Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.efm.symbex/.antlr-eclipse6
-rw-r--r--org.eclipse.efm.symbex/.cproject1030
-rw-r--r--org.eclipse.efm.symbex/.gitignore4
-rw-r--r--org.eclipse.efm.symbex/.project82
-rw-r--r--org.eclipse.efm.symbex/CHANGELOG.md1
-rw-r--r--org.eclipse.efm.symbex/CMakeLists.txt89
-rw-r--r--org.eclipse.efm.symbex/CONTRIBUTING.md3
-rw-r--r--org.eclipse.efm.symbex/README.md5
-rw-r--r--org.eclipse.efm.symbex/TODO.md1
-rw-r--r--org.eclipse.efm.symbex/about.html28
-rwxr-xr-xorg.eclipse.efm.symbex/cmake.sh16
-rw-r--r--org.eclipse.efm.symbex/cmake/BuildANTLR2.cmake50
-rw-r--r--org.eclipse.efm.symbex/cmake/BuildCVC4.cmake114
-rw-r--r--org.eclipse.efm.symbex/cmake/BuildCVC4.cmake.bak106
-rw-r--r--org.eclipse.efm.symbex/cmake/BuildGMP.cmake16
-rw-r--r--org.eclipse.efm.symbex/cmake/CodeCoverage.cmake200
-rw-r--r--org.eclipse.efm.symbex/cmake/DetectRevision.cmake15
-rw-r--r--org.eclipse.efm.symbex/cmake/DetectSystem.cmake34
-rw-r--r--org.eclipse.efm.symbex/cmake/DetectToolChain.cmake10
-rw-r--r--org.eclipse.efm.symbex/cmake/FindANTLR2.cmake28
-rw-r--r--org.eclipse.efm.symbex/cmake/FindANTLR3.cmake24
-rw-r--r--org.eclipse.efm.symbex/cmake/FindCVC4.cmake30
-rw-r--r--org.eclipse.efm.symbex/cmake/FindGMP.cmake44
-rw-r--r--org.eclipse.efm.symbex/cmake/GenericOptions.cmake19
-rw-r--r--org.eclipse.efm.symbex/cmake/InitCoverage.cmake9
-rw-r--r--org.eclipse.efm.symbex/cmake/LookForMandatoryPrereq.cmake83
-rw-r--r--org.eclipse.efm.symbex/cmake/LookForSCM.cmake27
-rw-r--r--org.eclipse.efm.symbex/cmake/PrintBanner.cmake34
-rw-r--r--org.eclipse.efm.symbex/cmake/SelectSpecificOptions.cmake10
-rw-r--r--org.eclipse.efm.symbex/cmake/SpecificOptions-Linux.cmake81
-rw-r--r--org.eclipse.efm.symbex/cmake/SpecificOptions-WinMSYS2.cmake50
-rw-r--r--org.eclipse.efm.symbex/cmake/SpecificOptions-WinMinGW.cmake28
-rw-r--r--org.eclipse.efm.symbex/cmake/antlr2-patch/lib/cpp/antlr/CharScanner.hpp588
-rw-r--r--org.eclipse.efm.symbex/cmake/antlr2-patch/scripts/config.guess1558
-rw-r--r--org.eclipse.efm.symbex/cmake/antlr2-patch/scripts/config.sub1791
-rw-r--r--org.eclipse.efm.symbex/cmake/cvc4-1.4-patch/config/boost-v2.m41560
-rw-r--r--org.eclipse.efm.symbex/cmake/cvc4-1.4-patch/config/boost.m41565
-rw-r--r--org.eclipse.efm.symbex/cmake/cvc4-1.4-patch/config/boost.m4.txt1560
-rw-r--r--org.eclipse.efm.symbex/cmake/cvc4-1.4-patch/options/options_template.cpp610
-rw-r--r--org.eclipse.efm.symbex/cmake/cvc4-1.4-patch/util/integer_gmp_imp.h520
-rw-r--r--org.eclipse.efm.symbex/cmake/cvc4-1.4-patch/util/rational_gmp_imp.h356
-rw-r--r--org.eclipse.efm.symbex/cmake/cvc4-master-patch/config/boost-v2.m41560
-rw-r--r--org.eclipse.efm.symbex/cmake/cvc4-master-patch/config/boost.m41565
-rw-r--r--org.eclipse.efm.symbex/cmake/cvc4-master-patch/config/boost.m4.txt1560
-rw-r--r--org.eclipse.efm.symbex/cmake/cvc4-master-patch/options/options_template.cpp835
-rw-r--r--org.eclipse.efm.symbex/cmake/cvc4-master-patch/util/integer_gmp_imp.h510
-rw-r--r--org.eclipse.efm.symbex/cmake/cvc4-master-patch/util/rational_gmp_imp.h355
-rw-r--r--org.eclipse.efm.symbex/cmake/cvc4-patch/config/boost-v2.m41560
-rw-r--r--org.eclipse.efm.symbex/cmake/cvc4-patch/config/boost.m41565
-rw-r--r--org.eclipse.efm.symbex/cmake/cvc4-patch/config/boost.m4.txt1560
-rw-r--r--org.eclipse.efm.symbex/cmake/cvc4-patch/options/options_template.cpp835
-rw-r--r--org.eclipse.efm.symbex/cmake/cvc4-patch/util/integer_gmp_imp.h520
-rw-r--r--org.eclipse.efm.symbex/cmake/cvc4-patch/util/rational_gmp_imp.h356
-rw-r--r--org.eclipse.efm.symbex/ftests/CMakeLists.txt27
-rw-r--r--org.eclipse.efm.symbex/ftests/CTestTestfile.cmake2
-rw-r--r--org.eclipse.efm.symbex/ftests/cmake/DefineSymbexFuncTestProject.cmake2
-rw-r--r--org.eclipse.efm.symbex/resources/doc/BUILD_WITH_CMAKE.md92
-rw-r--r--org.eclipse.efm.symbex/resources/doc/INSTALL_LINUX.md69
-rw-r--r--org.eclipse.efm.symbex/resources/doc/INSTALL_MSYS2.md166
-rw-r--r--org.eclipse.efm.symbex/resources/doc/INSTALL_SOLVERS.md546
-rw-r--r--org.eclipse.efm.symbex/resources/doc/README.md265
-rw-r--r--org.eclipse.efm.symbex/resources/doc/SYMBOLIC_EXECUTION_WORKFLOW.md313
-rw-r--r--org.eclipse.efm.symbex/src/CMakeLists.txt24
-rw-r--r--org.eclipse.efm.symbex/src/GUIDELINES.md6
-rw-r--r--org.eclipse.efm.symbex/src/README.md51
-rw-r--r--org.eclipse.efm.symbex/src/base/CMakeLists.txt17
-rw-r--r--org.eclipse.efm.symbex/src/base/ClassKindInfo.cpp870
-rw-r--r--org.eclipse.efm.symbex/src/base/ClassKindInfo.h618
-rw-r--r--org.eclipse.efm.symbex/src/base/InstanceCounter.h96
-rw-r--r--org.eclipse.efm.symbex/src/base/README.md12
-rw-r--r--org.eclipse.efm.symbex/src/base/ReferenceCounter.cpp22
-rw-r--r--org.eclipse.efm.symbex/src/base/ReferenceCounter.h157
-rw-r--r--org.eclipse.efm.symbex/src/base/SmartPointer.h406
-rw-r--r--org.eclipse.efm.symbex/src/base/SmartPointerUtil.cpp185
-rw-r--r--org.eclipse.efm.symbex/src/base/SmartPointerUtil.h74
-rw-r--r--org.eclipse.efm.symbex/src/base/SmartTable.h1147
-rw-r--r--org.eclipse.efm.symbex/src/builder/Builder.cpp999
-rw-r--r--org.eclipse.efm.symbex/src/builder/Builder.h229
-rw-r--r--org.eclipse.efm.symbex/src/builder/CMakeLists.txt19
-rw-r--r--org.eclipse.efm.symbex/src/builder/Loader.cpp1783
-rw-r--r--org.eclipse.efm.symbex/src/builder/Loader.h180
-rw-r--r--org.eclipse.efm.symbex/src/builder/README.md10
-rw-r--r--org.eclipse.efm.symbex/src/builder/analysis/CommunicationDependency.cpp839
-rw-r--r--org.eclipse.efm.symbex/src/builder/analysis/CommunicationDependency.h275
-rw-r--r--org.eclipse.efm.symbex/src/builder/analysis/MachineDependency.cpp126
-rw-r--r--org.eclipse.efm.symbex/src/builder/analysis/MachineDependency.h69
-rw-r--r--org.eclipse.efm.symbex/src/builder/analysis/TransitionReachability.cpp834
-rw-r--r--org.eclipse.efm.symbex/src/builder/analysis/TransitionReachability.h132
-rw-r--r--org.eclipse.efm.symbex/src/builder/compiler/BaseCompiler.cpp697
-rw-r--r--org.eclipse.efm.symbex/src/builder/compiler/BaseCompiler.h245
-rw-r--r--org.eclipse.efm.symbex/src/builder/compiler/BaseCompilerTable.h261
-rw-r--r--org.eclipse.efm.symbex/src/builder/compiler/BaseMachineCompiler.cpp765
-rw-r--r--org.eclipse.efm.symbex/src/builder/compiler/BaseMachineCompiler.h97
-rw-r--r--org.eclipse.efm.symbex/src/builder/compiler/Compiler.cpp3574
-rw-r--r--org.eclipse.efm.symbex/src/builder/compiler/Compiler.h209
-rw-r--r--org.eclipse.efm.symbex/src/builder/compiler/CompilerOfInteraction.cpp3086
-rw-r--r--org.eclipse.efm.symbex/src/builder/compiler/CompilerOfInteraction.h227
-rw-r--r--org.eclipse.efm.symbex/src/builder/compiler/CompilerOfProgram.cpp177
-rw-r--r--org.eclipse.efm.symbex/src/builder/compiler/CompilerOfProgram.h87
-rw-r--r--org.eclipse.efm.symbex/src/builder/compiler/CompilerOfTransition.cpp1420
-rw-r--r--org.eclipse.efm.symbex/src/builder/compiler/CompilerOfTransition.h128
-rw-r--r--org.eclipse.efm.symbex/src/builder/compiler/CompilerOfVariable.cpp953
-rw-r--r--org.eclipse.efm.symbex/src/builder/compiler/CompilerOfVariable.h113
-rw-r--r--org.eclipse.efm.symbex/src/builder/compiler/README.md10
-rw-r--r--org.eclipse.efm.symbex/src/builder/compiler/SymbolPredicate.h195
-rw-r--r--org.eclipse.efm.symbex/src/builder/compiler/SymbolTable.cpp2909
-rw-r--r--org.eclipse.efm.symbex/src/builder/compiler/SymbolTable.h923
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AbstractAvmcodeCompiler.cpp1939
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AbstractAvmcodeCompiler.h478
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeActivityCompiler.cpp1312
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeActivityCompiler.h95
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeAssignCompiler.cpp426
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeAssignCompiler.h48
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeCommunicationCompiler.cpp1182
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeCommunicationCompiler.h63
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeCompiler.cpp2937
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeCompiler.h417
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeContainerCompiler.cpp328
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeContainerCompiler.h38
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeCtorExpressionCompiler.cpp140
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeCtorExpressionCompiler.h31
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeExpressionCompiler.cpp1013
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeExpressionCompiler.h126
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeGinacCompiler.cpp25
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeGinacCompiler.h28
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeGuardCompiler.cpp217
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeGuardCompiler.h50
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeInvokeCompiler.cpp556
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeInvokeCompiler.h44
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeIteCompiler.cpp134
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeIteCompiler.h31
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeJumpCompiler.cpp167
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeJumpCompiler.h44
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeLambdaCompiler.cpp569
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeLambdaCompiler.h35
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeLookupExprCompiler.cpp43
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeLookupExprCompiler.h33
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeLoopCompiler.cpp181
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeLoopCompiler.h38
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeMachineStatusCompiler.cpp70
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeMachineStatusCompiler.h32
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeMathFunctionCompiler.cpp52
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeMathFunctionCompiler.h32
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeMetaStatementCompiler.cpp172
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeMetaStatementCompiler.h44
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeQueueCompiler.cpp482
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeQueueCompiler.h40
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeSchedulingCompiler.cpp98
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeSchedulingCompiler.h32
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeSequenceCompiler.cpp437
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeSequenceCompiler.h40
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeUfiCastExpressionCompiler.cpp867
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeUfiCastExpressionCompiler.h40
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeVariableStatusCompiler.cpp36
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/AvmcodeVariableStatusCompiler.h32
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/CompilationEnvironment.cpp318
-rw-r--r--org.eclipse.efm.symbex/src/builder/primitive/CompilationEnvironment.h441
-rw-r--r--org.eclipse.efm.symbex/src/cmake/DefineSymbexProject.cmake42
-rw-r--r--org.eclipse.efm.symbex/src/cmake/GenerateInfoHeaders.cmake13
-rw-r--r--org.eclipse.efm.symbex/src/cmake/INSTALL_tmp-toc.xml44
-rw-r--r--org.eclipse.efm.symbex/src/cmake/INSTALL_tmp.html231
-rw-r--r--org.eclipse.efm.symbex/src/cmake/INSTALL_tmp.md135
-rw-r--r--org.eclipse.efm.symbex/src/cmake/INSTALL_tmp.xml308
-rw-r--r--org.eclipse.efm.symbex/src/cmake/PrintBanner.cmake7
-rw-r--r--org.eclipse.efm.symbex/src/collection/Array.h554
-rw-r--r--org.eclipse.efm.symbex/src/collection/BFContainer.cpp23
-rw-r--r--org.eclipse.efm.symbex/src/collection/BFContainer.h958
-rw-r--r--org.eclipse.efm.symbex/src/collection/Bitset.h127
-rw-r--r--org.eclipse.efm.symbex/src/collection/CMakeLists.txt13
-rw-r--r--org.eclipse.efm.symbex/src/collection/Collection.h167
-rw-r--r--org.eclipse.efm.symbex/src/collection/List.h748
-rw-r--r--org.eclipse.efm.symbex/src/collection/Multiset.h274
-rw-r--r--org.eclipse.efm.symbex/src/collection/Pair.h215
-rw-r--r--org.eclipse.efm.symbex/src/collection/README.md16
-rw-r--r--org.eclipse.efm.symbex/src/collection/Set.h190
-rw-r--r--org.eclipse.efm.symbex/src/collection/Typedef.h182
-rw-r--r--org.eclipse.efm.symbex/src/collection/Vector.h1008
-rw-r--r--org.eclipse.efm.symbex/src/common/AvmObject.cpp22
-rw-r--r--org.eclipse.efm.symbex/src/common/AvmObject.h180
-rw-r--r--org.eclipse.efm.symbex/src/common/AvmPointer.cpp22
-rw-r--r--org.eclipse.efm.symbex/src/common/AvmPointer.h352
-rw-r--r--org.eclipse.efm.symbex/src/common/BF.cpp561
-rw-r--r--org.eclipse.efm.symbex/src/common/BF.h951
-rw-r--r--org.eclipse.efm.symbex/src/common/CMakeLists.txt18
-rw-r--r--org.eclipse.efm.symbex/src/common/Element.cpp111
-rw-r--r--org.eclipse.efm.symbex/src/common/Element.h263
-rw-r--r--org.eclipse.efm.symbex/src/common/NamedElement.cpp293
-rw-r--r--org.eclipse.efm.symbex/src/common/NamedElement.h580
-rw-r--r--org.eclipse.efm.symbex/src/common/README.md18
-rw-r--r--org.eclipse.efm.symbex/src/common/RunnableElement.cpp231
-rw-r--r--org.eclipse.efm.symbex/src/common/RunnableElement.h581
-rw-r--r--org.eclipse.efm.symbex/src/common/SerializerFeature.cpp674
-rw-r--r--org.eclipse.efm.symbex/src/common/SerializerFeature.h537
-rw-r--r--org.eclipse.efm.symbex/src/computer/BaseEnvironment.cpp2118
-rw-r--r--org.eclipse.efm.symbex/src/computer/BaseEnvironment.h558
-rw-r--r--org.eclipse.efm.symbex/src/computer/CMakeLists.txt20
-rw-r--r--org.eclipse.efm.symbex/src/computer/EnvironmentFactory.cpp40
-rw-r--r--org.eclipse.efm.symbex/src/computer/EnvironmentFactory.h36
-rw-r--r--org.eclipse.efm.symbex/src/computer/EvaluationEnvironment.cpp334
-rw-r--r--org.eclipse.efm.symbex/src/computer/EvaluationEnvironment.h275
-rw-r--r--org.eclipse.efm.symbex/src/computer/ExecutionDataFactory.cpp212
-rw-r--r--org.eclipse.efm.symbex/src/computer/ExecutionDataFactory.h64
-rw-r--r--org.eclipse.efm.symbex/src/computer/ExecutionEnvironment.cpp492
-rw-r--r--org.eclipse.efm.symbex/src/computer/ExecutionEnvironment.h760
-rw-r--r--org.eclipse.efm.symbex/src/computer/PathConditionProcessor.cpp615
-rw-r--r--org.eclipse.efm.symbex/src/computer/PathConditionProcessor.h127
-rw-r--r--org.eclipse.efm.symbex/src/computer/instruction/AvmBytecode.cpp496
-rw-r--r--org.eclipse.efm.symbex/src/computer/instruction/AvmBytecode.h623
-rw-r--r--org.eclipse.efm.symbex/src/computer/instruction/AvmInstruction.cpp183
-rw-r--r--org.eclipse.efm.symbex/src/computer/instruction/AvmInstruction.h632
-rw-r--r--org.eclipse.efm.symbex/src/computer/instruction/InstructionEnvironment.cpp4570
-rw-r--r--org.eclipse.efm.symbex/src/computer/instruction/InstructionEnvironment.h430
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmActivityPrimitive.cpp2042
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmActivityPrimitive.h150
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmAssignPrimitive.cpp451
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmAssignPrimitive.h47
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmBaseConcurrencyPrimitive.cpp146
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmBaseConcurrencyPrimitive.h43
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmBitwisePrimitive.cpp303
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmBitwisePrimitive.h39
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmBufferPrimitive.cpp1215
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmBufferPrimitive.h53
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmCommunicationFactory.cpp1532
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmCommunicationFactory.h271
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmCommunicationPrimitive.cpp850
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmCommunicationPrimitive.h74
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmCommunicationRdvPrimitive.cpp1802
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmCommunicationRdvPrimitive.h435
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmConcurrencyPrimitive.cpp1192
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmConcurrencyPrimitive.h102
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmCtorPrimitive.cpp51
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmCtorPrimitive.h30
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmExpressionPrimitive.cpp119
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmExpressionPrimitive.h31
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmGuardPrimitive.cpp253
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmGuardPrimitive.h36
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmInputEnabledPrimitive.cpp298
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmInputEnabledPrimitive.h39
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmInvokePrimitive.cpp1454
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmInvokePrimitive.h77
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmItePrimitive.cpp171
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmItePrimitive.h32
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmIterationPrimitive.cpp869
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmIterationPrimitive.h43
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmJumpPrimitive.cpp140
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmJumpPrimitive.h40
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmLookupPrimitive.cpp632
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmLookupPrimitive.h69
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmMathPrimitive.cpp379
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmMathPrimitive.h74
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmMetaPrimitive.cpp303
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmMetaPrimitive.h44
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmPrimitiveProcessor.cpp1766
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmPrimitiveProcessor.h196
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmSchedulingPrimitive.cpp378
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmSchedulingPrimitive.h42
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmSequencePrimitive.cpp612
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmSequencePrimitive.h52
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmStatusPrimitive.cpp614
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmStatusPrimitive.h38
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmSynchronizationFactory.cpp1551
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/AvmSynchronizationFactory.h118
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/BaseAvmPrimitive.cpp139
-rw-r--r--org.eclipse.efm.symbex/src/computer/primitive/BaseAvmPrimitive.h179
-rw-r--r--org.eclipse.efm.symbex/src/fam/CMakeLists.txt23
-rw-r--r--org.eclipse.efm.symbex/src/fam/README.md133
-rw-r--r--org.eclipse.efm.symbex/src/fam/api/AbstractProcessorUnit.cpp957
-rw-r--r--org.eclipse.efm.symbex/src/fam/api/AbstractProcessorUnit.h1454
-rw-r--r--org.eclipse.efm.symbex/src/fam/api/CompositeControllerUnit.cpp469
-rw-r--r--org.eclipse.efm.symbex/src/fam/api/CompositeControllerUnit.h228
-rw-r--r--org.eclipse.efm.symbex/src/fam/api/ExtenderProcessorUnit.cpp154
-rw-r--r--org.eclipse.efm.symbex/src/fam/api/ExtenderProcessorUnit.h109
-rw-r--r--org.eclipse.efm.symbex/src/fam/api/IProcessorUnitTest.cpp100
-rw-r--r--org.eclipse.efm.symbex/src/fam/api/IProcessorUnitTest.h118
-rw-r--r--org.eclipse.efm.symbex/src/fam/api/MainProcessorUnit.cpp1074
-rw-r--r--org.eclipse.efm.symbex/src/fam/api/MainProcessorUnit.h312
-rw-r--r--org.eclipse.efm.symbex/src/fam/api/ProcessorUnitAutoRegistration.cpp65
-rw-r--r--org.eclipse.efm.symbex/src/fam/api/ProcessorUnitAutoRegistration.h151
-rw-r--r--org.eclipse.efm.symbex/src/fam/api/ProcessorUnitFactory.cpp375
-rw-r--r--org.eclipse.efm.symbex/src/fam/api/ProcessorUnitFactory.h69
-rw-r--r--org.eclipse.efm.symbex/src/fam/api/ProcessorUnitRepository.cpp243
-rw-r--r--org.eclipse.efm.symbex/src/fam/api/ProcessorUnitRepository.h92
-rw-r--r--org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageAbstractView.cpp49
-rw-r--r--org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageAbstractView.h153
-rw-r--r--org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageDirectiveTraceBuilder.cpp1123
-rw-r--r--org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageDirectiveTraceBuilder.h544
-rw-r--r--org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageHeuristicProperty.cpp305
-rw-r--r--org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageHeuristicProperty.h307
-rw-r--r--org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageOneTraceDriver.cpp779
-rw-r--r--org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageOneTraceDriver.h232
-rw-r--r--org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageProcessor.cpp670
-rw-r--r--org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageProcessor.h200
-rw-r--r--org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageStatistics.h446
-rw-r--r--org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageTraceDriver.cpp213
-rw-r--r--org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageTraceDriver.h141
-rw-r--r--org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageTraceView.cpp22
-rw-r--r--org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageTraceView.h103
-rw-r--r--org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageTransitionView.cpp3478
-rw-r--r--org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageTransitionView.h317
-rw-r--r--org.eclipse.efm.symbex/src/fam/coverage/BaseCoverageFilter.cpp323
-rw-r--r--org.eclipse.efm.symbex/src/fam/coverage/BaseCoverageFilter.h314
-rw-r--r--org.eclipse.efm.symbex/src/fam/coverage/FormulaCoverageFilter.cpp1283
-rw-r--r--org.eclipse.efm.symbex/src/fam/coverage/FormulaCoverageFilter.h443
-rw-r--r--org.eclipse.efm.symbex/src/fam/coverage/StatemachineReachability.cpp371
-rw-r--r--org.eclipse.efm.symbex/src/fam/coverage/StatemachineReachability.h104
-rw-r--r--org.eclipse.efm.symbex/src/fam/coverage/TransitionCoverageFilter.cpp3055
-rw-r--r--org.eclipse.efm.symbex/src/fam/coverage/TransitionCoverageFilter.h341
-rw-r--r--org.eclipse.efm.symbex/src/fam/debug/AvmDebugProcessor.cpp187
-rw-r--r--org.eclipse.efm.symbex/src/fam/debug/AvmDebugProcessor.h173
-rw-r--r--org.eclipse.efm.symbex/src/fam/debug/IDebugProcessorProvider.cpp3399
-rw-r--r--org.eclipse.efm.symbex/src/fam/debug/IDebugProcessorProvider.h659
-rw-r--r--org.eclipse.efm.symbex/src/fam/hitorjump/AvmHitOrJumpProcessor.cpp1290
-rw-r--r--org.eclipse.efm.symbex/src/fam/hitorjump/AvmHitOrJumpProcessor.h443
-rw-r--r--org.eclipse.efm.symbex/src/fam/hitorjump/BaseHitProcessor.cpp380
-rw-r--r--org.eclipse.efm.symbex/src/fam/hitorjump/BaseHitProcessor.h230
-rw-r--r--org.eclipse.efm.symbex/src/fam/hitorjump/HitOrderedProcessor.cpp401
-rw-r--r--org.eclipse.efm.symbex/src/fam/hitorjump/HitOrderedProcessor.h98
-rw-r--r--org.eclipse.efm.symbex/src/fam/hitorjump/HitUnorderedProcessor.cpp447
-rw-r--r--org.eclipse.efm.symbex/src/fam/hitorjump/HitUnorderedProcessor.h106
-rw-r--r--org.eclipse.efm.symbex/src/fam/queue/ExecutionQueue.cpp998
-rw-r--r--org.eclipse.efm.symbex/src/fam/queue/ExecutionQueue.h723
-rw-r--r--org.eclipse.efm.symbex/src/fam/queue/WaitingBasicStrategy.h271
-rw-r--r--org.eclipse.efm.symbex/src/fam/queue/WaitingStrategy.h761
-rw-r--r--org.eclipse.efm.symbex/src/fam/queue/WaitingStrategyBLOCK.h691
-rw-r--r--org.eclipse.efm.symbex/src/fam/queue/WaitingStrategyWEIGHT.h155
-rw-r--r--org.eclipse.efm.symbex/src/fam/redundancy/BaseDataComparator.cpp1227
-rw-r--r--org.eclipse.efm.symbex/src/fam/redundancy/BaseDataComparator.h429
-rw-r--r--org.eclipse.efm.symbex/src/fam/redundancy/ConfigurationComparator.cpp354
-rw-r--r--org.eclipse.efm.symbex/src/fam/redundancy/ConfigurationComparator.h230
-rw-r--r--org.eclipse.efm.symbex/src/fam/redundancy/DataSolverComparator.cpp185
-rw-r--r--org.eclipse.efm.symbex/src/fam/redundancy/DataSolverComparator.h184
-rw-r--r--org.eclipse.efm.symbex/src/fam/redundancy/DataSyntaxicEquivalence.cpp194
-rw-r--r--org.eclipse.efm.symbex/src/fam/redundancy/DataSyntaxicEquivalence.h120
-rw-r--r--org.eclipse.efm.symbex/src/fam/redundancy/PathScopeIterator.h464
-rw-r--r--org.eclipse.efm.symbex/src/fam/redundancy/RedundancyFilter.cpp609
-rw-r--r--org.eclipse.efm.symbex/src/fam/redundancy/RedundancyFilter.h234
-rw-r--r--org.eclipse.efm.symbex/src/fam/serializer/GraphVizExecutionGraphSerializer.cpp1703
-rw-r--r--org.eclipse.efm.symbex/src/fam/serializer/GraphVizExecutionGraphSerializer.h432
-rw-r--r--org.eclipse.efm.symbex/src/fam/serializer/GraphVizStatemachineSerializer.cpp940
-rw-r--r--org.eclipse.efm.symbex/src/fam/serializer/GraphVizStatemachineSerializer.h208
-rw-r--r--org.eclipse.efm.symbex/src/fam/serializer/Serializer.cpp98
-rw-r--r--org.eclipse.efm.symbex/src/fam/serializer/Serializer.h166
-rw-r--r--org.eclipse.efm.symbex/src/fam/testing/OfflineTestProcessor.cpp3116
-rw-r--r--org.eclipse.efm.symbex/src/fam/testing/OfflineTestProcessor.h592
-rw-r--r--org.eclipse.efm.symbex/src/fam/trace/AbstractTraceBuilder.cpp58
-rw-r--r--org.eclipse.efm.symbex/src/fam/trace/AbstractTraceBuilder.h83
-rw-r--r--org.eclipse.efm.symbex/src/fam/trace/AbstractTraceFormatter.cpp106
-rw-r--r--org.eclipse.efm.symbex/src/fam/trace/AbstractTraceFormatter.h101
-rw-r--r--org.eclipse.efm.symbex/src/fam/trace/AvmTraceGenerator.cpp312
-rw-r--r--org.eclipse.efm.symbex/src/fam/trace/AvmTraceGenerator.h166
-rw-r--r--org.eclipse.efm.symbex/src/fam/trace/BasicTraceBuilder.cpp762
-rw-r--r--org.eclipse.efm.symbex/src/fam/trace/BasicTraceBuilder.h134
-rw-r--r--org.eclipse.efm.symbex/src/fam/trace/BasicTraceFormatter.cpp1012
-rw-r--r--org.eclipse.efm.symbex/src/fam/trace/BasicTraceFormatter.h261
-rw-r--r--org.eclipse.efm.symbex/src/fam/trace/TTCNTitanTraceFormatter.cpp1342
-rw-r--r--org.eclipse.efm.symbex/src/fam/trace/TTCNTitanTraceFormatter.h261
-rw-r--r--org.eclipse.efm.symbex/src/fam/trace/TTCNTraceFormatter.cpp1084
-rw-r--r--org.eclipse.efm.symbex/src/fam/trace/TTCNTraceFormatter.h186
-rw-r--r--org.eclipse.efm.symbex/src/fam/trace/TraceManager.cpp41
-rw-r--r--org.eclipse.efm.symbex/src/fam/trace/TraceManager.h118
-rw-r--r--org.eclipse.efm.symbex/src/fam/trace/TraceNormalizer.cpp205
-rw-r--r--org.eclipse.efm.symbex/src/fam/trace/TraceNormalizer.h64
-rw-r--r--org.eclipse.efm.symbex/src/fam/trace/TraceNumerizer.cpp287
-rw-r--r--org.eclipse.efm.symbex/src/fam/trace/TraceNumerizer.h104
-rw-r--r--org.eclipse.efm.symbex/src/fml/CMakeLists.txt21
-rw-r--r--org.eclipse.efm.symbex/src/fml/README.md43
-rw-r--r--org.eclipse.efm.symbex/src/fml/buffer/BaseBufferForm.cpp19
-rw-r--r--org.eclipse.efm.symbex/src/fml/buffer/BaseBufferForm.h220
-rw-r--r--org.eclipse.efm.symbex/src/fml/buffer/BaseBufferQueue.cpp217
-rw-r--r--org.eclipse.efm.symbex/src/fml/buffer/BaseBufferQueue.h351
-rw-r--r--org.eclipse.efm.symbex/src/fml/buffer/BroadcastBuffer.cpp70
-rw-r--r--org.eclipse.efm.symbex/src/fml/buffer/BroadcastBuffer.h106
-rw-r--r--org.eclipse.efm.symbex/src/fml/buffer/FifoBuffer.cpp20
-rw-r--r--org.eclipse.efm.symbex/src/fml/buffer/FifoBuffer.h249
-rw-r--r--org.eclipse.efm.symbex/src/fml/buffer/LifoBuffer.cpp20
-rw-r--r--org.eclipse.efm.symbex/src/fml/buffer/LifoBuffer.h251
-rw-r--r--org.eclipse.efm.symbex/src/fml/buffer/MultiFifoBuffer.cpp21
-rw-r--r--org.eclipse.efm.symbex/src/fml/buffer/MultiFifoBuffer.h281
-rw-r--r--org.eclipse.efm.symbex/src/fml/buffer/MultiLifoBuffer.cpp21
-rw-r--r--org.eclipse.efm.symbex/src/fml/buffer/MultiLifoBuffer.h272
-rw-r--r--org.eclipse.efm.symbex/src/fml/buffer/MultisetBuffer.cpp20
-rw-r--r--org.eclipse.efm.symbex/src/fml/buffer/MultisetBuffer.h203
-rw-r--r--org.eclipse.efm.symbex/src/fml/buffer/RamBuffer.cpp103
-rw-r--r--org.eclipse.efm.symbex/src/fml/buffer/RamBuffer.h333
-rw-r--r--org.eclipse.efm.symbex/src/fml/buffer/SetBuffer.cpp20
-rw-r--r--org.eclipse.efm.symbex/src/fml/buffer/SetBuffer.h214
-rw-r--r--org.eclipse.efm.symbex/src/fml/builtin/Boolean.cpp22
-rw-r--r--org.eclipse.efm.symbex/src/fml/builtin/Boolean.h125
-rw-r--r--org.eclipse.efm.symbex/src/fml/builtin/BuiltinForm.cpp18
-rw-r--r--org.eclipse.efm.symbex/src/fml/builtin/BuiltinForm.h236
-rw-r--r--org.eclipse.efm.symbex/src/fml/builtin/Character.cpp19
-rw-r--r--org.eclipse.efm.symbex/src/fml/builtin/Character.h103
-rw-r--r--org.eclipse.efm.symbex/src/fml/builtin/Identifier.cpp18
-rw-r--r--org.eclipse.efm.symbex/src/fml/builtin/Identifier.h91
-rw-r--r--org.eclipse.efm.symbex/src/fml/builtin/QualifiedIdentifier.cpp20
-rw-r--r--org.eclipse.efm.symbex/src/fml/builtin/QualifiedIdentifier.h178
-rw-r--r--org.eclipse.efm.symbex/src/fml/builtin/String.cpp37
-rw-r--r--org.eclipse.efm.symbex/src/fml/builtin/String.h211
-rw-r--r--org.eclipse.efm.symbex/src/fml/common/BasePointer.cpp22
-rw-r--r--org.eclipse.efm.symbex/src/fml/common/BasePointer.h348
-rw-r--r--org.eclipse.efm.symbex/src/fml/common/BehavioralElement.cpp24
-rw-r--r--org.eclipse.efm.symbex/src/fml/common/BehavioralElement.h89
-rw-r--r--org.eclipse.efm.symbex/src/fml/common/CompiledElement.cpp23
-rw-r--r--org.eclipse.efm.symbex/src/fml/common/CompiledElement.h115
-rw-r--r--org.eclipse.efm.symbex/src/fml/common/LocationElement.cpp25
-rw-r--r--org.eclipse.efm.symbex/src/fml/common/LocationElement.h409
-rw-r--r--org.eclipse.efm.symbex/src/fml/common/ModifierElement.cpp382
-rw-r--r--org.eclipse.efm.symbex/src/fml/common/ModifierElement.h1681
-rw-r--r--org.eclipse.efm.symbex/src/fml/common/ObjectClassifier.cpp31
-rw-r--r--org.eclipse.efm.symbex/src/fml/common/ObjectClassifier.h94
-rw-r--r--org.eclipse.efm.symbex/src/fml/common/ObjectElement.cpp92
-rw-r--r--org.eclipse.efm.symbex/src/fml/common/ObjectElement.h335
-rw-r--r--org.eclipse.efm.symbex/src/fml/common/PropertyElement.cpp33
-rw-r--r--org.eclipse.efm.symbex/src/fml/common/PropertyElement.h106
-rw-r--r--org.eclipse.efm.symbex/src/fml/common/README.md13
-rw-r--r--org.eclipse.efm.symbex/src/fml/common/SpecifierElement.cpp802
-rw-r--r--org.eclipse.efm.symbex/src/fml/common/SpecifierElement.h2658
-rw-r--r--org.eclipse.efm.symbex/src/fml/common/TraceableElement.cpp23
-rw-r--r--org.eclipse.efm.symbex/src/fml/common/TraceableElement.h390
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/AvmLambda.cpp245
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/AvmLambda.h240
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/AvmProgram.cpp491
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/AvmProgram.h1275
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/AvmTransition.cpp296
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/AvmTransition.h210
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/BaseAvmProgram.cpp367
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/BaseAvmProgram.h599
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/BaseCompiledForm.cpp162
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/BaseCompiledForm.h231
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/BaseInstanceForm.cpp69
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/BaseInstanceForm.h555
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/ComRouteData.cpp90
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/ComRouteData.h204
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/ExecutableForm.cpp1501
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/ExecutableForm.h2466
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/ExecutableLib.cpp192
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/ExecutableLib.h99
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/ExecutableQuery.cpp1138
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/ExecutableQuery.h303
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/ExecutableSystem.cpp110
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/ExecutableSystem.h288
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/InstanceOfBuffer.cpp172
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/InstanceOfBuffer.h158
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/InstanceOfConnect.cpp144
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/InstanceOfConnect.h262
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/InstanceOfData.cpp502
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/InstanceOfData.h833
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/InstanceOfMachine.cpp488
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/InstanceOfMachine.h731
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/InstanceOfPort.cpp318
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/InstanceOfPort.h422
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/Router.cpp238
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/Router.h377
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/RoutingData.cpp128
-rw-r--r--org.eclipse.efm.symbex/src/fml/executable/RoutingData.h406
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/AvmCode.cpp1427
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/AvmCode.h1182
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/AvmCodeFactory.cpp189
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/AvmCodeFactory.h440
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/BuiltinArray.cpp836
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/BuiltinArray.h1403
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/BuiltinContainer.cpp200
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/BuiltinContainer.h1064
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/BuiltinQueue.cpp22
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/BuiltinQueue.h432
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/ExpressionComparer.cpp285
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/ExpressionComparer.h71
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/ExpressionConstant.cpp97
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/ExpressionConstant.h59
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/ExpressionConstructor.cpp476
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/ExpressionConstructor.h864
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/ExpressionConstructorImpl.cpp1492
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/ExpressionConstructorImpl.h696
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/ExpressionEval.cpp586
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/ExpressionEval.h86
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/ExpressionFactory.cpp1272
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/ExpressionFactory.h185
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/ExpressionSimplifier.cpp620
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/ExpressionSimplifier.h115
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/ExpressionTypeChecker.cpp1325
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/ExpressionTypeChecker.h256
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/README.md13
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/StatementConstructor.cpp22
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/StatementConstructor.h44
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/StatementFactory.cpp391
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/StatementFactory.h121
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/StatementTypeChecker.cpp23
-rw-r--r--org.eclipse.efm.symbex/src/fml/expression/StatementTypeChecker.h239
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/BehavioralPart.cpp294
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/BehavioralPart.h982
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/Buffer.cpp230
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/Buffer.h158
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/Channel.cpp123
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/Channel.h117
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/ComPoint.cpp60
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/ComPoint.h184
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/ComProtocol.cpp314
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/ComProtocol.h274
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/ComRoute.cpp87
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/ComRoute.h102
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/CompositePart.cpp325
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/CompositePart.h361
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/Connector.cpp69
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/Connector.h136
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/DataType.cpp792
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/DataType.h572
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/InstanceSpecifierPart.cpp172
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/InstanceSpecifierPart.h203
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/InteractionPart.cpp63
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/InteractionPart.h126
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/Machine.cpp673
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/Machine.h664
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/MachineQuery.cpp807
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/MachineQuery.h176
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/ModelOfComputationPart.cpp46
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/ModelOfComputationPart.h68
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/Package.cpp69
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/Package.h123
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/Port.cpp180
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/Port.h210
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/PropertyPart.cpp198
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/PropertyPart.h596
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/README.md80
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/Routine.cpp504
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/Routine.h410
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/System.cpp63
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/System.h122
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/Transition.cpp365
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/Transition.h378
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/TransitionMoc.cpp266
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/TransitionMoc.h321
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/Variable.cpp195
-rw-r--r--org.eclipse.efm.symbex/src/fml/infrastructure/Variable.h344
-rw-r--r--org.eclipse.efm.symbex/src/fml/lib/AvmAnalysis.cpp41
-rw-r--r--org.eclipse.efm.symbex/src/fml/lib/AvmAnalysis.h52
-rw-r--r--org.eclipse.efm.symbex/src/fml/lib/AvmLang.cpp146
-rw-r--r--org.eclipse.efm.symbex/src/fml/lib/AvmLang.h194
-rw-r--r--org.eclipse.efm.symbex/src/fml/lib/AvmOperationExpression.cpp84
-rw-r--r--org.eclipse.efm.symbex/src/fml/lib/AvmOperationExpression.h100
-rw-r--r--org.eclipse.efm.symbex/src/fml/lib/AvmOperationFactory.cpp244
-rw-r--r--org.eclipse.efm.symbex/src/fml/lib/AvmOperationFactory.h102
-rw-r--r--org.eclipse.efm.symbex/src/fml/lib/AvmOperationMachine.cpp153
-rw-r--r--org.eclipse.efm.symbex/src/fml/lib/AvmOperationMachine.h169
-rw-r--r--org.eclipse.efm.symbex/src/fml/lib/AvmOperationVariable.cpp402
-rw-r--r--org.eclipse.efm.symbex/src/fml/lib/AvmOperationVariable.h229
-rw-r--r--org.eclipse.efm.symbex/src/fml/lib/IComPoint.cpp71
-rw-r--r--org.eclipse.efm.symbex/src/fml/lib/IComPoint.h109
-rw-r--r--org.eclipse.efm.symbex/src/fml/lib/ITracePoint.cpp311
-rw-r--r--org.eclipse.efm.symbex/src/fml/lib/ITracePoint.h135
-rw-r--r--org.eclipse.efm.symbex/src/fml/lib/ITypeSpecifier.cpp513
-rw-r--r--org.eclipse.efm.symbex/src/fml/lib/ITypeSpecifier.h964
-rw-r--r--org.eclipse.efm.symbex/src/fml/numeric/Float.cpp21
-rw-r--r--org.eclipse.efm.symbex/src/fml/numeric/Float.h37
-rw-r--r--org.eclipse.efm.symbex/src/fml/numeric/Integer.cpp21
-rw-r--r--org.eclipse.efm.symbex/src/fml/numeric/Integer.h38
-rw-r--r--org.eclipse.efm.symbex/src/fml/numeric/Number.cpp22
-rw-r--r--org.eclipse.efm.symbex/src/fml/numeric/Number.h408
-rw-r--r--org.eclipse.efm.symbex/src/fml/numeric/Numeric.cpp24
-rw-r--r--org.eclipse.efm.symbex/src/fml/numeric/Numeric.h1510
-rw-r--r--org.eclipse.efm.symbex/src/fml/numeric/README.md16
-rw-r--r--org.eclipse.efm.symbex/src/fml/numeric/Rational.cpp23
-rw-r--r--org.eclipse.efm.symbex/src/fml/numeric/Rational.h40
-rw-r--r--org.eclipse.efm.symbex/src/fml/numeric/basic/FloatImpl.h379
-rw-r--r--org.eclipse.efm.symbex/src/fml/numeric/basic/IntegerImpl.h331
-rw-r--r--org.eclipse.efm.symbex/src/fml/numeric/basic/NumericImpl.h697
-rw-r--r--org.eclipse.efm.symbex/src/fml/numeric/basic/RationalImpl.h818
-rw-r--r--org.eclipse.efm.symbex/src/fml/numeric/boost/FloatImpl.h404
-rw-r--r--org.eclipse.efm.symbex/src/fml/numeric/boost/IntegerImpl.h349
-rw-r--r--org.eclipse.efm.symbex/src/fml/numeric/boost/NumericImpl.h705
-rw-r--r--org.eclipse.efm.symbex/src/fml/numeric/boost/RationalImpl.h539
-rw-r--r--org.eclipse.efm.symbex/src/fml/numeric/gmp/FloatImpl.h407
-rw-r--r--org.eclipse.efm.symbex/src/fml/numeric/gmp/IntegerImpl.h375
-rw-r--r--org.eclipse.efm.symbex/src/fml/numeric/gmp/NumericImpl.h698
-rw-r--r--org.eclipse.efm.symbex/src/fml/numeric/gmp/RationalImpl.h561
-rw-r--r--org.eclipse.efm.symbex/src/fml/operator/Operator.cpp93
-rw-r--r--org.eclipse.efm.symbex/src/fml/operator/Operator.h274
-rw-r--r--org.eclipse.efm.symbex/src/fml/operator/OperatorLib.cpp328
-rw-r--r--org.eclipse.efm.symbex/src/fml/operator/OperatorLib.h837
-rw-r--r--org.eclipse.efm.symbex/src/fml/operator/OperatorManager.cpp2780
-rw-r--r--org.eclipse.efm.symbex/src/fml/operator/OperatorManager.h782
-rw-r--r--org.eclipse.efm.symbex/src/fml/operator/README.md12
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/ExecutionConfiguration.cpp66
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/ExecutionConfiguration.h287
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/ExecutionContext.cpp875
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/ExecutionContext.h1318
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/ExecutionContextFlags.cpp179
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/ExecutionContextFlags.h1029
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/ExecutionData.cpp1027
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/ExecutionData.h1646
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/ExecutionInformation.cpp666
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/ExecutionInformation.h531
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/ExecutionLocation.cpp71
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/ExecutionLocation.h272
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/ExecutionSynchronizationPoint.cpp90
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/ExecutionSynchronizationPoint.h170
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/LocalRuntime.cpp62
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/LocalRuntime.h353
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/Message.cpp254
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/Message.h620
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/README.md34
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/RuntimeDef.cpp219
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/RuntimeDef.h152
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/RuntimeForm.cpp777
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/RuntimeForm.h821
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/RuntimeID.cpp550
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/RuntimeID.h1001
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/RuntimeLib.cpp65
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/RuntimeLib.h70
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/RuntimeQuery.cpp855
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/RuntimeQuery.h150
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/TableOfData.cpp343
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/TableOfData.h171
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/TableOfRuntimeFormState.cpp248
-rw-r--r--org.eclipse.efm.symbex/src/fml/runtime/TableOfRuntimeFormState.h658
-rw-r--r--org.eclipse.efm.symbex/src/fml/symbol/README.md16
-rw-r--r--org.eclipse.efm.symbex/src/fml/symbol/Symbol.cpp597
-rw-r--r--org.eclipse.efm.symbex/src/fml/symbol/Symbol.h747
-rw-r--r--org.eclipse.efm.symbex/src/fml/symbol/TableOfSymbol.cpp209
-rw-r--r--org.eclipse.efm.symbex/src/fml/symbol/TableOfSymbol.h224
-rw-r--r--org.eclipse.efm.symbex/src/fml/template/TemplateFactory.cpp45
-rw-r--r--org.eclipse.efm.symbex/src/fml/template/TemplateFactory.h37
-rw-r--r--org.eclipse.efm.symbex/src/fml/template/TimedMachine.cpp345
-rw-r--r--org.eclipse.efm.symbex/src/fml/template/TimedMachine.h70
-rw-r--r--org.eclipse.efm.symbex/src/fml/trace/BasicTraceParser.cpp583
-rw-r--r--org.eclipse.efm.symbex/src/fml/trace/BasicTraceParser.h114
-rw-r--r--org.eclipse.efm.symbex/src/fml/trace/TraceChecker.cpp1285
-rw-r--r--org.eclipse.efm.symbex/src/fml/trace/TraceChecker.h171
-rw-r--r--org.eclipse.efm.symbex/src/fml/trace/TraceFactory.cpp1326
-rw-r--r--org.eclipse.efm.symbex/src/fml/trace/TraceFactory.h248
-rw-r--r--org.eclipse.efm.symbex/src/fml/trace/TraceFilter.cpp1019
-rw-r--r--org.eclipse.efm.symbex/src/fml/trace/TraceFilter.h648
-rw-r--r--org.eclipse.efm.symbex/src/fml/trace/TracePoint.cpp1880
-rw-r--r--org.eclipse.efm.symbex/src/fml/trace/TracePoint.h555
-rw-r--r--org.eclipse.efm.symbex/src/fml/trace/TraceSequence.cpp371
-rw-r--r--org.eclipse.efm.symbex/src/fml/trace/TraceSequence.h227
-rw-r--r--org.eclipse.efm.symbex/src/fml/type/BaseSymbolTypeSpecifier.cpp23
-rw-r--r--org.eclipse.efm.symbex/src/fml/type/BaseSymbolTypeSpecifier.h181
-rw-r--r--org.eclipse.efm.symbex/src/fml/type/BaseTypeSpecifier.cpp381
-rw-r--r--org.eclipse.efm.symbex/src/fml/type/BaseTypeSpecifier.h468
-rw-r--r--org.eclipse.efm.symbex/src/fml/type/ChoiceTypeSpecifier.cpp69
-rw-r--r--org.eclipse.efm.symbex/src/fml/type/ChoiceTypeSpecifier.h67
-rw-r--r--org.eclipse.efm.symbex/src/fml/type/ClassTypeSpecifier.cpp103
-rw-r--r--org.eclipse.efm.symbex/src/fml/type/ClassTypeSpecifier.h77
-rw-r--r--org.eclipse.efm.symbex/src/fml/type/ContainerTypeSpecifier.cpp232
-rw-r--r--org.eclipse.efm.symbex/src/fml/type/ContainerTypeSpecifier.h150
-rw-r--r--org.eclipse.efm.symbex/src/fml/type/EnumTypeSpecifier.cpp300
-rw-r--r--org.eclipse.efm.symbex/src/fml/type/EnumTypeSpecifier.h215
-rw-r--r--org.eclipse.efm.symbex/src/fml/type/IntervalTypeSpecifier.cpp162
-rw-r--r--org.eclipse.efm.symbex/src/fml/type/IntervalTypeSpecifier.h183
-rw-r--r--org.eclipse.efm.symbex/src/fml/type/README.md17
-rw-r--r--org.eclipse.efm.symbex/src/fml/type/TableOfTypeSpecifier.cpp110
-rw-r--r--org.eclipse.efm.symbex/src/fml/type/TableOfTypeSpecifier.h305
-rw-r--r--org.eclipse.efm.symbex/src/fml/type/TypeAliasSpecifier.cpp53
-rw-r--r--org.eclipse.efm.symbex/src/fml/type/TypeAliasSpecifier.h145
-rw-r--r--org.eclipse.efm.symbex/src/fml/type/TypeManager.cpp751
-rw-r--r--org.eclipse.efm.symbex/src/fml/type/TypeManager.h483
-rw-r--r--org.eclipse.efm.symbex/src/fml/type/TypeSpecifier.cpp356
-rw-r--r--org.eclipse.efm.symbex/src/fml/type/TypeSpecifier.h568
-rw-r--r--org.eclipse.efm.symbex/src/fml/type/UnionTypeSpecifier.cpp71
-rw-r--r--org.eclipse.efm.symbex/src/fml/type/UnionTypeSpecifier.h66
-rw-r--r--org.eclipse.efm.symbex/src/fml/workflow/Query.cpp835
-rw-r--r--org.eclipse.efm.symbex/src/fml/workflow/Query.h605
-rw-r--r--org.eclipse.efm.symbex/src/fml/workflow/UniFormIdentifier.cpp636
-rw-r--r--org.eclipse.efm.symbex/src/fml/workflow/UniFormIdentifier.h629
-rw-r--r--org.eclipse.efm.symbex/src/fml/workflow/WObject.cpp840
-rw-r--r--org.eclipse.efm.symbex/src/fml/workflow/WObject.h1033
-rw-r--r--org.eclipse.efm.symbex/src/fml/workflow/WPropertyImpl.cpp107
-rw-r--r--org.eclipse.efm.symbex/src/fml/workflow/WPropertyImpl.h229
-rw-r--r--org.eclipse.efm.symbex/src/main/AvmLauncher.cpp443
-rw-r--r--org.eclipse.efm.symbex/src/main/AvmLauncher.h110
-rw-r--r--org.eclipse.efm.symbex/src/main/AvmMain.cpp32
-rw-r--r--org.eclipse.efm.symbex/src/main/AvmMain.h34
-rw-r--r--org.eclipse.efm.symbex/src/main/README.md10
-rw-r--r--org.eclipse.efm.symbex/src/main/SignalHandler.cpp64
-rw-r--r--org.eclipse.efm.symbex/src/main/SignalHandler.h69
-rw-r--r--org.eclipse.efm.symbex/src/main/main.cpp30
-rw-r--r--org.eclipse.efm.symbex/src/main/version.h.in31
-rw-r--r--org.eclipse.efm.symbex/src/parser/CMakeLists.txt25
-rw-r--r--org.eclipse.efm.symbex/src/parser/ParserManager.cpp271
-rw-r--r--org.eclipse.efm.symbex/src/parser/ParserManager.h127
-rw-r--r--org.eclipse.efm.symbex/src/parser/README.md10
-rw-r--r--org.eclipse.efm.symbex/src/parser/model/ParserUtil.cpp2145
-rw-r--r--org.eclipse.efm.symbex/src/parser/model/ParserUtil.h370
-rw-r--r--org.eclipse.efm.symbex/src/parser/model/fml.g6876
-rw-r--r--org.eclipse.efm.symbex/src/parser/model/fml.tokens691
-rw-r--r--org.eclipse.efm.symbex/src/parser/model/fmlLexer.c39414
-rw-r--r--org.eclipse.efm.symbex/src/parser/model/fmlLexer.h3091
-rw-r--r--org.eclipse.efm.symbex/src/parser/model/fmlParser.c91320
-rw-r--r--org.eclipse.efm.symbex/src/parser/model/fmlParser.h2697
-rw-r--r--org.eclipse.efm.symbex/src/parser/workflow/.gitignore6
-rw-r--r--org.eclipse.efm.symbex/src/parser/workflow/Workflow.g1797
-rw-r--r--org.eclipse.efm.symbex/src/printer/CMakeLists.txt15
-rw-r--r--org.eclipse.efm.symbex/src/printer/Manipulators.cpp56
-rw-r--r--org.eclipse.efm.symbex/src/printer/Manipulators.h862
-rw-r--r--org.eclipse.efm.symbex/src/printer/OutStream.cpp410
-rw-r--r--org.eclipse.efm.symbex/src/printer/OutStream.h1810
-rw-r--r--org.eclipse.efm.symbex/src/printer/WrapStream.cpp186
-rw-r--r--org.eclipse.efm.symbex/src/printer/WrapStream.h232
-rw-r--r--org.eclipse.efm.symbex/src/sew/CMakeLists.txt18
-rw-r--r--org.eclipse.efm.symbex/src/sew/Configuration.cpp955
-rw-r--r--org.eclipse.efm.symbex/src/sew/Configuration.h555
-rw-r--r--org.eclipse.efm.symbex/src/sew/README.md25
-rw-r--r--org.eclipse.efm.symbex/src/sew/SEW.md524
-rw-r--r--org.eclipse.efm.symbex/src/sew/SymbexController.cpp265
-rw-r--r--org.eclipse.efm.symbex/src/sew/SymbexController.h79
-rw-r--r--org.eclipse.efm.symbex/src/sew/SymbexControllerRequestManager.cpp48
-rw-r--r--org.eclipse.efm.symbex/src/sew/SymbexControllerRequestManager.h487
-rw-r--r--org.eclipse.efm.symbex/src/sew/SymbexControllerRequestStatus.h304
-rw-r--r--org.eclipse.efm.symbex/src/sew/SymbexControllerUnitManager.cpp577
-rw-r--r--org.eclipse.efm.symbex/src/sew/SymbexControllerUnitManager.h629
-rw-r--r--org.eclipse.efm.symbex/src/sew/SymbexDispatcher.cpp144
-rw-r--r--org.eclipse.efm.symbex/src/sew/SymbexDispatcher.h290
-rw-r--r--org.eclipse.efm.symbex/src/sew/SymbexEngine.cpp709
-rw-r--r--org.eclipse.efm.symbex/src/sew/SymbexEngine.h276
-rw-r--r--org.eclipse.efm.symbex/src/sew/SymbexEventManager.cpp22
-rw-r--r--org.eclipse.efm.symbex/src/sew/SymbexEventManager.h133
-rw-r--r--org.eclipse.efm.symbex/src/sew/SymbexJob.h195
-rw-r--r--org.eclipse.efm.symbex/src/sew/SymbexProcessor.cpp179
-rw-r--r--org.eclipse.efm.symbex/src/sew/SymbexProcessor.h94
-rw-r--r--org.eclipse.efm.symbex/src/sew/Workflow.cpp963
-rw-r--r--org.eclipse.efm.symbex/src/sew/Workflow.h430
-rw-r--r--org.eclipse.efm.symbex/src/solver/CMakeLists.txt20
-rw-r--r--org.eclipse.efm.symbex/src/solver/CVC4Solver.cpp2423
-rw-r--r--org.eclipse.efm.symbex/src/solver/CVC4Solver.h164
-rw-r--r--org.eclipse.efm.symbex/src/solver/OmegaSolver.cpp1380
-rw-r--r--org.eclipse.efm.symbex/src/solver/OmegaSolver.h193
-rw-r--r--org.eclipse.efm.symbex/src/solver/README.md11
-rw-r--r--org.eclipse.efm.symbex/src/solver/Z3Solver.cpp2746
-rw-r--r--org.eclipse.efm.symbex/src/solver/Z3Solver.h318
-rw-r--r--org.eclipse.efm.symbex/src/solver/api/SatSolver.cpp152
-rw-r--r--org.eclipse.efm.symbex/src/solver/api/SatSolver.h191
-rw-r--r--org.eclipse.efm.symbex/src/solver/api/SmtSolver.h578
-rw-r--r--org.eclipse.efm.symbex/src/solver/api/SolverDef.cpp217
-rw-r--r--org.eclipse.efm.symbex/src/solver/api/SolverDef.h217
-rw-r--r--org.eclipse.efm.symbex/src/solver/api/SolverFactory.cpp994
-rw-r--r--org.eclipse.efm.symbex/src/solver/api/SolverFactory.h279
-rw-r--r--org.eclipse.efm.symbex/src/svninfo.mk36
-rw-r--r--org.eclipse.efm.symbex/src/util/BoostFactory.cpp57
-rw-r--r--org.eclipse.efm.symbex/src/util/BoostFactory.h46
-rw-r--r--org.eclipse.efm.symbex/src/util/CMakeLists.txt16
-rw-r--r--org.eclipse.efm.symbex/src/util/ExecutionTime.cpp397
-rw-r--r--org.eclipse.efm.symbex/src/util/ExecutionTime.h95
-rw-r--r--org.eclipse.efm.symbex/src/util/README.md10
-rw-r--r--org.eclipse.efm.symbex/src/util/avm_assert.cpp62
-rw-r--r--org.eclipse.efm.symbex/src/util/avm_assert.h316
-rw-r--r--org.eclipse.efm.symbex/src/util/avm_debug.cpp539
-rw-r--r--org.eclipse.efm.symbex/src/util/avm_debug.h863
-rw-r--r--org.eclipse.efm.symbex/src/util/avm_injector.cpp23
-rw-r--r--org.eclipse.efm.symbex/src/util/avm_injector.h97
-rw-r--r--org.eclipse.efm.symbex/src/util/avm_numeric.cpp221
-rw-r--r--org.eclipse.efm.symbex/src/util/avm_numeric.h258
-rw-r--r--org.eclipse.efm.symbex/src/util/avm_string.cpp94
-rw-r--r--org.eclipse.efm.symbex/src/util/avm_string.h359
-rw-r--r--org.eclipse.efm.symbex/src/util/avm_types.cpp46
-rw-r--r--org.eclipse.efm.symbex/src/util/avm_types.h75
-rw-r--r--org.eclipse.efm.symbex/src/util/avm_uri.cpp164
-rw-r--r--org.eclipse.efm.symbex/src/util/avm_uri.h170
-rw-r--r--org.eclipse.efm.symbex/src/util/avm_util.cpp477
-rw-r--r--org.eclipse.efm.symbex/src/util/avm_util.h341
-rw-r--r--org.eclipse.efm.symbex/src/util/avm_vfs.cpp545
-rw-r--r--org.eclipse.efm.symbex/src/util/avm_vfs.h207
-rw-r--r--org.eclipse.efm.symbex/src/util/confs.h.in34
-rw-r--r--org.eclipse.efm.symbex/utests/CMakeLists.txt24
-rw-r--r--org.eclipse.efm.symbex/utests/base/CMakeLists.txt24
-rw-r--r--org.eclipse.efm.symbex/utests/base/t_InstanceCounter.cpp109
-rw-r--r--org.eclipse.efm.symbex/utests/base/t_base_runner.cpp7
-rw-r--r--org.eclipse.efm.symbex/utests/cmake/DefineSymbexUnitTestProject.cmake4
-rw-r--r--org.eclipse.efm.symbex/utests/cmake/LookForSymbexLibs.cmake28
-rw-r--r--org.eclipse.efm.symbex/utests/fml/CMakeLists.txt30
-rw-r--r--org.eclipse.efm.symbex/utests/fml/t_ExpressionConstructor.cpp50
-rw-r--r--org.eclipse.efm.symbex/utests/fml/t_Float.cpp58
-rw-r--r--org.eclipse.efm.symbex/utests/fml/t_Integer.cpp66
-rw-r--r--org.eclipse.efm.symbex/utests/fml/t_Numeric.cpp53
-rw-r--r--org.eclipse.efm.symbex/utests/fml/t_Rational.cpp68
-rw-r--r--org.eclipse.efm.symbex/utests/fml/t_fml_runner.cpp21
-rw-r--r--org.eclipse.efm.symbex/utests/fml/t_solver_ginac.cpp167
-rw-r--r--org.eclipse.efm.symbex/utests/fml/t_solver_yices.cpp61
-rw-r--r--org.eclipse.efm.symbex/utests/to_migrate/to_migrate.zipbin0 -> 17209 bytes
778 files changed, 452787 insertions, 0 deletions
diff --git a/org.eclipse.efm.symbex/.antlr-eclipse b/org.eclipse.efm.symbex/.antlr-eclipse
new file mode 100644
index 0000000..9f31be7
--- /dev/null
+++ b/org.eclipse.efm.symbex/.antlr-eclipse
@@ -0,0 +1,6 @@
+<?xml version='1.0' ?>
+<settings>
+ <resource name='**ANTLR-ECLIPSE-PLUGIN**'>
+ <property name='pluginVersion' value='2.7.6' />
+ </resource>
+</settings>
diff --git a/org.eclipse.efm.symbex/.cproject b/org.eclipse.efm.symbex/.cproject
new file mode 100644
index 0000000..04f4a43
--- /dev/null
+++ b/org.eclipse.efm.symbex/.cproject
@@ -0,0 +1,1030 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?><cproject>
+ <storageModule moduleId="org.eclipse.cdt.core.settings">
+ <cconfiguration id="cdt.managedbuild.config.gnu.cygwin.exe.release.1751191049">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cygwin.exe.release.1751191049" moduleId="org.eclipse.cdt.core.settings" name="Release">
+ <externalSettings/>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="avm" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf" description="" errorParsers="org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser" id="cdt.managedbuild.config.gnu.cygwin.exe.release.1751191049" name="Release" parent="cdt.managedbuild.config.gnu.cygwin.exe.release" postannouncebuildStep="" postbuildStep="" preannouncebuildStep="" prebuildStep="">
+ <folderInfo id="cdt.managedbuild.config.gnu.cygwin.exe.release.1751191049." name="/" resourcePath="">
+ <toolChain errorParsers="" id="cdt.managedbuild.toolchain.gnu.base.841109125" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.base">
+ <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.base.1228411808" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
+ <builder buildPath="${workspace_loc:/com.cea.avm}/Release" errorParsers="org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.CWDLocator" id="cdt.managedbuild.target.gnu.builder.base.452044552" keepEnvironmentInBuildfile="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="28" superClass="cdt.managedbuild.target.gnu.builder.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.archiver.base.2062207392" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
+ <tool command="g++ -pipe" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GCCErrorParser" id="cdt.managedbuild.tool.gnu.cpp.compiler.base.1462469422" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
+ <option id="gnu.cpp.compiler.option.optimization.level.1081509723" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.debugging.level.1941988987" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.preprocessor.def.1113833192" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
+ <listOptionValue builtIn="false" value="__AVM_UNIX__"/>
+ <listOptionValue builtIn="false" value="__AVM_LINUX__"/>
+ <listOptionValue builtIn="false" value="_GIT_VERSION_=\&quot;$(shell git describe --always --tags)\&quot;"/>
+ <listOptionValue builtIn="false" value="_AVM_BUILTIN_NUMERIC_GMP_"/>
+ <listOptionValue builtIn="false" value="_AVM_SOLVER_OMEGA_"/>
+ <listOptionValue builtIn="false" value="_AVM_SOLVER_CVC4_"/>
+ <listOptionValue builtIn="false" value="_AVM_SOLVER_Z3_"/>
+ </option>
+ <option id="gnu.cpp.compiler.option.preprocessor.undef.603363077" name="Undefined symbols (-U)" superClass="gnu.cpp.compiler.option.preprocessor.undef" useByScannerDiscovery="false" valueType="undefDefinedSymbols">
+ <listOptionValue builtIn="false" value="_AVM_EXPRESSION_GINAC_"/>
+ <listOptionValue builtIn="false" value="_AVM_SOLVER_CVC3_"/>
+ <listOptionValue builtIn="false" value="_AVM_SOLVER_YICES_V1_"/>
+ <listOptionValue builtIn="false" value="_AVM_SOLVER_YICES_V2_"/>
+ </option>
+ <option id="gnu.cpp.compiler.option.include.paths.1808691653" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/include/linux64}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/include/linux64/antlr3c}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/include/linux64/omega}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/include/linux64/z3}&quot;"/>
+ </option>
+ <option id="gnu.cpp.compiler.option.dialect.std.1536595217" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.cpp.compiler.dialect.default" valueType="enumerated"/>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.2124431323" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+ </tool>
+ <tool command="g++ -pipe" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GCCErrorParser" id="cdt.managedbuild.tool.gnu.c.compiler.base.1874989982" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base">
+ <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.option.optimization.level.1241677914" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="gnu.c.optimization.level.none" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.debugging.level.1687167247" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.none" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.include.paths.1256559701" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/include/linux64}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/include/linux64/antlr3c}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/include/linux64/omega}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/include/linux64/z3}&quot;"/>
+ </option>
+ <option id="gnu.c.compiler.option.preprocessor.def.symbols.768999597" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
+ <listOptionValue builtIn="false" value="__AVM_UNIX__"/>
+ <listOptionValue builtIn="false" value="__AVM_LINUX__"/>
+ <listOptionValue builtIn="false" value="_AVM_BUILTIN_NUMERIC_GMP_"/>
+ <listOptionValue builtIn="false" value="_AVM_SOLVER_OMEGA_"/>
+ <listOptionValue builtIn="false" value="_AVM_SOLVER_CVC4_"/>
+ <listOptionValue builtIn="false" value="_AVM_SOLVER_Z3_"/>
+ </option>
+ <option id="gnu.c.compiler.option.dialect.std.105233525" name="Language standard" superClass="gnu.c.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.c.compiler.dialect.default" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.misc.other.1900018295" name="Other flags" superClass="gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-c -fmessage-length=0 -Wuninitialized -Wunused-function -Wunused-variable -Wunused-but-set-variable " valueType="string"/>
+ <option id="gnu.c.compiler.option.warnings.allwarn.1387864221" name="All warnings (-Wall)" superClass="gnu.c.compiler.option.warnings.allwarn" useByScannerDiscovery="false" value="false" valueType="boolean"/>
+ <option id="gnu.c.compiler.option.warnings.nowarn.747595627" name="Inhibit all warnings (-w)" superClass="gnu.c.compiler.option.warnings.nowarn" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.797128776" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.linker.base.1461344745" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
+ <tool command="g++ -pipe -static -fopenmp" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GLDErrorParser" id="cdt.managedbuild.tool.gnu.cpp.linker.base.1926879841" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base">
+ <option id="gnu.cpp.link.option.strip.968562551" name="Omit all symbol information (-s)" superClass="gnu.cpp.link.option.strip" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+ <option id="gnu.cpp.link.option.libs.1295705831" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" useByScannerDiscovery="false" valueType="libs">
+ <listOptionValue builtIn="false" value="antlr"/>
+ <listOptionValue builtIn="false" value="antlr3c"/>
+ <listOptionValue builtIn="false" value="omega"/>
+ <listOptionValue builtIn="false" value="boost_system"/>
+ <listOptionValue builtIn="false" value="boost_filesystem"/>
+ <listOptionValue builtIn="false" value="boost_regex"/>
+ <listOptionValue builtIn="false" value="boost_unit_test_framework"/>
+ <listOptionValue builtIn="false" value="cvc4"/>
+ <listOptionValue builtIn="false" value="z3"/>
+ <listOptionValue builtIn="false" value="rt"/>
+ <listOptionValue builtIn="false" value="ginac"/>
+ <listOptionValue builtIn="false" value="cln"/>
+ <listOptionValue builtIn="false" value="gmpxx"/>
+ <listOptionValue builtIn="false" value="gmp"/>
+ </option>
+ <option id="gnu.cpp.link.option.paths.1897215325" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" useByScannerDiscovery="false" valueType="libPaths">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lib/linux64}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lib/linux64/yices1}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lib/linux64/yices2}&quot;"/>
+ </option>
+ <option id="gnu.cpp.link.option.userobjs.350456819" name="Other objects" superClass="gnu.cpp.link.option.userobjs" useByScannerDiscovery="false" valueType="userObjs">
+ <listOptionValue builtIn="false" value=""/>
+ <listOptionValue builtIn="false" value=""/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.2071397986" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+ <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+ </inputType>
+ </tool>
+ <tool command="as" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GASErrorParser" id="cdt.managedbuild.tool.gnu.assembler.base.1775367656" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base">
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.534285428" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry excluding="cmake|src-head|utests|include|src30c|bakup|out|src|Release" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+ <entry excluding="cmake" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+ <storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
+ </cconfiguration>
+ <cconfiguration id="cdt.managedbuild.config.gnu.cygwin.exe.debug.894915920.995135159.311874657.454277048">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cygwin.exe.debug.894915920.995135159.311874657.454277048" moduleId="org.eclipse.cdt.core.settings" name="Debug">
+ <externalSettings>
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/com.cea.avm"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/com.cea.avm/Debug"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="avm" srcPrefixMapping="" srcRootPath=""/>
+ </externalSetting>
+ </externalSettings>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="avm" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" errorParsers="org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GCCErrorParser" id="cdt.managedbuild.config.gnu.cygwin.exe.debug.894915920.995135159.311874657.454277048" name="Debug" parent="cdt.managedbuild.config.gnu.cygwin.exe.debug" postannouncebuildStep="" postbuildStep="cp -f avm.exe diversity.exe" preannouncebuildStep="" prebuildStep="">
+ <folderInfo id="cdt.managedbuild.config.gnu.cygwin.exe.debug.894915920.995135159.311874657.454277048." name="/" resourcePath="">
+ <toolChain errorParsers="" id="cdt.managedbuild.toolchain.gnu.base.64427688" name="Linux GCC" nonInternalBuilderId="cdt.managedbuild.target.gnu.builder.base" superClass="cdt.managedbuild.toolchain.gnu.base">
+ <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.base.1076208010" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
+ <builder arguments="" buildPath="${workspace_loc:/com.cea.avm/Debug}" command="make" errorParsers="org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.CWDLocator" id="cdt.managedbuild.target.gnu.builder.base.456653098" keepEnvironmentInBuildfile="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="28" stopOnErr="false" superClass="cdt.managedbuild.target.gnu.builder.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.archiver.base.1837705542" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base">
+ <option id="gnu.both.lib.option.flags.40292830" name="Archiver flags" superClass="gnu.both.lib.option.flags" value="-r " valueType="string"/>
+ </tool>
+ <tool command="g++ -pipe" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GCCErrorParser" id="cdt.managedbuild.tool.gnu.cpp.compiler.base.1616443269" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
+ <option id="gnu.cpp.compiler.option.include.paths.494556361" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/include/linux64}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/include/linux64/antlr3c}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/include/linux64/omega}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/include/linux64/z3}&quot;"/>
+ </option>
+ <option id="gnu.cpp.compiler.option.optimization.level.784961564" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.debugging.level.118493204" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.preprocessor.def.1694577690" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
+ <listOptionValue builtIn="false" value="__AVM_UNIX__"/>
+ <listOptionValue builtIn="false" value="__AVM_LINUX__"/>
+ <listOptionValue builtIn="false" value="_GIT_VERSION_=\&quot;$(shell git describe --always --tags)\&quot;"/>
+ <listOptionValue builtIn="false" value="_AVM_BUILTIN_NUMERIC_GMP_"/>
+ <listOptionValue builtIn="false" value="_AVM_SOLVER_OMEGA_"/>
+ <listOptionValue builtIn="false" value="_AVM_SOLVER_CVC4_"/>
+ <listOptionValue builtIn="false" value="_AVM_SOLVER_Z3_"/>
+ </option>
+ <option id="gnu.cpp.compiler.option.preprocessor.undef.105703250" name="Undefined symbols (-U)" superClass="gnu.cpp.compiler.option.preprocessor.undef" useByScannerDiscovery="false" valueType="undefDefinedSymbols">
+ <listOptionValue builtIn="false" value="_AVM_BUILTIN_NUMERIC_BOOST_"/>
+ <listOptionValue builtIn="false" value="_AVM_EXPRESSION_GINAC_"/>
+ <listOptionValue builtIn="false" value="_AVM_SOLVER_YICES_V1_"/>
+ <listOptionValue builtIn="false" value="_AVM_SOLVER_YICES_V2_"/>
+ <listOptionValue builtIn="false" value="_AVM_SOLVER_CVC3_"/>
+ </option>
+ <option id="gnu.cpp.compiler.option.dialect.std.1908041746" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.cpp.compiler.dialect.default" valueType="enumerated"/>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.790249768" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+ </tool>
+ <tool command="g++ -pipe" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GCCErrorParser" id="cdt.managedbuild.tool.gnu.c.compiler.base.501710889" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base">
+ <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.2004380143" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="gnu.c.optimization.level.none" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.debugging.level.1690296888" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.preprocessor.def.symbols.159093750" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
+ <listOptionValue builtIn="false" value="__AVM_UNIX__"/>
+ <listOptionValue builtIn="false" value="__AVM_LINUX__"/>
+ <listOptionValue builtIn="false" value="_AVM_BUILTIN_NUMERIC_GMP_"/>
+ <listOptionValue builtIn="false" value="_AVM_SOLVER_OMEGA_"/>
+ <listOptionValue builtIn="false" value="_AVM_SOLVER_CVC4_"/>
+ <listOptionValue builtIn="false" value="_AVM_SOLVER_Z3_"/>
+ </option>
+ <option id="gnu.c.compiler.option.include.paths.1653518804" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/include/linux64}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/include/linux64/antlr3c}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/include/linux64/omega}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/include/linux64/z3}&quot;"/>
+ </option>
+ <option id="gnu.c.compiler.option.misc.other.1282364744" name="Other flags" superClass="gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-c -fmessage-length=0 -Wuninitialized -Wunused-function -Wunused-variable -Wunused-but-set-variable " valueType="string"/>
+ <option id="gnu.c.compiler.option.warnings.allwarn.1682566304" name="All warnings (-Wall)" superClass="gnu.c.compiler.option.warnings.allwarn" useByScannerDiscovery="false" value="false" valueType="boolean"/>
+ <option id="gnu.c.compiler.option.dialect.std.776688867" name="Language standard" superClass="gnu.c.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.c.compiler.dialect.default" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.warnings.nowarn.1348802212" name="Inhibit all warnings (-w)" superClass="gnu.c.compiler.option.warnings.nowarn" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+ <option id="gnu.c.compiler.option.preprocessor.undef.symbol.2120185917" name="Undefined symbols (-U)" superClass="gnu.c.compiler.option.preprocessor.undef.symbol" useByScannerDiscovery="false"/>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.167561388" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.linker.base.472635841" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base">
+ <option defaultValue="true" id="gnu.c.link.option.shared.938537262" name="Shared (-shared)" superClass="gnu.c.link.option.shared" valueType="boolean"/>
+ </tool>
+ <tool command="g++ -pipe -static -fopenmp" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GLDErrorParser" id="cdt.managedbuild.tool.gnu.cpp.linker.base.1628020538" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base">
+ <option id="gnu.cpp.link.option.libs.800527498" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" useByScannerDiscovery="false" valueType="libs">
+ <listOptionValue builtIn="false" value="antlr"/>
+ <listOptionValue builtIn="false" value="antlr3c"/>
+ <listOptionValue builtIn="false" value="omega"/>
+ <listOptionValue builtIn="false" value="boost_system"/>
+ <listOptionValue builtIn="false" value="boost_filesystem"/>
+ <listOptionValue builtIn="false" value="boost_regex"/>
+ <listOptionValue builtIn="false" value="cvc4"/>
+ <listOptionValue builtIn="false" value="z3"/>
+ <listOptionValue builtIn="false" value="rt"/>
+ <listOptionValue builtIn="false" value="gmpxx"/>
+ <listOptionValue builtIn="false" value="gmp"/>
+ </option>
+ <option id="gnu.cpp.link.option.paths.864887485" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" useByScannerDiscovery="false" valueType="libPaths">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lib/linux64}&quot;"/>
+ </option>
+ <option id="gnu.cpp.link.option.userobjs.231528028" name="Other objects" superClass="gnu.cpp.link.option.userobjs" useByScannerDiscovery="false"/>
+ <option id="gnu.cpp.link.option.strip.1540652826" name="Omit all symbol information (-s)" superClass="gnu.cpp.link.option.strip" useByScannerDiscovery="false" value="false" valueType="boolean"/>
+ <option defaultValue="true" id="gnu.cpp.link.option.shared.1883723754" name="Shared (-shared)" superClass="gnu.cpp.link.option.shared" useByScannerDiscovery="false" value="false" valueType="boolean"/>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.426522801" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+ <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+ </inputType>
+ <outputType id="cdt.managedbuild.tool.gnu.cpp.linker.output.so.538493262" outputPrefix="" superClass="cdt.managedbuild.tool.gnu.cpp.linker.output.so"/>
+ </tool>
+ <tool command="as" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GASErrorParser" id="cdt.managedbuild.tool.gnu.assembler.base.1977045655" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base">
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1169614305" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry excluding="cmake|src-head|utests|include|src30c|bakup|out|src|Release" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+ <entry excluding="cmake" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+ <storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
+ </cconfiguration>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <project id="com.cea.avm.cdt.managedbuild.target.gnu.cygwin.exe.597274634" name="Executable" projectType="cdt.managedbuild.target.gnu.cygwin.exe"/>
+ </storageModule>
+ <storageModule moduleId="refreshScope" versionNumber="2">
+ <configuration configurationName="Debug-SOLVERS-GMP"/>
+ <configuration configurationName="Release PragmaDev Executable"/>
+ <configuration configurationName="ReleaseWin64"/>
+ <configuration configurationName="Debug g++-6.x"/>
+ <configuration configurationName="Debug GinaC">
+ <resource resourceType="PROJECT" workspacePath="/com.cea.avm"/>
+ </configuration>
+ <configuration configurationName="Release PragmaDev Library"/>
+ <configuration configurationName="DebugSolver"/>
+ <configuration configurationName="DebugSolvers"/>
+ <configuration configurationName="Debug NUMERIC+BOOST"/>
+ <configuration configurationName="Debug Solvers"/>
+ <configuration configurationName="Release windows x64bits"/>
+ <configuration configurationName="Debug-SOLVERS-NUMERICS"/>
+ <configuration configurationName="ReleasePragmaListLibrary"/>
+ <configuration configurationName="Debug+SOLVER+NUMERIC+BOOST"/>
+ <configuration configurationName="Debug+NUMERIC+BOOST">
+ <resource resourceType="PROJECT" workspacePath="/com.cea.avm"/>
+ </configuration>
+ <configuration configurationName="Release">
+ <resource resourceType="PROJECT" workspacePath="/com.cea.avm"/>
+ </configuration>
+ <configuration configurationName="Debug">
+ <resource resourceType="PROJECT" workspacePath="/com.cea.avm"/>
+ </configuration>
+ <configuration configurationName="ReleasePragmaListExecutable"/>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
+ <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+ <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
+ <storageModule moduleId="scannerConfiguration">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cygwin.exe.debug.894915920;cdt.managedbuild.config.gnu.cygwin.exe.debug.894915920.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base.1989861534;cdt.managedbuild.tool.gnu.cpp.compiler.input.1828025572">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cygwin.exe.debug.894915920;cdt.managedbuild.config.gnu.cygwin.exe.debug.894915920.;cdt.managedbuild.tool.gnu.c.compiler.mingw.base.2051841523;cdt.managedbuild.tool.gnu.c.compiler.input.1182516726">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cygwin.exe.debug.894915920;cdt.managedbuild.config.gnu.cygwin.exe.debug.894915920.;cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.debug.793519659;cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.1859405221">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cygwin.exe.debug.894915920.668329529.1752327754;cdt.managedbuild.config.gnu.cygwin.exe.debug.894915920.668329529.1752327754.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base.976449314;cdt.managedbuild.tool.gnu.cpp.compiler.input.1761731478">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cygwin.exe.debug.894915920.668329529.1752327754;cdt.managedbuild.config.gnu.cygwin.exe.debug.894915920.668329529.1752327754.;cdt.managedbuild.tool.gnu.c.compiler.mingw.base.495141995;cdt.managedbuild.tool.gnu.c.compiler.input.2117587977">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cygwin.exe.debug.894915920;cdt.managedbuild.config.gnu.cygwin.exe.debug.894915920.;cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.debug.1777691;cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin.1244920376">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cygwin.exe.release.1751191049;cdt.managedbuild.config.gnu.cygwin.exe.release.1751191049.;cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.release.821900023;cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.1037217745">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cygwin.exe.release.1751191049;cdt.managedbuild.config.gnu.cygwin.exe.release.1751191049.;cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.release.599127307;cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin.1411083076">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ </storageModule>
+</cproject>
diff --git a/org.eclipse.efm.symbex/.gitignore b/org.eclipse.efm.symbex/.gitignore
new file mode 100644
index 0000000..d7e59a7
--- /dev/null
+++ b/org.eclipse.efm.symbex/.gitignore
@@ -0,0 +1,4 @@
+/Debug*
+/Release*
+*.md.html
+/builds/
diff --git a/org.eclipse.efm.symbex/.project b/org.eclipse.efm.symbex/.project
new file mode 100644
index 0000000..e99fb4f
--- /dev/null
+++ b/org.eclipse.efm.symbex/.project
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.efm.symbex</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <triggers>clean,full,incremental,</triggers>
+ <arguments>
+ <dictionary>
+ <key>?name?</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.append_environment</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+ <value>all</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildArguments</key>
+ <value>-k -j4</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildCommand</key>
+ <value>make</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildLocation</key>
+ <value>${workspace_loc:/com.cea.avm/Debug}</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+ <value>clean</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.contents</key>
+ <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+ <value>false</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+ <value>all</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.stopOnError</key>
+ <value>false</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+ <value>true</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.efm.symbex/CHANGELOG.md b/org.eclipse.efm.symbex/CHANGELOG.md
new file mode 100644
index 0000000..dc89e7f
--- /dev/null
+++ b/org.eclipse.efm.symbex/CHANGELOG.md
@@ -0,0 +1 @@
+# EFM-SYMBEX : Eclipse Formal Modeling - Symbolic Execution Platform
diff --git a/org.eclipse.efm.symbex/CMakeLists.txt b/org.eclipse.efm.symbex/CMakeLists.txt
new file mode 100644
index 0000000..7977f9f
--- /dev/null
+++ b/org.eclipse.efm.symbex/CMakeLists.txt
@@ -0,0 +1,89 @@
+# =============================================================================
+# CMake Master File for Symbex All
+# =============================================================================
+#
+# Note : This file defines the whole process
+#
+# =============================================================================
+
+# Minimum required CMake version
+cmake_minimum_required (VERSION 2.8 FATAL_ERROR)
+
+project (Symbex_all CXX C)
+
+# Tell cmake where to find its own modules
+list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) # Common modules
+
+# System detection
+include (DetectSystem)
+
+# Toolchain detection
+include (DetectToolChain)
+
+# Searching for configuration management tools
+include (LookForSCM)
+
+# Sources revision
+include (DetectRevision)
+
+# Generic options that should propagate to all subtargets
+# (hence they must be loaded before the project structure is defined)
+include (GenericOptions)
+
+# OS-specific options that should propagate to all subtargets
+# (hence they must be loaded before the project structure is defined)
+include (SelectSpecificOptions)
+
+# Searching for mandatory prerequisites
+#set (BOOST_COMPONENTS system filesystem regex unit_test_framework)
+set (BOOST_COMPONENTS system filesystem regex)
+include (LookForMandatoryPrereq)
+
+
+
+
+
+# ======== BUILD CONFIGURATION ============================================
+message("")
+message("")
+message("* * * * * * * * * * Build type configuration for Symbex all * * * * * * * * * *")
+
+if(DEFINED ENV{DIVERSITY_CMAKE_BUILD_TYPE})
+ if($ENV{DIVERSITY_CMAKE_BUILD_TYPE} STREQUAL "TEST_AND_COVERAGE_UTESTS")
+ message(" Using unitary test build configuration : $ENV{DIVERSITY_CMAKE_BUILD_TYPE}")
+ elseif($ENV{DIVERSITY_CMAKE_BUILD_TYPE} STREQUAL "PRODUCTION")
+ message(" Using production build configuration : $ENV{DIVERSITY_CMAKE_BUILD_TYPE}")
+ else()
+ message( WARNING " Not using the org.eclipse.efm.cdash.ctest build configuration framework : default symbex.exe configuration used")
+ message(" placeholder : $ENV{DIVERSITY_CMAKE_BUILD_TYPE}")
+ endif()
+endif()
+
+message("")
+message("")
+
+
+
+# adding the main directory containing the code for the main executable (symbex.exe)
+add_subdirectory (src)
+
+# for specific builds
+if(DEFINED ENV{DIVERSITY_CMAKE_BUILD_TYPE})
+ if($ENV{DIVERSITY_CMAKE_BUILD_TYPE} STREQUAL "TEST_AND_COVERAGE_UTESTS")
+ # Load testing facilities
+ # it must be done on the highest level cmakelists.txt otherwise ctest does not find the tests :
+ # see http://stackoverflow.com/questions/13550153/no-tests-found-when-using-gtest-with-cmake-ctest
+ include (CTest)
+ # coverage
+ include(InitCoverage)
+ add_subdirectory (utests)
+ endif()
+endif()
+
+
+
+message("")
+message("")
+message("")
+message("")
+
diff --git a/org.eclipse.efm.symbex/CONTRIBUTING.md b/org.eclipse.efm.symbex/CONTRIBUTING.md
new file mode 100644
index 0000000..48fbe9f
--- /dev/null
+++ b/org.eclipse.efm.symbex/CONTRIBUTING.md
@@ -0,0 +1,3 @@
+# EFM-SYMBEX : Eclipse Formal Modeling - Symbolic Execution Platform
+
+Thanks for your interest in this project.
diff --git a/org.eclipse.efm.symbex/README.md b/org.eclipse.efm.symbex/README.md
new file mode 100644
index 0000000..2928f6e
--- /dev/null
+++ b/org.eclipse.efm.symbex/README.md
@@ -0,0 +1,5 @@
+# EFM-SYMBEX : Eclipse Formal Modeling - Symbolic Execution Platform
+
+## Source code structure
+[Source Folder](src/README.md)
+
diff --git a/org.eclipse.efm.symbex/TODO.md b/org.eclipse.efm.symbex/TODO.md
new file mode 100644
index 0000000..dc89e7f
--- /dev/null
+++ b/org.eclipse.efm.symbex/TODO.md
@@ -0,0 +1 @@
+# EFM-SYMBEX : Eclipse Formal Modeling - Symbolic Execution Platform
diff --git a/org.eclipse.efm.symbex/about.html b/org.eclipse.efm.symbex/about.html
new file mode 100644
index 0000000..d35d5ae
--- /dev/null
+++ b/org.eclipse.efm.symbex/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/org.eclipse.efm.symbex/cmake.sh b/org.eclipse.efm.symbex/cmake.sh
new file mode 100755
index 0000000..d5230c0
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake.sh
@@ -0,0 +1,16 @@
+echo cmake -G \"Unix Makefiles\" ./build
+
+# Setting build directory step
+
+rm -d -r -f build
+
+mkdir build ; cd build
+
+# Cmake Configuration step
+
+cmake -G "Unix Makefiles" ../org.eclipse.efm.symbex/
+
+# Compilation step
+
+make -j28
+
diff --git a/org.eclipse.efm.symbex/cmake/BuildANTLR2.cmake b/org.eclipse.efm.symbex/cmake/BuildANTLR2.cmake
new file mode 100644
index 0000000..c9af461
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/BuildANTLR2.cmake
@@ -0,0 +1,50 @@
+# =============================================================================
+# CMake module building ANTLR2 from sources
+# =============================================================================
+
+
+include (ExternalProject)
+
+set (ANTLR277_DIR antlr-2.7.7)
+set (ANTLR277_ARC ${ANTLR277_DIR}.tar.gz)
+set (ANTLR277_URL http://www.antlr2.org/download/${ANTLR277_ARC})
+
+
+if (NOT (DEFINED ANTLR2_INSTALL_DIR))
+# set (ANTLR2_INSTALL_DIR /home/lapitre_is148245/efm/symbex_hipp/org.eclipse.efm-symbex/org.eclipse.efm.symbex/build_gui/contrib)
+ set (ANTLR2_INSTALL_DIR ${CMAKE_BINARY_DIR}/contrib)
+ set (ANTLR2_INSTALL_LIB_DIR ${ANTLR2_INSTALL_DIR}/lib)
+ set (ANTLR2_INSTALL_INCLUDE_DIR ${ANTLR2_INSTALL_DIR}/include)
+endif()
+
+set (ANTLR2_CONFIGURE configure)
+set (ANTLR2_CONFIGURE ${ANTLR2_CONFIGURE} --prefix=${ANTLR2_INSTALL_DIR})
+# Fine tunning of installation directories
+#set (ANTLR2_CONFIGURE ${ANTLR2_CONFIGURE} --libdir=${ANTLR2_INSTALL_LIB_DIR} --includedir=${ANTLR2_INSTALL_INCLUDE_DIR})
+
+
+externalproject_add (antlr2
+
+ # Download step
+ DOWNLOAD_DIR ${CMAKE_BINARY_DIR}
+ URL ${ANTLR277_URL}
+ PREFIX antlr2
+
+ # Patch step
+ PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/cmake/antlr2-patch/lib/cpp/antlr/CharScanner.hpp ${CMAKE_BINARY_DIR}/antlr2/src/antlr2/lib/cpp/antlr
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/cmake/antlr2-patch/scripts/config.guess ${CMAKE_BINARY_DIR}/antlr2/src/antlr2/scripts
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/cmake/antlr2-patch/scripts/config.sub ${CMAKE_BINARY_DIR}/antlr2/src/antlr2/scripts
+
+ # Configure step
+ CONFIGURE_COMMAND ${CMAKE_BINARY_DIR}/antlr2/src/antlr2/${ANTLR2_CONFIGURE}
+
+ # Build step
+ BUILD_COMMAND make
+
+ # Install step
+ INSTALL_COMMAND make install
+ )
+
+# These variables ca be used by the client code of this module (ex: FindModule)
+set (ANTLR2_INCLUDE_DIR ${ANTLR2_INSTALL_INCLUDE_DIR})
+set (ANTLR2_LIBRARIES libantlr.a)
diff --git a/org.eclipse.efm.symbex/cmake/BuildCVC4.cmake b/org.eclipse.efm.symbex/cmake/BuildCVC4.cmake
new file mode 100644
index 0000000..16b0755
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/BuildCVC4.cmake
@@ -0,0 +1,114 @@
+# =============================================================================
+# CMake module building CVC4 from sources
+# =============================================================================
+#
+# Note : ANTLR3 is downloaded and built during the CVC4 build
+# Note : Some source files are patched (see PATCH_COMMAND)
+#
+# =============================================================================
+
+include (ExternalProject)
+
+# url and env vars for packaged version source
+set (CVC414_DIR cvc4-1.4)
+set (CVC414_ARC ${CVC414_DIR}.tar.gz)
+#set (CVC414_URL http://cvc4.cs.nyu.edu/builds/src/${CVC414_ARC})
+set (CVC414_URL http://cvc4.cs.stanford.edu/builds/src/${CVC414_ARC})
+
+#set (CMAKE_SOURCE_PATCH_DIR ${CMAKE_SOURCE_DIR}/cmake/cvc4-1.4-patch)
+
+
+# url and env vars for git repository source
+set(CVC4_GIT_REPOSITORY_URL https://github.com/CVC4/CVC4.git)
+
+set (CMAKE_SOURCE_PATCH_DIR ${CMAKE_SOURCE_DIR}/cmake/cvc4-master-patch)
+
+
+set (CVC4_CONFIGURE configure)
+# set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --disable-silent-rules) uncomment to force CVC4 makefile to display compilation/link commands
+set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --with-gmp)
+set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --enable-static-boost --with-boost=${Boost_INCLUDE_DIRS} --with-boost-libdir=${Boost_LIBRARIES_DIRS})
+
+# DEBUG
+#set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --enable-static-boost --with-boost=/home/ss219326/usr --with-boost-libdir=/home/ss219326/usr/lib) # MARCHE !
+#set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --enable-static-boost --with-boost=/home/ss219326/Boost --with-boost-libdir=/home/ss219326/Boost/lib) # MARCHE !
+#set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --enable-static-boost --with-boost=/home/ss219326/Boost/include --with-boost-libdir=/home/ss219326/Boost/lib) # MARCHE !
+#set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --enable-static-boost --with-boost=/home/ss219326/mingw64 --with-boost-libdir=/home/ss219326/mingw64/lib) # MARCHE !
+#set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --enable-static-boost --with-boost=/opt/mingw64 --with-boost-libdir=/opt/mingw64/lib) # MARCHE !
+#set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --enable-static-boost --with-boost=/mingw642 --with-boost-libdir=/mingw642/lib) # MARCHE !!
+#set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --enable-static-boost --with-boost=/mingw64 --with-boost-libdir=/mingw64/lib) # MARCHE PAS !!
+#set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --enable-static-boost --with-boost=/mingw64/include --with-boost-libdir=/mingw64/lib) # MARCHE PAS
+# END DEBUG
+
+if (NOT (DEFINED CVC4_INSTALL_DIR))
+ set (CVC4_INSTALL_DIR ${CMAKE_BINARY_DIR}/contrib)
+
+ set (CVC4_INSTALL_INCLUDE_DIR ${CVC4_INSTALL_DIR}/include)
+ set (CVC4_INSTALL_LIB_DIR ${CVC4_INSTALL_DIR}/lib)
+
+ set (ANTLR3_INSTALL_INCLUDE_DIR ${CVC4_INSTALL_INCLUDE_DIR}/antlr3c)
+ set (ANTLR3_INSTALL_LIB_DIR ${CVC4_INSTALL_LIB_DIR})
+endif()
+
+set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --with-antlr-dir=${CMAKE_BINARY_DIR}/cvc4/src/cvc4/antlr-3.4 ANTLR=${CMAKE_BINARY_DIR}/cvc4/src/cvc4/antlr-3.4/bin/antlr3)
+set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --enable-static=true --enable-shared=false --enable-static-binary --enable-optimized)
+set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --prefix=${CVC4_INSTALL_DIR})
+# Fine tunning of installation directories
+#set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --libdir=${CVC4_INSTALL_LIB_DIR} --includedir=${CVC4_INSTALL_INCLUDE_DIR})
+
+# Environment variable needed by CVC4
+set (ENV{CPPFLAGS} "-I${Boost_INCLUDE_DIRS} -I${GMP_INCLUDE_DIR} -I${GMPXX_INCLUDE_DIR}")
+#set (ENV{LDFLAGS} "${LIBGMP} ${LIBGMPXX} ${Boost_LIBRARIES}")
+set (ENV{LIBS} -lgmp) # Needed to build the CVC4 executable (and thus achieved the build process successfully)
+
+message (CPPFLAGS $ENV{CPPFLAGS})
+
+externalproject_add (cvc4
+
+ # Download or git-clone step and init
+ DOWNLOAD_DIR ${CMAKE_BINARY_DIR}
+ #URL ${CVC414_URL}
+ GIT_REPOSITORY ${CVC4_GIT_REPOSITORY_URL}
+ PREFIX cvc4
+
+ # Patch step
+ PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_PATCH_DIR}/util/integer_gmp_imp.h ${CMAKE_BINARY_DIR}/cvc4/src/cvc4/src/util
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_PATCH_DIR}/util/rational_gmp_imp.h ${CMAKE_BINARY_DIR}/cvc4/src/cvc4/src/util
+ # COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_PATCH_DIR}/options/options_template.cpp ${CMAKE_BINARY_DIR}/cvc4/src/cvc4/src/options
+
+ # Configure step
+ SOURCE_DIR ${CMAKE_BINARY_DIR}/cvc4/src/cvc4
+
+ # Git command
+ CONFIGURE_COMMAND cd ${CMAKE_BINARY_DIR}/cvc4/src/cvc4 && ${CMAKE_BINARY_DIR}/cvc4/src/cvc4/autogen.sh
+ COMMAND ${CMAKE_BINARY_DIR}/cvc4/src/cvc4/contrib/get-antlr-3.4
+
+ # Download command
+ #CONFIGURE_COMMAND ${CMAKE_BINARY_DIR}/cvc4/src/cvc4/contrib/get-antlr-3.4
+ # COMMAND echo "show_cvc4_configure"
+ COMMAND echo ${CMAKE_BINARY_DIR}/cvc4/src/cvc4/${CVC4_CONFIGURE}
+ COMMAND ${CMAKE_BINARY_DIR}/cvc4/src/cvc4/${CVC4_CONFIGURE}
+
+ # Build step
+ BUILD_COMMAND make -j28
+
+ # Install command
+ INSTALL_COMMAND make install
+ #COMMAND install -m 644 ${CMAKE_BINARY_DIR}/cvc4/src/cvc4/antlr-3.4/lib/libantlr3c.a ${ANTLR3_INSTALL_LIB_DIR}
+ #COMMAND install -m 644 -t ${ANTLR3_INSTALL_INCLUDE_DIR} ${CMAKE_BINARY_DIR}/cvc4/src/cvc4/antlr-3.4/include/*
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/cvc4/src/cvc4/antlr-3.4/lib/libantlr3c.a ${ANTLR3_INSTALL_LIB_DIR}
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/cvc4/src/cvc4/antlr-3.4/include ${ANTLR3_INSTALL_INCLUDE_DIR}
+ )
+
+# Back to previous state
+set (ENV{CPPFLAGS} "")
+#set (ENV{LDFLAGS} "")
+set (ENV{LIBS} "")
+
+# These variables can be used by the client code of this module (ex: FindModule)
+set (CVC4_INCLUDE_DIR ${CVC4_INSTALL_INCLUDE_DIR})
+set (CVC4_LIBRARIES libcvc4.a)
+
+set (ANTLR3_INCLUDE_DIR ${CVC4_INSTALL_INCLUDE_DIR}/include}) # TODO : Check if this works !
+set (ANTLR3_LIBRARIES libantlr3c.a) # TODO : Check if this works !
+
diff --git a/org.eclipse.efm.symbex/cmake/BuildCVC4.cmake.bak b/org.eclipse.efm.symbex/cmake/BuildCVC4.cmake.bak
new file mode 100644
index 0000000..309c987
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/BuildCVC4.cmake.bak
@@ -0,0 +1,106 @@
+# =============================================================================
+# CMake module building CVC4 from sources
+# =============================================================================
+#
+# Note : ANTLR3 is downloaded and built during the CVC4 build
+# Note : Some source files are patched (see PATCH_COMMAND)
+#
+# =============================================================================
+
+include (ExternalProject)
+
+# url for packaged version source
+set (CVC414_DIR cvc4-1.4)
+set (CVC414_ARC ${CVC414_DIR}.tar.gz)
+set (CVC414_URL http://cvc4.cs.nyu.edu/builds/src/${CVC414_ARC})
+
+# url for git repository source
+set(CVC4_GIT_REPOSITORY_URL https://github.com/CVC4/CVC4.git)
+
+
+set (CVC4_CONFIGURE configure)
+# set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --disable-silent-rules) uncomment to force CVC4 makefile to display compilation/link commands
+set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --with-gmp)
+set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --enable-static-boost --with-boost=${Boost_INCLUDE_DIRS} --with-boost-libdir=${Boost_LIBRARIES_DIRS})
+
+# DEBUG
+#set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --enable-static-boost --with-boost=/home/ss219326/usr --with-boost-libdir=/home/ss219326/usr/lib) # MARCHE !
+#set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --enable-static-boost --with-boost=/home/ss219326/Boost --with-boost-libdir=/home/ss219326/Boost/lib) # MARCHE !
+#set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --enable-static-boost --with-boost=/home/ss219326/Boost/include --with-boost-libdir=/home/ss219326/Boost/lib) # MARCHE !
+#set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --enable-static-boost --with-boost=/home/ss219326/mingw64 --with-boost-libdir=/home/ss219326/mingw64/lib) # MARCHE !
+#set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --enable-static-boost --with-boost=/opt/mingw64 --with-boost-libdir=/opt/mingw64/lib) # MARCHE !
+#set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --enable-static-boost --with-boost=/mingw642 --with-boost-libdir=/mingw642/lib) # MARCHE !!
+#set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --enable-static-boost --with-boost=/mingw64 --with-boost-libdir=/mingw64/lib) # MARCHE PAS !!
+#set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --enable-static-boost --with-boost=/mingw64/include --with-boost-libdir=/mingw64/lib) # MARCHE PAS
+# END DEBUG
+
+if (NOT (DEFINED CVC4_INSTALL_DIR))
+ set (CVC4_INSTALL_DIR ${CMAKE_BINARY_DIR}/contrib)
+
+ set (CVC4_INSTALL_INCLUDE_DIR ${CVC4_INSTALL_DIR}/include)
+ set (CVC4_INSTALL_LIB_DIR ${CVC4_INSTALL_DIR}/lib)
+
+ set (ANTLR3_INSTALL_INCLUDE_DIR ${CVC4_INSTALL_INCLUDE_DIR}/antlr3c)
+ set (ANTLR3_INSTALL_LIB_DIR ${CVC4_INSTALL_LIB_DIR})
+endif()
+
+set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --with-antlr-dir=${CMAKE_BINARY_DIR}/cvc4/src/cvc4/antlr-3.4 ANTLR=${CMAKE_BINARY_DIR}/cvc4/src/cvc4/antlr-3.4/bin/antlr3)
+set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --enable-static=true --enable-shared=false --enable-static-binary --enable-optimized)
+set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --prefix=${CVC4_INSTALL_DIR})
+# Fine tunning of installation directories
+#set (CVC4_CONFIGURE ${CVC4_CONFIGURE} --libdir=${CVC4_INSTALL_LIB_DIR} --includedir=${CVC4_INSTALL_INCLUDE_DIR})
+
+# Environment variable needed by CVC4
+set (ENV{CPPFLAGS} "-I${Boost_INCLUDE_DIRS} -I${GMP_INCLUDE_DIR} -I${GMPXX_INCLUDE_DIR}")
+#set (ENV{LDFLAGS} "${LIBGMP} ${LIBGMPXX} ${Boost_LIBRARIES}")
+set (ENV{LIBS} -lgmp) # Needed to build the CVC4 executable (and thus achieved the build process successfully)
+
+message (CPPFLAGS $ENV{CPPFLAGS})
+
+externalproject_add (cvc4
+
+ # Download or git-clone step and init
+ DOWNLOAD_DIR ${CMAKE_BINARY_DIR}
+ URL ${CVC414_URL}
+ #GIT_REPOSITORY ${CVC4_GIT_REPOSITORY_URL}
+ PREFIX cvc4
+
+ # Patch step
+ PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/cmake/cvc4-patch/util/integer_gmp_imp.h ${CMAKE_BINARY_DIR}/cvc4/src/cvc4/src/util
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/cmake/cvc4-patch/util/rational_gmp_imp.h ${CMAKE_BINARY_DIR}/cvc4/src/cvc4/src/util
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/cmake/cvc4-patch/options/options_template.cpp ${CMAKE_BINARY_DIR}/cvc4/src/cvc4/src/options
+
+ # Configure step
+ SOURCE_DIR ${CMAKE_BINARY_DIR}/cvc4/src/cvc4
+
+# Case of GIT_REPOSITORY command
+# CONFIGURE_COMMAND cd ${CMAKE_BINARY_DIR}/cvc4/src/cvc4 && ${CMAKE_BINARY_DIR}/cvc4/src/cvc4/autogen.sh
+# COMMAND ${CMAKE_BINARY_DIR}/cvc4/src/cvc4/contrib/get-antlr-3.4
+#
+# Case of URL command
+ CONFIGURE_COMMAND ${CMAKE_BINARY_DIR}/cvc4/src/cvc4/contrib/get-antlr-3.4
+ COMMAND ${CMAKE_BINARY_DIR}/cvc4/src/cvc4/${CVC4_CONFIGURE}
+
+ # Build step
+ BUILD_COMMAND make -j4
+
+ # Install command
+ INSTALL_COMMAND make install
+ #COMMAND install -m 644 ${CMAKE_BINARY_DIR}/cvc4/src/cvc4/antlr-3.4/lib/libantlr3c.a ${ANTLR3_INSTALL_LIB_DIR}
+ #COMMAND install -m 644 -t ${ANTLR3_INSTALL_INCLUDE_DIR} ${CMAKE_BINARY_DIR}/cvc4/src/cvc4/antlr-3.4/include/*
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/cvc4/src/cvc4/antlr-3.4/lib/libantlr3c.a ${ANTLR3_INSTALL_LIB_DIR}
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/cvc4/src/cvc4/antlr-3.4/include ${ANTLR3_INSTALL_INCLUDE_DIR}
+ )
+
+# Back to previous state
+set (ENV{CPPFLAGS} "")
+#set (ENV{LDFLAGS} "")
+set (ENV{LIBS} "")
+
+# These variables can be used by the client code of this module (ex: FindModule)
+set (CVC4_INCLUDE_DIR ${CVC4_INSTALL_INCLUDE_DIR})
+set (CVC4_LIBRARIES libcvc4.a)
+
+set (ANTLR3_INCLUDE_DIR ${CVC4_INSTALL_INCLUDE_DIR}/include}) # TODO : Check if this works !
+set (ANTLR3_LIBRARIES libantlr3c.a) # TODO : Check if this works !
+
diff --git a/org.eclipse.efm.symbex/cmake/BuildGMP.cmake b/org.eclipse.efm.symbex/cmake/BuildGMP.cmake
new file mode 100644
index 0000000..d40d7b6
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/BuildGMP.cmake
@@ -0,0 +1,16 @@
+# PENDING : TO BE CONTINUED
+
+message ("Build GMP from sources ...")
+set (GMP_URL https://gmplib.org/repo/gmp-6.1)
+set (GMP_DOS2UNIX sh -c "dos2unix.exe *")
+set (GMP_CONFIGURE sh configure)
+set (GMP_CONFIGURE ${GMP_CONFIGURE} --enable-cxx --disable-shared)
+set (GMP_CONFIGURE ${GMP_CONFIGURE} CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER})
+# configure --enable-cxx --disable-shared CC=C:/MinGW/bin/gcc.exe CXX=C:/MinGW/bin/g++.exe
+
+externalproject_add (gmp
+ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gmp
+ HG_REPOSITORY ${GMP_URL}
+ CONFIGURE_COMMAND ${GMP_DOS2UNIX} COMMAND sh ./.bootstrap COMMAND ${GMP_CONFIGURE}
+ BUILD_COMMAND make
+ BUILD_IN_SOURCE 1) \ No newline at end of file
diff --git a/org.eclipse.efm.symbex/cmake/CodeCoverage.cmake b/org.eclipse.efm.symbex/cmake/CodeCoverage.cmake
new file mode 100644
index 0000000..e1a06a5
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/CodeCoverage.cmake
@@ -0,0 +1,200 @@
+# Copyright (c) 2012 - 2015, Lars Bilke
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+#
+# 3. Neither the name of the copyright holder nor the names of its contributors
+# may be used to endorse or promote products derived from this software without
+# specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#
+#
+# 2012-01-31, Lars Bilke
+# - Enable Code Coverage
+#
+# 2013-09-17, Joakim Söderberg
+# - Added support for Clang.
+# - Some additional usage instructions.
+#
+# USAGE:
+
+# 0. (Mac only) If you use Xcode 5.1 make sure to patch geninfo as described here:
+# http://stackoverflow.com/a/22404544/80480
+#
+# 1. Copy this file into your cmake modules path.
+#
+# 2. Add the following line to your CMakeLists.txt:
+# INCLUDE(CodeCoverage)
+#
+# 3. Set compiler flags to turn off optimization and enable coverage:
+# SET(CMAKE_CXX_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
+# SET(CMAKE_C_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
+#
+# 3. Use the function SETUP_TARGET_FOR_COVERAGE to create a custom make target
+# which runs your test executable and produces a lcov code coverage report:
+# Example:
+# SETUP_TARGET_FOR_COVERAGE(
+# my_coverage_target # Name for custom target.
+# test_driver # Name of the test driver executable that runs the tests.
+# # NOTE! This should always have a ZERO as exit code
+# # otherwise the coverage generation will not complete.
+# coverage # Name of output directory.
+# )
+#
+# 4. Build a Debug build:
+# cmake -DCMAKE_BUILD_TYPE=Debug ..
+# make
+# make my_coverage_target
+#
+#
+
+# Check prereqs
+FIND_PROGRAM( GCOV_PATH gcov )
+message("${LCOV_INSTALL_INCLUDE_DIR}")
+FIND_LIBRARY( LCOV_PATH lcov HINTS ${LCOV_INSTALL_INCLUDE_DIR})
+message("${LCOV_PATH}")
+FIND_PROGRAM( GENHTML_PATH genhtml )
+FIND_PROGRAM( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/tests)
+
+IF(NOT GCOV_PATH)
+ MESSAGE(FATAL_ERROR "gcov not found! Aborting...")
+ENDIF() # NOT GCOV_PATH
+
+IF(NOT CMAKE_COMPILER_IS_GNUCXX)
+ # Clang version 3.0.0 and greater now supports gcov as well.
+ MESSAGE(WARNING "Compiler is not GNU gcc! Clang Version 3.0.0 and greater supports gcov as well, but older versions don't.")
+
+ IF(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ MESSAGE(FATAL_ERROR "Compiler is not GNU gcc! Aborting...")
+ ENDIF()
+ENDIF() # NOT CMAKE_COMPILER_IS_GNUCXX
+
+SET(CMAKE_CXX_FLAGS_COVERAGE
+ "-g -O0 --coverage -fprofile-arcs -ftest-coverage"
+ CACHE STRING "Flags used by the C++ compiler during coverage builds."
+ FORCE )
+SET(CMAKE_C_FLAGS_COVERAGE
+ "-g -O0 --coverage -fprofile-arcs -ftest-coverage"
+ CACHE STRING "Flags used by the C compiler during coverage builds."
+ FORCE )
+SET(CMAKE_EXE_LINKER_FLAGS_COVERAGE
+ ""
+ CACHE STRING "Flags used for linking binaries during coverage builds."
+ FORCE )
+SET(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
+ ""
+ CACHE STRING "Flags used by the shared libraries linker during coverage builds."
+ FORCE )
+MARK_AS_ADVANCED(
+ CMAKE_CXX_FLAGS_COVERAGE
+ CMAKE_C_FLAGS_COVERAGE
+ CMAKE_EXE_LINKER_FLAGS_COVERAGE
+ CMAKE_SHARED_LINKER_FLAGS_COVERAGE )
+
+IF ( NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "Coverage"))
+ MESSAGE( WARNING "Code coverage results with an optimized (non-Debug) build may be misleading" )
+ENDIF() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug"
+
+
+# Param _targetname The name of new the custom make target
+# Param _testrunner The name of the target which runs the tests.
+# MUST return ZERO always, even on errors.
+# If not, no coverage report will be created!
+# Param _outputname lcov output is generated as _outputname.info
+# HTML report is generated in _outputname/index.html
+# Optional fourth parameter is passed as arguments to _testrunner
+# Pass them in list form, e.g.: "-j;2" for -j 2
+FUNCTION(SETUP_TARGET_FOR_COVERAGE _targetname _testrunner _outputname)
+
+ IF(NOT LCOV_PATH)
+ MESSAGE(FATAL_ERROR "lcov not found! Aborting...")
+ ENDIF() # NOT LCOV_PATH
+
+ IF(NOT GENHTML_PATH)
+ MESSAGE(FATAL_ERROR "genhtml not found! Aborting...")
+ ENDIF() # NOT GENHTML_PATH
+
+ SET(coverage_info "${CMAKE_BINARY_DIR}/${_outputname}.info")
+ SET(coverage_cleaned "${coverage_info}.cleaned")
+
+ SEPARATE_ARGUMENTS(test_command UNIX_COMMAND "${_testrunner}")
+
+ # Setup target
+ ADD_CUSTOM_TARGET(${_targetname}
+
+ # Cleanup lcov
+ ${LCOV_PATH} --directory . --zerocounters
+
+ # Run tests
+ COMMAND ${test_command} ${ARGV3}
+
+ # Capturing lcov counters and generating report
+ COMMAND ${LCOV_PATH} --directory . --capture --output-file ${coverage_info}
+ COMMAND ${LCOV_PATH} --remove ${coverage_info} 'tests/*' '/usr/*' --output-file ${coverage_cleaned}
+ COMMAND ${GENHTML_PATH} -o ${_outputname} ${coverage_cleaned}
+ COMMAND ${CMAKE_COMMAND} -E remove ${coverage_info} ${coverage_cleaned}
+
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+ COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
+ )
+
+ # Show info where to find the report
+ ADD_CUSTOM_COMMAND(TARGET ${_targetname} POST_BUILD
+ COMMAND ;
+ COMMENT "Open ./${_outputname}/index.html in your browser to view the coverage report."
+ )
+
+ENDFUNCTION() # SETUP_TARGET_FOR_COVERAGE
+
+# Param _targetname The name of new the custom make target
+# Param _testrunner The name of the target which runs the tests
+# Param _outputname cobertura output is generated as _outputname.xml
+# Optional fourth parameter is passed as arguments to _testrunner
+# Pass them in list form, e.g.: "-j;2" for -j 2
+FUNCTION(SETUP_TARGET_FOR_COVERAGE_COBERTURA _targetname _testrunner _outputname)
+
+ IF(NOT PYTHON_EXECUTABLE)
+ MESSAGE(FATAL_ERROR "Python not found! Aborting...")
+ ENDIF() # NOT PYTHON_EXECUTABLE
+
+ IF(NOT GCOVR_PATH)
+ MESSAGE(FATAL_ERROR "gcovr not found! Aborting...")
+ ENDIF() # NOT GCOVR_PATH
+
+ ADD_CUSTOM_TARGET(${_targetname}
+
+ # Run tests
+ ${_testrunner} ${ARGV3}
+
+ # Running gcovr
+ COMMAND ${GCOVR_PATH} -x -r ${CMAKE_SOURCE_DIR} -e '${CMAKE_SOURCE_DIR}/tests/' -o ${_outputname}.xml
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+ COMMENT "Running gcovr to produce Cobertura code coverage report."
+ )
+
+ # Show info where to find the report
+ ADD_CUSTOM_COMMAND(TARGET ${_targetname} POST_BUILD
+ COMMAND ;
+ COMMENT "Cobertura code coverage report saved in ${_outputname}.xml."
+ )
+
+ENDFUNCTION() # SETUP_TARGET_FOR_COVERAGE_COBERTURA \ No newline at end of file
diff --git a/org.eclipse.efm.symbex/cmake/DetectRevision.cmake b/org.eclipse.efm.symbex/cmake/DetectRevision.cmake
new file mode 100644
index 0000000..82d2f6e
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/DetectRevision.cmake
@@ -0,0 +1,15 @@
+# =============================================================================
+# CMake module getting the git description of the current commit
+# =============================================================================
+
+
+message (STATUS "****** Looking for git commit id ******")
+
+
+execute_process (COMMAND ${GIT_EXECUTABLE} describe --long --tags --dirty --always
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ OUTPUT_VARIABLE GIT_COMMIT_ID
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+
+message (STATUS "Commit id : ${GIT_COMMIT_ID}")
diff --git a/org.eclipse.efm.symbex/cmake/DetectSystem.cmake b/org.eclipse.efm.symbex/cmake/DetectSystem.cmake
new file mode 100644
index 0000000..932507a
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/DetectSystem.cmake
@@ -0,0 +1,34 @@
+# =============================================================================
+# CMake module getting some properties from the current platform
+# =============================================================================
+
+
+message (STATUS "****** Looking for system information ******")
+
+# Endianness testing (answer in variable SYSTEM_IS_BIG_ENDIAN)
+include (TestBigEndian)
+test_big_endian (SYSTEM_IS_BIG_ENDIAN)
+if (SYSTEM_IS_BIG_ENDIAN)
+ set (SYSTEM_IS_BIG_ENDIAN_STR Yes)
+else ()
+ set (SYSTEM_IS_BIG_ENDIAN_STR No)
+endif ()
+
+# Processors testing (answer in variable SYSTEM_NB_OF_PROC)
+include (ProcessorCount)
+ProcessorCount (SYSTEM_NB_OF_PROC)
+
+# Checking type size (result in bytes)
+include (CheckTypeSize)
+check_type_size (int INT_SIZE LANGUAGE CXX)
+check_type_size (short SHORT_INT_SIZE LANGUAGE CXX)
+check_type_size (long LONG_INT_SIZE LANGUAGE CXX)
+check_type_size (char CHAR_SIZE LANGUAGE CXX)
+
+# Report
+message (STATUS "System : ${CMAKE_SYSTEM}-${CMAKE_SYSTEM_PROCESSOR}")
+message (STATUS "System (CMake var): WIN32=${WIN32} MINGW=${MINGW} UNIX=${UNIX} MSYS=${MSYS} CYGWIN=${CYGWIN}")
+message (STATUS "Big-endian : ${SYSTEM_IS_BIG_ENDIAN_STR}")
+message (STATUS "Types size (bytes): int=${INT_SIZE} shortint=${SHORT_INT_SIZE} longint=${LONG_INT_SIZE} char=${CHAR_SIZE}")
+message (STATUS "Nb of processors : ${SYSTEM_NB_OF_PROC}")
+
diff --git a/org.eclipse.efm.symbex/cmake/DetectToolChain.cmake b/org.eclipse.efm.symbex/cmake/DetectToolChain.cmake
new file mode 100644
index 0000000..300a903
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/DetectToolChain.cmake
@@ -0,0 +1,10 @@
+# =============================================================================
+# CMake module displaying current toolchain
+# =============================================================================
+
+message (STATUS "****** Looking for toolchain information ******")
+
+# No real detection here, only printing what CMake knows already
+message (STATUS "C++ compiler: " ${CMAKE_CXX_COMPILER} ", version " ${CMAKE_CXX_COMPILER_VERSION})
+message (STATUS "C compiler: " ${CMAKE_C_COMPILER} ", version " ${CMAKE_C_COMPILER_VERSION})
+message (STATUS "Linker: " ${CMAKE_LINKER})
diff --git a/org.eclipse.efm.symbex/cmake/FindANTLR2.cmake b/org.eclipse.efm.symbex/cmake/FindANTLR2.cmake
new file mode 100644
index 0000000..5922e8c
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/FindANTLR2.cmake
@@ -0,0 +1,28 @@
+# =============================================================================
+# CMake package looking for ANTLR2 librairies
+# =============================================================================
+#
+# ANTLR2_FOUND : System has ANTLR2 lib and associated headers
+# ANTLR2_LIBRARIES : libantlr.a location
+# ANTLR2_INCLUDE_DIR : include directory
+#
+# Note : this package is not designed to be general nor comprehensive :
+# it only fits the Symbex project needs
+#
+# =============================================================================
+
+
+if (ANTLR2_INCLUDE_DIR AND ANTLR2_LIBRARIES) # Already in cache, be silent
+ set (ANTLR2_FIND_QUIETLY TRUE)
+endif ()
+
+#find_path (ANTLR2_INCLUDE_DIR NAMES ANTLRException.hpp PATH_SUFFIXES antlr HINTS ${ANTLR2_INSTALL_INCLUDE_DIR})
+find_path (ANTLR2_INCLUDE_DIR NAMES antlr/ANTLRException.hpp HINTS ${ANTLR2_INSTALL_INCLUDE_DIR})
+find_library (ANTLR2_LIBRARIES NAMES antlr libantlr.a HINTS ${ANTLR2_INSTALL_LIB_DIR})
+
+message (STATUS "ANTLR2 : " ${ANTLR2_LIBRARIES} " " ${ANTLR2_INCLUDE_DIR})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args (ANTLR2 DEFAULT_MSG ANTLR2_LIBRARIES ANTLR2_INCLUDE_DIR)
+
+
diff --git a/org.eclipse.efm.symbex/cmake/FindANTLR3.cmake b/org.eclipse.efm.symbex/cmake/FindANTLR3.cmake
new file mode 100644
index 0000000..ce41065
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/FindANTLR3.cmake
@@ -0,0 +1,24 @@
+# =============================================================================
+# CMake package looking for ANTLR3 C runtime librairies
+# =============================================================================
+#
+# ANTLR3_FOUND : System has ANTLR3 C Runtime lib and associated headers
+# ANTLR3_LIBRARIES : ANTLR3 library location
+# ANTLR3_INCLUDE_DIR : ANTLR3 include directory
+#
+# Note : this package is not designed to be general nor comprehensive :
+# it only fits the Symbex project needs
+#
+# =============================================================================
+
+if (ANTLR3_INCLUDE_DIR AND ANTLR3_LIBRARIES) # Already in cache, be silent
+ set (ANTLR3_FIND_QUIETLY TRUE)
+endif ()
+
+find_path (ANTLR3_INCLUDE_DIR NAMES antlr3.h HINTS ${ANTLR3_INSTALL_INCLUDE_DIR})
+find_library (ANTLR3_LIBRARIES NAMES libantlr3c libantlr3c.a HINTS ${ANTLR3_INSTALL_LIB_DIR} ${CVC4_INSTALL_LIB_DIR})
+message (STATUS "ANTLR3 : " ${ANTLR3_LIBRARIES} " " ${ANTLR3_INCLUDE_DIR})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args (ANTLR3 DEFAULT_MSG ANTLR3_LIBRARIES ANTLR3_INCLUDE_DIR)
+
diff --git a/org.eclipse.efm.symbex/cmake/FindCVC4.cmake b/org.eclipse.efm.symbex/cmake/FindCVC4.cmake
new file mode 100644
index 0000000..36290dd
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/FindCVC4.cmake
@@ -0,0 +1,30 @@
+# =============================================================================
+# CMake package looking for CVC4
+# =============================================================================
+#
+# CVC4_FOUND : System has CVC4 lib and associated headers
+# CVC4_INCLUDE_DIR : CVC4 include directory
+# CVC4_LIBRARIES : CVC4 lib location
+#
+# Note : this package is not designed to be general nor comprehensive :
+# it only fits the Symbex project needs
+#
+# =============================================================================
+
+# If already in cache, be silent
+if (CVC4_INCLUDE_DIR AND CVC4_LIBRARIES) # Already in cache, be silent
+ set (CVC4_FIND_QUIETLY TRUE)
+endif ()
+
+#message ("CVC4_INSTALL_INCLUDE_DIR=${CVC4_INSTALL_INCLUDE_DIR}")
+#message ("CVC4_INSTALL_LIB_DIR=${CVC4_INSTALL_LIB_DIR}")
+
+find_path (CVC4_INCLUDE_DIR NAMES cvc4/cvc4.h HINTS ${CVC4_INSTALL_INCLUDE_DIR})
+find_library(CVC4_LIBRARIES NAMES libcvc4.a HINTS ${CVC4_INSTALL_LIB_DIR})
+#find_library(CVC4_LIBRARIES NAMES cvc4 HINTS /c/msys64/mingw64/usr/lib)
+
+message (STATUS "CVC4 : " ${CVC4_LIBRARIES} " " ${CVC4_INCLUDE_DIR})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args (CVC4 DEFAULT_MSG CVC4_LIBRARIES CVC4_INCLUDE_DIR)
+
diff --git a/org.eclipse.efm.symbex/cmake/FindGMP.cmake b/org.eclipse.efm.symbex/cmake/FindGMP.cmake
new file mode 100644
index 0000000..10260f9
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/FindGMP.cmake
@@ -0,0 +1,44 @@
+# =============================================================================
+# CMake package looking for GMP libraries
+# =============================================================================
+#
+# GMP_FOUND : System has both GMP lib and associated headers
+#
+# Note : this package is not designed to be general nor comprehensive :
+# it only fits the Symbex project needs
+#
+# =============================================================================
+
+# If already in cache, be silent
+if (gmp_includedir AND gmpxx_includedir AND lib_gmp_c AND lib_gmp_cxx)
+ set (GMP_FIND_QUIETLY TRUE)
+endif ()
+
+
+
+find_path (gmp_includedir NAMES gmp.h PATHS ${GMP_INCLUDEDIR})
+find_path (gmpxx_includedir NAMES gmpxx.h PATHS ${GMP_INCLUDEDIR})
+
+find_library(lib_gmp_c NAMES gmp libgmp.a PATHS ${GMP_LIBRARYDIR})
+find_library(lib_gmp_cxx NAMES gmpxx libgmpxx.a PATHS ${GMP_LIBRARYDIR})
+
+
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args (GMP DEFAULT_MSG lib_gmp_c lib_gmp_cxx gmp_includedir gmpxx_includedir)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/org.eclipse.efm.symbex/cmake/GenericOptions.cmake b/org.eclipse.efm.symbex/cmake/GenericOptions.cmake
new file mode 100644
index 0000000..6c5a597
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/GenericOptions.cmake
@@ -0,0 +1,19 @@
+# =============================================================================
+# CMake file for generic built options
+# =============================================================================
+#
+# Note : These compile directives propagate to all targets on all systems
+#
+# =============================================================================
+
+
+# What is defined
+#add_definitions (-D_AVM_BUILT_WITH_CMAKE_ -D_AVM_SOLVER_CVC4_ -D_AVM_BUILTIN_NUMERIC_BOOST_)
+add_definitions (-D_AVM_BUILT_WITH_CMAKE_ -D_AVM_SOLVER_CVC4_ -D_AVM_BUILTIN_NUMERIC_GMP_)
+
+
+# What is undefined
+add_definitions (-U_AVM_SOLVER_YICES_V1_ -U_AVM_SOLVER_YICES_V2_ -U_AVM_SOLVER_CVC3_ -U _AVM_EXPRESSION_GINAC_ -U_AVM_SOLVER_OMEGA_)
+add_definitions(-U_AVM_BUILTIN_NUMERIC_BOOST_)
+
+
diff --git a/org.eclipse.efm.symbex/cmake/InitCoverage.cmake b/org.eclipse.efm.symbex/cmake/InitCoverage.cmake
new file mode 100644
index 0000000..290242e
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/InitCoverage.cmake
@@ -0,0 +1,9 @@
+
+
+
+SET(CMAKE_CXX_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
+SET(CMAKE_C_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
+
+
+
+link_libraries (gcov) \ No newline at end of file
diff --git a/org.eclipse.efm.symbex/cmake/LookForMandatoryPrereq.cmake b/org.eclipse.efm.symbex/cmake/LookForMandatoryPrereq.cmake
new file mode 100644
index 0000000..3884bd7
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/LookForMandatoryPrereq.cmake
@@ -0,0 +1,83 @@
+# ===============================================================================
+# CMake module : Search for mandatory prerequisites
+# ===============================================================================
+#
+# This module looks for mandatory libraries and sets variable
+# like <XXX>_LIBRARIES and <XXX>_INCLUDE_DIR
+# Variables of the form <XXX>_ROOT are passed to the Find modules which use them as hints
+#
+# ===============================================================================
+
+
+message (STATUS "****** Looking for mandatory prerequisites ******")
+
+# ---------------------------- Looking for Boost ------------------------------
+#
+# Variable BOOST_ROOT is used as a search hint by find_package
+#
+message (STATUS "**** Looking for BOOST ****")
+
+set (Boost_DEBUG ON) # Enable boost DEBUG
+
+
+# BOOST_COMPONENTS should contains the required boost components
+set (Boost_USE_STATIC_LIBS ON) # Force to lookg for static libraries
+find_package (Boost 1.40 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
+if (NOT (Boost_FOUND))
+ message (FATAL_ERROR "Boost not found : please install Boost >= 1.53 manually")
+else ()
+ message (STATUS "Boost : " ${Boost_LIBRARIES} "-" ${Boost_INCLUDE_DIRS} "-" ${Boost_LIBRARY_DIRS})
+endif()
+message (STATUS "**** ****")
+
+# --------------------------- Looking for GPM ---------------------------------
+#
+# The GMP_ROOT variable is used as a search hint
+#
+message (STATUS "**** Looking for GMP ****")
+find_package(GMP 6.1.0 REQUIRED)
+if (NOT (GMP_FOUND))
+ message (FATAL_ERROR "GMP not found : please install GMP >= 6.1.0 manually")
+else ()
+ message (STATUS "GMP : " ${lib_gmp_c} "-" ${lib_gmp_cxx} "-" ${gmp_includedir} "-" ${gmpxx_includedir})
+endif()
+message (STATUS "**** ****")
+
+# --------------------------- Looking for CVC4 --------------------------------
+#
+# CVC4_INSTALL_INCLUDE_DIR : hint to find includes
+# CVC4_INSTALL_LIB_DIR : hint to find libraries
+#
+find_package(CVC4)
+if (NOT (CVC4_FOUND))
+ message("CVC4 not found : later, I will try to build CVC4 from sources (including an ANTLR3 build)")
+ include (BuildCVC4)
+ add_custom_target (rescan_cvc4 ${CMAKE_COMMAND} ${CMAKE_SOURCE_DIR} DEPENDS cvc4)
+else ()
+ add_custom_target (rescan_cvc4)
+endif()
+
+
+# -------------------------- Looking for ANTLR2 -------------------------------
+#
+# ANTLR2_INSTALL_INCLUDE_DIR : hint to find includes
+# ANTLR2_INSTALL_LIB_DIR : hint to find libraries
+#
+find_package(ANTLR2)
+if (NOT (ANTLR2_FOUND))
+ message ("ANTLR2 not found : later, I will try to build ANTLR2 from sources")
+ include (BuildANTLR2)
+ add_custom_target (rescan_antlr2 ${CMAKE_COMMAND} ${CMAKE_SOURCE_DIR} DEPENDS antlr2 )
+else ()
+ add_custom_target (rescan_antlr2)
+endif()
+
+
+# -------------------- Looking for ANTLR3 C runtime ---------------------------
+# The ANTLR3_INSTALL_INCLUDE_DIR and ANTLR3_INSTALL_LIB_DIR variables are used as search hints
+find_package(ANTLR3)
+if (NOT (ANTLR3_FOUND))
+ message ("ANTLR3 not found : please install ANTLR3 package manually or (re)install CVC4 (which comes with an automatic ANTLR3 installation)")
+endif()
+
+
diff --git a/org.eclipse.efm.symbex/cmake/LookForSCM.cmake b/org.eclipse.efm.symbex/cmake/LookForSCM.cmake
new file mode 100644
index 0000000..be4a741
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/LookForSCM.cmake
@@ -0,0 +1,27 @@
+# =============================================================================
+# CMake Module looking for Software Configuration Management tools
+# =============================================================================
+#
+# Note : Tools currently looked for are : Git SVN
+#
+# =============================================================================
+
+
+
+# Looking foir Git
+find_package(Git)
+if (GIT_FOUND)
+ message (STATUS "Git ${GIT_VERSION_STRING} found : ${GIT_EXECUTABLE}" )
+else ()
+ message (FATAL_ERROR "Git not found")
+endif()
+
+
+
+# Looking for Mercurial
+find_package(Hg)
+if (HG_FOUND)
+ message (STATUS "Mercurial ${HG_VERSION_STRING} found : ${HG_EXECUTABLE}" )
+else ()
+ message (STATUS "Mercurial not found")
+endif()
diff --git a/org.eclipse.efm.symbex/cmake/PrintBanner.cmake b/org.eclipse.efm.symbex/cmake/PrintBanner.cmake
new file mode 100644
index 0000000..39f7903
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/PrintBanner.cmake
@@ -0,0 +1,34 @@
+# Banner
+
+function (banner_row WIDTH REPEATING_CHAR LEFTCORNER_CHAR RIGHTCORNER_CHAR TEXT)
+ if (TEXT)
+ string (LENGTH ${TEXT} TEXT_LENGTH)
+ math (EXPR TEXT_LENGTH_MODULO2 "${TEXT_LENGTH} % 2")
+ if (TEXT_LENGTH_MODULO2)
+ set (TEXT "${TEXT} ")
+ string (LENGTH ${TEXT} TEXT_LENGTH)
+ endif()
+ else ()
+ set (TEXT_LENGTH 0)
+ endif()
+ math (EXPR HALFLINE_LENGTH "(${WIDTH} - ${TEXT_LENGTH}) / 2 - 2")
+ set (RESULT ${TEXT})
+ foreach (DUMMY RANGE ${HALFLINE_LENGTH})
+ set (RESULT "${REPEATING_CHAR}${RESULT}${REPEATING_CHAR}")
+ endforeach()
+ set (RESULT "${LEFTCORNER_CHAR}${RESULT}${RIGHTCORNER_CHAR}")
+ message (STATUS ${RESULT})
+ unset (TEXT_LENGTH)
+endfunction (banner_row)
+
+banner_row (40 "-" " " " " "")
+banner_row (40 " " "/" "\\" "")
+banner_row (40 " " "|" "|" ${BANNER_MESSAGE})
+banner_row (40 " " "\\" "/" "")
+banner_row (40 "-" " " " " "")
+
+
+
+
+
+
diff --git a/org.eclipse.efm.symbex/cmake/SelectSpecificOptions.cmake b/org.eclipse.efm.symbex/cmake/SelectSpecificOptions.cmake
new file mode 100644
index 0000000..e263ad3
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/SelectSpecificOptions.cmake
@@ -0,0 +1,10 @@
+# --- Select system specific directives ---
+
+# Windows/MinGW specific optinos
+if ((WIN32) AND (MINGW) AND (MSYS) AND NOT(CYGWIN) AND NOT (UNIX)) # MSYS2 identification by CMake is not really reliable
+ include (SpecificOptions-WinMSYS2)
+elseif ((UNIX) AND NOT (MSYS) AND NOT (CYGWIN)) # Linux Native
+ include (SpecificOptions-Linux)
+else ()
+ message (WARNING "No specific options for the current system")
+endif ()
diff --git a/org.eclipse.efm.symbex/cmake/SpecificOptions-Linux.cmake b/org.eclipse.efm.symbex/cmake/SpecificOptions-Linux.cmake
new file mode 100644
index 0000000..110c98d
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/SpecificOptions-Linux.cmake
@@ -0,0 +1,81 @@
+# =============================================================================
+# Setup of Native Linux specific options
+# =============================================================================
+#
+#
+# =============================================================================
+
+
+message (STATUS "****** Setting options for Linux/GCC ******")
+
+# Compilation directives
+add_definitions (-D__AVM_UNIX__ -D__AVM_LINUX__)
+add_compile_options (-fmessage-length=0 -pipe)
+
+
+SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lrt" )
+message(" .............................. CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}")
+
+
+#set(Boost_USE_MULTITHREADED OFF)
+#message(" .............................. Boost_USE_MULTITHREADED ${Boost_USE_MULTITHREADED}")
+
+
+
+
+
+
+# The following variables are first used as search hints by find modules.
+# If search failed, they are used by the build modules
+
+# Local configuration
+#set (SYMBEX_INSTALL_DIR /usr/local)
+
+# HIPP (Hudson) configuration
+set (SYMBEX_INSTALL_DIR ${CMAKE_BINARY_DIR}/workswith)
+
+
+set (SYMBEX_INSTALL_INCLUDE_DIR ${SYMBEX_INSTALL_DIR}/include)
+set (SYMBEX_INSTALL_LIB_DIR ${SYMBEX_INSTALL_DIR}/lib)
+
+
+set (CVC4_INSTALL_DIR ${SYMBEX_INSTALL_DIR})
+set (CVC4_INSTALL_INCLUDE_DIR ${SYMBEX_INSTALL_INCLUDE_DIR})
+set (CVC4_INSTALL_LIB_DIR ${SYMBEX_INSTALL_LIB_DIR})
+
+# NOTE: 'antlr2' suffix is automatically added by the configure script
+set (ANTLR2_INSTALL_DIR ${SYMBEX_INSTALL_DIR})
+set (ANTLR2_INSTALL_INCLUDE_DIR ${SYMBEX_INSTALL_INCLUDE_DIR})
+set (ANTLR2_INSTALL_LIB_DIR ${SYMBEX_INSTALL_LIB_DIR})
+
+# NOTE: 'antlr3c' suffix is not automatically added by the configure script
+set (ANTLR3_INSTALL_DIR ${SYMBEX_INSTALL_DIR})
+set (ANTLR3_INSTALL_INCLUDE_DIR ${SYMBEX_INSTALL_INCLUDE_DIR}/antlr3c)
+set (ANTLR3_INSTALL_LIB_DIR ${SYMBEX_INSTALL_LIB_DIR})
+
+
+set (BOOST_ROOT /usr) # instead of /usr/local
+
+set (BOOST_INCLUDEDIR ${BOOST_ROOT}/include/boost)
+#set (BOOST_INCLUDE_DIRS ${BOOST_ROOT}/include)
+#set (BOOST_LIBRARYDIR ${BOOST_ROOT}/lib)
+set (BOOST_LIBRARYDIR /usr/lib/x86_64-linux-gnu/)
+
+#set (BOOST_ROOT /home/diversitytest/boost_1_61_0)
+#set (BOOST_INCLUDEDIR /home/diversitytest/boost_1_61_0/boost)
+#set (BOOST_LIBRARYDIR /home/diversitytest/boost_1_61_0/libs)
+
+
+
+set (GMP_ROOT /usr) # instead of /usr/local
+
+set (GMP_INCLUDEDIR ${GMP_ROOT}/include)
+set (GMP_LIBRARYDIR ${GMP_ROOT}/lib)
+
+include_directories (${CVC4_INSTALL_INCLUDE_DIR} ${ANTLR2_INSTALL_INCLUDE_DIR} ${ANTLR3_INSTALL_INCLUDE_DIR} ${BOOST_INCLUDEDIR})
+
+
+
+
+
+
diff --git a/org.eclipse.efm.symbex/cmake/SpecificOptions-WinMSYS2.cmake b/org.eclipse.efm.symbex/cmake/SpecificOptions-WinMSYS2.cmake
new file mode 100644
index 0000000..3157660
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/SpecificOptions-WinMSYS2.cmake
@@ -0,0 +1,50 @@
+# =============================================================================
+# Setup of Windows/MSYS2 specific options
+# =============================================================================
+#
+# Note : We assume a 64 bits built, which implies the use of
+# /msys64/mingw64 directory for install.
+#
+# Warning : Use Windows style paths not MSYS2 path !
+#
+# =============================================================================
+
+
+message (STATUS "****** Setting options for Windows/MSYS2 ******")
+
+# Compilation directives
+add_definitions (-D__AVM_MINGW__ -D__AVM_WINDOWS__)
+add_compile_options (-fmessage-length=0 -pipe)
+
+# The following variables are first used as search hints by find modules.
+# If search failed, they are used by the build modules (as configure scripts
+# of the prerequisites know nothing about MSYS2, we need to force them to use
+# the MSYS2 install directories)
+
+set (CVC4_INSTALL_INCLUDE_DIR C:/msys64/mingw64/usr/include)
+set (CVC4_INSTALL_LIB_DIR C:/msys64/mingw64/usr/lib)
+
+# NOTE: 'antlr' suffix is automatically added by the configure script
+set (ANTLR2_INSTALL_INCLUDE_DIR C:/msys64/mingw64/usr/include)
+set (ANTLR2_INSTALL_LIB_DIR C:/msys64/mingw64/usr/lib)
+
+set (ANTLR3_INSTALL_INCLUDE_DIR C:/msys64/mingw64/usr/include)
+set (ANTLR3_INSTALL_LIB_DIR C:/msys64/mingw64/usr/lib)
+
+# FIXME : use of .../mingw642 instead of .../mingw64 is compulsory due to a CVC4 configure bug
+set (BOOST_ROOT C:/msys64/mingw642)
+set (BOOST_INCLUDEDIR C:/msys64/mingw642/include) # FIXME
+set (BOOST_LIBRARYDIR C:/msys64/mingw642/include/lib) # FIXME
+
+set (GMP_ROOT C:/msys64/mingw64)
+set (GMP_INCLUDEDIR C:/msys64/mingw64/include)
+set (GMP_LIBRARYDIR C:/msys64/mingw64/lib)
+
+
+
+include_directories (${CVC4_INSTALL_INCLUDE_DIR} ${ANTLR2_INSTALL_INCLUDE_DIR} ${ANTLR3_INSTALL_INCLUDE_DIR})
+
+# FIXME : Temporary bypass for the 'CVC4/configure/boost/mingw64' bug on MSYS2
+set (Boost_INCLUDE_DIRS /mingw642/include)
+set (Boost_LIBRARY_DIRS /mingw642/lib)
+# End FIXME
diff --git a/org.eclipse.efm.symbex/cmake/SpecificOptions-WinMinGW.cmake b/org.eclipse.efm.symbex/cmake/SpecificOptions-WinMinGW.cmake
new file mode 100644
index 0000000..ee301c3
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/SpecificOptions-WinMinGW.cmake
@@ -0,0 +1,28 @@
+# --- Setup of Windows/MinGW specific options ---
+
+message ("Setting specific options for Windows/MinGW...")
+
+# Compilation directives
+add_definitions (-D__AVM_MINGW__ -D__AVM_WINDOWS__)
+add_compile_options (-fmessage-length=0 -pipe)
+
+# Prerequisites default localization
+if (NOT BOOST_ROOT)
+ set (BOOST_ROOT C:/boost-1.53)
+endif ()
+
+if (NOT GMP_ROOT)
+ set (GMP_ROOT C:/GMP)
+endif ()
+
+if (NOT ANTLR_ROOT)
+ set (ANTLR_ROOT C:/ANTLR)
+endif ()
+
+if (NOT CVC4_ROOT)
+ set (CVC4_ROOT C:/CVC4)
+endif ()
+
+if (NOT OMEGA_ROOT)
+ set (OMEGA_ROOT C:/Omega)
+endif ()
diff --git a/org.eclipse.efm.symbex/cmake/antlr2-patch/lib/cpp/antlr/CharScanner.hpp b/org.eclipse.efm.symbex/cmake/antlr2-patch/lib/cpp/antlr/CharScanner.hpp
new file mode 100644
index 0000000..ab1af42
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/antlr2-patch/lib/cpp/antlr/CharScanner.hpp
@@ -0,0 +1,588 @@
+#ifndef INC_CharScanner_hpp__
+#define INC_CharScanner_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id: //depot/code/org.antlr/release/antlr-2.7.7/lib/cpp/antlr/CharScanner.hpp#2 $
+ */
+
+
+/*
+HOTFIX: 2016.07.28
+This file produces a build error on a linux ubuntu platform where antlr is not installed by default
+(it does the download and install process)
+the error says something about "EOF" being not defined; a possible solution is to include the following lib :
+
+#include <stdlib.h>
+ */
+#include <stdlib.h>
+#include <stdio.h>
+
+
+
+#include <antlr/config.hpp>
+#include <cstring> // Patch needed to compile
+#include <map>
+
+#ifdef HAS_NOT_CCTYPE_H
+#include <ctype.h>
+#else
+#include <cctype>
+#endif
+
+#if ( _MSC_VER == 1200 )
+// VC6 seems to need this
+// note that this is not a standard C++ include file.
+# include <stdio.h>
+#endif
+
+#include <antlr/TokenStream.hpp>
+#include <antlr/RecognitionException.hpp>
+#include <antlr/SemanticException.hpp>
+#include <antlr/MismatchedCharException.hpp>
+#include <antlr/InputBuffer.hpp>
+#include <antlr/BitSet.hpp>
+#include <antlr/LexerSharedInputState.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+class ANTLR_API CharScanner;
+
+ANTLR_C_USING(tolower)
+
+#ifdef ANTLR_REALLY_NO_STRCASECMP
+// Apparently, neither strcasecmp nor stricmp is standard, and Codewarrior
+// on the mac has neither...
+inline int strcasecmp(const char *s1, const char *s2)
+{
+ while (true)
+ {
+ char c1 = tolower(*s1++),
+ c2 = tolower(*s2++);
+ if (c1 < c2) return -1;
+ if (c1 > c2) return 1;
+ if (c1 == 0) return 0;
+ }
+}
+#else
+#ifdef NO_STRCASECMP
+ANTLR_C_USING(stricmp)
+#else
+ANTLR_C_USING(strcasecmp)
+#endif
+#endif
+
+/** Functor for the literals map
+ */
+class ANTLR_API CharScannerLiteralsLess : public ANTLR_USE_NAMESPACE(std)binary_function<ANTLR_USE_NAMESPACE(std)string,ANTLR_USE_NAMESPACE(std)string,bool> {
+private:
+ const CharScanner* scanner;
+public:
+#ifdef NO_TEMPLATE_PARTS
+ CharScannerLiteralsLess() {} // not really used, definition to appease MSVC
+#endif
+ CharScannerLiteralsLess(const CharScanner* theScanner)
+ : scanner(theScanner)
+ {
+ }
+ bool operator() (const ANTLR_USE_NAMESPACE(std)string& x,const ANTLR_USE_NAMESPACE(std)string& y) const;
+// defaults are good enough..
+ // CharScannerLiteralsLess(const CharScannerLiteralsLess&);
+ // CharScannerLiteralsLess& operator=(const CharScannerLiteralsLess&);
+};
+
+/** Superclass of generated lexers
+ */
+class ANTLR_API CharScanner : public TokenStream {
+protected:
+ typedef RefToken (*factory_type)();
+public:
+ CharScanner(InputBuffer& cb, bool case_sensitive );
+ CharScanner(InputBuffer* cb, bool case_sensitive );
+ CharScanner(const LexerSharedInputState& state, bool case_sensitive );
+
+ virtual ~CharScanner()
+ {
+ }
+
+ virtual int LA(unsigned int i);
+
+ virtual void append(char c)
+ {
+ if (saveConsumedInput)
+ {
+ size_t l = text.length();
+
+ if ((l%256) == 0)
+ text.reserve(l+256);
+
+ text.replace(l,0,&c,1);
+ }
+ }
+
+ virtual void append(const ANTLR_USE_NAMESPACE(std)string& s)
+ {
+ if( saveConsumedInput )
+ text += s;
+ }
+
+ virtual void commit()
+ {
+ inputState->getInput().commit();
+ }
+
+ /** called by the generated lexer to do error recovery, override to
+ * customize the behaviour.
+ */
+ virtual void recover(const RecognitionException& ex, const BitSet& tokenSet)
+ {
+ consume();
+ consumeUntil(tokenSet);
+ }
+
+ virtual void consume()
+ {
+ if (inputState->guessing == 0)
+ {
+ int c = LA(1);
+ if (caseSensitive)
+ {
+ append(c);
+ }
+ else
+ {
+ // use input.LA(), not LA(), to get original case
+ // CharScanner.LA() would toLower it.
+ append(inputState->getInput().LA(1));
+ }
+
+ // RK: in a sense I don't like this automatic handling.
+ if (c == '\t')
+ tab();
+ else
+ inputState->column++;
+ }
+ inputState->getInput().consume();
+ }
+
+ /** Consume chars until one matches the given char */
+ virtual void consumeUntil(int c)
+ {
+ for(;;)
+ {
+ int la_1 = LA(1);
+ if( la_1 == EOF_CHAR || la_1 == c )
+ break;
+ consume();
+ }
+ }
+
+ /** Consume chars until one matches the given set */
+ virtual void consumeUntil(const BitSet& set)
+ {
+ for(;;)
+ {
+ int la_1 = LA(1);
+ if( la_1 == EOF_CHAR || set.member(la_1) )
+ break;
+ consume();
+ }
+ }
+
+ /// Mark the current position and return a id for it
+ virtual unsigned int mark()
+ {
+ return inputState->getInput().mark();
+ }
+ /// Rewind the scanner to a previously marked position
+ virtual void rewind(unsigned int pos)
+ {
+ inputState->getInput().rewind(pos);
+ }
+
+ /// See if input contains character 'c' throw MismatchedCharException if not
+ virtual void match(int c)
+ {
+ int la_1 = LA(1);
+ if ( la_1 != c )
+ throw MismatchedCharException(la_1, c, false, this);
+ consume();
+ }
+
+ /** See if input contains element from bitset b
+ * throw MismatchedCharException if not
+ */
+ virtual void match(const BitSet& b)
+ {
+ int la_1 = LA(1);
+
+ if ( !b.member(la_1) )
+ throw MismatchedCharException( la_1, b, false, this );
+ consume();
+ }
+
+ /** See if input contains string 's' throw MismatchedCharException if not
+ * @note the string cannot match EOF
+ */
+ virtual void match( const char* s )
+ {
+ while( *s != '\0' )
+ {
+ // the & 0xFF is here to prevent sign extension lateron
+ int la_1 = LA(1), c = (*s++ & 0xFF);
+
+ if ( la_1 != c )
+ throw MismatchedCharException(la_1, c, false, this);
+
+ consume();
+ }
+ }
+ /** See if input contains string 's' throw MismatchedCharException if not
+ * @note the string cannot match EOF
+ */
+ virtual void match(const ANTLR_USE_NAMESPACE(std)string& s)
+ {
+ size_t len = s.length();
+
+ for (size_t i = 0; i < len; i++)
+ {
+ // the & 0xFF is here to prevent sign extension lateron
+ int la_1 = LA(1), c = (s[i] & 0xFF);
+
+ if ( la_1 != c )
+ throw MismatchedCharException(la_1, c, false, this);
+
+ consume();
+ }
+ }
+ /** See if input does not contain character 'c'
+ * throw MismatchedCharException if not
+ */
+ virtual void matchNot(int c)
+ {
+ int la_1 = LA(1);
+
+ if ( la_1 == c )
+ throw MismatchedCharException(la_1, c, true, this);
+
+ consume();
+ }
+ /** See if input contains character in range c1-c2
+ * throw MismatchedCharException if not
+ */
+ virtual void matchRange(int c1, int c2)
+ {
+ int la_1 = LA(1);
+
+ if ( la_1 < c1 || la_1 > c2 )
+ throw MismatchedCharException(la_1, c1, c2, false, this);
+
+ consume();
+ }
+
+ virtual bool getCaseSensitive() const
+ {
+ return caseSensitive;
+ }
+
+ virtual void setCaseSensitive(bool t)
+ {
+ caseSensitive = t;
+ }
+
+ virtual bool getCaseSensitiveLiterals() const=0;
+
+ /// Get the line the scanner currently is in (starts at 1)
+ virtual int getLine() const
+ {
+ return inputState->line;
+ }
+
+ /// set the line number
+ virtual void setLine(int l)
+ {
+ inputState->line = l;
+ }
+
+ /// Get the column the scanner currently is in (starts at 1)
+ virtual int getColumn() const
+ {
+ return inputState->column;
+ }
+ /// set the column number
+ virtual void setColumn(int c)
+ {
+ inputState->column = c;
+ }
+
+ /// get the filename for the file currently used
+ virtual const ANTLR_USE_NAMESPACE(std)string& getFilename() const
+ {
+ return inputState->filename;
+ }
+ /// Set the filename the scanner is using (used in error messages)
+ virtual void setFilename(const ANTLR_USE_NAMESPACE(std)string& f)
+ {
+ inputState->filename = f;
+ }
+
+ virtual bool getCommitToPath() const
+ {
+ return commitToPath;
+ }
+
+ virtual void setCommitToPath(bool commit)
+ {
+ commitToPath = commit;
+ }
+
+ /** return a copy of the current text buffer */
+ virtual const ANTLR_USE_NAMESPACE(std)string& getText() const
+ {
+ return text;
+ }
+
+ virtual void setText(const ANTLR_USE_NAMESPACE(std)string& s)
+ {
+ text = s;
+ }
+
+ virtual void resetText()
+ {
+ text = "";
+ inputState->tokenStartColumn = inputState->column;
+ inputState->tokenStartLine = inputState->line;
+ }
+
+ virtual RefToken getTokenObject() const
+ {
+ return _returnToken;
+ }
+
+ /** Used to keep track of line breaks, needs to be called from
+ * within generated lexers when a \n \r is encountered.
+ */
+ virtual void newline()
+ {
+ ++inputState->line;
+ inputState->column = 1;
+ }
+
+ /** Advance the current column number by an appropriate amount according
+ * to the tabsize. This method needs to be explicitly called from the
+ * lexer rules encountering tabs.
+ */
+ virtual void tab()
+ {
+ int c = getColumn();
+ int nc = ( ((c-1)/tabsize) + 1) * tabsize + 1; // calculate tab stop
+ setColumn( nc );
+ }
+ /// set the tabsize. Returns the old tabsize
+ int setTabsize( int size )
+ {
+ int oldsize = tabsize;
+ tabsize = size;
+ return oldsize;
+ }
+ /// Return the tabsize used by the scanner
+ int getTabSize() const
+ {
+ return tabsize;
+ }
+
+ /** Report exception errors caught in nextToken() */
+ virtual void reportError(const RecognitionException& e);
+
+ /** Parser error-reporting function can be overridden in subclass */
+ virtual void reportError(const ANTLR_USE_NAMESPACE(std)string& s);
+
+ /** Parser warning-reporting function can be overridden in subclass */
+ virtual void reportWarning(const ANTLR_USE_NAMESPACE(std)string& s);
+
+ virtual InputBuffer& getInputBuffer()
+ {
+ return inputState->getInput();
+ }
+
+ virtual LexerSharedInputState getInputState()
+ {
+ return inputState;
+ }
+
+ /** set the input state for the lexer.
+ * @note state is a reference counted object, hence no reference */
+ virtual void setInputState(LexerSharedInputState state)
+ {
+ inputState = state;
+ }
+
+ /// Set the factory for created tokens
+ virtual void setTokenObjectFactory(factory_type factory)
+ {
+ tokenFactory = factory;
+ }
+
+ /** Test the token text against the literals table
+ * Override this method to perform a different literals test
+ */
+ virtual int testLiteralsTable(int ttype) const
+ {
+ ANTLR_USE_NAMESPACE(std)map<ANTLR_USE_NAMESPACE(std)string,int,CharScannerLiteralsLess>::const_iterator i = literals.find(text);
+ if (i != literals.end())
+ ttype = (*i).second;
+ return ttype;
+ }
+
+ /** Test the text passed in against the literals table
+ * Override this method to perform a different literals test
+ * This is used primarily when you want to test a portion of
+ * a token
+ */
+ virtual int testLiteralsTable(const ANTLR_USE_NAMESPACE(std)string& txt,int ttype) const
+ {
+ ANTLR_USE_NAMESPACE(std)map<ANTLR_USE_NAMESPACE(std)string,int,CharScannerLiteralsLess>::const_iterator i = literals.find(txt);
+ if (i != literals.end())
+ ttype = (*i).second;
+ return ttype;
+ }
+
+ /// Override this method to get more specific case handling
+ virtual int toLower(int c) const
+ {
+ // test on EOF_CHAR for buggy (?) STLPort tolower (or HPUX tolower?)
+ // also VC++ 6.0 does this. (see fix 422 (is reverted by this fix)
+ // this one is more structural. Maybe make this configurable.
+ return (c == EOF_CHAR ? EOF_CHAR : tolower(c));
+ }
+
+ /** This method is called by YourLexer::nextToken() when the lexer has
+ * hit EOF condition. EOF is NOT a character.
+ * This method is not called if EOF is reached during
+ * syntactic predicate evaluation or during evaluation
+ * of normal lexical rules, which presumably would be
+ * an IOException. This traps the "normal" EOF condition.
+ *
+ * uponEOF() is called after the complete evaluation of
+ * the previous token and only if your parser asks
+ * for another token beyond that last non-EOF token.
+ *
+ * You might want to throw token or char stream exceptions
+ * like: "Heh, premature eof" or a retry stream exception
+ * ("I found the end of this file, go back to referencing file").
+ */
+ virtual void uponEOF()
+ {
+ }
+
+ /// Methods used to change tracing behavior
+ virtual void traceIndent();
+ virtual void traceIn(const char* rname);
+ virtual void traceOut(const char* rname);
+
+#ifndef NO_STATIC_CONSTS
+ static const int EOF_CHAR = EOF;
+#else
+ enum {
+ EOF_CHAR = EOF
+ };
+#endif
+protected:
+ ANTLR_USE_NAMESPACE(std)string text; ///< Text of current token
+ /// flag indicating wether consume saves characters
+ bool saveConsumedInput;
+ factory_type tokenFactory; ///< Factory for tokens
+ bool caseSensitive; ///< Is this lexer case sensitive
+ ANTLR_USE_NAMESPACE(std)map<ANTLR_USE_NAMESPACE(std)string,int,CharScannerLiteralsLess> literals; // set by subclass
+
+ RefToken _returnToken; ///< used to return tokens w/o using return val
+
+ /// Input state, gives access to input stream, shared among different lexers
+ LexerSharedInputState inputState;
+
+ /** Used during filter mode to indicate that path is desired.
+ * A subsequent scan error will report an error as usual
+ * if acceptPath=true;
+ */
+ bool commitToPath;
+
+ int tabsize; ///< tab size the scanner uses.
+
+ /// Create a new RefToken of type t
+ virtual RefToken makeToken(int t)
+ {
+ RefToken tok = tokenFactory();
+ tok->setType(t);
+ tok->setColumn(inputState->tokenStartColumn);
+ tok->setLine(inputState->tokenStartLine);
+ return tok;
+ }
+
+ /** Tracer class, used when -traceLexer is passed to antlr
+ */
+ class Tracer {
+ private:
+ CharScanner* parser;
+ const char* text;
+
+ Tracer(const Tracer& other); // undefined
+ Tracer& operator=(const Tracer& other); // undefined
+ public:
+ Tracer( CharScanner* p,const char* t )
+ : parser(p), text(t)
+ {
+ parser->traceIn(text);
+ }
+ ~Tracer()
+ {
+ parser->traceOut(text);
+ }
+ };
+
+ int traceDepth;
+private:
+ CharScanner( const CharScanner& other ); // undefined
+ CharScanner& operator=( const CharScanner& other ); // undefined
+
+#ifndef NO_STATIC_CONSTS
+ static const int NO_CHAR = 0;
+#else
+ enum {
+ NO_CHAR = 0
+ };
+#endif
+};
+
+inline int CharScanner::LA(unsigned int i)
+{
+ int c = inputState->getInput().LA(i);
+
+ if ( caseSensitive )
+ return c;
+ else
+ return toLower(c); // VC 6 tolower bug caught in toLower.
+}
+
+inline bool CharScannerLiteralsLess::operator() (const ANTLR_USE_NAMESPACE(std)string& x,const ANTLR_USE_NAMESPACE(std)string& y) const
+{
+ if (scanner->getCaseSensitiveLiterals())
+ return ANTLR_USE_NAMESPACE(std)less<ANTLR_USE_NAMESPACE(std)string>()(x,y);
+ else
+ {
+#ifdef NO_STRCASECMP
+ return (stricmp(x.c_str(),y.c_str())<0);
+#else
+ return (strcasecmp(x.c_str(),y.c_str())<0);
+#endif
+ }
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_CharScanner_hpp__
diff --git a/org.eclipse.efm.symbex/cmake/antlr2-patch/scripts/config.guess b/org.eclipse.efm.symbex/cmake/antlr2-patch/scripts/config.guess
new file mode 100644
index 0000000..b79252d
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/antlr2-patch/scripts/config.guess
@@ -0,0 +1,1558 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright 1992-2013 Free Software Foundation, Inc.
+
+timestamp='2013-06-10'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+#
+# Originally written by Per Bothner.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+#
+# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright 1992-2013 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+ # If the system lacks a compiler, then just pick glibc.
+ # We could probably try harder.
+ LIBC=gnu
+
+ eval $set_cc_for_build
+ cat <<-EOF > $dummy.c
+ #include <features.h>
+ #if defined(__UCLIBC__)
+ LIBC=uclibc
+ #elif defined(__dietlibc__)
+ LIBC=dietlibc
+ #else
+ LIBC=gnu
+ #endif
+ EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ ;;
+esac
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ELF__
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit ;;
+ *:Bitrig:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit ;;
+ *:SolidBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ alpha:OSF1:*:*)
+ case $UNAME_RELEASE in
+ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ exitcode=$?
+ trap '' 0
+ exit $exitcode ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit ;;
+ arm*:riscos:*:*|arm*:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit ;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
+ s390x:SunOS:*:*)
+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+ echo i386-pc-auroraux${UNAME_RELEASE}
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ eval $set_cc_for_build
+ SUN_ARCH="i386"
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH="x86_64"
+ fi
+ fi
+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c &&
+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`$dummy $dummyarg` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit ;;
+ *:AIX:*:[4567])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ eval $set_cc_for_build
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep -q __LP64__
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo unknown-hitachi-hiuxwe2
+ exit ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ *:UNICOS/mp:*:*)
+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:FreeBSD:*:*)
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ case ${UNAME_PROCESSOR} in
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit ;;
+ *:MINGW64*:*)
+ echo ${UNAME_MACHINE}-pc-mingw64
+ exit ;;
+ *:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
+ i*:MSYS*:*)
+ echo ${UNAME_MACHINE}-pc-msys
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit ;;
+ *:Interix*:*)
+ case ${UNAME_MACHINE} in
+ x86)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ authenticamd | genuineintel | EM64T)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ IA64)
+ echo ia64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ esac ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit ;;
+ 8664:Windows_NT:*)
+ echo x86_64-pc-mks
+ exit ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+ exit ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit ;;
+ aarch64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ aarch64_be:Linux:*:*)
+ UNAME_MACHINE=aarch64_be
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+ if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ arc:Linux:*:* | arceb:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ arm*:Linux:*:*)
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ else
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+ fi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ cris:Linux:*:*)
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ exit ;;
+ crisv32:Linux:*:*)
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ exit ;;
+ frv:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ hexagon:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ i*86:Linux:*:*)
+ echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+ exit ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ mips:Linux:*:* | mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef ${UNAME_MACHINE}
+ #undef ${UNAME_MACHINE}el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=${UNAME_MACHINE}el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=${UNAME_MACHINE}
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+ ;;
+ or1k:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ or32:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-${LIBC}
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-${LIBC}
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+ PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+ *) echo hppa-unknown-linux-${LIBC} ;;
+ esac
+ exit ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-${LIBC}
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-${LIBC}
+ exit ;;
+ ppc64le:Linux:*:*)
+ echo powerpc64le-unknown-linux-${LIBC}
+ exit ;;
+ ppcle:Linux:*:*)
+ echo powerpcle-unknown-linux-${LIBC}
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+ exit ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ tile*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+ exit ;;
+ x86_64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
+ # Note: whatever this is, it MUST be the same as what config.sub
+ # prints for the "djgpp" host, or else GDB configury will decide that
+ # this is a cross-build.
+ echo i586-pc-msdosdjgpp
+ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo ${UNAME_MACHINE}-stratus-vos
+ exit ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
+ x86_64:Haiku:*:*)
+ echo x86_64-unknown-haiku
+ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-7:SUPER-UX:*:*)
+ echo sx7-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8:SUPER-UX:*:*)
+ echo sx8-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
+ echo sx8r-nec-superux${UNAME_RELEASE}
+ exit ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ eval $set_cc_for_build
+ if test "$UNAME_PROCESSOR" = unknown ; then
+ UNAME_PROCESSOR=powerpc
+ fi
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ case $UNAME_PROCESSOR in
+ i386) UNAME_PROCESSOR=x86_64 ;;
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
+ esac
+ fi
+ fi
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
+ NEO-?:NONSTOP_KERNEL:*:*)
+ echo neo-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSE-*:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ exit ;;
+ i*86:rdos:*:*)
+ echo ${UNAME_MACHINE}-pc-rdos
+ exit ;;
+ i*86:AROS:*:*)
+ echo ${UNAME_MACHINE}-pc-aros
+ exit ;;
+ x86_64:VMkernel:*:*)
+ echo ${UNAME_MACHINE}-unknown-esx
+ exit ;;
+esac
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ c34*)
+ echo c34-convex-bsd
+ exit ;;
+ c38*)
+ echo c38-convex-bsd
+ exit ;;
+ c4*)
+ echo c4-convex-bsd
+ exit ;;
+ esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/org.eclipse.efm.symbex/cmake/antlr2-patch/scripts/config.sub b/org.eclipse.efm.symbex/cmake/antlr2-patch/scripts/config.sub
new file mode 100644
index 0000000..9633db7
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/antlr2-patch/scripts/config.sub
@@ -0,0 +1,1791 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright 1992-2013 Free Software Foundation, Inc.
+
+timestamp='2013-08-10'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+
+
+# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright 1992-2013 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit ;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ android-linux)
+ os=-linux-android
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis | -knuth | -cray | -microblaze*)
+ os=
+ basic_machine=$1
+ ;;
+ -bluegene*)
+ os=-cnk
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco6)
+ os=-sco5v6
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*178)
+ os=-lynxos178
+ ;;
+ -lynx*5)
+ os=-lynxos5
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | aarch64 | aarch64_be \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arceb \
+ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+ | avr | avr32 \
+ | be32 | be64 \
+ | bfin \
+ | c4x | c8051 | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | epiphany \
+ | fido | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k | iq2000 \
+ | le32 | le64 \
+ | lm32 \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipsr5900 | mipsr5900el \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+ | nds32 | nds32le | nds32be \
+ | nios | nios2 | nios2eb | nios2el \
+ | ns16k | ns32k \
+ | open8 \
+ | or1k | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle \
+ | pyramid \
+ | rl78 | rx \
+ | score \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+ | spu \
+ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+ | ubicom32 \
+ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+ | we32k \
+ | x86 | xc16x | xstormy16 | xtensa \
+ | z8k | z80)
+ basic_machine=$basic_machine-unknown
+ ;;
+ c54x)
+ basic_machine=tic54x-unknown
+ ;;
+ c55x)
+ basic_machine=tic55x-unknown
+ ;;
+ c6x)
+ basic_machine=tic6x-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
+
+ strongarm | thumb | xscale)
+ basic_machine=arm-unknown
+ ;;
+ xgate)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ xscaleeb)
+ basic_machine=armeb-unknown
+ ;;
+
+ xscaleel)
+ basic_machine=armel-unknown
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | aarch64-* | aarch64_be-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* | avr32-* \
+ | be32-* | be64-* \
+ | bfin-* | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* \
+ | c8051-* | clipper-* | craynv-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | hexagon-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | le32-* | le64-* \
+ | lm32-* \
+ | m32c-* | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ | microblaze-* | microblazeel-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64octeon-* | mips64octeonel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64r5900-* | mips64r5900el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipsr5900-* | mipsr5900el-* \
+ | mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
+ | msp430-* \
+ | nds32-* | nds32le-* | nds32be-* \
+ | nios-* | nios2-* | nios2eb-* | nios2el-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | open8-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+ | pyramid-* \
+ | rl78-* | romp-* | rs6000-* | rx-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+ | tahoe-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tile*-* \
+ | tron-* \
+ | ubicom32-* \
+ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+ | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* \
+ | xstormy16-* | xtensa*-* \
+ | ymp-* \
+ | z8k-* | z80-*)
+ ;;
+ # Recognize the basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ os=-aros
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ bluegene*)
+ basic_machine=powerpc-ibm
+ os=-cnk
+ ;;
+ c54x-*)
+ basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c55x-*)
+ basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c6x-*)
+ basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=-cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16 | cr16-*)
+ basic_machine=cr16-unknown
+ os=-elf
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ os=-dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ microblaze*)
+ basic_machine=microblaze-xilinx
+ ;;
+ mingw64)
+ basic_machine=x86_64-pc
+ os=-mingw64
+ ;;
+ mingw32)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ os=-mingw32ce
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ ms1-*)
+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ ;;
+ msys)
+ basic_machine=i686-pc
+ os=-msys
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ nacl)
+ basic_machine=le32-unknown
+ os=-nacl
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ neo-tandem)
+ basic_machine=neo-tandem
+ ;;
+ nse-tandem)
+ basic_machine=nse-tandem
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ openrisc | openrisc-*)
+ basic_machine=or32-unknown
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc | ppcbe) basic_machine=powerpc-unknown
+ ;;
+ ppc-* | ppcbe-*)
+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rdos | rdos64)
+ basic_machine=x86_64-pc
+ os=-rdos
+ ;;
+ rdos32)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sde)
+ basic_machine=mipsisa32-sde
+ os=-elf
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh5el)
+ basic_machine=sh5le-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ strongarm-* | thumb-*)
+ basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tile*)
+ basic_machine=$basic_machine-unknown
+ os=-linux-gnu
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ xscale-* | xscalee[bl]-*)
+ basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ z80-*-coff)
+ basic_machine=z80-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -auroraux)
+ os=-auroraux
+ ;;
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+ | -sym* | -kopensolaris* | -plan9* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* | -aros* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -bitrig* | -openbsd* | -solidbsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-musl* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -os400*)
+ os=-os400
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -syllable*)
+ os=-syllable
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -tpf*)
+ os=-tpf
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -dicos*)
+ os=-dicos
+ ;;
+ -nacl*)
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ score-*)
+ os=-elf
+ ;;
+ spu-*)
+ os=-elf
+ ;;
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ c8051-*)
+ os=-elf
+ ;;
+ hexagon-*)
+ os=-elf
+ ;;
+ tic54x-*)
+ os=-coff
+ ;;
+ tic55x-*)
+ os=-coff
+ ;;
+ tic6x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mep-*)
+ os=-elf
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or1k-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-haiku)
+ os=-haiku
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-knuth)
+ os=-mmixware
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -cnk*|-aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -tpf*)
+ vendor=ibm
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/org.eclipse.efm.symbex/cmake/cvc4-1.4-patch/config/boost-v2.m4 b/org.eclipse.efm.symbex/cmake/cvc4-1.4-patch/config/boost-v2.m4
new file mode 100644
index 0000000..27d063f
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/cvc4-1.4-patch/config/boost-v2.m4
@@ -0,0 +1,1560 @@
+# boost.m4: Locate Boost headers and libraries for autoconf-based projects.
+# Copyright (C) 2007-2011, 2014 Benoit Sigoure <tsuna@lrde.epita.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Additional permission under section 7 of the GNU General Public
+# License, version 3 ("GPLv3"):
+#
+# If you convey this file as part of a work that contains a
+# configuration script generated by Autoconf, you may do so under
+# terms of your choice.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+m4_define([_BOOST_SERIAL], [m4_translit([
+# serial 25
+], [#
+], [])])
+
+# Original sources can be found at http://github.com/tsuna/boost.m4
+# You can fetch the latest version of the script by doing:
+# wget http://github.com/tsuna/boost.m4/raw/master/build-aux/boost.m4
+
+# ------ #
+# README #
+# ------ #
+
+# This file provides several macros to use the various Boost libraries.
+# The first macro is BOOST_REQUIRE. It will simply check if it's possible to
+# find the Boost headers of a given (optional) minimum version and it will
+# define BOOST_CPPFLAGS accordingly. It will add an option --with-boost to
+# your configure so that users can specify non standard locations.
+# If the user's environment contains BOOST_ROOT and --with-boost was not
+# specified, --with-boost=$BOOST_ROOT is implicitly used.
+# For more README and documentation, go to http://github.com/tsuna/boost.m4
+# Note: THESE MACROS ASSUME THAT YOU USE LIBTOOL. If you don't, don't worry,
+# simply read the README, it will show you what to do step by step.
+
+m4_pattern_forbid([^_?(BOOST|Boost)_])
+
+
+# _BOOST_SED_CPP(SED-PROGRAM, PROGRAM,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# --------------------------------------------------------
+# Same as AC_EGREP_CPP, but leave the result in conftest.i.
+#
+# SED-PROGRAM is *not* overquoted, as in AC_EGREP_CPP. It is expanded
+# in double-quotes, so escape your double quotes.
+#
+# It could be useful to turn this into a macro which extracts the
+# value of any macro.
+m4_define([_BOOST_SED_CPP],
+[AC_LANG_PUSH([C++])dnl
+AC_LANG_PREPROC_REQUIRE()dnl
+AC_REQUIRE([AC_PROG_SED])dnl
+AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])])
+AS_IF([dnl eval is necessary to expand ac_cpp.
+dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
+dnl Beware of Windows end-of-lines, for instance if we are running
+dnl some Windows programs under Wine. In that case, boost/version.hpp
+dnl is certainly using "\r\n", but the regular Unix shell will only
+dnl strip `\n' with backquotes, not the `\r'. This results in
+dnl boost_cv_lib_version='1_37\r' for instance, which breaks
+dnl everything else.
+dnl Cannot use 'dnl' after [$4] because a trailing dnl may break AC_CACHE_CHECK
+dnl
+dnl Beware that GCC 5, when expanding macros, may embed # line directives
+dnl a within single line:
+dnl
+dnl # 1 "conftest.cc"
+dnl # 1 "<built-in>"
+dnl # 1 "<command-line>"
+dnl # 1 "conftest.cc"
+dnl # 1 "/opt/local/include/boost/version.hpp" 1 3
+dnl # 2 "conftest.cc" 2
+dnl boost-lib-version =
+dnl # 2 "conftest.cc" 3
+dnl "1_56"
+dnl
+dnl So get rid of the # lines, and glue the remaining ones together.
+(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+ grep -v '#' |
+ tr -d '\r' |
+ tr -s '\n' ' ' |
+ $SED -n -e "$1" >conftest.i 2>&1],
+ [$3],
+ [$4])
+rm -rf conftest*
+AC_LANG_POP([C++])dnl
+])# _BOOST_SED_CPP
+
+
+
+# BOOST_REQUIRE([VERSION], [ACTION-IF-NOT-FOUND])
+# -----------------------------------------------
+# Look for Boost. If version is given, it must either be a literal of the form
+# "X.Y.Z" where X, Y and Z are integers (the ".Z" part being optional) or a
+# variable "$var".
+# Defines the value BOOST_CPPFLAGS. This macro only checks for headers with
+# the required version, it does not check for any of the Boost libraries.
+# On # success, defines HAVE_BOOST. On failure, calls the optional
+# ACTION-IF-NOT-FOUND action if one was supplied.
+# Otherwise aborts with an error message.
+AC_DEFUN_ONCE([BOOST_REQUIRE],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_PROG_GREP])dnl
+echo "$as_me: this is boost.m4[]_BOOST_SERIAL" >&AS_MESSAGE_LOG_FD
+boost_save_IFS=$IFS
+boost_version_req=$1
+IFS=.
+set x $boost_version_req 0 0 0
+IFS=$boost_save_IFS
+shift
+boost_version_req=`expr "$[1]" '*' 100000 + "$[2]" '*' 100 + "$[3]"`
+boost_version_req_string=$[1].$[2].$[3]
+AC_ARG_WITH([boost],
+ [AS_HELP_STRING([--with-boost=DIR],
+ [prefix of Boost $1 @<:@guess@:>@])])dnl
+AC_ARG_VAR([BOOST_ROOT],[Location of Boost installation])dnl
+# If BOOST_ROOT is set and the user has not provided a value to
+# --with-boost, then treat BOOST_ROOT as if it the user supplied it.
+if test x"$BOOST_ROOT" != x; then
+ if test x"$with_boost" = x; then
+ AC_MSG_NOTICE([Detected BOOST_ROOT; continuing with --with-boost=$BOOST_ROOT])
+ with_boost=$BOOST_ROOT
+ else
+ AC_MSG_NOTICE([Detected BOOST_ROOT=$BOOST_ROOT, but overridden by --with-boost=$with_boost])
+ fi
+fi
+AC_SUBST([DISTCHECK_CONFIGURE_FLAGS],
+ ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"])dnl
+boost_save_CPPFLAGS=$CPPFLAGS
+ AC_CACHE_CHECK([for Boost headers version >= $boost_version_req_string],
+ [boost_cv_inc_path],
+ [boost_cv_inc_path=no
+AC_LANG_PUSH([C++])dnl
+m4_pattern_allow([^BOOST_VERSION$])dnl
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#include <boost/version.hpp>
+#if !defined BOOST_VERSION
+# error BOOST_VERSION is not defined
+#elif BOOST_VERSION < $boost_version_req
+# error Boost headers version < $boost_version_req
+#endif
+]])])
+ # If the user provided a value to --with-boost, use it and only it.
+ case $with_boost in #(
+ ''|yes) set x '' /opt/local/include /usr/local/include /opt/include \
+ /usr/include C:/Boost/include;; #(
+ *) set x "$with_boost/include" "$with_boost";;
+ esac
+ shift
+ for boost_dir
+ do
+ # Without --layout=system, Boost (or at least some versions) installs
+ # itself in <prefix>/include/boost-<version>. This inner loop helps to
+ # find headers in such directories.
+ #
+ # Any ${boost_dir}/boost-x_xx directories are searched in reverse version
+ # order followed by ${boost_dir}. The final '.' is a sentinel for
+ # searching $boost_dir" itself. Entries are whitespace separated.
+ #
+ # I didn't indent this loop on purpose (to avoid over-indented code)
+ boost_layout_system_search_list=`cd "$boost_dir" 2>/dev/null \
+ && ls -1 | "${GREP}" '^boost-' | sort -rn -t- -k2 \
+ && echo .`
+ for boost_inc in $boost_layout_system_search_list
+ do
+ if test x"$boost_inc" != x.; then
+ boost_inc="$boost_dir/$boost_inc"
+ else
+ boost_inc="$boost_dir" # Uses sentinel in boost_layout_system_search_list
+ fi
+ if test x"$boost_inc" != x; then
+ # We are going to check whether the version of Boost installed
+ # in $boost_inc is usable by running a compilation that
+ # #includes it. But if we pass a -I/some/path in which Boost
+ # is not installed, the compiler will just skip this -I and
+ # use other locations (either from CPPFLAGS, or from its list
+ # of system include directories). As a result we would use
+ # header installed on the machine instead of the /some/path
+ # specified by the user. So in that precise case (trying
+ # $boost_inc), make sure the version.hpp exists.
+ #
+ # Use test -e as there can be symlinks.
+ test -e "$boost_inc/boost/version.hpp" || continue
+ CPPFLAGS="$CPPFLAGS -I$boost_inc"
+ fi
+ AC_COMPILE_IFELSE([], [boost_cv_inc_path=yes], [boost_cv_version=no])
+ if test x"$boost_cv_inc_path" = xyes; then
+ if test x"$boost_inc" != x; then
+ boost_cv_inc_path=$boost_inc
+ fi
+ break 2
+ fi
+ done
+ done
+AC_LANG_POP([C++])dnl
+ ])
+ case $boost_cv_inc_path in #(
+ no)
+ boost_errmsg="cannot find Boost headers version >= $boost_version_req_string"
+ m4_if([$2], [], [AC_MSG_ERROR([$boost_errmsg])],
+ [AC_MSG_NOTICE([$boost_errmsg])])
+ $2
+ ;;#(
+ yes)
+ BOOST_CPPFLAGS=
+ ;;#(
+ *)
+ AC_SUBST([BOOST_CPPFLAGS], ["-I$boost_cv_inc_path"])dnl
+ ;;
+ esac
+ if test x"$boost_cv_inc_path" != xno; then
+ AC_DEFINE([HAVE_BOOST], [1],
+ [Defined if the requested minimum BOOST version is satisfied])
+ AC_CACHE_CHECK([for Boost's header version],
+ [boost_cv_lib_version],
+ [m4_pattern_allow([^BOOST_LIB_VERSION$])dnl
+ _BOOST_SED_CPP([[/^boost-lib-version = /{s///;s/[\" ]//g;p;q;}]],
+ [#include <boost/version.hpp>
+boost-lib-version = BOOST_LIB_VERSION],
+ [boost_cv_lib_version=`cat conftest.i`])])
+ # e.g. "134" for 1_34_1 or "135" for 1_35
+ boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'`
+ case $boost_major_version in #(
+ '' | *[[!0-9]]*)
+ AC_MSG_ERROR([invalid value: boost_major_version='$boost_major_version'])
+ ;;
+ esac
+fi
+CPPFLAGS=$boost_save_CPPFLAGS
+])# BOOST_REQUIRE
+
+
+# BOOST_STATIC()
+# --------------
+# Add the "--enable-static-boost" configure argument. If this argument is given
+# on the command line, static versions of the libraries will be looked up.
+AC_DEFUN([BOOST_STATIC],
+ [AC_ARG_ENABLE([static-boost],
+ [AS_HELP_STRING([--enable-static-boost],
+ [Prefer the static boost libraries over the shared ones [no]])],
+ [enable_static_boost=yes],
+ [enable_static_boost=no])])# BOOST_STATIC
+
+
+# BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND])
+# --------------------------------------------------------------------------
+# Wrapper around AC_CHECK_HEADER for Boost headers. Useful to check for
+# some parts of the Boost library which are only made of headers and don't
+# require linking (such as Boost.Foreach).
+#
+# Default ACTION-IF-NOT-FOUND: Fail with a fatal error unless Boost couldn't be
+# found in the first place, in which case by default a notice is issued to the
+# user. Presumably if we haven't died already it's because it's OK to not have
+# Boost, which is why only a notice is issued instead of a hard error.
+#
+# Default ACTION-IF-FOUND: define the preprocessor symbol HAVE_<HEADER-NAME> in
+# case of success # (where HEADER-NAME is written LIKE_THIS, e.g.,
+# HAVE_BOOST_FOREACH_HPP).
+AC_DEFUN([BOOST_FIND_HEADER],
+[AC_REQUIRE([BOOST_REQUIRE])dnl
+if test x"$boost_cv_inc_path" = xno; then
+ m4_default([$2], [AC_MSG_NOTICE([Boost not available, not searching for $1])])
+else
+AC_LANG_PUSH([C++])dnl
+boost_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+AC_CHECK_HEADER([$1],
+ [m4_default([$3], [AC_DEFINE(AS_TR_CPP([HAVE_$1]), [1],
+ [Define to 1 if you have <$1>])])],
+ [m4_default([$2], [AC_MSG_ERROR([cannot find $1])])])
+CPPFLAGS=$boost_save_CPPFLAGS
+AC_LANG_POP([C++])dnl
+fi
+])# BOOST_FIND_HEADER
+
+
+# BOOST_FIND_LIBS([COMPONENT-NAME], [CANDIDATE-LIB-NAMES],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Look for the Boost library COMPONENT-NAME (e.g., `thread', for
+# libboost_thread) under the possible CANDIDATE-LIB-NAMES (e.g.,
+# "thread_win32 thread"). Check that HEADER-NAME works and check that
+# libboost_LIB-NAME can link with the code CXX-TEST. The optional
+# argument CXX-PROLOGUE can be used to include some C++ code before
+# the `main' function.
+#
+# Invokes BOOST_FIND_HEADER([HEADER-NAME]) (see above).
+#
+# Boost libraries typically come compiled with several flavors (with different
+# runtime options) so PREFERRED-RT-OPT is the preferred suffix. A suffix is one
+# or more of the following letters: sgdpn (in that order). s = static
+# runtime, d = debug build, g = debug/diagnostic runtime, p = STLPort build,
+# n = (unsure) STLPort build without iostreams from STLPort (it looks like `n'
+# must always be used along with `p'). Additionally, PREFERRED-RT-OPT can
+# start with `mt-' to indicate that there is a preference for multi-thread
+# builds. Some sample values for PREFERRED-RT-OPT: (nothing), mt, d, mt-d, gdp
+# ... If you want to make sure you have a specific version of Boost
+# (eg, >= 1.33) you *must* invoke BOOST_REQUIRE before this macro.
+AC_DEFUN([BOOST_FIND_LIBS],
+[AC_REQUIRE([BOOST_REQUIRE])dnl
+AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl
+AC_REQUIRE([BOOST_STATIC])dnl
+AC_REQUIRE([_BOOST_GUESS_WHETHER_TO_USE_MT])dnl
+if test x"$boost_cv_inc_path" = xno; then
+ AC_MSG_NOTICE([Boost not available, not searching for the Boost $1 library])
+else
+dnl The else branch is huge and wasn't intended on purpose.
+AC_LANG_PUSH([C++])dnl
+AS_VAR_PUSHDEF([Boost_lib], [boost_cv_lib_$1])dnl
+AS_VAR_PUSHDEF([Boost_lib_LDFLAGS], [boost_cv_lib_$1_LDFLAGS])dnl
+AS_VAR_PUSHDEF([Boost_lib_LDPATH], [boost_cv_lib_$1_LDPATH])dnl
+AS_VAR_PUSHDEF([Boost_lib_LIBS], [boost_cv_lib_$1_LIBS])dnl
+BOOST_FIND_HEADER([$4])
+boost_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib],
+ [_BOOST_FIND_LIBS($@)])
+case $Boost_lib in #(
+ (no) _AC_MSG_LOG_CONFTEST
+ AC_MSG_ERROR([cannot find the flags to link with Boost $1])
+ ;;
+esac
+AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS])dnl
+AC_SUBST(AS_TR_CPP([BOOST_$1_LDPATH]), [$Boost_lib_LDPATH])dnl
+AC_SUBST([BOOST_LDPATH], [$Boost_lib_LDPATH])dnl
+AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS])dnl
+CPPFLAGS=$boost_save_CPPFLAGS
+AS_VAR_POPDEF([Boost_lib])dnl
+AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl
+AS_VAR_POPDEF([Boost_lib_LDPATH])dnl
+AS_VAR_POPDEF([Boost_lib_LIBS])dnl
+AC_LANG_POP([C++])dnl
+fi
+])
+
+
+# BOOST_FIND_LIB([LIB-NAME],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Backward compatibility wrapper for BOOST_FIND_LIBS.
+AC_DEFUN([BOOST_FIND_LIB],
+[BOOST_FIND_LIBS([$1], $@)])
+
+
+# _BOOST_FIND_LIBS([LIB-NAME], [CANDIDATE-LIB-NAMES],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Real implementation of BOOST_FIND_LIBS: rely on these local macros:
+# Boost_lib, Boost_lib_LDFLAGS, Boost_lib_LDPATH, Boost_lib_LIBS
+#
+# The algorithm is as follows: first look for a given library name
+# according to the user's PREFERRED-RT-OPT. For each library name, we
+# prefer to use the ones that carry the tag (toolset name). Each
+# library is searched through the various standard paths were Boost is
+# usually installed. If we can't find the standard variants, we try
+# to enforce -mt (for instance on MacOSX, libboost_thread.dylib
+# doesn't exist but there's -obviously- libboost_thread-mt.dylib).
+AC_DEFUN([_BOOST_FIND_LIBS],
+[Boost_lib=no
+ case "$3" in #(
+ (mt | mt-) boost_mt=-mt; boost_rtopt=;; #(
+ (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$3" : 'Xmt-*\(.*\)'`;; #(
+ (*) boost_mt=; boost_rtopt=$3;;
+ esac
+ if test $enable_static_boost = yes; then
+ boost_rtopt="s$boost_rtopt"
+ fi
+ # Find the proper debug variant depending on what we've been asked to find.
+ case $boost_rtopt in #(
+ (*d*) boost_rt_d=$boost_rtopt;; #(
+ (*[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn')
+ boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #(
+ (*) boost_rt_d='-d';;
+ esac
+ # If the PREFERRED-RT-OPT are not empty, prepend a `-'.
+ test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt"
+ $boost_guess_use_mt && boost_mt=-mt
+ # Look for the abs path the static archive.
+ # $libext is computed by Libtool but let's make sure it's non empty.
+ test -z "$libext" &&
+ AC_MSG_ERROR([the libext variable is empty, did you invoke Libtool?])
+ boost_save_ac_objext=$ac_objext
+ # Generate the test file.
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$4>
+$6], [$5])])
+dnl Optimization hacks: compiling C++ is slow, especially with Boost. What
+dnl we're trying to do here is guess the right combination of link flags
+dnl (LIBS / LDFLAGS) to use a given library. This can take several
+dnl iterations before it succeeds and is thus *very* slow. So what we do
+dnl instead is that we compile the code first (and thus get an object file,
+dnl typically conftest.o). Then we try various combinations of link flags
+dnl until we succeed to link conftest.o in an executable. The problem is
+dnl that the various TRY_LINK / COMPILE_IFELSE macros of Autoconf always
+dnl remove all the temporary files including conftest.o. So the trick here
+dnl is to temporarily change the value of ac_objext so that conftest.o is
+dnl preserved accross tests. This is obviously fragile and I will burn in
+dnl hell for not respecting Autoconf's documented interfaces, but in the
+dnl mean time, it optimizes the macro by a factor of 5 to 30.
+dnl Another small optimization: the first argument of AC_COMPILE_IFELSE left
+dnl empty because the test file is generated only once above (before we
+dnl start the for loops).
+ AC_COMPILE_IFELSE([],
+ [ac_objext=do_not_rm_me_plz],
+ [AC_MSG_ERROR([cannot compile a test that uses Boost $1])])
+ ac_objext=$boost_save_ac_objext
+ boost_failed_libs=
+# Don't bother to ident the following nested for loops, only the 2
+# innermost ones matter.
+for boost_lib_ in $2; do
+for boost_tag_ in -$boost_cv_lib_tag ''; do
+for boost_ver_ in -$boost_cv_lib_version ''; do
+for boost_mt_ in $boost_mt -mt ''; do
+for boost_rtopt_ in $boost_rtopt '' -d; do
+ for boost_lib in \
+ boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_ver_
+ do
+ # Avoid testing twice the same lib
+ case $boost_failed_libs in #(
+ (*@$boost_lib@*) continue;;
+ esac
+ # If with_boost is empty, we'll search in /lib first, which is not quite
+ # right so instead we'll try to a location based on where the headers are.
+ boost_tmp_lib=$with_boost
+ test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include}
+ for boost_ldpath in "$boost_tmp_lib/lib" '' \
+ /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \
+ "$with_boost" C:/Boost/lib /lib*
+ do
+ # Don't waste time with directories that don't exist.
+ if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then
+ continue
+ fi
+ boost_save_LDFLAGS=$LDFLAGS
+ # Are we looking for a static library?
+ case $boost_ldpath:$boost_rtopt_ in #(
+ (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt)
+ Boost_lib_LIBS="$boost_ldpath/lib$boost_lib.$libext"
+ test -e "$Boost_lib_LIBS" || continue;; #(
+ (*) # No: use -lboost_foo to find the shared library.
+ Boost_lib_LIBS="-l$boost_lib";;
+ esac
+ boost_save_LIBS=$LIBS
+ LIBS="$Boost_lib_LIBS $LIBS"
+ test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath"
+dnl First argument of AC_LINK_IFELSE left empty because the test file is
+dnl generated only once above (before we start the for loops).
+ _BOOST_AC_LINK_IFELSE([],
+ [Boost_lib=yes], [Boost_lib=no])
+ ac_objext=$boost_save_ac_objext
+ LDFLAGS=$boost_save_LDFLAGS
+ LIBS=$boost_save_LIBS
+ if test x"$Boost_lib" = xyes; then
+ # Check or used cached result of whether or not using -R or
+ # -rpath makes sense. Some implementations of ld, such as for
+ # Mac OSX, require -rpath but -R is the flag known to work on
+ # other systems. https://github.com/tsuna/boost.m4/issues/19
+ AC_CACHE_VAL([boost_cv_rpath_link_ldflag],
+ [case $boost_ldpath in
+ '') # Nothing to do.
+ boost_cv_rpath_link_ldflag=
+ boost_rpath_link_ldflag_found=yes;;
+ *)
+ for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do
+ LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
+ LIBS="$boost_save_LIBS $Boost_lib_LIBS"
+ _BOOST_AC_LINK_IFELSE([],
+ [boost_rpath_link_ldflag_found=yes
+ break],
+ [boost_rpath_link_ldflag_found=no])
+ done
+ ;;
+ esac
+ AS_IF([test "x$boost_rpath_link_ldflag_found" != "xyes"],
+ [AC_MSG_ERROR([Unable to determine whether to use -R or -rpath])])
+ LDFLAGS=$boost_save_LDFLAGS
+ LIBS=$boost_save_LIBS
+ ])
+ test x"$boost_ldpath" != x &&
+ Boost_lib_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
+ Boost_lib_LDPATH="$boost_ldpath"
+ break 7
+ else
+ boost_failed_libs="$boost_failed_libs@$boost_lib@"
+ fi
+ done
+ done
+done
+done
+done
+done
+done # boost_lib_
+rm -f conftest.$ac_objext
+])
+
+
+
+# --------------------------------------- #
+# Checks for the various Boost libraries. #
+# --------------------------------------- #
+
+# List of boost libraries: http://www.boost.org/libs/libraries.htm
+# The page http://beta.boost.org/doc/libs is useful: it gives the first release
+# version of each library (among other things).
+
+# BOOST_DEFUN(LIBRARY, CODE)
+# --------------------------
+# Define BOOST_<LIBRARY-UPPERCASE> as a macro that runs CODE.
+#
+# Use indir to avoid the warning on underquoted macro name given to AC_DEFUN.
+m4_define([BOOST_DEFUN],
+[m4_indir([AC_DEFUN],
+ m4_toupper([BOOST_$1]),
+[m4_pushdef([BOOST_Library], [$1])dnl
+$2
+m4_popdef([BOOST_Library])dnl
+])
+])
+
+# BOOST_ARRAY()
+# -------------
+# Look for Boost.Array
+BOOST_DEFUN([Array],
+[BOOST_FIND_HEADER([boost/array.hpp])])
+
+
+# BOOST_ASIO()
+# ------------
+# Look for Boost.Asio (new in Boost 1.35).
+BOOST_DEFUN([Asio],
+[AC_REQUIRE([BOOST_SYSTEM])dnl
+BOOST_FIND_HEADER([boost/asio.hpp])])
+
+
+# BOOST_BIND()
+# ------------
+# Look for Boost.Bind.
+BOOST_DEFUN([Bind],
+[BOOST_FIND_HEADER([boost/bind.hpp])])
+
+
+# BOOST_CHRONO()
+# --------------
+# Look for Boost.Chrono.
+BOOST_DEFUN([Chrono],
+[# Do we have to check for Boost.System? This link-time dependency was
+# added as of 1.35.0. If we have a version <1.35, we must not attempt to
+# find Boost.System as it didn't exist by then.
+if test $boost_major_version -ge 135; then
+ BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+boost_filesystem_save_LIBS=$LIBS
+boost_filesystem_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([chrono], [$1],
+ [boost/chrono.hpp],
+ [boost::chrono::thread_clock d;])
+if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
+ BOOST_CHRONO_LIBS="$BOOST_CHRONO_LIBS $BOOST_SYSTEM_LIBS"
+fi
+LIBS=$boost_filesystem_save_LIBS
+LDFLAGS=$boost_filesystem_save_LDFLAGS
+])# BOOST_CHRONO
+
+
+# BOOST_CONTEXT([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Context. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+#
+# * This library was introduced in Boost 1.51.0
+# * The signatures of make_fcontext() and jump_fcontext were changed in 1.56.0
+# * A dependency on boost_thread appears in 1.57.0
+BOOST_DEFUN([Context],
+[boost_context_save_LIBS=$LIBS
+ boost_context_save_LDFLAGS=$LDFLAGS
+if test $boost_major_version -ge 157; then
+ BOOST_THREAD([$1])
+ m4_pattern_allow([^BOOST_THREAD_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_THREAD_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_THREAD_LDFLAGS"
+fi
+BOOST_FIND_LIB([context], [$1],
+ [boost/context/all.hpp],[[
+
+// creates a stack
+void * stack_pointer = new void*[4096];
+std::size_t const size = sizeof(void*[4096]);
+
+#if BOOST_VERSION <= 105100
+ctx::make_fcontext(&fc, f);
+return ctx::jump_fcontext(&fcm, &fc, 3) == 6;
+
+#else
+
+fc = ctx::make_fcontext(stack_pointer, size, f);
+return ctx::jump_fcontext(&fcm, fc, 3) == 6;
+
+#endif
+
+
+]],[dnl
+
+#include <boost/version.hpp>
+#if BOOST_VERSION <= 105100
+
+namespace ctx = boost::ctx;
+
+static ctx::fcontext_t fcm, fc;
+
+static void f(intptr_t i) {
+ ctx::jump_fcontext(&fc, &fcm, i * 2);
+}
+
+#elif BOOST_VERSION <= 105500
+
+namespace ctx = boost::context;
+
+// context
+static ctx::fcontext_t fcm, *fc;
+
+// context-function
+static void f(intptr_t i) {
+ ctx::jump_fcontext(fc, &fcm, i * 2);
+}
+
+#else
+
+namespace ctx = boost::context;
+
+// context
+static ctx::fcontext_t fcm, fc;
+
+// context-function
+static void f(intptr_t i) {
+ ctx::jump_fcontext(&fc, fcm, i * 2);
+}
+#endif
+])
+LIBS=$boost_context_save_LIBS
+LDFLAGS=$boost_context_save_LDFLAGS
+])# BOOST_CONTEXT
+
+
+# BOOST_CONVERSION()
+# ------------------
+# Look for Boost.Conversion (cast / lexical_cast)
+BOOST_DEFUN([Conversion],
+[BOOST_FIND_HEADER([boost/cast.hpp])
+BOOST_FIND_HEADER([boost/lexical_cast.hpp])
+])# BOOST_CONVERSION
+
+
+# BOOST_COROUTINE([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Coroutine. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. This library was introduced in Boost
+# 1.53.0
+BOOST_DEFUN([Coroutine],
+[
+boost_coroutine_save_LIBS=$LIBS
+boost_coroutine_save_LDFLAGS=$LDFLAGS
+# Link-time dependency from coroutine to context
+BOOST_CONTEXT([$1])
+# Starting from Boost 1.55 a dependency on Boost.System is added
+if test $boost_major_version -ge 155; then
+ BOOST_SYSTEM([$1])
+fi
+m4_pattern_allow([^BOOST_(CONTEXT|SYSTEM)_(LIBS|LDFLAGS)])
+LIBS="$LIBS $BOOST_CONTEXT_LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_CONTEXT_LDFLAGS"
+
+# in 1.53 coroutine was a header only library
+if test $boost_major_version -eq 153; then
+ BOOST_FIND_HEADER([boost/coroutine/coroutine.hpp])
+else
+ BOOST_FIND_LIB([coroutine], [$1],
+ [boost/coroutine/coroutine.hpp],
+ [
+ #include <boost/version.hpp>
+ #if BOOST_VERSION <= 105500
+ boost::coroutines::coroutine<int(int)> coro; coro.get();
+ #else
+ boost::coroutines::asymmetric_coroutine<int>::pull_type coro; coro.get();
+ #endif
+ ])
+fi
+# Link-time dependency from coroutine to context, existed only in 1.53, in 1.54
+# coroutine doesn't use context from its headers but from its library.
+if test $boost_major_version -eq 153 || test $enable_static_boost = yes && test $boost_major_version -ge 154; then
+ BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_CONTEXT_LIBS"
+ BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_CONTEXT_LDFLAGS"
+fi
+if test $enable_static_boost = yes && test $boost_major_version -ge 155; then
+ BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_SYSTEM_LIBS"
+ BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+fi
+LIBS=$boost_coroutine_save_LIBS
+LDFLAGS=$boost_coroutine_save_LDFLAGS
+])# BOOST_COROUTINE
+
+
+# BOOST_CRC()
+# -----------
+# Look for Boost.CRC
+BOOST_DEFUN([CRC],
+[BOOST_FIND_HEADER([boost/crc.hpp])
+])# BOOST_CRC
+
+
+# BOOST_DATE_TIME([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Date_Time. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Date_Time],
+[BOOST_FIND_LIB([date_time], [$1],
+ [boost/date_time/posix_time/posix_time.hpp],
+ [boost::posix_time::ptime t;])
+])# BOOST_DATE_TIME
+
+
+# BOOST_FILESYSTEM([PREFERRED-RT-OPT])
+# ------------------------------------
+# Look for Boost.Filesystem. For the documentation of PREFERRED-RT-OPT, see
+# the documentation of BOOST_FIND_LIB above.
+# Do not check for boost/filesystem.hpp because this file was introduced in
+# 1.34.
+BOOST_DEFUN([Filesystem],
+[# Do we have to check for Boost.System? This link-time dependency was
+# added as of 1.35.0. If we have a version <1.35, we must not attempt to
+# find Boost.System as it didn't exist by then.
+if test $boost_major_version -ge 135; then
+ BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+boost_filesystem_save_LIBS=$LIBS
+boost_filesystem_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([filesystem], [$1],
+ [boost/filesystem/path.hpp], [boost::filesystem::path p;])
+if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
+ BOOST_FILESYSTEM_LIBS="$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"
+fi
+LIBS=$boost_filesystem_save_LIBS
+LDFLAGS=$boost_filesystem_save_LDFLAGS
+])# BOOST_FILESYSTEM
+
+
+# BOOST_FLYWEIGHT()
+# -----------------
+# Look for Boost.Flyweight.
+BOOST_DEFUN([Flyweight],
+[dnl There's a hidden dependency on pthreads.
+AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
+BOOST_FIND_HEADER([boost/flyweight.hpp])
+AC_SUBST([BOOST_FLYWEIGHT_LIBS], [$boost_cv_pthread_flag])
+])
+
+
+# BOOST_FOREACH()
+# ---------------
+# Look for Boost.Foreach.
+BOOST_DEFUN([Foreach],
+[BOOST_FIND_HEADER([boost/foreach.hpp])])
+
+
+# BOOST_FORMAT()
+# --------------
+# Look for Boost.Format.
+# Note: we can't check for boost/format/format_fwd.hpp because the header isn't
+# standalone. It can't be compiled because it triggers the following error:
+# boost/format/detail/config_macros.hpp:88: error: 'locale' in namespace 'std'
+# does not name a type
+BOOST_DEFUN([Format],
+[BOOST_FIND_HEADER([boost/format.hpp])])
+
+
+# BOOST_FUNCTION()
+# ----------------
+# Look for Boost.Function
+BOOST_DEFUN([Function],
+[BOOST_FIND_HEADER([boost/function.hpp])])
+
+
+# BOOST_GEOMETRY()
+# ----------------
+# Look for Boost.Geometry (new since 1.47.0).
+BOOST_DEFUN([Geometry],
+[BOOST_FIND_HEADER([boost/geometry.hpp])
+])# BOOST_GEOMETRY
+
+
+# BOOST_GRAPH([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost.Graphs. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Graph],
+[boost_graph_save_LIBS=$LIBS
+boost_graph_save_LDFLAGS=$LDFLAGS
+# Link-time dependency from graph to regex was added as of 1.40.0.
+if test $boost_major_version -ge 140; then
+ BOOST_REGEX([$1])
+ m4_pattern_allow([^BOOST_REGEX_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_REGEX_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_REGEX_LDFLAGS"
+fi
+BOOST_FIND_LIB([graph], [$1],
+ [boost/graph/adjacency_list.hpp], [boost::adjacency_list<> g;])
+LIBS=$boost_graph_save_LIBS
+LDFLAGS=$boost_graph_save_LDFLAGS
+])# BOOST_GRAPH
+
+
+# BOOST_IOSTREAMS([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.IOStreams. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([IOStreams],
+[BOOST_FIND_LIB([iostreams], [$1],
+ [boost/iostreams/device/file_descriptor.hpp],
+ [boost::iostreams::file_descriptor fd; fd.close();])
+])# BOOST_IOSTREAMS
+
+
+# BOOST_HASH()
+# ------------
+# Look for Boost.Functional/Hash
+BOOST_DEFUN([Hash],
+[BOOST_FIND_HEADER([boost/functional/hash.hpp])])
+
+
+# BOOST_LAMBDA()
+# --------------
+# Look for Boost.Lambda
+BOOST_DEFUN([Lambda],
+[BOOST_FIND_HEADER([boost/lambda/lambda.hpp])])
+
+
+# BOOST_LOCALE()
+# --------------
+# Look for Boost.Locale
+BOOST_DEFUN([Locale],
+[
+boost_locale_save_LIBS=$LIBS
+boost_locale_save_LDFLAGS=$LDFLAGS
+# require SYSTEM for boost-1.50.0 and up
+if test $boost_major_version -ge 150; then
+ BOOST_SYSTEM([$1])
+ m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+fi # end of the Boost.System check.
+BOOST_FIND_LIB([locale], [$1],
+ [boost/locale.hpp],
+ [[boost::locale::generator gen; std::locale::global(gen(""));]])
+LIBS=$boost_locale_save_LIBS
+LDFLAGS=$boost_locale_save_LDFLAGS
+])# BOOST_LOCALE
+
+# BOOST_LOG([PREFERRED-RT-OPT])
+# -----------------------------
+# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Log],
+[boost_log_save_LIBS=$LIBS
+boost_log_save_LDFLAGS=$LDFLAGS
+BOOST_SYSTEM([$1])
+BOOST_FILESYSTEM([$1])
+BOOST_DATE_TIME([$1])
+m4_pattern_allow([^BOOST_(SYSTEM|FILESYSTEM|DATE_TIME)_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_DATE_TIME_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_DATE_TIME_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([log], [$1],
+ [boost/log/core/core.hpp],
+ [boost::log::attribute a; a.get_value();])
+LIBS=$boost_log_save_LIBS
+LDFLAGS=$boost_log_save_LDFLAGS
+])# BOOST_LOG
+
+
+# BOOST_LOG_SETUP([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Log_Setup],
+[boost_log_setup_save_LIBS=$LIBS
+boost_log_setup_save_LDFLAGS=$LDFLAGS
+BOOST_LOG([$1])
+m4_pattern_allow([^BOOST_LOG_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_LOG_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_LOG_LDFLAGS"
+BOOST_FIND_LIB([log_setup], [$1],
+ [boost/log/utility/setup/from_settings.hpp],
+ [boost::log::basic_settings<char> bs; bs.empty();])
+LIBS=$boost_log_setup_save_LIBS
+LDFLAGS=$boost_log_setup_save_LDFLAGS
+])# BOOST_LOG_SETUP
+
+
+# BOOST_MATH()
+# ------------
+# Look for Boost.Math
+# TODO: This library isn't header-only but it comes in multiple different
+# flavors that don't play well with BOOST_FIND_LIB (e.g, libboost_math_c99,
+# libboost_math_c99f, libboost_math_c99l, libboost_math_tr1,
+# libboost_math_tr1f, libboost_math_tr1l). This macro must be fixed to do the
+# right thing anyway.
+BOOST_DEFUN([Math],
+[BOOST_FIND_HEADER([boost/math/special_functions.hpp])])
+
+
+# BOOST_MPI([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost MPI. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. Uses MPICXX variable if it is
+# set, otherwise tries CXX
+#
+BOOST_DEFUN([MPI],
+[boost_save_CXX=${CXX}
+boost_save_CXXCPP=${CXXCPP}
+if test x"${MPICXX}" != x; then
+ CXX=${MPICXX}
+ CXXCPP="${MPICXX} -E"
+fi
+BOOST_FIND_LIB([mpi], [$1],
+ [boost/mpi.hpp],
+ [int argc = 0;
+ char **argv = 0;
+ boost::mpi::environment env(argc,argv);])
+CXX=${boost_save_CXX}
+CXXCPP=${boost_save_CXXCPP}
+])# BOOST_MPI
+
+
+# BOOST_MULTIARRAY()
+# ------------------
+# Look for Boost.MultiArray
+BOOST_DEFUN([MultiArray],
+[BOOST_FIND_HEADER([boost/multi_array.hpp])])
+
+
+# BOOST_NUMERIC_UBLAS()
+# --------------------------
+# Look for Boost.NumericUblas (Basic Linear Algebra)
+BOOST_DEFUN([Numeric_Ublas],
+[BOOST_FIND_HEADER([boost/numeric/ublas/vector.hpp])
+])# BOOST_NUMERIC_UBLAS
+
+
+# BOOST_NUMERIC_CONVERSION()
+# --------------------------
+# Look for Boost.NumericConversion (policy-based numeric conversion)
+BOOST_DEFUN([Numeric_Conversion],
+[BOOST_FIND_HEADER([boost/numeric/conversion/converter.hpp])
+])# BOOST_NUMERIC_CONVERSION
+
+
+# BOOST_OPTIONAL()
+# ----------------
+# Look for Boost.Optional
+BOOST_DEFUN([Optional],
+[BOOST_FIND_HEADER([boost/optional.hpp])])
+
+
+# BOOST_PREPROCESSOR()
+# --------------------
+# Look for Boost.Preprocessor
+BOOST_DEFUN([Preprocessor],
+[BOOST_FIND_HEADER([boost/preprocessor/repeat.hpp])])
+
+
+# BOOST_RANGE()
+# --------------------
+# Look for Boost.Range
+BOOST_DEFUN([Range],
+[BOOST_FIND_HEADER([boost/range/adaptors.hpp])])
+
+# BOOST_UNORDERED()
+# -----------------
+# Look for Boost.Unordered
+BOOST_DEFUN([Unordered],
+[BOOST_FIND_HEADER([boost/unordered_map.hpp])])
+
+
+# BOOST_UUID()
+# ------------
+# Look for Boost.Uuid
+BOOST_DEFUN([Uuid],
+[BOOST_FIND_HEADER([boost/uuid/uuid.hpp])])
+
+
+# BOOST_PROGRAM_OPTIONS([PREFERRED-RT-OPT])
+# -----------------------------------------
+# Look for Boost.Program_options. For the documentation of PREFERRED-RT-OPT,
+# see the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Program_Options],
+[BOOST_FIND_LIB([program_options], [$1],
+ [boost/program_options.hpp],
+ [boost::program_options::options_description d("test");])
+])# BOOST_PROGRAM_OPTIONS
+
+
+
+# _BOOST_PYTHON_CONFIG(VARIABLE, FLAG)
+# ------------------------------------
+# Save VARIABLE, and define it via `python-config --FLAG`.
+# Substitute BOOST_PYTHON_VARIABLE.
+m4_define([_BOOST_PYTHON_CONFIG],
+[AC_SUBST([BOOST_PYTHON_$1],
+ [`python-config --$2 2>/dev/null`])dnl
+boost_python_save_$1=$$1
+$1="$$1 $BOOST_PYTHON_$1"])
+
+
+# BOOST_PYTHON([PREFERRED-RT-OPT])
+# --------------------------------
+# Look for Boost.Python. For the documentation of PREFERRED-RT-OPT,
+# see the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Python],
+[_BOOST_PYTHON_CONFIG([CPPFLAGS], [includes])
+_BOOST_PYTHON_CONFIG([LDFLAGS], [ldflags])
+_BOOST_PYTHON_CONFIG([LIBS], [libs])
+m4_pattern_allow([^BOOST_PYTHON_MODULE$])dnl
+BOOST_FIND_LIBS([python], [python python3], [$1],
+ [boost/python.hpp],
+ [], [BOOST_PYTHON_MODULE(empty) {}])
+CPPFLAGS=$boost_python_save_CPPFLAGS
+LDFLAGS=$boost_python_save_LDFLAGS
+LIBS=$boost_python_save_LIBS
+])# BOOST_PYTHON
+
+
+# BOOST_REF()
+# -----------
+# Look for Boost.Ref
+BOOST_DEFUN([Ref],
+[BOOST_FIND_HEADER([boost/ref.hpp])])
+
+
+# BOOST_REGEX([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost.Regex. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Regex],
+[BOOST_FIND_LIB([regex], [$1],
+ [boost/regex.hpp],
+ [boost::regex exp("*"); boost::regex_match("foo", exp);])
+])# BOOST_REGEX
+
+
+# BOOST_SERIALIZATION([PREFERRED-RT-OPT])
+# ---------------------------------------
+# Look for Boost.Serialization. For the documentation of PREFERRED-RT-OPT, see
+# the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Serialization],
+[BOOST_FIND_LIB([serialization], [$1],
+ [boost/archive/text_oarchive.hpp],
+ [std::ostream* o = 0; // Cheap way to get an ostream...
+ boost::archive::text_oarchive t(*o);])
+])# BOOST_SERIALIZATION
+
+
+# BOOST_SIGNALS([PREFERRED-RT-OPT])
+# ---------------------------------
+# Look for Boost.Signals. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Signals],
+[BOOST_FIND_LIB([signals], [$1],
+ [boost/signal.hpp],
+ [boost::signal<void ()> s;])
+])# BOOST_SIGNALS
+
+
+# BOOST_SIGNALS2()
+# ----------------
+# Look for Boost.Signals2 (new since 1.39.0).
+BOOST_DEFUN([Signals2],
+[BOOST_FIND_HEADER([boost/signals2.hpp])
+])# BOOST_SIGNALS2
+
+
+# BOOST_SMART_PTR()
+# -----------------
+# Look for Boost.SmartPtr
+BOOST_DEFUN([Smart_Ptr],
+[BOOST_FIND_HEADER([boost/scoped_ptr.hpp])
+BOOST_FIND_HEADER([boost/shared_ptr.hpp])
+])
+
+
+# BOOST_STATICASSERT()
+# --------------------
+# Look for Boost.StaticAssert
+BOOST_DEFUN([StaticAssert],
+[BOOST_FIND_HEADER([boost/static_assert.hpp])])
+
+
+# BOOST_STRING_ALGO()
+# -------------------
+# Look for Boost.StringAlgo
+BOOST_DEFUN([String_Algo],
+[BOOST_FIND_HEADER([boost/algorithm/string.hpp])
+])
+
+
+# BOOST_SYSTEM([PREFERRED-RT-OPT])
+# --------------------------------
+# Look for Boost.System. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. This library was introduced in Boost
+# 1.35.0.
+BOOST_DEFUN([System],
+[BOOST_FIND_LIB([system], [$1],
+ [boost/system/error_code.hpp],
+ [boost::system::error_code e; e.clear();])
+])# BOOST_SYSTEM
+
+
+# BOOST_TEST([PREFERRED-RT-OPT])
+# ------------------------------
+# Look for Boost.Test. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Test],
+[m4_pattern_allow([^BOOST_CHECK$])dnl
+BOOST_FIND_LIB([unit_test_framework], [$1],
+ [boost/test/unit_test.hpp], [BOOST_CHECK(2 == 2);],
+ [using boost::unit_test::test_suite;
+ test_suite* init_unit_test_suite(int argc, char ** argv)
+ { return NULL; }])
+])# BOOST_TEST
+
+
+# BOOST_THREAD([PREFERRED-RT-OPT])
+# ---------------------------------
+# Look for Boost.Thread. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Thread],
+[dnl Having the pthread flag is required at least on GCC3 where
+dnl boost/thread.hpp would complain if we try to compile without
+dnl -pthread on GNU/Linux.
+AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
+boost_thread_save_LIBS=$LIBS
+boost_thread_save_LDFLAGS=$LDFLAGS
+boost_thread_save_CPPFLAGS=$CPPFLAGS
+# Link-time dependency from thread to system was added as of 1.49.0.
+if test $boost_major_version -ge 149; then
+BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+CPPFLAGS="$CPPFLAGS $boost_cv_pthread_flag"
+
+# When compiling for the Windows platform, the threads library is named
+# differently. This suffix doesn't exist in new versions of Boost, or
+# possibly new versions of GCC on mingw I am assuming it's Boost's change for
+# now and I am setting version to 1.48, for lack of knowledge as to when this
+# change occurred.
+if test $boost_major_version -lt 148; then
+ case $host_os in
+ (*mingw*) boost_thread_lib_ext=_win32;;
+ esac
+fi
+BOOST_FIND_LIBS([thread], [thread$boost_thread_lib_ext],
+ [$1],
+ [boost/thread.hpp], [boost::thread t; boost::mutex m;])
+
+case $host_os in
+ (*mingw*) boost_thread_w32_socket_link=-lws2_32;;
+esac
+
+BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag $boost_thread_w32_socket_link"
+BOOST_THREAD_LDFLAGS="$BOOST_SYSTEM_LDFLAGS"
+BOOST_CPPFLAGS="$BOOST_CPPFLAGS $boost_cv_pthread_flag"
+LIBS=$boost_thread_save_LIBS
+LDFLAGS=$boost_thread_save_LDFLAGS
+CPPFLAGS=$boost_thread_save_CPPFLAGS
+])# BOOST_THREAD
+
+AU_ALIAS([BOOST_THREADS], [BOOST_THREAD])
+
+
+# BOOST_TOKENIZER()
+# -----------------
+# Look for Boost.Tokenizer
+BOOST_DEFUN([Tokenizer],
+[BOOST_FIND_HEADER([boost/tokenizer.hpp])])
+
+
+# BOOST_TRIBOOL()
+# ---------------
+# Look for Boost.Tribool
+BOOST_DEFUN([Tribool],
+[BOOST_FIND_HEADER([boost/logic/tribool_fwd.hpp])
+BOOST_FIND_HEADER([boost/logic/tribool.hpp])
+])
+
+
+# BOOST_TUPLE()
+# -------------
+# Look for Boost.Tuple
+BOOST_DEFUN([Tuple],
+[BOOST_FIND_HEADER([boost/tuple/tuple.hpp])])
+
+
+# BOOST_TYPETRAITS()
+# --------------------
+# Look for Boost.TypeTraits
+BOOST_DEFUN([TypeTraits],
+[BOOST_FIND_HEADER([boost/type_traits.hpp])])
+
+
+# BOOST_UTILITY()
+# ---------------
+# Look for Boost.Utility (noncopyable, result_of, base-from-member idiom,
+# etc.)
+BOOST_DEFUN([Utility],
+[BOOST_FIND_HEADER([boost/utility.hpp])])
+
+
+# BOOST_VARIANT()
+# ---------------
+# Look for Boost.Variant.
+BOOST_DEFUN([Variant],
+[BOOST_FIND_HEADER([boost/variant/variant_fwd.hpp])
+BOOST_FIND_HEADER([boost/variant.hpp])])
+
+
+# BOOST_POINTER_CONTAINER()
+# ------------------------
+# Look for Boost.PointerContainer
+BOOST_DEFUN([Pointer_Container],
+[BOOST_FIND_HEADER([boost/ptr_container/ptr_deque.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_list.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_vector.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_array.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_set.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_map.hpp])
+])# BOOST_POINTER_CONTAINER
+
+
+# BOOST_WAVE([PREFERRED-RT-OPT])
+# ------------------------------
+# NOTE: If you intend to use Wave/Spirit with thread support, make sure you
+# call BOOST_THREAD first.
+# Look for Boost.Wave. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Wave],
+[AC_REQUIRE([BOOST_FILESYSTEM])dnl
+AC_REQUIRE([BOOST_DATE_TIME])dnl
+boost_wave_save_LIBS=$LIBS
+boost_wave_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_((FILE)?SYSTEM|DATE_TIME|THREAD)_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS \
+$BOOST_THREAD_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS \
+$BOOST_DATE_TIME_LDFLAGS $BOOST_THREAD_LDFLAGS"
+BOOST_FIND_LIB([wave], [$1],
+ [boost/wave.hpp],
+ [boost::wave::token_id id; get_token_name(id);])
+LIBS=$boost_wave_save_LIBS
+LDFLAGS=$boost_wave_save_LDFLAGS
+])# BOOST_WAVE
+
+
+# BOOST_XPRESSIVE()
+# -----------------
+# Look for Boost.Xpressive (new since 1.36.0).
+BOOST_DEFUN([Xpressive],
+[BOOST_FIND_HEADER([boost/xpressive/xpressive.hpp])])
+
+
+# ----------------- #
+# Internal helpers. #
+# ----------------- #
+
+
+# _BOOST_PTHREAD_FLAG()
+# ---------------------
+# Internal helper for BOOST_THREAD. Computes boost_cv_pthread_flag
+# which must be used in CPPFLAGS and LIBS.
+#
+# Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3,
+# boost/thread.hpp will trigger a #error if -pthread isn't used:
+# boost/config/requires_threads.hpp:47:5: #error "Compiler threading support
+# is not turned on. Please set the correct command line options for
+# threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
+#
+# Based on ACX_PTHREAD: http://autoconf-archive.cryp.to/acx_pthread.html
+AC_DEFUN([_BOOST_PTHREAD_FLAG],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_LANG_PUSH([C++])dnl
+AC_CACHE_CHECK([for the flags needed to use pthreads], [boost_cv_pthread_flag],
+[ boost_cv_pthread_flag=
+ # The ordering *is* (sometimes) important. Some notes on the
+ # individual items follow:
+ # (none): in case threads are in libc; should be tried before -Kthread and
+ # other compiler flags to prevent continual compiler warnings
+ # -lpthreads: AIX (must check this before -lpthread)
+ # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+ # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+ # -llthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+ # -pthread: GNU Linux/GCC (kernel threads), BSD/GCC (userland threads)
+ # -pthreads: Solaris/GCC
+ # -mthreads: MinGW32/GCC, Lynx/GCC
+ # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+ # doesn't hurt to check since this sometimes defines pthreads too;
+ # also defines -D_REENTRANT)
+ # ... -mt is also the pthreads flag for HP/aCC
+ # -lpthread: GNU Linux, etc.
+ # --thread-safe: KAI C++
+ case $host_os in #(
+ *solaris*)
+ # On Solaris (at least, for some versions), libc contains stubbed
+ # (non-functional) versions of the pthreads routines, so link-based
+ # tests will erroneously succeed. (We need to link with -pthreads/-mt/
+ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
+ # a function called by this macro, so we could check for that, but
+ # who knows whether they'll stub that too in a future libc.) So,
+ # we'll just look for -pthreads and -lpthread first:
+ boost_pthread_flags="-pthreads -lpthread -mt -pthread";; #(
+ *)
+ boost_pthread_flags="-lpthreads -Kthread -kthread -llthread -pthread \
+ -pthreads -mthreads -lpthread --thread-safe -mt";;
+ esac
+ # Generate the test file.
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <pthread.h>],
+ [pthread_t th; pthread_join(th, 0);
+ pthread_attr_init(0); pthread_cleanup_push(0, 0);
+ pthread_create(0,0,0,0); pthread_cleanup_pop(0);])])
+ for boost_pthread_flag in '' $boost_pthread_flags; do
+ boost_pthread_ok=false
+dnl Re-use the test file already generated.
+ boost_pthreads__save_LIBS=$LIBS
+ LIBS="$LIBS $boost_pthread_flag"
+ AC_LINK_IFELSE([],
+ [if grep ".*$boost_pthread_flag" conftest.err; then
+ echo "This flag seems to have triggered warnings" >&AS_MESSAGE_LOG_FD
+ else
+ boost_pthread_ok=:; boost_cv_pthread_flag=$boost_pthread_flag
+ fi])
+ LIBS=$boost_pthreads__save_LIBS
+ $boost_pthread_ok && break
+ done
+])
+AC_LANG_POP([C++])dnl
+])# _BOOST_PTHREAD_FLAG
+
+
+# _BOOST_gcc_test(MAJOR, MINOR)
+# -----------------------------
+# Internal helper for _BOOST_FIND_COMPILER_TAG.
+m4_define([_BOOST_gcc_test],
+["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC @ gcc$1$2"])dnl
+
+# _BOOST_mingw_test(MAJOR, MINOR)
+# -----------------------------
+# Internal helper for _BOOST_FIND_COMPILER_TAG.
+m4_define([_BOOST_mingw_test],
+["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw$1$2"])dnl
+
+
+# _BOOST_FIND_COMPILER_TAG()
+# --------------------------
+# Internal. When Boost is installed without --layout=system, each library
+# filename will hold a suffix that encodes the compiler used during the
+# build. The Boost build system seems to call this a `tag'.
+AC_DEFUN([_BOOST_FIND_COMPILER_TAG],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_CACHE_CHECK([for the toolset name used by Boost for $CXX],
+ [boost_cv_lib_tag],
+[boost_cv_lib_tag=unknown
+if test x$boost_cv_inc_path != xno; then
+ AC_LANG_PUSH([C++])dnl
+ # The following tests are mostly inspired by boost/config/auto_link.hpp
+ # The list is sorted to most recent/common to oldest compiler (in order
+ # to increase the likelihood of finding the right compiler with the
+ # least number of compilation attempt).
+ # Beware that some tests are sensible to the order (for instance, we must
+ # look for MinGW before looking for GCC3).
+ # I used one compilation test per compiler with a #error to recognize
+ # each compiler so that it works even when cross-compiling (let me know
+ # if you know a better approach).
+ # Known missing tags (known from Boost's tools/build/v2/tools/common.jam):
+ # como, edg, kcc, bck, mp, sw, tru, xlc
+ # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines
+ # the same defines as GCC's).
+ for i in \
+ _BOOST_mingw_test(5, 3) \
+ _BOOST_gcc_test(5, 3) \
+ _BOOST_mingw_test(5, 2) \
+ _BOOST_gcc_test(5, 2) \
+ _BOOST_mingw_test(5, 1) \
+ _BOOST_gcc_test(5, 1) \
+ _BOOST_mingw_test(5, 0) \
+ _BOOST_gcc_test(5, 0) \
+ _BOOST_mingw_test(4, 10) \
+ _BOOST_gcc_test(4, 10) \
+ _BOOST_mingw_test(4, 9) \
+ _BOOST_gcc_test(4, 9) \
+ _BOOST_mingw_test(4, 8) \
+ _BOOST_gcc_test(4, 8) \
+ _BOOST_mingw_test(4, 7) \
+ _BOOST_gcc_test(4, 7) \
+ _BOOST_mingw_test(4, 6) \
+ _BOOST_gcc_test(4, 6) \
+ _BOOST_mingw_test(4, 5) \
+ _BOOST_gcc_test(4, 5) \
+ _BOOST_mingw_test(4, 4) \
+ _BOOST_gcc_test(4, 4) \
+ _BOOST_mingw_test(4, 3) \
+ _BOOST_gcc_test(4, 3) \
+ _BOOST_mingw_test(4, 2) \
+ _BOOST_gcc_test(4, 2) \
+ _BOOST_mingw_test(4, 1) \
+ _BOOST_gcc_test(4, 1) \
+ _BOOST_mingw_test(4, 0) \
+ _BOOST_gcc_test(4, 0) \
+ "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \
+ && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw" \
+ _BOOST_gcc_test(3, 4) \
+ _BOOST_gcc_test(3, 3) \
+ "defined _MSC_VER && _MSC_VER >= 1500 @ vc90" \
+ "defined _MSC_VER && _MSC_VER == 1400 @ vc80" \
+ _BOOST_gcc_test(3, 2) \
+ "defined _MSC_VER && _MSC_VER == 1310 @ vc71" \
+ _BOOST_gcc_test(3, 1) \
+ _BOOST_gcc_test(3, 0) \
+ "defined __BORLANDC__ @ bcb" \
+ "defined __ICC && (defined __unix || defined __unix__) @ il" \
+ "defined __ICL @ iw" \
+ "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \
+ _BOOST_gcc_test(2, 95) \
+ "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \
+ "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \
+ "defined _MSC_VER && _MSC_VER < 1300 && defined UNDER_CE @ evc4" \
+ "defined __MWERKS__ && __MWERKS__ <= 0x31FF @ cw8"
+ do
+ boost_tag_test=`expr "X$i" : 'X\([[^@]]*\) @ '`
+ boost_tag=`expr "X$i" : 'X[[^@]]* @ \(.*\)'`
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if $boost_tag_test
+/* OK */
+#else
+# error $boost_tag_test
+#endif
+]])], [boost_cv_lib_tag=$boost_tag; break], [])
+ done
+AC_LANG_POP([C++])dnl
+ case $boost_cv_lib_tag in #(
+ # Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed
+ # to "gcc41" for instance.
+ *-gcc | *'-gcc ') :;; #( Don't re-add -gcc: it's already in there.
+ gcc*)
+ boost_tag_x=
+ case $host_os in #(
+ darwin*)
+ if test $boost_major_version -ge 136; then
+ # The `x' added in r46793 of Boost.
+ boost_tag_x=x
+ fi;;
+ esac
+ # We can specify multiple tags in this variable because it's used by
+ # BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ...
+ boost_cv_lib_tag="$boost_tag_x$boost_cv_lib_tag -${boost_tag_x}gcc"
+ ;; #(
+ unknown)
+ AC_MSG_WARN([[could not figure out which toolset name to use for $CXX]])
+ boost_cv_lib_tag=
+ ;;
+ esac
+fi])dnl end of AC_CACHE_CHECK
+])# _BOOST_FIND_COMPILER_TAG
+
+
+# _BOOST_GUESS_WHETHER_TO_USE_MT()
+# --------------------------------
+# Compile a small test to try to guess whether we should favor MT (Multi
+# Thread) flavors of Boost. Sets boost_guess_use_mt accordingly.
+AC_DEFUN([_BOOST_GUESS_WHETHER_TO_USE_MT],
+[# Check whether we do better use `mt' even though we weren't ask to.
+AC_LANG_PUSH([C++])dnl
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if defined _REENTRANT || defined _MT || defined __MT__
+/* use -mt */
+#else
+# error MT not needed
+#endif
+]])], [boost_guess_use_mt=:], [boost_guess_use_mt=false])
+AC_LANG_POP([C++])dnl
+])
+
+# _BOOST_AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+# -------------------------------------------------------------------
+# Fork of _AC_LINK_IFELSE that preserves conftest.o across calls. Fragile,
+# will break when Autoconf changes its internals. Requires that you manually
+# rm -f conftest.$ac_objext in between to really different tests, otherwise
+# you will try to link a conftest.o left behind by a previous test.
+# Used to aggressively optimize BOOST_FIND_LIB (see the big comment in this
+# macro).
+#
+# Don't use "break" in the actions, as it would short-circuit some code
+# this macro runs after the actions.
+m4_define([_BOOST_AC_LINK_IFELSE],
+[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
+rm -f conftest$ac_exeext
+boost_save_ac_ext=$ac_ext
+boost_use_source=:
+# If we already have a .o, re-use it. We change $ac_ext so that $ac_link
+# tries to link the existing object file instead of compiling from source.
+test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false &&
+ _AS_ECHO_LOG([re-using the existing conftest.$ac_objext])
+AS_IF([_AC_DO_STDERR($ac_link) && {
+ test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_executable_p conftest$ac_exeext
+dnl FIXME: use AS_TEST_X instead when 2.61 is widespread enough.
+ }],
+ [$2],
+ [if $boost_use_source; then
+ _AC_MSG_LOG_CONFTEST
+ fi
+ $3])
+ac_objext=$boost_save_ac_objext
+ac_ext=$boost_save_ac_ext
+dnl Delete also the IPA/IPO (Inter Procedural Analysis/Optimization)
+dnl information created by the PGI compiler (conftest_ipa8_conftest.oo),
+dnl as it would interfere with the next link command.
+rm -f core conftest.err conftest_ipa8_conftest.oo \
+ conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl
+])# _BOOST_AC_LINK_IFELSE
+
+# Local Variables:
+# mode: autoconf
+# End:
diff --git a/org.eclipse.efm.symbex/cmake/cvc4-1.4-patch/config/boost.m4 b/org.eclipse.efm.symbex/cmake/cvc4-1.4-patch/config/boost.m4
new file mode 100644
index 0000000..084cfd2
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/cvc4-1.4-patch/config/boost.m4
@@ -0,0 +1,1565 @@
+# boost.m4: Locate Boost headers and libraries for autoconf-based projects.
+# Copyright (C) 2007-2011, 2014 Benoit Sigoure <tsuna@lrde.epita.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Additional permission under section 7 of the GNU General Public
+# License, version 3 ("GPLv3"):
+#
+# If you convey this file as part of a work that contains a
+# configuration script generated by Autoconf, you may do so under
+# terms of your choice.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+m4_define([_BOOST_SERIAL], [m4_translit([
+# serial 25
+], [#
+], [])])
+
+# Original sources can be found at http://github.com/tsuna/boost.m4
+# You can fetch the latest version of the script by doing:
+# wget http://github.com/tsuna/boost.m4/raw/master/build-aux/boost.m4
+
+# ------ #
+# README #
+# ------ #
+
+# This file provides several macros to use the various Boost libraries.
+# The first macro is BOOST_REQUIRE. It will simply check if it's possible to
+# find the Boost headers of a given (optional) minimum version and it will
+# define BOOST_CPPFLAGS accordingly. It will add an option --with-boost to
+# your configure so that users can specify non standard locations.
+# If the user's environment contains BOOST_ROOT and --with-boost was not
+# specified, --with-boost=$BOOST_ROOT is implicitly used.
+# For more README and documentation, go to http://github.com/tsuna/boost.m4
+# Note: THESE MACROS ASSUME THAT YOU USE LIBTOOL. If you don't, don't worry,
+# simply read the README, it will show you what to do step by step.
+
+m4_pattern_forbid([^_?(BOOST|Boost)_])
+
+
+# _BOOST_SED_CPP(SED-PROGRAM, PROGRAM,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# --------------------------------------------------------
+# Same as AC_EGREP_CPP, but leave the result in conftest.i.
+#
+# SED-PROGRAM is *not* overquoted, as in AC_EGREP_CPP. It is expanded
+# in double-quotes, so escape your double quotes.
+#
+# It could be useful to turn this into a macro which extracts the
+# value of any macro.
+m4_define([_BOOST_SED_CPP],
+[AC_LANG_PUSH([C++])dnl
+AC_LANG_PREPROC_REQUIRE()dnl
+AC_REQUIRE([AC_PROG_SED])dnl
+AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])])
+AS_IF([dnl eval is necessary to expand ac_cpp.
+dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
+dnl Beware of Windows end-of-lines, for instance if we are running
+dnl some Windows programs under Wine. In that case, boost/version.hpp
+dnl is certainly using "\r\n", but the regular Unix shell will only
+dnl strip `\n' with backquotes, not the `\r'. This results in
+dnl boost_cv_lib_version='1_37\r' for instance, which breaks
+dnl everything else.
+dnl Cannot use 'dnl' after [$4] because a trailing dnl may break AC_CACHE_CHECK
+dnl
+dnl Beware that GCC 5, when expanding macros, may embed # line directives
+dnl a within single line:
+dnl
+dnl # 1 "conftest.cc"
+dnl # 1 "<built-in>"
+dnl # 1 "<command-line>"
+dnl # 1 "conftest.cc"
+dnl # 1 "/opt/local/include/boost/version.hpp" 1 3
+dnl # 2 "conftest.cc" 2
+dnl boost-lib-version =
+dnl # 2 "conftest.cc" 3
+dnl "1_56"
+dnl
+dnl So get rid of the # lines, and glue the remaining ones together.
+(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+ grep -v '#' |
+ tr -d '\r' |
+ tr -s '\n' ' ' |
+ $SED -n -e "$1" >conftest.i 2>&1],
+ [$3],
+ [$4])
+rm -rf conftest*
+AC_LANG_POP([C++])dnl
+])# _BOOST_SED_CPP
+
+
+
+# BOOST_REQUIRE([VERSION], [ACTION-IF-NOT-FOUND])
+# -----------------------------------------------
+# Look for Boost. If version is given, it must either be a literal of the form
+# "X.Y.Z" where X, Y and Z are integers (the ".Z" part being optional) or a
+# variable "$var".
+# Defines the value BOOST_CPPFLAGS. This macro only checks for headers with
+# the required version, it does not check for any of the Boost libraries.
+# On # success, defines HAVE_BOOST. On failure, calls the optional
+# ACTION-IF-NOT-FOUND action if one was supplied.
+# Otherwise aborts with an error message.
+AC_DEFUN_ONCE([BOOST_REQUIRE],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_PROG_GREP])dnl
+echo "$as_me: this is boost.m4[]_BOOST_SERIAL" >&AS_MESSAGE_LOG_FD
+boost_save_IFS=$IFS
+boost_version_req=$1
+IFS=.
+set x $boost_version_req 0 0 0
+IFS=$boost_save_IFS
+shift
+boost_version_req=`expr "$[1]" '*' 100000 + "$[2]" '*' 100 + "$[3]"`
+boost_version_req_string=$[1].$[2].$[3]
+AC_ARG_WITH([boost],
+ [AS_HELP_STRING([--with-boost=DIR],
+ [prefix of Boost $1 @<:@guess@:>@])])dnl
+AC_ARG_VAR([BOOST_ROOT],[Location of Boost installation])dnl
+# If BOOST_ROOT is set and the user has not provided a value to
+# --with-boost, then treat BOOST_ROOT as if it the user supplied it.
+if test x"$BOOST_ROOT" != x; then
+ if test x"$with_boost" = x; then
+ AC_MSG_NOTICE([Detected BOOST_ROOT; continuing with --with-boost=$BOOST_ROOT])
+ with_boost=$BOOST_ROOT
+ else
+ AC_MSG_NOTICE([Detected BOOST_ROOT=$BOOST_ROOT, but overridden by --with-boost=$with_boost])
+ fi
+fi
+AC_SUBST([DISTCHECK_CONFIGURE_FLAGS],
+ ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"])dnl
+boost_save_CPPFLAGS=$CPPFLAGS
+ AC_CACHE_CHECK([for Boost headers version >= $boost_version_req_string],
+ [boost_cv_inc_path],
+ [boost_cv_inc_path=no
+AC_LANG_PUSH([C++])dnl
+m4_pattern_allow([^BOOST_VERSION$])dnl
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#include <boost/version.hpp>
+#if !defined BOOST_VERSION
+# error BOOST_VERSION is not defined
+#elif BOOST_VERSION < $boost_version_req
+# error Boost headers version < $boost_version_req
+#endif
+]])])
+ # If the user provided a value to --with-boost, use it and only it.
+ case $with_boost in #(
+ ''|yes) set x '' /opt/local/include /usr/local/include /opt/include \
+ /usr/include C:/Boost/include;; #(
+ *) set x "$with_boost/include" "$with_boost";;
+ esac
+ shift
+ for boost_dir
+ do
+ # Without --layout=system, Boost (or at least some versions) installs
+ # itself in <prefix>/include/boost-<version>. This inner loop helps to
+ # find headers in such directories.
+ #
+ # Any ${boost_dir}/boost-x_xx directories are searched in reverse version
+ # order followed by ${boost_dir}. The final '.' is a sentinel for
+ # searching $boost_dir" itself. Entries are whitespace separated.
+ #
+ # I didn't indent this loop on purpose (to avoid over-indented code)
+ boost_layout_system_search_list=`cd "$boost_dir" 2>/dev/null \
+ && ls -1 | "${GREP}" '^boost-' | sort -rn -t- -k2 \
+ && echo .`
+ for boost_inc in $boost_layout_system_search_list
+ do
+ if test x"$boost_inc" != x.; then
+ boost_inc="$boost_dir/$boost_inc"
+ else
+ boost_inc="$boost_dir" # Uses sentinel in boost_layout_system_search_list
+ fi
+ if test x"$boost_inc" != x; then
+ # We are going to check whether the version of Boost installed
+ # in $boost_inc is usable by running a compilation that
+ # #includes it. But if we pass a -I/some/path in which Boost
+ # is not installed, the compiler will just skip this -I and
+ # use other locations (either from CPPFLAGS, or from its list
+ # of system include directories). As a result we would use
+ # header installed on the machine instead of the /some/path
+ # specified by the user. So in that precise case (trying
+ # $boost_inc), make sure the version.hpp exists.
+ #
+ # Use test -e as there can be symlinks.
+ test -e "$boost_inc/boost/version.hpp" || continue
+ CPPFLAGS="$CPPFLAGS -I$boost_inc"
+ fi
+ AC_COMPILE_IFELSE([], [boost_cv_inc_path=yes], [boost_cv_version=no])
+ if test x"$boost_cv_inc_path" = xyes; then
+ if test x"$boost_inc" != x; then
+ boost_cv_inc_path=$boost_inc
+ fi
+ break 2
+ fi
+ done
+ done
+AC_LANG_POP([C++])dnl
+ ])
+ case $boost_cv_inc_path in #(
+ no)
+ boost_errmsg="cannot find Boost headers version >= $boost_version_req_string"
+ m4_if([$2], [], [AC_MSG_ERROR([$boost_errmsg])],
+ [AC_MSG_NOTICE([$boost_errmsg])])
+ $2
+ ;;#(
+ yes)
+ BOOST_CPPFLAGS=
+ ;;#(
+ *)
+ AC_SUBST([BOOST_CPPFLAGS], ["-I$boost_cv_inc_path"])dnl
+ ;;
+ esac
+ if test x"$boost_cv_inc_path" != xno; then
+ AC_DEFINE([HAVE_BOOST], [1],
+ [Defined if the requested minimum BOOST version is satisfied])
+ AC_CACHE_CHECK([for Boost's header version],
+ [boost_cv_lib_version],
+ [m4_pattern_allow([^BOOST_LIB_VERSION$])dnl
+ _BOOST_SED_CPP([[/^boost-lib-version = /{s///;s/[\" ]//g;p;q;}]],
+ [#include <boost/version.hpp>
+boost-lib-version = BOOST_LIB_VERSION],
+ [boost_cv_lib_version=`cat conftest.i`])])
+ # e.g. "134" for 1_34_1 or "135" for 1_35
+
+ #boost_cv_lib_version="161"
+ #boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'`
+ #boost_major_version=`echo "$BOOST_LIB_VERSION" | sed 's/_//;s/_.*//'`
+ boost_major_version="161"
+
+ #case $boost_major_version in #(
+ # '' | *[[!0-9]]*)
+ # AC_MSG_ERROR([invalid value: boost_major_version='$boost_major_version'])
+ # ;;
+ #esac
+fi
+CPPFLAGS=$boost_save_CPPFLAGS
+])# BOOST_REQUIRE
+
+
+# BOOST_STATIC()
+# --------------
+# Add the "--enable-static-boost" configure argument. If this argument is given
+# on the command line, static versions of the libraries will be looked up.
+AC_DEFUN([BOOST_STATIC],
+ [AC_ARG_ENABLE([static-boost],
+ [AS_HELP_STRING([--enable-static-boost],
+ [Prefer the static boost libraries over the shared ones [no]])],
+ [enable_static_boost=yes],
+ [enable_static_boost=no])])# BOOST_STATIC
+
+
+# BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND])
+# --------------------------------------------------------------------------
+# Wrapper around AC_CHECK_HEADER for Boost headers. Useful to check for
+# some parts of the Boost library which are only made of headers and don't
+# require linking (such as Boost.Foreach).
+#
+# Default ACTION-IF-NOT-FOUND: Fail with a fatal error unless Boost couldn't be
+# found in the first place, in which case by default a notice is issued to the
+# user. Presumably if we haven't died already it's because it's OK to not have
+# Boost, which is why only a notice is issued instead of a hard error.
+#
+# Default ACTION-IF-FOUND: define the preprocessor symbol HAVE_<HEADER-NAME> in
+# case of success # (where HEADER-NAME is written LIKE_THIS, e.g.,
+# HAVE_BOOST_FOREACH_HPP).
+AC_DEFUN([BOOST_FIND_HEADER],
+[AC_REQUIRE([BOOST_REQUIRE])dnl
+if test x"$boost_cv_inc_path" = xno; then
+ m4_default([$2], [AC_MSG_NOTICE([Boost not available, not searching for $1])])
+else
+AC_LANG_PUSH([C++])dnl
+boost_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+AC_CHECK_HEADER([$1],
+ [m4_default([$3], [AC_DEFINE(AS_TR_CPP([HAVE_$1]), [1],
+ [Define to 1 if you have <$1>])])],
+ [m4_default([$2], [AC_MSG_ERROR([cannot find $1])])])
+CPPFLAGS=$boost_save_CPPFLAGS
+AC_LANG_POP([C++])dnl
+fi
+])# BOOST_FIND_HEADER
+
+
+# BOOST_FIND_LIBS([COMPONENT-NAME], [CANDIDATE-LIB-NAMES],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Look for the Boost library COMPONENT-NAME (e.g., `thread', for
+# libboost_thread) under the possible CANDIDATE-LIB-NAMES (e.g.,
+# "thread_win32 thread"). Check that HEADER-NAME works and check that
+# libboost_LIB-NAME can link with the code CXX-TEST. The optional
+# argument CXX-PROLOGUE can be used to include some C++ code before
+# the `main' function.
+#
+# Invokes BOOST_FIND_HEADER([HEADER-NAME]) (see above).
+#
+# Boost libraries typically come compiled with several flavors (with different
+# runtime options) so PREFERRED-RT-OPT is the preferred suffix. A suffix is one
+# or more of the following letters: sgdpn (in that order). s = static
+# runtime, d = debug build, g = debug/diagnostic runtime, p = STLPort build,
+# n = (unsure) STLPort build without iostreams from STLPort (it looks like `n'
+# must always be used along with `p'). Additionally, PREFERRED-RT-OPT can
+# start with `mt-' to indicate that there is a preference for multi-thread
+# builds. Some sample values for PREFERRED-RT-OPT: (nothing), mt, d, mt-d, gdp
+# ... If you want to make sure you have a specific version of Boost
+# (eg, >= 1.33) you *must* invoke BOOST_REQUIRE before this macro.
+AC_DEFUN([BOOST_FIND_LIBS],
+[AC_REQUIRE([BOOST_REQUIRE])dnl
+AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl
+AC_REQUIRE([BOOST_STATIC])dnl
+AC_REQUIRE([_BOOST_GUESS_WHETHER_TO_USE_MT])dnl
+if test x"$boost_cv_inc_path" = xno; then
+ AC_MSG_NOTICE([Boost not available, not searching for the Boost $1 library])
+else
+dnl The else branch is huge and wasn't intended on purpose.
+AC_LANG_PUSH([C++])dnl
+AS_VAR_PUSHDEF([Boost_lib], [boost_cv_lib_$1])dnl
+AS_VAR_PUSHDEF([Boost_lib_LDFLAGS], [boost_cv_lib_$1_LDFLAGS])dnl
+AS_VAR_PUSHDEF([Boost_lib_LDPATH], [boost_cv_lib_$1_LDPATH])dnl
+AS_VAR_PUSHDEF([Boost_lib_LIBS], [boost_cv_lib_$1_LIBS])dnl
+BOOST_FIND_HEADER([$4])
+boost_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib],
+ [_BOOST_FIND_LIBS($@)])
+case $Boost_lib in #(
+ (no) _AC_MSG_LOG_CONFTEST
+ AC_MSG_ERROR([cannot find the flags to link with Boost $1])
+ ;;
+esac
+AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS])dnl
+AC_SUBST(AS_TR_CPP([BOOST_$1_LDPATH]), [$Boost_lib_LDPATH])dnl
+AC_SUBST([BOOST_LDPATH], [$Boost_lib_LDPATH])dnl
+AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS])dnl
+CPPFLAGS=$boost_save_CPPFLAGS
+AS_VAR_POPDEF([Boost_lib])dnl
+AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl
+AS_VAR_POPDEF([Boost_lib_LDPATH])dnl
+AS_VAR_POPDEF([Boost_lib_LIBS])dnl
+AC_LANG_POP([C++])dnl
+fi
+])
+
+
+# BOOST_FIND_LIB([LIB-NAME],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Backward compatibility wrapper for BOOST_FIND_LIBS.
+AC_DEFUN([BOOST_FIND_LIB],
+[BOOST_FIND_LIBS([$1], $@)])
+
+
+# _BOOST_FIND_LIBS([LIB-NAME], [CANDIDATE-LIB-NAMES],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Real implementation of BOOST_FIND_LIBS: rely on these local macros:
+# Boost_lib, Boost_lib_LDFLAGS, Boost_lib_LDPATH, Boost_lib_LIBS
+#
+# The algorithm is as follows: first look for a given library name
+# according to the user's PREFERRED-RT-OPT. For each library name, we
+# prefer to use the ones that carry the tag (toolset name). Each
+# library is searched through the various standard paths were Boost is
+# usually installed. If we can't find the standard variants, we try
+# to enforce -mt (for instance on MacOSX, libboost_thread.dylib
+# doesn't exist but there's -obviously- libboost_thread-mt.dylib).
+AC_DEFUN([_BOOST_FIND_LIBS],
+[Boost_lib=no
+ case "$3" in #(
+ (mt | mt-) boost_mt=-mt; boost_rtopt=;; #(
+ (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$3" : 'Xmt-*\(.*\)'`;; #(
+ (*) boost_mt=; boost_rtopt=$3;;
+ esac
+ if test $enable_static_boost = yes; then
+ boost_rtopt="s$boost_rtopt"
+ fi
+ # Find the proper debug variant depending on what we've been asked to find.
+ case $boost_rtopt in #(
+ (*d*) boost_rt_d=$boost_rtopt;; #(
+ (*[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn')
+ boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #(
+ (*) boost_rt_d='-d';;
+ esac
+ # If the PREFERRED-RT-OPT are not empty, prepend a `-'.
+ test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt"
+ $boost_guess_use_mt && boost_mt=-mt
+ # Look for the abs path the static archive.
+ # $libext is computed by Libtool but let's make sure it's non empty.
+ test -z "$libext" &&
+ AC_MSG_ERROR([the libext variable is empty, did you invoke Libtool?])
+ boost_save_ac_objext=$ac_objext
+ # Generate the test file.
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$4>
+$6], [$5])])
+dnl Optimization hacks: compiling C++ is slow, especially with Boost. What
+dnl we're trying to do here is guess the right combination of link flags
+dnl (LIBS / LDFLAGS) to use a given library. This can take several
+dnl iterations before it succeeds and is thus *very* slow. So what we do
+dnl instead is that we compile the code first (and thus get an object file,
+dnl typically conftest.o). Then we try various combinations of link flags
+dnl until we succeed to link conftest.o in an executable. The problem is
+dnl that the various TRY_LINK / COMPILE_IFELSE macros of Autoconf always
+dnl remove all the temporary files including conftest.o. So the trick here
+dnl is to temporarily change the value of ac_objext so that conftest.o is
+dnl preserved accross tests. This is obviously fragile and I will burn in
+dnl hell for not respecting Autoconf's documented interfaces, but in the
+dnl mean time, it optimizes the macro by a factor of 5 to 30.
+dnl Another small optimization: the first argument of AC_COMPILE_IFELSE left
+dnl empty because the test file is generated only once above (before we
+dnl start the for loops).
+ AC_COMPILE_IFELSE([],
+ [ac_objext=do_not_rm_me_plz],
+ [AC_MSG_ERROR([cannot compile a test that uses Boost $1])])
+ ac_objext=$boost_save_ac_objext
+ boost_failed_libs=
+# Don't bother to ident the following nested for loops, only the 2
+# innermost ones matter.
+for boost_lib_ in $2; do
+for boost_tag_ in -$boost_cv_lib_tag ''; do
+for boost_ver_ in -$boost_cv_lib_version ''; do
+for boost_mt_ in $boost_mt -mt ''; do
+for boost_rtopt_ in $boost_rtopt '' -d; do
+ for boost_lib in \
+ boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_ver_
+ do
+ # Avoid testing twice the same lib
+ case $boost_failed_libs in #(
+ (*@$boost_lib@*) continue;;
+ esac
+ # If with_boost is empty, we'll search in /lib first, which is not quite
+ # right so instead we'll try to a location based on where the headers are.
+ boost_tmp_lib=$with_boost
+ test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include}
+ for boost_ldpath in "$boost_tmp_lib/lib" '' \
+ /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \
+ "$with_boost" C:/Boost/lib /lib*
+ do
+ # Don't waste time with directories that don't exist.
+ if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then
+ continue
+ fi
+ boost_save_LDFLAGS=$LDFLAGS
+ # Are we looking for a static library?
+ case $boost_ldpath:$boost_rtopt_ in #(
+ (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt)
+ Boost_lib_LIBS="$boost_ldpath/lib$boost_lib.$libext"
+ test -e "$Boost_lib_LIBS" || continue;; #(
+ (*) # No: use -lboost_foo to find the shared library.
+ Boost_lib_LIBS="-l$boost_lib";;
+ esac
+ boost_save_LIBS=$LIBS
+ LIBS="$Boost_lib_LIBS $LIBS"
+ test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath"
+dnl First argument of AC_LINK_IFELSE left empty because the test file is
+dnl generated only once above (before we start the for loops).
+ _BOOST_AC_LINK_IFELSE([],
+ [Boost_lib=yes], [Boost_lib=no])
+ ac_objext=$boost_save_ac_objext
+ LDFLAGS=$boost_save_LDFLAGS
+ LIBS=$boost_save_LIBS
+ if test x"$Boost_lib" = xyes; then
+ # Check or used cached result of whether or not using -R or
+ # -rpath makes sense. Some implementations of ld, such as for
+ # Mac OSX, require -rpath but -R is the flag known to work on
+ # other systems. https://github.com/tsuna/boost.m4/issues/19
+ AC_CACHE_VAL([boost_cv_rpath_link_ldflag],
+ [case $boost_ldpath in
+ '') # Nothing to do.
+ boost_cv_rpath_link_ldflag=
+ boost_rpath_link_ldflag_found=yes;;
+ *)
+ for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do
+ LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
+ LIBS="$boost_save_LIBS $Boost_lib_LIBS"
+ _BOOST_AC_LINK_IFELSE([],
+ [boost_rpath_link_ldflag_found=yes
+ break],
+ [boost_rpath_link_ldflag_found=no])
+ done
+ ;;
+ esac
+ AS_IF([test "x$boost_rpath_link_ldflag_found" != "xyes"],
+ [AC_MSG_ERROR([Unable to determine whether to use -R or -rpath])])
+ LDFLAGS=$boost_save_LDFLAGS
+ LIBS=$boost_save_LIBS
+ ])
+ test x"$boost_ldpath" != x &&
+ Boost_lib_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
+ Boost_lib_LDPATH="$boost_ldpath"
+ break 7
+ else
+ boost_failed_libs="$boost_failed_libs@$boost_lib@"
+ fi
+ done
+ done
+done
+done
+done
+done
+done # boost_lib_
+rm -f conftest.$ac_objext
+])
+
+
+
+# --------------------------------------- #
+# Checks for the various Boost libraries. #
+# --------------------------------------- #
+
+# List of boost libraries: http://www.boost.org/libs/libraries.htm
+# The page http://beta.boost.org/doc/libs is useful: it gives the first release
+# version of each library (among other things).
+
+# BOOST_DEFUN(LIBRARY, CODE)
+# --------------------------
+# Define BOOST_<LIBRARY-UPPERCASE> as a macro that runs CODE.
+#
+# Use indir to avoid the warning on underquoted macro name given to AC_DEFUN.
+m4_define([BOOST_DEFUN],
+[m4_indir([AC_DEFUN],
+ m4_toupper([BOOST_$1]),
+[m4_pushdef([BOOST_Library], [$1])dnl
+$2
+m4_popdef([BOOST_Library])dnl
+])
+])
+
+# BOOST_ARRAY()
+# -------------
+# Look for Boost.Array
+BOOST_DEFUN([Array],
+[BOOST_FIND_HEADER([boost/array.hpp])])
+
+
+# BOOST_ASIO()
+# ------------
+# Look for Boost.Asio (new in Boost 1.35).
+BOOST_DEFUN([Asio],
+[AC_REQUIRE([BOOST_SYSTEM])dnl
+BOOST_FIND_HEADER([boost/asio.hpp])])
+
+
+# BOOST_BIND()
+# ------------
+# Look for Boost.Bind.
+BOOST_DEFUN([Bind],
+[BOOST_FIND_HEADER([boost/bind.hpp])])
+
+
+# BOOST_CHRONO()
+# --------------
+# Look for Boost.Chrono.
+BOOST_DEFUN([Chrono],
+[# Do we have to check for Boost.System? This link-time dependency was
+# added as of 1.35.0. If we have a version <1.35, we must not attempt to
+# find Boost.System as it didn't exist by then.
+if test $boost_major_version -ge 135; then
+ BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+boost_filesystem_save_LIBS=$LIBS
+boost_filesystem_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([chrono], [$1],
+ [boost/chrono.hpp],
+ [boost::chrono::thread_clock d;])
+if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
+ BOOST_CHRONO_LIBS="$BOOST_CHRONO_LIBS $BOOST_SYSTEM_LIBS"
+fi
+LIBS=$boost_filesystem_save_LIBS
+LDFLAGS=$boost_filesystem_save_LDFLAGS
+])# BOOST_CHRONO
+
+
+# BOOST_CONTEXT([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Context. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+#
+# * This library was introduced in Boost 1.51.0
+# * The signatures of make_fcontext() and jump_fcontext were changed in 1.56.0
+# * A dependency on boost_thread appears in 1.57.0
+BOOST_DEFUN([Context],
+[boost_context_save_LIBS=$LIBS
+ boost_context_save_LDFLAGS=$LDFLAGS
+if test $boost_major_version -ge 157; then
+ BOOST_THREAD([$1])
+ m4_pattern_allow([^BOOST_THREAD_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_THREAD_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_THREAD_LDFLAGS"
+fi
+BOOST_FIND_LIB([context], [$1],
+ [boost/context/all.hpp],[[
+
+// creates a stack
+void * stack_pointer = new void*[4096];
+std::size_t const size = sizeof(void*[4096]);
+
+#if BOOST_VERSION <= 105100
+ctx::make_fcontext(&fc, f);
+return ctx::jump_fcontext(&fcm, &fc, 3) == 6;
+
+#else
+
+fc = ctx::make_fcontext(stack_pointer, size, f);
+return ctx::jump_fcontext(&fcm, fc, 3) == 6;
+
+#endif
+
+
+]],[dnl
+
+#include <boost/version.hpp>
+#if BOOST_VERSION <= 105100
+
+namespace ctx = boost::ctx;
+
+static ctx::fcontext_t fcm, fc;
+
+static void f(intptr_t i) {
+ ctx::jump_fcontext(&fc, &fcm, i * 2);
+}
+
+#elif BOOST_VERSION <= 105500
+
+namespace ctx = boost::context;
+
+// context
+static ctx::fcontext_t fcm, *fc;
+
+// context-function
+static void f(intptr_t i) {
+ ctx::jump_fcontext(fc, &fcm, i * 2);
+}
+
+#else
+
+namespace ctx = boost::context;
+
+// context
+static ctx::fcontext_t fcm, fc;
+
+// context-function
+static void f(intptr_t i) {
+ ctx::jump_fcontext(&fc, fcm, i * 2);
+}
+#endif
+])
+LIBS=$boost_context_save_LIBS
+LDFLAGS=$boost_context_save_LDFLAGS
+])# BOOST_CONTEXT
+
+
+# BOOST_CONVERSION()
+# ------------------
+# Look for Boost.Conversion (cast / lexical_cast)
+BOOST_DEFUN([Conversion],
+[BOOST_FIND_HEADER([boost/cast.hpp])
+BOOST_FIND_HEADER([boost/lexical_cast.hpp])
+])# BOOST_CONVERSION
+
+
+# BOOST_COROUTINE([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Coroutine. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. This library was introduced in Boost
+# 1.53.0
+BOOST_DEFUN([Coroutine],
+[
+boost_coroutine_save_LIBS=$LIBS
+boost_coroutine_save_LDFLAGS=$LDFLAGS
+# Link-time dependency from coroutine to context
+BOOST_CONTEXT([$1])
+# Starting from Boost 1.55 a dependency on Boost.System is added
+if test $boost_major_version -ge 155; then
+ BOOST_SYSTEM([$1])
+fi
+m4_pattern_allow([^BOOST_(CONTEXT|SYSTEM)_(LIBS|LDFLAGS)])
+LIBS="$LIBS $BOOST_CONTEXT_LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_CONTEXT_LDFLAGS"
+
+# in 1.53 coroutine was a header only library
+if test $boost_major_version -eq 153; then
+ BOOST_FIND_HEADER([boost/coroutine/coroutine.hpp])
+else
+ BOOST_FIND_LIB([coroutine], [$1],
+ [boost/coroutine/coroutine.hpp],
+ [
+ #include <boost/version.hpp>
+ #if BOOST_VERSION <= 105500
+ boost::coroutines::coroutine<int(int)> coro; coro.get();
+ #else
+ boost::coroutines::asymmetric_coroutine<int>::pull_type coro; coro.get();
+ #endif
+ ])
+fi
+# Link-time dependency from coroutine to context, existed only in 1.53, in 1.54
+# coroutine doesn't use context from its headers but from its library.
+if test $boost_major_version -eq 153 || test $enable_static_boost = yes && test $boost_major_version -ge 154; then
+ BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_CONTEXT_LIBS"
+ BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_CONTEXT_LDFLAGS"
+fi
+if test $enable_static_boost = yes && test $boost_major_version -ge 155; then
+ BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_SYSTEM_LIBS"
+ BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+fi
+LIBS=$boost_coroutine_save_LIBS
+LDFLAGS=$boost_coroutine_save_LDFLAGS
+])# BOOST_COROUTINE
+
+
+# BOOST_CRC()
+# -----------
+# Look for Boost.CRC
+BOOST_DEFUN([CRC],
+[BOOST_FIND_HEADER([boost/crc.hpp])
+])# BOOST_CRC
+
+
+# BOOST_DATE_TIME([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Date_Time. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Date_Time],
+[BOOST_FIND_LIB([date_time], [$1],
+ [boost/date_time/posix_time/posix_time.hpp],
+ [boost::posix_time::ptime t;])
+])# BOOST_DATE_TIME
+
+
+# BOOST_FILESYSTEM([PREFERRED-RT-OPT])
+# ------------------------------------
+# Look for Boost.Filesystem. For the documentation of PREFERRED-RT-OPT, see
+# the documentation of BOOST_FIND_LIB above.
+# Do not check for boost/filesystem.hpp because this file was introduced in
+# 1.34.
+BOOST_DEFUN([Filesystem],
+[# Do we have to check for Boost.System? This link-time dependency was
+# added as of 1.35.0. If we have a version <1.35, we must not attempt to
+# find Boost.System as it didn't exist by then.
+if test $boost_major_version -ge 135; then
+ BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+boost_filesystem_save_LIBS=$LIBS
+boost_filesystem_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([filesystem], [$1],
+ [boost/filesystem/path.hpp], [boost::filesystem::path p;])
+if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
+ BOOST_FILESYSTEM_LIBS="$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"
+fi
+LIBS=$boost_filesystem_save_LIBS
+LDFLAGS=$boost_filesystem_save_LDFLAGS
+])# BOOST_FILESYSTEM
+
+
+# BOOST_FLYWEIGHT()
+# -----------------
+# Look for Boost.Flyweight.
+BOOST_DEFUN([Flyweight],
+[dnl There's a hidden dependency on pthreads.
+AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
+BOOST_FIND_HEADER([boost/flyweight.hpp])
+AC_SUBST([BOOST_FLYWEIGHT_LIBS], [$boost_cv_pthread_flag])
+])
+
+
+# BOOST_FOREACH()
+# ---------------
+# Look for Boost.Foreach.
+BOOST_DEFUN([Foreach],
+[BOOST_FIND_HEADER([boost/foreach.hpp])])
+
+
+# BOOST_FORMAT()
+# --------------
+# Look for Boost.Format.
+# Note: we can't check for boost/format/format_fwd.hpp because the header isn't
+# standalone. It can't be compiled because it triggers the following error:
+# boost/format/detail/config_macros.hpp:88: error: 'locale' in namespace 'std'
+# does not name a type
+BOOST_DEFUN([Format],
+[BOOST_FIND_HEADER([boost/format.hpp])])
+
+
+# BOOST_FUNCTION()
+# ----------------
+# Look for Boost.Function
+BOOST_DEFUN([Function],
+[BOOST_FIND_HEADER([boost/function.hpp])])
+
+
+# BOOST_GEOMETRY()
+# ----------------
+# Look for Boost.Geometry (new since 1.47.0).
+BOOST_DEFUN([Geometry],
+[BOOST_FIND_HEADER([boost/geometry.hpp])
+])# BOOST_GEOMETRY
+
+
+# BOOST_GRAPH([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost.Graphs. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Graph],
+[boost_graph_save_LIBS=$LIBS
+boost_graph_save_LDFLAGS=$LDFLAGS
+# Link-time dependency from graph to regex was added as of 1.40.0.
+if test $boost_major_version -ge 140; then
+ BOOST_REGEX([$1])
+ m4_pattern_allow([^BOOST_REGEX_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_REGEX_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_REGEX_LDFLAGS"
+fi
+BOOST_FIND_LIB([graph], [$1],
+ [boost/graph/adjacency_list.hpp], [boost::adjacency_list<> g;])
+LIBS=$boost_graph_save_LIBS
+LDFLAGS=$boost_graph_save_LDFLAGS
+])# BOOST_GRAPH
+
+
+# BOOST_IOSTREAMS([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.IOStreams. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([IOStreams],
+[BOOST_FIND_LIB([iostreams], [$1],
+ [boost/iostreams/device/file_descriptor.hpp],
+ [boost::iostreams::file_descriptor fd; fd.close();])
+])# BOOST_IOSTREAMS
+
+
+# BOOST_HASH()
+# ------------
+# Look for Boost.Functional/Hash
+BOOST_DEFUN([Hash],
+[BOOST_FIND_HEADER([boost/functional/hash.hpp])])
+
+
+# BOOST_LAMBDA()
+# --------------
+# Look for Boost.Lambda
+BOOST_DEFUN([Lambda],
+[BOOST_FIND_HEADER([boost/lambda/lambda.hpp])])
+
+
+# BOOST_LOCALE()
+# --------------
+# Look for Boost.Locale
+BOOST_DEFUN([Locale],
+[
+boost_locale_save_LIBS=$LIBS
+boost_locale_save_LDFLAGS=$LDFLAGS
+# require SYSTEM for boost-1.50.0 and up
+if test $boost_major_version -ge 150; then
+ BOOST_SYSTEM([$1])
+ m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+fi # end of the Boost.System check.
+BOOST_FIND_LIB([locale], [$1],
+ [boost/locale.hpp],
+ [[boost::locale::generator gen; std::locale::global(gen(""));]])
+LIBS=$boost_locale_save_LIBS
+LDFLAGS=$boost_locale_save_LDFLAGS
+])# BOOST_LOCALE
+
+# BOOST_LOG([PREFERRED-RT-OPT])
+# -----------------------------
+# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Log],
+[boost_log_save_LIBS=$LIBS
+boost_log_save_LDFLAGS=$LDFLAGS
+BOOST_SYSTEM([$1])
+BOOST_FILESYSTEM([$1])
+BOOST_DATE_TIME([$1])
+m4_pattern_allow([^BOOST_(SYSTEM|FILESYSTEM|DATE_TIME)_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_DATE_TIME_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_DATE_TIME_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([log], [$1],
+ [boost/log/core/core.hpp],
+ [boost::log::attribute a; a.get_value();])
+LIBS=$boost_log_save_LIBS
+LDFLAGS=$boost_log_save_LDFLAGS
+])# BOOST_LOG
+
+
+# BOOST_LOG_SETUP([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Log_Setup],
+[boost_log_setup_save_LIBS=$LIBS
+boost_log_setup_save_LDFLAGS=$LDFLAGS
+BOOST_LOG([$1])
+m4_pattern_allow([^BOOST_LOG_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_LOG_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_LOG_LDFLAGS"
+BOOST_FIND_LIB([log_setup], [$1],
+ [boost/log/utility/setup/from_settings.hpp],
+ [boost::log::basic_settings<char> bs; bs.empty();])
+LIBS=$boost_log_setup_save_LIBS
+LDFLAGS=$boost_log_setup_save_LDFLAGS
+])# BOOST_LOG_SETUP
+
+
+# BOOST_MATH()
+# ------------
+# Look for Boost.Math
+# TODO: This library isn't header-only but it comes in multiple different
+# flavors that don't play well with BOOST_FIND_LIB (e.g, libboost_math_c99,
+# libboost_math_c99f, libboost_math_c99l, libboost_math_tr1,
+# libboost_math_tr1f, libboost_math_tr1l). This macro must be fixed to do the
+# right thing anyway.
+BOOST_DEFUN([Math],
+[BOOST_FIND_HEADER([boost/math/special_functions.hpp])])
+
+
+# BOOST_MPI([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost MPI. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. Uses MPICXX variable if it is
+# set, otherwise tries CXX
+#
+BOOST_DEFUN([MPI],
+[boost_save_CXX=${CXX}
+boost_save_CXXCPP=${CXXCPP}
+if test x"${MPICXX}" != x; then
+ CXX=${MPICXX}
+ CXXCPP="${MPICXX} -E"
+fi
+BOOST_FIND_LIB([mpi], [$1],
+ [boost/mpi.hpp],
+ [int argc = 0;
+ char **argv = 0;
+ boost::mpi::environment env(argc,argv);])
+CXX=${boost_save_CXX}
+CXXCPP=${boost_save_CXXCPP}
+])# BOOST_MPI
+
+
+# BOOST_MULTIARRAY()
+# ------------------
+# Look for Boost.MultiArray
+BOOST_DEFUN([MultiArray],
+[BOOST_FIND_HEADER([boost/multi_array.hpp])])
+
+
+# BOOST_NUMERIC_UBLAS()
+# --------------------------
+# Look for Boost.NumericUblas (Basic Linear Algebra)
+BOOST_DEFUN([Numeric_Ublas],
+[BOOST_FIND_HEADER([boost/numeric/ublas/vector.hpp])
+])# BOOST_NUMERIC_UBLAS
+
+
+# BOOST_NUMERIC_CONVERSION()
+# --------------------------
+# Look for Boost.NumericConversion (policy-based numeric conversion)
+BOOST_DEFUN([Numeric_Conversion],
+[BOOST_FIND_HEADER([boost/numeric/conversion/converter.hpp])
+])# BOOST_NUMERIC_CONVERSION
+
+
+# BOOST_OPTIONAL()
+# ----------------
+# Look for Boost.Optional
+BOOST_DEFUN([Optional],
+[BOOST_FIND_HEADER([boost/optional.hpp])])
+
+
+# BOOST_PREPROCESSOR()
+# --------------------
+# Look for Boost.Preprocessor
+BOOST_DEFUN([Preprocessor],
+[BOOST_FIND_HEADER([boost/preprocessor/repeat.hpp])])
+
+
+# BOOST_RANGE()
+# --------------------
+# Look for Boost.Range
+BOOST_DEFUN([Range],
+[BOOST_FIND_HEADER([boost/range/adaptors.hpp])])
+
+# BOOST_UNORDERED()
+# -----------------
+# Look for Boost.Unordered
+BOOST_DEFUN([Unordered],
+[BOOST_FIND_HEADER([boost/unordered_map.hpp])])
+
+
+# BOOST_UUID()
+# ------------
+# Look for Boost.Uuid
+BOOST_DEFUN([Uuid],
+[BOOST_FIND_HEADER([boost/uuid/uuid.hpp])])
+
+
+# BOOST_PROGRAM_OPTIONS([PREFERRED-RT-OPT])
+# -----------------------------------------
+# Look for Boost.Program_options. For the documentation of PREFERRED-RT-OPT,
+# see the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Program_Options],
+[BOOST_FIND_LIB([program_options], [$1],
+ [boost/program_options.hpp],
+ [boost::program_options::options_description d("test");])
+])# BOOST_PROGRAM_OPTIONS
+
+
+
+# _BOOST_PYTHON_CONFIG(VARIABLE, FLAG)
+# ------------------------------------
+# Save VARIABLE, and define it via `python-config --FLAG`.
+# Substitute BOOST_PYTHON_VARIABLE.
+m4_define([_BOOST_PYTHON_CONFIG],
+[AC_SUBST([BOOST_PYTHON_$1],
+ [`python-config --$2 2>/dev/null`])dnl
+boost_python_save_$1=$$1
+$1="$$1 $BOOST_PYTHON_$1"])
+
+
+# BOOST_PYTHON([PREFERRED-RT-OPT])
+# --------------------------------
+# Look for Boost.Python. For the documentation of PREFERRED-RT-OPT,
+# see the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Python],
+[_BOOST_PYTHON_CONFIG([CPPFLAGS], [includes])
+_BOOST_PYTHON_CONFIG([LDFLAGS], [ldflags])
+_BOOST_PYTHON_CONFIG([LIBS], [libs])
+m4_pattern_allow([^BOOST_PYTHON_MODULE$])dnl
+BOOST_FIND_LIBS([python], [python python3], [$1],
+ [boost/python.hpp],
+ [], [BOOST_PYTHON_MODULE(empty) {}])
+CPPFLAGS=$boost_python_save_CPPFLAGS
+LDFLAGS=$boost_python_save_LDFLAGS
+LIBS=$boost_python_save_LIBS
+])# BOOST_PYTHON
+
+
+# BOOST_REF()
+# -----------
+# Look for Boost.Ref
+BOOST_DEFUN([Ref],
+[BOOST_FIND_HEADER([boost/ref.hpp])])
+
+
+# BOOST_REGEX([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost.Regex. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Regex],
+[BOOST_FIND_LIB([regex], [$1],
+ [boost/regex.hpp],
+ [boost::regex exp("*"); boost::regex_match("foo", exp);])
+])# BOOST_REGEX
+
+
+# BOOST_SERIALIZATION([PREFERRED-RT-OPT])
+# ---------------------------------------
+# Look for Boost.Serialization. For the documentation of PREFERRED-RT-OPT, see
+# the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Serialization],
+[BOOST_FIND_LIB([serialization], [$1],
+ [boost/archive/text_oarchive.hpp],
+ [std::ostream* o = 0; // Cheap way to get an ostream...
+ boost::archive::text_oarchive t(*o);])
+])# BOOST_SERIALIZATION
+
+
+# BOOST_SIGNALS([PREFERRED-RT-OPT])
+# ---------------------------------
+# Look for Boost.Signals. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Signals],
+[BOOST_FIND_LIB([signals], [$1],
+ [boost/signal.hpp],
+ [boost::signal<void ()> s;])
+])# BOOST_SIGNALS
+
+
+# BOOST_SIGNALS2()
+# ----------------
+# Look for Boost.Signals2 (new since 1.39.0).
+BOOST_DEFUN([Signals2],
+[BOOST_FIND_HEADER([boost/signals2.hpp])
+])# BOOST_SIGNALS2
+
+
+# BOOST_SMART_PTR()
+# -----------------
+# Look for Boost.SmartPtr
+BOOST_DEFUN([Smart_Ptr],
+[BOOST_FIND_HEADER([boost/scoped_ptr.hpp])
+BOOST_FIND_HEADER([boost/shared_ptr.hpp])
+])
+
+
+# BOOST_STATICASSERT()
+# --------------------
+# Look for Boost.StaticAssert
+BOOST_DEFUN([StaticAssert],
+[BOOST_FIND_HEADER([boost/static_assert.hpp])])
+
+
+# BOOST_STRING_ALGO()
+# -------------------
+# Look for Boost.StringAlgo
+BOOST_DEFUN([String_Algo],
+[BOOST_FIND_HEADER([boost/algorithm/string.hpp])
+])
+
+
+# BOOST_SYSTEM([PREFERRED-RT-OPT])
+# --------------------------------
+# Look for Boost.System. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. This library was introduced in Boost
+# 1.35.0.
+BOOST_DEFUN([System],
+[BOOST_FIND_LIB([system], [$1],
+ [boost/system/error_code.hpp],
+ [boost::system::error_code e; e.clear();])
+])# BOOST_SYSTEM
+
+
+# BOOST_TEST([PREFERRED-RT-OPT])
+# ------------------------------
+# Look for Boost.Test. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Test],
+[m4_pattern_allow([^BOOST_CHECK$])dnl
+BOOST_FIND_LIB([unit_test_framework], [$1],
+ [boost/test/unit_test.hpp], [BOOST_CHECK(2 == 2);],
+ [using boost::unit_test::test_suite;
+ test_suite* init_unit_test_suite(int argc, char ** argv)
+ { return NULL; }])
+])# BOOST_TEST
+
+
+# BOOST_THREAD([PREFERRED-RT-OPT])
+# ---------------------------------
+# Look for Boost.Thread. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Thread],
+[dnl Having the pthread flag is required at least on GCC3 where
+dnl boost/thread.hpp would complain if we try to compile without
+dnl -pthread on GNU/Linux.
+AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
+boost_thread_save_LIBS=$LIBS
+boost_thread_save_LDFLAGS=$LDFLAGS
+boost_thread_save_CPPFLAGS=$CPPFLAGS
+# Link-time dependency from thread to system was added as of 1.49.0.
+if test $boost_major_version -ge 149; then
+BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+CPPFLAGS="$CPPFLAGS $boost_cv_pthread_flag"
+
+# When compiling for the Windows platform, the threads library is named
+# differently. This suffix doesn't exist in new versions of Boost, or
+# possibly new versions of GCC on mingw I am assuming it's Boost's change for
+# now and I am setting version to 1.48, for lack of knowledge as to when this
+# change occurred.
+if test $boost_major_version -lt 148; then
+ case $host_os in
+ (*mingw*) boost_thread_lib_ext=_win32;;
+ esac
+fi
+BOOST_FIND_LIBS([thread], [thread$boost_thread_lib_ext],
+ [$1],
+ [boost/thread.hpp], [boost::thread t; boost::mutex m;])
+
+case $host_os in
+ (*mingw*) boost_thread_w32_socket_link=-lws2_32;;
+esac
+
+BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag $boost_thread_w32_socket_link"
+BOOST_THREAD_LDFLAGS="$BOOST_SYSTEM_LDFLAGS"
+BOOST_CPPFLAGS="$BOOST_CPPFLAGS $boost_cv_pthread_flag"
+LIBS=$boost_thread_save_LIBS
+LDFLAGS=$boost_thread_save_LDFLAGS
+CPPFLAGS=$boost_thread_save_CPPFLAGS
+])# BOOST_THREAD
+
+AU_ALIAS([BOOST_THREADS], [BOOST_THREAD])
+
+
+# BOOST_TOKENIZER()
+# -----------------
+# Look for Boost.Tokenizer
+BOOST_DEFUN([Tokenizer],
+[BOOST_FIND_HEADER([boost/tokenizer.hpp])])
+
+
+# BOOST_TRIBOOL()
+# ---------------
+# Look for Boost.Tribool
+BOOST_DEFUN([Tribool],
+[BOOST_FIND_HEADER([boost/logic/tribool_fwd.hpp])
+BOOST_FIND_HEADER([boost/logic/tribool.hpp])
+])
+
+
+# BOOST_TUPLE()
+# -------------
+# Look for Boost.Tuple
+BOOST_DEFUN([Tuple],
+[BOOST_FIND_HEADER([boost/tuple/tuple.hpp])])
+
+
+# BOOST_TYPETRAITS()
+# --------------------
+# Look for Boost.TypeTraits
+BOOST_DEFUN([TypeTraits],
+[BOOST_FIND_HEADER([boost/type_traits.hpp])])
+
+
+# BOOST_UTILITY()
+# ---------------
+# Look for Boost.Utility (noncopyable, result_of, base-from-member idiom,
+# etc.)
+BOOST_DEFUN([Utility],
+[BOOST_FIND_HEADER([boost/utility.hpp])])
+
+
+# BOOST_VARIANT()
+# ---------------
+# Look for Boost.Variant.
+BOOST_DEFUN([Variant],
+[BOOST_FIND_HEADER([boost/variant/variant_fwd.hpp])
+BOOST_FIND_HEADER([boost/variant.hpp])])
+
+
+# BOOST_POINTER_CONTAINER()
+# ------------------------
+# Look for Boost.PointerContainer
+BOOST_DEFUN([Pointer_Container],
+[BOOST_FIND_HEADER([boost/ptr_container/ptr_deque.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_list.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_vector.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_array.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_set.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_map.hpp])
+])# BOOST_POINTER_CONTAINER
+
+
+# BOOST_WAVE([PREFERRED-RT-OPT])
+# ------------------------------
+# NOTE: If you intend to use Wave/Spirit with thread support, make sure you
+# call BOOST_THREAD first.
+# Look for Boost.Wave. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Wave],
+[AC_REQUIRE([BOOST_FILESYSTEM])dnl
+AC_REQUIRE([BOOST_DATE_TIME])dnl
+boost_wave_save_LIBS=$LIBS
+boost_wave_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_((FILE)?SYSTEM|DATE_TIME|THREAD)_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS \
+$BOOST_THREAD_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS \
+$BOOST_DATE_TIME_LDFLAGS $BOOST_THREAD_LDFLAGS"
+BOOST_FIND_LIB([wave], [$1],
+ [boost/wave.hpp],
+ [boost::wave::token_id id; get_token_name(id);])
+LIBS=$boost_wave_save_LIBS
+LDFLAGS=$boost_wave_save_LDFLAGS
+])# BOOST_WAVE
+
+
+# BOOST_XPRESSIVE()
+# -----------------
+# Look for Boost.Xpressive (new since 1.36.0).
+BOOST_DEFUN([Xpressive],
+[BOOST_FIND_HEADER([boost/xpressive/xpressive.hpp])])
+
+
+# ----------------- #
+# Internal helpers. #
+# ----------------- #
+
+
+# _BOOST_PTHREAD_FLAG()
+# ---------------------
+# Internal helper for BOOST_THREAD. Computes boost_cv_pthread_flag
+# which must be used in CPPFLAGS and LIBS.
+#
+# Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3,
+# boost/thread.hpp will trigger a #error if -pthread isn't used:
+# boost/config/requires_threads.hpp:47:5: #error "Compiler threading support
+# is not turned on. Please set the correct command line options for
+# threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
+#
+# Based on ACX_PTHREAD: http://autoconf-archive.cryp.to/acx_pthread.html
+AC_DEFUN([_BOOST_PTHREAD_FLAG],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_LANG_PUSH([C++])dnl
+AC_CACHE_CHECK([for the flags needed to use pthreads], [boost_cv_pthread_flag],
+[ boost_cv_pthread_flag=
+ # The ordering *is* (sometimes) important. Some notes on the
+ # individual items follow:
+ # (none): in case threads are in libc; should be tried before -Kthread and
+ # other compiler flags to prevent continual compiler warnings
+ # -lpthreads: AIX (must check this before -lpthread)
+ # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+ # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+ # -llthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+ # -pthread: GNU Linux/GCC (kernel threads), BSD/GCC (userland threads)
+ # -pthreads: Solaris/GCC
+ # -mthreads: MinGW32/GCC, Lynx/GCC
+ # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+ # doesn't hurt to check since this sometimes defines pthreads too;
+ # also defines -D_REENTRANT)
+ # ... -mt is also the pthreads flag for HP/aCC
+ # -lpthread: GNU Linux, etc.
+ # --thread-safe: KAI C++
+ case $host_os in #(
+ *solaris*)
+ # On Solaris (at least, for some versions), libc contains stubbed
+ # (non-functional) versions of the pthreads routines, so link-based
+ # tests will erroneously succeed. (We need to link with -pthreads/-mt/
+ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
+ # a function called by this macro, so we could check for that, but
+ # who knows whether they'll stub that too in a future libc.) So,
+ # we'll just look for -pthreads and -lpthread first:
+ boost_pthread_flags="-pthreads -lpthread -mt -pthread";; #(
+ *)
+ boost_pthread_flags="-lpthreads -Kthread -kthread -llthread -pthread \
+ -pthreads -mthreads -lpthread --thread-safe -mt";;
+ esac
+ # Generate the test file.
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <pthread.h>],
+ [pthread_t th; pthread_join(th, 0);
+ pthread_attr_init(0); pthread_cleanup_push(0, 0);
+ pthread_create(0,0,0,0); pthread_cleanup_pop(0);])])
+ for boost_pthread_flag in '' $boost_pthread_flags; do
+ boost_pthread_ok=false
+dnl Re-use the test file already generated.
+ boost_pthreads__save_LIBS=$LIBS
+ LIBS="$LIBS $boost_pthread_flag"
+ AC_LINK_IFELSE([],
+ [if grep ".*$boost_pthread_flag" conftest.err; then
+ echo "This flag seems to have triggered warnings" >&AS_MESSAGE_LOG_FD
+ else
+ boost_pthread_ok=:; boost_cv_pthread_flag=$boost_pthread_flag
+ fi])
+ LIBS=$boost_pthreads__save_LIBS
+ $boost_pthread_ok && break
+ done
+])
+AC_LANG_POP([C++])dnl
+])# _BOOST_PTHREAD_FLAG
+
+
+# _BOOST_gcc_test(MAJOR, MINOR)
+# -----------------------------
+# Internal helper for _BOOST_FIND_COMPILER_TAG.
+m4_define([_BOOST_gcc_test],
+["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC @ gcc$1$2"])dnl
+
+# _BOOST_mingw_test(MAJOR, MINOR)
+# -----------------------------
+# Internal helper for _BOOST_FIND_COMPILER_TAG.
+m4_define([_BOOST_mingw_test],
+["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw$1$2"])dnl
+
+
+# _BOOST_FIND_COMPILER_TAG()
+# --------------------------
+# Internal. When Boost is installed without --layout=system, each library
+# filename will hold a suffix that encodes the compiler used during the
+# build. The Boost build system seems to call this a `tag'.
+AC_DEFUN([_BOOST_FIND_COMPILER_TAG],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_CACHE_CHECK([for the toolset name used by Boost for $CXX],
+ [boost_cv_lib_tag],
+[boost_cv_lib_tag=unknown
+if test x$boost_cv_inc_path != xno; then
+ AC_LANG_PUSH([C++])dnl
+ # The following tests are mostly inspired by boost/config/auto_link.hpp
+ # The list is sorted to most recent/common to oldest compiler (in order
+ # to increase the likelihood of finding the right compiler with the
+ # least number of compilation attempt).
+ # Beware that some tests are sensible to the order (for instance, we must
+ # look for MinGW before looking for GCC3).
+ # I used one compilation test per compiler with a #error to recognize
+ # each compiler so that it works even when cross-compiling (let me know
+ # if you know a better approach).
+ # Known missing tags (known from Boost's tools/build/v2/tools/common.jam):
+ # como, edg, kcc, bck, mp, sw, tru, xlc
+ # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines
+ # the same defines as GCC's).
+ for i in \
+ _BOOST_mingw_test(5, 3) \
+ _BOOST_gcc_test(5, 3) \
+ _BOOST_mingw_test(5, 2) \
+ _BOOST_gcc_test(5, 2) \
+ _BOOST_mingw_test(5, 1) \
+ _BOOST_gcc_test(5, 1) \
+ _BOOST_mingw_test(5, 0) \
+ _BOOST_gcc_test(5, 0) \
+ _BOOST_mingw_test(4, 10) \
+ _BOOST_gcc_test(4, 10) \
+ _BOOST_mingw_test(4, 9) \
+ _BOOST_gcc_test(4, 9) \
+ _BOOST_mingw_test(4, 8) \
+ _BOOST_gcc_test(4, 8) \
+ _BOOST_mingw_test(4, 7) \
+ _BOOST_gcc_test(4, 7) \
+ _BOOST_mingw_test(4, 6) \
+ _BOOST_gcc_test(4, 6) \
+ _BOOST_mingw_test(4, 5) \
+ _BOOST_gcc_test(4, 5) \
+ _BOOST_mingw_test(4, 4) \
+ _BOOST_gcc_test(4, 4) \
+ _BOOST_mingw_test(4, 3) \
+ _BOOST_gcc_test(4, 3) \
+ _BOOST_mingw_test(4, 2) \
+ _BOOST_gcc_test(4, 2) \
+ _BOOST_mingw_test(4, 1) \
+ _BOOST_gcc_test(4, 1) \
+ _BOOST_mingw_test(4, 0) \
+ _BOOST_gcc_test(4, 0) \
+ "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \
+ && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw" \
+ _BOOST_gcc_test(3, 4) \
+ _BOOST_gcc_test(3, 3) \
+ "defined _MSC_VER && _MSC_VER >= 1500 @ vc90" \
+ "defined _MSC_VER && _MSC_VER == 1400 @ vc80" \
+ _BOOST_gcc_test(3, 2) \
+ "defined _MSC_VER && _MSC_VER == 1310 @ vc71" \
+ _BOOST_gcc_test(3, 1) \
+ _BOOST_gcc_test(3, 0) \
+ "defined __BORLANDC__ @ bcb" \
+ "defined __ICC && (defined __unix || defined __unix__) @ il" \
+ "defined __ICL @ iw" \
+ "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \
+ _BOOST_gcc_test(2, 95) \
+ "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \
+ "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \
+ "defined _MSC_VER && _MSC_VER < 1300 && defined UNDER_CE @ evc4" \
+ "defined __MWERKS__ && __MWERKS__ <= 0x31FF @ cw8"
+ do
+ boost_tag_test=`expr "X$i" : 'X\([[^@]]*\) @ '`
+ boost_tag=`expr "X$i" : 'X[[^@]]* @ \(.*\)'`
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if $boost_tag_test
+/* OK */
+#else
+# error $boost_tag_test
+#endif
+]])], [boost_cv_lib_tag=$boost_tag; break], [])
+ done
+AC_LANG_POP([C++])dnl
+ case $boost_cv_lib_tag in #(
+ # Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed
+ # to "gcc41" for instance.
+ *-gcc | *'-gcc ') :;; #( Don't re-add -gcc: it's already in there.
+ gcc*)
+ boost_tag_x=
+ case $host_os in #(
+ darwin*)
+ if test $boost_major_version -ge 136; then
+ # The `x' added in r46793 of Boost.
+ boost_tag_x=x
+ fi;;
+ esac
+ # We can specify multiple tags in this variable because it's used by
+ # BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ...
+ boost_cv_lib_tag="$boost_tag_x$boost_cv_lib_tag -${boost_tag_x}gcc"
+ ;; #(
+ unknown)
+ AC_MSG_WARN([[could not figure out which toolset name to use for $CXX]])
+ boost_cv_lib_tag=
+ ;;
+ esac
+fi])dnl end of AC_CACHE_CHECK
+])# _BOOST_FIND_COMPILER_TAG
+
+
+# _BOOST_GUESS_WHETHER_TO_USE_MT()
+# --------------------------------
+# Compile a small test to try to guess whether we should favor MT (Multi
+# Thread) flavors of Boost. Sets boost_guess_use_mt accordingly.
+AC_DEFUN([_BOOST_GUESS_WHETHER_TO_USE_MT],
+[# Check whether we do better use `mt' even though we weren't ask to.
+AC_LANG_PUSH([C++])dnl
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if defined _REENTRANT || defined _MT || defined __MT__
+/* use -mt */
+#else
+# error MT not needed
+#endif
+]])], [boost_guess_use_mt=:], [boost_guess_use_mt=false])
+AC_LANG_POP([C++])dnl
+])
+
+# _BOOST_AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+# -------------------------------------------------------------------
+# Fork of _AC_LINK_IFELSE that preserves conftest.o across calls. Fragile,
+# will break when Autoconf changes its internals. Requires that you manually
+# rm -f conftest.$ac_objext in between to really different tests, otherwise
+# you will try to link a conftest.o left behind by a previous test.
+# Used to aggressively optimize BOOST_FIND_LIB (see the big comment in this
+# macro).
+#
+# Don't use "break" in the actions, as it would short-circuit some code
+# this macro runs after the actions.
+m4_define([_BOOST_AC_LINK_IFELSE],
+[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
+rm -f conftest$ac_exeext
+boost_save_ac_ext=$ac_ext
+boost_use_source=:
+# If we already have a .o, re-use it. We change $ac_ext so that $ac_link
+# tries to link the existing object file instead of compiling from source.
+test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false &&
+ _AS_ECHO_LOG([re-using the existing conftest.$ac_objext])
+AS_IF([_AC_DO_STDERR($ac_link) && {
+ test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_executable_p conftest$ac_exeext
+dnl FIXME: use AS_TEST_X instead when 2.61 is widespread enough.
+ }],
+ [$2],
+ [if $boost_use_source; then
+ _AC_MSG_LOG_CONFTEST
+ fi
+ $3])
+ac_objext=$boost_save_ac_objext
+ac_ext=$boost_save_ac_ext
+dnl Delete also the IPA/IPO (Inter Procedural Analysis/Optimization)
+dnl information created by the PGI compiler (conftest_ipa8_conftest.oo),
+dnl as it would interfere with the next link command.
+rm -f core conftest.err conftest_ipa8_conftest.oo \
+ conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl
+])# _BOOST_AC_LINK_IFELSE
+
+# Local Variables:
+# mode: autoconf
+# End:
diff --git a/org.eclipse.efm.symbex/cmake/cvc4-1.4-patch/config/boost.m4.txt b/org.eclipse.efm.symbex/cmake/cvc4-1.4-patch/config/boost.m4.txt
new file mode 100644
index 0000000..27d063f
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/cvc4-1.4-patch/config/boost.m4.txt
@@ -0,0 +1,1560 @@
+# boost.m4: Locate Boost headers and libraries for autoconf-based projects.
+# Copyright (C) 2007-2011, 2014 Benoit Sigoure <tsuna@lrde.epita.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Additional permission under section 7 of the GNU General Public
+# License, version 3 ("GPLv3"):
+#
+# If you convey this file as part of a work that contains a
+# configuration script generated by Autoconf, you may do so under
+# terms of your choice.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+m4_define([_BOOST_SERIAL], [m4_translit([
+# serial 25
+], [#
+], [])])
+
+# Original sources can be found at http://github.com/tsuna/boost.m4
+# You can fetch the latest version of the script by doing:
+# wget http://github.com/tsuna/boost.m4/raw/master/build-aux/boost.m4
+
+# ------ #
+# README #
+# ------ #
+
+# This file provides several macros to use the various Boost libraries.
+# The first macro is BOOST_REQUIRE. It will simply check if it's possible to
+# find the Boost headers of a given (optional) minimum version and it will
+# define BOOST_CPPFLAGS accordingly. It will add an option --with-boost to
+# your configure so that users can specify non standard locations.
+# If the user's environment contains BOOST_ROOT and --with-boost was not
+# specified, --with-boost=$BOOST_ROOT is implicitly used.
+# For more README and documentation, go to http://github.com/tsuna/boost.m4
+# Note: THESE MACROS ASSUME THAT YOU USE LIBTOOL. If you don't, don't worry,
+# simply read the README, it will show you what to do step by step.
+
+m4_pattern_forbid([^_?(BOOST|Boost)_])
+
+
+# _BOOST_SED_CPP(SED-PROGRAM, PROGRAM,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# --------------------------------------------------------
+# Same as AC_EGREP_CPP, but leave the result in conftest.i.
+#
+# SED-PROGRAM is *not* overquoted, as in AC_EGREP_CPP. It is expanded
+# in double-quotes, so escape your double quotes.
+#
+# It could be useful to turn this into a macro which extracts the
+# value of any macro.
+m4_define([_BOOST_SED_CPP],
+[AC_LANG_PUSH([C++])dnl
+AC_LANG_PREPROC_REQUIRE()dnl
+AC_REQUIRE([AC_PROG_SED])dnl
+AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])])
+AS_IF([dnl eval is necessary to expand ac_cpp.
+dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
+dnl Beware of Windows end-of-lines, for instance if we are running
+dnl some Windows programs under Wine. In that case, boost/version.hpp
+dnl is certainly using "\r\n", but the regular Unix shell will only
+dnl strip `\n' with backquotes, not the `\r'. This results in
+dnl boost_cv_lib_version='1_37\r' for instance, which breaks
+dnl everything else.
+dnl Cannot use 'dnl' after [$4] because a trailing dnl may break AC_CACHE_CHECK
+dnl
+dnl Beware that GCC 5, when expanding macros, may embed # line directives
+dnl a within single line:
+dnl
+dnl # 1 "conftest.cc"
+dnl # 1 "<built-in>"
+dnl # 1 "<command-line>"
+dnl # 1 "conftest.cc"
+dnl # 1 "/opt/local/include/boost/version.hpp" 1 3
+dnl # 2 "conftest.cc" 2
+dnl boost-lib-version =
+dnl # 2 "conftest.cc" 3
+dnl "1_56"
+dnl
+dnl So get rid of the # lines, and glue the remaining ones together.
+(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+ grep -v '#' |
+ tr -d '\r' |
+ tr -s '\n' ' ' |
+ $SED -n -e "$1" >conftest.i 2>&1],
+ [$3],
+ [$4])
+rm -rf conftest*
+AC_LANG_POP([C++])dnl
+])# _BOOST_SED_CPP
+
+
+
+# BOOST_REQUIRE([VERSION], [ACTION-IF-NOT-FOUND])
+# -----------------------------------------------
+# Look for Boost. If version is given, it must either be a literal of the form
+# "X.Y.Z" where X, Y and Z are integers (the ".Z" part being optional) or a
+# variable "$var".
+# Defines the value BOOST_CPPFLAGS. This macro only checks for headers with
+# the required version, it does not check for any of the Boost libraries.
+# On # success, defines HAVE_BOOST. On failure, calls the optional
+# ACTION-IF-NOT-FOUND action if one was supplied.
+# Otherwise aborts with an error message.
+AC_DEFUN_ONCE([BOOST_REQUIRE],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_PROG_GREP])dnl
+echo "$as_me: this is boost.m4[]_BOOST_SERIAL" >&AS_MESSAGE_LOG_FD
+boost_save_IFS=$IFS
+boost_version_req=$1
+IFS=.
+set x $boost_version_req 0 0 0
+IFS=$boost_save_IFS
+shift
+boost_version_req=`expr "$[1]" '*' 100000 + "$[2]" '*' 100 + "$[3]"`
+boost_version_req_string=$[1].$[2].$[3]
+AC_ARG_WITH([boost],
+ [AS_HELP_STRING([--with-boost=DIR],
+ [prefix of Boost $1 @<:@guess@:>@])])dnl
+AC_ARG_VAR([BOOST_ROOT],[Location of Boost installation])dnl
+# If BOOST_ROOT is set and the user has not provided a value to
+# --with-boost, then treat BOOST_ROOT as if it the user supplied it.
+if test x"$BOOST_ROOT" != x; then
+ if test x"$with_boost" = x; then
+ AC_MSG_NOTICE([Detected BOOST_ROOT; continuing with --with-boost=$BOOST_ROOT])
+ with_boost=$BOOST_ROOT
+ else
+ AC_MSG_NOTICE([Detected BOOST_ROOT=$BOOST_ROOT, but overridden by --with-boost=$with_boost])
+ fi
+fi
+AC_SUBST([DISTCHECK_CONFIGURE_FLAGS],
+ ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"])dnl
+boost_save_CPPFLAGS=$CPPFLAGS
+ AC_CACHE_CHECK([for Boost headers version >= $boost_version_req_string],
+ [boost_cv_inc_path],
+ [boost_cv_inc_path=no
+AC_LANG_PUSH([C++])dnl
+m4_pattern_allow([^BOOST_VERSION$])dnl
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#include <boost/version.hpp>
+#if !defined BOOST_VERSION
+# error BOOST_VERSION is not defined
+#elif BOOST_VERSION < $boost_version_req
+# error Boost headers version < $boost_version_req
+#endif
+]])])
+ # If the user provided a value to --with-boost, use it and only it.
+ case $with_boost in #(
+ ''|yes) set x '' /opt/local/include /usr/local/include /opt/include \
+ /usr/include C:/Boost/include;; #(
+ *) set x "$with_boost/include" "$with_boost";;
+ esac
+ shift
+ for boost_dir
+ do
+ # Without --layout=system, Boost (or at least some versions) installs
+ # itself in <prefix>/include/boost-<version>. This inner loop helps to
+ # find headers in such directories.
+ #
+ # Any ${boost_dir}/boost-x_xx directories are searched in reverse version
+ # order followed by ${boost_dir}. The final '.' is a sentinel for
+ # searching $boost_dir" itself. Entries are whitespace separated.
+ #
+ # I didn't indent this loop on purpose (to avoid over-indented code)
+ boost_layout_system_search_list=`cd "$boost_dir" 2>/dev/null \
+ && ls -1 | "${GREP}" '^boost-' | sort -rn -t- -k2 \
+ && echo .`
+ for boost_inc in $boost_layout_system_search_list
+ do
+ if test x"$boost_inc" != x.; then
+ boost_inc="$boost_dir/$boost_inc"
+ else
+ boost_inc="$boost_dir" # Uses sentinel in boost_layout_system_search_list
+ fi
+ if test x"$boost_inc" != x; then
+ # We are going to check whether the version of Boost installed
+ # in $boost_inc is usable by running a compilation that
+ # #includes it. But if we pass a -I/some/path in which Boost
+ # is not installed, the compiler will just skip this -I and
+ # use other locations (either from CPPFLAGS, or from its list
+ # of system include directories). As a result we would use
+ # header installed on the machine instead of the /some/path
+ # specified by the user. So in that precise case (trying
+ # $boost_inc), make sure the version.hpp exists.
+ #
+ # Use test -e as there can be symlinks.
+ test -e "$boost_inc/boost/version.hpp" || continue
+ CPPFLAGS="$CPPFLAGS -I$boost_inc"
+ fi
+ AC_COMPILE_IFELSE([], [boost_cv_inc_path=yes], [boost_cv_version=no])
+ if test x"$boost_cv_inc_path" = xyes; then
+ if test x"$boost_inc" != x; then
+ boost_cv_inc_path=$boost_inc
+ fi
+ break 2
+ fi
+ done
+ done
+AC_LANG_POP([C++])dnl
+ ])
+ case $boost_cv_inc_path in #(
+ no)
+ boost_errmsg="cannot find Boost headers version >= $boost_version_req_string"
+ m4_if([$2], [], [AC_MSG_ERROR([$boost_errmsg])],
+ [AC_MSG_NOTICE([$boost_errmsg])])
+ $2
+ ;;#(
+ yes)
+ BOOST_CPPFLAGS=
+ ;;#(
+ *)
+ AC_SUBST([BOOST_CPPFLAGS], ["-I$boost_cv_inc_path"])dnl
+ ;;
+ esac
+ if test x"$boost_cv_inc_path" != xno; then
+ AC_DEFINE([HAVE_BOOST], [1],
+ [Defined if the requested minimum BOOST version is satisfied])
+ AC_CACHE_CHECK([for Boost's header version],
+ [boost_cv_lib_version],
+ [m4_pattern_allow([^BOOST_LIB_VERSION$])dnl
+ _BOOST_SED_CPP([[/^boost-lib-version = /{s///;s/[\" ]//g;p;q;}]],
+ [#include <boost/version.hpp>
+boost-lib-version = BOOST_LIB_VERSION],
+ [boost_cv_lib_version=`cat conftest.i`])])
+ # e.g. "134" for 1_34_1 or "135" for 1_35
+ boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'`
+ case $boost_major_version in #(
+ '' | *[[!0-9]]*)
+ AC_MSG_ERROR([invalid value: boost_major_version='$boost_major_version'])
+ ;;
+ esac
+fi
+CPPFLAGS=$boost_save_CPPFLAGS
+])# BOOST_REQUIRE
+
+
+# BOOST_STATIC()
+# --------------
+# Add the "--enable-static-boost" configure argument. If this argument is given
+# on the command line, static versions of the libraries will be looked up.
+AC_DEFUN([BOOST_STATIC],
+ [AC_ARG_ENABLE([static-boost],
+ [AS_HELP_STRING([--enable-static-boost],
+ [Prefer the static boost libraries over the shared ones [no]])],
+ [enable_static_boost=yes],
+ [enable_static_boost=no])])# BOOST_STATIC
+
+
+# BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND])
+# --------------------------------------------------------------------------
+# Wrapper around AC_CHECK_HEADER for Boost headers. Useful to check for
+# some parts of the Boost library which are only made of headers and don't
+# require linking (such as Boost.Foreach).
+#
+# Default ACTION-IF-NOT-FOUND: Fail with a fatal error unless Boost couldn't be
+# found in the first place, in which case by default a notice is issued to the
+# user. Presumably if we haven't died already it's because it's OK to not have
+# Boost, which is why only a notice is issued instead of a hard error.
+#
+# Default ACTION-IF-FOUND: define the preprocessor symbol HAVE_<HEADER-NAME> in
+# case of success # (where HEADER-NAME is written LIKE_THIS, e.g.,
+# HAVE_BOOST_FOREACH_HPP).
+AC_DEFUN([BOOST_FIND_HEADER],
+[AC_REQUIRE([BOOST_REQUIRE])dnl
+if test x"$boost_cv_inc_path" = xno; then
+ m4_default([$2], [AC_MSG_NOTICE([Boost not available, not searching for $1])])
+else
+AC_LANG_PUSH([C++])dnl
+boost_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+AC_CHECK_HEADER([$1],
+ [m4_default([$3], [AC_DEFINE(AS_TR_CPP([HAVE_$1]), [1],
+ [Define to 1 if you have <$1>])])],
+ [m4_default([$2], [AC_MSG_ERROR([cannot find $1])])])
+CPPFLAGS=$boost_save_CPPFLAGS
+AC_LANG_POP([C++])dnl
+fi
+])# BOOST_FIND_HEADER
+
+
+# BOOST_FIND_LIBS([COMPONENT-NAME], [CANDIDATE-LIB-NAMES],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Look for the Boost library COMPONENT-NAME (e.g., `thread', for
+# libboost_thread) under the possible CANDIDATE-LIB-NAMES (e.g.,
+# "thread_win32 thread"). Check that HEADER-NAME works and check that
+# libboost_LIB-NAME can link with the code CXX-TEST. The optional
+# argument CXX-PROLOGUE can be used to include some C++ code before
+# the `main' function.
+#
+# Invokes BOOST_FIND_HEADER([HEADER-NAME]) (see above).
+#
+# Boost libraries typically come compiled with several flavors (with different
+# runtime options) so PREFERRED-RT-OPT is the preferred suffix. A suffix is one
+# or more of the following letters: sgdpn (in that order). s = static
+# runtime, d = debug build, g = debug/diagnostic runtime, p = STLPort build,
+# n = (unsure) STLPort build without iostreams from STLPort (it looks like `n'
+# must always be used along with `p'). Additionally, PREFERRED-RT-OPT can
+# start with `mt-' to indicate that there is a preference for multi-thread
+# builds. Some sample values for PREFERRED-RT-OPT: (nothing), mt, d, mt-d, gdp
+# ... If you want to make sure you have a specific version of Boost
+# (eg, >= 1.33) you *must* invoke BOOST_REQUIRE before this macro.
+AC_DEFUN([BOOST_FIND_LIBS],
+[AC_REQUIRE([BOOST_REQUIRE])dnl
+AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl
+AC_REQUIRE([BOOST_STATIC])dnl
+AC_REQUIRE([_BOOST_GUESS_WHETHER_TO_USE_MT])dnl
+if test x"$boost_cv_inc_path" = xno; then
+ AC_MSG_NOTICE([Boost not available, not searching for the Boost $1 library])
+else
+dnl The else branch is huge and wasn't intended on purpose.
+AC_LANG_PUSH([C++])dnl
+AS_VAR_PUSHDEF([Boost_lib], [boost_cv_lib_$1])dnl
+AS_VAR_PUSHDEF([Boost_lib_LDFLAGS], [boost_cv_lib_$1_LDFLAGS])dnl
+AS_VAR_PUSHDEF([Boost_lib_LDPATH], [boost_cv_lib_$1_LDPATH])dnl
+AS_VAR_PUSHDEF([Boost_lib_LIBS], [boost_cv_lib_$1_LIBS])dnl
+BOOST_FIND_HEADER([$4])
+boost_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib],
+ [_BOOST_FIND_LIBS($@)])
+case $Boost_lib in #(
+ (no) _AC_MSG_LOG_CONFTEST
+ AC_MSG_ERROR([cannot find the flags to link with Boost $1])
+ ;;
+esac
+AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS])dnl
+AC_SUBST(AS_TR_CPP([BOOST_$1_LDPATH]), [$Boost_lib_LDPATH])dnl
+AC_SUBST([BOOST_LDPATH], [$Boost_lib_LDPATH])dnl
+AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS])dnl
+CPPFLAGS=$boost_save_CPPFLAGS
+AS_VAR_POPDEF([Boost_lib])dnl
+AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl
+AS_VAR_POPDEF([Boost_lib_LDPATH])dnl
+AS_VAR_POPDEF([Boost_lib_LIBS])dnl
+AC_LANG_POP([C++])dnl
+fi
+])
+
+
+# BOOST_FIND_LIB([LIB-NAME],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Backward compatibility wrapper for BOOST_FIND_LIBS.
+AC_DEFUN([BOOST_FIND_LIB],
+[BOOST_FIND_LIBS([$1], $@)])
+
+
+# _BOOST_FIND_LIBS([LIB-NAME], [CANDIDATE-LIB-NAMES],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Real implementation of BOOST_FIND_LIBS: rely on these local macros:
+# Boost_lib, Boost_lib_LDFLAGS, Boost_lib_LDPATH, Boost_lib_LIBS
+#
+# The algorithm is as follows: first look for a given library name
+# according to the user's PREFERRED-RT-OPT. For each library name, we
+# prefer to use the ones that carry the tag (toolset name). Each
+# library is searched through the various standard paths were Boost is
+# usually installed. If we can't find the standard variants, we try
+# to enforce -mt (for instance on MacOSX, libboost_thread.dylib
+# doesn't exist but there's -obviously- libboost_thread-mt.dylib).
+AC_DEFUN([_BOOST_FIND_LIBS],
+[Boost_lib=no
+ case "$3" in #(
+ (mt | mt-) boost_mt=-mt; boost_rtopt=;; #(
+ (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$3" : 'Xmt-*\(.*\)'`;; #(
+ (*) boost_mt=; boost_rtopt=$3;;
+ esac
+ if test $enable_static_boost = yes; then
+ boost_rtopt="s$boost_rtopt"
+ fi
+ # Find the proper debug variant depending on what we've been asked to find.
+ case $boost_rtopt in #(
+ (*d*) boost_rt_d=$boost_rtopt;; #(
+ (*[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn')
+ boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #(
+ (*) boost_rt_d='-d';;
+ esac
+ # If the PREFERRED-RT-OPT are not empty, prepend a `-'.
+ test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt"
+ $boost_guess_use_mt && boost_mt=-mt
+ # Look for the abs path the static archive.
+ # $libext is computed by Libtool but let's make sure it's non empty.
+ test -z "$libext" &&
+ AC_MSG_ERROR([the libext variable is empty, did you invoke Libtool?])
+ boost_save_ac_objext=$ac_objext
+ # Generate the test file.
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$4>
+$6], [$5])])
+dnl Optimization hacks: compiling C++ is slow, especially with Boost. What
+dnl we're trying to do here is guess the right combination of link flags
+dnl (LIBS / LDFLAGS) to use a given library. This can take several
+dnl iterations before it succeeds and is thus *very* slow. So what we do
+dnl instead is that we compile the code first (and thus get an object file,
+dnl typically conftest.o). Then we try various combinations of link flags
+dnl until we succeed to link conftest.o in an executable. The problem is
+dnl that the various TRY_LINK / COMPILE_IFELSE macros of Autoconf always
+dnl remove all the temporary files including conftest.o. So the trick here
+dnl is to temporarily change the value of ac_objext so that conftest.o is
+dnl preserved accross tests. This is obviously fragile and I will burn in
+dnl hell for not respecting Autoconf's documented interfaces, but in the
+dnl mean time, it optimizes the macro by a factor of 5 to 30.
+dnl Another small optimization: the first argument of AC_COMPILE_IFELSE left
+dnl empty because the test file is generated only once above (before we
+dnl start the for loops).
+ AC_COMPILE_IFELSE([],
+ [ac_objext=do_not_rm_me_plz],
+ [AC_MSG_ERROR([cannot compile a test that uses Boost $1])])
+ ac_objext=$boost_save_ac_objext
+ boost_failed_libs=
+# Don't bother to ident the following nested for loops, only the 2
+# innermost ones matter.
+for boost_lib_ in $2; do
+for boost_tag_ in -$boost_cv_lib_tag ''; do
+for boost_ver_ in -$boost_cv_lib_version ''; do
+for boost_mt_ in $boost_mt -mt ''; do
+for boost_rtopt_ in $boost_rtopt '' -d; do
+ for boost_lib in \
+ boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_ver_
+ do
+ # Avoid testing twice the same lib
+ case $boost_failed_libs in #(
+ (*@$boost_lib@*) continue;;
+ esac
+ # If with_boost is empty, we'll search in /lib first, which is not quite
+ # right so instead we'll try to a location based on where the headers are.
+ boost_tmp_lib=$with_boost
+ test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include}
+ for boost_ldpath in "$boost_tmp_lib/lib" '' \
+ /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \
+ "$with_boost" C:/Boost/lib /lib*
+ do
+ # Don't waste time with directories that don't exist.
+ if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then
+ continue
+ fi
+ boost_save_LDFLAGS=$LDFLAGS
+ # Are we looking for a static library?
+ case $boost_ldpath:$boost_rtopt_ in #(
+ (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt)
+ Boost_lib_LIBS="$boost_ldpath/lib$boost_lib.$libext"
+ test -e "$Boost_lib_LIBS" || continue;; #(
+ (*) # No: use -lboost_foo to find the shared library.
+ Boost_lib_LIBS="-l$boost_lib";;
+ esac
+ boost_save_LIBS=$LIBS
+ LIBS="$Boost_lib_LIBS $LIBS"
+ test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath"
+dnl First argument of AC_LINK_IFELSE left empty because the test file is
+dnl generated only once above (before we start the for loops).
+ _BOOST_AC_LINK_IFELSE([],
+ [Boost_lib=yes], [Boost_lib=no])
+ ac_objext=$boost_save_ac_objext
+ LDFLAGS=$boost_save_LDFLAGS
+ LIBS=$boost_save_LIBS
+ if test x"$Boost_lib" = xyes; then
+ # Check or used cached result of whether or not using -R or
+ # -rpath makes sense. Some implementations of ld, such as for
+ # Mac OSX, require -rpath but -R is the flag known to work on
+ # other systems. https://github.com/tsuna/boost.m4/issues/19
+ AC_CACHE_VAL([boost_cv_rpath_link_ldflag],
+ [case $boost_ldpath in
+ '') # Nothing to do.
+ boost_cv_rpath_link_ldflag=
+ boost_rpath_link_ldflag_found=yes;;
+ *)
+ for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do
+ LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
+ LIBS="$boost_save_LIBS $Boost_lib_LIBS"
+ _BOOST_AC_LINK_IFELSE([],
+ [boost_rpath_link_ldflag_found=yes
+ break],
+ [boost_rpath_link_ldflag_found=no])
+ done
+ ;;
+ esac
+ AS_IF([test "x$boost_rpath_link_ldflag_found" != "xyes"],
+ [AC_MSG_ERROR([Unable to determine whether to use -R or -rpath])])
+ LDFLAGS=$boost_save_LDFLAGS
+ LIBS=$boost_save_LIBS
+ ])
+ test x"$boost_ldpath" != x &&
+ Boost_lib_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
+ Boost_lib_LDPATH="$boost_ldpath"
+ break 7
+ else
+ boost_failed_libs="$boost_failed_libs@$boost_lib@"
+ fi
+ done
+ done
+done
+done
+done
+done
+done # boost_lib_
+rm -f conftest.$ac_objext
+])
+
+
+
+# --------------------------------------- #
+# Checks for the various Boost libraries. #
+# --------------------------------------- #
+
+# List of boost libraries: http://www.boost.org/libs/libraries.htm
+# The page http://beta.boost.org/doc/libs is useful: it gives the first release
+# version of each library (among other things).
+
+# BOOST_DEFUN(LIBRARY, CODE)
+# --------------------------
+# Define BOOST_<LIBRARY-UPPERCASE> as a macro that runs CODE.
+#
+# Use indir to avoid the warning on underquoted macro name given to AC_DEFUN.
+m4_define([BOOST_DEFUN],
+[m4_indir([AC_DEFUN],
+ m4_toupper([BOOST_$1]),
+[m4_pushdef([BOOST_Library], [$1])dnl
+$2
+m4_popdef([BOOST_Library])dnl
+])
+])
+
+# BOOST_ARRAY()
+# -------------
+# Look for Boost.Array
+BOOST_DEFUN([Array],
+[BOOST_FIND_HEADER([boost/array.hpp])])
+
+
+# BOOST_ASIO()
+# ------------
+# Look for Boost.Asio (new in Boost 1.35).
+BOOST_DEFUN([Asio],
+[AC_REQUIRE([BOOST_SYSTEM])dnl
+BOOST_FIND_HEADER([boost/asio.hpp])])
+
+
+# BOOST_BIND()
+# ------------
+# Look for Boost.Bind.
+BOOST_DEFUN([Bind],
+[BOOST_FIND_HEADER([boost/bind.hpp])])
+
+
+# BOOST_CHRONO()
+# --------------
+# Look for Boost.Chrono.
+BOOST_DEFUN([Chrono],
+[# Do we have to check for Boost.System? This link-time dependency was
+# added as of 1.35.0. If we have a version <1.35, we must not attempt to
+# find Boost.System as it didn't exist by then.
+if test $boost_major_version -ge 135; then
+ BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+boost_filesystem_save_LIBS=$LIBS
+boost_filesystem_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([chrono], [$1],
+ [boost/chrono.hpp],
+ [boost::chrono::thread_clock d;])
+if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
+ BOOST_CHRONO_LIBS="$BOOST_CHRONO_LIBS $BOOST_SYSTEM_LIBS"
+fi
+LIBS=$boost_filesystem_save_LIBS
+LDFLAGS=$boost_filesystem_save_LDFLAGS
+])# BOOST_CHRONO
+
+
+# BOOST_CONTEXT([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Context. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+#
+# * This library was introduced in Boost 1.51.0
+# * The signatures of make_fcontext() and jump_fcontext were changed in 1.56.0
+# * A dependency on boost_thread appears in 1.57.0
+BOOST_DEFUN([Context],
+[boost_context_save_LIBS=$LIBS
+ boost_context_save_LDFLAGS=$LDFLAGS
+if test $boost_major_version -ge 157; then
+ BOOST_THREAD([$1])
+ m4_pattern_allow([^BOOST_THREAD_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_THREAD_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_THREAD_LDFLAGS"
+fi
+BOOST_FIND_LIB([context], [$1],
+ [boost/context/all.hpp],[[
+
+// creates a stack
+void * stack_pointer = new void*[4096];
+std::size_t const size = sizeof(void*[4096]);
+
+#if BOOST_VERSION <= 105100
+ctx::make_fcontext(&fc, f);
+return ctx::jump_fcontext(&fcm, &fc, 3) == 6;
+
+#else
+
+fc = ctx::make_fcontext(stack_pointer, size, f);
+return ctx::jump_fcontext(&fcm, fc, 3) == 6;
+
+#endif
+
+
+]],[dnl
+
+#include <boost/version.hpp>
+#if BOOST_VERSION <= 105100
+
+namespace ctx = boost::ctx;
+
+static ctx::fcontext_t fcm, fc;
+
+static void f(intptr_t i) {
+ ctx::jump_fcontext(&fc, &fcm, i * 2);
+}
+
+#elif BOOST_VERSION <= 105500
+
+namespace ctx = boost::context;
+
+// context
+static ctx::fcontext_t fcm, *fc;
+
+// context-function
+static void f(intptr_t i) {
+ ctx::jump_fcontext(fc, &fcm, i * 2);
+}
+
+#else
+
+namespace ctx = boost::context;
+
+// context
+static ctx::fcontext_t fcm, fc;
+
+// context-function
+static void f(intptr_t i) {
+ ctx::jump_fcontext(&fc, fcm, i * 2);
+}
+#endif
+])
+LIBS=$boost_context_save_LIBS
+LDFLAGS=$boost_context_save_LDFLAGS
+])# BOOST_CONTEXT
+
+
+# BOOST_CONVERSION()
+# ------------------
+# Look for Boost.Conversion (cast / lexical_cast)
+BOOST_DEFUN([Conversion],
+[BOOST_FIND_HEADER([boost/cast.hpp])
+BOOST_FIND_HEADER([boost/lexical_cast.hpp])
+])# BOOST_CONVERSION
+
+
+# BOOST_COROUTINE([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Coroutine. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. This library was introduced in Boost
+# 1.53.0
+BOOST_DEFUN([Coroutine],
+[
+boost_coroutine_save_LIBS=$LIBS
+boost_coroutine_save_LDFLAGS=$LDFLAGS
+# Link-time dependency from coroutine to context
+BOOST_CONTEXT([$1])
+# Starting from Boost 1.55 a dependency on Boost.System is added
+if test $boost_major_version -ge 155; then
+ BOOST_SYSTEM([$1])
+fi
+m4_pattern_allow([^BOOST_(CONTEXT|SYSTEM)_(LIBS|LDFLAGS)])
+LIBS="$LIBS $BOOST_CONTEXT_LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_CONTEXT_LDFLAGS"
+
+# in 1.53 coroutine was a header only library
+if test $boost_major_version -eq 153; then
+ BOOST_FIND_HEADER([boost/coroutine/coroutine.hpp])
+else
+ BOOST_FIND_LIB([coroutine], [$1],
+ [boost/coroutine/coroutine.hpp],
+ [
+ #include <boost/version.hpp>
+ #if BOOST_VERSION <= 105500
+ boost::coroutines::coroutine<int(int)> coro; coro.get();
+ #else
+ boost::coroutines::asymmetric_coroutine<int>::pull_type coro; coro.get();
+ #endif
+ ])
+fi
+# Link-time dependency from coroutine to context, existed only in 1.53, in 1.54
+# coroutine doesn't use context from its headers but from its library.
+if test $boost_major_version -eq 153 || test $enable_static_boost = yes && test $boost_major_version -ge 154; then
+ BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_CONTEXT_LIBS"
+ BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_CONTEXT_LDFLAGS"
+fi
+if test $enable_static_boost = yes && test $boost_major_version -ge 155; then
+ BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_SYSTEM_LIBS"
+ BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+fi
+LIBS=$boost_coroutine_save_LIBS
+LDFLAGS=$boost_coroutine_save_LDFLAGS
+])# BOOST_COROUTINE
+
+
+# BOOST_CRC()
+# -----------
+# Look for Boost.CRC
+BOOST_DEFUN([CRC],
+[BOOST_FIND_HEADER([boost/crc.hpp])
+])# BOOST_CRC
+
+
+# BOOST_DATE_TIME([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Date_Time. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Date_Time],
+[BOOST_FIND_LIB([date_time], [$1],
+ [boost/date_time/posix_time/posix_time.hpp],
+ [boost::posix_time::ptime t;])
+])# BOOST_DATE_TIME
+
+
+# BOOST_FILESYSTEM([PREFERRED-RT-OPT])
+# ------------------------------------
+# Look for Boost.Filesystem. For the documentation of PREFERRED-RT-OPT, see
+# the documentation of BOOST_FIND_LIB above.
+# Do not check for boost/filesystem.hpp because this file was introduced in
+# 1.34.
+BOOST_DEFUN([Filesystem],
+[# Do we have to check for Boost.System? This link-time dependency was
+# added as of 1.35.0. If we have a version <1.35, we must not attempt to
+# find Boost.System as it didn't exist by then.
+if test $boost_major_version -ge 135; then
+ BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+boost_filesystem_save_LIBS=$LIBS
+boost_filesystem_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([filesystem], [$1],
+ [boost/filesystem/path.hpp], [boost::filesystem::path p;])
+if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
+ BOOST_FILESYSTEM_LIBS="$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"
+fi
+LIBS=$boost_filesystem_save_LIBS
+LDFLAGS=$boost_filesystem_save_LDFLAGS
+])# BOOST_FILESYSTEM
+
+
+# BOOST_FLYWEIGHT()
+# -----------------
+# Look for Boost.Flyweight.
+BOOST_DEFUN([Flyweight],
+[dnl There's a hidden dependency on pthreads.
+AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
+BOOST_FIND_HEADER([boost/flyweight.hpp])
+AC_SUBST([BOOST_FLYWEIGHT_LIBS], [$boost_cv_pthread_flag])
+])
+
+
+# BOOST_FOREACH()
+# ---------------
+# Look for Boost.Foreach.
+BOOST_DEFUN([Foreach],
+[BOOST_FIND_HEADER([boost/foreach.hpp])])
+
+
+# BOOST_FORMAT()
+# --------------
+# Look for Boost.Format.
+# Note: we can't check for boost/format/format_fwd.hpp because the header isn't
+# standalone. It can't be compiled because it triggers the following error:
+# boost/format/detail/config_macros.hpp:88: error: 'locale' in namespace 'std'
+# does not name a type
+BOOST_DEFUN([Format],
+[BOOST_FIND_HEADER([boost/format.hpp])])
+
+
+# BOOST_FUNCTION()
+# ----------------
+# Look for Boost.Function
+BOOST_DEFUN([Function],
+[BOOST_FIND_HEADER([boost/function.hpp])])
+
+
+# BOOST_GEOMETRY()
+# ----------------
+# Look for Boost.Geometry (new since 1.47.0).
+BOOST_DEFUN([Geometry],
+[BOOST_FIND_HEADER([boost/geometry.hpp])
+])# BOOST_GEOMETRY
+
+
+# BOOST_GRAPH([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost.Graphs. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Graph],
+[boost_graph_save_LIBS=$LIBS
+boost_graph_save_LDFLAGS=$LDFLAGS
+# Link-time dependency from graph to regex was added as of 1.40.0.
+if test $boost_major_version -ge 140; then
+ BOOST_REGEX([$1])
+ m4_pattern_allow([^BOOST_REGEX_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_REGEX_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_REGEX_LDFLAGS"
+fi
+BOOST_FIND_LIB([graph], [$1],
+ [boost/graph/adjacency_list.hpp], [boost::adjacency_list<> g;])
+LIBS=$boost_graph_save_LIBS
+LDFLAGS=$boost_graph_save_LDFLAGS
+])# BOOST_GRAPH
+
+
+# BOOST_IOSTREAMS([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.IOStreams. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([IOStreams],
+[BOOST_FIND_LIB([iostreams], [$1],
+ [boost/iostreams/device/file_descriptor.hpp],
+ [boost::iostreams::file_descriptor fd; fd.close();])
+])# BOOST_IOSTREAMS
+
+
+# BOOST_HASH()
+# ------------
+# Look for Boost.Functional/Hash
+BOOST_DEFUN([Hash],
+[BOOST_FIND_HEADER([boost/functional/hash.hpp])])
+
+
+# BOOST_LAMBDA()
+# --------------
+# Look for Boost.Lambda
+BOOST_DEFUN([Lambda],
+[BOOST_FIND_HEADER([boost/lambda/lambda.hpp])])
+
+
+# BOOST_LOCALE()
+# --------------
+# Look for Boost.Locale
+BOOST_DEFUN([Locale],
+[
+boost_locale_save_LIBS=$LIBS
+boost_locale_save_LDFLAGS=$LDFLAGS
+# require SYSTEM for boost-1.50.0 and up
+if test $boost_major_version -ge 150; then
+ BOOST_SYSTEM([$1])
+ m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+fi # end of the Boost.System check.
+BOOST_FIND_LIB([locale], [$1],
+ [boost/locale.hpp],
+ [[boost::locale::generator gen; std::locale::global(gen(""));]])
+LIBS=$boost_locale_save_LIBS
+LDFLAGS=$boost_locale_save_LDFLAGS
+])# BOOST_LOCALE
+
+# BOOST_LOG([PREFERRED-RT-OPT])
+# -----------------------------
+# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Log],
+[boost_log_save_LIBS=$LIBS
+boost_log_save_LDFLAGS=$LDFLAGS
+BOOST_SYSTEM([$1])
+BOOST_FILESYSTEM([$1])
+BOOST_DATE_TIME([$1])
+m4_pattern_allow([^BOOST_(SYSTEM|FILESYSTEM|DATE_TIME)_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_DATE_TIME_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_DATE_TIME_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([log], [$1],
+ [boost/log/core/core.hpp],
+ [boost::log::attribute a; a.get_value();])
+LIBS=$boost_log_save_LIBS
+LDFLAGS=$boost_log_save_LDFLAGS
+])# BOOST_LOG
+
+
+# BOOST_LOG_SETUP([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Log_Setup],
+[boost_log_setup_save_LIBS=$LIBS
+boost_log_setup_save_LDFLAGS=$LDFLAGS
+BOOST_LOG([$1])
+m4_pattern_allow([^BOOST_LOG_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_LOG_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_LOG_LDFLAGS"
+BOOST_FIND_LIB([log_setup], [$1],
+ [boost/log/utility/setup/from_settings.hpp],
+ [boost::log::basic_settings<char> bs; bs.empty();])
+LIBS=$boost_log_setup_save_LIBS
+LDFLAGS=$boost_log_setup_save_LDFLAGS
+])# BOOST_LOG_SETUP
+
+
+# BOOST_MATH()
+# ------------
+# Look for Boost.Math
+# TODO: This library isn't header-only but it comes in multiple different
+# flavors that don't play well with BOOST_FIND_LIB (e.g, libboost_math_c99,
+# libboost_math_c99f, libboost_math_c99l, libboost_math_tr1,
+# libboost_math_tr1f, libboost_math_tr1l). This macro must be fixed to do the
+# right thing anyway.
+BOOST_DEFUN([Math],
+[BOOST_FIND_HEADER([boost/math/special_functions.hpp])])
+
+
+# BOOST_MPI([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost MPI. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. Uses MPICXX variable if it is
+# set, otherwise tries CXX
+#
+BOOST_DEFUN([MPI],
+[boost_save_CXX=${CXX}
+boost_save_CXXCPP=${CXXCPP}
+if test x"${MPICXX}" != x; then
+ CXX=${MPICXX}
+ CXXCPP="${MPICXX} -E"
+fi
+BOOST_FIND_LIB([mpi], [$1],
+ [boost/mpi.hpp],
+ [int argc = 0;
+ char **argv = 0;
+ boost::mpi::environment env(argc,argv);])
+CXX=${boost_save_CXX}
+CXXCPP=${boost_save_CXXCPP}
+])# BOOST_MPI
+
+
+# BOOST_MULTIARRAY()
+# ------------------
+# Look for Boost.MultiArray
+BOOST_DEFUN([MultiArray],
+[BOOST_FIND_HEADER([boost/multi_array.hpp])])
+
+
+# BOOST_NUMERIC_UBLAS()
+# --------------------------
+# Look for Boost.NumericUblas (Basic Linear Algebra)
+BOOST_DEFUN([Numeric_Ublas],
+[BOOST_FIND_HEADER([boost/numeric/ublas/vector.hpp])
+])# BOOST_NUMERIC_UBLAS
+
+
+# BOOST_NUMERIC_CONVERSION()
+# --------------------------
+# Look for Boost.NumericConversion (policy-based numeric conversion)
+BOOST_DEFUN([Numeric_Conversion],
+[BOOST_FIND_HEADER([boost/numeric/conversion/converter.hpp])
+])# BOOST_NUMERIC_CONVERSION
+
+
+# BOOST_OPTIONAL()
+# ----------------
+# Look for Boost.Optional
+BOOST_DEFUN([Optional],
+[BOOST_FIND_HEADER([boost/optional.hpp])])
+
+
+# BOOST_PREPROCESSOR()
+# --------------------
+# Look for Boost.Preprocessor
+BOOST_DEFUN([Preprocessor],
+[BOOST_FIND_HEADER([boost/preprocessor/repeat.hpp])])
+
+
+# BOOST_RANGE()
+# --------------------
+# Look for Boost.Range
+BOOST_DEFUN([Range],
+[BOOST_FIND_HEADER([boost/range/adaptors.hpp])])
+
+# BOOST_UNORDERED()
+# -----------------
+# Look for Boost.Unordered
+BOOST_DEFUN([Unordered],
+[BOOST_FIND_HEADER([boost/unordered_map.hpp])])
+
+
+# BOOST_UUID()
+# ------------
+# Look for Boost.Uuid
+BOOST_DEFUN([Uuid],
+[BOOST_FIND_HEADER([boost/uuid/uuid.hpp])])
+
+
+# BOOST_PROGRAM_OPTIONS([PREFERRED-RT-OPT])
+# -----------------------------------------
+# Look for Boost.Program_options. For the documentation of PREFERRED-RT-OPT,
+# see the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Program_Options],
+[BOOST_FIND_LIB([program_options], [$1],
+ [boost/program_options.hpp],
+ [boost::program_options::options_description d("test");])
+])# BOOST_PROGRAM_OPTIONS
+
+
+
+# _BOOST_PYTHON_CONFIG(VARIABLE, FLAG)
+# ------------------------------------
+# Save VARIABLE, and define it via `python-config --FLAG`.
+# Substitute BOOST_PYTHON_VARIABLE.
+m4_define([_BOOST_PYTHON_CONFIG],
+[AC_SUBST([BOOST_PYTHON_$1],
+ [`python-config --$2 2>/dev/null`])dnl
+boost_python_save_$1=$$1
+$1="$$1 $BOOST_PYTHON_$1"])
+
+
+# BOOST_PYTHON([PREFERRED-RT-OPT])
+# --------------------------------
+# Look for Boost.Python. For the documentation of PREFERRED-RT-OPT,
+# see the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Python],
+[_BOOST_PYTHON_CONFIG([CPPFLAGS], [includes])
+_BOOST_PYTHON_CONFIG([LDFLAGS], [ldflags])
+_BOOST_PYTHON_CONFIG([LIBS], [libs])
+m4_pattern_allow([^BOOST_PYTHON_MODULE$])dnl
+BOOST_FIND_LIBS([python], [python python3], [$1],
+ [boost/python.hpp],
+ [], [BOOST_PYTHON_MODULE(empty) {}])
+CPPFLAGS=$boost_python_save_CPPFLAGS
+LDFLAGS=$boost_python_save_LDFLAGS
+LIBS=$boost_python_save_LIBS
+])# BOOST_PYTHON
+
+
+# BOOST_REF()
+# -----------
+# Look for Boost.Ref
+BOOST_DEFUN([Ref],
+[BOOST_FIND_HEADER([boost/ref.hpp])])
+
+
+# BOOST_REGEX([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost.Regex. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Regex],
+[BOOST_FIND_LIB([regex], [$1],
+ [boost/regex.hpp],
+ [boost::regex exp("*"); boost::regex_match("foo", exp);])
+])# BOOST_REGEX
+
+
+# BOOST_SERIALIZATION([PREFERRED-RT-OPT])
+# ---------------------------------------
+# Look for Boost.Serialization. For the documentation of PREFERRED-RT-OPT, see
+# the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Serialization],
+[BOOST_FIND_LIB([serialization], [$1],
+ [boost/archive/text_oarchive.hpp],
+ [std::ostream* o = 0; // Cheap way to get an ostream...
+ boost::archive::text_oarchive t(*o);])
+])# BOOST_SERIALIZATION
+
+
+# BOOST_SIGNALS([PREFERRED-RT-OPT])
+# ---------------------------------
+# Look for Boost.Signals. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Signals],
+[BOOST_FIND_LIB([signals], [$1],
+ [boost/signal.hpp],
+ [boost::signal<void ()> s;])
+])# BOOST_SIGNALS
+
+
+# BOOST_SIGNALS2()
+# ----------------
+# Look for Boost.Signals2 (new since 1.39.0).
+BOOST_DEFUN([Signals2],
+[BOOST_FIND_HEADER([boost/signals2.hpp])
+])# BOOST_SIGNALS2
+
+
+# BOOST_SMART_PTR()
+# -----------------
+# Look for Boost.SmartPtr
+BOOST_DEFUN([Smart_Ptr],
+[BOOST_FIND_HEADER([boost/scoped_ptr.hpp])
+BOOST_FIND_HEADER([boost/shared_ptr.hpp])
+])
+
+
+# BOOST_STATICASSERT()
+# --------------------
+# Look for Boost.StaticAssert
+BOOST_DEFUN([StaticAssert],
+[BOOST_FIND_HEADER([boost/static_assert.hpp])])
+
+
+# BOOST_STRING_ALGO()
+# -------------------
+# Look for Boost.StringAlgo
+BOOST_DEFUN([String_Algo],
+[BOOST_FIND_HEADER([boost/algorithm/string.hpp])
+])
+
+
+# BOOST_SYSTEM([PREFERRED-RT-OPT])
+# --------------------------------
+# Look for Boost.System. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. This library was introduced in Boost
+# 1.35.0.
+BOOST_DEFUN([System],
+[BOOST_FIND_LIB([system], [$1],
+ [boost/system/error_code.hpp],
+ [boost::system::error_code e; e.clear();])
+])# BOOST_SYSTEM
+
+
+# BOOST_TEST([PREFERRED-RT-OPT])
+# ------------------------------
+# Look for Boost.Test. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Test],
+[m4_pattern_allow([^BOOST_CHECK$])dnl
+BOOST_FIND_LIB([unit_test_framework], [$1],
+ [boost/test/unit_test.hpp], [BOOST_CHECK(2 == 2);],
+ [using boost::unit_test::test_suite;
+ test_suite* init_unit_test_suite(int argc, char ** argv)
+ { return NULL; }])
+])# BOOST_TEST
+
+
+# BOOST_THREAD([PREFERRED-RT-OPT])
+# ---------------------------------
+# Look for Boost.Thread. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Thread],
+[dnl Having the pthread flag is required at least on GCC3 where
+dnl boost/thread.hpp would complain if we try to compile without
+dnl -pthread on GNU/Linux.
+AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
+boost_thread_save_LIBS=$LIBS
+boost_thread_save_LDFLAGS=$LDFLAGS
+boost_thread_save_CPPFLAGS=$CPPFLAGS
+# Link-time dependency from thread to system was added as of 1.49.0.
+if test $boost_major_version -ge 149; then
+BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+CPPFLAGS="$CPPFLAGS $boost_cv_pthread_flag"
+
+# When compiling for the Windows platform, the threads library is named
+# differently. This suffix doesn't exist in new versions of Boost, or
+# possibly new versions of GCC on mingw I am assuming it's Boost's change for
+# now and I am setting version to 1.48, for lack of knowledge as to when this
+# change occurred.
+if test $boost_major_version -lt 148; then
+ case $host_os in
+ (*mingw*) boost_thread_lib_ext=_win32;;
+ esac
+fi
+BOOST_FIND_LIBS([thread], [thread$boost_thread_lib_ext],
+ [$1],
+ [boost/thread.hpp], [boost::thread t; boost::mutex m;])
+
+case $host_os in
+ (*mingw*) boost_thread_w32_socket_link=-lws2_32;;
+esac
+
+BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag $boost_thread_w32_socket_link"
+BOOST_THREAD_LDFLAGS="$BOOST_SYSTEM_LDFLAGS"
+BOOST_CPPFLAGS="$BOOST_CPPFLAGS $boost_cv_pthread_flag"
+LIBS=$boost_thread_save_LIBS
+LDFLAGS=$boost_thread_save_LDFLAGS
+CPPFLAGS=$boost_thread_save_CPPFLAGS
+])# BOOST_THREAD
+
+AU_ALIAS([BOOST_THREADS], [BOOST_THREAD])
+
+
+# BOOST_TOKENIZER()
+# -----------------
+# Look for Boost.Tokenizer
+BOOST_DEFUN([Tokenizer],
+[BOOST_FIND_HEADER([boost/tokenizer.hpp])])
+
+
+# BOOST_TRIBOOL()
+# ---------------
+# Look for Boost.Tribool
+BOOST_DEFUN([Tribool],
+[BOOST_FIND_HEADER([boost/logic/tribool_fwd.hpp])
+BOOST_FIND_HEADER([boost/logic/tribool.hpp])
+])
+
+
+# BOOST_TUPLE()
+# -------------
+# Look for Boost.Tuple
+BOOST_DEFUN([Tuple],
+[BOOST_FIND_HEADER([boost/tuple/tuple.hpp])])
+
+
+# BOOST_TYPETRAITS()
+# --------------------
+# Look for Boost.TypeTraits
+BOOST_DEFUN([TypeTraits],
+[BOOST_FIND_HEADER([boost/type_traits.hpp])])
+
+
+# BOOST_UTILITY()
+# ---------------
+# Look for Boost.Utility (noncopyable, result_of, base-from-member idiom,
+# etc.)
+BOOST_DEFUN([Utility],
+[BOOST_FIND_HEADER([boost/utility.hpp])])
+
+
+# BOOST_VARIANT()
+# ---------------
+# Look for Boost.Variant.
+BOOST_DEFUN([Variant],
+[BOOST_FIND_HEADER([boost/variant/variant_fwd.hpp])
+BOOST_FIND_HEADER([boost/variant.hpp])])
+
+
+# BOOST_POINTER_CONTAINER()
+# ------------------------
+# Look for Boost.PointerContainer
+BOOST_DEFUN([Pointer_Container],
+[BOOST_FIND_HEADER([boost/ptr_container/ptr_deque.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_list.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_vector.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_array.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_set.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_map.hpp])
+])# BOOST_POINTER_CONTAINER
+
+
+# BOOST_WAVE([PREFERRED-RT-OPT])
+# ------------------------------
+# NOTE: If you intend to use Wave/Spirit with thread support, make sure you
+# call BOOST_THREAD first.
+# Look for Boost.Wave. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Wave],
+[AC_REQUIRE([BOOST_FILESYSTEM])dnl
+AC_REQUIRE([BOOST_DATE_TIME])dnl
+boost_wave_save_LIBS=$LIBS
+boost_wave_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_((FILE)?SYSTEM|DATE_TIME|THREAD)_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS \
+$BOOST_THREAD_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS \
+$BOOST_DATE_TIME_LDFLAGS $BOOST_THREAD_LDFLAGS"
+BOOST_FIND_LIB([wave], [$1],
+ [boost/wave.hpp],
+ [boost::wave::token_id id; get_token_name(id);])
+LIBS=$boost_wave_save_LIBS
+LDFLAGS=$boost_wave_save_LDFLAGS
+])# BOOST_WAVE
+
+
+# BOOST_XPRESSIVE()
+# -----------------
+# Look for Boost.Xpressive (new since 1.36.0).
+BOOST_DEFUN([Xpressive],
+[BOOST_FIND_HEADER([boost/xpressive/xpressive.hpp])])
+
+
+# ----------------- #
+# Internal helpers. #
+# ----------------- #
+
+
+# _BOOST_PTHREAD_FLAG()
+# ---------------------
+# Internal helper for BOOST_THREAD. Computes boost_cv_pthread_flag
+# which must be used in CPPFLAGS and LIBS.
+#
+# Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3,
+# boost/thread.hpp will trigger a #error if -pthread isn't used:
+# boost/config/requires_threads.hpp:47:5: #error "Compiler threading support
+# is not turned on. Please set the correct command line options for
+# threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
+#
+# Based on ACX_PTHREAD: http://autoconf-archive.cryp.to/acx_pthread.html
+AC_DEFUN([_BOOST_PTHREAD_FLAG],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_LANG_PUSH([C++])dnl
+AC_CACHE_CHECK([for the flags needed to use pthreads], [boost_cv_pthread_flag],
+[ boost_cv_pthread_flag=
+ # The ordering *is* (sometimes) important. Some notes on the
+ # individual items follow:
+ # (none): in case threads are in libc; should be tried before -Kthread and
+ # other compiler flags to prevent continual compiler warnings
+ # -lpthreads: AIX (must check this before -lpthread)
+ # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+ # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+ # -llthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+ # -pthread: GNU Linux/GCC (kernel threads), BSD/GCC (userland threads)
+ # -pthreads: Solaris/GCC
+ # -mthreads: MinGW32/GCC, Lynx/GCC
+ # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+ # doesn't hurt to check since this sometimes defines pthreads too;
+ # also defines -D_REENTRANT)
+ # ... -mt is also the pthreads flag for HP/aCC
+ # -lpthread: GNU Linux, etc.
+ # --thread-safe: KAI C++
+ case $host_os in #(
+ *solaris*)
+ # On Solaris (at least, for some versions), libc contains stubbed
+ # (non-functional) versions of the pthreads routines, so link-based
+ # tests will erroneously succeed. (We need to link with -pthreads/-mt/
+ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
+ # a function called by this macro, so we could check for that, but
+ # who knows whether they'll stub that too in a future libc.) So,
+ # we'll just look for -pthreads and -lpthread first:
+ boost_pthread_flags="-pthreads -lpthread -mt -pthread";; #(
+ *)
+ boost_pthread_flags="-lpthreads -Kthread -kthread -llthread -pthread \
+ -pthreads -mthreads -lpthread --thread-safe -mt";;
+ esac
+ # Generate the test file.
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <pthread.h>],
+ [pthread_t th; pthread_join(th, 0);
+ pthread_attr_init(0); pthread_cleanup_push(0, 0);
+ pthread_create(0,0,0,0); pthread_cleanup_pop(0);])])
+ for boost_pthread_flag in '' $boost_pthread_flags; do
+ boost_pthread_ok=false
+dnl Re-use the test file already generated.
+ boost_pthreads__save_LIBS=$LIBS
+ LIBS="$LIBS $boost_pthread_flag"
+ AC_LINK_IFELSE([],
+ [if grep ".*$boost_pthread_flag" conftest.err; then
+ echo "This flag seems to have triggered warnings" >&AS_MESSAGE_LOG_FD
+ else
+ boost_pthread_ok=:; boost_cv_pthread_flag=$boost_pthread_flag
+ fi])
+ LIBS=$boost_pthreads__save_LIBS
+ $boost_pthread_ok && break
+ done
+])
+AC_LANG_POP([C++])dnl
+])# _BOOST_PTHREAD_FLAG
+
+
+# _BOOST_gcc_test(MAJOR, MINOR)
+# -----------------------------
+# Internal helper for _BOOST_FIND_COMPILER_TAG.
+m4_define([_BOOST_gcc_test],
+["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC @ gcc$1$2"])dnl
+
+# _BOOST_mingw_test(MAJOR, MINOR)
+# -----------------------------
+# Internal helper for _BOOST_FIND_COMPILER_TAG.
+m4_define([_BOOST_mingw_test],
+["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw$1$2"])dnl
+
+
+# _BOOST_FIND_COMPILER_TAG()
+# --------------------------
+# Internal. When Boost is installed without --layout=system, each library
+# filename will hold a suffix that encodes the compiler used during the
+# build. The Boost build system seems to call this a `tag'.
+AC_DEFUN([_BOOST_FIND_COMPILER_TAG],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_CACHE_CHECK([for the toolset name used by Boost for $CXX],
+ [boost_cv_lib_tag],
+[boost_cv_lib_tag=unknown
+if test x$boost_cv_inc_path != xno; then
+ AC_LANG_PUSH([C++])dnl
+ # The following tests are mostly inspired by boost/config/auto_link.hpp
+ # The list is sorted to most recent/common to oldest compiler (in order
+ # to increase the likelihood of finding the right compiler with the
+ # least number of compilation attempt).
+ # Beware that some tests are sensible to the order (for instance, we must
+ # look for MinGW before looking for GCC3).
+ # I used one compilation test per compiler with a #error to recognize
+ # each compiler so that it works even when cross-compiling (let me know
+ # if you know a better approach).
+ # Known missing tags (known from Boost's tools/build/v2/tools/common.jam):
+ # como, edg, kcc, bck, mp, sw, tru, xlc
+ # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines
+ # the same defines as GCC's).
+ for i in \
+ _BOOST_mingw_test(5, 3) \
+ _BOOST_gcc_test(5, 3) \
+ _BOOST_mingw_test(5, 2) \
+ _BOOST_gcc_test(5, 2) \
+ _BOOST_mingw_test(5, 1) \
+ _BOOST_gcc_test(5, 1) \
+ _BOOST_mingw_test(5, 0) \
+ _BOOST_gcc_test(5, 0) \
+ _BOOST_mingw_test(4, 10) \
+ _BOOST_gcc_test(4, 10) \
+ _BOOST_mingw_test(4, 9) \
+ _BOOST_gcc_test(4, 9) \
+ _BOOST_mingw_test(4, 8) \
+ _BOOST_gcc_test(4, 8) \
+ _BOOST_mingw_test(4, 7) \
+ _BOOST_gcc_test(4, 7) \
+ _BOOST_mingw_test(4, 6) \
+ _BOOST_gcc_test(4, 6) \
+ _BOOST_mingw_test(4, 5) \
+ _BOOST_gcc_test(4, 5) \
+ _BOOST_mingw_test(4, 4) \
+ _BOOST_gcc_test(4, 4) \
+ _BOOST_mingw_test(4, 3) \
+ _BOOST_gcc_test(4, 3) \
+ _BOOST_mingw_test(4, 2) \
+ _BOOST_gcc_test(4, 2) \
+ _BOOST_mingw_test(4, 1) \
+ _BOOST_gcc_test(4, 1) \
+ _BOOST_mingw_test(4, 0) \
+ _BOOST_gcc_test(4, 0) \
+ "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \
+ && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw" \
+ _BOOST_gcc_test(3, 4) \
+ _BOOST_gcc_test(3, 3) \
+ "defined _MSC_VER && _MSC_VER >= 1500 @ vc90" \
+ "defined _MSC_VER && _MSC_VER == 1400 @ vc80" \
+ _BOOST_gcc_test(3, 2) \
+ "defined _MSC_VER && _MSC_VER == 1310 @ vc71" \
+ _BOOST_gcc_test(3, 1) \
+ _BOOST_gcc_test(3, 0) \
+ "defined __BORLANDC__ @ bcb" \
+ "defined __ICC && (defined __unix || defined __unix__) @ il" \
+ "defined __ICL @ iw" \
+ "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \
+ _BOOST_gcc_test(2, 95) \
+ "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \
+ "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \
+ "defined _MSC_VER && _MSC_VER < 1300 && defined UNDER_CE @ evc4" \
+ "defined __MWERKS__ && __MWERKS__ <= 0x31FF @ cw8"
+ do
+ boost_tag_test=`expr "X$i" : 'X\([[^@]]*\) @ '`
+ boost_tag=`expr "X$i" : 'X[[^@]]* @ \(.*\)'`
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if $boost_tag_test
+/* OK */
+#else
+# error $boost_tag_test
+#endif
+]])], [boost_cv_lib_tag=$boost_tag; break], [])
+ done
+AC_LANG_POP([C++])dnl
+ case $boost_cv_lib_tag in #(
+ # Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed
+ # to "gcc41" for instance.
+ *-gcc | *'-gcc ') :;; #( Don't re-add -gcc: it's already in there.
+ gcc*)
+ boost_tag_x=
+ case $host_os in #(
+ darwin*)
+ if test $boost_major_version -ge 136; then
+ # The `x' added in r46793 of Boost.
+ boost_tag_x=x
+ fi;;
+ esac
+ # We can specify multiple tags in this variable because it's used by
+ # BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ...
+ boost_cv_lib_tag="$boost_tag_x$boost_cv_lib_tag -${boost_tag_x}gcc"
+ ;; #(
+ unknown)
+ AC_MSG_WARN([[could not figure out which toolset name to use for $CXX]])
+ boost_cv_lib_tag=
+ ;;
+ esac
+fi])dnl end of AC_CACHE_CHECK
+])# _BOOST_FIND_COMPILER_TAG
+
+
+# _BOOST_GUESS_WHETHER_TO_USE_MT()
+# --------------------------------
+# Compile a small test to try to guess whether we should favor MT (Multi
+# Thread) flavors of Boost. Sets boost_guess_use_mt accordingly.
+AC_DEFUN([_BOOST_GUESS_WHETHER_TO_USE_MT],
+[# Check whether we do better use `mt' even though we weren't ask to.
+AC_LANG_PUSH([C++])dnl
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if defined _REENTRANT || defined _MT || defined __MT__
+/* use -mt */
+#else
+# error MT not needed
+#endif
+]])], [boost_guess_use_mt=:], [boost_guess_use_mt=false])
+AC_LANG_POP([C++])dnl
+])
+
+# _BOOST_AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+# -------------------------------------------------------------------
+# Fork of _AC_LINK_IFELSE that preserves conftest.o across calls. Fragile,
+# will break when Autoconf changes its internals. Requires that you manually
+# rm -f conftest.$ac_objext in between to really different tests, otherwise
+# you will try to link a conftest.o left behind by a previous test.
+# Used to aggressively optimize BOOST_FIND_LIB (see the big comment in this
+# macro).
+#
+# Don't use "break" in the actions, as it would short-circuit some code
+# this macro runs after the actions.
+m4_define([_BOOST_AC_LINK_IFELSE],
+[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
+rm -f conftest$ac_exeext
+boost_save_ac_ext=$ac_ext
+boost_use_source=:
+# If we already have a .o, re-use it. We change $ac_ext so that $ac_link
+# tries to link the existing object file instead of compiling from source.
+test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false &&
+ _AS_ECHO_LOG([re-using the existing conftest.$ac_objext])
+AS_IF([_AC_DO_STDERR($ac_link) && {
+ test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_executable_p conftest$ac_exeext
+dnl FIXME: use AS_TEST_X instead when 2.61 is widespread enough.
+ }],
+ [$2],
+ [if $boost_use_source; then
+ _AC_MSG_LOG_CONFTEST
+ fi
+ $3])
+ac_objext=$boost_save_ac_objext
+ac_ext=$boost_save_ac_ext
+dnl Delete also the IPA/IPO (Inter Procedural Analysis/Optimization)
+dnl information created by the PGI compiler (conftest_ipa8_conftest.oo),
+dnl as it would interfere with the next link command.
+rm -f core conftest.err conftest_ipa8_conftest.oo \
+ conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl
+])# _BOOST_AC_LINK_IFELSE
+
+# Local Variables:
+# mode: autoconf
+# End:
diff --git a/org.eclipse.efm.symbex/cmake/cvc4-1.4-patch/options/options_template.cpp b/org.eclipse.efm.symbex/cmake/cvc4-1.4-patch/options/options_template.cpp
new file mode 100644
index 0000000..44bf6b9
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/cvc4-1.4-patch/options/options_template.cpp
@@ -0,0 +1,610 @@
+/********************* */
+/*! \file options_template.cpp
+ ** \verbatim
+ ** Original author: Morgan Deters
+ ** Major contributors: none
+ ** Minor contributors (to current version): Kshitij Bansal
+ ** This file is part of the CVC4 project.
+ ** Copyright (c) 2009-2014 New York University and The University of Iowa
+ ** See the file COPYING in the top-level source directory for licensing
+ ** information.\endverbatim
+ **
+ ** \brief Contains code for handling command-line options.
+ **
+ ** Contains code for handling command-line options
+ **/
+
+#if !defined(_BSD_SOURCE) && defined(__MINGW32__) && !defined(__MINGW64__)
+// force use of optreset; mingw32 croaks on argv-switching otherwise
+# include "cvc4autoconfig.h"
+# define _BSD_SOURCE
+# undef HAVE_DECL_OPTRESET
+# define HAVE_DECL_OPTRESET 1
+# define CVC4_IS_NOT_REALLY_BSD
+#endif /* !_BSD_SOURCE && __MINGW32__ && !__MINGW64__ */
+
+#ifdef __MINGW64__
+#define _BSD_SOURCE // Needed to avoid 'optreset' error at link
+extern int optreset;
+#endif /* __MINGW64__ */
+
+#include <getopt.h>
+
+// clean up
+#ifdef CVC4_IS_NOT_REALLY_BSD
+# undef _BSD_SOURCE
+#endif /* CVC4_IS_NOT_REALLY_BSD */
+
+#include <cstdio>
+#include <cstdlib>
+#include <new>
+#include <string>
+#include <sstream>
+#include <limits>
+#include <unistd.h>
+#include <string.h>
+#include <stdint.h>
+#include <time.h>
+
+#include "expr/expr.h"
+#include "util/configuration.h"
+#include "util/didyoumean.h"
+#include "util/exception.h"
+#include "util/language.h"
+#include "util/tls.h"
+
+${include_all_option_headers}
+
+#line 58 "${template}"
+
+#include "util/output.h"
+#include "options/options_holder.h"
+#include "cvc4autoconfig.h"
+#include "options/base_options_handlers.h"
+
+${option_handler_includes}
+
+#line 67 "${template}"
+
+using namespace CVC4;
+using namespace CVC4::options;
+
+namespace CVC4 {
+
+CVC4_THREADLOCAL(Options*) Options::s_current = NULL;
+
+/**
+ * This is a default handler for options of built-in C++ type. This
+ * template is really just a helper for the handleOption() template,
+ * below. Variants of this template handle numeric and non-numeric,
+ * integral and non-integral, signed and unsigned C++ types.
+ * handleOption() makes sure to instantiate the right one.
+ *
+ * This implements default behavior when e.g. an option is
+ * unsigned but the user specifies a negative argument; etc.
+ */
+template <class T, bool is_numeric, bool is_integer>
+struct OptionHandler {
+ static T handle(std::string option, std::string optionarg);
+};/* struct OptionHandler<> */
+
+/** Variant for integral C++ types */
+template <class T>
+struct OptionHandler<T, true, true> {
+ static T handle(std::string option, std::string optionarg) {
+ try {
+ Integer i(optionarg, 10);
+
+ if(! std::numeric_limits<T>::is_signed && i < 0) {
+ // unsigned type but user gave negative argument
+ throw OptionException(option + " requires a nonnegative argument");
+ } else if(i < std::numeric_limits<T>::min()) {
+ // negative overflow for type
+ std::stringstream ss;
+ ss << option << " requires an argument >= " << std::numeric_limits<T>::min();
+ throw OptionException(ss.str());
+ } else if(i > std::numeric_limits<T>::max()) {
+ // positive overflow for type
+ std::stringstream ss;
+ ss << option << " requires an argument <= " << std::numeric_limits<T>::max();
+ throw OptionException(ss.str());
+ }
+
+ if(std::numeric_limits<T>::is_signed) {
+ return T(i.getLong());
+ } else {
+ return T(i.getUnsignedLong());
+ }
+ } catch(std::invalid_argument&) {
+ // user gave something other than an integer
+ throw OptionException(option + " requires an integer argument");
+ }
+ }
+};/* struct OptionHandler<T, true, true> */
+
+/** Variant for numeric but non-integral C++ types */
+template <class T>
+struct OptionHandler<T, true, false> {
+ static T handle(std::string option, std::string optionarg) {
+ std::stringstream in(optionarg);
+ long double r;
+ in >> r;
+ if(! in.eof()) {
+ // we didn't consume the whole string (junk at end)
+ throw OptionException(option + " requires a numeric argument");
+ }
+
+ if(! std::numeric_limits<T>::is_signed && r < 0.0) {
+ // unsigned type but user gave negative value
+ throw OptionException(option + " requires a nonnegative argument");
+ } else if(r < -std::numeric_limits<T>::max()) {
+ // negative overflow for type
+ std::stringstream ss;
+ ss << option << " requires an argument >= " << -std::numeric_limits<T>::max();
+ throw OptionException(ss.str());
+ } else if(r > std::numeric_limits<T>::max()) {
+ // positive overflow for type
+ std::stringstream ss;
+ ss << option << " requires an argument <= " << std::numeric_limits<T>::max();
+ throw OptionException(ss.str());
+ }
+
+ return T(r);
+ }
+};/* struct OptionHandler<T, true, false> */
+
+/** Variant for non-numeric C++ types */
+template <class T>
+struct OptionHandler<T, false, false> {
+ static T handle(std::string option, std::string optionarg) {
+ T::unsupported_handleOption_call___please_write_me;
+ // The above line causes a compiler error if this version of the template
+ // is ever instantiated (meaning that a specialization is missing). So
+ // don't worry about the segfault in the next line, the "return" is only
+ // there to keep the compiler from giving additional, distracting errors
+ // and warnings.
+ return *(T*)0;
+ }
+};/* struct OptionHandler<T, false, false> */
+
+/** Handle an option of type T in the default way. */
+template <class T>
+T handleOption(std::string option, std::string optionarg) {
+ return OptionHandler<T, std::numeric_limits<T>::is_specialized, std::numeric_limits<T>::is_integer>::handle(option, optionarg);
+}
+
+/** Handle an option of type std::string in the default way. */
+template <>
+std::string handleOption<std::string>(std::string option, std::string optionarg) {
+ return optionarg;
+}
+
+/**
+ * Run handler, and any user-given predicates, for option T.
+ * If a user specifies a :handler or :predicates, it overrides this.
+ */
+template <class T>
+typename T::type runHandlerAndPredicates(T, std::string option, std::string optionarg, SmtEngine* smt) {
+ // By default, parse the option argument in a way appropriate for its type.
+ // E.g., for "unsigned int" options, ensure that the provided argument is
+ // a nonnegative integer that fits in the unsigned int type.
+
+ return handleOption<typename T::type>(option, optionarg);
+}
+
+template <class T>
+void runBoolPredicates(T, std::string option, bool b, SmtEngine* smt) {
+ // By default, nothing to do for bool. Users add things with
+ // :predicate in options files to provide custom checking routines
+ // that can throw exceptions.
+}
+
+${all_custom_handlers}
+
+#line 204 "${template}"
+
+#ifdef CVC4_DEBUG
+# define USE_EARLY_TYPE_CHECKING_BY_DEFAULT true
+#else /* CVC4_DEBUG */
+# define USE_EARLY_TYPE_CHECKING_BY_DEFAULT false
+#endif /* CVC4_DEBUG */
+
+#if defined(CVC4_MUZZLED) || defined(CVC4_COMPETITION_MODE)
+# define DO_SEMANTIC_CHECKS_BY_DEFAULT false
+#else /* CVC4_MUZZLED || CVC4_COMPETITION_MODE */
+# define DO_SEMANTIC_CHECKS_BY_DEFAULT true
+#endif /* CVC4_MUZZLED || CVC4_COMPETITION_MODE */
+
+Options::Options() :
+ d_holder(new options::OptionsHolder()) {
+}
+
+Options::Options(const Options& options) :
+ d_holder(new options::OptionsHolder(*options.d_holder)) {
+}
+
+Options::~Options() {
+ delete d_holder;
+}
+
+options::OptionsHolder::OptionsHolder() : ${all_modules_defaults}
+{
+}
+
+#line 234 "${template}"
+
+static const std::string mostCommonOptionsDescription = "\
+Most commonly-used CVC4 options:${common_documentation}";
+
+#line 239 "${template}"
+
+static const std::string optionsDescription = mostCommonOptionsDescription + "\n\
+\n\
+Additional CVC4 options:${remaining_documentation}";
+
+#line 245 "${template}"
+
+static const std::string optionsFootnote = "\n\
+[*] Each of these options has a --no-OPTIONNAME variant, which reverses the\n\
+ sense of the option.\n\
+";
+
+static const std::string languageDescription = "\
+Languages currently supported as arguments to the -L / --lang option:\n\
+ auto attempt to automatically determine language\n\
+ cvc4 | presentation | pl CVC4 presentation language\n\
+ smt1 | smtlib1 SMT-LIB format 1.2\n\
+ smt | smtlib | smt2 | smtlib2 SMT-LIB format 2.0\n\
+ tptp TPTP format (cnf and fof)\n\
+\n\
+Languages currently supported as arguments to the --output-lang option:\n\
+ auto match output language to input language\n\
+ cvc4 | presentation | pl CVC4 presentation language\n\
+ cvc3 CVC3 presentation language\n\
+ smt1 | smtlib1 SMT-LIB format 1.2\n\
+ smt | smtlib | smt2 | smtlib2 SMT-LIB format 2.0\n\
+ z3str SMT-LIB 2.0 with Z3-str string constraints\n\
+ tptp TPTP format\n\
+ ast internal format (simple syntax trees)\n\
+";
+
+std::string Options::getDescription() const {
+ return optionsDescription;
+}
+
+void Options::printUsage(const std::string msg, std::ostream& out) {
+ out << msg << optionsDescription << std::endl
+ << optionsFootnote << std::endl << std::flush;
+}
+
+void Options::printShortUsage(const std::string msg, std::ostream& out) {
+ out << msg << mostCommonOptionsDescription << std::endl
+ << optionsFootnote << std::endl
+ << "For full usage, please use --help." << std::endl << std::endl << std::flush;
+}
+
+void Options::printLanguageHelp(std::ostream& out) {
+ out << languageDescription << std::flush;
+}
+
+/**
+ * This is a table of long options. By policy, each short option
+ * should have an equivalent long option (but the reverse isn't the
+ * case), so this table should thus contain all command-line options.
+ *
+ * Each option in this array has four elements:
+ *
+ * 1. the long option string
+ * 2. argument behavior for the option:
+ * no_argument - no argument permitted
+ * required_argument - an argument is expected
+ * optional_argument - an argument is permitted but not required
+ * 3. this is a pointer to an int which is set to the 4th entry of the
+ * array if the option is present; or NULL, in which case
+ * getopt_long() returns the 4th entry
+ * 4. the return value for getopt_long() when this long option (or the
+ * value to set the 3rd entry to; see #3)
+ *
+ * If you add something here, you should add it in src/main/usage.h
+ * also, to document it.
+ *
+ * If you add something that has a short option equivalent, you should
+ * add it to the getopt_long() call in parseOptions().
+ */
+static struct option cmdlineOptions[] = {${all_modules_long_options}
+ { NULL, no_argument, NULL, '\0' }
+};/* cmdlineOptions */
+
+#line 318 "${template}"
+
+static void preemptGetopt(int& argc, char**& argv, const char* opt) {
+ const size_t maxoptlen = 128;
+
+ Debug("preemptGetopt") << "preempting getopt() with " << opt << std::endl;
+
+ AlwaysAssert(opt != NULL && *opt != '\0');
+ AlwaysAssert(strlen(opt) <= maxoptlen);
+
+ ++argc;
+ unsigned i = 1;
+ while(argv[i] != NULL && argv[i][0] != '\0') {
+ ++i;
+ }
+
+ if(argv[i] == NULL) {
+ argv = (char**) realloc(argv, (i + 6) * sizeof(char*));
+ for(unsigned j = i; j < i + 5; ++j) {
+ argv[j] = (char*) malloc(sizeof(char) * maxoptlen);
+ argv[j][0] = '\0';
+ }
+ argv[i + 5] = NULL;
+ }
+
+ strncpy(argv[i], opt, maxoptlen - 1);
+ argv[i][maxoptlen - 1] = '\0'; // ensure NUL-termination even on overflow
+}
+
+namespace options {
+
+/** Set a given Options* as "current" just for a particular scope. */
+class OptionsGuard {
+ CVC4_THREADLOCAL_TYPE(Options*)* d_field;
+ Options* d_old;
+public:
+ OptionsGuard(CVC4_THREADLOCAL_TYPE(Options*)* field, Options* opts) :
+ d_field(field),
+ d_old(*field) {
+ *field = opts;
+ }
+ ~OptionsGuard() {
+ *d_field = d_old;
+ }
+};/* class OptionsGuard */
+
+}/* CVC4::options namespace */
+
+/**
+ * Parse argc/argv and put the result into a CVC4::Options.
+ * The return value is what's left of the command line (that is, the
+ * non-option arguments).
+ */
+std::vector<std::string> Options::parseOptions(int argc, char* main_argv[]) throw(OptionException) {
+ options::OptionsGuard guard(&s_current, this);
+
+ const char *progName = main_argv[0];
+ SmtEngine* const smt = NULL;
+
+ Debug("options") << "main_argv == " << main_argv << std::endl;
+
+ // Reset getopt(), in the case of multiple calls to parseOptions().
+ // This can be = 1 in newer GNU getopt, but older (< 2007) require = 0.
+ optind = 0;
+#if HAVE_DECL_OPTRESET
+ optreset = 1; // on BSD getopt() (e.g. Mac OS), might need this
+#endif /* HAVE_DECL_OPTRESET */
+
+ // find the base name of the program
+ const char *x = strrchr(progName, '/');
+ if(x != NULL) {
+ progName = x + 1;
+ }
+ d_holder->binary_name = std::string(progName);
+
+ int extra_argc = 1;
+ char **extra_argv = (char**) malloc(2 * sizeof(char*));
+ extra_argv[0] = NULL;
+ extra_argv[1] = NULL;
+
+ int extra_optind = 0, main_optind = 0;
+ int old_optind;
+ int *optind_ref = &main_optind;
+
+ char** argv = main_argv;
+
+ std::vector<std::string> nonOptions;
+
+ for(;;) {
+ int c = -1;
+ optopt = 0;
+ std::string option, optionarg;
+ Debug("preemptGetopt") << "top of loop, extra_optind == " << extra_optind << ", extra_argc == " << extra_argc << std::endl;
+ if((extra_optind == 0 ? 1 : extra_optind) < extra_argc) {
+#if HAVE_DECL_OPTRESET
+ if(optind_ref != &extra_optind) {
+ optreset = 1; // on BSD getopt() (e.g. Mac OS), might need this
+ }
+#endif /* HAVE_DECL_OPTRESET */
+ old_optind = optind = extra_optind;
+ optind_ref = &extra_optind;
+ argv = extra_argv;
+ Debug("preemptGetopt") << "in preempt code, next arg is " << extra_argv[optind == 0 ? 1 : optind] << std::endl;
+ if(extra_argv[extra_optind == 0 ? 1 : extra_optind][0] != '-') {
+ InternalError("preempted args cannot give non-options command-line args (found `%s')", extra_argv[extra_optind == 0 ? 1 : extra_optind]);
+ }
+ c = getopt_long(extra_argc, extra_argv,
+ "+:${all_modules_short_options}",
+ cmdlineOptions, NULL);
+ Debug("preemptGetopt") << "in preempt code, c == " << c << " (`" << char(c) << "') optind == " << optind << std::endl;
+ if(optopt == 0 ||
+ ( optopt >= ${long_option_value_begin} && optopt <= ${long_option_value_end} )) {
+ // long option
+ option = argv[old_optind == 0 ? 1 : old_optind];
+ optionarg = (optarg == NULL) ? "" : optarg;
+ } else {
+ // short option
+ option = std::string("-") + char(optopt);
+ optionarg = (optarg == NULL) ? "" : optarg;
+ }
+ if(optind >= extra_argc) {
+ Debug("preemptGetopt") << "-- no more preempt args" << std::endl;
+ unsigned i = 1;
+ while(extra_argv[i] != NULL && extra_argv[i][0] != '\0') {
+ extra_argv[i][0] = '\0';
+ ++i;
+ }
+ extra_argc = 1;
+ extra_optind = 0;
+ } else {
+ Debug("preemptGetopt") << "-- more preempt args" << std::endl;
+ extra_optind = optind;
+ }
+ }
+ if(c == -1) {
+#if HAVE_DECL_OPTRESET
+ if(optind_ref != &main_optind) {
+ optreset = 1; // on BSD getopt() (e.g. Mac OS), might need this
+ }
+#endif /* HAVE_DECL_OPTRESET */
+ old_optind = optind = main_optind;
+ optind_ref = &main_optind;
+ argv = main_argv;
+ if(main_optind < argc && main_argv[main_optind][0] != '-') {
+ do {
+ if(main_optind != 0) {
+ nonOptions.push_back(main_argv[main_optind]);
+ }
+ ++main_optind;
+ } while(main_optind < argc && main_argv[main_optind][0] != '-');
+ continue;
+ }
+ Debug("options") << "[ before, optind == " << optind << " ]" << std::endl;
+#if defined(__MINGW32__) || defined(__MINGW64__)
+ if(optreset == 1 && optind > 1) {
+ // on mingw, optreset will reset the optind, so we have to
+ // manually advance argc, argv
+ main_argv[optind - 1] = main_argv[0];
+ argv = main_argv += optind - 1;
+ argc -= optind - 1;
+ old_optind = optind = main_optind = 1;
+ if(argc > 0) {
+ Debug("options") << "looking at : " << argv[0] << std::endl;
+ }
+ /*c = getopt_long(argc, main_argv,
+ "+:${all_modules_short_options}",
+ cmdlineOptions, NULL);
+ Debug("options") << "pre-emptory c is " << c << " (" << char(c) << ")" << std::endl;
+ Debug("options") << "optind was reset to " << optind << std::endl;
+ optind = main_optind;
+ Debug("options") << "I restored optind to " << optind << std::endl;*/
+ }
+#endif /* __MINGW32__ || __MINGW64__ */
+ Debug("options") << "[ argc == " << argc << ", main_argv == " << main_argv << " ]" << std::endl;
+ c = getopt_long(argc, main_argv,
+ "+:${all_modules_short_options}",
+ cmdlineOptions, NULL);
+ main_optind = optind;
+ Debug("options") << "[ got " << int(c) << " (" << char(c) << ") ]" << std::endl;
+ Debug("options") << "[ next option will be at pos: " << optind << " ]" << std::endl;
+ if(c == -1) {
+ Debug("options") << "done with option parsing" << std::endl;
+ break;
+ }
+ option = argv[old_optind == 0 ? 1 : old_optind];
+ optionarg = (optarg == NULL) ? "" : optarg;
+ }
+
+ Debug("preemptGetopt") << "processing option " << c << " (`" << char(c) << "'), " << option << std::endl;
+
+ switch(c) {
+${all_modules_option_handlers}
+
+#line 511 "${template}"
+
+ case ':':
+ // This can be a long or short option, and the way to get at the
+ // name of it is different.
+ throw OptionException(std::string("option `") + option + "' missing its required argument");
+
+ case '?':
+ default:
+ if( ( optopt == 0 || ( optopt >= ${long_option_value_begin} && optopt <= ${long_option_value_end} ) ) &&
+ !strncmp(argv[optind - 1], "--thread", 8) &&
+ strlen(argv[optind - 1]) > 8 ) {
+ if(! isdigit(argv[optind - 1][8])) {
+ throw OptionException(std::string("can't understand option `") + option + "': expected something like --threadN=\"--option1 --option2\", where N is a nonnegative integer");
+ }
+ std::vector<std::string>& threadArgv = d_holder->threadArgv;
+ char *end;
+ long tnum = strtol(argv[optind - 1] + 8, &end, 10);
+ if(tnum < 0 || (*end != '\0' && *end != '=')) {
+ throw OptionException(std::string("can't understand option `") + option + "': expected something like --threadN=\"--option1 --option2\", where N is a nonnegative integer");
+ }
+ if(threadArgv.size() <= size_t(tnum)) {
+ threadArgv.resize(tnum + 1);
+ }
+ if(threadArgv[tnum] != "") {
+ threadArgv[tnum] += " ";
+ }
+ if(*end == '\0') { // e.g., we have --thread0 "foo"
+ if(argc <= optind) {
+ throw OptionException(std::string("option `") + option + "' missing its required argument");
+ }
+ Debug("options") << "thread " << tnum << " gets option " << argv[optind] << std::endl;
+ threadArgv[tnum] += argv[(*optind_ref)++];
+ } else { // e.g., we have --thread0="foo"
+ if(end[1] == '\0') {
+ throw OptionException(std::string("option `") + option + "' missing its required argument");
+ }
+ Debug("options") << "thread " << tnum << " gets option " << (end + 1) << std::endl;
+ threadArgv[tnum] += end + 1;
+ }
+ Debug("options") << "thread " << tnum << " now has " << threadArgv[tnum] << std::endl;
+ break;
+ }
+
+ throw OptionException(std::string("can't understand option `") + option + "'"
+ + suggestCommandLineOptions(option));
+ }
+ }
+
+ Debug("options") << "returning " << nonOptions.size() << " non-option arguments." << std::endl;
+
+ free(extra_argv);
+
+ return nonOptions;
+}
+
+std::string Options::suggestCommandLineOptions(const std::string& optionName) throw() {
+ DidYouMean didYouMean;
+
+ const char* opt;
+ for(size_t i = 0; (opt = cmdlineOptions[i].name) != NULL; ++i) {
+ didYouMean.addWord(std::string("--") + cmdlineOptions[i].name);
+ }
+
+ return didYouMean.getMatchAsString(optionName.substr(0, optionName.find('=')));
+}
+
+static const char* smtOptions[] = {
+ ${all_modules_smt_options},
+#line 580 "${template}"
+ NULL
+};/* smtOptions[] */
+
+std::vector<std::string> Options::suggestSmtOptions(const std::string& optionName) throw() {
+ std::vector<std::string> suggestions;
+
+ const char* opt;
+ for(size_t i = 0; (opt = smtOptions[i]) != NULL; ++i) {
+ if(std::strstr(opt, optionName.c_str()) != NULL) {
+ suggestions.push_back(opt);
+ }
+ }
+
+ return suggestions;
+}
+
+SExpr Options::getOptions() const throw() {
+ std::vector<SExpr> opts;
+
+ ${all_modules_get_options}
+
+#line 602 "${template}"
+
+ return SExpr(opts);
+}
+
+#undef USE_EARLY_TYPE_CHECKING_BY_DEFAULT
+#undef DO_SEMANTIC_CHECKS_BY_DEFAULT
+
+}/* CVC4 namespace */
diff --git a/org.eclipse.efm.symbex/cmake/cvc4-1.4-patch/util/integer_gmp_imp.h b/org.eclipse.efm.symbex/cmake/cvc4-1.4-patch/util/integer_gmp_imp.h
new file mode 100644
index 0000000..2416b7f
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/cvc4-1.4-patch/util/integer_gmp_imp.h
@@ -0,0 +1,520 @@
+/********************* */
+/*! \file integer_gmp_imp.h
+ ** \verbatim
+ ** Original author: Tim King
+ ** Major contributors: Morgan Deters, Liana Hadarean
+ ** Minor contributors (to current version): Dejan Jovanovic
+ ** This file is part of the CVC4 project.
+ ** Copyright (c) 2009-2014 New York University and The University of Iowa
+ ** See the file COPYING in the top-level source directory for licensing
+ ** information.\endverbatim
+ **
+ ** \brief A multiprecision integer constant; wraps a GMP multiprecision
+ ** integer.
+ **
+ ** A multiprecision integer constant; wraps a GMP multiprecision integer.
+ **/
+
+#include "cvc4_public.h"
+
+#ifndef __CVC4__INTEGER_H
+#define __CVC4__INTEGER_H
+
+#include <string>
+#include <iostream>
+#include <limits>
+
+#include "util/gmp_util.h"
+#include "util/exception.h"
+
+namespace CVC4 {
+
+class Rational;
+
+class CVC4_PUBLIC Integer {
+private:
+ /**
+ * Stores the value of the rational is stored in a C++ GMP integer class.
+ * Using this instead of mpz_t allows for easier destruction.
+ */
+ mpz_class d_value;
+
+public:
+
+ /**
+ * Gets a reference to the gmp data that backs up the integer.
+ * Only accessible to friend classes.
+ */
+ const mpz_class& get_mpz() const { return d_value; }
+
+ /**
+ * Constructs an Integer by copying a GMP C++ primitive.
+ */
+ Integer(const mpz_class& val) : d_value(val) {}
+
+ /** Constructs a rational with the value 0. */
+ Integer() : d_value(0){}
+
+ /**
+ * Constructs a Integer from a C string.
+ * Throws std::invalid_argument if the string is not a valid rational.
+ * For more information about what is a valid rational string,
+ * see GMP's documentation for mpq_set_str().
+ */
+ explicit Integer(const char* s, unsigned base = 10);
+ explicit Integer(const std::string& s, unsigned base = 10);
+
+ Integer(const Integer& q) : d_value(q.d_value) {}
+
+ Integer( signed int z) : d_value(z) {}
+ Integer(unsigned int z) : d_value(z) {}
+ Integer( signed long int z) : d_value(z) {}
+ Integer(unsigned long int z) : d_value(z) {}
+
+#ifdef CVC4_NEED_INT64_T_OVERLOADS
+ Integer( int64_t z) : d_value(static_cast<long>(z)) {}
+ Integer(uint64_t z) : d_value(static_cast<unsigned long>(z)) {}
+#endif /* CVC4_NEED_INT64_T_OVERLOADS */
+
+ ~Integer() {}
+
+ Integer& operator=(const Integer& x){
+ if(this == &x) return *this;
+ d_value = x.d_value;
+ return *this;
+ }
+
+ bool operator==(const Integer& y) const {
+ return d_value == y.d_value;
+ }
+
+ Integer operator-() const {
+ return Integer(-(d_value));
+ }
+
+
+ bool operator!=(const Integer& y) const {
+ return d_value != y.d_value;
+ }
+
+ bool operator< (const Integer& y) const {
+ return d_value < y.d_value;
+ }
+
+ bool operator<=(const Integer& y) const {
+ return d_value <= y.d_value;
+ }
+
+ bool operator> (const Integer& y) const {
+ return d_value > y.d_value;
+ }
+
+ bool operator>=(const Integer& y) const {
+ return d_value >= y.d_value;
+ }
+
+
+ Integer operator+(const Integer& y) const {
+ return Integer( d_value + y.d_value );
+ }
+ Integer& operator+=(const Integer& y) {
+ d_value += y.d_value;
+ return *this;
+ }
+
+ Integer operator-(const Integer& y) const {
+ return Integer( d_value - y.d_value );
+ }
+ Integer& operator-=(const Integer& y) {
+ d_value -= y.d_value;
+ return *this;
+ }
+
+ Integer operator*(const Integer& y) const {
+ return Integer( d_value * y.d_value );
+ }
+ Integer& operator*=(const Integer& y) {
+ d_value *= y.d_value;
+ return *this;
+ }
+
+
+ Integer bitwiseOr(const Integer& y) const {
+ mpz_class result;
+ mpz_ior(result.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer(result);
+ }
+
+ Integer bitwiseAnd(const Integer& y) const {
+ mpz_class result;
+ mpz_and(result.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer(result);
+ }
+
+ Integer bitwiseXor(const Integer& y) const {
+ mpz_class result;
+ mpz_xor(result.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer(result);
+ }
+
+ Integer bitwiseNot() const {
+ mpz_class result;
+ mpz_com(result.get_mpz_t(), d_value.get_mpz_t());
+ return Integer(result);
+ }
+
+ /**
+ * Return this*(2^pow).
+ */
+ Integer multiplyByPow2(uint32_t pow) const{
+ mpz_class result;
+ mpz_mul_2exp(result.get_mpz_t(), d_value.get_mpz_t(), pow);
+ return Integer( result );
+ }
+
+ /**
+ * Returns the Integer obtained by setting the ith bit of the
+ * current Integer to 1.
+ */
+ Integer setBit(uint32_t i) const {
+ mpz_class res = d_value;
+ mpz_setbit(res.get_mpz_t(), i);
+ return Integer(res);
+ }
+
+ bool isBitSet(uint32_t i) const {
+ return !extractBitRange(1, i).isZero();
+ }
+
+ /**
+ * Returns the integer with the binary representation of size bits
+ * extended with amount 1's
+ */
+ Integer oneExtend(uint32_t size, uint32_t amount) const {
+ // check that the size is accurate
+ DebugCheckArgument((*this) < Integer(1).multiplyByPow2(size), size);
+ mpz_class res = d_value;
+
+ for (unsigned i = size; i < size + amount; ++i) {
+ mpz_setbit(res.get_mpz_t(), i);
+ }
+
+ return Integer(res);
+ }
+
+ uint32_t toUnsignedInt() const {
+ return mpz_get_ui(d_value.get_mpz_t());
+ }
+
+ /** See GMP Documentation. */
+ Integer extractBitRange(uint32_t bitCount, uint32_t low) const {
+ // bitCount = high-low+1
+ uint32_t high = low + bitCount-1;
+ //— Function: void mpz_fdiv_r_2exp (mpz_t r, mpz_t n, mp_bitcnt_t b)
+ mpz_class rem, div;
+ mpz_fdiv_r_2exp(rem.get_mpz_t(), d_value.get_mpz_t(), high+1);
+ mpz_fdiv_q_2exp(div.get_mpz_t(), rem.get_mpz_t(), low);
+
+ return Integer(div);
+ }
+
+ /**
+ * Returns the floor(this / y)
+ */
+ Integer floorDivideQuotient(const Integer& y) const {
+ mpz_class q;
+ mpz_fdiv_q(q.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer( q );
+ }
+
+ /**
+ * Returns r == this - floor(this/y)*y
+ */
+ Integer floorDivideRemainder(const Integer& y) const {
+ mpz_class r;
+ mpz_fdiv_r(r.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer( r );
+ }
+
+ /**
+ * Computes a floor quotient and remainder for x divided by y.
+ */
+ static void floorQR(Integer& q, Integer& r, const Integer& x, const Integer& y) {
+ mpz_fdiv_qr(q.d_value.get_mpz_t(), r.d_value.get_mpz_t(), x.d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ }
+
+ /**
+ * Returns the ceil(this / y)
+ */
+ Integer ceilingDivideQuotient(const Integer& y) const {
+ mpz_class q;
+ mpz_cdiv_q(q.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer( q );
+ }
+
+ /**
+ * Returns the ceil(this / y)
+ */
+ Integer ceilingDivideRemainder(const Integer& y) const {
+ mpz_class r;
+ mpz_cdiv_r(r.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer( r );
+ }
+
+ /**
+ * Computes a quoitent and remainder according to Boute's Euclidean definition.
+ * euclidianDivideQuotient, euclidianDivideRemainder.
+ *
+ * Boute, Raymond T. (April 1992).
+ * The Euclidean definition of the functions div and mod.
+ * ACM Transactions on Programming Languages and Systems (TOPLAS)
+ * ACM Press. 14 (2): 127 - 144. doi:10.1145/128861.128862.
+ */
+ static void euclidianQR(Integer& q, Integer& r, const Integer& x, const Integer& y) {
+ // compute the floor and then fix the value up if needed.
+ floorQR(q,r,x,y);
+
+ if(r.strictlyNegative()){
+ // if r < 0
+ // abs(r) < abs(y)
+ // - abs(y) < r < 0, then 0 < r + abs(y) < abs(y)
+ // n = y * q + r
+ // n = y * q - abs(y) + r + abs(y)
+ if(r.sgn() >= 0){
+ // y = abs(y)
+ // n = y * q - y + r + y
+ // n = y * (q-1) + (r+y)
+ q -= 1;
+ r += y;
+ }else{
+ // y = -abs(y)
+ // n = y * q + y + r - y
+ // n = y * (q+1) + (r-y)
+ q += 1;
+ r -= y;
+ }
+ }
+ }
+ /**
+ * Returns the quoitent according to Boute's Euclidean definition.
+ * See the documentation for euclidianQR.
+ */
+ Integer euclidianDivideQuotient(const Integer& y) const {
+ Integer q,r;
+ euclidianQR(q,r, *this, y);
+ return q;
+ }
+
+ /**
+ * Returns the remainfing according to Boute's Euclidean definition.
+ * See the documentation for euclidianQR.
+ */
+ Integer euclidianDivideRemainder(const Integer& y) const {
+ Integer q,r;
+ euclidianQR(q,r, *this, y);
+ return r;
+ }
+
+
+ /**
+ * If y divides *this, then exactQuotient returns (this/y)
+ */
+ Integer exactQuotient(const Integer& y) const {
+ DebugCheckArgument(y.divides(*this), y);
+ mpz_class q;
+ mpz_divexact(q.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer( q );
+ }
+
+ /**
+ * Returns y mod 2^exp
+ */
+ Integer modByPow2(uint32_t exp) const {
+ mpz_class res;
+ mpz_fdiv_r_2exp(res.get_mpz_t(), d_value.get_mpz_t(), exp);
+ return Integer(res);
+ }
+
+ /**
+ * Returns y / 2^exp
+ */
+ Integer divByPow2(uint32_t exp) const {
+ mpz_class res;
+ mpz_fdiv_q_2exp(res.get_mpz_t(), d_value.get_mpz_t(), exp);
+ return Integer(res);
+ }
+
+
+ int sgn() const {
+ return mpz_sgn(d_value.get_mpz_t());
+ }
+
+ inline bool strictlyPositive() const {
+ return sgn() > 0;
+ }
+
+ inline bool strictlyNegative() const {
+ return sgn() < 0;
+ }
+
+ inline bool isZero() const {
+ return sgn() == 0;
+ }
+
+ bool isOne() const {
+ return mpz_cmp_si(d_value.get_mpz_t(), 1) == 0;
+ }
+
+ bool isNegativeOne() const {
+ return mpz_cmp_si(d_value.get_mpz_t(), -1) == 0;
+ }
+
+ /**
+ * Raise this Integer to the power <code>exp</code>.
+ *
+ * @param exp the exponent
+ */
+ Integer pow(unsigned long int exp) const {
+ mpz_class result;
+ mpz_pow_ui(result.get_mpz_t(),d_value.get_mpz_t(),exp);
+ return Integer( result );
+ }
+
+ /**
+ * Return the greatest common divisor of this integer with another.
+ */
+ Integer gcd(const Integer& y) const {
+ mpz_class result;
+ mpz_gcd(result.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer(result);
+ }
+
+ /**
+ * Return the least common multiple of this integer with another.
+ */
+ Integer lcm(const Integer& y) const {
+ mpz_class result;
+ mpz_lcm(result.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer(result);
+ }
+
+ /**
+ * All non-zero integers z, z.divide(0)
+ * ! zero.divides(zero)
+ */
+ bool divides(const Integer& y) const {
+ int res = mpz_divisible_p(y.d_value.get_mpz_t(), d_value.get_mpz_t());
+ return res != 0;
+ }
+
+ /**
+ * Return the absolute value of this integer.
+ */
+ Integer abs() const {
+ return d_value >= 0 ? *this : -*this;
+ }
+
+ std::string toString(int base = 10) const{
+ return d_value.get_str(base);
+ }
+
+ bool fitsSignedInt() const;
+
+ bool fitsUnsignedInt() const;
+
+ signed int getSignedInt() const;
+
+ unsigned int getUnsignedInt() const;
+
+ long getLong() const {
+ long si = d_value.get_si();
+ // ensure there wasn't overflow
+ CheckArgument(mpz_cmp_si(d_value.get_mpz_t(), si) == 0, this,
+ "Overflow detected in Integer::getLong()");
+ return si;
+ }
+ unsigned long getUnsignedLong() const {
+ unsigned long ui = d_value.get_ui();
+ // ensure there wasn't overflow
+ CheckArgument(mpz_cmp_ui(d_value.get_mpz_t(), ui) == 0, this,
+ "Overflow detected in Integer::getUnsignedLong()");
+ return ui;
+ }
+
+ /**
+ * Computes the hash of the node from the first word of the
+ * numerator, the denominator.
+ */
+ size_t hash() const {
+ return gmpz_hash(d_value.get_mpz_t());
+ }
+
+ /**
+ * Returns true iff bit n is set.
+ *
+ * @param n the bit to test (0 == least significant bit)
+ * @return true if bit n is set in this integer; false otherwise
+ */
+ bool testBit(unsigned n) const {
+ return mpz_tstbit(d_value.get_mpz_t(), n);
+ }
+
+ /**
+ * Returns k if the integer is equal to 2^(k-1)
+ * @return k if the integer is equal to 2^(k-1) and 0 otherwise
+ */
+ unsigned isPow2() const {
+ if (d_value <= 0) return 0;
+ // check that the number of ones in the binary representation is 1
+ if (mpz_popcount(d_value.get_mpz_t()) == 1) {
+ // return the index of the first one plus 1
+ return mpz_scan1(d_value.get_mpz_t(), 0) + 1;
+ }
+ return 0;
+ }
+
+
+ /**
+ * If x != 0, returns the smallest n s.t. 2^{n-1} <= abs(x) < 2^{n}.
+ * If x == 0, returns 1.
+ */
+ size_t length() const {
+ if(sgn() == 0){
+ return 1;
+ }else{
+ return mpz_sizeinbase(d_value.get_mpz_t(),2);
+ }
+ }
+
+ static void extendedGcd(Integer& g, Integer& s, Integer& t, const Integer& a, const Integer& b){
+ //see the documentation for:
+ //mpz_gcdext (mpz_t g, mpz_t s, mpz_t t, mpz_t a, mpz_t b);
+ mpz_gcdext (g.d_value.get_mpz_t(), s.d_value.get_mpz_t(), t.d_value.get_mpz_t(), a.d_value.get_mpz_t(), b.d_value.get_mpz_t());
+ }
+
+ /** Returns a reference to the minimum of two integers. */
+ static const Integer& min(const Integer& a, const Integer& b){
+ return (a <=b ) ? a : b;
+ }
+
+ /** Returns a reference to the maximum of two integers. */
+ static const Integer& max(const Integer& a, const Integer& b){
+ return (a >= b ) ? a : b;
+ }
+
+ friend class CVC4::Rational;
+};/* class Integer */
+
+struct IntegerHashFunction {
+ inline size_t operator()(const CVC4::Integer& i) const {
+ return i.hash();
+ }
+};/* struct IntegerHashFunction */
+
+inline std::ostream& operator<<(std::ostream& os, const Integer& n) {
+ return os << n.toString();
+}
+
+}/* CVC4 namespace */
+
+#endif /* __CVC4__INTEGER_H */
diff --git a/org.eclipse.efm.symbex/cmake/cvc4-1.4-patch/util/rational_gmp_imp.h b/org.eclipse.efm.symbex/cmake/cvc4-1.4-patch/util/rational_gmp_imp.h
new file mode 100644
index 0000000..89d0631
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/cvc4-1.4-patch/util/rational_gmp_imp.h
@@ -0,0 +1,356 @@
+/********************* */
+/*! \file rational_gmp_imp.h
+ ** \verbatim
+ ** Original author: Tim King
+ ** Major contributors: Morgan Deters
+ ** Minor contributors (to current version): Dejan Jovanovic
+ ** This file is part of the CVC4 project.
+ ** Copyright (c) 2009-2014 New York University and The University of Iowa
+ ** See the file COPYING in the top-level source directory for licensing
+ ** information.\endverbatim
+ **
+ ** \brief Multiprecision rational constants; wraps a GMP multiprecision
+ ** rational.
+ **
+ ** Multiprecision rational constants; wraps a GMP multiprecision rational.
+ **/
+
+#include "cvc4_public.h"
+
+#ifndef __CVC4__RATIONAL_H
+#define __CVC4__RATIONAL_H
+
+#include <gmp.h>
+#include <string>
+
+#include "util/integer.h"
+#include "util/exception.h"
+
+namespace CVC4 {
+
+class CVC4_PUBLIC RationalFromDoubleException : public Exception {
+public:
+ RationalFromDoubleException(double d) throw();
+};
+
+/**
+ ** A multi-precision rational constant.
+ ** This stores the rational as a pair of multi-precision integers,
+ ** one for the numerator and one for the denominator.
+ ** The number is always stored so that the gcd of the numerator and denominator
+ ** is 1. (This is referred to as referred to as canonical form in GMP's
+ ** literature.) A consequence is that that the numerator and denominator may be
+ ** different than the values used to construct the Rational.
+ **
+ ** NOTE: The correct way to create a Rational from an int is to use one of the
+ ** int numerator/int denominator constructors with the denominator 1. Trying
+ ** to construct a Rational with a single int, e.g., Rational(0), will put you
+ ** in danger of invoking the char* constructor, from whence you will segfault.
+ **/
+
+class CVC4_PUBLIC Rational {
+private:
+ /**
+ * Stores the value of the rational is stored in a C++ GMP rational class.
+ * Using this instead of mpq_t allows for easier destruction.
+ */
+ mpq_class d_value;
+
+public:
+
+ /**
+ * Constructs a Rational from a mpq_class object.
+ * Does a deep copy.
+ * Assumes that the value is in canonical form, and thus does not
+ * have to call canonicalize() on the value.
+ */
+ Rational(const mpq_class& val) : d_value(val) { }
+
+ /**
+ * Creates a rational from a decimal string (e.g., <code>"1.5"</code>).
+ *
+ * @param dec a string encoding a decimal number in the format
+ * <code>[0-9]*\.[0-9]*</code>
+ */
+ static Rational fromDecimal(const std::string& dec);
+
+ /** Constructs a rational with the value 0/1. */
+ Rational() : d_value(0){
+ d_value.canonicalize();
+ }
+
+ /**
+ * Constructs a Rational from a C string in a given base (defaults to 10).
+ * Throws std::invalid_argument if the string is not a valid rational.
+ * For more information about what is a valid rational string,
+ * see GMP's documentation for mpq_set_str().
+ */
+ explicit Rational(const char* s, unsigned base = 10): d_value(s, base) {
+ d_value.canonicalize();
+ }
+ Rational(const std::string& s, unsigned base = 10) : d_value(s, base) {
+ d_value.canonicalize();
+ }
+
+ /**
+ * Creates a Rational from another Rational, q, by performing a deep copy.
+ */
+ Rational(const Rational& q) : d_value(q.d_value) {
+ d_value.canonicalize();
+ }
+
+ /**
+ * Constructs a canonical Rational from a numerator.
+ */
+ Rational(signed int n) : d_value(n,1) {
+ d_value.canonicalize();
+ }
+ Rational(unsigned int n) : d_value(n,1) {
+ d_value.canonicalize();
+ }
+ Rational(signed long int n) : d_value(n,1) {
+ d_value.canonicalize();
+ }
+ Rational(unsigned long int n) : d_value(n,1) {
+ d_value.canonicalize();
+ }
+
+#ifdef CVC4_NEED_INT64_T_OVERLOADS
+ Rational(int64_t n) : d_value(static_cast<long>(n), 1) {
+ d_value.canonicalize();
+ }
+ Rational(uint64_t n) : d_value(static_cast<unsigned long>(n), 1) {
+ d_value.canonicalize();
+ }
+#endif /* CVC4_NEED_INT64_T_OVERLOADS */
+
+ /**
+ * Constructs a canonical Rational from a numerator and denominator.
+ */
+ Rational(signed int n, signed int d) : d_value(n,d) {
+ d_value.canonicalize();
+ }
+ Rational(unsigned int n, unsigned int d) : d_value(n,d) {
+ d_value.canonicalize();
+ }
+ Rational(signed long int n, signed long int d) : d_value(n,d) {
+ d_value.canonicalize();
+ }
+ Rational(unsigned long int n, unsigned long int d) : d_value(n,d) {
+ d_value.canonicalize();
+ }
+
+#ifdef CVC4_NEED_INT64_T_OVERLOADS
+ Rational(int64_t n, int64_t d) : d_value(static_cast<long>(n), static_cast<long>(d)) {
+ d_value.canonicalize();
+ }
+ Rational(uint64_t n, uint64_t d) : d_value(static_cast<unsigned long>(n), static_cast<unsigned long>(d)) {
+ d_value.canonicalize();
+ }
+#endif /* CVC4_NEED_INT64_T_OVERLOADS */
+
+ Rational(const Integer& n, const Integer& d) :
+ d_value(n.get_mpz(), d.get_mpz())
+ {
+ d_value.canonicalize();
+ }
+ Rational(const Integer& n) :
+ d_value(n.get_mpz())
+ {
+ d_value.canonicalize();
+ }
+ ~Rational() {}
+
+ /**
+ * Gets a reference to the gmp data that backs up the rational.
+ * Only accessible to friend classes.
+ */
+ const mpq_class& get_mpq() const { return d_value; }
+
+ /**
+ * Returns the value of numerator of the Rational.
+ * Note that this makes a deep copy of the numerator.
+ */
+ Integer getNumerator() const {
+ return Integer(d_value.get_num());
+ }
+
+ /**
+ * Returns the value of denominator of the Rational.
+ * Note that this makes a deep copy of the denominator.
+ */
+ Integer getDenominator() const {
+ return Integer(d_value.get_den());
+ }
+
+ static Rational fromDouble(double d) throw(RationalFromDoubleException);
+
+ /**
+ * Get a double representation of this Rational, which is
+ * approximate: truncation may occur, overflow may result in
+ * infinity, and underflow may result in zero.
+ */
+ double getDouble() const {
+ return d_value.get_d();
+ }
+
+ Rational inverse() const {
+ return Rational(getDenominator(), getNumerator());
+ }
+
+ int cmp(const Rational& x) const {
+ //Don't use mpq_class's cmp() function.
+ //The name ends up conflicting with this function.
+ return mpq_cmp(d_value.get_mpq_t(), x.d_value.get_mpq_t());
+ }
+
+ int sgn() const {
+ return mpq_sgn(d_value.get_mpq_t());
+ }
+
+ bool isZero() const {
+ return sgn() == 0;
+ }
+
+ bool isOne() const {
+ return mpq_cmp_si(d_value.get_mpq_t(), 1, 1) == 0;
+ }
+
+ bool isNegativeOne() const {
+ return mpq_cmp_si(d_value.get_mpq_t(), -1, 1) == 0;
+ }
+
+ Rational abs() const {
+ if(sgn() < 0){
+ return -(*this);
+ }else{
+ return *this;
+ }
+ }
+
+ Integer floor() const {
+ mpz_class q;
+ mpz_fdiv_q(q.get_mpz_t(), d_value.get_num_mpz_t(), d_value.get_den_mpz_t());
+ return Integer(q);
+ }
+
+ Integer ceiling() const {
+ mpz_class q;
+ mpz_cdiv_q(q.get_mpz_t(), d_value.get_num_mpz_t(), d_value.get_den_mpz_t());
+ return Integer(q);
+ }
+
+ Rational floor_frac() const {
+ return (*this) - Rational(floor());
+ }
+
+ Rational& operator=(const Rational& x){
+ if(this == &x) return *this;
+ d_value = x.d_value;
+ return *this;
+ }
+
+ Rational operator-() const{
+ return Rational(-(d_value));
+ }
+
+ bool operator==(const Rational& y) const {
+ return d_value == y.d_value;
+ }
+
+ bool operator!=(const Rational& y) const {
+ return d_value != y.d_value;
+ }
+
+ bool operator< (const Rational& y) const {
+ return d_value < y.d_value;
+ }
+
+ bool operator<=(const Rational& y) const {
+ return d_value <= y.d_value;
+ }
+
+ bool operator> (const Rational& y) const {
+ return d_value > y.d_value;
+ }
+
+ bool operator>=(const Rational& y) const {
+ return d_value >= y.d_value;
+ }
+
+ Rational operator+(const Rational& y) const{
+ return Rational( d_value + y.d_value );
+ }
+ Rational operator-(const Rational& y) const {
+ return Rational( d_value - y.d_value );
+ }
+
+ Rational operator*(const Rational& y) const {
+ return Rational( d_value * y.d_value );
+ }
+ Rational operator/(const Rational& y) const {
+ return Rational( d_value / y.d_value );
+ }
+
+ Rational& operator+=(const Rational& y){
+ d_value += y.d_value;
+ return (*this);
+ }
+ Rational& operator-=(const Rational& y){
+ d_value -= y.d_value;
+ return (*this);
+ }
+
+ Rational& operator*=(const Rational& y){
+ d_value *= y.d_value;
+ return (*this);
+ }
+
+ Rational& operator/=(const Rational& y){
+ d_value /= y.d_value;
+ return (*this);
+ }
+
+ bool isIntegral() const{
+ return getDenominator() == 1;
+ }
+
+ /** Returns a string representing the rational in the given base. */
+ std::string toString(int base = 10) const {
+ return d_value.get_str(base);
+ }
+
+ /**
+ * Computes the hash of the rational from hashes of the numerator and the
+ * denominator.
+ */
+ size_t hash() const {
+ size_t numeratorHash = gmpz_hash(d_value.get_num_mpz_t());
+ size_t denominatorHash = gmpz_hash(d_value.get_den_mpz_t());
+
+ return numeratorHash xor denominatorHash;
+ }
+
+ uint32_t complexity() const {
+ uint32_t numLen = getNumerator().length();
+ uint32_t denLen = getDenominator().length();
+ return numLen + denLen;
+ }
+
+ /** Equivalent to calling (this->abs()).cmp(b.abs()) */
+ int absCmp(const Rational& q) const;
+
+};/* class Rational */
+
+struct RationalHashFunction {
+ inline size_t operator()(const CVC4::Rational& r) const {
+ return r.hash();
+ }
+};/* struct RationalHashFunction */
+
+CVC4_PUBLIC std::ostream& operator<<(std::ostream& os, const Rational& n);
+
+}/* CVC4 namespace */
+
+#endif /* __CVC4__RATIONAL_H */
+
diff --git a/org.eclipse.efm.symbex/cmake/cvc4-master-patch/config/boost-v2.m4 b/org.eclipse.efm.symbex/cmake/cvc4-master-patch/config/boost-v2.m4
new file mode 100644
index 0000000..27d063f
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/cvc4-master-patch/config/boost-v2.m4
@@ -0,0 +1,1560 @@
+# boost.m4: Locate Boost headers and libraries for autoconf-based projects.
+# Copyright (C) 2007-2011, 2014 Benoit Sigoure <tsuna@lrde.epita.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Additional permission under section 7 of the GNU General Public
+# License, version 3 ("GPLv3"):
+#
+# If you convey this file as part of a work that contains a
+# configuration script generated by Autoconf, you may do so under
+# terms of your choice.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+m4_define([_BOOST_SERIAL], [m4_translit([
+# serial 25
+], [#
+], [])])
+
+# Original sources can be found at http://github.com/tsuna/boost.m4
+# You can fetch the latest version of the script by doing:
+# wget http://github.com/tsuna/boost.m4/raw/master/build-aux/boost.m4
+
+# ------ #
+# README #
+# ------ #
+
+# This file provides several macros to use the various Boost libraries.
+# The first macro is BOOST_REQUIRE. It will simply check if it's possible to
+# find the Boost headers of a given (optional) minimum version and it will
+# define BOOST_CPPFLAGS accordingly. It will add an option --with-boost to
+# your configure so that users can specify non standard locations.
+# If the user's environment contains BOOST_ROOT and --with-boost was not
+# specified, --with-boost=$BOOST_ROOT is implicitly used.
+# For more README and documentation, go to http://github.com/tsuna/boost.m4
+# Note: THESE MACROS ASSUME THAT YOU USE LIBTOOL. If you don't, don't worry,
+# simply read the README, it will show you what to do step by step.
+
+m4_pattern_forbid([^_?(BOOST|Boost)_])
+
+
+# _BOOST_SED_CPP(SED-PROGRAM, PROGRAM,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# --------------------------------------------------------
+# Same as AC_EGREP_CPP, but leave the result in conftest.i.
+#
+# SED-PROGRAM is *not* overquoted, as in AC_EGREP_CPP. It is expanded
+# in double-quotes, so escape your double quotes.
+#
+# It could be useful to turn this into a macro which extracts the
+# value of any macro.
+m4_define([_BOOST_SED_CPP],
+[AC_LANG_PUSH([C++])dnl
+AC_LANG_PREPROC_REQUIRE()dnl
+AC_REQUIRE([AC_PROG_SED])dnl
+AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])])
+AS_IF([dnl eval is necessary to expand ac_cpp.
+dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
+dnl Beware of Windows end-of-lines, for instance if we are running
+dnl some Windows programs under Wine. In that case, boost/version.hpp
+dnl is certainly using "\r\n", but the regular Unix shell will only
+dnl strip `\n' with backquotes, not the `\r'. This results in
+dnl boost_cv_lib_version='1_37\r' for instance, which breaks
+dnl everything else.
+dnl Cannot use 'dnl' after [$4] because a trailing dnl may break AC_CACHE_CHECK
+dnl
+dnl Beware that GCC 5, when expanding macros, may embed # line directives
+dnl a within single line:
+dnl
+dnl # 1 "conftest.cc"
+dnl # 1 "<built-in>"
+dnl # 1 "<command-line>"
+dnl # 1 "conftest.cc"
+dnl # 1 "/opt/local/include/boost/version.hpp" 1 3
+dnl # 2 "conftest.cc" 2
+dnl boost-lib-version =
+dnl # 2 "conftest.cc" 3
+dnl "1_56"
+dnl
+dnl So get rid of the # lines, and glue the remaining ones together.
+(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+ grep -v '#' |
+ tr -d '\r' |
+ tr -s '\n' ' ' |
+ $SED -n -e "$1" >conftest.i 2>&1],
+ [$3],
+ [$4])
+rm -rf conftest*
+AC_LANG_POP([C++])dnl
+])# _BOOST_SED_CPP
+
+
+
+# BOOST_REQUIRE([VERSION], [ACTION-IF-NOT-FOUND])
+# -----------------------------------------------
+# Look for Boost. If version is given, it must either be a literal of the form
+# "X.Y.Z" where X, Y and Z are integers (the ".Z" part being optional) or a
+# variable "$var".
+# Defines the value BOOST_CPPFLAGS. This macro only checks for headers with
+# the required version, it does not check for any of the Boost libraries.
+# On # success, defines HAVE_BOOST. On failure, calls the optional
+# ACTION-IF-NOT-FOUND action if one was supplied.
+# Otherwise aborts with an error message.
+AC_DEFUN_ONCE([BOOST_REQUIRE],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_PROG_GREP])dnl
+echo "$as_me: this is boost.m4[]_BOOST_SERIAL" >&AS_MESSAGE_LOG_FD
+boost_save_IFS=$IFS
+boost_version_req=$1
+IFS=.
+set x $boost_version_req 0 0 0
+IFS=$boost_save_IFS
+shift
+boost_version_req=`expr "$[1]" '*' 100000 + "$[2]" '*' 100 + "$[3]"`
+boost_version_req_string=$[1].$[2].$[3]
+AC_ARG_WITH([boost],
+ [AS_HELP_STRING([--with-boost=DIR],
+ [prefix of Boost $1 @<:@guess@:>@])])dnl
+AC_ARG_VAR([BOOST_ROOT],[Location of Boost installation])dnl
+# If BOOST_ROOT is set and the user has not provided a value to
+# --with-boost, then treat BOOST_ROOT as if it the user supplied it.
+if test x"$BOOST_ROOT" != x; then
+ if test x"$with_boost" = x; then
+ AC_MSG_NOTICE([Detected BOOST_ROOT; continuing with --with-boost=$BOOST_ROOT])
+ with_boost=$BOOST_ROOT
+ else
+ AC_MSG_NOTICE([Detected BOOST_ROOT=$BOOST_ROOT, but overridden by --with-boost=$with_boost])
+ fi
+fi
+AC_SUBST([DISTCHECK_CONFIGURE_FLAGS],
+ ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"])dnl
+boost_save_CPPFLAGS=$CPPFLAGS
+ AC_CACHE_CHECK([for Boost headers version >= $boost_version_req_string],
+ [boost_cv_inc_path],
+ [boost_cv_inc_path=no
+AC_LANG_PUSH([C++])dnl
+m4_pattern_allow([^BOOST_VERSION$])dnl
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#include <boost/version.hpp>
+#if !defined BOOST_VERSION
+# error BOOST_VERSION is not defined
+#elif BOOST_VERSION < $boost_version_req
+# error Boost headers version < $boost_version_req
+#endif
+]])])
+ # If the user provided a value to --with-boost, use it and only it.
+ case $with_boost in #(
+ ''|yes) set x '' /opt/local/include /usr/local/include /opt/include \
+ /usr/include C:/Boost/include;; #(
+ *) set x "$with_boost/include" "$with_boost";;
+ esac
+ shift
+ for boost_dir
+ do
+ # Without --layout=system, Boost (or at least some versions) installs
+ # itself in <prefix>/include/boost-<version>. This inner loop helps to
+ # find headers in such directories.
+ #
+ # Any ${boost_dir}/boost-x_xx directories are searched in reverse version
+ # order followed by ${boost_dir}. The final '.' is a sentinel for
+ # searching $boost_dir" itself. Entries are whitespace separated.
+ #
+ # I didn't indent this loop on purpose (to avoid over-indented code)
+ boost_layout_system_search_list=`cd "$boost_dir" 2>/dev/null \
+ && ls -1 | "${GREP}" '^boost-' | sort -rn -t- -k2 \
+ && echo .`
+ for boost_inc in $boost_layout_system_search_list
+ do
+ if test x"$boost_inc" != x.; then
+ boost_inc="$boost_dir/$boost_inc"
+ else
+ boost_inc="$boost_dir" # Uses sentinel in boost_layout_system_search_list
+ fi
+ if test x"$boost_inc" != x; then
+ # We are going to check whether the version of Boost installed
+ # in $boost_inc is usable by running a compilation that
+ # #includes it. But if we pass a -I/some/path in which Boost
+ # is not installed, the compiler will just skip this -I and
+ # use other locations (either from CPPFLAGS, or from its list
+ # of system include directories). As a result we would use
+ # header installed on the machine instead of the /some/path
+ # specified by the user. So in that precise case (trying
+ # $boost_inc), make sure the version.hpp exists.
+ #
+ # Use test -e as there can be symlinks.
+ test -e "$boost_inc/boost/version.hpp" || continue
+ CPPFLAGS="$CPPFLAGS -I$boost_inc"
+ fi
+ AC_COMPILE_IFELSE([], [boost_cv_inc_path=yes], [boost_cv_version=no])
+ if test x"$boost_cv_inc_path" = xyes; then
+ if test x"$boost_inc" != x; then
+ boost_cv_inc_path=$boost_inc
+ fi
+ break 2
+ fi
+ done
+ done
+AC_LANG_POP([C++])dnl
+ ])
+ case $boost_cv_inc_path in #(
+ no)
+ boost_errmsg="cannot find Boost headers version >= $boost_version_req_string"
+ m4_if([$2], [], [AC_MSG_ERROR([$boost_errmsg])],
+ [AC_MSG_NOTICE([$boost_errmsg])])
+ $2
+ ;;#(
+ yes)
+ BOOST_CPPFLAGS=
+ ;;#(
+ *)
+ AC_SUBST([BOOST_CPPFLAGS], ["-I$boost_cv_inc_path"])dnl
+ ;;
+ esac
+ if test x"$boost_cv_inc_path" != xno; then
+ AC_DEFINE([HAVE_BOOST], [1],
+ [Defined if the requested minimum BOOST version is satisfied])
+ AC_CACHE_CHECK([for Boost's header version],
+ [boost_cv_lib_version],
+ [m4_pattern_allow([^BOOST_LIB_VERSION$])dnl
+ _BOOST_SED_CPP([[/^boost-lib-version = /{s///;s/[\" ]//g;p;q;}]],
+ [#include <boost/version.hpp>
+boost-lib-version = BOOST_LIB_VERSION],
+ [boost_cv_lib_version=`cat conftest.i`])])
+ # e.g. "134" for 1_34_1 or "135" for 1_35
+ boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'`
+ case $boost_major_version in #(
+ '' | *[[!0-9]]*)
+ AC_MSG_ERROR([invalid value: boost_major_version='$boost_major_version'])
+ ;;
+ esac
+fi
+CPPFLAGS=$boost_save_CPPFLAGS
+])# BOOST_REQUIRE
+
+
+# BOOST_STATIC()
+# --------------
+# Add the "--enable-static-boost" configure argument. If this argument is given
+# on the command line, static versions of the libraries will be looked up.
+AC_DEFUN([BOOST_STATIC],
+ [AC_ARG_ENABLE([static-boost],
+ [AS_HELP_STRING([--enable-static-boost],
+ [Prefer the static boost libraries over the shared ones [no]])],
+ [enable_static_boost=yes],
+ [enable_static_boost=no])])# BOOST_STATIC
+
+
+# BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND])
+# --------------------------------------------------------------------------
+# Wrapper around AC_CHECK_HEADER for Boost headers. Useful to check for
+# some parts of the Boost library which are only made of headers and don't
+# require linking (such as Boost.Foreach).
+#
+# Default ACTION-IF-NOT-FOUND: Fail with a fatal error unless Boost couldn't be
+# found in the first place, in which case by default a notice is issued to the
+# user. Presumably if we haven't died already it's because it's OK to not have
+# Boost, which is why only a notice is issued instead of a hard error.
+#
+# Default ACTION-IF-FOUND: define the preprocessor symbol HAVE_<HEADER-NAME> in
+# case of success # (where HEADER-NAME is written LIKE_THIS, e.g.,
+# HAVE_BOOST_FOREACH_HPP).
+AC_DEFUN([BOOST_FIND_HEADER],
+[AC_REQUIRE([BOOST_REQUIRE])dnl
+if test x"$boost_cv_inc_path" = xno; then
+ m4_default([$2], [AC_MSG_NOTICE([Boost not available, not searching for $1])])
+else
+AC_LANG_PUSH([C++])dnl
+boost_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+AC_CHECK_HEADER([$1],
+ [m4_default([$3], [AC_DEFINE(AS_TR_CPP([HAVE_$1]), [1],
+ [Define to 1 if you have <$1>])])],
+ [m4_default([$2], [AC_MSG_ERROR([cannot find $1])])])
+CPPFLAGS=$boost_save_CPPFLAGS
+AC_LANG_POP([C++])dnl
+fi
+])# BOOST_FIND_HEADER
+
+
+# BOOST_FIND_LIBS([COMPONENT-NAME], [CANDIDATE-LIB-NAMES],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Look for the Boost library COMPONENT-NAME (e.g., `thread', for
+# libboost_thread) under the possible CANDIDATE-LIB-NAMES (e.g.,
+# "thread_win32 thread"). Check that HEADER-NAME works and check that
+# libboost_LIB-NAME can link with the code CXX-TEST. The optional
+# argument CXX-PROLOGUE can be used to include some C++ code before
+# the `main' function.
+#
+# Invokes BOOST_FIND_HEADER([HEADER-NAME]) (see above).
+#
+# Boost libraries typically come compiled with several flavors (with different
+# runtime options) so PREFERRED-RT-OPT is the preferred suffix. A suffix is one
+# or more of the following letters: sgdpn (in that order). s = static
+# runtime, d = debug build, g = debug/diagnostic runtime, p = STLPort build,
+# n = (unsure) STLPort build without iostreams from STLPort (it looks like `n'
+# must always be used along with `p'). Additionally, PREFERRED-RT-OPT can
+# start with `mt-' to indicate that there is a preference for multi-thread
+# builds. Some sample values for PREFERRED-RT-OPT: (nothing), mt, d, mt-d, gdp
+# ... If you want to make sure you have a specific version of Boost
+# (eg, >= 1.33) you *must* invoke BOOST_REQUIRE before this macro.
+AC_DEFUN([BOOST_FIND_LIBS],
+[AC_REQUIRE([BOOST_REQUIRE])dnl
+AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl
+AC_REQUIRE([BOOST_STATIC])dnl
+AC_REQUIRE([_BOOST_GUESS_WHETHER_TO_USE_MT])dnl
+if test x"$boost_cv_inc_path" = xno; then
+ AC_MSG_NOTICE([Boost not available, not searching for the Boost $1 library])
+else
+dnl The else branch is huge and wasn't intended on purpose.
+AC_LANG_PUSH([C++])dnl
+AS_VAR_PUSHDEF([Boost_lib], [boost_cv_lib_$1])dnl
+AS_VAR_PUSHDEF([Boost_lib_LDFLAGS], [boost_cv_lib_$1_LDFLAGS])dnl
+AS_VAR_PUSHDEF([Boost_lib_LDPATH], [boost_cv_lib_$1_LDPATH])dnl
+AS_VAR_PUSHDEF([Boost_lib_LIBS], [boost_cv_lib_$1_LIBS])dnl
+BOOST_FIND_HEADER([$4])
+boost_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib],
+ [_BOOST_FIND_LIBS($@)])
+case $Boost_lib in #(
+ (no) _AC_MSG_LOG_CONFTEST
+ AC_MSG_ERROR([cannot find the flags to link with Boost $1])
+ ;;
+esac
+AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS])dnl
+AC_SUBST(AS_TR_CPP([BOOST_$1_LDPATH]), [$Boost_lib_LDPATH])dnl
+AC_SUBST([BOOST_LDPATH], [$Boost_lib_LDPATH])dnl
+AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS])dnl
+CPPFLAGS=$boost_save_CPPFLAGS
+AS_VAR_POPDEF([Boost_lib])dnl
+AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl
+AS_VAR_POPDEF([Boost_lib_LDPATH])dnl
+AS_VAR_POPDEF([Boost_lib_LIBS])dnl
+AC_LANG_POP([C++])dnl
+fi
+])
+
+
+# BOOST_FIND_LIB([LIB-NAME],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Backward compatibility wrapper for BOOST_FIND_LIBS.
+AC_DEFUN([BOOST_FIND_LIB],
+[BOOST_FIND_LIBS([$1], $@)])
+
+
+# _BOOST_FIND_LIBS([LIB-NAME], [CANDIDATE-LIB-NAMES],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Real implementation of BOOST_FIND_LIBS: rely on these local macros:
+# Boost_lib, Boost_lib_LDFLAGS, Boost_lib_LDPATH, Boost_lib_LIBS
+#
+# The algorithm is as follows: first look for a given library name
+# according to the user's PREFERRED-RT-OPT. For each library name, we
+# prefer to use the ones that carry the tag (toolset name). Each
+# library is searched through the various standard paths were Boost is
+# usually installed. If we can't find the standard variants, we try
+# to enforce -mt (for instance on MacOSX, libboost_thread.dylib
+# doesn't exist but there's -obviously- libboost_thread-mt.dylib).
+AC_DEFUN([_BOOST_FIND_LIBS],
+[Boost_lib=no
+ case "$3" in #(
+ (mt | mt-) boost_mt=-mt; boost_rtopt=;; #(
+ (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$3" : 'Xmt-*\(.*\)'`;; #(
+ (*) boost_mt=; boost_rtopt=$3;;
+ esac
+ if test $enable_static_boost = yes; then
+ boost_rtopt="s$boost_rtopt"
+ fi
+ # Find the proper debug variant depending on what we've been asked to find.
+ case $boost_rtopt in #(
+ (*d*) boost_rt_d=$boost_rtopt;; #(
+ (*[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn')
+ boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #(
+ (*) boost_rt_d='-d';;
+ esac
+ # If the PREFERRED-RT-OPT are not empty, prepend a `-'.
+ test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt"
+ $boost_guess_use_mt && boost_mt=-mt
+ # Look for the abs path the static archive.
+ # $libext is computed by Libtool but let's make sure it's non empty.
+ test -z "$libext" &&
+ AC_MSG_ERROR([the libext variable is empty, did you invoke Libtool?])
+ boost_save_ac_objext=$ac_objext
+ # Generate the test file.
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$4>
+$6], [$5])])
+dnl Optimization hacks: compiling C++ is slow, especially with Boost. What
+dnl we're trying to do here is guess the right combination of link flags
+dnl (LIBS / LDFLAGS) to use a given library. This can take several
+dnl iterations before it succeeds and is thus *very* slow. So what we do
+dnl instead is that we compile the code first (and thus get an object file,
+dnl typically conftest.o). Then we try various combinations of link flags
+dnl until we succeed to link conftest.o in an executable. The problem is
+dnl that the various TRY_LINK / COMPILE_IFELSE macros of Autoconf always
+dnl remove all the temporary files including conftest.o. So the trick here
+dnl is to temporarily change the value of ac_objext so that conftest.o is
+dnl preserved accross tests. This is obviously fragile and I will burn in
+dnl hell for not respecting Autoconf's documented interfaces, but in the
+dnl mean time, it optimizes the macro by a factor of 5 to 30.
+dnl Another small optimization: the first argument of AC_COMPILE_IFELSE left
+dnl empty because the test file is generated only once above (before we
+dnl start the for loops).
+ AC_COMPILE_IFELSE([],
+ [ac_objext=do_not_rm_me_plz],
+ [AC_MSG_ERROR([cannot compile a test that uses Boost $1])])
+ ac_objext=$boost_save_ac_objext
+ boost_failed_libs=
+# Don't bother to ident the following nested for loops, only the 2
+# innermost ones matter.
+for boost_lib_ in $2; do
+for boost_tag_ in -$boost_cv_lib_tag ''; do
+for boost_ver_ in -$boost_cv_lib_version ''; do
+for boost_mt_ in $boost_mt -mt ''; do
+for boost_rtopt_ in $boost_rtopt '' -d; do
+ for boost_lib in \
+ boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_ver_
+ do
+ # Avoid testing twice the same lib
+ case $boost_failed_libs in #(
+ (*@$boost_lib@*) continue;;
+ esac
+ # If with_boost is empty, we'll search in /lib first, which is not quite
+ # right so instead we'll try to a location based on where the headers are.
+ boost_tmp_lib=$with_boost
+ test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include}
+ for boost_ldpath in "$boost_tmp_lib/lib" '' \
+ /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \
+ "$with_boost" C:/Boost/lib /lib*
+ do
+ # Don't waste time with directories that don't exist.
+ if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then
+ continue
+ fi
+ boost_save_LDFLAGS=$LDFLAGS
+ # Are we looking for a static library?
+ case $boost_ldpath:$boost_rtopt_ in #(
+ (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt)
+ Boost_lib_LIBS="$boost_ldpath/lib$boost_lib.$libext"
+ test -e "$Boost_lib_LIBS" || continue;; #(
+ (*) # No: use -lboost_foo to find the shared library.
+ Boost_lib_LIBS="-l$boost_lib";;
+ esac
+ boost_save_LIBS=$LIBS
+ LIBS="$Boost_lib_LIBS $LIBS"
+ test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath"
+dnl First argument of AC_LINK_IFELSE left empty because the test file is
+dnl generated only once above (before we start the for loops).
+ _BOOST_AC_LINK_IFELSE([],
+ [Boost_lib=yes], [Boost_lib=no])
+ ac_objext=$boost_save_ac_objext
+ LDFLAGS=$boost_save_LDFLAGS
+ LIBS=$boost_save_LIBS
+ if test x"$Boost_lib" = xyes; then
+ # Check or used cached result of whether or not using -R or
+ # -rpath makes sense. Some implementations of ld, such as for
+ # Mac OSX, require -rpath but -R is the flag known to work on
+ # other systems. https://github.com/tsuna/boost.m4/issues/19
+ AC_CACHE_VAL([boost_cv_rpath_link_ldflag],
+ [case $boost_ldpath in
+ '') # Nothing to do.
+ boost_cv_rpath_link_ldflag=
+ boost_rpath_link_ldflag_found=yes;;
+ *)
+ for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do
+ LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
+ LIBS="$boost_save_LIBS $Boost_lib_LIBS"
+ _BOOST_AC_LINK_IFELSE([],
+ [boost_rpath_link_ldflag_found=yes
+ break],
+ [boost_rpath_link_ldflag_found=no])
+ done
+ ;;
+ esac
+ AS_IF([test "x$boost_rpath_link_ldflag_found" != "xyes"],
+ [AC_MSG_ERROR([Unable to determine whether to use -R or -rpath])])
+ LDFLAGS=$boost_save_LDFLAGS
+ LIBS=$boost_save_LIBS
+ ])
+ test x"$boost_ldpath" != x &&
+ Boost_lib_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
+ Boost_lib_LDPATH="$boost_ldpath"
+ break 7
+ else
+ boost_failed_libs="$boost_failed_libs@$boost_lib@"
+ fi
+ done
+ done
+done
+done
+done
+done
+done # boost_lib_
+rm -f conftest.$ac_objext
+])
+
+
+
+# --------------------------------------- #
+# Checks for the various Boost libraries. #
+# --------------------------------------- #
+
+# List of boost libraries: http://www.boost.org/libs/libraries.htm
+# The page http://beta.boost.org/doc/libs is useful: it gives the first release
+# version of each library (among other things).
+
+# BOOST_DEFUN(LIBRARY, CODE)
+# --------------------------
+# Define BOOST_<LIBRARY-UPPERCASE> as a macro that runs CODE.
+#
+# Use indir to avoid the warning on underquoted macro name given to AC_DEFUN.
+m4_define([BOOST_DEFUN],
+[m4_indir([AC_DEFUN],
+ m4_toupper([BOOST_$1]),
+[m4_pushdef([BOOST_Library], [$1])dnl
+$2
+m4_popdef([BOOST_Library])dnl
+])
+])
+
+# BOOST_ARRAY()
+# -------------
+# Look for Boost.Array
+BOOST_DEFUN([Array],
+[BOOST_FIND_HEADER([boost/array.hpp])])
+
+
+# BOOST_ASIO()
+# ------------
+# Look for Boost.Asio (new in Boost 1.35).
+BOOST_DEFUN([Asio],
+[AC_REQUIRE([BOOST_SYSTEM])dnl
+BOOST_FIND_HEADER([boost/asio.hpp])])
+
+
+# BOOST_BIND()
+# ------------
+# Look for Boost.Bind.
+BOOST_DEFUN([Bind],
+[BOOST_FIND_HEADER([boost/bind.hpp])])
+
+
+# BOOST_CHRONO()
+# --------------
+# Look for Boost.Chrono.
+BOOST_DEFUN([Chrono],
+[# Do we have to check for Boost.System? This link-time dependency was
+# added as of 1.35.0. If we have a version <1.35, we must not attempt to
+# find Boost.System as it didn't exist by then.
+if test $boost_major_version -ge 135; then
+ BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+boost_filesystem_save_LIBS=$LIBS
+boost_filesystem_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([chrono], [$1],
+ [boost/chrono.hpp],
+ [boost::chrono::thread_clock d;])
+if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
+ BOOST_CHRONO_LIBS="$BOOST_CHRONO_LIBS $BOOST_SYSTEM_LIBS"
+fi
+LIBS=$boost_filesystem_save_LIBS
+LDFLAGS=$boost_filesystem_save_LDFLAGS
+])# BOOST_CHRONO
+
+
+# BOOST_CONTEXT([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Context. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+#
+# * This library was introduced in Boost 1.51.0
+# * The signatures of make_fcontext() and jump_fcontext were changed in 1.56.0
+# * A dependency on boost_thread appears in 1.57.0
+BOOST_DEFUN([Context],
+[boost_context_save_LIBS=$LIBS
+ boost_context_save_LDFLAGS=$LDFLAGS
+if test $boost_major_version -ge 157; then
+ BOOST_THREAD([$1])
+ m4_pattern_allow([^BOOST_THREAD_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_THREAD_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_THREAD_LDFLAGS"
+fi
+BOOST_FIND_LIB([context], [$1],
+ [boost/context/all.hpp],[[
+
+// creates a stack
+void * stack_pointer = new void*[4096];
+std::size_t const size = sizeof(void*[4096]);
+
+#if BOOST_VERSION <= 105100
+ctx::make_fcontext(&fc, f);
+return ctx::jump_fcontext(&fcm, &fc, 3) == 6;
+
+#else
+
+fc = ctx::make_fcontext(stack_pointer, size, f);
+return ctx::jump_fcontext(&fcm, fc, 3) == 6;
+
+#endif
+
+
+]],[dnl
+
+#include <boost/version.hpp>
+#if BOOST_VERSION <= 105100
+
+namespace ctx = boost::ctx;
+
+static ctx::fcontext_t fcm, fc;
+
+static void f(intptr_t i) {
+ ctx::jump_fcontext(&fc, &fcm, i * 2);
+}
+
+#elif BOOST_VERSION <= 105500
+
+namespace ctx = boost::context;
+
+// context
+static ctx::fcontext_t fcm, *fc;
+
+// context-function
+static void f(intptr_t i) {
+ ctx::jump_fcontext(fc, &fcm, i * 2);
+}
+
+#else
+
+namespace ctx = boost::context;
+
+// context
+static ctx::fcontext_t fcm, fc;
+
+// context-function
+static void f(intptr_t i) {
+ ctx::jump_fcontext(&fc, fcm, i * 2);
+}
+#endif
+])
+LIBS=$boost_context_save_LIBS
+LDFLAGS=$boost_context_save_LDFLAGS
+])# BOOST_CONTEXT
+
+
+# BOOST_CONVERSION()
+# ------------------
+# Look for Boost.Conversion (cast / lexical_cast)
+BOOST_DEFUN([Conversion],
+[BOOST_FIND_HEADER([boost/cast.hpp])
+BOOST_FIND_HEADER([boost/lexical_cast.hpp])
+])# BOOST_CONVERSION
+
+
+# BOOST_COROUTINE([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Coroutine. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. This library was introduced in Boost
+# 1.53.0
+BOOST_DEFUN([Coroutine],
+[
+boost_coroutine_save_LIBS=$LIBS
+boost_coroutine_save_LDFLAGS=$LDFLAGS
+# Link-time dependency from coroutine to context
+BOOST_CONTEXT([$1])
+# Starting from Boost 1.55 a dependency on Boost.System is added
+if test $boost_major_version -ge 155; then
+ BOOST_SYSTEM([$1])
+fi
+m4_pattern_allow([^BOOST_(CONTEXT|SYSTEM)_(LIBS|LDFLAGS)])
+LIBS="$LIBS $BOOST_CONTEXT_LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_CONTEXT_LDFLAGS"
+
+# in 1.53 coroutine was a header only library
+if test $boost_major_version -eq 153; then
+ BOOST_FIND_HEADER([boost/coroutine/coroutine.hpp])
+else
+ BOOST_FIND_LIB([coroutine], [$1],
+ [boost/coroutine/coroutine.hpp],
+ [
+ #include <boost/version.hpp>
+ #if BOOST_VERSION <= 105500
+ boost::coroutines::coroutine<int(int)> coro; coro.get();
+ #else
+ boost::coroutines::asymmetric_coroutine<int>::pull_type coro; coro.get();
+ #endif
+ ])
+fi
+# Link-time dependency from coroutine to context, existed only in 1.53, in 1.54
+# coroutine doesn't use context from its headers but from its library.
+if test $boost_major_version -eq 153 || test $enable_static_boost = yes && test $boost_major_version -ge 154; then
+ BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_CONTEXT_LIBS"
+ BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_CONTEXT_LDFLAGS"
+fi
+if test $enable_static_boost = yes && test $boost_major_version -ge 155; then
+ BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_SYSTEM_LIBS"
+ BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+fi
+LIBS=$boost_coroutine_save_LIBS
+LDFLAGS=$boost_coroutine_save_LDFLAGS
+])# BOOST_COROUTINE
+
+
+# BOOST_CRC()
+# -----------
+# Look for Boost.CRC
+BOOST_DEFUN([CRC],
+[BOOST_FIND_HEADER([boost/crc.hpp])
+])# BOOST_CRC
+
+
+# BOOST_DATE_TIME([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Date_Time. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Date_Time],
+[BOOST_FIND_LIB([date_time], [$1],
+ [boost/date_time/posix_time/posix_time.hpp],
+ [boost::posix_time::ptime t;])
+])# BOOST_DATE_TIME
+
+
+# BOOST_FILESYSTEM([PREFERRED-RT-OPT])
+# ------------------------------------
+# Look for Boost.Filesystem. For the documentation of PREFERRED-RT-OPT, see
+# the documentation of BOOST_FIND_LIB above.
+# Do not check for boost/filesystem.hpp because this file was introduced in
+# 1.34.
+BOOST_DEFUN([Filesystem],
+[# Do we have to check for Boost.System? This link-time dependency was
+# added as of 1.35.0. If we have a version <1.35, we must not attempt to
+# find Boost.System as it didn't exist by then.
+if test $boost_major_version -ge 135; then
+ BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+boost_filesystem_save_LIBS=$LIBS
+boost_filesystem_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([filesystem], [$1],
+ [boost/filesystem/path.hpp], [boost::filesystem::path p;])
+if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
+ BOOST_FILESYSTEM_LIBS="$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"
+fi
+LIBS=$boost_filesystem_save_LIBS
+LDFLAGS=$boost_filesystem_save_LDFLAGS
+])# BOOST_FILESYSTEM
+
+
+# BOOST_FLYWEIGHT()
+# -----------------
+# Look for Boost.Flyweight.
+BOOST_DEFUN([Flyweight],
+[dnl There's a hidden dependency on pthreads.
+AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
+BOOST_FIND_HEADER([boost/flyweight.hpp])
+AC_SUBST([BOOST_FLYWEIGHT_LIBS], [$boost_cv_pthread_flag])
+])
+
+
+# BOOST_FOREACH()
+# ---------------
+# Look for Boost.Foreach.
+BOOST_DEFUN([Foreach],
+[BOOST_FIND_HEADER([boost/foreach.hpp])])
+
+
+# BOOST_FORMAT()
+# --------------
+# Look for Boost.Format.
+# Note: we can't check for boost/format/format_fwd.hpp because the header isn't
+# standalone. It can't be compiled because it triggers the following error:
+# boost/format/detail/config_macros.hpp:88: error: 'locale' in namespace 'std'
+# does not name a type
+BOOST_DEFUN([Format],
+[BOOST_FIND_HEADER([boost/format.hpp])])
+
+
+# BOOST_FUNCTION()
+# ----------------
+# Look for Boost.Function
+BOOST_DEFUN([Function],
+[BOOST_FIND_HEADER([boost/function.hpp])])
+
+
+# BOOST_GEOMETRY()
+# ----------------
+# Look for Boost.Geometry (new since 1.47.0).
+BOOST_DEFUN([Geometry],
+[BOOST_FIND_HEADER([boost/geometry.hpp])
+])# BOOST_GEOMETRY
+
+
+# BOOST_GRAPH([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost.Graphs. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Graph],
+[boost_graph_save_LIBS=$LIBS
+boost_graph_save_LDFLAGS=$LDFLAGS
+# Link-time dependency from graph to regex was added as of 1.40.0.
+if test $boost_major_version -ge 140; then
+ BOOST_REGEX([$1])
+ m4_pattern_allow([^BOOST_REGEX_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_REGEX_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_REGEX_LDFLAGS"
+fi
+BOOST_FIND_LIB([graph], [$1],
+ [boost/graph/adjacency_list.hpp], [boost::adjacency_list<> g;])
+LIBS=$boost_graph_save_LIBS
+LDFLAGS=$boost_graph_save_LDFLAGS
+])# BOOST_GRAPH
+
+
+# BOOST_IOSTREAMS([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.IOStreams. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([IOStreams],
+[BOOST_FIND_LIB([iostreams], [$1],
+ [boost/iostreams/device/file_descriptor.hpp],
+ [boost::iostreams::file_descriptor fd; fd.close();])
+])# BOOST_IOSTREAMS
+
+
+# BOOST_HASH()
+# ------------
+# Look for Boost.Functional/Hash
+BOOST_DEFUN([Hash],
+[BOOST_FIND_HEADER([boost/functional/hash.hpp])])
+
+
+# BOOST_LAMBDA()
+# --------------
+# Look for Boost.Lambda
+BOOST_DEFUN([Lambda],
+[BOOST_FIND_HEADER([boost/lambda/lambda.hpp])])
+
+
+# BOOST_LOCALE()
+# --------------
+# Look for Boost.Locale
+BOOST_DEFUN([Locale],
+[
+boost_locale_save_LIBS=$LIBS
+boost_locale_save_LDFLAGS=$LDFLAGS
+# require SYSTEM for boost-1.50.0 and up
+if test $boost_major_version -ge 150; then
+ BOOST_SYSTEM([$1])
+ m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+fi # end of the Boost.System check.
+BOOST_FIND_LIB([locale], [$1],
+ [boost/locale.hpp],
+ [[boost::locale::generator gen; std::locale::global(gen(""));]])
+LIBS=$boost_locale_save_LIBS
+LDFLAGS=$boost_locale_save_LDFLAGS
+])# BOOST_LOCALE
+
+# BOOST_LOG([PREFERRED-RT-OPT])
+# -----------------------------
+# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Log],
+[boost_log_save_LIBS=$LIBS
+boost_log_save_LDFLAGS=$LDFLAGS
+BOOST_SYSTEM([$1])
+BOOST_FILESYSTEM([$1])
+BOOST_DATE_TIME([$1])
+m4_pattern_allow([^BOOST_(SYSTEM|FILESYSTEM|DATE_TIME)_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_DATE_TIME_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_DATE_TIME_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([log], [$1],
+ [boost/log/core/core.hpp],
+ [boost::log::attribute a; a.get_value();])
+LIBS=$boost_log_save_LIBS
+LDFLAGS=$boost_log_save_LDFLAGS
+])# BOOST_LOG
+
+
+# BOOST_LOG_SETUP([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Log_Setup],
+[boost_log_setup_save_LIBS=$LIBS
+boost_log_setup_save_LDFLAGS=$LDFLAGS
+BOOST_LOG([$1])
+m4_pattern_allow([^BOOST_LOG_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_LOG_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_LOG_LDFLAGS"
+BOOST_FIND_LIB([log_setup], [$1],
+ [boost/log/utility/setup/from_settings.hpp],
+ [boost::log::basic_settings<char> bs; bs.empty();])
+LIBS=$boost_log_setup_save_LIBS
+LDFLAGS=$boost_log_setup_save_LDFLAGS
+])# BOOST_LOG_SETUP
+
+
+# BOOST_MATH()
+# ------------
+# Look for Boost.Math
+# TODO: This library isn't header-only but it comes in multiple different
+# flavors that don't play well with BOOST_FIND_LIB (e.g, libboost_math_c99,
+# libboost_math_c99f, libboost_math_c99l, libboost_math_tr1,
+# libboost_math_tr1f, libboost_math_tr1l). This macro must be fixed to do the
+# right thing anyway.
+BOOST_DEFUN([Math],
+[BOOST_FIND_HEADER([boost/math/special_functions.hpp])])
+
+
+# BOOST_MPI([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost MPI. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. Uses MPICXX variable if it is
+# set, otherwise tries CXX
+#
+BOOST_DEFUN([MPI],
+[boost_save_CXX=${CXX}
+boost_save_CXXCPP=${CXXCPP}
+if test x"${MPICXX}" != x; then
+ CXX=${MPICXX}
+ CXXCPP="${MPICXX} -E"
+fi
+BOOST_FIND_LIB([mpi], [$1],
+ [boost/mpi.hpp],
+ [int argc = 0;
+ char **argv = 0;
+ boost::mpi::environment env(argc,argv);])
+CXX=${boost_save_CXX}
+CXXCPP=${boost_save_CXXCPP}
+])# BOOST_MPI
+
+
+# BOOST_MULTIARRAY()
+# ------------------
+# Look for Boost.MultiArray
+BOOST_DEFUN([MultiArray],
+[BOOST_FIND_HEADER([boost/multi_array.hpp])])
+
+
+# BOOST_NUMERIC_UBLAS()
+# --------------------------
+# Look for Boost.NumericUblas (Basic Linear Algebra)
+BOOST_DEFUN([Numeric_Ublas],
+[BOOST_FIND_HEADER([boost/numeric/ublas/vector.hpp])
+])# BOOST_NUMERIC_UBLAS
+
+
+# BOOST_NUMERIC_CONVERSION()
+# --------------------------
+# Look for Boost.NumericConversion (policy-based numeric conversion)
+BOOST_DEFUN([Numeric_Conversion],
+[BOOST_FIND_HEADER([boost/numeric/conversion/converter.hpp])
+])# BOOST_NUMERIC_CONVERSION
+
+
+# BOOST_OPTIONAL()
+# ----------------
+# Look for Boost.Optional
+BOOST_DEFUN([Optional],
+[BOOST_FIND_HEADER([boost/optional.hpp])])
+
+
+# BOOST_PREPROCESSOR()
+# --------------------
+# Look for Boost.Preprocessor
+BOOST_DEFUN([Preprocessor],
+[BOOST_FIND_HEADER([boost/preprocessor/repeat.hpp])])
+
+
+# BOOST_RANGE()
+# --------------------
+# Look for Boost.Range
+BOOST_DEFUN([Range],
+[BOOST_FIND_HEADER([boost/range/adaptors.hpp])])
+
+# BOOST_UNORDERED()
+# -----------------
+# Look for Boost.Unordered
+BOOST_DEFUN([Unordered],
+[BOOST_FIND_HEADER([boost/unordered_map.hpp])])
+
+
+# BOOST_UUID()
+# ------------
+# Look for Boost.Uuid
+BOOST_DEFUN([Uuid],
+[BOOST_FIND_HEADER([boost/uuid/uuid.hpp])])
+
+
+# BOOST_PROGRAM_OPTIONS([PREFERRED-RT-OPT])
+# -----------------------------------------
+# Look for Boost.Program_options. For the documentation of PREFERRED-RT-OPT,
+# see the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Program_Options],
+[BOOST_FIND_LIB([program_options], [$1],
+ [boost/program_options.hpp],
+ [boost::program_options::options_description d("test");])
+])# BOOST_PROGRAM_OPTIONS
+
+
+
+# _BOOST_PYTHON_CONFIG(VARIABLE, FLAG)
+# ------------------------------------
+# Save VARIABLE, and define it via `python-config --FLAG`.
+# Substitute BOOST_PYTHON_VARIABLE.
+m4_define([_BOOST_PYTHON_CONFIG],
+[AC_SUBST([BOOST_PYTHON_$1],
+ [`python-config --$2 2>/dev/null`])dnl
+boost_python_save_$1=$$1
+$1="$$1 $BOOST_PYTHON_$1"])
+
+
+# BOOST_PYTHON([PREFERRED-RT-OPT])
+# --------------------------------
+# Look for Boost.Python. For the documentation of PREFERRED-RT-OPT,
+# see the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Python],
+[_BOOST_PYTHON_CONFIG([CPPFLAGS], [includes])
+_BOOST_PYTHON_CONFIG([LDFLAGS], [ldflags])
+_BOOST_PYTHON_CONFIG([LIBS], [libs])
+m4_pattern_allow([^BOOST_PYTHON_MODULE$])dnl
+BOOST_FIND_LIBS([python], [python python3], [$1],
+ [boost/python.hpp],
+ [], [BOOST_PYTHON_MODULE(empty) {}])
+CPPFLAGS=$boost_python_save_CPPFLAGS
+LDFLAGS=$boost_python_save_LDFLAGS
+LIBS=$boost_python_save_LIBS
+])# BOOST_PYTHON
+
+
+# BOOST_REF()
+# -----------
+# Look for Boost.Ref
+BOOST_DEFUN([Ref],
+[BOOST_FIND_HEADER([boost/ref.hpp])])
+
+
+# BOOST_REGEX([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost.Regex. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Regex],
+[BOOST_FIND_LIB([regex], [$1],
+ [boost/regex.hpp],
+ [boost::regex exp("*"); boost::regex_match("foo", exp);])
+])# BOOST_REGEX
+
+
+# BOOST_SERIALIZATION([PREFERRED-RT-OPT])
+# ---------------------------------------
+# Look for Boost.Serialization. For the documentation of PREFERRED-RT-OPT, see
+# the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Serialization],
+[BOOST_FIND_LIB([serialization], [$1],
+ [boost/archive/text_oarchive.hpp],
+ [std::ostream* o = 0; // Cheap way to get an ostream...
+ boost::archive::text_oarchive t(*o);])
+])# BOOST_SERIALIZATION
+
+
+# BOOST_SIGNALS([PREFERRED-RT-OPT])
+# ---------------------------------
+# Look for Boost.Signals. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Signals],
+[BOOST_FIND_LIB([signals], [$1],
+ [boost/signal.hpp],
+ [boost::signal<void ()> s;])
+])# BOOST_SIGNALS
+
+
+# BOOST_SIGNALS2()
+# ----------------
+# Look for Boost.Signals2 (new since 1.39.0).
+BOOST_DEFUN([Signals2],
+[BOOST_FIND_HEADER([boost/signals2.hpp])
+])# BOOST_SIGNALS2
+
+
+# BOOST_SMART_PTR()
+# -----------------
+# Look for Boost.SmartPtr
+BOOST_DEFUN([Smart_Ptr],
+[BOOST_FIND_HEADER([boost/scoped_ptr.hpp])
+BOOST_FIND_HEADER([boost/shared_ptr.hpp])
+])
+
+
+# BOOST_STATICASSERT()
+# --------------------
+# Look for Boost.StaticAssert
+BOOST_DEFUN([StaticAssert],
+[BOOST_FIND_HEADER([boost/static_assert.hpp])])
+
+
+# BOOST_STRING_ALGO()
+# -------------------
+# Look for Boost.StringAlgo
+BOOST_DEFUN([String_Algo],
+[BOOST_FIND_HEADER([boost/algorithm/string.hpp])
+])
+
+
+# BOOST_SYSTEM([PREFERRED-RT-OPT])
+# --------------------------------
+# Look for Boost.System. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. This library was introduced in Boost
+# 1.35.0.
+BOOST_DEFUN([System],
+[BOOST_FIND_LIB([system], [$1],
+ [boost/system/error_code.hpp],
+ [boost::system::error_code e; e.clear();])
+])# BOOST_SYSTEM
+
+
+# BOOST_TEST([PREFERRED-RT-OPT])
+# ------------------------------
+# Look for Boost.Test. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Test],
+[m4_pattern_allow([^BOOST_CHECK$])dnl
+BOOST_FIND_LIB([unit_test_framework], [$1],
+ [boost/test/unit_test.hpp], [BOOST_CHECK(2 == 2);],
+ [using boost::unit_test::test_suite;
+ test_suite* init_unit_test_suite(int argc, char ** argv)
+ { return NULL; }])
+])# BOOST_TEST
+
+
+# BOOST_THREAD([PREFERRED-RT-OPT])
+# ---------------------------------
+# Look for Boost.Thread. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Thread],
+[dnl Having the pthread flag is required at least on GCC3 where
+dnl boost/thread.hpp would complain if we try to compile without
+dnl -pthread on GNU/Linux.
+AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
+boost_thread_save_LIBS=$LIBS
+boost_thread_save_LDFLAGS=$LDFLAGS
+boost_thread_save_CPPFLAGS=$CPPFLAGS
+# Link-time dependency from thread to system was added as of 1.49.0.
+if test $boost_major_version -ge 149; then
+BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+CPPFLAGS="$CPPFLAGS $boost_cv_pthread_flag"
+
+# When compiling for the Windows platform, the threads library is named
+# differently. This suffix doesn't exist in new versions of Boost, or
+# possibly new versions of GCC on mingw I am assuming it's Boost's change for
+# now and I am setting version to 1.48, for lack of knowledge as to when this
+# change occurred.
+if test $boost_major_version -lt 148; then
+ case $host_os in
+ (*mingw*) boost_thread_lib_ext=_win32;;
+ esac
+fi
+BOOST_FIND_LIBS([thread], [thread$boost_thread_lib_ext],
+ [$1],
+ [boost/thread.hpp], [boost::thread t; boost::mutex m;])
+
+case $host_os in
+ (*mingw*) boost_thread_w32_socket_link=-lws2_32;;
+esac
+
+BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag $boost_thread_w32_socket_link"
+BOOST_THREAD_LDFLAGS="$BOOST_SYSTEM_LDFLAGS"
+BOOST_CPPFLAGS="$BOOST_CPPFLAGS $boost_cv_pthread_flag"
+LIBS=$boost_thread_save_LIBS
+LDFLAGS=$boost_thread_save_LDFLAGS
+CPPFLAGS=$boost_thread_save_CPPFLAGS
+])# BOOST_THREAD
+
+AU_ALIAS([BOOST_THREADS], [BOOST_THREAD])
+
+
+# BOOST_TOKENIZER()
+# -----------------
+# Look for Boost.Tokenizer
+BOOST_DEFUN([Tokenizer],
+[BOOST_FIND_HEADER([boost/tokenizer.hpp])])
+
+
+# BOOST_TRIBOOL()
+# ---------------
+# Look for Boost.Tribool
+BOOST_DEFUN([Tribool],
+[BOOST_FIND_HEADER([boost/logic/tribool_fwd.hpp])
+BOOST_FIND_HEADER([boost/logic/tribool.hpp])
+])
+
+
+# BOOST_TUPLE()
+# -------------
+# Look for Boost.Tuple
+BOOST_DEFUN([Tuple],
+[BOOST_FIND_HEADER([boost/tuple/tuple.hpp])])
+
+
+# BOOST_TYPETRAITS()
+# --------------------
+# Look for Boost.TypeTraits
+BOOST_DEFUN([TypeTraits],
+[BOOST_FIND_HEADER([boost/type_traits.hpp])])
+
+
+# BOOST_UTILITY()
+# ---------------
+# Look for Boost.Utility (noncopyable, result_of, base-from-member idiom,
+# etc.)
+BOOST_DEFUN([Utility],
+[BOOST_FIND_HEADER([boost/utility.hpp])])
+
+
+# BOOST_VARIANT()
+# ---------------
+# Look for Boost.Variant.
+BOOST_DEFUN([Variant],
+[BOOST_FIND_HEADER([boost/variant/variant_fwd.hpp])
+BOOST_FIND_HEADER([boost/variant.hpp])])
+
+
+# BOOST_POINTER_CONTAINER()
+# ------------------------
+# Look for Boost.PointerContainer
+BOOST_DEFUN([Pointer_Container],
+[BOOST_FIND_HEADER([boost/ptr_container/ptr_deque.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_list.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_vector.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_array.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_set.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_map.hpp])
+])# BOOST_POINTER_CONTAINER
+
+
+# BOOST_WAVE([PREFERRED-RT-OPT])
+# ------------------------------
+# NOTE: If you intend to use Wave/Spirit with thread support, make sure you
+# call BOOST_THREAD first.
+# Look for Boost.Wave. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Wave],
+[AC_REQUIRE([BOOST_FILESYSTEM])dnl
+AC_REQUIRE([BOOST_DATE_TIME])dnl
+boost_wave_save_LIBS=$LIBS
+boost_wave_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_((FILE)?SYSTEM|DATE_TIME|THREAD)_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS \
+$BOOST_THREAD_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS \
+$BOOST_DATE_TIME_LDFLAGS $BOOST_THREAD_LDFLAGS"
+BOOST_FIND_LIB([wave], [$1],
+ [boost/wave.hpp],
+ [boost::wave::token_id id; get_token_name(id);])
+LIBS=$boost_wave_save_LIBS
+LDFLAGS=$boost_wave_save_LDFLAGS
+])# BOOST_WAVE
+
+
+# BOOST_XPRESSIVE()
+# -----------------
+# Look for Boost.Xpressive (new since 1.36.0).
+BOOST_DEFUN([Xpressive],
+[BOOST_FIND_HEADER([boost/xpressive/xpressive.hpp])])
+
+
+# ----------------- #
+# Internal helpers. #
+# ----------------- #
+
+
+# _BOOST_PTHREAD_FLAG()
+# ---------------------
+# Internal helper for BOOST_THREAD. Computes boost_cv_pthread_flag
+# which must be used in CPPFLAGS and LIBS.
+#
+# Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3,
+# boost/thread.hpp will trigger a #error if -pthread isn't used:
+# boost/config/requires_threads.hpp:47:5: #error "Compiler threading support
+# is not turned on. Please set the correct command line options for
+# threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
+#
+# Based on ACX_PTHREAD: http://autoconf-archive.cryp.to/acx_pthread.html
+AC_DEFUN([_BOOST_PTHREAD_FLAG],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_LANG_PUSH([C++])dnl
+AC_CACHE_CHECK([for the flags needed to use pthreads], [boost_cv_pthread_flag],
+[ boost_cv_pthread_flag=
+ # The ordering *is* (sometimes) important. Some notes on the
+ # individual items follow:
+ # (none): in case threads are in libc; should be tried before -Kthread and
+ # other compiler flags to prevent continual compiler warnings
+ # -lpthreads: AIX (must check this before -lpthread)
+ # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+ # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+ # -llthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+ # -pthread: GNU Linux/GCC (kernel threads), BSD/GCC (userland threads)
+ # -pthreads: Solaris/GCC
+ # -mthreads: MinGW32/GCC, Lynx/GCC
+ # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+ # doesn't hurt to check since this sometimes defines pthreads too;
+ # also defines -D_REENTRANT)
+ # ... -mt is also the pthreads flag for HP/aCC
+ # -lpthread: GNU Linux, etc.
+ # --thread-safe: KAI C++
+ case $host_os in #(
+ *solaris*)
+ # On Solaris (at least, for some versions), libc contains stubbed
+ # (non-functional) versions of the pthreads routines, so link-based
+ # tests will erroneously succeed. (We need to link with -pthreads/-mt/
+ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
+ # a function called by this macro, so we could check for that, but
+ # who knows whether they'll stub that too in a future libc.) So,
+ # we'll just look for -pthreads and -lpthread first:
+ boost_pthread_flags="-pthreads -lpthread -mt -pthread";; #(
+ *)
+ boost_pthread_flags="-lpthreads -Kthread -kthread -llthread -pthread \
+ -pthreads -mthreads -lpthread --thread-safe -mt";;
+ esac
+ # Generate the test file.
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <pthread.h>],
+ [pthread_t th; pthread_join(th, 0);
+ pthread_attr_init(0); pthread_cleanup_push(0, 0);
+ pthread_create(0,0,0,0); pthread_cleanup_pop(0);])])
+ for boost_pthread_flag in '' $boost_pthread_flags; do
+ boost_pthread_ok=false
+dnl Re-use the test file already generated.
+ boost_pthreads__save_LIBS=$LIBS
+ LIBS="$LIBS $boost_pthread_flag"
+ AC_LINK_IFELSE([],
+ [if grep ".*$boost_pthread_flag" conftest.err; then
+ echo "This flag seems to have triggered warnings" >&AS_MESSAGE_LOG_FD
+ else
+ boost_pthread_ok=:; boost_cv_pthread_flag=$boost_pthread_flag
+ fi])
+ LIBS=$boost_pthreads__save_LIBS
+ $boost_pthread_ok && break
+ done
+])
+AC_LANG_POP([C++])dnl
+])# _BOOST_PTHREAD_FLAG
+
+
+# _BOOST_gcc_test(MAJOR, MINOR)
+# -----------------------------
+# Internal helper for _BOOST_FIND_COMPILER_TAG.
+m4_define([_BOOST_gcc_test],
+["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC @ gcc$1$2"])dnl
+
+# _BOOST_mingw_test(MAJOR, MINOR)
+# -----------------------------
+# Internal helper for _BOOST_FIND_COMPILER_TAG.
+m4_define([_BOOST_mingw_test],
+["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw$1$2"])dnl
+
+
+# _BOOST_FIND_COMPILER_TAG()
+# --------------------------
+# Internal. When Boost is installed without --layout=system, each library
+# filename will hold a suffix that encodes the compiler used during the
+# build. The Boost build system seems to call this a `tag'.
+AC_DEFUN([_BOOST_FIND_COMPILER_TAG],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_CACHE_CHECK([for the toolset name used by Boost for $CXX],
+ [boost_cv_lib_tag],
+[boost_cv_lib_tag=unknown
+if test x$boost_cv_inc_path != xno; then
+ AC_LANG_PUSH([C++])dnl
+ # The following tests are mostly inspired by boost/config/auto_link.hpp
+ # The list is sorted to most recent/common to oldest compiler (in order
+ # to increase the likelihood of finding the right compiler with the
+ # least number of compilation attempt).
+ # Beware that some tests are sensible to the order (for instance, we must
+ # look for MinGW before looking for GCC3).
+ # I used one compilation test per compiler with a #error to recognize
+ # each compiler so that it works even when cross-compiling (let me know
+ # if you know a better approach).
+ # Known missing tags (known from Boost's tools/build/v2/tools/common.jam):
+ # como, edg, kcc, bck, mp, sw, tru, xlc
+ # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines
+ # the same defines as GCC's).
+ for i in \
+ _BOOST_mingw_test(5, 3) \
+ _BOOST_gcc_test(5, 3) \
+ _BOOST_mingw_test(5, 2) \
+ _BOOST_gcc_test(5, 2) \
+ _BOOST_mingw_test(5, 1) \
+ _BOOST_gcc_test(5, 1) \
+ _BOOST_mingw_test(5, 0) \
+ _BOOST_gcc_test(5, 0) \
+ _BOOST_mingw_test(4, 10) \
+ _BOOST_gcc_test(4, 10) \
+ _BOOST_mingw_test(4, 9) \
+ _BOOST_gcc_test(4, 9) \
+ _BOOST_mingw_test(4, 8) \
+ _BOOST_gcc_test(4, 8) \
+ _BOOST_mingw_test(4, 7) \
+ _BOOST_gcc_test(4, 7) \
+ _BOOST_mingw_test(4, 6) \
+ _BOOST_gcc_test(4, 6) \
+ _BOOST_mingw_test(4, 5) \
+ _BOOST_gcc_test(4, 5) \
+ _BOOST_mingw_test(4, 4) \
+ _BOOST_gcc_test(4, 4) \
+ _BOOST_mingw_test(4, 3) \
+ _BOOST_gcc_test(4, 3) \
+ _BOOST_mingw_test(4, 2) \
+ _BOOST_gcc_test(4, 2) \
+ _BOOST_mingw_test(4, 1) \
+ _BOOST_gcc_test(4, 1) \
+ _BOOST_mingw_test(4, 0) \
+ _BOOST_gcc_test(4, 0) \
+ "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \
+ && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw" \
+ _BOOST_gcc_test(3, 4) \
+ _BOOST_gcc_test(3, 3) \
+ "defined _MSC_VER && _MSC_VER >= 1500 @ vc90" \
+ "defined _MSC_VER && _MSC_VER == 1400 @ vc80" \
+ _BOOST_gcc_test(3, 2) \
+ "defined _MSC_VER && _MSC_VER == 1310 @ vc71" \
+ _BOOST_gcc_test(3, 1) \
+ _BOOST_gcc_test(3, 0) \
+ "defined __BORLANDC__ @ bcb" \
+ "defined __ICC && (defined __unix || defined __unix__) @ il" \
+ "defined __ICL @ iw" \
+ "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \
+ _BOOST_gcc_test(2, 95) \
+ "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \
+ "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \
+ "defined _MSC_VER && _MSC_VER < 1300 && defined UNDER_CE @ evc4" \
+ "defined __MWERKS__ && __MWERKS__ <= 0x31FF @ cw8"
+ do
+ boost_tag_test=`expr "X$i" : 'X\([[^@]]*\) @ '`
+ boost_tag=`expr "X$i" : 'X[[^@]]* @ \(.*\)'`
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if $boost_tag_test
+/* OK */
+#else
+# error $boost_tag_test
+#endif
+]])], [boost_cv_lib_tag=$boost_tag; break], [])
+ done
+AC_LANG_POP([C++])dnl
+ case $boost_cv_lib_tag in #(
+ # Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed
+ # to "gcc41" for instance.
+ *-gcc | *'-gcc ') :;; #( Don't re-add -gcc: it's already in there.
+ gcc*)
+ boost_tag_x=
+ case $host_os in #(
+ darwin*)
+ if test $boost_major_version -ge 136; then
+ # The `x' added in r46793 of Boost.
+ boost_tag_x=x
+ fi;;
+ esac
+ # We can specify multiple tags in this variable because it's used by
+ # BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ...
+ boost_cv_lib_tag="$boost_tag_x$boost_cv_lib_tag -${boost_tag_x}gcc"
+ ;; #(
+ unknown)
+ AC_MSG_WARN([[could not figure out which toolset name to use for $CXX]])
+ boost_cv_lib_tag=
+ ;;
+ esac
+fi])dnl end of AC_CACHE_CHECK
+])# _BOOST_FIND_COMPILER_TAG
+
+
+# _BOOST_GUESS_WHETHER_TO_USE_MT()
+# --------------------------------
+# Compile a small test to try to guess whether we should favor MT (Multi
+# Thread) flavors of Boost. Sets boost_guess_use_mt accordingly.
+AC_DEFUN([_BOOST_GUESS_WHETHER_TO_USE_MT],
+[# Check whether we do better use `mt' even though we weren't ask to.
+AC_LANG_PUSH([C++])dnl
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if defined _REENTRANT || defined _MT || defined __MT__
+/* use -mt */
+#else
+# error MT not needed
+#endif
+]])], [boost_guess_use_mt=:], [boost_guess_use_mt=false])
+AC_LANG_POP([C++])dnl
+])
+
+# _BOOST_AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+# -------------------------------------------------------------------
+# Fork of _AC_LINK_IFELSE that preserves conftest.o across calls. Fragile,
+# will break when Autoconf changes its internals. Requires that you manually
+# rm -f conftest.$ac_objext in between to really different tests, otherwise
+# you will try to link a conftest.o left behind by a previous test.
+# Used to aggressively optimize BOOST_FIND_LIB (see the big comment in this
+# macro).
+#
+# Don't use "break" in the actions, as it would short-circuit some code
+# this macro runs after the actions.
+m4_define([_BOOST_AC_LINK_IFELSE],
+[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
+rm -f conftest$ac_exeext
+boost_save_ac_ext=$ac_ext
+boost_use_source=:
+# If we already have a .o, re-use it. We change $ac_ext so that $ac_link
+# tries to link the existing object file instead of compiling from source.
+test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false &&
+ _AS_ECHO_LOG([re-using the existing conftest.$ac_objext])
+AS_IF([_AC_DO_STDERR($ac_link) && {
+ test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_executable_p conftest$ac_exeext
+dnl FIXME: use AS_TEST_X instead when 2.61 is widespread enough.
+ }],
+ [$2],
+ [if $boost_use_source; then
+ _AC_MSG_LOG_CONFTEST
+ fi
+ $3])
+ac_objext=$boost_save_ac_objext
+ac_ext=$boost_save_ac_ext
+dnl Delete also the IPA/IPO (Inter Procedural Analysis/Optimization)
+dnl information created by the PGI compiler (conftest_ipa8_conftest.oo),
+dnl as it would interfere with the next link command.
+rm -f core conftest.err conftest_ipa8_conftest.oo \
+ conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl
+])# _BOOST_AC_LINK_IFELSE
+
+# Local Variables:
+# mode: autoconf
+# End:
diff --git a/org.eclipse.efm.symbex/cmake/cvc4-master-patch/config/boost.m4 b/org.eclipse.efm.symbex/cmake/cvc4-master-patch/config/boost.m4
new file mode 100644
index 0000000..084cfd2
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/cvc4-master-patch/config/boost.m4
@@ -0,0 +1,1565 @@
+# boost.m4: Locate Boost headers and libraries for autoconf-based projects.
+# Copyright (C) 2007-2011, 2014 Benoit Sigoure <tsuna@lrde.epita.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Additional permission under section 7 of the GNU General Public
+# License, version 3 ("GPLv3"):
+#
+# If you convey this file as part of a work that contains a
+# configuration script generated by Autoconf, you may do so under
+# terms of your choice.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+m4_define([_BOOST_SERIAL], [m4_translit([
+# serial 25
+], [#
+], [])])
+
+# Original sources can be found at http://github.com/tsuna/boost.m4
+# You can fetch the latest version of the script by doing:
+# wget http://github.com/tsuna/boost.m4/raw/master/build-aux/boost.m4
+
+# ------ #
+# README #
+# ------ #
+
+# This file provides several macros to use the various Boost libraries.
+# The first macro is BOOST_REQUIRE. It will simply check if it's possible to
+# find the Boost headers of a given (optional) minimum version and it will
+# define BOOST_CPPFLAGS accordingly. It will add an option --with-boost to
+# your configure so that users can specify non standard locations.
+# If the user's environment contains BOOST_ROOT and --with-boost was not
+# specified, --with-boost=$BOOST_ROOT is implicitly used.
+# For more README and documentation, go to http://github.com/tsuna/boost.m4
+# Note: THESE MACROS ASSUME THAT YOU USE LIBTOOL. If you don't, don't worry,
+# simply read the README, it will show you what to do step by step.
+
+m4_pattern_forbid([^_?(BOOST|Boost)_])
+
+
+# _BOOST_SED_CPP(SED-PROGRAM, PROGRAM,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# --------------------------------------------------------
+# Same as AC_EGREP_CPP, but leave the result in conftest.i.
+#
+# SED-PROGRAM is *not* overquoted, as in AC_EGREP_CPP. It is expanded
+# in double-quotes, so escape your double quotes.
+#
+# It could be useful to turn this into a macro which extracts the
+# value of any macro.
+m4_define([_BOOST_SED_CPP],
+[AC_LANG_PUSH([C++])dnl
+AC_LANG_PREPROC_REQUIRE()dnl
+AC_REQUIRE([AC_PROG_SED])dnl
+AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])])
+AS_IF([dnl eval is necessary to expand ac_cpp.
+dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
+dnl Beware of Windows end-of-lines, for instance if we are running
+dnl some Windows programs under Wine. In that case, boost/version.hpp
+dnl is certainly using "\r\n", but the regular Unix shell will only
+dnl strip `\n' with backquotes, not the `\r'. This results in
+dnl boost_cv_lib_version='1_37\r' for instance, which breaks
+dnl everything else.
+dnl Cannot use 'dnl' after [$4] because a trailing dnl may break AC_CACHE_CHECK
+dnl
+dnl Beware that GCC 5, when expanding macros, may embed # line directives
+dnl a within single line:
+dnl
+dnl # 1 "conftest.cc"
+dnl # 1 "<built-in>"
+dnl # 1 "<command-line>"
+dnl # 1 "conftest.cc"
+dnl # 1 "/opt/local/include/boost/version.hpp" 1 3
+dnl # 2 "conftest.cc" 2
+dnl boost-lib-version =
+dnl # 2 "conftest.cc" 3
+dnl "1_56"
+dnl
+dnl So get rid of the # lines, and glue the remaining ones together.
+(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+ grep -v '#' |
+ tr -d '\r' |
+ tr -s '\n' ' ' |
+ $SED -n -e "$1" >conftest.i 2>&1],
+ [$3],
+ [$4])
+rm -rf conftest*
+AC_LANG_POP([C++])dnl
+])# _BOOST_SED_CPP
+
+
+
+# BOOST_REQUIRE([VERSION], [ACTION-IF-NOT-FOUND])
+# -----------------------------------------------
+# Look for Boost. If version is given, it must either be a literal of the form
+# "X.Y.Z" where X, Y and Z are integers (the ".Z" part being optional) or a
+# variable "$var".
+# Defines the value BOOST_CPPFLAGS. This macro only checks for headers with
+# the required version, it does not check for any of the Boost libraries.
+# On # success, defines HAVE_BOOST. On failure, calls the optional
+# ACTION-IF-NOT-FOUND action if one was supplied.
+# Otherwise aborts with an error message.
+AC_DEFUN_ONCE([BOOST_REQUIRE],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_PROG_GREP])dnl
+echo "$as_me: this is boost.m4[]_BOOST_SERIAL" >&AS_MESSAGE_LOG_FD
+boost_save_IFS=$IFS
+boost_version_req=$1
+IFS=.
+set x $boost_version_req 0 0 0
+IFS=$boost_save_IFS
+shift
+boost_version_req=`expr "$[1]" '*' 100000 + "$[2]" '*' 100 + "$[3]"`
+boost_version_req_string=$[1].$[2].$[3]
+AC_ARG_WITH([boost],
+ [AS_HELP_STRING([--with-boost=DIR],
+ [prefix of Boost $1 @<:@guess@:>@])])dnl
+AC_ARG_VAR([BOOST_ROOT],[Location of Boost installation])dnl
+# If BOOST_ROOT is set and the user has not provided a value to
+# --with-boost, then treat BOOST_ROOT as if it the user supplied it.
+if test x"$BOOST_ROOT" != x; then
+ if test x"$with_boost" = x; then
+ AC_MSG_NOTICE([Detected BOOST_ROOT; continuing with --with-boost=$BOOST_ROOT])
+ with_boost=$BOOST_ROOT
+ else
+ AC_MSG_NOTICE([Detected BOOST_ROOT=$BOOST_ROOT, but overridden by --with-boost=$with_boost])
+ fi
+fi
+AC_SUBST([DISTCHECK_CONFIGURE_FLAGS],
+ ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"])dnl
+boost_save_CPPFLAGS=$CPPFLAGS
+ AC_CACHE_CHECK([for Boost headers version >= $boost_version_req_string],
+ [boost_cv_inc_path],
+ [boost_cv_inc_path=no
+AC_LANG_PUSH([C++])dnl
+m4_pattern_allow([^BOOST_VERSION$])dnl
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#include <boost/version.hpp>
+#if !defined BOOST_VERSION
+# error BOOST_VERSION is not defined
+#elif BOOST_VERSION < $boost_version_req
+# error Boost headers version < $boost_version_req
+#endif
+]])])
+ # If the user provided a value to --with-boost, use it and only it.
+ case $with_boost in #(
+ ''|yes) set x '' /opt/local/include /usr/local/include /opt/include \
+ /usr/include C:/Boost/include;; #(
+ *) set x "$with_boost/include" "$with_boost";;
+ esac
+ shift
+ for boost_dir
+ do
+ # Without --layout=system, Boost (or at least some versions) installs
+ # itself in <prefix>/include/boost-<version>. This inner loop helps to
+ # find headers in such directories.
+ #
+ # Any ${boost_dir}/boost-x_xx directories are searched in reverse version
+ # order followed by ${boost_dir}. The final '.' is a sentinel for
+ # searching $boost_dir" itself. Entries are whitespace separated.
+ #
+ # I didn't indent this loop on purpose (to avoid over-indented code)
+ boost_layout_system_search_list=`cd "$boost_dir" 2>/dev/null \
+ && ls -1 | "${GREP}" '^boost-' | sort -rn -t- -k2 \
+ && echo .`
+ for boost_inc in $boost_layout_system_search_list
+ do
+ if test x"$boost_inc" != x.; then
+ boost_inc="$boost_dir/$boost_inc"
+ else
+ boost_inc="$boost_dir" # Uses sentinel in boost_layout_system_search_list
+ fi
+ if test x"$boost_inc" != x; then
+ # We are going to check whether the version of Boost installed
+ # in $boost_inc is usable by running a compilation that
+ # #includes it. But if we pass a -I/some/path in which Boost
+ # is not installed, the compiler will just skip this -I and
+ # use other locations (either from CPPFLAGS, or from its list
+ # of system include directories). As a result we would use
+ # header installed on the machine instead of the /some/path
+ # specified by the user. So in that precise case (trying
+ # $boost_inc), make sure the version.hpp exists.
+ #
+ # Use test -e as there can be symlinks.
+ test -e "$boost_inc/boost/version.hpp" || continue
+ CPPFLAGS="$CPPFLAGS -I$boost_inc"
+ fi
+ AC_COMPILE_IFELSE([], [boost_cv_inc_path=yes], [boost_cv_version=no])
+ if test x"$boost_cv_inc_path" = xyes; then
+ if test x"$boost_inc" != x; then
+ boost_cv_inc_path=$boost_inc
+ fi
+ break 2
+ fi
+ done
+ done
+AC_LANG_POP([C++])dnl
+ ])
+ case $boost_cv_inc_path in #(
+ no)
+ boost_errmsg="cannot find Boost headers version >= $boost_version_req_string"
+ m4_if([$2], [], [AC_MSG_ERROR([$boost_errmsg])],
+ [AC_MSG_NOTICE([$boost_errmsg])])
+ $2
+ ;;#(
+ yes)
+ BOOST_CPPFLAGS=
+ ;;#(
+ *)
+ AC_SUBST([BOOST_CPPFLAGS], ["-I$boost_cv_inc_path"])dnl
+ ;;
+ esac
+ if test x"$boost_cv_inc_path" != xno; then
+ AC_DEFINE([HAVE_BOOST], [1],
+ [Defined if the requested minimum BOOST version is satisfied])
+ AC_CACHE_CHECK([for Boost's header version],
+ [boost_cv_lib_version],
+ [m4_pattern_allow([^BOOST_LIB_VERSION$])dnl
+ _BOOST_SED_CPP([[/^boost-lib-version = /{s///;s/[\" ]//g;p;q;}]],
+ [#include <boost/version.hpp>
+boost-lib-version = BOOST_LIB_VERSION],
+ [boost_cv_lib_version=`cat conftest.i`])])
+ # e.g. "134" for 1_34_1 or "135" for 1_35
+
+ #boost_cv_lib_version="161"
+ #boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'`
+ #boost_major_version=`echo "$BOOST_LIB_VERSION" | sed 's/_//;s/_.*//'`
+ boost_major_version="161"
+
+ #case $boost_major_version in #(
+ # '' | *[[!0-9]]*)
+ # AC_MSG_ERROR([invalid value: boost_major_version='$boost_major_version'])
+ # ;;
+ #esac
+fi
+CPPFLAGS=$boost_save_CPPFLAGS
+])# BOOST_REQUIRE
+
+
+# BOOST_STATIC()
+# --------------
+# Add the "--enable-static-boost" configure argument. If this argument is given
+# on the command line, static versions of the libraries will be looked up.
+AC_DEFUN([BOOST_STATIC],
+ [AC_ARG_ENABLE([static-boost],
+ [AS_HELP_STRING([--enable-static-boost],
+ [Prefer the static boost libraries over the shared ones [no]])],
+ [enable_static_boost=yes],
+ [enable_static_boost=no])])# BOOST_STATIC
+
+
+# BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND])
+# --------------------------------------------------------------------------
+# Wrapper around AC_CHECK_HEADER for Boost headers. Useful to check for
+# some parts of the Boost library which are only made of headers and don't
+# require linking (such as Boost.Foreach).
+#
+# Default ACTION-IF-NOT-FOUND: Fail with a fatal error unless Boost couldn't be
+# found in the first place, in which case by default a notice is issued to the
+# user. Presumably if we haven't died already it's because it's OK to not have
+# Boost, which is why only a notice is issued instead of a hard error.
+#
+# Default ACTION-IF-FOUND: define the preprocessor symbol HAVE_<HEADER-NAME> in
+# case of success # (where HEADER-NAME is written LIKE_THIS, e.g.,
+# HAVE_BOOST_FOREACH_HPP).
+AC_DEFUN([BOOST_FIND_HEADER],
+[AC_REQUIRE([BOOST_REQUIRE])dnl
+if test x"$boost_cv_inc_path" = xno; then
+ m4_default([$2], [AC_MSG_NOTICE([Boost not available, not searching for $1])])
+else
+AC_LANG_PUSH([C++])dnl
+boost_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+AC_CHECK_HEADER([$1],
+ [m4_default([$3], [AC_DEFINE(AS_TR_CPP([HAVE_$1]), [1],
+ [Define to 1 if you have <$1>])])],
+ [m4_default([$2], [AC_MSG_ERROR([cannot find $1])])])
+CPPFLAGS=$boost_save_CPPFLAGS
+AC_LANG_POP([C++])dnl
+fi
+])# BOOST_FIND_HEADER
+
+
+# BOOST_FIND_LIBS([COMPONENT-NAME], [CANDIDATE-LIB-NAMES],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Look for the Boost library COMPONENT-NAME (e.g., `thread', for
+# libboost_thread) under the possible CANDIDATE-LIB-NAMES (e.g.,
+# "thread_win32 thread"). Check that HEADER-NAME works and check that
+# libboost_LIB-NAME can link with the code CXX-TEST. The optional
+# argument CXX-PROLOGUE can be used to include some C++ code before
+# the `main' function.
+#
+# Invokes BOOST_FIND_HEADER([HEADER-NAME]) (see above).
+#
+# Boost libraries typically come compiled with several flavors (with different
+# runtime options) so PREFERRED-RT-OPT is the preferred suffix. A suffix is one
+# or more of the following letters: sgdpn (in that order). s = static
+# runtime, d = debug build, g = debug/diagnostic runtime, p = STLPort build,
+# n = (unsure) STLPort build without iostreams from STLPort (it looks like `n'
+# must always be used along with `p'). Additionally, PREFERRED-RT-OPT can
+# start with `mt-' to indicate that there is a preference for multi-thread
+# builds. Some sample values for PREFERRED-RT-OPT: (nothing), mt, d, mt-d, gdp
+# ... If you want to make sure you have a specific version of Boost
+# (eg, >= 1.33) you *must* invoke BOOST_REQUIRE before this macro.
+AC_DEFUN([BOOST_FIND_LIBS],
+[AC_REQUIRE([BOOST_REQUIRE])dnl
+AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl
+AC_REQUIRE([BOOST_STATIC])dnl
+AC_REQUIRE([_BOOST_GUESS_WHETHER_TO_USE_MT])dnl
+if test x"$boost_cv_inc_path" = xno; then
+ AC_MSG_NOTICE([Boost not available, not searching for the Boost $1 library])
+else
+dnl The else branch is huge and wasn't intended on purpose.
+AC_LANG_PUSH([C++])dnl
+AS_VAR_PUSHDEF([Boost_lib], [boost_cv_lib_$1])dnl
+AS_VAR_PUSHDEF([Boost_lib_LDFLAGS], [boost_cv_lib_$1_LDFLAGS])dnl
+AS_VAR_PUSHDEF([Boost_lib_LDPATH], [boost_cv_lib_$1_LDPATH])dnl
+AS_VAR_PUSHDEF([Boost_lib_LIBS], [boost_cv_lib_$1_LIBS])dnl
+BOOST_FIND_HEADER([$4])
+boost_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib],
+ [_BOOST_FIND_LIBS($@)])
+case $Boost_lib in #(
+ (no) _AC_MSG_LOG_CONFTEST
+ AC_MSG_ERROR([cannot find the flags to link with Boost $1])
+ ;;
+esac
+AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS])dnl
+AC_SUBST(AS_TR_CPP([BOOST_$1_LDPATH]), [$Boost_lib_LDPATH])dnl
+AC_SUBST([BOOST_LDPATH], [$Boost_lib_LDPATH])dnl
+AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS])dnl
+CPPFLAGS=$boost_save_CPPFLAGS
+AS_VAR_POPDEF([Boost_lib])dnl
+AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl
+AS_VAR_POPDEF([Boost_lib_LDPATH])dnl
+AS_VAR_POPDEF([Boost_lib_LIBS])dnl
+AC_LANG_POP([C++])dnl
+fi
+])
+
+
+# BOOST_FIND_LIB([LIB-NAME],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Backward compatibility wrapper for BOOST_FIND_LIBS.
+AC_DEFUN([BOOST_FIND_LIB],
+[BOOST_FIND_LIBS([$1], $@)])
+
+
+# _BOOST_FIND_LIBS([LIB-NAME], [CANDIDATE-LIB-NAMES],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Real implementation of BOOST_FIND_LIBS: rely on these local macros:
+# Boost_lib, Boost_lib_LDFLAGS, Boost_lib_LDPATH, Boost_lib_LIBS
+#
+# The algorithm is as follows: first look for a given library name
+# according to the user's PREFERRED-RT-OPT. For each library name, we
+# prefer to use the ones that carry the tag (toolset name). Each
+# library is searched through the various standard paths were Boost is
+# usually installed. If we can't find the standard variants, we try
+# to enforce -mt (for instance on MacOSX, libboost_thread.dylib
+# doesn't exist but there's -obviously- libboost_thread-mt.dylib).
+AC_DEFUN([_BOOST_FIND_LIBS],
+[Boost_lib=no
+ case "$3" in #(
+ (mt | mt-) boost_mt=-mt; boost_rtopt=;; #(
+ (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$3" : 'Xmt-*\(.*\)'`;; #(
+ (*) boost_mt=; boost_rtopt=$3;;
+ esac
+ if test $enable_static_boost = yes; then
+ boost_rtopt="s$boost_rtopt"
+ fi
+ # Find the proper debug variant depending on what we've been asked to find.
+ case $boost_rtopt in #(
+ (*d*) boost_rt_d=$boost_rtopt;; #(
+ (*[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn')
+ boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #(
+ (*) boost_rt_d='-d';;
+ esac
+ # If the PREFERRED-RT-OPT are not empty, prepend a `-'.
+ test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt"
+ $boost_guess_use_mt && boost_mt=-mt
+ # Look for the abs path the static archive.
+ # $libext is computed by Libtool but let's make sure it's non empty.
+ test -z "$libext" &&
+ AC_MSG_ERROR([the libext variable is empty, did you invoke Libtool?])
+ boost_save_ac_objext=$ac_objext
+ # Generate the test file.
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$4>
+$6], [$5])])
+dnl Optimization hacks: compiling C++ is slow, especially with Boost. What
+dnl we're trying to do here is guess the right combination of link flags
+dnl (LIBS / LDFLAGS) to use a given library. This can take several
+dnl iterations before it succeeds and is thus *very* slow. So what we do
+dnl instead is that we compile the code first (and thus get an object file,
+dnl typically conftest.o). Then we try various combinations of link flags
+dnl until we succeed to link conftest.o in an executable. The problem is
+dnl that the various TRY_LINK / COMPILE_IFELSE macros of Autoconf always
+dnl remove all the temporary files including conftest.o. So the trick here
+dnl is to temporarily change the value of ac_objext so that conftest.o is
+dnl preserved accross tests. This is obviously fragile and I will burn in
+dnl hell for not respecting Autoconf's documented interfaces, but in the
+dnl mean time, it optimizes the macro by a factor of 5 to 30.
+dnl Another small optimization: the first argument of AC_COMPILE_IFELSE left
+dnl empty because the test file is generated only once above (before we
+dnl start the for loops).
+ AC_COMPILE_IFELSE([],
+ [ac_objext=do_not_rm_me_plz],
+ [AC_MSG_ERROR([cannot compile a test that uses Boost $1])])
+ ac_objext=$boost_save_ac_objext
+ boost_failed_libs=
+# Don't bother to ident the following nested for loops, only the 2
+# innermost ones matter.
+for boost_lib_ in $2; do
+for boost_tag_ in -$boost_cv_lib_tag ''; do
+for boost_ver_ in -$boost_cv_lib_version ''; do
+for boost_mt_ in $boost_mt -mt ''; do
+for boost_rtopt_ in $boost_rtopt '' -d; do
+ for boost_lib in \
+ boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_ver_
+ do
+ # Avoid testing twice the same lib
+ case $boost_failed_libs in #(
+ (*@$boost_lib@*) continue;;
+ esac
+ # If with_boost is empty, we'll search in /lib first, which is not quite
+ # right so instead we'll try to a location based on where the headers are.
+ boost_tmp_lib=$with_boost
+ test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include}
+ for boost_ldpath in "$boost_tmp_lib/lib" '' \
+ /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \
+ "$with_boost" C:/Boost/lib /lib*
+ do
+ # Don't waste time with directories that don't exist.
+ if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then
+ continue
+ fi
+ boost_save_LDFLAGS=$LDFLAGS
+ # Are we looking for a static library?
+ case $boost_ldpath:$boost_rtopt_ in #(
+ (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt)
+ Boost_lib_LIBS="$boost_ldpath/lib$boost_lib.$libext"
+ test -e "$Boost_lib_LIBS" || continue;; #(
+ (*) # No: use -lboost_foo to find the shared library.
+ Boost_lib_LIBS="-l$boost_lib";;
+ esac
+ boost_save_LIBS=$LIBS
+ LIBS="$Boost_lib_LIBS $LIBS"
+ test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath"
+dnl First argument of AC_LINK_IFELSE left empty because the test file is
+dnl generated only once above (before we start the for loops).
+ _BOOST_AC_LINK_IFELSE([],
+ [Boost_lib=yes], [Boost_lib=no])
+ ac_objext=$boost_save_ac_objext
+ LDFLAGS=$boost_save_LDFLAGS
+ LIBS=$boost_save_LIBS
+ if test x"$Boost_lib" = xyes; then
+ # Check or used cached result of whether or not using -R or
+ # -rpath makes sense. Some implementations of ld, such as for
+ # Mac OSX, require -rpath but -R is the flag known to work on
+ # other systems. https://github.com/tsuna/boost.m4/issues/19
+ AC_CACHE_VAL([boost_cv_rpath_link_ldflag],
+ [case $boost_ldpath in
+ '') # Nothing to do.
+ boost_cv_rpath_link_ldflag=
+ boost_rpath_link_ldflag_found=yes;;
+ *)
+ for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do
+ LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
+ LIBS="$boost_save_LIBS $Boost_lib_LIBS"
+ _BOOST_AC_LINK_IFELSE([],
+ [boost_rpath_link_ldflag_found=yes
+ break],
+ [boost_rpath_link_ldflag_found=no])
+ done
+ ;;
+ esac
+ AS_IF([test "x$boost_rpath_link_ldflag_found" != "xyes"],
+ [AC_MSG_ERROR([Unable to determine whether to use -R or -rpath])])
+ LDFLAGS=$boost_save_LDFLAGS
+ LIBS=$boost_save_LIBS
+ ])
+ test x"$boost_ldpath" != x &&
+ Boost_lib_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
+ Boost_lib_LDPATH="$boost_ldpath"
+ break 7
+ else
+ boost_failed_libs="$boost_failed_libs@$boost_lib@"
+ fi
+ done
+ done
+done
+done
+done
+done
+done # boost_lib_
+rm -f conftest.$ac_objext
+])
+
+
+
+# --------------------------------------- #
+# Checks for the various Boost libraries. #
+# --------------------------------------- #
+
+# List of boost libraries: http://www.boost.org/libs/libraries.htm
+# The page http://beta.boost.org/doc/libs is useful: it gives the first release
+# version of each library (among other things).
+
+# BOOST_DEFUN(LIBRARY, CODE)
+# --------------------------
+# Define BOOST_<LIBRARY-UPPERCASE> as a macro that runs CODE.
+#
+# Use indir to avoid the warning on underquoted macro name given to AC_DEFUN.
+m4_define([BOOST_DEFUN],
+[m4_indir([AC_DEFUN],
+ m4_toupper([BOOST_$1]),
+[m4_pushdef([BOOST_Library], [$1])dnl
+$2
+m4_popdef([BOOST_Library])dnl
+])
+])
+
+# BOOST_ARRAY()
+# -------------
+# Look for Boost.Array
+BOOST_DEFUN([Array],
+[BOOST_FIND_HEADER([boost/array.hpp])])
+
+
+# BOOST_ASIO()
+# ------------
+# Look for Boost.Asio (new in Boost 1.35).
+BOOST_DEFUN([Asio],
+[AC_REQUIRE([BOOST_SYSTEM])dnl
+BOOST_FIND_HEADER([boost/asio.hpp])])
+
+
+# BOOST_BIND()
+# ------------
+# Look for Boost.Bind.
+BOOST_DEFUN([Bind],
+[BOOST_FIND_HEADER([boost/bind.hpp])])
+
+
+# BOOST_CHRONO()
+# --------------
+# Look for Boost.Chrono.
+BOOST_DEFUN([Chrono],
+[# Do we have to check for Boost.System? This link-time dependency was
+# added as of 1.35.0. If we have a version <1.35, we must not attempt to
+# find Boost.System as it didn't exist by then.
+if test $boost_major_version -ge 135; then
+ BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+boost_filesystem_save_LIBS=$LIBS
+boost_filesystem_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([chrono], [$1],
+ [boost/chrono.hpp],
+ [boost::chrono::thread_clock d;])
+if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
+ BOOST_CHRONO_LIBS="$BOOST_CHRONO_LIBS $BOOST_SYSTEM_LIBS"
+fi
+LIBS=$boost_filesystem_save_LIBS
+LDFLAGS=$boost_filesystem_save_LDFLAGS
+])# BOOST_CHRONO
+
+
+# BOOST_CONTEXT([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Context. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+#
+# * This library was introduced in Boost 1.51.0
+# * The signatures of make_fcontext() and jump_fcontext were changed in 1.56.0
+# * A dependency on boost_thread appears in 1.57.0
+BOOST_DEFUN([Context],
+[boost_context_save_LIBS=$LIBS
+ boost_context_save_LDFLAGS=$LDFLAGS
+if test $boost_major_version -ge 157; then
+ BOOST_THREAD([$1])
+ m4_pattern_allow([^BOOST_THREAD_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_THREAD_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_THREAD_LDFLAGS"
+fi
+BOOST_FIND_LIB([context], [$1],
+ [boost/context/all.hpp],[[
+
+// creates a stack
+void * stack_pointer = new void*[4096];
+std::size_t const size = sizeof(void*[4096]);
+
+#if BOOST_VERSION <= 105100
+ctx::make_fcontext(&fc, f);
+return ctx::jump_fcontext(&fcm, &fc, 3) == 6;
+
+#else
+
+fc = ctx::make_fcontext(stack_pointer, size, f);
+return ctx::jump_fcontext(&fcm, fc, 3) == 6;
+
+#endif
+
+
+]],[dnl
+
+#include <boost/version.hpp>
+#if BOOST_VERSION <= 105100
+
+namespace ctx = boost::ctx;
+
+static ctx::fcontext_t fcm, fc;
+
+static void f(intptr_t i) {
+ ctx::jump_fcontext(&fc, &fcm, i * 2);
+}
+
+#elif BOOST_VERSION <= 105500
+
+namespace ctx = boost::context;
+
+// context
+static ctx::fcontext_t fcm, *fc;
+
+// context-function
+static void f(intptr_t i) {
+ ctx::jump_fcontext(fc, &fcm, i * 2);
+}
+
+#else
+
+namespace ctx = boost::context;
+
+// context
+static ctx::fcontext_t fcm, fc;
+
+// context-function
+static void f(intptr_t i) {
+ ctx::jump_fcontext(&fc, fcm, i * 2);
+}
+#endif
+])
+LIBS=$boost_context_save_LIBS
+LDFLAGS=$boost_context_save_LDFLAGS
+])# BOOST_CONTEXT
+
+
+# BOOST_CONVERSION()
+# ------------------
+# Look for Boost.Conversion (cast / lexical_cast)
+BOOST_DEFUN([Conversion],
+[BOOST_FIND_HEADER([boost/cast.hpp])
+BOOST_FIND_HEADER([boost/lexical_cast.hpp])
+])# BOOST_CONVERSION
+
+
+# BOOST_COROUTINE([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Coroutine. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. This library was introduced in Boost
+# 1.53.0
+BOOST_DEFUN([Coroutine],
+[
+boost_coroutine_save_LIBS=$LIBS
+boost_coroutine_save_LDFLAGS=$LDFLAGS
+# Link-time dependency from coroutine to context
+BOOST_CONTEXT([$1])
+# Starting from Boost 1.55 a dependency on Boost.System is added
+if test $boost_major_version -ge 155; then
+ BOOST_SYSTEM([$1])
+fi
+m4_pattern_allow([^BOOST_(CONTEXT|SYSTEM)_(LIBS|LDFLAGS)])
+LIBS="$LIBS $BOOST_CONTEXT_LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_CONTEXT_LDFLAGS"
+
+# in 1.53 coroutine was a header only library
+if test $boost_major_version -eq 153; then
+ BOOST_FIND_HEADER([boost/coroutine/coroutine.hpp])
+else
+ BOOST_FIND_LIB([coroutine], [$1],
+ [boost/coroutine/coroutine.hpp],
+ [
+ #include <boost/version.hpp>
+ #if BOOST_VERSION <= 105500
+ boost::coroutines::coroutine<int(int)> coro; coro.get();
+ #else
+ boost::coroutines::asymmetric_coroutine<int>::pull_type coro; coro.get();
+ #endif
+ ])
+fi
+# Link-time dependency from coroutine to context, existed only in 1.53, in 1.54
+# coroutine doesn't use context from its headers but from its library.
+if test $boost_major_version -eq 153 || test $enable_static_boost = yes && test $boost_major_version -ge 154; then
+ BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_CONTEXT_LIBS"
+ BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_CONTEXT_LDFLAGS"
+fi
+if test $enable_static_boost = yes && test $boost_major_version -ge 155; then
+ BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_SYSTEM_LIBS"
+ BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+fi
+LIBS=$boost_coroutine_save_LIBS
+LDFLAGS=$boost_coroutine_save_LDFLAGS
+])# BOOST_COROUTINE
+
+
+# BOOST_CRC()
+# -----------
+# Look for Boost.CRC
+BOOST_DEFUN([CRC],
+[BOOST_FIND_HEADER([boost/crc.hpp])
+])# BOOST_CRC
+
+
+# BOOST_DATE_TIME([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Date_Time. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Date_Time],
+[BOOST_FIND_LIB([date_time], [$1],
+ [boost/date_time/posix_time/posix_time.hpp],
+ [boost::posix_time::ptime t;])
+])# BOOST_DATE_TIME
+
+
+# BOOST_FILESYSTEM([PREFERRED-RT-OPT])
+# ------------------------------------
+# Look for Boost.Filesystem. For the documentation of PREFERRED-RT-OPT, see
+# the documentation of BOOST_FIND_LIB above.
+# Do not check for boost/filesystem.hpp because this file was introduced in
+# 1.34.
+BOOST_DEFUN([Filesystem],
+[# Do we have to check for Boost.System? This link-time dependency was
+# added as of 1.35.0. If we have a version <1.35, we must not attempt to
+# find Boost.System as it didn't exist by then.
+if test $boost_major_version -ge 135; then
+ BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+boost_filesystem_save_LIBS=$LIBS
+boost_filesystem_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([filesystem], [$1],
+ [boost/filesystem/path.hpp], [boost::filesystem::path p;])
+if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
+ BOOST_FILESYSTEM_LIBS="$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"
+fi
+LIBS=$boost_filesystem_save_LIBS
+LDFLAGS=$boost_filesystem_save_LDFLAGS
+])# BOOST_FILESYSTEM
+
+
+# BOOST_FLYWEIGHT()
+# -----------------
+# Look for Boost.Flyweight.
+BOOST_DEFUN([Flyweight],
+[dnl There's a hidden dependency on pthreads.
+AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
+BOOST_FIND_HEADER([boost/flyweight.hpp])
+AC_SUBST([BOOST_FLYWEIGHT_LIBS], [$boost_cv_pthread_flag])
+])
+
+
+# BOOST_FOREACH()
+# ---------------
+# Look for Boost.Foreach.
+BOOST_DEFUN([Foreach],
+[BOOST_FIND_HEADER([boost/foreach.hpp])])
+
+
+# BOOST_FORMAT()
+# --------------
+# Look for Boost.Format.
+# Note: we can't check for boost/format/format_fwd.hpp because the header isn't
+# standalone. It can't be compiled because it triggers the following error:
+# boost/format/detail/config_macros.hpp:88: error: 'locale' in namespace 'std'
+# does not name a type
+BOOST_DEFUN([Format],
+[BOOST_FIND_HEADER([boost/format.hpp])])
+
+
+# BOOST_FUNCTION()
+# ----------------
+# Look for Boost.Function
+BOOST_DEFUN([Function],
+[BOOST_FIND_HEADER([boost/function.hpp])])
+
+
+# BOOST_GEOMETRY()
+# ----------------
+# Look for Boost.Geometry (new since 1.47.0).
+BOOST_DEFUN([Geometry],
+[BOOST_FIND_HEADER([boost/geometry.hpp])
+])# BOOST_GEOMETRY
+
+
+# BOOST_GRAPH([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost.Graphs. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Graph],
+[boost_graph_save_LIBS=$LIBS
+boost_graph_save_LDFLAGS=$LDFLAGS
+# Link-time dependency from graph to regex was added as of 1.40.0.
+if test $boost_major_version -ge 140; then
+ BOOST_REGEX([$1])
+ m4_pattern_allow([^BOOST_REGEX_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_REGEX_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_REGEX_LDFLAGS"
+fi
+BOOST_FIND_LIB([graph], [$1],
+ [boost/graph/adjacency_list.hpp], [boost::adjacency_list<> g;])
+LIBS=$boost_graph_save_LIBS
+LDFLAGS=$boost_graph_save_LDFLAGS
+])# BOOST_GRAPH
+
+
+# BOOST_IOSTREAMS([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.IOStreams. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([IOStreams],
+[BOOST_FIND_LIB([iostreams], [$1],
+ [boost/iostreams/device/file_descriptor.hpp],
+ [boost::iostreams::file_descriptor fd; fd.close();])
+])# BOOST_IOSTREAMS
+
+
+# BOOST_HASH()
+# ------------
+# Look for Boost.Functional/Hash
+BOOST_DEFUN([Hash],
+[BOOST_FIND_HEADER([boost/functional/hash.hpp])])
+
+
+# BOOST_LAMBDA()
+# --------------
+# Look for Boost.Lambda
+BOOST_DEFUN([Lambda],
+[BOOST_FIND_HEADER([boost/lambda/lambda.hpp])])
+
+
+# BOOST_LOCALE()
+# --------------
+# Look for Boost.Locale
+BOOST_DEFUN([Locale],
+[
+boost_locale_save_LIBS=$LIBS
+boost_locale_save_LDFLAGS=$LDFLAGS
+# require SYSTEM for boost-1.50.0 and up
+if test $boost_major_version -ge 150; then
+ BOOST_SYSTEM([$1])
+ m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+fi # end of the Boost.System check.
+BOOST_FIND_LIB([locale], [$1],
+ [boost/locale.hpp],
+ [[boost::locale::generator gen; std::locale::global(gen(""));]])
+LIBS=$boost_locale_save_LIBS
+LDFLAGS=$boost_locale_save_LDFLAGS
+])# BOOST_LOCALE
+
+# BOOST_LOG([PREFERRED-RT-OPT])
+# -----------------------------
+# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Log],
+[boost_log_save_LIBS=$LIBS
+boost_log_save_LDFLAGS=$LDFLAGS
+BOOST_SYSTEM([$1])
+BOOST_FILESYSTEM([$1])
+BOOST_DATE_TIME([$1])
+m4_pattern_allow([^BOOST_(SYSTEM|FILESYSTEM|DATE_TIME)_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_DATE_TIME_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_DATE_TIME_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([log], [$1],
+ [boost/log/core/core.hpp],
+ [boost::log::attribute a; a.get_value();])
+LIBS=$boost_log_save_LIBS
+LDFLAGS=$boost_log_save_LDFLAGS
+])# BOOST_LOG
+
+
+# BOOST_LOG_SETUP([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Log_Setup],
+[boost_log_setup_save_LIBS=$LIBS
+boost_log_setup_save_LDFLAGS=$LDFLAGS
+BOOST_LOG([$1])
+m4_pattern_allow([^BOOST_LOG_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_LOG_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_LOG_LDFLAGS"
+BOOST_FIND_LIB([log_setup], [$1],
+ [boost/log/utility/setup/from_settings.hpp],
+ [boost::log::basic_settings<char> bs; bs.empty();])
+LIBS=$boost_log_setup_save_LIBS
+LDFLAGS=$boost_log_setup_save_LDFLAGS
+])# BOOST_LOG_SETUP
+
+
+# BOOST_MATH()
+# ------------
+# Look for Boost.Math
+# TODO: This library isn't header-only but it comes in multiple different
+# flavors that don't play well with BOOST_FIND_LIB (e.g, libboost_math_c99,
+# libboost_math_c99f, libboost_math_c99l, libboost_math_tr1,
+# libboost_math_tr1f, libboost_math_tr1l). This macro must be fixed to do the
+# right thing anyway.
+BOOST_DEFUN([Math],
+[BOOST_FIND_HEADER([boost/math/special_functions.hpp])])
+
+
+# BOOST_MPI([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost MPI. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. Uses MPICXX variable if it is
+# set, otherwise tries CXX
+#
+BOOST_DEFUN([MPI],
+[boost_save_CXX=${CXX}
+boost_save_CXXCPP=${CXXCPP}
+if test x"${MPICXX}" != x; then
+ CXX=${MPICXX}
+ CXXCPP="${MPICXX} -E"
+fi
+BOOST_FIND_LIB([mpi], [$1],
+ [boost/mpi.hpp],
+ [int argc = 0;
+ char **argv = 0;
+ boost::mpi::environment env(argc,argv);])
+CXX=${boost_save_CXX}
+CXXCPP=${boost_save_CXXCPP}
+])# BOOST_MPI
+
+
+# BOOST_MULTIARRAY()
+# ------------------
+# Look for Boost.MultiArray
+BOOST_DEFUN([MultiArray],
+[BOOST_FIND_HEADER([boost/multi_array.hpp])])
+
+
+# BOOST_NUMERIC_UBLAS()
+# --------------------------
+# Look for Boost.NumericUblas (Basic Linear Algebra)
+BOOST_DEFUN([Numeric_Ublas],
+[BOOST_FIND_HEADER([boost/numeric/ublas/vector.hpp])
+])# BOOST_NUMERIC_UBLAS
+
+
+# BOOST_NUMERIC_CONVERSION()
+# --------------------------
+# Look for Boost.NumericConversion (policy-based numeric conversion)
+BOOST_DEFUN([Numeric_Conversion],
+[BOOST_FIND_HEADER([boost/numeric/conversion/converter.hpp])
+])# BOOST_NUMERIC_CONVERSION
+
+
+# BOOST_OPTIONAL()
+# ----------------
+# Look for Boost.Optional
+BOOST_DEFUN([Optional],
+[BOOST_FIND_HEADER([boost/optional.hpp])])
+
+
+# BOOST_PREPROCESSOR()
+# --------------------
+# Look for Boost.Preprocessor
+BOOST_DEFUN([Preprocessor],
+[BOOST_FIND_HEADER([boost/preprocessor/repeat.hpp])])
+
+
+# BOOST_RANGE()
+# --------------------
+# Look for Boost.Range
+BOOST_DEFUN([Range],
+[BOOST_FIND_HEADER([boost/range/adaptors.hpp])])
+
+# BOOST_UNORDERED()
+# -----------------
+# Look for Boost.Unordered
+BOOST_DEFUN([Unordered],
+[BOOST_FIND_HEADER([boost/unordered_map.hpp])])
+
+
+# BOOST_UUID()
+# ------------
+# Look for Boost.Uuid
+BOOST_DEFUN([Uuid],
+[BOOST_FIND_HEADER([boost/uuid/uuid.hpp])])
+
+
+# BOOST_PROGRAM_OPTIONS([PREFERRED-RT-OPT])
+# -----------------------------------------
+# Look for Boost.Program_options. For the documentation of PREFERRED-RT-OPT,
+# see the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Program_Options],
+[BOOST_FIND_LIB([program_options], [$1],
+ [boost/program_options.hpp],
+ [boost::program_options::options_description d("test");])
+])# BOOST_PROGRAM_OPTIONS
+
+
+
+# _BOOST_PYTHON_CONFIG(VARIABLE, FLAG)
+# ------------------------------------
+# Save VARIABLE, and define it via `python-config --FLAG`.
+# Substitute BOOST_PYTHON_VARIABLE.
+m4_define([_BOOST_PYTHON_CONFIG],
+[AC_SUBST([BOOST_PYTHON_$1],
+ [`python-config --$2 2>/dev/null`])dnl
+boost_python_save_$1=$$1
+$1="$$1 $BOOST_PYTHON_$1"])
+
+
+# BOOST_PYTHON([PREFERRED-RT-OPT])
+# --------------------------------
+# Look for Boost.Python. For the documentation of PREFERRED-RT-OPT,
+# see the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Python],
+[_BOOST_PYTHON_CONFIG([CPPFLAGS], [includes])
+_BOOST_PYTHON_CONFIG([LDFLAGS], [ldflags])
+_BOOST_PYTHON_CONFIG([LIBS], [libs])
+m4_pattern_allow([^BOOST_PYTHON_MODULE$])dnl
+BOOST_FIND_LIBS([python], [python python3], [$1],
+ [boost/python.hpp],
+ [], [BOOST_PYTHON_MODULE(empty) {}])
+CPPFLAGS=$boost_python_save_CPPFLAGS
+LDFLAGS=$boost_python_save_LDFLAGS
+LIBS=$boost_python_save_LIBS
+])# BOOST_PYTHON
+
+
+# BOOST_REF()
+# -----------
+# Look for Boost.Ref
+BOOST_DEFUN([Ref],
+[BOOST_FIND_HEADER([boost/ref.hpp])])
+
+
+# BOOST_REGEX([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost.Regex. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Regex],
+[BOOST_FIND_LIB([regex], [$1],
+ [boost/regex.hpp],
+ [boost::regex exp("*"); boost::regex_match("foo", exp);])
+])# BOOST_REGEX
+
+
+# BOOST_SERIALIZATION([PREFERRED-RT-OPT])
+# ---------------------------------------
+# Look for Boost.Serialization. For the documentation of PREFERRED-RT-OPT, see
+# the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Serialization],
+[BOOST_FIND_LIB([serialization], [$1],
+ [boost/archive/text_oarchive.hpp],
+ [std::ostream* o = 0; // Cheap way to get an ostream...
+ boost::archive::text_oarchive t(*o);])
+])# BOOST_SERIALIZATION
+
+
+# BOOST_SIGNALS([PREFERRED-RT-OPT])
+# ---------------------------------
+# Look for Boost.Signals. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Signals],
+[BOOST_FIND_LIB([signals], [$1],
+ [boost/signal.hpp],
+ [boost::signal<void ()> s;])
+])# BOOST_SIGNALS
+
+
+# BOOST_SIGNALS2()
+# ----------------
+# Look for Boost.Signals2 (new since 1.39.0).
+BOOST_DEFUN([Signals2],
+[BOOST_FIND_HEADER([boost/signals2.hpp])
+])# BOOST_SIGNALS2
+
+
+# BOOST_SMART_PTR()
+# -----------------
+# Look for Boost.SmartPtr
+BOOST_DEFUN([Smart_Ptr],
+[BOOST_FIND_HEADER([boost/scoped_ptr.hpp])
+BOOST_FIND_HEADER([boost/shared_ptr.hpp])
+])
+
+
+# BOOST_STATICASSERT()
+# --------------------
+# Look for Boost.StaticAssert
+BOOST_DEFUN([StaticAssert],
+[BOOST_FIND_HEADER([boost/static_assert.hpp])])
+
+
+# BOOST_STRING_ALGO()
+# -------------------
+# Look for Boost.StringAlgo
+BOOST_DEFUN([String_Algo],
+[BOOST_FIND_HEADER([boost/algorithm/string.hpp])
+])
+
+
+# BOOST_SYSTEM([PREFERRED-RT-OPT])
+# --------------------------------
+# Look for Boost.System. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. This library was introduced in Boost
+# 1.35.0.
+BOOST_DEFUN([System],
+[BOOST_FIND_LIB([system], [$1],
+ [boost/system/error_code.hpp],
+ [boost::system::error_code e; e.clear();])
+])# BOOST_SYSTEM
+
+
+# BOOST_TEST([PREFERRED-RT-OPT])
+# ------------------------------
+# Look for Boost.Test. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Test],
+[m4_pattern_allow([^BOOST_CHECK$])dnl
+BOOST_FIND_LIB([unit_test_framework], [$1],
+ [boost/test/unit_test.hpp], [BOOST_CHECK(2 == 2);],
+ [using boost::unit_test::test_suite;
+ test_suite* init_unit_test_suite(int argc, char ** argv)
+ { return NULL; }])
+])# BOOST_TEST
+
+
+# BOOST_THREAD([PREFERRED-RT-OPT])
+# ---------------------------------
+# Look for Boost.Thread. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Thread],
+[dnl Having the pthread flag is required at least on GCC3 where
+dnl boost/thread.hpp would complain if we try to compile without
+dnl -pthread on GNU/Linux.
+AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
+boost_thread_save_LIBS=$LIBS
+boost_thread_save_LDFLAGS=$LDFLAGS
+boost_thread_save_CPPFLAGS=$CPPFLAGS
+# Link-time dependency from thread to system was added as of 1.49.0.
+if test $boost_major_version -ge 149; then
+BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+CPPFLAGS="$CPPFLAGS $boost_cv_pthread_flag"
+
+# When compiling for the Windows platform, the threads library is named
+# differently. This suffix doesn't exist in new versions of Boost, or
+# possibly new versions of GCC on mingw I am assuming it's Boost's change for
+# now and I am setting version to 1.48, for lack of knowledge as to when this
+# change occurred.
+if test $boost_major_version -lt 148; then
+ case $host_os in
+ (*mingw*) boost_thread_lib_ext=_win32;;
+ esac
+fi
+BOOST_FIND_LIBS([thread], [thread$boost_thread_lib_ext],
+ [$1],
+ [boost/thread.hpp], [boost::thread t; boost::mutex m;])
+
+case $host_os in
+ (*mingw*) boost_thread_w32_socket_link=-lws2_32;;
+esac
+
+BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag $boost_thread_w32_socket_link"
+BOOST_THREAD_LDFLAGS="$BOOST_SYSTEM_LDFLAGS"
+BOOST_CPPFLAGS="$BOOST_CPPFLAGS $boost_cv_pthread_flag"
+LIBS=$boost_thread_save_LIBS
+LDFLAGS=$boost_thread_save_LDFLAGS
+CPPFLAGS=$boost_thread_save_CPPFLAGS
+])# BOOST_THREAD
+
+AU_ALIAS([BOOST_THREADS], [BOOST_THREAD])
+
+
+# BOOST_TOKENIZER()
+# -----------------
+# Look for Boost.Tokenizer
+BOOST_DEFUN([Tokenizer],
+[BOOST_FIND_HEADER([boost/tokenizer.hpp])])
+
+
+# BOOST_TRIBOOL()
+# ---------------
+# Look for Boost.Tribool
+BOOST_DEFUN([Tribool],
+[BOOST_FIND_HEADER([boost/logic/tribool_fwd.hpp])
+BOOST_FIND_HEADER([boost/logic/tribool.hpp])
+])
+
+
+# BOOST_TUPLE()
+# -------------
+# Look for Boost.Tuple
+BOOST_DEFUN([Tuple],
+[BOOST_FIND_HEADER([boost/tuple/tuple.hpp])])
+
+
+# BOOST_TYPETRAITS()
+# --------------------
+# Look for Boost.TypeTraits
+BOOST_DEFUN([TypeTraits],
+[BOOST_FIND_HEADER([boost/type_traits.hpp])])
+
+
+# BOOST_UTILITY()
+# ---------------
+# Look for Boost.Utility (noncopyable, result_of, base-from-member idiom,
+# etc.)
+BOOST_DEFUN([Utility],
+[BOOST_FIND_HEADER([boost/utility.hpp])])
+
+
+# BOOST_VARIANT()
+# ---------------
+# Look for Boost.Variant.
+BOOST_DEFUN([Variant],
+[BOOST_FIND_HEADER([boost/variant/variant_fwd.hpp])
+BOOST_FIND_HEADER([boost/variant.hpp])])
+
+
+# BOOST_POINTER_CONTAINER()
+# ------------------------
+# Look for Boost.PointerContainer
+BOOST_DEFUN([Pointer_Container],
+[BOOST_FIND_HEADER([boost/ptr_container/ptr_deque.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_list.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_vector.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_array.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_set.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_map.hpp])
+])# BOOST_POINTER_CONTAINER
+
+
+# BOOST_WAVE([PREFERRED-RT-OPT])
+# ------------------------------
+# NOTE: If you intend to use Wave/Spirit with thread support, make sure you
+# call BOOST_THREAD first.
+# Look for Boost.Wave. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Wave],
+[AC_REQUIRE([BOOST_FILESYSTEM])dnl
+AC_REQUIRE([BOOST_DATE_TIME])dnl
+boost_wave_save_LIBS=$LIBS
+boost_wave_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_((FILE)?SYSTEM|DATE_TIME|THREAD)_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS \
+$BOOST_THREAD_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS \
+$BOOST_DATE_TIME_LDFLAGS $BOOST_THREAD_LDFLAGS"
+BOOST_FIND_LIB([wave], [$1],
+ [boost/wave.hpp],
+ [boost::wave::token_id id; get_token_name(id);])
+LIBS=$boost_wave_save_LIBS
+LDFLAGS=$boost_wave_save_LDFLAGS
+])# BOOST_WAVE
+
+
+# BOOST_XPRESSIVE()
+# -----------------
+# Look for Boost.Xpressive (new since 1.36.0).
+BOOST_DEFUN([Xpressive],
+[BOOST_FIND_HEADER([boost/xpressive/xpressive.hpp])])
+
+
+# ----------------- #
+# Internal helpers. #
+# ----------------- #
+
+
+# _BOOST_PTHREAD_FLAG()
+# ---------------------
+# Internal helper for BOOST_THREAD. Computes boost_cv_pthread_flag
+# which must be used in CPPFLAGS and LIBS.
+#
+# Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3,
+# boost/thread.hpp will trigger a #error if -pthread isn't used:
+# boost/config/requires_threads.hpp:47:5: #error "Compiler threading support
+# is not turned on. Please set the correct command line options for
+# threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
+#
+# Based on ACX_PTHREAD: http://autoconf-archive.cryp.to/acx_pthread.html
+AC_DEFUN([_BOOST_PTHREAD_FLAG],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_LANG_PUSH([C++])dnl
+AC_CACHE_CHECK([for the flags needed to use pthreads], [boost_cv_pthread_flag],
+[ boost_cv_pthread_flag=
+ # The ordering *is* (sometimes) important. Some notes on the
+ # individual items follow:
+ # (none): in case threads are in libc; should be tried before -Kthread and
+ # other compiler flags to prevent continual compiler warnings
+ # -lpthreads: AIX (must check this before -lpthread)
+ # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+ # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+ # -llthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+ # -pthread: GNU Linux/GCC (kernel threads), BSD/GCC (userland threads)
+ # -pthreads: Solaris/GCC
+ # -mthreads: MinGW32/GCC, Lynx/GCC
+ # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+ # doesn't hurt to check since this sometimes defines pthreads too;
+ # also defines -D_REENTRANT)
+ # ... -mt is also the pthreads flag for HP/aCC
+ # -lpthread: GNU Linux, etc.
+ # --thread-safe: KAI C++
+ case $host_os in #(
+ *solaris*)
+ # On Solaris (at least, for some versions), libc contains stubbed
+ # (non-functional) versions of the pthreads routines, so link-based
+ # tests will erroneously succeed. (We need to link with -pthreads/-mt/
+ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
+ # a function called by this macro, so we could check for that, but
+ # who knows whether they'll stub that too in a future libc.) So,
+ # we'll just look for -pthreads and -lpthread first:
+ boost_pthread_flags="-pthreads -lpthread -mt -pthread";; #(
+ *)
+ boost_pthread_flags="-lpthreads -Kthread -kthread -llthread -pthread \
+ -pthreads -mthreads -lpthread --thread-safe -mt";;
+ esac
+ # Generate the test file.
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <pthread.h>],
+ [pthread_t th; pthread_join(th, 0);
+ pthread_attr_init(0); pthread_cleanup_push(0, 0);
+ pthread_create(0,0,0,0); pthread_cleanup_pop(0);])])
+ for boost_pthread_flag in '' $boost_pthread_flags; do
+ boost_pthread_ok=false
+dnl Re-use the test file already generated.
+ boost_pthreads__save_LIBS=$LIBS
+ LIBS="$LIBS $boost_pthread_flag"
+ AC_LINK_IFELSE([],
+ [if grep ".*$boost_pthread_flag" conftest.err; then
+ echo "This flag seems to have triggered warnings" >&AS_MESSAGE_LOG_FD
+ else
+ boost_pthread_ok=:; boost_cv_pthread_flag=$boost_pthread_flag
+ fi])
+ LIBS=$boost_pthreads__save_LIBS
+ $boost_pthread_ok && break
+ done
+])
+AC_LANG_POP([C++])dnl
+])# _BOOST_PTHREAD_FLAG
+
+
+# _BOOST_gcc_test(MAJOR, MINOR)
+# -----------------------------
+# Internal helper for _BOOST_FIND_COMPILER_TAG.
+m4_define([_BOOST_gcc_test],
+["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC @ gcc$1$2"])dnl
+
+# _BOOST_mingw_test(MAJOR, MINOR)
+# -----------------------------
+# Internal helper for _BOOST_FIND_COMPILER_TAG.
+m4_define([_BOOST_mingw_test],
+["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw$1$2"])dnl
+
+
+# _BOOST_FIND_COMPILER_TAG()
+# --------------------------
+# Internal. When Boost is installed without --layout=system, each library
+# filename will hold a suffix that encodes the compiler used during the
+# build. The Boost build system seems to call this a `tag'.
+AC_DEFUN([_BOOST_FIND_COMPILER_TAG],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_CACHE_CHECK([for the toolset name used by Boost for $CXX],
+ [boost_cv_lib_tag],
+[boost_cv_lib_tag=unknown
+if test x$boost_cv_inc_path != xno; then
+ AC_LANG_PUSH([C++])dnl
+ # The following tests are mostly inspired by boost/config/auto_link.hpp
+ # The list is sorted to most recent/common to oldest compiler (in order
+ # to increase the likelihood of finding the right compiler with the
+ # least number of compilation attempt).
+ # Beware that some tests are sensible to the order (for instance, we must
+ # look for MinGW before looking for GCC3).
+ # I used one compilation test per compiler with a #error to recognize
+ # each compiler so that it works even when cross-compiling (let me know
+ # if you know a better approach).
+ # Known missing tags (known from Boost's tools/build/v2/tools/common.jam):
+ # como, edg, kcc, bck, mp, sw, tru, xlc
+ # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines
+ # the same defines as GCC's).
+ for i in \
+ _BOOST_mingw_test(5, 3) \
+ _BOOST_gcc_test(5, 3) \
+ _BOOST_mingw_test(5, 2) \
+ _BOOST_gcc_test(5, 2) \
+ _BOOST_mingw_test(5, 1) \
+ _BOOST_gcc_test(5, 1) \
+ _BOOST_mingw_test(5, 0) \
+ _BOOST_gcc_test(5, 0) \
+ _BOOST_mingw_test(4, 10) \
+ _BOOST_gcc_test(4, 10) \
+ _BOOST_mingw_test(4, 9) \
+ _BOOST_gcc_test(4, 9) \
+ _BOOST_mingw_test(4, 8) \
+ _BOOST_gcc_test(4, 8) \
+ _BOOST_mingw_test(4, 7) \
+ _BOOST_gcc_test(4, 7) \
+ _BOOST_mingw_test(4, 6) \
+ _BOOST_gcc_test(4, 6) \
+ _BOOST_mingw_test(4, 5) \
+ _BOOST_gcc_test(4, 5) \
+ _BOOST_mingw_test(4, 4) \
+ _BOOST_gcc_test(4, 4) \
+ _BOOST_mingw_test(4, 3) \
+ _BOOST_gcc_test(4, 3) \
+ _BOOST_mingw_test(4, 2) \
+ _BOOST_gcc_test(4, 2) \
+ _BOOST_mingw_test(4, 1) \
+ _BOOST_gcc_test(4, 1) \
+ _BOOST_mingw_test(4, 0) \
+ _BOOST_gcc_test(4, 0) \
+ "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \
+ && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw" \
+ _BOOST_gcc_test(3, 4) \
+ _BOOST_gcc_test(3, 3) \
+ "defined _MSC_VER && _MSC_VER >= 1500 @ vc90" \
+ "defined _MSC_VER && _MSC_VER == 1400 @ vc80" \
+ _BOOST_gcc_test(3, 2) \
+ "defined _MSC_VER && _MSC_VER == 1310 @ vc71" \
+ _BOOST_gcc_test(3, 1) \
+ _BOOST_gcc_test(3, 0) \
+ "defined __BORLANDC__ @ bcb" \
+ "defined __ICC && (defined __unix || defined __unix__) @ il" \
+ "defined __ICL @ iw" \
+ "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \
+ _BOOST_gcc_test(2, 95) \
+ "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \
+ "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \
+ "defined _MSC_VER && _MSC_VER < 1300 && defined UNDER_CE @ evc4" \
+ "defined __MWERKS__ && __MWERKS__ <= 0x31FF @ cw8"
+ do
+ boost_tag_test=`expr "X$i" : 'X\([[^@]]*\) @ '`
+ boost_tag=`expr "X$i" : 'X[[^@]]* @ \(.*\)'`
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if $boost_tag_test
+/* OK */
+#else
+# error $boost_tag_test
+#endif
+]])], [boost_cv_lib_tag=$boost_tag; break], [])
+ done
+AC_LANG_POP([C++])dnl
+ case $boost_cv_lib_tag in #(
+ # Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed
+ # to "gcc41" for instance.
+ *-gcc | *'-gcc ') :;; #( Don't re-add -gcc: it's already in there.
+ gcc*)
+ boost_tag_x=
+ case $host_os in #(
+ darwin*)
+ if test $boost_major_version -ge 136; then
+ # The `x' added in r46793 of Boost.
+ boost_tag_x=x
+ fi;;
+ esac
+ # We can specify multiple tags in this variable because it's used by
+ # BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ...
+ boost_cv_lib_tag="$boost_tag_x$boost_cv_lib_tag -${boost_tag_x}gcc"
+ ;; #(
+ unknown)
+ AC_MSG_WARN([[could not figure out which toolset name to use for $CXX]])
+ boost_cv_lib_tag=
+ ;;
+ esac
+fi])dnl end of AC_CACHE_CHECK
+])# _BOOST_FIND_COMPILER_TAG
+
+
+# _BOOST_GUESS_WHETHER_TO_USE_MT()
+# --------------------------------
+# Compile a small test to try to guess whether we should favor MT (Multi
+# Thread) flavors of Boost. Sets boost_guess_use_mt accordingly.
+AC_DEFUN([_BOOST_GUESS_WHETHER_TO_USE_MT],
+[# Check whether we do better use `mt' even though we weren't ask to.
+AC_LANG_PUSH([C++])dnl
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if defined _REENTRANT || defined _MT || defined __MT__
+/* use -mt */
+#else
+# error MT not needed
+#endif
+]])], [boost_guess_use_mt=:], [boost_guess_use_mt=false])
+AC_LANG_POP([C++])dnl
+])
+
+# _BOOST_AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+# -------------------------------------------------------------------
+# Fork of _AC_LINK_IFELSE that preserves conftest.o across calls. Fragile,
+# will break when Autoconf changes its internals. Requires that you manually
+# rm -f conftest.$ac_objext in between to really different tests, otherwise
+# you will try to link a conftest.o left behind by a previous test.
+# Used to aggressively optimize BOOST_FIND_LIB (see the big comment in this
+# macro).
+#
+# Don't use "break" in the actions, as it would short-circuit some code
+# this macro runs after the actions.
+m4_define([_BOOST_AC_LINK_IFELSE],
+[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
+rm -f conftest$ac_exeext
+boost_save_ac_ext=$ac_ext
+boost_use_source=:
+# If we already have a .o, re-use it. We change $ac_ext so that $ac_link
+# tries to link the existing object file instead of compiling from source.
+test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false &&
+ _AS_ECHO_LOG([re-using the existing conftest.$ac_objext])
+AS_IF([_AC_DO_STDERR($ac_link) && {
+ test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_executable_p conftest$ac_exeext
+dnl FIXME: use AS_TEST_X instead when 2.61 is widespread enough.
+ }],
+ [$2],
+ [if $boost_use_source; then
+ _AC_MSG_LOG_CONFTEST
+ fi
+ $3])
+ac_objext=$boost_save_ac_objext
+ac_ext=$boost_save_ac_ext
+dnl Delete also the IPA/IPO (Inter Procedural Analysis/Optimization)
+dnl information created by the PGI compiler (conftest_ipa8_conftest.oo),
+dnl as it would interfere with the next link command.
+rm -f core conftest.err conftest_ipa8_conftest.oo \
+ conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl
+])# _BOOST_AC_LINK_IFELSE
+
+# Local Variables:
+# mode: autoconf
+# End:
diff --git a/org.eclipse.efm.symbex/cmake/cvc4-master-patch/config/boost.m4.txt b/org.eclipse.efm.symbex/cmake/cvc4-master-patch/config/boost.m4.txt
new file mode 100644
index 0000000..27d063f
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/cvc4-master-patch/config/boost.m4.txt
@@ -0,0 +1,1560 @@
+# boost.m4: Locate Boost headers and libraries for autoconf-based projects.
+# Copyright (C) 2007-2011, 2014 Benoit Sigoure <tsuna@lrde.epita.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Additional permission under section 7 of the GNU General Public
+# License, version 3 ("GPLv3"):
+#
+# If you convey this file as part of a work that contains a
+# configuration script generated by Autoconf, you may do so under
+# terms of your choice.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+m4_define([_BOOST_SERIAL], [m4_translit([
+# serial 25
+], [#
+], [])])
+
+# Original sources can be found at http://github.com/tsuna/boost.m4
+# You can fetch the latest version of the script by doing:
+# wget http://github.com/tsuna/boost.m4/raw/master/build-aux/boost.m4
+
+# ------ #
+# README #
+# ------ #
+
+# This file provides several macros to use the various Boost libraries.
+# The first macro is BOOST_REQUIRE. It will simply check if it's possible to
+# find the Boost headers of a given (optional) minimum version and it will
+# define BOOST_CPPFLAGS accordingly. It will add an option --with-boost to
+# your configure so that users can specify non standard locations.
+# If the user's environment contains BOOST_ROOT and --with-boost was not
+# specified, --with-boost=$BOOST_ROOT is implicitly used.
+# For more README and documentation, go to http://github.com/tsuna/boost.m4
+# Note: THESE MACROS ASSUME THAT YOU USE LIBTOOL. If you don't, don't worry,
+# simply read the README, it will show you what to do step by step.
+
+m4_pattern_forbid([^_?(BOOST|Boost)_])
+
+
+# _BOOST_SED_CPP(SED-PROGRAM, PROGRAM,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# --------------------------------------------------------
+# Same as AC_EGREP_CPP, but leave the result in conftest.i.
+#
+# SED-PROGRAM is *not* overquoted, as in AC_EGREP_CPP. It is expanded
+# in double-quotes, so escape your double quotes.
+#
+# It could be useful to turn this into a macro which extracts the
+# value of any macro.
+m4_define([_BOOST_SED_CPP],
+[AC_LANG_PUSH([C++])dnl
+AC_LANG_PREPROC_REQUIRE()dnl
+AC_REQUIRE([AC_PROG_SED])dnl
+AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])])
+AS_IF([dnl eval is necessary to expand ac_cpp.
+dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
+dnl Beware of Windows end-of-lines, for instance if we are running
+dnl some Windows programs under Wine. In that case, boost/version.hpp
+dnl is certainly using "\r\n", but the regular Unix shell will only
+dnl strip `\n' with backquotes, not the `\r'. This results in
+dnl boost_cv_lib_version='1_37\r' for instance, which breaks
+dnl everything else.
+dnl Cannot use 'dnl' after [$4] because a trailing dnl may break AC_CACHE_CHECK
+dnl
+dnl Beware that GCC 5, when expanding macros, may embed # line directives
+dnl a within single line:
+dnl
+dnl # 1 "conftest.cc"
+dnl # 1 "<built-in>"
+dnl # 1 "<command-line>"
+dnl # 1 "conftest.cc"
+dnl # 1 "/opt/local/include/boost/version.hpp" 1 3
+dnl # 2 "conftest.cc" 2
+dnl boost-lib-version =
+dnl # 2 "conftest.cc" 3
+dnl "1_56"
+dnl
+dnl So get rid of the # lines, and glue the remaining ones together.
+(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+ grep -v '#' |
+ tr -d '\r' |
+ tr -s '\n' ' ' |
+ $SED -n -e "$1" >conftest.i 2>&1],
+ [$3],
+ [$4])
+rm -rf conftest*
+AC_LANG_POP([C++])dnl
+])# _BOOST_SED_CPP
+
+
+
+# BOOST_REQUIRE([VERSION], [ACTION-IF-NOT-FOUND])
+# -----------------------------------------------
+# Look for Boost. If version is given, it must either be a literal of the form
+# "X.Y.Z" where X, Y and Z are integers (the ".Z" part being optional) or a
+# variable "$var".
+# Defines the value BOOST_CPPFLAGS. This macro only checks for headers with
+# the required version, it does not check for any of the Boost libraries.
+# On # success, defines HAVE_BOOST. On failure, calls the optional
+# ACTION-IF-NOT-FOUND action if one was supplied.
+# Otherwise aborts with an error message.
+AC_DEFUN_ONCE([BOOST_REQUIRE],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_PROG_GREP])dnl
+echo "$as_me: this is boost.m4[]_BOOST_SERIAL" >&AS_MESSAGE_LOG_FD
+boost_save_IFS=$IFS
+boost_version_req=$1
+IFS=.
+set x $boost_version_req 0 0 0
+IFS=$boost_save_IFS
+shift
+boost_version_req=`expr "$[1]" '*' 100000 + "$[2]" '*' 100 + "$[3]"`
+boost_version_req_string=$[1].$[2].$[3]
+AC_ARG_WITH([boost],
+ [AS_HELP_STRING([--with-boost=DIR],
+ [prefix of Boost $1 @<:@guess@:>@])])dnl
+AC_ARG_VAR([BOOST_ROOT],[Location of Boost installation])dnl
+# If BOOST_ROOT is set and the user has not provided a value to
+# --with-boost, then treat BOOST_ROOT as if it the user supplied it.
+if test x"$BOOST_ROOT" != x; then
+ if test x"$with_boost" = x; then
+ AC_MSG_NOTICE([Detected BOOST_ROOT; continuing with --with-boost=$BOOST_ROOT])
+ with_boost=$BOOST_ROOT
+ else
+ AC_MSG_NOTICE([Detected BOOST_ROOT=$BOOST_ROOT, but overridden by --with-boost=$with_boost])
+ fi
+fi
+AC_SUBST([DISTCHECK_CONFIGURE_FLAGS],
+ ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"])dnl
+boost_save_CPPFLAGS=$CPPFLAGS
+ AC_CACHE_CHECK([for Boost headers version >= $boost_version_req_string],
+ [boost_cv_inc_path],
+ [boost_cv_inc_path=no
+AC_LANG_PUSH([C++])dnl
+m4_pattern_allow([^BOOST_VERSION$])dnl
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#include <boost/version.hpp>
+#if !defined BOOST_VERSION
+# error BOOST_VERSION is not defined
+#elif BOOST_VERSION < $boost_version_req
+# error Boost headers version < $boost_version_req
+#endif
+]])])
+ # If the user provided a value to --with-boost, use it and only it.
+ case $with_boost in #(
+ ''|yes) set x '' /opt/local/include /usr/local/include /opt/include \
+ /usr/include C:/Boost/include;; #(
+ *) set x "$with_boost/include" "$with_boost";;
+ esac
+ shift
+ for boost_dir
+ do
+ # Without --layout=system, Boost (or at least some versions) installs
+ # itself in <prefix>/include/boost-<version>. This inner loop helps to
+ # find headers in such directories.
+ #
+ # Any ${boost_dir}/boost-x_xx directories are searched in reverse version
+ # order followed by ${boost_dir}. The final '.' is a sentinel for
+ # searching $boost_dir" itself. Entries are whitespace separated.
+ #
+ # I didn't indent this loop on purpose (to avoid over-indented code)
+ boost_layout_system_search_list=`cd "$boost_dir" 2>/dev/null \
+ && ls -1 | "${GREP}" '^boost-' | sort -rn -t- -k2 \
+ && echo .`
+ for boost_inc in $boost_layout_system_search_list
+ do
+ if test x"$boost_inc" != x.; then
+ boost_inc="$boost_dir/$boost_inc"
+ else
+ boost_inc="$boost_dir" # Uses sentinel in boost_layout_system_search_list
+ fi
+ if test x"$boost_inc" != x; then
+ # We are going to check whether the version of Boost installed
+ # in $boost_inc is usable by running a compilation that
+ # #includes it. But if we pass a -I/some/path in which Boost
+ # is not installed, the compiler will just skip this -I and
+ # use other locations (either from CPPFLAGS, or from its list
+ # of system include directories). As a result we would use
+ # header installed on the machine instead of the /some/path
+ # specified by the user. So in that precise case (trying
+ # $boost_inc), make sure the version.hpp exists.
+ #
+ # Use test -e as there can be symlinks.
+ test -e "$boost_inc/boost/version.hpp" || continue
+ CPPFLAGS="$CPPFLAGS -I$boost_inc"
+ fi
+ AC_COMPILE_IFELSE([], [boost_cv_inc_path=yes], [boost_cv_version=no])
+ if test x"$boost_cv_inc_path" = xyes; then
+ if test x"$boost_inc" != x; then
+ boost_cv_inc_path=$boost_inc
+ fi
+ break 2
+ fi
+ done
+ done
+AC_LANG_POP([C++])dnl
+ ])
+ case $boost_cv_inc_path in #(
+ no)
+ boost_errmsg="cannot find Boost headers version >= $boost_version_req_string"
+ m4_if([$2], [], [AC_MSG_ERROR([$boost_errmsg])],
+ [AC_MSG_NOTICE([$boost_errmsg])])
+ $2
+ ;;#(
+ yes)
+ BOOST_CPPFLAGS=
+ ;;#(
+ *)
+ AC_SUBST([BOOST_CPPFLAGS], ["-I$boost_cv_inc_path"])dnl
+ ;;
+ esac
+ if test x"$boost_cv_inc_path" != xno; then
+ AC_DEFINE([HAVE_BOOST], [1],
+ [Defined if the requested minimum BOOST version is satisfied])
+ AC_CACHE_CHECK([for Boost's header version],
+ [boost_cv_lib_version],
+ [m4_pattern_allow([^BOOST_LIB_VERSION$])dnl
+ _BOOST_SED_CPP([[/^boost-lib-version = /{s///;s/[\" ]//g;p;q;}]],
+ [#include <boost/version.hpp>
+boost-lib-version = BOOST_LIB_VERSION],
+ [boost_cv_lib_version=`cat conftest.i`])])
+ # e.g. "134" for 1_34_1 or "135" for 1_35
+ boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'`
+ case $boost_major_version in #(
+ '' | *[[!0-9]]*)
+ AC_MSG_ERROR([invalid value: boost_major_version='$boost_major_version'])
+ ;;
+ esac
+fi
+CPPFLAGS=$boost_save_CPPFLAGS
+])# BOOST_REQUIRE
+
+
+# BOOST_STATIC()
+# --------------
+# Add the "--enable-static-boost" configure argument. If this argument is given
+# on the command line, static versions of the libraries will be looked up.
+AC_DEFUN([BOOST_STATIC],
+ [AC_ARG_ENABLE([static-boost],
+ [AS_HELP_STRING([--enable-static-boost],
+ [Prefer the static boost libraries over the shared ones [no]])],
+ [enable_static_boost=yes],
+ [enable_static_boost=no])])# BOOST_STATIC
+
+
+# BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND])
+# --------------------------------------------------------------------------
+# Wrapper around AC_CHECK_HEADER for Boost headers. Useful to check for
+# some parts of the Boost library which are only made of headers and don't
+# require linking (such as Boost.Foreach).
+#
+# Default ACTION-IF-NOT-FOUND: Fail with a fatal error unless Boost couldn't be
+# found in the first place, in which case by default a notice is issued to the
+# user. Presumably if we haven't died already it's because it's OK to not have
+# Boost, which is why only a notice is issued instead of a hard error.
+#
+# Default ACTION-IF-FOUND: define the preprocessor symbol HAVE_<HEADER-NAME> in
+# case of success # (where HEADER-NAME is written LIKE_THIS, e.g.,
+# HAVE_BOOST_FOREACH_HPP).
+AC_DEFUN([BOOST_FIND_HEADER],
+[AC_REQUIRE([BOOST_REQUIRE])dnl
+if test x"$boost_cv_inc_path" = xno; then
+ m4_default([$2], [AC_MSG_NOTICE([Boost not available, not searching for $1])])
+else
+AC_LANG_PUSH([C++])dnl
+boost_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+AC_CHECK_HEADER([$1],
+ [m4_default([$3], [AC_DEFINE(AS_TR_CPP([HAVE_$1]), [1],
+ [Define to 1 if you have <$1>])])],
+ [m4_default([$2], [AC_MSG_ERROR([cannot find $1])])])
+CPPFLAGS=$boost_save_CPPFLAGS
+AC_LANG_POP([C++])dnl
+fi
+])# BOOST_FIND_HEADER
+
+
+# BOOST_FIND_LIBS([COMPONENT-NAME], [CANDIDATE-LIB-NAMES],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Look for the Boost library COMPONENT-NAME (e.g., `thread', for
+# libboost_thread) under the possible CANDIDATE-LIB-NAMES (e.g.,
+# "thread_win32 thread"). Check that HEADER-NAME works and check that
+# libboost_LIB-NAME can link with the code CXX-TEST. The optional
+# argument CXX-PROLOGUE can be used to include some C++ code before
+# the `main' function.
+#
+# Invokes BOOST_FIND_HEADER([HEADER-NAME]) (see above).
+#
+# Boost libraries typically come compiled with several flavors (with different
+# runtime options) so PREFERRED-RT-OPT is the preferred suffix. A suffix is one
+# or more of the following letters: sgdpn (in that order). s = static
+# runtime, d = debug build, g = debug/diagnostic runtime, p = STLPort build,
+# n = (unsure) STLPort build without iostreams from STLPort (it looks like `n'
+# must always be used along with `p'). Additionally, PREFERRED-RT-OPT can
+# start with `mt-' to indicate that there is a preference for multi-thread
+# builds. Some sample values for PREFERRED-RT-OPT: (nothing), mt, d, mt-d, gdp
+# ... If you want to make sure you have a specific version of Boost
+# (eg, >= 1.33) you *must* invoke BOOST_REQUIRE before this macro.
+AC_DEFUN([BOOST_FIND_LIBS],
+[AC_REQUIRE([BOOST_REQUIRE])dnl
+AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl
+AC_REQUIRE([BOOST_STATIC])dnl
+AC_REQUIRE([_BOOST_GUESS_WHETHER_TO_USE_MT])dnl
+if test x"$boost_cv_inc_path" = xno; then
+ AC_MSG_NOTICE([Boost not available, not searching for the Boost $1 library])
+else
+dnl The else branch is huge and wasn't intended on purpose.
+AC_LANG_PUSH([C++])dnl
+AS_VAR_PUSHDEF([Boost_lib], [boost_cv_lib_$1])dnl
+AS_VAR_PUSHDEF([Boost_lib_LDFLAGS], [boost_cv_lib_$1_LDFLAGS])dnl
+AS_VAR_PUSHDEF([Boost_lib_LDPATH], [boost_cv_lib_$1_LDPATH])dnl
+AS_VAR_PUSHDEF([Boost_lib_LIBS], [boost_cv_lib_$1_LIBS])dnl
+BOOST_FIND_HEADER([$4])
+boost_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib],
+ [_BOOST_FIND_LIBS($@)])
+case $Boost_lib in #(
+ (no) _AC_MSG_LOG_CONFTEST
+ AC_MSG_ERROR([cannot find the flags to link with Boost $1])
+ ;;
+esac
+AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS])dnl
+AC_SUBST(AS_TR_CPP([BOOST_$1_LDPATH]), [$Boost_lib_LDPATH])dnl
+AC_SUBST([BOOST_LDPATH], [$Boost_lib_LDPATH])dnl
+AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS])dnl
+CPPFLAGS=$boost_save_CPPFLAGS
+AS_VAR_POPDEF([Boost_lib])dnl
+AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl
+AS_VAR_POPDEF([Boost_lib_LDPATH])dnl
+AS_VAR_POPDEF([Boost_lib_LIBS])dnl
+AC_LANG_POP([C++])dnl
+fi
+])
+
+
+# BOOST_FIND_LIB([LIB-NAME],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Backward compatibility wrapper for BOOST_FIND_LIBS.
+AC_DEFUN([BOOST_FIND_LIB],
+[BOOST_FIND_LIBS([$1], $@)])
+
+
+# _BOOST_FIND_LIBS([LIB-NAME], [CANDIDATE-LIB-NAMES],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Real implementation of BOOST_FIND_LIBS: rely on these local macros:
+# Boost_lib, Boost_lib_LDFLAGS, Boost_lib_LDPATH, Boost_lib_LIBS
+#
+# The algorithm is as follows: first look for a given library name
+# according to the user's PREFERRED-RT-OPT. For each library name, we
+# prefer to use the ones that carry the tag (toolset name). Each
+# library is searched through the various standard paths were Boost is
+# usually installed. If we can't find the standard variants, we try
+# to enforce -mt (for instance on MacOSX, libboost_thread.dylib
+# doesn't exist but there's -obviously- libboost_thread-mt.dylib).
+AC_DEFUN([_BOOST_FIND_LIBS],
+[Boost_lib=no
+ case "$3" in #(
+ (mt | mt-) boost_mt=-mt; boost_rtopt=;; #(
+ (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$3" : 'Xmt-*\(.*\)'`;; #(
+ (*) boost_mt=; boost_rtopt=$3;;
+ esac
+ if test $enable_static_boost = yes; then
+ boost_rtopt="s$boost_rtopt"
+ fi
+ # Find the proper debug variant depending on what we've been asked to find.
+ case $boost_rtopt in #(
+ (*d*) boost_rt_d=$boost_rtopt;; #(
+ (*[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn')
+ boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #(
+ (*) boost_rt_d='-d';;
+ esac
+ # If the PREFERRED-RT-OPT are not empty, prepend a `-'.
+ test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt"
+ $boost_guess_use_mt && boost_mt=-mt
+ # Look for the abs path the static archive.
+ # $libext is computed by Libtool but let's make sure it's non empty.
+ test -z "$libext" &&
+ AC_MSG_ERROR([the libext variable is empty, did you invoke Libtool?])
+ boost_save_ac_objext=$ac_objext
+ # Generate the test file.
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$4>
+$6], [$5])])
+dnl Optimization hacks: compiling C++ is slow, especially with Boost. What
+dnl we're trying to do here is guess the right combination of link flags
+dnl (LIBS / LDFLAGS) to use a given library. This can take several
+dnl iterations before it succeeds and is thus *very* slow. So what we do
+dnl instead is that we compile the code first (and thus get an object file,
+dnl typically conftest.o). Then we try various combinations of link flags
+dnl until we succeed to link conftest.o in an executable. The problem is
+dnl that the various TRY_LINK / COMPILE_IFELSE macros of Autoconf always
+dnl remove all the temporary files including conftest.o. So the trick here
+dnl is to temporarily change the value of ac_objext so that conftest.o is
+dnl preserved accross tests. This is obviously fragile and I will burn in
+dnl hell for not respecting Autoconf's documented interfaces, but in the
+dnl mean time, it optimizes the macro by a factor of 5 to 30.
+dnl Another small optimization: the first argument of AC_COMPILE_IFELSE left
+dnl empty because the test file is generated only once above (before we
+dnl start the for loops).
+ AC_COMPILE_IFELSE([],
+ [ac_objext=do_not_rm_me_plz],
+ [AC_MSG_ERROR([cannot compile a test that uses Boost $1])])
+ ac_objext=$boost_save_ac_objext
+ boost_failed_libs=
+# Don't bother to ident the following nested for loops, only the 2
+# innermost ones matter.
+for boost_lib_ in $2; do
+for boost_tag_ in -$boost_cv_lib_tag ''; do
+for boost_ver_ in -$boost_cv_lib_version ''; do
+for boost_mt_ in $boost_mt -mt ''; do
+for boost_rtopt_ in $boost_rtopt '' -d; do
+ for boost_lib in \
+ boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_ver_
+ do
+ # Avoid testing twice the same lib
+ case $boost_failed_libs in #(
+ (*@$boost_lib@*) continue;;
+ esac
+ # If with_boost is empty, we'll search in /lib first, which is not quite
+ # right so instead we'll try to a location based on where the headers are.
+ boost_tmp_lib=$with_boost
+ test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include}
+ for boost_ldpath in "$boost_tmp_lib/lib" '' \
+ /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \
+ "$with_boost" C:/Boost/lib /lib*
+ do
+ # Don't waste time with directories that don't exist.
+ if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then
+ continue
+ fi
+ boost_save_LDFLAGS=$LDFLAGS
+ # Are we looking for a static library?
+ case $boost_ldpath:$boost_rtopt_ in #(
+ (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt)
+ Boost_lib_LIBS="$boost_ldpath/lib$boost_lib.$libext"
+ test -e "$Boost_lib_LIBS" || continue;; #(
+ (*) # No: use -lboost_foo to find the shared library.
+ Boost_lib_LIBS="-l$boost_lib";;
+ esac
+ boost_save_LIBS=$LIBS
+ LIBS="$Boost_lib_LIBS $LIBS"
+ test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath"
+dnl First argument of AC_LINK_IFELSE left empty because the test file is
+dnl generated only once above (before we start the for loops).
+ _BOOST_AC_LINK_IFELSE([],
+ [Boost_lib=yes], [Boost_lib=no])
+ ac_objext=$boost_save_ac_objext
+ LDFLAGS=$boost_save_LDFLAGS
+ LIBS=$boost_save_LIBS
+ if test x"$Boost_lib" = xyes; then
+ # Check or used cached result of whether or not using -R or
+ # -rpath makes sense. Some implementations of ld, such as for
+ # Mac OSX, require -rpath but -R is the flag known to work on
+ # other systems. https://github.com/tsuna/boost.m4/issues/19
+ AC_CACHE_VAL([boost_cv_rpath_link_ldflag],
+ [case $boost_ldpath in
+ '') # Nothing to do.
+ boost_cv_rpath_link_ldflag=
+ boost_rpath_link_ldflag_found=yes;;
+ *)
+ for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do
+ LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
+ LIBS="$boost_save_LIBS $Boost_lib_LIBS"
+ _BOOST_AC_LINK_IFELSE([],
+ [boost_rpath_link_ldflag_found=yes
+ break],
+ [boost_rpath_link_ldflag_found=no])
+ done
+ ;;
+ esac
+ AS_IF([test "x$boost_rpath_link_ldflag_found" != "xyes"],
+ [AC_MSG_ERROR([Unable to determine whether to use -R or -rpath])])
+ LDFLAGS=$boost_save_LDFLAGS
+ LIBS=$boost_save_LIBS
+ ])
+ test x"$boost_ldpath" != x &&
+ Boost_lib_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
+ Boost_lib_LDPATH="$boost_ldpath"
+ break 7
+ else
+ boost_failed_libs="$boost_failed_libs@$boost_lib@"
+ fi
+ done
+ done
+done
+done
+done
+done
+done # boost_lib_
+rm -f conftest.$ac_objext
+])
+
+
+
+# --------------------------------------- #
+# Checks for the various Boost libraries. #
+# --------------------------------------- #
+
+# List of boost libraries: http://www.boost.org/libs/libraries.htm
+# The page http://beta.boost.org/doc/libs is useful: it gives the first release
+# version of each library (among other things).
+
+# BOOST_DEFUN(LIBRARY, CODE)
+# --------------------------
+# Define BOOST_<LIBRARY-UPPERCASE> as a macro that runs CODE.
+#
+# Use indir to avoid the warning on underquoted macro name given to AC_DEFUN.
+m4_define([BOOST_DEFUN],
+[m4_indir([AC_DEFUN],
+ m4_toupper([BOOST_$1]),
+[m4_pushdef([BOOST_Library], [$1])dnl
+$2
+m4_popdef([BOOST_Library])dnl
+])
+])
+
+# BOOST_ARRAY()
+# -------------
+# Look for Boost.Array
+BOOST_DEFUN([Array],
+[BOOST_FIND_HEADER([boost/array.hpp])])
+
+
+# BOOST_ASIO()
+# ------------
+# Look for Boost.Asio (new in Boost 1.35).
+BOOST_DEFUN([Asio],
+[AC_REQUIRE([BOOST_SYSTEM])dnl
+BOOST_FIND_HEADER([boost/asio.hpp])])
+
+
+# BOOST_BIND()
+# ------------
+# Look for Boost.Bind.
+BOOST_DEFUN([Bind],
+[BOOST_FIND_HEADER([boost/bind.hpp])])
+
+
+# BOOST_CHRONO()
+# --------------
+# Look for Boost.Chrono.
+BOOST_DEFUN([Chrono],
+[# Do we have to check for Boost.System? This link-time dependency was
+# added as of 1.35.0. If we have a version <1.35, we must not attempt to
+# find Boost.System as it didn't exist by then.
+if test $boost_major_version -ge 135; then
+ BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+boost_filesystem_save_LIBS=$LIBS
+boost_filesystem_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([chrono], [$1],
+ [boost/chrono.hpp],
+ [boost::chrono::thread_clock d;])
+if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
+ BOOST_CHRONO_LIBS="$BOOST_CHRONO_LIBS $BOOST_SYSTEM_LIBS"
+fi
+LIBS=$boost_filesystem_save_LIBS
+LDFLAGS=$boost_filesystem_save_LDFLAGS
+])# BOOST_CHRONO
+
+
+# BOOST_CONTEXT([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Context. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+#
+# * This library was introduced in Boost 1.51.0
+# * The signatures of make_fcontext() and jump_fcontext were changed in 1.56.0
+# * A dependency on boost_thread appears in 1.57.0
+BOOST_DEFUN([Context],
+[boost_context_save_LIBS=$LIBS
+ boost_context_save_LDFLAGS=$LDFLAGS
+if test $boost_major_version -ge 157; then
+ BOOST_THREAD([$1])
+ m4_pattern_allow([^BOOST_THREAD_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_THREAD_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_THREAD_LDFLAGS"
+fi
+BOOST_FIND_LIB([context], [$1],
+ [boost/context/all.hpp],[[
+
+// creates a stack
+void * stack_pointer = new void*[4096];
+std::size_t const size = sizeof(void*[4096]);
+
+#if BOOST_VERSION <= 105100
+ctx::make_fcontext(&fc, f);
+return ctx::jump_fcontext(&fcm, &fc, 3) == 6;
+
+#else
+
+fc = ctx::make_fcontext(stack_pointer, size, f);
+return ctx::jump_fcontext(&fcm, fc, 3) == 6;
+
+#endif
+
+
+]],[dnl
+
+#include <boost/version.hpp>
+#if BOOST_VERSION <= 105100
+
+namespace ctx = boost::ctx;
+
+static ctx::fcontext_t fcm, fc;
+
+static void f(intptr_t i) {
+ ctx::jump_fcontext(&fc, &fcm, i * 2);
+}
+
+#elif BOOST_VERSION <= 105500
+
+namespace ctx = boost::context;
+
+// context
+static ctx::fcontext_t fcm, *fc;
+
+// context-function
+static void f(intptr_t i) {
+ ctx::jump_fcontext(fc, &fcm, i * 2);
+}
+
+#else
+
+namespace ctx = boost::context;
+
+// context
+static ctx::fcontext_t fcm, fc;
+
+// context-function
+static void f(intptr_t i) {
+ ctx::jump_fcontext(&fc, fcm, i * 2);
+}
+#endif
+])
+LIBS=$boost_context_save_LIBS
+LDFLAGS=$boost_context_save_LDFLAGS
+])# BOOST_CONTEXT
+
+
+# BOOST_CONVERSION()
+# ------------------
+# Look for Boost.Conversion (cast / lexical_cast)
+BOOST_DEFUN([Conversion],
+[BOOST_FIND_HEADER([boost/cast.hpp])
+BOOST_FIND_HEADER([boost/lexical_cast.hpp])
+])# BOOST_CONVERSION
+
+
+# BOOST_COROUTINE([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Coroutine. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. This library was introduced in Boost
+# 1.53.0
+BOOST_DEFUN([Coroutine],
+[
+boost_coroutine_save_LIBS=$LIBS
+boost_coroutine_save_LDFLAGS=$LDFLAGS
+# Link-time dependency from coroutine to context
+BOOST_CONTEXT([$1])
+# Starting from Boost 1.55 a dependency on Boost.System is added
+if test $boost_major_version -ge 155; then
+ BOOST_SYSTEM([$1])
+fi
+m4_pattern_allow([^BOOST_(CONTEXT|SYSTEM)_(LIBS|LDFLAGS)])
+LIBS="$LIBS $BOOST_CONTEXT_LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_CONTEXT_LDFLAGS"
+
+# in 1.53 coroutine was a header only library
+if test $boost_major_version -eq 153; then
+ BOOST_FIND_HEADER([boost/coroutine/coroutine.hpp])
+else
+ BOOST_FIND_LIB([coroutine], [$1],
+ [boost/coroutine/coroutine.hpp],
+ [
+ #include <boost/version.hpp>
+ #if BOOST_VERSION <= 105500
+ boost::coroutines::coroutine<int(int)> coro; coro.get();
+ #else
+ boost::coroutines::asymmetric_coroutine<int>::pull_type coro; coro.get();
+ #endif
+ ])
+fi
+# Link-time dependency from coroutine to context, existed only in 1.53, in 1.54
+# coroutine doesn't use context from its headers but from its library.
+if test $boost_major_version -eq 153 || test $enable_static_boost = yes && test $boost_major_version -ge 154; then
+ BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_CONTEXT_LIBS"
+ BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_CONTEXT_LDFLAGS"
+fi
+if test $enable_static_boost = yes && test $boost_major_version -ge 155; then
+ BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_SYSTEM_LIBS"
+ BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+fi
+LIBS=$boost_coroutine_save_LIBS
+LDFLAGS=$boost_coroutine_save_LDFLAGS
+])# BOOST_COROUTINE
+
+
+# BOOST_CRC()
+# -----------
+# Look for Boost.CRC
+BOOST_DEFUN([CRC],
+[BOOST_FIND_HEADER([boost/crc.hpp])
+])# BOOST_CRC
+
+
+# BOOST_DATE_TIME([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Date_Time. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Date_Time],
+[BOOST_FIND_LIB([date_time], [$1],
+ [boost/date_time/posix_time/posix_time.hpp],
+ [boost::posix_time::ptime t;])
+])# BOOST_DATE_TIME
+
+
+# BOOST_FILESYSTEM([PREFERRED-RT-OPT])
+# ------------------------------------
+# Look for Boost.Filesystem. For the documentation of PREFERRED-RT-OPT, see
+# the documentation of BOOST_FIND_LIB above.
+# Do not check for boost/filesystem.hpp because this file was introduced in
+# 1.34.
+BOOST_DEFUN([Filesystem],
+[# Do we have to check for Boost.System? This link-time dependency was
+# added as of 1.35.0. If we have a version <1.35, we must not attempt to
+# find Boost.System as it didn't exist by then.
+if test $boost_major_version -ge 135; then
+ BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+boost_filesystem_save_LIBS=$LIBS
+boost_filesystem_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([filesystem], [$1],
+ [boost/filesystem/path.hpp], [boost::filesystem::path p;])
+if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
+ BOOST_FILESYSTEM_LIBS="$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"
+fi
+LIBS=$boost_filesystem_save_LIBS
+LDFLAGS=$boost_filesystem_save_LDFLAGS
+])# BOOST_FILESYSTEM
+
+
+# BOOST_FLYWEIGHT()
+# -----------------
+# Look for Boost.Flyweight.
+BOOST_DEFUN([Flyweight],
+[dnl There's a hidden dependency on pthreads.
+AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
+BOOST_FIND_HEADER([boost/flyweight.hpp])
+AC_SUBST([BOOST_FLYWEIGHT_LIBS], [$boost_cv_pthread_flag])
+])
+
+
+# BOOST_FOREACH()
+# ---------------
+# Look for Boost.Foreach.
+BOOST_DEFUN([Foreach],
+[BOOST_FIND_HEADER([boost/foreach.hpp])])
+
+
+# BOOST_FORMAT()
+# --------------
+# Look for Boost.Format.
+# Note: we can't check for boost/format/format_fwd.hpp because the header isn't
+# standalone. It can't be compiled because it triggers the following error:
+# boost/format/detail/config_macros.hpp:88: error: 'locale' in namespace 'std'
+# does not name a type
+BOOST_DEFUN([Format],
+[BOOST_FIND_HEADER([boost/format.hpp])])
+
+
+# BOOST_FUNCTION()
+# ----------------
+# Look for Boost.Function
+BOOST_DEFUN([Function],
+[BOOST_FIND_HEADER([boost/function.hpp])])
+
+
+# BOOST_GEOMETRY()
+# ----------------
+# Look for Boost.Geometry (new since 1.47.0).
+BOOST_DEFUN([Geometry],
+[BOOST_FIND_HEADER([boost/geometry.hpp])
+])# BOOST_GEOMETRY
+
+
+# BOOST_GRAPH([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost.Graphs. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Graph],
+[boost_graph_save_LIBS=$LIBS
+boost_graph_save_LDFLAGS=$LDFLAGS
+# Link-time dependency from graph to regex was added as of 1.40.0.
+if test $boost_major_version -ge 140; then
+ BOOST_REGEX([$1])
+ m4_pattern_allow([^BOOST_REGEX_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_REGEX_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_REGEX_LDFLAGS"
+fi
+BOOST_FIND_LIB([graph], [$1],
+ [boost/graph/adjacency_list.hpp], [boost::adjacency_list<> g;])
+LIBS=$boost_graph_save_LIBS
+LDFLAGS=$boost_graph_save_LDFLAGS
+])# BOOST_GRAPH
+
+
+# BOOST_IOSTREAMS([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.IOStreams. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([IOStreams],
+[BOOST_FIND_LIB([iostreams], [$1],
+ [boost/iostreams/device/file_descriptor.hpp],
+ [boost::iostreams::file_descriptor fd; fd.close();])
+])# BOOST_IOSTREAMS
+
+
+# BOOST_HASH()
+# ------------
+# Look for Boost.Functional/Hash
+BOOST_DEFUN([Hash],
+[BOOST_FIND_HEADER([boost/functional/hash.hpp])])
+
+
+# BOOST_LAMBDA()
+# --------------
+# Look for Boost.Lambda
+BOOST_DEFUN([Lambda],
+[BOOST_FIND_HEADER([boost/lambda/lambda.hpp])])
+
+
+# BOOST_LOCALE()
+# --------------
+# Look for Boost.Locale
+BOOST_DEFUN([Locale],
+[
+boost_locale_save_LIBS=$LIBS
+boost_locale_save_LDFLAGS=$LDFLAGS
+# require SYSTEM for boost-1.50.0 and up
+if test $boost_major_version -ge 150; then
+ BOOST_SYSTEM([$1])
+ m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+fi # end of the Boost.System check.
+BOOST_FIND_LIB([locale], [$1],
+ [boost/locale.hpp],
+ [[boost::locale::generator gen; std::locale::global(gen(""));]])
+LIBS=$boost_locale_save_LIBS
+LDFLAGS=$boost_locale_save_LDFLAGS
+])# BOOST_LOCALE
+
+# BOOST_LOG([PREFERRED-RT-OPT])
+# -----------------------------
+# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Log],
+[boost_log_save_LIBS=$LIBS
+boost_log_save_LDFLAGS=$LDFLAGS
+BOOST_SYSTEM([$1])
+BOOST_FILESYSTEM([$1])
+BOOST_DATE_TIME([$1])
+m4_pattern_allow([^BOOST_(SYSTEM|FILESYSTEM|DATE_TIME)_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_DATE_TIME_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_DATE_TIME_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([log], [$1],
+ [boost/log/core/core.hpp],
+ [boost::log::attribute a; a.get_value();])
+LIBS=$boost_log_save_LIBS
+LDFLAGS=$boost_log_save_LDFLAGS
+])# BOOST_LOG
+
+
+# BOOST_LOG_SETUP([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Log_Setup],
+[boost_log_setup_save_LIBS=$LIBS
+boost_log_setup_save_LDFLAGS=$LDFLAGS
+BOOST_LOG([$1])
+m4_pattern_allow([^BOOST_LOG_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_LOG_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_LOG_LDFLAGS"
+BOOST_FIND_LIB([log_setup], [$1],
+ [boost/log/utility/setup/from_settings.hpp],
+ [boost::log::basic_settings<char> bs; bs.empty();])
+LIBS=$boost_log_setup_save_LIBS
+LDFLAGS=$boost_log_setup_save_LDFLAGS
+])# BOOST_LOG_SETUP
+
+
+# BOOST_MATH()
+# ------------
+# Look for Boost.Math
+# TODO: This library isn't header-only but it comes in multiple different
+# flavors that don't play well with BOOST_FIND_LIB (e.g, libboost_math_c99,
+# libboost_math_c99f, libboost_math_c99l, libboost_math_tr1,
+# libboost_math_tr1f, libboost_math_tr1l). This macro must be fixed to do the
+# right thing anyway.
+BOOST_DEFUN([Math],
+[BOOST_FIND_HEADER([boost/math/special_functions.hpp])])
+
+
+# BOOST_MPI([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost MPI. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. Uses MPICXX variable if it is
+# set, otherwise tries CXX
+#
+BOOST_DEFUN([MPI],
+[boost_save_CXX=${CXX}
+boost_save_CXXCPP=${CXXCPP}
+if test x"${MPICXX}" != x; then
+ CXX=${MPICXX}
+ CXXCPP="${MPICXX} -E"
+fi
+BOOST_FIND_LIB([mpi], [$1],
+ [boost/mpi.hpp],
+ [int argc = 0;
+ char **argv = 0;
+ boost::mpi::environment env(argc,argv);])
+CXX=${boost_save_CXX}
+CXXCPP=${boost_save_CXXCPP}
+])# BOOST_MPI
+
+
+# BOOST_MULTIARRAY()
+# ------------------
+# Look for Boost.MultiArray
+BOOST_DEFUN([MultiArray],
+[BOOST_FIND_HEADER([boost/multi_array.hpp])])
+
+
+# BOOST_NUMERIC_UBLAS()
+# --------------------------
+# Look for Boost.NumericUblas (Basic Linear Algebra)
+BOOST_DEFUN([Numeric_Ublas],
+[BOOST_FIND_HEADER([boost/numeric/ublas/vector.hpp])
+])# BOOST_NUMERIC_UBLAS
+
+
+# BOOST_NUMERIC_CONVERSION()
+# --------------------------
+# Look for Boost.NumericConversion (policy-based numeric conversion)
+BOOST_DEFUN([Numeric_Conversion],
+[BOOST_FIND_HEADER([boost/numeric/conversion/converter.hpp])
+])# BOOST_NUMERIC_CONVERSION
+
+
+# BOOST_OPTIONAL()
+# ----------------
+# Look for Boost.Optional
+BOOST_DEFUN([Optional],
+[BOOST_FIND_HEADER([boost/optional.hpp])])
+
+
+# BOOST_PREPROCESSOR()
+# --------------------
+# Look for Boost.Preprocessor
+BOOST_DEFUN([Preprocessor],
+[BOOST_FIND_HEADER([boost/preprocessor/repeat.hpp])])
+
+
+# BOOST_RANGE()
+# --------------------
+# Look for Boost.Range
+BOOST_DEFUN([Range],
+[BOOST_FIND_HEADER([boost/range/adaptors.hpp])])
+
+# BOOST_UNORDERED()
+# -----------------
+# Look for Boost.Unordered
+BOOST_DEFUN([Unordered],
+[BOOST_FIND_HEADER([boost/unordered_map.hpp])])
+
+
+# BOOST_UUID()
+# ------------
+# Look for Boost.Uuid
+BOOST_DEFUN([Uuid],
+[BOOST_FIND_HEADER([boost/uuid/uuid.hpp])])
+
+
+# BOOST_PROGRAM_OPTIONS([PREFERRED-RT-OPT])
+# -----------------------------------------
+# Look for Boost.Program_options. For the documentation of PREFERRED-RT-OPT,
+# see the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Program_Options],
+[BOOST_FIND_LIB([program_options], [$1],
+ [boost/program_options.hpp],
+ [boost::program_options::options_description d("test");])
+])# BOOST_PROGRAM_OPTIONS
+
+
+
+# _BOOST_PYTHON_CONFIG(VARIABLE, FLAG)
+# ------------------------------------
+# Save VARIABLE, and define it via `python-config --FLAG`.
+# Substitute BOOST_PYTHON_VARIABLE.
+m4_define([_BOOST_PYTHON_CONFIG],
+[AC_SUBST([BOOST_PYTHON_$1],
+ [`python-config --$2 2>/dev/null`])dnl
+boost_python_save_$1=$$1
+$1="$$1 $BOOST_PYTHON_$1"])
+
+
+# BOOST_PYTHON([PREFERRED-RT-OPT])
+# --------------------------------
+# Look for Boost.Python. For the documentation of PREFERRED-RT-OPT,
+# see the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Python],
+[_BOOST_PYTHON_CONFIG([CPPFLAGS], [includes])
+_BOOST_PYTHON_CONFIG([LDFLAGS], [ldflags])
+_BOOST_PYTHON_CONFIG([LIBS], [libs])
+m4_pattern_allow([^BOOST_PYTHON_MODULE$])dnl
+BOOST_FIND_LIBS([python], [python python3], [$1],
+ [boost/python.hpp],
+ [], [BOOST_PYTHON_MODULE(empty) {}])
+CPPFLAGS=$boost_python_save_CPPFLAGS
+LDFLAGS=$boost_python_save_LDFLAGS
+LIBS=$boost_python_save_LIBS
+])# BOOST_PYTHON
+
+
+# BOOST_REF()
+# -----------
+# Look for Boost.Ref
+BOOST_DEFUN([Ref],
+[BOOST_FIND_HEADER([boost/ref.hpp])])
+
+
+# BOOST_REGEX([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost.Regex. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Regex],
+[BOOST_FIND_LIB([regex], [$1],
+ [boost/regex.hpp],
+ [boost::regex exp("*"); boost::regex_match("foo", exp);])
+])# BOOST_REGEX
+
+
+# BOOST_SERIALIZATION([PREFERRED-RT-OPT])
+# ---------------------------------------
+# Look for Boost.Serialization. For the documentation of PREFERRED-RT-OPT, see
+# the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Serialization],
+[BOOST_FIND_LIB([serialization], [$1],
+ [boost/archive/text_oarchive.hpp],
+ [std::ostream* o = 0; // Cheap way to get an ostream...
+ boost::archive::text_oarchive t(*o);])
+])# BOOST_SERIALIZATION
+
+
+# BOOST_SIGNALS([PREFERRED-RT-OPT])
+# ---------------------------------
+# Look for Boost.Signals. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Signals],
+[BOOST_FIND_LIB([signals], [$1],
+ [boost/signal.hpp],
+ [boost::signal<void ()> s;])
+])# BOOST_SIGNALS
+
+
+# BOOST_SIGNALS2()
+# ----------------
+# Look for Boost.Signals2 (new since 1.39.0).
+BOOST_DEFUN([Signals2],
+[BOOST_FIND_HEADER([boost/signals2.hpp])
+])# BOOST_SIGNALS2
+
+
+# BOOST_SMART_PTR()
+# -----------------
+# Look for Boost.SmartPtr
+BOOST_DEFUN([Smart_Ptr],
+[BOOST_FIND_HEADER([boost/scoped_ptr.hpp])
+BOOST_FIND_HEADER([boost/shared_ptr.hpp])
+])
+
+
+# BOOST_STATICASSERT()
+# --------------------
+# Look for Boost.StaticAssert
+BOOST_DEFUN([StaticAssert],
+[BOOST_FIND_HEADER([boost/static_assert.hpp])])
+
+
+# BOOST_STRING_ALGO()
+# -------------------
+# Look for Boost.StringAlgo
+BOOST_DEFUN([String_Algo],
+[BOOST_FIND_HEADER([boost/algorithm/string.hpp])
+])
+
+
+# BOOST_SYSTEM([PREFERRED-RT-OPT])
+# --------------------------------
+# Look for Boost.System. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. This library was introduced in Boost
+# 1.35.0.
+BOOST_DEFUN([System],
+[BOOST_FIND_LIB([system], [$1],
+ [boost/system/error_code.hpp],
+ [boost::system::error_code e; e.clear();])
+])# BOOST_SYSTEM
+
+
+# BOOST_TEST([PREFERRED-RT-OPT])
+# ------------------------------
+# Look for Boost.Test. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Test],
+[m4_pattern_allow([^BOOST_CHECK$])dnl
+BOOST_FIND_LIB([unit_test_framework], [$1],
+ [boost/test/unit_test.hpp], [BOOST_CHECK(2 == 2);],
+ [using boost::unit_test::test_suite;
+ test_suite* init_unit_test_suite(int argc, char ** argv)
+ { return NULL; }])
+])# BOOST_TEST
+
+
+# BOOST_THREAD([PREFERRED-RT-OPT])
+# ---------------------------------
+# Look for Boost.Thread. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Thread],
+[dnl Having the pthread flag is required at least on GCC3 where
+dnl boost/thread.hpp would complain if we try to compile without
+dnl -pthread on GNU/Linux.
+AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
+boost_thread_save_LIBS=$LIBS
+boost_thread_save_LDFLAGS=$LDFLAGS
+boost_thread_save_CPPFLAGS=$CPPFLAGS
+# Link-time dependency from thread to system was added as of 1.49.0.
+if test $boost_major_version -ge 149; then
+BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+CPPFLAGS="$CPPFLAGS $boost_cv_pthread_flag"
+
+# When compiling for the Windows platform, the threads library is named
+# differently. This suffix doesn't exist in new versions of Boost, or
+# possibly new versions of GCC on mingw I am assuming it's Boost's change for
+# now and I am setting version to 1.48, for lack of knowledge as to when this
+# change occurred.
+if test $boost_major_version -lt 148; then
+ case $host_os in
+ (*mingw*) boost_thread_lib_ext=_win32;;
+ esac
+fi
+BOOST_FIND_LIBS([thread], [thread$boost_thread_lib_ext],
+ [$1],
+ [boost/thread.hpp], [boost::thread t; boost::mutex m;])
+
+case $host_os in
+ (*mingw*) boost_thread_w32_socket_link=-lws2_32;;
+esac
+
+BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag $boost_thread_w32_socket_link"
+BOOST_THREAD_LDFLAGS="$BOOST_SYSTEM_LDFLAGS"
+BOOST_CPPFLAGS="$BOOST_CPPFLAGS $boost_cv_pthread_flag"
+LIBS=$boost_thread_save_LIBS
+LDFLAGS=$boost_thread_save_LDFLAGS
+CPPFLAGS=$boost_thread_save_CPPFLAGS
+])# BOOST_THREAD
+
+AU_ALIAS([BOOST_THREADS], [BOOST_THREAD])
+
+
+# BOOST_TOKENIZER()
+# -----------------
+# Look for Boost.Tokenizer
+BOOST_DEFUN([Tokenizer],
+[BOOST_FIND_HEADER([boost/tokenizer.hpp])])
+
+
+# BOOST_TRIBOOL()
+# ---------------
+# Look for Boost.Tribool
+BOOST_DEFUN([Tribool],
+[BOOST_FIND_HEADER([boost/logic/tribool_fwd.hpp])
+BOOST_FIND_HEADER([boost/logic/tribool.hpp])
+])
+
+
+# BOOST_TUPLE()
+# -------------
+# Look for Boost.Tuple
+BOOST_DEFUN([Tuple],
+[BOOST_FIND_HEADER([boost/tuple/tuple.hpp])])
+
+
+# BOOST_TYPETRAITS()
+# --------------------
+# Look for Boost.TypeTraits
+BOOST_DEFUN([TypeTraits],
+[BOOST_FIND_HEADER([boost/type_traits.hpp])])
+
+
+# BOOST_UTILITY()
+# ---------------
+# Look for Boost.Utility (noncopyable, result_of, base-from-member idiom,
+# etc.)
+BOOST_DEFUN([Utility],
+[BOOST_FIND_HEADER([boost/utility.hpp])])
+
+
+# BOOST_VARIANT()
+# ---------------
+# Look for Boost.Variant.
+BOOST_DEFUN([Variant],
+[BOOST_FIND_HEADER([boost/variant/variant_fwd.hpp])
+BOOST_FIND_HEADER([boost/variant.hpp])])
+
+
+# BOOST_POINTER_CONTAINER()
+# ------------------------
+# Look for Boost.PointerContainer
+BOOST_DEFUN([Pointer_Container],
+[BOOST_FIND_HEADER([boost/ptr_container/ptr_deque.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_list.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_vector.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_array.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_set.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_map.hpp])
+])# BOOST_POINTER_CONTAINER
+
+
+# BOOST_WAVE([PREFERRED-RT-OPT])
+# ------------------------------
+# NOTE: If you intend to use Wave/Spirit with thread support, make sure you
+# call BOOST_THREAD first.
+# Look for Boost.Wave. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Wave],
+[AC_REQUIRE([BOOST_FILESYSTEM])dnl
+AC_REQUIRE([BOOST_DATE_TIME])dnl
+boost_wave_save_LIBS=$LIBS
+boost_wave_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_((FILE)?SYSTEM|DATE_TIME|THREAD)_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS \
+$BOOST_THREAD_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS \
+$BOOST_DATE_TIME_LDFLAGS $BOOST_THREAD_LDFLAGS"
+BOOST_FIND_LIB([wave], [$1],
+ [boost/wave.hpp],
+ [boost::wave::token_id id; get_token_name(id);])
+LIBS=$boost_wave_save_LIBS
+LDFLAGS=$boost_wave_save_LDFLAGS
+])# BOOST_WAVE
+
+
+# BOOST_XPRESSIVE()
+# -----------------
+# Look for Boost.Xpressive (new since 1.36.0).
+BOOST_DEFUN([Xpressive],
+[BOOST_FIND_HEADER([boost/xpressive/xpressive.hpp])])
+
+
+# ----------------- #
+# Internal helpers. #
+# ----------------- #
+
+
+# _BOOST_PTHREAD_FLAG()
+# ---------------------
+# Internal helper for BOOST_THREAD. Computes boost_cv_pthread_flag
+# which must be used in CPPFLAGS and LIBS.
+#
+# Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3,
+# boost/thread.hpp will trigger a #error if -pthread isn't used:
+# boost/config/requires_threads.hpp:47:5: #error "Compiler threading support
+# is not turned on. Please set the correct command line options for
+# threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
+#
+# Based on ACX_PTHREAD: http://autoconf-archive.cryp.to/acx_pthread.html
+AC_DEFUN([_BOOST_PTHREAD_FLAG],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_LANG_PUSH([C++])dnl
+AC_CACHE_CHECK([for the flags needed to use pthreads], [boost_cv_pthread_flag],
+[ boost_cv_pthread_flag=
+ # The ordering *is* (sometimes) important. Some notes on the
+ # individual items follow:
+ # (none): in case threads are in libc; should be tried before -Kthread and
+ # other compiler flags to prevent continual compiler warnings
+ # -lpthreads: AIX (must check this before -lpthread)
+ # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+ # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+ # -llthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+ # -pthread: GNU Linux/GCC (kernel threads), BSD/GCC (userland threads)
+ # -pthreads: Solaris/GCC
+ # -mthreads: MinGW32/GCC, Lynx/GCC
+ # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+ # doesn't hurt to check since this sometimes defines pthreads too;
+ # also defines -D_REENTRANT)
+ # ... -mt is also the pthreads flag for HP/aCC
+ # -lpthread: GNU Linux, etc.
+ # --thread-safe: KAI C++
+ case $host_os in #(
+ *solaris*)
+ # On Solaris (at least, for some versions), libc contains stubbed
+ # (non-functional) versions of the pthreads routines, so link-based
+ # tests will erroneously succeed. (We need to link with -pthreads/-mt/
+ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
+ # a function called by this macro, so we could check for that, but
+ # who knows whether they'll stub that too in a future libc.) So,
+ # we'll just look for -pthreads and -lpthread first:
+ boost_pthread_flags="-pthreads -lpthread -mt -pthread";; #(
+ *)
+ boost_pthread_flags="-lpthreads -Kthread -kthread -llthread -pthread \
+ -pthreads -mthreads -lpthread --thread-safe -mt";;
+ esac
+ # Generate the test file.
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <pthread.h>],
+ [pthread_t th; pthread_join(th, 0);
+ pthread_attr_init(0); pthread_cleanup_push(0, 0);
+ pthread_create(0,0,0,0); pthread_cleanup_pop(0);])])
+ for boost_pthread_flag in '' $boost_pthread_flags; do
+ boost_pthread_ok=false
+dnl Re-use the test file already generated.
+ boost_pthreads__save_LIBS=$LIBS
+ LIBS="$LIBS $boost_pthread_flag"
+ AC_LINK_IFELSE([],
+ [if grep ".*$boost_pthread_flag" conftest.err; then
+ echo "This flag seems to have triggered warnings" >&AS_MESSAGE_LOG_FD
+ else
+ boost_pthread_ok=:; boost_cv_pthread_flag=$boost_pthread_flag
+ fi])
+ LIBS=$boost_pthreads__save_LIBS
+ $boost_pthread_ok && break
+ done
+])
+AC_LANG_POP([C++])dnl
+])# _BOOST_PTHREAD_FLAG
+
+
+# _BOOST_gcc_test(MAJOR, MINOR)
+# -----------------------------
+# Internal helper for _BOOST_FIND_COMPILER_TAG.
+m4_define([_BOOST_gcc_test],
+["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC @ gcc$1$2"])dnl
+
+# _BOOST_mingw_test(MAJOR, MINOR)
+# -----------------------------
+# Internal helper for _BOOST_FIND_COMPILER_TAG.
+m4_define([_BOOST_mingw_test],
+["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw$1$2"])dnl
+
+
+# _BOOST_FIND_COMPILER_TAG()
+# --------------------------
+# Internal. When Boost is installed without --layout=system, each library
+# filename will hold a suffix that encodes the compiler used during the
+# build. The Boost build system seems to call this a `tag'.
+AC_DEFUN([_BOOST_FIND_COMPILER_TAG],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_CACHE_CHECK([for the toolset name used by Boost for $CXX],
+ [boost_cv_lib_tag],
+[boost_cv_lib_tag=unknown
+if test x$boost_cv_inc_path != xno; then
+ AC_LANG_PUSH([C++])dnl
+ # The following tests are mostly inspired by boost/config/auto_link.hpp
+ # The list is sorted to most recent/common to oldest compiler (in order
+ # to increase the likelihood of finding the right compiler with the
+ # least number of compilation attempt).
+ # Beware that some tests are sensible to the order (for instance, we must
+ # look for MinGW before looking for GCC3).
+ # I used one compilation test per compiler with a #error to recognize
+ # each compiler so that it works even when cross-compiling (let me know
+ # if you know a better approach).
+ # Known missing tags (known from Boost's tools/build/v2/tools/common.jam):
+ # como, edg, kcc, bck, mp, sw, tru, xlc
+ # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines
+ # the same defines as GCC's).
+ for i in \
+ _BOOST_mingw_test(5, 3) \
+ _BOOST_gcc_test(5, 3) \
+ _BOOST_mingw_test(5, 2) \
+ _BOOST_gcc_test(5, 2) \
+ _BOOST_mingw_test(5, 1) \
+ _BOOST_gcc_test(5, 1) \
+ _BOOST_mingw_test(5, 0) \
+ _BOOST_gcc_test(5, 0) \
+ _BOOST_mingw_test(4, 10) \
+ _BOOST_gcc_test(4, 10) \
+ _BOOST_mingw_test(4, 9) \
+ _BOOST_gcc_test(4, 9) \
+ _BOOST_mingw_test(4, 8) \
+ _BOOST_gcc_test(4, 8) \
+ _BOOST_mingw_test(4, 7) \
+ _BOOST_gcc_test(4, 7) \
+ _BOOST_mingw_test(4, 6) \
+ _BOOST_gcc_test(4, 6) \
+ _BOOST_mingw_test(4, 5) \
+ _BOOST_gcc_test(4, 5) \
+ _BOOST_mingw_test(4, 4) \
+ _BOOST_gcc_test(4, 4) \
+ _BOOST_mingw_test(4, 3) \
+ _BOOST_gcc_test(4, 3) \
+ _BOOST_mingw_test(4, 2) \
+ _BOOST_gcc_test(4, 2) \
+ _BOOST_mingw_test(4, 1) \
+ _BOOST_gcc_test(4, 1) \
+ _BOOST_mingw_test(4, 0) \
+ _BOOST_gcc_test(4, 0) \
+ "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \
+ && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw" \
+ _BOOST_gcc_test(3, 4) \
+ _BOOST_gcc_test(3, 3) \
+ "defined _MSC_VER && _MSC_VER >= 1500 @ vc90" \
+ "defined _MSC_VER && _MSC_VER == 1400 @ vc80" \
+ _BOOST_gcc_test(3, 2) \
+ "defined _MSC_VER && _MSC_VER == 1310 @ vc71" \
+ _BOOST_gcc_test(3, 1) \
+ _BOOST_gcc_test(3, 0) \
+ "defined __BORLANDC__ @ bcb" \
+ "defined __ICC && (defined __unix || defined __unix__) @ il" \
+ "defined __ICL @ iw" \
+ "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \
+ _BOOST_gcc_test(2, 95) \
+ "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \
+ "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \
+ "defined _MSC_VER && _MSC_VER < 1300 && defined UNDER_CE @ evc4" \
+ "defined __MWERKS__ && __MWERKS__ <= 0x31FF @ cw8"
+ do
+ boost_tag_test=`expr "X$i" : 'X\([[^@]]*\) @ '`
+ boost_tag=`expr "X$i" : 'X[[^@]]* @ \(.*\)'`
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if $boost_tag_test
+/* OK */
+#else
+# error $boost_tag_test
+#endif
+]])], [boost_cv_lib_tag=$boost_tag; break], [])
+ done
+AC_LANG_POP([C++])dnl
+ case $boost_cv_lib_tag in #(
+ # Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed
+ # to "gcc41" for instance.
+ *-gcc | *'-gcc ') :;; #( Don't re-add -gcc: it's already in there.
+ gcc*)
+ boost_tag_x=
+ case $host_os in #(
+ darwin*)
+ if test $boost_major_version -ge 136; then
+ # The `x' added in r46793 of Boost.
+ boost_tag_x=x
+ fi;;
+ esac
+ # We can specify multiple tags in this variable because it's used by
+ # BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ...
+ boost_cv_lib_tag="$boost_tag_x$boost_cv_lib_tag -${boost_tag_x}gcc"
+ ;; #(
+ unknown)
+ AC_MSG_WARN([[could not figure out which toolset name to use for $CXX]])
+ boost_cv_lib_tag=
+ ;;
+ esac
+fi])dnl end of AC_CACHE_CHECK
+])# _BOOST_FIND_COMPILER_TAG
+
+
+# _BOOST_GUESS_WHETHER_TO_USE_MT()
+# --------------------------------
+# Compile a small test to try to guess whether we should favor MT (Multi
+# Thread) flavors of Boost. Sets boost_guess_use_mt accordingly.
+AC_DEFUN([_BOOST_GUESS_WHETHER_TO_USE_MT],
+[# Check whether we do better use `mt' even though we weren't ask to.
+AC_LANG_PUSH([C++])dnl
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if defined _REENTRANT || defined _MT || defined __MT__
+/* use -mt */
+#else
+# error MT not needed
+#endif
+]])], [boost_guess_use_mt=:], [boost_guess_use_mt=false])
+AC_LANG_POP([C++])dnl
+])
+
+# _BOOST_AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+# -------------------------------------------------------------------
+# Fork of _AC_LINK_IFELSE that preserves conftest.o across calls. Fragile,
+# will break when Autoconf changes its internals. Requires that you manually
+# rm -f conftest.$ac_objext in between to really different tests, otherwise
+# you will try to link a conftest.o left behind by a previous test.
+# Used to aggressively optimize BOOST_FIND_LIB (see the big comment in this
+# macro).
+#
+# Don't use "break" in the actions, as it would short-circuit some code
+# this macro runs after the actions.
+m4_define([_BOOST_AC_LINK_IFELSE],
+[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
+rm -f conftest$ac_exeext
+boost_save_ac_ext=$ac_ext
+boost_use_source=:
+# If we already have a .o, re-use it. We change $ac_ext so that $ac_link
+# tries to link the existing object file instead of compiling from source.
+test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false &&
+ _AS_ECHO_LOG([re-using the existing conftest.$ac_objext])
+AS_IF([_AC_DO_STDERR($ac_link) && {
+ test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_executable_p conftest$ac_exeext
+dnl FIXME: use AS_TEST_X instead when 2.61 is widespread enough.
+ }],
+ [$2],
+ [if $boost_use_source; then
+ _AC_MSG_LOG_CONFTEST
+ fi
+ $3])
+ac_objext=$boost_save_ac_objext
+ac_ext=$boost_save_ac_ext
+dnl Delete also the IPA/IPO (Inter Procedural Analysis/Optimization)
+dnl information created by the PGI compiler (conftest_ipa8_conftest.oo),
+dnl as it would interfere with the next link command.
+rm -f core conftest.err conftest_ipa8_conftest.oo \
+ conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl
+])# _BOOST_AC_LINK_IFELSE
+
+# Local Variables:
+# mode: autoconf
+# End:
diff --git a/org.eclipse.efm.symbex/cmake/cvc4-master-patch/options/options_template.cpp b/org.eclipse.efm.symbex/cmake/cvc4-master-patch/options/options_template.cpp
new file mode 100644
index 0000000..f1a9b6c
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/cvc4-master-patch/options/options_template.cpp
@@ -0,0 +1,835 @@
+/********************* */
+/*! \file options_template.cpp
+ ** \verbatim
+ ** Top contributors (to current version):
+ ** Tim King, Morgan Deters, Kshitij Bansal
+ ** This file is part of the CVC4 project.
+ ** Copyright (c) 2009-2016 by the authors listed in the file AUTHORS
+ ** in the top-level source directory) and their institutional affiliations.
+ ** All rights reserved. See the file COPYING in the top-level source
+ ** directory for licensing information.\endverbatim
+ **
+ ** \brief Contains code for handling command-line options.
+ **
+ ** Contains code for handling command-line options
+ **/
+
+#if !defined(_BSD_SOURCE) && defined(__MINGW32__) && !defined(__MINGW64__)
+// force use of optreset; mingw32 croaks on argv-switching otherwise
+# include "cvc4autoconfig.h"
+# define _BSD_SOURCE
+# undef HAVE_DECL_OPTRESET
+# define HAVE_DECL_OPTRESET 1
+# define CVC4_IS_NOT_REALLY_BSD
+#endif /* !_BSD_SOURCE && __MINGW32__ && !__MINGW64__ */
+
+#ifdef __MINGW64__
+#define _BSD_SOURCE // Needed to avoid 'optreset' error at link
+extern int optreset;
+#endif /* __MINGW64__ */
+
+#include <getopt.h>
+
+// clean up
+#ifdef CVC4_IS_NOT_REALLY_BSD
+# undef _BSD_SOURCE
+#endif /* CVC4_IS_NOT_REALLY_BSD */
+
+#include <unistd.h>
+#include <string.h>
+#include <stdint.h>
+#include <time.h>
+
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <iomanip>
+#include <new>
+#include <string>
+#include <sstream>
+#include <limits>
+
+#include "base/cvc4_assert.h"
+#include "base/exception.h"
+#include "base/output.h"
+#include "base/tls.h"
+#include "options/argument_extender.h"
+#include "options/argument_extender_implementation.h"
+#include "options/didyoumean.h"
+#include "options/language.h"
+#include "options/options_handler.h"
+
+${include_all_option_headers}
+
+#line 64 "${template}"
+
+#include "options/options_holder.h"
+#include "cvc4autoconfig.h"
+#include "options/base_handlers.h"
+
+${option_handler_includes}
+
+#line 72 "${template}"
+
+using namespace CVC4;
+using namespace CVC4::options;
+
+namespace CVC4 {
+
+CVC4_THREADLOCAL(Options*) Options::s_current = NULL;
+
+
+
+/**
+ * This is a default handler for options of built-in C++ type. This
+ * template is really just a helper for the handleOption() template,
+ * below. Variants of this template handle numeric and non-numeric,
+ * integral and non-integral, signed and unsigned C++ types.
+ * handleOption() makes sure to instantiate the right one.
+ *
+ * This implements default behavior when e.g. an option is
+ * unsigned but the user specifies a negative argument; etc.
+ */
+template <class T, bool is_numeric, bool is_integer>
+struct OptionHandler {
+ static T handle(std::string option, std::string optionarg);
+};/* struct OptionHandler<> */
+
+/** Variant for integral C++ types */
+template <class T>
+struct OptionHandler<T, true, true> {
+ static bool stringToInt(T& t, const std::string& str) {
+ std::istringstream ss(str);
+ ss >> t;
+ char tmp;
+ return !(ss.fail() || ss.get(tmp));
+ }
+
+ static bool containsMinus(const std::string& str) {
+ return str.find('-') != std::string::npos;
+ }
+
+ static T handle(const std::string& option, const std::string& optionarg) {
+ try {
+ T i;
+ bool success = stringToInt(i, optionarg);
+
+ if(!success){
+ throw OptionException(option + ": failed to parse "+ optionarg +
+ " as an integer of the appropraite type.");
+ }
+
+ // Depending in the platform unsigned numbers with '-' signs may parse.
+ // Reject these by looking for any minus if it is not signed.
+ if( (! std::numeric_limits<T>::is_signed) && containsMinus(optionarg) ) {
+ // unsigned type but user gave negative argument
+ throw OptionException(option + " requires a nonnegative argument");
+ } else if(i < std::numeric_limits<T>::min()) {
+ // negative overflow for type
+ std::stringstream ss;
+ ss << option << " requires an argument >= "
+ << std::numeric_limits<T>::min();
+ throw OptionException(ss.str());
+ } else if(i > std::numeric_limits<T>::max()) {
+ // positive overflow for type
+ std::stringstream ss;
+ ss << option << " requires an argument <= "
+ << std::numeric_limits<T>::max();
+ throw OptionException(ss.str());
+ }
+
+ return i;
+
+ // if(std::numeric_limits<T>::is_signed) {
+ // return T(i.getLong());
+ // } else {
+ // return T(i.getUnsignedLong());
+ // }
+ } catch(std::invalid_argument&) {
+ // user gave something other than an integer
+ throw OptionException(option + " requires an integer argument");
+ }
+ }
+};/* struct OptionHandler<T, true, true> */
+
+/** Variant for numeric but non-integral C++ types */
+template <class T>
+struct OptionHandler<T, true, false> {
+ static T handle(std::string option, std::string optionarg) {
+ std::stringstream in(optionarg);
+ long double r;
+ in >> r;
+ if(! in.eof()) {
+ // we didn't consume the whole string (junk at end)
+ throw OptionException(option + " requires a numeric argument");
+ }
+
+ if(! std::numeric_limits<T>::is_signed && r < 0.0) {
+ // unsigned type but user gave negative value
+ throw OptionException(option + " requires a nonnegative argument");
+ } else if(r < -std::numeric_limits<T>::max()) {
+ // negative overflow for type
+ std::stringstream ss;
+ ss << option << " requires an argument >= "
+ << -std::numeric_limits<T>::max();
+ throw OptionException(ss.str());
+ } else if(r > std::numeric_limits<T>::max()) {
+ // positive overflow for type
+ std::stringstream ss;
+ ss << option << " requires an argument <= "
+ << std::numeric_limits<T>::max();
+ throw OptionException(ss.str());
+ }
+
+ return T(r);
+ }
+};/* struct OptionHandler<T, true, false> */
+
+/** Variant for non-numeric C++ types */
+template <class T>
+struct OptionHandler<T, false, false> {
+ static T handle(std::string option, std::string optionarg) {
+ T::unsupported_handleOption_call___please_write_me;
+ // The above line causes a compiler error if this version of the template
+ // is ever instantiated (meaning that a specialization is missing). So
+ // don't worry about the segfault in the next line, the "return" is only
+ // there to keep the compiler from giving additional, distracting errors
+ // and warnings.
+ return *(T*)0;
+ }
+};/* struct OptionHandler<T, false, false> */
+
+/** Handle an option of type T in the default way. */
+template <class T>
+T handleOption(std::string option, std::string optionarg) {
+ return OptionHandler<T, std::numeric_limits<T>::is_specialized, std::numeric_limits<T>::is_integer>::handle(option, optionarg);
+}
+
+/** Handle an option of type std::string in the default way. */
+template <>
+std::string handleOption<std::string>(std::string option, std::string optionarg) {
+ return optionarg;
+}
+
+/**
+ * Run handler, and any user-given predicates, for option T.
+ * If a user specifies a :handler or :predicates, it overrides this.
+ */
+template <class T>
+typename T::type runHandlerAndPredicates(T, std::string option, std::string optionarg, options::OptionsHandler* handler) {
+ // By default, parse the option argument in a way appropriate for its type.
+ // E.g., for "unsigned int" options, ensure that the provided argument is
+ // a nonnegative integer that fits in the unsigned int type.
+
+ return handleOption<typename T::type>(option, optionarg);
+}
+
+template <class T>
+void runBoolPredicates(T, std::string option, bool b, options::OptionsHandler* handler) {
+ // By default, nothing to do for bool. Users add things with
+ // :predicate in options files to provide custom checking routines
+ // that can throw exceptions.
+}
+
+
+Options::Options()
+ : d_holder(new options::OptionsHolder())
+ , d_handler(new options::OptionsHandler(this))
+ , d_forceLogicListeners()
+ , d_beforeSearchListeners()
+ , d_tlimitListeners()
+ , d_tlimitPerListeners()
+ , d_rlimitListeners()
+ , d_rlimitPerListeners()
+{}
+
+Options::~Options() {
+ delete d_handler;
+ delete d_holder;
+}
+
+void Options::copyValues(const Options& options){
+ if(this != &options) {
+ delete d_holder;
+ d_holder = new options::OptionsHolder(*options.d_holder);
+ }
+}
+
+std::string Options::formatThreadOptionException(const std::string& option) {
+ std::stringstream ss;
+ ss << "can't understand option `" << option
+ << "': expected something like --threadN=\"--option1 --option2\","
+ << " where N is a nonnegative integer";
+ return ss.str();
+}
+
+ListenerCollection::Registration* Options::registerAndNotify(
+ ListenerCollection& collection, Listener* listener, bool notify)
+{
+ ListenerCollection::Registration* registration =
+ collection.registerListener(listener);
+ if(notify) {
+ listener->notify();
+ }
+ return registration;
+}
+
+ListenerCollection::Registration* Options::registerForceLogicListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::forceLogicString);
+ return registerAndNotify(d_forceLogicListeners, listener, notify);
+}
+
+ListenerCollection::Registration* Options::registerBeforeSearchListener(
+ Listener* listener)
+{
+ return d_beforeSearchListeners.registerListener(listener);
+}
+
+ListenerCollection::Registration* Options::registerTlimitListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet &&
+ wasSetByUser(options::cumulativeMillisecondLimit);
+ return registerAndNotify(d_tlimitListeners, listener, notify);
+}
+
+ListenerCollection::Registration* Options::registerTlimitPerListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::perCallMillisecondLimit);
+ return registerAndNotify(d_tlimitPerListeners, listener, notify);
+}
+
+ListenerCollection::Registration* Options::registerRlimitListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::cumulativeResourceLimit);
+ return registerAndNotify(d_rlimitListeners, listener, notify);
+}
+
+ListenerCollection::Registration* Options::registerRlimitPerListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::perCallResourceLimit);
+ return registerAndNotify(d_rlimitPerListeners, listener, notify);
+}
+
+ListenerCollection::Registration* Options::registerUseTheoryListListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::useTheoryList);
+ return registerAndNotify(d_useTheoryListListeners, listener, notify);
+}
+
+ListenerCollection::Registration* Options::registerSetDefaultExprDepthListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::defaultExprDepth);
+ return registerAndNotify(d_setDefaultExprDepthListeners, listener, notify);
+}
+
+ListenerCollection::Registration* Options::registerSetDefaultExprDagListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::defaultDagThresh);
+ return registerAndNotify(d_setDefaultDagThreshListeners, listener, notify);
+}
+
+ListenerCollection::Registration* Options::registerSetPrintExprTypesListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::printExprTypes);
+ return registerAndNotify(d_setPrintExprTypesListeners, listener, notify);
+}
+
+ListenerCollection::Registration* Options::registerSetDumpModeListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::dumpModeString);
+ return registerAndNotify(d_setDumpModeListeners, listener, notify);
+}
+
+ListenerCollection::Registration* Options::registerSetPrintSuccessListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::printSuccess);
+ return registerAndNotify(d_setPrintSuccessListeners, listener, notify);
+}
+
+ListenerCollection::Registration* Options::registerDumpToFileNameListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::dumpToFileName);
+ return registerAndNotify(d_dumpToFileListeners, listener, notify);
+}
+
+ListenerCollection::Registration*
+Options::registerSetRegularOutputChannelListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::regularChannelName);
+ return registerAndNotify(d_setRegularChannelListeners, listener, notify);
+}
+
+ListenerCollection::Registration*
+Options::registerSetDiagnosticOutputChannelListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::diagnosticChannelName);
+ return registerAndNotify(d_setDiagnosticChannelListeners, listener, notify);
+}
+
+ListenerCollection::Registration*
+Options::registerSetReplayLogFilename(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::replayLogFilename);
+ return registerAndNotify(d_setReplayFilenameListeners, listener, notify);
+}
+
+${all_custom_handlers}
+
+#line 394 "${template}"
+
+#ifdef CVC4_DEBUG
+# define USE_EARLY_TYPE_CHECKING_BY_DEFAULT true
+#else /* CVC4_DEBUG */
+# define USE_EARLY_TYPE_CHECKING_BY_DEFAULT false
+#endif /* CVC4_DEBUG */
+
+#if defined(CVC4_MUZZLED) || defined(CVC4_COMPETITION_MODE)
+# define DO_SEMANTIC_CHECKS_BY_DEFAULT false
+#else /* CVC4_MUZZLED || CVC4_COMPETITION_MODE */
+# define DO_SEMANTIC_CHECKS_BY_DEFAULT true
+#endif /* CVC4_MUZZLED || CVC4_COMPETITION_MODE */
+
+options::OptionsHolder::OptionsHolder() : ${all_modules_defaults}
+{
+}
+
+#line 412 "${template}"
+
+static const std::string mostCommonOptionsDescription = "\
+Most commonly-used CVC4 options:${common_documentation}";
+
+#line 417 "${template}"
+
+static const std::string optionsDescription = mostCommonOptionsDescription + "\n\
+\n\
+Additional CVC4 options:${remaining_documentation}";
+
+#line 423 "${template}"
+
+static const std::string optionsFootnote = "\n\
+[*] Each of these options has a --no-OPTIONNAME variant, which reverses the\n\
+ sense of the option.\n\
+";
+
+static const std::string languageDescription = "\
+Languages currently supported as arguments to the -L / --lang option:\n\
+ auto attempt to automatically determine language\n\
+ cvc4 | presentation | pl CVC4 presentation language\n\
+ smt1 | smtlib1 SMT-LIB format 1.2\n\
+ smt | smtlib | smt2 |\n\
+ smt2.0 | smtlib2 | smtlib2.0 SMT-LIB format 2.0\n\
+ smt2.5 | smtlib2.5 SMT-LIB format 2.5\n\
+ smt2.6 | smtlib2.6 SMT-LIB format 2.6\n\
+ tptp TPTP format (cnf and fof)\n\
+ sygus SyGuS format\n\
+\n\
+Languages currently supported as arguments to the --output-lang option:\n\
+ auto match output language to input language\n\
+ cvc4 | presentation | pl CVC4 presentation language\n\
+ cvc3 CVC3 presentation language\n\
+ smt1 | smtlib1 SMT-LIB format 1.2\n\
+ smt | smtlib | smt2 |\n\
+ smt2.0 | smtlib2.0 | smtlib2 SMT-LIB format 2.0\n\
+ smt2.5 | smtlib2.5 SMT-LIB format 2.5\n\
+ smt2.6 | smtlib2.6 SMT-LIB format 2.6\n\
+ tptp TPTP format\n\
+ z3str SMT-LIB 2.0 with Z3-str string constraints\n\
+ ast internal format (simple syntax trees)\n\
+";
+
+std::string Options::getDescription() const {
+ return optionsDescription;
+}
+
+void Options::printUsage(const std::string msg, std::ostream& out) {
+ out << msg << optionsDescription << std::endl
+ << optionsFootnote << std::endl << std::flush;
+}
+
+void Options::printShortUsage(const std::string msg, std::ostream& out) {
+ out << msg << mostCommonOptionsDescription << std::endl
+ << optionsFootnote << std::endl
+ << "For full usage, please use --help."
+ << std::endl << std::endl << std::flush;
+}
+
+void Options::printLanguageHelp(std::ostream& out) {
+ out << languageDescription << std::flush;
+}
+
+/**
+ * This is a table of long options. By policy, each short option
+ * should have an equivalent long option (but the reverse isn't the
+ * case), so this table should thus contain all command-line options.
+ *
+ * Each option in this array has four elements:
+ *
+ * 1. the long option string
+ * 2. argument behavior for the option:
+ * no_argument - no argument permitted
+ * required_argument - an argument is expected
+ * optional_argument - an argument is permitted but not required
+ * 3. this is a pointer to an int which is set to the 4th entry of the
+ * array if the option is present; or NULL, in which case
+ * getopt_long() returns the 4th entry
+ * 4. the return value for getopt_long() when this long option (or the
+ * value to set the 3rd entry to; see #3)
+ *
+ * If you add something here, you should add it in src/main/usage.h
+ * also, to document it.
+ *
+ * If you add something that has a short option equivalent, you should
+ * add it to the getopt_long() call in parseOptions().
+ */
+static struct option cmdlineOptions[] = {${all_modules_long_options}
+ { NULL, no_argument, NULL, '\0' }
+};/* cmdlineOptions */
+
+#line 502 "${template}"
+
+// static void preemptGetopt(int& argc, char**& argv, const char* opt) {
+
+// Debug("preemptGetopt") << "preempting getopt() with " << opt << std::endl;
+
+// AlwaysAssert(opt != NULL && *opt != '\0');
+// AlwaysAssert(strlen(opt) <= maxoptlen);
+
+// ++argc;
+// unsigned i = 1;
+// while(argv[i] != NULL && argv[i][0] != '\0') {
+// ++i;
+// }
+
+// if(argv[i] == NULL) {
+// argv = (char**) realloc(argv, (i + 6) * sizeof(char*));
+// for(unsigned j = i; j < i + 5; ++j) {
+// argv[j] = (char*) malloc(sizeof(char) * maxoptlen);
+// argv[j][0] = '\0';
+// }
+// argv[i + 5] = NULL;
+// }
+
+// strncpy(argv[i], opt, maxoptlen - 1);
+// argv[i][maxoptlen - 1] = '\0'; // ensure NUL-termination even on overflow
+// }
+
+namespace options {
+
+/** Set a given Options* as "current" just for a particular scope. */
+class OptionsGuard {
+ CVC4_THREADLOCAL_TYPE(Options*)* d_field;
+ Options* d_old;
+public:
+ OptionsGuard(CVC4_THREADLOCAL_TYPE(Options*)* field, Options* opts) :
+ d_field(field),
+ d_old(*field) {
+ *field = opts;
+ }
+ ~OptionsGuard() {
+ *d_field = d_old;
+ }
+};/* class OptionsGuard */
+
+}/* CVC4::options namespace */
+
+/**
+ * Parse argc/argv and put the result into a CVC4::Options.
+ * The return value is what's left of the command line (that is, the
+ * non-option arguments).
+ */
+std::vector<std::string> Options::parseOptions(Options* options,
+ int argc, char* argv[])
+ throw(OptionException) {
+
+ Assert(options != NULL);
+ Assert(argv != NULL);
+
+ options::OptionsGuard guard(&s_current, options);
+
+ const char *progName = argv[0];
+
+ // To debug options parsing, you may prefer to simply uncomment this
+ // and recompile. Debug flags have not been parsed yet so these have
+ // not been set.
+ //DebugChannel.on("options");
+
+ Debug("options") << "Options::parseOptions == " << options << std::endl;
+ Debug("options") << "argv == " << argv << std::endl;
+
+ // Find the base name of the program.
+ const char *x = strrchr(progName, '/');
+ if(x != NULL) {
+ progName = x + 1;
+ }
+ options->d_holder->binary_name = std::string(progName);
+
+ ArgumentExtender* argumentExtender = new ArgumentExtenderImplementation();
+ for(int position = 1; position < argc; position++) {
+ argumentExtender->pushBackArgument(argv[position]);
+ }
+
+ std::vector<std::string> nonoptions;
+ parseOptionsRecursive(options, argumentExtender, &nonoptions);
+ if(Debug.isOn("options")){
+ for(std::vector<std::string>::const_iterator i = nonoptions.begin(),
+ iend = nonoptions.end(); i != iend; ++i){
+ Debug("options") << "nonoptions " << *i << std::endl;
+ }
+ }
+
+ delete argumentExtender;
+ return nonoptions;
+}
+
+void Options::parseOptionsRecursive(Options* options,
+ ArgumentExtender* extender,
+ std::vector<std::string>* nonoptions)
+ throw(OptionException) {
+
+ int argc;
+ char** argv;
+
+ extender->movePreemptionsToArguments();
+ extender->pushFrontArgument("");
+ extender->getArguments(&argc, &argv);
+
+ if(Debug.isOn("options")) {
+ Debug("options") << "starting a new parseOptionsRecursive with "
+ << argc << " arguments" << std::endl;
+ for( int i = 0; i < argc ; i++ ){
+ Assert(argv[i] != NULL);
+ Debug("options") << " argv[" << i << "] = " << argv[i] << std::endl;
+ }
+ }
+
+ // Having this synonym simplifies the generation code in mkoptions.
+ options::OptionsHandler* handler = options->d_handler;
+ options::OptionsHolder* holder = options->d_holder;
+
+ // Reset getopt(), in the case of multiple calls to parseOptions().
+ // This can be = 1 in newer GNU getopt, but older (< 2007) require = 0.
+ optind = 0;
+#if HAVE_DECL_OPTRESET
+ optreset = 1; // on BSD getopt() (e.g. Mac OS), might need this
+#endif /* HAVE_DECL_OPTRESET */
+
+
+ int main_optind = 0;
+ int old_optind;
+
+
+ while(true) { // Repeat Forever
+
+ if(extender->hasPreemptions()){
+ // Stop this round of parsing. We now parse recursively
+ // to start on a new character array for argv.
+ parseOptionsRecursive(options, extender, nonoptions);
+ break;
+ }
+
+ optopt = 0;
+ std::string option, optionarg;
+
+ optind = main_optind;
+ old_optind = main_optind;
+ //optind_ref = &main_optind;
+ //argv = main_argv;
+
+ // If we encounter an element that is not at zero and does not start
+ // with a "-", this is a non-option. We consume this element as a
+ // non-option.
+ if (main_optind > 0 && main_optind < argc &&
+ argv[main_optind][0] != '-') {
+ Debug("options") << "enqueueing " << argv[main_optind]
+ << " as a non-option." << std::endl;
+ nonoptions->push_back(argv[main_optind]);
+ ++main_optind;
+ extender->popFrontArgument();
+ continue;
+ }
+
+
+ Debug("options") << "[ before, main_optind == " << main_optind << " ]"
+ << std::endl;
+ Debug("options") << "[ before, optind == " << optind << " ]" << std::endl;
+ Debug("options") << "[ argc == " << argc << ", argv == " << argv << " ]"
+ << std::endl;
+ int c = getopt_long(argc, argv,
+ "+:${all_modules_short_options}",
+ cmdlineOptions, NULL);
+
+ while(main_optind < optind) {
+ main_optind++;
+ extender->popFrontArgument();
+ }
+
+ Debug("options") << "[ got " << int(c) << " (" << char(c) << ") ]"
+ << "[ next option will be at pos: " << optind << " ]"
+ << std::endl;
+
+ // The initial getopt_long call should always determine that argv[0]
+ // is not an option and returns -1. We always manually advance beyond
+ // this element.
+ //
+ // We have to reinitialize optind to 0 instead of 1 as we need to support
+ // changing the argv array passed to getopt.
+ // This is needed as are using GNU extensions.
+ // From: http://man7.org/linux/man-pages/man3/getopt.3.html
+ // A program that scans multiple argument vectors, or rescans the same
+ // vector more than once, and wants to make use of GNU extensions such
+ // as '+' and '-' at the start of optstring, or changes the value of
+ // POSIXLY_CORRECT between scans, must reinitialize getopt() by
+ // resetting optind to 0, rather than the traditional value of 1.
+ // (Resetting to 0 forces the invocation of an internal initialization
+ // routine that rechecks POSIXLY_CORRECT and checks for GNU extensions
+ // in optstring.)
+ if ( old_optind == 0 && c == -1 ) {
+ Assert(main_optind > 0);
+ continue;
+ }
+
+ if ( c == -1 ) {
+ if(Debug.isOn("options")) {
+ Debug("options") << "done with option parsing" << std::endl;
+ for(int index = optind; index < argc; ++index) {
+ Debug("options") << "remaining " << argv[index] << std::endl;
+ }
+ }
+ break;
+ }
+
+ option = argv[old_optind == 0 ? 1 : old_optind];
+ optionarg = (optarg == NULL) ? "" : optarg;
+
+ Debug("preemptGetopt") << "processing option " << c
+ << " (`" << char(c) << "'), " << option << std::endl;
+
+ switch(c) {
+${all_modules_option_handlers}
+
+#line 724 "${template}"
+
+ case ':':
+ // This can be a long or short option, and the way to get at the
+ // name of it is different.
+ throw OptionException(std::string("option `") + option +
+ "' missing its required argument");
+
+ case '?':
+ default:
+ if( ( optopt == 0 ||
+ ( optopt >= ${long_option_value_begin} &&
+ optopt <= ${long_option_value_end} )
+ ) && !strncmp(argv[optind - 1], "--thread", 8) &&
+ strlen(argv[optind - 1]) > 8 )
+ {
+ if(! isdigit(argv[optind - 1][8])) {
+ throw OptionException(formatThreadOptionException(option));
+ }
+ std::vector<std::string>& threadArgv = holder->threadArgv;
+ char *end;
+ long tnum = strtol(argv[optind - 1] + 8, &end, 10);
+ if(tnum < 0 || (*end != '\0' && *end != '=')) {
+ throw OptionException(formatThreadOptionException(option));
+ }
+ if(threadArgv.size() <= size_t(tnum)) {
+ threadArgv.resize(tnum + 1);
+ }
+ if(threadArgv[tnum] != "") {
+ threadArgv[tnum] += " ";
+ }
+ if(*end == '\0') { // e.g., we have --thread0 "foo"
+ if(argc <= optind) {
+ throw OptionException(std::string("option `") + option +
+ "' missing its required argument");
+ }
+ Debug("options") << "thread " << tnum << " gets option "
+ << argv[optind] << std::endl;
+ threadArgv[tnum] += argv[main_optind];
+ main_optind++;
+ } else { // e.g., we have --thread0="foo"
+ if(end[1] == '\0') {
+ throw OptionException(std::string("option `") + option +
+ "' missing its required argument");
+ }
+ Debug("options") << "thread " << tnum << " gets option "
+ << (end + 1) << std::endl;
+ threadArgv[tnum] += end + 1;
+ }
+ Debug("options") << "thread " << tnum << " now has "
+ << threadArgv[tnum] << std::endl;
+ break;
+ }
+
+ throw OptionException(std::string("can't understand option `") + option +
+ "'" + suggestCommandLineOptions(option));
+ }
+ }
+
+ Debug("options") << "got " << nonoptions->size()
+ << " non-option arguments." << std::endl;
+
+ free(argv);
+}
+
+std::string Options::suggestCommandLineOptions(const std::string& optionName) throw() {
+ DidYouMean didYouMean;
+
+ const char* opt;
+ for(size_t i = 0; (opt = cmdlineOptions[i].name) != NULL; ++i) {
+ didYouMean.addWord(std::string("--") + cmdlineOptions[i].name);
+ }
+
+ return didYouMean.getMatchAsString(optionName.substr(0, optionName.find('=')));
+}
+
+static const char* smtOptions[] = {
+ ${all_modules_smt_options},
+#line 802 "${template}"
+ NULL
+};/* smtOptions[] */
+
+std::vector<std::string> Options::suggestSmtOptions(const std::string& optionName) throw() {
+ std::vector<std::string> suggestions;
+
+ const char* opt;
+ for(size_t i = 0; (opt = smtOptions[i]) != NULL; ++i) {
+ if(std::strstr(opt, optionName.c_str()) != NULL) {
+ suggestions.push_back(opt);
+ }
+ }
+
+ return suggestions;
+}
+
+std::vector< std::vector<std::string> > Options::getOptions() const throw() {
+ std::vector< std::vector<std::string> > opts;
+
+ ${all_modules_get_options}
+
+#line 824 "${template}"
+
+ return opts;
+}
+
+
+#undef USE_EARLY_TYPE_CHECKING_BY_DEFAULT
+#undef DO_SEMANTIC_CHECKS_BY_DEFAULT
+
+}/* CVC4 namespace */
diff --git a/org.eclipse.efm.symbex/cmake/cvc4-master-patch/util/integer_gmp_imp.h b/org.eclipse.efm.symbex/cmake/cvc4-master-patch/util/integer_gmp_imp.h
new file mode 100644
index 0000000..8bd2c7d
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/cvc4-master-patch/util/integer_gmp_imp.h
@@ -0,0 +1,510 @@
+/********************* */
+/*! \file integer_gmp_imp.h
+ ** \verbatim
+ ** Top contributors (to current version):
+ ** Tim King, Morgan Deters, Liana Hadarean
+ ** This file is part of the CVC4 project.
+ ** Copyright (c) 2009-2016 by the authors listed in the file AUTHORS
+ ** in the top-level source directory) and their institutional affiliations.
+ ** All rights reserved. See the file COPYING in the top-level source
+ ** directory for licensing information.\endverbatim
+ **
+ ** \brief A multiprecision integer constant; wraps a GMP multiprecision
+ ** integer.
+ **
+ ** A multiprecision integer constant; wraps a GMP multiprecision integer.
+ **/
+
+#include "cvc4_public.h"
+
+#ifndef __CVC4__INTEGER_H
+#define __CVC4__INTEGER_H
+
+#include <string>
+#include <iosfwd>
+#include <limits>
+
+#include "base/exception.h"
+#include "util/gmp_util.h"
+
+namespace CVC4 {
+
+class Rational;
+
+class CVC4_PUBLIC Integer {
+private:
+ /**
+ * Stores the value of the rational is stored in a C++ GMP integer class.
+ * Using this instead of mpz_t allows for easier destruction.
+ */
+ mpz_class d_value;
+
+public:
+
+ /**
+ * Gets a reference to the gmp data that backs up the integer.
+ * Only accessible to friend classes.
+ */
+ const mpz_class& get_mpz() const { return d_value; }
+
+ /**
+ * Constructs an Integer by copying a GMP C++ primitive.
+ */
+ Integer(const mpz_class& val) : d_value(val) {}
+
+ /** Constructs a rational with the value 0. */
+ Integer() : d_value(0){}
+
+ /**
+ * Constructs a Integer from a C string.
+ * Throws std::invalid_argument if the string is not a valid rational.
+ * For more information about what is a valid rational string,
+ * see GMP's documentation for mpq_set_str().
+ */
+ explicit Integer(const char* s, unsigned base = 10);
+ explicit Integer(const std::string& s, unsigned base = 10);
+
+ Integer(const Integer& q) : d_value(q.d_value) {}
+
+ Integer( signed int z) : d_value(z) {}
+ Integer(unsigned int z) : d_value(z) {}
+ Integer( signed long int z) : d_value(z) {}
+ Integer(unsigned long int z) : d_value(z) {}
+
+#ifdef CVC4_NEED_INT64_T_OVERLOADS
+ Integer( int64_t z) : d_value(static_cast<long>(z)) {}
+ Integer(uint64_t z) : d_value(static_cast<unsigned long>(z)) {}
+#endif /* CVC4_NEED_INT64_T_OVERLOADS */
+
+ ~Integer() {}
+
+ Integer& operator=(const Integer& x){
+ if(this == &x) return *this;
+ d_value = x.d_value;
+ return *this;
+ }
+
+ bool operator==(const Integer& y) const {
+ return d_value == y.d_value;
+ }
+
+ Integer operator-() const {
+ return Integer(-(d_value));
+ }
+
+
+ bool operator!=(const Integer& y) const {
+ return d_value != y.d_value;
+ }
+
+ bool operator< (const Integer& y) const {
+ return d_value < y.d_value;
+ }
+
+ bool operator<=(const Integer& y) const {
+ return d_value <= y.d_value;
+ }
+
+ bool operator> (const Integer& y) const {
+ return d_value > y.d_value;
+ }
+
+ bool operator>=(const Integer& y) const {
+ return d_value >= y.d_value;
+ }
+
+
+ Integer operator+(const Integer& y) const {
+ return Integer( d_value + y.d_value );
+ }
+ Integer& operator+=(const Integer& y) {
+ d_value += y.d_value;
+ return *this;
+ }
+
+ Integer operator-(const Integer& y) const {
+ return Integer( d_value - y.d_value );
+ }
+ Integer& operator-=(const Integer& y) {
+ d_value -= y.d_value;
+ return *this;
+ }
+
+ Integer operator*(const Integer& y) const {
+ return Integer( d_value * y.d_value );
+ }
+ Integer& operator*=(const Integer& y) {
+ d_value *= y.d_value;
+ return *this;
+ }
+
+
+ Integer bitwiseOr(const Integer& y) const {
+ mpz_class result;
+ mpz_ior(result.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer(result);
+ }
+
+ Integer bitwiseAnd(const Integer& y) const {
+ mpz_class result;
+ mpz_and(result.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer(result);
+ }
+
+ Integer bitwiseXor(const Integer& y) const {
+ mpz_class result;
+ mpz_xor(result.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer(result);
+ }
+
+ Integer bitwiseNot() const {
+ mpz_class result;
+ mpz_com(result.get_mpz_t(), d_value.get_mpz_t());
+ return Integer(result);
+ }
+
+ /**
+ * Return this*(2^pow).
+ */
+ Integer multiplyByPow2(uint32_t pow) const{
+ mpz_class result;
+ mpz_mul_2exp(result.get_mpz_t(), d_value.get_mpz_t(), pow);
+ return Integer( result );
+ }
+
+ /**
+ * Returns the Integer obtained by setting the ith bit of the
+ * current Integer to 1.
+ */
+ Integer setBit(uint32_t i) const {
+ mpz_class res = d_value;
+ mpz_setbit(res.get_mpz_t(), i);
+ return Integer(res);
+ }
+
+ bool isBitSet(uint32_t i) const {
+ return !extractBitRange(1, i).isZero();
+ }
+
+ /**
+ * Returns the integer with the binary representation of size bits
+ * extended with amount 1's
+ */
+ Integer oneExtend(uint32_t size, uint32_t amount) const;
+
+ uint32_t toUnsignedInt() const {
+ return mpz_get_ui(d_value.get_mpz_t());
+ }
+
+ /** See GMP Documentation. */
+ Integer extractBitRange(uint32_t bitCount, uint32_t low) const {
+ // bitCount = high-low+1
+ uint32_t high = low + bitCount-1;
+ //— Function: void mpz_fdiv_r_2exp (mpz_t r, mpz_t n, mp_bitcnt_t b)
+ mpz_class rem, div;
+ mpz_fdiv_r_2exp(rem.get_mpz_t(), d_value.get_mpz_t(), high+1);
+ mpz_fdiv_q_2exp(div.get_mpz_t(), rem.get_mpz_t(), low);
+
+ return Integer(div);
+ }
+
+ /**
+ * Returns the floor(this / y)
+ */
+ Integer floorDivideQuotient(const Integer& y) const {
+ mpz_class q;
+ mpz_fdiv_q(q.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer( q );
+ }
+
+ /**
+ * Returns r == this - floor(this/y)*y
+ */
+ Integer floorDivideRemainder(const Integer& y) const {
+ mpz_class r;
+ mpz_fdiv_r(r.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer( r );
+ }
+
+ /**
+ * Computes a floor quotient and remainder for x divided by y.
+ */
+ static void floorQR(Integer& q, Integer& r, const Integer& x, const Integer& y) {
+ mpz_fdiv_qr(q.d_value.get_mpz_t(), r.d_value.get_mpz_t(), x.d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ }
+
+ /**
+ * Returns the ceil(this / y)
+ */
+ Integer ceilingDivideQuotient(const Integer& y) const {
+ mpz_class q;
+ mpz_cdiv_q(q.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer( q );
+ }
+
+ /**
+ * Returns the ceil(this / y)
+ */
+ Integer ceilingDivideRemainder(const Integer& y) const {
+ mpz_class r;
+ mpz_cdiv_r(r.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer( r );
+ }
+
+ /**
+ * Computes a quoitent and remainder according to Boute's Euclidean definition.
+ * euclidianDivideQuotient, euclidianDivideRemainder.
+ *
+ * Boute, Raymond T. (April 1992).
+ * The Euclidean definition of the functions div and mod.
+ * ACM Transactions on Programming Languages and Systems (TOPLAS)
+ * ACM Press. 14 (2): 127 - 144. doi:10.1145/128861.128862.
+ */
+ static void euclidianQR(Integer& q, Integer& r, const Integer& x, const Integer& y) {
+ // compute the floor and then fix the value up if needed.
+ floorQR(q,r,x,y);
+
+ if(r.strictlyNegative()){
+ // if r < 0
+ // abs(r) < abs(y)
+ // - abs(y) < r < 0, then 0 < r + abs(y) < abs(y)
+ // n = y * q + r
+ // n = y * q - abs(y) + r + abs(y)
+ if(r.sgn() >= 0){
+ // y = abs(y)
+ // n = y * q - y + r + y
+ // n = y * (q-1) + (r+y)
+ q -= 1;
+ r += y;
+ }else{
+ // y = -abs(y)
+ // n = y * q + y + r - y
+ // n = y * (q+1) + (r-y)
+ q += 1;
+ r -= y;
+ }
+ }
+ }
+ /**
+ * Returns the quoitent according to Boute's Euclidean definition.
+ * See the documentation for euclidianQR.
+ */
+ Integer euclidianDivideQuotient(const Integer& y) const {
+ Integer q,r;
+ euclidianQR(q,r, *this, y);
+ return q;
+ }
+
+ /**
+ * Returns the remainfing according to Boute's Euclidean definition.
+ * See the documentation for euclidianQR.
+ */
+ Integer euclidianDivideRemainder(const Integer& y) const {
+ Integer q,r;
+ euclidianQR(q,r, *this, y);
+ return r;
+ }
+
+
+ /**
+ * If y divides *this, then exactQuotient returns (this/y)
+ */
+ Integer exactQuotient(const Integer& y) const;
+
+ /**
+ * Returns y mod 2^exp
+ */
+ Integer modByPow2(uint32_t exp) const {
+ mpz_class res;
+ mpz_fdiv_r_2exp(res.get_mpz_t(), d_value.get_mpz_t(), exp);
+ return Integer(res);
+ }
+
+ /**
+ * Returns y / 2^exp
+ */
+ Integer divByPow2(uint32_t exp) const {
+ mpz_class res;
+ mpz_fdiv_q_2exp(res.get_mpz_t(), d_value.get_mpz_t(), exp);
+ return Integer(res);
+ }
+
+
+ int sgn() const {
+ return mpz_sgn(d_value.get_mpz_t());
+ }
+
+ inline bool strictlyPositive() const {
+ return sgn() > 0;
+ }
+
+ inline bool strictlyNegative() const {
+ return sgn() < 0;
+ }
+
+ inline bool isZero() const {
+ return sgn() == 0;
+ }
+
+ bool isOne() const {
+ return mpz_cmp_si(d_value.get_mpz_t(), 1) == 0;
+ }
+
+ bool isNegativeOne() const {
+ return mpz_cmp_si(d_value.get_mpz_t(), -1) == 0;
+ }
+
+ /**
+ * Raise this Integer to the power <code>exp</code>.
+ *
+ * @param exp the exponent
+ */
+ Integer pow(unsigned long int exp) const {
+ mpz_class result;
+ mpz_pow_ui(result.get_mpz_t(), d_value.get_mpz_t(), exp);
+ return Integer(result);
+ }
+
+ /**
+ * Return the greatest common divisor of this integer with another.
+ */
+ Integer gcd(const Integer& y) const {
+ mpz_class result;
+ mpz_gcd(result.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer(result);
+ }
+
+ /**
+ * Return the least common multiple of this integer with another.
+ */
+ Integer lcm(const Integer& y) const {
+ mpz_class result;
+ mpz_lcm(result.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer(result);
+ }
+
+ /**
+ * All non-zero integers z, z.divide(0)
+ * ! zero.divides(zero)
+ */
+ bool divides(const Integer& y) const {
+ int res = mpz_divisible_p(y.d_value.get_mpz_t(), d_value.get_mpz_t());
+ return res != 0;
+ }
+
+ /**
+ * Return the absolute value of this integer.
+ */
+ Integer abs() const {
+ return d_value >= 0 ? *this : -*this;
+ }
+
+ std::string toString(int base = 10) const{
+ return d_value.get_str(base);
+ }
+
+ bool fitsSignedInt() const;
+
+ bool fitsUnsignedInt() const;
+
+ signed int getSignedInt() const;
+
+ unsigned int getUnsignedInt() const;
+
+ bool fitsSignedLong() const;
+
+ bool fitsUnsignedLong() const;
+
+ long getLong() const {
+ long si = d_value.get_si();
+ // ensure there wasn't overflow
+ CheckArgument(mpz_cmp_si(d_value.get_mpz_t(), si) == 0, this,
+ "Overflow detected in Integer::getLong().");
+ return si;
+ }
+
+ unsigned long getUnsignedLong() const {
+ unsigned long ui = d_value.get_ui();
+ // ensure there wasn't overflow
+ CheckArgument(mpz_cmp_ui(d_value.get_mpz_t(), ui) == 0, this,
+ "Overflow detected in Integer::getUnsignedLong().");
+ return ui;
+ }
+
+ /**
+ * Computes the hash of the node from the first word of the
+ * numerator, the denominator.
+ */
+ size_t hash() const {
+ return gmpz_hash(d_value.get_mpz_t());
+ }
+
+ /**
+ * Returns true iff bit n is set.
+ *
+ * @param n the bit to test (0 == least significant bit)
+ * @return true if bit n is set in this integer; false otherwise
+ */
+ bool testBit(unsigned n) const {
+ return mpz_tstbit(d_value.get_mpz_t(), n);
+ }
+
+ /**
+ * Returns k if the integer is equal to 2^(k-1)
+ * @return k if the integer is equal to 2^(k-1) and 0 otherwise
+ */
+ unsigned isPow2() const {
+ if (d_value <= 0) return 0;
+ // check that the number of ones in the binary representation is 1
+ if (mpz_popcount(d_value.get_mpz_t()) == 1) {
+ // return the index of the first one plus 1
+ return mpz_scan1(d_value.get_mpz_t(), 0) + 1;
+ }
+ return 0;
+ }
+
+
+ /**
+ * If x != 0, returns the smallest n s.t. 2^{n-1} <= abs(x) < 2^{n}.
+ * If x == 0, returns 1.
+ */
+ size_t length() const {
+ if(sgn() == 0){
+ return 1;
+ }else{
+ return mpz_sizeinbase(d_value.get_mpz_t(),2);
+ }
+ }
+
+ static void extendedGcd(Integer& g, Integer& s, Integer& t, const Integer& a, const Integer& b){
+ //see the documentation for:
+ //mpz_gcdext (mpz_t g, mpz_t s, mpz_t t, mpz_t a, mpz_t b);
+ mpz_gcdext (g.d_value.get_mpz_t(), s.d_value.get_mpz_t(), t.d_value.get_mpz_t(), a.d_value.get_mpz_t(), b.d_value.get_mpz_t());
+ }
+
+ /** Returns a reference to the minimum of two integers. */
+ static const Integer& min(const Integer& a, const Integer& b){
+ return (a <=b ) ? a : b;
+ }
+
+ /** Returns a reference to the maximum of two integers. */
+ static const Integer& max(const Integer& a, const Integer& b){
+ return (a >= b ) ? a : b;
+ }
+
+ friend class CVC4::Rational;
+};/* class Integer */
+
+struct IntegerHashFunction {
+ inline size_t operator()(const CVC4::Integer& i) const {
+ return i.hash();
+ }
+};/* struct IntegerHashFunction */
+
+inline std::ostream& operator<<(std::ostream& os, const Integer& n) {
+ return os << n.toString();
+}
+
+}/* CVC4 namespace */
+
+#endif /* __CVC4__INTEGER_H */
diff --git a/org.eclipse.efm.symbex/cmake/cvc4-master-patch/util/rational_gmp_imp.h b/org.eclipse.efm.symbex/cmake/cvc4-master-patch/util/rational_gmp_imp.h
new file mode 100644
index 0000000..5473c92
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/cvc4-master-patch/util/rational_gmp_imp.h
@@ -0,0 +1,355 @@
+/********************* */
+/*! \file rational_gmp_imp.h
+ ** \verbatim
+ ** Top contributors (to current version):
+ ** Tim King, Morgan Deters, Dejan Jovanovic
+ ** This file is part of the CVC4 project.
+ ** Copyright (c) 2009-2016 by the authors listed in the file AUTHORS
+ ** in the top-level source directory) and their institutional affiliations.
+ ** All rights reserved. See the file COPYING in the top-level source
+ ** directory for licensing information.\endverbatim
+ **
+ ** \brief Multiprecision rational constants; wraps a GMP multiprecision
+ ** rational.
+ **
+ ** Multiprecision rational constants; wraps a GMP multiprecision rational.
+ **/
+
+#include "cvc4_public.h"
+
+#ifndef __CVC4__RATIONAL_H
+#define __CVC4__RATIONAL_H
+
+#include <gmp.h>
+#include <string>
+
+#include "base/exception.h"
+#include "util/integer.h"
+
+namespace CVC4 {
+
+class CVC4_PUBLIC RationalFromDoubleException : public Exception {
+public:
+ RationalFromDoubleException(double d) throw();
+};
+
+/**
+ ** A multi-precision rational constant.
+ ** This stores the rational as a pair of multi-precision integers,
+ ** one for the numerator and one for the denominator.
+ ** The number is always stored so that the gcd of the numerator and denominator
+ ** is 1. (This is referred to as referred to as canonical form in GMP's
+ ** literature.) A consequence is that that the numerator and denominator may be
+ ** different than the values used to construct the Rational.
+ **
+ ** NOTE: The correct way to create a Rational from an int is to use one of the
+ ** int numerator/int denominator constructors with the denominator 1. Trying
+ ** to construct a Rational with a single int, e.g., Rational(0), will put you
+ ** in danger of invoking the char* constructor, from whence you will segfault.
+ **/
+
+class CVC4_PUBLIC Rational {
+private:
+ /**
+ * Stores the value of the rational is stored in a C++ GMP rational class.
+ * Using this instead of mpq_t allows for easier destruction.
+ */
+ mpq_class d_value;
+
+public:
+
+ /**
+ * Constructs a Rational from a mpq_class object.
+ * Does a deep copy.
+ * Assumes that the value is in canonical form, and thus does not
+ * have to call canonicalize() on the value.
+ */
+ Rational(const mpq_class& val) : d_value(val) { }
+
+ /**
+ * Creates a rational from a decimal string (e.g., <code>"1.5"</code>).
+ *
+ * @param dec a string encoding a decimal number in the format
+ * <code>[0-9]*\.[0-9]*</code>
+ */
+ static Rational fromDecimal(const std::string& dec);
+
+ /** Constructs a rational with the value 0/1. */
+ Rational() : d_value(0){
+ d_value.canonicalize();
+ }
+
+ /**
+ * Constructs a Rational from a C string in a given base (defaults to 10).
+ * Throws std::invalid_argument if the string is not a valid rational.
+ * For more information about what is a valid rational string,
+ * see GMP's documentation for mpq_set_str().
+ */
+ explicit Rational(const char* s, unsigned base = 10): d_value(s, base) {
+ d_value.canonicalize();
+ }
+ Rational(const std::string& s, unsigned base = 10) : d_value(s, base) {
+ d_value.canonicalize();
+ }
+
+ /**
+ * Creates a Rational from another Rational, q, by performing a deep copy.
+ */
+ Rational(const Rational& q) : d_value(q.d_value) {
+ d_value.canonicalize();
+ }
+
+ /**
+ * Constructs a canonical Rational from a numerator.
+ */
+ Rational(signed int n) : d_value(n,1) {
+ d_value.canonicalize();
+ }
+ Rational(unsigned int n) : d_value(n,1) {
+ d_value.canonicalize();
+ }
+ Rational(signed long int n) : d_value(n,1) {
+ d_value.canonicalize();
+ }
+ Rational(unsigned long int n) : d_value(n,1) {
+ d_value.canonicalize();
+ }
+
+#ifdef CVC4_NEED_INT64_T_OVERLOADS
+ Rational(int64_t n) : d_value(static_cast<long>(n), 1) {
+ d_value.canonicalize();
+ }
+ Rational(uint64_t n) : d_value(static_cast<unsigned long>(n), 1) {
+ d_value.canonicalize();
+ }
+#endif /* CVC4_NEED_INT64_T_OVERLOADS */
+
+ /**
+ * Constructs a canonical Rational from a numerator and denominator.
+ */
+ Rational(signed int n, signed int d) : d_value(n,d) {
+ d_value.canonicalize();
+ }
+ Rational(unsigned int n, unsigned int d) : d_value(n,d) {
+ d_value.canonicalize();
+ }
+ Rational(signed long int n, signed long int d) : d_value(n,d) {
+ d_value.canonicalize();
+ }
+ Rational(unsigned long int n, unsigned long int d) : d_value(n,d) {
+ d_value.canonicalize();
+ }
+
+#ifdef CVC4_NEED_INT64_T_OVERLOADS
+ Rational(int64_t n, int64_t d) : d_value(static_cast<long>(n), static_cast<long>(d)) {
+ d_value.canonicalize();
+ }
+ Rational(uint64_t n, uint64_t d) : d_value(static_cast<unsigned long>(n), static_cast<unsigned long>(d)) {
+ d_value.canonicalize();
+ }
+#endif /* CVC4_NEED_INT64_T_OVERLOADS */
+
+ Rational(const Integer& n, const Integer& d) :
+ d_value(n.get_mpz(), d.get_mpz())
+ {
+ d_value.canonicalize();
+ }
+ Rational(const Integer& n) :
+ d_value(n.get_mpz())
+ {
+ d_value.canonicalize();
+ }
+ ~Rational() {}
+
+ /**
+ * Gets a reference to the gmp data that backs up the rational.
+ * Only accessible to friend classes.
+ */
+ const mpq_class& get_mpq() const { return d_value; }
+
+ /**
+ * Returns the value of numerator of the Rational.
+ * Note that this makes a deep copy of the numerator.
+ */
+ Integer getNumerator() const {
+ return Integer(d_value.get_num());
+ }
+
+ /**
+ * Returns the value of denominator of the Rational.
+ * Note that this makes a deep copy of the denominator.
+ */
+ Integer getDenominator() const {
+ return Integer(d_value.get_den());
+ }
+
+ static Rational fromDouble(double d) throw(RationalFromDoubleException);
+
+ /**
+ * Get a double representation of this Rational, which is
+ * approximate: truncation may occur, overflow may result in
+ * infinity, and underflow may result in zero.
+ */
+ double getDouble() const {
+ return d_value.get_d();
+ }
+
+ Rational inverse() const {
+ return Rational(getDenominator(), getNumerator());
+ }
+
+ int cmp(const Rational& x) const {
+ //Don't use mpq_class's cmp() function.
+ //The name ends up conflicting with this function.
+ return mpq_cmp(d_value.get_mpq_t(), x.d_value.get_mpq_t());
+ }
+
+ int sgn() const {
+ return mpq_sgn(d_value.get_mpq_t());
+ }
+
+ bool isZero() const {
+ return sgn() == 0;
+ }
+
+ bool isOne() const {
+ return mpq_cmp_si(d_value.get_mpq_t(), 1, 1) == 0;
+ }
+
+ bool isNegativeOne() const {
+ return mpq_cmp_si(d_value.get_mpq_t(), -1, 1) == 0;
+ }
+
+ Rational abs() const {
+ if(sgn() < 0){
+ return -(*this);
+ }else{
+ return *this;
+ }
+ }
+
+ Integer floor() const {
+ mpz_class q;
+ mpz_fdiv_q(q.get_mpz_t(), d_value.get_num_mpz_t(), d_value.get_den_mpz_t());
+ return Integer(q);
+ }
+
+ Integer ceiling() const {
+ mpz_class q;
+ mpz_cdiv_q(q.get_mpz_t(), d_value.get_num_mpz_t(), d_value.get_den_mpz_t());
+ return Integer(q);
+ }
+
+ Rational floor_frac() const {
+ return (*this) - Rational(floor());
+ }
+
+ Rational& operator=(const Rational& x){
+ if(this == &x) return *this;
+ d_value = x.d_value;
+ return *this;
+ }
+
+ Rational operator-() const{
+ return Rational(-(d_value));
+ }
+
+ bool operator==(const Rational& y) const {
+ return d_value == y.d_value;
+ }
+
+ bool operator!=(const Rational& y) const {
+ return d_value != y.d_value;
+ }
+
+ bool operator< (const Rational& y) const {
+ return d_value < y.d_value;
+ }
+
+ bool operator<=(const Rational& y) const {
+ return d_value <= y.d_value;
+ }
+
+ bool operator> (const Rational& y) const {
+ return d_value > y.d_value;
+ }
+
+ bool operator>=(const Rational& y) const {
+ return d_value >= y.d_value;
+ }
+
+ Rational operator+(const Rational& y) const{
+ return Rational( d_value + y.d_value );
+ }
+ Rational operator-(const Rational& y) const {
+ return Rational( d_value - y.d_value );
+ }
+
+ Rational operator*(const Rational& y) const {
+ return Rational( d_value * y.d_value );
+ }
+ Rational operator/(const Rational& y) const {
+ return Rational( d_value / y.d_value );
+ }
+
+ Rational& operator+=(const Rational& y){
+ d_value += y.d_value;
+ return (*this);
+ }
+ Rational& operator-=(const Rational& y){
+ d_value -= y.d_value;
+ return (*this);
+ }
+
+ Rational& operator*=(const Rational& y){
+ d_value *= y.d_value;
+ return (*this);
+ }
+
+ Rational& operator/=(const Rational& y){
+ d_value /= y.d_value;
+ return (*this);
+ }
+
+ bool isIntegral() const{
+ return getDenominator() == 1;
+ }
+
+ /** Returns a string representing the rational in the given base. */
+ std::string toString(int base = 10) const {
+ return d_value.get_str(base);
+ }
+
+ /**
+ * Computes the hash of the rational from hashes of the numerator and the
+ * denominator.
+ */
+ size_t hash() const {
+ size_t numeratorHash = gmpz_hash(d_value.get_num_mpz_t());
+ size_t denominatorHash = gmpz_hash(d_value.get_den_mpz_t());
+
+ return numeratorHash xor denominatorHash;
+ }
+
+ uint32_t complexity() const {
+ uint32_t numLen = getNumerator().length();
+ uint32_t denLen = getDenominator().length();
+ return numLen + denLen;
+ }
+
+ /** Equivalent to calling (this->abs()).cmp(b.abs()) */
+ int absCmp(const Rational& q) const;
+
+};/* class Rational */
+
+struct RationalHashFunction {
+ inline size_t operator()(const CVC4::Rational& r) const {
+ return r.hash();
+ }
+};/* struct RationalHashFunction */
+
+CVC4_PUBLIC std::ostream& operator<<(std::ostream& os, const Rational& n);
+
+}/* CVC4 namespace */
+
+#endif /* __CVC4__RATIONAL_H */
diff --git a/org.eclipse.efm.symbex/cmake/cvc4-patch/config/boost-v2.m4 b/org.eclipse.efm.symbex/cmake/cvc4-patch/config/boost-v2.m4
new file mode 100644
index 0000000..27d063f
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/cvc4-patch/config/boost-v2.m4
@@ -0,0 +1,1560 @@
+# boost.m4: Locate Boost headers and libraries for autoconf-based projects.
+# Copyright (C) 2007-2011, 2014 Benoit Sigoure <tsuna@lrde.epita.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Additional permission under section 7 of the GNU General Public
+# License, version 3 ("GPLv3"):
+#
+# If you convey this file as part of a work that contains a
+# configuration script generated by Autoconf, you may do so under
+# terms of your choice.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+m4_define([_BOOST_SERIAL], [m4_translit([
+# serial 25
+], [#
+], [])])
+
+# Original sources can be found at http://github.com/tsuna/boost.m4
+# You can fetch the latest version of the script by doing:
+# wget http://github.com/tsuna/boost.m4/raw/master/build-aux/boost.m4
+
+# ------ #
+# README #
+# ------ #
+
+# This file provides several macros to use the various Boost libraries.
+# The first macro is BOOST_REQUIRE. It will simply check if it's possible to
+# find the Boost headers of a given (optional) minimum version and it will
+# define BOOST_CPPFLAGS accordingly. It will add an option --with-boost to
+# your configure so that users can specify non standard locations.
+# If the user's environment contains BOOST_ROOT and --with-boost was not
+# specified, --with-boost=$BOOST_ROOT is implicitly used.
+# For more README and documentation, go to http://github.com/tsuna/boost.m4
+# Note: THESE MACROS ASSUME THAT YOU USE LIBTOOL. If you don't, don't worry,
+# simply read the README, it will show you what to do step by step.
+
+m4_pattern_forbid([^_?(BOOST|Boost)_])
+
+
+# _BOOST_SED_CPP(SED-PROGRAM, PROGRAM,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# --------------------------------------------------------
+# Same as AC_EGREP_CPP, but leave the result in conftest.i.
+#
+# SED-PROGRAM is *not* overquoted, as in AC_EGREP_CPP. It is expanded
+# in double-quotes, so escape your double quotes.
+#
+# It could be useful to turn this into a macro which extracts the
+# value of any macro.
+m4_define([_BOOST_SED_CPP],
+[AC_LANG_PUSH([C++])dnl
+AC_LANG_PREPROC_REQUIRE()dnl
+AC_REQUIRE([AC_PROG_SED])dnl
+AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])])
+AS_IF([dnl eval is necessary to expand ac_cpp.
+dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
+dnl Beware of Windows end-of-lines, for instance if we are running
+dnl some Windows programs under Wine. In that case, boost/version.hpp
+dnl is certainly using "\r\n", but the regular Unix shell will only
+dnl strip `\n' with backquotes, not the `\r'. This results in
+dnl boost_cv_lib_version='1_37\r' for instance, which breaks
+dnl everything else.
+dnl Cannot use 'dnl' after [$4] because a trailing dnl may break AC_CACHE_CHECK
+dnl
+dnl Beware that GCC 5, when expanding macros, may embed # line directives
+dnl a within single line:
+dnl
+dnl # 1 "conftest.cc"
+dnl # 1 "<built-in>"
+dnl # 1 "<command-line>"
+dnl # 1 "conftest.cc"
+dnl # 1 "/opt/local/include/boost/version.hpp" 1 3
+dnl # 2 "conftest.cc" 2
+dnl boost-lib-version =
+dnl # 2 "conftest.cc" 3
+dnl "1_56"
+dnl
+dnl So get rid of the # lines, and glue the remaining ones together.
+(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+ grep -v '#' |
+ tr -d '\r' |
+ tr -s '\n' ' ' |
+ $SED -n -e "$1" >conftest.i 2>&1],
+ [$3],
+ [$4])
+rm -rf conftest*
+AC_LANG_POP([C++])dnl
+])# _BOOST_SED_CPP
+
+
+
+# BOOST_REQUIRE([VERSION], [ACTION-IF-NOT-FOUND])
+# -----------------------------------------------
+# Look for Boost. If version is given, it must either be a literal of the form
+# "X.Y.Z" where X, Y and Z are integers (the ".Z" part being optional) or a
+# variable "$var".
+# Defines the value BOOST_CPPFLAGS. This macro only checks for headers with
+# the required version, it does not check for any of the Boost libraries.
+# On # success, defines HAVE_BOOST. On failure, calls the optional
+# ACTION-IF-NOT-FOUND action if one was supplied.
+# Otherwise aborts with an error message.
+AC_DEFUN_ONCE([BOOST_REQUIRE],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_PROG_GREP])dnl
+echo "$as_me: this is boost.m4[]_BOOST_SERIAL" >&AS_MESSAGE_LOG_FD
+boost_save_IFS=$IFS
+boost_version_req=$1
+IFS=.
+set x $boost_version_req 0 0 0
+IFS=$boost_save_IFS
+shift
+boost_version_req=`expr "$[1]" '*' 100000 + "$[2]" '*' 100 + "$[3]"`
+boost_version_req_string=$[1].$[2].$[3]
+AC_ARG_WITH([boost],
+ [AS_HELP_STRING([--with-boost=DIR],
+ [prefix of Boost $1 @<:@guess@:>@])])dnl
+AC_ARG_VAR([BOOST_ROOT],[Location of Boost installation])dnl
+# If BOOST_ROOT is set and the user has not provided a value to
+# --with-boost, then treat BOOST_ROOT as if it the user supplied it.
+if test x"$BOOST_ROOT" != x; then
+ if test x"$with_boost" = x; then
+ AC_MSG_NOTICE([Detected BOOST_ROOT; continuing with --with-boost=$BOOST_ROOT])
+ with_boost=$BOOST_ROOT
+ else
+ AC_MSG_NOTICE([Detected BOOST_ROOT=$BOOST_ROOT, but overridden by --with-boost=$with_boost])
+ fi
+fi
+AC_SUBST([DISTCHECK_CONFIGURE_FLAGS],
+ ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"])dnl
+boost_save_CPPFLAGS=$CPPFLAGS
+ AC_CACHE_CHECK([for Boost headers version >= $boost_version_req_string],
+ [boost_cv_inc_path],
+ [boost_cv_inc_path=no
+AC_LANG_PUSH([C++])dnl
+m4_pattern_allow([^BOOST_VERSION$])dnl
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#include <boost/version.hpp>
+#if !defined BOOST_VERSION
+# error BOOST_VERSION is not defined
+#elif BOOST_VERSION < $boost_version_req
+# error Boost headers version < $boost_version_req
+#endif
+]])])
+ # If the user provided a value to --with-boost, use it and only it.
+ case $with_boost in #(
+ ''|yes) set x '' /opt/local/include /usr/local/include /opt/include \
+ /usr/include C:/Boost/include;; #(
+ *) set x "$with_boost/include" "$with_boost";;
+ esac
+ shift
+ for boost_dir
+ do
+ # Without --layout=system, Boost (or at least some versions) installs
+ # itself in <prefix>/include/boost-<version>. This inner loop helps to
+ # find headers in such directories.
+ #
+ # Any ${boost_dir}/boost-x_xx directories are searched in reverse version
+ # order followed by ${boost_dir}. The final '.' is a sentinel for
+ # searching $boost_dir" itself. Entries are whitespace separated.
+ #
+ # I didn't indent this loop on purpose (to avoid over-indented code)
+ boost_layout_system_search_list=`cd "$boost_dir" 2>/dev/null \
+ && ls -1 | "${GREP}" '^boost-' | sort -rn -t- -k2 \
+ && echo .`
+ for boost_inc in $boost_layout_system_search_list
+ do
+ if test x"$boost_inc" != x.; then
+ boost_inc="$boost_dir/$boost_inc"
+ else
+ boost_inc="$boost_dir" # Uses sentinel in boost_layout_system_search_list
+ fi
+ if test x"$boost_inc" != x; then
+ # We are going to check whether the version of Boost installed
+ # in $boost_inc is usable by running a compilation that
+ # #includes it. But if we pass a -I/some/path in which Boost
+ # is not installed, the compiler will just skip this -I and
+ # use other locations (either from CPPFLAGS, or from its list
+ # of system include directories). As a result we would use
+ # header installed on the machine instead of the /some/path
+ # specified by the user. So in that precise case (trying
+ # $boost_inc), make sure the version.hpp exists.
+ #
+ # Use test -e as there can be symlinks.
+ test -e "$boost_inc/boost/version.hpp" || continue
+ CPPFLAGS="$CPPFLAGS -I$boost_inc"
+ fi
+ AC_COMPILE_IFELSE([], [boost_cv_inc_path=yes], [boost_cv_version=no])
+ if test x"$boost_cv_inc_path" = xyes; then
+ if test x"$boost_inc" != x; then
+ boost_cv_inc_path=$boost_inc
+ fi
+ break 2
+ fi
+ done
+ done
+AC_LANG_POP([C++])dnl
+ ])
+ case $boost_cv_inc_path in #(
+ no)
+ boost_errmsg="cannot find Boost headers version >= $boost_version_req_string"
+ m4_if([$2], [], [AC_MSG_ERROR([$boost_errmsg])],
+ [AC_MSG_NOTICE([$boost_errmsg])])
+ $2
+ ;;#(
+ yes)
+ BOOST_CPPFLAGS=
+ ;;#(
+ *)
+ AC_SUBST([BOOST_CPPFLAGS], ["-I$boost_cv_inc_path"])dnl
+ ;;
+ esac
+ if test x"$boost_cv_inc_path" != xno; then
+ AC_DEFINE([HAVE_BOOST], [1],
+ [Defined if the requested minimum BOOST version is satisfied])
+ AC_CACHE_CHECK([for Boost's header version],
+ [boost_cv_lib_version],
+ [m4_pattern_allow([^BOOST_LIB_VERSION$])dnl
+ _BOOST_SED_CPP([[/^boost-lib-version = /{s///;s/[\" ]//g;p;q;}]],
+ [#include <boost/version.hpp>
+boost-lib-version = BOOST_LIB_VERSION],
+ [boost_cv_lib_version=`cat conftest.i`])])
+ # e.g. "134" for 1_34_1 or "135" for 1_35
+ boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'`
+ case $boost_major_version in #(
+ '' | *[[!0-9]]*)
+ AC_MSG_ERROR([invalid value: boost_major_version='$boost_major_version'])
+ ;;
+ esac
+fi
+CPPFLAGS=$boost_save_CPPFLAGS
+])# BOOST_REQUIRE
+
+
+# BOOST_STATIC()
+# --------------
+# Add the "--enable-static-boost" configure argument. If this argument is given
+# on the command line, static versions of the libraries will be looked up.
+AC_DEFUN([BOOST_STATIC],
+ [AC_ARG_ENABLE([static-boost],
+ [AS_HELP_STRING([--enable-static-boost],
+ [Prefer the static boost libraries over the shared ones [no]])],
+ [enable_static_boost=yes],
+ [enable_static_boost=no])])# BOOST_STATIC
+
+
+# BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND])
+# --------------------------------------------------------------------------
+# Wrapper around AC_CHECK_HEADER for Boost headers. Useful to check for
+# some parts of the Boost library which are only made of headers and don't
+# require linking (such as Boost.Foreach).
+#
+# Default ACTION-IF-NOT-FOUND: Fail with a fatal error unless Boost couldn't be
+# found in the first place, in which case by default a notice is issued to the
+# user. Presumably if we haven't died already it's because it's OK to not have
+# Boost, which is why only a notice is issued instead of a hard error.
+#
+# Default ACTION-IF-FOUND: define the preprocessor symbol HAVE_<HEADER-NAME> in
+# case of success # (where HEADER-NAME is written LIKE_THIS, e.g.,
+# HAVE_BOOST_FOREACH_HPP).
+AC_DEFUN([BOOST_FIND_HEADER],
+[AC_REQUIRE([BOOST_REQUIRE])dnl
+if test x"$boost_cv_inc_path" = xno; then
+ m4_default([$2], [AC_MSG_NOTICE([Boost not available, not searching for $1])])
+else
+AC_LANG_PUSH([C++])dnl
+boost_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+AC_CHECK_HEADER([$1],
+ [m4_default([$3], [AC_DEFINE(AS_TR_CPP([HAVE_$1]), [1],
+ [Define to 1 if you have <$1>])])],
+ [m4_default([$2], [AC_MSG_ERROR([cannot find $1])])])
+CPPFLAGS=$boost_save_CPPFLAGS
+AC_LANG_POP([C++])dnl
+fi
+])# BOOST_FIND_HEADER
+
+
+# BOOST_FIND_LIBS([COMPONENT-NAME], [CANDIDATE-LIB-NAMES],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Look for the Boost library COMPONENT-NAME (e.g., `thread', for
+# libboost_thread) under the possible CANDIDATE-LIB-NAMES (e.g.,
+# "thread_win32 thread"). Check that HEADER-NAME works and check that
+# libboost_LIB-NAME can link with the code CXX-TEST. The optional
+# argument CXX-PROLOGUE can be used to include some C++ code before
+# the `main' function.
+#
+# Invokes BOOST_FIND_HEADER([HEADER-NAME]) (see above).
+#
+# Boost libraries typically come compiled with several flavors (with different
+# runtime options) so PREFERRED-RT-OPT is the preferred suffix. A suffix is one
+# or more of the following letters: sgdpn (in that order). s = static
+# runtime, d = debug build, g = debug/diagnostic runtime, p = STLPort build,
+# n = (unsure) STLPort build without iostreams from STLPort (it looks like `n'
+# must always be used along with `p'). Additionally, PREFERRED-RT-OPT can
+# start with `mt-' to indicate that there is a preference for multi-thread
+# builds. Some sample values for PREFERRED-RT-OPT: (nothing), mt, d, mt-d, gdp
+# ... If you want to make sure you have a specific version of Boost
+# (eg, >= 1.33) you *must* invoke BOOST_REQUIRE before this macro.
+AC_DEFUN([BOOST_FIND_LIBS],
+[AC_REQUIRE([BOOST_REQUIRE])dnl
+AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl
+AC_REQUIRE([BOOST_STATIC])dnl
+AC_REQUIRE([_BOOST_GUESS_WHETHER_TO_USE_MT])dnl
+if test x"$boost_cv_inc_path" = xno; then
+ AC_MSG_NOTICE([Boost not available, not searching for the Boost $1 library])
+else
+dnl The else branch is huge and wasn't intended on purpose.
+AC_LANG_PUSH([C++])dnl
+AS_VAR_PUSHDEF([Boost_lib], [boost_cv_lib_$1])dnl
+AS_VAR_PUSHDEF([Boost_lib_LDFLAGS], [boost_cv_lib_$1_LDFLAGS])dnl
+AS_VAR_PUSHDEF([Boost_lib_LDPATH], [boost_cv_lib_$1_LDPATH])dnl
+AS_VAR_PUSHDEF([Boost_lib_LIBS], [boost_cv_lib_$1_LIBS])dnl
+BOOST_FIND_HEADER([$4])
+boost_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib],
+ [_BOOST_FIND_LIBS($@)])
+case $Boost_lib in #(
+ (no) _AC_MSG_LOG_CONFTEST
+ AC_MSG_ERROR([cannot find the flags to link with Boost $1])
+ ;;
+esac
+AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS])dnl
+AC_SUBST(AS_TR_CPP([BOOST_$1_LDPATH]), [$Boost_lib_LDPATH])dnl
+AC_SUBST([BOOST_LDPATH], [$Boost_lib_LDPATH])dnl
+AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS])dnl
+CPPFLAGS=$boost_save_CPPFLAGS
+AS_VAR_POPDEF([Boost_lib])dnl
+AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl
+AS_VAR_POPDEF([Boost_lib_LDPATH])dnl
+AS_VAR_POPDEF([Boost_lib_LIBS])dnl
+AC_LANG_POP([C++])dnl
+fi
+])
+
+
+# BOOST_FIND_LIB([LIB-NAME],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Backward compatibility wrapper for BOOST_FIND_LIBS.
+AC_DEFUN([BOOST_FIND_LIB],
+[BOOST_FIND_LIBS([$1], $@)])
+
+
+# _BOOST_FIND_LIBS([LIB-NAME], [CANDIDATE-LIB-NAMES],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Real implementation of BOOST_FIND_LIBS: rely on these local macros:
+# Boost_lib, Boost_lib_LDFLAGS, Boost_lib_LDPATH, Boost_lib_LIBS
+#
+# The algorithm is as follows: first look for a given library name
+# according to the user's PREFERRED-RT-OPT. For each library name, we
+# prefer to use the ones that carry the tag (toolset name). Each
+# library is searched through the various standard paths were Boost is
+# usually installed. If we can't find the standard variants, we try
+# to enforce -mt (for instance on MacOSX, libboost_thread.dylib
+# doesn't exist but there's -obviously- libboost_thread-mt.dylib).
+AC_DEFUN([_BOOST_FIND_LIBS],
+[Boost_lib=no
+ case "$3" in #(
+ (mt | mt-) boost_mt=-mt; boost_rtopt=;; #(
+ (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$3" : 'Xmt-*\(.*\)'`;; #(
+ (*) boost_mt=; boost_rtopt=$3;;
+ esac
+ if test $enable_static_boost = yes; then
+ boost_rtopt="s$boost_rtopt"
+ fi
+ # Find the proper debug variant depending on what we've been asked to find.
+ case $boost_rtopt in #(
+ (*d*) boost_rt_d=$boost_rtopt;; #(
+ (*[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn')
+ boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #(
+ (*) boost_rt_d='-d';;
+ esac
+ # If the PREFERRED-RT-OPT are not empty, prepend a `-'.
+ test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt"
+ $boost_guess_use_mt && boost_mt=-mt
+ # Look for the abs path the static archive.
+ # $libext is computed by Libtool but let's make sure it's non empty.
+ test -z "$libext" &&
+ AC_MSG_ERROR([the libext variable is empty, did you invoke Libtool?])
+ boost_save_ac_objext=$ac_objext
+ # Generate the test file.
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$4>
+$6], [$5])])
+dnl Optimization hacks: compiling C++ is slow, especially with Boost. What
+dnl we're trying to do here is guess the right combination of link flags
+dnl (LIBS / LDFLAGS) to use a given library. This can take several
+dnl iterations before it succeeds and is thus *very* slow. So what we do
+dnl instead is that we compile the code first (and thus get an object file,
+dnl typically conftest.o). Then we try various combinations of link flags
+dnl until we succeed to link conftest.o in an executable. The problem is
+dnl that the various TRY_LINK / COMPILE_IFELSE macros of Autoconf always
+dnl remove all the temporary files including conftest.o. So the trick here
+dnl is to temporarily change the value of ac_objext so that conftest.o is
+dnl preserved accross tests. This is obviously fragile and I will burn in
+dnl hell for not respecting Autoconf's documented interfaces, but in the
+dnl mean time, it optimizes the macro by a factor of 5 to 30.
+dnl Another small optimization: the first argument of AC_COMPILE_IFELSE left
+dnl empty because the test file is generated only once above (before we
+dnl start the for loops).
+ AC_COMPILE_IFELSE([],
+ [ac_objext=do_not_rm_me_plz],
+ [AC_MSG_ERROR([cannot compile a test that uses Boost $1])])
+ ac_objext=$boost_save_ac_objext
+ boost_failed_libs=
+# Don't bother to ident the following nested for loops, only the 2
+# innermost ones matter.
+for boost_lib_ in $2; do
+for boost_tag_ in -$boost_cv_lib_tag ''; do
+for boost_ver_ in -$boost_cv_lib_version ''; do
+for boost_mt_ in $boost_mt -mt ''; do
+for boost_rtopt_ in $boost_rtopt '' -d; do
+ for boost_lib in \
+ boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_ver_
+ do
+ # Avoid testing twice the same lib
+ case $boost_failed_libs in #(
+ (*@$boost_lib@*) continue;;
+ esac
+ # If with_boost is empty, we'll search in /lib first, which is not quite
+ # right so instead we'll try to a location based on where the headers are.
+ boost_tmp_lib=$with_boost
+ test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include}
+ for boost_ldpath in "$boost_tmp_lib/lib" '' \
+ /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \
+ "$with_boost" C:/Boost/lib /lib*
+ do
+ # Don't waste time with directories that don't exist.
+ if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then
+ continue
+ fi
+ boost_save_LDFLAGS=$LDFLAGS
+ # Are we looking for a static library?
+ case $boost_ldpath:$boost_rtopt_ in #(
+ (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt)
+ Boost_lib_LIBS="$boost_ldpath/lib$boost_lib.$libext"
+ test -e "$Boost_lib_LIBS" || continue;; #(
+ (*) # No: use -lboost_foo to find the shared library.
+ Boost_lib_LIBS="-l$boost_lib";;
+ esac
+ boost_save_LIBS=$LIBS
+ LIBS="$Boost_lib_LIBS $LIBS"
+ test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath"
+dnl First argument of AC_LINK_IFELSE left empty because the test file is
+dnl generated only once above (before we start the for loops).
+ _BOOST_AC_LINK_IFELSE([],
+ [Boost_lib=yes], [Boost_lib=no])
+ ac_objext=$boost_save_ac_objext
+ LDFLAGS=$boost_save_LDFLAGS
+ LIBS=$boost_save_LIBS
+ if test x"$Boost_lib" = xyes; then
+ # Check or used cached result of whether or not using -R or
+ # -rpath makes sense. Some implementations of ld, such as for
+ # Mac OSX, require -rpath but -R is the flag known to work on
+ # other systems. https://github.com/tsuna/boost.m4/issues/19
+ AC_CACHE_VAL([boost_cv_rpath_link_ldflag],
+ [case $boost_ldpath in
+ '') # Nothing to do.
+ boost_cv_rpath_link_ldflag=
+ boost_rpath_link_ldflag_found=yes;;
+ *)
+ for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do
+ LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
+ LIBS="$boost_save_LIBS $Boost_lib_LIBS"
+ _BOOST_AC_LINK_IFELSE([],
+ [boost_rpath_link_ldflag_found=yes
+ break],
+ [boost_rpath_link_ldflag_found=no])
+ done
+ ;;
+ esac
+ AS_IF([test "x$boost_rpath_link_ldflag_found" != "xyes"],
+ [AC_MSG_ERROR([Unable to determine whether to use -R or -rpath])])
+ LDFLAGS=$boost_save_LDFLAGS
+ LIBS=$boost_save_LIBS
+ ])
+ test x"$boost_ldpath" != x &&
+ Boost_lib_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
+ Boost_lib_LDPATH="$boost_ldpath"
+ break 7
+ else
+ boost_failed_libs="$boost_failed_libs@$boost_lib@"
+ fi
+ done
+ done
+done
+done
+done
+done
+done # boost_lib_
+rm -f conftest.$ac_objext
+])
+
+
+
+# --------------------------------------- #
+# Checks for the various Boost libraries. #
+# --------------------------------------- #
+
+# List of boost libraries: http://www.boost.org/libs/libraries.htm
+# The page http://beta.boost.org/doc/libs is useful: it gives the first release
+# version of each library (among other things).
+
+# BOOST_DEFUN(LIBRARY, CODE)
+# --------------------------
+# Define BOOST_<LIBRARY-UPPERCASE> as a macro that runs CODE.
+#
+# Use indir to avoid the warning on underquoted macro name given to AC_DEFUN.
+m4_define([BOOST_DEFUN],
+[m4_indir([AC_DEFUN],
+ m4_toupper([BOOST_$1]),
+[m4_pushdef([BOOST_Library], [$1])dnl
+$2
+m4_popdef([BOOST_Library])dnl
+])
+])
+
+# BOOST_ARRAY()
+# -------------
+# Look for Boost.Array
+BOOST_DEFUN([Array],
+[BOOST_FIND_HEADER([boost/array.hpp])])
+
+
+# BOOST_ASIO()
+# ------------
+# Look for Boost.Asio (new in Boost 1.35).
+BOOST_DEFUN([Asio],
+[AC_REQUIRE([BOOST_SYSTEM])dnl
+BOOST_FIND_HEADER([boost/asio.hpp])])
+
+
+# BOOST_BIND()
+# ------------
+# Look for Boost.Bind.
+BOOST_DEFUN([Bind],
+[BOOST_FIND_HEADER([boost/bind.hpp])])
+
+
+# BOOST_CHRONO()
+# --------------
+# Look for Boost.Chrono.
+BOOST_DEFUN([Chrono],
+[# Do we have to check for Boost.System? This link-time dependency was
+# added as of 1.35.0. If we have a version <1.35, we must not attempt to
+# find Boost.System as it didn't exist by then.
+if test $boost_major_version -ge 135; then
+ BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+boost_filesystem_save_LIBS=$LIBS
+boost_filesystem_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([chrono], [$1],
+ [boost/chrono.hpp],
+ [boost::chrono::thread_clock d;])
+if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
+ BOOST_CHRONO_LIBS="$BOOST_CHRONO_LIBS $BOOST_SYSTEM_LIBS"
+fi
+LIBS=$boost_filesystem_save_LIBS
+LDFLAGS=$boost_filesystem_save_LDFLAGS
+])# BOOST_CHRONO
+
+
+# BOOST_CONTEXT([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Context. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+#
+# * This library was introduced in Boost 1.51.0
+# * The signatures of make_fcontext() and jump_fcontext were changed in 1.56.0
+# * A dependency on boost_thread appears in 1.57.0
+BOOST_DEFUN([Context],
+[boost_context_save_LIBS=$LIBS
+ boost_context_save_LDFLAGS=$LDFLAGS
+if test $boost_major_version -ge 157; then
+ BOOST_THREAD([$1])
+ m4_pattern_allow([^BOOST_THREAD_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_THREAD_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_THREAD_LDFLAGS"
+fi
+BOOST_FIND_LIB([context], [$1],
+ [boost/context/all.hpp],[[
+
+// creates a stack
+void * stack_pointer = new void*[4096];
+std::size_t const size = sizeof(void*[4096]);
+
+#if BOOST_VERSION <= 105100
+ctx::make_fcontext(&fc, f);
+return ctx::jump_fcontext(&fcm, &fc, 3) == 6;
+
+#else
+
+fc = ctx::make_fcontext(stack_pointer, size, f);
+return ctx::jump_fcontext(&fcm, fc, 3) == 6;
+
+#endif
+
+
+]],[dnl
+
+#include <boost/version.hpp>
+#if BOOST_VERSION <= 105100
+
+namespace ctx = boost::ctx;
+
+static ctx::fcontext_t fcm, fc;
+
+static void f(intptr_t i) {
+ ctx::jump_fcontext(&fc, &fcm, i * 2);
+}
+
+#elif BOOST_VERSION <= 105500
+
+namespace ctx = boost::context;
+
+// context
+static ctx::fcontext_t fcm, *fc;
+
+// context-function
+static void f(intptr_t i) {
+ ctx::jump_fcontext(fc, &fcm, i * 2);
+}
+
+#else
+
+namespace ctx = boost::context;
+
+// context
+static ctx::fcontext_t fcm, fc;
+
+// context-function
+static void f(intptr_t i) {
+ ctx::jump_fcontext(&fc, fcm, i * 2);
+}
+#endif
+])
+LIBS=$boost_context_save_LIBS
+LDFLAGS=$boost_context_save_LDFLAGS
+])# BOOST_CONTEXT
+
+
+# BOOST_CONVERSION()
+# ------------------
+# Look for Boost.Conversion (cast / lexical_cast)
+BOOST_DEFUN([Conversion],
+[BOOST_FIND_HEADER([boost/cast.hpp])
+BOOST_FIND_HEADER([boost/lexical_cast.hpp])
+])# BOOST_CONVERSION
+
+
+# BOOST_COROUTINE([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Coroutine. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. This library was introduced in Boost
+# 1.53.0
+BOOST_DEFUN([Coroutine],
+[
+boost_coroutine_save_LIBS=$LIBS
+boost_coroutine_save_LDFLAGS=$LDFLAGS
+# Link-time dependency from coroutine to context
+BOOST_CONTEXT([$1])
+# Starting from Boost 1.55 a dependency on Boost.System is added
+if test $boost_major_version -ge 155; then
+ BOOST_SYSTEM([$1])
+fi
+m4_pattern_allow([^BOOST_(CONTEXT|SYSTEM)_(LIBS|LDFLAGS)])
+LIBS="$LIBS $BOOST_CONTEXT_LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_CONTEXT_LDFLAGS"
+
+# in 1.53 coroutine was a header only library
+if test $boost_major_version -eq 153; then
+ BOOST_FIND_HEADER([boost/coroutine/coroutine.hpp])
+else
+ BOOST_FIND_LIB([coroutine], [$1],
+ [boost/coroutine/coroutine.hpp],
+ [
+ #include <boost/version.hpp>
+ #if BOOST_VERSION <= 105500
+ boost::coroutines::coroutine<int(int)> coro; coro.get();
+ #else
+ boost::coroutines::asymmetric_coroutine<int>::pull_type coro; coro.get();
+ #endif
+ ])
+fi
+# Link-time dependency from coroutine to context, existed only in 1.53, in 1.54
+# coroutine doesn't use context from its headers but from its library.
+if test $boost_major_version -eq 153 || test $enable_static_boost = yes && test $boost_major_version -ge 154; then
+ BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_CONTEXT_LIBS"
+ BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_CONTEXT_LDFLAGS"
+fi
+if test $enable_static_boost = yes && test $boost_major_version -ge 155; then
+ BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_SYSTEM_LIBS"
+ BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+fi
+LIBS=$boost_coroutine_save_LIBS
+LDFLAGS=$boost_coroutine_save_LDFLAGS
+])# BOOST_COROUTINE
+
+
+# BOOST_CRC()
+# -----------
+# Look for Boost.CRC
+BOOST_DEFUN([CRC],
+[BOOST_FIND_HEADER([boost/crc.hpp])
+])# BOOST_CRC
+
+
+# BOOST_DATE_TIME([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Date_Time. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Date_Time],
+[BOOST_FIND_LIB([date_time], [$1],
+ [boost/date_time/posix_time/posix_time.hpp],
+ [boost::posix_time::ptime t;])
+])# BOOST_DATE_TIME
+
+
+# BOOST_FILESYSTEM([PREFERRED-RT-OPT])
+# ------------------------------------
+# Look for Boost.Filesystem. For the documentation of PREFERRED-RT-OPT, see
+# the documentation of BOOST_FIND_LIB above.
+# Do not check for boost/filesystem.hpp because this file was introduced in
+# 1.34.
+BOOST_DEFUN([Filesystem],
+[# Do we have to check for Boost.System? This link-time dependency was
+# added as of 1.35.0. If we have a version <1.35, we must not attempt to
+# find Boost.System as it didn't exist by then.
+if test $boost_major_version -ge 135; then
+ BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+boost_filesystem_save_LIBS=$LIBS
+boost_filesystem_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([filesystem], [$1],
+ [boost/filesystem/path.hpp], [boost::filesystem::path p;])
+if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
+ BOOST_FILESYSTEM_LIBS="$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"
+fi
+LIBS=$boost_filesystem_save_LIBS
+LDFLAGS=$boost_filesystem_save_LDFLAGS
+])# BOOST_FILESYSTEM
+
+
+# BOOST_FLYWEIGHT()
+# -----------------
+# Look for Boost.Flyweight.
+BOOST_DEFUN([Flyweight],
+[dnl There's a hidden dependency on pthreads.
+AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
+BOOST_FIND_HEADER([boost/flyweight.hpp])
+AC_SUBST([BOOST_FLYWEIGHT_LIBS], [$boost_cv_pthread_flag])
+])
+
+
+# BOOST_FOREACH()
+# ---------------
+# Look for Boost.Foreach.
+BOOST_DEFUN([Foreach],
+[BOOST_FIND_HEADER([boost/foreach.hpp])])
+
+
+# BOOST_FORMAT()
+# --------------
+# Look for Boost.Format.
+# Note: we can't check for boost/format/format_fwd.hpp because the header isn't
+# standalone. It can't be compiled because it triggers the following error:
+# boost/format/detail/config_macros.hpp:88: error: 'locale' in namespace 'std'
+# does not name a type
+BOOST_DEFUN([Format],
+[BOOST_FIND_HEADER([boost/format.hpp])])
+
+
+# BOOST_FUNCTION()
+# ----------------
+# Look for Boost.Function
+BOOST_DEFUN([Function],
+[BOOST_FIND_HEADER([boost/function.hpp])])
+
+
+# BOOST_GEOMETRY()
+# ----------------
+# Look for Boost.Geometry (new since 1.47.0).
+BOOST_DEFUN([Geometry],
+[BOOST_FIND_HEADER([boost/geometry.hpp])
+])# BOOST_GEOMETRY
+
+
+# BOOST_GRAPH([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost.Graphs. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Graph],
+[boost_graph_save_LIBS=$LIBS
+boost_graph_save_LDFLAGS=$LDFLAGS
+# Link-time dependency from graph to regex was added as of 1.40.0.
+if test $boost_major_version -ge 140; then
+ BOOST_REGEX([$1])
+ m4_pattern_allow([^BOOST_REGEX_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_REGEX_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_REGEX_LDFLAGS"
+fi
+BOOST_FIND_LIB([graph], [$1],
+ [boost/graph/adjacency_list.hpp], [boost::adjacency_list<> g;])
+LIBS=$boost_graph_save_LIBS
+LDFLAGS=$boost_graph_save_LDFLAGS
+])# BOOST_GRAPH
+
+
+# BOOST_IOSTREAMS([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.IOStreams. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([IOStreams],
+[BOOST_FIND_LIB([iostreams], [$1],
+ [boost/iostreams/device/file_descriptor.hpp],
+ [boost::iostreams::file_descriptor fd; fd.close();])
+])# BOOST_IOSTREAMS
+
+
+# BOOST_HASH()
+# ------------
+# Look for Boost.Functional/Hash
+BOOST_DEFUN([Hash],
+[BOOST_FIND_HEADER([boost/functional/hash.hpp])])
+
+
+# BOOST_LAMBDA()
+# --------------
+# Look for Boost.Lambda
+BOOST_DEFUN([Lambda],
+[BOOST_FIND_HEADER([boost/lambda/lambda.hpp])])
+
+
+# BOOST_LOCALE()
+# --------------
+# Look for Boost.Locale
+BOOST_DEFUN([Locale],
+[
+boost_locale_save_LIBS=$LIBS
+boost_locale_save_LDFLAGS=$LDFLAGS
+# require SYSTEM for boost-1.50.0 and up
+if test $boost_major_version -ge 150; then
+ BOOST_SYSTEM([$1])
+ m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+fi # end of the Boost.System check.
+BOOST_FIND_LIB([locale], [$1],
+ [boost/locale.hpp],
+ [[boost::locale::generator gen; std::locale::global(gen(""));]])
+LIBS=$boost_locale_save_LIBS
+LDFLAGS=$boost_locale_save_LDFLAGS
+])# BOOST_LOCALE
+
+# BOOST_LOG([PREFERRED-RT-OPT])
+# -----------------------------
+# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Log],
+[boost_log_save_LIBS=$LIBS
+boost_log_save_LDFLAGS=$LDFLAGS
+BOOST_SYSTEM([$1])
+BOOST_FILESYSTEM([$1])
+BOOST_DATE_TIME([$1])
+m4_pattern_allow([^BOOST_(SYSTEM|FILESYSTEM|DATE_TIME)_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_DATE_TIME_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_DATE_TIME_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([log], [$1],
+ [boost/log/core/core.hpp],
+ [boost::log::attribute a; a.get_value();])
+LIBS=$boost_log_save_LIBS
+LDFLAGS=$boost_log_save_LDFLAGS
+])# BOOST_LOG
+
+
+# BOOST_LOG_SETUP([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Log_Setup],
+[boost_log_setup_save_LIBS=$LIBS
+boost_log_setup_save_LDFLAGS=$LDFLAGS
+BOOST_LOG([$1])
+m4_pattern_allow([^BOOST_LOG_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_LOG_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_LOG_LDFLAGS"
+BOOST_FIND_LIB([log_setup], [$1],
+ [boost/log/utility/setup/from_settings.hpp],
+ [boost::log::basic_settings<char> bs; bs.empty();])
+LIBS=$boost_log_setup_save_LIBS
+LDFLAGS=$boost_log_setup_save_LDFLAGS
+])# BOOST_LOG_SETUP
+
+
+# BOOST_MATH()
+# ------------
+# Look for Boost.Math
+# TODO: This library isn't header-only but it comes in multiple different
+# flavors that don't play well with BOOST_FIND_LIB (e.g, libboost_math_c99,
+# libboost_math_c99f, libboost_math_c99l, libboost_math_tr1,
+# libboost_math_tr1f, libboost_math_tr1l). This macro must be fixed to do the
+# right thing anyway.
+BOOST_DEFUN([Math],
+[BOOST_FIND_HEADER([boost/math/special_functions.hpp])])
+
+
+# BOOST_MPI([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost MPI. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. Uses MPICXX variable if it is
+# set, otherwise tries CXX
+#
+BOOST_DEFUN([MPI],
+[boost_save_CXX=${CXX}
+boost_save_CXXCPP=${CXXCPP}
+if test x"${MPICXX}" != x; then
+ CXX=${MPICXX}
+ CXXCPP="${MPICXX} -E"
+fi
+BOOST_FIND_LIB([mpi], [$1],
+ [boost/mpi.hpp],
+ [int argc = 0;
+ char **argv = 0;
+ boost::mpi::environment env(argc,argv);])
+CXX=${boost_save_CXX}
+CXXCPP=${boost_save_CXXCPP}
+])# BOOST_MPI
+
+
+# BOOST_MULTIARRAY()
+# ------------------
+# Look for Boost.MultiArray
+BOOST_DEFUN([MultiArray],
+[BOOST_FIND_HEADER([boost/multi_array.hpp])])
+
+
+# BOOST_NUMERIC_UBLAS()
+# --------------------------
+# Look for Boost.NumericUblas (Basic Linear Algebra)
+BOOST_DEFUN([Numeric_Ublas],
+[BOOST_FIND_HEADER([boost/numeric/ublas/vector.hpp])
+])# BOOST_NUMERIC_UBLAS
+
+
+# BOOST_NUMERIC_CONVERSION()
+# --------------------------
+# Look for Boost.NumericConversion (policy-based numeric conversion)
+BOOST_DEFUN([Numeric_Conversion],
+[BOOST_FIND_HEADER([boost/numeric/conversion/converter.hpp])
+])# BOOST_NUMERIC_CONVERSION
+
+
+# BOOST_OPTIONAL()
+# ----------------
+# Look for Boost.Optional
+BOOST_DEFUN([Optional],
+[BOOST_FIND_HEADER([boost/optional.hpp])])
+
+
+# BOOST_PREPROCESSOR()
+# --------------------
+# Look for Boost.Preprocessor
+BOOST_DEFUN([Preprocessor],
+[BOOST_FIND_HEADER([boost/preprocessor/repeat.hpp])])
+
+
+# BOOST_RANGE()
+# --------------------
+# Look for Boost.Range
+BOOST_DEFUN([Range],
+[BOOST_FIND_HEADER([boost/range/adaptors.hpp])])
+
+# BOOST_UNORDERED()
+# -----------------
+# Look for Boost.Unordered
+BOOST_DEFUN([Unordered],
+[BOOST_FIND_HEADER([boost/unordered_map.hpp])])
+
+
+# BOOST_UUID()
+# ------------
+# Look for Boost.Uuid
+BOOST_DEFUN([Uuid],
+[BOOST_FIND_HEADER([boost/uuid/uuid.hpp])])
+
+
+# BOOST_PROGRAM_OPTIONS([PREFERRED-RT-OPT])
+# -----------------------------------------
+# Look for Boost.Program_options. For the documentation of PREFERRED-RT-OPT,
+# see the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Program_Options],
+[BOOST_FIND_LIB([program_options], [$1],
+ [boost/program_options.hpp],
+ [boost::program_options::options_description d("test");])
+])# BOOST_PROGRAM_OPTIONS
+
+
+
+# _BOOST_PYTHON_CONFIG(VARIABLE, FLAG)
+# ------------------------------------
+# Save VARIABLE, and define it via `python-config --FLAG`.
+# Substitute BOOST_PYTHON_VARIABLE.
+m4_define([_BOOST_PYTHON_CONFIG],
+[AC_SUBST([BOOST_PYTHON_$1],
+ [`python-config --$2 2>/dev/null`])dnl
+boost_python_save_$1=$$1
+$1="$$1 $BOOST_PYTHON_$1"])
+
+
+# BOOST_PYTHON([PREFERRED-RT-OPT])
+# --------------------------------
+# Look for Boost.Python. For the documentation of PREFERRED-RT-OPT,
+# see the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Python],
+[_BOOST_PYTHON_CONFIG([CPPFLAGS], [includes])
+_BOOST_PYTHON_CONFIG([LDFLAGS], [ldflags])
+_BOOST_PYTHON_CONFIG([LIBS], [libs])
+m4_pattern_allow([^BOOST_PYTHON_MODULE$])dnl
+BOOST_FIND_LIBS([python], [python python3], [$1],
+ [boost/python.hpp],
+ [], [BOOST_PYTHON_MODULE(empty) {}])
+CPPFLAGS=$boost_python_save_CPPFLAGS
+LDFLAGS=$boost_python_save_LDFLAGS
+LIBS=$boost_python_save_LIBS
+])# BOOST_PYTHON
+
+
+# BOOST_REF()
+# -----------
+# Look for Boost.Ref
+BOOST_DEFUN([Ref],
+[BOOST_FIND_HEADER([boost/ref.hpp])])
+
+
+# BOOST_REGEX([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost.Regex. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Regex],
+[BOOST_FIND_LIB([regex], [$1],
+ [boost/regex.hpp],
+ [boost::regex exp("*"); boost::regex_match("foo", exp);])
+])# BOOST_REGEX
+
+
+# BOOST_SERIALIZATION([PREFERRED-RT-OPT])
+# ---------------------------------------
+# Look for Boost.Serialization. For the documentation of PREFERRED-RT-OPT, see
+# the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Serialization],
+[BOOST_FIND_LIB([serialization], [$1],
+ [boost/archive/text_oarchive.hpp],
+ [std::ostream* o = 0; // Cheap way to get an ostream...
+ boost::archive::text_oarchive t(*o);])
+])# BOOST_SERIALIZATION
+
+
+# BOOST_SIGNALS([PREFERRED-RT-OPT])
+# ---------------------------------
+# Look for Boost.Signals. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Signals],
+[BOOST_FIND_LIB([signals], [$1],
+ [boost/signal.hpp],
+ [boost::signal<void ()> s;])
+])# BOOST_SIGNALS
+
+
+# BOOST_SIGNALS2()
+# ----------------
+# Look for Boost.Signals2 (new since 1.39.0).
+BOOST_DEFUN([Signals2],
+[BOOST_FIND_HEADER([boost/signals2.hpp])
+])# BOOST_SIGNALS2
+
+
+# BOOST_SMART_PTR()
+# -----------------
+# Look for Boost.SmartPtr
+BOOST_DEFUN([Smart_Ptr],
+[BOOST_FIND_HEADER([boost/scoped_ptr.hpp])
+BOOST_FIND_HEADER([boost/shared_ptr.hpp])
+])
+
+
+# BOOST_STATICASSERT()
+# --------------------
+# Look for Boost.StaticAssert
+BOOST_DEFUN([StaticAssert],
+[BOOST_FIND_HEADER([boost/static_assert.hpp])])
+
+
+# BOOST_STRING_ALGO()
+# -------------------
+# Look for Boost.StringAlgo
+BOOST_DEFUN([String_Algo],
+[BOOST_FIND_HEADER([boost/algorithm/string.hpp])
+])
+
+
+# BOOST_SYSTEM([PREFERRED-RT-OPT])
+# --------------------------------
+# Look for Boost.System. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. This library was introduced in Boost
+# 1.35.0.
+BOOST_DEFUN([System],
+[BOOST_FIND_LIB([system], [$1],
+ [boost/system/error_code.hpp],
+ [boost::system::error_code e; e.clear();])
+])# BOOST_SYSTEM
+
+
+# BOOST_TEST([PREFERRED-RT-OPT])
+# ------------------------------
+# Look for Boost.Test. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Test],
+[m4_pattern_allow([^BOOST_CHECK$])dnl
+BOOST_FIND_LIB([unit_test_framework], [$1],
+ [boost/test/unit_test.hpp], [BOOST_CHECK(2 == 2);],
+ [using boost::unit_test::test_suite;
+ test_suite* init_unit_test_suite(int argc, char ** argv)
+ { return NULL; }])
+])# BOOST_TEST
+
+
+# BOOST_THREAD([PREFERRED-RT-OPT])
+# ---------------------------------
+# Look for Boost.Thread. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Thread],
+[dnl Having the pthread flag is required at least on GCC3 where
+dnl boost/thread.hpp would complain if we try to compile without
+dnl -pthread on GNU/Linux.
+AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
+boost_thread_save_LIBS=$LIBS
+boost_thread_save_LDFLAGS=$LDFLAGS
+boost_thread_save_CPPFLAGS=$CPPFLAGS
+# Link-time dependency from thread to system was added as of 1.49.0.
+if test $boost_major_version -ge 149; then
+BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+CPPFLAGS="$CPPFLAGS $boost_cv_pthread_flag"
+
+# When compiling for the Windows platform, the threads library is named
+# differently. This suffix doesn't exist in new versions of Boost, or
+# possibly new versions of GCC on mingw I am assuming it's Boost's change for
+# now and I am setting version to 1.48, for lack of knowledge as to when this
+# change occurred.
+if test $boost_major_version -lt 148; then
+ case $host_os in
+ (*mingw*) boost_thread_lib_ext=_win32;;
+ esac
+fi
+BOOST_FIND_LIBS([thread], [thread$boost_thread_lib_ext],
+ [$1],
+ [boost/thread.hpp], [boost::thread t; boost::mutex m;])
+
+case $host_os in
+ (*mingw*) boost_thread_w32_socket_link=-lws2_32;;
+esac
+
+BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag $boost_thread_w32_socket_link"
+BOOST_THREAD_LDFLAGS="$BOOST_SYSTEM_LDFLAGS"
+BOOST_CPPFLAGS="$BOOST_CPPFLAGS $boost_cv_pthread_flag"
+LIBS=$boost_thread_save_LIBS
+LDFLAGS=$boost_thread_save_LDFLAGS
+CPPFLAGS=$boost_thread_save_CPPFLAGS
+])# BOOST_THREAD
+
+AU_ALIAS([BOOST_THREADS], [BOOST_THREAD])
+
+
+# BOOST_TOKENIZER()
+# -----------------
+# Look for Boost.Tokenizer
+BOOST_DEFUN([Tokenizer],
+[BOOST_FIND_HEADER([boost/tokenizer.hpp])])
+
+
+# BOOST_TRIBOOL()
+# ---------------
+# Look for Boost.Tribool
+BOOST_DEFUN([Tribool],
+[BOOST_FIND_HEADER([boost/logic/tribool_fwd.hpp])
+BOOST_FIND_HEADER([boost/logic/tribool.hpp])
+])
+
+
+# BOOST_TUPLE()
+# -------------
+# Look for Boost.Tuple
+BOOST_DEFUN([Tuple],
+[BOOST_FIND_HEADER([boost/tuple/tuple.hpp])])
+
+
+# BOOST_TYPETRAITS()
+# --------------------
+# Look for Boost.TypeTraits
+BOOST_DEFUN([TypeTraits],
+[BOOST_FIND_HEADER([boost/type_traits.hpp])])
+
+
+# BOOST_UTILITY()
+# ---------------
+# Look for Boost.Utility (noncopyable, result_of, base-from-member idiom,
+# etc.)
+BOOST_DEFUN([Utility],
+[BOOST_FIND_HEADER([boost/utility.hpp])])
+
+
+# BOOST_VARIANT()
+# ---------------
+# Look for Boost.Variant.
+BOOST_DEFUN([Variant],
+[BOOST_FIND_HEADER([boost/variant/variant_fwd.hpp])
+BOOST_FIND_HEADER([boost/variant.hpp])])
+
+
+# BOOST_POINTER_CONTAINER()
+# ------------------------
+# Look for Boost.PointerContainer
+BOOST_DEFUN([Pointer_Container],
+[BOOST_FIND_HEADER([boost/ptr_container/ptr_deque.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_list.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_vector.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_array.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_set.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_map.hpp])
+])# BOOST_POINTER_CONTAINER
+
+
+# BOOST_WAVE([PREFERRED-RT-OPT])
+# ------------------------------
+# NOTE: If you intend to use Wave/Spirit with thread support, make sure you
+# call BOOST_THREAD first.
+# Look for Boost.Wave. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Wave],
+[AC_REQUIRE([BOOST_FILESYSTEM])dnl
+AC_REQUIRE([BOOST_DATE_TIME])dnl
+boost_wave_save_LIBS=$LIBS
+boost_wave_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_((FILE)?SYSTEM|DATE_TIME|THREAD)_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS \
+$BOOST_THREAD_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS \
+$BOOST_DATE_TIME_LDFLAGS $BOOST_THREAD_LDFLAGS"
+BOOST_FIND_LIB([wave], [$1],
+ [boost/wave.hpp],
+ [boost::wave::token_id id; get_token_name(id);])
+LIBS=$boost_wave_save_LIBS
+LDFLAGS=$boost_wave_save_LDFLAGS
+])# BOOST_WAVE
+
+
+# BOOST_XPRESSIVE()
+# -----------------
+# Look for Boost.Xpressive (new since 1.36.0).
+BOOST_DEFUN([Xpressive],
+[BOOST_FIND_HEADER([boost/xpressive/xpressive.hpp])])
+
+
+# ----------------- #
+# Internal helpers. #
+# ----------------- #
+
+
+# _BOOST_PTHREAD_FLAG()
+# ---------------------
+# Internal helper for BOOST_THREAD. Computes boost_cv_pthread_flag
+# which must be used in CPPFLAGS and LIBS.
+#
+# Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3,
+# boost/thread.hpp will trigger a #error if -pthread isn't used:
+# boost/config/requires_threads.hpp:47:5: #error "Compiler threading support
+# is not turned on. Please set the correct command line options for
+# threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
+#
+# Based on ACX_PTHREAD: http://autoconf-archive.cryp.to/acx_pthread.html
+AC_DEFUN([_BOOST_PTHREAD_FLAG],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_LANG_PUSH([C++])dnl
+AC_CACHE_CHECK([for the flags needed to use pthreads], [boost_cv_pthread_flag],
+[ boost_cv_pthread_flag=
+ # The ordering *is* (sometimes) important. Some notes on the
+ # individual items follow:
+ # (none): in case threads are in libc; should be tried before -Kthread and
+ # other compiler flags to prevent continual compiler warnings
+ # -lpthreads: AIX (must check this before -lpthread)
+ # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+ # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+ # -llthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+ # -pthread: GNU Linux/GCC (kernel threads), BSD/GCC (userland threads)
+ # -pthreads: Solaris/GCC
+ # -mthreads: MinGW32/GCC, Lynx/GCC
+ # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+ # doesn't hurt to check since this sometimes defines pthreads too;
+ # also defines -D_REENTRANT)
+ # ... -mt is also the pthreads flag for HP/aCC
+ # -lpthread: GNU Linux, etc.
+ # --thread-safe: KAI C++
+ case $host_os in #(
+ *solaris*)
+ # On Solaris (at least, for some versions), libc contains stubbed
+ # (non-functional) versions of the pthreads routines, so link-based
+ # tests will erroneously succeed. (We need to link with -pthreads/-mt/
+ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
+ # a function called by this macro, so we could check for that, but
+ # who knows whether they'll stub that too in a future libc.) So,
+ # we'll just look for -pthreads and -lpthread first:
+ boost_pthread_flags="-pthreads -lpthread -mt -pthread";; #(
+ *)
+ boost_pthread_flags="-lpthreads -Kthread -kthread -llthread -pthread \
+ -pthreads -mthreads -lpthread --thread-safe -mt";;
+ esac
+ # Generate the test file.
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <pthread.h>],
+ [pthread_t th; pthread_join(th, 0);
+ pthread_attr_init(0); pthread_cleanup_push(0, 0);
+ pthread_create(0,0,0,0); pthread_cleanup_pop(0);])])
+ for boost_pthread_flag in '' $boost_pthread_flags; do
+ boost_pthread_ok=false
+dnl Re-use the test file already generated.
+ boost_pthreads__save_LIBS=$LIBS
+ LIBS="$LIBS $boost_pthread_flag"
+ AC_LINK_IFELSE([],
+ [if grep ".*$boost_pthread_flag" conftest.err; then
+ echo "This flag seems to have triggered warnings" >&AS_MESSAGE_LOG_FD
+ else
+ boost_pthread_ok=:; boost_cv_pthread_flag=$boost_pthread_flag
+ fi])
+ LIBS=$boost_pthreads__save_LIBS
+ $boost_pthread_ok && break
+ done
+])
+AC_LANG_POP([C++])dnl
+])# _BOOST_PTHREAD_FLAG
+
+
+# _BOOST_gcc_test(MAJOR, MINOR)
+# -----------------------------
+# Internal helper for _BOOST_FIND_COMPILER_TAG.
+m4_define([_BOOST_gcc_test],
+["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC @ gcc$1$2"])dnl
+
+# _BOOST_mingw_test(MAJOR, MINOR)
+# -----------------------------
+# Internal helper for _BOOST_FIND_COMPILER_TAG.
+m4_define([_BOOST_mingw_test],
+["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw$1$2"])dnl
+
+
+# _BOOST_FIND_COMPILER_TAG()
+# --------------------------
+# Internal. When Boost is installed without --layout=system, each library
+# filename will hold a suffix that encodes the compiler used during the
+# build. The Boost build system seems to call this a `tag'.
+AC_DEFUN([_BOOST_FIND_COMPILER_TAG],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_CACHE_CHECK([for the toolset name used by Boost for $CXX],
+ [boost_cv_lib_tag],
+[boost_cv_lib_tag=unknown
+if test x$boost_cv_inc_path != xno; then
+ AC_LANG_PUSH([C++])dnl
+ # The following tests are mostly inspired by boost/config/auto_link.hpp
+ # The list is sorted to most recent/common to oldest compiler (in order
+ # to increase the likelihood of finding the right compiler with the
+ # least number of compilation attempt).
+ # Beware that some tests are sensible to the order (for instance, we must
+ # look for MinGW before looking for GCC3).
+ # I used one compilation test per compiler with a #error to recognize
+ # each compiler so that it works even when cross-compiling (let me know
+ # if you know a better approach).
+ # Known missing tags (known from Boost's tools/build/v2/tools/common.jam):
+ # como, edg, kcc, bck, mp, sw, tru, xlc
+ # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines
+ # the same defines as GCC's).
+ for i in \
+ _BOOST_mingw_test(5, 3) \
+ _BOOST_gcc_test(5, 3) \
+ _BOOST_mingw_test(5, 2) \
+ _BOOST_gcc_test(5, 2) \
+ _BOOST_mingw_test(5, 1) \
+ _BOOST_gcc_test(5, 1) \
+ _BOOST_mingw_test(5, 0) \
+ _BOOST_gcc_test(5, 0) \
+ _BOOST_mingw_test(4, 10) \
+ _BOOST_gcc_test(4, 10) \
+ _BOOST_mingw_test(4, 9) \
+ _BOOST_gcc_test(4, 9) \
+ _BOOST_mingw_test(4, 8) \
+ _BOOST_gcc_test(4, 8) \
+ _BOOST_mingw_test(4, 7) \
+ _BOOST_gcc_test(4, 7) \
+ _BOOST_mingw_test(4, 6) \
+ _BOOST_gcc_test(4, 6) \
+ _BOOST_mingw_test(4, 5) \
+ _BOOST_gcc_test(4, 5) \
+ _BOOST_mingw_test(4, 4) \
+ _BOOST_gcc_test(4, 4) \
+ _BOOST_mingw_test(4, 3) \
+ _BOOST_gcc_test(4, 3) \
+ _BOOST_mingw_test(4, 2) \
+ _BOOST_gcc_test(4, 2) \
+ _BOOST_mingw_test(4, 1) \
+ _BOOST_gcc_test(4, 1) \
+ _BOOST_mingw_test(4, 0) \
+ _BOOST_gcc_test(4, 0) \
+ "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \
+ && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw" \
+ _BOOST_gcc_test(3, 4) \
+ _BOOST_gcc_test(3, 3) \
+ "defined _MSC_VER && _MSC_VER >= 1500 @ vc90" \
+ "defined _MSC_VER && _MSC_VER == 1400 @ vc80" \
+ _BOOST_gcc_test(3, 2) \
+ "defined _MSC_VER && _MSC_VER == 1310 @ vc71" \
+ _BOOST_gcc_test(3, 1) \
+ _BOOST_gcc_test(3, 0) \
+ "defined __BORLANDC__ @ bcb" \
+ "defined __ICC && (defined __unix || defined __unix__) @ il" \
+ "defined __ICL @ iw" \
+ "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \
+ _BOOST_gcc_test(2, 95) \
+ "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \
+ "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \
+ "defined _MSC_VER && _MSC_VER < 1300 && defined UNDER_CE @ evc4" \
+ "defined __MWERKS__ && __MWERKS__ <= 0x31FF @ cw8"
+ do
+ boost_tag_test=`expr "X$i" : 'X\([[^@]]*\) @ '`
+ boost_tag=`expr "X$i" : 'X[[^@]]* @ \(.*\)'`
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if $boost_tag_test
+/* OK */
+#else
+# error $boost_tag_test
+#endif
+]])], [boost_cv_lib_tag=$boost_tag; break], [])
+ done
+AC_LANG_POP([C++])dnl
+ case $boost_cv_lib_tag in #(
+ # Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed
+ # to "gcc41" for instance.
+ *-gcc | *'-gcc ') :;; #( Don't re-add -gcc: it's already in there.
+ gcc*)
+ boost_tag_x=
+ case $host_os in #(
+ darwin*)
+ if test $boost_major_version -ge 136; then
+ # The `x' added in r46793 of Boost.
+ boost_tag_x=x
+ fi;;
+ esac
+ # We can specify multiple tags in this variable because it's used by
+ # BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ...
+ boost_cv_lib_tag="$boost_tag_x$boost_cv_lib_tag -${boost_tag_x}gcc"
+ ;; #(
+ unknown)
+ AC_MSG_WARN([[could not figure out which toolset name to use for $CXX]])
+ boost_cv_lib_tag=
+ ;;
+ esac
+fi])dnl end of AC_CACHE_CHECK
+])# _BOOST_FIND_COMPILER_TAG
+
+
+# _BOOST_GUESS_WHETHER_TO_USE_MT()
+# --------------------------------
+# Compile a small test to try to guess whether we should favor MT (Multi
+# Thread) flavors of Boost. Sets boost_guess_use_mt accordingly.
+AC_DEFUN([_BOOST_GUESS_WHETHER_TO_USE_MT],
+[# Check whether we do better use `mt' even though we weren't ask to.
+AC_LANG_PUSH([C++])dnl
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if defined _REENTRANT || defined _MT || defined __MT__
+/* use -mt */
+#else
+# error MT not needed
+#endif
+]])], [boost_guess_use_mt=:], [boost_guess_use_mt=false])
+AC_LANG_POP([C++])dnl
+])
+
+# _BOOST_AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+# -------------------------------------------------------------------
+# Fork of _AC_LINK_IFELSE that preserves conftest.o across calls. Fragile,
+# will break when Autoconf changes its internals. Requires that you manually
+# rm -f conftest.$ac_objext in between to really different tests, otherwise
+# you will try to link a conftest.o left behind by a previous test.
+# Used to aggressively optimize BOOST_FIND_LIB (see the big comment in this
+# macro).
+#
+# Don't use "break" in the actions, as it would short-circuit some code
+# this macro runs after the actions.
+m4_define([_BOOST_AC_LINK_IFELSE],
+[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
+rm -f conftest$ac_exeext
+boost_save_ac_ext=$ac_ext
+boost_use_source=:
+# If we already have a .o, re-use it. We change $ac_ext so that $ac_link
+# tries to link the existing object file instead of compiling from source.
+test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false &&
+ _AS_ECHO_LOG([re-using the existing conftest.$ac_objext])
+AS_IF([_AC_DO_STDERR($ac_link) && {
+ test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_executable_p conftest$ac_exeext
+dnl FIXME: use AS_TEST_X instead when 2.61 is widespread enough.
+ }],
+ [$2],
+ [if $boost_use_source; then
+ _AC_MSG_LOG_CONFTEST
+ fi
+ $3])
+ac_objext=$boost_save_ac_objext
+ac_ext=$boost_save_ac_ext
+dnl Delete also the IPA/IPO (Inter Procedural Analysis/Optimization)
+dnl information created by the PGI compiler (conftest_ipa8_conftest.oo),
+dnl as it would interfere with the next link command.
+rm -f core conftest.err conftest_ipa8_conftest.oo \
+ conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl
+])# _BOOST_AC_LINK_IFELSE
+
+# Local Variables:
+# mode: autoconf
+# End:
diff --git a/org.eclipse.efm.symbex/cmake/cvc4-patch/config/boost.m4 b/org.eclipse.efm.symbex/cmake/cvc4-patch/config/boost.m4
new file mode 100644
index 0000000..084cfd2
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/cvc4-patch/config/boost.m4
@@ -0,0 +1,1565 @@
+# boost.m4: Locate Boost headers and libraries for autoconf-based projects.
+# Copyright (C) 2007-2011, 2014 Benoit Sigoure <tsuna@lrde.epita.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Additional permission under section 7 of the GNU General Public
+# License, version 3 ("GPLv3"):
+#
+# If you convey this file as part of a work that contains a
+# configuration script generated by Autoconf, you may do so under
+# terms of your choice.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+m4_define([_BOOST_SERIAL], [m4_translit([
+# serial 25
+], [#
+], [])])
+
+# Original sources can be found at http://github.com/tsuna/boost.m4
+# You can fetch the latest version of the script by doing:
+# wget http://github.com/tsuna/boost.m4/raw/master/build-aux/boost.m4
+
+# ------ #
+# README #
+# ------ #
+
+# This file provides several macros to use the various Boost libraries.
+# The first macro is BOOST_REQUIRE. It will simply check if it's possible to
+# find the Boost headers of a given (optional) minimum version and it will
+# define BOOST_CPPFLAGS accordingly. It will add an option --with-boost to
+# your configure so that users can specify non standard locations.
+# If the user's environment contains BOOST_ROOT and --with-boost was not
+# specified, --with-boost=$BOOST_ROOT is implicitly used.
+# For more README and documentation, go to http://github.com/tsuna/boost.m4
+# Note: THESE MACROS ASSUME THAT YOU USE LIBTOOL. If you don't, don't worry,
+# simply read the README, it will show you what to do step by step.
+
+m4_pattern_forbid([^_?(BOOST|Boost)_])
+
+
+# _BOOST_SED_CPP(SED-PROGRAM, PROGRAM,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# --------------------------------------------------------
+# Same as AC_EGREP_CPP, but leave the result in conftest.i.
+#
+# SED-PROGRAM is *not* overquoted, as in AC_EGREP_CPP. It is expanded
+# in double-quotes, so escape your double quotes.
+#
+# It could be useful to turn this into a macro which extracts the
+# value of any macro.
+m4_define([_BOOST_SED_CPP],
+[AC_LANG_PUSH([C++])dnl
+AC_LANG_PREPROC_REQUIRE()dnl
+AC_REQUIRE([AC_PROG_SED])dnl
+AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])])
+AS_IF([dnl eval is necessary to expand ac_cpp.
+dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
+dnl Beware of Windows end-of-lines, for instance if we are running
+dnl some Windows programs under Wine. In that case, boost/version.hpp
+dnl is certainly using "\r\n", but the regular Unix shell will only
+dnl strip `\n' with backquotes, not the `\r'. This results in
+dnl boost_cv_lib_version='1_37\r' for instance, which breaks
+dnl everything else.
+dnl Cannot use 'dnl' after [$4] because a trailing dnl may break AC_CACHE_CHECK
+dnl
+dnl Beware that GCC 5, when expanding macros, may embed # line directives
+dnl a within single line:
+dnl
+dnl # 1 "conftest.cc"
+dnl # 1 "<built-in>"
+dnl # 1 "<command-line>"
+dnl # 1 "conftest.cc"
+dnl # 1 "/opt/local/include/boost/version.hpp" 1 3
+dnl # 2 "conftest.cc" 2
+dnl boost-lib-version =
+dnl # 2 "conftest.cc" 3
+dnl "1_56"
+dnl
+dnl So get rid of the # lines, and glue the remaining ones together.
+(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+ grep -v '#' |
+ tr -d '\r' |
+ tr -s '\n' ' ' |
+ $SED -n -e "$1" >conftest.i 2>&1],
+ [$3],
+ [$4])
+rm -rf conftest*
+AC_LANG_POP([C++])dnl
+])# _BOOST_SED_CPP
+
+
+
+# BOOST_REQUIRE([VERSION], [ACTION-IF-NOT-FOUND])
+# -----------------------------------------------
+# Look for Boost. If version is given, it must either be a literal of the form
+# "X.Y.Z" where X, Y and Z are integers (the ".Z" part being optional) or a
+# variable "$var".
+# Defines the value BOOST_CPPFLAGS. This macro only checks for headers with
+# the required version, it does not check for any of the Boost libraries.
+# On # success, defines HAVE_BOOST. On failure, calls the optional
+# ACTION-IF-NOT-FOUND action if one was supplied.
+# Otherwise aborts with an error message.
+AC_DEFUN_ONCE([BOOST_REQUIRE],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_PROG_GREP])dnl
+echo "$as_me: this is boost.m4[]_BOOST_SERIAL" >&AS_MESSAGE_LOG_FD
+boost_save_IFS=$IFS
+boost_version_req=$1
+IFS=.
+set x $boost_version_req 0 0 0
+IFS=$boost_save_IFS
+shift
+boost_version_req=`expr "$[1]" '*' 100000 + "$[2]" '*' 100 + "$[3]"`
+boost_version_req_string=$[1].$[2].$[3]
+AC_ARG_WITH([boost],
+ [AS_HELP_STRING([--with-boost=DIR],
+ [prefix of Boost $1 @<:@guess@:>@])])dnl
+AC_ARG_VAR([BOOST_ROOT],[Location of Boost installation])dnl
+# If BOOST_ROOT is set and the user has not provided a value to
+# --with-boost, then treat BOOST_ROOT as if it the user supplied it.
+if test x"$BOOST_ROOT" != x; then
+ if test x"$with_boost" = x; then
+ AC_MSG_NOTICE([Detected BOOST_ROOT; continuing with --with-boost=$BOOST_ROOT])
+ with_boost=$BOOST_ROOT
+ else
+ AC_MSG_NOTICE([Detected BOOST_ROOT=$BOOST_ROOT, but overridden by --with-boost=$with_boost])
+ fi
+fi
+AC_SUBST([DISTCHECK_CONFIGURE_FLAGS],
+ ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"])dnl
+boost_save_CPPFLAGS=$CPPFLAGS
+ AC_CACHE_CHECK([for Boost headers version >= $boost_version_req_string],
+ [boost_cv_inc_path],
+ [boost_cv_inc_path=no
+AC_LANG_PUSH([C++])dnl
+m4_pattern_allow([^BOOST_VERSION$])dnl
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#include <boost/version.hpp>
+#if !defined BOOST_VERSION
+# error BOOST_VERSION is not defined
+#elif BOOST_VERSION < $boost_version_req
+# error Boost headers version < $boost_version_req
+#endif
+]])])
+ # If the user provided a value to --with-boost, use it and only it.
+ case $with_boost in #(
+ ''|yes) set x '' /opt/local/include /usr/local/include /opt/include \
+ /usr/include C:/Boost/include;; #(
+ *) set x "$with_boost/include" "$with_boost";;
+ esac
+ shift
+ for boost_dir
+ do
+ # Without --layout=system, Boost (or at least some versions) installs
+ # itself in <prefix>/include/boost-<version>. This inner loop helps to
+ # find headers in such directories.
+ #
+ # Any ${boost_dir}/boost-x_xx directories are searched in reverse version
+ # order followed by ${boost_dir}. The final '.' is a sentinel for
+ # searching $boost_dir" itself. Entries are whitespace separated.
+ #
+ # I didn't indent this loop on purpose (to avoid over-indented code)
+ boost_layout_system_search_list=`cd "$boost_dir" 2>/dev/null \
+ && ls -1 | "${GREP}" '^boost-' | sort -rn -t- -k2 \
+ && echo .`
+ for boost_inc in $boost_layout_system_search_list
+ do
+ if test x"$boost_inc" != x.; then
+ boost_inc="$boost_dir/$boost_inc"
+ else
+ boost_inc="$boost_dir" # Uses sentinel in boost_layout_system_search_list
+ fi
+ if test x"$boost_inc" != x; then
+ # We are going to check whether the version of Boost installed
+ # in $boost_inc is usable by running a compilation that
+ # #includes it. But if we pass a -I/some/path in which Boost
+ # is not installed, the compiler will just skip this -I and
+ # use other locations (either from CPPFLAGS, or from its list
+ # of system include directories). As a result we would use
+ # header installed on the machine instead of the /some/path
+ # specified by the user. So in that precise case (trying
+ # $boost_inc), make sure the version.hpp exists.
+ #
+ # Use test -e as there can be symlinks.
+ test -e "$boost_inc/boost/version.hpp" || continue
+ CPPFLAGS="$CPPFLAGS -I$boost_inc"
+ fi
+ AC_COMPILE_IFELSE([], [boost_cv_inc_path=yes], [boost_cv_version=no])
+ if test x"$boost_cv_inc_path" = xyes; then
+ if test x"$boost_inc" != x; then
+ boost_cv_inc_path=$boost_inc
+ fi
+ break 2
+ fi
+ done
+ done
+AC_LANG_POP([C++])dnl
+ ])
+ case $boost_cv_inc_path in #(
+ no)
+ boost_errmsg="cannot find Boost headers version >= $boost_version_req_string"
+ m4_if([$2], [], [AC_MSG_ERROR([$boost_errmsg])],
+ [AC_MSG_NOTICE([$boost_errmsg])])
+ $2
+ ;;#(
+ yes)
+ BOOST_CPPFLAGS=
+ ;;#(
+ *)
+ AC_SUBST([BOOST_CPPFLAGS], ["-I$boost_cv_inc_path"])dnl
+ ;;
+ esac
+ if test x"$boost_cv_inc_path" != xno; then
+ AC_DEFINE([HAVE_BOOST], [1],
+ [Defined if the requested minimum BOOST version is satisfied])
+ AC_CACHE_CHECK([for Boost's header version],
+ [boost_cv_lib_version],
+ [m4_pattern_allow([^BOOST_LIB_VERSION$])dnl
+ _BOOST_SED_CPP([[/^boost-lib-version = /{s///;s/[\" ]//g;p;q;}]],
+ [#include <boost/version.hpp>
+boost-lib-version = BOOST_LIB_VERSION],
+ [boost_cv_lib_version=`cat conftest.i`])])
+ # e.g. "134" for 1_34_1 or "135" for 1_35
+
+ #boost_cv_lib_version="161"
+ #boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'`
+ #boost_major_version=`echo "$BOOST_LIB_VERSION" | sed 's/_//;s/_.*//'`
+ boost_major_version="161"
+
+ #case $boost_major_version in #(
+ # '' | *[[!0-9]]*)
+ # AC_MSG_ERROR([invalid value: boost_major_version='$boost_major_version'])
+ # ;;
+ #esac
+fi
+CPPFLAGS=$boost_save_CPPFLAGS
+])# BOOST_REQUIRE
+
+
+# BOOST_STATIC()
+# --------------
+# Add the "--enable-static-boost" configure argument. If this argument is given
+# on the command line, static versions of the libraries will be looked up.
+AC_DEFUN([BOOST_STATIC],
+ [AC_ARG_ENABLE([static-boost],
+ [AS_HELP_STRING([--enable-static-boost],
+ [Prefer the static boost libraries over the shared ones [no]])],
+ [enable_static_boost=yes],
+ [enable_static_boost=no])])# BOOST_STATIC
+
+
+# BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND])
+# --------------------------------------------------------------------------
+# Wrapper around AC_CHECK_HEADER for Boost headers. Useful to check for
+# some parts of the Boost library which are only made of headers and don't
+# require linking (such as Boost.Foreach).
+#
+# Default ACTION-IF-NOT-FOUND: Fail with a fatal error unless Boost couldn't be
+# found in the first place, in which case by default a notice is issued to the
+# user. Presumably if we haven't died already it's because it's OK to not have
+# Boost, which is why only a notice is issued instead of a hard error.
+#
+# Default ACTION-IF-FOUND: define the preprocessor symbol HAVE_<HEADER-NAME> in
+# case of success # (where HEADER-NAME is written LIKE_THIS, e.g.,
+# HAVE_BOOST_FOREACH_HPP).
+AC_DEFUN([BOOST_FIND_HEADER],
+[AC_REQUIRE([BOOST_REQUIRE])dnl
+if test x"$boost_cv_inc_path" = xno; then
+ m4_default([$2], [AC_MSG_NOTICE([Boost not available, not searching for $1])])
+else
+AC_LANG_PUSH([C++])dnl
+boost_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+AC_CHECK_HEADER([$1],
+ [m4_default([$3], [AC_DEFINE(AS_TR_CPP([HAVE_$1]), [1],
+ [Define to 1 if you have <$1>])])],
+ [m4_default([$2], [AC_MSG_ERROR([cannot find $1])])])
+CPPFLAGS=$boost_save_CPPFLAGS
+AC_LANG_POP([C++])dnl
+fi
+])# BOOST_FIND_HEADER
+
+
+# BOOST_FIND_LIBS([COMPONENT-NAME], [CANDIDATE-LIB-NAMES],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Look for the Boost library COMPONENT-NAME (e.g., `thread', for
+# libboost_thread) under the possible CANDIDATE-LIB-NAMES (e.g.,
+# "thread_win32 thread"). Check that HEADER-NAME works and check that
+# libboost_LIB-NAME can link with the code CXX-TEST. The optional
+# argument CXX-PROLOGUE can be used to include some C++ code before
+# the `main' function.
+#
+# Invokes BOOST_FIND_HEADER([HEADER-NAME]) (see above).
+#
+# Boost libraries typically come compiled with several flavors (with different
+# runtime options) so PREFERRED-RT-OPT is the preferred suffix. A suffix is one
+# or more of the following letters: sgdpn (in that order). s = static
+# runtime, d = debug build, g = debug/diagnostic runtime, p = STLPort build,
+# n = (unsure) STLPort build without iostreams from STLPort (it looks like `n'
+# must always be used along with `p'). Additionally, PREFERRED-RT-OPT can
+# start with `mt-' to indicate that there is a preference for multi-thread
+# builds. Some sample values for PREFERRED-RT-OPT: (nothing), mt, d, mt-d, gdp
+# ... If you want to make sure you have a specific version of Boost
+# (eg, >= 1.33) you *must* invoke BOOST_REQUIRE before this macro.
+AC_DEFUN([BOOST_FIND_LIBS],
+[AC_REQUIRE([BOOST_REQUIRE])dnl
+AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl
+AC_REQUIRE([BOOST_STATIC])dnl
+AC_REQUIRE([_BOOST_GUESS_WHETHER_TO_USE_MT])dnl
+if test x"$boost_cv_inc_path" = xno; then
+ AC_MSG_NOTICE([Boost not available, not searching for the Boost $1 library])
+else
+dnl The else branch is huge and wasn't intended on purpose.
+AC_LANG_PUSH([C++])dnl
+AS_VAR_PUSHDEF([Boost_lib], [boost_cv_lib_$1])dnl
+AS_VAR_PUSHDEF([Boost_lib_LDFLAGS], [boost_cv_lib_$1_LDFLAGS])dnl
+AS_VAR_PUSHDEF([Boost_lib_LDPATH], [boost_cv_lib_$1_LDPATH])dnl
+AS_VAR_PUSHDEF([Boost_lib_LIBS], [boost_cv_lib_$1_LIBS])dnl
+BOOST_FIND_HEADER([$4])
+boost_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib],
+ [_BOOST_FIND_LIBS($@)])
+case $Boost_lib in #(
+ (no) _AC_MSG_LOG_CONFTEST
+ AC_MSG_ERROR([cannot find the flags to link with Boost $1])
+ ;;
+esac
+AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS])dnl
+AC_SUBST(AS_TR_CPP([BOOST_$1_LDPATH]), [$Boost_lib_LDPATH])dnl
+AC_SUBST([BOOST_LDPATH], [$Boost_lib_LDPATH])dnl
+AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS])dnl
+CPPFLAGS=$boost_save_CPPFLAGS
+AS_VAR_POPDEF([Boost_lib])dnl
+AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl
+AS_VAR_POPDEF([Boost_lib_LDPATH])dnl
+AS_VAR_POPDEF([Boost_lib_LIBS])dnl
+AC_LANG_POP([C++])dnl
+fi
+])
+
+
+# BOOST_FIND_LIB([LIB-NAME],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Backward compatibility wrapper for BOOST_FIND_LIBS.
+AC_DEFUN([BOOST_FIND_LIB],
+[BOOST_FIND_LIBS([$1], $@)])
+
+
+# _BOOST_FIND_LIBS([LIB-NAME], [CANDIDATE-LIB-NAMES],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Real implementation of BOOST_FIND_LIBS: rely on these local macros:
+# Boost_lib, Boost_lib_LDFLAGS, Boost_lib_LDPATH, Boost_lib_LIBS
+#
+# The algorithm is as follows: first look for a given library name
+# according to the user's PREFERRED-RT-OPT. For each library name, we
+# prefer to use the ones that carry the tag (toolset name). Each
+# library is searched through the various standard paths were Boost is
+# usually installed. If we can't find the standard variants, we try
+# to enforce -mt (for instance on MacOSX, libboost_thread.dylib
+# doesn't exist but there's -obviously- libboost_thread-mt.dylib).
+AC_DEFUN([_BOOST_FIND_LIBS],
+[Boost_lib=no
+ case "$3" in #(
+ (mt | mt-) boost_mt=-mt; boost_rtopt=;; #(
+ (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$3" : 'Xmt-*\(.*\)'`;; #(
+ (*) boost_mt=; boost_rtopt=$3;;
+ esac
+ if test $enable_static_boost = yes; then
+ boost_rtopt="s$boost_rtopt"
+ fi
+ # Find the proper debug variant depending on what we've been asked to find.
+ case $boost_rtopt in #(
+ (*d*) boost_rt_d=$boost_rtopt;; #(
+ (*[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn')
+ boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #(
+ (*) boost_rt_d='-d';;
+ esac
+ # If the PREFERRED-RT-OPT are not empty, prepend a `-'.
+ test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt"
+ $boost_guess_use_mt && boost_mt=-mt
+ # Look for the abs path the static archive.
+ # $libext is computed by Libtool but let's make sure it's non empty.
+ test -z "$libext" &&
+ AC_MSG_ERROR([the libext variable is empty, did you invoke Libtool?])
+ boost_save_ac_objext=$ac_objext
+ # Generate the test file.
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$4>
+$6], [$5])])
+dnl Optimization hacks: compiling C++ is slow, especially with Boost. What
+dnl we're trying to do here is guess the right combination of link flags
+dnl (LIBS / LDFLAGS) to use a given library. This can take several
+dnl iterations before it succeeds and is thus *very* slow. So what we do
+dnl instead is that we compile the code first (and thus get an object file,
+dnl typically conftest.o). Then we try various combinations of link flags
+dnl until we succeed to link conftest.o in an executable. The problem is
+dnl that the various TRY_LINK / COMPILE_IFELSE macros of Autoconf always
+dnl remove all the temporary files including conftest.o. So the trick here
+dnl is to temporarily change the value of ac_objext so that conftest.o is
+dnl preserved accross tests. This is obviously fragile and I will burn in
+dnl hell for not respecting Autoconf's documented interfaces, but in the
+dnl mean time, it optimizes the macro by a factor of 5 to 30.
+dnl Another small optimization: the first argument of AC_COMPILE_IFELSE left
+dnl empty because the test file is generated only once above (before we
+dnl start the for loops).
+ AC_COMPILE_IFELSE([],
+ [ac_objext=do_not_rm_me_plz],
+ [AC_MSG_ERROR([cannot compile a test that uses Boost $1])])
+ ac_objext=$boost_save_ac_objext
+ boost_failed_libs=
+# Don't bother to ident the following nested for loops, only the 2
+# innermost ones matter.
+for boost_lib_ in $2; do
+for boost_tag_ in -$boost_cv_lib_tag ''; do
+for boost_ver_ in -$boost_cv_lib_version ''; do
+for boost_mt_ in $boost_mt -mt ''; do
+for boost_rtopt_ in $boost_rtopt '' -d; do
+ for boost_lib in \
+ boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_ver_
+ do
+ # Avoid testing twice the same lib
+ case $boost_failed_libs in #(
+ (*@$boost_lib@*) continue;;
+ esac
+ # If with_boost is empty, we'll search in /lib first, which is not quite
+ # right so instead we'll try to a location based on where the headers are.
+ boost_tmp_lib=$with_boost
+ test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include}
+ for boost_ldpath in "$boost_tmp_lib/lib" '' \
+ /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \
+ "$with_boost" C:/Boost/lib /lib*
+ do
+ # Don't waste time with directories that don't exist.
+ if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then
+ continue
+ fi
+ boost_save_LDFLAGS=$LDFLAGS
+ # Are we looking for a static library?
+ case $boost_ldpath:$boost_rtopt_ in #(
+ (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt)
+ Boost_lib_LIBS="$boost_ldpath/lib$boost_lib.$libext"
+ test -e "$Boost_lib_LIBS" || continue;; #(
+ (*) # No: use -lboost_foo to find the shared library.
+ Boost_lib_LIBS="-l$boost_lib";;
+ esac
+ boost_save_LIBS=$LIBS
+ LIBS="$Boost_lib_LIBS $LIBS"
+ test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath"
+dnl First argument of AC_LINK_IFELSE left empty because the test file is
+dnl generated only once above (before we start the for loops).
+ _BOOST_AC_LINK_IFELSE([],
+ [Boost_lib=yes], [Boost_lib=no])
+ ac_objext=$boost_save_ac_objext
+ LDFLAGS=$boost_save_LDFLAGS
+ LIBS=$boost_save_LIBS
+ if test x"$Boost_lib" = xyes; then
+ # Check or used cached result of whether or not using -R or
+ # -rpath makes sense. Some implementations of ld, such as for
+ # Mac OSX, require -rpath but -R is the flag known to work on
+ # other systems. https://github.com/tsuna/boost.m4/issues/19
+ AC_CACHE_VAL([boost_cv_rpath_link_ldflag],
+ [case $boost_ldpath in
+ '') # Nothing to do.
+ boost_cv_rpath_link_ldflag=
+ boost_rpath_link_ldflag_found=yes;;
+ *)
+ for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do
+ LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
+ LIBS="$boost_save_LIBS $Boost_lib_LIBS"
+ _BOOST_AC_LINK_IFELSE([],
+ [boost_rpath_link_ldflag_found=yes
+ break],
+ [boost_rpath_link_ldflag_found=no])
+ done
+ ;;
+ esac
+ AS_IF([test "x$boost_rpath_link_ldflag_found" != "xyes"],
+ [AC_MSG_ERROR([Unable to determine whether to use -R or -rpath])])
+ LDFLAGS=$boost_save_LDFLAGS
+ LIBS=$boost_save_LIBS
+ ])
+ test x"$boost_ldpath" != x &&
+ Boost_lib_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
+ Boost_lib_LDPATH="$boost_ldpath"
+ break 7
+ else
+ boost_failed_libs="$boost_failed_libs@$boost_lib@"
+ fi
+ done
+ done
+done
+done
+done
+done
+done # boost_lib_
+rm -f conftest.$ac_objext
+])
+
+
+
+# --------------------------------------- #
+# Checks for the various Boost libraries. #
+# --------------------------------------- #
+
+# List of boost libraries: http://www.boost.org/libs/libraries.htm
+# The page http://beta.boost.org/doc/libs is useful: it gives the first release
+# version of each library (among other things).
+
+# BOOST_DEFUN(LIBRARY, CODE)
+# --------------------------
+# Define BOOST_<LIBRARY-UPPERCASE> as a macro that runs CODE.
+#
+# Use indir to avoid the warning on underquoted macro name given to AC_DEFUN.
+m4_define([BOOST_DEFUN],
+[m4_indir([AC_DEFUN],
+ m4_toupper([BOOST_$1]),
+[m4_pushdef([BOOST_Library], [$1])dnl
+$2
+m4_popdef([BOOST_Library])dnl
+])
+])
+
+# BOOST_ARRAY()
+# -------------
+# Look for Boost.Array
+BOOST_DEFUN([Array],
+[BOOST_FIND_HEADER([boost/array.hpp])])
+
+
+# BOOST_ASIO()
+# ------------
+# Look for Boost.Asio (new in Boost 1.35).
+BOOST_DEFUN([Asio],
+[AC_REQUIRE([BOOST_SYSTEM])dnl
+BOOST_FIND_HEADER([boost/asio.hpp])])
+
+
+# BOOST_BIND()
+# ------------
+# Look for Boost.Bind.
+BOOST_DEFUN([Bind],
+[BOOST_FIND_HEADER([boost/bind.hpp])])
+
+
+# BOOST_CHRONO()
+# --------------
+# Look for Boost.Chrono.
+BOOST_DEFUN([Chrono],
+[# Do we have to check for Boost.System? This link-time dependency was
+# added as of 1.35.0. If we have a version <1.35, we must not attempt to
+# find Boost.System as it didn't exist by then.
+if test $boost_major_version -ge 135; then
+ BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+boost_filesystem_save_LIBS=$LIBS
+boost_filesystem_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([chrono], [$1],
+ [boost/chrono.hpp],
+ [boost::chrono::thread_clock d;])
+if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
+ BOOST_CHRONO_LIBS="$BOOST_CHRONO_LIBS $BOOST_SYSTEM_LIBS"
+fi
+LIBS=$boost_filesystem_save_LIBS
+LDFLAGS=$boost_filesystem_save_LDFLAGS
+])# BOOST_CHRONO
+
+
+# BOOST_CONTEXT([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Context. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+#
+# * This library was introduced in Boost 1.51.0
+# * The signatures of make_fcontext() and jump_fcontext were changed in 1.56.0
+# * A dependency on boost_thread appears in 1.57.0
+BOOST_DEFUN([Context],
+[boost_context_save_LIBS=$LIBS
+ boost_context_save_LDFLAGS=$LDFLAGS
+if test $boost_major_version -ge 157; then
+ BOOST_THREAD([$1])
+ m4_pattern_allow([^BOOST_THREAD_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_THREAD_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_THREAD_LDFLAGS"
+fi
+BOOST_FIND_LIB([context], [$1],
+ [boost/context/all.hpp],[[
+
+// creates a stack
+void * stack_pointer = new void*[4096];
+std::size_t const size = sizeof(void*[4096]);
+
+#if BOOST_VERSION <= 105100
+ctx::make_fcontext(&fc, f);
+return ctx::jump_fcontext(&fcm, &fc, 3) == 6;
+
+#else
+
+fc = ctx::make_fcontext(stack_pointer, size, f);
+return ctx::jump_fcontext(&fcm, fc, 3) == 6;
+
+#endif
+
+
+]],[dnl
+
+#include <boost/version.hpp>
+#if BOOST_VERSION <= 105100
+
+namespace ctx = boost::ctx;
+
+static ctx::fcontext_t fcm, fc;
+
+static void f(intptr_t i) {
+ ctx::jump_fcontext(&fc, &fcm, i * 2);
+}
+
+#elif BOOST_VERSION <= 105500
+
+namespace ctx = boost::context;
+
+// context
+static ctx::fcontext_t fcm, *fc;
+
+// context-function
+static void f(intptr_t i) {
+ ctx::jump_fcontext(fc, &fcm, i * 2);
+}
+
+#else
+
+namespace ctx = boost::context;
+
+// context
+static ctx::fcontext_t fcm, fc;
+
+// context-function
+static void f(intptr_t i) {
+ ctx::jump_fcontext(&fc, fcm, i * 2);
+}
+#endif
+])
+LIBS=$boost_context_save_LIBS
+LDFLAGS=$boost_context_save_LDFLAGS
+])# BOOST_CONTEXT
+
+
+# BOOST_CONVERSION()
+# ------------------
+# Look for Boost.Conversion (cast / lexical_cast)
+BOOST_DEFUN([Conversion],
+[BOOST_FIND_HEADER([boost/cast.hpp])
+BOOST_FIND_HEADER([boost/lexical_cast.hpp])
+])# BOOST_CONVERSION
+
+
+# BOOST_COROUTINE([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Coroutine. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. This library was introduced in Boost
+# 1.53.0
+BOOST_DEFUN([Coroutine],
+[
+boost_coroutine_save_LIBS=$LIBS
+boost_coroutine_save_LDFLAGS=$LDFLAGS
+# Link-time dependency from coroutine to context
+BOOST_CONTEXT([$1])
+# Starting from Boost 1.55 a dependency on Boost.System is added
+if test $boost_major_version -ge 155; then
+ BOOST_SYSTEM([$1])
+fi
+m4_pattern_allow([^BOOST_(CONTEXT|SYSTEM)_(LIBS|LDFLAGS)])
+LIBS="$LIBS $BOOST_CONTEXT_LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_CONTEXT_LDFLAGS"
+
+# in 1.53 coroutine was a header only library
+if test $boost_major_version -eq 153; then
+ BOOST_FIND_HEADER([boost/coroutine/coroutine.hpp])
+else
+ BOOST_FIND_LIB([coroutine], [$1],
+ [boost/coroutine/coroutine.hpp],
+ [
+ #include <boost/version.hpp>
+ #if BOOST_VERSION <= 105500
+ boost::coroutines::coroutine<int(int)> coro; coro.get();
+ #else
+ boost::coroutines::asymmetric_coroutine<int>::pull_type coro; coro.get();
+ #endif
+ ])
+fi
+# Link-time dependency from coroutine to context, existed only in 1.53, in 1.54
+# coroutine doesn't use context from its headers but from its library.
+if test $boost_major_version -eq 153 || test $enable_static_boost = yes && test $boost_major_version -ge 154; then
+ BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_CONTEXT_LIBS"
+ BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_CONTEXT_LDFLAGS"
+fi
+if test $enable_static_boost = yes && test $boost_major_version -ge 155; then
+ BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_SYSTEM_LIBS"
+ BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+fi
+LIBS=$boost_coroutine_save_LIBS
+LDFLAGS=$boost_coroutine_save_LDFLAGS
+])# BOOST_COROUTINE
+
+
+# BOOST_CRC()
+# -----------
+# Look for Boost.CRC
+BOOST_DEFUN([CRC],
+[BOOST_FIND_HEADER([boost/crc.hpp])
+])# BOOST_CRC
+
+
+# BOOST_DATE_TIME([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Date_Time. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Date_Time],
+[BOOST_FIND_LIB([date_time], [$1],
+ [boost/date_time/posix_time/posix_time.hpp],
+ [boost::posix_time::ptime t;])
+])# BOOST_DATE_TIME
+
+
+# BOOST_FILESYSTEM([PREFERRED-RT-OPT])
+# ------------------------------------
+# Look for Boost.Filesystem. For the documentation of PREFERRED-RT-OPT, see
+# the documentation of BOOST_FIND_LIB above.
+# Do not check for boost/filesystem.hpp because this file was introduced in
+# 1.34.
+BOOST_DEFUN([Filesystem],
+[# Do we have to check for Boost.System? This link-time dependency was
+# added as of 1.35.0. If we have a version <1.35, we must not attempt to
+# find Boost.System as it didn't exist by then.
+if test $boost_major_version -ge 135; then
+ BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+boost_filesystem_save_LIBS=$LIBS
+boost_filesystem_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([filesystem], [$1],
+ [boost/filesystem/path.hpp], [boost::filesystem::path p;])
+if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
+ BOOST_FILESYSTEM_LIBS="$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"
+fi
+LIBS=$boost_filesystem_save_LIBS
+LDFLAGS=$boost_filesystem_save_LDFLAGS
+])# BOOST_FILESYSTEM
+
+
+# BOOST_FLYWEIGHT()
+# -----------------
+# Look for Boost.Flyweight.
+BOOST_DEFUN([Flyweight],
+[dnl There's a hidden dependency on pthreads.
+AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
+BOOST_FIND_HEADER([boost/flyweight.hpp])
+AC_SUBST([BOOST_FLYWEIGHT_LIBS], [$boost_cv_pthread_flag])
+])
+
+
+# BOOST_FOREACH()
+# ---------------
+# Look for Boost.Foreach.
+BOOST_DEFUN([Foreach],
+[BOOST_FIND_HEADER([boost/foreach.hpp])])
+
+
+# BOOST_FORMAT()
+# --------------
+# Look for Boost.Format.
+# Note: we can't check for boost/format/format_fwd.hpp because the header isn't
+# standalone. It can't be compiled because it triggers the following error:
+# boost/format/detail/config_macros.hpp:88: error: 'locale' in namespace 'std'
+# does not name a type
+BOOST_DEFUN([Format],
+[BOOST_FIND_HEADER([boost/format.hpp])])
+
+
+# BOOST_FUNCTION()
+# ----------------
+# Look for Boost.Function
+BOOST_DEFUN([Function],
+[BOOST_FIND_HEADER([boost/function.hpp])])
+
+
+# BOOST_GEOMETRY()
+# ----------------
+# Look for Boost.Geometry (new since 1.47.0).
+BOOST_DEFUN([Geometry],
+[BOOST_FIND_HEADER([boost/geometry.hpp])
+])# BOOST_GEOMETRY
+
+
+# BOOST_GRAPH([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost.Graphs. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Graph],
+[boost_graph_save_LIBS=$LIBS
+boost_graph_save_LDFLAGS=$LDFLAGS
+# Link-time dependency from graph to regex was added as of 1.40.0.
+if test $boost_major_version -ge 140; then
+ BOOST_REGEX([$1])
+ m4_pattern_allow([^BOOST_REGEX_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_REGEX_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_REGEX_LDFLAGS"
+fi
+BOOST_FIND_LIB([graph], [$1],
+ [boost/graph/adjacency_list.hpp], [boost::adjacency_list<> g;])
+LIBS=$boost_graph_save_LIBS
+LDFLAGS=$boost_graph_save_LDFLAGS
+])# BOOST_GRAPH
+
+
+# BOOST_IOSTREAMS([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.IOStreams. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([IOStreams],
+[BOOST_FIND_LIB([iostreams], [$1],
+ [boost/iostreams/device/file_descriptor.hpp],
+ [boost::iostreams::file_descriptor fd; fd.close();])
+])# BOOST_IOSTREAMS
+
+
+# BOOST_HASH()
+# ------------
+# Look for Boost.Functional/Hash
+BOOST_DEFUN([Hash],
+[BOOST_FIND_HEADER([boost/functional/hash.hpp])])
+
+
+# BOOST_LAMBDA()
+# --------------
+# Look for Boost.Lambda
+BOOST_DEFUN([Lambda],
+[BOOST_FIND_HEADER([boost/lambda/lambda.hpp])])
+
+
+# BOOST_LOCALE()
+# --------------
+# Look for Boost.Locale
+BOOST_DEFUN([Locale],
+[
+boost_locale_save_LIBS=$LIBS
+boost_locale_save_LDFLAGS=$LDFLAGS
+# require SYSTEM for boost-1.50.0 and up
+if test $boost_major_version -ge 150; then
+ BOOST_SYSTEM([$1])
+ m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+fi # end of the Boost.System check.
+BOOST_FIND_LIB([locale], [$1],
+ [boost/locale.hpp],
+ [[boost::locale::generator gen; std::locale::global(gen(""));]])
+LIBS=$boost_locale_save_LIBS
+LDFLAGS=$boost_locale_save_LDFLAGS
+])# BOOST_LOCALE
+
+# BOOST_LOG([PREFERRED-RT-OPT])
+# -----------------------------
+# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Log],
+[boost_log_save_LIBS=$LIBS
+boost_log_save_LDFLAGS=$LDFLAGS
+BOOST_SYSTEM([$1])
+BOOST_FILESYSTEM([$1])
+BOOST_DATE_TIME([$1])
+m4_pattern_allow([^BOOST_(SYSTEM|FILESYSTEM|DATE_TIME)_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_DATE_TIME_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_DATE_TIME_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([log], [$1],
+ [boost/log/core/core.hpp],
+ [boost::log::attribute a; a.get_value();])
+LIBS=$boost_log_save_LIBS
+LDFLAGS=$boost_log_save_LDFLAGS
+])# BOOST_LOG
+
+
+# BOOST_LOG_SETUP([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Log_Setup],
+[boost_log_setup_save_LIBS=$LIBS
+boost_log_setup_save_LDFLAGS=$LDFLAGS
+BOOST_LOG([$1])
+m4_pattern_allow([^BOOST_LOG_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_LOG_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_LOG_LDFLAGS"
+BOOST_FIND_LIB([log_setup], [$1],
+ [boost/log/utility/setup/from_settings.hpp],
+ [boost::log::basic_settings<char> bs; bs.empty();])
+LIBS=$boost_log_setup_save_LIBS
+LDFLAGS=$boost_log_setup_save_LDFLAGS
+])# BOOST_LOG_SETUP
+
+
+# BOOST_MATH()
+# ------------
+# Look for Boost.Math
+# TODO: This library isn't header-only but it comes in multiple different
+# flavors that don't play well with BOOST_FIND_LIB (e.g, libboost_math_c99,
+# libboost_math_c99f, libboost_math_c99l, libboost_math_tr1,
+# libboost_math_tr1f, libboost_math_tr1l). This macro must be fixed to do the
+# right thing anyway.
+BOOST_DEFUN([Math],
+[BOOST_FIND_HEADER([boost/math/special_functions.hpp])])
+
+
+# BOOST_MPI([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost MPI. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. Uses MPICXX variable if it is
+# set, otherwise tries CXX
+#
+BOOST_DEFUN([MPI],
+[boost_save_CXX=${CXX}
+boost_save_CXXCPP=${CXXCPP}
+if test x"${MPICXX}" != x; then
+ CXX=${MPICXX}
+ CXXCPP="${MPICXX} -E"
+fi
+BOOST_FIND_LIB([mpi], [$1],
+ [boost/mpi.hpp],
+ [int argc = 0;
+ char **argv = 0;
+ boost::mpi::environment env(argc,argv);])
+CXX=${boost_save_CXX}
+CXXCPP=${boost_save_CXXCPP}
+])# BOOST_MPI
+
+
+# BOOST_MULTIARRAY()
+# ------------------
+# Look for Boost.MultiArray
+BOOST_DEFUN([MultiArray],
+[BOOST_FIND_HEADER([boost/multi_array.hpp])])
+
+
+# BOOST_NUMERIC_UBLAS()
+# --------------------------
+# Look for Boost.NumericUblas (Basic Linear Algebra)
+BOOST_DEFUN([Numeric_Ublas],
+[BOOST_FIND_HEADER([boost/numeric/ublas/vector.hpp])
+])# BOOST_NUMERIC_UBLAS
+
+
+# BOOST_NUMERIC_CONVERSION()
+# --------------------------
+# Look for Boost.NumericConversion (policy-based numeric conversion)
+BOOST_DEFUN([Numeric_Conversion],
+[BOOST_FIND_HEADER([boost/numeric/conversion/converter.hpp])
+])# BOOST_NUMERIC_CONVERSION
+
+
+# BOOST_OPTIONAL()
+# ----------------
+# Look for Boost.Optional
+BOOST_DEFUN([Optional],
+[BOOST_FIND_HEADER([boost/optional.hpp])])
+
+
+# BOOST_PREPROCESSOR()
+# --------------------
+# Look for Boost.Preprocessor
+BOOST_DEFUN([Preprocessor],
+[BOOST_FIND_HEADER([boost/preprocessor/repeat.hpp])])
+
+
+# BOOST_RANGE()
+# --------------------
+# Look for Boost.Range
+BOOST_DEFUN([Range],
+[BOOST_FIND_HEADER([boost/range/adaptors.hpp])])
+
+# BOOST_UNORDERED()
+# -----------------
+# Look for Boost.Unordered
+BOOST_DEFUN([Unordered],
+[BOOST_FIND_HEADER([boost/unordered_map.hpp])])
+
+
+# BOOST_UUID()
+# ------------
+# Look for Boost.Uuid
+BOOST_DEFUN([Uuid],
+[BOOST_FIND_HEADER([boost/uuid/uuid.hpp])])
+
+
+# BOOST_PROGRAM_OPTIONS([PREFERRED-RT-OPT])
+# -----------------------------------------
+# Look for Boost.Program_options. For the documentation of PREFERRED-RT-OPT,
+# see the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Program_Options],
+[BOOST_FIND_LIB([program_options], [$1],
+ [boost/program_options.hpp],
+ [boost::program_options::options_description d("test");])
+])# BOOST_PROGRAM_OPTIONS
+
+
+
+# _BOOST_PYTHON_CONFIG(VARIABLE, FLAG)
+# ------------------------------------
+# Save VARIABLE, and define it via `python-config --FLAG`.
+# Substitute BOOST_PYTHON_VARIABLE.
+m4_define([_BOOST_PYTHON_CONFIG],
+[AC_SUBST([BOOST_PYTHON_$1],
+ [`python-config --$2 2>/dev/null`])dnl
+boost_python_save_$1=$$1
+$1="$$1 $BOOST_PYTHON_$1"])
+
+
+# BOOST_PYTHON([PREFERRED-RT-OPT])
+# --------------------------------
+# Look for Boost.Python. For the documentation of PREFERRED-RT-OPT,
+# see the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Python],
+[_BOOST_PYTHON_CONFIG([CPPFLAGS], [includes])
+_BOOST_PYTHON_CONFIG([LDFLAGS], [ldflags])
+_BOOST_PYTHON_CONFIG([LIBS], [libs])
+m4_pattern_allow([^BOOST_PYTHON_MODULE$])dnl
+BOOST_FIND_LIBS([python], [python python3], [$1],
+ [boost/python.hpp],
+ [], [BOOST_PYTHON_MODULE(empty) {}])
+CPPFLAGS=$boost_python_save_CPPFLAGS
+LDFLAGS=$boost_python_save_LDFLAGS
+LIBS=$boost_python_save_LIBS
+])# BOOST_PYTHON
+
+
+# BOOST_REF()
+# -----------
+# Look for Boost.Ref
+BOOST_DEFUN([Ref],
+[BOOST_FIND_HEADER([boost/ref.hpp])])
+
+
+# BOOST_REGEX([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost.Regex. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Regex],
+[BOOST_FIND_LIB([regex], [$1],
+ [boost/regex.hpp],
+ [boost::regex exp("*"); boost::regex_match("foo", exp);])
+])# BOOST_REGEX
+
+
+# BOOST_SERIALIZATION([PREFERRED-RT-OPT])
+# ---------------------------------------
+# Look for Boost.Serialization. For the documentation of PREFERRED-RT-OPT, see
+# the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Serialization],
+[BOOST_FIND_LIB([serialization], [$1],
+ [boost/archive/text_oarchive.hpp],
+ [std::ostream* o = 0; // Cheap way to get an ostream...
+ boost::archive::text_oarchive t(*o);])
+])# BOOST_SERIALIZATION
+
+
+# BOOST_SIGNALS([PREFERRED-RT-OPT])
+# ---------------------------------
+# Look for Boost.Signals. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Signals],
+[BOOST_FIND_LIB([signals], [$1],
+ [boost/signal.hpp],
+ [boost::signal<void ()> s;])
+])# BOOST_SIGNALS
+
+
+# BOOST_SIGNALS2()
+# ----------------
+# Look for Boost.Signals2 (new since 1.39.0).
+BOOST_DEFUN([Signals2],
+[BOOST_FIND_HEADER([boost/signals2.hpp])
+])# BOOST_SIGNALS2
+
+
+# BOOST_SMART_PTR()
+# -----------------
+# Look for Boost.SmartPtr
+BOOST_DEFUN([Smart_Ptr],
+[BOOST_FIND_HEADER([boost/scoped_ptr.hpp])
+BOOST_FIND_HEADER([boost/shared_ptr.hpp])
+])
+
+
+# BOOST_STATICASSERT()
+# --------------------
+# Look for Boost.StaticAssert
+BOOST_DEFUN([StaticAssert],
+[BOOST_FIND_HEADER([boost/static_assert.hpp])])
+
+
+# BOOST_STRING_ALGO()
+# -------------------
+# Look for Boost.StringAlgo
+BOOST_DEFUN([String_Algo],
+[BOOST_FIND_HEADER([boost/algorithm/string.hpp])
+])
+
+
+# BOOST_SYSTEM([PREFERRED-RT-OPT])
+# --------------------------------
+# Look for Boost.System. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. This library was introduced in Boost
+# 1.35.0.
+BOOST_DEFUN([System],
+[BOOST_FIND_LIB([system], [$1],
+ [boost/system/error_code.hpp],
+ [boost::system::error_code e; e.clear();])
+])# BOOST_SYSTEM
+
+
+# BOOST_TEST([PREFERRED-RT-OPT])
+# ------------------------------
+# Look for Boost.Test. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Test],
+[m4_pattern_allow([^BOOST_CHECK$])dnl
+BOOST_FIND_LIB([unit_test_framework], [$1],
+ [boost/test/unit_test.hpp], [BOOST_CHECK(2 == 2);],
+ [using boost::unit_test::test_suite;
+ test_suite* init_unit_test_suite(int argc, char ** argv)
+ { return NULL; }])
+])# BOOST_TEST
+
+
+# BOOST_THREAD([PREFERRED-RT-OPT])
+# ---------------------------------
+# Look for Boost.Thread. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Thread],
+[dnl Having the pthread flag is required at least on GCC3 where
+dnl boost/thread.hpp would complain if we try to compile without
+dnl -pthread on GNU/Linux.
+AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
+boost_thread_save_LIBS=$LIBS
+boost_thread_save_LDFLAGS=$LDFLAGS
+boost_thread_save_CPPFLAGS=$CPPFLAGS
+# Link-time dependency from thread to system was added as of 1.49.0.
+if test $boost_major_version -ge 149; then
+BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+CPPFLAGS="$CPPFLAGS $boost_cv_pthread_flag"
+
+# When compiling for the Windows platform, the threads library is named
+# differently. This suffix doesn't exist in new versions of Boost, or
+# possibly new versions of GCC on mingw I am assuming it's Boost's change for
+# now and I am setting version to 1.48, for lack of knowledge as to when this
+# change occurred.
+if test $boost_major_version -lt 148; then
+ case $host_os in
+ (*mingw*) boost_thread_lib_ext=_win32;;
+ esac
+fi
+BOOST_FIND_LIBS([thread], [thread$boost_thread_lib_ext],
+ [$1],
+ [boost/thread.hpp], [boost::thread t; boost::mutex m;])
+
+case $host_os in
+ (*mingw*) boost_thread_w32_socket_link=-lws2_32;;
+esac
+
+BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag $boost_thread_w32_socket_link"
+BOOST_THREAD_LDFLAGS="$BOOST_SYSTEM_LDFLAGS"
+BOOST_CPPFLAGS="$BOOST_CPPFLAGS $boost_cv_pthread_flag"
+LIBS=$boost_thread_save_LIBS
+LDFLAGS=$boost_thread_save_LDFLAGS
+CPPFLAGS=$boost_thread_save_CPPFLAGS
+])# BOOST_THREAD
+
+AU_ALIAS([BOOST_THREADS], [BOOST_THREAD])
+
+
+# BOOST_TOKENIZER()
+# -----------------
+# Look for Boost.Tokenizer
+BOOST_DEFUN([Tokenizer],
+[BOOST_FIND_HEADER([boost/tokenizer.hpp])])
+
+
+# BOOST_TRIBOOL()
+# ---------------
+# Look for Boost.Tribool
+BOOST_DEFUN([Tribool],
+[BOOST_FIND_HEADER([boost/logic/tribool_fwd.hpp])
+BOOST_FIND_HEADER([boost/logic/tribool.hpp])
+])
+
+
+# BOOST_TUPLE()
+# -------------
+# Look for Boost.Tuple
+BOOST_DEFUN([Tuple],
+[BOOST_FIND_HEADER([boost/tuple/tuple.hpp])])
+
+
+# BOOST_TYPETRAITS()
+# --------------------
+# Look for Boost.TypeTraits
+BOOST_DEFUN([TypeTraits],
+[BOOST_FIND_HEADER([boost/type_traits.hpp])])
+
+
+# BOOST_UTILITY()
+# ---------------
+# Look for Boost.Utility (noncopyable, result_of, base-from-member idiom,
+# etc.)
+BOOST_DEFUN([Utility],
+[BOOST_FIND_HEADER([boost/utility.hpp])])
+
+
+# BOOST_VARIANT()
+# ---------------
+# Look for Boost.Variant.
+BOOST_DEFUN([Variant],
+[BOOST_FIND_HEADER([boost/variant/variant_fwd.hpp])
+BOOST_FIND_HEADER([boost/variant.hpp])])
+
+
+# BOOST_POINTER_CONTAINER()
+# ------------------------
+# Look for Boost.PointerContainer
+BOOST_DEFUN([Pointer_Container],
+[BOOST_FIND_HEADER([boost/ptr_container/ptr_deque.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_list.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_vector.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_array.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_set.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_map.hpp])
+])# BOOST_POINTER_CONTAINER
+
+
+# BOOST_WAVE([PREFERRED-RT-OPT])
+# ------------------------------
+# NOTE: If you intend to use Wave/Spirit with thread support, make sure you
+# call BOOST_THREAD first.
+# Look for Boost.Wave. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Wave],
+[AC_REQUIRE([BOOST_FILESYSTEM])dnl
+AC_REQUIRE([BOOST_DATE_TIME])dnl
+boost_wave_save_LIBS=$LIBS
+boost_wave_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_((FILE)?SYSTEM|DATE_TIME|THREAD)_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS \
+$BOOST_THREAD_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS \
+$BOOST_DATE_TIME_LDFLAGS $BOOST_THREAD_LDFLAGS"
+BOOST_FIND_LIB([wave], [$1],
+ [boost/wave.hpp],
+ [boost::wave::token_id id; get_token_name(id);])
+LIBS=$boost_wave_save_LIBS
+LDFLAGS=$boost_wave_save_LDFLAGS
+])# BOOST_WAVE
+
+
+# BOOST_XPRESSIVE()
+# -----------------
+# Look for Boost.Xpressive (new since 1.36.0).
+BOOST_DEFUN([Xpressive],
+[BOOST_FIND_HEADER([boost/xpressive/xpressive.hpp])])
+
+
+# ----------------- #
+# Internal helpers. #
+# ----------------- #
+
+
+# _BOOST_PTHREAD_FLAG()
+# ---------------------
+# Internal helper for BOOST_THREAD. Computes boost_cv_pthread_flag
+# which must be used in CPPFLAGS and LIBS.
+#
+# Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3,
+# boost/thread.hpp will trigger a #error if -pthread isn't used:
+# boost/config/requires_threads.hpp:47:5: #error "Compiler threading support
+# is not turned on. Please set the correct command line options for
+# threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
+#
+# Based on ACX_PTHREAD: http://autoconf-archive.cryp.to/acx_pthread.html
+AC_DEFUN([_BOOST_PTHREAD_FLAG],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_LANG_PUSH([C++])dnl
+AC_CACHE_CHECK([for the flags needed to use pthreads], [boost_cv_pthread_flag],
+[ boost_cv_pthread_flag=
+ # The ordering *is* (sometimes) important. Some notes on the
+ # individual items follow:
+ # (none): in case threads are in libc; should be tried before -Kthread and
+ # other compiler flags to prevent continual compiler warnings
+ # -lpthreads: AIX (must check this before -lpthread)
+ # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+ # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+ # -llthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+ # -pthread: GNU Linux/GCC (kernel threads), BSD/GCC (userland threads)
+ # -pthreads: Solaris/GCC
+ # -mthreads: MinGW32/GCC, Lynx/GCC
+ # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+ # doesn't hurt to check since this sometimes defines pthreads too;
+ # also defines -D_REENTRANT)
+ # ... -mt is also the pthreads flag for HP/aCC
+ # -lpthread: GNU Linux, etc.
+ # --thread-safe: KAI C++
+ case $host_os in #(
+ *solaris*)
+ # On Solaris (at least, for some versions), libc contains stubbed
+ # (non-functional) versions of the pthreads routines, so link-based
+ # tests will erroneously succeed. (We need to link with -pthreads/-mt/
+ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
+ # a function called by this macro, so we could check for that, but
+ # who knows whether they'll stub that too in a future libc.) So,
+ # we'll just look for -pthreads and -lpthread first:
+ boost_pthread_flags="-pthreads -lpthread -mt -pthread";; #(
+ *)
+ boost_pthread_flags="-lpthreads -Kthread -kthread -llthread -pthread \
+ -pthreads -mthreads -lpthread --thread-safe -mt";;
+ esac
+ # Generate the test file.
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <pthread.h>],
+ [pthread_t th; pthread_join(th, 0);
+ pthread_attr_init(0); pthread_cleanup_push(0, 0);
+ pthread_create(0,0,0,0); pthread_cleanup_pop(0);])])
+ for boost_pthread_flag in '' $boost_pthread_flags; do
+ boost_pthread_ok=false
+dnl Re-use the test file already generated.
+ boost_pthreads__save_LIBS=$LIBS
+ LIBS="$LIBS $boost_pthread_flag"
+ AC_LINK_IFELSE([],
+ [if grep ".*$boost_pthread_flag" conftest.err; then
+ echo "This flag seems to have triggered warnings" >&AS_MESSAGE_LOG_FD
+ else
+ boost_pthread_ok=:; boost_cv_pthread_flag=$boost_pthread_flag
+ fi])
+ LIBS=$boost_pthreads__save_LIBS
+ $boost_pthread_ok && break
+ done
+])
+AC_LANG_POP([C++])dnl
+])# _BOOST_PTHREAD_FLAG
+
+
+# _BOOST_gcc_test(MAJOR, MINOR)
+# -----------------------------
+# Internal helper for _BOOST_FIND_COMPILER_TAG.
+m4_define([_BOOST_gcc_test],
+["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC @ gcc$1$2"])dnl
+
+# _BOOST_mingw_test(MAJOR, MINOR)
+# -----------------------------
+# Internal helper for _BOOST_FIND_COMPILER_TAG.
+m4_define([_BOOST_mingw_test],
+["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw$1$2"])dnl
+
+
+# _BOOST_FIND_COMPILER_TAG()
+# --------------------------
+# Internal. When Boost is installed without --layout=system, each library
+# filename will hold a suffix that encodes the compiler used during the
+# build. The Boost build system seems to call this a `tag'.
+AC_DEFUN([_BOOST_FIND_COMPILER_TAG],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_CACHE_CHECK([for the toolset name used by Boost for $CXX],
+ [boost_cv_lib_tag],
+[boost_cv_lib_tag=unknown
+if test x$boost_cv_inc_path != xno; then
+ AC_LANG_PUSH([C++])dnl
+ # The following tests are mostly inspired by boost/config/auto_link.hpp
+ # The list is sorted to most recent/common to oldest compiler (in order
+ # to increase the likelihood of finding the right compiler with the
+ # least number of compilation attempt).
+ # Beware that some tests are sensible to the order (for instance, we must
+ # look for MinGW before looking for GCC3).
+ # I used one compilation test per compiler with a #error to recognize
+ # each compiler so that it works even when cross-compiling (let me know
+ # if you know a better approach).
+ # Known missing tags (known from Boost's tools/build/v2/tools/common.jam):
+ # como, edg, kcc, bck, mp, sw, tru, xlc
+ # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines
+ # the same defines as GCC's).
+ for i in \
+ _BOOST_mingw_test(5, 3) \
+ _BOOST_gcc_test(5, 3) \
+ _BOOST_mingw_test(5, 2) \
+ _BOOST_gcc_test(5, 2) \
+ _BOOST_mingw_test(5, 1) \
+ _BOOST_gcc_test(5, 1) \
+ _BOOST_mingw_test(5, 0) \
+ _BOOST_gcc_test(5, 0) \
+ _BOOST_mingw_test(4, 10) \
+ _BOOST_gcc_test(4, 10) \
+ _BOOST_mingw_test(4, 9) \
+ _BOOST_gcc_test(4, 9) \
+ _BOOST_mingw_test(4, 8) \
+ _BOOST_gcc_test(4, 8) \
+ _BOOST_mingw_test(4, 7) \
+ _BOOST_gcc_test(4, 7) \
+ _BOOST_mingw_test(4, 6) \
+ _BOOST_gcc_test(4, 6) \
+ _BOOST_mingw_test(4, 5) \
+ _BOOST_gcc_test(4, 5) \
+ _BOOST_mingw_test(4, 4) \
+ _BOOST_gcc_test(4, 4) \
+ _BOOST_mingw_test(4, 3) \
+ _BOOST_gcc_test(4, 3) \
+ _BOOST_mingw_test(4, 2) \
+ _BOOST_gcc_test(4, 2) \
+ _BOOST_mingw_test(4, 1) \
+ _BOOST_gcc_test(4, 1) \
+ _BOOST_mingw_test(4, 0) \
+ _BOOST_gcc_test(4, 0) \
+ "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \
+ && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw" \
+ _BOOST_gcc_test(3, 4) \
+ _BOOST_gcc_test(3, 3) \
+ "defined _MSC_VER && _MSC_VER >= 1500 @ vc90" \
+ "defined _MSC_VER && _MSC_VER == 1400 @ vc80" \
+ _BOOST_gcc_test(3, 2) \
+ "defined _MSC_VER && _MSC_VER == 1310 @ vc71" \
+ _BOOST_gcc_test(3, 1) \
+ _BOOST_gcc_test(3, 0) \
+ "defined __BORLANDC__ @ bcb" \
+ "defined __ICC && (defined __unix || defined __unix__) @ il" \
+ "defined __ICL @ iw" \
+ "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \
+ _BOOST_gcc_test(2, 95) \
+ "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \
+ "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \
+ "defined _MSC_VER && _MSC_VER < 1300 && defined UNDER_CE @ evc4" \
+ "defined __MWERKS__ && __MWERKS__ <= 0x31FF @ cw8"
+ do
+ boost_tag_test=`expr "X$i" : 'X\([[^@]]*\) @ '`
+ boost_tag=`expr "X$i" : 'X[[^@]]* @ \(.*\)'`
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if $boost_tag_test
+/* OK */
+#else
+# error $boost_tag_test
+#endif
+]])], [boost_cv_lib_tag=$boost_tag; break], [])
+ done
+AC_LANG_POP([C++])dnl
+ case $boost_cv_lib_tag in #(
+ # Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed
+ # to "gcc41" for instance.
+ *-gcc | *'-gcc ') :;; #( Don't re-add -gcc: it's already in there.
+ gcc*)
+ boost_tag_x=
+ case $host_os in #(
+ darwin*)
+ if test $boost_major_version -ge 136; then
+ # The `x' added in r46793 of Boost.
+ boost_tag_x=x
+ fi;;
+ esac
+ # We can specify multiple tags in this variable because it's used by
+ # BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ...
+ boost_cv_lib_tag="$boost_tag_x$boost_cv_lib_tag -${boost_tag_x}gcc"
+ ;; #(
+ unknown)
+ AC_MSG_WARN([[could not figure out which toolset name to use for $CXX]])
+ boost_cv_lib_tag=
+ ;;
+ esac
+fi])dnl end of AC_CACHE_CHECK
+])# _BOOST_FIND_COMPILER_TAG
+
+
+# _BOOST_GUESS_WHETHER_TO_USE_MT()
+# --------------------------------
+# Compile a small test to try to guess whether we should favor MT (Multi
+# Thread) flavors of Boost. Sets boost_guess_use_mt accordingly.
+AC_DEFUN([_BOOST_GUESS_WHETHER_TO_USE_MT],
+[# Check whether we do better use `mt' even though we weren't ask to.
+AC_LANG_PUSH([C++])dnl
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if defined _REENTRANT || defined _MT || defined __MT__
+/* use -mt */
+#else
+# error MT not needed
+#endif
+]])], [boost_guess_use_mt=:], [boost_guess_use_mt=false])
+AC_LANG_POP([C++])dnl
+])
+
+# _BOOST_AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+# -------------------------------------------------------------------
+# Fork of _AC_LINK_IFELSE that preserves conftest.o across calls. Fragile,
+# will break when Autoconf changes its internals. Requires that you manually
+# rm -f conftest.$ac_objext in between to really different tests, otherwise
+# you will try to link a conftest.o left behind by a previous test.
+# Used to aggressively optimize BOOST_FIND_LIB (see the big comment in this
+# macro).
+#
+# Don't use "break" in the actions, as it would short-circuit some code
+# this macro runs after the actions.
+m4_define([_BOOST_AC_LINK_IFELSE],
+[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
+rm -f conftest$ac_exeext
+boost_save_ac_ext=$ac_ext
+boost_use_source=:
+# If we already have a .o, re-use it. We change $ac_ext so that $ac_link
+# tries to link the existing object file instead of compiling from source.
+test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false &&
+ _AS_ECHO_LOG([re-using the existing conftest.$ac_objext])
+AS_IF([_AC_DO_STDERR($ac_link) && {
+ test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_executable_p conftest$ac_exeext
+dnl FIXME: use AS_TEST_X instead when 2.61 is widespread enough.
+ }],
+ [$2],
+ [if $boost_use_source; then
+ _AC_MSG_LOG_CONFTEST
+ fi
+ $3])
+ac_objext=$boost_save_ac_objext
+ac_ext=$boost_save_ac_ext
+dnl Delete also the IPA/IPO (Inter Procedural Analysis/Optimization)
+dnl information created by the PGI compiler (conftest_ipa8_conftest.oo),
+dnl as it would interfere with the next link command.
+rm -f core conftest.err conftest_ipa8_conftest.oo \
+ conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl
+])# _BOOST_AC_LINK_IFELSE
+
+# Local Variables:
+# mode: autoconf
+# End:
diff --git a/org.eclipse.efm.symbex/cmake/cvc4-patch/config/boost.m4.txt b/org.eclipse.efm.symbex/cmake/cvc4-patch/config/boost.m4.txt
new file mode 100644
index 0000000..27d063f
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/cvc4-patch/config/boost.m4.txt
@@ -0,0 +1,1560 @@
+# boost.m4: Locate Boost headers and libraries for autoconf-based projects.
+# Copyright (C) 2007-2011, 2014 Benoit Sigoure <tsuna@lrde.epita.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Additional permission under section 7 of the GNU General Public
+# License, version 3 ("GPLv3"):
+#
+# If you convey this file as part of a work that contains a
+# configuration script generated by Autoconf, you may do so under
+# terms of your choice.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+m4_define([_BOOST_SERIAL], [m4_translit([
+# serial 25
+], [#
+], [])])
+
+# Original sources can be found at http://github.com/tsuna/boost.m4
+# You can fetch the latest version of the script by doing:
+# wget http://github.com/tsuna/boost.m4/raw/master/build-aux/boost.m4
+
+# ------ #
+# README #
+# ------ #
+
+# This file provides several macros to use the various Boost libraries.
+# The first macro is BOOST_REQUIRE. It will simply check if it's possible to
+# find the Boost headers of a given (optional) minimum version and it will
+# define BOOST_CPPFLAGS accordingly. It will add an option --with-boost to
+# your configure so that users can specify non standard locations.
+# If the user's environment contains BOOST_ROOT and --with-boost was not
+# specified, --with-boost=$BOOST_ROOT is implicitly used.
+# For more README and documentation, go to http://github.com/tsuna/boost.m4
+# Note: THESE MACROS ASSUME THAT YOU USE LIBTOOL. If you don't, don't worry,
+# simply read the README, it will show you what to do step by step.
+
+m4_pattern_forbid([^_?(BOOST|Boost)_])
+
+
+# _BOOST_SED_CPP(SED-PROGRAM, PROGRAM,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# --------------------------------------------------------
+# Same as AC_EGREP_CPP, but leave the result in conftest.i.
+#
+# SED-PROGRAM is *not* overquoted, as in AC_EGREP_CPP. It is expanded
+# in double-quotes, so escape your double quotes.
+#
+# It could be useful to turn this into a macro which extracts the
+# value of any macro.
+m4_define([_BOOST_SED_CPP],
+[AC_LANG_PUSH([C++])dnl
+AC_LANG_PREPROC_REQUIRE()dnl
+AC_REQUIRE([AC_PROG_SED])dnl
+AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])])
+AS_IF([dnl eval is necessary to expand ac_cpp.
+dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
+dnl Beware of Windows end-of-lines, for instance if we are running
+dnl some Windows programs under Wine. In that case, boost/version.hpp
+dnl is certainly using "\r\n", but the regular Unix shell will only
+dnl strip `\n' with backquotes, not the `\r'. This results in
+dnl boost_cv_lib_version='1_37\r' for instance, which breaks
+dnl everything else.
+dnl Cannot use 'dnl' after [$4] because a trailing dnl may break AC_CACHE_CHECK
+dnl
+dnl Beware that GCC 5, when expanding macros, may embed # line directives
+dnl a within single line:
+dnl
+dnl # 1 "conftest.cc"
+dnl # 1 "<built-in>"
+dnl # 1 "<command-line>"
+dnl # 1 "conftest.cc"
+dnl # 1 "/opt/local/include/boost/version.hpp" 1 3
+dnl # 2 "conftest.cc" 2
+dnl boost-lib-version =
+dnl # 2 "conftest.cc" 3
+dnl "1_56"
+dnl
+dnl So get rid of the # lines, and glue the remaining ones together.
+(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+ grep -v '#' |
+ tr -d '\r' |
+ tr -s '\n' ' ' |
+ $SED -n -e "$1" >conftest.i 2>&1],
+ [$3],
+ [$4])
+rm -rf conftest*
+AC_LANG_POP([C++])dnl
+])# _BOOST_SED_CPP
+
+
+
+# BOOST_REQUIRE([VERSION], [ACTION-IF-NOT-FOUND])
+# -----------------------------------------------
+# Look for Boost. If version is given, it must either be a literal of the form
+# "X.Y.Z" where X, Y and Z are integers (the ".Z" part being optional) or a
+# variable "$var".
+# Defines the value BOOST_CPPFLAGS. This macro only checks for headers with
+# the required version, it does not check for any of the Boost libraries.
+# On # success, defines HAVE_BOOST. On failure, calls the optional
+# ACTION-IF-NOT-FOUND action if one was supplied.
+# Otherwise aborts with an error message.
+AC_DEFUN_ONCE([BOOST_REQUIRE],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_PROG_GREP])dnl
+echo "$as_me: this is boost.m4[]_BOOST_SERIAL" >&AS_MESSAGE_LOG_FD
+boost_save_IFS=$IFS
+boost_version_req=$1
+IFS=.
+set x $boost_version_req 0 0 0
+IFS=$boost_save_IFS
+shift
+boost_version_req=`expr "$[1]" '*' 100000 + "$[2]" '*' 100 + "$[3]"`
+boost_version_req_string=$[1].$[2].$[3]
+AC_ARG_WITH([boost],
+ [AS_HELP_STRING([--with-boost=DIR],
+ [prefix of Boost $1 @<:@guess@:>@])])dnl
+AC_ARG_VAR([BOOST_ROOT],[Location of Boost installation])dnl
+# If BOOST_ROOT is set and the user has not provided a value to
+# --with-boost, then treat BOOST_ROOT as if it the user supplied it.
+if test x"$BOOST_ROOT" != x; then
+ if test x"$with_boost" = x; then
+ AC_MSG_NOTICE([Detected BOOST_ROOT; continuing with --with-boost=$BOOST_ROOT])
+ with_boost=$BOOST_ROOT
+ else
+ AC_MSG_NOTICE([Detected BOOST_ROOT=$BOOST_ROOT, but overridden by --with-boost=$with_boost])
+ fi
+fi
+AC_SUBST([DISTCHECK_CONFIGURE_FLAGS],
+ ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"])dnl
+boost_save_CPPFLAGS=$CPPFLAGS
+ AC_CACHE_CHECK([for Boost headers version >= $boost_version_req_string],
+ [boost_cv_inc_path],
+ [boost_cv_inc_path=no
+AC_LANG_PUSH([C++])dnl
+m4_pattern_allow([^BOOST_VERSION$])dnl
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#include <boost/version.hpp>
+#if !defined BOOST_VERSION
+# error BOOST_VERSION is not defined
+#elif BOOST_VERSION < $boost_version_req
+# error Boost headers version < $boost_version_req
+#endif
+]])])
+ # If the user provided a value to --with-boost, use it and only it.
+ case $with_boost in #(
+ ''|yes) set x '' /opt/local/include /usr/local/include /opt/include \
+ /usr/include C:/Boost/include;; #(
+ *) set x "$with_boost/include" "$with_boost";;
+ esac
+ shift
+ for boost_dir
+ do
+ # Without --layout=system, Boost (or at least some versions) installs
+ # itself in <prefix>/include/boost-<version>. This inner loop helps to
+ # find headers in such directories.
+ #
+ # Any ${boost_dir}/boost-x_xx directories are searched in reverse version
+ # order followed by ${boost_dir}. The final '.' is a sentinel for
+ # searching $boost_dir" itself. Entries are whitespace separated.
+ #
+ # I didn't indent this loop on purpose (to avoid over-indented code)
+ boost_layout_system_search_list=`cd "$boost_dir" 2>/dev/null \
+ && ls -1 | "${GREP}" '^boost-' | sort -rn -t- -k2 \
+ && echo .`
+ for boost_inc in $boost_layout_system_search_list
+ do
+ if test x"$boost_inc" != x.; then
+ boost_inc="$boost_dir/$boost_inc"
+ else
+ boost_inc="$boost_dir" # Uses sentinel in boost_layout_system_search_list
+ fi
+ if test x"$boost_inc" != x; then
+ # We are going to check whether the version of Boost installed
+ # in $boost_inc is usable by running a compilation that
+ # #includes it. But if we pass a -I/some/path in which Boost
+ # is not installed, the compiler will just skip this -I and
+ # use other locations (either from CPPFLAGS, or from its list
+ # of system include directories). As a result we would use
+ # header installed on the machine instead of the /some/path
+ # specified by the user. So in that precise case (trying
+ # $boost_inc), make sure the version.hpp exists.
+ #
+ # Use test -e as there can be symlinks.
+ test -e "$boost_inc/boost/version.hpp" || continue
+ CPPFLAGS="$CPPFLAGS -I$boost_inc"
+ fi
+ AC_COMPILE_IFELSE([], [boost_cv_inc_path=yes], [boost_cv_version=no])
+ if test x"$boost_cv_inc_path" = xyes; then
+ if test x"$boost_inc" != x; then
+ boost_cv_inc_path=$boost_inc
+ fi
+ break 2
+ fi
+ done
+ done
+AC_LANG_POP([C++])dnl
+ ])
+ case $boost_cv_inc_path in #(
+ no)
+ boost_errmsg="cannot find Boost headers version >= $boost_version_req_string"
+ m4_if([$2], [], [AC_MSG_ERROR([$boost_errmsg])],
+ [AC_MSG_NOTICE([$boost_errmsg])])
+ $2
+ ;;#(
+ yes)
+ BOOST_CPPFLAGS=
+ ;;#(
+ *)
+ AC_SUBST([BOOST_CPPFLAGS], ["-I$boost_cv_inc_path"])dnl
+ ;;
+ esac
+ if test x"$boost_cv_inc_path" != xno; then
+ AC_DEFINE([HAVE_BOOST], [1],
+ [Defined if the requested minimum BOOST version is satisfied])
+ AC_CACHE_CHECK([for Boost's header version],
+ [boost_cv_lib_version],
+ [m4_pattern_allow([^BOOST_LIB_VERSION$])dnl
+ _BOOST_SED_CPP([[/^boost-lib-version = /{s///;s/[\" ]//g;p;q;}]],
+ [#include <boost/version.hpp>
+boost-lib-version = BOOST_LIB_VERSION],
+ [boost_cv_lib_version=`cat conftest.i`])])
+ # e.g. "134" for 1_34_1 or "135" for 1_35
+ boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'`
+ case $boost_major_version in #(
+ '' | *[[!0-9]]*)
+ AC_MSG_ERROR([invalid value: boost_major_version='$boost_major_version'])
+ ;;
+ esac
+fi
+CPPFLAGS=$boost_save_CPPFLAGS
+])# BOOST_REQUIRE
+
+
+# BOOST_STATIC()
+# --------------
+# Add the "--enable-static-boost" configure argument. If this argument is given
+# on the command line, static versions of the libraries will be looked up.
+AC_DEFUN([BOOST_STATIC],
+ [AC_ARG_ENABLE([static-boost],
+ [AS_HELP_STRING([--enable-static-boost],
+ [Prefer the static boost libraries over the shared ones [no]])],
+ [enable_static_boost=yes],
+ [enable_static_boost=no])])# BOOST_STATIC
+
+
+# BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND])
+# --------------------------------------------------------------------------
+# Wrapper around AC_CHECK_HEADER for Boost headers. Useful to check for
+# some parts of the Boost library which are only made of headers and don't
+# require linking (such as Boost.Foreach).
+#
+# Default ACTION-IF-NOT-FOUND: Fail with a fatal error unless Boost couldn't be
+# found in the first place, in which case by default a notice is issued to the
+# user. Presumably if we haven't died already it's because it's OK to not have
+# Boost, which is why only a notice is issued instead of a hard error.
+#
+# Default ACTION-IF-FOUND: define the preprocessor symbol HAVE_<HEADER-NAME> in
+# case of success # (where HEADER-NAME is written LIKE_THIS, e.g.,
+# HAVE_BOOST_FOREACH_HPP).
+AC_DEFUN([BOOST_FIND_HEADER],
+[AC_REQUIRE([BOOST_REQUIRE])dnl
+if test x"$boost_cv_inc_path" = xno; then
+ m4_default([$2], [AC_MSG_NOTICE([Boost not available, not searching for $1])])
+else
+AC_LANG_PUSH([C++])dnl
+boost_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+AC_CHECK_HEADER([$1],
+ [m4_default([$3], [AC_DEFINE(AS_TR_CPP([HAVE_$1]), [1],
+ [Define to 1 if you have <$1>])])],
+ [m4_default([$2], [AC_MSG_ERROR([cannot find $1])])])
+CPPFLAGS=$boost_save_CPPFLAGS
+AC_LANG_POP([C++])dnl
+fi
+])# BOOST_FIND_HEADER
+
+
+# BOOST_FIND_LIBS([COMPONENT-NAME], [CANDIDATE-LIB-NAMES],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Look for the Boost library COMPONENT-NAME (e.g., `thread', for
+# libboost_thread) under the possible CANDIDATE-LIB-NAMES (e.g.,
+# "thread_win32 thread"). Check that HEADER-NAME works and check that
+# libboost_LIB-NAME can link with the code CXX-TEST. The optional
+# argument CXX-PROLOGUE can be used to include some C++ code before
+# the `main' function.
+#
+# Invokes BOOST_FIND_HEADER([HEADER-NAME]) (see above).
+#
+# Boost libraries typically come compiled with several flavors (with different
+# runtime options) so PREFERRED-RT-OPT is the preferred suffix. A suffix is one
+# or more of the following letters: sgdpn (in that order). s = static
+# runtime, d = debug build, g = debug/diagnostic runtime, p = STLPort build,
+# n = (unsure) STLPort build without iostreams from STLPort (it looks like `n'
+# must always be used along with `p'). Additionally, PREFERRED-RT-OPT can
+# start with `mt-' to indicate that there is a preference for multi-thread
+# builds. Some sample values for PREFERRED-RT-OPT: (nothing), mt, d, mt-d, gdp
+# ... If you want to make sure you have a specific version of Boost
+# (eg, >= 1.33) you *must* invoke BOOST_REQUIRE before this macro.
+AC_DEFUN([BOOST_FIND_LIBS],
+[AC_REQUIRE([BOOST_REQUIRE])dnl
+AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl
+AC_REQUIRE([BOOST_STATIC])dnl
+AC_REQUIRE([_BOOST_GUESS_WHETHER_TO_USE_MT])dnl
+if test x"$boost_cv_inc_path" = xno; then
+ AC_MSG_NOTICE([Boost not available, not searching for the Boost $1 library])
+else
+dnl The else branch is huge and wasn't intended on purpose.
+AC_LANG_PUSH([C++])dnl
+AS_VAR_PUSHDEF([Boost_lib], [boost_cv_lib_$1])dnl
+AS_VAR_PUSHDEF([Boost_lib_LDFLAGS], [boost_cv_lib_$1_LDFLAGS])dnl
+AS_VAR_PUSHDEF([Boost_lib_LDPATH], [boost_cv_lib_$1_LDPATH])dnl
+AS_VAR_PUSHDEF([Boost_lib_LIBS], [boost_cv_lib_$1_LIBS])dnl
+BOOST_FIND_HEADER([$4])
+boost_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib],
+ [_BOOST_FIND_LIBS($@)])
+case $Boost_lib in #(
+ (no) _AC_MSG_LOG_CONFTEST
+ AC_MSG_ERROR([cannot find the flags to link with Boost $1])
+ ;;
+esac
+AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS])dnl
+AC_SUBST(AS_TR_CPP([BOOST_$1_LDPATH]), [$Boost_lib_LDPATH])dnl
+AC_SUBST([BOOST_LDPATH], [$Boost_lib_LDPATH])dnl
+AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS])dnl
+CPPFLAGS=$boost_save_CPPFLAGS
+AS_VAR_POPDEF([Boost_lib])dnl
+AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl
+AS_VAR_POPDEF([Boost_lib_LDPATH])dnl
+AS_VAR_POPDEF([Boost_lib_LIBS])dnl
+AC_LANG_POP([C++])dnl
+fi
+])
+
+
+# BOOST_FIND_LIB([LIB-NAME],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Backward compatibility wrapper for BOOST_FIND_LIBS.
+AC_DEFUN([BOOST_FIND_LIB],
+[BOOST_FIND_LIBS([$1], $@)])
+
+
+# _BOOST_FIND_LIBS([LIB-NAME], [CANDIDATE-LIB-NAMES],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE])
+# --------------------------------------------------------------
+# Real implementation of BOOST_FIND_LIBS: rely on these local macros:
+# Boost_lib, Boost_lib_LDFLAGS, Boost_lib_LDPATH, Boost_lib_LIBS
+#
+# The algorithm is as follows: first look for a given library name
+# according to the user's PREFERRED-RT-OPT. For each library name, we
+# prefer to use the ones that carry the tag (toolset name). Each
+# library is searched through the various standard paths were Boost is
+# usually installed. If we can't find the standard variants, we try
+# to enforce -mt (for instance on MacOSX, libboost_thread.dylib
+# doesn't exist but there's -obviously- libboost_thread-mt.dylib).
+AC_DEFUN([_BOOST_FIND_LIBS],
+[Boost_lib=no
+ case "$3" in #(
+ (mt | mt-) boost_mt=-mt; boost_rtopt=;; #(
+ (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$3" : 'Xmt-*\(.*\)'`;; #(
+ (*) boost_mt=; boost_rtopt=$3;;
+ esac
+ if test $enable_static_boost = yes; then
+ boost_rtopt="s$boost_rtopt"
+ fi
+ # Find the proper debug variant depending on what we've been asked to find.
+ case $boost_rtopt in #(
+ (*d*) boost_rt_d=$boost_rtopt;; #(
+ (*[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn')
+ boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #(
+ (*) boost_rt_d='-d';;
+ esac
+ # If the PREFERRED-RT-OPT are not empty, prepend a `-'.
+ test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt"
+ $boost_guess_use_mt && boost_mt=-mt
+ # Look for the abs path the static archive.
+ # $libext is computed by Libtool but let's make sure it's non empty.
+ test -z "$libext" &&
+ AC_MSG_ERROR([the libext variable is empty, did you invoke Libtool?])
+ boost_save_ac_objext=$ac_objext
+ # Generate the test file.
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$4>
+$6], [$5])])
+dnl Optimization hacks: compiling C++ is slow, especially with Boost. What
+dnl we're trying to do here is guess the right combination of link flags
+dnl (LIBS / LDFLAGS) to use a given library. This can take several
+dnl iterations before it succeeds and is thus *very* slow. So what we do
+dnl instead is that we compile the code first (and thus get an object file,
+dnl typically conftest.o). Then we try various combinations of link flags
+dnl until we succeed to link conftest.o in an executable. The problem is
+dnl that the various TRY_LINK / COMPILE_IFELSE macros of Autoconf always
+dnl remove all the temporary files including conftest.o. So the trick here
+dnl is to temporarily change the value of ac_objext so that conftest.o is
+dnl preserved accross tests. This is obviously fragile and I will burn in
+dnl hell for not respecting Autoconf's documented interfaces, but in the
+dnl mean time, it optimizes the macro by a factor of 5 to 30.
+dnl Another small optimization: the first argument of AC_COMPILE_IFELSE left
+dnl empty because the test file is generated only once above (before we
+dnl start the for loops).
+ AC_COMPILE_IFELSE([],
+ [ac_objext=do_not_rm_me_plz],
+ [AC_MSG_ERROR([cannot compile a test that uses Boost $1])])
+ ac_objext=$boost_save_ac_objext
+ boost_failed_libs=
+# Don't bother to ident the following nested for loops, only the 2
+# innermost ones matter.
+for boost_lib_ in $2; do
+for boost_tag_ in -$boost_cv_lib_tag ''; do
+for boost_ver_ in -$boost_cv_lib_version ''; do
+for boost_mt_ in $boost_mt -mt ''; do
+for boost_rtopt_ in $boost_rtopt '' -d; do
+ for boost_lib in \
+ boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \
+ boost_$boost_lib_$boost_tag_$boost_ver_
+ do
+ # Avoid testing twice the same lib
+ case $boost_failed_libs in #(
+ (*@$boost_lib@*) continue;;
+ esac
+ # If with_boost is empty, we'll search in /lib first, which is not quite
+ # right so instead we'll try to a location based on where the headers are.
+ boost_tmp_lib=$with_boost
+ test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include}
+ for boost_ldpath in "$boost_tmp_lib/lib" '' \
+ /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \
+ "$with_boost" C:/Boost/lib /lib*
+ do
+ # Don't waste time with directories that don't exist.
+ if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then
+ continue
+ fi
+ boost_save_LDFLAGS=$LDFLAGS
+ # Are we looking for a static library?
+ case $boost_ldpath:$boost_rtopt_ in #(
+ (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt)
+ Boost_lib_LIBS="$boost_ldpath/lib$boost_lib.$libext"
+ test -e "$Boost_lib_LIBS" || continue;; #(
+ (*) # No: use -lboost_foo to find the shared library.
+ Boost_lib_LIBS="-l$boost_lib";;
+ esac
+ boost_save_LIBS=$LIBS
+ LIBS="$Boost_lib_LIBS $LIBS"
+ test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath"
+dnl First argument of AC_LINK_IFELSE left empty because the test file is
+dnl generated only once above (before we start the for loops).
+ _BOOST_AC_LINK_IFELSE([],
+ [Boost_lib=yes], [Boost_lib=no])
+ ac_objext=$boost_save_ac_objext
+ LDFLAGS=$boost_save_LDFLAGS
+ LIBS=$boost_save_LIBS
+ if test x"$Boost_lib" = xyes; then
+ # Check or used cached result of whether or not using -R or
+ # -rpath makes sense. Some implementations of ld, such as for
+ # Mac OSX, require -rpath but -R is the flag known to work on
+ # other systems. https://github.com/tsuna/boost.m4/issues/19
+ AC_CACHE_VAL([boost_cv_rpath_link_ldflag],
+ [case $boost_ldpath in
+ '') # Nothing to do.
+ boost_cv_rpath_link_ldflag=
+ boost_rpath_link_ldflag_found=yes;;
+ *)
+ for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do
+ LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
+ LIBS="$boost_save_LIBS $Boost_lib_LIBS"
+ _BOOST_AC_LINK_IFELSE([],
+ [boost_rpath_link_ldflag_found=yes
+ break],
+ [boost_rpath_link_ldflag_found=no])
+ done
+ ;;
+ esac
+ AS_IF([test "x$boost_rpath_link_ldflag_found" != "xyes"],
+ [AC_MSG_ERROR([Unable to determine whether to use -R or -rpath])])
+ LDFLAGS=$boost_save_LDFLAGS
+ LIBS=$boost_save_LIBS
+ ])
+ test x"$boost_ldpath" != x &&
+ Boost_lib_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
+ Boost_lib_LDPATH="$boost_ldpath"
+ break 7
+ else
+ boost_failed_libs="$boost_failed_libs@$boost_lib@"
+ fi
+ done
+ done
+done
+done
+done
+done
+done # boost_lib_
+rm -f conftest.$ac_objext
+])
+
+
+
+# --------------------------------------- #
+# Checks for the various Boost libraries. #
+# --------------------------------------- #
+
+# List of boost libraries: http://www.boost.org/libs/libraries.htm
+# The page http://beta.boost.org/doc/libs is useful: it gives the first release
+# version of each library (among other things).
+
+# BOOST_DEFUN(LIBRARY, CODE)
+# --------------------------
+# Define BOOST_<LIBRARY-UPPERCASE> as a macro that runs CODE.
+#
+# Use indir to avoid the warning on underquoted macro name given to AC_DEFUN.
+m4_define([BOOST_DEFUN],
+[m4_indir([AC_DEFUN],
+ m4_toupper([BOOST_$1]),
+[m4_pushdef([BOOST_Library], [$1])dnl
+$2
+m4_popdef([BOOST_Library])dnl
+])
+])
+
+# BOOST_ARRAY()
+# -------------
+# Look for Boost.Array
+BOOST_DEFUN([Array],
+[BOOST_FIND_HEADER([boost/array.hpp])])
+
+
+# BOOST_ASIO()
+# ------------
+# Look for Boost.Asio (new in Boost 1.35).
+BOOST_DEFUN([Asio],
+[AC_REQUIRE([BOOST_SYSTEM])dnl
+BOOST_FIND_HEADER([boost/asio.hpp])])
+
+
+# BOOST_BIND()
+# ------------
+# Look for Boost.Bind.
+BOOST_DEFUN([Bind],
+[BOOST_FIND_HEADER([boost/bind.hpp])])
+
+
+# BOOST_CHRONO()
+# --------------
+# Look for Boost.Chrono.
+BOOST_DEFUN([Chrono],
+[# Do we have to check for Boost.System? This link-time dependency was
+# added as of 1.35.0. If we have a version <1.35, we must not attempt to
+# find Boost.System as it didn't exist by then.
+if test $boost_major_version -ge 135; then
+ BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+boost_filesystem_save_LIBS=$LIBS
+boost_filesystem_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([chrono], [$1],
+ [boost/chrono.hpp],
+ [boost::chrono::thread_clock d;])
+if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
+ BOOST_CHRONO_LIBS="$BOOST_CHRONO_LIBS $BOOST_SYSTEM_LIBS"
+fi
+LIBS=$boost_filesystem_save_LIBS
+LDFLAGS=$boost_filesystem_save_LDFLAGS
+])# BOOST_CHRONO
+
+
+# BOOST_CONTEXT([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Context. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+#
+# * This library was introduced in Boost 1.51.0
+# * The signatures of make_fcontext() and jump_fcontext were changed in 1.56.0
+# * A dependency on boost_thread appears in 1.57.0
+BOOST_DEFUN([Context],
+[boost_context_save_LIBS=$LIBS
+ boost_context_save_LDFLAGS=$LDFLAGS
+if test $boost_major_version -ge 157; then
+ BOOST_THREAD([$1])
+ m4_pattern_allow([^BOOST_THREAD_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_THREAD_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_THREAD_LDFLAGS"
+fi
+BOOST_FIND_LIB([context], [$1],
+ [boost/context/all.hpp],[[
+
+// creates a stack
+void * stack_pointer = new void*[4096];
+std::size_t const size = sizeof(void*[4096]);
+
+#if BOOST_VERSION <= 105100
+ctx::make_fcontext(&fc, f);
+return ctx::jump_fcontext(&fcm, &fc, 3) == 6;
+
+#else
+
+fc = ctx::make_fcontext(stack_pointer, size, f);
+return ctx::jump_fcontext(&fcm, fc, 3) == 6;
+
+#endif
+
+
+]],[dnl
+
+#include <boost/version.hpp>
+#if BOOST_VERSION <= 105100
+
+namespace ctx = boost::ctx;
+
+static ctx::fcontext_t fcm, fc;
+
+static void f(intptr_t i) {
+ ctx::jump_fcontext(&fc, &fcm, i * 2);
+}
+
+#elif BOOST_VERSION <= 105500
+
+namespace ctx = boost::context;
+
+// context
+static ctx::fcontext_t fcm, *fc;
+
+// context-function
+static void f(intptr_t i) {
+ ctx::jump_fcontext(fc, &fcm, i * 2);
+}
+
+#else
+
+namespace ctx = boost::context;
+
+// context
+static ctx::fcontext_t fcm, fc;
+
+// context-function
+static void f(intptr_t i) {
+ ctx::jump_fcontext(&fc, fcm, i * 2);
+}
+#endif
+])
+LIBS=$boost_context_save_LIBS
+LDFLAGS=$boost_context_save_LDFLAGS
+])# BOOST_CONTEXT
+
+
+# BOOST_CONVERSION()
+# ------------------
+# Look for Boost.Conversion (cast / lexical_cast)
+BOOST_DEFUN([Conversion],
+[BOOST_FIND_HEADER([boost/cast.hpp])
+BOOST_FIND_HEADER([boost/lexical_cast.hpp])
+])# BOOST_CONVERSION
+
+
+# BOOST_COROUTINE([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Coroutine. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. This library was introduced in Boost
+# 1.53.0
+BOOST_DEFUN([Coroutine],
+[
+boost_coroutine_save_LIBS=$LIBS
+boost_coroutine_save_LDFLAGS=$LDFLAGS
+# Link-time dependency from coroutine to context
+BOOST_CONTEXT([$1])
+# Starting from Boost 1.55 a dependency on Boost.System is added
+if test $boost_major_version -ge 155; then
+ BOOST_SYSTEM([$1])
+fi
+m4_pattern_allow([^BOOST_(CONTEXT|SYSTEM)_(LIBS|LDFLAGS)])
+LIBS="$LIBS $BOOST_CONTEXT_LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_CONTEXT_LDFLAGS"
+
+# in 1.53 coroutine was a header only library
+if test $boost_major_version -eq 153; then
+ BOOST_FIND_HEADER([boost/coroutine/coroutine.hpp])
+else
+ BOOST_FIND_LIB([coroutine], [$1],
+ [boost/coroutine/coroutine.hpp],
+ [
+ #include <boost/version.hpp>
+ #if BOOST_VERSION <= 105500
+ boost::coroutines::coroutine<int(int)> coro; coro.get();
+ #else
+ boost::coroutines::asymmetric_coroutine<int>::pull_type coro; coro.get();
+ #endif
+ ])
+fi
+# Link-time dependency from coroutine to context, existed only in 1.53, in 1.54
+# coroutine doesn't use context from its headers but from its library.
+if test $boost_major_version -eq 153 || test $enable_static_boost = yes && test $boost_major_version -ge 154; then
+ BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_CONTEXT_LIBS"
+ BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_CONTEXT_LDFLAGS"
+fi
+if test $enable_static_boost = yes && test $boost_major_version -ge 155; then
+ BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_SYSTEM_LIBS"
+ BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+fi
+LIBS=$boost_coroutine_save_LIBS
+LDFLAGS=$boost_coroutine_save_LDFLAGS
+])# BOOST_COROUTINE
+
+
+# BOOST_CRC()
+# -----------
+# Look for Boost.CRC
+BOOST_DEFUN([CRC],
+[BOOST_FIND_HEADER([boost/crc.hpp])
+])# BOOST_CRC
+
+
+# BOOST_DATE_TIME([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Date_Time. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Date_Time],
+[BOOST_FIND_LIB([date_time], [$1],
+ [boost/date_time/posix_time/posix_time.hpp],
+ [boost::posix_time::ptime t;])
+])# BOOST_DATE_TIME
+
+
+# BOOST_FILESYSTEM([PREFERRED-RT-OPT])
+# ------------------------------------
+# Look for Boost.Filesystem. For the documentation of PREFERRED-RT-OPT, see
+# the documentation of BOOST_FIND_LIB above.
+# Do not check for boost/filesystem.hpp because this file was introduced in
+# 1.34.
+BOOST_DEFUN([Filesystem],
+[# Do we have to check for Boost.System? This link-time dependency was
+# added as of 1.35.0. If we have a version <1.35, we must not attempt to
+# find Boost.System as it didn't exist by then.
+if test $boost_major_version -ge 135; then
+ BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+boost_filesystem_save_LIBS=$LIBS
+boost_filesystem_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([filesystem], [$1],
+ [boost/filesystem/path.hpp], [boost::filesystem::path p;])
+if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
+ BOOST_FILESYSTEM_LIBS="$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"
+fi
+LIBS=$boost_filesystem_save_LIBS
+LDFLAGS=$boost_filesystem_save_LDFLAGS
+])# BOOST_FILESYSTEM
+
+
+# BOOST_FLYWEIGHT()
+# -----------------
+# Look for Boost.Flyweight.
+BOOST_DEFUN([Flyweight],
+[dnl There's a hidden dependency on pthreads.
+AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
+BOOST_FIND_HEADER([boost/flyweight.hpp])
+AC_SUBST([BOOST_FLYWEIGHT_LIBS], [$boost_cv_pthread_flag])
+])
+
+
+# BOOST_FOREACH()
+# ---------------
+# Look for Boost.Foreach.
+BOOST_DEFUN([Foreach],
+[BOOST_FIND_HEADER([boost/foreach.hpp])])
+
+
+# BOOST_FORMAT()
+# --------------
+# Look for Boost.Format.
+# Note: we can't check for boost/format/format_fwd.hpp because the header isn't
+# standalone. It can't be compiled because it triggers the following error:
+# boost/format/detail/config_macros.hpp:88: error: 'locale' in namespace 'std'
+# does not name a type
+BOOST_DEFUN([Format],
+[BOOST_FIND_HEADER([boost/format.hpp])])
+
+
+# BOOST_FUNCTION()
+# ----------------
+# Look for Boost.Function
+BOOST_DEFUN([Function],
+[BOOST_FIND_HEADER([boost/function.hpp])])
+
+
+# BOOST_GEOMETRY()
+# ----------------
+# Look for Boost.Geometry (new since 1.47.0).
+BOOST_DEFUN([Geometry],
+[BOOST_FIND_HEADER([boost/geometry.hpp])
+])# BOOST_GEOMETRY
+
+
+# BOOST_GRAPH([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost.Graphs. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Graph],
+[boost_graph_save_LIBS=$LIBS
+boost_graph_save_LDFLAGS=$LDFLAGS
+# Link-time dependency from graph to regex was added as of 1.40.0.
+if test $boost_major_version -ge 140; then
+ BOOST_REGEX([$1])
+ m4_pattern_allow([^BOOST_REGEX_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_REGEX_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_REGEX_LDFLAGS"
+fi
+BOOST_FIND_LIB([graph], [$1],
+ [boost/graph/adjacency_list.hpp], [boost::adjacency_list<> g;])
+LIBS=$boost_graph_save_LIBS
+LDFLAGS=$boost_graph_save_LDFLAGS
+])# BOOST_GRAPH
+
+
+# BOOST_IOSTREAMS([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.IOStreams. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([IOStreams],
+[BOOST_FIND_LIB([iostreams], [$1],
+ [boost/iostreams/device/file_descriptor.hpp],
+ [boost::iostreams::file_descriptor fd; fd.close();])
+])# BOOST_IOSTREAMS
+
+
+# BOOST_HASH()
+# ------------
+# Look for Boost.Functional/Hash
+BOOST_DEFUN([Hash],
+[BOOST_FIND_HEADER([boost/functional/hash.hpp])])
+
+
+# BOOST_LAMBDA()
+# --------------
+# Look for Boost.Lambda
+BOOST_DEFUN([Lambda],
+[BOOST_FIND_HEADER([boost/lambda/lambda.hpp])])
+
+
+# BOOST_LOCALE()
+# --------------
+# Look for Boost.Locale
+BOOST_DEFUN([Locale],
+[
+boost_locale_save_LIBS=$LIBS
+boost_locale_save_LDFLAGS=$LDFLAGS
+# require SYSTEM for boost-1.50.0 and up
+if test $boost_major_version -ge 150; then
+ BOOST_SYSTEM([$1])
+ m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+fi # end of the Boost.System check.
+BOOST_FIND_LIB([locale], [$1],
+ [boost/locale.hpp],
+ [[boost::locale::generator gen; std::locale::global(gen(""));]])
+LIBS=$boost_locale_save_LIBS
+LDFLAGS=$boost_locale_save_LDFLAGS
+])# BOOST_LOCALE
+
+# BOOST_LOG([PREFERRED-RT-OPT])
+# -----------------------------
+# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Log],
+[boost_log_save_LIBS=$LIBS
+boost_log_save_LDFLAGS=$LDFLAGS
+BOOST_SYSTEM([$1])
+BOOST_FILESYSTEM([$1])
+BOOST_DATE_TIME([$1])
+m4_pattern_allow([^BOOST_(SYSTEM|FILESYSTEM|DATE_TIME)_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_DATE_TIME_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_DATE_TIME_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([log], [$1],
+ [boost/log/core/core.hpp],
+ [boost::log::attribute a; a.get_value();])
+LIBS=$boost_log_save_LIBS
+LDFLAGS=$boost_log_save_LDFLAGS
+])# BOOST_LOG
+
+
+# BOOST_LOG_SETUP([PREFERRED-RT-OPT])
+# -----------------------------------
+# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Log_Setup],
+[boost_log_setup_save_LIBS=$LIBS
+boost_log_setup_save_LDFLAGS=$LDFLAGS
+BOOST_LOG([$1])
+m4_pattern_allow([^BOOST_LOG_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_LOG_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_LOG_LDFLAGS"
+BOOST_FIND_LIB([log_setup], [$1],
+ [boost/log/utility/setup/from_settings.hpp],
+ [boost::log::basic_settings<char> bs; bs.empty();])
+LIBS=$boost_log_setup_save_LIBS
+LDFLAGS=$boost_log_setup_save_LDFLAGS
+])# BOOST_LOG_SETUP
+
+
+# BOOST_MATH()
+# ------------
+# Look for Boost.Math
+# TODO: This library isn't header-only but it comes in multiple different
+# flavors that don't play well with BOOST_FIND_LIB (e.g, libboost_math_c99,
+# libboost_math_c99f, libboost_math_c99l, libboost_math_tr1,
+# libboost_math_tr1f, libboost_math_tr1l). This macro must be fixed to do the
+# right thing anyway.
+BOOST_DEFUN([Math],
+[BOOST_FIND_HEADER([boost/math/special_functions.hpp])])
+
+
+# BOOST_MPI([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost MPI. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. Uses MPICXX variable if it is
+# set, otherwise tries CXX
+#
+BOOST_DEFUN([MPI],
+[boost_save_CXX=${CXX}
+boost_save_CXXCPP=${CXXCPP}
+if test x"${MPICXX}" != x; then
+ CXX=${MPICXX}
+ CXXCPP="${MPICXX} -E"
+fi
+BOOST_FIND_LIB([mpi], [$1],
+ [boost/mpi.hpp],
+ [int argc = 0;
+ char **argv = 0;
+ boost::mpi::environment env(argc,argv);])
+CXX=${boost_save_CXX}
+CXXCPP=${boost_save_CXXCPP}
+])# BOOST_MPI
+
+
+# BOOST_MULTIARRAY()
+# ------------------
+# Look for Boost.MultiArray
+BOOST_DEFUN([MultiArray],
+[BOOST_FIND_HEADER([boost/multi_array.hpp])])
+
+
+# BOOST_NUMERIC_UBLAS()
+# --------------------------
+# Look for Boost.NumericUblas (Basic Linear Algebra)
+BOOST_DEFUN([Numeric_Ublas],
+[BOOST_FIND_HEADER([boost/numeric/ublas/vector.hpp])
+])# BOOST_NUMERIC_UBLAS
+
+
+# BOOST_NUMERIC_CONVERSION()
+# --------------------------
+# Look for Boost.NumericConversion (policy-based numeric conversion)
+BOOST_DEFUN([Numeric_Conversion],
+[BOOST_FIND_HEADER([boost/numeric/conversion/converter.hpp])
+])# BOOST_NUMERIC_CONVERSION
+
+
+# BOOST_OPTIONAL()
+# ----------------
+# Look for Boost.Optional
+BOOST_DEFUN([Optional],
+[BOOST_FIND_HEADER([boost/optional.hpp])])
+
+
+# BOOST_PREPROCESSOR()
+# --------------------
+# Look for Boost.Preprocessor
+BOOST_DEFUN([Preprocessor],
+[BOOST_FIND_HEADER([boost/preprocessor/repeat.hpp])])
+
+
+# BOOST_RANGE()
+# --------------------
+# Look for Boost.Range
+BOOST_DEFUN([Range],
+[BOOST_FIND_HEADER([boost/range/adaptors.hpp])])
+
+# BOOST_UNORDERED()
+# -----------------
+# Look for Boost.Unordered
+BOOST_DEFUN([Unordered],
+[BOOST_FIND_HEADER([boost/unordered_map.hpp])])
+
+
+# BOOST_UUID()
+# ------------
+# Look for Boost.Uuid
+BOOST_DEFUN([Uuid],
+[BOOST_FIND_HEADER([boost/uuid/uuid.hpp])])
+
+
+# BOOST_PROGRAM_OPTIONS([PREFERRED-RT-OPT])
+# -----------------------------------------
+# Look for Boost.Program_options. For the documentation of PREFERRED-RT-OPT,
+# see the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Program_Options],
+[BOOST_FIND_LIB([program_options], [$1],
+ [boost/program_options.hpp],
+ [boost::program_options::options_description d("test");])
+])# BOOST_PROGRAM_OPTIONS
+
+
+
+# _BOOST_PYTHON_CONFIG(VARIABLE, FLAG)
+# ------------------------------------
+# Save VARIABLE, and define it via `python-config --FLAG`.
+# Substitute BOOST_PYTHON_VARIABLE.
+m4_define([_BOOST_PYTHON_CONFIG],
+[AC_SUBST([BOOST_PYTHON_$1],
+ [`python-config --$2 2>/dev/null`])dnl
+boost_python_save_$1=$$1
+$1="$$1 $BOOST_PYTHON_$1"])
+
+
+# BOOST_PYTHON([PREFERRED-RT-OPT])
+# --------------------------------
+# Look for Boost.Python. For the documentation of PREFERRED-RT-OPT,
+# see the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Python],
+[_BOOST_PYTHON_CONFIG([CPPFLAGS], [includes])
+_BOOST_PYTHON_CONFIG([LDFLAGS], [ldflags])
+_BOOST_PYTHON_CONFIG([LIBS], [libs])
+m4_pattern_allow([^BOOST_PYTHON_MODULE$])dnl
+BOOST_FIND_LIBS([python], [python python3], [$1],
+ [boost/python.hpp],
+ [], [BOOST_PYTHON_MODULE(empty) {}])
+CPPFLAGS=$boost_python_save_CPPFLAGS
+LDFLAGS=$boost_python_save_LDFLAGS
+LIBS=$boost_python_save_LIBS
+])# BOOST_PYTHON
+
+
+# BOOST_REF()
+# -----------
+# Look for Boost.Ref
+BOOST_DEFUN([Ref],
+[BOOST_FIND_HEADER([boost/ref.hpp])])
+
+
+# BOOST_REGEX([PREFERRED-RT-OPT])
+# -------------------------------
+# Look for Boost.Regex. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Regex],
+[BOOST_FIND_LIB([regex], [$1],
+ [boost/regex.hpp],
+ [boost::regex exp("*"); boost::regex_match("foo", exp);])
+])# BOOST_REGEX
+
+
+# BOOST_SERIALIZATION([PREFERRED-RT-OPT])
+# ---------------------------------------
+# Look for Boost.Serialization. For the documentation of PREFERRED-RT-OPT, see
+# the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Serialization],
+[BOOST_FIND_LIB([serialization], [$1],
+ [boost/archive/text_oarchive.hpp],
+ [std::ostream* o = 0; // Cheap way to get an ostream...
+ boost::archive::text_oarchive t(*o);])
+])# BOOST_SERIALIZATION
+
+
+# BOOST_SIGNALS([PREFERRED-RT-OPT])
+# ---------------------------------
+# Look for Boost.Signals. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Signals],
+[BOOST_FIND_LIB([signals], [$1],
+ [boost/signal.hpp],
+ [boost::signal<void ()> s;])
+])# BOOST_SIGNALS
+
+
+# BOOST_SIGNALS2()
+# ----------------
+# Look for Boost.Signals2 (new since 1.39.0).
+BOOST_DEFUN([Signals2],
+[BOOST_FIND_HEADER([boost/signals2.hpp])
+])# BOOST_SIGNALS2
+
+
+# BOOST_SMART_PTR()
+# -----------------
+# Look for Boost.SmartPtr
+BOOST_DEFUN([Smart_Ptr],
+[BOOST_FIND_HEADER([boost/scoped_ptr.hpp])
+BOOST_FIND_HEADER([boost/shared_ptr.hpp])
+])
+
+
+# BOOST_STATICASSERT()
+# --------------------
+# Look for Boost.StaticAssert
+BOOST_DEFUN([StaticAssert],
+[BOOST_FIND_HEADER([boost/static_assert.hpp])])
+
+
+# BOOST_STRING_ALGO()
+# -------------------
+# Look for Boost.StringAlgo
+BOOST_DEFUN([String_Algo],
+[BOOST_FIND_HEADER([boost/algorithm/string.hpp])
+])
+
+
+# BOOST_SYSTEM([PREFERRED-RT-OPT])
+# --------------------------------
+# Look for Boost.System. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. This library was introduced in Boost
+# 1.35.0.
+BOOST_DEFUN([System],
+[BOOST_FIND_LIB([system], [$1],
+ [boost/system/error_code.hpp],
+ [boost::system::error_code e; e.clear();])
+])# BOOST_SYSTEM
+
+
+# BOOST_TEST([PREFERRED-RT-OPT])
+# ------------------------------
+# Look for Boost.Test. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Test],
+[m4_pattern_allow([^BOOST_CHECK$])dnl
+BOOST_FIND_LIB([unit_test_framework], [$1],
+ [boost/test/unit_test.hpp], [BOOST_CHECK(2 == 2);],
+ [using boost::unit_test::test_suite;
+ test_suite* init_unit_test_suite(int argc, char ** argv)
+ { return NULL; }])
+])# BOOST_TEST
+
+
+# BOOST_THREAD([PREFERRED-RT-OPT])
+# ---------------------------------
+# Look for Boost.Thread. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Thread],
+[dnl Having the pthread flag is required at least on GCC3 where
+dnl boost/thread.hpp would complain if we try to compile without
+dnl -pthread on GNU/Linux.
+AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
+boost_thread_save_LIBS=$LIBS
+boost_thread_save_LDFLAGS=$LDFLAGS
+boost_thread_save_CPPFLAGS=$CPPFLAGS
+# Link-time dependency from thread to system was added as of 1.49.0.
+if test $boost_major_version -ge 149; then
+BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+CPPFLAGS="$CPPFLAGS $boost_cv_pthread_flag"
+
+# When compiling for the Windows platform, the threads library is named
+# differently. This suffix doesn't exist in new versions of Boost, or
+# possibly new versions of GCC on mingw I am assuming it's Boost's change for
+# now and I am setting version to 1.48, for lack of knowledge as to when this
+# change occurred.
+if test $boost_major_version -lt 148; then
+ case $host_os in
+ (*mingw*) boost_thread_lib_ext=_win32;;
+ esac
+fi
+BOOST_FIND_LIBS([thread], [thread$boost_thread_lib_ext],
+ [$1],
+ [boost/thread.hpp], [boost::thread t; boost::mutex m;])
+
+case $host_os in
+ (*mingw*) boost_thread_w32_socket_link=-lws2_32;;
+esac
+
+BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag $boost_thread_w32_socket_link"
+BOOST_THREAD_LDFLAGS="$BOOST_SYSTEM_LDFLAGS"
+BOOST_CPPFLAGS="$BOOST_CPPFLAGS $boost_cv_pthread_flag"
+LIBS=$boost_thread_save_LIBS
+LDFLAGS=$boost_thread_save_LDFLAGS
+CPPFLAGS=$boost_thread_save_CPPFLAGS
+])# BOOST_THREAD
+
+AU_ALIAS([BOOST_THREADS], [BOOST_THREAD])
+
+
+# BOOST_TOKENIZER()
+# -----------------
+# Look for Boost.Tokenizer
+BOOST_DEFUN([Tokenizer],
+[BOOST_FIND_HEADER([boost/tokenizer.hpp])])
+
+
+# BOOST_TRIBOOL()
+# ---------------
+# Look for Boost.Tribool
+BOOST_DEFUN([Tribool],
+[BOOST_FIND_HEADER([boost/logic/tribool_fwd.hpp])
+BOOST_FIND_HEADER([boost/logic/tribool.hpp])
+])
+
+
+# BOOST_TUPLE()
+# -------------
+# Look for Boost.Tuple
+BOOST_DEFUN([Tuple],
+[BOOST_FIND_HEADER([boost/tuple/tuple.hpp])])
+
+
+# BOOST_TYPETRAITS()
+# --------------------
+# Look for Boost.TypeTraits
+BOOST_DEFUN([TypeTraits],
+[BOOST_FIND_HEADER([boost/type_traits.hpp])])
+
+
+# BOOST_UTILITY()
+# ---------------
+# Look for Boost.Utility (noncopyable, result_of, base-from-member idiom,
+# etc.)
+BOOST_DEFUN([Utility],
+[BOOST_FIND_HEADER([boost/utility.hpp])])
+
+
+# BOOST_VARIANT()
+# ---------------
+# Look for Boost.Variant.
+BOOST_DEFUN([Variant],
+[BOOST_FIND_HEADER([boost/variant/variant_fwd.hpp])
+BOOST_FIND_HEADER([boost/variant.hpp])])
+
+
+# BOOST_POINTER_CONTAINER()
+# ------------------------
+# Look for Boost.PointerContainer
+BOOST_DEFUN([Pointer_Container],
+[BOOST_FIND_HEADER([boost/ptr_container/ptr_deque.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_list.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_vector.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_array.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_set.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_map.hpp])
+])# BOOST_POINTER_CONTAINER
+
+
+# BOOST_WAVE([PREFERRED-RT-OPT])
+# ------------------------------
+# NOTE: If you intend to use Wave/Spirit with thread support, make sure you
+# call BOOST_THREAD first.
+# Look for Boost.Wave. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Wave],
+[AC_REQUIRE([BOOST_FILESYSTEM])dnl
+AC_REQUIRE([BOOST_DATE_TIME])dnl
+boost_wave_save_LIBS=$LIBS
+boost_wave_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_((FILE)?SYSTEM|DATE_TIME|THREAD)_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS \
+$BOOST_THREAD_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS \
+$BOOST_DATE_TIME_LDFLAGS $BOOST_THREAD_LDFLAGS"
+BOOST_FIND_LIB([wave], [$1],
+ [boost/wave.hpp],
+ [boost::wave::token_id id; get_token_name(id);])
+LIBS=$boost_wave_save_LIBS
+LDFLAGS=$boost_wave_save_LDFLAGS
+])# BOOST_WAVE
+
+
+# BOOST_XPRESSIVE()
+# -----------------
+# Look for Boost.Xpressive (new since 1.36.0).
+BOOST_DEFUN([Xpressive],
+[BOOST_FIND_HEADER([boost/xpressive/xpressive.hpp])])
+
+
+# ----------------- #
+# Internal helpers. #
+# ----------------- #
+
+
+# _BOOST_PTHREAD_FLAG()
+# ---------------------
+# Internal helper for BOOST_THREAD. Computes boost_cv_pthread_flag
+# which must be used in CPPFLAGS and LIBS.
+#
+# Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3,
+# boost/thread.hpp will trigger a #error if -pthread isn't used:
+# boost/config/requires_threads.hpp:47:5: #error "Compiler threading support
+# is not turned on. Please set the correct command line options for
+# threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
+#
+# Based on ACX_PTHREAD: http://autoconf-archive.cryp.to/acx_pthread.html
+AC_DEFUN([_BOOST_PTHREAD_FLAG],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_LANG_PUSH([C++])dnl
+AC_CACHE_CHECK([for the flags needed to use pthreads], [boost_cv_pthread_flag],
+[ boost_cv_pthread_flag=
+ # The ordering *is* (sometimes) important. Some notes on the
+ # individual items follow:
+ # (none): in case threads are in libc; should be tried before -Kthread and
+ # other compiler flags to prevent continual compiler warnings
+ # -lpthreads: AIX (must check this before -lpthread)
+ # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+ # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+ # -llthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+ # -pthread: GNU Linux/GCC (kernel threads), BSD/GCC (userland threads)
+ # -pthreads: Solaris/GCC
+ # -mthreads: MinGW32/GCC, Lynx/GCC
+ # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+ # doesn't hurt to check since this sometimes defines pthreads too;
+ # also defines -D_REENTRANT)
+ # ... -mt is also the pthreads flag for HP/aCC
+ # -lpthread: GNU Linux, etc.
+ # --thread-safe: KAI C++
+ case $host_os in #(
+ *solaris*)
+ # On Solaris (at least, for some versions), libc contains stubbed
+ # (non-functional) versions of the pthreads routines, so link-based
+ # tests will erroneously succeed. (We need to link with -pthreads/-mt/
+ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
+ # a function called by this macro, so we could check for that, but
+ # who knows whether they'll stub that too in a future libc.) So,
+ # we'll just look for -pthreads and -lpthread first:
+ boost_pthread_flags="-pthreads -lpthread -mt -pthread";; #(
+ *)
+ boost_pthread_flags="-lpthreads -Kthread -kthread -llthread -pthread \
+ -pthreads -mthreads -lpthread --thread-safe -mt";;
+ esac
+ # Generate the test file.
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <pthread.h>],
+ [pthread_t th; pthread_join(th, 0);
+ pthread_attr_init(0); pthread_cleanup_push(0, 0);
+ pthread_create(0,0,0,0); pthread_cleanup_pop(0);])])
+ for boost_pthread_flag in '' $boost_pthread_flags; do
+ boost_pthread_ok=false
+dnl Re-use the test file already generated.
+ boost_pthreads__save_LIBS=$LIBS
+ LIBS="$LIBS $boost_pthread_flag"
+ AC_LINK_IFELSE([],
+ [if grep ".*$boost_pthread_flag" conftest.err; then
+ echo "This flag seems to have triggered warnings" >&AS_MESSAGE_LOG_FD
+ else
+ boost_pthread_ok=:; boost_cv_pthread_flag=$boost_pthread_flag
+ fi])
+ LIBS=$boost_pthreads__save_LIBS
+ $boost_pthread_ok && break
+ done
+])
+AC_LANG_POP([C++])dnl
+])# _BOOST_PTHREAD_FLAG
+
+
+# _BOOST_gcc_test(MAJOR, MINOR)
+# -----------------------------
+# Internal helper for _BOOST_FIND_COMPILER_TAG.
+m4_define([_BOOST_gcc_test],
+["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC @ gcc$1$2"])dnl
+
+# _BOOST_mingw_test(MAJOR, MINOR)
+# -----------------------------
+# Internal helper for _BOOST_FIND_COMPILER_TAG.
+m4_define([_BOOST_mingw_test],
+["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw$1$2"])dnl
+
+
+# _BOOST_FIND_COMPILER_TAG()
+# --------------------------
+# Internal. When Boost is installed without --layout=system, each library
+# filename will hold a suffix that encodes the compiler used during the
+# build. The Boost build system seems to call this a `tag'.
+AC_DEFUN([_BOOST_FIND_COMPILER_TAG],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_CACHE_CHECK([for the toolset name used by Boost for $CXX],
+ [boost_cv_lib_tag],
+[boost_cv_lib_tag=unknown
+if test x$boost_cv_inc_path != xno; then
+ AC_LANG_PUSH([C++])dnl
+ # The following tests are mostly inspired by boost/config/auto_link.hpp
+ # The list is sorted to most recent/common to oldest compiler (in order
+ # to increase the likelihood of finding the right compiler with the
+ # least number of compilation attempt).
+ # Beware that some tests are sensible to the order (for instance, we must
+ # look for MinGW before looking for GCC3).
+ # I used one compilation test per compiler with a #error to recognize
+ # each compiler so that it works even when cross-compiling (let me know
+ # if you know a better approach).
+ # Known missing tags (known from Boost's tools/build/v2/tools/common.jam):
+ # como, edg, kcc, bck, mp, sw, tru, xlc
+ # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines
+ # the same defines as GCC's).
+ for i in \
+ _BOOST_mingw_test(5, 3) \
+ _BOOST_gcc_test(5, 3) \
+ _BOOST_mingw_test(5, 2) \
+ _BOOST_gcc_test(5, 2) \
+ _BOOST_mingw_test(5, 1) \
+ _BOOST_gcc_test(5, 1) \
+ _BOOST_mingw_test(5, 0) \
+ _BOOST_gcc_test(5, 0) \
+ _BOOST_mingw_test(4, 10) \
+ _BOOST_gcc_test(4, 10) \
+ _BOOST_mingw_test(4, 9) \
+ _BOOST_gcc_test(4, 9) \
+ _BOOST_mingw_test(4, 8) \
+ _BOOST_gcc_test(4, 8) \
+ _BOOST_mingw_test(4, 7) \
+ _BOOST_gcc_test(4, 7) \
+ _BOOST_mingw_test(4, 6) \
+ _BOOST_gcc_test(4, 6) \
+ _BOOST_mingw_test(4, 5) \
+ _BOOST_gcc_test(4, 5) \
+ _BOOST_mingw_test(4, 4) \
+ _BOOST_gcc_test(4, 4) \
+ _BOOST_mingw_test(4, 3) \
+ _BOOST_gcc_test(4, 3) \
+ _BOOST_mingw_test(4, 2) \
+ _BOOST_gcc_test(4, 2) \
+ _BOOST_mingw_test(4, 1) \
+ _BOOST_gcc_test(4, 1) \
+ _BOOST_mingw_test(4, 0) \
+ _BOOST_gcc_test(4, 0) \
+ "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \
+ && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw" \
+ _BOOST_gcc_test(3, 4) \
+ _BOOST_gcc_test(3, 3) \
+ "defined _MSC_VER && _MSC_VER >= 1500 @ vc90" \
+ "defined _MSC_VER && _MSC_VER == 1400 @ vc80" \
+ _BOOST_gcc_test(3, 2) \
+ "defined _MSC_VER && _MSC_VER == 1310 @ vc71" \
+ _BOOST_gcc_test(3, 1) \
+ _BOOST_gcc_test(3, 0) \
+ "defined __BORLANDC__ @ bcb" \
+ "defined __ICC && (defined __unix || defined __unix__) @ il" \
+ "defined __ICL @ iw" \
+ "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \
+ _BOOST_gcc_test(2, 95) \
+ "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \
+ "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \
+ "defined _MSC_VER && _MSC_VER < 1300 && defined UNDER_CE @ evc4" \
+ "defined __MWERKS__ && __MWERKS__ <= 0x31FF @ cw8"
+ do
+ boost_tag_test=`expr "X$i" : 'X\([[^@]]*\) @ '`
+ boost_tag=`expr "X$i" : 'X[[^@]]* @ \(.*\)'`
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if $boost_tag_test
+/* OK */
+#else
+# error $boost_tag_test
+#endif
+]])], [boost_cv_lib_tag=$boost_tag; break], [])
+ done
+AC_LANG_POP([C++])dnl
+ case $boost_cv_lib_tag in #(
+ # Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed
+ # to "gcc41" for instance.
+ *-gcc | *'-gcc ') :;; #( Don't re-add -gcc: it's already in there.
+ gcc*)
+ boost_tag_x=
+ case $host_os in #(
+ darwin*)
+ if test $boost_major_version -ge 136; then
+ # The `x' added in r46793 of Boost.
+ boost_tag_x=x
+ fi;;
+ esac
+ # We can specify multiple tags in this variable because it's used by
+ # BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ...
+ boost_cv_lib_tag="$boost_tag_x$boost_cv_lib_tag -${boost_tag_x}gcc"
+ ;; #(
+ unknown)
+ AC_MSG_WARN([[could not figure out which toolset name to use for $CXX]])
+ boost_cv_lib_tag=
+ ;;
+ esac
+fi])dnl end of AC_CACHE_CHECK
+])# _BOOST_FIND_COMPILER_TAG
+
+
+# _BOOST_GUESS_WHETHER_TO_USE_MT()
+# --------------------------------
+# Compile a small test to try to guess whether we should favor MT (Multi
+# Thread) flavors of Boost. Sets boost_guess_use_mt accordingly.
+AC_DEFUN([_BOOST_GUESS_WHETHER_TO_USE_MT],
+[# Check whether we do better use `mt' even though we weren't ask to.
+AC_LANG_PUSH([C++])dnl
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if defined _REENTRANT || defined _MT || defined __MT__
+/* use -mt */
+#else
+# error MT not needed
+#endif
+]])], [boost_guess_use_mt=:], [boost_guess_use_mt=false])
+AC_LANG_POP([C++])dnl
+])
+
+# _BOOST_AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+# -------------------------------------------------------------------
+# Fork of _AC_LINK_IFELSE that preserves conftest.o across calls. Fragile,
+# will break when Autoconf changes its internals. Requires that you manually
+# rm -f conftest.$ac_objext in between to really different tests, otherwise
+# you will try to link a conftest.o left behind by a previous test.
+# Used to aggressively optimize BOOST_FIND_LIB (see the big comment in this
+# macro).
+#
+# Don't use "break" in the actions, as it would short-circuit some code
+# this macro runs after the actions.
+m4_define([_BOOST_AC_LINK_IFELSE],
+[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
+rm -f conftest$ac_exeext
+boost_save_ac_ext=$ac_ext
+boost_use_source=:
+# If we already have a .o, re-use it. We change $ac_ext so that $ac_link
+# tries to link the existing object file instead of compiling from source.
+test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false &&
+ _AS_ECHO_LOG([re-using the existing conftest.$ac_objext])
+AS_IF([_AC_DO_STDERR($ac_link) && {
+ test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_executable_p conftest$ac_exeext
+dnl FIXME: use AS_TEST_X instead when 2.61 is widespread enough.
+ }],
+ [$2],
+ [if $boost_use_source; then
+ _AC_MSG_LOG_CONFTEST
+ fi
+ $3])
+ac_objext=$boost_save_ac_objext
+ac_ext=$boost_save_ac_ext
+dnl Delete also the IPA/IPO (Inter Procedural Analysis/Optimization)
+dnl information created by the PGI compiler (conftest_ipa8_conftest.oo),
+dnl as it would interfere with the next link command.
+rm -f core conftest.err conftest_ipa8_conftest.oo \
+ conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl
+])# _BOOST_AC_LINK_IFELSE
+
+# Local Variables:
+# mode: autoconf
+# End:
diff --git a/org.eclipse.efm.symbex/cmake/cvc4-patch/options/options_template.cpp b/org.eclipse.efm.symbex/cmake/cvc4-patch/options/options_template.cpp
new file mode 100644
index 0000000..f1a9b6c
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/cvc4-patch/options/options_template.cpp
@@ -0,0 +1,835 @@
+/********************* */
+/*! \file options_template.cpp
+ ** \verbatim
+ ** Top contributors (to current version):
+ ** Tim King, Morgan Deters, Kshitij Bansal
+ ** This file is part of the CVC4 project.
+ ** Copyright (c) 2009-2016 by the authors listed in the file AUTHORS
+ ** in the top-level source directory) and their institutional affiliations.
+ ** All rights reserved. See the file COPYING in the top-level source
+ ** directory for licensing information.\endverbatim
+ **
+ ** \brief Contains code for handling command-line options.
+ **
+ ** Contains code for handling command-line options
+ **/
+
+#if !defined(_BSD_SOURCE) && defined(__MINGW32__) && !defined(__MINGW64__)
+// force use of optreset; mingw32 croaks on argv-switching otherwise
+# include "cvc4autoconfig.h"
+# define _BSD_SOURCE
+# undef HAVE_DECL_OPTRESET
+# define HAVE_DECL_OPTRESET 1
+# define CVC4_IS_NOT_REALLY_BSD
+#endif /* !_BSD_SOURCE && __MINGW32__ && !__MINGW64__ */
+
+#ifdef __MINGW64__
+#define _BSD_SOURCE // Needed to avoid 'optreset' error at link
+extern int optreset;
+#endif /* __MINGW64__ */
+
+#include <getopt.h>
+
+// clean up
+#ifdef CVC4_IS_NOT_REALLY_BSD
+# undef _BSD_SOURCE
+#endif /* CVC4_IS_NOT_REALLY_BSD */
+
+#include <unistd.h>
+#include <string.h>
+#include <stdint.h>
+#include <time.h>
+
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <iomanip>
+#include <new>
+#include <string>
+#include <sstream>
+#include <limits>
+
+#include "base/cvc4_assert.h"
+#include "base/exception.h"
+#include "base/output.h"
+#include "base/tls.h"
+#include "options/argument_extender.h"
+#include "options/argument_extender_implementation.h"
+#include "options/didyoumean.h"
+#include "options/language.h"
+#include "options/options_handler.h"
+
+${include_all_option_headers}
+
+#line 64 "${template}"
+
+#include "options/options_holder.h"
+#include "cvc4autoconfig.h"
+#include "options/base_handlers.h"
+
+${option_handler_includes}
+
+#line 72 "${template}"
+
+using namespace CVC4;
+using namespace CVC4::options;
+
+namespace CVC4 {
+
+CVC4_THREADLOCAL(Options*) Options::s_current = NULL;
+
+
+
+/**
+ * This is a default handler for options of built-in C++ type. This
+ * template is really just a helper for the handleOption() template,
+ * below. Variants of this template handle numeric and non-numeric,
+ * integral and non-integral, signed and unsigned C++ types.
+ * handleOption() makes sure to instantiate the right one.
+ *
+ * This implements default behavior when e.g. an option is
+ * unsigned but the user specifies a negative argument; etc.
+ */
+template <class T, bool is_numeric, bool is_integer>
+struct OptionHandler {
+ static T handle(std::string option, std::string optionarg);
+};/* struct OptionHandler<> */
+
+/** Variant for integral C++ types */
+template <class T>
+struct OptionHandler<T, true, true> {
+ static bool stringToInt(T& t, const std::string& str) {
+ std::istringstream ss(str);
+ ss >> t;
+ char tmp;
+ return !(ss.fail() || ss.get(tmp));
+ }
+
+ static bool containsMinus(const std::string& str) {
+ return str.find('-') != std::string::npos;
+ }
+
+ static T handle(const std::string& option, const std::string& optionarg) {
+ try {
+ T i;
+ bool success = stringToInt(i, optionarg);
+
+ if(!success){
+ throw OptionException(option + ": failed to parse "+ optionarg +
+ " as an integer of the appropraite type.");
+ }
+
+ // Depending in the platform unsigned numbers with '-' signs may parse.
+ // Reject these by looking for any minus if it is not signed.
+ if( (! std::numeric_limits<T>::is_signed) && containsMinus(optionarg) ) {
+ // unsigned type but user gave negative argument
+ throw OptionException(option + " requires a nonnegative argument");
+ } else if(i < std::numeric_limits<T>::min()) {
+ // negative overflow for type
+ std::stringstream ss;
+ ss << option << " requires an argument >= "
+ << std::numeric_limits<T>::min();
+ throw OptionException(ss.str());
+ } else if(i > std::numeric_limits<T>::max()) {
+ // positive overflow for type
+ std::stringstream ss;
+ ss << option << " requires an argument <= "
+ << std::numeric_limits<T>::max();
+ throw OptionException(ss.str());
+ }
+
+ return i;
+
+ // if(std::numeric_limits<T>::is_signed) {
+ // return T(i.getLong());
+ // } else {
+ // return T(i.getUnsignedLong());
+ // }
+ } catch(std::invalid_argument&) {
+ // user gave something other than an integer
+ throw OptionException(option + " requires an integer argument");
+ }
+ }
+};/* struct OptionHandler<T, true, true> */
+
+/** Variant for numeric but non-integral C++ types */
+template <class T>
+struct OptionHandler<T, true, false> {
+ static T handle(std::string option, std::string optionarg) {
+ std::stringstream in(optionarg);
+ long double r;
+ in >> r;
+ if(! in.eof()) {
+ // we didn't consume the whole string (junk at end)
+ throw OptionException(option + " requires a numeric argument");
+ }
+
+ if(! std::numeric_limits<T>::is_signed && r < 0.0) {
+ // unsigned type but user gave negative value
+ throw OptionException(option + " requires a nonnegative argument");
+ } else if(r < -std::numeric_limits<T>::max()) {
+ // negative overflow for type
+ std::stringstream ss;
+ ss << option << " requires an argument >= "
+ << -std::numeric_limits<T>::max();
+ throw OptionException(ss.str());
+ } else if(r > std::numeric_limits<T>::max()) {
+ // positive overflow for type
+ std::stringstream ss;
+ ss << option << " requires an argument <= "
+ << std::numeric_limits<T>::max();
+ throw OptionException(ss.str());
+ }
+
+ return T(r);
+ }
+};/* struct OptionHandler<T, true, false> */
+
+/** Variant for non-numeric C++ types */
+template <class T>
+struct OptionHandler<T, false, false> {
+ static T handle(std::string option, std::string optionarg) {
+ T::unsupported_handleOption_call___please_write_me;
+ // The above line causes a compiler error if this version of the template
+ // is ever instantiated (meaning that a specialization is missing). So
+ // don't worry about the segfault in the next line, the "return" is only
+ // there to keep the compiler from giving additional, distracting errors
+ // and warnings.
+ return *(T*)0;
+ }
+};/* struct OptionHandler<T, false, false> */
+
+/** Handle an option of type T in the default way. */
+template <class T>
+T handleOption(std::string option, std::string optionarg) {
+ return OptionHandler<T, std::numeric_limits<T>::is_specialized, std::numeric_limits<T>::is_integer>::handle(option, optionarg);
+}
+
+/** Handle an option of type std::string in the default way. */
+template <>
+std::string handleOption<std::string>(std::string option, std::string optionarg) {
+ return optionarg;
+}
+
+/**
+ * Run handler, and any user-given predicates, for option T.
+ * If a user specifies a :handler or :predicates, it overrides this.
+ */
+template <class T>
+typename T::type runHandlerAndPredicates(T, std::string option, std::string optionarg, options::OptionsHandler* handler) {
+ // By default, parse the option argument in a way appropriate for its type.
+ // E.g., for "unsigned int" options, ensure that the provided argument is
+ // a nonnegative integer that fits in the unsigned int type.
+
+ return handleOption<typename T::type>(option, optionarg);
+}
+
+template <class T>
+void runBoolPredicates(T, std::string option, bool b, options::OptionsHandler* handler) {
+ // By default, nothing to do for bool. Users add things with
+ // :predicate in options files to provide custom checking routines
+ // that can throw exceptions.
+}
+
+
+Options::Options()
+ : d_holder(new options::OptionsHolder())
+ , d_handler(new options::OptionsHandler(this))
+ , d_forceLogicListeners()
+ , d_beforeSearchListeners()
+ , d_tlimitListeners()
+ , d_tlimitPerListeners()
+ , d_rlimitListeners()
+ , d_rlimitPerListeners()
+{}
+
+Options::~Options() {
+ delete d_handler;
+ delete d_holder;
+}
+
+void Options::copyValues(const Options& options){
+ if(this != &options) {
+ delete d_holder;
+ d_holder = new options::OptionsHolder(*options.d_holder);
+ }
+}
+
+std::string Options::formatThreadOptionException(const std::string& option) {
+ std::stringstream ss;
+ ss << "can't understand option `" << option
+ << "': expected something like --threadN=\"--option1 --option2\","
+ << " where N is a nonnegative integer";
+ return ss.str();
+}
+
+ListenerCollection::Registration* Options::registerAndNotify(
+ ListenerCollection& collection, Listener* listener, bool notify)
+{
+ ListenerCollection::Registration* registration =
+ collection.registerListener(listener);
+ if(notify) {
+ listener->notify();
+ }
+ return registration;
+}
+
+ListenerCollection::Registration* Options::registerForceLogicListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::forceLogicString);
+ return registerAndNotify(d_forceLogicListeners, listener, notify);
+}
+
+ListenerCollection::Registration* Options::registerBeforeSearchListener(
+ Listener* listener)
+{
+ return d_beforeSearchListeners.registerListener(listener);
+}
+
+ListenerCollection::Registration* Options::registerTlimitListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet &&
+ wasSetByUser(options::cumulativeMillisecondLimit);
+ return registerAndNotify(d_tlimitListeners, listener, notify);
+}
+
+ListenerCollection::Registration* Options::registerTlimitPerListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::perCallMillisecondLimit);
+ return registerAndNotify(d_tlimitPerListeners, listener, notify);
+}
+
+ListenerCollection::Registration* Options::registerRlimitListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::cumulativeResourceLimit);
+ return registerAndNotify(d_rlimitListeners, listener, notify);
+}
+
+ListenerCollection::Registration* Options::registerRlimitPerListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::perCallResourceLimit);
+ return registerAndNotify(d_rlimitPerListeners, listener, notify);
+}
+
+ListenerCollection::Registration* Options::registerUseTheoryListListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::useTheoryList);
+ return registerAndNotify(d_useTheoryListListeners, listener, notify);
+}
+
+ListenerCollection::Registration* Options::registerSetDefaultExprDepthListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::defaultExprDepth);
+ return registerAndNotify(d_setDefaultExprDepthListeners, listener, notify);
+}
+
+ListenerCollection::Registration* Options::registerSetDefaultExprDagListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::defaultDagThresh);
+ return registerAndNotify(d_setDefaultDagThreshListeners, listener, notify);
+}
+
+ListenerCollection::Registration* Options::registerSetPrintExprTypesListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::printExprTypes);
+ return registerAndNotify(d_setPrintExprTypesListeners, listener, notify);
+}
+
+ListenerCollection::Registration* Options::registerSetDumpModeListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::dumpModeString);
+ return registerAndNotify(d_setDumpModeListeners, listener, notify);
+}
+
+ListenerCollection::Registration* Options::registerSetPrintSuccessListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::printSuccess);
+ return registerAndNotify(d_setPrintSuccessListeners, listener, notify);
+}
+
+ListenerCollection::Registration* Options::registerDumpToFileNameListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::dumpToFileName);
+ return registerAndNotify(d_dumpToFileListeners, listener, notify);
+}
+
+ListenerCollection::Registration*
+Options::registerSetRegularOutputChannelListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::regularChannelName);
+ return registerAndNotify(d_setRegularChannelListeners, listener, notify);
+}
+
+ListenerCollection::Registration*
+Options::registerSetDiagnosticOutputChannelListener(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::diagnosticChannelName);
+ return registerAndNotify(d_setDiagnosticChannelListeners, listener, notify);
+}
+
+ListenerCollection::Registration*
+Options::registerSetReplayLogFilename(
+ Listener* listener, bool notifyIfSet)
+{
+ bool notify = notifyIfSet && wasSetByUser(options::replayLogFilename);
+ return registerAndNotify(d_setReplayFilenameListeners, listener, notify);
+}
+
+${all_custom_handlers}
+
+#line 394 "${template}"
+
+#ifdef CVC4_DEBUG
+# define USE_EARLY_TYPE_CHECKING_BY_DEFAULT true
+#else /* CVC4_DEBUG */
+# define USE_EARLY_TYPE_CHECKING_BY_DEFAULT false
+#endif /* CVC4_DEBUG */
+
+#if defined(CVC4_MUZZLED) || defined(CVC4_COMPETITION_MODE)
+# define DO_SEMANTIC_CHECKS_BY_DEFAULT false
+#else /* CVC4_MUZZLED || CVC4_COMPETITION_MODE */
+# define DO_SEMANTIC_CHECKS_BY_DEFAULT true
+#endif /* CVC4_MUZZLED || CVC4_COMPETITION_MODE */
+
+options::OptionsHolder::OptionsHolder() : ${all_modules_defaults}
+{
+}
+
+#line 412 "${template}"
+
+static const std::string mostCommonOptionsDescription = "\
+Most commonly-used CVC4 options:${common_documentation}";
+
+#line 417 "${template}"
+
+static const std::string optionsDescription = mostCommonOptionsDescription + "\n\
+\n\
+Additional CVC4 options:${remaining_documentation}";
+
+#line 423 "${template}"
+
+static const std::string optionsFootnote = "\n\
+[*] Each of these options has a --no-OPTIONNAME variant, which reverses the\n\
+ sense of the option.\n\
+";
+
+static const std::string languageDescription = "\
+Languages currently supported as arguments to the -L / --lang option:\n\
+ auto attempt to automatically determine language\n\
+ cvc4 | presentation | pl CVC4 presentation language\n\
+ smt1 | smtlib1 SMT-LIB format 1.2\n\
+ smt | smtlib | smt2 |\n\
+ smt2.0 | smtlib2 | smtlib2.0 SMT-LIB format 2.0\n\
+ smt2.5 | smtlib2.5 SMT-LIB format 2.5\n\
+ smt2.6 | smtlib2.6 SMT-LIB format 2.6\n\
+ tptp TPTP format (cnf and fof)\n\
+ sygus SyGuS format\n\
+\n\
+Languages currently supported as arguments to the --output-lang option:\n\
+ auto match output language to input language\n\
+ cvc4 | presentation | pl CVC4 presentation language\n\
+ cvc3 CVC3 presentation language\n\
+ smt1 | smtlib1 SMT-LIB format 1.2\n\
+ smt | smtlib | smt2 |\n\
+ smt2.0 | smtlib2.0 | smtlib2 SMT-LIB format 2.0\n\
+ smt2.5 | smtlib2.5 SMT-LIB format 2.5\n\
+ smt2.6 | smtlib2.6 SMT-LIB format 2.6\n\
+ tptp TPTP format\n\
+ z3str SMT-LIB 2.0 with Z3-str string constraints\n\
+ ast internal format (simple syntax trees)\n\
+";
+
+std::string Options::getDescription() const {
+ return optionsDescription;
+}
+
+void Options::printUsage(const std::string msg, std::ostream& out) {
+ out << msg << optionsDescription << std::endl
+ << optionsFootnote << std::endl << std::flush;
+}
+
+void Options::printShortUsage(const std::string msg, std::ostream& out) {
+ out << msg << mostCommonOptionsDescription << std::endl
+ << optionsFootnote << std::endl
+ << "For full usage, please use --help."
+ << std::endl << std::endl << std::flush;
+}
+
+void Options::printLanguageHelp(std::ostream& out) {
+ out << languageDescription << std::flush;
+}
+
+/**
+ * This is a table of long options. By policy, each short option
+ * should have an equivalent long option (but the reverse isn't the
+ * case), so this table should thus contain all command-line options.
+ *
+ * Each option in this array has four elements:
+ *
+ * 1. the long option string
+ * 2. argument behavior for the option:
+ * no_argument - no argument permitted
+ * required_argument - an argument is expected
+ * optional_argument - an argument is permitted but not required
+ * 3. this is a pointer to an int which is set to the 4th entry of the
+ * array if the option is present; or NULL, in which case
+ * getopt_long() returns the 4th entry
+ * 4. the return value for getopt_long() when this long option (or the
+ * value to set the 3rd entry to; see #3)
+ *
+ * If you add something here, you should add it in src/main/usage.h
+ * also, to document it.
+ *
+ * If you add something that has a short option equivalent, you should
+ * add it to the getopt_long() call in parseOptions().
+ */
+static struct option cmdlineOptions[] = {${all_modules_long_options}
+ { NULL, no_argument, NULL, '\0' }
+};/* cmdlineOptions */
+
+#line 502 "${template}"
+
+// static void preemptGetopt(int& argc, char**& argv, const char* opt) {
+
+// Debug("preemptGetopt") << "preempting getopt() with " << opt << std::endl;
+
+// AlwaysAssert(opt != NULL && *opt != '\0');
+// AlwaysAssert(strlen(opt) <= maxoptlen);
+
+// ++argc;
+// unsigned i = 1;
+// while(argv[i] != NULL && argv[i][0] != '\0') {
+// ++i;
+// }
+
+// if(argv[i] == NULL) {
+// argv = (char**) realloc(argv, (i + 6) * sizeof(char*));
+// for(unsigned j = i; j < i + 5; ++j) {
+// argv[j] = (char*) malloc(sizeof(char) * maxoptlen);
+// argv[j][0] = '\0';
+// }
+// argv[i + 5] = NULL;
+// }
+
+// strncpy(argv[i], opt, maxoptlen - 1);
+// argv[i][maxoptlen - 1] = '\0'; // ensure NUL-termination even on overflow
+// }
+
+namespace options {
+
+/** Set a given Options* as "current" just for a particular scope. */
+class OptionsGuard {
+ CVC4_THREADLOCAL_TYPE(Options*)* d_field;
+ Options* d_old;
+public:
+ OptionsGuard(CVC4_THREADLOCAL_TYPE(Options*)* field, Options* opts) :
+ d_field(field),
+ d_old(*field) {
+ *field = opts;
+ }
+ ~OptionsGuard() {
+ *d_field = d_old;
+ }
+};/* class OptionsGuard */
+
+}/* CVC4::options namespace */
+
+/**
+ * Parse argc/argv and put the result into a CVC4::Options.
+ * The return value is what's left of the command line (that is, the
+ * non-option arguments).
+ */
+std::vector<std::string> Options::parseOptions(Options* options,
+ int argc, char* argv[])
+ throw(OptionException) {
+
+ Assert(options != NULL);
+ Assert(argv != NULL);
+
+ options::OptionsGuard guard(&s_current, options);
+
+ const char *progName = argv[0];
+
+ // To debug options parsing, you may prefer to simply uncomment this
+ // and recompile. Debug flags have not been parsed yet so these have
+ // not been set.
+ //DebugChannel.on("options");
+
+ Debug("options") << "Options::parseOptions == " << options << std::endl;
+ Debug("options") << "argv == " << argv << std::endl;
+
+ // Find the base name of the program.
+ const char *x = strrchr(progName, '/');
+ if(x != NULL) {
+ progName = x + 1;
+ }
+ options->d_holder->binary_name = std::string(progName);
+
+ ArgumentExtender* argumentExtender = new ArgumentExtenderImplementation();
+ for(int position = 1; position < argc; position++) {
+ argumentExtender->pushBackArgument(argv[position]);
+ }
+
+ std::vector<std::string> nonoptions;
+ parseOptionsRecursive(options, argumentExtender, &nonoptions);
+ if(Debug.isOn("options")){
+ for(std::vector<std::string>::const_iterator i = nonoptions.begin(),
+ iend = nonoptions.end(); i != iend; ++i){
+ Debug("options") << "nonoptions " << *i << std::endl;
+ }
+ }
+
+ delete argumentExtender;
+ return nonoptions;
+}
+
+void Options::parseOptionsRecursive(Options* options,
+ ArgumentExtender* extender,
+ std::vector<std::string>* nonoptions)
+ throw(OptionException) {
+
+ int argc;
+ char** argv;
+
+ extender->movePreemptionsToArguments();
+ extender->pushFrontArgument("");
+ extender->getArguments(&argc, &argv);
+
+ if(Debug.isOn("options")) {
+ Debug("options") << "starting a new parseOptionsRecursive with "
+ << argc << " arguments" << std::endl;
+ for( int i = 0; i < argc ; i++ ){
+ Assert(argv[i] != NULL);
+ Debug("options") << " argv[" << i << "] = " << argv[i] << std::endl;
+ }
+ }
+
+ // Having this synonym simplifies the generation code in mkoptions.
+ options::OptionsHandler* handler = options->d_handler;
+ options::OptionsHolder* holder = options->d_holder;
+
+ // Reset getopt(), in the case of multiple calls to parseOptions().
+ // This can be = 1 in newer GNU getopt, but older (< 2007) require = 0.
+ optind = 0;
+#if HAVE_DECL_OPTRESET
+ optreset = 1; // on BSD getopt() (e.g. Mac OS), might need this
+#endif /* HAVE_DECL_OPTRESET */
+
+
+ int main_optind = 0;
+ int old_optind;
+
+
+ while(true) { // Repeat Forever
+
+ if(extender->hasPreemptions()){
+ // Stop this round of parsing. We now parse recursively
+ // to start on a new character array for argv.
+ parseOptionsRecursive(options, extender, nonoptions);
+ break;
+ }
+
+ optopt = 0;
+ std::string option, optionarg;
+
+ optind = main_optind;
+ old_optind = main_optind;
+ //optind_ref = &main_optind;
+ //argv = main_argv;
+
+ // If we encounter an element that is not at zero and does not start
+ // with a "-", this is a non-option. We consume this element as a
+ // non-option.
+ if (main_optind > 0 && main_optind < argc &&
+ argv[main_optind][0] != '-') {
+ Debug("options") << "enqueueing " << argv[main_optind]
+ << " as a non-option." << std::endl;
+ nonoptions->push_back(argv[main_optind]);
+ ++main_optind;
+ extender->popFrontArgument();
+ continue;
+ }
+
+
+ Debug("options") << "[ before, main_optind == " << main_optind << " ]"
+ << std::endl;
+ Debug("options") << "[ before, optind == " << optind << " ]" << std::endl;
+ Debug("options") << "[ argc == " << argc << ", argv == " << argv << " ]"
+ << std::endl;
+ int c = getopt_long(argc, argv,
+ "+:${all_modules_short_options}",
+ cmdlineOptions, NULL);
+
+ while(main_optind < optind) {
+ main_optind++;
+ extender->popFrontArgument();
+ }
+
+ Debug("options") << "[ got " << int(c) << " (" << char(c) << ") ]"
+ << "[ next option will be at pos: " << optind << " ]"
+ << std::endl;
+
+ // The initial getopt_long call should always determine that argv[0]
+ // is not an option and returns -1. We always manually advance beyond
+ // this element.
+ //
+ // We have to reinitialize optind to 0 instead of 1 as we need to support
+ // changing the argv array passed to getopt.
+ // This is needed as are using GNU extensions.
+ // From: http://man7.org/linux/man-pages/man3/getopt.3.html
+ // A program that scans multiple argument vectors, or rescans the same
+ // vector more than once, and wants to make use of GNU extensions such
+ // as '+' and '-' at the start of optstring, or changes the value of
+ // POSIXLY_CORRECT between scans, must reinitialize getopt() by
+ // resetting optind to 0, rather than the traditional value of 1.
+ // (Resetting to 0 forces the invocation of an internal initialization
+ // routine that rechecks POSIXLY_CORRECT and checks for GNU extensions
+ // in optstring.)
+ if ( old_optind == 0 && c == -1 ) {
+ Assert(main_optind > 0);
+ continue;
+ }
+
+ if ( c == -1 ) {
+ if(Debug.isOn("options")) {
+ Debug("options") << "done with option parsing" << std::endl;
+ for(int index = optind; index < argc; ++index) {
+ Debug("options") << "remaining " << argv[index] << std::endl;
+ }
+ }
+ break;
+ }
+
+ option = argv[old_optind == 0 ? 1 : old_optind];
+ optionarg = (optarg == NULL) ? "" : optarg;
+
+ Debug("preemptGetopt") << "processing option " << c
+ << " (`" << char(c) << "'), " << option << std::endl;
+
+ switch(c) {
+${all_modules_option_handlers}
+
+#line 724 "${template}"
+
+ case ':':
+ // This can be a long or short option, and the way to get at the
+ // name of it is different.
+ throw OptionException(std::string("option `") + option +
+ "' missing its required argument");
+
+ case '?':
+ default:
+ if( ( optopt == 0 ||
+ ( optopt >= ${long_option_value_begin} &&
+ optopt <= ${long_option_value_end} )
+ ) && !strncmp(argv[optind - 1], "--thread", 8) &&
+ strlen(argv[optind - 1]) > 8 )
+ {
+ if(! isdigit(argv[optind - 1][8])) {
+ throw OptionException(formatThreadOptionException(option));
+ }
+ std::vector<std::string>& threadArgv = holder->threadArgv;
+ char *end;
+ long tnum = strtol(argv[optind - 1] + 8, &end, 10);
+ if(tnum < 0 || (*end != '\0' && *end != '=')) {
+ throw OptionException(formatThreadOptionException(option));
+ }
+ if(threadArgv.size() <= size_t(tnum)) {
+ threadArgv.resize(tnum + 1);
+ }
+ if(threadArgv[tnum] != "") {
+ threadArgv[tnum] += " ";
+ }
+ if(*end == '\0') { // e.g., we have --thread0 "foo"
+ if(argc <= optind) {
+ throw OptionException(std::string("option `") + option +
+ "' missing its required argument");
+ }
+ Debug("options") << "thread " << tnum << " gets option "
+ << argv[optind] << std::endl;
+ threadArgv[tnum] += argv[main_optind];
+ main_optind++;
+ } else { // e.g., we have --thread0="foo"
+ if(end[1] == '\0') {
+ throw OptionException(std::string("option `") + option +
+ "' missing its required argument");
+ }
+ Debug("options") << "thread " << tnum << " gets option "
+ << (end + 1) << std::endl;
+ threadArgv[tnum] += end + 1;
+ }
+ Debug("options") << "thread " << tnum << " now has "
+ << threadArgv[tnum] << std::endl;
+ break;
+ }
+
+ throw OptionException(std::string("can't understand option `") + option +
+ "'" + suggestCommandLineOptions(option));
+ }
+ }
+
+ Debug("options") << "got " << nonoptions->size()
+ << " non-option arguments." << std::endl;
+
+ free(argv);
+}
+
+std::string Options::suggestCommandLineOptions(const std::string& optionName) throw() {
+ DidYouMean didYouMean;
+
+ const char* opt;
+ for(size_t i = 0; (opt = cmdlineOptions[i].name) != NULL; ++i) {
+ didYouMean.addWord(std::string("--") + cmdlineOptions[i].name);
+ }
+
+ return didYouMean.getMatchAsString(optionName.substr(0, optionName.find('=')));
+}
+
+static const char* smtOptions[] = {
+ ${all_modules_smt_options},
+#line 802 "${template}"
+ NULL
+};/* smtOptions[] */
+
+std::vector<std::string> Options::suggestSmtOptions(const std::string& optionName) throw() {
+ std::vector<std::string> suggestions;
+
+ const char* opt;
+ for(size_t i = 0; (opt = smtOptions[i]) != NULL; ++i) {
+ if(std::strstr(opt, optionName.c_str()) != NULL) {
+ suggestions.push_back(opt);
+ }
+ }
+
+ return suggestions;
+}
+
+std::vector< std::vector<std::string> > Options::getOptions() const throw() {
+ std::vector< std::vector<std::string> > opts;
+
+ ${all_modules_get_options}
+
+#line 824 "${template}"
+
+ return opts;
+}
+
+
+#undef USE_EARLY_TYPE_CHECKING_BY_DEFAULT
+#undef DO_SEMANTIC_CHECKS_BY_DEFAULT
+
+}/* CVC4 namespace */
diff --git a/org.eclipse.efm.symbex/cmake/cvc4-patch/util/integer_gmp_imp.h b/org.eclipse.efm.symbex/cmake/cvc4-patch/util/integer_gmp_imp.h
new file mode 100644
index 0000000..2416b7f
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/cvc4-patch/util/integer_gmp_imp.h
@@ -0,0 +1,520 @@
+/********************* */
+/*! \file integer_gmp_imp.h
+ ** \verbatim
+ ** Original author: Tim King
+ ** Major contributors: Morgan Deters, Liana Hadarean
+ ** Minor contributors (to current version): Dejan Jovanovic
+ ** This file is part of the CVC4 project.
+ ** Copyright (c) 2009-2014 New York University and The University of Iowa
+ ** See the file COPYING in the top-level source directory for licensing
+ ** information.\endverbatim
+ **
+ ** \brief A multiprecision integer constant; wraps a GMP multiprecision
+ ** integer.
+ **
+ ** A multiprecision integer constant; wraps a GMP multiprecision integer.
+ **/
+
+#include "cvc4_public.h"
+
+#ifndef __CVC4__INTEGER_H
+#define __CVC4__INTEGER_H
+
+#include <string>
+#include <iostream>
+#include <limits>
+
+#include "util/gmp_util.h"
+#include "util/exception.h"
+
+namespace CVC4 {
+
+class Rational;
+
+class CVC4_PUBLIC Integer {
+private:
+ /**
+ * Stores the value of the rational is stored in a C++ GMP integer class.
+ * Using this instead of mpz_t allows for easier destruction.
+ */
+ mpz_class d_value;
+
+public:
+
+ /**
+ * Gets a reference to the gmp data that backs up the integer.
+ * Only accessible to friend classes.
+ */
+ const mpz_class& get_mpz() const { return d_value; }
+
+ /**
+ * Constructs an Integer by copying a GMP C++ primitive.
+ */
+ Integer(const mpz_class& val) : d_value(val) {}
+
+ /** Constructs a rational with the value 0. */
+ Integer() : d_value(0){}
+
+ /**
+ * Constructs a Integer from a C string.
+ * Throws std::invalid_argument if the string is not a valid rational.
+ * For more information about what is a valid rational string,
+ * see GMP's documentation for mpq_set_str().
+ */
+ explicit Integer(const char* s, unsigned base = 10);
+ explicit Integer(const std::string& s, unsigned base = 10);
+
+ Integer(const Integer& q) : d_value(q.d_value) {}
+
+ Integer( signed int z) : d_value(z) {}
+ Integer(unsigned int z) : d_value(z) {}
+ Integer( signed long int z) : d_value(z) {}
+ Integer(unsigned long int z) : d_value(z) {}
+
+#ifdef CVC4_NEED_INT64_T_OVERLOADS
+ Integer( int64_t z) : d_value(static_cast<long>(z)) {}
+ Integer(uint64_t z) : d_value(static_cast<unsigned long>(z)) {}
+#endif /* CVC4_NEED_INT64_T_OVERLOADS */
+
+ ~Integer() {}
+
+ Integer& operator=(const Integer& x){
+ if(this == &x) return *this;
+ d_value = x.d_value;
+ return *this;
+ }
+
+ bool operator==(const Integer& y) const {
+ return d_value == y.d_value;
+ }
+
+ Integer operator-() const {
+ return Integer(-(d_value));
+ }
+
+
+ bool operator!=(const Integer& y) const {
+ return d_value != y.d_value;
+ }
+
+ bool operator< (const Integer& y) const {
+ return d_value < y.d_value;
+ }
+
+ bool operator<=(const Integer& y) const {
+ return d_value <= y.d_value;
+ }
+
+ bool operator> (const Integer& y) const {
+ return d_value > y.d_value;
+ }
+
+ bool operator>=(const Integer& y) const {
+ return d_value >= y.d_value;
+ }
+
+
+ Integer operator+(const Integer& y) const {
+ return Integer( d_value + y.d_value );
+ }
+ Integer& operator+=(const Integer& y) {
+ d_value += y.d_value;
+ return *this;
+ }
+
+ Integer operator-(const Integer& y) const {
+ return Integer( d_value - y.d_value );
+ }
+ Integer& operator-=(const Integer& y) {
+ d_value -= y.d_value;
+ return *this;
+ }
+
+ Integer operator*(const Integer& y) const {
+ return Integer( d_value * y.d_value );
+ }
+ Integer& operator*=(const Integer& y) {
+ d_value *= y.d_value;
+ return *this;
+ }
+
+
+ Integer bitwiseOr(const Integer& y) const {
+ mpz_class result;
+ mpz_ior(result.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer(result);
+ }
+
+ Integer bitwiseAnd(const Integer& y) const {
+ mpz_class result;
+ mpz_and(result.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer(result);
+ }
+
+ Integer bitwiseXor(const Integer& y) const {
+ mpz_class result;
+ mpz_xor(result.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer(result);
+ }
+
+ Integer bitwiseNot() const {
+ mpz_class result;
+ mpz_com(result.get_mpz_t(), d_value.get_mpz_t());
+ return Integer(result);
+ }
+
+ /**
+ * Return this*(2^pow).
+ */
+ Integer multiplyByPow2(uint32_t pow) const{
+ mpz_class result;
+ mpz_mul_2exp(result.get_mpz_t(), d_value.get_mpz_t(), pow);
+ return Integer( result );
+ }
+
+ /**
+ * Returns the Integer obtained by setting the ith bit of the
+ * current Integer to 1.
+ */
+ Integer setBit(uint32_t i) const {
+ mpz_class res = d_value;
+ mpz_setbit(res.get_mpz_t(), i);
+ return Integer(res);
+ }
+
+ bool isBitSet(uint32_t i) const {
+ return !extractBitRange(1, i).isZero();
+ }
+
+ /**
+ * Returns the integer with the binary representation of size bits
+ * extended with amount 1's
+ */
+ Integer oneExtend(uint32_t size, uint32_t amount) const {
+ // check that the size is accurate
+ DebugCheckArgument((*this) < Integer(1).multiplyByPow2(size), size);
+ mpz_class res = d_value;
+
+ for (unsigned i = size; i < size + amount; ++i) {
+ mpz_setbit(res.get_mpz_t(), i);
+ }
+
+ return Integer(res);
+ }
+
+ uint32_t toUnsignedInt() const {
+ return mpz_get_ui(d_value.get_mpz_t());
+ }
+
+ /** See GMP Documentation. */
+ Integer extractBitRange(uint32_t bitCount, uint32_t low) const {
+ // bitCount = high-low+1
+ uint32_t high = low + bitCount-1;
+ //— Function: void mpz_fdiv_r_2exp (mpz_t r, mpz_t n, mp_bitcnt_t b)
+ mpz_class rem, div;
+ mpz_fdiv_r_2exp(rem.get_mpz_t(), d_value.get_mpz_t(), high+1);
+ mpz_fdiv_q_2exp(div.get_mpz_t(), rem.get_mpz_t(), low);
+
+ return Integer(div);
+ }
+
+ /**
+ * Returns the floor(this / y)
+ */
+ Integer floorDivideQuotient(const Integer& y) const {
+ mpz_class q;
+ mpz_fdiv_q(q.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer( q );
+ }
+
+ /**
+ * Returns r == this - floor(this/y)*y
+ */
+ Integer floorDivideRemainder(const Integer& y) const {
+ mpz_class r;
+ mpz_fdiv_r(r.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer( r );
+ }
+
+ /**
+ * Computes a floor quotient and remainder for x divided by y.
+ */
+ static void floorQR(Integer& q, Integer& r, const Integer& x, const Integer& y) {
+ mpz_fdiv_qr(q.d_value.get_mpz_t(), r.d_value.get_mpz_t(), x.d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ }
+
+ /**
+ * Returns the ceil(this / y)
+ */
+ Integer ceilingDivideQuotient(const Integer& y) const {
+ mpz_class q;
+ mpz_cdiv_q(q.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer( q );
+ }
+
+ /**
+ * Returns the ceil(this / y)
+ */
+ Integer ceilingDivideRemainder(const Integer& y) const {
+ mpz_class r;
+ mpz_cdiv_r(r.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer( r );
+ }
+
+ /**
+ * Computes a quoitent and remainder according to Boute's Euclidean definition.
+ * euclidianDivideQuotient, euclidianDivideRemainder.
+ *
+ * Boute, Raymond T. (April 1992).
+ * The Euclidean definition of the functions div and mod.
+ * ACM Transactions on Programming Languages and Systems (TOPLAS)
+ * ACM Press. 14 (2): 127 - 144. doi:10.1145/128861.128862.
+ */
+ static void euclidianQR(Integer& q, Integer& r, const Integer& x, const Integer& y) {
+ // compute the floor and then fix the value up if needed.
+ floorQR(q,r,x,y);
+
+ if(r.strictlyNegative()){
+ // if r < 0
+ // abs(r) < abs(y)
+ // - abs(y) < r < 0, then 0 < r + abs(y) < abs(y)
+ // n = y * q + r
+ // n = y * q - abs(y) + r + abs(y)
+ if(r.sgn() >= 0){
+ // y = abs(y)
+ // n = y * q - y + r + y
+ // n = y * (q-1) + (r+y)
+ q -= 1;
+ r += y;
+ }else{
+ // y = -abs(y)
+ // n = y * q + y + r - y
+ // n = y * (q+1) + (r-y)
+ q += 1;
+ r -= y;
+ }
+ }
+ }
+ /**
+ * Returns the quoitent according to Boute's Euclidean definition.
+ * See the documentation for euclidianQR.
+ */
+ Integer euclidianDivideQuotient(const Integer& y) const {
+ Integer q,r;
+ euclidianQR(q,r, *this, y);
+ return q;
+ }
+
+ /**
+ * Returns the remainfing according to Boute's Euclidean definition.
+ * See the documentation for euclidianQR.
+ */
+ Integer euclidianDivideRemainder(const Integer& y) const {
+ Integer q,r;
+ euclidianQR(q,r, *this, y);
+ return r;
+ }
+
+
+ /**
+ * If y divides *this, then exactQuotient returns (this/y)
+ */
+ Integer exactQuotient(const Integer& y) const {
+ DebugCheckArgument(y.divides(*this), y);
+ mpz_class q;
+ mpz_divexact(q.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer( q );
+ }
+
+ /**
+ * Returns y mod 2^exp
+ */
+ Integer modByPow2(uint32_t exp) const {
+ mpz_class res;
+ mpz_fdiv_r_2exp(res.get_mpz_t(), d_value.get_mpz_t(), exp);
+ return Integer(res);
+ }
+
+ /**
+ * Returns y / 2^exp
+ */
+ Integer divByPow2(uint32_t exp) const {
+ mpz_class res;
+ mpz_fdiv_q_2exp(res.get_mpz_t(), d_value.get_mpz_t(), exp);
+ return Integer(res);
+ }
+
+
+ int sgn() const {
+ return mpz_sgn(d_value.get_mpz_t());
+ }
+
+ inline bool strictlyPositive() const {
+ return sgn() > 0;
+ }
+
+ inline bool strictlyNegative() const {
+ return sgn() < 0;
+ }
+
+ inline bool isZero() const {
+ return sgn() == 0;
+ }
+
+ bool isOne() const {
+ return mpz_cmp_si(d_value.get_mpz_t(), 1) == 0;
+ }
+
+ bool isNegativeOne() const {
+ return mpz_cmp_si(d_value.get_mpz_t(), -1) == 0;
+ }
+
+ /**
+ * Raise this Integer to the power <code>exp</code>.
+ *
+ * @param exp the exponent
+ */
+ Integer pow(unsigned long int exp) const {
+ mpz_class result;
+ mpz_pow_ui(result.get_mpz_t(),d_value.get_mpz_t(),exp);
+ return Integer( result );
+ }
+
+ /**
+ * Return the greatest common divisor of this integer with another.
+ */
+ Integer gcd(const Integer& y) const {
+ mpz_class result;
+ mpz_gcd(result.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer(result);
+ }
+
+ /**
+ * Return the least common multiple of this integer with another.
+ */
+ Integer lcm(const Integer& y) const {
+ mpz_class result;
+ mpz_lcm(result.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t());
+ return Integer(result);
+ }
+
+ /**
+ * All non-zero integers z, z.divide(0)
+ * ! zero.divides(zero)
+ */
+ bool divides(const Integer& y) const {
+ int res = mpz_divisible_p(y.d_value.get_mpz_t(), d_value.get_mpz_t());
+ return res != 0;
+ }
+
+ /**
+ * Return the absolute value of this integer.
+ */
+ Integer abs() const {
+ return d_value >= 0 ? *this : -*this;
+ }
+
+ std::string toString(int base = 10) const{
+ return d_value.get_str(base);
+ }
+
+ bool fitsSignedInt() const;
+
+ bool fitsUnsignedInt() const;
+
+ signed int getSignedInt() const;
+
+ unsigned int getUnsignedInt() const;
+
+ long getLong() const {
+ long si = d_value.get_si();
+ // ensure there wasn't overflow
+ CheckArgument(mpz_cmp_si(d_value.get_mpz_t(), si) == 0, this,
+ "Overflow detected in Integer::getLong()");
+ return si;
+ }
+ unsigned long getUnsignedLong() const {
+ unsigned long ui = d_value.get_ui();
+ // ensure there wasn't overflow
+ CheckArgument(mpz_cmp_ui(d_value.get_mpz_t(), ui) == 0, this,
+ "Overflow detected in Integer::getUnsignedLong()");
+ return ui;
+ }
+
+ /**
+ * Computes the hash of the node from the first word of the
+ * numerator, the denominator.
+ */
+ size_t hash() const {
+ return gmpz_hash(d_value.get_mpz_t());
+ }
+
+ /**
+ * Returns true iff bit n is set.
+ *
+ * @param n the bit to test (0 == least significant bit)
+ * @return true if bit n is set in this integer; false otherwise
+ */
+ bool testBit(unsigned n) const {
+ return mpz_tstbit(d_value.get_mpz_t(), n);
+ }
+
+ /**
+ * Returns k if the integer is equal to 2^(k-1)
+ * @return k if the integer is equal to 2^(k-1) and 0 otherwise
+ */
+ unsigned isPow2() const {
+ if (d_value <= 0) return 0;
+ // check that the number of ones in the binary representation is 1
+ if (mpz_popcount(d_value.get_mpz_t()) == 1) {
+ // return the index of the first one plus 1
+ return mpz_scan1(d_value.get_mpz_t(), 0) + 1;
+ }
+ return 0;
+ }
+
+
+ /**
+ * If x != 0, returns the smallest n s.t. 2^{n-1} <= abs(x) < 2^{n}.
+ * If x == 0, returns 1.
+ */
+ size_t length() const {
+ if(sgn() == 0){
+ return 1;
+ }else{
+ return mpz_sizeinbase(d_value.get_mpz_t(),2);
+ }
+ }
+
+ static void extendedGcd(Integer& g, Integer& s, Integer& t, const Integer& a, const Integer& b){
+ //see the documentation for:
+ //mpz_gcdext (mpz_t g, mpz_t s, mpz_t t, mpz_t a, mpz_t b);
+ mpz_gcdext (g.d_value.get_mpz_t(), s.d_value.get_mpz_t(), t.d_value.get_mpz_t(), a.d_value.get_mpz_t(), b.d_value.get_mpz_t());
+ }
+
+ /** Returns a reference to the minimum of two integers. */
+ static const Integer& min(const Integer& a, const Integer& b){
+ return (a <=b ) ? a : b;
+ }
+
+ /** Returns a reference to the maximum of two integers. */
+ static const Integer& max(const Integer& a, const Integer& b){
+ return (a >= b ) ? a : b;
+ }
+
+ friend class CVC4::Rational;
+};/* class Integer */
+
+struct IntegerHashFunction {
+ inline size_t operator()(const CVC4::Integer& i) const {
+ return i.hash();
+ }
+};/* struct IntegerHashFunction */
+
+inline std::ostream& operator<<(std::ostream& os, const Integer& n) {
+ return os << n.toString();
+}
+
+}/* CVC4 namespace */
+
+#endif /* __CVC4__INTEGER_H */
diff --git a/org.eclipse.efm.symbex/cmake/cvc4-patch/util/rational_gmp_imp.h b/org.eclipse.efm.symbex/cmake/cvc4-patch/util/rational_gmp_imp.h
new file mode 100644
index 0000000..89d0631
--- /dev/null
+++ b/org.eclipse.efm.symbex/cmake/cvc4-patch/util/rational_gmp_imp.h
@@ -0,0 +1,356 @@
+/********************* */
+/*! \file rational_gmp_imp.h
+ ** \verbatim
+ ** Original author: Tim King
+ ** Major contributors: Morgan Deters
+ ** Minor contributors (to current version): Dejan Jovanovic
+ ** This file is part of the CVC4 project.
+ ** Copyright (c) 2009-2014 New York University and The University of Iowa
+ ** See the file COPYING in the top-level source directory for licensing
+ ** information.\endverbatim
+ **
+ ** \brief Multiprecision rational constants; wraps a GMP multiprecision
+ ** rational.
+ **
+ ** Multiprecision rational constants; wraps a GMP multiprecision rational.
+ **/
+
+#include "cvc4_public.h"
+
+#ifndef __CVC4__RATIONAL_H
+#define __CVC4__RATIONAL_H
+
+#include <gmp.h>
+#include <string>
+
+#include "util/integer.h"
+#include "util/exception.h"
+
+namespace CVC4 {
+
+class CVC4_PUBLIC RationalFromDoubleException : public Exception {
+public:
+ RationalFromDoubleException(double d) throw();
+};
+
+/**
+ ** A multi-precision rational constant.
+ ** This stores the rational as a pair of multi-precision integers,
+ ** one for the numerator and one for the denominator.
+ ** The number is always stored so that the gcd of the numerator and denominator
+ ** is 1. (This is referred to as referred to as canonical form in GMP's
+ ** literature.) A consequence is that that the numerator and denominator may be
+ ** different than the values used to construct the Rational.
+ **
+ ** NOTE: The correct way to create a Rational from an int is to use one of the
+ ** int numerator/int denominator constructors with the denominator 1. Trying
+ ** to construct a Rational with a single int, e.g., Rational(0), will put you
+ ** in danger of invoking the char* constructor, from whence you will segfault.
+ **/
+
+class CVC4_PUBLIC Rational {
+private:
+ /**
+ * Stores the value of the rational is stored in a C++ GMP rational class.
+ * Using this instead of mpq_t allows for easier destruction.
+ */
+ mpq_class d_value;
+
+public:
+
+ /**
+ * Constructs a Rational from a mpq_class object.
+ * Does a deep copy.
+ * Assumes that the value is in canonical form, and thus does not
+ * have to call canonicalize() on the value.
+ */
+ Rational(const mpq_class& val) : d_value(val) { }
+
+ /**
+ * Creates a rational from a decimal string (e.g., <code>"1.5"</code>).
+ *
+ * @param dec a string encoding a decimal number in the format
+ * <code>[0-9]*\.[0-9]*</code>
+ */
+ static Rational fromDecimal(const std::string& dec);
+
+ /** Constructs a rational with the value 0/1. */
+ Rational() : d_value(0){
+ d_value.canonicalize();
+ }
+
+ /**
+ * Constructs a Rational from a C string in a given base (defaults to 10).
+ * Throws std::invalid_argument if the string is not a valid rational.
+ * For more information about what is a valid rational string,
+ * see GMP's documentation for mpq_set_str().
+ */
+ explicit Rational(const char* s, unsigned base = 10): d_value(s, base) {
+ d_value.canonicalize();
+ }
+ Rational(const std::string& s, unsigned base = 10) : d_value(s, base) {
+ d_value.canonicalize();
+ }
+
+ /**
+ * Creates a Rational from another Rational, q, by performing a deep copy.
+ */
+ Rational(const Rational& q) : d_value(q.d_value) {
+ d_value.canonicalize();
+ }
+
+ /**
+ * Constructs a canonical Rational from a numerator.
+ */
+ Rational(signed int n) : d_value(n,1) {
+ d_value.canonicalize();
+ }
+ Rational(unsigned int n) : d_value(n,1) {
+ d_value.canonicalize();
+ }
+ Rational(signed long int n) : d_value(n,1) {
+ d_value.canonicalize();
+ }
+ Rational(unsigned long int n) : d_value(n,1) {
+ d_value.canonicalize();
+ }
+
+#ifdef CVC4_NEED_INT64_T_OVERLOADS
+ Rational(int64_t n) : d_value(static_cast<long>(n), 1) {
+ d_value.canonicalize();
+ }
+ Rational(uint64_t n) : d_value(static_cast<unsigned long>(n), 1) {
+ d_value.canonicalize();
+ }
+#endif /* CVC4_NEED_INT64_T_OVERLOADS */
+
+ /**
+ * Constructs a canonical Rational from a numerator and denominator.
+ */
+ Rational(signed int n, signed int d) : d_value(n,d) {
+ d_value.canonicalize();
+ }
+ Rational(unsigned int n, unsigned int d) : d_value(n,d) {
+ d_value.canonicalize();
+ }
+ Rational(signed long int n, signed long int d) : d_value(n,d) {
+ d_value.canonicalize();
+ }
+ Rational(unsigned long int n, unsigned long int d) : d_value(n,d) {
+ d_value.canonicalize();
+ }
+
+#ifdef CVC4_NEED_INT64_T_OVERLOADS
+ Rational(int64_t n, int64_t d) : d_value(static_cast<long>(n), static_cast<long>(d)) {
+ d_value.canonicalize();
+ }
+ Rational(uint64_t n, uint64_t d) : d_value(static_cast<unsigned long>(n), static_cast<unsigned long>(d)) {
+ d_value.canonicalize();
+ }
+#endif /* CVC4_NEED_INT64_T_OVERLOADS */
+
+ Rational(const Integer& n, const Integer& d) :
+ d_value(n.get_mpz(), d.get_mpz())
+ {
+ d_value.canonicalize();
+ }
+ Rational(const Integer& n) :
+ d_value(n.get_mpz())
+ {
+ d_value.canonicalize();
+ }
+ ~Rational() {}
+
+ /**
+ * Gets a reference to the gmp data that backs up the rational.
+ * Only accessible to friend classes.
+ */
+ const mpq_class& get_mpq() const { return d_value; }
+
+ /**
+ * Returns the value of numerator of the Rational.
+ * Note that this makes a deep copy of the numerator.
+ */
+ Integer getNumerator() const {
+ return Integer(d_value.get_num());
+ }
+
+ /**
+ * Returns the value of denominator of the Rational.
+ * Note that this makes a deep copy of the denominator.
+ */
+ Integer getDenominator() const {
+ return Integer(d_value.get_den());
+ }
+
+ static Rational fromDouble(double d) throw(RationalFromDoubleException);
+
+ /**
+ * Get a double representation of this Rational, which is
+ * approximate: truncation may occur, overflow may result in
+ * infinity, and underflow may result in zero.
+ */
+ double getDouble() const {
+ return d_value.get_d();
+ }
+
+ Rational inverse() const {
+ return Rational(getDenominator(), getNumerator());
+ }
+
+ int cmp(const Rational& x) const {
+ //Don't use mpq_class's cmp() function.
+ //The name ends up conflicting with this function.
+ return mpq_cmp(d_value.get_mpq_t(), x.d_value.get_mpq_t());
+ }
+
+ int sgn() const {
+ return mpq_sgn(d_value.get_mpq_t());
+ }
+
+ bool isZero() const {
+ return sgn() == 0;
+ }
+
+ bool isOne() const {
+ return mpq_cmp_si(d_value.get_mpq_t(), 1, 1) == 0;
+ }
+
+ bool isNegativeOne() const {
+ return mpq_cmp_si(d_value.get_mpq_t(), -1, 1) == 0;
+ }
+
+ Rational abs() const {
+ if(sgn() < 0){
+ return -(*this);
+ }else{
+ return *this;
+ }
+ }
+
+ Integer floor() const {
+ mpz_class q;
+ mpz_fdiv_q(q.get_mpz_t(), d_value.get_num_mpz_t(), d_value.get_den_mpz_t());
+ return Integer(q);
+ }
+
+ Integer ceiling() const {
+ mpz_class q;
+ mpz_cdiv_q(q.get_mpz_t(), d_value.get_num_mpz_t(), d_value.get_den_mpz_t());
+ return Integer(q);
+ }
+
+ Rational floor_frac() const {
+ return (*this) - Rational(floor());
+ }
+
+ Rational& operator=(const Rational& x){
+ if(this == &x) return *this;
+ d_value = x.d_value;
+ return *this;
+ }
+
+ Rational operator-() const{
+ return Rational(-(d_value));
+ }
+
+ bool operator==(const Rational& y) const {
+ return d_value == y.d_value;
+ }
+
+ bool operator!=(const Rational& y) const {
+ return d_value != y.d_value;
+ }
+
+ bool operator< (const Rational& y) const {
+ return d_value < y.d_value;
+ }
+
+ bool operator<=(const Rational& y) const {
+ return d_value <= y.d_value;
+ }
+
+ bool operator> (const Rational& y) const {
+ return d_value > y.d_value;
+ }
+
+ bool operator>=(const Rational& y) const {
+ return d_value >= y.d_value;
+ }
+
+ Rational operator+(const Rational& y) const{
+ return Rational( d_value + y.d_value );
+ }
+ Rational operator-(const Rational& y) const {
+ return Rational( d_value - y.d_value );
+ }
+
+ Rational operator*(const Rational& y) const {
+ return Rational( d_value * y.d_value );
+ }
+ Rational operator/(const Rational& y) const {
+ return Rational( d_value / y.d_value );
+ }
+
+ Rational& operator+=(const Rational& y){
+ d_value += y.d_value;
+ return (*this);
+ }
+ Rational& operator-=(const Rational& y){
+ d_value -= y.d_value;
+ return (*this);
+ }
+
+ Rational& operator*=(const Rational& y){
+ d_value *= y.d_value;
+ return (*this);
+ }
+
+ Rational& operator/=(const Rational& y){
+ d_value /= y.d_value;
+ return (*this);
+ }
+
+ bool isIntegral() const{
+ return getDenominator() == 1;
+ }
+
+ /** Returns a string representing the rational in the given base. */
+ std::string toString(int base = 10) const {
+ return d_value.get_str(base);
+ }
+
+ /**
+ * Computes the hash of the rational from hashes of the numerator and the
+ * denominator.
+ */
+ size_t hash() const {
+ size_t numeratorHash = gmpz_hash(d_value.get_num_mpz_t());
+ size_t denominatorHash = gmpz_hash(d_value.get_den_mpz_t());
+
+ return numeratorHash xor denominatorHash;
+ }
+
+ uint32_t complexity() const {
+ uint32_t numLen = getNumerator().length();
+ uint32_t denLen = getDenominator().length();
+ return numLen + denLen;
+ }
+
+ /** Equivalent to calling (this->abs()).cmp(b.abs()) */
+ int absCmp(const Rational& q) const;
+
+};/* class Rational */
+
+struct RationalHashFunction {
+ inline size_t operator()(const CVC4::Rational& r) const {
+ return r.hash();
+ }
+};/* struct RationalHashFunction */
+
+CVC4_PUBLIC std::ostream& operator<<(std::ostream& os, const Rational& n);
+
+}/* CVC4 namespace */
+
+#endif /* __CVC4__RATIONAL_H */
+
diff --git a/org.eclipse.efm.symbex/ftests/CMakeLists.txt b/org.eclipse.efm.symbex/ftests/CMakeLists.txt
new file mode 100644
index 0000000..4b87aba
--- /dev/null
+++ b/org.eclipse.efm.symbex/ftests/CMakeLists.txt
@@ -0,0 +1,27 @@
+# =============================================================================
+# CMake file for functional testing
+# =============================================================================
+
+
+# Minimum required CMake version
+cmake_minimum_required (VERSION 2.8 FATAL_ERROR)
+
+
+# Tell cmake where to find its own modules
+list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/../cmake)
+list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
+
+# Print title banner
+set (BANNER_MESSAGE "This is Symbex Functional Test")
+include (PrintBanner)
+
+
+# UNDER PROGRESS
+
+add_executable(ls IMPORTED)
+set_property (TARGET ls PROPERTY IMPORTED_LOCATION /usr/bin/ls)
+
+
+
+# Define tests
+add_test (NAME ls COMMAND c:/msys64/usr/bin/ls) # Dummy test \ No newline at end of file
diff --git a/org.eclipse.efm.symbex/ftests/CTestTestfile.cmake b/org.eclipse.efm.symbex/ftests/CTestTestfile.cmake
new file mode 100644
index 0000000..21c8623
--- /dev/null
+++ b/org.eclipse.efm.symbex/ftests/CTestTestfile.cmake
@@ -0,0 +1,2 @@
+# Define tests
+add_test (NAME ls COMMAND c:/msys64/usr/bin/ls) # Dummy test \ No newline at end of file
diff --git a/org.eclipse.efm.symbex/ftests/cmake/DefineSymbexFuncTestProject.cmake b/org.eclipse.efm.symbex/ftests/cmake/DefineSymbexFuncTestProject.cmake
new file mode 100644
index 0000000..5fbcec5
--- /dev/null
+++ b/org.eclipse.efm.symbex/ftests/cmake/DefineSymbexFuncTestProject.cmake
@@ -0,0 +1,2 @@
+add_subdirectory (base)
+add_subdirectory (fml) \ No newline at end of file
diff --git a/org.eclipse.efm.symbex/resources/doc/BUILD_WITH_CMAKE.md b/org.eclipse.efm.symbex/resources/doc/BUILD_WITH_CMAKE.md
new file mode 100644
index 0000000..4b6872b
--- /dev/null
+++ b/org.eclipse.efm.symbex/resources/doc/BUILD_WITH_CMAKE.md
@@ -0,0 +1,92 @@
+# Symbex Build with CMake
+
+## Environment installation
+Symbex can be build with CMake on Linux Ubuntu or Windows MSYS2 systems
+Follow steps described in `INSTALL_MSYS2.md ` or `INSTALL_LINUX.md ` to install the required environment.
+
+## CMake Fundamentals
+CMake is an open-source, cross-platform family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice.
+
+CMake holds the build rules in configuration files (``src/CMakeLists.txt``, ``src/*/CMakeLists.txt`` and ``src/cmake/*.cmake``) written in a dedicated [platform independent language](https://cmake.org/cmake/help/v3.6/manual/cmake-language.7.html).
+
+Basically, [building with CMake](https://cmake.org/cmake/help/v3.6/manual/cmake-buildsystem.7.html) follows this procedure :
+1. The user chooses a [Toolchain](https://cmake.org/cmake/help/v3.6/manual/cmake-toolchains.7.html) (a set of compiler, linker and associated libraries) and a [Generator](https://cmake.org/cmake/help/v3.6/manual/cmake-generators.7.html) (a platform dependent build system such as Make, Visual Studio, etc.). Of course, these must be available on the current platform.
+2. Configuration. CMake analyses the current platform, toolchain and generator and put the relevant information in a cache file (CMakeCache.txt).
+3. Generation. CMake creates all the files needed by the chosen generator.
+4. Build. The generator executes the build without knowing anything about CMake.
+
+If one or several sources file are modified, it is only required to redo the build step. If compile options or prerequisites are modified, the whole procedure must be done again from the beginning.
+
+CMake can launched through a [GUI](https://cmake.org/cmake/help/v3.6/manual/cmake-gui.1.html) or a [command line](https://cmake.org/cmake/help/v3.6/manual/cmake.1.html).
+
+## Standard Build Procedure
+
+### Build on Windows MSYS2
+
+#### Bypass of a CVC4 configure anomaly
+After boost is installed, copy the boost default installation to a directory where CVC4 configure will be able to find it :
+``cp -R /mingw64 /mingw642``
+
+#### Build Procedure
+
+1. Open a MSYS2-MINGW64 shell console. Make sure MINGW64 appears in the prompt.
+2. Clone the Symbex sources repository using Eclipse Git or the command line ``git clone ssh://gitolite@132.166.135.212/diversity/org.eclipse.efm-symbex.git``. Make sure your SSH keys exists and are properly declared to Git.
+3. Launch ``cmake-gui &`` and fill the two top fields with the path to the workspace sources directory (it should be ``src``) and the directory where you want to build (it is better to choose one outside the workspace).
+4. Press _Configure_. In the opening dialog choose the _MSYS Makefile_ generator. Don't change the default checked option _Use Default Native Compiler_ unless you know what you do. Press _Finish_ to launch the configure step. CMake logs what it is doing in the bottom message console. Pay attention to messages in red if any. During the very first build, some prerequisites are not found and CMake says it will build them later. At the end of the configure step, the cache console shows the resulting CMake variables and theirs values. (this is nothing more than a pretty display of the cache file).
+5. Press _Generate_ and wait for the message _Generating done_ to appear. Makefiles have been created in the build directory.
+6. In the shell console, go to the build directory and launch the build with ``make``. On multicore platform you can launch parallel build with ``make -jX`` where X is slightly inferior to the number of cores. The current platform core number is displayed in the CMake message console. Build verbosity can be increased with ``make VERBOSE=1``. If it is the very first build, CMake will try to download, build and install the missing prerequisites (longer build).
+7. A the end of the process, the ``symbex.exe`` executable is built and can be checked using ``./symbex -test``.
+
+### Build on Linux Ubuntu
+
+#### Build Procedure
+1. Open a shell console.
+
+Follow steps 2 to 7 of Build on Windows MSYS2 procedure.
+During step 4, choose the _Unix Makefiles_ generator
+During step 6, if it is the very first build, Cmake will install the missing prerequisites, but will not have access to the default folders. Either try ``sudo make`` or install in other folders. It is possible to configure installation in other folders in SpecificOptions-LinuxNAtive.cmake
+
+## Known Problems
+
+* **Problem : Configure step failed at the basic compilation check made by CMake**
+Usually this problem arises when cache is deleted. Solution : Just kill cmake-gui and relaunch.
+
+
+## Changing Build Options
+
+* **Options that affect the whole project on every platform**
+Edit ``GenericOptions.cmake`` and modify ``add_definitions()`` and ``add_options()`` commands according to your wish. Pay attention to only put platform independent options here. Exemple : ``-g``, ``-O3``, ``-D_AVM_BUILTIN_NUMERIC_GMP_ ``
+
+* **Options that affect the whole project on a specific platform**
+Edit ``SpecificOptions-<platform>.cmake`` and modify ``add_definitions()`` and ``add_options()`` commands according to your wish.
+Exemple : ``-D__AVM_MINGW__``
+
+* **Options that affect a specific internal library on every platform**
+Edit the ``CMakeLists.txt`` file of this library and modify (or add) the ``add_definitions()`` and ``add_options()`` commands according to your wish.
+
+**Note : No mechanism is provided to set an option that is specific to only one internal library and only one platform.**
+
+
+## Advanced CMake (for Developers)
+* **How to add a new source file ?**
+CMake will automatically detect the file as long as it is located in the directory hierarchy of an existing internal library and have a known suffix (``.h, .cpp, .c``).
+
+* **How to add a new sources directory without defining a new internal library**
+CMake will automatically detect the directory and files it contains as long as it is located in the directory hierarchy of an existing internal library.
+
+* **How to add a new internal library ?**
+1. In ``src/``, create the top directory for mylib and any other required subdirectories.
+2. Edit ``DefineProject.cmake``
+2.1 Add the required ``add_subdirectory (mylib)`` command.
+2.2 Add mylib in the ``target_link_libraries (symbex ... mylib ...)`` command, at the right place for the link to succeed.
+3. Copy the ``CMakeLists.txt`` file of an existing internal library into the top directory of mylib. Change all occurences of the existent library name with mylib. If needed, add or remove ``target_include_directories()`` commands to give access to any needed prerequisiste headers. Never write an explicit path here, instead use CMake variable (you can look at the CMakeLists.txt of other library to know about the right variable).
+
+* **How to add a new prerequisite X ?**
+If the prerequisite is a binary package available on every Symbex supported platform, follow the following process :
+1. Create a new ``FindX.cmake module``, taking inspiration from an existing one. This module should return CMake variables containing path to the library(ies) and the include directory(ies).
+2. Add the relevant code in ``LookForMandatoryPrereq.cmake`` for CMake to call the new ``FindX`` module.
+3. Link to the new library(ies) in the ``target_link_libraries(symbex ...)`` command in ``DefineProject.cmake``
+4. For every internal library needing access to the new prerequisites headers, add a new ``target_include_directories`` command in the ``CMalkeLists.txt`` of this library. Always use CMake variables created by the FindX module (cf. step 1).
+
+
+
diff --git a/org.eclipse.efm.symbex/resources/doc/INSTALL_LINUX.md b/org.eclipse.efm.symbex/resources/doc/INSTALL_LINUX.md
new file mode 100644
index 0000000..e61cb40
--- /dev/null
+++ b/org.eclipse.efm.symbex/resources/doc/INSTALL_LINUX.md
@@ -0,0 +1,69 @@
+# Linux Ubuntu Environment Installation
+
+## Core System installation
+This procedure has been tested under Ubuntu 14.04 LTS.
+
+## APT, the package manager
+APT is a set of core tools found inside Debian based operating systems. It provides utilities for the installation and removal of software packages and dependencies on a system.
+
+### APT-GET, package management
+
+#### Update repositories
+Repositories are updated from the locations specified in /etc/apt/sources.list and /etc/apt/sources.list.d/.
+``sudo apt-get update``
+
+#### Upgrade the whole OS distribution
+``sudo apt-get upgrade``
+
+#### Installing a package
+``sudo apt-get install <package>``
+
+#### Removing a package without removing its configurations files
+``sudo apt-get remove <package>``
+
+#### Removing a package including its configurations files
+``sudo apt-get purge <package>``
+or
+``sudo apt-get remove --purge <package>``
+
+### APT-CACHE, high level package query
+APT cache files are located in /var/cache/apt/archives
+
+#### List all available packages for the OS
+``apt-cache pkgnames``
+
+#### Look for packages matching a string pattern
+``apt-cache search <string>``
+
+#### Show comprehensive information about a package
+``apt-cache show <package>``
+
+### DPKG, low level package management
+
+#### Show all files installed by a package
+``dpkg -L <package>``
+
+#### Show all packages containing a filename or filepath
+``dpkg -S <filenameorpath>``
+
+## Main Components Installation
+
+#### CMake, a tool to build across several platforms
+`sudo apt-get install cmake`
+`sudo apt-get install cmake-gui`
+
+#### Boost, the Free peer-reviewed portable C++ source libraries (compulsory)
+`sudo apt-get install libboost-all-dev` : Debian's default boost version (currently 1.54)
+
+#### ANTLR2, a parser
+`sudo apt-get install libantlr-dev`
+
+#### GMP, a free library for arbitrary precision arithmetic (optional)
+`sudo apt-get install libgmp-dev`
+
+#### Git, The distributed version control system
+`sudo apt-get install git`
+
+
+
+
diff --git a/org.eclipse.efm.symbex/resources/doc/INSTALL_MSYS2.md b/org.eclipse.efm.symbex/resources/doc/INSTALL_MSYS2.md
new file mode 100644
index 0000000..0a4ed61
--- /dev/null
+++ b/org.eclipse.efm.symbex/resources/doc/INSTALL_MSYS2.md
@@ -0,0 +1,166 @@
+# MSYS2 Compiler Environment : installation
+
+## Core System installation
+* Go to [http://msys2.github.io](http://msys2.github.io/)
+* Download and run the installer **msys2-x86_64-20160921.exe**
+* When prompted to enter **Installation Folder**, use default choice **C:\msys64**
+* Tick **Run MSYS2 now**, this will open a shell
+* Update the package database and pacman with ``pacman -Sy pacman``
+* If needed, close MSYS2, run it again from Start menu. Update the rest with: Update the package database and core system packages with: ``pacman -Syu``
+* Again, if needed, close MSYS2, run it again from Start menu. Update the rest with: ``pacman -Su``
+
+Pinning to Taskbar: shortcut command list
+1. C:\msys64\msys2_shell.cmd -mingw64
+2. C:\msys64\usr\bin\mintty.exe -i /msys2.ico /usr/bin/bash --login
+
+
+
+## Pacman, the package manager
+The documentation [wiki page](https://wiki.archlinux.org/index.php/pacman)
+
+### Querying package databases
+* Help on queries on the sync database **-S**
+* Help on queries on installed packages **-Q**
+
+```
+pacman -S --help
+pacman -Q --help
+```
+
+* Search for packages in the database / in already installed packages
+
+```
+
+pacman -Ss string1 string2
+
+pacman -Qs string1 string2
+
+```
+
+
+* To display installed file list a given package
+
+```
+pacman -Slq package_name
+
+pacman -Qlq package_name
+```
+
+* To display extensive information about a given package
+
+```
+pacman -Si package_name
+
+pacman -Qi package_name
+```
+
+### Installing packages
+* Installing specific packages
+
+```
+pacman -S package_name1 package_name2
+```
+
+### Removing packages
+* Removing packages, leaving all of its dependencies installed
+
+```
+pacman -R package_name
+```
+
+* Removing packages and its dependencies which are not required by any other installed package
+
+```
+pacman -Rs package_name
+```
+
+### Updating packages
+* Comparing versions before updating, to see old and new versions of available packages
+
+```
+pacman -Syu
+```
+
+
+## Main Components installation
+### Utilities used to store, backup, and transport files
+
+```
+pacman -S tar
+```
+
+### Git : The distributed version control system
+
+```
+pacman -S git
+```
+
+### Binutils : A set of programs to assemble and manipulate binary and object files
+
+```
+pacman -S binutils
+```
+
+# Utils for compilation
+
+### GNU autotools : tools to automate parts of the compilation process
+```
+pacman -S autoconf
+
+pacman -S automake
+
+pacman -S libtool
+
+pacman -S make
+```
+
+### CMake : a tool to build across several platforms
+* **CMake** (compulsory)
+
+```
+pacman -S mingw-w64-x86_64-cmake
+```
+* **Qt5 Framework** (optional big package only needed for cmake-gui)
+```
+pacman -S mingw-w64-x86_64-qt5
+```
+
+### Gcc : The GNU Compiler Collection - C and C++ frontends
+* **Gcc** for **MinGW w64-x86_64** environment (compulsory)
+
+```
+pacman -S mingw-w64-x86_64-gcc
+```
+
+* **GNU Debugger** (optional)
+
+```
+pacman -S mingw-w64-x86_64-gdb
+```
+
+### Additional developer libraries
+* **Boost**, the Free peer-reviewed portable C++ source libraries (compulsory)
+
+```
+pacman -S mingw-w64-x86_64-boost
+```
+
+* **GMP**, A free library for arbitrary precision arithmetic (optional)
+
+```
+pacman -S mingw-w64-x86_64-gmp
+```
+
+* **GNU readline** library (optional)
+
+```
+pacman -S libreadline-devel
+```
+
+### Python : the version 3 of the high-level scripting language
+Required by
+* Z3 prover compilation
+Optional otherwise
+```
+pacman -S mingw-w64-x86_64-python3
+```
diff --git a/org.eclipse.efm.symbex/resources/doc/INSTALL_SOLVERS.md b/org.eclipse.efm.symbex/resources/doc/INSTALL_SOLVERS.md
new file mode 100644
index 0000000..7c1be96
--- /dev/null
+++ b/org.eclipse.efm.symbex/resources/doc/INSTALL_SOLVERS.md
@@ -0,0 +1,546 @@
+msys64/symbex# MinGW Distro - nuwen.net
+
+* **Web** [mingw-nuwen](https://nuwen.net/mingw.html)
+* **Download & install**
+
+```
+Download: 'mingw-14.x.exe'
+Unarchive it in the root directory: 'C:\'
+```
+
+
+# SEP: Open Source Solvers compilation & installation
+
+* For Microsoft Windows platform, assume that the system **MSYS2 / MinGW64** is installed, see [INSTALL_MSYS2](INSTALL_MSYS2.md)
+
+* Assume that you have these file system configuration
+
+```
+ git-repository-local-directory
+ |__ solvers
+ |__ install
+```
+
+* Go to ```git-repository-local-directory```
+
+```sh
+cd git-repository-local-directory
+```
+
+
+## ANTLR Tools, for C++ lexer or parser, version 2.7.7
+
+* **Repository** [download](http://www.antlr2.org/download.html)
+* **Web** [antlr2.org](http://www.antlr2.org/)
+* **Get source code**
+
+```sh
+Just download it: http://www.antlr2.org/download/antlr-2.7.7.tar.gz
+```
+* **Go to** the local unarchive directory
+
+```sh
+cd antlr-2.7.7-directory
+```
+
+* **Patch** ```lib\cpp\antlr\CharScanner.hpp```
+
+```cpp
++#include <string.h>
+or
++#include <cstring>
+```
+
+* **Configuration**
+
+```sh
+./configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=/c/msys64/symbex --enable-cxx --disable-java --disable-python --disable-csharp --enable-static=true --enable-shared=false --enable-64bit
+
+--host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32
+
+#--host=i686-w64-mingw32 --build=i686-w64-mingw32
+#--host=mingw-w64-x86_64 --build=mingw-w64-x86_64
+
+
+./configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=/c/mingw/symbex --enable-cxx --disable-java --disable-python --disable-csharp --enable-static=true --enable-shared=false --enable-64bit
+```
+
+## ANTLR Tools, for C++ lexer or parser, version 3.4
+
+* **Repository** [download](http://www.antlr3.org/download/C/)
+* **Web** [antlr3.org](http://www.antlr3.org/)
+* **Get source code**
+
+```sh
+Just download it: http://www.antlr3.org/download/C/libantlr3c-3.4.tar.gz
+```
+* **Go to** the local unarchive directory
+
+```sh
+cd libantlr3c-3.4-directory
+```
+
+* **Configuration**
+
+```sh
+./configure --prefix=/c/msys64/symbex --enable-static=true --enable-shared=false --enable-64bit
+
+./configure --prefix=/c/mingw/symbex --enable-static=true --enable-shared=false --enable-64bit
+```
+
+## ANTLR Tools, for C++ lexer or parser, version 4.6
+
+* **Repository** [GitHub](https://github.com/antlr/antlr4)
+* **Doc** [cpp-target](https://github.com/antlr/antlr4/blob/master/doc/cpp-target.md)
+* **Get source code**
+
+```sh
+ git clone https://github.com/antlr/antlr4.git
+```
+* **Go to** the local clone directory
+
+```sh
+cd antlr4-directory
+```
+
+* **Configuration**
+
+```sh
+cd /runtime/Cpp
+mkdir build && mkdir run && cd build
+cmake .. -DANTLR_JAR_LOCATION=/c/msys64/symbex/source/antlr-4.6-complet.jar -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=make -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DWITH_DEMO=True
+```
+
+
+
+## GMP, The GNU Multiple Precision Arithmetic Library, version 6.1.2
+
+* **Repository** [download](https://gmplib.org/#DOWNLOAD)
+* **Web** [gmplib.org](https://gmplib.org/)
+* **Get source code**
+
+```sh
+Just download it: https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2
+```
+* **Go to** the local unarchive directory
+
+```sh
+cd gmp-6.1-directory
+```
+
+* **Configuration**
+
+```sh
+./configure --prefix=/c/msys64/symbex --enable-cxx --disable-shared
+
+./configure --prefix=/c/mingw/symbex --enable-cxx --disable-shared
+```
+
+
+## CLN, Class Library for Numbers, version 1.3.4
+
+* **Repository** [CLN](http://www.ginac.de/CLN/cln.git/)
+* **Web** [CLN](http://www.ginac.de/CLN/)
+* **Get source code**
+
+```sh
+ git clone git://www.ginac.de/cln.git
+ autoreconf -iv
+```
+* **Go to** the local clone directory
+
+```sh
+cd cln-1.3-directory
+```
+
+* **Configuration**
+
+```sh
+
+./configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=/c/msys64/symbex --with-gmp=/c/msys64/symbex --enable-static --disable-shared
+
+./configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=/c/mingw/symbex --with-gmp=/c/mingw/symbex --enable-static --disable-shared
+
+```
+
+## GiNaC is Not a CAS ()Computer Algebra System), version 1.7.1
+
+* **Repository** [GiNaC](http://www.ginac.de/ginac.git/)
+* **Web** [GiNaC](http://www.ginac.de/)
+* **Get source code**
+
+```sh
+ git clone git://www.ginac.de/ginac.git
+ autoreconf -i
+```
+* **Go to** the local clone directory
+
+```sh
+cd ginac-1.7-directory
+```
+
+* **Configuration**
+
+```sh
+
+export CLN_CFLAGS=-I/c/msys64/symbex/include
+
+export CLN_LIBS=-L/c/msys64/symbex/lib
+
+
+export LIBS="/c/msys64/symbex/lib/libcln.a /c/msys64/symbex/lib/libgmp.a -lreadline -lncurses"
+
+./configure --prefix=/c/msys64/symbex --enable-static --disable-shared
+
+
+export LIBS="/c/mingw/symbex/lib/libcln.a /c/mingw/symbex/lib/libgmp.a -lreadline -lncurses"
+
+./configure --prefix=/c/mingw/symbex --enable-static --disable-shared
+
+```
+
+
+
+
+## Omega Library, for constraint manipulation
+Omega Project Source Release, version 2.1
+
+* **Repository** [GitHub](https://github.com/davewathaverford/the-omega-project)
+
+* **Get source code**
+
+```sh
+ git clone https://github.com/davewathaverford/the-omega-project.git
+```
+* **Go to** the local clone directory
+
+```sh
+cd omega-directory
+```
+
+* **Configuration**
+ + Edit ```omega-directory/Makefile.config```
+ + Modify compiler flags ```COMPILER_CFLAGS``` and install location ```DESTDIR```
+
+```makefile
+
+# line 15: uncomment it i.e.
+X11_LIBS = -lXm -lXt -lX11 -lICE -lSM
+
+# line 18: comment it i.e.
+#X11_LIBS = #-lICE -lSM
+
+# near line 28
+COMPILER_CFLAGS=-Wall -Wno-format -Wparentheses -DSIG_HANDLER_HAS_ONE_ARG=1 -DSHUT_UP_ABOUT_STATEMENT_WITH_NO_EFFECT_IN_DYNAMIC_ARRAY_CREATION -DDAVEW_THESIS_REDUCTIONS -DSTUDY_KILL_USE
+
+# near line 83
+DESTDIR=git-repository-local-directory/install
+```
+
+* **Patch** ```basic\include\basic\assert.h```
+
+```cpp
+
+15,17c15,17
+< #ifdef WIN32
+< # define _assert(ex) ((!(ex)) ? ((void)fprintf(stderr,"\n\nAssertion \"%s\" failed: file \"%s\", line %d\n", ex, __FILE__, __LINE__), Exit(-2), 0) : 1)
+< #else
+---
+> //#ifdef WIN32
+> //# define _assert(ex) ((!(ex)) ? ((void)fprintf(stderr,"\n\nAssertion \"%s\" failed: file \"%s\", line %d\n", ex, __FILE__, __LINE__), //Exit(-2), 0) : 1)
+> //#else
+20c20
+< #endif
+---
+> //#endif
+
+```
+
+* **Patch** ```basic\include\basic\util.h```
+
+```cpp
+
+4,8c4,10
+< #ifdef WIN32
+< #define LONGLONG _int64
+< #else
+< #define LONGLONG long long
+< #endif
+---
+> #include <stdint.h>
+>
+> //#ifdef WIN32
+> #define LONGLONG int64_t
+> //#else
+> //#define LONGLONG long long
+> //#endif
+22,24c24,26
+< #ifdef WIN32
+< # define MAXLONGLONG (0x7ffffffffffffff)
+< #else
+---
+> //#ifdef WIN32
+> //# define MAXLONGLONG (0x7ffffffffffffff)
+> //#else
+26c28
+< #endif
+---
+> //#endif
+
+```
+
+* **Patch** ```omega_lib/src/omega_core/oc_simple.c```
+
+```cpp
+
+1189
+< if (GEQs[e2].coef[0] > GEQs[e].coef[0] ||
+< (GEQs[e2].coef[0] == GEQs[e].coef[0] && GEQs[e2].color))
+---
+> if (GEQs[e2].coef[0] >= GEQs[e].coef[0] && GEQs[e2].color)
+
+```
+
+* **Patch** ```omega_lib/src/closure.c```
+
+```cpp
+
+
+```
+
+* **Patch** ```omega_lib/src/pres_dnf.c```
+
+```cpp
+
+332
+< int recursive=0;
+---
+> // int recursive=0;
+
+982
+< bool empty_or=true;
+---
+> // bool empty_or=true;
+
+```
+
+
+* **Compilation**
+ + Do
+
+```sh
+make depend
+
+make libomega.a
+```
+
+* **installation**
+
+ + Do
+
+```sh
+make install
+```
+
+## CVC4, SMT Solver from New York University
+This is CVC4 release version 1.4
+
+* **Repository** [GitHub](https://github.com/CVC4/CVC4)
+
+* **Get source code**
+
+```sh
+git clone https://github.com/CVC4/CVC4.git
+```
+
+* **Go to** the local clone directory
+
+```sh
+cd cvc4-directory
+
+./autogen.sh
+```
+
+* **Patch** ```src\util\sexpr.h:line71```
+
+```cpp
+
+#ifdef CVC4_NEED_INT64_T_OVERLOADS
+ SExpr(int64_t value);
+ SExpr(uint64_t value);
+#endif /* CVC4_NEED_INT64_T_OVERLOADS */
+
+```
+
+* **Patch** ```src\util\sexpr.cpp:line127```
+
+```cpp
+
+#ifdef CVC4_NEED_INT64_T_OVERLOADS
+SExpr::SExpr(int64_t value)
+ : d_sexprType(SEXPR_INTEGER),
+ d_integerValue(value),
+ d_rationalValue(0),
+ d_stringValue(""),
+ d_children(NULL) {}
+
+SExpr::SExpr(uint64_t value)
+ : d_sexprType(SEXPR_INTEGER),
+ d_integerValue(value),
+ d_rationalValue(0),
+ d_stringValue(""),
+ d_children(NULL) {}
+#endif /* CVC4_NEED_INT64_T_OVERLOADS */
+
+```
+
+
+* **Configuration**
+ + Get & Compile the tool **antlr-3.4**
+
+```sh
+
+cd contrib/
+./get-antlr-3.4
+cd ..
+
+cd contrib/ && ./get-antlr-3.4 && cd ..
+
+```
+
+ + Configure UNIX
+
+```sh
+export LIBS="-lgmp"
+
+./configure --prefix=/home/lapitre_is148245/efm/symbex/contrib --with-antlr-dir=`pwd`/antlr-3.4 ANTLR=`pwd`/antlr-3.4/bin/antlr3 --enable-static=true --enable-shared=false --enable-static-binary --enable-proof --enable-optimized --bsd
+
+--without-cln --with-gmp
+
+--best need --with-cln
+```
+
+
+ + Configure MSYS2
+
+```sh
+export LIBS="-lgmp"
+
+export CFLAGS=-I/c/msys64/symbex/include
+export CPPFLAGS=-I/c/msys64/symbex/include
+export CXXFLAGS=-I/c/msys64/symbex/include
+export LDFLAGS=-L/c/msys64/symbex/lib
+
+./configure --prefix=/c/msys64/symbex --with-antlr-dir=`pwd`/antlr-3.4 ANTLR=`pwd`/antlr-3.4/bin/antlr3 --enable-static=true --enable-shared=false --enable-static-binary --enable-proof --enable-optimized --bsd
+
+./configure --prefix=/c/msys64/symbex --with-antlr-dir=`pwd`/antlr-3.4 ANTLR=`pwd`/antlr-3.4/bin/antlr3 --enable-static=true --enable-shared=false --enable-static-binary --enable-proof --enable-optimized --without-cln --with-gmp --bsd
+
+--with-boost=/c/msys64/mingw64/include/boost --with-boost-libdir=/c/msys64/mingw64/lib
+
+
+export LIBS="-lgmp"
+
+export CFLAGS=-I/c/mingw/symbex/include
+export CPPFLAGS=-I/c/mingw/symbex/include
+export CXXFLAGS=-I/c/mingw/symbex/include
+
+./configure --prefix=/c/mingw/symbex --with-antlr-dir=`pwd`/antlr-3.4 ANTLR=`pwd`/antlr-3.4/bin/antlr3 --enable-static=true --enable-shared=false --enable-static-binary --enable-proof --enable-optimized --bsd
+
+./configure --prefix=/c/mingw/symbex --with-antlr-dir=`pwd`/antlr-3.4 ANTLR=`pwd`/antlr-3.4/bin/antlr3 --enable-static=true --enable-shared=false --enable-static-binary --enable-proof --enable-optimized --without-cln --with-gmp --with-boost=/c/mingw/include/boost --with-boost-libdir=/c/mingw/lib --bsd
+
+
+--best need --with-cln
+```
+
+* **Compilation**
+
+Check if the `Makefile` is correct i.e. if `buildirs = <builds/$arch/$buildid>` !
+
+```sh
+make -j4
+```
+
+* **installation**
+```sh
+make install
+```
+
+
+## Z3, Theorem Prover from Microsoft Research
+This is Z3 release version 4.4.1
+
+* **Repository** [GitHub](https://github.com/Z3Prover/z3)
+
+* **Get source code**
+```sh
+ git clone https://github.com/Z3Prover/z3.git
+```
+
+* **Go to** the local clone directory
+```sh
+cd z3-directory
+```
+
+* **Configuration**
+ + Using configure
+
+```sh
+
+export LDFLAGS="-L/c/msys64/symbex/lib"
+
+export LIBS="/c/msys64/symbex/lib/libgmp.a"
+
+export Z3_INSTALL_BIN_DIR=/c/msys64/symbex/bin
+export Z3_INSTALL_LIB_DIR=/c/msys64/symbex/lib
+export Z3_INSTALL_INCLUDE_DIR=/c/msys64/symbex/include
+
+export LDFLAGS="-L/c/mingw/symbex/lib"
+
+export LIBS="/c/mingw/symbex/lib/libgmp.a"
+
+export Z3_INSTALL_BIN_DIR=/c/mingw/symbex/bin
+export Z3_INSTALL_LIB_DIR=/c/mingw/symbex/lib
+export Z3_INSTALL_INCLUDE_DIR=/c/mingw/symbex/include
+
+
+./configure CXX=g++ CC=gcc AR=ar --staticlib --staticbin --optimize --noomp
+CXX=g++ CC=gcc AR=ar ./configure --staticlib --staticbin --optimize --noomp --makefiles
+
+CXX=g++ CC=gcc AR=ar python scripts/mk_make.py --staticlib --staticbin --optimize --noomp
+python scripts/mk_make.py --staticlib --staticbin --optimize --noomp
+
+```
+
+ + Using cmake
+
+```sh
+
+cd z3-directory
+
+git clean -nx src
+git clean -fx src
+
+python contrib/cmake/bootstrap.py create
+
+./configure --staticlib --staticbin --optimize --noomp
+
+#rm -rfd build
+mkdir build && cd build
+
+cmake -G "Unix Makefiles" ../
+
+make -j4 # Replace 4 with an appropriate number
+
+```
+
+
+* **Compilation**
+```sh
+cd build
+make -j4
+```
+
+* **installation**
+```sh
+make install
+```
diff --git a/org.eclipse.efm.symbex/resources/doc/README.md b/org.eclipse.efm.symbex/resources/doc/README.md
new file mode 100644
index 0000000..f4f5782
--- /dev/null
+++ b/org.eclipse.efm.symbex/resources/doc/README.md
@@ -0,0 +1,265 @@
+# SEP, Symbolic Execution Platform: Documentation
+La palteforme est constituée des projets suivants:
+
+Projet | Descritption
+------------------------------|----------------------------------
+ org.eclipse.efm.sep.doc | Documentation, architecture générale
+ org.eclipse.efm.sep.common | Eléments communs
+ org.eclipse.efm.sep.core | Eléments de base
+ org.eclipse.efm.sep.infra | Infrastructure de données
+ org.eclipse.efm.sep.fam | Modules d'analyse formalle
+ org.eclipse.efm.sep.solver | Services de solver
+ org.eclipse.efm.sep.engine | Le moteur
+ org.eclipse.efm.sep.workflow | Le workflow
+
+Chaque projet est constitué des sections suivante:
+* **require** :> ses dépendances externes
+* **import** :> ses dépendances au sein de la SEP
+* **export** :> ses services proposées
+* **internal** :> ses éléments internes
+
+
+## org.eclipse.efm.sep.common
+Utilitaires communs à tous les autres composants
+
+### Require
+
+
+### Import
+
+
+### Export
+services de sérialisation
+services de gestion de trace de mise au point
+
+### Internal
+Les détails d'implémentation interne !
+
+
+## org.eclipse.efm.sep.core
+
+### Require
+
+
+### Import
+* **org.eclipse.efm.sep.common**
+
+### Export
+* Smart-Pointer
+
+
+### Internal
+Les détails d'implémentation interne !
+
+
+## org.eclipse.efm.sep.infra
+Infrastructure pour l'exécution symbolique
+
+### Require
+
+### Import
+* **org.eclipse.efm.sep.common**
+* **org.eclipse.efm.sep.core**
+
+
+### Export
+* Expression
+* Instruction
+* EC: Execution Context
+* ED: Execution Data
+* EVAL: Evaluation Environnement
+* EXEC: Execution Environnement
+
+### Internal
+Les détails d'implémentation interne !
+
+
+## org.eclipse.efm.sep.fam
+Module d'Analyse Formelle
+
+### Require
+
+### Import
+* **org.eclipse.efm.sep.common**
+* **org.eclipse.efm.sep.core**
+ + Smart-Pointer
+
+### Export
+
+#### IFAM: Interface of Formal Analysis Module
+C'est l'interface que doit implémenter tout Module d'Analyse Formelle.
+Il fournit des services pour intervenir dans les différentes phases du SEW, Symbolic Execution Workflow, à savoir:
+
+* **configure**, MANDATORY
+ + Définit (et vérifie?) dans quelle phase du *SE-Workflow* il va intervenir
+ + Prise en compte la configuration fournit par l'utilisateur, défini dans son **fichier.sew** (ancienmment *fichier.favm*)
+
+* **preprocess**, OPTIONAL, s'il a un traitement à effectuer, en *preprocessing*, i.e. avant la phase dynamique du processus Diversity
+* **postprocess**, OPTIONAL, s'il a un traitement à effectuer, en *postprocessing*, i.e. après la phase dynamique du processus Diversity
+
+* **prefilter**, OPTIONAL, s'il a un traitement à effectuer, en *prefiltering*, i.e. pendant la phase dynamique du processus Diversity , mais avant l'exécution symbolique proprement dite
+
+* **postfilter**, OPTIONAL, s'il a un traitement à effectuer, en *postfiltering*, i.e. pendant la phase dynamique du processus Diversity , mais après l'exécution symbolique proprement dite
+
+
+* **report**, OPTIONAL, pour proposer un bilan de l'analyse formelle effectuée
+
+Soit par exemple:
+
+```cpp
+class MyFAM : public AutoRegisteredFAM< MyFAM >,
+{
+ // MANDATORY for Smart Pointer services
+ AVM_DECLARE_CLONABLE_CLASS( MyFAM )
+
+ /**
+ * MyFAM
+ * for automatic registration in the FAM repository
+ * the UFID key
+ * need for instanciation from the SEW specification file
+ */
+ AVM_INJECT_AUTO_REGISTER_UFID_KEY( "MyFAM" )
+ // end registration
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+
+public:
+ /**
+ * CONSTRUCTOR
+ */
+ MyFAM(CentralProcessorUnit & aManager, Form * aParameterForm)
+ : AutoRegisteredFAM(aManager, aParameterForm,
+ AVM_PRE_FILTERING_STAGE | AVM_POST_FILTERING_STAGE, ...),
+
+ /**
+ * CONFIGURE
+ */
+ bool configureImpl();
+
+ /**
+ * REPORT TRACE
+ */
+ virtual void reportDefault(AvmOstream & os) const;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PROCESSING API
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * preProcessing
+ */
+ virtual bool preprocess();
+
+ /**
+ * postprocessing
+ */
+ virtual bool postprocess();
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FILTERING API
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * preFiltering
+ */
+ virtual bool prefilter(ExecutionContext * anEC);
+
+ /**
+ * postFiltering
+ * Every post filter has to implement this method
+ */
+ virtual bool postfilter(ExecutionContext * anEC);
+};
+
+```
+
+
+#### CPU: Central Processor Unit
+C'est le scheduler qui gère l'activation les FAMs dans les différentes phases de l'exécution (voir *section MOE* dans le *fichier SEW/FAVM* de spécification du workflow)
+
+#### MPU: Main Processor Unit
+C'est le FAM principal, toujours actif, ayant la charge de
+
+* gérer les "critèrse d'arrêts" (voir *fichier SEW/FAVM* dans le fichier
+* détecter les *deadlocks* d'exécution (noeud sans fils en *postprefiltering*)
+* diverses traitementents internes, tel l'attribution d'un identifiant (numéro) de largeur dans le graphe d'exécution
+* ...
+
+
+#### Some FAMs
+* FAM Coverage (state / transition -- input / output, ...) :pour les analyses dédiées couvertures structurelles des modèles
+* FAM Hit or Jump : pour la sélection de comportement à partir de trace fournie par l'utilisateur
+* FAM Testing (Online / Offline) : pour calculer un verdict associé à un *objectif de test* en mode *online/offline*
+
+### Internal
+Les détails d'implémentation interne !
+
+
+## org.eclipse.efm.sep.solver
+
+### Require
+* CVC4, le solver de l'université de New York hébergé [ici](http://cvc4.cs.nyu.edu/web/) et sur Github [ici](https://github.com/CVC4/CVC4)
+* Z3, le solver open-source de Microsoft hébergé [ici](https://github.com/Z3Prover/z3/wiki) et sur Github [ici](https://github.com/Z3Prover/z3)
+
+### Import
+* **org.eclipse.efm.sep.common**
+ + Outils de mise au point
+
+* **org.eclipse.efm.sep.core**
+ + Smart-Pointer
+
+* **org.eclipse.efm.sep.infra**
+ + Expression
+
+### Export
+**org.eclipse.efm.sep.solver.ISolver** défini l'interface des services attendus d'un solver, pour un prédicat booléen donné, tel:
+* **checkSatisfiability()** pour vérifier (ou *checker*) sa satisfiabilité i.e.
+ + SAT, satisfiable
+ + UNSAT, non-satisfiable
+ + ABORT, échec (par abandon) de la vérification
+ + UNKNOWN, satisfiabilité inconnu !
+* **checkModel()** pour obtenir, si posssible, un modèle concrèt la validant
+
+**org.eclipse.efm.sep.solver.SolverFactory** est une factory permettant:
+* l'instanciation d'un solver pariculier,
+* l'accès au solver instancié par défaut.
+
+### Internal
+Les détails d'implémentation interne !
+
+
+## org.eclipse.efm.sep.engine
+Instancie et exécute la plateforme d'analyse symbolique définie dans le *workflow*
+
+### Require
+* Rien
+
+### Import
+**org.eclipse.efm.sep.**
+* tous les autres composants de la plateforme SEP.
+
+### Export
+L'exécutable résultant
+
+### Internal
+Les détails d'implémentation interne !
+* CPU: Central Processor Unit
+* MPU: Main Processor Unit
+
+
+## org.eclipse.efm.sep.
+
+### Require
+
+
+### Import
+
+
+### Export
+
+
+### Internal
+Les détails d'implémentation interne !
diff --git a/org.eclipse.efm.symbex/resources/doc/SYMBOLIC_EXECUTION_WORKFLOW.md b/org.eclipse.efm.symbex/resources/doc/SYMBOLIC_EXECUTION_WORKFLOW.md
new file mode 100644
index 0000000..b3de396
--- /dev/null
+++ b/org.eclipse.efm.symbex/resources/doc/SYMBOLIC_EXECUTION_WORKFLOW.md
@@ -0,0 +1,313 @@
+# SEW, Symbolic Execution Workflow Specification
+
+## Class Workflow
+* **workspace** as Virtual File System for the Workflow
+* **projet** as the specification
+* **job** as analysis jobs
+
+```sew
+
+Workflow <sew-id> "<description> of the Symbolic Execution Workflow" {
+ workspace {
+ //...
+ }
+
+ project {
+ //...
+ }
+
+ // Default Job
+ job = Job <id> "<description>" {
+ // ...
+ }
+
+ // Additional Job
+ job += Job <id> "<description>" {
+ // ...
+ }
+
+ /*
+ sop : Sequence
+ | Parallel
+ */
+ scheduler = <sop> {
+ start <jod-id-1>
+ start <jod-id-1>
+ }
+}
+
+```
+
+
+### Class Workspace
+* **root** as workspace native file system path
+* **source** as workspace source folder
+* **output** as workspace output folder
+* **log** as workspace output log folder
+
+```sew
+
+workspace {
+ // Chemin absolu ou relatif (au dossier de lancement!) du projet SEW
+ root = <path>
+ // Chemin relatif à @project (ou absolu!) du dossier contenant les fichiers XFSP
+ source = <path>
+ // Chemin relatif à @project (ou absolu!) du dossier principal des fichiers générés par DIVERSITY
+ output = <path>
+ // Chemin relatif à @output (ou absolu!) du dossier des fichiers log et debug
+ log = <path>
+}
+
+```
+
+
+### Class Project
+
+```sew
+
+project {
+ // ...
+}
+
+```
+
+
+
+
+### Class SAJ, Symbolic Analysis Job
+* **stream** as default interaction streams
+* **project** as analyzed specification
+* **serializer** as default serializers
+* **fam** as Formal Analysis Module
+
+
+```sew
+
+ stream {
+ // ...
+ }
+
+ project {
+ //...
+ }
+
+ main = MainAnalysisModule <id> "<description> of the Main Analysis Module" {
+ // ...
+ }
+
+ serializer = GraphVizStatemachineSerializer <id> "<description>" {
+ // ...
+ }
+
+ serializer = GraphVizExecutionGraphSerializer <id> "<description>" {
+ // ...
+ }
+
+
+ fam += StateTransitionCoverageModule "State/Transition Coverage Analysis Module" {
+ // ...
+ }
+
+ fam += HitOrJumpModule "Hit or Jump Analysis Module" {
+ // ...
+ }
+
+
+ fam "Formal Analysis Module" = hitorjump {
+ // "Processor" de gestion des critères d'arrêt absolus (paramètres utilisateur)
+ main {
+ @property:
+
+ log:
+
+ debug {
+
+ }
+
+ queue {
+
+ }
+ }
+ }
+
+}
+
+```
+
+#### Class Stream
+* **stdin** as Standard Input Stream
+* **stdout** as Standard Output Stream
+* **stderr** as Standard Error Stream
+
+* **project** as model specification
+
+
+```sew
+
+stream {
+ /*
+ uri : std "::" ( 'cout' | 'cerr' | 'cin' )
+ | sew "::" ( 'log' | 'trace' )
+ | folder "::" <path>
+ | file "::" <path>
+ | filename "::" <path>
+ | socket "::" <host-id> ":" <port-number>
+ */
+ stdin = <uri>
+ stdout = <uri>
+ stderr = <uri>
+
+ // ...
+}
+
+```
+
+
+#### Class Project
+* **model** as FormalML Concrete Syntax model
+
+```sew
+
+project {
+ // Chemin relatif à @workspace::source (ou absolu!)
+ model = <FormalML-Concrete-Syntax.fml>
+
+ // ...
+}
+
+```
+
+#### Class FAM, Formal Analysis Module/Plugin
+* **priority** as *scheduler priority* in the workflow
+
+```sew
+
+fam += CoverageFAM "Transition Coverage Analysis Module" {
+ priority {
+ // ...
+ }
+}
+
+```
+
+
+##### Class Priority
+* **preprocess** as preprocessing thread priority
+* **prefilter** as prefiltering thread priority
+* **postfilter** as postfiltering thread priority
+* **postprocess** as postprocessing thread priority
+
+```sew
+
+priority {
+ preprocess = <integer>
+ prefilter = <integer>
+ postfilter = <integer>
+ postprocess = <integer>
+
+ // ...
+}
+
+```
+
+
+#### Class MainAnalysisModule
+* **queue** as Symbolic Execution Queue
+* **limit** as Symbolic Execution Processing Limit
+
+```sew
+
+main += MainAnalysisModule <id> "<description> of the MAM" {
+ queue <id> "Symbolic Execution Queue" {
+ // ...
+ }
+
+ limit <id> "Symbolic Execution Processing Limit" {
+ // ...
+ }
+
+ // Nombre de noeud MAXIMAL (-1 <=> no-limit) de l'arbre d'évaluation symbolique
+ node = <integer>
+
+ // Nombre de pas de calcul MAXIMAL (-1 <=> no-limit) du moteur d'évaluation symbolique
+ @eval = <integer>;
+
+ // Hauteur MAXIMALE
+ @height = <integer>;
+
+ // Largeur MAXIMALE
+ @width = <integer>;
+
+ // ...
+}
+
+```
+
+##### Class Queue
+* **policy** as *enqueue/dequeue policy* of the queue
+
+```sew
+
+queue <id> "<description> of the Symbolic Execution Queue" {
+ /*
+ 'BFS' | 'BREADTH_FIRST_SEARCH'
+ 'DFS' | 'DEPTH_FIRST_SEARCH'
+ 'RFS' | 'RANDOM_FIRST_SEARCH'
+ 'WEIGHT::{ DFS | BFS | RFS | XFS }'
+ */
+ policy = <policy>
+
+ // ...
+}
+
+```
+
+
+#### Class Serializer
+
+##### Class GraphVizStatemachineSerializer
+
+```sew
+
+serializer += GraphVizStatemachineSerializer <id> "<description>" {
+ // ...
+}
+
+```
+
+##### Class GraphVizExecutionGraphSerializer
+
+```sew
+
+serializer += GraphVizExecutionGraphSerializer <id> "<description>" {
+ // ...
+}
+
+```
+
+
+#### Class StateTransitionCoverageModule
+
+```sew
+
+fam += StateTransitionCoverageModule "State/Transition Coverage Analysis Module" {
+ // ...
+}
+
+```
+
+
+#### Class HitOrJumpModule
+
+```sew
+
+fam += HitOrJumpModule <id> "<description>" {
+ // ...
+}
+
+```
+
+
+
+
+
diff --git a/org.eclipse.efm.symbex/src/CMakeLists.txt b/org.eclipse.efm.symbex/src/CMakeLists.txt
new file mode 100644
index 0000000..60dc121
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/CMakeLists.txt
@@ -0,0 +1,24 @@
+# =============================================================================
+# CMake Master File for Symbex Build
+# =============================================================================
+#
+# Note : This file defines the whole process
+#
+# =============================================================================
+
+# Minimum required CMake version
+cmake_minimum_required (VERSION 2.8 FATAL_ERROR)
+
+# Tell cmake where to find its own modules
+list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) # Common modules
+list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/src/cmake) # Specific modules
+
+# Print title banner
+set (BANNER_MESSAGE "This is Symbex Build System")
+include (PrintBanner)
+
+# Generating information headers
+include (GenerateInfoHeaders)
+
+# Project definition (directories hierarchy, main target sources, link)
+include (DefineSymbexProject)
diff --git a/org.eclipse.efm.symbex/src/GUIDELINES.md b/org.eclipse.efm.symbex/src/GUIDELINES.md
new file mode 100644
index 0000000..8c6c59f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/GUIDELINES.md
@@ -0,0 +1,6 @@
+# EFM-SYMBEX : Eclipse Formal Modeling - Symbolic Execution Platform
+
+## Rules
+
+* Output stream for live debugging : AVM_OS_DEBUG
+
diff --git a/org.eclipse.efm.symbex/src/README.md b/org.eclipse.efm.symbex/src/README.md
new file mode 100644
index 0000000..d38e6df
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/README.md
@@ -0,0 +1,51 @@
+# EFM-SYMBEX : Eclipse Formal Modeling - Symbolic Execution Platform
+
+## Source code structure
+
+
+### Package *base*
+[Base Classes](base/README.md)
+
+
+### Package *common*
+[Common Classes](common/README.md)
+
+
+### Package *core*
+
+[Core Classes](core/README.md)
+
+
+### Package *fml*
+[Formal Modeling Language](fml/README.md)
+
+
+### Package *parser*
+[Parser Classes](parser/README.md)
+
+
+### Package *compiler*
+[Compiler Classes](compiler/README.md)
+
+
+### Package *context*
+[Context Classes](context/README.md)
+
+### Package *sew*
+[Symbolic Execution Workflow Classes](sew/README.md)
+
+
+### Package *fam*
+[Formal Analysis Module Classes](fam/README.md)
+
+
+### Package *solver*
+[Solver Classes](solver/README.md)
+
+
+### Package *util*
+[Util Classes](util/README.md)
+
+
+### Package *main*
+[Main CPP Classes](main/README.md)
diff --git a/org.eclipse.efm.symbex/src/base/CMakeLists.txt b/org.eclipse.efm.symbex/src/base/CMakeLists.txt
new file mode 100644
index 0000000..8307359
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/base/CMakeLists.txt
@@ -0,0 +1,17 @@
+# =============================================================================
+# CMake file for the BASE library
+# =============================================================================
+
+# C++ source files to take into account (all files matching patterns recursively)
+file (GLOB_RECURSE BASE_CXX_SRC_FILES *.cpp *.h)
+
+# Target to build
+add_library (base STATIC ${BASE_CXX_SRC_FILES})
+
+# Include directories (internal)
+target_include_directories (base PUBLIC ..) # FIXME : explicit the dependencies lib by lib
+
+
+# Target include directories (external)
+target_include_directories (base PUBLIC ${GMP_INCLUDE_DIR} ${GMPXX_INCLUDE_DIR})
+target_include_directories (base PUBLIC ${Boost_INCLUDE_DIRS})
diff --git a/org.eclipse.efm.symbex/src/base/ClassKindInfo.cpp b/org.eclipse.efm.symbex/src/base/ClassKindInfo.cpp
new file mode 100644
index 0000000..e528f51
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/base/ClassKindInfo.cpp
@@ -0,0 +1,870 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 déc. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ClassKindInfo.h"
+
+#include <common/NamedElement.h>
+
+#include <printer/OutStream.h>
+
+#include <fam/coverage/FormulaCoverageFilter.h>
+
+#include <fml/common/BehavioralElement.h>
+#include <fml/common/PropertyElement.h>
+#include <fml/common/ObjectElement.h>
+
+#include <fml/builtin/Boolean.h>
+#include <fml/builtin/BuiltinForm.h>
+#include <fml/builtin/Character.h>
+#include <fml/builtin/Identifier.h>
+#include <fml/builtin/String.h>
+
+#include <fml/buffer/BaseBufferQueue.h>
+#include <fml/buffer/BroadcastBuffer.h>
+#include <fml/buffer/FifoBuffer.h>
+#include <fml/buffer/LifoBuffer.h>
+#include <fml/buffer/MultiFifoBuffer.h>
+#include <fml/buffer/MultiLifoBuffer.h>
+#include <fml/buffer/MultisetBuffer.h>
+#include <fml/buffer/RamBuffer.h>
+#include <fml/buffer/SetBuffer.h>
+
+#include <fml/executable/AvmLambda.h>
+#include <fml/executable/AvmProgram.h>
+#include <fml/executable/AvmTransition.h>
+#include <fml/executable/BaseInstanceForm.h>
+#include <fml/executable/BaseAvmProgram.h>
+#include <fml/executable/ComRouteData.h>
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/ExecutableSystem.h>
+#include <fml/executable/InstanceOfBuffer.h>
+#include <fml/executable/InstanceOfConnect.h>
+#include <fml/executable/InstanceOfData.h>
+#include <fml/executable/InstanceOfMachine.h>
+#include <fml/executable/InstanceOfPort.h>
+#include <fml/executable/Router.h>
+#include <fml/executable/RoutingData.h>
+
+#include <fml/expression/BuiltinArray.h>
+#include <fml/expression/BuiltinQueue.h>
+#include <fml/expression/BuiltinContainer.h>
+#include <fml/expression/ExpressionFactory.h>
+
+#include <fml/infrastructure/Buffer.h>
+#include <fml/infrastructure/Channel.h>
+#include <fml/infrastructure/ComPoint.h>
+#include <fml/infrastructure/ComRoute.h>
+#include <fml/infrastructure/Connector.h>
+#include <fml/infrastructure/DataType.h>
+//#include <infrastructure/Instance.h>
+#include <fml/infrastructure/Machine.h>
+#include <fml/infrastructure/Package.h>
+#include <fml/infrastructure/Port.h>
+#include <fml/infrastructure/Routine.h>
+#include <fml/infrastructure/System.h>
+#include <fml/infrastructure/Transition.h>
+#include <fml/infrastructure/Variable.h>
+
+#include <fml/numeric/Float.h>
+#include <fml/numeric/Integer.h>
+#include <fml/numeric/Number.h>
+#include <fml/numeric/Rational.h>
+
+#include <fml/operator/Operator.h>
+
+#include <fml/runtime/ExecutionConfiguration.h>
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/Message.h>
+#include <fml/runtime/RuntimeForm.h>
+#include <fml/runtime/RuntimeID.h>
+
+#include <fml/trace/TracePoint.h>
+#include <fml/trace/TraceSequence.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+#include <fml/type/BaseSymbolTypeSpecifier.h>
+#include <fml/type/ClassTypeSpecifier.h>
+#include <fml/type/ContainerTypeSpecifier.h>
+#include <fml/type/EnumTypeSpecifier.h>
+#include <fml/type/IntervalTypeSpecifier.h>
+#include <fml/type/TypeAliasSpecifier.h>
+#include <fml/type/UnionTypeSpecifier.h>
+
+#include <fml/workflow/UniFormIdentifier.h>
+#include <fml/workflow/WObject.h>
+
+
+namespace sep
+{
+
+
+ClassKindInfo * ClassKindInfo::TYPE_UNDEFINED_INFO;
+
+class_kind_t ClassKindInfoInitializer::TYPE_NEW_ID = 0;
+
+std::vector< ClassKindInfo * > * ClassKindInfoInitializer::CKI_TABLE;
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// INITIALIZATION / DESTRUCTION INVARIANT
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+#define INIT_CLASS_KIND_INFO( T ) \
+ do { \
+ ClassKindInfoInitializer::classKindInfo< T >().mNAME = #T; \
+ } while( false )
+
+static avm_uint16_t NIFTY_COUNTER = 0;
+
+ClassKindInfoInitializer::ClassKindInfoInitializer()
+{
+ if( (0 == NIFTY_COUNTER++) && (0 == TYPE_NEW_ID) )
+ {
+ // STATIC INITIALIZATION DEPENDANCY
+ CKI_TABLE = new std::vector< ClassKindInfo * >();
+
+ ClassKindInfo::TYPE_UNDEFINED_INFO =
+ new ClassKindInfo(TYPE_UNDEFINED_ID, "#undefined");
+
+ // TYPE_NEW_ID == 0 for ClassKindInfo::TYPE_UNDEFINED_INFO
+ TYPE_NEW_ID = 1;
+
+
+ ////////////////////////////////////////////////////////////////////////
+ //PREDEFINED CLASS KIND w.r.t. ENUM_CLASS_KIND ORDER
+ ////////////////////////////////////////////////////////////////////////
+
+ // BUILTIN
+ INIT_CLASS_KIND_INFO( Boolean );
+
+ INIT_CLASS_KIND_INFO( Character );
+
+ INIT_CLASS_KIND_INFO( Integer );
+
+ INIT_CLASS_KIND_INFO( Rational );
+
+ INIT_CLASS_KIND_INFO( Float );
+
+ INIT_CLASS_KIND_INFO( String );
+
+ INIT_CLASS_KIND_INFO( Identifier );
+ INIT_CLASS_KIND_INFO( QualifiedIdentifier );
+
+ // OPERATOR
+ INIT_CLASS_KIND_INFO( Operator );
+
+ // EXPRESSION , STATEMENT
+ INIT_CLASS_KIND_INFO( AvmCode );
+
+ // EXECUTABLE OBJECT INSTANCE
+ INIT_CLASS_KIND_INFO( InstanceOfBuffer );
+ INIT_CLASS_KIND_INFO( InstanceOfConnect );
+ INIT_CLASS_KIND_INFO( InstanceOfData );
+ INIT_CLASS_KIND_INFO( InstanceOfMachine );
+ INIT_CLASS_KIND_INFO( InstanceOfPort );
+
+ // EXECUTABLE OBJECT
+ INIT_CLASS_KIND_INFO( AvmLambda );
+ INIT_CLASS_KIND_INFO( AvmProgram );
+ INIT_CLASS_KIND_INFO( AvmTransition );
+
+ INIT_CLASS_KIND_INFO( ExecutableForm );
+ INIT_CLASS_KIND_INFO( ExecutableSystem );
+
+ // RUNTIME OBJECT
+ INIT_CLASS_KIND_INFO( RuntimeID );
+ INIT_CLASS_KIND_INFO( RuntimeForm );
+
+ // EXECUTION OBJECT
+ INIT_CLASS_KIND_INFO( ExecutionConfiguration );
+
+ INIT_CLASS_KIND_INFO( ExecutionData );
+ INIT_CLASS_KIND_INFO( ExecutionContext );
+
+ // WORKFLOW CONFIGURATION
+ INIT_CLASS_KIND_INFO( WObject );
+
+ // LIA or FSP
+ INIT_CLASS_KIND_INFO( UniFormIdentifier );
+
+ // XLIA or XFSP
+ INIT_CLASS_KIND_INFO( Buffer );
+ INIT_CLASS_KIND_INFO( Channel );
+ INIT_CLASS_KIND_INFO( ComPoint );
+ INIT_CLASS_KIND_INFO( ComRoute );
+ INIT_CLASS_KIND_INFO( Connector );
+ INIT_CLASS_KIND_INFO( Machine );
+// INIT_CLASS_KIND_INFO( Instance );
+ INIT_CLASS_KIND_INFO( Package );
+ INIT_CLASS_KIND_INFO( Port );
+ INIT_CLASS_KIND_INFO( Routine );
+ INIT_CLASS_KIND_INFO( System );
+ INIT_CLASS_KIND_INFO( Transition );
+ INIT_CLASS_KIND_INFO( Variable );
+ // DATA TYPE
+ INIT_CLASS_KIND_INFO( DataType );
+
+ // ARRAY
+ INIT_CLASS_KIND_INFO( ArrayBoolean );
+ INIT_CLASS_KIND_INFO( ArrayCharacter );
+ INIT_CLASS_KIND_INFO( ArrayInteger );
+ INIT_CLASS_KIND_INFO( ArrayRational );
+ INIT_CLASS_KIND_INFO( ArrayFloat );
+ INIT_CLASS_KIND_INFO( ArrayString );
+
+ INIT_CLASS_KIND_INFO( ArrayIdentifier );
+ INIT_CLASS_KIND_INFO( ArrayQualifiedIdentifier );
+
+ INIT_CLASS_KIND_INFO( ArrayBF );
+
+ // CONTAINER
+ INIT_CLASS_KIND_INFO( BuiltinVector );
+ INIT_CLASS_KIND_INFO( BuiltinReverseVector );
+ INIT_CLASS_KIND_INFO( BuiltinList );
+ INIT_CLASS_KIND_INFO( BuiltinSet );
+ INIT_CLASS_KIND_INFO( BuiltinBag );
+ INIT_CLASS_KIND_INFO( BuiltinFifo );
+ INIT_CLASS_KIND_INFO( BuiltinLifo );
+
+ // BUFFER
+ INIT_CLASS_KIND_INFO( FifoBuffer );
+ INIT_CLASS_KIND_INFO( LifoBuffer );
+ INIT_CLASS_KIND_INFO( MultiFifoBuffer );
+ INIT_CLASS_KIND_INFO( MultiLifoBuffer );
+ INIT_CLASS_KIND_INFO( MultisetBuffer );
+ INIT_CLASS_KIND_INFO( SetBuffer );
+ INIT_CLASS_KIND_INFO( BroadcastBuffer );
+ INIT_CLASS_KIND_INFO( RamBuffer );
+
+ // COM
+ INIT_CLASS_KIND_INFO( Message );
+ INIT_CLASS_KIND_INFO( ComRouteData );
+ INIT_CLASS_KIND_INFO( Router );
+ INIT_CLASS_KIND_INFO( RoutingData );
+
+ // OTHER
+ INIT_CLASS_KIND_INFO( FormulaData );
+
+ // EXECUTION TRACE
+ INIT_CLASS_KIND_INFO( TracePoint );
+ INIT_CLASS_KIND_INFO( TraceSequence );
+
+AVM_IF_DEBUG_LEVEL_FLAG( ULTRA , COMPILING )
+ toStreamTable(AVM_OS_COUT,
+ "ClassKindInfoInitializer::ClassKindInfoInitializer");
+AVM_ENDIF_DEBUG_LEVEL_FLAG( ULTRA , COMPILING )
+ }
+}
+
+
+ClassKindInfoInitializer::~ClassKindInfoInitializer()
+{
+ if( 0 == --NIFTY_COUNTER )
+ {
+// toStreamTable(std::cout, ~ClassKindInfoInitializer);
+//
+// ClassKindInfoInitializer::CKI_TABLE->clear();
+
+ delete( CKI_TABLE );
+ delete( ClassKindInfo::TYPE_UNDEFINED_INFO );
+ }
+}
+
+
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+ClassKindInfo::ClassKindInfo(class_kind_t aClassKind, const char * tname)
+: mKIND( aClassKind ),
+mTNAME( tname ),
+mNAME( tname )
+{
+ ClassKindInfoInitializer::CKI_TABLE->push_back( this );
+}
+
+
+std::string ClassKindInfo::info() const
+{
+ return( OSS() << "typeinfo< " << std::setw(3) << ((avm_size_t) mKIND)
+ << " , " << mNAME << FQN_ID_ROOT_SEPARATOR << mTNAME << " >" );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+void ClassKindInfoInitializer::toStreamTable(
+ OutStream & os, const std::string & msg)
+{
+ os << TAB << msg << ":>" << std::endl;
+ std::vector< ClassKindInfo * >::const_iterator it = CKI_TABLE->begin();
+ std::vector< ClassKindInfo * >::const_iterator endIt = CKI_TABLE->end();
+ for( ; it != endIt ; ++it )
+ {
+ os << TAB2 << (*it)->info() << EOL;
+ }
+
+ os << TAB << "CKI_TABLE.size: " << CKI_TABLE->size() << EOL;
+ os << TAB << "CKI_NEW_ID : " << ((avm_size_t) TYPE_NEW_ID) << EOL;
+ os << TAB << "NIFTY_COUNTER : " << NIFTY_COUNTER << EOL;
+
+ os << TAB << "end" << EOL_FLUSH;
+}
+
+
+
+
+#define CHECK_CLASS_KIND_INFO( T , K ) \
+ do { \
+ if( CLASS_KIND_T( T ) != ((class_kind_t) K) ) \
+ { \
+ std::cout << "FATAL_ERROR :> " << #T << " : " \
+ << ((avm_size_t) CLASS_KIND_T( T )) << " =/= " \
+ << ((avm_size_t) K) << " : " << #K << "!!!" << std::endl; \
+ } \
+ } while( false )
+
+
+static void checkClassKindInfo_w_r_t_EnumClassKind()
+{
+// std::cout << "checkClassKindInfo_w_r_t_EnumClassKind :>" << std::endl;
+
+ // BUILTIN
+ CHECK_CLASS_KIND_INFO( Boolean , FORM_BUILTIN_BOOLEAN_KIND );
+
+ CHECK_CLASS_KIND_INFO( Character , FORM_BUILTIN_CHARACTER_KIND );
+
+ CHECK_CLASS_KIND_INFO( Integer , FORM_BUILTIN_INTEGER_KIND );
+ CHECK_CLASS_KIND_INFO( Rational , FORM_BUILTIN_RATIONAL_KIND );
+ CHECK_CLASS_KIND_INFO( Float , FORM_BUILTIN_FLOAT_KIND );
+
+ CHECK_CLASS_KIND_INFO( String , FORM_BUILTIN_STRING_KIND );
+ CHECK_CLASS_KIND_INFO( Identifier , FORM_BUILTIN_IDENTIFIER_KIND );
+ CHECK_CLASS_KIND_INFO( QualifiedIdentifier, FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND );
+
+ // OPERATOR
+ CHECK_CLASS_KIND_INFO( Operator , FORM_OPERATOR_KIND );
+
+ // EXPRESSION , STATEMENT
+ CHECK_CLASS_KIND_INFO( AvmCode , FORM_AVMCODE_KIND );
+
+ // EXECUTABLE OBJECT INSTANCE
+ CHECK_CLASS_KIND_INFO( InstanceOfBuffer , FORM_INSTANCE_BUFFER_KIND );
+ CHECK_CLASS_KIND_INFO( InstanceOfConnect , FORM_INSTANCE_CONNECTOR_KIND );
+ CHECK_CLASS_KIND_INFO( InstanceOfData , FORM_INSTANCE_DATA_KIND );
+ CHECK_CLASS_KIND_INFO( InstanceOfMachine , FORM_INSTANCE_MACHINE_KIND );
+ CHECK_CLASS_KIND_INFO( InstanceOfPort , FORM_INSTANCE_PORT_KIND );
+
+ // EXECUTABLE OBJECT
+ CHECK_CLASS_KIND_INFO( AvmLambda , FORM_AVMLAMBDA_KIND );
+ CHECK_CLASS_KIND_INFO( AvmProgram , FORM_AVMPROGRAM_KIND );
+ CHECK_CLASS_KIND_INFO( AvmTransition , FORM_AVMTRANSITION_KIND );
+ CHECK_CLASS_KIND_INFO( ExecutableForm , FORM_EXECUTABLE_MACHINE_KIND );
+ CHECK_CLASS_KIND_INFO( ExecutableSystem , FORM_EXECUTABLE_SYSTEM_KIND );
+
+ // RUNTIME OBJECT
+ CHECK_CLASS_KIND_INFO( RuntimeID , FORM_RUNTIME_ID_KIND );
+ CHECK_CLASS_KIND_INFO( RuntimeForm , FORM_RUNTIME_KIND );
+
+ // EXECUTION OBJECT
+ CHECK_CLASS_KIND_INFO( ExecutionConfiguration , FORM_EXECUTION_CONFIGURATION_KIND );
+ CHECK_CLASS_KIND_INFO( ExecutionData , FORM_EXECUTION_DATA_KIND );
+ CHECK_CLASS_KIND_INFO( ExecutionContext , FORM_EXECUTION_CONTEXT_KIND );
+
+ // WORKFLOW CONFIGURATION
+ CHECK_CLASS_KIND_INFO( WObject , FORM_WOBJECT_KIND );
+
+ // LIA or FSP
+ CHECK_CLASS_KIND_INFO( UniFormIdentifier , FORM_UFI_KIND );
+
+ // XLIA or XFSP
+ CHECK_CLASS_KIND_INFO( Buffer , FORM_XFSP_BUFFER_KIND );
+ CHECK_CLASS_KIND_INFO( Channel , FORM_XFSP_CHANNEL_KIND );
+ CHECK_CLASS_KIND_INFO( ComPoint , FORM_XFSP_COM_POINT_KIND );
+ CHECK_CLASS_KIND_INFO( ComRoute , FORM_XFSP_COM_ROUTE_KIND );
+ CHECK_CLASS_KIND_INFO( Connector , FORM_XFSP_CONNECTOR_KIND );
+ CHECK_CLASS_KIND_INFO( Machine , FORM_XFSP_MACHINE_KIND );
+// CHECK_CLASS_KIND_INFO( Instance , FORM_XFSP_INSTANCE_KIND );
+ CHECK_CLASS_KIND_INFO( Package , FORM_XFSP_PACKAGE_KIND );
+ CHECK_CLASS_KIND_INFO( Port , FORM_XFSP_PORT_KIND );
+ CHECK_CLASS_KIND_INFO( Routine , FORM_XFSP_ROUTINE_KIND );
+ CHECK_CLASS_KIND_INFO( System , FORM_XFSP_SYSTEM_KIND );
+ CHECK_CLASS_KIND_INFO( Transition , FORM_XFSP_TRANSITION_KIND );
+ CHECK_CLASS_KIND_INFO( Variable , FORM_XFSP_VARIABLE_KIND );
+ // DATA TYPE
+ CHECK_CLASS_KIND_INFO( DataType , FORM_XFSP_DATATYPE_KIND );
+
+ // ARRAY
+ CHECK_CLASS_KIND_INFO( ArrayBoolean , FORM_ARRAY_BOOLEAN_KIND );
+ CHECK_CLASS_KIND_INFO( ArrayCharacter , FORM_ARRAY_CHARACTER_KIND );
+ CHECK_CLASS_KIND_INFO( ArrayInteger , FORM_ARRAY_INTEGER_KIND );
+ CHECK_CLASS_KIND_INFO( ArrayRational , FORM_ARRAY_RATIONAL_KIND );
+ CHECK_CLASS_KIND_INFO( ArrayFloat , FORM_ARRAY_FLOAT_KIND );
+ CHECK_CLASS_KIND_INFO( ArrayString , FORM_ARRAY_STRING_KIND );
+ CHECK_CLASS_KIND_INFO( ArrayIdentifier , FORM_ARRAY_IDENTIFIER_KIND );
+ CHECK_CLASS_KIND_INFO( ArrayQualifiedIdentifier ,
+ FORM_ARRAY_QUALIFIED_IDENTIFIER_KIND );
+ CHECK_CLASS_KIND_INFO( ArrayBF , FORM_ARRAY_BF_KIND );
+
+ // CONTAINER
+ CHECK_CLASS_KIND_INFO( BuiltinVector , FORM_CONTAINER_VECTOR_KIND );
+ CHECK_CLASS_KIND_INFO( BuiltinReverseVector ,
+ FORM_CONTAINER_REVERSE_VECTOR_KIND );
+ CHECK_CLASS_KIND_INFO( BuiltinList , FORM_CONTAINER_LIST_KIND );
+ CHECK_CLASS_KIND_INFO( BuiltinSet , FORM_CONTAINER_SET_KIND );
+ CHECK_CLASS_KIND_INFO( BuiltinBag , FORM_CONTAINER_BAG_KIND );
+ CHECK_CLASS_KIND_INFO( BuiltinFifo , FORM_CONTAINER_FIFO_KIND );
+ CHECK_CLASS_KIND_INFO( BuiltinLifo , FORM_CONTAINER_LIFO_KIND );
+
+ // BUFFER
+ CHECK_CLASS_KIND_INFO( FifoBuffer , FORM_BUFFER_FIFO_KIND );
+ CHECK_CLASS_KIND_INFO( LifoBuffer , FORM_BUFFER_LIFO_KIND );
+ CHECK_CLASS_KIND_INFO( MultiFifoBuffer , FORM_BUFFER_MULTI_FIFO_KIND );
+ CHECK_CLASS_KIND_INFO( MultiLifoBuffer , FORM_BUFFER_MULTI_LIFO_KIND );
+
+ CHECK_CLASS_KIND_INFO( MultisetBuffer , FORM_BUFFER_MULTISET_KIND );
+ CHECK_CLASS_KIND_INFO( SetBuffer , FORM_BUFFER_SET_KIND );
+
+ CHECK_CLASS_KIND_INFO( BroadcastBuffer , FORM_BUFFER_BROADCAST_KIND );
+ CHECK_CLASS_KIND_INFO( RamBuffer , FORM_BUFFER_RAM_KIND );
+
+ // COM
+ CHECK_CLASS_KIND_INFO( Message , FORM_MESSAGE_KIND );
+ CHECK_CLASS_KIND_INFO( ComRouteData , FORM_COM_ROUTE_DATA_KIND );
+ CHECK_CLASS_KIND_INFO( Router , FORM_ROUTER_KIND );
+ CHECK_CLASS_KIND_INFO( RoutingData , FORM_ROUTING_DATA_KIND );
+
+ // OTHER
+ CHECK_CLASS_KIND_INFO( FormulaData , FORM_EXEC_FILTER_FORMULA_DATA_KIND );
+
+ // EXECUTION TRACE
+ CHECK_CLASS_KIND_INFO( TracePoint , FORM_TRACE_POINT_KIND );
+ CHECK_CLASS_KIND_INFO( TraceSequence, FORM_TRACE_SEQUENCE_KIND );
+
+ // std::cout << "end" << std::endl;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// LOADER / DISPOSER API
+////////////////////////////////////////////////////////////////////////////////
+
+void ClassKindInfoInitializer::load()
+{
+ checkClassKindInfo_w_r_t_EnumClassKind();
+
+AVM_IF_DEBUG_LEVEL_FLAG( ULTRA , COMPILING )
+ toStreamTable(AVM_OS_COUT, "ClassKindInfoInitializer::load");
+AVM_ENDIF_DEBUG_LEVEL_FLAG( ULTRA , COMPILING )
+}
+
+
+void ClassKindInfoInitializer::dispose()
+{
+AVM_IF_DEBUG_LEVEL_FLAG( ULTRA , COMPILING )
+ toStreamTable(AVM_OS_COUT, "ClassKindInfoInitializer::dispose");
+AVM_ENDIF_DEBUG_LEVEL_FLAG( ULTRA , COMPILING )
+}
+
+
+
+
+/**
+ * CLASS KIND CHECKER
+ * CAST
+ */
+template<> bool ClassKindImpl::is< Machine >() const
+{
+ return( is_exactly< Machine >() ||
+ is< System >() ||
+ is< Package >() );
+}
+
+template<> bool ClassKindImpl::isnot< Machine >() const
+{
+ return( isnot_exactly< Machine >() &&
+ isnot< System >() &&
+ isnot< Package >() );
+}
+
+
+template<> bool ClassKindImpl::is< BehavioralElement >() const
+{
+ return( is< PropertyElement >() ||
+ is< Machine >() ||
+// is< Instance >() ||
+ is< Transition >() ||
+ is< Routine >() );
+}
+
+template<> bool ClassKindImpl::isnot< BehavioralElement >() const
+{
+ return( isnot< PropertyElement >() &&
+ isnot< Machine >() &&
+// isnot< Instance >() &&
+ isnot< Transition >() &&
+ isnot< Routine >() );
+}
+
+
+template<> bool ClassKindImpl::is< PropertyElement >() const
+{
+ return( is< Variable >() ||
+ is< Port >() ||
+ is< Buffer >() ||
+ is< Channel >() );
+}
+
+template<> bool ClassKindImpl::isnot< PropertyElement >() const
+{
+ return( isnot< Variable >() &&
+ isnot< Port >() &&
+ isnot< Buffer >() &&
+ isnot< Channel >() );
+}
+
+
+template<> bool ClassKindImpl::is< ObjectElement >() const
+{
+ return( is< PropertyElement >() ||
+ is< BehavioralElement >() ||
+ is< DataType >() ||
+ is< Connector >() ||
+ is< ComRoute >() ||
+ is< BaseCompiledForm >() ||
+ is< WObject >() );
+}
+
+template<> bool ClassKindImpl::isnot< ObjectElement >() const
+{
+ return( isnot< PropertyElement >() &&
+ isnot< BehavioralElement >() &&
+ isnot< DataType >() &&
+ isnot< Connector >() &&
+ isnot< ComRoute >() &&
+ isnot< BaseCompiledForm >() &&
+ isnot< WObject >() );
+}
+
+
+template<> bool ClassKindImpl::is< Number >() const
+{
+ return( is< Integer >() ||
+ is< Rational >() ||
+ is< Float >() );
+}
+
+template<> bool ClassKindImpl::isnot< Number >() const
+{
+ return( isnot< Integer >() &&
+ isnot< Rational >() &&
+ isnot< Float >() );
+}
+
+
+template<> bool ClassKindImpl::is< BuiltinQueue >() const
+{
+ return( is< BuiltinFifo >() ||
+ is< BuiltinLifo >() );
+}
+
+template<> bool ClassKindImpl::isnot< BuiltinQueue >() const
+{
+ return( isnot< BuiltinFifo >() &&
+ isnot< BuiltinLifo >() );
+}
+
+
+template<> bool ClassKindImpl::is< BuiltinList >() const
+{
+ return( is_exactly< BuiltinList >() ||
+ is< BuiltinQueue >() ||
+ is< BuiltinSet >() ||
+ is< BuiltinBag >() );
+}
+
+template<> bool ClassKindImpl::isnot< BuiltinList >() const
+{
+ return( isnot_exactly< BuiltinList >() ||
+ isnot< BuiltinQueue >() ||
+ isnot< BuiltinSet >() ||
+ isnot< BuiltinBag >() );
+}
+
+
+template<> bool ClassKindImpl::is< BuiltinVector >() const
+{
+ return( is_exactly< BuiltinVector >() ||
+ is< BuiltinReverseVector >() );
+}
+
+template<> bool ClassKindImpl::isnot< BuiltinVector >() const
+{
+ return( isnot_exactly< BuiltinVector >() &&
+ isnot< BuiltinReverseVector >() );
+}
+
+
+template<> bool ClassKindImpl::is< BuiltinArray >() const
+{
+ return( is< ArrayBoolean >() ||
+ is< ArrayCharacter >() ||
+ is< ArrayInteger >() ||
+ is< ArrayFloat >() ||
+ is< ArrayString >() ||
+ is< ArrayIdentifier >() ||
+ is< ArrayQualifiedIdentifier >() ||
+ is< ArrayBF >() );
+}
+
+template<> bool ClassKindImpl::isnot< BuiltinArray >() const
+{
+ return( isnot< ArrayBoolean >() &&
+ isnot< ArrayCharacter >() &&
+ isnot< ArrayInteger >() &&
+ isnot< ArrayFloat >() &&
+ isnot< ArrayString >() &&
+ isnot< ArrayIdentifier >() &&
+ isnot< ArrayQualifiedIdentifier >() &&
+ isnot< ArrayBF >() );
+}
+
+
+template<> bool ClassKindImpl::is_strictly< BuiltinArray >() const
+{
+ return( is< ArrayBoolean >() ||
+ is< ArrayCharacter >() ||
+ is< ArrayInteger >() ||
+ is< ArrayFloat >() ||
+ is< ArrayString >() ||
+ is< ArrayIdentifier >() ||
+ is< ArrayQualifiedIdentifier >() );
+}
+
+template<> bool ClassKindImpl::isnot_strictly< BuiltinArray >() const
+{
+ return( is< ArrayBF >() );
+}
+
+
+template<> bool ClassKindImpl::is< BuiltinContainer >() const
+{
+ return( is< BuiltinVector >() ||
+ is< BuiltinList >() ||
+ is< BuiltinQueue >() ||
+ is< BuiltinReverseVector >() );
+}
+
+template<> bool ClassKindImpl::isnot< BuiltinContainer >() const
+{
+ return( isnot< BuiltinVector >() &&
+ isnot< BuiltinList >() &&
+ isnot< BuiltinQueue >() &&
+ isnot< BuiltinReverseVector >() );
+}
+
+
+template<> bool ClassKindImpl::is< BuiltinCollection >() const
+{
+ return( is< BuiltinArray >() ||
+ is< BuiltinContainer >() );
+}
+
+template<> bool ClassKindImpl::isnot< BuiltinCollection >() const
+{
+ return( isnot< BuiltinArray >() &&
+ isnot< BuiltinContainer >() );
+}
+
+
+template<> bool ClassKindImpl::is< BuiltinForm >() const
+{
+ return( is< Boolean >() ||
+ is< Character >() ||
+ is< Number >() ||
+ is< String >() ||
+ is< BuiltinCollection >() );
+}
+
+template<> bool ClassKindImpl::isnot< BuiltinForm >() const
+{
+ return( isnot< Boolean >() &&
+ isnot< Character >() &&
+ isnot< Number >() &&
+ isnot< String >() &&
+ isnot< BuiltinCollection >() );
+}
+
+
+template<> bool ClassKindImpl::is< BaseInstanceForm >() const
+{
+ return( is< InstanceOfData >() ||
+ is< InstanceOfPort >() ||
+ is< InstanceOfMachine >() ||
+ is< InstanceOfBuffer >() ||
+ is< InstanceOfConnect >() );
+}
+
+template<> bool ClassKindImpl::isnot< BaseInstanceForm >() const
+{
+ return( isnot< InstanceOfData >() &&
+ isnot< InstanceOfPort >() &&
+ isnot< InstanceOfMachine >() &&
+ isnot< InstanceOfBuffer >() &&
+ isnot< InstanceOfConnect >() );
+}
+
+
+template<> bool ClassKindImpl::is< AvmProgram >() const
+{
+ return( is_exactly< AvmProgram >() ||
+ is< AvmTransition >() ||
+ is< ExecutableForm >() );
+}
+
+template<> bool ClassKindImpl::isnot< AvmProgram >() const
+{
+ return( isnot_exactly< AvmProgram >() &&
+ isnot< AvmTransition >() &&
+ isnot< ExecutableForm >() );
+}
+
+
+template<> bool ClassKindImpl::is< BaseAvmProgram >() const
+{
+ return( is_exactly< BaseAvmProgram >() ||
+ is< AvmProgram >() ||
+ is< AvmLambda >() );
+}
+
+template<> bool ClassKindImpl::isnot< BaseAvmProgram >() const
+{
+ return( isnot_exactly< BaseAvmProgram >() &&
+ isnot< AvmProgram >() &&
+ isnot< AvmLambda >() );
+}
+
+
+template<> bool ClassKindImpl::is< BaseSymbolTypeSpecifier >() const
+{
+ return( is< ClassTypeSpecifier >() ||
+ is< EnumTypeSpecifier >() ||
+ is< UnionTypeSpecifier >() );
+}
+
+template<> bool ClassKindImpl::isnot< BaseSymbolTypeSpecifier >() const
+{
+ return( isnot< ClassTypeSpecifier >() &&
+ isnot< EnumTypeSpecifier >() &&
+ isnot< UnionTypeSpecifier >() );
+}
+
+
+template<> bool ClassKindImpl::is< BaseTypeSpecifier >() const
+{
+ return( is_exactly< BaseTypeSpecifier >() ||
+ is< BaseSymbolTypeSpecifier >() ||
+ is< ContainerTypeSpecifier >() ||
+ is< IntervalTypeSpecifier >() ||
+ is< TypeAliasSpecifier >() );
+}
+
+template<> bool ClassKindImpl::isnot< BaseTypeSpecifier >() const
+{
+ return( isnot_exactly< BaseTypeSpecifier >() &&
+ isnot< BaseSymbolTypeSpecifier >() &&
+ isnot< ContainerTypeSpecifier >() &&
+ isnot< IntervalTypeSpecifier >() &&
+ isnot< TypeAliasSpecifier >() );
+}
+
+
+template<> bool ClassKindImpl::is< BaseCompiledForm >() const
+{
+ return( is< BaseInstanceForm >() ||
+ is< BaseAvmProgram >() ||
+ is< ExecutableSystem >() ||
+ is< ComRouteData >() ||
+ is< BaseTypeSpecifier >() );
+}
+
+template<> bool ClassKindImpl::isnot< BaseCompiledForm >() const
+{
+ return( isnot< BaseInstanceForm >() &&
+ isnot< BaseAvmProgram >() &&
+ isnot< ExecutableSystem >() &&
+ isnot< ComRouteData >() &&
+ isnot< BaseTypeSpecifier >() );
+}
+
+
+template<> bool ClassKindImpl::is< RamBuffer >() const
+{
+ return( is_exactly< RamBuffer >() ||
+ is< BroadcastBuffer >() );
+}
+
+template<> bool ClassKindImpl::isnot< RamBuffer >() const
+{
+ return( isnot_exactly< RamBuffer >() &&
+ isnot< BroadcastBuffer >() );
+}
+
+
+template<> bool ClassKindImpl::is< BaseBufferQueue >() const
+{
+ return( is< FifoBuffer >() ||
+ is< LifoBuffer >() ||
+ is< MultiFifoBuffer >() ||
+ is< MultiLifoBuffer >() ||
+ is< SetBuffer >() ||
+ is< MultisetBuffer >() );
+}
+
+template<> bool ClassKindImpl::isnot< BaseBufferQueue >() const
+{
+ return( isnot< FifoBuffer >() &&
+ isnot< LifoBuffer >() &&
+ isnot< MultiFifoBuffer >() &&
+ isnot< MultiLifoBuffer >() &&
+ isnot< SetBuffer >() &&
+ isnot< MultisetBuffer >() );
+}
+
+
+template<> bool ClassKindImpl::is< BaseBufferForm >() const
+{
+ return( is< BaseBufferQueue >() ||
+ is< RamBuffer >() );
+}
+
+template<> bool ClassKindImpl::isnot< BaseBufferForm >() const
+{
+ return( isnot< BaseBufferQueue >() &&
+ isnot< RamBuffer >() );
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/base/ClassKindInfo.h b/org.eclipse.efm.symbex/src/base/ClassKindInfo.h
new file mode 100644
index 0000000..c6ebdd5
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/base/ClassKindInfo.h
@@ -0,0 +1,618 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 déc. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BASE_CLASSKINDINFO_H_
+#define BASE_CLASSKINDINFO_H_
+
+#include <iomanip>
+#include <string>
+#include <typeinfo>
+#include <vector>
+
+#include <printer/OutStream.h>
+
+#include <util/avm_assert.h>
+#include <util/avm_injector.h>
+#include <util/avm_numeric.h>
+#include <util/avm_string.h>
+
+
+namespace sep
+{
+
+
+typedef avm_uint8_t class_kind_t;
+
+
+enum ENUM_CLASS_KIND
+{
+ // UNDEFINED
+ FORM_UNDEFINED_KIND = 0,
+
+ // BUILTIN
+ FORM_BUILTIN_BOOLEAN_KIND,
+
+ FORM_BUILTIN_CHARACTER_KIND,
+
+ FORM_BUILTIN_INTEGER_KIND,
+ FORM_BUILTIN_RATIONAL_KIND,
+ FORM_BUILTIN_FLOAT_KIND,
+
+ FORM_BUILTIN_STRING_KIND,
+ FORM_BUILTIN_IDENTIFIER_KIND,
+ FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND,
+
+ // OPERATOR
+ FORM_OPERATOR_KIND,
+
+ // EXPRESSION , STATEMENT
+ FORM_AVMCODE_KIND,
+
+
+ // EXECUTABLE OBJECT INSTANCE
+ FORM_INSTANCE_BUFFER_KIND,
+ FORM_INSTANCE_CONNECTOR_KIND,
+ FORM_INSTANCE_DATA_KIND,
+ FORM_INSTANCE_MACHINE_KIND,
+ FORM_INSTANCE_PORT_KIND,
+
+ // EXECUTABLE OBJECT
+ FORM_AVMLAMBDA_KIND,
+ FORM_AVMPROGRAM_KIND,
+ FORM_AVMTRANSITION_KIND,
+ FORM_EXECUTABLE_MACHINE_KIND,
+ FORM_EXECUTABLE_SYSTEM_KIND,
+
+ // RUNTIME OBJECT
+ FORM_RUNTIME_ID_KIND,
+ FORM_RUNTIME_KIND,
+
+ // EXECUTION OBJECT
+ FORM_EXECUTION_CONFIGURATION_KIND,
+ FORM_EXECUTION_DATA_KIND,
+ FORM_EXECUTION_CONTEXT_KIND,
+
+ // WORKFLOW CONFIGURATION
+ FORM_WOBJECT_KIND,
+
+ // LIA or FSP
+ FORM_UFI_KIND,
+
+ // XLIA or XFSP
+ FORM_XFSP_BUFFER_KIND,
+ FORM_XFSP_CHANNEL_KIND,
+ FORM_XFSP_COM_POINT_KIND,
+ FORM_XFSP_COM_ROUTE_KIND,
+ FORM_XFSP_CONNECTOR_KIND,
+ FORM_XFSP_MACHINE_KIND,
+// FORM_XFSP_INSTANCE_KIND,
+ FORM_XFSP_PACKAGE_KIND,
+ FORM_XFSP_PORT_KIND,
+ FORM_XFSP_ROUTINE_KIND,
+ FORM_XFSP_SYSTEM_KIND,
+ FORM_XFSP_TRANSITION_KIND,
+ FORM_XFSP_VARIABLE_KIND,
+ // TYPE
+ FORM_XFSP_DATATYPE_KIND,
+
+ // ARRAY
+ FORM_ARRAY_BOOLEAN_KIND,
+ FORM_ARRAY_CHARACTER_KIND,
+ FORM_ARRAY_INTEGER_KIND,
+ FORM_ARRAY_RATIONAL_KIND,
+ FORM_ARRAY_FLOAT_KIND,
+ FORM_ARRAY_STRING_KIND,
+ FORM_ARRAY_IDENTIFIER_KIND,
+ FORM_ARRAY_QUALIFIED_IDENTIFIER_KIND,
+ FORM_ARRAY_BF_KIND,
+
+ // CONTAINER
+ FORM_CONTAINER_VECTOR_KIND,
+ FORM_CONTAINER_REVERSE_VECTOR_KIND,
+ FORM_CONTAINER_LIST_KIND,
+ FORM_CONTAINER_SET_KIND,
+ FORM_CONTAINER_BAG_KIND,
+ FORM_CONTAINER_FIFO_KIND,
+ FORM_CONTAINER_LIFO_KIND,
+
+ // BUFFER
+ FORM_BUFFER_FIFO_KIND,
+ FORM_BUFFER_LIFO_KIND,
+ FORM_BUFFER_MULTI_FIFO_KIND,
+ FORM_BUFFER_MULTI_LIFO_KIND,
+
+ FORM_BUFFER_MULTISET_KIND,
+ FORM_BUFFER_SET_KIND,
+
+ FORM_BUFFER_BROADCAST_KIND,
+ FORM_BUFFER_RAM_KIND,
+
+ // COM
+ FORM_MESSAGE_KIND,
+ FORM_COM_ROUTE_DATA_KIND,
+ FORM_ROUTER_KIND,
+ FORM_ROUTING_DATA_KIND,
+
+ // OTHER
+ FORM_EXEC_FILTER_FORMULA_DATA_KIND,
+
+ // EXECUTION TRACE
+ FORM_TRACE_POINT_KIND,
+ FORM_TRACE_SEQUENCE_KIND,
+
+ // DESTROYED
+ FORM_DESTROYED_KIND
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// CLASS KIND INFO
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+struct ClassKindInfo :
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ClassKindInfo )
+{
+
+ friend class ClassKindInfoInitializer;
+
+
+public:
+ /**
+ * ATTRIBUTES
+ */
+ static ClassKindInfo * TYPE_UNDEFINED_INFO;
+
+ const class_kind_t mKIND;
+
+ const char * mTNAME;
+
+ std::string mNAME;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ClassKindInfo(class_kind_t aClassKind, const char * tname);
+
+ /**
+ * info
+ */
+ std::string info() const;
+
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// CLASS KIND INFO INITIALIZER
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+static class ClassKindInfoInitializer
+{
+
+public:
+ ////////////////////////////////////////////////////////////////////////////////
+ // INITIALIZATION / DESTRUCTION INVARIANT
+ ////////////////////////////////////////////////////////////////////////////////
+
+ ClassKindInfoInitializer();
+
+ ~ClassKindInfoInitializer();
+
+
+public:
+ ////////////////////////////////////////////////////////////////////////////
+ // LOADER / DISPOSER API
+ ////////////////////////////////////////////////////////////////////////////
+
+ static void load();
+ static void dispose();
+
+
+public:
+ /**
+ * ATTRIBUTES
+ */
+ static const class_kind_t TYPE_UNDEFINED_ID = 0;
+
+ static class_kind_t TYPE_NEW_ID;
+
+
+ static std::vector< ClassKindInfo * > * CKI_TABLE;
+
+
+ template< class T >
+ static ClassKindInfo & classKindInfo()
+ {
+ static ClassKindInfo _TYPE_INFO_( TYPE_NEW_ID++ , typeid(T).name() );
+
+ return( _TYPE_INFO_ );
+ }
+
+
+ static void toStreamTable(OutStream & os, const std::string & msg);
+
+} CLASS_KIND_INFO_INITIALIZER;
+
+
+#define CKII_TABLE_INFO( aClassKind ) \
+ (*ClassKindInfoInitializer::CKI_TABLE)[ aClassKind ]
+
+#define CKII_TABLE_INFO_T( aClassKind ) \
+ (*ClassKindInfoInitializer::CKI_TABLE) \
+ [ ClassKindInfoImpl< T >::CLASS_KIND_INFO.mKIND ]
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// CLASS KIND INFO IMPLEMENTATION
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+template< class T >
+class ClassKindInfoImpl
+{
+
+ friend class ClassKindInfoInitializer;
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ClassKindInfoImpl()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ClassKindInfoImpl()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * ATTRIBUTES
+ */
+ static ClassKindInfo & CLASS_KIND_INFO;
+
+
+ /**
+ * GETTER
+ * classKind
+ * classKindName
+ */
+ inline static std::string info()
+ {
+ return( ClassKindInfoImpl< T >::CLASS_KIND_INFO.info() );
+ }
+
+};
+
+template< class T >
+ClassKindInfo & ClassKindInfoImpl< T >::CLASS_KIND_INFO =
+ ClassKindInfoInitializer::classKindInfo< T >();
+
+
+#define CLASS_KIND_T( T ) ClassKindInfoImpl< T >::CLASS_KIND_INFO.mKIND
+
+#define CLASS_KIND_NAME_T( T ) ClassKindInfoImpl< T >::CLASS_KIND_INFO.mNAME
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// CLASS KIND DEFAULT IMPLEMENTATION
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class ClassKindImpl
+{
+
+ friend class ClassKindInfoInitializer;
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ class_kind_t mClassKind;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ClassKindImpl(class_kind_t aClassKind)
+ : mClassKind( aClassKind )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ClassKindImpl(const ClassKindImpl & aCKI)
+ : mClassKind( aCKI.mClassKind )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ ~ClassKindImpl()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CLASS KIND CHECKER & CAST API
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * GETTER
+ * classKind
+ * classKindName
+ */
+ inline class_kind_t classKind() const
+ {
+ return( mClassKind );
+ }
+
+ inline const std::string & classKindName() const
+ {
+ return( CKII_TABLE_INFO( mClassKind )->mNAME );
+ }
+
+ inline std::string classKindInfo() const
+ {
+ return( OSS() << "classKindInfo< "
+ << static_cast< avm_size_t>( mClassKind ) << " , "
+ << CKII_TABLE_INFO( mClassKind )->mNAME
+ << " >" );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CLASS KIND CHECKER & CAST API
+ ////////////////////////////////////////////////////////////////////////////
+
+ // Check if BF is a handle to a T, including base classes.
+ template< typename T >
+ inline bool is() const
+ {
+ return( ClassKindInfoImpl< T >::CLASS_KIND_INFO.mKIND == mClassKind );
+ }
+
+ template< typename T >
+ inline bool isnot() const
+ {
+ return( ClassKindInfoImpl< T >::CLASS_KIND_INFO.mKIND != mClassKind );
+ }
+
+ // Check if BF is a handle to a T, not including base classes.
+ template< typename T >
+ inline bool is_exactly() const
+ {
+ return( ClassKindInfoImpl< T >::CLASS_KIND_INFO.mKIND == mClassKind );
+ }
+
+ template< typename T >
+ inline bool isnot_exactly() const
+ {
+ return( ClassKindInfoImpl< T >::CLASS_KIND_INFO.mKIND != mClassKind );
+ }
+
+ // Check if BF is a handle to a T, not including specific classes.
+ template< typename T >
+ inline bool is_strictly() const
+ {
+ return( is< T >() );
+ }
+
+ template< typename T >
+ inline bool isnot_strictly() const
+ {
+ return( not is_strictly< T >() );
+ }
+
+
+ // cast as specified pointer
+ template< typename T >
+ inline T * as()
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( is< T >() )
+ << "Invalid type casting :> static_cast< "
+ << CKII_TABLE_INFO_T( T )->mNAME
+ << " * >( "
+ << CKII_TABLE_INFO( mClassKind )->mNAME
+ << " * )"
+ << SEND_EXIT;
+
+ return( static_cast< T * >( this ) );
+ }
+
+ template< typename T >
+ inline const T * as() const
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( is< T >() )
+ << "Invalid type casting :> static_cast< "
+ << CKII_TABLE_INFO_T( T )->mNAME
+ << " * >( "
+ << CKII_TABLE_INFO( mClassKind )->mNAME
+ << " * )"
+ << SEND_EXIT;
+
+ return( static_cast< const T * >( this ) );
+ }
+
+
+ template< typename T >
+ inline T * to()
+ {
+ // NO ASSERT
+ // Assumes that the type checking has been done by the user
+ return( static_cast< T * >( this ) );
+ }
+
+ template< typename T >
+ inline const T * to() const
+ {
+ // NO ASSERT
+ // Assumes that the type checking has been done by the user
+ return( static_cast< const T * >( this ) );
+ }
+
+ template< typename T >
+ inline const T & to_ref() const
+ {
+ // NO ASSERT
+ // Assumes that the type checking has been done by the user
+ return( static_cast< const T & >( *this ) );
+ }
+
+};
+
+
+
+/**
+ * CLASS KIND CHECKER
+ * CAST
+ */
+class Machine;
+template<> bool ClassKindImpl::is< Machine >() const;
+template<> bool ClassKindImpl::isnot< Machine >() const;
+
+
+class BehavioralElement;
+template<> bool ClassKindImpl::is< BehavioralElement >() const;
+template<> bool ClassKindImpl::isnot< BehavioralElement >() const;
+
+class PropertyElement;
+template<> bool ClassKindImpl::is< PropertyElement >() const;
+template<> bool ClassKindImpl::isnot< PropertyElement >() const;
+
+
+class ObjectElement;
+template<> bool ClassKindImpl::is< ObjectElement >() const;
+template<> bool ClassKindImpl::isnot< ObjectElement >() const;
+
+
+class Number;
+template<> bool ClassKindImpl::is< Number >() const;
+template<> bool ClassKindImpl::isnot< Number >() const;
+
+
+class BuiltinQueue;
+template<> bool ClassKindImpl::is< BuiltinQueue >() const;
+template<> bool ClassKindImpl::isnot< BuiltinQueue >() const;
+
+
+class BuiltinList;
+template<> bool ClassKindImpl::is< BuiltinList >() const;
+template<> bool ClassKindImpl::isnot< BuiltinList >() const;
+
+
+class BuiltinVector;
+template<> bool ClassKindImpl::is< BuiltinVector >() const;
+template<> bool ClassKindImpl::isnot< BuiltinVector >() const;
+
+
+class BuiltinArray;
+template<> bool ClassKindImpl::is< BuiltinArray >() const;
+template<> bool ClassKindImpl::isnot< BuiltinArray >() const;
+
+template<> bool ClassKindImpl::is_strictly< BuiltinArray >() const;
+template<> bool ClassKindImpl::isnot_strictly< BuiltinArray >() const;
+
+
+class BuiltinContainer;
+template<> bool ClassKindImpl::is< BuiltinContainer >() const;
+template<> bool ClassKindImpl::isnot< BuiltinContainer >() const;
+
+
+class BuiltinCollection;
+template<> bool ClassKindImpl::is< BuiltinCollection >() const;
+template<> bool ClassKindImpl::isnot< BuiltinCollection >() const;
+
+
+class BuiltinForm;
+template<> bool ClassKindImpl::is< BuiltinForm >() const;
+template<> bool ClassKindImpl::isnot< BuiltinForm >() const;
+
+
+class BaseInstanceForm;
+template<> bool ClassKindImpl::is< BaseInstanceForm >() const;
+template<> bool ClassKindImpl::isnot< BaseInstanceForm >() const;
+
+
+
+class AvmProgram;
+template<> bool ClassKindImpl::is< AvmProgram >() const;
+template<> bool ClassKindImpl::isnot< AvmProgram >() const;
+
+class BaseAvmProgram;
+template<> bool ClassKindImpl::is< BaseAvmProgram >() const;
+template<> bool ClassKindImpl::isnot< BaseAvmProgram >() const;
+
+
+class BaseSymbolTypeSpecifier;
+template<> bool ClassKindImpl::is< BaseSymbolTypeSpecifier >() const;
+template<> bool ClassKindImpl::isnot< BaseSymbolTypeSpecifier >() const;
+
+class BaseTypeSpecifier;
+template<> bool ClassKindImpl::is< BaseTypeSpecifier >() const;
+template<> bool ClassKindImpl::isnot< BaseTypeSpecifier >() const;
+
+
+class BaseCompiledForm;
+template<> bool ClassKindImpl::is< BaseCompiledForm >() const;
+template<> bool ClassKindImpl::isnot< BaseCompiledForm >() const;
+
+
+
+class RamBuffer;
+template<> bool ClassKindImpl::is< RamBuffer >() const;
+template<> bool ClassKindImpl::isnot< RamBuffer >() const;
+
+
+class BaseBufferQueue;
+template<> bool ClassKindImpl::is< BaseBufferQueue >() const;
+template<> bool ClassKindImpl::isnot< BaseBufferQueue >() const;
+
+
+class BaseBufferForm;
+template<> bool ClassKindImpl::is< BaseBufferForm >() const;
+template<> bool ClassKindImpl::isnot< BaseBufferForm >() const;
+
+
+} /* namespace sep */
+#endif /* BASE_CLASSKINDINFO_H_ */
diff --git a/org.eclipse.efm.symbex/src/base/InstanceCounter.h b/org.eclipse.efm.symbex/src/base/InstanceCounter.h
new file mode 100644
index 0000000..fc782fb
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/base/InstanceCounter.h
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 29 déc. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BASE_INSTANCECOUNTER_H_
+#define BASE_INSTANCECOUNTER_H_
+
+#include <printer/OutStream.h> // printer/OutStream.h
+
+
+namespace sep
+{
+
+
+template< class T >
+class InstanceCounter
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ InstanceCounter()
+ {
+ ++INSTANCE_CREATED;
+
+ ++INSTANCE_ALIVE;
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~InstanceCounter()
+ {
+ --INSTANCE_ALIVE;
+ }
+
+
+ /**
+ * Serialization
+ */
+ inline static void reportCounters(
+ OutStream & os, const std::string & className)
+ {
+ if( INSTANCE_ALIVE > 0 )
+ {
+ showCounters(os, className);
+ }
+ }
+
+ inline static void showCounters(
+ OutStream & os, const std::string & className)
+ {
+ int colSize = 32 - className.size();
+
+ os << TAB << className << std::setw( (colSize > 0) ? colSize : 1 )
+ << " :> " << std::setw(6)
+ << INSTANCE_ALIVE << " / " << INSTANCE_CREATED
+ << EOL_FLUSH;
+ }
+
+
+ /**
+ * ATTRIBUTE
+ */
+ static std::size_t INSTANCE_CREATED;
+
+ static std::size_t INSTANCE_ALIVE;
+
+
+};
+
+
+template< class T >
+std::size_t InstanceCounter< T >::INSTANCE_CREATED = 0;
+
+template< class T >
+std::size_t InstanceCounter< T >::INSTANCE_ALIVE = 0;
+
+
+
+} /* namespace sep */
+#endif /* BASE_INSTANCECOUNTER_H_ */
diff --git a/org.eclipse.efm.symbex/src/base/README.md b/org.eclipse.efm.symbex/src/base/README.md
new file mode 100644
index 0000000..03a0ac5
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/base/README.md
@@ -0,0 +1,12 @@
+# EFM-SYMBEX : Base
+
+## Source code structure
+
+#### Interfaces
+
+### Classes
+* **Assert**
+* **Exception**
+* **Stream**
+
+#### Factories
diff --git a/org.eclipse.efm.symbex/src/base/ReferenceCounter.cpp b/org.eclipse.efm.symbex/src/base/ReferenceCounter.cpp
new file mode 100644
index 0000000..bc0f062
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/base/ReferenceCounter.cpp
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 19 mars 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ReferenceCounter.h"
+
+namespace sep
+{
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/base/ReferenceCounter.h b/org.eclipse.efm.symbex/src/base/ReferenceCounter.h
new file mode 100644
index 0000000..ddacb2a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/base/ReferenceCounter.h
@@ -0,0 +1,157 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 19 mars 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BASE_REFERENCECOUNTER_H_
+#define BASE_REFERENCECOUNTER_H_
+
+#include <printer/OutStream.h> // printer/OutStream.h
+#include <util/avm_debug.h> // util/avm_debug.h
+#include <util/avm_numeric.h> // util/avm_debug.h
+
+
+namespace sep
+{
+
+class ReferenceCounter
+{
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ avm_uint32_t mReferenceCount;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ReferenceCounter( avm_uint32_t count = 1 )
+ : mReferenceCount( count )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ReferenceCounter()
+ {
+ mReferenceCount = 0;
+ }
+
+
+ /**
+ * AVM DEBUG REF COUNTER
+ */
+ inline void AVM_DEBUG_REF_COUNTER(OutStream & os) const
+ {
+AVM_IF_DEBUG_FLAG( REFERENCE_COUNTING )
+ os << " /* < ref: " << getRefCount() << " > */" << std::flush;
+AVM_ENDIF_DEBUG_FLAG( REFERENCE_COUNTING )
+ }
+
+ inline std::string AVM_DEBUG_REF_COUNTER() const
+ {
+ StringOutStream oss;
+
+ AVM_DEBUG_REF_COUNTER(oss);
+
+ return( oss.str() );
+ }
+
+ inline std::string strRefCount() const
+ {
+ return( OSS() << " /* < ref: " << getRefCount() << " > */" );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mReferenceCount
+ */
+ inline avm_uint32_t getRefCount() const
+ {
+ return( mReferenceCount );
+ }
+
+ inline void setRefCount(avm_uint32_t count)
+ {
+ mReferenceCount = count;
+ }
+
+
+ /**
+ * REFERCENCE COUNT
+ * MANAGEMENT
+ */
+ inline virtual void decrRefCount()
+ {
+ --mReferenceCount;
+ }
+
+ inline virtual void incrRefCount()
+ {
+ ++mReferenceCount;
+ }
+
+
+ /**
+ * LIFECYCLE
+ */
+ inline bool isAlive() const
+ {
+ return( mReferenceCount > 0 );
+ }
+
+ inline bool isDead() const
+ {
+ return( mReferenceCount == 0 );
+ }
+
+ /**
+ * MULTIPLICITY
+ */
+ inline bool isUnique() const
+ {
+ return( mReferenceCount == 1 );
+ }
+
+ inline bool isMultiple() const
+ {
+ return( mReferenceCount >= 2 );
+ }
+
+
+ /**
+ * WRITABILITY
+ */
+ inline bool isWritable() const
+ {
+ return( mReferenceCount == 1 );
+ }
+
+ inline bool isnotWritable() const
+ {
+ return( mReferenceCount != 1 );
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* BASE_REFERENCECOUNTER_H_ */
diff --git a/org.eclipse.efm.symbex/src/base/SmartPointer.h b/org.eclipse.efm.symbex/src/base/SmartPointer.h
new file mode 100644
index 0000000..3f74975
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/base/SmartPointer.h
@@ -0,0 +1,406 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef BASE_SMARTPOINTER_H_
+#define BASE_SMARTPOINTER_H_
+
+#include <bits/move.h>
+
+#include "SmartPointerUtil.h"
+
+#include <util/avm_numeric.h>
+
+
+namespace sep
+{
+
+
+template< class T, class Tdestructor >
+class SmartPointer
+{
+
+private:
+ /**
+ * TYPEDEF
+ */
+ typedef SmartPointer< T , Tdestructor > this_type;
+
+protected:
+ /**
+ * TYPEDEF
+ */
+ typedef T value_type;
+
+ typedef T & reference;
+ typedef const T & const_reference;
+
+
+ typedef T * pointer;
+ typedef const T * const_pointer;
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ pointer mPTR;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ explicit SmartPointer(pointer ptr = NULL)
+ : mPTR( ptr )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ SmartPointer(const SmartPointer & other)
+ : mPTR( NULL )
+ {
+ acquire( other.mPTR );
+ }
+
+ template< class U >
+ SmartPointer(const SmartPointer< U , Tdestructor > & other)
+ : mPTR( NULL )
+ {
+ acquire( other.raw_pointer() );
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ ~SmartPointer()
+ {
+ destroy();
+ }
+
+ inline void destroy()
+ {
+ release( NULL );
+ }
+
+
+ /**
+ * REFCOUNT
+ */
+ inline avm_uint32_t getRefCount() const
+ {
+ return( ( mPTR != NULL )? mPTR->getRefCount() : 0 );
+ }
+
+
+ inline bool isUnique() const
+ {
+ return( (mPTR != NULL)? mPTR->isUnique() : false );
+ }
+
+ inline bool isMultiple() const
+ {
+ return( (mPTR != NULL)? mPTR->isMultiple() : false );
+ }
+
+
+ /**
+ * WRITABILITY
+ */
+ inline bool isWritable() const
+ {
+ return( getRefCount() == 1 );
+ }
+
+ inline bool isnotWritable() const
+ {
+ return( getRefCount() != 1 );
+ }
+
+ inline void makeWritable()
+ {
+// AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+// << "raw_pointer in an SmartPointer !!!"
+// << SEND_EXIT;
+
+ if( mPTR->getRefCount() > 1 )
+ {
+ mPTR->decrRefCount();
+
+ mPTR = mPTR->clone();
+ }
+ }
+
+
+ /**
+ * [IN]VALIDITY
+ */
+ inline bool isNull() const
+ {
+ return( mPTR == NULL );
+ }
+
+ inline bool invalid() const
+ {
+ return( mPTR == NULL );
+ }
+
+
+ inline bool isnotNull() const
+ {
+ return( mPTR != NULL );
+ }
+
+ inline bool valid() const
+ {
+ return( mPTR != NULL );
+ }
+
+
+ /**
+ * SWAP
+ * FLUSH
+ */
+ inline void swap(SmartPointer & other)
+ {
+ std::swap(mPTR, other.mPTR);
+ }
+
+ inline void flush(SmartPointer & other)
+ {
+ release( other.mPTR );
+
+ other.mPTR = NULL;
+ }
+
+
+ /**
+ * GETTER
+ * mPTR
+ */
+ inline pointer raw_pointer() const
+ {
+ return( mPTR );
+ }
+
+ inline const_reference raw_reference() const
+ {
+ return( * mPTR );
+ }
+
+ inline avm_address_t raw_address() const
+ {
+ return( avm_address_t( mPTR ) );
+ }
+
+
+ /**
+ * [RE]SETTER
+ * mPTR
+ */
+ inline void acquirePointer(pointer aPtr)
+ {
+ release_acquire( aPtr );
+ }
+
+ inline void setPointer(pointer aPtr)
+ {
+ release( aPtr );
+ }
+
+
+ inline void replacePointer(pointer aPtr)
+ {
+ mPTR = aPtr;
+ }
+
+
+ /**
+ * OPERATORS
+ */
+// inline reference operator* () const throw()
+// {
+// AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+// << "raw_pointer in an SmartPointer !!!"
+// << SEND_EXIT;
+//
+// return( *mPTR );
+// }
+//
+// inline pointer operator-> () const
+// {
+// AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+// << "raw_pointer in an SmartPointer !!!"
+// << SEND_EXIT;
+//
+// return( mPTR );
+// }
+
+ // COMMENT FOR USE IN STL CONTAINER
+// inline pointer operator & () const
+// {
+// AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+// << "raw_pointer in an SmartPointer !!!"
+// << SEND_EXIT;
+//
+// return( mPTR );
+// }
+
+
+ /**
+ * CAST
+ */
+// inline operator pointer () const
+// {
+// return( mPTR );
+// }
+//
+// // Desactive call of << delete >> using compiler ambiguous mecanism
+// inline operator void * () const
+// {
+// return( mPTR );
+// }
+
+
+ /**
+ * ASSIGNMENT
+ */
+ inline SmartPointer & operator=(pointer aPtr)
+ {
+ if( mPTR != aPtr )
+ {
+ release( aPtr );
+ }
+ return( *this );
+ }
+
+ inline SmartPointer & operator=(const SmartPointer & other)
+ {
+ if( mPTR != other.mPTR )
+ {
+ release_acquire( other.mPTR );
+ }
+ return( *this );
+ }
+
+ template< class U >
+ inline SmartPointer & operator=(
+ const SmartPointer< U , Tdestructor > & other)
+ {
+ if( mPTR != other.raw_pointer() )
+ {
+ release_acquire( other.raw_pointer() );
+ }
+ return( *this );
+ }
+
+
+// template< class U >
+// inline SmartPointer & operator=(U * aPtr)
+// {
+// if( mPTR != aPtr )
+// {
+// release( aPtr );
+// }
+// return( *this );
+// }
+
+
+ /**
+ * COMPARISON
+ * OPERATOR
+ */
+
+ inline bool operator==(pointer aPtr) const
+ {
+ return( mPTR == aPtr);
+ }
+
+ inline bool operator==(const SmartPointer & other) const
+ {
+ return( mPTR == other.mPTR );
+ }
+
+ template<class U>
+ inline bool operator==(
+ const SmartPointer< U , Tdestructor > & other) const
+ {
+ return( mPTR == other.raw_pointer() );
+ }
+
+
+ inline bool operator!=(pointer aPtr) const
+ {
+ return( mPTR != aPtr );
+ }
+
+ inline bool operator!=(const SmartPointer & other) const
+ {
+ return( mPTR != other.mPTR );
+ }
+
+ template<class U>
+ inline bool operator!=(
+ const SmartPointer< U , Tdestructor > & other) const
+ {
+ return( mPTR != other.raw_pointer() );
+ }
+
+
+protected:
+ /**
+ * acquire
+ * release
+ * release_acquire
+ */
+ // increment the count
+ inline void acquire(pointer aPtr)
+ {
+ if( aPtr != NULL )
+ {
+ aPtr->incrRefCount();
+ }
+ mPTR = aPtr;
+ }
+
+
+ // decrement the count, delete if it is 0
+ inline void release(pointer aPtr)
+ {
+ Tdestructor::destroy( mPTR );
+
+ mPTR = aPtr;
+ }
+
+
+ inline void release_acquire(pointer aPtr)
+ {
+ Tdestructor::destroy( mPTR );
+
+ if( aPtr != NULL )
+ {
+ aPtr->incrRefCount();
+ }
+ mPTR = aPtr;
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /*BASE_SMARTPOINTER_H_*/
diff --git a/org.eclipse.efm.symbex/src/base/SmartPointerUtil.cpp b/org.eclipse.efm.symbex/src/base/SmartPointerUtil.cpp
new file mode 100644
index 0000000..8a012c6
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/base/SmartPointerUtil.cpp
@@ -0,0 +1,185 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 19 mars 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "SmartPointerUtil.h"
+
+#include <util/avm_debug.h> // util/avm_debug.h
+
+#include <common/AvmObject.h> // common/AvmObject.h
+#include <common/Element.h> // common/Element.h
+
+#include <printer/OutStream.h> // printer/OutStream.h
+
+
+namespace sep
+{
+
+
+/**
+ * MEMORY MANAGEMENT
+ * DESTROY
+ * FORM
+ */
+void destroy(AvmObject * anObject)
+{
+ DestroyObjectPolicy::destroy(anObject);
+}
+
+
+void DestroyObjectPolicy::destroy(AvmObject * anObject)
+{
+ if( anObject != NULL )
+ {
+ if( anObject->isUnique() )
+ {
+// AVM_OS_TRACE << "destroy :> " << anObject->str() << std::endl;
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , REFERENCE_COUNTING )
+ anObject->dbgDestroy();
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , REFERENCE_COUNTING )
+
+ delete( anObject );
+
+ anObject = NULL;
+ }
+
+ else if( anObject->getRefCount() == 0 )
+ {
+//AVM_IF_DEBUG_LEVEL_FLAG( HIGH , REFERENCE_COUNTING )
+// const char * classKindName = anObject->classKindName();
+// std::string strForm = "";//anObject->str();
+//
+// AVM_OS_COUT << ">>> destroy AvmObject < " << classKindName
+// << " > @ " << avm_address_t(anObject) << " : " << strForm
+// << " with refCount == 0 !!!"
+// << std::endl;
+//
+// AVM_OS_LOG << ">>> destroy AvmObject < " << classKindName
+// << " > @ " << avm_address_t(anObject) << " : " << strForm
+// << " with refCount == 0 !!!"
+// << std::endl;
+//
+// AVM_OS_TRACE << ">>> destroy AvmObject < " << classKindName
+// << " > @ " << avm_address_t(anObject) << " : " << strForm
+// << " with refCount == 0 !!!"
+// << std::endl;
+//_AVM_ELSE_
+// AVM_OS_WARNING_ALERT << ">>> destroy with refCount == 0 !!!"
+// << SEND_ALERT;
+
+ AVM_OS_COUT << ">>> destroy AvmObject @ "
+ << avm_address_t(anObject)
+ << " with refCount == 0 !!!" << std::endl;
+
+ AVM_OS_LOG << ">>> destroy AvmObject @ "
+ << avm_address_t(anObject)
+ << " with refCount == 0 !!!" << std::endl;
+
+ AVM_OS_TRACE << "\t>>> destroy AvmObject @ "
+ << avm_address_t(anObject)
+ << " with refCount == 0 !!!" << std::endl;
+
+ anObject->toStream(AVM_OS_COUT);
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , REFERENCE_COUNTING )
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , REFERENCE_COUNTING )
+ anObject->dbgDestroy();
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , REFERENCE_COUNTING )
+ }
+
+ else
+ {
+ anObject->decrRefCount();
+ }
+ }
+}
+
+
+
+void destroyElement(Element * anElement)
+{
+ DestroyElementPolicy::destroy(anElement);
+}
+
+
+void DestroyElementPolicy::destroy(Element * anElement)
+{
+ if( anElement != NULL )
+ {
+ if( anElement->isUnique() )
+ {
+// AVM_OS_TRACE << "destroy :> " << anElement->str() << std::endl;
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , REFERENCE_COUNTING )
+ anElement->dbgDestroy();
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , REFERENCE_COUNTING )
+
+ delete( anElement );
+
+ anElement = NULL;
+ }
+
+ else if( anElement->getRefCount() == 0 )
+ {
+//AVM_IF_DEBUG_LEVEL_FLAG( HIGH , REFERENCE_COUNTING )
+//
+// const char * classKindName = anElement->classKindName();
+// std::string strForm = "";//anElement->str();
+//
+// AVM_OS_COUT << ">>> destroy Element < " << classKindName
+// << " > @ " << avm_address_t(anElement) << " : " << strForm
+// << " with refCount == 0 !!!"
+// << std::endl;
+//
+// AVM_OS_LOG << ">>> destroy Element < " << classKindName
+// << " > @ " << avm_address_t(anElement) << " : " << strForm
+// << " with refCount == 0 !!!"
+// << std::endl;
+//
+// AVM_OS_TRACE << ">>> destroy Element < " << classKindName
+// << " > @ " << avm_address_t(anElement) << " : " << strForm
+// << " with refCount == 0 !!!"
+// << std::endl;
+//_AVM_ELSE_
+// AVM_OS_WARNING_ALERT << ">>> destroy with refCount == 0 !!!"
+// << SEND_ALERT;
+
+ AVM_OS_COUT << ">>> destroy Element @ "
+ << avm_address_t(anElement)
+ << " with refCount == 0 !!!" << std::endl;
+ AVM_OS_COUT << "\t>> " << anElement->str() << std::endl;
+
+ AVM_OS_LOG << ">>> destroy Element @ "
+ << avm_address_t(anElement)
+ << " with refCount == 0 !!!" << std::endl;
+ AVM_OS_LOG << "\t>> " << anElement->str() << std::endl;
+
+ AVM_OS_TRACE << "\t>>> destroy Element @ "
+ << avm_address_t(anElement)
+ << " with refCount == 0 !!!" << std::endl;
+ AVM_OS_TRACE << "\t>> " << anElement->str() << std::endl;
+
+//AVM_IF_DEBUG_LEVEL_FLAG( HIGH , REFERENCE_COUNTING )
+ }
+
+ else
+ {
+ anElement->decrRefCount();
+ }
+ }
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/base/SmartPointerUtil.h b/org.eclipse.efm.symbex/src/base/SmartPointerUtil.h
new file mode 100644
index 0000000..2ee3b90
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/base/SmartPointerUtil.h
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 19 mars 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BASE_SMARTPOINTERUTIL_H_
+#define BASE_SMARTPOINTERUTIL_H_
+
+#include <cstddef>
+
+namespace sep
+{
+
+/**
+ * MEMORY MANAGEMENT
+ * INCR - DECR
+ * REFCOUNT
+ */
+
+template< class T >
+T * incrReferenceCount(T * anElement)
+{
+ if( anElement != NULL )
+ {
+ anElement->incrRefCount();
+ }
+
+ return( anElement );
+}
+
+
+/**
+ * MEMORY MANAGEMENT
+ * DESTROY
+ * FORM
+ */
+
+class AvmObject;
+class Element;
+
+
+/**
+ * SMART DESTROY POLICY
+ * FORM
+ */
+struct DestroyObjectPolicy
+{
+ static void destroy(AvmObject * anObject);
+};
+
+void destroy(AvmObject * anObject);
+
+
+struct DestroyElementPolicy
+{
+ static void destroy(Element * anObject);
+};
+
+extern void destroyElement(Element * anElement);
+
+
+} /* namespace sep */
+
+#endif /* BASE_SMARTPOINTERUTIL_H_ */
diff --git a/org.eclipse.efm.symbex/src/base/SmartTable.h b/org.eclipse.efm.symbex/src/base/SmartTable.h
new file mode 100644
index 0000000..f1f44da
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/base/SmartTable.h
@@ -0,0 +1,1147 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 13 janv. 2017
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BASE_SMARTTABLE_H_
+#define BASE_SMARTTABLE_H_
+
+#include <util/avm_assert.h>
+#include <util/avm_debug.h>
+#include <util/avm_injector.h>
+#include <util/avm_numeric.h>
+
+#include <base/ReferenceCounter.h>
+#include <base/SmartPointer.h>
+
+#include <printer/OutStream.h>
+
+
+namespace sep
+{
+
+template< class T, class Tdestructor >
+class SmartTable
+{
+
+protected:
+ /**
+ * TYPEDEF
+ */
+ typedef SmartTable < T , Tdestructor > this_type;
+
+ typedef SmartPointer< T , Tdestructor > smart_pointer_t;
+
+protected:
+ /**
+ * TYPEDEF
+ */
+ typedef T value_type;
+
+ typedef T & reference_t;
+ typedef const T & const_reference_t;
+
+ typedef T * pointer_t;
+ typedef const T * const_pointer_t;
+
+ typedef T * & reference_pointer_t;
+ typedef const T * & const_reference_pointer_t;
+
+ typedef T * * pointer_pointer_t;
+ typedef const T * * const_pointer_pointer_t;
+
+public:
+ typedef T * * iterator;
+ typedef T * const * const_iterator;
+
+
+private:
+ /**
+ * Internal Table
+ */
+ struct TableT : public ReferenceCounter,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( TableT )
+ {
+
+ /**
+ * ATTRIBUTES
+ */
+ avm_size_t mSize;
+
+ pointer_pointer_t mElements;
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TableT()
+ : ReferenceCounter( ),
+ mSize( 0 ),
+ mElements( NULL )
+ {
+ //!! NOTHING
+ }
+
+ TableT(avm_size_t aSize, pointer_t aDefaultValue = NULL)
+ : ReferenceCounter( ),
+ mSize( aSize ),
+ mElements( NULL )
+ {
+ alloc(aDefaultValue);
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ TableT(const TableT & aTable)
+ : ReferenceCounter( ),
+ mSize( aTable.mSize ),
+ mElements( NULL )
+ {
+ acquire( aTable );
+ }
+
+ TableT(avm_size_t aSize, const TableT & aTable,
+ pointer_t aDefaultValue = NULL)
+ : ReferenceCounter( ),
+ mSize( aSize ),
+ mElements( NULL )
+ {
+ acquire_resize( aTable, aDefaultValue );
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~TableT()
+ {
+ destroyTable();
+
+ mSize = 0;
+ }
+
+ inline void destroyTable()
+ {
+ for( avm_size_t offset = 0 ; offset < mSize ; ++offset )
+ {
+ Tdestructor::destroy( mElements[ offset ] );
+ }
+ }
+
+ /**
+ * ALLOCATION
+ */
+ inline void alloc(pointer_t aDefaultValue = NULL)
+ {
+ if( mSize > 0 )
+ {
+ mElements = new pointer_t[ mSize ];
+
+ for( avm_size_t offset = 0 ; offset < mSize ; ++offset )
+ {
+ mElements[offset] = aDefaultValue;
+ }
+ }
+ else
+ {
+ mElements = NULL;
+ }
+ }
+
+ /**
+ * Resize
+ */
+ inline void resize(avm_size_t aSize, pointer_t aDefaultValue = NULL)
+ {
+ if( aSize == 0 )
+ {
+ destroyTable();
+
+ mSize = 0;
+ }
+ else if( mSize > 0 )
+ {
+ avm_size_t oldSize = mSize;
+ pointer_pointer_t oldELements = mElements;
+
+ mElements = new pointer_t[ mSize = aSize ];
+
+ avm_size_t offset = 0;
+
+ // The size increased
+ if( aSize >= oldSize )
+ {
+ for( ; offset < oldSize ; ++offset )
+ {
+ mElements[offset] = oldELements[offset];
+ }
+ // Completion
+ for( ; offset < aSize ; ++offset )
+ {
+ mElements[offset] = aDefaultValue;
+ }
+ }
+ // The size decreased
+ else
+ {
+ for( ; offset < aSize ; ++offset )
+ {
+ mElements[offset] = oldELements[offset];
+ }
+ // Deletion
+ for( ; offset < oldSize ; ++offset )
+ {
+ Tdestructor::destroy( mElements[ offset ] );
+ }
+ }
+
+ delete [] oldELements;
+ }
+ else
+ {
+ mSize = aSize;
+
+ alloc(aDefaultValue);
+ }
+ }
+
+
+ /**
+ * acquire
+ * release
+ * release_acquire
+ */
+ inline void acquire(const TableT & aTable)
+ {
+ if( mSize > 0 )
+ {
+ mElements = new pointer_t[ mSize ];
+
+ // Acquire
+ for( avm_size_t offset = 0 ; offset < mSize ; ++offset )
+ {
+ acquire(offset, aTable.mElements[offset]);
+ }
+ }
+ else
+ {
+ mElements = NULL;
+ }
+ }
+
+ inline void acquire_resize(
+ const TableT & aTable, pointer_t aDefaultValue)
+ {
+ if( mSize > 0 )
+ {
+ mElements = new pointer_t[ mSize ];
+
+ avm_size_t offset = 0;
+
+ avm_size_t minBound = std::min(mSize, aTable.mSize);
+
+ // Acquire
+ for( ; offset < minBound ; ++offset )
+ {
+ acquire(offset, aTable.mElements[offset]);
+ }
+ // Completion if need
+ for( ; offset < mSize ; ++offset )
+ {
+ mElements[offset] = aDefaultValue;
+ }
+ }
+ else
+ {
+ mElements = NULL;
+ }
+ }
+
+
+ inline void acquire(avm_size_t offset, pointer_t anElement)
+ {
+ if( anElement != NULL )
+ {
+ anElement->incrRefCount();
+ }
+
+ mElements[offset] = anElement;
+ }
+
+ inline void release(avm_size_t offset, pointer_t anElement)
+ {
+ Tdestructor::destroy( mElements[offset] );
+
+ mElements[offset] = anElement;
+ }
+
+ inline void release_acquire(avm_size_t offset, pointer_t anElement)
+ {
+ Tdestructor::destroy( mElements[offset] );
+
+ if( anElement != NULL )
+ {
+ anElement->incrRefCount();
+ }
+
+ mElements[offset] = anElement;
+ }
+
+
+ /**
+ * Writable
+ */
+ inline TableT * clone_acquire() const
+ {
+ return( new TableT(*this) );
+ }
+
+ inline TableT * clone_resize_acquire(
+ avm_size_t aSize, pointer_t aDefaultValue = NULL) const
+ {
+ return( new TableT(aSize, *this, aDefaultValue) );
+ }
+
+ };
+
+protected:
+ /**
+ * TYPEDEF
+ */
+ typedef TableT table_type;
+ typedef TableT * table_pointer_t;
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ table_pointer_t mTable;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ explicit SmartTable(table_pointer_t aTable = NULL)
+ : mTable( aTable )
+ {
+ //!! NOTHING
+ }
+
+ SmartTable(avm_size_t aSize, pointer_t aDefaultValue = NULL)
+ : mTable( new table_type(aSize, aDefaultValue) )
+ {
+ //!! NOTHING
+ }
+
+ SmartTable(avm_size_t aSize,
+ const SmartTable & aSmartTable, pointer_t aDefaultValue = NULL)
+ : mTable( NULL )
+ {
+ if( aSize == aSmartTable.size() )
+ {
+ acquire( aSmartTable.mTable );
+ }
+ else
+ {
+ mTable = aSmartTable.mTable
+ ->clone_resize_acquire(aSize, aDefaultValue);
+ }
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ SmartTable(const SmartTable & aSmartTable)
+ : mTable( NULL )
+ {
+ acquire( aSmartTable.mTable );
+ }
+
+ template< class U >
+ SmartTable(const SmartTable< U , Tdestructor > & aSmartTable)
+ : mTable( NULL )
+ {
+ acquire( aSmartTable.mTable );
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ ~SmartTable()
+ {
+ destroy();
+ }
+
+ inline void destroy()
+ {
+ destroyTable( mTable );
+ }
+
+ inline void destroyTable(table_pointer_t & aTable)
+ {
+ if( aTable != NULL )
+ {
+ if( aTable->isUnique() )
+ {
+ delete( aTable );
+ }
+ else
+ {
+ aTable->decrRefCount();
+ }
+
+ aTable = NULL;
+ }
+ }
+
+
+ /**
+ * mSize
+ */
+ inline avm_size_t size() const
+ {
+ return( (mTable == NULL) ? 0 : mTable->mSize );
+ }
+
+ inline bool empty() const
+ {
+ return( (mTable == NULL) || (mTable->mSize == 0) );
+ }
+
+ inline bool nonempty() const
+ {
+ return( (mTable != NULL) && (mTable->mSize > 0) );
+ }
+
+ inline bool populated() const
+ {
+ return( (mTable != NULL) && (mTable->mSize > 1) );
+ }
+
+
+ /**
+ * GETTER
+ * for element at given position by reference
+ * return( [const_]pointer_t )
+ */
+ inline pointer_t at(avm_size_t offset)
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , size() )
+ << SEND_EXIT;
+
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mTable->mElements[offset] )
+ << " pointer in an SmartTable at offset: " << offset << " !!!"
+ << SEND_EXIT;
+
+ return( mTable->mElements[offset] );
+ }
+
+ inline const_pointer_t at(avm_size_t offset) const
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , size() )
+ << SEND_EXIT;
+
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mTable->mElements[offset] )
+ << " pointer in an SmartTable at offset: " << offset << " !!!"
+ << SEND_EXIT;
+
+ return( mTable->mElements[offset] );
+ }
+
+ /**
+ * GETTER
+ * for element at given position
+ * return( [const_]reference_t )
+ */
+ inline reference_t ref(avm_size_t offset)
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , size() )
+ << SEND_EXIT;
+
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mTable->mElements[offset] )
+ << " pointer in an SmartTable at offset: " << offset << " !!!"
+ << SEND_EXIT;
+
+ return( *( mTable->mElements[offset] ) );
+ }
+
+ inline const_reference_t ref(avm_size_t offset) const
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , size() )
+ << SEND_EXIT;
+
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mTable->mElements[offset] )
+ << " pointer in an SmartTable at offset: " << offset << " !!!"
+ << SEND_EXIT;
+
+ return( *( mTable->mElements[offset] ) );
+ }
+
+
+ /**
+ * SETTER
+ * for element at given position
+ */
+ inline void set(avm_size_t offset, pointer_t anElement) const
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , size() )
+ << SEND_EXIT;
+
+ mTable->mElements[offset] = anElement;
+ }
+
+ inline void append(pointer_t anElement) const
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( 0 , size() )
+ << SEND_EXIT;
+
+ avm_size_t offset = 0;
+ for( ; offset < mTable->mSize ; ++offset )
+ {
+ if( mTable->mElements[ offset ] == NULL )
+ {
+ mTable->mElements[offset] = anElement;
+
+ return;
+ }
+ }
+
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( offset < mTable->mSize )
+ << "Unexpected a full SmartTable in method append(...) !"
+ << SEND_EXIT;
+ }
+
+ /**
+ * SETTER
+ * for element at given position
+ * update reference counter:> release acquire
+ */
+ inline void assign(avm_size_t offset, pointer_t anElement) const
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , size() )
+ << SEND_EXIT;
+
+ mTable->release_acquire(offset, anElement);
+ }
+
+ inline void assign(avm_size_t offset,
+ const smart_pointer_t & anElement) const
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , size() )
+ << SEND_EXIT;
+
+ mTable->release_acquire(offset, anElement.raw_pointer());
+ }
+
+ /**
+ * GETTER
+ * for element at given position
+ * return( Smart Pointer )
+ */
+ template< class SmartPointerT >
+ inline SmartPointerT to_sp(avm_size_t offset) const
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , size() )
+ << SEND_EXIT;
+
+ if( //(mTable != NULL) && (mTable->mSize > offset) &&
+ (mTable->mElements[ offset ] != NULL) )
+ {
+ mTable->mElements[ offset ]->incrRefCount();
+
+ return( SmartPointerT( mTable->mElements[offset] ) );
+ }
+
+ return( SmartPointerT() );
+ }
+
+
+ /**
+ * GETTER
+ * for element at given position
+ * operator[]
+ * return( [const_]reference_t )
+ */
+ inline reference_t operator[](avm_size_t offset)
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , size() )
+ << SEND_EXIT;
+
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mTable->mElements[offset] )
+ << " pointer in an SmartTable at offset: " << offset << " !!!"
+ << SEND_EXIT;
+
+ return( *( mTable->mElements[offset] ) );
+ }
+
+ inline const_reference_t operator[](avm_size_t offset) const
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , size() )
+ << SEND_EXIT;
+
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mTable->mElements[offset] )
+ << " pointer in an SmartTable at offset: " << offset << " !!!"
+ << SEND_EXIT;
+
+ return( *( mTable->mElements[offset] ) );
+ }
+
+ /**
+ * GETTER
+ * for element at ( front | back ) position
+ * return( [const_]pointer_t )
+ */
+ inline reference_pointer_t front()
+ {
+ return((size() == 0) ? NULL : mTable->mElements[ 0 ] );
+ }
+
+ inline const_reference_pointer_t front() const
+ {
+ return( (size() == 0) ? NULL : mTable->mElements[ 0 ] );
+ }
+
+ inline reference_pointer_t back()
+ {
+ return( (size() == 0) ? NULL : mTable->mElements[mTable->mSize - 1] );
+ }
+
+ inline const_reference_pointer_t back() const
+ {
+ return( (size() == 0) ? NULL : mTable->mElements[mTable->mSize - 1] );
+ }
+
+
+ /**
+ * ITERATOR
+ */
+ inline iterator begin()
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mTable )
+ << " Table in an SmartTable !!!"
+ << SEND_EXIT;
+
+ return( mTable->mElements );
+ }
+
+ inline const_iterator begin() const
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mTable )
+ << " Table in an SmartTable !!!"
+ << SEND_EXIT;
+
+ return( mTable->mElements );
+ }
+
+
+ inline iterator end()
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mTable )
+ << " Table in an SmartTable !!!"
+ << SEND_EXIT;
+
+ return( mTable->mElements + size() );
+ }
+
+ inline const_iterator end() const
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mTable )
+ << " Table in an SmartTable !!!"
+ << SEND_EXIT;
+
+ return( mTable->mElements + size() );
+ }
+
+
+ /**
+ * REFCOUNT
+ */
+ inline avm_uint32_t getRefCount() const
+ {
+ return( ( mTable == NULL ) ? 0 : mTable->getRefCount() );
+ }
+
+
+ inline bool isUnique() const
+ {
+ return( (mTable == NULL) ? false : mTable->isUnique() );
+ }
+
+ inline bool isMultiple() const
+ {
+ return( (mTable == NULL) ? false : mTable->isMultiple() );
+ }
+
+ /**
+ * AVM DEBUG REF COUNTER
+ */
+ inline void AVM_DEBUG_REF_COUNTER(OutStream & os) const
+ {
+AVM_IF_DEBUG_FLAG( REFERENCE_COUNTING )
+ if( mTable != NULL )
+ {
+ os << " /* < ref: " << mTable->getRefCount() << " > */";
+ }
+ else
+ {
+ os << " /* < ref: SmartTable<null> */";
+ }
+ os << std::flush;
+AVM_ENDIF_DEBUG_FLAG( REFERENCE_COUNTING )
+ }
+
+
+ /**
+ * WRITABILITY
+ */
+ inline bool isWritable() const
+ {
+ return( getRefCount() == 1 );
+ }
+
+ inline bool isnotWritable() const
+ {
+ return( getRefCount() != 1 );
+ }
+
+ inline void makeWritable()
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mTable )
+ << " Table in an SmartTable !!!"
+ << SEND_EXIT;
+
+ if( mTable->isMultiple() )
+ {
+ mTable->decrRefCount();
+
+ mTable = mTable->clone_acquire();
+ }
+ }
+
+ inline void makeWritable(avm_size_t offset)
+ {
+ makeWritable();
+
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mTable->mElements[offset] )
+ << " pointer in an SmartTable at offset: " << offset << " !!!"
+ << SEND_EXIT;
+
+ if( mTable->mElements[offset]->isMultiple() )
+ {
+ mTable->mElements[offset]->decrRefCount();
+
+ mTable->mElements[offset] = mTable->mElements[offset]->clone();
+ }
+ }
+
+ /**
+ * GETTER
+ * for witable element at given position
+ * return( reference_pointer_t )
+ */
+ inline reference_pointer_t getWritable(avm_size_t offset)
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , size() )
+ << SEND_EXIT;
+
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mTable->mElements[offset] )
+ << " pointer in an SmartTable at offset: " << offset << " !!!"
+ << SEND_EXIT;
+
+ makeWritable();
+
+ if( mTable->mElements[offset]->isMultiple() )
+ {
+ mTable->mElements[offset]->decrRefCount();
+
+ mTable->mElements[offset] = mTable->mElements[offset]->clone();
+ }
+
+ return( mTable->mElements[offset] );
+ }
+
+ /**
+ * GETTER
+ * for witable element at given position
+ * return( reference_t )
+ */
+ inline reference_t refWritable(avm_size_t offset)
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , size() )
+ << SEND_EXIT;
+
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mTable->mElements[offset] )
+ << " pointer in an SmartTable at offset: " << offset << " !!!"
+ << SEND_EXIT;
+
+ makeWritable();
+
+ if( mTable->mElements[offset]->isMultiple() )
+ {
+ mTable->mElements[offset]->decrRefCount();
+
+ mTable->mElements[offset] = mTable->mElements[offset]->clone();
+ }
+
+ return( *( mTable->mElements[offset] ) );
+ }
+
+// template< class ElementT >
+// inline reference_pointer_t getWritable(ElementT * anElement)
+// {
+// return( getWritable( anElement->getOffset() ) );
+// }
+
+ /**
+ * GETTER
+ * for witable element at given position
+ * return( SmartPointerT )
+ */
+ template< class SmartPointerT >
+ inline SmartPointerT spWritable(avm_size_t offset)
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , size() )
+ << SEND_EXIT;
+
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mTable->mElements[offset] )
+ << " pointer in an SmartTable at offset: " << offset << " !!!"
+ << SEND_EXIT;
+
+ makeWritable();
+
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mTable->mElements[offset] )
+ << " pointer in an SmartTable at offset: " << offset << " !!!"
+ << SEND_EXIT;
+
+ if( mTable->mElements[offset]->isMultiple() )
+ {
+ mTable->mElements[offset]->decrRefCount();
+
+ mTable->mElements[offset] = mTable->mElements[offset]->clone();
+ }
+
+ mTable->mElements[ offset ]->incrRefCount();
+
+ return( SmartPointerT(mTable->mElements[offset]) );
+ }
+
+
+ /**
+ * RESIZE
+ */
+ inline void makeWritableResize(
+ avm_size_t aSize, pointer_t aDefaultValue = NULL)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mTable )
+ << " Table in an SmartTable !!!"
+ << SEND_EXIT;
+
+ if( mTable->isMultiple() )
+ {
+ mTable->decrRefCount();
+
+ mTable = mTable->clone_resize_acquire(aSize, aDefaultValue);
+ }
+ else // if( mTable->isUnique() > 1 )
+ {
+ mTable->resize(aSize, aDefaultValue);
+ }
+ }
+
+ /**
+ * [IN]VALIDITY
+ */
+ inline bool isNull() const
+ {
+ return( mTable == NULL );
+ }
+
+ inline bool isNull(avm_size_t offset) const
+ {
+// AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mTable )
+// << " Table in an SmartTable !!!"
+// << SEND_EXIT;
+
+ return( (mTable == NULL)
+ || (mTable->mElements[offset] == NULL) );
+ }
+
+ inline bool invalid() const
+ {
+ return( mTable == NULL );
+ }
+
+ inline bool invalid(avm_size_t offset) const
+ {
+// AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mTable )
+// << " Table in an SmartTable !!!"
+// << SEND_EXIT;
+
+ return( (mTable == NULL)
+ || (mTable->mElements[offset] == NULL) );
+ }
+
+
+ inline bool isnotNull() const
+ {
+ return( mTable != NULL );
+ }
+
+ inline bool isnotNull(avm_size_t offset) const
+ {
+// AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mTable )
+// << " Table in an SmartTable !!!"
+// << SEND_EXIT;
+
+ return( (mTable != NULL)
+ && (mTable->mElements[offset] != NULL) );
+ }
+
+
+ inline bool valid() const
+ {
+ return( mTable != NULL );
+ }
+
+ inline bool valid(avm_size_t offset) const
+ {
+// AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mTable )
+// << " Table in an SmartTable !!!"
+// << SEND_EXIT;
+
+ return( (mTable != NULL)
+ && (mTable->mElements[offset] != NULL) );
+ }
+
+
+ /**
+ * SWAP
+ * FLUSH
+ */
+ inline void swap(SmartTable & other)
+ {
+ std::swap(mTable, other.mTable);
+ }
+
+ inline void flush(SmartTable & other)
+ {
+ release( other.mTable );
+
+ other.mTable = NULL;
+ }
+
+
+ /**
+ * GETTER
+ * mTable
+ */
+ inline avm_address_t raw_address() const
+ {
+ return( avm_address_t( mTable ) );
+ }
+
+ /**
+ * ASSIGNMENT
+ */
+ inline SmartTable & operator=(table_pointer_t aTable)
+ {
+ if( mTable != aTable )
+ {
+ release( aTable );
+ }
+ return( *this );
+ }
+
+ inline SmartTable & operator=(const SmartTable & other)
+ {
+ if( mTable != other.mTable )
+ {
+ release_acquire( other.mTable );
+ }
+ return( *this );
+ }
+
+
+ /**
+ * COMPARISON
+ * OPERATOR
+ */
+
+ inline bool operator==(table_pointer_t aTable) const
+ {
+ return( mTable == aTable );
+ }
+
+ inline bool operator==(const SmartTable & other) const
+ {
+ return( mTable == other.mTable );
+ }
+
+ template<class U>
+ inline bool operator==(
+ const SmartTable< U , Tdestructor > & other) const
+ {
+ return( mTable == other.raw_pointer() );
+ }
+
+
+ inline bool operator!=(table_pointer_t aTable) const
+ {
+ return( mTable != aTable );
+ }
+
+ inline bool operator!=(const SmartTable & other) const
+ {
+ return( mTable != other.mTable );
+ }
+
+ template<class U>
+ inline bool operator!=(
+ const SmartTable< U , Tdestructor > & other) const
+ {
+ return( mTable != other.raw_pointer() );
+ }
+
+
+protected:
+ /**
+ * acquire
+ * release
+ * release_acquire
+ */
+ // increment the count
+ inline void acquire(table_pointer_t aTable)
+ {
+ if( aTable != NULL )
+ {
+ aTable->incrRefCount();
+ }
+
+ mTable = aTable;
+ }
+
+
+ // decrement the count, delete if it is 0
+ inline void release(table_pointer_t aTable)
+ {
+ destroyTable( mTable );
+
+ mTable = aTable;
+ }
+
+
+ inline void release_acquire(table_pointer_t aTable)
+ {
+ destroyTable( mTable );
+
+ if( aTable != NULL )
+ {
+ aTable->incrRefCount();
+ }
+
+ mTable = aTable;
+ }
+
+
+public:
+ /**
+ * Serialization
+ */
+ inline std::string str() const
+ {
+ std::ostringstream oss;
+
+ if( mTable != NULL )
+ {
+ if( mTable->mSize > 0 )
+ {
+ oss << "[ " << mTable->mElements[ 0 ]->str();
+
+ for( avm_size_t offset = 1 ; offset < mTable->mSize ; ++offset )
+ {
+ if( mTable->mElements[ offset ] != NULL )
+ {
+ oss << " , " << mTable->mElements[ offset ]->str();
+ }
+ else
+ {
+ oss << " , null< T * >";
+ }
+ }
+
+ oss << " ]";
+
+ return( oss.str() );
+ }
+ else
+ {
+ return( "empty<SmartTable>" );
+ }
+ }
+ else
+ {
+ return( "null<SmartTable>" );
+ }
+ }
+
+ inline std::string toString(
+ const AvmIndent & indent = AVM_TAB_INDENT) const
+ {
+ StringOutStream oss(indent);
+
+ toStream( oss );
+
+ return( oss.str() );
+ }
+
+ inline void toStream(OutStream & os) const
+ {
+ if( mTable != NULL )
+ {
+ if( mTable->mSize > 0 )
+ {
+ for( avm_size_t offset = 0 ; offset < mTable->mSize ; ++offset )
+ {
+ if( mTable->mElements[ offset ] != NULL )
+ {
+ mTable->mElements[ offset ]->toStream(os);
+ }
+ else
+ {
+ os << TAB << "null< T * >" << EOL;
+ }
+ os << std::flush;
+ }
+ }
+ else
+ {
+ os << TAB << "empty<SmartTable>" << EOL_FLUSH;
+ }
+ }
+ else
+ {
+ os << TAB << "null<SmartTable>" << EOL_FLUSH;
+ }
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* BASE_SMARTTABLE_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/Builder.cpp b/org.eclipse.efm.symbex/src/builder/Builder.cpp
new file mode 100644
index 0000000..496a2b1
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/Builder.cpp
@@ -0,0 +1,999 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "Builder.h"
+
+#include <builder/Loader.h>
+
+#include <builder/primitive/CompilationEnvironment.h>
+
+#include <computer/ExecutionEnvironment.h>
+
+#include <fml/executable/AvmProgram.h>
+#include <fml/executable/BaseInstanceForm.h>
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/ExecutableQuery.h>
+#include <fml/executable/ExecutableSystem.h>
+#include <fml/executable/InstanceOfBuffer.h>
+#include <fml/executable/InstanceOfConnect.h>
+#include <fml/executable/InstanceOfData.h>
+#include <fml/executable/InstanceOfMachine.h>
+#include <fml/executable/InstanceOfPort.h>
+
+#include <fml/expression/ExpressionConstant.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/StatementConstructor.h>
+
+#include <fml/operator/Operator.h>
+
+#include <fml/runtime/ExecutionConfiguration.h>
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/LocalRuntime.h>
+#include <fml/runtime/RuntimeForm.h>
+#include <fml/runtime/TableOfRuntimeFormState.h>
+
+#include <fml/infrastructure/System.h>
+#include <fml/runtime/LocalRuntime.h>
+
+#include <fml/workflow/UniFormIdentifier.h>
+
+#include <sew/Configuration.h>
+#include <sew/SymbexEngine.h>
+
+#include <util/ExecutionTime.h>
+
+
+namespace sep
+{
+
+
+/**
+ * LOADER
+ */
+void Builder::load()
+{
+ CompilationEnvironment::initCache();
+}
+
+
+/**
+ * DISPOSER
+ */
+void Builder::dispose()
+{
+ CompilationEnvironment::finalizeCache();
+}
+
+
+
+/**
+ * CONFIGURE
+ */
+bool Builder::configure()
+{
+ if( not mCompiler.configure() )
+ {
+ AVM_OS_ERROR_ALERT
+ << "Builder::configure:> "
+ "the XLIA compiler configuration failed !!!"
+ << SEND_ALERT;
+
+ return( false );
+ }
+
+ return( true );
+}
+
+
+/**
+ * START
+ */
+bool Builder::start()
+{
+ // COMPILATION
+//CHRONO
+//AVM_OS_DEBUG << std::endl << "Building:> start chrono !" << std::endl;
+//ExecutionTime chrono( true );
+
+ if( mConfiguration.hasSpecification() )
+ {
+ mCompiler.start( mConfiguration.getSpecification() );
+
+ mCompiler.reportCompilation(AVM_OS_LOG);
+ if( mCompiler.hasError() )
+ {
+ mCompiler.reportCompilation(AVM_OS_COUT);
+ mCompiler.reportCompilation(AVM_OS_TRACE);
+
+ return( false );
+ }
+ else if( mCompiler.hasErrorWarning() )
+ {
+ mCompiler.reportCompilation(AVM_OS_COUT);
+ }
+ }
+ else if( AVM_ERROR_COUNT == 0 )
+ {
+ ++AVM_ERROR_COUNT;
+ }
+
+
+ if( (AVM_ERROR_COUNT > 0) && (AVM_WARNING_COUNT > 0) )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Compilation : error"
+ << ( (AVM_ERROR_COUNT > 0) ? "s " : " " ) << AVM_ERROR_COUNT
+ << " : warning"
+ << ( (AVM_ERROR_COUNT > 0) ? "s " : " " ) << AVM_WARNING_COUNT
+ << SEND_EXIT;
+ }
+
+
+// CHRONO
+//chrono.finish_time();
+//AVM_OS_DEBUG << std::endl << "chrono stop:> " << chrono.time_stat() << std::endl;
+
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ mConfiguration.serializeDebugExecutable( "compiled" );
+AVM_ENDIF_DEBUG_FLAG(COMPILING )
+
+
+ // LOADING INSTANCE FOR EXECUTION
+//CHRONO
+//AVM_OS_DEBUG << std::endl << "Loading:> start chrono !" << std::endl;
+//chrono.start_time();
+
+ /*
+ * Creating the first/initial execution data/context
+ */
+ APExecutionData theInitialExecutionData = createInitialExecutionData();
+
+ mConfiguration.setMainExecutionData( theInitialExecutionData );
+
+ ExecutionContext * anInitialExecutionContext =
+ new ExecutionContext(theInitialExecutionData, 0, 1);
+
+ mConfiguration.appendInputContext( anInitialExecutionContext );
+
+//CHRONO
+//chrono.finish_time();
+//AVM_OS_DEBUG << std::endl << "chrono stop:> " << chrono.time_stat() << std::endl;
+
+ return( true );
+}
+
+
+/*
+ * Initial Execution Context creation
+ */
+APExecutionData Builder::createInitialExecutionData()
+{
+ ExecutableSystem & anExecutableSystem =
+ mConfiguration.getExecutableSystem();
+
+ APExecutionData theInitialExecutionData( new ExecutionData(
+ anExecutableSystem.getMachineCount() + 1 /* for PARAMETERS */ ) );
+
+ theInitialExecutionData->setNodeCondition(
+ ExpressionConstant::BOOLEAN_TRUE );
+ theInitialExecutionData->setNodeTimedCondition(
+ ExpressionConstant::BOOLEAN_TRUE );
+
+ theInitialExecutionData->setPathCondition(
+ ExpressionConstant::BOOLEAN_TRUE );
+ theInitialExecutionData->setPathTimedCondition(
+ ExpressionConstant::BOOLEAN_TRUE );
+
+ /*
+ * Loading instance
+ */
+ int thePid = 0;
+ avm_offset_t theOffset = 0;
+
+ Loader & theLoader = mSymbexEngine.getLoader();
+
+ /*
+ * Loading parameters instance
+ */
+ // ExecutionData::PARAM_MACHINE_RUNTIME_OFFSET === theOffset === 0
+ RuntimeID parametersRID(RuntimeID::REF_NULL, thePid++,
+ theOffset++, anExecutableSystem.rawParametersInstance());
+
+ mConfiguration.appendRID( parametersRID );
+
+ theInitialExecutionData->saveRuntimeForm(parametersRID.getOffset(),
+ new ParametersRuntimeForm( parametersRID ) );
+
+ theInitialExecutionData->setRuntimeFormState(
+ parametersRID.getOffset(), PROCESS_UNDEFINED_STATE);
+
+ /*
+ * Loading system instance
+ */
+ // ExecutionData::SYSTEM_RUNTIME_OFFSET === theOffset === 1
+ RuntimeForm * theSystemRuntime = theLoader.loadSystemInstance(
+ theInitialExecutionData, RuntimeID::REF_NULL,
+ anExecutableSystem.rawSystemInstance(), thePid, theOffset);
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , LOADING )
+ theSystemRuntime->toStream( AVM_OS_TRACE );
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , LOADING )
+
+ /**
+ * RUNNING onCREATE
+ */
+ if( not theLoader.finalizeRunningOnCreate(ENV, theInitialExecutionData) )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "createInitialExecutionContext:> Failed to finalize "
+ "loading by running << onCreate Primitive >> !!!"
+ << SEND_EXIT;
+ }
+
+ // WARNING Assume possible auto-destruction of <theSystemExecutable>
+ // after running< system->onCreate() > due to makeWritable... process !
+ const RuntimeID & theSystemRID = theInitialExecutionData->getSystemRID();
+
+ ExecutableForm * theSystemExecutable = theSystemRID.getExecutable();
+
+
+//!![MIGRATION]:MONITOR --> onCreate Routine
+// theLoader.loadInitialMonitorData(theInitialExecutionData,
+// theSystemRID, anExecutableSystem.rawSystemInstance(), true);
+
+AVM_IF_DEBUG_FLAG( LOADING )
+ mConfiguration.serializeDebugExecutable( "loaded" );
+AVM_ENDIF_DEBUG_FLAG( LOADING )
+
+ /*
+ * Setting the main program
+ */
+ theInitialExecutionData->setOnInit( theSystemExecutable->getOnInit() );
+
+ theInitialExecutionData->setOnSchedule( theSystemExecutable->getOnRun() );
+
+// if( theInitialExecutionData->getOnSchedule()->nonempty()
+// && theInitialExecutionData->getOnSchedule()
+// ->isOpCode( AVM_OPCODE_SCHEDULE_INVOKE )
+// && theSystemExecutable->isMocKindAnd() )
+// {
+// theInitialExecutionData->setOnSchedule(
+// theSystemExecutable->getOnSchedule() );
+// }
+
+ theInitialExecutionData->setSystemRID();
+
+ theInitialExecutionData->setRuntimeFormState(
+ theSystemRID, PROCESS_RUNNING_STATE );
+
+ return( theInitialExecutionData );
+}
+
+
+
+
+/**
+ * BUILDER
+ * Replace a qualified element by its runtime's counterpart
+ */
+
+BF Builder::compileExpression(const BF & aCode)
+{
+ return( compileExpression( mConfiguration.
+ getExecutableSystem().defaultExecutableForm(), aCode) );
+}
+
+BFCode Builder::compileStatement(const BFCode & aCode)
+{
+ return( compileStatement( mConfiguration.
+ getExecutableSystem().defaultExecutableForm(), aCode) );
+}
+
+
+
+BF Builder::searchSymbolInstance(TableOfSymbol & aliasTable,
+ const ExecutionData & anED, UniFormIdentifier * anUFI)
+{
+ std::ostringstream osUFI;
+
+ std::string aFullyQualifiedNameID = anUFI->str();
+
+ {
+ const BF & foundInstance =
+ aliasTable.getByFQNameID( aFullyQualifiedNameID );
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+
+ if( anED.hasLocalRuntimeStack() )
+ {
+ StackOfLocalRuntime::const_reverse_iterator it =
+ anED.getLocalRuntimes()->rbegin();
+ StackOfLocalRuntime::const_reverse_iterator itEnd =
+ anED.getLocalRuntimes()->rend();
+ for( ; it != itEnd ; ++it )
+ {
+ const BF & anInstance = (*it).getProgram()->getAllData().
+ getByFQNameID( aFullyQualifiedNameID );
+ if( anInstance.valid() )
+ {
+ return( anInstance );
+ }
+ }
+ }
+
+
+ UniFormIdentifier::iterator it = anUFI->begin();
+ UniFormIdentifier::iterator itEnd = anUFI->end();
+
+ // recherche de la machine PRINCIPALE (ROOT)
+ osUFI << "inst::" << (*it).str();
+
+ const RuntimeID & theSystemRID = anED.getSystemRID();
+ RuntimeID theMachineID = theSystemRID;
+
+ for( ++it ; (it != itEnd) ; ++it )
+ {
+ if( theMachineID.getInstance()->fqnEquals( osUFI.str() ) )
+ {
+ break;
+ }
+ osUFI << "." << (*it).str();
+ }
+
+ if( it != itEnd )
+ {
+ VectorOfInstanceOfMachine aliasPath;
+
+ RuntimeID rid = theMachineID;
+
+ // comme c'est la spec RID
+// aliasPath.append( theMachineID.getInstance() );
+
+ // recherche de la machine FEUILLE
+ for( ; it != itEnd ; ++it)
+ {
+ osUFI << "." << (*it).str();
+ rid = anED.getRuntime(rid).getChild( osUFI.str() );
+ if( rid.valid() )
+ {
+ theMachineID = rid;
+ aliasPath.append( theMachineID.getInstance() );
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ if( (it == itEnd) && (theMachineID == theSystemRID) )
+ {
+ --it;
+ }
+
+ if( it != itEnd )
+ {
+ ExecutableForm * anExecutable = theMachineID.getExecutable();
+ osUFI.str( "" );
+
+ osUFI << "inst::" // with std::strlen( "exec::" ) --> 6
+ << anExecutable->getFullyQualifiedNameID().substr( 6 );
+
+ for( ; it != itEnd ; ++it)
+ {
+ osUFI << "." << (*it).str();
+ }
+
+
+ // The ORIGINAL INSTANCE
+ BF anInstance = anExecutable->getAllData().getByFQNameID(
+ osUFI.str() );
+
+ if( anInstance.invalid() )
+ {
+ anInstance = anExecutable->getConstData().getByFQNameID(
+ osUFI.str() );
+ }
+ if( anInstance.invalid() )
+ {
+ anInstance = anExecutable->getPort().getByFQNameID(
+ osUFI.str() );
+ }
+ if( anInstance.invalid() )
+ {
+ anInstance = anExecutable->getBuffer().getByFQNameID(
+ osUFI.str() );
+ }
+ if( anInstance.invalid() )
+ {
+ anInstance = anExecutable->getConnect().getByFQNameID(
+ osUFI.str() );
+ }
+
+ if( anInstance.valid() )
+ {
+
+// AVM_OS_TRACE << TAB << "Searching " << anUFI->str() << std::endl
+// << TAB << "Found " << std::endl;
+// anInstance.toStream(AVM_OS_TRACE << TAB);
+// AVM_OS_TRACE << std::flush;
+
+ if( aliasPath.nonempty() )
+ {
+ BaseInstanceForm * newInstance = NULL;
+
+ switch ( anInstance.classKind() )
+ {
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ newInstance = new InstanceOfData(
+ theSystemRID.getExecutable(),
+ anInstance.to_ptr< InstanceOfData >(),
+ aliasPath);
+ newInstance->setCreatorContainerRID( theMachineID );
+ newInstance->setRuntimeContainerRID( theMachineID );
+ aliasTable.save( newInstance );
+
+ break;
+ }
+
+ case FORM_INSTANCE_MACHINE_KIND:
+ {
+ newInstance = new InstanceOfMachine(
+ theSystemRID.getExecutable(),
+ anInstance.to_ptr< InstanceOfMachine >(),
+ aliasPath);
+ newInstance->setCreatorContainerRID( theMachineID );
+ newInstance->setRuntimeContainerRID( theMachineID );
+
+ return( aliasTable.save( newInstance ) );
+ }
+
+ case FORM_INSTANCE_PORT_KIND:
+ {
+ newInstance = new InstanceOfPort(
+ theSystemRID.getExecutable(),
+ anInstance.to_ptr< InstanceOfPort >(),
+ aliasPath);
+ newInstance->setCreatorContainerRID( theMachineID );
+ newInstance->setRuntimeContainerRID( theMachineID );
+
+ return( aliasTable.save( newInstance ) );
+ }
+
+ case FORM_INSTANCE_BUFFER_KIND:
+ {
+ newInstance = new InstanceOfBuffer(
+ theSystemRID.getExecutable(),
+ anInstance.to_ptr< InstanceOfBuffer >(),
+ aliasPath);
+ newInstance->setCreatorContainerRID( theMachineID );
+ newInstance->setRuntimeContainerRID( theMachineID );
+
+ return( aliasTable.save( newInstance ) );
+ }
+
+ case FORM_INSTANCE_CONNECTOR_KIND:
+ {
+ newInstance = new InstanceOfConnect(
+ theSystemRID.getExecutable(),
+ anInstance.to_ptr< InstanceOfConnect >(),
+ aliasPath);
+ newInstance->setCreatorContainerRID( theMachineID );
+ newInstance->setRuntimeContainerRID( theMachineID );
+
+ return( aliasTable.save( newInstance ) );
+ }
+
+ default :
+ {
+ return( BF::REF_NULL );
+ }
+ }
+ }
+ }
+
+ return( anInstance );
+ }
+
+ else if( aliasPath.nonempty() )
+ {
+ return( BF( sep::incrReferenceCount(aliasPath.last()) ) );
+ }
+
+
+ else
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Unfound leaf machine : " << osUFI.str()
+ << " >> container of << " << aFullyQualifiedNameID
+ << " >> !!!"
+ << SEND_EXIT;
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+const BF & Builder::searchSymbolInstance(TableOfSymbol & aliasTable,
+ const ExecutionData & anED, const ObjectElement * astElement)
+{
+ {
+ const BF & foundInstance = aliasTable.getByAstElement(astElement);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ if( anED.hasLocalRuntimeStack() )
+ {
+ StackOfLocalRuntime::const_reverse_iterator it =
+ anED.getLocalRuntimes()->rbegin();
+ StackOfLocalRuntime::const_reverse_iterator itEnd =
+ anED.getLocalRuntimes()->rend();
+ for( ; it != itEnd ; ++it )
+ {
+ const BF & anInstance =
+ (*it).getProgram()->getAllData().getByAstElement(astElement);
+ if( anInstance.valid() )
+ {
+ return( anInstance );
+ }
+ }
+ }
+
+ {
+ ExecutableQuery XQuery( mConfiguration );
+
+ const BF & foundInstance = XQuery.getInstanceByAstElement(astElement);
+
+ return( foundInstance );
+ }
+}
+
+
+const BF & Builder::searchSymbolInstance(TableOfSymbol & aliasTable,
+ const ExecutionData & anED, const BF & aBaseInstance)
+{
+ if( aliasTable.contains(aBaseInstance) )
+ {
+ return( aBaseInstance );
+ }
+
+ if( anED.hasLocalRuntimeStack() )
+ {
+ StackOfLocalRuntime::const_reverse_iterator it =
+ anED.getLocalRuntimes()->rbegin();
+ StackOfLocalRuntime::const_reverse_iterator itEnd =
+ anED.getLocalRuntimes()->rend();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it).getProgram()->containsData( aBaseInstance ) )
+ {
+ return( aBaseInstance );
+ }
+ }
+ }
+
+ const RuntimeID & theSystemRID = anED.getSystemRID();
+
+ VectorOfInstanceOfMachine aliasPath;
+
+ TableOfRuntimeT::const_iterator itRF = anED.getTableOfRuntime().begin();
+ TableOfRuntimeT::const_iterator endRF = anED.getTableOfRuntime().end();
+ for( RuntimeID itRID ; itRF != endRF ; ++itRF)
+ {
+ itRID = (*itRF)->getRID();
+
+ switch( aBaseInstance.classKind() )
+ {
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ if( itRID.getExecutable()->containsData(
+ aBaseInstance.to_ptr< InstanceOfData >() ) )
+ {
+ aliasPath.append( itRID.getInstance() );
+
+ InstanceOfData * newInstance = new InstanceOfData(
+ theSystemRID.getExecutable(),
+ aBaseInstance.to_ptr< InstanceOfData >(), aliasPath);
+ newInstance->setCreatorContainerRID( itRID );
+ newInstance->setRuntimeContainerRID( itRID );
+
+ aliasTable.save( newInstance );
+ }
+
+ break;
+ }
+
+ case FORM_INSTANCE_MACHINE_KIND:
+ {
+ if( itRID.getExecutable()->
+ getInstanceStatic().contains(aBaseInstance) )
+ {
+ aliasPath.append( itRID.getInstance() );
+
+ InstanceOfMachine * newInstance = new InstanceOfMachine(
+ theSystemRID.getExecutable(),
+ aBaseInstance.to_ptr< InstanceOfMachine >(),
+ aliasPath );
+ newInstance->setCreatorContainerRID( itRID );
+ newInstance->setRuntimeContainerRID( itRID );
+
+ aliasTable.save( newInstance );
+ }
+ break;
+ }
+
+ case FORM_INSTANCE_PORT_KIND:
+ {
+ if( itRID.getExecutable()->getPort().contains(aBaseInstance) )
+ {
+ aliasPath.append( itRID.getInstance() );
+
+ InstanceOfPort * newInstance = new InstanceOfPort(
+ theSystemRID.getExecutable(),
+ aBaseInstance.to_ptr< InstanceOfPort >(), aliasPath);
+ newInstance->setCreatorContainerRID( itRID );
+ newInstance->setRuntimeContainerRID( itRID );
+
+ aliasTable.save( newInstance );
+ }
+ break;
+ }
+
+ case FORM_INSTANCE_BUFFER_KIND:
+ {
+ InstanceOfBuffer * bufferInstance =
+ aBaseInstance.to_ptr< InstanceOfBuffer >();
+
+ if( itRID.getExecutable()->getBuffer().contains(bufferInstance) )
+ {
+ aliasPath.append( itRID.getInstance() );
+
+ InstanceOfBuffer * newInstance = new InstanceOfBuffer(
+ theSystemRID.getExecutable(),
+ bufferInstance, aliasPath );
+ newInstance->setCreatorContainerRID( itRID );
+ newInstance->setRuntimeContainerRID( itRID );
+
+ aliasTable.save( newInstance );
+ }
+ break;
+ }
+
+ case FORM_INSTANCE_CONNECTOR_KIND:
+ {
+ InstanceOfConnect * connectInstance =
+ aBaseInstance.to_ptr< InstanceOfConnect >();
+
+ if( itRID.getExecutable()->getConnect().contains(connectInstance) )
+ {
+ aliasPath.append( itRID.getInstance() );
+
+ InstanceOfConnect * newInstance = new InstanceOfConnect(
+ theSystemRID.getExecutable(),
+ connectInstance, aliasPath );
+ newInstance->setCreatorContainerRID( itRID );
+ newInstance->setRuntimeContainerRID( itRID );
+
+ aliasTable.save( newInstance );
+ }
+ break;
+ }
+
+ default :
+ {
+ break;
+ }
+ }
+ }
+
+ return( aBaseInstance );
+}
+
+
+
+BF Builder::build(TableOfSymbol & aliasTable,
+ const ExecutionData & anED, const AvmProgram & aProgram, const BF & aCode)
+{
+ if( aProgram.hasData() )
+ {
+ bool destroyLocalRuntimeStackFlag = false;
+
+ ExecutionData cloneED( anED );
+
+ if( not cloneED.hasLocalRuntimeStack() )
+ {
+ destroyLocalRuntimeStackFlag = true;
+ cloneED.createLocalRuntimeStack();
+ }
+ cloneED.getLocalRuntimes()->push( LocalRuntime(aProgram) );
+
+ BF buildCode = build(aliasTable, cloneED, aCode);
+
+ cloneED.getLocalRuntimes()->pop();
+ if( destroyLocalRuntimeStackFlag )
+ {
+ cloneED.destroyLocalRuntimeStack();
+ }
+
+
+ return( buildCode );
+ }
+ else
+ {
+ return( build(aliasTable, anED, aCode) );
+ }
+}
+
+
+BF Builder::build(const ExecutionData & anED, const BF & aCode)
+{
+ TableOfSymbol aliasTable;
+
+ BF buildCode = build(aliasTable, anED, aCode);
+
+ aliasTable.clear();
+
+ return( buildCode );
+}
+
+
+BF Builder::build(TableOfSymbol & aliasTable,
+ const ExecutionData & anED, const BF & aCode)
+{
+ BF compileCode = compile(aliasTable, anED, aCode);
+ if( compileCode.is< AvmCode >() )
+ {
+ compileCode = mAvmcodeCompiler.optimizeExpression(
+ mConfiguration.getExecutableSystem().rawSystemInstance()
+ ->getExecutable(), compileCode.bfCode());
+ }
+
+ return( ExpressionConstructor::newExpr( compileCode ) );
+}
+
+
+BF Builder::compile(TableOfSymbol & aliasTable,
+ const ExecutionData & anED, const BF & aCode)
+{
+ switch( aCode.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ BFCode anAvmCode = aCode.bfCode();
+ Operator * mainOperator = anAvmCode->getOperator();
+
+ BFCode newCode( mainOperator );
+
+ AvmCode::iterator itArg = anAvmCode->begin();
+ AvmCode::iterator itEndArg = anAvmCode->end();
+ for( ; itArg != itEndArg ; ++itArg )
+ {
+ switch( (*itArg).classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ BF bf = compile(aliasTable, anED, *itArg);
+
+ if( bf.is< AvmCode >() )
+ {
+ anAvmCode = bf.bfCode();
+ if( anAvmCode->isOpCode( mainOperator ) &&
+ mainOperator->isAssociative() )
+ {
+ newCode->append( anAvmCode->getArgs() );
+ }
+ else
+ {
+ newCode->append( bf );
+ }
+ }
+ else
+ {
+ newCode->append( bf );
+ }
+
+ break;
+ }
+
+
+ default:
+ {
+ newCode->append( compile(aliasTable, anED, *itArg) );
+
+ break;
+ }
+ }
+
+ }
+
+ return( newCode );
+ }
+
+
+ case FORM_UFI_KIND:
+ {
+ BF anInstance = searchSymbolInstance(aliasTable,
+ anED, aCode.to_ptr< UniFormIdentifier>());
+ if( anInstance.valid() )
+ {
+ if( anInstance.is< InstanceOfData >() )
+ {
+ InstanceOfData * aData = anInstance.to_ptr< InstanceOfData >();
+ if( aData->getModifier().hasFeatureFinal() && aData->hasValue() )
+ {
+ return( aData->getValue() );
+ }
+ }
+
+ return( anInstance );
+ }
+ else
+ {
+ ExecutableQuery XQuery( mConfiguration );
+
+ const BF & aProgram = XQuery.getExecutableOrProgram(aCode.str());
+ if( aProgram.valid() )
+ {
+ return( aProgram );
+ }
+ else
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Unfound UFI symbol : " << aCode.str()
+ << SEND_EXIT;
+
+ return( aCode );
+ }
+ }
+
+ break;
+ }
+
+ case FORM_XFSP_BUFFER_KIND:
+ case FORM_XFSP_CHANNEL_KIND:
+ case FORM_XFSP_CONNECTOR_KIND:
+ case FORM_XFSP_MACHINE_KIND:
+ case FORM_XFSP_PORT_KIND:
+ case FORM_XFSP_ROUTINE_KIND:
+ case FORM_XFSP_SYSTEM_KIND:
+ case FORM_XFSP_TRANSITION_KIND:
+ case FORM_XFSP_DATATYPE_KIND:
+ case FORM_XFSP_VARIABLE_KIND:
+ {
+ const BF & anInstance = searchSymbolInstance(
+ aliasTable, anED, aCode.to_ptr< ObjectElement >() );
+ if( anInstance.valid() )
+ {
+ if( anInstance.is< InstanceOfData >() )
+ {
+ InstanceOfData * aData = anInstance.to_ptr< InstanceOfData >();
+ if( aData->getModifier().hasFeatureFinal() && aData->hasValue() )
+ {
+ return( aData->getValue() );
+ }
+ }
+
+ return( anInstance );
+ }
+ else
+ {
+ ExecutableQuery XQuery( mConfiguration );
+
+ const BF & aProgram = XQuery.getExecutableOrProgram(
+ aCode.to_ptr< ObjectElement >() );
+ if( aProgram.valid() )
+ {
+ return( aProgram );
+ }
+ else
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Unfound FORM symbol : " << aCode.str()
+ << SEND_EXIT;
+
+ return( aCode );
+ }
+ }
+
+ break;
+ }
+
+ case FORM_OPERATOR_KIND:
+ {
+ return( aCode );
+ }
+
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ const BF & anInstance = searchSymbolInstance(aliasTable, anED, aCode);
+ if( anInstance.valid() )
+ {
+ if( anInstance.is< InstanceOfData >() )
+ {
+ InstanceOfData * aData = anInstance.to_ptr< InstanceOfData >();
+ if( aData->getModifier().hasFeatureFinal() && aData->hasValue() )
+ {
+ return( aData->getValue() );
+ }
+ }
+
+ return( anInstance );
+ }
+
+ return( aCode );
+ }
+
+ case FORM_INSTANCE_BUFFER_KIND:
+ case FORM_INSTANCE_CONNECTOR_KIND:
+ case FORM_INSTANCE_MACHINE_KIND:
+ case FORM_INSTANCE_PORT_KIND:
+ {
+ BF anInstance = searchSymbolInstance(aliasTable, anED, aCode);
+ if( anInstance.valid() )
+ {
+ // AVM_OS_TRACE << " --> bOK" << std::endl;
+
+ return( anInstance );
+ }
+
+ return( aCode );
+ }
+
+ case FORM_RUNTIME_ID_KIND:
+ {
+ return( aCode );
+ }
+
+
+ //@deprecated
+ //case FORM_EXPRESSION_GINAC_KIND:
+
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ case FORM_BUILTIN_CHARACTER_KIND:
+ case FORM_BUILTIN_INTEGER_KIND:
+ case FORM_BUILTIN_RATIONAL_KIND:
+ case FORM_BUILTIN_FLOAT_KIND:
+ case FORM_BUILTIN_STRING_KIND:
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+ {
+ return( aCode );
+ }
+
+ default:
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Unexpected FORM KIND for compileAvmCode\n"
+ << aCode.toString()
+ << SEND_EXIT;
+
+ return( aCode );
+ }
+ }
+
+ return( BF::REF_NULL );
+
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/builder/Builder.h b/org.eclipse.efm.symbex/src/builder/Builder.h
new file mode 100644
index 0000000..aba6bbd
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/Builder.h
@@ -0,0 +1,229 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef BUILDER_H_
+#define BUILDER_H_
+
+#include <computer/EvaluationEnvironment.h>
+
+#include <builder/compiler/BaseCompilerTable.h>
+
+#include <builder/compiler/Compiler.h>
+
+#include <fml/executable/ExecutableSystem.h>
+
+#include <fml/symbol/TableOfSymbol.h>
+
+
+namespace sep
+{
+
+class AvmCode;
+class AvmcodeCompiler;
+class AvmPrimitiveProcessor;
+class AvmProgram;
+
+class Configuration;
+
+class ExecutionData;
+class ExecutableSystem;
+
+class ObjectElement;
+
+class SymbexEngine;
+
+class UniFormIdentifier;
+
+
+
+class Builder
+{
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ SymbexEngine & mSymbexEngine;
+
+ Configuration & mConfiguration;
+
+ EvaluationEnvironment ENV;
+
+ BaseCompilerTable mBaseCompilerTable;
+
+ AvmcodeCompiler mAvmcodeCompiler;
+
+ Compiler mCompiler;
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Builder(SymbexEngine & aSymbexEngine, Configuration & aConfiguration,
+ AvmPrimitiveProcessor & aPrimitiveProcessor)
+ : mSymbexEngine( aSymbexEngine ),
+ mConfiguration( aConfiguration ),
+ ENV( aPrimitiveProcessor ),
+ mBaseCompilerTable( aConfiguration ),
+ mAvmcodeCompiler( aConfiguration , mBaseCompilerTable ),
+ mCompiler( aConfiguration , mAvmcodeCompiler )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Builder()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * LOADER - DISPOSER
+ */
+ static void load();
+ static void dispose();
+
+
+ /**
+ * CONFIGURE
+ */
+ bool configure();
+
+
+ /**
+ * GETTER
+ * mConfiguration
+ * mAvmcodeCompiler
+ * mCompiler
+ */
+ inline Configuration & getConfiguration()
+ {
+ return( mConfiguration );
+ }
+
+ inline AvmcodeCompiler & getAvmcodeCompiler()
+ {
+ return( mAvmcodeCompiler );
+ }
+
+ inline Compiler & getCompiler()
+ {
+ return( mCompiler );
+ }
+
+
+ /**
+ * GETTER
+ * Compiler Error / Warning count
+ */
+ inline bool hasError()
+ {
+ return( mCompiler.hasError() );
+ }
+
+ inline bool hasWarning()
+ {
+ return( mCompiler.hasWarning() );
+ }
+
+
+ inline void resetErrorWarning()
+ {
+ mCompiler.resetErrorWarning();
+ }
+
+
+ /**
+ * START
+ */
+ bool start();
+
+ /*
+ * Initial Execution Context creation
+ */
+ APExecutionData createInitialExecutionData();
+
+
+ /**
+ * BUILDER
+ * Replace UFI of var by this associated BaseInstanceForm
+ */
+
+ inline BF compileExpression(ExecutableForm * anExecutable, const BF & aCode)
+ {
+ CompilationEnvironment compilENV(anExecutable);
+
+ compilENV.mCTX->setModifier(
+ Modifier::PROPERTY_PUBLIC_VOLATILE_MODIFIER );
+
+ BF bf = mAvmcodeCompiler.decode_compileExpression(
+ compilENV.mCTX, aCode);
+
+ return( ( bf.isnot< AvmCode >() ) ? bf :
+ mAvmcodeCompiler.optimizeExpression(compilENV.mCTX, bf.bfCode()) );
+ }
+
+ inline BF compileExpression(const BF & aCode);
+
+
+ inline BFCode compileStatement(
+ ExecutableForm * anExecutable, const BFCode & aCode)
+ {
+ BFCode compiledCode =
+ mAvmcodeCompiler.compileStatement(anExecutable, aCode);
+
+ return( mAvmcodeCompiler.optimizeStatement(
+ anExecutable, compiledCode) );
+ }
+
+ inline BFCode compileStatement(const BFCode & aCode);
+
+
+
+ BF build(TableOfSymbol & aliasTable,
+ const ExecutionData & anED, const BF & aCode);
+
+
+ BF build(const ExecutionData & anED, const BF & aCode);
+
+ inline BF build(const APExecutionData & apED, const BF & aCode)
+ {
+ return( build((* apED), aCode) );
+ }
+
+
+ BF build(TableOfSymbol & aliasTable, const ExecutionData & anED,
+ const AvmProgram & aProgram, const BF & aCode);
+
+ BF compile(TableOfSymbol & aliasTable,
+ const ExecutionData & anED, const BF & aCode);
+
+
+ BF searchSymbolInstance(TableOfSymbol & aliasTable,
+ const ExecutionData & anED, UniFormIdentifier * anUFI);
+
+ const BF & searchSymbolInstance(TableOfSymbol & aliasTable,
+ const ExecutionData & anED, const ObjectElement * objElement);
+
+ const BF & searchSymbolInstance(TableOfSymbol & aliasTable,
+ const ExecutionData & anED, const BF & aBaseInstance);
+
+};
+
+
+} /* namespace sep */
+
+#endif /*BUILDER_H_*/
diff --git a/org.eclipse.efm.symbex/src/builder/CMakeLists.txt b/org.eclipse.efm.symbex/src/builder/CMakeLists.txt
new file mode 100644
index 0000000..b165365
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/CMakeLists.txt
@@ -0,0 +1,19 @@
+# =============================================================================
+# CMake file for the BUILDER library
+# =============================================================================
+
+# C++ source files to take into account (all files matching patterns, recursively)
+file (GLOB_RECURSE BUILDER_CXX_SRC_FILES *.cpp *.h)
+
+# Target to build
+add_library (builder STATIC ${BUILDER_CXX_SRC_FILES})
+
+# Include directories (internal)
+target_include_directories (builder PUBLIC ..) # FIXME : explicit the dependencies lib by lib
+
+# Target include directories (external)
+target_include_directories (builder PUBLIC ${GMP_INCLUDE_DIR} ${GMPXX_INCLUDE_DIR})
+target_include_directories (builder PUBLIC ${Boost_INCLUDE_DIRS})
+target_include_directories (builder PUBLIC ${CVC4_INCLUDE_DIR})
+
+add_dependencies(builder rescan_cvc4)
diff --git a/org.eclipse.efm.symbex/src/builder/Loader.cpp b/org.eclipse.efm.symbex/src/builder/Loader.cpp
new file mode 100644
index 0000000..45aa25d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/Loader.cpp
@@ -0,0 +1,1783 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "Loader.h"
+
+#include <builder/primitive/AvmcodeCompiler.h>
+
+#include <builder/Builder.h>
+#include <computer/ExecutionEnvironment.h>
+
+#include <fml/buffer/BaseBufferForm.h>
+#include <fml/buffer/BroadcastBuffer.h>
+#include <fml/buffer/FifoBuffer.h>
+#include <fml/buffer/LifoBuffer.h>
+#include <fml/buffer/MultiFifoBuffer.h>
+#include <fml/buffer/MultiLifoBuffer.h>
+#include <fml/buffer/MultisetBuffer.h>
+#include <fml/buffer/RamBuffer.h>
+#include <fml/buffer/SetBuffer.h>
+
+#include <fml/common/ModifierElement.h>
+
+#include <fml/executable/BaseInstanceForm.h>
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/ExecutableLib.h>
+#include <fml/executable/InstanceOfData.h>
+#include <fml/executable/InstanceOfMachine.h>
+#include <fml/executable/InstanceOfPort.h>
+#include <fml/executable/Router.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/BuiltinQueue.h>
+#include <fml/expression/BuiltinContainer.h>
+#include <fml/expression/ExpressionConstant.h>
+#include <fml/expression/ExpressionFactory.h>
+#include <fml/expression/ExpressionTypeChecker.h>
+#include <fml/expression/StatementConstructor.h>
+
+#include <fml/infrastructure/Buffer.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/symbol/Symbol.h>
+#include <fml/symbol/TableOfSymbol.h>
+
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/Message.h>
+#include <fml/runtime/RuntimeForm.h>
+#include <fml/runtime/RuntimeID.h>
+#include <fml/runtime/RuntimeLib.h>
+#include <fml/runtime/TableOfData.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+#include <fml/type/ClassTypeSpecifier.h>
+#include <fml/type/ContainerTypeSpecifier.h>
+#include <fml/type/TypeManager.h>
+
+#include <sew/Configuration.h>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+Loader::Loader(Configuration & aConfiguration, Builder & aBuilder,
+ AvmPrimitiveProcessor & aPrimitiveProcessor)
+: mConfiguration( aConfiguration ),
+mBuilder( aBuilder ),
+ENV( aPrimitiveProcessor ),
+mOnCreateRoutime( )
+{
+ //!! NOTHING
+}
+
+/**
+ * CONFIGURE
+ */
+bool Loader::configure()
+{
+ //!! NOTHING
+
+ return( true );
+}
+
+
+/**
+ * RUNNING onCREATE
+ * mOnCreateRoutime
+ */
+bool Loader::finalizeRunningOnCreate(
+ const BaseEnvironment & ENV, APExecutionData & anED)
+{
+ if( hasOnCreateRoutime() )
+ {
+ // Save current active RID
+ RuntimeID saveRID = anED->mRID;
+
+ const_rid_iterator itRID = on_create_begin();
+ const_rid_iterator endRID = on_create_end();
+ for( ; itRID != endRID ; ++itRID )
+ {
+//!![TRACE]: to delete
+//AVM_OS_DEBUG << "onCreate: " << str_header( *itRID ) << std::endl
+// << to_stream( (*itRID).getOnCreate() ) << std::flush;
+
+ ExecutionEnvironment tmpENV(ENV, anED,
+ (*itRID), (*itRID).getOnCreate() );
+
+ if( tmpENV.run(PROCESS_CREATING_STATE) )
+ {
+ tmpENV.outEDS.pop_last_to( anED );
+
+ if( tmpENV.outEDS.nonempty() )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unsupported << onCreate Primitive >> "
+ "which execution create more than one "
+ "Execution Context :>\n"
+ << (*itRID).getOnCreate()->toString( AVM_TAB1_INDENT )
+ << SEND_ALERT;
+
+ return( false );
+ }
+
+ anED.mwsetRuntimeFormState((*itRID),
+ PROCESS_CREATING_STATE, PROCESS_DISABLED_STATE);
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Failed to eval << onCreate Routine >> "
+ "on initial Execution Context :>\n"
+ << ENV.inCODE->toString( AVM_TAB1_INDENT )
+ << SEND_ALERT;
+
+ return( false );
+ }
+ }
+
+ resetOnCreateRoutime();
+
+ // Restore current active RID
+ anED->mRID = saveRID;
+ }
+
+ return( true );
+}
+
+
+
+/**
+ * loadSchedulerCode
+ * for onSchedule Routine
+ */
+BFCode Loader::loadSchedulerCode(
+ APExecutionData & anED, const RuntimeForm & aRF,
+ const BFCode & aSchedulerCode, bool isStaticLoading)
+{
+ if( aSchedulerCode.invalid() )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "loadSchedulerCode:> Unexpected a << null<code> >> !!!"
+ << SEND_EXIT;
+
+ return( aSchedulerCode );
+ }
+ else if( aSchedulerCode->empty() )
+ {
+ return( aSchedulerCode );
+ }
+
+ if( aSchedulerCode->singleton()
+ && aSchedulerCode->first().is< InstanceOfMachine >()
+ && OperatorManager::isActivity( aSchedulerCode->getOperator() ) )
+ {
+ InstanceOfMachine * anInstance =
+ aSchedulerCode->first().to_ptr< InstanceOfMachine >();
+
+ if( isStaticLoading
+ && anInstance->hasRuntimeRID()
+ && anED->isAlive( anInstance->getRuntimeRID() ) )
+ {
+ return( StatementConstructor::newOptiNopCode(
+ aSchedulerCode->getOperator(),
+ anInstance->getRuntimeRID(), AVM_ARG_MACHINE_RID) );
+ }
+ else
+ {
+ if( aRF.getExecutable()->hasOnConcurrency() )
+ {
+ BFCode loadCode( aRF.getExecutable()->getOnConcurrencyOperator() );
+
+ loadSchedulerCode(anED, aRF, aSchedulerCode,
+ loadCode, isStaticLoading);
+
+ loadCode = mBuilder.getAvmcodeCompiler().optimizeStatement(
+ aRF.getExecutable(), loadCode);
+
+ return( loadCode );
+ }
+ else
+ {
+ TableOfRuntimeID::iterator itChild = aRF.getChildTable()->begin();
+ TableOfRuntimeID::iterator endChild = aRF.getChildTable()->end();
+ for( ; itChild != endChild ; ++itChild )
+ {
+ if( anInstance->getSpecifier().hasDesignInstanceStatic()
+ && (anInstance == (*itChild).getInstance())
+ && anED->isAlive( *itChild ) )
+ {
+ return( StatementConstructor::newOptiNopCode(
+ aSchedulerCode->getOperator(),
+ (*itChild), AVM_ARG_MACHINE_RID) );
+ }
+ else if( anInstance->getSpecifier().hasDesignModel()
+ && (*itChild).isDynamicLoaded()
+ && (anInstance == (*itChild).
+ getInstance()->getInstanceModel())
+ && anED->isAlive( *itChild ) )
+ {
+ return( StatementConstructor::newOptiNopCode(
+ aSchedulerCode->getOperator(),
+ (*itChild), AVM_ARG_MACHINE_RID) );
+ }
+ }
+
+ AVM_OS_FATAL_ERROR_EXIT
+ << "loadSchedulerCode:> Failed !!!" << aSchedulerCode
+ << SEND_EXIT;
+
+ return( aSchedulerCode );
+ }
+ }
+ }
+
+ else
+ {
+ BFCode loadCode( aSchedulerCode->getOperator() );
+
+ AvmCode::iterator itArg = aSchedulerCode->begin();
+ AvmCode::iterator endArg = aSchedulerCode->end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ if( (*itArg).is< AvmCode >() )
+ {
+ loadSchedulerCode(anED, aRF,
+ (*itArg).bfCode(), loadCode, isStaticLoading);
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "loadSchedulerCode:> Unexpected arg :>"
+ << (*itArg)
+ << SEND_EXIT;
+
+ loadCode->append( *itArg );
+ }
+ }
+
+ return( mBuilder.getAvmcodeCompiler().optimizeStatement(
+ aRF.getExecutable(), loadCode) );
+ }
+}
+
+
+void Loader::loadSchedulerCode(APExecutionData & anED,
+ const RuntimeForm & aRF, const BFCode & aSchedulerCode,
+ BFCode & loadCode, bool isStaticLoading)
+{
+ if( aSchedulerCode->singleton() &&
+ aSchedulerCode->first().is< InstanceOfMachine >() &&
+ OperatorManager::isActivity( aSchedulerCode->getOperator() ) )
+ {
+ InstanceOfMachine * anInstance =
+ aSchedulerCode->first().to_ptr< InstanceOfMachine >();
+
+ if( isStaticLoading
+ && anInstance->hasRuntimeRID()
+ && anED->isAlive( anInstance->getRuntimeRID() ) )
+ {
+ loadCode->append( StatementConstructor::newOptiNopCode(
+ aSchedulerCode->getOperator(),
+ anInstance->getRuntimeRID(), AVM_ARG_MACHINE_RID) );
+ }
+ else
+ {
+ TableOfRuntimeID::iterator itChild = aRF.getChildTable()->begin();
+ TableOfRuntimeID::iterator endChild = aRF.getChildTable()->end();
+ for( ; itChild != endChild ; ++itChild )
+ {
+ if( anInstance->getSpecifier().hasDesignInstanceStatic()
+ && (anInstance == (*itChild).getInstance())
+ && anED->isAlive( *itChild ) )
+ {
+ loadCode->append( StatementConstructor::newOptiNopCode(
+ aSchedulerCode->getOperator(),
+ (*itChild), AVM_ARG_MACHINE_RID) );
+ }
+ else if( anInstance->getSpecifier().hasDesignModel()
+ && (*itChild).isDynamicLoaded()
+ && (anInstance == (*itChild).
+ getInstance()->getInstanceModel())
+ && anED->isAlive( *itChild ) )
+ {
+ loadCode->append( StatementConstructor::newOptiNopCode(
+ aSchedulerCode->getOperator(),
+ (*itChild), AVM_ARG_MACHINE_RID) );
+ }
+ }
+ }
+ }
+ else
+ {
+ loadCode->append(
+ loadSchedulerCode(anED, aRF,
+ aSchedulerCode, isStaticLoading) );
+ }
+}
+
+
+/**
+ * loadSystemInstance
+ */
+RuntimeForm * Loader::loadSystemInstance(APExecutionData & anED,
+ const RuntimeID & aParentRID, InstanceOfMachine * aMachine,
+ int & thePid, avm_offset_t & theOffset)
+{
+AVM_IF_DEBUG_FLAG( LOADING )
+ AVM_OS_TRACE << INCR_INDENT_TAB
+ << "< begin loading system instance < "
+ << aMachine->getFullyQualifiedNameID() << " >"
+ << std::endl
+ << TAB << "\t>>>> parent is: "
+ << std::endl;
+
+ aParentRID.toStream(AVM_OS_TRACE << INCR2_INDENT);
+
+ AVM_OS_TRACE << EOL_DECR2_INDENT;
+AVM_ENDIF_DEBUG_FLAG( LOADING )
+
+
+ // PID & OFFSET for the runtime machine
+ int pid = thePid++;
+ avm_offset_t offset = theOffset++;
+
+ RuntimeID loadMachineRID(aParentRID, pid, offset, aMachine);
+
+ mConfiguration.appendRID( loadMachineRID );
+
+ if( aMachine->getExecutable()->hasSingleRuntimeInstance() )
+ {
+ aMachine->setRuntimeRID(loadMachineRID);
+ }
+
+ RuntimeForm * aRF = new RuntimeForm( loadMachineRID );
+
+ anED->saveRuntimeForm(offset, aRF);
+
+ if( aMachine->hasOnCreate() )
+ {
+ mOnCreateRoutime.append( loadMachineRID );
+
+ anED->setRuntimeFormState(offset, PROCESS_CREATING_STATE);
+ }
+ else
+ {
+ anED->setRuntimeFormState(offset, PROCESS_DISABLED_STATE);
+ }
+
+//!?! Code pour évolution future
+// aRF->setNodeCondition( ExpressionConstant::BOOLEAN_TRUE );
+// aRF->setNodeTimedCondition( ExpressionConstant::BOOLEAN_TRUE );
+
+
+ if( aParentRID.valid() )
+ {
+ anED->getRuntime(aParentRID).appendChild( loadMachineRID );
+ }
+
+ ExecutableForm * anExecutable = aMachine->getExecutable();
+
+ // Load DATA
+ if( loadData(anED, loadMachineRID, loadMachineRID) )
+ {
+ // Optimization for runtime resource access
+ TableOfInstanceOfData::const_raw_iterator itData =
+ anExecutable->getData().begin();
+ TableOfInstanceOfData::const_raw_iterator endData =
+ anExecutable->getData().end();
+ for( ; itData != endData ; ++itData )
+ {
+ (itData)->setRuntimeContainerRID( loadMachineRID );
+ }
+ }
+
+ // Load BUFFER
+ if( loadBuffer(anED, loadMachineRID, loadMachineRID) )
+ {
+ // Optimization for runtime resource access
+ TableOfSymbol::iterator itBuffer = anExecutable->getBuffer().begin();
+ TableOfSymbol::iterator endBuffer = anExecutable->getBuffer().end();
+ for( ; itBuffer < endBuffer ; ++itBuffer )
+ {
+ (*itBuffer).setRuntimeContainerRID( loadMachineRID );
+ }
+ }
+
+ // Load ROUTER
+ if( loadRouter(anED, loadMachineRID, loadMachineRID) )
+ {
+ // Optimization for runtime resource access
+ TableOfSymbol::iterator itPort = anExecutable->getPort().begin();
+ TableOfSymbol::iterator endPort = anExecutable->getPort().end();
+ for( ; itPort != endPort ; ++itPort )
+ {
+ (*itPort).setRuntimeContainerRID( loadMachineRID );
+
+ if( (*itPort).port().isPort() )
+ {
+ if( (*itPort).getModifier().hasDirectionInput() )
+ {
+ (*itPort).setInputRoutingData( aRF->getRouter().
+ getInputRouting((*itPort).getRouteOffset()) );
+ }
+ if( (*itPort).getModifier().hasDirectionOutput() )
+ {
+ (*itPort).setOutputRoutingData( aRF->getRouter().
+ getOutputRouting((*itPort).getRouteOffset()) );
+ }
+ }
+ }
+ }
+
+
+ // Load MACHINE
+ loadMachine(anED, loadMachineRID, loadMachineRID, thePid, theOffset);
+
+ // set SCHEDULE
+ if( anExecutable->hasSingleRuntimeInstance() &&
+ aMachine->getExecutable()->hasOnSchedule() )
+ {
+ aRF->setOnSchedule(
+ loadSchedulerCode(anED, (*aRF),
+ aMachine->getExecutable()->getOnSchedule(), true) );
+ }
+
+ // Optimization for runtime resource access
+ TableOfInstanceOfData::const_raw_iterator itData =
+ anExecutable->getDataAlias().begin();
+ TableOfInstanceOfData::const_raw_iterator endData =
+ anExecutable->getDataAlias().end();
+ for( ; itData != endData ; ++itData )
+ {
+ if( (itData)->isAlias() )
+ {
+ if( (itData)->hasAliasTarget() &&
+ (itData)->getAliasTarget()->hasRuntimeContainerRID() )
+ {
+ (itData)->setRuntimeContainerRID(
+ (itData)->getAliasTarget()->getRuntimeContainerRID() );
+ }
+ else if( (itData)->hasMachinePath() )
+ {
+ (itData)->setRuntimeContainerRID( (itData)->getMachinePath()->
+ last()->getExecutable()->getData().
+ rawAt((itData)->getOffset())->getRuntimeContainerRID() );
+ }
+ }
+ }
+
+ // Optimization for runtime resource access
+ TableOfSymbol::iterator itAlias = anExecutable->getAlias().begin();
+ TableOfSymbol::iterator endAlias = anExecutable->getAlias().end();
+ for( ; itAlias < endAlias ; ++itAlias )
+ {
+ if( (*itAlias).isAlias() )
+ {
+ if( (*itAlias).hasAliasTarget() &&
+ (*itAlias).getAliasTarget()->hasRuntimeContainerRID() )
+ {
+ (*itAlias).setRuntimeContainerRID(
+ (*itAlias).getAliasTarget()->getRuntimeContainerRID() );
+ }
+ else if( (*itAlias).hasMachinePath() )
+ {
+ (*itAlias).setRuntimeContainerRID((*itAlias).
+ getMachinePath()->last()->getExecutable()->getData().
+ rawAt((*itAlias).getOffset())->getRuntimeContainerRID() );
+ }
+ }
+ }
+
+AVM_IF_DEBUG_FLAG( LOADING )
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << "> end loading system instance < "
+ << aMachine->getFullyQualifiedNameID() << " >" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( LOADING )
+
+ return( aRF );
+}
+
+
+/**
+ * loadMachineInstance
+ */
+RuntimeForm * Loader::loadMachineInstance(APExecutionData & anED,
+ const RuntimeID & aParentRID, InstanceOfMachine * anInstance,
+ int & thePid, avm_offset_t & theOffset)
+{
+AVM_IF_DEBUG_FLAG( LOADING )
+ AVM_OS_TRACE << INCR_INDENT_TAB
+ << "< begin loading machine instance < "
+ << anInstance->getFullyQualifiedNameID() << " >"
+ << std::endl
+ << TAB << "\t>>>> parent is: "
+ << std::endl;
+
+ aParentRID.toStream(AVM_OS_TRACE << INCR2_INDENT);
+
+ AVM_OS_TRACE << EOL_DECR2_INDENT;
+AVM_ENDIF_DEBUG_FLAG( LOADING )
+
+ // PID & OFFSET for the runtime machine
+ int pid = thePid++;
+ avm_offset_t offset = theOffset++;
+
+ RuntimeID loadMachineRID(aParentRID, pid, offset, anInstance);
+ if( anInstance->getExecutable()->hasSingleRuntimeInstance() )
+ {
+ anInstance->setRuntimeRID(loadMachineRID);
+ }
+
+ mConfiguration.appendRID( loadMachineRID );
+
+ RuntimeForm * aRF = new RuntimeForm( loadMachineRID );
+
+ anED->saveRuntimeForm(offset, aRF);
+
+//!?! Code pour évolution future
+// aRF->setNodeCondition( ExpressionConstant::BOOLEAN_TRUE );
+// aRF->setNodeTimedCondition( ExpressionConstant::BOOLEAN_TRUE );
+
+
+ if( anInstance->isAutoStart() )
+ {
+// anED->setRuntimeFormState(offset, anED->getRuntimeFormState(aParentRF));
+
+ if( anInstance->hasOnCreate() )
+ {
+ mOnCreateRoutime.append( loadMachineRID );
+
+ anED->setRuntimeFormState(offset, PROCESS_CREATING_STATE);
+ }
+ else
+ {
+ anED->setRuntimeFormState(offset, PROCESS_DISABLED_STATE);
+ }
+ }
+ else
+ {
+ anED->setRuntimeFormState(offset, PROCESS_CREATED_STATE);
+
+ loadMachineRID.setDynamicLoaded( true );
+ }
+
+ if( aParentRID.valid() )
+ {
+ anED->getRuntime(aParentRID).appendChild( loadMachineRID );
+ }
+
+
+ ExecutableForm * anExecutable = anInstance->getExecutable();
+
+ // Load DATA
+ if( loadData(anED, loadMachineRID, loadMachineRID) )
+ {
+ // Optimization for runtime resource access
+ if( anExecutable->hasSingleRuntimeInstance() &&
+ anExecutable->getData().nonempty() )
+ {
+ TableOfInstanceOfData::const_raw_iterator itData =
+ anExecutable->getData().begin();
+ TableOfInstanceOfData::const_raw_iterator endData =
+ anExecutable->getData().end();
+ for( ; itData != endData ; ++itData )
+ {
+ (itData)->setRuntimeContainerRID( loadMachineRID );
+ }
+ }
+ }
+
+ // Load BUFFER
+ if( loadBuffer(anED, loadMachineRID, loadMachineRID) )
+ {
+ // Optimization for runtime resource access
+ if( anExecutable->hasSingleRuntimeInstance() &&
+ anExecutable->getBuffer().nonempty())
+ {
+ TableOfSymbol::iterator itBuffer = anExecutable->getBuffer().begin();
+ TableOfSymbol::iterator endBuffer = anExecutable->getBuffer().end();
+ for( ; itBuffer < endBuffer ; ++itBuffer )
+ {
+ (*itBuffer).setRuntimeContainerRID( loadMachineRID );
+ }
+ }
+ }
+
+ // Load ROUTER
+ if( loadRouter(anED, loadMachineRID, loadMachineRID) )
+ {
+ if( anExecutable->hasSingleRuntimeInstance() &&
+ anExecutable->getPort().nonempty() )
+ {
+ // Optimization for runtime resource access
+ TableOfSymbol::iterator itPort = anExecutable->getPort().begin();
+ TableOfSymbol::iterator endPort = anExecutable->getPort().end();
+ for( ; itPort != endPort ; ++itPort )
+ {
+ (*itPort).setRuntimeContainerRID( loadMachineRID );
+
+ if( (*itPort).port().isPort() )
+ {
+ if( (*itPort).getModifier().hasDirectionInput() )
+ {
+ (*itPort).setInputRoutingData( aRF->getRouter().
+ getInputRouting((*itPort).getRouteOffset()) );
+ }
+ if( (*itPort).getModifier().hasDirectionOutput() )
+ {
+ (*itPort).setOutputRoutingData(aRF->getRouter().
+ getOutputRouting((*itPort).getRouteOffset()) );
+ }
+ }
+ }
+ }
+ }
+
+
+ // Load MACHINE
+ loadMachine(anED, loadMachineRID, loadMachineRID, thePid, theOffset);
+
+ // set SCHEDULE
+ if( //anExecutable->hasSingleRuntimeInstance() &&
+ anExecutable->hasOnSchedule() )
+ {
+ aRF->setOnSchedule(
+ loadSchedulerCode(anED, (*aRF),
+ anExecutable->getOnSchedule(), true) );
+ }
+
+
+ // Optimization for runtime resource access
+ TableOfInstanceOfData::const_raw_iterator itData =
+ anExecutable->getDataAlias().begin();
+ TableOfInstanceOfData::const_raw_iterator endData =
+ anExecutable->getDataAlias().end();
+ for( ; itData != endData ; ++itData )
+ {
+ if( (itData)->isAlias() )
+ {
+ if( (itData)->hasAliasTarget() &&
+ (itData)->getAliasTarget()->hasRuntimeContainerRID() )
+ {
+ (itData)->setRuntimeContainerRID(
+ (itData)->getAliasTarget()->getRuntimeContainerRID() );
+ }
+ else if( (itData)->hasMachinePath() )
+ {
+ (itData)->setRuntimeContainerRID((itData)->getMachinePath()->
+ last()->getExecutable()->getData().
+ rawAt((itData)->getOffset())->getRuntimeContainerRID() );
+ }
+ }
+ }
+
+ // Optimization for runtime resource access
+ TableOfSymbol::iterator itAlias = anExecutable->getAlias().begin();
+ TableOfSymbol::iterator endAlias = anExecutable->getAlias().end();
+ for( ; itAlias < endAlias ; ++itAlias )
+ {
+ if( (*itAlias).isAlias() )
+ {
+ if( (*itAlias).hasAliasTarget() &&
+ (*itAlias).getAliasTarget()->hasRuntimeContainerRID() )
+ {
+ (*itAlias).setRuntimeContainerRID(
+ (*itAlias).getAliasTarget()->getRuntimeContainerRID() );
+ }
+ else if( (*itAlias).hasMachinePath() )
+ {
+ (*itAlias).setRuntimeContainerRID( (*itAlias).
+ getMachinePath()->last()->getExecutable()->getData().
+ rawAt((*itAlias).getOffset())->getRuntimeContainerRID() );
+ }
+ }
+ }
+
+AVM_IF_DEBUG_FLAG( LOADING )
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << "> end loading machine instance < "
+ << anInstance->getFullyQualifiedNameID() << " >" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( LOADING )
+
+ return( aRF );
+}
+
+
+/**
+ * loadData
+ */
+bool Loader::loadData(APExecutionData & anED,
+ const RuntimeID & aRID, const RuntimeID & aDataRID)
+{
+ if( aDataRID.hasVariable() )
+ {
+ avm_size_t errorCount = 0;
+
+ ExecutableForm * theExecutable = aDataRID.getExecutable();
+
+ TableOfData * aDataTable = new TableOfData( theExecutable->getDataSize() );
+ anED->getRuntime(aDataRID).setDataTable(aDataTable);
+
+ InstanceOfMachine * aMachine = aDataRID.getInstance();
+
+ TableOfInstanceOfData::const_raw_iterator itData =
+ theExecutable->getData().begin();
+ TableOfInstanceOfData::const_raw_iterator endData =
+ theExecutable->getData().end();
+ avm_offset_t offset = 0;
+
+ // LOAD PARAMETER & RETURN
+ if( theExecutable->hasParamReturn()
+ && aMachine->hasParamReturnTable() )
+ {
+ BF paramReturnArgument;
+
+ anED->makeWritableRuntimeFormStateTable();
+
+ avm_size_t paramReturnCount = theExecutable->getParamReturnCount();
+ for( ; offset < paramReturnCount ; ++itData , ++offset )
+ {
+ anED->setAssigned(aDataRID, offset, true);
+
+AVM_OS_ASSERT_FATAL_ERROR_EXIT( offset == (itData)->getOffset() )
+ << "Invalid variable offset in data table !\n\t"
+ << str_header( *itData )
+ << SEND_EXIT;
+
+ paramReturnArgument = aMachine->getParamReturn(offset);
+ if( paramReturnArgument.invalid() && (itData)->hasValue() )
+ {
+ paramReturnArgument = (itData)->getValue();
+ }
+
+ if( paramReturnArgument.valid() )
+ {
+ if( (itData)->getModifier().hasNatureReference() )
+ {
+ if( paramReturnArgument.isnot< InstanceOfData >() )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "loading:> Unexpected a non "
+ "lvalue for reference param << "
+ << paramReturnArgument.str() << " >> !!!"
+ << SEND_EXIT;
+ }
+ }
+ else if( (itData)->getModifier().hasNatureMacro() )
+ {
+ //!! NOTHING
+ }
+ else if( aDataRID.getInstance()->isAutoStart() )
+ //(not theExecutable->getSpecifier().isComponentProcedure()))
+ {
+ if( ENV.eval(anED, aDataRID, paramReturnArgument) )
+ {
+ paramReturnArgument = ENV.outVAL;
+ }
+ // ASSERT paramForm is an LVALUE
+ else //if( not (itData)->getModifier().hasNatureReference() )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "loading:> Failed to eval initial "
+ "value for param << "
+ << paramReturnArgument.str() << " >> !!!"
+ << SEND_EXIT;
+ }
+ }
+ else
+ {
+ paramReturnArgument = ENV.createInitial(
+ anED, aDataRID, (itData) );
+ }
+
+ if( not ExpressionTypeChecker::isTyped(
+ (itData)->getTypeSpecifier(), paramReturnArgument) )
+ {
+ ++errorCount;
+
+// getCompilerTable().incrErrorCount();
+ AVM_OS_WARN
+ << aMachine->getAstElement()->errorLocation()
+ << "loadData :> Unexpected << ";
+
+AVM_IF_DEBUG_FLAG( LOADING )
+ AVM_OS_WARN << std::endl << paramReturnArgument
+ << " >> as << " << (itData)->getTypeSpecifier()->strT();
+
+ aMachine->getAstElement()->errorLocation(AVM_OS_TRACE)
+ << "loadData :> Unexpected << "
+ << str_header( paramReturnArgument ) << " >> as << "
+ << (itData)->getTypeSpecifier()->strT()
+ << " >> parameter for\n\t<< " << str_header( *itData ) << " >> !!!"
+ << std::endl;
+
+AVM_ELSE
+
+ AVM_OS_WARN << str_header( paramReturnArgument ) << " >> as << "
+ << (itData)->getTypeSpecifier()->strT();
+AVM_ENDIF_DEBUG_FLAG( LOADING )
+
+ AVM_OS_WARN << " >> parameter for\n\t<< "
+ << str_header( *itData ) << " >>!!!"
+ << std::endl;
+ }
+ }
+ else
+ {
+ paramReturnArgument =
+ ENV.createInitial(anED, aDataRID, (itData));
+ }
+
+ aDataTable->set(offset, paramReturnArgument);
+ }
+ }
+
+
+ for( ; itData != endData ; ++itData , ++offset )
+ {
+ anED->setAssigned(aDataRID, offset, true);
+
+ aDataTable->set(offset,
+ ENV.createInitial(anED, aDataRID, (itData)));
+ }
+
+ return( errorCount == 0 );
+ }
+
+ return( true );
+}
+
+/**
+ * loadInitialMonitorData
+ */
+//!![MIGRATION]:MONITOR --> onCreate Routine
+//void Loader::loadInitialMonitorData(
+// APExecutionData & anED, const RuntimeID & aRID,
+// InstanceOfMachine * anInstanceMachine, bool isRecursive)
+//{
+// const RuntimeID & aDataRID = anED->getRuntimeID(anInstanceMachine);
+// ExecutableForm * theExecutable = aDataRID.getExecutable();
+//
+// // Load DATA
+// if( theExecutable->getData().nonempty() )
+// {
+// TableOfInstanceOfData::const_raw_iterator itData =
+// theExecutable->getData().begin();
+// TableOfInstanceOfData::const_raw_iterator endData =
+// theExecutable->getData().end();
+//
+// // LOAD PARAMETER
+// if( theExecutable->hasParam() && anInstanceMachine->hasParamReturnTable() )
+// {
+// avm_size_t paramCount = theExecutable->getParamCount();
+// for( avm_offset_t offset = 0 ; offset < paramCount ; ++itData , ++offset )
+// {
+// if( (itData)->hasOnWriteRoutine() )
+// {
+// BF paramForm = anInstanceMachine->getParam(offset);
+//
+// if( paramForm.valid() )
+// {
+// ENV.eval(anED, aRID, paramForm);
+// paramForm = ENV.outVAL;
+// }
+// else if( ENV.getRvalue(anED, aDataRID, (itData)).invalid() )
+// {
+// paramForm = ENV.createInitial(anED, aDataRID, (itData));
+// }
+//
+// if( not ExpressionFactory::containsVariable(
+// (itData)->getOnWriteCode(), (itData)) )
+// {
+// if( not ENV.writeData(anED, aDataRID, (itData), paramForm) )
+// {
+// AVM_OS_EXIT( FAILED )
+// << "loadInitialMonitorData:> Unvalid "
+// "Initial Value << " << paramForm.str()
+// << " >> for onInit monitor !\n"
+// << (itData)->toString()
+// << SEND_EXIT;
+// }
+// }
+// }
+// }
+// }
+//
+// for( ; itData != endData ; ++itData )
+// {
+// if( (itData)->hasOnWriteRoutine() )
+// {
+// BF paramForm = ENV.getRvalue(anED, aDataRID, (itData));
+// if( paramForm.invalid() )
+// {
+// paramForm = ENV.createInitial(anED, aDataRID, (itData));
+// }
+//
+// if( not ExpressionFactory::containsVariable(
+// (itData)->getOnWriteCode(), (itData)) )
+// {
+// if( not ENV.writeData(anED, aDataRID, (itData), paramForm) )
+// {
+// AVM_OS_EXIT( FAILED )
+// << "loadInitialMonitorData:> Unvalid "
+// "Initial Value << " << paramForm.str()
+// << " >> for onInit monitor !\n"
+// << (itData)->toString()
+// << SEND_EXIT;
+// }
+// }
+// }
+// }
+// }
+//
+// // Load MACHINE
+// if( isRecursive && theExecutable->getMachineInstance().nonempty() )
+// {
+// TableOfSymbol::const_iterator itMachine =
+// theExecutable->instance_static_begin();
+// TableOfSymbol::const_iterator endMachine =
+// theExecutable->instance_static_end();
+// for( ; itMachine != endMachine ; ++itMachine )
+// {
+// loadInitialMonitorData(anED, aRID,
+// (*itMachine).rawMachine(), isRecursive);
+// }
+// }
+//}
+
+
+/**
+ * loadBuffer
+ */
+bool Loader::loadBuffer(APExecutionData & anED,
+ const RuntimeID & aRID, const RuntimeID & loadMachineRID)
+{
+ ExecutableForm * loadExecutable = loadMachineRID.getExecutable();
+
+ if( loadExecutable->getBuffer().nonempty() )
+ {
+ TableOfBufferT aBufferTable( loadExecutable->getBuffer().size() );
+ anED->getRuntime( loadMachineRID ).setBufferTable(aBufferTable);
+
+ TableOfSymbol::const_iterator itBuffer = loadExecutable->getBuffer().begin();
+ TableOfSymbol::const_iterator endBuffer = loadExecutable->getBuffer().end();
+ for( avm_size_t offset = 0 ; itBuffer < endBuffer ; ++itBuffer , ++offset )
+ {
+ switch( (*itBuffer).getPolicySpecifierKind() )
+ {
+ case TYPE_FIFO_SPECIFIER:
+ {
+ aBufferTable.set(offset,
+ new FifoBuffer(((*itBuffer).rawBuffer())));
+ break;
+ }
+ case TYPE_LIFO_SPECIFIER:
+ {
+ aBufferTable.set(offset,
+ new LifoBuffer(((*itBuffer).rawBuffer())));
+ break;
+ }
+
+
+ case TYPE_MULTI_FIFO_SPECIFIER:
+ {
+ aBufferTable.set(offset,
+ new MultiFifoBuffer(((*itBuffer).rawBuffer())));
+ break;
+ }
+ case TYPE_MULTI_LIFO_SPECIFIER:
+ {
+ aBufferTable.set(offset,
+ new MultiLifoBuffer(((*itBuffer).rawBuffer())));
+ break;
+ }
+
+
+ case TYPE_RAM_SPECIFIER:
+ {
+ aBufferTable.set(offset,
+ new RamBuffer(((*itBuffer).rawBuffer())));
+ break;
+ }
+
+ case TYPE_MULTISET_SPECIFIER:
+ {
+ aBufferTable.set(offset,
+ new MultisetBuffer(((*itBuffer).rawBuffer())));
+ break;
+ }
+ case TYPE_SET_SPECIFIER:
+ {
+ aBufferTable.set(offset,
+ new SetBuffer(((*itBuffer).rawBuffer())));
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_EXIT( FAILED )
+ << "theBuffer Nature is unexpected"
+ << SEND_EXIT;
+
+ aBufferTable.set(offset,
+ new FifoBuffer(((*itBuffer).rawBuffer())));
+ break;
+ }
+ }
+ }
+ }
+
+ return( true );
+}
+
+
+/**
+ * loadMachine
+ */
+void Loader::loadMachine(APExecutionData & anED,
+ const RuntimeID & aRID, const RuntimeID & loadMachineRID,
+ int & thePid, avm_offset_t & theOffset)
+{
+ ExecutableForm * loadExecutable = loadMachineRID.getExecutable();
+
+ if( loadExecutable->getInstanceStatic().nonempty() )
+ {
+ if( loadExecutable->hasInstanceStaticThis() )
+ {
+ anED->getRuntime( loadMachineRID ).appendChild( loadMachineRID );
+ }
+
+ TableOfSymbol::const_iterator itInstance =
+ loadExecutable->instance_static_begin();
+ TableOfSymbol::const_iterator endInstance =
+ loadExecutable->instance_static_end();
+ for( ; itInstance != endInstance ; ++itInstance )
+ {
+ loadMachineInstance( anED , loadMachineRID,
+ (*itInstance).rawMachine(), thePid, theOffset);
+ }
+ }
+}
+
+
+/**
+ * dynamicLoadMachine
+ */
+RuntimeForm * Loader::dynamicLoadMachine(APExecutionData & anED,
+ const RuntimeID & aRID, RuntimeForm * aModelRF,
+ const RuntimeID & aParentRID, Operator * aScheduleOp)
+{
+ InstanceOfMachine * aMachine = aModelRF->getInstance()->clone();
+// BF bfMachine( aMachine );
+
+ aMachine->setInstanciationCount( aModelRF->getInstanciationCount() );
+
+ ExecutableForm * theExecutable = aMachine->getExecutable();
+
+ aMachine->updateUfid( aModelRF->getInstanciationCount() );
+
+ aMachine->setOffset( anED->getRuntime(aParentRID).getChildTable()->size() );
+
+
+AVM_IF_DEBUG_FLAG( LOADING )
+ AVM_OS_TRACE << INCR_INDENT_TAB
+ << "< begin loading machine instance < "
+ << aMachine->getFullyQualifiedNameID() << " >" << std::endl;
+
+ AVM_OS_TRACE << incr_stream( aMachine ) << TAB << "\t>>>> parent is: "
+ << std::endl;
+
+ aParentRID.toStream(AVM_OS_TRACE << INCR2_INDENT);
+
+ AVM_OS_TRACE << EOL_DECR2_INDENT;
+AVM_ENDIF_DEBUG_FLAG( LOADING )
+
+
+ // PID & OFFSET for the runtime machine
+ avm_offset_t theOffset = anED->getTableOfRuntime().size();
+ int thePid = anED->getRuntimeID(theOffset - 1).getRid() + 1;
+
+ avm_size_t newMachineCount =
+ 1 + theExecutable->getrecMachineCount() + theOffset;
+
+ int pid = thePid++;
+ avm_offset_t offset = theOffset++;
+
+
+ //!! TODO RESIZE & MEMORY
+ anED->resize( newMachineCount );
+
+
+ RuntimeID loadMachineRID(
+ aModelRF->getRID(), aParentRID, pid, offset, aMachine);
+
+ loadMachineRID.setDynamicLoaded( true );
+
+ mConfiguration.appendRID( loadMachineRID );
+
+ RuntimeForm * aRF = new RuntimeForm( loadMachineRID );
+ anED->saveRuntimeForm(offset, aRF);
+
+//!?! Code pour évolution future
+// aRF->setNodeCondition( ExpressionConstant::BOOLEAN_TRUE );
+// aRF->setNodeTimedCondition( ExpressionConstant::BOOLEAN_TRUE );
+
+ if( aMachine->hasOnCreate() )
+ {
+ mOnCreateRoutime.append( loadMachineRID );
+
+ anED->setRuntimeFormState(offset, PROCESS_CREATING_STATE);
+ }
+ else
+ {
+ anED->setRuntimeFormState(offset, PROCESS_DISABLED_STATE);
+ }
+
+ RuntimeForm & aParentRF = anED.getWritableRuntime( aParentRID );
+
+ aParentRF.makeWritableChildTable();
+ aParentRF.appendChild( loadMachineRID );
+
+ aParentRF.setOnSchedule(
+ loadSchedulerCode(anED, aParentRF,
+ aParentRF.getExecutable()->getOnSchedule(), true) );
+
+ // Load DATA
+ if( loadData(anED, aRID, loadMachineRID) )
+ {
+ if( loadMachineRID.hasVariable() )
+ {
+//!![MIGRATION]:MONITOR --> onCreate Routine
+// loadInitialMonitorData(anED, aRID,
+// loadMachineRID.getInstance(), false);
+ }
+ }
+ else
+ {
+ AVM_OS_EXIT( FAILED )
+ << "dynamicLoadMachine:> loadData failed"
+ << SEND_EXIT;
+ }
+
+ // Load BUFFER
+ if( not loadBuffer(anED, aRID, loadMachineRID) )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "dynamicLoadMachine:> loadBuffer failed"
+ << SEND_EXIT;
+ }
+
+ // Load ROUTER
+ if( not dynamicLoadRouter(anED, loadMachineRID) )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "dynamicLoadMachine:> dynamicLoadRouter failed"
+ << SEND_EXIT;
+ }
+
+
+ // Load MACHINE
+ loadMachine(anED, loadMachineRID, loadMachineRID, thePid, theOffset);
+
+ // set SCHEDULE
+ if( theExecutable->hasOnSchedule() )
+ {
+ aRF->setOnSchedule(
+ loadSchedulerCode(anED, (*aRF),
+ theExecutable->getOnSchedule(), true) );
+ }
+
+
+AVM_IF_DEBUG_FLAG( LOADING )
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << "> end loading machine instance < "
+ << aMachine->getFullyQualifiedNameID() << " >" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( LOADING )
+
+
+ return( aRF );
+}
+
+
+
+RuntimeForm * Loader::dynamicLoadMachine(APExecutionData & anED,
+ const RuntimeID & aRID, InstanceOfMachine * anInstanceDynamic,
+ const RuntimeID & aParentRID, Operator * aScheduleOp)
+{
+ InstanceOfMachine * aMachine = anInstanceDynamic->clone();
+// BF bfMachine( aMachine );
+
+ aMachine->setInstanciationCount(
+ anInstanceDynamic->getInstanciationCount() );
+
+ ExecutableForm * theExecutable = aMachine->getExecutable();
+
+// aMachine->updateUfid( anInstanceDynamic->getInstanciationCount() );
+
+ aMachine->setOffset(
+ anED->getRuntime(aParentRID).getChildTable()->size() );
+
+
+AVM_IF_DEBUG_FLAG( LOADING )
+ AVM_OS_TRACE << INCR_INDENT_TAB
+ << "< begin loading machine instance < "
+ << aMachine->getFullyQualifiedNameID() << " >" << std::endl;
+
+ AVM_OS_TRACE << to_stream( aMachine ) << TAB << "\t>>>> parent is: "
+ << std::endl;
+
+ aParentRID.toStream(AVM_OS_TRACE << INCR2_INDENT);
+
+ AVM_OS_TRACE << EOL_DECR2_INDENT;
+AVM_ENDIF_DEBUG_FLAG( LOADING )
+
+
+ // PID & OFFSET for the runtime machine
+ avm_offset_t theOffset = anED->getTableOfRuntime().size();
+ int thePid = anED->getRuntimeID(theOffset - 1).getRid() + 1;
+
+ avm_size_t newMachineCount =
+ 1 + theExecutable->getrecMachineCount() + theOffset;
+
+ int pid = thePid++;
+ avm_offset_t offset = theOffset++;
+
+
+ //!! TODO RESIZE & MEMORY
+ anED->resize( newMachineCount );
+
+
+ RuntimeID loadMachineRID(aParentRID, pid, offset, aMachine);
+
+ loadMachineRID.setDynamicLoaded( true );
+
+ mConfiguration.appendRID( loadMachineRID );
+
+ RuntimeForm * aRF = new RuntimeForm( loadMachineRID );
+ anED->saveRuntimeForm(offset, aRF);
+
+//!?! Code pour évolution future
+// aRF->setNodeCondition( ExpressionConstant::BOOLEAN_TRUE );
+// aRF->setNodeTimedCondition( ExpressionConstant::BOOLEAN_TRUE );
+
+ if( aMachine->hasOnCreate() )
+ {
+ mOnCreateRoutime.append( loadMachineRID );
+
+ anED->setRuntimeFormState(offset, PROCESS_CREATING_STATE);
+ }
+ else
+ {
+ anED->setRuntimeFormState(offset, PROCESS_DISABLED_STATE);
+ }
+
+ RuntimeForm & aParentRF = anED.getWritableRuntime( aParentRID );
+
+ aParentRF.makeWritableChildTable();
+ aParentRF.appendChild( loadMachineRID );
+
+ aParentRF.setOnSchedule( loadSchedulerCode(anED, aParentRF,
+ aParentRF.getExecutable()->getOnSchedule(), false) );
+
+ // Load DATA
+ if( loadData(anED, aRID, loadMachineRID) )
+ {
+ if( loadMachineRID.hasVariable() )
+ {
+// loadInitialMonitorData(anED, aRID,
+// loadMachineRID.getInstance(), false);
+ }
+ }
+ else
+ {
+ AVM_OS_EXIT( FAILED )
+ << "dynamicLoadMachine:> loadData failed"
+ << SEND_EXIT;
+ }
+
+ // Load BUFFER
+ if( not loadBuffer(anED, aRID, loadMachineRID) )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "dynamicLoadMachine:> loadBuffer failed"
+ << SEND_EXIT;
+ }
+
+ // Load ROUTER
+ if( not dynamicLoadRouter(anED, loadMachineRID) )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "dynamicLoadMachine:> dynamicLoadRouter failed"
+ << SEND_EXIT;
+ }
+
+
+ // Load MACHINE
+ loadMachine(anED, loadMachineRID, loadMachineRID, thePid, theOffset);
+
+ // set SCHEDULE
+ if( theExecutable->hasOnSchedule() )
+ {
+ aRF->setOnSchedule(
+ loadSchedulerCode(anED, (*aRF),
+ theExecutable->getOnSchedule(), true) );
+ }
+
+
+AVM_IF_DEBUG_FLAG( LOADING )
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << "> end loading machine instance < "
+ << aMachine->getFullyQualifiedNameID() << " >" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( LOADING )
+
+
+ return( aRF );
+}
+
+
+/**
+ * getRouter4Model
+ */
+const Router & Loader::getRouter4Model(
+ APExecutionData & anED, RuntimeID & aRoutingRID)
+{
+ while( aRoutingRID.valid() )
+ {
+ if( aRoutingRID.getExecutable()->hasRouter4Model() )
+ {
+ const Router & aRouter = aRoutingRID.getExecutable()
+ ->getRouter4Model( aRoutingRID.getExecutable() );
+
+ if( aRouter.valid() )
+ {
+ return( aRouter );
+ }
+ }
+
+ aRoutingRID = aRoutingRID.getPRID();
+ }
+
+ return( Router::_NULL_ );
+}
+
+/**
+ * cloneUpdateRouter
+ */
+static Router cloneUpdateRouter(const Router & loadRouter,
+ const RuntimeID & aRoutingRID,
+ const RuntimeID & loadMachineRID)
+{
+ avm_size_t routeCount = loadRouter.getRouteID();
+
+ Router newRouter(loadMachineRID.getInstance(), routeCount, routeCount);
+
+ RoutingData aRoutingData;
+
+ // GLOBAL INPUT or OUTPUT ROUTE
+ avm_size_t offset = 0;
+ for( ; offset < routeCount ; ++offset )
+ {
+ aRoutingData = loadRouter.getInputRouting(offset);
+ if( aRoutingData.valid() )
+ {
+ aRoutingData.makeWritable();
+ aRoutingData.setRuntimeRID(aRoutingRID);
+
+ newRouter.setInputRouting(offset, aRoutingData);
+ }
+
+ // NO ELSE because of INOUT PORT
+ aRoutingData = loadRouter.getOutputRouting(offset);
+ if( aRoutingData.valid() )
+ {
+ aRoutingData.makeWritable();
+ aRoutingData.setRuntimeRID(aRoutingRID);
+
+ newRouter.setOutputRouting(offset, aRoutingData);
+ }
+ }
+
+
+ // LOCAL INPUT ROUTE
+ offset = loadRouter.getRouteID();
+ routeCount = loadRouter.getInputRoutingTable().size();
+ for( ; offset < routeCount ; ++offset )
+ {
+ aRoutingData = loadRouter.getInputRouting(offset);
+ if( aRoutingData.valid() )
+ {
+ aRoutingData.makeWritable();
+ aRoutingData.setRuntimeRID(aRoutingRID);
+
+ newRouter.appendInputRouting( aRoutingData );
+ }
+ }
+
+ // LOCAL OUPUT ROUTE
+ offset = loadRouter.getRouteID();
+ routeCount = loadRouter.getOutputRoutingTable().size();
+ for( ; offset < routeCount ; ++offset )
+ {
+ aRoutingData = loadRouter.getOutputRouting(offset);
+ if( aRoutingData.valid() )
+ {
+ aRoutingData.makeWritable();
+ aRoutingData.setRuntimeRID(aRoutingRID);
+
+ newRouter.appendOutputRouting( aRoutingData );
+ }
+ }
+
+ return( newRouter );
+}
+
+
+/**
+ * loadRouter
+ */
+bool Loader::loadRouter(APExecutionData & anED,
+ const RuntimeID & aRID, const RuntimeID & loadMachineRID)
+{
+ ExecutableForm * loadExecutable = loadMachineRID.getExecutable();
+
+ // Load ROUTER
+ if( loadExecutable->hasPort() || loadExecutable->hasRouter4This() )
+ {
+ RuntimeForm & loadRF = anED->getRuntime( loadMachineRID );
+
+ Router parentLoadRouter;
+ RuntimeID aRoutingRID;
+ TableOfRouter * containerRouterTable = NULL;
+
+ if( loadMachineRID.hasPRID() )
+ {
+ containerRouterTable = &( loadMachineRID.getPRID().
+ getExecutable()->getRouters4Instance() );
+
+ parentLoadRouter = anED->getRuntime(
+ loadMachineRID.getPRID() ).getRouter();
+ }
+
+ if( loadExecutable->hasRouter4Instance() )
+ {
+ const Router & theRouter4This = loadExecutable->getRouter4This();
+
+ if( (containerRouterTable != NULL)
+ && containerRouterTable->populated() )
+ {
+ const Router & theRouter4Parent = containerRouterTable->get(
+ loadMachineRID.getInstance()->getOffset());
+
+ avm_size_t routeCount = theRouter4This.getRouteID();
+
+ Router newRouter(
+ loadMachineRID.getInstance(), routeCount, routeCount);
+ loadRF.setRouter( newRouter );
+
+ RoutingData aRoutingData;
+
+ // GLOBAL INPUT or OUTPUT ROUTE
+ for( avm_size_t offset = 0 ; offset < routeCount ; ++offset )
+ {
+ aRoutingData = theRouter4This.getInputRouting(offset);
+ if( aRoutingData.invalid() )
+ {
+ aRoutingData = theRouter4Parent.getInputRouting(offset);
+ }
+ if( aRoutingData.invalid() )
+ {
+ aRoutingData = parentLoadRouter.getInputRouting(offset);
+ }
+ if( aRoutingData.valid() )
+ {
+ aRoutingData.makeWritable();
+ aRoutingData.setRuntimeRID(loadMachineRID);
+
+ newRouter.setInputRouting(offset, aRoutingData);
+ }
+
+ // NO ELSE because of INOUT PORT
+ aRoutingData = theRouter4This.getOutputRouting(offset);
+ if( aRoutingData.invalid() )
+ {
+ aRoutingData = theRouter4Parent.getOutputRouting(offset);
+ }
+ if( aRoutingData.invalid() )
+ {
+ aRoutingData = parentLoadRouter.getOutputRouting(offset);
+ }
+ if( aRoutingData.valid() )
+ {
+ aRoutingData.makeWritable();
+ aRoutingData.setRuntimeRID(loadMachineRID);
+
+ newRouter.setOutputRouting(offset, aRoutingData);
+ }
+ }
+
+ // LOCAL INPUT or OUTPUT ROUTE
+ TableOfSymbol::const_iterator itPort =
+ loadExecutable->getPort().begin();
+ TableOfSymbol::const_iterator endPort =
+ loadExecutable->getPort().end();
+ for( ; itPort != endPort ; ++itPort )
+ {
+ if( (*itPort).port().isPort() )
+ {
+ if( (*itPort).getModifier().hasDirectionInput() )
+ {
+ if( (*itPort).getModifier().isVisibilityPublic() )
+ {
+ aRoutingData = theRouter4Parent.getInputRouting(
+ (*itPort).getRouteOffset());
+
+ aRoutingRID = loadMachineRID.getPRID();
+ }
+ else
+ {
+ aRoutingData = theRouter4This.getInputRouting(
+ (*itPort).getRouteOffset());
+
+ aRoutingRID = loadMachineRID;
+ }
+
+ aRoutingData.makeWritable();
+ aRoutingData.setRuntimeRID(aRoutingRID);
+
+ newRouter.appendInputRouting( aRoutingData );
+ }
+ // NO ELSE because of INOUT PORT
+ if( (*itPort).getModifier().hasDirectionOutput() )
+ {
+ if( (*itPort).getModifier().isVisibilityPublic() )
+ {
+ aRoutingData = theRouter4Parent.getOutputRouting(
+ (*itPort).getRouteOffset());
+ aRoutingRID = loadMachineRID.getPRID();
+ }
+ else
+ {
+ aRoutingData = theRouter4This.getOutputRouting(
+ (*itPort).getRouteOffset());
+ aRoutingRID =loadMachineRID;
+ }
+
+ aRoutingData.makeWritable();
+ aRoutingData.setRuntimeRID(aRoutingRID);
+
+ newRouter.appendOutputRouting( aRoutingData );
+ }
+ }
+ }
+ }
+ else
+ {
+// loadRF.setRouter( theRouter4This );
+
+ loadRF.setRouter( cloneUpdateRouter(
+ theRouter4This, loadMachineRID, loadMachineRID) );
+ }
+ }
+ else if( (containerRouterTable != NULL)
+ && containerRouterTable->nonempty() )
+ {
+// loadRF.setRouter( containerRouterTable->getRouter(machineOffset) );
+
+ loadRF.setRouter( cloneUpdateRouter(
+ containerRouterTable->get(
+ loadMachineRID.getInstance()->getOffset()),
+ loadMachineRID.getPRID(), loadMachineRID) );
+ }
+
+ else
+ {
+ aRoutingRID = loadMachineRID;
+ const Router & aRouter = getRouter4Model(anED, aRoutingRID);
+ if( aRouter.valid() )
+ {
+// loadRF.setRouter( aRouter );
+
+ loadRF.setRouter( cloneUpdateRouter(
+ aRouter, aRoutingRID, loadMachineRID) );
+ }
+ else
+ {
+ AVM_OS_EXIT( FAILED )
+ << "No Router Table found !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+//@debug:
+// AVM_OS_TRACE << "loadRouter: " << loadRF.getFullyQualifiedNameID() << std::endl;
+// loadRF.getRouter().toStream(AVM_OS_TRACE);
+ }
+
+ return( true );
+}
+
+
+/**
+ * dynamicLoadRouter
+ */
+bool Loader::dynamicLoadRouter(APExecutionData & anED,
+ const RuntimeID & loadMachineRID)
+{
+ ExecutableForm * loadExecutable = loadMachineRID.getExecutable();
+
+ // Load ROUTER
+ if( loadExecutable->hasPort() || loadExecutable->hasRouter4This() )
+ {
+ RuntimeForm & loadRF = anED->getRuntime( loadMachineRID );
+
+ const TableOfRouter & containerRouterTable = loadMachineRID.
+ getPRID().getExecutable()->getRouters4Model();
+
+ Router parentLoadRouter = anED->getRuntime(
+ loadMachineRID.getPRID() ).getRouter();
+
+ if( loadExecutable->hasRouter4Instance() )
+ {
+ const Router & theRouter4This = loadExecutable->getRouter4This();
+
+ if( containerRouterTable.nonempty() )
+ {
+ const Router & theRouter4Parent = containerRouterTable.get(
+ loadMachineRID.getInstance()->getInstanceModel()->getOffset());
+
+ avm_size_t aRouteID = theRouter4This.getRouteID();
+
+ Router newRouter(
+ loadMachineRID.getInstance(), aRouteID, aRouteID);
+ loadRF.setRouter( newRouter );
+
+ RoutingData aRoutingData;
+
+ // GLOBAL INPUT or OUTPUT ROUTE
+ for( avm_size_t offset = 0 ; offset < aRouteID ; ++offset )
+ {
+ aRoutingData = theRouter4This.getInputRouting(offset);
+ if( aRoutingData.invalid() )
+ {
+ aRoutingData = theRouter4Parent.getInputRouting(offset);
+ }
+ if( aRoutingData.invalid() )
+ {
+ aRoutingData = parentLoadRouter.getInputRouting(offset);
+ }
+ if( aRoutingData.valid() )
+ {
+ aRoutingData.makeWritable();
+ aRoutingData.setRuntimeRID(loadMachineRID);
+
+ newRouter.setInputRouting(offset, aRoutingData);
+ }
+
+ // NO ELSE because of INOUT PORT
+ aRoutingData = theRouter4This.getOutputRouting(offset);
+ if( aRoutingData.invalid() )
+ {
+ aRoutingData = theRouter4Parent.getOutputRouting(offset);
+ }
+ if( aRoutingData.invalid() )
+ {
+ aRoutingData = parentLoadRouter.getOutputRouting(offset);
+ }
+ if( aRoutingData.valid() )
+ {
+ aRoutingData.makeWritable();
+ aRoutingData.setRuntimeRID(loadMachineRID);
+
+ newRouter.setOutputRouting(offset, aRoutingData);
+ }
+ }
+
+ // LOCAL INPUT or OUTPUT ROUTE
+ TableOfSymbol::const_iterator itPort =
+ loadExecutable->getPort().begin();
+ TableOfSymbol::const_iterator endPort =
+ loadExecutable->getPort().end();
+ for( ; itPort != endPort ; ++itPort )
+ {
+ if( (*itPort).getModifier().hasDirectionInput() )
+ {
+ if( (*itPort).getModifier().isVisibilityPublic() )
+ {
+ newRouter.appendInputRouting( theRouter4Parent
+ .getInputRouting((*itPort).getRouteOffset()) );
+ }
+ else
+ {
+ newRouter.appendInputRouting( theRouter4This
+ .getInputRouting((*itPort).getRouteOffset()) );
+ }
+ }
+ // NO ELSE because of INOUT PORT
+ if( (*itPort).getModifier().hasDirectionOutput() )
+ {
+ if( (*itPort).getModifier().isVisibilityPublic() )
+ {
+ newRouter.appendOutputRouting( theRouter4Parent
+ .getOutputRouting((*itPort).getRouteOffset()) );
+ }
+ else
+ {
+ newRouter.appendOutputRouting( theRouter4This
+ .getOutputRouting((*itPort).getRouteOffset()) );
+ }
+ }
+ }
+ }
+ else
+ {
+ loadRF.setRouter( theRouter4This );
+ }
+ }
+ else if( containerRouterTable.nonempty() )
+ {
+ loadRF.setRouter( containerRouterTable.get(
+ loadMachineRID.getInstance()->getInstanceModel()->getOffset()) );
+ }
+
+ else
+ {
+ RuntimeID aRoutingRID = loadMachineRID;
+ const Router & aRouter = getRouter4Model(anED, aRoutingRID);
+ if( aRouter.valid() )
+ {
+ loadRF.setRouter( aRouter );
+ }
+ else
+ {
+ AVM_OS_EXIT( FAILED )
+ << "No Router Table found !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+
+ return( true );
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/builder/Loader.h b/org.eclipse.efm.symbex/src/builder/Loader.h
new file mode 100644
index 0000000..56ae09c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/Loader.h
@@ -0,0 +1,180 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef LOADER_H_
+#define LOADER_H_
+
+#include <common/BF.h>
+
+#include <collection/List.h>
+
+#include <computer/EvaluationEnvironment.h>
+
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+class AvmPrimitiveProcessor;
+
+class BaseEnvironment;
+class Builder;
+
+class Configuration;
+
+class ExecutableForm;
+
+class InstanceOfData;
+class InstanceOfMachine;
+
+class RuntimeForm;
+
+class Loader
+{
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef List< RuntimeID >::const_iterator const_rid_iterator;
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ Configuration & mConfiguration;
+
+ Builder & mBuilder;
+
+ EvaluationEnvironment ENV;
+
+ List< RuntimeID > mOnCreateRoutime;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Loader(Configuration & aConfiguration, Builder & aBuilder,
+ AvmPrimitiveProcessor & aPrimitiveProcessor);
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Loader()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONFIGURE
+ */
+ bool configure();
+
+ /**
+ * mOnCreateRoutime
+ */
+ inline bool hasOnCreateRoutime() const
+ {
+ return( mOnCreateRoutime.nonempty() );
+ }
+
+ inline void resetOnCreateRoutime()
+ {
+ mOnCreateRoutime.clear();
+ }
+
+ /**
+ * [ CONST ] ITERATOR
+ */
+ inline const_rid_iterator on_create_begin() const
+ {
+ return( mOnCreateRoutime.begin() );
+ }
+
+ inline const_rid_iterator on_create_end() const
+ {
+ return( mOnCreateRoutime.end() );
+ }
+
+
+ /**
+ * RUNNING onCREATE
+ * mOnCreateRoutime
+ */
+ bool finalizeRunningOnCreate(
+ const BaseEnvironment & ENV, APExecutionData & anED);
+
+ /**
+ * UTILS
+ */
+ BFCode loadSchedulerCode(
+ APExecutionData & anED, const RuntimeForm & aRF,
+ const BFCode & aSchedulerCode, bool isStaticLoading);
+
+ void loadSchedulerCode(APExecutionData & anED,
+ const RuntimeForm & aRF, const BFCode & aSchedulerCode,
+ BFCode & loadCode, bool isStaticLoading);
+
+
+ RuntimeForm * loadSystemInstance(APExecutionData & anED,
+ const RuntimeID & aParentRID, InstanceOfMachine * aMachine,
+ int & thePid, avm_offset_t & theOffset);
+
+ RuntimeForm * loadMachineInstance(APExecutionData & anED,
+ const RuntimeID & aParentRID, InstanceOfMachine * aMachine,
+ int & thePid, avm_offset_t & theOffset);
+
+
+ void loadMachine(APExecutionData & anED, const RuntimeID & aRID,
+ const RuntimeID & loadMachineRID, int & thePid,
+ avm_offset_t & theOffset);
+
+ RuntimeForm * dynamicLoadMachine(APExecutionData & anED,
+ const RuntimeID & aRID, RuntimeForm * aModelRF,
+ const RuntimeID & aParentRID, Operator * aScheduleOp);
+
+ RuntimeForm * dynamicLoadMachine(APExecutionData & anED,
+ const RuntimeID & aRID, InstanceOfMachine * anInstanceDynamic,
+ const RuntimeID & aParentRID, Operator * aScheduleOp);
+
+
+// void loadInitialMonitorData(
+// APExecutionData & anED, const RuntimeID & aRID,
+// InstanceOfMachine * anInstanceMachine, bool isRecursive);
+
+
+ bool loadData(APExecutionData & anED, const RuntimeID & aRID,
+ const RuntimeID & aDataRID);
+
+ bool loadBuffer(APExecutionData & anED, const RuntimeID & aRID,
+ const RuntimeID & loadMachineRID);
+
+
+ const Router & getRouter4Model(
+ APExecutionData & anED, RuntimeID & aRoutingRID);
+
+ bool loadRouter(APExecutionData & anED, const RuntimeID & aRID,
+ const RuntimeID & loadMachineRID);
+
+ bool dynamicLoadRouter(APExecutionData & anED,
+ const RuntimeID & loadMachineRID);
+
+};
+
+
+}
+
+#endif /*LOADER_H_*/
diff --git a/org.eclipse.efm.symbex/src/builder/README.md b/org.eclipse.efm.symbex/src/builder/README.md
new file mode 100644
index 0000000..d8f0054
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/README.md
@@ -0,0 +1,10 @@
+# EFM-SYMBEX : Builder
+
+## Source code structure
+
+### Interfaces
+
+### Classes
+
+### Factories
+
diff --git a/org.eclipse.efm.symbex/src/builder/analysis/CommunicationDependency.cpp b/org.eclipse.efm.symbex/src/builder/analysis/CommunicationDependency.cpp
new file mode 100644
index 0000000..d21de9b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/analysis/CommunicationDependency.cpp
@@ -0,0 +1,839 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 24 févr. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "CommunicationDependency.h"
+
+#include <fml/expression/StatementFactory.h>
+
+#include <fml/runtime/ExecutionData.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+//// the communication information
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+BF CommunicationDependency::getCommunicationCode(
+ AvmProgram * anAvmProgram, const BFCode & aCode,
+ bool (*isCom)(AvmCode * comCode), bool & hasMutableSchedule )
+{
+ if( aCode.invalid() )
+ {
+ //!! NOTHING
+ return( BF::REF_NULL );
+ }
+ else if( isCom(aCode) )
+ {
+ return( aCode );
+ }
+ else
+ {
+ ExecutableForm * activityExec = NULL;
+
+ switch( anAvmProgram->isScopeTransition() ? //is< AvmTransition >()
+ AVM_OPCODE_NULL : aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_SCHEDULE_INVOKE:
+ {
+ if( (activityExec = StatementFactory::
+ getActivityTargetExecutable(anAvmProgram, aCode))
+ != NULL )
+ {
+ if( activityExec->isMutableSchedule() )
+ {
+ hasMutableSchedule = true;
+ }
+ else
+ {
+ getCommunicationCode(activityExec,
+ activityExec->getOnSchedule(), isCom,
+ hasMutableSchedule );
+ }
+ }
+
+ return( BF::REF_NULL );
+ }
+
+ case AVM_OPCODE_INVOKE_TRANSITION:
+ {
+ // Pour éviter les récursions infinis !!!
+ if( isCom == (& CommunicationDependency::isCommunicationCode) )
+ {
+ return( aCode->first().to_ptr< AvmProgram >()
+ ->getCommunicationCode() );
+ }
+ else if( isCom ==
+ (& CommunicationDependency::isInternalCommunicationCode) )
+ {
+ return( aCode->first().to_ptr< AvmProgram >()
+ ->getCommunicationCode() );
+ }
+ else if( isCom == (& CommunicationDependency::isEnvironmentCom) )
+ {
+ return( aCode->first().to_ptr< AvmProgram >()
+ ->getEnvironmentCom() );
+ }
+ else if( isCom ==
+ (& CommunicationDependency::isEnvironmentInputCom) )
+ {
+ return( aCode->first().to_ptr< AvmProgram >()
+ ->getEnvironmentInputCom() );
+ }
+ else if( isCom ==
+ (& CommunicationDependency::isEnvironmentOutputCom) )
+ {
+ return( aCode->first().to_ptr< AvmProgram >()
+ ->getEnvironmentOutputCom() );
+ }
+
+ else
+ {
+ return( getCommunicationCode(
+ aCode->first().to_ptr< AvmProgram >(),
+ aCode->first().to_ptr< AvmProgram >()->getCode(),
+ isCom, hasMutableSchedule) );
+ }
+
+ return( BF::REF_NULL );
+ }
+
+ case AVM_OPCODE_IRUN:
+ {
+ if( (activityExec = StatementFactory::
+ getActivityTargetExecutable(anAvmProgram, aCode))
+ != NULL )
+ {
+ return( getCommunicationCode(activityExec,
+ activityExec->getOnIRun(), isCom,
+ hasMutableSchedule) );
+ }
+
+ return( BF::REF_NULL );
+ }
+ case AVM_OPCODE_RUN:
+ {
+ if( (activityExec = StatementFactory::
+ getActivityTargetExecutable(anAvmProgram, aCode))
+ != NULL )
+ {
+ return( getCommunicationCode(activityExec,
+ activityExec->getOnRun(), isCom,
+ hasMutableSchedule) );
+ }
+
+ return( BF::REF_NULL );
+ }
+ case AVM_OPCODE_RTC:
+ {
+ if( (activityExec = StatementFactory::
+ getActivityTargetExecutable(anAvmProgram, aCode))
+ != NULL )
+ {
+ return( getCommunicationCode(activityExec,
+ activityExec->getOnRtc(), isCom,
+ hasMutableSchedule) );
+ }
+
+ return( BF::REF_NULL );
+ }
+
+ case AVM_OPCODE_IENABLE_INVOKE:
+ {
+ if( (activityExec = StatementFactory::
+ getActivityTargetExecutable(anAvmProgram, aCode))
+ != NULL )
+ {
+ return( getCommunicationCode(activityExec,
+ activityExec->getOnIEnable(), isCom,
+ hasMutableSchedule) );
+ }
+
+ return( BF::REF_NULL );
+ }
+ case AVM_OPCODE_ENABLE_INVOKE:
+ {
+ if( (activityExec = StatementFactory::
+ getActivityTargetExecutable(anAvmProgram, aCode))
+ != NULL )
+ {
+ return( getCommunicationCode(activityExec,
+ activityExec->getOnEnable(), isCom,
+ hasMutableSchedule) );
+ }
+
+ return( BF::REF_NULL );
+ }
+
+ case AVM_OPCODE_IDISABLE_INVOKE:
+ {
+ if( (activityExec = StatementFactory::
+ getActivityTargetExecutable(anAvmProgram, aCode))
+ != NULL )
+ {
+ return( getCommunicationCode(activityExec,
+ activityExec->getOnIDisable(), isCom,
+ hasMutableSchedule) );
+ }
+
+ return( BF::REF_NULL );
+ }
+ case AVM_OPCODE_DISABLE_INVOKE:
+ {
+ if( (activityExec = StatementFactory::
+ getActivityTargetExecutable(anAvmProgram, aCode))
+ != NULL )
+ {
+ return( getCommunicationCode(activityExec,
+ activityExec->getOnDisable(), isCom,
+ hasMutableSchedule) );
+ }
+
+ return( BF::REF_NULL );
+ }
+
+ case AVM_OPCODE_IABORT_INVOKE:
+ {
+ if( (activityExec = StatementFactory::
+ getActivityTargetExecutable(anAvmProgram, aCode))
+ != NULL )
+ {
+ return( getCommunicationCode(activityExec,
+ activityExec->getOnIAbort(), isCom,
+ hasMutableSchedule) );
+ }
+
+ return( BF::REF_NULL );
+ }
+ case AVM_OPCODE_ABORT_INVOKE:
+ {
+ if( (activityExec = StatementFactory::
+ getActivityTargetExecutable(anAvmProgram, aCode))
+ != NULL )
+ {
+ return( getCommunicationCode(activityExec,
+ activityExec->getOnAbort(), isCom,
+ hasMutableSchedule) );
+ }
+
+ return( BF::REF_NULL );
+ }
+
+
+ default:
+ {
+ if( OperatorManager::isSchedule(aCode->getOperator()) )
+ {
+ AvmCode::this_container_type listOfComArg;
+ BF comArg;
+
+ AvmCode::iterator itArg = aCode->begin();
+ AvmCode::iterator itEndArg = aCode->end();
+ for( ; itArg != itEndArg ; ++itArg )
+ {
+ if( (*itArg).is< AvmCode >() )
+ {
+ comArg = getCommunicationCode(anAvmProgram,
+ (*itArg).bfCode(), isCom, hasMutableSchedule);
+
+ if( comArg.valid() )
+ {
+ listOfComArg.append(comArg);
+ }
+ }
+ }
+
+ if( listOfComArg.populated() )
+ {
+ return( ExpressionConstructor::newCode(
+ aCode->getOperator(), listOfComArg) );
+ }
+ else if( listOfComArg.nonempty() )
+ {
+ return( listOfComArg.pop_first() );
+ }
+ }
+
+ return( BF::REF_NULL );
+ }
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+/**
+ * Collect information about
+ * static input enabled communication
+ */
+void CommunicationDependency::computeInputEnabledCom(AvmProgram * anAvmProgram,
+ ListOfInstanceOfPort & inputEnabledCom, AvmCode * aCode,
+ bool (*isCom)(AvmCode * comCode), bool & hasMutableSchedule )
+{
+ if( aCode == NULL )
+ {
+ //!! NOTHING
+ return;
+ }
+ else if( isCom(aCode) )
+ {
+ if( aCode->first().is< InstanceOfPort >() )
+ {
+ inputEnabledCom.add_union( aCode->first().to_ptr< InstanceOfPort >() );
+ }
+ }
+ else
+ {
+ ExecutableForm * activityExec = NULL;
+
+ switch( ( anAvmProgram->isScopeTransition() && //is< AvmTransition >()
+ (not OperatorManager::isSchedule(aCode->getOperator())) ) ?
+ AVM_OPCODE_NULL : aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_SCHEDULE_INVOKE:
+ {
+ if( (activityExec = StatementFactory::
+ getActivityTargetExecutable(anAvmProgram, aCode))
+ != NULL )
+ {
+ if( activityExec->isMutableSchedule() )
+ {
+ hasMutableSchedule = true;
+ }
+ else
+ {
+ computeInputEnabledCom(activityExec, inputEnabledCom,
+ activityExec->getOnSchedule(), isCom,
+ hasMutableSchedule );
+ }
+ }
+
+ break;
+ }
+
+ case AVM_OPCODE_INVOKE_TRANSITION:
+ {
+ // Pour éviter les récursions infinis !!!
+ if( isCom == (& CommunicationDependency::isInputEnabledCom) )
+ {
+ inputEnabledCom.add_union( aCode->first().
+ to_ptr< AvmProgram >()->getInputEnabledCom() );
+ }
+ else if( isCom == (& CommunicationDependency::isInputEnabledSave) )
+ {
+ inputEnabledCom.add_union( aCode->first().
+ to_ptr< AvmProgram >()->getInputEnabledSave() );
+ }
+
+ else if( isCom == (& CommunicationDependency::isInputCom) )
+ {
+ inputEnabledCom.add_union( aCode->first().
+ to_ptr< AvmProgram >()->getInputCom() );
+ }
+ else if( isCom == (& CommunicationDependency::isOutputCom) )
+ {
+ inputEnabledCom.add_union( aCode->first().
+ to_ptr< AvmProgram >()->getOutputCom() );
+ }
+
+ else
+ {
+ computeInputEnabledCom(
+ aCode->first().to_ptr< AvmProgram >(),
+ inputEnabledCom,
+ aCode->first().to_ptr< AvmProgram >()->getCode(),
+ isCom, hasMutableSchedule );
+ }
+
+ break;
+ }
+
+ case AVM_OPCODE_IRUN:
+ {
+ if( (activityExec = StatementFactory::
+ getActivityTargetExecutable(anAvmProgram, aCode))
+ != NULL )
+ {
+ computeInputEnabledCom(activityExec, inputEnabledCom,
+ activityExec->getOnIRun(), isCom,
+ hasMutableSchedule );
+ }
+
+ break;
+ }
+ case AVM_OPCODE_RUN:
+ {
+ if( (activityExec = StatementFactory::
+ getActivityTargetExecutable(anAvmProgram, aCode))
+ != NULL )
+ {
+ computeInputEnabledCom(activityExec, inputEnabledCom,
+ activityExec->getOnRun(), isCom,
+ hasMutableSchedule );
+ }
+
+ break;
+ }
+ case AVM_OPCODE_RTC:
+ {
+ if( (activityExec = StatementFactory::
+ getActivityTargetExecutable(anAvmProgram, aCode)) != NULL )
+ {
+ computeInputEnabledCom(activityExec, inputEnabledCom,
+ activityExec->getOnRtc(), isCom,
+ hasMutableSchedule );
+ }
+
+ break;
+ }
+
+ case AVM_OPCODE_IENABLE_INVOKE:
+ {
+ if( (activityExec = StatementFactory::
+ getActivityTargetExecutable(anAvmProgram, aCode))
+ != NULL )
+ {
+ computeInputEnabledCom(activityExec, inputEnabledCom,
+ activityExec->getOnIEnable(), isCom,
+ hasMutableSchedule );
+ }
+
+ break;
+ }
+ case AVM_OPCODE_ENABLE_INVOKE:
+ {
+ if( (activityExec = StatementFactory::
+ getActivityTargetExecutable(anAvmProgram, aCode))
+ != NULL )
+ {
+ computeInputEnabledCom(activityExec, inputEnabledCom,
+ activityExec->getOnEnable(), isCom,
+ hasMutableSchedule );
+ }
+
+ break;
+ }
+
+ case AVM_OPCODE_IDISABLE_INVOKE:
+ {
+ if( (activityExec = StatementFactory::
+ getActivityTargetExecutable(anAvmProgram, aCode))
+ != NULL )
+ {
+ computeInputEnabledCom(activityExec, inputEnabledCom,
+ activityExec->getOnIDisable(), isCom,
+ hasMutableSchedule );
+ }
+
+ break;
+ }
+ case AVM_OPCODE_DISABLE_INVOKE:
+ {
+ if( (activityExec = StatementFactory::
+ getActivityTargetExecutable(anAvmProgram, aCode))
+ != NULL )
+ {
+ computeInputEnabledCom(activityExec, inputEnabledCom,
+ activityExec->getOnDisable(), isCom,
+ hasMutableSchedule );
+ }
+
+ break;
+ }
+
+ case AVM_OPCODE_IABORT_INVOKE:
+ {
+ if( (activityExec = StatementFactory::
+ getActivityTargetExecutable(anAvmProgram, aCode))
+ != NULL )
+ {
+ computeInputEnabledCom(activityExec, inputEnabledCom,
+ activityExec->getOnIAbort(), isCom,
+ hasMutableSchedule );
+ }
+
+ break;
+ }
+ case AVM_OPCODE_ABORT_INVOKE:
+ {
+ if( (activityExec = StatementFactory::
+ getActivityTargetExecutable(anAvmProgram, aCode))
+ != NULL )
+ {
+ computeInputEnabledCom(activityExec, inputEnabledCom,
+ activityExec->getOnAbort(), isCom,
+ hasMutableSchedule );
+ }
+
+ break;
+ }
+
+
+ // Justification of these switch statement
+// switch( ( anAvmProgram->isScopeTransition() &&
+// (not OperatorManager::isSchedule(aCode->getOperator())) ) ?
+// AVM_OPCODE_NULL : aCode->getAvmOpCode() )
+
+ case AVM_OPCODE_SEQUENCE:
+ case AVM_OPCODE_ATOMIC_SEQUENCE:
+ case AVM_OPCODE_SEQUENCE_SIDE:
+ case AVM_OPCODE_PRIOR_GT:
+ {
+ ListOfInstanceOfPort localPorts;
+
+ AvmCode::const_iterator itArg = aCode->begin();
+ AvmCode::const_iterator itEndArg = aCode->end();
+ for( ; itArg != itEndArg ; ++itArg )
+ {
+ if( (*itArg).is< AvmCode >() )
+ {
+ computeInputEnabledCom( anAvmProgram, localPorts,
+ (*itArg).to_ptr< AvmCode >(), isCom,
+ hasMutableSchedule );
+
+ if( localPorts.nonempty() )
+ {
+ inputEnabledCom.add_union(localPorts);
+
+ break;
+ }
+ }
+ }
+ break;
+ }
+
+ case AVM_OPCODE_PRIOR_LT:
+ {
+ ListOfInstanceOfPort localPorts;
+
+ AvmCode::const_reverse_iterator itArg = aCode->rbegin();
+ AvmCode::const_reverse_iterator itEndArg = aCode->rend();
+ for( ; itArg != itEndArg ; ++itArg )
+ {
+ if( (*itArg).is< AvmCode >() )
+ {
+ computeInputEnabledCom( anAvmProgram, localPorts,
+ (*itArg).to_ptr< AvmCode >(), isCom,
+ hasMutableSchedule );
+
+ if( localPorts.nonempty() )
+ {
+ inputEnabledCom.add_union(localPorts);
+
+ break;
+ }
+ }
+ }
+ break;
+ }
+
+ default:
+ {
+ if( OperatorManager::isSchedule(aCode->getOperator()) )
+ {
+ AvmCode::const_iterator itArg = aCode->begin();
+ AvmCode::const_iterator itEndArg = aCode->end();
+ for( ; itArg != itEndArg ; ++itArg )
+ {
+ if( (*itArg).is< AvmCode >() )
+ {
+ computeInputEnabledCom(
+ anAvmProgram, inputEnabledCom,
+ (*itArg).to_ptr< AvmCode >(), isCom,
+ hasMutableSchedule );
+ }
+ }
+ }
+
+ break;
+ }
+ }
+ }
+}
+
+
+/**
+ * Collect information about
+ * runtime input enabled communication
+ */
+void CommunicationDependency::computeInputEnabledCom(
+ const ExecutionData & anED, const RuntimeID & aRID,
+ ListOfInstanceOfPort & inputEnabledCom,
+ AvmCode * aCode, bool (*isCom)(AvmCode * comCode) )
+{
+ if( aCode == NULL )
+ {
+ //!! NOTHING
+ return;
+ }
+ else if( isCom(aCode) )
+ {
+ if( aCode->first().is< InstanceOfPort >() )
+ {
+ inputEnabledCom.add_union(
+ aCode->first().to_ptr< InstanceOfPort >() );
+ }
+ }
+ else
+ {
+ RuntimeID activityRID;
+
+ switch( aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_SCHEDULE_INVOKE:
+ {
+ if( (activityRID = StatementFactory::
+ getActivityTargetRID(anED, aRID, aCode)).valid() )
+ {
+ if( activityRID.getExecutable()->isMutableSchedule() )
+ {
+ computeInputEnabledCom(anED, activityRID, inputEnabledCom,
+ anED.getRuntimeFormOnSchedule(activityRID), isCom);
+ }
+ else
+ {
+ computeInputEnabledCom(anED, activityRID, inputEnabledCom,
+ activityRID.getExecutable()->getOnSchedule(),
+ isCom );
+ }
+ }
+
+ break;
+ }
+
+ case AVM_OPCODE_INVOKE_TRANSITION:
+ {
+ // Pour éviter les récursions infinis !!!
+ if( isCom == (& CommunicationDependency::isInputEnabledCom) )
+ {
+ inputEnabledCom.add_union( aCode->first().
+ to_ptr< AvmProgram >()->getInputEnabledCom() );
+ }
+ else if( isCom == (& CommunicationDependency::isInputEnabledSave) )
+ {
+ inputEnabledCom.add_union( aCode->first().
+ to_ptr< AvmProgram >()->getInputEnabledSave() );
+ }
+
+ else if( isCom == (& CommunicationDependency::isInputCom) )
+ {
+ inputEnabledCom.add_union( aCode->first().
+ to_ptr< AvmProgram >()->getInputCom() );
+ }
+ else if( isCom == (& CommunicationDependency::isOutputCom) )
+ {
+ inputEnabledCom.add_union( aCode->first().
+ to_ptr< AvmProgram >()->getOutputCom() );
+ }
+
+ else
+ {
+ computeInputEnabledCom(anED, activityRID, inputEnabledCom,
+ aCode->first().to_ptr< AvmProgram >()->getCode(), isCom);
+ }
+
+ break;
+ }
+
+ case AVM_OPCODE_IRUN:
+ {
+ if( (activityRID = StatementFactory::
+ getActivityTargetRID(anED, aRID, aCode)).valid() )
+ {
+ computeInputEnabledCom(anED, activityRID, inputEnabledCom,
+ activityRID.getExecutable()->getOnIRun(), isCom );
+ }
+
+ break;
+ }
+ case AVM_OPCODE_RUN:
+ {
+ if( (activityRID = StatementFactory::
+ getActivityTargetRID(anED, aRID, aCode)).valid() )
+ {
+ computeInputEnabledCom(anED, activityRID, inputEnabledCom,
+ activityRID.getExecutable()->getOnRun(), isCom );
+ }
+
+ break;
+ }
+ case AVM_OPCODE_RTC:
+ {
+ if( (activityRID = StatementFactory::
+ getActivityTargetRID(anED, aRID, aCode)) != NULL )
+ {
+ computeInputEnabledCom(anED, activityRID, inputEnabledCom,
+ activityRID.getExecutable()->getOnRtc(), isCom );
+ }
+
+ break;
+ }
+
+ case AVM_OPCODE_IENABLE_INVOKE:
+ {
+ if( (activityRID = StatementFactory::
+ getActivityTargetRID(anED, aRID, aCode)).valid() )
+ {
+ computeInputEnabledCom(anED, activityRID, inputEnabledCom,
+ activityRID.getExecutable()->getOnIEnable(),
+ isCom );
+ }
+
+ break;
+ }
+ case AVM_OPCODE_ENABLE_INVOKE:
+ {
+ if( (activityRID = StatementFactory::
+ getActivityTargetRID(anED, aRID, aCode)).valid() )
+ {
+ computeInputEnabledCom(anED, activityRID, inputEnabledCom,
+ activityRID.getExecutable()->getOnEnable(),
+ isCom );
+ }
+
+ break;
+ }
+
+ case AVM_OPCODE_IDISABLE_INVOKE:
+ {
+ if( (activityRID = StatementFactory::
+ getActivityTargetRID(anED, aRID, aCode)).valid() )
+ {
+ computeInputEnabledCom(anED, activityRID, inputEnabledCom,
+ activityRID.getExecutable()->getOnIDisable(),
+ isCom );
+ }
+
+ break;
+ }
+ case AVM_OPCODE_DISABLE_INVOKE:
+ {
+ if( (activityRID = StatementFactory::
+ getActivityTargetRID(anED, aRID, aCode)).valid() )
+ {
+ computeInputEnabledCom(anED, activityRID, inputEnabledCom,
+ activityRID.getExecutable()->getOnDisable(),
+ isCom );
+ }
+
+ break;
+ }
+
+ case AVM_OPCODE_IABORT_INVOKE:
+ {
+ if( (activityRID = StatementFactory::
+ getActivityTargetRID(anED, aRID, aCode)).valid() )
+ {
+ computeInputEnabledCom(anED, activityRID, inputEnabledCom,
+ activityRID.getExecutable()->getOnIAbort(),
+ isCom );
+ }
+
+ break;
+ }
+ case AVM_OPCODE_ABORT_INVOKE:
+ {
+ if( (activityRID = StatementFactory::
+ getActivityTargetRID(anED, aRID, aCode)).valid() )
+ {
+ computeInputEnabledCom(anED, activityRID, inputEnabledCom,
+ activityRID.getExecutable()->getOnAbort(), isCom );
+ }
+
+ break;
+ }
+
+
+ case AVM_OPCODE_SEQUENCE:
+ case AVM_OPCODE_ATOMIC_SEQUENCE:
+ case AVM_OPCODE_SEQUENCE_SIDE:
+ case AVM_OPCODE_PRIOR_GT:
+ {
+ ListOfInstanceOfPort localPorts;
+
+ AvmCode::const_iterator itArg = aCode->begin();
+ AvmCode::const_iterator itEndArg = aCode->end();
+ for( ; itArg != itEndArg ; ++itArg )
+ {
+ if( (*itArg).is< AvmCode >() )
+ {
+ computeInputEnabledCom(anED, aRID, localPorts,
+ (*itArg).to_ptr< AvmCode >(), isCom );
+
+ if( localPorts.nonempty() )
+ {
+ inputEnabledCom.add_union(localPorts);
+
+ break;
+ }
+ }
+ }
+ break;
+ }
+
+ case AVM_OPCODE_PRIOR_LT:
+ {
+ ListOfInstanceOfPort localPorts;
+
+ AvmCode::const_reverse_iterator itArg = aCode->rbegin();
+ AvmCode::const_reverse_iterator itEndArg = aCode->rend();
+ for( ; itArg != itEndArg ; ++itArg )
+ {
+ if( (*itArg).is< AvmCode >() )
+ {
+ computeInputEnabledCom(anED, aRID, localPorts,
+ (*itArg).to_ptr< AvmCode >(), isCom );
+
+ if( localPorts.nonempty() )
+ {
+ inputEnabledCom.add_union(localPorts);
+
+ break;
+ }
+ }
+ }
+ break;
+ }
+
+ default:
+ {
+ if( OperatorManager::isSchedule(aCode->getOperator()) )
+ {
+ AvmCode::const_iterator itArg = aCode->begin();
+ AvmCode::const_iterator itEndArg = aCode->end();
+ for( ; itArg != itEndArg ; ++itArg )
+ {
+ if( (*itArg).is< AvmCode >() )
+ {
+ computeInputEnabledCom(
+ anED, aRID, inputEnabledCom,
+ (*itArg).to_ptr< AvmCode >(), isCom );
+ }
+ }
+ }
+
+ break;
+ }
+ }
+ }
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/builder/analysis/CommunicationDependency.h b/org.eclipse.efm.symbex/src/builder/analysis/CommunicationDependency.h
new file mode 100644
index 0000000..0929055
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/analysis/CommunicationDependency.h
@@ -0,0 +1,275 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 24 févr. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef COMMUNICATIONDEPENDENCY_H_
+#define COMMUNICATIONDEPENDENCY_H_
+
+#include <common/BF.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/executable/AvmProgram.h>
+
+#include <fml/operator/OperatorLib.h>
+
+
+namespace sep
+{
+
+
+class ExecutionData;
+
+
+class CommunicationDependency
+{
+
+public:
+
+ /**
+ * Collect information about
+ * general communication
+ */
+ static BF getCommunicationCode(
+ AvmProgram * anAvmProgram, const BFCode & aCode,
+ bool (*isCom)(AvmCode * comCode) , bool & hasMutableSchedule );
+
+
+ static bool isCommunicationCode(AvmCode * comCode)
+ {
+ AVM_OPCODE opCode = comCode->getAvmOpCode();
+
+ return( (opCode == AVM_OPCODE_INPUT ) ||
+ (opCode == AVM_OPCODE_INPUT_FROM ) ||
+ (opCode == AVM_OPCODE_OUTPUT ) ||
+ (opCode == AVM_OPCODE_OUTPUT_TO ) );
+ }
+
+ inline static BF getCommunicationCode(AvmProgram * anAvmProgram,
+ const BFCode & aCode, bool & hasMutableSchedule)
+ {
+ return( getCommunicationCode(anAvmProgram, aCode,
+ & CommunicationDependency::isCommunicationCode,
+ hasMutableSchedule) );
+ }
+
+
+ static bool isInternalCommunicationCode(AvmCode * comCode)
+ {
+ AVM_OPCODE opCode = comCode->getAvmOpCode();
+ AVM_OPCODE optimizCode = comCode->getOptimizedOpCode();
+
+ return( ((opCode == AVM_OPCODE_INPUT ) ||
+ (opCode == AVM_OPCODE_INPUT_FROM ) ||
+ (opCode == AVM_OPCODE_OUTPUT ) ||
+ (opCode == AVM_OPCODE_OUTPUT_TO ) ) &&
+ (optimizCode != AVM_OPCODE_INPUT_ENV) &&
+ (optimizCode != AVM_OPCODE_OUTPUT_ENV) );
+ }
+
+ inline static BF getInternalCommunicationCode(AvmProgram * anAvmProgram,
+ const BFCode & aCode, bool & hasMutableSchedule)
+ {
+ return( getCommunicationCode(anAvmProgram, aCode,
+ & CommunicationDependency::isInternalCommunicationCode,
+ hasMutableSchedule) );
+ }
+
+
+ /**
+ * Collect information about
+ * communication with the environment
+ */
+ static bool isEnvironmentCom(AvmCode * comCode)
+ {
+ AVM_OPCODE optimizeCode = comCode->getOptimizedOpCode();
+
+ return( (optimizeCode == AVM_OPCODE_INPUT_ENV) ||
+ (optimizeCode == AVM_OPCODE_OUTPUT_ENV) );
+ }
+
+ inline static BF getEnvironmentCom(AvmProgram * anAvmProgram,
+ const BFCode & aCode, bool & hasMutableSchedule)
+ {
+ return( getCommunicationCode(anAvmProgram, aCode,
+ & CommunicationDependency::isEnvironmentCom,
+ hasMutableSchedule) );
+ }
+
+
+
+ static bool isEnvironmentInputCom(AvmCode * comCode)
+ {
+ return( comCode->getOptimizedOpCode() == AVM_OPCODE_INPUT_ENV );
+ }
+
+ inline static BF getEnvironmentInputCom(AvmProgram * anAvmProgram,
+ const BFCode & aCode, bool & hasMutableSchedule)
+ {
+ return( getCommunicationCode(anAvmProgram, aCode,
+ & CommunicationDependency::isEnvironmentInputCom,
+ hasMutableSchedule) );
+ }
+
+
+ static bool isEnvironmentOutputCom(AvmCode * comCode)
+ {
+ return( comCode->getOptimizedOpCode() == AVM_OPCODE_OUTPUT_ENV );
+ }
+
+ inline static BF getEnvironmentOutputCom(AvmProgram * anAvmProgram,
+ const BFCode & aCode, bool & hasMutableSchedule)
+ {
+ return( getCommunicationCode(anAvmProgram, aCode,
+ & CommunicationDependency::isEnvironmentOutputCom,
+ hasMutableSchedule) );
+ }
+
+
+
+ /**
+ * Collect information about
+ * static input enabled communication
+ */
+ static void computeInputEnabledCom(AvmProgram * anAvmProgram,
+ ListOfInstanceOfPort & inputEnabledCom, AvmCode * aCode,
+ bool (*isCom)(AvmCode * comCode) , bool & hasMutableSchedule );
+
+
+ static bool isInputEnabledCom(AvmCode * comCode)
+ {
+ return( (comCode->hasOpCode( AVM_OPCODE_INPUT, AVM_OPCODE_INPUT_FROM ))
+ && (comCode->getOptimizedOpCode() != AVM_OPCODE_INPUT_ENV) );
+ }
+
+ inline static void computeInputEnabledCom(
+ AvmProgram * anAvmProgram, AvmCode * aCode)
+ {
+ bool hasMutableSchedule = false;
+
+ computeInputEnabledCom( anAvmProgram,
+ anAvmProgram->getInputEnabledCom(), aCode,
+ & CommunicationDependency::isInputEnabledCom,
+ hasMutableSchedule );
+
+ anAvmProgram->setMutableCommunication( hasMutableSchedule );
+ }
+
+
+ static bool isInputEnabledSave(AvmCode * comCode)
+ {
+ return( comCode->isOpCode( AVM_OPCODE_INPUT_SAVE ) );
+ }
+
+ inline static void computeInputEnabledSave(
+ AvmProgram * anAvmProgram, AvmCode * aCode)
+ {
+ bool hasMutableSchedule = false;
+
+ computeInputEnabledCom( anAvmProgram,
+ anAvmProgram->getInputEnabledSave(), aCode,
+ & CommunicationDependency::isInputEnabledSave,
+ hasMutableSchedule );
+
+ anAvmProgram->setMutableCommunication( hasMutableSchedule );
+ }
+
+
+
+ /**
+ * Collect information about
+ * input / output internal communication
+ */
+ static bool isInputCom(AvmCode * comCode)
+ {
+ return( (comCode->hasOpCode( AVM_OPCODE_INPUT, AVM_OPCODE_INPUT_FROM ))
+ && (comCode->getOptimizedOpCode() != AVM_OPCODE_INPUT_ENV) );
+ }
+
+ inline static BF getInputCom(AvmProgram * anAvmProgram,
+ const BFCode & aCode, bool & hasMutableSchedule)
+ {
+ return( getCommunicationCode(anAvmProgram, aCode,
+ & CommunicationDependency::isInputCom, hasMutableSchedule) );
+ }
+
+ static void computeInputCom(AvmProgram * anAvmProgram, AvmCode * aCode)
+ {
+ bool hasMutableSchedule = false;
+
+ computeInputEnabledCom(anAvmProgram, anAvmProgram->getInputCom(), aCode,
+ & CommunicationDependency::isInputCom, hasMutableSchedule);
+
+ anAvmProgram->setMutableCommunication( hasMutableSchedule );
+ }
+
+
+ static bool isOutputCom(AvmCode * comCode)
+ {
+ return( (comCode->hasOpCode( AVM_OPCODE_OUTPUT, AVM_OPCODE_OUTPUT_TO ))
+ && (comCode->getOptimizedOpCode() != AVM_OPCODE_OUTPUT_ENV) );
+ }
+
+ inline static BF getOutputCom(AvmProgram * anAvmProgram,
+ const BFCode & aCode, bool & hasMutableSchedule)
+ {
+ return( getCommunicationCode(anAvmProgram, aCode,
+ & CommunicationDependency::isOutputCom, hasMutableSchedule) );
+ }
+
+
+ static void computeOutputCom( AvmProgram * anAvmProgram, AvmCode * aCode)
+ {
+ bool hasMutableSchedule = false;
+
+ computeInputEnabledCom(anAvmProgram, anAvmProgram->getOutputCom(), aCode,
+ & CommunicationDependency::isOutputCom, hasMutableSchedule);
+
+ anAvmProgram->setMutableCommunication( hasMutableSchedule );
+ }
+
+
+
+ /**
+ * Collect information about
+ * runtime input enabled communication
+ */
+ static void computeInputEnabledCom(const ExecutionData & anED,
+ const RuntimeID & aRID, ListOfInstanceOfPort & inputEnabledCom,
+ AvmCode * aCode, bool (*isCom)(AvmCode * comCode) );
+
+
+ inline static void computeInputEnabledCom(
+ const ExecutionData & anED, const RuntimeID & aRID,
+ ListOfInstanceOfPort & inputEnabledCom, AvmCode * aCode)
+ {
+ computeInputEnabledCom(anED, aRID, inputEnabledCom, aCode,
+ & CommunicationDependency::isInputEnabledCom );
+ }
+
+ inline static void computeInputEnabledSave(
+ const ExecutionData & anED, const RuntimeID & aRID,
+ ListOfInstanceOfPort & inputEnabledSave, AvmCode * aCode )
+ {
+ computeInputEnabledCom(anED, aRID, inputEnabledSave, aCode,
+ & CommunicationDependency::isInputEnabledSave );
+ }
+
+
+
+};
+
+} /* namespace sep */
+
+#endif /* COMMUNICATIONDEPENDENCY_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/analysis/MachineDependency.cpp b/org.eclipse.efm.symbex/src/builder/analysis/MachineDependency.cpp
new file mode 100644
index 0000000..bdfc7eb
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/analysis/MachineDependency.cpp
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 25 juil. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "MachineDependency.h"
+
+#include <common/BF.h>
+
+#include <fml/executable/AvmLambda.h>
+#include <fml/executable/AvmProgram.h>
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/ExecutableSystem.h>
+
+#include <fml/expression/AvmCode.h>
+
+namespace sep
+{
+
+
+bool MachineDependency::computeVariableDependency(ExecutableSystem * anExecSystem)
+{
+ const TableOfExecutableForm & executables = anExecSystem->getExecutables();
+
+ TableOfExecutableForm::const_raw_iterator itExec = executables.begin();
+ TableOfExecutableForm::const_raw_iterator endExec = executables.end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ if( not computeVariableDependency( itExec ) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+}
+
+
+
+bool MachineDependency::computeVariableDependency(ExecutableForm * anExecutable)
+{
+ avm_size_t endOffset = anExecutable->getTransition().size();
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ if( not computeVariableDependency( anExecutable->rawTransition(offset) ) )
+ {
+ return( false );
+ }
+ }
+
+ endOffset = anExecutable->getProgram().size();
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ if( not computeVariableDependency( anExecutable->rawProgram(offset) ) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+}
+
+
+bool MachineDependency::isVariableDependency(
+ ExecutableForm * anExecutable, AvmCode * aCode)
+{
+ return( false );
+}
+
+bool MachineDependency::isVariableDependency(
+ ExecutableForm * anExecutable, const BF & aVar)
+{
+ return( false );
+}
+
+
+
+bool MachineDependency::computeVariableDependency(AvmProgram * aProgram)
+{
+ return( false );
+}
+
+bool MachineDependency::isVariableDependency(
+ AvmProgram * aProgram, AvmCode * aCode)
+{
+ return( false );
+}
+
+bool MachineDependency::isVariableDependency(
+ AvmProgram * aProgram, const BF & aVar)
+{
+ return( false );
+}
+
+
+
+bool MachineDependency::computeVariableDependency(AvmLambda * aLambda)
+{
+ return( false );
+}
+
+bool MachineDependency::isVariableDependency(
+ AvmLambda * aLambda, AvmCode * aCode)
+{
+ return( false );
+}
+
+bool MachineDependency::isVariableDependency(
+ AvmLambda * aLambda, const BF & aVar)
+{
+ return( false );
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/builder/analysis/MachineDependency.h b/org.eclipse.efm.symbex/src/builder/analysis/MachineDependency.h
new file mode 100644
index 0000000..03fa1a9
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/analysis/MachineDependency.h
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 25 juil. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef MACHINEDEPENDENCY_H_
+#define MACHINEDEPENDENCY_H_
+
+namespace sep
+{
+
+
+class BF;
+
+class AvmCode;
+
+class AvmLambda;
+class AvmProgram;
+class ExecutableForm;
+class ExecutableSystem;
+
+
+class MachineDependency
+{
+
+public:
+
+ static bool computeVariableDependency(ExecutableSystem * anExecSystem);
+
+
+ static bool computeVariableDependency(ExecutableForm * anExecutable);
+
+ static bool isVariableDependency(
+ ExecutableForm * anExecutable, AvmCode * aCode);
+ static bool isVariableDependency(
+ ExecutableForm * anExecutable, const BF & aVar);
+
+
+ static bool computeVariableDependency(AvmProgram * aProgram);
+
+ static bool isVariableDependency(
+ AvmProgram * aProgram, AvmCode * aCode);
+ static bool isVariableDependency(
+ AvmProgram * aProgram, const BF & aVar);
+
+
+ static bool computeVariableDependency(AvmLambda * aLambda);
+
+ static bool isVariableDependency(
+ AvmLambda * aLambda, AvmCode * aCode);
+
+ static bool isVariableDependency(
+ AvmLambda * aLambda, const BF & aVar);
+
+
+};
+
+} /* namespace sep */
+#endif /* MACHINEDEPENDENCY_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/analysis/TransitionReachability.cpp b/org.eclipse.efm.symbex/src/builder/analysis/TransitionReachability.cpp
new file mode 100644
index 0000000..da7fc83
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/analysis/TransitionReachability.cpp
@@ -0,0 +1,834 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 nov. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "TransitionReachability.h"
+
+
+#include <computer/primitive/AvmCommunicationFactory.h>
+
+#include <fml/executable/AvmTransition.h>
+#include <fml/executable/ExecutableLib.h>
+
+#include <fml/expression/StatementTypeChecker.h>
+
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/Message.h>
+#include <fml/runtime/RuntimeForm.h>
+#include <fml/runtime/RuntimeID.h>
+
+#include <fml/trace/TracePoint.h>
+#include <fml/trace/TraceSequence.h>
+
+
+namespace sep
+{
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+TransitionReachability::TransitionReachability(const ExecutionContext & anEC,
+ const RuntimeID & aRID, AvmTransition * aTransition)
+: theEC( anEC ),
+theED( anEC.refExecutionData() ),
+theRID( aRID ),
+theTransition( aTransition ),
+theTransitionPoint( NULL ),
+theTraceElement( ),
+
+theRuntimePathComputingCountLimit( 16 ),
+
+theGoalAchievedFlag( false ),
+
+theVirtualBuffer(theTransition, NULL, 0, TYPE_LIFO_SPECIFIER, -1),
+theEmitOutput( & theVirtualBuffer ),
+
+theTableOfRuntimeStatus( *( theED.getRuntimeFormStateTable() ) )
+{
+ //!! NOTHING
+}
+
+
+/**
+ * UTILS
+ */
+bool TransitionReachability::initialize()
+{
+ theGoalAchievedFlag = false;
+
+ if( theRID.invalid() )
+ {
+ if( theED.mRID.getExecutable()->getTransition().contains(theTransition) )
+ {
+ theRID = theED.mRID;
+ }
+
+ if( theRID.invalid() )
+ {
+ if( theTransitionPoint != NULL )
+ {
+ theTransitionPoint->updateRID( theED );
+
+ theRID = theTransitionPoint->RID;
+ }
+ else
+ {
+ theRID = theED.getRuntimeID( theTransition->getExecutable() );
+ }
+ }
+ }
+
+ return( theRID.valid() );
+}
+
+
+bool TransitionReachability::computePath()
+{
+ if( initialize() )
+ {
+ AvmCommunicationFactory::collectBufferMessage(theED, theEmitOutput);
+
+ return( theGoalAchievedFlag = computePath(theRID, theTransition) );
+ }
+
+ return( false );
+}
+
+
+bool TransitionReachability::computePath(TraceSequence & aTraceElement)
+{
+ if( initialize() )
+ {
+ AvmCommunicationFactory::collectBufferMessage(theED, theEmitOutput);
+
+ if( computePath(theRID, theTransition) )
+ {
+ aTraceElement.copyTrace( theTraceElement );
+
+ theGoalAchievedFlag = true;
+
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+
+
+void TransitionReachability::report(OutStream & os)
+{
+ os << "Trace to reach :> " << theTransition->strTransitionHeader();
+ theTraceElement.toStream(os);
+
+// os << TAB << "Emit Output :>" << to_stream( theEmitOutput );
+
+ os << ( theGoalAchievedFlag ? "NEW" : "NO" ) << " OBJECTIVE !!!" << std::endl;
+}
+
+
+
+bool TransitionReachability::computePath(
+ const RuntimeID & aRID, AvmTransition * aTransition)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << TAB << "computePath from :> ";
+ theEC.traceMinimum(AVM_OS_COUT);
+ AVM_OS_COUT << TAB2 << aRID.strUniqId() << " |==> ";
+ aTransition->toStreamHeader(AVM_OS_COUT); AVM_OS_COUT << std::endl;
+ if( aTransition->hasInternalCommunicationCode() )
+ {
+ AVM_OS_COUT << TAB2 << "com |==> ";
+ BaseCompiledForm::toStreamStaticCom(AVM_OS_COUT,
+ aTransition->getInternalCommunicationCode());
+ }
+ AVM_OS_COUT << TAB2 << "Emit Output :>" << to_stream( theEmitOutput )
+ << TAB << "end //computePath" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+
+ if( theED.isIdleOrRunning(aRID) )
+ {
+ return( fireTransition(aRID, aTransition) );
+ }
+ else
+ {
+ return( computePathToTransition(aRID, aTransition) );
+ }
+
+ return( false );
+}
+
+
+bool TransitionReachability::fireTransition(
+ const RuntimeID & aRID, AvmTransition * aTransition)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << std::endl
+ << TAB << "fireTransition :> " << aRID.strUniqId()
+ << " |==> " << aTransition->strTransitionHeader() << std::endl
+ << TAB2 << "Emit Output :>" << to_stream( theEmitOutput )
+ << TAB << "end //fireTransition" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+
+ theTableOfRuntimeStatus.stateSet(aRID.getOffset(), PROCESS_SUSPENDED_STATE);
+
+ if( aTransition->hasInputCom() )
+ {
+ ListOfInstanceOfPort anInputTrace( aTransition->getInputCom() );
+ if( theEmitOutput.uncontains( anInputTrace ) )
+ {
+ // trouver des émetteurs pour les INPUT attendu au regard de ED< SC >
+ while( anInputTrace.nonempty() )
+ {
+ if( computePathToInput(aRID, anInputTrace.front()) )
+ {
+ anInputTrace.pop_front();
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ if( anInputTrace.empty() )
+ {
+ traceTransition(aRID, aTransition);
+
+ return( true );
+ }
+ return( false );
+ }
+ else
+ {
+ traceTransition(aRID, aTransition);
+ }
+ }
+ else
+ {
+ traceTransition(aRID, aTransition);
+ }
+
+ return( true );
+}
+
+
+void TransitionReachability::traceTransition(
+ const RuntimeID & aRID, AvmTransition * aTransition)
+{
+ TracePoint * tmpTP = new TracePoint(
+ ENUM_TRACE_POINT::TRACE_TRANSITION_NATURE,
+ AVM_OPCODE_INVOKE_TRANSITION, aRID, aTransition);
+
+ theTraceElement.points.append( BF(tmpTP) );
+
+ // Virtual Eval Of aTransition
+ if( aTransition->hasOutputCom() )
+ {
+ ListOfInstanceOfPort::const_iterator itOutput =
+ aTransition->getOutputCom().begin();
+ ListOfInstanceOfPort::const_iterator endOutput =
+ aTransition->getOutputCom().end();
+ for( ; itOutput != endOutput ; ++itOutput )
+ {
+ theEmitOutput.push( Message(aRID, INCR_BF(*itOutput)) );
+ }
+ }
+}
+
+
+bool TransitionReachability::computePathToTransition(
+ const RuntimeID & aRID, AvmTransition * aTransition)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << std::endl
+ << TAB << "computePathToTransition using :> " << aRID.strUniqId()
+ << " |==> " << aTransition->strTransitionHeader() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+
+ RuntimeID tmpRID = aRID.getPRID();
+ for( ; tmpRID.valid() ; tmpRID = tmpRID.getPRID() )
+ {
+// AVM_OS_COUT << tmpRID.strUniqId() << " : "
+// << tmpRID.getInstance()->getFullyQualifiedNameID() << std::endl;
+
+ if( theED.isIdleOrRunning(tmpRID) )
+ {
+ break;
+ }
+ }
+
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( tmpRID )
+ << "Runnable Ancestor Statemachine for "
+ << aRID.strUniqId() << " in the context of "
+ << aTransition->getFullyQualifiedNameID() << " !!!"
+ << SEND_EXIT;
+
+ const RuntimeForm & tmpRF = theED.getRuntime(tmpRID);
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << TAB2 << "Runnable Ancestor Statemachine :> "
+ << tmpRID.str() << std::endl
+ << TAB2 << "Runnable Ancestor State Scheduler :> {";
+ tmpRF.getOnSchedule()->toStreamRoutine( AVM_OS_COUT )
+ << TAB2 << "}" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+
+ if( tmpRF.getOnSchedule()->isOpCode( AVM_OPCODE_RUN ) &&
+ tmpRF.getOnSchedule()->first().is< RuntimeID >() )
+ {
+ return( computePathFromRunnable(
+ tmpRF.getOnSchedule()->first().bfRID(), aTransition) );
+ }
+
+ return( false );
+}
+
+
+bool TransitionReachability::computePathFromRunnable(
+ const RuntimeID & aRID, AvmTransition * aTransition)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << std::endl
+ << TAB << "computePathFromRunnable using :> " << aRID.strUniqId()
+ << " |==> " << aTransition->strTransitionHeader() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ if( not aRID.getExecutable()->
+ containsForwardReachableTransition(aTransition) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << TAB2 << "Unreachable transition :> "
+ << theTransition->strTransitionHeader() << std::endl
+ << TAB2 << "from : " << aRID.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ return( false );
+ }
+
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << TAB << "Looking for a path to :> " << aRID.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+
+ ListOfAvmTransition oneTransitionPath;
+
+ if( computePathToTransition(aRID, aTransition, oneTransitionPath) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << INCR_INDENT;
+ AvmTransition::toStream(AVM_OS_COUT, oneTransitionPath);
+ AVM_OS_COUT << DECR_INDENT << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ // All found path
+// ListOfListOfAvmTransition allTransitionPaths;
+// computePathToTransition(aRID, aTransition, allTransitionPaths);
+
+ RuntimeID tmpRID = aRID;
+ do
+ {
+ aTransition = oneTransitionPath.front();
+
+ if( fireTransition(tmpRID, aTransition) )
+ {
+ oneTransitionPath.pop_front();
+
+ if( not computeTargetMachine(tmpRID, aTransition->getCode()) )
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ break;
+ }
+ }
+ while( oneTransitionPath.nonempty() );
+
+ return( oneTransitionPath.empty() );
+ }
+
+ return( false );
+}
+
+
+
+//bool TransitionReachability::computePathFromRunnable(
+// const RuntimeID & aRID, AvmTransition * aTransition)
+//{
+//AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+// AVM_OS_COUT << std::endl
+// << TAB << "computePathFromRunnable using :> " << aRID.strUniqId()
+// << " |==> " << aTransition->strTransitionHeader() << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+//
+// if( not aRID.getExecutable()->
+// containsForwardReachableTransition(aTransition) )
+// {
+//AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+// AVM_OS_COUT << TAB2 << "Unreachable transition :> "
+// << theTransition->strTransitionHeader() << std::endl
+// << TAB2 << "from : " << aRID.str() << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+//
+// return( false );
+// }
+//
+//
+//AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+// AVM_OS_COUT << TAB << "Looking for a path to :> " << aRID.str() << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+//
+//
+// // All found path
+// ListOfListOfAvmTransition allTransitionPaths;
+// computePathToTransition(aRID, aTransition, allTransitionPaths);
+//
+// BFList saveTracePoints( theTraceElement.points );
+//
+// ListOfAvmTransition oneTransitionPath;
+// RuntimeID tmpRID;
+//
+//// if( computePathToTransition(aRID, aTransition, oneTransitionPath) )
+// while( allTransitionPaths.nonempty() )
+// {
+// oneTransitionPath.clear();
+// oneTransitionPath.splice( allTransitionPaths.front() );
+// allTransitionPaths.pop_front();
+//
+//AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+// AVM_OS_COUT << TAB << "Found Path --> "
+// << aTransition->getFullyQualifiedNameID() << std::endl << INCR_INDENT;
+// AvmTransition::toStream(AVM_OS_COUT, oneTransitionPath);
+// AVM_OS_COUT << DECR_INDENT << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+//
+// tmpRID = aRID;
+// do
+// {
+// aTransition = oneTransitionPath.front();
+//
+// if( fireTransition(tmpRID, aTransition) )
+// {
+// oneTransitionPath.pop_front();
+//
+// computeTargetMachine(tmpRID, aTransition->getCode());
+// }
+// else
+// {
+// break;
+// }
+// }
+// while( oneTransitionPath.nonempty() );
+//
+// if( oneTransitionPath.empty() )
+// {
+// return( true );
+// }
+// else if( allTransitionPaths.empty() )
+// {
+// return( false );
+// }
+//
+// // BACKTRACK
+// else if( saveTracePoints.empty() )
+// {
+// theTraceElement.points.clear();
+// }
+// else
+// {
+// while( theTraceElement.points.back().isNTEQ( saveTracePoints.back() ) )
+// {
+// theTraceElement.points.pop_back();
+// }
+// }
+// }
+//
+// return( false );
+//}
+
+
+bool TransitionReachability::computePathToInput(
+ const RuntimeID & aRID, InstanceOfPort * anInputTrace)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << TAB << "computePathToInput :> " << std::endl
+ << TAB2 << "Expected Input :> "
+ << anInputTrace->getFullyQualifiedNameID() << std::endl
+ << TAB2 << "Emit Output :>" << to_stream( theEmitOutput )
+ << TAB << "end //computePathToInput" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+
+ ExecutableForm * tmpExecutable = NULL;
+ RuntimeID srcRID;
+
+ // Parcourir tous les états et repérer ceux contenant les bons output/outputTo
+ TableOfRuntimeT::const_iterator itRF = theED.getTableOfRuntime().begin();
+ TableOfRuntimeT::const_iterator endRF = theED.getTableOfRuntime().end();
+ for( ; itRF != endRF ; ++itRF )
+ {
+ srcRID = (*itRF)->getRID();
+ tmpExecutable = srcRID.getExecutable();
+
+ if( theTableOfRuntimeStatus.isSuspended(srcRID.getOffset()) )
+ {
+ //!! Exclude machine
+ }
+ else if( theED.isIdleOrRunning( srcRID ) &&
+ tmpExecutable->getForwardReachableTransition().nonempty() )
+ {
+ ListOfAvmTransition::const_iterator itTrans =
+ tmpExecutable->getForwardReachableTransition().begin();
+ ListOfAvmTransition::const_iterator endTrans =
+ tmpExecutable->getForwardReachableTransition().end();
+ for( ; itTrans != endTrans ; ++itTrans )
+ {
+ if( (*itTrans)->getOutputCom().contains(anInputTrace) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << TAB << "found Output in :> " << srcRID.strUniqId() << " |==> "
+ << (*itTrans)->strTransitionHeader() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ if( tmpExecutable != (*itTrans)->getExecutable() )
+ {
+ if( computePathFromRunnable(srcRID, (*itTrans)) )
+ {
+ return( true );
+ }
+ }
+ else if( fireTransition(srcRID, (*itTrans)) )
+ {
+ return( true );
+ }
+ }
+ }
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << TAB << "Unfound Input :> "
+ << anInputTrace->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ return( false );
+}
+
+
+bool TransitionReachability::computePathToTransition(const RuntimeID & aRID,
+ AvmTransition * aTransition, ListOfAvmTransition & oneTransitionPath)
+{
+ ListOfListOfAvmTransition anyTransitionPaths;
+
+ ListOfAvmTransition listOfOutgoingTransition;
+ InstanceOfMachine * tgtInstance;
+
+ // Initialization step
+ ExecutableForm * fwdMachine = aRID.getExecutable();
+ fwdMachine->getOutgoingTransition( listOfOutgoingTransition );
+
+ ExecutableForm * tgtMachine = fwdMachine;
+
+ ListOfAvmTransition::const_iterator itTrans = listOfOutgoingTransition.begin();
+ ListOfAvmTransition::const_iterator endTrans = listOfOutgoingTransition.end();
+ for( ; itTrans != endTrans ; ++itTrans )
+ {
+ if( (tgtInstance = (*itTrans)->getTransitionTarget()) != NULL )
+ {
+ tgtMachine = tgtInstance->getExecutable();
+ }
+ if( tgtMachine->containsForwardReachableTransition(aTransition) )
+ {
+ anyTransitionPaths.append( ListOfAvmTransition(*itTrans) );
+ }
+ }
+
+
+ ListOfAvmTransition aTransitionPath;
+
+ // Iterative step
+ while( anyTransitionPaths.nonempty() )
+ {
+ aTransitionPath.clear();
+ aTransitionPath.splice( anyTransitionPaths.front() );
+ anyTransitionPaths.pop_front();
+
+ if( (tgtInstance = aTransitionPath.back()->getTransitionTarget()) != NULL )
+ {
+ fwdMachine = tgtInstance->getExecutable();
+ }
+ if( fwdMachine->getTransition().contains(aTransition) )
+ {
+ oneTransitionPath.splice( aTransitionPath );
+ oneTransitionPath.push_back( aTransition );
+
+ return( true );
+ }
+ else
+ {
+ listOfOutgoingTransition.clear();
+ fwdMachine->getOutgoingTransition( listOfOutgoingTransition );
+
+ itTrans = listOfOutgoingTransition.begin();
+ endTrans = listOfOutgoingTransition.end();
+ for( ; itTrans != endTrans ; ++itTrans )
+ {
+ if( not aTransitionPath.contains( *itTrans ) )
+ {
+ if( (tgtInstance = (*itTrans)->getTransitionTarget()) != NULL )
+ {
+ tgtMachine = tgtInstance->getExecutable();
+ }
+ if( tgtMachine->containsForwardReachableTransition(aTransition) )
+ {
+ if( anyTransitionPaths.size() <
+ theRuntimePathComputingCountLimit )
+ {
+ anyTransitionPaths.push_back( aTransitionPath );
+ anyTransitionPaths.back().push_back( *itTrans );
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return( false );
+}
+
+
+bool TransitionReachability::computePathToTransition(const RuntimeID & aRID,
+ AvmTransition * aTransition, ListOfListOfAvmTransition & allTransitionPaths)
+{
+ ListOfListOfAvmTransition anyTransitionPaths;
+ ListOfListOfAvmTransition prefixLoopTransitionPaths;
+
+ ListOfAvmTransition aTransitionPath;
+
+ ListOfAvmTransition listOfOutgoingTransition;
+ InstanceOfMachine * tgtInstance;
+
+ // Initialization step
+ ExecutableForm * fwdMachine = aRID.getExecutable();
+ fwdMachine->getOutgoingTransition( listOfOutgoingTransition );
+
+ ExecutableForm * tgtMachine = fwdMachine;
+
+ ListOfAvmTransition::const_iterator itTrans = listOfOutgoingTransition.begin();
+ ListOfAvmTransition::const_iterator endTrans = listOfOutgoingTransition.end();
+ for( ; itTrans != endTrans ; ++itTrans )
+ {
+ if( (tgtInstance = (*itTrans)->getTransitionTarget()) != NULL )
+ {
+ tgtMachine = tgtInstance->getExecutable();
+ }
+ if( tgtMachine->containsForwardReachableTransition(aTransition) )
+ {
+ anyTransitionPaths.append( ListOfAvmTransition(*itTrans) );
+ }
+ }
+
+ // Iterative step
+ while( anyTransitionPaths.nonempty() )
+ {
+// AVM_OS_COUT << TAB << "TMP found paths :> " << std::endl;
+// ListOfListOfAvmTransition::const_iterator itList = allTransitionPaths.begin();
+// ListOfListOfAvmTransition::const_iterator endList = allTransitionPaths.end();
+// for( avm_size_t number = 0 ; itList != endList ; ++itList , ++number )
+// {
+// AVM_OS_COUT << TAB << "Path number :" << number << ">"
+// << std::endl << INCR_INDENT;
+// AvmTransition::toStream(AVM_OS_COUT, *itList);
+// AVM_OS_COUT << std::endl << DECR_INDENT;
+// }
+//
+// AVM_OS_COUT << TAB << "TMP Computing paths :> " << std::endl;
+// itList = anyTransitionPaths.begin();
+// endList = anyTransitionPaths.end();
+// for( avm_size_t number = 0 ; itList != endList ; ++itList , ++number )
+// {
+// AVM_OS_COUT << TAB << "Path number :" << number << ">"
+// << std::endl << INCR_INDENT;
+// AvmTransition::toStream(AVM_OS_COUT, *itList);
+// AVM_OS_COUT << DECR_INDENT;
+// }
+// AVM_OS_COUT << std::endl;
+
+ aTransitionPath.clear();
+ aTransitionPath.splice( anyTransitionPaths.front() );
+ anyTransitionPaths.pop_front();
+
+ if( (tgtInstance = aTransitionPath.back()->getTransitionTarget()) != NULL )
+ {
+ fwdMachine = tgtInstance->getExecutable();
+ }
+ if( fwdMachine->getTransition().contains(aTransition) )
+ {
+ allTransitionPaths.push_back( aTransitionPath );
+ allTransitionPaths.back().push_back( aTransition );
+ }
+ else
+ {
+ listOfOutgoingTransition.clear();
+ fwdMachine->getOutgoingTransition( listOfOutgoingTransition );
+
+ itTrans = listOfOutgoingTransition.begin();
+ endTrans = listOfOutgoingTransition.end();
+ for( ; itTrans != endTrans ; ++itTrans )
+ {
+ if( aTransitionPath.contains( *itTrans ) )
+ {
+ prefixLoopTransitionPaths.push_back( aTransitionPath );
+ prefixLoopTransitionPaths.back().push_back( *itTrans );
+ }
+ else
+ {
+ if( (tgtInstance = (*itTrans)->getTransitionTarget()) != NULL )
+ {
+ tgtMachine = tgtInstance->getExecutable();
+ }
+ if( tgtMachine->containsForwardReachableTransition(aTransition) )
+ {
+ anyTransitionPaths.push_back( aTransitionPath );
+ anyTransitionPaths.back().push_back( *itTrans );
+ }
+ }
+ }
+ }
+ }
+
+ AVM_OS_COUT << TAB << "List of found paths :> " << std::endl;
+ ListOfListOfAvmTransition::const_iterator itList = allTransitionPaths.begin();
+ ListOfListOfAvmTransition::const_iterator endList = allTransitionPaths.end();
+ for( avm_size_t number = 0 ; itList != endList ; ++itList , ++number )
+ {
+ AVM_OS_COUT << TAB << "Path number :" << number << " --> "
+ << aTransition->getFullyQualifiedNameID() << std::endl << INCR_INDENT;
+ AvmTransition::toStream(AVM_OS_COUT, *itList);
+ AVM_OS_COUT << std::endl << DECR_INDENT;
+ }
+
+// AVM_OS_COUT << TAB << "List of found prefix-paths :> " << std::endl;
+// itList = prefixLoopTransitionPaths.begin();
+// endList = prefixLoopTransitionPaths.end();
+// for( avm_size_t number = 0 ; itList != endList ; ++itList , ++number )
+// {
+// AVM_OS_COUT << TAB << "Prefix number :" << number << ">"
+// << std::endl << INCR_INDENT;
+// AvmTransition::toStream(AVM_OS_COUT, *itList);
+// AVM_OS_COUT << std::endl << DECR_INDENT;
+// }
+
+ return( allTransitionPaths.nonempty() );
+}
+
+
+bool TransitionReachability::computeTargetMachine(
+ RuntimeID & aRID, AvmCode * aCode)
+{
+ switch( aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_ENABLE_INVOKE:
+ case AVM_OPCODE_ENABLE_SET:
+ {
+ const BF & targetMachine = aCode->first();
+
+ if( targetMachine.is< InstanceOfMachine >() )
+ {
+ if( (targetMachine.to_ptr< InstanceOfMachine >()
+ != aRID.getInstance())
+ && theED.getRuntime(aRID).hasChild() )
+ {
+ aRID = theED.getRuntimeFormChild(aRID,
+ targetMachine.to_ptr< InstanceOfMachine >() );
+ }
+ }
+ else if( targetMachine.is< RuntimeID >() )
+ {
+ aRID = targetMachine.bfRID();
+ }
+
+ return( true );
+ }
+ case AVM_OPCODE_DISABLE_SELF:
+ {
+ aRID = aRID.getPRID();
+
+ return( true );
+ }
+ case AVM_OPCODE_DISABLE_INVOKE:
+ {
+ if( (aCode->first() == ExecutableLib::MACHINE_SELF)
+ || (aRID == aCode->first()) )
+ {
+ aRID = aRID.getPRID();
+
+ return( true );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ case AVM_OPCODE_DISABLE_SELVES:
+ {
+ if( aCode->first().isInteger() )
+ {
+ for( avm_uinteger_t level = aCode->first().toInteger() ;
+ level > 0 ; --level )
+ {
+ aRID = aRID.getPRID();
+ }
+ }
+ else
+ {
+ aRID = aRID.getPRID();
+ }
+
+ return( true );
+ }
+ default:
+ {
+ if( StatementTypeChecker::isSchedule(aCode) )
+ {
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator endIt = aCode->end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).is< AvmCode >() )
+ {
+ if( not computeTargetMachine(aRID,
+ (*it).to_ptr< AvmCode >()) )
+ {
+ return( false );
+ }
+ }
+ }
+ }
+
+ return( true );
+ }
+ }
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/builder/analysis/TransitionReachability.h b/org.eclipse.efm.symbex/src/builder/analysis/TransitionReachability.h
new file mode 100644
index 0000000..b56a3b9
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/analysis/TransitionReachability.h
@@ -0,0 +1,132 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 nov. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef TRANSITIONREACHABILITY_H_
+#define TRANSITIONREACHABILITY_H_
+
+#include <collection/List.h>
+#include <collection/Typedef.h>
+
+#include <fml/buffer/LifoBuffer.h>
+
+#include <fml/executable/AvmTransition.h>
+#include <fml/executable/InstanceOfBuffer.h>
+
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeID.h>
+
+#include <fml/trace/TraceSequence.h>
+
+
+namespace sep
+{
+
+class OutStream;
+class AvmTransition;
+
+class ExecutableForm;
+class ExecutionContext;
+class ExecutionData;
+
+class InstanceOfPort;
+
+class RuntimeForm;
+class RuntimeID;
+
+class TracePoint;
+
+
+class TransitionReachability
+{
+
+protected:
+ /**
+ * TYPEDEF
+ */
+ typedef List< ListOfAvmTransition > ListOfListOfAvmTransition;
+
+
+ /**
+ * ATTRIBUTE
+ */
+ const ExecutionContext & theEC;
+ const ExecutionData & theED;
+ RuntimeID theRID;
+ AvmTransition * theTransition;
+
+ TracePoint * theTransitionPoint;
+ TraceSequence theTraceElement;
+
+ avm_size_t theRuntimePathComputingCountLimit;
+
+ bool theGoalAchievedFlag;
+
+ InstanceOfBuffer theVirtualBuffer;
+ LifoBuffer theEmitOutput;
+
+ TableOfRuntimeFormState theTableOfRuntimeStatus;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TransitionReachability(const ExecutionContext & anEC,
+ const RuntimeID & aRID, AvmTransition * aTransition);
+
+
+ /**
+ * UTILS
+ */
+ bool initialize();
+
+ bool computePath();
+
+ bool computePath(TraceSequence & aTraceElement);
+
+ void report(OutStream & os);
+
+
+ bool computePath(const RuntimeID & aRID, AvmTransition * aTransition);
+
+ bool fireTransition(const RuntimeID & aRID, AvmTransition * aTransition);
+
+ void traceTransition(const RuntimeID & aRID, AvmTransition * aTransition);
+
+ bool computePathToTransition(
+ const RuntimeID & aRID, AvmTransition * aTransition);
+
+ bool computePathFromRunnable(
+ const RuntimeID & aRID, AvmTransition * aTransition);
+
+ bool computePathToInput(
+ const RuntimeID & aRID, InstanceOfPort * anInputTrace);
+
+
+ bool computePathToTransition(const RuntimeID & aRID,
+ AvmTransition * aTransition, ListOfAvmTransition & oneTransitionPath);
+
+ bool computePathToTransition(const RuntimeID & aRID,
+ AvmTransition * aTransition, ListOfListOfAvmTransition & allTransitionPaths);
+
+ bool computeTargetMachine(RuntimeID & aRID, AvmCode * aCode);
+
+};
+
+
+} /* namespace sep */
+
+#endif /* TRANSITIONREACHABILITY_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/compiler/BaseCompiler.cpp b/org.eclipse.efm.symbex/src/builder/compiler/BaseCompiler.cpp
new file mode 100644
index 0000000..31c5c61
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/compiler/BaseCompiler.cpp
@@ -0,0 +1,697 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "BaseCompiler.h"
+
+#include <fml/executable/ExecutableLib.h>
+
+#include <fml/infrastructure/DataType.h>
+#include <fml/infrastructure/PropertyPart.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+#include <fml/type/ChoiceTypeSpecifier.h>
+#include <fml/type/ClassTypeSpecifier.h>
+#include <fml/type/EnumTypeSpecifier.h>
+#include <fml/type/UnionTypeSpecifier.h>
+#include <fml/type/TypeManager.h>
+
+#include <fml/workflow/UniFormIdentifier.h>
+
+#include <sew/Configuration.h>
+
+
+namespace sep
+{
+
+
+/**
+ * Pre-Compiling type specifier
+ */
+void BaseCompiler::precompileTypeSpecifier(
+ AvmProgram * aContainer, const BF & bfType)
+{
+ TypeSpecifier aTypeSpecifier;
+
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( bfType )
+ << "typedef for compiling !!!"
+ << SEND_EXIT;
+
+ if( bfType.is< DataType >() )
+ {
+ DataType * aDataType = bfType.to_ptr< DataType >();
+
+ if( aDataType->hasTypeContainer() )
+ {
+ aTypeSpecifier = compileContainerSpecifier(aContainer, aDataType);
+ }
+ else if( aDataType->isTypedInterval() )
+ {
+ aTypeSpecifier = compileIntervalSpecifier(aContainer, aDataType);
+ }
+ else if( aDataType->isTypedEnum() )
+ {
+ aTypeSpecifier = compileEnumerationSpecifier(aContainer, aDataType);
+ }
+ else if( aDataType->isTypedStructure() )
+ {
+ aTypeSpecifier = compileStructureSpecifier(aContainer, aDataType);
+ }
+
+ else if( aDataType->isTypedChoice() )
+ {
+ aTypeSpecifier = compileChoiceSpecifier(aContainer, aDataType);
+ }
+
+ else if( aDataType->isTypedUnion() )
+ {
+ aTypeSpecifier = compileUnionSpecifier(aContainer, aDataType);
+ }
+
+ else if( aDataType->isTypedAlias() )
+ {
+ aTypeSpecifier = compileTypeAliasSpecifier(aContainer, aDataType);
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected a typedef << " << bfType.str()
+ << " >> for compiling !!!"
+ << SEND_EXIT;
+ }
+ }
+
+ else if( bfType.is< BaseTypeSpecifier >() )
+ {
+ //!! OK
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected a typedef << " << bfType.str()
+ << " >> for compiling !!!"
+ << SEND_EXIT;
+ }
+
+ if( aTypeSpecifier.valid() )
+ {
+ aContainer->appendTypeSpecifier( aTypeSpecifier );
+ }
+}
+
+
+
+/**
+ * Compiling type specifier
+ */
+TypeSpecifier BaseCompiler::compileTypeSpecifier(
+ AvmProgram * aContainer, const std::string & aTypeID)
+{
+ const TypeSpecifier & aType = TypeManager::getPrimitiveType( aTypeID );
+
+ if( aType.valid() )
+ {
+ return( aType );
+ }
+ else
+ {
+ CompilationEnvironment compilENV(aContainer);
+
+ const TypeSpecifier & aType = SymbolTable::searchTypeSpecifier(
+ getConfiguration().getExecutableSystem(),
+ compilENV.mCTX, aTypeID);
+
+ if( aType.valid() )
+ {
+ return( aType );
+ }
+ else
+ {
+ aContainer->getAstElement()->errorLocation(AVM_OS_WARN)
+ << "Error while compiling type specifier << "
+ << aTypeID << " >>" << std::endl << std::endl;
+
+ return( TypeManager::UNIVERSAL );
+ }
+ }
+}
+
+
+TypeSpecifier BaseCompiler::compileTypeSpecifier(
+ AvmProgram * aContainer, const BF & bfType)
+{
+ if( bfType.invalid() )
+ {
+ return( TypeManager::UNIVERSAL );
+ }
+
+ else if( bfType.is< BaseTypeSpecifier >() )
+ {
+ return( bfType.as_bf< TypeSpecifier >() );
+ }
+
+ else if( bfType.is< UniFormIdentifier >() )
+ {
+ CompilationEnvironment compilENV(aContainer);
+
+ const TypeSpecifier & aType = SymbolTable::searchTypeSpecifier(
+ getConfiguration().getExecutableSystem(),
+ compilENV.mCTX, bfType.str());
+
+ if( aType.valid() )
+ {
+ return( aType );
+ }
+ else
+ {
+// incrErrorCount();
+ AVM_OS_WARN << bfType.to_ptr< UniFormIdentifier >()
+ ->errorLocation(aContainer->getAstElement())
+ << "Unfound data type form << " << bfType.str()
+ << " >>" << std::endl << std::endl;
+
+ return( TypeManager::UNIVERSAL );
+ }
+ }
+
+ else if( bfType.isnot< ObjectElement /*!DataType!*/ >() )
+ {
+ const TypeSpecifier & aType =
+ TypeManager::getPrimitiveType( bfType.str() );
+
+ if( aType.valid() )
+ {
+ return( aType );
+ }
+ else
+ {
+ AVM_OS_TODO_ALERT
+ << "Compilation of unknown type specificier << "
+ << bfType.str() << " >> !!!"
+ << SEND_ALERT;
+
+ return( TypeManager::UNIVERSAL );
+ }
+ }
+
+ else
+ {
+ CompilationEnvironment compilENV(aContainer);
+
+ TypeSpecifier bfTS = SymbolTable::searchTypeSpecifier(
+ getConfiguration().getExecutableSystem(),
+ compilENV.mCTX, bfType.to_ptr< ObjectElement >() );
+
+ if( bfTS.valid() )
+ {
+ return( bfTS );
+ }
+
+ else if( bfType.is< DataType >() )
+ {
+ DataType * aDataType = bfType.to_ptr< DataType >();
+
+ if( aDataType->hasTypeContainer() )
+ {
+ bfTS = compileContainerSpecifier(aContainer, aDataType);
+ }
+ else if( aDataType->isTypedInterval() )
+ {
+ bfTS = compileIntervalSpecifier(aContainer, aDataType);
+ }
+ else if( aDataType->isTypedEnum() )
+ {
+ bfTS = compileEnumerationSpecifier(aContainer, aDataType);
+ }
+ else if( aDataType->isTypedStructure() )
+ {
+ bfTS = compileStructureSpecifier(aContainer, aDataType);
+ }
+
+ else if( aDataType->isTypedChoice() )
+ {
+ bfTS = compileChoiceSpecifier(aContainer, aDataType);
+ }
+
+ else if( aDataType->isTypedUnion() )
+ {
+ bfTS = compileUnionSpecifier(aContainer, aDataType);
+ }
+
+ else// if( aDataType->isTypedAlias() )
+ {
+ bfTS = compileTypeAliasSpecifier(aContainer, aDataType);
+ }
+ }
+
+ if( bfTS.valid() )
+ {
+ if( bfTS.hasTypeEnumOrComposite() &&
+ SymbolTable::searchTypeSpecifier(
+ getConfiguration().getExecutableSystem(),
+ compilENV.mCTX, bfTS.getAstElement()).invalid() )
+ {
+ aContainer->appendTypeSpecifier( bfTS );
+ }
+
+ return( bfTS );
+ }
+ else
+ {
+ aContainer->getAstElement()->errorLocation(AVM_OS_WARN)
+ << "Error while compiling type specifier << "
+ << bfType.str() << " >>" << std::endl << std::endl;
+
+ return( TypeManager::UNIVERSAL );
+ }
+
+
+// incrErrorCount();
+ ++AVM_ERROR_COUNT;
+
+ AVM_OS_ERROR_ALERT
+ << "TODO:> compilation of unknown type specificier like : << "
+ << bfType.str() << " >> !!!"
+ << SEND_ALERT;
+
+ return( TypeManager::UNIVERSAL );
+ }
+}
+
+
+TypeSpecifier BaseCompiler::compileStructureSpecifier(
+ AvmProgram * aContainer, DataType * aStructureT)
+{
+ ClassTypeSpecifier * theClassType;
+ TypeSpecifier bfTS( theClassType = TypeManager::newClass(aStructureT) );
+
+ BF aValue;
+ TypeSpecifier aTypeSpecifier;
+
+ TableOfVariable::const_raw_iterator it =
+ aStructureT->getPropertyPart()->getVariables().begin();
+ TableOfVariable::const_raw_iterator endIt =
+ aStructureT->getPropertyPart()->getVariables().end();
+ for( ; it != endIt ; ++it )
+ {
+ aTypeSpecifier = compileTypeSpecifier(aContainer, (it)->getType());
+
+ InstanceOfData * anInstanceAttribute = new InstanceOfData(
+ IPointerDataNature::POINTER_FIELD_CLASS_ATTRIBUTE_NATURE,
+ NULL, (it), aTypeSpecifier,
+ theClassType->getSymbolData().size(), (it)->getModifier() );
+ anInstanceAttribute->setNameID( (it)->getNameID() );
+
+ aValue = (it)->getValue();
+ if( aValue.valid() )
+ {
+ switch( aValue.classKind() )
+ {
+ case FORM_OPERATOR_KIND:
+
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ case FORM_BUILTIN_CHARACTER_KIND:
+ case FORM_BUILTIN_INTEGER_KIND:
+ case FORM_BUILTIN_RATIONAL_KIND:
+ case FORM_BUILTIN_FLOAT_KIND:
+ case FORM_BUILTIN_STRING_KIND:
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+ //@deprecated
+ //case FORM_EXPRESSION_GINAC_KIND:
+ {
+ anInstanceAttribute->setValue( aValue );
+
+ break;
+ }
+
+ default:
+ {
+ if( (aValue == ExecutableLib::MACHINE_NULL)
+ || (aValue == ExecutableLib::CHANNEL_NIL)
+ || (aValue == ExecutableLib::PORT_NIL )
+ || (aValue == ExecutableLib::BUFFER_NIL ) )
+ {
+ anInstanceAttribute->setValue( aValue );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected STRUCTURE ATTRIBUTE value "
+ "for compileStructureSpecifier :>\n"
+ << aValue.toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+// anInstanceAttribute->setValue( mAvmcodeCompiler.
+// decode_compileExpression(aContainer, aValue) );
+ }
+
+ break;
+ }
+ }
+
+ }
+
+ theClassType->saveSymbolData(anInstanceAttribute);
+ }
+
+ theClassType->updateSize();
+
+ return( bfTS );
+}
+
+
+TypeSpecifier BaseCompiler::compileChoiceSpecifier(
+ AvmProgram * aContainer, DataType * aChoiceT)
+{
+ ChoiceTypeSpecifier * theChoiceType;
+ TypeSpecifier bfTS( theChoiceType = TypeManager::newChoice(aChoiceT) );
+
+ BF aValue;
+ TypeSpecifier aTypeSpecifier;
+
+ TableOfVariable::const_raw_iterator it =
+ aChoiceT->getPropertyPart()->getVariables().begin();
+ TableOfVariable::const_raw_iterator endIt =
+ aChoiceT->getPropertyPart()->getVariables().end();
+ for( ; it != endIt ; ++it )
+ {
+ aTypeSpecifier = compileTypeSpecifier(aContainer, (it)->getType());
+
+ InstanceOfData * anInstanceAttribute = new InstanceOfData(
+ IPointerDataNature::POINTER_FIELD_CHOICE_ATTRIBUTE_NATURE,
+ NULL, (it), aTypeSpecifier,
+ theChoiceType->getSymbolData().size(), (it)->getModifier() );
+ anInstanceAttribute->setNameID( (it)->getNameID() );
+
+ aValue = (it)->getValue();
+ if( aValue.valid() )
+ {
+ switch( aValue.classKind() )
+ {
+ case FORM_OPERATOR_KIND:
+
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ case FORM_BUILTIN_CHARACTER_KIND:
+ case FORM_BUILTIN_INTEGER_KIND:
+ case FORM_BUILTIN_RATIONAL_KIND:
+ case FORM_BUILTIN_FLOAT_KIND:
+ case FORM_BUILTIN_STRING_KIND:
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+ //@deprecated
+ //case FORM_EXPRESSION_GINAC_KIND:
+ {
+ anInstanceAttribute->setValue( aValue );
+
+ break;
+ }
+
+ default:
+ {
+ if( (aValue == ExecutableLib::MACHINE_NULL)
+ || (aValue == ExecutableLib::CHANNEL_NIL)
+ || (aValue == ExecutableLib::PORT_NIL )
+ || (aValue == ExecutableLib::BUFFER_NIL ) )
+ {
+ anInstanceAttribute->setValue( aValue );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected STRUCTURE ATTRIBUTE value "
+ "for compileChoiceSpecifier :>\n"
+ << aValue.toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+// anInstanceAttribute->setValue( mAvmcodeCompiler.
+// decode_compileExpression(aContainer, aValue) );
+ }
+
+ break;
+ }
+ }
+
+ }
+
+ theChoiceType->saveSymbolData(anInstanceAttribute);
+ }
+
+ theChoiceType->updateSize();
+
+ return( bfTS );
+}
+
+
+TypeSpecifier BaseCompiler::compileUnionSpecifier(
+ AvmProgram * aContainer, DataType * anUnionT)
+{
+ UnionTypeSpecifier * theUnionType;
+ TypeSpecifier bfTS( theUnionType = TypeManager::newUnion(anUnionT) );
+
+ BF aValue;
+ TypeSpecifier aTypeSpecifier;
+
+ TableOfVariable::const_raw_iterator it =
+ anUnionT->getPropertyPart()->getVariables().begin();
+ TableOfVariable::const_raw_iterator endIt =
+ anUnionT->getPropertyPart()->getVariables().end();
+ for( ; it != endIt ; ++it )
+ {
+ aTypeSpecifier = compileTypeSpecifier(aContainer, (it)->getType());
+
+ InstanceOfData * anInstanceAttribute = new InstanceOfData(
+ IPointerDataNature::POINTER_FIELD_UNION_ATTRIBUTE_NATURE,
+ NULL, (it), aTypeSpecifier, 0, (it)->getModifier());
+ anInstanceAttribute->setNameID( (it)->getNameID() );
+
+ aValue = (it)->getValue();
+ if( aValue.valid() )
+ {
+ switch( aValue.classKind() )
+ {
+ case FORM_OPERATOR_KIND:
+
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ case FORM_BUILTIN_CHARACTER_KIND:
+ case FORM_BUILTIN_INTEGER_KIND:
+ case FORM_BUILTIN_RATIONAL_KIND:
+ case FORM_BUILTIN_FLOAT_KIND:
+ case FORM_BUILTIN_STRING_KIND:
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+ //@deprecated
+ //case FORM_EXPRESSION_GINAC_KIND:
+ {
+ anInstanceAttribute->setValue( aValue );
+
+ break;
+ }
+
+ default:
+ {
+ if( (aValue == ExecutableLib::MACHINE_NULL)
+ || (aValue == ExecutableLib::CHANNEL_NIL)
+ || (aValue == ExecutableLib::PORT_NIL )
+ || (aValue == ExecutableLib::BUFFER_NIL ) )
+ {
+ anInstanceAttribute->setValue( aValue );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected UNION ATTRIBUTE value "
+ "for compileUnionSpecifier :>\n"
+ << aValue.toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+// anInstanceAttribute->setValue( mAvmcodeCompiler.
+// decode_compileExpression(aContainer, aValue) );
+ }
+
+ break;
+ }
+ }
+
+ }
+
+ theUnionType->saveSymbolData(anInstanceAttribute);
+ }
+
+ theUnionType->updateSize();
+
+ return( bfTS );
+}
+
+
+TypeSpecifier BaseCompiler::compileContainerSpecifier(
+ AvmProgram * aContainer, DataType * aCollectionT)
+{
+ TypeSpecifier theContainerType = compileTypeSpecifier(
+ aContainer, aCollectionT->getContentsTypeSpecifier());
+
+ if( theContainerType.invalid() )
+ {
+ theContainerType = TypeManager::UNIVERSAL;
+
+// incrErrorCount();
+ ++AVM_ERROR_COUNT;
+
+ AVM_OS_ERROR_ALERT << "BaseCompiler::compileCollectionSpecifier : << "
+ << aCollectionT->strT() << " >> !!!"
+ << SEND_ALERT;
+ }
+
+
+ int theSize = aCollectionT->size();
+
+ if( (aCollectionT->getContainerSpecifierKind() == TYPE_ARRAY_SPECIFIER)
+ && (theSize < 1) )
+ {
+ theSize = 1;
+
+// incrErrorCount();
+ ++AVM_ERROR_COUNT;
+
+ AVM_OS_ERROR_ALERT << "BaseCompiler::compileCollectionSpecifier : << "
+ << aCollectionT->strT() << " >> !!!"
+ << SEND_ALERT;
+ }
+
+ TypeSpecifier bfTS( TypeManager::newCollection(aCollectionT,
+ aCollectionT->getContainerSpecifierKind(), theContainerType,
+ (theSize < 0)? AVM_NUMERIC_MAX_INTEGER : theSize ) );
+
+ return( bfTS );
+}
+
+
+TypeSpecifier BaseCompiler::compileIntervalSpecifier(
+ AvmProgram * aContainer, DataType * anIntervalT)
+{
+ TypeSpecifier theBaseType = compileTypeSpecifier(
+ aContainer, anIntervalT->getIntervalTypeSpecifier());
+
+ if( theBaseType.invalid() )
+ {
+ theBaseType = TypeManager::INTEGER;
+
+// incrErrorCount();
+ ++AVM_ERROR_COUNT;
+
+ AVM_OS_ERROR_ALERT << "BaseCompiler::compileIntervalSpecifier : << "
+ << anIntervalT->strT() << " >> !!!"
+ << SEND_ALERT;
+ }
+
+ BF aMin = mAvmcodeCompiler.decode_compileExpression(
+ aContainer, anIntervalT->getIntervalInfimum());
+
+ BF aMax = mAvmcodeCompiler.decode_compileExpression(
+ aContainer, anIntervalT->getIntervalSupremum());
+
+ TypeSpecifier bfTS( TypeManager::newInterval(anIntervalT,
+ theBaseType, anIntervalT->getIntervalKind(), aMin, aMax) );
+
+ return( bfTS );
+}
+
+
+TypeSpecifier BaseCompiler::compileEnumerationSpecifier(
+ AvmProgram * aContainer, DataType * anEnumT)
+{
+ EnumTypeSpecifier * theEnumType;
+ TypeSpecifier bfTS( theEnumType = TypeManager::newEnum(anEnumT));
+
+ BF aValue;
+
+ TableOfVariable::const_raw_iterator it =
+ anEnumT->getPropertyPart()->getVariables().begin();
+ TableOfVariable::const_raw_iterator endIt =
+ anEnumT->getPropertyPart()->getVariables().end();
+ for( ; it != endIt ; ++it )
+ {
+ InstanceOfData * anInstanceSymbol = new InstanceOfData(
+ IPointerDataNature::POINTER_ENUM_SYMBOL_NATURE,
+ aContainer, (it), bfTS, (it)->getFullyQualifiedNameID(),
+ theEnumType->getSymbolData().size(),
+ Modifier::PROPERTY_PUBLIC_FINAL_STATIC_MODIFIER);
+ anInstanceSymbol->updateFullyQualifiedNameID();
+
+ aValue = (it)->getValue();
+ if( aValue.valid() )
+ {
+ if( aValue.isBuiltinValue() )
+ {
+ anInstanceSymbol->setValue( aValue );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENUM value for "
+ "compileEnumerationSpecifier :>\n"
+ << aValue.toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+// anInstanceSymbol->setValue( mAvmcodeCompiler.
+// decode_compileExpression(aContainer, aValue) );
+ }
+ }
+ else
+ {
+ anInstanceSymbol->setValue( theEnumType->newfreshSymbolValue() );
+ }
+
+ theEnumType->saveSymbolData(anInstanceSymbol);
+ }
+
+ theEnumType->updateSize();
+ theEnumType->updateBound();
+
+ return( bfTS );
+}
+
+
+TypeSpecifier BaseCompiler::compileTypeAliasSpecifier(
+ AvmProgram * aContainer, DataType * aDataType)
+{
+ TypeSpecifier theTypeSpecifier = compileTypeSpecifier(
+ aContainer, aDataType->getTypeSpecifier());
+
+ if( theTypeSpecifier.invalid() )
+ {
+ theTypeSpecifier = TypeManager::UNIVERSAL;
+
+// incrErrorCount();
+ ++AVM_ERROR_COUNT;
+
+ AVM_OS_ERROR_ALERT << "BaseCompiler::compileTypeAliasSpecifier : << "
+ << aDataType->toString() << " >> !!!"
+ << SEND_ALERT;
+ }
+
+ TypeSpecifier bfTS(
+ TypeManager::newTypeAlias(aDataType, theTypeSpecifier) );
+
+ if( aDataType->hasConstraintRoutine() &&
+ aDataType->getConstraintRoutine()->doSomething() )
+ {
+ bfTS.saveConstraint(
+ mAvmcodeCompiler.compileRoutine(
+ this, aContainer, theTypeSpecifier,
+ aDataType->getConstraintRoutine() ) );
+ }
+
+ return( bfTS );
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/builder/compiler/BaseCompiler.h b/org.eclipse.efm.symbex/src/builder/compiler/BaseCompiler.h
new file mode 100644
index 0000000..68d1c38
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/compiler/BaseCompiler.h
@@ -0,0 +1,245 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef BUILDER_COMPILER_BASECOMPILER_H_
+#define BUILDER_COMPILER_BASECOMPILER_H_
+
+#include <common/AvmObject.h>
+
+#include <builder/compiler/BaseCompilerTable.h>
+
+#include <builder/primitive/AvmcodeCompiler.h>
+
+#include <fml/type/TypeSpecifier.h>
+
+
+namespace sep
+{
+
+class AvmcodeCompiler;
+class AvmProgram;
+
+class BaseCompilerTable;
+class BF;
+
+class Configuration;
+
+class DataType;
+
+class ExecutableSystem;
+
+class SymbolTable;
+
+
+class BaseCompiler : public AvmObject
+{
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ Configuration & mConfiguration;
+
+public:
+ /**
+ * ATTRIBUTE
+ */
+ AvmcodeCompiler & mAvmcodeCompiler;
+
+ BaseCompilerTable & mCompilerTable;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BaseCompiler(Configuration & aConfiguration,
+ AvmcodeCompiler & anAvmcodeCompiler)
+ : AvmObject( ),
+ mConfiguration( aConfiguration ),
+ mAvmcodeCompiler( anAvmcodeCompiler ),
+ mCompilerTable( anAvmcodeCompiler.mCompilerTable )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ BaseCompiler(BaseCompiler & aBaseCompiler)
+ : AvmObject( ),
+ mConfiguration( aBaseCompiler.mConfiguration ),
+ mAvmcodeCompiler( aBaseCompiler.mAvmcodeCompiler ),
+ mCompilerTable( aBaseCompiler.mCompilerTable )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BaseCompiler()
+ {
+ //!! NOTHING
+ }
+
+
+ /*
+ * GETTER
+ * mConfiguration
+ */
+ inline Configuration & getConfiguration()
+ {
+ return( mConfiguration );
+ }
+
+
+ /*
+ * GETTER
+ * theSymbolTable
+ */
+ inline SymbolTable & getSymbolTable()
+ {
+ return( mCompilerTable.getSymbolTable() );
+ }
+
+ /*
+ * GETTER
+ * theErrorCount
+ */
+ inline avm_size_t getErrorCount()
+ {
+ return( mCompilerTable.getErrorCount() );
+ }
+
+ inline bool hasError() const
+ {
+ return( mCompilerTable.hasError() );
+ }
+
+ inline bool hasZeroError() const
+ {
+ return( mCompilerTable.hasZeroError() );
+ }
+
+ inline avm_size_t incrErrorCount()
+ {
+ return( mCompilerTable.incrErrorCount() );
+ }
+
+
+ /*
+ * GETTER
+ * theWarningCount
+ */
+ inline avm_size_t getWarningCount()
+ {
+ return( mCompilerTable.getWarningCount() );
+ }
+
+ inline bool hasWarning() const
+ {
+ return( mCompilerTable.hasWarning() );
+ }
+
+ inline bool hasZeroWarning() const
+ {
+ return( mCompilerTable.hasZeroWarning() );
+ }
+
+ inline avm_size_t incrWarningCount()
+ {
+ return( mCompilerTable.incrWarningCount() );
+ }
+
+
+ /**
+ * REPORT
+ */
+ void reportCompilation(OutStream & os) const
+ {
+ mCompilerTable.reportCompilation(os);
+ }
+
+
+ inline bool hasErrorWarning() const
+ {
+ return( mCompilerTable.hasError() || mCompilerTable.hasWarning() );
+ }
+
+ inline void resetErrorWarning()
+ {
+ mCompilerTable.resetErrorWarning();
+ }
+
+
+ /**
+ * METHODS
+ * start
+ */
+ virtual bool start()
+ {
+ //!! NOTHING
+
+ return( true );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // TYPE SPECIFIER [ PRE ] COMPILATION
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ void precompileTypeSpecifier(
+ AvmProgram * aContainer, const BF & aDataType);
+
+
+ TypeSpecifier compileTypeSpecifier(
+ AvmProgram * aContainer, const std::string & aTypeID);
+
+ TypeSpecifier compileTypeSpecifier(
+ AvmProgram * aContainer, const BF & bfType);
+
+ TypeSpecifier compileStructureSpecifier(
+ AvmProgram * aContainer, DataType * aStructureT);
+
+ TypeSpecifier compileChoiceSpecifier(
+ AvmProgram * aContainer, DataType * aChoiceT);
+
+ TypeSpecifier compileUnionSpecifier(
+ AvmProgram * aContainer, DataType * anUnionT);
+
+ TypeSpecifier compileContainerSpecifier(
+ AvmProgram * aContainer, DataType * aCollectionT);
+
+ TypeSpecifier compileIntervalSpecifier(
+ AvmProgram * aContainer, DataType * anIntervalT);
+
+ TypeSpecifier compileEnumerationSpecifier(
+ AvmProgram * aContainer, DataType * anEnumT);
+
+ TypeSpecifier compileTypeAliasSpecifier(
+ AvmProgram * aContainer, DataType * aDataType);
+
+
+
+
+};
+
+
+}
+
+#endif /* BUILDER_COMPILER_BASECOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/compiler/BaseCompilerTable.h b/org.eclipse.efm.symbex/src/builder/compiler/BaseCompilerTable.h
new file mode 100644
index 0000000..3965d4c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/compiler/BaseCompilerTable.h
@@ -0,0 +1,261 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 18 sept. 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BUILDER_COMPILER_BASECOMPILERTABLE_H_
+#define BUILDER_COMPILER_BASECOMPILERTABLE_H_
+
+#include <common/AvmPointer.h>
+#include <common/AvmObject.h>
+
+#include <builder/compiler/SymbolTable.h>
+
+
+namespace sep
+{
+
+
+class BaseCompilerTable : public AvmObject
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( BaseCompilerTable )
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ SymbolTable mSymbolTable;
+
+ avm_size_t mErrorCount;
+
+ avm_size_t mWarningCount;
+
+ StringOutStream ERROR_OS;
+
+ StringOutStream WARNING_OS;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BaseCompilerTable(Configuration & aConfiguration)
+ : AvmObject( ),
+ mSymbolTable( aConfiguration ),
+ mErrorCount( 0 ),
+ mWarningCount( 0 ),
+ ERROR_OS( ),
+ WARNING_OS( )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ BaseCompilerTable(const BaseCompilerTable & aCompilerTable)
+ : AvmObject( aCompilerTable ),
+ mSymbolTable( aCompilerTable.mSymbolTable ),
+ mErrorCount( aCompilerTable.mErrorCount ),
+ mWarningCount( aCompilerTable.mWarningCount ),
+ ERROR_OS(),
+ WARNING_OS()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BaseCompilerTable()
+ {
+ //!! NOTHING
+ }
+
+
+ /*
+ * GETTER
+ * mSymbolTable
+ */
+ inline SymbolTable & getSymbolTable()
+ {
+ return( mSymbolTable );
+ }
+
+
+ /*
+ * GETTER
+ * mErrorCount
+ */
+ inline avm_size_t getErrorCount()
+ {
+ return( mErrorCount );
+ }
+
+ inline bool hasError() const
+ {
+ return( mErrorCount > 0 );
+ }
+
+ inline bool hasZeroError() const
+ {
+ return( mErrorCount == 0 );
+ }
+
+ inline avm_size_t incrErrorCount()
+ {
+ return( ++mErrorCount );
+ }
+
+ inline void resetErrorCount()
+ {
+ mErrorCount = 0;
+ }
+
+
+ /*
+ * GETTER
+ * mWarningCount
+ */
+ inline avm_size_t getWarningCount()
+ {
+ return( mWarningCount );
+ }
+
+ inline bool hasWarning() const
+ {
+ return( mWarningCount > 0 );
+ }
+
+ inline bool hasZeroWarning() const
+ {
+ return( mWarningCount == 0 );
+ }
+
+ inline avm_size_t incrWarningCount()
+ {
+ return( ++mWarningCount );
+ }
+
+ inline void resetWarningCount()
+ {
+ mWarningCount = 0;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * ERROR_OS
+ */
+ inline std::string getErrorMessage()
+ {
+ return( ERROR_OS.str() );
+ }
+
+ inline bool hasErrorMessage() const
+ {
+ return( ! (ERROR_OS.str().empty()) );
+ }
+
+
+ inline void addErrorMessage(const std::string & anErrorMessage)
+ {
+ if( hasErrorMessage() )
+ {
+ ERROR_OS << "\n";
+ }
+ ERROR_OS << anErrorMessage;
+ }
+
+
+ inline void resetError()
+ {
+ ERROR_OS.str("");
+ }
+
+ inline void setErrorMessage(const std::string & anErrorMessage)
+ {
+ resetError();
+ ERROR_OS << anErrorMessage;
+ }
+
+
+
+ /**
+ * GETTER - SETTER
+ * WARNING_OS
+ */
+ inline std::string getWarningMessage()
+ {
+ return( WARNING_OS.str() );
+ }
+
+ inline bool hasWarningMessage() const
+ {
+ return( ! (WARNING_OS.str().empty()) );
+ }
+
+
+ inline void addWarningMessage(const std::string & anWarningMessage)
+ {
+ if( hasWarningMessage() )
+ {
+ WARNING_OS << "\n";
+ }
+ WARNING_OS << anWarningMessage;
+ }
+
+
+ inline void resetWarning()
+ {
+ WARNING_OS.str("");
+ }
+
+ inline void setWarningMessage(const std::string & anWarningMessage)
+ {
+ resetWarning();
+ WARNING_OS << anWarningMessage;
+ }
+
+
+ /**
+ * REPORT
+ */
+ void reportCompilation(OutStream & os) const
+ {
+ os << _SEW_ << "Compilation report:> " << mErrorCount
+ << " error" << ((mErrorCount > 1)? "s " : " ")
+ << mWarningCount << " warning"
+ << ((mWarningCount > 1)? "s" : "") << EOL_FLUSH;
+ }
+
+ inline void resetErrorWarning()
+ {
+ resetError();
+ resetErrorCount();
+
+ resetWarningCount();
+ resetWarning();
+ }
+
+};
+
+
+}
+
+#endif /* BUILDER_COMPILER_BASECOMPILERTABLE_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/compiler/BaseMachineCompiler.cpp b/org.eclipse.efm.symbex/src/builder/compiler/BaseMachineCompiler.cpp
new file mode 100644
index 0000000..8b1d00f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/compiler/BaseMachineCompiler.cpp
@@ -0,0 +1,765 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 22 nov. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "BaseMachineCompiler.h"
+
+#include <builder/primitive/AvmcodeCompiler.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/executable/AvmProgram.h>
+#include <fml/executable/BaseInstanceForm.h>
+#include <fml/executable/ExecutableLib.h>
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/ExecutableSystem.h>
+
+#include <sew/Configuration.h>
+
+
+namespace sep
+{
+
+
+/**
+ *******************************************************************************
+ * POST-COMPILATION OF EXECUTABLE
+ *******************************************************************************
+ */
+
+void BaseMachineCompiler::postcompileExecutableSystem()
+{
+ TableOfExecutableForm::const_raw_iterator itExec =
+ getConfiguration().getExecutableSystem().getExecutables().begin();
+ TableOfExecutableForm::const_raw_iterator endExec =
+ getConfiguration().getExecutableSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ optimizeExecutable( itExec );
+ }
+
+ // Optimize the system Instance
+ InstanceOfMachine * theSystemInstance = getConfiguration().
+ getExecutableSystem().getSystemInstance().rawMachine();
+ optimizeInstance( theSystemInstance->getExecutable(), theSystemInstance );
+}
+
+
+void BaseMachineCompiler::optimizeExecutable(ExecutableForm * anExecutableForm)
+{
+ if( anExecutableForm->isOptimizedFlag() )
+ {
+ return;
+ }
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ AVM_OS_TRACE << INCR_INDENT_TAB
+ << "< begin postcompiling executable routine:> "
+ << anExecutableForm->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ // Optimize all routines which defined the executable's behavior
+ optimizeAllBehavioralRoutines( anExecutableForm );
+
+ // Optimize all instance of machine parameters
+ optimizeInstance( anExecutableForm );
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << "> end postcompiling executable routine:> "
+ << anExecutableForm->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ anExecutableForm->setOptimizedFlag();
+}
+
+
+
+void BaseMachineCompiler::optimizeAllBehavioralRoutines(
+ ExecutableForm * anExecutableForm)
+{
+// AVM_OS_TRACE << TAB << "<| optimizing<machine>: "
+// << anExecutableForm->getFullyQualifiedNameID() << std::endl;
+
+
+ /*
+ * onRead / onWrite routines of data
+ */
+ mAvmcodeCompiler.optimizeDataRoutine( anExecutableForm );
+
+
+ /*
+ * onCreate
+ */
+ if( anExecutableForm->hasOnCreate() )
+ {
+ anExecutableForm->setOnCreate(
+ mAvmcodeCompiler.optimizeStatement(
+ anExecutableForm,
+ anExecutableForm->getOnCreate()) );
+ }
+
+ /*
+ * onInit
+ */
+ if( anExecutableForm->hasOnInit() )
+ {
+ anExecutableForm->setOnInit(
+ mAvmcodeCompiler.optimizeStatement(
+ anExecutableForm,
+ anExecutableForm->getOnInit()) );
+ }
+
+ /*
+ * onExit
+ */
+ if( anExecutableForm->hasOnFinal() )
+ {
+ anExecutableForm->setOnFinal(
+ mAvmcodeCompiler.optimizeStatement(
+ anExecutableForm,
+ anExecutableForm->getOnFinal()) );
+ }
+
+
+ /*
+ * onStart
+ */
+ if( anExecutableForm->hasOnStart() )
+ {
+ anExecutableForm->setOnStart(
+ mAvmcodeCompiler.optimizeStatement(
+ anExecutableForm,
+ anExecutableForm->getOnStart()) );
+ }
+
+ /*
+ * onStop
+ */
+ if( anExecutableForm->hasOnStop() )
+ {
+ anExecutableForm->setOnStop(
+ mAvmcodeCompiler.optimizeStatement(
+ anExecutableForm,
+ anExecutableForm->getOnStop()) );
+ }
+
+
+ /*
+ * onIEnable
+ */
+ if( anExecutableForm->hasOnIEnable() )
+ {
+ anExecutableForm->setOnIEnable(
+ mAvmcodeCompiler.optimizeStatement(
+ anExecutableForm,
+ anExecutableForm->getOnIEnable()) );
+ }
+
+ /*
+ * onEnable
+ */
+ if( anExecutableForm->hasOnEnable() )
+ {
+ anExecutableForm->setOnEnable(
+ mAvmcodeCompiler.optimizeStatement(
+ anExecutableForm,
+ anExecutableForm->getOnEnable()) );
+ }
+
+
+ /*
+ * onIDisable
+ */
+ if( anExecutableForm->hasOnIDisable() )
+ {
+ anExecutableForm->setOnIDisable(
+ mAvmcodeCompiler.optimizeStatement(
+ anExecutableForm,
+ anExecutableForm->getOnIDisable()) );
+ }
+
+ /*
+ * onDisable
+ */
+ if( anExecutableForm->hasOnDisable() )
+ {
+ anExecutableForm->setOnDisable(
+ mAvmcodeCompiler.optimizeStatement(
+ anExecutableForm,
+ anExecutableForm->getOnDisable()) );
+ }
+
+
+ /*
+ * onIAbort
+ */
+ if( anExecutableForm->hasOnIAbort() )
+ {
+ anExecutableForm->setOnIAbort(
+ mAvmcodeCompiler.optimizeStatement(
+ anExecutableForm,
+ anExecutableForm->getOnIAbort()) );
+ }
+
+ /*
+ * onAbort
+ */
+ if( anExecutableForm->hasOnAbort() )
+ {
+ anExecutableForm->setOnAbort(
+ mAvmcodeCompiler.optimizeStatement(
+ anExecutableForm,
+ anExecutableForm->getOnAbort()) );
+ }
+
+
+ /*
+ * onIRun
+ */
+ if( anExecutableForm->hasOnIRun() )
+ {
+ anExecutableForm->setOnIRun(
+ mAvmcodeCompiler.optimizeStatement(
+ anExecutableForm,
+ anExecutableForm->getOnIRun()) );
+ }
+
+ /*
+ * onRun
+ */
+ if( anExecutableForm->hasOnRun() )
+ {
+ anExecutableForm->setOnRun(
+ mAvmcodeCompiler.optimizeStatement(
+ anExecutableForm,
+ anExecutableForm->getOnRun()) );
+ }
+ else if( anExecutableForm->hasOnIRun() )
+ {
+ anExecutableForm->setOnRun( anExecutableForm->getOnIRun() );
+ }
+
+
+ /*
+ * onRtc
+ */
+ if( anExecutableForm->hasOnRtc() )
+ {
+ anExecutableForm->setOnRtc(
+ mAvmcodeCompiler.optimizeStatement(
+ anExecutableForm,
+ anExecutableForm->getOnRtc()) );
+ }
+
+
+ /*
+ * onConcurrency
+ */
+ if( anExecutableForm->hasOnConcurrency() )
+ {
+ if( not StatementTypeChecker::isEmptySchedule(
+ anExecutableForm->getOnConcurrency()) )
+ {
+ anExecutableForm->setOnConcurrency(
+ mAvmcodeCompiler.optimizeStatement(
+ anExecutableForm,
+ anExecutableForm->getOnConcurrency()) );
+ }
+ }
+
+ /*
+ * onSchedule
+ */
+ if( anExecutableForm->hasOnSchedule() )
+ {
+ anExecutableForm->setOnSchedule(
+ optimizeSchedulingRoutine(
+ anExecutableForm,
+ anExecutableForm->getOnSchedule() ) );
+ }
+
+ /*
+ * onSynchronize
+ */
+ if( anExecutableForm->hasOnSynchronize() )
+ {
+ anExecutableForm->setOnSynchronize(
+ mAvmcodeCompiler.optimizeStatement(
+ anExecutableForm,
+ anExecutableForm->getOnSynchronize()) );
+ }
+
+
+ /*
+ * all Transition
+ */
+ AvmTransition * itTransition;
+ avm_size_t endOffset = anExecutableForm->getTransition().size();
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itTransition = anExecutableForm->getTransition().rawAt(offset);
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ AVM_OS_TRACE << INCR_INDENT_TAB
+ << "< begin postcompiling transition:> "
+ << itTransition->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ // Optimize all program routine
+ mAvmcodeCompiler.optimizeProgramRoutine( itTransition );
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << "> end postcompiling transition:> "
+ << itTransition->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+ }
+
+
+ /*
+ * all Program
+ */
+ AvmProgram * itProg;
+ endOffset = anExecutableForm->getProgram().size();
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itProg = anExecutableForm->getProgram().rawAt(offset);
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ AVM_OS_TRACE << INCR_INDENT_TAB
+ << "< begin postcompiling avm_program:> "
+ << itProg->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ // Optimize all program routine
+ mAvmcodeCompiler.optimizeProgramRoutine( itProg );
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << "> end postcompiling avm_program:> "
+ << itProg->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+ }
+
+// AVM_OS_TRACE << TAB << ">| optimizing<machine>: "
+// << anExecutableForm->getFullyQualifiedNameID() << std::endl << std::endl;
+}
+
+
+
+void BaseMachineCompiler::optimizeInstance(ExecutableForm * anExecutableForm)
+{
+//AVM_OS_TRACE << TAB << "<| optimizing<machine>: "
+// << anExecutableForm->getFullyQualifiedNameID() << std::endl;
+
+ /*
+ * all Program
+ */
+ if( anExecutableForm->hasInstanceStatic() )
+ {
+ TableOfSymbol::const_iterator itMachine =
+ anExecutableForm->instance_static_begin();
+ TableOfSymbol::const_iterator endMachine =
+ anExecutableForm->instance_static_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ optimizeInstance(anExecutableForm, (*itMachine).rawMachine());
+ }
+ }
+
+ if( anExecutableForm->hasInstanceDynamic() )
+ {
+ TableOfSymbol::const_iterator itMachine =
+ anExecutableForm->instance_dynamic_begin();
+ TableOfSymbol::const_iterator endMachine =
+ anExecutableForm->instance_dynamic_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ optimizeInstance(anExecutableForm, (*itMachine).rawMachine());
+ }
+ }
+
+//AVM_OS_TRACE << TAB << ">| optimizing<machine>: "
+// << anExecutableForm->getFullyQualifiedNameID() << std::endl << std::endl;
+}
+
+
+
+void BaseMachineCompiler::optimizeInstance(
+ ExecutableForm * theExecutableContainer, InstanceOfMachine * anInstance)
+{
+ AVM_IF_DEBUG_FLAG( COMPILING )
+ AVM_OS_TRACE << INCR_INDENT_TAB
+ << "< begin postcompiling instance of machine parameter :> "
+ << str_header( anInstance ) << std::endl;
+ AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ // Optimize all instance routine
+ mAvmcodeCompiler.optimizeInstance( theExecutableContainer, anInstance );
+
+ AVM_IF_DEBUG_FLAG( COMPILING )
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << "> end postcompiling instance of machine parameter :> "
+ << str_header( anInstance ) << std::endl;
+ AVM_ENDIF_DEBUG_FLAG( COMPILING )
+}
+
+
+/**
+ * COMPILING EXECUTABLE SCHEDULER
+ * Specific because of dynamic instantiation
+ */
+BFCode BaseMachineCompiler::compileSchedulerRoutine(
+ ExecutableForm * anExecutableForm,
+ ListOfInstanceOfMachine & usedInstance,
+ const BFCode & aSchedulerCode)
+{
+ if( aSchedulerCode.invalid() )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "completeSchedulerRoutine:> Unexpected a << null<code> >> !!!"
+ << SEND_EXIT;
+
+ return( aSchedulerCode );
+ }
+ else if( aSchedulerCode->empty() )
+ {
+ return( aSchedulerCode );
+ }
+
+ if( aSchedulerCode->singleton()
+ && aSchedulerCode->first().is< InstanceOfMachine >()
+ && OperatorManager::isActivity( aSchedulerCode->getOperator() ) )
+ {
+ InstanceOfMachine * anInstance =
+ aSchedulerCode->first().to_ptr< InstanceOfMachine >();
+
+ if( anInstance->getSpecifier().isDesignInstanceStatic() )
+ {
+ return( aSchedulerCode );
+ }
+
+ else if( anExecutableForm->hasOnConcurrency() )
+ {
+ BFCode compilCode( anExecutableForm->getOnConcurrencyOperator() );
+
+ compileSchedulerRoutine(anExecutableForm,
+ usedInstance, aSchedulerCode, compilCode);
+
+ return( compilCode );
+ }
+ else if( anInstance->getSpecifier().isDesignPrototypeStatic()
+ && anInstance->isAutoStart() )
+ {
+ return( aSchedulerCode );
+ }
+ else
+ {
+ TableOfSymbol::const_iterator itMachine =
+ anExecutableForm->instance_static_begin();
+ TableOfSymbol::const_iterator endMachine =
+ anExecutableForm->instance_static_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ if( anInstance->getSpecifier().hasDesignModel()
+ && (anInstance != (*itMachine).rawMachine())
+ && (*itMachine).isInstanceModel( anInstance )
+ && (not usedInstance.contains((*itMachine).rawMachine())) )
+ {
+ usedInstance.append( (*itMachine).rawMachine() );
+
+ return( StatementConstructor::newCode(
+ aSchedulerCode->getOperator(), (*itMachine)) );
+ }
+ }
+
+ AVM_OS_FATAL_ERROR_EXIT
+ << "completeSchedulerRoutine:> Failed !!!\n"
+ << aSchedulerCode
+ << SEND_EXIT;
+
+ return( aSchedulerCode );
+ }
+ }
+
+ else
+ {
+ BFCode compilCode( aSchedulerCode->getOperator() );
+
+ AvmCode::iterator itArg = aSchedulerCode->begin();
+ AvmCode::iterator endArg = aSchedulerCode->end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ if( (*itArg).is< AvmCode >() )
+ {
+ compileSchedulerRoutine(anExecutableForm,
+ usedInstance, (*itArg).bfCode(), compilCode);
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "completeSchedulerRoutine:> Unexpected arg :>\n"
+ << (*itArg)
+ << SEND_EXIT;
+
+ compilCode->append( *itArg );
+ }
+ }
+
+ return( compilCode );
+ }
+}
+
+
+void BaseMachineCompiler::compileSchedulerRoutine(
+ ExecutableForm * anExecutableForm,
+ ListOfInstanceOfMachine & usedInstance,
+ const BFCode & aSchedulerCode, BFCode & compilCode)
+{
+ if( aSchedulerCode->singleton() &&
+ aSchedulerCode->first().is< InstanceOfMachine >() &&
+ OperatorManager::isActivity( aSchedulerCode->getOperator() ) )
+ {
+ InstanceOfMachine * anInstance =
+ aSchedulerCode->first().to_ptr< InstanceOfMachine >();
+
+ if( anInstance->getSpecifier().isDesignInstanceStatic() )
+ {
+ compilCode.append( aSchedulerCode );
+ }
+ else
+ {
+ BFCode modelScheduler;
+
+ if( anInstance->getSpecifier().isDesignPrototypeStatic() )
+ {
+ if( anInstance->isAutoStart() )
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( compilCode->nonempty()
+ || (anInstance->getExecutable() != anExecutableForm) )
+ << "Infinite recursive loop detection with "
+ "instance << " << str_header( anInstance )
+ << " >> in the schedule code of the executable << "
+ << str_header( anExecutableForm ) << " >> !!!"
+ << SEND_EXIT;
+
+ compilCode.append( aSchedulerCode );
+ }
+
+ if( anInstance->hasInstanceModel() )
+ {
+ anInstance = anInstance->getInstanceModel();
+
+ modelScheduler = StatementConstructor::newCode(
+ aSchedulerCode->getOperator(), INCR_BF(anInstance) );
+ }
+ else
+ {
+ AVM_OS_ASSERT_WARNING_ALERT(
+ not anInstance->getSpecifier().isComponentSystem() )
+ << "Unexpected the system instance << "
+ << str_header( anInstance )
+ << " >> in the schedule code of the executable << "
+ << str_header( anExecutableForm ) << " >> !!!"
+ << SEND_EXIT;
+ }
+ }
+ else
+ {
+ modelScheduler = aSchedulerCode;
+ }
+
+ TableOfSymbol::const_iterator itMachine =
+ anExecutableForm->instance_static_begin();
+ TableOfSymbol::const_iterator endMachine =
+ anExecutableForm->instance_static_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ if( anInstance == (*itMachine).getInstanceModel() &&
+ (not usedInstance.contains((*itMachine).rawMachine())) )
+ {
+ compilCode->append( StatementConstructor::newCode(
+ aSchedulerCode->getOperator(), (*itMachine)) );
+
+ usedInstance.append( (*itMachine).rawMachine() );
+ }
+ }
+
+ if( modelScheduler.valid() )
+ {
+ compilCode.append( modelScheduler );
+ }
+ }
+ }
+ else
+ {
+ compilCode->append( compileSchedulerRoutine(
+ anExecutableForm, usedInstance, aSchedulerCode) );
+ }
+}
+
+
+BFCode BaseMachineCompiler::compileSchedulerRoutine(
+ ExecutableForm * anExecutableForm, const BFCode & aCode)
+{
+ if( OperatorManager::isSchedule( aCode->getOperator() ) )
+ {
+ BFCode schedCode( aCode->getOperator() );
+
+ AvmCode::iterator itArg = aCode->begin();
+ AvmCode::iterator endArg = aCode->end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ if( (*itArg).is< AvmCode >() )
+ {
+ schedCode->append( compileSchedulerRoutine(
+ anExecutableForm, (*itArg).bfCode() ) );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "compileSchedulerRoutine:> Unexpected arg :>\n"
+ << (*itArg)
+ << SEND_EXIT;
+
+ schedCode->append( *itArg );
+ }
+ }
+
+ return( schedCode );
+ }
+ else if( OperatorManager::isActivity( aCode->getOperator() ) )
+ {
+ return( mAvmcodeCompiler.compileStatement(anExecutableForm, aCode) );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "compileSchedulerRoutine:> Unexpected code :>\n" << aCode
+ << SEND_EXIT;
+
+ return( aCode );
+ }
+}
+
+
+BFCode BaseMachineCompiler::optimizeSchedulingRoutine(
+ ExecutableForm * anExecutableForm, const BFCode & aSchedulerCode)
+{
+ if( aSchedulerCode.invalid() )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "completeSchedulerRoutine:> Unexpected a << null<code> >> !!!"
+ << SEND_EXIT;
+
+ return( aSchedulerCode );
+ }
+ else if( aSchedulerCode->empty() )
+ {
+ return( aSchedulerCode );
+ }
+
+ if( aSchedulerCode->singleton() &&
+ aSchedulerCode->first().is< InstanceOfMachine >() &&
+ OperatorManager::isActivity( aSchedulerCode->getOperator() ) )
+ {
+ InstanceOfMachine * anInstance =
+ aSchedulerCode->first().to_ptr< InstanceOfMachine >();
+
+ if( anInstance->getSpecifier().isDesignInstanceStatic() )
+ {
+ return( aSchedulerCode );
+ }
+
+ else if( anInstance->getSpecifier().isDesignPrototypeStatic() )
+ {
+ if( anInstance->isAutoStart() )
+ {
+ return( aSchedulerCode );
+ }
+ else if( anInstance->hasPossibleDynamicInstanciation() )
+ {
+ return( StatementConstructor::newCode(
+ aSchedulerCode->getOperator(),
+ INCR_BF(anInstance->getInstanceModel()) ) );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "optimizeSchedulingRoutine:> "
+ "Unexpected non auto-start prototype machine :>\n"
+ << to_stream( anInstance )
+ << SEND_EXIT;
+
+ return( aSchedulerCode );
+ }
+ }
+
+ else if( anInstance->getSpecifier().isDesignModel() )
+ {
+ if( anInstance->hasPossibleDynamicInstanciation() )
+ {
+ return( aSchedulerCode );
+ }
+ else
+ {
+ return( BFCode::REF_NULL );
+ }
+ }
+ }
+
+ else
+ {
+ BFCode optiCode( aSchedulerCode->getOperator() );
+ BFCode argCode;
+
+ AvmCode::iterator itArg = aSchedulerCode->begin();
+ AvmCode::iterator endArg = aSchedulerCode->end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ if( (*itArg).is< AvmCode >() )
+ {
+ argCode = optimizeSchedulingRoutine(
+ anExecutableForm, (*itArg).bfCode() );
+
+ if( argCode.valid() )
+ {
+ optiCode->append( argCode );
+ }
+ }
+ else
+ {
+ optiCode->append( *itArg );
+ }
+ }
+
+ if( optiCode->empty() )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "optimizeSchedulingRoutine:> "
+ "Unexpected scheduler code :>\n"
+ << aSchedulerCode
+ << SEND_EXIT;
+ }
+
+ return( optiCode );
+ }
+
+ return( aSchedulerCode );
+// return( mAvmcodeCompiler.optimizeStatement(anExecutableForm, aCode) );
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/builder/compiler/BaseMachineCompiler.h b/org.eclipse.efm.symbex/src/builder/compiler/BaseMachineCompiler.h
new file mode 100644
index 0000000..68bcec2
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/compiler/BaseMachineCompiler.h
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 22 nov. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BUILDER_COMPILER_BASEMACHINECOMPILER_H_
+#define BUILDER_COMPILER_BASEMACHINECOMPILER_H_
+
+#include <builder/compiler/BaseCompiler.h>
+
+
+namespace sep
+{
+
+
+class AvmcodeCompiler;
+class ExecutableForm;
+class InstanceOfMachine;
+
+
+class BaseMachineCompiler : public BaseCompiler
+{
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BaseMachineCompiler(Configuration & aConfiguration,
+ AvmcodeCompiler & anAvmcodeCompiler)
+ : BaseCompiler( aConfiguration , anAvmcodeCompiler )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BaseMachineCompiler()
+ {
+ //!! NOTHING
+ }
+
+
+ /*
+ ***************************************************************************
+ * COMPILING EXECUTABLE - AVMPROGRAM
+ ***************************************************************************
+ */
+ void postcompileExecutableSystem();
+
+ void optimizeExecutable(ExecutableForm * anExecutableForm);
+
+ void optimizeAllBehavioralRoutines(ExecutableForm * anExecutableForm);
+
+ void optimizeInstance(ExecutableForm * anExecutableForm);
+
+ void optimizeInstance(
+ ExecutableForm * theExecutableContainer,
+ InstanceOfMachine * anInstance);
+
+
+
+ /**
+ * COMPILING EXECUTABLE SCHEDULER
+ */
+ BFCode compileSchedulerRoutine(
+ ExecutableForm * anExecutableForm,
+ ListOfInstanceOfMachine & usedInstance,
+ const BFCode & aSchedulerCode);
+
+ void compileSchedulerRoutine(ExecutableForm * anExecutableForm,
+ ListOfInstanceOfMachine & usedInstance,
+ const BFCode & aSchedulerCode, BFCode & compilCode);
+
+ BFCode compileSchedulerRoutine(
+ ExecutableForm * anExecutableForm, const BFCode & aCode);
+
+ BFCode optimizeSchedulingRoutine(
+ ExecutableForm * anExecutableForm, const BFCode & aSchedulerCode);
+
+};
+
+
+} /* namespace sep */
+#endif /* BUILDER_COMPILER_BASEMACHINECOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/compiler/Compiler.cpp b/org.eclipse.efm.symbex/src/builder/compiler/Compiler.cpp
new file mode 100644
index 0000000..1b7a725
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/compiler/Compiler.cpp
@@ -0,0 +1,3574 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "Compiler.h"
+
+#include <builder/analysis/CommunicationDependency.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/ExpressionConstant.h>
+#include <fml/expression/ExpressionFactory.h>
+#include <fml/builtin/Identifier.h>
+#include <fml/expression/StatementTypeChecker.h>
+#include <fml/expression/StatementConstructor.h>
+#include <fml/expression/StatementFactory.h>
+#include <fml/builtin/QualifiedIdentifier.h>
+
+#include <fml/executable/AvmProgram.h>
+#include <fml/executable/AvmTransition.h>
+#include <fml/executable/BaseInstanceForm.h>
+#include <fml/executable/ExecutableLib.h>
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/ExecutableSystem.h>
+#include <fml/executable/InstanceOfBuffer.h>
+#include <fml/executable/InstanceOfData.h>
+#include <fml/executable/InstanceOfMachine.h>
+#include <fml/executable/InstanceOfPort.h>
+#include <fml/executable/RoutingData.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/type/TypeManager.h>
+
+#include <fml/infrastructure/DataType.h>
+#include <fml/infrastructure/Machine.h>
+#include <fml/infrastructure/System.h>
+#include <fml/infrastructure/Transition.h>
+
+#include <fml/infrastructure/BehavioralPart.h>
+#include <fml/infrastructure/CompositePart.h>
+#include <fml/infrastructure/PropertyPart.h>
+
+#include <fml/workflow/UniFormIdentifier.h>
+#include <fml/workflow/WObject.h>
+
+#include <sew/Configuration.h>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+Compiler::Compiler(Configuration & aConfiguration,
+ AvmcodeCompiler & anAvmcodeCompiler)
+: BaseMachineCompiler( aConfiguration, anAvmcodeCompiler ),
+mDataCompiler( *this ),
+mProgramCompiler( *this ),
+mTransitionCompiler( *this ),
+mComCompiler( *this )
+{
+ //!! NOTHING
+}
+
+
+/**
+ * CONFIGURE
+ */
+bool Compiler::configure()
+{
+ if( not mAvmcodeCompiler.configure() )
+ {
+ AVM_OS_ERROR_ALERT << "Compiler::configure:> "
+ "the Avmcode compiler configuration failed !!!"
+ << SEND_ALERT;
+
+ return( false );
+ }
+
+ return( true );
+}
+
+
+/*
+ ******************************************************************************
+ * START
+ ******************************************************************************
+ */
+
+bool Compiler::start(System & aSystem)
+{
+ ExecutableSystem * aExecutableSystem = new ExecutableSystem( aSystem );
+ mConfiguration.setExecutableSystem( aExecutableSystem );
+
+ precompileSystem(aSystem);
+
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ mConfiguration.serializeDebugExecutable( "precompiling" );
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ mComCompiler.updateMessageID();
+
+ compileExecutableSystem();
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ mConfiguration.serializeDebugExecutable( "compiling" );
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+
+ postcompileExecutableSystem();
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+mConfiguration.serializeDebugExecutable( "postcompiling" );
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+
+ return( hasZeroError() );
+}
+
+/**
+ *******************************************************************************
+ * PRECOMPILATION
+ *******************************************************************************
+ */
+
+/**
+ * precompile
+ * declaration
+ */
+void Compiler::precompilePropertyPart(ExecutableForm * anExecutable,
+ PropertyPart & theDeclaration, TableOfInstanceOfData & tableOfVariable)
+{
+ // User Variable-Parameters
+ PropertyPart::const_variable_iterator itVar =
+ theDeclaration.var_parameter_begin();
+ PropertyPart::const_owned_iterator endVar =
+ theDeclaration.var_parameter_end();
+ for( ; itVar != endVar ; ++itVar )
+ {
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( (*itVar) )
+ << "data or type for compiling !!!"
+ << SEND_EXIT;
+
+ // Allocation for variable
+ mDataCompiler.precompileData(anExecutable,
+ (*itVar).to_ptr< Variable >(), tableOfVariable);
+ }
+
+ // User Variable-Returns
+ itVar = theDeclaration.var_return_begin();
+ endVar = theDeclaration.var_return_end();
+ for( ; itVar != endVar ; ++itVar )
+ {
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( (*itVar) )
+ << "data or type for compiling !!!"
+ << SEND_EXIT;
+
+ // Allocation for variable
+ mDataCompiler.precompileData(anExecutable,
+ (*itVar).to_ptr< Variable >(), tableOfVariable);
+ }
+
+ // Other OwnedElements
+ PropertyPart::const_owned_iterator itWfO = theDeclaration.owned_begin();
+ PropertyPart::const_owned_iterator endWfO = theDeclaration.owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( (*itWfO) )
+ << "data or type for compiling !!!"
+ << SEND_EXIT;
+
+ // Allocation for variable
+ if( (*itWfO).is< Variable >() )
+ {
+ Variable * aVariable = (*itWfO).to_ptr< Variable >();
+
+ if( aVariable->getModifier().noNatureParameter() )
+ {
+ mDataCompiler.precompileData(anExecutable,
+ aVariable, tableOfVariable);
+ }
+ }
+
+ // Allocation for buffer
+ else if( (*itWfO).is< Buffer >() )
+ {
+ mComCompiler.precompileBuffer(
+ anExecutable, (*itWfO).to_ptr< Buffer >());
+ }
+
+ // Allocation for port
+ else if( (*itWfO).is< Port >() )
+ {
+// mComCompiler.precompilePort(anExecutable,
+// (*it).to_ptr< Port >(), tableOfVariable);
+ }
+
+ else if( (*itWfO).is< Channel >() )
+ {
+// mComCompiler.precompileChannel(
+// anExecutable, (*it).to_ptr< Channel >());
+ }
+
+ else if( (*itWfO).is< Machine >() )
+ {
+// precompileInstanceStatic(
+// anExecutable, (*it).to_ptr< Machine >());
+ }
+
+ // Allocation for typedef
+ else if( (*itWfO).is< DataType >() )
+ {
+ precompileTypeSpecifier(anExecutable, (*itWfO));
+ }
+ }
+
+ // Allocation for ports / signals
+ mComCompiler.precompileComPoint(
+ anExecutable, theDeclaration, tableOfVariable);
+
+ // Allocation for channels
+ mComCompiler.precompileChannel(anExecutable,
+ theDeclaration, tableOfVariable);
+}
+
+
+void Compiler::precompileDataType(AvmProgram * aProgram,
+ PropertyPart & theDeclaration, TableOfInstanceOfData & tableOfVariable)
+{
+ PropertyPart::const_owned_iterator it = theDeclaration.owned_begin();
+ PropertyPart::const_owned_iterator endIt = theDeclaration.owned_end();
+ for( ; it != endIt ; ++it )
+ {
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( (*it) )
+ << "data or type for compiling !!!"
+ << SEND_EXIT;
+
+ // Allocation for variable
+ if( (*it).is< Variable >() )
+ {
+ mDataCompiler.precompileData(aProgram,
+ (*it).to_ptr< Variable >(), tableOfVariable);
+ }
+
+ // Allocation for typedef
+ else
+ {
+ precompileTypeSpecifier(aProgram, (*it));
+ }
+ }
+}
+
+
+/**
+ * precompile
+ * specification
+ */
+void Compiler::precompileExecutableCompositePart(
+ ExecutableForm * aContainer, Machine * anExecutableSpec)
+{
+ CompositePart * aCompositePart = anExecutableSpec->getCompositePart();
+
+ if( aCompositePart == NULL )
+ {
+ //!! NOTHING
+ return;
+ }
+
+ /*
+ * precompiling procedure
+ */
+ if( aCompositePart->hasProcedure() )
+ {
+ CompositePart::const_procedure_iterator it =
+ aCompositePart->procedure_begin();
+ CompositePart::const_procedure_iterator endIt =
+ aCompositePart->procedure_end();
+ for( ; it != endIt ; ++it )
+ {
+ precompileExecutable(aContainer, (it));
+ }
+ }
+
+ /*
+ * precompiling executable - instance static
+ */
+ if( aCompositePart->hasMachine() )
+ {
+ // precompiling sub-executable
+ anExecutableSpec->expandGroupStatemachine();
+
+ CompositePart::const_machine_iterator it =
+ aCompositePart->machine_begin();
+ CompositePart::const_machine_iterator endIt =
+ aCompositePart->machine_end();
+ for( ; it != endIt ; ++it )
+ {
+ precompileExecutable(aContainer, (it));
+ }
+ }
+
+ /*
+ * precompiling instance dynamic
+ */
+ if( aCompositePart->hasInstanceDynamic() )
+ {
+ CompositePart::const_machine_iterator it =
+ aCompositePart->instance_dynamic_begin();
+ CompositePart::const_machine_iterator endIt =
+ aCompositePart->instance_dynamic_end();
+ for( ; it != endIt ; ++it )
+ {
+// if( (it)->getSpecifier().isDesignInstanceDynamic() )
+ {
+ precompileExecutableInstanceDynamique(aContainer, (it));
+ }
+ }
+ }
+}
+
+
+void Compiler::precompileExecutable(
+ ExecutableForm * aContainer, Machine * anExecutableSpec)
+{
+ if( anExecutableSpec->getSpecifier().hasGroupMask() )
+ {
+ precompileExecutableGroup(aContainer, anExecutableSpec);
+ }
+ else if( anExecutableSpec->getSpecifier().isDesignModel())
+ {
+ precompileExecutableModel(aContainer, anExecutableSpec);
+ }
+ else if( anExecutableSpec->getSpecifier().isDesignPrototypeStatic() )
+ {
+ precompileExecutablePrototype(aContainer, anExecutableSpec);
+ }
+ else if( anExecutableSpec->getSpecifier().isDesignInstanceStatic() )
+ {
+ precompileExecutableInstanceStatic(aContainer, anExecutableSpec);
+ }
+ else if( anExecutableSpec->getSpecifier().isDesignInstanceDynamic() )
+ {
+ precompileExecutableInstanceDynamique(aContainer, anExecutableSpec);
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected in precompiling stage the executable: "
+ << std::endl << str_header( anExecutableSpec ) << std::endl
+ << "==> with specifier: "
+ << anExecutableSpec->getSpecifier().str() << " !!!"
+ << SEND_EXIT;
+ }
+}
+
+
+ExecutableForm * Compiler::precompileExecutableModel(
+ ExecutableForm * aContainer, Machine * anExecutableSpec)
+{
+//AVM_OS_CERR << TAB << "<** begin precompiling executable model:>"
+// << std::endl << str_header( anExecutableSpec ) << std::endl;
+
+ // CREATE NEW EXECUTABLE
+ ExecutableForm * anExec = new ExecutableForm(
+ mConfiguration.getExecutableSystem(),
+ aContainer, anExecutableSpec);
+
+ setInheritedSpecifier(aContainer, anExec);
+
+ // APPEND NEW EXECUTABLE IN THE SYSTEM
+// //?? For retrocompatibity serialization order
+// getSymbolTable().addMachineExecutable(
+// mExecutableSystem->saveExecutable( anExec ) );
+
+ avm_size_t maximalInstanceCount = anExecutableSpec->hasInstanceSpecifier()
+ ? anExecutableSpec->getInstanceSpecifier()->getMaximalInstanceCount()
+ : AVM_NUMERIC_MAX_SIZE_T;
+
+ //??? Sera fait dans precompileExecutableInstanceXXX(...) ?
+// anExec->incrPossibleStaticInstanciationCount( createdInstanceCount );
+
+ if( anExecutableSpec->getSpecifier().isFamilyComponentComposite() )
+ {
+ Specifier aSpecifier( anExecutableSpec->getSpecifier() );
+
+ InstanceOfMachine * aModelInstance = new InstanceOfMachine(
+ aContainer, anExecutableSpec, anExec, NULL,
+ aContainer->getInstanceModel().size(),
+ aSpecifier.setDesignModel() );
+
+ //??? Sera fait dans precompileExecutableInstanceXXX(...) ?
+ aModelInstance->setInstanceCount(
+ /*createdInstanceCount*/0, maximalInstanceCount);
+
+ aContainer->saveInstanceModel( aModelInstance );
+ }
+
+ /*
+ * Allocation of declaration contents :>
+ * constant, variable, typedef, buffer, port
+ */
+ TableOfInstanceOfData tableOfVariable;
+
+ if( anExecutableSpec->hasProperty() )
+ {
+ avm_offset_t parametersCount = anExecutableSpec->
+ getPropertyPart().getVariableParametersCount();
+
+ anExec->setParamOffsetCount( 0 , parametersCount );
+
+ anExec->setReturnOffsetCount( parametersCount, anExecutableSpec->
+ getPropertyPart().getVariableReturnsCount() );
+
+ precompilePropertyPart(anExec,
+ anExecutableSpec->getPropertyPart(), tableOfVariable);
+ }
+
+ /*
+ * Update data table
+ */
+ anExec->setData(tableOfVariable);
+
+
+ /*
+ * precompiling executable composite part
+ */
+ if( anExecutableSpec->hasMachine() || anExecutableSpec->hasPortSignal() )
+ {
+ Specifier aSpecifier( anExecutableSpec->getSpecifier() );
+
+ // Set the instance THIS at first position (index = 0)
+ InstanceOfMachine * aNewInstance =
+ InstanceOfMachine::newInstanceModelThis(
+ anExec, anExecutableSpec, anExec, NULL,
+ anExec->getInstanceModel().size(),
+ aSpecifier.setDesignModel() );
+
+ anExec->saveInstanceModel(aNewInstance);
+
+ aNewInstance = InstanceOfMachine::newThis(anExec,
+ aNewInstance, anExec->getInstanceStatic().size() );
+// aNewInstance->setAutoStart( anExecutableSpec->hasInitialInstance() );
+
+ anExec->saveInstanceStatic(aNewInstance);
+ }
+
+ precompileExecutableCompositePart(anExec, anExecutableSpec);
+
+
+ /*
+ * precompiling transition
+ */
+ if( anExecutableSpec->hasOutgoingTransition() )
+ {
+ BehavioralPart::const_transition_iterator it = anExecutableSpec->
+ getBehavior()->outgoing_transition_begin();
+ BehavioralPart::const_transition_iterator endIt = anExecutableSpec->
+ getBehavior()->outgoing_transition_end();
+ for( ; it != endIt ; ++it )
+ {
+ mTransitionCompiler.precompileTransition( anExec, (it) );
+ }
+ }
+
+ // APPEND NEW EXECUTABLE IN THE SYSTEM
+ //?? For retrocompatibity serialization order
+ getSymbolTable().addMachineExecutable( mConfiguration.
+ getExecutableSystem().saveExecutable( anExec ) );
+
+//AVM_OS_TRACE << TAB << ">** end precompiling executable MODEL:>"
+// << std::endl << str_header( anExecutableSpec ) << std::endl;
+
+ return( anExec );
+}
+
+
+void Compiler::precompileExecutablePrototype(
+ ExecutableForm * aContainer, Machine * anExecutableSpec)
+{
+//AVM_OS_TRACE << TAB << "<++ begin precompiling executable #instance model:>"
+// << std::endl << str_header( anExecutableSpec ) << std::endl;
+
+ ExecutableForm * anExec =
+ precompileExecutableModel(aContainer, anExecutableSpec);
+
+ avm_size_t initialInstanceCount = 1;
+ avm_size_t maximalInstanceCount = AVM_NUMERIC_MAX_SIZE_T;
+ if( anExecutableSpec->hasInstanceSpecifier() )
+ {
+ initialInstanceCount = anExecutableSpec->
+ getInstanceSpecifier()->getInitialInstanceCount();
+
+ maximalInstanceCount = anExecutableSpec->
+ getInstanceSpecifier()->getMaximalInstanceCount();
+ }
+
+ // Instances for << MODEL >> & INSTANCE
+ InstanceOfMachine * aModelInstance = NULL;
+ if( anExecutableSpec->getSpecifier().isFamilyComponentComposite() )
+ {
+ aModelInstance = aContainer->getInstanceModel().
+ getByAstElement( anExec->getAstElement() ).rawMachine();
+ if( aModelInstance == NULL )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unfound model instance of #prototype executable !!!"
+ << std::endl << str_header( anExec->getAstElement() )
+ << SEND_EXIT;
+ }
+ else
+ {
+ aModelInstance->incrInstanciationCount( initialInstanceCount );
+
+ anExec->incrPossibleStaticInstanciationCount( initialInstanceCount );
+ }
+ }
+
+ if( initialInstanceCount > 0 )
+ {
+ Specifier aSpecifier( anExecutableSpec->getSpecifier() );
+
+ InstanceOfMachine * aNewInstance = new InstanceOfMachine(
+ aContainer, anExecutableSpec, anExec, aModelInstance,
+ aContainer->getInstanceStatic().size(),
+ aSpecifier.setDesignPrototypeStatic() );
+
+ aNewInstance->setInstanceCount(
+ initialInstanceCount, maximalInstanceCount);
+
+ aNewInstance->setAutoStart( true );
+
+ setInheritedSpecifier(aContainer, aNewInstance);
+
+ anExec->setPrototypeInstance( aNewInstance );
+
+ const Symbol & bfInstance =
+ aContainer->saveInstanceStatic(aNewInstance);
+ getSymbolTable().addInstanceStatic(bfInstance);
+
+ aSpecifier.setDesignInstanceStatic();
+
+ avm_size_t offset = 1;
+ for( ; offset < initialInstanceCount ; ++offset )
+ {
+ aNewInstance = new InstanceOfMachine(
+ aContainer, anExecutableSpec, anExec, aModelInstance,
+ aContainer->getInstanceStatic().size(), aSpecifier);
+ aNewInstance->setInstanceCount(1, maximalInstanceCount);
+
+ aNewInstance->updateUfid(offset);
+
+ aNewInstance->setAutoStart( true );
+
+ setInheritedSpecifier(aContainer, aNewInstance);
+
+ getSymbolTable().addInstanceStatic(
+ aContainer->saveInstanceStatic(aNewInstance));
+ }
+ }
+ else
+ {
+//!![TRACE]: to delete
+//AVM_OS_DEBUG << "precompileExecutablePrototype Initial Instanciation Count: 0"
+// << std::endl << str_header( anExec ) << std::endl;
+ }
+
+//AVM_OS_TRACE << TAB << ">++ end precompiling executable #instance model:>"
+// << std::endl << str_header( anExecutableSpec ) << std::endl;
+}
+
+
+void Compiler::precompileExecutableInstanceStatic(
+ ExecutableForm * aContainer, Machine * anExecutableSpec)
+{
+//AVM_OS_TRACE << TAB << "<-- begin precompiling executable #static instance:>"
+// << std::endl << str_header( anExecutableSpec ) << std::endl;
+
+ ExecutableForm * anExec =
+ getSymbolTable().searchExecutableModel(anExecutableSpec);
+
+ if( anExec != NULL )
+ {
+ avm_size_t initialInstanceCount = anExecutableSpec->
+ getInstanceSpecifier()->getInitialInstanceCount();
+ avm_size_t maximalInstanceCount = anExecutableSpec->
+ getInstanceSpecifier()->getMaximalInstanceCount();
+
+ anExec->incrPossibleStaticInstanciationCount( initialInstanceCount );
+
+ // Instances for << MODEL >> & INSTANCE
+ InstanceOfMachine * aModelInstance = aContainer->getInstanceModel().
+ getByAstElement( anExec->getAstElement() ).rawMachine();
+ if( aModelInstance == NULL )
+ {
+ Specifier aSpecifier(
+ anExec->getAstMachine()->getSpecifier() );
+
+ aModelInstance = new InstanceOfMachine( aContainer,
+ anExec->getAstMachine(), anExec, NULL,
+ aContainer->getInstanceModel().size(),
+ aSpecifier.setDesignModel() );
+
+ aModelInstance->setInstanceCount(
+ initialInstanceCount, maximalInstanceCount);
+
+ aContainer->saveInstanceModel( aModelInstance );
+ }
+ else
+ {
+ aModelInstance->incrInstanciationCount( initialInstanceCount );
+ }
+
+ InstanceOfMachine * aNewInstance = NULL;
+ avm_size_t offset = 0;
+ for( ; offset < initialInstanceCount ; ++offset )
+ {
+ aNewInstance = new InstanceOfMachine(
+ aContainer, anExecutableSpec, anExec, aModelInstance,
+ aContainer->getInstanceStatic().size() );
+
+ aNewInstance->setInstanceCount(
+ initialInstanceCount, maximalInstanceCount);
+
+ if( offset > 0 )
+ {
+ aNewInstance->updateUfid(offset);
+ }
+
+ aNewInstance->setAutoStart( anExecutableSpec->isAutoStart() );
+// aNewInstance->setAutoStart( true );
+
+ setInheritedSpecifier(aContainer, aNewInstance);
+
+ getSymbolTable().addInstanceStatic(
+ aContainer->saveInstanceStatic(aNewInstance));
+ }
+ }
+
+ // ERROR REPORTING
+ else if( getSymbolTable().hasError() )
+ {
+ incrErrorCount();
+ anExecutableSpec->errorLocation(AVM_OS_WARN)
+ << getSymbolTable().getErrorMessage()
+ << std::endl << std::endl;
+ }
+
+ else
+ {
+
+
+ incrErrorCount();
+ anExecutableSpec->errorLocation(AVM_OS_WARN)
+ << "Unfound the model << " << anExecutableSpec->strType()
+ << " >> of the executable instance << "
+ << str_header( anExecutableSpec ) << " >>"
+ << std::endl << std::endl;
+ }
+
+//AVM_OS_TRACE << TAB << ">-- end precompiling executable #dynamic instance:>"
+// << std::endl << str_header( anExecutableSpec ) << std::endl;
+}
+
+
+void Compiler::precompileExecutableInstanceDynamique(
+ ExecutableForm * aContainer, Machine * anExecutableSpec)
+{
+//AVM_OS_WARN << TAB << "<-- begin precompiling executable #dynamic instance:>"
+// << std::endl << str_header( anExecutableSpec ) << std::endl;
+
+ ExecutableForm * anExec =
+ getSymbolTable().searchExecutableModel(anExecutableSpec);
+
+ avm_size_t initialInstanceCount = anExecutableSpec->
+ getInstanceSpecifier()->getInitialInstanceCount();
+ avm_size_t maximalInstanceCount = anExecutableSpec->
+ getInstanceSpecifier()->getMaximalInstanceCount();
+
+ if( anExec != NULL )
+ {
+ // Instances for << MODEL >> & INSTANCE
+ CompilationEnvironment cENV(anExec);
+
+ InstanceOfMachine * aModelInstance =
+ getSymbolTable().searchInstanceModel(
+ cENV.mCTX, anExec->getAstElement()).rawMachine();
+ if( aModelInstance == NULL )
+ {
+ aModelInstance = aContainer->getInstanceModel().
+ getByAstElement( anExec->getAstElement() ).rawMachine();
+ }
+ if( aModelInstance == NULL )
+ {
+ Specifier aSpecifier(
+ anExec->getAstMachine()->getSpecifier() );
+
+ aModelInstance = new InstanceOfMachine( aContainer,
+ anExec->getAstMachine(), anExec, NULL,
+ aContainer->getInstanceModel().size(),
+ aSpecifier.setDesignModel() );
+
+ aModelInstance->setInstanceCount(
+ initialInstanceCount, maximalInstanceCount);
+
+ aContainer->saveInstanceModel( aModelInstance );
+
+ anExec->incrPossibleDynamicInstanciationCount(
+ initialInstanceCount );
+ }
+ else
+ {
+ aModelInstance->incrPossibleDynamicInstanciationCount(
+ initialInstanceCount );
+ }
+
+ InstanceOfMachine * aNewInstance = new InstanceOfMachine(
+ aContainer, anExecutableSpec, anExec, aModelInstance,
+ aContainer->getInstanceStatic().size() );
+
+ aNewInstance->setInstanceCount(
+ initialInstanceCount, maximalInstanceCount);
+
+ aNewInstance->setAutoStart( true );
+
+ setInheritedSpecifier(aContainer, aNewInstance);
+
+ aContainer->saveInstanceDynamic(aNewInstance);
+ }
+
+ // ERROR REPORTING
+ else if( getSymbolTable().hasError() )
+ {
+ incrErrorCount();
+ anExecutableSpec->errorLocation(AVM_OS_WARN)
+ << getSymbolTable().getErrorMessage()
+ << std::endl << std::endl;
+ }
+
+ else
+ {
+ incrWarningCount();
+ anExecutableSpec->warningLocation(AVM_OS_LOG)
+ << "Unfound the executable model << "
+ << anExecutableSpec->strType()
+ << " >> of the #dynamic instance !!!"
+ << std::endl << str_header( anExecutableSpec )
+ << std::endl << std::endl;
+
+ InstanceOfMachine * aNewInstance = new InstanceOfMachine(
+ aContainer, anExecutableSpec, anExec, NULL,
+ aContainer->getInstanceStatic().size() );
+
+ aNewInstance->setInstanceCount(
+ initialInstanceCount, maximalInstanceCount);
+
+ aNewInstance->setAutoStart( false );
+
+ setInheritedSpecifier(aContainer, aNewInstance);
+
+ aContainer->saveInstanceDynamic(aNewInstance);
+ }
+
+//AVM_OS_WARN << TAB << ">-- end precompiling executable #dynamic instance:>"
+// << std::endl << str_header( anExecutableSpec ) << std::endl;
+}
+
+
+void Compiler::precompileExecutableGroup(
+ ExecutableForm * aContainer, Machine * anExecutableSpec)
+{
+// Machine * containerSM = anExecutableSpec->getContainerMachine();
+//
+// if( anExecutableSpec->getSpecifier().isGroupEvery())
+// {
+// containerSM->appendOutgoingTransitionToEveryState(anExecutableSpec);
+// }
+// else if( anExecutableSpec->getSpecifier().isGroupSome())
+// {
+// containerSM->appendOutgoingTransitionToSomeState(anExecutableSpec);
+// }
+// else if( anExecutableSpec->getSpecifier().isGroupExcept() )
+// {
+// containerSM->appendOutgoingTransitionToExceptState(anExecutableSpec);
+// }
+}
+
+
+
+
+
+/**
+ * precompile
+ * specification
+ */
+void Compiler::precompileSystem(System & aSystem)
+{
+//AVM_OS_TRACE << TAB << "< begin precompiling specification:> "
+// << aSystem.getFullyQualifiedNameID() << std::endl;
+
+ /*
+ * For the system executable
+ */
+ ExecutableForm * systemExec = new ExecutableForm(
+ mConfiguration.getExecutableSystem(), NULL, (& aSystem));
+
+ // APPEND NEW EXECUTABLE IN THE SYSTEM
+// //?? For retrocompatibity serialization order
+// getSymbolTable().addMachineExecutable(
+// mExecutableSystem->saveExecutable( systemExec ) );
+
+ // Structural decompositon
+ systemExec->setMainComponent( true );
+
+
+ Specifier aSpecifier( aSystem.getSpecifier() );
+
+ InstanceOfMachine * aNewInstance = new InstanceOfMachine(NULL, (& aSystem),
+ systemExec, NULL, 0, aSpecifier.setDesignPrototypeStatic() );
+
+ aNewInstance->setAutoStart( true );
+// aSystem.getInstanceSpecifier()->hasInitialInstance() );
+
+ aNewInstance->setInstanceCount(1, 1);
+
+ systemExec->setPrototypeInstance( aNewInstance );
+ systemExec->incrPossibleStaticInstanciationCount(1);
+
+ getSymbolTable().addInstanceStatic( mConfiguration.
+ getExecutableSystem().setSystemInstance(aNewInstance) );
+
+
+ // Set the instance THIS in first position (index = 0)
+ // for << MODEL >> & INSTANCE
+ aNewInstance = InstanceOfMachine::newInstanceModelThis(
+ systemExec, (& aSystem), systemExec, NULL,
+ systemExec->getInstanceModel().size(),
+ aSpecifier.setDesignModel() );
+
+ aNewInstance->setInstanceCount(0, 1);
+
+ systemExec->saveInstanceModel( aNewInstance );
+
+ aNewInstance = InstanceOfMachine::newThis(systemExec,
+ aNewInstance, systemExec->getInstanceStatic().size() );
+
+ systemExec->saveInstanceStatic(aNewInstance);
+
+ /*
+ * Allocation of declaration contents :>
+ * constant, variable, typedef, buffer, port
+ */
+ if( aSystem.hasProperty() )
+ {
+ TableOfInstanceOfData tableOfVariable;
+
+ precompilePropertyPart(systemExec,
+ aSystem.getPropertyPart(), tableOfVariable);
+
+ /*
+ * Update data table
+ */
+ systemExec->setData(tableOfVariable);
+ }
+
+
+ /*
+ * precompiling executable composite part
+ */
+ precompileExecutableCompositePart(systemExec, (& aSystem));
+
+//AVM_OS_TRACE << TAB << "> end precompiling specification:> "
+// << aSystem.getFullyQualifiedNameID() << std::endl << std::endl;
+
+ // APPEND NEW EXECUTABLE IN THE SYSTEM
+ //?? For retrocompatibity serialization order
+ getSymbolTable().addMachineExecutable( mConfiguration.
+ getExecutableSystem().saveExecutable( systemExec ) );
+}
+
+
+/**
+ * setInheritedSpecifier from container to owned elements
+ */
+void Compiler::setInheritedSpecifier(
+ ExecutableForm * aContainer, ExecutableForm * anExecutable)
+{
+ if( aContainer->getSpecifier().hasFeatureInputEnabled() )
+ {
+ anExecutable->getwSpecifier().setFeatureInputEnabled();
+
+ const_cast< Machine * >(anExecutable->getAstMachine() )
+ ->getwSpecifier().setFeatureInputEnabled();
+
+ }
+}
+
+void Compiler::setInheritedSpecifier(
+ ExecutableForm * aContainer, InstanceOfMachine * aMachine)
+{
+ if( aContainer->getSpecifier().hasFeatureInputEnabled() )
+ {
+ aMachine->getwSpecifier().setFeatureInputEnabled();
+ }
+}
+
+
+
+
+/**
+ *******************************************************************************
+ * COMPILATION OF EXECUTABLE
+ *******************************************************************************
+ */
+
+void Compiler::compileExecutableSystem()
+{
+ TableOfExecutableForm::const_raw_iterator itProc;
+ TableOfExecutableForm::const_raw_iterator endProc;
+
+ TableOfExecutableForm::const_raw_iterator itExec =
+ mConfiguration.getExecutableSystem().getExecutables().begin();
+ TableOfExecutableForm::const_raw_iterator endIt =
+ mConfiguration.getExecutableSystem().getExecutables().end();
+ for( ; itExec != endIt ; ++itExec )
+ {
+ compileExecutable( (itExec) );
+
+ if( (itExec)->hasExecutable() )
+ {
+ itProc = (itExec)->getExecutables().begin();
+ endProc = (itExec)->getExecutables().end();
+ for( ; itProc != endProc ; ++itProc )
+ {
+ compileProcedure( itProc );
+ }
+ }
+ }
+}
+
+
+void Compiler::compileExecutable(ExecutableForm * anExecutable)
+{
+ if( anExecutable->isCompiledFlag() )
+ {
+ return;
+ }
+ else
+ {
+ anExecutable->setCompiledFlag();
+ }
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "<| compiling<executable>: "
+ << anExecutable->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ // Compile data & all machine MOE program
+ compileBaseMachine(anExecutable);
+
+ // Compile data & all instance MOE program
+ compileAllInstances( anExecutable );
+
+ if( anExecutable->getAstElement()->is< System >() )
+ {
+ compileSystem( anExecutable );
+ }
+
+ else if( anExecutable->getAstElement()->is_exactly< Machine >() )
+ {
+ if( anExecutable->getSpecifier().isFamilyComponentStatemachine() )
+ {
+ compileStatemachine( anExecutable );
+ }
+
+ else
+ {
+ compileMachine( anExecutable );
+ }
+ }
+
+ else
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Unexpected executable form for compiling :\n"
+ << anExecutable->toString()
+ << SEND_EXIT;
+ }
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ AVM_OS_TRACE << TAB_DECR_INDENT << ">| compiling<executable>: "
+ << anExecutable->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+}
+
+
+/**
+ *******************************************************************************
+ * COMPILATION OF INSTANCE MACHINE PARAM
+ *******************************************************************************
+ */
+void Compiler::compileAllInstances(ExecutableForm * anExecutableForm)
+{
+ if( anExecutableForm->hasInstanceStatic() )
+ {
+ // Compilation of InstanceOfMachine Parameters / Behaviors
+ TableOfSymbol::const_iterator itMachine =
+ anExecutableForm->instance_static_begin();
+ TableOfSymbol::const_iterator endMachine =
+ anExecutableForm->instance_static_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ compileInstance(anExecutableForm, (*itMachine).rawMachine());
+
+ if( not (*itMachine).hasExecutable() )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected a #static instance "
+ "without executable model !!!"
+ << std::endl << str_header( (*itMachine) )
+ << SEND_EXIT;
+ }
+ }
+ }
+
+ if( anExecutableForm->hasInstanceDynamic() )
+ {
+ // Compilation of InstanceOfMachine Parameters / Behaviors
+ TableOfSymbol::const_iterator itMachine =
+ anExecutableForm->instance_dynamic_begin();
+ TableOfSymbol::const_iterator endMachine =
+ anExecutableForm->instance_dynamic_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ compileInstance(anExecutableForm, (*itMachine).rawMachine());
+
+ if( not (*itMachine).hasExecutable() )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected a #dynamic instance "
+ "without executable model !!!"
+ << std::endl << str_header( (*itMachine) )
+ << SEND_EXIT;
+ }
+ }
+ }
+}
+
+void Compiler::compileInstance(
+ ExecutableForm * theExecutableContainer, InstanceOfMachine * anInstance)
+{
+ const Machine * anExecutableSpec = anInstance->getAstMachine();
+
+//AVM_OS_WARN << TAB << "<-- begin compiling executable instance:>" << std::endl
+// << to_stream( anInstance )// << std::endl
+// << to_stream( anExecutableSpec ) << std::endl;
+
+ ExecutableForm * anExec = anInstance->getExecutable();
+
+ if( anExec == NULL )
+ {
+ anExec = getSymbolTable().searchExecutableModel(anExecutableSpec);
+
+ if( anExec != NULL )
+ {
+ anInstance->setExecutable( anExec );
+
+ anInstance->setAutoStart( true );
+
+ // Instances for << MODEL >> & INSTANCE
+ CompilationEnvironment cENV(anExec);
+
+ InstanceOfMachine * aModelInstance =
+ getSymbolTable().searchInstanceModel(
+ cENV.mCTX, anExec->getAstElement()).rawMachine();
+ if( aModelInstance == NULL )
+ {
+ aModelInstance = theExecutableContainer->getInstanceModel().
+ getByAstElement( anExec->getAstElement() ).rawMachine();
+ }
+ if( aModelInstance != NULL )
+ {
+ anInstance->setInstanceModel( aModelInstance );
+ }
+
+ if( anInstance->getSpecifier().hasDesignInstanceDynamic() )
+ {
+ if( aModelInstance != NULL )
+ {
+ aModelInstance->incrPossibleDynamicInstanciationCount( 1 );
+ }
+ else
+ {
+ anExec->incrPossibleDynamicInstanciationCount( 1 );
+ }
+ }
+ else
+ {
+ anExec->incrPossibleStaticInstanciationCount( 1 );
+ }
+ }
+
+ // ERROR REPORTING
+ else if( getSymbolTable().hasError() )
+ {
+ incrErrorCount();
+ anExecutableSpec->errorLocation(AVM_OS_WARN)
+ << getSymbolTable().getErrorMessage()
+ << std::endl << std::endl;
+ }
+
+ else
+ {
+ incrErrorCount();
+ anExecutableSpec->errorLocation(AVM_OS_WARN)
+ << "Unfound the model << "
+ << anExecutableSpec->strType()
+ << " >> of the statemachine instance << "
+ << str_header( anExecutableSpec ) << " >>"
+ << std::endl << std::endl;
+ }
+ }
+
+ if( anExec != NULL )
+ {
+ compileExecutable( anExec );
+
+ if( anExec->hasParamReturn() )
+ {
+ compileInstanceParameters(theExecutableContainer, anInstance);
+ }
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected a instance without executable model !!!"
+ << std::endl << str_header( anInstance )
+ << SEND_EXIT;
+
+ return;
+ }
+
+ BehavioralPart * theBehavior = anExecutableSpec->getBehavior();
+
+ if( theBehavior != NULL )
+ {
+ /*
+ * onCreate
+ */
+ if( theBehavior->hasOnCreate()
+ && StatementTypeChecker::doSomething(theBehavior->getOnCreate()) )
+ {
+ CompilationEnvironment cENV(NULL, anExec, theExecutableContainer);
+
+ BFCode onCreate = theBehavior->getOnCreate();
+ if( anExec->hasOnCreate()
+ && anInstance->getSpecifier().hasDesignInstanceNotModel() )
+ {
+ onCreate = StatementConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ anExec->getOnCreate(), onCreate );
+ }
+
+ anInstance->setOnCreate(
+ mAvmcodeCompiler.compileStatement(cENV.mCTX, onCreate) );
+ }
+
+ /*
+ * onStart
+ */
+ if( theBehavior->hasOnStart()
+ && StatementTypeChecker::doSomething(theBehavior->getOnStart()) )
+ {
+ CompilationEnvironment cENV(NULL, anExec, theExecutableContainer);
+
+ BFCode onStart = theBehavior->getOnStart();
+ if( anExec->hasOnStart() )
+ {
+ onStart = StatementConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ anExec->getOnStart(), onStart );
+ }
+
+ if( anExec->hasOnInit() )
+ {
+ onStart = StatementConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ onStart, anExec->getOnInit() );
+ }
+
+ anInstance->setOnStart(
+ mAvmcodeCompiler.compileStatement(cENV.mCTX, onStart) );
+ }
+ }
+
+//AVM_OS_WARN << TAB << ">-- end compiling executable instance:>" << std::endl
+// << to_stream( anInstance )// << std::endl
+// << str_header( anExecutableSpec ) << std::endl;
+}
+
+
+void Compiler::compileInstanceParameters(
+ ExecutableForm * theExecutableContainer, InstanceOfMachine * anInstance)
+{
+ ExecutableForm * anExecutableForm = anInstance->getExecutable();
+
+ const Machine * aMachine = anInstance->getAstMachine();
+
+ if( (anExecutableForm != NULL) && anExecutableForm->hasParamReturn() )
+ {
+ APTableOfData aParamTable( new TableOfData(
+ anExecutableForm->getParamReturnCount() ) );
+ anInstance->setParamReturnTable( aParamTable );
+
+ anInstance->setReturnOffset( anExecutableForm->getParamCount() );
+
+ bool hasInitialInstance =
+ aMachine->getInstanceSpecifier()->hasInitialInstance();
+
+
+ if( anExecutableForm->hasParam() )
+ {
+ if( aMachine->hasVariableParameter() )
+ {
+ BF paramValue;
+
+ TableOfVariable::const_raw_iterator it =
+ aMachine->getVariableParameters().begin();
+ TableOfVariable::const_raw_iterator itEnd =
+ aMachine->getVariableParameters().end();
+ for( avm_offset_t offset = 0 ; it != itEnd ; ++it , ++offset )
+ {
+ if( (*it).invalid() )
+ {
+ if( hasInitialInstance )
+ {
+ incrWarningCount();
+ aMachine->errorLocation(AVM_OS_WARN)
+ << "Compile param warning << "
+ << str_header(
+ anExecutableForm->rawParamData(offset) )
+ << " >> for the statemachine instance << "
+ << str_header( aMachine ) << " >> "
+ << "Unexpected non-instanciated parameters !"
+ << std::endl << std::endl;
+ //!! Generation of symbolic parameter
+ //!! Generation of symbolic parameter
+ }
+ }
+ else if( (it)->hasValue() )
+ {
+ paramValue = mAvmcodeCompiler.decode_compileExpression(
+ theExecutableContainer, (it)->getValue() );
+ if( paramValue.valid() )
+ {
+ aParamTable->set(offset, paramValue);
+ }
+ else
+ {
+ incrErrorCount();
+ aMachine->errorLocation(AVM_OS_WARN)
+ << "Compile param error << "
+ << str_header( *it )
+ << " >> for the statemachine instance << "
+ << str_header( aMachine ) << " >>"
+ << std::endl << std::endl;
+ }
+ }
+ else if( hasInitialInstance )
+ {
+ incrWarningCount();
+ aMachine->warningLocation(AVM_OS_WARN)
+ << "Compile param warning << "
+ << str_header( *it )
+ << " >> for the statemachine instance << "
+ << str_header( aMachine ) << " >> "
+ << "Unexpected non-instanciated parameters !"
+ << std::endl << std::endl;
+ //!! Generation of symbolic parameter
+ //!! Generation of symbolic parameter
+ }
+ }
+ }
+ }
+
+ if( anExecutableForm->hasReturn() )
+ {
+ if( aMachine->hasVariableReturn() )
+ {
+ BF returnValue;
+
+ TableOfVariable::const_raw_iterator it =
+ aMachine->getVariableReturns().begin();
+ TableOfVariable::const_raw_iterator itEnd =
+ aMachine->getVariableReturns().end();
+ for( avm_offset_t offset = 0 ; it != itEnd ; ++it , ++offset )
+ {
+ if( (*it).invalid() )
+ {
+ incrWarningCount();
+ aMachine->errorLocation(AVM_OS_WARN)
+ << "Compile return warning << "
+ << str_header(
+ anExecutableForm->rawReturnData(offset) )
+ << " >> for the statemachine instance << "
+ << str_header( aMachine ) << " >> "
+ << "Unexpected non-instanciated parameters !"
+ << std::endl << std::endl;
+ //!! Generation of symbolic parameter
+ //!! Generation of symbolic parameter
+ }
+ else if( (it)->hasValue() )
+ {
+ returnValue = mAvmcodeCompiler.decode_compileExpression(
+ theExecutableContainer, (it)->getValue() );
+ if( returnValue.valid() )
+ {
+ aParamTable->set(anExecutableForm->getReturnOffset()
+ + offset, returnValue);
+ }
+ else
+ {
+ incrErrorCount();
+ aMachine->errorLocation(AVM_OS_WARN)
+ << "Compile return error << "
+ << str_header( *it )
+ << " >> for the statemachine instance << "
+ << str_header( aMachine ) << " >>"
+ << std::endl << std::endl;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+
+/**
+ *******************************************************************************
+ * COMPILATION OF AVMPROGRAM
+ *******************************************************************************
+ */
+
+void Compiler::compileAvmPrograms()
+{
+ AvmProgram * aProgram;
+ avm_size_t offset;
+
+ TableOfExecutableForm::const_raw_iterator itExec =
+ mConfiguration.getExecutableSystem().getExecutables().begin();
+ TableOfExecutableForm::const_raw_iterator endExec =
+ mConfiguration.getExecutableSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ for( offset = 0 ; offset < (itExec)->getProgram().size() ; ++offset )
+ {
+ aProgram = (itExec)->getProgram().rawAt(offset);
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "<| compiling<program>: "
+ << aProgram->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ mProgramCompiler.compileProgram( aProgram );
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+// (*itProg)->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << TAB_DECR_INDENT << ">| compiling<program>: "
+ << aProgram->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+ }
+ }
+}
+
+
+/**
+ * compile
+ * Executable
+ */
+void Compiler::compileBaseMachine(ExecutableForm * anExecutableForm)
+{
+ const Machine * aMachine = anExecutableForm->getAstMachine();
+
+//AVM_OS_TRACE << TAB << "<| compiling<machine>: "
+// << str_header( aMachine ) << std::endl;
+
+
+ // COMPILATION OF PORT
+ mComCompiler.compilePort(anExecutableForm);
+
+ // COMPILATION OF DATA
+ mDataCompiler.compileData(anExecutableForm);
+
+
+ if( not aMachine->hasBehavior() )
+ {
+ return;
+ }
+
+ BehavioralPart * theBehavior = aMachine->getBehavior();
+
+ /*
+ * onCreate
+ */
+ if( theBehavior->hasOnCreate() &&
+ StatementTypeChecker::doSomething(theBehavior->getOnCreate()) )
+ {
+ anExecutableForm->setOnCreate(
+ mAvmcodeCompiler.compileStatement(
+ anExecutableForm, theBehavior->getOnCreate()) );
+ }
+
+ /*
+ * onInit
+ */
+ if( theBehavior->hasOnInit() &&
+ StatementTypeChecker::doSomething(theBehavior->getOnInit()) )
+ {
+ anExecutableForm->setOnInit(
+ mAvmcodeCompiler.compileStatement(
+ anExecutableForm, theBehavior->getOnInit()) );
+ }
+
+ /*
+ * onFinal
+ */
+ if( theBehavior->hasOnFinal() &&
+ StatementTypeChecker::doSomething(theBehavior->getOnFinal()) )
+ {
+ anExecutableForm->setOnFinal(
+ mAvmcodeCompiler.compileStatement(
+ anExecutableForm, theBehavior->getOnFinal()) );
+ }
+
+
+ /*
+ * onReturn
+ */
+ if( theBehavior->hasOnReturn() &&
+ StatementTypeChecker::doSomething(theBehavior->getOnReturn()) )
+ {
+ anExecutableForm->setOnReturn(
+ StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ mAvmcodeCompiler.compileStatement(
+ anExecutableForm, theBehavior->getOnReturn()),
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_FINAL) ) );
+ }
+
+
+ /*
+ * onStart
+ */
+ if( theBehavior->hasOnStart() &&
+ StatementTypeChecker::doSomething(theBehavior->getOnStart()) )
+ {
+ anExecutableForm->setOnStart(
+ mAvmcodeCompiler.compileStatement(
+ anExecutableForm, theBehavior->getOnStart()) );
+ }
+
+ /*
+ * onStop
+ */
+ if( theBehavior->hasOnStop() &&
+ StatementTypeChecker::doSomething(theBehavior->getOnStop()) )
+ {
+ anExecutableForm->setOnStop(
+ mAvmcodeCompiler.compileStatement(
+ anExecutableForm, theBehavior->getOnStop()) );
+ }
+
+
+ /*
+ * onIEnable
+ */
+ if( theBehavior->hasOnIEnable() &&
+ StatementTypeChecker::doSomething(theBehavior->getOnIEnable()) )
+ {
+ anExecutableForm->setOnIEnable(
+ mAvmcodeCompiler.compileStatement(
+ anExecutableForm, theBehavior->getOnIEnable()) );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ anExecutableForm->setOnIEnable(StatementConstructor::newCodeFlatMiddle(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+
+ StatementConstructor::newComment( "begin<ienable> " +
+ anExecutableForm->getFullyQualifiedNameID() ),
+
+ anExecutableForm->getOnIEnable(),
+
+ StatementConstructor::newComment( "end<ienable> " +
+ anExecutableForm->getFullyQualifiedNameID() ) ) );
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ }
+
+ /*
+ * onEnable
+ */
+ if( theBehavior->hasOnEnable() &&
+ StatementTypeChecker::doSomething(theBehavior->getOnEnable()) )
+ {
+ anExecutableForm->setOnEnable(
+ mAvmcodeCompiler.compileStatement(
+ anExecutableForm, theBehavior->getOnEnable()) );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ anExecutableForm->setOnEnable(StatementConstructor::newCodeFlatMiddle(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+
+ StatementConstructor::newComment( "begin<enable> " +
+ anExecutableForm->getFullyQualifiedNameID() ),
+
+ anExecutableForm->getOnEnable(),
+
+ StatementConstructor::newComment( "end<enable> " +
+ anExecutableForm->getFullyQualifiedNameID() ) ) );
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ }
+
+ // EXPAND IENABLE / ENABLE
+ if( anExecutableForm->hasOnIEnable() )
+ {
+ if( anExecutableForm->hasOnEnable() )
+ {
+ if( not AvmCodeFactory::contains(anExecutableForm,
+ anExecutableForm->getOnEnable(), AVM_OPCODE_IENABLE_INVOKE) )
+ {
+ anExecutableForm->setOnEnable(
+ StatementConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+
+ anExecutableForm->getOnIEnable(),
+
+ anExecutableForm->getOnEnable() ) );
+ }
+ else
+ {
+ // EXPAND IENABLE
+ }
+ }
+ else
+ {
+// (*it)->setOnEnable( BFCode(OperatorManager::OPERATOR_IENABLE) );
+
+ //Optimization
+ anExecutableForm->setOnEnable( anExecutableForm->getOnIEnable() );
+ }
+ }
+
+
+
+ /*
+ * onIDisable
+ */
+ if( theBehavior->hasOnIDisable() &&
+ StatementTypeChecker::doSomething(theBehavior->getOnIDisable()) )
+ {
+ anExecutableForm->setOnIDisable(
+ mAvmcodeCompiler.compileStatement(
+ anExecutableForm, theBehavior->getOnIDisable()) );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ anExecutableForm->setOnIDisable(StatementConstructor::newCodeFlatMiddle(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+ StatementConstructor::newComment( "begin<idisable> " +
+ anExecutableForm->getFullyQualifiedNameID() ),
+
+ anExecutableForm->getOnIDisable(),
+
+ StatementConstructor::newComment( "end<idisable> " +
+ anExecutableForm->getFullyQualifiedNameID() ) ) );
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ }
+
+ /*
+ * onDisable
+ */
+ if( theBehavior->hasOnDisable() &&
+ StatementTypeChecker::doSomething(theBehavior->getOnDisable()) )
+ {
+ anExecutableForm->setOnDisable(
+ mAvmcodeCompiler.compileStatement(
+ anExecutableForm, theBehavior->getOnDisable()) );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ anExecutableForm->setOnDisable(StatementConstructor::newCodeFlatMiddle(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+ StatementConstructor::newComment( "begin<disable> " +
+ anExecutableForm->getFullyQualifiedNameID() ),
+
+ anExecutableForm->getOnDisable(),
+
+ StatementConstructor::newComment( "end<disable> " +
+ anExecutableForm->getFullyQualifiedNameID() ) ) );
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+
+ anExecutableForm->setOnDisable( StatementConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+
+ anExecutableForm->getOnDisable(),
+
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_DISABLE_SELF) ) );
+ }
+
+ // EXPAND IDISABLE / DISABLE
+ if( anExecutableForm->hasOnIDisable() )
+ {
+ if( anExecutableForm->hasOnDisable() )
+ {
+ if( not AvmCodeFactory::contains(anExecutableForm,
+ anExecutableForm->getOnDisable(), AVM_OPCODE_IDISABLE_INVOKE) )
+ {
+ anExecutableForm->setOnDisable(
+ StatementConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+
+ anExecutableForm->getOnIDisable(),
+
+ anExecutableForm->getOnDisable() ) );
+ }
+ else
+ {
+ // EXPAND IDISABLE
+ }
+ }
+ else
+ {
+// (*it)->setOnDisable( BFCode(OperatorManager::OPERATOR_IDISABLE) );
+
+ //Optimization
+ anExecutableForm->setOnDisable( StatementConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+
+ anExecutableForm->getOnIDisable(),
+
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_DISABLE_SELF) ) );
+ }
+
+ anExecutableForm->setOnIDisable( StatementConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+
+ anExecutableForm->getOnIDisable(),
+
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_DISABLE_SELF) ) );
+ }
+
+
+ /*
+ * onIAbort
+ */
+ if( theBehavior->hasOnIAbort() &&
+ StatementTypeChecker::doSomething(theBehavior->getOnIAbort()) )
+ {
+ anExecutableForm->setOnIAbort(
+ mAvmcodeCompiler.compileStatement(
+ anExecutableForm, theBehavior->getOnIAbort()) );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ anExecutableForm->setOnIAbort(StatementConstructor::newCodeFlatMiddle(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+ StatementConstructor::newComment( "begin<iabort> " +
+ anExecutableForm->getFullyQualifiedNameID() ),
+
+ anExecutableForm->getOnIAbort(),
+
+ StatementConstructor::newComment( "end<iabort> " +
+ anExecutableForm->getFullyQualifiedNameID() ) ) );
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ }
+
+ /*
+ * onAbort
+ */
+ if( theBehavior->hasOnAbort() &&
+ StatementTypeChecker::doSomething(theBehavior->getOnAbort()) )
+ {
+ anExecutableForm->setOnAbort(
+ mAvmcodeCompiler.compileStatement(
+ anExecutableForm, theBehavior->getOnAbort()) );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ anExecutableForm->setOnAbort(StatementConstructor::newCodeFlatMiddle(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+ StatementConstructor::newComment( "begin<abort> " +
+ anExecutableForm->getFullyQualifiedNameID() ),
+
+ anExecutableForm->getOnAbort(),
+
+ StatementConstructor::newComment( "end<abort> " +
+ anExecutableForm->getFullyQualifiedNameID() ) ) );
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+
+ anExecutableForm->setOnAbort( StatementConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+
+ anExecutableForm->getOnAbort(),
+
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ABORT_SELF) ) );
+ }
+
+ // EXPAND IABORT / ABORT
+ if( anExecutableForm->hasOnIAbort() )
+ {
+ if( anExecutableForm->hasOnAbort() )
+ {
+ if( not AvmCodeFactory::contains(anExecutableForm,
+ anExecutableForm->getOnAbort(), AVM_OPCODE_IABORT_INVOKE) )
+ {
+ anExecutableForm->setOnAbort(
+ StatementConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+
+ anExecutableForm->getOnIAbort(),
+
+ anExecutableForm->getOnAbort() ) );
+ }
+ else
+ {
+ // EXPAND IABORT
+ }
+ }
+ else
+ {
+// (*it)->setOnAbort( BFCode(OperatorManager::OPERATOR_IABORT) );
+
+ //Optimization
+ anExecutableForm->setOnAbort( StatementConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+
+ anExecutableForm->getOnIAbort(),
+
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ABORT_SELF) ) );
+ }
+
+ anExecutableForm->setOnIAbort( StatementConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+
+ anExecutableForm->getOnIAbort(),
+
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ABORT_SELF) ) );
+ }
+
+
+ /*
+ * onIRun
+ */
+ if( theBehavior->hasOnIRun() &&
+ StatementTypeChecker::doSomething(theBehavior->getOnIRun()) )
+ {
+ anExecutableForm->setOnIRun(
+ mAvmcodeCompiler.compileStatement(
+ anExecutableForm, theBehavior->getOnIRun()) );
+ }
+
+ /*
+ * onRun
+ */
+ if( theBehavior->hasOnRun() &&
+ StatementTypeChecker::doSomething(theBehavior->getOnRun()) )
+ {
+ anExecutableForm->setOnRun(
+ mAvmcodeCompiler.compileStatement(
+ anExecutableForm, theBehavior->getOnRun()) );
+ }
+
+ /*
+ * onRtc
+ */
+ if( theBehavior->hasOnRtc() &&
+ StatementTypeChecker::doSomething(theBehavior->getOnRtc()) )
+ {
+ anExecutableForm->setOnRtc(
+ mAvmcodeCompiler.compileStatement(
+ anExecutableForm, theBehavior->getOnRtc()) );
+ }
+
+
+ /*
+ * onSchedule
+ */
+ if( theBehavior->hasOnSchedule() )
+ {
+ if( StatementTypeChecker::isEmptySchedule(theBehavior->getOnSchedule()) )
+ {
+ //!! NOTHING
+ }
+ else
+ {
+ anExecutableForm->setOnSchedule(
+ compileSchedulerRoutine(
+ anExecutableForm,
+ theBehavior->getOnSchedule() ) );
+ }
+ }
+
+ /*
+ * onConcurrency
+ */
+ if( theBehavior->hasOnConcurrency() )
+ {
+ if( StatementTypeChecker::isEmptySchedule(theBehavior->getOnConcurrency()) )
+ {
+ anExecutableForm->setOnConcurrency( theBehavior->getOnConcurrency() );
+ }
+ else
+ {
+ anExecutableForm->setOnConcurrency(
+ mAvmcodeCompiler.compileStatement(
+ anExecutableForm, theBehavior->getOnConcurrency()) );
+ }
+ }
+ else if( StatementTypeChecker::isSchedule(theBehavior->getOnSchedule()) )
+ {
+ anExecutableForm->setOnConcurrency(
+ theBehavior->getOnSchedule().getOperator() );
+ }
+
+
+ /*
+ * onSynchronize
+ */
+ if( theBehavior->hasOnSynchronize() )
+ {
+ anExecutableForm->setOnSynchronize(
+ mAvmcodeCompiler.compileStatement(
+ anExecutableForm, theBehavior->getOnSynchronize()) );
+ }
+
+
+ /*
+ * other user Routines
+ */
+ BehavioralPart::const_routine_iterator it = theBehavior->routine_begin();
+ BehavioralPart::const_routine_iterator endIt = theBehavior->routine_end();
+ for( ; it != endIt ; ++it )
+ {
+ anExecutableForm->saveProgram(
+ mAvmcodeCompiler.compileRoutine(this, anExecutableForm, it) );
+ }
+
+
+//AVM_OS_TRACE << TAB << ">| compiling<machine>: "
+// << str_header( aMachine ) << std::endl << std::endl;
+}
+
+
+/**
+ * compile
+ * executable procedure
+ */
+void Compiler::compileProcedure(ExecutableForm * anExecutableForm)
+{
+ // Compile data & all machine MOE program
+ compileBaseMachine(anExecutableForm);
+
+ const Machine * aProcedure = anExecutableForm->getAstMachine();
+
+//AVM_OS_TRACE << TAB << "<| compiling<statemachine>: "
+// << str_header( aProcedure ) << std::endl;
+
+ // PUSH MOC
+ WObject * moc_transition = NULL;//aProcedure::getTransitionMoc();
+ if( moc_transition != NULL )
+ {
+ mTransitionCompiler.pushMoc(moc_transition);
+ }
+
+
+ // Compile all specific statemachine
+ if( aProcedure->getSpecifier().isStateBasic() )
+ {
+ compileStatemachineBasic(anExecutableForm);
+ }
+
+ else if( aProcedure->getSpecifier().isMocStateTransitionStructure() )
+ {
+ compileExecutableMocStateTransitionStructure(anExecutableForm);
+ }
+ else if( aProcedure->getSpecifier().isMocCompositeStructure() )
+ {
+ compileExecutableMocCompositeStructure(anExecutableForm);
+ }
+
+ else
+ {
+ // MOC Attribute for mutable Schedule
+ anExecutableForm->setMutableSchedule(
+ anExecutableForm->hasOnSchedule() );
+
+ /*
+ * Compiling communication
+ */
+ bool hasSynchronizeMachine = false;
+ bool hasUpdateBuffer = false;
+
+ mComCompiler.compileCommunication(anExecutableForm,
+ hasUpdateBuffer, hasSynchronizeMachine);
+
+ if( anExecutableForm->hasOnRun() )
+ {
+ //!! NOTHING
+ }
+ else if( anExecutableForm->hasOnRtc() )
+ {
+ anExecutableForm->setOnRun(StatementConstructor::newCode(
+ OperatorManager::OPERATOR_RTC));
+ }
+
+ else if( anExecutableForm->hasOnSchedule() )
+ {
+ anExecutableForm->setOnRun( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_SCHEDULE_INVOKE));
+ }
+ }
+
+ // POP MOC
+ if( moc_transition != NULL )
+ {
+ mTransitionCompiler.popMoc();
+ }
+
+//AVM_OS_TRACE << TAB << ">| compiling<statemachine>: "
+// << str_header( aProcedure ) << std::endl;
+}
+
+
+/**
+ * compile
+ * executable machine
+ */
+void Compiler::compileMachine(ExecutableForm * anExecutableForm)
+{
+//AVM_OS_TRACE << TAB << "<| compiling<machine>: "
+// << str_header( aMachine ) << std::endl;
+
+ // COMPILE PROGRAM
+ if( anExecutableForm->hasProgram() )
+ {
+ AvmProgram * aProgram;
+
+ avm_size_t offset = 0;
+ for( ; offset < anExecutableForm->getProgram().size() ; ++offset )
+ {
+ aProgram = anExecutableForm->getProgram().rawAt(offset);
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "<| compiling<program>: "
+ << aProgram->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ mProgramCompiler.compileProgram( aProgram );
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+// (*itProg)->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << TAB_DECR_INDENT << ">| compiling<program>: "
+ << aProgram->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+ }
+ }
+
+
+ const Machine * aMachine = anExecutableForm->getAstMachine();
+
+ // Compile all specific machine
+ if( aMachine->getSpecifier().isMocStateTransitionStructure() )
+ {
+ compileExecutableMocStateTransitionStructure(anExecutableForm);
+ }
+ else if( aMachine->getSpecifier().isMocCompositeStructure() )
+ {
+ compileExecutableMocCompositeStructure(anExecutableForm);
+ }
+ else
+ {
+ // MOC Attribute for mutable Schedule
+ anExecutableForm->setMutableSchedule(
+ anExecutableForm->hasOnSchedule() );
+
+ /*
+ * Compiling communication
+ */
+ bool hasSynchronizeMachine = false;
+ bool hasUpdateBuffer = false;
+
+ mComCompiler.compileCommunication(anExecutableForm,
+ hasUpdateBuffer, hasSynchronizeMachine);
+
+ if( anExecutableForm->hasOnRun() )
+ {
+ //!! NOTHING
+ }
+ else if( anExecutableForm->hasOnRtc() )
+ {
+ anExecutableForm->setOnRun(StatementConstructor::newCode(
+ OperatorManager::OPERATOR_RTC));
+ }
+
+ else if( anExecutableForm->hasOnSchedule() )
+ {
+ anExecutableForm->setOnRun( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_SCHEDULE_INVOKE));
+ }
+ }
+
+//AVM_OS_TRACE << TAB << ">| compiling<machine>: "
+// << str_header( aMachine ) << std::endl << std::endl;
+}
+
+
+/**
+ * compile
+ * specification
+ */
+void Compiler::compileSystem(ExecutableForm * anExecutableForm)
+{
+ const System * aSystem = anExecutableForm->getAstSystem();
+
+//AVM_OS_TRACE << TAB << "<| compiling<system>: "
+// << aSystem->getFullyQualifiedNameID() << std::endl;
+
+ // Compile all specific machine
+ if( aSystem->getSpecifier().isMocStateTransitionStructure() )
+ {
+ compileExecutableMocStateTransitionStructure(anExecutableForm);
+ }
+ else //if( aSystem->getSpecifier().isMocCompositeStructure()
+ //|| (not aSystem->hasRunnableBehavior()) )
+ {
+ compileExecutableMocCompositeStructure(anExecutableForm);
+ }
+
+ if( not anExecutableForm->hasOnInit() )
+ {
+ anExecutableForm->setOnInit( StatementConstructor::nopCode() );
+ }
+
+ if( anExecutableForm->hasOnIRun() )
+ {
+ if( anExecutableForm->hasOnRun() )
+ {
+ anExecutableForm->setOnRun(
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_SEQUENCE_SIDE,
+ anExecutableForm->getOnIRun(),
+ anExecutableForm->getOnRun()) );
+ }
+ else
+ {
+ anExecutableForm->setOnRun( anExecutableForm->getOnIRun() );
+ }
+ }
+ else if( (not anExecutableForm->hasOnSchedule())
+ && (not anExecutableForm->hasOnRun()) )
+ {
+ anExecutableForm->setOnRun( StatementConstructor::nopCode() );
+ }
+
+
+//AVM_OS_TRACE << TAB << ">| compiling<system>: "
+// << aSystem->getFullyQualifiedNameID() << std::endl << std::endl;
+}
+
+
+
+
+/**
+ * compile
+ * statemachine
+ */
+void Compiler::compileStatemachine(ExecutableForm * anExecutableForm)
+{
+ const Machine * aStatemachine = anExecutableForm->getAstMachine();
+
+//AVM_OS_TRACE << TAB << "<| compiling<statemachine>: "
+// << str_header( aStatemachine ) << std::endl;
+
+ // PUSH MOC
+ WObject * moc_transition = NULL;//aStatemachine::getTransitionMoc();
+ if( moc_transition != NULL )
+ {
+ mTransitionCompiler.pushMoc(moc_transition);
+ }
+
+ // Compile all specific statemachine
+ if( aStatemachine->getSpecifier().hasFamilyPseudostateEnding() )
+ {
+ compilePseudostateEnding(anExecutableForm);
+ }
+ else if( aStatemachine->getSpecifier().hasPseudostateMocHISTORY() )
+ {
+ compileStatemachineHistory(anExecutableForm);
+ }
+ else if( aStatemachine->getSpecifier().isPseudostate() )
+ {
+ compileStatemachinePseudo(anExecutableForm);
+ }
+
+ else if( aStatemachine->getSpecifier().isStateBasic() )
+ {
+ compileStatemachineBasic(anExecutableForm);
+ }
+
+ else if( aStatemachine->getSpecifier().isMocStateTransitionStructure() )
+ {
+ compileExecutableMocStateTransitionStructure(anExecutableForm);
+ }
+ else if( aStatemachine->getSpecifier().isMocCompositeStructure() )
+ {
+ compileExecutableMocCompositeStructure(anExecutableForm);
+ }
+ else if( aStatemachine->getSpecifier().isComponentProcedure() )
+ {
+ compileExecutableMocCompositeStructure(anExecutableForm);
+ }
+
+ else
+ {
+ incrErrorCount();
+ aStatemachine->errorLocation(AVM_OS_WARN)
+ << "Unexpected statemachine type << "
+ << str_header( aStatemachine ) << " >>"
+ << std::endl << std::endl;
+ }
+
+
+ // COMPILE TRANSITION
+ if( anExecutableForm->hasTransition() )
+ {
+ AvmTransition * aTransition;
+
+ avm_size_t offset = 0;
+ for( ; offset < anExecutableForm->getTransition().size() ; ++offset )
+ {
+ aTransition = anExecutableForm->getTransition().rawAt(offset);
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "<| compiling<transition>: "
+ << aTransition->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ mTransitionCompiler.compileTransition( aTransition );
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+// (*itProg)->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << TAB_DECR_INDENT << ">| compiling<transition>: "
+ << aTransition->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+ }
+
+ if( anExecutableForm->getSpecifier().hasFeatureInputEnabled() )
+ {
+ computeInputEnabledCom( anExecutableForm );
+ }
+ }
+
+
+ // COMPILE PROGRAM
+ if( anExecutableForm->hasProgram() )
+ {
+ AvmProgram * aProgram;
+
+ avm_size_t offset = 0;
+ for( ; offset < anExecutableForm->getProgram().size() ; ++offset )
+ {
+ aProgram = anExecutableForm->getProgram().rawAt(offset);
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "<| compiling<program>: "
+ << aProgram->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ mProgramCompiler.compileProgram( aProgram );
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+// (*itProg)->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << TAB_DECR_INDENT << ">| compiling<program>: "
+ << aProgram->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+ }
+
+ if( anExecutableForm->getSpecifier().hasFeatureInputEnabled() )
+ {
+ computeInputEnabledCom( anExecutableForm );
+ }
+ }
+
+
+ // POP MOC
+ if( moc_transition != NULL )
+ {
+ mTransitionCompiler.popMoc();
+ }
+
+//AVM_OS_TRACE << TAB << ">| compiling<statemachine>: "
+// << str_header( aStatemachine ) << std::endl;
+}
+
+
+void Compiler::compileExecutableMocCompositeStructure(
+ ExecutableForm * anExecutableForm)
+{
+ const Machine * anExecutableSpec = anExecutableForm->getAstMachine();
+
+//AVM_OS_TRACE << TAB << "<| compiling executable< moc: and >: "
+// << str_header( anExecutableSpec ) << std::endl;
+
+ bool hasInstanceStatic = anExecutableSpec->hasMachine();
+ bool hasSynchronizeMachine = false;
+ bool hasUpdateBuffer = false;
+
+
+ // MOC Attribute for mutable Schedule
+ anExecutableForm->setMutableSchedule( false );
+
+ /**
+ * compile all routines which defined the executable's behavior
+ */
+ compileAllBehavioralRoutines( anExecutableForm );
+
+ /*
+ * Compiling communication
+ */
+ mComCompiler.compileCommunication(anExecutableForm,
+ hasUpdateBuffer, hasSynchronizeMachine);
+
+
+ /*
+ * OnRun
+ * whith high priority order
+ *
+ * StrongAbort Transition
+ * OnIRun
+ * ( Simple Transition or submachine ) depend on MOC
+ * WeakAbort Transition
+ * NormalTerminaison Transition
+ */
+
+ BFCode onRunProgram;
+
+ // Update Buffer
+ if( hasInstanceStatic )
+ {
+ if( hasSynchronizeMachine ) // only if has RDV protocol
+ {
+ anExecutableForm->setRdvCommunication( hasSynchronizeMachine );
+
+ setRdvScheduling( anExecutableForm );
+ }
+
+ if( anExecutableForm->hasOnRun() )
+ {
+ onRunProgram = anExecutableForm->getOnRun();
+
+ anExecutableForm->setOnRun( BFCode::REF_NULL );
+
+ if( not AvmCodeFactory::contains(anExecutableForm,
+ onRunProgram, AVM_OPCODE_SCHEDULE_INVOKE) )
+ {
+ if( (not anExecutableForm->hasOnRtc()) &&
+ AvmCodeFactory::contains(anExecutableForm,
+ onRunProgram, AVM_OPCODE_RTC) )
+ {
+ anExecutableForm->setOnRtc(
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_SCHEDULE_INVOKE) );
+ }
+ else if( anExecutableForm->hasOnSchedule()
+ || anExecutableForm->isMutableSchedule() )
+ {
+ onRunProgram = StatementConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE, onRunProgram,
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_SCHEDULE_INVOKE) );
+ }
+ }
+ }
+ else if( anExecutableForm->hasOnSchedule()
+ || anExecutableForm->isMutableSchedule() )
+ {
+ onRunProgram = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_SCHEDULE_INVOKE);
+ }
+
+ if( hasUpdateBuffer ) // only if has BROADCAST protocol
+ {
+ onRunProgram = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_UPDATE_BUFFER, onRunProgram);
+ }
+ }
+
+ if( anExecutableSpec->hasOutgoingTransition() )
+ {
+ // Compile Statemachine Transition
+ mTransitionCompiler.compileStatemachineTransition(
+ anExecutableForm, onRunProgram );
+ }
+ else if( onRunProgram.valid() )
+ {
+ anExecutableForm->setOnRun( onRunProgram );
+ }
+ else if( anExecutableForm->hasOnIRun() )
+ {
+ anExecutableForm->setOnRun( StatementConstructor::nopCode() );
+ }
+
+
+//AVM_OS_TRACE << TAB << ">| compiling executable< moc: and >: "
+// << str_header( anExecutableSpec ) << std::endl;
+}
+
+
+void Compiler::compileExecutableMocStateTransitionStructure(
+ ExecutableForm * anExecutableForm)
+{
+ const Machine * anExecutableSpec = anExecutableForm->getAstMachine();
+
+//AVM_OS_TRACE << TAB << "<| compiling executable< moc: and >: "
+// << str_header( anExecutableSpec ) << std::endl;
+
+ bool hasSynchronizeMachine = false;
+ bool hasUpdateBuffer = false;
+
+// /*
+// * Compiling program
+// */
+//
+// TableOfAvmProgram::iterator it = anExecutableForm->getProgram().begin();
+// for( ; it != anExecutableForm->getProgram().end() ; ++it )
+// {
+// compileProgram(anExecutableForm, (*it));
+// }
+
+
+ // MOC Attribute for mutable Schedule
+ anExecutableForm->setMutableSchedule( true );
+
+ if( anExecutableSpec->hasMachine() )
+ {
+ /*
+ * ON_INIT
+ * ON_ENABLE
+ */
+ // non determinism: simulation of enabling for
+ // each [ start ] state or [ initial ] state ...
+ BFCode onInitCode( OperatorManager::OPERATOR_NONDETERMINISM );
+
+ BFCode onEnableCode( OperatorManager::OPERATOR_NONDETERMINISM );
+
+ BFCode onScheduleCode( OperatorManager::OPERATOR_NONDETERMINISM );
+
+ bool hasnotOwnedPseudostateHistory = (not anExecutableSpec->
+ getOwnedElementsSpecifier().hasPseudostateMocHISTORY());
+
+ bool hasnotOwnedPseudostateInitialOrStateStart =
+ (not anExecutableSpec->
+ getOwnedElementsSpecifier().hasMocINITIAL_START());
+
+ TableOfSymbol::const_iterator itMachine =
+ anExecutableForm->instance_static_begin();
+ TableOfSymbol::const_iterator endMachine =
+ anExecutableForm->instance_static_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ const Specifier & itSpecifier =
+ (*itMachine).getExecutable()->getSpecifier();
+
+ if( itSpecifier.isPseudostateInitialOrStateStart() )
+ {
+ onInitCode->append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_INIT, (*itMachine) ) );
+
+ if( hasnotOwnedPseudostateHistory )
+ {
+ onEnableCode->append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ENABLE_INVOKE,
+ (*itMachine) ) );
+ }
+
+ onScheduleCode->append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_RUN, (*itMachine)) );
+ }
+ else if( itSpecifier.hasPseudostateHistory() )
+ {
+ onEnableCode->append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ENABLE_INVOKE,
+ (*itMachine) ) );
+ }
+ else if( hasnotOwnedPseudostateInitialOrStateStart )
+ {
+ onInitCode->append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_INIT, (*itMachine) ) );
+
+ if( hasnotOwnedPseudostateHistory )
+ {
+ onEnableCode->append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ENABLE_SET,
+ (*itMachine) ),
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ENABLE_INVOKE,
+ (*itMachine) ) ) );
+ }
+
+ onScheduleCode->append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_RUN, (*itMachine) ) );
+ }
+ }
+
+ // ON INIT
+ if( onInitCode->nonempty() )
+ {
+ anExecutableForm->setOnInit( StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ anExecutableForm->getOnInit(),
+ (onInitCode->singleton() ?
+ onInitCode->first().bfCode() : onInitCode) ) );
+ }
+
+ // ON ENABLE
+ if( onEnableCode->nonempty() )
+ {
+ anExecutableForm->setOnEnable( StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ anExecutableForm->getOnEnable(),
+ (onEnableCode->singleton() ?
+ onEnableCode->first().bfCode() : onEnableCode) ) );
+ }
+
+ /**
+ * ON SCHEDULE
+ */
+ if( anExecutableForm->hasOnSchedule() )
+ {
+ incrErrorCount();
+ anExecutableSpec->errorLocation(AVM_OS_WARN)
+ << "Unexpected a State-Transition-System << "
+ << str_header( anExecutableSpec )
+ << " >> with user schedule code: "
+ << anExecutableForm->getOnSchedule() << std::endl;
+ }
+ else if( onScheduleCode->nonempty() )
+ {
+ anExecutableForm->setOnSchedule( StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ anExecutableForm->getOnSchedule(),
+ (onScheduleCode->singleton() ?
+ onScheduleCode->first().bfCode() : onScheduleCode) ) );
+ }
+ else if( anExecutableForm->hasOneInstanceStatic() )
+ {
+ anExecutableForm->setOnSchedule( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_RUN,
+ anExecutableForm->firstInstanceStatic() ) );
+ }
+
+ /*
+ * ON_DISABLE
+ */
+ if( anExecutableForm->hasOnDisable() )
+ {
+ anExecutableForm->setOnDisable(
+ StatementConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_DISABLE_CHILD),
+ anExecutableForm->getOnDisable() ) );
+ }
+ else
+ {
+ anExecutableForm->setOnDisable( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_DISABLE_CHILD),
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_DISABLE_SELF) ) );
+ }
+ }
+
+ /*
+ * Compiling communication
+ */
+ mComCompiler.compileCommunication(anExecutableForm,
+ hasUpdateBuffer, hasSynchronizeMachine);
+
+
+ /*
+ * OnRun
+ * whith high priority order
+ *
+ * StrongAbort Transition
+ * OnIRun
+ * ( Simple Transition or submachine ) depend on MOC
+ * WeakAbort Transition
+ * NormalTerminaison Transition
+ */
+
+ BFCode onRunProgram;
+
+ // Update Buffer
+ if( anExecutableSpec->hasMachine() )
+ {
+ if( hasSynchronizeMachine ) // only if has RDV protocol
+ {
+ anExecutableForm->setRdvCommunication( hasSynchronizeMachine );
+
+ setRdvScheduling( anExecutableForm );
+ }
+
+ if( anExecutableForm->hasOnRun() )
+ {
+ onRunProgram = anExecutableForm->getOnRun();
+
+ if( AvmCodeFactory::contains(anExecutableForm,
+ onRunProgram, AVM_OPCODE_SCHEDULE_INVOKE) )
+ {
+ //!!NOTHING
+ }
+ else if( (not anExecutableForm->hasOnRtc())
+ && AvmCodeFactory::contains(anExecutableForm,
+ onRunProgram, AVM_OPCODE_RTC) )
+ {
+ anExecutableForm->setOnRtc(
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_SCHEDULE_INVOKE) );
+ }
+ else
+ {
+ onRunProgram = StatementConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE, onRunProgram,
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_SCHEDULE_INVOKE) );
+ }
+
+ anExecutableForm->setOnRun( BFCode::REF_NULL );
+ }
+ else
+ {
+ onRunProgram = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_SCHEDULE_INVOKE);
+ }
+
+ if( hasUpdateBuffer ) // only if has BROADCAST protocol
+ {
+ onRunProgram = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_UPDATE_BUFFER, onRunProgram);
+ }
+ }
+
+ if( anExecutableSpec->hasOutgoingTransition() )
+ {
+ // Compile Statemachine Transition
+ mTransitionCompiler.compileStatemachineTransition(
+ anExecutableForm, onRunProgram);
+ }
+ else if( onRunProgram.valid() )
+ {
+ anExecutableForm->setOnRun( onRunProgram );
+ }
+ else if( anExecutableForm->hasOnIRun() )
+ {
+ anExecutableForm->setOnRun( StatementConstructor::nopCode() );
+ }
+
+
+//AVM_OS_TRACE << TAB << ">| compiling executable< moc: and >: "
+// << str_header( anExecutableSpec ) << std::endl;
+}
+
+
+void Compiler::compilePseudostateEnding(ExecutableForm * anExecutableForm)
+{
+ const Machine * aStatemachine = anExecutableForm->getAstMachine();
+
+//AVM_OS_TRACE << TAB << "<| compiling<statemachine>: "
+// << str_header( aStatemachine ) << std::endl;
+
+ // MOC Attribute for mutable Schedule
+ anExecutableForm->setMutableSchedule( false );
+
+ /*
+ * ON ENABLE
+ */
+ BFCode onTerminalCode;
+
+ if( aStatemachine->getSpecifier().isPseudostateTerminal() )
+ {
+ onTerminalCode = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_DESTROY, ExecutableLib::MACHINE_PARENT);
+ }
+ else //if( aStatemachine->getSpecifier().isPseudostateReturn() )
+ {
+ onTerminalCode = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_FINAL);
+ }
+
+ anExecutableForm->setOnEnable( StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ anExecutableForm->getOnEnable(), onTerminalCode) );
+
+ if( aStatemachine->hasOutgoingTransition() )
+ {
+ incrErrorCount();
+ aStatemachine->errorLocation(AVM_OS_WARN)
+ << "Unexpected state< terminal > << "
+ << str_header( aStatemachine )
+ << " >> with outgoing transitions"
+ << std::endl << std::endl;
+ }
+
+//aStatemachine->toStream(AVM_OS_TRACE << TAB);
+//anExecutableForm->toStream(AVM_OS_TRACE << TAB);
+//AVM_OS_TRACE << TAB << ">| compiling<statemachine>: "
+// << str_header( aStatemachine ) << std::endl;
+}
+
+
+void Compiler::compileStatemachineHistory(ExecutableForm * anExecutableForm)
+{
+ const Machine * aStatemachine = anExecutableForm->getAstMachine();
+
+//AVM_OS_TRACE << TAB << "<| compiling<statemachine>: "
+// << str_header( aStatemachine ) << std::endl;
+
+ // MOC Attribute for mutable Schedule
+ anExecutableForm->setMutableSchedule( false );
+
+ if( aStatemachine->hasOutgoingTransition() )
+ {
+ // Compile Statemachine Transition
+ mTransitionCompiler.compileStatemachineTransition(
+ anExecutableForm , anExecutableForm->getOnRun());
+ }
+
+ BFCode onEnableCode = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_RUN);
+
+ BFCode onHistoryCode = StatementConstructor::newCode(
+ aStatemachine->getSpecifier().isPseudostateDeepHistory() ?
+ OperatorManager::OPERATOR_DEEP_HISTORY_INVOKE :
+ OperatorManager::OPERATOR_SHALLOW_HISTORY_INVOKE,
+ ExecutableLib::MACHINE_PARENT);
+
+ if( anExecutableForm->hasOnRun() )
+ {
+ anExecutableForm->setOnRun( StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_PRIOR_GT,
+ anExecutableForm->getOnRun(), onHistoryCode) );
+ }
+ else if( anExecutableForm->hasOnIRun() )
+ {
+ anExecutableForm->setOnRun( onHistoryCode );
+ }
+ else
+ {
+ onEnableCode = onHistoryCode;
+ }
+
+
+ /*
+ * ON INIT
+ * ON ENABLE
+ */
+ // this is aStatemachine->getSpecifier().isPseudostate()
+ // ON INIT
+ anExecutableForm->setOnInit( StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ anExecutableForm->getOnInit(), onEnableCode) );
+
+ // ON ENABLE
+ anExecutableForm->setOnEnable( StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ anExecutableForm->getOnEnable(), onEnableCode) );
+
+//aStatemachine->toStream(AVM_OS_TRACE << TAB);
+//anExecutableForm->toStream(AVM_OS_TRACE << TAB);
+//AVM_OS_TRACE << TAB << ">| compiling<statemachine>: "
+// << str_header( aStatemachine ) << std::endl;
+}
+
+
+void Compiler::compileStatemachinePseudo(ExecutableForm * anExecutableForm)
+{
+ const Machine * aStatemachine = anExecutableForm->getAstMachine();
+
+//AVM_OS_TRACE << TAB << "<| compiling<statemachine>: "
+// << str_header( aStatemachine ) << std::endl;
+
+ // MOC Attribute for mutable Schedule
+ anExecutableForm->setMutableSchedule( false );
+
+ /*
+ * ON INIT
+ * ON ENABLE
+ */
+ BFCode onEnableCode = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_RUN);
+
+ // ON INIT
+ if( aStatemachine->getSpecifier().isPseudostateInitial()
+ && anExecutableForm->hasOnEnable() )
+ {
+ anExecutableForm->setOnInit(
+ StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ anExecutableForm->getOnInit(),
+ anExecutableForm->getOnEnable(), onEnableCode) );
+ }
+ else
+ {
+ anExecutableForm->setOnInit( StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ anExecutableForm->getOnInit(), onEnableCode) );
+ }
+
+ anExecutableForm->setOnEnable(
+ StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ anExecutableForm->getOnEnable(), onEnableCode) );
+
+
+
+ /*
+ * Schedule State Transition
+ */
+ if( aStatemachine->getSpecifier().isPseudostateFork() )
+ {
+ if( aStatemachine->hasOutgoingTransition() &&
+ aStatemachine->getBehavior()->
+ getOutgoingTransitions().populated() )
+ {
+ // Schedule State< fork > Transition
+ mTransitionCompiler.compileStateForkOutputTransition(
+ anExecutableForm, anExecutableForm->getOnRun());
+ }
+ else
+ {
+ incrErrorCount();
+ aStatemachine->errorLocation(AVM_OS_WARN)
+ << "Unexpected pseudostate< fork > << "
+ << str_header( aStatemachine )
+ << " >> with less than 2 outgoing transitions"
+ << std::endl << std::endl;
+ }
+ }
+
+ else if( aStatemachine->getSpecifier().isPseudostateJoin() )
+ {
+ if( aStatemachine->hasIncomingTransition()
+ && aStatemachine->getBehavior()->
+ getIncomingTransitions().populated() )
+ {
+ // SYnchronize incoming Transition
+ mTransitionCompiler.compileStateJoinInputTransition(
+ anExecutableForm );
+ }
+ else
+ {
+ incrErrorCount();
+ aStatemachine->errorLocation(AVM_OS_WARN)
+ << "Unexpected pseudostate< join > << "
+ << str_header( aStatemachine )
+ << " >> with less than 2 incoming transitions"
+ << std::endl << std::endl;
+ }
+
+
+ if( aStatemachine->hasOutgoingTransition() )
+ {
+ // Compile Statemachine Transition
+ mTransitionCompiler.compileStatemachineTransition(
+ anExecutableForm , anExecutableForm->getOnRun());
+ }
+ else
+ {
+ incrErrorCount();
+ aStatemachine->errorLocation(AVM_OS_WARN)
+ << "Unexpected pseudostate< join > << "
+ << str_header( aStatemachine )
+ << " >> without outgoing transitions"
+ << std::endl << std::endl;
+ }
+ }
+
+
+ else if( aStatemachine->hasOutgoingTransition() )
+ {
+ // Compile Statemachine Transition
+ mTransitionCompiler.compileStatemachineTransition(
+ anExecutableForm , anExecutableForm->getOnRun() );
+ }
+
+
+ if( not anExecutableForm->hasOnRun() )
+ {
+ if( not aStatemachine->getSpecifier().hasFamilyPseudostateENDING() )
+ {
+ incrWarningCount();
+ aStatemachine->warningLocation(AVM_OS_WARN)
+ << "No eval code for << " << str_header( aStatemachine )
+ << " >> which is not TERMINAL or RETURN moc!" << std::endl;
+ }
+ else if( aStatemachine->getSpecifier().isPseudostateInitial() )
+ {
+ incrErrorCount();
+ aStatemachine->errorLocation(AVM_OS_WARN)
+ << "No eval code for << " << str_header( aStatemachine )
+ << " >> which is an INITIAL state!!!" << std::endl;
+
+ anExecutableForm->setOnRun( StatementConstructor::nopCode() );
+ }
+ AVM_OS_WARN << std::endl;
+
+ if( anExecutableForm->hasOnIRun() )
+ {
+ anExecutableForm->setOnRun( StatementConstructor::nopCode() );
+ }
+ }
+
+//aStatemachine->toStream(AVM_OS_TRACE << TAB);
+//anExecutableForm->toStream(AVM_OS_TRACE << TAB);
+//AVM_OS_TRACE << TAB << ">| compiling<statemachine>: "
+// << str_header( aStatemachine ) << std::endl;
+}
+
+
+void Compiler::compileStatemachineBasic(ExecutableForm * anExecutableForm)
+{
+ const Machine * aStatemachine = anExecutableForm->getAstMachine();
+
+//AVM_OS_TRACE << TAB << "<| compiling<statemachine>: "
+// << str_header( aStatemachine ) << std::endl;
+
+ // MOC Attribute for mutable Schedule
+ anExecutableForm->setMutableSchedule( false );
+
+
+ // ON INIT
+ if( aStatemachine->getSpecifier().isStateStart()
+ && anExecutableForm->hasOnEnable() )
+ {
+ anExecutableForm->setOnInit(
+ StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ anExecutableForm->getOnInit(),
+ anExecutableForm->getOnEnable()) );
+ }
+
+
+ /*
+ * Schedule State Transition
+ */
+ if( aStatemachine->getSpecifier().isStateFinal() )
+ {
+ anExecutableForm->setOnEnable(
+ StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ anExecutableForm->getOnEnable(),
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_FINAL)) );
+
+ if( aStatemachine->hasOutgoingTransition() )
+ {
+ incrErrorCount();
+ aStatemachine->errorLocation(AVM_OS_WARN)
+ << "Unexpected state< final > << "
+ << str_header( aStatemachine )
+ << " >> with outgoing transitions"
+ << std::endl << std::endl;
+ }
+ }
+
+
+ else if( aStatemachine->hasOutgoingTransition() )
+ {
+ // Compile Statemachine Transition
+ mTransitionCompiler.compileStatemachineTransition(
+ anExecutableForm , anExecutableForm->getOnRun() );
+ }
+
+ if( aStatemachine->getSpecifier().isStateSync() )
+ {
+ Variable * aVar = new Variable(
+ const_cast< Machine * >( aStatemachine ),
+ Modifier::PROPERTY_PUBLIC_VOLATILE_MODIFIER,
+ TypeManager::INTEGER,
+ aStatemachine->getNameID() + "#syncVar" );
+
+ const_cast< Machine * >( aStatemachine )->
+ getPropertyPart().saveOwnedVariable( aVar );
+
+ InstanceOfData * syncInstance = new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ anExecutableForm, aVar, TypeManager::INTEGER,
+ anExecutableForm->getDataSize(),
+ Modifier::PROPERTY_PUBLIC_VOLATILE_MODIFIER);
+//!![MIGRATION]:MODIFIER
+// Modifier::PROPERTY_VOLATILE_FEATURE);
+ syncInstance->setValue( ExpressionConstant::INTEGER_ZERO );
+
+ const BF & syncVar = anExecutableForm->saveData(syncInstance);
+
+
+ BFCode incrSyncVar = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ASSIGN, syncVar,
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_PLUS, syncVar,
+ ExpressionConstant::INTEGER_ONE) );
+
+ anExecutableForm->setOnEnable(
+ StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+ anExecutableForm->getOnEnable(), incrSyncVar) );
+
+
+ BFCode decrSyncVar = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ASSIGN, syncVar,
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_PLUS, syncVar,
+ ExpressionConstant::INTEGER_MINUS_ONE) );
+
+ anExecutableForm->setOnDisable(
+ StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+ anExecutableForm->getOnDisable(), decrSyncVar) );
+
+
+ BFCode guardSyncVar = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_GUARD,
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_GT, syncVar,
+ ExpressionConstant::INTEGER_ZERO) );
+
+ anExecutableForm->setOnRun(
+ StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ guardSyncVar, anExecutableForm->getOnRun()) );
+ }
+
+
+ if( anExecutableForm->hasOnIRun()
+ && (not anExecutableForm->hasOnRun()) )
+ {
+ anExecutableForm->setOnRun( StatementConstructor::nopCode() );
+ }
+
+ if( (not anExecutableForm->hasOnRun())
+ && (not aStatemachine->getSpecifier().isStateFinal()) )
+ {
+ incrWarningCount();
+ aStatemachine->warningLocation(AVM_OS_WARN)
+ << "No eval code for << " << str_header( aStatemachine )
+ << " >> which is not FINAL!"
+ << std::endl << std::endl;
+ }
+
+//aStatemachine->toStream(AVM_OS_TRACE << TAB);
+//anExecutableForm->toStream(AVM_OS_TRACE << TAB);
+//AVM_OS_TRACE << TAB << ">| compiling<statemachine>: "
+// << str_header( aStatemachine ) << std::endl;
+}
+
+
+/**
+ * compile
+ * statemachine input_enabled
+ */
+
+void Compiler::removeSubmachineInputEnabledCode(
+ ExecutableForm * anExecutableForm)
+{
+ if( anExecutableForm->hasInstanceStatic() )
+ {
+ TableOfSymbol::const_iterator itMachine =
+ anExecutableForm->instance_static_begin();
+ TableOfSymbol::const_iterator endMachine =
+ anExecutableForm->instance_static_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ if( (*itMachine).machine().
+ getSpecifier().isDesignPrototypeStatic()
+ && (*itMachine).getExecutable()->hasOnRun() )
+ {
+ if( (*itMachine).getExecutable()->
+ getOnRun()->isOpCode( AVM_OPCODE_INPUT_ENABLED ) )
+ {
+ BFCode newCode = (*itMachine).getExecutable()->
+ getOnRun()->first().bfCode();
+ (*itMachine).getExecutable()->setOnRun( newCode );
+ }
+
+ removeSubmachineInputEnabledCode(
+ (*itMachine).getExecutable() );
+ }
+ }
+ }
+}
+
+
+void Compiler::computeInputEnabledCom(ExecutableForm * anExecutableForm)
+{
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT(
+ anExecutableForm->getSpecifier().hasFeatureInputEnabled() )
+ << "Unexpected a non INPUT_ENABLED Executable !!!"
+ << SEND_EXIT;
+
+ // input enabled running code
+ CommunicationDependency::computeInputEnabledCom(
+ anExecutableForm, anExecutableForm->getOnRun() );
+
+ if( anExecutableForm->getSpecifier().isState() )
+ {
+ computeInputEnabledBuffer( anExecutableForm );
+
+ if( anExecutableForm->getInputEnabledBuffer().populated() )
+ {
+ incrErrorCount();
+ anExecutableForm->getAstMachine()->errorLocation(AVM_OS_WARN)
+ << "InputEnabled:> NO SUPPORT for multiple buffer "
+ "at runtime for << "
+ << str_header( anExecutableForm->getAstMachine() )
+ << " >> !" << std::endl;
+
+ AVM_OS_FATAL_ERROR_EXIT << "Expect the Future !!!" << SEND_EXIT;
+ }
+ else if( anExecutableForm->getInputEnabledBuffer().empty() )
+ {
+ incrErrorCount();
+ anExecutableForm->getAstMachine()->errorLocation(AVM_OS_WARN)
+ << "InputEnabled:> Unfound runtime buffer for << "
+ << str_header( anExecutableForm->getAstMachine() )
+ << " >> !" << std::endl;
+ }
+
+ if( anExecutableForm->hasContainer() &&
+ anExecutableForm->getExecutableContainer()->hasTransition() )
+ {
+ //!! NOTHING
+ }
+ else
+ {
+ anExecutableForm->setOnRun( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_INPUT_ENABLED,
+ anExecutableForm->getOnRun() ));
+
+ removeSubmachineInputEnabledCode( anExecutableForm );
+ }
+ }
+}
+
+
+void Compiler::computeInputEnabledBuffer(ExecutableForm * anExecutableForm)
+{
+ for( ExecutableForm * tmpExec = anExecutableForm ; tmpExec != NULL ;
+ tmpExec = tmpExec->getExecutableContainer() )
+ {
+ if( tmpExec->hasBuffer() )
+ {
+ const TableOfSymbol & bufferTable = tmpExec->getBuffer();
+ for( avm_size_t offset = 0 ; offset < bufferTable.size() ; ++offset )
+ {
+ anExecutableForm->addInputEnabledBuffer(
+ bufferTable[ offset ].rawBuffer());
+ }
+ return;
+ }
+
+ if( tmpExec->hasRouter4This() )
+ {
+ return;
+ }
+
+ if( tmpExec->hasRouter4Instance() )
+ {
+ return;
+ }
+
+ if( tmpExec->hasRouter4Model() )
+ {
+ return;
+ }
+ }
+}
+
+
+/**
+ * compile statemachine
+ * initialization
+ * enabling
+ * scheduling
+ */
+void Compiler::compileAllBehavioralRoutines(ExecutableForm * theExecutable)
+{
+ const Machine * aMachine = theExecutable->getAstMachine();
+
+ if( aMachine->hasMachine() )
+ {
+ //compiling initialization
+ compileBehaviorInitialization(theExecutable);
+
+ //compiling scheduler
+ compileBehaviorScheduling(theExecutable);
+
+ //enabling
+ compileBehaviorEnabling(theExecutable);
+
+ //disabling
+ compileBehaviorDisabling(theExecutable);
+
+ //aborting
+ compileBehaviorAborting(theExecutable);
+ }
+}
+
+
+
+void Compiler::compileBehaviorInitialization(ExecutableForm * theExecutable)
+{
+ BFCodeList listOfCode;
+
+ ListOfInstanceOfMachine usedInstance;
+ if( theExecutable->hasOnInit() )
+ {
+ StatementFactory::collectActivityMachine(
+ theExecutable, AVM_OPCODE_INIT, AVM_OPCODE_START,
+ theExecutable->getOnInit(), usedInstance);
+ }
+
+ TableOfSymbol::const_iterator itMachine =
+ theExecutable->instance_static_begin();
+ TableOfSymbol::const_iterator endMachine =
+ theExecutable->instance_static_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ if( (*itMachine).getExecutable()->isSchedulable()
+ && (*itMachine).machine().isAutoStart()
+ && (not usedInstance.contains( (*itMachine).rawMachine() )) )
+ {
+ listOfCode.append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_INIT, (*itMachine)) );
+ }
+ }
+
+ /**
+ * Optimisization
+ */
+ BFCode onInitCode;
+ if( listOfCode.populated() )
+ {
+ onInitCode = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_STRONG_SYNCHRONOUS, listOfCode);
+ }
+ else if( listOfCode.nonempty() )
+ {
+ onInitCode = listOfCode.first();
+ }
+ else if( not theExecutable->hasOnInit() )
+ {
+// incrWarningCount();
+ theExecutable->getAstElement()->warningLocation(AVM_OS_LOG)
+ << "Unfound InstanceStatic for onInit code compilation "
+ "of composite machine << "
+ << theExecutable->getAstElement()->getFullyQualifiedNameID()
+ << " >>" << std::endl << std::endl;
+ }
+
+ if( onInitCode.valid() )
+ {
+ theExecutable->setOnInit(
+ StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ theExecutable->getOnInit(), onInitCode) );
+ }
+
+ // onSTART
+ theExecutable->setOnStart(
+ StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ theExecutable->getOnStart(),
+ theExecutable->getOnInit()) );
+}
+
+
+void Compiler::compileBehaviorEnabling(ExecutableForm * theExecutable)
+{
+ BFCodeList listOfCode;
+
+ ListOfInstanceOfMachine usedInstance;
+ if( theExecutable->hasOnEnable() )
+ {
+ StatementFactory::collectActivityMachine(
+ theExecutable, AVM_OPCODE_ENABLE_INVOKE,
+ theExecutable->getOnEnable(), usedInstance);
+ }
+
+ TableOfSymbol::const_iterator itMachine =
+ theExecutable->instance_static_begin();
+ TableOfSymbol::const_iterator endMachine =
+ theExecutable->instance_static_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ if( ( (*itMachine).getExecutable()->hasOnInit()
+ || (*itMachine).getExecutable()->hasOnRun()
+ || (*itMachine).getExecutable()->hasOnEnable() )
+ && (*itMachine).machine().isAutoStart()
+ && (not usedInstance.contains( (*itMachine).rawMachine() )) )
+ {
+ listOfCode.append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ENABLE_INVOKE, (*itMachine)) );
+ }
+ }
+
+ /**
+ * Optimisization
+ */
+ BFCode onEnableCode;
+ if( listOfCode.populated() )
+ {
+ onEnableCode = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_STRONG_SYNCHRONOUS, listOfCode);
+ }
+ else if( listOfCode.nonempty() )
+ {
+ onEnableCode = listOfCode.first();
+ }
+ else if( not theExecutable->hasOnInit() )
+ {
+// incrWarningCount();
+ theExecutable->getAstElement()->warningLocation(AVM_OS_LOG)
+ << "Unfound InstanceStatic for onEnable code compilation "
+ "of composite machine << "
+ << theExecutable->getAstElement()->getFullyQualifiedNameID()
+ << " >>" << std::endl << std::endl;
+ }
+
+ if( onEnableCode.valid() )
+ {
+ theExecutable->setOnEnable(
+ StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ theExecutable->getOnEnable(), onEnableCode) );
+ }
+}
+
+
+void Compiler::compileBehaviorDisabling(ExecutableForm * theExecutable)
+{
+ BFCodeList listOfCode;
+
+ ListOfInstanceOfMachine usedInstance;
+ if( theExecutable->hasOnDisable() )
+ {
+ StatementFactory::collectActivityMachine(
+ theExecutable, AVM_OPCODE_DISABLE_INVOKE,
+ theExecutable->getOnDisable(), usedInstance);
+ }
+
+ TableOfSymbol::const_iterator itMachine =
+ theExecutable->instance_static_begin();
+ TableOfSymbol::const_iterator endMachine =
+ theExecutable->instance_static_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ if( (*itMachine).machine().isAutoStart()
+ && (not usedInstance.contains( (*itMachine).rawMachine() )) )
+ {
+ listOfCode.append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_DISABLE_INVOKE, (*itMachine)) );
+ }
+ }
+
+ /**
+ * Optimisization
+ */
+ BFCode onDisableCode;
+ if( listOfCode.populated() )
+ {
+ onDisableCode = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_STRONG_SYNCHRONOUS, listOfCode);
+ }
+ else if( listOfCode.nonempty() )
+ {
+ onDisableCode = listOfCode.first();
+ }
+
+ if( onDisableCode.valid() )
+ {
+ theExecutable->setOnDisable(
+ StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ onDisableCode, theExecutable->getOnDisable()) );
+ }
+}
+
+
+void Compiler::compileBehaviorAborting(ExecutableForm * theExecutable)
+{
+ BFCodeList listOfCode;
+
+ ListOfInstanceOfMachine usedInstance;
+ if( theExecutable->hasOnAbort() )
+ {
+ StatementFactory::collectActivityMachine(
+ theExecutable, AVM_OPCODE_ABORT_INVOKE,
+ theExecutable->getOnAbort(), usedInstance);
+ }
+
+ TableOfSymbol::const_iterator itMachine =
+ theExecutable->instance_static_begin();
+ TableOfSymbol::const_iterator endMachine =
+ theExecutable->instance_static_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ if( (*itMachine).machine().isAutoStart()
+ && (not usedInstance.contains( (*itMachine).rawMachine() )) )
+ {
+ listOfCode.append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ABORT_INVOKE, (*itMachine)) );
+ }
+ }
+
+ /**
+ * Optimisization
+ */
+ BFCode onAbortCode;
+ if( listOfCode.populated() )
+ {
+ onAbortCode = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_STRONG_SYNCHRONOUS, listOfCode);
+ }
+ else if( listOfCode.nonempty() )
+ {
+ onAbortCode = listOfCode.first();
+ }
+
+ if( onAbortCode.valid() )
+ {
+ theExecutable->setOnAbort(
+ StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ onAbortCode, theExecutable->getOnAbort()) );
+ }
+}
+
+
+void Compiler::compileBehaviorScheduling(ExecutableForm * theExecutable)
+{
+ ListOfInstanceOfMachine usedInstance;
+ Operator * defaultConcurrencyOp = NULL;
+ BFCode userScheduler;
+
+ // INIT STEP
+ // Collect unscheduled submachines
+ // get default concurrency policy
+ if( theExecutable->hasOnRun() )
+ {
+ StatementFactory::collectRunMachine(
+ theExecutable, theExecutable->getOnRun(), usedInstance);
+ }
+
+ if( theExecutable->hasOnSchedule() )
+ {
+ userScheduler = theExecutable->getOnSchedule();
+
+ if( userScheduler->empty() )
+ {
+ defaultConcurrencyOp = userScheduler->getOperator();
+ theExecutable->setOnSchedule( userScheduler = BFCode::REF_NULL );
+ }
+ else
+ {
+ if( OperatorManager::isSchedule( userScheduler->getOperator() ) )
+ {
+ defaultConcurrencyOp = userScheduler->getOperator();
+ }
+
+ StatementFactory::collectRunMachine(
+ theExecutable, userScheduler, usedInstance);
+ }
+ }
+
+ if( theExecutable->hasOnConcurrency() )
+ {
+ defaultConcurrencyOp = theExecutable->getOnConcurrencyOperator();
+ }
+ else
+ {
+ if( defaultConcurrencyOp == NULL )
+ {
+ defaultConcurrencyOp = OperatorManager::OPERATOR_INTERLEAVING;
+ }
+
+ theExecutable->setOnConcurrency(
+ StatementConstructor::newCode(defaultConcurrencyOp) );
+ }
+
+ // STEP case for singleton submachine
+ if( usedInstance.empty()
+ && theExecutable->hasOneInstanceStatic()
+ && theExecutable->hasOneInstanceModel() )
+ {
+ BFCode runMachineCode(OperatorManager::OPERATOR_RUN,
+ theExecutable->getInstanceStatic().last());
+
+ if( userScheduler.valid() )
+ {
+ if( userScheduler->isOperator( defaultConcurrencyOp ) )
+ {
+ userScheduler->append( runMachineCode );
+ }
+ else
+ {
+ userScheduler = StatementConstructor::newCode(
+ defaultConcurrencyOp, userScheduler, runMachineCode );
+ }
+
+ theExecutable->setOnSchedule( userScheduler );
+ }
+ else
+ {
+ theExecutable->setOnSchedule( runMachineCode );
+ }
+ }
+
+ // STEP case for many submachines
+ else if( usedInstance.size() < (theExecutable->sizeInstanceStatic()
+ + theExecutable->sizeInstanceModel()) )
+ {
+ BFCode aScheduleCode;
+
+ if( userScheduler.valid() )
+ {
+ aScheduleCode = compileSchedulerRoutine(
+ theExecutable, usedInstance, userScheduler);
+
+ if( aScheduleCode->isnotOperator( defaultConcurrencyOp ) )
+ {
+ aScheduleCode = StatementConstructor::newCode(
+ defaultConcurrencyOp, aScheduleCode );
+ }
+ }
+ else
+ {
+ userScheduler = aScheduleCode =
+ StatementConstructor::newCode( defaultConcurrencyOp );
+ }
+
+ TableOfSymbol::const_iterator itInstance =
+ theExecutable->instance_static_begin();
+ TableOfSymbol::const_iterator endInstance =
+ theExecutable->instance_static_end();
+ for( ; itInstance != endInstance ; ++itInstance )
+ {
+ if( (*itInstance).getExecutable()->isSchedulable()
+ && (not usedInstance.contains((*itInstance).rawMachine())) )
+ {
+ aScheduleCode->append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_RUN, (*itInstance)) );
+ }
+ }
+
+ itInstance = theExecutable->instance_model_begin();
+ endInstance = theExecutable->instance_model_end();
+ for( ; itInstance != endInstance ; ++itInstance )
+ {
+ if( (*itInstance).machine().hasPossibleDynamicInstanciation()
+ && (*itInstance).getExecutable()->isSchedulable()
+ && (not usedInstance.contains((*itInstance).rawMachine())) )
+ {
+ aScheduleCode->append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_RUN, (*itInstance)) );
+ }
+ }
+
+ if( aScheduleCode->singleton() )
+ {
+ aScheduleCode->pop_last_to( userScheduler );
+
+ if( userScheduler.valid() )
+ {
+ theExecutable->setOnSchedule( userScheduler );
+ }
+ }
+ else
+ {
+ theExecutable->setOnSchedule( aScheduleCode );
+ }
+ }
+ else if( userScheduler.valid() )
+ {
+ theExecutable->setOnSchedule( compileSchedulerRoutine(
+ theExecutable, usedInstance, userScheduler) );
+ }
+}
+
+
+void Compiler::setRdvScheduling(ExecutableForm * theExecutable)
+{
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( theExecutable->hasRdvCommunication() )
+ << "Unexpected Executable without RDV comunication !!!"
+ << SEND_EXIT;
+
+
+ BFCode & aScheduleCode = theExecutable->getOnSchedule();
+ switch( aScheduleCode.getAvmOpCode() )
+ {
+ case AVM_OPCODE_ASYNCHRONOUS:
+ {
+ aScheduleCode.setOperator(
+ OperatorManager::OPERATOR_RDV_ASYNCHRONOUS );
+ break;
+ }
+
+ case AVM_OPCODE_STRONG_SYNCHRONOUS:
+ {
+ aScheduleCode.setOperator(
+ OperatorManager::OPERATOR_RDV_STRONG_SYNCHRONOUS );
+ break;
+ }
+
+ case AVM_OPCODE_WEAK_SYNCHRONOUS:
+ {
+ aScheduleCode.setOperator(
+ OperatorManager::OPERATOR_RDV_WEAK_SYNCHRONOUS );
+ break;
+ }
+
+ case AVM_OPCODE_INTERLEAVING:
+ {
+ aScheduleCode.setOperator(
+ OperatorManager::OPERATOR_RDV_INTERLEAVING );
+ break;
+ }
+
+ case AVM_OPCODE_PARALLEL:
+ {
+ aScheduleCode.setOperator(
+ OperatorManager::OPERATOR_RDV_PARALLEL );
+ break;
+ }
+
+ default:
+ {
+ theExecutable->setOnSchedule(StatementConstructor::newCode(
+ OperatorManager::OPERATOR_SYNCHRONIZE, aScheduleCode));
+ break;
+ }
+ }
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/builder/compiler/Compiler.h b/org.eclipse.efm.symbex/src/builder/compiler/Compiler.h
new file mode 100644
index 0000000..d001d12
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/compiler/Compiler.h
@@ -0,0 +1,209 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef BUILDER_COMPILER_COMPILER_H_
+#define BUILDER_COMPILER_COMPILER_H_
+
+#include <builder/compiler/BaseMachineCompiler.h>
+
+#include <builder/compiler/CompilerOfInteraction.h>
+#include <builder/compiler/CompilerOfProgram.h>
+#include <builder/compiler/CompilerOfTransition.h>
+#include <builder/compiler/CompilerOfVariable.h>
+
+
+namespace sep
+{
+
+class Configuration;
+
+class AvmcodeCompiler;
+
+class AvmProgram;
+class ExecutableForm;
+class ExecutableSystem;
+class InstanceOfBuffer;
+class InstanceOfMachine;
+class Machine;
+class PropertyPart;
+class System;
+
+
+class Compiler : public BaseMachineCompiler
+{
+
+public:
+ /**
+ * ATTRIBUTE
+ */
+ CompilerOfVariable mDataCompiler;
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ CompilerOfProgram mProgramCompiler;
+
+ CompilerOfTransition mTransitionCompiler;
+
+ CompilerOfInteraction mComCompiler;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Compiler(Configuration & aConfiguration, AvmcodeCompiler & anAvmcodeCompiler);
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Compiler()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONFIGURE
+ */
+ bool configure();
+
+
+ /**
+ * METHODS
+ * start
+ */
+ virtual bool start(System & aSystem);
+
+
+ /*
+ ***************************************************************************
+ * PRE-COMPILING SYSTEM - (STATE)MACHINE TRANSITION
+ ***************************************************************************
+ */
+ void precompilePropertyPart(
+ ExecutableForm * anExecutable, PropertyPart & theDeclaration,
+ TableOfInstanceOfData & tableOfVariable);
+
+ void precompileDataType(
+ AvmProgram * aProgram, PropertyPart & theDeclaration,
+ TableOfInstanceOfData & tableOfVariable);
+
+
+ void precompileExecutableCompositePart(
+ ExecutableForm * aContainer, Machine * anExecutableSpec);
+
+ void precompileExecutable(
+ ExecutableForm * aContainer, Machine * anExecutableSpec);
+
+ ExecutableForm * precompileExecutableModel(
+ ExecutableForm * aContainer, Machine * anExecutableSpec);
+
+ void precompileExecutablePrototype(
+ ExecutableForm * aContainer, Machine * anExecutableSpec);
+
+ void precompileExecutableInstanceStatic(
+ ExecutableForm * aContainer, Machine * anExecutableSpec);
+
+ void precompileExecutableInstanceDynamique(
+ ExecutableForm * aContainer, Machine * anExecutableSpec);
+
+ void precompileExecutableGroup(
+ ExecutableForm * aContainer, Machine * aStatemachine);
+
+
+ void precompileSystem(System & aSystem);
+
+
+ /**
+ * setInheritedSpecifier from container to owned elements
+ */
+ void setInheritedSpecifier(
+ ExecutableForm * aContainer, ExecutableForm * anExecutable);
+
+ void setInheritedSpecifier(
+ ExecutableForm * aContainer, InstanceOfMachine * aMachine);
+
+
+ /*
+ ***************************************************************************
+ * COMPILING EXECUTABLE - AVMPROGRAM
+ ***************************************************************************
+ */
+ void compileExecutableSystem();
+
+ void compileExecutable(ExecutableForm * anExecutable);
+
+ void compileAvmPrograms();
+
+
+ /*
+ ***************************************************************************
+ * COMPILING SYSTEM - (STATE)MACHINE TRANSITION
+ ***************************************************************************
+ */
+ void compileAllInstances(ExecutableForm * anExecutableForm);
+
+ void compileInstance(
+ ExecutableForm * theExecutableContainer,
+ InstanceOfMachine * anInstanceMachine);
+
+ void compileInstanceParameters(
+ ExecutableForm * theExecutableContainer,
+ InstanceOfMachine * anInstanceMachine);
+
+ void compileBaseMachine(ExecutableForm * anExecutableForm);
+
+ void compileProcedure(ExecutableForm * anExecutableForm);
+
+ void compileMachine(ExecutableForm * anExecutableForm);
+
+ void compileSystem(ExecutableForm * anExecutableForm);
+ void compileStatemachine(ExecutableForm * anExecutableForm);
+
+ void compileExecutableMocCompositeStructure(
+ ExecutableForm * anExecutableForm);
+
+ void compileExecutableMocStateTransitionStructure(
+ ExecutableForm * anExecutableForm);
+
+ void compileStatemachineBasic(ExecutableForm * anExecutableForm);
+ void compileStatemachinePseudo(ExecutableForm * anExecutableForm);
+ void compileStatemachineHistory(ExecutableForm * anExecutableForm);
+ void compilePseudostateEnding(ExecutableForm * anExecutableForm);
+
+
+ void removeSubmachineInputEnabledCode(ExecutableForm * anExecutableForm);
+
+ void computeInputEnabledCom(ExecutableForm * anExecutableForm);
+
+ void computeInputEnabledBuffer(ExecutableForm * anExecutableForm);
+
+ void compileAllBehavioralRoutines(ExecutableForm * theExecutable);
+
+ void compileBehaviorInitialization(ExecutableForm * theExecutable);
+ void compileBehaviorEnabling(ExecutableForm * theExecutable);
+ void compileBehaviorDisabling(ExecutableForm * theExecutable);
+ void compileBehaviorAborting(ExecutableForm * theExecutable);
+
+ void compileBehaviorScheduling(ExecutableForm * theExecutable);
+ void setRdvScheduling(ExecutableForm * theExecutable);
+
+};
+
+
+
+}
+
+#endif /*BUILDER_COMPILER_COMPILER_H_*/
diff --git a/org.eclipse.efm.symbex/src/builder/compiler/CompilerOfInteraction.cpp b/org.eclipse.efm.symbex/src/builder/compiler/CompilerOfInteraction.cpp
new file mode 100644
index 0000000..37d7877
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/compiler/CompilerOfInteraction.cpp
@@ -0,0 +1,3086 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 18 sept. 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "CompilerOfInteraction.h"
+
+#include <builder/compiler/SymbolTable.h>
+#include <builder/compiler/Compiler.h>
+
+#include <fml/common/ModifierElement.h>
+
+#include <fml/lib/IComPoint.h>
+
+#include <fml/builtin/Identifier.h>
+#include <fml/builtin/QualifiedIdentifier.h>
+
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/InstanceOfBuffer.h>
+#include <fml/executable/InstanceOfConnect.h>
+#include <fml/executable/InstanceOfData.h>
+#include <fml/executable/InstanceOfMachine.h>
+#include <fml/executable/Router.h>
+
+#include <fml/infrastructure/Buffer.h>
+#include <fml/infrastructure/Channel.h>
+#include <fml/infrastructure/ComPoint.h>
+#include <fml/infrastructure/ComProtocol.h>
+#include <fml/infrastructure/ComRoute.h>
+#include <fml/infrastructure/Connector.h>
+#include <fml/infrastructure/InteractionPart.h>
+#include <fml/infrastructure/Machine.h>
+#include <fml/infrastructure/Port.h>
+#include <fml/infrastructure/PropertyPart.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+#include <fml/type/TypeManager.h>
+
+#include <fml/workflow/UniFormIdentifier.h>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+CompilerOfInteraction::CompilerOfInteraction(Compiler & aCompiler)
+: BaseCompiler(aCompiler),
+mNextRouteID( 0 ),
+mNextConnectID( 0 )
+{
+ //!! NOTHING
+}
+
+
+/**
+ *******************************************************************************
+ * PRECOMPILATION
+ *******************************************************************************
+ */
+
+/**
+ * precompile
+ * port
+ */
+
+BF CompilerOfInteraction::precompileParameter(
+ ExecutableForm * aContainer, TableOfInstanceOfData & tableOfVariable,
+ Variable * aParameter, avm_offset_t offset)
+{
+ // #bind parameter
+ if( aParameter->getModifier().hasNatureParameterBind() )
+ {
+ InstanceOfData * bindInstance = new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ aContainer, aParameter, TypeManager::UNIVERSAL,
+ offset, aParameter->getModifier() );
+ if( aParameter->getNameID().empty() )
+ {
+ bindInstance->setNameID( OSS() << "$" << offset );
+ }
+ else
+ {
+ bindInstance->setNameID( aParameter->getNameID() );
+ }
+ bindInstance->setValue( aParameter->getValue() );
+
+ return( BF( bindInstance ) );
+ }
+
+ // variable parameter
+ else if( aParameter->getModifier().hasNatureParameter() )
+ {
+ TypeSpecifier aTypeSpecifier =
+ compileTypeSpecifier(aContainer, aParameter->getType());
+
+ InstanceOfData * paramInstance = new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE, aContainer,
+ aParameter, aTypeSpecifier, offset,
+ aParameter->getModifier() );
+ if( aParameter->getNameID().empty() )
+ {
+ paramInstance->setNameID( OSS() << "$" << offset );
+ }
+ else
+ {
+ paramInstance->setNameID( aParameter->getNameID() );
+ }
+ paramInstance->setValue( aParameter->getValue() );
+
+ return( BF( paramInstance ) );
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+void CompilerOfInteraction::precompileComPoint(ExecutableForm * aContainer,
+ PropertyPart & theDeclaration, TableOfInstanceOfData & tableOfVariable)
+{
+ PropertyPart::TableOfPort listOfInputPort;
+ PropertyPart::TableOfPort listOfInoutPort;
+ PropertyPart::TableOfPort listOfOutputPort;
+
+ BF aParameter;
+ TableOfVariable::const_raw_iterator itParam;
+ TableOfVariable::const_raw_iterator endParam;
+
+ avm_size_t inoutPortCount = 0;
+
+ // Classification of signals
+ PropertyPart::TableOfSignal::const_raw_iterator its =
+ theDeclaration.getSignals().begin();
+ PropertyPart::TableOfSignal::const_raw_iterator endIts =
+ theDeclaration.getSignals().end();
+ for( ; its != endIts ; ++its )
+ {
+ if( (its)->getModifier().isDirectionInput() )
+ {
+ listOfInputPort.append( *its );
+ }
+ else if( (its)->getModifier().isDirectionInout() )
+ {
+ listOfInoutPort.append( *its );
+ ++inoutPortCount;
+ }
+ else if( (its)->getModifier().isDirectionOutput() )
+ {
+ listOfOutputPort.append( *its );
+ }
+ }
+
+ aContainer->setMessageSignalCount( theDeclaration.getSignals().size() );
+
+ // Classification of ports
+ PropertyPart::TableOfPort::const_raw_iterator itp =
+ theDeclaration.getPorts().begin();
+ PropertyPart::TableOfPort::const_raw_iterator endItp =
+ theDeclaration.getPorts().end();
+ for( ; itp != endItp ; ++itp )
+ {
+ if( (itp)->getModifier().isDirectionInput() )
+ {
+ listOfInputPort.append( *itp );
+ }
+ else if( (itp)->getModifier().isDirectionInout() )
+ {
+ listOfInoutPort.append( *itp );
+ ++inoutPortCount;
+ }
+ else if( (itp)->getModifier().isDirectionOutput() )
+ {
+ listOfOutputPort.append( *itp );
+ }
+ }
+
+ // Pre-compilation of ports
+ precompileComPoint(aContainer,
+ listOfInoutPort, 0, tableOfVariable);
+
+ precompileComPoint(aContainer,
+ listOfInputPort, inoutPortCount, tableOfVariable);
+
+ precompileComPoint(aContainer,
+ listOfOutputPort, inoutPortCount, tableOfVariable);
+}
+
+
+void CompilerOfInteraction::precompileComPoint(ExecutableForm * aContainer,
+ const PropertyPart::TableOfPort & listOfComPoint,
+ avm_size_t ioPortOffset, TableOfInstanceOfData & tableOfVariable)
+{
+ InstanceOfPort * newPortInstance = NULL;
+
+ BF aParameter;
+ TableOfVariable::const_raw_iterator itParam;
+ TableOfVariable::const_raw_iterator endParam;
+
+ avm_offset_t typeOffset = 0;
+
+ PropertyPart::TableOfPort::const_raw_iterator it = listOfComPoint.begin();
+ PropertyPart::TableOfPort::const_raw_iterator endIt = listOfComPoint.end();
+ for( avm_offset_t offset = ioPortOffset ; it != endIt ; ++it , ++offset )
+ {
+ newPortInstance = new InstanceOfPort(aContainer, (it), offset,
+ (it)->getParameters().size(), (it)->getComPointNature());
+
+ getSymbolTable().addPortInstance(
+ aContainer->savePort(newPortInstance) );
+
+ if( newPortInstance->isSignal() )
+ {
+ newPortInstance->setRouteOffset( mNextRouteID++ );
+ }
+
+ itParam = (it)->getParameters().begin();
+ endParam = (it)->getParameters().end();
+ for( typeOffset = 0 ; itParam != endParam ; ++itParam , ++typeOffset )
+ {
+ aParameter = precompileParameter(aContainer,
+ tableOfVariable, (itParam), typeOffset);
+ newPortInstance->setParameter(typeOffset, aParameter);
+ }
+ }
+}
+
+
+
+void CompilerOfInteraction::precompileChannel(ExecutableForm * aContainer,
+ PropertyPart & theDeclaration, TableOfInstanceOfData & tableOfVariable)
+{
+ InstanceOfPort * newInstanceOfChannel;
+ InstanceOfPort * newInstanceOfPort;
+
+ PropertyPart::const_owned_iterator it;
+ PropertyPart::const_owned_iterator endIt;
+
+ PropertyPart::TableOfChannel::const_raw_iterator itChannel =
+ theDeclaration.getChannels().begin();
+ PropertyPart::TableOfChannel::const_raw_iterator endChannel =
+ theDeclaration.getChannels().end();
+ avm_offset_t offset = 0;
+ for( ; itChannel != endChannel ; ++itChannel, ++offset )
+ {
+ newInstanceOfChannel = InstanceOfPort::newChannel(
+ aContainer, (itChannel), offset);
+
+ aContainer->saveChannel(newInstanceOfChannel);
+
+ if( (itChannel)->hasContents() )
+ {
+ it = (itChannel)->getContents()->owned_begin();
+ endIt = (itChannel)->getContents()->owned_end();
+ for( ; it != endIt ; ++it )
+ {
+ // case of Signal
+ if( (*it).is< Signal >() )
+ {
+ const Symbol & aPort = getSymbolTable().searchPortInstance(
+ (*it).to_ptr< Port >()->getSignalModel() );
+ if( aPort.valid() )
+ {
+ newInstanceOfPort = new InstanceOfPort(
+ aContainer, (*it).to_ptr< Port >(),
+ newInstanceOfChannel, aPort.rawPort() );
+
+ newInstanceOfChannel->appendContent(
+ Symbol(newInstanceOfPort) );
+ }
+ }
+
+ else if( (*it).is< Variable >() )
+ {
+
+ }
+ }
+ }
+ }
+}
+
+
+/**
+ * precompile
+ * buffer
+ */
+void CompilerOfInteraction::precompileBuffer(
+ ExecutableForm * aContainer, Buffer * aBuffer)
+{
+ InstanceOfBuffer * newBufferInstance = new InstanceOfBuffer(
+ aContainer, aBuffer, aContainer->getBuffer().size());
+
+ getSymbolTable().addBufferInstance(
+ aContainer->saveBuffer(newBufferInstance) );
+}
+
+
+
+
+
+
+/**
+ *******************************************************************************
+ *******************************************************************************
+ *******************************************************************************
+ *******************************************************************************
+ *******************************************************************************
+ *******************************************************************************
+ * COMPILATION
+ *******************************************************************************
+ *******************************************************************************
+ *******************************************************************************
+ *******************************************************************************
+ *******************************************************************************
+ *******************************************************************************
+ */
+
+
+void CompilerOfInteraction::compilePort(ExecutableForm * anExecutable)
+{
+ TableOfSymbol::const_iterator itPort = anExecutable->getPort().begin();
+ TableOfSymbol::const_iterator endPort = anExecutable->getPort().end();
+ for( ; itPort != endPort ; ++itPort )
+ {
+ compilePort(anExecutable, (*itPort).port());
+ }
+}
+
+void CompilerOfInteraction::compilePort(ExecutableForm * anExecutable,
+ const InstanceOfPort & aPortInstance)
+{
+ ArrayOfBF::const_iterator it = aPortInstance.getParameters().begin();
+ ArrayOfBF::const_iterator endIt = aPortInstance.getParameters().end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).is< InstanceOfData >() )
+ {
+ InstanceOfData * aVar = (*it).to_ptr< InstanceOfData >();
+
+ // #bind parameter
+ if( aVar->getModifier().hasNatureParameterBind()
+ && aVar->hasValue() )
+ {
+ aVar->setValue( mAvmcodeCompiler.decode_compileExpression(
+ anExecutable, aVar->getValue()) );
+ }
+
+ // variable parameter, optional default value
+ else if( aVar->getModifier().hasNatureParameter()
+ && aVar->hasValue()
+ && (not aVar->getValue().isNumeric()) )
+ {
+ aVar->setValue( mAvmcodeCompiler.decode_compileExpression(
+ anExecutable, aVar->getValue()) );
+ }
+ }
+ }
+}
+
+
+/**
+ *******************************************************************************
+ * TOOLS FOR ROUTER CREATION
+ *******************************************************************************
+ */
+
+Router CompilerOfInteraction::newMachineRouter(InstanceOfMachine * aMachine)
+{
+ Router aRouter(aMachine, mNextRouteID, mNextRouteID);
+
+ ExecutableForm * anExecutable = aMachine->getExecutable();
+
+ TableOfSymbol::iterator itPort = anExecutable->getPort().begin();
+ TableOfSymbol::iterator endPort = anExecutable->getPort().end();
+ for( ; itPort != endPort ; ++itPort )
+ {
+ if( (*itPort).port().isPort() )
+ {
+ // the route offset of local port w.r.t. global route offset
+ (*itPort).setRouteOffset( mNextRouteID + (*itPort).getOffset() -
+ anExecutable->getMessageSignalCount() );
+
+ if( (*itPort).getModifier().hasDirectionInput() )
+ {
+ aRouter.appendInputRouting( RoutingData::_NULL_ );
+ }
+ // NO ELSE because of INOUT PORT
+ if( (*itPort).getModifier().hasDirectionOutput() )
+ {
+ aRouter.appendOutputRouting( RoutingData::_NULL_ );
+ }
+ }
+
+ else// if( (*itPort).isSignal() )
+ {
+ //!! NOTHING
+ }
+ }
+
+ return( aRouter );
+}
+
+
+Router CompilerOfInteraction::addMachineModelRouter(
+ ExecutableForm * theExecutable, InstanceOfMachine * aMachine)
+{
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( aMachine->getOffset() == 0 )
+ << "Unexpected the first machine model "
+ "for router with offset > 0 !!!"
+ << SEND_EXIT;
+
+ Router aRouter = newMachineRouter(aMachine);
+
+ theExecutable->appendRouter4Model( aRouter );
+
+ return( aRouter );
+}
+
+
+
+/**
+ * compile
+ * statemachine interaction
+ */
+void CompilerOfInteraction::compileCommunication(ExecutableForm * theExecutable,
+ bool & hasSynchronizeMachine, bool & hasUpdateBuffer)
+{
+ const Machine * aMachine = theExecutable->getAstMachine();
+
+ if( aMachine->hasInteraction() )
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( theExecutable->hasInstanceStaticThis() )
+ << "Unexpected communicated Machine without submachine THIS !!!"
+ << SEND_EXIT;
+
+ avm_size_t nbComMachineCount = 0;
+
+ TableOfRouter & theTableOfRouter4Instance =
+ theExecutable->getRouters4Instance();
+
+ // Attention: the offset of routing table of an instance machine is
+ // the same than the offset of this instance
+ TableOfSymbol::const_iterator itMachine =
+ theExecutable->getInstanceStatic().begin();
+ TableOfSymbol::const_iterator endMachine =
+ theExecutable->getInstanceStatic().end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ if( (*itMachine).getExecutable()->hasPort() )
+ {
+ ++nbComMachineCount;
+ theTableOfRouter4Instance.append(
+ newMachineRouter((*itMachine).rawMachine()) );
+//@debug:
+// AVM_OS_TRACE << "compileCommunication :> INIT "
+// << str_header( theExecutable ) << std::endl;
+// theRouterTable->last()->toStream(AVM_OS_TRACE);
+ }
+ else if( (*itMachine).getAstMachine()->hasInteraction() )
+ {
+ ++nbComMachineCount;
+ theTableOfRouter4Instance.append(
+ newMachineRouter((*itMachine).rawMachine()) );
+//@debug:
+// AVM_OS_TRACE << "compileCommunication :> INIT "
+// << str_header( theExecutable ) << std::endl;
+// theRouterTable->last()->toStream(AVM_OS_TRACE);
+ }
+ else
+ {
+ theTableOfRouter4Instance.append( Router::_NULL_ );
+ }
+ }
+
+ // For MACHINE MODEL
+ TableOfRouter & theTableOfRouter4Model =
+ theExecutable->getRouters4Model();
+
+ // Router for instance machine THIS
+ theTableOfRouter4Model.append( theExecutable->getRouter4This() );
+
+ itMachine = theExecutable->instance_model_begin();
+ endMachine = theExecutable->instance_model_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ if( (*itMachine).getExecutable()->hasPort() )
+ {
+ ++nbComMachineCount;
+ theTableOfRouter4Model.append(
+ newMachineRouter((*itMachine).rawMachine()) );
+//@debug:
+// AVM_OS_TRACE << "compileCommunication :> INIT "
+// << str_header( theExecutable ) << std::endl;
+// theRouterTable->last()->toStream(AVM_OS_TRACE);
+ }
+ else if( (*itMachine).getAstMachine()->hasInteraction() )
+ {
+ ++nbComMachineCount;
+ theTableOfRouter4Model.append(
+ newMachineRouter((*itMachine).rawMachine()) );
+//@debug:
+// AVM_OS_TRACE << "compileCommunication :> INIT "
+// << str_header( theExecutable ) << std::endl;
+// theRouterTable->last()->toStream(AVM_OS_TRACE);
+ }
+ else
+ {
+ theTableOfRouter4Model.append( Router::_NULL_ );
+ }
+ }
+
+ if( nbComMachineCount > 0 )
+ {
+ compileConnector(theExecutable,
+ hasUpdateBuffer, hasSynchronizeMachine);
+
+ postCompileCommunication(theExecutable);
+ }
+ else
+ {
+ theExecutable->getRouters4Instance().clear();
+
+ theExecutable->getRouters4Model().clear();
+ }
+ }
+
+ else if( aMachine->hasPortSignal()
+ && ( aMachine->getSpecifier().isComponentSystem()
+ || (not aMachine->getContainerMachine()->hasInteraction()) ) )
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( theExecutable->hasInstanceStaticThis() )
+ << "Unexpected communicated Machine without submachine THIS !!!"
+ << SEND_EXIT;
+
+ Router bfRouter = newMachineRouter(
+ theExecutable->getInstanceStaticThis().rawMachine());
+
+ theExecutable->appendRouter4Instance( bfRouter );
+
+ if( not aMachine->getSpecifier().isComponentSystem() )
+ {
+ theExecutable->appendRouter4Model( bfRouter );
+ }
+
+//@debug:
+// AVM_OS_TRACE << "compileCommunication :> INIT "
+// << str_header( aMachine ) << std::endl;
+// theRouterTable->last()->toStream(AVM_OS_TRACE);
+
+ postCompileCommunication(theExecutable);
+ }
+}
+
+
+
+/*
+ *******************************************************************************
+ * COMPILE INTERACTION CONNECT
+ *******************************************************************************
+ */
+void CompilerOfInteraction::compileConnector(ExecutableForm * theExecutable,
+ bool & hasSynchronizeMachine, bool & hasUpdateBuffer)
+{
+ const Machine * aMachine = theExecutable->getAstMachine();
+
+ InstanceOfConnect * ioc = NULL;
+
+ InteractionPart::const_connector_iterator itConnector;
+ InteractionPart::const_connector_iterator endConnector;
+
+ const InteractionPart * theInteractionPart = aMachine->getInteraction();
+ if( theInteractionPart != NULL )
+ {
+ itConnector = theInteractionPart->connector_begin();
+ endConnector = theInteractionPart->connector_end();
+ for( ; itConnector != endConnector ; ++itConnector )
+ {
+ ioc = new InstanceOfConnect( theExecutable,
+ (itConnector), theExecutable->getConnect().size(),
+ (itConnector)->getProtocol(), (itConnector)->getCast() );
+
+ getSymbolTable().addConnectInstance(
+ theExecutable->saveConnect(ioc) );
+
+ ////////////////////////////////////////////////////////////////////
+ // For PORT
+ if( (itConnector)->isPort() )
+ {
+ compileConnector(theExecutable, (itConnector), ioc,
+ hasSynchronizeMachine, hasUpdateBuffer);
+ }
+
+ ////////////////////////////////////////////////////////////////////
+ // For MESSAGE OR SIGNAL
+ else if( (itConnector)->isSignal() )
+ {
+ compileRoute(theExecutable, (itConnector), ioc,
+ hasSynchronizeMachine, hasUpdateBuffer);
+ }
+ }
+ }
+}
+
+
+
+void CompilerOfInteraction::compileConnector(ExecutableForm * theExecutable,
+ Connector * aConnector, InstanceOfConnect * ioc,
+ bool & hasSynchronizeMachine, bool & hasUpdateBuffer)
+{
+ // One unique Connector ID per connection!
+ ioc->setMID( ++mNextConnectID );
+ switch( aConnector->getProtocol() )
+ {
+ case ComProtocol::PROTOCOL_BUFFER_KIND:
+ {
+ compileConnectorBuffer(theExecutable, ioc);
+ break;
+ }
+
+ case ComProtocol::PROTOCOL_RDV_KIND:
+ case ComProtocol::PROTOCOL_MULTIRDV_KIND:
+ {
+ hasSynchronizeMachine = true;
+ compileConnectorSynchronous(theExecutable, ioc);
+ break;
+ }
+
+ case ComProtocol::PROTOCOL_FLOW_KIND:
+ {
+ hasSynchronizeMachine = true;
+ compileConnectorFlow(theExecutable, ioc);
+ break;
+ }
+
+ case ComProtocol::PROTOCOL_BROADCAST_KIND:
+ {
+ hasUpdateBuffer = true;
+ compileConnectorBroadcast(theExecutable, ioc);
+ break;
+ }
+
+
+ case ComProtocol::PROTOCOL_TRANSFERT_KIND:
+ {
+ compileConnectorTransfert(theExecutable, ioc);
+ break;
+ }
+
+ case ComProtocol::PROTOCOL_ENVIRONMENT_KIND:
+ {
+ compileConnectorEnvironment(theExecutable, ioc);
+ break;
+ }
+
+ case ComProtocol::PROTOCOL_MULTICAST_KIND:
+ case ComProtocol::PROTOCOL_UNICAST_KIND:
+ case ComProtocol::PROTOCOL_ANYCAST_KIND:
+ {
+ compileConnectorRoutingCast(theExecutable, ioc);
+ break;
+ }
+
+ case ComProtocol::PROTOCOL_UNDEFINED_KIND:
+ default:
+ {
+ // ERROR REPORTING
+ incrErrorCount();
+ aConnector->errorLocation(AVM_OS_WARN)
+ << "Unexpected for the connection<port> the protocol << "
+ << aConnector->strProtocolCast(true) << " >>"
+ << std::endl;
+
+ break;
+ }
+ }
+}
+
+void CompilerOfInteraction::compileRoute(ExecutableForm * theExecutable,
+ Connector * aConnector, InstanceOfConnect * ioc,
+ bool & hasSynchronizeMachine, bool & hasUpdateBuffer)
+{
+ switch( aConnector->getProtocol() )
+ {
+ case ComProtocol::PROTOCOL_BUFFER_KIND:
+ {
+ compileRouteBuffer(theExecutable, ioc);
+ break;
+ }
+
+ case ComProtocol::PROTOCOL_RDV_KIND:
+ case ComProtocol::PROTOCOL_MULTIRDV_KIND:
+ {
+ hasSynchronizeMachine = true;
+ compileRouteSynchronous(theExecutable, ioc);
+ break;
+ }
+
+ case ComProtocol::PROTOCOL_BROADCAST_KIND:
+ {
+ hasUpdateBuffer = true;
+ compileRouteBroadcast(theExecutable, ioc);
+ break;
+ }
+
+
+ case ComProtocol::PROTOCOL_TRANSFERT_KIND:
+ {
+ compileRouteTransfert(theExecutable, ioc);
+ break;
+ }
+
+ case ComProtocol::PROTOCOL_ENVIRONMENT_KIND:
+ {
+ compileRouteEnvironment(theExecutable, ioc);
+ break;
+ }
+
+ case ComProtocol::PROTOCOL_MULTICAST_KIND:
+ case ComProtocol::PROTOCOL_UNICAST_KIND:
+ case ComProtocol::PROTOCOL_ANYCAST_KIND:
+ {
+ compileRouteRoutingCast(theExecutable, ioc);
+ break;
+ }
+
+ case ComProtocol::PROTOCOL_UNDEFINED_KIND:
+ default:
+ {
+ // ERROR REPORTING
+ incrErrorCount();
+ aConnector->errorLocation(AVM_OS_WARN)
+ << "Unexpected for the connection<message|signal> "
+ "the protocol << "
+ << aConnector->strProtocolCast(true) << " >>"
+ << std::endl;
+
+ break;
+ }
+ }
+}
+
+
+/*
+ *******************************************************************************
+ * COMPILE INTERACTION CONNECT BROADCAST
+ *******************************************************************************
+ */
+void CompilerOfInteraction::compileConnectorBroadcast(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc)
+{
+ const Connector * aConnector = ioc->getAstConnector();
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ AVM_OS_TRACE << INCR_INDENT_TAB
+ << "COMPILE INTERACTION CONNECT BROADCAST" << std::endl;
+ aConnector->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+
+ Buffer * buffer = NULL;
+ InstanceOfBuffer * theBufferInstance = NULL;
+
+ if( aConnector->hasBuffer() )
+ {
+ buffer = aConnector->getBuffer();
+
+ if( buffer->isAnonymID() )
+ {
+ theBufferInstance = new InstanceOfBuffer(
+ theExecutable, buffer, theExecutable->getBuffer().size());
+
+ getSymbolTable().addBufferInstance(
+ theExecutable->saveBuffer(theBufferInstance) );
+ }
+ else
+ {
+ theBufferInstance = getSymbolTable().searchBufferInstance(
+ theExecutable, buffer).rawBuffer();
+ }
+ }
+ else if( aConnector->hasBufferUfid() )
+ {
+ theBufferInstance =
+ getSymbolTable().searchBufferInstanceByQualifiedNameID(
+ theExecutable, aConnector->strBufferUfid()).rawBuffer();
+
+ if( theBufferInstance == NULL )
+ {
+ incrErrorCount();
+ aConnector->errorLocation(AVM_OS_WARN)
+ << "Unfound in the COM POINT the buffer instance < "
+ << aConnector->strBufferUfid() << " > !" << std::endl;
+ }
+ }
+ else //if( buffer == NULL )
+ {
+ theBufferInstance = new InstanceOfBuffer(
+ theExecutable, NULL, theExecutable->getBuffer().size(),
+ TYPE_FIFO_SPECIFIER, -1 );
+
+ getSymbolTable().addBufferInstance(
+ theExecutable->saveBuffer(theBufferInstance) );
+ }
+
+
+ BFList::const_raw_iterator< ComPoint > itComPoint;
+ BFList::const_raw_iterator< ComPoint > endItComPoint;
+
+ List< RoutingData > listOfRoutingData;
+ RoutingData theRoutingData;
+
+ // Routing for all port
+ Connector::route_iterator itComRoute = aConnector->begin();
+ Connector::route_iterator endItComRoute = aConnector->end();
+ for( ; itComRoute != endItComRoute ; ++itComRoute )
+ {
+ itComPoint = (*itComRoute)->getComPoints().begin();
+ endItComPoint = (*itComRoute)->getComPoints().end();
+ for( ; itComPoint != endItComPoint ; ++itComPoint )
+ {
+ createRoutingData(listOfRoutingData, theExecutable,
+ ioc, (*itComRoute), (itComPoint));
+
+ while( listOfRoutingData.nonempty() )
+ {
+ listOfRoutingData.pop_first_to( theRoutingData );
+
+ // for buffer port
+ if( theBufferInstance != NULL )
+ {
+ theRoutingData.appendBuffer(theBufferInstance);
+ }
+
+ if( (*itComRoute)->hasProtocol() )
+ {
+ // TODO for other COM_PROTOCOL
+ }
+ }
+ }
+ }
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ ioc->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << "END COMPILE INTERACTION CONNECT BROADCAST"
+ << std::endl << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+}
+
+
+/*
+ *******************************************************************************
+ * COMPILE INTERACTION CONNECT BUFFER
+ *******************************************************************************
+ */
+
+static void bufferCompletion(
+ List< RoutingData > & listOfOutRoutingData,
+ List< RoutingData > & listOfInRoutingData)
+{
+ List< RoutingData >::iterator inRD;
+ List< RoutingData >::iterator outRD;
+
+ bool hasntBuffer;
+
+ inRD = listOfInRoutingData.begin();
+ for( ; inRD != listOfInRoutingData.end() ; ++inRD )
+ {
+ hasntBuffer = inRD->getBufferInstance().empty();
+
+ outRD = listOfOutRoutingData.begin();
+ for( ; outRD != listOfOutRoutingData.end() ; ++outRD )
+ {
+ if( hasntBuffer && outRD->getBufferInstance().nonempty() )
+ {
+ inRD->getBufferInstance().append(
+ outRD->getBufferInstance() );
+ }
+ }
+
+ inRD->getBufferInstance().makeUnique();
+ }
+
+ outRD = listOfOutRoutingData.begin();
+ for( ; outRD != listOfOutRoutingData.end() ; ++outRD )
+ {
+ hasntBuffer = (outRD)->getBufferInstance().empty();
+
+ inRD = listOfInRoutingData.begin();
+ for( ; inRD != listOfInRoutingData.end() ; ++inRD )
+ {
+ if( hasntBuffer && (inRD)->getBufferInstance().nonempty() )
+ {
+ (outRD)->getBufferInstance().append(
+ (inRD)->getBufferInstance() );
+ }
+ }
+
+ (outRD)->getBufferInstance().makeUnique();
+ }
+}
+
+
+void CompilerOfInteraction::compileConnectorBuffer(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc)
+{
+ const Connector * aConnector = ioc->getAstConnector();
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ AVM_OS_TRACE << INCR_INDENT_TAB
+ << "COMPILE INTERACTION CONNECT BUFFER" << std::endl;
+ aConnector->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+
+ Buffer * buffer = NULL;
+ InstanceOfBuffer * theBufferInstance = NULL;
+ InstanceOfBuffer * localBufferInstance = NULL;
+
+ if( aConnector->hasBuffer() )
+ {
+ buffer = aConnector->getBuffer();
+
+ if( buffer->isAnonymID() )
+ {
+ theBufferInstance = new InstanceOfBuffer(theExecutable,
+ buffer, theExecutable->getBuffer().size() );
+
+ getSymbolTable().addBufferInstance(
+ theExecutable->saveBuffer(theBufferInstance) );
+ }
+ else
+ {
+ theBufferInstance = getSymbolTable().searchBufferInstance(
+ theExecutable, buffer).rawBuffer();
+ }
+ }
+ else if( aConnector->hasBufferUfid() )
+ {
+ theBufferInstance =
+ getSymbolTable().searchBufferInstanceByQualifiedNameID(
+ theExecutable, aConnector->strBufferUfid()).rawBuffer();
+
+ if( theBufferInstance == NULL )
+ {
+ incrErrorCount();
+ aConnector->errorLocation(AVM_OS_WARN)
+ << "Unfound in the COM POINT the buffer instance < "
+ << aConnector->strBufferUfid() << " > !" << std::endl;
+ }
+ }
+ else //if( buffer == NULL )
+ {
+ theBufferInstance = new InstanceOfBuffer(
+ theExecutable, NULL, theExecutable->getBuffer().size(),
+ TYPE_FIFO_SPECIFIER, -1 );
+
+ getSymbolTable().addBufferInstance(
+ theExecutable->saveBuffer(theBufferInstance) );
+ }
+
+ // lists for update input port connector list
+ List< RoutingData > listOfOutRoutingData;
+ List< RoutingData > listOfInRoutingData;
+
+ BFList::const_raw_iterator< ComPoint > itComPoint;
+ BFList::const_raw_iterator< ComPoint > endItComPoint;
+
+ List< RoutingData > listOfRoutingData;
+ RoutingData theRoutingData;
+
+ // Routing for all port
+ Connector::route_iterator itComRoute = aConnector->begin();
+ Connector::route_iterator endItComRoute = aConnector->end();
+ for( ; itComRoute != endItComRoute ; ++itComRoute )
+ {
+ itComPoint = (*itComRoute)->getComPoints().begin();
+ endItComPoint = (*itComRoute)->getComPoints().end();
+ for( ; itComPoint != endItComPoint ; ++itComPoint )
+ {
+ createRoutingData(listOfRoutingData, theExecutable,
+ ioc, (*itComRoute), (itComPoint));
+
+ while( listOfRoutingData.nonempty() )
+ {
+ listOfRoutingData.pop_first_to( theRoutingData );
+
+ if( theBufferInstance != NULL )
+ {
+ // for buffer port
+ theRoutingData.appendBuffer(theBufferInstance);
+ }
+
+ // for buffer port
+ if( not (*itComRoute)->hasProtocol() )
+ {
+ continue;
+ }
+
+ switch( (*itComRoute)->getProtocol() )
+ {
+ case ComProtocol::PROTOCOL_BUFFER_KIND:
+ {
+ localBufferInstance = theBufferInstance;
+
+ if( (*itComRoute)->hasBuffer() )
+ {
+ buffer = (*itComRoute)->getBuffer();
+ if( buffer->isAnonymID() )
+ {
+ localBufferInstance = new InstanceOfBuffer(
+ theExecutable, buffer,
+ theExecutable->getBuffer().size());
+
+ getSymbolTable().addBufferInstance(
+ theExecutable->saveBuffer(
+ localBufferInstance) );
+ }
+ else
+ {
+ localBufferInstance = getSymbolTable().
+ searchBufferInstance(
+ theExecutable, buffer).rawBuffer();
+ }
+ }
+ else if( (*itComRoute)->hasBufferUfid() )
+ {
+ localBufferInstance = getSymbolTable().
+ searchBufferInstanceByQualifiedNameID(
+ theExecutable,
+ (*itComRoute)->strBufferUfid()).rawBuffer();
+
+ if( localBufferInstance == NULL )
+ {
+ incrErrorCount();
+ aConnector->errorLocation(AVM_OS_WARN)
+ << "Unfound in the COM POINT "
+ "the buffer instance < "
+ << aConnector->strBufferUfid() << " > !"
+ << std::endl;
+ }
+ }
+
+ if( localBufferInstance != NULL )
+ {
+ theRoutingData.appendBuffer(localBufferInstance);
+ }
+ else
+ {
+ // TODO for other ERROR
+ }
+
+ break;
+ }
+
+ default:
+ {
+ // TODO for other COM_PROTOCOL
+ break;
+ }
+ }
+
+ // list for update all buffer and port connector list
+ if( (*itComRoute)->getModifier().isDirectionOutput() )
+ {
+ listOfOutRoutingData.append(theRoutingData);
+ }
+ else
+ {
+ listOfInRoutingData.append(theRoutingData);
+ }
+ }
+ }
+ }
+
+
+ // buffer completion
+ bufferCompletion(listOfOutRoutingData, listOfInRoutingData);
+
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ ioc->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << "END COMPILE INTERACTION CONNECT BUFFER"
+ << std::endl << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+}
+
+
+
+/*
+ *******************************************************************************
+ * COMPILE INTERACTION CONNECT ROUTING CAST
+ *******************************************************************************
+ */
+void CompilerOfInteraction::compileConnectorRoutingCast(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc)
+{
+ const Connector * aConnector = ioc->getAstConnector();
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ AVM_OS_TRACE << INCR_INDENT_TAB
+ << "COMPILE INTERACTION CONNECT ROUTING CAST" << std::endl;
+ aConnector->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+
+ Buffer * buffer = NULL;
+ InstanceOfBuffer * theBufferInstance = NULL;
+
+ // lists for update input port connector list
+ List< RoutingData > listOfOutRoutingData;
+ List< RoutingData > listOfInRoutingData;
+
+ BFList::const_raw_iterator< ComPoint > itComPoint;
+ BFList::const_raw_iterator< ComPoint > endItComPoint;
+
+ List< RoutingData > listOfRoutingData;
+ RoutingData theRoutingData;
+
+ // Routing for all port
+ Connector::route_iterator itComRoute = aConnector->begin();
+ Connector::route_iterator endItComRoute = aConnector->end();
+ for( ; itComRoute != endItComRoute ; ++itComRoute )
+ {
+ itComPoint = (*itComRoute)->getComPoints().begin();
+ endItComPoint = (*itComRoute)->getComPoints().end();
+ for( ; itComPoint != endItComPoint ; ++itComPoint )
+ {
+ createRoutingData(listOfRoutingData, theExecutable,
+ ioc, (*itComRoute), (itComPoint));
+
+ while( listOfRoutingData.nonempty() )
+ {
+ listOfRoutingData.pop_first_to( theRoutingData );
+
+ // list for update input buffer and port connector list
+ listOfOutRoutingData.append(theRoutingData);
+
+ // for buffer port
+ if( not (*itComRoute)->hasProtocol() )
+ {
+ continue;
+ }
+
+ switch( (*itComRoute)->getProtocol() )
+ {
+ case ComProtocol::PROTOCOL_BUFFER_KIND:
+ {
+ if( (*itComRoute)->hasBuffer() )
+ {
+ buffer = (*itComRoute)->getBuffer();
+ if( buffer->isAnonymID() )
+ {
+ theBufferInstance = new InstanceOfBuffer(
+ theExecutable, buffer,
+ theExecutable->getBuffer().size());
+
+ getSymbolTable().addBufferInstance(
+ theExecutable->saveBuffer(
+ theBufferInstance) );
+ }
+ else
+ {
+ theBufferInstance = getSymbolTable().
+ searchBufferInstance(
+ theExecutable, buffer).rawBuffer();
+ }
+ }
+ else if( (*itComRoute)->hasBufferUfid() )
+ {
+ theBufferInstance = getSymbolTable().
+ searchBufferInstance(theExecutable,
+ (*itComRoute)->strBufferUfid()).rawBuffer();
+
+ if( theBufferInstance == NULL )
+ {
+ incrErrorCount();
+ aConnector->errorLocation(AVM_OS_WARN)
+ << "Unfound in the COM POINT "
+ "the buffer instance < "
+ << (*itComRoute)->strBufferUfid()
+ << " > !" << std::endl;
+ }
+ }
+
+ if( theBufferInstance != NULL )
+ {
+ theRoutingData.appendBuffer(theBufferInstance);
+ }
+ else
+ {
+ // TODO for other ERROR
+ }
+
+ break;
+ }
+
+ case ComProtocol::PROTOCOL_MULTICAST_KIND:
+ {
+ break;
+ }
+ case ComProtocol::PROTOCOL_UNICAST_KIND:
+ {
+ break;
+ }
+ case ComProtocol::PROTOCOL_ANYCAST_KIND:
+ {
+ break;
+ }
+ default:
+ {
+ // TODO for other COM_PROTOCOL
+ break;
+ }
+ }
+
+ // list for update all buffer and port connector list
+ if( (*itComRoute)->getModifier().isDirectionOutput() )
+ {
+ listOfOutRoutingData.append(theRoutingData);
+ }
+ else
+ {
+ listOfInRoutingData.append(theRoutingData);
+ }
+ }
+ }
+ }
+
+
+ // buffer completion
+ bufferCompletion(listOfOutRoutingData, listOfInRoutingData);
+
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << "END COMPILE INTERACTION CONNECT ROUTING CAST"
+ << std::endl << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+}
+
+
+/*
+ *******************************************************************************
+ * COMPILE INTERACTION CONNECT SYNCHRONOUS
+ *******************************************************************************
+ */
+void CompilerOfInteraction::compileConnectorSynchronous(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc)
+{
+ const Connector * aConnector = ioc->getAstConnector();
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ AVM_OS_TRACE << INCR_INDENT_TAB
+ << "COMPILE INTERACTION CONNECT SYNCHRONOUS"
+ << std::endl;
+ aConnector->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+
+ BFList::const_raw_iterator< ComPoint > itComPoint;
+ BFList::const_raw_iterator< ComPoint > endItComPoint;
+
+ List< RoutingData > listOfRoutingData;
+
+ // Routing for all port
+ Connector::route_iterator itComRoute = aConnector->begin();
+ Connector::route_iterator endItComRoute = aConnector->end();
+ for( ; itComRoute != endItComRoute ; ++itComRoute )
+ {
+ if( (*itComRoute)->hasCast() )
+ {
+ if( (*itComRoute)->getModifier().isDirectionOutput() )
+ {
+ ioc->getOutputComRouteData().setCast((*itComRoute)->getCast());
+ }
+ else
+ {
+ ioc->getInputComRouteData().setCast((*itComRoute)->getCast());
+ }
+ }
+
+ itComPoint = (*itComRoute)->getComPoints().begin();
+ endItComPoint = (*itComRoute)->getComPoints().end();
+ for( ; itComPoint != endItComPoint ; ++itComPoint )
+ {
+ createRoutingData(listOfRoutingData, theExecutable,
+ ioc, (*itComRoute), (itComPoint));
+
+ if( (*itComRoute)->hasProtocol() )
+ {
+ // TODO for other COM_PROTOCOL
+ }
+ }
+ }
+
+ if( ioc->getProtocol() == ComProtocol::PROTOCOL_MULTIRDV_KIND )
+ {
+ if( (not ioc->getOutputComRouteData().hasCast()) &&
+ ioc->getOutputComRouteData().getMachinePorts().singleton() )
+ {
+ ioc->getOutputComRouteData().setCast(
+ ComProtocol::PROTOCOL_UNICAST_KIND );
+ }
+
+ if( (not ioc->getInputComRouteData().hasCast()) &&
+ ioc->getInputComRouteData().getMachinePorts().singleton() )
+ {
+ ioc->getInputComRouteData().setCast(
+ ComProtocol::PROTOCOL_UNICAST_KIND );
+ }
+ }
+
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ ioc->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << "END COMPILE INTERACTION CONNECT SYNCHRONOUS"
+ << std::endl << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+}
+
+
+/*
+ *******************************************************************************
+ * COMPILE INTERACTION CONNECT FLOW
+ *******************************************************************************
+ */
+void CompilerOfInteraction::compileConnectorFlow(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc)
+{
+ const Connector * aConnector = ioc->getAstConnector();
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ AVM_OS_TRACE << INCR_INDENT_TAB
+ << "COMPILE INTERACTION CONNECT FLOW"
+ << std::endl;
+ aConnector->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+
+ BFList::const_raw_iterator< ComPoint > itComPoint;
+ BFList::const_raw_iterator< ComPoint > endItComPoint;
+
+ List< RoutingData > listOfRoutingData;
+
+ // Routing for all port
+ Connector::route_iterator itComRoute = aConnector->begin();
+ Connector::route_iterator endItComRoute = aConnector->end();
+ for( ; itComRoute != endItComRoute ; ++itComRoute )
+ {
+ itComPoint = (*itComRoute)->getComPoints().begin();
+ endItComPoint = (*itComRoute)->getComPoints().end();
+ for( ; itComPoint != endItComPoint ; ++itComPoint )
+ {
+ createRoutingData(listOfRoutingData, theExecutable,
+ ioc, (*itComRoute), (itComPoint));
+
+ if( (*itComRoute)->hasProtocol() )
+ {
+ // TODO for other COM_PROTOCOL
+ }
+ }
+ }
+
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ ioc->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << "END COMPILE INTERACTION CONNECT FLOW"
+ << std::endl << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+}
+
+
+/*
+ *******************************************************************************
+ * COMPILE INTERACTION CONNECT TRANSFERT
+ *******************************************************************************
+ */
+void CompilerOfInteraction::compileConnectorTransfert(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc)
+{
+ const Connector * aConnector = ioc->getAstConnector();
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ AVM_OS_TRACE << INCR_INDENT_TAB
+ << "COMPILE INTERACTION CONNECT TRANSFERT"
+ << std::endl;
+ aConnector->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+
+ BFList::const_raw_iterator< ComPoint > itComPoint;
+ BFList::const_raw_iterator< ComPoint > endItComPoint;
+
+ List< RoutingData > listOfRoutingData;
+// RoutingData theRoutingData;
+
+ // Routing for all port
+ Connector::route_iterator itComRoute = aConnector->begin();
+ Connector::route_iterator endItComRoute = aConnector->end();
+ for( ; itComRoute != endItComRoute ; ++itComRoute )
+ {
+ itComPoint = (*itComRoute)->getComPoints().begin();
+ endItComPoint = (*itComRoute)->getComPoints().end();
+ for( ; itComPoint != endItComPoint ; ++itComPoint )
+ {
+ createRoutingData(listOfRoutingData, theExecutable,
+ ioc, (*itComRoute), (itComPoint));
+
+// while( listOfRoutingData.nonempty() )
+// {
+// listOfRoutingData.pop_first_to( theRoutingData );
+//
+// if( theRoutingData.getComPoint()->is< OutputComPoint >() )
+// {
+// theExecutable->getRouter4Instance(
+// theInstanceStatic->getOffset())->setOutputRouting(
+// theComPointInstance, theRoutingData);
+// ioc->getOutputComRouteData().appendMachineComPoint(
+// theRoutingData.getMachinePort() );
+// }
+//
+// if( theRoutingData.getComPoint()->is< InputComPoint >() )
+// {
+// theExecutable->getRouter4Instance(
+// theInstanceStatic->getOffset())->setInputRouting(
+// theComPointInstance, theRoutingData);
+// ioc->getInputComRouteData().appendMachineComPoint(
+// theRoutingData.getMachinePort() );
+// }
+// }
+ }
+ }
+
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ ioc->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << "END COMPILE INTERACTION CONNECT TRANSFERT"
+ << std::endl << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+}
+
+/*
+ *******************************************************************************
+ * COMPILE INTERACTION CONNECT ENVIRONMENT
+ *******************************************************************************
+ */
+
+void CompilerOfInteraction::compileConnectorEnvironment(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc)
+{
+ const Connector * aConnector = ioc->getAstConnector();
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ AVM_OS_TRACE << INCR_INDENT_TAB
+ << "COMPILE INTERACTION CONNECT ENVIRONMENT"
+ << std::endl;
+ aConnector->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+
+ BFList::const_raw_iterator< ComPoint > itComPoint;
+ BFList::const_raw_iterator< ComPoint > endItComPoint;
+
+ List< RoutingData > listOfRoutingData;
+ RoutingData theRoutingData;
+
+ // Routing for all port
+ Connector::route_iterator itComRoute = aConnector->begin();
+ Connector::route_iterator endItComRoute = aConnector->end();
+ for( ; itComRoute != endItComRoute ; ++itComRoute )
+ {
+ itComPoint = (*itComRoute)->getComPoints().begin();
+ endItComPoint = (*itComRoute)->getComPoints().end();
+ for( ; itComPoint != endItComPoint ; ++itComPoint )
+ {
+ createRoutingData(listOfRoutingData, theExecutable,
+ ioc, (*itComRoute), (itComPoint));
+
+ while( listOfRoutingData.nonempty() )
+ {
+ listOfRoutingData.pop_first_to( theRoutingData );
+
+ // ERROR REPORTING
+ if( theRoutingData.getPort()->getModifier().isnotDirectionKind(
+ (*itComRoute)->getModifier().getDirectionKind() )
+ && (not theRoutingData.getPort()->
+ getModifier().isDirectionInout()) )
+ {
+ incrErrorCount();
+ AVM_OS_WARN << (*itComRoute)->errorLocation(aConnector)
+ << "Unexpected a "
+ << theRoutingData.getPort()->getModifier().strDirection()
+ << " PORT << "
+ << theRoutingData.getPort()->getFullyQualifiedNameID()
+ << " >> in an "
+ << (*itComRoute)->getModifier().strDirection()
+ << " BUS << " << aConnector->getFullyQualifiedNameID()
+ << " >>" << std::endl;
+ }
+ }
+ }
+ }
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ ioc->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << "END COMPILE INTERACTION CONNECT ENVIRONMENT"
+ << std::endl << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+}
+
+
+
+
+
+
+
+
+/*
+ *******************************************************************************
+ * COMPILE INTERACTION CONNECT BROADCAST
+ *******************************************************************************
+ */
+void CompilerOfInteraction::compileRouteBroadcast(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc)
+{
+ const Connector * aConnector = ioc->getAstConnector();
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ AVM_OS_TRACE << INCR_INDENT_TAB
+ << "COMPILE INTERACTION CONNECT BROADCAST"
+ << std::endl;
+ aConnector->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+
+ Buffer * buffer = NULL;
+ InstanceOfBuffer * theBufferInstance = NULL;
+
+ if( aConnector->hasBuffer() )
+ {
+ buffer = aConnector->getBuffer();
+
+ if( buffer->isAnonymID() )
+ {
+ theBufferInstance = new InstanceOfBuffer(
+ theExecutable, buffer, theExecutable->getBuffer().size());
+
+ getSymbolTable().addBufferInstance(
+ theExecutable->saveBuffer(theBufferInstance) );
+ }
+ else
+ {
+ theBufferInstance = getSymbolTable().searchBufferInstance(
+ theExecutable, buffer).rawBuffer();
+ }
+ }
+ else if( aConnector->hasBufferUfid() )
+ {
+ theBufferInstance =
+ getSymbolTable().searchBufferInstanceByQualifiedNameID(
+ theExecutable, aConnector->strBufferUfid()).rawBuffer();
+
+ if( theBufferInstance == NULL )
+ {
+ incrErrorCount();
+ aConnector->errorLocation(AVM_OS_WARN)
+ << "Unfound in the COM POINT the buffer instance < "
+ << aConnector->strBufferUfid() << " > !" << std::endl;
+ }
+ }
+ else if( buffer == NULL )
+ {
+ theBufferInstance = new InstanceOfBuffer(
+ theExecutable, buffer, theExecutable->getBuffer().size(),
+ TYPE_FIFO_SPECIFIER, -1 );
+
+ getSymbolTable().addBufferInstance(
+ theExecutable->saveBuffer(theBufferInstance) );
+ }
+
+
+ BFList::const_raw_iterator< ComPoint > itComPoint;
+ BFList::const_raw_iterator< ComPoint > endItComPoint;
+
+ List< RoutingData > listOfRoutingData;
+ RoutingData theRoutingData;
+
+ // Routing for all port
+ Connector::route_iterator itComRoute = aConnector->begin();
+ Connector::route_iterator endItComRoute = aConnector->end();
+ for( ; itComRoute != endItComRoute ; ++itComRoute )
+ {
+ itComPoint = (*itComRoute)->getComPoints().begin();
+ endItComPoint = (*itComRoute)->getComPoints().end();
+ for( ; itComPoint != endItComPoint ; ++itComPoint )
+ {
+ createRoutingData(listOfRoutingData, theExecutable,
+ ioc, (*itComRoute), (itComPoint));
+
+ while( listOfRoutingData.nonempty() )
+ {
+ listOfRoutingData.pop_first_to( theRoutingData );
+
+ // for buffer port
+ if( theBufferInstance != NULL )
+ {
+ theRoutingData.appendBuffer(theBufferInstance);
+ }
+
+ if( (*itComRoute)->hasProtocol() )
+ {
+ // TODO for other COM_PROTOCOL
+ }
+ }
+ }
+ }
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ ioc->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << "END COMPILE INTERACTION CONNECT BROADCAST"
+ << std::endl << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+}
+
+
+/*
+ *******************************************************************************
+ * COMPILE INTERACTION CONNECT BUFFER
+ *******************************************************************************
+ */
+void CompilerOfInteraction::compileRouteBuffer(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc)
+{
+ const Connector * aConnector = ioc->getAstConnector();
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ AVM_OS_TRACE << INCR_INDENT_TAB
+ << "COMPILE INTERACTION CONNECT BUFFER" << std::endl;
+ aConnector->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+
+ Buffer * buffer = NULL;
+ InstanceOfBuffer * theBufferInstance = NULL;
+ InstanceOfBuffer * localBufferInstance = NULL;
+
+ if( aConnector->hasBuffer() )
+ {
+ buffer = aConnector->getBuffer();
+ if( buffer->isAnonymID() )
+ {
+ theBufferInstance = new InstanceOfBuffer(
+ theExecutable, buffer, theExecutable->getBuffer().size());
+
+ getSymbolTable().addBufferInstance(
+ theExecutable->saveBuffer(theBufferInstance) );
+ }
+ else
+ {
+ theBufferInstance = getSymbolTable().searchBufferInstance(
+ theExecutable, buffer).rawBuffer();
+ }
+ }
+ else if( aConnector->hasBufferUfid() )
+ {
+ theBufferInstance =
+ getSymbolTable().searchBufferInstanceByQualifiedNameID(
+ theExecutable, aConnector->strBufferUfid()).rawBuffer();
+
+ if( theBufferInstance == NULL )
+ {
+ incrErrorCount();
+ aConnector->errorLocation(AVM_OS_WARN)
+ << "Unfound in the COM POINT the buffer instance < "
+ << aConnector->strBufferUfid() << " > !" << std::endl;
+ }
+ }
+ else if( buffer == NULL )
+ {
+ theBufferInstance = new InstanceOfBuffer(
+ theExecutable, buffer, theExecutable->getBuffer().size(),
+ TYPE_FIFO_SPECIFIER, -1 );
+
+ getSymbolTable().addBufferInstance(
+ theExecutable->saveBuffer(theBufferInstance) );
+ }
+
+ // lists for update input port connector list
+ List< RoutingData > listOfOutRoutingData;
+ List< RoutingData > listOfInRoutingData;
+
+ BFList::const_raw_iterator< ComPoint > itComPoint;
+ BFList::const_raw_iterator< ComPoint > endItComPoint;
+
+ List< RoutingData > listOfRoutingData;
+ RoutingData theRoutingData;
+
+ // Routing for all port
+ Connector::route_iterator itComRoute = aConnector->begin();
+ Connector::route_iterator endItComRoute = aConnector->end();
+ for( ; itComRoute != endItComRoute ; ++itComRoute )
+ {
+ itComPoint = (*itComRoute)->getComPoints().begin();
+ endItComPoint = (*itComRoute)->getComPoints().end();
+ for( ; itComPoint != endItComPoint ; ++itComPoint )
+ {
+ createRoutingData(listOfRoutingData, theExecutable,
+ ioc, (*itComRoute), (itComPoint));
+
+ while( listOfRoutingData.nonempty() )
+ {
+ listOfRoutingData.pop_first_to( theRoutingData );
+
+ if( theBufferInstance != NULL )
+ {
+ // for buffer port
+ theRoutingData.appendBuffer(theBufferInstance);
+ }
+
+ // for buffer port
+ if( not (*itComRoute)->hasProtocol() )
+ {
+ continue;
+ }
+
+ switch( (*itComRoute)->getProtocol() )
+ {
+ case ComProtocol::PROTOCOL_BUFFER_KIND:
+ {
+ localBufferInstance = theBufferInstance;
+
+ if( (*itComRoute)->hasBuffer() )
+ {
+ buffer = (*itComRoute)->getBuffer();
+
+ if( buffer->isAnonymID() )
+ {
+ localBufferInstance = new InstanceOfBuffer(
+ theExecutable, buffer,
+ theExecutable->getBuffer().size());
+
+ getSymbolTable().addBufferInstance(
+ theExecutable->saveBuffer(
+ localBufferInstance) );
+ }
+ else
+ {
+ localBufferInstance = getSymbolTable().
+ searchBufferInstance(theExecutable, buffer).
+ rawBuffer();
+ }
+ }
+ else if( (*itComRoute)->hasBufferUfid() )
+ {
+ localBufferInstance = getSymbolTable().
+ searchBufferInstance(theExecutable,
+ (*itComRoute)->strBufferUfid()).rawBuffer();
+
+ if( localBufferInstance == NULL )
+ {
+ incrErrorCount();
+ aConnector->errorLocation(AVM_OS_WARN)
+ << "Unfound in the COM POINT "
+ "the buffer instance < "
+ << (*itComRoute)->strBufferUfid()
+ << " > !" << std::endl;
+ }
+ }
+
+ if( localBufferInstance != NULL )
+ {
+ theRoutingData.appendBuffer(localBufferInstance);
+ }
+ else
+ {
+ // TODO for other ERROR
+ }
+
+ break;
+ }
+
+ default:
+ {
+ // TODO for other COM_PROTOCOL
+ break;
+ }
+ }
+
+ // list for update all buffer and port connector list
+ if( (*itComRoute)->getModifier().isDirectionOutput() )
+ {
+ listOfOutRoutingData.append(theRoutingData);
+ }
+ else
+ {
+ listOfInRoutingData.append(theRoutingData);
+ }
+ }
+ }
+ }
+
+
+ // buffer completion
+ bufferCompletion(listOfOutRoutingData, listOfInRoutingData);
+
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ ioc->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << "END COMPILE INTERACTION CONNECT BUFFER"
+ << std::endl << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+}
+
+
+
+/*
+ *******************************************************************************
+ * COMPILE INTERACTION CONNECT ROUTING CAST
+ *******************************************************************************
+ */
+void CompilerOfInteraction::compileRouteRoutingCast(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc)
+{
+ const Connector * aConnector = ioc->getAstConnector();
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ AVM_OS_TRACE << INCR_INDENT_TAB
+ << "COMPILE INTERACTION CONNECT ROUTING CAST"
+ << std::endl;
+ aConnector->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+
+ Buffer * buffer = NULL;
+ InstanceOfBuffer * theBufferInstance = NULL;
+
+ // lists for update input port connector list
+ List< RoutingData > listOfOutRoutingData;
+ List< RoutingData > listOfInRoutingData;
+
+ BFList::const_raw_iterator< ComPoint > itComPoint;
+ BFList::const_raw_iterator< ComPoint > endItComPoint;
+
+ List< RoutingData > listOfRoutingData;
+ RoutingData theRoutingData;
+
+ // Routing for all port
+ Connector::route_iterator itComRoute = aConnector->begin();
+ Connector::route_iterator endItComRoute = aConnector->end();
+ for( ; itComRoute != endItComRoute ; ++itComRoute )
+ {
+ itComPoint = (*itComRoute)->getComPoints().begin();
+ endItComPoint = (*itComRoute)->getComPoints().end();
+ for( ; itComPoint != endItComPoint ; ++itComPoint )
+ {
+ createRoutingData(listOfRoutingData, theExecutable,
+ ioc, (*itComRoute), (itComPoint));
+
+ while( listOfRoutingData.nonempty() )
+ {
+ listOfRoutingData.pop_first_to( theRoutingData );
+
+ // list for update input buffer and port connector list
+ listOfOutRoutingData.append(theRoutingData);
+
+ // for buffer port
+ if( not (*itComRoute)->hasProtocol() )
+ {
+ continue;
+ }
+
+ switch( (*itComRoute)->getProtocol() )
+ {
+ case ComProtocol::PROTOCOL_BUFFER_KIND:
+ {
+ if( (*itComRoute)->hasBuffer() )
+ {
+ buffer = (*itComRoute)->getBuffer();
+
+ if( buffer->isAnonymID() )
+ {
+ theBufferInstance = new InstanceOfBuffer(
+ theExecutable, buffer,
+ theExecutable->getBuffer().size());
+
+ getSymbolTable().addBufferInstance(
+ theExecutable->saveBuffer(theBufferInstance));
+ }
+ else
+ {
+ theBufferInstance = getSymbolTable().
+ searchBufferInstance(theExecutable, buffer).
+ rawBuffer();
+ }
+ }
+ else if( (*itComRoute)->hasBufferUfid() )
+ {
+ theBufferInstance = getSymbolTable().
+ searchBufferInstance(theExecutable,
+ (*itComRoute)->strBufferUfid()).rawBuffer();
+
+ if( theBufferInstance == NULL )
+ {
+ incrErrorCount();
+ aConnector->errorLocation(AVM_OS_WARN)
+ << "Unfound in the COM POINT "
+ "the buffer instance < "
+ << (*itComRoute)->strBufferUfid()
+ << " > !" << std::endl;
+ }
+ }
+
+ if( theBufferInstance != NULL )
+ {
+ theRoutingData.appendBuffer(theBufferInstance);
+ }
+ else
+ {
+ // TODO for other ERROR
+ }
+
+ break;
+ }
+
+ case ComProtocol::PROTOCOL_MULTICAST_KIND:
+ {
+ break;
+ }
+ case ComProtocol::PROTOCOL_UNICAST_KIND:
+ {
+ break;
+ }
+ case ComProtocol::PROTOCOL_ANYCAST_KIND:
+ {
+ break;
+ }
+ default:
+ {
+ // TODO for other COM_PROTOCOL
+ break;
+ }
+ }
+
+ // list for update all buffer and port connector list
+ if( (*itComRoute)->getModifier().isDirectionOutput() )
+ {
+ listOfOutRoutingData.append(theRoutingData);
+ }
+ else
+ {
+ listOfInRoutingData.append(theRoutingData);
+ }
+ }
+ }
+ }
+
+
+ // buffer completion
+ bufferCompletion(listOfOutRoutingData, listOfInRoutingData);
+
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << "END COMPILE INTERACTION CONNECT ROUTING CAST"
+ << std::endl << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+}
+
+
+/*
+ *******************************************************************************
+ * COMPILE INTERACTION CONNECT SYNCHRONOUS
+ *******************************************************************************
+ */
+void CompilerOfInteraction::compileRouteSynchronous(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc)
+{
+ const Connector * aConnector = ioc->getAstConnector();
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ AVM_OS_TRACE << INCR_INDENT_TAB
+ << "COMPILE INTERACTION CONNECT SYNCHRONOUS" << std::endl;
+ aConnector->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+
+ BFList::const_raw_iterator< ComPoint > itComPoint;
+ BFList::const_raw_iterator< ComPoint > endItComPoint;
+
+ List< RoutingData > listOfRoutingData;
+// RoutingData theRoutingData;
+
+ // Routing for all port
+ Connector::route_iterator itComRoute = aConnector->begin();
+ Connector::route_iterator endItComRoute = aConnector->end();
+ for( ; itComRoute != endItComRoute ; ++itComRoute )
+ {
+ if( (*itComRoute)->hasCast() )
+ {
+ if( (*itComRoute)->getModifier().isDirectionOutput() )
+ {
+ ioc->getOutputComRouteData().setCast(
+ (*itComRoute)->getCast() );
+ }
+ else
+ {
+ ioc->getInputComRouteData().setCast(
+ (*itComRoute)->getCast() );
+ }
+ }
+
+ itComPoint = (*itComRoute)->getComPoints().begin();
+ endItComPoint = (*itComRoute)->getComPoints().end();
+ for( ; itComPoint != endItComPoint ; ++itComPoint )
+ {
+ createRoutingData(listOfRoutingData, theExecutable,
+ ioc, (*itComRoute), (itComPoint));
+
+// while( listOfRoutingData.nonempty() )
+// {
+// listOfRoutingData.pop_first_to( theRoutingData );
+//
+// if( (*itComRoute)->hasProtocol() )
+// {
+// // TODO for other COM_PROTOCOL
+// }
+// }
+ }
+ }
+
+ if( ioc->getProtocol() == ComProtocol::PROTOCOL_MULTIRDV_KIND )
+ {
+ if( (not ioc->getOutputComRouteData().hasCast()) &&
+ ioc->getOutputComRouteData().getMachinePorts().singleton() )
+ {
+ ioc->getOutputComRouteData().setCast(
+ ComProtocol::PROTOCOL_UNICAST_KIND );
+ }
+
+ if( (not ioc->getInputComRouteData().hasCast()) &&
+ ioc->getInputComRouteData().getMachinePorts().singleton() )
+ {
+ ioc->getInputComRouteData().setCast(
+ ComProtocol::PROTOCOL_UNICAST_KIND );
+ }
+ }
+
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ ioc->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << "END COMPILE INTERACTION CONNECT SYNCHRONOUS"
+ << std::endl << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+}
+
+
+
+/*
+ *******************************************************************************
+ * COMPILE INTERACTION CONNECT TRANSFERT
+ *******************************************************************************
+ */
+void CompilerOfInteraction::compileRouteTransfert(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc)
+{
+ const Connector * aConnector = ioc->getAstConnector();
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ AVM_OS_TRACE << INCR_INDENT_TAB
+ << "COMPILE INTERACTION CONNECT TRANSFERT" << std::endl;
+ aConnector->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+
+ BFList::const_raw_iterator< ComPoint > itComPoint;
+ BFList::const_raw_iterator< ComPoint > endItComPoint;
+
+ List< RoutingData > listOfRoutingData;
+// RoutingData theRoutingData;
+
+ // Routing for all port
+ Connector::route_iterator itComRoute = aConnector->begin();
+ Connector::route_iterator endItComRoute = aConnector->end();
+ for( ; itComRoute != endItComRoute ; ++itComRoute )
+ {
+ itComPoint = (*itComRoute)->getComPoints().begin();
+ endItComPoint = (*itComRoute)->getComPoints().end();
+ for( ; itComPoint != endItComPoint ; ++itComPoint )
+ {
+ createRoutingData(listOfRoutingData, theExecutable,
+ ioc, (*itComRoute), (itComPoint));
+//
+// while( listOfRoutingData.nonempty() )
+// {
+// listOfRoutingData.pop_first_to( theRoutingData );
+//
+// if( theRoutingData.getComPoint()->is< OutputComPoint >() )
+// {
+// theExecutable->getRouter4Instance(
+// theInstanceStatic->getOffset())->setOutputRouting(
+// theComPointInstance, theRoutingData);
+// ioc->getOutputComRouteData().appendMachineComPoint(
+// theRoutingData.getMachinePort() );
+// }
+//
+// if( theRoutingData.getComPoint()->is< InputComPoint >() )
+// {
+// theExecutable->getRouter4Instance(
+// theInstanceStatic->getOffset())->setInputRouting(
+// theComPointInstance, theRoutingData);
+// ioc->getInputComRouteData().appendMachineComPoint(
+// theRoutingData.getMachinePort() );
+// }
+// }
+ }
+ }
+
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ ioc->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << "END COMPILE INTERACTION CONNECT TRANSFERT"
+ << std::endl << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+}
+
+/*
+ *******************************************************************************
+ * COMPILE INTERACTION CONNECT ENVIRONMENT
+ *******************************************************************************
+ */
+
+void CompilerOfInteraction::compileRouteEnvironment(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc)
+{
+ const Connector * aConnector = ioc->getAstConnector();
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ AVM_OS_TRACE << INCR_INDENT_TAB
+ << "COMPILE INTERACTION CONNECT ENVIRONMENT" << std::endl;
+ aConnector->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+
+ BFList::const_raw_iterator< ComPoint > itComPoint;
+ BFList::const_raw_iterator< ComPoint > endItComPoint;
+
+ List< RoutingData > listOfRoutingData;
+ RoutingData theRoutingData;
+
+ // Routing for all port
+ Connector::route_iterator itComRoute = aConnector->begin();
+ Connector::route_iterator endItComRoute = aConnector->end();
+ for( ; itComRoute != endItComRoute ; ++itComRoute )
+ {
+ itComPoint = (*itComRoute)->getComPoints().begin();
+ endItComPoint = (*itComRoute)->getComPoints().end();
+ for( ; itComPoint != endItComPoint ; ++itComPoint )
+ {
+ createRoutingData(listOfRoutingData, theExecutable,
+ ioc, (*itComRoute), (itComPoint));
+
+ while( listOfRoutingData.nonempty() )
+ {
+ listOfRoutingData.pop_first_to( theRoutingData );
+
+ // ERROR REPORTING
+ if( theRoutingData.getPort()->getModifier().isnotDirectionKind(
+ (*itComRoute)->getModifier().getDirectionKind() )
+ && (not theRoutingData.getPort()->
+ getModifier().isDirectionInout()) )
+ {
+ incrErrorCount();
+ AVM_OS_WARN << (*itComRoute)->errorLocation(aConnector)
+ << "Unexpected a "
+ << theRoutingData.getPort()->getModifier().strDirection()
+ << " PORT << "
+ << theRoutingData.getPort()->getFullyQualifiedNameID()
+ << " >> in an "
+ << (*itComRoute)->getModifier().strDirection()
+ << " BUS << " << aConnector->getFullyQualifiedNameID()
+ << " >>" << std::endl;
+ }
+ }
+ }
+ }
+
+AVM_IF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+ ioc->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << "END COMPILE INTERACTION CONNECT ENVIRONMENT"
+ << std::endl << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , COMMUNICATION )
+}
+
+
+
+
+/*
+ *******************************************************************************
+ * TOOLS FOR ROUTING DATA
+ *******************************************************************************
+ */
+RoutingData CompilerOfInteraction::addRoutingData(
+ ExecutableForm * theExecutable, bool isInstanceStaticFlag,
+ InstanceOfConnect * ioc, InstanceOfMachine * theInstanceStatic,
+ InstanceOfPort * thePortInstance,
+ Modifier::DIRECTION_KIND aDirection)
+{
+ RoutingData theRoutingData(ioc, theInstanceStatic, thePortInstance);
+
+ if( thePortInstance->isPort() )
+ {
+ Router & theRouter = ( isInstanceStaticFlag )
+ ? theExecutable->getRouter4Instance(theInstanceStatic->getOffset())
+ : theExecutable->getRouter4Model(theInstanceStatic->getOffset());
+
+ return( addRoutingData(theRouter, theRoutingData, aDirection) );
+ }
+ else// if( thePortInstance->isSignal() )
+ {
+ theRoutingData.setMID( thePortInstance->getRouteOffset() + 1 );
+
+ return( addRoutingData(theExecutable->getRouter4This(),
+ theRoutingData, aDirection) );
+ }
+}
+
+
+RoutingData CompilerOfInteraction::addRoutingData(
+ Router & theRouter, RoutingData & theRoutingData,
+ Modifier::DIRECTION_KIND aDirection)
+{
+ switch( aDirection )
+ {
+ case Modifier::DIRECTION_INPUT_KIND:
+ {
+ theRouter.appendInputRouting(
+ theRoutingData.getPort(), theRoutingData);
+
+ theRoutingData.getConnect()->getInputComRouteData().
+ appendMachinePort( theRoutingData.getMachinePort() );
+
+ break;
+ }
+
+ case Modifier::DIRECTION_OUTPUT_KIND:
+ {
+ theRouter.appendOutputRouting(
+ theRoutingData.getPort(), theRoutingData);
+
+ theRoutingData.getConnect()->getOutputComRouteData().
+ appendMachinePort( theRoutingData.getMachinePort() );
+
+ break;
+ }
+
+ case Modifier::DIRECTION_INOUT_KIND:
+ {
+ theRouter.appendInputRouting(
+ theRoutingData.getPort(), theRoutingData);
+
+ theRoutingData.getConnect()->getInputComRouteData().
+ appendMachinePort( theRoutingData.getMachinePort() );
+
+
+ theRouter.appendOutputRouting(
+ theRoutingData.getPort(), theRoutingData);
+
+ theRoutingData.getConnect()->getOutputComRouteData().
+ appendMachinePort( theRoutingData.getMachinePort() );
+
+ break;
+ }
+
+ default:
+ {
+ theRoutingData.getConnect()->
+ getAstElement()->errorLocation(AVM_OS_WARN)
+ << "Routing Data for < "
+ << str_header( theRoutingData.getPort() ) << " > !"
+ << std::endl;
+
+ AVM_OS_EXIT( FAILED )
+ << "Unexpected Port Nature !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+
+ return( theRoutingData );
+}
+
+
+
+/*
+ *******************************************************************************
+ * SEARCH PORT CONNECT INSTANCE
+ *******************************************************************************
+ */
+
+ExecutableForm * CompilerOfInteraction::compileComPointMachine(
+ ExecutableForm * theExecutable, ComPoint * aComPoint,
+ bool & isInstanceStaticFlag, InstanceOfMachine * & aMachine)
+{
+ if( aComPoint->hasMachine() )
+ {
+ Machine * comMachine = aComPoint->getMachine();
+
+ ExecutableForm * anExecutable4Port = theExecutable;
+ while( anExecutable4Port != NULL )
+ {
+ if( anExecutable4Port->isAstElement( comMachine )
+ && anExecutable4Port->hasInstanceStaticThis() )
+ {
+ isInstanceStaticFlag = true;
+ aMachine = anExecutable4Port->
+ getInstanceStaticThis().rawMachine();
+
+ return( anExecutable4Port );
+ }
+ anExecutable4Port = anExecutable4Port->getExecutableContainer();
+ }
+
+ if( comMachine->getSpecifier().hasDesignInstanceStatic() )
+ {
+ isInstanceStaticFlag = true;
+
+ aMachine = theExecutable->
+ getByAstInstanceStatic( comMachine ).rawMachine();
+ }
+ else
+ {
+ isInstanceStaticFlag = false;
+
+ aMachine = theExecutable->getInstanceModel().
+ getByAstElement( comMachine ).rawMachine();
+
+ if( aMachine == NULL )
+ {
+ ExecutableForm * aMachineExec = getSymbolTable().
+ searchExecutable(comMachine).to_ptr< ExecutableForm >();
+
+ if( aMachineExec != NULL )
+ {
+ if( aMachineExec->isAncestorOf(theExecutable) )
+ {
+ isInstanceStaticFlag = true;
+ aMachine = theExecutable->
+ getInstanceStaticThis().rawMachine();
+ }
+ else
+ {
+ aMachine = new InstanceOfMachine(theExecutable,
+ aMachineExec->getAstMachine(), aMachineExec,
+ NULL, theExecutable->getInstanceModel().size());
+
+ theExecutable->saveInstanceModel(aMachine);
+
+ addMachineModelRouter(theExecutable, aMachine);
+ }
+
+ return( aMachineExec );
+ }
+
+ else
+ {
+ incrErrorCount();
+ AVM_OS_WARN << aComPoint->errorLocation( aComPoint )
+ << "Unfound in the COM POINT < "
+ << str_header( comMachine ) << " > !"
+ << std::endl;
+
+ return( NULL );
+ }
+ }
+ }
+
+ if( aMachine != NULL )
+ {
+ if( aMachine->hasExecutable() )
+ {
+ return( aMachine->getExecutable() );
+ }
+ else
+ {
+ incrErrorCount();
+ AVM_OS_WARN
+ << aComPoint->errorLocation( aComPoint )
+ << "Unexpected in the COMP POINT < "
+ << str_header( comMachine )
+ << " > without a model with an interface !"
+ << std::endl;
+
+ return( NULL );
+ }
+ }
+ else
+ {
+ incrErrorCount();
+ AVM_OS_WARN << aComPoint->errorLocation( aComPoint )
+ << "Unfound in the COM POINT < "
+ << str_header( comMachine ) << " > !"
+ << std::endl;
+
+ return( NULL );
+ }
+ }
+
+ else if( aComPoint->hasMachinePortQualifiedNameID() )
+ {
+ if( aComPoint->getMachinePortQualifiedNameID().is< Identifier >() )
+ {
+ if( theExecutable->hasInstanceStaticThis() )
+ {
+ isInstanceStaticFlag = true;
+ aMachine = theExecutable->getInstanceStaticThis().rawMachine();
+
+ ExecutableForm * comExec = theExecutable;
+ while( comExec != NULL )
+ {
+ if( comExec->getPort().getByNameID( aComPoint->
+ getMachinePortQualifiedNameID().str() ).valid() )
+ {
+ aMachine = theExecutable->
+ getInstanceStaticThis().rawMachine();
+ return( comExec );
+ }
+ comExec = comExec->getExecutableContainer();
+ }
+ }
+
+ incrErrorCount();
+ AVM_OS_WARN << aComPoint->errorLocation( aComPoint )
+ << "Unfound in the COM POINT the port contained machine < "
+ << aComPoint->getMachinePortQualifiedNameID() << " > !"
+ << std::endl;
+
+ return( NULL );
+ }
+
+
+ std::string machineFQN;
+
+ if( aComPoint->getMachinePortQualifiedNameID().
+ is< QualifiedIdentifier >() )
+ {
+ machineFQN = aComPoint->getMachinePortQualifiedNameID().to_ptr<
+ QualifiedIdentifier >()->getContainerQualifiedNameID();
+ }
+ else if( aComPoint->getMachinePortQualifiedNameID().
+ is< UniFormIdentifier >() )
+ {
+ machineFQN = aComPoint->getMachinePortQualifiedNameID().
+ to_ptr< UniFormIdentifier >()->toStringContainer();
+ }
+
+ if( not machineFQN.empty() )
+ {
+ aMachine = theExecutable->getInstanceStatic().
+ getByFQNameID( machineFQN ).rawMachine();
+
+ if( aMachine == NULL )
+ {
+ isInstanceStaticFlag = false;
+
+ aMachine = theExecutable->getInstanceModel().
+ getByFQNameID( machineFQN ).rawMachine();
+
+ if( aMachine == NULL )
+ {
+ ExecutableForm * theMachineModel = getSymbolTable().
+ searchExecutable(machineFQN).to_ptr< ExecutableForm >();
+
+ if( theMachineModel != NULL )
+ {
+ aMachine = new InstanceOfMachine(theExecutable,
+ theMachineModel->getAstMachine(),
+ theMachineModel, NULL,
+ theExecutable->getInstanceModel().size());
+
+ theExecutable->saveInstanceModel(aMachine);
+
+ addMachineModelRouter(theExecutable, aMachine);
+
+ return( theMachineModel );
+ }
+
+ else
+ {
+ incrErrorCount();
+ AVM_OS_WARN << aComPoint->errorLocation( aComPoint )
+ << "Unfound in the COM POINT the machine < "
+ << machineFQN << " > !" << std::endl;
+
+ return( NULL );
+ }
+ }
+ }
+ }
+
+ if( aMachine != NULL )
+ {
+ if( aMachine->hasExecutable() )
+ {
+ return( aMachine->getExecutable() );
+ }
+ else
+ {
+ incrErrorCount();
+ AVM_OS_WARN
+ << aComPoint->errorLocation( aComPoint )
+ << "Unexpected in the COMP POINT < "
+ << aComPoint->getMachinePortQualifiedNameID().str()
+ << " > a machine without a model with an interface !"
+ << std::endl;
+
+ return( NULL );
+ }
+ }
+ else
+ {
+ incrErrorCount();
+ AVM_OS_WARN << aComPoint->errorLocation( aComPoint )
+ << "Unfound in the COM POINT < "
+ << aComPoint->getMachinePortQualifiedNameID().str()
+ << " > a machine !" << std::endl;
+
+ return( NULL );
+ }
+
+ }
+
+ return( (aMachine != NULL) ? aMachine->getExecutable() : NULL );
+}
+
+
+bool CompilerOfInteraction::compileComPointPort(
+ ExecutableForm * theExecutable4Port,
+ ComPoint * aComPoint, InstanceOfPort * & thePortInstance)
+{
+ if( aComPoint->hasPort() )
+ {
+ if( aComPoint->getPort()->isBasic() )
+ {
+ thePortInstance = getSymbolTable().searchPortConnectorInstance(
+ theExecutable4Port, aComPoint->getPort());
+
+ if( thePortInstance == NULL )
+ {
+ incrErrorCount();
+ AVM_OS_WARN
+ << aComPoint->errorLocation( aComPoint )
+ << "Unfound in the COM POINT the port < "
+ << aComPoint->getPort()->getFullyQualifiedNameID()
+ << " > in the model "
+ << str_header( aComPoint->getMachine() )
+ << std::endl;
+ }
+ }
+ else //if( aComPoint->getPort()->isComposite() )
+ {
+ incrErrorCount();
+ AVM_OS_WARN << aComPoint->errorLocation( aComPoint )
+ << "Unexpected the COMPOSITE PORT << "
+ << str_header( thePortInstance ) << " >> as COM POINT "
+ << std::endl << std::endl;
+
+ return( false );
+ }
+ }
+ else if( aComPoint->hasMachinePortQualifiedNameID() )
+ {
+ std::string portId;
+
+ if( aComPoint->getMachinePortQualifiedNameID().is< Identifier >() )
+ {
+ portId= aComPoint->getMachinePortQualifiedNameID().str();
+ }
+ if( aComPoint->getMachinePortQualifiedNameID().
+ is< QualifiedIdentifier >() )
+ {
+ portId = aComPoint->getMachinePortQualifiedNameID().
+ to_ptr< QualifiedIdentifier >()->getNameID();
+ }
+ else if( aComPoint->getMachinePortQualifiedNameID().
+ is< UniFormIdentifier >() )
+ {
+ portId = aComPoint->getMachinePortQualifiedNameID().
+ to_ptr< UniFormIdentifier >()->toStringId();
+ }
+ else
+ {
+ incrErrorCount();
+ AVM_OS_WARN << aComPoint->errorLocation( aComPoint )
+ << "Unfound in the CONNECT the port < "
+ << aComPoint->getMachinePortQualifiedNameID()
+ << " > in the model of < "
+ << str_header( theExecutable4Port ) << " > !"
+ << std::endl;
+
+ return( false );
+ }
+
+ std::string portUfi =
+ theExecutable4Port->getAstFullyQualifiedNameID() + "." + portId;
+
+ thePortInstance = getSymbolTable().searchPortConnectorInstance(
+ theExecutable4Port, portUfi);
+
+ if( thePortInstance == NULL )
+ {
+ incrErrorCount();
+ AVM_OS_WARN << aComPoint->errorLocation( aComPoint )
+ << "Unfound in the CONNECT the port < "
+ << portUfi << " > in the model of < "
+ << str_header( aComPoint->getMachine() ) << " > !"
+ << std::endl;
+
+ return( false );
+ }
+ }
+
+ return( thePortInstance != NULL );
+}
+
+
+
+void CompilerOfInteraction::createRoutingData(
+ List< RoutingData > & listOfRoutingData,
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc,
+ ComRoute * aComRoute, ComPoint * aComPoint)
+{
+ bool isInstanceStaticFlag = true;
+
+ InstanceOfMachine * anInstanceStatic = NULL;
+
+ ExecutableForm * anExecutable4Port = compileComPointMachine(
+ theExecutable, aComPoint, isInstanceStaticFlag, anInstanceStatic);
+ if( anExecutable4Port != NULL )
+ {
+ if( aComPoint->isMachineAllPort() )
+ {
+ TableOfSymbol::const_iterator itPort;
+ TableOfSymbol::const_iterator endPort;
+
+ do
+ {
+ itPort = anExecutable4Port->getPort().begin();
+ endPort = anExecutable4Port->getPort().end();
+ for( ; itPort != endPort ; ++itPort)
+ {
+ if( (*itPort).port().isSignal()
+ || ((*itPort).getContainer() == theExecutable) )
+ {
+ if( (*itPort).getModifier().hasDirectionKind(
+ aComRoute->getModifier().getDirectionKind() ) )
+ {
+ listOfRoutingData.append( addRoutingData(
+ theExecutable, isInstanceStaticFlag, ioc,
+ anInstanceStatic, (*itPort).rawPort(),
+ aComRoute->getModifier().getDirectionKind()) );
+ }
+ else
+ {
+ incrWarningCount();
+ AVM_OS_WARN << aComPoint->warningLocation(aComPoint)
+ << "Incompatibility between the ComRoute << "
+ << aComRoute->str() << " >> & the ComPoint << "
+ << str_header( *itPort ) << " >> NATURE "
+ << std::endl << std::endl;
+ }
+ }
+ }
+
+ anExecutable4Port = anExecutable4Port->getExecutableContainer();
+ }
+ while( anExecutable4Port != NULL );
+ }
+ else
+ {
+ InstanceOfPort * aPortInstance = NULL;
+
+ if( compileComPointPort(
+ anExecutable4Port, aComPoint, aPortInstance) )
+ {
+ if( aPortInstance->getModifier().isDirectionKind(
+ aComRoute->getModifier().getDirectionKind() )
+ || aPortInstance->getModifier().isDirectionInout() )
+ {
+ listOfRoutingData.append( addRoutingData(
+ theExecutable, isInstanceStaticFlag,
+ ioc, anInstanceStatic, aPortInstance,
+ aComRoute->getModifier().getDirectionKind()) );
+ }
+ else
+ {
+ incrWarningCount();
+ AVM_OS_WARN << aComPoint->warningLocation( aComPoint )
+ << "Incompatibility between the ComRoute << "
+ << aComRoute->str() << " >> & the ComPoint << "
+ << str_header( aPortInstance ) << " >> NATURE "
+ << std::endl << std::endl;
+ }
+ }
+ }
+ }
+}
+
+
+/**
+ *******************************************************************************
+ * POST-COMPILATION
+ *******************************************************************************
+ */
+
+void CompilerOfInteraction::setUndefinedLocalRouteToEnv(const Router & aRouter)
+{
+ InstanceOfMachine * aMachine = aRouter.getMachine();
+
+ TableOfSymbol::const_iterator itPort =
+ aMachine->getExecutable()->getPort().begin();
+ TableOfSymbol::const_iterator endPort =
+ aMachine->getExecutable()->getPort().end();
+
+ for( ; itPort != endPort ; ++itPort )
+ {
+ if( (*itPort).port().isPort() )
+ {
+ if( (*itPort).getModifier().hasDirectionInput()
+ && aRouter.hasntInputRouting( (*itPort).getRouteOffset() ) )
+ {
+ aRouter.setInputRouting((*itPort).getRouteOffset(),
+ RoutingData(0, aMachine, (*itPort).rawPort(),
+ ComProtocol::PROTOCOL_ENVIRONMENT_KIND) );
+ }
+ // NO ELSE because of INOUT PORT
+ if( (*itPort).getModifier().hasDirectionOutput()
+ && aRouter.hasntOutputRouting( (*itPort).getRouteOffset() ) )
+ {
+ aRouter.setOutputRouting((*itPort).getRouteOffset(),
+ RoutingData(0, aMachine, (*itPort).rawPort(),
+ ComProtocol::PROTOCOL_ENVIRONMENT_KIND) );
+ }
+ }
+ }
+}
+
+
+void CompilerOfInteraction::updateGlobalRoute(
+ const Router & refRouter, const Router & newRouter)
+{
+ for( avm_size_t offset = 0 ; offset < mNextRouteID ; ++offset )
+ {
+ if( newRouter.getInputRouting(offset).invalid() )
+ {
+ if( refRouter.hasInputRouting(offset) )
+ {
+ newRouter.setInputRouting(offset,
+ refRouter.getInputRouting(offset));
+ }
+// else
+// {
+// newRouter.setInputRouting(offset, RoutingData(0, aMachine,
+// theMessage, ComProtocol::PROTOCOL_ENVIRONMENT_KIND)) );
+// }
+ }
+ // NO ELSE because of INOUT PORT
+ if( newRouter.hasntOutputRouting(offset) )
+ {
+ if( refRouter.hasOutputRouting(offset) )
+ {
+ newRouter.setOutputRouting(offset,
+ refRouter.getOutputRouting(offset));
+ }
+// else
+// {
+// newRouter.setOutputRouting(offset, RoutingData(0, aMachine,
+// theMessage, ComProtocol::PROTOCOL_ENVIRONMENT_KIND)) );
+// }
+ }
+ }
+}
+
+void CompilerOfInteraction::updateLocalModelUsingLocalPrototype(
+ ExecutableForm * theExecutable, const Router & aRouter4Model)
+{
+ InstanceOfMachine * aMachine = aRouter4Model.getMachine();
+
+//@debug:
+// AVM_OS_TRACE << "updateLocalModelUsingLocalPrototype: "
+// << theExecutable->getFullyQualifiedNameID() << std::endl
+// << " >>==>> " << str_header( aMachine ) << std::endl;
+// AVM_OS_TRACE << "INIT :>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl;
+// aRouter4Model.toStream(AVM_OS_TRACE);
+
+ Router aRouter4Prototype;
+ if( aMachine->getSpecifier().isDesignPrototypeStatic() )
+ {
+ aRouter4Prototype = theExecutable->getRouter4Prototype(aMachine);
+ }
+
+ if( aRouter4Prototype.valid() )
+ {
+//@debug:
+// aRouter4Prototype.toStream(AVM_OS_TRACE);
+// aRouter4Model.toStream(AVM_OS_TRACE);
+
+ // UPDATE GLOBAL ROUTE
+ updateGlobalRoute(aRouter4Prototype, aRouter4Model);
+
+//@debug:
+// AVM_OS_TRACE << "AVANT :>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl;
+// aRouter4Model.toStream(AVM_OS_TRACE);
+
+ TableOfSymbol::const_iterator itPort =
+ aMachine->getExecutable()->getPort().begin();
+ TableOfSymbol::const_iterator endPort =
+ aMachine->getExecutable()->getPort().end();
+ for( ; itPort != endPort ; ++itPort )
+ {
+ if( (*itPort).getModifier().hasDirectionInput()
+ && aRouter4Model.getInputRouting(
+ (*itPort).getRouteOffset()).invalid() )
+ {
+ if( aRouter4Prototype.getInputRouting(
+ (*itPort).getRouteOffset()).valid() )
+ {
+ aRouter4Model.setInputRouting((*itPort).getRouteOffset(),
+ aRouter4Prototype.getInputRouting(
+ (*itPort).getRouteOffset()));
+ }
+ }
+ // NO ELSE because of INOUT PORT
+ if( (*itPort).getModifier().hasDirectionOutput()
+ && aRouter4Model.hasntOutputRouting(
+ (*itPort).getRouteOffset()) )
+ {
+ if( aRouter4Prototype.getOutputRouting(
+ (*itPort).getRouteOffset()).valid() )
+ {
+ aRouter4Model.setOutputRouting((*itPort).getRouteOffset(),
+ aRouter4Prototype.getOutputRouting(
+ (*itPort).getRouteOffset()));
+ }
+ }
+ }
+
+//@debug:
+// AVM_OS_TRACE << "APRES :>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl;
+// aRouter4Model.toStream(AVM_OS_TRACE);
+// AVM_OS_TRACE << std::endl;
+ }
+}
+
+
+void CompilerOfInteraction::updateLocalModelUsingGlobalModel(
+ const Router & aRouter4Model)
+{
+ InstanceOfMachine * aMachine = aRouter4Model.getMachine();
+
+ ExecutableForm * anExecutable = aMachine->getExecutable();
+
+//@debug:
+// AVM_OS_TRACE << "updateLocalModelUsingGlobalModel: "
+// << theExecutable->getFullyQualifiedNameID() << std::endl
+// << " >>==>> " << str_header( aMachine ) << std::endl;
+// AVM_OS_TRACE << "INIT :>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl;
+// aRouter4Model.toStream(AVM_OS_TRACE);
+
+ Router aRouter4ModelThis;
+
+ if( aMachine->getSpecifier().isDesignPrototypeStatic()
+ && anExecutable->hasRouter4Instance() )
+ {
+ aRouter4ModelThis = anExecutable->getRouter4This();
+ }
+ else if( not anExecutable->hasRouter4Instance() )
+ {
+ anExecutable->appendRouter4Instance( aRouter4Model );
+
+ aRouter4ModelThis = anExecutable->getRouter4This();
+
+ if( not anExecutable->hasRouter4Model() )
+ {
+ anExecutable->setRouters4Model(
+ anExecutable->getRouters4Instance() );
+ }
+ }
+ else if( not anExecutable->hasRouter4Model() )
+ {
+ anExecutable->setRouters4Model(
+ anExecutable->getRouters4Instance() );
+ }
+
+
+ if( aRouter4ModelThis.valid() )
+ {
+//@debug:
+// aRouter4ModelThis.toStream(AVM_OS_TRACE);
+// aRouter4Model.toStream(AVM_OS_TRACE);
+
+ // UPDATE GLOBAL ROUTE
+ updateGlobalRoute(aRouter4ModelThis, aRouter4Model);
+
+
+//@debug:
+// AVM_OS_TRACE << "AVANT :>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl;
+// aRouter4Model.toStream(AVM_OS_TRACE);
+
+ TableOfSymbol::const_iterator itPort =
+ aMachine->getExecutable()->getPort().begin();
+ TableOfSymbol::const_iterator endPort =
+ aMachine->getExecutable()->getPort().end();
+
+ for( ; itPort != endPort ; ++itPort )
+ {
+ if( (*itPort).getModifier().hasDirectionInput()
+ && aRouter4Model.getInputRouting(
+ (*itPort).getRouteOffset()).invalid() )
+ {
+ if( aRouter4ModelThis.getInputRouting(
+ (*itPort).getRouteOffset()).valid() )
+ {
+ aRouter4Model.setInputRouting((*itPort).getRouteOffset(),
+ aRouter4ModelThis.getInputRouting(
+ (*itPort).getRouteOffset()));
+ }
+ else if( (*itPort).port().isPort() )
+ {
+ aRouter4Model.setInputRouting((*itPort).getRouteOffset(),
+ RoutingData(0, aMachine, (*itPort).rawPort(),
+ ComProtocol::PROTOCOL_ENVIRONMENT_KIND) );
+ }
+ }
+ // NO ELSE because of INOUT PORT
+ if( (*itPort).getModifier().hasDirectionOutput()
+ && aRouter4Model.hasntOutputRouting(
+ (*itPort).getRouteOffset()) )
+ {
+ if( aRouter4ModelThis.getOutputRouting(
+ (*itPort).getRouteOffset()).valid() )
+ {
+ aRouter4Model.setOutputRouting((*itPort).getRouteOffset(),
+ aRouter4ModelThis.getOutputRouting(
+ (*itPort).getRouteOffset()));
+ }
+ else if( (*itPort).port().isPort() )
+ {
+ aRouter4Model.setOutputRouting((*itPort).getRouteOffset(),
+ RoutingData(0, aMachine, (*itPort).rawPort(),
+ ComProtocol::PROTOCOL_ENVIRONMENT_KIND) );
+ }
+ }
+ }
+
+//@debug:
+// AVM_OS_TRACE << "APRES :>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl;
+// aRouter4Model.toStream(AVM_OS_TRACE);
+// AVM_OS_TRACE << std::endl;
+ }
+ else
+ {
+ setUndefinedLocalRouteToEnv( aRouter4Model );
+ }
+}
+
+
+void CompilerOfInteraction::postCompileCommunication(
+ ExecutableForm * theExecutable)
+{
+ TableOfRouter::iterator itRouter;
+ TableOfRouter::iterator endRouter;
+
+ // UPDATE DEFAULT MODEL ROUTER TO ENVIRONMENT
+ if( theExecutable->hasRouter4Model() )
+ {
+ itRouter = theExecutable->getRouters4Model().begin();
+ endRouter = theExecutable->getRouters4Model().end();
+ for( ; itRouter != endRouter ; ++itRouter )
+ {
+ if( (*itRouter).valid() )
+ {
+ updateLocalModelUsingLocalPrototype(theExecutable, *itRouter);
+
+ updateLocalModelUsingGlobalModel( *itRouter );
+
+ updateGlobalRoute(theExecutable->getRouter4This(), *itRouter);
+ }
+ }
+
+ // UPDATE DEFAULT INSTANCE ROUTER AS MODEL'S
+ TableOfRoutingData::iterator itRdInst;
+ TableOfRoutingData::const_iterator itRdModel;
+ TableOfRoutingData::iterator endRD;
+
+ itRouter = theExecutable->getRouters4Instance().begin();
+ endRouter = theExecutable->getRouters4Instance().end();
+ for( ; itRouter != endRouter ; ++itRouter )
+ {
+ if( (*itRouter).valid() )
+ {
+ const Router & theRouter = theExecutable->
+ getRouter4Model((*itRouter).getMachine());
+
+ if( theRouter == (*itRouter) )
+ {
+ continue;
+ }
+// if( theRouter == NULL )
+// {
+// // IDENTIFICATION ROUTER(machine prototype)
+// // ==> ROUTER(machine instance)
+// theRouter = theExecutable->getRouter4Prototype(
+// (*itRouterInst)->getMachine() );
+// }
+
+ if( theRouter != NULL )
+ {
+ itRdModel = theRouter.getInputRoutingTable().begin();
+
+ itRdInst = (*itRouter).getInputRoutingTable().begin();
+ endRD = (*itRouter).getInputRoutingTable().end();
+ for( ; itRdInst != endRD ; ++itRdInst , ++itRdModel )
+ {
+ if( (*itRdInst).invalid() && (*itRdModel).valid())
+ {
+ (*itRdInst) = (*itRdModel);
+ }
+ }
+
+
+ itRdModel = theRouter.getOutputRoutingTable().begin();
+
+ itRdInst = (*itRouter).getOutputRoutingTable().begin();
+ endRD = (*itRouter).getOutputRoutingTable().end();
+ for( ; itRdInst != endRD ; ++itRdInst , ++itRdModel )
+ {
+ if( (*itRdInst).invalid() && (*itRdModel).valid())
+ {
+ (*itRdInst) = (*itRdModel);
+ }
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ itRouter = theExecutable->getRouters4Instance().begin();
+ endRouter = theExecutable->getRouters4Instance().end();
+ for( ; itRouter != endRouter ; ++itRouter )
+ {
+ if( (*itRouter).valid() )
+ {
+ setUndefinedLocalRouteToEnv( (*itRouter) );
+ }
+ }
+ }
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/builder/compiler/CompilerOfInteraction.h b/org.eclipse.efm.symbex/src/builder/compiler/CompilerOfInteraction.h
new file mode 100644
index 0000000..7bae781
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/compiler/CompilerOfInteraction.h
@@ -0,0 +1,227 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 18 sept. 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BUILDER_COMPILER_COMPILEROFINTERACTION_H_
+#define BUILDER_COMPILER_COMPILEROFINTERACTION_H_
+
+#include <builder/compiler/BaseCompiler.h>
+
+#include <collection/List.h>
+
+#include <fml/executable/Router.h>
+#include <fml/executable/RoutingData.h>
+
+#include <fml/infrastructure/PropertyPart.h>
+
+
+namespace sep
+{
+
+
+class Compiler;
+
+class Buffer;
+class ComPoint;
+class ComRoute;
+class Connector;
+class ExecutableForm;
+class InstanceOfConnect;
+class InstanceOfMachine;
+class InstanceOfPort;
+class PropertyPart;
+
+
+class CompilerOfInteraction : public BaseCompiler
+{
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ avm_size_t mNextRouteID;
+
+ avm_size_t mNextConnectID;
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ CompilerOfInteraction(Compiler & aCompiler);
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~CompilerOfInteraction()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * mNextRouteID
+ * mNextConnectID
+ */
+ void updateMessageID()
+ {
+ mNextConnectID = mNextRouteID;
+ }
+
+ /**
+ ***************************************************************************
+ * PRE-COMPILATION
+ ***************************************************************************
+ */
+ BF precompileParameter(ExecutableForm * aContainer,
+ TableOfInstanceOfData & tableOfVariable,
+ Variable * aParameter, avm_offset_t offset);
+
+ void precompileComPoint(
+ ExecutableForm * aContainer, PropertyPart & theDeclaration,
+ TableOfInstanceOfData & tableOfVariable);
+
+ void precompileComPoint(ExecutableForm * aContainer,
+ const PropertyPart::TableOfPort & listOfComPoint,
+ avm_size_t ioPortOffset, TableOfInstanceOfData & tableOfVariable);
+
+ void precompileChannel(
+ ExecutableForm * aContainer, PropertyPart & theDeclaration,
+ TableOfInstanceOfData & tableOfVariable);
+
+ void precompileBuffer(ExecutableForm * aContainer, Buffer * aBuffer);
+
+
+
+ /**
+ ***************************************************************************
+ * COMPILATION
+ ***************************************************************************
+ */
+ void compilePort(ExecutableForm * anExecutable);
+
+ void compilePort(ExecutableForm * anExecutable,
+ const InstanceOfPort & aPortInstance);
+
+
+ Router addMachineModelRouter(
+ ExecutableForm * theExecutable, InstanceOfMachine * aMachine);
+
+ Router newMachineRouter(InstanceOfMachine * aMachine);
+
+
+ void compileCommunication(ExecutableForm * theExecutable,
+ bool & hasSynchronizeMachine, bool & hasUpdateBuffer);
+
+ void compileConnector(ExecutableForm * theExecutable,
+ bool & hasSynchronizeMachine, bool & hasUpdateBuffer);
+
+ void compileConnector(ExecutableForm * theExecutable,
+ Connector * aConnector, InstanceOfConnect * ioc,
+ bool & hasSynchronizeMachine, bool & hasUpdateBuffer);
+
+ void compileRoute(ExecutableForm * theExecutable,
+ Connector * aConnector, InstanceOfConnect * ioc,
+ bool & hasSynchronizeMachine, bool & hasUpdateBuffer);
+
+
+
+ void compileConnectorBroadcast(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc);
+
+ void compileConnectorBuffer(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc);
+
+ void compileConnectorRoutingCast(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc);
+
+ void compileConnectorSynchronous(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc);
+
+ void compileConnectorFlow(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc);
+
+ void compileConnectorTransfert(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc);
+
+ void compileConnectorEnvironment(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc);
+
+
+ void compileRouteBroadcast(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc);
+
+ void compileRouteBuffer(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc);
+
+ void compileRouteRoutingCast(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc);
+
+ void compileRouteSynchronous(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc);
+
+ void compileRouteTransfert(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc);
+
+ void compileRouteEnvironment(
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc);
+
+
+
+ ExecutableForm * compileComPointMachine(
+ ExecutableForm * theExecutable, ComPoint * aComPoint,
+ bool & isInstanceStaticFlag, InstanceOfMachine * & aMachine);
+
+ bool compileComPointPort(ExecutableForm * theExecutable4Port,
+ ComPoint * aComPoint, InstanceOfPort * & aPort);
+
+ void createRoutingData(List< RoutingData > & listOfRoutingData,
+ ExecutableForm * theExecutable, InstanceOfConnect * ioc,
+ ComRoute * aComRoute, ComPoint * aComPoint);
+
+ RoutingData addRoutingData(ExecutableForm * theExecutable,
+ bool isInstanceStaticFlag, InstanceOfConnect * ioc,
+ InstanceOfMachine * theInstanceStatic,
+ InstanceOfPort * thePortInstance,
+ Modifier::DIRECTION_KIND aDirection);
+
+ RoutingData addRoutingData(Router & theRouter,
+ RoutingData & theRoutingData,
+ Modifier::DIRECTION_KIND aDirection);
+
+
+ /**
+ ***************************************************************************
+ * POST-COMPILATION
+ ***************************************************************************
+ */
+
+ void setUndefinedLocalRouteToEnv(const Router & aRouter);
+
+ void updateGlobalRoute(const Router & refRouter, const Router & newRouter);
+
+ void updateLocalModelUsingLocalPrototype(
+ ExecutableForm * theExecutable, const Router & aRouter4Model);
+
+ void updateLocalModelUsingGlobalModel(const Router & aRouter4Model);
+
+ void postCompileCommunication(ExecutableForm * theExecutable);
+
+};
+
+
+}
+
+#endif /* BUILDER_COMPILER_COMPILEROFINTERACTION_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/compiler/CompilerOfProgram.cpp b/org.eclipse.efm.symbex/src/builder/compiler/CompilerOfProgram.cpp
new file mode 100644
index 0000000..dd9bdb8
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/compiler/CompilerOfProgram.cpp
@@ -0,0 +1,177 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 29 mars 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "CompilerOfProgram.h"
+
+#include <builder/primitive/AvmcodeCompiler.h>
+#include <builder/compiler/Compiler.h>
+#include <builder/compiler/CompilerOfVariable.h>
+
+#include <fml/common/SpecifierElement.h>
+
+#include <fml/executable/AvmProgram.h>
+#include <fml/executable/ExecutableForm.h>
+
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+CompilerOfProgram::CompilerOfProgram(Compiler & aCompiler)
+: BaseCompiler(aCompiler),
+mDataCompiler( aCompiler.mDataCompiler )
+{
+ //!! NOTHING
+}
+
+
+/**
+ *******************************************************************************
+ * IMPLEMENT FORM PROGRAM
+ *******************************************************************************
+ *
+ * form
+ * section HEADER
+ * @ufi = <% UFI %> ;
+ * @name = <% String %> ;
+ * @type = <% <PROGRAM> %> ;
+ * @design = FORM ;
+ * endsection HEADER
+ *
+ * section PARAM
+ * ( @const = <% Boolean %> ; )?
+ * endsection PARAM
+ *
+ * section DATA
+ * ( data_typedef )* // MODEL of a DATA_TYPE i.e definition of new DATA_TYPE
+ * ( const_decl )* // INSTANCE of DATA_TYPE CONSTANT DEFINITION
+ * ( var_decl )* // INSTANCE of DATA_TYPE VARIABLE DECLARATION
+ * endsection DATA
+ *
+ * section MOE
+ * ( @run{ <% <AvmCode> %> } )?
+ * endsection MOE
+ * endform
+ *
+ ***************************************************************************
+ */
+
+
+
+/**
+ *******************************************************************************
+ * PRECOMPILATION
+ *******************************************************************************
+ */
+void CompilerOfProgram::precompileProgram(
+ ExecutableForm * aContainer, ObjectElement * aProgram)
+{
+// AVM_OS_TRACE << TAB << "<||||| begin precompiling simple Program:> "
+// << aProgram->getFullyQualifiedNameID() << std::endl;
+
+ // CREATE NEW EXECUTABLE
+ AvmProgram * anAvmProgram = new AvmProgram(
+ Specifier::SCOPE_PROGRAM_KIND, aContainer, aProgram, 0);
+
+ getSymbolTable().addProgram( aContainer->saveProgram( anAvmProgram ) );
+
+ TableOfInstanceOfData tableOfVariable;
+
+ /*
+ * Allocation of program PARAM variable
+ */
+// if( aMachine->hasDeclarationParam() )
+// {
+// avm_offset_t paramOffset = tableOfVariable.size();
+//
+// mDataCompiler.precompileData(anExec, aProgram->getDeclarationParam(),
+// tableOfVariable);
+//
+// anAvmProgram->setParamOffsetCount( paramOffset , tableOfVariable.size() );
+// }
+//
+// if( aMachine->hasDeclaration() )
+// {
+// PropertyPart * aDeclaration = aProgram->getDeclaration();
+//
+// /*
+// * Allocation of program DATA variable
+// */
+// mDataCompiler.precompileData(anExec, aDeclaration, tableOfVariable);
+// }
+
+
+ //////////////////////////////////////////////////////////////////////////////////////////////
+ // Update data table
+ //////////////////////////////////////////////////////////////////////////////////////////////
+ anAvmProgram->setData(tableOfVariable);
+
+// AVM_OS_TRACE << TAB << ">||||| end precompiling simple Program:> "
+// << aProgram->getFullyQualifiedNameID() << std::endl;
+}
+
+
+
+
+/**
+ *******************************************************************************
+ * COMPILATION
+ *******************************************************************************
+ */
+
+/**
+ * compile
+ * transition
+ */
+void CompilerOfProgram::compileProgram(AvmProgram * anAvmProgram)
+{
+ const ObjectElement * aCompiledProgram = anAvmProgram->getAstElement();
+
+// AVM_OS_TRACE << TAB << "<| compiling<program>: "
+// << Query::getUfi(aProgram) << std::endl;
+
+
+ // COMPILATION OF DATA
+ mDataCompiler.compileData(anAvmProgram);
+
+
+ /*
+ * onRun
+ */
+ if( aCompiledProgram->is< Routine >() )
+ {
+ anAvmProgram->setCode( mAvmcodeCompiler.compileStatement(anAvmProgram,
+ aCompiledProgram->as< Routine >()->getCode()) );
+ }
+ if( aCompiledProgram->is< Transition >() )
+ {
+ anAvmProgram->setCode( mAvmcodeCompiler.compileStatement(anAvmProgram,
+ aCompiledProgram->as< Transition >()->getStatement()) );
+ }
+
+// AVM_OS_TRACE << TAB << ">| compiling<program>: "
+// << Query::getUfi(aProgram) << std::endl << std::endl;
+}
+
+
+
+}
+
+
diff --git a/org.eclipse.efm.symbex/src/builder/compiler/CompilerOfProgram.h b/org.eclipse.efm.symbex/src/builder/compiler/CompilerOfProgram.h
new file mode 100644
index 0000000..8908b62
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/compiler/CompilerOfProgram.h
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 29 mars 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BUILDER_COMPILER_COMPILEROFPROGRAM_H_
+#define BUILDER_COMPILER_COMPILEROFPROGRAM_H_
+
+#include <builder/compiler/BaseCompiler.h>
+
+
+namespace sep
+{
+
+
+class AvmcodeCompiler;
+class CompilerOfAvmCode;
+class Compiler;
+class CompilerOfVariable;
+
+class AvmCode;
+class AvmProgram;
+class ExecutableForm;
+class ObjectElement;
+
+
+
+class CompilerOfProgram : public BaseCompiler
+{
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ CompilerOfVariable & mDataCompiler;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ CompilerOfProgram(Compiler & aCompiler);
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~CompilerOfProgram()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ ***************************************************************************
+ * PRECOMPILATION
+ ***************************************************************************
+ */
+ void precompileProgram(ExecutableForm * aContainer, ObjectElement * aProgram);
+
+
+ /**
+ ***************************************************************************
+ * COMPILATION
+ ***************************************************************************
+ */
+ void compileProgram(AvmProgram * anAvmProgram);
+
+};
+
+
+}
+
+
+
+#endif /* BUILDER_COMPILER_COMPILEROFPROGRAM_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/compiler/CompilerOfTransition.cpp b/org.eclipse.efm.symbex/src/builder/compiler/CompilerOfTransition.cpp
new file mode 100644
index 0000000..f5eb0a3
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/compiler/CompilerOfTransition.cpp
@@ -0,0 +1,1420 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 nov. 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "CompilerOfTransition.h"
+
+#include <builder/analysis/CommunicationDependency.h>
+#include <builder/primitive/AvmcodeCompiler.h>
+#include <builder/primitive/CompilationEnvironment.h>
+#include <builder/compiler/Compiler.h>
+#include <builder/compiler/CompilerOfVariable.h>
+
+#include <fml/executable/AvmLambda.h>
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/ExecutableLib.h>
+
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/ExpressionTypeChecker.h>
+#include <fml/expression/StatementConstructor.h>
+#include <fml/expression/StatementFactory.h>
+
+#include <fml/operator/Operator.h>
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/infrastructure/BehavioralPart.h>
+#include <fml/infrastructure/Transition.h>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+CompilerOfTransition::CompilerOfTransition(Compiler & aCompiler)
+: BaseCompiler(aCompiler),
+mCompiler( aCompiler ),
+mDataCompiler( aCompiler.mDataCompiler ),
+mMocStack( ),
+mCurrentMoc( NULL ),
+mDefaultMoc( TransitionMoc::MOE_RDE_RUN )
+{
+ setDefaultMoc();
+}
+
+
+
+void CompilerOfTransition::setDefaultMoc()
+{
+ mCurrentMoc = & mDefaultMoc;
+}
+
+
+void CompilerOfTransition::pushMoc(WObject * mocTransition)
+{
+ mCurrentMoc = new TransitionMoc( mocTransition );
+
+ mMocStack.push_back( mCurrentMoc );
+}
+
+void CompilerOfTransition::popMoc()
+{
+ if( mMocStack.nonempty() )
+ {
+ delete( mMocStack.pop_last() );
+ }
+
+ if( mMocStack.nonempty() )
+ {
+ mCurrentMoc = mMocStack.last();
+ }
+ else
+ {
+ mCurrentMoc = & mDefaultMoc;
+ }
+}
+
+
+/**
+ *******************************************************************************
+ * PRECOMPILATION
+ *******************************************************************************
+ */
+void CompilerOfTransition::precompileTransition(
+ ExecutableForm * aContainer, Transition * aTransition)
+{
+// AVM_OS_TRACE << TAB << "<$$$$$ precompiling transition < "
+// << aTransition->getFullyQualifiedNameID() << " >" << std::endl;
+
+ AvmTransition * anAvmTransition =
+ new AvmTransition(aContainer, aTransition, 0);
+
+ getSymbolTable().addTransition(
+ aContainer->saveTransition( anAvmTransition ) );
+
+ Machine * target = NULL;
+ if( aTransition->hasTarget() )
+ {
+ target = getTransitionTarget(aTransition, aTransition->getTarget());
+ if( target != NULL )
+ {
+ aTransition->getTarget().acquirePointer( target );
+
+ target->getUniqBehaviorPart()->
+ appendIncomingTransition( INCR_BF(aTransition) );
+ }
+ }
+
+ /*
+ * Allocation of declaration contents :>
+ * constant, variable, typedef, buffer, port
+ */
+ if( aTransition->hasDeclaration() )
+ {
+ TableOfInstanceOfData tableOfVariable;
+
+ mCompiler.precompileDataType(anAvmTransition,
+ *(aTransition->getDeclaration()), tableOfVariable);
+
+ /*
+ * Update data table
+ */
+ anAvmTransition->setData(tableOfVariable);
+ }
+
+
+
+// AVM_OS_TRACE << TAB << ">$$$$$ end precompiling transition < "
+// << aTransition->getFullyQualifiedNameID() << " >" << std::endl;
+}
+
+
+
+
+/**
+ *******************************************************************************
+ * COMPILATION
+ *******************************************************************************
+ */
+
+/**
+ * compile
+ * transition
+ */
+void CompilerOfTransition::compileTransition(AvmTransition * anAvmTransition)
+{
+ const Transition * aTransition = anAvmTransition->getAstTransition();
+
+// AVM_OS_TRACE << TAB << "<| compiling<transiton>: "
+// << TRIM(aTransition->toString(AVM_OS_TRACE.INDENT))
+// << std::endl;
+
+ const Machine * source = aTransition->getSource();
+ const Machine * target = NULL;
+
+ BF targetVariable;
+ BF targetMachine;
+
+ if( aTransition->hasTarget() )
+ {
+ BF tgt = compileTransitionTarget(anAvmTransition, aTransition->getTarget());
+
+ if( tgt.valid() )
+ {
+ anAvmTransition->setTarget( tgt );
+
+ if( tgt.is< InstanceOfMachine >() )
+ {
+ target = tgt.to_ptr< InstanceOfMachine >()->getAstMachine();
+
+ targetMachine = tgt;
+
+ if( target->getSpecifier().isPseudostateInitial() )
+ {
+ incrWarningCount();
+ aTransition->warningLocation(AVM_OS_WARN)
+ << "Unexpected the pseudo-state< initial > '"
+ << target->getFullyQualifiedNameID()
+ << "' as target of the transition : "
+ << str_header( aTransition ) << std::endl;
+ }
+ }
+ else if( tgt.is< InstanceOfData >() )
+ {
+ targetVariable = tgt;
+ }
+ }
+ }
+
+ // By default : the last active state
+ // Only for Trace usage
+ else if( not source->getSpecifier().isPseudostate() )
+ {
+ anAvmTransition->setTarget(
+ getSymbolTable().searchInstanceStatic(source) );
+
+ //???
+// aTransition->setTarget( anAvmTransition->getTarget() );
+// aTransition->setTarget( INCR_BF(source) );
+ }
+ else
+ {
+ // TODO found last stable state !!!
+ }
+
+
+ // COMPILATION OF DATA
+ mDataCompiler.compileData(anAvmTransition);
+
+ /*
+ * EVAL transition
+ */
+ BFCode OnRun(OperatorManager::OPERATOR_SEQUENCE);
+
+ // DISABLE source / ENABLE target
+ BFCode disableSource;
+ BFCode enableTarget;
+ BFCodeList ienableAtomicSequence;
+
+ // DISABLE source
+ disableSource = StatementConstructor::newCode(
+ aTransition->hasMocAbort() ?
+ OperatorManager::OPERATOR_ABORT_INVOKE :
+ OperatorManager::OPERATOR_DISABLE_INVOKE);
+
+ if( targetMachine.valid() )
+ {
+ enableTarget = BFCode( OperatorManager::OPERATOR_ENABLE_INVOKE,
+ targetMachine);
+
+ if( target->getSpecifier().hasPseudostateHistory() )
+ {
+ //!! moe< statemachine > :> don't invoke ENABLE_SET
+ }
+ else if( target->getSpecifier().hasFamilyPseudostateEnding() )
+ {
+ enableTarget = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_SEQUENCE,
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ENABLE_SET, targetMachine),
+ enableTarget);
+ }
+ else if( target->getSpecifier().isPseudostate() )
+ {
+ //!! moe< statemachine > :> no need to invoke ENABLE_SET
+ }
+ // TRANSITION INSTABLE
+ else if( aTransition->getModifier().hasFeatureTransient() )
+ {
+ enableTarget = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_IENABLE_INVOKE,
+ targetMachine),
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_RUN, targetMachine) );
+ }
+ else if( COMPILE_CONTEXT::INLINE_ENABLE_MASK )
+ {
+ enableTarget = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_SEQUENCE,
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ENABLE_SET, targetMachine),
+ enableTarget);
+ }
+ else
+ {
+ enableTarget = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ENABLE_SET, targetMachine),
+ enableTarget);
+ }
+
+ if( source == target )
+ {
+ if( source->getSpecifier().isPseudostateInitial() )
+ {
+ incrErrorCount();
+ AVM_OS_WARN << source->errorLocation(aTransition)
+ << "Unexpected transition loop in initial state << "
+ << str_header( source ) << " >> !!!" << std::endl;
+ }
+ else if( source->getSpecifier().isPseudostate() )
+ {
+ incrWarningCount();
+ AVM_OS_WARN << source->warningLocation(aTransition)
+ << "Transition loop in (unstable) pseudo state << "
+ << str_header( source ) << " >> !!!" << std::endl;
+ }
+
+ //!! NOTHING
+ // BETWEEN DISABLE/ABORT SOURCE
+ // ==> ENABLE TARGET
+ }
+
+ else if( source->getContainerMachine() == target->getContainerMachine() )
+ {
+ //!! NOTHING
+ // BETWEEN DISABLE/ABORT SOURCE
+ // ==> ENABLE TARGET
+ }
+
+ else if( source == target->getContainerMachine() )
+ {
+ // IDISABLE/IABORT SOURCE
+ // ==> IENABLE & ENABLE TARGET
+ disableSource = StatementConstructor::newCode(
+ aTransition->hasMocAbort() ?
+ OperatorManager::OPERATOR_IABORT_INVOKE :
+ OperatorManager::OPERATOR_IDISABLE_INVOKE);
+
+ disableSource = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+ StatementConstructor::newCode(
+ aTransition->hasMocAbort() ?
+ OperatorManager::OPERATOR_ABORT_CHILD :
+ OperatorManager::OPERATOR_DISABLE_CHILD),
+ disableSource);
+
+ ienableAtomicSequence.push_front(
+ BFCode(OperatorManager::OPERATOR_IENABLE_INVOKE) );
+// ExecutableLib::MACHINE_SELF) );
+ }
+
+ else if( source->getContainerMachine() == target )
+ {
+ // DISABLE/ABORT SOURCE & IDISABLE/IABORT CONTAINER
+ // ==> IENABLE & ENABLE TARGET
+ disableSource = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+ disableSource,
+ StatementConstructor::newCode(
+ aTransition->hasMocAbort() ?
+ OperatorManager::OPERATOR_IABORT_INVOKE :
+ OperatorManager::OPERATOR_IDISABLE_INVOKE) );
+
+ enableTarget = BFCode(
+ aTransition->getModifier().hasFeatureTransient()
+ ? OperatorManager::OPERATOR_RETURN
+ : OperatorManager::OPERATOR_ENABLE_INVOKE );
+ }
+
+ else
+ {
+ const Machine * lcaMachine = source->LCA(
+ ( target->getSpecifier().hasPseudostateHistory()
+ || target->getSpecifier().isPseudostateInitial() ) ?
+ target->getContainerMachine() : target );
+
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( lcaMachine ) "LCA( "
+ << source->getFullyQualifiedNameID() << " , "
+ << target->getFullyQualifiedNameID() << " ) !!!"
+ << SEND_EXIT;
+
+ if( source != lcaMachine )
+ {
+ const Machine * containerOfSource = source->getContainerMachine();
+ if( containerOfSource != lcaMachine )
+ {
+ avm_uinteger_t disableLevel = 1;
+
+ for( ; containerOfSource != lcaMachine ; ++disableLevel )
+ {
+ containerOfSource =
+ containerOfSource->getContainerMachine();
+ }
+
+ disableSource = StatementConstructor::newCode(
+ aTransition->hasMocAbort()
+ ? OperatorManager::OPERATOR_ABORT_SELVES
+ : OperatorManager::OPERATOR_DISABLE_SELVES,
+ ExpressionConstructor::newUInteger(disableLevel) );
+
+ if( source->hasMachine() )
+ {
+ disableSource = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+ StatementConstructor::newCode(
+ aTransition->hasMocAbort() ?
+ OperatorManager::OPERATOR_ABORT_CHILD :
+ OperatorManager::OPERATOR_DISABLE_CHILD),
+ disableSource);
+ }
+ }
+ }
+
+ if( target->getContainerMachine() != lcaMachine )
+ {
+ const Machine * containerOfTarget = target->getContainerMachine();
+ for( ; containerOfTarget != lcaMachine ;
+ containerOfTarget = containerOfTarget->getContainerMachine() )
+ {
+ if( (targetMachine = getSymbolTable().searchInstanceStatic(
+ containerOfTarget)).valid() )
+ {
+ ienableAtomicSequence.push_front(
+ BFCode(OperatorManager::OPERATOR_IENABLE_INVOKE,
+ targetMachine) );
+// ExecutableLib::MACHINE_SELF) );
+
+ ienableAtomicSequence.push_front(
+ BFCode(OperatorManager::OPERATOR_ENABLE_SET,
+ targetMachine) );
+ }
+ else
+ {
+ incrErrorCount();
+ aTransition->errorLocation(AVM_OS_WARN)
+ << "Unfound transition target container"
+ " state instance < "
+ << str_header( containerOfTarget )
+ << " > where LCA is < "
+ << str_header( lcaMachine )<< " >"
+ << std::endl
+ << aTransition->toString(AVM_TAB1_INDENT)
+ << std::endl;
+ }
+ }
+ }
+ }
+ }
+ else if( targetVariable.valid() )
+ {
+ enableTarget = BFCode( OperatorManager::OPERATOR_ENABLE_INVOKE,
+ targetVariable);
+
+ enableTarget = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ENABLE_SET, targetVariable),
+ enableTarget);
+ }
+
+
+ if( aTransition->hasStatement() )
+ {
+ // Attention: création possible de variable local dans le conteneur,
+ // i.e. l'état source de la transition
+ OnRun->appendFlat( aTransition->getStatement() );
+ }
+
+ /*
+ * DISABLE source / ENABLE target
+ */
+ if( disableSource.valid() && enableTarget.valid() &&
+ (! aTransition->isMocInternal()) )
+ {
+ switch( mCurrentMoc->getMoeRun() )
+ {
+ case TransitionMoc::MOE_RDE_RUN:
+ {
+// OnRun->push_back( disableSource );
+// OnRun->push_back( ienableAtomicSequence );
+// OnRun->push_back( enableTarget );
+
+ if( ienableAtomicSequence.nonempty() )
+ {
+ BFCode disableEnableAtomicSequence(
+ StatementConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ disableSource) );
+ disableEnableAtomicSequence->push_back(ienableAtomicSequence);
+ disableEnableAtomicSequence->push_back(enableTarget);
+
+ OnRun->push_back( disableEnableAtomicSequence );
+ }
+ else
+ {
+ OnRun->push_back( StatementConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ disableSource, enableTarget ) );
+ }
+ break;
+ }
+
+ case TransitionMoc::MOE_DRE_RUN:
+ {
+ OnRun->push_front( disableSource );
+
+ if( ienableAtomicSequence.nonempty() )
+ {
+ BFCode ienableEnableAtomicSequence(
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_SEQUENCE,
+ ienableAtomicSequence) );
+ ienableEnableAtomicSequence->push_back( enableTarget );
+
+ OnRun->push_back( ienableEnableAtomicSequence );
+ }
+ else
+ {
+ OnRun->push_back( enableTarget );
+ }
+ break;
+ }
+
+ case TransitionMoc::MOE_DER_RUN:
+ {
+// OnRun->push_front( enableTarget );
+// OnRun->push_front( ienableAtomicSequence );
+// OnRun->push_front( disableSource );
+
+ if( ienableAtomicSequence.nonempty() )
+ {
+ BFCode disableEnableAtomicSequence(
+ StatementConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ disableSource) );
+ disableEnableAtomicSequence->push_back( ienableAtomicSequence );
+ disableEnableAtomicSequence->push_back( enableTarget );
+
+ OnRun->push_front( disableEnableAtomicSequence );
+ }
+ else
+ {
+ OnRun->push_front( StatementConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ disableSource, enableTarget ) );
+ }
+ break;
+ }
+
+ case TransitionMoc::MOE_UNDEFINED_RUN:
+ default:
+ {
+ //!!! NOTHING
+ break;
+ }
+ }
+ }
+
+ if( OnRun->nonempty() )
+ {
+ anAvmTransition->setCode( mAvmcodeCompiler.
+ compileStatement(anAvmTransition, OnRun) );
+
+ if( aTransition->hasStatement() )
+ {
+ // Attention: création possible de variable local dans le conteneur,
+ // i.e. l'état source de la transition
+ BFCode aCompiledCode = anAvmTransition->getCode();
+
+
+ // the communication information
+ bool hasMutableSchedule = false;
+
+ anAvmTransition->setCommunicationCode(
+ CommunicationDependency::getCommunicationCode(
+ anAvmTransition, aCompiledCode, hasMutableSchedule) );
+
+ anAvmTransition->setMutableCommunication( hasMutableSchedule );
+
+
+ anAvmTransition->setInternalCommunicationCode(
+ CommunicationDependency::getInternalCommunicationCode(
+ anAvmTransition, aCompiledCode, hasMutableSchedule) );
+
+//??!!??
+// if( anAvmTransition->getExecutableContainer()->
+// getSpecifier().hasFeatureInputEnabled() )
+ {
+ CommunicationDependency::computeInputEnabledCom(
+ anAvmTransition, aCompiledCode );
+
+ CommunicationDependency::computeInputEnabledSave(
+ anAvmTransition, aCompiledCode );
+
+
+ CommunicationDependency::computeInputCom(
+ anAvmTransition, aCompiledCode);
+
+ CommunicationDependency::computeOutputCom(
+ anAvmTransition, aCompiledCode);
+
+
+ anAvmTransition->setEnvironmentCom(
+ CommunicationDependency::getEnvironmentCom(
+ anAvmTransition, aCompiledCode, hasMutableSchedule) );
+
+ anAvmTransition->setEnvironmentInputCom(
+ CommunicationDependency::getEnvironmentInputCom(
+ anAvmTransition, aCompiledCode, hasMutableSchedule) );
+
+ anAvmTransition->setEnvironmentOutputCom(
+ CommunicationDependency::getEnvironmentOutputCom(
+ anAvmTransition, aCompiledCode, hasMutableSchedule) );
+
+// AVM_OS_COUT << "compileTransition:> "
+// << str_header( anAvmTransition ) << std::endl;
+// anAvmTransition->toStreamStaticCom(AVM_OS_COUT);
+ }
+ }
+ }
+ else
+ {
+ if( OperatorManager::isSchedule(OnRun->getOperator()) )
+ {
+ OnRun = StatementConstructor::nopCode();
+ }
+ anAvmTransition->setCode( OnRun );
+ }
+
+// AVM_OS_TRACE << TAB << ">| compiling<transiton>: "
+// << aTransition->getFullyQualifiedNameID() << std::endl;
+}
+
+
+
+/*
+ * GETTER
+ * for transition
+ */
+Machine * CompilerOfTransition::getTransitionTarget(
+ Transition * aTransition, const BF & smTarget)
+{
+ if( smTarget.is< Machine >() )
+ {
+ return( smTarget.to_ptr< Machine >() );
+ }
+ else if( smTarget.is< Variable >() )
+ {
+ return( NULL );
+ }
+ else
+ {
+ Machine * tgtMachine = NULL;
+
+ Machine * srcMachine = aTransition->getContainer()->as< Machine >();
+ if( srcMachine->getNameID() == smTarget.str() )
+ {
+ return( srcMachine );
+ }
+
+ Machine * containerMachine = srcMachine;
+ while( containerMachine->hasContainer() &&
+ containerMachine->getContainer()->is< Machine >() )
+ {
+ tgtMachine = containerMachine;
+ containerMachine = containerMachine->getContainer()->as< Machine >();
+
+ tgtMachine = containerMachine->getrecMachine(smTarget.str(), tgtMachine);
+ if( tgtMachine != NULL )
+ {
+ if( tgtMachine->hasContainer()
+ && tgtMachine->getContainer()->is< Machine >()
+ && tgtMachine->getContainer()->to< Machine >()->
+ getSpecifier().isMocStateTransitionStructure() )
+ {
+ return( tgtMachine );
+ }
+ else
+ {
+ incrErrorCount();
+ aTransition->errorLocation(AVM_OS_WARN)
+ << "Unexpected transition target without "
+ "a STATEMACHINE< or > container :> "
+ << std::endl
+ << TAB << "target state:> " << str_header( tgtMachine )
+ << std::endl
+ << TAB << "target super:> " << str_header(
+ tgtMachine->getContainer()->to< Machine >() )
+ << std::endl
+ << aTransition->toString(AVM_TAB1_INDENT)
+ << std::endl;
+
+ return( tgtMachine );
+ }
+ }
+ }
+
+ if( srcMachine->hasMachine() )
+ {
+ Machine * tgtMachine =
+ srcMachine->getrecMachine(smTarget.str(), NULL);
+ if( tgtMachine != NULL )
+ {
+ if( tgtMachine->hasContainer()
+ && tgtMachine->getContainer()->is< Machine >()
+ && tgtMachine->getContainer()->to< Machine >()->
+ getSpecifier().isMocStateTransitionStructure() )
+ {
+ incrWarningCount();
+ aTransition->warningLocation(AVM_OS_WARN)
+ << "The transition target is a sub-state"
+ " of the transition source "
+ << std::endl
+ << TAB << str_header(
+ tgtMachine->getContainer()->to< Machine >() )
+ << " --> " << str_header( tgtMachine )
+ << std::endl
+ << aTransition->toString(AVM_TAB1_INDENT)
+ << std::endl;
+ }
+ else
+ {
+ incrErrorCount();
+ aTransition->errorLocation(AVM_OS_WARN)
+ << "Unexpected transition target without "
+ "a STATEMACHINE< or > container :> "
+ << std::endl
+ << TAB << "target state:> "
+ << str_header( tgtMachine )
+ << std::endl
+ << TAB << "target super:> " << str_header(
+ tgtMachine->getContainer()->to< Machine >() )
+ << std::endl
+ << aTransition->toString(AVM_TAB1_INDENT)
+ << std::endl;
+ }
+
+ return( tgtMachine );
+ }
+ }
+
+ incrErrorCount();
+ aTransition->errorLocation(AVM_OS_WARN)
+ << "Unfound the transition target :> " << smTarget.str()
+ << std::endl
+ << aTransition->toString(AVM_TAB1_INDENT)
+ << std::endl;
+
+ return( NULL );
+ }
+}
+
+
+BF CompilerOfTransition::compileTransitionTarget(
+ AvmTransition * anAvmTransition, const BF & smTarget)
+{
+ if( smTarget.is< Variable >() )
+ {
+ CompilationEnvironment compilENV(anAvmTransition);
+
+ return( getSymbolTable().searchDataInstance(
+ compilENV.mCTX, smTarget.to_ptr< Variable >()) );
+
+// if( not ExpressionTypeChecker::isTyped(TypeManager::MACHINE, smTarget) )
+// {
+// incrErrorCount();
+// anAvmTransition->getAstElement()->errorLocation(AVM_OS_WARN)
+// << "Unexpected the transition variable target type :> "
+// << str_header( smTarget.to_ptr< Variable >() ) << std::endl;
+// }
+ }
+
+ if( smTarget.is< Machine >() )
+ {
+ return( getSymbolTable().
+ searchInstanceStatic(smTarget.to_ptr< Machine >()) );
+ }
+ else
+ {
+ BFList foundTarget;
+ getSymbolTable().searchMachineInstanceByQualifiedNameID(
+ smTarget.str(), foundTarget);
+ if( foundTarget.singleton() )
+ {
+ return( foundTarget.pop_first() );
+ }
+ else if( foundTarget.populated() )
+ {
+ incrErrorCount();
+ AVM_OS_WARN << "Indeterminism:> found many target state < "
+ << smTarget.str() << " > from program < "
+ << str_header( anAvmTransition ) << " > !!!";
+ while( foundTarget.nonempty() )
+ {
+ AVM_OS_WARN << "\n\tFound :> " << str_header(
+ foundTarget.pop_first().to_ptr< InstanceOfMachine >() );
+ }
+
+ return( foundTarget.pop_first() );
+ }
+ else
+ {
+ incrErrorCount();
+ AVM_OS_WARN << "Unfound target state < "
+ << smTarget.str() << " > from program < "
+ << str_header( anAvmTransition ) << " > !!!";
+ while( foundTarget.nonempty() )
+ {
+ AVM_OS_WARN << "\n\tFound :> " << str_header(
+ foundTarget.pop_first().to_ptr< InstanceOfMachine >() );
+ }
+
+ return( BF::REF_NULL );
+ }
+ }
+}
+
+
+
+/**
+ * compile
+ * list of transition
+ */
+BFCode CompilerOfTransition::scheduleListOfTransition(
+ ExecutableForm * anExecutableForm, BFList & listOfTransition)
+{
+ if( listOfTransition.populated() )
+ {
+ ListOfBFList schedList;
+ ListOfInt priorList;
+ int priority = 0;
+
+ BFList * tmpList = new BFList();
+ schedList.append( tmpList );
+ priorList.append( priority );
+
+ ListOfBFList::iterator itSched;
+ ListOfBFList::iterator endSched;
+ ListOfInt::iterator itPrior;
+
+ // TRI
+ BFList::iterator it = listOfTransition.begin();
+ for( ; it != listOfTransition.end() ; ++it )
+ {
+ priority = (*it).to_ptr< AvmTransition >()->
+ getAstTransition()->getPriority();
+
+ itSched = schedList.begin();
+ endSched = schedList.end();
+ itPrior = priorList.begin();
+ for( ; itSched != endSched ; ++itSched , ++itPrior )
+ {
+ if( (*itPrior) == priority )
+ {
+ (*itSched)->append( (*it) );
+
+ break;
+ }
+
+ else if( (mCurrentMoc->isUserPriorityMinFirst() &&
+ ((*itPrior) > priority)) ||
+ ((! mCurrentMoc->isUserPriorityMinFirst()) &&
+ ((*itPrior) < priority)) )
+ {
+ tmpList = new BFList();
+ tmpList->append( (*it) );
+
+ schedList.insert( itSched , tmpList );
+ priorList.insert( itPrior , priority );
+
+ break;
+ }
+ }
+
+ if( itSched == endSched )
+ {
+ tmpList = new BFList();
+ tmpList->append( (*it) );
+
+ schedList.append( tmpList );
+ priorList.append( priority );
+ }
+ }
+
+
+ // SCHEDULE
+ if( schedList.populated() )
+ {
+ BFCode aCode(OperatorManager::OPERATOR_PRIOR_GT);
+
+ endSched = schedList.end();
+ for( itSched = schedList.begin() ; itSched != endSched ; ++itSched )
+ {
+ if( (*itSched)->populated() )
+ {
+ BFCode tmpCode( OperatorManager::OPERATOR_NONDETERMINISM );
+
+ BFList::iterator it = (*itSched)->begin();
+ for( ; it != (*itSched)->end() ; ++it )
+ {
+ tmpCode->append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_INVOKE_TRANSITION,
+ (*it)) );
+ }
+
+ aCode->append( tmpCode );
+ }
+ else if( (*itSched)->nonempty() )
+ {
+ aCode->append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_INVOKE_TRANSITION,
+ (*itSched)->last()) );
+ }
+
+ delete( (*itSched) );
+ }
+
+ return( aCode );
+ }
+
+ else
+ {
+ BFCode aTrans;
+
+ if( schedList.last()->populated() )
+ {
+ BFCode tmpCode( OperatorManager::OPERATOR_NONDETERMINISM );
+
+ BFList::iterator it = schedList.last()->begin();
+ for( ; it != schedList.last()->end() ; ++it )
+ {
+ tmpCode->append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_INVOKE_TRANSITION, (*it)) );
+ }
+
+ aTrans = tmpCode;
+ }
+ else if( schedList.last()->nonempty() )
+ {
+ aTrans = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_INVOKE_TRANSITION,
+ schedList.last()->last());
+ }
+
+ delete( schedList.last() );
+
+ return( aTrans );
+ }
+ }
+
+ else if( listOfTransition.nonempty() )
+ {
+ return( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_INVOKE_TRANSITION,
+ listOfTransition.first()) );
+ }
+
+ return( BFCode::REF_NULL );
+}
+
+
+
+
+void CompilerOfTransition::compileStatemachineTransition(
+ ExecutableForm * anExecutableForm, const BFCode & runRoutine)
+{
+ const Machine * aStatemachine = anExecutableForm->getAstMachine();
+
+// AVM_OS_TRACE << TAB << "<| compiling<transition> of "
+// << str_header( aStatemachine ) << std::endl;
+
+ bool hasTransition = aStatemachine->hasOutgoingTransition();
+
+ /*
+ * Compiling transition
+ */
+ BFList listOfSimpleTransition;
+ BFList listOfSimpleElseTransition;
+
+ BFList listOfAbortTransition;
+ BFList listOfAbortElseTransition;
+
+
+ BFList listOfFinalTransition;
+ BFList listOfFinalElseTransition;
+
+ BFList listOfInternalTransition;
+ BFList listOfInternalElseTransition;
+
+ BFList listOfAutoTransition;
+ BFList listOfAutoElseTransition;
+
+ if( hasTransition )
+ {
+ ListOfAvmTransition usedTransition;
+
+ if( runRoutine.valid() )
+ {
+ StatementFactory::collectInvokeTransition(
+ anExecutableForm, runRoutine, usedTransition);
+ }
+
+ BehavioralPart::const_transition_iterator it =
+ aStatemachine->getBehavior()->outgoing_transition_begin();
+ BehavioralPart::const_transition_iterator endIt =
+ aStatemachine->getBehavior()->outgoing_transition_end();
+ for( ; it != endIt ; ++it )
+ {
+ const BF & compiledTransition =
+ anExecutableForm->getTransitionByAstElement(it);
+
+ if( usedTransition.nonempty() && usedTransition.contains(
+ compiledTransition.to_ptr< AvmTransition >()) )
+ {
+ continue;
+ }
+
+ switch( (it)->getMocKind() )
+ {
+ case Transition::MOC_SIMPLE_KIND:
+ {
+ listOfSimpleTransition.append(compiledTransition);
+ break;
+ }
+ case Transition::MOC_ELSE_KIND:
+ case Transition::MOC_SIMPLE_ELSE_KIND:
+ {
+ listOfSimpleElseTransition.append(compiledTransition);
+ break;
+ }
+
+ case Transition::MOC_ABORT_KIND:
+ {
+ listOfAbortTransition.append(compiledTransition);
+ break;
+ }
+ case Transition::MOC_ABORT_ELSE_KIND:
+ {
+ listOfAbortElseTransition.append(compiledTransition);
+ break;
+ }
+
+ case Transition::MOC_FINAL_KIND:
+ {
+ listOfFinalTransition.append(compiledTransition);
+ break;
+ }
+ case Transition::MOC_FINAL_ELSE_KIND:
+ {
+ listOfFinalElseTransition.append(compiledTransition);
+ break;
+ }
+
+ case Transition::MOC_INTERNAL_KIND:
+ {
+ listOfInternalTransition.append(compiledTransition);
+ break;
+ }
+ case Transition::MOC_INTERNAL_ELSE_KIND:
+ {
+ listOfInternalElseTransition.append(compiledTransition);
+ break;
+ }
+
+ case Transition::MOC_AUTO_KIND:
+ {
+ listOfAutoTransition.append(compiledTransition);
+ break;
+ }
+ case Transition::MOC_AUTO_ELSE_KIND:
+ {
+ listOfAutoElseTransition.append(compiledTransition);
+ break;
+ }
+
+ case Transition::MOC_UNDEFINED_KIND:
+ default:
+ {
+ incrErrorCount();
+ (it)->warningLocation(AVM_OS_WARN)
+ << "Unexpected transition kind:> "
+ << std::endl << (*it) << std::flush;
+
+ break;
+ }
+ }
+ }
+ }
+
+
+ /*
+ * OnRun
+ * whith high priority order
+ *
+ * StrongAbort Transition
+ * ActivityDo
+ * ( Simple Transition or submachine ) depend on MOC
+ * WeakAbort Transition
+ * NormalTerminaison Transition
+ */
+
+ AvmCode::this_container_type listOfOrderArg;
+
+ if( hasTransition && runRoutine.valid() )
+ {
+ if( aStatemachine->hasModelOfComputation() )
+ {
+
+ }
+
+ // Abort Transition
+ if( listOfAbortTransition.nonempty() )
+ {
+ listOfOrderArg.append( scheduleListOfTransition(
+ anExecutableForm, listOfAbortTransition) );
+ }
+ // Else Transition< abort >
+ if( listOfAbortElseTransition.nonempty() )
+ {
+ listOfOrderArg.append( scheduleListOfTransition(
+ anExecutableForm, listOfAbortElseTransition) );
+ }
+
+ /*
+ * EVAL
+ * ( Simple Transition or submachine ) depend on MOC
+ */
+ if( listOfSimpleTransition.nonempty() && runRoutine.valid() )
+ {
+ Operator * op = OperatorManager::OPERATOR_PRIOR_GT;
+ if( (mCurrentMoc->isLcaEnabled() &&
+ mCurrentMoc->isLcaMinFirst()) ||
+ (mCurrentMoc->isSourceEnabled() &&
+ mCurrentMoc->isSourceMinFirst()) )
+ {
+ listOfOrderArg.append( StatementConstructor::xnewCodeFlat(op,
+ runRoutine,
+ scheduleListOfTransition(
+ anExecutableForm, listOfSimpleTransition)) );
+ }
+ else if( (mCurrentMoc->isLcaEnabled() &&
+ (! mCurrentMoc->isLcaMinFirst())) ||
+ (mCurrentMoc->isSourceEnabled() &&
+ (! mCurrentMoc->isSourceMinFirst())) )
+ {
+ listOfOrderArg.append( StatementConstructor::xnewCodeFlat(op,
+ scheduleListOfTransition(
+ anExecutableForm, listOfSimpleTransition),
+ runRoutine) );
+ }
+ else
+ {
+ op = OperatorManager::OPERATOR_NONDETERMINISM;
+ listOfOrderArg.append( StatementConstructor::xnewCodeFlat(op,
+ runRoutine,
+ scheduleListOfTransition(
+ anExecutableForm, listOfSimpleTransition)) );
+ }
+ }
+ else if( listOfSimpleTransition.nonempty() )
+ {
+ listOfOrderArg.append( scheduleListOfTransition(
+ anExecutableForm, listOfSimpleTransition) );
+ }
+ else if( runRoutine.valid() )
+ {
+ listOfOrderArg.append( runRoutine );
+ }
+
+ // Else Transition< simple >
+ if( listOfSimpleElseTransition.nonempty() )
+ {
+ listOfOrderArg.append( scheduleListOfTransition(
+ anExecutableForm, listOfSimpleElseTransition) );
+ }
+
+ // Final Transition
+
+ // Auto Transition
+ if( listOfAutoTransition.nonempty() )
+ {
+ listOfOrderArg.append( scheduleListOfTransition(
+ anExecutableForm, listOfAutoTransition) );
+ }
+ // Else Transition< auto >
+ if( listOfAutoElseTransition.nonempty() )
+ {
+ listOfOrderArg.append( scheduleListOfTransition(
+ anExecutableForm, listOfAutoElseTransition) );
+ }
+
+ // Internal Transition
+ if( listOfInternalTransition.nonempty() )
+ {
+ listOfOrderArg.append( scheduleListOfTransition(
+ anExecutableForm, listOfInternalTransition) );
+ }
+ // Else Transition< simple >
+ if( listOfInternalElseTransition.nonempty() )
+ {
+ listOfOrderArg.append( scheduleListOfTransition(
+ anExecutableForm, listOfInternalElseTransition) );
+ }
+ }
+ else if( hasTransition )
+ {
+ /*
+ * OnRun
+ * StrongAbort Transition >
+ * ActivityDo >
+ * Simple Transition >
+ * WeakAbort Transition >
+ * NormalTerminaison Transition
+ */
+
+ // Abort Transition
+ if( listOfAbortTransition.nonempty() )
+ {
+ listOfOrderArg.append( scheduleListOfTransition(anExecutableForm,
+ listOfAbortTransition) );
+ }
+ // Else Transition< abort >
+ if( listOfAbortElseTransition.nonempty() )
+ {
+ listOfOrderArg.append( scheduleListOfTransition(
+ anExecutableForm, listOfAbortElseTransition) );
+ }
+
+
+ // Simple Transition
+ if( listOfSimpleTransition.nonempty() )
+ {
+ listOfOrderArg.append( scheduleListOfTransition(anExecutableForm,
+ listOfSimpleTransition) );
+ }
+
+ // Else Transition< simple >
+ if( listOfSimpleElseTransition.nonempty() )
+ {
+ listOfOrderArg.append( scheduleListOfTransition(anExecutableForm,
+ listOfSimpleElseTransition) );
+ }
+
+ // Final Transition
+ }
+ else if( runRoutine.valid() )
+ {
+ listOfOrderArg.append( runRoutine );
+ }
+
+
+ /*
+ * Assemble OnRun code
+ */
+ if( listOfOrderArg.populated() )
+ {
+ BFCode aCode = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_PRIOR_GT, listOfOrderArg);
+
+ anExecutableForm->setOnRun( aCode );
+ }
+ else if( listOfOrderArg.nonempty() )
+ {
+ if( listOfOrderArg.first().is< AvmCode >() )
+ {
+ anExecutableForm->setOnRun( listOfOrderArg.first().bfCode() );
+ }
+ else
+ {
+ anExecutableForm->setOnRun( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_INVOKE_TRANSITION,
+ listOfOrderArg.first()) );
+ }
+ }
+
+
+ // Final Transition
+ if( listOfFinalTransition.nonempty() )
+ {
+ anExecutableForm->setOnFinal( StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ anExecutableForm->getOnFinal(),
+ scheduleListOfTransition(anExecutableForm,
+ listOfFinalTransition) ) );
+ }
+ // Else Transition< final >
+ if( listOfFinalElseTransition.nonempty() )
+ {
+ anExecutableForm->setOnFinal( StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ anExecutableForm->getOnFinal(),
+ scheduleListOfTransition(anExecutableForm,
+ listOfFinalElseTransition) ) );
+ }
+
+// AVM_OS_TRACE << TAB << ">| compiling<transition> of "
+// << str_header( aStatemachine ) << std::endl;
+}
+
+
+
+void CompilerOfTransition::compileStateForkOutputTransition(
+ ExecutableForm * anExecutableForm, const BFCode & runRoutine)
+{
+ const Machine * aStatemachine = anExecutableForm->getAstMachine();
+
+// AVM_OS_TRACE << TAB << "<| compiling<transition> of "
+// << str_header( aStatemachine ) << std::endl;
+
+ /*
+ * Schedule transition
+ */
+ BFCode forkCode(OperatorManager::OPERATOR_FORK);
+
+ BehavioralPart::const_transition_iterator it =
+ aStatemachine->getBehavior()->outgoing_transition_begin();
+ BehavioralPart::const_transition_iterator endIt =
+ aStatemachine->getBehavior()->outgoing_transition_end();
+ for( ; it != endIt ; ++it )
+ {
+ switch( (it)->getMocKind() )
+ {
+ case Transition::MOC_SIMPLE_KIND:
+ {
+ forkCode->append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_INVOKE_TRANSITION,
+ anExecutableForm->getTransitionByAstElement(it)) );
+ break;
+ }
+
+ case Transition::MOC_ABORT_KIND:
+ case Transition::MOC_ELSE_KIND:
+ case Transition::MOC_FINAL_KIND:
+ case Transition::MOC_INTERNAL_KIND:
+ case Transition::MOC_AUTO_KIND:
+ case Transition::MOC_UNDEFINED_KIND:
+ default:
+ {
+ incrErrorCount();
+ (it)->warningLocation(AVM_OS_WARN)
+ << "Unexpected outgoing transition kind:> "
+ << (*it) << "for the pseudostate< fork > << "
+ << str_header( aStatemachine ) << std::endl;
+ break;
+ }
+ }
+ }
+
+ anExecutableForm->setOnRun( StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE, runRoutine, forkCode) );
+
+// AVM_OS_TRACE << TAB << ">| compiling<transition> of "
+// << str_header( aStatemachine ) << std::endl;
+}
+
+
+
+void CompilerOfTransition::compileStateJoinInputTransition(
+ ExecutableForm * anExecutableForm)
+{
+ const Machine * aStatemachine = anExecutableForm->getAstMachine();
+
+// AVM_OS_TRACE << TAB << "<| compiling<transition> of "
+// << str_header( aStatemachine ) << std::endl;
+
+ /*
+ * Schedule transition
+ */
+ BFCode syncCode(OperatorManager::OPERATOR_STRONG_SYNCHRONOUS);
+
+ CompilationEnvironment compilENV(anExecutableForm);
+
+ BehavioralPart::const_transition_iterator it =
+ aStatemachine->getBehavior()->incoming_transition_begin();
+ BehavioralPart::const_transition_iterator endIt =
+ aStatemachine->getBehavior()->incoming_transition_end();
+ for( ; it != endIt ; ++it )
+ {
+ switch( (it)->getMocKind() )
+ {
+ case Transition::MOC_SIMPLE_KIND:
+ {
+ const BF & aTransition =
+ getSymbolTable().searchTransition(compilENV.mCTX, (it));
+ if( aTransition.valid() )
+ {
+ syncCode->append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_INVOKE_TRANSITION, aTransition) );
+ }
+ else
+ {
+ incrErrorCount();
+ (it)->warningLocation(AVM_OS_WARN)
+ << "compileStateJoinInputTransition:> "
+ "Unfound incoming transition :"
+ << std::endl << (*it) << std::flush;
+ }
+
+ break;
+ }
+
+ case Transition::MOC_ABORT_KIND:
+ case Transition::MOC_ELSE_KIND:
+ case Transition::MOC_FINAL_KIND:
+ case Transition::MOC_INTERNAL_KIND:
+ case Transition::MOC_AUTO_KIND:
+ case Transition::MOC_UNDEFINED_KIND:
+ default:
+ {
+ incrErrorCount();
+ (it)->warningLocation(AVM_OS_WARN)
+ << "Unexpected outgoing transition kind:> "
+ << std::endl << (*it) << std::flush
+ << "for the pseudostate< fork > << "
+ << str_header( aStatemachine ) << std::endl;
+ break;
+ }
+ }
+ }
+
+ anExecutableForm->setOnEnable( StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_JOIN, syncCode),
+ anExecutableForm->getOnEnable()) );
+
+// AVM_OS_TRACE << TAB << ">| compiling<transition> of "
+// << str_header( aStatemachine ) << std::endl;
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/builder/compiler/CompilerOfTransition.h b/org.eclipse.efm.symbex/src/builder/compiler/CompilerOfTransition.h
new file mode 100644
index 0000000..b00b1b3
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/compiler/CompilerOfTransition.h
@@ -0,0 +1,128 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 nov. 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BUILDER_COMPILER_COMPILEROFTRANSITION_H_
+#define BUILDER_COMPILER_COMPILEROFTRANSITION_H_
+
+#include <builder/compiler/BaseCompiler.h>
+
+#include <collection/Typedef.h>
+
+#include <fml/executable/AvmTransition.h>
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/infrastructure/TransitionMoc.h>
+
+
+
+namespace sep
+{
+
+
+class AvmcodeCompiler;
+class CompilerOfAvmCode;
+class Compiler;
+class CompilerOfVariable;
+
+class AvmCode;
+class AvmTransition;
+class ExecutableForm;
+class Machine;
+class Transition;
+class WObject;
+
+
+class CompilerOfTransition : public BaseCompiler
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ CompilerOfTransition(Compiler & aCompiler);
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~CompilerOfTransition()
+ {
+ //!! NOTHING
+ }
+
+
+ void setDefaultMoc();
+
+
+ void pushMoc(WObject * mocTransition);
+
+ void popMoc();
+
+
+ /**
+ ***************************************************************************
+ * PRECOMPILATION
+ ***************************************************************************
+ */
+ void precompileTransition(
+ ExecutableForm * aContainer, Transition * aTransition);
+
+
+ /**
+ ***************************************************************************
+ * COMPILATION
+ ***************************************************************************
+ */
+ void compileTransition(AvmTransition * anAvmTransition);
+
+ BFCode scheduleListOfTransition(
+ ExecutableForm * anExecutableForm, BFList & listOfTransition);
+
+ Machine * getTransitionTarget(
+ Transition * aTransition, const BF & smTarget);
+
+ BF compileTransitionTarget(
+ AvmTransition * anAvmTransition, const BF & smTarget);
+
+ void compileStatemachineTransition(ExecutableForm * anExecutableForm,
+ const BFCode & runRoutine);
+
+ void compileStateForkOutputTransition(ExecutableForm * anExecutableForm,
+ const BFCode & runRoutine);
+
+ void compileStateJoinInputTransition(ExecutableForm * anExecutableForm);
+
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ Compiler & mCompiler;
+
+ CompilerOfVariable & mDataCompiler;
+
+
+ // MOC:> Model of Compilation
+ List< TransitionMoc * > mMocStack;
+
+ TransitionMoc * mCurrentMoc;
+
+ TransitionMoc mDefaultMoc;
+
+};
+
+}
+
+#endif /* BUILDER_COMPILER_COMPILEROFTRANSITION_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/compiler/CompilerOfVariable.cpp b/org.eclipse.efm.symbex/src/builder/compiler/CompilerOfVariable.cpp
new file mode 100644
index 0000000..0aba949
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/compiler/CompilerOfVariable.cpp
@@ -0,0 +1,953 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 29 mars 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "CompilerOfVariable.h"
+
+#include <builder/primitive/AvmcodeCompiler.h>
+#include <builder/compiler/Compiler.h>
+
+#include <fml/executable/AvmLambda.h>
+#include <fml/executable/AvmProgram.h>
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/InstanceOfData.h>
+
+#include <fml/builtin/Boolean.h>
+#include <fml/builtin/Character.h>
+#include <fml/builtin/Identifier.h>
+
+#include <fml/common/SpecifierElement.h>
+
+#include <fml/numeric/Integer.h>
+#include <fml/numeric/Number.h>
+
+#include <fml/expression/BuiltinArray.h>
+#include <fml/expression/ExpressionFactory.h>
+#include <fml/expression/ExpressionTypeChecker.h>
+#include <fml/expression/StatementConstructor.h>
+#include <fml/expression/StatementConstructor.h>
+#include <fml/expression/StatementTypeChecker.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/symbol/TableOfSymbol.h>
+
+#include <fml/infrastructure/BehavioralPart.h>
+#include <fml/infrastructure/Routine.h>
+#include <fml/infrastructure/Variable.h>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+CompilerOfVariable::CompilerOfVariable(Compiler & aCompiler)
+: BaseCompiler(aCompiler)
+{
+ //!! NOTHING
+}
+
+
+/**
+ *******************************************************************************
+ * PRE-COMPILATION
+ *******************************************************************************
+ */
+
+void CompilerOfVariable::addPrecompileData(
+ AvmProgram * aContainer, Symbol & aVariable,
+ TableOfInstanceOfData & tableOfVariable, bool collectVarEnabled)
+{
+ getSymbolTable().addDataInstance(aVariable);
+
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( aVariable.hasTypeSpecifier() )
+ << "addPrecompileData:> Unexpected a "
+ "variable without type-specifier !!!"
+ << SEND_EXIT;
+
+ BaseTypeSpecifier * aTypeSpecifier = aVariable.getTypeSpecifier();
+
+ if( aTypeSpecifier->is< TypeAliasSpecifier >() )
+ {
+ aTypeSpecifier = aTypeSpecifier->
+ to< TypeAliasSpecifier >()->targetTypeSpecifier();
+ }
+
+ ArrayBF * arrayValue = ( aVariable.hasArrayValue() ) ?
+ aVariable.getArrayValue() : NULL;
+
+// if( arrayValue->getTypeSpecifier() != aTypeSpecifier )
+// {
+// aTypeSpecifier = NULL;
+// }
+
+ switch( aTypeSpecifier->getTypeSpecifierKind() )
+ {
+ case TYPE_BOOLEAN_SPECIFIER:
+ case TYPE_CHARACTER_SPECIFIER:
+ case TYPE_REAL_SPECIFIER:
+ case TYPE_FLOAT_SPECIFIER:
+ case TYPE_RATIONAL_SPECIFIER:
+ case TYPE_INTEGER_SPECIFIER:
+
+ case TYPE_INTERVAL_SPECIFIER:
+
+ case TYPE_ENUM_SPECIFIER:
+
+ case TYPE_STRING_SPECIFIER:
+
+ case TYPE_MACHINE_SPECIFIER:
+ {
+ if( collectVarEnabled )
+ {
+ tableOfVariable.append(aVariable);
+ }
+
+ break;
+ }
+
+ case TYPE_CLASS_SPECIFIER:
+ {
+ ClassTypeSpecifier * classType =
+ aTypeSpecifier->to< ClassTypeSpecifier >();
+
+ aVariable.setAttribute( new TableOfSymbol(classType->size()) );
+
+ InstanceOfData * newInstance;
+ Symbol newSymbol;
+
+ TableOfSymbol::iterator it = classType->getSymbolData().begin();
+ TableOfSymbol::iterator endIt = classType->getSymbolData().end();
+ for( avm_offset_t offset = 0 ; it != endIt ; ++it, ++offset )
+ {
+ newSymbol = newInstance = new InstanceOfData(
+ IPointerDataNature::POINTER_FIELD_CLASS_ATTRIBUTE_NATURE,
+ aVariable.getContainer(), (*it).getAstElement(),
+ (*it).getTypeSpecifier(), aVariable.getFullyQualifiedNameID() + "." +
+ (*it).getAstNameID(), offset, aVariable.rawData() );
+
+ newInstance->getwModifier().setNatureKind(
+ (*it).getAstElement()->getModifier().getNatureKind() );
+
+ newInstance->getwModifier().setFeatureVolatile(
+ (*it).getAstElement()->getModifier().hasFeatureVolatile() );
+ newInstance->getwModifier().setFeatureTransient(
+ (*it).getAstElement()->getModifier().hasFeatureTransient() );
+
+ aVariable.setAttribute(offset, newSymbol);
+
+ if( (arrayValue != NULL) && (arrayValue->size() > offset) )
+ {
+ newInstance->setValue( arrayValue->at(offset) );
+ }
+ else
+ {
+ newInstance->setValue( (*it).getValue() );
+ }
+
+ newInstance->setParent( aVariable.rawData() );
+ newInstance->updateNameID();
+
+ precompileData_initialValue(aContainer, newInstance);
+
+ if( newInstance->getModifier().hasFeatureUnsafe()
+ || aContainer->getModifier().hasFeatureUnsafe() )
+ {
+ compileTypeConstraint(aContainer, newInstance);
+ }
+
+ // ADD DATA
+ addPrecompileData(aContainer, newSymbol,
+ tableOfVariable, collectVarEnabled);
+ }
+
+ break;
+ }
+
+ case TYPE_CHOICE_SPECIFIER:
+ {
+ ClassTypeSpecifier * classType =
+ aTypeSpecifier->to< ClassTypeSpecifier >();
+
+ aVariable.setAttribute( new TableOfSymbol(classType->size()) );
+
+ InstanceOfData * newInstance;
+ Symbol newSymbol;
+
+ TableOfSymbol::iterator it = classType->getSymbolData().begin();
+ TableOfSymbol::iterator endIt = classType->getSymbolData().end();
+ for( avm_offset_t offset = 0 ; it != endIt ; ++it, ++offset )
+ {
+ newSymbol = newInstance = new InstanceOfData(
+ IPointerDataNature::POINTER_FIELD_CHOICE_ATTRIBUTE_NATURE,
+ aVariable.getContainer(), (*it).getAstElement(),
+ (*it).getTypeSpecifier(), aVariable.getFullyQualifiedNameID() + "." +
+ (*it).getAstNameID(), offset, aVariable.rawData() );
+
+ newInstance->getwModifier().setNatureKind(
+ (*it).getAstElement()->getModifier().getNatureKind() );
+
+ newInstance->getwModifier().setFeatureVolatile(
+ (*it).getAstElement()->getModifier().hasFeatureVolatile() );
+ newInstance->getwModifier().setFeatureTransient(
+ (*it).getAstElement()->getModifier().hasFeatureTransient() );
+
+ aVariable.setAttribute(offset, newSymbol);
+
+ if( (arrayValue != NULL) && (arrayValue->size() > offset) )
+ {
+ newInstance->setValue( arrayValue->at(offset) );
+ }
+ else
+ {
+ newInstance->setValue( (*it).getValue() );
+ }
+
+ newInstance->setParent( aVariable.rawData() );
+ newInstance->updateNameID();
+
+ precompileData_initialValue(aContainer, newInstance);
+
+ if( newInstance->getModifier().hasFeatureUnsafe()
+ || aContainer->getModifier().hasFeatureUnsafe() )
+ {
+ compileTypeConstraint(aContainer, newInstance);
+ }
+
+ // ADD DATA
+ addPrecompileData(aContainer, newSymbol,
+ tableOfVariable, collectVarEnabled);
+ }
+
+ break;
+ }
+
+ case TYPE_UNION_SPECIFIER:
+ {
+ UnionTypeSpecifier * unionType =
+ aTypeSpecifier->to< UnionTypeSpecifier >();
+ aVariable.setAttribute( new TableOfSymbol(unionType->size()) );
+
+ InstanceOfData * newInstance;
+ Symbol newSymbol;
+
+ TableOfSymbol::iterator it = unionType->getSymbolData().begin();
+ TableOfSymbol::iterator endIt = unionType->getSymbolData().end();
+ for( avm_offset_t offset = 0 ; it != endIt ; ++it, ++offset )
+ {
+ if( (*it).hasTypeArrayOrStructure() )
+ {
+ incrErrorCount();
+ AVM_OS_WARN << aVariable.getAstElement()
+ ->errorLocation(aContainer->getAstElement())
+ << "CompilerOfVariable::addPrecompileData : "
+ << "Unsupported \"composite type\" "
+ "in a \"union type\" << "
+ << str_header( *it ) << " >>!" << std::endl;
+ }
+
+ newSymbol = newInstance = new InstanceOfData(
+ IPointerDataNature::POINTER_FIELD_UNION_ATTRIBUTE_NATURE,
+ aVariable.getContainer(), (*it).getAstElement(),
+ (*it).getTypeSpecifier(),
+ aVariable.getFullyQualifiedNameID() + "." +
+ (*it).getAstNameID(),
+ aVariable.getOffset(),
+ aVariable.rawData() );
+
+ newInstance->getwModifier().setNatureKind(
+ (*it).getAstElement()->getModifier().getNatureKind() );
+
+ newInstance->getwModifier().setFeatureVolatile(
+ (*it).getAstElement()->getModifier().hasFeatureVolatile() );
+ newInstance->getwModifier().setFeatureTransient(
+ (*it).getAstElement()->getModifier().hasFeatureTransient() );
+
+ aVariable.setAttribute(offset, newSymbol);
+
+ if( (arrayValue != NULL) && (arrayValue->size() > offset) )
+ {
+ newInstance->setValue( arrayValue->at(offset) );
+ }
+ else
+ {
+ newInstance->setValue( (*it).getValue() );
+ }
+
+ newInstance->setParent( aVariable.rawData() );
+ newInstance->updateNameID();
+
+ precompileData_initialValue(aContainer, newInstance);
+
+ if( newInstance->getModifier().hasFeatureUnsafe()
+ || aContainer->getModifier().hasFeatureUnsafe() )
+ {
+ compileTypeConstraint(aContainer, newInstance);
+ }
+
+ // ADD DATA
+ addPrecompileData(aContainer, newSymbol,
+ tableOfVariable, collectVarEnabled);
+ }
+
+ break;
+ }
+
+
+ case TYPE_ARRAY_SPECIFIER:
+ {
+ ContainerTypeSpecifier * collectionT =
+ aTypeSpecifier->to< ContainerTypeSpecifier >();
+
+ aVariable.setAttribute( new TableOfSymbol(collectionT->size()) );
+
+ std::ostringstream ossID;
+
+ InstanceOfData * newInstance;
+ Symbol newSymbol;
+
+ avm_offset_t offset = 0;
+ for( ; offset < collectionT->size() ; ++offset )
+ {
+ ossID.str("");
+ ossID << "[" << offset << "]";
+
+ newSymbol = newInstance = new InstanceOfData(
+ IPointerDataNature::POINTER_FIELD_ARRAY_OFFSET_NATURE,
+ aVariable.getContainer(), aVariable.getAstElement(),
+ collectionT->getContentsTypeSpecifier(),
+ aVariable.getFullyQualifiedNameID() + ossID.str(),
+ offset, aVariable.getModifier() );
+
+ newInstance->setParent( aVariable.rawData() );
+ newInstance->updateNameID();
+
+ aVariable.setAttribute(offset, newSymbol);
+
+ if( newInstance->getModifier().hasFeatureUnsafe()
+ || aContainer->getModifier().hasFeatureUnsafe() )
+ {
+ compileTypeConstraint(aContainer, newInstance);
+ }
+
+ if( (arrayValue != NULL) && (arrayValue->size() > offset) )
+ {
+ newInstance->setValue( arrayValue->at(offset) );
+ }
+
+ // ADD DATA
+ addPrecompileData(aContainer, newSymbol,
+ tableOfVariable, collectVarEnabled);
+ }
+
+ break;
+ }
+
+
+ case TYPE_FIFO_SPECIFIER:
+ case TYPE_LIFO_SPECIFIER:
+ case TYPE_MULTI_FIFO_SPECIFIER:
+ case TYPE_MULTI_LIFO_SPECIFIER:
+ case TYPE_LIST_SPECIFIER:
+ case TYPE_SET_SPECIFIER:
+ {
+ if( collectVarEnabled )
+ {
+ tableOfVariable.append(aVariable);
+ }
+
+ break;
+ }
+
+ case TYPE_UNIVERSAL_SPECIFIER:
+ {
+ if( collectVarEnabled )
+ {
+ tableOfVariable.append(aVariable);
+ }
+
+ break;
+ }
+
+ case TYPE_NULL_SPECIFIER:
+ {
+ // TODO ERROR
+ break;
+ }
+
+ default :
+ {
+ // TODO ERROR
+ break;
+ }
+ }
+}
+
+
+avm_size_t CompilerOfVariable::nextOffset(
+ TableOfInstanceOfData & tableOfVariable)
+{
+ return( tableOfVariable.size() );
+
+// if( tableOfVariable.nonempty() )
+// {
+// InstanceOfData * lastVar = tableOfVariable.last().to_ptr< InstanceOfData >();
+// avm_offset_t offset = 0;
+//
+// if( lastVar->getModifier().hasNatureReference() )
+// {
+// offset = 1;
+// }
+// else
+// {
+// offset = lastVar->getTypeSpecifier()->getDataSize();
+// }
+//
+// return( offset + lastVar->getOffset() );
+// }
+// else
+// {
+// return( 0 );
+// }
+}
+
+
+void CompilerOfVariable::precompileData(AvmProgram * aContainer,
+ Variable * aVariable, TableOfInstanceOfData & tableOfVariable)
+{
+ TypeSpecifier aTypeSpecifier;
+ InstanceOfData * newInstance;
+ Symbol newSymbol;
+
+ aTypeSpecifier = compileTypeSpecifier(aContainer, aVariable->getType());
+
+ newSymbol = newInstance = new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ aContainer, aVariable, aTypeSpecifier,
+ nextOffset(tableOfVariable), aVariable->getModifier() );
+ newInstance->setNameID( aVariable->getNameID() );
+// newInstance->fullyUpdateAllNameID( aNewInstance->getFullyQualifiedNameID() );
+
+ precompileData_initialValue(aContainer, newInstance);
+
+ if( aVariable->getModifier().hasNatureReference() )
+ {
+ tableOfVariable.append(newSymbol);
+ }
+ else if( aVariable->getModifier().hasFeatureFinal() )
+ {
+ aContainer->appendConstData(newSymbol);
+
+ TableOfInstanceOfData tableOfConstant;
+
+ addPrecompileData(aContainer, newSymbol, tableOfConstant, true);
+
+ if( tableOfConstant.populated() )
+ {
+ TableOfInstanceOfData::const_iterator it = tableOfConstant.begin();
+ TableOfInstanceOfData::const_iterator endIt = tableOfConstant.end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).isNTEQ(newInstance) )
+ {
+ aContainer->appendConstData( *it );
+ }
+ }
+ }
+ else if( tableOfConstant.singleton() &&
+ tableOfConstant.front().isNTEQ(newInstance) )
+ {
+ aContainer->appendConstData( tableOfConstant.front() );
+ }
+ }
+ else
+ {
+ if( newInstance->getModifier().hasFeatureUnsafe()
+ || aContainer->getModifier().hasFeatureUnsafe() )
+ {
+ compileTypeConstraint(aContainer, newInstance);
+ }
+
+ // ADD DATA
+ tableOfVariable.append(newSymbol);
+
+ addPrecompileData(aContainer, newSymbol, tableOfVariable);
+ }
+
+}
+
+
+/**
+ *******************************************************************************
+ * COMPILATION
+ *******************************************************************************
+ */
+
+void CompilerOfVariable::compileData(ExecutableForm * anExecutable)
+{
+ TableOfInstanceOfData::const_raw_iterator itData =
+ anExecutable->getConstData().begin();
+ TableOfInstanceOfData::const_raw_iterator endData =
+ anExecutable->getConstData().end();
+ for( ; itData != endData ; ++itData )
+ {
+ if( (itData)->hasAstVariable() )
+ {
+ compileConstData(anExecutable, (itData));
+ }
+ }
+
+
+ BFCode onInitialize( OperatorManager::OPERATOR_SEQUENCE );
+
+ itData = anExecutable->getAllData().begin();
+ endData = anExecutable->getAllData().end();
+ for( ; itData != endData ; ++itData )
+ {
+ if( (itData)->hasAstVariable() )
+ {
+ compileDataOnCreate(anExecutable, itData, onInitialize);
+
+ compileData(anExecutable, (itData));
+ }
+ }
+
+ if( onInitialize->nonempty() )
+ {
+//!![TRACE]: to delete
+//AVM_OS_DEBUG << std::endl << "compileData() => onCreate:> "
+// << onInitialize << std::endl;
+
+ BehavioralPart * theBehavioralPart = const_cast< Machine * >(
+ anExecutable->getAstMachine() )->getUniqBehaviorPart();
+
+ onInitialize = StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ onInitialize, theBehavioralPart->getOnCreate() );
+
+ theBehavioralPart->setOnCreate( onInitialize->populated() ?
+ onInitialize : onInitialize->first().bfCode() );
+ }
+}
+
+
+void CompilerOfVariable::compileDataOnCreate(
+ ExecutableForm * anExecutable,
+ TableOfInstanceOfData::const_raw_iterator itData,
+ BFCode & onInitialize)
+{
+ const Variable * aVariable = (itData)->getAstVariable();
+
+ const BF & aValue = ( (itData)->hasAliasTarget() &&
+ (itData)->getAliasTarget()->as< InstanceOfData >()->hasValue() )?
+ (itData)->getAliasTarget()->as< InstanceOfData >()->getValue() :
+ ( (itData)->hasValue() ?
+ (itData)->getValue() : aVariable->getValue() );
+//!![TRACE]: to delete
+//!![MIGRATION]:TRACE
+// AVM_OS_DEBUG << std::endl
+// << "compileData() => onCreate:>\n"
+// << to_stream( *itData ) << to_stream( aVariable ) << std::endl;
+
+ if( aValue.valid() )
+ {
+ /*if( (itData)->hasTypeArrayOrStructure()
+ && (not aValue.is< BuiltinCollection >()) )
+ {
+ AVM_OS_DEBUG << std::endl
+ << "compileData() => onCreate:> unexpected\n"
+ << "type:> " << aValue.classKindInfo() << std::endl
+ << to_stream( *itData ) << std::endl;
+ }
+ else*/ if( not ( (itData)->hasParent()
+ && (itData)->getParent()->hasValue() ) )
+// && (itData)->getParent()->hasTypeArrayOrStructure()
+// && (itData)->getParent()->getValue().is< BuiltinCollection >() ) )
+ {
+//AVM_OS_DEBUG << std::endl << "compileData() => onCreate:>\n"
+// << to_stream( *itData ) << std::endl;
+//// << str_header( *itData ) << std::endl;
+
+ onInitialize->append( StatementConstructor::newCode(
+ aVariable->getAssignOperator(), (*itData), aValue ) );
+ }
+ }
+}
+
+void CompilerOfVariable::compileData(AvmProgram * aProgram)
+{
+ TableOfInstanceOfData::const_raw_iterator itData =
+ aProgram->getConstData().begin();
+ TableOfInstanceOfData::const_raw_iterator endData =
+ aProgram->getConstData().end();
+ for( ; itData != endData ; ++itData )
+ {
+ if( (itData)->hasAstVariable() )
+ {
+ compileConstData(aProgram, (itData));
+ }
+ }
+
+
+ itData = aProgram->getAllData().begin();
+ endData = aProgram->getAllData().end();
+ for( ; itData != endData ; ++itData )
+ {
+ if( (itData)->hasAstVariable() )
+ {
+ compileData(aProgram, (itData));
+ }
+ }
+}
+
+
+void CompilerOfVariable::compileConstData(
+ AvmProgram * aContainer, InstanceOfData * aVarInstance)
+{
+ if( aVarInstance->hasAstVariable() )
+ {
+ const Variable * aCompiledVar = aVarInstance->getAstVariable();
+ if( aCompiledVar->hasOnWrite() )
+ {
+ //!!! ERROR
+ }
+
+ compileData_initialValue(aContainer, aVarInstance);
+ }
+}
+
+
+void CompilerOfVariable::compileData(
+ AvmProgram * aContainer, InstanceOfData * aVarInstance)
+{
+ const Variable * aCompiledVar = aVarInstance->getAstVariable();
+
+ if( aCompiledVar->hasOnWrite() &&
+ aCompiledVar->getOnWriteRoutine()->doSomething() )
+ {
+ AvmProgram * onWriteProg = mAvmcodeCompiler.compileRoutine(this,
+ aContainer, aVarInstance, aCompiledVar->getOnWriteRoutine());
+
+ if( aVarInstance->isConcreteStructAttribute() )
+ {
+ onWriteProg->setFullyQualifiedNameContainer( aVarInstance );
+ }
+
+ aVarInstance->setOnWriteRoutine( onWriteProg );
+
+ aContainer->getExecutable()->saveAnonymousInnerRoutine( onWriteProg );
+ }
+
+ else if( aVarInstance->hasTypeSpecifier() &&
+ aVarInstance->getTypeSpecifier()->hasConstraint() )
+ {
+ aVarInstance->setOnWriteRoutine( aVarInstance->getTypeSpecifier()->
+ getConstraint().as_ptr< AvmProgram >() );
+ }
+// else if( aCompiledVar->hasDataType() &&
+// aCompiledVar->getDataType()->getConstraintRoutine().doSomething() )
+// {
+// aVarInstance->setOnWriteRoutine( compileData_monitor(
+// aContainer, aVarInstance,
+// aCompiledVar->getDataType()->getConstraintRoutine()) );
+// }
+
+ compileData_initialValue(aContainer, aVarInstance);
+}
+
+
+BF CompilerOfVariable::precompileData_initialValue(AvmProgram * aContainer,
+ BaseTypeSpecifier * aTypeSpecifier, const BF & aValue)
+{
+ if( aValue.invalid() )
+ {
+ return( BF::REF_NULL );
+ }
+
+ else if( aValue.is< InstanceOfData >() )
+ {
+ if( aValue.to_ptr< InstanceOfData >()->hasValue() &&
+ ExpressionTypeChecker::isFinalSymbolicBasicSymbol(
+ aValue.to_ptr< InstanceOfData >()->getValue()) )
+ {
+ return( aValue.to_ptr< InstanceOfData >()->getValue() );
+ }
+ else if( aValue.to_ptr< InstanceOfData >()->getModifier().
+ hasModifierPublicFinalStaticParameter() )
+ {
+ return( aValue );
+ }
+ }
+
+ else if( aValue.is_strictly< BuiltinArray >() )
+ {
+ BuiltinArray * aBuiltinArrayValue = aValue.to_ptr< BuiltinArray >();
+
+ if( aBuiltinArrayValue->is< ArrayIdentifier >()
+ || aBuiltinArrayValue->is< ArrayQualifiedIdentifier >() )
+ {
+ return( BF::REF_NULL );
+ }
+ else if( aTypeSpecifier->hasTypeListCollection() )
+ {
+ BuiltinContainer * containerValue = BuiltinContainer::create(
+ aTypeSpecifier->as< ContainerTypeSpecifier >() );
+
+ containerValue->copy(aBuiltinArrayValue, std::min(
+ containerValue->capacity(), aBuiltinArrayValue->size()) );
+
+ return( BF(containerValue) );
+ }
+
+ else
+ {
+ ArrayBF * bfArray = aBuiltinArrayValue->getArrayBF();
+
+ if( (bfArray->getTypeSpecifier() != aTypeSpecifier)
+ && ExpressionTypeChecker::isTyped(aTypeSpecifier, aValue) )
+ {
+ bfArray->setTypeSpecifier( aTypeSpecifier );
+ }
+
+ if( bfArray->getTypeSpecifier()->is< ContainerTypeSpecifier >()
+ && bfArray->getTypeSpecifier()->to<
+ ContainerTypeSpecifier >()->weaklyTypedIdentifier() )
+ {
+ delete bfArray;
+ }
+ else
+ {
+ return( BF( bfArray ) );
+ }
+ }
+ }
+
+ else if( aValue.is< ArrayBF >()
+ /*&& aVarInstance->getModifier().hasFeatureFinal
+ && ExpressionTypeChecker::isFinalSymbolicCompositeSymbol(
+ aValue.to_ptr< ArrayBF >())*/ )
+ {
+ bool isFinalSymbol = true;
+
+ CompilationEnvironment compilENV(aContainer);
+
+ ArrayBF * bfArray = aValue.to_ptr< ArrayBF >();
+ for( avm_size_t idx = 0 ; idx < bfArray->size() ; ++idx )
+ {
+ const BF & arg = bfArray->at(idx);
+ if( arg.is< Variable >() )
+ {
+ if( arg.to_ptr< Variable >()->hasValue()
+ && ExpressionTypeChecker::isFinalSymbolicSymbol(
+ arg.to_ptr< Variable >()->getValue()) )
+ {
+ const BF & compiledVar =
+ mAvmcodeCompiler.getSymbolTable().searchSemSymbol(
+ compilENV.mCTX, arg.to_ptr< Variable >() );
+
+ if( compiledVar.valid()
+ && compiledVar.is< InstanceOfData >()
+ && compiledVar.to_ptr< InstanceOfData >()->hasValue() )
+ {
+ bfArray->set(idx,
+ compiledVar.to_ptr< InstanceOfData >()->getValue() );
+ }
+ else if( aTypeSpecifier->hasTypeContainer() )
+ {
+ bfArray->set(idx, precompileData_initialValue(aContainer,
+ aTypeSpecifier->as< ContainerTypeSpecifier >()
+ ->getContentsTypeSpecifier(),
+ arg.to_ptr< Variable >()->getValue()) );
+ }
+ else if( aTypeSpecifier->isTypedClass() )
+ {
+ bfArray->set(idx, precompileData_initialValue(aContainer,
+ aTypeSpecifier->as< ClassTypeSpecifier >()
+ ->getSymbolData(idx).getTypeSpecifier(),
+ arg.to_ptr< Variable >()->getValue()) );
+ }
+ else
+ {
+ bfArray->set(idx, arg.to_ptr< Variable >()->getValue() );
+ }
+ }
+ else
+ {
+ isFinalSymbol = false;
+ }
+ }
+ else if( not ExpressionTypeChecker::isFinalSymbolicSymbol( arg ) )
+ {
+ isFinalSymbol = false;
+ }
+ }
+
+ if( isFinalSymbol )
+ {
+ if( (aValue.to_ptr< ArrayBF >()->getTypeSpecifier() != aTypeSpecifier)
+ && ExpressionTypeChecker::isTyped(aTypeSpecifier, aValue) )
+ {
+ aValue.to_ptr< ArrayBF >()->setTypeSpecifier( aTypeSpecifier );
+ }
+
+ return( aValue );
+ }
+ }
+
+ else if( aTypeSpecifier->isTypedArray() )
+ {
+ if( ExpressionTypeChecker::isFinalSymbolicBasicSymbol(aValue) )
+ {
+ return( BF( new ArrayBF(aTypeSpecifier,
+ aTypeSpecifier->size(), aValue) ) );
+ }
+ }
+
+ else if( aTypeSpecifier->isTypedEnum() )
+ {
+ if( aValue.is< Variable >() )
+ {
+ return( aTypeSpecifier->as< EnumTypeSpecifier >()->getSymbolData().
+ getByAstElement( aValue.to_ptr< Variable >() ) );
+ }
+ else if( aValue.is< Identifier >() )
+ {
+ return( aTypeSpecifier->as< EnumTypeSpecifier >()->getSymbolData().
+ getByNameID( aValue.to_ptr< Identifier >()->getValue() ) );
+ }
+ else
+ {
+ return( aTypeSpecifier->as< EnumTypeSpecifier >()->
+ getSymbolData().getByQualifiedNameID( aValue.str() ) );
+ }
+ }
+
+ else if( aValue.is< Number >() || aValue.is< Boolean >() ||
+ aValue.is< Character >() || aValue.is< String >() )
+ {
+ return( aValue );
+ }
+
+ return( BF::REF_NULL );
+}
+
+void CompilerOfVariable::precompileData_initialValue(
+ AvmProgram * aContainer, InstanceOfData * aVarInstance)
+{
+ const Variable * aVar = aVarInstance->getAstVariable();
+
+ BF aValue = aVar->getValue();
+ if( aValue.valid() )
+ {
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << "variable:precompile#value> " << str_header( aVar ) << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ aVarInstance->setValue( precompileData_initialValue(aContainer,
+ aVarInstance->getTypeSpecifier(), aValue) );
+
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << "instance:> " << str_header( aVarInstance ) << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ }
+}
+
+
+
+void CompilerOfVariable::compileData_initialValue(
+ AvmProgram * aContainer, InstanceOfData * aVarInstance)
+{
+ const Variable * aVar = aVarInstance->getAstVariable();
+
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << "variable:compile#value> " << str_header( aVar ) << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ if( not aVarInstance->hasValue() )
+ {
+ const BF & aValue = aVar->getValue();
+ if( aValue.valid() )
+ {
+ CompilationEnvironment compilENV(aContainer);
+ compilENV.mCTX->mType = aVarInstance->getTypeSpecifier();
+
+ aVarInstance->setValue( mAvmcodeCompiler.
+ decode_compileExpression(compilENV.mCTX, aValue) );
+
+ if( aVarInstance->getValue().is< ArrayBF >() )
+ {
+ ArrayBF * bfArray = aVarInstance->getValue().to_ptr< ArrayBF >();
+ for( avm_size_t idx = 0 ; idx < bfArray->size() ; ++idx )
+ {
+ const BF & arg = bfArray->at(idx);
+ if( arg.is< InstanceOfData >() &&
+ arg.to_ptr< InstanceOfData >()->hasValue() &&
+ ExpressionTypeChecker::isFinalSymbolicSymbol(
+ arg.to_ptr< InstanceOfData >()->getValue()) )
+ {
+ bfArray->set(idx,
+ arg.to_ptr< InstanceOfData >()->getValue() );
+ }
+ }
+ }
+ }
+ }
+
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << "instance:> " << str_header( aVarInstance ) << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+}
+
+
+// TODO Verifier la généralisation, hors des types énumérés!!!
+void CompilerOfVariable::compileTypeConstraint(
+ AvmProgram * aContainer, InstanceOfData * aVarInstance)
+{
+ AVM_OS_ASSERT_WARNING_ALERT( aVarInstance->getModifier().hasFeatureUnsafe()
+ || aContainer->getModifier().hasFeatureUnsafe() )
+ << "Unexpected a << non-unsafe >> InstanceOfData !!!"
+ << SEND_ALERT;
+
+ BaseTypeSpecifier * aTypeSpecifier = aVarInstance->getTypeSpecifier();
+ if( aTypeSpecifier->couldGenerateConstraint() )
+ {
+ AvmProgram * onWriteProg = new AvmProgram(
+ Specifier::SCOPE_ROUTINE_KIND,
+ aContainer, aVarInstance->getAstElement(), 1);
+ onWriteProg->updateUfid( "#onWriteTypeConstraint" );
+ onWriteProg->setParamOffsetCount(0, 1);
+
+ BF newValue( new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE, onWriteProg,
+ aVarInstance->getAstElement(), aTypeSpecifier, "newValue", 0) );
+ onWriteProg->setData(0, newValue);
+ onWriteProg->updateDataTable();
+
+ BFCode code(OperatorManager::OPERATOR_GUARD,
+ aTypeSpecifier->genConstraint(newValue) );
+
+ onWriteProg->setCode(code);
+
+ aVarInstance->setOnWriteRoutine( onWriteProg );
+
+ aContainer->getExecutable()->saveAnonymousInnerRoutine( onWriteProg );
+ }
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/builder/compiler/CompilerOfVariable.h b/org.eclipse.efm.symbex/src/builder/compiler/CompilerOfVariable.h
new file mode 100644
index 0000000..939f7f9
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/compiler/CompilerOfVariable.h
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 29 mars 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BUILDER_COMPILER_COMPILEROFVARIABLE_H_
+#define BUILDER_COMPILER_COMPILEROFVARIABLE_H_
+
+#include <builder/compiler/BaseCompiler.h>
+
+#include <collection/Vector.h>
+
+#include <fml/type/TypeSpecifier.h>
+
+
+namespace sep
+{
+
+
+class AvmProgram;
+class ExecutableForm;
+
+class InstanceOfData;
+
+class Variable;
+
+class Compiler;
+
+
+
+class CompilerOfVariable : public BaseCompiler
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ CompilerOfVariable(Compiler & aCompiler);
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~CompilerOfVariable()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ ***************************************************************************
+ * PRECOMPILATION
+ ***************************************************************************
+ */
+
+ void addPrecompileData(AvmProgram * aContainer, Symbol & aVariable,
+ TableOfInstanceOfData & tableOfVariable,
+ bool collectVarEnabled = false);
+
+ static avm_size_t nextOffset(TableOfInstanceOfData & tableOfVariable);
+
+
+ void precompileTypeSpecifier(AvmProgram * aContainer, const BF & aDataType);
+
+ void precompileData(AvmProgram * aContainer,
+ Variable * aVariable, TableOfInstanceOfData & tableOfVariable);
+
+ BF precompileData_initialValue(AvmProgram * aContainer,
+ BaseTypeSpecifier * aTypeSpecifier, const BF & aValue);
+
+ void precompileData_initialValue(AvmProgram * aContainer,
+ InstanceOfData * aVarInstance);
+
+ /**
+ ***************************************************************************
+ * COMPILATION
+ ***************************************************************************
+ */
+ void compileData(ExecutableForm * anExecutable);
+
+ void compileDataOnCreate(ExecutableForm * anExecutable,
+ TableOfInstanceOfData::const_raw_iterator itData,
+ BFCode & onInitialize);
+
+
+
+ void compileData(AvmProgram * aProgram);
+
+ void compileConstData(AvmProgram * aContainer, InstanceOfData * aVarInstance);
+ void compileData(AvmProgram * aContainer, InstanceOfData * aVarInstance);
+
+ void compileData_initialValue(
+ AvmProgram * aContainer, InstanceOfData * aVarInstance);
+
+ void compileTypeConstraint(
+ AvmProgram * aContainer, InstanceOfData * aVarInstance);
+
+};
+
+}
+
+#endif /* BUILDER_COMPILER_COMPILEROFVARIABLE_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/compiler/README.md b/org.eclipse.efm.symbex/src/builder/compiler/README.md
new file mode 100644
index 0000000..27550df
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/compiler/README.md
@@ -0,0 +1,10 @@
+# EFM-SYMBEX : Compiler
+
+## Source code structure
+
+### Interfaces
+
+### Classes
+
+### Factories
+
diff --git a/org.eclipse.efm.symbex/src/builder/compiler/SymbolPredicate.h b/org.eclipse.efm.symbex/src/builder/compiler/SymbolPredicate.h
new file mode 100644
index 0000000..d73ba83
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/compiler/SymbolPredicate.h
@@ -0,0 +1,195 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 15 sept. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BUILDER_COMPILER_SYMBOLPREDICATE_H_
+#define BUILDER_COMPILER_SYMBOLPREDICATE_H_
+
+#include <fml/executable/BaseCompiledForm.h>
+
+#include <fml/symbol/Symbol.h>
+
+
+namespace sep
+{
+
+
+class SymbolPredicate
+{
+public:
+ /**
+ * CONSTRUCTOR / DESTRUCTOR
+ */
+ SymbolPredicate()
+ {
+ //!! NOTHING
+ }
+
+ virtual ~SymbolPredicate()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * OPERATOR API
+ */
+ virtual bool operator() (const BaseCompiledForm * aSymbol) const = 0;
+
+ virtual bool operator() (const Symbol & aSymbol) const = 0;
+
+};
+
+
+
+
+class SymbolPredicateByQualifiedNameID : public SymbolPredicate
+{
+
+public:
+ /**
+ * ATTRIBUTE
+ */
+ std::string mQualifiedNameID;
+
+ /**
+ * CONSTRUCTOR / DESTRUCTOR
+ *
+ */
+ SymbolPredicateByQualifiedNameID(const std::string & aQualifiedNameID)
+ : SymbolPredicate( ),
+ mQualifiedNameID( aQualifiedNameID )
+ {
+ //!! NOTHING
+ }
+
+ virtual ~SymbolPredicateByQualifiedNameID()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * OPERATOR
+ */
+ inline virtual bool operator() (const BaseCompiledForm * aSymbol) const
+ {
+ return( aSymbol->fqnEndsWith(mQualifiedNameID) );
+ }
+
+ inline virtual bool operator() (const Symbol & aSymbol) const
+ {
+ return( aSymbol.fqnEndsWith(mQualifiedNameID) );
+ }
+
+};
+
+
+
+class SymbolPredicateByNameID : public SymbolPredicateByQualifiedNameID
+{
+public:
+ /**
+ * CONSTRUCTOR
+ */
+ SymbolPredicateByNameID(const std::string & id)
+ : SymbolPredicateByQualifiedNameID( id )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * OPERATOR
+ */
+ inline virtual bool operator() (const BaseCompiledForm * aSymbol) const
+ {
+ return( aSymbol->getNameID() == mQualifiedNameID );
+ }
+
+ inline virtual bool operator() (const Symbol & aSymbol) const
+ {
+ return( aSymbol.getNameID() == mQualifiedNameID );
+ }
+
+};
+
+
+class SymbolPredicateByCompiledFQNameID :
+ public SymbolPredicateByQualifiedNameID
+{
+public:
+ /**
+ * CONSTRUCTOR
+ */
+ SymbolPredicateByCompiledFQNameID(
+ const std::string & aFullyQualifiedNameID)
+ : SymbolPredicateByQualifiedNameID( aFullyQualifiedNameID )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * OPERATOR
+ */
+ inline virtual bool operator() (const BaseCompiledForm * aSymbol) const
+ {
+ return( aSymbol->getAstFullyQualifiedNameID() == mQualifiedNameID );
+ }
+
+ inline virtual bool operator() (const Symbol & aSymbol) const
+ {
+ return( aSymbol.getAstFullyQualifiedNameID() == mQualifiedNameID );
+ }
+
+};
+
+
+
+class SymbolPredicateByCompiledElement : public SymbolPredicate
+{
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ const ObjectElement * mElement;
+
+public:
+ SymbolPredicateByCompiledElement(const ObjectElement * anElement)
+ : SymbolPredicate( ),
+ mElement(anElement)
+ {
+ //!! NOTHING
+ }
+ virtual ~SymbolPredicateByCompiledElement()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * OPERATOR
+ */
+ inline virtual bool operator() (const BaseCompiledForm * aSymbol) const
+ {
+ return( aSymbol->isAstElement( mElement ) );
+ }
+
+ inline virtual bool operator() (const Symbol & aSymbol) const
+ {
+ return( aSymbol.isAstElement( mElement ) );
+ }
+
+};
+
+
+} /* namespace sep */
+#endif /* BUILDER_COMPILER_SYMBOLPREDICATE_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/compiler/SymbolTable.cpp b/org.eclipse.efm.symbex/src/builder/compiler/SymbolTable.cpp
new file mode 100644
index 0000000..c0d610e
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/compiler/SymbolTable.cpp
@@ -0,0 +1,2909 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include <builder/compiler/SymbolTable.h>
+
+#include <builder/primitive/CompilationEnvironment.h>
+
+#include <fml/common/ObjectElement.h>
+#include <fml/common/PropertyElement.h>
+
+#include <fml/executable/AvmProgram.h>
+#include <fml/executable/AvmTransition.h>
+#include <fml/executable/BaseAvmProgram.h>
+#include <fml/executable/BaseInstanceForm.h>
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/ExecutableLib.h>
+#include <fml/executable/ExecutableSystem.h>
+#include <fml/executable/InstanceOfBuffer.h>
+#include <fml/executable/InstanceOfPort.h>
+#include <fml/executable/RoutingData.h>
+
+#include <fml/builtin/QualifiedIdentifier.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/infrastructure/Channel.h>
+#include <fml/infrastructure/Connector.h>
+#include <fml/infrastructure/Machine.h>
+#include <fml/infrastructure/Port.h>
+
+#include <fml/symbol/Symbol.h>
+
+#include <fml/workflow/UniFormIdentifier.h>
+
+#include <sew/Configuration.h>
+
+
+namespace sep
+{
+
+
+/**
+ *******************************************************************************
+ * SEARCH
+ *******************************************************************************
+ */
+
+ /**
+ * SEARCH
+ * for Type
+ */
+const TypeSpecifier & SymbolTable::searchTypeSpecifier(
+ ExecutableSystem & anExecutableSystem,
+ COMPILE_CONTEXT * aCTX, const ObjectElement * astElement)
+{
+ BaseAvmProgram * aProgram = aCTX->mCompileCtx;
+ for( ; aProgram != NULL ; aProgram = aProgram->getContainer() )
+ {
+ if( aProgram->is< AvmProgram >() )
+ {
+ const TypeSpecifier & foundType =
+ aProgram->to< AvmProgram >()->getTypeSpecifier(astElement);
+ if( foundType.valid() )
+ {
+ return( foundType );
+ }
+ }
+ }
+
+ TableOfExecutableForm::const_raw_iterator itExec =
+ anExecutableSystem.getExecutables().begin();
+ TableOfExecutableForm::const_raw_iterator itEnd =
+ anExecutableSystem.getExecutables().end();
+ for( ; itExec != itEnd ; ++itExec )
+ {
+ const TypeSpecifier & foundType =
+ (itExec)->getTypeSpecifier(astElement);
+ if( foundType.valid() )
+ {
+ return( foundType );
+ }
+ }
+
+ return( TypeSpecifier::REF_NULL );
+}
+
+
+const TypeSpecifier & SymbolTable::searchTypeSpecifier(
+ ExecutableSystem & anExecutableSystem, COMPILE_CONTEXT * aCTX,
+ const std::string & aFullyQualifiedNameID)
+{
+ BaseAvmProgram * aProgram = aCTX->mCompileCtx;
+ for( ; aProgram != NULL ; aProgram = aProgram->getContainer() )
+ {
+ if( aProgram->is< AvmProgram >() )
+ {
+ const TypeSpecifier & foundType = aProgram->to< AvmProgram >()->
+ getTypeSpecifier( aFullyQualifiedNameID );
+ if( foundType.valid() )
+ {
+ return( foundType );
+ }
+ }
+ }
+
+ TableOfExecutableForm::const_raw_iterator itExec =
+ anExecutableSystem.getExecutables().begin();
+ TableOfExecutableForm::const_raw_iterator itEnd =
+ anExecutableSystem.getExecutables().end();
+ for( ; itExec != itEnd ; ++itExec )
+ {
+ const TypeSpecifier & foundType =
+ (itExec)->getTypeSpecifier( aFullyQualifiedNameID );
+ if( foundType.valid() )
+ {
+ return( foundType );
+ }
+ }
+
+ return( TypeSpecifier::REF_NULL );
+}
+
+
+/*
+ * SEARCH
+ * for Data Instance
+ */
+const BF & SymbolTable::searchDataInstance(
+ BaseAvmProgram * tmpProgram, const ObjectElement * astElement) const
+{
+ for( ; tmpProgram != NULL ; tmpProgram = tmpProgram->getContainer() )
+ {
+ {
+ const BF & foundInstance =
+ tmpProgram->getAllData().getByAstElement(astElement);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ {
+ const BF & foundInstance =
+ tmpProgram->getDataAlias().getByAstElement(astElement);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ if( tmpProgram->is< AvmProgram >() )
+ {
+ {
+ const BF & foundInstance = tmpProgram->to< AvmProgram >()->
+ getConstData().getByAstElement(astElement);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ {
+ const BF & foundInstance = tmpProgram->to< AvmProgram >()->
+ getSymbolDataByAstElement(astElement);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+const BF & SymbolTable::searchDataInstance(
+ COMPILE_CONTEXT * aCTX, const ObjectElement * objElement)
+{
+ // RESET ERROR
+ resetError();
+
+ const BF & foundInstance =
+ searchDataInstance(aCTX->mCompileCtx, objElement);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ else if( aCTX->isSpecificRuntimeCtx() )
+ {
+ const BF & foundInstance =
+ searchDataInstance(aCTX->mRuntimeCtx, objElement);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ return( searchDataInstanceAlias(aCTX, objElement) );
+}
+
+
+
+const BF & SymbolTable::searchDataInstance(BaseAvmProgram * tmpProgram,
+ const std::string & aFullyQualifiedNameID) const
+{
+ for( ; tmpProgram != NULL ; tmpProgram = tmpProgram->getContainer() )
+ {
+ const BF & foundInstance = tmpProgram->getAllData().
+ getByFQNameID( aFullyQualifiedNameID );
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+
+ if( tmpProgram->is< AvmProgram >() )
+ {
+ {
+ const BF & foundInstance = tmpProgram->to< AvmProgram >()->
+ getConstData().getByFQNameID( aFullyQualifiedNameID );
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ {
+ const BF & foundInstance = tmpProgram->to< AvmProgram >()->
+ getSymbolData( aFullyQualifiedNameID );
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ if( tmpProgram->is< ExecutableForm >() )
+ {
+ const BF & foundInstance = tmpProgram->to< ExecutableForm >()->
+ getDataAlias().getByFQNameID( aFullyQualifiedNameID );
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+const BF & SymbolTable::searchDataInstance(COMPILE_CONTEXT * aCTX,
+ const std::string & aFullyQualifiedNameID)
+{
+ // RESET ERROR
+ resetError();
+
+ const BF & foundInstance =
+ searchDataInstance(aCTX->mCompileCtx, aFullyQualifiedNameID);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ else if( aCTX->isSpecificRuntimeCtx() )
+ {
+ const BF & foundInstance =
+ searchDataInstance(aCTX->mRuntimeCtx, aFullyQualifiedNameID);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ return( searchDataInstanceAlias(aCTX, aFullyQualifiedNameID) );
+}
+
+
+
+const BF & SymbolTable::searchDataInstanceByQualifiedNameID(
+ BaseAvmProgram * tmpProgram, const std::string & aQualifiedNameID) const
+{
+ for( ; tmpProgram != NULL ; tmpProgram = tmpProgram->getContainer() )
+ {
+ const BF & foundInstance = tmpProgram->
+ getAllData().getByQualifiedNameID(aQualifiedNameID);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+
+ if( tmpProgram->is< AvmProgram >() )
+ {
+ {
+ const BF & foundInstance = tmpProgram->to< AvmProgram >()->
+ getConstData().getByQualifiedNameID(aQualifiedNameID);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ {
+ const BF & foundInstance = tmpProgram->to< AvmProgram >()->
+ getSymbolDataByQualifiedNameID(aQualifiedNameID);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ if( tmpProgram->is< ExecutableForm >() )
+ {
+ const BF & foundInstance = tmpProgram->to< ExecutableForm >()->
+ getDataAlias().getByQualifiedNameID(aQualifiedNameID);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+const BF & SymbolTable::searchDataInstanceByQualifiedNameID(
+ COMPILE_CONTEXT * aCTX, const std::string & aQualifiedNameID)
+{
+ // RESET ERROR
+ resetError();
+
+ const BF & foundInstance = searchDataInstanceByQualifiedNameID(
+ aCTX->mCompileCtx, aQualifiedNameID);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ else if( aCTX->isSpecificRuntimeCtx() )
+ {
+ const BF & foundInstance = searchDataInstanceByQualifiedNameID(
+ aCTX->mRuntimeCtx, aQualifiedNameID);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+
+const BF & SymbolTable::searchDataInstanceByNameID(
+ BaseAvmProgram * tmpProgram, const std::string & aNameID) const
+{
+ for( ; tmpProgram != NULL ; tmpProgram = tmpProgram->getContainer() )
+ {
+ const BF & foundInstance =
+ tmpProgram->getAllData().getByNameID(aNameID);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+
+ if( tmpProgram->is< AvmProgram >() )
+ {
+ {
+ const BF & foundInstance = tmpProgram->to<
+ AvmProgram >()->getConstData().getByNameID(aNameID);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ {
+ const BF & foundInstance = tmpProgram->to<
+ AvmProgram >()->getSymbolDataByNameID(aNameID);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ if( tmpProgram->is< ExecutableForm >() )
+ {
+ const BF & foundInstance = tmpProgram->to<
+ ExecutableForm >()->getDataAlias().getByNameID(aNameID);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+const BF & SymbolTable::searchDataInstanceAlias(
+ COMPILE_CONTEXT * aCTX, const ObjectElement * astElement)
+{
+ ExecutableForm * tmpExecutable = NULL;
+ BF foundInstance;
+ InstanceOfData * foundData = NULL;
+
+ TableOfExecutableForm::const_raw_iterator itExec =
+ mConfiguration.getExecutableSystem().getExecutables().begin();
+ TableOfExecutableForm::const_raw_iterator endExec =
+ mConfiguration.getExecutableSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ foundInstance = (itExec)->getAllData().getByAstElement(astElement);
+ if( foundInstance.valid() )
+ {
+ tmpExecutable = (itExec);
+ break;
+ }
+
+ foundInstance = (itExec)->getConstData().getByAstElement(astElement);
+ if( foundInstance.valid() )
+ {
+ tmpExecutable = (itExec);
+ break;
+ }
+
+ foundInstance = (itExec)->getSymbolDataByAstElement(astElement);
+ if( foundInstance.valid() )
+ {
+ tmpExecutable = (itExec);
+ break;
+ }
+ }
+
+ if( foundInstance.valid() )
+ {
+ foundData = foundInstance.to_ptr< InstanceOfData >();
+ if( foundData->getModifier().isVisibilityPublic( aCTX->getModifier() ) )
+ {
+ return( createDataInstanceAlias(
+ aCTX->mCompileCtx->getExecutable(),
+ astElement->getFullyQualifiedNameID(),
+ foundData, tmpExecutable) );
+ }
+ else
+ {
+ incrErrorCount();
+ ERROR_OS << "Illegal acces of the NON-PUBLIC instance << &"
+ << astElement->getFullyQualifiedNameID() << " >> !!!";
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+const BF & SymbolTable::searchDataInstanceAlias(
+ COMPILE_CONTEXT * aCTX, const std::string & aFullyQualifiedNameID)
+{
+ std::string fqnPrefix = aFullyQualifiedNameID.substr(0,
+ aFullyQualifiedNameID.find_last_of('.'));
+
+ std::string aliasFQN;
+
+ VectorOfInstanceOfMachine theInstanceOfMachinePath;
+
+ ExecutableForm * tmpExecutable = aCTX->mCompileCtx->getExecutable();
+
+ Symbol aMachine;
+
+ for( ; tmpExecutable != NULL ;
+ tmpExecutable = tmpExecutable->getExecutableContainer() )
+ {
+ if( ((aMachine = tmpExecutable->getInstanceStatic().
+ getByFQNameID(fqnPrefix)).valid() )
+ || ((aMachine = tmpExecutable->getInstanceStatic().
+ getByQualifiedNameID(fqnPrefix)).valid()) )
+ {
+ theInstanceOfMachinePath.append( aMachine.rawMachine() );
+
+ tmpExecutable = aMachine.getExecutable();
+
+ aliasFQN = aMachine.getFullyQualifiedNameID();
+
+ break;
+ }
+ }
+
+ if( aMachine.invalid() )
+ {
+ fqnPrefix = aFullyQualifiedNameID.substr(0,
+ aFullyQualifiedNameID.find('.'));
+ tmpExecutable = NULL;
+
+ TableOfExecutableForm::const_raw_iterator itExec =
+ mConfiguration.getExecutableSystem().getExecutables().begin();
+ TableOfExecutableForm::const_raw_iterator endExec =
+ mConfiguration.getExecutableSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ if( (itExec)->getAstFullyQualifiedNameID() == fqnPrefix )
+ {
+ tmpExecutable = (itExec);
+ break;
+ }
+ else if( NamedElement::compareLocation(
+ (itExec)->getAstFullyQualifiedNameID(), fqnPrefix) )
+ {
+ tmpExecutable = (itExec);
+ break;
+ }
+ else if( (itExec)->getNameID() == fqnPrefix )
+ {
+ tmpExecutable = (itExec);
+ break;
+ }
+ }
+ }
+
+ if( tmpExecutable != NULL )
+ {
+ ListOfString strList;
+
+ NamedElement::collectNameID(strList,
+ aFullyQualifiedNameID, fqnPrefix.size() + 1);
+
+ if( strList.singleton() )
+ {
+ aliasFQN = aliasFQN + '.' + strList.first();
+ fqnPrefix = tmpExecutable->getAstFullyQualifiedNameID() +
+ '.' + strList.pop_first();
+
+ if( tmpExecutable->getAllData().getByFQNameID(fqnPrefix).invalid() )
+ {
+ tmpExecutable = NULL;
+ }
+ }
+
+ while( strList.populated() && (tmpExecutable != NULL) )
+ {
+ fqnPrefix = tmpExecutable->getAstFullyQualifiedNameID()
+ + '.' + strList.pop_first();
+
+ aMachine = tmpExecutable->
+ getInstanceStatic().getByFQNameID( fqnPrefix );
+ if( aMachine != NULL )
+ {
+ aliasFQN = aMachine.getFullyQualifiedNameID();
+
+ theInstanceOfMachinePath.append( aMachine.rawMachine() );
+
+ tmpExecutable = aMachine.getExecutable();
+ }
+ else
+ {
+ if( tmpExecutable->getAllData().
+ getByFQNameID(fqnPrefix).invalid() )
+ {
+ break;
+ }
+ }
+ }
+
+ if( tmpExecutable != NULL )
+ {
+ while( strList.nonempty() )
+ {
+ aliasFQN = aliasFQN + '.' + strList.first();
+ fqnPrefix = fqnPrefix + '.' + strList.pop_first();
+ }
+
+ const BF & foundInstance =
+ tmpExecutable->getAllData().getByFQNameID(fqnPrefix);
+
+ if( foundInstance.valid() )
+ {
+ InstanceOfData * foundData =
+ foundInstance.to_ptr< InstanceOfData >();
+ if( foundData->getModifier().
+ isVisibilityPublic( aCTX->getModifier() ) )
+ {
+ return( createDataInstanceAlias(
+ aCTX->mCompileCtx->getExecutable(),
+ aliasFQN, foundData, theInstanceOfMachinePath) );
+ }
+ else
+ {
+ incrErrorCount();
+ ERROR_OS << "Illegal acces of the NON-PUBLIC instance << "
+ << aFullyQualifiedNameID << " >> !!!";
+ }
+ }
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+const BF & SymbolTable::createDataInstanceAlias(ExecutableForm * anExecutable,
+ const std::string & aFullyQualifiedNameID,
+ InstanceOfData * anInstance, ExecutableForm * instContainer)
+{
+ const ExecutableForm * lcaExecutable = anExecutable->LCA( instContainer );
+
+ if( lcaExecutable != NULL )
+ {
+ std::string fqnPrefix = lcaExecutable->getAstFullyQualifiedNameID();
+
+ ListOfString strList;
+ NamedElement::collectNameID(strList, aFullyQualifiedNameID, fqnPrefix);
+
+ VectorOfInstanceOfMachine theInstanceOfMachinePath;
+
+ while( strList.populated() )
+ {
+ fqnPrefix = fqnPrefix + '.' + strList.pop_first();
+
+ const Symbol & execInstance =
+ lcaExecutable->getInstanceStatic().getByFQNameID( fqnPrefix );
+ if( execInstance.valid() )
+ {
+ theInstanceOfMachinePath.append(execInstance.rawMachine());
+ lcaExecutable = execInstance.getExecutable();
+ }
+ else
+ {
+ if( lcaExecutable->getAllData().
+ getByFQNameID( fqnPrefix ).invalid() )
+ {
+ lcaExecutable = NULL;
+ }
+ break;
+ }
+ }
+
+ if( lcaExecutable != NULL )
+ {
+ while( strList.nonempty() )
+ {
+ fqnPrefix = fqnPrefix + '.' + strList.pop_first();
+ }
+
+ BF foundInstance =
+ lcaExecutable->getAllData().getByFQNameID( fqnPrefix );
+ if( foundInstance.invalid() )
+ {
+ foundInstance =
+ lcaExecutable->getConstData().getByFQNameID( fqnPrefix );
+
+ if( foundInstance.invalid() )
+ {
+ foundInstance = lcaExecutable->getSymbolData(fqnPrefix);
+ }
+ }
+
+ if( foundInstance == anInstance )
+ {
+ InstanceOfData * aliasInstance( new InstanceOfData(
+ anExecutable, anInstance, theInstanceOfMachinePath) );
+ aliasInstance->setFullyQualifiedNameID("alias" +
+ aFullyQualifiedNameID.substr(
+ aFullyQualifiedNameID.find(':')) );
+
+ return( anExecutable->saveDataAlias(aliasInstance) );
+ }
+ else
+ {
+ incrErrorCount();
+ ERROR_OS << "Failed to create ALIAS for instance << "
+ << aFullyQualifiedNameID << " >> !!!";
+ }
+ }
+ }
+ else
+ {
+ incrErrorCount();
+ ERROR_OS << "Unfound LCA executable between "
+ << anExecutable->getFullyQualifiedNameID() << " & ";
+ ERROR_OS << instContainer->getFullyQualifiedNameID()
+ << " for ALIAS creation for instance << "
+ << aFullyQualifiedNameID << " >> !!!";
+ }
+
+
+ return( BF::REF_NULL );
+}
+
+
+const BF & SymbolTable::createDataInstanceAlias(ExecutableForm * anExecutable,
+ const std::string & aFullyQualifiedNameID, InstanceOfData * anInstance,
+ VectorOfInstanceOfMachine & theInstanceOfMachinePath)
+{
+ const ExecutableForm * lcaExecutable = anExecutable->LCRA(
+ theInstanceOfMachinePath.last()->getContainer()->getExecutable() );
+
+ if( lcaExecutable != NULL )
+ {
+ if( lcaExecutable->hasContainer()
+ && theInstanceOfMachinePath.populated()
+ && (theInstanceOfMachinePath.first()
+ != mConfiguration.getExecutableSystem().rawSystemInstance()) )
+ {
+ while( theInstanceOfMachinePath.first()->getExecutable()
+ != lcaExecutable )
+ {
+ theInstanceOfMachinePath.remove_first();
+ }
+ if( lcaExecutable == anExecutable )
+ {
+ theInstanceOfMachinePath.remove_first();
+ }
+ }
+ else
+ {
+ //!! NOTHING
+ }
+
+ InstanceOfData * aliasInstance( new InstanceOfData(anExecutable,
+ anInstance, theInstanceOfMachinePath) );
+
+ aliasInstance->setFullyQualifiedNameID( "alias" +
+ aFullyQualifiedNameID.substr(aFullyQualifiedNameID.find(':')) );
+
+ return( anExecutable->saveDataAlias(aliasInstance) );
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+/*
+ ******************************************************************************
+ * SEARCH PORT CONNECT INSTANCE
+ ******************************************************************************
+ */
+
+InstanceOfPort * SymbolTable::searchPortConnectorInstance(
+ ExecutableForm * anExecutable,
+ const std::string & aFullyQualifiedNameID) const
+{
+ // SEACH FOR INTERNAL PORT CONNEXION
+ {
+ const Symbol & foundInstance =
+ anExecutable->getPort().getByFQNameID( aFullyQualifiedNameID );
+ if( foundInstance.valid() )
+ {
+ return( foundInstance.rawPort() );
+ }
+ }
+
+ // SEACH FOR MACHINE PORT CONNEXION
+ TableOfSymbol::const_iterator itMachine =
+ anExecutable->getInstanceStatic().begin();
+ TableOfSymbol::const_iterator endMachine =
+ anExecutable->getInstanceStatic().end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ const Symbol & foundInstance = (*itMachine).getExecutable()->getPort().
+ getByFQNameID( aFullyQualifiedNameID );
+ if( foundInstance.valid() )
+ {
+ return( foundInstance.rawPort() );
+ }
+ }
+
+ return( NULL );
+}
+
+InstanceOfPort * SymbolTable::searchPortConnectorInstance(
+ ExecutableForm * anExecutable, const ObjectElement * aPort) const
+{
+ // SEACH FOR INTERNAL PORT CONNEXION
+ {
+ const Symbol & foundInstance =
+ anExecutable->getPort().getByAstElement(aPort);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance.rawPort() );
+ }
+ }
+
+ // SEACH FOR MACHINE PORT CONNEXION
+ TableOfSymbol::const_iterator itMachine =
+ anExecutable->getInstanceStatic().begin();
+ TableOfSymbol::const_iterator endMachine =
+ anExecutable->getInstanceStatic().end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ const Symbol & foundInstance = (*itMachine).getExecutable()->
+ getPort().getByAstElement(aPort);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance.rawPort() );
+ }
+ }
+
+ const Symbol & foundInstance = XQuery.getSemPortByAstElement(
+ anExecutable->getExecutableContainer(), aPort);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance.rawPort() );
+ }
+
+ return( NULL );
+}
+
+
+/*
+ ******************************************************************************
+ * SEARCH PORT SYMBOL INSTANCE
+ ******************************************************************************
+ */
+const Symbol & SymbolTable::searchPortSymbolInstance(
+ ExecutableForm * anExec, Port * aPort) const
+{
+ const Symbol & foundInstance = XQuery.getSemPortByAstElement(anExec, aPort);
+ if( foundInstance.valid() )
+ {
+ return foundInstance;
+ }
+
+ if( aPort->hasRoutingChannel() )
+ {
+ const Symbol & foundChannel =
+ XQuery.getChannel( aPort->getRoutingChannel() );
+ if( foundChannel.valid() )
+ {
+ return foundChannel.channel().getContents().getByAstElement(aPort);
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+
+/*
+ *******************************************************************************
+ * SEARCH BUFFER SYMBOL INSTANCE
+ *******************************************************************************
+ */
+
+const Symbol & SymbolTable::searchBufferInstance(
+ ExecutableForm * anExecutable, const ObjectElement * objElement) const
+{
+ // SEARCH ON CURRENT BUFFER LIST
+ {
+ const Symbol & anInstance =
+ anExecutable->getBuffer().getByAstElement(objElement);
+ if( anInstance.valid() )
+ {
+ return( anInstance );
+ }
+ }
+
+ // SEARCH ON CURRENT ALIAS BUFFER LIST
+ {
+ const Symbol & anInstance =
+ anExecutable->getAlias().getByAstElement(objElement);
+ if( anInstance.is< InstanceOfBuffer >() )
+ {
+ return( anInstance );
+ }
+ }
+
+
+ // SEARCH ON CURRENT MODEL CHILD BUFFER LIST & MAKE AN ALIAS
+ InstanceOfBuffer * aBufferInstance = NULL;
+
+ TableOfSymbol::const_iterator itMachine = anExecutable->instance_model_begin();
+ TableOfSymbol::const_iterator endMachine = anExecutable->instance_model_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ aBufferInstance = (*itMachine).getExecutable()->
+ getBuffer().getByAstElement(objElement).rawBuffer();
+ if( aBufferInstance != NULL )
+ {
+ break;
+ }
+ }
+
+ if( aBufferInstance != NULL )
+ {
+ VectorOfInstanceOfMachine theInstanceOfMachinePath;
+ theInstanceOfMachinePath.append( (*itMachine).rawMachine() );
+
+ InstanceOfBuffer * aliasInstance = new InstanceOfBuffer(
+ anExecutable, aBufferInstance, theInstanceOfMachinePath);
+
+ std::string aFullyQualifiedNameID =
+ aBufferInstance->getFullyQualifiedNameID();
+
+ aliasInstance->setFullyQualifiedNameID( "alias" +
+ aFullyQualifiedNameID.substr(aFullyQualifiedNameID.find(':')) );
+
+ return( anExecutable->saveAlias(aliasInstance) );
+ }
+
+ return( searchBufferInstance(objElement) );
+}
+
+
+
+const Symbol & SymbolTable::searchBufferInstance(ExecutableForm * anExecutable,
+ const std::string & aFullyQualifiedNameID)
+{
+ // SEARCH ON CURRENT BUFFER LIST
+ {
+ const Symbol & anInstance =
+ anExecutable->getBuffer().getByFQNameID( aFullyQualifiedNameID );
+ if( anInstance.valid() )
+ {
+ return( anInstance );
+ }
+ }
+
+ // SEARCH ON CURRENT ALIAS BUFFER LIST
+ {
+ const Symbol & anInstance =
+ anExecutable->getAlias().getByFQNameID( aFullyQualifiedNameID );
+ if( anInstance.is< InstanceOfBuffer >() )
+ {
+ return( anInstance );
+ }
+ }
+
+ // SEARCH ON CURRENT MODEL CHILD BUFFER LIST & MAKE AN ALIAS
+ InstanceOfBuffer * aBufferInstance = NULL;
+
+ TableOfSymbol::const_iterator itMachine = anExecutable->instance_model_begin();
+ TableOfSymbol::const_iterator endMachine = anExecutable->instance_model_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ aBufferInstance = (*itMachine).getExecutable()->
+ getBuffer().getByFQNameID( aFullyQualifiedNameID ).rawBuffer();
+ if( aBufferInstance != NULL )
+ {
+ break;
+ }
+ }
+
+ if( aBufferInstance != NULL )
+ {
+ VectorOfInstanceOfMachine theInstanceOfMachinePath;
+ theInstanceOfMachinePath.append( (*itMachine).rawMachine() );
+
+ InstanceOfBuffer * aliasInstance = new InstanceOfBuffer(
+ anExecutable, aBufferInstance, theInstanceOfMachinePath );
+
+ std::string fqnID = aBufferInstance->getFullyQualifiedNameID();
+ aliasInstance->setFullyQualifiedNameID( "alias" +
+ fqnID.substr(fqnID.find(':')) );
+
+ return( anExecutable->saveAlias(aliasInstance) );
+ }
+
+ return( searchBufferInstanceAlias(anExecutable, aFullyQualifiedNameID) );
+}
+
+
+const Symbol & SymbolTable::searchBufferInstanceByQualifiedNameID(
+ ExecutableForm * anExec, const std::string & aQualifiedNameID) const
+{
+ for( ; anExec != NULL ; anExec = anExec->getExecutableContainer() )
+ {
+ const Symbol & anInstance =
+ anExec->getBuffer().getByQualifiedNameID(aQualifiedNameID);
+ if( anInstance.valid() )
+ {
+ return( anInstance );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+
+const Symbol & SymbolTable::searchBufferInstanceByNameID(
+ ExecutableForm * anExec, const std::string & aNameID) const
+{
+ for( ; anExec != NULL ; anExec = anExec->getExecutableContainer() )
+ {
+ const Symbol & foundInstance =
+ anExec->getBuffer().getByNameID(aNameID);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+
+const Symbol & SymbolTable::searchBufferInstanceAlias(
+ ExecutableForm * anExecutable,
+ const std::string & aFullyQualifiedNameID)
+{
+ std::string fqnPrefix = aFullyQualifiedNameID.substr(0,
+ aFullyQualifiedNameID.find_last_of('.'));
+
+ std::string aliasFQN;
+
+ VectorOfInstanceOfMachine theInstanceOfMachinePath;
+
+ ExecutableForm * tmpExecutable = anExecutable;
+
+ Symbol aMachine;
+
+ for( ; tmpExecutable != NULL ;
+ tmpExecutable = tmpExecutable->getExecutableContainer() )
+ {
+ if( ((aMachine = tmpExecutable->getInstanceStatic().getByFQNameID(
+ fqnPrefix)).valid())
+ || ((aMachine = tmpExecutable->getInstanceStatic().
+ getByQualifiedNameID(fqnPrefix)).valid()) )
+ {
+ theInstanceOfMachinePath.append( aMachine.rawMachine() );
+
+ tmpExecutable = aMachine.getExecutable();
+
+ aliasFQN = aMachine.getFullyQualifiedNameID();
+
+ break;
+ }
+ }
+
+ if( aMachine.invalid() )
+ {
+ fqnPrefix = aFullyQualifiedNameID.substr(0,
+ aFullyQualifiedNameID.find('.'));
+ tmpExecutable = NULL;
+
+ TableOfExecutableForm::const_raw_iterator itExec =
+ mConfiguration.getExecutableSystem().getExecutables().begin();
+ TableOfExecutableForm::const_raw_iterator endExec =
+ mConfiguration.getExecutableSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ if( (itExec)->getAstFullyQualifiedNameID() == fqnPrefix )
+ {
+ tmpExecutable = (itExec);
+ break;
+ }
+ else if( NamedElement::compareLocation(
+ (itExec)->getAstFullyQualifiedNameID(), fqnPrefix) )
+ {
+ tmpExecutable = (itExec);
+ break;
+ }
+ else if( (itExec)->getNameID() == fqnPrefix )
+ {
+ tmpExecutable = (itExec);
+ break;
+ }
+ }
+ }
+
+ if( tmpExecutable != NULL )
+ {
+ ListOfString strList;
+
+ NamedElement::collectNameID(strList,
+ aFullyQualifiedNameID, fqnPrefix.size() + 1);
+
+ if( strList.singleton() )
+ {
+ aliasFQN = aliasFQN + '.' + strList.first();
+ fqnPrefix = tmpExecutable->getAstFullyQualifiedNameID() +
+ '.' + strList.pop_first();
+
+ if( tmpExecutable->getBuffer().getByFQNameID(fqnPrefix).invalid() )
+ {
+ tmpExecutable = NULL;
+ }
+ }
+
+ while( strList.populated() && (tmpExecutable != NULL) )
+ {
+ fqnPrefix = tmpExecutable->getAstFullyQualifiedNameID()
+ + '.' + strList.pop_first();
+
+ aMachine = tmpExecutable->getInstanceStatic().
+ getByFQNameID( fqnPrefix );
+ if( aMachine.valid() )
+ {
+ aliasFQN = aMachine.getFullyQualifiedNameID();
+
+ theInstanceOfMachinePath.append( aMachine.rawMachine() );
+
+ tmpExecutable = aMachine.getExecutable();
+ }
+ else
+ {
+ if( tmpExecutable->getBuffer().
+ getByFQNameID( fqnPrefix ).invalid() )
+ {
+ break;
+ }
+ }
+ }
+
+ if( tmpExecutable != NULL )
+ {
+ while( strList.nonempty() )
+ {
+ aliasFQN = aliasFQN + '.' + strList.first();
+ fqnPrefix = fqnPrefix + '.' + strList.pop_first();
+ }
+
+ const Symbol & foundInstance =
+ tmpExecutable->getBuffer().getByFQNameID( fqnPrefix );
+
+ if( foundInstance.valid() )
+ {
+ if( foundInstance.getModifier().isVisibilityPublic() )
+ {
+ return( createBufferInstanceAlias(anExecutable, aliasFQN,
+ foundInstance.rawBuffer(), theInstanceOfMachinePath) );
+ }
+ else
+ {
+ incrErrorCount();
+ ERROR_OS << "Illegal acces of the NON-PUBLIC instance << "
+ << aFullyQualifiedNameID << " >> !!!";
+ }
+ }
+ }
+ }
+
+
+ return( Symbol::REF_NULL );
+}
+
+
+
+const Symbol & SymbolTable::createBufferInstanceAlias(ExecutableForm * anExecutable,
+ const std::string & aFullyQualifiedNameID, InstanceOfBuffer * anInstance,
+ VectorOfInstanceOfMachine & theInstanceOfMachinePath)
+{
+ const ExecutableForm * lcaExecutable = anExecutable->LCRA(
+ theInstanceOfMachinePath.last()->getContainer()->getExecutable() );
+
+ if( lcaExecutable != NULL )
+ {
+ if( lcaExecutable->hasContainer()
+ && (theInstanceOfMachinePath.first()
+ != mConfiguration.getExecutableSystem().rawSystemInstance()) )
+ {
+ while( theInstanceOfMachinePath.first()->getExecutable()
+ != lcaExecutable )
+ {
+ theInstanceOfMachinePath.remove_first();
+ }
+ if( lcaExecutable == anExecutable )
+ {
+ theInstanceOfMachinePath.remove_first();
+ }
+ }
+ else
+ {
+ //!! NOTHING
+ }
+
+ InstanceOfBuffer * aliasInstance( new InstanceOfBuffer(
+ anExecutable, anInstance, theInstanceOfMachinePath) );
+
+ aliasInstance->setFullyQualifiedNameID( "alias" +
+ aFullyQualifiedNameID.substr(aFullyQualifiedNameID.find(':')) );
+
+ return( anExecutable->saveAlias(aliasInstance) );
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+
+
+/*
+ *******************************************************************************
+ * SEARCH CONNECT SYMBOL INSTANCE
+ *******************************************************************************
+ */
+
+const Symbol & SymbolTable::searchConnectorInstance(
+ ExecutableForm * anExecutable, const ObjectElement * objElement) const
+{
+ // SEARCH ON CURRENT BUFFER LIST
+ {
+ const Symbol & anInstance =
+ anExecutable->getConnect().getByAstElement(objElement);
+ if( anInstance.valid() )
+ {
+ return( anInstance );
+ }
+ }
+
+ // SEARCH ON CURRENT ALIAS BUFFER LIST
+ {
+ const Symbol & anInstance =
+ anExecutable->getAlias().getByAstElement(objElement);
+ if( anInstance.is< InstanceOfConnect >() )
+ {
+ return( anInstance );
+ }
+ }
+
+
+ // SEARCH ON CURRENT MODEL CHILD BUFFER LIST & MAKE AN ALIAS
+ Symbol bfConnect;
+
+ TableOfSymbol::const_iterator itMachine = anExecutable->instance_model_begin();
+ TableOfSymbol::const_iterator itEnd = anExecutable->instance_model_end();
+ for( ; itMachine != itEnd ; ++itMachine )
+ {
+ bfConnect = (*itMachine).getExecutable()->
+ getConnect().getByAstElement(objElement);
+ if( bfConnect.valid() )
+ {
+ break;
+ }
+ }
+
+ if( bfConnect.valid() )
+ {
+ VectorOfInstanceOfMachine theInstanceOfMachinePath;
+ theInstanceOfMachinePath.append( (*itMachine).rawMachine() );
+
+ InstanceOfConnect * aliasInstance = new InstanceOfConnect(
+ anExecutable, bfConnect.rawConnect(), theInstanceOfMachinePath );
+
+ const std::string & aFullyQualifiedNameID =
+ bfConnect.getFullyQualifiedNameID();
+
+ aliasInstance->setFullyQualifiedNameID( "alias" +
+ aFullyQualifiedNameID.substr(aFullyQualifiedNameID.find(':')) );
+
+ return( anExecutable->saveAlias(aliasInstance) );
+ }
+
+ return( searchConnectorInstance(objElement) );
+}
+
+
+
+const Symbol & SymbolTable::searchConnectorInstance(ExecutableForm * anExecutable,
+ const std::string & aFullyQualifiedNameID) const
+{
+ // SEARCH ON CURRENT BUFFER LIST
+ {
+ const Symbol & anInstance =
+ anExecutable->getConnect().getByFQNameID( aFullyQualifiedNameID );
+ if( anInstance.valid() )
+ {
+ return( anInstance );
+ }
+ }
+
+ // SEARCH ON CURRENT ALIAS BUFFER LIST
+ {
+ const Symbol & anInstance =
+ anExecutable->getAlias().getByFQNameID( aFullyQualifiedNameID );
+ if( anInstance.is< InstanceOfConnect >() )
+ {
+ return( anInstance );
+ }
+ }
+
+ // SEARCH ON CURRENT MODEL CHILD BUFFER LIST & MAKE AN ALIAS
+ Symbol bfConnect;
+
+ TableOfSymbol::const_iterator itMachine = anExecutable->instance_model_begin();
+ TableOfSymbol::const_iterator endMachine = anExecutable->instance_model_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ bfConnect = (*itMachine).getExecutable()->getConnect().
+ getByFQNameID( aFullyQualifiedNameID );
+ if( bfConnect.valid() )
+ {
+ break;
+ }
+ }
+
+ if( bfConnect.valid() )
+ {
+ VectorOfInstanceOfMachine theInstanceOfMachinePath;
+ theInstanceOfMachinePath.append( (*itMachine).rawMachine() );
+
+ InstanceOfConnect * aliasInstance = new InstanceOfConnect(
+ anExecutable, bfConnect.rawConnect(), theInstanceOfMachinePath );
+
+ const std::string & aFullyQualifiedNameID =
+ bfConnect.getFullyQualifiedNameID();
+
+ aliasInstance->setFullyQualifiedNameID( "alias" +
+ aFullyQualifiedNameID.substr(aFullyQualifiedNameID.find(':')) );
+
+ return( anExecutable->saveAlias(aliasInstance) );
+ }
+
+ return( searchConnectorInstance( aFullyQualifiedNameID ) );
+}
+
+
+const Symbol & SymbolTable::searchConnectorInstanceByQualifiedNameID(
+ ExecutableForm * anExec, const std::string & aQualifiedNameID) const
+{
+ for( ; anExec != NULL ; anExec = anExec->getExecutableContainer() )
+ {
+ const Symbol & foundInstance =
+ anExec->getConnect().getByQualifiedNameID(aQualifiedNameID);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+
+const Symbol & SymbolTable::searchConnectorInstanceByNameID(
+ ExecutableForm * anExec, const std::string & aNameID) const
+{
+ for( ; anExec != NULL ; anExec = anExec->getExecutableContainer() )
+ {
+ const Symbol & foundInstance =
+ anExec->getConnect().getByNameID(aNameID);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+
+/*
+ *******************************************************************************
+ * SEARCH MACHINE INSTANCE
+ *******************************************************************************
+ */
+const Symbol & SymbolTable::searchInstanceModelByNameID(
+ ExecutableForm * anExec, const std::string & aNameID) const
+{
+ for( ; anExec != NULL ; anExec = anExec->getExecutableContainer() )
+ {
+ const Symbol & foundInstance =
+ anExec->getInstanceModel().getByNameID(aNameID);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+const Symbol & SymbolTable::searchInstanceModelByNameID(
+ COMPILE_CONTEXT * aCTX, const std::string & aNameID) const
+{
+ return( searchInstanceModelByNameID(
+ aCTX->mCompileCtx->getExecutable(), aNameID) );
+}
+
+
+const Symbol & SymbolTable::searchMachineInstanceByNameID(
+ ExecutableForm * anExec, const std::string & aNameID) const
+{
+ for( ; anExec != NULL ; anExec = anExec->getExecutableContainer() )
+ {
+ const Symbol & foundInstance =
+ anExec->getInstanceStatic().getByNameID(aNameID);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+const Symbol & SymbolTable::searchMachineInstanceByNameID(
+ COMPILE_CONTEXT * aCTX, const std::string & aNameID) const
+{
+ return( searchMachineInstanceByNameID(
+ aCTX->mCompileCtx->getExecutable(), aNameID) );
+}
+
+
+/**
+ * SEARCH
+ * for Machine Instance
+ */
+const Symbol & SymbolTable::searchInstanceModel(
+ COMPILE_CONTEXT * aCTX, const ObjectElement * astElement) const
+{
+ ExecutableForm * anExec = aCTX->mCompileCtx->getExecutable();
+
+ for( ; anExec != NULL ; anExec = anExec->getExecutableContainer() )
+ {
+ const Symbol & foundInstance =
+ anExec->getByAstInstanceModel(astElement);
+ if( foundInstance.valid() && foundInstance.machine().isnotThis() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ return( searchInstanceStatic( astElement ) );
+}
+
+
+const Symbol & SymbolTable::searchInstanceStatic(
+ COMPILE_CONTEXT * aCTX, const ObjectElement * astElement) const
+{
+ ExecutableForm * anExec = aCTX->mCompileCtx->getExecutable();
+
+ for( ; anExec != NULL ; anExec = anExec->getExecutableContainer() )
+ {
+ const Symbol & foundInstance =
+ anExec->getByAstInstanceStatic(astElement);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ return( searchInstanceStatic( astElement ) );
+}
+
+
+const Symbol & SymbolTable::searchInstanceDynamic(
+ COMPILE_CONTEXT * aCTX, const ObjectElement * astElement) const
+{
+ ExecutableForm * anExec = aCTX->mCompileCtx->getExecutable();
+
+ for( ; anExec != NULL ; anExec = anExec->getExecutableContainer() )
+ {
+ const Symbol & foundInstance =
+ anExec->getByAstInstanceDynamic(astElement);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ return( searchInstanceStatic( astElement ) );
+}
+
+
+
+
+InstanceOfMachine * SymbolTable::searchInstanceStatic(
+ const ObjectElement * fromMachine, const UniFormIdentifier & anUFI)
+{
+ // RESET ERROR
+ resetError();
+
+ BFList listofMachine;
+ searchInstanceStatic(
+ fromMachine->getContainerMachine(), anUFI, listofMachine);
+
+ if( listofMachine.populated() )
+ {
+ incrErrorCount();
+ ERROR_OS << "Too more statemachine << "
+ << anUFI.str() << " >> are found !";
+
+ return( listofMachine.first().to_ptr< InstanceOfMachine >() );
+ }
+ else if( listofMachine.nonempty() )
+ {
+ return( listofMachine.first().to_ptr< InstanceOfMachine >() );
+ }
+ else
+ {
+ incrErrorCount();
+ ERROR_OS << "Unfound statemachine << "
+ << anUFI.str() << " >> !";
+
+ return( NULL );
+ }
+}
+
+void SymbolTable::searchInstanceStatic(const ObjectElement * refMachine,
+ const UniFormIdentifier & anUFI, BFList & foundList) const
+{
+ std::string strUFI = anUFI.str();
+ SymbolPredicateByCompiledFQNameID pred(strUFI);
+
+ if( not anUFI.hasLocator() )
+ {
+ std::string refUfi = refMachine->getFullyQualifiedNameID();
+ refUfi = refUfi.substr(
+ refUfi.find(FQN_ID_ROOT_SEPARATOR), refUfi.size());
+
+ pred.mQualifiedNameID = refUfi + '.' + strUFI;
+ searchCompiledElement(mListOfInstanceStatic, pred, foundList);
+
+ if( anUFI.populated() )
+ {
+ std::string commonAncestor = anUFI.first().str();
+
+ std::string::size_type pos;
+ while( (pos = refUfi.rfind(commonAncestor)) != std::string::npos )
+ {
+ refUfi = refUfi.substr(0, pos);
+ pred.mQualifiedNameID = refUfi + strUFI;
+ searchCompiledElement(mListOfInstanceStatic, pred, foundList);
+ }
+ }
+ }
+ else
+ {
+ searchCompiledElement(mListOfInstanceStatic, pred, foundList);
+ }
+}
+
+
+void SymbolTable::searchInstanceByNameID(COMPILE_CONTEXT * aCTX,
+ const std::string & aNameID, BFList & foundList) const
+{
+ switch( aCTX->mType->getTypeSpecifierKind() )
+ {
+ case TYPE_MACHINE_SPECIFIER:
+ {
+ searchMachineInstanceByNameID(aNameID, foundList);
+ break;
+ }
+ case TYPE_PORT_SPECIFIER:
+ {
+ searchPortInstanceByNameID(aNameID, foundList);
+ break;
+ }
+ case TYPE_SIGNAL_SPECIFIER:
+ {
+ searchPortInstanceByNameID(aNameID, foundList);
+ break;
+ }
+
+ case TYPE_BUFFER_SPECIFIER:
+ {
+ searchBufferInstanceByNameID(aNameID, foundList);
+ break;
+ }
+
+ case TYPE_CONNECTOR_SPECIFIER:
+ {
+ searchConnectorInstanceByNameID(aNameID, foundList);
+ break;
+ }
+
+
+ case TYPE_BOOLEAN_SPECIFIER:
+
+ case TYPE_POS_INTEGER_SPECIFIER:
+ case TYPE_UINTEGER_SPECIFIER:
+ case TYPE_INTEGER_SPECIFIER:
+
+ case TYPE_URATIONAL_SPECIFIER:
+ case TYPE_RATIONAL_SPECIFIER:
+
+ case TYPE_UFLOAT_SPECIFIER:
+ case TYPE_FLOAT_SPECIFIER:
+
+ case TYPE_UREAL_SPECIFIER:
+ case TYPE_REAL_SPECIFIER:
+
+ case TYPE_ENUM_SPECIFIER:
+
+ case TYPE_CHARACTER_SPECIFIER:
+ case TYPE_STRING_SPECIFIER:
+
+ case TYPE_CLOCK_SPECIFIER:
+ case TYPE_TIME_SPECIFIER:
+ case TYPE_CONTINUOUS_TIME_SPECIFIER:
+ case TYPE_DISCRETE_TIME_SPECIFIER:
+
+ case TYPE_INTERVAL_SPECIFIER:
+ case TYPE_OPERATOR_SPECIFIER:
+ case TYPE_AVMCODE_SPECIFIER:
+ case TYPE_MESSAGE_SPECIFIER:
+ {
+ searchDataInstanceByNameID(aNameID, foundList);
+
+ if( foundList.empty() )
+ {
+ searchPortInstanceByNameID(aNameID, foundList);
+
+ searchMachineInstanceByNameID(aNameID, foundList);
+
+ searchBufferInstanceByNameID(aNameID, foundList);
+
+ searchConnectorInstanceByNameID(aNameID, foundList);
+ }
+ break;
+ }
+
+ default:
+ {
+ searchDataInstanceByNameID(aNameID, foundList);
+
+ searchPortInstanceByNameID(aNameID, foundList);
+
+ searchMachineInstanceByNameID(aNameID, foundList);
+
+ searchBufferInstanceByNameID(aNameID, foundList);
+
+ searchConnectorInstanceByNameID(aNameID, foundList);
+
+ break;
+ }
+ }
+
+ if( foundList.empty() )
+ {
+ searchDataInstanceByNameID(aNameID, foundList);
+ }
+}
+
+
+
+void SymbolTable::searchInstanceByQualifiedNameID(COMPILE_CONTEXT * aCTX,
+ const std::string & aQualifiedNameID, BFList & foundList) const
+{
+ switch( aCTX->mType->getTypeSpecifierKind() )
+ {
+ case TYPE_MACHINE_SPECIFIER:
+ {
+ searchMachineInstanceByQualifiedNameID(aQualifiedNameID, foundList);
+ break;
+ }
+ case TYPE_PORT_SPECIFIER:
+ {
+ searchPortInstanceByQualifiedNameID(aQualifiedNameID, foundList);
+ break;
+ }
+ case TYPE_SIGNAL_SPECIFIER:
+ {
+ searchPortInstanceByQualifiedNameID(aQualifiedNameID, foundList);
+ break;
+ }
+
+ case TYPE_BUFFER_SPECIFIER:
+ {
+ searchBufferInstanceByQualifiedNameID(aQualifiedNameID, foundList);
+ break;
+ }
+
+ case TYPE_CONNECTOR_SPECIFIER:
+ {
+ searchConnectorInstanceByQualifiedNameID(aQualifiedNameID, foundList);
+ break;
+ }
+
+
+ case TYPE_BOOLEAN_SPECIFIER:
+
+ case TYPE_POS_INTEGER_SPECIFIER:
+ case TYPE_UINTEGER_SPECIFIER:
+ case TYPE_INTEGER_SPECIFIER:
+
+ case TYPE_URATIONAL_SPECIFIER:
+ case TYPE_RATIONAL_SPECIFIER:
+
+ case TYPE_UFLOAT_SPECIFIER:
+ case TYPE_FLOAT_SPECIFIER:
+
+ case TYPE_UREAL_SPECIFIER:
+ case TYPE_REAL_SPECIFIER:
+
+ case TYPE_ENUM_SPECIFIER:
+
+ case TYPE_CHARACTER_SPECIFIER:
+ case TYPE_STRING_SPECIFIER:
+
+ case TYPE_CLOCK_SPECIFIER:
+ case TYPE_TIME_SPECIFIER:
+ case TYPE_CONTINUOUS_TIME_SPECIFIER:
+ case TYPE_DISCRETE_TIME_SPECIFIER:
+
+ case TYPE_INTERVAL_SPECIFIER:
+ case TYPE_OPERATOR_SPECIFIER:
+ case TYPE_AVMCODE_SPECIFIER:
+ case TYPE_MESSAGE_SPECIFIER:
+ {
+ searchDataInstanceByQualifiedNameID(aQualifiedNameID, foundList);
+
+ if( foundList.empty() )
+ {
+ searchPortInstanceByQualifiedNameID(aQualifiedNameID, foundList);
+
+ searchMachineInstanceByQualifiedNameID(aQualifiedNameID, foundList);
+
+ searchBufferInstanceByQualifiedNameID(aQualifiedNameID, foundList);
+
+ searchConnectorInstanceByQualifiedNameID(aQualifiedNameID, foundList);
+ }
+ break;
+ }
+
+ default:
+ {
+ searchDataInstanceByQualifiedNameID(aQualifiedNameID, foundList);
+
+ searchPortInstanceByQualifiedNameID(aQualifiedNameID, foundList);
+
+ searchMachineInstanceByQualifiedNameID(aQualifiedNameID, foundList);
+
+ searchBufferInstanceByQualifiedNameID(aQualifiedNameID, foundList);
+
+ searchConnectorInstanceByQualifiedNameID(aQualifiedNameID, foundList);
+
+ break;
+ }
+ }
+
+ if( foundList.empty() )
+ {
+ searchDataInstanceByNameID(aQualifiedNameID, foundList);
+ }
+}
+
+
+/**
+ * SEARCH
+ * for DataFactory, Port or Machine
+ */
+const BF & SymbolTable::searchInstance(
+ COMPILE_CONTEXT * aCTX, const ObjectElement * objElement)
+{
+ // CASE form is a PORT
+ if( objElement->is< Port >() )
+ {
+ const Symbol & foundInstance = XQuery.getSemPortByAstElement(
+ aCTX->mCompileCtx->getExecutable(), objElement);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ // CASE form is a [STATE]MACHINE
+ if( objElement->is< Machine >() )
+ {
+ {
+ const Symbol & foundInstance =
+ searchInstanceStatic(aCTX, objElement);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+ {
+ const Symbol & foundInstance =
+ searchInstanceModel(aCTX, objElement);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ return( searchInstanceStatic(objElement) );
+ }
+
+ // CASE form is a BUFFER
+ if( objElement->is< Buffer >() )
+ {
+ const Symbol & foundInstance = searchBufferInstance(
+ aCTX->mCompileCtx->getExecutable(), objElement);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+
+ // CASE form is a CONNECT
+ if( objElement->is< Connector >() )
+ {
+ const Symbol & foundInstance = searchConnectorInstance(
+ aCTX->mCompileCtx->getExecutable(), objElement);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ {
+ const BF & foundInstance = searchDataInstance(aCTX, objElement);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ // For the Case of undetected TYPE
+ {
+ const Symbol & foundInstance = searchInstanceStatic(objElement);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+
+const BF & SymbolTable::searchInstance(COMPILE_CONTEXT * aCTX,
+ const std::string & aFullyQualifiedNameID)
+{
+ // CASE element is a PORT
+ if( aCTX->typeMustBePortFamily() )
+ {
+ const Symbol & foundInstance = XQuery.getSemPort(
+ aCTX->mCompileCtx->getExecutable(), aFullyQualifiedNameID);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ // CASE element is a [STATE]MACHINE
+ if( aCTX->typeMustBeMachineFamily() )
+ {
+ const Symbol & foundInstance =
+ searchInstanceStatic(aFullyQualifiedNameID);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ // CASE element is a BUFFER
+ if( aCTX->typeMustBeBufferFamily() )
+ {
+ const Symbol & foundInstance = searchBufferInstance(
+ aCTX->mCompileCtx->getExecutable(), aFullyQualifiedNameID);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+
+ // CASE element is a CONNECT
+ if( aCTX->typeMustBeConnectorFamily() )
+ {
+ const Symbol & foundInstance = searchConnectorInstance(
+ aCTX->mCompileCtx->getExecutable(), aFullyQualifiedNameID);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ // CASE element is anything ELSE
+ // UNCONDITIONAL
+ {
+ const BF & foundInstance =
+ searchDataInstance(aCTX, aFullyQualifiedNameID);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+/*
+ * SEARCH
+ * Program for a given FORM
+ */
+const BF & SymbolTable::searchTransition(
+ COMPILE_CONTEXT * aCTX, const ObjectElement * objElement) const
+{
+ ExecutableForm * anExec = aCTX->mCompileCtx->getExecutable();
+ for( ; anExec != NULL ; anExec = anExec->getExecutableContainer() )
+ {
+ const BF & tmpTransition =
+ anExec->getTransitionByAstElement(objElement);
+ if( tmpTransition.valid() )
+ {
+ return( tmpTransition );
+ }
+ }
+
+ {
+ const BF & aTransition = searchTransition(objElement);
+ if( aTransition.valid() )
+ {
+ return( aTransition );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+const BF & SymbolTable::searchTransition(
+ COMPILE_CONTEXT * aCTX, const std::string & aFullyQualifiedNameID) const
+{
+ ExecutableForm * anExec = aCTX->mCompileCtx->getExecutable();
+
+ for( ; anExec != NULL ; anExec = anExec->getExecutableContainer() )
+ {
+ const BF & tmpTransition = anExec->getTransition(aFullyQualifiedNameID);
+ if( tmpTransition.valid() )
+ {
+ return( tmpTransition );
+ }
+ }
+
+ {
+ const BF & aTransition = searchTransition(aFullyQualifiedNameID);
+ if( aTransition.valid() )
+ {
+ return( aTransition );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+const BF & SymbolTable::searchTransitionByNameID(
+ COMPILE_CONTEXT * aCTX, const std::string & aNameID) const
+{
+ ExecutableForm * anExec = aCTX->mCompileCtx->getExecutable();
+
+ for( ; anExec != NULL ; anExec = anExec->getExecutableContainer() )
+ {
+ const BF & tmpTransition = anExec->getTransitionByNameID(aNameID);
+ if( tmpTransition.valid() )
+ {
+ return( tmpTransition );
+ }
+ }
+
+ {
+ const BF & aTransition = searchTransitionByNameID(aNameID);
+ if( aTransition.valid() )
+ {
+ return( aTransition );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+const BF & SymbolTable::searchProgram(
+ COMPILE_CONTEXT * aCTX, const ObjectElement * objElement) const
+{
+ ExecutableForm * anExec = aCTX->mCompileCtx->getExecutable();
+ for( ; anExec != NULL ; anExec = anExec->getExecutableContainer() )
+ {
+ const BF & tmpProgram = anExec->getProgramByAstElement(objElement);
+ if( tmpProgram.valid() )
+ {
+ return( tmpProgram );
+ }
+ }
+
+ {
+ const BF & aProgram = searchProgram(objElement);
+ if( aProgram.valid() )
+ {
+ return( aProgram );
+ }
+ }
+
+ return( searchExecutable(objElement) );
+}
+
+
+const BF & SymbolTable::searchProgram(
+ COMPILE_CONTEXT * aCTX, const std::string & aFullyQualifiedNameID) const
+{
+ ExecutableForm * anExec = aCTX->mCompileCtx->getExecutable();
+
+ for( ; anExec != NULL ; anExec = anExec->getExecutableContainer() )
+ {
+ const BF & tmpProgram = anExec->getProgram(aFullyQualifiedNameID);
+ if( tmpProgram.valid() )
+ {
+ return( tmpProgram );
+ }
+ }
+
+ {
+ const BF & aProgram = searchProgram(aFullyQualifiedNameID);
+ if( aProgram.valid() )
+ {
+ return( aProgram );
+ }
+ }
+
+ return( searchExecutable(aFullyQualifiedNameID) );
+}
+
+
+const BF & SymbolTable::searchProgramByNameID(
+ COMPILE_CONTEXT * aCTX, const std::string & aNameID) const
+{
+ ExecutableForm * anExec = aCTX->mCompileCtx->getExecutable();
+
+ for( ; anExec != NULL ; anExec = anExec->getExecutableContainer() )
+ {
+ const BF & tmpProgram = anExec->getProgramByNameID(aNameID);
+ if( tmpProgram.valid() )
+ {
+ return( tmpProgram );
+ }
+ }
+
+ {
+ const BF & aProgram = searchProgramByNameID(aNameID);
+ if( aProgram.valid() )
+ {
+ return( aProgram );
+ }
+ }
+
+ return( searchExecutableByNameID(aNameID) );
+}
+
+
+/*
+ * SEARCH
+ * Executable of the MODEL for a given FORM
+ */
+ExecutableForm * SymbolTable::searchExecutableModel(const Machine * aMachine)
+{
+ // RESET ERROR
+ resetError();
+
+ const BF & aModel = aMachine->getType();
+ if( aModel.is< Machine >() )
+ {
+ if( aModel.to_ptr< Machine >()->getSpecifier().hasDesignModel() )
+ {
+ return( searchExecutable(aModel.to_ptr< Machine >()).
+ to_ptr< ExecutableForm >() );
+ }
+ else
+ {
+ return( searchExecutableModel(aModel.to_ptr< Machine >()) );
+ }
+ }
+ else if( aModel.is< Identifier >() )
+ {
+ std::string aNameID = aModel.to_ptr< Identifier >()->getValue();
+
+ const BF & foundExec = searchExecutableByNameID(aNameID);
+
+ return( foundExec.valid() ?
+ foundExec.as_ptr< ExecutableForm >() : NULL );
+ }
+
+ else
+ {
+ std::string aQualifiedNameID = aModel.is< QualifiedIdentifier >()
+ ? aModel.to_ptr< QualifiedIdentifier >()->getValue()
+ : ( aModel.is< UniFormIdentifier >()
+ ? aModel.to_ptr< UniFormIdentifier >()->toStringLocation()
+ : aModel.str() );
+
+ const BF & foundExec =
+ searchExecutableByQualifiedNameID( aQualifiedNameID );
+
+ return( foundExec.valid() ?
+ foundExec.as_ptr< ExecutableForm >() : NULL );
+ }
+}
+
+
+/**
+ * SEARCH SYMBOL
+ * for DataFactory, Port, Machine, Executable
+ */
+const BF & SymbolTable::searchSymbol(COMPILE_CONTEXT * aCTX,
+ const ObjectElement * objElement)
+{
+ {
+ const BF & theSymbol = searchInstance(aCTX, objElement);
+ if( theSymbol.valid() )
+ {
+ return( theSymbol );
+ }
+ }
+
+ {
+ const BF & theSymbol = searchTransition(aCTX, objElement);
+ if( theSymbol.valid() )
+ {
+ return( theSymbol );
+ }
+ }
+ {
+ const BF & theSymbol = searchProgram(aCTX, objElement);
+ if( theSymbol.valid() )
+ {
+ return( theSymbol );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+const BF & SymbolTable::searchSymbol(COMPILE_CONTEXT * aCTX,
+ const std::string & aFullyQualifiedNameID)
+{
+ {
+ const BF & theSymbol = searchInstance(aCTX, aFullyQualifiedNameID);
+ if( theSymbol.valid() )
+ {
+ return( theSymbol );
+ }
+ }
+
+ {
+ const BF & theSymbol = searchTransition(aCTX, aFullyQualifiedNameID);
+ if( theSymbol.valid() )
+ {
+ return( theSymbol );
+ }
+ }
+
+ {
+ const BF & theSymbol = searchProgram(aCTX, aFullyQualifiedNameID);
+ if( theSymbol.valid() )
+ {
+ return( theSymbol );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+BF SymbolTable::searchSymbolByUFI(
+ COMPILE_CONTEXT * aCTX, const UniFormIdentifier & anUFI)
+{
+ UniFormIdentifier::const_iterator it = anUFI.begin();
+ UniFormIdentifier::const_iterator itEnd = anUFI.end();
+
+ std::ostringstream ossUFI;
+ const ObjectElement * TheMainObjectElement = NULL;
+
+ BF bfInstance;
+ InstanceOfMachine * theInstanceMachine;
+
+ // CHECKING ROOT MACHINE INSTANCE
+ if( (*it).is< ObjectElement >() )
+ {
+ TheMainObjectElement = (*it).to_ptr< ObjectElement >();
+
+ if( (bfInstance = searchInstanceStatic(TheMainObjectElement)).valid() )
+ {
+ theInstanceMachine = bfInstance.to_ptr< InstanceOfMachine >();
+ }
+ else
+ {
+ incrErrorCount();
+ ERROR_OS << "Unfound the main form < "
+ << TheMainObjectElement->getFullyQualifiedNameID()
+ << " > of UFI < " << anUFI.str() << " > in the system << "
+ << mConfiguration.getExecutableSystem().rawSystemInstance()
+ ->getAstElement()->getFullyQualifiedNameID() << " >>"
+ << std::endl;
+
+ return( BF::REF_NULL );
+ }
+ }
+ else
+ {
+ ossUFI << anUFI.toStringLocator()
+ << FQN_ID_ROOT_SEPARATOR << (*it).str();
+
+ theInstanceMachine =
+ mConfiguration.getExecutableSystem().rawSystemInstance();
+ TheMainObjectElement = theInstanceMachine->getAstElement();
+ if( (TheMainObjectElement != NULL)
+ && TheMainObjectElement->fqnEquals( ossUFI.str() ) )
+ {
+ if( it == itEnd )
+ {
+ return( mConfiguration.getExecutableSystem().getSystemInstance() );
+ }
+ }
+ else
+ {
+ incrErrorCount();
+ ERROR_OS << "Unfound the main form < "
+ << ossUFI.str() << " > of UFI < "
+ << anUFI.str() << " > in the system << "
+ << mConfiguration.getExecutableSystem().rawSystemInstance()
+ ->getAstElement()->getFullyQualifiedNameID() << " >>"
+ << std::endl;
+
+ return( BF::REF_NULL );
+ }
+ }
+
+ ossUFI.str("");
+ ossUFI << theInstanceMachine->getFullyQualifiedNameID();
+
+ // CHECKING MAIN MACHINE INSTANCE
+ for( ++it ; it != itEnd ; ++it )
+ {
+ if( (*it).isIdentifier() )
+ {
+ ossUFI << '.' << (*it).str();
+
+ bfInstance = theInstanceMachine->getExecutable()->
+ getInstanceStatic().getByFQNameID( ossUFI.str() );
+
+ if( bfInstance.invalid() )
+ {
+ bfInstance = theInstanceMachine->getExecutable()->
+ getInstanceStatic().getByNameID( (*it).str() );
+ }
+
+ if( bfInstance.valid() )
+ {
+ theInstanceMachine = bfInstance.to_ptr< InstanceOfMachine >();
+
+ continue;
+ }
+ }
+ else if( (*it).is< ObjectElement >() )
+ {
+ if( (*it).to_ptr< ObjectElement >()->getContainer()
+ == TheMainObjectElement )
+ {
+ TheMainObjectElement = (*it).to_ptr< ObjectElement >();
+
+ if( (bfInstance = theInstanceMachine->getExecutable()->
+ getByAstInstanceStatic(TheMainObjectElement)).valid() )
+ {
+ theInstanceMachine = bfInstance.to_ptr< InstanceOfMachine >();
+
+ ossUFI.str("");
+ ossUFI << theInstanceMachine->getFullyQualifiedNameID();
+
+ continue;
+ }
+ }
+ else
+ {
+ incrErrorCount();
+ ERROR_OS << "MissFormed UFI < "
+ << anUFI.str() << " > : the field < "
+ << (*it).to_ptr<
+ ObjectElement >()->getFullyQualifiedNameID()
+ << " > container is not < "
+ << TheMainObjectElement->getFullyQualifiedNameID()
+ << " > !!!" << std::endl;
+
+ return( BF::REF_NULL );
+ }
+ }
+ else
+ {
+ incrErrorCount();
+ ERROR_OS << "Unexpected < " << it->str()
+ << " > as field of the UFI < "
+ << anUFI.str() << " > !!!"
+ << std::endl;
+
+ return( BF::REF_NULL );
+ }
+
+ break;
+ }
+
+ if( bfInstance.valid() )
+ {
+ if( it == itEnd )
+ {
+ return( bfInstance );
+ }
+
+ // CHECKING FOR MAIN MACHINE
+ ossUFI.str("");
+ ossUFI << theInstanceMachine->getFullyQualifiedNameID();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it).isUfid() )
+ {
+ ossUFI << '.' << it->str();
+ }
+ else
+ {
+ incrErrorCount();
+ ERROR_OS << "Unexpected < " << it->str()
+ << " > as field of the UFI < " << anUFI.str()
+ << " > !!!" << std::endl;
+
+ return( BF::REF_NULL );
+ }
+ }
+
+ const BF & aSymbol = theInstanceMachine->getExecutable()->
+ getSymbol(ossUFI.str(), aCTX->getTypeFamily());
+ if( aSymbol.valid() )
+ {
+ return( aSymbol );
+ }
+ else
+ {
+ incrErrorCount();
+ ERROR_OS << "Unfound a runtime symbol for the UFI < "
+ << anUFI.str() << " >" << std::endl;
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+const BF & SymbolTable::searchSemSymbol(
+ COMPILE_CONTEXT * aCTX, const ObjectElement * astElement) const
+{
+ BaseAvmProgram * aProgram = aCTX->mCompileCtx;
+ for( ; aProgram != NULL ; aProgram = aProgram->getContainer() )
+ {
+ const BF & theSymbol =
+ aProgram->getSymbolByAstElement(astElement, aCTX->getTypeFamily());
+ if( theSymbol.valid() )
+ {
+ return( theSymbol );
+ }
+ }
+
+ if( aCTX->mRuntimeCtx != aCTX->mCompileCtx )
+ {
+ aProgram = aCTX->mRuntimeCtx;
+ for( ; aProgram != NULL ; aProgram = aProgram->getContainer() )
+ {
+ const BF & theSymbol = aProgram->
+ getSymbolByAstElement(astElement, aCTX->getTypeFamily());
+ if( theSymbol.valid() )
+ {
+ return( theSymbol );
+ }
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+const BF & SymbolTable::searchSemSymbolByQualifiedNameID(
+ COMPILE_CONTEXT * aCTX, const std::string & aQualifiedNameID) const
+{
+ BaseAvmProgram * aProgram = aCTX->mCompileCtx;
+ for( ; aProgram != NULL ; aProgram = aProgram->getContainer() )
+ {
+ const BF & theSymbol = aProgram->getSymbolByQualifiedNameID(
+ aQualifiedNameID, aCTX->getTypeFamily());
+ if( theSymbol.valid() )
+ {
+ return( theSymbol );
+ }
+ }
+
+ if( aCTX->mRuntimeCtx != aCTX->mCompileCtx )
+ {
+ aProgram = aCTX->mRuntimeCtx;
+ for( ; aProgram != NULL ; aProgram = aProgram->getContainer() )
+ {
+ const BF & theSymbol = aProgram->getSymbolByQualifiedNameID(
+ aQualifiedNameID, aCTX->getTypeFamily());
+ if( theSymbol.valid() )
+ {
+ return( theSymbol );
+ }
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+const BF & SymbolTable::searchSemSymbolByNameID(
+ COMPILE_CONTEXT * aCTX, const std::string & aNameID) const
+{
+ BaseAvmProgram * aProgram = aCTX->mCompileCtx;
+ for( ; aProgram != NULL ; aProgram = aProgram->getContainer() )
+ {
+ const BF & theSymbol =
+ aProgram->getSymbolByNameID(aNameID, aCTX->getTypeFamily());
+ if( theSymbol.valid() )
+ {
+ return( theSymbol );
+ }
+ }
+
+ if( aCTX->mRuntimeCtx != aCTX->mCompileCtx )
+ {
+ aProgram = aCTX->mRuntimeCtx;
+ for( ; aProgram != NULL ; aProgram = aProgram->getContainer() )
+ {
+ const BF & theSymbol = aProgram->
+ getSymbolByNameID(aNameID, aCTX->getTypeFamily());
+ if( theSymbol.valid() )
+ {
+ return( theSymbol );
+ }
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+// TODO Optimize searchSymbolByQualifiedNameID
+BF SymbolTable::searchSymbolByQualifiedNameID(
+ COMPILE_CONTEXT * aCTX, const std::string & aQualifiedNameID)
+{
+ {
+ const BF & theSymbol =
+ searchSemSymbolByQualifiedNameID(aCTX, aQualifiedNameID);
+ if( theSymbol.valid() )
+ {
+ return( theSymbol );
+ }
+ }
+
+ ListOfString listOfId;
+ avm_size_t idCount = NamedElement::collectNameID(listOfId, aQualifiedNameID);
+ if( idCount == 2 )
+ {
+ const Symbol & aMachine = aCTX->mCompileCtx->getExecutable()
+ ->getInstanceStatic().getByNameID(listOfId.first());
+ if( aMachine.valid() )
+ {
+ const BF & theSymbol = aMachine.getExecutable()->
+ getSymbolByNameID(listOfId.second(), aCTX->getTypeFamily());
+ if( theSymbol.valid() )
+ {
+ if( theSymbol.is< BaseInstanceForm >() )
+ {
+ return( createAliasIfNotAccessible(
+ aCTX, aMachine.rawMachine(), theSymbol) );
+ }
+
+ return( theSymbol );
+ }
+ }
+ }
+
+ BFList foundList;
+ searchInstanceByQualifiedNameID(aCTX, aQualifiedNameID, foundList);
+ if( foundList.singleton() )
+ {
+ return( foundList.pop_first() );
+ }
+ else if( foundList.populated() )
+ {
+ incrErrorCount();
+ ERROR_OS << "Indeterminism:> found too many element < "
+ << aQualifiedNameID << " > from "
+ << ( aCTX->mCompileCtx->is< ExecutableForm >() ?
+ "executable" : "program" )
+ << " < " << aCTX->mCompileCtx->getFullyQualifiedNameID()
+ << " > !!!";
+ while( foundList.nonempty() )
+ {
+ ERROR_OS << "\n\tFound :> " << str_header( foundList.pop_first() );
+ }
+
+ return( BF::REF_NULL );
+ }
+
+ {
+ const BF & theSymbol = searchTransition(aCTX, aQualifiedNameID);
+ if( theSymbol.valid() )
+ {
+ return( theSymbol );
+ }
+ }
+ {
+ const BF & theSymbol = searchProgram(aCTX, aQualifiedNameID);
+ if( theSymbol.valid() )
+ {
+ return( theSymbol );
+ }
+ }
+
+ {
+ const BF & theSymbol = searchInstanceStatic(aQualifiedNameID);
+ if( theSymbol.valid() )
+ {
+ return( theSymbol );
+ }
+ }
+ return( BF::REF_NULL );
+}
+
+
+BF SymbolTable::searchSymbolByNameID(
+ COMPILE_CONTEXT * aCTX, const std::string & aNameID)
+{
+ {
+ const BF & theSymbol = searchSemSymbolByNameID(aCTX, aNameID);
+ if( theSymbol.valid() )
+ {
+ return( theSymbol );
+ }
+ }
+
+ BFList foundList;
+ searchInstanceByNameID(aCTX, aNameID, foundList);
+ if( foundList.singleton() )
+ {
+ return( foundList.pop_first() );
+ }
+ else if( foundList.populated() )
+ {
+ incrErrorCount();
+ ERROR_OS << "Indeterminism:> found too many element < " << aNameID
+ << " > from " << ( aCTX->mCompileCtx->is< ExecutableForm >() ?
+ "executable" : "program" )
+ << " < " << aCTX->mCompileCtx->getFullyQualifiedNameID() << " > !!!";
+ while( foundList.nonempty() )
+ {
+ ERROR_OS << "\n\tFound :> " << str_header( foundList.pop_first() );
+ }
+
+ return( BF::REF_NULL );
+ }
+
+ {
+ const BF & theSymbol = searchMachineInstanceByNameID(aCTX, aNameID);
+ if( theSymbol.valid() )
+ {
+ return( theSymbol );
+ }
+ }
+ {
+ const BF & theSymbol = searchInstanceModelByNameID(aCTX, aNameID);
+ if( theSymbol.valid() )
+ {
+ return( theSymbol );
+ }
+ }
+
+ {
+ const BF & theSymbol = searchTransitionByNameID(aCTX, aNameID);
+ if( theSymbol.valid() )
+ {
+ return( theSymbol );
+ }
+ }
+ {
+ const BF & theSymbol = searchProgramByNameID(aCTX, aNameID);
+ if( theSymbol.valid() )
+ {
+ return( theSymbol );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+BF SymbolTable::createAliasIfNotAccessible(COMPILE_CONTEXT * aCTX,
+ InstanceOfMachine * aContainerInstance, const BF & bfInstance)
+{
+ if( not aContainerInstance->getSpecifier().isDesignInstanceStatic() )
+ {
+ return( createAliasIfNotAccessible(aCTX, bfInstance) );
+ }
+
+ ExecutableForm * anExecutable = aCTX->mCompileCtx->getExecutable();
+
+ const ExecutableForm * lcaExecutable = anExecutable->LCRA(
+ aContainerInstance->getContainer()->getExecutable() );
+
+ if( lcaExecutable != NULL )
+ {
+ BaseInstanceForm * ptrInstance = bfInstance.to_ptr< BaseInstanceForm >();
+
+ std::string fqnPrefix = lcaExecutable->getAstFullyQualifiedNameID();
+
+ ListOfString strList;
+ NamedElement::collectNameID(strList,
+ aContainerInstance->getAstFullyQualifiedNameID() + '.' +
+ ptrInstance->getNameID(), fqnPrefix);
+
+ VectorOfInstanceOfMachine theInstanceOfMachinePath;
+
+ while( strList.populated() )
+ {
+ fqnPrefix = fqnPrefix + '.' + strList.pop_first();
+
+ const Symbol & execInstance = lcaExecutable->getInstanceStatic().
+ getByFQNameID( fqnPrefix );
+ if( execInstance.valid() )
+ {
+ theInstanceOfMachinePath.append(execInstance.rawMachine());
+ lcaExecutable = execInstance.getExecutable();
+ }
+ else
+ {
+ if( lcaExecutable->getAllData().getByFQNameID( fqnPrefix ).valid()
+ || lcaExecutable->getBuffer().getByFQNameID( fqnPrefix ).valid()
+ || lcaExecutable->getPort().getByFQNameID( fqnPrefix ).valid()
+ || lcaExecutable->getConnect().getByFQNameID( fqnPrefix ).valid() )
+ {
+ lcaExecutable = NULL;
+ }
+ break;
+ }
+ }
+
+ if( lcaExecutable != NULL )
+ {
+// if( theInstanceOfMachinePath.last() != aContainerInstance )
+// {
+// theInstanceOfMachinePath.append(aContainerInstance);
+// }
+
+ Symbol newInstance;
+
+ switch ( ptrInstance->classKind() )
+ {
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ if( lcaExecutable->containsAllData(
+ bfInstance.to_ptr< InstanceOfData >()) )
+ {
+ newInstance = new InstanceOfData(anExecutable,
+ ptrInstance->to< InstanceOfData >(),
+ theInstanceOfMachinePath);
+ }
+
+ break;
+ }
+
+ case FORM_INSTANCE_MACHINE_KIND:
+ {
+ if( lcaExecutable->getInstanceStatic().contains(bfInstance) )
+ {
+ newInstance = new InstanceOfMachine( anExecutable,
+ ptrInstance->to< InstanceOfMachine >(),
+ theInstanceOfMachinePath);
+ }
+ break;
+ }
+
+ case FORM_INSTANCE_PORT_KIND:
+ {
+ if( lcaExecutable->getPort().contains(bfInstance) )
+ {
+ newInstance = new InstanceOfPort(anExecutable,
+ ptrInstance->to< InstanceOfPort >(),
+ theInstanceOfMachinePath);
+ }
+ break;
+ }
+
+ case FORM_INSTANCE_BUFFER_KIND:
+ {
+ if( lcaExecutable->getBuffer().contains(bfInstance) )
+ {
+ newInstance = new InstanceOfBuffer(anExecutable,
+ ptrInstance->to< InstanceOfBuffer >(),
+ theInstanceOfMachinePath);
+ }
+ break;
+ }
+
+ case FORM_INSTANCE_CONNECTOR_KIND:
+ {
+ if( lcaExecutable->getConnect().contains(bfInstance) )
+ {
+ newInstance = new InstanceOfConnect(anExecutable,
+ ptrInstance->to< InstanceOfConnect >(),
+ theInstanceOfMachinePath);
+ }
+ break;
+ }
+
+ default :
+ {
+ break;
+ }
+ }
+
+ if( newInstance != NULL )
+ {
+ newInstance.setFullyQualifiedNameID( "alias"
+ + aContainerInstance->getFullyQualifiedNameID().substr(
+ aContainerInstance->getFullyQualifiedNameID().find(':'))
+ + "." + ptrInstance->getNameID() );
+
+ if( not newInstance.getModifier().
+ isVisibilityPublic( aCTX->getModifier() ) )
+ {
+ incrErrorCount();
+ ERROR_OS << "Failed to create ALIAS for a non PUBLIC instance << "
+ << str_header( ptrInstance ) << " >> !!!";
+ }
+
+ if( newInstance.is< InstanceOfData >() )
+ {
+ aCTX->mCompileCtx->getExecutable()->appendDataAlias(newInstance);
+ }
+ else
+ {
+ aCTX->mCompileCtx->getExecutable()->appendAlias(newInstance);
+ }
+
+ return( newInstance );
+ }
+ else
+ {
+ incrErrorCount();
+ ERROR_OS << "Failed to create ALIAS for instance << "
+ << str_header( ptrInstance ) << " >> !!!";
+ }
+ }
+ }
+
+ return( bfInstance );
+}
+
+
+BF SymbolTable::createAliasIfNotAccessible(
+ COMPILE_CONTEXT * aCTX, const BF & bfInstance)
+{
+ BaseInstanceForm * ptrInstance = bfInstance.to_ptr< BaseInstanceForm >();
+
+ for( BaseAvmProgram * tmpProgram = aCTX->mCompileCtx ; tmpProgram != NULL ;
+ tmpProgram = tmpProgram->getContainer() )
+ {
+ if( tmpProgram == ptrInstance->getContainer() )
+ {
+ return( bfInstance );
+ }
+ }
+
+ ExecutableForm * anExecutable = aCTX->mCompileCtx->getExecutable();
+
+ const ExecutableForm * lcaExecutable = anExecutable->LCRA(
+ ptrInstance->getContainer()->getExecutable() );
+
+ if( lcaExecutable != NULL )
+ {
+ std::string fqnPrefix = lcaExecutable->getAstFullyQualifiedNameID();
+
+ ListOfString strList;
+ NamedElement::collectNameID(strList,
+ ptrInstance->getAstFullyQualifiedNameID(), fqnPrefix);
+
+ VectorOfInstanceOfMachine theInstanceOfMachinePath;
+
+ while( strList.populated() )
+ {
+ fqnPrefix = fqnPrefix + '.' + strList.pop_first();
+
+ const Symbol & execInstance =
+ lcaExecutable->getInstanceStatic().getByFQNameID( fqnPrefix );
+ if( execInstance.valid() )
+ {
+ theInstanceOfMachinePath.append(execInstance.rawMachine());
+ lcaExecutable = execInstance.getExecutable();
+ }
+ else
+ {
+ if( lcaExecutable->getAllData().getByFQNameID( fqnPrefix ).valid()
+ || lcaExecutable->getBuffer().getByFQNameID(fqnPrefix ).valid()
+ || lcaExecutable->getPort().getByFQNameID(fqnPrefix ).valid()
+ || lcaExecutable->getConnect().getByFQNameID(fqnPrefix ).valid() )
+ {
+ lcaExecutable = NULL;
+ }
+ break;
+ }
+ }
+
+ if( lcaExecutable != NULL )
+ {
+ Symbol newInstance;
+
+ switch ( bfInstance.classKind() )
+ {
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ if( lcaExecutable->containsAllData(
+ bfInstance.to_ptr< InstanceOfData >()) )
+ {
+ newInstance = new InstanceOfData(anExecutable,
+ ptrInstance->to< InstanceOfData >(),
+ theInstanceOfMachinePath);
+ }
+
+ break;
+ }
+
+ case FORM_INSTANCE_MACHINE_KIND:
+ {
+ if( lcaExecutable->getInstanceStatic().contains(bfInstance) )
+ {
+ newInstance = new InstanceOfMachine(anExecutable,
+ ptrInstance->to< InstanceOfMachine >(),
+ theInstanceOfMachinePath);
+ }
+ break;
+ }
+
+ case FORM_INSTANCE_PORT_KIND:
+ {
+ if( lcaExecutable->getPort().contains(bfInstance) )
+ {
+ newInstance = new InstanceOfPort(anExecutable,
+ ptrInstance->to< InstanceOfPort >(),
+ theInstanceOfMachinePath);
+ }
+ break;
+ }
+
+ case FORM_INSTANCE_BUFFER_KIND:
+ {
+ if( lcaExecutable->getBuffer().contains(bfInstance) )
+ {
+ newInstance = new InstanceOfBuffer(anExecutable,
+ ptrInstance->to< InstanceOfBuffer >(),
+ theInstanceOfMachinePath);
+ }
+ break;
+ }
+
+ case FORM_INSTANCE_CONNECTOR_KIND:
+ {
+ if( lcaExecutable->getConnect().contains(bfInstance) )
+ {
+ newInstance = new InstanceOfConnect(anExecutable,
+ ptrInstance->to< InstanceOfConnect >(),
+ theInstanceOfMachinePath);
+ }
+ break;
+ }
+
+ default :
+ {
+ break;
+ }
+ }
+
+ if( newInstance.valid() )
+ {
+ newInstance.setFullyQualifiedNameID( "alias" +
+ ptrInstance->getFullyQualifiedNameID().substr(
+ ptrInstance->getFullyQualifiedNameID().find(':')) );
+
+ if( not newInstance.getModifier().
+ isVisibilityPublic( aCTX->getModifier() ) )
+ {
+ incrErrorCount();
+ ERROR_OS << "Failed to create ALIAS for a non PUBLIC instance << "
+ << str_header( ptrInstance ) << " >> !!!";
+ }
+
+ if( newInstance.is< InstanceOfData >() )
+ {
+ aCTX->mCompileCtx->getExecutable()->appendDataAlias(newInstance);
+ }
+ else
+ {
+ aCTX->mCompileCtx->getExecutable()->appendAlias(newInstance);
+ }
+
+ return( newInstance );
+ }
+ else
+ {
+ incrErrorCount();
+ ERROR_OS << "Failed to create ALIAS for instance << "
+ << str_header( ptrInstance ) << " >> !!!";
+ }
+ }
+ }
+
+ return( bfInstance );
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/builder/compiler/SymbolTable.h b/org.eclipse.efm.symbex/src/builder/compiler/SymbolTable.h
new file mode 100644
index 0000000..fb409d4
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/compiler/SymbolTable.h
@@ -0,0 +1,923 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef BUILDER_COMPILER_SYMBOLTABLE_H_
+#define BUILDER_COMPILER_SYMBOLTABLE_H_
+
+#include <builder/compiler/SymbolPredicate.h>
+
+#include <collection/Typedef.h>
+#include <collection/BFContainer.h>
+
+#include <fml/executable/ExecutableQuery.h>
+#include <fml/executable/InstanceOfData.h>
+#include <fml/executable/InstanceOfMachine.h>
+
+#include <fml/symbol/Symbol.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+
+
+namespace sep
+{
+
+
+class COMPILE_CONTEXT;
+
+class Configuration;
+
+class ExecutableForm;
+class ExecutableSystem;
+
+class InstanceOfBuffer;
+class InstanceOfPort;
+
+class ObjectElement;
+
+class Machine;
+class Port;
+
+class TypeSpecifier;
+
+class UniFormIdentifier;
+
+
+
+class SymbolTable
+{
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ Configuration & mConfiguration;
+
+ ListOfSymbol mListOfInstanceStatic;
+
+ ListOfSymbol mListOfPortInstance;
+
+ ListOfSymbol mListOfBufferInstance;
+
+ ListOfSymbol mListOfConnectorInstance;
+
+ ListOfSymbol mListOfDataInstance;
+
+
+ BFList mListOfMachineExecutable;
+
+ BFList mListOfAvmTransition;
+
+ BFList mListOfAvmProgram;
+
+ ExecutableQuery XQuery;
+
+
+ avm_size_t mErrorCount;
+
+ avm_size_t mWarningCount;
+
+ StringOutStream ERROR_OS;
+
+ StringOutStream WARNING_OS;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ SymbolTable(Configuration & aConfiguration)
+ : mConfiguration( aConfiguration ),
+ XQuery( mConfiguration ),
+ mErrorCount( 0 ),
+ mWarningCount(0),
+ ERROR_OS(),
+ WARNING_OS()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ SymbolTable(const SymbolTable & aSymbolTable)
+ : mConfiguration( aSymbolTable.mConfiguration ),
+ XQuery( mConfiguration ),
+ mErrorCount( aSymbolTable.mErrorCount ),
+ mWarningCount(aSymbolTable.mWarningCount ),
+ ERROR_OS(),
+ WARNING_OS()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~SymbolTable()
+ {
+ //!! NOTHING
+ }
+
+
+ /*
+ * SETTER
+ * mExecutableSystem
+ */
+ inline void setSymbolTable(SymbolTable & aSymbolTable)
+ {
+ mListOfInstanceStatic.append( aSymbolTable.mListOfInstanceStatic );
+
+ mListOfPortInstance.append( aSymbolTable.mListOfPortInstance );
+
+ mListOfBufferInstance.append( aSymbolTable.mListOfBufferInstance );
+
+ mListOfConnectorInstance.append( aSymbolTable.mListOfConnectorInstance );
+
+ mListOfDataInstance.append( aSymbolTable.mListOfDataInstance );
+
+ mListOfAvmTransition.append( aSymbolTable.mListOfAvmTransition );
+
+ mListOfAvmProgram.append( aSymbolTable.mListOfAvmProgram );
+ }
+
+
+ /**
+ * SEARCH
+ * for Port
+ */
+ InstanceOfPort * searchPortConnectorInstance(
+ ExecutableForm * anExecutable, const ObjectElement * aPort) const;
+
+ InstanceOfPort * searchPortConnectorInstance(
+ ExecutableForm * anExecutable,
+ const std::string & aFullyQualifiedNameID) const;
+
+
+ const Symbol & searchPortSymbolInstance(
+ ExecutableForm * anExecutable, Port * aPort) const;
+
+
+ /**
+ * SEARCH
+ * for Type
+ */
+ static const TypeSpecifier & searchTypeSpecifier(
+ ExecutableSystem & anExecutableSystem,
+ COMPILE_CONTEXT * aCTX, const ObjectElement * objElement);
+
+ static const TypeSpecifier & searchTypeSpecifier(
+ ExecutableSystem & anExecutableSystem, COMPILE_CONTEXT * aCTX,
+ const std::string & aFullyQualifiedNameID);
+
+ /**
+ * SEARCH
+ * for Data
+ */
+ const BF & searchDataInstance(BaseAvmProgram * tmpProgram,
+ const ObjectElement * objElement) const;
+
+ const BF & searchDataInstance(
+ COMPILE_CONTEXT * aCTX, const ObjectElement * objElement);
+
+
+ const BF & searchDataInstance(BaseAvmProgram * tmpProgram,
+ const std::string & aFullyQualifiedNameID) const;
+
+ const BF & searchDataInstance(COMPILE_CONTEXT * aCTX,
+ const std::string & aFullyQualifiedNameID);
+
+
+ const BF & searchDataInstanceByQualifiedNameID(BaseAvmProgram * tmpProgram,
+ const std::string & aQualifiedNameID) const;
+
+ const BF & searchDataInstanceByQualifiedNameID(
+ COMPILE_CONTEXT * aCTX, const std::string & aQualifiedNameID);
+
+
+ const BF & searchDataInstanceByNameID(
+ BaseAvmProgram * tmpProgram, const std::string & aNameID) const;
+
+//$DELETE
+// const BF & searchDataInstanceByNameID(
+// COMPILE_CONTEXT * aCTX, const std::string & aNameID);
+
+
+
+ const BF & searchDataInstanceAlias(
+ COMPILE_CONTEXT * aCTX, const ObjectElement * objElement);
+
+ const BF & searchDataInstanceAlias(COMPILE_CONTEXT * aCTX,
+ const std::string & aFullyQualifiedNameID);
+
+
+ const BF & createDataInstanceAlias(ExecutableForm * anExecutable,
+ const std::string & aFullyQualifiedNameID,
+ InstanceOfData * anInstance, ExecutableForm * instContainer);
+
+ const BF & createDataInstanceAlias(ExecutableForm * anExecutable,
+ const std::string & aFullyQualifiedNameID,
+ InstanceOfData * anInstance,
+ VectorOfInstanceOfMachine & theInstanceOfMachinePath);
+
+ /**
+ * SEARCH
+ * for Machine Instance
+ */
+ const Symbol & searchInstanceModel(
+ COMPILE_CONTEXT * aCTX, const ObjectElement * astElement) const;
+
+ const Symbol & searchInstanceStatic(
+ COMPILE_CONTEXT * aCTX, const ObjectElement * astElement) const;
+
+ const Symbol & searchInstanceDynamic(
+ COMPILE_CONTEXT * aCTX, const ObjectElement * astElement) const;
+
+
+ const Symbol & searchInstanceModelByNameID(
+ ExecutableForm * anExecutable, const std::string & aNameID) const;
+
+ const Symbol & searchInstanceModelByNameID(
+ COMPILE_CONTEXT * aCTX, const std::string & aNameID) const;
+
+ const Symbol & searchMachineInstanceByNameID(
+ ExecutableForm * anExecutable, const std::string & aNameID) const;
+
+ const Symbol & searchMachineInstanceByNameID(
+ COMPILE_CONTEXT * aCTX, const std::string & aNameID) const;
+
+
+ InstanceOfMachine * searchInstanceStatic(
+ const ObjectElement * fromMachine, const UniFormIdentifier & anUFI);
+
+ void searchInstanceStatic(const ObjectElement * refMachine,
+ const UniFormIdentifier & anUFI, BFList & foundList) const;
+
+
+ void searchInstanceByNameID(COMPILE_CONTEXT * aCTX,
+ const std::string & aQualifiedNameID, BFList & foundList) const;
+
+ void searchInstanceByQualifiedNameID(COMPILE_CONTEXT * aCTX,
+ const std::string & aQualifiedNameID, BFList & foundList) const;
+
+ /**
+ * SEARCH
+ * for Data, Port or Machine
+ */
+ const BF & searchInstance(
+ COMPILE_CONTEXT * aCTX, const ObjectElement * objElement);
+
+ const BF & searchInstance(COMPILE_CONTEXT * aCTX,
+ const std::string & aFullyQualifiedNameID);
+
+
+ /**
+ * SEARCH SYMBOL
+ * for Data, Port or Machine
+ */
+ const BF & searchSymbol(
+ COMPILE_CONTEXT * aCTX, const ObjectElement * objElement);
+
+ const BF & searchSymbol(COMPILE_CONTEXT * aCTX,
+ const std::string & aFullyQualifiedNameID);
+
+ BF searchSymbolByUFI(COMPILE_CONTEXT * aCTX, const UniFormIdentifier & anUFI);
+
+
+ const BF & searchSemSymbol(COMPILE_CONTEXT * aCTX,
+ const ObjectElement * objElement) const;
+
+ const BF & searchSemSymbolByQualifiedNameID(COMPILE_CONTEXT * aCTX,
+ const std::string & aQualifiedNameID) const;
+
+ const BF & searchSemSymbolByNameID(COMPILE_CONTEXT * aCTX,
+ const std::string & aNameID) const;
+
+
+ BF searchSymbolByQualifiedNameID(COMPILE_CONTEXT * aCTX,
+ const std::string & aQualifiedNameID);
+
+ BF searchSymbolByNameID(
+ COMPILE_CONTEXT * aCTX, const std::string & aNameID);
+
+
+ BF createAliasIfNotAccessible(COMPILE_CONTEXT * aCTX,
+ InstanceOfMachine * aContainerInstance, const BF & bfInstance);
+
+ BF createAliasIfNotAccessible(COMPILE_CONTEXT * aCTX, const BF & bfInstance);
+
+
+ /**
+ * SEARCH
+ * Executable for a given FORM
+ */
+ const BF & searchTransition(
+ COMPILE_CONTEXT * aCTX, const ObjectElement * objElement) const;
+
+ const BF & searchTransition(COMPILE_CONTEXT * aCTX,
+ const std::string & aFullyQualifiedNameID) const;
+
+ const BF & searchTransitionByNameID(
+ COMPILE_CONTEXT * aCTX, const std::string & aNameID) const;
+
+
+ const BF & searchProgram(COMPILE_CONTEXT * aCTX,
+ const ObjectElement * objElement) const;
+
+ const BF & searchProgram(COMPILE_CONTEXT * aCTX,
+ const std::string & aFullyQualifiedNameID) const;
+
+ const BF & searchProgramByNameID(
+ COMPILE_CONTEXT * aCTX, const std::string & aNameID) const;
+
+ /**
+ * SEARCH
+ * Executable of the MODEL for a given FORM
+ */
+ ExecutableForm * searchExecutableModel(const Machine * aMachine);
+
+ /**
+ * SEARCH
+ * Instance for a given FORM
+ */
+ inline const BF & searchCompiledElement(
+ const BFList & listOfInstance, const SymbolPredicate & pred) const
+ {
+ BFList::const_iterator it = listOfInstance.begin();
+ for( ; it != listOfInstance.end() ; ++it )
+ {
+ if( pred( (*it).to_ptr< BaseCompiledForm >() ) )
+ {
+ return( *it );
+ }
+ }
+
+ return( BF::REF_NULL );
+ }
+
+ inline const Symbol & searchCompiledElement(
+ const ListOfSymbol & listOfInstance,
+ const SymbolPredicate & pred) const
+ {
+ ListOfSymbol::const_iterator it = listOfInstance.begin();
+ ListOfSymbol::const_iterator endIt = listOfInstance.end();
+ for( ; it != endIt ; ++it )
+ {
+ if( pred( (*it) ) )
+ {
+ return( *it );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+ }
+
+ template< typename T >
+ inline T * searchCompiledElement(BFVector & tableOfInstance,
+ const SymbolPredicate & pred) const
+ {
+ BFVector::const_iterator it = tableOfInstance.begin();
+ for( ; it != tableOfInstance.end() ; ++it )
+ {
+ if( pred( (*it).as_ptr< T >() ) )
+ {
+ return( (*it).to_ptr< T >() );
+ }
+ }
+
+ return( NULL );
+ }
+
+ inline const Symbol & searchCompiledElement(
+ VectorOfSymbol & tableOfInstance,
+ const SymbolPredicate & pred) const
+ {
+ VectorOfSymbol::const_iterator it = tableOfInstance.begin();
+ VectorOfSymbol::const_iterator endIt = tableOfInstance.end();
+ for( ; it != endIt ; ++it )
+ {
+ if( pred( (*it) ) )
+ {
+ return( (*it) );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+ }
+
+
+ inline void searchCompiledElement(const ListOfSymbol & listOfInstance,
+ const SymbolPredicate & pred, BFList & foundList) const
+ {
+ ListOfSymbol::const_iterator it = listOfInstance.begin();
+ ListOfSymbol::const_iterator endIt = listOfInstance.end();
+ for( ; it != endIt ; ++it )
+ {
+ if( pred( (*it) ) )
+ {
+ foundList.append( *it );
+ }
+ }
+ }
+
+
+ /**
+ ***************************************************************************
+ * GETTER / SETTER
+ * mListOfMachineExecutable
+ ***************************************************************************
+ */
+ inline const BF & searchExecutable(const ObjectElement * anElement) const
+ {
+ SymbolPredicateByCompiledElement pred( anElement );
+
+ return( searchCompiledElement(mListOfMachineExecutable, pred) );
+ }
+
+ inline const BF & searchExecutable(
+ const std::string & aFullyQualifiedNameID) const
+ {
+ SymbolPredicateByCompiledFQNameID pred(aFullyQualifiedNameID);
+
+ return( searchCompiledElement(mListOfMachineExecutable, pred) );
+ }
+
+ inline const BF & searchExecutableByQualifiedNameID(
+ const std::string & aQualifiedNameID) const
+ {
+ SymbolPredicateByQualifiedNameID pred(aQualifiedNameID);
+
+ return( searchCompiledElement(mListOfMachineExecutable, pred) );
+ }
+
+ inline const BF & searchExecutableByNameID(
+ const std::string & aQualifiedNameID) const
+ {
+ SymbolPredicateByNameID pred(aQualifiedNameID);
+
+ return( searchCompiledElement(mListOfMachineExecutable, pred) );
+ }
+
+
+
+ /**
+ ***************************************************************************
+ * GETTER / SETTER
+ * mListOfInstanceStatic
+ * "SYMBOL TABLE : MACHINE"
+ ***************************************************************************
+ */
+
+ inline void addInstanceStatic(const Symbol & anInstance)
+ {
+ mListOfInstanceStatic.append(anInstance);
+ }
+
+ inline const Symbol & searchInstanceStatic(
+ const ObjectElement * anElement) const
+ {
+ SymbolPredicateByCompiledElement pred( anElement );
+
+ return( searchCompiledElement(mListOfInstanceStatic, pred) );
+ }
+
+ inline const Symbol & searchInstanceStatic(
+ const std::string & aFullyQualifiedNameID) const
+ {
+ SymbolPredicateByCompiledFQNameID pred(aFullyQualifiedNameID);
+
+ return( searchCompiledElement(mListOfInstanceStatic, pred) );
+ }
+
+
+ inline void searchMachineInstanceByNameID(
+ const std::string & aNameID, BFList & foundList) const
+ {
+ SymbolPredicateByNameID pred(aNameID);
+
+ searchCompiledElement(mListOfInstanceStatic, pred, foundList);
+ }
+
+ inline void searchMachineInstanceByQualifiedNameID(
+ const std::string & aQualifiedNameID, BFList & foundList) const
+ {
+ SymbolPredicateByQualifiedNameID pred(aQualifiedNameID);
+
+ searchCompiledElement(mListOfInstanceStatic, pred, foundList);
+ }
+
+
+ /**
+ ***************************************************************************
+ * GETTER / SETTER
+ * mListOfPortInstance
+ * "SYMBOL TABLE : PORT"
+ ***************************************************************************
+ */
+ inline void addPortInstance(const Symbol & anInstance)
+ {
+ mListOfPortInstance.append(anInstance);
+ }
+
+ inline const Symbol & searchPortInstance(
+ const ObjectElement * anElement) const
+ {
+ SymbolPredicateByCompiledElement pred( anElement );
+
+ return( searchCompiledElement(mListOfPortInstance, pred) );
+ }
+
+ inline void searchPortInstanceByNameID(
+ const std::string & aNameID, BFList & foundList) const
+ {
+ SymbolPredicateByNameID pred(aNameID);
+
+ searchCompiledElement(mListOfPortInstance, pred, foundList);
+ }
+
+ inline void searchPortInstanceByQualifiedNameID(
+ const std::string & aQualifiedNameID, BFList & foundList) const
+ {
+ SymbolPredicateByQualifiedNameID pred(aQualifiedNameID);
+
+ searchCompiledElement(mListOfPortInstance, pred, foundList);
+ }
+
+
+ const Symbol & searchPortInstance(
+ COMPILE_CONTEXT * aCTX, InstanceOfData * aData) const;
+
+
+ /**
+ ***************************************************************************
+ * GETTER / SETTER
+ * mListOfBufferInstance
+ * "SYMBOL TABLE : BUFFER"
+ ***************************************************************************
+ */
+ inline void addBufferInstance(const Symbol & anInstance)
+ {
+ mListOfBufferInstance.append(anInstance);
+ }
+
+ inline const Symbol & searchBufferInstance(
+ const ObjectElement * anElement) const
+ {
+ SymbolPredicateByCompiledElement pred( anElement );
+
+ return( searchCompiledElement(mListOfBufferInstance, pred) );
+ }
+
+ inline void searchBufferInstanceByNameID(
+ const std::string & aNameID, BFList & foundList) const
+ {
+ SymbolPredicateByNameID pred(aNameID);
+
+ searchCompiledElement(mListOfBufferInstance, pred, foundList);
+ }
+
+ inline void searchBufferInstanceByQualifiedNameID(
+ const std::string & aQualifiedNameID, BFList & foundList) const
+ {
+ SymbolPredicateByQualifiedNameID pred(aQualifiedNameID);
+
+ searchCompiledElement(mListOfBufferInstance, pred, foundList);
+ }
+
+ const Symbol & searchBufferInstance(ExecutableForm * anExecutable,
+ const ObjectElement * objElement) const;
+
+ const Symbol & searchBufferInstance(ExecutableForm * anExecutable,
+ const std::string & aFullyQualifiedNameID);
+
+ const Symbol & searchBufferInstanceByQualifiedNameID(
+ ExecutableForm * anExecutable,
+ const std::string & aQualifiedNameID) const;
+
+ const Symbol & searchBufferInstanceByNameID(
+ ExecutableForm * anExecutable, const std::string & aNameID) const;
+
+ const Symbol & searchBufferInstanceAlias(ExecutableForm * anExecutable,
+ const std::string & aFullyQualifiedNameID);
+
+
+ const Symbol & createBufferInstanceAlias(ExecutableForm * anExecutable,
+ const std::string & aFullyQualifiedNameID,
+ InstanceOfBuffer * anInstance,
+ VectorOfInstanceOfMachine & theInstanceOfMachinePath);
+
+ /**
+ ***************************************************************************
+ * GETTER / SETTER
+ * theListOfConnectInstance
+ * "SYMBOL TABLE : CONNECT"
+ ***************************************************************************
+ */
+ inline void addConnectInstance(const Symbol & anInstance)
+ {
+ mListOfConnectorInstance.append(anInstance);
+ }
+
+ inline const Symbol & searchConnectorInstance(
+ const std::string & aFullyQualifiedNameID) const
+ {
+ SymbolPredicateByCompiledFQNameID pred(aFullyQualifiedNameID);
+
+ return( searchCompiledElement(mListOfConnectorInstance, pred) );
+ }
+
+
+ inline const Symbol & searchConnectorInstance(
+ const ObjectElement * anElement) const
+ {
+ SymbolPredicateByCompiledElement pred( anElement );
+
+ return( searchCompiledElement(mListOfConnectorInstance, pred) );
+ }
+
+ inline void searchConnectorInstanceByNameID(
+ const std::string & aNameID, BFList & foundList) const
+ {
+ SymbolPredicateByNameID pred(aNameID);
+
+ searchCompiledElement(mListOfConnectorInstance, pred, foundList);
+ }
+
+ inline void searchConnectorInstanceByQualifiedNameID(
+ const std::string & aQualifiedNameID, BFList & foundList) const
+ {
+ SymbolPredicateByQualifiedNameID pred(aQualifiedNameID);
+
+ searchCompiledElement(mListOfConnectorInstance, pred, foundList);
+ }
+
+
+ const Symbol & searchConnectorInstance(ExecutableForm * anExecutable,
+ const ObjectElement * objElement) const;
+
+ const Symbol & searchConnectorInstance(ExecutableForm * anExecutable,
+ const std::string & aFullyQualifiedNameID) const;
+
+ const Symbol & searchConnectorInstanceByQualifiedNameID(
+ ExecutableForm * anExecutable,
+ const std::string & aQualifiedNameID) const;
+
+ const Symbol & searchConnectorInstanceByNameID(
+ ExecutableForm * anExecutable, const std::string & aNameID) const;
+
+
+
+ /**
+ ***************************************************************************
+ * GETTER / SETTER
+ * mListOfDataInstance
+ * "SYMBOL TABLE : DATA"
+ ***************************************************************************
+ */
+ inline void addDataInstance(const Symbol & anInstance)
+ {
+ mListOfDataInstance.append(anInstance);
+ }
+
+ inline void searchDataInstanceByNameID(
+ const std::string & aNameID, BFList & foundList) const
+ {
+ SymbolPredicateByNameID pred(aNameID);
+
+ searchCompiledElement(mListOfDataInstance, pred, foundList);
+ }
+
+ inline void searchDataInstanceByQualifiedNameID(
+ const std::string & aQualifiedNameID, BFList & foundList) const
+ {
+ SymbolPredicateByQualifiedNameID pred(aQualifiedNameID);
+
+ searchCompiledElement(mListOfDataInstance, pred, foundList);
+ }
+
+ /**
+ ***************************************************************************
+ * GETTER / SETTER
+ * mListOfMachineExecutable
+ * "SYMBOL TABLE : MACHINE EXECUTABLE"
+ ***************************************************************************
+ */
+ inline void addMachineExecutable(const BF & anExecutable)
+ {
+ mListOfMachineExecutable.append( anExecutable );
+ }
+
+ /**
+ ***************************************************************************
+ * GETTER / SETTER
+ * mListOfAvmTransition
+ * "SYMBOL TABLE : AVM PROGRAM"
+ ***************************************************************************
+ */
+ inline void addTransition(const BF & aTransition)
+ {
+ mListOfAvmTransition.append( aTransition );
+ }
+
+ inline const BF & searchTransition(const ObjectElement * anElement) const
+ {
+ SymbolPredicateByCompiledElement pred( anElement );
+
+ return( searchCompiledElement(mListOfAvmTransition, pred) );
+ }
+
+ inline const BF & searchTransition(
+ const std::string & aFullyQualifiedNameID) const
+ {
+ SymbolPredicateByCompiledFQNameID pred(aFullyQualifiedNameID);
+
+ return( searchCompiledElement(mListOfAvmTransition, pred) );
+ }
+
+ inline const BF & searchTransitionByNameID(const std::string & aNameID) const
+ {
+ SymbolPredicateByNameID pred(aNameID);
+
+ return( searchCompiledElement(mListOfAvmTransition, pred) );
+ }
+
+
+ /**
+ ***************************************************************************
+ * GETTER / SETTER
+ * mListOfAvmProgram
+ * "SYMBOL TABLE : AVM PROGRAM"
+ ***************************************************************************
+ */
+ inline void addProgram(const BF & aProgram)
+ {
+ mListOfAvmProgram.append( aProgram );
+ }
+
+ inline const BF & searchProgram(const ObjectElement * anElement) const
+ {
+ SymbolPredicateByCompiledElement pred( anElement );
+
+ return( searchCompiledElement(mListOfAvmProgram, pred) );
+ }
+
+ inline const BF & searchProgram(
+ const std::string & aFullyQualifiedNameID) const
+ {
+ SymbolPredicateByCompiledFQNameID pred(aFullyQualifiedNameID);
+
+ return( searchCompiledElement(mListOfAvmProgram, pred) );
+ }
+
+ inline const BF & searchProgramByNameID(const std::string & aNameID) const
+ {
+ SymbolPredicateByNameID pred(aNameID);
+
+ return( searchCompiledElement(mListOfAvmProgram, pred) );
+ }
+
+
+ /*
+ * GETTER
+ * mErrorCount
+ */
+ inline avm_size_t getErrorCount() const
+ {
+ return( mErrorCount );
+ }
+
+ inline bool hasError() const
+ {
+ return( mErrorCount > 0 );
+ }
+
+ inline bool hasZeroError() const
+ {
+ return( mErrorCount == 0 );
+ }
+
+ inline avm_size_t incrErrorCount()
+ {
+ return( ++mErrorCount );
+ }
+
+
+
+ /*
+ * GETTER
+ * mWarningCount
+ */
+ inline avm_size_t getWarningCount() const
+ {
+ return( mWarningCount );
+ }
+
+ inline bool hasWarning() const
+ {
+ return( mWarningCount > 0 );
+ }
+
+ inline bool hasZeroWarning() const
+ {
+ return( mWarningCount == 0 );
+ }
+
+ inline avm_size_t incrWarningCount()
+ {
+ return( ++mWarningCount );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * ERROR_OS
+ */
+ inline std::string getErrorMessage() const
+ {
+ return( ERROR_OS.str() );
+ }
+
+ inline bool hasErrorMessage() const
+ {
+ return( ! (ERROR_OS.str().empty()) );
+ }
+
+
+ inline void addErrorMessage(const std::string & anErrorMessage)
+ {
+ if( hasErrorMessage() )
+ {
+ ERROR_OS << "\n";
+ }
+ ERROR_OS << anErrorMessage;
+ }
+
+
+ inline void resetError()
+ {
+ mErrorCount = 0;
+
+ ERROR_OS.str("");
+ }
+
+ inline void setErrorMessage(const std::string & anErrorMessage)
+ {
+ resetError();
+ ERROR_OS << anErrorMessage;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * WARNING_OS
+ */
+ inline std::string getWarningMessage() const
+ {
+ return( WARNING_OS.str() );
+ }
+
+ inline bool hasWarningMessage() const
+ {
+ return( ! (WARNING_OS.str().empty()) );
+ }
+
+
+ inline void addWarningMessage(const std::string & anWarningMessage)
+ {
+ if( hasWarningMessage() )
+ {
+ WARNING_OS << "\n";
+ }
+ WARNING_OS << anWarningMessage;
+ }
+
+
+ inline void resetWarning()
+ {
+ mWarningCount = 0;
+
+ WARNING_OS.str("");
+ }
+
+ inline void setWarningMessage(const std::string & anWarningMessage)
+ {
+ resetWarning();
+ WARNING_OS << anWarningMessage;
+ }
+
+};
+
+
+}
+
+#endif /* BUILDER_COMPILER_SYMBOLTABLE_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AbstractAvmcodeCompiler.cpp b/org.eclipse.efm.symbex/src/builder/primitive/AbstractAvmcodeCompiler.cpp
new file mode 100644
index 0000000..28a26be
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AbstractAvmcodeCompiler.cpp
@@ -0,0 +1,1939 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 7 avr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AbstractAvmcodeCompiler.h"
+
+#include <builder/primitive/AvmcodeCompiler.h>
+
+#include <computer/instruction/AvmInstruction.h>
+
+#include <fml/builtin/QualifiedIdentifier.h>
+
+#include <fml/executable/BaseAvmProgram.h>
+#include <fml/executable/ExecutableLib.h>
+#include <fml/executable/InstanceOfBuffer.h>
+#include <fml/executable/InstanceOfConnect.h>
+#include <fml/executable/InstanceOfData.h>
+#include <fml/executable/InstanceOfMachine.h>
+#include <fml/executable/InstanceOfPort.h>
+
+#include <fml/builtin/Boolean.h>
+#include <fml/builtin/Character.h>
+
+#include <fml/numeric/Float.h>
+#include <fml/numeric/Integer.h>
+#include <fml/numeric/Rational.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/BuiltinArray.h>
+#include <fml/expression/ExpressionTypeChecker.h>
+#include <fml/expression/StatementTypeChecker.h>
+
+#include <fml/lib/AvmOperationFactory.h>
+#include <fml/lib/ITypeSpecifier.h>
+
+#include <fml/type/ContainerTypeSpecifier.h>
+
+#include <fml/infrastructure/Buffer.h>
+#include <fml/infrastructure/Connector.h>
+#include <fml/infrastructure/Machine.h>
+#include <fml/infrastructure/Port.h>
+#include <fml/infrastructure/Routine.h>
+#include <fml/infrastructure/Transition.h>
+#include <fml/infrastructure/Variable.h>
+
+#include <fml/workflow/UniFormIdentifier.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// SPECIFIC ARGUMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AbstractAvmcodeCompiler::compileArgLvalue(
+ COMPILE_CONTEXT * aCTX, const BF & arg)
+{
+ BF compileArg;
+
+ switch( arg.classKind() )
+ {
+ case FORM_XFSP_VARIABLE_KIND:
+ {
+ compileArg = AVMCODE_COMPILER.compileVariable(aCTX, arg);
+ break;
+ }
+
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+ {
+ if( arg.to_ptr< QualifiedIdentifier >()->isPositionalParameter() )
+ {
+ compileArg = AVMCODE_COMPILER.
+ compileQualifiedPositionalIdentifier(aCTX, arg);
+ }
+ else if( arg.str().find(':') != std::string::npos )
+ {
+ compileArg = AVMCODE_COMPILER.
+ compileFullyQualifiedNameID(aCTX, arg);
+ }
+ else
+ {
+ compileArg = AVMCODE_COMPILER.
+ compileQualifiedIdentifier(aCTX, arg);
+ }
+ break;
+ }
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ {
+ compileArg = AVMCODE_COMPILER.compileIdentifier(aCTX, arg);
+ break;
+ }
+
+ case FORM_XFSP_BUFFER_KIND:
+ case FORM_XFSP_CHANNEL_KIND:
+ case FORM_XFSP_CONNECTOR_KIND:
+ case FORM_XFSP_MACHINE_KIND:
+ case FORM_XFSP_PORT_KIND:
+ case FORM_XFSP_ROUTINE_KIND:
+ case FORM_XFSP_SYSTEM_KIND:
+ case FORM_XFSP_TRANSITION_KIND:
+ case FORM_XFSP_DATATYPE_KIND:
+ {
+ compileArg = AVMCODE_COMPILER.compileElement(aCTX, arg);
+ break;
+ }
+
+ case FORM_UFI_KIND:
+ {
+ compileArg = AVMCODE_COMPILER.compileUFI(
+ aCTX, arg.to_ref< UniFormIdentifier>());
+ break;
+ }
+
+ case FORM_AVMCODE_KIND:
+ {
+ compileArg = AVMCODE_COMPILER.compileExpression(aCTX, arg.bfCode());
+ break;
+ }
+
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ compileArg = arg;
+ break;
+ }
+
+ default:
+ {
+ compileArg = AVMCODE_COMPILER.decode_compileExpression(aCTX, arg);
+ break;
+ }
+ }
+
+
+ if( compileArg.valid() )
+ {
+ if( compileArg.is< InstanceOfData >() )
+ {
+ InstanceOfData * iodArg = compileArg.to_ptr< InstanceOfData >();
+
+ if( iodArg->getModifier().hasFeatureMutable() )
+ {
+ if( iodArg->isAlias() )
+ {
+ if( not iodArg->getModifier().
+ isVisibilityPublic( aCTX->getModifier() ) )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "compileArgLvalue:> compilation error : "
+ "Illegal access of non \"public\" LVALUE << "
+ << str_header( iodArg ) << " >> for << "
+ << arg.str() << " >>" << std::endl << std::endl;
+ }
+ if( not iodArg->getModifier().
+ hasFeatureVolatile( aCTX->getModifier() ) )
+ {
+ if( iodArg->getAstElement()->isnot< ObjectElement >() )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "compileArgLvalue:> compilation error : "
+ "Illegal access of non \"volatile\" LVALUE << "
+ << str_header( iodArg ) << " >> for << "
+ << arg.str() << " >>" << std::endl << std::endl;
+ }
+ }
+ }
+ return( compileArg );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "compileArgLvalue:> compilation error : "
+ "Illegal access of a \"const\" LVALUE << "
+ << str_header( iodArg ) << " >> for << "
+ << arg.str() << " >>" << std::endl << std::endl;
+
+ return( arg );
+ }
+ }
+ else if( compileArg.is< AvmCode >() )
+ {
+ return( compileArg );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "compileArgLvalue:> compilation error : "
+ "Unexpected << " << compileArg.str()
+ << " >> as LVALUE for << " << arg.str() << " >>"
+ << std::endl << std::endl;
+
+ return( arg );
+ }
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "compileArgLvalue:> compilation error << "
+ << arg.str() << " >>" << std::endl << std::endl;
+
+ return( arg );
+ }
+}
+
+
+BF AbstractAvmcodeCompiler::compileArgRvalue(
+ COMPILE_CONTEXT * aCTX, const BF & arg, bool needTypeChecking)
+{
+ BF compileArg = AVMCODE_COMPILER.decode_compileExpression(aCTX, arg);
+
+ if( compileArg.valid() )
+ {
+ if( compileArg.is< InstanceOfData >() )
+ {
+ InstanceOfData * iodArg = compileArg.to_ptr< InstanceOfData >();
+
+ if( iodArg->getModifier().hasFeatureMutable() )
+ {
+ if( iodArg->isAlias() )
+ {
+ if( not iodArg->getModifier().
+ isVisibilityPublic( aCTX->getModifier() ) )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "compileArgLvalue:> compilation error : "
+ "Illegal access of non \"public\" RVALUE << "
+ << str_header( iodArg ) << " >> for << "
+ << arg.str() << " >>" << std::endl << std::endl;
+ }
+ }
+ }
+ }
+ }
+
+ if( compileArg.valid() )
+ {
+ if( aCTX->isNeedTypeChecking(needTypeChecking) )
+ {
+ checkArgType(aCTX, aCTX->mType, compileArg);
+ }
+
+ return( compileArg );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "compileArgRvalue:> compilation error << "
+ << arg.str() << " >>" << std::endl << std::endl;
+
+ return( arg );
+ }
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// COMPILATION OF EXPRESSION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AbstractAvmcodeCompiler::compileExpressionCode(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ Operator * mainOperator = aCode->getOperator();
+ BFCode newCode( mainOperator );
+
+ BF arg;
+ AvmCode * pCode;
+
+ AvmCode::iterator itArg = aCode->begin();
+ AvmCode::iterator itEndArg = aCode->end();
+
+ for( ; itArg != itEndArg ; ++itArg )
+ {
+ arg = AVMCODE_COMPILER.decode_compileExpression(aCTX, *itArg);
+
+ if( arg.invalid() )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmCode< expression > compilation error << "
+ << (*itArg).str() << " >>" << std::endl << std::endl;
+
+ newCode->append( arg );
+ continue;
+ }
+
+ if( arg.is< AvmCode >() )
+ {
+ pCode = arg.to_ptr< AvmCode >();
+
+ if( pCode->isOperator( mainOperator )
+ && mainOperator->isAssociative() )
+ {
+ newCode->append( pCode->getArgs() );
+ }
+ else
+ {
+ newCode->append( arg );
+ }
+ }
+ else
+ {
+ newCode->append( arg );
+ }
+ }
+
+ return( newCode );
+}
+
+
+BFCode AbstractAvmcodeCompiler::optimizeExpressionCode(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode,
+ avm_arg_operand_t anOperand)
+{
+ Operator * mainOperator = aCode->getOperator();
+ BFCode newCode( mainOperator );
+
+ BF arg;
+ AvmCode * pCode;
+
+ AvmCode::iterator itArg = aCode->begin();
+ AvmCode::iterator itEndArg = aCode->end();
+
+ AvmInstruction * argsInstruction = newCode->newEmptyInstruction();
+
+ Vector< AvmBytecode > vectorOfArgOpcode;
+
+ for( ; itArg != itEndArg ; ++itArg )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, *itArg);
+
+ if( arg.invalid() )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmCode< expression > optimization error << "
+ << (*itArg).str() << " >>" << std::endl << std::endl;
+
+ newCode->append( arg );
+ continue;
+ }
+
+ if( arg.is< AvmCode >() )
+ {
+ pCode = arg.to_ptr< AvmCode >();
+
+ if( pCode->isOperator( mainOperator )
+ && mainOperator->isAssociative() )
+ {
+ newCode->append( pCode->getArgs() );
+
+ vectorOfArgOpcode.append(
+ pCode->getInstruction()->getBytecode(),
+ pCode->size());
+ }
+ else
+ {
+ newCode->append( arg );
+
+ vectorOfArgOpcode.append( argcodeOfExpression(aCTX, pCode) );
+ }
+ }
+ else
+ {
+ newCode->append( arg );
+
+ AvmBytecode argOpcode;
+ setArgcodeRValue(aCTX, argOpcode, arg, false);
+ vectorOfArgOpcode.append( argOpcode );
+ }
+ }
+
+ argsInstruction->setMainBytecode(
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ anOperand );
+
+ argsInstruction->computeBytecode( false , vectorOfArgOpcode );
+
+ return( newCode );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// COMPILATION OF STATEMENT
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AbstractAvmcodeCompiler::compileStatementCode(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ Operator * mainOperator = aCode->getOperator();
+ BFCode newCode( mainOperator );
+
+ BF arg;
+
+ AvmCode::iterator itArg = aCode->begin();
+ AvmCode::iterator itEndArg = aCode->end();
+
+ for( ; itArg != itEndArg ; ++itArg )
+ {
+ arg = AVMCODE_COMPILER.decode_compileStatement(aCTX, *itArg);
+
+ if( arg.invalid() )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmCode< statement > compilation error << "
+ << (*itArg).str() << " >>" << std::endl << std::endl;
+
+ newCode->append( *itArg );
+ continue;
+ }
+
+ switch( arg.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ if( arg.to_ptr< AvmCode >()->isOpCode( mainOperator )
+ && mainOperator->isAssociative() )
+ {
+ newCode->append( arg.to_ptr< AvmCode >()->getArgs() );
+ }
+ else
+ {
+ newCode->append( arg );
+ }
+
+ break;
+ }
+
+ default:
+ {
+ newCode->append( arg );
+
+ break;
+ }
+ }
+ }
+
+ return( newCode );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE COMPILATION STEP
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AbstractAvmcodeCompiler::compileAvmcode(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ Operator * mainOperator = aCode->getOperator();
+ BFCode newCode( mainOperator );
+
+ BF arg;
+
+ AvmCode::iterator itArg = aCode->begin();
+ AvmCode::iterator itEndArg = aCode->end();
+
+ for( ; itArg != itEndArg ; ++itArg )
+ {
+ switch( (*itArg).classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ arg = compileAvmcode(aCTX, (*itArg).bfCode());
+
+ break;
+ }
+
+ default:
+ {
+ arg = AVMCODE_COMPILER.decode_compileExpression(aCTX, *itArg);
+
+ break;
+ }
+ }
+
+
+
+ if( arg.invalid() )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmCode< statement > compilation error << "
+ << (*itArg).str() << " >>" << std::endl << std::endl;
+
+ newCode->append( *itArg );
+ continue;
+ }
+
+ switch( arg.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ if( arg.to_ptr< AvmCode >()->isOperator( mainOperator )
+ && mainOperator->isAssociative() )
+ {
+ newCode->append( arg.to_ptr< AvmCode >()->getArgs() );
+ }
+ else
+ {
+ newCode->append( arg );
+ }
+
+ break;
+ }
+
+ default:
+ {
+ newCode->append( arg );
+
+ break;
+ }
+ }
+ }
+
+ return( newCode );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVM OPCODE COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * operand
+ */
+
+bool AbstractAvmcodeCompiler::mustBeEvaluatedArgument(const BF & arg)
+{
+ switch( arg.classKind() )
+ {
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ case FORM_BUILTIN_INTEGER_KIND:
+ case FORM_BUILTIN_RATIONAL_KIND:
+ case FORM_BUILTIN_FLOAT_KIND:
+
+ case FORM_BUILTIN_CHARACTER_KIND:
+ case FORM_BUILTIN_STRING_KIND:
+ {
+ return( false );
+ }
+
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+ {
+ return( true );
+ }
+
+ case FORM_AVMCODE_KIND:
+ {
+ return( true );
+ }
+
+ case FORM_ARRAY_BOOLEAN_KIND:
+ case FORM_ARRAY_CHARACTER_KIND:
+ case FORM_ARRAY_INTEGER_KIND:
+ case FORM_ARRAY_RATIONAL_KIND:
+ case FORM_ARRAY_FLOAT_KIND:
+ case FORM_ARRAY_STRING_KIND:
+ case FORM_ARRAY_IDENTIFIER_KIND:
+ case FORM_ARRAY_QUALIFIED_IDENTIFIER_KIND:
+ {
+ return( false );
+ }
+
+ case FORM_ARRAY_BF_KIND:
+ {
+ return( mustBeEvaluatedArgumentArray( arg.to_ptr< ArrayBF >() ) );
+ }
+
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ return( true );
+ }
+
+ case FORM_RUNTIME_ID_KIND:
+
+ case FORM_INSTANCE_PORT_KIND:
+ case FORM_INSTANCE_BUFFER_KIND:
+ case FORM_INSTANCE_CONNECTOR_KIND:
+ {
+ return( false );
+ }
+
+ case FORM_OPERATOR_KIND:
+ case FORM_AVMLAMBDA_KIND:
+ case FORM_AVMPROGRAM_KIND:
+ case FORM_AVMTRANSITION_KIND:
+ case FORM_EXECUTABLE_MACHINE_KIND:
+ case FORM_EXECUTABLE_SYSTEM_KIND:
+ {
+ return( false );
+ }
+
+ default:
+ {
+ return( true );
+ }
+ }
+}
+
+
+bool AbstractAvmcodeCompiler::mustBeEvaluatedArgumentArray(ArrayBF * arrayArg)
+{
+ for( avm_size_t idx = 0 ; idx < arrayArg->size() ; ++idx )
+ {
+ if( mustBeEvaluatedArgument(arrayArg->at(idx)) )
+ {
+ return( true );
+ }
+ }
+ return( false );
+}
+
+avm_arg_operand_t AbstractAvmcodeCompiler::operandOf(const BF & arg)
+{
+ switch( arg.classKind() )
+ {
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ {
+ return( AVM_ARG_BOOLEAN_KIND );
+ }
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ return( AVM_ARG_INTEGER_KIND );
+ }
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ return( AVM_ARG_RATIONAL_KIND );
+ }
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ return( AVM_ARG_FLOAT_KIND );
+ }
+
+ case FORM_BUILTIN_CHARACTER_KIND:
+ {
+ return( AVM_ARG_CHARACTER_KIND );
+ }
+ case FORM_BUILTIN_STRING_KIND:
+ {
+ return( AVM_ARG_STRING_KIND );
+ }
+
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+ {
+ return( AVM_ARG_BUILTIN_KIND );
+ }
+
+ case FORM_OPERATOR_KIND:
+ {
+ return( AVM_ARG_OPERATOR_KIND );
+ }
+
+ case FORM_AVMCODE_KIND:
+ {
+ return( AVM_ARG_EXPRESSION_KIND );
+ }
+
+ case FORM_ARRAY_BOOLEAN_KIND:
+ case FORM_ARRAY_CHARACTER_KIND:
+ case FORM_ARRAY_INTEGER_KIND:
+ case FORM_ARRAY_RATIONAL_KIND:
+ case FORM_ARRAY_FLOAT_KIND:
+ case FORM_ARRAY_STRING_KIND:
+ case FORM_ARRAY_IDENTIFIER_KIND:
+ case FORM_ARRAY_QUALIFIED_IDENTIFIER_KIND:
+ {
+ return( AVM_ARG_BUILTIN_ARRAY_KIND );
+ }
+
+ case FORM_ARRAY_BF_KIND:
+ {
+ ArrayBF * arrayArg = arg.to_ptr< ArrayBF >();
+ for( avm_size_t idx = 0 ; idx < arrayArg->size() ; ++idx )
+ {
+ if( mustBeEvaluatedArgument(arrayArg->at(idx)) )
+ {
+ return( AVM_ARG_EXPRESSION_KIND );
+ }
+ }
+ return( AVM_ARG_BUILTIN_ARRAY_KIND );
+ }
+
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ InstanceOfData * anInstance = arg.to_ptr< InstanceOfData >();
+
+ if( anInstance->isUfiMixedPointer() )
+ {
+ return( AVM_ARG_DATA_UFI_KIND );
+ }
+ else if( anInstance->getModifier().hasNatureReference() )
+ {
+ return( anInstance->isUfiOffsetPointer() ?
+ AVM_ARG_DATA_UFI_KIND : AVM_ARG_DATA_REF_KIND );
+ }
+ else if( anInstance->getModifier().hasNatureMacro() )
+ {
+ return( AVM_ARG_DATA_MACRO_KIND );
+ }
+ else if( anInstance->getModifier().hasFeatureMutable() )
+ {
+ return( AVM_ARG_DATA_KIND );
+ }
+ else if( anInstance->getModifier().hasModifierPublicFinalStatic() )
+ {
+ if( ExecutableLib::MACHINE_COMPONENT_SELF == anInstance )
+ {
+ return( AVM_ARG_COMPONENT_SELF_RID );
+ }
+ else if( ExecutableLib::MACHINE_COMPONENT_PARENT == anInstance )
+ {
+ return( AVM_ARG_COMPONENT_PARENT_RID );
+ }
+ else if( ExecutableLib::MACHINE_COMPONENT_COMMUNICATOR
+ == anInstance )
+ {
+ return( AVM_ARG_COMPONENT_COMMUNICATOR_RID );
+ }
+
+ else if( ExecutableLib::MACHINE_ENVIRONMENT == anInstance )
+ {
+ return( AVM_ARG_ENVIRONMENT_RID );
+ }
+
+ else if( ExecutableLib::MACHINE_SYSTEM == anInstance )
+ {
+ return( AVM_ARG_SYSTEM_RID );
+ }
+
+ else if( ExecutableLib::MACHINE_SELF == anInstance )
+ {
+ return( AVM_ARG_SELF_RID );
+ }
+ else if( ExecutableLib::MACHINE_PARENT == anInstance )
+ {
+ return( AVM_ARG_PARENT_RID );
+ }
+ else if( ExecutableLib::MACHINE_COMMUNICATOR == anInstance )
+ {
+ return( AVM_ARG_COMMUNICATOR_RID );
+ }
+ else
+ {
+ return( AVM_ARG_DATA_CST_KIND );
+ }
+ }
+ else if( anInstance->getModifier().hasFeatureFinal() )
+ {
+ return( AVM_ARG_DATA_CST_KIND );
+ }
+ else
+ {
+ return( AVM_ARG_DATA_KIND );
+ }
+ }
+
+ case FORM_RUNTIME_ID_KIND:
+ {
+ return( AVM_ARG_MACHINE_RID );
+ }
+
+ case FORM_INSTANCE_PORT_KIND:
+ {
+ return( AVM_ARG_PORT_KIND );
+ }
+ case FORM_INSTANCE_BUFFER_KIND:
+ {
+ return( AVM_ARG_BUFFER_KIND );
+ }
+ case FORM_INSTANCE_CONNECTOR_KIND:
+ {
+ return( AVM_ARG_CONNECTOR_KIND );
+ }
+
+ case FORM_AVMLAMBDA_KIND:
+ case FORM_AVMPROGRAM_KIND:
+ case FORM_AVMTRANSITION_KIND:
+ case FORM_EXECUTABLE_MACHINE_KIND:
+ case FORM_EXECUTABLE_SYSTEM_KIND:
+ {
+ return( AVM_ARG_STATEMENT_KIND );
+ }
+
+ default:
+ {
+ return( AVM_ARG_UNDEFINED_OPERAND );
+ }
+ }
+}
+
+
+avm_arg_processor_t AbstractAvmcodeCompiler::processorOf(
+ BaseTypeSpecifier * aType)
+{
+ switch( aType->getTypeSpecifierKind() )
+ {
+ case TYPE_BOOLEAN_SPECIFIER:
+ case TYPE_INTEGER_SPECIFIER:
+ case TYPE_RATIONAL_SPECIFIER:
+ case TYPE_FLOAT_SPECIFIER:
+ {
+ return( AVM_ARG_ARITHMETIC_LOGIC_CPU );
+ }
+
+ case TYPE_CHARACTER_SPECIFIER:
+ {
+ return( AVM_ARG_CHARACTER_CPU );
+ }
+
+ case TYPE_STRING_SPECIFIER:
+ {
+ return( AVM_ARG_STRING_CPU );
+ }
+
+ case TYPE_ARRAY_SPECIFIER:
+ {
+ return( AVM_ARG_ARRAY_RVALUE_CPU );
+// return( AVM_ARG_ARRAY_LVALUE_CPU );
+ }
+
+ case TYPE_VECTOR_SPECIFIER:
+ case TYPE_REVERSE_VECTOR_SPECIFIER:
+ {
+ return( AVM_ARG_VECTOR_CPU );
+ }
+
+ case TYPE_LIST_SPECIFIER:
+ {
+ return( AVM_ARG_LIST_CPU );
+ }
+
+ case TYPE_FIFO_SPECIFIER:
+ case TYPE_LIFO_SPECIFIER:
+ case TYPE_MULTI_FIFO_SPECIFIER:
+ case TYPE_MULTI_LIFO_SPECIFIER:
+ case TYPE_RAM_SPECIFIER:
+ {
+ return( AVM_ARG_QUEUE_CPU );
+ }
+
+ case TYPE_SET_SPECIFIER:
+ case TYPE_MULTISET_SPECIFIER:
+ {
+ return( AVM_ARG_COLLECTION_CPU );
+ }
+
+ default:
+ {
+ return( AVM_ARG_UNDEFINED_PROCESSOR );
+ }
+ }
+}
+
+
+avm_arg_operand_t AbstractAvmcodeCompiler::operandOf(BaseTypeSpecifier * aType)
+{
+ switch( aType->getTypeSpecifierKind() )
+ {
+ case TYPE_BOOLEAN_SPECIFIER:
+ {
+ return( AVM_ARG_BOOLEAN_KIND );
+ }
+ case TYPE_INTEGER_SPECIFIER:
+ {
+ return( AVM_ARG_INTEGER_KIND );
+ }
+ case TYPE_RATIONAL_SPECIFIER:
+ {
+ return( AVM_ARG_RATIONAL_KIND );
+ }
+ case TYPE_FLOAT_SPECIFIER:
+ {
+ return( AVM_ARG_FLOAT_KIND );
+ }
+
+ case TYPE_CHARACTER_SPECIFIER:
+ {
+ return( AVM_ARG_CHARACTER_KIND );
+ }
+ case TYPE_STRING_SPECIFIER:
+ {
+ return( AVM_ARG_STRING_KIND );
+ }
+
+ case TYPE_OPERATOR_SPECIFIER:
+ {
+ return( AVM_ARG_OPERATOR_KIND );
+ }
+
+ case TYPE_AVMCODE_SPECIFIER:
+ {
+ return( AVM_ARG_EXPRESSION_KIND );
+ }
+
+ case TYPE_ARRAY_SPECIFIER:
+ {
+ return( AVM_ARG_ARRAY_KIND );
+ }
+
+ default:
+ {
+ if( aType->hasTypeCollection() )
+ {
+ return( AVM_ARG_COLLECTION_KIND );
+ }
+ else
+ {
+ return( AVM_ARG_UNDEFINED_OPERAND );
+ }
+ }
+ }
+}
+
+
+
+void AbstractAvmcodeCompiler::setArgcodeLValue(COMPILE_CONTEXT * aCTX,
+ AvmBytecode & argCode, const BF & arg, bool needTypeChecking)
+{
+ argCode.processor = AVM_ARG_MEMORY_LVALUE_CPU;
+ argCode.operation = AVM_ARG_SEVAL_LVALUE;
+
+ if( arg.is< InstanceOfData >() )
+ {
+ InstanceOfData * anInstance = arg.to_ptr< InstanceOfData >();
+
+ if( aCTX->isNeedTypeChecking(needTypeChecking) )
+ {
+ if( argCode.hasType() )
+ {
+ checkArgType(aCTX, argCode.dtype, arg);
+ }
+ else if( aCTX->hasType() )
+ {
+ argCode.dtype = aCTX->mType;
+ checkArgType(aCTX, argCode.dtype, arg);
+ }
+ else
+ {
+ argCode.dtype = anInstance->getTypeSpecifier();
+ }
+ }
+ else if( not argCode.hasType() )
+ {
+ argCode.dtype = anInstance->getTypeSpecifier();
+ }
+
+ if( anInstance->isUfiMixedPointer() )
+ {
+ argCode.operand = AVM_ARG_DATA_UFI_KIND;
+ }
+ else if( anInstance->getModifier().hasNatureReference() )
+ {
+ argCode.operand = (anInstance->isUfiOffsetPointer() ?
+ AVM_ARG_DATA_UFI_KIND : AVM_ARG_DATA_REF_KIND);
+ }
+ else if( anInstance->getModifier().hasNatureMacro() )
+ {
+ argCode.operand = AVM_ARG_DATA_MACRO_KIND;
+ }
+
+ else if( anInstance->getModifier().hasFeatureMutable() )
+ {
+ argCode.processor = AVM_ARG_NOP_CPU;
+ argCode.operation = AVM_ARG_NOP_LVALUE;
+ argCode.operand = AVM_ARG_DATA_KIND;
+ }
+ else
+ {
+ getCompilerTable().incrWarningCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "setArgcodeLvalue :> Unexpected the InstanceOfData << "
+ << str_header( arg ) << " >> as << " << argCode.strType()
+ << " >> argument !!!" << std::endl;
+
+ argCode.processor = AVM_ARG_NOP_CPU;
+ argCode.operation = AVM_ARG_NOP_LVALUE;
+ argCode.operand = AVM_ARG_DATA_KIND;
+ }
+ }
+
+ else if( arg.is< AvmCode >() )
+ {
+ argCode.operand = AVM_ARG_EXPRESSION_KIND;
+ }
+
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "setArgcodeLvalue :> Unexpected << "
+ << str_header( arg ) << " >> as lvalue argument typed by "
+ << argCode.strType() << " >> !!!" << std::endl;
+
+ argCode.operand = AVM_ARG_EXPRESSION_KIND;
+ }
+}
+
+
+void AbstractAvmcodeCompiler::setArgcodeLValueRef(COMPILE_CONTEXT * aCTX,
+ AvmBytecode & argCode, const BF & arg, bool needTypeChecking)
+{
+ if( arg.is< InstanceOfData >()
+ && arg.to_ptr< InstanceOfData >()->getModifier().hasNatureReference() )
+ {
+ if( aCTX->isNeedTypeChecking(needTypeChecking) )
+ {
+ if( argCode.hasType() )
+ {
+ checkArgType(aCTX, argCode.dtype, arg);
+ }
+ else if( aCTX->hasType() )
+ {
+ argCode.dtype = aCTX->mType;
+ checkArgType(aCTX, argCode.dtype, arg);
+ }
+ else
+ {
+ argCode.dtype = arg.to_ptr<
+ InstanceOfData >()->getTypeSpecifier();
+ }
+ }
+ else if( not argCode.hasType() )
+ {
+ argCode.dtype = arg.to_ptr<
+ InstanceOfData >()->getTypeSpecifier();
+ }
+
+ argCode.processor = AVM_ARG_NOP_CPU;
+ argCode.operation = AVM_ARG_NOP_LVALUE;
+ argCode.operand = AVM_ARG_DATA_REF_KIND;
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "setArgcodeLvalue :> Unexpected << "
+ << str_header( arg ) << " >> as << " << argCode.strType()
+ << " >> reference InstanceOfData argument !!!" << std::endl;
+
+ argCode.processor = AVM_ARG_NOP_CPU;
+ argCode.operation = AVM_ARG_NOP_LVALUE;
+ argCode.operand = AVM_ARG_EXPRESSION_KIND;
+ }
+}
+
+
+void AbstractAvmcodeCompiler::setArgcodeLValueMacro(COMPILE_CONTEXT * aCTX,
+ AvmBytecode & argCode, const BF & arg, bool needTypeChecking)
+{
+ if( arg.is< InstanceOfData >()
+ && arg.to_ptr< InstanceOfData >()->getModifier().hasNatureMacro() )
+ {
+ if( aCTX->isNeedTypeChecking(needTypeChecking) )
+ {
+ if( argCode.hasType() )
+ {
+ checkArgType(aCTX, argCode.dtype, arg);
+ }
+ else if( aCTX->hasType() )
+ {
+ argCode.dtype = aCTX->mType;
+ checkArgType(aCTX, argCode.dtype, arg);
+ }
+ else
+ {
+ argCode.dtype = arg.to_ptr<
+ InstanceOfData >()->getTypeSpecifier();
+ }
+ }
+ else if( not argCode.hasType() )
+ {
+ argCode.dtype = arg.to_ptr<
+ InstanceOfData >()->getTypeSpecifier();
+ }
+
+ argCode.processor = AVM_ARG_NOP_CPU;
+ argCode.operation = AVM_ARG_NOP_LVALUE;
+ argCode.operand = AVM_ARG_DATA_MACRO_KIND;
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "setArgcodeLvalue :> Unexpected << "
+ << str_header( arg ) << " >> as << " << argCode.strType()
+ << " >> macro InstanceOfData argument !!!" << std::endl;
+
+ argCode.processor = AVM_ARG_NOP_CPU;
+ argCode.operation = AVM_ARG_NOP_LVALUE;
+ argCode.operand = AVM_ARG_EXPRESSION_KIND;
+ }
+}
+
+
+void AbstractAvmcodeCompiler::setArgcodeRValue(COMPILE_CONTEXT * aCTX,
+ AvmBytecode & argCode, BF & arg, bool needTypeChecking)
+{
+ if( argCode.dtype->isTypedArray() )
+ {
+ setArgcodeRValueArray(aCTX, argCode, arg, needTypeChecking);
+
+ return;
+ }
+
+ if( aCTX->isNeedTypeChecking(needTypeChecking) )
+ {
+ checkArgType(aCTX, argCode.dtype, arg);
+ }
+
+ if( arg.is< ArrayBF >() )
+ {
+ setArgcodeRValueArray(aCTX, argCode,
+ arg.to_ptr< ArrayBF >(), needTypeChecking);
+ }
+ else if( arg.isBuiltinValue() )
+ {
+// argCode.processor = AVM_ARG_ARITHMETIC_LOGIC_CPU;
+ argCode.processor = AVM_ARG_NOP_CPU;
+ argCode.operation = AVM_ARG_NOP_RVALUE;
+
+ if( arg.is< Boolean >() )
+ {
+ argCode.operand = AVM_ARG_BOOLEAN_KIND;
+ }
+ else if( arg.is< Integer >() )
+ {
+ argCode.operand = AVM_ARG_INTEGER_KIND;
+ }
+ else if( arg.is< Rational >() )
+ {
+ argCode.operand = AVM_ARG_RATIONAL_KIND;
+ }
+ else if( arg.is< Float >() )
+ {
+ argCode.operand = AVM_ARG_FLOAT_KIND;
+ }
+ else if( arg.is< Character >() )
+ {
+// argCode.processor = AVM_ARG_CHARACTER_CPU;
+ argCode.operand = AVM_ARG_CHARACTER_KIND;
+ }
+ else if( arg.is< String >() )
+ {
+// argCode.processor = AVM_ARG_STRING_CPU;
+ argCode.operand = AVM_ARG_STRING_KIND;
+ }
+ else
+ {
+ argCode.operand = AVM_ARG_BUILTIN_KIND;
+ }
+ }
+
+ else if( arg.is< InstanceOfData >() )
+ {
+ InstanceOfData * anInstance = arg.to_ptr< InstanceOfData >();
+
+ argCode.processor = anInstance->isTypedMachine() ?
+ AVM_ARG_MEMORY_MACHINE_CPU : AVM_ARG_MEMORY_RVALUE_CPU;
+
+ argCode.operation = AVM_ARG_SEVAL_RVALUE;
+
+ if( anInstance->isUfiMixedPointer() )
+ {
+ argCode.operand = AVM_ARG_DATA_UFI_KIND;
+ }
+ else if( anInstance->getModifier().hasNatureReference() )
+ {
+ argCode.operand = (anInstance->isUfiOffsetPointer() ?
+ AVM_ARG_DATA_UFI_KIND : AVM_ARG_DATA_REF_KIND);
+ }
+ else if( anInstance->getModifier().hasNatureMacro() )
+ {
+ argCode.operand = AVM_ARG_DATA_MACRO_KIND;
+ }
+
+ else if( anInstance->getModifier().hasFeatureMutable() )
+ {
+ argCode.operand = AVM_ARG_DATA_KIND;
+ }
+
+ else if( anInstance->getModifier().hasModifierPublicFinalStatic() )
+ {
+ if( anInstance->isTypedEnum() && anInstance->hasValue() )
+ {
+ arg = anInstance->getValue();
+ setArgcodeRValue(aCTX, argCode, arg, false);
+ }
+ else
+ {
+ argCode.processor = AVM_ARG_MEMORY_MACHINE_CPU;
+
+ if( ExecutableLib::MACHINE_COMPONENT_SELF == anInstance )
+ {
+ argCode.operand = AVM_ARG_COMPONENT_SELF_RID;
+ }
+ else if( ExecutableLib::MACHINE_COMPONENT_PARENT == anInstance )
+ {
+ argCode.operand = AVM_ARG_COMPONENT_PARENT_RID;
+ }
+ else if( ExecutableLib::MACHINE_COMPONENT_COMMUNICATOR == anInstance )
+ {
+ argCode.operand = AVM_ARG_COMPONENT_COMMUNICATOR_RID;
+ }
+
+ else if( ExecutableLib::MACHINE_ENVIRONMENT == anInstance )
+ {
+ argCode.operand = AVM_ARG_ENVIRONMENT_RID;
+ }
+
+ else if( ExecutableLib::MACHINE_SYSTEM == anInstance )
+ {
+ argCode.operand = AVM_ARG_SYSTEM_RID;
+ }
+
+ else if( ExecutableLib::MACHINE_SELF == anInstance )
+ {
+ argCode.operand = AVM_ARG_SELF_RID;
+ }
+ else if( ExecutableLib::MACHINE_PARENT == anInstance )
+ {
+ argCode.operand = AVM_ARG_PARENT_RID;
+ }
+ else if( ExecutableLib::MACHINE_COMMUNICATOR == anInstance )
+ {
+ argCode.operand = AVM_ARG_COMMUNICATOR_RID;
+ }
+ else
+ {
+ argCode.processor = AVM_ARG_NOP_CPU;
+ argCode.operation = AVM_ARG_NOP_RVALUE;
+ argCode.operand = AVM_ARG_DATA_CST_KIND;
+ }
+ }
+ }
+ else if( anInstance->getModifier().hasFeatureFinal() )
+ {
+ argCode.processor = AVM_ARG_NOP_CPU;
+ argCode.operation = AVM_ARG_NOP_RVALUE;
+ argCode.operand = AVM_ARG_DATA_CST_KIND;
+ }
+
+ else
+ {
+ getCompilerTable().incrWarningCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "setArgcodeRvalue :> Unexpected the InstanceOfData << "
+ << str_header( anInstance ) << " >> as << "
+ << argCode.strType() << " >> argument !!!" << std::endl;
+
+ argCode.operation = AVM_ARG_NOP_RVALUE;
+ argCode.operand = AVM_ARG_DATA_KIND;
+ }
+
+ if( argCode.dtype == TypeManager::UNIVERSAL )
+ {
+ argCode.dtype = anInstance->getTypeSpecifier();
+ }
+
+ }
+
+ else if( arg.is< RuntimeID >() )
+ {
+ argCode.processor = AVM_ARG_NOP_CPU;
+ argCode.operation = AVM_ARG_NOP_RVALUE;
+ argCode.operand = AVM_ARG_MACHINE_RID;
+ }
+
+ else if( arg.is< InstanceOfMachine >() )
+ {
+ argCode.processor = AVM_ARG_MEMORY_MACHINE_CPU;
+
+ if( (not argCode.hasType()) || argCode.dtype->isTypedMachine() )
+ {
+ argCode.operation = AVM_ARG_SEVAL_RVALUE;
+ argCode.operand = AVM_ARG_MACHINE_RID;
+ }
+ else
+ {
+ argCode.operation = AVM_ARG_NOP_RVALUE;
+ argCode.operand = AVM_ARG_DATA_KIND;
+ }
+ }
+ else if( arg.is< InstanceOfPort >() )
+ {
+ argCode.processor = AVM_ARG_NOP_CPU;
+ argCode.operation = AVM_ARG_NOP_RVALUE;
+ argCode.operand = AVM_ARG_PORT_KIND;
+ }
+ else if( arg.is< InstanceOfBuffer >() )
+ {
+ argCode.processor = AVM_ARG_NOP_CPU;
+ argCode.operation = AVM_ARG_NOP_RVALUE;
+ argCode.operand = AVM_ARG_BUFFER_KIND;
+ }
+ else if( arg.is< InstanceOfConnect >() )
+ {
+ argCode.processor = AVM_ARG_NOP_CPU;
+ argCode.operation = AVM_ARG_NOP_RVALUE;
+ argCode.operand = AVM_ARG_CONNECTOR_KIND;
+ }
+
+ else if( arg.is< BaseInstanceForm >() )
+ {
+ argCode.processor = AVM_ARG_NOP_CPU;
+ argCode.operation = AVM_ARG_NOP_RVALUE;
+ argCode.operand = AVM_ARG_DATA_KIND;
+ }
+
+
+ else if( arg.is< AvmCode >() )
+ {
+ if( not arg.to_ptr< AvmCode >()->hasInstruction() )
+ {
+ arg = AVMCODE_COMPILER.optimizeExpression(aCTX, arg.bfCode());
+ }
+
+ argCode = argcodeOfExpression(aCTX, arg.to_ptr< AvmCode >());
+ }
+
+ else if( arg.is< Operator >()
+ && ( (not argCode.hasType())
+ || argCode.dtype->isTypedOperator() ) )
+ {
+ argCode.processor = AVM_ARG_NOP_CPU;
+ argCode.operation = AVM_ARG_NOP_RVALUE;
+ argCode.operand = AVM_ARG_OPERATOR_KIND;
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "setArgcodeRvalue :> Unexpected << "
+ << str_header( arg ) << " >> as << " << argCode.strType()
+ << " >> argument !!!" << std::endl;
+
+ argCode.processor = AVM_ARG_ARITHMETIC_LOGIC_CPU;
+ argCode.operation = AVM_ARG_SEVAL_RVALUE;
+ argCode.operand = AVM_ARG_EXPRESSION_KIND;
+ }
+}
+
+
+AvmBytecode AbstractAvmcodeCompiler::argcodeOfExpression(
+ COMPILE_CONTEXT * aCTX, AvmCode * aCode)
+{
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( aCode->hasInstruction() )
+ << "setArgcodeRvalue :> Unexpected << " << aCode->str()
+ << " >> without compileInstruction !!!"
+ << SEND_EXIT;
+
+ AvmBytecode argCode = aCode->getInstruction()->getMainBytecode();
+
+ if(StatementTypeChecker::isAssign(aCode) )
+ {
+ argCode.processor = AVM_ARG_MEMORY_RVALUE_CPU;
+ if( argCode.isNopOperation() )
+ {
+ argCode.operation = AVM_ARG_SEVAL_RVALUE;
+ }
+ }
+ else if(StatementTypeChecker::isCommunication(aCode) )
+ {
+ argCode.processor = AVM_ARG_STATEMENT_CPU;
+ argCode.operation = AVM_ARG_SEVAL_RVALUE;
+ argCode.operand = AVM_ARG_STATEMENT_KIND;
+ }
+
+ else if(ExpressionTypeChecker::isCtor(aCode) )
+ {
+ argCode.operand = AVM_ARG_EXPRESSION_KIND;
+ }
+ return( argCode );
+}
+
+
+
+void AbstractAvmcodeCompiler::setArgcodeRValueArray(COMPILE_CONTEXT * aCTX,
+ AvmBytecode & argCode, BF & arg, bool needTypeChecking)
+{
+ ContainerTypeSpecifier * arrayT =
+ argCode.dtype->as< ContainerTypeSpecifier >();
+
+ if( arg.is< ArrayBF >() )
+ {
+ if( aCTX->isNeedTypeChecking(needTypeChecking) )
+ {
+ checkArgType(aCTX, argCode.dtype, arg);
+ }
+
+ ArrayBF * argArray = arg.to_ptr< ArrayBF >();
+
+
+ if( argArray->size() < arrayT->size() )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "setArgcodeRValueArray :> Too few element in array :>\n<< "
+ << arg.str() << " >>\nas type << " << arrayT->strT()
+ << " >> argument !!!" << std::endl;
+ }
+ else if( argArray->size() > arrayT->size() )
+ {
+ getCompilerTable().incrWarningCount();
+ aCTX->warningContext( AVM_OS_WARN )
+ << "setArgcodeRValueArray :> Too much element in array\n<< "
+ << arg.str() << " >>\nas type << " << arrayT->strType()
+ << " >> argument !!!" << std::endl;
+
+ ArrayBF * reducedArgArray = new ArrayBF(arrayT, arrayT->size());
+
+ for( avm_size_t idx = 0 ; idx < arrayT->size() ; ++idx )
+ {
+ reducedArgArray->set(idx, argArray->at(idx));
+ }
+
+ arg.renew( reducedArgArray );
+
+ setArgcodeRValueArray(aCTX, argCode,
+ reducedArgArray, needTypeChecking);
+ }
+ else
+ {
+ setArgcodeRValueArray(aCTX, argCode,
+ arg.to_ptr< ArrayBF >(), needTypeChecking);
+ }
+ }
+
+
+ else if( arg.is< InstanceOfData >()
+ && ExpressionTypeChecker::weaklyTyped( arrayT,
+ arg.to_ptr< InstanceOfData >()->getTypeSpecifier() ) )
+ {
+ argCode.processor = AVM_ARG_MEMORY_RVALUE_CPU;
+ argCode.operation = AVM_ARG_SEVAL_RVALUE;
+ argCode.operand = AVM_ARG_DATA_KIND;
+ }
+
+ else if( ExpressionTypeChecker::isTyped(arrayT, arg) )
+ {
+ argCode.processor = AVM_ARG_ARITHMETIC_LOGIC_CPU;
+ argCode.operation = AVM_ARG_SEVAL_RVALUE;
+ argCode.operand = AVM_ARG_EXPRESSION_KIND;
+ }
+
+ else
+ {
+ while( arrayT->getContentsTypeSpecifier().isTypedArray() )
+ {
+ arrayT = arrayT->getContentsTypeSpecifier().rawContainer();
+ }
+ if( aCTX->isNeedTypeChecking(needTypeChecking) )
+ {
+ checkArgType(aCTX, arrayT->getContentsTypeSpecifier(), arg);
+ }
+
+ argCode.processor = AVM_ARG_ARRAY_RVALUE_CPU;
+ argCode.operation = AVM_ARG_SEVAL_RVALUE;
+ argCode.operand = operandOf(arg);
+ }
+}
+
+void AbstractAvmcodeCompiler::setArgcodeRValueArray(COMPILE_CONTEXT * aCTX,
+ AvmBytecode & argCode, ArrayBF * argArray, bool needTypeChecking)
+{
+ avm_size_t argArraySize = argArray->size();
+
+ argCode.processor = AVM_ARG_ARRAY_RVALUE_CPU;
+ argCode.operation = AVM_ARG_NOP_RVALUE;
+ argCode.operand = AVM_ARG_BUILTIN_ARRAY_KIND;
+
+ for( avm_size_t idx = 0 ; idx < argArraySize ; ++idx )
+ {
+ if( mustBeEvaluatedArgument(argArray->at(idx)) )
+ {
+ argCode.operation = AVM_ARG_SEVAL_RVALUE;
+ argCode.operand = AVM_ARG_ARRAY_KIND;
+ break;
+ }
+ }
+
+
+ AvmInstruction * arrayInstruction = new AvmInstruction( argArraySize );
+
+ argArray->setInstruction( arrayInstruction );
+
+ // Global ArgCode
+ arrayInstruction->setMainBytecode(argCode);
+
+ if( argArray->getTypeSpecifier()->is< ClassTypeSpecifier >() )
+ {
+ ClassTypeSpecifier * structT =
+ argArray->getTypeSpecifier()->to< ClassTypeSpecifier >();
+
+ for( avm_size_t idx = 0 ; idx < argArraySize ; ++idx )
+ {
+ setArgcodeRValue(
+ aCTX->clone(structT->getSymbolData(idx).getTypeSpecifier()),
+ arrayInstruction->at(idx), argArray->at(idx), needTypeChecking);
+
+ arrayInstruction->at(idx).offset = idx;
+ }
+ }
+ else
+ {
+ if( argArray->getTypeSpecifier()->is< ContainerTypeSpecifier >() )
+ {
+ aCTX = aCTX->clone( argArray->getTypeSpecifier()->
+ to< ContainerTypeSpecifier >()->getContentsTypeSpecifier() );
+ }
+ else
+ {
+ needTypeChecking = false;
+ }
+
+ for( avm_size_t idx = 0 ; idx < argArraySize ; ++idx )
+ {
+ setArgcodeRValue(aCTX, arrayInstruction->at(idx),
+ argArray->at(idx), needTypeChecking);
+
+ arrayInstruction->at(idx).offset = idx;
+ }
+ }
+}
+
+
+void AbstractAvmcodeCompiler::setArgcodeContainerWValue(COMPILE_CONTEXT * aCTX,
+ AvmBytecode & argCode, const BF & arg)
+{
+ argCode.processor = AVM_ARG_MEMORY_WVALUE_CPU;
+
+ if( arg.is< BuiltinContainer >() )
+ {
+ argCode.operation = AVM_ARG_SEVAL_WVALUE;
+ argCode.operand = AVM_ARG_BUILTIN_CONTAINER_KIND;
+ }
+
+ else if( arg.is< InstanceOfBuffer >() )
+ {
+ argCode.operation = AVM_ARG_SEVAL_WVALUE;
+ argCode.operand = AVM_ARG_BUFFER_KIND;
+ argCode.dtype = TypeManager::BUFFER;
+
+ }
+
+ else if( arg.is< InstanceOfData >() )
+ {
+ argCode.operation = AVM_ARG_SEVAL_WVALUE;
+
+ InstanceOfData * anInstance = arg.to_ptr< InstanceOfData >();
+
+ if( anInstance->isUfiMixedPointer() )
+ {
+ argCode.operand = AVM_ARG_DATA_UFI_KIND;
+ }
+ else if( anInstance->getModifier().hasNatureReference() )
+ {
+ argCode.operand = (anInstance->isUfiOffsetPointer() ?
+ AVM_ARG_DATA_UFI_KIND : AVM_ARG_DATA_REF_KIND);
+ }
+ else if( anInstance->getModifier().hasNatureMacro() )
+ {
+ argCode.operand = AVM_ARG_DATA_MACRO_KIND;
+ }
+
+ else if( anInstance->getModifier().hasFeatureMutable() )
+ {
+ argCode.operand = AVM_ARG_DATA_KIND;
+ }
+
+ else
+ {
+ getCompilerTable().incrWarningCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "setArgcodeContainerWValue :> "
+ "Unexpected the InstanceOfData << "
+ << str_header( anInstance ) << " >> as << "
+ << argCode.strType() << " >> argument !!!" << std::endl;
+
+ argCode.operation = AVM_ARG_NOP_RVALUE;
+ argCode.operand = AVM_ARG_DATA_KIND;
+ }
+
+ if( anInstance->isTypedBuffer() || anInstance->hasTypeCollection() )
+ {
+ argCode.dtype = anInstance->getTypeSpecifier();
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "setArgcodeContainerWValue :> Unexpected << "
+ << str_header( anInstance ) << " >> as << Collection< T >"
+ << " >> argument !!!" << std::endl;
+
+ AVM_OS_WARN << "The type below, is there a type of "
+ "collection ? If yes, you found a BUG ! "
+ << std::endl
+ << to_stream( anInstance->referedTypeSpecifier() );
+ }
+ }
+
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "setArgcodeContainerWValue :> Unexpected << "
+ << str_header( arg ) << " >> as << container >> argument !!!"
+ << std::endl;
+
+ argCode.operation = AVM_ARG_SEVAL_WVALUE;
+ argCode.operand = AVM_ARG_EXPRESSION_KIND;
+ }
+}
+
+
+void AbstractAvmcodeCompiler::setArgcodeContainerRValue(COMPILE_CONTEXT * aCTX,
+ AvmBytecode & argCode, const BF & arg)
+{
+ if( arg.is< BuiltinContainer >() )
+ {
+ argCode.processor = AVM_ARG_COLLECTION_CPU;
+ argCode.operation = AVM_ARG_NOP_RVALUE;
+ argCode.operand = AVM_ARG_BUILTIN_CONTAINER_KIND;
+ }
+
+ else if( arg.is< InstanceOfBuffer >() )
+ {
+ argCode.processor = AVM_ARG_BUFFER_CPU;
+ argCode.operation = AVM_ARG_SEVAL_RVALUE;
+ argCode.operand = AVM_ARG_BUFFER_KIND;
+ argCode.dtype = TypeManager::BUFFER;
+
+ }
+
+ else if( arg.is< InstanceOfData >() )
+ {
+ argCode.processor = AVM_ARG_MEMORY_RVALUE_CPU;
+ argCode.operation = AVM_ARG_SEVAL_RVALUE;
+
+ InstanceOfData * anInstance = arg.to_ptr< InstanceOfData >();
+
+ if( anInstance->isUfiMixedPointer() )
+ {
+ argCode.operand = AVM_ARG_DATA_UFI_KIND;
+ }
+ else if( anInstance->getModifier().hasNatureReference() )
+ {
+ argCode.operand = (anInstance->isUfiOffsetPointer() ?
+ AVM_ARG_DATA_UFI_KIND : AVM_ARG_DATA_REF_KIND);
+ }
+ else if( anInstance->getModifier().hasNatureMacro() )
+ {
+ argCode.operand = AVM_ARG_DATA_MACRO_KIND;
+ }
+
+ else if( anInstance->getModifier().hasFeatureMutable() )
+ {
+ argCode.operand = AVM_ARG_DATA_KIND;
+ }
+
+ else
+ {
+ getCompilerTable().incrWarningCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "setArgcodeContainerRValue :> "
+ "Unexpected the InstanceOfData << "
+ << str_header( anInstance ) << " >> as << "
+ << argCode.strType() << " >> argument !!!" << std::endl;
+
+ argCode.operation = AVM_ARG_NOP_RVALUE;
+ argCode.operand = AVM_ARG_DATA_KIND;
+ }
+
+ if( anInstance->isTypedBuffer()
+ || anInstance->isTypedString()
+ || anInstance->hasTypeCollection() )
+ {
+ argCode.dtype = anInstance->getTypeSpecifier();
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "setArgcodeContainerRValue :> Unexpected << "
+ << str_header( anInstance ) << " >> as << Collection< T >"
+ << " >> argument !!!" << std::endl;
+
+ AVM_OS_WARN << "The type below, is there a type of "
+ "collection ? if yes, you found a BUG ! "
+ << std::endl
+ << to_stream( anInstance->referedTypeSpecifier() );
+ }
+ }
+
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "setArgcodeContainerRValue :> Unexpected << "
+ << arg.raw_pointer()->classKindInfo() << " : " << str_header( arg )
+ << " >> as << container >> argument !!!" << std::endl;
+
+ argCode.operation = AVM_ARG_SEVAL_RVALUE;
+ argCode.operand = AVM_ARG_EXPRESSION_KIND;
+ }
+}
+
+
+
+void AbstractAvmcodeCompiler::setArgcodeStatement(COMPILE_CONTEXT * aCTX,
+ AvmBytecode & argCode, const BF & arg, bool needTypeChecking)
+{
+ argCode.dtype = TypeManager::AVMCODE;
+ if( aCTX->isNeedTypeChecking(needTypeChecking) )
+ {
+ checkArgType(aCTX, argCode.dtype, arg);
+ }
+
+ argCode.operation = AVM_ARG_UNDEFINED_OPERATION;
+ argCode.operand = AVM_ARG_UNDEFINED_OPERAND;
+
+ if( arg.is< InstanceOfData >() )
+ {
+ InstanceOfData * anInstance = arg.to_ptr< InstanceOfData >();
+
+ argCode.processor = AVM_ARG_MEMORY_RVALUE_CPU;
+ argCode.operation = AVM_ARG_SEVAL_RVALUE;
+
+ if( anInstance->isUfiMixedPointer() )
+ {
+ argCode.operand = AVM_ARG_DATA_UFI_KIND;
+ }
+ else if( anInstance->getModifier().hasNatureReference() )
+ {
+ argCode.operand = (anInstance->isUfiOffsetPointer() ?
+ AVM_ARG_DATA_UFI_KIND : AVM_ARG_DATA_REF_KIND);
+ }
+ else if( anInstance->getModifier().hasNatureMacro() )
+ {
+ argCode.operand = AVM_ARG_DATA_MACRO_KIND;
+ }
+ else if( anInstance->getModifier().hasFeatureMutable() )
+ {
+ argCode.operand = AVM_ARG_DATA_KIND;
+ }
+ }
+ else if( arg.is< AvmCode >() )
+ {
+ argCode.processor = AVM_ARG_NOP_CPU;
+ argCode.operation = AVM_ARG_NOP_RVALUE;
+ argCode.operand = AVM_ARG_STATEMENT_KIND;
+ }
+
+ if( (argCode.operation == AVM_ARG_UNDEFINED_OPERATION)
+ && (argCode.operand == AVM_ARG_UNDEFINED_OPERAND) )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "setArgcodeStatement :> Unexpected << "
+ << str_header( arg ) << " >> as << "
+ << argCode.strType() << " >> argument !!!" << std::endl;
+
+ argCode.operation = AVM_ARG_SEVAL_RVALUE;
+ argCode.operand = AVM_ARG_STATEMENT_KIND;
+ }
+}
+
+
+
+ExecutableForm * AbstractAvmcodeCompiler::getExecutableMachine(
+ COMPILE_CONTEXT * aCTX, const BF & arg)
+{
+ switch( arg.classKind() )
+ {
+ case FORM_RUNTIME_ID_KIND:
+ {
+ return( arg.bfRID().getExecutable() );
+ }
+
+ case FORM_INSTANCE_MACHINE_KIND:
+ {
+ return( arg.to_ptr< InstanceOfMachine >()->getExecutable() );
+ }
+
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ InstanceOfData * anInstance = arg.to_ptr< InstanceOfData >();
+
+ if( anInstance->isTypedMachine()
+ && anInstance->getModifier().hasModifierPublicFinalStatic() )
+ {
+ ExecutableForm * anExecutable = aCTX->mCompileCtx->getExecutable();
+
+ if( ExecutableLib::MACHINE_COMPONENT_SELF == anInstance )
+ {
+ while( anExecutable != NULL )
+ {
+ if( anExecutable->isMainComponent() )
+ {
+ return( anExecutable );
+ }
+ anExecutable = anExecutable->getExecutableContainer();
+ }
+ return( anExecutable );
+ }
+ else if( ExecutableLib::MACHINE_COMPONENT_PARENT == anInstance )
+ {
+ for( bool isParent = false ; anExecutable != NULL ; )
+ {
+ if( anExecutable->isMainComponent() )
+ {
+ if( isParent )
+ {
+ return( anExecutable );
+ }
+ isParent = true;
+ }
+ anExecutable = anExecutable->getExecutableContainer();
+ }
+ return( anExecutable );
+ }
+ else if( ExecutableLib::MACHINE_COMPONENT_COMMUNICATOR
+ == anInstance )
+ {
+ while( anExecutable != NULL )
+ {
+ if( anExecutable->isMainComponent()
+ && anExecutable->hasPort() )
+ {
+ return( anExecutable );
+ }
+ anExecutable = anExecutable->getExecutableContainer();
+ }
+ return( anExecutable );
+ }
+
+ else if( ExecutableLib::MACHINE_SYSTEM == anInstance )
+ {
+ while( anExecutable->hasContainer() )
+ {
+ anExecutable = anExecutable->getExecutableContainer();
+ }
+ return( anExecutable );
+ }
+
+ if( ExecutableLib::MACHINE_SELF == anInstance )
+ {
+ return( anExecutable );
+ }
+ else if( ExecutableLib::MACHINE_PARENT == anInstance )
+ {
+ return( anExecutable->getExecutableContainer() );
+ }
+ else if( ExecutableLib::MACHINE_COMMUNICATOR == anInstance )
+ {
+ while( anExecutable != NULL )
+ {
+ if( anExecutable->hasPort() )
+ {
+ return( anExecutable );
+ }
+ anExecutable = anExecutable->getExecutableContainer();
+ }
+ return( anExecutable );
+ }
+ }
+
+ return( NULL );
+ }
+
+ case FORM_UFI_KIND:
+ case FORM_AVMCODE_KIND:
+ default:
+ {
+ return( NULL );
+ }
+ }
+
+ return( NULL );
+}
+
+
+
+void AbstractAvmcodeCompiler::checkArgType(COMPILE_CONTEXT * aCTX,
+ BaseTypeSpecifier * aType, const BF & arg)
+{
+ if( (aType == NULL) || aType->isTypedUniversal() )
+ {
+ return;
+ }
+ else if( not ExpressionTypeChecker::isTyped(aType, arg) )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "checkArgType :> Unexpected << ";
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ AVM_OS_WARN << std::endl << arg;
+AVM_ELSE
+ AVM_OS_WARN << str_header( arg );
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ AVM_OS_WARN << " >> as << " << aType->strT()
+ << " >> argument !!!" << std::endl;
+
+ if( aType->isTypedAlias() )
+ {
+ AVM_OS_WARN << "Info: << " << aType->strT()
+ << " >> is an alias or a typedef of :> "
+ << aType->referedTypeSpecifier()->strT() << std::endl;
+ }
+ }
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AbstractAvmcodeCompiler.h b/org.eclipse.efm.symbex/src/builder/primitive/AbstractAvmcodeCompiler.h
new file mode 100644
index 0000000..780e9ce
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AbstractAvmcodeCompiler.h
@@ -0,0 +1,478 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 7 avr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef ABSTRACTAVMCODECOMPILER_H_
+#define ABSTRACTAVMCODECOMPILER_H_
+
+#include <common/AvmObject.h>
+
+#include <builder/compiler/BaseCompilerTable.h>
+
+#include <builder/primitive/AvmcodeCompiler.h>
+#include <builder/primitive/CompilationEnvironment.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+
+
+namespace sep
+{
+
+class ArrayBF;
+class AvmBytecode;
+
+class BaseAvmProgram;
+class Element;
+
+class ExecutableForm;
+
+class SymbolTable;
+
+
+class AbstractAvmcodeCompiler : public AvmObject
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AbstractAvmcodeCompiler(AvmcodeCompiler & aCodeCompiler)
+ : AvmObject( ),
+ AVMCODE_COMPILER( aCodeCompiler )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AbstractAvmcodeCompiler()
+ {
+ //!! NOTHING
+ }
+
+
+ /*
+ * GETTER
+ * theCompilerTable
+ */
+ inline BaseCompilerTable & getCompilerTable()
+ {
+ return( AVMCODE_COMPILER.getCompilerTable() );
+ }
+
+
+ /*
+ * GETTER
+ * theSymbolTable
+ */
+ inline SymbolTable & getSymbolTable()
+ {
+ return( AVMCODE_COMPILER.getSymbolTable() );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SPECIFIC ARGUMENT COMPILATION
+ ////////////////////////////////////////////////////////////////////////////
+
+ BF compileArgLvalue(COMPILE_CONTEXT * aCTX, const BF & arg);
+
+ BF compileArgRvalue(COMPILE_CONTEXT * aCTX,
+ const TypeSpecifier & aType, const BF & arg)
+ {
+ return( compileArgRvalue(aCTX->clone(aType), arg,
+ (aType != TypeManager::UNIVERSAL)) );
+ }
+
+ BF compileArgRvalue(COMPILE_CONTEXT * aCTX, const BF & arg,
+ bool needTypeChecking = false);
+
+ inline BF compileArgStatement(COMPILE_CONTEXT * aCTX, const BF & arg)
+ {
+ return( AVMCODE_COMPILER.decode_compileStatement(aCTX, arg) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // EXPRESSION COMPILATION STEP
+ ////////////////////////////////////////////////////////////////////////////
+
+ BFCode compileExpressionCode(COMPILE_CONTEXT * aCTX,
+ const BFCode & aCode);
+
+ inline virtual BF compileExpression(COMPILE_CONTEXT * aCTX,
+ const BFCode & aCode)
+ {
+ return( compileExpressionCode(aCTX, aCode) );
+ }
+
+
+ BFCode optimizeExpressionCode(COMPILE_CONTEXT * aCTX, const BFCode & aCode,
+ avm_arg_operand_t anOperand = AVM_ARG_EXPRESSION_KIND);
+
+ inline virtual BF optimizeExpression(COMPILE_CONTEXT * aCTX,
+ const BFCode & aCode)
+ {
+ return( optimizeExpressionCode(aCTX, aCode) );
+ }
+
+
+ inline void optimizeArgExpression(COMPILE_CONTEXT * aCTX,
+ const BFCode & aCode, avm_offset_t offset)
+ {
+ if( aCode->at(offset).is< AvmCode >() )
+ {
+ aCode->safe_set( offset,
+ AVMCODE_COMPILER.optimizeExpression(
+ aCTX, aCode->at(offset).bfCode()) );
+ }
+ }
+
+ inline void optimizeArgStatement(COMPILE_CONTEXT * aCTX,
+ const BFCode & aCode, avm_offset_t offset)
+ {
+ if( aCode->at(offset).is< AvmCode >() )
+ {
+ aCode->safe_set( offset,
+ AVMCODE_COMPILER.optimizeStatement(
+ aCTX, aCode->at(offset).bfCode()) );
+ }
+ }
+
+
+ inline void optimizeArgExpression(COMPILE_CONTEXT * aCTX,
+ BFCodeList & listOfCodes)
+ {
+ BFCodeList::iterator itCode = listOfCodes.begin();
+ BFCodeList::iterator endCode = listOfCodes.end();
+ for( ; itCode != endCode ; ++itCode )
+ {
+ (*itCode) = AVMCODE_COMPILER.optimizeExpression(aCTX, (*itCode));
+ }
+ }
+
+ inline void optimizeArgStatement(COMPILE_CONTEXT * aCTX,
+ BFCodeList & listOfCodes)
+ {
+ BFCodeList::iterator itCode = listOfCodes.begin();
+ BFCodeList::iterator endCode = listOfCodes.end();
+ for( ; itCode != endCode ; ++itCode )
+ {
+ (*itCode) = AVMCODE_COMPILER.optimizeStatement(aCTX, (*itCode));
+ }
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // STATEMENT COMPILATION STEP
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual BFCode compileStatementCode(COMPILE_CONTEXT * aCTX,
+ const BFCode & aCode);
+
+ inline virtual BFCode optimizeStatementCode(COMPILE_CONTEXT * aCTX,
+ const BFCode & aCode)
+ {
+ return( optimizeExpressionCode(aCTX, aCode, AVM_ARG_STATEMENT_KIND) );
+ }
+
+
+
+ inline virtual BFCode compileStatement(COMPILE_CONTEXT * aCTX,
+ const BFCode & aCode)
+ {
+ return( compileStatementCode(aCTX, aCode) );
+ }
+
+ inline virtual BFCode optimizeStatement(COMPILE_CONTEXT * aCTX,
+ const BFCode & aCode)
+ {
+ return( aCode );
+// return( optimizeStatementCode(aCTX, aCode) );
+ }
+
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // AVMCODE COMPILATION STEP
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual BFCode compileAvmcode(COMPILE_CONTEXT * aCTX, const BFCode & aCode);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM OPCODE COMPILATION
+ ////////////////////////////////////////////////////////////////////////////
+
+ static bool mustBeEvaluatedArgument(const BF & arg);
+
+ static bool mustBeEvaluatedArgumentArray(ArrayBF * arrayArg);
+
+
+ avm_arg_operand_t operandOf(const BF & arg);
+
+ avm_arg_processor_t processorOf(BaseTypeSpecifier * aType);
+
+ avm_arg_operand_t operandOf(BaseTypeSpecifier * aType);
+
+
+ void setArgcodeLValue(COMPILE_CONTEXT * aCTX, AvmBytecode & argCode,
+ const BF & arg, bool needTypeChecking = true);
+
+ void setArgcodeLValueRef(COMPILE_CONTEXT * aCTX, AvmBytecode & argCode,
+ const BF & arg, bool needTypeChecking = true);
+
+ void setArgcodeLValueMacro(COMPILE_CONTEXT * aCTX, AvmBytecode & argCode,
+ const BF & arg, bool needTypeChecking = true);
+
+
+ void setArgcodeRValue(COMPILE_CONTEXT * aCTX, AvmBytecode & argCode,
+ BF & arg, bool needTypeChecking = true);
+
+ AvmBytecode argcodeOfExpression(COMPILE_CONTEXT * aCTX, AvmCode * aCode);
+
+
+ void setArgcodeRValueArray(COMPILE_CONTEXT * aCTX, AvmBytecode & argCode,
+ BF & arg, bool needTypeChecking = true);
+
+ void setArgcodeRValueArray(COMPILE_CONTEXT * aCTX, AvmBytecode & argCode,
+ ArrayBF * arg, bool needTypeChecking = true);
+
+ inline void setArgcodeParamValue(COMPILE_CONTEXT * aCTX,
+ AvmBytecode & argCode, BF & arg,
+ bool needTypeChecking = true)
+ {
+ setArgcodeRValue(aCTX, argCode, arg, needTypeChecking);
+ argCode.context = AVM_ARG_PARAMETER_CTX;
+ }
+
+
+ void setArgcodeContainerWValue(COMPILE_CONTEXT * aCTX,
+ AvmBytecode & argCode, const BF & arg);
+
+ void setArgcodeContainerRValue(COMPILE_CONTEXT * aCTX,
+ AvmBytecode & argCode, const BF & arg);
+
+ void setArgcodeStatement(COMPILE_CONTEXT * aCTX, AvmBytecode & argCode,
+ const BF & arg, bool needTypeChecking = true);
+
+ ExecutableForm * getExecutableMachine(COMPILE_CONTEXT * aCTX, const BF & arg);
+
+ void checkArgType(COMPILE_CONTEXT * aCTX,
+ BaseTypeSpecifier * aType, const BF & arg);
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ AvmcodeCompiler & AVMCODE_COMPILER;
+
+
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// Macro for smart avmcode compiler declaration.
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+#define AVMCODE_BASECOMPILER_CLASS_HEADER(classname, supername) \
+class classname : public supername \
+{ \
+public: \
+ classname(AvmcodeCompiler & aCompiler) \
+ : supername( aCompiler ) \
+ { /*!! NOTHING !!*/ } \
+ virtual ~classname() \
+ { /*!! NOTHING !!*/ }
+
+
+
+/**
+ * Macro for smart avmcode compiler declaration.
+ */
+
+#define AVMCODE_COMPILER_CLASS_HEADER(classname, supername) \
+AVMCODE_BASECOMPILER_CLASS_HEADER(Avmcode##classname##Compiler, supername) \
+ virtual BF compileExpression(COMPILE_CONTEXT * aCTX, const BFCode & aCode);\
+ virtual BFCode compileStatement(COMPILE_CONTEXT * aCTX, const BFCode & aCode);
+
+#define AVMCODE_COMPILER_CLASS(classname, supername) \
+ AVMCODE_COMPILER_CLASS_HEADER(classname, supername) \
+};
+
+
+
+#define AVMCODE_COMPILER_EXPRESSION_CLASS_HEADER(name, classname, supername) \
+AVMCODE_BASECOMPILER_CLASS_HEADER(Avmcode##classname##Compiler, supername) \
+ virtual BF compileExpression(COMPILE_CONTEXT * aCTX, const BFCode & aCode);\
+ BFCode compileStatement(COMPILE_CONTEXT * aCTX, const BFCode & aCode) \
+ { \
+ AVM_OS_FATAL_ERROR_EXIT << "Unexpected << " << name \
+ << " >> EXPRESSION as statement compilation !!!" \
+ << SEND_EXIT; \
+ return( aCode ); \
+ }
+
+#define AVMCODE_COMPILER_EXPRESSION_CLASS(name, classname, supername) \
+ AVMCODE_COMPILER_EXPRESSION_CLASS_HEADER(name, classname, supername) \
+};
+
+
+#define AVMCODE_COMPILER_STATEMENT_CLASS_HEADER(name, classname, supername) \
+AVMCODE_BASECOMPILER_CLASS_HEADER(Avmcode##classname##Compiler, supername) \
+ BF compileExpression(COMPILE_CONTEXT * aCTX, const BFCode & aCode) \
+ { \
+ AVM_OS_FATAL_ERROR_EXIT << "Unexpected << " << name \
+ << " STATEMENT as expression compilation !!!" \
+ << SEND_EXIT; \
+ return( aCode ); \
+ } \
+ virtual BFCode compileStatement(COMPILE_CONTEXT * aCTX, const BFCode & aCode);
+
+#define AVMCODE_COMPILER_STATEMENT_CLASS(name, classname, supername) \
+ AVMCODE_COMPILER_STATEMENT_CLASS_HEADER(name, classname, supername) \
+};
+
+
+
+#define AVMCODE_COMPILER_OPTIMIZER_CLASS_HEADER(classname, supername) \
+AVMCODE_BASECOMPILER_CLASS_HEADER(Avmcode##classname##Compiler, supername) \
+ virtual BF compileExpression(COMPILE_CONTEXT * aCTX, const BFCode & aCode);\
+ virtual BF optimizeExpression(COMPILE_CONTEXT * aCTX, const BFCode & aCode); \
+ virtual BFCode compileStatement(COMPILE_CONTEXT * aCTX, const BFCode & aCode); \
+ virtual BFCode optimizeStatement(COMPILE_CONTEXT * aCTX, const BFCode & aCode);
+
+
+#define AVMCODE_COMPILER_OPTIMIZER_CLASS(classname, supername) \
+ AVMCODE_COMPILER_OPTIMIZER_CLASS_HEADER(classname, supername) \
+};
+
+
+
+#define AVMCODE_COMPILER_EXPRESSION_OPTIMIZER_CLASS_HEADER(name, classname, supername) \
+AVMCODE_BASECOMPILER_CLASS_HEADER(Avmcode##classname##Compiler, supername) \
+ virtual BF compileExpression(COMPILE_CONTEXT * aCTX, const BFCode & aCode);\
+ virtual BF optimizeExpression(COMPILE_CONTEXT * aCTX, const BFCode & aCode); \
+ BFCode compileStatement(COMPILE_CONTEXT * aCTX, const BFCode & aCode) \
+ { \
+ AVM_OS_FATAL_ERROR_EXIT << "Unexpected << " << name \
+ << " >> EXPRESSION as statement compilation !!!" \
+ << SEND_EXIT; \
+ return( aCode ); \
+ } \
+ BFCode optimizeStatement(COMPILE_CONTEXT * aCTX, const BFCode & aCode) \
+ { \
+ AVM_OS_FATAL_ERROR_EXIT << "Unexpected << " << name \
+ << " >> EXPRESSION as statement optimization !!!" \
+ << SEND_EXIT; \
+ return( aCode ); \
+ }
+
+#define AVMCODE_COMPILER_EXPRESSION_OPTIMIZER_CLASS(name, classname, supername) \
+ AVMCODE_COMPILER_EXPRESSION_OPTIMIZER_CLASS_HEADER(name, classname, supername) \
+};
+
+
+#define AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS_HEADER(name, classname, supername) \
+AVMCODE_BASECOMPILER_CLASS_HEADER(Avmcode##classname##Compiler, supername) \
+ BF compileExpression(COMPILE_CONTEXT * aCTX, const BFCode & aCode) \
+ { \
+ AVM_OS_FATAL_ERROR_EXIT << "Unexpected << " << name \
+ << " >> STATEMENT as expression compilation !!!" \
+ << SEND_EXIT; \
+ return( aCode ); \
+ } \
+ BF optimizeExpression(COMPILE_CONTEXT * aCTX, const BFCode & aCode) \
+ { \
+ AVM_OS_FATAL_ERROR_EXIT << "Unexpected << " << name \
+ << " >> STATEMENT as expression optimization !!!" \
+ << SEND_EXIT; \
+ return( aCode ); \
+ } \
+ virtual BFCode compileStatement(COMPILE_CONTEXT * aCTX, const BFCode & aCode); \
+ virtual BFCode optimizeStatement(COMPILE_CONTEXT * aCTX, const BFCode & aCode);
+
+#define AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS(name, classname, supername) \
+ AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS_HEADER(name, classname, supername) \
+};
+
+
+
+
+#define AVMCODE_COMPILER_NO_OPTIMIZER_CLASS_HEADER(name, classname, supername) \
+AVMCODE_BASECOMPILER_CLASS_HEADER(Avmcode##classname##Compiler, supername) \
+ BF compileExpression(COMPILE_CONTEXT * aCTX, const BFCode & aCode); \
+ BF optimizeExpression(COMPILE_CONTEXT * aCTX, const BFCode & aCode) \
+ { \
+ AVM_OS_FATAL_ERROR_EXIT << "Unexpected invoke of " << name \
+ << " >> STATEMENT as expression optimization !!!" \
+ << SEND_EXIT; \
+ return( aCode ); \
+ } \
+ virtual BFCode compileStatement(COMPILE_CONTEXT * aCTX, const BFCode & aCode); \
+ virtual BFCode optimizeStatement(COMPILE_CONTEXT * aCTX, const BFCode & aCode) \
+ { \
+ AVM_OS_FATAL_ERROR_EXIT << "Unexpected invoke of " << name \
+ << " >> EXPRESSION as statement optimization !!!" \
+ << SEND_EXIT; \
+ return( aCode ); \
+ } \
+
+#define AVMCODE_COMPILER_NO_OPTIMIZER_CLASS(name, classname, supername) \
+ AVMCODE_COMPILER_NO_OPTIMIZER_CLASS_HEADER(name, classname, supername) \
+};
+
+
+
+
+
+/**
+ * Macro for smart avmcode compiler declaration.
+ *
+#define AVMCODE_COMPILER_EXPRESSION_CLASS_HEADER(classname, supername) \
+AVMCODE_BASECOMPILER_CLASS_HEADER(Avmcode##classname##Compiler, supername) \
+ virtual BF compileExpression(COMPILE_CONTEXT * aCTX, const BFCode & aCode);
+
+
+#define AVMCODE_COMPILER_EXPRESSION_CLASS(classname, supername) \
+AVMCODE_COMPILER_EXPRESSION_CLASS_HEADER(classname, supername) \
+};
+*/
+
+/**
+ * Macro for smart avmcode compiler declaration.
+ *
+#define AVMCODE_COMPILER_STATEMENT_CLASS_HEADER(classname, supername) \
+AVMCODE_BASECOMPILER_CLASS_HEADER(Avmcode##classname##Compiler, supername) \
+ virtual BFCode compileStatement(COMPILE_CONTEXT * aCTX, const BFCode & aCode);
+
+
+#define AVMCODE_COMPILER_STATEMENT_CLASS(classname, supername) \
+AVMCODE_COMPILER_STATEMENT_CLASS_HEADER(classname, supername) \
+};
+*/
+
+
+}
+
+#endif /* ABSTRACTAVMCODECOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeActivityCompiler.cpp b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeActivityCompiler.cpp
new file mode 100644
index 0000000..34d9fa3
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeActivityCompiler.cpp
@@ -0,0 +1,1312 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 12 avr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmcodeActivityCompiler.h"
+
+#include <collection/Typedef.h>
+
+#include <builder/primitive/AvmcodeSequenceCompiler.h>
+#include <builder/primitive/AvmcodeUfiCastExpressionCompiler.h>
+
+#include <fml/common/ObjectElement.h>
+
+#include <fml/executable/ExecutableLib.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/ExpressionTypeChecker.h>
+#include <fml/expression/StatementConstructor.h>
+#include <fml/expression/StatementTypeChecker.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/workflow/UniFormIdentifier.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE ACTIVITY STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeActivityStatementCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->empty() )
+ {
+ aCode->append( ExecutableLib::MACHINE_SELF );
+ return( aCode );
+ }
+ else
+ {
+ return( compileStatementParams(aCTX, aCode) );
+ }
+}
+
+BFCode AvmcodeActivityStatementCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->hasInstruction() )
+ {
+ return( aCode );
+ }
+
+ if( aCode->empty() )
+ {
+ aCode->append( ExecutableLib::MACHINE_SELF );
+ }
+
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ argsInstruction->at(0).dtype = TypeManager::MACHINE;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), aCode->first());
+
+ if( aCode->populated() )
+ {
+ AvmCode::iterator itParam = aCode->begin();
+ AvmCode::iterator itEndParam = aCode->end();
+ avm_offset_t offset = 1;
+ for( ++itParam ; itParam != itEndParam ; ++itParam , ++offset )
+ {
+ optimizeArgExpression(aCTX, aCode, offset);
+
+ setArgcodeParamValue(aCTX, argsInstruction->at(offset), (*itParam), false);
+ }
+ }
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND,
+ /*dtype */ argsInstruction->at(0).dtype);
+
+ return( aCode );
+}
+
+
+BFCode AvmcodeActivityStatementCompiler::compileStatementParams(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode newCode( aCode->getOperator() );
+
+ if( aCode->empty() )
+ {
+ return( newCode );
+ }
+
+ AvmCode::iterator itArg = aCode->begin();
+
+ newCode->append( compileArgRvalue(aCTX, TypeManager::MACHINE, (*itArg)) );
+
+ AvmCode::iterator itEndArg = aCode->end();
+ for( ++itArg ; itArg != itEndArg ; ++itArg )
+ {
+ switch( (*itArg).classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ const BFCode & argCode = (*itArg).bfCode();
+ if( aCode->populated() &&
+ StatementTypeChecker::isAssign( argCode ) &&
+ newCode->first().is< InstanceOfMachine >() )
+ {
+ ExecutableForm * execInstance = newCode->first().
+ to_ptr< InstanceOfMachine >()->getExecutable();
+
+ if( argCode->populated() )
+ {
+ newCode->append( StatementConstructor::newCode(
+ argCode->getOperator(),
+ compileArgLvalue( aCTX->newCTX(execInstance,
+ Modifier::PROPERTY_PUBLIC_VOLATILE_MODIFIER),
+ argCode->first()),
+ compileArgRvalue( aCTX->newCTX(
+ Modifier::PROPERTY_PUBLIC_VOLATILE_MODIFIER),
+ argCode->second())) );
+ }
+ else
+ {
+ newCode->append( StatementConstructor::newCode(
+ argCode->getOperator(), compileArgLvalue(
+ aCTX->newCTX(execInstance,
+ Modifier::PROPERTY_PUBLIC_VOLATILE_MODIFIER),
+ argCode->first())) );
+ }
+ }
+ else
+ {
+ newCode->append(
+ AVMCODE_COMPILER.compileExpression(aCTX, argCode) );
+ }
+
+ break;
+ }
+
+ default:
+ {
+ newCode->append( compileArgRvalue(aCTX, (*itArg)) );
+
+ break;
+ }
+ }
+ }
+
+ return( newCode );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE CONTEXT SWITCHER STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeContextSwitcherStatementCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->size() != 2 )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Expected CONTEXT SWITCHER with one running "
+ "machine and a statement as parameter !!!"
+ << SEND_EXIT;
+ }
+
+ BF ctxMachine = compileArgRvalue(aCTX, TypeManager::MACHINE, aCode->first() );
+
+ if( ctxMachine.is< InstanceOfMachine >() )
+ {
+ aCTX = aCTX->newCTX(
+ //ctxMachine.to_ptr< InstanceOfMachine >()->getExecutable(),
+ ctxMachine.to_ptr< InstanceOfMachine >()->getExecutable() );
+ }
+
+ return( StatementConstructor::newCode( aCode->getOperator(), ctxMachine,
+ compileStatementCode(aCTX, aCode->second().bfCode())) );
+}
+
+
+BFCode AvmcodeContextSwitcherStatementCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ argsInstruction->at(0).dtype = TypeManager::MACHINE;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), aCode->first());
+
+ if( aCode->first().is< InstanceOfMachine >() )
+ {
+ aCTX = aCTX->newCTX(aCode->first().
+ to_ptr< InstanceOfMachine >()->getExecutable() );
+ }
+
+ optimizeArgStatement(aCTX, aCode, 1);
+ argsInstruction->at(1).dtype = TypeManager::UNIVERSAL;
+ setArgcodeStatement(aCTX, argsInstruction->at(1), aCode->second(), false);
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND,
+ /*dtype */ argsInstruction->at(0).dtype);
+
+ return( aCode );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE IENABLE STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeIEnableStatementCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->empty() )
+ {
+ aCode->append( ExecutableLib::MACHINE_SELF );
+ }
+ else if( aCode->singleton() )
+ {
+ return( StatementConstructor::newCode(aCode->getOperator(),
+ compileArgRvalue(aCTX, TypeManager::MACHINE, aCode->first())) );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected IENABLE STATEMENT with more "
+ "than one running machine as parameter !!!"
+ << SEND_EXIT;
+ }
+
+ return( aCode );
+}
+
+
+BFCode AvmcodeIEnableStatementCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->empty() )
+ {
+ aCode->append( ExecutableLib::MACHINE_SELF );
+ }
+
+ ExecutableForm * anExecutable = getExecutableMachine(aCTX, aCode->first());
+
+ if( anExecutable != NULL )
+ {
+ if( anExecutable->hasOnIEnable() )
+ {
+ if( aCTX->isInlineEnable(anExecutable) )
+ {
+ BFCode optiCode = AVMCODE_COMPILER.optimizeStatement(
+ aCTX->newCTX(anExecutable), anExecutable->getOnIEnable() );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ return( StatementConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+
+ StatementConstructor::newComment(
+ "<ienable> " + anExecutable->getFullyQualifiedNameID()),
+
+ optiCode,
+
+ StatementConstructor::newComment(
+ "end<ienable> " + anExecutable->getFullyQualifiedNameID()) ));
+
+AVM_ELSE
+
+ return( optiCode );
+
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ }
+ else
+ {
+ return( AvmcodeActivityStatementCompiler::
+ optimizeStatement(aCTX, aCode) );
+ }
+ }
+ else
+ {
+ return( StatementConstructor::newComment(
+ "nop<ienable> " + anExecutable->getFullyQualifiedNameID() ));
+ }
+ }
+
+ return( AvmcodeActivityStatementCompiler::optimizeStatement(aCTX, aCode) );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE ENABLE STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeEnableStatementCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->empty() )
+ {
+ aCode->append( ExecutableLib::MACHINE_SELF );
+ }
+ else if( aCode->singleton() )
+ {
+ return( StatementConstructor::newCode(aCode->getOperator(),
+ compileArgRvalue(aCTX, TypeManager::MACHINE, aCode->first())) );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENABLE STATEMENT with more "
+ "than one running machine as parameter !!!"
+ << SEND_EXIT;
+ }
+
+ return( aCode );
+}
+
+
+BFCode AvmcodeEnableStatementCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->empty() )
+ {
+ aCode->append( ExecutableLib::MACHINE_SELF );
+ }
+
+ ExecutableForm * anExecutable = getExecutableMachine(aCTX, aCode->first());
+
+ if( anExecutable != NULL )
+ {
+ if( anExecutable->hasOnEnable() )
+ {
+ if( aCTX->isInlineEnable(anExecutable) )
+ {
+ BFCode optiCode = AVMCODE_COMPILER.optimizeStatement(
+ aCTX->newCTX(anExecutable), anExecutable->getOnEnable() );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ return( StatementConstructor::newCodeFlatMiddle(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+
+ StatementConstructor::newComment(
+ "begin<enable> " + anExecutable->getFullyQualifiedNameID() ),
+
+ optiCode,
+
+ StatementConstructor::newComment(
+ "end<enable> " + anExecutable->getFullyQualifiedNameID()) ));
+
+AVM_ELSE
+
+ return( optiCode );
+
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ }
+ else
+ {
+ return( AvmcodeActivityStatementCompiler::
+ optimizeStatement(aCTX, aCode) );
+ }
+ }
+ else
+ {
+ return( StatementConstructor::newComment(
+ "nop<enable> " + anExecutable->getFullyQualifiedNameID() ));
+ }
+ }
+
+ return( AvmcodeActivityStatementCompiler::optimizeStatement(aCTX, aCode) );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE IDISABLE STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeIDisableStatementCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->empty() )
+ {
+ aCode->append( ExecutableLib::MACHINE_SELF );
+ }
+ else if( aCode->singleton() )
+ {
+ return( StatementConstructor::newCode( aCode->getOperator(),
+ compileArgRvalue(aCTX, TypeManager::MACHINE, aCode->first())) );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected IDISABLE STATEMENT with more "
+ "than one running machine as parameter !!!"
+ << SEND_EXIT;
+ }
+
+ return( aCode );
+}
+
+
+BFCode AvmcodeIDisableStatementCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->empty() )
+ {
+ aCode->append( ExecutableLib::MACHINE_SELF );
+ }
+
+ ExecutableForm * anExecutable = getExecutableMachine(aCTX, aCode->first());
+
+ if( anExecutable != NULL )
+ {
+ if( anExecutable->hasOnIDisable() )
+ {
+// BFCode optiCode = AVMCODE_COMPILER.optimizeStatement(
+// aCTX->newCTX(anExecutable), anExecutable->getOnIDisable() );
+//
+//AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+// return( StatementConstructor::newCodeFlatMiddle(
+// OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+//
+// StatementConstructor::newComment(
+// "begin<idisable> " + anExecutable->getFullyQualifiedNameID()),
+//
+// optiCode,
+//
+// StatementConstructor::newComment(
+// "end<idisable> " + anExecutable->getFullyQualifiedNameID()) ));
+//_AVM_ELSE_
+//
+// return( optiCode );
+//
+//AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ }
+ else
+ {
+ return( StatementConstructor::newComment(
+ "nop<idisable> " + anExecutable->getFullyQualifiedNameID()) );
+ }
+ }
+
+ return( AvmcodeActivityStatementCompiler::optimizeStatement(aCTX, aCode) );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE DISABLE STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeDisableStatementCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->empty() )
+ {
+ aCode->append( ExecutableLib::MACHINE_SELF );
+ }
+ else if( aCode->singleton() )
+ {
+ if( ExpressionTypeChecker::isInteger(aCode->first()) )
+ {
+ return( AVMCODE_COMPILER.compileStatement(aCTX,
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_DISABLE_SELVES,
+ aCode->first() )));
+ }
+
+ return( StatementConstructor::newCode( aCode->getOperator(),
+ compileArgRvalue(aCTX, TypeManager::MACHINE, aCode->first())) );
+
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected DISABLE STATEMENT with more "
+ "than one running machine as parameter !!!"
+ << SEND_EXIT;
+ }
+
+ return( aCode );
+}
+
+
+BFCode AvmcodeDisableStatementCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->empty() )
+ {
+ aCode->append( ExecutableLib::MACHINE_SELF );
+ }
+
+ ExecutableForm * anExecutable = getExecutableMachine(aCTX, aCode->first());
+
+ if( anExecutable != NULL )
+ {
+ if( anExecutable->hasOnDisable() )
+ {
+// BFCode optiCode = AVMCODE_COMPILER.optimizeStatement(
+// aCTX->newCTX(anExecutable), anExecutable->getOnDisable() );
+//
+//AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+// return( StatementConstructor::newCodeFlatMiddle(
+// OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+//
+// StatementConstructor::newComment(
+// "begin<disable> " + anExecutable->getFullyQualifiedNameID()),
+//
+// optiCode,
+//
+// StatementConstructor::newComment(
+// "end<disable> " + anExecutable->getFullyQualifiedNameID()) ));
+//_AVM_ELSE_
+//
+// return( optiCode );
+//
+//AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ }
+ else if( aCode->first() == ExecutableLib::MACHINE_SELF )
+ {
+ return( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_DISABLE_SELF) );
+ }
+ else
+ {
+ return( AvmcodeActivityStatementCompiler::optimizeStatement(
+ aCTX, StatementConstructor::newCode(
+ OperatorManager::OPERATOR_DISABLE_SET, aCode->first() )));
+ }
+ }
+ else if( aCode->first() == ExecutableLib::MACHINE_SELF )
+ {
+ return( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_DISABLE_SELF) );
+ }
+
+ return( AvmcodeActivityStatementCompiler::optimizeStatement(aCTX, aCode) );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE DISABLE#SELVES STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeDisableSelvesStatementCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->singleton() )
+ {
+ if( ExpressionTypeChecker::isInteger(aCode->first()) )
+ {
+ if( aCode->first().isWeakInteger() &&
+ (aCode->first().toInteger() < 0) )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected DISABLE#SELVES STATEMENT with "
+ "a negative integer as parameter !!!"
+ << SEND_EXIT;
+
+ return( StatementConstructor::newCode(
+ aCode->getOperator(),
+ ExpressionConstructor::newUInteger(
+ (- aCode->first().toInteger()) ) ) );
+ }
+ }
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected DISABLE#SELVES STATEMENT with "
+ "only an unsigned integer as parameter !!!"
+ << SEND_EXIT;
+ }
+
+ return( aCode );
+}
+
+BFCode AvmcodeDisableSelvesStatementCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optCode;
+
+ if( aCode->first().isWeakInteger() )
+ {
+ ExecutableForm * anExecutable = aCTX->mCompileCtx->getExecutable();
+ avm_integer_t interLevel = 0;
+
+ optCode = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE);
+
+ avm_integer_t disableLevel = aCode->first().toInteger();
+ for( avm_integer_t level = disableLevel ;
+ (level > 0) && (anExecutable != NULL) ; --level )
+ {
+ if( anExecutable->hasOnIDisable() )
+ {
+ if( interLevel > 1 )
+ {
+ optCode->append( StatementConstructor::newOptiNopCode(
+ OperatorManager::OPERATOR_DISABLE_SELVES,
+ ExpressionConstructor::newUInteger(interLevel),
+ AVM_ARG_BUILTIN_KIND) );
+ }
+ else if( interLevel == 1 )
+ {
+ optCode->append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_DISABLE_SELF) );
+ }
+
+ optCode->appendFlat( anExecutable->getOnIDisable() );
+
+ interLevel = 0;
+ }
+ else
+ {
+ interLevel = interLevel + 1;
+ }
+
+ anExecutable = anExecutable->getExecutableContainer();
+ }
+
+ if( interLevel != disableLevel )
+ {
+ if( interLevel > 1 )
+ {
+ optCode->append( StatementConstructor::newOptiNopCode(
+ OperatorManager::OPERATOR_DISABLE_SELVES,
+ ExpressionConstructor::newUInteger(interLevel),
+ AVM_ARG_BUILTIN_KIND) );
+ }
+ else if( interLevel == 1 )
+ {
+ optCode->append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_DISABLE_SELF) );
+ }
+
+ return( AvmcodeStrongSequenceCompiler::atomizeSequence(optCode) );
+ }
+ else
+ {
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ argsInstruction->set( 0,
+ /*operation*/ AVM_ARG_NOP_RVALUE,
+ /*operand */ AVM_ARG_BUILTIN_KIND,
+ /*dtype */ TypeManager::INTEGER );
+
+ argsInstruction->computeMainBytecode(0);
+
+ return( aCode );
+ }
+ }
+ else
+ {
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ optimizeArgExpression(aCTX, aCode, 0);
+ argsInstruction->at(0).dtype = TypeManager::INTEGER;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), aCode->first());
+
+ argsInstruction->computeMainBytecode(0);
+
+ return( aCode );
+ }
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE IABORT STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeIAbortStatementCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->empty() )
+ {
+ aCode->append( ExecutableLib::MACHINE_SELF );
+ }
+ else if( aCode->singleton() )
+ {
+ return( StatementConstructor::newCode(aCode->getOperator(),
+ compileArgRvalue(aCTX, TypeManager::MACHINE, aCode->first())) );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected IABORT STATEMENT with more "
+ "than one running machine as parameter !!!"
+ << SEND_EXIT;
+ }
+
+ return( aCode );
+}
+
+
+BFCode AvmcodeIAbortStatementCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->empty() )
+ {
+ aCode->append( ExecutableLib::MACHINE_SELF );
+ }
+
+ ExecutableForm * anExecutable = getExecutableMachine(aCTX, aCode->first());
+
+ if( anExecutable != NULL )
+ {
+ if( anExecutable->hasOnIAbort() )
+ {
+// BFCode optiCode = AVMCODE_COMPILER.optimizeStatement(
+// aCTX->newCTX(anExecutable), anExecutable->getOnIAbort() );
+//
+//AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+// return(StatementConstructor::newCodeFlatMiddle(
+// OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+//
+// StatementConstructor::newComment(
+// "begin<iabort> " + anExecutable->getFullyQualifiedNameID()),
+//
+// optiCode,
+//
+// StatementConstructor::newComment(
+// "end<iabort> " + anExecutable->getFullyQualifiedNameID()) ));
+//_AVM_ELSE_
+//
+// return( optiCode );
+//
+//AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ }
+ else
+ {
+ return( StatementConstructor::newComment(
+ "nop<iabort> " + anExecutable->getFullyQualifiedNameID()) );
+ }
+ }
+
+ return( AvmcodeActivityStatementCompiler::optimizeStatement(aCTX, aCode) );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE ABORT STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeAbortStatementCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->empty() )
+ {
+ aCode->append( ExecutableLib::MACHINE_SELF );
+ }
+ else if( aCode->singleton() )
+ {
+ return( StatementConstructor::newCode(aCode->getOperator(),
+ compileArgRvalue(aCTX, TypeManager::MACHINE, aCode->first())) );
+ }
+ else if( aCode->nonempty() )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ABORT STATEMENT with more "
+ "than one running machine as parameter !!!"
+ << SEND_EXIT;
+ }
+
+ return( aCode );
+}
+
+
+BFCode AvmcodeAbortStatementCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->empty() )
+ {
+ aCode->append( ExecutableLib::MACHINE_SELF );
+ }
+
+ ExecutableForm * anExecutable = getExecutableMachine(aCTX, aCode->first());
+
+ if( anExecutable != NULL )
+ {
+ if( anExecutable->hasOnAbort() )
+ {
+// BFCode optiCode = AVMCODE_COMPILER.optimizeStatement(
+// aCTX->newCTX(anExecutable), anExecutable->getOnAbort() );
+//
+//AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+// return( StatementConstructor::newCodeFlatMiddle(
+// OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+//
+// StatementConstructor::newComment(
+// "begin<abort> " + anExecutable->getFullyQualifiedNameID() ),
+//
+// optiCode,
+//
+// StatementConstructor::newComment(
+// "end<abort> " + anExecutable->getFullyQualifiedNameID()) ));
+//_AVM_ELSE_
+//
+// return( optiCode );
+//
+//AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ }
+ else if( aCode->first() == ExecutableLib::MACHINE_SELF )
+ {
+ return( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ABORT_SELF) );
+ }
+ else
+ {
+ return( AvmcodeActivityStatementCompiler::optimizeStatement(
+ aCTX, StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ABORT_SET,
+ aCode->first() )));
+ }
+ }
+
+ return( AvmcodeActivityStatementCompiler::optimizeStatement(aCTX, aCode) );
+}
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE ABORT#SELVES STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeAbortSelvesStatementCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->singleton() )
+ {
+ if( ExpressionTypeChecker::isInteger(aCode->first()) )
+ {
+ if( aCode->first().isWeakInteger() &&
+ (aCode->first().toInteger() < 0) )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ABORT#SELVES STATEMENT with "
+ "a negative integer as parameter !!!"
+ << SEND_EXIT;
+
+ return( StatementConstructor::newCode(
+ aCode->getOperator(),
+ ExpressionConstructor::newUInteger(
+ (- aCode->first().toInteger()) ) ) );
+ }
+ }
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ABORT#SELVES STATEMENT with "
+ "only an unsigned integer as parameter !!!"
+ << SEND_EXIT;
+ }
+
+ return( aCode );
+}
+
+
+BFCode AvmcodeAbortSelvesStatementCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->first().isWeakInteger() )
+ {
+ ExecutableForm * anExecutable = aCTX->mCompileCtx->getExecutable();
+ avm_integer_t interLevel = 0;
+
+ BFCode optCode = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE);
+
+ avm_integer_t abortLevel = aCode->first().toInteger();
+ for( avm_integer_t level = abortLevel ;
+ (level > 0) && (anExecutable != NULL) ; --level )
+ {
+ if( anExecutable->hasOnIAbort() )
+ {
+ if( interLevel > 1 )
+ {
+ optCode->append( StatementConstructor::newOptiNopCode(
+ OperatorManager::OPERATOR_ABORT_SELVES,
+ ExpressionConstructor::newUInteger(interLevel),
+ AVM_ARG_BUILTIN_KIND) );
+ }
+ else if( interLevel == 1 )
+ {
+ optCode->append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ABORT_SELF) );
+ }
+
+ optCode->appendFlat( anExecutable->getOnIDisable() );
+
+ interLevel = 0;
+ }
+ else
+ {
+ interLevel = interLevel + 1;
+ }
+
+ anExecutable = anExecutable->getExecutableContainer();
+ }
+
+ if( interLevel != abortLevel )
+ {
+ if( interLevel > 1 )
+ {
+ optCode->append( StatementConstructor::newOptiNopCode(
+ OperatorManager::OPERATOR_ABORT_SELVES,
+ ExpressionConstructor::newUInteger(interLevel),
+ AVM_ARG_BUILTIN_KIND) );
+ }
+ else if( interLevel == 1 )
+ {
+ optCode->append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ABORT_SELF) );
+ }
+
+ return( AvmcodeStrongSequenceCompiler::atomizeSequence(optCode) );
+ }
+ else
+ {
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ argsInstruction->set( 0,
+ /*operation*/ AVM_ARG_NOP_RVALUE,
+ /*operand */ AVM_ARG_BUILTIN_KIND,
+ /*dtype */ TypeManager::INTEGER );
+
+ argsInstruction->computeMainBytecode(0);
+
+ return( aCode );
+ }
+ }
+ else
+ {
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ optimizeArgExpression(aCTX, aCode, 0);
+ argsInstruction->at(0).dtype = TypeManager::INTEGER;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), aCode->first());
+
+ argsInstruction->computeMainBytecode(0);
+
+ return( aCode );
+ }
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE FORK STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeForkStatementCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->size() < 2 )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected FORK STATEMENT with less "
+ "than 2 running machines as parameters !!!"
+ << SEND_EXIT;
+
+ return( aCode );
+ }
+ else
+ {
+ return( AbstractAvmcodeCompiler::compileStatement(aCTX, aCode) );
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE JOIN STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeJoinStatementCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->empty() )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected JOIN STATEMENT without "
+ "running machines as parameters !!!"
+ << SEND_EXIT;
+
+ return( aCode );
+ }
+ else if( aCode->singleton() )
+ {
+ return( StatementConstructor::newCode( aCode->getOperator(),
+ compileArgRvalue(aCTX, aCode->first()) ) );
+ }
+ else
+ {
+
+ return( compileStatementParams(aCTX, aCode) );
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE GOTO STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeGotoStatementCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->empty() )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected GOTO STATEMENT without "
+ "one running machine as target !!!"
+ << SEND_EXIT;
+
+ return( aCode );
+ }
+ else
+ {
+ BF gotoTarget = AVMCODE_COMPILER.decode_compileVariableMachine(
+ aCTX, aCode->first());
+
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( gotoTarget.is< InstanceOfMachine >() )
+ << "Unexpected GOTO machine target:>\n" << aCode.str()
+ << SEND_EXIT;
+
+ BFCode flowStatement;
+ if( aCode->populated() && gotoTarget.is< InstanceOfMachine >() )
+ {
+ flowStatement = AVMCODE_COMPILER.decode_compileStatement(
+ gotoTarget.to_ptr< InstanceOfMachine >()->getExecutable(),
+ aCode->second());
+
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( flowStatement.valid() )
+ << "Unexpected GOTO flow statement:>\n" << aCode.str()
+ << SEND_EXIT;
+ }
+
+
+ const Machine * source =
+ aCTX->mCompileCtx->getExecutable()->getAstMachine();
+ const Machine * target =
+ gotoTarget.to_ptr< InstanceOfMachine >()->getAstMachine();
+
+ const Machine * lcaMachine = source->LCRA(target);
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( lcaMachine )
+ << "Unexpected a <null> LCA( "
+ << source->getFullyQualifiedNameID() << " , "
+ << target->getFullyQualifiedNameID() << " )"
+ << SEND_EXIT;
+
+ BFCode disableCode( OperatorManager::OPERATOR_DISABLE_INVOKE );
+ BFCode enableCode ( OperatorManager::OPERATOR_ENABLE_INVOKE );
+ BFList listOfEnableTarget;
+
+ if( (source != lcaMachine)
+ && (source->getContainerMachine() != lcaMachine) )
+ {
+ avm_uinteger_t disableLevel = 1;
+
+ const Machine * containerOfSource = source->getContainerMachine();
+ for( ; containerOfSource != lcaMachine ; ++disableLevel )
+ {
+ containerOfSource = containerOfSource->getContainerMachine();
+ }
+
+ disableCode = StatementConstructor::newOptiNopCode(
+ OperatorManager::OPERATOR_DISABLE_SELVES,
+ ExpressionConstructor::newUInteger(disableLevel),
+ AVM_ARG_BUILTIN_KIND);
+ }
+ if( target != lcaMachine )
+ {
+ const Machine * containerOfMachine = target;
+ for( ; containerOfMachine != lcaMachine ;
+ containerOfMachine = containerOfMachine->getContainerMachine() )
+ {
+ listOfEnableTarget.push_front(
+ getSymbolTable().searchInstanceStatic(containerOfMachine) );
+ }
+ enableCode.append( listOfEnableTarget );
+
+ if( flowStatement.valid() )
+ {
+ enableCode = AvmcodeStrongSequenceCompiler::atomizeSequence(
+ StatementConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ enableCode, flowStatement) );
+ }
+ }
+
+
+ if( source != lcaMachine ) // for disable self
+ {
+ if( enableCode->nonempty() )
+ {
+ return( AvmcodeStrongSequenceCompiler::atomizeSequence(
+ StatementConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ disableCode, enableCode) ));
+ }
+ else
+ {
+ return( disableCode );
+ }
+ }
+ else
+ {
+ return( enableCode );
+ }
+
+// return( compileStatementParams(aCTX, aCode) );
+ }
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE SCHEDULE STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeRtcStatementCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->empty() )
+ {
+ aCode->append( ExecutableLib::MACHINE_SELF );
+ return( aCode );
+ }
+ else
+ {
+ return( AvmcodeActivityStatementCompiler::
+ compileStatement(aCTX, aCode) );
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE SCHEDULE#INVOKE STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeScheduleStatementCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->empty() )
+ {
+ aCode->append( ExecutableLib::MACHINE_SELF );
+ return( aCode );
+ }
+ else
+ {
+ return( AvmcodeActivityStatementCompiler::
+ compileStatement(aCTX, aCode) );
+ }
+}
+
+
+BFCode AvmcodeScheduleStatementCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->empty() )
+ {
+ aCode->append( ExecutableLib::MACHINE_SELF );
+ }
+
+// ExecutableForm * anExecutable = getExecutableMachine(aCTX, aCode->first());
+//
+// if( (anExecutable != NULL) && anExecutable->hasOnSchedule() &&
+// anExecutable->isInlinableSchedule() )
+// {
+// BFCode optiCode = AVMCODE_COMPILER.optimizeStatement(
+// aCTX->newCTX(anExecutable), anExecutable->getOnSchedule() );
+//
+//AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+// return( StatementConstructor::newCodeFlatMiddle(
+// OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+//
+// StatementConstructor::newComment(
+// "begin<schedule> " + anExecutable->getFullyQualifiedNameID() ),
+//
+// optiCode,
+//
+// StatementConstructor::newComment(
+// "end<schedule> " + anExecutable->getFullyQualifiedNameID()) ));
+//
+//AVM_ELSE
+//
+// return( optiCode );
+//
+//AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+// }
+
+ return( AvmcodeActivityStatementCompiler::optimizeStatement(aCTX, aCode) );
+}
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE SCHEDULE#IN STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeScheduleInStatementCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->size() == 2 )
+ {
+ BF machine = compileArgRvalue(aCTX, TypeManager::MACHINE, aCode->second());
+
+ if( machine.is< InstanceOfMachine >() )
+ {
+ aCTX = aCTX->newCTX(
+ machine.to_ptr< InstanceOfMachine >()->getExecutable() );
+ }
+ BF submachine = compileArgRvalue(aCTX, TypeManager::MACHINE, aCode->first());
+
+ BFCode newCode( aCode->getOperator(), submachine, machine);
+
+ return( newCode );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENABLE#SET STATEMENT with more "
+ "than one running machine as parameter !!!"
+ << SEND_EXIT;
+
+ return( aCode );
+ }
+}
+
+
+BF AvmcodeScheduleInStatementCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ argsInstruction->at(0).dtype = TypeManager::MACHINE;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), aCode->first());
+
+ argsInstruction->at(1).dtype = argsInstruction->at(0).dtype;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), aCode->second());
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_RETURN_CTX,
+ /*processor*/ AVM_ARG_MEMORY_MACHINE_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_EXPRESSION_KIND,
+ /*dtype */ TypeManager::MACHINE);
+
+ return( aCode );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE INPUT_ENABLED STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeInputEnabledStatementCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode newCode( aCode->getOperator(),
+ AbstractAvmcodeCompiler::compileStatementCode(aCTX,
+ aCode->first().bfCode()) );
+
+ return( newCode );
+}
+
+
+BFCode AvmcodeInputEnabledStatementCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optCode( aCode->getOperator() );
+
+ optCode->append( AVMCODE_COMPILER.optimizeStatement(aCTX,
+ aCode->first().bfCode() ));
+
+ return( optCode );
+}
+
+
+
+
+}
+
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeActivityCompiler.h b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeActivityCompiler.h
new file mode 100644
index 0000000..77f880e
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeActivityCompiler.h
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 12 avr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCODEACTIVITYCOMPILER_H_
+#define AVMCODEACTIVITYCOMPILER_H_
+
+#include <builder/primitive/AbstractAvmcodeCompiler.h>
+
+
+namespace sep
+{
+
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS_HEADER("ACTIVITY#STATEMENT",
+ ActivityStatement, AbstractAvmcodeCompiler)
+
+ BFCode compileStatementParams(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode);
+};
+
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS("CONTEXT_SWITCHER",
+ ContextSwitcherStatement, AvmcodeActivityStatementCompiler)
+
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS("IENABLE",
+ IEnableStatement, AvmcodeActivityStatementCompiler)
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS("ENABLE",
+ EnableStatement, AvmcodeActivityStatementCompiler)
+
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS("IDISABLE",
+ IDisableStatement, AvmcodeActivityStatementCompiler)
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS("DISABLE",
+ DisableStatement, AvmcodeActivityStatementCompiler)
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS("DISABLE#SELVES",
+ DisableSelvesStatement, AvmcodeActivityStatementCompiler)
+
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS("IABORT",
+ IAbortStatement, AvmcodeActivityStatementCompiler)
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS("ABORT",
+ AbortStatement, AvmcodeActivityStatementCompiler)
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS("ABORT#SELVES",
+ AbortSelvesStatement, AvmcodeActivityStatementCompiler)
+
+
+
+AVMCODE_COMPILER_STATEMENT_CLASS("FORK",
+ ForkStatement, AvmcodeActivityStatementCompiler)
+
+AVMCODE_COMPILER_STATEMENT_CLASS("JOIN",
+ JoinStatement, AvmcodeActivityStatementCompiler)
+
+
+AVMCODE_COMPILER_STATEMENT_CLASS("GOTO",
+ GotoStatement, AvmcodeActivityStatementCompiler)
+
+
+AVMCODE_COMPILER_STATEMENT_CLASS("RTC",
+ RtcStatement, AvmcodeActivityStatementCompiler)
+
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS("SCHEDULE",
+ ScheduleStatement, AvmcodeActivityStatementCompiler)
+
+AVMCODE_COMPILER_EXPRESSION_OPTIMIZER_CLASS("SCHEDULE#IN",
+ ScheduleInStatement, AvmcodeActivityStatementCompiler)
+
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS("INPUT_ENABLED",
+ InputEnabledStatement, AbstractAvmcodeCompiler)
+
+
+
+}
+
+#endif /* AVMCODEACTIVITYCOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeAssignCompiler.cpp b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeAssignCompiler.cpp
new file mode 100644
index 0000000..d1f6e77
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeAssignCompiler.cpp
@@ -0,0 +1,426 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 12 avr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmcodeAssignCompiler.h"
+
+#include <computer/instruction/AvmInstruction.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/StatementConstructor.h>
+
+#include <fml/operator/OperatorManager.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE ASSIGN COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+inline BF AvmcodeAssignCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileStatement(aCTX, aCode) );
+}
+
+inline BF AvmcodeAssignCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ setArgcodeLValue(aCTX, argsInstruction->at(0), aCode->first());
+
+ optimizeArgExpression(aCTX, aCode, 1);
+ argsInstruction->at(1).dtype = argsInstruction->at(0).dtype;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), aCode->second());
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_RETURN_CTX,
+ /*processor*/ AVM_ARG_MEMORY_RVALUE_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_EXPRESSION_KIND,
+ /*dtype */ argsInstruction->at(0).dtype);
+
+ return( aCode );
+}
+
+
+inline BFCode AvmcodeAssignCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BF lvalue = compileArgLvalue(aCTX, aCode->first());
+
+ if( lvalue.is< InstanceOfData >() )
+ {
+ aCTX = aCTX->clone(
+ lvalue.to_ptr< InstanceOfData >()->getTypeSpecifier() );
+ }
+
+ BF rvalue = compileArgRvalue(aCTX, aCode->second());
+
+ BFCode compilCode = StatementConstructor::newCode(
+ aCode->getOperator(), lvalue, rvalue );
+
+ return( compilCode );
+}
+
+// lvalue =: rvalue; ==> [ lvalue , rvalue ]
+BFCode AvmcodeAssignCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ setArgcodeLValue(aCTX, argsInstruction->at(0), aCode->first());
+
+ optimizeArgExpression(aCTX, aCode, 1);
+ argsInstruction->at(1).dtype = argsInstruction->at(0).dtype;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), aCode->second());
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND,
+ /*dtype */ argsInstruction->at(0).dtype);
+
+ return( aCode );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE ASSIGN AFTER COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+inline BF AvmcodeAssignAfterCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BF lvalue = compileArgLvalue(aCTX, aCode->first());
+
+ if( lvalue.is< InstanceOfData >() )
+ {
+ aCTX = aCTX->clone(
+ lvalue.to_ptr< InstanceOfData >()->getTypeSpecifier() );
+ }
+
+ return( StatementConstructor::newCode( aCode->getOperator(),
+ lvalue, lvalue, compileArgRvalue(aCTX, aCode->second()) ) );
+}
+
+inline BF AvmcodeAssignAfterCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ setArgcodeLValue(aCTX, argsInstruction->at(0), aCode->first());
+
+ argsInstruction->at(1).dtype = argsInstruction->at(0).dtype;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), aCode->second());
+
+ optimizeArgExpression(aCTX, aCode, 2);
+ setArgcodeRValue(aCTX, argsInstruction->at(2), aCode->third());
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_RETURN_CTX,
+ /*processor*/ AVM_ARG_MEMORY_RVALUE_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_EXPRESSION_KIND,
+ /*dtype */ argsInstruction->at(0).dtype);
+
+ return( aCode );
+}
+
+
+inline BFCode AvmcodeAssignAfterCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BF lvalue = compileArgLvalue(aCTX, aCode->first());
+
+ if( lvalue.is< InstanceOfData >() )
+ {
+ aCTX = aCTX->clone(
+ lvalue.to_ptr< InstanceOfData >()->getTypeSpecifier() );
+ }
+
+ return( StatementConstructor::newCode(OperatorManager::OPERATOR_ASSIGN,
+ lvalue, compileArgRvalue(aCTX, aCode->second()) ) );
+}
+
+// lvalue =: rvalue; ==> [ lvalue , rvalue ]
+BFCode AvmcodeAssignAfterCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected invoke of ASSIGN#AFTER "
+ "statement compilation optimizer !!!"
+ << SEND_EXIT;
+
+ return( aCode );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE ASSIGN OP COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+// lvalue op := rvalue; ==> [ lvalue , VAL[lvalue] op rvalue ]
+inline BF AvmcodeAssignOpCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode expr = aCode->second().bfCode();
+ expr = ExpressionConstructor::newCode(expr->getOperator(),
+ aCode->first(), expr->first());
+
+ expr = ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_ASSIGN, aCode->first(), expr);
+
+ return( AVMCODE_COMPILER.compileExpression(aCTX, expr) );
+}
+
+
+inline BFCode AvmcodeAssignOpCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode expr = aCode->second().bfCode();
+ expr = ExpressionConstructor::newCode(expr->getOperator(),
+ aCode->first(), expr->first());
+
+ expr = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ASSIGN, aCode->first(), expr);
+
+ return( AVMCODE_COMPILER.compileStatement(aCTX, expr) );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE ASSIGN OP AFTER COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+// lvalue =: op rvalue; ==> [ lvalue , VAL[lvalue] , (VAL[lvalue] op rvalue) ]
+inline BF AvmcodeAssignOpAfterCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode expr = aCode->second().bfCode();
+ expr = ExpressionConstructor::newCode(expr->getOperator(),
+ aCode->first(), expr->first());
+
+ expr = ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_ASSIGN_AFTER, aCode->first(), expr);
+
+ return( AVMCODE_COMPILER.compileExpression(aCTX, expr) );
+}
+
+
+inline BFCode AvmcodeAssignOpAfterCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode expr = aCode->second().bfCode();
+ expr = ExpressionConstructor::newCode(expr->getOperator(),
+ aCode->first(), expr->first());
+
+ expr = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ASSIGN, aCode->first(), expr);
+
+ return( AVMCODE_COMPILER.compileStatement(aCTX, expr) );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE ASSIGN REFERENCE COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+inline BF AvmcodeAssignRefCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileStatement(aCTX, aCode) );
+}
+
+inline BF AvmcodeAssignRefCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optCode = optimizeStatement(aCTX, aCode);
+
+ optCode->getInstruction()->setMainOperand( AVM_ARG_EXPRESSION_KIND );
+
+ return( optCode );
+}
+
+
+inline BFCode AvmcodeAssignRefCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BF lvalue = compileArgLvalue(aCTX, aCode->first());
+
+ if( lvalue.is< InstanceOfData >() )
+ {
+ aCTX = aCTX->clone(
+ lvalue.to_ptr< InstanceOfData >()->getTypeSpecifier() );
+ }
+
+ return( StatementConstructor::newCode( aCode->getOperator(),
+ lvalue, compileArgLvalue(aCTX, aCode->second()) ) );
+}
+
+BFCode AvmcodeAssignRefCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ // lvalue =: lvalue; <==> lvalue = $(quote lvalue);
+ aCode->setOperator( OperatorManager::OPERATOR_ASSIGN );
+
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ setArgcodeLValueRef(aCTX, argsInstruction->at(0), aCode->first());
+
+ optimizeArgExpression(aCTX, aCode, 1);
+ argsInstruction->at(1).dtype = argsInstruction->at(0).dtype;
+ setArgcodeLValue(aCTX, argsInstruction->at(1), aCode->second());
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND,
+ /*dtype */ argsInstruction->at(0).dtype);
+
+ return( aCode );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE ASSIGN Macro COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+inline BF AvmcodeAssignMacroCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileStatement(aCTX, aCode) );
+}
+
+inline BF AvmcodeAssignMacroCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optCode = optimizeStatement(aCTX, aCode);
+
+ optCode->getInstruction()->setMainOperand( AVM_ARG_EXPRESSION_KIND );
+
+ return( optCode );
+}
+
+
+inline BFCode AvmcodeAssignMacroCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BF lvalue = compileArgLvalue(aCTX, aCode->first());
+
+ if( lvalue.is< InstanceOfData >() )
+ {
+ aCTX = aCTX->clone(
+ lvalue.to_ptr< InstanceOfData >()->getTypeSpecifier() );
+ }
+
+ return( StatementConstructor::newCode( aCode->getOperator(),
+ lvalue, compileArgRvalue(aCTX, aCode->second()) ) );
+}
+
+BFCode AvmcodeAssignMacroCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ // lvalue =: lvalue; <==> lvalue = $(quote lvalue);
+ aCode->setOperator( OperatorManager::OPERATOR_ASSIGN );
+
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ setArgcodeLValueMacro(aCTX, argsInstruction->at(0), aCode->first());
+
+ optimizeArgExpression(aCTX, aCode, 1);
+ argsInstruction->at(1).dtype = argsInstruction->at(0).dtype;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), aCode->second());
+ argsInstruction->at(1).setNopOperation();
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND,
+ /*dtype */ argsInstruction->at(0).dtype);
+
+ return( aCode );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE ASSIGN UNARY COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+inline BF AvmcodeAssignUnaryCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileStatement(aCTX, aCode) );
+}
+
+inline BF AvmcodeAssignUnaryCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ setArgcodeLValue(aCTX, argsInstruction->at(0), aCode->first());
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_RETURN_CTX,
+ /*processor*/ AVM_ARG_MEMORY_RVALUE_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_EXPRESSION_KIND,
+ /*dtype */ argsInstruction->at(0).dtype);
+
+ return( aCode );
+}
+
+
+inline BFCode AvmcodeAssignUnaryCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( StatementConstructor::newCode( aCode->getOperator(),
+ compileArgLvalue(aCTX, aCode->first()) ) );
+}
+
+BFCode AvmcodeAssignUnaryCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ setArgcodeLValue(aCTX, argsInstruction->at(0), aCode->first());
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND,
+ /*dtype */ argsInstruction->at(0).dtype);
+
+ return( aCode );
+}
+
+
+
+}
+
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeAssignCompiler.h b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeAssignCompiler.h
new file mode 100644
index 0000000..743069d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeAssignCompiler.h
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 12 avr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCODEASSIGNCOMPILER_H_
+#define AVMCODEASSIGNCOMPILER_H_
+
+#include <builder/primitive/AbstractAvmcodeCompiler.h>
+
+
+namespace sep
+{
+
+
+AVMCODE_COMPILER_OPTIMIZER_CLASS(Assign, AbstractAvmcodeCompiler)
+
+
+AVMCODE_COMPILER_OPTIMIZER_CLASS(AssignAfter, AbstractAvmcodeCompiler)
+
+
+AVMCODE_COMPILER_NO_OPTIMIZER_CLASS("ASSIGN#OP", AssignOp, AbstractAvmcodeCompiler)
+
+
+AVMCODE_COMPILER_NO_OPTIMIZER_CLASS("ASSIGN#OP#AFTER", AssignOpAfter, AbstractAvmcodeCompiler)
+
+
+AVMCODE_COMPILER_OPTIMIZER_CLASS(AssignRef, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_OPTIMIZER_CLASS(AssignMacro, AbstractAvmcodeCompiler)
+
+
+AVMCODE_COMPILER_OPTIMIZER_CLASS(AssignUnary, AbstractAvmcodeCompiler)
+
+
+}
+
+#endif /* AVMCODEASSIGNCOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeCommunicationCompiler.cpp b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeCommunicationCompiler.cpp
new file mode 100644
index 0000000..b350ce3
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeCommunicationCompiler.cpp
@@ -0,0 +1,1182 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 12 avr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmcodeCommunicationCompiler.h"
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/ExpressionTypeChecker.h>
+
+#include <fml/infrastructure/ComProtocol.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <sew/Configuration.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE INPUT STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeInputCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode compiledCode = compileExpressionCode(aCTX, aCode);
+
+ const BF & arg = compiledCode->first();
+
+ if( ExpressionTypeChecker::isTyped(TypeManager::PORT, arg) )
+ {
+ //!! NOTHING
+ }
+ else if( ExpressionTypeChecker::isTyped(TypeManager::MESSAGE, arg) )
+ {
+
+ }
+ else// if( arg.is< InstanceOfData >() )
+ {
+ compiledCode->setOperator(OperatorManager::OPERATOR_INPUT_VAR);
+ }
+
+ return( compiledCode );
+}
+
+
+BFCode AvmcodeInputCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optimizedCode( aCode->getOperator() );
+
+ AvmInstruction * argsInstruction =
+ optimizedCode->newInstruction( aCode->size() );
+
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator endIt = aCode->end();
+
+ BF arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ if( arg.is< InstanceOfPort >() )
+ {
+ argsInstruction->at(0).dtype = TypeManager::PORT;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), arg, false);
+
+ InstanceOfPort * aPort = arg.to_ptr< InstanceOfPort >();
+
+ if( aPort->hasInputRoutingData() )
+ {
+ const RoutingData & aRoutingData = aPort->getInputRoutingData();
+
+ switch( aRoutingData.getProtocol() )
+ {
+ case ComProtocol::PROTOCOL_ENVIRONMENT_KIND:
+ {
+ optimizedCode->setOperator(
+ OperatorManager::OPERATOR_INPUT_ENV);
+ break;
+ }
+
+ case ComProtocol::PROTOCOL_RDV_KIND:
+ case ComProtocol::PROTOCOL_MULTIRDV_KIND:
+ {
+ optimizedCode->setOperator(
+ OperatorManager::OPERATOR_INPUT_RDV);
+ break;
+ }
+
+ case ComProtocol::PROTOCOL_BUFFER_KIND:
+ case ComProtocol::PROTOCOL_BROADCAST_KIND:
+ case ComProtocol::PROTOCOL_MULTICAST_KIND:
+ case ComProtocol::PROTOCOL_UNICAST_KIND:
+ case ComProtocol::PROTOCOL_ANYCAST_KIND:
+ {
+ if( aRoutingData.getBufferInstance().singleton() )
+ {
+ optimizedCode->setOperator(
+ OperatorManager::OPERATOR_INPUT_BUFFER);
+ }
+ break;
+ }
+
+ case ComProtocol::PROTOCOL_TRANSFERT_KIND:
+ case ComProtocol::PROTOCOL_UNDEFINED_KIND:
+ default:
+ {
+ break;
+ }
+ }
+ }
+
+ avm_size_t paramCount = aPort->getParameterCount();
+ for( avm_size_t offset = 1 ;
+ (++it != endIt) && (offset <= paramCount) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = aPort->getParameterType(offset-1);
+ setArgcodeLValue(aCTX, argsInstruction->at(offset), arg);
+ }
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND);
+
+ return( optimizedCode );
+ }
+ else if( ExpressionTypeChecker::isTyped(TypeManager::PORT, arg) )
+ {
+ argsInstruction->at(0).dtype = TypeManager::PORT;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), arg, false);
+
+ for( avm_size_t offset = 1 ; (++it != endIt) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = TypeManager::UNIVERSAL;
+ setArgcodeLValue(aCTX, argsInstruction->at(offset), arg);
+ }
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND);
+
+ return( optimizedCode );
+ }
+ else if( ExpressionTypeChecker::isTyped(TypeManager::MESSAGE, arg) )
+ {
+ argsInstruction->at(0).dtype = TypeManager::MESSAGE;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), arg, false);
+
+ for( avm_size_t offset = 1 ; (++it != endIt) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = TypeManager::UNIVERSAL;
+ setArgcodeLValue(aCTX, argsInstruction->at(offset), (*it), false);
+ }
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND);
+
+ return( optimizedCode );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmcodeInputCompiler::optimizeStatement :> Unexpected << "
+ << str_header( arg ) << " >> as input first argument !!!"
+ << std::endl;
+
+ return( aCode );
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE INPUT#FROM STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeInputFromCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->size() >= 2 )
+ {
+ BFCode compilCode( aCode->getOperator() );
+
+ AvmCode::iterator it = aCode->begin();
+ compilCode.append(
+ compileArgRvalue(aCTX, TypeManager::PORT, *it) );
+
+ compilCode.append(
+ compileArgRvalue(aCTX, TypeManager::MACHINE, *(++it)) );
+
+ AvmCode::iterator endIt = aCode->end();
+ for( ++it ; it != endIt ; ++it )
+ {
+ compilCode.append( compileArgLvalue(aCTX, *it) );
+ }
+
+ return( compilCode );
+
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmcodeInputFromCompiler::compileStatement :> "
+ "Not enough parameter for << input_from >> statement << "
+ << str_indent( aCode ) << " >> !!!"
+ << std::endl;
+
+ return( aCode );
+ }
+}
+
+
+BFCode AvmcodeInputFromCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optimizedCode( aCode->getOperator() );
+
+ AvmInstruction * argsInstruction =
+ optimizedCode->newInstruction( aCode->size() );
+
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator endIt = aCode->end();
+
+ BF arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ if( arg.is< InstanceOfPort >() )
+ {
+ argsInstruction->at(0).dtype = TypeManager::PORT;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), arg, false);
+
+ InstanceOfPort * aPort = arg.to_ptr< InstanceOfPort >();
+ avm_size_t paramCount = aPort->getParameterCount();
+
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*(++it)));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(1).dtype = TypeManager::MACHINE;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), arg);
+
+ for( avm_size_t offset = 2 ;
+ (++it != endIt) && (paramCount > 0) ; ++offset , --paramCount )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = aPort->getParameterType(offset-2);
+ setArgcodeLValue(aCTX, argsInstruction->at(offset), arg);
+ }
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND);
+
+ return( optimizedCode );
+ }
+ else if( ExpressionTypeChecker::isTyped(TypeManager::PORT, arg) )
+ {
+ argsInstruction->at(0).dtype = TypeManager::PORT;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), arg, false);
+
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*(++it)));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(1).dtype = TypeManager::MACHINE;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), arg);
+
+ for( avm_size_t offset = 2 ; (++it != endIt) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = TypeManager::UNIVERSAL;
+ setArgcodeLValue(aCTX, argsInstruction->at(offset), arg);
+ }
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND);
+
+ return( optimizedCode );
+ }
+ else if( ExpressionTypeChecker::isTyped(TypeManager::MESSAGE, arg) )
+ {
+ argsInstruction->at(0).dtype = TypeManager::MESSAGE;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), arg, false);
+
+
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*(++it)));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(1).dtype = TypeManager::MACHINE;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), arg);
+
+ for( avm_size_t offset = 2 ; (++it != endIt) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = TypeManager::UNIVERSAL;
+ setArgcodeLValue(aCTX, argsInstruction->at(offset), (*it), false);
+ }
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND);
+
+ return( optimizedCode );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmcodeInputCompiler::optimizeStatement :> Unexpected << "
+ << str_header( arg ) << " >> as input first argument !!!"
+ << std::endl;
+
+ return( aCode );
+ }
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE INPUT#SAVE STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeInputSaveCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+
+ return( StatementConstructor::newCode(aCode->getOperator(),
+ compileArgRvalue(aCTX, TypeManager::PORT, aCode->first())) );
+ return( compileExpressionCode(aCTX, aCode) );
+}
+
+
+BFCode AvmcodeInputSaveCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optimizedCode( aCode->getOperator() );
+
+ AvmInstruction * argsInstruction =
+ optimizedCode->newInstruction( aCode->size() );
+
+ BF arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, aCode->first());
+ optimizedCode->append( arg );
+
+ if( arg.is< InstanceOfPort >() )
+ {
+ argsInstruction->at(0).dtype = TypeManager::PORT;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), arg, false);
+
+// InstanceOfPort * aPort = arg.to_ptr< InstanceOfPort >();
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND);
+
+
+ return( optimizedCode );
+ }
+ else if( ExpressionTypeChecker::isTyped(TypeManager::MESSAGE, arg) )
+ {
+ argsInstruction->at(0).dtype = TypeManager::MESSAGE;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), arg, false);
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND);
+
+ return( optimizedCode );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmcodeInputCompiler::optimizeStatement :> Unexpected << "
+ << str_header( arg ) << " >> as input first argument !!!"
+ << std::endl;
+
+ return( aCode );
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE INPUT#VAR STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeInputVarCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BF lvalue = compileArgLvalue(aCTX, aCode->first());
+
+ if( aCode->populated() )
+ {
+ if( lvalue.is< InstanceOfData >() )
+ {
+ aCTX = aCTX->clone(
+ lvalue.to_ptr< InstanceOfData >()->getTypeSpecifier() );
+ }
+ return( StatementConstructor::newCode( aCode->getOperator(),
+ lvalue, compileArgRvalue(aCTX, aCode->second())) );
+ }
+ else
+ {
+ return( StatementConstructor::newCode(aCode->getOperator(), lvalue) );
+ }
+}
+
+
+BFCode AvmcodeInputVarCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ setArgcodeLValue(aCTX, argsInstruction->at(0), aCode->first());
+
+ if( aCode->populated() )
+ {
+ optimizeArgExpression(aCTX, aCode, 1);
+ argsInstruction->at(1).dtype = argsInstruction->at(0).dtype;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), aCode->second());
+ }
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND,
+ /*dtype */ argsInstruction->at(0).dtype);
+
+ return( aCode );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE INPUT#ENV STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeInputEnvCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileExpressionCode(aCTX, aCode) );
+}
+
+
+BFCode AvmcodeInputEnvCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optimizedCode( aCode->getOperator() );
+
+ AvmInstruction * argsInstruction =
+ optimizedCode->newInstruction( aCode->size() );
+
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator endIt = aCode->end();
+
+ BF arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ if( arg.is< InstanceOfPort >() )
+ {
+ argsInstruction->at(0).dtype = TypeManager::PORT;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), arg, false);
+
+ InstanceOfPort * aPort = arg.to_ptr< InstanceOfPort >();
+ avm_size_t paramCount = aPort->getParameterCount();
+
+ for( avm_size_t offset = 1 ;
+ (++it != endIt) && (paramCount > 0) ; ++offset , --paramCount )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = aPort->getParameterType(offset-1);
+ setArgcodeLValue(aCTX, argsInstruction->at(offset), arg);
+ }
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND);
+
+ return( optimizedCode );
+ }
+ else if( ExpressionTypeChecker::isTyped(TypeManager::PORT, arg) )
+ {
+ argsInstruction->at(0).dtype = TypeManager::PORT;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), arg, false);
+
+ for( avm_size_t offset = 1 ; (++it != endIt) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = TypeManager::UNIVERSAL;
+ setArgcodeLValue(aCTX, argsInstruction->at(offset), arg);
+ }
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND);
+
+ return( optimizedCode );
+ }
+ else if( ExpressionTypeChecker::isTyped(TypeManager::MESSAGE, arg) )
+ {
+ argsInstruction->at(0).dtype = TypeManager::MESSAGE;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), arg, false);
+
+ for( avm_size_t offset = 1 ; (++it != endIt) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = TypeManager::UNIVERSAL;
+ setArgcodeLValue(aCTX, argsInstruction->at(offset), (*it), false);
+ }
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND);
+
+ return( optimizedCode );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmcodeInputCompiler::optimizeStatement :> Unexpected << "
+ << str_header( arg ) << " >> as input first argument !!!"
+ << std::endl;
+
+ return( aCode );
+ }
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE OUTPUT STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeOutputCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode compiledCode = compileExpressionCode(aCTX, aCode);
+
+ const BF & arg = compiledCode->first();
+
+ if( ExpressionTypeChecker::isTyped(TypeManager::PORT, arg) )
+ {
+ //!! NOTHING
+ }
+ else if( ExpressionTypeChecker::isTyped(TypeManager::MESSAGE, arg) )
+ {
+
+ }
+ else
+ {
+ compiledCode->setOperator(OperatorManager::OPERATOR_OUTPUT_VAR);
+ }
+
+ return( compiledCode );
+}
+
+
+BFCode AvmcodeOutputCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optimizedCode( aCode->getOperator() );
+
+ AvmInstruction * argsInstruction =
+ optimizedCode->newInstruction( aCode->size() );
+
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator endIt = aCode->end();
+
+ BF arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ if( arg.is< InstanceOfPort >() )
+ {
+ argsInstruction->at(0).dtype = TypeManager::PORT;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), arg, false);
+
+ InstanceOfPort * aPort = arg.to_ptr< InstanceOfPort >();
+
+ if( aPort->hasOutputRoutingData() )
+ {
+ const RoutingData & aRoutingData = aPort->getOutputRoutingData();
+
+ switch( aRoutingData.getProtocol() )
+ {
+ case ComProtocol::PROTOCOL_ENVIRONMENT_KIND:
+ {
+ optimizedCode->setOperator(
+ OperatorManager::OPERATOR_OUTPUT_ENV);
+ break;
+ }
+
+ case ComProtocol::PROTOCOL_RDV_KIND:
+ case ComProtocol::PROTOCOL_MULTIRDV_KIND:
+ {
+ optimizedCode->setOperator(
+ OperatorManager::OPERATOR_OUTPUT_RDV);
+ break;
+ }
+
+ case ComProtocol::PROTOCOL_BUFFER_KIND:
+ case ComProtocol::PROTOCOL_BROADCAST_KIND:
+ case ComProtocol::PROTOCOL_MULTICAST_KIND:
+ case ComProtocol::PROTOCOL_UNICAST_KIND:
+ case ComProtocol::PROTOCOL_ANYCAST_KIND:
+ {
+ if( aRoutingData.getBufferInstance().singleton() )
+ {
+ optimizedCode->setOperator(
+ OperatorManager::OPERATOR_OUTPUT_BUFFER);
+ }
+ break;
+ }
+
+ case ComProtocol::PROTOCOL_TRANSFERT_KIND:
+ case ComProtocol::PROTOCOL_UNDEFINED_KIND:
+ default:
+ {
+ break;
+ }
+ }
+ }
+
+ avm_size_t paramCount = aPort->getParameterCount();
+ for( avm_size_t offset = 1 ;
+ (++it != endIt) && (offset <= paramCount) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = aPort->getParameterType(offset-1);
+ setArgcodeRValue(aCTX->clone(argsInstruction->at(offset).dtype),
+ argsInstruction->at(offset), arg);
+ }
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND);
+
+ return( optimizedCode );
+ }
+ else if( ExpressionTypeChecker::isTyped(TypeManager::PORT, arg) )
+ {
+ argsInstruction->at(0).dtype = TypeManager::PORT;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), arg, false);
+
+ for( avm_size_t offset = 1 ; (++it != endIt) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = TypeManager::UNIVERSAL;
+ setArgcodeRValue(aCTX, argsInstruction->at(offset), arg, false);
+ }
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND);
+
+ return( optimizedCode );
+ }
+ else if( ExpressionTypeChecker::isTyped(TypeManager::MESSAGE, arg) )
+ {
+ argsInstruction->at(0).dtype = TypeManager::MESSAGE;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), arg, false);
+
+ for( avm_size_t offset = 1 ; (++it != endIt) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = TypeManager::UNIVERSAL;
+ setArgcodeRValue(aCTX, argsInstruction->at(offset), (*it), false);
+ }
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND);
+
+ return( optimizedCode );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmcodeInputCompiler::optimizeStatement :> Unexpected << "
+ << str_header( arg ) << " >> as input first argument !!!"
+ << std::endl;
+
+ return( aCode );
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE OUTPUT#TO STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeOutputToCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->size() >= 2 )
+ {
+ BFCode compilCode( aCode->getOperator() );
+
+ AvmCode::iterator it = aCode->begin();
+ compilCode.append(
+ compileArgRvalue(aCTX, TypeManager::PORT, *it) );
+
+ compilCode.append(
+ compileArgRvalue(aCTX, TypeManager::MACHINE, *(++it)) );
+
+ AvmCode::iterator endIt = aCode->end();
+ for( ++it ; it != endIt ; ++it )
+ {
+ compilCode.append( compileArgRvalue(aCTX, *it) );
+ }
+
+ return( compilCode );
+
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmcodeOutputToCompiler::compileStatement :> "
+ "Not enough parameter for << output_to >> statement << "
+ << str_indent( aCode ) << " >> !!!"
+ << std::endl;
+
+ return( aCode );
+ }
+}
+
+
+BFCode AvmcodeOutputToCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optimizedCode( aCode->getOperator() );
+
+ AvmInstruction * argsInstruction =
+ optimizedCode->newInstruction( aCode->size() );
+
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator endIt = aCode->end();
+
+ BF arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ if( arg.is< InstanceOfPort >() )
+ {
+ argsInstruction->at(0).dtype = TypeManager::PORT;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), arg, false);
+
+ InstanceOfPort * aPort = arg.as_ptr< InstanceOfPort >();
+ avm_size_t paramCount = aPort->getParameterCount();
+
+
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*(++it)));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(1).dtype = TypeManager::MACHINE;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), arg);
+
+ for( avm_size_t offset = 2 ;
+ (++it != endIt) && (paramCount > 0) ; ++offset , --paramCount )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = aPort->getParameterType(offset-2);
+ setArgcodeRValue(aCTX, argsInstruction->at(offset), arg);
+ }
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND);
+
+ return( optimizedCode );
+ }
+ else if( ExpressionTypeChecker::isTyped(TypeManager::PORT, arg) )
+ {
+ argsInstruction->at(0).dtype = TypeManager::PORT;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), arg, false);
+
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*(++it)));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(1).dtype = TypeManager::MACHINE;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), arg);
+
+ for( avm_size_t offset = 2 ; (++it != endIt) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = TypeManager::UNIVERSAL;
+ setArgcodeRValue(aCTX, argsInstruction->at(offset), arg);
+ }
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND);
+
+ return( optimizedCode );
+ }
+ else if( ExpressionTypeChecker::isTyped(TypeManager::MESSAGE, arg) )
+ {
+ argsInstruction->at(0).dtype = TypeManager::MESSAGE;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), arg, false);
+
+
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*(++it)));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(1).dtype = TypeManager::MACHINE;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), arg);
+
+ for( avm_size_t offset = 2 ; (++it != endIt) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = TypeManager::UNIVERSAL;
+ setArgcodeRValue(aCTX, argsInstruction->at(offset), (*it), false);
+ }
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND);
+
+ return( optimizedCode );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmcodeInputCompiler::optimizeStatement :> Unexpected << "
+ << str_header( arg ) << " >> as input first argument !!!"
+ << std::endl;
+
+ return( aCode );
+ }
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE OUTPUT#VAR STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeOutputVarCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BF lvalue = compileArgLvalue(aCTX, aCode->first());
+
+ if( aCode->populated() )
+ {
+ if( lvalue.is< InstanceOfData >() )
+ {
+ aCTX = aCTX->clone( lvalue.to_ptr<
+ InstanceOfData >()->getTypeSpecifier() );
+ }
+ return( StatementConstructor::newCode( aCode->getOperator(),
+ lvalue, compileArgRvalue(aCTX, aCode->second())) );
+ }
+ else
+ {
+ return( StatementConstructor::newCode(
+ aCode->getOperator(), lvalue, lvalue) );
+ }
+}
+
+
+BFCode AvmcodeOutputVarCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->singleton() )
+ {
+ aCode->append( aCode->first() );
+ }
+
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ setArgcodeLValue(aCTX, argsInstruction->at(0), aCode->first());
+
+ if( aCode->singleton() )
+ {
+ aCode->append( aCode->first() );
+ }
+
+ optimizeArgExpression(aCTX, aCode, 1);
+ argsInstruction->at(1).dtype = argsInstruction->at(0).dtype;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), aCode->second());
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND,
+ /*dtype */ argsInstruction->at(0).dtype);
+
+ return( aCode );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE OUTPUT#ENV STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeOutputEnvCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileExpressionCode(aCTX, aCode) );
+}
+
+
+BFCode AvmcodeOutputEnvCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optimizedCode( aCode->getOperator() );
+
+ AvmInstruction * argsInstruction =
+ optimizedCode->newInstruction( aCode->size() );
+
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator endIt = aCode->end();
+
+ BF arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ if( ExpressionTypeChecker::isTyped(TypeManager::PORT, arg) )
+ {
+ argsInstruction->at(0).dtype = TypeManager::PORT;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), arg, false);
+
+ InstanceOfPort * aPort = arg.as_ptr< InstanceOfPort >();
+ avm_size_t paramCount = aPort->getParameterCount();
+
+ for( avm_size_t offset = 1 ;
+ (++it != endIt) && (paramCount > 0) ; ++offset , --paramCount )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = aPort->getParameterType(offset-1);
+ setArgcodeRValue(aCTX, argsInstruction->at(offset), arg);
+ }
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND);
+
+ return( optimizedCode );
+ }
+ else if( ExpressionTypeChecker::isTyped(TypeManager::PORT, arg) )
+ {
+ argsInstruction->at(0).dtype = TypeManager::PORT;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), arg, false);
+
+ for( avm_size_t offset = 1 ; (++it != endIt) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = TypeManager::UNIVERSAL;
+ setArgcodeRValue(aCTX, argsInstruction->at(offset), arg);
+ }
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND);
+
+ return( optimizedCode );
+ }
+ else if( ExpressionTypeChecker::isTyped(TypeManager::MESSAGE, arg) )
+ {
+ argsInstruction->at(0).dtype = TypeManager::MESSAGE;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), arg, false);
+
+ for( avm_size_t offset = 1 ; (++it != endIt) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = TypeManager::UNIVERSAL;
+ setArgcodeRValue(aCTX, argsInstruction->at(offset), (*it), false);
+ }
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND);
+
+ return( optimizedCode );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmcodeInputCompiler::optimizeStatement :> Unexpected << "
+ << str_header( arg ) << " >> as input first argument !!!"
+ << std::endl;
+
+ return( aCode );
+ }
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE PRESENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeAbsentPresentCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileExpressionCode(aCTX, aCode) );
+}
+
+BF AvmcodeAbsentPresentCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( optimizeExpressionCode(aCTX, aCode) );
+}
+
+
+BFCode AvmcodeAbsentPresentCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileExpressionCode(aCTX, aCode) );
+}
+
+BFCode AvmcodeAbsentPresentCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( optimizeStatementCode(aCTX, aCode) );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE OBS COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+inline BF AvmcodeObsCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileStatement(aCTX, aCode) );
+}
+
+inline BF AvmcodeObsCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optCode = optimizeStatement(aCTX, aCode);
+
+ optCode->getInstruction()->setMainOperand( AVM_ARG_EXPRESSION_KIND );
+
+ return( optCode );
+}
+
+
+inline BFCode AvmcodeObsCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->size() == 2 )
+ {
+ return( StatementConstructor::newCode( aCode->getOperator(),
+ AVMCODE_COMPILER.getConfiguration().
+ getExecutableSystem().getSystemInstance(),
+ compileArgStatement(aCTX, aCode->first()),
+ compileArgRvalue(aCTX, TypeManager::BOOLEAN, aCode->second())) );
+ }
+ return( StatementConstructor::newCode( aCode->getOperator(),
+ compileArgRvalue(aCTX, TypeManager::MACHINE, aCode->first()),
+ compileArgStatement(aCTX, aCode->second()),
+ compileArgRvalue(aCTX, TypeManager::BOOLEAN, aCode->third())) );
+}
+
+// lvalue =: rvalue; ==> [ lvalue , rvalue ]
+BFCode AvmcodeObsCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ optimizeArgStatement(aCTX, aCode, 0);
+ setArgcodeRValue(aCTX, argsInstruction->at(0), aCode->first());
+ argsInstruction->operand(0, AVM_ARG_MACHINE_RID);
+
+ optimizeArgStatement(aCTX, aCode, 1);
+ setArgcodeRValue(aCTX, argsInstruction->at(1), aCode->second());
+
+ optimizeArgExpression(aCTX, aCode, 2);
+ argsInstruction->at(2).dtype = TypeManager::BOOLEAN;
+ setArgcodeRValue(aCTX, argsInstruction->at(2), aCode->third());
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND,
+ /*dtype */ argsInstruction->at(0).dtype);
+
+ return( aCode );
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeCommunicationCompiler.h b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeCommunicationCompiler.h
new file mode 100644
index 0000000..0a229ff
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeCommunicationCompiler.h
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 12 avr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCODECOMMUNICATIONCOMPILER_H_
+#define AVMCODECOMMUNICATIONCOMPILER_H_
+
+#include <builder/primitive/AbstractAvmcodeCompiler.h>
+
+
+namespace sep
+{
+
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS(
+ "INPUT", Input, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS(
+ "INPUT#FROM", InputFrom, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS(
+ "INPUT#SAVE", InputSave, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS(
+ "INPUT#VAR", InputVar, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS(
+ "INPUT#ENV", InputEnv, AbstractAvmcodeCompiler)
+
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS(
+ "OUTPUT", Output, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS(
+ "OUTPUT#TO", OutputTo, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS(
+ "OUTPUT#VAR", OutputVar, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS(
+ "OUTPUT#ENV", OutputEnv, AbstractAvmcodeCompiler)
+
+
+AVMCODE_COMPILER_OPTIMIZER_CLASS(AbsentPresent, AbstractAvmcodeCompiler)
+
+
+AVMCODE_COMPILER_OPTIMIZER_CLASS(Obs, AbstractAvmcodeCompiler)
+
+
+}
+
+#endif /* AVMCODECOMMUNICATIONCOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeCompiler.cpp b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeCompiler.cpp
new file mode 100644
index 0000000..9170df8
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeCompiler.cpp
@@ -0,0 +1,2937 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 7 avr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmcodeCompiler.h"
+
+#include <iostream>
+
+#include <builder/compiler/BaseCompiler.h>
+#include <builder/compiler/BaseCompilerTable.h>
+
+#include <builder/primitive/AbstractAvmcodeCompiler.h>
+#include <builder/primitive/AvmcodeActivityCompiler.h>
+#include <builder/primitive/AvmcodeAssignCompiler.h>
+#include <builder/primitive/AvmcodeCommunicationCompiler.h>
+#include <builder/primitive/AvmcodeContainerCompiler.h>
+#include <builder/primitive/AvmcodeCtorExpressionCompiler.h>
+#include <builder/primitive/AvmcodeExpressionCompiler.h>
+#include <builder/primitive/AvmcodeGinacCompiler.h>
+#include <builder/primitive/AvmcodeGuardCompiler.h>
+#include <builder/primitive/AvmcodeInvokeCompiler.h>
+#include <builder/primitive/AvmcodeIteCompiler.h>
+#include <builder/primitive/AvmcodeJumpCompiler.h>
+#include <builder/primitive/AvmcodeLambdaCompiler.h>
+#include <builder/primitive/AvmcodeLookupExprCompiler.h>
+#include <builder/primitive/AvmcodeLoopCompiler.h>
+#include <builder/primitive/AvmcodeMachineStatusCompiler.h>
+#include <builder/primitive/AvmcodeMathFunctionCompiler.h>
+#include <builder/primitive/AvmcodeMetaStatementCompiler.h>
+#include <builder/primitive/AvmcodeQueueCompiler.h>
+#include <builder/primitive/AvmcodeSchedulingCompiler.h>
+#include <builder/primitive/AvmcodeSequenceCompiler.h>
+#include <builder/primitive/AvmcodeUfiCastExpressionCompiler.h>
+#include <builder/primitive/AvmcodeVariableStatusCompiler.h>
+
+#include <fml/common/SpecifierElement.h>
+
+#include <fml/executable/AvmProgram.h>
+#include <fml/executable/BaseAvmProgram.h>
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/InstanceOfData.h>
+#include <fml/executable/InstanceOfPort.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/BuiltinArray.h>
+#include <fml/expression/BuiltinContainer.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/StatementFactory.h>
+
+#include <fml/operator/Operator.h>
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/type/TypeManager.h>
+
+#include <fml/infrastructure/Buffer.h>
+#include <fml/infrastructure/Connector.h>
+#include <fml/infrastructure/DataType.h>
+#include <fml/infrastructure/Machine.h>
+#include <fml/infrastructure/Port.h>
+#include <fml/infrastructure/Routine.h>
+#include <fml/infrastructure/Transition.h>
+#include <fml/infrastructure/Variable.h>
+
+#include <fml/workflow/UniFormIdentifier.h>
+
+#include <sew/Configuration.h>
+
+
+namespace sep
+{
+
+
+#define NEW_COMPILER( OP_AC ) \
+ ( AVMCODE_COMPILER_TABLE_FOR_DESTROY.push_back( new OP_AC( *this ) ) , \
+ AVMCODE_COMPILER_TABLE_FOR_DESTROY.back() )
+
+
+#define OPCODE_COMPILER( OP_ID ) \
+ AVMCODE_COMPILER_TABLE[ OperatorManager::OPERATOR_##OP_ID->getOffset() ]
+
+
+
+/**
+ * DESTRUCTOR
+ */
+AvmcodeCompiler::~AvmcodeCompiler()
+{
+ AVMCODE_COMPILER_TABLE.clear();
+
+ std::vector< AbstractAvmcodeCompiler * >::iterator it =
+ AVMCODE_COMPILER_TABLE_FOR_DESTROY.begin();
+ std::vector< AbstractAvmcodeCompiler * >::iterator endIt =
+ AVMCODE_COMPILER_TABLE_FOR_DESTROY.end();
+ for( avm_size_t offset = 0 ; it != endIt ; ++it , ++offset )
+ {
+ delete( *it );
+ }
+
+ delete( UFI_EXPRESSION_COMPILER );
+
+ AVMCODE_COMPILER_TABLE_FOR_DESTROY.clear();
+}
+
+
+/*
+ * GETTER
+ * theSymbolTable
+ */
+SymbolTable & AvmcodeCompiler::getSymbolTable()
+{
+ return( mCompilerTable.getSymbolTable() );
+}
+
+
+/**
+ * CONFIGURE
+ */
+bool AvmcodeCompiler::configure()
+{
+ DEFAULT_AVMCODE_COMPILER =NEW_COMPILER( AbstractAvmcodeCompiler );
+
+ NOTHING_AVMCODE_COMPILER =NEW_COMPILER( AvmcodeNothingCompiler );
+
+ UNARY_ARITHMETIC_EXPRESSION_COMPILER =
+ NEW_COMPILER( AvmcodeUnaryArithmeticExpressionALUCompiler );
+ BINARY_ARITHMETIC_EXPRESSION_COMPILER =
+ NEW_COMPILER( AvmcodeBinaryArithmeticExpressionALUCompiler );
+ ASSOCIATIVE_ARITHMETIC_EXPRESSION_COMPILER =
+ NEW_COMPILER( AvmcodeAssociativeArithmeticExpressionALUCompiler );
+
+ UNARY_BITWISE_EXPRESSION_COMPILER =
+ NEW_COMPILER( AvmcodeUnaryBitwiseExpressionCompiler );
+ BINARY_BITWISE_EXPRESSION_COMPILER =
+ NEW_COMPILER( AvmcodeBinaryBitwiseExpressionCompiler );
+ ASSOCIATIVE_BITWISE_EXPRESSION_COMPILER =
+ NEW_COMPILER( AvmcodeAssociativeBitwiseExpressionCompiler );
+
+ UNARY_PREDICATE_EXPRESSION_COMPILER =
+ NEW_COMPILER( AvmcodeUnaryPredicateExpressionCompiler );
+ BINARY_PREDICATE_EXPRESSION_COMPILER =
+ NEW_COMPILER( AvmcodeBinaryPredicateExpressionCompiler );
+ ASSOCIATIVE_PREDICATE_EXPRESSION_COMPILER =
+ NEW_COMPILER( AvmcodeAssociativePredicateExpressionCompiler );
+
+ RELATIONAL_EXPRESSION_COMPILER =
+ NEW_COMPILER( AvmcodeRelationalExpressionCompiler );
+
+ UNARY_STRING_EXPRESSION_COMPILER =
+ NEW_COMPILER( AvmcodeUnaryStringExpressionCompiler );
+ BINARY_STRING_EXPRESSION_COMPILER =
+ NEW_COMPILER( AvmcodeBinaryStringExpressionCompiler );
+ ASSOCIATIVE_STRING_EXPRESSION_COMPILER =
+ NEW_COMPILER( AvmcodeAssociativeStringExpressionCompiler );
+
+ LOOKUP_EXPRESSION_COMPILER =
+ NEW_COMPILER( AvmcodeLookupExpressionCompiler );
+
+ MACHINE_STATUS_EXPRESSION_COMPILER =
+ NEW_COMPILER( AvmcodeMachineStatusExpressionCompiler );
+
+ MATH_FUNCTION_COMPILER =
+ NEW_COMPILER( AvmcodeMathFunctionCompiler );
+
+ UFI_EXPRESSION_COMPILER =
+ new AvmcodeUfiExpressionCompiler( *this );
+
+ VARIABLE_STATUS_EXPRESSION_COMPILER =
+ NEW_COMPILER( AvmcodeVariableStatusExpressionCompiler );
+
+
+ ACTIVITY_STATEMENT_COMPILER =
+ NEW_COMPILER( AvmcodeActivityStatementCompiler );
+
+ SCHEDULING_STATEMENT_COMPILER =
+ NEW_COMPILER( AvmcodeSchedulingCompiler );
+
+ SEQUENCE_STATEMENT_COMPILER =
+ NEW_COMPILER( AvmcodeSequenceCompiler );
+
+ ITE_STATEMENT_COMPILER =
+ NEW_COMPILER( AvmcodeIteCompiler );
+
+
+ UNARY_CONTAINER_STATEMENT =
+ NEW_COMPILER( AvmcodeUnaryContainerStatementCompiler );
+
+ UNARY_WRITE_CONTAINER_STATEMENT =
+ NEW_COMPILER( AvmcodeUnaryWriteContainerStatementCompiler );
+
+ BINARY_CONTAINER_STATEMENT =
+ NEW_COMPILER( AvmcodeBinaryContainerStatementCompiler );
+
+ BINARY_WRITE_CONTAINER_STATEMENT =
+ NEW_COMPILER( AvmcodeBinaryWriteContainerStatementCompiler );
+
+
+ //DEFAULT_AVMCODE_COMPILER);
+ AVMCODE_COMPILER_TABLE.resize(
+ OperatorManager::TABLE_OF_OPERATOR.size(),
+ DEFAULT_AVMCODE_COMPILER );
+
+ if( not configureOther() )
+ {
+ return( false );
+ }
+
+ if( not configureMeta() )
+ {
+ return( false );
+ }
+
+ if( not configureLambdaPrimitive() )
+ {
+ return( false );
+ }
+
+ if( not configureActivityPrimitive() )
+ {
+ return( false );
+ }
+
+ if( not configureStatusPrimitive() )
+ {
+ return( false );
+ }
+
+ if( not configureSchedulingPrimitive() )
+ {
+ return( false );
+ }
+ if( not configureBasicPrimitive() )
+ {
+ return( false );
+ }
+
+ if( not configureArithmeticPrimitive() )
+ {
+ return( false );
+ }
+ if( not configureBitwisePrimitive() )
+ {
+ return( false );
+ }
+ if( not configureLogicPrimitive() )
+ {
+ return( false );
+ }
+
+ if( not configureLookupPrimitive() )
+ {
+ return( false );
+ }
+ if( not configureMathematicPrimitive() )
+ {
+ return( false );
+ }
+
+ if( not configureStringCollectionPrimitive() )
+ {
+ return( false );
+ }
+
+ if( not configureIoltPrimitive() )
+ {
+ return( false );
+ }
+
+ return( true );
+}
+
+
+bool AvmcodeCompiler::configureOther()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM UFI STATEMENT
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPILER( UFI ) = UFI_EXPRESSION_COMPILER;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM CAST STATEMENT
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPILER( CTOR ) = NEW_COMPILER( AvmcodeCtorExpressionCompiler );
+
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM GINAC EXPRESSION & STATEMENT
+ ////////////////////////////////////////////////////////////////////////////
+// mGinacPrimitive = NEW_COMPILER( AbstractAvmcodeCompiler );
+
+
+ return( true );
+}
+
+
+bool AvmcodeCompiler::configureMeta()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM NOP STATEMENT
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPILER( NOP ) = NOTHING_AVMCODE_COMPILER;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM META STATEMENT
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPILER( INFORMAL ) = NEW_COMPILER( AvmcodeInformalExpressionCompiler );
+
+ OPCODE_COMPILER( TRACE ) = NEW_COMPILER( AvmcodeTraceExpressionCompiler );
+
+ OPCODE_COMPILER( DEBUG ) = NEW_COMPILER( AvmcodeDebugExpressionCompiler );
+
+ OPCODE_COMPILER( COMMENT ) = NEW_COMPILER( AvmcodeCommentExpressionCompiler );
+
+ OPCODE_COMPILER( QUOTE ) = DEFAULT_AVMCODE_COMPILER;
+
+ OPCODE_COMPILER( META_EVAL ) = NEW_COMPILER( AvmcodeMetaEvalStatementCompiler );
+ OPCODE_COMPILER( META_RUN ) = NEW_COMPILER( AvmcodeMetaRunStatementCompiler );
+
+
+ return( true );
+}
+
+
+bool AvmcodeCompiler::configureLambdaPrimitive()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // LAMBDA STATEMENT
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPILER( APPLY ) = NEW_COMPILER( AvmcodeLambdaApplyCompiler );
+
+ OPCODE_COMPILER( LAMBDA ) = NEW_COMPILER( AvmcodeLambdaExprCompiler );
+
+ ////////////////////////////////////////////////////////////////////////////
+ // LET STATEMENT
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPILER( LET ) = NEW_COMPILER( AvmcodeLambdaLetCompiler );
+
+
+ return( true );
+}
+
+
+bool AvmcodeCompiler::configureActivityPrimitive()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM MACHINE MANAGING
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPILER( CONTEXT_SWITCHER ) = NEW_COMPILER( AvmcodeContextSwitcherStatementCompiler );
+
+ OPCODE_COMPILER( INIT ) = ACTIVITY_STATEMENT_COMPILER;
+ OPCODE_COMPILER( FINAL ) = ACTIVITY_STATEMENT_COMPILER;
+ OPCODE_COMPILER( DESTROY ) = ACTIVITY_STATEMENT_COMPILER;
+
+ OPCODE_COMPILER( START ) = ACTIVITY_STATEMENT_COMPILER;
+ OPCODE_COMPILER( RESTART ) = ACTIVITY_STATEMENT_COMPILER;
+ OPCODE_COMPILER( STOP ) = ACTIVITY_STATEMENT_COMPILER;
+
+ OPCODE_COMPILER( WAIT ) = ACTIVITY_STATEMENT_COMPILER;
+
+ OPCODE_COMPILER( SUSPEND ) = ACTIVITY_STATEMENT_COMPILER;
+ OPCODE_COMPILER( RESUME ) = ACTIVITY_STATEMENT_COMPILER;
+
+
+ OPCODE_COMPILER( IENABLE_INVOKE ) = NEW_COMPILER( AvmcodeIEnableStatementCompiler );
+ OPCODE_COMPILER( ENABLE_INVOKE ) = NEW_COMPILER( AvmcodeEnableStatementCompiler );
+ OPCODE_COMPILER( ENABLE_SET ) = ACTIVITY_STATEMENT_COMPILER;
+
+ OPCODE_COMPILER( IDISABLE_INVOKE ) = NEW_COMPILER( AvmcodeIDisableStatementCompiler );
+ OPCODE_COMPILER( DISABLE_INVOKE ) = NEW_COMPILER( AvmcodeDisableStatementCompiler );
+ OPCODE_COMPILER( DISABLE_SET ) = ACTIVITY_STATEMENT_COMPILER;
+ OPCODE_COMPILER( DISABLE_CHILD ) = NOTHING_AVMCODE_COMPILER;
+ OPCODE_COMPILER( DISABLE_SELF ) = NOTHING_AVMCODE_COMPILER;
+ OPCODE_COMPILER( DISABLE_SELVES ) = NEW_COMPILER( AvmcodeDisableSelvesStatementCompiler );
+
+ OPCODE_COMPILER( IABORT_INVOKE ) = NEW_COMPILER( AvmcodeIAbortStatementCompiler );
+ OPCODE_COMPILER( ABORT_INVOKE ) = NEW_COMPILER( AvmcodeAbortStatementCompiler );
+ OPCODE_COMPILER( ABORT_SET ) = ACTIVITY_STATEMENT_COMPILER;
+ OPCODE_COMPILER( ABORT_CHILD ) = NOTHING_AVMCODE_COMPILER;
+ OPCODE_COMPILER( ABORT_SELF ) = NOTHING_AVMCODE_COMPILER;
+ OPCODE_COMPILER( ABORT_SELVES ) = NEW_COMPILER( AvmcodeAbortSelvesStatementCompiler );
+
+ OPCODE_COMPILER( HISTORY_CLEAR ) = ACTIVITY_STATEMENT_COMPILER;
+ OPCODE_COMPILER( DEEP_HISTORY_INVOKE ) = ACTIVITY_STATEMENT_COMPILER;
+ OPCODE_COMPILER( SHALLOW_HISTORY_INVOKE ) = ACTIVITY_STATEMENT_COMPILER;
+
+ OPCODE_COMPILER( IRUN ) = ACTIVITY_STATEMENT_COMPILER;
+ OPCODE_COMPILER( RUN ) = ACTIVITY_STATEMENT_COMPILER;
+
+ OPCODE_COMPILER( RTC ) = NEW_COMPILER( AvmcodeRtcStatementCompiler );
+
+
+ OPCODE_COMPILER( INVOKE_NEW ) = NEW_COMPILER( AvmcodeInvokeNewCompiler );
+
+ OPCODE_COMPILER( INVOKE_ROUTINE ) = NEW_COMPILER( AvmcodeInvokeRoutineCompiler );
+
+ OPCODE_COMPILER( INVOKE_TRANSITION ) = NEW_COMPILER( AvmcodeInvokeTransitionCompiler );
+
+ OPCODE_COMPILER( INVOKE_METHOD ) = NEW_COMPILER( AvmcodeInvokeMethodCompiler );
+ OPCODE_COMPILER( INVOKE_PROGRAM ) = NEW_COMPILER( AvmcodeInvokeProgramCompiler );
+ OPCODE_COMPILER( INVOKE_FUNCTION ) = NEW_COMPILER( AvmcodeInvokeFunctionCompiler );
+
+
+ OPCODE_COMPILER( SCHEDULE_INVOKE ) = NEW_COMPILER( AvmcodeScheduleStatementCompiler );
+ OPCODE_COMPILER( SCHEDULE_GET ) = ACTIVITY_STATEMENT_COMPILER;
+ OPCODE_COMPILER( SCHEDULE_IN ) = NEW_COMPILER( AvmcodeScheduleInStatementCompiler );
+ OPCODE_COMPILER( SCHEDULE_SET ) = ACTIVITY_STATEMENT_COMPILER;
+
+ OPCODE_COMPILER( GOTO ) = NEW_COMPILER( AvmcodeGotoStatementCompiler );
+
+ OPCODE_COMPILER( FORK ) = NEW_COMPILER( AvmcodeForkStatementCompiler );
+ OPCODE_COMPILER( JOIN ) = NEW_COMPILER( AvmcodeJoinStatementCompiler );
+
+ OPCODE_COMPILER( INPUT_ENABLED ) = NEW_COMPILER( AvmcodeInputEnabledStatementCompiler );
+
+ OPCODE_COMPILER( RDV ) = ACTIVITY_STATEMENT_COMPILER;
+
+ OPCODE_COMPILER( SYNCHRONIZE ) = ACTIVITY_STATEMENT_COMPILER;
+
+
+ return( true );
+}
+
+
+bool AvmcodeCompiler::configureStatusPrimitive()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM MACHINE STATUS
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPILER( STATUS_WAS ) = MACHINE_STATUS_EXPRESSION_COMPILER;
+ OPCODE_COMPILER( STATUS_IS ) = MACHINE_STATUS_EXPRESSION_COMPILER;
+ OPCODE_COMPILER( STATUS_BEING ) = MACHINE_STATUS_EXPRESSION_COMPILER;
+ OPCODE_COMPILER( STATUS_WILL ) = MACHINE_STATUS_EXPRESSION_COMPILER;
+
+ OPCODE_COMPILER( CHANGED ) = VARIABLE_STATUS_EXPRESSION_COMPILER;
+ OPCODE_COMPILER( CHANGED_TO ) = VARIABLE_STATUS_EXPRESSION_COMPILER;
+
+ return( true );
+}
+
+
+bool AvmcodeCompiler::configureSchedulingPrimitive()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM PROGRAM SCHEDULING
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPILER( ASYNCHRONOUS ) = SCHEDULING_STATEMENT_COMPILER;
+ OPCODE_COMPILER( STRONG_SYNCHRONOUS ) = SCHEDULING_STATEMENT_COMPILER;
+ OPCODE_COMPILER( WEAK_SYNCHRONOUS ) = SCHEDULING_STATEMENT_COMPILER;
+ OPCODE_COMPILER( INTERLEAVING ) = SCHEDULING_STATEMENT_COMPILER;
+ OPCODE_COMPILER( PARALLEL ) = SCHEDULING_STATEMENT_COMPILER;
+
+ OPCODE_COMPILER( RDV_ASYNCHRONOUS ) = SCHEDULING_STATEMENT_COMPILER;
+ OPCODE_COMPILER( RDV_STRONG_SYNCHRONOUS ) = SCHEDULING_STATEMENT_COMPILER;
+ OPCODE_COMPILER( RDV_WEAK_SYNCHRONOUS ) = SCHEDULING_STATEMENT_COMPILER;
+ OPCODE_COMPILER( RDV_INTERLEAVING ) = SCHEDULING_STATEMENT_COMPILER;
+ OPCODE_COMPILER( RDV_PARALLEL ) = SCHEDULING_STATEMENT_COMPILER;
+
+
+ OPCODE_COMPILER( EXCLUSIVE ) = SCHEDULING_STATEMENT_COMPILER;
+ OPCODE_COMPILER( NONDETERMINISM ) = SCHEDULING_STATEMENT_COMPILER;
+
+ OPCODE_COMPILER( PRIOR_GT ) = SCHEDULING_STATEMENT_COMPILER;
+ OPCODE_COMPILER( PRIOR_LT ) = SCHEDULING_STATEMENT_COMPILER;
+
+ OPCODE_COMPILER( SCHEDULE_AND_THEN ) = SCHEDULING_STATEMENT_COMPILER;
+ OPCODE_COMPILER( SCHEDULE_OR_ELSE ) = SCHEDULING_STATEMENT_COMPILER;
+
+ OPCODE_COMPILER( ATOMIC_SEQUENCE ) = NEW_COMPILER( AvmcodeAtomicSequenceCompiler );
+
+ OPCODE_COMPILER( SEQUENCE ) = NEW_COMPILER( AvmcodeStrongSequenceCompiler );
+
+ OPCODE_COMPILER( SEQUENCE_SIDE ) = SEQUENCE_STATEMENT_COMPILER;
+ OPCODE_COMPILER( SEQUENCE_WEAK ) = SEQUENCE_STATEMENT_COMPILER;
+
+ OPCODE_COMPILER( PRODUCT ) = SCHEDULING_STATEMENT_COMPILER;
+
+
+ return( true );
+}
+
+
+bool AvmcodeCompiler::configureBasicPrimitive()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM BUFFER MANAGING
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPILER( UPDATE_BUFFER ) = DEFAULT_AVMCODE_COMPILER;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM PRIMITIVE STATEMENT
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPILER( ASSIGN ) = NEW_COMPILER( AvmcodeAssignCompiler );
+ OPCODE_COMPILER( ASSIGN_AFTER ) = NEW_COMPILER( AvmcodeAssignAfterCompiler );
+
+ OPCODE_COMPILER( ASSIGN_OP ) = NEW_COMPILER( AvmcodeAssignOpCompiler );
+ OPCODE_COMPILER( ASSIGN_OP_AFTER ) = NEW_COMPILER( AvmcodeAssignOpAfterCompiler );
+
+ OPCODE_COMPILER( ASSIGN_REF ) = NEW_COMPILER( AvmcodeAssignRefCompiler );
+ OPCODE_COMPILER( ASSIGN_MACRO ) = NEW_COMPILER( AvmcodeAssignMacroCompiler );
+
+ OPCODE_COMPILER( ASSIGN_NEWFRESH ) = NEW_COMPILER( AvmcodeAssignUnaryCompiler );
+ OPCODE_COMPILER( ASSIGN_RESET ) = OPCODE_COMPILER( ASSIGN_NEWFRESH );
+
+ OPCODE_COMPILER( GUARD ) = NEW_COMPILER( AvmcodeGuardCompiler );
+ OPCODE_COMPILER( TIMED_GUARD ) = NEW_COMPILER( AvmcodeTimedGuardCompiler );
+ OPCODE_COMPILER( EVENT ) = NEW_COMPILER( AvmcodeEventCompiler );
+ OPCODE_COMPILER( CHECK_SAT ) = NEW_COMPILER( AvmcodeChecksatCompiler );
+
+ OPCODE_COMPILER( INPUT ) = NEW_COMPILER( AvmcodeInputCompiler );
+ OPCODE_COMPILER( INPUT_FROM ) = NEW_COMPILER( AvmcodeInputFromCompiler );
+ OPCODE_COMPILER( INPUT_SAVE ) = NEW_COMPILER( AvmcodeInputSaveCompiler );
+
+ OPCODE_COMPILER( INPUT_VAR ) = NEW_COMPILER( AvmcodeInputVarCompiler );
+ OPCODE_COMPILER( INPUT_ENV ) = NEW_COMPILER( AvmcodeInputEnvCompiler );
+
+ OPCODE_COMPILER( OUTPUT ) = NEW_COMPILER( AvmcodeOutputCompiler );
+ OPCODE_COMPILER( OUTPUT_TO ) = NEW_COMPILER( AvmcodeOutputToCompiler );
+ OPCODE_COMPILER( OUTPUT_VAR ) = NEW_COMPILER( AvmcodeOutputVarCompiler );
+ OPCODE_COMPILER( OUTPUT_ENV ) = NEW_COMPILER( AvmcodeOutputEnvCompiler );
+
+ OPCODE_COMPILER( PRESENT ) = NEW_COMPILER( AvmcodeAbsentPresentCompiler );
+ OPCODE_COMPILER( ABSENT ) = OPCODE_COMPILER( PRESENT );
+
+ OPCODE_COMPILER( IF ) = ITE_STATEMENT_COMPILER;
+ OPCODE_COMPILER( IFE ) = ITE_STATEMENT_COMPILER;
+
+ OPCODE_COMPILER( FOR ) = NEW_COMPILER( AvmcodeForCompiler );
+ OPCODE_COMPILER( FOREACH ) = NEW_COMPILER( AvmcodeForeachCompiler );
+ OPCODE_COMPILER( WHILE_DO ) = NEW_COMPILER( AvmcodeWhileDoCompiler );
+ OPCODE_COMPILER( DO_WHILE ) = NEW_COMPILER( AvmcodeDoWhileCompiler );
+
+ OPCODE_COMPILER( BREAK ) = NEW_COMPILER( AvmcodeBreakCompiler );
+ OPCODE_COMPILER( CONTINUE ) = NEW_COMPILER( AvmcodeContinueCompiler );
+ OPCODE_COMPILER( RETURN ) = NEW_COMPILER( AvmcodeReturnCompiler );
+ OPCODE_COMPILER( EXIT ) = NEW_COMPILER( AvmcodeExitCompiler );
+
+ OPCODE_COMPILER( STEP_MARK ) = DEFAULT_AVMCODE_COMPILER;
+
+
+ return( true );
+}
+
+
+bool AvmcodeCompiler::configureBitwisePrimitive()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM BITWISE EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ OPCODE_COMPILER( BNOT ) = UNARY_BITWISE_EXPRESSION_COMPILER;
+
+ OPCODE_COMPILER( BAND ) = ASSOCIATIVE_BITWISE_EXPRESSION_COMPILER;
+ OPCODE_COMPILER( BOR ) = ASSOCIATIVE_BITWISE_EXPRESSION_COMPILER;
+ OPCODE_COMPILER( BXOR ) = BINARY_BITWISE_EXPRESSION_COMPILER;
+
+ OPCODE_COMPILER( LSHIFT ) = BINARY_BITWISE_EXPRESSION_COMPILER;
+ OPCODE_COMPILER( RSHIFT ) = BINARY_BITWISE_EXPRESSION_COMPILER;
+
+
+ return( true );
+}
+
+
+bool AvmcodeCompiler::configureLogicPrimitive()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM PREDICAT EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ OPCODE_COMPILER( NOT ) = UNARY_PREDICATE_EXPRESSION_COMPILER;
+
+ OPCODE_COMPILER( AND ) = ASSOCIATIVE_PREDICATE_EXPRESSION_COMPILER;
+ OPCODE_COMPILER( NAND ) = ASSOCIATIVE_PREDICATE_EXPRESSION_COMPILER;
+
+ OPCODE_COMPILER( XAND ) = BINARY_PREDICATE_EXPRESSION_COMPILER;
+
+ OPCODE_COMPILER( OR ) = ASSOCIATIVE_PREDICATE_EXPRESSION_COMPILER;
+ OPCODE_COMPILER( NOR ) = ASSOCIATIVE_PREDICATE_EXPRESSION_COMPILER;
+
+ OPCODE_COMPILER( XOR ) = BINARY_PREDICATE_EXPRESSION_COMPILER;
+ OPCODE_COMPILER( XNOR ) = BINARY_PREDICATE_EXPRESSION_COMPILER;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM COMPARISON EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ OPCODE_COMPILER( EQ ) = RELATIONAL_EXPRESSION_COMPILER;
+ OPCODE_COMPILER( NEQ ) = RELATIONAL_EXPRESSION_COMPILER;
+
+ OPCODE_COMPILER( SEQ ) = RELATIONAL_EXPRESSION_COMPILER;
+ OPCODE_COMPILER( NSEQ ) = RELATIONAL_EXPRESSION_COMPILER;
+
+ OPCODE_COMPILER( LT ) = RELATIONAL_EXPRESSION_COMPILER;
+ OPCODE_COMPILER( LTE ) = RELATIONAL_EXPRESSION_COMPILER;
+
+ OPCODE_COMPILER( GT ) = RELATIONAL_EXPRESSION_COMPILER;
+ OPCODE_COMPILER( GTE ) = RELATIONAL_EXPRESSION_COMPILER;
+
+
+ return( true );
+}
+
+
+bool AvmcodeCompiler::configureArithmeticPrimitive()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM ARITHMETIC EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ OPCODE_COMPILER( PLUS ) = ASSOCIATIVE_ARITHMETIC_EXPRESSION_COMPILER;
+ OPCODE_COMPILER( MINUS ) = BINARY_ARITHMETIC_EXPRESSION_COMPILER;
+ OPCODE_COMPILER( UMINUS ) = UNARY_ARITHMETIC_EXPRESSION_COMPILER;
+
+ OPCODE_COMPILER( MULT ) = ASSOCIATIVE_ARITHMETIC_EXPRESSION_COMPILER;
+ OPCODE_COMPILER( POW ) = BINARY_ARITHMETIC_EXPRESSION_COMPILER;
+
+ OPCODE_COMPILER( DIV ) = BINARY_ARITHMETIC_EXPRESSION_COMPILER;
+ OPCODE_COMPILER( MOD ) = BINARY_ARITHMETIC_EXPRESSION_COMPILER;
+
+
+ return( true );
+}
+
+
+bool AvmcodeCompiler::configureLookupPrimitive()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // LOOKUP STATEMENT
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPILER( LOOKUP_INT ) = LOOKUP_EXPRESSION_COMPILER;
+ OPCODE_COMPILER( LOOKUP_INT_EXT ) = LOOKUP_EXPRESSION_COMPILER;
+ OPCODE_COMPILER( LOOKUP_NEAREST ) = LOOKUP_EXPRESSION_COMPILER;
+ OPCODE_COMPILER( LOOKUP_BELOW ) = LOOKUP_EXPRESSION_COMPILER;
+ OPCODE_COMPILER( LOOKUP_ABOVE ) = LOOKUP_EXPRESSION_COMPILER;
+ OPCODE_COMPILER( LOOKUP2D_INT_EXT ) = LOOKUP_EXPRESSION_COMPILER;
+
+ return( true );
+}
+
+
+bool AvmcodeCompiler::configureMathematicPrimitive()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM MATHEMATICAL FUNCTION
+ ////////////////////////////////////////////////////////////////////////////
+
+ // MIN - MAX
+ OPCODE_COMPILER( MIN ) = MATH_FUNCTION_COMPILER;
+ OPCODE_COMPILER( MAX ) = MATH_FUNCTION_COMPILER;
+
+ // RANDOM
+ OPCODE_COMPILER( RANDOM ) = MATH_FUNCTION_COMPILER;
+
+ // ABS
+ OPCODE_COMPILER( ABS ) = MATH_FUNCTION_COMPILER;
+
+ // ROUNDING
+ OPCODE_COMPILER( CEIL ) = MATH_FUNCTION_COMPILER;
+ OPCODE_COMPILER( FLOOR ) = MATH_FUNCTION_COMPILER;
+ OPCODE_COMPILER( ROUND ) = MATH_FUNCTION_COMPILER;
+ OPCODE_COMPILER( TRUNCATE ) = MATH_FUNCTION_COMPILER;
+
+
+ // EXP - LOG
+ OPCODE_COMPILER( SQRT ) = MATH_FUNCTION_COMPILER;
+
+ OPCODE_COMPILER( EXP ) = MATH_FUNCTION_COMPILER;
+ OPCODE_COMPILER( LOG ) = MATH_FUNCTION_COMPILER;
+
+ // TRIGONOMETRIC
+ OPCODE_COMPILER( SIN ) = MATH_FUNCTION_COMPILER;
+ OPCODE_COMPILER( COS ) = MATH_FUNCTION_COMPILER;
+ OPCODE_COMPILER( TAN ) = MATH_FUNCTION_COMPILER;
+
+ OPCODE_COMPILER( SINH ) = MATH_FUNCTION_COMPILER;
+ OPCODE_COMPILER( COSH ) = MATH_FUNCTION_COMPILER;
+ OPCODE_COMPILER( TANH ) = MATH_FUNCTION_COMPILER;
+
+ OPCODE_COMPILER( ASIN ) = MATH_FUNCTION_COMPILER;
+ OPCODE_COMPILER( ACOS ) = MATH_FUNCTION_COMPILER;
+ OPCODE_COMPILER( ATAN ) = MATH_FUNCTION_COMPILER;
+ OPCODE_COMPILER( ATAN2 ) = MATH_FUNCTION_COMPILER;
+
+ OPCODE_COMPILER( ASINH ) = MATH_FUNCTION_COMPILER;
+ OPCODE_COMPILER( ACOSH ) = MATH_FUNCTION_COMPILER;
+ OPCODE_COMPILER( ATANH ) = MATH_FUNCTION_COMPILER;
+
+ return( true );
+}
+
+
+bool AvmcodeCompiler::configureStringCollectionPrimitive()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM STRING / COLLECTION OPERATOR
+ ////////////////////////////////////////////////////////////////////////////
+
+ OPCODE_COMPILER( CONTAINS ) = BINARY_CONTAINER_STATEMENT;
+
+ OPCODE_COMPILER( IN ) = BINARY_CONTAINER_STATEMENT;
+ OPCODE_COMPILER( NOTIN ) = BINARY_CONTAINER_STATEMENT;
+
+ OPCODE_COMPILER( SUBSET ) = BINARY_CONTAINER_STATEMENT;
+ OPCODE_COMPILER( SUBSETEQ ) = BINARY_CONTAINER_STATEMENT;
+
+ OPCODE_COMPILER( INTERSECT ) = BINARY_CONTAINER_STATEMENT;
+
+ OPCODE_COMPILER( STARTS_WITH ) = BINARY_STRING_EXPRESSION_COMPILER;
+ OPCODE_COMPILER( ENDS_WITH ) = BINARY_STRING_EXPRESSION_COMPILER;
+ OPCODE_COMPILER( CONCAT ) = ASSOCIATIVE_STRING_EXPRESSION_COMPILER;
+
+ OPCODE_COMPILER( PUSH ) = NEW_COMPILER( AvmcodePushCompiler );
+ OPCODE_COMPILER( ASSIGN_TOP ) = NEW_COMPILER( AvmcodeAssignTopCompiler );
+ OPCODE_COMPILER( TOP ) = NEW_COMPILER( AvmcodeTopCompiler );
+ OPCODE_COMPILER( POP ) = NEW_COMPILER( AvmcodePopCompiler );
+ OPCODE_COMPILER( POP_FROM ) = NEW_COMPILER( AvmcodePopFromCompiler );
+
+ OPCODE_COMPILER( EMPTY ) = UNARY_CONTAINER_STATEMENT;
+ OPCODE_COMPILER( NONEMPTY ) = UNARY_CONTAINER_STATEMENT;
+ OPCODE_COMPILER( SINGLETON ) = UNARY_CONTAINER_STATEMENT;
+ OPCODE_COMPILER( POPULATED ) = UNARY_CONTAINER_STATEMENT;
+ OPCODE_COMPILER( FULL ) = UNARY_CONTAINER_STATEMENT;
+
+ OPCODE_COMPILER( SIZE ) = UNARY_CONTAINER_STATEMENT;
+
+ OPCODE_COMPILER( APPEND ) = BINARY_WRITE_CONTAINER_STATEMENT;
+
+ OPCODE_COMPILER( REMOVE ) = BINARY_WRITE_CONTAINER_STATEMENT;
+
+ OPCODE_COMPILER( CLEAR ) = UNARY_WRITE_CONTAINER_STATEMENT;
+
+ OPCODE_COMPILER( RESIZE ) = BINARY_WRITE_CONTAINER_STATEMENT;
+
+ return( true );
+}
+
+
+bool AvmcodeCompiler::configureIoltPrimitive()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // IOLTL BEHAVIORAL PREDICAT
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPILER( GLOBALLY ) = DEFAULT_AVMCODE_COMPILER;
+ OPCODE_COMPILER( UNTIL ) = DEFAULT_AVMCODE_COMPILER;
+ OPCODE_COMPILER( NEXT ) = DEFAULT_AVMCODE_COMPILER;
+ OPCODE_COMPILER( EVENTUALLY ) = DEFAULT_AVMCODE_COMPILER;
+ OPCODE_COMPILER( RELEASES ) = DEFAULT_AVMCODE_COMPILER;
+
+ OPCODE_COMPILER( OBS ) = NEW_COMPILER( AvmcodeObsCompiler );
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // IOLTL LOGICAL PREDICAT
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPILER( AND_T ) = DEFAULT_AVMCODE_COMPILER;
+ OPCODE_COMPILER( OR_T ) = DEFAULT_AVMCODE_COMPILER;
+ OPCODE_COMPILER( NOT_T ) = DEFAULT_AVMCODE_COMPILER;
+ OPCODE_COMPILER( IMP_T ) = DEFAULT_AVMCODE_COMPILER;
+
+
+ return( true );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+//// the COMPILER of ARGUMENT
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+const BF & AvmcodeCompiler::postCompileSymbol(const BF & aSymbol)
+{
+ if( aSymbol.is< InstanceOfData >() )
+ {
+ InstanceOfData * anInstance = aSymbol.to_ptr< InstanceOfData >();
+
+ if( anInstance->getModifier().hasFeatureFinal()
+ && anInstance->hasValue() )
+ {
+ if( anInstance->isTypedEnum() )
+ {
+ return( aSymbol );
+ }
+ else if( anInstance->getModifier().hasNatureParameter() )
+ {
+ return( aSymbol );
+ }
+ else
+ {
+ return( anInstance->getValue() );
+ }
+ }
+ else
+ {
+ return( aSymbol );
+ }
+ }
+
+ else if( aSymbol.is< InstanceOfMachine >() )
+ {
+ if( aSymbol.to_ptr< InstanceOfMachine >()->hasRuntimeRID() )
+ {
+ return( aSymbol.to_ptr< InstanceOfMachine >()->getRuntimeRID() );
+ }
+ return( aSymbol );
+ }
+
+ else //if( aSymbol.is< UniFormIdentifier >() || aSymbol.is< AvmCode >() )
+ {
+ return( aSymbol );
+ }
+}
+
+
+
+BF AvmcodeCompiler::compileUFI(
+ COMPILE_CONTEXT * aCTX, const UniFormIdentifier & anUFI)
+{
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "<| compiling<UFI>: "
+ << anUFI.str() << std::endl;
+ aCTX->debugContext( AVM_OS_TRACE << INCR_INDENT ) << DECR_INDENT;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ BF aSymbol = UFI_EXPRESSION_COMPILER->compileUfiExpression(aCTX, anUFI);
+
+ if( aSymbol.valid() )
+ {
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << TAB_DECR_INDENT << ">| result"
+ << ((aSymbol.is< UniFormIdentifier >()) ? "<UFI>: " : ":> ")
+ << str_header( aSymbol ) << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ return( postCompileSymbol(aSymbol) );
+ }
+
+ // ERROR REPORTING
+ else if( getSymbolTable().hasError() )
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << anUFI.errorLocation(aCTX->mCompileCtx->getAstElement())
+ << getSymbolTable().getErrorMessage()
+ << std::endl << std::endl;
+
+ return( BF::REF_NULL );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << anUFI.errorLocation(aCTX->mCompileCtx->getAstElement())
+ << "UFI compilation error : unfound symbol << "
+ << anUFI.str() << " >>" << std::endl << std::endl;
+
+ return( BF::REF_NULL );
+ }
+}
+
+
+BF AvmcodeCompiler::compileFullyQualifiedNameID(
+ COMPILE_CONTEXT * aCTX, const std::string & aFullyQualifiedNameID)
+{
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "<| compiling<fqn>: "
+ << aFullyQualifiedNameID << std::endl;
+ aCTX->debugContext( AVM_OS_TRACE << INCR_INDENT ) << DECR_INDENT;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ BF aSymbol = getSymbolTable().searchSymbol(aCTX, aFullyQualifiedNameID);
+
+ if( aSymbol.invalid() )
+ {
+ UniFormIdentifier anUFI(aFullyQualifiedNameID);
+
+ aSymbol = getSymbolTable().searchSymbolByUFI(aCTX, anUFI);
+ }
+
+ if( aSymbol.valid() )
+ {
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << TAB_DECR_INDENT << ">| result"
+ << ((aSymbol.is< UniFormIdentifier >())? "<fqn>: " : ":> ")
+ << str_header( aSymbol ) << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ return( postCompileSymbol(aSymbol) );
+ }
+
+ // ERROR REPORTING
+ else if( getSymbolTable().hasError() )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << getSymbolTable().getErrorMessage()
+ << std::endl << std::endl;
+
+ return( ExpressionConstructor::
+ newQualifiedIdentifier(aFullyQualifiedNameID) );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "FullyQualifiedNameID compilation error : unfound symbol << "
+ << aFullyQualifiedNameID << " >>"
+ << std::endl << std::endl;
+
+ return( ExpressionConstructor::
+ newQualifiedIdentifier(aFullyQualifiedNameID) );
+ }
+}
+
+
+BF AvmcodeCompiler::compileQualifiedIdentifier(
+ COMPILE_CONTEXT * aCTX, const BF & aQualifiedNameID)
+{
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "<| compiling<QualifiedNameID>: "
+ << aQualifiedNameID.str() << std::endl;
+ aCTX->debugContext( AVM_OS_TRACE << INCR_INDENT ) << DECR_INDENT;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ const BF & aSymbol = getSymbolTable().
+ searchSymbolByQualifiedNameID(aCTX, aQualifiedNameID.str());
+
+ if( aSymbol.valid() )
+ {
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << TAB_DECR_INDENT << ">| result :> "
+ << str_header( aSymbol ) << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ return( postCompileSymbol(aSymbol) );
+ }
+
+ // ERROR REPORTING
+ else if( getSymbolTable().hasError() )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << getSymbolTable().getErrorMessage()
+ << std::endl << std::endl;
+
+ return( aQualifiedNameID );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "[ [ Fully ] Qualified ] Name ID compilation error : "
+ "unfound symbol << " << aQualifiedNameID.str() << " >>"
+ << std::endl << std::endl;
+
+ return( aQualifiedNameID );
+ }
+}
+
+
+BF AvmcodeCompiler::compileQualifiedPositionalIdentifier(
+ COMPILE_CONTEXT * aCTX, const BF & aQualifiedNameID)
+{
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << INCR_INDENT_TAB
+ << "<| compiling<QualifiedPositionalIdentifier>: "
+ << aQualifiedNameID.str() << std::endl
+ << TAB2 << str_header( aCTX ) << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ const BF & aSymbol = getSymbolTable().
+ searchSymbolByQualifiedNameID(aCTX, aQualifiedNameID.str());
+
+ if( aSymbol.valid() )
+ {
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << TAB_DECR_INDENT << ">| result"
+ << ((aSymbol.is< UniFormIdentifier >())? "<qnid>: " : ":> ")
+ << str_header( aSymbol ) << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ if( aSymbol.is< InstanceOfMachine >() )
+ {
+ ExecutableForm * anExec = aSymbol.to_ptr< InstanceOfMachine >()->getExecutable();
+ if( anExec != NULL )
+ {
+ avm_offset_t aPositionOffset = aQualifiedNameID.
+ to_ptr< QualifiedIdentifier >()->getPositionOffset();
+
+ if( aPositionOffset < anExec->getParamCount() )
+ {
+ return( anExec->getParam(aPositionOffset) );
+ }
+ }
+ return( aSymbol );
+ }
+
+ return( postCompileSymbol(aSymbol) );
+ }
+
+ // ERROR REPORTING
+ else if( getSymbolTable().hasError() )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << getSymbolTable().getErrorMessage()
+ << std::endl << std::endl;
+
+ return( aQualifiedNameID );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "[ [ Fully ] Qualified ] Name ID compilation error :"
+ " unfound symbol << " << aQualifiedNameID.str() << " >>"
+ << std::endl << std::endl;
+
+ return( aQualifiedNameID );
+ }
+}
+
+
+BF AvmcodeCompiler::compileIdentifier(
+ COMPILE_CONTEXT * aCTX, const std::string & aNameID)
+{
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "<| compiling<name-id>: "
+ << aNameID << std::endl;
+ aCTX->debugContext( AVM_OS_TRACE << INCR_INDENT ) << DECR_INDENT;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ const BF & aSymbol = getSymbolTable().searchSymbolByNameID(aCTX, aNameID);
+
+ if( aSymbol.valid() )
+ {
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << TAB_DECR_INDENT << ">| result"
+ << ((aSymbol.is< UniFormIdentifier >())? "<name-id>: " : ":> ")
+ << str_header( aSymbol ) << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ return( postCompileSymbol(aSymbol) );
+ }
+
+ else
+ {
+ InstanceOfData * varCtx = aCTX->mVariableCtx;
+ for( ; varCtx != NULL ; varCtx = varCtx->getParent() )
+ {
+ BF aFieldSymbol = getSymbolTable().searchSymbol(aCTX,
+ ( OSS() << varCtx->getFullyQualifiedNameID()
+ << '.' << aNameID ) );
+
+ if( aFieldSymbol.valid() )
+ {
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << TAB_DECR_INDENT << ">| result:> "
+ << str_header( aFieldSymbol ) << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ return( postCompileSymbol(aFieldSymbol) );
+ }
+ }
+
+ Operator * opID = OperatorManager::getOp( aNameID );
+
+ if( opID != NULL )
+ {
+ return( CONST_BF_OP( opID ) );
+ }
+ // ERROR REPORTING
+ else if( getSymbolTable().hasError() )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << getSymbolTable().getErrorMessage()
+ << std::endl << std::endl;
+
+ return( ExpressionConstructor::newIdentifier(aNameID) );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "Identifier compilation error : unfound symbol << "
+ << aNameID << " >>" << std::endl << std::endl;
+
+ return( ExpressionConstructor::newIdentifier(aNameID) );
+ }
+ }
+}
+
+
+const BF & AvmcodeCompiler::compileElement(
+ COMPILE_CONTEXT * aCTX, const BF & anElement)
+{
+ ObjectElement * objElement = anElement.to_ptr< ObjectElement >();
+
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "<| compiling<FORM>: & "
+ << objElement->getFullyQualifiedNameID() << std::endl;
+ aCTX->debugContext( AVM_OS_TRACE << INCR_INDENT ) << DECR_INDENT;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ const BF & aSymbol = getSymbolTable().searchSymbol(aCTX, objElement);
+
+ if( aSymbol.valid() )
+ {
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << ">| result:> " << str_header( aSymbol ) << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ return( postCompileSymbol(aSymbol) );
+ }
+
+ // ERROR REPORTING
+ else if( getSymbolTable().hasError() )
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << objElement->errorLocation(
+ aCTX->mCompileCtx->getAstElement())
+ << getSymbolTable().getErrorMessage()
+ << std::endl << std::endl;
+
+ return( anElement );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "Unfound data instance << & "
+ << objElement->getFullyQualifiedNameID() << " >>"
+ << std::endl << std::endl;
+
+ return( anElement );
+ }
+}
+
+
+const BF & AvmcodeCompiler::compileDataType(
+ COMPILE_CONTEXT * aCTX, const BF & aDataType)
+{
+ DataType * pType = aDataType.to_ptr< DataType >();
+
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "<| compiling<DataType>: "
+ << str_header( pType ) << std::endl;
+ aCTX->debugContext( AVM_OS_TRACE << INCR_INDENT ) << DECR_INDENT;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ const TypeSpecifier & aTypeSpecifier =
+ SymbolTable::searchTypeSpecifier(
+ getConfiguration().getExecutableSystem(), aCTX, pType);
+
+ if( aTypeSpecifier.valid() )
+ {
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << TAB_DECR_INDENT << ">| result:> "
+ << str_header( aTypeSpecifier ) << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ return( aTypeSpecifier );
+ }
+
+ // ERROR REPORTING
+ else if( getSymbolTable().hasError() )
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << pType->errorLocation(aCTX->mCompileCtx->getAstElement())
+ << getSymbolTable().getErrorMessage()
+ << std::endl << std::endl;
+
+ return( aDataType );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "Unfound typedef << & " << str_header( pType )
+ << " >>" << std::endl << std::endl;
+
+ return( aDataType );
+ }
+}
+
+
+const BF & AvmcodeCompiler::compileVariable(
+ COMPILE_CONTEXT * aCTX, const BF & aVariable)
+{
+ Variable * pVariable = aVariable.to_ptr< Variable >();
+
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "<| compiling<Variable>: "
+ << str_header( pVariable ) << std::endl;
+ aCTX->debugContext( AVM_OS_TRACE << INCR_INDENT ) << DECR_INDENT;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ const BF & aSymbol = getSymbolTable().searchDataInstance(aCTX, pVariable);
+
+ if( aSymbol.valid() )
+ {
+ InstanceOfData * anInstance = aSymbol.to_ptr< InstanceOfData >();
+
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << ">| result:> " << str_header( anInstance ) << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ if( anInstance->getModifier().hasFeatureFinal() )
+ {
+ if( (not anInstance->hasValue()) && pVariable->hasValue() )
+ {
+ anInstance->setValue( decode_compileExpression(
+ aCTX->clone(anInstance->getTypeSpecifier()),
+ pVariable->getValue() ) );
+ }
+
+ if( anInstance->hasValue() )
+ {
+ if( anInstance->isEnumSymbolPointer()
+ && anInstance->getModifier().hasFeatureUnsafe() )
+ {
+ return( aSymbol );
+ }
+ else if( anInstance->getModifier().hasNatureParameter() )
+ {
+ return( aSymbol );
+ }
+ else
+ {
+ return( anInstance->getValue() );
+ }
+ }
+ }
+
+ return( aSymbol );
+ }
+
+ // ERROR REPORTING
+ else if( getSymbolTable().hasError() )
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << pVariable->errorLocation(
+ aCTX->mCompileCtx->getAstElement() )
+ << getSymbolTable().getErrorMessage()
+ << std::endl << std::endl;
+
+
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << ">| error:> " << str_header( pVariable ) << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ return( aVariable );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "Unfound variable instance << "
+ << pVariable->getFullyQualifiedNameID() << " >>"
+ << std::endl << std::endl;
+
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << ">| error:> " << str_header( pVariable ) << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ return( aVariable );
+ }
+}
+
+
+const BF & AvmcodeCompiler::compileBuffer(
+ COMPILE_CONTEXT * aCTX, const BF & aBuffer)
+{
+ Buffer * pBuffer = aBuffer.to_ptr< Buffer >();
+
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "<| compiling<Buffer>: "
+ << str_header( pBuffer ) << std::endl;
+ aCTX->debugContext( AVM_OS_TRACE << INCR_INDENT ) << DECR_INDENT;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ const BF & aSymbol = getSymbolTable().searchBufferInstance(
+ aCTX->mCompileCtx->getExecutable(), pBuffer);
+
+ if( aSymbol.valid() )
+ {
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << TAB_DECR_INDENT << ">| result:> "
+ << str_header( aSymbol.to_ptr< InstanceOfBuffer >() ) << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ return( aSymbol );
+ }
+
+ // ERROR REPORTING
+ else if( getSymbolTable().hasError() )
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << pBuffer->errorLocation(aCTX->mCompileCtx->getAstElement())
+ << getSymbolTable().getErrorMessage()
+ << std::endl << std::endl;
+
+ return( aBuffer );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "Unfound buffer instance << & " << str_header( pBuffer )
+ << " >>" << std::endl << std::endl;
+
+ return( aBuffer );
+ }
+}
+
+
+const BF & AvmcodeCompiler::compilePort(
+ COMPILE_CONTEXT * aCTX, const BF & aPort)
+{
+ Port * pPort = aPort.to_ptr< Port >();
+
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "<| compiling<Port>: "
+ << str_header( pPort ) << std::endl;
+ aCTX->debugContext( AVM_OS_TRACE << INCR_INDENT ) << DECR_INDENT;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ const BF & aSymbol = getSymbolTable().
+ searchPortSymbolInstance(aCTX->mCompileCtx->getExecutable(), pPort);
+
+ if( aSymbol.valid() )
+ {
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << TAB_DECR_INDENT << ">| result:> "
+ << str_header( aSymbol.to_ptr< InstanceOfPort >() ) << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ return( aSymbol );
+ }
+
+ // ERROR REPORTING
+ else if( getSymbolTable().hasError() )
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << pPort->errorLocation(aCTX->mCompileCtx->getAstElement())
+ << getSymbolTable().getErrorMessage()
+ << std::endl << std::endl;
+
+ return( aPort );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "Unfound port instance << " << str_header( pPort ) << " >>"
+ << std::endl << std::endl;
+
+ return( aPort );
+ }
+}
+
+
+const BF & AvmcodeCompiler::compileConnector(
+ COMPILE_CONTEXT * aCTX, const BF & aConnector)
+{
+ return( aConnector );
+}
+
+
+const BF & AvmcodeCompiler::compileMachine(
+ COMPILE_CONTEXT * aCTX, const BF & aMachine)
+{
+ Machine * pMachine = aMachine.to_ptr< Machine >();
+
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "<| compiling<Machine>: "
+ << str_header( pMachine ) << std::endl;
+ aCTX->debugContext( AVM_OS_TRACE << INCR_INDENT ) << DECR_INDENT;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ const BF & aSymbol =
+ getSymbolTable().searchInstanceStatic(aCTX, pMachine);
+
+ if( aSymbol.valid() )
+ {
+ InstanceOfMachine * aMachineSymbol =
+ aSymbol.to_ptr< InstanceOfMachine >();
+
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << TAB_DECR_INDENT << ">| result:> "
+ << str_header( aMachineSymbol ) << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ if( aMachineSymbol->hasRuntimeRID() )
+ {
+ AVM_OS_TRACE << TAB_DECR_INDENT << ">| result:> "
+ << aMachineSymbol->getRuntimeRID().str() << std::endl;
+
+ return( aMachineSymbol->getRuntimeRID() );
+ }
+
+ return( aSymbol );
+ }
+
+ const BF & aSymbolModel =
+ getSymbolTable().searchInstanceModel(aCTX, pMachine);
+
+ if( aSymbolModel.valid() )
+ {
+ return( aSymbolModel );
+ }
+
+ if( pMachine->getSpecifier().isDesignInstanceDynamic() )
+ {
+ const BF & aSymbol =
+ getSymbolTable().searchInstanceDynamic(aCTX, pMachine);
+
+ if( aSymbol.valid() )
+ {
+ return( aSymbol );
+ }
+ }
+
+ // ERROR REPORTING
+ if( getSymbolTable().hasError() )
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << pMachine->errorLocation(
+ aCTX->mCompileCtx->getAstElement() )
+ << getSymbolTable().getErrorMessage()
+ << std::endl << std::endl;
+
+ return( aMachine );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "Unfound machine << " << str_header( pMachine )
+ << " >>" << std::endl << std::endl;
+
+ return( aMachine );
+ }
+}
+
+
+const BF & AvmcodeCompiler::compileRoutine(
+ COMPILE_CONTEXT * aCTX, const BF & aRoutine)
+{
+ Routine * pRoutine = aRoutine.to_ptr< Routine >();
+
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "<| compiling<Routine>: "
+ << str_header( pRoutine ) << std::endl;
+ aCTX->debugContext( AVM_OS_TRACE << INCR_INDENT ) << DECR_INDENT;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ const BF & aSymbol =
+ getSymbolTable().searchProgram(aCTX, pRoutine->getNameID());
+
+ if( aSymbol.valid() )
+ {
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << ">| result:> " << str_header( aSymbol ) << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ return( aSymbol );
+ }
+
+ // ERROR REPORTING
+ else if( getSymbolTable().hasError() )
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << pRoutine->errorLocation(
+ aCTX->mCompileCtx->getAstElement() )
+ << getSymbolTable().getErrorMessage()
+ << std::endl << std::endl;
+
+ return( aRoutine );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "Unfound routine << & " << str_header( pRoutine )
+ << " >>" << std::endl << std::endl;
+
+ return( aRoutine );
+ }
+}
+
+
+const BF & AvmcodeCompiler::compileTransition(
+ COMPILE_CONTEXT * aCTX, const BF & aTransition)
+{
+ Transition * pTransition = aTransition.to_ptr< Transition >();
+
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "<| compiling<Transition>: "
+ << str_header( pTransition ) << std::endl;
+ aCTX->debugContext( AVM_OS_TRACE << INCR_INDENT ) << DECR_INDENT;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ const BF & aSymbol = getSymbolTable().searchTransition(aCTX, pTransition);
+
+ if( aSymbol.valid() )
+ {
+AVM_IF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << ">| result:> " << str_header( aSymbol ) << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , QUALIFIED_NAME_ID )
+
+ return( aSymbol );
+ }
+
+ // ERROR REPORTING
+ else if( getSymbolTable().hasError() )
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << pTransition->errorLocation(
+ aCTX->mCompileCtx->getAstElement() )
+ << getSymbolTable().getErrorMessage()
+ << std::endl << std::endl;
+
+ return( aTransition );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "Unfound transition << & " << str_header( pTransition )
+ << " >>" << std::endl << std::endl;
+
+ return( aTransition );
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+//// the COMPILER of EXPRESSION
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "in<expr>: "
+ << STRIML( aCode->toString(AVM_OS_TRACE.INDENT) )
+ << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+
+
+ BF expr = AVMCODE_COMPILER_TABLE[ aCode->getOpOffset() ]->
+ compileExpression(aCTX, aCode);
+
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+ AVM_OS_TRACE << TAB_DECR_INDENT << "out:> "
+ << STRIML( expr.toString(AVM_OS_TRACE.INDENT) )
+ << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+
+ return( expr );
+}
+
+
+BF AvmcodeCompiler::decode_compileExpression(
+ COMPILE_CONTEXT * aCTX, const BF & aCode)
+{
+ switch( aCode.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ return( compileExpression(aCTX, aCode.bfCode()) );
+ }
+
+ case FORM_UFI_KIND:
+ {
+ return( compileUFI(aCTX, aCode.to_ref< UniFormIdentifier>()) );
+ }
+
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+ {
+ if( aCode.str().find(':') != std::string::npos )
+ {
+ return( compileFullyQualifiedNameID(aCTX, aCode) );
+ }
+ else
+ {
+ return( compileQualifiedIdentifier(aCTX, aCode) );
+ }
+ }
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ {
+ return( compileIdentifier(aCTX, aCode) );
+ }
+
+ case FORM_XFSP_VARIABLE_KIND:
+ {
+ return( compileVariable(aCTX, aCode) );
+ }
+
+ case FORM_XFSP_DATATYPE_KIND:
+ {
+ return( compileDataType(aCTX, aCode) );
+ }
+
+ case FORM_XFSP_MACHINE_KIND:
+ case FORM_XFSP_SYSTEM_KIND:
+ {
+ return( compileMachine(aCTX, aCode) );
+ }
+
+// case FORM_XFSP_INSTANCE_KIND:
+// {
+// return( compileInstance(aCTX, aCode) );
+// }
+
+ case FORM_XFSP_BUFFER_KIND:
+ {
+ return( compileBuffer(aCTX, aCode) );
+ }
+
+ case FORM_XFSP_PORT_KIND:
+ {
+ return( compilePort(aCTX, aCode) );
+ }
+
+ case FORM_XFSP_TRANSITION_KIND:
+ {
+ return( compileTransition(aCTX, aCode) );
+ }
+
+ case FORM_XFSP_ROUTINE_KIND:
+ {
+ return( compileRoutine(aCTX, aCode) );
+ }
+
+
+ case FORM_XFSP_PACKAGE_KIND:
+ case FORM_XFSP_CHANNEL_KIND:
+ case FORM_XFSP_COM_POINT_KIND:
+ case FORM_XFSP_COM_ROUTE_KIND:
+ case FORM_XFSP_CONNECTOR_KIND:
+
+ case FORM_OPERATOR_KIND:
+
+ case FORM_EXECUTABLE_MACHINE_KIND:
+
+ case FORM_INSTANCE_BUFFER_KIND:
+ case FORM_INSTANCE_CONNECTOR_KIND:
+ case FORM_INSTANCE_DATA_KIND:
+ case FORM_INSTANCE_MACHINE_KIND:
+ case FORM_INSTANCE_PORT_KIND:
+
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ case FORM_BUILTIN_CHARACTER_KIND:
+ case FORM_BUILTIN_INTEGER_KIND:
+ case FORM_BUILTIN_RATIONAL_KIND:
+ case FORM_BUILTIN_FLOAT_KIND:
+ case FORM_BUILTIN_STRING_KIND:
+ {
+ return( aCode );
+ }
+
+ case FORM_ARRAY_BOOLEAN_KIND:
+ case FORM_ARRAY_CHARACTER_KIND:
+ case FORM_ARRAY_INTEGER_KIND:
+ case FORM_ARRAY_RATIONAL_KIND:
+ case FORM_ARRAY_FLOAT_KIND:
+ case FORM_ARRAY_STRING_KIND:
+ {
+ BuiltinArray * aBuiltinArray = aCode.to_ptr< BuiltinArray >();
+
+ // Build the type specified container
+ if( (aCTX->mType != NULL)
+ && aCTX->mType->hasTypeCollection()
+ && aCTX->mType->is< ContainerTypeSpecifier >() )
+ {
+ BuiltinContainer * containerValue = BuiltinContainer::create(
+ aCTX->mType->as< ContainerTypeSpecifier >() );
+
+ containerValue->copy( aBuiltinArray, std::min(
+ containerValue->capacity(), aBuiltinArray->size()) );
+
+ return( BF( containerValue ) );
+ }
+ else
+ {
+ return( BF( aBuiltinArray->getArrayBF() ) );
+ }
+ }
+
+ case FORM_ARRAY_IDENTIFIER_KIND:
+ {
+ return( compileArrayOfIdentifier(aCTX,
+ aCode.to_ptr< ArrayIdentifier >()) );
+ }
+
+ case FORM_ARRAY_QUALIFIED_IDENTIFIER_KIND:
+ {
+ return( compileArrayOfQualifiedIdentifier(aCTX,
+ aCode.to_ptr< ArrayQualifiedIdentifier >()) );
+ }
+
+ case FORM_ARRAY_BF_KIND:
+ {
+ return( compileArrayOfBF(aCTX, aCode.to_ptr< ArrayBF >()) );
+ }
+
+ case FORM_CONTAINER_VECTOR_KIND:
+ case FORM_CONTAINER_REVERSE_VECTOR_KIND:
+ case FORM_CONTAINER_LIST_KIND:
+ case FORM_CONTAINER_SET_KIND:
+ case FORM_CONTAINER_BAG_KIND:
+ case FORM_CONTAINER_FIFO_KIND:
+ case FORM_CONTAINER_LIFO_KIND:
+ {
+ return( aCode );
+ }
+
+ default:
+ { // TODO
+ AVM_OS_WARNING_ALERT
+ << "AvmcodeCompiler is trying to decode_compileExpression"
+ "\n\ttypeinfo: " << aCode.raw_pointer()->classKindInfo()
+ << "\n\t<< " << aCode.str() << " >> !!!"
+ << SEND_ALERT;
+
+ return( BF::REF_NULL );
+ }
+ }
+
+ return( aCode );
+}
+
+
+
+BF AvmcodeCompiler::compileArrayOfIdentifier(
+ COMPILE_CONTEXT * aCTX, ArrayIdentifier * idArray)
+{
+ BaseTypeSpecifier * arrayType = ( (aCTX->mType != NULL) &&
+ aCTX->mType->hasTypeComposite()) ? aCTX->mType :
+ idArray->getTypeSpecifier();
+
+ ArrayBF * compiledArray = new ArrayBF(arrayType, idArray->size());
+
+ bool isnotCompiled = false;
+
+ if( aCTX->mType != NULL )
+ {
+ COMPILE_CONTEXT * contentCTX = NULL;
+
+ if( aCTX->mType->hasTypeCollection() &&
+ aCTX->mType->is< ContainerTypeSpecifier >() )
+ {
+ contentCTX = aCTX->clone( aCTX->mType->
+ to< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier() );
+
+ for( avm_size_t index = 0; index < idArray->size() ; ++index )
+ {
+ compiledArray->set( index,
+ compileIdentifier(contentCTX, idArray->get(index)) );
+ }
+ }
+ else if( aCTX->mType->isTypedStructure() )
+ {
+ ClassTypeSpecifier * typeStruct =
+ aCTX->mType->to< ClassTypeSpecifier >();
+ TableOfSymbol::const_iterator itField =
+ typeStruct->getSymbolData().begin();
+ TableOfSymbol::const_iterator endField =
+ typeStruct->getSymbolData().end();
+
+ for( avm_size_t index = 0; (index < idArray->size()) &&
+ (itField != endField) ; ++index )
+ {
+ contentCTX = aCTX->clone(
+ (*itField).getTypeSpecifier() );
+
+ compiledArray->set( index,
+ compileIdentifier(contentCTX, idArray->get(index)) );
+ }
+ }
+ else
+ {
+ isnotCompiled = true;
+ }
+ }
+
+ if( isnotCompiled )
+ {
+ for( avm_size_t index = 0; index < idArray->size() ; ++index )
+ {
+ compiledArray->set( index,
+ compileIdentifier(aCTX, idArray->get(index)) );
+ }
+ }
+
+ // Build the type specified container
+ if( (aCTX->mType != NULL) && aCTX->mType->hasTypeCollection() &&
+ aCTX->mType->is< ContainerTypeSpecifier >() )
+ {
+ BuiltinContainer * containerValue = BuiltinContainer::create(
+ aCTX->mType->as< ContainerTypeSpecifier >() );
+
+ containerValue->copy( compiledArray, std::min(
+ containerValue->capacity(), compiledArray->size()) );
+
+ return( BF( containerValue ) );
+ }
+ else
+ {
+ return( BF( compiledArray ) );
+ }
+}
+
+
+BF AvmcodeCompiler::compileArrayOfQualifiedIdentifier(
+ COMPILE_CONTEXT * aCTX, ArrayQualifiedIdentifier * ufidArray)
+{
+ BaseTypeSpecifier * arrayType = ( (aCTX->mType != NULL) &&
+ aCTX->mType->hasTypeComposite()) ? aCTX->mType :
+ ufidArray->getTypeSpecifier();
+
+ ArrayBF * compiledArray = new ArrayBF(arrayType, ufidArray->size());
+
+ bool isnotCompiled = false;
+
+ if( aCTX->mType != NULL )
+ {
+ COMPILE_CONTEXT * contentCTX = NULL;
+
+ if( aCTX->mType->hasTypeCollection() &&
+ aCTX->mType->is< ContainerTypeSpecifier >() )
+ {
+ contentCTX = aCTX->clone( aCTX->mType->
+ to< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier() );
+
+ for( avm_size_t index = 0; index < ufidArray->size() ; ++index )
+ {
+ compiledArray->set( index,
+ compileFullyQualifiedNameID(
+ contentCTX, ufidArray->get(index)) );
+ }
+ }
+ else if( aCTX->mType->isTypedStructure() )
+ {
+ ClassTypeSpecifier * typeStruct =
+ aCTX->mType->to< ClassTypeSpecifier >();
+ TableOfSymbol::const_iterator itField =
+ typeStruct->getSymbolData().begin();
+ TableOfSymbol::const_iterator endField =
+ typeStruct->getSymbolData().end();
+
+ for( avm_size_t index = 0; (index < ufidArray->size()) &&
+ (itField != endField) ; ++index )
+ {
+ contentCTX = aCTX->clone(
+ (*itField).getTypeSpecifier() );
+
+ compiledArray->set( index,
+ compileFullyQualifiedNameID(
+ contentCTX, ufidArray->get(index)) );
+ }
+ }
+ else
+ {
+ isnotCompiled = true;
+ }
+ }
+
+ if( isnotCompiled )
+ {
+ for( avm_size_t index = 0; index < ufidArray->size() ; ++index )
+ {
+ compiledArray->set( index,
+ compileFullyQualifiedNameID(aCTX, ufidArray->get(index)) );
+ }
+ }
+
+ // Build the type specified container
+ if( (aCTX->mType != NULL) && aCTX->mType->hasTypeCollection() &&
+ aCTX->mType->is< ContainerTypeSpecifier >() )
+ {
+ BuiltinContainer * containerValue = BuiltinContainer::create(
+ aCTX->mType->as< ContainerTypeSpecifier >() );
+
+ containerValue->copy( compiledArray, std::min(
+ containerValue->capacity(), compiledArray->size()) );
+
+ return( BF( containerValue ) );
+ }
+ else
+ {
+ return( BF( compiledArray ) );
+ }
+}
+
+
+BF AvmcodeCompiler::compileArrayOfBF(
+ COMPILE_CONTEXT * aCTX, ArrayBF * bfarray)
+{
+ BaseTypeSpecifier * arrayType = ( (aCTX->mType != NULL) &&
+ aCTX->mType->hasTypeComposite() ) ?
+ aCTX->mType : bfarray->getTypeSpecifier();
+
+ ArrayBF * compiledArray = new ArrayBF(arrayType, bfarray->size());
+
+ BF bfCompiledArray( compiledArray );
+
+ bool isnotCompiled = false;
+
+ if( aCTX->mType != NULL )
+ {
+ COMPILE_CONTEXT * contentCTX = NULL;
+
+ if( aCTX->mType->hasTypeCollection() &&
+ aCTX->mType->is< ContainerTypeSpecifier >() )
+ {
+ contentCTX = aCTX->clone( aCTX->mType->
+ to< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier() );
+
+ for( avm_size_t index = 0; index < bfarray->size() ; ++index )
+ {
+ compiledArray->set( index , decode_compileExpression(
+ contentCTX, bfarray->at(index) ) );
+ }
+ }
+ else if( aCTX->mType->isTypedStructure() )
+ {
+ ClassTypeSpecifier * typeStruct =
+ aCTX->mType->to< ClassTypeSpecifier >();
+ TableOfSymbol::const_iterator itField =
+ typeStruct->getSymbolData().begin();
+ TableOfSymbol::const_iterator endField =
+ typeStruct->getSymbolData().end();
+
+ for( avm_size_t index = 0; (index < bfarray->size()) &&
+ (itField != endField) ; ++index )
+ {
+ contentCTX = aCTX->clone(
+ (*itField).getTypeSpecifier() );
+
+ compiledArray->set( index , decode_compileExpression(
+ contentCTX, bfarray->at(index) ) );
+ }
+ }
+ else
+ {
+ isnotCompiled = true;
+ }
+ }
+
+ if( isnotCompiled )
+ {
+ for( avm_size_t index = 0; index < bfarray->size() ; ++index )
+ {
+ compiledArray->set( index ,
+ decode_compileExpression(
+ aCTX, bfarray->at(index) ) );
+ }
+ }
+
+ // Build the type specified container
+ if( (aCTX->mType != NULL) && aCTX->mType->hasTypeCollection() &&
+ aCTX->mType->is< ContainerTypeSpecifier >() )
+ {
+ if( AbstractAvmcodeCompiler::
+ mustBeEvaluatedArgumentArray( compiledArray ) )
+ {
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_CTOR,
+ INCR_BF(aCTX->mType), bfCompiledArray) );
+ }
+ else
+ {
+ BuiltinContainer * containerValue = BuiltinContainer::create(
+ aCTX->mType->as< ContainerTypeSpecifier >() );
+
+ containerValue->copy( compiledArray, std::min(
+ containerValue->capacity(), compiledArray->size()) );
+
+ return( BF( containerValue ) );
+ }
+ }
+ else
+ {
+ return( bfCompiledArray );
+ }
+}
+
+
+
+
+BF AvmcodeCompiler::decode_compileVariableMachine(
+ COMPILE_CONTEXT * aCTX, const BF & aCode)
+{
+ BF varCode = decode_compileExpression(aCTX, aCode);
+ if( varCode.is< InstanceOfMachine >() )
+ {
+ if( varCode.to_ptr< InstanceOfMachine >()->hasRuntimeRID() )
+ {
+ return( varCode.to_ptr< InstanceOfMachine >()->getRuntimeRID() );
+ }
+ return( varCode );
+ }
+ else if( varCode.is< InstanceOfData >() )
+ {
+ if( varCode.to_ptr< InstanceOfData >()->isTypedMachine() )
+ {
+ return( varCode );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+BF AvmcodeCompiler::decode_compileVariablePort(
+ COMPILE_CONTEXT * aCTX, const BF & aCode)
+{
+ BF varCode = decode_compileExpression(aCTX, aCode);
+ if( varCode.is< InstanceOfPort >() )
+ {
+ return( varCode );
+ }
+ else if( varCode.is< InstanceOfData >() )
+ {
+ if( varCode.to_ptr< InstanceOfData >()->isTypedPort() )
+ {
+ return( varCode );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+BF AvmcodeCompiler::decode_compileVariableBuffer(
+ COMPILE_CONTEXT * aCTX, const BF & aCode)
+{
+ BF varCode = decode_compileExpression(aCTX, aCode);
+ if( varCode.is< InstanceOfBuffer >() )
+ {
+ return( varCode );
+ }
+ else if( varCode.is< InstanceOfData >() )
+ {
+ if( varCode.to_ptr< InstanceOfData >()->isTypedBuffer() )
+ {
+ return( varCode );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+//// the OPTIMIZER of EXPRESSION
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->hasInstruction() )
+ {
+ return( aCode );
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "in<expr>: "
+ << STRIML( aCode->toString(AVM_OS_TRACE.INDENT) )
+ << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+
+
+ BF expr = AVMCODE_COMPILER_TABLE[ aCode->getOpOffset() ]->
+ optimizeExpression(aCTX, aCode);
+
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+ AVM_OS_TRACE << TAB_DECR_INDENT << "out:> "
+ << STRIML( expr.toString(AVM_OS_TRACE.INDENT) )
+ << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+
+ return( expr );
+}
+
+
+BF AvmcodeCompiler::decode_optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BF & aCode)
+{
+ switch( aCode.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ return( optimizeExpression(aCTX, aCode.bfCode()) );
+ }
+
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ InstanceOfData * anInstance = aCode.to_ptr< InstanceOfData >();
+ if( anInstance->getModifier().hasModifierPublicFinalStatic()
+ && anInstance->isTypedEnum() && anInstance->hasValue() )
+ {
+ return( anInstance->getValue() );
+ }
+ else
+ {
+ BF optExpr = aCode;
+
+ return( optExpr );
+ }
+ }
+
+ default:
+ {
+ BF optExpr = aCode;
+
+ return( optExpr );
+ }
+ }
+}
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+//// the COMPILER of STATEMENT
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , COMPILING )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "in<stmnt>: "
+ << STRIML( aCode->toString(AVM_OS_TRACE.INDENT) )
+ << std::flush;
+
+// AVM_OS_TRACE << "aCode->getOperator() :> " << aCode->getOperator()->strOp()
+// << std::endl
+// << "aCode->getOpOffset() :> " << aCode->getOpOffset()
+// << std::endl
+// << "AVMCODE_COMPILER_TABLE :> @" << &AVMCODE_COMPILER_TABLE
+// << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , COMPILING )
+
+
+ BFCode stmnt = AVMCODE_COMPILER_TABLE[ aCode->getOpOffset() ]->
+ compileStatement(aCTX, aCode);
+
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , COMPILING )
+ AVM_OS_TRACE << TAB_DECR_INDENT << "out:> "
+ << STRIML( stmnt->toString(AVM_OS_TRACE.INDENT) )
+ << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , COMPILING )
+
+ return( stmnt );
+}
+
+
+BF AvmcodeCompiler::decode_compileStatement(
+ COMPILE_CONTEXT * aCTX, const BF & aCode)
+{
+ switch( aCode.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ return( compileStatement(aCTX, aCode.bfCode()) );
+ }
+
+ case FORM_UFI_KIND:
+ {
+ return( compileUFI(aCTX, aCode.to_ref< UniFormIdentifier>()) );
+ }
+
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+ {
+ if( aCode.str().find(':') != std::string::npos )
+ {
+ return( compileFullyQualifiedNameID(aCTX, aCode) );
+ }
+ else
+ {
+ return( compileQualifiedIdentifier(aCTX, aCode) );
+ }
+ }
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ {
+ return( compileQualifiedIdentifier(aCTX, aCode) );
+ }
+
+ case FORM_XFSP_DATATYPE_KIND:
+ {
+ return( compileDataType(aCTX, aCode) );
+ }
+
+ case FORM_XFSP_VARIABLE_KIND:
+ {
+ return( compileVariable(aCTX, aCode) );
+ }
+
+ case FORM_XFSP_MACHINE_KIND:
+ case FORM_XFSP_SYSTEM_KIND:
+ {
+ return( compileMachine(aCTX, aCode) );
+ }
+
+// case FORM_XFSP_INSTANCE_KIND:
+// {
+// return( compileInstance(aCTX, aCode) );
+// }
+
+ case FORM_XFSP_BUFFER_KIND:
+ {
+ return( compileBuffer(aCTX, aCode) );
+ }
+
+ case FORM_XFSP_PORT_KIND:
+ {
+ return( compilePort(aCTX, aCode) );
+ }
+
+ case FORM_XFSP_TRANSITION_KIND:
+ {
+ return( compileTransition(aCTX, aCode) );
+ }
+
+ case FORM_XFSP_ROUTINE_KIND:
+ {
+ return( compileRoutine(aCTX, aCode) );
+ }
+
+
+ case FORM_XFSP_PACKAGE_KIND:
+ case FORM_XFSP_CHANNEL_KIND:
+ case FORM_XFSP_COM_POINT_KIND:
+ case FORM_XFSP_COM_ROUTE_KIND:
+ case FORM_XFSP_CONNECTOR_KIND:
+
+ case FORM_OPERATOR_KIND:
+
+ case FORM_EXECUTABLE_MACHINE_KIND:
+
+ case FORM_INSTANCE_BUFFER_KIND:
+ case FORM_INSTANCE_CONNECTOR_KIND:
+ case FORM_INSTANCE_DATA_KIND:
+ case FORM_INSTANCE_MACHINE_KIND:
+ case FORM_INSTANCE_PORT_KIND:
+
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ case FORM_BUILTIN_CHARACTER_KIND:
+ case FORM_BUILTIN_INTEGER_KIND:
+ case FORM_BUILTIN_RATIONAL_KIND:
+ case FORM_BUILTIN_FLOAT_KIND:
+ case FORM_BUILTIN_STRING_KIND:
+ {
+ return( aCode );
+ }
+
+ case FORM_ARRAY_BOOLEAN_KIND:
+ case FORM_ARRAY_CHARACTER_KIND:
+ case FORM_ARRAY_INTEGER_KIND:
+ case FORM_ARRAY_RATIONAL_KIND:
+ case FORM_ARRAY_FLOAT_KIND:
+ case FORM_ARRAY_STRING_KIND:
+ {
+ return( aCode );
+ }
+
+ case FORM_ARRAY_IDENTIFIER_KIND:
+ {
+ ArrayIdentifier * idArray = aCode.to_ptr< ArrayIdentifier >();
+ BFVector array;
+
+ for( avm_size_t index = 0; index < idArray->size() ; ++index )
+ {
+ array.append( compileIdentifier(aCTX, idArray->get(index)) );
+ }
+
+ return( BuiltinArray::create(array) );
+ }
+
+ case FORM_ARRAY_QUALIFIED_IDENTIFIER_KIND:
+ {
+ ArrayQualifiedIdentifier * ufiArray =
+ aCode.to_ptr< ArrayQualifiedIdentifier >();
+ BFVector array;
+
+ for( avm_size_t index = 0; index < ufiArray->size() ; ++index )
+ {
+ array.append( compileFullyQualifiedNameID(
+ aCTX, ufiArray->get(index)) );
+ }
+
+ return( BuiltinArray::create(array) );
+ }
+
+ case FORM_ARRAY_BF_KIND:
+ {
+ ArrayBF * bfarray = aCode.to_ptr< ArrayBF >();
+ BFVector array;
+
+ for( avm_size_t index = 0; index < bfarray->size() ; ++index )
+ {
+ array.append( decode_compileExpression(
+ aCTX, bfarray->at(index) ) );
+ }
+
+ return( BuiltinArray::create(array) );
+ }
+
+ default:
+ { // TODO
+ AVM_OS_WARNING_ALERT
+ << "AvmcodeCompiler is trying to decode_compileStatement"
+ "\n\t<< " << aCode.str() << " >> !!!"
+ << SEND_ALERT;
+
+ return( BF::REF_NULL );
+ }
+ }
+
+ return( aCode );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+//// the OPTIMIZER of << RUNTIME >> EXPRESSION
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmcodeCompiler::optimizeEvalExpression(
+ COMPILE_CONTEXT * aCTX, BFCode & aCode)
+{
+ if( aCode->hasInstruction() )
+ {
+ return( true );
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "in<expr>: "
+ << STRIML( aCode->toString(AVM_OS_TRACE.INDENT) )
+ << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+
+ BF expr = AVMCODE_COMPILER_TABLE[ aCode->getOpOffset() ]->
+ optimizeExpression(aCTX, aCode);
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+ AVM_OS_TRACE << TAB_DECR_INDENT << "out:> "
+ << STRIML( expr.toString(AVM_OS_TRACE.INDENT) )
+ << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+
+ if( expr.is< AvmCode >() )
+ {
+ aCode = expr.bfCode();
+
+ return( true );
+
+ }
+
+ return( false );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+//// the OPTIMIZER of STATEMENT
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->hasInstruction() )
+ {
+ return( aCode );
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , COMPILING )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "in<stmnt>: "
+ << STRIML( aCode->toString(AVM_OS_TRACE.INDENT) )
+ << std::flush;
+
+// AVM_OS_TRACE << "aCode->getOperator() :> " << aCode->getOperator()->strOp()
+// << std::endl
+// << "aCode->getOpOffset() :> " << aCode->getOpOffset()
+// << std::endl
+// << "AVMCODE_COMPILER_TABLE :> @" << &AVMCODE_COMPILER_TABLE
+// << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , COMPILING )
+
+
+ BFCode stmnt = AVMCODE_COMPILER_TABLE[ aCode->getOpOffset() ]->
+ optimizeStatement(aCTX, aCode);
+
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , COMPILING )
+ AVM_OS_TRACE << TAB_DECR_INDENT << "out:> "
+ << STRIML( stmnt->toString(AVM_OS_TRACE.INDENT) )
+ << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , COMPILING )
+
+ return( stmnt );
+}
+
+
+BF AvmcodeCompiler::decode_optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BF & aCode)
+{
+ switch( aCode.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ return( optimizeStatement(aCTX, aCode.bfCode()) );
+ }
+
+ case FORM_AVMPROGRAM_KIND:
+ case FORM_AVMTRANSITION_KIND:
+ {
+ optimizeProgramRoutine( aCode.to_ptr< AvmProgram >() );
+
+ return( aCode );
+ }
+
+ default:
+ {
+ BF optCode = aCode;
+
+ return( optCode );
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+//// the COMPILER of ROUTINE
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+AvmProgram * AvmcodeCompiler::compileRoutineStructure(
+ BaseCompiler * aCompiler, AvmProgram * aProgramCtx, Routine * aRoutine)
+{
+ avm_size_t paramCount = aRoutine->getParameters().size();
+ avm_size_t returnCount = aRoutine->getReturns().size();
+ avm_size_t paramReturnCount = paramCount + returnCount;
+
+ AvmProgram * aCompiledRoutine = new AvmProgram(
+ Specifier::SCOPE_ROUTINE_KIND,
+ aProgramCtx, aRoutine, paramReturnCount );
+
+ aCompiledRoutine->setParamOffsetCount(0, paramCount);
+ aCompiledRoutine->setReturnOffsetCount(paramCount, returnCount);
+
+
+ InstanceOfData * anInstance = NULL;
+ TypeSpecifier bfTS;
+
+ avm_size_t offset = 0;
+
+ // Parameters
+ BFVector::raw_iterator< Variable > itVar = aRoutine->getParameters().begin();
+ for( ; offset < paramCount ; ++itVar , ++offset )
+ {
+ bfTS = aCompiler->compileTypeSpecifier(aProgramCtx, itVar->getType());
+ if( bfTS.invalid() )
+ {
+ bfTS = TypeManager::UNIVERSAL;
+
+// incrErrorCount();
+ ++AVM_ERROR_COUNT;
+
+ AVM_OS_ERROR_ALERT << "AvmcodeCompiler::compileRoutine : << "
+ << itVar->strTypeSpecifier() << " >> !!!"
+ << SEND_ALERT;
+ }
+
+ anInstance = new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ aCompiledRoutine, itVar, bfTS, offset);
+
+ aCompiledRoutine->setData(offset, anInstance);
+
+ if( itVar->hasValue() )
+ {
+ anInstance->setValue(
+ decode_compileExpression(
+ aProgramCtx, itVar->getValue()) );
+ }
+ }
+
+ // Returns
+ itVar = aRoutine->getReturns().begin();
+ for( ; offset < paramReturnCount ; ++itVar , ++offset )
+ {
+ bfTS = aCompiler->compileTypeSpecifier(aProgramCtx, itVar->getType());
+ if( bfTS.invalid() )
+ {
+ bfTS = TypeManager::UNIVERSAL;
+
+ // incrErrorCount();
+ ++AVM_ERROR_COUNT;
+
+ AVM_OS_ERROR_ALERT << "AvmcodeCompiler::compileRoutine : << "
+ << itVar->strTypeSpecifier() << " >> !!!"
+ << SEND_ALERT;
+ }
+
+ anInstance = new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ aCompiledRoutine, itVar, bfTS, offset);
+
+ aCompiledRoutine->setData(offset, anInstance);
+
+ if( itVar->hasValue() )
+ {
+ anInstance->setValue(
+ decode_compileExpression(aProgramCtx, itVar->getValue()) );
+ }
+ }
+
+ // Finalize compiled data
+ aCompiledRoutine->updateDataTable();
+
+ return( aCompiledRoutine );
+}
+
+
+AvmProgram * AvmcodeCompiler::compileRoutine(BaseCompiler * aCompiler,
+ AvmProgram * aProgramCtx, Routine * aRoutine)
+{
+ AvmProgram * aCompiledRoutine =
+ compileRoutineStructure(aCompiler, aProgramCtx, aRoutine);
+
+ // Compile Routine -> Code
+ aCompiledRoutine->setCode(
+ compileStatement(aCompiledRoutine, aRoutine->getCode()) );
+
+ return( aCompiledRoutine );
+}
+
+
+AvmProgram * AvmcodeCompiler::compileRoutine(
+ BaseCompiler * aCompiler, AvmProgram * aProgramCtx,
+ InstanceOfData * aVarInstanceCtx, Routine * aRoutine)
+{
+ AvmProgram * aCompiledRoutine =
+ compileRoutineStructure(aCompiler, aProgramCtx, aRoutine);
+
+
+ // Compile Routine -> Code
+ CompilationEnvironment compilENV(aCompiledRoutine, aVarInstanceCtx);
+
+ aCompiledRoutine->setCode(
+ compileStatement(compilENV.mCTX, aRoutine->getCode()) );
+
+ return( aCompiledRoutine );
+}
+
+
+AvmProgram * AvmcodeCompiler::compileRoutine(
+ BaseCompiler * aCompiler, AvmProgram * aProgramCtx,
+ const TypeSpecifier & aTypeSpecifierCtx, Routine * aRoutine)
+{
+ AvmProgram * aCompiledRoutine =
+ compileRoutineStructure(aCompiler, aProgramCtx, aRoutine);
+
+ // Compile Routine -> Code
+ aCompiledRoutine->setCode(
+ compileStatement(aCompiledRoutine, aRoutine->getCode()) );
+
+ return( aCompiledRoutine );
+}
+
+
+/**
+ *******************************************************************************
+ * POST-COMPILATION OF DATA ROUTINE
+ *******************************************************************************
+ */
+
+void AvmcodeCompiler::optimizeDataRoutine(AvmProgram * aProgram)
+{
+//AVM_OS_TRACE << TAB << "<| optimizing<program>: "
+// << aProgram->getFullyQualifiedNameID() << std::endl;
+
+ if( aProgram->hasConstData() )
+ {
+ TableOfInstanceOfData::const_raw_iterator itData =
+ aProgram->getConstData().begin();
+ TableOfInstanceOfData::const_raw_iterator endData =
+ aProgram->getConstData().end();
+ for( ; itData != endData ; ++itData )
+ {
+ /*
+ * initial macro value
+ */
+ if( (itData)->getModifier().hasNatureMacro()
+ && (itData)->hasValue()
+ && (itData)->getValue().is< AvmCode >() )
+ {
+ (itData)->setValue( optimizeExpression(
+ aProgram, (itData)->getValue().bfCode()) );
+ }
+ }
+ }
+
+ if( aProgram->hasData() )
+ {
+ TableOfInstanceOfData::const_raw_iterator itData =
+ aProgram->getAllData().begin();
+ TableOfInstanceOfData::const_raw_iterator endData =
+ aProgram->getAllData().end();
+ for( ; itData != endData ; ++itData )
+ {
+ /*
+ * initial macro value
+ */
+ if( (itData)->getModifier().hasNatureMacro()
+ && (itData)->hasValue()
+ && (itData)->getValue().is< AvmCode >() )
+ {
+ (itData)->setValue( optimizeExpression(
+ aProgram, (itData)->getValue().bfCode()) );
+ }
+
+ /*
+ * onWrite
+ */
+ if( (itData)->hasOnWriteRoutine())
+ {
+ optimizeProgramRoutine( (itData)->getOnWriteRoutine() );
+ }
+ }
+ }
+
+ if( aProgram->hasDataAlias() )
+ {
+ TableOfInstanceOfData::const_raw_iterator itData =
+ aProgram->getDataAlias().begin();
+ TableOfInstanceOfData::const_raw_iterator endData =
+ aProgram->getDataAlias().end();
+ for( ; itData != endData ; ++itData )
+ {
+ /*
+ * Symbolic Array Index
+ */
+ if( (itData)->hasArrayIndexPointer() )
+ {
+ TableOfSymbol::iterator itDP = (itData)->getDataPath()->begin();
+ TableOfSymbol::iterator endItDP = (itData)->getDataPath()->end();
+
+ for( ; itDP != endItDP ; ++itDP )
+ {
+ if( (*itDP).isFieldArrayIndexPointer() &&
+ (*itDP).getValue().is< AvmCode >() )
+ {
+ (*itDP).setValue( optimizeExpression(
+ aProgram, (*itDP).getValue().bfCode()) );
+ }
+ }
+ }
+ }
+ }
+
+
+//AVM_OS_TRACE << TAB << ">| optimizing<Program>: "
+// << aProgram->getFullyQualifiedNameID() << std::endl << std::endl;
+}
+
+
+void AvmcodeCompiler::optimizeDataRoutine(ExecutableForm * theExecutable)
+{
+//AVM_OS_TRACE << TAB << "<| optimizing<executable>: "
+// << theExecutable->getFullyQualifiedNameID() << std::endl;
+
+ optimizeDataRoutine( static_cast< AvmProgram * >(theExecutable) );
+
+//AVM_OS_TRACE << TAB << ">| optimizing<executable>: "
+// << theExecutable->getFullyQualifiedNameID() << std::endl << std::endl;
+}
+
+
+
+void AvmcodeCompiler::optimizeProgramRoutine(AvmProgram * aProgram)
+{
+//AVM_OS_TRACE << TAB << "<| optimizing<program>: "
+// << aProgram->getFullyQualifiedNameID() << std::endl;
+
+
+ /*
+ * onRead / onWrite routine of data
+ */
+ optimizeDataRoutine( aProgram );
+
+
+ if( aProgram->hasCode() )
+ {
+ aProgram->setCode( optimizeStatement(aProgram, aProgram->getCode()) );
+
+ aProgram->updateOpcodeFamily();
+ }
+
+
+ /*
+ * onSynchronize
+ */
+// if( aProgram->hasOnSynchronize() )
+// {
+// aProgram->setOnSynchronize(
+// theAvmcodeCompiler.optimizeStatement(
+// aProgram, aProgram->getOnSynchronize()) );
+// }
+
+
+//AVM_OS_TRACE << TAB << ">| optimizing<program>: "
+// << aProgram->getFullyQualifiedNameID() << std::endl << std::endl;
+}
+
+
+
+void AvmcodeCompiler::optimizeInstance(
+ ExecutableForm * theExecutableContainer, InstanceOfMachine * anInstance)
+{
+ ExecutableForm * anExec = anInstance->getExecutable();
+
+ /*
+ * onCreate
+ */
+ if( anInstance->hasOnCreate() )
+ {
+ CompilationEnvironment compilENV(NULL, anExec, theExecutableContainer);
+
+ anInstance->setOnCreate( optimizeStatement(
+ compilENV.mCTX, anInstance->getOnCreate() ) );
+ }
+ else
+ {
+ anInstance->setOnCreate( anExec->getOnCreate() );
+ }
+
+ /*
+ * onStart
+ */
+ if( anInstance->hasOnStart() )
+ {
+ CompilationEnvironment compilENV(NULL, anExec, theExecutableContainer);
+
+ anInstance->setOnStart( optimizeStatement(
+ compilENV.mCTX, anInstance->getOnStart() ) );
+ }
+ else if( anExec->hasOnStart() )
+ {
+ anInstance->setOnStart( anExec->getOnStart() );
+ }
+ else if( anInstance->getSpecifier().hasDesignInstanceDynamic()
+ || anExec->getSpecifier().isComponentProcedure() )
+ {
+ if( anExec->hasOnInit() )
+ {
+ anInstance->setOnStart( anExec->getOnInit() );
+ }
+ else if( anInstance->getSpecifier().hasDesignInstanceDynamic() )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "optimizeInstance: Unexpected #dynamic instance "
+ "without << onStart Primitive >> !!!"
+ << std::endl << to_stream( anInstance )
+ << SEND_EXIT;
+ }
+ }
+
+ //!![MIGRATION] optimizeInstanceParameter
+ if( anInstance->hasParam() )
+ {
+ CompilationEnvironment compilENV(NULL, anExec, theExecutableContainer);
+ COMPILE_CONTEXT * aCTX;
+
+ InstanceOfData * paramVar;
+
+ TableOfData::iterator it = anInstance->getParamReturnTable()->begin();
+ TableOfData::iterator endIt = anInstance->getParamReturnTable()->end();
+ for( avm_offset_t offset = 0 ; it != endIt ; ++it , ++offset )
+ {
+ if( (*it).is< AvmCode >() )
+ {
+ paramVar = anExec->rawParamData(offset);
+
+ aCTX = compilENV.mCTX->clone( paramVar->getTypeSpecifier() );
+
+ (*it) = optimizeExpression(aCTX, (*it).bfCode());
+
+// if( paramVar->getModifier().hasNatureReference()
+// && (*it).is< AvmCode >() )
+// {
+//// setArgcodeLValue(aCTX,
+//// (*it).to_ptr< AvmCode >()->getGlobalArgcode(), (*it));
+// }
+ }
+ else if( (*it).is< InstanceOfData >() )
+ {
+ InstanceOfData * anInstance = (*it).to_ptr< InstanceOfData >();
+ if( anInstance->getModifier().hasModifierPublicFinalStatic()
+ && anInstance->isTypedEnum() && anInstance->hasValue() )
+ {
+ (*it) = anInstance->getValue();
+ }
+ }
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+//// replace UFI by INSTANCE
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+BF AvmcodeCompiler::substituteUfiByInstance(ExecutableForm * theExecutable,
+ const BF & anElement, ListOfSymbol & usingInstance)
+{
+ if( anElement.invalid() )
+ {
+ return( anElement );
+ }
+ else if( anElement.is< Machine >() )
+ {
+ TableOfSymbol::const_iterator itMachine =
+ theExecutable->instance_static_begin();
+ TableOfSymbol::const_iterator endMachine =
+ theExecutable->instance_static_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ if( anElement.isTEQ( (*itMachine).getAstElement() ) )
+ {
+ usingInstance.append( (*itMachine) );
+
+ return( (*itMachine) );
+ }
+ }
+
+ AVM_OS_EXIT( FAILED )
+ << "Undefined machine instance < "
+ << anElement.to_ptr< Machine >()->getFullyQualifiedNameID()
+ << " > in executable machine < "
+ << theExecutable->getFullyQualifiedNameID() << " > !!!"
+ << SEND_EXIT;
+
+ return( anElement );
+ }
+ else if( anElement.is< UniFormIdentifier >() )
+ {
+ std::string strUFI = anElement.str();
+
+ TableOfSymbol::const_iterator itMachine =
+ theExecutable->instance_static_begin();
+ TableOfSymbol::const_iterator endMachine =
+ theExecutable->instance_static_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ if( (*itMachine).getAstFullyQualifiedNameID().find(strUFI,
+ (*itMachine).getFullyQualifiedNameID().size()
+ - strUFI.size()) != std::string::npos )
+ {
+ usingInstance.append( (*itMachine) );
+
+ return( (*itMachine) );
+ }
+ }
+
+ AVM_OS_EXIT( FAILED )
+ << "Undefined machine instance < "
+ << strUFI << " > in executable machine < "
+ << theExecutable->getFullyQualifiedNameID() << " > !!!"
+ << SEND_EXIT;
+
+ return( anElement );
+ }
+ else if( anElement.is< AvmCode >() )
+ {
+ BFCode aCode = anElement.bfCode();
+ BFCode aNewCode(aCode->getOperator());
+
+ AvmCode::iterator it = aCode->begin();
+ for( ; it != aCode->end() ; ++it )
+ {
+ aNewCode->append( substituteUfiByInstance(
+ theExecutable, *it, usingInstance) );
+ }
+
+ return( aNewCode );
+ }
+ else
+ {
+ return( anElement );
+ }
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeCompiler.h b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeCompiler.h
new file mode 100644
index 0000000..daeb570
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeCompiler.h
@@ -0,0 +1,417 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 7 avr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCODECOMPILER_H_
+#define AVMCODECOMPILER_H_
+
+#include <vector>
+
+#include <common/AvmObject.h>
+#include <common/BF.h>
+
+#include <builder/primitive/CompilationEnvironment.h>
+
+#include <collection/Typedef.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/symbol/Symbol.h>
+
+
+namespace sep
+{
+
+
+class AbstractAvmcodeCompiler;
+class AvmcodeUfiExpressionCompiler;
+
+class BaseCompiler;
+class BaseCompilerTable;
+
+class ArrayBF;
+class ArrayIdentifier;
+class ArrayQualifiedIdentifier;
+
+class AvmCode;
+class AvmProgram;
+
+class Configuration;
+
+class Element;
+class ExecutableForm;
+class ExecutableSystem;
+
+class Routine;
+class SymbolTable;
+class TypeSpecifier;
+
+class UniFormIdentifier;
+
+
+class AvmcodeCompiler : public AvmObject
+{
+
+public:
+ /**
+ * ATTRIBUTE
+ */
+ Configuration & mConfiguration;
+
+ BaseCompilerTable & mCompilerTable;
+
+
+ AvmcodeUfiExpressionCompiler * UFI_EXPRESSION_COMPILER;
+
+ std::vector< AbstractAvmcodeCompiler * > AVMCODE_COMPILER_TABLE;
+ std::vector< AbstractAvmcodeCompiler * > AVMCODE_COMPILER_TABLE_FOR_DESTROY;
+
+ AbstractAvmcodeCompiler * DEFAULT_AVMCODE_COMPILER;
+ AbstractAvmcodeCompiler * NOTHING_AVMCODE_COMPILER;
+
+ AbstractAvmcodeCompiler * UNARY_ARITHMETIC_EXPRESSION_COMPILER;
+ AbstractAvmcodeCompiler * BINARY_ARITHMETIC_EXPRESSION_COMPILER;
+ AbstractAvmcodeCompiler * ASSOCIATIVE_ARITHMETIC_EXPRESSION_COMPILER;
+
+ AbstractAvmcodeCompiler * UNARY_BITWISE_EXPRESSION_COMPILER;
+ AbstractAvmcodeCompiler * BINARY_BITWISE_EXPRESSION_COMPILER;
+ AbstractAvmcodeCompiler * ASSOCIATIVE_BITWISE_EXPRESSION_COMPILER;
+
+ AbstractAvmcodeCompiler * UNARY_PREDICATE_EXPRESSION_COMPILER;
+ AbstractAvmcodeCompiler * BINARY_PREDICATE_EXPRESSION_COMPILER;
+ AbstractAvmcodeCompiler * ASSOCIATIVE_PREDICATE_EXPRESSION_COMPILER;
+
+ AbstractAvmcodeCompiler * RELATIONAL_EXPRESSION_COMPILER;
+
+ AbstractAvmcodeCompiler * UNARY_STRING_EXPRESSION_COMPILER;
+ AbstractAvmcodeCompiler * BINARY_STRING_EXPRESSION_COMPILER;
+ AbstractAvmcodeCompiler * ASSOCIATIVE_STRING_EXPRESSION_COMPILER;
+
+ AbstractAvmcodeCompiler * LOOKUP_EXPRESSION_COMPILER;
+ AbstractAvmcodeCompiler * MACHINE_STATUS_EXPRESSION_COMPILER;
+ AbstractAvmcodeCompiler * MATH_FUNCTION_COMPILER;
+ AbstractAvmcodeCompiler * VARIABLE_STATUS_EXPRESSION_COMPILER;
+
+ AbstractAvmcodeCompiler * ACTIVITY_STATEMENT_COMPILER;
+ AbstractAvmcodeCompiler * SCHEDULING_STATEMENT_COMPILER;
+ AbstractAvmcodeCompiler * SEQUENCE_STATEMENT_COMPILER;
+
+ AbstractAvmcodeCompiler * ITE_STATEMENT_COMPILER;
+
+ AbstractAvmcodeCompiler * UNARY_CONTAINER_STATEMENT;
+ AbstractAvmcodeCompiler * UNARY_WRITE_CONTAINER_STATEMENT;
+
+ AbstractAvmcodeCompiler * BINARY_CONTAINER_STATEMENT;
+ AbstractAvmcodeCompiler * BINARY_WRITE_CONTAINER_STATEMENT;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmcodeCompiler(Configuration & aConfiguration,
+ BaseCompilerTable & aCompilerTable)
+ : AvmObject( ),
+ mConfiguration( aConfiguration ),
+ mCompilerTable( aCompilerTable ),
+
+ UFI_EXPRESSION_COMPILER( NULL ),
+
+ AVMCODE_COMPILER_TABLE( ),
+ AVMCODE_COMPILER_TABLE_FOR_DESTROY( ),
+
+ DEFAULT_AVMCODE_COMPILER( NULL ),
+ NOTHING_AVMCODE_COMPILER( NULL ),
+
+ UNARY_ARITHMETIC_EXPRESSION_COMPILER( NULL ),
+ BINARY_ARITHMETIC_EXPRESSION_COMPILER( NULL ),
+ ASSOCIATIVE_ARITHMETIC_EXPRESSION_COMPILER( NULL ),
+
+ UNARY_BITWISE_EXPRESSION_COMPILER( NULL ),
+ BINARY_BITWISE_EXPRESSION_COMPILER( NULL ),
+ ASSOCIATIVE_BITWISE_EXPRESSION_COMPILER( NULL ),
+
+ UNARY_PREDICATE_EXPRESSION_COMPILER( NULL ),
+ BINARY_PREDICATE_EXPRESSION_COMPILER( NULL ),
+ ASSOCIATIVE_PREDICATE_EXPRESSION_COMPILER( NULL ),
+
+ RELATIONAL_EXPRESSION_COMPILER( NULL ),
+
+ UNARY_STRING_EXPRESSION_COMPILER( NULL ),
+ BINARY_STRING_EXPRESSION_COMPILER( NULL ),
+ ASSOCIATIVE_STRING_EXPRESSION_COMPILER( NULL ),
+
+ LOOKUP_EXPRESSION_COMPILER( NULL ),
+ MACHINE_STATUS_EXPRESSION_COMPILER( NULL ),
+ MATH_FUNCTION_COMPILER( NULL ),
+ VARIABLE_STATUS_EXPRESSION_COMPILER( NULL ),
+
+ ACTIVITY_STATEMENT_COMPILER( NULL ),
+ SCHEDULING_STATEMENT_COMPILER( NULL ),
+ SEQUENCE_STATEMENT_COMPILER( NULL ),
+ ITE_STATEMENT_COMPILER( NULL ),
+
+ UNARY_CONTAINER_STATEMENT( NULL ),
+ UNARY_WRITE_CONTAINER_STATEMENT( NULL ),
+
+ BINARY_CONTAINER_STATEMENT( NULL ),
+ BINARY_WRITE_CONTAINER_STATEMENT( NULL )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AvmcodeCompiler();
+
+
+ /**
+ * GETTER
+ * mConfiguration
+ */
+ inline Configuration & getConfiguration() const
+ {
+ return( mConfiguration );
+ }
+
+ /*
+ * GETTER
+ * mCompilerTable
+ */
+ inline BaseCompilerTable & getCompilerTable()
+ {
+ return( mCompilerTable );
+ }
+
+ /*
+ * GETTER
+ * theSymbolTable
+ */
+ SymbolTable & getSymbolTable();
+
+
+ /**
+ * CONFIGURE
+ */
+ bool configure();
+
+ bool configureOther();
+
+ bool configureMeta();
+
+ bool configureLambdaPrimitive();
+
+ bool configureActivityPrimitive();
+
+ bool configureStatusPrimitive();
+
+ bool configureSchedulingPrimitive();
+ bool configureBasicPrimitive();
+
+ bool configureArithmeticPrimitive();
+ bool configureBitwisePrimitive();
+ bool configureLogicPrimitive();
+
+ bool configureLookupPrimitive();
+ bool configureMathematicPrimitive();
+
+ bool configureStringCollectionPrimitive();
+
+ bool configureIoltPrimitive();
+
+
+ /*
+ * COMPILE ARGUMENT
+ */
+ const BF & postCompileSymbol(const BF & aSymbol);
+
+ BF compileUFI(COMPILE_CONTEXT * aCTX, const UniFormIdentifier & anUFI);
+
+
+ BF compileFullyQualifiedNameID(COMPILE_CONTEXT * aCTX,
+ const std::string & aFullyQualifiedNameID);
+
+ inline BF compileFullyQualifiedNameID(
+ COMPILE_CONTEXT * aCTX, const BF & aFQN_ID)
+ {
+ return( compileFullyQualifiedNameID(aCTX, aFQN_ID.str()) );
+ }
+
+
+ BF compileQualifiedIdentifier(
+ COMPILE_CONTEXT * aCTX, const BF & aQualifiedNameID);
+
+ BF compileQualifiedPositionalIdentifier(
+ COMPILE_CONTEXT * aCTX, const BF & aQualifiedNameID);
+
+
+ BF compileIdentifier(COMPILE_CONTEXT * aCTX, const std::string & aNameID);
+
+ inline BF compileIdentifier(COMPILE_CONTEXT * aCTX, const BF & aNameID)
+ {
+ return( compileIdentifier(aCTX, aNameID.str()) );
+ }
+
+
+ const BF & compileElement(COMPILE_CONTEXT * aCTX, const BF & anElement);
+
+ const BF & compileDataType(COMPILE_CONTEXT * aCTX, const BF & aDataType);
+ const BF & compileVariable(COMPILE_CONTEXT * aCTX, const BF & aVariable);
+ const BF & compileBuffer(COMPILE_CONTEXT * aCTX, const BF & aBuffer);
+ const BF & compilePort(COMPILE_CONTEXT * aCTX, const BF & aPort);
+ const BF & compileConnector(COMPILE_CONTEXT * aCTX, const BF & aConnector);
+
+ const BF & compileMachine(COMPILE_CONTEXT * aCTX, const BF & aMachine);
+ const BF & compileRoutine(COMPILE_CONTEXT * aCTX, const BF & aRoutine);
+ const BF & compileTransition(COMPILE_CONTEXT * aCTX, const BF & aTransition);
+
+
+ /*
+ * DECODE & COMPILE EXPRESSION
+ */
+ BF decode_compileExpression(COMPILE_CONTEXT * aCTX, const BF & aCode);
+
+ BF decode_compileExpression(AvmProgram * aCompileCtx, const BF & aCode)
+ {
+ CompilationEnvironment compilENV(aCompileCtx);
+
+ return( decode_compileExpression(compilENV.mCTX, aCode) );
+ }
+
+ BF compileArrayOfIdentifier(COMPILE_CONTEXT * aCTX, ArrayIdentifier * idArray);
+
+ BF compileArrayOfQualifiedIdentifier(COMPILE_CONTEXT * aCTX,
+ ArrayQualifiedIdentifier * ufiArray);
+
+ BF compileArrayOfBF(COMPILE_CONTEXT * aCTX, ArrayBF * bfarray);
+
+
+ BF compileExpression(COMPILE_CONTEXT * aCTX, const BFCode & aCode);
+
+
+ BF decode_optimizeExpression(COMPILE_CONTEXT * aCTX, const BF & aCode);
+
+
+ BF optimizeExpression(COMPILE_CONTEXT * aCTX, const BFCode & aCode);
+
+ BF optimizeExpression(AvmProgram * aCompileCtx, const BFCode & aCode)
+ {
+ CompilationEnvironment compilENV(aCompileCtx);
+
+ return( optimizeExpression(compilENV.mCTX, aCode) );
+ }
+
+
+ BF decode_compileVariableMachine(COMPILE_CONTEXT * aCTX, const BF & aCode);
+
+ BF decode_compileVariablePort(COMPILE_CONTEXT * aCTX, const BF & aCode);
+
+ BF decode_compileVariableBuffer(COMPILE_CONTEXT * aCTX, const BF & aCode);
+
+
+ /*
+ * DECODE & COMPILE EXPRESSION
+ */
+ bool optimizeEvalExpression(COMPILE_CONTEXT * aCTX, BFCode & aCode);
+
+ bool optimizeEvalExpression(AvmProgram * aCompileCtx, BFCode & aCode)
+ {
+ CompilationEnvironment compilENV(aCompileCtx);
+
+ return( optimizeEvalExpression(compilENV.mCTX, aCode) );
+ }
+
+
+ /*
+ * DECODE & COMPILE STATEMENT
+ */
+ BF decode_compileStatement(COMPILE_CONTEXT * aCTX, const BF & aCode);
+
+ BF decode_compileStatement(AvmProgram * aCompileCtx, const BF & aCode)
+ {
+ CompilationEnvironment compilENV(aCompileCtx);
+
+ return( decode_compileStatement(compilENV.mCTX, aCode) );
+ }
+
+
+ BFCode compileStatement(COMPILE_CONTEXT * aCTX, const BFCode & aCode);
+
+ BFCode compileStatement(AvmProgram * aCompileCtx, const BFCode & aCode)
+ {
+ CompilationEnvironment compilENV(aCompileCtx);
+
+ return( compileStatement(compilENV.mCTX, aCode) );
+ }
+
+
+ BF decode_optimizeStatement(COMPILE_CONTEXT * aCTX, const BF & aCode);
+
+ BF decode_optimizeStatement(AvmProgram * aCompileCtx, const BF & aCode)
+ {
+ CompilationEnvironment compilENV(aCompileCtx);
+
+ return( decode_optimizeStatement(compilENV.mCTX, aCode) );
+ }
+
+
+ BFCode optimizeStatement(COMPILE_CONTEXT * aCTX, const BFCode & aCode);
+
+ BFCode optimizeStatement(AvmProgram * aCompileCtx, const BFCode & aCode)
+ {
+ CompilationEnvironment compilENV(aCompileCtx);
+
+ return( optimizeStatement(compilENV.mCTX, aCode) );
+ }
+
+
+ AvmProgram * compileRoutineStructure(BaseCompiler * aCompiler,
+ AvmProgram * aProgramCtx, Routine * aRoutine);
+
+ AvmProgram * compileRoutine(BaseCompiler * aCompiler,
+ AvmProgram * aProgramCtx, Routine * aRoutine);
+
+ AvmProgram * compileRoutine(
+ BaseCompiler * aCompiler, AvmProgram * aProgramCtx,
+ InstanceOfData * aVarInstanceCtx, Routine * aRoutine);
+
+ AvmProgram * compileRoutine(
+ BaseCompiler * aCompiler, AvmProgram * aProgramCtx,
+ const TypeSpecifier & aTypeSpecifierCtx, Routine * aRoutine);
+
+
+ BF substituteUfiByInstance(ExecutableForm * theExecutable,
+ const BF & anElement, ListOfSymbol & usingInstance);
+
+
+ /*
+ * OPTIMIZE PROGRAM from EXECUTABLE or DATA
+ */
+ void optimizeProgramRoutine(AvmProgram * aProgram);
+
+ void optimizeDataRoutine(AvmProgram * aProgram);
+
+ void optimizeDataRoutine(ExecutableForm * theExecutable);
+
+ void optimizeInstance(ExecutableForm * theExecutableContainer,
+ InstanceOfMachine * aMachine);
+
+};
+
+
+}
+
+#endif /* AVMCODECOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeContainerCompiler.cpp b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeContainerCompiler.cpp
new file mode 100644
index 0000000..ce25a8b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeContainerCompiler.cpp
@@ -0,0 +1,328 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 12 avr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmcodeContainerCompiler.h"
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/ExpressionTypeChecker.h>
+#include <fml/expression/StatementConstructor.h>
+
+#include <fml/operator/OperatorLib.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE CONTAINER UNARY STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeUnaryContainerStatementCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileStatement(aCTX, aCode) );
+}
+
+BF AvmcodeUnaryContainerStatementCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optCode = optimizeStatement(aCTX, aCode);
+
+ avm_arg_processor_t arg_cpu = AVM_ARG_COLLECTION_CPU;
+
+ if( ExpressionTypeChecker::isVector( aCode->first() ) )
+ {
+ arg_cpu = AVM_ARG_VECTOR_CPU;
+ }
+
+ optCode->getInstruction()->setMainProcessor( arg_cpu );
+ optCode->getInstruction()->setMainOperand( AVM_ARG_EXPRESSION_KIND );
+
+ return( optCode );
+}
+
+
+BFCode AvmcodeUnaryContainerStatementCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BF container = compileArgRvalue(aCTX, TypeManager::UNIVERSAL, aCode->first());
+
+ return( StatementConstructor::newCode(aCode->getOperator(), container) );
+}
+
+BFCode AvmcodeUnaryContainerStatementCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ optimizeArgExpression(aCTX, aCode, 0);
+ argsInstruction->at(0).dtype = TypeManager::UNIVERSAL;
+ setArgcodeContainerRValue(aCTX, argsInstruction->at(0), aCode->first());
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND,
+ /*dtype */ argsInstruction->at(0).dtype);
+
+ return( aCode );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE WRITE CONTAINER UNARY STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeUnaryWriteContainerStatementCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileStatement(aCTX, aCode) );
+}
+
+BF AvmcodeUnaryWriteContainerStatementCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optCode = optimizeStatement(aCTX, aCode);
+
+ avm_arg_processor_t arg_cpu = AVM_ARG_COLLECTION_CPU;
+
+ if( ExpressionTypeChecker::isVector( aCode->first() ) )
+ {
+ arg_cpu = AVM_ARG_VECTOR_CPU;
+ }
+
+ optCode->getInstruction()->setMainProcessor( arg_cpu );
+ optCode->getInstruction()->setMainOperand( AVM_ARG_EXPRESSION_KIND );
+
+ return( optCode );
+}
+
+
+BFCode AvmcodeUnaryWriteContainerStatementCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BF container = compileArgRvalue(aCTX, TypeManager::UNIVERSAL, aCode->first());
+
+ return( StatementConstructor::newCode(aCode->getOperator(), container) );
+}
+
+BFCode AvmcodeUnaryWriteContainerStatementCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ optimizeArgExpression(aCTX, aCode, 0);
+ argsInstruction->at(0).dtype = TypeManager::UNIVERSAL;
+ setArgcodeContainerWValue(aCTX, argsInstruction->at(0), aCode->first());
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND,
+ /*dtype */ argsInstruction->at(0).dtype);
+
+ return( aCode );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE CONTAINER BINARY STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeBinaryContainerStatementCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileStatement(aCTX, aCode) );
+}
+
+BF AvmcodeBinaryContainerStatementCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optCode = optimizeStatement(aCTX, aCode);
+
+ avm_arg_processor_t arg_cpu = AVM_ARG_COLLECTION_CPU;
+
+ BF optContainer = optCode->hasOpCode(AVM_OPCODE_IN, AVM_OPCODE_NOTIN) ?
+ aCode->second() : aCode->first();
+
+ if( ExpressionTypeChecker::isVector(optContainer) )
+ {
+ arg_cpu = AVM_ARG_VECTOR_CPU;
+ }
+
+ optCode->getInstruction()->setMainProcessor( arg_cpu );
+ optCode->getInstruction()->setMainOperand( AVM_ARG_EXPRESSION_KIND );
+
+ return( optCode );
+}
+
+
+BFCode AvmcodeBinaryContainerStatementCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BF container;
+ BF element;
+ if( aCode->hasOpCode(AVM_OPCODE_IN, AVM_OPCODE_NOTIN) )
+ {
+ container = aCode->second();
+ element = aCode->first();
+ }
+ else
+ {
+ container = aCode->first();
+ element = aCode->second();
+ }
+
+ container = compileArgRvalue(aCTX, TypeManager::UNIVERSAL, container);
+
+ InstanceOfData * instance = NULL;
+ if( container.is< InstanceOfData >() )
+ {
+ instance = container.to_ptr< InstanceOfData >();
+ if( instance->hasTypeContainer() &&
+ aCode->hasOpCode(AVM_OPCODE_CONTAINS,
+ AVM_OPCODE_IN, AVM_OPCODE_NOTIN) )
+ {
+ aCTX = aCTX->clone( instance->getTypeSpecifier()->
+ to< ContainerTypeSpecifier >()->getContentsTypeSpecifier() );
+ }
+ }
+
+ element = compileArgRvalue(aCTX, element, true);
+
+
+ if( aCode->hasOpCode(AVM_OPCODE_IN, AVM_OPCODE_NOTIN) )
+ {
+ return( StatementConstructor::newCode(
+ aCode->getOperator(), element, container) );
+ }
+ else
+ {
+ return( StatementConstructor::newCode(
+ aCode->getOperator(), container, element) );
+ }
+}
+
+BFCode AvmcodeBinaryContainerStatementCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ argsInstruction->at(0).dtype = TypeManager::UNIVERSAL;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), aCode->first(), false);
+
+ argsInstruction->at(1).dtype = TypeManager::UNIVERSAL;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), aCode->second(), false);
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND,
+ /*dtype */ argsInstruction->at(0).dtype);
+
+ return( aCode );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE WRITE CONTAINER BINARY STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeBinaryWriteContainerStatementCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileStatement(aCTX, aCode) );
+}
+
+BF AvmcodeBinaryWriteContainerStatementCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optCode = optimizeStatement(aCTX, aCode);
+
+ avm_arg_processor_t arg_cpu = AVM_ARG_COLLECTION_CPU;
+
+ BF optContainer = optCode->hasOpCode(AVM_OPCODE_IN, AVM_OPCODE_NOTIN) ?
+ aCode->second() : aCode->first();
+
+ if( ExpressionTypeChecker::isVector(optContainer) )
+ {
+ arg_cpu = AVM_ARG_VECTOR_CPU;
+ }
+
+ optCode->getInstruction()->setMainProcessor( arg_cpu );
+ optCode->getInstruction()->setMainOperand( AVM_ARG_EXPRESSION_KIND );
+
+ return( optCode );
+}
+
+
+BFCode AvmcodeBinaryWriteContainerStatementCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BF container = compileArgRvalue(aCTX, TypeManager::UNIVERSAL, aCode->first());
+
+ InstanceOfData * instance = NULL;
+ if( container.is< InstanceOfData >() )
+ {
+ instance = container.to_ptr< InstanceOfData >();
+ if( instance->hasTypeContainer() )
+ {
+ if( aCode->hasOpCode(AVM_OPCODE_APPEND, AVM_OPCODE_REMOVE) )
+ {
+ aCTX = aCTX->clone( instance->getTypeSpecifier()->
+ to< ContainerTypeSpecifier >()->getContentsTypeSpecifier() );
+ }
+ else if( aCode->isOpCode(AVM_OPCODE_RESIZE) )
+ {
+ aCTX = aCTX->clone( TypeManager::INTEGER );
+ }
+ }
+ }
+
+ BF element = compileArgRvalue(aCTX, aCode->second(), true);
+
+ return( StatementConstructor::newCode(
+ aCode->getOperator(), container, element) );
+}
+
+BFCode AvmcodeBinaryWriteContainerStatementCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ argsInstruction->at(0).dtype = TypeManager::UNIVERSAL;
+ setArgcodeContainerWValue(aCTX, argsInstruction->at(0), aCode->first());
+
+ argsInstruction->at(1).dtype = TypeManager::UNIVERSAL;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), aCode->second(), false);
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND,
+ /*dtype */ argsInstruction->at(0).dtype);
+
+ return( aCode );
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeContainerCompiler.h b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeContainerCompiler.h
new file mode 100644
index 0000000..39a1cee
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeContainerCompiler.h
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 12 avr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCODECONTAINERCOMPILER_H_
+#define AVMCODECONTAINERCOMPILER_H_
+
+#include <builder/primitive/AbstractAvmcodeCompiler.h>
+
+
+namespace sep
+{
+
+
+AVMCODE_COMPILER_OPTIMIZER_CLASS(UnaryContainerStatement, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_OPTIMIZER_CLASS(UnaryWriteContainerStatement, AbstractAvmcodeCompiler)
+
+
+AVMCODE_COMPILER_OPTIMIZER_CLASS(BinaryContainerStatement, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_OPTIMIZER_CLASS(BinaryWriteContainerStatement, AbstractAvmcodeCompiler)
+
+
+}
+
+#endif /* AVMCODECONTAINERCOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeCtorExpressionCompiler.cpp b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeCtorExpressionCompiler.cpp
new file mode 100644
index 0000000..f0b6821
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeCtorExpressionCompiler.cpp
@@ -0,0 +1,140 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 12 avr. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmcodeCtorExpressionCompiler.h"
+
+#include <fml/expression/BuiltinArray.h>
+#include <fml/expression/ExpressionConstructor.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE CTOR EXPRESSION COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeCtorExpressionCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BF ctorType = compileArgRvalue(aCTX, aCode->first());
+ if( not ctorType.is< BaseTypeSpecifier >() )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmcodeCtorExpressionCompiler::compileExpression :> "
+ "Unexpected <<" << str_indent( ctorType )
+ << " >> as a type specifier of ctor expression :"
+ << IGNORE_FIRST_TAB << aCode
+ << std::endl;
+
+ return( aCode );
+ }
+
+ BaseTypeSpecifier * ctorTypeSpecifier =
+ ctorType.to_ptr< BaseTypeSpecifier >();
+
+ BF bfExpr = aCode->second();
+ if( bfExpr.is< BuiltinArray >() && ctorTypeSpecifier->hasTypeComposite() )
+ {
+ bfExpr = compileArgRvalue(aCTX->clone(ctorTypeSpecifier), bfExpr);
+
+ if( bfExpr.to_ptr< BuiltinArray >()->
+ getTypeSpecifier() == ctorTypeSpecifier )
+ {
+ return( bfExpr );
+ }
+
+ return( ExpressionConstructor::newCode(
+ aCode->getOperator(), ctorType, bfExpr) );
+ }
+ else
+ {
+ return( ExpressionConstructor::newCode(
+ aCode->getOperator(), ctorType,
+ compileArgRvalue(aCTX, bfExpr) ) );
+ }
+}
+
+BF AvmcodeCtorExpressionCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ argsInstruction->set(0,
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_NOP_CPU,
+ /*operation*/ AVM_ARG_NOP_VALUE,
+ /*operand */ AVM_ARG_CTOR_TYPE_KIND,
+ /*type */ aCode->first().as_ptr< BaseTypeSpecifier >() );
+
+ optimizeArgExpression(aCTX, aCode, 1);
+ argsInstruction->at(1).dtype = aCode->first().to_ptr< BaseTypeSpecifier >();
+ setArgcodeRValue(aCTX, argsInstruction->at(1), aCode->second());
+
+ avm_arg_processor_t mainProcessor =
+ processorOf( argsInstruction->dtype(0) );
+
+ switch( argsInstruction->operand(1) )
+ {
+ case AVM_ARG_STRING_KIND:
+ {
+ mainProcessor = AVM_ARG_STRING_CPU;
+ break;
+ }
+ case AVM_ARG_CHARACTER_KIND:
+ {
+ mainProcessor = AVM_ARG_CHARACTER_CPU;
+ break;
+ }
+ case AVM_ARG_BOOLEAN_KIND:
+ case AVM_ARG_INTEGER_KIND:
+ case AVM_ARG_RATIONAL_KIND:
+ case AVM_ARG_FLOAT_KIND:
+ {
+ mainProcessor = AVM_ARG_ARITHMETIC_LOGIC_CPU;
+ break;
+ }
+
+ case AVM_ARG_ARRAY_KIND:
+ {
+ mainProcessor = AVM_ARG_COLLECTION_CPU;
+ break;
+ }
+
+ default:
+ {
+ if( argsInstruction->dtype(1) != TypeManager::UNIVERSAL )
+ {
+ mainProcessor = processorOf( argsInstruction->dtype(1) );
+ }
+ break;
+ }
+ }
+
+ argsInstruction->setMainBytecode(
+ /*context */ AVM_ARG_RETURN_CTX,
+ /*processor*/ mainProcessor,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ operandOf( argsInstruction->dtype(0) ),
+ /*dtype */ argsInstruction->dtype(0));
+
+ return( aCode );
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeCtorExpressionCompiler.h b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeCtorExpressionCompiler.h
new file mode 100644
index 0000000..6dbd662
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeCtorExpressionCompiler.h
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 12 avr. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCODECTOREXPRESSIONCOMPILER_H_
+#define AVMCODECTOREXPRESSIONCOMPILER_H_
+
+#include <builder/primitive/AbstractAvmcodeCompiler.h>
+
+
+namespace sep
+{
+
+
+AVMCODE_COMPILER_EXPRESSION_OPTIMIZER_CLASS("CTOR< type >( expression+ )",
+ CtorExpression, AbstractAvmcodeCompiler)
+
+
+} /* namespace sep */
+#endif /* AVMCODECTOREXPRESSIONCOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeExpressionCompiler.cpp b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeExpressionCompiler.cpp
new file mode 100644
index 0000000..0a6df73
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeExpressionCompiler.cpp
@@ -0,0 +1,1013 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 2 avr. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmcodeExpressionCompiler.h"
+
+#include <fml/executable/InstanceOfData.h>
+
+#include <fml/expression/BuiltinArray.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/ExpressionFactory.h>
+#include <fml/expression/ExpressionTypeChecker.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/type/ClassTypeSpecifier.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// UNARY RVALUE COMPILATION STEP
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeExpressionALUCompiler::optimizeUnaryRvalue(COMPILE_CONTEXT * aCTX,
+ const BFCode & aCode, BaseTypeSpecifier * aType,
+ avm_arg_processor_t aProcessor, BaseTypeSpecifier * mainType)
+{
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ optimizeArgExpression(aCTX, aCode, 0);
+ argsInstruction->at(0).dtype = aType;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), aCode->first(), false);
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_RETURN_CTX,
+ /*processor*/ aProcessor,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_EXPRESSION_KIND,
+ /*dtype */ mainType);
+
+ return( aCode );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// BINARY RVALUE COMPILATION STEP
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeExpressionALUCompiler::optimizeBinaryRvalue(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode,
+ BaseTypeSpecifier * aType1, BaseTypeSpecifier * aType2,
+ avm_arg_processor_t aProcessor, BaseTypeSpecifier * mainType)
+{
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ optimizeArgExpression(aCTX, aCode, 0);
+ argsInstruction->at(0).dtype = aType1;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), aCode->first(), false);
+
+ optimizeArgExpression(aCTX, aCode, 1);
+ argsInstruction->at(1).dtype = aType2;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), aCode->second(), false);
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_RETURN_CTX,
+ /*processor*/ aProcessor,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_EXPRESSION_KIND,
+ /*dtype */ mainType);
+
+ // set operation on string
+ if( (argsInstruction->at(0).operand == AVM_ARG_STRING_KIND) &&
+ (argsInstruction->at(1).operand == AVM_ARG_STRING_KIND) )
+ {
+ argsInstruction->setMainBytecode(
+ /*context */ AVM_ARG_RETURN_CTX,
+ /*processor*/ AVM_ARG_STRING_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_EXPRESSION_KIND,
+ /*dtype */ mainType );
+ }
+
+ return( aCode );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// ASSOCIATIVE RVALUE COMPILATION STEP
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeExpressionALUCompiler::compileAssociativeRvalue(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode, BaseTypeSpecifier * aType)
+{
+ Operator * mainOperator = aCode->getOperator();
+ BFCode newCode( mainOperator );
+
+ BF arg;
+ AvmCode * pCode;
+
+ aCTX = aCTX->clone(aType);
+
+ AvmCode::iterator itArg = aCode->begin();
+ AvmCode::iterator itEndArg = aCode->end();
+ for( ; itArg != itEndArg ; ++itArg )
+ {
+ arg = AVMCODE_COMPILER.decode_compileExpression(aCTX, *itArg);
+
+ if( arg.invalid() )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmCode< expression > compilation error << "
+ << (*itArg).str() << " >>" << std::endl << std::endl;
+
+ newCode->append( arg );
+ continue;
+ }
+
+ if( arg.is< AvmCode >() )
+ {
+ pCode = arg.to_ptr< AvmCode >();
+
+ if( pCode->isOperator( mainOperator ) &&
+ mainOperator->isAssociative() )
+ {
+ newCode->append( pCode->getArgs() );
+ }
+ else
+ {
+ newCode->append( arg );
+ }
+ }
+ else
+ {
+ newCode->append( arg );
+ }
+ }
+
+ return( newCode );
+}
+
+BFCode AvmcodeExpressionALUCompiler::optimizeAssociativeRvalue(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode, BaseTypeSpecifier * aType,
+ avm_arg_processor_t aProcessor, BaseTypeSpecifier * mainType)
+{
+ Operator * mainOperator = aCode->getOperator();
+ BFCode newCode( mainOperator );
+
+ BF arg;
+ AvmCode * pCode;
+
+ AvmCode::iterator itArg = aCode->begin();
+ AvmCode::iterator itEndArg = aCode->end();
+
+ AvmInstruction * argsInstruction = newCode->newEmptyInstruction();
+
+ Vector< AvmBytecode > vectorOfArgOpcode;
+
+ avm_size_t stringArgCount = 0;
+
+ for( ; itArg != itEndArg ; ++itArg )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, *itArg);
+
+ if( arg.invalid() )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmCode< expression > optimization error << "
+ << (*itArg).str() << " >>" << std::endl << std::endl;
+
+ newCode->append( arg );
+ continue;
+ }
+
+ if( arg.is< AvmCode >() )
+ {
+ pCode = arg.to_ptr< AvmCode >();
+
+ if( pCode->isOperator( mainOperator ) &&
+ mainOperator->isAssociative() )
+ {
+ newCode->append( pCode->getArgs() );
+
+ vectorOfArgOpcode.append(
+ pCode->getInstruction()->getBytecode(), pCode->size());
+ }
+ else
+ {
+ newCode->append( arg );
+
+ if( pCode->hasInstruction() )
+ {
+ vectorOfArgOpcode.append( argcodeOfExpression(aCTX, pCode) );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected expression without argcode << "
+ << pCode->strDebug() << " >> !!!"
+ << SEND_EXIT;
+
+ vectorOfArgOpcode.append( AvmBytecode(AVM_ARG_ARGUMENT_CTX,
+ AVM_ARG_SEVAL_RVALUE, AVM_ARG_EXPRESSION_KIND) );
+ }
+ vectorOfArgOpcode.back().context = AVM_ARG_ARGUMENT_CTX;
+ }
+ }
+ else
+ {
+ newCode->append( arg );
+
+ AvmBytecode argOpcode;
+ setArgcodeRValue(aCTX, argOpcode, arg, false);
+ argOpcode.context = AVM_ARG_ARGUMENT_CTX;
+ vectorOfArgOpcode.append( argOpcode );
+ }
+
+ if( vectorOfArgOpcode.back().operand == AVM_ARG_STRING_KIND )
+ {
+ stringArgCount += 1;
+ }
+ }
+
+ argsInstruction->setMainBytecode(
+ /*context */ AVM_ARG_RETURN_CTX,
+ /*processor*/ aProcessor,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_EXPRESSION_KIND,
+ /*dtype */ mainType );
+
+ argsInstruction->computeBytecode( false , vectorOfArgOpcode );
+
+ // set operation on string
+ if( stringArgCount > 0 )
+ {
+ argsInstruction->setMainBytecode(
+ /*context */ AVM_ARG_RETURN_CTX,
+ /*processor*/ AVM_ARG_STRING_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_EXPRESSION_KIND,
+ /*dtype */ mainType );
+ }
+
+ return( newCode );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE ARITHMETIC LOGIC CPU COMPILATION for UNARY EXPRESSION
+////////////////////////////////////////////////////////////////////////////////
+
+
+BF AvmcodeExpressionALUCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileUnaryRvalue(aCTX, aCode, TypeManager::UNIVERSAL) );
+}
+
+
+BF AvmcodeExpressionALUCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+// argsInstruction->setMainBytecode(
+// /*context */ AVM_ARG_RETURN_CTX,
+// /*processor*/ AVM_ARG_ARITHMETIC_LOGIC_CPU,
+// /*operation*/ AVM_ARG_SEVAL_RVALUE,
+// /*operand */ AVM_ARG_EXPRESSION_KIND,
+// /*dtype */ argsInstruction->at(0).dtype);
+
+ return( optimizeUnaryRvalue(aCTX, aCode, TypeManager::UNIVERSAL,
+ AVM_ARG_ARITHMETIC_LOGIC_CPU, TypeManager::UNIVERSAL) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE ARITHMETIC LOGIC CPU COMPILATION for UNARY EXPRESSION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeUnaryArithmeticExpressionALUCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileUnaryRvalue(aCTX, aCode, TypeManager::UNIVERSAL) );
+}
+
+
+BF AvmcodeUnaryArithmeticExpressionALUCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+// argsInstruction->setMainBytecode(
+// /*context */ AVM_ARG_RETURN_CTX,
+// /*processor*/ AVM_ARG_ARITHMETIC_LOGIC_CPU,
+// /*operation*/ AVM_ARG_SEVAL_RVALUE,
+// /*operand */ AVM_ARG_EXPRESSION_KIND,
+// /*dtype */ argsInstruction->at(0).dtype);
+
+ return( optimizeUnaryRvalue(aCTX, aCode, TypeManager::UNIVERSAL,
+ AVM_ARG_ARITHMETIC_LOGIC_CPU, TypeManager::UNIVERSAL) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE ARITHMETIC LOGIC CPU COMPILATION for BINARY EXPRESSION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeBinaryArithmeticExpressionALUCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileBinaryRvalue(aCTX, aCode,
+ TypeManager::UNIVERSAL, TypeManager::UNIVERSAL) );
+}
+
+
+BF AvmcodeBinaryArithmeticExpressionALUCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( optimizeBinaryRvalue(aCTX, aCode,
+ TypeManager::UNIVERSAL, TypeManager::UNIVERSAL,
+ AVM_ARG_ARITHMETIC_LOGIC_CPU, TypeManager::UNIVERSAL) );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE ARITHMETIC LOGIC CPU COMPILATION for ASSOCIATIVE EXPRESSION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeAssociativeArithmeticExpressionALUCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileAssociativeRvalue(aCTX, aCode, TypeManager::UNIVERSAL) );
+}
+
+
+BF AvmcodeAssociativeArithmeticExpressionALUCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( optimizeAssociativeRvalue(aCTX, aCode, TypeManager::UNIVERSAL,
+ AVM_ARG_ARITHMETIC_LOGIC_CPU, TypeManager::UNIVERSAL) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE PREDICAT EXPRESSION COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+static void compareStructure(BaseAvmProgram * aProgram, AvmCode * expandCode,
+ Operator * op, const Symbol & arg1, const Symbol & arg2)
+{
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+// AVM_OS_TRACE << "compareStructure:> " << std::endl;
+// arg1.toStream(AVM_OS_TRACE);
+// arg2.toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << "compareStructure:> " << std::endl
+ << "\t" << str_header( arg1 ) << std::endl
+ << "\t" << str_header( arg2 ) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+
+ if( arg1.hasAttribute() && arg2.hasAttribute() )
+ {
+ TableOfSymbol::const_iterator it1 = arg1.getAttribute()->begin();
+ TableOfSymbol::const_iterator it2 = arg2.getAttribute()->begin();
+ TableOfSymbol::const_iterator itEnd = arg1.getAttribute()->end();
+ for( ; it1 != itEnd ; ++it1 , ++it2 )
+ {
+ compareStructure(aProgram, expandCode, op, (*it1) , (*it2));
+ }
+ }
+
+ else if( arg1.hasAttribute() || arg2.hasAttribute() )
+ {
+ const Symbol & argAttrs = arg1.hasAttribute() ? arg1 : arg2;
+ const Symbol & argOther = arg1.hasDataPath() ? arg1 : arg2;
+
+ Symbol argAlias;
+ std::string aQualifiedNameID;
+
+ TableOfSymbol::const_iterator it = argAttrs.getAttribute()->begin();
+ TableOfSymbol::const_iterator itEnd = argAttrs.getAttribute()->end();
+ for( ; it != itEnd ; ++it )
+ {
+ argAlias = new InstanceOfData(argOther.getPointerNature(),
+ argOther.getContainer(), argOther.rawData(),
+ *(argOther.getDataPath()), (*it));
+
+ aQualifiedNameID = (*it).getFullyQualifiedNameID().substr(
+ argAttrs.getFullyQualifiedNameID().length() + 1);
+
+ argAlias.updateFullyQualifiedNameID(
+ OSS() << argOther.getFullyQualifiedNameID()
+ << '.' << aQualifiedNameID,
+ OSS() << argOther.getNameID() << '.' << aQualifiedNameID );
+
+ aProgram->appendDataAlias(argAlias);
+
+ compareStructure(aProgram, expandCode, op, (*it) , argAlias);
+ }
+ }
+
+ else if( arg1.isTypedStructure() )
+ {
+ Symbol arg1Alias;
+ Symbol arg2Alias;
+ std::string id;
+
+ ClassTypeSpecifier * structT =
+ arg1.getTypeSpecifier()->as< ClassTypeSpecifier >();
+ TableOfSymbol::const_iterator it = structT->getSymbolData().begin();
+ TableOfSymbol::const_iterator itEnd = structT->getSymbolData().end();
+ for( ; it != itEnd ; ++it )
+ {
+ id = (*it).getNameID();
+
+ arg1Alias = new InstanceOfData(arg1.getPointerNature(),
+ arg1.getContainer(), arg1.rawData(),
+ *(arg1.getDataPath()), (*it));
+
+ arg1Alias.updateFullyQualifiedNameID(
+ ( OSS() << arg1.getFullyQualifiedNameID() << '.' << id ),
+ ( OSS() << arg1.getNameID() << '.' << id ) );
+
+ aProgram->appendDataAlias(arg1Alias);
+
+
+ arg2Alias = new InstanceOfData(arg2.getPointerNature(),
+ arg2.getContainer(), arg2.rawData(),
+ *(arg2.getDataPath()), (*it));
+
+ arg2Alias.updateFullyQualifiedNameID(
+ ( OSS() << arg2.getFullyQualifiedNameID() << '.' << id ),
+ ( OSS() << arg2.getNameID() << '.' << id ) );
+
+ aProgram->appendDataAlias(arg2Alias);
+
+ compareStructure(aProgram, expandCode, op, arg1Alias , arg2Alias);
+ }
+ }
+
+ else
+ {
+ BFCode atomCode(op);
+
+ if( arg1.isFieldClassAttributePointer() ||
+ arg1.isFieldArrayOffsetPointer() )
+ {
+ atomCode->append( INCR_BF( arg1.getAliasTarget() ) );
+ }
+ else
+ {
+ atomCode->append( arg1 );
+ }
+
+ if( arg2.isFieldClassAttributePointer() ||
+ arg2.isFieldArrayOffsetPointer() )
+ {
+ atomCode->append( INCR_BF( arg2.getAliasTarget() ) );
+ }
+ else
+ {
+ atomCode->append( arg2 );
+ }
+
+ expandCode->append( atomCode );
+ }
+}
+
+
+static void compareStructure(BaseAvmProgram * aProgram, AvmCode * expandCode,
+ Operator * op, const Symbol & arg1, const BF & arg2)
+{
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+// AVM_OS_TRACE << "compareStructure:> " << std::endl;
+// arg1.toStream(AVM_OS_TRACE);
+// arg2.toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << "compareStructure:> " << std::endl
+ << "\t" << str_header( arg1 ) << std::endl
+ << "\t" << arg2.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+
+
+ if( arg1.hasAttribute() && arg2.is< ArrayBF >())
+ {
+ ArrayBF * arg2Array = arg2.to_ptr< ArrayBF >();
+ avm_size_t offset = 0;
+
+ TableOfSymbol::const_iterator it = arg1.getAttribute()->begin();
+ TableOfSymbol::const_iterator itEnd = arg1.getAttribute()->end();
+ for( ; (it != itEnd) && (offset < arg2Array->size()) ; ++it , ++offset )
+ {
+ compareStructure(aProgram, expandCode,
+ op, (*it), arg2Array->at(offset));
+ }
+ }
+
+ else if( arg1.isTypedStructure() && arg2.is< ArrayBF >() )
+ {
+ ArrayBF * arg2Array = arg2.to_ptr< ArrayBF >();
+ avm_size_t offset = 0;
+
+ Symbol arg1Alias;
+ std::string id;
+
+ ClassTypeSpecifier * structT =
+ arg1.getTypeSpecifier()->as< ClassTypeSpecifier >();
+ TableOfSymbol::const_iterator it = structT->getSymbolData().begin();
+ TableOfSymbol::const_iterator itEnd = structT->getSymbolData().end();
+ for( ; (it != itEnd) && (offset < arg2Array->size()) ; ++it , ++offset )
+ {
+ id = (*it).getNameID();
+
+ arg1Alias = new InstanceOfData(arg1.getPointerNature(),
+ arg1.getContainer(), arg1.rawData(),
+ *(arg1.getDataPath()), (*it));
+
+ arg1Alias.updateFullyQualifiedNameID(
+ ( OSS() << arg1.getFullyQualifiedNameID() << '.' << id ),
+ ( OSS() << arg1.getNameID() << '.' << id ) );
+
+ aProgram->appendDataAlias(arg1Alias);
+
+ compareStructure(aProgram, expandCode, op,
+ arg1Alias, arg2Array->at(offset));
+ }
+ }
+
+ else
+ {
+ BFCode atomCode(op);
+
+ if( arg1.isFieldClassAttributePointer() ||
+ arg1.isFieldArrayOffsetPointer() )
+ {
+ atomCode->append( INCR_BF( arg1.getAliasTarget() ) );
+ }
+ else
+ {
+ atomCode->append( arg1 );
+ }
+
+ atomCode->append( arg2 );
+
+ expandCode->append( atomCode );
+ }
+}
+
+
+BF AvmcodeRelationalExpressionCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode compileCode = compileBinaryRvalue(aCTX, aCode,
+ TypeManager::UNIVERSAL, TypeManager::UNIVERSAL);
+
+ if( compileCode->first().is< InstanceOfData >() )
+ {
+ Symbol arg1( compileCode->first() );
+
+ if( aCTX->isNeedTypeChecking() )
+ {
+ checkArgType(aCTX, arg1.getTypeSpecifier(), compileCode->second());
+ }
+
+ if( arg1.hasTypeArrayOrStructure() )
+ {
+ if( compileCode->second().is< InstanceOfData >() )
+ {
+ Symbol arg2( compileCode->second() );
+
+ if( arg1.getTypeSpecifier() == arg2.getTypeSpecifier() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+ AVM_OS_TRACE << "AvmcodeRelationalExpressionCompiler:>\n"
+ << "\t" << str_header( arg1 ) << std::endl
+ << "\t" << str_header( arg2 ) << std::endl;
+
+ AVM_OS_TRACE << "Comparison of data structure << "
+ << compileCode->str() << " >> " << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+
+ BFCode expandCode(
+ aCode->isOpCode( AVM_OPCODE_NEQ ) ?
+ OperatorManager::OPERATOR_OR :
+ OperatorManager::OPERATOR_AND );
+
+ compareStructure(aCTX->mCompileCtx, expandCode,
+ aCode->getOperator(), arg1, arg2);
+
+ if( expandCode->singleton() && expandCode.is< AvmCode >() )
+ {
+ compileCode = expandCode->first();
+ }
+ else
+ {
+ compileCode = expandCode;
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+ AVM_OS_TRACE << "AvmcodeRelationalExpressionCompiler:result>\n"
+ << compileCode.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+ }
+ }
+
+ else if( compileCode->second().is< ArrayBF >() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+ AVM_OS_TRACE << "AvmcodeRelationalExpressionCompiler:>\n"
+ << "\t" << str_header( arg1 ) << std::endl
+ << "\t" << compileCode->second().str() << std::endl;
+
+ AVM_OS_TRACE << "Comparison of data structre << "
+ << compileCode->str() << " >> " << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+
+ BFCode expandCode(
+ aCode->isOpCode( AVM_OPCODE_NEQ ) ?
+ OperatorManager::OPERATOR_OR :
+ OperatorManager::OPERATOR_AND );
+
+ compareStructure(aCTX->mCompileCtx, expandCode,
+ aCode->getOperator(), arg1, compileCode->second());
+
+ if( expandCode->singleton() && expandCode.is< AvmCode >() )
+ {
+ compileCode = expandCode->first();
+ }
+ else
+ {
+ compileCode = expandCode;
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+ AVM_OS_TRACE << "AvmcodeRelationalExpressionCompiler:result>\n"
+ << compileCode.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+ }
+ }
+ }
+ else if( compileCode->second().is< InstanceOfData >() )
+ {
+ if( aCTX->isNeedTypeChecking() )
+ {
+ checkArgType(aCTX, compileCode->second().to_ptr<
+ InstanceOfData >()->getTypeSpecifier(), compileCode->first());
+ }
+
+ }
+
+ return( compileCode );
+}
+
+
+BF AvmcodeRelationalExpressionCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ avm_arg_processor_t processor = AVM_ARG_ARITHMETIC_LOGIC_CPU;
+
+ if( aCode->first().is< InstanceOfData >() &&
+ aCode->first().to_ptr< InstanceOfData >()->hasTypeArrayOrStructure() )
+ {
+ processor = AVM_ARG_ARRAY_RVALUE_CPU;
+ }
+ else if( aCode->second().is< InstanceOfData >() &&
+ aCode->second().to_ptr< InstanceOfData >()->hasTypeArrayOrStructure() )
+ {
+ processor = AVM_ARG_ARRAY_RVALUE_CPU;
+ }
+ else if( aCode->first().is< ArrayBF >() || aCode->second().is< ArrayBF >() )
+ {
+ processor = AVM_ARG_ARRAY_RVALUE_CPU;
+ }
+
+ return( optimizeBinaryRvalue( aCTX, aCode, TypeManager::UNIVERSAL,
+ TypeManager::UNIVERSAL, processor, TypeManager::BOOLEAN) );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE PREDICATE EXPRESSION COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeUnaryPredicateExpressionCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileUnaryRvalue(aCTX, aCode, TypeManager::BOOLEAN) );
+}
+
+
+BF AvmcodeUnaryPredicateExpressionCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( optimizeUnaryRvalue(aCTX, aCode, TypeManager::BOOLEAN,
+ AVM_ARG_ARITHMETIC_LOGIC_CPU, TypeManager::BOOLEAN) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE PREDICATE EXPRESSION COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeBinaryPredicateExpressionCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileBinaryRvalue(aCTX, aCode,
+ TypeManager::BOOLEAN, TypeManager::BOOLEAN) );
+}
+
+
+BF AvmcodeBinaryPredicateExpressionCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( optimizeBinaryRvalue(aCTX, aCode,
+ TypeManager::BOOLEAN, TypeManager::BOOLEAN,
+ AVM_ARG_ARITHMETIC_LOGIC_CPU, TypeManager::BOOLEAN) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE PREDICATE EXPRESSION COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeAssociativePredicateExpressionCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileAssociativeRvalue(aCTX, aCode, TypeManager::BOOLEAN) );
+}
+
+
+BF AvmcodeAssociativePredicateExpressionCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( optimizeAssociativeRvalue(aCTX, aCode, TypeManager::BOOLEAN,
+ AVM_ARG_ARITHMETIC_LOGIC_CPU, TypeManager::BOOLEAN) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE BITWISE EXPRESSION COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeUnaryBitwiseExpressionCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileUnaryRvalue(aCTX, aCode, TypeManager::INTEGER) );
+}
+
+
+BF AvmcodeUnaryBitwiseExpressionCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( optimizeUnaryRvalue(aCTX, aCode, TypeManager::INTEGER,
+ AVM_ARG_ARITHMETIC_LOGIC_CPU, TypeManager::INTEGER) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE BITWISE EXPRESSION COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeBinaryBitwiseExpressionCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileBinaryRvalue(aCTX, aCode,
+ TypeManager::INTEGER, TypeManager::INTEGER) );
+}
+
+
+BF AvmcodeBinaryBitwiseExpressionCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( optimizeBinaryRvalue(aCTX, aCode,
+ TypeManager::INTEGER, TypeManager::INTEGER,
+ AVM_ARG_ARITHMETIC_LOGIC_CPU, TypeManager::INTEGER) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE BITWISE EXPRESSION COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeAssociativeBitwiseExpressionCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileAssociativeRvalue(aCTX, aCode, TypeManager::INTEGER) );
+}
+
+
+BF AvmcodeAssociativeBitwiseExpressionCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( optimizeAssociativeRvalue(aCTX, aCode, TypeManager::INTEGER,
+ AVM_ARG_ARITHMETIC_LOGIC_CPU, TypeManager::INTEGER) );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE STRING UNARY EXPRESSION COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeUnaryStringExpressionCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileUnaryRvalue(aCTX, aCode, TypeManager::STRING) );
+}
+
+
+BF AvmcodeUnaryStringExpressionCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( optimizeUnaryRvalue(aCTX, aCode, TypeManager::STRING,
+ AVM_ARG_STRING_CPU, TypeManager::UNIVERSAL) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE STRING BINARY EXPRESSION COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeBinaryStringExpressionCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileBinaryRvalue(aCTX, aCode,
+ TypeManager::STRING, TypeManager::STRING) );
+}
+
+
+BF AvmcodeBinaryStringExpressionCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( optimizeBinaryRvalue(aCTX, aCode,
+ TypeManager::STRING, TypeManager::STRING,
+ AVM_ARG_STRING_CPU, TypeManager::UNIVERSAL) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE ASSOCIATIVE BINARY EXPRESSION COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeAssociativeStringExpressionCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ Operator * mainOperator = aCode->getOperator();
+ BFCode newCode( mainOperator );
+
+ BF arg;
+ AvmCode * pCode;
+
+ aCTX = aCTX->clone(TypeManager::STRING);
+
+ AvmCode::iterator itArg = aCode->begin();
+ AvmCode::iterator itEndArg = aCode->end();
+ for( ; itArg != itEndArg ; ++itArg )
+ {
+ arg = AVMCODE_COMPILER.decode_compileExpression(aCTX, *itArg);
+
+ if( arg.valid() )
+ {
+ if( (not ExpressionTypeChecker::isTyped(TypeManager::STRING, arg))
+ && arg.isnot< BuiltinForm >() )
+ {
+ arg = ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_CTOR, TypeManager::STRING, arg);
+ }
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmCode< expression > compilation error << "
+ << (*itArg).str() << " >>" << std::endl << std::endl;
+
+ newCode->append( arg );
+ continue;
+ }
+
+ if( arg.is< AvmCode >() )
+ {
+ pCode = arg.to_ptr< AvmCode >();
+
+ if( pCode->isOperator( mainOperator ) &&
+ mainOperator->isAssociative() )
+ {
+ newCode->append( pCode->getArgs() );
+ }
+ else
+ {
+ newCode->append( arg );
+ }
+ }
+ else
+ {
+ newCode->append( arg );
+ }
+ }
+
+ return( newCode );
+}
+
+
+BF AvmcodeAssociativeStringExpressionCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ Operator * mainOperator = aCode->getOperator();
+ BFCode newCode( mainOperator );
+
+ BF arg;
+ AvmCode * pCode;
+
+ AvmCode::iterator itArg = aCode->begin();
+ AvmCode::iterator itEndArg = aCode->end();
+
+ AvmInstruction * argsInstruction = newCode->newEmptyInstruction();
+
+ Vector< AvmBytecode > vectorOfArgOpcode;
+
+ for( ; itArg != itEndArg ; ++itArg )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, *itArg);
+
+ if( arg.invalid() )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmCode< expression > optimization error << "
+ << (*itArg).str() << " >>" << std::endl << std::endl;
+
+ newCode->append( arg );
+ continue;
+ }
+
+ if( arg.is< AvmCode >() )
+ {
+ pCode = arg.to_ptr< AvmCode >();
+
+ if( pCode->isOperator( mainOperator ) &&
+ mainOperator->isAssociative() )
+ {
+ newCode->append( pCode->getArgs() );
+
+ vectorOfArgOpcode.append(
+ pCode->getInstruction()->getBytecode(), pCode->size());
+ }
+ else
+ {
+ newCode->append( arg );
+
+ if( pCode->hasInstruction() )
+ {
+ vectorOfArgOpcode.append( argcodeOfExpression(aCTX, pCode) );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected expression without argcode << "
+ << pCode->strDebug() << " >> !!!"
+ << SEND_EXIT;
+
+ vectorOfArgOpcode.append( AvmBytecode(AVM_ARG_ARGUMENT_CTX,
+ AVM_ARG_SEVAL_RVALUE, AVM_ARG_EXPRESSION_KIND) );
+ }
+ vectorOfArgOpcode.back().context = AVM_ARG_ARGUMENT_CTX;
+ }
+ }
+ else
+ {
+ newCode->append( arg );
+
+ AvmBytecode argOpcode;
+ setArgcodeRValue(aCTX, argOpcode, arg, false);
+
+ argOpcode.context = AVM_ARG_ARGUMENT_CTX;
+
+ if( (not ExpressionTypeChecker::isTyped(TypeManager::STRING, arg))
+ && arg.is< BuiltinForm >() )
+ {
+ argOpcode.processor = AVM_ARG_STRING_CPU;
+ }
+
+ vectorOfArgOpcode.append( argOpcode );
+ }
+ }
+
+ argsInstruction->setMainBytecode(
+ /*context */ AVM_ARG_RETURN_CTX,
+ /*processor*/ AVM_ARG_STRING_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_EXPRESSION_KIND,
+ /*dtype */ TypeManager::STRING );
+
+ argsInstruction->computeBytecode( false , vectorOfArgOpcode );
+
+ return( newCode );
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeExpressionCompiler.h b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeExpressionCompiler.h
new file mode 100644
index 0000000..6cc74d2
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeExpressionCompiler.h
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 2 avr. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCODEEXPRESSIONCOMPILER_H_
+#define AVMCODEEXPRESSIONCOMPILER_H_
+
+#include <builder/primitive/AbstractAvmcodeCompiler.h>
+
+
+namespace sep
+{
+
+
+AVMCODE_COMPILER_EXPRESSION_OPTIMIZER_CLASS_HEADER("ARITHMETIC_LOGIC_CPU",
+ ExpressionALU, AbstractAvmcodeCompiler)
+
+ ////////////////////////////////////////////////////////////////////////////
+ // UNARY RVALUE COMPILATION STEP
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline BFCode compileUnaryRvalue(COMPILE_CONTEXT * aCTX,
+ const BFCode & aCode, const TypeSpecifier & aType)
+ {
+ return( StatementConstructor::newCode( aCode->getOperator(),
+ compileArgRvalue(aCTX, aType, aCode->first()) ));
+
+ }
+
+ BFCode optimizeUnaryRvalue(COMPILE_CONTEXT * aCTX,
+ const BFCode & aCode, BaseTypeSpecifier * aType,
+ avm_arg_processor_t aProcessor, BaseTypeSpecifier * mainType);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // BINARY RVALUE COMPILATION STEP
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline BFCode compileBinaryRvalue(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode,
+ const TypeSpecifier & aType1, const TypeSpecifier & aType2)
+ {
+ return( StatementConstructor::newCode( aCode->getOperator(),
+ compileArgRvalue(aCTX, aType1, aCode->first()),
+ compileArgRvalue(aCTX, aType2, aCode->second()) ));
+ }
+
+ BFCode optimizeBinaryRvalue(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode,
+ BaseTypeSpecifier * aType1, BaseTypeSpecifier * aType2,
+ avm_arg_processor_t aProcessor, BaseTypeSpecifier * mainType);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // ASSOCIATIVE RVALUE COMPILATION STEP
+ ////////////////////////////////////////////////////////////////////////////
+
+ BFCode compileAssociativeRvalue(COMPILE_CONTEXT * aCTX,
+ const BFCode & aCode, BaseTypeSpecifier * aType);
+
+ BFCode optimizeAssociativeRvalue(COMPILE_CONTEXT * aCTX,
+ const BFCode & aCode, BaseTypeSpecifier * aType,
+ avm_arg_processor_t aProcessor, BaseTypeSpecifier * mainType);
+
+};
+
+
+AVMCODE_COMPILER_EXPRESSION_OPTIMIZER_CLASS("UNARY_ARITHMETIC_LOGIC_CPU",
+ UnaryArithmeticExpressionALU, AvmcodeExpressionALUCompiler)
+
+AVMCODE_COMPILER_EXPRESSION_OPTIMIZER_CLASS("BINARY_ARITHMETIC_LOGIC_CPU",
+ BinaryArithmeticExpressionALU, AvmcodeExpressionALUCompiler)
+
+AVMCODE_COMPILER_EXPRESSION_OPTIMIZER_CLASS("ASSOCIATIVE_ARITHMETIC_LOGIC_CPU",
+ AssociativeArithmeticExpressionALU, AvmcodeExpressionALUCompiler)
+
+
+AVMCODE_COMPILER_EXPRESSION_OPTIMIZER_CLASS("EXPRESSION#RELATIONAL",
+ RelationalExpression, AvmcodeExpressionALUCompiler)
+
+
+AVMCODE_COMPILER_EXPRESSION_OPTIMIZER_CLASS("UNARY_EXPRESSION#PREDICATE",
+ UnaryPredicateExpression, AvmcodeExpressionALUCompiler)
+
+AVMCODE_COMPILER_EXPRESSION_OPTIMIZER_CLASS("BINARY_EXPRESSION#PREDICATE",
+ BinaryPredicateExpression, AvmcodeExpressionALUCompiler)
+
+AVMCODE_COMPILER_EXPRESSION_OPTIMIZER_CLASS("ASSOCIATIVE_EXPRESSION#PREDICATE",
+ AssociativePredicateExpression, AvmcodeExpressionALUCompiler)
+
+
+AVMCODE_COMPILER_EXPRESSION_OPTIMIZER_CLASS("UNARY_EXPRESSION#BITWISE",
+ UnaryBitwiseExpression, AvmcodeExpressionALUCompiler)
+
+AVMCODE_COMPILER_EXPRESSION_OPTIMIZER_CLASS("BINARY_EXPRESSION#BITWISE",
+ BinaryBitwiseExpression, AvmcodeExpressionALUCompiler)
+
+AVMCODE_COMPILER_EXPRESSION_OPTIMIZER_CLASS("ASSOCIATIVE_EXPRESSION#BITWISE",
+ AssociativeBitwiseExpression, AvmcodeExpressionALUCompiler)
+
+
+
+AVMCODE_COMPILER_EXPRESSION_OPTIMIZER_CLASS("UNARY_EXPRESSION#STRING",
+ UnaryStringExpression, AvmcodeExpressionALUCompiler)
+
+AVMCODE_COMPILER_EXPRESSION_OPTIMIZER_CLASS("BINARY_EXPRESSION#STRING",
+ BinaryStringExpression, AvmcodeExpressionALUCompiler)
+
+AVMCODE_COMPILER_EXPRESSION_OPTIMIZER_CLASS("ASSOCIATIVE_EXPRESSION#STRING",
+ AssociativeStringExpression, AvmcodeExpressionALUCompiler)
+
+
+
+} /* namespace sep */
+#endif /* AVMCODEEXPRESSIONCOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeGinacCompiler.cpp b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeGinacCompiler.cpp
new file mode 100644
index 0000000..352f460
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeGinacCompiler.cpp
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 12 avr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmcodeGinacCompiler.h"
+
+#include <fml/expression/AvmCode.h>
+
+
+namespace sep
+{
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeGinacCompiler.h b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeGinacCompiler.h
new file mode 100644
index 0000000..ffbccc5
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeGinacCompiler.h
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 12 avr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCODEGINACCOMPILER_H_
+#define AVMCODEGINACCOMPILER_H_
+
+#include <builder/primitive/AbstractAvmcodeCompiler.h>
+
+
+namespace sep
+{
+
+
+}
+
+#endif /* AVMCODEGINACCOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeGuardCompiler.cpp b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeGuardCompiler.cpp
new file mode 100644
index 0000000..2471b47
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeGuardCompiler.cpp
@@ -0,0 +1,217 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmcodeGuardCompiler.h"
+
+#include <builder/primitive/AvmcodeCompiler.h>
+
+#include <computer/instruction/AvmInstruction.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/ExpressionFactory.h>
+#include <fml/expression/StatementConstructor.h>
+
+#include <fml/type/TypeManager.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE GUARD COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeGuardCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( StatementConstructor::newCode(aCode->getOperator(),
+ compileArgRvalue(aCTX, TypeManager::BOOLEAN, aCode->first())) );
+}
+
+
+BFCode AvmcodeGuardCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ optimizeArgExpression(aCTX, aCode, 0);
+ argsInstruction->at(0).dtype = TypeManager::BOOLEAN;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), aCode->first());
+
+ argsInstruction->computeMainBytecode(0);
+
+
+ trivialAssignmentsSequence.clear();
+
+ ExpressionFactory::deduceTrivialAssignmentsFromConjonction(
+ aCode->first(), trivialAssignmentsSequence);
+ if( trivialAssignmentsSequence.nonempty() )
+ {
+ bool saveNeedTypeCheckingState = aCTX->mNeedTypeChecking;
+ aCTX->mNeedTypeChecking = false;
+
+ optimizeArgStatement(aCTX, trivialAssignmentsSequence);
+
+ aCTX->mNeedTypeChecking = saveNeedTypeCheckingState;
+
+AVM_IF_DEBUG_FLAG2_AND( COMPUTING , STATEMENT ,
+ AVM_DEBUG_LEVEL_OR_FLAG(HIGH , TEST_DECISION) )
+ trivialAssignmentsSequence.append(
+ StatementConstructor::newComment("end<guard>") );
+AVM_ENDIF_DEBUG_FLAG2_AND( COMPUTING , STATEMENT )
+
+ return( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+ aCode, trivialAssignmentsSequence) );
+ }
+ else
+ {
+ return( aCode );
+ }
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE TIMED GUARD COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeTimedGuardCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( StatementConstructor::newCode(aCode->getOperator(),
+ compileArgRvalue(aCTX, TypeManager::BOOLEAN, aCode->first())) );
+}
+
+BFCode AvmcodeTimedGuardCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ optimizeArgExpression(aCTX, aCode, 0);
+ argsInstruction->at(0).dtype = TypeManager::BOOLEAN;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), aCode->first());
+
+ argsInstruction->computeMainBytecode(0);
+
+
+ trivialAssignmentsSequence.clear();
+
+ ExpressionFactory::deduceTrivialAssignmentsFromConjonction(
+ aCode->first(), trivialAssignmentsSequence);
+ if( trivialAssignmentsSequence.nonempty() )
+ {
+ optimizeArgStatement(aCTX, trivialAssignmentsSequence);
+
+AVM_IF_DEBUG_FLAG2_AND( COMPUTING , STATEMENT ,
+ AVM_DEBUG_LEVEL_OR_FLAG(HIGH , TEST_DECISION) )
+ trivialAssignmentsSequence.append(
+ StatementConstructor::newComment("end<guard>") );
+AVM_ENDIF_DEBUG_FLAG2_AND( COMPUTING , STATEMENT )
+
+ return( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+ aCode, trivialAssignmentsSequence) );
+ }
+ else
+ {
+ return( aCode );
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE EVENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeEventCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( StatementConstructor::newCode(aCode->getOperator(),
+ compileArgRvalue(aCTX, TypeManager::BOOLEAN, aCode->first())) );
+}
+
+BFCode AvmcodeEventCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ optimizeArgExpression(aCTX, aCode, 0);
+ argsInstruction->at(0).dtype = TypeManager::BOOLEAN;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), aCode->first());
+
+ argsInstruction->computeMainBytecode(0);
+
+ return( aCode );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE CHECKSAT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeChecksatCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->populated() )
+ {
+ return( StatementConstructor::newCode(aCode->getOperator(),
+ compileArgRvalue(aCTX, TypeManager::STRING, aCode->first()),
+ compileArgRvalue(aCTX, TypeManager::BOOLEAN, aCode->second()) ));
+ }
+ else
+ {
+ return( StatementConstructor::newCode(aCode->getOperator(),
+ compileArgRvalue(aCTX, TypeManager::BOOLEAN, aCode->first())) );
+ }
+}
+
+BFCode AvmcodeChecksatCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ if( aCode->populated() )
+ {
+ argsInstruction->at(0).dtype = TypeManager::STRING;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), aCode->first());
+
+ optimizeArgExpression(aCTX, aCode, 1);
+ argsInstruction->at(1).dtype = TypeManager::BOOLEAN;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), aCode->second());
+ }
+ else
+ {
+ optimizeArgExpression(aCTX, aCode, 0);
+ argsInstruction->at(0).dtype = TypeManager::BOOLEAN;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), aCode->first());
+ }
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND,
+ /*dtype */ TypeManager::BOOLEAN);
+
+ return( aCode );
+}
+
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeGuardCompiler.h b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeGuardCompiler.h
new file mode 100644
index 0000000..6b6a012
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeGuardCompiler.h
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCODEGUARDCOMPILER_H_
+#define AVMCODEGUARDCOMPILER_H_
+
+#include <builder/primitive/AbstractAvmcodeCompiler.h>
+
+
+namespace sep
+{
+
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS_HEADER(
+ "GUARD", Guard, AbstractAvmcodeCompiler)
+protected:
+ BFCodeList trivialAssignmentsSequence;
+};
+
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS_HEADER(
+ "TIMED_GUARD", TimedGuard, AbstractAvmcodeCompiler)
+protected:
+ BFCodeList trivialAssignmentsSequence;
+};
+
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS(
+ "EVENT", Event, AbstractAvmcodeCompiler)
+
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS(
+ "CHECKSAT", Checksat, AbstractAvmcodeCompiler)
+
+
+}
+
+#endif /* AVMCODEGUARDCOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeInvokeCompiler.cpp b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeInvokeCompiler.cpp
new file mode 100644
index 0000000..6a50739
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeInvokeCompiler.cpp
@@ -0,0 +1,556 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 12 avr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmcodeInvokeCompiler.h"
+
+#include <parser/model/ParserUtil.h>
+
+#include <fml/executable/AvmLambda.h>
+#include <fml/executable/AvmProgram.h>
+#include <fml/executable/AvmTransition.h>
+#include <fml/executable/ExecutableForm.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/StatementConstructor.h>
+
+#include <fml/lib/AvmOperationFactory.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/infrastructure/Machine.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE INVOKE NEW INSTANCE COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeInvokeNewCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( AbstractAvmcodeCompiler::compileExpressionCode(aCTX, aCode) );
+
+//[REGRESSION]!TODO
+// return( compileStatement(aCTX, aCode) );
+}
+
+
+BF AvmcodeInvokeNewCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+//[REGRESSION]!TODO
+// BFCode newCode = optimizeStatement(aCTX, aCode);
+//
+// newCode->getInstruction()->setMainBytecode(
+// /*context */ AVM_ARG_RETURN_CTX,
+// /*processor*/ AVM_ARG_MEMORY_MACHINE_CPU,
+// /*operation*/ AVM_ARG_SEVAL_RVALUE,
+// /*operand */ AVM_ARG_EXPRESSION_KIND,
+// /*dtype */ newCode->getInstruction()->at(0).dtype);
+//
+// return( aCode );
+
+
+ BFCode optimizedCode( aCode->getOperator() );
+
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator endIt = aCode->end();
+
+ AvmInstruction * argsInstruction =
+ optimizedCode->newInstruction( aCode->size() );
+
+ InstanceOfMachine * dynamicInstance = NULL;
+
+ BF arg = (*it);
+
+ optimizedCode->append( arg );
+
+ if( arg.is< InstanceOfMachine >() )
+ {
+ dynamicInstance = arg.to_ptr< InstanceOfMachine >();
+
+ argsInstruction->at(0).set(
+ /*context */ AVM_ARG_ARGUMENT_CTX,
+ /*processor*/ AVM_ARG_NOP_CPU,
+ /*operation*/ AVM_ARG_NOP_RVALUE,
+ /*operand */ AVM_ARG_MACHINE_RID,
+ /*type */ dynamicInstance->getTypeSpecifier()
+ );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "optimizeStatement :> Unexpected << " << str_header( arg )
+ << " >> as invoke#new first argument in << "
+ << aCode->str() << " >> !!!" << std::endl;
+
+ return( aCode );
+ }
+
+ avm_size_t paramCount = dynamicInstance->getParamCount();
+ for( avm_size_t offset = 1 ;
+ (++it != endIt) && (offset <= paramCount) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype =
+ dynamicInstance->getParamType( offset-1 );
+ setArgcodeRValue(aCTX, argsInstruction->at(offset), arg);
+ }
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_ARGUMENT_CTX,
+ /*processor*/ AVM_ARG_MEMORY_MACHINE_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_EXPRESSION_KIND);
+
+ return( optimizedCode );
+
+}
+
+
+BFCode AvmcodeInvokeNewCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->size() != 1 )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "Unexpected INVOKE#NEW without only one runnable "
+ "#dynamic instance machine !!!"
+ << std::endl << aCode.toString()
+ << SEND_EXIT;
+ }
+
+ BFCode newCode = AbstractAvmcodeCompiler::compileExpressionCode(aCTX, aCode);
+
+ const BF & arg = newCode->first();
+ if( arg.is< InstanceOfMachine >() )
+ {
+ if( arg.to_ptr< InstanceOfMachine >()->
+ getSpecifier().isDesignInstanceDynamic() )
+ {
+//!![MIGRATION]: see Compiler::precompileExecutableInstanceDynamique(...)
+// modelMachine->incrPossibleDynamicInstanciationCount(1);
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "Unexpected INVOKE#NEW with one runnable "
+ "#dynamic instance machine !!!"
+ << std::endl << newCode.toString()
+ << SEND_EXIT;
+ }
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "Unexpected INVOKE#NEW without one "
+ "runnable #dynamic #instance machine !!!"
+ << std::endl << newCode.toString()
+ << SEND_EXIT;
+ }
+
+ return( newCode );
+}
+
+
+BFCode AvmcodeInvokeNewCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ const BF & arg = aCode->first();
+ if( arg.is< InstanceOfMachine >()
+ && arg.to_ptr< InstanceOfMachine >()->
+ getSpecifier().isDesignInstanceDynamic() )
+ {
+ AvmInstruction * argsInstruction = aCode->newInstruction( aCode->size() );
+
+ InstanceOfMachine * dynamicInstance = arg.to_ptr< InstanceOfMachine >();
+
+ argsInstruction->at(0).set(
+ /*context */ AVM_ARG_ARGUMENT_CTX,
+ /*processor*/ AVM_ARG_NOP_CPU,
+ /*operation*/ AVM_ARG_NOP_RVALUE,
+ /*operand */ AVM_ARG_MACHINE_RID,
+ /*type */ dynamicInstance->getTypeSpecifier()
+ );
+
+ argsInstruction->setMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_NOPS_CPU,
+ /*operation*/ AVM_ARG_NOPS_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND,
+ /*dtype */ argsInstruction->at(0).dtype);
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "optimizeStatement: Unexpected statement << invoke#new >> "
+ "argument !!!\n\t" << str_header( arg )
+ << std::endl << to_stream( aCode ) << std::endl;
+
+ return( aCode );
+ }
+
+ return( aCode );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE INVOKE ROUTINE COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeInvokeRoutineCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileStatement(aCTX, aCode) );
+}
+
+BFCode AvmcodeInvokeRoutineCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+// if( aCode->singleton && aCode->first().is< Routine >() )
+// {
+// return( ParserUtil::invokeRoutineExpression(
+// aCode->first().to_ptr< Routine >() ) );
+// }
+// else
+ if( aCode->size() < 2 )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "Expected invokable expression like "
+ "(: form invokable ...) << " << aCode.str() << " >>"
+ << std::endl << std::endl;
+
+ return( AbstractAvmcodeCompiler::compileStatement(aCTX, aCode) );
+ }
+
+ BFCode newCode;
+
+ BF arg = AVMCODE_COMPILER.decode_compileStatement(aCTX, aCode->first());
+ if( arg.invalid() )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmCode< statement > compilation error << (: "
+ << aCode->first().str() << " ...) >>"
+ << std::endl << std::endl;
+
+ return( aCode );
+ }
+
+
+ if( aCode->second().is< Operator >() )
+ {
+ newCode = StatementConstructor::newCode(
+ aCode->second().to_ptr< Operator >(), arg);
+ }
+ else if( aCode->second().isIdentifier() )
+ {
+ Operator * op = AvmOperationFactory::get(arg,
+ aCode->second().toIdentifier());
+ if( op != NULL )
+ {
+ newCode = StatementConstructor::newCode(op, arg);
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmCode< statement > compilation error << (: "
+ << arg.str() << " " << aCode->second().str() << " ...) >>"
+ << std::endl << std::endl;
+
+ return( aCode );
+ }
+ }
+
+ AvmCode::iterator itArg = aCode->begin() + 2;
+ AvmCode::iterator itEndArg = aCode->end();
+ for( ; itArg != itEndArg ; ++itArg )
+ {
+ arg = AVMCODE_COMPILER.decode_compileStatement(aCTX, *itArg);
+
+ if( arg.valid() )
+ {
+ newCode->append( arg );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmCode< statement > compilation error << "
+ << (*itArg).str() << " >>"
+ << std::endl << std::endl;
+
+ newCode->append( *itArg );
+ continue;
+ }
+ }
+
+ return( newCode );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE INVOKE TRANSITION COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeInvokeTransitionCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->size() != 1 )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "Unexpected more than one argument for invoke#transition << "
+ << aCode.str() << " >>"
+ << std::endl << std::endl;
+
+ return( AbstractAvmcodeCompiler::compileStatement(aCTX, aCode) );
+ }
+
+ BF arg = AVMCODE_COMPILER.decode_compileStatement(aCTX, aCode->first());
+ if( arg.invalid() || arg.isnot< AvmTransition >() )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmCode< statement > compilation error << (: "
+ << aCode->first().str() << " ...) >>"
+ << std::endl << std::endl;
+
+ return( aCode );
+ }
+
+ return( StatementConstructor::newCode(aCode->getOperator(), arg) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE INVOKE METHOD COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeInvokeMethodCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->size() < 2 )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "Expected invokable expression like (: form invokable ...) << "
+ << aCode.str() << " >>"
+ << std::endl << std::endl;
+
+ return( AbstractAvmcodeCompiler::compileExpression(aCTX, aCode) );
+ }
+
+ BFCode newCode;
+
+ BF arg = AVMCODE_COMPILER.decode_compileExpression(aCTX, aCode->first());
+ if( arg.invalid() )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmCode< statement > compilation error << (: "
+ << aCode->first().str() << " ...) >>"
+ << std::endl << std::endl;
+
+ return( aCode );
+ }
+
+
+ if( aCode->second().is< Operator >() )
+ {
+ newCode = StatementConstructor::newCode(
+ aCode->second().to_ptr< Operator >(), arg);
+ }
+ else if( aCode->second().isIdentifier() )
+ {
+ Operator * op = AvmOperationFactory::get(arg,
+ aCode->second().toIdentifier());
+ if( op != NULL )
+ {
+ newCode = StatementConstructor::newCode(op, arg);
+ }
+ else
+ {
+// TypeManager::get
+
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmCode< statement > compilation error << (: "
+ << arg.str() << " " << aCode->second().str() << " ...) >>"
+ << std::endl << std::endl;
+
+ return( aCode );
+ }
+ }
+
+ AvmCode::iterator itArg = aCode->begin() + 2;
+ AvmCode::iterator itEndArg = aCode->end();
+ for( ; itArg != itEndArg ; ++itArg )
+ {
+ arg = AVMCODE_COMPILER.decode_compileExpression(aCTX, *itArg);
+
+ if( arg.valid() )
+ {
+ newCode->append( arg );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmCode< statement > compilation error << "
+ << (*itArg).str() << " >>"
+ << std::endl << std::endl;
+
+ newCode->append( *itArg );
+ continue;
+ }
+ }
+
+ return( AVMCODE_COMPILER.compileExpression(aCTX, newCode) );
+}
+
+BFCode AvmcodeInvokeMethodCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->size() < 2 )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "Expected invokable expression like "
+ "(: form invokable ...) << " << aCode.str() << " >>"
+ << std::endl << std::endl;
+
+ return( AbstractAvmcodeCompiler::compileStatement(aCTX, aCode) );
+ }
+
+ BFCode newCode;
+
+ BF arg = AVMCODE_COMPILER.decode_compileExpression(aCTX, aCode->first());
+ if( arg.invalid() )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmCode< statement > compilation error << (: "
+ << aCode->first().str() << " ...) >>"
+ << std::endl << std::endl;
+
+ return( aCode );
+ }
+
+
+ if( aCode->second().is< Operator >() )
+ {
+ newCode = StatementConstructor::newCode(
+ aCode->second().to_ptr< Operator >(), arg);
+ }
+ else if( aCode->second().isIdentifier() )
+ {
+ Operator * op = AvmOperationFactory::get(arg,
+ aCode->second().toIdentifier());
+ if( op != NULL )
+ {
+ newCode = StatementConstructor::newCode(op, arg);
+ }
+ else
+ {
+// TypeManager::get
+
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmCode< statement > compilation error << (: "
+ << arg.str() << " " << aCode->second().str() << " ...) >>"
+ << std::endl << std::endl;
+
+ return( aCode );
+ }
+ }
+
+ AvmCode::iterator itArg = aCode->begin() + 2;
+ AvmCode::iterator itEndArg = aCode->end();
+ for( ; itArg != itEndArg ; ++itArg )
+ {
+ arg = AVMCODE_COMPILER.decode_compileExpression(aCTX, *itArg);
+
+ if( arg.valid() )
+ {
+ newCode->append( arg );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmCode< statement > compilation error << "
+ << (*itArg).str() << " >>"
+ << std::endl << std::endl;
+
+ newCode->append( *itArg );
+ continue;
+ }
+ }
+
+ return( AVMCODE_COMPILER.compileStatement(aCTX, newCode) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE INVOKE PROGRAM COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeInvokeProgramCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileStatement(aCTX, aCode) );
+}
+
+BFCode AvmcodeInvokeProgramCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( AbstractAvmcodeCompiler::compileStatement(aCTX, aCode) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE INVOKE FUNCTION COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeInvokeFunctionCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileStatement(aCTX, aCode) );
+}
+
+BFCode AvmcodeInvokeFunctionCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( AbstractAvmcodeCompiler::compileStatement(aCTX, aCode) );
+
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeInvokeCompiler.h b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeInvokeCompiler.h
new file mode 100644
index 0000000..5cf0764
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeInvokeCompiler.h
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 12 avr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCODEINVOKECOMPILER_H_
+#define AVMCODEINVOKECOMPILER_H_
+
+#include <builder/primitive/AbstractAvmcodeCompiler.h>
+
+
+namespace sep
+{
+
+
+AVMCODE_COMPILER_OPTIMIZER_CLASS(InvokeNew, AbstractAvmcodeCompiler)
+
+
+AVMCODE_COMPILER_CLASS(InvokeRoutine, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_STATEMENT_CLASS(
+ "INVOKE#TRANSITION", InvokeTransition, AbstractAvmcodeCompiler)
+
+
+AVMCODE_COMPILER_CLASS(InvokeMethod, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_CLASS(InvokeProgram, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_CLASS(InvokeFunction, AbstractAvmcodeCompiler)
+
+
+}
+
+#endif /* AVMCODEINVOKECOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeIteCompiler.cpp b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeIteCompiler.cpp
new file mode 100644
index 0000000..6ba4b35
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeIteCompiler.cpp
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 nov. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmcodeIteCompiler.h"
+
+#include <builder/primitive/AvmcodeCompiler.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/StatementConstructor.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE IF THE ELSE COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeIteCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode aCompiledCode( aCode->getOperator(),
+ compileArgRvalue(aCTX, TypeManager::BOOLEAN, aCode->first()),
+ compileArgRvalue(aCTX, aCode->second()) );
+
+ if( aCode->isOpCode( AVM_OPCODE_IFE ) )
+ {
+ aCompiledCode->append( compileArgRvalue(aCTX, aCode->third()) );
+ }
+
+ return( aCompiledCode );
+}
+
+BF AvmcodeIteCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optimizedCode( aCode->getOperator(),
+ AVMCODE_COMPILER.decode_optimizeExpression(aCTX, aCode->first()),
+ AVMCODE_COMPILER.decode_optimizeExpression(aCTX, aCode->second()) );
+
+ AvmInstruction * argsInstruction =
+ optimizedCode->newInstruction( aCode->size() );
+
+ argsInstruction->at(0).dtype = TypeManager::BOOLEAN;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), optimizedCode->first());
+
+ argsInstruction->at(1).dtype = TypeManager::UNIVERSAL;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), optimizedCode->second());
+
+ if( aCode->isOpCode( AVM_OPCODE_IFE ) )
+ {
+ optimizedCode->append( AVMCODE_COMPILER.decode_optimizeExpression(
+ aCTX, aCode->third()) );
+
+ argsInstruction->at(2).dtype = TypeManager::UNIVERSAL;
+ setArgcodeRValue(aCTX, argsInstruction->at(2), optimizedCode->third());
+ }
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_ARITHMETIC_LOGIC_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_EXPRESSION_KIND);
+
+ return( optimizedCode );
+}
+
+
+
+BFCode AvmcodeIteCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode aCompiledCode( aCode->getOperator(),
+ compileArgRvalue(aCTX, TypeManager::BOOLEAN, aCode->first()),
+ AVMCODE_COMPILER.decode_compileStatement(aCTX, aCode->second()) );
+
+ if( aCode->isOpCode( AVM_OPCODE_IFE ) )
+ {
+ aCompiledCode->append(
+ AVMCODE_COMPILER.decode_compileStatement(aCTX, aCode->third()) );
+ }
+
+ return( aCompiledCode );
+}
+
+
+BFCode AvmcodeIteCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optimizedCode( aCode->getOperator(),
+ AVMCODE_COMPILER.decode_optimizeExpression(aCTX, aCode->first()),
+ AVMCODE_COMPILER.decode_optimizeStatement(aCTX, aCode->second()) );
+
+ AvmInstruction * argsInstruction =
+ optimizedCode->newInstruction( aCode->size() );
+
+ argsInstruction->at(0).dtype = TypeManager::BOOLEAN;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), optimizedCode->first());
+
+ setArgcodeStatement(aCTX, argsInstruction->at(1), optimizedCode->second());
+
+ if( aCode->isOpCode( AVM_OPCODE_IFE ) )
+ {
+ optimizedCode->append( AVMCODE_COMPILER.decode_optimizeStatement(
+ aCTX, aCode->third()) );
+
+ setArgcodeStatement(aCTX, argsInstruction->at(2), optimizedCode->third());
+ }
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND);
+
+ return( optimizedCode );
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeIteCompiler.h b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeIteCompiler.h
new file mode 100644
index 0000000..e755ddb
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeIteCompiler.h
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 nov. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCODEITECOMPILER_H_
+#define AVMCODEITECOMPILER_H_
+
+#include <builder/primitive/AbstractAvmcodeCompiler.h>
+
+
+namespace sep
+{
+
+
+AVMCODE_COMPILER_OPTIMIZER_CLASS(Ite, AbstractAvmcodeCompiler)
+
+
+
+} /* namespace sep */
+#endif /* AVMCODEITECOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeJumpCompiler.cpp b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeJumpCompiler.cpp
new file mode 100644
index 0000000..2f4363e
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeJumpCompiler.cpp
@@ -0,0 +1,167 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 nov. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmcodeJumpCompiler.h"
+
+#include <fml/expression/AvmCode.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE BREAK EXECUTABLE COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeBreakCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( aCode );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE CONTINUE EXECUTABLE COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeContinueCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( aCode );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE EXIT EXECUTABLE COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeReturnCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->empty() )
+ {
+ return( aCode );
+ }
+ else
+ {
+ const AvmProgram * aProgram = aCTX->mCompileCtx->getAvmProgram();
+ for( ; aProgram != NULL ; aProgram = aProgram->getAvmProgramContainer() )
+ {
+ if( aProgram->hasReturn() )
+ {
+ break;
+ }
+ }
+
+ if( aProgram != NULL )
+ {
+ BFCode retAssignCode( OperatorManager::OPERATOR_ASSIGN,
+ aProgram->getReturn(0), compileArgRvalue(
+ aCTX->clone(aProgram->getReturnTypeSpecifier(0)),
+ aCode->first(), false) );
+
+// if( aProgram->is< ExecutableForm >() &&
+// ( aProgram->to< ExecutableForm >()->hasKindProcedure() ||
+// aProgram->to< ExecutableForm >()->hasOnReturn() ) )
+// {
+// return( StatementConstructor::newCode(
+// OperatorManager::OPERATOR_ATOMIC_SEQUENCE, retAssignCode,
+// StatementConstructor::newCode(aCode->getOperator()) ) );
+// }
+// else
+ {
+ return( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE, retAssignCode,
+ StatementConstructor::newCode(aCode->getOperator()) ) );
+ }
+ }
+ else
+ {
+ return( StatementConstructor::newCode(aCode->getOperator(),
+ compileArgRvalue(aCTX, aCode->first(), false)) );
+ }
+ }
+}
+
+BFCode AvmcodeReturnCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->nonempty() )
+ {
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ optimizeArgExpression(aCTX, aCode, 0);
+ argsInstruction->at(0).dtype = TypeManager::UNIVERSAL;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), aCode->first());
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_RETURN_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND,
+ /*dtype */ argsInstruction->at(0).dtype);
+
+// return( optimizeStatementCode(aCTX, aCode) );
+ }
+
+ return( aCode );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE EXIT EXECUTABLE COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeExitCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->empty() )
+ {
+ return( aCode );
+ }
+ else
+ {
+ return( StatementConstructor::newCode(aCode->getOperator(),
+ compileArgRvalue(aCTX, aCode->first(), false)) );
+ }
+}
+
+BFCode AvmcodeExitCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->nonempty() )
+ {
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ optimizeArgExpression(aCTX, aCode, 0);
+ argsInstruction->at(0).dtype = TypeManager::UNIVERSAL;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), aCode->first());
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_RETURN_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND,
+ /*dtype */ argsInstruction->at(0).dtype);
+
+// return( optimizeStatementCode(aCTX, aCode) );
+ }
+
+ return( aCode );
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeJumpCompiler.h b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeJumpCompiler.h
new file mode 100644
index 0000000..15b634c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeJumpCompiler.h
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 nov. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCODEJUMPCOMPILER_H_
+#define AVMCODEJUMPCOMPILER_H_
+
+#include <builder/primitive/AbstractAvmcodeCompiler.h>
+
+
+namespace sep
+{
+
+
+AVMCODE_COMPILER_STATEMENT_CLASS(
+ "BREAK", Break, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_STATEMENT_CLASS(
+ "CONTNUE", Continue, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS(
+ "RETURN", Return, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS(
+ "EXIT", Exit, AbstractAvmcodeCompiler)
+
+
+
+
+
+
+} /* namespace sep */
+#endif /* AVMCODEJUMPCOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeLambdaCompiler.cpp b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeLambdaCompiler.cpp
new file mode 100644
index 0000000..a5d6336
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeLambdaCompiler.cpp
@@ -0,0 +1,569 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 mai 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmcodeLambdaCompiler.h"
+
+#include <fml/executable/AvmLambda.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/StatementConstructor.h>
+
+#include <fml/executable/InstanceOfData.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/type/TypeManager.h>
+
+#include <fml/infrastructure/Variable.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE LAMBDA APPLY COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeLambdaApplyCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( not aCode->populated() )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Unexpected APP EXPRESSION with less than 2 arguments "
+ "for compileAvmCodeApp\n" << aCode->toString()
+ << SEND_EXIT;
+ }
+
+ BF aLambdaExpression = compileArgRvalue(aCTX, aCode->first());
+
+ if( aLambdaExpression.invalid() )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Error:> compiling LAMBDA EXPRESSION << "
+ << aCode->first().str() << " >> for compileAvmCodeApp\n"
+ << aCode->toString()
+ << SEND_EXIT;
+ }
+
+ BFCode newCode( aCode->getOperator() , aLambdaExpression);
+
+// BF appVar;
+
+ BF lambdaValue;
+
+ AvmCode::iterator itArg = aCode->begin();
+ AvmCode::iterator itEndArg = aCode->end();
+ for( ++itArg ; itArg != itEndArg ; ++itArg )
+ {
+ lambdaValue = compileArgRvalue(aCTX, (*itArg));
+ if( lambdaValue.valid() )
+ {
+ newCode->append( lambdaValue );
+ }
+ else
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Error:> compiling LAMBDA VALUE << "
+ << (*itArg).str() << " >> for compileAvmCodeApp\n"
+ << aCode->toString()
+ << SEND_EXIT;
+ }
+
+// if( (*itArg).isnot< AvmCode >() )
+// {
+// AVM_OS_EXIT( FAILED )
+// << "Unexpected AVMCODE as variable-value association << "
+// << (*itArg).str() << " >> for compileAvmCodeApp\n"
+// << aCode->toString()
+// << SEND_EXIT;
+// }
+//
+// const BFCode & appAssign = (*itArg).bfAvmCode();
+//
+// if( appAssign->isnotOperator( OperatorManager::OPERATOR_ASSIGN ) )
+// {
+// AVM_OS_EXIT( FAILED )
+// << "Unexpected OPERATOR KIND in variable-value "
+// "association << " << appAssign->str()
+// << " >> for compileAvmCodeApp\n" << aCode->toString()
+// << SEND_EXIT;
+// }
+//
+// appVar = appAssign->first();
+//
+// if( not appVar.isUFID() )
+// {
+// AVM_OS_EXIT( FAILED )
+// << "Unexpected VARIABLE KIND in variable-value "
+// "association << " << appAssign->str()
+// << " >> for compileAvmCodeApp\n" << aCode->toString()
+// << SEND_EXIT;
+// }
+//
+// const BF & lambdaVar = appAvmLambda->getSymbol( appVar.str() );
+// lambdaValue = compileArgRvalue(appAvmLambda, appAssign->second());
+//
+// if( lambdaVar.valid && lambdaValue.valid() )
+// {
+// lambdaVar->setValue( lambdaValue );
+// }
+ }
+
+ return( newCode );
+}
+
+BFCode AvmcodeLambdaApplyCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( not aCode->populated() )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Unexpected APP EXPRESSION with less than 2 arguments "
+ "for compileAvmCodeApp\n" << aCode->toString()
+ << SEND_EXIT;
+
+ return( BFCode::REF_NULL );
+ }
+
+ BF aLambdaExpression = AVMCODE_COMPILER.decode_compileStatement(aCTX,
+ aCode->first());
+
+ if( aLambdaExpression.invalid() )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Error:> compiling LAMBDA EXPRESSION << "
+ << aCode->first().str() << " >> for compileAvmCodeApp\n"
+ << aCode->toString()
+ << SEND_EXIT;
+ }
+
+ BFCode newCode( aCode->getOperator() , aLambdaExpression);
+
+// BF appVar;
+
+// InstanceOfData * lambdaVar = NULL;
+ BF lambdaValue;
+
+ AvmCode::iterator itArg = aCode->begin();
+ AvmCode::iterator itEndArg = aCode->end();
+ for( ++itArg ; itArg != itEndArg ; ++itArg )
+ {
+ lambdaValue = AVMCODE_COMPILER.decode_compileStatement(aCTX, (*itArg));
+ if( lambdaValue.valid() )
+ {
+ newCode->append( lambdaValue );
+ }
+ else
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Error:> compiling LAMBDA VALUE << "
+ << (*itArg).str() << " >> for compileAvmCodeApp\n"
+ << aCode->toString()
+ << SEND_EXIT;
+ }
+
+// if( (*itArg).isnot< AvmCode >() )
+// {
+// AVM_OS_EXIT( FAILED )
+// << "Unexpected AVMCODE as variable-value "
+// "association << " << (*itArg).str()
+// << " >> for compileAvmCodeApp\n" << aCode->toString()
+// << SEND_EXIT;
+// }
+//
+// const BFCode & appAssign = (*itArg).bfCode();
+//
+// if( appAssign->isnotOperator( OperatorManager::OPERATOR_ASSIGN ) )
+// {
+// AVM_OS_EXIT( FAILED )
+// << "Unexpected OPERATOR KIND in variable-value "
+// "association << " << appAssign->str()
+// << " >> for compileAvmCodeApp\n" << aCode->toString()
+// << SEND_EXIT;
+// }
+//
+// appVar = appAssign->first();
+//
+// if( not appVar.isUFID() )
+// {
+// AVM_OS_EXIT( FAILED )
+// << "Unexpected VARIABLE KIND in variable-value "
+// "association << " << appAssign->str()
+// << " >> for compileAvmCodeApp\n" << aCode->toString()
+// << SEND_EXIT;
+// }
+//
+// const BF & lambdaVar = appAvmLambda->getSymbol( appVar.str() );
+// lambdaValue = AVMCODE_COMPILER.decode_compileStatement(appAvmLambda,
+// appAssign->second());
+//
+// if( lambdaVar.valid() && lambdaValue.valid() )
+// {
+// lambdaVar.to_ptr< InstanceOfData >()->setValue( lambdaValue );
+// }
+ }
+
+ return( newCode );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE LAMBDA LET COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeLambdaLetCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( not aCode->populated() )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Unexpected LAMBDA EXPRESSION without argument for "
+ "compileAvmCodeLet\n" << aCode->toString()
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+
+ avm_size_t varCount = aCode->size() - 1;
+
+ AvmLambda * letAvmLambda = new AvmLambda(
+ aCTX->mCompileCtx, varCount, AVM_LAMBDA_LET_NATURE);
+
+ BF bfLetLambda( letAvmLambda );
+
+ BF letVar;
+ BF letValue;
+
+ BFCode letAssign;
+ BF letVarForm;
+ Variable * letVariable;
+ InstanceOfData * lambdaInstance;
+
+ AvmCode::iterator itArg = aCode->begin();
+ for( avm_size_t offset = 0 ; offset < varCount ; ++itArg , ++offset )
+ {
+ if( (*itArg).is< AvmCode >() )
+ {
+ letAssign = (*itArg).bfCode();
+
+ if( letAssign->getOperator() == OperatorManager::OPERATOR_ASSIGN )
+ {
+ letVar = letAssign->first();
+
+ letValue = letAssign->second();
+ }
+ else
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Unexpected OPERATOR KIND in variable-value "
+ "association << " << letAssign->str()
+ << " >> for compileAvmCodeLet\n" << aCode->toString()
+ << SEND_EXIT;
+ }
+ }
+ else
+ {
+ letVar = (*itArg);
+
+ letValue.destroy();
+ letAssign.destroy();
+ }
+
+
+ if( letVar.isIdentifier() || letVar.isUfi() ||
+ letVar.is< UniFormIdentifier >() )
+ {
+ letVarForm = BF( letVariable = new Variable(
+ const_cast< ObjectElement * >(
+ aCTX->mCompileCtx->getAstElement() ),
+ TypeManager::UNIVERSAL, letVar.str(), letVar.str()) );
+
+ lambdaInstance = new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ letAvmLambda, letVariable, TypeManager::UNIVERSAL,
+ offset, Modifier::PROPERTY_PARAMETER_MODIFIER );
+
+ letAvmLambda->setData(offset, lambdaInstance);
+
+ if( letValue.valid() )
+ {
+ letAssign->set(0, letVarForm);
+
+ lambdaInstance->setValue( compileArgRvalue(aCTX, letValue) );
+ }
+ else
+ {
+ aCode->set(offset, letVarForm);
+ }
+ }
+
+ else
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Unexpected LAMBDA VARIABLE << " << letVar.str()
+ << " >> for compileAvmCodelet\n" << aCode->toString()
+ << SEND_EXIT;
+ }
+ }
+
+ letAvmLambda->setExpression( compileArgRvalue(
+ aCTX->newCTX(letAvmLambda, aCTX->mRuntimeCtx), aCode->last()) );
+
+ return( bfLetLambda );
+// return( ExpressionConstructor::newCode(
+// OperatorManager::OPERATOR_INVOKE_LAMBDA_LET, letAvmLambda) );
+}
+
+BFCode AvmcodeLambdaLetCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( not aCode->populated() )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Unexpected LAMBDA EXPRESSION without argument "
+ "for compileAvmCodeLet\n" << aCode->toString()
+ << SEND_EXIT;
+
+ return( BFCode::REF_NULL );
+ }
+
+ avm_size_t varCount = aCode->size() - 1;
+
+ AvmLambda * letAvmLambda = new AvmLambda(
+ aCTX->mCompileCtx, varCount, AVM_LAMBDA_LET_NATURE);
+
+ BF bfLetLambda( letAvmLambda );
+
+ BF letVar;
+ BF letValue;
+
+ BFCode letAssign;
+ BF letVarForm;
+ Variable * letVariable;
+ InstanceOfData * lambdaInstance;
+
+ AvmCode::iterator itArg = aCode->begin();
+ for( avm_size_t offset = 0 ; offset < varCount ; ++itArg , ++offset )
+ {
+ if( (*itArg).is< AvmCode >() )
+ {
+ letAssign = (*itArg).bfCode();
+
+ if( letAssign->getOperator() == OperatorManager::OPERATOR_ASSIGN )
+ {
+ letVar = letAssign->first();
+
+ letValue = letAssign->second();
+ }
+ else
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Unexpected OPERATOR KIND in variable-value "
+ "association << " << letAssign->str()
+ << " >> for compileAvmCodeLet\n" << aCode->toString()
+ << SEND_EXIT;
+ }
+ }
+ else
+ {
+ letVar = (*itArg);
+
+ letValue.destroy();
+ letAssign.destroy();
+ }
+
+
+ if( letVar.isIdentifier() || letVar.isUfi() ||
+ letVar.is< UniFormIdentifier >() )
+ {
+ letVarForm = BF( letVariable = new Variable(
+ const_cast< ObjectElement * >(
+ aCTX->mCompileCtx->getAstElement() ),
+ TypeManager::UNIVERSAL, letVar.str(), letVar.str()) );
+
+ lambdaInstance = new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ letAvmLambda, letVariable, TypeManager::UNIVERSAL,
+ offset, Modifier::PROPERTY_PARAMETER_MODIFIER );
+ letAvmLambda->setData(offset, lambdaInstance);
+
+ if( letValue.valid() )
+ {
+ letAssign->set(0, letVarForm);
+
+ lambdaInstance->setValue(
+ AVMCODE_COMPILER.decode_compileStatement(aCTX, letValue) );
+ }
+ else
+ {
+ aCode->set(offset, letVarForm);
+ }
+ }
+
+ else
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Unexpected LAMBDA VARIABLE << " << letVar.str()
+ << " >> for compileAvmCodelet\n" << aCode->toString()
+ << SEND_EXIT;
+ }
+ }
+
+ letAvmLambda->setExpression( AVMCODE_COMPILER.decode_compileStatement(
+ aCTX->newCTX(letAvmLambda, aCTX->mRuntimeCtx), aCode->last()) );
+
+ return( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_INVOKE_LAMBDA_LET, bfLetLambda) );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE LAMBDA EXPRESSION COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeLambdaExprCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->empty() )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Unexpected LAMBDA EXPRESSION without argument "
+ "for compileAvmCodeLambda\n" << aCode->toString()
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+
+ avm_size_t varCount = aCode->size() - 1;
+
+ AvmLambda * funAvmLambda = new AvmLambda(
+ aCTX->mCompileCtx, varCount, AVM_LAMBDA_FUN_NATURE);
+
+ BF bfFunLambda( funAvmLambda );
+
+ BF lambdaVar;
+ BF lambdaVarForm;
+ Variable * lambdaVariable;
+ InstanceOfData * lambdaInstance;
+
+ AvmCode::iterator itArg = aCode->begin();
+ for( avm_size_t offset = 0 ; offset < varCount ; ++itArg , ++offset )
+ {
+ lambdaVar = (*itArg);
+
+ if( lambdaVar.isIdentifier() || lambdaVar.isUfi() ||
+ lambdaVar.is< UniFormIdentifier >() )
+ {
+ lambdaVarForm = BF( lambdaVariable = new Variable(
+ const_cast< ObjectElement * >(
+ aCTX->mCompileCtx->getAstElement() ),
+ TypeManager::UNIVERSAL, lambdaVar.str(), lambdaVar.str()) );
+ aCode->set(offset, lambdaVarForm);
+
+ lambdaInstance = new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ funAvmLambda, lambdaVariable, TypeManager::UNIVERSAL,
+ offset, Modifier::PROPERTY_PARAMETER_MODIFIER );
+
+ funAvmLambda->setData(offset, lambdaInstance);
+ }
+ else
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Unexpected LAMBDA VARIABLE for "
+ "compileAvmCodeLambda\n" << aCode->toString()
+ << SEND_EXIT;
+ }
+ }
+
+ funAvmLambda->setExpression( compileArgRvalue(
+ aCTX->newCTX(funAvmLambda, aCTX->mRuntimeCtx), aCode->last()) );
+
+ return( bfFunLambda );
+// return( ExpressionConstructor::newCode(
+// OperatorManager::OPERATOR_INVOKE_LAMBDA_APPLY, bfFunLambda) );
+}
+
+BFCode AvmcodeLambdaExprCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ if( aCode->empty() )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Unexpected LAMBDA EXPRESSION without argument "
+ "for compileAvmCodeLambda\n" << aCode->toString()
+ << SEND_EXIT;
+
+ return( BFCode::REF_NULL );
+ }
+
+ avm_size_t varCount = aCode->size() - 1;
+
+ AvmLambda * funAvmLambda = new AvmLambda(
+ aCTX->mCompileCtx, varCount, AVM_LAMBDA_FUN_NATURE);
+
+ BF bfFunLambda( funAvmLambda );
+
+ BF lambdaVar;
+ BF lambdaVarForm;
+ Variable * lambdaVariable;
+ InstanceOfData * lambdaInstance;
+
+ AvmCode::iterator itArg = aCode->begin();
+ for( avm_size_t offset = 0 ; offset < varCount ; ++itArg , ++offset )
+ {
+ lambdaVar = (*itArg);
+
+ if( lambdaVar.isIdentifier() || lambdaVar.isUfi() ||
+ lambdaVar.is< UniFormIdentifier >() )
+ {
+ lambdaVarForm = BF( lambdaVariable = new Variable(
+ const_cast< ObjectElement * >(
+ aCTX->mCompileCtx->getAstElement() ),
+ TypeManager::UNIVERSAL, lambdaVar.str(), lambdaVar.str()) );
+ aCode->set(offset, lambdaVarForm);
+
+ lambdaInstance = new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ funAvmLambda, lambdaVariable, TypeManager::UNIVERSAL,
+ offset, Modifier::PROPERTY_PARAMETER_MODIFIER );
+
+ funAvmLambda->setData(offset, lambdaInstance);
+ }
+ else
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Unexpected LAMBDA VARIABLE for "
+ "compileAvmCodeLambda\n" << aCode->toString()
+ << SEND_EXIT;
+ }
+ }
+
+ BF lambdaCode = AVMCODE_COMPILER.decode_compileStatement(
+ aCTX->newCTX(funAvmLambda, aCTX->mRuntimeCtx), aCode->last());
+
+ funAvmLambda->setExpression( lambdaCode );
+
+ return( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_INVOKE_LAMBDA_APPLY, bfFunLambda) );
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeLambdaCompiler.h b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeLambdaCompiler.h
new file mode 100644
index 0000000..2add33f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeLambdaCompiler.h
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 mai 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCODELAMBDACOMPILER_H_
+#define AVMCODELAMBDACOMPILER_H_
+
+#include <builder/primitive/AbstractAvmcodeCompiler.h>
+
+
+namespace sep
+{
+
+
+AVMCODE_COMPILER_CLASS(LambdaApply, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_CLASS(LambdaLet, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_CLASS(LambdaExpr, AbstractAvmcodeCompiler)
+
+
+}
+
+#endif /* AVMCODELAMBDACOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeLookupExprCompiler.cpp b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeLookupExprCompiler.cpp
new file mode 100644
index 0000000..ff5d49c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeLookupExprCompiler.cpp
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 1 mai 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmcodeLookupExprCompiler.h"
+
+#include <fml/expression/AvmCode.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE LOOKUP EXPRESSION COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeLookupExpressionCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileExpressionCode(aCTX, aCode) );
+}
+
+BF AvmcodeLookupExpressionCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( optimizeExpressionCode(aCTX, aCode) );
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeLookupExprCompiler.h b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeLookupExprCompiler.h
new file mode 100644
index 0000000..98525b5
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeLookupExprCompiler.h
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 1 mai 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCODELOOKUPEXPRCOMPILER_H_
+#define AVMCODELOOKUPEXPRCOMPILER_H_
+
+#include <builder/primitive/AbstractAvmcodeCompiler.h>
+
+
+namespace sep
+{
+
+
+AVMCODE_COMPILER_EXPRESSION_OPTIMIZER_CLASS(
+ "LOOKUP", LookupExpression, AbstractAvmcodeCompiler)
+
+
+
+}
+
+#endif /* AVMCODELOOKUPEXPRCOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeLoopCompiler.cpp b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeLoopCompiler.cpp
new file mode 100644
index 0000000..94ee972
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeLoopCompiler.cpp
@@ -0,0 +1,181 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 nov. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmcodeLoopCompiler.h"
+
+#include <builder/primitive/AvmcodeCompiler.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/StatementConstructor.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE FOR COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeForCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( StatementConstructor::newCode(aCode->getOperator(),
+ AVMCODE_COMPILER.decode_compileStatement(aCTX, aCode->first()),
+ compileArgRvalue(aCTX, TypeManager::BOOLEAN, aCode->second()),
+ AVMCODE_COMPILER.decode_compileStatement(aCTX, aCode->third()),
+ AVMCODE_COMPILER.decode_compileStatement(aCTX, aCode->fourth())) );
+}
+
+
+BFCode AvmcodeForCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optimizedCode(aCode->getOperator(),
+ AVMCODE_COMPILER.decode_optimizeStatement(aCTX, aCode->first()),
+ AVMCODE_COMPILER.decode_optimizeExpression(aCTX, aCode->second()),
+ AVMCODE_COMPILER.decode_optimizeStatement(aCTX, aCode->third()),
+ AVMCODE_COMPILER.decode_optimizeStatement(aCTX, aCode->fourth()) );
+
+ AvmInstruction * argsInstruction = optimizedCode->genInstruction();
+
+ setArgcodeStatement(aCTX, argsInstruction->at(0), optimizedCode->first());
+
+ argsInstruction->at(1).dtype = TypeManager::BOOLEAN;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), optimizedCode->second());
+
+ setArgcodeStatement(aCTX, argsInstruction->at(2), optimizedCode->third());
+
+ setArgcodeStatement(aCTX, argsInstruction->at(3), optimizedCode->fourth());
+
+ argsInstruction->setMainBytecode(
+ /*operation*/ AVM_ARG_NOPS,
+ /*operand */ AVM_ARG_STATEMENT_KIND );
+
+ return( optimizedCode );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE FOREACH COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeForeachCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( StatementConstructor::newCode( aCode->getOperator(),
+ compileArgLvalue(aCTX, aCode->first()),
+ compileArgRvalue(aCTX, aCode->second()),
+ AVMCODE_COMPILER.decode_compileStatement(aCTX, aCode->third()) ) );
+}
+
+
+BFCode AvmcodeForeachCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optimizedCode(aCode->getOperator(),
+ AVMCODE_COMPILER.decode_optimizeExpression(aCTX, aCode->first()),
+ AVMCODE_COMPILER.decode_optimizeExpression(aCTX, aCode->second()),
+ AVMCODE_COMPILER.decode_optimizeStatement(aCTX, aCode->third()) );
+
+ AvmInstruction * argsInstruction = optimizedCode->genInstruction();
+
+ setArgcodeLValue(aCTX, argsInstruction->at(0), optimizedCode->first(), false);
+
+ setArgcodeRValue(aCTX, argsInstruction->at(1), optimizedCode->second());
+
+ setArgcodeStatement(aCTX, argsInstruction->at(2), optimizedCode->third());
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_VALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND);
+
+ return( optimizedCode );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE WHILE DO COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeWhileDoCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( StatementConstructor::newCode(aCode->getOperator(),
+ compileArgRvalue(aCTX, TypeManager::BOOLEAN, aCode->first()),
+ AVMCODE_COMPILER.decode_compileStatement(aCTX, aCode->second())) );
+}
+
+
+BFCode AvmcodeWhileDoCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optimizedCode(StatementConstructor::newCode(aCode->getOperator(),
+ AVMCODE_COMPILER.decode_optimizeExpression(aCTX, aCode->first()),
+ AVMCODE_COMPILER.decode_optimizeStatement(aCTX, aCode->second())) );
+
+ AvmInstruction * argsInstruction = optimizedCode->genInstruction();
+
+ argsInstruction->at(0).dtype = TypeManager::BOOLEAN;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), optimizedCode->first());
+
+ setArgcodeStatement(aCTX, argsInstruction->at(1), optimizedCode->second());
+
+ argsInstruction->setMainBytecode(
+ /*operation*/ AVM_ARG_NOPS,
+ /*operand */ AVM_ARG_STATEMENT_KIND );
+
+ return( optimizedCode );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE DO WHILE COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BFCode AvmcodeDoWhileCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( StatementConstructor::newCode(aCode->getOperator(),
+ AVMCODE_COMPILER.decode_compileStatement(aCTX, aCode->first()),
+ compileArgRvalue(aCTX, TypeManager::BOOLEAN, aCode->second())) );
+}
+
+
+BFCode AvmcodeDoWhileCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optimizedCode(StatementConstructor::newCode(aCode->getOperator(),
+ AVMCODE_COMPILER.decode_optimizeStatement(aCTX, aCode->first()),
+ AVMCODE_COMPILER.decode_optimizeExpression(aCTX, aCode->second())) );
+
+ AvmInstruction * argsInstruction = optimizedCode->genInstruction();
+
+ setArgcodeStatement(aCTX, argsInstruction->at(0), optimizedCode->first());
+
+ argsInstruction->at(1).dtype = TypeManager::BOOLEAN;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), optimizedCode->second());
+
+ argsInstruction->setMainBytecode(
+ /*operation*/ AVM_ARG_NOPS,
+ /*operand */ AVM_ARG_STATEMENT_KIND );
+
+ return( optimizedCode );
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeLoopCompiler.h b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeLoopCompiler.h
new file mode 100644
index 0000000..f63dc37
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeLoopCompiler.h
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 nov. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCODELOOPCOMPILER_H_
+#define AVMCODELOOPCOMPILER_H_
+
+#include <builder/primitive/AbstractAvmcodeCompiler.h>
+
+
+namespace sep
+{
+
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS("LOOP#FOR", For, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS("LOOP#FOREACH", Foreach, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS("LOOP#WHILE_DO", WhileDo, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_STATEMENT_OPTIMIZER_CLASS("LOOP#DO_WHILE", DoWhile, AbstractAvmcodeCompiler)
+
+
+
+
+} /* namespace sep */
+#endif /* AVMCODELOOPCOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeMachineStatusCompiler.cpp b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeMachineStatusCompiler.cpp
new file mode 100644
index 0000000..19b6cc0
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeMachineStatusCompiler.cpp
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 1 mai 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmcodeMachineStatusCompiler.h"
+
+#include <fml/expression/AvmCode.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE MACHINE STATUS EXPRESSION COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeMachineStatusExpressionCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode aCompiledCode( aCode->getOperator(),
+ compileArgRvalue(aCTX, TypeManager::OPERATOR, aCode->first()),
+ compileArgRvalue(aCTX, TypeManager::MACHINE , aCode->second()) );
+
+ return( aCompiledCode );
+}
+
+
+BF AvmcodeMachineStatusExpressionCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ optimizeArgExpression(aCTX, aCode, 0);
+ optimizeArgExpression(aCTX, aCode, 1);
+
+ if( aCode->first().isnot< Operator >() && aCode->second().is< Operator >() )
+ {
+ std::swap(aCode->first(), aCode->second());
+ }
+
+ argsInstruction->at(0).dtype = TypeManager::OPERATOR;
+ setArgcodeRValue(aCTX, argsInstruction->at(0), aCode->first());
+
+ argsInstruction->at(1).dtype = TypeManager::MACHINE;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), aCode->second());
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_RETURN_CTX,
+ /*processor*/ AVM_ARG_MEMORY_MACHINE_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_EXPRESSION_KIND,
+ /*dtype */ TypeManager::BOOLEAN);
+
+ return( aCode );
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeMachineStatusCompiler.h b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeMachineStatusCompiler.h
new file mode 100644
index 0000000..4260072
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeMachineStatusCompiler.h
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 1 mai 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCODEMACHINESTATUSCOMPILER_H_
+#define AVMCODEMACHINESTATUSCOMPILER_H_
+
+#include <builder/primitive/AbstractAvmcodeCompiler.h>
+
+
+namespace sep
+{
+
+
+AVMCODE_COMPILER_EXPRESSION_OPTIMIZER_CLASS(
+ "MACHINE STATUS", MachineStatusExpression, AbstractAvmcodeCompiler)
+
+
+}
+
+#endif /* AVMCODEMACHINESTATUSCOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeMathFunctionCompiler.cpp b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeMathFunctionCompiler.cpp
new file mode 100644
index 0000000..1101a12
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeMathFunctionCompiler.cpp
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 29 avr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmcodeMathFunctionCompiler.h"
+
+#include <fml/type/TypeManager.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE ARITHMETIC EXPRESSION COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeMathFunctionCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileExpressionCode(aCTX, aCode) );
+}
+
+BF AvmcodeMathFunctionCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optCode = optimizeExpressionCode(aCTX, aCode, AVM_ARG_EXPRESSION_KIND) ;
+
+ optCode->getInstruction()->setMainBytecode(
+ /*context */ AVM_ARG_RETURN_CTX,
+ /*processor*/ AVM_ARG_ARITHMETIC_LOGIC_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_EXPRESSION_KIND,
+ /*dtype */ TypeManager::UNIVERSAL );
+
+
+ return( optCode );
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeMathFunctionCompiler.h b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeMathFunctionCompiler.h
new file mode 100644
index 0000000..589b21a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeMathFunctionCompiler.h
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 29 avr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCODEMATHFUNCTIONCOMPILER_H_
+#define AVMCODEMATHFUNCTIONCOMPILER_H_
+
+#include <builder/primitive/AbstractAvmcodeCompiler.h>
+
+
+namespace sep
+{
+
+
+AVMCODE_COMPILER_EXPRESSION_OPTIMIZER_CLASS("MATH_FUCTION",
+ MathFunction, AbstractAvmcodeCompiler)
+
+
+}
+
+#endif /* AVMCODEMATHFUNCTIONCOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeMetaStatementCompiler.cpp b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeMetaStatementCompiler.cpp
new file mode 100644
index 0000000..9b7713d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeMetaStatementCompiler.cpp
@@ -0,0 +1,172 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 14 mars 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmcodeMetaStatementCompiler.h"
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE NOP COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeNothingCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( aCode );
+}
+
+BF AvmcodeNothingCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( aCode );
+}
+
+
+BFCode AvmcodeNothingCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( aCode );
+}
+
+BFCode AvmcodeNothingCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( aCode );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE INFORMAL EXPRESSION COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeInformalExpressionCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( AbstractAvmcodeCompiler::compileAvmcode(aCTX, aCode) );
+}
+
+
+BFCode AvmcodeInformalExpressionCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( AbstractAvmcodeCompiler::compileAvmcode(aCTX, aCode) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE TRACE EXPRESSION COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeTraceExpressionCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( AbstractAvmcodeCompiler::compileAvmcode(aCTX, aCode) );
+}
+
+
+BFCode AvmcodeTraceExpressionCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( AbstractAvmcodeCompiler::compileAvmcode(aCTX, aCode) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE DEBUG EXPRESSION COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeDebugExpressionCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( AbstractAvmcodeCompiler::compileAvmcode(aCTX, aCode) );
+}
+
+
+BFCode AvmcodeDebugExpressionCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( AbstractAvmcodeCompiler::compileAvmcode(aCTX, aCode) );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE COMMENT EXPRESSION COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeCommentExpressionCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode newCode = aCode;
+
+ return( newCode );
+}
+
+
+BFCode AvmcodeCommentExpressionCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode newCode = aCode;
+
+ return( newCode );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE META EVAL STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeMetaEvalStatementCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( AbstractAvmcodeCompiler::compileAvmcode(aCTX, aCode) );
+}
+
+
+BFCode AvmcodeMetaEvalStatementCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( AbstractAvmcodeCompiler::compileAvmcode(aCTX, aCode) );
+}
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE META RUN STATEMENT COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeMetaRunStatementCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( AbstractAvmcodeCompiler::compileAvmcode(aCTX, aCode) );
+}
+
+
+BFCode AvmcodeMetaRunStatementCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( AbstractAvmcodeCompiler::compileAvmcode(aCTX, aCode) );
+}
+
+
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeMetaStatementCompiler.h b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeMetaStatementCompiler.h
new file mode 100644
index 0000000..bf4a3c7
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeMetaStatementCompiler.h
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 14 mars 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCODEMETASTATEMENTCOMPILER_H_
+#define AVMCODEMETASTATEMENTCOMPILER_H_
+
+#include <builder/primitive/AbstractAvmcodeCompiler.h>
+
+
+namespace sep
+{
+
+
+AVMCODE_COMPILER_OPTIMIZER_CLASS(Nothing, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_CLASS(InformalExpression, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_CLASS(TraceExpression, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_CLASS(DebugExpression, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_CLASS(CommentExpression, AbstractAvmcodeCompiler)
+
+
+AVMCODE_COMPILER_CLASS(MetaEvalStatement, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_CLASS(MetaRunStatement, AbstractAvmcodeCompiler)
+
+
+
+} /* namespace sep */
+#endif /* AVMCODEMETASTATEMENTCOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeQueueCompiler.cpp b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeQueueCompiler.cpp
new file mode 100644
index 0000000..1a8d449
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeQueueCompiler.cpp
@@ -0,0 +1,482 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 12 avr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmcodeQueueCompiler.h"
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/ExpressionTypeChecker.h>
+
+#include <fml/type/TypeManager.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE PUSH COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodePushCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileStatement(aCTX, aCode) );
+}
+
+BF AvmcodePushCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( optimizeStatement(aCTX, aCode) );
+}
+
+BFCode AvmcodePushCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileExpressionCode(aCTX, aCode) );
+}
+
+BFCode AvmcodePushCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator endIt = aCode->end();
+ BFCode optimizedCode( aCode->getOperator() );
+
+ AvmInstruction * argsInstruction =
+ optimizedCode->newInstruction( aCode->size() );
+
+ BF arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ setArgcodeContainerWValue(aCTX, argsInstruction->at(0), arg);
+
+ if( argsInstruction->at(0).dtype->isTypedBuffer() )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*(++it)));
+ optimizedCode->append( arg );
+
+ if( ExpressionTypeChecker::isTyped(TypeManager::MESSAGE, arg) )
+ {
+ argsInstruction->at(1).dtype = TypeManager::MESSAGE;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), arg, false);
+ }
+ else if( ExpressionTypeChecker::isTyped(TypeManager::PORT, arg) )
+ {
+ argsInstruction->at(1).dtype = TypeManager::PORT;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), arg, false);
+
+ if( arg.is< InstanceOfPort >() )
+ {
+ InstanceOfPort * aPort = arg.to_ptr< InstanceOfPort >();
+ avm_size_t paramCount = aPort->getParameterCount();
+
+ for( avm_size_t offset = 2 ;
+ (++it != endIt) && (offset <= paramCount) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = aPort->getParameterType(offset-1);
+ setArgcodeRValue(aCTX, argsInstruction->at(offset), arg);
+ }
+ }
+ else for( avm_size_t offset = 2 ; (++it != endIt) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = TypeManager::UNIVERSAL;
+ setArgcodeRValue(aCTX, argsInstruction->at(offset), (*it), false);
+ }
+ }
+ else for( avm_size_t offset = 2 ; (++it != endIt) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = TypeManager::UNIVERSAL;
+ setArgcodeRValue(aCTX, argsInstruction->at(offset), (*it), false);
+ }
+ }
+
+ else if( argsInstruction->at(0).dtype->hasTypeCollection() )
+ {
+ BaseTypeSpecifier * aTS = argsInstruction->at(0).dtype->
+ as< ContainerTypeSpecifier >()->getContentsTypeSpecifier();
+
+ for( avm_offset_t offset = 1 ; (++it != endIt) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(
+ aCTX->clone(aTS), (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = aTS;
+ setArgcodeRValue(aCTX, argsInstruction->at(offset), arg);
+ }
+ }
+
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND,
+ /*dtype */ argsInstruction->at(0).dtype);
+
+ return( optimizedCode );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE TOP COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeAssignTopCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileStatement(aCTX, aCode) );
+}
+
+BF AvmcodeAssignTopCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optCode = optimizeStatement(aCTX, aCode);
+
+ optCode->getInstruction()->setMainOperand( AVM_ARG_EXPRESSION_KIND );
+
+ return( optCode );
+}
+
+
+BFCode AvmcodeAssignTopCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileExpressionCode(aCTX, aCode) );
+}
+
+BFCode AvmcodeAssignTopCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator endIt = aCode->end();
+ BFCode optimizedCode( aCode->getOperator() );
+
+ AvmInstruction * argsInstruction =
+ optimizedCode->newInstruction( aCode->size() );
+
+ BF arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ setArgcodeContainerWValue(aCTX, argsInstruction->at(0), arg);
+
+ if( argsInstruction->at(0).dtype->isTypedBuffer() )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*(++it)));
+ optimizedCode->append( arg );
+
+ if( ExpressionTypeChecker::isTyped(TypeManager::MESSAGE, arg) )
+ {
+ argsInstruction->at(1).dtype = TypeManager::MESSAGE;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), arg, false);
+ }
+ else if( ExpressionTypeChecker::isTyped(TypeManager::PORT, arg) )
+ {
+ argsInstruction->at(1).dtype = TypeManager::PORT;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), arg, false);
+
+ if( arg.is< InstanceOfPort >() )
+ {
+ InstanceOfPort * aPort = arg.to_ptr< InstanceOfPort >();
+ avm_size_t paramCount = aPort->getParameterCount();
+
+ for( avm_size_t offset = 2 ;
+ (++it != endIt) && (offset <= paramCount) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = aPort->getParameterType(offset-1);
+ setArgcodeLValue(aCTX, argsInstruction->at(offset), arg);
+ }
+ }
+ else for( avm_size_t offset = 2 ; (++it != endIt) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = TypeManager::UNIVERSAL;
+ setArgcodeLValue(aCTX, argsInstruction->at(offset), (*it), false);
+ }
+ }
+ else for( avm_size_t offset = 2 ; (++it != endIt) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = TypeManager::UNIVERSAL;
+ setArgcodeLValue(aCTX, argsInstruction->at(offset), (*it), false);
+ }
+ }
+
+ else if( argsInstruction->at(0).dtype->hasTypeCollection() )
+ {
+ BaseTypeSpecifier * aTS = argsInstruction->at(0).dtype->
+ as< ContainerTypeSpecifier >()->getContentsTypeSpecifier();
+
+ for( avm_offset_t offset = 1 ; (++it != endIt) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(
+ aCTX->clone(aTS), (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = aTS;
+ setArgcodeRValue(aCTX, argsInstruction->at(offset), arg);
+ }
+ }
+
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND,
+ /*dtype */ argsInstruction->at(0).dtype);
+
+ return( optimizedCode );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE TOP COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeTopCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileExpressionCode(aCTX, aCode) );
+}
+
+BF AvmcodeTopCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optCode = optimizeExpressionCode(aCTX, aCode, AVM_ARG_EXPRESSION_KIND) ;
+
+ optCode->getInstruction()->setMainProcessor( AVM_ARG_QUEUE_CPU );
+
+ return( optCode );
+}
+
+
+BFCode AvmcodeTopCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileExpressionCode(aCTX, aCode) );
+}
+
+BFCode AvmcodeTopCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( optimizeStatementCode(aCTX, aCode) );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE POP COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodePopCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileStatement(aCTX, aCode) );
+}
+
+BF AvmcodePopCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optCode = optimizeStatement(aCTX, aCode);
+
+ optCode->getInstruction()->setMainProcessor( AVM_ARG_QUEUE_CPU );
+ optCode->getInstruction()->setMainOperand( AVM_ARG_EXPRESSION_KIND );
+
+ return( optCode );
+}
+
+
+BFCode AvmcodePopCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileExpressionCode(aCTX, aCode) );
+}
+
+BFCode AvmcodePopCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator endIt = aCode->end();
+ BFCode optimizedCode( aCode->getOperator() );
+
+ AvmInstruction * argsInstruction =
+ optimizedCode->newInstruction( aCode->size() );
+
+ BF arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ setArgcodeContainerWValue(aCTX, argsInstruction->at(0), arg);
+
+ if( argsInstruction->at(0).dtype->isTypedBuffer() )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*(++it)));
+ optimizedCode->append( arg );
+
+ if( ExpressionTypeChecker::isTyped(TypeManager::MESSAGE, arg) )
+ {
+ argsInstruction->at(1).dtype = TypeManager::MESSAGE;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), arg, false);
+ }
+ else if( ExpressionTypeChecker::isTyped(TypeManager::PORT, arg) )
+ {
+ argsInstruction->at(1).dtype = TypeManager::PORT;
+ setArgcodeRValue(aCTX, argsInstruction->at(1), arg, false);
+
+ if( arg.is< InstanceOfPort >() )
+ {
+ InstanceOfPort * aPort = arg.to_ptr< InstanceOfPort >();
+ avm_size_t paramCount = aPort->getParameterCount();
+
+ for( avm_size_t offset = 2 ;
+ (++it != endIt) && (offset <= paramCount) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = aPort->getParameterType(offset-1);
+ setArgcodeLValue(aCTX, argsInstruction->at(offset), arg);
+ }
+ }
+ else for( avm_size_t offset = 2 ; (++it != endIt) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = TypeManager::UNIVERSAL;
+ setArgcodeLValue(aCTX, argsInstruction->at(offset), (*it), false);
+ }
+ }
+ else for( avm_size_t offset = 2 ; (++it != endIt) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(aCTX, (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = TypeManager::UNIVERSAL;
+ setArgcodeLValue(aCTX, argsInstruction->at(offset), (*it), false);
+ }
+ }
+
+ else if( argsInstruction->at(0).dtype->hasTypeCollection() )
+ {
+ BaseTypeSpecifier * aTS = argsInstruction->at(0).dtype->
+ as< ContainerTypeSpecifier >()->getContentsTypeSpecifier();
+
+ for( avm_offset_t offset = 1 ; (++it != endIt) ; ++offset )
+ {
+ arg = AVMCODE_COMPILER.decode_optimizeExpression(
+ aCTX->clone(aTS), (*it));
+ optimizedCode->append( arg );
+
+ argsInstruction->at(offset).dtype = aTS;
+ setArgcodeLValue(aCTX, argsInstruction->at(offset), arg);
+ }
+ }
+
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND,
+ /*dtype */ argsInstruction->at(0).dtype);
+
+ return( optimizedCode );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE POP_FROM COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodePopFromCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileStatement(aCTX, aCode) );
+}
+
+BF AvmcodePopFromCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optCode = optimizeStatement(aCTX, aCode);
+
+ optCode->getInstruction()->setMainProcessor( AVM_ARG_QUEUE_CPU );
+ optCode->getInstruction()->setMainOperand( AVM_ARG_EXPRESSION_KIND );
+
+ return( optCode );
+}
+
+
+BFCode AvmcodePopFromCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileExpressionCode(aCTX, aCode) );
+}
+
+BFCode AvmcodePopFromCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ AvmInstruction * argsInstruction = aCode->genInstruction();
+
+ optimizeArgExpression(aCTX, aCode, 0);
+ setArgcodeContainerWValue(aCTX, argsInstruction->at(0), aCode->first());
+
+ if( argsInstruction->at(0).dtype->isTypedBuffer() )
+ {
+ //!!! TODO
+ optimizeArgExpression(aCTX, aCode, 1);
+ setArgcodeContainerRValue(aCTX, argsInstruction->at(1), aCode->second());
+ }
+ else if( argsInstruction->at(0).dtype->hasTypeCollection() )
+ {
+ optimizeArgExpression(aCTX, aCode, 1);
+ setArgcodeContainerRValue(aCTX, argsInstruction->at(1), aCode->second());
+ }
+
+
+ argsInstruction->computeMainBytecode(
+ /*context */ AVM_ARG_STANDARD_CTX,
+ /*processor*/ AVM_ARG_STATEMENT_CPU,
+ /*operation*/ AVM_ARG_SEVAL_RVALUE,
+ /*operand */ AVM_ARG_STATEMENT_KIND,
+ /*dtype */ argsInstruction->at(0).dtype);
+
+ return( aCode );
+}
+
+
+
+
+}
+
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeQueueCompiler.h b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeQueueCompiler.h
new file mode 100644
index 0000000..05ff7d8
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeQueueCompiler.h
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 12 avr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCODEQUEUECOMPILER_H_
+#define AVMCODEQUEUECOMPILER_H_
+
+#include <builder/primitive/AbstractAvmcodeCompiler.h>
+
+
+namespace sep
+{
+
+
+AVMCODE_COMPILER_OPTIMIZER_CLASS(Push, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_OPTIMIZER_CLASS(AssignTop, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_OPTIMIZER_CLASS(Top, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_OPTIMIZER_CLASS(Pop, AbstractAvmcodeCompiler)
+
+AVMCODE_COMPILER_OPTIMIZER_CLASS(PopFrom, AbstractAvmcodeCompiler)
+
+
+
+}
+
+#endif /* AVMCODEQUEUECOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeSchedulingCompiler.cpp b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeSchedulingCompiler.cpp
new file mode 100644
index 0000000..dcdf1ff
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeSchedulingCompiler.cpp
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 1 mai 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmcodeSchedulingCompiler.h"
+
+#include <fml/expression/AvmCode.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE SCHEDULING COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeSchedulingCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( AbstractAvmcodeCompiler::compileStatement(aCTX, aCode) );
+}
+
+BF AvmcodeSchedulingCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optCode( aCode->getOperator() );
+
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator endIt = aCode->end();
+ for( ; it != endIt ; ++it )
+ {
+ optCode->append( AVMCODE_COMPILER.decode_optimizeExpression(aCTX, *it) );
+ }
+
+ if( optCode->empty() )
+ {
+ return( StatementConstructor::nopCode() );
+ }
+ else
+ {
+ return( optCode->singleton() ? optCode->first().bfCode() : optCode );
+ }
+}
+
+
+BFCode AvmcodeSchedulingCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode newCode = AbstractAvmcodeCompiler::compileStatement(aCTX, aCode);
+
+ if( newCode->singleton() && newCode->first().is< AvmCode >() )
+ {
+ return( newCode->first().bfCode() );
+ }
+
+ return( newCode );
+}
+
+
+BFCode AvmcodeSchedulingCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optCode( aCode->getOperator() );
+
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator endIt = aCode->end();
+ for( ; it != endIt ; ++it )
+ {
+ optCode->append( AVMCODE_COMPILER.decode_optimizeStatement(aCTX, *it) );
+ }
+
+ if( optCode->empty() )
+ {
+ return( StatementConstructor::nopCode() );
+ }
+ else
+ {
+ return( optCode->singleton() ? optCode->first().bfCode() : optCode );
+ }
+}
+
+
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeSchedulingCompiler.h b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeSchedulingCompiler.h
new file mode 100644
index 0000000..a7f2a6c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeSchedulingCompiler.h
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 1 mai 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCODESCHEDULINGCOMPILER_H_
+#define AVMCODESCHEDULINGCOMPILER_H_
+
+#include <builder/primitive/AbstractAvmcodeCompiler.h>
+
+
+namespace sep
+{
+
+
+AVMCODE_COMPILER_OPTIMIZER_CLASS(Scheduling, AbstractAvmcodeCompiler)
+
+
+
+}
+
+#endif /* AVMCODESCHEDULINGCOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeSequenceCompiler.cpp b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeSequenceCompiler.cpp
new file mode 100644
index 0000000..ee8d339
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeSequenceCompiler.cpp
@@ -0,0 +1,437 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 1 mai 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmcodeSequenceCompiler.h"
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/StatementConstructor.h>
+#include <fml/expression/StatementTypeChecker.h>
+
+#include <fml/operator/Operator.h>
+#include <fml/operator/OperatorManager.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE ATOMIC SEQUENCE COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeAtomicSequenceCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileStatement(aCTX, aCode) );
+}
+
+BF AvmcodeAtomicSequenceCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optCode( aCode->getOperator() );
+
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator endIt = aCode->end();
+ for( ; it != endIt ; ++it )
+ {
+ optCode->append(
+ AVMCODE_COMPILER.decode_optimizeExpression(aCTX, *it) );
+ }
+
+ return( optCode->singleton() ? optCode->first().bfCode() : optCode );
+}
+
+
+
+BFCode AvmcodeAtomicSequenceCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode newCode = AbstractAvmcodeCompiler::compileStatement(aCTX, aCode);
+
+ if( newCode->singleton() && newCode->first().is< AvmCode >() )
+ {
+ return( newCode->first().bfCode() );
+ }
+
+ return( newCode );
+}
+
+BFCode AvmcodeAtomicSequenceCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optCode( aCode->getOperator() );
+
+ BF optimizedArg;
+
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator endIt = aCode->end();
+ for( ; it != endIt ; ++it )
+ {
+ optimizedArg = AVMCODE_COMPILER.decode_optimizeStatement(aCTX, *it);
+
+ if( StatementTypeChecker::isComment(optimizedArg) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ optCode->append( optimizedArg );
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ }
+
+ else
+ {
+ optCode->appendFlat( optimizedArg );
+ }
+ }
+
+ if( optCode->empty() )
+ {
+ return( StatementConstructor::nopCode() );
+ }
+ else
+ {
+ return( optCode->singleton() ? optCode->first().bfCode() : optCode );
+ }
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE SEQUENCE COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeStrongSequenceCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileStatement(aCTX, aCode) );
+}
+
+BF AvmcodeStrongSequenceCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( optimizeStatement(aCTX, aCode) );
+}
+
+
+
+BFCode AvmcodeStrongSequenceCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode newCode = AbstractAvmcodeCompiler::compileStatement(aCTX, aCode);
+
+ if( newCode->singleton() && newCode->first().is< AvmCode >() )
+ {
+ return( newCode->first().bfCode() );
+ }
+
+ return( newCode );
+}
+
+BFCode AvmcodeStrongSequenceCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optCode( aCode->getOperator() );
+
+ BFCode atomicCode( OperatorManager::OPERATOR_ATOMIC_SEQUENCE );
+
+ BF optimizedArg;
+
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator endIt = aCode->end();
+ for( ; it != endIt ; ++it )
+ {
+ optimizedArg = AVMCODE_COMPILER.decode_optimizeStatement(aCTX, *it);
+
+ if( StatementTypeChecker::isComment(optimizedArg) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ atomicCode->append( optimizedArg );
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ }
+
+ // ==> StatementTypeChecker::isStrongAtomicSequence(atomicCode)
+ else if( StatementTypeChecker::isAtomicStatement(optimizedArg) )
+ {
+ atomicCode->append( optimizedArg );
+ }
+ else if( StatementTypeChecker::isStrongAtomicSequence(optimizedArg) )
+ {
+ atomicCode->append( optimizedArg.to_ptr< AvmCode >()->getArgs() );
+ }
+ else if( atomicCode->empty() )
+ {
+ optCode->appendFlat( optimizedArg );
+ }
+ else if( StatementTypeChecker::isAtomicSequence(optimizedArg) )
+ {
+ atomicCode->append( optimizedArg.to_ptr< AvmCode >()->getArgs() );
+
+ optCode->append( atomicCode );
+
+ atomicCode = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE );
+ }
+ else if( ((it + 1) != endIt ) )
+ {
+ atomicCode->append( optimizedArg );
+
+ optCode->append( atomicCode );
+
+ atomicCode = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE );
+ }
+ else // ==> end for(...)
+ {
+ if( atomicCode->singleton() )
+ {
+ optCode->appendFlat( atomicCode->pop_last() );
+ }
+ else if( atomicCode->populated() )
+ {
+ optCode->append( atomicCode );
+ }
+ atomicCode = BFCode::REF_NULL;
+
+ optCode->appendFlat( optimizedArg );
+ }
+ }
+
+ if( optCode->nonempty() )
+ {
+ if( atomicCode.invalid() )
+ {
+ //!! NOTHING
+ }
+ else if( atomicCode->singleton() )
+ {
+ optCode->appendFlat( atomicCode->pop_last() );
+ }
+ else if( atomicCode->populated() )
+ {
+ optCode->append( atomicCode );
+ }
+
+ else if( optCode->singleton() )
+ {
+ return( optCode->first().bfCode() );
+ }
+
+ return( optCode );
+ }
+
+ else if( atomicCode->empty() )
+ {
+ return( StatementConstructor::nopCode() );
+ }
+ else
+ {
+ return( atomicCode->singleton() ?
+ atomicCode->first().bfCode() : atomicCode );
+ }
+}
+
+
+
+BFCode AvmcodeStrongSequenceCompiler::atomizeSequence(const BFCode & aCode)
+{
+ BFCode optCode( aCode->getOperator() );
+
+ BFCode atomicCode( OperatorManager::OPERATOR_ATOMIC_SEQUENCE );
+
+ BF optimizedArg;
+
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator endIt = aCode->end();
+ for( ; it != endIt ; ++it )
+ {
+ optimizedArg = (*it);
+
+ if( StatementTypeChecker::isComment(optimizedArg) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ atomicCode->append( optimizedArg );
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ }
+
+ // ==> StatementTypeChecker::isStrongAtomicSequence(atomicCode)
+ else if( StatementTypeChecker::isAtomicStatement(optimizedArg) )
+ {
+ atomicCode->append( optimizedArg );
+ }
+ else if( StatementTypeChecker::isStrongAtomicSequence(optimizedArg) )
+ {
+ atomicCode->append( optimizedArg.to_ptr< AvmCode >()->getArgs() );
+ }
+ else if( atomicCode->empty() )
+ {
+ optCode->appendFlat( optimizedArg );
+ }
+ else if( StatementTypeChecker::isAtomicSequence(optimizedArg) )
+ {
+ atomicCode->append( optimizedArg.to_ptr< AvmCode >()->getArgs() );
+
+ optCode->append( atomicCode );
+
+ atomicCode = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE );
+ }
+ else if( ((it + 1) != endIt ) )
+ {
+ atomicCode->append( optimizedArg );
+
+ optCode->append( atomicCode );
+
+ atomicCode = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE );
+ }
+ // ==> end for(...)
+ else
+ {
+ if( atomicCode->singleton() )
+ {
+ optCode->appendFlat( atomicCode->pop_last() );
+ }
+ else if( atomicCode->populated() )
+ {
+ optCode->append( atomicCode );
+ }
+ atomicCode = BFCode::REF_NULL;
+
+ optCode->appendFlat( optimizedArg );
+ }
+ }
+
+
+ if( optCode->nonempty() )
+ {
+ if( atomicCode.invalid() )
+ {
+ //!! NOTHING
+ }
+ else if( atomicCode->singleton() )
+ {
+ optCode->appendFlat( atomicCode->pop_last() );
+ }
+ else if( atomicCode->populated() )
+ {
+ optCode->append( atomicCode );
+ }
+
+ else if( optCode->singleton() )
+ {
+ return( optCode->first().bfCode() );
+ }
+
+ return( optCode );
+ }
+ else if( atomicCode->singleton() )
+ {
+ return( atomicCode->first().bfCode() );
+ }
+ else
+ {
+ return( atomicCode );
+ }
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE SEQUENCE COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeSequenceCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( compileStatement(aCTX, aCode) );
+}
+
+BF AvmcodeSequenceCompiler::optimizeExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optCode( aCode->getOperator() );
+
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator endIt = aCode->end();
+ for( ; it != endIt ; ++it )
+ {
+ optCode->append(
+ AVMCODE_COMPILER.decode_optimizeExpression(aCTX, *it) );
+ }
+
+ return( optCode->singleton() ? optCode->first().bfCode() : optCode );
+}
+
+
+BFCode AvmcodeSequenceCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode newCode = AbstractAvmcodeCompiler::compileStatement(aCTX, aCode);
+
+ if( newCode->singleton() )
+ {
+ if( newCode->first().is< AvmCode >() )
+ {
+ return( newCode->first().bfCode() );
+ }
+ }
+ else if( newCode->empty() )
+ {
+ return( StatementConstructor::nopCode() );
+ }
+
+ return( newCode );
+}
+
+
+BFCode AvmcodeSequenceCompiler::optimizeStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ BFCode optCode( aCode->getOperator() );
+
+ BF optimizedArg;
+
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator endIt = aCode->end();
+ for( ; it != endIt ; ++it )
+ {
+ optimizedArg = AVMCODE_COMPILER.decode_optimizeStatement(aCTX, *it);
+
+ if( StatementTypeChecker::isComment(optimizedArg) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ optCode->append( optimizedArg );
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ }
+
+ else
+ {
+ optCode->appendFlat( optimizedArg );
+ }
+ }
+
+ if( optCode->empty() )
+ {
+ return( StatementConstructor::nopCode() );
+ }
+ else
+ {
+ return( optCode->singleton() ? optCode->first().bfCode() : optCode );
+ }
+}
+
+
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeSequenceCompiler.h b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeSequenceCompiler.h
new file mode 100644
index 0000000..de61772
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeSequenceCompiler.h
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 1 mai 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCODESEQUENCECOMPILER_H_
+#define AVMCODESEQUENCECOMPILER_H_
+
+#include <builder/primitive/AbstractAvmcodeCompiler.h>
+
+
+namespace sep
+{
+
+
+AVMCODE_COMPILER_OPTIMIZER_CLASS(AtomicSequence, AbstractAvmcodeCompiler)
+
+
+AVMCODE_COMPILER_OPTIMIZER_CLASS_HEADER(StrongSequence, AbstractAvmcodeCompiler)
+ static BFCode atomizeSequence(const BFCode & aCode);
+};
+
+
+AVMCODE_COMPILER_OPTIMIZER_CLASS(Sequence, AbstractAvmcodeCompiler)
+
+
+
+}
+
+#endif /* AVMCODESEQUENCECOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeUfiCastExpressionCompiler.cpp b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeUfiCastExpressionCompiler.cpp
new file mode 100644
index 0000000..21134b7
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeUfiCastExpressionCompiler.cpp
@@ -0,0 +1,867 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 4 mai 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmcodeUfiCastExpressionCompiler.h"
+
+#include <fml/executable/BaseInstanceForm.h>
+#include <fml/executable/ExecutableSystem.h>
+#include <fml/executable/InstanceOfData.h>
+#include <fml/executable/InstanceOfMachine.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/ExpressionTypeChecker.h>
+
+#include <fml/lib/AvmOperationFactory.h>
+
+#include <fml/symbol/TableOfSymbol.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+#include <fml/type/BaseSymbolTypeSpecifier.h>
+#include <fml/type/ContainerTypeSpecifier.h>
+#include <fml/type/EnumTypeSpecifier.h>
+
+#include <fml/workflow/UniFormIdentifier.h>
+
+#include <sew/Configuration.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE UFI EXPRESSION COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeUfiExpressionCompiler::compileUfiExpression(
+ COMPILE_CONTEXT * aCTX, const UniFormIdentifier & theUFI)
+{
+ BF bfInstance;
+
+ if( theUFI.isAbsoluteFullFields() )
+ {
+ bfInstance = getSymbolTable().searchSymbolByUFI(aCTX, theUFI);
+ if( bfInstance.valid() )
+ {
+ return( bfInstance );
+ }
+
+ else
+ {
+ std::string strUFI = theUFI.str();
+
+ //StringTools::replace(strUFI, "spec::", "inst::");
+ StringTools::eraseAll(strUFI, "&");
+
+ bfInstance = getSymbolTable().searchSymbol(aCTX, strUFI);
+ if( bfInstance.valid() )
+ {
+ return( bfInstance );
+ }
+ }
+ }
+ else if( theUFI.isFullOffset() )
+ {
+ bfInstance = getSymbolTable().searchSymbolByQualifiedNameID(
+ aCTX, theUFI.str());
+ if( bfInstance.valid() )
+ {
+ return( bfInstance );
+ }
+ }
+
+ UniFormIdentifier::const_iterator it = theUFI.begin();
+ UniFormIdentifier::const_iterator itEnd = theUFI.end();
+
+ std::ostringstream ossUFI;
+
+ const ObjectElement * TheMainObjectElement = NULL;
+
+ // CHECKING FIRST ELEMENT
+ if( (*it).is< ObjectElement >() )
+ {
+ TheMainObjectElement = (*it).to_ptr< ObjectElement >();
+ }
+ else
+ {
+ if( theUFI.hasLocator() )
+ {
+ ossUFI << theUFI.toStringLocator()
+ << FQN_ID_ROOT_SEPARATOR << (*it).str();
+ }
+ ossUFI << (*it).str();
+
+ TheMainObjectElement = AVMCODE_COMPILER.getConfiguration().
+ getExecutableSystem().getSystemInstance().getAstElement();
+ }
+
+ if( TheMainObjectElement == NULL )
+ {
+ bfInstance = getSymbolTable().searchDataInstance(aCTX, theUFI.str());
+ if( bfInstance.valid() )
+ {
+ return( bfInstance );
+ }
+ else
+ {
+ bfInstance = getSymbolTable().searchSymbolByNameID(aCTX, (*it).str());
+ if( bfInstance.valid() )
+ {
+ TheMainObjectElement = bfInstance.to_ptr<
+ BaseInstanceForm >()->getAstElement();
+ }
+ }
+ }
+
+
+ if( TheMainObjectElement != NULL )
+ {
+ ObjectElement * objElement = NULL;
+
+ ossUFI.str("");
+ ossUFI << TheMainObjectElement->getFullyQualifiedNameID();
+
+ // CHECKING MAIN FORM
+ for( ++it ; it != itEnd ; ++it )
+ {
+ if( (*it).is< ObjectElement >() )
+ {
+ objElement = (*it).to_ptr< ObjectElement >();
+
+ if( objElement->getContainer() == TheMainObjectElement )
+ {
+ TheMainObjectElement = objElement;
+
+ ossUFI.str("");
+ ossUFI << TheMainObjectElement->getFullyQualifiedNameID();
+ }
+ else
+ {
+ break;
+ }
+ }
+ else if( (*it).isIdentifier() )
+ {
+ ossUFI << '.' << (*it).str();
+ }
+ else
+ {
+ break;
+ }
+
+ if( objElement != NULL )
+ {
+ TheMainObjectElement = objElement;
+
+ //!![MIGRATION] i.e. isArrayType() isContainerType() isClassType()
+ AVM_OS_FATAL_ERROR_EXIT
+ << "!!! DataTypeFactory::isCompositeType !!!"
+ << SEND_EXIT;
+ break;
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+ else if( (*it).isFieldInvokable() )
+ {
+ Operator * opExpr = AvmOperationFactory::get( (*it).str() );
+ if( opExpr != NULL )
+ {
+ BFCode anInvokeExpression( opExpr );
+
+ BF arg;
+ for( ++it ; it != itEnd ; ++it )
+ {
+ if( (*it).isFieldParameter() )
+ {
+ arg = compileArgRvalue(aCTX, *it);
+
+ if( arg.valid() )
+ {
+ anInvokeExpression->append( arg );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmCode< statement > compilation error << "
+ << (*it).str() << " >>"
+ << std::endl << std::endl;
+
+ anInvokeExpression->append( *it );
+ }
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ if( it != itEnd )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmCode< statement > compilation error"
+ " << (: " << anInvokeExpression.str()
+ << " " << (*it).str() << " ...) >> for "
+ << theUFI.str() << std::endl << std::endl;
+ }
+
+ return( anInvokeExpression );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << "Unfound the operation < " << (*it).str()
+ << " > in the UFI < " << theUFI.str() << " >"
+ << std::endl;
+
+ return( BF::REF_NULL );
+ }
+ }
+
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << "Unfound the invokable field < " << ossUFI.str()
+ << " > of UFI < " << theUFI.str() << " > in the system << "
+ << AVMCODE_COMPILER.getConfiguration().
+ getExecutableSystem().rawSystemInstance()->
+ getAstElement()->getFullyQualifiedNameID()
+ << " >>" << std::endl;
+
+ return( BF::REF_NULL );
+ }
+
+
+ // CHECKING FIRST INSTANCE
+ if( TheMainObjectElement != NULL )
+ {
+ bfInstance = getSymbolTable().searchInstance(aCTX, TheMainObjectElement);
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << "Unfound the main object element < " << ossUFI.str()
+ << " > of UFI < " << theUFI.str() << " > in the system << "
+ << AVMCODE_COMPILER.getConfiguration().
+ getExecutableSystem().rawSystemInstance()->
+ getAstElement()->getFullyQualifiedNameID()
+ << " >>" << std::endl;
+
+ return( BF::REF_NULL );
+ }
+
+
+ if( bfInstance.valid() )
+ {
+ if( it == itEnd )
+ {
+ return( bfInstance );
+ }
+
+ // CASE FIRST INSTANCE is a MACHINE
+ if( bfInstance.is< InstanceOfMachine >() )
+ {
+ InstanceOfMachine * theInstanceMachine =
+ bfInstance.to_ptr< InstanceOfMachine >();
+
+ InstanceOfMachine * ptrInstance = NULL;
+
+ // CHECKING FOR MAIN MACHINE
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it).isIdentifier() )
+ {
+ ossUFI.str("");
+ ossUFI << theInstanceMachine->getExecutable()->
+ getAstFullyQualifiedNameID() << '.' << (*it).str();
+ bfInstance = getSymbolTable().searchInstance(
+ aCTX->newCTX(theInstanceMachine->getExecutable()),
+ ossUFI.str() );
+ if( bfInstance.valid() )
+ {
+ if( bfInstance.is< InstanceOfMachine >() )
+ {
+ ptrInstance = bfInstance.to_ptr< InstanceOfMachine >();
+
+ if( ptrInstance->getContainer() ==
+ theInstanceMachine->getExecutable() )
+ {
+ theInstanceMachine = ptrInstance;
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << "Unexpected a non child machine "
+ "instance < " << ptrInstance->getFullyQualifiedNameID()
+ << " of the machine instance < "
+ << theInstanceMachine->getFullyQualifiedNameID()
+ << " > > in the UFI < " << theUFI.str()
+ << " >" << std::endl;
+
+ return( BF::REF_NULL );
+ }
+ }
+ else if( bfInstance.is< InstanceOfData >() )
+ {
+ ++it;
+
+ break;
+ }
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << "Unfound machine attribute < "
+ << (*it).str() << " > of the UFI < "
+ << theUFI.str() << " >" << std::endl;
+
+ return( BF::REF_NULL );
+ }
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << "Unexpected class attribute kind < "
+ << (*it).str() << " > of the UFI < "
+ << theUFI.str() << " >" << std::endl;
+
+ return( BF::REF_NULL );
+ }
+ }
+
+ if( it == itEnd )
+ {
+ bfInstance = getSymbolTable().createAliasIfNotAccessible(
+ aCTX, theInstanceMachine, bfInstance);
+
+ // ERROR REPORTING
+ if( getSymbolTable().hasError() )
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << theUFI.errorLocation(
+ aCTX->mCompileCtx->getAstElement() )
+ << getSymbolTable().getErrorMessage()
+ << std::endl << std::endl;
+ }
+
+ return( bfInstance );
+ }
+ }
+
+
+ // CASE FIRST INSTANCE is a DATA
+ if( bfInstance.is< InstanceOfData >() )
+ {
+ bfInstance = getSymbolTable().
+ createAliasIfNotAccessible(aCTX, bfInstance);
+ // ERROR REPORTING
+ if( getSymbolTable().hasError() )
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << theUFI.errorLocation(
+ aCTX->mCompileCtx->getAstElement() )
+ << getSymbolTable().getErrorMessage()
+ << std::endl << std::endl;
+ }
+
+ Symbol symbolData( bfInstance );
+
+ InstanceOfData * ptrInstance = bfInstance.to_ptr< InstanceOfData >();
+
+ BaseTypeSpecifier * aTypeSpecifier = ptrInstance->getTypeSpecifier();
+
+ if( aTypeSpecifier->hasTypeStructureOrChoiceOrUnion() ||
+ aTypeSpecifier->hasTypeArrayVector() )
+ {
+ BaseSymbolTypeSpecifier * aStructTypeSpecifier = NULL;
+
+ bool isArrayIndex = false;
+// bool isNotArray = true;
+
+ TableOfSymbol aRelativeDataPath;
+ std::ostringstream ossID;
+
+ ossUFI.str( "" );
+ ossUFI << ptrInstance->getFullyQualifiedNameID();
+
+ ossID << ptrInstance->getNameID();
+
+
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it).isFieldIndex() )
+ {
+ if( not aTypeSpecifier->hasTypeArrayVector() )
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "Unexpected a non Array field kind < "
+ << ossUFI.str() << " > of the UFI < "
+ << theUFI.str() << " >" << std::endl;
+
+ return( BF::REF_NULL );
+ }
+
+ aTypeSpecifier = aTypeSpecifier->
+ as< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier();
+
+ BF index = compileArgRvalue(aCTX, (*it));
+ if( index.valid() )
+ {
+// isNotArray = false;
+ if( index.isInteger() )
+ {
+ symbolData = new InstanceOfData(
+ IPointerDataNature::
+ POINTER_FIELD_ARRAY_OFFSET_NATURE,
+ aCTX->mCompileCtx,
+ aTypeSpecifier->getAstElement(),
+ aTypeSpecifier, 0 );
+ symbolData.setOffset( index.toInteger() );
+ }
+ else
+ {
+ isArrayIndex = true;
+ symbolData = new InstanceOfData(
+ IPointerDataNature::
+ POINTER_FIELD_ARRAY_INDEX_NATURE,
+ aCTX->mCompileCtx,
+ aTypeSpecifier->getAstElement(),
+ aTypeSpecifier, 0 );
+ symbolData.setValue( index );
+ }
+
+ aRelativeDataPath.append( symbolData );
+
+ ossUFI << "[" << index.str() << "]";
+ ossID << "[" << ( index.is< BaseInstanceForm >() ?
+ index.to_ptr< BaseInstanceForm >()->getNameID() :
+ index.str() ) << "]";
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << "Unfound array index < "
+ << (*it).str() << " > of the UFI element < "
+ << theUFI.str() << " >" << std::endl;
+
+ return( BF::REF_NULL );
+ }
+ }
+
+ else if( aTypeSpecifier->hasTypeStructureOrChoiceOrUnion() )
+ {
+// AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( aTypeSpecifier->isTypedClass() )
+// << "Unexpected a non Class/Struct type !!!"
+// << SEND_EXIT;
+
+ aStructTypeSpecifier =
+ aTypeSpecifier->to< BaseSymbolTypeSpecifier >();
+ if( (*it).isIdentifier() )
+ {
+ ossUFI << '.' << (*it).str();
+ ossID << '.' << (*it).str();
+
+ symbolData = symbolData.getAttributeByNameID( ossID.str() );
+ if( symbolData.invalid() )
+ {
+ symbolData = aStructTypeSpecifier->
+ getDataByNameID( (*it).str() );
+ }
+
+ //!! NO ELSE here
+ if( symbolData.valid() )
+ {
+ if( aTypeSpecifier->isTypedUnion() )
+ {
+ // Not insertion in Data path
+ }
+ else
+ {
+ aRelativeDataPath.append( symbolData );
+ }
+
+ aTypeSpecifier = symbolData.getTypeSpecifier();
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << "Unfound structure attribute < "
+ << (*it).str() << " > of the UFI < "
+ << theUFI.str() << " >" << std::endl;
+
+ return( BF::REF_NULL );
+ }
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << "Unexpected structure attribute kind < "
+ << (*it).str() << " > of the UFI < "
+ << theUFI.str() << " >" << std::endl;
+
+ return( BF::REF_NULL );
+ }
+ }
+ else
+ {
+ break;
+ }
+
+// else
+// {
+// getCompilerTable().incrErrorCount();
+// AVM_OS_WARN << "Unexpected type < "
+// << aTypeSpecifier->getFullyQualifiedNameID()
+// << " > for the element < " << (*it).str()
+// << " > of the instance of data < " << theUFI.str()
+// << " >" << std::endl;
+// return( BF::REF_NULL );
+// }
+ }
+
+ IPointerDataNature::POINTER_DATA_NATURE aPointerNature =
+ IPointerDataNature::POINTER_UNDEFINED_NATURE;
+ if( isArrayIndex )
+ {
+ aPointerNature = IPointerDataNature::POINTER_UFI_MIXED_NATURE;
+ }
+ else
+ {
+ aPointerNature = IPointerDataNature::POINTER_UFI_OFFSET_NATURE;
+ }
+
+
+ if( aRelativeDataPath.nonempty() )
+ {
+ aRelativeDataPath.pop_last_to( symbolData );
+
+ symbolData = new InstanceOfData(aPointerNature,
+ ptrInstance->getContainer(), ptrInstance,
+ aRelativeDataPath, symbolData);
+ }
+ else
+ {
+ VectorOfInstanceOfMachine aRelativeMachinePath;
+
+ symbolData = new InstanceOfData(ptrInstance->getContainer(),
+ symbolData.rawData(), aRelativeMachinePath);
+ }
+
+ symbolData.updateFullyQualifiedNameID( ossUFI.str() , ossID.str() );
+
+// if( isNotArray )
+ {
+ aCTX->mCompileCtx->getExecutable()->
+ appendDataAlias( symbolData );
+// ptrInstance->getContainer()->appendDataAlias( symbolData );
+ }
+
+ if( it == itEnd )
+ {
+ return( symbolData );
+ }
+
+ else if( (*it).isFieldInvokable() )
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( (*it).isIdentifier() )
+ << "Unexpected a non-Identifier << "
+ << (*it).str() << " >> as Invocable !!!"
+ << SEND_EXIT;
+
+ Operator * op = AvmOperationFactory::get(
+ symbolData, (*it).toIdentifier());
+ if( op != NULL )
+ {
+ BFCode newCode(op, symbolData);
+ BF arg;
+ for( ++it ; it != itEnd ; ++it )
+ {
+ if( (*it).isFieldParameter() )
+ {
+ arg = compileArgRvalue(aCTX, *it);
+
+ if( arg.valid() )
+ {
+ newCode->append( arg );
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmCode< statement > "
+ "compilation error << "
+ << (*it).str() << " >>"
+ << std::endl << std::endl;
+
+ newCode->append( *it );
+ }
+ }
+ else
+ {
+ break;
+ }
+ }
+ if( it == itEnd )
+ {
+ return( newCode );
+ }
+
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmCode< statement > "
+ "compilation error << (: "
+ << symbolData.str() << " "
+ << (*it).str() << " ...) >> for "
+ << theUFI.str()
+ << std::endl << std::endl;
+
+ return( symbolData );
+ }
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "AvmCode< statement > "
+ "compilation error << (: "
+ << symbolData.str() << " "
+ << (*it).str() << " ...) >> for "
+ << theUFI.str()
+ << std::endl << std::endl;
+
+ return( symbolData );
+ }
+ }
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ aCTX->errorContext( AVM_OS_WARN )
+ << "UFI compilation error << "
+ << symbolData.str() << " >> for "
+ << theUFI.str()
+ << std::endl << std::endl;
+
+ return( symbolData );
+ }
+ }
+
+ else if( aTypeSpecifier->isTypedLambda() /*&& (*(it-1)).isFieldInvokable()*/ )
+ {
+ BFCode invokeCode(OperatorManager::OPERATOR_INVOKE_LAMBDA_APPLY,
+ symbolData);
+// (theInstanceData->getModifier().hasFeatureFinal() && theInstanceData->hasValue()) ?
+// theInstanceData->getValue() : theInstanceData);
+
+ BF param;
+ for( ; it != itEnd ; ++it )
+ {
+ param = compileArgRvalue(aCTX, (*it));
+
+ if( param.invalid() )
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << "Compilation Error of the parameter < "
+ << (*it).str() << " > of the invokable < "
+ << ptrInstance->getFullyQualifiedNameID() << " > in the UFI < "
+ << theUFI.str() << " >" << std::endl;
+
+ continue;
+ }
+
+ invokeCode->append( param );
+ }
+
+ return( invokeCode );
+ }
+
+ else if( aTypeSpecifier->isTypedMachine() )
+ {
+
+ }
+
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << "Unexpected type < " << aTypeSpecifier->str()
+ << " > for instance of data < " << ptrInstance->getFullyQualifiedNameID()
+ << " > int the UFI < " << theUFI.str() << " >"
+ << std::endl;
+
+ return( BF::REF_NULL );
+ }
+ }
+
+ // CASE FIRST INSTANCE is a PORT
+ else if( bfInstance.is< InstanceOfPort >() )
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << "Unexpected a port instance < "
+ << bfInstance.to_ptr< InstanceOfPort >()->getFullyQualifiedNameID()
+ << " > int the UFI < " << theUFI.str() << " >" << std::endl;
+
+ return( BF::REF_NULL );
+ }
+
+ else
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << "Unexpected a base instance < "
+ << bfInstance.to_ptr< BaseInstanceForm >()->getFullyQualifiedNameID()
+ << " > int the UFI < " << theUFI.str() << " >" << std::endl;
+
+ return( BF::REF_NULL );
+ }
+ }
+
+ else
+ {
+ const BF & tmpTransition =
+ getSymbolTable().searchTransition(aCTX, TheMainObjectElement);
+ if( tmpTransition.valid() && (it == itEnd) )
+ {
+ return( tmpTransition );
+ }
+
+ const BF & tmpProgram =
+ getSymbolTable().searchProgram(aCTX, TheMainObjectElement);
+ if( tmpProgram.valid() && (it == itEnd) )
+ {
+ return( tmpProgram );
+ }
+
+
+ const BF & aType = SymbolTable::searchTypeSpecifier(
+ AVMCODE_COMPILER.getConfiguration().getExecutableSystem(),
+ aCTX, TheMainObjectElement);
+ if( aType.valid() )
+ {
+ if( it == itEnd )
+ {
+ return( aType );
+ }
+ else
+ {
+ EnumTypeSpecifier * anEnumTS;
+
+ for( ; it != itEnd ; ++it )
+ {
+ if( aType.is< EnumTypeSpecifier >() )
+ {
+ anEnumTS = aType.to_ptr< EnumTypeSpecifier >();
+
+ if( (*it).isIdentifier() )
+ {
+ ossUFI.str("");
+ ossUFI << anEnumTS->getFullyQualifiedNameID() << '.' << (*it).str();
+
+ bfInstance = anEnumTS->getSymbolData(ossUFI.str());
+
+ break;
+ }
+ }
+ }
+
+ if( bfInstance.valid() && (it == itEnd) )
+ {
+ return( bfInstance );
+ }
+ }
+ }
+
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << "Unfound a runtime symbol for the form < "
+ << TheMainObjectElement->getFullyQualifiedNameID()
+ << " > in the UFI < " << theUFI.str() << " >"
+ << std::endl;
+
+ return( BF::REF_NULL );
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+
+
+
+BF AvmcodeUfiExpressionCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ UniFormIdentifier * runtimeUFI = new UniFormIdentifier(false);
+ BF bfRuntimeUFI( runtimeUFI );
+
+ BF arg;
+
+ COMPILE_CONTEXT * containerCTX = aCTX->clone();
+
+ AvmCode::iterator itArg = aCode->begin();
+ AvmCode::iterator itEndArg = aCode->end();
+
+ for( ; itArg != itEndArg ; ++itArg )
+ {
+ arg = compileArgRvalue(containerCTX, *itArg);
+
+ if( arg.invalid() )
+ {
+ getCompilerTable().incrErrorCount();
+ AVM_OS_WARN << "Compilation Error of < " << (*itArg).str()
+ << " > in the UFI < " << aCode->str() << " >" << std::endl;
+
+ continue;
+ }
+
+ runtimeUFI->appendUndef(arg);
+
+ containerCTX->mCompileCtx = aCTX->mCompileCtx;
+
+ if( ExpressionTypeChecker::isCtor(arg) && (itArg != itEndArg) )
+ {
+ const BF & aCastType = arg.to_ptr< AvmCode >()->first();
+ if( aCastType.is< BaseAvmProgram >() )
+ {
+ containerCTX->mCompileCtx = aCastType.to_ptr< BaseAvmProgram >();
+ }
+ }
+ }
+
+ return( bfRuntimeUFI );
+
+}
+
+BFCode AvmcodeUfiExpressionCompiler::compileStatement(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected UFI EXPRESSION as statement !!!"
+ << SEND_EXIT;
+
+ return( aCode );
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeUfiCastExpressionCompiler.h b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeUfiCastExpressionCompiler.h
new file mode 100644
index 0000000..9a7cb89
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeUfiCastExpressionCompiler.h
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 4 mai 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCODEUFICASTEXPRESSIONCOMPILER_H_
+#define AVMCODEUFICASTEXPRESSIONCOMPILER_H_
+
+#include <builder/primitive/AbstractAvmcodeCompiler.h>
+
+
+namespace sep
+{
+
+
+class CompilationEnvironment;
+class UniFormIdentifier;
+
+
+AVMCODE_COMPILER_CLASS_HEADER(UfiExpression, AbstractAvmcodeCompiler)
+public:
+ BF compileUfiExpression(COMPILE_CONTEXT * aCTX,
+ const UniFormIdentifier & theUFI);
+};
+
+
+
+}
+
+#endif /* AVMCODEUFICASTEXPRESSIONCOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeVariableStatusCompiler.cpp b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeVariableStatusCompiler.cpp
new file mode 100644
index 0000000..67fd010
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeVariableStatusCompiler.cpp
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 1 mai 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmcodeVariableStatusCompiler.h"
+
+#include <fml/expression/AvmCode.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVMCODE VARIABLE STATUS EXPRESSION COMPILATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF AvmcodeVariableStatusExpressionCompiler::compileExpression(
+ COMPILE_CONTEXT * aCTX, const BFCode & aCode)
+{
+ return( AbstractAvmcodeCompiler::compileStatement(aCTX, aCode) );
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeVariableStatusCompiler.h b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeVariableStatusCompiler.h
new file mode 100644
index 0000000..9a13774
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/AvmcodeVariableStatusCompiler.h
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 1 mai 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCODEVARIABLESTATUSCOMPILER_H_
+#define AVMCODEVARIABLESTATUSCOMPILER_H_
+
+#include <builder/primitive/AbstractAvmcodeCompiler.h>
+
+
+namespace sep
+{
+
+
+AVMCODE_COMPILER_EXPRESSION_CLASS("VARIABLE STATUS", VariableStatusExpression, AbstractAvmcodeCompiler)
+
+
+
+}
+
+#endif /* AVMCODEVARIABLESTATUSCOMPILER_H_ */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/CompilationEnvironment.cpp b/org.eclipse.efm.symbex/src/builder/primitive/CompilationEnvironment.cpp
new file mode 100644
index 0000000..17fca16
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/CompilationEnvironment.cpp
@@ -0,0 +1,318 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 14 févr. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "CompilationEnvironment.h"
+
+
+namespace sep
+{
+
+
+/**
+ * STATIC
+ * ATTRIBUTES
+ */
+bool COMPILE_CONTEXT::DEFAUL_TYPE_CHECKING_MASK = true;
+
+bool COMPILE_CONTEXT::INLINE_DISABLE_MASK = false;
+
+bool COMPILE_CONTEXT::INLINE_ENABLE_MASK = false;
+
+bool COMPILE_CONTEXT::INLINE_PROCEDURE_MASK = true;
+
+
+
+/**
+ * report debug Context
+ */
+OutStream & COMPILE_CONTEXT::debugContext(OutStream & os)
+{
+ os << TAB << "Context:> "
+ << mCompileCtx->getFullyQualifiedNameID() << std::endl;
+
+ if( isSpecificRuntimeCtx() )
+ {
+ os << TAB << "Runtime:> "
+ << mRuntimeCtx->getFullyQualifiedNameID() << std::endl;
+ }
+
+ if( mVariableCtx != NULL )
+ {
+ os << TAB << "DataVar:> "
+ << mVariableCtx->getFullyQualifiedNameID() << std::endl;
+ }
+
+ return( os );
+}
+
+
+/**
+ * report error Context & Location
+ */
+OutStream & COMPILE_CONTEXT::errorContext(OutStream & os)
+{
+AVM_IF_DEBUG_FLAG( COMPILING )
+ os << "ctx:> " << mCompileCtx->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ BaseAvmProgram * errorCtx =
+ ( mCompileCtx == mRuntimeCtx )? mCompileCtx : mRuntimeCtx;
+ errorCtx->getAstElement()->errorLocation(os,
+ errorCtx->hasContainer() ?
+ errorCtx->getContainer()->getAstElement() : NULL);
+
+ return( os );
+}
+
+PairOutStream & COMPILE_CONTEXT::errorContext(PairOutStream & os)
+{
+AVM_IF_DEBUG_FLAG( COMPILING )
+ os << "ctx:> " << mCompileCtx->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ BaseAvmProgram * errorCtx =
+ ( mCompileCtx == mRuntimeCtx )? mCompileCtx : mRuntimeCtx;
+ errorCtx->getAstElement()->errorLocation(os,
+ errorCtx->hasContainer() ?
+ errorCtx->getContainer()->getAstElement() : NULL);
+
+ return( os );
+}
+
+TripleOutStream & COMPILE_CONTEXT::errorContext(TripleOutStream & os)
+{
+AVM_IF_DEBUG_FLAG( COMPILING )
+ os << "ctx:> " << mCompileCtx->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ BaseAvmProgram * errorCtx =
+ ( mCompileCtx == mRuntimeCtx )? mCompileCtx : mRuntimeCtx;
+ errorCtx->getAstElement()->errorLocation(os,
+ errorCtx->hasContainer() ?
+ errorCtx->getContainer()->getAstElement() : NULL);
+
+ return( os );
+}
+
+
+/**
+ * report warning Context & Location
+ */
+OutStream & COMPILE_CONTEXT::warningContext(OutStream & os)
+{
+AVM_IF_DEBUG_FLAG( COMPILING )
+ os << "ctx:> " << mCompileCtx->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ BaseAvmProgram * warningCtx =
+ ( mCompileCtx == mRuntimeCtx )? mCompileCtx : mRuntimeCtx;
+ warningCtx->getAstElement()->warningLocation(os,
+ warningCtx->hasContainer() ?
+ warningCtx->getContainer()->getAstElement() : NULL);
+
+ return( os );
+}
+
+PairOutStream & COMPILE_CONTEXT::warningContext(PairOutStream & os)
+{
+AVM_IF_DEBUG_FLAG( COMPILING )
+ os << "ctx:> " << mCompileCtx->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ BaseAvmProgram * warningCtx =
+ ( mCompileCtx == mRuntimeCtx )? mCompileCtx : mRuntimeCtx;
+ warningCtx->getAstElement()->warningLocation(os,
+ warningCtx->hasContainer() ?
+ warningCtx->getContainer()->getAstElement() : NULL);
+
+ return( os );
+}
+
+TripleOutStream & COMPILE_CONTEXT::warningContext(TripleOutStream & os)
+{
+AVM_IF_DEBUG_FLAG( COMPILING )
+ os << "ctx:> " << mCompileCtx->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ BaseAvmProgram * warningCtx =
+ ( mCompileCtx == mRuntimeCtx )? mCompileCtx : mRuntimeCtx;
+ warningCtx->getAstElement()->warningLocation(os,
+ warningCtx->hasContainer() ?
+ warningCtx->getContainer()->getAstElement() : NULL);
+
+ return( os );
+}
+
+
+/**
+ * Serialization
+ */
+void COMPILE_CONTEXT::strHeader(OutStream & os) const
+{
+ os << TAB << ( hasModifier() ? getModifier().toString() : "" )
+ << "COMPILER< ctx: " << mCompileCtx->getFullyQualifiedNameID();
+ if( mCompileCtx != mRuntimeCtx )
+ {
+ os << " , run: " << mRuntimeCtx->getFullyQualifiedNameID();
+ }
+ if( (mType != NULL) && (mType != TypeManager::UNIVERSAL) )
+ {
+ os << " , type " << ( mNeedTypeChecking ? "?:" : ":" )
+ << str_header( mType );
+ }
+ os << " >";
+}
+
+
+void COMPILE_CONTEXT::toStream(OutStream & os) const
+{
+ os << TAB << ( hasModifier() ? getModifier().toString() : "" )
+ << "compiler {" << EOL
+ << TAB2 << "context = " << str_header( mCompileCtx ) << EOL
+ << TAB2 << "runtime = " << str_header( mRuntimeCtx ) << EOL;
+
+ if( mType != NULL )
+ {
+ os << TAB2 << ( mNeedTypeChecking ? "check_" : "" )
+ << "type = " << str_header( mType ) << EOL;
+ }
+
+ os << TAB << "}" << EOL;
+}
+
+
+
+///////////////////////////////////////////////////////////////////////////
+// CACHE MANAGER
+///////////////////////////////////////////////////////////////////////////
+
+List< COMPILE_CONTEXT * > CompilationEnvironment::COMPILE_CONTEXT_CACHE;
+
+
+void CompilationEnvironment::initCache()
+{
+ for( avm_size_t i = 0 ; i < COMPILE_CONTEXT_INITIAL_COUNT ; ++i )
+ {
+ COMPILE_CONTEXT_CACHE.append(
+ new COMPILE_CONTEXT(NULL, NULL, NULL, NULL) );
+ }
+}
+
+void CompilationEnvironment::finalizeCache()
+{
+ avm_size_t finalCacheSize = 0;
+
+ while( COMPILE_CONTEXT_CACHE.nonempty() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+ AVM_OS_TRACE << "COMPILE_CONTEXT::finalize:> @"
+ << avm_address_t( COMPILE_CONTEXT_CACHE.last() ) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+
+ ++finalCacheSize;
+ delete( COMPILE_CONTEXT_CACHE.pop_last() );
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+ AVM_OS_TRACE << "COMPILE_CONTEXT::finalize#cache:> count = "
+ << finalCacheSize << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+}
+
+
+
+COMPILE_CONTEXT * CompilationEnvironment::newCTX(COMPILE_CONTEXT * PREV,
+ BaseAvmProgram * aCompileCtx, ExecutableForm * aRuntimeCtx,
+ InstanceOfData * aVariableCtx, BaseTypeSpecifier * aType,
+ bool needTypeChecking, const Modifier & aModifier)
+{
+ COMPILE_CONTEXT * newCTX = NULL;
+
+ if( COMPILE_CONTEXT_CACHE.nonempty() )
+ {
+ COMPILE_CONTEXT_CACHE.pop_last_to( newCTX );
+
+ newCTX->PREV = PREV;
+
+ // Used for safe memory management !!!
+ if( PREV != NULL )
+ {
+ newCTX->NEXT = PREV->NEXT;
+ PREV->NEXT = newCTX;
+ }
+ else
+ {
+ newCTX->NEXT = NULL;
+ }
+
+ newCTX->mCompileCtx = aCompileCtx;
+ newCTX->mRuntimeCtx = aRuntimeCtx;
+ newCTX->mVariableCtx = aVariableCtx;
+
+ newCTX->mType = aType;
+ newCTX->mNeedTypeChecking = needTypeChecking;
+
+ newCTX->setModifier( aModifier );
+ }
+ else
+ {
+ newCTX = new COMPILE_CONTEXT(PREV,
+ aCompileCtx, aRuntimeCtx, aVariableCtx, aType, aModifier);
+
+ AVM_OS_ASSERT_OUT_OF_MEMORY_EXIT( newCTX )
+ << "CompilationEnvironment::newCTX !!!"
+ << SEND_EXIT;
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+ AVM_OS_TRACE << "COMPILE_CONTEXT::new:> @" << avm_address_t( newCTX )
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+
+ return( newCTX );
+}
+
+
+void CompilationEnvironment::freeCTX(COMPILE_CONTEXT * & CTX)
+{
+ if( CTX->NEXT == NULL )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+ AVM_OS_TRACE << "COMPILE_CONTEXT::free:> @"
+ << avm_address_t( CTX ) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+ COMPILE_CONTEXT_CACHE.append( CTX );
+
+ CTX = NULL;
+ }
+ else
+ {
+ for( COMPILE_CONTEXT * nextCTX = CTX ; CTX != NULL ; CTX = nextCTX )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+ AVM_OS_TRACE << "COMPILE_CONTEXT::free:> @"
+ << avm_address_t( CTX ) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , COMPILING )
+
+ nextCTX = CTX->NEXT;
+// CTX->NEXT = NULL;
+ COMPILE_CONTEXT_CACHE.append( CTX );
+ }
+ }
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/builder/primitive/CompilationEnvironment.h b/org.eclipse.efm.symbex/src/builder/primitive/CompilationEnvironment.h
new file mode 100644
index 0000000..0ad17fd
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/builder/primitive/CompilationEnvironment.h
@@ -0,0 +1,441 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 14 févr. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef COMPILATIONENVIRONMENT_H_
+#define COMPILATIONENVIRONMENT_H_
+
+#include <common/BF.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/executable/AvmProgram.h>
+#include <fml/executable/BaseAvmProgram.h>
+#include <fml/executable/ExecutableForm.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+#include <fml/type/TypeManager.h>
+
+#include <fml/infrastructure/Machine.h>
+
+#include <collection/List.h>
+
+
+#define COMPILE_CONTEXT_INITIAL_COUNT 16
+
+
+namespace sep
+{
+
+class BaseAvmProgram;
+class ExecutableForm;
+class InstanceOfData;
+
+class COMPILE_CONTEXT;
+
+
+class CompilationEnvironment
+{
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ CompilationEnvironment(COMPILE_CONTEXT * aCTX,
+ BaseAvmProgram * aCompileCtx, ExecutableForm * aRuntimeCtx)
+ : mCTX( newCTX(aCTX, aCompileCtx, aRuntimeCtx) )
+ {
+ //!! NOTHING
+ }
+
+// CompilationEnvironment(COMPILE_CONTEXT * aCTX, BaseAvmProgram * aCompileCtx)
+// : mCTX( newCTX(aCTX, aCompileCtx, aCompileCtx->getExecutable()) )
+// {
+// //!! NOTHING
+// }
+
+ CompilationEnvironment(COMPILE_CONTEXT * aCTX, ExecutableForm * aCompileCtx)
+ : mCTX( newCTX(aCTX, aCompileCtx, aCompileCtx) )
+ {
+ //!! NOTHING
+ }
+
+
+ CompilationEnvironment(AvmProgram * aCompileCtx,
+ InstanceOfData * aVariableCtx = NULL)
+ : mCTX( newCTX(NULL, aCompileCtx,
+ aCompileCtx->getExecutable(), aVariableCtx) )
+ {
+ //!! NOTHING
+ }
+
+ CompilationEnvironment(ExecutableForm * aCompileCtx)
+ : mCTX( newCTX(NULL, aCompileCtx, aCompileCtx) )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~CompilationEnvironment()
+ {
+ freeCTX( mCTX );
+ }
+
+
+
+public:
+ /*ATTRIBUTES*/
+
+ COMPILE_CONTEXT * mCTX;
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // CACHE MANAGER
+ ///////////////////////////////////////////////////////////////////////////
+ static List< COMPILE_CONTEXT * > COMPILE_CONTEXT_CACHE;
+
+ static void initCache();
+
+ static void finalizeCache();
+
+
+ static COMPILE_CONTEXT * newCTX(COMPILE_CONTEXT * PREV,
+ BaseAvmProgram * aCompileCtx, ExecutableForm * aRuntimeCtx,
+ InstanceOfData * aVariableCtx = NULL,
+ BaseTypeSpecifier * aType = TypeManager::UNIVERSAL,
+ bool needTypeChecking = true,
+ const Modifier & aModifier = Modifier::PROPERTY_UNDEFINED_MODIFIER);
+
+
+ static void freeCTX(COMPILE_CONTEXT * & CTX);
+
+};
+
+
+
+struct COMPILE_CONTEXT : public ModifierImpl
+{
+
+public:
+ /**
+ * STATIC
+ * ATTRIBUTES
+ */
+ static bool DEFAUL_TYPE_CHECKING_MASK;
+
+ static bool INLINE_DISABLE_MASK;
+
+ static bool INLINE_ENABLE_MASK;
+
+ static bool INLINE_PROCEDURE_MASK;
+
+ /**
+ * ATTRIBUTES
+ */
+ COMPILE_CONTEXT * PREV;
+ COMPILE_CONTEXT * NEXT;
+
+ BaseAvmProgram * mCompileCtx;
+ ExecutableForm * mRuntimeCtx;
+
+ InstanceOfData * mVariableCtx;
+
+ BaseTypeSpecifier * mType;
+
+ bool mNeedTypeChecking;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ COMPILE_CONTEXT(COMPILE_CONTEXT * aCTX, BaseAvmProgram * aCompileCtx,
+ ExecutableForm * aRuntimeCtx, InstanceOfData * aVariableCtx,
+ BaseTypeSpecifier * aType = TypeManager::UNIVERSAL,
+ const Modifier & aModifier = Modifier::PROPERTY_UNDEFINED_MODIFIER)
+ : ModifierImpl( aModifier ),
+ PREV( aCTX ), NEXT( NULL ),
+
+ mCompileCtx ( aCompileCtx ),
+ mRuntimeCtx ( aRuntimeCtx ),
+ mVariableCtx( aVariableCtx ),
+
+ mType( aType ),
+ mNeedTypeChecking( true )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~COMPILE_CONTEXT()
+ {
+ //!! NOTHING
+ }
+
+
+ COMPILE_CONTEXT * newCTX(BaseAvmProgram * aCompileCtx,
+ ExecutableForm * aRuntimeCtx, InstanceOfData * aVariableCtx = NULL)
+ {
+ return( CompilationEnvironment::newCTX(this,
+ aCompileCtx, aRuntimeCtx, aVariableCtx,
+ mType, mNeedTypeChecking, getModifier()) );
+ }
+
+ COMPILE_CONTEXT * newCTX(BaseAvmProgram * aCompileCtx)
+ {
+ return( CompilationEnvironment::newCTX(this,
+ aCompileCtx, aCompileCtx->getExecutable(), mVariableCtx,
+ mType, mNeedTypeChecking, getModifier()) );
+ }
+
+ COMPILE_CONTEXT * newCompileCTX(BaseAvmProgram * aCompileCtx)
+ {
+ return( CompilationEnvironment::newCTX(this,
+ aCompileCtx, mRuntimeCtx, mVariableCtx,
+ mType, mNeedTypeChecking, getModifier()) );
+ }
+
+
+ COMPILE_CONTEXT * newCTX(ExecutableForm * aRuntimeCtx)
+ {
+ return( CompilationEnvironment::newCTX(this,
+ mCompileCtx, aRuntimeCtx, mVariableCtx,
+ mType, mNeedTypeChecking, getModifier()) );
+ }
+
+
+ COMPILE_CONTEXT * newCTX(ExecutableForm * aRuntimeCtx,
+ const Modifier & aModifier)
+ {
+ return( CompilationEnvironment::newCTX(this,
+ mCompileCtx, aRuntimeCtx, mVariableCtx,
+ mType, mNeedTypeChecking, aModifier) );
+ }
+
+ COMPILE_CONTEXT * newCTX(const Modifier & aModifier)
+ {
+ return( CompilationEnvironment::newCTX(this,
+ mCompileCtx, mRuntimeCtx, mVariableCtx,
+ mType, mNeedTypeChecking, aModifier) );
+ }
+
+
+ COMPILE_CONTEXT * clone()
+ {
+ return( CompilationEnvironment::newCTX(this,
+ mCompileCtx, mRuntimeCtx, mVariableCtx,
+ mType, mNeedTypeChecking, getModifier()) );
+ }
+
+ COMPILE_CONTEXT * clone(const TypeSpecifier & aType)
+ {
+ return( CompilationEnvironment::newCTX(this,
+ mCompileCtx, mRuntimeCtx, mVariableCtx,
+ aType.rawType(), mNeedTypeChecking, getModifier()) );
+ }
+
+ COMPILE_CONTEXT * clone(BaseTypeSpecifier * aType)
+ {
+ return( CompilationEnvironment::newCTX(this,
+ mCompileCtx, mRuntimeCtx, mVariableCtx,
+ aType, mNeedTypeChecking, getModifier()) );
+ }
+
+
+ /**
+ * mType
+ */
+ inline bool hasType() const
+ {
+ return( (mType != NULL) && (mType != TypeManager::UNIVERSAL) );
+ }
+
+
+ inline avm_type_specifier_kind_t getTypeFamily() const
+ {
+ return( ( mType != NULL ) ?
+ mType->getTypeSpecifierKind() : TYPE_UNDEFINED_SPECIFIER );
+ }
+
+
+ inline bool typeMustBeMachineFamily() const
+ {
+ return( (mType == NULL)
+ || mType->hasTypeSpecifierKind(TYPE_MACHINE_SPECIFIER,
+ TYPE_UNIVERSAL_SPECIFIER, TYPE_UNDEFINED_SPECIFIER) );
+ }
+
+ inline bool typeMustBePortFamily() const
+ {
+ return( (mType == NULL)
+ || mType->hasTypeSpecifierKind(TYPE_PORT_SPECIFIER,
+ TYPE_SIGNAL_SPECIFIER,TYPE_MESSAGE_SPECIFIER)
+ || mType->hasTypeSpecifierKind(TYPE_UNIVERSAL_SPECIFIER,
+ TYPE_UNDEFINED_SPECIFIER) );
+ }
+
+ inline bool typeMustBeChannelFamily() const
+ {
+ return( (mType == NULL)
+ || mType->hasTypeSpecifierKind(TYPE_CHANNEL_SPECIFIER,
+ TYPE_UNIVERSAL_SPECIFIER, TYPE_UNDEFINED_SPECIFIER) );
+ }
+
+ inline bool typeMustBeBufferFamily() const
+ {
+ return( (mType == NULL)
+ || mType->hasTypeSpecifierKind(TYPE_BUFFER_SPECIFIER,
+ TYPE_UNIVERSAL_SPECIFIER, TYPE_UNDEFINED_SPECIFIER) );
+ }
+
+ inline bool typeMustBeConnectorFamily() const
+ {
+ return( (mType == NULL)
+ || mType->hasTypeSpecifierKind(TYPE_CONNECTOR_SPECIFIER,
+ TYPE_UNIVERSAL_SPECIFIER, TYPE_UNDEFINED_SPECIFIER) );
+ }
+
+
+ inline bool typeCouldBeOherFamily() const
+ {
+ if( mType != NULL )
+ {
+ switch( mType->getTypeSpecifierKind() )
+ {
+ case TYPE_MACHINE_SPECIFIER:
+ case TYPE_PORT_SPECIFIER:
+ case TYPE_SIGNAL_SPECIFIER:
+ case TYPE_MESSAGE_SPECIFIER:
+ case TYPE_CHANNEL_SPECIFIER:
+ case TYPE_BUFFER_SPECIFIER:
+ case TYPE_CONNECTOR_SPECIFIER:
+ return( false );
+
+ default:
+ return( true );
+ }
+ }
+
+ return( true );
+ }
+
+ inline bool typeCouldBeTypeSpecifierFamily() const
+ {
+ return( typeCouldBeOherFamily() );
+ }
+
+ inline bool typeCouldBeTransitionFamily() const
+ {
+ return( typeCouldBeOherFamily() );
+ }
+
+ inline bool typeCouldBeGenericProgramFamily() const
+ {
+ return( typeCouldBeOherFamily() );
+ }
+
+
+
+ /**
+ * mNeedTypeChecking
+ */
+ inline bool isStrongNeedTypeChecking(bool localTypeCheckingMask = true ) const
+ {
+ return( localTypeCheckingMask
+ && DEFAUL_TYPE_CHECKING_MASK
+ && mNeedTypeChecking );
+ }
+
+ inline bool isWeakNeedTypeChecking(bool localTypeCheckingMask = true ) const
+ {
+ return( DEFAUL_TYPE_CHECKING_MASK
+ && (localTypeCheckingMask
+ || mNeedTypeChecking) );
+ }
+
+ inline bool isNeedTypeChecking(bool localTypeCheckingMask = true ) const
+ {
+ return( isStrongNeedTypeChecking(localTypeCheckingMask) );
+ }
+
+
+ /**
+ * mCompileCtx
+ */
+ bool isCompileTransitionCtx()
+ {
+ return( mCompileCtx->is< AvmTransition >() );
+ }
+
+ bool isInlineEnable(ExecutableForm * anExecutable)
+ {
+ return( INLINE_ENABLE_MASK
+ && isCompileTransitionCtx()
+ && anExecutable->isInlinableEnable() );
+ }
+
+
+ bool isInlineProcedure(ExecutableForm * anExecutable)
+ {
+ return( INLINE_PROCEDURE_MASK
+ && isCompileTransitionCtx()
+ && anExecutable->isInlinableProcedure() );
+ }
+
+ /**
+ * mCompileCtx
+ */
+ bool isSpecificRuntimeCtx()
+ {
+ return( (mRuntimeCtx != mCompileCtx)
+ && (mRuntimeCtx != mCompileCtx->getContainer()) );
+ }
+
+
+ /**
+ * report debug Context
+ */
+ OutStream & debugContext(OutStream & os);
+
+ /**
+ * report error Context & Location
+ */
+ OutStream & errorContext(OutStream & os);
+ PairOutStream & errorContext(PairOutStream & os);
+ TripleOutStream & errorContext(TripleOutStream & os);
+
+ OutStream & warningContext(OutStream & os);
+ PairOutStream & warningContext(PairOutStream & os);
+ TripleOutStream & warningContext(TripleOutStream & os);
+
+ /**
+ * Serialization
+ */
+ virtual void strHeader(OutStream & os) const;
+
+ virtual void toStream(OutStream & os) const;
+
+};
+
+
+
+} /* namespace sep */
+#endif /* COMPILATIONENVIRONMENT_H_ */
diff --git a/org.eclipse.efm.symbex/src/cmake/DefineSymbexProject.cmake b/org.eclipse.efm.symbex/src/cmake/DefineSymbexProject.cmake
new file mode 100644
index 0000000..6461705
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/cmake/DefineSymbexProject.cmake
@@ -0,0 +1,42 @@
+# =============================================================================
+# CMake module defining the Symbex project
+# =============================================================================
+
+
+message (STATUS "****** Defining project******")
+
+# Definition of project name and supported languages
+project (Symbex CXX C)
+
+# Project structure : only add directories associated with the build of an
+# internal library (i.e. containing a CMakeLists.txt defining a target)
+# Sources within subdirectories are taken into account by the recursive
+# look-up (see the specific CMakeLists.txt)
+add_subdirectory (base)
+add_subdirectory (builder)
+add_subdirectory (collection)
+add_subdirectory (common)
+add_subdirectory (computer)
+add_subdirectory (fam)
+add_subdirectory (fml)
+add_subdirectory (parser)
+add_subdirectory (printer)
+add_subdirectory (sew)
+add_subdirectory (solver)
+add_subdirectory (util)
+
+
+
+# Main target C++ source files (all files matching patterns)
+file (GLOB_RECURSE MAIN_CXX_SRC_FILES main/*.cpp main/*.h)
+
+# Main target definition (association to its sources)
+add_executable (symbex ${MAIN_CXX_SRC_FILES})
+
+# Adhoc dependencies to force builds from sources (if a prerequisite is not found)
+add_dependencies(symbex rescan_cvc4)
+add_dependencies(symbex rescan_antlr2)
+
+# Main target link - FIXME : duplicate fml and fam needed to link sucessfully
+target_link_libraries (symbex sew parser fam fml fam builder solver computer fml common base collection printer util ${ANTLR2_LIBRARIES} ${ANTLR3_LIBRARIES} ${Boost_LIBRARIES} ${CVC4_LIBRARIES} ${lib_gmp_c} ${lib_gmp_cxx})
+
diff --git a/org.eclipse.efm.symbex/src/cmake/GenerateInfoHeaders.cmake b/org.eclipse.efm.symbex/src/cmake/GenerateInfoHeaders.cmake
new file mode 100644
index 0000000..a87ba9d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/cmake/GenerateInfoHeaders.cmake
@@ -0,0 +1,13 @@
+# =============================================================================
+# CMake module generating source files with useful information
+# =============================================================================
+
+
+message (STATUS "****** Generating informative headers ******")
+
+
+configure_file (${PROJECT_SOURCE_DIR}/src/main/version.h.in ${PROJECT_BINARY_DIR}/main/version.h)
+configure_file (${PROJECT_SOURCE_DIR}/src/util/confs.h.in ${PROJECT_BINARY_DIR}/util/confs.h)
+
+include_directories(${PROJECT_BINARY_DIR}/main)
+include_directories(${PROJECT_BINARY_DIR}/util) \ No newline at end of file
diff --git a/org.eclipse.efm.symbex/src/cmake/INSTALL_tmp-toc.xml b/org.eclipse.efm.symbex/src/cmake/INSTALL_tmp-toc.xml
new file mode 100644
index 0000000..1444e19
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/cmake/INSTALL_tmp-toc.xml
@@ -0,0 +1,44 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!--
+ Copyright (c) 2016 CEA LIST.
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ - Initial API and Implementation
+ -->
+
+<toc topic="src/cmake/INSTALL_tmp.html" label="INSTALL_tmp">
+ <topic href="src/cmake/INSTALL_tmp.html" label="EFM-SYMBEX : Build and Installation Instructions">
+ <topic href="src/cmake/INSTALL_tmp.html#overview" label="Overview"></topic>
+ <topic href="src/cmake/INSTALL_tmp.html#prerequisites-installation" label="Prerequisites installation">
+ <topic href="src/cmake/INSTALL_tmp.html#binaries-almost-installation-on-linux" label="Binaries (almost) installation on Linux">
+ <topic href="src/cmake/INSTALL_tmp.html#cmake" label="CMake"></topic>
+ <topic href="src/cmake/INSTALL_tmp.html#boost" label="Boost"></topic>
+ <topic href="src/cmake/INSTALL_tmp.html#gmp" label="GMP"></topic>
+ <topic href="src/cmake/INSTALL_tmp.html#antlr2" label="ANTLR2"></topic>
+ <topic href="src/cmake/INSTALL_tmp.html#antlr3" label="ANTLR3"></topic>
+ <topic href="src/cmake/INSTALL_tmp.html#cvc4" label="CVC4"></topic>
+ <topic href="src/cmake/INSTALL_tmp.html#omega" label="Omega"></topic>
+ </topic>
+ <topic href="src/cmake/INSTALL_tmp.html#sources-installation-on-linux" label="Sources installation on Linux"></topic>
+ <topic href="src/cmake/INSTALL_tmp.html#sources-installation-on-windows-mingw-msys2" label="Sources installation on Windows/MinGW/MSYS2">
+ <topic href="src/cmake/INSTALL_tmp.html#cmake2" label="CMake"></topic>
+ <topic href="src/cmake/INSTALL_tmp.html#msys2" label="MSYS2"></topic>
+ <topic href="src/cmake/INSTALL_tmp.html#cvc42" label="CVC4"></topic>
+ </topic>
+ </topic>
+ <topic href="src/cmake/INSTALL_tmp.html#standard-build" label="Standard Build"></topic>
+ <topic href="src/cmake/INSTALL_tmp.html#build-customization-for-developers" label="Build Customization (for developers)">
+ <topic href="src/cmake/INSTALL_tmp.html#set-compilation-options" label="Set compilation options"></topic>
+ <topic href="src/cmake/INSTALL_tmp.html#modify-link-command-line" label="Modify link command line"></topic>
+ <topic href="src/cmake/INSTALL_tmp.html#change-prerequisites-look-up-add-a-nex-prerequisite" label="Change prerequisites look-up / Add a nex prerequisite"></topic>
+ <topic href="src/cmake/INSTALL_tmp.html#change-project-structure-without-adding-a-new-target" label="Change project structure without adding a new target"></topic>
+ <topic href="src/cmake/INSTALL_tmp.html#add-a-new-target" label="Add a new target"></topic>
+ </topic>
+ </topic>
+</toc> \ No newline at end of file
diff --git a/org.eclipse.efm.symbex/src/cmake/INSTALL_tmp.html b/org.eclipse.efm.symbex/src/cmake/INSTALL_tmp.html
new file mode 100644
index 0000000..bdc2700
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/cmake/INSTALL_tmp.html
@@ -0,0 +1,231 @@
+<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ </head>
+ <body>
+ <h1 id="efm-symbex-build-and-installation-instructions">EFM-SYMBEX : Build and Installation Instructions</h1>
+ <h2 id="overview">Overview</h2>
+ <p>In order to build EFM-SYMBEX, you'll need :
+ <br/>
+ </p>
+ <ul>
+ <li>
+ <a href="https://cmake.org/download/">CMake</a>, 2.8 or higher
+ </li>
+ <li>
+ <a href="http://www.boost.org/users/download/">Boost</a>, 1.53 or higher
+ </li>
+ <li>
+ <a href="https://gmplib.org/">GMP</a>, 2.5.1.3
+ </li>
+ <li>
+ <a href="http://www.antlr2.org">ANTLR2</a>, C bindings library, 2.7.7
+ </li>
+ <li>
+ <a href="http://www.antlr3.org">ANTLR3</a>, C bindings library, 3.4
+ </li>
+ <li>
+ <a href="http://cvc4.cs.nyu.edu">CVC4</a>, 1.3.1 or higher
+ </li>
+ <li>
+ <a href="https://github.com/davewathaverford/the-omega-project">Omega</a>
+ </li>
+ </ul>
+ <p>EFM-SYMBEX build is driven by CMake and tested with the following generators : </p>
+ <ul>
+ <li>Unix Makefiles (native compilers)</li>
+ </ul>
+ <h2 id="prerequisites-installation">Prerequisites installation</h2>
+ <h3 id="binaries-almost-installation-on-linux">Binaries (almost) installation on Linux</h3>
+ <p>Following instructions are given for debian-like distributions. You should adapt them to the package manager used by your distribution.
+ <br/>
+ </p>
+ <h4 id="cmake">CMake</h4>
+ <p>
+ <code>sudo apt-get install cmake</code>
+ <br/>
+
+ <code>sudo apt-get install cmake-gui</code>
+ <br/>
+ </p>
+ <h4 id="boost">Boost</h4>
+ <p>
+ <code>sudo apt-get install boost-1.53</code>
+ <br/>
+ </p>
+ <h4 id="gmp">GMP</h4>
+ <p>
+ <code>sudo apt-get install libgmp-dev</code>
+ <br/>
+ </p>
+ <h4 id="antlr2">ANTLR2</h4>
+ <p>
+ <code>sudo apt-get install libantlr-dev</code>
+ <br/>
+ </p>
+ <h4 id="antlr3">ANTLR3</h4>
+ <p>As no ANTLR 3.4 package seems available, it is necessary to compile a source distribution :
+ Download
+ <a href="http://www.antlr3.org/download/C/libantlr3c-3.4.tar.gz">libantlr3c-3.4.tar.gz</a> then :
+ <br/>
+ </p>
+ <p>
+ <code>tar zxvf libantlr3c-3.4.tar.gz</code>
+ <br/>
+
+ <code>./configure --enable-static=true --enable-shared=false</code>, add
+ <code>--enable-64bit</code> according to your system.
+ <br/>
+
+ <code>make</code>
+ <br/>
+
+ <code>make check</code>
+ <br/>
+
+ <code>sudo make install</code>
+ <br/>
+ </p>
+ <p>Headers and library should be automatically installed in /usr/local. Use
+ <code>.\configure --prefix=&lt;yourpath&gt;</code> to install in another location. In this case, you'll need to set
+ <code>ANTLR3_ROOT</code> variable to this location for CMake to know about it.
+ <br/>
+ </p>
+ <h4 id="cvc4">CVC4</h4>
+ <p>Add the following lines in
+ <code>/etc/apt/sources.list</code> :
+ <br/>
+ </p>
+ <p>
+ <code>deb http://cvc4.cs.nyu.edu/debian/ stable/</code>
+
+ <code>deb http://cvc4.cs.nyu.edu/debian unstable/</code>
+
+ <code>deb_src http://cvc4.cs.nyu.edu/debian unstable/</code>
+ <br/>
+ </p>
+ <p>Then do :
+ <br/>
+ </p>
+ <p>
+ <code>sudo apt-get update</code>
+ <br/>
+
+ <code>sudo apt-get install cvc4 libcvc4-dev</code>
+ <br/>
+ </p>
+ <h4 id="omega">Omega</h4>
+ <p>No package being available for Omega, it is necessary to compile a source distribution. Clone the source repository :
+ <br/>
+ </p>
+ <p>
+ <code>git clone https://github.com/davewathaverford/the-omega-project.git</code>
+ <br/>
+ </p>
+ <p>Then do : </p>
+ <p>
+ <code>make depends</code>
+ <br/>
+
+ <code>make libomega.a</code>
+ <br/>
+
+ <code>sudo make install</code>
+ </p>
+ <p>Headers and library should be automatically installed in /usr/local. Use .\configure --prefix=/usr/local to install in another location. In this case, you'll need to set
+ <code>OMEGA_ROOT</code> variable to this location for CMake to know about it.
+ </p>
+ <h3 id="sources-installation-on-linux">Sources installation on Linux</h3>
+ <p>
+ <strong>TO BE DONE</strong>
+ </p>
+ <h3 id="sources-installation-on-windows-mingw-msys2">Sources installation on Windows/MinGW/MSYS2</h3>
+ <p>
+ <strong>WARNING : Currently under test</strong>
+ </p>
+ <h4 id="cmake2">CMake</h4>
+ <p>Use the Windows installer found
+ <a href="https://cmake.org/download/">here</a>
+ </p>
+ <h4 id="msys2">MSYS2</h4>
+ <p>Follow the instructions of INSTALL_MSYS.md.</p>
+ <h4 id="cvc42">CVC4</h4>
+ <p>Download the sources archive
+ <a href="http://cvc4.cs.nyu.edu/builds/src/cvc4-1.4.tar.gz">cvc4-1.4.tar.gz</a>
+ </p>
+ <p>
+ <strong>TO BE CONTINUED</strong>
+ </p>
+ <h2 id="standard-build">Standard Build</h2>
+ <p>Launch cmake (or cMake-gui), set the source directory and the desired build directory.
+ Choose a valid generator, select your compilers (native compilers are recommended), configure and generate.
+ If your prerequisites are installed in non-standard locations, you'll have to set
+ <code>&lt;PREREQUISITE&gt;_ROOT</code> variable(s) in the CMake cache editor.
+ <br/>
+ </p>
+ <p>Then build the project using the built-in commands of the generator :
+ <br/>
+ </p>
+ <ul>
+ <li>With "Unix Makefiles", simply do
+ <code>make</code> in the build directory.
+ </li>
+ </ul>
+ <p>A the end of the process, the symbex executable is built and can be checked using
+ <br/>
+ <code>symbex -test</code>.
+ </p>
+ <h2 id="build-customization-for-developers">Build Customization (for developers)</h2>
+ <p>To customize the build, you'll have to modify CMake Files. All CMake files are
+ <code>CMakeLists.txt</code> or
+ <code>*.cmake</code>.
+ Each project target (main executable and internal libraries) is associated with a
+ <code>CMakeLists.txt</code> in which every thing specific to this target are defined. All things relative to the project as a whole (prerequisites, cmake detection module, ...) are stored stored in the cmake directory.
+ </p>
+ <h3 id="set-compilation-options">Set compilation options</h3>
+ <p>Options which hold for all target and whatever the platform are set in
+ <code>DefineGeneric.cmake</code>
+ Options which hold for all target and are platform-specific are set in
+ <code>&lt;Platform&gt;Specific.cmake</code>.
+ Options which hold for one target and whatever the platform are set in the
+ <code>CMakeLists.txt</code> of this target.
+ </p>
+ <h3 id="modify-link-command-line">Modify link command line</h3>
+ <p>Main target link is defined in
+ <code>LinkMainTarget.cmake</code>
+ </p>
+ <h3 id="change-prerequisites-look-up-add-a-nex-prerequisite">Change prerequisites look-up / Add a nex prerequisite</h3>
+ <p>Prerequisites are defined and searched for in
+ <code>LookForMandatoryPrerequisites.cmake</code>.
+ <br/>
+ Here you can add a new prerequisite or change the way an existing prerequisite is search for.
+ </p>
+ <h3 id="change-project-structure-without-adding-a-new-target">Change project structure without adding a new target</h3>
+ <p>Simply add a new subdirectory(ies) into existing target(s) source hierarchy.</p>
+ <h3 id="add-a-new-target">Add a new target</h3>
+ <p>To add a new
+ <code>newtarget</code> to the project, you have to :
+ <br/>
+ </p>
+ <ol>
+ <li>Create the
+ <code>newtarget</code> source hierarchy in
+ <code>src/newtarget/</code>
+ </li>
+ <li>Add a
+ <code>CMakeLists.txt</code> into target root directory
+ <code>newtarget/</code> (it is easy to adapt a
+ <code>CMakeLists.txt</code> from other targets)
+ </li>
+ <li>Add a new
+ <code>add_subdirectory (newtarget)</code> in
+ <code>DefineProjectStructure.cmake</code> to make CMake aware to the new sources
+ </li>
+ <li>Complete
+ <code>LinkMainTarget.cmake</code> by adding
+ <code>newtarget</code> to the link line.
+ </li>
+ </ol>
+ </body>
+</html> \ No newline at end of file
diff --git a/org.eclipse.efm.symbex/src/cmake/INSTALL_tmp.md b/org.eclipse.efm.symbex/src/cmake/INSTALL_tmp.md
new file mode 100644
index 0000000..9bf3c58
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/cmake/INSTALL_tmp.md
@@ -0,0 +1,135 @@
+# EFM-SYMBEX : Build and Installation Instructions
+
+## Overview
+In order to build EFM-SYMBEX, you'll need :
+* [CMake](https://cmake.org/download/), 2.8 or higher
+* [Boost](http://www.boost.org/users/download/), 1.53 or higher
+* [GMP](https://gmplib.org/), 2.5.1.3
+* [ANTLR2](http://www.antlr2.org), C bindings library, 2.7.7
+* [ANTLR3](http://www.antlr3.org), C bindings library, 3.4
+* [CVC4](http://cvc4.cs.nyu.edu), 1.3.1 or higher
+* [Omega](https://github.com/davewathaverford/the-omega-project)
+
+EFM-SYMBEX build is driven by CMake and tested with the following generators :
+
+* Unix Makefiles (native compilers)
+
+## Prerequisites installation
+
+### Binaries (almost) installation on Linux
+
+Following instructions are given for debian-like distributions. You should adapt them to the package manager used by your distribution.
+
+#### CMake
+`sudo apt-get install cmake`
+`sudo apt-get install cmake-gui`
+
+#### Boost
+`sudo apt-get install boost-1.53`
+
+#### GMP
+`sudo apt-get install libgmp-dev`
+
+#### ANTLR2
+`sudo apt-get install libantlr-dev`
+
+#### ANTLR3
+As no ANTLR 3.4 package seems available, it is necessary to compile a source distribution :
+Download [libantlr3c-3.4.tar.gz](http://www.antlr3.org/download/C/libantlr3c-3.4.tar.gz) then :
+
+`tar zxvf libantlr3c-3.4.tar.gz`
+`./configure --enable-static=true --enable-shared=false`, add `--enable-64bit` according to your system.
+`make`
+`make check`
+`sudo make install`
+
+Headers and library should be automatically installed in /usr/local. Use `.\configure --prefix=<yourpath>` to install in another location. In this case, you'll need to set `ANTLR3_ROOT` variable to this location for CMake to know about it.
+
+#### CVC4
+Add the following lines in `/etc/apt/sources.list` :
+
+`deb http://cvc4.cs.nyu.edu/debian/ stable/`
+`deb http://cvc4.cs.nyu.edu/debian unstable/`
+`deb_src http://cvc4.cs.nyu.edu/debian unstable/`
+
+Then do :
+
+`sudo apt-get update`
+`sudo apt-get install cvc4 libcvc4-dev`
+
+#### Omega
+No package being available for Omega, it is necessary to compile a source distribution. Clone the source repository :
+
+`git clone https://github.com/davewathaverford/the-omega-project.git`
+
+Then do :
+
+`make depends`
+`make libomega.a`
+`sudo make install`
+
+Headers and library should be automatically installed in /usr/local. Use .\configure --prefix=/usr/local to install in another location. In this case, you'll need to set `OMEGA_ROOT` variable to this location for CMake to know about it.
+
+### Sources installation on Linux
+**TO BE DONE**
+
+### Sources installation on Windows/MinGW/MSYS2
+**WARNING : Currently under test**
+
+#### CMake
+Use the Windows installer found [here](https://cmake.org/download/)
+
+#### MSYS2
+Follow instructions of INSTALL_MSYS.md.
+
+#### CVC4
+Download the sources archive [cvc4-1.4.tar.gz](http://cvc4.cs.nyu.edu/builds/src/cvc4-1.4.tar.gz)
+
+**TO BE CONTINUED**
+
+## Standard Build
+Launch cmake (or cMake-gui), set the source directory and the desired build directory.
+Choose a valid generator, select your compilers (native compilers are recommended), configure and generate.
+If your prerequisites are installed in non-standard locations, you'll have to set `<PREREQUISITE>_ROOT` variable(s) in the CMake cache editor.
+
+Then build the project using the built-in commands of the generator :
+* With "Unix Makefiles", simply do `make` in the build directory.
+
+A the end of the process, the symbex executable is built and can be checked using `symbex -test `.
+
+## Customize the Build (for developers)
+To customize the build, you'll have to modify CMake Files. All CMake files are `CMakeLists.txt` or `*.cmake`.
+Each project target (main executable and internal libraries) is associated with a `CMakeLists.txt` in which every thing specific to this target are defined. All things relative to the project as a whole (prerequisites, cmake detection module, ...) are stored stored in the cmake directory.
+
+### Set compilation options
+Options which hold for all target and whatever the platform are set in `DefineGeneric.cmake`
+Options which hold for all target and are platform-specific are set in `<Platform>Specific.cmake`.
+Options which hold for one target and whatever the platform are set in the `CMakeLists.txt` of this target.
+
+### Modify link command line
+Main target link is defined in `LinkMainTarget.cmake`
+
+### Change prerequisites look-up / Add a nex prerequisite
+Prerequisites are defined and searched for in `LookForMandatoryPrerequisites.cmake`.
+Here you can add a new prerequisite or change the way an existing prerequisite is search for.
+
+### Change project structure without adding a new target
+Simply add a new subdirectory(ies) into existing target(s) source hierarchy.
+
+### Add a new target
+To add a new `newtarget` to the project, you have to :
+1. Create the `newtarget` source hierarchy in `src/newtarget/`
+1. Add a `CMakeLists.txt` into target root directory `newtarget/` (it is easy to adapt a `CMakeLists.txt` from other targets)
+2. Add a new `add_subdirectory (newtarget)` in `DefineProjectStructure.cmake` to make CMake aware to the new sources
+3. Complete `LinkMainTarget.cmake` by adding `newtarget` to the link line.
+
+
+
+
+
+
+
+
+
+
+
diff --git a/org.eclipse.efm.symbex/src/cmake/INSTALL_tmp.xml b/org.eclipse.efm.symbex/src/cmake/INSTALL_tmp.xml
new file mode 100644
index 0000000..3098d95
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/cmake/INSTALL_tmp.xml
@@ -0,0 +1,308 @@
+<?xml version='1.0' ?>
+<!--
+ Copyright (c) 2016 CEA LIST.
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ - Initial API and Implementation
+ -->
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<book>
+ <title>INSTALL_tmp</title>
+ <chapter id="efm-symbex-build-and-installation-instructions">
+ <title>EFM-SYMBEX : Build and Installation Instructions</title>
+ <section id="overview">
+ <title>Overview</title>
+ <para>In order to build EFM-SYMBEX, you'll need :
+</para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="https://cmake.org/download/">CMake</ulink>, 2.8 or higher
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://www.boost.org/users/download/">Boost</ulink>, 1.53 or higher
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="https://gmplib.org/">GMP</ulink>, 2.5.1.3
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://www.antlr2.org">ANTLR2</ulink>, C bindings library, 2.7.7
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://www.antlr3.org">ANTLR3</ulink>, C bindings library, 3.4
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://cvc4.cs.nyu.edu">CVC4</ulink>, 1.3.1 or higher
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="https://github.com/davewathaverford/the-omega-project">Omega</ulink>
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>EFM-SYMBEX build is driven by CMake and tested with the following generators : </para>
+ <itemizedlist>
+ <listitem>
+ <para>Unix Makefiles (native compilers)</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section id="prerequisites-installation">
+ <title>Prerequisites installation</title>
+ <section id="binaries-almost-installation-on-linux">
+ <title>Binaries (almost) installation on Linux</title>
+ <para>Following instructions are given for debian-like distributions. You should adapt them to the package manager used by your distribution.
+</para>
+ <section id="cmake">
+ <title>CMake</title>
+ <para>
+
+ <code>sudo apt-get install cmake</code>
+
+
+
+ <code>sudo apt-get install cmake-gui</code>
+
+ </para>
+ </section>
+ <section id="boost">
+ <title>Boost</title>
+ <para>
+
+ <code>sudo apt-get install boost-1.53</code>
+
+ </para>
+ </section>
+ <section id="gmp">
+ <title>GMP</title>
+ <para>
+
+ <code>sudo apt-get install libgmp-dev</code>
+
+ </para>
+ </section>
+ <section id="antlr2">
+ <title>ANTLR2</title>
+ <para>
+
+ <code>sudo apt-get install libantlr-dev</code>
+
+ </para>
+ </section>
+ <section id="antlr3">
+ <title>ANTLR3</title>
+ <para>As no ANTLR 3.4 package seems available, it is necessary to compile a source distribution :
+ Download
+ <ulink url="http://www.antlr3.org/download/C/libantlr3c-3.4.tar.gz">libantlr3c-3.4.tar.gz</ulink> then :
+
+
+
+ <code>tar zxvf libantlr3c-3.4.tar.gz</code>
+
+
+
+ <code>./configure --enable-static=true --enable-shared=false</code>, add
+ <code>--enable-64bit</code> according to your system.
+
+
+
+ <code>make</code>
+
+
+
+ <code>make check</code>
+
+
+
+ <code>sudo make install</code>
+
+ </para>
+ <para>Headers and library should be automatically installed in /usr/local. Use
+ <code>.\configure --prefix=&lt;yourpath&gt;</code> to install in another location. In this case, you'll need to set
+ <code>ANTLR3_ROOT</code> variable to this location for CMake to know about it.
+
+ </para>
+ </section>
+ <section id="cvc4">
+ <title>CVC4</title>
+ <para>Add the following lines in
+ <code>/etc/apt/sources.list</code> :
+
+
+
+ <code>deb http://cvc4.cs.nyu.edu/debian/ stable/</code>
+
+
+ <code>deb http://cvc4.cs.nyu.edu/debian unstable/</code>
+
+
+
+ <code>deb_src http://cvc4.cs.nyu.edu/debian unstable/</code>
+
+ Then do :
+
+
+
+ <code>sudo apt-get update</code>
+
+
+
+ <code>sudo apt-get install cvc4 libcvc4-dev</code>
+
+ </para>
+ </section>
+ <section id="omega">
+ <title>Omega</title>
+ <para>No package being available for Omega, it is necessary to compile a source distribution.
+
+ Clone the source repository :
+
+
+
+ <code>git clone https://github.com/davewathaverford/the-omega-project.git</code>
+
+ Then do :
+
+
+ <code>make depends</code>
+
+
+
+ <code>make libomega.a</code>
+
+
+
+ <code>sudo make install</code>
+ </para>
+ <para>Headers and library should be automatically installed in /usr/local. Use .\configure --prefix=/usr/local to install in another location. In this case, you'll need to set
+ <code>OMEGA_ROOT</code> variable to this location for CMake to know about it.
+ </para>
+ </section>
+ </section>
+ <section id="sources-installation-on-linux">
+ <title>Sources installation on Linux</title>
+ <para>
+ <emphasis role="bold">TO BE DONE</emphasis>
+ </para>
+ </section>
+ <section id="sources-installation-on-windows-mingw-msys2">
+ <title>Sources installation on Windows/MinGW/MSYS2</title>
+ <para>
+ <emphasis role="bold">WARNING : Currently under test</emphasis>
+ </para>
+ <section id="cmake2">
+ <title>CMake</title>
+ <para>Use the Windows installer found
+ <ulink url="https://cmake.org/download/">here</ulink>
+ </para>
+ </section>
+ <section id="msys2">
+ <title>MSYS2</title>
+ <para>Follow the instructions of INSTALL_MSYS.md.</para>
+ </section>
+ <section id="cvc42">
+ <title>CVC4</title>
+ <para>Download the sources archive
+ <ulink url="http://cvc4.cs.nyu.edu/builds/src/cvc4-1.4.tar.gz">cvc4-1.4.tar.gz</ulink>
+ </para>
+ <para>
+ <emphasis role="bold">TO BE CONTINUED</emphasis>
+ </para>
+ </section>
+ </section>
+ </section>
+ <section id="standard-build">
+ <title>Standard Build</title>
+ <para>Whatever the platform, launch CMake (or CMake-gui), set the sources directory and the desired build directory.
+ Choose a valid generator, select your compilers (native compilers are recommended), configure and generate.
+ If you have installed prerequisites in non-standard locations, you'll have to set <PREREQUISITE>_ROOT variabl(s)e in the CMake cache editor.
+</para>
+ <para>Then build the project using the built-in commands of the generator :
+</para>
+ <itemizedlist>
+ <listitem>
+ <para>With "Unix Makefiles", simply do
+ <code>make</code> in the build directory.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>A the end of the process, the symbex executable is built and can be checked using
+
+ <code>symbex -test</code>.
+ </para>
+ </section>
+ <section id="build-customization-for-developers">
+ <title>Build Customization (for developers)</title>
+ <para>To customize the build, you'll have to modify CMake Files. All CMake files are CMakeLists.txt or *.cmake.
+ Each project target (main executable and internal libraries) is associated with a CMakeLists.txt in which every thing specific to this target are defined. All things relative to the project as a whole (prerequisites, cmake detection module, ...) are stored stored in the src/cmake directory.</para>
+ <section id="set-compilation-options">
+ <title>Set compilation options</title>
+ <para>Options which hold for all target and whatever the platform are set in
+ <code>DefineGeneric.cmake</code>
+ Options which hold for all target and are platform-specific are set in
+ <code>&lt;Platform&gt;Specific.cmake</code>.
+ Options which hold for one target and whatever the platform are set in the
+ <code>CMakeLists.txt</code> of this target.
+ </para>
+ </section>
+ <section id="modify-link-command-line">
+ <title>Modify link command line</title>
+ <para>Main target link is defined in
+ <code>LinkMainTarget.cmake</code>
+ </para>
+ </section>
+ <section id="change-prerequisites-look-up-add-a-nex-prerequisite">
+ <title>Change prerequisites look-up / Add a nex prerequisite</title>
+ <para>Prerequisites are defined and searched for in
+ <code>LookForMandatoryPrerequisites.cmake</code>. Here you add a new prerequisite or can change the way an existing prerequisite is search for.
+ </para>
+ </section>
+ <section id="change-project-structure-without-adding-a-new-target">
+ <title>Change project structure without adding a new target</title>
+ <para>Simply add a new subdirectory(ies) into existing target(s) source hierarchy.</para>
+ </section>
+ <section id="add-a-new-target">
+ <title>Add a new target</title>
+ <para>To add a new target <newtarget>, you must :
+</para>
+ <orderedlist>
+ <listitem>
+ <para>Create the <newtarget> source hierarchy in src/</para>
+ </listitem>
+ <listitem>
+ <para>Add a CMakeLists.txt into <newtarget> (it is easy to adapt a CMakeLists.txt from other targets) </para>
+ </listitem>
+ <listitem>
+ <para>Add a new line
+ <code>add_subdirectory (&lt;newtarget&gt;)</code> in
+ <code>DefineProjectStructure.cmake</code>
+ 3.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Complete
+ <code>LinkMainTarget.cmake</code> by adding <newtarget> to the link line.
+ </para>
+ </listitem>
+ </orderedlist>
+ </section>
+ </section>
+ </chapter>
+</book> \ No newline at end of file
diff --git a/org.eclipse.efm.symbex/src/cmake/PrintBanner.cmake b/org.eclipse.efm.symbex/src/cmake/PrintBanner.cmake
new file mode 100644
index 0000000..389bf3f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/cmake/PrintBanner.cmake
@@ -0,0 +1,7 @@
+# Banner
+
+message (STATUS "\n _________________________________________________
+ / \\
+ | This is Symbex build system |
+ \\_________________________________________________/
+ ")
diff --git a/org.eclipse.efm.symbex/src/collection/Array.h b/org.eclipse.efm.symbex/src/collection/Array.h
new file mode 100644
index 0000000..a0d384f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/collection/Array.h
@@ -0,0 +1,554 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef CONTAINER_ARRAY_H_
+#define CONTAINER_ARRAY_H_
+
+
+#include <vector>
+
+#include <util/avm_assert.h>
+#include <util/avm_numeric.h>
+#include <base/SmartPointerUtil.h>
+
+
+namespace sep
+{
+
+
+template< typename T >
+class Array
+{
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ T * mTable;
+
+ avm_size_t mSize;
+
+
+public:
+ /**
+ * TYPEDEF
+ * iterator
+ * reference
+ */
+ typedef T * iterator;
+ typedef const T * const_iterator;
+
+ typedef T & reference;
+ typedef const T & const_reference;
+
+ typedef std::vector< T > BaseVector;
+
+
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Array()
+ : mTable( NULL ),
+ mSize( 0 )
+ {
+ //!! NOTHING
+ }
+
+ explicit Array(avm_size_t aSize)
+ : mTable( NULL ),
+ mSize( 0 )
+ {
+ alloc( aSize );
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ Array(const Array & anArray)
+ : mTable( NULL ),
+ mSize( 0 )
+ {
+ alloc( anArray );
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Others
+ */
+ explicit Array(avm_size_t aSize, const_reference defaultValue)
+ : mTable( NULL ),
+ mSize( 0 )
+ {
+ alloc( aSize , defaultValue );
+ }
+
+ explicit Array(const BaseVector & anArray)
+ : mTable( NULL ),
+ mSize( 0 )
+ {
+ alloc( anArray );
+ }
+
+ explicit Array(const Array & anArray,
+ const_reference lastValue)
+ : mTable( NULL ),
+ mSize( 0 )
+ {
+ alloc( anArray , lastValue );
+ }
+
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Array()
+ {
+ delete[] ( mTable );
+
+ mTable = NULL;
+ }
+
+
+ /*
+ ***************************************************************************
+ * RESET
+ ***************************************************************************
+ */
+
+ void reset(T value)
+ {
+ for( avm_size_t offset = 0 ; offset < mSize ; ++offset )
+ {
+ mTable[offset] = value;
+ }
+ }
+
+
+ /*
+ ***************************************************************************
+ * ALLOCATION
+ ***************************************************************************
+ */
+
+ inline void alloc(avm_size_t aSize)
+ {
+ mSize = aSize;
+
+ mTable = ( (mSize > 0)? (new T[ mSize ]) : NULL );
+ }
+
+
+ inline void alloc(avm_size_t aSize, T defaultValue)
+ {
+ alloc( aSize );
+
+ for( avm_size_t offset = 0 ; offset < mSize ; ++offset )
+ {
+ mTable[offset] = defaultValue;
+ }
+ }
+
+
+ inline void alloc(const Array & anArray)
+ {
+ alloc( anArray.size() );
+
+ for( avm_size_t offset = 0 ; offset < mSize ; ++offset )
+ {
+ mTable[offset] = anArray[offset];
+ }
+ }
+
+
+ inline void alloc(const Array & anArray, T lastValue)
+ {
+ avm_size_t aSize = anArray.size();
+ alloc( aSize + 1 );
+
+ for( avm_size_t offset = 0 ; offset < aSize ; ++offset )
+ {
+ mTable[offset] = anArray[offset];
+ }
+ mTable[aSize] = lastValue;
+
+ }
+
+
+ inline void alloc(const BaseVector & anArray)
+ {
+ alloc( anArray.size() );
+
+ for( avm_size_t offset = 0 ; offset < mSize ; ++offset )
+ {
+ mTable[offset] = anArray[offset];
+ }
+ }
+
+
+
+ /*
+ ***************************************************************************
+ * RE-ALLOCATION
+ ***************************************************************************
+ */
+
+ inline void realloc(avm_size_t aSize)
+ {
+ if( mSize != aSize )
+ {
+ delete[] ( mTable );
+
+ alloc( aSize );
+ }
+ }
+
+
+ inline void realloc(avm_size_t aSize, T defaultValue)
+ {
+ if( mSize != aSize )
+ {
+ delete[] ( mTable );
+
+ alloc( aSize );
+ }
+
+ reset( defaultValue );
+ }
+
+
+ inline void realloc(const Array & anArray)
+ {
+ if( mSize != anArray.size() )
+ {
+ delete[] ( mTable );
+
+ alloc( anArray.size() );
+ }
+
+ for( avm_size_t offset = 0 ; offset < mSize ; ++offset )
+ {
+ mTable[offset] = anArray[offset];
+ }
+ }
+
+
+ inline void realloc(const BaseVector & anArray)
+ {
+ if( mSize != anArray.size() )
+ {
+ delete[] ( mTable );
+
+ alloc( anArray.size() );
+ }
+
+ for( avm_size_t offset = 0 ; offset < mSize ; ++offset )
+ {
+ mTable[offset] = anArray[offset];
+ }
+ }
+
+
+ /*
+ ***************************************************************************
+ * RE-SIZE
+ ***************************************************************************
+ */
+
+ inline void resize(avm_size_t aSize)
+ {
+ if( mSize > 0 )
+ {
+ avm_size_t oldSize = mSize;
+ T * oldTable = mTable;
+
+ alloc( aSize );
+
+ if( aSize > oldSize )
+ {
+ aSize = oldSize;
+ }
+
+ for( avm_size_t offset = 0 ; offset < aSize ; ++offset )
+ {
+ mTable[offset] = oldTable[offset];
+ }
+
+ delete [] oldTable;
+ }
+
+ else
+ {
+ alloc(aSize);
+ }
+ }
+
+ inline void resize(avm_size_t aSize, T defaultValue)
+ {
+ if( mSize > 0 )
+ {
+ avm_size_t oldSize = mSize;
+ T * oldTable = mTable;
+
+ alloc( aSize );
+
+ if( aSize > oldSize )
+ {
+ aSize = oldSize;
+ }
+
+ avm_size_t offset = 0;
+
+ for( ; offset < aSize ; ++offset )
+ {
+ mTable[offset] = oldTable[offset];
+ }
+
+ for( ; offset < mSize ; ++offset )
+ {
+ mTable[offset] = defaultValue;
+ }
+
+ delete [] oldTable;
+ }
+
+ else
+ {
+ alloc(aSize, defaultValue);
+ }
+ }
+
+
+ /**
+ * ITERATOR
+ */
+
+ inline iterator begin()
+ {
+ return( mTable );
+ }
+
+ inline const_iterator begin() const
+ {
+ return( mTable );
+ }
+
+
+ inline iterator succ_begin()
+ {
+ return( (mSize > 0)? mTable + 1 : mTable );
+ }
+
+ inline const_iterator succ_begin() const
+ {
+ return( (mSize > 0)? mTable + 1 : mTable );
+ }
+
+
+ inline iterator end()
+ {
+ return( mTable + mSize );
+ }
+
+ inline const_iterator end() const
+ {
+ return( mTable + mSize );
+ }
+
+
+ inline iterator pred_end()
+ {
+ return( (mSize > 0)? mTable + mSize - 1 : mTable );
+ }
+
+ inline const_iterator pred_end() const
+ {
+ return( (mSize > 0)? mTable + mSize - 1 : mTable );
+ }
+
+
+
+ /**
+ * GETTER - SETTER
+ * mTable
+ */
+ inline reference at(avm_size_t offset)
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , mSize ) << SEND_EXIT;
+
+ return( mTable[offset] );
+ }
+
+ inline const_reference at(avm_size_t offset) const
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , mSize ) << SEND_EXIT;
+
+ return( mTable[offset] );
+ }
+
+ inline reference get(avm_size_t offset)
+ {
+ return( mTable[offset] );
+ }
+
+ inline const_reference get(avm_size_t offset) const
+ {
+ return( mTable[offset] );
+ }
+
+
+ inline void set(avm_size_t offset, const T & arg)
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , mSize ) << SEND_EXIT;
+
+ mTable[offset] = arg;
+ }
+
+
+ // operator[]
+ inline reference operator[](avm_size_t offset)
+ {
+ return( mTable[offset] );
+ }
+
+ inline const_reference operator[](avm_size_t offset) const
+ {
+ return( mTable[offset] );
+ }
+
+ // front() and back()
+ inline reference front()
+ {
+ return mTable[0];
+ }
+
+ inline const_reference front() const
+ {
+ return mTable[0];
+ }
+
+ inline reference back()
+ {
+ return mTable[mSize - 1];
+ }
+
+ inline const_reference back() const
+ {
+ return mTable[mSize - 1];
+ }
+
+ // size is constant
+ inline avm_size_t size() const
+ {
+ return( mSize );
+ }
+
+ inline bool empty() const
+ {
+ return( mSize == 0 );
+ }
+
+ inline bool nonempty() const
+ {
+ return( mSize > 0 );
+ }
+
+ inline bool singleton() const
+ {
+ return( mSize == 1 );
+ }
+
+ inline bool populated() const
+ {
+ return( mSize > 1 );
+ }
+
+
+ inline reference first()
+ {
+ return( mTable[0] );
+ }
+
+ inline const_reference first() const
+ {
+ return( mTable[0] );
+ }
+
+
+ inline reference second()
+ {
+ return( mTable[1] );
+ }
+
+ inline const_reference second() const
+ {
+ return( mTable[1] );
+ }
+
+
+ inline reference third()
+ {
+ return( mTable[2] );
+ }
+
+ inline const_reference third() const
+ {
+ return( mTable[2] );
+ }
+
+
+ inline reference last()
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( mSize > 0 )
+ << "last():> Unexpected an empty array !!!"
+ << SEND_EXIT;
+
+ return( mTable[mSize - 1] );
+ }
+
+ inline const_reference last() const
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( mSize > 0 )
+ << "last():> Unexpected an empty array !!!"
+ << SEND_EXIT;
+
+ return( mTable[mSize - 1] );
+ }
+
+ /**
+ * contains a particular element
+ */
+ inline virtual bool contains(const T & arg) const
+ {
+ const_iterator itEnd = end();
+ for( const_iterator it = begin() ; it != itEnd ; ++it )
+ {
+ if( (*it) == arg )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+ }
+
+};
+
+
+}
+
+#endif /*CONTAINER_ARRAY_H_*/
diff --git a/org.eclipse.efm.symbex/src/collection/BFContainer.cpp b/org.eclipse.efm.symbex/src/collection/BFContainer.cpp
new file mode 100644
index 0000000..8311286
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/collection/BFContainer.cpp
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 13 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "BFContainer.h"
+
+
+namespace sep
+{
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/collection/BFContainer.h b/org.eclipse.efm.symbex/src/collection/BFContainer.h
new file mode 100644
index 0000000..77b8d13
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/collection/BFContainer.h
@@ -0,0 +1,958 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 13 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BFCONTAINER_H_
+#define BFCONTAINER_H_
+
+#include <common/AvmObject.h>
+#include <common/AvmPointer.h>
+#include <common/BF.h>
+#include <common/NamedElement.h>
+
+#include <collection/Collection.h>
+#include <collection/Array.h>
+#include <collection/List.h>
+#include <collection/Multiset.h>
+#include <collection/Pair.h>
+#include <collection/Set.h>
+#include <collection/Vector.h>
+
+
+namespace sep
+{
+
+
+class ObjectElement;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// TYPEDEF FOR COLLECTION < BF >
+////////////////////////////////////////////////////////////////////////////////
+
+typedef Collection < BF > BFCollection;
+//typedef List < BF > BFList;
+typedef Array < BF > ArrayOfBF;
+//typedef Vector < BF > BFVector;
+typedef Multiset < BF > BFMultiset;
+typedef Set < BF > BFSet;
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// List of BF
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class BFList : public List < BF >
+{
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef List< BF > BaseListOfBF;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BFList()
+ : BaseListOfBF()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ BFList(const BFList & aList)
+ : BaseListOfBF( aList )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BFList()
+ {
+ BaseListOfBF::clear();
+ }
+
+
+ /**
+ * SAVE
+ */
+ inline void save( Element * anElement )
+ {
+ BaseListOfBF::append( BF( anElement) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // raw iterator
+ ////////////////////////////////////////////////////////////////////////////
+
+ template< class rawT >
+ class raw_iterator : public BFList::iterator
+ {
+ public:
+ raw_iterator()
+ : BFList::iterator( )
+ {
+ //!! NOTHING
+ }
+
+ raw_iterator(const BFList::iterator & anIterator)
+ : BFList::iterator( anIterator )
+ {
+ //!! NOTHING
+ }
+
+ inline operator rawT * () const
+ {
+ BF & current = BFList::iterator::operator*();
+
+ return( current.to_ptr< rawT >() );
+ }
+
+ inline rawT * operator->() const
+ {
+ BF & current = BFList::iterator::operator*();
+
+ return( current.to_ptr< rawT >() );
+ }
+
+ };
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // const raw iterator
+ ////////////////////////////////////////////////////////////////////////////
+
+ template< class rawT >
+ class const_raw_iterator : public BFList::const_iterator
+ {
+ public:
+ const_raw_iterator()
+ : BFList::const_iterator( )
+ {
+ //!! NOTHING
+ }
+
+ const_raw_iterator(const BFList::const_iterator & anIterator)
+ : BFList::const_iterator( anIterator )
+ {
+ //!! NOTHING
+ }
+
+ inline operator rawT * () const
+ {
+ const BF & current = BFList::const_iterator::operator*();
+
+ return( current.to_ptr< rawT >() );
+ }
+
+ inline rawT * operator->() const
+ {
+ const BF & current = BFList::const_iterator::operator*();
+
+ return( current.to_ptr< rawT >() );
+ }
+
+ };
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// Array of BF
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+//class ArrayOfBF : public Array < BF >
+//{
+//
+//public:
+// /**
+// * TYPEDEF
+// */
+// typedef Array < BF > BaseArrayOfBF;
+//
+//
+//public:
+// /**
+// * CONSTRUCTOR
+// * Default
+// */
+// ArrayOfBF()
+// : BaseArrayOfBF()
+// {
+// //!! NOTHING
+// }
+//
+// /**
+// * CONSTRUCTOR
+// * Copy
+// */
+// ArrayOfBF(const ArrayOfBF & anArray)
+// : BaseArrayOfBF( anArray )
+// {
+// //!! NOTHING
+// }
+//
+// /**
+// * CONSTRUCTOR
+// * Others
+// */
+// explicit ArrayOfBF(avm_size_t count)
+// : BaseArrayOfBF(count)
+// {
+// //!! NOTHING
+// }
+//
+// explicit ArrayOfBF(avm_size_t count, const BF & anElement)
+// : BaseArrayOfBF(count, anElement)
+// {
+// //!! NOTHING
+// }
+//
+// ArrayOfBF(const BaseVector & aVector)
+// : BaseArrayOfBF( aVector )
+// {
+// //!! NOTHING
+// }
+//
+// ArrayOfBF(const ArrayOfBF & anArray, const_reference lastValue)
+// : BaseArrayOfBF( anArray , lastValue)
+// {
+// //!! NOTHING
+// }
+//
+//
+// /**
+// * DESTRUCTOR
+// */
+// virtual ~ArrayOfBF()
+// {
+// BaseArrayOfBF::clear();
+// }
+//
+//
+// /**
+// * SAVE
+// */
+// inline void save( Element * anElement )
+// {
+// BaseArrayOfBF::append( BF( anElement) );
+// }
+//
+//
+// ////////////////////////////////////////////////////////////////////////////
+// // raw iterator
+// ////////////////////////////////////////////////////////////////////////////
+//
+// template< class rawT >
+// class raw_iterator : public ArrayOfBF::iterator
+// {
+// public:
+// raw_iterator()
+// : ArrayOfBF::iterator( )
+// {
+// //!! NOTHING
+// }
+//
+// raw_iterator(const ArrayOfBF::iterator & anIterator)
+// : ArrayOfBF::iterator( anIterator )
+// {
+// //!! NOTHING
+// }
+//
+// inline operator rawT * () const
+// {
+// return( ArrayOfBF::iterator::_M_current->to_ptr< rawT >() );
+// }
+//
+// inline rawT * operator->() const
+// {
+// return( ArrayOfBF::iterator::_M_current->to_ptr< rawT >() );
+// }
+//
+// };
+//
+//
+// ////////////////////////////////////////////////////////////////////////////
+// // const raw iterator
+// ////////////////////////////////////////////////////////////////////////////
+//
+// template< class rawT >
+// class const_raw_iterator : public ArrayOfBF::const_iterator
+// {
+// public:
+// const_raw_iterator()
+// : ArrayOfBF::const_iterator( )
+// {
+// //!! NOTHING
+// }
+//
+// const_raw_iterator(const ArrayOfBF::const_iterator & anIterator)
+// : ArrayOfBF::const_iterator( anIterator )
+// {
+// //!! NOTHING
+// }
+//
+// inline operator rawT * () const
+// {
+// return( ArrayOfBF::const_iterator::_M_current->to_ptr< rawT >() );
+// }
+//
+// inline rawT * operator->() const
+// {
+// return( ArrayOfBF::const_iterator::_M_current->to_ptr< rawT >() );
+// }
+//
+// };
+//
+//};
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// Vector of BF
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class BFVector : public Vector < BF >
+{
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef Vector < BF > BaseVectorOfBF;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BFVector()
+ : BaseVectorOfBF()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ BFVector(const BFVector & aVector)
+ : BaseVectorOfBF( aVector )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Others
+ */
+ explicit BFVector(avm_size_t count)
+ : BaseVectorOfBF(count)
+ {
+ //!! NOTHING
+ }
+
+ explicit BFVector(avm_size_t count, const BF & elem)
+ : BaseVectorOfBF(count, elem)
+ {
+ //!! NOTHING
+ }
+
+ explicit BFVector(const BF & arg)
+ : BaseVectorOfBF( arg )
+ {
+ //!! NOTHING
+ }
+
+ explicit BFVector(const BF & arg1, const BF & arg2)
+ : BaseVectorOfBF( arg1, arg2 )
+ {
+ //!! NOTHING
+ }
+
+ explicit BFVector(const BF & arg1, const BF & arg2, const BF & arg3)
+ : BaseVectorOfBF( arg1, arg2, arg3 )
+ {
+ //!! NOTHING
+ }
+
+ explicit BFVector(const BF & arg1, const BF & arg2,
+ const BF & arg3, const BF & arg4)
+ : BaseVectorOfBF( arg1, arg2, arg3, arg4 )
+ {
+ //!! NOTHING
+ }
+
+ explicit BFVector(const BF & arg1, const BF & arg2,
+ const BF & arg3, const BF & arg4, const BF & arg5)
+ : BaseVectorOfBF( arg1, arg2, arg3, arg4, arg5 )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BFVector()
+ {
+ BaseVectorOfBF::clear();
+ }
+
+
+ /**
+ * SAVE
+ */
+ inline void save( Element * anElement )
+ {
+ BaseVectorOfBF::append( BF( anElement) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // raw iterator
+ ////////////////////////////////////////////////////////////////////////////
+
+ template< class rawT >
+ class raw_iterator : public BFVector::iterator
+ {
+ public:
+ raw_iterator()
+ : BFVector::iterator( )
+ {
+ //!! NOTHING
+ }
+
+ raw_iterator(const BFVector::iterator & anIterator)
+ : BFVector::iterator( anIterator )
+ {
+ //!! NOTHING
+ }
+
+ inline operator rawT * () const
+ {
+ return( BFVector::iterator::_M_current->to_ptr< rawT >() );
+ }
+
+ inline rawT * operator->() const
+ {
+ return( BFVector::iterator::_M_current->to_ptr< rawT >() );
+ }
+
+ };
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // const raw iterator
+ ////////////////////////////////////////////////////////////////////////////
+
+ template< class rawT >
+ class const_raw_iterator : public BFVector::const_iterator
+ {
+ public:
+ const_raw_iterator()
+ : BFVector::const_iterator( )
+ {
+ //!! NOTHING
+ }
+
+ const_raw_iterator(const BFVector::const_iterator & anIterator)
+ : BFVector::const_iterator( anIterator )
+ {
+ //!! NOTHING
+ }
+
+ inline operator rawT * () const
+ {
+ return( BFVector::const_iterator::_M_current->to_ptr< rawT >() );
+ }
+
+ inline rawT * operator->() const
+ {
+ return( BFVector::const_iterator::_M_current->to_ptr< rawT >() );
+ }
+
+ };
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// Table of BF with raw_pointer using [ [ Fully ] Qualified ] Name ID - API
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+template< class BaseT >
+class TableOfBF_T :
+ public AvmObject ,
+ public BFVector ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( TableOfBF_T< BaseT > )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( TableOfBF_T )
+
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef BaseT * PointerBaseT;
+
+ typedef BFVector::raw_iterator< BaseT > raw_iterator;
+
+ typedef BFVector::const_raw_iterator< BaseT > const_raw_iterator;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TableOfBF_T()
+ : AvmObject( ),
+ BFVector( )
+ {
+ //!! NOTHING
+ }
+
+ TableOfBF_T(avm_size_t aSize)
+ : AvmObject( ),
+ BFVector( aSize )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ TableOfBF_T(const TableOfBF_T & aTable)
+ : AvmObject( aTable ),
+ BFVector( aTable )
+ {
+ //!! NOTHING
+ }
+
+ TableOfBF_T(const BFVector & aVector)
+ : AvmObject( ),
+ BFVector( aVector )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~TableOfBF_T()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER
+ * Element at <offset> position
+ */
+ inline PointerBaseT rawAt(avm_size_t offset) const
+ {
+ return( BFVector::at(offset).template to_ptr< BaseT >() );
+ }
+
+
+ inline const BF & get(avm_size_t offset) const
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_OFFSET_EXIT( offset , BFVector::size() )
+ << "Unbound Element at <offset> position !!!"
+ << SEND_EXIT;
+
+ return( BFVector::at(offset) );
+ }
+
+
+ /**
+ * GETTER
+ * Element by qlfNameID as QualifiedNameID w.r.t compare_op
+ */
+ inline const BF & getByQualifiedNameID(
+ const std::string & qlfNameID,
+ NamedElement::op_comparer_t op) const
+ {
+ const_iterator it = begin();
+ const_iterator endIt = end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).to_ptr< BaseT >()->compare(qlfNameID, op) )
+ {
+ return( *it );
+ }
+ }
+
+ return( BF::REF_NULL );
+ }
+
+ inline PointerBaseT rawByQualifiedNameID(
+ const std::string & qlfNameID,
+ NamedElement::op_comparer_t op) const
+ {
+ const_iterator it = begin();
+ const_iterator endIt = end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).to_ptr< BaseT >()->compareID(qlfNameID, op) )
+ {
+ return( (*it).to_ptr< BaseT >() );
+ }
+ }
+
+ return( NULL );
+ }
+
+
+ /**
+ * GETTER
+ * Element by Fully Qualified NameID
+ */
+ inline const BF & getByFQNameID(
+ const std::string & aFullyQualifiedNameID) const
+ {
+ const_raw_iterator it = begin();
+ const_raw_iterator endIt = end();
+ for( ; it != endIt ; ++it )
+ {
+ // STRICT:> compare LOCATOR & LOCATION (true:- retry only LOCATION)
+ if( (it)->fqnEquals( aFullyQualifiedNameID , true ) )
+ {
+ return( *it );
+ }
+ }
+
+ return( BF::REF_NULL );
+ }
+
+ inline PointerBaseT rawByFQNameID(
+ const std::string & aFullyQualifiedNameID) const
+ {
+ const_raw_iterator it = begin();
+ const_raw_iterator endIt = end();
+ for( ; it != endIt ; ++it )
+ {
+ // STRICT:> compare LOCATOR & LOCATION (true:- retry only LOCATION)
+ if( (it)->fqnEquals( aFullyQualifiedNameID , true ) )
+ {
+ return( it );
+ }
+ }
+
+ return( NULL );
+ }
+
+
+ /**
+ * GETTER
+ * Element by qlfNameID as QualifiedNameID
+ */
+ inline const BF & getByQualifiedNameID(
+ const std::string & aQualifiedNameID) const
+ {
+ const_iterator it = begin();
+ const_iterator endIt = end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).to_ptr< BaseT >()->fqnEndsWith(aQualifiedNameID) )
+ {
+ return( *it );
+ }
+ }
+
+ return( BF::REF_NULL );
+ }
+
+ inline PointerBaseT rawByQualifiedNameID(
+ const std::string & aQualifiedNameID) const
+ {
+ const_iterator it = begin();
+ const_iterator endIt = end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).to_ptr< BaseT >()->fqnEndsWith(aQualifiedNameID) )
+ {
+ return( (*it).to_ptr< BaseT >() );
+ }
+ }
+
+ return( NULL );
+ }
+
+
+ inline avm_size_t getByQualifiedNameID(
+ const std::string & aQualifiedNameID, BFList & listofFound) const
+ {
+ avm_size_t count = 0;
+
+ const_iterator it = begin();
+ const_iterator endIt = end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).to_ptr< BaseT >()->fqnEndsWith(aQualifiedNameID) )
+ {
+ listofFound.append( *it );
+
+ ++count;
+ }
+ }
+
+ return( count );
+ }
+
+
+ /**
+ * GETTER
+ * Element by aNameID
+ */
+ inline const BF & getByNameID(const std::string & aNameID) const
+ {
+ const_raw_iterator it = begin();
+ const_raw_iterator endIt = end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (it)->getNameID() == aNameID )
+ {
+ return( *it );
+ }
+ }
+
+ return( BF::REF_NULL );
+ }
+
+ inline PointerBaseT rawByNameID(const std::string & aNameID) const
+ {
+ const_raw_iterator it = begin();
+ const_raw_iterator endIt = end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (it)->getNameID() == aNameID )
+ {
+ return( it );
+ }
+ }
+
+ return( NULL );
+ }
+
+ inline avm_size_t getByNameID(
+ const std::string & aNameID, BFList & listofFound) const
+ {
+ avm_size_t count = 0;
+
+ const_raw_iterator it = begin();
+ const_raw_iterator endIt = end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (it)->getNameID() == aNameID )
+ {
+ listofFound.append( *it );
+
+ ++count;
+ }
+ }
+
+ return( count );
+ }
+
+
+ inline avm_offset_t getOffsetByNameID(const std::string & aNameID) const
+ {
+ const_raw_iterator it = begin();
+ const_raw_iterator endIt = end();
+ for( avm_offset_t offset = 0 ; it != endIt ; ++it , ++offset )
+ {
+ if( (it)->getNameID() == aNameID )
+ {
+ return( offset );
+ }
+ }
+ return( AVM_NO_OFFSET );
+ }
+
+
+ /**
+ * GETTER
+ * Element by compiled form
+ */
+ inline const BF & getByAstElement(const ObjectElement * astElement) const
+ {
+ const_raw_iterator it = begin();
+ const_raw_iterator endIt = end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (it)->isAstElement( astElement ) )
+ {
+ return( *it );
+ }
+ }
+
+ return( BF::REF_NULL );
+ }
+
+
+ /**
+ * SAVE
+ * APPEND
+ */
+ inline const BF & save(PointerBaseT anElement)
+ {
+ BFVector::push_back( BF(anElement) );
+
+ return( BFVector::back() );
+ }
+
+ inline void append(const BF & anElement)
+ {
+ BFVector::append( anElement );
+ }
+
+ inline void append(const BFList & aList)
+ {
+ BFVector::append( aList );
+ }
+
+ inline void append(const BFVector & aVector)
+ {
+ BFVector::append( aVector );
+ }
+
+
+ /**
+ * SETTER
+ */
+ inline void set(avm_offset_t offset, const BF & anElement)
+ {
+ BFVector::set(offset, anElement);
+ }
+
+ inline void set(avm_offset_t offset, PointerBaseT anElement)
+ {
+ BFVector::set(offset, BF(anElement));
+ }
+
+
+ /**
+ * contains a particular element
+ */
+ inline bool contains(PointerBaseT anElement) const
+ {
+ if( (anElement->getOffset() < size()) &&
+ (rawAt(anElement->getOffset()) == anElement) )
+ {
+ return( true );
+ }
+ else
+ {
+ const_raw_iterator it = BaseVector::begin();
+ const_raw_iterator endIt = BaseVector::end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (it) == anElement )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+ }
+ }
+
+
+ inline bool contains(const BF & anElement) const
+ {
+ return( anElement.is< BaseT >()
+ && contains( anElement.to_ptr< BaseT >() ) );
+ }
+
+
+ /**
+ * Serialization
+ */
+ inline virtual void strFQN(OutStream & os) const
+ {
+ const_raw_iterator it = begin();
+ const_raw_iterator endIt = end();
+ for( ; it != endIt ; ++it )
+ {
+// os << TAB << str_fqn(it) << EOL;
+ os << TAB << (it)->strFQN() << EOL;
+ }
+ }
+
+
+ inline virtual void strHeader(OutStream & os) const
+ {
+ const_raw_iterator it = begin();
+ const_raw_iterator endIt = end();
+ for( ; it != endIt ; ++it )
+ {
+// os << TAB << str_header( it ) << EOL;
+ (it)->strHeader( os << TAB ); os << EOL;
+ }
+ }
+
+ inline virtual void toStream(OutStream & os) const
+ {
+ const_raw_iterator it = begin();
+ const_raw_iterator endIt = end();
+ for( ; it != endIt ; ++it )
+ {
+ (it)->toStream(os);
+ }
+ }
+
+};
+
+
+/**
+ * operator <<
+ */
+AVM_OS_STREAM_COLLECTION( BFList )
+AVM_OS_STREAM_COLLECTION( ArrayOfBF )
+AVM_OS_STREAM_COLLECTION( BFVector )
+AVM_OS_STREAM_COLLECTION( BFMultiset )
+AVM_OS_STREAM_COLLECTION( BFSet )
+
+
+
+typedef List < BFList * > ListOfBFList;
+
+
+} /* namespace sep */
+
+#endif /* BFCONTAINER_H_ */
diff --git a/org.eclipse.efm.symbex/src/collection/Bitset.h b/org.eclipse.efm.symbex/src/collection/Bitset.h
new file mode 100644
index 0000000..981186f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/collection/Bitset.h
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 nov. 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMBITSET_H_
+#define AVMBITSET_H_
+
+#include <util/avm_injector.h>
+#include <boost/dynamic_bitset.hpp>
+
+#include <util/avm_numeric.h>
+#include <collection/Array.h>
+#include <collection/Vector.h>
+
+
+
+namespace sep
+{
+
+
+class Bitset :
+ public boost::dynamic_bitset<>,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( Bitset )
+{
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef boost::dynamic_bitset<> base_bitset_t;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Bitset()
+ : base_bitset_t( )
+ {
+ //!! NOTHING
+ }
+
+ explicit Bitset(avm_size_t length, bool isSet)
+ : base_bitset_t( length )
+ {
+ if( isSet )
+ {
+ set();
+ }
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ Bitset(const Bitset & aBitset)
+ : base_bitset_t( aBitset )
+ {
+ //!! NOTHING
+ }
+
+
+ Bitset(const base_bitset_t & aBitset)
+ : base_bitset_t( aBitset )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Bitset()
+ {
+ //!! NOTHING
+ }
+
+
+ inline bool allTrue() const
+ {
+ return( base_bitset_t::count() == base_bitset_t::size() );
+ }
+
+ inline bool anyTrue() const
+ {
+ return( base_bitset_t::any() );
+ }
+
+
+ inline bool allFalse() const
+ {
+ return( base_bitset_t::none() );
+ }
+
+ inline bool anyFalse() const
+ {
+ return( base_bitset_t::count() != base_bitset_t::size() );
+ }
+
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// COLEECTION TYPE DEFINITION
+////////////////////////////////////////////////////////////////////////////////
+
+typedef Array< Bitset * > ArrayOfBitset;
+
+typedef Vector< Bitset > VectorOfBitset;
+
+
+}
+
+#endif /* AVMBITSET_H_ */
diff --git a/org.eclipse.efm.symbex/src/collection/CMakeLists.txt b/org.eclipse.efm.symbex/src/collection/CMakeLists.txt
new file mode 100644
index 0000000..3967e12
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/collection/CMakeLists.txt
@@ -0,0 +1,13 @@
+# =============================================================================
+# CMake file for the COLLEC library
+# =============================================================================
+
+# C++ source files to take into account (all files matching patterns recursively)
+file (GLOB_RECURSE COLLEC_CXX_SRC_FILES *.cpp *.h)
+
+# Target to build
+add_library (collection STATIC ${COLLEC_CXX_SRC_FILES})
+
+# Include directories (internal)
+target_include_directories (collection PUBLIC ..) # FIXME : explicit the dependencies lib by lib
+
diff --git a/org.eclipse.efm.symbex/src/collection/Collection.h b/org.eclipse.efm.symbex/src/collection/Collection.h
new file mode 100644
index 0000000..1e0970a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/collection/Collection.h
@@ -0,0 +1,167 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef CONTAINER_COLLECTION_H_
+#define CONTAINER_COLLECTION_H_
+
+#include <list>
+#include <vector>
+
+namespace sep
+{
+
+
+template< typename T >
+class Collection
+{
+
+public:
+
+ /**
+ * TYPEDEF
+ * iterator
+ * reference
+ */
+ typedef T & reference;
+ typedef const T & const_reference;
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Collection()
+ {
+ //!! NOTHING
+ }
+
+
+ /*
+ ***************************************************************************
+ * SETTER
+ * push back & front
+ ***************************************************************************
+ */
+ virtual void push_back(const T & arg) = 0;
+
+ virtual void push_back(const std::list< T > & aCollection) = 0;
+
+ virtual void push_back(const std::vector< T > & aCollection) = 0;
+
+
+ virtual void push_front(const T & arg) = 0;
+
+ virtual void push_front(const std::list< T > & aCollection) = 0;
+
+ virtual void push_front(const std::vector< T > & aCollection) = 0;
+
+
+
+ /*
+ ***************************************************************************
+ * GETTER
+ * emptiness
+ ***************************************************************************
+ */
+ virtual bool empty() const = 0;
+
+ virtual bool nonempty() const = 0;
+
+ virtual bool singleton() const = 0;
+
+ virtual bool populated() const = 0;
+
+
+// virtual avm_size_t size() const = 0;
+
+
+ /**
+ * contains a particular element
+ */
+ virtual bool contains(const T & arg) const = 0;
+
+
+ /*
+ ***************************************************************************
+ * SETTER
+ * append
+ ***************************************************************************
+ */
+ virtual void append(const T & arg) = 0;
+
+ virtual void append(const T & arg1, const T & arg2) = 0;
+
+ virtual void append(T * anArrayOfArgument, int anArgSize) = 0;
+
+
+ /*
+ ***************************************************************************
+ * GETTER - SETTER
+ * add_union
+ ***************************************************************************
+ */
+ virtual void add_union(const T & arg) = 0;
+
+ virtual void add_union(const T & arg1, const T & arg2) = 0;
+
+
+ virtual void add_union(const std::list< T > & aCollection) = 0;
+
+ virtual void add_union(const std::vector< T > & aCollection) = 0;
+
+
+ /*
+ ***************************************************************************
+ * GETTER
+ * first & ... & last
+ ***************************************************************************
+ */
+ virtual reference first() = 0;
+ virtual const_reference first() const = 0;
+
+ virtual T pop_first() = 0;
+
+ virtual void pop_first_to(T & theFirst) = 0;
+
+ virtual reference second() = 0;
+ virtual const_reference second() const = 0;
+
+ virtual reference last() = 0;
+ virtual const_reference last() const = 0;
+
+ virtual T pop_last() = 0;
+
+ virtual void pop_last_to(T & theLast) = 0;
+
+
+ /*
+ ***************************************************************************
+ * SETTER
+ * reset
+ ***************************************************************************
+ */
+ virtual void reset(const T & arg) = 0;
+
+ virtual void reset(const std::list< T > & aCollection) = 0;
+
+ virtual void reset(const std::vector< T > & aCollection) = 0;
+
+
+
+// virtual void makeUnique() = 0;
+
+};
+
+
+}
+
+#endif /*CONTAINER_COLLECTION_H_*/
+
diff --git a/org.eclipse.efm.symbex/src/collection/List.h b/org.eclipse.efm.symbex/src/collection/List.h
new file mode 100644
index 0000000..ecb9013
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/collection/List.h
@@ -0,0 +1,748 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef CONTAINER_LIST_H_
+#define CONTAINER_LIST_H_
+
+#include <list>
+
+#include <util/avm_assert.h>
+#include <util/avm_numeric.h>
+#include <base/SmartPointerUtil.h>
+
+#include <collection/Collection.h>
+
+
+namespace sep
+{
+
+
+template< typename T >
+class List :
+ public std::list< T >,
+ public Collection< T >
+{
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef T & reference;
+ typedef const T & const_reference;
+
+ typedef std::list< T > BaseList;
+ typedef std::vector< T > BaseVector;
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ List()
+ : BaseList()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ List(const List & aList)
+ : BaseList( aList )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Others
+ */
+ explicit List(const T & arg)
+ : BaseList()
+ {
+ append(arg);
+ }
+
+ explicit List(const T & arg1, const T & arg2)
+ : BaseList()
+ {
+ append(arg1, arg2);
+ }
+
+ explicit List(T arg1, T arg2, T arg3)
+ : BaseList()
+ {
+ append(arg1, arg2, arg3);
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~List()
+ {
+ BaseList::clear();
+ }
+
+
+ /*
+ ***************************************************************************
+ * SETTER
+ * pop | push back
+ ***************************************************************************
+ */
+
+ inline virtual void pop_back()
+ {
+ BaseList::pop_back();
+ }
+
+ inline void pop_back(avm_size_t count)
+ {
+ for( ; (count > 0) && nonempty() ; --count )
+ {
+ BaseList::pop_back();
+ }
+ }
+
+
+ inline virtual void push_back(const T & arg)
+ {
+ BaseList::push_back(arg);
+ }
+
+
+ inline virtual void push_back(const std::list< T > & aCollection)
+ {
+ BaseList::insert(BaseList::end(),
+ aCollection.begin(), aCollection.end());
+ }
+
+ template< typename _TOE >
+ inline void push_back(const std::list< _TOE > & aCollection)
+ {
+ BaseList::insert(BaseList::end(),
+ aCollection.begin(), aCollection.end());
+ }
+
+
+ inline virtual void push_back(const std::vector< T > & aCollection)
+ {
+ BaseList::insert(BaseList::end(),
+ aCollection.begin(), aCollection.end());
+ }
+
+ template< typename _TOE >
+ inline void push_back(const std::vector< _TOE > & aCollection)
+ {
+ BaseList::insert(BaseList::end(),
+ aCollection.begin(), aCollection.end());
+ }
+
+
+ inline virtual void push_front(const T & arg)
+ {
+ BaseList::push_front(arg);
+ }
+
+
+ /*
+ ***************************************************************************
+ * SETTER
+ * pop | push front
+ ***************************************************************************
+ */
+
+ inline virtual void pop_front()
+ {
+ BaseList::pop_front();
+ }
+
+ inline void pop_front(avm_size_t count)
+ {
+ for( ; (count > 0) && nonempty() ; --count )
+ {
+ BaseList::pop_front();
+ }
+ }
+
+
+ inline virtual void push_front(const std::list< T > & aCollection)
+ {
+ BaseList::insert(BaseList::begin(),
+ aCollection.begin(), aCollection.end());
+ }
+
+ template< typename _TOE >
+ inline void push_front(const std::list< _TOE > & aCollection)
+ {
+ BaseList::insert(BaseList::begin(),
+ aCollection.begin(), aCollection.end());
+ }
+
+
+ inline virtual void push_front(const std::vector< T > & aCollection)
+ {
+ BaseList::insert(BaseList::begin(),
+ aCollection.begin(), aCollection.end());
+ }
+
+ template< typename _TOE >
+ inline void push_front(const std::vector< _TOE > & aCollection)
+ {
+ BaseList::insert(BaseList::begin(),
+ aCollection.begin(), aCollection.end());
+ }
+
+
+ /*
+ ***************************************************************************
+ * GETTER
+ * emptiness
+ ***************************************************************************
+ */
+ inline virtual bool empty() const
+ {
+ return( BaseList::empty() );
+ }
+
+ inline virtual bool nonempty() const
+ {
+ return( not BaseList::empty() );
+ }
+
+ inline virtual bool singleton() const
+ {
+ //return( size() == 1 );
+
+ typename BaseList::const_iterator it = BaseList::begin();
+ typename BaseList::const_iterator itEnd = BaseList::end();
+ return( (it != itEnd) && ((++it) == itEnd) );
+ }
+
+ inline virtual bool populated() const
+ {
+ //return( size() > 1 );
+
+ typename BaseList::const_iterator it = BaseList::begin();
+ typename BaseList::const_iterator itEnd = BaseList::end();
+ return( (it != itEnd) && ((++it) != itEnd) );
+ }
+
+
+ // inline virtual avm_size_t size() const
+ // {
+ // return( BaseList::size() );
+ // }
+
+
+ /**
+ * contains a particular element
+ */
+ inline virtual bool contains(const T & arg) const
+ {
+ typename BaseList::const_iterator it = BaseList::begin();
+ typename BaseList::const_iterator itEnd = BaseList::end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it) == arg )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+ }
+
+
+ /**
+ * has an intersection with another list
+ */
+ inline virtual bool intersect(const std::list< T > & aCollection) const
+ {
+ typename std::list< T >::const_iterator itCol;
+ typename std::list< T >::const_iterator endItCol = aCollection.end();
+
+ typename BaseList::const_iterator it = BaseList::begin();
+ typename BaseList::const_iterator itEnd = BaseList::end();
+ for( ; it != itEnd ; ++it )
+ {
+ for( itCol = aCollection.begin() ; itCol != endItCol ; ++itCol )
+ {
+ if( (*it) == (*itCol) )
+ {
+ return( true );
+ }
+ }
+ }
+
+ return( false );
+ }
+
+
+ /*
+ ***************************************************************************
+ * SETTER
+ * append
+ ***************************************************************************
+ */
+ inline virtual void append(const T & arg)
+ {
+ BaseList::push_back(arg);
+ }
+
+ inline virtual void append(const T & arg1, const T & arg2)
+ {
+ append(arg1);
+ append(arg2);
+ }
+
+ inline virtual void append(const T & arg1, const T & arg2, const T & arg3)
+ {
+ append(arg1);
+ append(arg2);
+ append(arg3);
+ }
+
+
+ inline virtual void append(T * anArrayOfArgument, int anArgSize)
+ {
+ for (int i = 0 ; i < anArgSize ; ++i)
+ {
+ push_back(anArrayOfArgument[i]);
+ }
+ }
+
+ template< typename _TOE >
+ inline void append(const std::list< _TOE > & aCollection)
+ {
+ BaseList::insert(BaseList::end(),
+ aCollection.begin(), aCollection.end());
+ }
+
+ template< typename _TOE >
+ inline void splice(std::list< _TOE > & aCollection)
+ {
+ BaseList::splice(BaseList::end(), aCollection);
+ }
+
+ template< typename _TOE >
+ inline void append(const std::vector< _TOE > & aCollection)
+ {
+ BaseList::insert(BaseList::end(),
+ aCollection.begin(), aCollection.end());
+ }
+
+
+ /*
+ ***************************************************************************
+ * SETTER
+ * add_union
+ ***************************************************************************
+ */
+ inline virtual void add_union(const T & arg)
+ {
+ if( not contains(arg) )
+ {
+ BaseList::push_back(arg);
+ }
+ }
+
+ inline virtual void add_union(const T & arg1, const T & arg2)
+ {
+ add_union(arg1);
+ add_union(arg2);
+ }
+
+
+ inline virtual void add_union(T * anArrayOfArgument, int anArgSize)
+ {
+ for (int i = 0 ; i < anArgSize ; ++i)
+ {
+ add_union( anArrayOfArgument[i] );
+ }
+ }
+
+
+ inline virtual void add_union(const std::list< T > & aCollection)
+ {
+ typename std::list< T >::const_iterator it = aCollection.begin();
+ for( ; it != aCollection.end() ; ++it )
+ {
+ add_union( (*it) );
+ }
+ }
+
+ inline virtual void add_union(const std::list< T > * aCollection)
+ {
+ typename std::list< T >::const_iterator it = aCollection->begin();
+ for( ; it != aCollection->end() ; ++it )
+ {
+ add_union( (*it) );
+ }
+ }
+
+ inline virtual void add_union(const std::vector< T > & aCollection)
+ {
+ typename std::vector< T >::const_iterator it = aCollection.begin();
+ for( ; it != aCollection.end() ; ++it )
+ {
+ add_union( (*it) );
+ }
+ }
+
+
+ /*
+ ***************************************************************************
+ * GETTER
+ * first & ... & last
+ ***************************************************************************
+ */
+ inline virtual reference first()
+ {
+ return( BaseList::front() );
+ }
+
+ inline virtual const_reference first() const
+ {
+ return( BaseList::front() );
+ }
+
+
+ inline virtual T pop_first()
+ {
+ T theFirst = BaseList::front();
+
+ BaseList::pop_front();
+
+ return( theFirst );
+ }
+
+ inline virtual void pop_first_to(T & theFirst)
+ {
+ theFirst = BaseList::front();
+
+ BaseList::pop_front();
+ }
+
+ inline void remove_first()
+ {
+ BaseList::pop_front();
+ }
+
+
+ inline virtual reference second()
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( populated() )
+ << "Expected a List with size() > 1 !!!"
+ << SEND_EXIT;
+
+ return( *( ++(BaseList::begin()) ) );
+ }
+
+ inline virtual const_reference second() const
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( populated() )
+ << "Expected a List with size() > 1 !!!"
+ << SEND_EXIT;
+
+ return( *( ++(BaseList::begin()) ) );
+ }
+
+
+ inline virtual reference last()
+ {
+ return( *( BaseList::rbegin() ) );
+ }
+
+ inline virtual const_reference last() const
+ {
+ return( *( BaseList::rbegin() ) );
+ }
+
+
+ inline virtual T pop_last()
+ {
+ T theLast = BaseList::back();
+
+ BaseList::pop_back();
+
+ return( theLast );
+ }
+
+ inline virtual void pop_last_to(T & theLast)
+ {
+ theLast = BaseList::back();
+
+ BaseList::pop_back();
+ }
+
+ inline void remove_last()
+ {
+ BaseList::pop_back();
+ }
+
+
+ inline virtual reference at(avm_size_t index)
+ {
+ typename BaseList::iterator it = BaseList::begin();
+ typename BaseList::iterator itEnd = BaseList::end();
+ for( ; (index > 0) && (it != itEnd) ; ++it , --index )
+ {
+ //!!! NOTHING
+ }
+
+ return( ((index == 0) && (it != itEnd)) ? *it : last() );
+ }
+
+ inline virtual const_reference at(avm_size_t index) const
+ {
+ typename BaseList::const_iterator it = BaseList::begin();
+ typename BaseList::const_iterator itEnd = BaseList::end();
+ for( ; (index > 0) && (it != itEnd) ; ++it , --index )
+ {
+ //!!! NOTHING
+ }
+
+ return( ((index == 0) && (it != itEnd)) ? *it : last() );
+ }
+
+
+ inline virtual reference get(avm_size_t index)
+ {
+ return( at(index) );
+ }
+
+ inline virtual const_reference get(avm_size_t index) const
+ {
+ return( at(index) );
+ }
+
+
+ inline T pop_index(avm_size_t index)
+ {
+ typename BaseList::iterator it = BaseList::begin();
+ typename BaseList::iterator itEnd = BaseList::end();
+ for( ; (index > 0) && (it != itEnd) ; ++it , --index )
+ {
+ //!!! NOTHING
+ }
+
+ if( (index == 0) && (it != itEnd) )
+ {
+ T theElt = *it;
+
+ BaseList::erase( it );
+
+ return( theElt );
+ }
+ else
+ {
+ return( pop_last() );
+ }
+ }
+
+
+ /*
+ ***************************************************************************
+ * SETTER
+ * reset
+ ***************************************************************************
+ */
+ inline virtual void reset(const T & arg)
+ {
+ BaseList::clear();
+ push_back(arg);
+ }
+
+
+ inline virtual void reset(const std::list< T > & aCollection)
+ {
+ BaseList::clear();
+
+ push_back(aCollection);
+ }
+
+ inline virtual void reset(const std::vector< T > & aCollection)
+ {
+ BaseList::clear();
+
+ push_back(aCollection);
+ }
+
+
+ template< typename _TOE >
+ inline void reset(const std::list< _TOE > & aCollection)
+ {
+ BaseList::clear();
+
+ push_back(aCollection);
+ }
+
+ template< typename _TOE >
+ inline void reset(const std::vector< _TOE > & aCollection)
+ {
+ BaseList::clear();
+
+ push_back(aCollection);
+ }
+
+
+ inline virtual void remove(const T & arg)
+ {
+ BaseList::remove(arg);
+ }
+
+ inline void remove(const std::list< T > & aCollection)
+ {
+ typename std::list< T >::const_iterator it = aCollection.begin();
+ for( ; it != aCollection.end() ; ++it )
+ {
+ BaseList::remove( (*it) );
+ }
+ }
+
+
+ inline virtual void makeUnique()
+ {
+ if( populated() )
+ {
+ typename BaseList::const_iterator itTmp;
+
+ typename BaseList::iterator it = BaseList::begin();
+ for( ++it ; it != BaseList::end() ; )
+ {
+ for( itTmp = BaseList::begin() ; itTmp != it ; ++itTmp )
+ {
+ if( (*itTmp) == (*it) )
+ {
+ break;
+ }
+ }
+
+ if( itTmp != it )
+ {
+ it = BaseList::erase(it);
+ }
+ else
+ {
+ ++it;
+ }
+ }
+ }
+
+ // BaseList::sort();
+ // BaseList::unique();
+ }
+
+};
+
+
+
+template< typename T >
+class APList : public List< T >
+{
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef T & reference;
+ typedef const T & const_reference;
+
+ typedef List< T > BaseAPList;
+
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ APList()
+ : BaseAPList()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ APList(const APList & aList)
+ : BaseAPList( )
+ {
+ typename BaseAPList::const_iterator it = aList.begin();
+ typename BaseAPList::const_iterator itEnd = aList.end();
+ for( ; it != itEnd ; ++it )
+ {
+ BaseAPList::push_back( sep::incrReferenceCount( *it ) );
+ }
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~APList()
+ {
+ clear();
+ }
+
+ /**
+ * CLEAR
+ */
+ void clear()
+ {
+ while( BaseAPList::nonempty() )
+ {
+ sep::destroy( BaseAPList::pop_last() );
+ }
+
+ BaseAPList::clear();
+ }
+
+};
+
+
+
+/**
+ * MEMORY MANAGEMENT
+ * DESTROY
+ */
+
+template< class T >
+void destroy(List< T * > * aList)
+{
+ while( aList->nonempty() )
+ {
+ sep::destroy( aList->pop_last() );
+ }
+
+ delete( aList );
+
+ aList = NULL;
+}
+
+
+template< class T >
+void destroy(List< T > * aList)
+{
+ delete( aList );
+
+ aList = NULL;
+}
+
+
+
+}
+
+#endif /*CONTAINER_LIST_H_*/
diff --git a/org.eclipse.efm.symbex/src/collection/Multiset.h b/org.eclipse.efm.symbex/src/collection/Multiset.h
new file mode 100644
index 0000000..d1bac0d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/collection/Multiset.h
@@ -0,0 +1,274 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef CONTAINER_MULTISET_H_
+#define CONTAINER_MULTISET_H_
+
+#include <set>
+
+#include <base/SmartPointerUtil.h>
+
+#include <collection/Collection.h>
+
+
+namespace sep
+{
+
+
+template< typename T >
+class Multiset : public std::multiset< T >
+{
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef T & reference;
+ typedef const T & const_reference;
+
+ typedef std::multiset< T > BaseMultiset;
+ typedef std::vector< T > BaseVector;
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Multiset()
+ : BaseMultiset()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ Multiset(const Multiset & aMultiset)
+ : BaseMultiset( aMultiset )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Others
+ */
+ explicit Multiset(const T & arg)
+ : BaseMultiset()
+ {
+ append(arg);
+ }
+
+ explicit Multiset(const T & arg1, const T & arg2)
+ : BaseMultiset()
+ {
+ append(arg1, arg2);
+ }
+
+ explicit Multiset(const T & arg1, const T & arg2, const T & arg3)
+ : BaseMultiset()
+ {
+ append(arg1, arg2, arg3);
+ }
+
+ explicit Multiset(const T & arg1, const T & arg2,
+ const T & arg3, const T & arg4)
+ : BaseMultiset()
+ {
+ append(arg1, arg2, arg3, arg4);
+ }
+
+ explicit Multiset(const T & arg1, const T & arg2,
+ const T & arg3, const T & arg4, const T & arg5)
+ : BaseMultiset()
+ {
+ append(arg1, arg2, arg3, arg4, arg5);
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Multiset()
+ {
+ BaseMultiset::clear();
+ }
+
+
+ /*
+ ***************************************************************************
+ * GETTER
+ * emptiness
+ ***************************************************************************
+ */
+ inline virtual bool empty() const
+ {
+ return( BaseMultiset::empty() );
+ }
+
+ inline virtual bool nonempty() const
+ {
+ return( not BaseMultiset::empty() );
+ }
+
+ inline virtual bool singleton() const
+ {
+ typename
+ BaseMultiset::const_iterator it = BaseMultiset::begin();
+ typename
+ BaseMultiset::const_iterator itEnd = BaseMultiset::end();
+ return( (it != itEnd) && ((++it) == itEnd) );
+ }
+
+ inline virtual bool populated() const
+ {
+ typename
+ BaseMultiset::const_iterator it = BaseMultiset::begin();
+ typename
+ BaseMultiset::const_iterator itEnd = BaseMultiset::end();
+ return( (it != itEnd) && ((++it) != itEnd) );
+ }
+
+
+ // inline virtual avm_size_t size() const
+ // {
+ // return( BaseMultiset::size() );
+ // }
+
+
+ /**
+ * contains a particular element
+ */
+ inline virtual bool contains(const T & arg) const
+ {
+ typename
+ BaseMultiset::const_iterator it = BaseMultiset::begin();
+ typename
+ BaseMultiset::const_iterator itEnd = BaseMultiset::end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it) == arg )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+ }
+
+
+ /*
+ ***************************************************************************
+ * SETTER
+ * append
+ ***************************************************************************
+ */
+ inline virtual void append(const T & arg)
+ {
+ BaseMultiset::push_back(arg);
+ }
+
+ inline virtual void append(const T & arg1, const T & arg2)
+ {
+ append(arg1);
+ append(arg2);
+ }
+
+ inline virtual void append(const T & arg1, const T & arg2, const T & arg3)
+ {
+ append(arg1);
+ append(arg2);
+ append(arg3);
+ }
+
+ inline virtual void append(const T & arg1, const T & arg2,
+ const T & arg3, const T & arg4)
+ {
+ append(arg1);
+ append(arg2);
+ append(arg3);
+ append(arg4);
+ }
+
+ inline virtual void append(const T & arg1, const T & arg2,
+ const T & arg3, const T & arg4, const T & arg5)
+ {
+ append(arg1);
+ append(arg2);
+ append(arg3);
+ append(arg4);
+ append(arg5);
+ }
+
+
+ template< typename _TOE >
+ inline void append(const std::multiset< _TOE > & aCollection)
+ {
+ BaseMultiset::insert(BaseMultiset::end(),
+ aCollection.begin(), aCollection.end());
+ }
+
+ template< typename _TOE >
+ inline void splice(const std::multiset< _TOE > & aCollection)
+ {
+ BaseMultiset::splice(
+ BaseMultiset::end(), aCollection);
+ }
+
+ template< typename _TOE >
+ inline void append(const std::vector< _TOE > & aCollection)
+ {
+ BaseMultiset::insert(BaseMultiset::end(),
+ aCollection.begin(), aCollection.end());
+ }
+
+};
+
+
+/**
+ * MEMORY MANAGEMENT
+ * DESTROY
+ */
+
+template< class T >
+void destroy(Multiset< T * > * & aMultiset)
+{
+ while( aMultiset->nonempty() )
+ {
+ sep::destroy( aMultiset->pop_last() );
+ }
+
+ delete( aMultiset );
+
+ aMultiset = NULL;
+}
+
+
+template< class T >
+void destroy(Multiset< T > * & aMultiset)
+{
+ while( aMultiset->nonempty() )
+ {
+ sep::destroy( aMultiset->pop_last() );
+ }
+
+ delete( aMultiset );
+
+ aMultiset = NULL;
+}
+
+
+}
+
+#endif /*CONTAINER_MULTISET_H_*/
diff --git a/org.eclipse.efm.symbex/src/collection/Pair.h b/org.eclipse.efm.symbex/src/collection/Pair.h
new file mode 100644
index 0000000..e37c95c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/collection/Pair.h
@@ -0,0 +1,215 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef CONTAINER_PAIR_H_
+#define CONTAINER_PAIR_H_
+
+#include <base/SmartPointerUtil.h>
+
+
+namespace sep
+{
+
+
+template< typename T , typename U >
+class Pair
+{
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef T & referenceT;
+ typedef const T & const_referenceT;
+
+ typedef U & referenceU;
+ typedef const U & const_referenceU;
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Pair()
+ : theFirst( ),
+ theSecond( )
+ {
+ }
+
+ explicit Pair(T one)
+ : theFirst( one ),
+ theSecond( )
+ {
+ }
+
+// explicit Pair(U two)
+// : theFirst( ),
+// theSecond( two )
+// {
+// }
+
+ explicit Pair(T one, U two)
+ : theFirst( one ),
+ theSecond( two )
+ {
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ Pair(const Pair & aPair)
+ : theFirst( aPair.theFirst ),
+ theSecond( aPair.theSecond )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Pair()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * theFirst
+ */
+ referenceT first()
+ {
+ return( theFirst );
+ }
+
+ const_referenceT first() const
+ {
+ return( theFirst );
+ }
+
+ void setFirst(T one)
+ {
+ theFirst = one;
+ }
+
+ void setFirst(const_referenceT one)
+ {
+ theFirst = one;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * theSecond
+ */
+ referenceU second()
+ {
+ return( theSecond );
+ }
+
+ const_referenceU second() const
+ {
+ return( theSecond );
+ }
+
+ void setSecond(U two)
+ {
+ theSecond = two;
+ }
+
+ void setSecond(const_referenceU two)
+ {
+ theSecond = two;
+ }
+
+
+ /**
+ * COMPARISON
+ * OPERATOR
+ */
+ inline bool operator==(const Pair & other) const
+ {
+ return( (theFirst == other.theFirst) && (theSecond == other.theSecond) );
+ }
+
+ inline bool operator!=(const Pair & other) const
+ {
+ return( (theFirst != other.theFirst) || (theSecond != other.theSecond) );
+ }
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ T theFirst;
+
+ U theSecond;
+
+
+};
+
+
+
+/**
+ * MEMORY MANAGEMENT
+ * DESTROY
+ */
+
+template< typename T , typename U >
+void destroy(Pair< T * , U * > * aPair)
+{
+ sep::destroy( aPair->first() );
+ sep::destroy( aPair->second() );
+
+ delete( aPair );
+
+ aPair = NULL;
+}
+
+
+template< typename T , typename U >
+void destroy(Pair< T * , U > * aPair)
+{
+ sep::destroy( aPair->first() );
+
+ delete( aPair );
+
+ aPair = NULL;
+}
+
+
+template< typename T , typename U >
+void destroy(Pair< T , U * > * aPair)
+{
+ sep::destroy( aPair->second() );
+
+ delete( aPair );
+
+ aPair = NULL;
+}
+
+
+template< typename T , typename U >
+void destroy(Pair< T , U > * aPair)
+{
+ delete( aPair );
+
+ aPair = NULL;
+}
+
+
+
+
+}
+
+#endif /*CONTAINER_PAIR_H_*/
diff --git a/org.eclipse.efm.symbex/src/collection/README.md b/org.eclipse.efm.symbex/src/collection/README.md
new file mode 100644
index 0000000..51b873a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/collection/README.md
@@ -0,0 +1,16 @@
+# EFM-SYMBEX : Container
+
+## Source code structure
+
+### Interfaces
+* **Container**
+
+### Classes
+* **List**
+* **Vector**
+* **Multiset**
+* **Set**
+
+### Factories
+* **Collection**
+
diff --git a/org.eclipse.efm.symbex/src/collection/Set.h b/org.eclipse.efm.symbex/src/collection/Set.h
new file mode 100644
index 0000000..e63453c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/collection/Set.h
@@ -0,0 +1,190 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef CONTAINER_SET_H_
+#define CONTAINER_SET_H_
+
+#include <set>
+
+#include <base/SmartPointerUtil.h>
+
+
+namespace sep
+{
+
+
+template< typename T >
+class Set : public std::set< T >
+{
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef T & reference;
+ typedef const T & const_reference;
+
+ typedef std::set< T > BaseSet;
+ typedef std::vector< T > BaseVector;
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Set()
+ : BaseSet()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ Set(const Set & aSet)
+ : BaseSet( aSet )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Set()
+ {
+ BaseSet::clear();
+ }
+
+
+ /*
+ ***************************************************************************
+ * GETTER
+ * emptiness
+ ***************************************************************************
+ */
+ inline virtual bool empty() const
+ {
+ return( BaseSet::empty() );
+ }
+
+ inline virtual bool nonempty() const
+ {
+ return( not BaseSet::empty() );
+ }
+
+ inline virtual bool singleton() const
+ {
+ //return( size() == 1 );
+
+ typename BaseSet::const_iterator it = BaseSet::begin();
+ typename BaseSet::const_iterator itEnd = BaseSet::end();
+ return( (it != itEnd) && ((++it) == itEnd) );
+ }
+
+ inline virtual bool populated() const
+ {
+ //return( size() > 1 );
+
+ typename BaseSet::const_iterator it = BaseSet::begin();
+ typename BaseSet::const_iterator itEnd = BaseSet::end();
+ return( (it != itEnd) && ((++it) != itEnd) );
+ }
+
+
+ /**
+ * contains a particular element
+ */
+ inline virtual bool contains(const T & arg) const
+ {
+ typename BaseSet::const_iterator it = BaseSet::begin();
+ typename BaseSet::const_iterator itEnd = BaseSet::end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it) == arg )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+ }
+
+
+ /*
+ ***************************************************************************
+ * SETTER
+ * append
+ ***************************************************************************
+ */
+
+ template< typename _TOE >
+ inline void append(const std::set< _TOE > & aCollection)
+ {
+ BaseSet::insert(BaseSet::end(),
+ aCollection.begin(), aCollection.end());
+ }
+
+ template< typename _TOE >
+ inline void splice(const std::set< _TOE > & aCollection)
+ {
+ BaseSet::splice(BaseSet::end(),
+ aCollection);
+ }
+
+ template< typename _TOE >
+ inline void append(const std::vector< _TOE > & aCollection)
+ {
+ BaseSet::insert(BaseSet::end(),
+ aCollection.begin(), aCollection.end());
+ }
+
+};
+
+
+/**
+ * MEMORY MANAGEMENT
+ * DESTROY
+ */
+
+template< class T >
+void destroy(Set< T * > * & aSet)
+{
+ while( aSet->nonempty() )
+ {
+ sep::destroy( aSet->pop_last() );
+ }
+
+ delete( aSet );
+
+ aSet = NULL;
+}
+
+
+template< class T >
+void destroy(Set< T > * & aSet)
+{
+ while( aSet->nonempty() )
+ {
+ sep::destroy( aSet->pop_last() );
+ }
+
+ delete( aSet );
+
+ aSet = NULL;
+}
+
+
+}
+
+#endif /*CONTAINER_SET_H_*/
diff --git a/org.eclipse.efm.symbex/src/collection/Typedef.h b/org.eclipse.efm.symbex/src/collection/Typedef.h
new file mode 100644
index 0000000..3b9ae08
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/collection/Typedef.h
@@ -0,0 +1,182 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef CONTAINER_TYPEDEF_H_
+#define CONTAINER_TYPEDEF_H_
+
+
+#include <collection/Array.h>
+
+#include <collection/Collection.h>
+
+#include <collection/List.h>
+
+#include <collection/Multiset.h>
+
+#include <collection/Pair.h>
+
+#include <collection/Set.h>
+
+#include <collection/Vector.h>
+
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// MACRO FOR TYPEDEF DEFINITION
+////////////////////////////////////////////////////////////////////////////////
+
+
+// LIST
+#define DEFINE_LIST_REF_T(ClassName, TypedefName) \
+ typedef List < ClassName > ListOf##TypedefName;
+
+#define DEFINE_LIST_REF(ClassName) \
+ typedef List < ClassName > ListOf##ClassName;
+
+#define DEFINE_LIST_PTR_T(ClassName, TypedefName) \
+ typedef List < ClassName * > ListOf##TypedefName;
+
+#define DEFINE_LIST_PTR(ClassName) \
+ typedef List < ClassName * > ListOf##ClassName;
+
+
+// VECTOR
+#define DEFINE_VECTOR_REF_T(ClassName, TypedefName) \
+ typedef Vector < ClassName > VectorOf##TypedefName;
+
+#define DEFINE_VECTOR_REF(ClassName) \
+ typedef Vector < ClassName > VectorOf##ClassName;
+
+#define DEFINE_VECTOR_PTR_T(ClassName, TypedefName) \
+ typedef Vector < ClassName * > VectorOf##TypedefName;
+
+#define DEFINE_VECTOR_PTR(ClassName) \
+ typedef Vector < ClassName * > VectorOf##ClassName;
+
+#define DEFINE_APVECTOR_PTR(ClassName) \
+ typedef APVector < ClassName * > APVectorOf##ClassName;
+
+
+
+// PAIR
+#define DEFINE_PAIR_REF(ClassNameA, ClassNameB, TypedefName) \
+ typedef Pair < ClassNameA , ClassNameB > TypedefName;
+
+#define DEFINE_PAIR_PTR(ClassNameA, ClassNameB, TypedefName) \
+ typedef Pair < ClassNameA * , ClassNameB * > TypedefName;
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CLASS
+////////////////////////////////////////////////////////////////////////////////
+
+
+class BFCode;
+class RuntimeID;
+
+class AvmProgram;
+class AvmTransition;
+
+class ExecutableForm;
+
+class Form;
+
+class InstanceOfBuffer;
+class InstanceOfData;
+class InstanceOfMachine;
+class InstanceOfPort;
+
+class Machine;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// TYPEDEF FOR COLLECTION < BFCode >
+////////////////////////////////////////////////////////////////////////////////
+
+typedef Collection < BFCode > BFCodeCollection;
+typedef List < BFCode > BFCodeList;
+typedef Vector < BFCode > BFCodeVector;
+
+
+/**
+ * TYPE LIST DECLARATIONS
+ */
+
+DEFINE_LIST_REF_T(int , Int)
+
+DEFINE_LIST_REF_T( std::string , String )
+
+
+////////////////////////////////////////////////////////////////////////////////
+// List
+////////////////////////////////////////////////////////////////////////////////
+
+DEFINE_LIST_PTR( Machine )
+
+DEFINE_LIST_PTR( AvmProgram )
+
+DEFINE_LIST_PTR( AvmTransition )
+
+DEFINE_LIST_PTR( ExecutableForm )
+
+DEFINE_LIST_PTR( InstanceOfBuffer )
+DEFINE_LIST_PTR( InstanceOfData )
+DEFINE_LIST_PTR( InstanceOfMachine )
+DEFINE_LIST_PTR( InstanceOfPort )
+
+
+/**
+ * TYPE VECTOR DECLARATIONS
+ */
+DEFINE_VECTOR_REF_T(int , Int)
+
+DEFINE_VECTOR_REF_T( std::string , String )
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Vector
+////////////////////////////////////////////////////////////////////////////////
+
+DEFINE_VECTOR_PTR( AvmProgram )
+
+DEFINE_VECTOR_PTR( AvmTransition )
+
+DEFINE_VECTOR_PTR( ExecutableForm )
+
+DEFINE_VECTOR_PTR( InstanceOfData )
+
+DEFINE_VECTOR_PTR( InstanceOfMachine )
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Set & Multiset
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * TYPE MIXED DECLARATIONS
+ */
+
+DEFINE_PAIR_REF( RuntimeID , ListOfInstanceOfData , PairMachineData )
+
+DEFINE_LIST_REF( PairMachineData )
+
+
+}
+
+#endif /*CONTAINER_TYPEDEF_H_*/
+
diff --git a/org.eclipse.efm.symbex/src/collection/Vector.h b/org.eclipse.efm.symbex/src/collection/Vector.h
new file mode 100644
index 0000000..b8280f6
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/collection/Vector.h
@@ -0,0 +1,1008 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef CONTAINER_VECTOR_H_
+#define CONTAINER_VECTOR_H_
+
+#include <vector>
+
+#include <util/avm_assert.h>
+#include <util/avm_numeric.h>
+#include <base/SmartPointerUtil.h>
+
+#include <collection/Collection.h>
+
+
+namespace sep
+{
+
+
+template<typename T>
+class Vector :
+ public std::vector< T >,
+ public Collection< T >
+{
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef T & reference;
+ typedef const T & const_reference;
+
+ typedef std::list< T > BaseList;
+ typedef std::vector< T > BaseVector;
+
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Vector()
+ : BaseVector()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ Vector(const Vector & aVec)
+ : BaseVector( aVec )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Others
+ */
+ explicit Vector(avm_size_t count)
+ : BaseVector(count)
+ {
+ //!! NOTHING
+ }
+
+ explicit Vector(avm_size_t count, const T & elem)
+ : BaseVector(count, elem)
+ {
+ //!! NOTHING
+ }
+
+ explicit Vector(const T & arg)
+ : BaseVector()
+ {
+ append(arg);
+ }
+
+ explicit Vector(const T & arg1, const T & arg2)
+ : BaseVector()
+ {
+ append(arg1, arg2);
+ }
+
+ explicit Vector(const T & arg1, const T & arg2, const T & arg3)
+ : BaseVector()
+ {
+ append(arg1, arg2, arg3);
+ }
+
+ explicit Vector(const T & arg1, const T & arg2,
+ const T & arg3, const T & arg4)
+ : BaseVector()
+ {
+ append(arg1, arg2, arg3, arg4);
+ }
+
+ explicit Vector(const T & arg1, const T & arg2,
+ const T & arg3, const T & arg4, const T & arg5)
+ : BaseVector()
+ {
+ append(arg1, arg2, arg3, arg4, arg5);
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Vector()
+ {
+ BaseVector::clear();
+ }
+
+
+ /*
+ ***************************************************************************
+ * SETTER
+ * push back & front
+ ***************************************************************************
+ */
+ inline virtual void push_back(const T & arg)
+ {
+ BaseVector::push_back(arg);
+ }
+
+
+ inline virtual void push_back(const std::list< T > & aCollection)
+ {
+ BaseVector::insert(BaseVector::end(),
+ aCollection.begin(), aCollection.end());
+ }
+
+ template< typename _TOE >
+ inline void push_back(const std::list< _TOE > & aCollection)
+ {
+ BaseVector::insert(BaseVector::end(),
+ aCollection.begin(), aCollection.end());
+ }
+
+
+ inline virtual void push_back(const std::vector< T > & aCollection)
+ {
+ BaseVector::insert(BaseVector::end(),
+ aCollection.begin(), aCollection.end());
+ }
+
+ template< typename _TOE >
+ inline void push_back(const std::vector< _TOE > & aCollection)
+ {
+ BaseVector::insert(BaseVector::end(),
+ aCollection.begin(), aCollection.end());
+ }
+
+
+
+ inline virtual void push_front(const T & arg)
+ {
+ BaseVector::insert(BaseVector::begin(), arg);
+ }
+
+ inline virtual void push_front(const std::list< T > & aCollection)
+ {
+ BaseVector::insert(BaseVector::begin(),
+ aCollection.begin(), aCollection.end());
+ }
+
+ template< typename _TOE >
+ inline void push_front(const std::list< _TOE > & aCollection)
+ {
+ BaseVector::insert(BaseVector::begin(),
+ aCollection.begin(), aCollection.end());
+ }
+
+
+ inline virtual void push_front(const std::vector< T > & aCollection)
+ {
+ BaseVector::insert(BaseVector::begin(),
+ aCollection.begin(), aCollection.end());
+ }
+
+ template< typename _TOE >
+ inline void push_front(const std::vector< _TOE > & aCollection)
+ {
+ BaseVector::insert(BaseVector::begin(),
+ aCollection.begin(), aCollection.end());
+ }
+
+
+ /*
+ ***************************************************************************
+ * GETTER
+ * emptiness
+ ***************************************************************************
+ */
+ inline virtual bool empty() const
+ {
+ return( BaseVector::empty() );
+ }
+
+ inline virtual bool nonempty() const
+ {
+ return( not BaseVector::empty() );
+ }
+
+ inline virtual bool singleton() const
+ {
+ return( BaseVector::size() == 1 );
+ }
+
+ inline virtual bool populated() const
+ {
+ return( BaseVector::size() > 1 );
+ }
+
+
+ /**
+ * contains a particular element
+ */
+ inline virtual bool contains(const T & arg) const
+ {
+ typename
+ BaseVector::const_iterator it = BaseVector::begin();
+ typename
+ BaseVector::const_iterator itEnd = BaseVector::end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it) == arg )
+ {
+ return( true );
+ }
+ }
+
+ // for( avm_size_t it = 0 ; it != BaseVector::size() ; ++it )
+ // {
+ // if( BaseVector::at(it) == arg )
+ // {
+ // return( true );
+ // }
+ // }
+
+ return( false );
+ }
+
+
+ inline virtual bool contains(const std::vector< T > & aCollection)
+ {
+ typename
+ std::vector< T >::const_iterator it = aCollection.begin();
+ typename
+ std::vector< T >::const_iterator itEnd = aCollection.end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( not contains( (*it) ) )
+ {
+ return( false );
+ }
+ }
+
+ if(empty() && !aCollection.empty())
+ {
+ return( false );
+ }
+ else
+ {
+ return( true );
+ }
+ }
+
+
+ template< typename U >
+ inline int find(U arg) const
+ {
+ for( avm_size_t it = 0 ; it != BaseVector::size() ; ++it )
+ {
+ if( BaseVector::at(it) == arg )
+ {
+ return( it );
+ }
+ }
+
+
+ return( -1 );
+ }
+
+
+ /*
+ ***************************************************************************
+ * SETTER
+ * append
+ ***************************************************************************
+ */
+ inline virtual void append(const T & arg)
+ {
+ BaseVector::push_back(arg);
+ }
+
+ inline virtual void append(const T & arg1, const T & arg2)
+ {
+ append(arg1);
+ append(arg2);
+ }
+
+ inline virtual void append(const T & arg1, const T & arg2, const T & arg3)
+ {
+ append(arg1);
+ append(arg2);
+ append(arg3);
+ }
+
+ inline virtual void append(const T & arg1,
+ const T & arg2, const T & arg3, const T & arg4)
+ {
+ append(arg1);
+ append(arg2);
+ append(arg3);
+ append(arg4);
+ }
+
+ inline virtual void append(const T & arg1, const T & arg2,
+ const T & arg3, const T & arg4, const T & arg5)
+ {
+ append(arg1);
+ append(arg2);
+ append(arg3);
+ append(arg4);
+ append(arg5);
+ }
+
+
+ inline virtual void append(T * anArrayOfArgument, int anArgSize)
+ {
+ for (int i = 0 ; i < anArgSize ; ++i)
+ {
+ push_back(anArrayOfArgument[i]);
+ }
+ }
+
+ template< typename _TOE >
+ inline void append(const std::list< _TOE > & aCollection)
+ {
+ BaseVector::insert(BaseVector::end(),
+ aCollection.begin(), aCollection.end());
+ }
+
+ template< typename _TOE >
+ inline void append(const std::vector< _TOE > & aCollection)
+ {
+ BaseVector::insert(BaseVector::end(),
+ aCollection.begin(), aCollection.end());
+ }
+
+ template< typename _TOE >
+ inline void appendTail(const std::vector< _TOE > & aCollection)
+ {
+ BaseVector::insert(BaseVector::end(),
+ aCollection.begin() + 1, aCollection.end());
+ }
+
+ template< typename _TOE >
+ inline void splice(std::vector< _TOE > & aCollection)
+ {
+ BaseVector::insert(BaseVector::end(),
+ aCollection.begin(), aCollection.end());
+ aCollection.clear();
+ }
+
+
+ /*
+ ***************************************************************************
+ * SETTER
+ * add_union
+ ***************************************************************************
+ */
+ inline virtual void add_union(const T & arg)
+ {
+ if( not contains(arg) )
+ {
+ BaseVector::push_back(arg);
+ }
+ }
+
+ inline virtual void add_union(const T & arg1, const T & arg2)
+ {
+ add_union(arg1);
+ add_union(arg2);
+ }
+
+
+ inline virtual void add_union(T * anArrayOfArgument, int anArgSize)
+ {
+ for (int i = 0 ; i < anArgSize ; ++i)
+ {
+ add_union( anArrayOfArgument[i] );
+ }
+ }
+
+
+ inline virtual void add_union(const std::list< T > & aCollection)
+ {
+ typename std::list< T >::const_iterator it = aCollection.begin();
+ for( ; it != aCollection.end() ; ++it )
+ {
+ add_union( (*it) );
+ }
+ }
+
+ inline virtual void add_union(const std::vector< T > & aCollection)
+ {
+ typename std::vector< T >::const_iterator it = aCollection.begin();
+ for( ; it != aCollection.end() ; ++it )
+ {
+ add_union( (*it) );
+ }
+ }
+
+
+ /*
+ ***************************************************************************
+ * GETTER
+ * first & ... & last
+ ***************************************************************************
+ */
+ inline virtual reference first()
+ {
+ return( BaseVector::front() );
+ }
+
+ inline virtual const_reference first() const
+ {
+ return( BaseVector::front() );
+ }
+
+ inline virtual reference getArg1()
+ {
+ return get(0);
+ }
+
+ inline virtual const_reference getArg1() const
+ {
+ return get(0);
+ }
+
+
+ inline virtual void pop_front()
+ {
+ BaseVector::erase(BaseVector::begin());
+ }
+
+
+ inline virtual T pop_first()
+ {
+ T theFirst = BaseVector::front();
+
+ BaseVector::erase( BaseVector::begin() );
+
+ return( theFirst );
+ }
+
+ inline virtual void pop_first_to(T & theFirst)
+ {
+ theFirst = BaseVector::front();
+
+ BaseVector::erase( BaseVector::begin() );
+ }
+
+ inline virtual void remove_first()
+ {
+ BaseVector::erase( BaseVector::begin() );
+ }
+
+
+ inline virtual reference second()
+ {
+ return( get(1) );
+ }
+
+ inline virtual const_reference second() const
+ {
+ return( get(1) );
+ }
+
+ inline virtual reference getArg2()
+ {
+ return get(1);
+ }
+
+ inline virtual const_reference getArg2() const
+ {
+ return get(1);
+ }
+
+
+ inline virtual reference third()
+ {
+ return( get(2) );
+ }
+
+ inline virtual const_reference third() const
+ {
+ return( get(2) );
+ }
+
+ inline virtual reference getArg3()
+ {
+ return get(2);
+ }
+
+ inline virtual const_reference getArg3() const
+ {
+ return get(2);
+ }
+
+
+ inline virtual reference fourth()
+ {
+ return( get(3) );
+ }
+
+ inline virtual const_reference fourth() const
+ {
+ return( get(3) );
+ }
+
+ inline virtual reference getArg4()
+ {
+ return get(3);
+ }
+
+ inline virtual const_reference getArg4() const
+ {
+ return get(3);
+ }
+
+
+ inline virtual reference fifth()
+ {
+ return( get(4) );
+ }
+
+ inline virtual const_reference fifth() const
+ {
+ return( get(4) );
+ }
+
+ inline virtual reference getArg5()
+ {
+ return get(4);
+ }
+
+ inline virtual const_reference getArg5() const
+ {
+ return get(4);
+ }
+
+
+ inline virtual reference sixth()
+ {
+ return( get(5) );
+ }
+
+ inline virtual const_reference sixth() const
+ {
+ return( get(5) );
+ }
+
+ inline virtual reference getArg6()
+ {
+ return get(5);
+ }
+
+ inline virtual const_reference getArg6() const
+ {
+ return get(5);
+ }
+
+
+ inline virtual reference seventh()
+ {
+ return get(6);
+ }
+
+ inline virtual const_reference seventh() const
+ {
+ return get(6);
+ }
+
+ inline virtual reference getArg7()
+ {
+ return get(6);
+ }
+
+ inline virtual const_reference getArg7() const
+ {
+ return get(6);
+ }
+
+
+ inline virtual reference last()
+ {
+ return( BaseVector::back() );
+ }
+
+ inline virtual const_reference last() const
+ {
+ return( BaseVector::back() );
+ }
+
+
+ inline virtual T pop_last()
+ {
+ T theLast = BaseVector::back();
+
+ BaseVector::pop_back();
+
+ return( theLast );
+ }
+
+ inline virtual void pop_last_to(T & theLast)
+ {
+ theLast = BaseVector::back();
+
+ BaseVector::pop_back();
+ }
+
+ inline virtual void remove_last()
+ {
+ BaseVector::pop_back();
+ }
+
+ inline virtual reference get(avm_size_t index)
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT(index, BaseVector::size())
+ << SEND_EXIT;
+
+ return( BaseVector::at(index) );
+ }
+
+ inline virtual const_reference get(avm_size_t index) const
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT(index, BaseVector::size())
+ << SEND_EXIT;
+
+ return( BaseVector::at(index) );
+ }
+
+////////////////////////////////////////////////////////////////////////////////
+//////// UNCOMMENT FOR << vector::_M_range_check >> EXCEPTION DEBUGGING ////////
+////////////////////////////////////////////////////////////////////////////////
+//
+// inline virtual reference at(avm_size_t index)
+// {
+// AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT(index, BaseVector::size())
+// << SEND_EXIT;
+//
+// return( BaseVector::at(index) );
+// }
+//
+// inline virtual const_reference at(avm_size_t index) const
+// {
+// AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT(index, BaseVector::size())
+// << SEND_EXIT;
+//
+// return( BaseVector::at(index) );
+// }
+//
+//
+// inline virtual reference operator[](avm_size_t index)
+// {
+// AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT(index, BaseVector::size())
+// << SEND_EXIT;
+//
+// return( BaseVector::operator[](index) );
+// }
+//
+// inline virtual const_reference operator[](avm_size_t index) const
+// {
+// AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT(index, BaseVector::size())
+// << SEND_EXIT;
+//
+// return( BaseVector::operator[](index) );
+// }
+////////////////////////////////////////////////////////////////////////////////
+
+
+ inline virtual void set(avm_size_t index, const T & arg)
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT(index, BaseVector::size())
+ << SEND_EXIT;
+
+ (*this)[index] = arg;
+ }
+
+
+ /*
+ ***************************************************************************
+ * GETTER / SETTER
+ * reverse access
+ ***************************************************************************
+ */
+
+ inline virtual reference reverse_at(avm_size_t index)
+ {
+// AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT(index, BaseVector::size())
+// << SEND_EXIT;
+
+ return( BaseVector::
+ at(BaseVector::size() - 1 - index) );
+ }
+
+ inline virtual const_reference reverse_at(avm_size_t index) const
+ {
+// AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT(index, BaseVector::size())
+// << SEND_EXIT;
+
+ return( BaseVector::
+ at(BaseVector::size() - 1 - index) );
+ }
+
+
+ inline virtual reference reverse_get(avm_size_t index)
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT(index, BaseVector::size())
+ << SEND_EXIT;
+
+ return( BaseVector::
+ at(BaseVector::size() - 1 - index) );
+ }
+
+ inline virtual const_reference reverse_get(avm_size_t index) const
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT(index, BaseVector::size())
+ << SEND_EXIT;
+
+ return( BaseVector::
+ at(BaseVector::size() - 1 - index) );
+ }
+
+
+
+ inline virtual void reverse_set(avm_size_t index, const T & arg)
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT(index, BaseVector::size())
+ << SEND_EXIT;
+
+ (*this)[BaseVector::size() - 1 - index] = arg;
+ }
+
+
+
+ /*
+ ***************************************************************************
+ * SETTER
+ * reset
+ ***************************************************************************
+ */
+ inline virtual void reset(const T & arg)
+ {
+ BaseVector::clear();
+
+ append(arg);
+ }
+
+ inline virtual void reset(const T & arg1, const T & arg2)
+ {
+ BaseVector::clear();
+
+ append(arg1);
+ append(arg2);
+ }
+
+ inline virtual void reset(const T & arg1, const T & arg2, const T & arg3)
+ {
+ BaseVector::clear();
+
+ append(arg1);
+ append(arg2);
+ append(arg3);
+ }
+
+ inline virtual void reset(const T & arg1,
+ const T & arg2, const T & arg3, const T & arg4)
+ {
+ BaseVector::clear();
+
+ append(arg1);
+ append(arg2);
+ append(arg3);
+ append(arg4);
+ }
+
+ inline virtual void reset(const T & arg1, const T & arg2,
+ const T & arg3, const T & arg4, const T & arg5)
+ {
+ BaseVector::clear();
+
+ append(arg1);
+ append(arg2);
+ append(arg3);
+ append(arg4);
+ append(arg5);
+ }
+
+
+ inline virtual void reset(T* anArrayOfArgument, int anArgSize)
+ {
+ BaseVector::clear();
+
+ for (int i = 0 ; i < anArgSize ; ++i)
+ {
+ push_back(anArrayOfArgument[i]);
+ }
+ }
+
+
+ inline virtual void reset(const std::list< T > & aCollection)
+ {
+ BaseVector::clear();
+
+ push_back(aCollection);
+ }
+
+ inline virtual void reset(const std::vector< T > & aCollection)
+ {
+ BaseVector::clear();
+
+ push_back(aCollection);
+ }
+
+
+ template< typename _TOE >
+ inline void reset(const std::list< _TOE > & aCollection)
+ {
+ BaseVector::clear();
+
+ push_back(aCollection);
+ }
+
+ template< typename _TOE >
+ inline void reset(const std::vector< _TOE > & aCollection)
+ {
+ BaseVector::clear();
+
+ push_back(aCollection);
+ }
+
+ /**
+ * erase - remove (<=> erase all)
+ *
+ */
+ inline virtual void remove(const T & arg)
+ {
+ typename BaseVector::iterator it = BaseVector::begin();
+ for( ; it != BaseVector::end() ; ++it )
+ {
+ if( (*it) == arg )
+ {
+ BaseVector::erase(it);
+ break;
+ }
+ }
+
+
+ // for( avm_size_t it = 0 ; it != BaseVector::size() ; ++it )
+ // {
+ // if( BaseVector::at(it) == arg )
+ // {
+ // BaseVector::erase(BaseVector::begin() + it);
+ // break;
+ // }
+ // }
+ }
+
+ inline virtual void rremove(const T & arg)
+ {
+ typename
+ BaseVector::reverse_iterator it =BaseVector::rbegin();
+ for( ; it != BaseVector::rend() ; ++it )
+ {
+ if( (*it) == arg )
+ {
+ BaseVector::erase( --( it.base() ) );
+ break;
+ }
+ }
+ }
+
+};
+
+
+
+
+
+template< typename T >
+class APVector : public Vector< T >
+{
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef T & reference;
+ typedef const T & const_reference;
+
+ typedef Vector< T > BaseAPVector;
+
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ APVector()
+ : BaseAPVector()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ APVector(const APVector & aVector)
+ : BaseAPVector( )
+ {
+ typename BaseAPVector::const_iterator it = aVector.begin();
+ typename BaseAPVector::const_iterator itEnd = aVector.end();
+ for( ; it != itEnd ; ++it )
+ {
+ BaseAPVector::push_back( sep::incrReferenceCount( *it ) );
+ }
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~APVector()
+ {
+ typename
+ BaseAPVector::const_iterator it = BaseAPVector::begin();
+ typename
+ BaseAPVector::const_iterator itEnd = BaseAPVector::end();
+ for( ; it != itEnd ; ++it )
+ {
+ sep::destroy( *it );
+ }
+ }
+
+ /**
+ * CLEAR
+ */
+ void clear()
+ {
+ while( BaseAPVector::nonempty() )
+ {
+ sep::destroy( BaseAPVector::pop_last() );
+ }
+
+ BaseAPVector::clear();
+ }
+
+};
+
+
+
+/**
+ * MEMORY MANAGEMENT
+ * DESTROY
+ */
+
+template< class T >
+void destroy(Vector< T * > * & aVector)
+{
+ typename Vector< T * >::iterator it = aVector->begin();
+ typename Vector< T * >::iterator itEnd = aVector->end();
+ for( ; it != itEnd ; ++it )
+ {
+ sep::destroy( *it );
+ }
+
+ delete( aVector );
+
+ aVector = NULL;
+}
+
+
+template< class T >
+void destroy(Vector< T > * & aVector)
+{
+ delete( aVector );
+
+ aVector = NULL;
+}
+
+
+
+}
+
+#endif /*CONTAINER_VECTOR_H_*/
diff --git a/org.eclipse.efm.symbex/src/common/AvmObject.cpp b/org.eclipse.efm.symbex/src/common/AvmObject.cpp
new file mode 100644
index 0000000..e898f5d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/common/AvmObject.cpp
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 juil. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmObject.h"
+
+namespace sep
+{
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/common/AvmObject.h b/org.eclipse.efm.symbex/src/common/AvmObject.h
new file mode 100644
index 0000000..1862794
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/common/AvmObject.h
@@ -0,0 +1,180 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 juil. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef REFERENCECOUNTER_H_
+#define REFERENCECOUNTER_H_
+
+#include <util/avm_assert.h>
+#include <util/avm_debug.h>
+#include <util/avm_injector.h>
+
+#include <base/ReferenceCounter.h>
+
+#include <printer/OutStream.h>
+
+
+namespace sep
+{
+
+
+class AvmObject :
+ public ReferenceCounter,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( AvmObject )
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmObject( )
+ : ReferenceCounter( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ AvmObject(const AvmObject & anObject)
+ : ReferenceCounter( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AvmObject()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * AVM DEBUG REF COUNTER
+ */
+ inline void AVM_DEBUG_REF_COUNTER(OutStream & os) const
+ {
+AVM_IF_DEBUG_FLAG( REFERENCE_COUNTING )
+ os << " /* < ref: " << getRefCount() << " > */" << std::flush;
+AVM_ENDIF_DEBUG_FLAG( REFERENCE_COUNTING )
+ }
+
+ inline std::string AVM_DEBUG_REF_COUNTER() const
+ {
+ StringOutStream oss;
+
+ AVM_DEBUG_REF_COUNTER(oss);
+
+ return( oss.str() );
+ }
+
+ inline std::string strRefCount() const
+ {
+ return( OSS() << " /* < ref: " << getRefCount() << " > */" );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SERIALIZATION API
+ ////////////////////////////////////////////////////////////////////////////
+
+// template< class OS_T >
+// OS_T & osStream(OS_T & os) const
+// {
+// toStream( os );
+//
+// return( os );
+// }
+
+
+ inline virtual OutStream & osStream(OutStream & os) const
+ {
+ toStream( os );
+
+ return( os );
+ }
+
+ inline virtual StringOutStream & osStream(StringOutStream & os) const
+ {
+ toStream( os );
+
+ return( os );
+ }
+
+ inline virtual PairOutStream & osStream(PairOutStream & os) const
+ {
+ toStream( os );
+
+ return( os );
+ }
+
+ inline virtual TripleOutStream & osStream(TripleOutStream & os) const
+ {
+ toStream( os );
+
+ return( os );
+ }
+
+
+ inline virtual void toStream(OutStream & os) const
+ {
+ //!! NOTHING
+ }
+
+ inline virtual void toStream(PairOutStream & os) const
+ {
+ toStream( os.OS1);
+ toStream(os.OS2 );
+ }
+
+ inline virtual void toStream(TripleOutStream & os) const
+ {
+ toStream( os.OS1);
+ toStream(os.OS2);
+ toStream(os.OS3 );
+ }
+
+
+ inline virtual std::string toString(
+ const AvmIndent & indent = AVM_TAB_INDENT) const
+ {
+ StringOutStream oss(indent);
+
+ toStream( oss );
+
+ return( oss.str() );
+ }
+
+
+ /**
+ * TRACE on DESTROY
+ * dbgDestroy
+ */
+ inline void dbgDestroy() const
+ {
+ AVM_OS_WARN << "destroy< @ " << avm_address_t( this )
+ << " , " << std::setw(16) << "AvmObject" << " > :"
+ << std::flush << str_indent( this ) << std::endl;
+ }
+
+};
+
+
+}
+
+#endif /* REFERENCECOUNTER_H_ */
diff --git a/org.eclipse.efm.symbex/src/common/AvmPointer.cpp b/org.eclipse.efm.symbex/src/common/AvmPointer.cpp
new file mode 100644
index 0000000..538a429
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/common/AvmPointer.cpp
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 2 févr. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmPointer.h"
+
+namespace sep
+{
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/common/AvmPointer.h b/org.eclipse.efm.symbex/src/common/AvmPointer.h
new file mode 100644
index 0000000..f46082b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/common/AvmPointer.h
@@ -0,0 +1,352 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 2 févr. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMPOINTER_H_
+#define AVMPOINTER_H_
+
+#include <base/SmartPointer.h>
+
+
+#include <common/BF.h>
+
+#include <printer/OutStream.h>
+
+
+namespace sep
+{
+
+
+template< class T , class Tdestructor >
+class AvmPointer : public SmartPointer< T , Tdestructor >
+{
+
+private:
+ /**
+ * TYPEDEF
+ */
+ typedef SmartPointer< T , Tdestructor > base_this_type;
+ typedef AvmPointer< T , Tdestructor > this_type;
+
+protected:
+ typedef T value_type;
+
+ typedef T & reference;
+ typedef const T & const_reference;
+
+
+ typedef T * pointer;
+ typedef const T * const_pointer;
+
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmPointer()
+ : base_this_type( )
+ {
+ //!!! NOTHING
+ }
+
+ explicit AvmPointer(pointer ptr)
+ : base_this_type( ptr )
+ {
+ //!!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ AvmPointer(const AvmPointer & other)
+ : base_this_type( other )
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AvmPointer()
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * CAST
+ */
+ inline operator pointer () const
+ {
+ return( base_this_type::mPTR );
+ }
+
+ // Desactive call of << delete >> using compiler ambiguous mecanism
+ inline operator void * () const
+ {
+ return( this_type::raw_pointer() );
+ }
+
+
+ /**
+ * OPERATORS
+ */
+ inline pointer operator-> () const
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( base_this_type::mPTR )
+ << "raw_pointer in AvmPointer !!!"
+ << SEND_EXIT;
+
+ return( base_this_type::mPTR );
+ }
+
+
+ /**
+ * ASSIGNMENT
+ */
+ inline AvmPointer & operator=(pointer aPtr)
+ {
+ if( base_this_type::mPTR != aPtr )
+ {
+ base_this_type::release( aPtr );
+ }
+ return( *this );
+ }
+
+ inline AvmPointer & operator=(const AvmPointer & other)
+ {
+ if( base_this_type::mPTR != other.mPTR )
+ {
+ base_this_type::release_acquire( other.mPTR );
+ }
+ return( *this );
+ }
+
+
+ inline AvmPointer & operator=(const BF & other)
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( other.is_weakly< value_type >() )
+ << "Invalid Assignment Cast of a BF to a "
+ "AvmPointer< T , Tdestructor > !!!"
+ << SEND_EXIT;
+
+ if( base_this_type::mPTR != other.raw_pointer() )
+ {
+ base_this_type::release_acquire( const_cast<pointer>(
+ static_cast< pointer >(other.raw_pointer()) ) );
+ }
+ return( *this );
+ }
+
+
+ /**
+ * COMPARISON
+ * OPERATOR
+ */
+
+ inline bool operator==(const_pointer aPtr) const
+ {
+ return( base_this_type::mPTR == aPtr );
+ }
+
+ template< class U >
+ inline bool operator==(const U * aPtr) const
+ {
+ return( base_this_type::mPTR == aPtr );
+ }
+
+ inline bool operator==(const AvmPointer & other) const
+ {
+ return( base_this_type::mPTR == other.mPTR );
+ }
+
+ inline bool operator==(const BF & other) const
+ {
+ return( base_this_type::mPTR == other.raw_pointer() );
+ }
+
+
+ inline bool operator!=(const_pointer aPtr) const
+ {
+ return( base_this_type::mPTR != aPtr );
+ }
+
+ template< class U >
+ inline bool operator!=(const U * aPtr) const
+ {
+ return( base_this_type::mPTR != aPtr );
+ }
+
+ inline bool operator!=(const AvmPointer & other) const
+ {
+ return( base_this_type::mPTR != other.mPTR );
+ }
+
+ inline bool operator!=(const BF & other) const
+ {
+ return( base_this_type::mPTR != other.raw_pointer() );
+ }
+
+
+
+ /**
+ * COMPARISON
+ */
+ inline bool isEQ(const_pointer aPtr) const
+ {
+ return( base_this_type::mPTR == aPtr );
+ }
+
+ inline bool isEQ(const AvmPointer & other) const
+ {
+ return( base_this_type::mPTR == other.mPTR );
+ }
+
+
+ inline bool isNEQ(const_pointer aPtr) const
+ {
+ return( base_this_type::mPTR != aPtr );
+ }
+
+ inline bool isNEQ(const AvmPointer & other) const
+ {
+ return( base_this_type::mPTR != other.mPTR );
+ }
+
+
+ /**
+ * Serialization
+ */
+ inline void toStream(OutStream & os) const
+ {
+ if( base_this_type::mPTR != NULL )
+ {
+ base_this_type::mPTR->toStream(os);
+ }
+ else
+ {
+ os << TAB << "AvmPointer<null>" << EOL_FLUSH;
+ }
+ }
+
+
+ inline virtual std::string toString(
+ const AvmIndent & indent = AVM_TAB_INDENT) const
+ {
+ StringOutStream oss(indent);
+
+ toStream(oss);
+
+ return( oss.str() );
+ }
+
+
+ /**
+ * DEFAULT NULL
+ */
+ static AvmPointer REF_NULL;
+
+};
+
+
+template< class T , class Tdestructor >
+AvmPointer< T , Tdestructor > AvmPointer< T , Tdestructor >::REF_NULL;
+
+
+#define AP_REF_NULL(ClassName) AP##ClassName::REF_NULL
+
+
+#define AVM_DEFINE_AP_CLASS(ClassName) \
+ typedef AvmPointer< ClassName , DestroyObjectPolicy > AP##ClassName;
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+//
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+#define INCR_BF(A) \
+ sep::BF( sep::incrReferenceCount(A) )
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+//// TYPE DEFINITION for SMART POINTER.
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+//template< class T >
+//class AvmCloneableClass
+//{
+//
+//public:
+// /**
+// * DESTRUCTOR
+// */
+// virtual ~AvmCloneableClass()
+// {
+// //!! NOTHING
+// }
+//
+// virtual T * clone() const
+// {
+// return( new T(*this) );
+// }
+//};
+
+
+#define AVM_DECLARE_CLONABLE_CLASS(ClassName) \
+public: \
+ virtual ClassName * clone() const \
+ { return( new ClassName(*this) ); } \
+private:
+
+
+
+//template< class T >
+//class AvmUncloneableClass
+//{
+//
+//public:
+// /**
+// * DESTRUCTOR
+// */
+// virtual ~AvmUncloneableClass()
+// {
+// //!! NOTHING
+// }
+//
+// virtual T * clone() const
+// {
+// return( const_cast< T * >(this) );
+// }
+//};
+
+
+#define AVM_DECLARE_UNCLONABLE_CLASS(ClassName) \
+public: \
+ virtual ClassName * clone() const \
+ { return( const_cast< ClassName * >(this) ); } \
+private:
+
+
+} /* namespace sep */
+#endif /* AVMPOINTER_H_ */
diff --git a/org.eclipse.efm.symbex/src/common/BF.cpp b/org.eclipse.efm.symbex/src/common/BF.cpp
new file mode 100644
index 0000000..adda86c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/common/BF.cpp
@@ -0,0 +1,561 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 juil. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "BF.h"
+
+#include <fml/common/ObjectElement.h>
+
+#include <fml/executable/BaseCompiledForm.h>
+#include <fml/executable/InstanceOfData.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/ExpressionComparer.h>
+#include <fml/expression/ExpressionConstant.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/ExpressionFactory.h>
+
+//#include <fml/symbol/Symbol.h>
+//#include <fml/pointer/Type.h>
+
+#include <fml/runtime/RuntimeID.h>
+
+#include <fml/workflow/UniFormIdentifier.h>
+
+
+namespace sep
+{
+
+
+/**
+ * INSTANCE COUNTER
+ */
+avm_uint64_t BF::INSTANCE_COUNTER_ASP = 0;
+
+
+/*
+ * STATIC
+ * ATTRIBUTES
+ */
+
+/**
+ * DEFAULT NULL
+ */
+BF BF::REF_NULL;
+
+
+/**
+ * Finalize
+ */
+void BF::finalize()
+{
+ if( (mPTR != NULL) && (mPTR->getRefCount() > 1) )
+ {
+AVM_IF_DEBUG_FLAG( REFERENCE_COUNTING )
+ Element * pbf = /*dynamic_cast< Element * >*/( mPTR );
+ if( pbf != NULL )
+ {
+ AVM_OS_LOG << "finalize< " << pbf->classKindName()
+ << "> @ " << avm_address_t( pbf )
+ << " x " << pbf->getRefCount() << " : " << pbf->str()
+ << std::endl;
+ }
+AVM_ENDIF_DEBUG_FLAG( REFERENCE_COUNTING )
+
+ mPTR->setRefCount( 1 );
+ }
+
+ release( NULL );
+}
+
+
+/**
+ * NUMERIC or SIMPLE TYPE TEST & CAST
+ */
+
+bool BF::isBoolean() const
+{
+ return( ExpressionFactory::isBoolean(*this) );
+}
+
+bool BF::toBoolean() const
+{
+ return( ExpressionFactory::toBoolean(*this) );
+}
+
+
+bool BF::isEqualFalse() const
+{
+ return( this->isTEQ( ExpressionConstant::BOOLEAN_FALSE ) ||
+ ExpressionFactory::isEqualFalse(*this) );
+}
+
+bool BF::isNotEqualFalse() const
+{
+ return( ExpressionFactory::isNotEqualFalse(*this) );
+}
+
+
+bool BF::isEqualTrue() const
+{
+ return( this->isTEQ( ExpressionConstant::BOOLEAN_TRUE ) ||
+ ExpressionFactory::isEqualTrue(*this) );
+}
+
+bool BF::isNotEqualTrue() const
+{
+ return( ExpressionFactory::isNotEqualTrue(*this) );
+}
+
+
+
+
+
+/**
+ * GETTER
+ * for simple or numeric kind
+ */
+bool BF::isEqualZero() const
+{
+ return( this->isTEQ( ExpressionConstant::INTEGER_ZERO ) ||
+ (this->is< Number >() && this->to_ptr< Number >()->isZero()) );
+}
+
+bool BF::isEqualOne() const
+{
+ return( this->isTEQ( ExpressionConstant::INTEGER_ONE ) ||
+ (this->is< Number >() && this->to_ptr< Number >()->isOne()) );
+}
+
+
+bool BF::isNumber() const
+{
+ return( ExpressionFactory::isNumber(*this) );
+}
+
+bool BF::isNumeric() const
+{
+ return( ExpressionFactory::isNumeric(*this) );
+}
+
+
+bool BF::isExpression() const
+{
+ return( this->is< AvmCode >() );
+}
+
+
+
+bool BF::isInt32() const
+{
+ return( ExpressionFactory::isInt32(*this) );
+}
+
+avm_int32_t BF::toInt32() const
+{
+ return( ExpressionFactory::toInt32(*this) );
+}
+
+
+bool BF::isInt64() const
+{
+ return( ExpressionFactory::isInt64(*this) );
+}
+
+avm_int64_t BF::toInt64() const
+{
+ return( ExpressionFactory::toInt64(*this) );
+}
+
+
+bool BF::isInteger() const
+{
+ return( ExpressionFactory::isInteger(*this) );
+}
+
+avm_integer_t BF::toInteger() const
+{
+ return( ExpressionFactory::toInteger(*this) );
+}
+
+
+bool BF::isPosInteger() const
+{
+ return( ExpressionFactory::isPosInteger(*this) );
+}
+
+
+bool BF::isUInteger() const
+{
+ return( ExpressionFactory::isUInteger(*this) );
+}
+
+avm_uinteger_t BF::toUInteger() const
+{
+ return( ExpressionFactory::toUInteger(*this) );
+}
+
+bool BF::isRational() const
+{
+ return( ExpressionFactory::isRational(*this) );
+}
+
+avm_integer_t BF::toDenominator() const
+{
+ return( ExpressionFactory::toDenominator(*this) );
+}
+avm_integer_t BF::toNumerator() const
+{
+ return( ExpressionFactory::toNumerator(*this) );
+}
+
+
+bool BF::isFloat() const
+{
+ return( ExpressionFactory::isFloat(*this) );
+}
+
+avm_float_t BF::toFloat() const
+{
+ return( ExpressionFactory::toFloat(*this) );
+}
+
+
+bool BF::isReal() const
+{
+ return( ExpressionFactory::isReal(*this) );
+}
+
+avm_real_t BF::toReal() const
+{
+ return( ExpressionFactory::toReal(*this) );
+}
+
+
+bool BF::isCharacter() const
+{
+ return( ExpressionFactory::isCharacter(*this) );
+}
+
+char BF::toCharacter() const
+{
+ return( ExpressionFactory::toCharacter(*this) );
+}
+
+
+bool BF::isBuiltinString() const
+{
+ return( ExpressionFactory::isBuiltinString(*this) );
+}
+
+std::string BF::toBuiltinString() const
+{
+ return( ExpressionFactory::toBuiltinString(*this) );
+}
+
+
+bool BF::isIdentifier() const
+{
+ return( ExpressionFactory::isIdentifier(*this) );
+}
+
+std::string BF::toIdentifier() const
+{
+ return( ExpressionFactory::toIdentifier(*this) );
+}
+
+
+bool BF::isUfi() const
+{
+ return( ExpressionFactory::isUfi(*this) );
+}
+
+std::string BF::toUfi() const
+{
+ return( ExpressionFactory::toUfi(*this) );
+}
+
+std::string BF::toUfid() const
+{
+ return( ExpressionFactory::toUfid(*this) );
+}
+
+
+bool BF::isEnumSymbol() const
+{
+ return( ExpressionFactory::isEnumSymbol(*this) );
+}
+
+std::string BF::strEnumSymbol() const
+{
+ return( ExpressionFactory::strEnumSymbol(*this) );
+}
+
+
+bool BF::isUFID() const
+{
+ return( isUfid() || is< UniFormIdentifier >() );
+}
+
+
+bool BF::isBuiltinValue() const
+{
+ return( ExpressionFactory::isBuiltinValue(*this) );
+}
+
+
+bool BF::isConstValue() const
+{
+ return( ExpressionFactory::isConstValue(*this) );
+}
+
+
+/**
+ * REFERENCE
+ * CAST
+ */
+
+#define STATIC_CAST_BF_TO_XBF_T(BFClassName, ClassName, methodName) \
+BFClassName & BF::methodName() \
+{ \
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( is< ClassName >() ) \
+ << "Invalid << BF<" #ClassName "> >> Type <" \
+ << classKindName() << ">( " << str() << " ) Cast !!!" \
+ << SEND_EXIT; \
+ return( static_cast< BFClassName & >( *this ) ); \
+}
+
+#define STATIC_CAST_BF_TO_XBF2(ClassName, Name) \
+ STATIC_CAST_BF_TO_XBF_T(BF##Name, ClassName, bf##Name)
+
+#define STATIC_CAST_BF_TO_XBF(ClassName) \
+ STATIC_CAST_BF_TO_XBF_T(BF##ClassName, ClassName, bf##ClassName)
+
+
+#define STATIC_CCAST_BF_TO_XBF_T(BFClassName, ClassName, methodName) \
+const BFClassName & BF::methodName() const \
+{ \
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( is< ClassName >() ) \
+ << "Invalid << BF<" #ClassName "> >> Type <" \
+ << classKindName() << ">( " << str() << " ) Cast !!!" \
+ << SEND_EXIT; \
+ return( static_cast< const BFClassName & >( *this ) ); \
+}
+
+#define STATIC_CCAST_BF_TO_XBF2(ClassName, Name) \
+ STATIC_CCAST_BF_TO_XBF_T(BF##Name, ClassName, bf##Name)
+
+#define STATIC_CCAST_BF_TO_XBF(ClassName) \
+ STATIC_CCAST_BF_TO_XBF_T(BF##ClassName, ClassName, bf##ClassName)
+
+
+STATIC_CAST_BF_TO_XBF2(AvmCode, Code)
+
+STATIC_CCAST_BF_TO_XBF2(AvmCode, Code)
+
+
+STATIC_CCAST_BF_TO_XBF_T( RuntimeID, RuntimeID, bfRID)
+
+
+
+/**
+ * BUILD NEW EXPRESSION
+ */
+BF & BF::opExpr(Operator * anOperator, const BF & arg)
+{
+ return( *this = ExpressionConstructor::newCode(anOperator, *this, arg) );
+}
+
+
+BF & BF::eqExpr(const BF & arg)
+{
+ return( *this = ExpressionConstructor::eqExpr(*this, arg));
+}
+
+BF & BF::neqExpr(const BF & arg)
+{
+ return( *this = ExpressionConstructor::neqExpr(*this, arg) );
+}
+
+
+BF & BF::ltExpr(const BF & arg)
+{
+ return( *this = ExpressionConstructor::ltExpr(*this, arg) );
+}
+
+BF & BF::lteExpr(const BF & arg)
+{
+ return( *this = ExpressionConstructor::lteExpr(*this, arg) );
+}
+
+
+BF & BF::gtExpr(const BF & arg)
+{
+ return( *this = ExpressionConstructor::gtExpr(*this, arg) );
+}
+
+BF & BF::gteExpr(const BF & arg)
+{
+ return( *this = ExpressionConstructor::gteExpr(*this, arg) );
+}
+
+
+
+
+BF & BF::andExpr(const BF & arg)
+{
+ return( *this = ExpressionConstructor::andExpr(*this, arg) );
+}
+
+BF & BF::orExpr(const BF & arg)
+{
+ return( *this = ExpressionConstructor::orExpr(*this, arg) );
+}
+
+BF & BF::notExpr()
+{
+ return( *this = ExpressionConstructor::notExpr(*this) );
+}
+
+
+BF & BF::addExpr(const BF & arg)
+{
+ return( *this = ExpressionConstructor::addExpr(*this, arg) );
+}
+
+BF & BF::incrExpr(avm_uinteger_t val)
+{
+ return( *this = ExpressionConstructor::addExpr(*this, val) );
+}
+
+
+BF & BF::minusExpr(const BF & arg)
+{
+ return( *this = ExpressionConstructor::minusExpr(*this, arg) );
+}
+
+BF & BF::uminusExpr()
+{
+ return( *this = ExpressionConstructor::uminusExpr(*this) );
+}
+
+BF & BF::decrExpr(avm_uinteger_t val)
+{
+ return( *this = ExpressionConstructor::addExpr(*this, (- val)) );
+}
+
+
+BF & BF::multExpr(const BF & arg)
+{
+ return( *this = ExpressionConstructor::multExpr(*this, arg) );
+}
+
+BF & BF::powExpr(const BF & arg)
+{
+ return( *this = ExpressionConstructor::powExpr(*this, arg) );
+}
+
+BF & BF::divExpr(const BF & arg)
+{
+ return( *this = ExpressionConstructor::divExpr(*this, arg) );
+}
+
+BF & BF::invExpr()
+{
+ return( *this = ExpressionConstructor::divExpr(
+ ExpressionConstructor::newExpr((avm_integer_t) 1), *this) );
+}
+
+
+
+/**
+ * COMPARISON
+ */
+int BF::compare(const BF & other) const
+{
+ return( (mPTR == other.mPTR) ? 0 :
+ ExpressionComparer::compare(*this, other) );
+}
+
+int BF::compare_share(BF & other)
+{
+ if( mPTR == other.mPTR )
+ {
+ return( 0 );
+ }
+ else
+ {
+ int cmpResult = ExpressionComparer::compare(*this, other);
+ if( cmpResult == 0 )
+ {
+ share( other );
+ }
+ return( cmpResult );
+ }
+}
+
+
+bool BF::isEQ(const BF & other) const
+{
+ return ExpressionComparer::isEQ(*this, other);
+}
+
+
+///**
+// * ASSIGNMENT
+// * Symbol
+// * Type
+// */
+//inline BF & BF::operator=(const Symbol & aSymbol)
+//{
+// if( mPTR != aSymbol.rawSymbol() )
+// {
+// AVM_ASSIGN_DEBUG_BF_PTR( aSymbol.raw_pointer() )
+//
+// release( aSymbol.rawSymbol() );
+// }
+// return( *this );
+//}
+//
+//// Type
+//BF & BF::operator=(const Type & aType)
+//{
+// if( mPTR != aType.rawType() )
+// {
+// AVM_ASSIGN_DEBUG_BF_PTR( aType.raw_pointer() )
+//
+// release( aType.rawType() );
+// }
+// return( *this );
+//}
+
+
+
+/**
+ * strHeader
+ */
+void BF::strHeader(OutStream & os) const
+{
+ if( this->is< ObjectElement >() )
+ {
+ this->to_ptr< ObjectElement >()->strHeader( os );
+ }
+ else
+ {
+ os << this->str();
+ }
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/common/BF.h b/org.eclipse.efm.symbex/src/common/BF.h
new file mode 100644
index 0000000..b402bdd
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/common/BF.h
@@ -0,0 +1,951 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 juil. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BF_H_
+#define BF_H_
+
+#include <base/ClassKindInfo.h>
+#include <base/SmartPointer.h>
+#include <common/Element.h>
+
+#include <util/avm_assert.h>
+#include <util/avm_string.h>
+
+
+#define AVM_DEBUG_BF_POINTER true
+#undef AVM_DEBUG_BF_POINTER
+
+#if defined(AVM_DEBUG_BF_POINTER)
+
+ #define AVM_DECLARE_DEBUG_BF_PTR public: std::string dbgPTR;
+
+
+ #define AVM_STR_BF_PTR( ptr ) ( (ptr != NULL) ? ptr->str() : "BF<null>" )
+
+ #define AVM_INIT_DEBUG_BF_PTR_NULL , dbgPTR( "BF<null>" )
+
+ #define AVM_INIT_DEBUG_BF_PTR( ptr ) , dbgPTR( AVM_STR_BF_PTR(ptr) )
+
+ #define AVM_COPY_DEBUG_BF_PTR( bf ) , dbgPTR( bf.dbgPTR )
+
+ #define AVM_ASSIGN_DEBUG_BF_PTR( ptr ) dbgPTR = AVM_STR_BF_PTR(ptr);
+
+#else
+
+ #define AVM_INIT_DEBUG_BF_PTR_NULL
+
+ #define AVM_DECLARE_DEBUG_BF_PTR
+
+ #define AVM_INIT_DEBUG_BF_PTR( ptr )
+
+ #define AVM_COPY_DEBUG_BF_PTR( ptr )
+
+ #define AVM_ASSIGN_DEBUG_BF_PTR( ptr )
+
+#endif
+
+
+namespace sep
+{
+
+
+class BFCode;
+
+class Operator;
+
+class RuntimeID;
+
+//class Symbol;
+//class Type;
+
+
+
+class BF :
+ public SmartPointer< Element , DestroyElementPolicy >,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( BF )
+{
+
+
+private:
+ /**
+ * TYPEDEF
+ */
+ typedef SmartPointer< Element , DestroyElementPolicy > base_this_type;
+
+ AVM_DECLARE_DEBUG_BF_PTR
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BF() throw()
+ : base_this_type()
+ AVM_INIT_DEBUG_BF_PTR_NULL
+ {
+ //!! NOTHING
+ }
+
+ explicit BF(Element * anElement)
+ : base_this_type( anElement )
+ AVM_INIT_DEBUG_BF_PTR( anElement )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ BF(const BF & anElement)
+ : base_this_type( anElement )
+ AVM_COPY_DEBUG_BF_PTR( anElement )
+ {
+ //!! NOTHING
+ }
+
+
+ static avm_uint64_t INSTANCE_COUNTER_ASP;
+
+ template< class U >
+ BF(const SmartPointer< U , DestroyElementPolicy > & other)
+ : base_this_type( other )
+ {
+ //!! NOTHING
+ ++INSTANCE_COUNTER_ASP;
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BF()
+ {
+ //!! NOTHING
+ }
+
+
+ void finalize();
+
+
+ /**
+ * NUMERIC or SIMPLE TYPE TEST & CAST
+ */
+ virtual bool isBoolean() const;
+ virtual bool toBoolean() const;
+
+ /**
+ * COMPARISON
+ * with TRUE & FALSE
+ */
+ virtual bool isEqualFalse() const;
+ virtual bool isNotEqualFalse() const;
+
+ virtual bool isEqualTrue() const;
+ virtual bool isNotEqualTrue()const;
+
+
+ virtual bool isEqualZero() const;
+ virtual bool isEqualOne() const;
+
+ virtual bool isNumber() const;
+ virtual bool isNumeric() const;
+
+ virtual bool isExpression() const;
+
+
+ virtual bool isInt32() const;
+ virtual avm_int32_t toInt32() const;
+
+ virtual bool isInt64() const;
+ virtual avm_int64_t toInt64() const;
+
+
+ virtual bool isInteger() const;
+ virtual avm_integer_t toInteger() const;
+
+ virtual bool isWeakInteger() const
+ {
+ return( isInteger() );
+ }
+
+ virtual bool isPosInteger() const;
+
+ virtual bool isUInteger() const;
+ virtual avm_uinteger_t toUInteger() const;
+
+
+ virtual bool isRational() const;
+ virtual avm_integer_t toDenominator() const;
+ virtual avm_integer_t toNumerator() const;
+
+ virtual bool isWeakRational() const
+ {
+ return( isRational() || isWeakInteger() );
+ }
+
+
+ virtual bool isFloat() const;
+ virtual avm_float_t toFloat() const;
+
+ virtual bool isWeakFloat() const
+ {
+ return( isFloat() || isWeakRational() );
+ }
+
+
+ virtual bool isReal() const;
+ virtual avm_real_t toReal() const;
+
+ inline virtual bool isWeakReal() const
+ {
+ return( isReal() || isWeakFloat() );
+ }
+
+
+
+ virtual bool isCharacter() const;
+ virtual char toCharacter() const;
+
+ virtual bool isBuiltinString() const;
+ virtual std::string toBuiltinString() const;
+
+
+ virtual bool isIdentifier() const;
+ virtual std::string toIdentifier() const;
+
+ virtual bool isUfi() const;
+ virtual std::string toUfi() const;
+
+ virtual bool isUfid() const
+ {
+ return( isUfi() || isIdentifier() );
+ }
+ virtual std::string toUfid() const;
+
+ virtual bool isEnumSymbol() const;
+ virtual std::string strEnumSymbol() const;
+
+ virtual bool isUFID() const;
+
+ bool isBuiltinValue() const;
+
+ virtual bool isConstValue() const;
+
+
+
+ /**
+ * REFERENCE
+ * CAST
+ */
+ BFCode & bfCode() ;
+
+ const BFCode & bfCode() const;
+
+ const RuntimeID & bfRID() const;
+
+
+
+ /**
+ * MEMORY MANAGEMENT
+ */
+
+ void incrRefCount() const
+ {
+ if( mPTR != NULL )
+ {
+ mPTR->incrRefCount();
+ }
+ }
+
+
+ /**
+ * GETTER
+ * ClassKindInfo
+ */
+ inline class_kind_t classKind() const
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "raw_pointer in BF::classKind() !!!"
+ << SEND_EXIT;
+
+ return( mPTR->classKind() );
+ }
+
+ inline const std::string & classKindName() const
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "raw_pointer in BF::classKindName() !!!"
+ << SEND_EXIT;
+
+ return( mPTR->classKindName() );
+ }
+
+ inline std::string classKindInfo() const
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "raw_pointer in BF::classKindInfo() !!!"
+ << SEND_EXIT;
+
+ return( mPTR->classKindInfo() );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // TYPE CHECKER
+ ////////////////////////////////////////////////////////////////////////////
+
+ // Check if BF is a handle to a T, including base classes.
+ template<class T >
+ inline bool is() const
+ {
+// AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+// << "raw_pointer in BF::is< T >() !!!"
+// << SEND_EXIT;
+
+ return( (mPTR != NULL) && mPTR->is< T >() );
+ }
+
+ template<class T >
+ inline bool isnot() const
+ {
+ return(( mPTR == NULL) || mPTR->isnot< T >() );
+ }
+
+ // Check if BF is a handle to a T, not including base classes.
+ template< class T >
+ inline bool is_weakly() const
+ {
+ return( (mPTR == NULL) || mPTR->is< T >() );
+ }
+
+ // Check if BF is a handle to a T, not including base classes.
+ template< class T >
+ inline bool is_exactly() const
+ {
+// AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+// << "raw_pointer in BF::is_exactly< T >() !!!"
+// << SEND_EXIT;
+
+ return( (mPTR != NULL) && mPTR->is_exactly< T >() );
+ }
+
+ template< class T >
+ inline bool isnot_exactly() const
+ {
+ return( (mPTR == NULL) || mPTR->isnot_exactly< T >() );
+ }
+
+ // Check if BF is a handle to a T, not including specific classes.
+ template< class T >
+ inline bool is_strictly() const
+ {
+// AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+// << "raw_pointer in BF::is_strictly< T >() !!!"
+// << SEND_EXIT;
+
+ return( (mPTR != NULL) && mPTR->is_strictly< T >() );
+ }
+
+ template< class T >
+ inline bool isnot_strictly() const
+ {
+ return( (mPTR == NULL) || mPTR->isnot_strictly< T >() );
+ }
+
+
+ // cast BF as specified pointer
+ template< class T >
+ inline T * as_ptr() const
+ {
+ // previous:> AVM_OS_ASSERT_WARNING_ALERT
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "raw_pointer in BF::as_ptr< T >() !!!"
+ << SEND_EXIT;
+
+ return( (mPTR != NULL) ? mPTR->as< T >() : NULL );
+ }
+
+ template< class T >
+ inline T * to_ptr() const
+ {
+ return( mPTR->to< T >() );
+ }
+
+
+ // cast BF as specified reference
+ template< class T >
+ inline T & as_ref()
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "raw_pointer in BF::as_ref< T >() !!!"
+ << SEND_EXIT;
+
+ return( *( mPTR->as< T >() ) );
+ }
+
+ template< class T >
+ inline const T & as_ref() const
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "raw_pointer in BF::as< T >() !!!"
+ << SEND_EXIT;
+
+ return( *( mPTR->as< T >() ) );
+ }
+
+ template< class T >
+ inline const T & to_ref() const
+ {
+ return( *( mPTR->as< T >() ) );
+ }
+
+
+ // cast BF as derived BF
+// template< class T >
+// inline T & as_bf()
+// {
+// return( static_cast< T & >( *this ) );
+// }
+
+ template< class T >
+ inline const T & as_bf() const
+ {
+ return( static_cast< const T & >( *this ) );
+ }
+
+
+
+ /**
+ * CAST
+ */
+// inline operator Element * () const
+// {
+// return( mPTR );
+// }
+
+ // Desactive call of << delete >> using compiler ambiguous mecanism
+// inline operator void * () const
+// {
+// return( mPTR );
+// }
+
+
+// template< class T >
+// inline operator T * ()
+// {
+// return( static_cast< T * >( mPTR ) );
+// }
+//
+// /**
+// * OPERATORS
+// */
+// template< class T >
+// inline T * operator-> ()
+// {
+// AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+// << "raw_pointer in BF::operator->< T >() !!!"
+// << SEND_EXIT;
+//
+// return( static_cast< T * >( mPTR ) );
+// }
+
+
+ /**
+ * GETTER - SETTER
+ * for container of BF
+ */
+ // Generally with range check
+ inline const BF & at(avm_size_t offset) const
+ {
+ return( mPTR->at(offset) );
+ }
+
+ inline BF & at(avm_size_t offset)
+ {
+ return( mPTR->at(offset) );
+ }
+
+ // move to contained element at position < offset >
+ inline void moveAt(avm_size_t offset)
+ {
+ mPTR->decrRefCount();
+
+ mPTR = mPTR->at( offset ).mPTR;
+
+ mPTR->incrRefCount();
+ }
+
+
+ // Generally without range check
+ inline BF & operator[](avm_size_t offset)
+ {
+ return( mPTR->operator[](offset) );
+ }
+
+ // Generally without range check
+ inline const BF & operator[](avm_size_t offset) const
+ {
+ return( mPTR->operator[](offset) );
+ }
+
+
+ inline BF & getWritable()
+ {
+ base_this_type::makeWritable();
+ return( *this );
+ }
+
+ inline BF & getWritable(avm_size_t offset)
+ {
+ return( mPTR->getWritable(offset) );
+ }
+
+ inline void makeWritable()
+ {
+ base_this_type::makeWritable();
+ }
+
+ inline void makeWritable(avm_size_t offset)
+ {
+ mPTR->makeWritable( offset );
+ }
+
+ // move to writable contained element at position < offset >
+ inline void moveAtWritable(avm_size_t offset)
+ {
+ mPTR->decrRefCount();
+
+ mPTR = mPTR->getWritable( offset ).mPTR;
+
+ mPTR->incrRefCount();
+ }
+
+
+ inline void set(const BF & bf)
+ {
+ base_this_type::release_acquire( bf.mPTR );
+ }
+
+ inline void set(avm_size_t offset, const BF & bf)
+ {
+ mPTR->set(offset, bf);
+ }
+
+// inline void mw_set(avm_size_t offset, const BF & bf)
+// {
+// base_this_type::makeWritable();
+// mPTR->set(offset, bf);
+// }
+
+
+ inline avm_size_t size() const
+ {
+ return( mPTR->size() );
+ }
+
+
+ /**
+ * ASSIGNMENT
+ */
+// template< class U >
+// inline BF & operator=(
+// const SmartPointer< U , DestroyElementPolicy > & other)
+// {
+// if( mPTR != other.raw_pointer() )
+// {
+// AVM_ASSIGN_DEBUG_BF_PTR( other.raw_pointer() )
+//
+// release_acquire( other.raw_pointer() );
+// }
+// return( *this );
+// }
+//
+// // Symbol
+// BF & operator=(const Symbol & aSymbol);
+//
+// // Type
+// BF & operator=(const Type & aType);
+
+ inline BF & operator=(pointer aPtr)
+ {
+ if( mPTR != aPtr )
+ {
+ AVM_ASSIGN_DEBUG_BF_PTR( aPtr )
+
+ release( aPtr );
+ }
+ return( *this );
+ }
+
+
+ inline void renew(pointer aPtr)
+ {
+ if( mPTR != aPtr )
+ {
+ release( aPtr );
+ }
+ }
+
+ inline void newincr(pointer aPtr)
+ {
+ if( mPTR != aPtr )
+ {
+ release_acquire( aPtr );
+ }
+ }
+
+ /**
+ * COMPARISON
+ * OPERATOR
+ */
+
+ inline bool operator==(const BF & other) const
+ {
+ return( (mPTR == other.mPTR) || isEQ(other) );
+ }
+
+ inline bool operator==(const Element & aPtr) const
+ {
+ return( (mPTR == &aPtr) || mPTR->isEQ(aPtr) );
+ }
+
+ inline bool operator==(const Element * aPtr) const
+ {
+ return( (mPTR == aPtr) ||
+ ((aPtr != NULL) && (mPTR != NULL) && mPTR->isEQ(*aPtr)) );
+ }
+
+
+ inline bool operator!=(const BF & other) const
+ {
+ return( (mPTR != other.mPTR) || isNEQ(other) );
+ }
+
+ inline bool operator!=(const Element & aPtr) const
+ {
+ return( (mPTR != &aPtr) && mPTR->isNEQ(aPtr) );
+ }
+
+ inline bool operator!=(const Element * aPtr) const
+ {
+ return( (mPTR != aPtr) &&
+ ((mPTR == NULL) || (aPtr == NULL) || mPTR->isNEQ(*aPtr)) );
+ }
+
+
+ /**
+ * POINTER TRIVIALLY EQUAL COMPARISON
+ */
+ inline bool isTEQ(const Element * bf) const
+ {
+ return( mPTR == bf );
+ }
+
+ inline bool isTEQ(const BF & other) const
+ {
+ return( mPTR == other.mPTR );
+ }
+
+
+ inline bool isNTEQ(const Element * bf) const
+ {
+ return( mPTR != bf );
+ }
+
+ inline bool isNTEQ(const BF & other) const
+ {
+ return( mPTR != other.mPTR );
+ }
+
+
+ /**
+ * COMPARISON
+ */
+ int compare(const BF & other) const;
+
+ int compare_share(BF & other);
+
+
+ bool isEQ(const BF & other) const;
+
+ inline bool isNEQ(const BF & other) const
+ {
+ return( not isEQ(other) );
+ }
+
+
+ bool strEQ(const BF & other) const
+ {
+ return( (mPTR == other.mPTR)
+ || ((mPTR != NULL) && (other.mPTR != NULL)
+ && (mPTR->str() == other.mPTR->str())) );
+ }
+
+ bool strNEQ(const BF & other) const
+ {
+ return( (mPTR != other.mPTR)
+ && ((mPTR == NULL) || (other.mPTR == NULL)
+ || (mPTR->str() != other.mPTR->str())) );
+ }
+
+
+
+ /**
+ * BUILD NEW EXPRESSION
+ */
+ BF & opExpr(Operator * anOperator, const BF & arg);
+
+ BF & eqExpr(const BF & arg);
+ BF & neqExpr(const BF & arg);
+
+ BF & ltExpr(const BF & arg);
+ BF & lteExpr(const BF & arg);
+
+ BF & gtExpr(const BF & arg);
+ BF & gteExpr(const BF & arg);
+
+
+ BF & andExpr(const BF & arg);
+ BF & orExpr(const BF & arg);
+ BF & notExpr();
+
+ BF & addExpr(const BF & arg);
+ BF & incrExpr(avm_uinteger_t val = 1);
+
+ BF & minusExpr(const BF & arg);
+ BF & uminusExpr();
+ BF & decrExpr(avm_uinteger_t val = 1);
+
+ BF & multExpr(const BF & arg);
+ BF & powExpr(const BF & arg);
+ BF & divExpr(const BF & arg);
+ BF & invExpr();
+
+
+
+ /**
+ * DEFAULT NULL
+ */
+ static BF REF_NULL;
+
+
+ /**
+ * Serialization
+ */
+ virtual void toStream(OutStream & os) const
+ {
+ if( mPTR != NULL )
+ {
+ mPTR->toStream( os );
+ }
+ else
+ {
+ os << TAB << "BF<null>" << EOL_FLUSH;
+ }
+ }
+
+ virtual void toStream(PairOutStream & os) const
+ {
+ if( mPTR != NULL )
+ {
+ mPTR->toStream( os.OS1 );
+ mPTR->toStream( os.OS2 );
+ }
+ else
+ {
+ os << TAB << "BF<null>" << EOL_FLUSH;
+ }
+ }
+
+ virtual void toStream(TripleOutStream & os) const
+ {
+ if( mPTR != NULL )
+ {
+ mPTR->toStream( os.OS1 );
+ mPTR->toStream( os.OS2 );
+ mPTR->toStream( os.OS3 );
+ }
+ else
+ {
+ os << TAB << "BF<null>" << EOL_FLUSH;
+ }
+ }
+
+
+ inline virtual std::string toString(
+ const AvmIndent & indent = AVM_TAB_INDENT) const
+ {
+ StringOutStream oss(indent);
+
+ toStream( oss );
+
+ return( oss.str() );
+ }
+
+ inline virtual std::string wrapString(
+ const WrapData & wrapData = DEFAULT_WRAP_DATA,
+ const AvmIndent & indent = AVM_TAB_INDENT) const
+ {
+ StringOutStream woss(wrapData, indent);
+
+ toStream( woss );
+
+ return( woss.str() );
+ }
+
+
+ /**
+ * strHeader
+ */
+ virtual std::string strHeader() const
+ {
+ StringOutStream oss;
+
+ strHeader( oss );
+
+ return( oss.str() );
+ }
+
+ virtual void strHeader(OutStream & os) const;
+
+ virtual void strHeader(PairOutStream & os) const
+ {
+ strHeader( os.OS1 );
+ strHeader( os.OS2 );
+ }
+
+ virtual void strHeader(TripleOutStream & os) const
+ {
+ toStream( os.OS1 );
+ toStream( os.OS2 );
+ toStream( os.OS3 );
+ }
+
+
+ inline virtual std::string str() const
+ {
+ return( ( mPTR != NULL ) ? mPTR->str() : ("BF<null>") );
+ }
+
+ inline virtual std::string wrapStr(
+ const WrapData & wrapData = DEFAULT_WRAP_DATA) const
+ {
+ StringOutStream woss(DEFAULT_WRAP_DATA, AVM_STR_INDENT);
+
+ toStream( woss << IGNORE_FIRST_TAB );
+
+ return( woss.str() );
+ }
+
+
+ // LEFT TRIM the result
+ inline virtual std::string _str() const
+ {
+ if( mPTR != NULL )
+ {
+ std::string strTmp = mPTR->str();
+
+ return( StringTools::ltrim(strTmp) );
+
+ }
+
+ return( "BF<null>" );
+ }
+
+ // RIGTH TRIM the result
+ inline virtual std::string str_() const
+ {
+ if( mPTR != NULL )
+ {
+ std::string strTmp = mPTR->str();
+
+ return( StringTools::rtrim(strTmp) );
+
+ }
+
+ return( "BF<null>" );
+ }
+
+ // LEFT & RIGTH TRIM the result
+ inline virtual std::string _str_() const
+ {
+ if( mPTR != NULL )
+ {
+ std::string strTmp = mPTR->str();
+
+ return( StringTools::trim(strTmp) );
+
+ }
+
+ return( "BF<null>" );
+ }
+
+
+ inline virtual std::string strNum(
+ uint8_t precision = AVM_MUMERIC_PRECISION) const
+ {
+ return( ( mPTR != NULL ) ? mPTR->strNum(precision) : "BF<null>" );
+ }
+
+
+ inline virtual void AVM_DEBUG_REF_COUNTER(OutStream & os) const
+ {
+ if( mPTR != NULL )
+ {
+ mPTR->AVM_DEBUG_REF_COUNTER(os);
+ }
+ else
+ {
+ os << "BF<null, ref:0>" << std::flush;
+ }
+ }
+
+ inline virtual std::string AVM_DEBUG_REF_COUNTER() const
+ {
+ return( ( mPTR != NULL ) ?
+ mPTR->AVM_DEBUG_REF_COUNTER() : "BF<null, ref:0>" );
+ }
+
+
+private:
+
+ /** Share equal objects between expressions.
+ */
+ inline void share(BF & other)
+ {
+ if( getRefCount() <= other.getRefCount() )
+ {
+ acquirePointer( other.mPTR );
+ }
+ else
+ {
+ other.acquirePointer( mPTR );
+ }
+ }
+
+};
+
+
+/**
+ * operator<<
+ */
+AVM_OS_STREAM( BF )
+
+
+}
+
+#endif /* BF_H_ */
diff --git a/org.eclipse.efm.symbex/src/common/CMakeLists.txt b/org.eclipse.efm.symbex/src/common/CMakeLists.txt
new file mode 100644
index 0000000..d3ab9c1
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/common/CMakeLists.txt
@@ -0,0 +1,18 @@
+# =============================================================================
+# CMake file for the COMMON library
+# =============================================================================
+
+# C++ source files to take into account (all files matching patterns recursively)
+file (GLOB_RECURSE COMMON_CXX_SRC_FILES *.cpp *.h)
+
+# Target to build
+add_library (common STATIC ${COMMON_CXX_SRC_FILES})
+
+# Include directories (internal)
+target_include_directories (common PUBLIC ..)
+
+# Target include directories (external)
+target_include_directories (common PUBLIC ${GMP_INCLUDE_DIR} ${GMPXX_INCLUDE_DIR})
+target_include_directories (common PUBLIC ${Boost_INCLUDE_DIRS})
+
+
diff --git a/org.eclipse.efm.symbex/src/common/Element.cpp b/org.eclipse.efm.symbex/src/common/Element.cpp
new file mode 100644
index 0000000..0062027
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/common/Element.cpp
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "Element.h"
+
+#include <common/BF.h>
+
+#include <exception>
+
+
+namespace sep
+{
+
+
+/**
+ * GETTER - SETTER
+ * for container of BF
+ */
+BF & Element::at(avm_size_t offset)
+{
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Illegal method call << Element::at( "
+ << str() << " , " << offset << " ) >> !!!"
+ << SEND_EXIT;
+
+ throw( std::exception() );
+}
+
+const BF & Element::at(avm_size_t offset) const
+{
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Illegal method call << Element::at( "
+ << str() << " , " << offset << " ) >> !!!"
+ << SEND_EXIT;
+
+ throw( std::exception() );
+}
+
+
+BF & Element::operator[](avm_size_t offset)
+{
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Illegal method call << Element::operator[]( "
+ << str() << " , " << offset << " ) >> !!!"
+ << SEND_EXIT;
+
+ throw( std::exception() );
+}
+
+const BF & Element::operator[](avm_size_t offset) const
+{
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Illegal method call << Element::operator[]( "
+ << str() << " , " << offset << " ) >> !!!"
+ << SEND_EXIT;
+
+ throw( std::exception() );
+}
+
+
+BF & Element::getWritable(avm_size_t offset)
+{
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Illegal method call << Element::getWritable( "
+ << str() << " , " << offset << " ) >> !!!"
+ << SEND_EXIT;
+
+ throw( std::exception() );
+}
+
+void Element::makeWritable(avm_size_t offset)
+{
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Illegal method call << Element::makeWritable( "
+ << str() << " , " << offset << " ) >> !!!"
+ << SEND_EXIT;
+
+ throw( std::exception() );
+}
+
+void Element::set(avm_size_t offset, const BF & bf)
+{
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Illegal method call << Element::set( "
+ << str() << " , " << offset << " ) >> !!!"
+ << SEND_EXIT;
+
+ throw( std::exception() );
+}
+
+avm_size_t Element::size() const
+{
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Illegal method call << Element::size() >> !!!"
+ << SEND_EXIT;
+
+ throw( std::exception() );
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/common/Element.h b/org.eclipse.efm.symbex/src/common/Element.h
new file mode 100644
index 0000000..8b66f64
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/common/Element.h
@@ -0,0 +1,263 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef COMMON_ELEMENT_H_
+#define COMMON_ELEMENT_H_
+
+#include <base/ClassKindInfo.h>
+#include <common/AvmObject.h>
+
+namespace sep
+{
+
+
+class BF;
+
+
+class Element :
+ public AvmObject,
+ public ClassKindImpl,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( Element )
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Element(class_kind_t aClassKind)
+ : AvmObject( ),
+ ClassKindImpl( aClassKind )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ * Abstract pur
+ */
+ Element(const Element & anElement)
+ : AvmObject( anElement ),
+ ClassKindImpl( anElement )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Element()
+ {
+ //!! NOTHING
+ }
+
+
+ inline avm_address_t raw_address() const
+ {
+ return( avm_address_t( this ) );
+ }
+
+
+ /**
+ * CLONE
+ */
+ virtual Element * clone() const = 0;
+
+
+ /**
+ * GETTER - SETTER
+ * for container of BF
+ */
+ // Generally with range check
+ virtual BF & at(avm_size_t offset);
+ virtual const BF & at(avm_size_t offset) const;
+
+ // Generally with range check
+ virtual const BF & operator[](avm_size_t offset) const;
+ virtual BF & operator[](avm_size_t offset);
+
+ virtual BF & getWritable(avm_size_t offset);
+
+ virtual void makeWritable(avm_size_t offset);
+
+ virtual void set(avm_size_t offset, const BF & bf);
+
+ virtual avm_size_t size() const;
+
+
+ /**
+ * COMPARISON
+ * OPERATOR
+ */
+
+ inline virtual bool isEQ(const Element & bf) const
+ {
+ return( this == &bf );
+ }
+
+ inline virtual bool isEQ(const Element * bf) const
+ {
+ return( (bf != NULL) && isEQ(* bf) );
+ }
+
+
+ inline virtual bool isNEQ(const Element & bf) const
+ {
+ return( this != &bf );
+ }
+
+ inline virtual bool isNEQ(const Element * bf) const
+ {
+ return( (bf == NULL) || isNEQ(* bf) );
+ }
+
+
+ bool virtual isTEQ(const Element & bf) const
+ {
+ return( this == &bf );
+ }
+
+ bool virtual isTEQ(const Element * bf) const
+ {
+ return( this == bf );
+ }
+
+
+ inline virtual bool isNTEQ(const Element & bf) const
+ {
+ return( this != &bf );
+ }
+
+ inline virtual bool isNTEQ(const Element * bf) const
+ {
+ return( this != bf );
+ }
+
+
+ /**
+ * SERIALIZATION
+ */
+ virtual void toStream(OutStream & os) const = 0;
+
+
+ inline void serialize(OutStream & os) const
+ {
+ toStream( os );
+ }
+
+
+ inline virtual std::string str() const
+ {
+ StringOutStream oss( AVM_STR_INDENT );
+
+ toStream( oss << IGNORE_FIRST_TAB );
+
+ return( oss.str() );
+ }
+
+
+ inline virtual std::string strNum(
+ uint8_t precision = AVM_MUMERIC_PRECISION) const
+ {
+ return( str() );
+ }
+
+
+ /**
+ * TRACE on DESTROY
+ * dbgDestroy
+ */
+ inline void dbgDestroy() const
+ {
+ AVM_OS_WARN << "destroy< @ " << avm_address_t( this )
+ << " , " << std::setw(16) << classKindName() << " > : "
+ << std::flush << str() << std::endl;
+ }
+
+};
+
+
+template< class T >
+class ClonableElement : public Element
+{
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ClonableElement(class_kind_t aClassKind)
+ : Element( aClassKind )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ ClonableElement(const Element & anElement)
+ : Element( anElement )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CLONE
+ */
+ virtual T * clone() const
+ {
+ return( new T( * static_cast< const T * >(this) ) );
+ }
+};
+
+
+template< class T >
+class UnclonableElement : public Element
+{
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ UnclonableElement(class_kind_t aClassKind)
+ : Element( aClassKind )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ UnclonableElement(const Element & anElement)
+ : Element( anElement )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CLONE
+ */
+ virtual T * clone() const
+ {
+ return( const_cast< T * >(this) );
+ }
+};
+
+
+}
+
+#endif /*COMMON_ELEMENT_H_*/
diff --git a/org.eclipse.efm.symbex/src/common/NamedElement.cpp b/org.eclipse.efm.symbex/src/common/NamedElement.cpp
new file mode 100644
index 0000000..2d2b6da
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/common/NamedElement.cpp
@@ -0,0 +1,293 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mars 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "NamedElement.h"
+
+#include <boost/tokenizer.hpp>
+
+
+namespace sep
+{
+
+/**
+ * ATTRIBUTES
+ */
+const std::string NamedElement::UNNAMED_ID = "<name-id:?>";
+
+
+/*
+ * UTIL
+ * return suffix of <container-id>.<name-id> i.e. <name-id>
+ */
+std::string NamedElement::extractNameID(const std::string & aQualifiedNameID)
+{
+ if( not aQualifiedNameID.empty() )
+ {
+ std::string::size_type pos = aQualifiedNameID.find_last_of('.');
+
+ if( pos != std::string::npos )
+ {
+ return( aQualifiedNameID.substr(pos + 1) );
+ }
+ else
+ {
+ pos = aQualifiedNameID.find(FQN_ID_ROOT_SEPARATOR);
+
+ if( pos != std::string::npos )
+ {
+ return( aQualifiedNameID.substr(pos + 2) );
+ }
+ }
+ }
+
+ return( aQualifiedNameID );
+}
+
+
+/**
+ * UTIL
+ * return <container-id>.<name-id>
+ * return <fqn> without <system-id>
+ */
+std::string NamedElement::makeQualifiedNameID(
+ const std::string & aQualifiedNameID)
+{
+ std::string::size_type posLocator =
+ aQualifiedNameID.find(FQN_ID_ROOT_SEPARATOR);
+
+ if( posLocator != std::string::npos )
+ {
+ std::string::size_type posLocation = aQualifiedNameID.find('.');
+
+ if( (posLocation != std::string::npos) && (posLocation > posLocator) )
+ {
+ return( OSS() << aQualifiedNameID.substr(0, posLocator) << ":"
+ << aQualifiedNameID.substr(posLocation + 1) );
+ }
+ }
+
+ return( aQualifiedNameID );
+}
+
+std::string NamedElement::makeQualifiedNameID(
+ const std::string & aQualifiedNameID, const std::string & aNameID)
+{
+ std::string::size_type posLocator =
+ aQualifiedNameID.find(FQN_ID_ROOT_SEPARATOR);
+
+ if( posLocator != std::string::npos )
+ {
+ std::string::size_type posLocation = aQualifiedNameID.find_last_of('.',
+ (aQualifiedNameID.size() - aNameID.size() - 2) );
+
+ if( (posLocation != std::string::npos) && (posLocation > posLocator) )
+ {
+ return( OSS() << aQualifiedNameID.substr(0, posLocator) << ":"
+ << aQualifiedNameID.substr(posLocation + 1) );
+ }
+ }
+
+ return( aQualifiedNameID );
+}
+
+
+std::string NamedElement::getContainerQualifiedNameID(
+ const std::string & aQualifiedNameID)
+{
+ if( not aQualifiedNameID.empty() )
+ {
+ std::string::size_type pos = aQualifiedNameID.find_last_of('.');
+
+ if( pos != std::string::npos )
+ {
+ return( aQualifiedNameID.substr(0, pos) );
+ }
+ else
+ {
+ pos = aQualifiedNameID.find(FQN_ID_ROOT_SEPARATOR);
+
+ if( pos != std::string::npos )
+ {
+ return( aQualifiedNameID.substr(pos + 2) );
+ }
+ else
+ {
+ return( "" );
+ }
+ }
+ }
+
+ return( aQualifiedNameID );
+}
+
+
+/*
+ *******************************************************************************
+ * COMPARER FOR QUALIFIED NAME ID STRING
+ *******************************************************************************
+ */
+bool NamedElement::compareID(
+ const std::string & aQualifiedNameID, op_comparer_t op) const
+{
+ switch( op )
+ {
+ case OP_STRONG_COMPARER :
+ return( (mFullyQualifiedNameID == aQualifiedNameID)
+ || NamedElement::compareLocation(
+ mFullyQualifiedNameID, aQualifiedNameID) );
+
+ case OP_STRICT_COMPARER :
+ return( mFullyQualifiedNameID == aQualifiedNameID );
+
+ case OP_ABSOLUTE_COMPARER :
+ return( NamedElement::compareLocation(
+ mFullyQualifiedNameID, aQualifiedNameID) );
+
+ case OP_RELATIVE_COMPARER :
+ return( this->fqnEndsWith(aQualifiedNameID) );
+
+ case OP_NAME_ID_COMPARER :
+ return( mNameID == aQualifiedNameID );
+
+ case OP_UNRESTRICTED_NAME_COMPARER :
+ return( mUnrestrictedName == aQualifiedNameID );
+
+ default:
+ {
+ if( (op & OP_STRICT_COMPARER)
+ && (mFullyQualifiedNameID == aQualifiedNameID) )
+ {
+ return( true );
+ }
+ if( (op & OP_ABSOLUTE_COMPARER)
+ && NamedElement::compareLocation(
+ mFullyQualifiedNameID, aQualifiedNameID) )
+ {
+ return( true );
+ }
+ if( (op & OP_RELATIVE_COMPARER )
+ && this->fqnEndsWith(aQualifiedNameID) )
+ {
+ return( true );
+ }
+ if( (op & OP_NAME_ID_COMPARER)
+ && (mNameID == aQualifiedNameID) )
+ {
+ return( true );
+ }
+
+ if( (op & OP_UNRESTRICTED_NAME_COMPARER)
+ && (mNameID == aQualifiedNameID) )
+ {
+ return( true );
+ }
+
+ return( false );
+ }
+ }
+}
+
+
+/*
+ * !UNUSED!
+bool NamedElement::compareID(
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aQualifiedNameID, op_comparer_t op)
+{
+ if( (op & OP_STRICT_COMPARER)
+ && (aFullyQualifiedNameID == aQualifiedNameID) )
+ {
+ return( true );
+ }
+ if( (op & OP_ABSOLUTE_COMPARER)
+ && NamedElement::compareLocation(
+ aFullyQualifiedNameID, aQualifiedNameID) )
+ {
+ return( true );
+ }
+ if( (op & OP_RELATIVE_COMPARER )
+ && NamedElement::fqnEndsWith(aFullyQualifiedNameID, aQualifiedNameID) )
+ {
+ return( true );
+ }
+ if( (op & OP_NAME_ID_COMPARER)
+ && (NamedElement::extractNameID(aFullyQualifiedNameID)
+ == aQualifiedNameID) )
+ {
+ return( true );
+ }
+
+ if( (op & OP_UNRESTRICTED_NAME_COMPARER)
+ && (aFullyQualifiedNameID == aQualifiedNameID) )
+ {
+ return( true );
+ }
+
+ return( false );
+}
+* !UNUSED!
+*/
+
+
+/*
+ *******************************************************************************
+ * LIST of ID of QUALIFIED NAME ID
+ *******************************************************************************
+ */
+avm_size_t NamedElement::collectNameID(Collection< std::string > & listNameID,
+ const std::string & aQualifiedNameID, std::string::size_type pos)
+{
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( pos < aQualifiedNameID.size() )
+ << "Bad string position in NamedElement::listofID("
+ << aQualifiedNameID << " , " << pos << " )"
+ << SEND_EXIT;
+
+ const std::string & subQualifiedNameID = aQualifiedNameID.substr(pos);
+
+ typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
+ boost::char_separator<char> sep(".");
+
+ tokenizer tokens(subQualifiedNameID, sep);
+ avm_size_t count = 0;
+ tokenizer::iterator it = tokens.begin();
+ for( ; it != tokens.end() ; ++it , ++count )
+ {
+ listNameID.append((std::string) (*it));
+ }
+
+ return( count );
+}
+
+
+avm_size_t NamedElement::collectNameID(Collection< std::string > & listNameID,
+ const std::string & aQualifiedNameID)
+{
+ typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
+ boost::char_separator<char> sep(".");
+
+ tokenizer tokens(aQualifiedNameID, sep);
+ avm_size_t count = 0;
+ tokenizer::iterator it = tokens.begin();
+ for( ; it != tokens.end() ; ++it , ++count )
+ {
+ listNameID.append((std::string) (*it));
+ }
+
+ return( count );
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/common/NamedElement.h b/org.eclipse.efm.symbex/src/common/NamedElement.h
new file mode 100644
index 0000000..4535c90
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/common/NamedElement.h
@@ -0,0 +1,580 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mars 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef COMMON_NAMEDELEMENT_H_
+#define COMMON_NAMEDELEMENT_H_
+
+#include <common/Element.h>
+
+#include <collection/Collection.h>
+
+
+
+namespace sep
+{
+
+
+/**
+ * DEFAULT
+ * Fully Qualified Name ID SchemeSeparator
+ */
+#define FQN_ID_SCHEME_PATH_SEPARATOR ":/"
+
+#define FQN_ID_ROOT_SEPARATOR "::"
+
+
+class NamedElement :
+ public Element ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( NamedElement )
+{
+
+public:
+/**
+ * TYPEDEF
+ */
+ typedef avm_uint8_t op_comparer_t;
+
+ enum {
+ OP_STRICT_COMPARER = 0x001,
+
+ OP_ABSOLUTE_COMPARER = 0x002, // Ignore LOCATOR
+
+ OP_RELATIVE_COMPARER = 0x004,
+
+ OP_NAME_ID_COMPARER = 0x008,
+
+ OP_UNRESTRICTED_NAME_COMPARER = 0x010,
+
+ OP_STRONG_COMPARER = OP_STRICT_COMPARER
+ | OP_ABSOLUTE_COMPARER,
+
+ OP_QUALIFIED_NAME_ID_COMPARER = OP_STRICT_COMPARER
+ | OP_ABSOLUTE_COMPARER
+ | OP_RELATIVE_COMPARER
+ | OP_NAME_ID_COMPARER,
+
+ OP_WEAK_COMPARER = OP_QUALIFIED_NAME_ID_COMPARER
+ | OP_UNRESTRICTED_NAME_COMPARER,
+
+ OP_ANY_COMPARER = OP_STRONG_COMPARER
+ | OP_WEAK_COMPARER
+ };
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ static const std::string UNNAMED_ID;
+
+ std::string mFullyQualifiedNameID;
+ std::string mNameID;
+ std::string mUnrestrictedName;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ NamedElement(class_kind_t aClassKind)
+ : Element( aClassKind ),
+ mFullyQualifiedNameID( ),
+ mNameID( ),
+ mUnrestrictedName( )
+ {
+ //!! NOTHING
+ }
+
+ NamedElement(class_kind_t aClassKind, const std::string & aNameID)
+ : Element( aClassKind ),
+ mFullyQualifiedNameID( ),
+ mNameID( aNameID ),
+ mUnrestrictedName( aNameID )
+ {
+ //!! NOTHING
+ }
+
+ NamedElement(class_kind_t aClassKind,
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID,
+ const std::string & anUnrestrictedName)
+ : Element( aClassKind ),
+ mFullyQualifiedNameID( aFullyQualifiedNameID ),
+ mNameID( aNameID ),
+ mUnrestrictedName( anUnrestrictedName )
+ {
+ //!! NOTHING
+ }
+
+ NamedElement(class_kind_t aClassKind,
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID)
+ : Element( aClassKind ),
+ mFullyQualifiedNameID( aFullyQualifiedNameID ),
+ mNameID( aNameID ),
+ mUnrestrictedName( aNameID )
+ {
+ //!! NOTHING
+ }
+
+
+ NamedElement(class_kind_t aClassKind, const NamedElement & anElement)
+ : Element( aClassKind ),
+ mFullyQualifiedNameID( ),
+ mNameID( ),
+ mUnrestrictedName( )
+ {
+ setAllName( anElement );
+ }
+
+ NamedElement(class_kind_t aClassKind, NamedElement * anElement)
+ : Element( aClassKind ),
+ mFullyQualifiedNameID( ),
+ mNameID( ),
+ mUnrestrictedName( )
+ {
+ setAllName( anElement );
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ NamedElement(const NamedElement & anElement)
+ : Element( anElement ),
+ mFullyQualifiedNameID( anElement.mFullyQualifiedNameID ),
+ mNameID( anElement.mNameID ),
+ mUnrestrictedName( anElement.mUnrestrictedName )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~NamedElement()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mFullyQualifiedNameID
+ */
+ inline virtual const std::string & getFullyQualifiedNameID() const
+ {
+ return( mFullyQualifiedNameID );
+ }
+
+ inline bool hasFullyQualifiedNameID() const
+ {
+ return( not mFullyQualifiedNameID.empty() );
+ }
+
+ inline void setFullyQualifiedNameID(
+ const std::string & aFullyQualifiedNameID)
+ {
+ mFullyQualifiedNameID = aFullyQualifiedNameID;
+
+ extractSetNameID( aFullyQualifiedNameID );
+ }
+
+ inline void setFullyQualifiedNameContainer( NamedElement * anElement)
+ {
+ mFullyQualifiedNameID =
+ ( OSS() << anElement->getFullyQualifiedNameID()
+ << '.' << getNameID() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mNameID
+ */
+ inline virtual const std::string & getNameID() const
+ {
+ return( mNameID );
+ }
+
+ inline bool hasNameID() const
+ {
+ return( not mNameID.empty() );
+ }
+
+ inline void setNameID(const std::string & aNameID)
+ {
+ mNameID = aNameID;
+ }
+
+ inline void extractSetNameID(const std::string & aQualifiedNameID)
+ {
+ mNameID = NamedElement::extractNameID( aQualifiedNameID );
+ }
+
+
+ /*
+ * UTIL
+ * return suffix of <container-id>.<name-id> i.e. <name-id>
+ */
+ static std::string extractNameID(const std::string & aQualifiedNameID);
+
+ /**
+ * GETTER - SETTER
+ * mFullyQualifiedNameID
+ */
+ inline void setAllNameID(const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID)
+ {
+ mFullyQualifiedNameID = aFullyQualifiedNameID;
+
+ setNameID( aNameID );
+ }
+
+ inline void setAllNameID(const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID, const std::string & name)
+ {
+ mFullyQualifiedNameID = aFullyQualifiedNameID;
+
+ mNameID = aNameID;
+
+ mUnrestrictedName = name;
+ }
+
+
+ /**
+ * UTIL
+ */
+ inline bool isNamed() const
+ {
+ return( not isUnamed() );
+ }
+
+ inline bool isUnamed() const
+ {
+ return( mFullyQualifiedNameID.empty() &&
+ mNameID.empty() && mUnrestrictedName.empty() );
+ }
+
+
+ inline void setAllName(const NamedElement & anElement)
+ {
+ mFullyQualifiedNameID = anElement.mFullyQualifiedNameID;
+ mNameID = anElement.mNameID;
+ mUnrestrictedName = anElement.mUnrestrictedName;
+ }
+
+ inline void setAllName(NamedElement * anElement)
+ {
+ if( anElement != NULL )
+ {
+ mFullyQualifiedNameID = anElement->mFullyQualifiedNameID;
+ mNameID = anElement->mNameID;
+ mUnrestrictedName = anElement->mUnrestrictedName;
+ }
+ }
+
+
+ /**
+ * COMPARISON
+ * OPERATOR
+ */
+ inline int compareFQN(const NamedElement & other) const
+ {
+ return( mFullyQualifiedNameID.compare( other.mFullyQualifiedNameID ) );
+ }
+
+ // STRICT:> compare LOCATOR & LOCATION [true:- retry only only LOCATION]
+ inline bool fqnEquals(const std::string & aFullyQualifiedNameID,
+ bool enabledOnlyLocationComparisonElse = false) const
+ {
+ return( (mFullyQualifiedNameID == aFullyQualifiedNameID)
+ || (enabledOnlyLocationComparisonElse
+ && NamedElement::compareLocation(
+ this, aFullyQualifiedNameID)) );
+ }
+
+ inline bool fqnEndsWith(const std::string & aQualifiedNameID) const
+ {
+ return( (mNameID == aQualifiedNameID)
+ || NamedElement::fqnEndsWith(
+ mFullyQualifiedNameID, aQualifiedNameID) );
+ }
+
+ inline bool fqnStartsWith(const std::string & aQualifiedNameID) const
+ {
+ return( mFullyQualifiedNameID.find(aQualifiedNameID) == 0 );
+ }
+
+ /**
+ * GETTER
+ * Qualified Name IDentifier
+ * QualifiedNameID
+ */
+ inline virtual std::string getQualifiedNameID() const
+ {
+ return( NamedElement::makeQualifiedNameID(
+ mFullyQualifiedNameID , mNameID ) );
+ }
+
+
+ inline bool isRelative() const
+ {
+ return( NamedElement::isRelative(mFullyQualifiedNameID) );
+ }
+
+
+ /**
+ * UTIL
+ * return <container-id>.<name-id>
+ */
+ static std::string makeQualifiedNameID(
+ const std::string & aQualifiedNameID);
+
+ static std::string makeQualifiedNameID(
+ const std::string & aQualifiedNameID, const std::string & aNameID);
+
+ static std::string getContainerQualifiedNameID(
+ const std::string & aQualifiedNameID);
+
+ /**
+ * Loacation
+ * Locator
+ */
+ inline static std::string location(const std::string & aQualifiedNameID)
+ {
+ std::string::size_type pos =
+ aQualifiedNameID.find(FQN_ID_ROOT_SEPARATOR);
+
+ return( (pos != std::string::npos) ?
+ aQualifiedNameID.substr(pos + 2 ) : aQualifiedNameID );
+ }
+
+ inline static std::string locator(const std::string & aQualifiedNameID)
+ {
+ std::string::size_type pos =
+ aQualifiedNameID.find(FQN_ID_ROOT_SEPARATOR);
+
+ return( (pos != std::string::npos) ?
+ aQualifiedNameID.substr(0, pos) : "" );
+ }
+
+
+ inline static bool compareID(
+ const std::string & aQualifiedNameID_1,
+ const std::string & aQualifiedNameID_2)
+ {
+ return( aQualifiedNameID_1 == aQualifiedNameID_2 );
+ }
+
+ inline static bool compareLocation(
+ const std::string & aQualifiedNameID_1,
+ const std::string & aQualifiedNameID_2)
+ {
+ return( NamedElement::location(aQualifiedNameID_1)
+ == NamedElement::location(aQualifiedNameID_2) );
+ }
+
+ /**
+ * isAbsolute
+ * isRelative
+ */
+ inline static bool isAbsolute(const std::string & aQualifiedNameID)
+ {
+ return( aQualifiedNameID.find(FQN_ID_ROOT_SEPARATOR)
+ != std::string::npos );
+ }
+
+ inline static bool isRelative(const std::string & aQualifiedNameID)
+ {
+ return( aQualifiedNameID.find(FQN_ID_ROOT_SEPARATOR)
+ == std::string::npos );
+ }
+
+
+ inline static bool isNull(const std::string & aQualifiedNameID)
+ {
+ return( (not aQualifiedNameID.empty())
+ && (aQualifiedNameID[ 0 ] == '<')
+ && (aQualifiedNameID.find_last_of(":null")
+ != std::string::npos) );
+ }
+
+ inline static bool isSimplenameID(const std::string & aQualifiedNameID)
+ {
+ return( (aQualifiedNameID.find_last_of('.') == std::string::npos)
+ && (aQualifiedNameID.find(FQN_ID_ROOT_SEPARATOR)
+ == std::string::npos) );
+ }
+
+
+ /**
+ * GETTER
+ * "name" of a USER FORM
+ */
+ inline const std::string & getUnrestrictedName() const
+ {
+ return( mUnrestrictedName );
+ }
+
+ inline bool hasUnrestrictedName() const
+ {
+ return( not mUnrestrictedName.empty() );
+ }
+
+ inline bool hasReallyUnrestrictedName() const
+ {
+ return( (not mUnrestrictedName.empty()) &&
+ (mUnrestrictedName != mNameID ) );
+ }
+
+ inline void setUnrestrictedName(const std::string & name)
+ {
+ mUnrestrictedName = name;
+ }
+
+
+ /*
+ ***************************************************************************
+ * COMPARER FOR QUALIFIED NAME ID STRING
+ ***************************************************************************
+ */
+ bool compareID(const std::string & aQualifiedNameID,
+ op_comparer_t op) const;
+
+ /*
+ * !UNUSED!
+ static bool compareID(const std::string & aFullyQualifiedNameID,
+ const std::string & aQualifiedNameID, op_comparer_t op);
+
+ inline static bool compareFullyQualifiedNameID(
+ const NamedElement * anElement,
+ const std::string & aQualifiedNameID)
+ {
+ return( anElement->compareID(aQualifiedNameID, OP_STRONG_COMPARER) );
+ }
+ * !UNUSED!
+ */
+
+ inline static bool compareLocation(const NamedElement * anElement,
+ const std::string & aQualifiedNameID)
+ {
+ return( anElement->compareID(aQualifiedNameID, OP_ABSOLUTE_COMPARER) );
+ }
+
+ /*
+ * !UNUSED!
+ inline static bool compareQualifiedNameID(
+ const NamedElement * anElement,
+ const std::string & aQualifiedNameID)
+ {
+ return( compareID(anElement,
+ aQualifiedNameID, OP_QUALIFIED_NAME_ID_COMPARER) );
+ }
+ * !UNUSED!
+ */
+
+ inline static bool fqnStartsWith(
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aQualifiedNameID)
+ {
+ return( aFullyQualifiedNameID.find(aQualifiedNameID) == 0 );
+ }
+
+ inline static bool fqnEndsWith(
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aQualifiedNameID)
+ {
+ std::size_t rpos = aFullyQualifiedNameID.rfind(aQualifiedNameID);
+
+ return( (rpos != std::string::npos)
+ && (rpos == (aFullyQualifiedNameID.length()
+ - aQualifiedNameID.length()))
+ && ( (rpos == 0)
+ || (aFullyQualifiedNameID[rpos-1] == '.')
+ || (aFullyQualifiedNameID[rpos-1] == ':') ) );
+ }
+
+
+ /*
+ ***************************************************************************
+ * LIST of ID of QUALIFIED NAME ID
+ ***************************************************************************
+ */
+ static avm_size_t collectNameID(Collection< std::string > & listNameID,
+ const std::string & aQualifiedNameID, std::string::size_type pos);
+
+ inline static avm_size_t collectNameID(
+ Collection< std::string > & listNameID,
+ const std::string & aQualifiedNameID, const std::string & ignorePrefix)
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT(
+ aQualifiedNameID.find(ignorePrefix) == 0 )
+ << "Bad prefix string in NamedElement::listofID("
+ << aQualifiedNameID << ", " << ignorePrefix << ") !!!"
+ << SEND_EXIT;
+
+ return NamedElement::collectNameID(listNameID,
+ aQualifiedNameID, ignorePrefix.size());
+ }
+
+ static avm_size_t collectNameID(Collection< std::string > & listNameID,
+ const std::string & aQualifiedNameID);
+
+
+ /**
+ * Serialization
+ */
+ inline virtual std::string strFQN(
+ const std::string & defaultFQN = "<unamed-element>") const
+ {
+ return( hasFullyQualifiedNameID() ? mFullyQualifiedNameID
+ : ( hasNameID() ? mNameID
+ : ( hasUnrestrictedName() ? ("'" + mUnrestrictedName + "'")
+ : defaultFQN ) ) );
+
+ return( defaultFQN );
+ }
+
+ inline void virtual strFQN(OutStream & os) const
+ {
+ os << strFQN();
+ }
+
+
+ /**
+ * Serialization
+ */
+ inline virtual std::string str() const
+ {
+ if( not getFullyQualifiedNameID().empty() )
+ {
+ return( getFullyQualifiedNameID() );
+ }
+ else if( not getNameID().empty() )
+ {
+ return( getNameID() );
+ }
+ return( getUnrestrictedName() );
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* COMMON_NAMEDELEMENT_H_ */
diff --git a/org.eclipse.efm.symbex/src/common/README.md b/org.eclipse.efm.symbex/src/common/README.md
new file mode 100644
index 0000000..3ea9a28
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/common/README.md
@@ -0,0 +1,18 @@
+# EFM-SYMBEX : Common
+
+## Source code structure
+
+### Interfaces
+
+### Classes
+* **Reference Counter**
+* **Element**
+* **NamedElement**
+ - Name / Identifier
+ - UnrestrictedName
+ - QualifiedName
+ - Description
+* **Smart Pointer**
+
+
+### Factories
diff --git a/org.eclipse.efm.symbex/src/common/RunnableElement.cpp b/org.eclipse.efm.symbex/src/common/RunnableElement.cpp
new file mode 100644
index 0000000..d2f9ea0
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/common/RunnableElement.cpp
@@ -0,0 +1,231 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 1 déc. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "RunnableElement.h"
+
+#include <fml/workflow/Query.h>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+RunnableElement::RunnableElement(WObject * wfParameterObject)
+: NamedElement( CLASS_KIND_T( RunnableElement ) , wfParameterObject ),
+SerializerFeature( ),
+mParameterWObject( wfParameterObject ),
+mConfigFlag( false ),
+
+mReportPrintFlag( true ),
+
+mStartupLifecycleStatus( RUNNABLE_IDLE_STATE ),
+mStaticLifecycleStatus ( RUNNABLE_UNDEFINED_STATE ),
+mDynamicLifecycleStatus( RUNNABLE_UNDEFINED_STATE )
+{
+ //!! NOTHING
+}
+
+RunnableElement::RunnableElement(
+ class_kind_t aClassKind, WObject * wfParameterObject)
+: NamedElement( aClassKind , wfParameterObject ),
+SerializerFeature( ),
+mParameterWObject( wfParameterObject ),
+mConfigFlag( false ),
+
+mReportPrintFlag( true ),
+
+mStartupLifecycleStatus( RUNNABLE_IDLE_STATE ),
+mStaticLifecycleStatus ( RUNNABLE_UNDEFINED_STATE ),
+mDynamicLifecycleStatus( RUNNABLE_UNDEFINED_STATE )
+{
+ //!! NOTHING
+}
+
+
+/**
+ * SETTER
+ * mParameterWObject
+ */
+void RunnableElement::setParameterWObject(WObject * wfParameterObject)
+{
+ mParameterWObject = wfParameterObject;
+
+ if( (mParameterWObject != WObject::_NULL_)
+ && isUnamed() )
+ {
+ setAllName( mParameterWObject );
+ }
+}
+
+
+/**
+ * CONFIGURE
+ */
+bool RunnableElement::configure()
+{
+ // INITIALIZATION
+ configureDebug();
+
+ mConfigFlag = true;
+
+ if( getParameterWObject() != WObject::_NULL_ )
+ {
+ mConfigFlag = SerializerFeature::configure( getParameterWObject() );
+
+ mReportPrintFlag = Query::getWPropertyBoolean(
+ Query::getWSequenceOrElse(
+ getParameterWObject(), "PROPERTY", "REPORT"),
+ "reporting", true);
+ }
+
+ return( mConfigFlag );
+}
+
+/**
+ *******************************************************************************
+prototype process::... as &avm::processor... is
+ section SCHEDULING
+ @startup = 'waiting';
+ endsection SCHEDULING
+endprototype
+ *******************************************************************************
+ */
+bool RunnableElement::configureLifecycleState()
+{
+ mStartupLifecycleStatus = RUNNABLE_IDLE_STATE;
+
+ WObject * theLIFECYCLE = Query::getRegexWSequence(getParameterWObject(),
+ OR_WID4("lifecycle", "LIFECYCLE", "scheduling", "SCHEDULING") );
+
+ if( theLIFECYCLE != WObject::_NULL_ )
+ {
+ std::string strStartupStatus =
+ Query::getWPropertyString(theLIFECYCLE, "startup", "ready");
+
+ mStartupLifecycleStatus =
+ RunnableElement::toLifecycle(strStartupStatus);
+
+ StringTools::tolower( strStartupStatus );
+
+ if( (mStartupLifecycleStatus != RUNNABLE_READY_STATE)
+ && (mStartupLifecycleStatus != RUNNABLE_STANDBY_STATE) )
+ {
+ AVM_OS_WARN << "RunnableElement::configureLifecycleState:> "
+ "Unexpected lifecycle other than READY or STANDBY status "
+ "for startup !!!"
+ << std::endl;
+
+ return( false );
+ }
+ }
+
+ mDynamicLifecycleStatus = mStartupLifecycleStatus;
+
+ mStaticLifecycleStatus = RUNNABLE_CONFIGURED_STATE;
+
+ return( true );
+}
+
+
+void RunnableElement::configureDebug()
+{
+AVM_IF_DEBUG_FLAG_AND( CONFIGURING, (getParameterWObject() != WObject::_NULL_) )
+
+ AVM_OS_LOG << std::endl;
+
+ AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PARSING)
+
+ getParameterWObject()->toStream(AVM_OS_LOG);
+
+ AVM_DEBUG_ELSE
+
+ AVM_OS_LOG << str_header( getParameterWObject() ) << std::endl;
+
+ AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PARSING )
+
+AVM_ENDIF_DEBUG_FLAG_AND( CONFIGURING )
+}
+
+
+/**
+ * SERIALIZATION API
+ */
+std::string RunnableElement::strLifecycle(lifecycle_status_t aLifecycleStatus)
+{
+ switch( aLifecycleStatus)
+ {
+ case RUNNABLE_IDLE_STATE : return( "IDLE" );
+ case RUNNABLE_RUNNING_STATE : return( "RUNNING" );
+
+ case RUNNABLE_WAITING_STATE : return( "WAITING" );
+ case RUNNABLE_SUSPENDED_STATE : return( "SUSPENDED" );
+ case RUNNABLE_STOPPED_STATE : return( "STOPPED" );
+ case RUNNABLE_EXITED_STATE : return( "EXITED" );
+
+ case RUNNABLE_CONFIGURED_STATE : return( "CONFIGURED" );
+ case RUNNABLE_INITIALIZED_STATE : return( "INITIALIZED" );
+ case RUNNABLE_STARTED_STATE : return( "STARTED" );
+ case RUNNABLE_RELEASED_STATE : return( "RELEASED" );
+
+ case RUNNABLE_READY_STATE : return( "READY" );
+ case RUNNABLE_STANDBY_STATE : return( "STANDBY" );
+
+ case RUNNABLE_UNDEFINED_STATE : return( "UNDEFINED" );
+
+ default : return( "UNKNOWN" );
+ }
+}
+
+
+RunnableElement::lifecycle_status_t
+RunnableElement::toLifecycle(std::string aLifecycle)
+{
+ StringTools::toupper( aLifecycle );
+
+#define TO_LIFECYCLE( lifecycle ) \
+ if( aLifecycle == #lifecycle ) return( RUNNABLE_##lifecycle##_STATE );
+
+ TO_LIFECYCLE( IDLE )
+ TO_LIFECYCLE( RUNNING )
+
+ TO_LIFECYCLE( WAITING )
+ TO_LIFECYCLE( SUSPENDED )
+ TO_LIFECYCLE( STOPPED )
+ TO_LIFECYCLE( EXITED )
+
+ TO_LIFECYCLE( CONFIGURED )
+ TO_LIFECYCLE( INITIALIZED )
+ TO_LIFECYCLE( STARTED )
+ TO_LIFECYCLE( RELEASED )
+
+ TO_LIFECYCLE( READY )
+ TO_LIFECYCLE( STANDBY )
+
+ return( RUNNABLE_UNDEFINED_STATE );
+}
+
+
+std::string RunnableElement::strUniqId() const
+{
+ return( (mParameterWObject != WObject::_NULL_) ?
+ mParameterWObject->strUniqId() : "<null-thread-id>" );
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/common/RunnableElement.h b/org.eclipse.efm.symbex/src/common/RunnableElement.h
new file mode 100644
index 0000000..caa116a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/common/RunnableElement.h
@@ -0,0 +1,581 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 1 déc. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef COMMON_RUNNABLEELEMENT_H_
+#define COMMON_RUNNABLEELEMENT_H_
+
+#include <common/NamedElement.h>
+#include <common/SerializerFeature.h>
+
+
+namespace sep
+{
+
+
+enum ExecCmdStatus
+{
+ EXEC_CMD_UNKNOWN,
+ EXEC_CMD_OK,
+ EXEC_CMD_EXIT,
+ EXEC_CMD_FAILED
+};
+
+
+class WObject;
+
+
+class RunnableElement :
+ public NamedElement,
+ public SerializerFeature,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( RunnableElement )
+{
+
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef avm_uint16_t lifecycle_status_t;
+
+ enum {
+ RUNNABLE_UNDEFINED_STATE = 0x0000,
+
+
+ RUNNABLE_CONFIGURED_STATE = 0x0001,
+
+ RUNNABLE_INITIALIZED_STATE = 0x0002,
+
+ RUNNABLE_STARTED_STATE = 0x0004,
+
+ RUNNABLE_RELEASED_STATE = 0x0008,
+
+
+ RUNNABLE_READY_STATE = 0x0010,
+
+ RUNNABLE_STANDBY_STATE = 0x0020,
+
+
+ RUNNABLE_IDLE_STATE = 0x0040,
+
+ RUNNABLE_RUNNING_STATE = 0x0080,
+
+
+ RUNNABLE_WAITING_STATE = 0x0100,
+
+ RUNNABLE_SUSPENDED_STATE = 0x0200,
+
+
+ RUNNABLE_STOPPED_STATE = 0x0400,
+
+ RUNNABLE_EXITED_STATE = 0x0800,
+
+ // ALIASES
+ RUNNABLE_STATIC_READY_STATE = RUNNABLE_INITIALIZED_STATE
+ | RUNNABLE_STARTED_STATE
+ | RUNNABLE_READY_STATE,
+
+ RUNNABLE_DYNAMIC_READY_STATE = RUNNABLE_IDLE_STATE
+ | RUNNABLE_RUNNING_STATE,
+
+ RUNNABLE_ACTIVE_STATE = RUNNABLE_STARTED_STATE
+ | RUNNABLE_READY_STATE
+ | RUNNABLE_IDLE_STATE
+ | RUNNABLE_RUNNING_STATE
+ | RUNNABLE_WAITING_STATE
+ | RUNNABLE_SUSPENDED_STATE,
+
+ RUNNABLE_INACTIVE_STATE = RUNNABLE_STANDBY_STATE
+ | RUNNABLE_STOPPED_STATE
+ | RUNNABLE_RELEASED_STATE
+ | RUNNABLE_EXITED_STATE
+ };
+
+
+ struct AutoRunningIdleSwitcher
+ {
+ RunnableElement & mRunnableElement;
+
+ AutoRunningIdleSwitcher(RunnableElement & aRunnableElement)
+ :mRunnableElement( aRunnableElement )
+ {
+ mRunnableElement.setLifecycleRunning();
+ }
+
+ ~AutoRunningIdleSwitcher()
+ {
+ mRunnableElement.setLifecycleIdle();
+ }
+ };
+
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ WObject * mParameterWObject;
+
+ //Indicateur du bon déroulement de la procédure << configure() >>
+ bool mConfigFlag;
+
+ //Indicateur pour afficher un rapport final
+ bool mReportPrintFlag;
+
+ lifecycle_status_t mStartupLifecycleStatus;
+
+ lifecycle_status_t mStaticLifecycleStatus;
+
+ lifecycle_status_t mDynamicLifecycleStatus;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ RunnableElement(WObject * wfParameterObject);
+
+ RunnableElement(class_kind_t aClassKind, WObject * wfParameterObject);
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ * Abstract pur
+ */
+ RunnableElement(const RunnableElement & aRunnable)
+ : NamedElement( aRunnable ),
+ SerializerFeature( aRunnable ),
+ mParameterWObject( aRunnable.mParameterWObject ),
+ mConfigFlag( aRunnable.mConfigFlag ),
+
+ mReportPrintFlag( aRunnable.mReportPrintFlag ),
+
+ mStartupLifecycleStatus( aRunnable.mStartupLifecycleStatus ),
+ mStaticLifecycleStatus ( aRunnable.mStaticLifecycleStatus ),
+ mDynamicLifecycleStatus( aRunnable.mDynamicLifecycleStatus )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~RunnableElement()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mParameterWObject
+ */
+ inline WObject * getParameterWObject() const
+ {
+ return( mParameterWObject );
+ }
+
+ inline bool hasParameterWObject() const
+ {
+ return( mParameterWObject != NULL /*WObject::_NULL_*/ );
+ }
+
+ void setParameterWObject(WObject * wfParameterObject);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // RUNNABLE LIFECYCLE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * GETTER - SETTER
+ * mStaticLifecycleStatus
+ */
+ inline bool isLifecycleConfigured() const
+ {
+ return( (mStaticLifecycleStatus & RUNNABLE_CONFIGURED_STATE) != 0 );
+ }
+
+ inline void setLifecycleConfigured()
+ {
+ mStaticLifecycleStatus = RUNNABLE_CONFIGURED_STATE;
+ }
+
+
+ inline bool isLifecycleInitialized() const
+ {
+ return( (mStaticLifecycleStatus & RUNNABLE_INITIALIZED_STATE) != 0 );
+ }
+
+ inline void setLifecycleInitialized()
+ {
+ mStaticLifecycleStatus = RUNNABLE_INITIALIZED_STATE;
+ }
+
+
+ inline bool isLifecycleStarted() const
+ {
+ return( (mStaticLifecycleStatus & RUNNABLE_STARTED_STATE) != 0 );
+ }
+
+ inline void setLifecycleStarted()
+ {
+ mStaticLifecycleStatus = RUNNABLE_STARTED_STATE;
+ }
+
+
+ inline bool isLifecycleReleased() const
+ {
+ return( (mStaticLifecycleStatus & RUNNABLE_RELEASED_STATE) != 0 );
+ }
+
+ inline void setLifecycleReleased()
+ {
+ mStaticLifecycleStatus = RUNNABLE_RELEASED_STATE;
+ }
+
+
+ inline bool isLifecycleStopped() const
+ {
+ return( (mStaticLifecycleStatus & RUNNABLE_STOPPED_STATE) != 0 );
+ }
+
+ inline void setLifecycleStopped()
+ {
+ mStaticLifecycleStatus = RUNNABLE_STOPPED_STATE;
+ }
+
+
+ inline bool isLifecycleExited() const
+ {
+ return( (mStaticLifecycleStatus & RUNNABLE_EXITED_STATE) != 0 );
+ }
+
+ inline void setLifecycleExited()
+ {
+ mStaticLifecycleStatus = RUNNABLE_EXITED_STATE;
+ }
+
+
+ inline bool isLifecycleReady() const
+ {
+ return( (mStaticLifecycleStatus & RUNNABLE_READY_STATE) != 0 );
+ }
+
+ inline void setLifecycleReady()
+ {
+ mStaticLifecycleStatus = RUNNABLE_READY_STATE;
+ }
+
+
+ inline bool isLifecycleStandby() const
+ {
+ return( (mStaticLifecycleStatus & RUNNABLE_STANDBY_STATE) != 0 );
+ }
+
+ inline void setLifecycleStandby()
+ {
+ mStaticLifecycleStatus = RUNNABLE_STANDBY_STATE;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mStaticLifecycleStatus
+ */
+ inline bool isLifecycleIdle() const
+ {
+ return( (mDynamicLifecycleStatus & RUNNABLE_IDLE_STATE) != 0 );
+ }
+
+ inline void setLifecycleIdle()
+ {
+ mDynamicLifecycleStatus = RUNNABLE_IDLE_STATE;
+ }
+
+
+ inline bool isLifecycleRunning() const
+ {
+ return( (mDynamicLifecycleStatus & RUNNABLE_RUNNING_STATE) != 0 );
+ }
+
+ inline void setLifecycleRunning()
+ {
+ mDynamicLifecycleStatus = RUNNABLE_RUNNING_STATE;
+ }
+
+
+ inline bool isLifecycleWaiting() const
+ {
+ return( (mDynamicLifecycleStatus & RUNNABLE_WAITING_STATE) != 0 );
+ }
+
+ inline void setLifecycleWaiting()
+ {
+ mDynamicLifecycleStatus = RUNNABLE_WAITING_STATE;
+ }
+
+
+ inline bool isLifecycleSuspended() const
+ {
+ return( (mDynamicLifecycleStatus & RUNNABLE_SUSPENDED_STATE) != 0 );
+ }
+
+ inline void setLifecycleSuspended()
+ {
+ mDynamicLifecycleStatus = RUNNABLE_SUSPENDED_STATE;
+ }
+
+
+ /**
+ * TESTER
+ * LifecycleStatus
+ */
+ inline bool isLifecycleActive() const
+ {
+ return( (mStaticLifecycleStatus & RUNNABLE_ACTIVE_STATE) != 0 );
+ }
+
+ inline bool isLifecycleInactive() const
+ {
+ return( (mStaticLifecycleStatus & RUNNABLE_INACTIVE_STATE) != 0 );
+ }
+
+
+ inline virtual bool isLifecycleRunnable()const
+ {
+ return( ((mDynamicLifecycleStatus & RUNNABLE_DYNAMIC_READY_STATE) != 0)
+ && ((mStaticLifecycleStatus & RUNNABLE_STATIC_READY_STATE) != 0) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // START / STOP / KILL / SUSPEND / RESUME API
+ ////////////////////////////////////////////////////////////////////////////
+
+// virtual int start()
+// {
+// //!! NOTHING
+// return( true );
+// }
+
+ inline virtual int stop()
+ {
+ setLifecycleStopped();
+
+ //!! NOTHING
+ return( 0 );
+ }
+
+
+ inline virtual int kill()
+ {
+ setLifecycleStopped();
+
+ //!! NOTHING
+ return( 0 );
+ }
+
+
+ inline virtual bool suspend()
+ {
+ setLifecycleSuspended();
+
+ //!! NOTHING
+ return( true );
+ }
+
+ inline virtual bool resume()
+ {
+ setLifecycleIdle();
+
+ //!! NOTHING
+ return( true );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool configure();
+
+ bool configureLifecycleState();
+
+ virtual void configureDebug();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // INIT API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool initImpl() = 0;
+
+ inline virtual bool init()
+ {
+ if( initImpl() )
+ {
+ setLifecycleInitialized();
+
+ return( true );
+ }
+
+ return( false );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // EXIT API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool exitImpl() = 0;
+
+ inline virtual bool exit()
+ {
+ if( exitImpl() )
+ {
+ setLifecycleExited();
+
+ return( true );
+ }
+
+ return( false );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // REPORT API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline virtual void report(OutStream & os) const
+ {
+ if( mReportPrintFlag )
+ {
+ AVM_VERBOSITY_SWITCH_SILENT
+
+ reportSilent(os);
+
+ AVM_VERBOSITY_SWITCH_CASE_MINIMUM
+
+ reportMinimum(os);
+
+ AVM_VERBOSITY_SWITCH_CASE_MEDIUM
+
+ reportMedium(os);
+
+ AVM_VERBOSITY_SWITCH_CASE_MAXIMUM
+
+ reportMaximum(os);
+
+ AVM_VERBOSITY_SWITCH_END
+ }
+ }
+
+ inline virtual void report(PairOutStream & os) const
+ {
+ report( os.OS1 );
+ report( os.OS2 );
+ }
+
+ inline virtual void report(TripleOutStream & os) const
+ {
+ report( os.OS1 );
+ report( os.OS2 );
+ report( os.OS3 );
+ }
+
+
+ inline virtual void reportSilent(OutStream & os) const
+ {
+ reportMinimum(os);
+ }
+
+ inline virtual void reportMinimum(OutStream & os) const
+ {
+ reportDefault(os);
+ }
+
+ inline virtual void reportMedium(OutStream & os) const
+ {
+ reportDefault(os);
+ }
+
+ inline virtual void reportMaximum(OutStream & os) const
+ {
+ reportDefault(os);
+ }
+
+ inline virtual void reportDefault(OutStream & os) const
+ {
+ //!! NOTHING
+ }
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PROCESS API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline virtual bool preprocess()
+ {
+ //!! NOTHING
+ return( true );
+ }
+
+ inline virtual bool postprocess()
+ {
+ //!! NOTHING
+ return( true );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SERIALIZATION API
+ ////////////////////////////////////////////////////////////////////////////
+
+ static std::string strLifecycle(lifecycle_status_t aLifecycleStatus);
+
+ static lifecycle_status_t toLifecycle(std::string aLifecycle);
+
+ inline std::string strDynamicLifecycleStatus() const
+ {
+ return( strLifecycle(mDynamicLifecycleStatus) );
+ }
+
+ inline std::string strStaticLifecycleStatus() const
+ {
+ return( strLifecycle(mStaticLifecycleStatus) );
+ }
+
+ inline OutStream & strLifecycleStatus(OutStream & os) const
+ {
+ os << "< dynamic:" << strLifecycle(mStaticLifecycleStatus)
+ << " , static:" << strLifecycle(mDynamicLifecycleStatus) << " >";
+
+ return( os );
+ }
+
+ virtual std::string strUniqId() const;
+
+ inline virtual void toStream(OutStream & os) const
+ {
+ //!! NOTHING
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* COMMON_RUNNABLEELEMENT_H_ */
diff --git a/org.eclipse.efm.symbex/src/common/SerializerFeature.cpp b/org.eclipse.efm.symbex/src/common/SerializerFeature.cpp
new file mode 100644
index 0000000..ec65c51
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/common/SerializerFeature.cpp
@@ -0,0 +1,674 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 23 nov. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "SerializerFeature.h"
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <util/avm_vfs.h>
+
+#include <boost/tokenizer.hpp>
+
+
+namespace sep
+{
+
+/**
+ *******************************************************************************
+prototype filter::filter_ufid as avm::core.filter.filter_type is
+ section PROPERTY
+ ...
+ endsection PROPERTY
+
+ section REPORT
+ @uri = std ":" ( "cout" | "cerr" )
+ | avm ":" ( "log" | "trace" )
+ | folder ":" path
+ | file ":" path
+ | filename ":" path
+ | socket ":" host ":" port
+ ;
+ @uri = ...;
+
+ @when = [ init ][:]
+ [ otf | (every | after | before) ? value#unit][:][ exit ];
+
+ endsection REPORT
+
+endprototype
+ *******************************************************************************
+ */
+
+
+static bool scanPeriod(std::string period,
+ avm_delay_value_t & value, avm_unit_t & unit)
+{
+ if( ::isdigit(period[0]) )
+ {
+ std::string::size_type pos = period.find('#');
+
+ if( pos != std::string::npos )
+ {
+ if( not sep::from_string<avm_delay_value_t>(
+ period.substr(0, pos), value, std::dec) )
+ {
+ return false;
+ }
+ period = period.substr(pos+1);
+
+ if( period == "ns" )
+ {
+ unit = AVM_NANO_SECOND_UNIT;
+ }
+ else if( period == "µs" )
+ {
+ unit = AVM_MICRO_SECOND_UNIT;
+ }
+ else if( period == "ms" )
+ {
+ unit = AVM_MILLI_SECOND_UNIT;
+ }
+ else if( period == "s" )
+ {
+ unit = AVM_SECOND_UNIT;
+ }
+ else if( period == "min" )
+ {
+ unit = AVM_MINUTE_UNIT;
+ }
+ else if( period == "h" )
+ {
+ unit = AVM_HOUR_UNIT;
+ }
+ else if( period == "step" )
+ {
+ unit = AVM_STEP_UNIT;
+ }
+ else if( REGEX_MATCH(period , CONS_WID2("micro", "step")) )
+ {
+ unit = AVM_MICRO_STEP_UNIT;
+ }
+ else if( REGEX_MATCH(period , CONS_WID2("macro", "step")) )
+ {
+ unit = AVM_MACRO_STEP_UNIT;
+ }
+ else
+ {
+ return false;
+ }
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool SerializerFeature::configure(WObject * wfParameterObject)
+{
+ bool isConfigOK = true;
+
+ WObject * theVFS = Query::getRegexWSequence(
+ wfParameterObject, OR_WID2("vfs", "VFS"));
+
+ if( theVFS == WObject::_NULL_ )
+ {
+ theVFS = Query::getRegexWSequence(
+ wfParameterObject, OR_WID2("report", "REPORT"));
+ }
+
+ if( theVFS != WObject::_NULL_ )
+ {
+ mReportDetailsFlag =
+ Query::getWPropertyBoolean(theVFS, "details", false);
+
+ ////////////////////////////////////////////////////////////////////////
+ // The report mTableOfURI Attributes
+ ////////////////////////////////////////////////////////////////////////
+ lastFolder.location = VFS::ProjectOutputPath;
+
+ std::string::size_type pos;
+ std::string scheme;
+ std::string attrID;
+
+ WObject::const_iterator itWfO = theVFS->owned_begin();
+ WObject::const_iterator endWfO = theVFS->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty() )
+ {
+ scheme = attrID = (*itWfO)->getNameID();
+
+ AvmUri & uri = appendUri( (*itWfO)->toStringValue() );
+
+ if( StringTools::startsWith(scheme, "uri") )
+ {
+ pos = uri.raw.find(':');
+ if( pos != std::string::npos )
+ {
+ scheme = uri.raw.substr(0, pos);
+ uri.location = uri.raw.substr(pos+1);
+ }
+ }
+ else
+ {
+ pos = scheme.find('#');
+ if( pos != std::string::npos )
+ {
+ scheme = scheme.substr(0, pos);
+ }
+ uri.location = uri.raw;
+ }
+
+ if( scheme.empty() )
+ {
+ theVFS->errorLocation(AVM_OS_WARN)
+ << "Expected an uri like:> "
+ << "std:stream | file:path | socket:host:port !!!"
+ << std::endl;
+
+ destroyLastUri();
+
+ isConfigOK = false;
+
+ continue;
+ }
+
+
+ if( StringTools::startsWith(scheme, "stream") )
+ {
+ if( configureStream(theVFS, uri) )
+ {
+ mapUri(attrID, uri);
+ }
+ else
+ {
+ destroyLastUri();
+
+ isConfigOK = false;
+ }
+ }
+
+ else if( StringTools::startsWith(scheme, "folder") )
+ {
+ if( configureFolder(theVFS, uri) )
+ {
+ mapUri(attrID, uri);
+ }
+ else
+ {
+ destroyLastUri();
+
+ isConfigOK = false;
+ }
+ }
+
+ else if( StringTools::startsWith(scheme, "file") )
+ {
+ if( configureFile(theVFS, uri) )
+ {
+ mapUri(attrID, uri);
+ }
+ else
+ {
+ destroyLastUri();
+
+ isConfigOK = false;
+ }
+ }
+
+ else if( StringTools::startsWith(scheme, "filename") )
+ {
+ if( configureFilename(theVFS, uri) )
+ {
+ mapUri(attrID, uri);
+ }
+ else
+ {
+ destroyLastUri();
+
+ isConfigOK = false;
+ }
+ }
+
+ else if( StringTools::startsWith(scheme, "socket") )
+ {
+ if( configureSocket(theVFS, uri) )
+ {
+ mapUri(attrID, uri);
+ }
+ else
+ {
+ destroyLastUri();
+
+ isConfigOK = false;
+ }
+ }
+
+ else
+ {
+ theVFS->errorLocation(AVM_OS_WARN)
+ << "Expected an uri like:> "
+ << "std:stream | file:path | socket:host:port !!!"
+ << std::endl;
+
+ destroyLastUri();
+
+ isConfigOK = false;
+ }
+ }
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////
+ // The report PERIOD Attribute
+ ////////////////////////////////////////////////////////////////////////
+ std::string strPeriod = Query::getWPropertyString(theVFS, "when", "");
+ if( not strPeriod.empty() )
+ {
+ isConfigOK = configurePeriod(theVFS, strPeriod)
+ && isConfigOK;
+ }
+
+
+ if( mReportDetailsFlag )
+ {
+ SerializerFeature::toStream(AVM_OS_COUT);
+ }
+ }
+ else
+ {
+// theVFS->errorLocation(AVM_OS_WARN)
+// << "Expected a REPORT section !!!" << std::endl;
+ }
+
+ return( true );
+}
+
+
+bool SerializerFeature::configureStream(WObject * theVFS, AvmUri & uri)
+{
+ if( uri.location.find("std:") == 0 )
+ {
+ if( uri.location == "std:cout" )
+ {
+ uri.kind |= AVM_URI_STREAM_STD_COUT_KIND;
+ uri.outStream.OS = AVM_OS_COUT.OS;
+ }
+ else if( uri.location == "std:cerr" )
+ {
+ uri.kind |= AVM_URI_STREAM_STD_CERR_KIND;
+ uri.outStream.OS = AVM_OS_CERR.OS;
+ }
+ else
+ {
+ theVFS->errorLocation(AVM_OS_WARN)
+ << "Expected an uri like:> "
+ << "std:( cout | cerr ) !!!" << std::endl;
+
+ return false;
+ }
+ }
+
+ else if( uri.location.find("avm:") == 0 )
+ {
+ if( uri.location == "avm:log" )
+ {
+ uri.kind |= AVM_URI_STREAM_AVM_LOG_KIND;
+ uri.outStream.OS = AVM_OS_LOG.OS;
+ }
+ else if( uri.location == "avm:trace" )
+ {
+ uri.kind |= AVM_URI_STREAM_AVM_TRACE_KIND;
+ uri.outStream.OS = AVM_OS_TRACE.OS;
+ }
+ else
+ {
+ theVFS->errorLocation(AVM_OS_WARN)
+ << "Expected an uri like:> "
+ << "avm:( log | trace ) !!!" << std::endl;
+
+ return false;
+ }
+ }
+
+ return( true );
+}
+
+
+bool SerializerFeature::configureFolder(WObject * theVFS, AvmUri & uri)
+{
+ uri.kind |= AVM_URI_FOLDER_KIND;
+
+ if( uri.location == "avm:project" )
+ {
+ lastFolder.location = uri.location = VFS::ProjectPath;
+ }
+ else if( uri.location == "avm:output" )
+ {
+ lastFolder.location = uri.location = VFS::ProjectOutputPath;
+ }
+ else if( uri.location == "avm:source" )
+ {
+ lastFolder.location = uri.location = VFS::ProjectSourcePath;
+ }
+ else if( uri.location == "avm:log" )
+ {
+ lastFolder.location = uri.location = VFS::ProjectLogPath;
+ }
+ else
+ {
+ lastFolder.location = uri.location =
+ VFS::native_path(uri.location, lastFolder.location);
+
+ if ( not VFS::checkWritingFolder(uri.location) )
+ {
+ theVFS->errorLocation(AVM_OS_WARN)
+ << "The folder `" << uri.location
+ << "' ---> doesn't exist or "
+ "is not writable !!!" << std::endl;
+
+ return( false );
+ }
+ }
+
+ return( true );
+}
+
+
+bool SerializerFeature::configureFile(WObject * theVFS, AvmUri & uri)
+{
+ uri.kind |= AVM_URI_FILE_KIND;
+
+ uri.location = VFS::native_path(uri.location, lastFolder.location);
+
+ uri.outStream = new std::ofstream(uri.location.c_str(), uri.mode);
+
+ if( uri.outStream.good() )
+ {
+ uri.isAllocated = true;
+
+ lastFile.location = uri.location;
+
+ return( true );
+ }
+ else
+ {
+ theVFS->errorLocation(AVM_OS_WARN)
+ << "Failed to open < " << uri.location
+ << " > file in write mode !!!" << std::endl;
+
+ return( false );
+ }
+}
+
+
+bool SerializerFeature::configureFilename(WObject * theVFS, AvmUri & uri)
+{
+ uri.kind |= AVM_URI_FILENAME_KIND;
+
+ uri.location = VFS::native_path(uri.location, lastFolder.location);
+
+ uri.outStream = new std::ofstream(uri.location.c_str(), uri.mode);
+
+ if( uri.outStream.good() )
+ {
+ uri.isAllocated = true;
+
+ lastFilename.location = uri.location;
+
+ return( true );
+ }
+ else
+ {
+ theVFS->errorLocation(AVM_OS_WARN)
+ << "Failed to open < " << uri.location
+ << " > filename in write mode !!!" << std::endl;
+
+ return( false );
+ }
+}
+
+
+bool SerializerFeature::configureSocket(WObject * theVFS, AvmUri & uri)
+{
+ uri.kind |= AVM_URI_SOCKET_KIND;
+
+ std::string::size_type pos = uri.location.find(':');
+
+ if( pos != std::string::npos )
+ {
+ if( not sep::from_string<avm_uint64_t>(
+ uri.location.substr(pos+1), uri.port, std::dec) )
+ {
+ theVFS->errorLocation(AVM_OS_WARN)
+ << "Expected an uri<socket> with valid port number like:> "
+ << "socket:host:port !!!" << std::endl;
+
+ return false;
+ }
+
+ uri.location = uri.location.substr(0, pos);
+ }
+ else
+ {
+ theVFS->errorLocation(AVM_OS_WARN)
+ << "Expected an uri like:> "
+ << "socket:host:port !!!" << std::endl;
+
+ return false;
+ }
+
+ return( true );
+}
+
+
+bool SerializerFeature::configurePeriod(
+ WObject * theVFS, const std::string & strPeriod)
+{
+ std::string period;
+ std::string::size_type pos;
+
+ typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
+ boost::char_separator<char> sep(":");
+
+ tokenizer tokens(strPeriod, sep);
+ tokenizer::iterator endIt = tokens.end();
+ for( tokenizer::iterator it = tokens.begin() ; it != endIt ; ++it )
+ {
+ period = *it;
+
+ if( period == "init" )
+ {
+ mPeriodKind |= AVM_PERIOD_INIT_KIND;
+ }
+ else if( period == "exit" )
+ {
+ mPeriodKind |= AVM_PERIOD_EXIT_KIND;
+ }
+
+ else if( period == "preprocess" )
+ {
+ mPeriodKind |= AVM_PERIOD_PREPROCESS_KIND;
+ }
+ else if( period == "postprocess" )
+ {
+ mPeriodKind |= AVM_PERIOD_POSTPROCESS_KIND;
+ }
+
+ else if( period == "prefilter" )
+ {
+ mPeriodKind |= AVM_PERIOD_PREFILTER_KIND;
+ }
+ else if( period == "postfilter" )
+ {
+ mPeriodKind |= AVM_PERIOD_POSTFILTER_KIND;
+ }
+
+ else if( period == "otf" )
+ {
+ mPeriodKind |= AVM_PERIOD_OTF_KIND;
+ }
+ else if( period.find("every") == 0 )
+ {
+ mPeriodKind |= AVM_PERIOD_EVERY_KIND;
+
+ pos = period.find('?');
+ if( (pos != std::string::npos) &&
+ (not scanPeriod(period.substr(pos+1),
+ mPeriodEveryValue, mPeriodEveryUnit)) )
+ {
+ theVFS->errorLocation(AVM_OS_WARN)
+ << "Expected a period like:> "
+ << "every?delay#unit !!!" << std::endl;
+
+ return false;
+ }
+ }
+
+ else if( period.find("after") == 0 )
+ {
+ mPeriodKind |= AVM_PERIOD_AFTER_KIND;
+
+ pos = period.find('?');
+ if( (pos != std::string::npos) &&
+ (not scanPeriod(period.substr(pos+1),
+ mPeriodAfterValue, mPeriodAfterUnit)) )
+ {
+ theVFS->errorLocation(AVM_OS_WARN)
+ << "Expected a period like:> "
+ << "after?delay#unit !!!" << std::endl;
+
+ return false;
+ }
+ }
+
+ else if( period.find("before") == 0 )
+ {
+ mPeriodKind |= AVM_PERIOD_BEFORE_KIND;
+
+ pos = period.find('?');
+ if( (pos != std::string::npos) &&
+ (not scanPeriod(period.substr(pos+1),
+ mPeriodBeforeValue, mPeriodBeforeUnit)) )
+ {
+ theVFS->errorLocation(AVM_OS_WARN)
+ << "Expected a period like:> "
+ << "before?delay#unit !!!" << std::endl;
+
+ return false;
+ }
+ }
+
+ else
+ {
+ theVFS->errorLocation(AVM_OS_WARN)
+ << "Expected a period like:> "
+ << "[ init ][:][ otf | (every | after | before)?"
+ "value#unit][:][ exit ] !!!" << std::endl;
+
+ return false;
+ }
+ }
+
+ return( true );
+}
+
+
+
+/**
+ *******************************************************************************
+ * SERIALIZATION
+ *******************************************************************************
+ */
+
+std::string SerializerFeature::strPeriodKind(avm_period_kind_t kind)
+{
+ switch ( kind )
+ {
+ case AVM_PERIOD_INIT_KIND : return( "init");
+ case AVM_PERIOD_EXIT_KIND : return( "exit");
+
+ case AVM_PERIOD_OTF_KIND : return( "otf");
+
+ case AVM_PERIOD_EVERY_KIND : return( "every");
+ case AVM_PERIOD_AFTER_KIND : return( "after");
+ case AVM_PERIOD_BEFORE_KIND : return( "before");
+
+ case AVM_PERIOD_UNDEFINED_KIND : return( "undefined<period#kind>");
+
+ default : return( "unknown<period#kind>" );
+ }
+}
+
+
+void SerializerFeature::toStream(OutStream & os) const
+{
+ os << TAB << "report:" << EOL;
+
+ os << TAB2 << "details = "
+ << (mReportDetailsFlag ? "true" : "false") << ";"
+ << EOL_INCR_INDENT;
+
+ VectorOfAvmUri::const_iterator it = mTableOfURI.begin();
+ VectorOfAvmUri::const_iterator endIt = mTableOfURI.end();
+ for( ; it != endIt ; ++it )
+ {
+ (*it).toStream(os);
+ }
+
+ std::string sep = "";
+ os << DECR_INDENT_TAB2 << "when = ";
+
+ if( IS_PERIOD_INIT_KIND(mPeriodKind) )
+ {
+ os << "init";
+ sep = ":";
+ }
+
+ if( IS_PERIOD_AFTER_KIND(mPeriodKind) )
+ {
+ os << (sep = ":") << "after?" << mPeriodAfterValue
+ << "#" << strUnit(mPeriodAfterUnit);
+ ;
+ }
+
+ if( IS_PERIOD_OTF_KIND(mPeriodKind) )
+ {
+ os << (sep = ":") << "otf";
+ }
+
+ if( IS_PERIOD_EVERY_KIND(mPeriodKind) )
+ {
+ os << (sep = ":") << "every?" << mPeriodEveryValue
+ << "#" << strUnit(mPeriodEveryUnit);
+ }
+
+ if( IS_PERIOD_BEFORE_KIND(mPeriodKind) )
+ {
+ os << (sep = ":") << "before?" << mPeriodBeforeValue
+ << "#" << strUnit(mPeriodBeforeUnit);
+ }
+
+ if( IS_PERIOD_EXIT_KIND(mPeriodKind) )
+ {
+ os << (sep = ":") << "exit";
+ }
+ os << ";" << EOL;
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/common/SerializerFeature.h b/org.eclipse.efm.symbex/src/common/SerializerFeature.h
new file mode 100644
index 0000000..7d18841
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/common/SerializerFeature.h
@@ -0,0 +1,537 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 23 nov. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef COMMON_SERIALIZERFEATURE_H_
+#define COMMON_SERIALIZERFEATURE_H_
+
+#include <util/avm_numeric.h>
+#include <util/avm_types.h>
+#include <util/avm_uri.h>
+
+#include <collection/Vector.h>
+
+#include <printer/OutStream.h>
+
+#include <map>
+
+
+namespace sep
+{
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// The PERIOD for reporting, ...
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+typedef avm_uint16_t avm_period_kind_t;
+
+enum {
+ AVM_PERIOD_UNDEFINED_KIND = 0x0000,
+
+ AVM_PERIOD_INIT_KIND = 0x0001,
+ AVM_PERIOD_EXIT_KIND = 0x0002,
+
+ AVM_PERIOD_PREPROCESS_KIND = 0x0004,
+ AVM_PERIOD_POSTPROCESS_KIND = 0x0008,
+
+ AVM_PERIOD_PREFILTER_KIND = 0x0010,
+ AVM_PERIOD_POSTFILTER_KIND = 0x0020,
+
+
+ AVM_PERIOD_OTF_KIND = 0x0040,
+ AVM_PERIOD_EVERY_KIND = 0x0080,
+
+ AVM_PERIOD_AFTER_KIND = 0x0100,
+ AVM_PERIOD_BEFORE_KIND = 0x0200,
+
+};
+
+#define IS_PERIOD_UNDEFINED_KIND(kind) (kind == AVM_PERIOD_UNDEFINED_KIND)
+
+#define IS_PERIOD_INIT_KIND(kind) (kind & AVM_PERIOD_INIT_KIND)
+#define IS_PERIOD_EXIT_KIND(kind) (kind & AVM_PERIOD_EXIT_KIND)
+
+#define IS_PERIOD_PREPROCESS_KIND(kind) (kind & AVM_PERIOD_PREPROCESS_KIND)
+#define IS_PERIOD_POSTPROCESS_KIND(kind) (kind & AVM_PERIOD_POSTPROCESS_KIND)
+
+#define IS_PERIOD_PREFILTER_KIND(kind) (kind & AVM_PERIOD_PREFILTER_KIND)
+#define IS_PERIOD_POSTFILTER_KIND(kind) (kind & AVM_PERIOD_POSTFILTER_KIND)
+
+#define IS_PERIOD_OTF_KIND(kind) (kind & AVM_PERIOD_OTF_KIND)
+#define IS_PERIOD_EVERY_KIND(kind) (kind & AVM_PERIOD_EVERY_KIND)
+
+#define IS_PERIOD_AFTER_KIND(kind) (kind & AVM_PERIOD_AFTER_KIND)
+#define IS_PERIOD_BEFORE_KIND(kind) (kind & AVM_PERIOD_BEFORE_KIND)
+
+
+class WObject;
+
+
+class SerializerFeature
+{
+
+protected:
+ /**
+ * TYPEDEF
+ */
+ typedef Vector< AvmUri > VectorOfAvmUri;
+
+
+ /**
+ * ATTRIBUTES
+ */
+ VectorOfAvmUri mTableOfURI;
+
+ AvmUri lastFolder;
+ AvmUri lastFile;
+ AvmUri lastFilename;
+
+ std::map< std::string , AvmUri * > mUriMap;
+
+ VectorOfAvmUri::iterator itURI;
+ VectorOfAvmUri::iterator endURI;
+ AvmUri * currentURI;
+
+ avm_period_kind_t mPeriodKind;
+
+ avm_delay_value_t mPeriodEveryValue;
+ avm_unit_t mPeriodEveryUnit;
+
+ avm_delay_value_t mPeriodAfterValue;
+ avm_unit_t mPeriodAfterUnit;
+
+ avm_delay_value_t mPeriodBeforeValue;
+ avm_unit_t mPeriodBeforeUnit;
+
+ // Only for RUNTIME
+ avm_delay_value_t mTimeInitValue;
+ avm_delay_value_t mTimePreviousValue;
+
+
+ // DETAILS REPORTING
+ bool mReportDetailsFlag;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ SerializerFeature()
+ : mTableOfURI( ),
+ lastFolder( AVM_URI_FOLDER_KIND , "." ),
+ lastFile( AVM_URI_FILE_KIND , "_" ),
+ lastFilename( AVM_URI_FILENAME_KIND , "_" ),
+ mUriMap( ),
+ itURI( ),
+ endURI( ),
+ currentURI( NULL ),
+
+ mPeriodKind( AVM_PERIOD_EXIT_KIND ),
+
+ mPeriodEveryValue( 0 ),
+ mPeriodEveryUnit( AVM_UNDEFINED_UNIT ),
+
+ mPeriodAfterValue( 0 ),
+ mPeriodAfterUnit( AVM_UNDEFINED_UNIT ),
+
+ mPeriodBeforeValue( 0 ),
+ mPeriodBeforeUnit( AVM_UNDEFINED_UNIT ),
+
+ mTimeInitValue( 0 ),
+ mTimePreviousValue( 0 ),
+
+ mReportDetailsFlag( true )
+
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~SerializerFeature()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONFIGURE
+ */
+ bool configure(WObject * wfParameterObject);
+
+ bool configureStream(WObject * theVFS, AvmUri & uri);
+
+ bool configureFolder(WObject * theVFS, AvmUri & uri);
+
+ bool configureFile(WObject * theVFS, AvmUri & uri);
+ bool configureFilename(WObject * theVFS, AvmUri & uri);
+
+ bool configureSocket(WObject * theVFS, AvmUri & uri);
+
+ bool configurePeriod(WObject * theVFS, const std::string & strPeriod);
+
+
+ /**
+ * SCHEDULE REPORT
+ */
+ virtual bool scheduleReport()
+ {
+ return( true );
+ }
+
+
+ /**
+ * GETTER -- SETTER
+ * mTableOfURI
+ */
+ inline AvmUri & appendUri( const std::string & rawLocation )
+ {
+ mTableOfURI.push_back( rawLocation );
+
+ return( mTableOfURI.back() );
+ }
+
+ inline void destroyLastUri()
+ {
+ mTableOfURI.pop_back();
+ }
+
+
+
+ inline const VectorOfAvmUri & getUri() const
+ {
+ return( mTableOfURI );
+ }
+
+ inline bool hasUri() const
+ {
+ return( mTableOfURI.empty() );
+ }
+
+ inline const AvmUri & getFolder() const
+ {
+ return( lastFolder );
+ }
+
+ inline const AvmUri & getLastFolder() const
+ {
+ return( lastFolder );
+ }
+
+ inline const AvmUri & getLastFile() const
+ {
+ return( lastFile );
+ }
+
+ inline const AvmUri & getLastFilename() const
+ {
+ return( lastFilename );
+ }
+
+
+ inline bool openStream()
+ {
+ endURI = mTableOfURI.end();
+ for( itURI = mTableOfURI.begin() ; itURI != endURI ; ++itURI )
+ {
+ if( not (*itURI).open() )
+ {
+
+ }
+ }
+
+ itURI = mTableOfURI.begin();
+ return( true );
+ }
+
+ inline void closeStream()
+ {
+ endURI = mTableOfURI.end();
+ for( itURI = mTableOfURI.begin() ; itURI != endURI ; ++itURI )
+ {
+ (*itURI).close();
+ }
+ }
+
+
+ inline void beginStream()
+ {
+ itURI = mTableOfURI.begin();
+ endURI = mTableOfURI.end();
+ }
+
+ inline bool hasStream()
+ {
+ while( itURI != endURI )
+ {
+ currentURI = &( *(itURI++) );
+ if( currentURI->outStream.good() )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+ }
+
+ inline OutStream & currentStream() const
+ {
+ return( currentURI->outStream );
+ }
+
+
+ /**
+ * GETTER -- SETTER
+ * mTableOfURI
+ */
+ inline void mapUri(const std::string & key, AvmUri & anUri)
+ {
+ mUriMap[ key ] = & anUri;
+ }
+
+ /**
+ * GETTER
+ * PERIOD KIND
+ */
+ inline avm_period_kind_t getPeriodKind() const
+ {
+ return( mPeriodKind );
+ }
+
+ inline bool hasPeriodKind() const
+ {
+ return( mPeriodKind != AVM_PERIOD_UNDEFINED_KIND );
+ }
+
+ inline void setPeriodKind(avm_period_kind_t kind)
+ {
+ mPeriodKind = kind;
+ }
+
+ inline void unsetPeriodKind()
+ {
+ mPeriodKind = AVM_PERIOD_UNDEFINED_KIND;
+ }
+
+
+ /**
+ * GETTER
+ * PERIOD EVERY KIND
+ */
+ inline avm_unit_t getPeriodEveryUnit() const
+ {
+ return( mPeriodEveryUnit );
+ }
+
+ inline bool hasPeriodEveryUnit() const
+ {
+ return( mPeriodEveryUnit != AVM_PERIOD_UNDEFINED_KIND );
+ }
+
+ inline void setPeriodEveryUnit(avm_unit_t unit)
+ {
+ mPeriodEveryUnit = unit;
+ }
+
+ inline void unsetPeriodEveryUnit()
+ {
+ mPeriodEveryUnit = AVM_PERIOD_UNDEFINED_KIND;
+ }
+
+
+ /**
+ * GETTER
+ * PERIOD EVERY VALUE
+ */
+ inline avm_delay_value_t getPeriodEveryValue() const
+ {
+ return( mPeriodEveryValue );
+ }
+
+ inline bool hasPeriodEveryValue() const
+ {
+ return( mPeriodEveryValue > 0 );
+ }
+
+ inline void setPeriodEveryValue(avm_delay_value_t value)
+ {
+ mPeriodEveryValue = value;
+ }
+
+
+ /**
+ * GETTER
+ * PERIOD AFTER KIND
+ */
+ inline avm_unit_t getPeriodAfterUnit() const
+ {
+ return( mPeriodAfterUnit );
+ }
+
+ inline bool hasPeriodAfterUnit() const
+ {
+ return( mPeriodAfterUnit != AVM_PERIOD_UNDEFINED_KIND );
+ }
+
+ inline void setPeriodAfterUnit(avm_unit_t unit)
+ {
+ mPeriodAfterUnit = unit;
+ }
+
+ inline void unsetPeriodAfterUnit()
+ {
+ mPeriodAfterUnit = AVM_PERIOD_UNDEFINED_KIND;
+ }
+
+
+ /**
+ * GETTER
+ * PERIOD AFTER VALUE
+ */
+ inline avm_delay_value_t getPeriodAfterValue() const
+ {
+ return( mPeriodAfterValue );
+ }
+
+ inline bool hasPeriodAfterValue() const
+ {
+ return( mPeriodAfterValue > 0 );
+ }
+
+ inline void setPeriodAfterValue(avm_delay_value_t value)
+ {
+ mPeriodAfterValue = value;
+ }
+
+
+ /**
+ * GETTER
+ * PERIOD BEFORE KIND
+ */
+ inline avm_unit_t getPeriodBeforeUnit() const
+ {
+ return( mPeriodBeforeUnit );
+ }
+
+ inline bool hasPeriodBeforeUnit() const
+ {
+ return( mPeriodBeforeUnit != AVM_PERIOD_UNDEFINED_KIND );
+ }
+
+ inline void setPeriodBeforeUnit(avm_unit_t unit)
+ {
+ mPeriodBeforeUnit = unit;
+ }
+
+ inline void unsetPeriodBeforeUnit()
+ {
+ mPeriodBeforeUnit = AVM_PERIOD_UNDEFINED_KIND;
+ }
+
+
+ /**
+ * GETTER
+ * PERIOD BEFORE VALUE
+ */
+ inline avm_delay_value_t getPeriodBeforeValue() const
+ {
+ return( mPeriodBeforeValue );
+ }
+
+ inline bool hasPeriodBeforeValue() const
+ {
+ return( mPeriodBeforeValue > 0 );
+ }
+
+ inline void setPeriodBeforeValue(avm_delay_value_t value)
+ {
+ mPeriodBeforeValue = value;
+ }
+
+
+ /**
+ * GETTER
+ * PERIOD BEGIN VALUE
+ */
+ inline avm_delay_value_t getTimeInitValue() const
+ {
+ return( mTimeInitValue );
+ }
+
+ inline bool hasTimeInitValue() const
+ {
+ return( mTimeInitValue > 0 );
+ }
+
+ inline void setTimeInitValue(avm_delay_value_t value)
+ {
+ mTimeInitValue = value;
+ }
+
+
+ /**
+ * GETTER
+ * PERIOD PREVIOUS VALUE
+ */
+ inline avm_delay_value_t getTimePreviousValue() const
+ {
+ return( mTimePreviousValue );
+ }
+
+ inline bool hasTimePreviousValue() const
+ {
+ return( mTimePreviousValue > 0 );
+ }
+
+ inline void setTimePreviousValue(avm_delay_value_t value)
+ {
+ mTimePreviousValue = value;
+ }
+
+
+ /**
+ * GETTER
+ * mReportDetailsFlag
+ */
+ inline bool isReportDetails() const
+ {
+ return( mReportDetailsFlag );
+ }
+
+ inline void setReportDetailsFlag(bool value)
+ {
+ mReportDetailsFlag = value;
+ }
+
+
+ /**
+ ***************************************************************************
+ * SERIALIZATION
+ ***************************************************************************
+ */
+ static std::string strPeriodKind(avm_period_kind_t kind);
+
+ virtual void toStream(OutStream & os) const;
+
+};
+
+
+} /* namespace sep */
+
+#endif /* COMMON_SERIALIZERFEATURE_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/BaseEnvironment.cpp b/org.eclipse.efm.symbex/src/computer/BaseEnvironment.cpp
new file mode 100644
index 0000000..9f3102e
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/BaseEnvironment.cpp
@@ -0,0 +1,2118 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 6 janv. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "BaseEnvironment.h"
+
+#include <collection/Bitset.h>
+
+#include <computer/ExecutionEnvironment.h>
+#include <computer/EvaluationEnvironment.h>
+#include <computer/PathConditionProcessor.h>
+
+#include <computer/primitive/AvmPrimitiveProcessor.h>
+
+#include <fml/executable/ExecutableLib.h>
+#include <fml/executable/InstanceOfData.h>
+
+#include <fml/expression/BuiltinArray.h>
+#include <fml/expression/BuiltinContainer.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/ExpressionTypeChecker.h>
+
+#include <fml/symbol/TableOfSymbol.h>
+
+#include <fml/runtime/ExecutionConfiguration.h>
+#include <fml/runtime/LocalRuntime.h>
+#include <fml/runtime/RuntimeLib.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+#include <fml/type/ClassTypeSpecifier.h>
+#include <fml/type/ContainerTypeSpecifier.h>
+#include <fml/type/TypeAliasSpecifier.h>
+
+#include <sew/Configuration.h>
+
+
+namespace sep
+{
+
+
+/**
+ * INDEX FOR NEW SYMBOLIC PARAMETER
+ */
+avm_uint32_t BaseEnvironment::NEW_PARAM_OFFSET = 0;
+
+
+/**
+ * GETTER
+ * Builder
+ * Configuration
+ * ExecutableSystem
+ */
+Builder & BaseEnvironment::getBuilder() const
+{
+ return( PRIMITIVE_PROCESSOR.getBuilder() );
+}
+
+Loader & BaseEnvironment::getLoader() const
+{
+ return( PRIMITIVE_PROCESSOR.getLoader() );
+}
+
+SymbexEngine & BaseEnvironment::getSymbexEngine() const
+{
+ return( PRIMITIVE_PROCESSOR.getSymbexEngine() );
+}
+
+Configuration & BaseEnvironment::getConfiguration() const
+{
+ return( PRIMITIVE_PROCESSOR.getConfiguration() );
+}
+
+ExecutableSystem & BaseEnvironment::getExecutableSystem() const
+{
+ return( PRIMITIVE_PROCESSOR.getConfiguration().getExecutableSystem() );
+}
+
+
+
+/**
+ * Serialization
+ */
+void BaseEnvironment::toStream(OutStream & os) const
+{
+ os << TAB << "inEC : ";
+ inEC->traceDefault(os << NEW_LTRIM_INDENT(os));
+
+ os << END_INDENT << TAB << "inED : ";
+ inED->toStream(os << NEW_LTRIM_INDENT(os));
+
+ os << END_INDENT << TAB << "inFORM : " << inFORM.str() << EOL;
+ os << TAB << "inCODE : " << inCODE.str() << EOL;
+
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// SYMBOLIC PARAMETRE CREATION
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+InstanceOfData * BaseEnvironment::create(const RuntimeID & aRID,
+ BaseTypeSpecifier * aTypeSpecifier, InstanceOfData * lvalue)
+{
+ /*
+ * préfixage de l'UFI de la constante symbolique
+ * par le nom de l'instance conteneur
+ */
+ std::ostringstream ossUfi;
+ std::ostringstream ossId;
+
+//AVM_IF_DEBUG_FLAG( LOADING )
+// ossUfi << aRID.getInstance()->getFullyQualifiedNameID()
+// << lvalue->getAstFullyQualifiedNameID().substr(
+// aRID.getExecutable()->getFullyQualifiedNameID().size());
+//_AVM_ELSE_
+ ossUfi << "pid#" << aRID.getRid() << ":" << lvalue->getNameID();
+ ossId << lvalue->getNameID();
+//AVM_ENDIF_DEBUG_FLAG( LOADING )
+
+ avm_uint32_t instNumber = lvalue->instanciationCountIncr();
+ ossUfi << "#" << instNumber;
+ ossId << "#" << instNumber;
+
+ InstanceOfData * theSymbolicParam = new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ aRID.getExecutable(), lvalue->getAstElement(),
+ aTypeSpecifier, ossUfi.str(), 0,
+ Modifier::PARAMETER_PUBLIC_FINAL_STATIC_MODIFIER );
+ theSymbolicParam->setCreatorContainerRID( aRID );
+ theSymbolicParam->setNameID( ossId.str() );
+
+ return( theSymbolicParam );
+}
+
+
+BF BaseEnvironment::evalInitial(
+ APExecutionData & anED, const RuntimeID & aRID,
+ InstanceOfData * lvalue, const BF & anInitialValue)
+{
+ if( anInitialValue.invalid() )
+ {
+ return( anInitialValue );
+ }
+
+ else if( anInitialValue.is< InstanceOfData >() )
+ {
+ if( anInitialValue.isTEQ(ExecutableLib::MACHINE_SELF) )
+ {
+ return( aRID );
+ }
+ else if( anInitialValue.isTEQ(ExecutableLib::MACHINE_PARENT) )
+ {
+ return( aRID.getPRID() );
+ }
+ }
+
+ else if( anInitialValue.is< InstanceOfMachine >() )
+ {
+ if( anInitialValue.isTEQ(ExecutableLib::MACHINE_ENVIRONMENT) )
+ {
+ return( RuntimeLib::RID_ENVIRONMENT );
+ }
+ else if( anInitialValue.isTEQ(ExecutableLib::MACHINE_NULL) )
+ {
+ return( RuntimeLib::RID_NIL );
+ }
+ }
+
+ else if( anInitialValue.is< ArrayBF >() )
+ {
+ ArrayBF * anInitialBuiltinArray = anInitialValue.to_ptr< ArrayBF >();
+
+ avm_size_t aSize = anInitialBuiltinArray->size();
+ for( avm_size_t offset = 0 ; offset < aSize ; ++offset )
+ {
+ BF & valOffset = anInitialBuiltinArray->at(offset);
+
+ valOffset = evalInitial(anED, aRID, lvalue, valOffset);
+ }
+
+ return( anInitialValue );
+ }
+
+ else if( anInitialValue.is< BuiltinArray >() )
+ {
+ return( anInitialValue );
+ }
+
+ else if( anInitialValue.is< BuiltinContainer >() )
+ {
+ BuiltinContainer * anInitialBuiltinContainer =
+ anInitialValue.to_ptr< BuiltinContainer >();
+
+ avm_size_t aSize = anInitialBuiltinContainer->size();
+ for( avm_size_t offset = 0 ; offset < aSize ; ++offset )
+ {
+ BF valOffset = anInitialBuiltinContainer->at(offset);
+
+ valOffset = evalInitial(anED, aRID, lvalue, valOffset);
+ }
+
+ return( anInitialValue );
+ }
+
+ return( anInitialValue );
+}
+
+BF BaseEnvironment::createInitial(APExecutionData & anED,
+ const RuntimeID & aRID, InstanceOfData * lvalue)
+{
+ BF theInitialValue = lvalue->getValue();
+
+ if( lvalue->getModifier().hasNatureMacro() )
+ {
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( theInitialValue )
+ << "BaseEnvironment::createInitial:> "
+ "Unexpected an instance macro << "
+ << lvalue->getFullyQualifiedNameID() << " >> without initial value !!!"
+ << SEND_EXIT;
+
+ return( theInitialValue );
+ }
+ else if( lvalue->getModifier().hasNatureReference() )
+ {
+ if( theInitialValue.is< InstanceOfData >() )
+ {
+ InstanceOfData * theInitialInstance =
+ theInitialValue.to_ptr< InstanceOfData >();
+
+ if( theInitialInstance->getModifier().hasFeatureMutable() )
+ {
+ if( ExpressionTypeChecker::weaklyTyped(lvalue->getTypeSpecifier(),
+ theInitialInstance->getTypeSpecifier()))
+ {
+ return( theInitialValue );
+ }
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BaseEnvironment::createInitial:> "
+ "Unexpected an instance << "
+ << str_header( lvalue )
+ << " >> with non mutable initial instance << "
+ << str_header( theInitialInstance ) << " >> !!!"
+ << SEND_EXIT;
+ }
+ }
+ else if( theInitialValue.valid() )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BaseEnvironment::createInitial:> "
+ "Unexpected an instance << "
+ << str_header( lvalue ) << " >> with initial value <<"
+ << str_indent( theInitialValue ) << " >> !!!"
+ << SEND_EXIT;
+ }
+ else
+ {
+ return( anED.saveParameter( create(aRID, lvalue) ) );
+ }
+ }
+
+ else if( theInitialValue.is< InstanceOfData >() )
+ {
+ InstanceOfData * theInitialInstance =
+ theInitialValue.to_ptr< InstanceOfData >();
+
+ if( theInitialInstance->getModifier().
+ hasModifierPublicFinalStaticParameter() )
+ {
+ if( ExpressionTypeChecker::weaklyTyped(lvalue->getTypeSpecifier(),
+ theInitialInstance->getTypeSpecifier()))
+ {
+ return( theInitialValue );
+ }
+ }
+ else if( theInitialInstance->hasValue() )
+ {
+ theInitialValue = theInitialInstance->getValue();
+ }
+ else if( theInitialInstance->getModifier().hasFeatureMutable() )
+ {
+ theInitialValue = getRvalue(anED, aRID, theInitialInstance);
+ if( theInitialValue.invalid() )
+ {
+ theInitialValue = createInitial(anED, aRID, theInitialInstance);
+
+ theInitialInstance->setValue(theInitialValue);
+ }
+
+ if( ExpressionTypeChecker::weaklyTyped(lvalue->getTypeSpecifier(),
+ theInitialInstance->getTypeSpecifier()))
+ {
+ return( theInitialValue );
+ }
+ }
+ }
+
+ theInitialValue = evalInitial(anED, aRID, lvalue, theInitialValue);
+
+
+ if( lvalue->hasTypeSpecifier() )
+ {
+ BaseTypeSpecifier * aTypeSpecifier = lvalue->getTypeSpecifier();
+ if( aTypeSpecifier->is< TypeAliasSpecifier >() )
+ {
+ aTypeSpecifier = aTypeSpecifier->to< TypeAliasSpecifier >()->
+ targetTypeSpecifier();
+ }
+
+ if( aTypeSpecifier->isTypedArray() )
+ {
+ ContainerTypeSpecifier * containerT =
+ aTypeSpecifier->as< ContainerTypeSpecifier >();
+ avm_size_t sizeT = containerT->size();
+
+ if( theInitialValue.valid() )
+ {
+ if( theInitialValue.is< BuiltinArray >() )
+ {
+ return( createInitial(anED, aRID, lvalue,
+ theInitialValue.to_ptr< BuiltinArray >()) );
+ }
+ else
+ {
+ return( BF( new ArrayBF(containerT, theInitialValue) ));
+ }
+ }
+ else
+ {
+ ArrayBF * arrayValue = new ArrayBF(aTypeSpecifier, sizeT);
+
+ TableOfSymbol::iterator it = lvalue->getAttribute()->begin();
+ for( avm_size_t idx = 0 ; idx < sizeT ; ++idx , ++it )
+ {
+ arrayValue->set(idx, createInitial(anED, aRID, (*it)));
+ }
+
+ return( BF(arrayValue) );
+ }
+ }
+
+ else if( aTypeSpecifier->hasTypeCollection() )
+ {
+ BuiltinContainer * containerValue = BuiltinContainer::create(
+ aTypeSpecifier->as< ContainerTypeSpecifier >() );
+
+ if( theInitialValue.valid() )
+ {
+ if( theInitialValue.is< BuiltinArray >() )
+ {
+ BuiltinArray * theInitialBuiltinArray =
+ theInitialValue.to_ptr< BuiltinArray >();
+
+ containerValue->copy( theInitialBuiltinArray,
+ std::min(containerValue->capacity(),
+ theInitialBuiltinArray->size()) );
+ }
+ else
+ {
+ containerValue->add( theInitialValue );
+ }
+ }
+
+ return( BF(containerValue) );
+ }
+
+ else if( aTypeSpecifier->isTypedClass() )
+ {
+ avm_size_t sizeT = aTypeSpecifier->size();
+
+ if( theInitialValue.valid() )
+ {
+ if( theInitialValue.is< BuiltinArray >() )
+ {
+ return( createInitial(anED, aRID, lvalue,
+ theInitialValue.to_ptr< BuiltinArray >()) );
+ }
+ else
+ {
+ return( BF( new ArrayBF(
+ aTypeSpecifier, sizeT, theInitialValue )));
+ }
+ }
+ else
+ {
+ ArrayBF * arrayValue = new ArrayBF(aTypeSpecifier, sizeT);
+
+ TableOfSymbol::iterator it = lvalue->getAttribute()->begin();
+ for( avm_size_t idx = 0 ; idx < sizeT ; ++idx , ++it )
+ {
+ arrayValue->set(idx, createInitial(anED, aRID, (*it)));
+ }
+
+ return( BF(arrayValue) );
+ }
+ }
+
+ else //if( aTypeSpecifier->isTypedSimple() )
+ {
+ if( theInitialValue.valid() )
+ {
+ return( theInitialValue );
+ }
+
+// else if( aTypeSpecifier->isTypedString() )
+// {
+// return( ExpressionConstructor::newString("") );
+// }
+ else if( aTypeSpecifier->isTypedMachine() )
+ {
+ return( RuntimeLib::RID_NIL );
+ }
+ else if( aTypeSpecifier->isTypedChannel() )
+ {
+ return( ExecutableLib::CHANNEL_NIL );
+ }
+ else if( aTypeSpecifier->isTypedPort() )
+ {
+ return( ExecutableLib::PORT_NIL );
+ }
+ else if( aTypeSpecifier->isTypedBuffer() )
+ {
+ return( ExecutableLib::BUFFER_NIL );
+ }
+ else
+ {
+ return( anED.saveParameter( create(aRID, lvalue) ) );
+ }
+ }
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BaseEnvironment::createInitial:> Unexpected an instance << "
+ << lvalue->getFullyQualifiedNameID() << " >> without typeSpecifier !!!"
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+}
+
+
+
+BF BaseEnvironment::createInitial(
+ APExecutionData & anED, const RuntimeID & aRID,
+ InstanceOfData * lvalue, BuiltinArray * initialArray)
+{
+ avm_size_t sizeT = lvalue->getTypeSpecifier()->size();
+
+ ArrayBF * bfValue = new ArrayBF(
+ ( initialArray->hasTypeSpecifier() ?
+ initialArray->getTypeSpecifier() :
+ lvalue->getTypeSpecifier() ), sizeT);
+
+ if( ExpressionTypeChecker::isFinalSymbolicCompositeSymbol(initialArray) )
+ {
+ avm_size_t idx = initialArray->size();
+
+ if( idx <= sizeT )
+ {
+ bfValue->copy(initialArray, idx);
+
+ for( ; idx < sizeT ; ++idx )
+ {
+ bfValue->set(idx, createInitial(anED, aRID,
+ lvalue->getAttribute()->at(idx)));
+ }
+ }
+ else
+ {
+ bfValue->copy(initialArray, sizeT);
+ }
+ }
+ else //if( initialArray->is< ArrayBF >() )
+ {
+ ArrayBF * bfInitialArray = initialArray->to< ArrayBF >();
+
+ avm_size_t initSizeT = bfInitialArray->size();
+
+ if( initSizeT > sizeT )
+ {
+ initSizeT = sizeT;
+ }
+
+ for( avm_size_t idx = 0 ; idx < initSizeT ; ++idx )
+ {
+ if( ExpressionTypeChecker::isFinalSymbolicSymbol(
+ bfInitialArray->at(idx)) )
+ {
+ bfValue->set(idx, bfInitialArray->at(idx));
+ }
+ else
+ {
+ bfValue->set(idx, createInitial(anED, aRID,
+ lvalue->getAttribute()->at(idx)));
+ }
+ }
+
+ for( avm_size_t idx = initSizeT ; idx < sizeT ; ++idx )
+ {
+ bfValue->set(idx, createInitial(anED, aRID,
+ lvalue->getAttribute()->at(idx)));
+ }
+ }
+
+ return( BF(bfValue) );
+}
+
+
+BF BaseEnvironment::createNewFreshParam(const RuntimeID & aRID,
+ BaseTypeSpecifier * aTypeSpecifier,
+ InstanceOfData * lvalue, BFList & paramList)
+{
+ if( aTypeSpecifier != NULL )
+ {
+ if( aTypeSpecifier->is< TypeAliasSpecifier >() )
+ {
+ aTypeSpecifier->to< TypeAliasSpecifier >()->targetTypeSpecifier();
+ }
+
+ if( aTypeSpecifier->isTypedArray() )
+ {
+ ContainerTypeSpecifier * containerT =
+ aTypeSpecifier->as< ContainerTypeSpecifier >();
+ avm_size_t sizeT = containerT->size();
+
+ ArrayBF * arrayValue = new ArrayBF(containerT, sizeT);
+
+ TableOfSymbol::iterator it = lvalue->getAttribute()->begin();
+ for( avm_size_t idx = 0 ; idx < sizeT ; ++idx , ++it )
+ {
+ arrayValue->set(idx,
+ createNewFreshParam(aRID, (*it), paramList));
+ }
+
+ return( BF(arrayValue) );
+ }
+
+ //TODO
+ else if( aTypeSpecifier->hasTypeCollection() )
+ {
+ BuiltinContainer * containerValue = BuiltinContainer::create(
+ aTypeSpecifier->as< ContainerTypeSpecifier >());
+
+ return( BF(containerValue) );
+ }
+
+ else if( aTypeSpecifier->isTypedClass() )
+ {
+ ClassTypeSpecifier * classType =
+ aTypeSpecifier->as< ClassTypeSpecifier >();
+ avm_size_t sizeT = classType->size();
+
+ ArrayBF * arrayValue = new ArrayBF(aTypeSpecifier, sizeT);
+
+ TableOfSymbol::iterator it = lvalue->getAttribute()->begin();
+ for( avm_size_t idx = 0 ; idx < sizeT ; ++idx , ++it )
+ {
+ arrayValue->set(idx,
+ createNewFreshParam(aRID, (*it), paramList));
+ }
+
+ return( BF(arrayValue) );
+ }
+
+ else //if( aTypeSpecifier->isTypedSimple() )
+ {
+// if( aTypeSpecifier->isTypedString() )
+// {
+// return( ExpressionConstructor::newString("") );
+// }
+// else
+// if( aTypeSpecifier->isTypedMachine() )
+// {
+// return( RuntimeLib::RID_NIL );
+// }
+// else
+ {
+ BF aNewFreshParam( create(aRID, aTypeSpecifier, lvalue) );
+
+ paramList.append( aNewFreshParam );
+
+ return( aNewFreshParam );
+ }
+ }
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "getInitialValue:> Unexpected an instance << "
+ << lvalue->getFullyQualifiedNameID() << " >> without typeSpecifier !!!"
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+Symbol BaseEnvironment::create(
+ const RuntimeID & aRID, const std::string & paramID,
+ const TypeSpecifier & aTypeSpecifier, const BF & aValue)
+{
+ std::ostringstream ossUfi;
+
+ ossUfi << "pid#" << aRID.getRid()
+ << ":" << paramID << "#" << ++NEW_PARAM_OFFSET;
+
+ Symbol theSymbolicParam( new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ aRID.getExecutable(), NULL, aTypeSpecifier, ossUfi.str(), 0,
+ Modifier::PARAMETER_PUBLIC_FINAL_STATIC_MODIFIER) );
+
+ theSymbolicParam.setCreatorContainerRID( aRID );
+ theSymbolicParam.setNameID( ossUfi.str() );
+ theSymbolicParam.setValue( aValue );
+
+ theSymbolicParam.setInstanciationCount(NEW_PARAM_OFFSET);
+
+ return( Symbol( theSymbolicParam ) );
+}
+
+
+
+Symbol BaseEnvironment::create4ArrayAccess(APExecutionData & apED,
+ const RuntimeID & aRID, const BF & arrayValue,
+ InstanceOfData * lvalueOfIndex)
+{
+ std::ostringstream ossUFI;
+ std::ostringstream ossID;
+
+ ossUFI << "pid#" << aRID.getRid() << ":";
+ ossUFI << lvalueOfIndex->getContainer()->
+ getData().rawAt(lvalueOfIndex->getOffset())->getAstNameID();
+ ossUFI << "#" << ++NEW_PARAM_OFFSET;
+ // lvalueOfIndex->incrInstanciationCount();
+ ossID << ossUFI.str();
+
+ Symbol newParam;
+ TableOfSymbol aRelativeDataPath;
+
+ TableOfSymbol::iterator itEnd = lvalueOfIndex->getDataPath()->end();
+ TableOfSymbol::iterator it = lvalueOfIndex->getDataPath()->begin();
+
+ switch( lvalueOfIndex->getPointerNature() )
+ {
+ case IPointerDataNature::POINTER_UFI_OFFSET_NATURE:
+ {
+ for( ; it != itEnd ; ++it )
+ {
+ ossUFI << "[" << (*it).getOffset() << "]";
+ ossID << "[" << (*it).getOffset() << "]";
+ }
+
+ newParam = new InstanceOfData(
+ lvalueOfIndex->getPointerNature(), aRID.getExecutable(),
+ lvalueOfIndex, *(lvalueOfIndex->getDataPath()) );
+
+ break;
+ }
+
+ case IPointerDataNature::POINTER_UFI_RUNTIME_NATURE:
+ {
+ // NO +1 for << this >> which is the root of the path
+ avm_size_t pathLength = lvalueOfIndex->getDataPath()->size();
+ avm_size_t * theOffsetPath = lvalueOfIndex->getOffsetPath();
+
+ for( avm_size_t k = 1 ; k < pathLength ; ++k )
+ {
+ ossUFI << "[" << theOffsetPath[k] << "]";
+ ossID << "[" << theOffsetPath[k] << "]";
+ }
+
+ newParam = new InstanceOfData(
+ lvalueOfIndex->getPointerNature(), aRID.getExecutable(),
+ lvalueOfIndex, *(lvalueOfIndex->getDataPath()) );
+
+ break;
+ }
+ case IPointerDataNature::POINTER_UFI_MIXED_NATURE:
+ {
+ Symbol symbolicIndex;
+ for( ; it != itEnd ; ++it )
+ {
+ switch( (*it).getPointerNature() )
+ {
+ case IPointerDataNature::POINTER_FIELD_CLASS_ATTRIBUTE_NATURE:
+ {
+ symbolicIndex = new InstanceOfData(
+ IPointerDataNature::
+ POINTER_FIELD_ARRAY_OFFSET_NATURE,
+ (*it).getContainer(), (*it).getAstElement(),
+ (*it).getTypeSpecifier(), (*it).getOffset() );
+
+ ossUFI << "." << symbolicIndex.str();
+ ossID << "." << symbolicIndex.str();
+
+ break;
+ }
+ case IPointerDataNature::POINTER_FIELD_ARRAY_OFFSET_NATURE:
+ {
+ symbolicIndex = new InstanceOfData(
+ IPointerDataNature::
+ POINTER_FIELD_ARRAY_OFFSET_NATURE,
+ (*it).getContainer(), (*it).getAstElement(),
+ (*it).getTypeSpecifier(), (*it).getOffset() );
+
+ ossUFI << "[" << symbolicIndex.str() << "]";
+ ossID << "[" << symbolicIndex.str() << "]";
+
+ break;
+ }
+ case IPointerDataNature::POINTER_FIELD_ARRAY_INDEX_NATURE:
+ {
+ EvaluationEnvironment eENV(*this, apED, aRID);
+ if( eENV.eval((*it).getValue()) )
+ {
+ apED = eENV.outED;
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Failed to eval ARRAY index << "
+ << (*it).strValue() << " >> in variable << "
+ << lvalueOfIndex->str()
+ << " >> for initializing a VVT !!!"
+ << SEND_EXIT;
+
+ return( Symbol::REF_NULL );
+ }
+
+ if( eENV.outVAL.isNumeric() )
+ {
+ symbolicIndex = new InstanceOfData(
+ IPointerDataNature::
+ POINTER_FIELD_ARRAY_OFFSET_NATURE,
+ (*it).getContainer(), (*it).getAstElement(),
+ (*it).getTypeSpecifier(),
+ eENV.outVAL.toInteger() );
+ }
+ else
+ {
+ symbolicIndex = new InstanceOfData(
+ IPointerDataNature::
+ POINTER_FIELD_ARRAY_INDEX_NATURE,
+ (*it).getContainer(), (*it).getAstElement(),
+ (*it).getTypeSpecifier(), 0 );
+ symbolicIndex.setValue( eENV.outVAL );
+ }
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , DATA )
+ AVM_OS_TRACE << "indexArray:> " << eENV.outVAL.toString() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , DATA )
+
+ ossUFI << "[" << eENV.outVAL.str() << "]";
+ ossID << "[" << eENV.outVAL.str() << "]";
+
+ break;
+ }
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "SymbolicParameterFactory::create4ArrayAccess:> "
+ "Unexpected POINTER NATURE "
+ "for the instance of data :>\n"
+ << (*it).toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ return( Symbol::REF_NULL );
+ }
+ }
+ aRelativeDataPath.append(symbolicIndex);
+ }
+
+ newParam = new InstanceOfData(lvalueOfIndex->getPointerNature(),
+ aRID.getExecutable(), lvalueOfIndex, aRelativeDataPath);
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "SymbolicParameterFactory::create4ArrayAccess:> "
+ "Unexpected POINTER NATURE "
+ "for the instance of index :>\n"
+ << lvalueOfIndex->toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ return( Symbol::REF_NULL );
+ }
+ }
+
+ newParam.setValue( arrayValue );
+ newParam.updateFullyQualifiedNameID( ossUFI.str() , ossID.str() );
+
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , DATA )
+ AVM_OS_TRACE << newParam.toString() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , DATA )
+
+ return( newParam );
+
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// the DATA ACCESS statement
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+/*
+ *******************************************************************************
+ * GETTER
+ * Assigned Flags
+ *******************************************************************************
+ */
+
+bool BaseEnvironment::isAssigned(const APExecutionData & apED,
+ const RuntimeID & aRID, InstanceOfData * lvalue)
+{
+ if( lvalue->hasRuntimeContainerRID() )
+ {
+ return( apED->isAssigned(
+ lvalue->getRuntimeContainerRID(), lvalue->getOffset()) );
+ }
+ else
+ {
+ RuntimeID aDataRID;
+
+ if( getRuntimeForm(apED, aRID, lvalue, aDataRID) )
+ {
+ return( apED->isAssigned(aDataRID, lvalue->getOffset()) );
+ }
+ }
+
+ return( false );
+}
+
+
+/*
+ *******************************************************************************
+ * GETTER
+ * runtime instance
+ *******************************************************************************
+ */
+bool BaseEnvironment::getRuntimeForm(
+ const APExecutionData & apED, const RuntimeID & aRID,
+ InstanceOfData * lvalue, RuntimeID & aDataRID)
+{
+ aDataRID = aRID;
+
+// if( lvalue->hasRuntimeContainerRID() )
+// {
+// aDataRID = lvalue->getRuntimeContainerRID();
+//
+// return( true );
+// }
+// else
+ if( lvalue->isAlias() )
+ {
+ if( lvalue->hasAliasTarget() &&
+ lvalue->getAliasTarget()->hasRuntimeContainerRID() )
+ {
+ lvalue->setRuntimeContainerRID( aDataRID =
+ lvalue->getAliasTarget()->getRuntimeContainerRID() );
+
+ return( true );
+ }
+
+ ArrayOfInstanceOfMachine::iterator it =
+ lvalue->getMachinePath()->begin();
+
+ // SEARCH of the RUNTIME FORM container
+ // where this INSTANCE of variable was declared
+ // SEARCH of the LCA(RID) of the current RID an the ALIAS container
+ while( aDataRID.valid()
+ && (aDataRID.getExecutable() != (*it)->getContainer()) )
+ {
+ aDataRID = aDataRID.getPRID();
+ }
+
+ if( aDataRID.valid() )
+ {
+ // Use of Alias PATH to find the INSTANCE of variable
+ ArrayOfInstanceOfMachine::iterator itEnd =
+ lvalue->getMachinePath()->end();
+ for( ; it != itEnd ; ++it )
+ {
+ aDataRID = apED->getRuntimeFormChild(aDataRID, (*it));
+ }
+
+// AVM_OS_ASSERT_FATAL_ERROR_EXIT( aDataRID.getVariable(
+// lvalue->getOffset() )->isAstElement( lvalue->getAstElement() ) )
+// << "Assign error " << aDataRID.getExecutable()
+// ->getData(lvalue->getOffset())->getFullyQualifiedNameID()
+// << " != " << lvalue->getFullyQualifiedNameID() << " !!!"
+// << SEND_EXIT;
+//
+//AVM_IF_DEBUG_FLAG( DATA )
+// AVM_OS_TRACE << INCR_INDENT_TAB << "begin BaseEnvironment::getRvalue\n";
+// lvalue->toStream(AVM_OS_TRACE);
+// apED->getRuntime(aDataRID).toStream(AVM_OS_TRACE);
+//
+// rvalue->toStream(AVM_OS_TRACE);
+// AVM_OS_TRACE << TAB_DECR_INDENT << "end BaseEnvironment::getRvalue\n";
+//AVM_ENDIF_DEBUG_FLAG( DATA )
+
+ return( true );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Access error : Unfound Runtime Data Container for << "
+ << lvalue->getFullyQualifiedNameID() << " >> !!!"
+ << SEND_EXIT;
+ }
+ }
+ else
+ {
+ ////////////////////////////////////////////////////////////////////////
+ // NORMAL IMPLEMENTATION
+ ////////////////////////////////////////////////////////////////////////
+
+ // SEARCH of the RUNTIME FORM container
+ // where this INSTANCE of variable was declared
+ while( aDataRID.valid() &&
+ (aDataRID.getExecutable() != lvalue->getContainer()) )
+ {
+ aDataRID = aDataRID.getPRID();
+ }
+
+ if( aDataRID.valid() )
+ {
+// AVM_OS_ASSERT_FATAL_ERROR_EXIT( aDataRID.getVariable(
+// lvalue->getOffset() )->isAstElement( lvalue->getAstElement() ) )
+// << "Assign error "
+// << aDataRID.getVariable(lvalue->getOffset())->getFullyQualifiedNameID()
+// << " != " << lvalue->getFullyQualifiedNameID() << " !!!"
+// << SEND_EXIT;
+//
+//AVM_IF_DEBUG_FLAG( DATA )
+// AVM_OS_TRACE << INCR_INDENT_TAB << "begin BaseEnvironment::getRvalue\n";
+// lvalue->toStream(AVM_OS_TRACE);
+// apED->getRuntime(aDataRID).toStream(AVM_OS_TRACE);
+//
+// rvalue->toStream(AVM_OS_TRACE);
+// AVM_OS_TRACE << TAB_DECR_INDENT << "end BaseEnvironment::getRvalue\n";
+//AVM_ENDIF_DEBUG_FLAG( DATA )
+
+ return( true );
+ }
+// else
+// {
+// AVM_OS_FATAL_ERROR_EXIT
+// << "Access error : Unfound Runtime Data Container for :> "
+// << aRID.str() << " |=> \n"
+// << str_header( lvalue )
+// << SEND_EXIT;
+// }
+ }
+
+ return( false );
+}
+
+
+bool BaseEnvironment::getRuntimeForm(const APExecutionData & apED,
+ InstanceOfData * lvalue, LocalRuntime & aLocalRuntime)
+{
+ if( apED->hasLocalRuntimeStack() )
+ {
+ StackOfLocalRuntime::
+ reverse_iterator it = apED->getLocalRuntimes()->rbegin();
+ StackOfLocalRuntime::
+ reverse_iterator itEnd = apED->getLocalRuntimes()->rend();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it).getProgram() == lvalue->getContainer() )
+ {
+ aLocalRuntime = (*it) ;
+
+ break;
+ }
+ }
+
+ if( aLocalRuntime.valid() )
+ {
+// AVM_OS_ASSERT_FATAL_ERROR_EXIT( aLocalRuntime.getProgram()->getData(
+// lvalue->getOffset())->isAstElement( lvalue->getAstElement() ) )
+// << "Assign error "
+// << aLocalRuntime.getProgram()->getData(lvalue->getOffset())->getFullyQualifiedNameID()
+// << " != " + lvalue->getFullyQualifiedNameID() << " !!!"
+// << SEND_EXIT;
+
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+
+/**
+ * Generate numeric offset for array access using symbolic expression
+ */
+avm_size_t BaseEnvironment::genNumericOffset(
+ APExecutionData & apED, const RuntimeID & aRID,
+ const Symbol & lvSymbolicOffset, const BF & rvEvaluatedOffset,
+ avm_size_t offsetMin, avm_size_t offsetMax)
+{
+ avm_size_t offset = AVM_NUMERIC_MAX_SIZE_T;
+
+ BF offsetExpr;
+
+ Bitset unusedOffsetBitset( offsetMax + 1 , true );
+
+ avm_size_t idx = offsetMin;
+
+ if( rvEvaluatedOffset.is< InstanceOfData >() )
+ {
+ offsetExpr = getRvalue( apED, apED->getParametersRID(),
+ rvEvaluatedOffset.to_ptr< InstanceOfData >() );
+
+ if( offsetExpr.isUInteger() &&
+ ((offset = offsetExpr.toInteger()) <= offsetMax) )
+ {
+// AVM_OS_INFO << "BaseEnvironment::genNumericOffset:> "
+// "TRY PREVIOUS NUMERIC ARRAY INDEX in [ "
+// << offsetMin << " , " << offsetMax
+// << " ]\n for the expression: "
+// << lvSymbolicOffset.strValue() << " |=> "
+// << no_indent( rvEvaluatedOffset ) << " |-> "
+// << offsetExpr.str() << "\n with constraint:> \n"
+// << apED->getPathCondition().wrapStr() << " !!!"
+// << std::endl;
+
+ if( PathConditionProcessor::addPathCondition(apED,
+ ExpressionConstructor::eqExpr(rvEvaluatedOffset, offsetExpr)) )
+ {
+ // forced to used << previous offset >>
+ idx = AVM_NUMERIC_MAX_SIZE_T;
+
+// AVM_OS_INFO << "BaseEnvironment::genNumericOffset:> "
+// "USED OLD NUMERIC ARRAY INDEX in [ "
+// << offsetMin << " , " << offsetMax
+// << " ]\n for the expression: "
+// << lvSymbolicOffset.strValue() << " |=> "
+// << no_indent( rvEvaluatedOffset ) << " |-> "
+// << offset << "\n with constraint:> \n"
+// << apED->getPathCondition().wrapStr() << " !!!"
+// << std::endl << std::endl;
+ }
+ }
+ }
+
+
+ for( ; idx <= offsetMax ; ++idx )
+ {
+ offset = RANDOM::gen_uinteger(offsetMin, offsetMax);
+
+ if( unusedOffsetBitset[ offset ] )
+ {
+ unusedOffsetBitset[ offset ] = false;
+
+ offsetExpr = ExpressionConstructor::newInteger(offset);
+
+ if( PathConditionProcessor::addPathCondition(apED,
+ ExpressionConstructor::eqExpr(rvEvaluatedOffset, offsetExpr)) )
+ {
+ // forced to used this << random offset >>
+ idx = AVM_NUMERIC_MAX_SIZE_T;
+
+ break;
+ }
+ }
+ }
+
+ if( idx != AVM_NUMERIC_MAX_SIZE_T )
+ {
+ for( offset = offsetMin ; offset <= offsetMax ; ++offset )
+ {
+ if( unusedOffsetBitset[ offset ] )
+ {
+ offsetExpr = ExpressionConstructor::newInteger(offset);
+
+ if( PathConditionProcessor::addPathCondition(
+ apED, ExpressionConstructor::eqExpr(
+ rvEvaluatedOffset, offsetExpr)) )
+ {
+// AVM_OS_INFO << "BaseEnvironment::genNumericOffset:> "
+// "Found NUMERIC<RANDOM> ARRAY INDEX in [ "
+// << offsetMin << " , " << offsetMax
+// << " ]\n for the expression: "
+// << lvSymbolicOffset.strValue() << " |=> "
+// << no_indent( rvEvaluatedOffset ) << " |-> "
+// << offset << "\n with constraint:> \n"
+// << apED->getPathCondition().wrapStr() << " !!!"
+// << std::endl;
+
+ break;
+ }
+ }
+ }
+ }
+
+ if( offset <= offsetMax )
+ {
+ if( lvSymbolicOffset.getValue().is< InstanceOfData >() )
+ {
+ InstanceOfData * lvIndex =
+ lvSymbolicOffset.getValue().to_ptr< InstanceOfData >();
+
+ if( lvIndex->getModifier().hasFeatureMutable() )
+ {
+ if( lvIndex->getModifier().hasNatureReference() )
+ {
+ lvIndex = getRvalue(apED, aRID, lvIndex).
+ to_ptr< InstanceOfData >();
+ }
+
+ if( lvIndex->getModifier().anyNatureReferenceMacro() )
+ {
+ setRvalue(apED, aRID, lvIndex, offsetExpr);
+ }
+ }
+
+ if( rvEvaluatedOffset.is< InstanceOfData >() )
+ {
+ lvIndex = rvEvaluatedOffset.to_ptr< InstanceOfData >();
+ if( not lvIndex->hasValue() )
+ {
+ setRvalue(apED, apED->getParametersRID(), lvIndex, offsetExpr);
+
+// AVM_OS_INFO << "BaseEnvironment::genNumericOffset:> "
+// "SAVE NUMERIC<RANDOM> ARRAY INDEX in [ "
+// << offsetMin << " , " << offsetMax
+// << " ]\n for the expression: "
+// << lvSymbolicOffset.strValue() << " |=> "
+// << no_indent( rvEvaluatedOffset ) << " |-> "
+// << offset << "\n with constraint:> \n"
+// << apED->getPathCondition().wrapStr() << " !!!"
+// << std::endl << std::endl;
+ }
+ }
+ }
+
+ return( offset );
+ }
+
+
+// apED.mwsetAEES( AEES_SYMBOLIC_EXECUTION_LIMITATION );
+
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BaseEnvironment::genNumericOffset:> "
+ "Unfound NUMERIC<RANDOM> ARRAY INDEX in [ " << offsetMin
+ << " , " << offsetMax << " ]\n for the expression: "
+ << lvSymbolicOffset.strValue() << " |=> "
+ << no_indent( rvEvaluatedOffset ) << "\n with constraint:> \n"
+ << apED->getPathCondition().wrapStr() << " !!!"
+ << SEND_EXIT;
+
+ return( AVM_NUMERIC_MAX_SIZE_T );
+}
+
+
+/*
+ *******************************************************************************
+ * GETTER
+ * rvalue for an lvalue
+ *******************************************************************************
+ */
+BF & BaseEnvironment::getRvalue(
+ APExecutionData & apED, const RuntimeID & aRID,
+ InstanceOfData * lvUFI, BF & rvalue, const Symbol & offsetValue)
+{
+ switch( offsetValue.getPointerNature() )
+ {
+ case IPointerDataNature::POINTER_FIELD_CLASS_ATTRIBUTE_NATURE:
+ case IPointerDataNature::POINTER_FIELD_ARRAY_OFFSET_NATURE:
+ case IPointerDataNature::POINTER_FIELD_CHOICE_ATTRIBUTE_NATURE:
+ case IPointerDataNature::POINTER_FIELD_UNION_ATTRIBUTE_NATURE:
+ {
+ return( rvalue.at( offsetValue.getOffset() ) );
+ }
+ case IPointerDataNature::POINTER_FIELD_ARRAY_INDEX_NATURE:
+ {
+ EvaluationEnvironment eENV(*this, apED, aRID);
+ if( eENV.evalOffset(offsetValue.getValue()) )
+ {
+ apED = eENV.outED;
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Failed to eval ARRAY index << "
+ << offsetValue.strValue() << " >> in UFI << "
+ << lvUFI->str() << " >> for reading in VVT !!!"
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+
+
+ if( eENV.outVAL.isNumeric() )
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_OFFSET_EXIT( eENV.outVAL.toInteger(),
+ static_cast< avm_integer_t >(rvalue.size()) )
+ << "Failed to read in VVT with index << "
+ << offsetValue.strValue() << " >> using UFI << "
+ << lvUFI->str() << " >> !!!"
+ << SEND_EXIT;
+
+ return( rvalue.at( eENV.outVAL.toInteger() ) );
+ }
+ else if( rvalue.size() > 0 )
+ {
+ avm_size_t offset = genNumericOffset( apED, aRID,
+ offsetValue, eENV.outVAL, 0, (rvalue.size() - 1) );
+
+ if( offset != AVM_NUMERIC_MAX_SIZE_T )
+ {
+ return( rvalue.at( offset ) );
+ }
+ else
+ {
+ return( BF::REF_NULL );
+ }
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BaseEnvironment::getRvalue:> "
+ "Unexpected variable << " << lvUFI->str()
+ << " >> with empty rvalue << " << rvalue.str()
+ << " >> for the instance of data :>\n"
+ << offsetValue.toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+ }
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BaseEnvironment::getRvalue:> "
+ "Unexpected POINTER NATURE in UFI << "
+ << lvUFI->str() << " >> for the instance of data :>\n"
+ << offsetValue.toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+ }
+}
+
+
+BF & BaseEnvironment::getRvalue(APExecutionData & apED,
+ const RuntimeID & aRID, InstanceOfData * lvalue)
+{
+ TableOfData * aDataTable = NULL;
+
+ if( lvalue->hasRuntimeContainerRID() )
+ {
+ aDataTable = apED->getRuntime(
+ lvalue->getRuntimeContainerRID()).getDataTable();
+ }
+ else
+ {
+ RuntimeID aDataRID;
+ if( getRuntimeForm(apED, aRID, lvalue, aDataRID) )
+ {
+ aDataTable = apED->getRuntime(aDataRID).getDataTable();
+ }
+ else
+ {
+ LocalRuntime aLocalRuntime;
+ if( getRuntimeForm(apED, lvalue, aLocalRuntime) )
+ {
+ aDataTable = &( aLocalRuntime.getDataTable() );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BaseEnvironment::getRvalue:> Failed to found "
+ "data table for the instance of data:\n\t"
+ << str_header( lvalue )
+ << "\nin the runtime context: " << str_header( aRID )
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+ }
+ }
+
+ switch( lvalue->getPointerNature() )
+ {
+ case IPointerDataNature::POINTER_STANDARD_NATURE:
+ case IPointerDataNature::POINTER_FIELD_CHOICE_ATTRIBUTE_NATURE:
+ case IPointerDataNature::POINTER_FIELD_UNION_ATTRIBUTE_NATURE:
+ {
+ return( aDataTable->at( lvalue->getOffset() ) );
+ }
+ case IPointerDataNature::POINTER_UFI_OFFSET_NATURE:
+ case IPointerDataNature::POINTER_UFI_RUNTIME_NATURE:
+ {
+ BF rvalue = aDataTable->at( lvalue->getOffset() );
+
+ // NO +1 for << this >> which is the root of the path
+ avm_size_t pathLength = lvalue->getDataPath()->size();
+ avm_size_t * theOffsetPath = lvalue->getOffsetPath();
+
+ for( avm_size_t k = 1 ; k < pathLength ; ++k )
+ {
+ if( rvalue.is< BuiltinCollection >() )
+ {
+ rvalue.moveAt( theOffsetPath[k] );
+ }
+ else
+ {
+ BF * value = new BF( create4ArrayAccess(
+ apED, aRID, rvalue, lvalue) );
+
+ return( *value );
+ }
+ }
+
+ if( rvalue.is< BuiltinCollection >() )
+ {
+ return( rvalue.at( theOffsetPath[pathLength] ) );
+ }
+ else
+ {
+ BF * value = new BF( create4ArrayAccess(
+ apED, aRID, rvalue, lvalue) );
+
+ return( *value );
+ }
+ }
+ case IPointerDataNature::POINTER_UFI_MIXED_NATURE:
+ {
+ BF rvalue = aDataTable->at( lvalue->getOffset() );
+
+ TableOfSymbol::iterator it = lvalue->getDataPath()->begin();
+ TableOfSymbol::iterator itEnd = lvalue->getDataPath()->pred_end();
+
+ bool isSymbolicAccess = false;
+
+ for( ; it != itEnd ; ++it )
+ {
+ if( rvalue.is< BuiltinCollection >() )
+ {
+ rvalue = getRvalue(apED, aRID, lvalue, rvalue, (*it));
+ }
+ else
+ {
+ isSymbolicAccess = true;
+
+ break;
+ }
+ }
+
+ if( rvalue.is< BuiltinCollection >() )
+ {
+ return( getRvalue(apED, aRID, lvalue, rvalue, (*it)) );
+ }
+ else
+ {
+ isSymbolicAccess = true;
+ }
+
+ if( isSymbolicAccess )
+ {
+ BF * value = new BF( create4ArrayAccess(apED, aRID,
+ aDataTable->at( lvalue->getOffset() ),
+ lvalue) );
+
+ return( *value );
+ }
+
+ break;
+ }
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BaseEnvironment::getRvalue:> Unexpected "
+ "POINTER NATURE for the instance of data:\n\t"
+ << str_header( lvalue )
+ << "\nin the runtime context: " << str_header( aRID )
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+/*
+ * GETTER
+ * writable rvalue for an lvalue
+ */
+BF & BaseEnvironment::getWvalue(
+ APExecutionData & apED, const RuntimeID & aRID,
+ ArrayBF * rvArray, const Symbol & lvalue)
+{
+ switch( lvalue.getPointerNature() )
+ {
+ case IPointerDataNature::POINTER_FIELD_CLASS_ATTRIBUTE_NATURE:
+ case IPointerDataNature::POINTER_FIELD_ARRAY_OFFSET_NATURE:
+ case IPointerDataNature::POINTER_FIELD_CHOICE_ATTRIBUTE_NATURE:
+ case IPointerDataNature::POINTER_FIELD_UNION_ATTRIBUTE_NATURE:
+ {
+ return( rvArray->getWritable( lvalue.getOffset() ));
+ }
+ case IPointerDataNature::POINTER_FIELD_ARRAY_INDEX_NATURE:
+ {
+ EvaluationEnvironment eENV(*this, apED, aRID);
+ if( eENV.evalOffset(lvalue.getValue()) )
+ {
+ apED = eENV.outED;
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Failed to eval ARRAY index << "
+ << lvalue.strValue() << " >> in variable << "
+ << lvalue.str() << " >> for reading in VVT !!!"
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+
+ if( eENV.outVAL.isNumeric() )
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_OFFSET_EXIT( eENV.outVAL.toInteger(),
+ static_cast< avm_integer_t >(rvArray->size()) )
+ << "Failed to access to an ARRAY with index << "
+ << lvalue.strValue() << " >> for reading in VVT !!!"
+ << SEND_EXIT;
+
+ return( rvArray->getWritable( eENV.outVAL.toInteger() ));
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BaseEnvironment::getWvalue:> "
+ "unexpected NON-INTEGER ARRAY OFFSET << "
+ << eENV.outVAL.str() << " >> in instance FQN-ID :>\n"
+ << lvalue.toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+ }
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BaseEnvironment::getWvalue:> Unexpected "
+ "POINTER NATURE for the instance of data :>\n"
+ << lvalue.toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+ }
+}
+
+
+BF & BaseEnvironment::getWvalue(
+ APExecutionData & apED, const RuntimeID & aRID,
+ BuiltinContainer * rvArray, const Symbol & lvalue)
+{
+ switch( lvalue.getPointerNature() )
+ {
+ case IPointerDataNature::POINTER_FIELD_CLASS_ATTRIBUTE_NATURE:
+ case IPointerDataNature::POINTER_FIELD_ARRAY_OFFSET_NATURE:
+ case IPointerDataNature::POINTER_FIELD_CHOICE_ATTRIBUTE_NATURE:
+ case IPointerDataNature::POINTER_FIELD_UNION_ATTRIBUTE_NATURE:
+ {
+ return( rvArray->getWritable( lvalue.getOffset() ));
+ }
+ case IPointerDataNature::POINTER_FIELD_ARRAY_INDEX_NATURE:
+ {
+ EvaluationEnvironment eENV(*this, apED, aRID);
+ if( eENV.evalOffset(lvalue.getValue()) )
+ {
+ apED = eENV.outED;
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Failed to eval ARRAY index << "
+ << lvalue.strValue() << " >> in variable << "
+ << lvalue.str() << " >> for reading in VVT !!!"
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+
+ if( eENV.outVAL.isNumeric() )
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_OFFSET_EXIT( eENV.outVAL.toInteger(),
+ static_cast< avm_integer_t >(rvArray->size()) )
+ << "Failed to access to an ARRAY with index << "
+ << lvalue.strValue() << " >> for reading in VVT !!!"
+ << SEND_EXIT;
+
+ return( rvArray->getWritable( eENV.outVAL.toInteger() ) );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BaseEnvironment::getWvalue:> "
+ "unexpected NON-INTEGER ARRAY OFFSET << "
+ << eENV.outVAL.str() << " >> in instance FQN-ID :>\n"
+ << lvalue.toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+ }
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BaseEnvironment::getWvalue:> Unexpected "
+ "POINTER NATURE for the instance of data :>\n"
+ << lvalue.toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+ }
+}
+
+
+
+BF & BaseEnvironment::getWvalue(APExecutionData & apED,
+ const RuntimeID & aRID, InstanceOfData * lvalue)
+{
+ TableOfData * aDataTable = NULL;
+
+ if( lvalue->hasRuntimeContainerRID() )
+ {
+ aDataTable = apED.getWritableRuntime(
+ lvalue->getRuntimeContainerRID() ).getWritableDataTable();
+ }
+ else
+ {
+ RuntimeID aDataRID;
+ if( getRuntimeForm(apED, aRID, lvalue, aDataRID) )
+ {
+ aDataTable = apED.getWritableRuntime(
+ aDataRID ).getWritableDataTable();
+ }
+ else
+ {
+ LocalRuntime aLocalRuntime;
+ if( getRuntimeForm(apED, lvalue, aLocalRuntime) )
+ {
+ apED.makeModifiableLocalRuntime( aLocalRuntime );
+
+ aDataTable = &( aLocalRuntime.getDataTable() );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BaseEnvironment::getWvalue:> Failed to found "
+ "data table for the instance of data :>\n"
+ << str_header( lvalue )
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+ }
+ }
+
+ switch( lvalue->getPointerNature() )
+ {
+ case IPointerDataNature::POINTER_STANDARD_NATURE:
+ case IPointerDataNature::POINTER_FIELD_CHOICE_ATTRIBUTE_NATURE:
+ case IPointerDataNature::POINTER_FIELD_UNION_ATTRIBUTE_NATURE:
+ {
+ return( aDataTable->getWritable( lvalue->getOffset() ) );
+ }
+ case IPointerDataNature::POINTER_UFI_OFFSET_NATURE:
+ case IPointerDataNature::POINTER_UFI_RUNTIME_NATURE:
+ {
+ BF rvalue = aDataTable->getWritable( lvalue->getOffset() );
+
+ // NO +1 for << this >> which is the root of the path
+ avm_size_t pathLength = lvalue->getDataPath()->size();
+ avm_size_t * theOffsetPath = lvalue->getOffsetPath();
+
+ for( avm_size_t k = 1 ; k < pathLength ; ++k )
+ {
+ if( rvalue.is< BuiltinCollection >() )
+ {
+ rvalue.moveAtWritable( theOffsetPath[k] );
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ if( rvalue.is< BuiltinCollection >() )
+ {
+ return( rvalue.getWritable( theOffsetPath[pathLength] ) );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BaseEnvironment::getWvalue:> Unexpected "
+ "rvalue container for the instance of data:\n\t"
+ << str_header( lvalue )
+ << "\nin the runtime context: " << str_header( aRID )
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+ }
+ case IPointerDataNature::POINTER_UFI_MIXED_NATURE:
+ {
+ BF rvalue = aDataTable->getWritable( lvalue->getOffset() );
+
+ TableOfSymbol::iterator it = lvalue->getDataPath()->begin();
+ TableOfSymbol::iterator itEnd = lvalue->getDataPath()->pred_end();
+
+ for( ; it != itEnd ; ++it )
+ {
+ if( rvalue.is< ArrayBF >() )
+ {
+ rvalue = getWvalue(apED, aRID,
+ rvalue.to_ptr< ArrayBF >(), (*it));
+ }
+ else if( rvalue.is< BuiltinContainer >() )
+ {
+ rvalue = getWvalue(apED, aRID,
+ rvalue.to_ptr< BuiltinContainer >(), (*it));
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ if( rvalue.is< ArrayBF >() )
+ {
+ return( getWvalue(apED,
+ aRID, rvalue.to_ptr< ArrayBF >(), (*it)) );
+ }
+ else if( rvalue.is< BuiltinContainer >() )
+ {
+ return( getWvalue(apED, aRID,
+ rvalue.to_ptr< BuiltinContainer >(), (*it)) );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BaseEnvironment::getWvalue:> Unexpected "
+ "rvalue container for the instance of data:\n\t"
+ << str_header( lvalue )
+ << "\nin the runtime context: " << str_header( aRID )
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+
+ break;
+ }
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BaseEnvironment::getWvalue:> Unexpected "
+ "POINTER NATURE for the instance of data:\n\t"
+ << str_header( lvalue )
+ << "\nin the runtime context: " << str_header( aRID )
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+/*
+ *******************************************************************************
+ * SETTER
+ * lvalue := rvalue
+ *******************************************************************************
+ */
+
+bool BaseEnvironment::setRvalue(APExecutionData & apED,
+ InstanceOfData * lvalue, const BF & rvalue)
+{
+ if( lvalue->hasRuntimeContainerRID() )
+ {
+ return( writeData(apED,
+ lvalue->getRuntimeContainerRID(), lvalue, rvalue) );
+ }
+ else
+ {
+ RuntimeID aDataRID;
+ if( getRuntimeForm(apED, apED->mRID, lvalue, aDataRID) )
+ {
+ return( writeData(apED, aDataRID, lvalue, rvalue) );
+ }
+ else
+ {
+ LocalRuntime aLocalRuntime;
+ if( getRuntimeForm(apED, lvalue, aLocalRuntime) )
+ {
+ return( setLocalRuntime(apED, aLocalRuntime, lvalue, rvalue) );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BaseEnvironment::setRvalue:> Failed to found "
+ "data table for the instance of data:\n\t"
+ << str_header( lvalue )
+ << "\nin the runtime context: "
+ << str_header( apED->mRID )
+ << SEND_EXIT;
+ }
+ }
+ }
+
+ return( false );
+}
+
+
+bool BaseEnvironment::invokeOnWriteRoutine(APExecutionData & apED,
+ const RuntimeID & aRID, InstanceOfData * lvalue, const BF & rvalue)
+{
+ if( lvalue->hasOnWriteRoutine() )
+ {
+ ExecutionEnvironment tmpENV(*this, apED, aRID, BFCode::REF_NULL);
+ if( not PRIMITIVE_PROCESSOR.invokeRoutine(
+ tmpENV, lvalue->getOnWriteRoutine(), rvalue) )
+ {
+ return( false );
+ }
+
+ if( tmpENV.outEDS.nonempty() )
+ {
+ const RuntimeID & saveRID = apED->mRID;
+
+ tmpENV.outEDS.pop_last_to( apED );
+
+ apED->mRID = saveRID;
+
+ if( tmpENV.outEDS.nonempty() )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unsupported << onWrite >> Routine which execution "
+ "create more than one Execution Context\n\t"
+ << str_header( lvalue )
+ << "\nin the runtime context: " << str_header( aRID )
+ << SEND_EXIT;
+ }
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+}
+
+
+/**
+ * setData
+ */
+bool BaseEnvironment::setData(
+ APExecutionData & apED, const RuntimeID & aRID,
+ InstanceOfData * lvalue, const BF & rvalue)
+{
+ apED.getWritableRuntime( aRID ).makeWritableDataTable();
+
+ switch( lvalue->getPointerNature() )
+ {
+ case IPointerDataNature::POINTER_STANDARD_NATURE:
+ case IPointerDataNature::POINTER_FIELD_CHOICE_ATTRIBUTE_NATURE:
+ case IPointerDataNature::POINTER_FIELD_UNION_ATTRIBUTE_NATURE:
+ {
+ apED->getRuntime(aRID).setData(lvalue->getOffset(), rvalue);
+
+ break;
+ }
+ case IPointerDataNature::POINTER_UFI_OFFSET_NATURE:
+ case IPointerDataNature::POINTER_UFI_RUNTIME_NATURE:
+ {
+ BF rvContainer = apED->getRuntime(aRID).
+ getWritableData( lvalue->getOffset() );
+
+// TableOfSymbol::iterator it = lvalue->getDataPath()->begin();
+// TableOfSymbol::iterator itEnd = lvalue->getDataPath()->pred_end();
+// for( ; it != itEnd ; ++it )
+// {
+// rvContainer.moveAtWritable( (*it)->getOffset() );
+// }
+// rvContainer->set((*it)->getOffset(), rvalue);
+
+ // NO +1 for << this >> which is the root of the path
+ avm_size_t pathLength = lvalue->getDataPath()->size();
+ avm_size_t * theOffsetPath = lvalue->getOffsetPath();
+
+ for( avm_size_t k = 1 ; k < pathLength ; ++k )
+ {
+ rvContainer.moveAtWritable( theOffsetPath[k] );
+ }
+
+ rvContainer.set(theOffsetPath[pathLength], rvalue);
+
+ break;
+ }
+ case IPointerDataNature::POINTER_UFI_MIXED_NATURE:
+ {
+ BF rvContainer = apED->getRuntime(aRID).
+ getWritableData( lvalue->getOffset() );
+
+ TableOfSymbol::iterator it = lvalue->getDataPath()->begin();
+ TableOfSymbol::iterator itEnd = lvalue->getDataPath()->pred_end();
+ for( ; it != itEnd ; ++it )
+ {
+ switch( (*it).getPointerNature() )
+ {
+ case IPointerDataNature::POINTER_FIELD_CLASS_ATTRIBUTE_NATURE:
+ case IPointerDataNature::POINTER_FIELD_ARRAY_OFFSET_NATURE:
+ {
+ rvContainer.moveAtWritable( (*it).getOffset() );
+
+ break;
+ }
+ case IPointerDataNature::POINTER_FIELD_ARRAY_INDEX_NATURE:
+ {
+ EvaluationEnvironment eENV(*this, apED);
+ if( eENV.evalOffset( (*it).getValue() ) )
+ {
+ apED = eENV.outED;
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Failed to eval ARRAY index << "
+ << (*it).strValue()
+ << " >> in variable << " << (*it).str()
+ << " >> for writing in VVT !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ if( eENV.outVAL.isNumeric() )
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_OFFSET_EXIT(
+ eENV.outVAL.toInteger(),
+ static_cast< avm_integer_t >(rvContainer.size()) )
+ << "Failed to write in ARRAY with index << "
+ << eENV.outVAL.toInteger()
+ << " >> in variable << " << lvalue->str()
+ << " >> for writing in VVT !!!"
+ << SEND_EXIT;
+
+ rvContainer.moveAtWritable( eENV.outVAL.toInteger() );
+
+ break;
+ }
+
+ else
+ {
+ avm_size_t offset = genNumericOffset(
+ apED, aRID, (*it), eENV.outVAL, 0,
+ (rvContainer.size() - 1) );
+
+ if( offset != AVM_NUMERIC_MAX_SIZE_T )
+ {
+ rvContainer.moveAtWritable( offset );
+
+ break;
+ }
+ }
+
+ apED.mwsetAEES( AEES_SYMBOLIC_EXECUTION_LIMITATION );
+
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BaseEnvironment::setData:> "
+ "unexpected NON-INTEGER ARRAY INDEX << "
+ << eENV.outVAL.str()
+ << " >> in instance FQN-ID :>\n"
+ << str_header( lvalue )
+ << SEND_EXIT;
+
+ return( false );
+ }
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BaseEnvironment::setData:> Unexpected "
+ "POINTER NATURE for the instance of data :>\n"
+ << str_header( lvalue )
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+
+ switch( (*it).getPointerNature() )
+ {
+ case IPointerDataNature::POINTER_FIELD_CLASS_ATTRIBUTE_NATURE:
+ case IPointerDataNature::POINTER_FIELD_ARRAY_OFFSET_NATURE:
+ case IPointerDataNature::POINTER_FIELD_CHOICE_ATTRIBUTE_NATURE:
+ case IPointerDataNature::POINTER_FIELD_UNION_ATTRIBUTE_NATURE:
+ {
+ rvContainer.set((*it).getOffset(), rvalue);
+
+ break;
+ }
+ case IPointerDataNature::POINTER_FIELD_ARRAY_INDEX_NATURE:
+ {
+ EvaluationEnvironment eENV(*this, apED);
+ if( eENV.evalOffset((*it).getValue()) )
+ {
+ apED = eENV.outED;
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Failed to eval ARRAY index << "
+ << (*it).strValue() << " >> in variable << "
+ << (*it).str() << " >> for writing in VVT !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ if( eENV.outVAL.isNumeric() )
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_OFFSET_EXIT(
+ eENV.outVAL.toInteger(),
+ static_cast< avm_integer_t >(rvContainer.size()) )
+ << "Failed to access to an ARRAY with index << "
+ << lvalue->strValue()
+ << " >> for writing in VVT !!!"
+ << SEND_EXIT;
+
+ rvContainer.set(eENV.outVAL.toInteger(), rvalue);
+
+ break;
+ }
+
+ else
+ {
+ avm_size_t offset = genNumericOffset(apED, aRID, (*it),
+ eENV.outVAL, 0, (rvContainer.size() - 1) );
+
+ if( offset != AVM_NUMERIC_MAX_SIZE_T )
+ {
+ rvContainer.set(offset, rvalue);
+
+ break;
+ }
+ }
+
+ // SYMBOLIC ACCES ERROR
+ apED.mwsetAEES( AEES_SYMBOLIC_EXECUTION_LIMITATION );
+
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BaseEnvironment::setData:> Unexpected "
+ "NON-INTEGER ARRAY INDEX << "
+ << eENV.outVAL.str() << " >> in instance FQN-ID :>\n"
+ << str_header( lvalue )
+ << SEND_EXIT;
+
+ return( false );
+ }
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BaseEnvironment::setData:> "
+ "Unexpected POINTER NATURE "
+ "for the instance of data :>\n"
+ << str_header( lvalue )
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+
+ break;
+ }
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BaseEnvironment::setData:> Unexpected "
+ "POINTER NATURE for the instance of data :>\n"
+ << str_header( lvalue )
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+
+ apED->mwsetAssigned(aRID, lvalue->getOffset(), true);
+
+ return( true );
+}
+
+
+/**
+ * setLocalRuntime
+ */
+bool BaseEnvironment::setLocalRuntime(
+ APExecutionData & apED, LocalRuntime & aLocalRuntime,
+ InstanceOfData * lvalue, const BF & rvalue)
+{
+ apED.makeModifiableLocalRuntime( aLocalRuntime );
+
+ // TODO what to do with monitor in this case
+
+ aLocalRuntime.setData(lvalue->getOffset(), rvalue);
+
+ return( true );
+}
+
+
+/**
+ * TOOLS
+ */
+BFCode BaseEnvironment::searchTraceIO(const BF & aTrace, AvmCode * ioFormula)
+{
+ if( aTrace.valid() )
+ {
+ BFCode ioTrace;
+
+ if( aTrace.is< AvmCode >() )
+ {
+ AvmCode::iterator it = aTrace.to_ptr< AvmCode >()->begin();
+ AvmCode::iterator itEnd = aTrace.to_ptr< AvmCode >()->end();
+ for( ; it != itEnd ; ++it )
+ {
+ ioTrace = searchTraceIO((*it), ioFormula);
+ if( ioTrace.valid() )
+ {
+ return( ioTrace );
+ }
+ }
+ }
+ else if( aTrace.is< ExecutionConfiguration >() )
+ {
+ const BF & ioAtomicTrace =
+ aTrace.to_ptr< ExecutionConfiguration >()->getCode();
+
+ if( ioAtomicTrace.is< AvmCode >() )
+ {
+ ioTrace = ioAtomicTrace.bfCode();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PORT )
+ AVM_OS_TRACE
+ << "ioTrace : " << ioTrace.str() << std::endl
+ << "ioFormula : " << ioFormula->str()<< std::endl << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PORT )
+
+ if( ioTrace->sameOperator( ioFormula ) &&
+ (ioTrace->size() >= ioFormula->size()) )
+ {
+ BaseInstanceForm * ioTraceInstance =
+ ioTrace->first().as_ptr< BaseInstanceForm >();
+
+ BaseInstanceForm * ioFormulaInstance =
+ ioFormula->first().as_ptr< BaseInstanceForm >();
+
+ if( ioTraceInstance->equals(ioFormulaInstance) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PORT )
+ AVM_OS_TRACE << "Found match : YES !!!" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PORT )
+
+ return( ioTrace );
+ }
+ }
+ else
+ {
+ return( BFCode::REF_NULL );
+ }
+ }
+ }
+ }
+
+ return( BFCode::REF_NULL );
+}
+
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/computer/BaseEnvironment.h b/org.eclipse.efm.symbex/src/computer/BaseEnvironment.h
new file mode 100644
index 0000000..82bf34a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/BaseEnvironment.h
@@ -0,0 +1,558 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 6 janv. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BASEENVIRONMENT_H_
+#define BASEENVIRONMENT_H_
+
+#include <common/AvmObject.h>
+
+#include <common/BF.h>
+
+#include <collection/Typedef.h>
+
+#include <fml/symbol/Symbol.h>
+
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeID.h>
+
+
+
+namespace sep
+{
+
+
+class ARGS_ENV;
+class AvmPrimitiveProcessor;
+
+class BuiltinArray;
+class Builder;
+class BuiltinContainer;
+
+class Configuration;
+
+class ExecutableSystem;
+
+class Loader;
+class LocalRuntime;
+
+class SymbexEngine;
+
+class TypeSpecifier;
+
+
+class BaseEnvironment :
+ public AvmObject,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( BaseEnvironment )
+{
+
+public :
+ /**
+ * ATTRIBUTES
+ */
+ ////////////////////////////////////////////////////////////////////////////
+ // INPUTs
+ ////////////////////////////////////////////////////////////////////////////
+
+ AvmPrimitiveProcessor & PRIMITIVE_PROCESSOR;
+
+ const ExecutionContext * inEC;
+
+ BF inFORM;
+
+ BFCode inCODE;
+
+ APExecutionData inED;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // ARGS ENV
+ ////////////////////////////////////////////////////////////////////////////
+
+ ARGS_ENV * mARG;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FAILED Execution Data
+ ////////////////////////////////////////////////////////////////////////////
+
+ ListOfAPExecutionData failureEDS;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BaseEnvironment(AvmPrimitiveProcessor & aPrimitiveProcessor)
+ : AvmObject( ),
+ PRIMITIVE_PROCESSOR( aPrimitiveProcessor ),
+ inEC( NULL ),
+ inFORM( ),
+ inCODE( ),
+ inED( ),
+ mARG( NULL ),
+ failureEDS( )
+ {
+ //!! NOTHING
+ }
+
+ BaseEnvironment(AvmPrimitiveProcessor & aPrimitiveProcessor,
+ const ExecutionContext * anEC)
+ : AvmObject( ),
+ PRIMITIVE_PROCESSOR( aPrimitiveProcessor ),
+ inEC( anEC ),
+ inFORM( ),
+ inCODE( ),
+ inED( anEC->getAPExecutionData() ),
+ mARG( NULL ),
+ failureEDS( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ BaseEnvironment(const BaseEnvironment & form)
+ : AvmObject( form ),
+ PRIMITIVE_PROCESSOR( form.PRIMITIVE_PROCESSOR ),
+ inEC( form.inEC ),
+ inFORM( form.inFORM ),
+ inCODE( form.inCODE ),
+ inED( form.inED ),
+ mARG( NULL ),
+ failureEDS( form.failureEDS )
+ {
+ //!! NOTHING
+ }
+
+ BaseEnvironment(const BaseEnvironment & form, const BFCode & aCode)
+ : AvmObject( form ),
+ PRIMITIVE_PROCESSOR( form.PRIMITIVE_PROCESSOR ),
+ inEC( form.inEC ),
+ inFORM( aCode ),
+ inCODE( aCode ),
+ inED( form.inED ),
+ mARG( NULL ),
+ failureEDS( )
+ {
+ //!! NOTHING
+ }
+
+ BaseEnvironment(const BaseEnvironment & form,
+ const RuntimeID & aRID, const BFCode & aCode)
+ : AvmObject( form ),
+ PRIMITIVE_PROCESSOR( form.PRIMITIVE_PROCESSOR ),
+ inEC( form.inEC ),
+ inFORM( aCode ),
+ inCODE( aCode ),
+ inED( form.inED ),
+ mARG( NULL ),
+ failureEDS( )
+ {
+ inED.mwsetRID(aRID);
+ }
+
+
+ BaseEnvironment(const BaseEnvironment & form, const APExecutionData & apED)
+ : AvmObject( form ),
+ PRIMITIVE_PROCESSOR( form.PRIMITIVE_PROCESSOR ),
+ inEC( form.inEC ),
+ inFORM( ),
+ inCODE( ),
+ inED( apED ),
+ mARG( NULL ),
+ failureEDS( )
+ {
+ //!! NOTHING
+ }
+
+ BaseEnvironment(const BaseEnvironment & form,
+ const APExecutionData & apED, const BF & bf)
+ : AvmObject( form ),
+ PRIMITIVE_PROCESSOR( form.PRIMITIVE_PROCESSOR ),
+ inEC( form.inEC ),
+ inFORM( bf ),
+ inCODE( (bf.is< AvmCode >()) ? bf.bfCode() : BFCode::REF_NULL ),
+ inED( apED ),
+ mARG( NULL ),
+ failureEDS( )
+ {
+ //!! NOTHING
+ }
+
+ BaseEnvironment(const BaseEnvironment & form,
+ const APExecutionData & apED, const BFCode & aCode)
+ : AvmObject( form ),
+ PRIMITIVE_PROCESSOR( form.PRIMITIVE_PROCESSOR ),
+ inEC( form.inEC ),
+ inFORM( aCode ),
+ inCODE( aCode ),
+ inED( apED ),
+ mARG( NULL ),
+ failureEDS( )
+ {
+ //!! NOTHING
+ }
+
+ BaseEnvironment(const BaseEnvironment & form,
+ const APExecutionData & apED, const RuntimeID & aRID)
+ : AvmObject( form ),
+ PRIMITIVE_PROCESSOR( form.PRIMITIVE_PROCESSOR ),
+ inEC( form.inEC ),
+ inFORM( form.inFORM ),
+ inCODE( form.inCODE ),
+ inED( apED ),
+ mARG( NULL ),
+ failureEDS( )
+ {
+ inED.mwsetRID(aRID);
+ }
+
+ BaseEnvironment(const BaseEnvironment & form, const APExecutionData & apED,
+ const RuntimeID & aRID, const BFCode & aCode)
+ : AvmObject( form ),
+ PRIMITIVE_PROCESSOR( form.PRIMITIVE_PROCESSOR ),
+ inEC( form.inEC ),
+ inFORM( aCode ),
+ inCODE( aCode ),
+ inED( apED ),
+ mARG( NULL ),
+ failureEDS( )
+ {
+ inED.mwsetRID(aRID);
+ }
+
+
+ BaseEnvironment(const BaseEnvironment & form, const BF & bf)
+ : AvmObject( form ),
+ PRIMITIVE_PROCESSOR( form.PRIMITIVE_PROCESSOR ),
+ inEC( form.inEC ),
+ inFORM( bf ),
+ inCODE( (bf.is< AvmCode >()) ? bf.bfCode() : BFCode::REF_NULL ),
+ inED( form.inED ),
+ mARG( NULL ),
+ failureEDS( )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BaseEnvironment()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER
+ * Builder
+ * Configuration
+ * ExecutableSystem
+ */
+ Builder & getBuilder() const;
+
+ Loader & getLoader() const;
+
+ SymbexEngine & getSymbexEngine() const;
+
+ Configuration & getConfiguration() const;
+
+ ExecutableSystem & getExecutableSystem() const;
+
+
+ /**
+ * GETTER - SETTER
+ * PROGRAM
+ */
+ inline void setCode(const BFCode & aCode)
+ {
+ inFORM = inCODE = aCode;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * INPUT ED
+ */
+ inline bool hasInputED() const
+ {
+ return( inED.valid() );
+ }
+
+ /**
+ * GETTER - SETTER
+ * OUTPUT EDS
+ */
+ virtual bool hasOutput() const = 0;
+
+ virtual bool hasntOutput() const = 0;
+
+
+ /**
+ * GETTER - SETTER
+ * FAILED EDS
+ */
+ inline void appendFailure(const APExecutionData & anED)
+ {
+ failureEDS.append(anED);
+ }
+
+ inline void spliceFailure(BaseEnvironment & ENV)
+ {
+ failureEDS.splice( ENV.failureEDS );
+ }
+
+ inline bool hasFailure() const
+ {
+ return( failureEDS.nonempty() );
+ }
+
+ inline bool isFailure() const
+ {
+ return( hasntOutput() && failureEDS.nonempty() );
+ }
+
+
+
+ /**
+ * Serialization
+ */
+ virtual void toStream(OutStream & os) const;
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ ///// SYMBOLIC PARAMETRE CREATION
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ InstanceOfData * create(const RuntimeID & aRID,
+ BaseTypeSpecifier * aTypeSpecifier, InstanceOfData * lvalue);
+
+ inline InstanceOfData * create(
+ const RuntimeID & aRID, InstanceOfData * lvalue)
+ {
+ return( create(aRID, lvalue->getTypeSpecifier(), lvalue));
+ }
+
+ BF evalInitial(APExecutionData & anED, const RuntimeID & aRID,
+ InstanceOfData * lvalue, const BF & anInitialValue);
+
+ BF createInitial(APExecutionData & anED,
+ const RuntimeID & aRID, InstanceOfData * lvalue);
+
+ inline BF createInitial(APExecutionData & anED,
+ const RuntimeID & aRID, const Symbol & lvalue)
+ {
+ return( createInitial(anED, aRID, lvalue.rawData()) );
+ }
+
+ BF createInitial(APExecutionData & anED, const RuntimeID & aRID,
+ InstanceOfData * lvalue, BuiltinArray * initialArray);
+
+
+ BF createNewFreshParam(const RuntimeID & aPRID,
+ BaseTypeSpecifier * aTypeSpecifier,
+ InstanceOfData * lvalue, BFList & paramList);
+
+ inline BF createNewFreshParam(const RuntimeID & aPRID,
+ InstanceOfData * lvalue, BFList & paramList)
+ {
+ return( createNewFreshParam(aPRID, lvalue->getTypeSpecifier(),
+ lvalue, paramList) );
+ }
+
+ inline BF createNewFreshParam(const RuntimeID & aPRID,
+ BaseTypeSpecifier * aTypeSpecifier,
+ const Symbol & lvalue, BFList & paramList)
+ {
+ return( createNewFreshParam(aPRID, aTypeSpecifier,
+ lvalue.rawData(), paramList) );
+ }
+
+ inline BF createNewFreshParam(const RuntimeID & aPRID,
+ const Symbol & lvalue, BFList & paramList)
+ {
+ return( createNewFreshParam(aPRID, lvalue.rawData(), paramList) );
+ }
+
+
+ Symbol create(const RuntimeID & aRID, const std::string & paramID,
+ const TypeSpecifier & aTypeSpecifier, const BF & aValue);
+
+
+ Symbol create4ArrayAccess(APExecutionData & anED,
+ const RuntimeID & aRID, const BF & arrayValue,
+ InstanceOfData * lvalueOfIndex);
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ ///// the DATA ACCESS statement
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ /*
+ * GETTER
+ * Assigned Flags
+ */
+ static bool isAssigned(const APExecutionData & apED,
+ const RuntimeID & aRID, InstanceOfData * lvalue);
+
+
+ /*
+ * GETTER
+ * Runtime instance
+ */
+ static bool getRuntimeForm(
+ const APExecutionData & apED, const RuntimeID & aRID,
+ InstanceOfData * lvalue, RuntimeID & aDataRID);
+
+ static bool getRuntimeForm(const APExecutionData & apED,
+ InstanceOfData * lvalue, LocalRuntime & aLocalRuntime);
+
+
+ /**
+ * Generate numeric offset for array access using symbolic expression
+ */
+ avm_size_t genNumericOffset(
+ APExecutionData & apED, const RuntimeID & aRID,
+ const Symbol & lvSymbolicOffset, const BF & rvEvaluatedOffset,
+ avm_size_t offsetMin, avm_size_t offsetMax);
+
+ /*
+ * GETTER
+ * rvalue for an lvalue
+ */
+ BF & getRvalue(APExecutionData & apED, const RuntimeID & aRID,
+ InstanceOfData * lvUFI, BF & rvalue, const Symbol & offsetValue);
+
+ BF & getRvalue(APExecutionData & apED, const RuntimeID & aRID,
+ InstanceOfData * lvalue);
+
+ inline BF & getRvalue(APExecutionData & apED, InstanceOfData * lvalue)
+ {
+ return( getRvalue(apED, apED->mRID, lvalue) );
+ }
+
+ inline BF & getRvalue(InstanceOfData * lvalue)
+ {
+ return( getRvalue(inED, inED->mRID, lvalue) );
+ }
+
+ inline BF & getRvalue(const RuntimeID & aRID, InstanceOfData * lvalue)
+ {
+ return( getRvalue(inED, aRID, lvalue) );
+ }
+
+
+ /*
+ * GETTER
+ * writable rvalue for an lvalue
+ */
+ BF & getWvalue(APExecutionData & apED, const RuntimeID & aRID,
+ ArrayBF * rvArray, const Symbol & lvalue);
+
+ BF & getWvalue(APExecutionData & apED, const RuntimeID & aRID,
+ BuiltinContainer * rvArray, const Symbol & lvalue);
+
+
+ BF & getWvalue(APExecutionData & apED,
+ const RuntimeID & aRID, InstanceOfData * lvalue);
+
+ inline BF & getWvalue(APExecutionData & apED, InstanceOfData * lvalue)
+ {
+ return( getWvalue(apED, apED->mRID, lvalue) );
+ }
+
+
+ /*
+ * SETTER
+ * lvalue := rvalue
+ */
+ inline bool setRvalue(InstanceOfData * lvalue, const BF & rvalue)
+ {
+ return( setRvalue(inED, lvalue, rvalue) );
+ }
+
+ bool setRvalue(APExecutionData & apED,
+ InstanceOfData * lvalue, const BF & rvalue);
+
+ inline bool setRvalue(
+ APExecutionData & apED, const RuntimeID & aRID,
+ InstanceOfData * lvalue, const BF & rvalue)
+ {
+ const RuntimeID prevRID = apED->mRID;
+ apED->mRID = aRID;
+
+ bool rt = setRvalue(apED, lvalue, rvalue);
+
+ apED->mRID = prevRID;
+
+ return( rt );
+ }
+
+
+ bool invokeOnWriteRoutine(
+ APExecutionData & apED, const RuntimeID & aRID,
+ InstanceOfData * lvalue, const BF & rvalue);
+
+ inline bool writeData(
+ APExecutionData & apED, const RuntimeID & aRID,
+ InstanceOfData * lvalue, const BF & rvalue)
+ {
+ if( invokeOnWriteRoutine(apED, aRID, lvalue, rvalue) )
+ {
+ return( setData(apED, aRID, lvalue, rvalue) );
+ }
+
+ return( false );
+ }
+
+
+ /**
+ * set[Local]Data
+ */
+ bool setData(APExecutionData & apED, const RuntimeID & aRID,
+ InstanceOfData * lvalue, const BF & rvalue);
+
+ bool setLocalRuntime(APExecutionData & apED, LocalRuntime & aLocalRuntime,
+ InstanceOfData * lvalue, const BF & rvalue);
+
+
+ /**
+ * TOOLS
+ */
+ BFCode searchTraceIO(const BF & aTrace, AvmCode * ioFormula);
+
+
+ /*
+ * STATIC ATTRIBUTES
+ */
+ static avm_uint32_t NEW_PARAM_OFFSET;
+
+};
+
+
+} /* namespace sep */
+#endif /* BASEENVIRONMENT_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/CMakeLists.txt b/org.eclipse.efm.symbex/src/computer/CMakeLists.txt
new file mode 100644
index 0000000..c73ba86
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/CMakeLists.txt
@@ -0,0 +1,20 @@
+# =============================================================================
+# CMake file for the COMPUTER library
+# =============================================================================
+
+
+# C++ source files to take into account (all files matching patterns, recursively)
+file (GLOB_RECURSE COMPUTER_CXX_SRC_FILES *.cpp *.h)
+
+# Target to build
+add_library (computer STATIC ${COMPUTER_CXX_SRC_FILES})
+
+# Include directories (internal)
+target_include_directories (computer PUBLIC ..) # FIXME : explicit the dependencies lib by lib
+
+ # Target include directories (external)
+target_include_directories (computer PUBLIC ${GMP_INCLUDE_DIR} ${GMPXX_INCLUDE_DIR})
+target_include_directories (computer PUBLIC ${Boost_INCLUDE_DIRS})
+target_include_directories (computer PUBLIC ${CVC4_INCLUDE_DIR})
+
+add_dependencies(computer rescan_cvc4)
diff --git a/org.eclipse.efm.symbex/src/computer/EnvironmentFactory.cpp b/org.eclipse.efm.symbex/src/computer/EnvironmentFactory.cpp
new file mode 100644
index 0000000..70725da
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/EnvironmentFactory.cpp
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 21 nov. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "EnvironmentFactory.h"
+
+#include <computer/instruction/InstructionEnvironment.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// LOADER / DISPOSER API
+////////////////////////////////////////////////////////////////////////////////
+
+void EnvironmentFactory::load()
+{
+ InstructionEnvironment::initCache();
+}
+
+void EnvironmentFactory::dispose()
+{
+ InstructionEnvironment::finalizeCache();
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/computer/EnvironmentFactory.h b/org.eclipse.efm.symbex/src/computer/EnvironmentFactory.h
new file mode 100644
index 0000000..cfd6ccc
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/EnvironmentFactory.h
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 21 nov. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef ENVIRONMENTFACTORY_H_
+#define ENVIRONMENTFACTORY_H_
+
+namespace sep
+{
+
+
+class EnvironmentFactory
+{
+
+public:
+ ////////////////////////////////////////////////////////////////////////////
+ // LOADER / DISPOSER API
+ ////////////////////////////////////////////////////////////////////////////
+ static void load();
+ static void dispose();
+
+};
+
+} /* namespace sep */
+#endif /* ENVIRONMENTFACTORY_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/EvaluationEnvironment.cpp b/org.eclipse.efm.symbex/src/computer/EvaluationEnvironment.cpp
new file mode 100644
index 0000000..fcf72de
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/EvaluationEnvironment.cpp
@@ -0,0 +1,334 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 27 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "EvaluationEnvironment.h"
+
+#include <builder/Builder.h>
+
+#include <fml/executable/InstanceOfPort.h>
+
+
+namespace sep
+{
+
+
+/**
+ * TOOLS
+ */
+BF EvaluationEnvironment::ioSubst(
+ const APExecutionData & apED, AvmProgram * aProgram,
+ AvmCode * progIO, AvmCode * traceIO, const BF & aCode)
+{
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( traceIO->sameOperator( progIO )
+ && (traceIO->size() >= progIO->size()) )
+ << " The traceIO and progIO are incompatible !!!"
+ << SEND_EXIT;
+
+AVM_IF_DEBUG_LEVEL_GT_LOW
+ AVM_OS_TRACE << INCR_INDENT_TAB << "ioSubst:: << " << aCode.str() << " >>"
+ << std::endl
+ << TAB << " In the context Of << " << traceIO->str() << " >>"
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_GT_LOW
+
+
+ bool destroyLocalRuntimeStack = false;
+
+ if( (aProgram != NULL) && aProgram->hasData() )
+ {
+ if( not apED->hasLocalRuntimeStack() )
+ {
+ destroyLocalRuntimeStack = true;
+ apED->createLocalRuntimeStack();
+ }
+
+ LocalRuntime aLocalRuntime( *aProgram );
+ apED->getLocalRuntimes()->push( aLocalRuntime );
+
+ AvmCode::iterator traceArg = traceIO->begin();
+ AvmCode::iterator itArg = progIO->begin();
+ AvmCode::iterator itEndArg = progIO->end();
+ for( ++itArg, ++traceArg ; itArg != itEndArg ; ++itArg, ++traceArg )
+ {
+ aLocalRuntime.setData(itArg->as_ptr<
+ BaseInstanceForm >()->getOffset(), (*traceArg));
+ }
+
+ eval(apED, apED->getSystemRID(), aCode);
+
+ apED->getLocalRuntimes()->pop();
+ if( destroyLocalRuntimeStack )
+ {
+ apED->destroyLocalRuntimeStack();
+ }
+ }
+ else
+ {
+ eval(apED, apED->getSystemRID(), aCode);
+ }
+
+ BF substCode = outVAL;
+
+
+AVM_IF_DEBUG_LEVEL_GT_LOW
+ AVM_OS_TRACE << TAB_DECR_INDENT << "result:: << " << substCode.str() << " >>"
+ << std::endl << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_GT_LOW
+
+ return( substCode );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// the EVAL statement for FILTER
+////////////////////////////////////////////////////////////////////////////////
+
+bool EvaluationEnvironment::eval(const APExecutionData & anED,
+ const RuntimeID & aRID, const BF & bf)
+{
+ RuntimeID prevRID = anED->mRID;
+ anED->mRID = aRID;
+
+ inEC = anED->getExecutionContext();
+
+ outED = inED = anED;
+
+ bool rt = false;
+
+ if( bf.is< AvmCode >() )
+ {
+ inFORM = inCODE = bf.bfCode();
+
+ rt = PRIMITIVE_PROCESSOR.seval(*this);
+ }
+ else
+ {
+ inFORM = bf;
+
+ rt = PRIMITIVE_PROCESSOR.decode_seval(*this);
+ }
+
+ anED->mRID = prevRID;
+
+ return( rt );
+}
+
+
+bool EvaluationEnvironment::eval(const APExecutionData & anED,
+ const RuntimeID & aRID, const BFCode & aCode)
+{
+ RuntimeID prevRID = anED->mRID;
+ anED->mRID = aRID;
+
+ inEC = anED->getExecutionContext();
+
+ outED = inED = anED;
+
+ inFORM = inCODE = aCode;
+
+ bool rt = PRIMITIVE_PROCESSOR.seval(*this);
+
+ anED->mRID = prevRID;
+
+ return( rt );
+}
+
+
+
+/**
+ * Serialization
+ */
+void EvaluationEnvironment::toStream(OutStream & os) const
+{
+ inEC->traceDefault(os);
+
+ inEC->traceDefaultPostEval(AVM_OS_TRACE);
+
+ outED->toStream(AVM_OS_TRACE);
+}
+
+
+
+/**
+ * CHECK SATISFIABILITY
+ */
+bool EvaluationEnvironment::evalFormula(const APExecutionData & anED,
+ const RuntimeID & aRID, AvmProgram * aProgram, const BF & anExpr)
+{
+ switch( anExpr.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ AvmCode * aFormula = anExpr.to_ptr< AvmCode >();
+
+ switch( aFormula->getAvmOpCode() )
+ {
+ case AVM_OPCODE_OBS :
+ {
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+// AVM_OS_TRACE << " ==> evtFormula:> "
+// << aFormula->second().str() << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+
+ const BFCode & evtFormula = aFormula->second().bfCode();
+
+ BF constraintFormula = aFormula->third();
+
+ switch( evtFormula->getAvmOpCode() )
+ {
+ case AVM_OPCODE_INPUT :
+ case AVM_OPCODE_OUTPUT :
+ {
+ if( evtFormula->first().is< BaseInstanceForm >() )
+ {
+ BaseInstanceForm * ioInstance = evtFormula->
+ first().to_ptr< BaseInstanceForm >();
+
+ if( ioInstance->is< InstanceOfPort >() )
+ {
+ BFCode ioTrace = searchTraceIO(
+ anED->getIOElementTrace(), evtFormula);
+
+ if( ioTrace.valid() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+ AVM_OS_TRACE << " ==> aFormula:> "
+ << constraintFormula.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+
+ if( constraintFormula.isEqualTrue() )
+ {
+ outVAL = constraintFormula;
+ }
+ else
+ {
+ outVAL = ioSubst( anED, aProgram,
+ evtFormula, ioTrace,
+ constraintFormula );
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+ AVM_OS_TRACE << " ==> EC<" << inEC->getIdNumber()
+ << "> |=?= anExecFormula:> " << outVAL.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+ }
+
+ return( true );
+ }
+ }
+ else if( ioInstance->is< InstanceOfData >() )
+ {
+ if( isAssigned(anED, aRID,
+ ioInstance->to< InstanceOfData >()) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+ AVM_OS_TRACE << " ==> aFormula:> "
+ << constraintFormula.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+
+ if( eval(anED, aRID, constraintFormula) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+ AVM_OS_TRACE << " ==> EC<" << inEC->getIdNumber()
+ << "> |=?= anExecFormula:> " << outVAL.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+
+ return( true );
+ }
+ }
+ }
+ }
+
+ break;
+ }
+
+ default:
+ {
+ if( eval(anED, aRID, evtFormula) )
+ {
+ if( outVAL.isEqualTrue() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+ AVM_OS_TRACE << " ==> Constraint Formula:> "
+ << constraintFormula.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+
+ if( evalCondition(constraintFormula) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+ AVM_OS_TRACE << " ==> EC<" << inEC->getIdNumber()
+ << "> |=?= anExecFormula:> " << outVAL.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+
+ return( true );
+ }
+ }
+ }
+
+ break;
+ }
+ }
+
+ break;
+ }
+
+ default:
+ {
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+// AVM_OS_TRACE << " ==> aFormula:> " << aFormula.str() << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+
+ if( eval(anED, aRID, anExpr.bfCode()) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+ AVM_OS_TRACE << " ==> EC<" << inEC->getIdNumber()
+ << "> |=?= anExecFormula:> " << outVAL.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+
+ return( true );
+ }
+
+ break;
+ }
+ }
+ break;
+ }
+
+ default:
+ {
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+// AVM_OS_TRACE << " ==> aFormula:> " << aFD->formula.str() << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+
+ if( eval(anED, aRID, anExpr) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+ AVM_OS_TRACE << " ==> EC<" << inEC->getIdNumber()
+ << "> |=?= anExecFormula:> " << outVAL.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+
+ return( true );
+ }
+
+ break;
+ }
+ }
+
+ return( false );
+}
+
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/computer/EvaluationEnvironment.h b/org.eclipse.efm.symbex/src/computer/EvaluationEnvironment.h
new file mode 100644
index 0000000..b05799a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/EvaluationEnvironment.h
@@ -0,0 +1,275 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 27 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef EVALUATIONENVIRONMENT_H_
+#define EVALUATIONENVIRONMENT_H_
+
+#include <computer/BaseEnvironment.h>
+
+#include <common/AvmPointer.h>
+
+#include <computer/primitive/AvmPrimitiveProcessor.h>
+
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/ExecutionData.h>
+
+
+namespace sep
+{
+
+
+class AvmCode;
+class AvmPrimitiveProcessor;
+class AvmProgram;
+
+class BF;
+class BuiltinForm;
+
+class RuntimeID;
+
+class UniFormIdentifier;
+
+
+class EvaluationEnvironment :
+ public BaseEnvironment ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( EvaluationEnvironment )
+{
+
+public :
+ /**
+ * ATTRIBUTES
+ */
+
+ ////////////////////////////////////////////////////////////////////////////
+ // OUTPUTs
+ ///////////////////////////////////////////////////////////////////////////
+ APExecutionData outED;
+
+ BF outVAL;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ EvaluationEnvironment(AvmPrimitiveProcessor & aPrimitiveProcessor)
+ : BaseEnvironment( aPrimitiveProcessor ),
+ outED( inED ),
+ outVAL( )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ explicit EvaluationEnvironment(const EvaluationEnvironment & form)
+ : BaseEnvironment( form ),
+ outED( form.outED ),
+ outVAL( form.outVAL )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy for eval
+ */
+ EvaluationEnvironment(BaseEnvironment & form)
+ : BaseEnvironment( form ),
+ outED( inED ),
+ outVAL( )
+ {
+ //!! NOTHING
+ }
+
+ EvaluationEnvironment(BaseEnvironment & form, const BF & bf)
+ : BaseEnvironment( form , bf ),
+ outED( inED ),
+ outVAL( )
+ {
+ //!! NOTHING
+ }
+
+ EvaluationEnvironment(BaseEnvironment & form, const APExecutionData & anED)
+ : BaseEnvironment( form , anED ),
+ outED( anED ),
+ outVAL( )
+ {
+ //!! NOTHING
+ }
+
+ EvaluationEnvironment(BaseEnvironment & form, const APExecutionData & anED,
+ const BFCode & aCode)
+ : BaseEnvironment(form , anED , aCode),
+ outED( anED ),
+ outVAL( )
+ {
+ //!! NOTHING
+ }
+
+ EvaluationEnvironment(BaseEnvironment & form, const APExecutionData & anED,
+ const RuntimeID & aRID)
+ : BaseEnvironment( form , anED , aRID ),
+ outED( anED ),
+ outVAL( )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~EvaluationEnvironment()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * OUTPUTS
+ */
+ inline virtual bool hasOutput() const
+ {
+ return( outED.valid() );
+ }
+
+ inline virtual bool hasntOutput() const
+ {
+ return( outED.invalid() && outVAL.invalid() );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ ///// the EVAL statement
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline bool eval(const BF & bf)
+ {
+ return( seval( bf ) );
+ }
+
+ inline bool evalCondition(const BF & bf)
+ {
+ return( seval( bf ) );
+ }
+
+ inline bool evalBoolean(const BF & bf)
+ {
+ return( seval( bf ) );
+ }
+
+ inline bool evalOffset(const BF & bf)
+ {
+ return( seval( bf ) );
+ }
+
+
+ // For filters
+ bool eval(const APExecutionData & anED, const RuntimeID & aRID,
+ const BF & bf);
+
+ bool eval(const APExecutionData & anED, const RuntimeID & aRID,
+ const BFCode & aCode);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// the EVAL statement
+ ////////////////////////////////////////////////////////////////////////////
+
+
+ inline bool decode_seval()
+ {
+ return( PRIMITIVE_PROCESSOR.decode_seval(*this) );
+ }
+
+ inline bool seval()
+ {
+ return( PRIMITIVE_PROCESSOR.seval(*this) );
+ }
+
+ inline bool seval(ARGS_ENV * anARG)
+ {
+ mARG = anARG;
+
+ return( PRIMITIVE_PROCESSOR.seval_wrt_ARG(*this) );
+ }
+
+ inline bool seval(const BF & bf)
+ {
+ inFORM = bf;
+
+ return( PRIMITIVE_PROCESSOR.decode_seval(*this) );
+ }
+
+ inline bool sevalChained(const BF & bf)
+ {
+ inED = outED;
+
+ inFORM = bf;
+
+ return( PRIMITIVE_PROCESSOR.decode_seval(*this) );
+ }
+
+
+ /**
+ * TOOLS
+ */
+ BF ioSubst(const APExecutionData & apED, AvmProgram * aProgram,
+ AvmCode * progIO, AvmCode * traceIO, const BF & aCode);
+
+
+ /**
+ * CHECK SATISFIABILITY
+ */
+ bool evalFormula(const APExecutionData & anED, const RuntimeID & aRID,
+ AvmProgram * aProgram, const BF & anExpr);
+
+ inline bool evalFormula(const APExecutionData & anED,
+ const RuntimeID & aRID, const BF & anExpr)
+ {
+ return( evalFormula(anED, aRID, NULL, anExpr) );
+ }
+
+ inline bool evalFormula(const ExecutionContext & anEC,
+ AvmProgram * aProgram, const BF & anExpr)
+ {
+ inEC = (& anEC);
+
+ inED = anEC.getAPExecutionData();
+
+ return( evalFormula(inED, inED->getSystemRID(), aProgram, anExpr) );
+ }
+
+
+ /**
+ * Serialization
+ */
+ virtual void toStream(OutStream & os) const;
+
+};
+
+
+}
+
+#endif /* EVALUATIONENVIRONMENT_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/ExecutionDataFactory.cpp b/org.eclipse.efm.symbex/src/computer/ExecutionDataFactory.cpp
new file mode 100644
index 0000000..7dd0cba
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/ExecutionDataFactory.cpp
@@ -0,0 +1,212 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 11 janv. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ExecutionDataFactory.h"
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/ExpressionComparer.h>
+#include <fml/expression/StatementConstructor.h>
+
+#include <fml/operator/OperatorManager.h>
+
+
+namespace sep
+{
+
+
+/*
+ * SETTER
+ * Schedule
+ * RunnableElementTrace
+ * IOElementTrace
+ */
+
+void ExecutionDataFactory::appendRunnableElementTrace(
+ APExecutionData & apED, const BF & aRunnableElementTrace)
+{
+ if( apED->hasRunnableElementTrace() )
+ {
+ apED.makeWritable();
+
+ BF & theNewRunnableElementTrace = apED->getRunnableElementTrace();
+
+//AVM_OS_DEBUG << "theNewRunnableElementTrace beg: "
+// << apED->getRunnableElementTrace().str(" ") << std::endl;
+
+ if( theNewRunnableElementTrace.is< AvmCode >() &&
+ theNewRunnableElementTrace.to_ptr<
+ AvmCode >()->isOpCode( AVM_OPCODE_SEQUENCE ) )
+ {
+ theNewRunnableElementTrace.makeWritable();
+ theNewRunnableElementTrace.to_ptr<
+ AvmCode >()->append(aRunnableElementTrace);
+ }
+ else
+ {
+ apED->setRunnableElementTrace( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_SEQUENCE,
+ theNewRunnableElementTrace, aRunnableElementTrace) );
+ }
+
+//AVM_OS_DEBUG << "theNewRunnableElementTrace end: "
+// << apED->getRunnableElementTrace().str(" ") << std::endl << std::endl;
+ }
+ else
+ {
+ apED.mwsetRunnableElementTrace( aRunnableElementTrace );
+
+//AVM_OS_DEBUG << "aRunnableElementTrace: " << aRunnableElementTrace.str(" ")
+// << std::endl << std::endl;
+ }
+}
+
+
+void ExecutionDataFactory::appendIOElementTrace(
+ APExecutionData & apED, const BF & theIOElementTrace)
+{
+ if( apED->hasIOElementTrace() )
+ {
+ apED.makeWritable();
+
+ BF & theNewIOElementTrace = apED->getIOElementTrace();
+
+ if( theNewIOElementTrace.is< AvmCode >() &&
+ theNewIOElementTrace.to_ptr< AvmCode >()->isOpCode( AVM_OPCODE_SEQUENCE ) )
+ {
+ theNewIOElementTrace.makeWritable();
+ theNewIOElementTrace.to_ptr< AvmCode >()->append(theIOElementTrace);
+ }
+ else
+ {
+ apED->setIOElementTrace( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_SEQUENCE,
+ theNewIOElementTrace, theIOElementTrace) );
+ }
+ }
+ else
+ {
+ apED.mwsetIOElementTrace( theIOElementTrace );
+ }
+}
+
+
+
+
+/**
+ * COMPARISON
+ */
+bool ExecutionDataFactory::equalsStatus(
+ const ExecutionData & oneED, const ExecutionData & otherED)
+{
+ bool isEquals = false;
+
+ if( oneED.getRuntimeFormStateTable() == otherED.getRuntimeFormStateTable() )
+ {
+ isEquals = oneED.getPathCondition().strEQ( otherED.getPathCondition() );
+
+ if( isEquals && oneED.getRuntimeFormStateTable()->hasAssigned() )
+ {
+ isEquals = equalsData(oneED, otherED);
+ }
+ }
+ else if( oneED.getRuntimeFormStateTable()->
+ equalsState(otherED.getRuntimeFormStateTable()) )
+ {
+// if( getRuntimeFormStateTable()->hasAssigned() &&
+// otherED.getRuntimeFormStateTable()->hasAssigned() )
+// {
+// isEquals = ExpressionComparer::isSEQ(getPathCondition(),
+// otherED.getPathCondition()) && equalsData(one, other);
+// }
+// else if( getRuntimeFormStateTable()->zeroAssigned() &&
+// otherED.getRuntimeFormStateTable()->zeroAssigned() )
+// {
+// isEquals = ExpressionComparer::isSEQ(
+// getPathCondition(), otherED.getPathCondition());
+// }
+
+ if( (oneED.getSaveTableOfAssignedFlag() != NULL) &&
+ otherED.getRuntimeFormStateTable()->hasAssigned() )
+ {
+ isEquals = oneED.getPathCondition().strEQ( otherED.getPathCondition() )
+ && equalsData(oneED, otherED);
+ }
+ else if( (oneED.getSaveTableOfAssignedFlag() == NULL) &&
+ otherED.getRuntimeFormStateTable()->zeroAssigned() )
+ {
+ isEquals = oneED.getPathCondition().strEQ( otherED.getPathCondition() );
+ }
+ }
+
+ return( isEquals );
+}
+
+
+bool ExecutionDataFactory::equalsData(
+ const ExecutionData & oneED, const ExecutionData & otherED)
+{
+ TableOfRuntimeFormState::TableOfAssignedFlag aTableOfAssignedFlag =
+ oneED.getSaveTableOfAssignedFlag();
+// TableOfRuntimeFormState::TableOfAssignedFlag aTableOfAssignedFlag =
+// theTableOfRuntimeFormFlags->getTableOfAssignedFlag();
+
+ TableOfRuntimeFormState::TableOfAssignedFlag otherTableOfAssignedFlag =
+ otherED.getRuntimeFormStateTable()->getTableOfAssignedFlag();
+
+ if( (aTableOfAssignedFlag != NULL) && (otherTableOfAssignedFlag != NULL) )
+ {
+ avm_size_t varCount = 0;
+ avm_size_t rfCount = oneED.getRuntimeFormStateTable()->size();
+
+ for( avm_size_t rid = 0 ; rid != rfCount ; ++rid )
+ {
+ if( (aTableOfAssignedFlag[rid] != NULL) &&
+ (otherTableOfAssignedFlag[rid] != NULL) )
+ {
+ const RuntimeForm & aRF = oneED.getRuntime(rid);
+ varCount = aRF.getExecutable()->getBasicDataSize();
+ for( avm_size_t offset = 0 ; offset < varCount ; ++offset )
+ {
+ if( (*(aTableOfAssignedFlag[rid]))[offset] !=
+ (*(otherTableOfAssignedFlag[rid]))[offset] )
+ {
+ return( false );
+ }
+ else if( (*(aTableOfAssignedFlag[rid]))[offset] )
+ {
+ if( aRF.getData(offset).strNEQ(
+ otherED.getRuntime(rid).getData(offset)) )
+ {
+ return( false );
+ }
+ }
+ }
+ }
+ else if( aTableOfAssignedFlag[rid] != otherTableOfAssignedFlag[rid] )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+ else
+ {
+ return( aTableOfAssignedFlag == otherTableOfAssignedFlag );
+ }
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/computer/ExecutionDataFactory.h b/org.eclipse.efm.symbex/src/computer/ExecutionDataFactory.h
new file mode 100644
index 0000000..ebe364d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/ExecutionDataFactory.h
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 11 janv. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef EXECUTIONDATAFACTORY_H_
+#define EXECUTIONDATAFACTORY_H_
+
+#include <common/BF.h>
+
+#include <computer/BaseEnvironment.h>
+
+#include <fml/runtime/ExecutionData.h>
+
+
+namespace sep
+{
+
+
+class ExecutionDataFactory
+{
+public:
+
+
+ /*
+ * SETTER
+ * RunnableElementTrace
+ * IOElementTrace
+ */
+ static void appendRunnableElementTrace(
+ APExecutionData & apED, const BF & aRunnableElementTrace);
+
+ static void appendIOElementTrace(
+ APExecutionData & apED, const BF & theIOElementTrace);
+
+
+ /**
+ * COMPARISON
+ */
+ static bool equalsStatus(
+ const ExecutionData & oneED, const ExecutionData & otherED);
+
+ static bool equalsData(
+ const ExecutionData & oneED, const ExecutionData & otherED);
+
+
+
+
+};
+
+
+
+} /* namespace sep */
+#endif /* EXECUTIONDATAFACTORY_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/ExecutionEnvironment.cpp b/org.eclipse.efm.symbex/src/computer/ExecutionEnvironment.cpp
new file mode 100644
index 0000000..de2344d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/ExecutionEnvironment.cpp
@@ -0,0 +1,492 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 19 févr. 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ExecutionEnvironment.h"
+
+#include <computer/EvaluationEnvironment.h>
+
+#include <computer/instruction/InstructionEnvironment.h>
+
+#include <fml/expression/BuiltinArray.h>
+#include <fml/expression/StatementConstructor.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/runtime/RuntimeForm.h>
+#include <fml/runtime/RuntimeID.h>
+
+
+#define EXEC_ENV_INITIAL_COUNT 16
+
+#define EXEC_ENV_DEFAULT_CAPACITY 16
+
+#define EXEC_ENV_INCR_CAPACITY 8
+
+
+
+namespace sep
+{
+
+
+///////////////////////////////////////////////////////////////////////////
+// CACHE MANAGER
+///////////////////////////////////////////////////////////////////////////
+
+List< ExecutionEnvironment::_EXEC_ENV_ * >
+ExecutionEnvironment::EXEC_ENV_CACHE;
+
+
+void ExecutionEnvironment::initENVS()
+{
+ for( avm_size_t i = 0 ; i < EXEC_ENV_INITIAL_COUNT ; ++i )
+ {
+ EXEC_ENV_CACHE.append( new _EXEC_ENV_() );
+ }
+}
+
+void ExecutionEnvironment::finalizeENVS()
+{
+ while( EXEC_ENV_CACHE.nonempty() )
+ {
+ delete( EXEC_ENV_CACHE.pop_last() );
+ }
+}
+
+
+
+ExecutionEnvironment::_EXEC_ENV_ * ExecutionEnvironment::newENV()
+{
+ ExecutionEnvironment::_EXEC_ENV_ * exec_env = NULL;
+
+ if( EXEC_ENV_CACHE.nonempty() )
+ {
+ EXEC_ENV_CACHE.pop_last_to( exec_env );
+ }
+ else
+ {
+ exec_env = new _EXEC_ENV_();
+
+ AVM_OS_ASSERT_OUT_OF_MEMORY_EXIT( exec_env )
+ << "BaseEnvironment::newENV !!!"
+ << SEND_EXIT;
+ }
+
+ return( exec_env );
+}
+
+
+void ExecutionEnvironment::freeENV(_EXEC_ENV_ * & exec_env)
+{
+ exec_env->PRIMITIVE_PROCESSOR = NULL;
+
+ exec_env->inEC = NULL;
+ exec_env->inFORM.destroy();
+ exec_env->inCODE.destroy();
+ exec_env->inED.destroy();
+
+ InstructionEnvironment::freeARGS( exec_env->arg );
+
+ exec_env->outEDS.clear();
+
+ exec_env->syncEDS.clear();
+ exec_env->irqEDS.clear();
+ exec_env->exitEDS.clear();
+ exec_env->failureEDS.clear();
+
+ EXEC_ENV_CACHE.append( exec_env );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// the RUN statement
+////////////////////////////////////////////////////////////////////////////////
+
+
+bool ExecutionEnvironment::run(
+ ListOfAPExecutionData & inEDS, const BFCode & aCode)
+{
+ ListOfAPExecutionData::iterator itED = inEDS.begin();
+ ListOfAPExecutionData::iterator endED = inEDS.end();
+ for( ; itED != endED ; ++itED )
+ {
+ inED = (*itED);
+ inFORM = inCODE = aCode;
+ if( not PRIMITIVE_PROCESSOR.run(inCODE->getOpOffset(), *this) )
+ {
+ return( false );
+ }
+ }
+ return( true );
+}
+
+
+bool ExecutionEnvironment::runFromOutputs(const BFCode & aCode)
+{
+ inFORM = inCODE = aCode;
+
+ if( outEDS.singleton() )
+ {
+ outEDS.pop_first_to( inED );
+
+ return( PRIMITIVE_PROCESSOR.run(inCODE->getOpOffset(), *this) );
+ }
+ else
+ {
+ ListOfAPExecutionData inEDS;
+ inEDS.splice( outEDS );
+
+ ListOfAPExecutionData::iterator itED = inEDS.begin();
+ ListOfAPExecutionData::iterator endED = inEDS.end();
+ for( ; itED != endED ; ++itED )
+ {
+ inED = (*itED);
+ inFORM = inCODE = aCode;
+ if( not PRIMITIVE_PROCESSOR.run(inCODE->getOpOffset(), *this) )
+ {
+ return( false );
+ }
+ }
+ return( true );
+ }
+}
+
+
+bool ExecutionEnvironment::runFromOutputs(Operator * op, const BFCode & aCode)
+{
+ inFORM = inCODE = aCode;
+
+ if( outEDS.singleton() )
+ {
+ outEDS.pop_first_to( inED );
+
+ return( PRIMITIVE_PROCESSOR.run(op->getOffset(), *this) );
+ }
+ else
+ {
+ ListOfAPExecutionData inEDS;
+ inEDS.splice( outEDS );
+
+ ListOfAPExecutionData::iterator itED = inEDS.begin();
+ ListOfAPExecutionData::iterator endED = inEDS.end();
+ for( ; itED != endED ; ++itED )
+ {
+ inED = (*itED);
+ inFORM = inCODE = aCode;
+ if( not PRIMITIVE_PROCESSOR.run(inCODE->getOpOffset(), *this) )
+ {
+ return( false );
+ }
+ }
+ return( true );
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// the RESUME statement
+////////////////////////////////////////////////////////////////////////////////
+
+bool ExecutionEnvironment::resume(
+ ExecutionEnvironment & ENV, APExecutionData & anED)
+{
+ inEC = ENV.inEC;
+
+ inED = anED;
+
+ inED.makeWritable();
+
+ inED->mSTATEMENT_QUEUE.popTo( saveEXEC_LOCATION );
+ inEXEC_LOCATION = saveEXEC_LOCATION.to_ptr< ExecutionLocation >();
+
+ inED->mRID = inEXEC_LOCATION->mRID;
+
+ inFORM = inCODE = inEXEC_LOCATION->mCODE;
+
+ return PRIMITIVE_PROCESSOR.resume(*this);
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// the OUTPUT management
+////////////////////////////////////////////////////////////////////////////////
+
+void ExecutionEnvironment::appendOutput(EvaluationEnvironment & ENV)
+{
+ outEDS.append( ENV.outED );
+
+ spliceFailure( ENV );
+}
+
+bool ExecutionEnvironment::extractOtherOutputED(
+ const APExecutionData & anED, ListOfAPExecutionData & listEDS)
+{
+ avm_uint8_t flags = 0;
+
+ while( outEDS.nonempty() )
+ {
+ if( outEDS.first()->isTNEQ( anED ) )
+ {
+ flags = flags | 0x01;
+ listEDS.append( outEDS.pop_first() );
+ }
+ else
+ {
+ flags = flags | 0x02;
+ outEDS.pop_first();
+ }
+ }
+
+ return( flags == 0x02 );
+}
+
+/**
+ * appendOutput
+ * w.r.t. AVM_EXEC_ENDING_STATUS
+ */
+void ExecutionEnvironment::appendOutput_wrtAEES(APExecutionData & anED)
+{
+ // Verification of EXECUTION ENDING STATUS
+ switch( anED->getAEES() )
+ {
+ case AEES_STMNT_NOTHING:
+ case AEES_STMNT_BREAK:
+ case AEES_STMNT_CONTINUE:
+ case AEES_STMNT_RETURN:
+ {
+ anED.mwsetAEES(AEES_OK);
+
+ outEDS.append( anED );
+
+ break;
+ }
+
+ case AEES_OK:
+ case AEES_STEP_RESUME:
+ case AEES_STEP_MARK:
+ {
+ outEDS.append( anED );
+
+ break;
+ }
+
+ case AEES_STMNT_EXIT:
+ case AEES_STMNT_EXIT_ALL:
+ case AEES_STMNT_FATAL_ERROR:
+ case AEES_SYMBOLIC_EXECUTION_LIMITATION:
+ {
+ exitEDS.append( anED );
+
+ break;
+ }
+
+ case AEES_FAILED:
+ {
+ failureEDS.append( anED );
+
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS :> "
+ << RuntimeDef::strAEES( anED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS :> "
+ << RuntimeDef::strAEES( anED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+}
+
+
+/**
+ * appendOutput
+ * mwset PROCESS_EVAL_STATE
+ * mwset AVM_EXEC_ENDING_STATUS
+ */
+
+bool ExecutionEnvironment::mwsetPES_mwsetAEES(
+ APExecutionData & anED, const RuntimeID & aRID,
+ PROCESS_EVAL_STATE aPES)
+{
+ anED.mwsetRuntimeFormState(aRID, aPES);
+
+ anED->setAEES( RuntimeDef::PES_to_AEES(aPES, anED->getAEES()) );
+
+ return( true );
+}
+
+bool ExecutionEnvironment::appendOutput_mwsetPES_mwsetAEES(
+ APExecutionData & anED, const RuntimeID & aRID,
+ PROCESS_EVAL_STATE aPES)
+{
+ if( mwsetPES_mwsetAEES(anED, aRID, aPES) )
+ {
+ outEDS.append( anED );
+
+ return( true );
+ }
+
+ return( false );
+}
+
+bool ExecutionEnvironment::appendOutput_mwsetPES_mwsetAEES(
+ ExecutionEnvironment & ENV, const RuntimeID & aRID,
+ PROCESS_EVAL_STATE aPES)
+{
+ ListOfAPExecutionData::iterator itED = ENV.outEDS.begin();
+ ListOfAPExecutionData::iterator endED = ENV.outEDS.end();
+ for( ; itED != endED ; ++itED )
+ {
+ appendOutput_mwsetPES_mwsetAEES((*itED), aRID, aPES);
+ }
+
+ return( true );
+}
+
+
+
+bool ExecutionEnvironment::appendOutput_mwsetPES_mwsetAEES(
+ APExecutionData & anED, const RuntimeID & aRID,
+ PROCESS_EVAL_STATE oldPES, PROCESS_EVAL_STATE aPES)
+{
+ if( anED->getRuntimeFormState(aRID) == oldPES )
+ {
+ anED.mwsetRuntimeFormState(aRID, aPES);
+
+ anED->setAEES( RuntimeDef::PES_to_AEES(aPES, anED->getAEES()) );
+ }
+
+ outEDS.append( anED );
+
+ return( true );
+}
+
+bool ExecutionEnvironment::appendOutput_mwsetPES_mwsetAEES(
+ ExecutionEnvironment & ENV, const RuntimeID & aRID,
+ PROCESS_EVAL_STATE oldPES, PROCESS_EVAL_STATE aPES)
+{
+ ListOfAPExecutionData::iterator itED = ENV.outEDS.begin();
+ ListOfAPExecutionData::iterator endED = ENV.outEDS.end();
+ for( ; itED != endED ; ++itED )
+ {
+ appendOutput_mwsetPES_mwsetAEES( (*itED), aRID, oldPES, aPES );
+ }
+
+ return( true );
+}
+
+
+
+bool ExecutionEnvironment::appendOutput_mwsetPES_mwsetAEES_mwsetRID(
+ APExecutionData & anED,
+ const RuntimeID & currentRID, const RuntimeID & nextRID,
+ PROCESS_EVAL_STATE oldPES, PROCESS_EVAL_STATE aPES)
+{
+ if( anED->getRuntimeFormState(currentRID) == oldPES )
+ {
+ anED.mwsetRuntimeFormState(currentRID, aPES);
+
+ anED->setAEES( RuntimeDef::PES_to_AEES(aPES, anED->getAEES()) );
+ }
+
+ anED->mRID = nextRID;
+
+ outEDS.append( anED );
+
+ return( true );
+}
+
+bool ExecutionEnvironment::appendOutput_mwsetPES_mwsetAEES_mwsetRID(
+ ExecutionEnvironment & ENV,
+ const RuntimeID & currentRID, const RuntimeID & nextRID,
+ PROCESS_EVAL_STATE oldPES, PROCESS_EVAL_STATE aPES)
+{
+ ListOfAPExecutionData::iterator itED = ENV.outEDS.begin();
+ ListOfAPExecutionData::iterator endED = ENV.outEDS.end();
+ for( ; itED != endED ; ++itED )
+ {
+ appendOutput_mwsetPES_mwsetAEES_mwsetRID(
+ (*itED), currentRID, nextRID, oldPES, aPES );
+ }
+
+ return( true );
+}
+
+
+
+
+/**
+ * Serialization
+ */
+void ExecutionEnvironment::toStream(OutStream & os) const
+{
+ os << TAB << "environment {" << EOL;
+
+ inEC->traceDefault(os);
+
+ //inEC->writeTraceAfterExec(os, TAB2, CHAR, EOL);
+
+ os << TAB << "outEDS:> count : " << outEDS.size() << std::endl;
+ ListOfAPExecutionData::const_iterator itED = outEDS.begin();
+ ListOfAPExecutionData::const_iterator endED = outEDS.end();
+ for( ; itED != endED ; ++itED )
+ {
+ os << TAB2 << "==>E[?] " << (*itED)->strStateConf()
+ << " " << (*itED)->getRunnableElementTrace().str() << EOL;
+ }
+ os << std::flush;
+
+ os << TAB << "syncEDS:> count : " << syncEDS.size() << std::endl;
+ itED = syncEDS.begin();
+ endED = syncEDS.end();
+ for( ; itED != endED ; ++itED )
+ {
+ os << TAB2 << "==>E[?] " << (*itED)->strStateConf()
+ << " " << (*itED)->getRunnableElementTrace().str() << EOL;
+ }
+ os << std::flush;
+
+ os << TAB << "irqEDS:> count : " << irqEDS.size() << std::endl;
+ itED = irqEDS.begin();
+ endED = irqEDS.end();
+ for( ; itED != endED ; ++itED )
+ {
+ os << TAB2 << "==>E[?] " << (*itED)->strStateConf()
+ << " " << (*itED)->getRunnableElementTrace().str() << EOL;
+ }
+ os << std::flush;
+
+ os << TAB << "failEDS:> count : " << failureEDS.size() << std::endl;
+ itED = failureEDS.begin();
+ endED = failureEDS.end();
+ for( ; itED != endED ; ++itED )
+ {
+ os << TAB2 << "==>E[?] " << (*itED)->strStateConf()
+ << " " << (*itED)->getRunnableElementTrace().str() << EOL;
+ }
+
+ os << TAB << "}" << EOL_FLUSH;
+
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/computer/ExecutionEnvironment.h b/org.eclipse.efm.symbex/src/computer/ExecutionEnvironment.h
new file mode 100644
index 0000000..6a1ba84
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/ExecutionEnvironment.h
@@ -0,0 +1,760 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 19 févr. 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef EXECUTIONENVIRONMENT_H_
+#define EXECUTIONENVIRONMENT_H_
+
+#include <computer/BaseEnvironment.h>
+
+#include <common/AvmPointer.h>
+
+#include <computer/primitive/AvmPrimitiveProcessor.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/operator/Operator.h>
+
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/ExecutionLocation.h>
+#include <fml/runtime/RuntimeDef.h>
+
+
+namespace sep
+{
+
+class EvaluationEnvironment;
+class AvmPrimitiveProcessor;
+
+class RuntimeID;
+
+
+class ExecutionEnvironment :
+ public BaseEnvironment ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ExecutionEnvironment )
+{
+
+public :
+ /**
+ * ATTRIBUTES
+ */
+ ////////////////////////////////////////////////////////////////////////////
+ // INPUTs
+ ////////////////////////////////////////////////////////////////////////////
+ BF saveEXEC_LOCATION;
+ ExecutionLocation * inEXEC_LOCATION;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // OUTPUTs
+ ////////////////////////////////////////////////////////////////////////////
+ ListOfAPExecutionData outEDS;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SYNC Execution Data
+ ////////////////////////////////////////////////////////////////////////////
+ ListOfAPExecutionData syncEDS;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // INTERRUPT REQUEST Execution Data
+ ////////////////////////////////////////////////////////////////////////////
+ ListOfAPExecutionData irqEDS;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // INTERRUPT REQUEST Execution Data
+ ////////////////////////////////////////////////////////////////////////////
+ ListOfAPExecutionData exitEDS;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ExecutionEnvironment(AvmPrimitiveProcessor & aPrimitiveProcessor)
+ : BaseEnvironment( aPrimitiveProcessor ),
+ saveEXEC_LOCATION( ),
+ inEXEC_LOCATION( NULL ),
+ outEDS( ),
+ syncEDS( ),
+ irqEDS( ),
+ exitEDS( )
+ {
+ //!! NOTHING
+ }
+
+ ExecutionEnvironment(AvmPrimitiveProcessor & aPrimitiveProcessor,
+ const ExecutionContext * aParentEC)
+ : BaseEnvironment( aPrimitiveProcessor , aParentEC ),
+ saveEXEC_LOCATION( ),
+ inEXEC_LOCATION( NULL ),
+ outEDS( ),
+ syncEDS( ),
+ irqEDS( ),
+ exitEDS( )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ explicit ExecutionEnvironment(const ExecutionEnvironment & form)
+ : BaseEnvironment( form ),
+ saveEXEC_LOCATION( form.saveEXEC_LOCATION ),
+ inEXEC_LOCATION( form.inEXEC_LOCATION ),
+ outEDS( form.outEDS ),
+ syncEDS( form.syncEDS ),
+ irqEDS( form.irqEDS ),
+ exitEDS( form.exitEDS )
+ {
+ //!! NOTHING
+ }
+
+
+ ExecutionEnvironment(const BaseEnvironment & form, const BF & bf)
+ : BaseEnvironment( form , bf ),
+ saveEXEC_LOCATION( ),
+ inEXEC_LOCATION( NULL ),
+ outEDS( ),
+ syncEDS( ),
+ irqEDS( ),
+ exitEDS( )
+ {
+ //!! NOTHING
+ }
+
+ ExecutionEnvironment(const BaseEnvironment & form, const BFCode & aCode)
+ : BaseEnvironment( form , aCode ),
+ saveEXEC_LOCATION( ),
+ inEXEC_LOCATION( NULL ),
+ outEDS( ),
+ syncEDS( ),
+ irqEDS( ),
+ exitEDS( )
+ {
+ //!! NOTHING
+ }
+
+ ExecutionEnvironment(const BaseEnvironment & form,
+ const RuntimeID & aRID, const BFCode & aCode)
+ : BaseEnvironment( form , aRID , aCode ),
+ saveEXEC_LOCATION( ),
+ inEXEC_LOCATION( NULL ),
+ outEDS( ),
+ syncEDS( ),
+ irqEDS( ),
+ exitEDS( )
+ {
+ //!! NOTHING
+ }
+
+
+ ExecutionEnvironment(const BaseEnvironment & form,
+ const APExecutionData & anED)
+ : BaseEnvironment( form , anED ),
+ saveEXEC_LOCATION( ),
+ inEXEC_LOCATION( NULL ),
+ outEDS( ),
+ syncEDS( ),
+ irqEDS( ),
+ exitEDS( )
+ {
+ //!! NOTHING
+ }
+
+
+ ExecutionEnvironment(const BaseEnvironment & form,
+ const APExecutionData & anED, const BF & bf)
+ : BaseEnvironment( form , anED , bf ),
+ saveEXEC_LOCATION( ),
+ inEXEC_LOCATION( NULL ),
+ outEDS( ),
+ syncEDS( ),
+ irqEDS( ),
+ exitEDS( )
+ {
+ //!! NOTHING
+ }
+
+ ExecutionEnvironment(const BaseEnvironment & form,
+ const APExecutionData & anED, const BFCode & aCode)
+ : BaseEnvironment( form , anED , aCode ),
+ saveEXEC_LOCATION( ),
+ inEXEC_LOCATION( NULL ),
+ outEDS( ),
+ syncEDS( ),
+ irqEDS( ),
+ exitEDS( )
+ {
+ //!! NOTHING
+ }
+
+
+ ExecutionEnvironment(const BaseEnvironment & form,
+ const APExecutionData & anED, const RuntimeID & aRID,
+ const BFCode & aCode)
+ : BaseEnvironment( form , anED , aRID , aCode ),
+ saveEXEC_LOCATION( ),
+ inEXEC_LOCATION( NULL ),
+ outEDS( ),
+ syncEDS( ),
+ irqEDS( ),
+ exitEDS( )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ExecutionEnvironment()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTROY OUTPUTS
+ */
+ inline void destroyOutED()
+ {
+ outEDS.clear();
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// the OUTPUT management
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline void appendOutput(const APExecutionData & anED)
+ {
+ outEDS.append(anED);
+ }
+
+ void appendOutput(EvaluationEnvironment & ENV);
+
+
+ inline virtual bool hasOutput() const
+ {
+ return( outEDS.nonempty() );
+ }
+
+ inline virtual bool hasntOutput() const
+ {
+ return( outEDS.empty() );
+ }
+
+ bool extractOtherOutputED(const APExecutionData & anED,
+ ListOfAPExecutionData & listEDS);
+
+
+ /**
+ * appendOutput
+ * w.r.t. AVM_EXEC_ENDING_STATUS
+ */
+ void appendOutput_wrtAEES(APExecutionData & anED);
+
+
+ /**
+ * appendOutput
+ * mwset PROCESS_EVAL_STATE
+ */
+ inline bool appendOutput_mwsetPES(APExecutionData & anED,
+ const RuntimeID & aRID, PROCESS_EVAL_STATE aPES)
+ {
+ anED.mwsetRuntimeFormState(aRID, aPES);
+
+ outEDS.append( anED );
+
+ return( true );
+ }
+
+
+ /**
+ * appendOutput
+ * mwset PROCESS_EVAL_STATE
+ * mwset AVM_EXEC_ENDING_STATUS
+ */
+ bool mwsetPES_mwsetAEES(APExecutionData & anED,
+ const RuntimeID & aRID, PROCESS_EVAL_STATE aPES);
+
+ bool appendOutput_mwsetPES_mwsetAEES(APExecutionData & anED,
+ const RuntimeID & aRID, PROCESS_EVAL_STATE aPES);
+
+ bool appendOutput_mwsetPES_mwsetAEES(ExecutionEnvironment & ENV,
+ const RuntimeID & aRID, PROCESS_EVAL_STATE aPES);
+
+
+ bool appendOutput_mwsetPES_mwsetAEES(APExecutionData & anED,
+ const RuntimeID & aRID,
+ PROCESS_EVAL_STATE oldPES, PROCESS_EVAL_STATE aPES);
+
+ bool appendOutput_mwsetPES_mwsetAEES(ExecutionEnvironment & ENV,
+ const RuntimeID & aRID,
+ PROCESS_EVAL_STATE oldPES, PROCESS_EVAL_STATE aPES);
+
+
+ bool appendOutput_mwsetPES_mwsetAEES_mwsetRID(APExecutionData & anED,
+ const RuntimeID & currentRID, const RuntimeID & nextRID,
+ PROCESS_EVAL_STATE oldPES, PROCESS_EVAL_STATE aPES);
+
+ bool appendOutput_mwsetPES_mwsetAEES_mwsetRID(ExecutionEnvironment & ENV,
+ const RuntimeID & currentRID, const RuntimeID & nextRID,
+ PROCESS_EVAL_STATE oldPES, PROCESS_EVAL_STATE aPES);
+
+ /**
+ * splice
+ * OUTPUT ExecutionData
+ */
+
+ inline void spliceOutput(ExecutionEnvironment & ENV)
+ {
+ outEDS.splice( ENV.outEDS );
+
+ spliceNotOutput( ENV );
+ }
+
+ inline void spliceNotOutput(ExecutionEnvironment & ENV)
+ {
+ spliceExit( ENV );
+ spliceIrq( ENV );
+ spliceFailure( ENV );
+ spliceSync( ENV );
+ }
+
+ inline void spliceNotOutputExit(ExecutionEnvironment & ENV)
+ {
+ spliceIrq( ENV );
+ spliceFailure( ENV );
+ spliceSync( ENV );
+ }
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// the SYNC management
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * GETTER - SETTER
+ * SYNC EDS
+ */
+ inline void appendSync(const APExecutionData & anED)
+ {
+ syncEDS.append(anED);
+ }
+
+ inline void spliceSync(ExecutionEnvironment & ENV)
+ {
+ syncEDS.splice( ENV.syncEDS );
+ }
+
+ inline bool hasSync() const
+ {
+ return( syncEDS.nonempty() );
+ }
+
+ inline bool isSync() const
+ {
+ return( hasntOutput() && syncEDS.nonempty() );
+ }
+
+
+ /**
+ * appendOutput
+ * mwset PROCESS_EVAL_STATE
+ */
+ inline bool appendSync_mwsetAEES(APExecutionData & anED,
+ AVM_EXEC_ENDING_STATUS anAEES)
+ {
+ anED.mwsetAEES(anAEES);
+
+ syncEDS.append( anED );
+
+ return( true );
+ }
+
+
+ /**
+ * append SYNC
+ * w.r.t. AVM_EXEC_ENDING_STATUS
+ *
+ * case AEES_STEP_MARK:
+ * case AEES_WAITING_INCOM_RDV:
+ * case AEES_WAITING_OUTCOM_RDV:
+ * case AEES_WAITING_JOIN_FORK:
+ *
+ * store statement position
+ */
+ inline bool appendSync_mwStorePos(APExecutionData anED)
+ {
+ anED.makeWritable();
+ anED->mSTATEMENT_QUEUE.push(anED->mRID, inCODE);
+
+ syncEDS.append( anED );
+
+ return( true );
+ }
+
+ inline bool appendSync_mwStorePos(APExecutionData anED,
+ const AvmCode::const_iterator & it,
+ const AvmCode::const_iterator & endIt)
+ {
+ anED.makeWritable();
+ anED->mSTATEMENT_QUEUE.push(anED->mRID, inCODE, it, endIt);
+
+ syncEDS.append( anED );
+
+ return( true );
+ }
+
+
+ /**
+ * splice SYNC
+ * w.r.t. AVM_EXEC_ENDING_STATUS
+ *
+ * case AEES_STEP_MARK:
+ * case AEES_WAITING_INCOM_RDV:
+ * case AEES_WAITING_OUTCOM_RDV:
+ * case AEES_WAITING_JOIN_FORK:
+ *
+ * store statement position
+ */
+ inline void spliceSync_mwStorePos(ExecutionEnvironment & ENV)
+ {
+ while( ENV.syncEDS.nonempty() )
+ {
+ appendSync_mwStorePos( ENV.syncEDS.pop_first() );
+ }
+ }
+
+ inline void spliceSync_mwStorePos(ExecutionEnvironment & ENV,
+ const AvmCode::const_iterator & it,
+ const AvmCode::const_iterator & endIt)
+ {
+ while( ENV.syncEDS.nonempty() )
+ {
+ appendSync_mwStorePos(ENV.syncEDS.pop_first(), it, endIt);
+ }
+ }
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// the IRQ management
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * GETTER - SETTER
+ * INTERRUPT REQUEST EDS
+ */
+ inline void appendIrq(const APExecutionData & anED)
+ {
+ irqEDS.append(anED);
+ }
+
+ inline void spliceIrq(ExecutionEnvironment & ENV)
+ {
+ irqEDS.splice( ENV.irqEDS );
+ }
+
+ inline bool hasIrq() const
+ {
+ return( irqEDS.nonempty() );
+ }
+
+ inline bool hasntIrq() const
+ {
+ return( irqEDS.empty() );
+ }
+
+ inline bool isIrq() const
+ {
+ return( hasntOutput() && irqEDS.nonempty() );
+ }
+
+
+ /**
+ * appendOutput
+ * mwset PROCESS_EVAL_STATE
+ */
+ inline bool appendIrq_mwsetAEES(APExecutionData & anED,
+ AVM_EXEC_ENDING_STATUS anAEES)
+ {
+ anED.mwsetAEES(anAEES);
+
+ irqEDS.append( anED );
+
+ return( true );
+ }
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// the EXIT management
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * GETTER - SETTER
+ * EXIT REQUEST EDS
+ */
+ inline void appendExit(const APExecutionData & anED)
+ {
+ exitEDS.append(anED);
+ }
+
+ inline void spliceExit(ExecutionEnvironment & ENV)
+ {
+ exitEDS.splice( ENV.exitEDS );
+ }
+
+ inline bool hasExit() const
+ {
+ return( exitEDS.nonempty() );
+ }
+
+ inline bool hasntExit() const
+ {
+ return( exitEDS.empty() );
+ }
+
+ inline bool isExit() const
+ {
+ return( hasntOutput() && exitEDS.nonempty() );
+ }
+
+
+ /**
+ * appendOutput
+ * mwset PROCESS_EVAL_STATE
+ */
+ inline bool appendExit_mwsetAEES(APExecutionData & anED,
+ AVM_EXEC_ENDING_STATUS anAEES)
+ {
+ anED.mwsetAEES(anAEES);
+
+ exitEDS.append( anED );
+
+ return( true );
+ }
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// ALL OUTPUT ED management
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline bool hasSyncIrq() const
+ {
+ return( syncEDS.nonempty() || irqEDS.nonempty() );
+ }
+
+
+ inline bool hasOutputSyncIrq() const
+ {
+ return( outEDS.nonempty() || syncEDS.nonempty() || irqEDS.nonempty() );
+ }
+
+ inline bool hasntOutputSyncIrq() const
+ {
+ return( outEDS.empty() && syncEDS.empty() && irqEDS.empty() );
+ }
+
+
+ inline bool hasNoneOutput() const
+ {
+ return( outEDS.empty() && syncEDS.empty() &&
+ irqEDS.empty() && failureEDS.empty() );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// the RUN statement
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline bool run()
+ {
+ return( PRIMITIVE_PROCESSOR.run(inCODE->getOpOffset(), *this) );
+ }
+
+ inline bool run(PROCESS_EVAL_STATE aPES)
+ {
+ inED.mwsetRuntimeFormState(aPES);
+
+ return( PRIMITIVE_PROCESSOR.run(inCODE->getOpOffset(), *this) );
+ }
+
+ inline bool run(Operator * op, const BFCode & aCode)
+ {
+ inFORM = inCODE = aCode;
+
+ return( PRIMITIVE_PROCESSOR.run(op->getOffset(), *this) );
+ }
+
+ inline bool run(const BFCode & aCode)
+ {
+ inFORM = inCODE = aCode;
+
+ return( PRIMITIVE_PROCESSOR.run(inCODE->getOpOffset(), *this) );
+ }
+
+
+ inline bool run(const BF & bf)
+ {
+ inFORM = inCODE = bf.bfCode();
+
+ return( PRIMITIVE_PROCESSOR.run(inCODE->getOpOffset(), *this) );
+ }
+
+ inline bool run(APExecutionData & anED, const BFCode & aCode)
+ {
+ inEC = anED->getExecutionContext();
+
+ inED = anED;
+
+ inFORM = inCODE = aCode;
+
+ return( PRIMITIVE_PROCESSOR.run(inCODE->getOpOffset(), *this) );
+ }
+
+ bool run(ListOfAPExecutionData & inEDS, const BFCode & aCode);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// run from OUT EDS
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool runFromOutputs(const BFCode & aCode);
+
+ bool runFromOutputs(Operator * op, const BFCode & aCode);
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// the RESUME statement
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool resume(ExecutionEnvironment & ENV, APExecutionData & anED);
+
+ inline bool decode_resume()
+ {
+ return( PRIMITIVE_PROCESSOR.decode_resume(*this) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// the RESTORE CONTEXT
+ ////////////////////////////////////////////////////////////////////////////
+ inline void restoreContext(const RuntimeID & aRID)
+ {
+ ListOfAPExecutionData::iterator itED = outEDS.begin();
+ ListOfAPExecutionData::iterator endED = outEDS.end();
+ for( ; itED != endED ; ++itED )
+ {
+ (*itED)->mRID = aRID;
+ }
+ }
+
+
+
+ /**
+ * Serialization
+ */
+ virtual void toStream(OutStream & os) const;
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // CACHE MANAGER
+ ///////////////////////////////////////////////////////////////////////////
+
+ struct _EXEC_ENV_
+ {
+ ////////////////////////////////////////////////////////////////////////
+ // INPUTs
+ ////////////////////////////////////////////////////////////////////////
+ AvmPrimitiveProcessor * PRIMITIVE_PROCESSOR;
+
+ const ExecutionContext * inEC;
+
+ BF inFORM;
+
+ BFCode inCODE;
+
+ APExecutionData inED;
+
+
+ ////////////////////////////////////////////////////////////////////////
+ // ARGS ENV
+ ////////////////////////////////////////////////////////////////////////
+
+ ARGS_ENV * arg;
+
+
+ ////////////////////////////////////////////////////////////////////////
+ // OUTPUTs
+ ////////////////////////////////////////////////////////////////////////
+ ListOfAPExecutionData outEDS;
+
+
+ ////////////////////////////////////////////////////////////////////////
+ // SYNC Execution Data
+ ////////////////////////////////////////////////////////////////////////
+ ListOfAPExecutionData syncEDS;
+
+ ////////////////////////////////////////////////////////////////////////
+ // INTERRUPT REQUEST Execution Data
+ ////////////////////////////////////////////////////////////////////////
+ ListOfAPExecutionData irqEDS;
+
+ ////////////////////////////////////////////////////////////////////////
+ // INTERRUPT REQUEST Execution Data
+ ////////////////////////////////////////////////////////////////////////
+ ListOfAPExecutionData exitEDS;
+
+ ////////////////////////////////////////////////////////////////////////
+ // FAILED Execution Data
+ ////////////////////////////////////////////////////////////////////////
+
+ ListOfAPExecutionData failureEDS;
+
+ };
+
+ /**
+ * CACHE
+ */
+ static List< _EXEC_ENV_ * > EXEC_ENV_CACHE;
+
+ static void initENVS();
+
+ static void finalizeENVS();
+
+
+ inline static _EXEC_ENV_ * newENV();
+
+ inline static void freeENV(_EXEC_ENV_ * & exec_env);
+
+
+};
+
+
+
+
+
+
+
+}
+
+#endif /* EXECUTIONENVIRONMENT_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/PathConditionProcessor.cpp b/org.eclipse.efm.symbex/src/computer/PathConditionProcessor.cpp
new file mode 100644
index 0000000..906625b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/PathConditionProcessor.cpp
@@ -0,0 +1,615 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 21 juin 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "PathConditionProcessor.h"
+
+#include <common/BF.h>
+
+#include <computer/primitive/AvmPrimitiveProcessor.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/ExpressionSimplifier.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <solver/api/SolverFactory.h>
+
+
+
+namespace sep
+{
+
+/*
+ * ATTRIBUTE
+ */
+// true:> Utilise les SAT-SOLVER pour checker les conditions
+bool PathConditionProcessor::checkPathcondSat = false;
+
+// false:> Pas de separation sur les OR dans les PCs
+bool PathConditionProcessor::separationOfPcDisjunction = false;
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// CHECK SATISFIABILITY
+////////////////////////////////////////////////////////////////////////////////
+
+bool PathConditionProcessor::isWeakSatisfiable(const BF & aCondition)
+{
+ return( SolverFactory::isWeakSatisfiable(aCondition,
+ PathConditionProcessor::checkPathcondSat) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// FIRED CONDITION
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool PathConditionProcessor::setNodeCondition(
+ APExecutionData & apED, const BF & theCondition)
+{
+ apED.makeWritable();
+
+// RuntimeForm * aRF = apED.makeWritableRuntimeForm( apED->mRID );
+
+ apED->setNodeCondition( theCondition );
+
+// aRF->setNodeCondition( theCondition );
+
+AVM_IF_DEBUG_FLAG( TEST_DECISION )
+ AVM_OS_TRACE << DEFAULT_WRAP_DATA << "SET FIRED CONDITION :"
+ << str_indent( theCondition ) << END_WRAP_EOL;
+AVM_ENDIF_DEBUG_FLAG( TEST_DECISION )
+
+ return( true );
+}
+
+
+bool PathConditionProcessor::addNodeCondition(
+ APExecutionData & apED, const BF & theCondition)
+{
+AVM_IF_DEBUG_FLAG( TEST_DECISION )
+ AVM_OS_TRACE << DEFAULT_WRAP_DATA << "ADD FIRED CONDITION :begin>"
+ << str_indent( theCondition ) << " with FC:"
+ << str_indent( apED->getNodeCondition() ) << END_WRAP_EOL;
+AVM_ENDIF_DEBUG_FLAG( TEST_DECISION )
+
+ if( theCondition.isEqualTrue() )
+ {
+ //!!! NOTHING
+ }
+ else if( theCondition.isEqualFalse() ||
+ apED->getNodeCondition().isEqualFalse() )
+ {
+ return( false );
+ }
+ else
+ {
+ apED.makeWritable();
+
+// RuntimeForm * aRF = apED.makeWritableRuntimeForm( apED->mRID );
+
+ if( apED->getNodeCondition().isEqualTrue() )
+ {
+// aRF->setNodeCondition( theCondition );
+
+ apED->setNodeCondition( theCondition );
+
+ }
+ else
+ {
+// aRF->setNodeCondition(
+// ExpressionSimplifier::simplif_and(
+// aRF->getNodeCondition(), theCondition) );
+
+ apED->setNodeCondition(
+ ExpressionSimplifier::simplif_and(
+ apED->getNodeCondition(), theCondition) );
+ }
+ }
+
+AVM_IF_DEBUG_FLAG( TEST_DECISION )
+ AVM_OS_TRACE << DEFAULT_WRAP_DATA << "ADD FIRED CONDITION :end>"
+ << str_indent( apED->getNodeCondition() ) << END_WRAP_EOL;
+AVM_ENDIF_DEBUG_FLAG( TEST_DECISION )
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// FIRED TIMED CONDITION
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool PathConditionProcessor::setNodeTimedCondition(
+ APExecutionData & apED, const BF & theTimedCondition)
+{
+ apED.makeWritable();
+
+// RuntimeForm * aRF = apED.makeWritableRuntimeForm( apED->mRID );
+
+ apED->setNodeTimedCondition( theTimedCondition );
+
+// aRF->setNodeTimedCondition( theTimedCondition );
+
+AVM_IF_DEBUG_FLAG( TEST_DECISION )
+ AVM_OS_TRACE << DEFAULT_WRAP_DATA << "SET FIRED TIMED CONDITION :"
+ << str_indent( theTimedCondition ) << END_WRAP_EOL;
+AVM_ENDIF_DEBUG_FLAG( TEST_DECISION )
+
+ return( true );
+}
+
+
+bool PathConditionProcessor::addNodeTimedCondition(
+ APExecutionData & apED, const BF & theTimedCondition)
+{
+AVM_IF_DEBUG_FLAG( TEST_DECISION )
+ AVM_OS_TRACE << DEFAULT_WRAP_DATA << "ADD FIRED TIMED CONDITION :begin>"
+ << str_indent( theTimedCondition ) << " with FtC:"
+ << str_indent( apED->getNodeTimedCondition() ) << END_WRAP_EOL;
+AVM_ENDIF_DEBUG_FLAG( TEST_DECISION )
+
+ if( theTimedCondition.isEqualTrue() )
+ {
+ //!!! NOTHING
+ }
+ else if( theTimedCondition.isEqualFalse() ||
+ apED->getNodeTimedCondition().isEqualFalse() )
+ {
+ return( false );
+ }
+ else
+ {
+ apED.makeWritable();
+
+// RuntimeForm * aRF = apED.makeWritableRuntimeForm( apED->mRID );
+
+ if( apED->getNodeCondition().isEqualTrue() )
+ {
+// aRF->setNodeTimedCondition( theTimedCondition );
+
+ apED->setNodeTimedCondition( theTimedCondition );
+
+ }
+ else
+ {
+// aRF->setNodeTimedCondition(
+// ExpressionSimplifier::simplif_and(
+// aRF->getNodeTimedCondition(), theTimedCondition) );
+
+ apED->setNodeTimedCondition(
+ ExpressionSimplifier::simplif_and(
+ apED->getNodeCondition(), theTimedCondition) );
+ }
+ }
+
+AVM_IF_DEBUG_FLAG( TEST_DECISION )
+ AVM_OS_TRACE << DEFAULT_WRAP_DATA << "ADD FIRED TIMED CONDITION :end>"
+ << str_indent( apED->getNodeTimedCondition() ) << END_WRAP_EOL;
+AVM_ENDIF_DEBUG_FLAG( TEST_DECISION )
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// PATH CONDITION
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool PathConditionProcessor::addPathCondition(APExecutionData & apED,
+ const BF & theCondition, bool considerFiredConditon)
+{
+AVM_IF_DEBUG_FLAG( TEST_DECISION )
+ AVM_OS_TRACE << DEFAULT_WRAP_DATA << "ADD PATH CONDITION :begin>"
+ << str_indent( theCondition ) << " with PC:"
+ << str_indent( apED->getPathCondition() ) << END_WRAP_EOL;
+AVM_ENDIF_DEBUG_FLAG( TEST_DECISION )
+
+
+ if( theCondition.isEqualFalse() || apED->getPathCondition().isEqualFalse() )
+ {
+AVM_IF_DEBUG_FLAG( TEST_DECISION )
+ AVM_OS_TRACE << "ADD PATH CONDITION :end> false" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( TEST_DECISION )
+
+ return( false );
+ }
+
+ else if( not theCondition.isEqualTrue() )
+ {
+ BF thePathCondition = ( apED->getPathCondition().isEqualTrue() ) ?
+ theCondition : ExpressionSimplifier::simplif_and(
+ apED->getPathCondition(), theCondition);
+
+AVM_IF_DEBUG_FLAG( TEST_DECISION )
+ AVM_OS_TRACE << DEFAULT_WRAP_DATA << "ADD PATH CONDITION :isSat?>"
+ << str_indent( thePathCondition ) << END_WRAP_EOL;
+AVM_ENDIF_DEBUG_FLAG( TEST_DECISION )
+
+ if( PathConditionProcessor::isWeakSatisfiable(thePathCondition) )
+ {
+ apED.makeWritable();
+
+ if( considerFiredConditon && apED->isEnabledNodeCondition() )
+ {
+ if( not addNodeCondition(apED, theCondition) )
+ {
+ return( false );
+ }
+ }
+
+ apED->setPathCondition( thePathCondition );
+ }
+ else
+ {
+// apED->setPathCondition( ExpressionConstant::BOOLEAN_FALSE );
+
+AVM_IF_DEBUG_FLAG( TEST_DECISION )
+ AVM_OS_TRACE << "ADD PATH CONDITION :end> false" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( TEST_DECISION )
+
+ return( false );
+ }
+ }
+
+AVM_IF_DEBUG_FLAG( TEST_DECISION )
+ AVM_OS_TRACE << DEFAULT_WRAP_DATA << "ADD PATH CONDITION :end>"
+ << str_indent( apED->getPathCondition() ) << END_WRAP_EOL;
+AVM_ENDIF_DEBUG_FLAG( TEST_DECISION )
+
+ return( true );
+}
+
+
+bool PathConditionProcessor::appendPathCondition(
+ APExecutionData & apED, BF & theCondition,
+ CollectionOfAPExecutionData & listOfOutputED)
+{
+AVM_IF_DEBUG_FLAG( TEST_DECISION )
+ AVM_OS_TRACE << DEFAULT_WRAP_DATA << "APPEND PATH CONDITION :begin>"
+ << str_indent( theCondition ) << " with PC:"
+ << str_indent( apED->getPathCondition() ) << END_WRAP_EOL;
+AVM_ENDIF_DEBUG_FLAG( TEST_DECISION )
+
+
+ if( theCondition.isEqualFalse() || apED->getPathCondition().isEqualFalse() )
+ {
+AVM_IF_DEBUG_FLAG( TEST_DECISION )
+ AVM_OS_TRACE << "APPEND PATH CONDITION : false" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( TEST_DECISION )
+
+ return( false );
+ }
+
+ else if( theCondition.isEqualTrue() )
+ {
+ listOfOutputED.append( apED );
+
+AVM_IF_DEBUG_FLAG( TEST_DECISION )
+ AVM_OS_TRACE << DEFAULT_WRAP_DATA << "APPEND PATH CONDITION :end>"
+ << str_indent( apED->getPathCondition() ) << END_WRAP_EOL;
+AVM_ENDIF_DEBUG_FLAG( TEST_DECISION )
+
+ return( true );
+ }
+
+ else if( PathConditionProcessor::separationOfPcDisjunction &&
+ theCondition.is< AvmCode >() &&
+ theCondition.to_ptr< AvmCode >()->isOpCode( AVM_OPCODE_OR ) )
+ {
+ APExecutionData newED;
+ avm_size_t count = 0;
+
+ AvmCode::iterator itEnd = theCondition.to_ptr< AvmCode >()->end();
+ AvmCode::iterator it = theCondition.to_ptr< AvmCode >()->begin();
+
+ if( apED->getPathCondition().isEqualTrue() )
+ {
+ for( ; it != itEnd ; ++it )
+ {
+ newED = apED;
+ newED.makeWritable();
+
+ if( setCondition(newED, (*it), (*it)) )
+ {
+ listOfOutputED.append( newED );
+ ++count;
+ }
+ }
+ }
+
+ else
+ {
+ BF thePathCondition;
+
+ for( ; it != itEnd ; ++it )
+ {
+ newED = apED;
+ newED.makeWritable();
+
+ thePathCondition = ExpressionSimplifier::simplif_and(
+ newED->getPathCondition(), (*it));
+ if( setCondition(newED, (*it), thePathCondition) )
+ {
+ listOfOutputED.append( newED );
+ }
+ }
+ }
+
+ return( count > 0 );
+ }
+ else
+ {
+ BF thePathCondition;
+ if( apED->getPathCondition().isEqualTrue() )
+ {
+ thePathCondition = theCondition;
+ }
+ else
+ {
+ thePathCondition = ExpressionSimplifier::simplif_and(
+ apED->getPathCondition(), theCondition);
+ }
+
+ if( setCondition(apED, theCondition, thePathCondition) )
+ {
+ listOfOutputED.append( apED );
+
+ return( true );
+ }
+
+ return( false );
+ }
+}
+
+
+bool PathConditionProcessor::setCondition(
+ APExecutionData & apED, const BF & theNodeCondition,
+ const BF & thePathCondition, bool considerFiredConditon)
+{
+ // Verification de la satisfiabilite des gardes
+ // compte tenu du parametrage dans favm
+ if( PathConditionProcessor::isWeakSatisfiable(thePathCondition) )
+ {
+ apED.makeWritable();
+
+ if( considerFiredConditon && apED->isEnabledNodeCondition() )
+ {
+ if( not addNodeCondition(apED, theNodeCondition) )
+ {
+ return( false );
+ }
+ }
+
+ apED->setPathCondition( thePathCondition );
+
+AVM_IF_DEBUG_FLAG( TEST_DECISION )
+ AVM_OS_TRACE << DEFAULT_WRAP_DATA << "SET PATH CONDITION :end>"
+ << str_indent( thePathCondition ) << END_WRAP_EOL;
+AVM_ENDIF_DEBUG_FLAG( TEST_DECISION )
+
+ return( true );
+ }
+ else
+ {
+AVM_IF_DEBUG_FLAG( TEST_DECISION )
+ AVM_OS_TRACE << "SET PATH CONDITION :end> false" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( TEST_DECISION )
+
+ return( false );
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// TIMED CONDITION
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool PathConditionProcessor::addPathTimedCondition(
+ APExecutionData & apED, const BF & theTimedCondition)
+{
+AVM_IF_DEBUG_FLAG( TEST_DECISION )
+ AVM_OS_TRACE << DEFAULT_WRAP_DATA << "APPEND PATH TIMED CONDITION :begin>"
+ << str_indent( theTimedCondition ) << " with PC: "
+ << str_indent( apED->getPathTimedCondition() ) << END_WRAP_EOL;
+AVM_ENDIF_DEBUG_FLAG( TEST_DECISION )
+
+
+ if( theTimedCondition.isEqualFalse() ||
+ apED->getPathTimedCondition().isEqualFalse() )
+ {
+AVM_IF_DEBUG_FLAG( TEST_DECISION )
+ AVM_OS_TRACE << "APPEND PATH TIMED CONDITION :end> false" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( TEST_DECISION )
+
+ return( false );
+ }
+
+ else if( not theTimedCondition.isEqualTrue() )
+ {
+ apED.makeWritable();
+
+ if( apED->isEnabledNodeCondition() )
+ {
+ if( not addNodeTimedCondition(apED, theTimedCondition) )
+ {
+ return( false );
+ }
+ }
+
+ if( apED->getPathTimedCondition().isEqualTrue() )
+ {
+ apED->setPathTimedCondition( theTimedCondition );
+ }
+ else
+ {
+ apED->setPathTimedCondition( ExpressionSimplifier::simplif_and(
+ apED->getPathTimedCondition(), theTimedCondition) );
+ }
+
+AVM_IF_DEBUG_FLAG( TEST_DECISION )
+ AVM_OS_TRACE << DEFAULT_WRAP_DATA << "APPEND PATH TIMED CONDITION :end>"
+ << str_indent( apED->getPathTimedCondition() ) << END_WRAP_EOL;
+AVM_ENDIF_DEBUG_FLAG( TEST_DECISION )
+ }
+
+ return( true );
+}
+
+
+bool PathConditionProcessor::appendPathTimedCondition(
+ APExecutionData & apED, BF & theTimedCondition,
+ CollectionOfAPExecutionData & listOfOutputED)
+{
+ if( theTimedCondition.isEqualFalse() ||
+ apED->getPathTimedCondition().isEqualFalse() )
+ {
+AVM_IF_DEBUG_FLAG( TEST_DECISION )
+ AVM_OS_TRACE << "APPEND PATH TIMED CONDITION : false" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( TEST_DECISION )
+
+ return( false );
+ }
+
+ else if( theTimedCondition.isEqualTrue() )
+ {
+ listOfOutputED.append( apED );
+
+AVM_IF_DEBUG_FLAG( TEST_DECISION )
+ AVM_OS_TRACE << DEFAULT_WRAP_DATA << "APPEND PATH TIMED CONDITION :"
+ << str_indent( apED->getPathTimedCondition() ) << END_WRAP_EOL;
+AVM_ENDIF_DEBUG_FLAG( TEST_DECISION )
+
+ return( true );
+ }
+
+ else if( PathConditionProcessor::separationOfPcDisjunction &&
+ theTimedCondition.is< AvmCode >() &&
+ theTimedCondition.to_ptr< AvmCode >()->isOpCode( AVM_OPCODE_OR ) )
+ {
+ APExecutionData newED;
+ avm_size_t count = 0;
+
+ AvmCode::iterator itEnd = theTimedCondition.to_ptr< AvmCode >()->end();
+ AvmCode::iterator it = theTimedCondition.to_ptr< AvmCode >()->begin();
+
+ if( apED->getPathTimedCondition().isEqualTrue() )
+ {
+ for( ; it != itEnd ; ++it )
+ {
+ newED = apED;
+ newED.makeWritable();
+
+ if( setTimedCondition(newED, (*it), (*it)) )
+ {
+ listOfOutputED.append( newED );
+ ++count;
+ }
+ }
+ }
+
+ else
+ {
+ BF thePathTimedCondition;
+
+ for( ; it != itEnd ; ++it )
+ {
+ newED = apED;
+ newED.makeWritable();
+
+ thePathTimedCondition = ExpressionSimplifier::simplif_and(
+ newED->getPathTimedCondition(), (*it));
+ if( setTimedCondition(newED, (*it), thePathTimedCondition) )
+ {
+ listOfOutputED.append( newED );
+ }
+ }
+ }
+
+ return( count > 0 );
+ }
+ else
+ {
+ BF thePathTimedCondition;
+ if( apED->getPathTimedCondition().isEqualTrue() )
+ {
+ thePathTimedCondition = theTimedCondition;
+ }
+ else
+ {
+ thePathTimedCondition = ExpressionSimplifier::simplif_and(
+ apED->getPathTimedCondition(), theTimedCondition);
+ }
+
+ if( setTimedCondition(apED, theTimedCondition, thePathTimedCondition) )
+ {
+ listOfOutputED.append( apED );
+
+ return( true );
+ }
+
+ return( false );
+ }
+}
+
+
+bool PathConditionProcessor::setTimedCondition(APExecutionData & apED,
+ const BF & theNodeTimedCondition, const BF & thePathTimedCondition)
+{
+ // Verification de la satisfiabilite des gardes
+ // compte tenu du parametrage dans favm
+ if( PathConditionProcessor::isWeakSatisfiable(
+ apED->andPathTimedCondition(thePathTimedCondition)) )
+ {
+ apED.makeWritable();
+
+ if( apED->isEnabledNodeCondition() )
+ {
+ if( not addNodeTimedCondition(apED, theNodeTimedCondition) )
+ {
+ return( false );
+ }
+ }
+
+ apED->setPathTimedCondition( thePathTimedCondition );
+
+AVM_IF_DEBUG_FLAG( TEST_DECISION )
+ AVM_OS_TRACE << DEFAULT_WRAP_DATA << "SET PATH TIMED CONDITION :"
+ << str_indent( thePathTimedCondition ) << END_WRAP_EOL;
+AVM_ENDIF_DEBUG_FLAG( TEST_DECISION )
+
+ return( true );
+ }
+ else
+ {
+AVM_IF_DEBUG_FLAG( TEST_DECISION )
+ AVM_OS_TRACE << "SET PATH TIMED CONDITION :end> false" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( TEST_DECISION )
+
+ return( false );
+ }
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/computer/PathConditionProcessor.h b/org.eclipse.efm.symbex/src/computer/PathConditionProcessor.h
new file mode 100644
index 0000000..5af35ce
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/PathConditionProcessor.h
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 21 juin 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef PATHCONDITIONPROCESSOR_H_
+#define PATHCONDITIONPROCESSOR_H_
+
+#include <computer/ExecutionEnvironment.h>
+
+#include <fml/runtime/ExecutionData.h>
+
+
+namespace sep
+{
+
+
+class BF;
+class ExecutionEnvironment;
+
+class PathConditionProcessor
+{
+
+public:
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// CHECK SATISFIABILITY
+ ////////////////////////////////////////////////////////////////////////////
+ static bool isWeakSatisfiable(const BF & aCondition);
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// FIRED TIMED CONDITION
+ ////////////////////////////////////////////////////////////////////////////
+
+ static bool setNodeCondition(APExecutionData & apED,
+ const BF & theCondition);
+ static bool addNodeCondition(APExecutionData & apED,
+ const BF & theCondition);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// FIRED TIMED CONDITION
+ ////////////////////////////////////////////////////////////////////////////
+
+ static bool setNodeTimedCondition(APExecutionData & apED,
+ const BF & theTimedCondition);
+ static bool addNodeTimedCondition(APExecutionData & apED,
+ const BF & theTimedCondition);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// PATH CONDITION
+ ////////////////////////////////////////////////////////////////////////////
+
+ static bool addPathCondition(APExecutionData & apED,
+ const BF & theCondition, bool considerFiredConditon = true);
+
+
+ static bool appendPathCondition(APExecutionData & apED, BF & theCondition,
+ CollectionOfAPExecutionData & listOfOutputED);
+
+ inline static bool appendPathCondition(ExecutionEnvironment & ENV,
+ APExecutionData & apED, BF & theCondition)
+ {
+ return( appendPathCondition(apED, theCondition, ENV.outEDS) );
+ }
+
+ inline static bool appendPathCondition(ExecutionEnvironment & ENV)
+ {
+ return( appendPathCondition(ENV.inED, ENV.inFORM, ENV.outEDS) );
+ }
+
+
+ static bool setCondition(
+ APExecutionData & apED, const BF & theNodeCondition,
+ const BF & thePathCondition, bool considerFiredConditon = true);
+
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // PATH TIMED CONDITION
+ ////////////////////////////////////////////////////////////////////////////
+
+ static bool addPathTimedCondition(APExecutionData & apED,
+ const BF & theTimedCondition);
+
+ inline static bool appendPathTimedCondition(ExecutionEnvironment & ENV,
+ APExecutionData & apED, BF & theTimedCondition)
+ {
+ return( appendPathTimedCondition(apED,
+ theTimedCondition, ENV.outEDS) );
+ }
+
+ static bool appendPathTimedCondition(APExecutionData & apED,
+ BF & theTimedCondition,
+ CollectionOfAPExecutionData & listOfOutputED);
+
+ static bool setTimedCondition(APExecutionData & apED,
+ const BF & theNodeTimedCondition,
+ const BF & thePathTimedCondition);
+
+
+
+public:
+ /*
+ * ATTRIBUTE
+ */
+ static bool checkPathcondSat;
+ static bool separationOfPcDisjunction;
+
+
+
+};
+
+
+}
+
+#endif /* PATHCONDITIONPROCESSOR_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/instruction/AvmBytecode.cpp b/org.eclipse.efm.symbex/src/computer/instruction/AvmBytecode.cpp
new file mode 100644
index 0000000..fad9b84
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/instruction/AvmBytecode.cpp
@@ -0,0 +1,496 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 1 mars 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmBytecode.h"
+
+#include <common/BF.h>
+
+#include <fml/executable/ExecutableLib.h>
+#include <fml/executable/InstanceOfData.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+#include <fml/type/TypeManager.h>
+
+
+namespace sep
+{
+
+
+AvmBytecode AvmBytecode::ARG_UNDEFINED_CODE(
+ /*context */ AVM_ARG_UNDEFINED_CONTEXT,
+ /*processor*/ AVM_ARG_UNDEFINED_PROCESSOR,
+ /*operation*/ AVM_ARG_UNDEFINED_OPERATION,
+ /*operand */ AVM_ARG_UNDEFINED_OPERAND,
+ /*dtype */ NULL);
+
+
+AvmBytecode AvmBytecode::ARG_NOPS_CODE(AVM_ARG_NOPS);
+
+AvmBytecode AvmBytecode::ARG_SEVAL_CODE(AVM_ARG_SEVAL);
+
+AvmBytecode AvmBytecode::ARG_MEVAL_CODE(AVM_ARG_MEVAL);
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+AvmBytecode::AvmBytecode(
+ avm_arg_context_t aContext, avm_arg_processor_t aProcessor,
+ avm_arg_operation_t anOperation, avm_arg_operand_t anOperand,
+ BaseTypeSpecifier * aType)
+: context( aContext ),
+processor( aProcessor ),
+numeric( false ),
+operation( anOperation ),
+operand( anOperand ),
+offset( AVM_NUMERIC_MAX_SIZE_T ),
+dtype( aType ),
+
+routine_decode_eval( NULL ),
+routine_eval( NULL ),
+routine_decode_run( NULL ),
+routine_run( NULL )
+{
+ //!! NOTHING
+}
+
+AvmBytecode::AvmBytecode(
+ avm_arg_context_t aContext, avm_arg_processor_t aProcessor,
+ avm_arg_operation_t anOperation, avm_arg_operand_t anOperand)
+: context( aContext ),
+processor( aProcessor ),
+numeric( false ),
+operation( anOperation ),
+operand( anOperand ),
+offset( AVM_NUMERIC_MAX_SIZE_T ),
+dtype( TypeManager::UNIVERSAL ),
+
+routine_decode_eval( NULL ),
+routine_eval( NULL ),
+routine_decode_run( NULL ),
+routine_run( NULL )
+{
+ //!! NOTHING
+}
+
+AvmBytecode::AvmBytecode( avm_arg_context_t aContext,
+ avm_arg_operation_t anOperation, avm_arg_operand_t anOperand)
+: context( aContext ),
+processor( AVM_ARG_UNDEFINED_PROCESSOR ),
+numeric( false ),
+operation( anOperation ),
+operand( anOperand ),
+offset( AVM_NUMERIC_MAX_SIZE_T ),
+dtype( TypeManager::UNIVERSAL ),
+
+routine_decode_eval( NULL ),
+routine_eval( NULL ),
+routine_decode_run( NULL ),
+routine_run( NULL )
+{
+ //!! NOTHING
+}
+
+AvmBytecode::AvmBytecode(
+ avm_arg_operation_t anOperation, avm_arg_operand_t anOperand)
+: context( AVM_ARG_STANDARD_CTX ),
+processor( AVM_ARG_UNDEFINED_PROCESSOR ),
+numeric( false ),
+operation( anOperation ),
+operand( anOperand ),
+offset( AVM_NUMERIC_MAX_SIZE_T ),
+dtype( TypeManager::UNIVERSAL ),
+
+routine_decode_eval( NULL ),
+routine_eval( NULL ),
+routine_decode_run( NULL ),
+routine_run( NULL )
+{
+ //!! NOTHING
+}
+
+
+/**
+ * dtype
+ */
+bool AvmBytecode::hasType() const
+{
+ return( (dtype != NULL) && (dtype != TypeManager::UNIVERSAL) );
+}
+
+
+/**
+ * Serialization
+ */
+std::string AvmBytecode::strContext(avm_arg_context_t context)
+{
+ switch( context )
+ {
+ case AVM_ARG_STANDARD_CTX:
+ {
+ return( "std" );
+ }
+
+ case AVM_ARG_ARGUMENT_CTX:
+ {
+ return( "arg" );
+ }
+
+ case AVM_ARG_PARAMETER_CTX:
+ {
+ return( "param" );
+ }
+
+ case AVM_ARG_RETURN_CTX:
+ {
+ return( "ret" );
+ }
+
+ case AVM_ARG_UNDEFINED_CONTEXT:
+ default:
+ {
+ return( "?ctx" );
+ }
+ }
+}
+
+
+std::string AvmBytecode::strProcessor(avm_arg_processor_t processor)
+{
+ switch( processor )
+ {
+ case AVM_ARG_NOP_CPU:
+ {
+ return( "nop" );
+ }
+ case AVM_ARG_NOPS_CPU:
+ {
+ return( "nops" );
+ }
+
+ case AVM_ARG_MEMORY_LVALUE_CPU:
+ {
+ return( "dma:lv" );
+ }
+ case AVM_ARG_MEMORY_WVALUE_CPU:
+ {
+ return( "dma:wv" );
+ }
+ case AVM_ARG_MEMORY_RVALUE_CPU:
+ {
+ return( "dma:rv" );
+ }
+ case AVM_ARG_MEMORY_MACHINE_CPU:
+ {
+ return( "dma:rid" );
+ }
+
+ case AVM_ARG_ARITHMETIC_LOGIC_CPU:
+ {
+ return( "alu" );
+ }
+
+ case AVM_ARG_CHARACTER_CPU:
+ {
+ return( "char" );
+ }
+ case AVM_ARG_STRING_CPU:
+ {
+ return( "string" );
+ }
+
+ case AVM_ARG_ARRAY_LVALUE_CPU:
+ {
+ return( "array:lv" );
+ }
+ case AVM_ARG_ARRAY_RVALUE_CPU:
+ {
+ return( "array:rv" );
+ }
+
+ case AVM_ARG_VECTOR_CPU:
+ {
+ return( "vector" );
+ }
+
+ case AVM_ARG_QUEUE_CPU:
+ {
+ return( "queue" );
+ }
+ case AVM_ARG_LIST_CPU:
+ {
+ return( "list" );
+ }
+ case AVM_ARG_COLLECTION_CPU:
+ {
+ return( "collection" );
+ }
+
+ case AVM_ARG_BUFFER_CPU:
+ {
+ return( "buffer" );
+ }
+
+ case AVM_ARG_STATEMENT_CPU:
+ {
+ return( "stm" );
+ }
+
+ case AVM_ARG_UNDEFINED_PROCESSOR:
+ default:
+ {
+ return( "?processor" );
+ }
+ }
+}
+
+
+std::string AvmBytecode::strNopCode(avm_arg_operation_t operation)
+{
+ switch( operation & AVM_ARG_OPERATION_NOP_MASK )
+ {
+ case AVM_ARG_NOP:
+ {
+ return( "nop" );
+ }
+ case AVM_ARG_NOPS:
+ {
+ return( "nops" );
+ }
+
+ default:
+ {
+ return( "" );
+ }
+ }
+}
+
+std::string AvmBytecode::strEvalCode(avm_arg_operation_t operation)
+{
+ switch( operation & AVM_ARG_OPERATION_EVAL_MASK )
+ {
+ case AVM_ARG_SEVAL:
+ {
+ return( "seval" );
+ }
+
+ case AVM_ARG_MEVAL:
+ {
+ return( "meval" );
+ }
+
+ default:
+ {
+ return( "" );
+ }
+ }
+}
+
+
+std::string AvmBytecode::strValueCode(avm_arg_operation_t operation)
+{
+ switch( operation & AVM_ARG_OPERATION_VALUE_MASK )
+ {
+ case AVM_ARG_RVALUE:
+ {
+ return( "rvalue" );
+ }
+ case AVM_ARG_LVALUE:
+ {
+ return( "lvalue" );
+ }
+ case AVM_ARG_WVALUE:
+ {
+ return( "wvalue" );
+ }
+
+ case AVM_ARG_VALUE:
+ {
+ return( "value" );
+ }
+
+ default:
+ {
+ return( "?value" );
+ }
+ }
+}
+
+
+std::string AvmBytecode::strOperand(avm_arg_operand_t operand)
+{
+ switch( operand )
+ {
+ case AVM_ARG_DATA_KIND:
+ {
+ return( "data" );
+ }
+ case AVM_ARG_DATA_CST_KIND:
+ {
+ return( "const" );
+ }
+ case AVM_ARG_DATA_REF_KIND:
+ {
+ return( "ref" );
+ }
+ case AVM_ARG_DATA_MACRO_KIND:
+ {
+ return( "macro" );
+ }
+ case AVM_ARG_DATA_UFI_KIND:
+ {
+ return( "ufi" );
+ }
+
+ case AVM_ARG_PORT_KIND:
+ {
+ return( "port" );
+ }
+ case AVM_ARG_BUFFER_KIND:
+ {
+ return( "buffer" );
+ }
+ case AVM_ARG_CONNECTOR_KIND:
+ {
+ return( "connector" );
+ }
+
+ case AVM_ARG_BUILTIN_KIND:
+ {
+ return( "builtin" );
+ }
+ case AVM_ARG_BUILTIN_ARRAY_KIND:
+ {
+ return( "built#array" );
+ }
+ case AVM_ARG_BUILTIN_CONTAINER_KIND:
+ {
+ return( "built#collection" );
+ }
+
+ case AVM_ARG_BOOLEAN_KIND:
+ {
+ return( "boolean" );
+ }
+ case AVM_ARG_INTEGER_KIND:
+ {
+ return( "integer" );
+ }
+ case AVM_ARG_RATIONAL_KIND:
+ {
+ return( "rational" );
+ }
+ case AVM_ARG_FLOAT_KIND:
+ {
+ return( "float" );
+ }
+ case AVM_ARG_CHARACTER_KIND:
+ {
+ return( "char" );
+ }
+ case AVM_ARG_STRING_KIND:
+ {
+ return( "string" );
+ }
+
+ case AVM_ARG_OPERATOR_KIND:
+ {
+ return( "operator" );
+ }
+
+ case AVM_ARG_EXPRESSION_KIND:
+ {
+ return( "expression" );
+ }
+ case AVM_ARG_ARRAY_KIND:
+ {
+ return( "array" );
+ }
+ case AVM_ARG_COLLECTION_KIND:
+ {
+ return( "collection" );
+ }
+
+ case AVM_ARG_STATEMENT_KIND:
+ {
+ return( "statement" );
+ }
+
+ case AVM_ARG_CTOR_TYPE_KIND:
+ {
+ return( "ctor#type" );
+ }
+
+
+ case AVM_ARG_MACHINE_RID:
+ {
+ return( "machine#rid" );
+ }
+
+ case AVM_ARG_EXPRESSION_RID:
+ {
+ return( "expr#rid" );
+ }
+
+ case AVM_ARG_SELF_RID:
+ {
+ return( "self#rid" );
+ }
+ case AVM_ARG_PARENT_RID:
+ {
+ return( "parent#rid" );
+ }
+ case AVM_ARG_COMMUNICATOR_RID:
+ {
+ return( "com#rid" );
+ }
+ case AVM_ARG_SYSTEM_RID:
+ {
+ return( "system#rid" );
+ }
+ case AVM_ARG_ENVIRONMENT_RID:
+ {
+ return( "env#rid" );
+ }
+ case AVM_ARG_COMPONENT_SELF_RID:
+ {
+ return( "component#self#rid" );
+ }
+ case AVM_ARG_COMPONENT_PARENT_RID:
+ {
+ return( "component#parent#rid" );
+ }
+ case AVM_ARG_COMPONENT_COMMUNICATOR_RID:
+ {
+ return( "component#com#rid" );
+ }
+
+ default:
+ {
+ return( "?expression" );
+ }
+ }
+}
+
+
+std::string AvmBytecode::strType() const
+{
+ return( (dtype != NULL) ? dtype->strT() : "null<dtype>" );
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/computer/instruction/AvmBytecode.h b/org.eclipse.efm.symbex/src/computer/instruction/AvmBytecode.h
new file mode 100644
index 0000000..17fac78
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/instruction/AvmBytecode.h
@@ -0,0 +1,623 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 1 mars 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMBYTECODE_H_
+#define AVMBYTECODE_H_
+
+#include <printer/OutStream.h>
+
+#include <util/avm_numeric.h>
+
+
+namespace sep
+{
+
+/**
+ * Evaluation context
+ */
+enum AVM_ARG_CONTEXT
+{
+ AVM_ARG_UNDEFINED_CONTEXT = 0x0000,
+
+ AVM_ARG_STANDARD_CTX,
+
+ AVM_ARG_ARGUMENT_CTX,
+
+ AVM_ARG_PARAMETER_CTX,
+
+ AVM_ARG_RETURN_CTX,
+
+};
+
+//typedef avm_uint8_t avm_arg_context_t;
+typedef AVM_ARG_CONTEXT avm_arg_context_t;
+
+
+/**
+ * Evaluation co-processor unit (CPU)
+ */
+enum AVM_ARG_PROCESSOR
+{
+ AVM_ARG_UNDEFINED_PROCESSOR = 0x0000,
+
+ AVM_ARG_NOP_CPU,
+ AVM_ARG_NOPS_CPU,
+
+ AVM_ARG_MEMORY_LVALUE_CPU,
+ AVM_ARG_MEMORY_WVALUE_CPU,
+ AVM_ARG_MEMORY_RVALUE_CPU,
+ AVM_ARG_MEMORY_MACHINE_CPU,
+
+ AVM_ARG_ARITHMETIC_LOGIC_CPU,
+
+ AVM_ARG_CHARACTER_CPU,
+
+ AVM_ARG_STRING_CPU,
+
+ AVM_ARG_ARRAY_LVALUE_CPU,
+ AVM_ARG_ARRAY_RVALUE_CPU,
+
+ AVM_ARG_VECTOR_CPU,
+
+ AVM_ARG_QUEUE_CPU,
+ AVM_ARG_LIST_CPU,
+ AVM_ARG_COLLECTION_CPU,
+
+ AVM_ARG_BUFFER_CPU,
+
+ AVM_ARG_STATEMENT_CPU,
+
+};
+
+//typedef avm_uint8_t avm_arg_processor_t;
+typedef AVM_ARG_PROCESSOR avm_arg_processor_t;
+
+
+/**
+ * Evaluation operation
+ */
+enum AVM_ARG_OPERATION
+{
+ AVM_ARG_UNDEFINED_OPERATION = 0x0000,
+
+ // 4 bits :> PREFIX CODE
+ // : 0001:nop
+ // : 0011:nops
+ AVM_ARG_NOP = 0x0001,
+
+ AVM_ARG_NOP_ALL = 0x0002,
+ AVM_ARG_NOPS = AVM_ARG_NOP_ALL | AVM_ARG_NOP,
+ // : 0100:sroutine_eval
+ // : 1000:mroutine_eval
+ AVM_ARG_SEVAL = 0x0004,
+ AVM_ARG_MEVAL = 0x0008,
+
+ // 4 bits :> LR-VALUE CODE
+ // | 0001:lvalue
+ // | 0010:rvalue
+ // | 0100:wvalue
+ // | 1000:lr_value
+ AVM_ARG_LVALUE = 0x0010,
+ AVM_ARG_WVALUE = 0x0020,
+ AVM_ARG_RVALUE = 0x0040,
+
+ AVM_ARG_VALUE = AVM_ARG_LVALUE
+ | AVM_ARG_WVALUE
+ | AVM_ARG_RVALUE,
+
+
+ // Combinaison [S|M]EVAL with VALUE
+ AVM_ARG_SEVAL_LVALUE = AVM_ARG_SEVAL | AVM_ARG_LVALUE,
+ AVM_ARG_SEVAL_WVALUE = AVM_ARG_SEVAL | AVM_ARG_WVALUE,
+ AVM_ARG_SEVAL_RVALUE = AVM_ARG_SEVAL | AVM_ARG_RVALUE,
+
+ AVM_ARG_SEVAL_VALUE = AVM_ARG_SEVAL | AVM_ARG_VALUE,
+
+ AVM_ARG_MEVAL_LVALUE = AVM_ARG_MEVAL | AVM_ARG_LVALUE,
+ AVM_ARG_MEVAL_WVALUE = AVM_ARG_MEVAL | AVM_ARG_WVALUE,
+ AVM_ARG_MEVAL_RVALUE = AVM_ARG_MEVAL | AVM_ARG_RVALUE,
+
+ AVM_ARG_MEVAL_VALUE = AVM_ARG_MEVAL | AVM_ARG_VALUE,
+
+ // Combinaison NOP with [S|M]EVAL with VALUE
+ AVM_ARG_NOP_LVALUE = AVM_ARG_NOP | AVM_ARG_LVALUE,
+ AVM_ARG_NOP_RVALUE = AVM_ARG_NOP | AVM_ARG_RVALUE,
+
+ AVM_ARG_NOP_VALUE = AVM_ARG_NOP | AVM_ARG_VALUE,
+
+ // Combinaison NOPS with [S|M]EVAL with VALUE
+ AVM_ARG_NOPS_LVALUE = AVM_ARG_NOPS | AVM_ARG_LVALUE,
+ AVM_ARG_NOPS_RVALUE = AVM_ARG_NOPS | AVM_ARG_RVALUE,
+
+ AVM_ARG_NOPS_VALUE = AVM_ARG_NOPS | AVM_ARG_VALUE,
+
+};
+
+//typedef avm_uint8_t avm_arg_operation_t;
+typedef AVM_ARG_OPERATION avm_arg_operation_t;
+
+
+#define AVM_ARG_OPERATION_NOP_MASK (AVM_ARG_NOP | AVM_ARG_NOPS)
+
+#define IS_ARG_OPERATION_NOP(op) (op & AVM_ARG_NOP)
+#define IS_ARG_OPERATION_NOPS(op) (op & AVM_ARG_NOP_ALL)
+
+
+#define AVM_ARG_OPERATION_EVAL_MASK (AVM_ARG_SEVAL | AVM_ARG_MEVAL)
+
+#define IS_ARG_OPERATION_EVAL(op) ((op & AVM_ARG_NOP) == 0)
+#define IS_ARG_OPERATION_SEVAL(op) (IS_ARG_OPERATION_EVAL(op) && (op & AVM_ARG_SEVAL) )
+#define IS_ARG_OPERATION_MEVAL(op) (IS_ARG_OPERATION_EVAL(op) && (op & AVM_ARG_MEVAL) )
+
+
+#define AVM_ARG_OPERATION_PREFIX_MASK (AVM_ARG_OPERATION_NOP_MASK | AVM_ARG_OPERATION_EVAL_MASK)
+
+#define HAS_ARG_OPERATION_PREFIX(op) ((op & AVM_ARG_OPERATION_PREFIX_MASK) != 0)
+
+
+#define AVM_ARG_OPERATION_X_SEVAL_MASK (AVM_ARG_SEVAL | (~ AVM_ARG_OPERATION_PREFIX_MASK))
+#define AVM_ARG_OPERATION_X_MEVAL_MASK (AVM_ARG_MEVAL | (~ AVM_ARG_OPERATION_PREFIX_MASK))
+
+
+#define AVM_ARG_OPERATION_VALUE_MASK ( AVM_ARG_LVALUE | AVM_ARG_WVALUE | AVM_ARG_RVALUE )
+
+
+/**
+ * Evaluation operand
+ */
+enum AVM_ARG_OPERAND
+{
+ AVM_ARG_UNDEFINED_OPERAND = 0x0000,
+
+ // 4 bit :> argument kind
+ // | 0001:data
+ // | 0011:data#ref
+ // | 0101:data#macro
+ // | 0100:expression
+ // : 1000:builtin
+ AVM_ARG_DATA_KIND,
+ AVM_ARG_DATA_CST_KIND,
+ AVM_ARG_DATA_REF_KIND,
+ AVM_ARG_DATA_MACRO_KIND,
+ AVM_ARG_DATA_UFI_KIND,
+
+ AVM_ARG_PORT_KIND,
+ AVM_ARG_BUFFER_KIND,
+ AVM_ARG_CONNECTOR_KIND,
+
+ AVM_ARG_BUILTIN_KIND,
+ AVM_ARG_BUILTIN_ARRAY_KIND,
+ AVM_ARG_BUILTIN_CONTAINER_KIND,
+
+ AVM_ARG_BOOLEAN_KIND,
+
+ AVM_ARG_INTEGER_KIND,
+ AVM_ARG_RATIONAL_KIND,
+ AVM_ARG_FLOAT_KIND,
+
+ AVM_ARG_CHARACTER_KIND,
+ AVM_ARG_STRING_KIND,
+
+ AVM_ARG_ARRAY_KIND,
+ AVM_ARG_COLLECTION_KIND,
+
+ AVM_ARG_MACHINE_RID,
+ AVM_ARG_EXPRESSION_RID,
+
+ AVM_ARG_SELF_RID,
+ AVM_ARG_PARENT_RID,
+ AVM_ARG_COMMUNICATOR_RID,
+ AVM_ARG_SYSTEM_RID,
+ AVM_ARG_ENVIRONMENT_RID,
+
+ AVM_ARG_COMPONENT_SELF_RID,
+ AVM_ARG_COMPONENT_PARENT_RID,
+ AVM_ARG_COMPONENT_COMMUNICATOR_RID,
+
+ AVM_ARG_OPERATOR_KIND,
+
+ AVM_ARG_EXPRESSION_KIND,
+
+ AVM_ARG_STATEMENT_KIND,
+
+ AVM_ARG_CTOR_TYPE_KIND,
+
+};
+
+//typedef avm_uint8_t avm_arg_operand_t;
+typedef AVM_ARG_OPERAND avm_arg_operand_t;
+
+
+/**
+ * Avm bytecode definition
+ */
+
+class ARGS_ENV;
+class AvmCode;
+class BaseTypeSpecifier;
+class BF;
+
+
+struct AvmBytecode
+{
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmBytecode(avm_arg_context_t aContext, avm_arg_processor_t aProcessor,
+ avm_arg_operation_t anOperation, avm_arg_operand_t anOperand,
+ BaseTypeSpecifier * aType);
+
+ AvmBytecode(avm_arg_context_t aContext, avm_arg_processor_t aProcessor,
+ avm_arg_operation_t anOperation = AVM_ARG_UNDEFINED_OPERATION,
+ avm_arg_operand_t anOperand = AVM_ARG_UNDEFINED_OPERAND);
+
+ AvmBytecode(avm_arg_context_t aContext,
+ avm_arg_operation_t anOperation = AVM_ARG_UNDEFINED_OPERATION,
+ avm_arg_operand_t anOperand = AVM_ARG_UNDEFINED_OPERAND);
+
+ AvmBytecode(avm_arg_operation_t anOperation = AVM_ARG_UNDEFINED_OPERATION,
+ avm_arg_operand_t anOperand = AVM_ARG_UNDEFINED_OPERAND);
+
+
+// /**
+// * CONSTRUCTOR
+// * Copy
+// */
+// AvmBytecode(const AvmBytecode & aBytecode)
+// : context( aBytecode.context ),
+// processor( aBytecode.processor ),
+// numeric( aBytecode.numeric ),
+// operation( aBytecode.operation ),
+// operand( aBytecode.operand ),
+// offset( aBytecode.offset ),
+// dtype( aBytecode.dtype ),
+//
+// routine_decode_eval( aBytecode.routine_decode_eval ),
+// routine_eval( aBytecode.routine_eval ),
+// routine_decode_run( aBytecode.routine_decode_run ),
+// routine_run( aBytecode.routine_run )
+// {
+// //!! NOTHING
+// }
+
+
+ /**
+ * operation
+ * operand
+ * result
+ */
+ void set(avm_arg_context_t aContext,
+ avm_arg_processor_t aProcessor, avm_arg_operation_t anOperation,
+ avm_arg_operand_t anOperand, BaseTypeSpecifier * aType = NULL)
+ {
+ context = aContext;
+ processor = aProcessor;
+ operation = anOperation;
+ operand = anOperand;
+ dtype = aType;
+ }
+
+
+ void set(avm_arg_operation_t anOperation, avm_arg_operand_t anOperand)
+ {
+ operation = anOperation;
+ operand = anOperand;
+ }
+
+
+ /**
+ * dtype
+ */
+ bool hasType() const;
+
+ /**
+ * NOP
+ * NOPS
+ * EVALS
+ */
+ inline bool isNopCpu() const
+ {
+ return( (processor == AVM_ARG_NOP_CPU) ||
+ (processor == AVM_ARG_NOPS_CPU) );
+ }
+
+ inline void setNopCpu(
+ avm_arg_operation_t opMask = AVM_ARG_UNDEFINED_OPERATION)
+ {
+ processor = AVM_ARG_NOP_CPU;
+
+ operation = avm_arg_operation_t(operation | opMask | AVM_ARG_NOP);
+
+ operation = avm_arg_operation_t(operation &
+ (~AVM_ARG_OPERATION_EVAL_MASK));
+ }
+
+
+ inline bool isNopOperation() const
+ {
+ return( IS_ARG_OPERATION_NOP(operation) );
+ }
+
+ inline void setNopOperation(
+ avm_arg_operation_t opMask = AVM_ARG_UNDEFINED_OPERATION)
+ {
+ operation = avm_arg_operation_t(operation | opMask | AVM_ARG_NOP);
+
+ operation = avm_arg_operation_t(operation &
+ (~AVM_ARG_OPERATION_EVAL_MASK));
+ }
+
+
+ inline bool isNopsOperation() const
+ {
+ return( IS_ARG_OPERATION_NOPS(operation) );
+ }
+
+ inline void setNopsOperation(
+ avm_arg_operation_t opMask = AVM_ARG_UNDEFINED_OPERATION)
+ {
+ operation = avm_arg_operation_t(operation | opMask | AVM_ARG_NOPS);
+
+ operation = avm_arg_operation_t( operation &
+ (~AVM_ARG_OPERATION_EVAL_MASK));
+ }
+
+ inline void unsetNopsOperation(avm_arg_operation_t opMask = AVM_ARG_SEVAL)
+ {
+ operation = avm_arg_operation_t( (operation | opMask) &
+ (~ AVM_ARG_OPERATION_NOP_MASK));
+ }
+
+
+ inline bool isEval() const
+ {
+ return( IS_ARG_OPERATION_EVAL(operation) );
+ }
+
+ inline void unsetEval()
+ {
+ operation = avm_arg_operation_t( operation &
+ (~ AVM_ARG_OPERATION_EVAL_MASK) );
+ }
+
+
+ inline bool isSeval() const
+ {
+ return( IS_ARG_OPERATION_SEVAL(operation) );
+ }
+
+ inline void setSeval(avm_arg_operation_t opMask = AVM_ARG_UNDEFINED_OPERATION)
+ {
+ operation = avm_arg_operation_t(operation | opMask | AVM_ARG_SEVAL);
+ }
+
+ // eXclusive PREFIX bit setting
+ inline void xsetSeval(avm_arg_operation_t opMask = AVM_ARG_UNDEFINED_OPERATION)
+ {
+ operation = avm_arg_operation_t( (operation | opMask) &
+ AVM_ARG_OPERATION_X_SEVAL_MASK );
+ }
+
+ inline void unsetSeval()
+ {
+ operation = avm_arg_operation_t( operation & (~ AVM_ARG_SEVAL) );
+ }
+
+
+ inline bool isMeval() const
+ {
+ return( IS_ARG_OPERATION_MEVAL(operation) );
+ }
+
+ inline void setMeval(avm_arg_operation_t opMask = AVM_ARG_UNDEFINED_OPERATION)
+ {
+ operation = avm_arg_operation_t(operation | opMask | AVM_ARG_MEVAL);
+ }
+
+ // eXclusive PREFIX bit setting
+ inline void xsetMeval(avm_arg_operation_t opMask = AVM_ARG_UNDEFINED_OPERATION)
+ {
+ operation = avm_arg_operation_t( (operation | opMask) &
+ AVM_ARG_OPERATION_X_MEVAL_MASK );
+ }
+
+ inline void unsetMeval()
+ {
+ operation = avm_arg_operation_t( operation & (~ AVM_ARG_MEVAL) );
+ }
+
+
+ static AvmBytecode ARG_UNDEFINED_CODE;
+
+ static AvmBytecode ARG_NOPS_CODE;
+ static AvmBytecode ARG_SEVAL_CODE;
+ static AvmBytecode ARG_MEVAL_CODE;
+
+
+ /**
+ * COMPARISON
+ * OPERATOR
+ */
+
+ inline bool operator==(const AvmBytecode & other) const
+ {
+ return( (context == other.context ) &&
+ (processor == other.processor) &&
+ (numeric == other.numeric ) &&
+ (operation == other.operation) &&
+ (operand == other.operand ) &&
+ (offset == other.offset ) &&
+ (dtype == other.dtype) );
+ }
+
+
+ /**
+ * Serialization
+ */
+ static std::string strContext(avm_arg_context_t context);
+
+ static std::string strProcessor(avm_arg_processor_t processor);
+
+
+ static std::string strNopCode(avm_arg_operation_t operation);
+
+ static std::string strEvalCode(avm_arg_operation_t operation);
+
+ inline static std::string strPrefixCode(avm_arg_operation_t operation)
+ {
+ if( HAS_ARG_OPERATION_PREFIX(operation) )
+ {
+ std::string nop = strNopCode(operation);
+ std::string routine_eval = strEvalCode(operation);
+
+ return( nop.empty() ? routine_eval :
+ (routine_eval.empty() ? nop :
+ (OSS() << nop << "#" << routine_eval).str()) );
+ }
+ else
+ {
+ return( "?routine_eval" );
+ }
+ }
+
+
+ static std::string strValueCode(avm_arg_operation_t operation);
+
+ inline static std::string strOperation(avm_arg_operation_t operation)
+ {
+ return( OSS() << strPrefixCode(operation) << ":"
+ << strValueCode(operation) );
+ }
+
+
+ static std::string strOperand(avm_arg_operand_t operand);
+
+
+ inline static std::string strCode(
+ avm_arg_context_t context, avm_arg_processor_t processor,
+ avm_arg_operation_t operation, avm_arg_operand_t operand)
+ {
+ std::ostringstream oss;
+
+ oss << strContext(context) << "[" << strProcessor(processor) << "]:>"
+ << strOperation(operation) << ":" << strOperand(operand);
+
+ return( oss.str() );
+ }
+
+
+ inline std::string strPrefixCode() const
+ {
+ return( AvmBytecode::strPrefixCode(operation) );
+ }
+
+ inline std::string strValueCode() const
+ {
+ return( AvmBytecode::strValueCode(operation) );
+ }
+
+ inline std::string strExpressionCode() const
+ {
+ return( AvmBytecode::strOperand(operand) );
+ }
+
+ inline std::string strCode() const
+ {
+ std::ostringstream oss;
+
+ oss << AvmBytecode::strCode(context, processor, operation, operand);
+ if( offset != AVM_NUMERIC_MAX_SIZE_T )
+ {
+ oss << "<<" << offset;
+ }
+
+ return( oss.str() );
+ }
+
+ std::string strType() const;
+
+
+ /*
+ * ATTRIBUTES
+ */
+ // context
+ avm_arg_context_t context;
+
+ // routine_evaluation processor
+ avm_arg_processor_t processor;
+
+ // is numeric valuation flag
+ bool numeric;
+
+ // operation
+ avm_arg_operation_t operation;
+
+ // operand<nature> used by the operation
+ avm_arg_operand_t operand;
+
+ // offset of operand in input table
+ avm_size_t offset;
+
+ // type of operand
+ BaseTypeSpecifier * dtype;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // optimize API for << [decode] eval >> routine
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool (* routine_decode_eval)(AvmBytecode *, ARGS_ENV &, const BF &);
+
+ inline bool decode_eval(ARGS_ENV & argENV, const BF & arg)
+ {
+ return( routine_decode_eval(this, argENV, arg) );
+ }
+
+
+ bool (* routine_eval)(AvmBytecode *, ARGS_ENV &, AvmCode *);
+
+ inline bool eval(ARGS_ENV & argENV, AvmCode * aCode)
+ {
+ return( routine_eval(this, argENV, aCode) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // optimize API for << [decode] run >> routine
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool (* routine_decode_run)(AvmBytecode *, ARGS_ENV &, const BF &);
+
+ inline bool decode_run(ARGS_ENV & argENV, const BF & arg)
+ {
+ return( routine_decode_run(this, argENV, arg) );
+ }
+
+
+ bool (* routine_run)(AvmBytecode *, ARGS_ENV &, AvmCode *);
+
+ inline bool run(ARGS_ENV & argENV, AvmCode * aCode)
+ {
+ return( routine_run(this, argENV, aCode) );
+ }
+
+
+};
+
+
+} /* namespace sep */
+#endif /* AVMBYTECODE_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/instruction/AvmInstruction.cpp b/org.eclipse.efm.symbex/src/computer/instruction/AvmInstruction.cpp
new file mode 100644
index 0000000..fdbd572
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/instruction/AvmInstruction.cpp
@@ -0,0 +1,183 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 23 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmInstruction.h"
+
+#include <fml/expression/AvmCode.h>
+
+
+namespace sep
+{
+
+/**
+ * compute main bytecode
+ * NOPS or EVALS
+ */
+void AvmInstruction::computeMainBytecode(
+ bool updateMainByteCodeIfNOPS, avm_arg_operation_t opMask)
+{
+ bool isUnsetNops = true;
+ for( int pc = int(theSize) - 1 ; pc >= 0 ; --pc )
+ {
+ if( isUnsetNops && theArgBytecode[pc].isEval() )
+ {
+ isUnsetNops = false;
+
+ if( pc < (int(theSize) - 2) )
+ {
+ theArgBytecode[pc+1].setNopsOperation();
+ }
+ }
+
+ if( theArgBytecode[pc].isSeval() )
+ {
+ theMainBytecode.xsetSeval(opMask);
+ }
+ else if( theArgBytecode[pc].isMeval() )
+ {
+ theMainBytecode.xsetMeval(opMask);
+ break;
+ }
+ }
+
+ if( isUnsetNops )
+ {
+ theArgBytecode[0].setNopsOperation(AVM_ARG_VALUE);
+
+ if( updateMainByteCodeIfNOPS )
+ {
+ theMainBytecode.setNopsOperation(opMask);
+ }
+ }
+ else
+ {
+// theMainBytecode.unsetNops();
+ }
+}
+
+
+void AvmInstruction::computeBytecode(bool updateMainByteCodeIfNOPS,
+ const Vector< AvmBytecode > & vectorOfArgOpcode)
+{
+ AVM_OS_ASSERT_WARNING_ALERT( vectorOfArgOpcode.nonempty() )
+ << "AvmBytecode::computeArgCode :> "
+ "Unexpected an empty vector of ArgOpcode !!!"
+ << SEND_ALERT;
+
+ theSize = vectorOfArgOpcode.size();
+
+ if( theArgBytecode != NULL )
+ {
+ delete theArgBytecode;
+ }
+
+ if( theSize > 0 )
+ {
+ theArgBytecode = new AvmBytecode[theSize];
+
+// for( avm_size_t pc = 0 ; pc < count ; ++pc )
+// {
+// theArgBytecode[pc] = vectorOfArgOpcode[pc];
+// }
+
+ bool isUnsetNops = true;
+ for( int pc = int(theSize) - 1 ; pc >= 0 ; --pc )
+ {
+ theArgBytecode[pc] = vectorOfArgOpcode[pc];
+
+ if( isUnsetNops && theArgBytecode[pc].isEval() )
+ {
+ isUnsetNops = false;
+
+ if( pc < (int(theSize) - 2) )
+ {
+ theArgBytecode[pc+1].setNopsOperation();
+ }
+ }
+
+ if( theArgBytecode[pc].isSeval() )
+ {
+ if( not theMainBytecode.isMeval() )
+ {
+ theMainBytecode.xsetSeval();
+ }
+ }
+ else if( theArgBytecode[pc].isMeval() &&
+ (not theMainBytecode.isMeval()) )
+ {
+ theMainBytecode.xsetMeval();
+ }
+ }
+
+ if( isUnsetNops )
+ {
+ theArgBytecode[0].setNopsOperation(AVM_ARG_VALUE);
+
+ if( updateMainByteCodeIfNOPS )
+ {
+ theMainBytecode.setNopsOperation();
+ }
+ }
+ else
+ {
+// theMainBytecode.unsetNops();
+ }
+ }
+ else
+ {
+ theMainBytecode.setNopsOperation();
+ }
+}
+
+
+/**
+ * nops bytecode
+ */
+AvmInstruction * AvmInstruction::nopsUnaryCode(avm_arg_operand_t operand)
+{
+ AvmInstruction * nopsInstruction = new AvmInstruction(1);
+
+ nopsInstruction->setMainBytecode(
+ /*processor*/ AVM_ARG_NOP_CPU,
+ /*operation*/ AVM_ARG_NOPS_VALUE,
+ /*operand */ operand);
+
+ nopsInstruction->set(0,
+ /*processor*/ AVM_ARG_NOP_CPU,
+ /*operation*/ AVM_ARG_NOPS_VALUE,
+ /*operand */ operand);
+
+ return( nopsInstruction );
+
+}
+
+
+/**
+ ***************************************************************************
+ * SERIALIZATION
+ ***************************************************************************
+ */
+void AvmInstruction::toStream(OutStream & os) const
+{
+ os << TAB << "#{" << EOL;
+ for( avm_size_t idx = 0 ; idx < theSize ; ++idx )
+ {
+ os << TAB2 << idx << ":" << theArgBytecode[idx].strCode() << EOL;
+ }
+ os << TAB << "}" << EOL_FLUSH;
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/computer/instruction/AvmInstruction.h b/org.eclipse.efm.symbex/src/computer/instruction/AvmInstruction.h
new file mode 100644
index 0000000..01b981e
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/instruction/AvmInstruction.h
@@ -0,0 +1,632 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 23 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMINSTRUCTION_H_
+#define AVMINSTRUCTION_H_
+
+#include <collection/Vector.h>
+
+#include <computer/instruction/AvmBytecode.h>
+
+
+namespace sep
+{
+
+
+class ARGS_ENV;
+class AvmCode;
+class BF;
+
+class AvmInstruction
+{
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmInstruction()
+ : theSize( 0 ),
+ theMainBytecode( ),
+ theArgBytecode( NULL ),
+
+ routine_decode_eval( NULL ),
+ routine_eval( NULL ),
+ routine_decode_run( NULL ),
+ routine_run( NULL )
+ {
+ //!!! NOTHING
+ }
+
+ AvmInstruction(avm_size_t aSize)
+ : theSize( aSize ),
+ theMainBytecode( ),
+ theArgBytecode( (aSize > 0) ? new AvmBytecode[aSize] : NULL ),
+
+ routine_decode_eval( NULL ),
+ routine_eval( NULL ),
+ routine_decode_run( NULL ),
+ routine_run( NULL )
+ {
+ //!!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ explicit AvmInstruction(const AvmInstruction & anInstruction)
+ : theSize( anInstruction.theSize ),
+ theMainBytecode( anInstruction.theMainBytecode ),
+ theArgBytecode( (theSize > 0) ? new AvmBytecode[theSize] : NULL ),
+
+ routine_decode_eval( anInstruction.routine_decode_eval ),
+ routine_eval( anInstruction.routine_eval ),
+ routine_decode_run( anInstruction.routine_decode_run ),
+ routine_run( anInstruction.routine_run )
+ {
+ copy( anInstruction.theArgBytecode );
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AvmInstruction()
+ {
+ delete ( theArgBytecode );
+ }
+
+
+ /**
+ * copy
+ */
+ inline void copy(AvmBytecode * argBytecode)
+ {
+ for( avm_size_t idx = 0 ; idx < theSize ; ++idx )
+ {
+ theArgBytecode[idx] = argBytecode[idx];
+ }
+ }
+
+ inline void copy(const avm_size_t srcOffset, const avm_size_t tgtOffset)
+ {
+ theArgBytecode[tgtOffset] = theArgBytecode[srcOffset];
+ }
+
+
+ /**
+ * GETTER
+ * theSize
+ */
+ inline avm_size_t size() const
+ {
+ return( theSize );
+ }
+
+ inline bool empty() const
+ {
+ return( theSize == 0 );
+ }
+
+ inline bool nonempty() const
+ {
+ return( theSize > 0 );
+ }
+
+ inline bool singleton() const
+ {
+ return( theSize == 1 );
+ }
+
+ inline bool populated() const
+ {
+ return( theSize > 1 );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * for theMainBytecode
+ */
+ inline AvmBytecode & getMainBytecode()
+ {
+ return( theMainBytecode );
+ }
+
+ inline void setMainBytecode(AvmBytecode & aByteCode)
+ {
+ theMainBytecode = aByteCode;
+ }
+
+
+ inline void setMainBytecode(
+ avm_arg_context_t context, avm_arg_processor_t processor,
+ avm_arg_operation_t operation, avm_arg_operand_t operand,
+ BaseTypeSpecifier * dtype = NULL)
+ {
+ theMainBytecode.context = context;
+ theMainBytecode.processor = processor;
+ theMainBytecode.operation = operation;
+ theMainBytecode.operand = operand;
+ theMainBytecode.dtype = dtype;
+ }
+
+ inline void setMainBytecode(
+ avm_arg_context_t context, avm_arg_operation_t operation,
+ avm_arg_operand_t operand, BaseTypeSpecifier * dtype = NULL)
+ {
+ theMainBytecode.context = context;
+ theMainBytecode.operation = operation;
+ theMainBytecode.operand = operand;
+ theMainBytecode.dtype = dtype;
+ }
+
+ inline void setMainBytecode(
+ avm_arg_processor_t processor, avm_arg_operation_t operation,
+ avm_arg_operand_t operand, BaseTypeSpecifier * dtype = NULL)
+ {
+ theMainBytecode.processor = processor;
+ theMainBytecode.operation = operation;
+ theMainBytecode.operand = operand;
+ theMainBytecode.dtype = dtype;
+ }
+
+ inline void setMainBytecode(avm_arg_operation_t operation,
+ avm_arg_operand_t operand, BaseTypeSpecifier * dtype = NULL)
+ {
+ theMainBytecode.operation = operation;
+ theMainBytecode.operand = operand;
+ theMainBytecode.dtype = dtype;
+ }
+
+
+ inline avm_arg_context_t getMainContext() const
+ {
+ return( theMainBytecode.context );
+ }
+
+ inline void setMainContext(avm_arg_context_t context)
+ {
+ theMainBytecode.context = context;
+ }
+
+
+ inline avm_arg_processor_t getMainProcessor() const
+ {
+ return( theMainBytecode.processor );
+ }
+
+ inline void setMainProcessor(avm_arg_processor_t processor)
+ {
+ theMainBytecode.processor = processor;
+ }
+
+
+ inline avm_arg_operation_t getMainOperation() const
+ {
+ return( theMainBytecode.operation );
+ }
+
+ inline void setMainOperation(avm_arg_operation_t operation)
+ {
+ theMainBytecode.operation = operation;
+ }
+
+
+ inline avm_arg_operand_t getMainOperand() const
+ {
+ return( theMainBytecode.operand );
+ }
+
+ inline void setMainOperand(avm_arg_operand_t operand)
+ {
+ theMainBytecode.operand = operand;
+ }
+
+
+ /**
+ * theMainBytecode
+ * NOP
+ */
+ inline bool isNop() const
+ {
+ return( IS_ARG_OPERATION_NOP(theMainBytecode.operation) );
+ }
+
+ inline void setNop(avm_arg_operation_t opMask = AVM_ARG_UNDEFINED_OPERATION)
+ {
+ theMainBytecode.operation = avm_arg_operation_t(
+ theMainBytecode.operation | opMask | AVM_ARG_NOP );
+
+ theMainBytecode.operation = avm_arg_operation_t(
+ theMainBytecode.operation & (~AVM_ARG_OPERATION_EVAL_MASK) );
+ }
+
+
+ /**
+ * theMainBytecode
+ * NOPS
+ */
+ inline bool isNopCPU() const
+ {
+ return( theMainBytecode.processor == AVM_ARG_NOP_CPU );
+ }
+
+ inline bool isNops() const
+ {
+ return( IS_ARG_OPERATION_NOPS(theMainBytecode.operation) );
+ }
+
+ inline void setNops(avm_arg_operation_t opMask = AVM_ARG_UNDEFINED_OPERATION)
+ {
+ theMainBytecode.operation = avm_arg_operation_t(
+ theMainBytecode.operation | opMask | AVM_ARG_NOPS );
+
+ theMainBytecode.operation = avm_arg_operation_t(
+ theMainBytecode.operation & (~AVM_ARG_OPERATION_EVAL_MASK) );
+ }
+
+ inline void unsetNops(avm_arg_operation_t opMask = AVM_ARG_SEVAL)
+ {
+ theMainBytecode.operation = avm_arg_operation_t(
+ (theMainBytecode.operation | opMask) &
+ (~ AVM_ARG_OPERATION_NOP_MASK) );
+ }
+
+
+ /**
+ * theMainBytecode
+ * EVAL
+ * EVAL
+ */
+ inline bool isEval() const
+ {
+ return( IS_ARG_OPERATION_EVAL(theMainBytecode.operation) );
+ }
+
+ inline void unsetEval()
+ {
+ theMainBytecode.operation = avm_arg_operation_t(
+ theMainBytecode.operation & (~ AVM_ARG_OPERATION_EVAL_MASK) );
+ }
+
+
+ /**
+ * theMainBytecode
+ * SEVAL
+ */
+ inline bool isSeval() const
+ {
+ return( IS_ARG_OPERATION_SEVAL(theMainBytecode.operation) );
+ }
+
+ inline void setSeval(avm_arg_operation_t opMask = AVM_ARG_UNDEFINED_OPERATION)
+ {
+ theMainBytecode.operation = avm_arg_operation_t(
+ theMainBytecode.operation | opMask | AVM_ARG_SEVAL);
+ }
+
+ // eXclusive PREFIX bit setting
+ inline void xsetSeval(avm_arg_operation_t opMask = AVM_ARG_UNDEFINED_OPERATION)
+ {
+ theMainBytecode.operation = avm_arg_operation_t(
+ (theMainBytecode.operation | opMask) &
+ AVM_ARG_OPERATION_X_SEVAL_MASK );
+ }
+
+ inline void unsetSeval()
+ {
+ theMainBytecode.operation = avm_arg_operation_t(
+ theMainBytecode.operation & (~ AVM_ARG_SEVAL) );
+ }
+
+
+ /**
+ * theMainBytecode
+ * MEVAL
+ */
+ inline bool isMeval() const
+ {
+ return( IS_ARG_OPERATION_MEVAL(theMainBytecode.operation) );
+ }
+
+ inline void setMeval(avm_arg_operation_t opMask = AVM_ARG_UNDEFINED_OPERATION)
+ {
+ theMainBytecode.operation = avm_arg_operation_t(
+ theMainBytecode.operation | opMask | AVM_ARG_MEVAL);
+ }
+
+ // eXclusive PREFIX bit setting
+ inline void xsetMeval(avm_arg_operation_t opMask = AVM_ARG_UNDEFINED_OPERATION)
+ {
+ theMainBytecode.operation = avm_arg_operation_t(
+ (theMainBytecode.operation | opMask) &
+ AVM_ARG_OPERATION_X_MEVAL_MASK );
+ }
+
+ inline void unsetMeval()
+ {
+ theMainBytecode.operation = avm_arg_operation_t(
+ theMainBytecode.operation & (~ AVM_ARG_MEVAL) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * for theArgBytecode
+ */
+ inline AvmBytecode * getBytecode() const
+ {
+ return( theArgBytecode );
+ }
+
+ inline bool hasBytecode() const
+ {
+ return( theArgBytecode != NULL );
+ }
+
+ inline void setBytecode(AvmBytecode * anBytecode)
+ {
+ theArgBytecode = anBytecode;
+ }
+
+ /**
+ * GETTER
+ * for theArgBytecode w.r.t. an idx
+ */
+ inline AvmBytecode & operator[](avm_size_t idx)
+ {
+ return( theArgBytecode[idx] );
+ }
+
+ inline const AvmBytecode & operator[](avm_size_t idx) const
+ {
+ return( theArgBytecode[idx] );
+ }
+
+
+ inline AvmBytecode & at(const avm_size_t idx)
+ {
+ return( theArgBytecode[idx] );
+ }
+
+ inline const AvmBytecode & at(const avm_size_t idx) const
+ {
+ return( theArgBytecode[idx] );
+ }
+
+ inline AvmBytecode & get(const avm_size_t idx)
+ {
+ return( theArgBytecode[idx] );
+ }
+
+ inline const AvmBytecode & get(const avm_size_t idx) const
+ {
+ return( theArgBytecode[idx] );
+ }
+
+
+ /**
+ * SETTER
+ * for theArgBytecode w.r.t. an idx
+ */
+ inline void set(const avm_size_t idx, AvmBytecode & aByteCode)
+ {
+ theArgBytecode[idx] = aByteCode;
+ }
+
+ inline void set(const avm_size_t idx, avm_arg_context_t context,
+ avm_arg_processor_t processor, avm_arg_operation_t operation,
+ avm_arg_operand_t operand, BaseTypeSpecifier * dtype = NULL)
+ {
+ theArgBytecode[idx].context = context;
+ theArgBytecode[idx].processor = processor;
+ theArgBytecode[idx].operation = operation;
+ theArgBytecode[idx].operand = operand;
+ theArgBytecode[idx].dtype = dtype;
+ }
+
+ inline void set(const avm_size_t idx,
+ avm_arg_processor_t processor, avm_arg_operation_t operation,
+ avm_arg_operand_t operand, BaseTypeSpecifier * dtype = NULL)
+ {
+ theArgBytecode[idx].processor = processor;
+ theArgBytecode[idx].operation = operation;
+ theArgBytecode[idx].operand = operand;
+ theArgBytecode[idx].dtype = dtype;
+ }
+
+ inline void set(const avm_size_t idx, avm_arg_operation_t operation,
+ avm_arg_operand_t operand, BaseTypeSpecifier * dtype = NULL)
+ {
+ theArgBytecode[idx].operation = operation;
+ theArgBytecode[idx].operand = operand;
+ theArgBytecode[idx].dtype = dtype;
+ }
+
+
+ inline avm_arg_context_t context(const avm_size_t idx)
+ {
+ return( theArgBytecode[idx].context );
+ }
+
+ inline void context(const avm_size_t idx, avm_arg_context_t context)
+ {
+ theArgBytecode[idx].context = context;
+ }
+
+
+ inline avm_arg_processor_t processor(const avm_size_t idx)
+ {
+ return( theArgBytecode[idx].processor );
+ }
+
+ inline void processor(const avm_size_t idx, avm_arg_processor_t processor)
+ {
+ theArgBytecode[idx].processor = processor;
+ }
+
+
+ inline avm_arg_operation_t operation(const avm_size_t idx)
+ {
+ return( theArgBytecode[idx].operation );
+ }
+
+ inline void operation(const avm_size_t idx, avm_arg_operation_t operation)
+ {
+ theArgBytecode[idx].operation = operation;
+ }
+
+
+ inline avm_arg_operand_t operand(const avm_size_t idx)
+ {
+ return( theArgBytecode[idx].operand );
+ }
+
+ inline void operand(const avm_size_t idx, avm_arg_operand_t operand)
+ {
+ theArgBytecode[idx].operand = operand;
+ }
+
+
+
+ inline avm_size_t offset(const avm_size_t idx)
+ {
+ return( theArgBytecode[idx].offset );
+ }
+
+ inline void offset(const avm_size_t idx, avm_size_t offset)
+ {
+ theArgBytecode[idx].offset = offset;
+ }
+
+
+ inline BaseTypeSpecifier * dtype(const avm_size_t idx)
+ {
+ return( theArgBytecode[idx].dtype );
+ }
+
+ inline void dtype(const avm_size_t idx, BaseTypeSpecifier * dtype)
+ {
+ theArgBytecode[idx].dtype = dtype;
+ }
+
+
+ /**
+ * compute main bytecode
+ * NOPS or EVALS
+ */
+ void computeMainBytecode(
+ bool updateMainByteCodeIfNOPS, avm_arg_operation_t opMask);
+
+ inline void computeMainBytecode(avm_arg_context_t aContext,
+ avm_arg_processor_t aProcessor, avm_arg_operation_t anOperation,
+ avm_arg_operand_t anOperand, BaseTypeSpecifier * aType = NULL)
+ {
+ theMainBytecode.context = aContext;
+ theMainBytecode.processor = aProcessor;
+ theMainBytecode.operation = anOperation;
+ theMainBytecode.operand = anOperand;
+ theMainBytecode.dtype = aType;
+
+ computeMainBytecode(true, AVM_ARG_UNDEFINED_OPERATION);
+ }
+
+ inline void computeMainBytecode(avm_size_t refBytecodeOffset)
+ {
+ theMainBytecode = theArgBytecode[ refBytecodeOffset ];
+
+ computeMainBytecode(true, AVM_ARG_UNDEFINED_OPERATION);
+ }
+
+
+ void computeBytecode(bool updateMainByteCodeIfNOPS,
+ const Vector< AvmBytecode > & vectorOfArgOpcode);
+
+
+ /**
+ * nops bytecode
+ */
+ static AvmInstruction * nopsUnaryCode(avm_arg_operand_t operand);
+
+
+ /**
+ ***************************************************************************
+ * SERIALIZATION
+ ***************************************************************************
+ */
+ void toStream(OutStream & os) const;
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ avm_size_t theSize;
+
+ AvmBytecode theMainBytecode;
+
+ AvmBytecode * theArgBytecode;
+
+
+public:
+ ////////////////////////////////////////////////////////////////////////////
+ // optimize API for << [decode] eval >> routine
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool (* routine_decode_eval)(AvmInstruction *, ARGS_ENV &, const BF &);
+
+ inline bool decode_eval(ARGS_ENV & argENV, const BF & arg)
+ {
+ return( routine_decode_eval(this, argENV, arg) );
+ }
+
+
+ bool (* routine_eval)(AvmInstruction *, ARGS_ENV &, AvmCode *);
+
+ inline bool eval(ARGS_ENV & argENV, AvmCode * aCode)
+ {
+ return( routine_eval(this, argENV, aCode) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // optimize API for << [decode] rrun >> routine
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool (* routine_decode_run)(AvmInstruction *, ARGS_ENV &, const BF &);
+
+ inline bool decode_run(ARGS_ENV & argENV, const BF & arg)
+ {
+ return( routine_decode_run(this, argENV, arg) );
+ }
+
+
+ bool (* routine_run)(AvmInstruction *, ARGS_ENV & argENV, AvmCode *);
+
+ inline bool run(ARGS_ENV & argENV, AvmCode * aCode)
+ {
+ return( routine_run(this, argENV, aCode) );
+ }
+
+
+};
+
+
+} /* namespace sep */
+
+#endif /* AVMINSTRUCTION_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/instruction/InstructionEnvironment.cpp b/org.eclipse.efm.symbex/src/computer/instruction/InstructionEnvironment.cpp
new file mode 100644
index 0000000..af5b588
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/instruction/InstructionEnvironment.cpp
@@ -0,0 +1,4570 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 16 avr. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "InstructionEnvironment.h"
+
+#include <sstream>
+
+#include <builder/Builder.h>
+
+#include <computer/BaseEnvironment.h>
+#include <computer/EvaluationEnvironment.h>
+#include <computer/ExecutionDataFactory.h>
+
+#include <computer/instruction/AvmInstruction.h>
+
+#include <fml/buffer/BaseBufferForm.h>
+
+#include <fml/executable/ExecutableLib.h>
+#include <fml/executable/InstanceOfBuffer.h>
+#include <fml/executable/InstanceOfConnect.h>
+#include <fml/executable/InstanceOfData.h>
+#include <fml/executable/InstanceOfMachine.h>
+#include <fml/executable/InstanceOfPort.h>
+
+#include <fml/operator/Operator.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/BuiltinArray.h>
+#include <fml/expression/BuiltinQueue.h>
+#include <fml/builtin/Character.h>
+#include <fml/expression/ExpressionComparer.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/ExpressionConstructorImpl.h>
+#include <fml/expression/StatementFactory.h>
+#include <fml/builtin/String.h>
+
+#include <fml/runtime/ExecutionConfiguration.h>
+#include <fml/runtime/LocalRuntime.h>
+#include <fml/runtime/RuntimeLib.h>
+
+#include <fml/type/ContainerTypeSpecifier.h>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+InstructionEnvironment::InstructionEnvironment(BaseEnvironment & ENV)
+: AvmObject( ),
+mARG( newARGS(&ENV, ENV.inED, ENV.inCODE->size()) ),
+itARG( mARG )
+{
+ //!! NOTHING
+}
+
+InstructionEnvironment::InstructionEnvironment(
+ BaseEnvironment & ENV, avm_size_t count)
+: AvmObject( ),
+mARG( newARGS(&ENV, ENV.inED, count) ),
+itARG( mARG )
+{
+ //!! NOTHING
+}
+
+
+///////////////////////////////////////////////////////////////////////////
+// CACHE MANAGER
+///////////////////////////////////////////////////////////////////////////
+
+List< ARGS_ENV * > InstructionEnvironment::ARGS_ENV_CACHE;
+
+
+void InstructionEnvironment::initCache()
+{
+ for( avm_size_t offset = 0 ;
+ offset < ARGS_ENV_INITIAL_CACHE_COUNT ; ++offset )
+ {
+ ARGS_ENV_CACHE.append( new ARGS_ENV(NULL, APExecutionData::REF_NULL,
+ ARGS_ENV_DEFAULT_CAPACITY, 0) );
+ }
+}
+
+
+void InstructionEnvironment::finalizeCache()
+{
+ avm_size_t finalCacheSize = 0;
+
+ while( ARGS_ENV_CACHE.nonempty() )
+ {
+//AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+// AVM_OS_TRACE << "ARGS_ENV::finalize:> @"
+// << avm_address_t( ARGS_ENV_CACHE.last() ) << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+
+ ++finalCacheSize;
+ delete( ARGS_ENV_CACHE.pop_last() );
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , STATEMENT )
+ AVM_OS_TRACE << "ARGS_ENV::finalize#cache:> count = " << finalCacheSize
+ << std::endl;
+
+ AVM_OS_TRACE << "ARGS_ENV::CALL:> count = "
+ << ARGS_ENV::CALL_COUNT << std::endl
+ << "ARGS_ENV::CALL<GiNaC:> count = "
+ << ARGS_ENV::CALL_COUNT_GINAC << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , STATEMENT )
+}
+
+
+ARGS_ENV * InstructionEnvironment::newARGS(BaseEnvironment * ENV,
+ const APExecutionData & anED, avm_size_t count)
+{
+ ARGS_ENV * arg = NULL;
+
+ if( ARGS_ENV_CACHE.nonempty() &&
+ (ARGS_ENV_CACHE.last()->capacity > count) )
+ {
+ ARGS_ENV_CACHE.pop_last_to( arg );
+
+ arg->ENV = ENV;
+ arg->outED = anED;
+
+ arg->table.resize( arg->count = count );
+ arg->values = & ( arg->table );
+
+ arg->idx = 0;
+ arg->NEXT = NULL;
+ }
+ else
+ {
+ arg = new ARGS_ENV(ENV, anED, count + ARGS_ENV_INCR_CAPACITY, count);
+
+ AVM_OS_ASSERT_OUT_OF_MEMORY_EXIT( arg )
+ << "BaseEnvironment::newARGS !!!"
+ << SEND_EXIT;
+ }
+
+//AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+// AVM_OS_TRACE << "ARGS_ENV::new:> @" << avm_address_t( arg )
+// << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+
+ return( arg );
+}
+
+
+void InstructionEnvironment::freeARGS(ARGS_ENV * & arg)
+{
+ if( arg->NEXT == NULL )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ AVM_OS_TRACE << "ARGS_ENV::free:> @" << avm_address_t( arg )
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ ARGS_ENV_CACHE.append( arg );
+ }
+ else
+ {
+ for( ARGS_ENV * nextArg = arg ; arg != NULL ; arg = nextArg )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ AVM_OS_TRACE << "ARGS_ENV::free:> @" << avm_address_t( arg )
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+
+ nextArg = arg->NEXT;
+ arg->NEXT = NULL;
+ ARGS_ENV_CACHE.append( arg );
+ }
+ }
+
+ arg = NULL;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// DECODE EVAL
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+avm_size_t ARGS_ENV::CALL_COUNT = 0;
+
+avm_size_t ARGS_ENV::CALL_COUNT_GINAC = 0;
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// DECODE EVAL CONTEXT
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool ARGS_ENV::main_decode_eval(BFCode & inCODE)
+{
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( inCODE->hasInstruction() )
+ << "ARGS_ENV::main_decode_eval :> "
+ "Unexpected a code without instruction !!!"
+ << SEND_EXIT;
+
+ if( (argsInstruction = inCODE->getInstruction())->isNopCPU() )
+ {
+ current( inCODE );
+
+ return( true );
+ }
+ else
+ {
+ argsBytecode = argsInstruction->getBytecode();
+
+ return( decode_eval_processor( argsInstruction->getMainBytecode(),
+ inCODE->to< AvmCode >() ) );
+ }
+}
+
+
+bool ARGS_ENV::main_decode_eval_args(AvmCode * inCODE)
+{
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( count == inCODE->size() )
+ << "Invalid statement ARGUMENTS initialization !!!\n"
+ << inCODE->toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ argsInstruction = inCODE->getInstruction();
+ if( (argsInstruction == NULL) || argsInstruction->isNops() ||
+ (argsBytecode = argsInstruction->getBytecode())[0].isNopsOperation() )
+ {
+ values = &( inCODE->getArgs() );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ AVM_OS_TRACE << "args[nops]:>>" << AVM_STR_INDENT;
+ argsStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << END_INDENT_EOL;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+
+ return( true );
+ }
+
+ else switch( argsInstruction->getMainContext() )
+ {
+ case AVM_ARG_STANDARD_CTX:
+ {
+ return( decode_eval_args_processor(
+ argsInstruction->getMainBytecode(), inCODE) );
+ }
+
+ case AVM_ARG_ARGUMENT_CTX:
+ case AVM_ARG_PARAMETER_CTX:
+ case AVM_ARG_RETURN_CTX:
+ {
+ return( decode_eval_args_processor(
+ argsInstruction->getMainBytecode(), inCODE) );
+ }
+
+ case AVM_ARG_UNDEFINED_CONTEXT:
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+bool ARGS_ENV::decode_eval_args_context(
+ AvmBytecode & bytecode, AvmCode * inCODE)
+{
+// AVM_OS_ASSERT_FATAL_ERROR_EXIT( count == inCODE->size() )
+// << "Invalid statement ARGUMENTS initialization !!!\n"
+// << inCODE->toString( AVM_TAB1_INDENT )
+// << SEND_EXIT;
+//
+// argsInstruction = inCODE->getInstruction();
+// if( (argsInstruction == NULL) || argsInstruction->isNops() ||
+// (argsBytecode = argsInstruction->getBytecode())[0].isNops() )
+// {
+// values = &( inCODE->getArgs() );
+//
+// return( true );
+// }
+
+ switch( bytecode.context )
+ {
+ case AVM_ARG_STANDARD_CTX:
+ {
+ return( decode_eval_args_processor(bytecode, inCODE) );
+ }
+
+ case AVM_ARG_ARGUMENT_CTX:
+ case AVM_ARG_PARAMETER_CTX:
+ case AVM_ARG_RETURN_CTX:
+ {
+ return( decode_eval_args_processor(bytecode, inCODE) );
+ }
+
+ case AVM_ARG_UNDEFINED_CONTEXT:
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// DECODE EVAL PROCESSOR
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool ARGS_ENV::decode_eval_args_processor(
+ AvmBytecode & bytecode, AvmCode * inCODE)
+{
+ avm_size_t CURRENT_CALL_COUNT;
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ CURRENT_CALL_COUNT = ++ARGS_ENV::CALL_COUNT;
+
+ AVM_OS_TRACE << "args[" << CURRENT_CALL_COUNT << "]:<< ";
+ inCODE->toDebug( AVM_OS_TRACE << AVM_SPC_INDENT ) << END_INDENT_EOL;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+
+ argsBytecode = (argsInstruction = inCODE->getInstruction())->getBytecode();
+
+ if( argsInstruction->isNops() || argsBytecode[0].isNopsOperation() )
+ {
+ values = &( inCODE->getArgs() );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ AVM_OS_TRACE << "args[nops:" << CURRENT_CALL_COUNT << ">]:>>";
+ argsStream( AVM_OS_TRACE << AVM_STR_INDENT );
+ AVM_OS_TRACE << END_INDENT_EOL;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+
+ return( true );
+ }
+
+ AvmCode::iterator it = inCODE->begin();
+ for( begin() ; hasNext() ; ++it , next() )
+ {
+ switch( argsBytecode[idx].processor )
+ {
+ case AVM_ARG_NOP_CPU:
+ {
+ current( *it );
+
+ break;
+ }
+ case AVM_ARG_NOPS_CPU:
+ {
+ current_next( *it );
+ for( ++it ; hasNext() ; ++it )
+ {
+ current_next( *it );
+ }
+
+ break;
+ }
+
+ case AVM_ARG_MEMORY_LVALUE_CPU:
+ {
+ if( eval_processor_dma_lvalue(argsBytecode[idx], *it) )
+ {
+ break;
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ case AVM_ARG_MEMORY_WVALUE_CPU:
+ {
+ if( eval_processor_dma_wvalue(argsBytecode[idx], *it) )
+ {
+ break;
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ case AVM_ARG_MEMORY_RVALUE_CPU:
+ {
+ if( eval_processor_dma_rvalue(argsBytecode[idx], *it) )
+ {
+ break;
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ case AVM_ARG_MEMORY_MACHINE_CPU:
+ {
+ if( eval_processor_dma_machine(argsBytecode[idx], *it) )
+ {
+ break;
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ case AVM_ARG_ARITHMETIC_LOGIC_CPU:
+ {
+ if( eval_processor_alu(argsBytecode[idx], *it) )
+ {
+ break;
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+
+ case AVM_ARG_CHARACTER_CPU:
+ {
+ if( eval_processor_character(argsBytecode[idx], *it) )
+ {
+ break;
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ case AVM_ARG_STRING_CPU:
+ {
+ if( eval_processor_string(argsBytecode[idx], *it) )
+ {
+ break;
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ case AVM_ARG_ARRAY_LVALUE_CPU:
+ {
+ if( eval_processor_array_lvalue(argsBytecode[idx], *it) )
+ {
+ break;
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ case AVM_ARG_ARRAY_RVALUE_CPU:
+ {
+ if( eval_processor_array_rvalue(argsBytecode[idx], *it) )
+ {
+ break;
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ case AVM_ARG_VECTOR_CPU:
+ {
+ if( eval_processor_vector(argsBytecode[idx], *it) )
+ {
+ break;
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ case AVM_ARG_QUEUE_CPU:
+ case AVM_ARG_LIST_CPU:
+ case AVM_ARG_COLLECTION_CPU:
+ {
+ if( eval_processor_collection(argsBytecode[idx], *it) )
+ {
+ break;
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ case AVM_ARG_BUFFER_CPU:
+ {
+ if( eval_processor_buffer(argsBytecode[idx], *it) )
+ {
+ break;
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ case AVM_ARG_STATEMENT_CPU:
+ {
+ if( eval_processor_statement(
+ argsBytecode[idx], (*it).to_ptr< AvmCode >()) )
+ {
+ break;
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ case AVM_ARG_UNDEFINED_PROCESSOR:
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::decode_eval_processor :> "
+ "Unexpected bytecode<processor> << "
+ << argsBytecode[idx].strCode()
+ << " >> for : " << (*it).str() << " !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ AVM_OS_TRACE << "args[" << CURRENT_CALL_COUNT << "]:>>" << AVM_STR_INDENT;
+ argsStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << END_INDENT_EOL;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+
+ return( true );
+}
+
+
+bool ARGS_ENV::decode_eval_processor(
+ AvmBytecode & bytecode, AvmCode * inCODE)
+{
+ switch( bytecode.processor )
+ {
+// case AVM_ARG_NO_OPERATION_CPU:
+// {
+// current( inCODE );
+//
+// return( true );
+// }
+//
+// case AVM_ARG_MEMORY_LVALUE_CPU:
+// {
+// return( eval_processor_dma_lvalue(bytecode, inCODE) );
+// }
+//
+// case AVM_ARG_MEMORY_WVALUE_CPU:
+// {
+// return( eval_processor_dma_wvalue(bytecode, inCODE) );
+// }
+
+ case AVM_ARG_MEMORY_RVALUE_CPU:
+ {
+ return( eval_processor_dma_rvalue(bytecode, inCODE) );
+ }
+
+ case AVM_ARG_MEMORY_MACHINE_CPU:
+ {
+ return( eval_processor_dma_machine(bytecode, inCODE) );
+ }
+
+ case AVM_ARG_ARITHMETIC_LOGIC_CPU:
+ {
+ return( eval_processor_alu(bytecode, inCODE) );
+ }
+
+
+ case AVM_ARG_CHARACTER_CPU:
+ {
+ return( eval_processor_character(bytecode, inCODE) );
+ }
+
+ case AVM_ARG_STRING_CPU:
+ {
+ return( eval_processor_string(bytecode, inCODE) );
+ }
+
+// case AVM_ARG_ARRAY_LVALUE_CPU:
+// {
+// return( eval_processor_array_lvalue(bytecode, inCODE) );
+// }
+// case AVM_ARG_ARRAY_RVALUE_CPU:
+// {
+// return( eval_processor_array_rvalue(bytecode, inCODE) );
+// }
+
+ case AVM_ARG_VECTOR_CPU:
+ {
+ return( eval_processor_vector(bytecode, inCODE) );
+ }
+
+ case AVM_ARG_QUEUE_CPU:
+ case AVM_ARG_LIST_CPU:
+ case AVM_ARG_COLLECTION_CPU:
+ {
+ return( eval_processor_collection(bytecode, inCODE) );
+ }
+
+ case AVM_ARG_BUFFER_CPU:
+ {
+ return( eval_processor_buffer(bytecode, inCODE) );
+ }
+
+ case AVM_ARG_STATEMENT_CPU:
+ {
+ return( eval_processor_statement(bytecode, inCODE) );
+ }
+
+ case AVM_ARG_UNDEFINED_PROCESSOR:
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::decode_eval_processor :> "
+ "Unexpected bytecode<processor> << "
+ << bytecode.strCode() << " >> for : "
+ << inCODE->strDebug() << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+}
+
+
+bool ARGS_ENV::decode_eval_processor(AvmBytecode & bytecode, BF & arg)
+{
+ switch( bytecode.processor )
+ {
+ case AVM_ARG_NOP_CPU:
+ case AVM_ARG_NOPS_CPU:
+ {
+ current( arg );
+
+ return( true );
+ }
+
+ case AVM_ARG_MEMORY_LVALUE_CPU:
+ {
+ return( eval_processor_dma_lvalue(bytecode, arg) );
+ }
+
+ case AVM_ARG_MEMORY_WVALUE_CPU:
+ {
+ return( eval_processor_dma_wvalue(bytecode, arg) );
+ }
+
+ case AVM_ARG_MEMORY_RVALUE_CPU:
+ {
+ return( eval_processor_dma_rvalue(bytecode, arg) );
+ }
+
+ case AVM_ARG_MEMORY_MACHINE_CPU:
+ {
+ return( eval_processor_dma_machine(bytecode, arg) );
+ }
+
+ case AVM_ARG_ARITHMETIC_LOGIC_CPU:
+ {
+ return( eval_processor_alu(bytecode, arg) );
+ }
+
+
+ case AVM_ARG_CHARACTER_CPU:
+ {
+ return( eval_processor_character(bytecode, arg) );
+ }
+
+ case AVM_ARG_STRING_CPU:
+ {
+ return( eval_processor_string(bytecode, arg) );
+ }
+
+ case AVM_ARG_ARRAY_LVALUE_CPU:
+ {
+ return( eval_processor_array_lvalue(bytecode, arg) );
+ }
+ case AVM_ARG_ARRAY_RVALUE_CPU:
+ {
+ return( eval_processor_array_rvalue(bytecode, arg) );
+ }
+
+ case AVM_ARG_VECTOR_CPU:
+ {
+ return( eval_processor_vector(bytecode, arg) );
+ }
+
+ case AVM_ARG_QUEUE_CPU:
+ case AVM_ARG_LIST_CPU:
+ case AVM_ARG_COLLECTION_CPU:
+ {
+ return( eval_processor_collection(bytecode, arg) );
+ }
+
+ case AVM_ARG_BUFFER_CPU:
+ {
+ return( eval_processor_buffer(bytecode, arg) );
+ }
+
+ case AVM_ARG_STATEMENT_CPU:
+ {
+ return( eval_processor_statement(
+ bytecode, (arg).to_ptr< AvmCode >()) );
+ }
+
+ case AVM_ARG_UNDEFINED_PROCESSOR:
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::decode_eval_processor :> "
+ "Unexpected bytecode<processor> << "
+ << bytecode.strCode() << " >> for : "
+ << arg.str() << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+}
+
+
+BF ARGS_ENV::return_decode_eval_processor(AvmBytecode & bytecode, BF & arg)
+{
+ InstructionEnvironment EVAL_ARG(ENV, outED, 1);
+ if( EVAL_ARG.mARG->decode_eval_processor(bytecode, arg) )
+ {
+ return( EVAL_ARG.mARG->at(0) );
+ }
+ else
+ {
+ return( arg );
+ }
+}
+
+bool ARGS_ENV::decode_eval_processor(BFCode & aCode)
+{
+ if( not aCode->hasInstruction() )
+ {
+ if( not ENV->getBuilder().getAvmcodeCompiler().optimizeEvalExpression(
+ ENV->inED->getParametersRID().getExecutable(), aCode) )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::decode_eval_processor :> "
+ "Unexpected a code without instruction << "
+ << aCode->str() << " >> !!!"
+ << SEND_EXIT;
+ }
+ }
+
+ return( decode_eval_processor(
+ aCode->getInstruction()->getMainBytecode(), aCode) );
+}
+
+BF ARGS_ENV::return_decode_eval_processor(BFCode & aCode)
+{
+ InstructionEnvironment EVAL_ARG(ENV, outED, 1);
+ if( EVAL_ARG.mARG->decode_eval_processor(aCode) )
+ {
+ return( EVAL_ARG.mARG->at(0) );
+ }
+ else
+ {
+ return( BF::REF_NULL );
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// EVAL PROCESSOR MEMORY UFI POINTER
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * EVAL PROCESSOR < AVM_ARG_MEMORY_UFI_POINTER_CPU >
+ */
+bool ARGS_ENV::eval_processor_dma_lvalue_ufi_pointer(
+ AvmBytecode & bytecode, BF & arg)
+{
+ InstanceOfData * lvalue = arg.to_ptr< InstanceOfData >();
+
+ avm_size_t * aRelativeOffsetPath =
+ new avm_size_t[ lvalue->getDataPath()->size() + 1 ];
+
+ InstanceOfData * aRoot = lvalue;
+ if( lvalue->getModifier().hasNatureReference() )
+ {
+ aRoot = ENV->getRvalue(outED, lvalue->getAliasTarget()->to<
+ InstanceOfData >()).as_ptr< InstanceOfData >();
+ }
+
+ aRelativeOffsetPath[0] = aRoot->getOffset();
+
+ InstanceOfData * ptrValue =
+ new InstanceOfData(lvalue, aRoot, aRelativeOffsetPath);
+
+ current( BF( ptrValue ) );
+
+ // For Array Value Size
+ BF rvalue;
+
+ if( ptrValue->hasRuntimeContainerRID() )
+ {
+ rvalue = outED->getRuntime( ptrValue->getRuntimeContainerRID() ).
+ getData( ptrValue->getOffset() );
+ }
+ else
+ {
+ RuntimeID aDataRID;
+
+ if( ENV->getRuntimeForm(outED, outED->mRID, ptrValue, aDataRID) )
+ {
+ ptrValue->setRuntimeContainerRID( aDataRID );
+
+ rvalue = outED->getRuntime(aDataRID).getData( ptrValue->getOffset() );
+ }
+ else
+ {
+ LocalRuntime aLocalRuntime;
+ if( ENV->getRuntimeForm(outED, lvalue, aLocalRuntime) )
+ {
+ rvalue = aLocalRuntime.getDataTable().at( ptrValue->getOffset() );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_dma_lvalue_ufi_pointer:> "
+ "Failed to found data table for the "
+ "instance of data :>\n"
+ << ptrValue->toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ current( arg );
+
+ return( false );
+ }
+ }
+ }
+
+ TableOfSymbol::iterator itPath = lvalue->getDataPath()->begin();
+ TableOfSymbol::iterator endPath = lvalue->getDataPath()->end();
+ for( avm_size_t k = 1 ; itPath != endPath ; ++k, ++itPath )
+ {
+ switch( (*itPath).getPointerNature() )
+ {
+ case IPointerDataNature::POINTER_FIELD_CLASS_ATTRIBUTE_NATURE:
+ case IPointerDataNature::POINTER_FIELD_ARRAY_OFFSET_NATURE:
+ {
+ aRelativeOffsetPath[k] = (*itPath).getOffset();
+
+ break;
+ }
+ case IPointerDataNature::POINTER_FIELD_ARRAY_INDEX_NATURE:
+ {
+ BF bfOffset = return_decode_eval_rvalue( (*itPath).getValue() );
+ if( bfOffset.invalid() )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Failed to eval ARRAY index << "
+ << (*itPath).strValue()
+ << " >> in variable << " << (*itPath).str()
+ << " >> for writing in VVT !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ if( bfOffset.isNumeric() )
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_OFFSET_EXIT( bfOffset.toInteger(),
+ static_cast< avm_integer_t >(rvalue.size()) )
+ << "Failed to write in ARRAY with index << "
+ << bfOffset.toInteger() << " >> in variable << "
+ << lvalue->str() << " >> for writing in VVT !!!"
+ << SEND_EXIT;
+
+ aRelativeOffsetPath[k] = bfOffset.toInteger();
+
+ break;
+ }
+
+ else
+ {
+ avm_size_t offset = ENV->genNumericOffset(
+ outED, outED->mRID, (*itPath),
+ bfOffset, 0, (rvalue.size() - 1) );
+
+ if( offset != AVM_NUMERIC_MAX_SIZE_T )
+ {
+ aRelativeOffsetPath[k] = offset;
+
+ break;
+ }
+ }
+
+ outED.mwsetAEES( AEES_SYMBOLIC_EXECUTION_LIMITATION );
+
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BaseEnvironment::setData:> "
+ "unexpected NON-INTEGER ARRAY INDEX << "
+ << bfOffset.str() << " >> in instance FQN-ID :>\n"
+ << lvalue->toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ return( false );
+ }
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_dma_lvalue_ufi_pointer:> "
+ "Unexpected POINTER NATURE for the instance of data :>\n"
+ << lvalue->toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+
+ rvalue.moveAt( aRelativeOffsetPath[k] );
+
+ if( (*itPath).getModifier().hasNatureReference() )
+ {
+ rvalue = ENV->getRvalue(outED, rvalue.as_ptr< InstanceOfData >() );
+ }
+ }
+
+ return( true );
+}
+
+
+bool ARGS_ENV::eval_processor_dma_wvalue_ufi_pointer(
+ AvmBytecode & bytecode, BF & arg)
+{
+ InstanceOfData * lvalue = arg.to_ptr< InstanceOfData >();
+
+ TableOfSymbol::iterator itPath = lvalue->getDataPath()->begin();
+ TableOfSymbol::iterator endPath = lvalue->getDataPath()->end();
+
+ if( lvalue->getModifier().hasNatureReference() )
+ {
+ lvalue = ENV->getRvalue(outED, lvalue->getAliasTarget()->to<
+ InstanceOfData >()).as_ptr< InstanceOfData >();
+ }
+
+ // For Array Value Size
+ BF rvalue;
+
+ if( lvalue->hasRuntimeContainerRID() )
+ {
+ rvalue = outED.getWritableRuntime(
+ lvalue->getRuntimeContainerRID() ).
+ getWritableData( lvalue->getOffset() );
+ }
+ else
+ {
+ RuntimeID aDataRID;
+
+ if( ENV->getRuntimeForm(outED, outED->mRID, lvalue, aDataRID) )
+ {
+ rvalue = outED.getWritableRuntimeDataTable(aDataRID)->
+ getWritable( lvalue->getOffset() );
+ }
+ else
+ {
+ LocalRuntime aLocalRuntime;
+ if( ENV->getRuntimeForm(outED, lvalue, aLocalRuntime) )
+ {
+ outED.makeModifiableLocalRuntime( aLocalRuntime );
+
+ rvalue = aLocalRuntime.getDataTable().
+ getWritable( lvalue->getOffset() );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_dma_rvalue_ufi_pointer:> "
+ "Failed to found data table for the "
+ "instance of data :>\n"
+ << lvalue->toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ current( arg );
+
+ return( false );
+ }
+ }
+ }
+
+ for( avm_size_t offset = 0; itPath != endPath ; ++itPath )
+ {
+ switch( (*itPath).getPointerNature() )
+ {
+ case IPointerDataNature::POINTER_FIELD_CLASS_ATTRIBUTE_NATURE:
+ case IPointerDataNature::POINTER_FIELD_ARRAY_OFFSET_NATURE:
+ {
+ offset = (*itPath).getOffset();
+
+ break;
+ }
+ case IPointerDataNature::POINTER_FIELD_ARRAY_INDEX_NATURE:
+ {
+ BF bfOffset = return_decode_eval_rvalue( (*itPath).getValue() );
+ if( bfOffset.invalid() )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Failed to eval ARRAY index << "
+ << (*itPath).strValue()
+ << " >> in variable << " << (*itPath).str()
+ << " >> for writing in VVT !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ if( bfOffset.isNumeric() )
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_OFFSET_EXIT( bfOffset.toInteger(),
+ static_cast< avm_integer_t >(rvalue.size()) )
+ << "Failed to write in ARRAY with index << "
+ << bfOffset.toInteger() << " >> in variable << "
+ << lvalue->str() << " >> for writing in VVT !!!"
+ << SEND_EXIT;
+
+ offset = bfOffset.toInteger();
+
+ break;
+ }
+
+ else
+ {
+ offset = ENV->genNumericOffset( outED, outED->mRID,
+ (*itPath), bfOffset, 0, (rvalue.size() - 1) );
+
+ if( offset != AVM_NUMERIC_MAX_SIZE_T )
+ {
+ break;
+ }
+ }
+
+ outED.mwsetAEES( AEES_SYMBOLIC_EXECUTION_LIMITATION );
+
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BaseEnvironment::setData:> "
+ "unexpected NON-INTEGER ARRAY INDEX << "
+ << bfOffset.str() << " >> in instance FQN-ID :>\n"
+ << lvalue->toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ return( false );
+ }
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_dma_wvalue_ufi_pointer:> "
+ "Unexpected POINTER NATURE for the instance of data :>\n"
+ << lvalue->toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+
+ rvalue.moveAtWritable( offset );
+
+ if( (*itPath).getModifier().hasNatureReference() )
+ {
+ rvalue = ENV->getWvalue(outED, rvalue.as_ptr< InstanceOfData >() );
+ }
+ }
+
+ current( rvalue );
+
+ return( true );
+}
+
+
+bool ARGS_ENV::eval_processor_dma_rvalue_ufi_pointer(
+ AvmBytecode & bytecode, BF & arg)
+{
+ InstanceOfData * lvalue = arg.to_ptr< InstanceOfData >();
+
+ TableOfSymbol::iterator itPath = lvalue->getDataPath()->begin();
+ TableOfSymbol::iterator endPath = lvalue->getDataPath()->end();
+
+ if( lvalue->getModifier().hasNatureReference() )
+ {
+ lvalue = ENV->getRvalue(outED, lvalue->getAliasTarget()->to<
+ InstanceOfData >()).as_ptr< InstanceOfData >();
+ }
+
+ // For Array Value Size
+ BF rvalue;
+
+ if( lvalue->hasRuntimeContainerRID() )
+ {
+ rvalue = outED->getRuntime( lvalue->getRuntimeContainerRID() ).
+ getData( lvalue->getOffset() );
+ }
+ else
+ {
+ RuntimeID aDataRID;
+
+ if( ENV->getRuntimeForm(outED, outED->mRID, lvalue, aDataRID) )
+ {
+ rvalue = outED->getRuntime(aDataRID).getData( lvalue->getOffset() );
+ }
+ else
+ {
+ LocalRuntime aLocalRuntime;
+ if( ENV->getRuntimeForm(outED, lvalue, aLocalRuntime) )
+ {
+ rvalue = aLocalRuntime.getDataTable().at( lvalue->getOffset() );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_dma_rvalue_ufi_pointer:> "
+ "Failed to found data table for the "
+ "instance of data :>\n"
+ << lvalue->toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ current( arg );
+
+ return( false );
+ }
+ }
+ }
+
+ for( avm_size_t offset = 0; itPath != endPath ; ++itPath )
+ {
+ switch( (*itPath).getPointerNature() )
+ {
+ case IPointerDataNature::POINTER_FIELD_CLASS_ATTRIBUTE_NATURE:
+ case IPointerDataNature::POINTER_FIELD_ARRAY_OFFSET_NATURE:
+ {
+ offset = (*itPath).getOffset();
+
+ break;
+ }
+ case IPointerDataNature::POINTER_FIELD_ARRAY_INDEX_NATURE:
+ {
+ BF bfOffset = return_decode_eval_rvalue( (*itPath).getValue() );
+ if( bfOffset.invalid() )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Failed to eval ARRAY index << "
+ << (*itPath).strValue()
+ << " >> in variable << " << (*itPath).str()
+ << " >> for writing in VVT !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ if( bfOffset.isNumeric() )
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_OFFSET_EXIT( bfOffset.toInteger(),
+ static_cast< avm_integer_t >(rvalue.size()) )
+ << "Failed to write in ARRAY with index << "
+ << bfOffset.toInteger() << " >> in variable << "
+ << lvalue->str() << " >> for writing in VVT !!!"
+ << SEND_EXIT;
+
+ offset = bfOffset.toInteger();
+
+ break;
+ }
+
+ else
+ {
+ offset = ENV->genNumericOffset(outED, outED->mRID,
+ (*itPath), bfOffset, 0, (rvalue.size() - 1) );
+
+ if( offset != AVM_NUMERIC_MAX_SIZE_T )
+ {
+ break;
+ }
+ }
+
+ outED.mwsetAEES( AEES_SYMBOLIC_EXECUTION_LIMITATION );
+
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BaseEnvironment::setData:> "
+ "unexpected NON-INTEGER ARRAY INDEX << "
+ << bfOffset.str() << " >> in instance FQN-ID :>\n"
+ << lvalue->toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ return( false );
+ }
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_dma_rvalue_ufi_pointer:> "
+ "Unexpected POINTER NATURE for the instance of data :>\n"
+ << lvalue->toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+
+ rvalue.moveAt( offset );
+
+ if( (*itPath).getModifier().hasNatureReference() )
+ {
+ rvalue = ENV->getRvalue(outED, rvalue.as_ptr< InstanceOfData >() );
+ }
+ }
+
+ current( rvalue );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// EVAL PROCESSOR MEMORY LVALUE
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * EVAL PROCESSOR < AVM_ARG_MEMORY_LVALUE_CPU >
+ */
+bool ARGS_ENV::eval_processor_dma_lvalue(AvmBytecode & bytecode, BF & arg)
+{
+ switch( bytecode.operand )
+ {
+ case AVM_ARG_DATA_KIND:
+ {
+ current( arg );
+
+ return( true );
+ }
+
+ case AVM_ARG_DATA_REF_KIND:
+ {
+ current( ENV->getRvalue(outED, arg.to_ptr< InstanceOfData >()) );
+
+ return( true );
+ }
+
+ case AVM_ARG_DATA_MACRO_KIND:
+ {
+ const BF & lvalue =
+ ENV->getRvalue(outED, arg.to_ptr< InstanceOfData >());
+
+ if( lvalue.is< InstanceOfData >() )
+ {
+ current( lvalue );
+
+ return( true );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected to eval_processor_dma_lvalue << "
+ << lvalue.str() << " >> for : " << arg.str() << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+
+ case AVM_ARG_DATA_UFI_KIND:
+ {
+ return( eval_processor_dma_lvalue_ufi_pointer(bytecode, arg) );
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_dma_lvalue :> "
+ "Unexpected argcode << " << bytecode.strCode()
+ << " >> for : " << arg.str() << " !!!"
+ << SEND_EXIT;
+
+ current( arg );
+
+ return( false );
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// EVAL PROCESSOR MEMORY WVALUE
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * EVAL PROCESSOR < AVM_ARG_MEMORY_WVALUE_CPU >
+ */
+bool ARGS_ENV::eval_processor_dma_wvalue(AvmBytecode & bytecode, BF & arg)
+{
+ switch( bytecode.operand )
+ {
+ case AVM_ARG_DATA_KIND:
+ {
+ current( ENV->getWvalue(outED, arg.to_ptr< InstanceOfData >()) );
+
+ return( true );
+ }
+
+ case AVM_ARG_DATA_REF_KIND:
+ {
+ current( ENV->getWvalue(outED,
+ ENV->getRvalue(outED, arg.to_ptr< InstanceOfData >()).
+ as_ptr< InstanceOfData >() ));
+
+ return( true );
+ }
+
+ case AVM_ARG_DATA_MACRO_KIND:
+ {
+ const BF & lvalue = ENV->getRvalue(outED,
+ arg.to_ptr< InstanceOfData >());
+
+ if( lvalue.is< InstanceOfData >() )
+ {
+ current( ENV->getWvalue(outED,
+ lvalue.to_ptr< InstanceOfData >() ));
+
+ return( true );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected to eval_processor_dma_wvalue << "
+ << lvalue.str() << " >> for : " << arg.str() << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+
+ case AVM_ARG_DATA_UFI_KIND:
+ {
+ return( eval_processor_dma_wvalue_ufi_pointer(bytecode, arg) );
+ }
+
+
+ case AVM_ARG_BUFFER_KIND:
+ {
+ const RuntimeID & aRID = outED->getRuntimeContainerRID(
+ arg.to_ptr< InstanceOfBuffer >());
+
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( aRID )
+ << "RID container for the buffer< "
+ << arg.to_ptr< InstanceOfBuffer >()->str() << " > !!!"
+ << SEND_EXIT;
+
+ current( outED.getWritableRuntime( aRID ).bfWritableBuffer(
+ arg.to_ptr< InstanceOfBuffer >() ) );
+
+ return( true );
+ }
+
+ case AVM_ARG_BUILTIN_CONTAINER_KIND:
+ {
+ arg.makeWritable();
+
+ current( arg );
+
+ return( true );
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_dma_wvalue :> "
+ "Unexpected argcode << " << bytecode.strCode()
+ << " >> for : " << arg.str() << " !!!"
+ << SEND_EXIT;
+
+ current( arg );
+
+ return( false );
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// EVAL PROCESSOR MEMORY RVALUE
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * EVAL PROCESSOR < AVM_ARG_MEMORY_RVALUE_CPU >
+ */
+bool ARGS_ENV::eval_processor_dma_rvalue(AvmBytecode & bytecode, BF & arg)
+{
+ switch( bytecode.operand )
+ {
+ case AVM_ARG_DATA_KIND:
+ {
+ current( ENV->getRvalue(outED, arg.to_ptr< InstanceOfData >()) );
+
+ return( true );
+ }
+
+ case AVM_ARG_DATA_CST_KIND:
+ {
+ current( arg );
+
+ return( true );
+ }
+
+ case AVM_ARG_DATA_REF_KIND:
+ {
+ current( ENV->getRvalue(outED,
+ ENV->getRvalue(outED, arg.to_ptr< InstanceOfData >()).
+ as_ptr< InstanceOfData >()) );
+
+ return( true );
+ }
+
+ case AVM_ARG_DATA_MACRO_KIND:
+ {
+ BF & rvalue = ENV->getRvalue(outED,
+ arg.to_ptr< InstanceOfData >());
+
+ if( rvalue.is< InstanceOfData >() )
+ {
+ current( ENV->getRvalue(outED,
+ rvalue.to_ptr< InstanceOfData >() ));
+
+ return( true );
+ }
+ else
+ {
+ return( decode_eval_rvalue( rvalue ) );
+ }
+ }
+
+ case AVM_ARG_DATA_UFI_KIND:
+ {
+ return( eval_processor_dma_rvalue_ufi_pointer(bytecode, arg) );
+ }
+
+ case AVM_ARG_EXPRESSION_KIND:
+ {
+ return( eval_processor_dma_rvalue(
+ bytecode, arg.to_ptr< AvmCode >()) );
+ }
+
+ case AVM_ARG_BUILTIN_CONTAINER_KIND:
+ {
+ current( arg );
+
+ return( true );
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_dma_rvalue :> "
+ "Unexpected argcode << " << bytecode.strCode()
+ << " >> for : " << arg.str() << " !!!"
+ << SEND_EXIT;
+
+ current( arg );
+
+ return( false );
+ }
+ }
+}
+
+
+bool ARGS_ENV::eval_processor_dma_rvalue(AvmBytecode & bytecode, AvmCode * aCode)
+{
+ InstructionEnvironment EVAL_ARG(ENV, outED, aCode->size());
+ if( EVAL_ARG.mARG->decode_eval_args_processor(bytecode, aCode) )
+ {
+ outED = EVAL_ARG.mARG->outED;
+ }
+ else
+ {
+ return( false );
+ }
+
+ switch( aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_ASSIGN:
+ {
+ current( EVAL_ARG.mARG->at(1) );
+
+AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+AVM_OS_TRACE << "dma:lvalue:> "
+ << str_header( EVAL_ARG.mARG->at(0).to_ptr< InstanceOfData >() )
+ << std::endl
+ << "dma:rvalue:> " << EVAL_ARG.mARG->at(1).str()
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ return( ENV->setRvalue( outED,
+ EVAL_ARG.mARG->at(0).to_ptr< InstanceOfData >(),
+ EVAL_ARG.mARG->at(1) ));
+ }
+
+ case AVM_OPCODE_ASSIGN_AFTER:
+ {
+ current( ENV->getRvalue( outED,
+ EVAL_ARG.mARG->at(0).to_ptr< InstanceOfData >() ));
+
+AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+AVM_OS_TRACE << "dma:lvalue:> "
+ << str_header( EVAL_ARG.mARG->at(0).to_ptr< InstanceOfData >() )
+ << std::endl
+ << "dma:rvalue:> " << EVAL_ARG.mARG->at(1).str()
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ current( EVAL_ARG.mARG->at(1) );
+
+ return( ENV->setRvalue( outED,
+ EVAL_ARG.mARG->at(0).to_ptr< InstanceOfData >(),
+ EVAL_ARG.mARG->at(2) ));
+ }
+
+
+ case AVM_OPCODE_ASSIGN_NEWFRESH:
+ {
+ BFList paramList;
+ BF aNewSymbolicConstant = ENV->createNewFreshParam(outED->mRID,
+ EVAL_ARG.mARG->at(0).to_ptr< InstanceOfData >(), paramList );
+
+ current( aNewSymbolicConstant );
+
+AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+AVM_OS_TRACE << "dma:lvalue:> "
+ << str_header( EVAL_ARG.mARG->at(0).to_ptr< InstanceOfData >() )
+ << std::endl
+ << "dma:rvalue:> " << aNewSymbolicConstant.str()
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ if( ENV->setRvalue(outED, EVAL_ARG.mARG->at(0).
+ to_ptr< InstanceOfData >(), aNewSymbolicConstant) )
+ {
+ ExecutionDataFactory::appendIOElementTrace(outED,
+ BF(new ExecutionConfiguration(outED->mRID,
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ASSIGN_NEWFRESH,
+ EVAL_ARG.mARG->at(0), aNewSymbolicConstant))));
+
+ outED.appendParameters( paramList );
+
+ return( true );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+// case AVM_OPCODE_ASSIGN_RESET:
+
+ case AVM_OPCODE_CTOR:
+ {
+ current( EVAL_ARG.mARG->at(0) );
+
+ return( true );
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_dma_rvalue :> "
+ "Unexpected opcode << " << aCode->strDebug() << " >> !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+}
+
+
+bool ARGS_ENV::decode_eval_rvalue(BF & arg)
+{
+ switch( arg.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ return( decode_eval_processor( arg.to_ptr< AvmCode >()
+ ->getInstruction()->getMainBytecode(),
+ arg.to_ptr< AvmCode >()) );
+ }
+
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ InstanceOfData * anInstance = arg.to_ptr< InstanceOfData >();
+
+ if( anInstance->getModifier().hasNatureReference() )
+ {
+ current( ENV->getRvalue(outED, ENV->getRvalue(outED,
+ anInstance).to_ptr< InstanceOfData >() ));
+ }
+ else if( anInstance->getModifier().hasNatureMacro() )
+ {
+ return( decode_eval_rvalue( ENV->getRvalue(outED, anInstance) ));
+ }
+ else if( anInstance->getModifier().hasFeatureMutable() )
+ {
+ current( ENV->getRvalue(outED, anInstance) );
+ }
+ else
+ {
+ current( arg );
+ }
+
+ return( true );
+ }
+
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ case FORM_BUILTIN_INTEGER_KIND:
+ case FORM_BUILTIN_RATIONAL_KIND:
+ case FORM_BUILTIN_FLOAT_KIND:
+
+ case FORM_BUILTIN_CHARACTER_KIND:
+ case FORM_BUILTIN_STRING_KIND:
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+
+ case FORM_ARRAY_BOOLEAN_KIND:
+ case FORM_ARRAY_CHARACTER_KIND:
+ case FORM_ARRAY_INTEGER_KIND:
+ case FORM_ARRAY_RATIONAL_KIND:
+ case FORM_ARRAY_FLOAT_KIND:
+ case FORM_ARRAY_STRING_KIND:
+ case FORM_ARRAY_IDENTIFIER_KIND:
+ case FORM_ARRAY_QUALIFIED_IDENTIFIER_KIND:
+
+ case FORM_RUNTIME_ID_KIND:
+
+ case FORM_INSTANCE_PORT_KIND:
+ case FORM_INSTANCE_BUFFER_KIND:
+ case FORM_INSTANCE_CONNECTOR_KIND:
+
+ case FORM_OPERATOR_KIND:
+ case FORM_AVMLAMBDA_KIND:
+ case FORM_AVMPROGRAM_KIND:
+ case FORM_AVMTRANSITION_KIND:
+ case FORM_EXECUTABLE_MACHINE_KIND:
+ case FORM_EXECUTABLE_SYSTEM_KIND:
+ {
+ current( arg );
+
+ return( true );
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Failed to decode_eval_rvalue << "
+ << arg.str() << " >> as Value argument !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+}
+
+
+BF ARGS_ENV::return_decode_eval_rvalue(BF & arg)
+{
+ switch( arg.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ return( return_decode_eval_processor(arg.bfCode()) );
+ }
+
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ InstanceOfData * anInstance = arg.to_ptr< InstanceOfData >();
+
+ if( anInstance->getModifier().hasNatureReference() )
+ {
+ return( ENV->getRvalue(outED, ENV->getRvalue(outED,
+ anInstance).to_ptr< InstanceOfData >() ));
+ }
+ else if( anInstance->getModifier().hasNatureMacro() )
+ {
+ return( return_decode_eval_rvalue(
+ ENV->getRvalue(outED, anInstance) ));
+ }
+ else if( anInstance->getModifier().hasFeatureMutable() )
+ {
+ return( ENV->getRvalue(outED, anInstance) );
+ }
+ else
+ {
+ return( arg );
+ }
+ }
+
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ case FORM_BUILTIN_INTEGER_KIND:
+ case FORM_BUILTIN_RATIONAL_KIND:
+ case FORM_BUILTIN_FLOAT_KIND:
+
+ case FORM_BUILTIN_CHARACTER_KIND:
+ case FORM_BUILTIN_STRING_KIND:
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+
+ case FORM_ARRAY_BOOLEAN_KIND:
+ case FORM_ARRAY_CHARACTER_KIND:
+ case FORM_ARRAY_INTEGER_KIND:
+ case FORM_ARRAY_RATIONAL_KIND:
+ case FORM_ARRAY_FLOAT_KIND:
+ case FORM_ARRAY_STRING_KIND:
+ case FORM_ARRAY_IDENTIFIER_KIND:
+ case FORM_ARRAY_QUALIFIED_IDENTIFIER_KIND:
+
+ case FORM_RUNTIME_ID_KIND:
+
+ case FORM_INSTANCE_PORT_KIND:
+ case FORM_INSTANCE_BUFFER_KIND:
+ case FORM_INSTANCE_CONNECTOR_KIND:
+
+ case FORM_OPERATOR_KIND:
+ case FORM_AVMLAMBDA_KIND:
+ case FORM_AVMPROGRAM_KIND:
+ case FORM_AVMTRANSITION_KIND:
+ case FORM_EXECUTABLE_MACHINE_KIND:
+ case FORM_EXECUTABLE_SYSTEM_KIND:
+ {
+ return( arg );
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Failed to return_decode_eval_rvalue << "
+ << arg.str() << " >> as Value argument !!!"
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// EVAL PROCESSOR MEMORY MACHINE as RID
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * EVAL PROCESSOR < AVM_ARG_MEMORY_MACHINE_CPU >
+ */
+bool ARGS_ENV::eval_processor_dma_machine(AvmBytecode & bytecode, BF & arg)
+{
+ switch( bytecode.operand )
+ {
+ case AVM_ARG_SELF_RID:
+ {
+ current( outED->mRID );
+
+ return( true );
+ }
+ case AVM_ARG_PARENT_RID:
+ {
+ current( outED->mRID.getPRID() );
+
+ return( true );
+ }
+ case AVM_ARG_COMMUNICATOR_RID:
+ {
+ current( outED->mRID.getCommunicator() );
+
+ return( true );
+ }
+ case AVM_ARG_SYSTEM_RID:
+ {
+ current( outED->getSystemRID() );
+
+ return( true );
+ }
+
+ case AVM_ARG_ENVIRONMENT_RID:
+ {
+ current( RuntimeLib::RID_ENVIRONMENT );
+
+ return( true );
+ }
+
+ case AVM_ARG_COMPONENT_SELF_RID:
+ {
+ current( outED->mRID.getComponentSelf() );
+
+ return( true );
+ }
+ case AVM_ARG_COMPONENT_PARENT_RID:
+ {
+ current( outED->mRID.getComponentParent() );
+
+ return( true );
+ }
+ case AVM_ARG_COMPONENT_COMMUNICATOR_RID:
+ {
+ current( outED->mRID.getComponentCommunicator() );
+
+ return( true );
+ }
+
+ case AVM_ARG_MACHINE_RID:
+ {
+ InstanceOfMachine * aMachine = arg.to_ptr< InstanceOfMachine >();
+
+ if( aMachine->getExecutable()->hasSingleRuntimeInstance() )
+ {
+ bytecode.setNopCpu();
+ if( (count == 1) && (idx == 0) )
+ {
+ bytecode.setNopsOperation();
+ }
+
+ current( arg = outED->getRuntimeID( aMachine ) );
+ }
+ else
+ {
+ current( outED->getRuntimeID( aMachine ) );
+ }
+
+ return( true );
+ }
+
+ case AVM_ARG_DATA_KIND:
+ {
+ current( ENV->getRvalue(outED, arg.to_ptr< InstanceOfData >()) );
+
+ return( true );
+ }
+
+ case AVM_ARG_DATA_REF_KIND:
+ {
+ current( ENV->getRvalue( outED,
+ ENV->getRvalue(outED, arg.to_ptr< InstanceOfData >()).
+ as_ptr< InstanceOfData >() ));
+
+ return( true );
+ }
+ case AVM_ARG_DATA_MACRO_KIND:
+ {
+ current( return_decode_eval_machine(
+ ENV->getRvalue(outED, arg.to_ptr< InstanceOfData >()) ));
+
+ return( true );
+ }
+
+ case AVM_ARG_DATA_UFI_KIND:
+ {
+ if( not eval_processor_dma_rvalue_ufi_pointer(bytecode, arg) )
+ {
+ return( false );
+ }
+ else if( current().is< RuntimeID >() )
+ {
+ return( true );
+ }
+ else if( current().is< InstanceOfMachine >() )
+ {
+ InstanceOfMachine * aMachine =
+ current().to_ptr< InstanceOfMachine >();
+
+ if( aMachine->getExecutable()->hasSingleRuntimeInstance() )
+ {
+ bytecode.setNopCpu();
+ if( (count == 1) && (idx == 0) )
+ {
+ bytecode.setNopsOperation();
+ }
+
+ current( arg = outED->getRuntimeID( aMachine ) );
+ }
+ else
+ {
+ current( outED->getRuntimeID( aMachine ) );
+ }
+
+ return( true );
+ }
+
+ return( false );
+ }
+
+ case AVM_ARG_EXPRESSION_RID:
+ {
+ current( return_decode_eval_machine(arg) );
+
+ return( true );
+ }
+
+ case AVM_ARG_EXPRESSION_KIND:
+ {
+ return( eval_processor_dma_machine(
+ bytecode, arg.to_ptr< AvmCode >() ));
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_dma_machine :> "
+ "Unexpected argcode << " << bytecode.strCode()
+ << " >> for : " << arg.str() << " !!!"
+ << SEND_EXIT;
+
+ current( arg );
+
+ return( false );
+ }
+ }
+}
+
+
+bool ARGS_ENV::eval_processor_dma_machine(AvmBytecode & bytecode, AvmCode * aCode)
+{
+ InstructionEnvironment EVAL_ARG(ENV, outED, aCode->size());
+ if( EVAL_ARG.mARG->decode_eval_args_processor(bytecode, aCode) )
+ {
+ outED = EVAL_ARG.mARG->outED;
+ }
+ else
+ {
+ return( false );
+ }
+
+ switch( aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_SCHEDULE_IN:
+ {
+ const BFCode & scheduleCode = outED->getRuntimeFormOnSchedule(
+ EVAL_ARG.mARG->at(1).bfRID() );
+
+ current( ExpressionConstructor::newBoolean(
+ StatementFactory::containsOperationOnRID(
+ scheduleCode, AVM_OPCODE_RUN,
+ EVAL_ARG.mARG->at(0).bfRID())) );
+
+ return( true );
+ }
+
+ case AVM_OPCODE_STATUS_BEING:
+ case AVM_OPCODE_STATUS_IS:
+ case AVM_OPCODE_STATUS_WAS:
+ case AVM_OPCODE_STATUS_WILL:
+
+ case AVM_OPCODE_INVOKE_NEW:
+ {
+ EvaluationEnvironment eENV(*ENV, outED, INCR_BF(aCode).bfCode());
+ if( eENV.seval(EVAL_ARG.mARG) )
+ {
+ outED = eENV.outED;
+
+ current( eENV.outVAL );
+
+ return( true );
+ }
+
+ return( false );
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_dma_machine :> "
+ "Unexpected opcode << " << aCode->strDebug() << " >> !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+}
+
+
+const RuntimeID & ARGS_ENV::return_decode_eval_machine(const BF & anElement)
+{
+ switch( anElement.classKind() )
+ {
+ case FORM_RUNTIME_ID_KIND:
+ {
+ return( anElement.bfRID() );
+ }
+
+ case FORM_INSTANCE_MACHINE_KIND:
+ {
+ return( outED->getRuntimeID(anElement.to_ptr< InstanceOfMachine >()) );
+ }
+
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ InstanceOfData * anInstance = anElement.to_ptr< InstanceOfData >();
+
+ if( anInstance->isTypedMachine() )
+ {
+ if( anInstance->getModifier().hasFeatureMutable() )
+ {
+ const BF & bfInstance = ENV->getRvalue(outED, anInstance);
+
+ if( bfInstance.is< RuntimeID >() )
+ {
+ return( bfInstance.bfRID() );
+ }
+ else if( bfInstance.is< InstanceOfMachine >() )
+ {
+ return( outED->getRuntimeID(
+ bfInstance.to_ptr< InstanceOfMachine >()) );
+ }
+ else if( anInstance->getModifier().anyNatureReferenceMacro()
+ && bfInstance.is< InstanceOfData >()
+ && (bfInstance != anInstance) )
+ {
+ return( return_decode_eval_machine(ENV->getRvalue(outED,
+ bfInstance.to_ptr< InstanceOfData >())) );
+ }
+ else
+ {
+ AVM_OS_WARN << "Unexpected" << str_header( anInstance )
+ << " as RuntimeID argument !!!" << std::endl;
+ }
+ }
+ else if( anInstance->getModifier().
+ hasModifierPublicFinalStatic() )
+ {
+ AVM_OS_WARN << "Unexpected " << str_header( anInstance )
+ << " as RuntimeID argument !!!" << std::endl;
+ }
+ else
+ {
+ AVM_OS_WARN << "Unexpected " << str_header( anInstance )
+ << " as RuntimeID argument :> bad type data !!!"
+ << std::endl;
+ }
+ }
+ else
+ {
+ AVM_OS_WARN << "Unexpected " << str_header( anInstance )
+ << " as RuntimeID argument :> bad type data !!!"
+ << std::endl;
+ }
+
+ return( RuntimeID::REF_NULL );
+ }
+
+ case FORM_AVMCODE_KIND:
+ {
+ EvaluationEnvironment eENV(*ENV, outED, anElement.bfCode());
+ if( eENV.seval() )
+ {
+ if( eENV.outVAL.is< RuntimeID >() )
+ {
+ outED = eENV.outED;
+
+ return( eENV.outVAL.bfRID() );
+ }
+ else
+ {
+ AVM_OS_WARN << "Unexpected " << eENV.outVAL.str()
+ << " as RuntimeID argument !!!" << std::endl;
+ }
+ }
+
+ return( RuntimeID::REF_NULL );
+ }
+
+ default:
+ {
+ AVM_OS_EXIT( FAILED )
+ << "ENV::evalMachine:> Unexpected form KIND\n"
+ << anElement.toString()
+ << SEND_EXIT;
+
+ return( RuntimeID::REF_NULL );
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// EVAL PROCESSOR ARITHMETIC / LOGIC
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * EVAL PROCESSOR < AVM_ARG_ARITHMETIC_LOGIC_CPU >
+ */
+bool ARGS_ENV::eval_processor_alu(AvmBytecode & bytecode, BF & arg)
+{
+ switch( bytecode.operand )
+ {
+ case AVM_ARG_EXPRESSION_KIND:
+ {
+ return( eval_processor_alu(bytecode, arg.to_ptr< AvmCode >()) );
+ }
+
+ case AVM_ARG_STATEMENT_KIND:
+ {
+ EvaluationEnvironment eENV(*ENV, outED, arg.bfCode());
+ if( eENV.seval() )
+ {
+ outED = eENV.outED;
+
+ current( eENV.outVAL );
+
+ return( true );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ case AVM_ARG_BOOLEAN_KIND:
+ case AVM_ARG_INTEGER_KIND:
+ case AVM_ARG_RATIONAL_KIND:
+ case AVM_ARG_FLOAT_KIND:
+
+ case AVM_ARG_DATA_CST_KIND:
+
+ case AVM_ARG_BUILTIN_KIND:
+ case AVM_ARG_BUILTIN_ARRAY_KIND:
+ case AVM_ARG_CHARACTER_KIND:
+ case AVM_ARG_STRING_KIND:
+
+ case AVM_ARG_PORT_KIND:
+ case AVM_ARG_BUFFER_KIND:
+ case AVM_ARG_CONNECTOR_KIND:
+ {
+ current( arg );
+
+ return( true );
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_alu :> Unexpected argcode << "
+ << argsBytecode[idx].strCode() << " >> for : "
+ << arg.str() << " !!!"
+ << SEND_EXIT;
+
+ current( arg );
+
+ return( false );
+ }
+ }
+}
+
+
+bool ARGS_ENV::eval_processor_alu(AvmBytecode & bytecode, AvmCode * aCode)
+{
+ InstructionEnvironment EVAL_ARG(ENV, outED, aCode->size());
+ if( EVAL_ARG.mARG->decode_eval_args_processor(bytecode, aCode) )
+ {
+ outED = EVAL_ARG.mARG->outED;
+ }
+ else
+ {
+ return( false );
+ }
+
+ switch( aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_PLUS:
+ {
+ current( ExpressionConstructorNative::addExpr(
+ *(EVAL_ARG.mARG->values)) );
+
+ return( true );
+ }
+ case AVM_OPCODE_MINUS:
+ {
+ current( ExpressionConstructorNative::minusExpr(
+ EVAL_ARG.mARG->at(0), EVAL_ARG.mARG->at(1)) );
+
+ return( true );
+ }
+ case AVM_OPCODE_UMINUS:
+ {
+ current( ExpressionConstructorNative::uminusExpr(
+ EVAL_ARG.mARG->at(0) ) );
+
+ return( true );
+ }
+
+ case AVM_OPCODE_MULT:
+ {
+ current( ExpressionConstructorNative::multExpr(
+ *(EVAL_ARG.mARG->values)) );
+
+ return( true );
+ }
+ case AVM_OPCODE_POW:
+ {
+ current( ExpressionConstructorNative::powExpr(
+ EVAL_ARG.mARG->at(0), EVAL_ARG.mARG->at(1)) );
+
+ return( true );
+ }
+
+ case AVM_OPCODE_DIV:
+ {
+ current( ExpressionConstructorNative::divExpr(
+ EVAL_ARG.mARG->at(0), EVAL_ARG.mARG->at(1)) );
+
+ return( true );
+ }
+
+// case AVM_OPCODE_MOD:
+// case AVM_OPCODE_MIN:
+// case AVM_OPCODE_MAX:
+
+ case AVM_OPCODE_EQ:
+ {
+ current( ExpressionConstructorNative::eqExpr(
+ EVAL_ARG.mARG->at(0), EVAL_ARG.mARG->at(1)) );
+
+ return( true );
+ }
+ case AVM_OPCODE_NEQ:
+ {
+ current( ExpressionConstructorNative::neqExpr(
+ EVAL_ARG.mARG->at(0), EVAL_ARG.mARG->at(1)) );
+
+ return( true );
+ }
+
+ case AVM_OPCODE_SEQ:
+ {
+ current( ExpressionConstructorNative::seqExpr(
+ EVAL_ARG.mARG->at(0), EVAL_ARG.mARG->at(1)) );
+
+ return( true );
+ }
+ case AVM_OPCODE_NSEQ:
+ {
+ current( ExpressionConstructorNative::nseqExpr(
+ EVAL_ARG.mARG->at(0), EVAL_ARG.mARG->at(1)) );
+
+ return( true );
+ }
+
+ case AVM_OPCODE_LT:
+ {
+ current( ExpressionConstructorNative::ltExpr(
+ EVAL_ARG.mARG->at(0), EVAL_ARG.mARG->at(1)) );
+
+ return( true );
+ }
+ case AVM_OPCODE_LTE:
+ {
+ current( ExpressionConstructorNative::lteExpr(
+ EVAL_ARG.mARG->at(0), EVAL_ARG.mARG->at(1)) );
+
+ return( true );
+ }
+ case AVM_OPCODE_GT:
+ {
+ current( ExpressionConstructorNative::gtExpr(
+ EVAL_ARG.mARG->at(0), EVAL_ARG.mARG->at(1)) );
+
+ return( true );
+ }
+ case AVM_OPCODE_GTE:
+ {
+ current( ExpressionConstructorNative::gteExpr(
+ EVAL_ARG.mARG->at(0), EVAL_ARG.mARG->at(1)) );
+
+ return( true );
+ }
+
+
+
+ case AVM_OPCODE_NOT:
+ {
+ current( ExpressionConstructorNative::notExpr(
+ EVAL_ARG.mARG->at(0) ) );
+
+ return( true );
+ }
+
+ case AVM_OPCODE_AND:
+ {
+ current( ExpressionConstructorNative::andExpr(
+ *(EVAL_ARG.mARG->values)) );
+
+ return( true );
+ }
+ case AVM_OPCODE_NAND:
+ {
+ current( ExpressionConstructorNative::notExpr(
+ ExpressionConstructorNative::andExpr(
+ *(EVAL_ARG.mARG->values)) ));
+
+ return( true );
+ }
+
+// case AVM_OPCODE_XAND:
+// {
+// return( true );
+// }
+
+ case AVM_OPCODE_OR:
+ {
+ current( ExpressionConstructorNative::orExpr(
+ *(EVAL_ARG.mARG->values)) );
+
+ return( true );
+ }
+ case AVM_OPCODE_NOR:
+ {
+ current( ExpressionConstructorNative::notExpr(
+ ExpressionConstructorNative::orExpr(
+ *(EVAL_ARG.mARG->values)) ));
+
+ return( true );
+ }
+
+// case AVM_OPCODE_XOR:
+// case AVM_OPCODE_XNOR:
+
+ // RANDOM
+ case AVM_OPCODE_RANDOM:
+ {
+ current( ExpressionConstructorNative::newInteger(
+ RANDOM::gen_integer(
+ EVAL_ARG.mARG->at(0).toInteger(),
+ EVAL_ARG.mARG->at(1).toInteger() ) ) );
+
+ return( true );
+ }
+
+// // ROUNDING
+// case AVM_OPCODE_ABS:
+// case AVM_OPCODE_CEIL:
+// case AVM_OPCODE_FLOOR:
+// case AVM_OPCODE_ROUND:
+// case AVM_OPCODE_TRUNCATE:
+//
+// // EXP - LOG
+// case AVM_OPCODE_SQRT:
+// case AVM_OPCODE_EXP:
+// case AVM_OPCODE_LN:
+// case AVM_OPCODE_LOG:
+//
+// // TRIGONOMETRIC
+// case AVM_OPCODE_SIN:
+// case AVM_OPCODE_COS:
+// case AVM_OPCODE_TAN:
+//
+// case AVM_OPCODE_SINH:
+// case AVM_OPCODE_COSH:
+// case AVM_OPCODE_TANH:
+//
+// case AVM_OPCODE_ASIN:
+// case AVM_OPCODE_ACOS:
+// case AVM_OPCODE_ATAN:
+// case AVM_OPCODE_ATAN2:
+//
+// case AVM_OPCODE_ASINH:
+// case AVM_OPCODE_ACOSH:
+// case AVM_OPCODE_ATANH:
+
+ case AVM_OPCODE_CTOR:
+ {
+ switch( aCode->getInstruction()->getMainOperand() )
+ {
+ case AVM_ARG_STRING_KIND:
+ {
+ current( ExpressionConstructor::newString(
+ EVAL_ARG.mARG->at(1).str()) );
+
+ return( true );
+ }
+ case AVM_ARG_CHARACTER_KIND:
+ case AVM_ARG_BOOLEAN_KIND:
+ case AVM_ARG_INTEGER_KIND:
+ case AVM_ARG_RATIONAL_KIND:
+ case AVM_ARG_FLOAT_KIND:
+
+ default:
+ {
+ current( EVAL_ARG.mARG->at(1) );
+
+ return( true );
+ }
+ }
+
+ return( true );
+ }
+
+ default:
+ {
+ current( ExpressionConstructorNative::newExpr(
+ aCode->getOperator(), *(EVAL_ARG.mARG->values)) );
+
+ return( true );
+
+// AVM_OS_FATAL_ERROR_EXIT
+// << "ARGS_ENV::eval_processor_alu :> "
+// "Unexpected opcode << " << aCode->strDebug()
+// << " >> for : " << aCode->strDebug() << " !!!"
+// << SEND_EXIT;
+//
+// return( false );
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// EVAL PROCESSOR STATEMENT
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * EVAL PROCESSOR < AVM_ARG_STATEMENT_CPU >
+ */
+bool ARGS_ENV::eval_processor_statement(AvmBytecode & bytecode, AvmCode * aCode)
+{
+ InstructionEnvironment EVAL_ARG(ENV, outED, aCode->size());
+ if( EVAL_ARG.mARG->main_decode_eval_args(aCode) )
+ {
+ outED = EVAL_ARG.mARG->outED;
+ }
+ else
+ {
+ return( aCode );
+ }
+
+ switch( aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_OBS:
+ {
+ current( EVAL_ARG.mARG->at(2) );
+
+ return( true );
+ }
+
+
+ case AVM_OPCODE_INPUT:
+ case AVM_OPCODE_OUTPUT:
+ {
+ BFCode ioTrace = ENV->searchTraceIO(outED->getIOElementTrace(), aCode);
+
+ if( ioTrace.valid() )
+ {
+ current( ioTrace );
+
+ AvmCode::iterator traceArg = ioTrace->begin();
+ EVAL_ARG.mARG->begin(1);
+ for( ++traceArg ; EVAL_ARG.mARG->hasNext() ;
+ EVAL_ARG.mARG->next() , ++traceArg )
+ {
+ if( not ENV->setRvalue( outED, EVAL_ARG.mARG->current().
+ as_ptr< InstanceOfData >(), (*traceArg)) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+
+ return( false );
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_statement :> "
+ "Unexpected bytecode << " << bytecode.strCode()
+ << " >> for : " << aCode->strDebug() << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+
+ return( false );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// EVAL PROCESSOR CHARACTER
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * EVAL PROCESSOR < AVM_ARG_CHARACTER_CPU >
+ */
+bool ARGS_ENV::eval_processor_character(AvmBytecode & bytecode, BF & arg)
+{
+ switch( bytecode.operand )
+ {
+ case AVM_ARG_EXPRESSION_KIND:
+ {
+ return( eval_processor_character( bytecode, arg.to_ptr< AvmCode >() ) );
+ }
+
+ case AVM_ARG_CHARACTER_KIND:
+ {
+ current( arg );
+
+ return( true );
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_character :> "
+ "Unexpected argcode << " << bytecode.strCode()
+ << " >> for : " << arg.str() << " !!!"
+ << SEND_EXIT;
+
+ current( ExpressionConstructor::newString(arg.str()) );
+
+ return( true );
+ }
+ }
+}
+
+
+bool ARGS_ENV::eval_processor_character(AvmBytecode & bytecode, AvmCode * aCode)
+{
+ InstructionEnvironment EVAL_ARG(ENV, outED, aCode->size());
+ if( EVAL_ARG.mARG->main_decode_eval_args(aCode) )
+ {
+ outED = EVAL_ARG.mARG->outED;
+ }
+ else
+ {
+ return( aCode );
+ }
+
+ switch( aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_CTOR:
+ {
+ switch( aCode->getInstruction()->getMainOperand() )
+ {
+ case AVM_ARG_STRING_KIND:
+ {
+ if( EVAL_ARG.mARG->at(1).is< Character >() )
+ {
+ current( ExpressionConstructor::newString(
+ to_string(EVAL_ARG.mARG->at(1).to_ptr<
+ Character >()->getValue())) );
+ }
+ else
+ {
+ current( ExpressionConstructor::newString(
+ EVAL_ARG.mARG->at(1).str()) );
+ }
+
+ return( true );
+ }
+ case AVM_ARG_CHARACTER_KIND:
+ {
+ current( ExpressionConstructor::newChar(
+ EVAL_ARG.mARG->at(1).str().at(0) ) );
+
+ return( true );
+ }
+
+ case AVM_ARG_BOOLEAN_KIND:
+ case AVM_ARG_INTEGER_KIND:
+ case AVM_ARG_RATIONAL_KIND:
+ case AVM_ARG_FLOAT_KIND:
+
+
+ default:
+ {
+ current( ExpressionConstructor::newString(
+ EVAL_ARG.mARG->at(1).str() ));
+
+ return( true );
+ }
+ }
+
+ return( true );
+ }
+
+// case AVM_OPCODE_EMPTY:
+// {
+// current( ExpressionConstructor::newBoolean( false ) );
+//
+// return( true );
+// }
+//
+// case AVM_OPCODE_NONEMPTY:
+// {
+// current( ExpressionConstructor::newBoolean( true ) );
+//
+// return( true );
+// }
+// case AVM_OPCODE_SINGLETON:
+// {
+// current( ExpressionConstructor::newBoolean( true ) );
+//
+// return( true );
+// }
+// case AVM_OPCODE_POPULATED:
+// {
+// current( ExpressionConstructor::newBoolean( false ) );
+//
+// return( true );
+// }
+//
+// case AVM_OPCODE_SIZE:
+// {
+// current( ExpressionConstructor::INTEGER_ONE );
+//
+// return( true );
+// }
+
+ case AVM_OPCODE_EQ:
+ case AVM_OPCODE_SEQ:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).to_ptr< Character >()->getValue() ==
+ EVAL_ARG.mARG->at(1).to_ptr< Character >()->getValue() ));
+
+ return( true );
+ }
+ case AVM_OPCODE_NEQ:
+ case AVM_OPCODE_NSEQ:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).to_ptr< Character >()->getValue() !=
+ EVAL_ARG.mARG->at(1).to_ptr< Character >()->getValue() ));
+
+ return( true );
+ }
+
+ case AVM_OPCODE_LT:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).to_ptr< Character >()->getValue() <
+ EVAL_ARG.mARG->at(1).to_ptr< Character >()->getValue() ));
+
+ return( true );
+ }
+ case AVM_OPCODE_LTE:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).to_ptr< Character >()->getValue() <=
+ EVAL_ARG.mARG->at(1).to_ptr< Character >()->getValue() ));
+
+ return( true );
+ }
+ case AVM_OPCODE_GT:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).to_ptr< Character >()->getValue() >
+ EVAL_ARG.mARG->at(1).to_ptr< Character >()->getValue() ));
+
+ return( true );
+ }
+ case AVM_OPCODE_GTE:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).to_ptr< Character >()->getValue() >=
+ EVAL_ARG.mARG->at(1).to_ptr< Character >()->getValue() ));
+
+ return( true );
+ }
+
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_character :> "
+ "Unexpected bytecode << " << bytecode.strCode()
+ << " >> for : " << aCode->strDebug() << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// EVAL PROCESSOR STRING
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * EVAL PROCESSOR < AVM_ARG_STRING_CPU >
+ */
+bool ARGS_ENV::eval_processor_string(AvmBytecode & bytecode, BF & arg)
+{
+ switch( bytecode.operand )
+ {
+ case AVM_ARG_EXPRESSION_KIND:
+ {
+ return( eval_processor_string( bytecode, arg.to_ptr< AvmCode >() ) );
+ }
+
+ case AVM_ARG_STRING_KIND:
+ {
+ current( arg );
+
+ return( true );
+ }
+
+ case AVM_ARG_CHARACTER_KIND:
+ {
+ current( ExpressionConstructor::newString(
+ to_string(arg.to_ptr< Character >()->getValue())) );
+
+ return( true );
+ }
+
+ case AVM_ARG_BOOLEAN_KIND:
+ case AVM_ARG_INTEGER_KIND:
+ case AVM_ARG_RATIONAL_KIND:
+ case AVM_ARG_FLOAT_KIND:
+ case AVM_ARG_OPERATOR_KIND:
+ case AVM_ARG_BUILTIN_KIND:
+ {
+ current( ExpressionConstructor::newString( arg.str() ) );
+
+ return( true );
+ }
+
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_string :> "
+ "Unexpected argcode << " << bytecode.strCode()
+ << " >> for : " << arg.str() << " !!!"
+ << SEND_EXIT;
+
+ current( ExpressionConstructor::newString(arg.str()) );
+
+ return( true );
+ }
+ }
+}
+
+
+bool ARGS_ENV::eval_processor_string(AvmBytecode & bytecode, AvmCode * aCode)
+{
+ InstructionEnvironment EVAL_ARG(ENV, outED, aCode->size());
+ if( EVAL_ARG.mARG->main_decode_eval_args(aCode) )
+ {
+ outED = EVAL_ARG.mARG->outED;
+ }
+ else
+ {
+ return( aCode );
+ }
+
+ switch( aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_PLUS:
+ case AVM_OPCODE_CONCAT:
+ {
+ std::ostringstream oss;
+ for( EVAL_ARG.mARG->begin() ; EVAL_ARG.mARG->hasNext() ;
+ EVAL_ARG.mARG->next() )
+ {
+ oss << EVAL_ARG.mARG->current().to_ptr< String >()->getValue();
+ }
+
+ current( ExpressionConstructor::newString(oss.str()) );
+
+ return( true );
+ }
+
+ case AVM_OPCODE_REMOVE:
+ {
+ std::string val = EVAL_ARG.mARG->at(0).to_ptr< String >()->getValue();
+
+ StringTools::replaceAll(val,
+ EVAL_ARG.mARG->at(1).to_ptr< String >()->getValue(), "");
+
+ current( ExpressionConstructor::newString( val ) );
+
+ return( true );
+ }
+
+ case AVM_OPCODE_CTOR:
+ {
+ switch( aCode->getInstruction()->getMainOperand() )
+ {
+ case AVM_ARG_STRING_KIND:
+ {
+ current( ExpressionConstructor::newString(
+ EVAL_ARG.mARG->at(1).str()) );
+
+ return( true );
+ }
+ case AVM_ARG_CHARACTER_KIND:
+ {
+ if( EVAL_ARG.mARG->at(1).to_ptr< String >()
+ ->getValue().empty() )
+ {
+ return( false );
+ }
+
+ current( ExpressionConstructor::newChar( EVAL_ARG.mARG
+ ->at(1).to_ptr< String >()->getValue().at(0)) );
+
+ return( true );
+ }
+
+ case AVM_ARG_BOOLEAN_KIND:
+ {
+ current( ExpressionConstructor::newBoolean( EVAL_ARG.mARG
+ ->at(1).to_ptr< String >()->getValue()) );
+
+ return( true );
+ }
+ case AVM_ARG_INTEGER_KIND:
+ {
+ current( ExpressionConstructor::newInteger( EVAL_ARG.mARG
+ ->at(1).to_ptr< String >()->getValue()) );
+
+ return( true );
+ }
+ case AVM_ARG_RATIONAL_KIND:
+ {
+ current( ExpressionConstructor::newRational( EVAL_ARG.mARG
+ ->at(1).to_ptr< String >()->getValue()) );
+
+ return( true );
+ }
+ case AVM_ARG_FLOAT_KIND:
+ {
+ current( ExpressionConstructor::newFloat( EVAL_ARG.mARG
+ ->at(1).to_ptr< String >()->getValue()) );
+
+ return( true );
+ }
+
+ default:
+ {
+ current( ExpressionConstructor::newString(
+ EVAL_ARG.mARG->at(1).str() ));
+
+ return( true );
+ }
+ }
+
+ return( true );
+ }
+
+ case AVM_OPCODE_CONTAINS:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).to_ptr< String >()->getValue().find(
+ EVAL_ARG.mARG->at(1).to_ptr< String >()
+ ->getValue() ) != std::string::npos ));
+
+ return( true );
+ }
+
+ case AVM_OPCODE_IN:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(1).to_ptr< String >()->getValue().find(
+ EVAL_ARG.mARG->at(0).to_ptr< String >()
+ ->getValue() ) != std::string::npos ));
+
+ return( true );
+ }
+ case AVM_OPCODE_NOTIN:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(1).to_ptr< String >()->getValue().find(
+ EVAL_ARG.mARG->at(0).to_ptr< String >()
+ ->getValue() ) == std::string::npos ));
+
+ return( true );
+ }
+
+ case AVM_OPCODE_STARTS_WITH:
+ {
+ current( ExpressionConstructor::newBoolean( StringTools::startsWith(
+ EVAL_ARG.mARG->at(0).to_ptr< String >()->getValue(),
+ EVAL_ARG.mARG->at(1).to_ptr< String >()->getValue() )));
+
+ return( true );
+ }
+ case AVM_OPCODE_ENDS_WITH:
+ {
+ current( ExpressionConstructor::newBoolean( StringTools::endsWith(
+ EVAL_ARG.mARG->at(0).to_ptr< String >()->getValue(),
+ EVAL_ARG.mARG->at(1).to_ptr< String >()->getValue() )));
+
+ return( true );
+ }
+
+ case AVM_OPCODE_EMPTY:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0)
+ .to_ptr< String >()->getValue().empty() ) );
+
+ return( true );
+ }
+
+ case AVM_OPCODE_NONEMPTY:
+ {
+ current( ExpressionConstructor::newBoolean(
+ not EVAL_ARG.mARG->at(0)
+ .to_ptr< String >()->getValue().empty() ) );
+
+ return( true );
+ }
+ case AVM_OPCODE_SINGLETON:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0)
+ .to_ptr< String >()->getValue().size() == 1 ) );
+
+ return( true );
+ }
+ case AVM_OPCODE_POPULATED:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0)
+ .to_ptr< String >()->getValue().size() > 1 ) );
+
+ return( true );
+ }
+
+ case AVM_OPCODE_SIZE:
+ {
+ current( ExpressionConstructor::newUInteger(
+ EVAL_ARG.mARG->at(0)
+ .to_ptr< String >()->getValue().size() ) );
+
+ return( true );
+ }
+
+ case AVM_OPCODE_EQ:
+ case AVM_OPCODE_SEQ:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).to_ptr< String >()->getValue().compare(
+ EVAL_ARG.mARG->at(1).to_ptr< String >()->getValue()) == 0 ));
+
+ return( true );
+ }
+ case AVM_OPCODE_NEQ:
+ case AVM_OPCODE_NSEQ:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).to_ptr< String >()->getValue().compare(
+ EVAL_ARG.mARG->at(1).to_ptr< String >()->getValue()) != 0 ) );
+
+ return( true );
+ }
+
+ case AVM_OPCODE_LT:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).to_ptr< String >()->getValue().compare(
+ EVAL_ARG.mARG->at(1).to_ptr< String >()->getValue()) < 0 ) );
+
+ return( true );
+ }
+ case AVM_OPCODE_LTE:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).to_ptr< String >()->getValue().compare(
+ EVAL_ARG.mARG->at(1).to_ptr< String >()->getValue()) <= 0 ) );
+
+ return( true );
+ }
+ case AVM_OPCODE_GT:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).to_ptr< String >()->getValue().compare(
+ EVAL_ARG.mARG->at(1).to_ptr< String >()->getValue()) > 0 ) );
+
+ return( true );
+ }
+ case AVM_OPCODE_GTE:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).to_ptr< String >()->getValue().compare(
+ EVAL_ARG.mARG->at(1).to_ptr< String >()->getValue()) >= 0 ) );
+
+ return( true );
+ }
+
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_string :> "
+ "Unexpected bytecode << " << bytecode.strCode()
+ << " >> for : " << aCode->strDebug() << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// EVAL PROCESSOR ARRAY
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * EVAL PROCESSOR < AVM_ARG_ARRAY_[L|V]_CPU >
+ */
+bool ARGS_ENV::eval_processor_array_lvalue(AvmBytecode & bytecode, BF & arg)
+{
+ switch( bytecode.operand )
+ {
+ case AVM_ARG_ARRAY_KIND:
+ {
+ ArrayBF & argArray = arg.as_ref< ArrayBF >();
+
+ ArrayBF * outArray = new ArrayBF(
+ argArray.getTypeSpecifier(), argArray.size());
+
+ if( argArray.hasInstruction() )
+ {
+ AvmInstruction * instruction = argArray.getInstruction();
+ for( avm_size_t offset = 0 ; offset < argArray.size() ; ++offset )
+ {
+ outArray->set(offset, return_decode_eval_processor(
+ instruction->at(offset), argArray[offset]));
+ }
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_array_lvalue :> "
+ "Unexpected array without instruction << "
+ << bytecode.strCode() << " >> for : << "
+ << arg.str() << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ current( BF( outArray ) );
+
+ return( true );
+ }
+
+ case AVM_ARG_BUILTIN_ARRAY_KIND:
+ {
+ current( arg );
+
+ return( true );
+ }
+
+ case AVM_ARG_EXPRESSION_KIND:
+ {
+ BF value = return_decode_eval_processor(
+ arg.to_ptr< AvmCode >()
+ ->getInstruction()->getMainBytecode(), arg);
+
+ current( genArray(
+ bytecode.dtype->as< ContainerTypeSpecifier >(), value) );
+
+ return( true );
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_array_lvalue :> "
+ "Unexpected argcode << " << bytecode.strCode()
+ << " >> for : << " << arg.str() << " !!!"
+ << SEND_EXIT;
+
+ current( genArray(
+ bytecode.dtype->as< ContainerTypeSpecifier >(), arg) );
+
+ return( false );
+ }
+ }
+}
+
+
+bool ARGS_ENV::eval_processor_array_rvalue(AvmBytecode & bytecode, BF & arg)
+{
+ switch( bytecode.operand )
+ {
+ case AVM_ARG_ARRAY_KIND:
+ {
+ ArrayBF & argArray = arg.as_ref< ArrayBF >();
+
+ ArrayBF * outArray = new ArrayBF(
+ argArray.getTypeSpecifier(), argArray.size());
+
+ if( argArray.hasInstruction() )
+ {
+ AvmInstruction * instruction = argArray.getInstruction();
+ for( avm_size_t offset = 0 ; offset < argArray.size() ; ++offset )
+ {
+ outArray->set(offset, return_decode_eval_processor(
+ instruction->at(offset), argArray[offset]));
+ }
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_array_rvalue :> "
+ "Unexpected array without instruction << "
+ << bytecode.strCode() << " >> for : << "
+ << arg.str() << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ current( BF( outArray ) );
+
+ return( true );
+ }
+
+ case AVM_ARG_BUILTIN_ARRAY_KIND:
+ {
+ current( arg );
+
+ return( true );
+ }
+
+ case AVM_ARG_BOOLEAN_KIND:
+ case AVM_ARG_INTEGER_KIND:
+ case AVM_ARG_RATIONAL_KIND:
+ case AVM_ARG_FLOAT_KIND:
+
+ case AVM_ARG_BUILTIN_KIND:
+ case AVM_ARG_CHARACTER_KIND:
+ case AVM_ARG_STRING_KIND:
+
+ case AVM_ARG_PORT_KIND:
+ case AVM_ARG_BUFFER_KIND:
+ case AVM_ARG_CONNECTOR_KIND:
+
+ case AVM_ARG_DATA_CST_KIND:
+ {
+ current( genArray(
+ bytecode.dtype->as< ContainerTypeSpecifier >(), arg) );
+
+
+ return( true );
+ }
+
+ case AVM_ARG_DATA_KIND:
+ {
+ current( genArray( bytecode.dtype->as< ContainerTypeSpecifier >(),
+ ENV->getRvalue(outED, arg.to_ptr< InstanceOfData >()) ));
+
+ return( true );
+ }
+
+ case AVM_ARG_DATA_REF_KIND:
+ {
+ current( genArray( bytecode.dtype->as< ContainerTypeSpecifier >(),
+ ENV->getRvalue(outED, ENV->getRvalue(outED, arg.to_ptr<
+ InstanceOfData >()).to_ptr< InstanceOfData >()) ));
+
+ return( true );
+ }
+
+ case AVM_ARG_DATA_MACRO_KIND:
+ {
+ BF rvalue = ENV->getRvalue(outED, arg.to_ptr< InstanceOfData >());
+
+ if( rvalue.is< InstanceOfData >() )
+ {
+ rvalue = ENV->getRvalue(outED, rvalue.to_ptr< InstanceOfData >());
+ }
+ else
+ {
+ if( decode_eval_rvalue( rvalue ) )
+ {
+ rvalue = current();
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ current( genArray(
+ bytecode.dtype->as< ContainerTypeSpecifier >(), rvalue ));
+
+ return( true );
+ }
+
+ case AVM_ARG_DATA_UFI_KIND:
+ {
+ if( eval_processor_dma_rvalue_ufi_pointer(bytecode, arg) )
+ {
+ current( genArray( bytecode.dtype->as<
+ ContainerTypeSpecifier >(), current() ) );
+
+ return( true );
+ }
+
+ return( false );
+ }
+
+ case AVM_ARG_MACHINE_RID:
+ case AVM_ARG_EXPRESSION_RID:
+ case AVM_ARG_SELF_RID:
+ case AVM_ARG_PARENT_RID:
+ case AVM_ARG_COMMUNICATOR_RID:
+ case AVM_ARG_SYSTEM_RID:
+ case AVM_ARG_ENVIRONMENT_RID:
+ case AVM_ARG_COMPONENT_SELF_RID:
+ case AVM_ARG_COMPONENT_PARENT_RID:
+ case AVM_ARG_COMPONENT_COMMUNICATOR_RID:
+ {
+ current( genArray( bytecode.dtype->as< ContainerTypeSpecifier >(),
+ return_decode_eval_machine( arg ) ));
+
+
+ return( true );
+ }
+
+
+ case AVM_ARG_EXPRESSION_KIND:
+ {
+ return( eval_processor_array_rvalue(
+ bytecode, arg.to_ptr< AvmCode >() ) );
+ }
+
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_array_rvalue :> "
+ "Unexpected argcode << " << bytecode.strCode()
+ << " >> for : " << arg.str() << " !!!"
+ << SEND_EXIT;
+
+ current( genArray(
+ bytecode.dtype->as< ContainerTypeSpecifier >(), arg) );
+
+ return( false );
+ }
+ }
+}
+
+
+BF ARGS_ENV::genArray(ContainerTypeSpecifier * arrayT, const BF & arg)
+{
+ BF value = ( arrayT->getContentsTypeSpecifier().isTypedArray() )?
+ genArray( arrayT->getContentsTypeSpecifier().rawContainer(), arg )
+ : arg;
+
+ return( BF( new ArrayBF(arrayT, value) ) );
+}
+
+
+
+bool ARGS_ENV::eval_processor_array_rvalue(AvmBytecode & bytecode, AvmCode * aCode)
+{
+ InstructionEnvironment EVAL_ARG(ENV, outED, aCode->size());
+ if( EVAL_ARG.mARG->main_decode_eval_args(aCode) )
+ {
+ outED = EVAL_ARG.mARG->outED;
+ }
+ else
+ {
+ return( aCode );
+ }
+
+ switch( aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_CONCAT:
+ {
+ const ArrayBF & arg1Array = EVAL_ARG.mARG->at(0).as_ref< ArrayBF >();
+ const ArrayBF & arg2Array = EVAL_ARG.mARG->at(1).as_ref< ArrayBF >();
+
+ ArrayBF * outArray = new ArrayBF( arg1Array.getTypeSpecifier(),
+ arg1Array.size() + arg2Array.size() );
+
+ avm_size_t offset = 0;
+ for( ; offset < arg1Array.size() ; ++offset )
+ {
+ outArray->set(offset, arg1Array[offset]);
+ }
+
+ for( avm_size_t pos = 0 ; pos < arg2Array.size() ; ++pos , ++offset )
+ {
+ outArray->set(offset, arg2Array[pos]);
+ }
+
+ current( BF( outArray ) );
+
+ return( true );
+ }
+
+ case AVM_OPCODE_REMOVE:
+ {
+ const ArrayBF & arg1Array = EVAL_ARG.mARG->at(0).as_ref< ArrayBF >();
+
+ ArrayBF * outArray = new ArrayBF(
+ arg1Array.getTypeSpecifier(), arg1Array.size() );
+
+ avm_size_t offset = 0;
+ for( avm_size_t pos = 0 ; pos < arg1Array.size() ; ++pos )
+ {
+ if( arg1Array[pos] == EVAL_ARG.mARG->at(1) )
+ {
+ outArray->set(offset, arg1Array[offset]);
+ ++offset;
+ }
+ }
+ outArray->resize( offset );
+
+ current( BF( outArray ) );
+
+ return( true );
+ }
+
+// case AVM_OPCODE_CTOR:
+// {
+// BF value = return_decode_eval_processor(
+// aCode->getInstruction()->getMainBytecode(), arg);
+//
+// current( genArray(
+// bytecode.dtype->as< ContainerTypeSpecifier >(), value) );
+//
+// return( true );
+// }
+
+ case AVM_OPCODE_CONTAINS:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).as_ref< ArrayBF >().contains(
+ EVAL_ARG.mARG->at(1)) ));
+
+ return( true );
+ }
+
+ case AVM_OPCODE_IN:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(1).as_ref< ArrayBF >().contains(
+ EVAL_ARG.mARG->at(0)) ));
+
+ return( true );
+ }
+ case AVM_OPCODE_NOTIN:
+ {
+ current( ExpressionConstructor::newBoolean( not
+ EVAL_ARG.mARG->at(1).as_ref< ArrayBF >().contains(
+ EVAL_ARG.mARG->at(0)) ));
+
+ return( true );
+ }
+
+ case AVM_OPCODE_STARTS_WITH:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).as_ref< ArrayBF >().startsWith(
+ EVAL_ARG.mARG->at(1).as_ref< ArrayBF >()) ));
+
+ return( true );
+ }
+ case AVM_OPCODE_ENDS_WITH:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).as_ref< ArrayBF >().endsWith(
+ EVAL_ARG.mARG->at(1).as_ref< ArrayBF >()) ));
+
+ return( true );
+ }
+
+ case AVM_OPCODE_EMPTY:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).as_ref< ArrayBF >().empty() ) );
+
+ return( true );
+ }
+
+ case AVM_OPCODE_NONEMPTY:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).as_ref< ArrayBF >().nonempty() ) );
+
+ return( true );
+ }
+ case AVM_OPCODE_SINGLETON:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).as_ref< ArrayBF >().singleton() ) );
+
+ return( true );
+ }
+ case AVM_OPCODE_POPULATED:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).as_ref< ArrayBF >().populated() ) );
+
+ return( true );
+ }
+
+ case AVM_OPCODE_SIZE:
+ {
+ current( ExpressionConstructor::newUInteger(
+ EVAL_ARG.mARG->at(0).as_ref< ArrayBF >().size() ) );
+
+ return( true );
+ }
+
+
+ case AVM_OPCODE_EQ:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).as_ref< ArrayBF >().isEQ(
+ EVAL_ARG.mARG->at(1).as_ref< ArrayBF >()) ));
+
+ return( true );
+ }
+ case AVM_OPCODE_SEQ:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).as_ref< ArrayBF >().isSEQ(
+ EVAL_ARG.mARG->at(1).as_ref< ArrayBF >()) ));
+
+ return( true );
+ }
+
+
+ case AVM_OPCODE_NEQ:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).as_ref< ArrayBF >().isNEQ(
+ EVAL_ARG.mARG->at(1).as_ref< ArrayBF >()) ));
+
+ return( true );
+ }
+ case AVM_OPCODE_NSEQ:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).as_ref< ArrayBF >().isNSEQ(
+ EVAL_ARG.mARG->at(1).as_ref< ArrayBF >()) ));
+
+ return( true );
+ }
+
+// case AVM_OPCODE_LT:
+// {
+// current( ExpressionConstructor::newBoolean(
+// EVAL_ARG.mARG->at(0).as_ref< ArrayBF >().isLT(
+// EVAL_ARG.mARG->at(1).as_ref< ArrayBF >()) ));
+//
+// return( true );
+// }
+// case AVM_OPCODE_LTE:
+// {
+// current( ExpressionConstructor::newBoolean(
+// EVAL_ARG.mARG->at(0).as_ref< ArrayBF >().isLTE(
+// EVAL_ARG.mARG->at(1).as_ref< ArrayBF >()) ));
+//
+// return( true );
+// }
+//
+// case AVM_OPCODE_GT:
+// {
+// current( ExpressionConstructor::newBoolean(
+// EVAL_ARG.mARG->at(0).as_ref< ArrayBF >().isGT(
+// EVAL_ARG.mARG->at(1).as_ref< ArrayBF >()) ));
+//
+// return( true );
+// }
+// case AVM_OPCODE_GTE:
+// {
+// current( ExpressionConstructor::newBoolean(
+// EVAL_ARG.mARG->at(0).as_ref< ArrayBF >().isGTE(
+// EVAL_ARG.mARG->at(1).as_ref< ArrayBF >()) ));
+//
+// return( true );
+// }
+
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_string :> "
+ "Unexpected bytecode << " << bytecode.strCode()
+ << " >> for : " << aCode->strDebug() << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// EVAL PROCESSOR QUEUE
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * EVAL PROCESSOR < AVM_ARG_COLLECTION_CPU >
+ */
+bool ARGS_ENV::eval_processor_vector(AvmBytecode & bytecode, BF & arg)
+{
+ switch( bytecode.operand )
+ {
+ case AVM_ARG_EXPRESSION_KIND:
+ {
+ return( eval_processor_vector(
+ bytecode, arg.to_ptr< AvmCode >() ));
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_queue :> "
+ "Unexpected bytecode << " << bytecode.strCode()
+ << " >> for : " << arg.str() << " !!!"
+ << SEND_EXIT;
+
+ current( arg );
+
+ return( false );
+ }
+ }
+}
+
+
+bool ARGS_ENV::eval_processor_vector(AvmBytecode & bytecode, AvmCode * aCode)
+{
+ InstructionEnvironment EVAL_ARG(ENV, outED, aCode->size());
+ if( EVAL_ARG.mARG->main_decode_eval_args(aCode) )
+ {
+ outED = EVAL_ARG.mARG->outED;
+ }
+ else
+ {
+ return( aCode );
+ }
+
+ switch( aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_CONTAINS:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).to_ptr< BuiltinVector >()
+ ->contains( EVAL_ARG.mARG->at(1) ) ));
+
+ return( true );
+ }
+
+ case AVM_OPCODE_IN:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(1).to_ptr< BuiltinVector >()
+ ->contains( EVAL_ARG.mARG->at(0) ) ));
+
+ return( true );
+ }
+ case AVM_OPCODE_NOTIN:
+ {
+ current( ExpressionConstructor::newBoolean( not
+ EVAL_ARG.mARG->at(1).to_ptr< BuiltinVector >()
+ ->contains( EVAL_ARG.mARG->at(0) ) ));
+
+ return( true );
+ }
+
+// case AVM_OPCODE_STARTS_WITH:
+// {
+// current( ExpressionConstructor::newBoolean( StringTools::startsWith(
+// EVAL_ARG.mARG->at(0).to_ptr< BuiltinVector >()->getValue(),
+// EVAL_ARG.mARG->at(1).to_ptr< BuiltinVector >()->getValue() )));
+//
+// return( true );
+// }
+// case AVM_OPCODE_ENDS_WITH:
+// {
+// current( ExpressionConstructor::newBoolean( StringTools::endsWith(
+// EVAL_ARG.mARG->at(0).to_ptr< BuiltinVector >()->getValue(),
+// EVAL_ARG.mARG->at(1).to_ptr< BuiltinVector >()->getValue() )));
+//
+// return( true );
+// }
+
+ case AVM_OPCODE_EMPTY:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0)
+ .to_ptr< BuiltinVector >()->empty() ) );
+
+ return( true );
+ }
+
+ case AVM_OPCODE_NONEMPTY:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0)
+ .to_ptr< BuiltinVector >()->nonempty() ) );
+
+ return( true );
+ }
+ case AVM_OPCODE_SINGLETON:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0)
+ .to_ptr< BuiltinVector >()->singleton() ) );
+
+ return( true );
+ }
+ case AVM_OPCODE_POPULATED:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0)
+ .to_ptr< BuiltinVector >()->populated() ) );
+
+ return( true );
+ }
+
+ case AVM_OPCODE_SIZE:
+ {
+ current( ExpressionConstructor::newUInteger(
+ EVAL_ARG.mARG->at(0)
+ .to_ptr< BuiltinVector >()->size() ) );
+
+ return( true );
+ }
+
+// case AVM_OPCODE_EQ:
+// case AVM_OPCODE_SEQ:
+// {
+// current( ExpressionConstructor::newBoolean(
+// EVAL_ARG.mARG->at(0).to_ptr< BuiltinVector >()->getValue().compare(
+// EVAL_ARG.mARG->at(1).to_ptr< BuiltinVector >()->getValue()) == 0 ));
+//
+// return( true );
+// }
+// case AVM_OPCODE_NEQ:
+// case AVM_OPCODE_NSEQ:
+// {
+// current( ExpressionConstructor::newBoolean(
+// EVAL_ARG.mARG->at(0).to_ptr< BuiltinVector >()->getValue().compare(
+// EVAL_ARG.mARG->at(1).to_ptr< BuiltinVector >()->getValue()) != 0 ) );
+//
+// return( true );
+// }
+//
+// case AVM_OPCODE_POP:
+// case AVM_OPCODE_PUSH:
+// case AVM_OPCODE_ASSIGN_TOP:
+// {
+// std::ostringstream oss;
+// for( begin() ; hasNext() ; next() )
+// {
+// oss << current().to_ptr< BuiltinVector >()->getValue();
+// }
+//
+// current( ExpressionConstructor::newString(oss.str()) );
+//
+// return( true );
+// }
+
+
+ case AVM_OPCODE_APPEND:
+ {
+ BuiltinVector * bVector =
+ EVAL_ARG.mARG->at(0).to_ptr< BuiltinVector >();
+ for( EVAL_ARG.mARG->begin(1) ; EVAL_ARG.mARG->hasNext() ;
+ EVAL_ARG.mARG->next() )
+ {
+ if( not bVector->add( EVAL_ARG.mARG->current() ) )
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << "THROW UNSATISFIED << APPEND >> : "
+ << outED->mRID.strUniqId() << " |=> "
+ << aCode->str() << std::endl;
+ AVM_OS_TRACE << "\t" << "<capacity:" << bVector->capacity()
+ << "> " << bVector->str() << " <=< "
+ << EVAL_ARG.mARG->current().str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+
+ return( false );
+ }
+ }
+
+ current( EVAL_ARG.mARG->at(0) );
+
+AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+ AVM_OS_TRACE << "rvalue:> " << bVector->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ return( true );
+ }
+
+ case AVM_OPCODE_REMOVE:
+ {
+ BuiltinVector * bVector =
+ EVAL_ARG.mARG->at(0).to_ptr< BuiltinVector >();
+ for( EVAL_ARG.mARG->begin(1) ; EVAL_ARG.mARG->hasNext() ;
+ EVAL_ARG.mARG->next() )
+ {
+ bVector->remove( EVAL_ARG.mARG->current() );
+ }
+
+ current( EVAL_ARG.mARG->at(0) );
+
+AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+ AVM_OS_TRACE << "rvalue:> " << bVector->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ return( true );
+ }
+
+
+ case AVM_OPCODE_CTOR:
+ {
+ BuiltinContainer * containerValue = BuiltinContainer::create(
+ EVAL_ARG.mARG->at(0).as_ptr< ContainerTypeSpecifier >() );
+
+ ArrayBF * arrayValue = EVAL_ARG.mARG->at(1).as_ptr< ArrayBF >();
+
+ containerValue->copy( arrayValue, std::min(
+ containerValue->capacity(), arrayValue->size()) );
+
+ current( BF( containerValue ) );
+
+ return( true );
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_queue :> "
+ "Unexpected bytecode << " << bytecode.strCode()
+ << " >> for : " << aCode->strDebug() << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// EVAL PROCESSOR COLLECTION
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * EVAL PROCESSOR < AVM_ARG_COLLECTION_CPU >
+ */
+bool ARGS_ENV::eval_processor_collection(AvmBytecode & bytecode, BF & arg)
+{
+ switch( bytecode.operand )
+ {
+ case AVM_ARG_EXPRESSION_KIND:
+ {
+ return( eval_processor_collection(
+ bytecode, arg.to_ptr< AvmCode >() ));
+ }
+
+ case AVM_ARG_BUILTIN_CONTAINER_KIND:
+ {
+ current( arg );
+
+ return( true );
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_collection :> "
+ "Unexpected bytecode << " << bytecode.strCode()
+ << " >> for : " << arg.str() << " !!!"
+ << SEND_EXIT;
+
+ current( arg );
+
+ return( false );
+ }
+ }
+}
+
+
+bool ARGS_ENV::eval_processor_collection(AvmBytecode & bytecode, AvmCode * aCode)
+{
+ InstructionEnvironment EVAL_ARG(ENV, outED, aCode->size());
+ if( EVAL_ARG.mARG->main_decode_eval_args(aCode) )
+ {
+ outED = EVAL_ARG.mARG->outED;
+ }
+ else
+ {
+ return( aCode );
+ }
+
+ switch( aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_CONTAINS:
+ {
+ BuiltinCollection * aCollection =
+ EVAL_ARG.mARG->at(0).to_ptr< BuiltinCollection >();
+
+ if( aCollection->contains( EVAL_ARG.mARG->at(1) ) )
+ {
+ current( ExpressionConstructor::newBoolean(true) );
+ }
+ else
+ {
+ if( aCollection->singleton() )
+ {
+ current( ExpressionConstructor::eqExpr(
+ aCollection->at(0), EVAL_ARG.mARG->at(1)) );
+ }
+ else if( aCollection->populated() )
+ {
+ current( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_CONTAINS,
+ EVAL_ARG.mARG->at(0), EVAL_ARG.mARG->at(1)) );
+ }
+
+ else
+ {
+ current( ExpressionConstructor::newBoolean(false) );
+ }
+ }
+
+// current( ExpressionConstructor::newBoolean(
+// EVAL_ARG.mARG->at(0).to_ptr< BuiltinCollection >()
+// ->contains( EVAL_ARG.mARG->at(1) ) ));
+
+ return( true );
+ }
+
+ case AVM_OPCODE_IN:
+ {
+ BuiltinCollection * aCollection =
+ EVAL_ARG.mARG->at(1).to_ptr< BuiltinCollection >();
+
+ if( aCollection->contains( EVAL_ARG.mARG->at(0) ) )
+ {
+ current( ExpressionConstructor::newBoolean(true) );
+ }
+ else
+ {
+ if( aCollection->singleton() )
+ {
+ current( ExpressionConstructor::eqExpr(
+ aCollection->at(0), EVAL_ARG.mARG->at(0)) );
+ }
+ else if( aCollection->populated() )
+ {
+ current( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_CONTAINS,
+ EVAL_ARG.mARG->at(1), EVAL_ARG.mARG->at(0)) );
+ }
+ else
+ {
+ current( ExpressionConstructor::newBoolean(false) );
+ }
+ }
+
+// current( ExpressionConstructor::newBoolean(
+// EVAL_ARG.mARG->at(1).to_ptr< BuiltinCollection >()
+// ->contains( EVAL_ARG.mARG->at(0) ) ));
+
+ return( true );
+ }
+ case AVM_OPCODE_NOTIN:
+ {
+ BuiltinCollection * aCollection =
+ EVAL_ARG.mARG->at(1).to_ptr< BuiltinCollection >();
+
+ if( aCollection->contains( EVAL_ARG.mARG->at(0) ) )
+ {
+ current( ExpressionConstructor::newBoolean(false) );
+ }
+ else
+ {
+ if( aCollection->singleton() )
+ {
+ current( ExpressionConstructor::neqExpr(
+ aCollection->at(0), EVAL_ARG.mARG->at(0)) );
+ }
+ else if( aCollection->populated() )
+ {
+ current( ExpressionConstructor::notExpr(
+ ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_CONTAINS,
+ EVAL_ARG.mARG->at(1), EVAL_ARG.mARG->at(0)) ));
+ }
+ else
+ {
+ current( ExpressionConstructor::newBoolean(true) );
+ }
+ }
+
+// current( ExpressionConstructor::newBoolean( not
+// EVAL_ARG.mARG->at(1).to_ptr< BuiltinCollection >()
+// ->contains( EVAL_ARG.mARG->at(0) ) ));
+
+ return( true );
+ }
+
+ case AVM_OPCODE_INTERSECT:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0).to_ptr< BuiltinList >()->intersect(
+ EVAL_ARG.mARG->at(1).as_ref< BuiltinList >() )));
+
+ return( true );
+ }
+
+// case AVM_OPCODE_STARTS_WITH:
+// {
+// current( ExpressionConstructor::newBoolean( StringTools::startsWith(
+// EVAL_ARG.mARG->at(0).to_ptr< BuiltinCollection >()->getValue(),
+// EVAL_ARG.mARG->at(1).to_ptr< BuiltinCollection >()->getValue() )));
+//
+// return( true );
+// }
+// case AVM_OPCODE_ENDS_WITH:
+// {
+// current( ExpressionConstructor::newBoolean( StringTools::endsWith(
+// EVAL_ARG.mARG->at(0).to_ptr< BuiltinCollection >()->getValue(),
+// EVAL_ARG.mARG->at(1).to_ptr< BuiltinCollection >()->getValue() )));
+//
+// return( true );
+// }
+
+ case AVM_OPCODE_EMPTY:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0)
+ .to_ptr< BuiltinCollection >()->empty() ) );
+
+ return( true );
+ }
+
+ case AVM_OPCODE_NONEMPTY:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0)
+ .to_ptr< BuiltinCollection >()->nonempty() ) );
+
+ return( true );
+ }
+ case AVM_OPCODE_SINGLETON:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0)
+ .to_ptr< BuiltinCollection >()->singleton() ));
+
+ return( true );
+ }
+ case AVM_OPCODE_POPULATED:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0)
+ .to_ptr< BuiltinCollection >()->populated()) );
+
+ return( true );
+ }
+ case AVM_OPCODE_FULL:
+ {
+ current( ExpressionConstructor::newBoolean(
+ EVAL_ARG.mARG->at(0)
+ .to_ptr< BuiltinCollection >()->full() ) );
+
+ return( true );
+ }
+
+ case AVM_OPCODE_SIZE:
+ {
+ current( ExpressionConstructor::newUInteger(
+ EVAL_ARG.mARG->at(0)
+ .to_ptr< BuiltinCollection >()->size() ) );
+
+ return( true );
+ }
+
+// case AVM_OPCODE_EQ:
+// case AVM_OPCODE_SEQ:
+// {
+// current( ExpressionConstructor::newBoolean(
+// EVAL_ARG.mARG->at(0).to_ptr< BuiltinCollection >()->getValue().compare(
+// EVAL_ARG.mARG->at(1).to_ptr< BuiltinCollection >()->getValue()) == 0 ));
+//
+// return( true );
+// }
+// case AVM_OPCODE_NEQ:
+// case AVM_OPCODE_NSEQ:
+// {
+// current( ExpressionConstructor::newBoolean(
+// EVAL_ARG.mARG->at(0).to_ptr< BuiltinCollection >()->getValue().compare(
+// EVAL_ARG.mARG->at(1).to_ptr< BuiltinCollection >()->getValue()) != 0 ) );
+//
+// return( true );
+// }
+
+
+ case AVM_OPCODE_TOP:
+ {
+ current( EVAL_ARG.mARG->at(0).as_ptr< BuiltinQueue >()->top() );
+
+ return( true );
+ }
+
+ case AVM_OPCODE_POP:
+ {
+ current( EVAL_ARG.mARG->at(0).as_ptr< BuiltinQueue >()->pop() );
+
+ return( true );
+ }
+
+ case AVM_OPCODE_POP_FROM:
+ {
+ current( EVAL_ARG.mARG->at(0).as_ptr< BuiltinQueue >()->pop_from(
+ EVAL_ARG.mARG->at(1).as_ref< BuiltinList >()) );
+
+ return( true );
+ }
+
+ case AVM_OPCODE_PUSH:
+ {
+ BuiltinContainer * queue =
+ EVAL_ARG.mARG->at(0).as_ptr< BuiltinContainer >();
+ for( EVAL_ARG.mARG->begin(1) ; EVAL_ARG.mARG->hasNext() ;
+ EVAL_ARG.mARG->next() )
+ {
+ if( not queue->push( EVAL_ARG.mARG->current() ) )
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << "THROW UNSATISFIED << PUSH >> : "
+ << outED->mRID.strUniqId() << " |=> "
+ << aCode->str() << std::endl;
+ AVM_OS_TRACE << "\t" << "<capacity:" << queue->capacity()
+ << "> " << queue->str() << " <=< "
+ << EVAL_ARG.mARG->current().str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+
+ return( false );
+ }
+ }
+
+ current( EVAL_ARG.mARG->at(0) );
+
+AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+ AVM_OS_TRACE << "rvalue:> " << queue->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ return( true );
+ }
+
+ case AVM_OPCODE_APPEND:
+ {
+ BuiltinContainer * queue =
+ EVAL_ARG.mARG->at(0).to_ptr< BuiltinContainer >();
+ for( EVAL_ARG.mARG->begin(1) ; EVAL_ARG.mARG->hasNext() ;
+ EVAL_ARG.mARG->next() )
+ {
+ if( not queue->add( EVAL_ARG.mARG->current() ) )
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << "THROW UNSATISFIED << APPEND >> : "
+ << outED->mRID.strUniqId() << " |=> "
+ << aCode->str() << std::endl;
+ AVM_OS_TRACE << "\t" << "<capacity:" << queue->capacity()
+ << "> " << queue->str() << " <=< "
+ << EVAL_ARG.mARG->current().str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+
+ return( false );
+ }
+ }
+
+ current( EVAL_ARG.mARG->at(0) );
+
+AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+ AVM_OS_TRACE << "rvalue:> " << queue->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ return( true );
+ }
+
+ case AVM_OPCODE_REMOVE:
+ {
+ BuiltinContainer * queue =
+ EVAL_ARG.mARG->at(0).to_ptr< BuiltinContainer >();
+ for( EVAL_ARG.mARG->begin(1) ; EVAL_ARG.mARG->hasNext() ;
+ EVAL_ARG.mARG->next() )
+ {
+ queue->remove( EVAL_ARG.mARG->current() );
+ }
+
+ current( EVAL_ARG.mARG->at(0) );
+
+AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+ AVM_OS_TRACE << "rvalue:> " << queue->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ return( true );
+ }
+
+ case AVM_OPCODE_ASSIGN_TOP:
+ {
+ BuiltinQueue * queue = EVAL_ARG.mARG->at(0).to_ptr< BuiltinQueue >();
+ if( queue->nonempty() )
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+ AVM_OS_TRACE << "lvalue:queue> " << queue->str() << std::endl;
+ AVM_OS_TRACE << "rvalue:> " << EVAL_ARG.mARG->at(1).str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ if( queue->top( EVAL_ARG.mARG->at(1) ) )
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+ AVM_OS_TRACE << "queue> " << queue->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ current( EVAL_ARG.mARG->at(1) );
+
+ return( true );
+ }
+ else
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << "THROW UNSATISFIED << ASSING#TOP >> : "
+ << outED->mRID.strUniqId() << " |=> "
+ << aCode->str() << std::endl;
+ AVM_OS_TRACE << "\t" << "assign#top in queue << "
+ << EVAL_ARG.mARG->at(0).str() << " >> failed !!!"
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+
+ return( false );
+ }
+ }
+ else
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << "THROW UNSATISFIED << ASSING#TOP >> : "
+ << outED->mRID.strUniqId() << " |=> "
+ << aCode->str() << std::endl;
+ AVM_OS_TRACE << "\t" << "Unexpected an empty queue << "
+ << EVAL_ARG.mARG->at(0).str() << " >>" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+
+ return( false );
+ }
+ }
+
+ case AVM_OPCODE_CTOR:
+ {
+ BuiltinContainer * containerValue = BuiltinContainer::create(
+ EVAL_ARG.mARG->at(0).as_ptr< ContainerTypeSpecifier >() );
+
+ ArrayBF * arrayValue = EVAL_ARG.mARG->at(1).as_ptr< ArrayBF >();
+
+ containerValue->copy( arrayValue, std::min(
+ containerValue->capacity(), arrayValue->size()) );
+
+ current( BF( containerValue ) );
+
+ return( true );
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_collection :> "
+ "Unexpected bytecode << " << bytecode.strCode()
+ << " >> for : " << aCode->strDebug() << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// EVAL PROCESSOR BUFFER
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * EVAL PROCESSOR < AVM_ARG_COLLECTION_CPU >
+ */
+bool ARGS_ENV::eval_processor_buffer(AvmBytecode & bytecode, BF & arg)
+{
+ switch( bytecode.operand )
+ {
+ case AVM_ARG_EXPRESSION_KIND:
+ {
+ return( eval_processor_buffer(
+ bytecode, arg.to_ptr< AvmCode >() ));
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_buffer :> "
+ "Unexpected bytecode << " << bytecode.strCode()
+ << " >> for : " << arg.str() << " !!!"
+ << SEND_EXIT;
+
+ current( arg );
+
+ return( false );
+ }
+ }
+}
+
+
+bool ARGS_ENV::eval_processor_buffer(AvmBytecode & bytecode, AvmCode * aCode)
+{
+ InstructionEnvironment EVAL_ARG(ENV, outED, aCode->size());
+ if( EVAL_ARG.mARG->main_decode_eval_args(aCode) )
+ {
+ outED = EVAL_ARG.mARG->outED;
+ }
+ else
+ {
+ return( aCode );
+ }
+
+ switch( aCode->getAvmOpCode() )
+ {
+// case AVM_OPCODE_CONTAINS:
+// {
+// current( ExpressionConstructor::newBoolean(
+// EVAL_ARG.mARG->at(0).to_ptr< BaseBufferForm >()
+// ->contains( EVAL_ARG.mARG->at(1) ) ));
+//
+// return( true );
+// }
+//
+// case AVM_OPCODE_IN:
+// {
+// current( ExpressionConstructor::newBoolean(
+// EVAL_ARG.mARG->at(1).to_ptr< BaseBufferForm >()
+// ->contains( EVAL_ARG.mARG->at(0) ) ));
+//
+// return( true );
+// }
+// case AVM_OPCODE_NOTIN:
+// {
+// current( ExpressionConstructor::newBoolean( not
+// EVAL_ARG.mARG->at(1).to_ptr< BaseBufferForm >()
+// ->contains( EVAL_ARG.mARG->at(0) ) ));
+//
+// return( true );
+// }
+//
+//// case AVM_OPCODE_STARTS_WITH:
+//// {
+//// current( ExpressionConstructor::newBoolean( StringTools::startsWith(
+//// EVAL_ARG.mARG->at(0).to_ptr< BaseBufferForm >()->getValue(),
+//// EVAL_ARG.mARG->at(1).to_ptr< BaseBufferForm >()->getValue() )));
+////
+//// return( true );
+//// }
+//// case AVM_OPCODE_ENDS_WITH:
+//// {
+//// current( ExpressionConstructor::newBoolean( StringTools::endsWith(
+//// EVAL_ARG.mARG->at(0).to_ptr< BaseBufferForm >()->getValue(),
+//// EVAL_ARG.mARG->at(1).to_ptr< BaseBufferForm >()->getValue() )));
+////
+//// return( true );
+//// }
+//
+// case AVM_OPCODE_EMPTY:
+// {
+// current( ExpressionConstructor::newBoolean(
+// EVAL_ARG.mARG->at(0)
+// .to_ptr< BaseBufferForm >()->empty() ) );
+//
+// return( true );
+// }
+//
+// case AVM_OPCODE_NONEMPTY:
+// {
+// current( ExpressionConstructor::newBoolean(
+// EVAL_ARG.mARG->at(0)
+// .to_ptr< BaseBufferForm >()->nonempty() ) );
+//
+// return( true );
+// }
+// case AVM_OPCODE_SINGLETON:
+// {
+// current( ExpressionConstructor::newBoolean(
+// EVAL_ARG.mARG->at(0)
+// .to_ptr< BaseBufferForm >()->singleton() ) );
+//
+// return( true );
+// }
+// case AVM_OPCODE_POPULATED:
+// {
+// current( ExpressionConstructor::newBoolean(
+// EVAL_ARG.mARG->at(0)
+// .to_ptr< BaseBufferForm >()->populated() ) );
+//
+// return( true );
+// }
+// case AVM_OPCODE_FULL:
+// {
+// current( ExpressionConstructor::newBoolean(
+// EVAL_ARG.mARG->at(0)
+// .to_ptr< BaseBufferForm >()->full() ) );
+//
+// return( true );
+// }
+//
+// case AVM_OPCODE_SIZE:
+// {
+// current( ExpressionConstructor::newUInteger(
+// EVAL_ARG.mARG->at(0)
+// .to_ptr< BaseBufferForm >()->size() ) );
+//
+// return( true );
+// }
+//
+//// case AVM_OPCODE_EQ:
+//// case AVM_OPCODE_SEQ:
+//// {
+//// current( ExpressionConstructor::newBoolean(
+//// EVAL_ARG.mARG->at(0).to_ptr< BaseBufferForm >()->getValue().compare(
+//// EVAL_ARG.mARG->at(1).to_ptr< BaseBufferForm >()->getValue()) == 0 ));
+////
+//// return( true );
+//// }
+//// case AVM_OPCODE_NEQ:
+//// case AVM_OPCODE_NSEQ:
+//// {
+//// current( ExpressionConstructor::newBoolean(
+//// EVAL_ARG.mARG->at(0).to_ptr< BaseBufferForm >()->getValue().compare(
+//// EVAL_ARG.mARG->at(1).to_ptr< BaseBufferForm >()->getValue()) != 0 ) );
+////
+//// return( true );
+//// }
+//
+//
+// case AVM_OPCODE_TOP:
+// {
+// current( EVAL_ARG.mARG->at(0).to_ptr< BaseBufferForm >()->top() );
+//
+// return( true );
+// }
+// case AVM_OPCODE_POP:
+// {
+// current( EVAL_ARG.mARG->at(0).to_ptr< BaseBufferForm >()->pop() );
+//
+// return( true );
+// }
+//
+// case AVM_OPCODE_PUSH:
+// {
+// BaseBufferForm * queue = EVAL_ARG.mARG->at(0).to_ptr< BaseBufferForm >();
+// for( EVAL_ARG.mARG->begin(1) ; EVAL_ARG.mARG->hasNext() ; EVAL_ARG.mARG->next() )
+// {
+// if( not queue->push( EVAL_ARG.mARG->current() ) )
+// {
+//AVM_IF_DEBUG_FLAG( STATEMENT)
+// AVM_OS_TRACE << "THROW UNSATISFIED << PUSH >> : "
+// << outED->mRID.strUniqId() << " |=> "
+// << aCode->str() << std::endl;
+// AVM_OS_TRACE << "\t" << "<capacity:" << queue->capacity()
+// << "> " << queue->str() << " <=< "
+// << EVAL_ARG.mARG->current().str() << std::endl;
+//AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+//
+// return( false );
+// }
+// }
+//AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+// AVM_OS_TRACE << "rvalue:> " << queue->str() << std::endl;
+//AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+//
+// return( true );
+// }
+//
+// case AVM_OPCODE_APPEND:
+// {
+// BaseBufferForm * queue = EVAL_ARG.mARG->at(0).to_ptr< BaseBufferForm >();
+// for( EVAL_ARG.mARG->begin(1) ; EVAL_ARG.mARG->hasNext() ; EVAL_ARG.mARG->next() )
+// {
+// if( not queue->append( EVAL_ARG.mARG->current() ) )
+// {
+//AVM_IF_DEBUG_FLAG( STATEMENT)
+// AVM_OS_TRACE << "THROW UNSATISFIED << APPEND >> : "
+// << outED->mRID.strUniqId() << " |=> "
+// << aCode->str() << std::endl;
+// AVM_OS_TRACE << "\t" << "<capacity:" << queue->capacity()
+// << "> " << queue->str() << " <=< "
+// << EVAL_ARG.mARG->current().str() << std::endl;
+//AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+//
+// return( false );
+// }
+// }
+//AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+// AVM_OS_TRACE << "rvalue:> " << queue->str() << std::endl;
+//AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+//
+// return( true );
+// }
+
+ case AVM_OPCODE_REMOVE:
+ {
+ BaseBufferForm * bbf = EVAL_ARG.mARG->at(0).to_ptr< BaseBufferForm >();
+ if( EVAL_ARG.mARG->at(1).is< InstanceOfPort >() )
+ {
+ bbf->remove( EVAL_ARG.mARG->at(1).to_ptr< InstanceOfPort >() );
+
+AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+ AVM_OS_TRACE << "rvalue:> " << bbf->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ return( true );
+ }
+
+ return( false );
+ }
+
+// case AVM_OPCODE_ASSIGN_TOP:
+// {
+// BaseBufferForm * queue = EVAL_ARG.mARG->at(0).to_ptr< BaseBufferForm >();
+// if( queue->nonempty() )
+// {
+//AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+// AVM_OS_TRACE << "lvalue:queue> " << queue->str() << std::endl;
+// AVM_OS_TRACE << "rvalue:> " << EVAL_ARG.mARG->at(1).str() << std::endl;
+//AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+//
+// if( queue->top( EVAL_ARG.mARG->at(1) ) )
+// {
+//AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+// AVM_OS_TRACE << "queue> " << queue->str() << std::endl;
+//AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+//
+// current( EVAL_ARG.mARG->at(1) );
+//
+// return( true );
+// }
+// else
+// {
+//AVM_IF_DEBUG_FLAG( STATEMENT)
+// AVM_OS_TRACE << "THROW UNSATISFIED << ASSING#TOP >> : "
+// << outED->mRID.strUniqId() << " |=> "
+// << aCode->str() << std::endl;
+// AVM_OS_TRACE << "\t" << "assign#top in queue << "
+// << EVAL_ARG.mARG->at(0).str() << " >> failed !!!"
+// << std::endl;
+//AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+//
+// return( false );
+// }
+// }
+// else
+// {
+//AVM_IF_DEBUG_FLAG( STATEMENT)
+// AVM_OS_TRACE << "THROW UNSATISFIED << ASSING#TOP >> : "
+// << outED->mRID.strUniqId() << " |=> "
+// << aCode->str() << std::endl;
+// AVM_OS_TRACE << "\t" << "Unexpected an empty queue << "
+// << EVAL_ARG.mARG->at(0).str() << " >>" << std::endl;
+//AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+//
+// return( false );
+// }
+// }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ARGS_ENV::eval_processor_collection :> "
+ "Unexpected bytecode << " << bytecode.strCode()
+ << " >> for : " << aCode->strDebug() << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Serialization
+ */
+void ARGS_ENV::argsStream(OutStream & os)
+{
+ begin();
+
+ if( hasNext() )
+ {
+ os << TAB << "$[" << EOL_TAB2 << current().str();
+
+ for( next() ; hasNext() ; next() )
+ {
+ os << " ," << EOL_TAB2 << current().str();
+ }
+
+ os << EOL_TAB << "]" << EOL_FLUSH;
+ }
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/computer/instruction/InstructionEnvironment.h b/org.eclipse.efm.symbex/src/computer/instruction/InstructionEnvironment.h
new file mode 100644
index 0000000..cd7c214
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/instruction/InstructionEnvironment.h
@@ -0,0 +1,430 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 16 avr. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef INSTRUCTIONENVIRONMENT_H_
+#define INSTRUCTIONENVIRONMENT_H_
+
+#include <common/AvmObject.h>
+#include <common/BF.h>
+
+#include <collection/List.h>
+#include <collection/Vector.h>
+
+#include <fml/runtime/ExecutionData.h>
+
+
+#define ARGS_ENV_INITIAL_CACHE_COUNT 32
+
+#define ARGS_ENV_DEFAULT_CAPACITY 16
+
+#define ARGS_ENV_INCR_CAPACITY 8
+
+
+
+namespace sep
+{
+
+class AvmCode;
+class ArrayBF;
+class BaseEnvironment;
+class ContainerTypeSpecifier;
+
+
+struct ARGS_ENV
+{
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ARGS_ENV(BaseEnvironment * aENV,
+ const APExecutionData & outED,
+ avm_size_t aCapacity, avm_size_t aCount)
+ : NEXT( NULL ),
+ ENV( aENV ),
+ outED( outED ),
+ table( aCount ),
+ values( & table ),
+
+ argsInstruction( NULL ),
+ argsBytecode( NULL ),
+
+ capacity( aCapacity ),
+ count( aCount ),
+ idx( 0 )
+ {
+ table.reserve( aCapacity );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ AVM_OS_TRACE << "new ARGS_ENV :>"
+ << " capacity = " << std::setw(4) << capacity
+ << " : count = " << std::setw(4) << count
+ << " @" << avm_address_t( this ) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ARGS_ENV()
+ {
+ values = NULL;
+ table.clear();
+ capacity = count = idx = 0;
+ }
+
+
+ /**
+ * EMPTYNESS
+ */
+ inline bool empty() const
+ {
+ return( count == 0 );
+ }
+
+ inline bool nonempty() const
+ {
+ return( count > 0 );
+ }
+
+
+ /**
+ * ITERATOR
+ */
+ inline void begin(avm_size_t offset = 0)
+ {
+ idx = offset;
+ }
+
+ inline bool hasNext() const
+ {
+ return( idx < count );
+ }
+
+ inline BF & current()
+ {
+ return( (*values)[ idx ] );
+ }
+
+ inline BF & current(avm_size_t offset)
+ {
+ return( (*values)[ offset ] );
+ }
+
+ inline void current(const BF & val)
+ {
+ (*values)[ idx ] = val;
+ }
+
+ inline void current_next(const BF & val)
+ {
+ (*values)[ idx ] = val;
+ ++idx;
+ }
+
+ inline void next()
+ {
+ ++idx;
+ }
+
+
+ /**
+ * GETTER
+ */
+ inline BF & operator[](avm_size_t offset)
+ {
+ return( (*values)[ offset ] );
+ }
+
+ inline const BF & operator[](avm_size_t offset) const
+ {
+ return( (*values)[ offset ] );
+ }
+
+
+ inline BF & at(avm_size_t offset)
+ {
+ return( (*values)[ offset ] );
+ }
+
+ inline const BF & at(avm_size_t offset) const
+ {
+ return( (*values)[ offset ] );
+ }
+
+
+
+ /**
+ * DECODE EVAL CONTEXT
+ */
+ bool main_decode_eval(BFCode & inCODE);
+
+ bool main_decode_eval_args(AvmCode * inCODE);
+
+
+ bool decode_eval_args_context(AvmBytecode & bytecode, AvmCode * inCODE);
+
+ /**
+ * DECODE EVAL PROCESSOR
+ */
+ bool decode_eval_args_processor(AvmBytecode & bytecode, AvmCode * inCODE);
+
+ bool decode_eval_processor(AvmBytecode & bytecode, AvmCode * inCODE);
+ bool decode_eval_processor(AvmBytecode & bytecode, BF & arg);
+
+ BF return_decode_eval_processor(AvmBytecode & bytecode, BF & arg);
+
+
+ bool decode_eval_processor(BFCode & aCode);
+ BF return_decode_eval_processor(BFCode & aCode);
+
+ /**
+ * EVAL PROCESSOR < AVM_ARG_MEMORY_UFI_POINTER_CPU >
+ */
+ bool eval_processor_dma_lvalue_ufi_pointer(AvmBytecode & bytecode, BF & arg);
+
+ bool eval_processor_dma_wvalue_ufi_pointer(AvmBytecode & bytecode, BF & arg);
+
+ bool eval_processor_dma_rvalue_ufi_pointer(AvmBytecode & bytecode, BF & arg);
+
+ /**
+ * EVAL PROCESSOR < AVM_ARG_MEMORY_LVALUE_CPU >
+ */
+ bool eval_processor_dma_lvalue(AvmBytecode & bytecode, BF & arg);
+
+ /**
+ * EVAL PROCESSOR < AVM_ARG_MEMORY_WVALUE_CPU >
+ */
+ bool eval_processor_dma_wvalue(AvmBytecode & bytecode, BF & arg);
+
+ /**
+ * EVAL PROCESSOR < AVM_ARG_MEMORY_RVALUE_CPU >
+ */
+ bool eval_processor_dma_rvalue(AvmBytecode & bytecode, BF & arg);
+ bool eval_processor_dma_rvalue(AvmBytecode & bytecode, AvmCode * aCode);
+
+ bool decode_eval_rvalue(BF & arg);
+
+ BF return_decode_eval_rvalue(BF & arg);
+
+ /**
+ * EVAL PROCESSOR < AVM_ARG_MEMORY_MACHINE_CPU >
+ */
+ bool eval_processor_dma_machine(AvmBytecode & bytecode, BF & arg);
+ bool eval_processor_dma_machine(AvmBytecode & bytecode, AvmCode * aCode);
+
+ const RuntimeID & return_decode_eval_machine(const BF & anElement);
+
+ /**
+ * EVAL PROCESSOR < AVM_ARG_ARITHMETIC_LOGIC_CPU >
+ */
+ bool eval_processor_alu(AvmBytecode & bytecode, BF & arg);
+ bool eval_processor_alu(AvmBytecode & bytecode, AvmCode * aCode);
+
+ /**
+ * EVAL PROCESSOR < AVM_ARG_STATEMENT_CPU >
+ */
+ bool eval_processor_statement(AvmBytecode & bytecode, AvmCode * aCode);
+
+ /**
+ * EVAL PROCESSOR < AVM_ARG_CHARACTER_CPU >
+ */
+ bool eval_processor_character(AvmBytecode & bytecode, BF & arg);
+ bool eval_processor_character(AvmBytecode & bytecode, AvmCode * aCode);
+
+ /**
+ * EVAL PROCESSOR < AVM_ARG_STRING_CPU >
+ */
+ bool eval_processor_string(AvmBytecode & bytecode, BF & arg);
+ bool eval_processor_string(AvmBytecode & bytecode, AvmCode * aCode);
+
+ /**
+ * EVAL PROCESSOR < AVM_ARG_ARRAY_[L|V]_CPU >
+ */
+ bool eval_processor_array_lvalue(AvmBytecode & bytecode, BF & arg);
+
+ bool eval_processor_array_rvalue(AvmBytecode & bytecode, BF & arg);
+
+ BF genArray(ContainerTypeSpecifier * arrayT, const BF & arg);
+
+ bool eval_processor_array_rvalue(AvmBytecode & bytecode, AvmCode * aCode);
+
+
+ /**
+ * EVAL PROCESSOR < AVM_ARG_VECTOR_CPU >
+ */
+ bool eval_processor_vector(AvmBytecode & bytecode, BF & arg);
+ bool eval_processor_vector(AvmBytecode & bytecode, AvmCode * aCode);
+
+
+ /**
+ * EVAL PROCESSOR < AVM_ARG_QUEUE_CPU >
+ * EVAL PROCESSOR < AVM_ARG_LIST_CPU >
+ * EVAL PROCESSOR < AVM_ARG_COLLECTION_CPU >
+ */
+ bool eval_processor_collection(AvmBytecode & bytecode, BF & arg);
+ bool eval_processor_collection(AvmBytecode & bytecode, AvmCode * aCode);
+
+
+ /**
+ * EVAL PROCESSOR < AVM_ARG_BUFFER_CPU >
+ */
+ bool eval_processor_buffer(AvmBytecode & bytecode, BF & arg);
+ bool eval_processor_buffer(AvmBytecode & bytecode, AvmCode * aCode);
+
+
+ /**
+ * DECODE EVAL RVALUE
+ */
+ BF ginac_return_decode_eval_rvalue(BF & arg);
+
+
+ /**
+ * Serialization
+ */
+ void argsStream(OutStream & os);
+
+
+ // Attribute
+ ARGS_ENV * NEXT;
+
+ BaseEnvironment * ENV;
+
+ APExecutionData outED;
+
+ RuntimeID mCTX;
+
+ Vector< BF > table;
+ Vector< BF > * values;
+
+ // Attributes
+ AvmInstruction * argsInstruction;
+ AvmBytecode * argsBytecode;
+
+ avm_size_t capacity;
+ avm_size_t count;
+ avm_size_t idx;
+
+
+ static avm_size_t CALL_COUNT;
+
+ static avm_size_t CALL_COUNT_GINAC;
+
+};
+
+
+
+class InstructionEnvironment :
+ public AvmObject,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( InstructionEnvironment )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( InstructionEnvironment )
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ InstructionEnvironment(BaseEnvironment & ENV);
+
+ InstructionEnvironment(BaseEnvironment & ENV, avm_size_t count);
+
+ InstructionEnvironment(BaseEnvironment * ENV,
+ const APExecutionData & outED, avm_size_t count)
+ : AvmObject( ),
+ mARG( newARGS(ENV, outED, count) ),
+ itARG( mARG )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~InstructionEnvironment()
+ {
+ freeARGS( mARG );
+ }
+
+
+ /**
+ * GETTER -- SETTER
+ * value
+ */
+// inline const BF & get() const
+// {
+// return( theArg->values[ idx ] );
+// }
+//
+// inline const BF & get(const avm_size_t offset) const
+// {
+// return( theArg->values[ offset ] );
+// }
+//
+// inline void set(const BF & bf)
+// {
+// theArg->values[theArg->idx ] = bf;
+// }
+//
+// inline void set(const avm_size_t offset, const BF & bf)
+// {
+// theArg->values[ offset ] = bf;
+// }
+
+
+ /**
+ * Serialization
+ */
+ inline void toStream(OutStream & os) const
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * Attributes
+ */
+
+ ARGS_ENV * mARG;
+
+ ARGS_ENV * itARG;
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // CACHE MANAGER
+ ///////////////////////////////////////////////////////////////////////////
+ static List< ARGS_ENV * > ARGS_ENV_CACHE;
+
+ static void initCache();
+
+ static void finalizeCache();
+
+
+ static ARGS_ENV * newARGS(BaseEnvironment * ENV,
+ const APExecutionData & anED, avm_size_t count);
+
+ static void freeARGS(ARGS_ENV * & arg);
+
+
+
+};
+
+
+
+} /* namespace sep */
+#endif /* INSTRUCTIONENVIRONMENT_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmActivityPrimitive.cpp b/org.eclipse.efm.symbex/src/computer/primitive/AvmActivityPrimitive.cpp
new file mode 100644
index 0000000..51c042b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmActivityPrimitive.cpp
@@ -0,0 +1,2042 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmActivityPrimitive.h"
+
+#include <builder/Loader.h>
+
+#include <computer/primitive/AvmSynchronizationFactory.h>
+
+#include <computer/ExecutionEnvironment.h>
+#include <computer/ExecutionDataFactory.h>
+
+#include <fml/buffer/BaseBufferForm.h>
+
+#include <fml/executable/ExecutableLib.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/StatementFactory.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/ExecutionConfiguration.h>
+#include <fml/runtime/ExecutionSynchronizationPoint.h>
+#include <fml/runtime/RuntimeDef.h>
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+
+/**
+ ***************************************************************************
+ * execution of an CONTEXT_SWITCHER program
+ ***************************************************************************
+ */
+bool AvmPrimitive_ContextSwitcher::run(ExecutionEnvironment & ENV)
+{
+ RuntimeID saveRID = ENV.mARG->outED->mRID;
+
+ ExecutionEnvironment tmpENV(ENV, ENV.mARG->outED,
+ ENV.mARG->at(0).bfRID(), ENV.mARG->at(1).bfCode() );
+
+ if( tmpENV.run() )
+ {
+ if( tmpENV.outEDS.nonempty() )
+ {
+ tmpENV.restoreContext( saveRID );
+
+ ENV.spliceOutput( tmpENV );
+ }
+ }
+ else
+ {
+ return( false );
+ }
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of an INIT program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Init::run(ExecutionEnvironment & ENV)
+{
+ const RuntimeID & tmpRID = ENV.mARG->at(0).bfRID();
+
+ if( ENV.mARG->outED->isDestroyed( tmpRID ) )
+ {
+ return( true );
+ }
+ else if( ENV.mARG->outED->isRunnable( tmpRID ) )
+ {
+ if( tmpRID.getExecutable()->hasOnInit() )
+ {
+ ExecutionEnvironment tmpENV(ENV, ENV.mARG->outED,
+ tmpRID, tmpRID.getExecutable()->getOnInit());
+
+ if( tmpENV.run(PROCESS_INITING_STATE) )
+ {
+ ENV.spliceNotOutput(tmpENV);
+
+ if( not ENV.appendOutput_mwsetPES_mwsetAEES(tmpENV, tmpRID,
+ PROCESS_INITING_STATE, PROCESS_IDLE_STATE) )
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ else if( not ENV.appendOutput_mwsetPES(
+ ENV.mARG->outED, tmpRID, PROCESS_IDLE_STATE) )
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ if( not ENV.mARG->outED->hasRunnableElementTrace() )
+// if( ENV.mARG->outED->isCreated( tmpRID ) )
+ {
+ ENV.mARG->outED->mAEES = AEES_STMNT_NOTHING;
+ }
+
+ ENV.outEDS.append( ENV.mARG->outED );
+ }
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a FINAL program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Final::run(ExecutionEnvironment & ENV)
+{
+ const RuntimeID & tmpRID = ENV.mARG->at(0).bfRID();
+
+ if( ENV.mARG->outED->isunRunnable( tmpRID ) )
+ {
+ return( true );
+ }
+ else if( ENV.mARG->outED->isRunnable( tmpRID ) )
+ {
+ if( tmpRID.getExecutable()->hasOnFinal() )
+ {
+ ExecutionEnvironment tmpENV(ENV, ENV.mARG->outED, tmpRID,
+ tmpRID.getExecutable()->getOnFinal());
+
+ if( tmpENV.run(PROCESS_FINALIZING_STATE) )
+ {
+ if( finalizedParent(ENV, tmpENV, tmpRID) )
+ {
+ ENV.spliceNotOutput(tmpENV);
+
+ return( true );
+ }
+ }
+ }
+ else
+ {
+ if( finalizedParent(ENV, ENV.mARG->outED, tmpRID) )
+ {
+ return( true );
+ }
+ }
+ }
+ else
+ {
+ ENV.outEDS.append( ENV.mARG->outED );
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+bool AvmPrimitive_Final::finalizedParent(ExecutionEnvironment & ENV,
+ ExecutionEnvironment & tmpENV, const RuntimeID & aRID)
+{
+ ListOfAPExecutionData::iterator itED = tmpENV.outEDS.begin();
+ ListOfAPExecutionData::iterator endED = tmpENV.outEDS.end();
+ for( ; itED != endED ; ++itED )
+ {
+ if( not finalizedParent(ENV, (*itED), aRID) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+}
+
+
+bool AvmPrimitive_Final::finalizedParent(ExecutionEnvironment & ENV,
+ APExecutionData & anED, const RuntimeID & aRID)
+{
+ anED.mwsetRuntimeFormState(aRID, PROCESS_FINALIZED_STATE);
+
+ anED->setAEES( RuntimeDef::PES_to_AEES(
+ PROCESS_FINALIZED_STATE, anED->getAEES()) );
+
+ List< RuntimeID > runnableRID;
+
+ RuntimeID tmpRID = aRID;
+ bool finalizeSelf;
+
+ while( (tmpRID = tmpRID.getPRID()).valid() )
+ {
+ const RuntimeForm & tmpRF = anED->getRuntime(tmpRID);
+ finalizeSelf = false;
+
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( tmpRF.hasChild() )
+ << "Unexpectded PRID RF with out child :> \n"
+ << tmpRF.toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ if( tmpRID.getSpecifier().isMocCompositeStructure() )
+ {
+ TableOfRuntimeID::const_iterator it = tmpRF.beginChild();
+ TableOfRuntimeID::const_iterator endIt = tmpRF.endChild();
+ for( ; it != endIt ; ++it )
+ {
+ if( not anED->isFinalizedOrDestroyed(*it) )
+ {
+ ENV.outEDS.append( anED );
+
+ return( true );
+ }
+ }
+ finalizeSelf = true;
+ }
+ else
+ {
+ StatementFactory::collectRID(tmpRF.getOnSchedule(), runnableRID);
+
+ List< RuntimeID >::const_iterator it = runnableRID.begin();
+ List< RuntimeID >::const_iterator endIt = runnableRID.end();
+ for( ; it != endIt ; ++it )
+ {
+ if( not anED->isFinalizedOrDestroyed(*it) )
+ {
+ ENV.outEDS.append( anED );
+
+ return( true );
+ }
+ }
+ finalizeSelf = true;
+ }
+
+ if( finalizeSelf )
+ {
+ if( tmpRID.getExecutable()->hasOnFinal() )
+ {
+ ExecutionEnvironment tmpENV(ENV, anED, tmpRID,
+ tmpRID.getExecutable()->getOnFinal());
+
+ if( tmpENV.run(PROCESS_FINALIZING_STATE) )
+ {
+ if( finalizedParent(ENV, tmpENV, tmpRID) )
+ {
+ ENV.spliceNotOutput(tmpENV);
+
+ return( true );
+ }
+ }
+
+ return( false );
+ }
+ else
+ {
+ ENV.mwsetPES_mwsetAEES(anED, tmpRID, PROCESS_FINALIZED_STATE);
+ }
+ }
+ }
+
+ if( tmpRID.invalid() )
+ {
+ if( anED->isunRunnableSystem() )
+ {
+ anED->setAEES(AEES_STMNT_EXIT);
+ ENV.exitEDS.append( anED );
+ }
+ else
+ {
+ ENV.outEDS.append( anED );
+ }
+ }
+ else
+ {
+ ENV.outEDS.append( anED );
+ }
+
+ return( true );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of an DESTROY program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Destroy::run(ExecutionEnvironment & ENV)
+{
+ const RuntimeID & tmpRID = ENV.mARG->at(0).bfRID();
+
+ if( ENV.mARG->outED->isunRunnable( tmpRID ) )
+ {
+ return( true );
+ }
+ else if( ENV.mARG->outED->isRunnable( tmpRID ) )
+ {
+ if( tmpRID.getExecutable()->hasOnFinal() )
+ {
+ ExecutionEnvironment tmpENV(ENV, ENV.mARG->outED, tmpRID,
+ tmpRID.getExecutable()->getOnFinal());
+
+ if( tmpENV.run(PROCESS_FINALIZING_STATE) )
+ {
+ if( destroyedParent(ENV, tmpENV, tmpRID) )
+ {
+ ENV.spliceNotOutput(tmpENV);
+
+ return( true );
+ }
+ }
+ }
+ else
+ {
+ if( destroyedParent(ENV, ENV.mARG->outED, tmpRID) )
+ {
+ return( true );
+ }
+ }
+ }
+ else
+ {
+ ENV.outEDS.append( ENV.mARG->outED );
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+bool AvmPrimitive_Destroy::destroyedParent(ExecutionEnvironment & ENV,
+ ExecutionEnvironment & tmpENV, const RuntimeID & aRID)
+{
+ ListOfAPExecutionData::iterator itED = tmpENV.outEDS.begin();
+ ListOfAPExecutionData::iterator endED = tmpENV.outEDS.end();
+ for( ; itED != endED ; ++itED )
+ {
+ if( not destroyedParent(ENV, (*itED), aRID) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+}
+
+
+bool AvmPrimitive_Destroy::destroyedParent(ExecutionEnvironment & ENV,
+ APExecutionData & anED, const RuntimeID & aRID)
+{
+ anED.mwsetRuntimeFormState(aRID, PROCESS_DESTROYED_STATE);
+ if( aRID.hasModel() )
+ {
+ anED->getWritableRuntime( aRID.getModel() ).decrInstanciationCount();
+ }
+
+ anED->setAEES( RuntimeDef::PES_to_AEES(
+ PROCESS_DESTROYED_STATE, anED->getAEES()) );
+
+ RuntimeID tmpRID = aRID;
+ bool autoDestroy;
+
+ while( (tmpRID = tmpRID.getPRID()).valid() )
+ {
+ const RuntimeForm & tmpRF = anED->getRuntime(tmpRID);
+ autoDestroy = false;
+
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( tmpRF.hasChild() )
+ << "Unexpectded PRID RF with out child :> \n"
+ << tmpRF.toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ if( tmpRID.getSpecifier().isMocCompositeStructure() )
+ {
+ TableOfRuntimeID::const_iterator it = tmpRF.beginChild();
+ TableOfRuntimeID::const_iterator endIt = tmpRF.endChild();
+ for( ; it != endIt ; ++it )
+ {
+ if( not anED->isFinalizedOrDestroyed(*it) )
+ {
+ ENV.outEDS.append( anED );
+
+ return( true );
+ }
+ }
+ autoDestroy = true;
+ }
+ else
+ {
+ autoDestroy = true;
+ }
+
+ if( autoDestroy )
+ {
+ if( tmpRID.getExecutable()->hasOnFinal() )
+ {
+ ExecutionEnvironment tmpENV(ENV, anED, tmpRID,
+ tmpRID.getExecutable()->getOnFinal());
+
+ if( tmpENV.run(PROCESS_FINALIZING_STATE) )
+ {
+ if( destroyedParent(ENV, tmpENV, tmpRID) )
+ {
+ ENV.spliceNotOutput(tmpENV);
+
+ return( true );
+ }
+ }
+
+ return( false );
+ }
+ else
+ {
+ ENV.mwsetPES_mwsetAEES(anED, tmpRID, PROCESS_DESTROYED_STATE);
+ if( tmpRID.hasModel() )
+ {
+ anED->getWritableRuntime(
+ tmpRID.getModel() ).decrInstanciationCount();
+ }
+ }
+ }
+ }
+
+ if( tmpRID.invalid() )
+ {
+ if( anED->isunRunnableSystem() )
+ {
+ anED->setAEES(AEES_STMNT_EXIT);
+ ENV.exitEDS.append( anED );
+ }
+ else
+ {
+ ENV.outEDS.append( anED );
+ }
+ }
+ else
+ {
+ ENV.outEDS.append( anED );
+ }
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a START program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Start::run(ExecutionEnvironment & ENV)
+{
+ const RuntimeID & tmpRID = ENV.mARG->at(0).bfRID();
+
+ if( ENV.mARG->outED->isDestroyed( tmpRID ) )
+ {
+ return( true );
+ }
+ else if( ENV.mARG->outED->isCreatedOrRunnable( tmpRID ) ||
+ ENV.mARG->outED->isFinalized( tmpRID ) )
+ {
+ BFCode aProgram = tmpRID.getOnStart();
+ if( aProgram.invalid() )
+ {
+ aProgram = tmpRID.getExecutable()->getOnStart();
+
+ if( aProgram.invalid() )
+ {
+ aProgram = tmpRID.getExecutable()->getOnInit();
+ }
+ }
+
+ if( aProgram.valid() )
+ {
+ ExecutionEnvironment tmpENV(ENV, ENV.mARG->outED, tmpRID, aProgram);
+
+ if( tmpENV.run(PROCESS_STARTING_STATE) )
+ {
+ ENV.spliceNotOutput(tmpENV);
+
+ if( not ENV.appendOutput_mwsetPES_mwsetAEES(tmpENV, tmpRID,
+ PROCESS_STARTING_STATE, PROCESS_IDLE_STATE) )
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ else if( not ENV.appendOutput_mwsetPES(
+ ENV.mARG->outED, tmpRID, PROCESS_IDLE_STATE) )
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ ENV.outEDS.append( ENV.mARG->outED );
+ }
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a RESTART program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Restart::run(ExecutionEnvironment & ENV)
+{
+ BFCode aProgram = ENV.inCODE;
+
+ ExecutionEnvironment tmpENV(ENV, aProgram);
+
+ if( tmpENV.run(OperatorManager::OPERATOR_STOP) )
+ {
+ if( tmpENV.runFromOutputs(OperatorManager::OPERATOR_START, aProgram) )
+ {
+ ENV.spliceOutput( tmpENV );
+
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a STOP program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Stop::run(ExecutionEnvironment & ENV)
+{
+ const RuntimeID & tmpRID = ENV.mARG->at(0).bfRID();
+
+ if( ENV.mARG->outED->isunRunnable( tmpRID ) )
+ {
+ return( true );
+ }
+ else if( ENV.mARG->outED->isRunnable( tmpRID ) )
+ {
+ if( tmpRID.getExecutable()->hasOnStop() )
+ {
+ ExecutionEnvironment tmpENV(ENV, ENV.mARG->outED, tmpRID,
+ tmpRID.getExecutable()->getOnStop());
+
+ if( tmpENV.run(PROCESS_STOPPING_STATE) )
+ {
+ ENV.spliceNotOutput(tmpENV);
+
+ if( not ENV.appendOutput_mwsetPES_mwsetAEES(tmpENV, tmpRID,
+ PROCESS_STOPPING_STATE, PROCESS_STOPPED_STATE) )
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ else if( not ENV.appendOutput_mwsetPES(
+ ENV.mARG->outED, tmpRID, PROCESS_STOPPED_STATE) )
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ ENV.outEDS.append( ENV.mARG->outED );
+ }
+
+ return( true );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of a WAIT program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Wait::run(ExecutionEnvironment & ENV)
+{
+ const RuntimeID & tmpRID = ENV.mARG->at(0).bfRID();
+
+ ENV.mARG->outED.mwsetRuntimeFormState(tmpRID, PROCESS_WAITING_STATE);
+
+ ENV.outEDS.append( ENV.mARG->outED );
+
+ return( true );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of a SUSPEND program
+ ***************************************************************************
+ */
+
+bool AvmPrimitive_Suspend::run(ExecutionEnvironment & ENV)
+{
+ const RuntimeID & tmpRID = ENV.mARG->at(0).bfRID();
+
+ if( ENV.mARG->outED->isunRunnable( tmpRID ) )
+ {
+ return( true );
+ }
+
+ ENV.mARG->outED.mwsetRuntimeFormState(tmpRID, PROCESS_SUSPENDED_STATE);
+
+ ENV.outEDS.append( ENV.mARG->outED );
+
+ return( true );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of a RESUME program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Resume::run(ExecutionEnvironment & ENV)
+{
+ const RuntimeID & tmpRID = ENV.mARG->at(0).bfRID();
+
+ if( ENV.mARG->outED->isSuspended( tmpRID ) )
+ {
+ ENV.mARG->outED.mwsetRuntimeFormState(tmpRID, PROCESS_IDLE_STATE);
+
+ ENV.outEDS.append( ENV.mARG->outED );
+ }
+
+ return( true );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of an IENABLE program
+ ***************************************************************************
+ */
+bool AvmPrimitive_IEnableInvoke::run(ExecutionEnvironment & ENV)
+{
+ ENV.mARG->outED.makeWritable();
+
+ ENV.mARG->outED->mRID = ENV.mARG->at(0).bfRID();
+
+ const BFCode & onInvoke =
+ ENV.mARG->outED->mRID.getExecutable()->getOnIEnable();
+ if( onInvoke.valid() )
+ {
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+ ExecutionDataFactory::appendRunnableElementTrace(ENV.mARG->outED,
+ BF(new ExecutionConfiguration(ENV.mARG->outED->mRID,
+ CONST_BF_OPERATOR(IENABLE_INVOKE))));
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+
+ return( ENV.run(ENV.mARG->outED, onInvoke) );
+ }
+ else
+ {
+ ENV.appendOutput( ENV.mARG->outED );
+
+ return( true );
+ }
+}
+
+
+/**
+ ***************************************************************************
+ * execution of an ENABLE program
+ ***************************************************************************
+ */
+bool AvmPrimitive_EnableInvoke::run(ExecutionEnvironment & ENV)
+{
+ ENV.mARG->outED.makeWritable();
+ ENV.mARG->outED->mPreserveRID = true;
+
+ ENV.mARG->outED->mRID = ENV.mARG->at(0).bfRID();
+
+// ENV.mARG->outED.mwsetRuntimeFormOnScheduleAndIdle(ENV.mARG->outED->mRID);
+
+ const BFCode & onInvoke =
+ ENV.mARG->outED->mRID.getExecutable()->getOnEnable();
+ if( onInvoke.valid() )
+ {
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+ ExecutionDataFactory::appendRunnableElementTrace(ENV.mARG->outED,
+ BF(new ExecutionConfiguration(ENV.mARG->outED->mRID,
+ CONST_BF_OPERATOR(ENABLE_INVOKE))));
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+
+ return( ENV.run(ENV.mARG->outED, onInvoke) );
+ }
+ else
+ {
+ ENV.appendOutput( ENV.mARG->outED );
+
+ return( true );
+ }
+}
+
+
+/**
+ ***************************************************************************
+ * execution of an ENABLE#SET program
+ ***************************************************************************
+ */
+bool AvmPrimitive_EnableSet::run(ExecutionEnvironment & ENV)
+{
+ ENV.mARG->outED.makeWritable();
+ ENV.mARG->outED->mPreserveRID = true;
+
+ ENV.mARG->outED->mRID = ENV.mARG->at(0).bfRID();
+
+ ENV.mARG->outED.mwsetRuntimeFormOnScheduleAndIdle(ENV.mARG->outED->mRID);
+
+ ENV.appendOutput( ENV.mARG->outED );
+
+ return( true );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of a GOTO program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Goto::run(ExecutionEnvironment & ENV)
+{
+ AVM_OS_FATAL_ERROR_EXIT
+ << "AvmPrimitive_Goto::run:> Unexpected GOTO< STATEMENT > !!!"
+ << SEND_EXIT;
+
+// if( ENV.run( StatementConstructor::newCode(
+// OperatorManager::OPERATOR_DISABLE, ENV.mARG->outED->mRID) ) )
+// {
+// return( ENV.runFromOutputs( StatementConstructor::newCode(
+// OperatorManager::OPERATOR_ENABLE, ENV.mARG->at(0)) ) );
+// }
+
+ return( false );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of a IDISABLE program
+ ***************************************************************************
+ */
+bool AvmPrimitive_IDisableInvoke::run(ExecutionEnvironment & ENV)
+{
+ ENV.mARG->outED.makeWritable();
+
+ ENV.mARG->outED->mRID = ENV.mARG->at(0).bfRID();
+
+ const BFCode & onInvoke =
+ ENV.mARG->outED->mRID.getExecutable()->getOnIDisable();
+ if( onInvoke.valid() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+ ExecutionDataFactory::appendRunnableElementTrace(ENV.mARG->outED,
+ BF(new ExecutionConfiguration(ENV.mARG->outED->mRID,
+ CONST_BF_OPERATOR(IDISABLE_INVOKE))));
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+
+ return( ENV.run(ENV.mARG->outED, onInvoke) );
+ }
+ else
+ {
+ ENV.outEDS.append( ENV.mARG->outED );
+
+ return( true );
+ }
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a DISABLE program
+ ***************************************************************************
+ */
+bool AvmPrimitive_DisableInvoke::run(ExecutionEnvironment & ENV)
+{
+ ENV.mARG->outED.makeWritable();
+ ENV.mARG->outED->mPreserveRID = true;
+
+ ENV.mARG->outED->mRID = ENV.mARG->at(0).bfRID();
+
+ const BFCode & onInvoke =
+ ENV.mARG->outED->mRID.getExecutable()->getOnDisable();
+ if( onInvoke.valid() )
+ {
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+ ExecutionDataFactory::appendRunnableElementTrace(ENV.mARG->outED,
+ BF(new ExecutionConfiguration(ENV.mARG->outED->mRID,
+ CONST_BF_OPERATOR(DISABLE_INVOKE))));
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+
+ return( ENV.run(ENV.mARG->outED, onInvoke) );
+ }
+ else
+ {
+ ENV.mARG->outED.mwsetRuntimeFormState(PROCESS_DISABLED_STATE);
+
+ ENV.mARG->outED->mRID = ENV.mARG->outED->mRID.getPRID();
+
+ ENV.outEDS.append( ENV.mARG->outED );
+
+ return( true );
+ }
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a DISABLE#SET program
+ ***************************************************************************
+ */
+bool AvmPrimitive_DisableSet::run(ExecutionEnvironment & ENV)
+{
+ ENV.mARG->outED.makeWritable();
+ ENV.mARG->outED->mPreserveRID = true;
+
+ ENV.mARG->outED->mRID = ENV.mARG->at(0).bfRID();
+
+ ENV.mARG->outED.mwsetRuntimeFormState(PROCESS_DISABLED_STATE);
+
+ ENV.mARG->outED->mRID = ENV.mARG->outED->mRID.getPRID();
+
+ ENV.outEDS.append( ENV.mARG->outED );
+
+ return( true );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of a DISABLE#CHILD program
+ ***************************************************************************
+ */
+bool AvmPrimitive_DisableChild::run(ExecutionEnvironment & ENV)
+{
+ APExecutionData outED = ENV.inED;
+ outED.makeWritable();
+ outED->mPreserveRID = true;
+
+// const BFCode & onDisable = ENV.inED->mRID.getExecutable()->getOnDisable();
+// if( onDisable.valid() )
+// {
+//AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+// ExecutionDataFactory::appendRunnableElementTrace(outED,
+// BF(new ExecutionConfiguration(outED->mRID, CONST_BF_OPERATOR(DISABLE))));
+//AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+//
+// ExecutionEnvironment tmpENV(ENV, outED, outED->mRID);
+// if( tmpENV.run(onDisable) )
+// {
+// while( tmpENV.outEDS.nonempty() )
+// {
+// tmpENV.outEDS.pop_first_to( outED );
+//
+// outED.mwsetRuntimeFormState(ENV.inED->mRID,
+// PROCESS_DISABLED_STATE);
+//
+// outED->mRID = ENV.inED->mRID.getPRID();
+//
+// ENV.outEDS.append( outED );
+// }
+//
+// ENV.spliceNotOutput( tmpENV );
+// }
+// else
+// {
+// return( false );
+// }
+// }
+// else
+ {
+ outED.mwsetRuntimeFormState(PROCESS_DISABLED_STATE);
+
+// outED->mRID = ENV.inED->mRID.getPRID();
+
+ ENV.outEDS.append( outED );
+ }
+
+ return( true );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of a DISABLE#SELF program
+ ***************************************************************************
+ */
+bool AvmPrimitive_DisableSelf::run(ExecutionEnvironment & ENV)
+{
+ APExecutionData outED = ENV.inED;
+ outED.makeWritable();
+ outED->mPreserveRID = true;
+
+ outED.mwsetRuntimeFormState(PROCESS_DISABLED_STATE);
+
+ outED->mRID = ENV.inED->mRID.getPRID();
+
+ ENV.outEDS.append( outED );
+
+ return( true );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of a DISABLE#SELVES program
+ ***************************************************************************
+ */
+bool AvmPrimitive_DisableSelves::run(ExecutionEnvironment & ENV)
+{
+ ENV.mARG->outED.makeWritable();
+ ENV.mARG->outED->mPreserveRID = true;
+
+ for( avm_uinteger_t level = ENV.mARG->at(0).toInteger() ;
+ level > 0 ; --level )
+ {
+ ENV.mARG->outED.mwsetRuntimeFormState(PROCESS_DISABLED_STATE);
+
+ ENV.mARG->outED->mRID = ENV.mARG->outED->mRID.getPRID();
+ }
+
+ ENV.outEDS.append( ENV.mARG->outED );
+
+ return( true );
+}
+
+
+
+
+/**
+ ***************************************************************************
+ * execution of a IABORT program
+ ***************************************************************************
+ */
+bool AvmPrimitive_IAbortInvoke::run(ExecutionEnvironment & ENV)
+{
+ ENV.mARG->outED.makeWritable();
+
+ ENV.mARG->outED->mRID = ENV.mARG->at(0).bfRID();
+
+ const BFCode & onInvoke =
+ ENV.mARG->outED->mRID.getExecutable()->getOnIAbort();
+ if( onInvoke.valid() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+ ExecutionDataFactory::appendRunnableElementTrace(ENV.mARG->outED,
+ BF(new ExecutionConfiguration(ENV.mARG->outED->mRID,
+ CONST_BF_OPERATOR(IABORT_INVOKE))));
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+
+ return( ENV.run(ENV.mARG->outED, onInvoke) );
+ }
+ else
+ {
+ ENV.outEDS.append( ENV.mARG->outED );
+
+ return( true );
+ }
+}
+
+
+bool AvmPrimitive_AbortInvoke::run(ExecutionEnvironment & ENV)
+{
+ ENV.mARG->outED.makeWritable();
+ ENV.mARG->outED->mPreserveRID = true;
+
+ ENV.mARG->outED->mRID = ENV.mARG->at(0).bfRID();
+
+ const BFCode & onInvoke = ENV.mARG->outED->mRID.getExecutable()->getOnAbort();
+ if( onInvoke.valid() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+ ExecutionDataFactory::appendRunnableElementTrace(ENV.mARG->outED,
+ BF(new ExecutionConfiguration(ENV.mARG->outED->mRID,
+ CONST_BF_OPERATOR(ABORT_INVOKE))));
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+
+ return( ENV.run(ENV.mARG->outED, onInvoke) );
+ }
+ else
+ {
+ ENV.mARG->outED.mwsetRuntimeFormState(PROCESS_ABORTED_STATE);
+
+ ENV.mARG->outED->mRID = ENV.mARG->outED->mRID.getPRID();
+
+ ENV.outEDS.append( ENV.mARG->outED );
+
+ return( true );
+ }
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a ABORT#SET program
+ ***************************************************************************
+ */
+bool AvmPrimitive_AbortSet::run(ExecutionEnvironment & ENV)
+{
+ RuntimeID anActiveID = ENV.mARG->outED->mRID;
+
+ ENV.mARG->outED.makeWritable();
+ ENV.mARG->outED->mPreserveRID = true;
+
+ ENV.mARG->outED->mRID = ENV.mARG->at(0).bfRID();
+
+ ENV.mARG->outED.mwsetRuntimeFormState(PROCESS_ABORTED_STATE);
+
+ ENV.mARG->outED->mRID = ENV.mARG->outED->mRID.getPRID();
+
+ ENV.outEDS.append( ENV.mARG->outED );
+
+ return( true );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of a ABORT#CHILD program
+ ***************************************************************************
+ */
+bool AvmPrimitive_AbortChild::run(ExecutionEnvironment & ENV)
+{
+ APExecutionData outED = ENV.inED;
+ outED.makeWritable();
+ outED->mPreserveRID = true;
+
+// const BFCode & onAbort = ENV.inED->mRID.getExecutable()->getOnAbort();
+// if( onAbort.valid() )
+// {
+//AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+// ExecutionDataFactory::appendRunnableElementTrace(outED,
+// BF(new ExecutionConfiguration(outED->mRID, CONST_BF_OPERATOR(ABORT))));
+//AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+//
+// ExecutionEnvironment tmpENV(ENV, outED, outED->mRID);
+// if( tmpENV.run(onAbort) )
+// {
+// while( tmpENV.outEDS.nonempty() )
+// {
+// tmpENV.outEDS.pop_first_to( outED );
+//
+// outED.mwsetRuntimeFormState(ENV.inED->mRID,
+// PROCESS_ABORTED_STATE);
+//
+// outED->mRID = ENV.inED->mRID.getPRID();
+//
+// ENV.outEDS.append( outED );
+// }
+//
+// ENV.spliceNotOutput(tmpENV);
+// }
+// else
+// {
+// return( false );
+// }
+// }
+// else
+ {
+ outED.mwsetRuntimeFormState(PROCESS_ABORTED_STATE);
+
+// outED->mRID = ENV.inED->mRID.getPRID();
+
+ ENV.outEDS.append( outED );
+ }
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a ABORT#SELF program
+ ***************************************************************************
+ */
+bool AvmPrimitive_AbortSelf::run(ExecutionEnvironment & ENV)
+{
+ APExecutionData outED = ENV.inED;
+ outED.makeWritable();
+ outED->mPreserveRID = true;
+
+ outED.mwsetRuntimeFormState(PROCESS_ABORTED_STATE);
+
+ outED->mRID = ENV.inED->mRID.getPRID();
+
+ ENV.outEDS.append( outED );
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a ABORT#SELVES program
+ ***************************************************************************
+ */
+bool AvmPrimitive_AbortSelves::run(ExecutionEnvironment & ENV)
+{
+ ENV.mARG->outED.makeWritable();
+ ENV.mARG->outED->mPreserveRID = true;
+
+ for( avm_uinteger_t level = ENV.mARG->at(0).toInteger() ;
+ level > 0 ; --level )
+ {
+ ENV.mARG->outED.mwsetRuntimeFormState(PROCESS_ABORTED_STATE);
+
+ ENV.mARG->outED->mRID = ENV.mARG->outED->mRID.getPRID();
+ }
+
+ ENV.outEDS.append( ENV.mARG->outED );
+
+ return( true );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of an RUN program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Nop::run(ExecutionEnvironment & ENV)
+{
+ ENV.outEDS.append( ENV.inED );
+
+ return( true );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of a HISTORY#CLEAR program
+ ***************************************************************************
+ */
+bool AvmPrimitive_HistoryClear::run(ExecutionEnvironment & ENV)
+{
+ ENV.mARG->outED->mRID = ENV.mARG->at(0).bfRID();
+
+ if( ENV.mARG->outED->mRID.getSpecifier().isMocStateTransitionStructure() )
+ {
+ ENV.mARG->outED.mwsetRuntimeFormOnSchedule(ENV.mARG->outED->mRID,
+ ENV.mARG->outED->mRID.getExecutable()->getOnEnable());
+ }
+
+ ENV.outEDS.append( ENV.mARG->outED );
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a DEEP_HISTORY#INVOKE program <=> SCHEDULE#INVOKE
+ ***************************************************************************
+ */
+bool AvmPrimitive_DeepHistoryInvoke::run(ExecutionEnvironment & ENV)
+{
+ ENV.mARG->outED->mRID = ENV.mARG->at(0).bfRID();
+
+ if( ENV.mARG->outED->isunRunnable( ENV.mARG->outED->mRID ) )
+ {
+ return( true );
+ }
+ else
+ {
+ const BFCode & onInvoke = ENV.mARG->outED->getRuntimeFormOnSchedule(
+ ENV.mARG->outED->mRID);
+
+ if( onInvoke.valid() &&
+ ENV.mARG->outED->isRunnable( ENV.mARG->outED->mRID ) )
+ {
+ ExecutionEnvironment tmpENV(ENV, ENV.mARG->outED, onInvoke);
+ if( tmpENV.run(PROCESS_RUNNING_STATE) )
+ {
+ ENV.spliceOutput(tmpENV);
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ ENV.outEDS.append( ENV.mARG->outED );
+ }
+ }
+
+ return( true );
+
+
+ ENV.outEDS.append( ENV.mARG->outED );
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a SHALLOW_HISTORY#INVOKE program <=> SCHEDULE#INVOKE
+ ***************************************************************************
+ */
+bool AvmPrimitive_ShallowHistoryInvoke::run(ExecutionEnvironment & ENV)
+{
+ ENV.mARG->outED->mRID = ENV.mARG->at(0).bfRID();
+
+ if( ENV.mARG->outED->isunRunnable( ENV.mARG->outED->mRID ) )
+ {
+ return( true );
+ }
+ else
+ {
+ const BFCode & onInvoke = ENV.mARG->outED->getRuntimeFormOnSchedule(
+ ENV.mARG->outED->mRID);
+
+ if( onInvoke.valid() &&
+ ENV.mARG->outED->isRunnable( ENV.mARG->outED->mRID ) )
+ {
+ ExecutionEnvironment tmpENV(ENV, ENV.mARG->outED, onInvoke);
+ if( tmpENV.run(PROCESS_RUNNING_STATE) )
+ {
+ ENV.spliceOutput(tmpENV);
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ ENV.outEDS.append( ENV.mARG->outED );
+ }
+ }
+
+ return( true );
+
+
+ ENV.outEDS.append( ENV.mARG->outED );
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a IRUN program
+ ***************************************************************************
+ */
+bool AvmPrimitive_IRun::run(ExecutionEnvironment & ENV)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+
+// if( ENV.inED->isRunnable( ) )
+ {
+ ExecutionDataFactory::appendRunnableElementTrace(ENV.inED,
+ BF(new ExecutionConfiguration(ENV.inED->mRID,
+ CONST_BF_OPERATOR(IRUN))));
+
+ return( ENV.run() );
+ }
+// else
+// {
+// ENV.outEDS.append( ENV.inED );
+// return( true );
+// }
+AVM_ELSE
+
+ return( ENV.run() );
+
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a RUN program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Run::run(ExecutionEnvironment & ENV)
+{
+ const RuntimeID & tmpRID = ENV.mARG->at(0).bfRID();
+
+ if( ENV.mARG->outED->isunRunnable( tmpRID ) )
+ {
+ return( true );
+ }
+ else if( tmpRID.getExecutable()->hasOnRun() &&
+ ENV.mARG->outED->isRunnable( tmpRID ) )
+ {
+ const BFCode & aRunCode = tmpRID.getExecutable()->getOnRun();
+
+ ENV.mARG->outED.mwsetRuntimeFormState(PROCESS_RUNNING_STATE);
+
+ ExecutionEnvironment tmpENV(ENV, ENV.mARG->outED, tmpRID, aRunCode);
+
+//AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+ ExecutionDataFactory::appendRunnableElementTrace(tmpENV.inED,
+ BF(new ExecutionConfiguration(tmpRID, CONST_BF_OPERATOR(RUN))));
+
+// AVM_OS_TRACE << "run:> " << tmpRID.str() << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+
+ // Execution of Internal Run
+ if( tmpRID.getExecutable()->hasOnIRun() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+ ExecutionDataFactory::appendRunnableElementTrace(tmpENV.inED,
+ BF(new ExecutionConfiguration(tmpRID, CONST_BF_OPERATOR(IRUN))));
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+
+ if( tmpENV.run(/*OperatorManager::OPERATOR_IRUN,*/
+ tmpRID.getExecutable()->getOnIRun()) )
+ {
+ ENV.spliceNotOutput( tmpENV );
+
+ if( tmpENV.outEDS.nonempty() )
+ {
+ ListOfAPExecutionData irunEDS( tmpENV.outEDS );
+
+ if( tmpENV.runFromOutputs(aRunCode) )
+ {
+ if( tmpENV.outEDS.nonempty() )
+ {
+ ENV.spliceOutput(tmpENV);
+ }
+ else // Preserve Internal Run effect
+ {
+ ENV.outEDS.append( irunEDS );
+ }
+
+ ENV.spliceNotOutput( tmpENV );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ if( tmpENV.run(aRunCode) )
+ {
+ APExecutionData tmpED;
+
+ // IRQ EDS traitement
+ while( tmpENV.irqEDS.nonempty() )
+ {
+ tmpENV.irqEDS.pop_last_to( tmpED );
+
+ // Verification of EXECUTION ENDING STATUS
+ switch( tmpED->getAEES() )
+ {
+ case AEES_STMNT_BREAK:
+ case AEES_STMNT_CONTINUE:
+ case AEES_STMNT_RETURN:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ ENV.outEDS.append( tmpED );
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION "
+ "STATUS as irqEDS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES )
+ << " !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+ }
+
+ ENV.spliceOutput(tmpENV);
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ if( tmpENV.run() )
+ {
+ APExecutionData tmpED;
+
+ // IRQ EDS traitement
+ while( tmpENV.irqEDS.nonempty() )
+ {
+ tmpENV.irqEDS.pop_last_to( tmpED );
+
+ // Verification of EXECUTION ENDING STATUS
+ switch( tmpED->getAEES() )
+ {
+ case AEES_STMNT_BREAK:
+ case AEES_STMNT_CONTINUE:
+ case AEES_STMNT_RETURN:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ ENV.outEDS.append( tmpED );
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS "
+ "as irqEDS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES )
+ << " !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+ }
+
+ ENV.spliceOutput(tmpENV);
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ }
+ else
+ {
+ if( not ENV.mARG->outED->hasRunnableElementTrace() )
+// if( ENV.mARG->outED->isCreated( tmpRID ) )
+ {
+ ENV.mARG->outED->mAEES = AEES_STMNT_NOTHING;
+ }
+
+ ENV.appendOutput(ENV.mARG->outED);
+ }
+
+ return( true );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of a RTC program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Rtc::run(ExecutionEnvironment & ENV)
+{
+ const RuntimeID & rtcRID = ENV.mARG->at(0).bfRID();
+
+ if( ENV.mARG->outED->isunRunnable( rtcRID ) )
+ {
+ return( true );
+ }
+ else if( ENV.mARG->outED->isRunnable( rtcRID ) )
+ {
+ const BFCode rctCode = rtcRID.getExecutable()->getOnRtc();
+
+ ExecutionEnvironment tmpENV(ENV, ENV.mARG->outED, rtcRID, rctCode);
+
+//AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+ ExecutionDataFactory::appendRunnableElementTrace(tmpENV.inED,
+ BF(new ExecutionConfiguration(rtcRID, CONST_BF_OPERATOR(RTC))));
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , STATEMENT )
+ AVM_OS_TRACE << "rtc:> " << rtcRID.str() << std::endl;
+ AVM_OS_COUT << "rtc:> " << rtcRID.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , STATEMENT )
+
+//AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+
+ if( not tmpENV.run(PROCESS_RTC_STATE) )
+ {
+ return( false );
+ }
+
+ if( tmpENV.hasOutput() )
+ {
+ ListOfAPExecutionData nextRTC;
+ ListOfAPExecutionData prevRTC;
+
+ if( tmpENV.extractOtherOutputED(ENV.mARG->outED, prevRTC) )
+ {
+ if( prevRTC.empty() )
+ {
+ ENV.appendOutput_wrtAEES( ENV.mARG->outED );
+ }
+ }
+
+ APExecutionData tmpED;
+
+ while( prevRTC.nonempty() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+ AVM_OS_COUT << "rtc:> leaf count: " << prevRTC.size() << std::endl;
+
+ AVM_OS_COUT << "PRESS ENTER" << std::endl;
+ std::cin.get();
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , PROGRAM )
+
+// currentED.pop_first_to( tmpED );
+ prevRTC.pop_last_to( tmpED );
+
+ switch( tmpED->mAEES )
+ {
+ case AEES_STMNT_NOTHING:
+ case AEES_STMNT_CONTINUE:
+ case AEES_STMNT_FINAL:
+ case AEES_STMNT_DESTROY:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ //!!! NO << break >> for these statement
+ }
+
+ // Evaluation of NEXT SEQUENCIAL STATEMENT
+ case AEES_OK:
+ case AEES_STEP_RESUME:
+ {
+ tmpED->mRID = rtcRID;
+
+ if( tmpENV.run(tmpED, rctCode) )
+ {
+ if( tmpENV.hasOutput() )
+ {
+ if( tmpENV.extractOtherOutputED(tmpED, nextRTC) )
+ {
+ if( nextRTC.empty()
+ && tmpED->isTNEQ( ENV.mARG->outED ) )
+ {
+ ENV.appendOutput_wrtAEES( tmpED );
+ }
+ }
+ prevRTC.splice( nextRTC );
+ }
+ else if( tmpED != ENV.mARG->outED )
+ {
+ ENV.appendOutput_wrtAEES( tmpED );
+ }
+ }
+ else
+ {
+ return( false );
+ }
+
+ break;
+ }
+
+ case AEES_STMNT_BREAK:
+ case AEES_STMNT_RETURN:
+ {
+ ENV.outEDS.append( tmpED );
+ break;
+ }
+
+ default:
+ {
+ ENV.destroyOutED();
+
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+ }
+ else if( not ENV.appendOutput_mwsetPES(ENV.mARG->outED, rtcRID,
+ PROCESS_RUNNING_STATE) )
+ {
+ return( true );
+ }
+
+ // Sync EDS traitement
+ ENV.spliceSync_mwStorePos(tmpENV);
+
+ // IRQ EDS traitement
+ ENV.spliceNotOutput(tmpENV);
+ }
+ else
+ {
+ if( not ENV.mARG->outED->hasRunnableElementTrace() )
+// if( ENV.mARG->outED->isCreated( tmpRID ) )
+ {
+ ENV.mARG->outED->mAEES = AEES_STMNT_NOTHING;
+ }
+
+ ENV.outEDS.append( ENV.mARG->outED );
+ }
+
+ return( true );
+}
+
+
+bool AvmPrimitive_Rtc::resume(ExecutionEnvironment & ENV)
+{
+ ENV.outEDS.append( ENV.inED );
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a SCHEDULE#INVOKE program
+ ***************************************************************************
+ */
+bool AvmPrimitive_ScheduleInvoke::run(ExecutionEnvironment & ENV)
+{
+ ENV.mARG->outED->mRID = ENV.mARG->at(0).bfRID();
+
+ if( ENV.mARG->outED->isunRunnable( ENV.mARG->outED->mRID ) )
+ {
+ return( true );
+ }
+ else
+ {
+ const BFCode & onInvoke = ENV.mARG->outED->getRuntimeFormOnSchedule(
+ ENV.mARG->outED->mRID);
+
+ if( onInvoke.valid() &&
+ ENV.mARG->outED->isRunnable( ENV.mARG->outED->mRID ) )
+ {
+ ExecutionEnvironment tmpENV(ENV, ENV.mARG->outED, onInvoke);
+ if( tmpENV.run(PROCESS_RUNNING_STATE) )
+ {
+ ENV.spliceOutput(tmpENV);
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ if( not ENV.mARG->outED->hasRunnableElementTrace() )
+// if( ENV.mARG->outED->isCreated( tmpRID ) )
+ {
+ ENV.mARG->outED->mAEES = AEES_STMNT_NOTHING;
+ }
+
+ ENV.outEDS.append( ENV.mARG->outED );
+ }
+ }
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a SCHEDULE#GET program
+ ***************************************************************************
+ */
+bool AvmPrimitive_ScheduleGet::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ENV.mARG->outED->getRuntimeFormOnSchedule(ENV.mARG->at(0).bfRID());
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a SCHEDULE#IN program
+ ***************************************************************************
+ */
+bool AvmPrimitive_ScheduleIn::seval(EvaluationEnvironment & ENV)
+{
+ const BFCode & scheduleCode = ENV.mARG->outED->getRuntimeFormOnSchedule(
+ ENV.mARG->at(1).bfRID() );
+
+ const RuntimeID & aRID = ENV.mARG->at(0).bfRID();
+
+ if( scheduleCode.valid() && aRID.valid() )
+ {
+ ENV.outVAL = ExpressionConstructor::newBoolean(
+ StatementFactory::containsOperationOnRID(
+ scheduleCode, AVM_OPCODE_RUN, aRID));
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a SCHEDULE#SET program
+ ***************************************************************************
+ */
+bool AvmPrimitive_ScheduleSet::run(ExecutionEnvironment & ENV)
+{
+ ENV.mARG->outED.mwsetRuntimeFormOnSchedule(
+ ENV.mARG->at(0).bfRID(), ENV.mARG->at(1).bfCode());
+
+ ENV.outEDS.append( ENV.mARG->outED );
+
+ return( true );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of a DEFER#INVOKE program
+ ***************************************************************************
+ */
+bool AvmPrimitive_DeferInvoke::run(ExecutionEnvironment & ENV)
+{
+ const RuntimeID & deferRID = ENV.mARG->at(0).bfRID();
+
+ if( ENV.mARG->outED->isunRunnable( deferRID ) )
+ {
+ return( true );
+ }
+ else
+ {
+ const BFCode & aRunCode = ENV.mARG->outED->getRuntimeFormOnDefer(deferRID);
+
+ if( aRunCode.valid() && ENV.mARG->outED->isRunnable( deferRID ) )
+ {
+ BFCode aRunCode = ENV.mARG->outED->getRuntimeFormOnDefer(deferRID);
+
+ ExecutionEnvironment tmpENV(ENV, ENV.mARG->outED, deferRID, aRunCode);
+ if( tmpENV.run(PROCESS_RUNNING_STATE) )
+ {
+ ENV.spliceOutput(tmpENV);
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ ENV.outEDS.append( ENV.inED );
+ }
+ }
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a DEFER#GET program
+ ***************************************************************************
+ */
+bool AvmPrimitive_DeferGet::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ENV.mARG->outED->getRuntimeFormOnDefer(ENV.mARG->at(0).bfRID());
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a DEFER#SET program
+ ***************************************************************************
+ */
+bool AvmPrimitive_DeferSet::run(ExecutionEnvironment & ENV)
+{
+ ENV.mARG->outED.mwsetRuntimeFormOnDefer(
+ ENV.mARG->at(0).bfRID(), ENV.mARG->at(1).bfCode());
+
+ ENV.outEDS.append( ENV.mARG->outED );
+
+ return( true );
+}
+
+
+
+
+/**
+ ***************************************************************************
+ * execution of a FORK program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Fork::run(ExecutionEnvironment & ENV)
+{
+ AvmCode::const_iterator it = ENV.inCODE->begin();
+ AvmCode::const_iterator endIt = ENV.inCODE->end();
+ for( ; it != endIt ; ++it )
+ {
+ ENV.run( *it );
+ }
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a JOIN program
+ ***************************************************************************
+ */
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// CHECK MOC
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_Join::checksatJoin(
+ ExecutionEnvironment & ENV, const BF & aJoinSpec)
+{
+ switch( aJoinSpec.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ const BFCode & aCode = aJoinSpec.bfCode();
+
+ switch ( aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_NOT:
+ {
+ return( not checksatJoin(ENV, aCode->first()) );
+ }
+
+ case AVM_OPCODE_AND:
+ case AVM_OPCODE_STRONG_SYNCHRONOUS:
+ {
+ AvmCode::iterator itForm = aCode->begin();
+ AvmCode::iterator endForm = aCode->end();
+ for( ; itForm != endForm ; ++itForm )
+ {
+ if( not checksatJoin(ENV, *itForm) )
+ {
+ return( false );
+ }
+ }
+ return( true );
+ }
+
+ case AVM_OPCODE_OR:
+ case AVM_OPCODE_WEAK_SYNCHRONOUS:
+ {
+ AvmCode::iterator itForm = aCode->begin();
+ AvmCode::iterator endForm = aCode->end();
+ for( ; itForm != endForm ; ++itForm )
+ {
+ if( checksatJoin(ENV, *itForm) )
+ {
+ return( true );
+ }
+ }
+ return( false );
+ }
+
+ case AVM_OPCODE_XOR:
+ case AVM_OPCODE_EXCLUSIVE:
+ {
+ avm_size_t nbTrue = 0;
+
+ AvmCode::iterator itForm = aCode->begin();
+ AvmCode::iterator endForm = aCode->end();
+ for( ; itForm != endForm ; ++itForm )
+ {
+ if( checksatJoin(ENV, *itForm) )
+ {
+ ++nbTrue;
+ }
+ }
+ return( nbTrue == 1 );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+ return( false );
+ }
+
+ case FORM_RUNTIME_ID_KIND:
+ {
+ return( ENV.inED->isWaitingJoin( aJoinSpec.bfRID() ) );
+ }
+
+ case FORM_INSTANCE_MACHINE_KIND:
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ //return( ENV.inED->isWaitingJoin( ENV.evalMachine(aJoinSpec) ) );
+ return( false );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+bool AvmPrimitive_Join::run(ExecutionEnvironment & ENV)
+{
+ APExecutionData outED = ENV.inED;
+ outED.mwsetAEES( AEES_WAITING_JOIN_FORK );
+
+ if( tableOfWaitingJoin.empty() )
+ {
+ tableOfWaitingJoin.resize( ENV.inED->getTableOfRuntime().size() );
+
+ outED.mwsetRuntimeFormState(outED->mRID, PROCESS_WAITING_JOIN_STATE);
+ tableOfWaitingJoin[ outED->mRID.getOffset() ].append( outED );
+ }
+ else if( tableOfWaitingJoin[ outED->mRID.getOffset() ].empty() )
+ {
+ outED.mwsetRuntimeFormState(outED->mRID, PROCESS_WAITING_JOIN_STATE);
+ tableOfWaitingJoin[ outED->mRID.getOffset() ].append( outED );
+ }
+
+ else if( tableOfWaitingJoin[ outED->mRID.getOffset() ].singleton() )
+ {
+ const APExecutionData & otherED =
+ tableOfWaitingJoin[ outED->mRID.getOffset() ].first();
+
+ APExecutionData joinED = AvmSynchronizationFactory::fusion(
+ outED->getExecutionContext()->LCA(
+ otherED->getExecutionContext())->getAPExecutionData(),
+ outED, otherED );
+ if( joinED.valid() )
+ {
+ joinED->setRuntimeFormState(outED->mRID, PROCESS_IDLE_STATE);
+ joinED.mwsetAEES( AEES_OK );
+ ENV.outEDS.append( joinED );
+
+ tableOfWaitingJoin[ outED->mRID.getOffset() ].clear();
+ }
+ }
+ else if( tableOfWaitingJoin[ outED->mRID.getOffset() ].populated() )
+ {
+ APExecutionData joinED = outED;
+
+ ListOfAPExecutionData::const_iterator itED =
+ tableOfWaitingJoin[ outED->mRID.getOffset() ].begin();
+ ListOfAPExecutionData::const_iterator endED =
+ tableOfWaitingJoin[ outED->mRID.getOffset() ].end();
+ for( ; itED != endED ; ++itED )
+ {
+ joinED = AvmSynchronizationFactory::fusion(
+ outED->getExecutionContext()->LCA(
+ (*itED)->getExecutionContext())->getAPExecutionData(),
+ joinED, *itED);
+ if( joinED.invalid() )
+ {
+ break;
+ }
+ joinED->setRuntimeFormState(outED->mRID, PROCESS_IDLE_STATE);
+ }
+
+ if( joinED.valid() )
+ {
+ joinED.mwsetAEES( AEES_OK );
+ ENV.outEDS.append( joinED );
+
+ tableOfWaitingJoin[ outED->mRID.getOffset() ].clear();
+ }
+ }
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a RDV program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Rdv::run(ExecutionEnvironment & ENV)
+{
+// const RuntimeID & tmpRID = ENV.mARG->at(0).bfRID();
+
+// ENV.outEDS.append( ENV.mARG->outED );
+
+ return( true );
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmActivityPrimitive.h b/org.eclipse.efm.symbex/src/computer/primitive/AvmActivityPrimitive.h
new file mode 100644
index 0000000..5a2b4d2
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmActivityPrimitive.h
@@ -0,0 +1,150 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMACTIVITYPRIMITIVE_H_
+#define AVMACTIVITYPRIMITIVE_H_
+
+#include <computer/primitive/BaseAvmPrimitive.h>
+
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/Message.h>
+
+
+
+namespace sep
+{
+
+
+class InstanceOfBuffer;
+class RuntimeID;
+
+
+AVM_PRIMITIVE_RUN_CLASS(ContextSwitcher, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(Init, BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_RUN_CLASS_HEADER(Final, BaseAvmPrimitive)
+ bool finalizedParent(ExecutionEnvironment & ENV,
+ ExecutionEnvironment & tmpENV, const RuntimeID & aRID);
+
+ bool finalizedParent(ExecutionEnvironment & ENV, APExecutionData & anED,
+ const RuntimeID & aRID);
+};
+
+
+AVM_PRIMITIVE_RUN_CLASS_HEADER(Destroy, BaseAvmPrimitive)
+ bool destroyedParent(ExecutionEnvironment & ENV,
+ ExecutionEnvironment & tmpENV, const RuntimeID & aRID);
+
+ bool destroyedParent(ExecutionEnvironment & ENV,
+ APExecutionData & anED, const RuntimeID & aRID);
+};
+
+
+AVM_PRIMITIVE_RUN_CLASS(Start, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(Restart, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(Stop, BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_RUN_CLASS(Wait, BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_RUN_CLASS(Suspend, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(Resume, BaseAvmPrimitive)
+
+
+// Enable family
+AVM_PRIMITIVE_RUN_CLASS(IEnableInvoke , BaseAvmPrimitive)
+AVM_PRIMITIVE_RUN_CLASS(EnableInvoke , BaseAvmPrimitive)
+AVM_PRIMITIVE_RUN_CLASS(EnableSet , BaseAvmPrimitive)
+
+// Disable family
+AVM_PRIMITIVE_RUN_CLASS(IDisableInvoke, BaseAvmPrimitive)
+AVM_PRIMITIVE_RUN_CLASS(DisableInvoke , BaseAvmPrimitive)
+AVM_PRIMITIVE_RUN_CLASS(DisableSet , BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(DisableChild , BaseAvmPrimitive)
+AVM_PRIMITIVE_RUN_CLASS(DisableSelf , BaseAvmPrimitive)
+AVM_PRIMITIVE_RUN_CLASS(DisableSelves , BaseAvmPrimitive)
+
+// Abort family
+AVM_PRIMITIVE_RUN_CLASS(IAbortInvoke , BaseAvmPrimitive)
+AVM_PRIMITIVE_RUN_CLASS(AbortInvoke , BaseAvmPrimitive)
+AVM_PRIMITIVE_RUN_CLASS(AbortSet , BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(AbortChild , BaseAvmPrimitive)
+AVM_PRIMITIVE_RUN_CLASS(AbortSelf , BaseAvmPrimitive)
+AVM_PRIMITIVE_RUN_CLASS(AbortSelves , BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_RUN_CLASS(Nop, BaseAvmPrimitive)
+
+
+// History family
+AVM_PRIMITIVE_RUN_CLASS(HistoryClear , BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(DeepHistoryInvoke, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(ShallowHistoryInvoke, BaseAvmPrimitive)
+
+
+// Run family
+AVM_PRIMITIVE_RUN_CLASS(IRun, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(Run, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_RESUME_CLASS(Rtc, BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_RUN_CLASS(ScheduleInvoke, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_EVAL_CLASS(ScheduleGet, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_EVAL_CLASS(ScheduleIn, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(ScheduleSet, BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_RUN_CLASS(DeferInvoke, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_EVAL_CLASS(DeferGet, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(DeferSet, BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_RUN_CLASS(Goto, BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_RUN_CLASS(Fork, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS_HEADER(Join, BaseAvmPrimitive)
+ bool checksatJoin(ExecutionEnvironment & ENV, const BF & aJoinSpec);
+protected:
+ VectorOfListOfAPExecutionData tableOfWaitingJoin;
+};
+
+
+AVM_PRIMITIVE_RUN_CLASS(Rdv, BaseAvmPrimitive)
+
+
+
+
+}
+
+#endif /* AVMACTIVITYPRIMITIVE_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmAssignPrimitive.cpp b/org.eclipse.efm.symbex/src/computer/primitive/AvmAssignPrimitive.cpp
new file mode 100644
index 0000000..01a4bd1
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmAssignPrimitive.cpp
@@ -0,0 +1,451 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmAssignPrimitive.h"
+
+#include <computer/EvaluationEnvironment.h>
+#include <computer/ExecutionDataFactory.h>
+#include <computer/ExecutionEnvironment.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/ExpressionSimplifier.h>
+
+#include <fml/operator/Operator.h>
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/runtime/ExecutionConfiguration.h>
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+
+/**
+ ***************************************************************************
+ * execution of an ASSIGN program
+ ***************************************************************************
+ */
+
+// lvalue =: rvalue; ==> [ lvalue , rvalue ]
+bool AvmPrimitive_Assignment::run(ExecutionEnvironment & ENV)
+{
+AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+ AVM_OS_TRACE << "lvalue:>> "
+ << str_header( ENV.mARG->at(0).to_ptr< InstanceOfData >() )
+ << std::endl
+ << "rvalue:>> " << ENV.mARG->at(1).str()
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ if( ENV.setRvalue(ENV.mARG->outED,
+ ENV.mARG->at(0).to_ptr< InstanceOfData >(), ENV.mARG->at(1)) )
+ {
+ ENV.appendOutput( ENV.mARG->outED );
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+// lvalue =: rvalue; ==> [ lvalue , rvalue ]
+
+bool AvmPrimitive_Assignment::seval(EvaluationEnvironment & ENV)
+{
+AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+ AVM_OS_TRACE << "lvalue:> "
+ << str_header( ENV.mARG->at(0).to_ptr< InstanceOfData >() )
+ << std::endl
+ << "rvalue:> " << ENV.mARG->at(1).str()
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ if( ENV.setRvalue(ENV.mARG->outED,
+ ENV.mARG->at(0).to_ptr< InstanceOfData >(), ENV.mARG->at(1)) )
+ {
+ ENV.outED = ENV.mARG->outED;
+ ENV.outVAL = ENV.mARG->at(1);
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of an ASSIGN RDECR program
+ ***************************************************************************
+ */
+
+// lvalue =: rvalue; ==> [ lvalue , rvalue ]
+bool AvmPrimitive_AssignmentAfter::run(ExecutionEnvironment & ENV)
+{
+AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+ AVM_OS_TRACE << "lvalue:>> "
+ << str_header( ENV.mARG->at(0).to_ptr< InstanceOfData >() )
+ << std::endl
+ << "rvalue:>> " << ENV.mARG->at(1).str()
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ if( ENV.setRvalue(ENV.mARG->outED,
+ ENV.mARG->at(0).to_ptr< InstanceOfData >(), ENV.mARG->at(1)) )
+ {
+ ENV.appendOutput( ENV.mARG->outED );
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+// lvalue =: rvalue; ==> [ lvalue , rvalue ]
+bool AvmPrimitive_AssignmentAfter::seval(EvaluationEnvironment & ENV)
+{
+AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+ AVM_OS_TRACE << "lvalue:> "
+ << str_header( ENV.mARG->at(0).to_ptr< InstanceOfData >() )
+ << std::endl
+ << "rvalue:> " << ENV.mARG->at(2).str()
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ ENV.outVAL = ENV.mARG->at(1);
+
+ if( ENV.setRvalue(ENV.mARG->outED,
+ ENV.mARG->at(0).to_ptr< InstanceOfData >(), ENV.mARG->at(2)) )
+ {
+ ENV.outED = ENV.mARG->outED;
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of an ASSIGN RDECR program
+ ***************************************************************************
+ */
+
+// lvalue =: op rvalue; ==> [ lvalue , (VAL[lvalue] op rvalue) ]
+bool AvmPrimitive_AssignmentOpAfter::run(ExecutionEnvironment & ENV)
+{
+AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+ AVM_OS_TRACE << "lvalue:>> "
+ << str_header( ENV.mARG->at(0).to_ptr< InstanceOfData >() )
+ << std::endl
+ << "rvalue:>> " << ENV.mARG->at(1).str()
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ if( ENV.setRvalue(ENV.mARG->outED,
+ ENV.mARG->at(0).to_ptr< InstanceOfData >(), ENV.mARG->at(1)) )
+ {
+//
+ return( true );
+ }
+
+ return( false );
+}
+
+
+// lvalue =: op rvalue; ==> [ lvalue , VAL[lvalue] , (VAL[lvalue] op rvalue) ]
+bool AvmPrimitive_AssignmentOpAfter::seval(EvaluationEnvironment & ENV)
+{
+AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+ AVM_OS_TRACE << "lvalue:> "
+ << str_header( ENV.mARG->at(0).to_ptr< InstanceOfData >() )
+ << std::endl
+ << "rvalue:> " << ENV.mARG->at(2).str()
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ ENV.outVAL = ENV.mARG->at(1);
+
+ if( ENV.setRvalue(ENV.mARG->outED,
+ ENV.mARG->at(0).to_ptr< InstanceOfData >(), ENV.mARG->at(2)) )
+ {
+ ENV.outED = ENV.mARG->outED;
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of an ASSIGN REFERENCE program
+ ***************************************************************************
+ */
+bool AvmPrimitive_AssignmentRef::run(ExecutionEnvironment & ENV)
+{
+AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+ AVM_OS_TRACE << "lvalue:>> "
+ << str_header( ENV.mARG->at(0).to_ptr< InstanceOfData >() )
+ << std::endl
+ << "rvalue:lvalue>> " << ENV.mARG->at(1).str()
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ if( ENV.setRvalue(ENV.mARG->outED,
+ ENV.mARG->at(0).to_ptr< InstanceOfData >(), ENV.mARG->at(1)) )
+ {
+ ENV.appendOutput( ENV.mARG->outED );
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+bool AvmPrimitive_AssignmentRef::seval(EvaluationEnvironment & ENV)
+{
+AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+ AVM_OS_TRACE << "lvalue:> "
+ << str_header( ENV.mARG->at(0).to_ptr< InstanceOfData >() )
+ << std::endl
+ << "rvalue:lvalue>> " << ENV.mARG->at(1).str()
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ if( ENV.setRvalue(ENV.mARG->outED,
+ ENV.mARG->at(0).to_ptr< InstanceOfData >(), ENV.mARG->at(1)) )
+ {
+ ENV.outED = ENV.mARG->outED;
+ ENV.outVAL = ENV.mARG->at(1);
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of an ASSIGN MACRO program
+ ***************************************************************************
+ */
+bool AvmPrimitive_AssignmentMacro::run(ExecutionEnvironment & ENV)
+{
+AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+ AVM_OS_TRACE << "lvalue:>> "
+ << str_header( ENV.mARG->at(0).to_ptr< InstanceOfData >() )
+ << std::endl
+ << "rvalue>> " << ENV.mARG->at(1).str()
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ if( ENV.setRvalue(ENV.mARG->outED,
+ ENV.mARG->at(0).to_ptr< InstanceOfData >(), ENV.mARG->at(1)) )
+ {
+ ENV.appendOutput( ENV.mARG->outED );
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+bool AvmPrimitive_AssignmentMacro::seval(EvaluationEnvironment & ENV)
+{
+AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+ AVM_OS_TRACE << "lvalue:> "
+ << str_header( ENV.mARG->at(0).to_ptr< InstanceOfData >() )
+ << std::endl
+ << "rvalue>> " << ENV.mARG->at(1).str()
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ if( ENV.setRvalue(ENV.mARG->outED,
+ ENV.mARG->at(0).to_ptr< InstanceOfData >(), ENV.mARG->at(1)) )
+ {
+ ENV.outED = ENV.mARG->outED;
+ ENV.outVAL = ENV.mARG->at(1);
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+
+
+/**
+ ***************************************************************************
+ * execution of an NEW FRESH program
+ ***************************************************************************
+ */
+bool AvmPrimitive_AssignNewFresh::run(ExecutionEnvironment & ENV)
+{
+ BFList paramList;
+ BF aNewSymbolicConstant = ENV.createNewFreshParam(ENV.mARG->outED->mRID,
+ ENV.mARG->at(0).to_ptr< InstanceOfData >(), paramList );
+
+AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+ AVM_OS_TRACE << "lvalue:>> "
+ << str_header( ENV.mARG->at(0).to_ptr< InstanceOfData >() )
+ << std::endl
+ << "rvalue:>> " << aNewSymbolicConstant.str()
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ if( ENV.setRvalue(ENV.mARG->outED,
+ ENV.mARG->at(0).to_ptr< InstanceOfData >(), aNewSymbolicConstant) )
+ {
+ ExecutionDataFactory::appendIOElementTrace(ENV.mARG->outED,
+ BF(new ExecutionConfiguration(ENV.mARG->outED->mRID,
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ASSIGN_NEWFRESH,
+ ENV.mARG->at(0), aNewSymbolicConstant))));
+
+ ENV.mARG->outED.appendParameters( paramList );
+
+ ENV.appendOutput( ENV.mARG->outED );
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+bool AvmPrimitive_AssignNewFresh::seval(EvaluationEnvironment & ENV)
+{
+ BFList paramList;
+ BF aNewSymbolicConstant = ENV.createNewFreshParam(ENV.mARG->outED->mRID,
+ ENV.mARG->at(0).to_ptr< InstanceOfData >(), paramList );
+
+AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+ AVM_OS_TRACE << "lvalue:>> "
+ << str_header( ENV.mARG->at(0).to_ptr< InstanceOfData >() )
+ << std::endl
+ << "rvalue:>> " << aNewSymbolicConstant.str()
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ if( ENV.setRvalue(ENV.mARG->outED,
+ ENV.mARG->at(0).to_ptr< InstanceOfData >(), aNewSymbolicConstant) )
+ {
+ ENV.outVAL = aNewSymbolicConstant;
+
+ ExecutionDataFactory::appendIOElementTrace(ENV.mARG->outED,
+ BF(new ExecutionConfiguration(ENV.mARG->outED->mRID,
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ASSIGN_NEWFRESH,
+ ENV.mARG->at(0), aNewSymbolicConstant))));
+
+ ENV.mARG->outED.appendParameters( paramList );
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of an RESET program
+ ***************************************************************************
+ */
+bool AvmPrimitive_AssignReset::run(ExecutionEnvironment & ENV)
+{
+ BFList paramList;
+ BF aNewSymbolicConstant = ENV.createNewFreshParam(ENV.mARG->outED->mRID,
+ ENV.mARG->at(0).to_ptr< InstanceOfData >(), paramList );
+
+AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+ AVM_OS_TRACE << "lvalue:>> "
+ << str_header( ENV.mARG->at(0).to_ptr< InstanceOfData >() )
+ << std::endl
+ << "rvalue:>> " << aNewSymbolicConstant.str()
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ if( ENV.setRvalue(ENV.mARG->outED,
+ ENV.mARG->at(0).to_ptr< InstanceOfData >(), aNewSymbolicConstant) )
+ {
+ ExecutionDataFactory::appendIOElementTrace(ENV.mARG->outED,
+ BF(new ExecutionConfiguration(ENV.mARG->outED->mRID,
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ASSIGN_RESET,
+ ENV.mARG->at(0), aNewSymbolicConstant))));
+
+ ENV.mARG->outED.appendParameters( paramList );
+
+ ENV.appendOutput( ENV.mARG->outED );
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+bool AvmPrimitive_AssignReset::seval(EvaluationEnvironment & ENV)
+{
+ BFList paramList;
+ BF aNewSymbolicConstant = ENV.createNewFreshParam(ENV.mARG->outED->mRID,
+ ENV.mARG->at(0).to_ptr< InstanceOfData >(), paramList );
+
+AVM_IF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+ AVM_OS_TRACE << "lvalue:>> "
+ << str_header( ENV.mARG->at(0).to_ptr< InstanceOfData >() )
+ << std::endl<< "rvalue:>> " << aNewSymbolicConstant.str()
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ if( ENV.setRvalue(ENV.mARG->outED,
+ ENV.mARG->at(0).to_ptr< InstanceOfData >(), aNewSymbolicConstant) )
+ {
+ ENV.outVAL = aNewSymbolicConstant;
+
+ ExecutionDataFactory::appendIOElementTrace(ENV.mARG->outED,
+ BF(new ExecutionConfiguration(ENV.mARG->outED->mRID,
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ASSIGN_RESET,
+ ENV.mARG->at(0), aNewSymbolicConstant))));
+
+ ENV.mARG->outED.appendParameters( paramList );
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmAssignPrimitive.h b/org.eclipse.efm.symbex/src/computer/primitive/AvmAssignPrimitive.h
new file mode 100644
index 0000000..21ed204
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmAssignPrimitive.h
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMASSIGNPRIMITIVE_H_
+#define AVMASSIGNPRIMITIVE_H_
+
+#include <computer/primitive/BaseAvmPrimitive.h>
+
+
+namespace sep
+{
+
+
+AVM_PRIMITIVE_RUN_EVAL_CLASS(Assignment, BaseAvmPrimitive)
+
+//AVM_PRIMITIVE_RUN_EVAL_CLASS(AssignmentOr, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_EVAL_CLASS(AssignmentAfter, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_EVAL_CLASS(AssignmentOpAfter, BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_RUN_EVAL_CLASS(AssignmentRef, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_EVAL_CLASS(AssignmentMacro, BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_RUN_EVAL_CLASS(AssignNewFresh, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_EVAL_CLASS(AssignReset, BaseAvmPrimitive)
+
+
+}
+
+#endif /* AVMASSIGNPRIMITIVE_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmBaseConcurrencyPrimitive.cpp b/org.eclipse.efm.symbex/src/computer/primitive/AvmBaseConcurrencyPrimitive.cpp
new file mode 100644
index 0000000..bc9eee7
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmBaseConcurrencyPrimitive.cpp
@@ -0,0 +1,146 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmBaseConcurrencyPrimitive.h"
+
+#include <computer/PathConditionProcessor.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/ExpressionSimplifier.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+
+/*
+ ***************************************************************************
+ ***************************************************************************
+ * EVAL EXCLUSIVE
+ ***************************************************************************
+ ***************************************************************************
+ */
+
+
+// Compute EVAL where NOT OTHER
+bool AvmBaseConcurrencyPrimitive::evalExclusive(APExecutionData & anInputED,
+ APExecutionData & evalED, APExecutionData & otherED,
+ CollectionOfAPExecutionData & listOfOutputED)
+{
+ BF theNodeCondition = otherED->getNodeCondition();
+
+ if( theNodeCondition.isEqualTrue() )
+ {
+ return( false );
+ }
+ else if( theNodeCondition.isEqualFalse() )
+ {
+ listOfOutputED.append( evalED );
+
+ return( true );
+ }
+ else
+ {
+ theNodeCondition = ExpressionConstructor::notExpr(theNodeCondition);
+
+ return( PathConditionProcessor::appendPathCondition(
+ evalED, theNodeCondition, listOfOutputED) );
+ }
+}
+
+
+// Compute EVAL where NOT OTHERS
+bool AvmBaseConcurrencyPrimitive::evalExclusive(APExecutionData & anInputED,
+ APExecutionData & evalED, ListOfAPExecutionData & listOfOtherED,
+ CollectionOfAPExecutionData & listOfOutputED)
+{
+ if( listOfOtherED.empty() )
+ {
+ listOfOutputED.append( evalED );
+
+ return( true );
+ }
+
+ else if( listOfOtherED.singleton() )
+ {
+ return( evalExclusive(anInputED, evalED,
+ listOfOtherED.last(), listOfOutputED) );
+ }
+
+ else
+ {
+ BFCode theNodeConditions(OperatorManager::OPERATOR_OR);
+
+ ListOfAPExecutionData::iterator it = listOfOtherED.begin();
+ ListOfAPExecutionData::iterator itEnd = listOfOtherED.end();
+ for( ; it != itEnd ; ++it )
+ {
+ theNodeConditions->append( (*it)->getNodeCondition() );
+ }
+
+ BF theNodeCondition =
+ ExpressionSimplifier::simplif( theNodeConditions );
+
+
+ if( theNodeCondition.isEqualTrue() )
+ {
+ return( false );
+ }
+ else if( theNodeCondition.isEqualFalse() )
+ {
+ listOfOutputED.append( evalED );
+
+ return( true );
+ }
+ else
+ {
+ theNodeCondition =
+ ExpressionConstructor::notExpr(theNodeCondition);
+
+ return( PathConditionProcessor::appendPathCondition(
+ evalED, theNodeCondition, listOfOutputED) );
+ }
+ }
+}
+
+
+bool AvmBaseConcurrencyPrimitive::evalExclusive(APExecutionData & anInputED,
+ ListOfAPExecutionData & oneListOfED, APExecutionData & otherED,
+ CollectionOfAPExecutionData & listOfOutputED)
+{
+ ListOfAPExecutionData::iterator itOne;
+ ListOfAPExecutionData::iterator endOne = oneListOfED.end();
+
+ // Compute OTHER where NOT ONE
+ for( itOne = oneListOfED.begin() ; itOne != endOne ; ++itOne )
+ {
+ if( not evalExclusive(anInputED, *itOne, otherED, listOfOutputED) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmBaseConcurrencyPrimitive.h b/org.eclipse.efm.symbex/src/computer/primitive/AvmBaseConcurrencyPrimitive.h
new file mode 100644
index 0000000..f5abea1
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmBaseConcurrencyPrimitive.h
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMBASESCHEDULINGPRIMITIVE_H_
+#define AVMBASESCHEDULINGPRIMITIVE_H_
+
+#include <computer/primitive/BaseAvmPrimitive.h>
+
+#include <fml/runtime/ExecutionData.h>
+
+
+namespace sep
+{
+
+AVM_PRIMITIVE_CLASS_HEADER(AvmBaseConcurrencyPrimitive, BaseAvmPrimitive)
+
+ bool evalExclusive(APExecutionData & anInputED, APExecutionData & evalED,
+ APExecutionData & otherED, CollectionOfAPExecutionData & listOfOutputED);
+
+ bool evalExclusive(APExecutionData & anInputED, APExecutionData & evalED,
+ ListOfAPExecutionData & listOfOtherED, CollectionOfAPExecutionData & listOfOutputED);
+
+ bool evalExclusive(APExecutionData & anInputED, ListOfAPExecutionData & oneListOfED,
+ APExecutionData & otherED, CollectionOfAPExecutionData & listOfOutputED);
+
+};
+
+
+}
+
+#endif /* AVMBASESCHEDULINGPRIMITIVE_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmBitwisePrimitive.cpp b/org.eclipse.efm.symbex/src/computer/primitive/AvmBitwisePrimitive.cpp
new file mode 100644
index 0000000..c94b1da
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmBitwisePrimitive.cpp
@@ -0,0 +1,303 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmBitwisePrimitive.h"
+
+#include <common/BF.h>
+
+#include <computer/EvaluationEnvironment.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/operator/Operator.h>
+#include <fml/operator/OperatorManager.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// BITWISE FORMAT
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+// INVARIANT:> only << second >> could be << numeric<integer> >>
+
+static void formtatBitwiseExpression(EvaluationEnvironment & ENV,
+ Operator * op, const BF & first, const BF & second)
+{
+ if( second.isInteger() && first.is< AvmCode >() &&
+ first.to_ptr< AvmCode >()->isOpCode(op) &&
+ first.to_ptr< AvmCode >()->second().isInteger() )
+ {
+ BF bresult;
+ switch( op->getAvmOpCode() )
+ {
+ case AVM_OPCODE_BAND: // (x & m ) & n == x & (m & n)
+ {
+ bresult = ExpressionConstructor::newInteger(second.isInteger() &
+ first.to_ptr< AvmCode >()->second().isInteger());
+ break;
+ }
+ case AVM_OPCODE_BOR: // (x | m ) | n == x | (m | n)
+ {
+ bresult = ExpressionConstructor::newInteger(second.isInteger() |
+ first.to_ptr< AvmCode >()->second().isInteger());
+ break;
+ }
+ case AVM_OPCODE_BXOR: // (x ^ m ) ^ n == x ^ (m ^ n)
+ {
+ bresult = ExpressionConstructor::newInteger(second.isInteger() ^
+ first.to_ptr< AvmCode >()->second().isInteger());
+
+ break;
+ }
+
+ case AVM_OPCODE_LSHIFT: // (x << m ) << n == x << (m + n)
+ case AVM_OPCODE_RSHIFT: // (x >> m ) >> n == x >> (m + n)
+ {
+ bresult = ExpressionConstructor::newInteger(second.isInteger() +
+ first.to_ptr< AvmCode >()->second().isInteger());
+
+ break;
+ }
+ default :
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Unexpected a bitwise operation << "
+ << first.str() << " " << op->getUnrestrictedName()
+ << " " << second.str() << " >>"
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+
+ ENV.outVAL = ExpressionConstructor::newCode(op,
+ first.to_ptr< AvmCode >()->first(), bresult);
+ }
+ else
+ {
+ ENV.outVAL = ExpressionConstructor::newCode(op, first, second);
+ }
+
+// ENV.outVAL = ENV.create(
+// ENV.outED->mRID, op->getUnrestrictedName(), TypeManager::INTEGER, ENV.outVAL);
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// BITWISE NOT
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_BNOT::seval(EvaluationEnvironment & ENV)
+{
+ // AFA : si le parametre ne se reduit pas a une valeur numerique
+ // alors on cree une nouvelle valeur symbolique BNOT#n a laquelle on associe
+ // un AvmCode correspondant au BNOT de la valeur symbolique
+
+ if( ENV.mARG->at(0).isInteger() )
+ {
+ // NOT OPERATION
+ ENV.outVAL = ExpressionConstructor::newInteger(
+ ~ (ENV.mARG->at(0).toInteger()) );
+ }
+ else if( ENV.mARG->at(0).is< AvmCode >() &&
+ ENV.mARG->at(0).to_ptr< AvmCode >()->isOpCode( AVM_OPCODE_BNOT ) )
+ {
+ ENV.outVAL = ENV.mARG->at(0).to_ptr< AvmCode >()->first();
+ }
+ else
+ {
+ ENV.outVAL = ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_BNOT, ENV.mARG->at(0));
+// ENV.outVAL = ENV.create(ENV.mARG->outED->mRID, "BNOT",
+// TypeManager::INTEGER, ENV.mARG->at(0));
+ }
+
+ return( true );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// BITWISE AND
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_BAND::seval(EvaluationEnvironment & ENV)
+{
+ // AFA : si l'évaluation ne se reduit pas a une valeur numerique
+ // alors on cree une nouvelle valeur symbolique BAND#n a laquelle
+ // on associe un AvmCode correspondant au BAND des paramètres évaluées
+
+ if ( ENV.mARG->at(0).isInteger() )
+ {
+ if ( ENV.mARG->at(1).isInteger() )
+ {
+ ENV.outVAL = ExpressionConstructor::newInteger(
+ ENV.mARG->at(0).toInteger() & ENV.mARG->at(1).toInteger() );
+ }
+ else
+ {
+ formtatBitwiseExpression(ENV, OperatorManager::OPERATOR_BAND,
+ ENV.mARG->at(1), ENV.mARG->at(0));
+ }
+ }
+ else
+ {
+ formtatBitwiseExpression(ENV, OperatorManager::OPERATOR_BAND,
+ ENV.mARG->at(0), ENV.mARG->at(1));
+ }
+
+ return( true );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// BITWISE OR
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_BOR::seval(EvaluationEnvironment & ENV)
+{
+ // AFA : si l'évaluation ne se reduit pas a une valeur numerique
+ // alors on cree une nouvelle valeur symbolique BOR#n a laquelle
+ // on associe un AvmCode correspondant au BOR des paramètres évaluées
+
+ if ( ENV.mARG->at(0).isInteger() )
+ {
+ if ( ENV.mARG->at(1).isInteger() )
+ {
+ ENV.outVAL = ExpressionConstructor::newInteger(
+ ENV.mARG->at(0).toInteger() | ENV.mARG->at(1).toInteger() );
+ }
+ else
+ {
+ formtatBitwiseExpression(ENV, OperatorManager::OPERATOR_BOR,
+ ENV.mARG->at(1), ENV.mARG->at(0));
+ }
+ }
+ else
+ {
+ formtatBitwiseExpression(ENV, OperatorManager::OPERATOR_BOR,
+ ENV.mARG->at(0), ENV.mARG->at(1));
+ }
+
+ return( true );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// BITWISE XOR
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_BXOR::seval(EvaluationEnvironment & ENV)
+{
+ // AFA : si l'évaluation ne se reduit pas a une valeur numerique
+ // alors on cree une nouvelle valeur symbolique BXOR#n a laquelle
+ // on associe un AvmCode correspondant au BXOR des paramètres évaluées
+
+ if ( ENV.mARG->at(0).isInteger() )
+ {
+ if ( ENV.mARG->at(1).isInteger() )
+ {
+ ENV.outVAL = ExpressionConstructor::newInteger(
+ ENV.mARG->at(0).toInteger() ^ ENV.mARG->at(1).toInteger() );
+ }
+ else
+ {
+ formtatBitwiseExpression(ENV, OperatorManager::OPERATOR_BXOR,
+ ENV.mARG->at(1), ENV.mARG->at(0));
+ }
+ }
+ else
+ {
+ formtatBitwiseExpression(ENV, OperatorManager::OPERATOR_BXOR,
+ ENV.mARG->at(0), ENV.mARG->at(1));
+ }
+
+ return( true );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// BITWISE LSHIFT
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_LSHIFT::seval(EvaluationEnvironment & ENV)
+{
+ // AFA : si l'évaluation ne se reduit pas a une valeur numerique
+ // alors on cree une nouvelle valeur symbolique LSHIFT#n a laquelle
+ // on associe un AvmCode correspondant au LSHIFT des paramètres évaluées
+
+ if ( ENV.mARG->at(0).isInteger() && ENV.mARG->at(1).isInteger() )
+ {
+ ENV.outVAL = ExpressionConstructor::newInteger(
+ ENV.mARG->at(0).toInteger() << ENV.mARG->at(1).toInteger() );
+ }
+ else
+ {
+ formtatBitwiseExpression(ENV, OperatorManager::OPERATOR_LSHIFT,
+ ENV.mARG->at(0), ENV.mARG->at(1));
+ }
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// BITWISE RSHIFT
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_RSHIFT::seval(EvaluationEnvironment & ENV)
+{
+ // AFA : si l'évaluation ne se reduit pas a une valeur numerique
+ // alors on cree une nouvelle valeur symbolique RSHIFT#n a laquelle
+ // on associe un AvmCode correspondant au RSHIFT des paramètres évaluées
+
+ if ( ENV.mARG->at(0).isInteger() && ENV.mARG->at(1).isInteger() )
+ {
+ ENV.outVAL = ExpressionConstructor::newInteger(
+ ENV.mARG->at(0).toInteger() >> ENV.mARG->at(1).toInteger() );
+ }
+ else
+ {
+ formtatBitwiseExpression(ENV, OperatorManager::OPERATOR_RSHIFT,
+ ENV.mARG->at(0), ENV.mARG->at(1));
+ }
+
+ return( true );
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmBitwisePrimitive.h b/org.eclipse.efm.symbex/src/computer/primitive/AvmBitwisePrimitive.h
new file mode 100644
index 0000000..402ab76
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmBitwisePrimitive.h
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMBITWISEPRIMITIVE_H_
+#define AVMBITWISEPRIMITIVE_H_
+
+#include <computer/primitive/BaseAvmPrimitive.h>
+
+
+namespace sep
+{
+
+
+AVM_PRIMITIVE_EVAL_CLASS(BNOT, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_EVAL_CLASS(BAND, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(BOR, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(BXOR, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_EVAL_CLASS(LSHIFT, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(RSHIFT, BaseAvmPrimitive)
+
+
+
+}
+
+#endif /* AVMBITWISEPRIMITIVE_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmBufferPrimitive.cpp b/org.eclipse.efm.symbex/src/computer/primitive/AvmBufferPrimitive.cpp
new file mode 100644
index 0000000..9186248
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmBufferPrimitive.cpp
@@ -0,0 +1,1215 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 25 janv. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmBufferPrimitive.h"
+
+#include <computer/EvaluationEnvironment.h>
+#include <computer/ExecutionDataFactory.h>
+#include <computer/ExecutionEnvironment.h>
+
+#include <fml/executable/InstanceOfBuffer.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/BuiltinQueue.h>
+#include <fml/expression/ExpressionConstructor.h>
+
+#include <fml/runtime/Message.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// BUFFER APPEND
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_APPEND::run(ExecutionEnvironment & ENV)
+{
+ if( ENV.mARG->at(0).is< BaseBufferForm >() )
+ {
+ // get the optional port parameter
+ Message aMsg;
+ if( ENV.mARG->at(1).is< Message >() )
+ {
+ aMsg = ENV.mARG->at(1);
+ }
+ else
+ {
+ BF aPort;
+ if( ENV.mARG->at(1).is< InstanceOfPort >() )
+ {
+ aPort = ENV.mARG->at(1);
+ ENV.mARG->begin(2);
+ }
+ else
+ {
+ ENV.mARG->begin(1);
+ }
+ aMsg = Message(ENV.mARG->outED->mRID, aPort);
+
+ // get other parameters
+ for( ; ENV.mARG->hasNext() ; ENV.mARG->next() )
+ {
+ aMsg.appendParameter( ENV.mARG->current() );
+ }
+
+AVM_IF_DEBUG_FLAG2( BUFFER , COMMUNICATION )
+ AVM_OS_TRACE << TAB << "Output Message to append in buffer" << std::endl;
+ aMsg.toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_FLAG2( BUFFER , COMMUNICATION )
+ }
+
+ // append the message in the buffer
+ if( ENV.mARG->at(0).to_ptr< BaseBufferForm >()->push(aMsg) )
+ {
+ ENV.appendOutput( ENV.mARG->outED );
+
+ return( true );
+ }
+ }
+
+ else if( ENV.mARG->at(0).is< BuiltinContainer >() )
+ {
+ BuiltinContainer * bc = ENV.mARG->at(0).to_ptr< BuiltinContainer >();
+
+ bool isAppend = false;
+ for( ENV.mARG->begin(1) ; ENV.mARG->hasNext() ; ENV.mARG->next() )
+ {
+ if( bc->add( ENV.mARG->current() ) )
+ {
+ isAppend = true;
+ }
+ else
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << "THROW UNSATISFIED << APPEND >> : "
+ << ENV.mARG->outED->mRID.strUniqId() << " |=> "
+ << ENV.inCODE->str() << std::endl;
+ AVM_OS_TRACE << "\t" << "<capacity:" << bc->capacity()
+ << "> " << bc->str() << " <=< "
+ << ENV.mARG->current().str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+
+ break;
+ }
+ }
+
+AVM_IF_DEBUG_FLAG( ASSIGNMENT )
+ AVM_OS_TRACE << "rvalue:> " << bc->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( ASSIGNMENT )
+
+ if( isAppend )
+ {
+ ENV.appendOutput( ENV.mARG->outED );
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// BUFFER REMOVE
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_REMOVE::run(ExecutionEnvironment & ENV)
+{
+ if( ENV.mARG->at(0).is< BaseBufferForm >() )
+ {
+ BaseBufferForm * bbf = ENV.mARG->at(0).to_ptr< BaseBufferForm >();
+
+ if( ENV.mARG->at(1).is< InstanceOfPort >() )
+ {
+AVM_IF_DEBUG_FLAG2( BUFFER , COMMUNICATION )
+ AVM_OS_TRACE << TAB << "Output Message to remove in buffer:>"
+ << std::endl << TAB2 << "buffer: " << str_header( bbf->getInstance() )
+ << std::endl << TAB2 << "port : "
+ << str_header( ENV.mARG->at(1).to_ptr< InstanceOfPort >() )
+ << std::endl << TAB2 << "buffer:av>" << bbf->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( BUFFER , COMMUNICATION )
+
+ bbf->remove( ENV.mARG->at(1).to_ptr< InstanceOfPort >() );
+
+AVM_IF_DEBUG_FLAG2( BUFFER , COMMUNICATION )
+ AVM_OS_TRACE << TAB2 << "buffer:ap>" << bbf->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( BUFFER , COMMUNICATION )
+
+ }
+
+ ENV.appendOutput( ENV.mARG->outED );
+
+ return( true );
+ }
+
+ else if( ENV.mARG->at(0).is< BuiltinContainer >() )
+ {
+ BuiltinContainer * bc = ENV.mARG->at(0).to_ptr< BuiltinContainer >();
+
+ for( ENV.mARG->begin(1) ; ENV.mARG->hasNext() ; ENV.mARG->next() )
+ {
+ bc->remove( ENV.mARG->current() );
+ }
+
+AVM_IF_DEBUG_FLAG( ASSIGNMENT )
+ AVM_OS_TRACE << "rvalue:> " << bc->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( ASSIGNMENT )
+
+ ENV.appendOutput( ENV.mARG->outED );
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// BUFFER CLEAR
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_CLEAR::run(ExecutionEnvironment & ENV)
+{
+ if( ENV.mARG->at(0).is< BaseBufferForm >() )
+ {
+ ENV.mARG->at(0).to_ptr< BaseBufferForm >()->clear();
+ }
+
+ else if( ENV.mARG->at(0).is< BuiltinContainer >() )
+ {
+ ENV.mARG->at(0).to_ptr< BuiltinContainer >()->clear();
+ }
+
+ ENV.appendOutput( ENV.mARG->outED );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// BUFFER RESIZE
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_RESIZE::run(ExecutionEnvironment & ENV)
+{
+ if( ENV.mARG->at(0).is< BaseBufferForm >() )
+ {
+ ENV.mARG->at(0).to_ptr< BaseBufferForm >()->resize(
+ ENV.mARG->at(1).toInteger());
+ }
+
+ else if( ENV.mARG->at(0).is< BuiltinCollection >() )
+ {
+ ENV.mARG->at(0).to_ptr< BuiltinCollection >()->resize(
+ ENV.mARG->at(1).toInteger());
+ }
+
+ ENV.appendOutput( ENV.mARG->outED );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// BUFFER PUSH
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_PUSH::run(ExecutionEnvironment & ENV)
+{
+ if( ENV.mARG->at(0).is< BaseBufferForm >() )
+ {
+ // get the optional port parameter
+ Message aMsg;
+ if( ENV.mARG->at(1).is< Message >() )
+ {
+ aMsg = ENV.mARG->at(1);
+ }
+ else
+ {
+ BF aPort;
+ if( ENV.mARG->at(1).is< InstanceOfPort >() )
+ {
+ aPort = ENV.mARG->at(1);
+ ENV.mARG->begin(2);
+ }
+ else
+ {
+ ENV.mARG->begin(1);
+ }
+ aMsg = Message(ENV.mARG->outED->mRID, aPort);
+
+ // get other parameters
+ for( ; ENV.mARG->hasNext() ; ENV.mARG->next() )
+ {
+ aMsg.appendParameter( ENV.mARG->current() );
+ }
+
+AVM_IF_DEBUG_FLAG2( BUFFER , COMMUNICATION )
+ AVM_OS_TRACE << TAB << "Output Message to append in buffer" << std::endl;
+ aMsg.toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_FLAG2( BUFFER , COMMUNICATION )
+ }
+
+ // append the message in the buffer
+ if( ENV.mARG->at(0).to_ptr< BaseBufferForm >()->push(aMsg) )
+ {
+ ENV.appendOutput( ENV.mARG->outED );
+
+ return( true );
+ }
+ }
+
+ else if( ENV.mARG->at(0).is< BuiltinQueue >() )
+ {
+ BuiltinQueue * queue = ENV.mARG->at(0).to_ptr< BuiltinQueue >();
+ if( queue != NULL )
+ {
+ bool isAppend = false;
+ for( ENV.mARG->begin(1) ; ENV.mARG->hasNext() ; ENV.mARG->next() )
+ {
+ if( queue->push( ENV.mARG->current() ) )
+ {
+ isAppend = true;
+ }
+ else
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << "THROW UNSATISFIED << PUSH >> : "
+ << ENV.mARG->outED->mRID.strUniqId() << " |=> "
+ << ENV.inCODE->str() << std::endl;
+ AVM_OS_TRACE << "\t" << "<capacity:" << queue->capacity()
+ << "> " << queue->str() << " <=< "
+ << ENV.mARG->current().str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+
+ break;
+ }
+ }
+
+AVM_IF_DEBUG_FLAG( ASSIGNMENT )
+ AVM_OS_TRACE << "rvalue:> " << queue->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( ASSIGNMENT )
+
+ if( isAppend )
+ {
+ ENV.appendOutput( ENV.mARG->outED );
+ return( true );
+ }
+ }
+ else
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << "THROW UNSATISFIED << PUSH >> : "
+ << ENV.mARG->outED->mRID.strUniqId() << " |=> "
+ << ENV.inCODE->str() << std::endl;
+ AVM_OS_TRACE << "\t" << "Unfound queue for << "
+ << ENV.mARG->at(0).str() << " >>" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+ }
+ }
+
+ else if( ENV.mARG->at(0).is< BuiltinContainer >() )
+ {
+ BuiltinContainer * bc = ENV.mARG->at(0).to_ptr< BuiltinContainer >();
+
+ bool isAppend = false;
+ for( ENV.mARG->begin(1) ; ENV.mARG->hasNext() ; ENV.mARG->next() )
+ {
+ if( bc->add( ENV.mARG->current() ) )
+ {
+ isAppend = true;
+ }
+ else
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << "THROW UNSATISFIED << PUSH >> : "
+ << ENV.mARG->outED->mRID.strUniqId() << " |=> "
+ << ENV.inCODE->str() << std::endl;
+ AVM_OS_TRACE << "\t" << "<capacity:" << bc->capacity()
+ << "> " << bc->str() << " <=< "
+ << ENV.mARG->current().str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+
+ break;
+ }
+ }
+
+AVM_IF_DEBUG_FLAG( ASSIGNMENT )
+ AVM_OS_TRACE << "rvalue:> " << bc->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( ASSIGNMENT )
+
+ if( isAppend )
+ {
+ ENV.appendOutput( ENV.mARG->outED );
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// BUFFER ASSIGN_TOP
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_ASSIGN_TOP::run(ExecutionEnvironment & ENV)
+{
+ if( ENV.mARG->at(0).is< BaseBufferForm >() )
+ {
+ // get the optional port parameter
+ Message aMsg;
+ if( ENV.mARG->at(1).is< Message >() )
+ {
+ aMsg = ENV.mARG->at(1);
+ }
+ else
+ {
+ BF aPort;
+ if( ENV.mARG->at(1).is< InstanceOfPort >() )
+ {
+ aPort = ENV.mARG->at(1);
+ ENV.mARG->begin(2);
+ }
+ else
+ {
+ ENV.mARG->begin(1);
+ }
+ aMsg = Message(ENV.mARG->outED->mRID, aPort);
+
+ // get other parameters
+ for( ; ENV.mARG->hasNext() ; ENV.mARG->next() )
+ {
+ aMsg.appendParameter( ENV.mARG->current() );
+ }
+
+AVM_IF_DEBUG_FLAG2( BUFFER , COMMUNICATION )
+ AVM_OS_TRACE << TAB << "Output Message to assign#top in buffer" << std::endl;
+ aMsg.toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_FLAG2( BUFFER , COMMUNICATION )
+ }
+
+ // append the message in the buffer
+ if( ENV.mARG->at(0).to_ptr< BaseBufferForm >()->top( aMsg) )
+ {
+ ENV.appendOutput( ENV.mARG->outED );
+
+ return( true );
+ }
+ }
+ else if( ENV.mARG->at(0).is< BuiltinQueue >() )
+ {
+ BuiltinQueue * queue = ENV.mARG->at(0).to_ptr< BuiltinQueue >();
+ if( queue->nonempty() )
+ {
+AVM_IF_DEBUG_FLAG( ASSIGNMENT )
+ AVM_OS_TRACE << "lvalue:queue> " << queue->str() << std::endl
+ << "rvalue:> " << ENV.mARG->at(1).str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( ASSIGNMENT )
+
+ if( queue->top( ENV.mARG->at(1) ) )
+ {
+AVM_IF_DEBUG_FLAG( ASSIGNMENT )
+ AVM_OS_TRACE << "queue> " << queue->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( ASSIGNMENT )
+
+ ENV.appendOutput( ENV.mARG->outED );
+
+ return( true );
+ }
+ }
+ }
+
+ return( false );
+}
+
+
+bool AvmPrimitive_ASSIGN_TOP::seval(EvaluationEnvironment & ENV)
+{
+ if( ENV.mARG->at(0).is< BaseBufferForm >() )
+ {
+ // get the optional port parameter
+ Message aMsg;
+ if( ENV.mARG->at(1).is< Message >() )
+ {
+ aMsg = ENV.mARG->at(1);
+ }
+ else
+ {
+ BF aPort;
+ if( ENV.mARG->at(1).is< InstanceOfPort >() )
+ {
+ aPort = ENV.mARG->at(1);
+ }
+ aMsg = Message(ENV.mARG->outED->mRID, aPort);
+
+ // get other parameters
+ for( ENV.mARG->begin(2) ; ENV.mARG->hasNext() ; ENV.mARG->next() )
+ {
+ aMsg.appendParameter( ENV.mARG->current() );
+ }
+
+AVM_IF_DEBUG_FLAG2( BUFFER , COMMUNICATION )
+ AVM_OS_TRACE << TAB << "Output Message to assign#top in buffer" << std::endl;
+ aMsg.toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_FLAG2( BUFFER , COMMUNICATION )
+ }
+
+ // append the message in the buffer
+ if( ENV.mARG->at(0).to_ptr< BaseBufferForm >()->top( aMsg) )
+ {
+ ENV.outVAL = aMsg;
+
+ return( true );
+ }
+ }
+ else if( ENV.mARG->at(0).is< BuiltinQueue >() )
+ {
+ BuiltinQueue * queue = ENV.mARG->at(0).to_ptr< BuiltinQueue >();
+ if( (queue != NULL) && queue->nonempty() )
+ {
+AVM_IF_DEBUG_FLAG( ASSIGNMENT )
+ AVM_OS_TRACE << "lvalue:queue> " << queue->str() << std::endl
+ << "rvalue:> " << ENV.mARG->at(1).str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( ASSIGNMENT )
+
+ if( queue->top( ENV.mARG->at(1) ) )
+ {
+AVM_IF_DEBUG_FLAG( ASSIGNMENT )
+ AVM_OS_TRACE << "queue> " << queue->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( ASSIGNMENT )
+
+ ENV.outVAL = ENV.mARG->at(1);
+
+ return( true );
+ }
+ }
+ else if( queue == NULL )
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << "THROW UNSATISFIED << ASSING#TOP >> : "
+ << ENV.inED->mRID.strUniqId() << " |=> "
+ << ENV.inCODE->str() << std::endl;
+ AVM_OS_TRACE << "\t" << "Unfound builtin queue for << "
+ << ENV.mARG->at(0).str() << " >>" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+ }
+ }
+
+ return( false );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// BUFFER TOP
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_TOP::run(ExecutionEnvironment & ENV)
+{
+ if( ENV.mARG->at(0).is< BaseBufferForm >() )
+ {
+ Message aMsg = ENV.mARG->at(0).to_ptr< BaseBufferForm >()->top();
+
+ if( aMsg.valid() && (ENV.mARG->count > 1) )
+ {
+ if( ENV.mARG->at(1).is< InstanceOfData >() &&
+ ENV.mARG->at(1).to_ptr< InstanceOfData >()->isTypedMessage() )
+ {
+AVM_IF_DEBUG_FLAG( ASSIGNMENT )
+ AVM_OS_TRACE << "rvalue:msg> " << aMsg.str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( ASSIGNMENT )
+
+ if( not ENV.setRvalue(ENV.mARG->outED,
+ ENV.mARG->at(1).to_ptr< InstanceOfData >(), aMsg) )
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ // We have to ignore the << Buffer >>
+ Message::const_iterator itValue = aMsg.beginParameters();
+ Message::const_iterator endValue = aMsg.endParameters();
+ ENV.mARG->begin(1);
+ for( ; ENV.mARG->hasNext() && (itValue != endValue) ;
+ ENV.mARG->next() , ++itValue )
+ {
+AVM_IF_DEBUG_FLAG( ASSIGNMENT )
+ AVM_OS_TRACE << "lvalue:> " << ENV.mARG->current().str() << std::endl
+ << "rvalue:> " << (*itValue).str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( ASSIGNMENT )
+
+ if( not ENV.setRvalue(ENV.mARG->outED, ENV.mARG->current().
+ to_ptr< InstanceOfData >(), (*itValue)) )
+ {
+ return( false );
+ }
+ }
+ }
+
+ ENV.appendOutput( ENV.mARG->outED );
+
+ return( true );
+ }
+
+ return( aMsg.valid() );
+ }
+ else //if( ENV.mARG->at(0).is< BuiltinQueue >() )
+ {
+ BuiltinQueue * queue = ENV.mARG->at(0).to_ptr< BuiltinQueue >();
+ if( ENV.mARG->count > 1 )
+ {
+ BF popValue;
+ for( ENV.mARG->begin(1) ; ENV.mARG->hasNext() ; ENV.mARG->next() )
+ {
+ popValue = queue->top();
+
+ if( popValue.invalid() )
+ {
+ return( false );
+ }
+ else
+ {
+AVM_IF_DEBUG_FLAG( ASSIGNMENT )
+ AVM_OS_TRACE << "rvalue:> " << popValue.str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( ASSIGNMENT )
+
+ if( not ENV.setRvalue(ENV.mARG->outED, ENV.mARG->current().
+ to_ptr< InstanceOfData >(), popValue) )
+ {
+ return( false );
+ }
+ }
+ }
+
+AVM_IF_DEBUG_FLAG( ASSIGNMENT )
+ AVM_OS_TRACE << "rvalue:queue> " << queue->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( ASSIGNMENT )
+
+ ENV.appendOutput( ENV.mARG->outED );
+
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+
+bool AvmPrimitive_TOP::seval(EvaluationEnvironment & ENV)
+{
+ if( ENV.mARG->at(0).is< BaseBufferForm >() )
+ {
+ ENV.outVAL = ENV.mARG->at(0).to_ptr< BaseBufferForm >()->top();
+ }
+
+ else if( ENV.mARG->at(0).is< BuiltinQueue >() )
+ {
+// AVM_OS_TRACE << "queue->top :> " << ENV.mARG->at(0).str()
+// << " = " << ENV.getWritableQueue(ENV.mARG->outED,
+// ENV.mARG->at(0)).str() << std::endl;
+
+ ENV.outVAL = ENV.mARG->at(0).to_ptr< BuiltinQueue >()->top();
+ }
+
+ return( ENV.outVAL.valid() );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// BUFFER POP
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_POP::run(ExecutionEnvironment & ENV)
+{
+ if( ENV.mARG->at(0).is< BaseBufferForm >() )
+ {
+ Message aMsg = ENV.mARG->at(0).to_ptr< BaseBufferForm >()->pop();
+
+ if( aMsg.valid() && (ENV.mARG->count > 1) )
+ {
+ if( ENV.mARG->at(1).is< InstanceOfData >() &&
+ ENV.mARG->at(1).to_ptr< InstanceOfData >()->isTypedMessage() )
+ {
+AVM_IF_DEBUG_FLAG( ASSIGNMENT )
+ AVM_OS_TRACE << "rvalue:msg> " << aMsg.str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( ASSIGNMENT )
+
+ if( not ENV.setRvalue(ENV.mARG->outED,
+ ENV.mARG->at(1).to_ptr< InstanceOfData >(), aMsg) )
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ // We have to ignore the << Buffer >>
+ Message::const_iterator itValue = aMsg.beginParameters();
+ Message::const_iterator endValue = aMsg.endParameters();
+ ENV.mARG->begin(1);
+ for( ; ENV.mARG->hasNext() && (itValue != endValue) ;
+ ENV.mARG->next() , ++itValue )
+ {
+AVM_IF_DEBUG_FLAG( ASSIGNMENT )
+ AVM_OS_TRACE << "lvalue:> " << ENV.mARG->current().str() << std::endl
+ << "rvalue:> " << (*itValue).str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( ASSIGNMENT )
+
+ if( not ENV.setRvalue(ENV.mARG->outED, ENV.mARG->current().
+ to_ptr< InstanceOfData >(), (*itValue)) )
+ {
+ return( false );
+ }
+ }
+ }
+
+ ENV.appendOutput( ENV.mARG->outED );
+
+ return( true );
+ }
+
+ return( aMsg.valid() );
+ }
+ else if( ENV.mARG->at(0).is< BuiltinQueue >() )
+ {
+ BuiltinQueue * queue = ENV.mARG->at(0).to_ptr< BuiltinQueue >();
+ if( ENV.mARG->count == 1 )
+ {
+ queue->pop();
+ }
+ else //if( ENV.mARG->count > 1 )
+ {
+ BF popValue;
+ for( ENV.mARG->begin(1) ; ENV.mARG->hasNext() ; ENV.mARG->next() )
+ {
+ popValue = queue->pop();
+
+ if( popValue.invalid() )
+ {
+ return( false );
+ }
+ else
+ {
+AVM_IF_DEBUG_FLAG( ASSIGNMENT )
+ AVM_OS_TRACE << "lvalue:> "
+ << str_header( ENV.mARG->current().to_ptr< InstanceOfData >() )
+ << std::endl
+ << "rvalue:> " << popValue.str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( ASSIGNMENT )
+
+ if( not ENV.setRvalue(ENV.mARG->outED, ENV.mARG->current().
+ to_ptr< InstanceOfData >(), popValue) )
+ {
+ return( false );
+ }
+ }
+ }
+ }
+
+AVM_IF_DEBUG_FLAG( ASSIGNMENT )
+ AVM_OS_TRACE << "rvalue:queue> " << queue->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( ASSIGNMENT )
+
+ ENV.appendOutput( ENV.mARG->outED );
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+bool AvmPrimitive_POP::seval(EvaluationEnvironment & ENV)
+{
+ if( ENV.mARG->at(0).is< BaseBufferForm >() )
+ {
+ ENV.outVAL = ENV.mARG->at(0).to_ptr< BaseBufferForm >()->pop();
+ }
+
+ else if( ENV.mARG->at(0).is< BuiltinQueue >() )
+ {
+// AVM_OS_TRACE << "queue :> " << ENV.mARG->at(0).str() << std::endl;
+
+ ENV.outVAL = ENV.mARG->at(0).to_ptr< BuiltinQueue >()->pop();
+
+// AVM_OS_TRACE << "queue->pop :> " << ENV.mARG->at(0).str() << std::endl;
+ }
+
+ return( ENV.outVAL.valid() );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// BUFFER POP FROM
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_POP_FROM::run(ExecutionEnvironment & ENV)
+{
+ if( ENV.mARG->at(0).is< BaseBufferForm >() )
+ {
+ Message aMsg = ENV.mARG->at(0).to_ptr< BaseBufferForm >()->pop();
+
+ if( aMsg.valid() && (ENV.mARG->count > 1) )
+ {
+ if( ENV.mARG->at(1).is< InstanceOfData >() &&
+ ENV.mARG->at(1).to_ptr< InstanceOfData >()->isTypedMessage() )
+ {
+AVM_IF_DEBUG_FLAG( ASSIGNMENT )
+ AVM_OS_TRACE << "rvalue:msg> " << aMsg.str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( ASSIGNMENT )
+
+ if( not ENV.setRvalue(ENV.mARG->outED,
+ ENV.mARG->at(1).to_ptr< InstanceOfData >(), aMsg) )
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ // We have to ignore the << Buffer >>
+ Message::const_iterator itValue = aMsg.beginParameters();
+ Message::const_iterator endValue = aMsg.endParameters();
+ ENV.mARG->begin(1);
+ for( ; ENV.mARG->hasNext() && (itValue != endValue) ;
+ ENV.mARG->next() , ++itValue )
+ {
+AVM_IF_DEBUG_FLAG( ASSIGNMENT )
+ AVM_OS_TRACE << "lvalue:> " << ENV.mARG->current().str() << std::endl
+ << "rvalue:> " << (*itValue).str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( ASSIGNMENT )
+
+ if( not ENV.setRvalue(ENV.mARG->outED, ENV.mARG->current().
+ to_ptr< InstanceOfData >(), (*itValue)) )
+ {
+ return( false );
+ }
+ }
+ }
+
+ ENV.appendOutput( ENV.mARG->outED );
+
+ return( true );
+ }
+
+ return( aMsg.valid() );
+ }
+ else if( ENV.mARG->at(0).is< BuiltinQueue >() )
+ {
+ BuiltinQueue * queue = ENV.mARG->at(0).to_ptr< BuiltinQueue >();
+ if( ENV.mARG->count == 1 )
+ {
+ queue->pop();
+ }
+ else //if( ENV.mARG->count > 1 )
+ {
+ BF popValue;
+ for( ENV.mARG->begin(1) ; ENV.mARG->hasNext() ; ENV.mARG->next() )
+ {
+ popValue = queue->pop();
+
+ if( popValue.invalid() )
+ {
+ return( false );
+ }
+ else
+ {
+AVM_IF_DEBUG_FLAG( ASSIGNMENT )
+ AVM_OS_TRACE << "rvalue:> " << popValue.str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( ASSIGNMENT )
+
+ if( not ENV.setRvalue(ENV.mARG->outED, ENV.mARG->current().
+ to_ptr< InstanceOfData >(), popValue) )
+ {
+ return( false );
+ }
+ }
+ }
+ }
+
+AVM_IF_DEBUG_FLAG( ASSIGNMENT )
+ AVM_OS_TRACE << "rvalue:queue> " << queue->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( ASSIGNMENT )
+
+ ENV.appendOutput( ENV.mARG->outED );
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+bool AvmPrimitive_POP_FROM::seval(EvaluationEnvironment & ENV)
+{
+ if( ENV.mARG->at(0).is< BaseBufferForm >() )
+ {
+ ENV.outVAL = ENV.mARG->at(0).to_ptr< BaseBufferForm >()->pop();
+ }
+
+ else if( ENV.mARG->at(0).is< BuiltinQueue >() )
+ {
+// AVM_OS_TRACE << "queue :> " << ENV.mARG->at(0).str() << std::endl;
+
+ ENV.outVAL = ENV.mARG->at(0).to_ptr< BuiltinQueue >()->pop();
+
+// AVM_OS_TRACE << "queue->pop :> " << ENV.mARG->at(0).str() << std::endl;
+ }
+
+ return( ENV.outVAL.valid() );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// BUFFER EMPTY
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_EMPTY::seval(EvaluationEnvironment & ENV)
+{
+ if( ENV.mARG->at(0).is< BaseBufferForm >() )
+ {
+ ENV.outVAL = ExpressionConstructor::newBoolean(
+ ENV.mARG->at(0).to_ptr< BaseBufferForm >()->empty() );
+ }
+
+ else if( ENV.mARG->at(0).is< BuiltinCollection >() )
+ {
+ ENV.outVAL = ExpressionConstructor::newBoolean(
+ ENV.mARG->at(0).to_ptr< BuiltinCollection >()->empty() );
+ }
+
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected a NON-BUILTIN-COLLECTION for the value << "
+ << ENV.mARG->at(0).str() << " >> !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ return( true );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// BUFFER NONEMPTY
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_NONEMPTY::seval(EvaluationEnvironment & ENV)
+{
+ if( ENV.mARG->at(0).is< BaseBufferForm >() )
+ {
+ ENV.outVAL = ExpressionConstructor::newBoolean(
+ ENV.mARG->at(0).to_ptr< BaseBufferForm >()->nonempty() );
+ }
+
+ else if( ENV.mARG->at(0).is< BuiltinCollection >() )
+ {
+ ENV.outVAL = ExpressionConstructor::newBoolean(
+ ENV.mARG->at(0).to_ptr< BuiltinCollection >()->nonempty() );
+ }
+
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected a NON-BUILTIN-COLLECTION for the value << "
+ << ENV.mARG->at(0).str() << " >> !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ return( true );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// BUFFER SINGLETON
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_SINGLETON::seval(EvaluationEnvironment & ENV)
+{
+ if( ENV.mARG->at(0).is< BaseBufferForm >() )
+ {
+ ENV.outVAL = ExpressionConstructor::newBoolean(
+ ENV.mARG->at(0).to_ptr< BaseBufferForm >()->singleton() );
+ }
+
+ else if( ENV.mARG->at(0).is< BuiltinCollection >() )
+ {
+ ENV.outVAL = ExpressionConstructor::newBoolean(
+ ENV.mARG->at(0).to_ptr< BuiltinCollection >()->singleton() );
+ }
+
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected a NON-BUILTIN-COLLECTION for the value << "
+ << ENV.mARG->at(0).str() << " >> !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ return( true );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// BUFFER POPULATED
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_POPULATED::seval(EvaluationEnvironment & ENV)
+{
+ if( ENV.mARG->at(0).is< BaseBufferForm >() )
+ {
+ ENV.outVAL = ExpressionConstructor::newBoolean(
+ ENV.mARG->at(0).to_ptr< BaseBufferForm >()->populated() );
+ }
+
+ else if( ENV.mARG->at(0).is< BuiltinCollection >() )
+ {
+ ENV.outVAL = ExpressionConstructor::newBoolean(
+ ENV.mARG->at(0).to_ptr< BuiltinCollection >()->populated() );
+ }
+
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected a NON-BUILTIN-COLLECTION for the value << "
+ << ENV.mARG->at(0).str() << " >> !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ return( true );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// BUFFER FULL
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_FULL::seval(EvaluationEnvironment & ENV)
+{
+ if( ENV.mARG->at(0).is< BaseBufferForm >() )
+ {
+ ENV.outVAL = ExpressionConstructor::newBoolean(
+ ENV.mARG->at(0).to_ptr< BaseBufferForm >()->full() );
+ }
+
+ else if( ENV.mARG->at(0).is< BuiltinCollection >() )
+ {
+ ENV.outVAL = ExpressionConstructor::newBoolean(
+ ENV.mARG->at(0).to_ptr< BuiltinCollection >()->full() );
+ }
+
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected a NON-BUILTIN-COLLECTION for the value << "
+ << ENV.mARG->at(0).str() << " >> !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// BUFFER SIZE
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_SIZE::seval(EvaluationEnvironment & ENV)
+{
+ if( ENV.mARG->at(0).is< BaseBufferForm >() )
+ {
+ ENV.outVAL = ExpressionConstructor::newInteger(
+ ENV.mARG->at(0).to_ptr< BaseBufferForm >()->size() );
+ }
+
+ else if( ENV.mARG->at(0).is< BuiltinCollection >() )
+ {
+ ENV.outVAL = ExpressionConstructor::newInteger(
+ ENV.mARG->at(0).to_ptr< BuiltinCollection >()->size() );
+ }
+
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected a NON-BUILTIN-COLLECTION for the value << "
+ << ENV.mARG->at(0).str() << " >> !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// BUFFER CONTAINS
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_CONTAINS::seval(EvaluationEnvironment & ENV)
+{
+ /*if( container.is< BaseBufferForm >() )
+ {
+ ENV.outVAL = ExpressionConstructor::newBoolean(
+ ENV.mARG->at(0).to_ptr< BaseBufferForm >()->
+ contains( ENV.mARG->at(1) ) );
+ }
+
+ else*/ if( ENV.mARG->at(0).is< BuiltinCollection >() )
+ {
+ ENV.outVAL = ExpressionConstructor::newBoolean( ENV.mARG->at(0).
+ to_ptr< BuiltinCollection >()->contains( ENV.mARG->at(1) ) );
+ }
+
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected a NON-BUILTIN-COLLECTION for the value << "
+ << ENV.mARG->at(0).str() << " >> !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ return( true );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// BUFFER IN
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_IN::seval(EvaluationEnvironment & ENV)
+{
+ /*if( container.is< BaseBufferForm >() )
+ {
+ ENV.outVAL = ExpressionConstructor::newBoolean(
+ ENV.mARG->at(1).to_ptr< BaseBufferForm >()->
+ contains( ENV.mARG->at(0) ) );
+ }
+
+ else*/ if( ENV.mARG->at(1).is< BuiltinCollection >() )
+ {
+ ENV.outVAL = ExpressionConstructor::newBoolean( ENV.mARG->at(1).
+ to_ptr< BuiltinCollection >()->contains( ENV.mARG->at(0) ) );
+ }
+
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected a NON-BUILTIN-COLLECTION for the value << "
+ << ENV.mARG->at(1).str() << " >> !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ return( true );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// BUFFER NOTIN
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_NOTIN::seval(EvaluationEnvironment & ENV)
+{
+ /*if( container.is< BaseBufferForm >() )
+ {
+ ENV.outVAL = ExpressionConstructor::newBoolean(
+ ! ENV.mARG->at(1).to_ptr< BaseBufferForm >()->
+ contains( ENV.mARG->at(0) ) );
+ }
+
+ else*/ if( ENV.mARG->at(1).is< BuiltinCollection >() )
+ {
+ ENV.outVAL = ExpressionConstructor::newBoolean( not ENV.mARG->at(1).
+ to_ptr< BuiltinCollection >()->contains( ENV.mARG->at(0) ) );
+ }
+
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected a NON-BUILTIN-COLLECTION for the value << "
+ << ENV.mARG->at(1).str() << " >> !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ return( true );
+}
+
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmBufferPrimitive.h b/org.eclipse.efm.symbex/src/computer/primitive/AvmBufferPrimitive.h
new file mode 100644
index 0000000..98833bb
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmBufferPrimitive.h
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 25 janv. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMBUFFERPRIMITIVE_H_
+#define AVMBUFFERPRIMITIVE_H_
+
+#include <computer/primitive/BaseAvmPrimitive.h>
+
+
+namespace sep
+{
+
+// BUFFER MANAGEMENT
+AVM_PRIMITIVE_RUN_CLASS(APPEND, BaseAvmPrimitive)
+AVM_PRIMITIVE_RUN_CLASS(REMOVE, BaseAvmPrimitive)
+AVM_PRIMITIVE_RUN_CLASS(CLEAR, BaseAvmPrimitive)
+AVM_PRIMITIVE_RUN_CLASS(RESIZE, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(PUSH, BaseAvmPrimitive)
+AVM_PRIMITIVE_RUN_EVAL_CLASS(ASSIGN_TOP, BaseAvmPrimitive)
+AVM_PRIMITIVE_RUN_EVAL_CLASS(TOP, BaseAvmPrimitive)
+AVM_PRIMITIVE_RUN_EVAL_CLASS(POP, BaseAvmPrimitive)
+AVM_PRIMITIVE_RUN_EVAL_CLASS(POP_FROM, BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_EVAL_CLASS(EMPTY, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(NONEMPTY, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(SINGLETON, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(POPULATED, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(FULL, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_EVAL_CLASS(CONTAINS, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(IN, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(NOTIN, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_EVAL_CLASS(SIZE, BaseAvmPrimitive)
+
+
+}
+
+#endif /* AVMBUFFERPRIMITIVE_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmCommunicationFactory.cpp b/org.eclipse.efm.symbex/src/computer/primitive/AvmCommunicationFactory.cpp
new file mode 100644
index 0000000..30221ba
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmCommunicationFactory.cpp
@@ -0,0 +1,1532 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 27 oct. 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmCommunicationFactory.h"
+
+#include <fml/common/ModifierElement.h>
+
+#include <computer/EvaluationEnvironment.h>
+#include <computer/ExecutionDataFactory.h>
+#include <computer/ExecutionEnvironment.h>
+
+#include <computer/instruction/InstructionEnvironment.h>
+
+#include <fml/buffer/BaseBufferForm.h>
+#include <fml/buffer/BroadcastBuffer.h>
+
+#include <fml/executable/ExecutableLib.h>
+#include <fml/executable/InstanceOfBuffer.h>
+#include <fml/executable/InstanceOfConnect.h>
+#include <fml/executable/InstanceOfData.h>
+#include <fml/executable/InstanceOfMachine.h>
+#include <fml/executable/InstanceOfPort.h>
+#include <fml/executable/Router.h>
+#include <fml/executable/RoutingData.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/StatementConstructor.h>
+
+#include <fml/infrastructure/ComProtocol.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/runtime/ExecutionConfiguration.h>
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/ExecutionSynchronizationPoint.h>
+#include <fml/runtime/Message.h>
+#include <fml/runtime/RuntimeLib.h>
+#include <fml/runtime/RuntimeID.h>
+
+#include <fml/workflow/UniFormIdentifier.h>
+
+
+namespace sep
+{
+
+
+/**
+ * SEARCH ROUTING DATA
+ */
+const RoutingData & AvmCommunicationFactory::searchInputRoutingData(
+ const ExecutionData & anED, InstanceOfPort * aPort,
+ RuntimeID & aRoutingRID)
+{
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( aPort->getModifier().hasDirectionInput() )
+ << "AvmCommunicationFactory::searchInputRoutingData :> "
+ "Unexpected non-INPUT port "
+ << aPort->getFullyQualifiedNameID() << " !!!"
+ << SEND_EXIT;
+
+ if( aPort->hasInputRoutingData() )
+ {
+ aRoutingRID = aPort->getInputRoutingData().getRuntimeRID();
+
+ return( aPort->getInputRoutingData() );
+ }
+ else if( aPort->isPort() )
+ {
+ if( aPort->hasRuntimeContainerRID() )
+ {
+ aRoutingRID = aPort->getRuntimeContainerRID();
+ }
+ else if( aRoutingRID.valid() )
+ {
+ aRoutingRID = aRoutingRID.getCommunicator(aPort);
+ }
+ }
+ else if( aPort->isSignal() )
+ {
+ while( aRoutingRID.valid()
+ && (not anED.getRuntime(aRoutingRID).hasRouter()) )
+ {
+ aRoutingRID = aRoutingRID.getPRID();
+ }
+ }
+
+ if( aRoutingRID.valid() )
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT(
+ anED.getRuntime(aRoutingRID).hasRouter() )
+ << "Searching Input RoutingData message error : << "
+ << aRoutingRID.getFullyQualifiedNameID()
+ << " >> doesn't have router !!!"
+ << SEND_EXIT;
+
+
+ const RoutingData & aRoutingData = anED.getRuntime(aRoutingRID).
+ getRouter().getInputRouting( aPort->getRouteOffset() );
+ if( aRoutingData != NULL )
+ {
+// aRoutingRID = ( aPort->isVisibilityPublic() )?
+// aRoutingRID.getPRID() : aRoutingRID;
+ aRoutingRID = aRoutingRID.getCommunicator(
+ aRoutingData.getMachine() );
+ }
+
+ return( aRoutingData );
+ }
+
+ return( RoutingData::_NULL_ );
+}
+
+
+const RoutingData & AvmCommunicationFactory::searchOutputRoutingData(
+ const ExecutionData & anED, InstanceOfPort * aPort,
+ RuntimeID & aRoutingRID)
+{
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( aPort->getModifier().hasDirectionOutput() )
+ << "AvmCommunicationFactory::searchOutputRoutingData :> "
+ "Unexpected non-OUTPUT port "
+ << aPort->getFullyQualifiedNameID() << " !!!"
+ << SEND_EXIT;
+
+ if( aPort->hasOutputRoutingData() )
+ {
+ aRoutingRID = aPort->getOutputRoutingData().getRuntimeRID();
+ return( aPort->getOutputRoutingData() );
+ }
+ else if( aPort->isPort() )
+ {
+ if( aPort->hasRuntimeContainerRID() )
+ {
+ aRoutingRID = aPort->getRuntimeContainerRID();
+ }
+ else if( aRoutingRID.valid() )
+ {
+ aRoutingRID = aRoutingRID.getCommunicator(aPort);
+ }
+ }
+ else if( aPort->isSignal() )
+ {
+ while( aRoutingRID.valid()
+ && (not anED.getRuntime(aRoutingRID).hasRouter()) )
+ {
+ aRoutingRID = aRoutingRID.getPRID();
+ }
+ }
+
+ if( aRoutingRID.valid() )
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT(
+ anED.getRuntime(aRoutingRID).hasRouter() )
+ << "Searching Output RoutingData message error : << "
+ << aRoutingRID.getFullyQualifiedNameID()
+ << " >> doesn't have router !!!"
+ << SEND_EXIT;
+
+
+ const RoutingData & aRoutingData = anED.getRuntime(aRoutingRID).
+ getRouter().getOutputRouting( aPort->getRouteOffset() );
+ if( aRoutingData != NULL )
+ {
+// aRoutingRID = ( aPort->isVisibilityPublic() )?
+// aRoutingRID.getPRID() : aRoutingRID;
+ aRoutingRID = aRoutingRID.getCommunicator(
+ aRoutingData.getMachine() );
+ }
+
+ return( aRoutingData );
+ }
+
+ return( RoutingData::_NULL_ );
+}
+
+
+/*
+ * CHECK ROUTING INFORMATION
+ */
+bool AvmCommunicationFactory::isRoutingProtocolEnv(
+ COMPILE_CONTEXT * aCTX, InstanceOfPort * aPort)
+{
+ return( false );
+}
+
+bool AvmCommunicationFactory::isRoutingProtocolRdv(
+ COMPILE_CONTEXT * aCTX, InstanceOfPort * aPort)
+{
+ return( false );
+}
+
+
+/*
+ * POP MESSAGE
+ */
+bool AvmCommunicationFactory::popMessage(
+ ExecutionEnvironment & ENV, InstanceOfPort * aPort)
+{
+ RuntimeID aRoutingRID = ENV.mARG->outED->mRID;
+
+ const RoutingData & aRoutingData =
+ searchInputRoutingData(ENV.mARG->outED, aPort, aRoutingRID);
+
+ if( aRoutingData != NULL )
+ {
+ switch( aRoutingData.getProtocol() )
+ {
+ case ComProtocol::PROTOCOL_ENVIRONMENT_KIND:
+ {
+ if( ENV.mARG->outED->getRuntime(aRoutingRID).
+ isEnvironmentEnabledCommunication() )
+ {
+ return( popMessage_environment(ENV, aRoutingRID, aRoutingData) );
+ }
+ return( false );
+ }
+
+ case ComProtocol::PROTOCOL_TRANSFERT_KIND: // inRD->hasAttach() )
+ {
+ return( popMessage_transfert(ENV, aRoutingRID, aRoutingData) );
+ }
+
+ case ComProtocol::PROTOCOL_BUFFER_KIND:
+ case ComProtocol::PROTOCOL_BROADCAST_KIND:
+ case ComProtocol::PROTOCOL_MULTICAST_KIND:
+ case ComProtocol::PROTOCOL_UNICAST_KIND:
+ case ComProtocol::PROTOCOL_ANYCAST_KIND:
+ {
+ return( popMessage_buffer(ENV, aRoutingRID, aRoutingData) );
+ }
+
+ case ComProtocol::PROTOCOL_RDV_KIND:
+ case ComProtocol::PROTOCOL_MULTIRDV_KIND:
+ {
+ return( popMessage_rdv(ENV, aRoutingRID, aRoutingData) );
+ }
+
+ case ComProtocol::PROTOCOL_UNDEFINED_KIND:
+ default:
+ {
+ AVM_OS_EXIT( FAILED )
+ << "popMessage :> Unknown Protocol for interaction << "
+ << aPort->strComPointNature() << ": "
+ << aPort->getFullyQualifiedNameID() << " >> & << machine: "
+ << aRoutingRID.getInstance()->getFullyQualifiedNameID()
+ << " >> in running context: << "
+ << ENV.mARG->outED->mRID.getInstance()->getFullyQualifiedNameID()
+ << " >> !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+ else
+ {
+ AVM_OS_EXIT( FAILED )
+ << "popMessage :> Unfound RoutingData for interaction << "
+ << aPort->strComPointNature() << ": "
+ << aPort->getFullyQualifiedNameID() << " >> & << machine: "
+ << aRoutingRID.getInstance()->getFullyQualifiedNameID()
+ << " >> in running context: << "
+ << ENV.mARG->outED->mRID.getInstance()->getFullyQualifiedNameID()
+ << " >> !!!"
+ << SEND_EXIT;
+ }
+
+ return( false );
+}
+
+
+bool AvmCommunicationFactory::popMessage_environment(ExecutionEnvironment & ENV,
+ const RuntimeID & aRoutingRID, const RoutingData & aRoutingData,
+ avm_size_t firstParameterOffset /*= 1*/)
+{
+ BFCode aTraceInput(OperatorManager::OPERATOR_INPUT_ENV, ENV.mARG->at(0));
+
+ bool allSuccess = true;
+
+ if( ENV.inCODE->populated() )
+ {
+ ENV.mARG->outED.makeModifiableParamTable();
+
+ InstanceOfPort * aPort = ENV.mARG->at(0).to_ptr< InstanceOfPort >();
+ avm_size_t offset = 0;
+
+ InstanceOfData * aVar = NULL;
+ BF aNewSymbolicConstant;
+ BFList paramList;
+
+ for( ENV.mARG->begin(firstParameterOffset) ; ENV.mARG->hasNext() ;
+ ENV.mARG->next() , ++offset )
+ {
+ paramList.clear();
+
+ aVar = ENV.mARG->current().to_ptr< InstanceOfData >();
+
+ aNewSymbolicConstant = ENV.createNewFreshParam(
+ ENV.mARG->outED->mRID,
+ aPort->getParameterType(offset),
+ aVar, paramList);
+
+ if( not ENV.setRvalue(ENV.mARG->outED, aVar, aNewSymbolicConstant) )
+ {
+ allSuccess = false;
+
+ break;
+ }
+
+ ENV.mARG->outED.appendParameters( paramList );
+
+ aTraceInput->append( aNewSymbolicConstant );
+ }
+ }
+
+ if( allSuccess )
+ {
+ ExecutionDataFactory::appendIOElementTrace(ENV.mARG->outED,
+ BF( new ExecutionConfiguration(
+ ENV.mARG->outED->mRID, aTraceInput) ) );
+
+ ENV.outEDS.append( ENV.mARG->outED );
+
+ return( true );
+ }
+ else
+ {
+ return( false );
+ }
+}
+
+
+bool AvmCommunicationFactory::popMessage_transfert(ExecutionEnvironment & ENV,
+ const RuntimeID & aRoutingRID, const RoutingData & aRoutingData)
+{
+ return( false );
+}
+
+
+bool AvmCommunicationFactory::popMessage_buffer(ExecutionEnvironment & ENV,
+ const RuntimeID & aRoutingRID, const RoutingData & aRoutingData)
+{
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << TAB << "begin "
+ "AvmCommunicationFactory::popMessage_buffer" << std::endl;
+
+ ENV.mARG->outED->getRuntime(aRoutingRID).toStreamData(
+ ENV.mARG->outED, AVM_OS_TRACE << INCR2_INDENT);
+ AVM_OS_TRACE << DECR2_INDENT;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ Message popMsg;
+
+ RuntimeID bufferDeclRID = aRoutingRID;
+
+ ListOfInstanceOfBuffer::const_iterator itBuffer =
+ aRoutingData.getBufferInstance().begin();
+ ListOfInstanceOfBuffer::const_iterator endBuffer =
+ aRoutingData.getBufferInstance().end();
+ for( ; itBuffer != endBuffer ; ++itBuffer )
+ {
+ bufferDeclRID = ENV.mARG->outED->getRuntimeContainerRID(
+ ENV.mARG->outED->mRID, (*itBuffer) );
+
+ if( bufferDeclRID.valid() )
+ {
+ if( ENV.mARG->outED->getRuntime(bufferDeclRID).
+ getBuffer( *itBuffer ).nonempty() )
+ {
+ BaseBufferForm & bbf = ENV.mARG->outED.getWritableRuntime(
+ bufferDeclRID ).getWritableBuffer( *itBuffer);
+
+ popMsg = bbf.pop(aRoutingData.getMID(), ENV.mARG->outED->mRID);
+
+ if( popMsg.valid() )
+ {
+ break;
+ }
+ }
+ }
+ }
+
+ if( popMsg.valid() )
+ {
+ BFCode aTraceInput(OperatorManager::OPERATOR_INPUT, ENV.mARG->at(0));
+
+ Message::const_iterator itVal = popMsg.getParameters().begin();
+ Message::const_iterator endVal = popMsg.getParameters().end();
+
+ // We have to ignore the << Port >> InstanceOfPort
+ for( ENV.mARG->begin(1) ; (itVal != endVal) && ENV.mARG->hasNext() ;
+ ENV.mARG->next() , ++itVal )
+ {
+ if( ENV.setRvalue(ENV.mARG->outED,
+ ENV.mARG->current().to_ptr< InstanceOfData >(), *itVal) )
+ {
+ aTraceInput->append( *itVal );
+
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ ExecutionDataFactory::appendIOElementTrace(ENV.mARG->outED,
+ BF( new ExecutionConfiguration(
+ ENV.mARG->outED->mRID, aTraceInput, popMsg) ) );
+
+ ENV.outEDS.append( ENV.mARG->outED );
+
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ ENV.mARG->outED->getRuntime(aRoutingRID).toStreamData(
+ ENV.mARG->outED, AVM_OS_TRACE << INCR2_INDENT);
+ AVM_OS_TRACE << DECR2_INDENT_TAB << "end "
+ "AvmCommunicationFactory::popMessage_buffer" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ return( true );
+ }
+ else
+ {
+ return( false );
+ }
+}
+
+
+bool AvmCommunicationFactory::popMessage_rdv(ExecutionEnvironment & ENV,
+ const RuntimeID & aRoutingRID, const RoutingData & aRoutingData)
+{
+ Message inMsg( RuntimeID::REF_NULL,
+ ENV.mARG->outED->mRID, aRoutingData.getPort() );
+ inMsg.setMID( aRoutingData.getMID() );
+
+ // We have to ignore the << Port >> InstanceOfPort
+ for( ENV.mARG->begin(1) ; ENV.mARG->hasNext() ; ENV.mARG->next() )
+ {
+ inMsg.appendParameter( ENV.mARG->current() );
+ }
+
+ ENV.mARG->outED.pushExecSyncPoint( new ExecutionSynchronizationPoint(
+ AWAITING_POINT_INPUT_NATURE, aRoutingRID, aRoutingData, inMsg) );
+
+ ENV.appendSync_mwsetAEES(ENV.mARG->outED, AEES_WAITING_INCOM_RDV);
+
+ return( true );
+}
+
+
+/*
+ * POP MESSAGE FROM
+ */
+
+bool AvmCommunicationFactory::popMessageFrom(ExecutionEnvironment & ENV)
+{
+ RuntimeID aRoutingRID = ENV.mARG->outED->mRID;
+ InstanceOfPort * aPort = ENV.mARG->at(0).to_ptr< InstanceOfPort >();
+
+ const RoutingData & aRoutingData =
+ searchInputRoutingData(ENV.mARG->outED, aPort, aRoutingRID);
+
+ RuntimeID aSenderRID = ENV.mARG->at(1).bfRID();
+
+ if( aRoutingData != NULL )
+ {
+ switch( aRoutingData.getProtocol() )
+ {
+ case ComProtocol::PROTOCOL_ENVIRONMENT_KIND:
+ {
+ if( ENV.mARG->outED->getRuntime(aRoutingRID).
+ isEnvironmentEnabledCommunication() )
+ {
+ return( popMessage_environment(ENV,
+ aRoutingRID, aRoutingData) );
+ }
+ return( false );
+ }
+
+ case ComProtocol::PROTOCOL_TRANSFERT_KIND: // inRD->hasAttach() )
+ {
+ return( popMessageFrom_transfert(ENV,
+ aSenderRID, aRoutingRID, aRoutingData) );
+ }
+
+ case ComProtocol::PROTOCOL_BUFFER_KIND:
+ case ComProtocol::PROTOCOL_BROADCAST_KIND:
+ case ComProtocol::PROTOCOL_MULTICAST_KIND:
+ case ComProtocol::PROTOCOL_UNICAST_KIND:
+ case ComProtocol::PROTOCOL_ANYCAST_KIND:
+ {
+ return( popMessageFrom_buffer(ENV,
+ aSenderRID, aRoutingRID, aRoutingData) );
+ }
+
+ case ComProtocol::PROTOCOL_RDV_KIND:
+ case ComProtocol::PROTOCOL_MULTIRDV_KIND:
+ {
+ return( popMessageFrom_rdv(ENV,
+ aSenderRID, aRoutingRID, aRoutingData) );
+ }
+ case ComProtocol::PROTOCOL_UNDEFINED_KIND:
+ default:
+ {
+ AVM_OS_EXIT( FAILED )
+ << "popMessageFrom :> Unknown Protocol for interaction << "
+ << aPort->strComPointNature() << ": "
+ << aPort->getFullyQualifiedNameID() << " >> & << machine: "
+ << aRoutingRID.getInstance()->getFullyQualifiedNameID()
+ << " >> in running context: << "
+ << ENV.mARG->outED->mRID.getInstance()->getFullyQualifiedNameID()
+ << " >> !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+ else
+ {
+ AVM_OS_EXIT( FAILED )
+ << "popMessageFrom :> Unfound RoutingData for interaction << "
+ << aPort->strComPointNature() << ": "
+ << aPort->getFullyQualifiedNameID() << " >> & << machine: "
+ << aRoutingRID.getInstance()->getFullyQualifiedNameID()
+ << " >> in running context: << "
+ << ENV.mARG->outED->mRID.getInstance()->getFullyQualifiedNameID()
+ << " >> !!!"
+ << SEND_EXIT;
+ }
+
+ return( false );
+
+}
+
+
+bool AvmCommunicationFactory::popMessageFrom_transfert(
+ ExecutionEnvironment & ENV, const RuntimeID & aSenderRID,
+ const RuntimeID & aRoutingRID, const RoutingData & aRoutingData)
+{
+ return( false );
+}
+
+
+bool AvmCommunicationFactory::popMessageFrom_buffer(
+ ExecutionEnvironment & ENV, const RuntimeID & aSenderRID,
+ const RuntimeID & aRoutingRID, const RoutingData & aRoutingData)
+{
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << TAB << "begin "
+ "AvmCommunicationFactory::popMessageFrom_buffer" << std::endl;
+
+ ENV.mARG->outED->getRuntime(aRoutingRID).toStreamData(
+ ENV.mARG->outED, AVM_OS_TRACE << INCR2_INDENT);
+ AVM_OS_TRACE << DECR2_INDENT;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ Message popMsg;
+
+ RuntimeID bufferDeclRID = aRoutingRID;
+
+ ListOfInstanceOfBuffer::const_iterator itBuffer =
+ aRoutingData.getBufferInstance().begin();
+ ListOfInstanceOfBuffer::const_iterator endBuffer =
+ aRoutingData.getBufferInstance().end();
+ for( ; itBuffer != endBuffer ; ++itBuffer )
+ {
+ bufferDeclRID = ENV.mARG->outED->getRuntimeContainerRID(
+ ENV.mARG->outED->mRID, (*itBuffer));
+
+ if( bufferDeclRID.valid() )
+ {
+ BaseBufferForm & bbf = ENV.mARG->outED.getWritableRuntime(
+ bufferDeclRID ).getWritableBuffer( *itBuffer );
+
+ popMsg = bbf.top();
+ if( popMsg.valid() && popMsg.isSender(aSenderRID) )
+ {
+ popMsg = bbf.pop(aRoutingData.getMID(), ENV.mARG->outED->mRID);
+ }
+
+ if( popMsg.valid() )
+ {
+ break;
+ }
+ }
+ }
+
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ ENV.mARG->outED->getRuntime(aRoutingRID).toStreamData(
+ ENV.mARG->outED, AVM_OS_TRACE << INCR2_INDENT);
+ AVM_OS_TRACE << DECR2_INDENT_TAB << "end "
+ "AvmCommunicationFactory::popMessageFrom_buffer" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ if( popMsg.valid() )
+ {
+ BFCode aTraceInput(OperatorManager::OPERATOR_INPUT, ENV.mARG->at(0));
+
+ Message::const_iterator itVal = popMsg.beginParameters();
+ Message::const_iterator endVal = popMsg.endParameters();
+
+ // We have to ignore the << Port >> InstanceOfPort and the << Sender >>
+ for( ENV.mARG->begin(2) ; (itVal != endVal) && ENV.mARG->hasNext() ;
+ ENV.mARG->next() , ++itVal )
+ {
+ if( ENV.setRvalue(ENV.mARG->outED,
+ ENV.mARG->current().to_ptr< InstanceOfData >(), *itVal) )
+ {
+ aTraceInput->append( *itVal );
+
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ ExecutionDataFactory::appendIOElementTrace(ENV.mARG->outED,
+ BF( new ExecutionConfiguration(
+ ENV.mARG->outED->mRID, aTraceInput, popMsg) ) );
+
+ ENV.outEDS.append( ENV.mARG->outED );
+
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ ENV.mARG->outED->getRuntime(aRoutingRID).toStreamData(
+ ENV.mARG->outED, AVM_OS_TRACE << INCR2_INDENT);
+ AVM_OS_TRACE << DECR2_INDENT_TAB << "end "
+ "AvmCommunicationFactory::popMessageFrom_buffer"
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ return( true );
+ }
+ else
+ {
+ return( false );
+ }
+}
+
+
+bool AvmCommunicationFactory::popMessageFrom_rdv(
+ ExecutionEnvironment & ENV, const RuntimeID & aSenderRID,
+ const RuntimeID & aRoutingRID, const RoutingData & aRoutingData)
+{
+ Message inMsg( aSenderRID, ENV.mARG->outED->mRID, aRoutingData.getPort() );
+ inMsg.setMID( aRoutingData.getMID() );
+
+ // We have to ignore the << Port >> InstanceOfPort and the << Sender >>
+ for( ENV.mARG->begin(2) ; ENV.mARG->hasNext() ; ENV.mARG->next() )
+ {
+ inMsg.appendParameter( ENV.mARG->current() );
+ }
+
+ ENV.mARG->outED.pushExecSyncPoint( new ExecutionSynchronizationPoint(
+ AWAITING_POINT_INPUT_NATURE, aRoutingRID, aRoutingData, inMsg) );
+
+ ENV.appendSync_mwsetAEES(ENV.mARG->outED, AEES_WAITING_INCOM_RDV);
+
+ return( true );
+}
+
+
+/*
+ * PUSH MESSAGE
+ */
+bool AvmCommunicationFactory::pushMessage(ExecutionEnvironment & ENV,
+ const Message & anOutputMsg, RuntimeID aRoutingRID)
+{
+ InstanceOfPort * aPort = anOutputMsg.getPort();
+
+ const RoutingData & aRoutingData =
+ searchOutputRoutingData(ENV.mARG->outED, aPort, aRoutingRID);
+
+ if( aRoutingData != NULL )
+ {
+ anOutputMsg.setMID( aRoutingData.getMID() );
+
+ switch( aRoutingData.getProtocol() )
+ {
+ case ComProtocol::PROTOCOL_ENVIRONMENT_KIND:
+ {
+ return( pushMessage_environment(ENV,
+ aRoutingRID, aRoutingData, anOutputMsg) );
+ }
+
+ case ComProtocol::PROTOCOL_TRANSFERT_KIND: // aRoutingData.hasAttach()
+ {
+ return( pushMessage_transfert(ENV,
+ aRoutingRID, aRoutingData, anOutputMsg) );
+ }
+
+ case ComProtocol::PROTOCOL_BUFFER_KIND:
+ {
+ return( pushMessage_buffer(ENV,
+ aRoutingRID, aRoutingData, anOutputMsg) );
+ }
+
+ case ComProtocol::PROTOCOL_RDV_KIND:
+ case ComProtocol::PROTOCOL_MULTIRDV_KIND:
+ {
+ return( pushMessage_rdv(ENV,
+ aRoutingRID, aRoutingData, anOutputMsg) );
+ }
+
+ case ComProtocol::PROTOCOL_BROADCAST_KIND:
+ {
+ return( pushMessage_broadcast(ENV,
+ aRoutingRID, aRoutingData, anOutputMsg) );
+ }
+
+ case ComProtocol::PROTOCOL_MULTICAST_KIND:
+ {
+ return( pushMessage_multicast(ENV,
+ aRoutingRID, aRoutingData, anOutputMsg) );
+ }
+ case ComProtocol::PROTOCOL_UNICAST_KIND:
+ {
+ return( pushMessage_unicast(ENV,
+ aRoutingRID, aRoutingData, anOutputMsg) );
+ }
+
+ case ComProtocol::PROTOCOL_ANYCAST_KIND:
+ {
+ return( pushMessage_anycast(ENV,
+ aRoutingRID, aRoutingData, anOutputMsg) );
+ }
+
+ case ComProtocol::PROTOCOL_UNDEFINED_KIND:
+ default:
+ {
+// return( pushMessage_environment(anED, ENV.mARG->outED->mRID,
+// aRoutingRF, aRoutingData, anOutputMsg, listOfOutputED) );
+ return( false );
+ }
+ }
+ }
+ else
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Push message error : Unfound RoutingData for interaction << "
+ << aPort->strComPointNature() << ": "
+ << aRoutingRID.getInstance()->getFullyQualifiedNameID()
+ << " >> in running context: << "
+ << aPort->getFullyQualifiedNameID() << " >> & << machine: "
+ << ENV.mARG->outED->mRID.getInstance()->getFullyQualifiedNameID()
+ << " >> !!!"
+ << SEND_EXIT;
+ }
+
+ return( false );
+}
+
+
+bool AvmCommunicationFactory::pushMessage_environment(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg)
+{
+ BFCode aTraceOutput(OperatorManager::OPERATOR_OUTPUT_ENV,
+ anOutputMsg.bfPort());
+
+ aTraceOutput->append( anOutputMsg.getParameters() );
+
+ ExecutionDataFactory::appendIOElementTrace(ENV.mARG->outED,
+ BF( new ExecutionConfiguration(
+ ENV.mARG->outED->mRID, aTraceOutput, anOutputMsg) ) );
+
+ ENV.outEDS.append( ENV.mARG->outED );
+
+ return( true );
+}
+
+
+bool AvmCommunicationFactory::pushMessage_transfert(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg)
+{
+ return( true );
+}
+
+bool AvmCommunicationFactory::pushMessage_buffer(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg)
+{
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << TAB << "begin "
+ "AvmCommunicationFactory::pushMessage_buffer" << std::endl;
+
+ ENV.mARG->outED->getRuntime(aRoutingRID).toStream(
+ AVM_OS_TRACE << INCR2_INDENT );
+ AVM_OS_TRACE << DECR2_INDENT;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+
+ bool oneSuccess = false;
+
+ RuntimeID bufferDeclRID = aRoutingRID;
+
+ ListOfInstanceOfBuffer::const_iterator itBuffer =
+ aRoutingData.getBufferInstance().begin();
+ ListOfInstanceOfBuffer::const_iterator endBuffer =
+ aRoutingData.getBufferInstance().end();
+ for( ; itBuffer != endBuffer ; ++itBuffer )
+ {
+ bufferDeclRID = ENV.mARG->outED->getRuntimeContainerRID(
+ aRoutingRID, (*itBuffer));
+
+ if( bufferDeclRID.valid() )
+ {
+ APExecutionData outED = ENV.mARG->outED;
+
+ BaseBufferForm & bbf = outED.getWritableRuntime(
+ bufferDeclRID ).getWritableBuffer( *itBuffer );
+
+ if( bbf.push( anOutputMsg ) )
+ {
+ oneSuccess = true;
+
+ BFCode aTraceOutput(OperatorManager::OPERATOR_OUTPUT,
+ anOutputMsg.bfPort());
+
+ aTraceOutput->append( anOutputMsg.getParameters() );
+
+ ExecutionDataFactory::appendIOElementTrace(outED,
+ BF( new ExecutionConfiguration(
+ outED->mRID, aTraceOutput, anOutputMsg) ) );
+
+ ENV.outEDS.append( outED );
+
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+ outED->getRuntime(aRoutingRID).toStream( AVM_OS_TRACE << INCR2_INDENT );
+ AVM_OS_TRACE << DECR2_INDENT_TAB
+ << "end AvmCommunicationFactory::pushMessage_buffer" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+ }
+ }
+ }
+
+ return( oneSuccess );
+}
+
+
+bool AvmCommunicationFactory::pushMessage_rdv(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg)
+{
+ ENV.mARG->outED.pushExecSyncPoint(new ExecutionSynchronizationPoint(
+ AWAITING_POINT_OUTPUT_NATURE, aRoutingRID, aRoutingData, anOutputMsg) );
+
+ ENV.appendSync_mwsetAEES(ENV.mARG->outED, AEES_WAITING_OUTCOM_RDV);
+
+ return( true );
+}
+
+
+bool AvmCommunicationFactory::pushMessage_broadcast(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg)
+{
+ return( true );
+}
+
+
+bool AvmCommunicationFactory::pushMessage_multicast(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg)
+{
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << TAB << "begin "
+ "AvmCommunicationFactory::pushMessage_multicast" << std::endl;
+
+ ENV.mARG->outED->getRuntime(aRoutingRID).toStream(
+ AVM_OS_TRACE << INCR2_INDENT );
+ AVM_OS_TRACE << DECR2_INDENT;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+
+ bool oneSuccess = false;
+
+ RuntimeID bufferDeclRID = aRoutingRID;
+
+ ListOfInstanceOfBuffer::const_iterator itBuffer =
+ aRoutingData.getBufferInstance().begin();
+ ListOfInstanceOfBuffer::const_iterator endBuffer =
+ aRoutingData.getBufferInstance().end();
+ for( ; itBuffer != endBuffer ; ++itBuffer )
+ {
+ bufferDeclRID = ENV.mARG->outED->getRuntimeContainerRID(
+ aRoutingRID, (*itBuffer));
+
+ if( bufferDeclRID.valid() )
+ {
+ BaseBufferForm & bbf = ENV.mARG->outED.getWritableRuntime(
+ bufferDeclRID ).getWritableBuffer( *itBuffer );
+
+ if( bbf.push( anOutputMsg ) )
+ {
+ oneSuccess = true;
+ }
+ }
+ }
+
+ if( oneSuccess )
+ {
+ BFCode aTraceOutput(OperatorManager::OPERATOR_OUTPUT,
+ anOutputMsg.bfPort());
+
+ aTraceOutput->append( anOutputMsg.getParameters() );
+
+ ExecutionDataFactory::appendIOElementTrace(ENV.mARG->outED,
+ BF( new ExecutionConfiguration(
+ ENV.mARG->outED->mRID, aTraceOutput, anOutputMsg) ) );
+
+ ENV.outEDS.append( ENV.mARG->outED );
+
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+ ENV.mARG->outED->getRuntime(aRoutingRID).toStream(
+ AVM_OS_TRACE << INCR2_INDENT );
+ AVM_OS_TRACE << DECR2_INDENT_TAB
+ << "end AvmCommunicationFactory::pushMessage_buffer"
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+
+ return( true );
+ }
+ else
+ {
+ return( false );
+ }
+}
+
+
+bool AvmCommunicationFactory::pushMessage_unicast(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg)
+{
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << TAB << "begin "
+ "AvmCommunicationFactory::pushMessage_multicast" << std::endl;
+
+ ENV.mARG->outED->getRuntime(aRoutingRID).toStream(
+ AVM_OS_TRACE << INCR2_INDENT );
+ AVM_OS_TRACE << DECR2_INDENT;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+
+ bool oneSuccess = false;
+
+ RuntimeID bufferDeclRID = aRoutingRID;
+
+ ListOfInstanceOfBuffer::const_iterator itBuffer =
+ aRoutingData.getBufferInstance().begin();
+ ListOfInstanceOfBuffer::const_iterator endBuffer =
+ aRoutingData.getBufferInstance().end();
+ for( ; itBuffer != endBuffer ; ++itBuffer )
+ {
+ bufferDeclRID = ENV.mARG->outED->getRuntimeContainerRID(
+ aRoutingRID, (*itBuffer));
+
+ if( bufferDeclRID.valid() )
+ {
+ BaseBufferForm & bbf = ENV.mARG->outED.getWritableRuntime(
+ bufferDeclRID ).getWritableBuffer( *itBuffer );
+
+ if( bbf.push( anOutputMsg ) )
+ {
+ oneSuccess = true;
+
+ BFCode aTraceOutput(OperatorManager::OPERATOR_OUTPUT,
+ anOutputMsg.bfPort());
+
+ aTraceOutput->append( anOutputMsg.getParameters() );
+
+ ExecutionDataFactory::appendIOElementTrace(ENV.mARG->outED,
+ BF( new ExecutionConfiguration(
+ ENV.mARG->outED->mRID, aTraceOutput, anOutputMsg) ) );
+
+ ENV.outEDS.append( ENV.mARG->outED );
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+ ENV.mARG->outED->getRuntime(aRoutingRID).toStream(
+ AVM_OS_TRACE << INCR2_INDENT );
+ AVM_OS_TRACE << DECR2_INDENT_TAB
+ << "end AvmCommunicationFactory::pushMessage_buffer"
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+ }
+ }
+ }
+
+ return( oneSuccess );
+}
+
+
+bool AvmCommunicationFactory::pushMessage_anycast(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg)
+{
+ return( pushMessage_buffer(ENV, aRoutingRID, aRoutingData, anOutputMsg) );
+// return( true );
+}
+
+
+
+/*
+ * PUSH MESSAGE TO
+ */
+
+bool AvmCommunicationFactory::pushMessageTo(
+ ExecutionEnvironment & ENV, const Message & anOutputMsg)
+{
+ RuntimeID aRoutingRID = ENV.mARG->outED->mRID;
+ InstanceOfPort * aPort = anOutputMsg.getPort();
+
+ const RoutingData & aRoutingData =
+ searchOutputRoutingData(ENV.mARG->outED, aPort, aRoutingRID);
+
+ if( aRoutingData != NULL )
+ {
+ anOutputMsg.setMID( aRoutingData.getMID() );
+
+ if( (anOutputMsg.getReceiverRID() == RuntimeLib::RID_ENVIRONMENT) ||
+ (anOutputMsg.getReceiverRID() == RuntimeLib::RID_NIL) )
+ {
+ return( pushMessage_environment(ENV,
+ aRoutingRID, aRoutingData, anOutputMsg) );
+ }
+
+ switch( aRoutingData.getProtocol() )
+ {
+ case ComProtocol::PROTOCOL_ENVIRONMENT_KIND:
+ {
+ return( pushMessage_environment(ENV,
+ aRoutingRID, aRoutingData, anOutputMsg) );
+ }
+
+ case ComProtocol::PROTOCOL_TRANSFERT_KIND:
+ {// aRoutingData.hasAttach() )
+ return( pushMessageTo_transfert(ENV,
+ aRoutingRID, aRoutingData, anOutputMsg) );
+ }
+
+ case ComProtocol::PROTOCOL_BUFFER_KIND:
+ {
+ return( pushMessageTo_buffer(ENV,
+ aRoutingRID, aRoutingData, anOutputMsg) );
+ }
+
+ case ComProtocol::PROTOCOL_RDV_KIND:
+ case ComProtocol::PROTOCOL_MULTIRDV_KIND:
+ {
+ return( pushMessageTo_rdv(ENV,
+ aRoutingRID, aRoutingData, anOutputMsg) );
+ }
+
+ case ComProtocol::PROTOCOL_BROADCAST_KIND:
+ {
+ return( pushMessageTo_broadcast(ENV,
+ aRoutingRID, aRoutingData, anOutputMsg) );
+ }
+
+ case ComProtocol::PROTOCOL_MULTICAST_KIND:
+ {
+ return( pushMessageTo_multicast(ENV,
+ aRoutingRID, aRoutingData, anOutputMsg) );
+ }
+ case ComProtocol::PROTOCOL_UNICAST_KIND:
+ {
+ return( pushMessageTo_unicast(ENV,
+ aRoutingRID, aRoutingData, anOutputMsg) );
+ }
+
+ case ComProtocol::PROTOCOL_ANYCAST_KIND:
+ {
+ return( pushMessageTo_anycast(ENV,
+ aRoutingRID, aRoutingData, anOutputMsg) );
+ }
+
+ case ComProtocol::PROTOCOL_UNDEFINED_KIND:
+ default:
+ {
+ AVM_OS_EXIT( FAILED )
+ << "pushMessageTo :> Unknown Protocol for interaction << "
+ << aPort->strComPointNature() << ": "
+ << aPort->getFullyQualifiedNameID() << " >> & << machine: "
+ << ENV.mARG->outED->mRID.getInstance()->getFullyQualifiedNameID()
+ << " >> !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+ else
+ {
+ AVM_OS_EXIT( FAILED )
+ << "pushMessageTo :> Unfound RoutingData for interaction << "
+ << aPort->strComPointNature() << ": "
+ << aPort->getFullyQualifiedNameID() << " >> & << machine: "
+ << aRoutingRID.getInstance()->getFullyQualifiedNameID()
+ << " >> in running context: << "
+ << ENV.mARG->outED->mRID.getInstance()->getFullyQualifiedNameID()
+ << " >> !!!"
+ << SEND_EXIT;
+ }
+
+ return( false );
+}
+
+
+bool AvmCommunicationFactory::pushMessageTo_transfert(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg)
+{
+ return( true );
+}
+
+
+bool AvmCommunicationFactory::pushMessageTo_buffer(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg)
+{
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << TAB << "begin "
+ "AvmCommunicationFactory::pushMessageTo_buffer" << std::endl;
+
+ ENV.mARG->outED->getRuntime(aRoutingRID).toStream(
+ AVM_OS_TRACE << INCR2_INDENT );
+ AVM_OS_TRACE << DECR2_INDENT;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+
+ // Search receiver machine in the INPUT MACHINE-PORT connected list
+ bool oneSuccess = false;
+
+ ListOfInstanceOfBuffer::const_iterator itbIn;
+ ListOfInstanceOfBuffer::const_iterator itbInEnd;
+
+ ListOfInstanceOfBuffer::const_iterator itbOut;
+ ListOfInstanceOfBuffer::const_iterator itbOutEnd;
+
+ const VectorOfPairMachinePort & theConnectedPort =
+ aRoutingRID.getExecutable()->getConnect().at(
+ aRoutingData.getConnect()->getOffset() ).
+ getInputComRouteData().getMachinePorts();
+
+ RuntimeID bufferDeclRID = aRoutingRID;
+
+ VectorOfPairMachinePort::const_iterator itMP = theConnectedPort.begin();
+ VectorOfPairMachinePort::const_iterator endMP = theConnectedPort.end();
+ for( ; itMP != endMP ; ++itMP )
+ {
+ if( anOutputMsg.isReceiverMachine( (*itMP)->first() ) )
+ {
+ // get Routing Data of the connector input receiver candidate
+ const RoutingData & connectInputRD =
+ ENV.mARG->outED->getRuntime(
+ anOutputMsg.getReceiverRID() ).getRouter().
+ getInputRouting( (*itMP)->second()->getRouteOffset() );
+
+ // Push the message in all COMMON buffer with the OUTPUT PORT!
+ itbIn = connectInputRD.getBufferInstance().begin();
+ itbInEnd = connectInputRD.getBufferInstance().end();
+ for( ; itbIn != itbInEnd ; ++itbIn )
+ {
+ itbOut = aRoutingData.getBufferInstance().begin();
+ itbOutEnd = aRoutingData.getBufferInstance().end();
+ for( ; itbOut != itbOutEnd ; ++itbOut )
+ {
+ if( (*itbIn) == (*itbOut) ) // COMMON BUFFER found
+ {
+ bufferDeclRID = ENV.mARG->outED->getRuntimeContainerRID(
+ anOutputMsg.getReceiverRID(), (*itbOut) );
+
+ BaseBufferForm & bbf =
+ ENV.mARG->outED.getWritableRuntime(
+ bufferDeclRID ).getWritableBuffer( *itbOut );
+
+ if( bbf.push( anOutputMsg ) )
+ {
+ oneSuccess = true;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if( oneSuccess )
+ {
+ BFCode aTraceOutput(OperatorManager::OPERATOR_OUTPUT,
+ anOutputMsg.bfPort());
+
+ aTraceOutput->append( anOutputMsg.getParameters() );
+
+ ExecutionDataFactory::appendIOElementTrace(ENV.mARG->outED,
+ BF( new ExecutionConfiguration(
+ ENV.mARG->outED->mRID, aTraceOutput, anOutputMsg) ) );
+
+ ENV.outEDS.append( ENV.mARG->outED );
+
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+ ENV.mARG->outED->getRuntime(aRoutingRID).toStream(
+ AVM_OS_TRACE << INCR2_INDENT );
+ AVM_OS_TRACE << DECR2_INDENT_TAB
+ << "end AvmCommunicationFactory::pushMessageTo_buffer"
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+
+ return( true );
+ }
+ else
+ {
+ return( false );
+ }
+}
+
+
+bool AvmCommunicationFactory::pushMessageTo_rdv(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg)
+{
+ ENV.mARG->outED.pushExecSyncPoint( new ExecutionSynchronizationPoint(
+ AWAITING_POINT_OUTPUT_NATURE,
+ aRoutingRID, aRoutingData, anOutputMsg) );
+
+ ENV.appendSync_mwsetAEES(ENV.mARG->outED, AEES_WAITING_OUTCOM_RDV);
+
+ return( true );
+}
+
+
+bool AvmCommunicationFactory::pushMessageTo_broadcast(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg)
+{
+ return( true );
+}
+
+
+bool AvmCommunicationFactory::pushMessageTo_multicast(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg)
+{
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << TAB << "begin "
+ "AvmCommunicationFactory::pushMessageTo_buffer" << std::endl;
+
+ ENV.mARG->outED->getRuntime(aRoutingRID).toStream(
+ AVM_OS_TRACE << INCR2_INDENT );
+ AVM_OS_TRACE << DECR2_INDENT;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+
+ // Search receiver machine in the INPUT MACHINE-PORT connected list
+ bool oneSuccess = false;
+
+ ListOfInstanceOfBuffer::const_iterator itbIn;
+ ListOfInstanceOfBuffer::const_iterator itbInEnd;
+
+ ListOfInstanceOfBuffer::const_iterator itbOut;
+ ListOfInstanceOfBuffer::const_iterator itbOutEnd;
+
+ const VectorOfPairMachinePort & theConnectedPort =
+ aRoutingRID.getExecutable()->getConnect().at(
+ aRoutingData.getConnect()->getOffset() ).
+ getInputComRouteData().getMachinePorts();
+
+ RuntimeID bufferDeclRID = aRoutingRID;
+
+ VectorOfPairMachinePort::const_iterator itMP = theConnectedPort.begin();
+ VectorOfPairMachinePort::const_iterator endMP = theConnectedPort.end();
+ for( ; itMP != endMP ; ++itMP )
+ {
+ if( anOutputMsg.isReceiverMachine( (*itMP)->first() ) )
+ {
+ // get Routing Data of the connector input receiver candidate
+ const RoutingData & connectInputRD =
+ ENV.mARG->outED->getRuntime(
+ anOutputMsg.getReceiverRID() ).getRouter().
+ getInputRouting( (*itMP)->second()->getRouteOffset() );
+
+ // Push the message in all COMMON buffer with the OUTPUT PORT!
+ itbIn = connectInputRD.getBufferInstance().begin();
+ itbInEnd = connectInputRD.getBufferInstance().end();
+ for( ; itbIn != itbInEnd ; ++itbIn )
+ {
+ itbOut = aRoutingData.getBufferInstance().begin();
+ itbOutEnd = aRoutingData.getBufferInstance().end();
+ for( ; itbOut != itbOutEnd ; ++itbOut )
+ {
+ if( (*itbIn) == (*itbOut) ) // COMMON BUFFER found
+ {
+ bufferDeclRID = ENV.mARG->outED->getRuntimeContainerRID(
+ anOutputMsg.getReceiverRID(), (*itbOut) );
+
+ BaseBufferForm & bbf =
+ ENV.mARG->outED.getWritableRuntime(
+ bufferDeclRID ).getWritableBuffer( *itbOut );
+
+ if( bbf.push( anOutputMsg ) )
+ {
+ oneSuccess = true;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if( oneSuccess )
+ {
+ BFCode aTraceOutput(OperatorManager::OPERATOR_OUTPUT,
+ anOutputMsg.bfPort());
+
+ aTraceOutput->append( anOutputMsg.getParameters() );
+
+ ExecutionDataFactory::appendIOElementTrace(ENV.mARG->outED,
+ BF(new ExecutionConfiguration(
+ ENV.mARG->outED->mRID, aTraceOutput, anOutputMsg) ) );
+
+ ENV.outEDS.append( ENV.mARG->outED );
+
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+ ENV.mARG->outED->getRuntime(aRoutingRID).toStream(
+ AVM_OS_TRACE << INCR2_INDENT );
+ AVM_OS_TRACE << DECR2_INDENT_TAB
+ << "end AvmCommunicationFactory::pushMessageTo_buffer"
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+
+ return( true );
+ }
+ else
+ {
+ return( false );
+ }
+}
+
+
+bool AvmCommunicationFactory::pushMessageTo_unicast(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg)
+{
+ return( true );
+}
+
+
+bool AvmCommunicationFactory::pushMessageTo_anycast(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg)
+{
+ return( pushMessageTo_buffer(ENV, aRoutingRID, aRoutingData, anOutputMsg) );
+// return( true );
+}
+
+
+/*
+ * UPDATE BUFFER
+ */
+bool AvmCommunicationFactory::updateBuffer(APExecutionData & anED)
+{
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+ anED->getRuntime(1).toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+
+ TableOfBufferT & wrBufferTable = anED.getWritableRuntime(
+ anED->mRID ).getWritableBufferTable();
+
+ TableOfBufferT::const_iterator it = wrBufferTable.begin();
+ TableOfBufferT::const_iterator itEnd = wrBufferTable.end();
+ for( ; it != itEnd ; ++it )
+ {
+ switch( (*it)->classKind() )
+ {
+ case FORM_BUFFER_BROADCAST_KIND:
+ {
+ BroadcastBuffer * theBuffer = (*it)->to< BroadcastBuffer >();
+ theBuffer->push( Message::_NULL_ );
+ theBuffer->update();
+
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+ anED->getRuntime(1).toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+
+ return( true );
+}
+
+
+/*
+ * PRESENCE / ABSENCE status
+ */
+bool AvmCommunicationFactory::computePresence(const ExecutionData & anED,
+ const RuntimeID & aReceiverRID, InstanceOfPort * aPort)
+{
+ RuntimeID aRoutingRID = aReceiverRID;
+
+ const RoutingData & aRoutingData =
+ searchInputRoutingData(anED, aPort, aRoutingRID);
+
+ if( aRoutingData != NULL )
+ {
+ switch( aRoutingData.getProtocol() )
+ {
+ case ComProtocol::PROTOCOL_ENVIRONMENT_KIND:
+ {
+ return( true );
+ }
+
+ case ComProtocol::PROTOCOL_TRANSFERT_KIND: // inRD->hasAttach() )
+ {
+ return( false );
+ }
+
+ case ComProtocol::PROTOCOL_BUFFER_KIND:
+ case ComProtocol::PROTOCOL_BROADCAST_KIND:
+ case ComProtocol::PROTOCOL_MULTICAST_KIND:
+ case ComProtocol::PROTOCOL_UNICAST_KIND:
+ case ComProtocol::PROTOCOL_ANYCAST_KIND:
+ {
+ RuntimeID bufferDeclRID = aRoutingRID;
+
+ ListOfInstanceOfBuffer::const_iterator itBuffer =
+ aRoutingData.getBufferInstance().begin();
+ ListOfInstanceOfBuffer::const_iterator endBuffer =
+ aRoutingData.getBufferInstance().end();
+ for( ; itBuffer != endBuffer ; ++itBuffer )
+ {
+ bufferDeclRID = anED.getRuntimeContainerRID(
+ aReceiverRID, (*itBuffer) );
+
+ if( bufferDeclRID.valid() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << "computePresence :> "
+ << str_header( aPort ) << std::endl
+ << "RoutingRID : " << aRoutingRID.getFullyQualifiedNameID()
+ << std::endl
+ << "BufferRID : " << bufferDeclRID.getFullyQualifiedNameID()
+ << std::endl
+ << "ReceiverRID : " << aReceiverRID.getFullyQualifiedNameID()
+ << std::endl;
+ aRoutingData.toStream(AVM_OS_TRACE);
+ anED.getRuntime(bufferDeclRID).toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , STATEMENT_COMMUNICATION )
+
+ const BaseBufferForm & bbf = anED.getRuntime(
+ bufferDeclRID ).getBuffer(*itBuffer);
+
+ if( bbf.nonempty() )
+ {
+ if( aRoutingRID.getExecutable()->
+ getSpecifier().hasFeatureInputEnabled() )
+ {
+ if( bbf.contains(
+ aRoutingData.getMID(), aReceiverRID) )
+ {
+ return( true );
+ }
+ }
+ else if( bbf.isTop(aRoutingData.getMID(),
+ aReceiverRID) )
+ {
+ return( true );
+ }
+ }
+ }
+ }
+
+ return( false );
+ }
+
+ case ComProtocol::PROTOCOL_RDV_KIND:
+ case ComProtocol::PROTOCOL_MULTIRDV_KIND:
+
+ case ComProtocol::PROTOCOL_UNDEFINED_KIND:
+ default:
+ {
+ return( false );
+ }
+ }
+ }
+
+ return( false );
+}
+
+
+/*
+ * Collect buffer message
+ */
+void AvmCommunicationFactory::collectBufferMessage(
+ const ExecutionData & anED, BaseBufferForm & aBuffer)
+{
+ TableOfBufferT::const_iterator itBuffer;
+ TableOfBufferT::const_iterator endBuffer;
+
+ TableOfRuntimeT::const_iterator itRF = anED.getTableOfRuntime().begin();
+ TableOfRuntimeT::const_iterator endRF = anED.getTableOfRuntime().end();
+ for( ; itRF != endRF ; ++itRF )
+ {
+ if( (*itRF)->hasBufferTable() )
+ {
+ itBuffer = (*itRF)->getBufferTable().begin();
+ endBuffer = (*itRF)->getBufferTable().end();
+ for( ; itBuffer != endBuffer ; ++itBuffer )
+ {
+ (*itBuffer)->copyTo( aBuffer );
+ }
+ }
+ }
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmCommunicationFactory.h b/org.eclipse.efm.symbex/src/computer/primitive/AvmCommunicationFactory.h
new file mode 100644
index 0000000..e0abf75
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmCommunicationFactory.h
@@ -0,0 +1,271 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 27 oct. 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCOMMUNICATIONFACTORY_H_
+#define AVMCOMMUNICATIONFACTORY_H_
+
+
+#include <collection/Typedef.h>
+
+#include <fml/executable/InstanceOfPort.h>
+
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+class COMPILE_CONTEXT;
+
+class AvmCode;
+
+class EvaluationEnvironment;
+class ExecutionEnvironment;
+
+class InstanceOfBuffer;
+
+class Message;
+
+class RoutingData;
+class RuntimeID;
+
+
+class AvmCommunicationFactory
+{
+
+private:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmCommunicationFactory()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AvmCommunicationFactory()
+ {
+ //!! NOTHING
+ }
+
+
+public:
+
+ /**
+ * SEARCH ROUTING DATA
+ */
+ static const RoutingData & searchInputRoutingData(
+ const ExecutionData & anED, InstanceOfPort * aPort,
+ RuntimeID & aRoutingRID );
+
+ inline static const RoutingData & searchInputRoutingData(
+ const APExecutionData & anED, InstanceOfPort * aPort,
+ RuntimeID & aRoutingRID )
+ {
+ return( searchInputRoutingData( (* anED) , aPort , aRoutingRID ) );
+ }
+
+
+ static const RoutingData & searchOutputRoutingData(
+ const ExecutionData & anED, InstanceOfPort * aPort,
+ RuntimeID & aRoutingRID );
+
+ inline static const RoutingData & searchOutputRoutingData(
+ const APExecutionData & anED, InstanceOfPort * aPort,
+ RuntimeID & aRoutingRID )
+ {
+ return( searchOutputRoutingData( (* anED) , aPort , aRoutingRID ) );
+ }
+
+
+ /*
+ * CHECK ROUTING INFORMATION
+ */
+ static bool isRoutingProtocolEnv(COMPILE_CONTEXT * aCTX,
+ InstanceOfPort * aPort);
+
+ static bool isRoutingProtocolRdv(COMPILE_CONTEXT * aCTX,
+ InstanceOfPort * aPort);
+
+
+ /*
+ * POP MESSAGE
+ */
+ static bool popMessage(ExecutionEnvironment & ENV,
+ InstanceOfPort * aPort);
+
+ static bool popMessage_environment(ExecutionEnvironment & ENV,
+ const RuntimeID & aRoutingRID, const RoutingData & aRoutingData,
+ avm_size_t firstParameterOffset = 1);
+
+ static bool popMessage_transfert(ExecutionEnvironment & ENV,
+ const RuntimeID & aRoutingRID, const RoutingData & aRoutingData);
+
+ static bool popMessage_buffer(ExecutionEnvironment & ENV,
+ const RuntimeID & aRoutingRID, const RoutingData & aRoutingData);
+
+ static bool popMessage_rdv(ExecutionEnvironment & ENV,
+ const RuntimeID & aRoutingRID, const RoutingData & aRoutingData);
+
+
+ /*
+ * POP MESSAGE FROM
+ */
+ static bool popMessageFrom(ExecutionEnvironment & ENV);
+
+ static bool popMessageFrom_transfert(
+ ExecutionEnvironment & ENV, const RuntimeID & aSenderRID,
+ const RuntimeID & aRoutingRID, const RoutingData & aRoutingData);
+
+ static bool popMessageFrom_buffer(
+ ExecutionEnvironment & ENV, const RuntimeID & aSenderRID,
+ const RuntimeID & aRoutingRID, const RoutingData & aRoutingData);
+
+ static bool popMessageFrom_rdv(
+ ExecutionEnvironment & ENV, const RuntimeID & aSenderRID,
+ const RuntimeID & aRoutingRID, const RoutingData & aRoutingData);
+
+
+ /*
+ * PUSH MESSAGE
+ */
+ static bool pushMessage(ExecutionEnvironment & ENV,
+ const Message & anOutputMsg, RuntimeID aRoutingRID);
+
+ static bool pushMessage_environment(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg);
+
+ static bool pushMessage_transfert(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg);
+
+ static bool pushMessage_buffer(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg);
+
+ static bool pushMessage_rdv(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg);
+
+ static bool pushMessage_broadcast(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg);
+
+ static bool pushMessage_multicast(
+ ExecutionEnvironment & ENV,
+ const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData,
+ const Message & anOutputMsg);
+
+ static bool pushMessage_unicast(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg);
+
+ static bool pushMessage_anycast(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg);
+
+
+ /*
+ * PUSH MESSAGE TO
+ */
+ static bool pushMessageTo(
+ ExecutionEnvironment & ENV, const Message & anOutputMsg);
+
+ static bool pushMessageTo_transfert(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg);
+
+ static bool pushMessageTo_buffer(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg);
+
+ static bool pushMessageTo_rdv(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg);
+
+ static bool pushMessageTo_broadcast(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg);
+
+ static bool pushMessageTo_multicast(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg);
+
+ static bool pushMessageTo_unicast(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg);
+
+ static bool pushMessageTo_anycast(
+ ExecutionEnvironment & ENV, const RuntimeID & aRoutingRID,
+ const RoutingData & aRoutingData, const Message & anOutputMsg);
+
+
+ /*
+ * UPDATE BUFFER
+ */
+ static bool updateBuffer(APExecutionData & anED);
+
+
+ /*
+ * PRESENCE / ABSENCE status
+ */
+ static bool computePresence(const ExecutionData & anED,
+ const RuntimeID & aReceiverRID, InstanceOfPort * aPort);
+
+ inline static bool computePresence(
+ const APExecutionData & anED, InstanceOfPort * aPort)
+ {
+ return( computePresence((* anED), anED->mRID, aPort) );
+ }
+
+
+ inline static bool computeAbsence(const ExecutionData & anED,
+ const RuntimeID & aReceiverRID, InstanceOfPort * aPort)
+ {
+ return( not computePresence(anED, aReceiverRID, aPort) );
+ }
+
+ inline static bool computeAbsence(
+ const APExecutionData & anED, InstanceOfPort * aPort)
+ {
+ return( not computePresence((* anED), anED->mRID, aPort) );
+ }
+
+
+ /*
+ * Collect buffer message
+ */
+ static void collectBufferMessage(
+ const ExecutionData & anED, BaseBufferForm & aBuffer);
+
+ inline static void collectBufferMessage(
+ const APExecutionData & anED, BaseBufferForm & aBuffer)
+ {
+ collectBufferMessage( (* anED) , aBuffer );
+ }
+
+};
+
+
+}
+
+#endif /* AVMCOMMUNICATIONFACTORY_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmCommunicationPrimitive.cpp b/org.eclipse.efm.symbex/src/computer/primitive/AvmCommunicationPrimitive.cpp
new file mode 100644
index 0000000..4da3786
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmCommunicationPrimitive.cpp
@@ -0,0 +1,850 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmCommunicationPrimitive.h"
+
+#include <builder/Builder.h>
+
+#include <computer/EvaluationEnvironment.h>
+#include <computer/ExecutionDataFactory.h>
+#include <computer/ExecutionEnvironment.h>
+#include <computer/PathConditionProcessor.h>
+
+#include <computer/primitive/AvmCommunicationFactory.h>
+#include <computer/primitive/AvmAssignPrimitive.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/ExpressionConstant.h>
+#include <fml/expression/ExpressionSimplifier.h>
+#include <fml/expression/StatementConstructor.h>
+
+#include <fml/runtime/ExecutionConfiguration.h>
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeLib.h>
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+
+/**
+ ***************************************************************************
+ * execution of an INPUT program
+ ***************************************************************************
+ */
+
+bool AvmPrimitive_Input::run(ExecutionEnvironment & ENV)
+{
+AVM_IF_DEBUG_FLAG_AND_NOT_FLAG( COMMUNICATION , STATEMENT )
+ AVM_OS_TRACE << TAB << "Input Message to receive: "
+ << ENV.inCODE->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG_AND_NOT_FLAG( COMMUNICATION , STATEMENT )
+
+ if( not AvmCommunicationFactory::popMessage(ENV,
+ ENV.mARG->at(0).to_ptr< InstanceOfPort >()) )
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << TAB << "THROW UNSATISFIED << INPUT >> :> "
+ << ENV.mARG->outED->mRID.strUniqId()
+ << " |=> " << ENV.inCODE->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+ }
+
+ return( true );
+}
+
+
+bool AvmPrimitive_InputVar::run(ExecutionEnvironment & ENV)
+{
+ InstanceOfData * anInstance = ENV.mARG->at(0).to_ptr< InstanceOfData >();
+
+ BFList paramList;
+ BF aNewSymbolicConstant( ENV.createNewFreshParam(ENV.mARG->outED->mRID,
+ anInstance, paramList) );
+
+ ExecutionDataFactory::appendIOElementTrace(ENV.mARG->outED,
+ BF( new ExecutionConfiguration(ENV.mARG->outED->mRID,
+ BFCode(OperatorManager::OPERATOR_INPUT,
+ ENV.mARG->at(0), aNewSymbolicConstant)) ) );
+
+ if( ENV.setRvalue(ENV.mARG->outED, anInstance, aNewSymbolicConstant) )
+ {
+ ENV.mARG->outED.appendParameters( paramList );
+
+ ENV.appendOutput( ENV.mARG->outED );
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+bool AvmPrimitive_InputEnv::run(ExecutionEnvironment & ENV)
+{
+ BFCode aTraceInput(OperatorManager::OPERATOR_INPUT_ENV, ENV.mARG->at(0));
+
+ bool allSuccess = true;
+
+ if( ENV.inCODE->populated() )
+ {
+ ENV.mARG->outED.makeModifiableParamTable();
+
+ InstanceOfPort * aPort = ENV.mARG->at(0).to_ptr< InstanceOfPort >();
+ avm_size_t offset = 0;
+
+ InstanceOfData * aVar = NULL;
+ BF aNewSymbolicConstant;
+ BFList paramList;
+
+ for( ENV.mARG->begin(1) ; ENV.mARG->hasNext() ;
+ ENV.mARG->next() , ++offset )
+ {
+ paramList.clear();
+
+ aVar = ENV.mARG->current().to_ptr< InstanceOfData >();
+
+ aNewSymbolicConstant = ENV.createNewFreshParam(
+ ENV.mARG->outED->mRID, aPort->getParameterType(offset),
+ aVar, paramList);
+
+ if( not ENV.setRvalue(ENV.mARG->outED, aVar, aNewSymbolicConstant) )
+ {
+ allSuccess = false;
+
+ break;
+ }
+
+ ENV.mARG->outED.appendParameters( paramList );
+
+ aTraceInput->append( aNewSymbolicConstant );
+ }
+ }
+
+ if( allSuccess )
+ {
+ ExecutionDataFactory::appendIOElementTrace(ENV.mARG->outED,
+ BF( new ExecutionConfiguration(
+ ENV.mARG->outED->mRID, aTraceInput) ) );
+
+ ENV.outEDS.append( ENV.mARG->outED );
+
+ return( true );
+ }
+ else
+ {
+ return( false );
+ }
+}
+
+
+bool AvmPrimitive_InputBuffer::run(ExecutionEnvironment & ENV)
+{
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << TAB << "begin AvmPrimitive_InputBuffer::run" << std::endl;
+
+ ENV.mARG->outED->getRuntime(1).toStreamData(
+ ENV.mARG->outED, AVM_OS_TRACE << INCR2_INDENT_TAB);
+ AVM_OS_TRACE << DECR2_INDENT;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+
+ const RoutingData & aRoutingData =
+ ENV.mARG->at(0).to_ptr< InstanceOfPort >()->getInputRoutingData();
+
+ const RuntimeID & aRoutingRID = aRoutingData.getRuntimeRID();
+
+ RuntimeID bufferDeclRID = aRoutingRID;
+
+ InstanceOfBuffer * aBuffer = aRoutingData.getBufferInstance().first();
+
+ bufferDeclRID = ENV.mARG->outED->getRuntimeContainerRID(
+ ENV.mARG->outED->mRID, aBuffer);
+ if( bufferDeclRID.valid() )
+ {
+ BaseBufferForm & bbf =
+ ENV.mARG->outED.getWritableRuntime(
+ bufferDeclRID ).getWritableBuffer( aBuffer );
+
+ Message popMsg;
+/*!!INPUT#ENABLED!!
+ if( ENV.mARG->outED->getRuntime(ENV.mARG->outED->mRID).isInputEnabled()
+ || ENV.mARG->outED->getRuntime(aRoutingRID).isInputEnabled()
+ || aRoutingData.isInputEnabled() || bbf->isInputEnabled() )
+ {
+ popMsg = bbf->popUntil(aRoutingData.getMID());
+ }
+ else*/
+ {
+ popMsg = bbf.pop(aRoutingData.getMID(), ENV.mARG->outED->mRID);
+ }
+
+ if( popMsg.valid() )
+ {
+ BFCode aTraceInput(OperatorManager::OPERATOR_INPUT, ENV.mARG->at(0));
+
+ Message::const_iterator itVal = popMsg.beginParameters();
+ Message::const_iterator endVal = popMsg.endParameters();
+
+ // We have to ignore the << Port >> InstanceOfPort
+ for( ENV.mARG->begin(1) ; (itVal != endVal) && ENV.mARG->hasNext() ;
+ ENV.mARG->next() , ++itVal )
+ {
+ if( ENV.setRvalue(ENV.mARG->outED,
+ ENV.mARG->current().to_ptr< InstanceOfData >(), *itVal) )
+ {
+ aTraceInput->append( *itVal );
+
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ ExecutionDataFactory::appendIOElementTrace(ENV.mARG->outED,
+ BF( new ExecutionConfiguration(
+ ENV.mARG->outED->mRID, aTraceInput, popMsg) ) );
+
+ ENV.outEDS.append( ENV.mARG->outED );
+
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ ENV.mARG->outED->getRuntime(1).toStreamData(
+ ENV.mARG->outED, AVM_OS_TRACE << INCR2_INDENT_TAB);
+
+ AVM_OS_TRACE << DECR2_INDENT_TAB
+ << "end AvmPrimitive_InputBuffer::run"
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+
+bool AvmPrimitive_InputRdv::run(ExecutionEnvironment & ENV)
+{
+ const BF & aPort = ENV.mARG->at(0);
+
+ const RoutingData & aRoutingData =
+ aPort.to_ptr< InstanceOfPort >()->getInputRoutingData();
+
+ const RuntimeID & aRoutingRID = aRoutingData.getRuntimeRID();
+
+ Message inMsg( aRoutingData.getMID(),
+ RuntimeID::REF_NULL, ENV.mARG->outED->mRID, aPort );
+
+ // We have to ignore the << Port >> InstanceOfPort
+ for( ENV.mARG->begin(1) ; ENV.mARG->hasNext() ; ENV.mARG->next() )
+ {
+ inMsg.appendParameter( ENV.mARG->current() );
+ }
+
+ ENV.mARG->outED.pushExecSyncPoint( new ExecutionSynchronizationPoint(
+ AWAITING_POINT_INPUT_NATURE, aRoutingRID, aRoutingData, inMsg) );
+
+ ENV.appendSync_mwsetAEES(ENV.mARG->outED, AEES_WAITING_INCOM_RDV);
+
+ return( true );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of an INPUT_FROM program
+ ***************************************************************************
+ */
+bool AvmPrimitive_InputFrom::run(ExecutionEnvironment & ENV)
+{
+AVM_IF_DEBUG_FLAG_AND_NOT_FLAG( COMMUNICATION , STATEMENT )
+ AVM_OS_TRACE << TAB << "Input Message to receive: "
+ << ENV.inCODE->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG_AND_NOT_FLAG( COMMUNICATION , STATEMENT )
+
+ if( (RuntimeLib::RID_ENVIRONMENT == ENV.mARG->at(1))
+ || (RuntimeLib::RID_NIL == ENV.mARG->at(1)) )
+ {
+ AvmCommunicationFactory::popMessage_environment(ENV,
+ ENV.mARG->at(1).bfRID(), RoutingData::_NULL_, 2);
+ }
+ else if( not AvmCommunicationFactory::popMessageFrom(ENV) )
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << TAB << "THROW UNSATISFIED << INPUT#FROM >> :> ?!? |=> "
+ << ENV.inCODE->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+ }
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of an OUTPUT program
+ ***************************************************************************
+ */
+
+bool AvmPrimitive_Output::run(ExecutionEnvironment & ENV)
+{
+AVM_IF_DEBUG_FLAG_AND_NOT_FLAG( COMMUNICATION , STATEMENT )
+ AVM_OS_TRACE << INCR_INDENT_TAB
+ << "<!?!" << ENV.inED->mRID.strUniqId()
+ << " |=> " << ENV.inCODE->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG_AND_NOT_FLAG( COMMUNICATION , STATEMENT )
+
+ Message anOutputMsg(ENV.mARG->outED->mRID, ENV.mARG->at(0) );
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << TAB << "Output Message to build" << std::endl;
+ anOutputMsg.toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , STATEMENT_COMMUNICATION )
+
+
+ for( ENV.mARG->begin(1) ; ENV.mARG->hasNext() ; ENV.mARG->next() )
+ {
+ anOutputMsg.appendParameter( ENV.mARG->current() );
+ }
+
+
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << TAB << "Output Message to push" << std::endl;
+ anOutputMsg.toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+
+ if( not AvmCommunicationFactory::pushMessage(ENV,
+ anOutputMsg, ENV.mARG->outED->mRID) )
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << TAB << "THROW UNSATISFIED << OUTPUT >> : <<< "
+ << ENV.mARG->outED->mRID.strUniqId()
+ << " |=> " << ENV.inCODE->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+ }
+
+
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << "!?!> " << ENV.inED->mRID.strUniqId()
+ << " |=> " << ENV.inCODE->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ return( true );
+}
+
+
+bool AvmPrimitive_OutputVar::run(ExecutionEnvironment & ENV)
+{
+ ExecutionDataFactory::appendIOElementTrace(ENV.mARG->outED,
+ BF( new ExecutionConfiguration(ENV.mARG->outED->mRID,
+ BFCode(OperatorManager::OPERATOR_OUTPUT,
+ ENV.mARG->at(0), ENV.mARG->at(1))) ) );
+
+ ENV.appendOutput( ENV.mARG->outED );
+
+ return( true );
+}
+
+
+bool AvmPrimitive_OutputEnv::run(ExecutionEnvironment & ENV)
+{
+ BFCode aTraceOutput(OperatorManager::OPERATOR_OUTPUT_ENV, ENV.mARG->at(0));
+
+ for( ENV.mARG->begin(1) ; ENV.mARG->hasNext() ; ENV.mARG->next() )
+ {
+ aTraceOutput->append( ENV.mARG->current() );
+ }
+
+ ExecutionDataFactory::appendIOElementTrace(ENV.mARG->outED,
+ BF( new ExecutionConfiguration(
+ ENV.mARG->outED->mRID, aTraceOutput) ) );
+
+ ENV.outEDS.append( ENV.mARG->outED );
+
+ return( true );
+}
+
+
+bool AvmPrimitive_OutputBuffer::run(ExecutionEnvironment & ENV)
+{
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << TAB << "begin AvmPrimitive_OutputBuffer::run" << std::endl;
+
+ ENV.mARG->outED->getRuntime(1).toStream(
+ AVM_OS_TRACE << INCR2_INDENT_TAB);
+ AVM_OS_TRACE << DECR2_INDENT;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+
+ const BF & aPort = ENV.mARG->at(0);
+
+ const RoutingData & aRoutingData =
+ aPort.to_ptr< InstanceOfPort >()->getOutputRoutingData();
+
+ const RuntimeID & aRoutingRID = aRoutingData.getRuntimeRID();
+
+ RuntimeID bufferDeclRID = aRoutingRID;
+
+ InstanceOfBuffer * aBuffer = aRoutingData.getBufferInstance().first();
+
+ bufferDeclRID = ENV.mARG->outED->getRuntimeContainerRID(
+ ENV.mARG->outED->mRID, aBuffer);
+
+ if( bufferDeclRID.valid() )
+ {
+ BaseBufferForm & bbf =
+ ENV.mARG->outED.getWritableRuntime(
+ bufferDeclRID ).getWritableBuffer( aBuffer );
+
+ Message outMsg( aRoutingData.getMID(),
+ ENV.mARG->outED->mRID, ENV.mARG->outED->mRID, aPort );
+
+ // We have to ignore the << Port >> InstanceOfPort
+ for( ENV.mARG->begin(1) ; ENV.mARG->hasNext() ; ENV.mARG->next() )
+ {
+ outMsg.appendParameter( ENV.mARG->current() );
+ }
+
+ if( bbf.push( outMsg ) )
+ {
+ BFCode aTraceOutput(OperatorManager::OPERATOR_OUTPUT, aPort);
+
+ aTraceOutput->append( outMsg.getParameters() );
+
+ ExecutionDataFactory::appendIOElementTrace(ENV.mARG->outED,
+ BF( new ExecutionConfiguration(
+ ENV.mARG->outED->mRID, aTraceOutput, outMsg) ) );
+
+ ENV.outEDS.append( ENV.mARG->outED );
+
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+ ENV.mARG->outED->getRuntime(1).toStream(
+ AVM_OS_TRACE << INCR2_INDENT_TAB);
+
+ AVM_OS_TRACE << DECR2_INDENT_TAB
+ << "end AvmPrimitive_OutputBuffer::run"
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , STATEMENT_COMMUNICATION )
+
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+
+bool AvmPrimitive_OutputRdv::run(ExecutionEnvironment & ENV)
+{
+ const BF & aPort = ENV.mARG->at(0);
+
+ const RoutingData & aRoutingData =
+ aPort.to_ptr< InstanceOfPort >()->getOutputRoutingData();
+
+ const RuntimeID & aRoutingRID = aRoutingData.getRuntimeRID();
+
+ Message outMsg( aRoutingData.getMID(),
+ ENV.mARG->outED->mRID, ENV.mARG->outED->mRID, aPort );
+
+ // We have to ignore the << Port >> InstanceOfPort
+ for( ENV.mARG->begin(1) ; ENV.mARG->hasNext() ; ENV.mARG->next() )
+ {
+ outMsg.appendParameter( ENV.mARG->current() );
+ }
+
+ ENV.mARG->outED.pushExecSyncPoint(new ExecutionSynchronizationPoint(
+ AWAITING_POINT_OUTPUT_NATURE, aRoutingRID, aRoutingData, outMsg) );
+
+ ENV.appendSync_mwsetAEES(ENV.mARG->outED, AEES_WAITING_OUTCOM_RDV);
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of an OUTPUT_TO program
+ ***************************************************************************
+ */
+bool AvmPrimitive_OutputTo::run(ExecutionEnvironment & ENV)
+{
+AVM_IF_DEBUG_FLAG_AND_NOT_FLAG( COMMUNICATION , STATEMENT )
+ AVM_OS_TRACE << INCR_INDENT_TAB
+ << "<!?!" << ENV.inED->mRID.strUniqId()
+ << " |=> " << ENV.inCODE->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG_AND_NOT_FLAG( COMMUNICATION , STATEMENT )
+
+ Message anOutputMsg( ENV.mARG->outED->mRID,
+ ENV.mARG->at(1).bfRID(), ENV.mARG->at(0) );
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << TAB << "Output Message to build" << std::endl;
+ anOutputMsg.toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , STATEMENT_COMMUNICATION )
+
+
+ for( ENV.mARG->begin(2) ; ENV.mARG->hasNext() ; ENV.mARG->next() )
+ {
+ anOutputMsg.appendParameter( ENV.mARG->current() );
+ }
+
+
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << TAB << "Output Message to push" << std::endl;
+ anOutputMsg.toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+
+ if( ENV.mARG->at(0).to_ptr< InstanceOfPort >()->isPort() )
+ {
+ if( not AvmCommunicationFactory::pushMessageTo(ENV, anOutputMsg) )
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << TAB << "THROW UNSATISFIED << OUTPUT >> : <<< "
+ << ENV.mARG->outED->mRID.strUniqId()
+ << " |=> " << ENV.inCODE->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+ }
+ }
+ else// if( ENV.mARG->at(0).to_ptr< InstanceOfPort >()->isSignal() )
+ {
+ if( ENV.mARG->at(1).bfRID().valid() )
+ {
+ if( (RuntimeLib::RID_ENVIRONMENT == ENV.mARG->at(1))
+ || (RuntimeLib::RID_NIL == ENV.mARG->at(1)) )
+ {
+ AvmCommunicationFactory::pushMessage_environment(ENV,
+ ENV.mARG->at(1).bfRID(), RoutingData::_NULL_, anOutputMsg);
+ }
+ else if( not AvmCommunicationFactory::pushMessage(ENV,
+ anOutputMsg, ENV.mARG->at(1).bfRID()) )
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << TAB << "THROW UNSATISFIED << OUTPUT#TO<"
+ << ENV.mARG->at(1).bfRID().getFullyQualifiedNameID() << "> >> : <<< "
+ << ENV.mARG->outED->mRID.strUniqId()
+ << " |=> " << ENV.inCODE->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+ }
+ }
+ else
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << TAB << "THROW UNKNOWN RECEIVER << OUTPUT#TO<"
+ << ENV.mARG->at(1).bfRID().getFullyQualifiedNameID() << "?> >> : <<< "
+ << ENV.mARG->outED->mRID.strUniqId()
+ << " |=> " << ENV.inCODE->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+
+ return( false );
+ }
+ }
+
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << "!?!> " << ENV.inED->mRID.strUniqId()
+ << " |=> " << ENV.inCODE->str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a PRESENT program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Present::run(ExecutionEnvironment & ENV)
+{
+ if( AvmCommunicationFactory::computePresence(ENV.mARG->outED,
+ ENV.mARG->at(0).to_ptr< InstanceOfPort >()) )
+ {
+ ENV.outEDS.append( ENV.mARG->outED );
+ }
+ else
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << "THROW UNSATISFIED << PRESENCE >> :> ?!? < "
+ << ENV.inCODE->str() << " >|=> "
+ << ENV.mARG->at(0).str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+ }
+
+ return( true );
+}
+
+
+bool AvmPrimitive_Present::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionConstructor::newBoolean(
+ AvmCommunicationFactory::computePresence(ENV.mARG->outED,
+ ENV.mARG->at(0).to_ptr< InstanceOfPort >()) );
+
+ return( true );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of an ABSENT program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Absent::run(ExecutionEnvironment & ENV)
+{
+ if( AvmCommunicationFactory::computeAbsence(ENV.mARG->outED,
+ ENV.mARG->at(0).to_ptr< InstanceOfPort >()) )
+ {
+ ENV.outEDS.append( ENV.mARG->outED );
+ }
+ else
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << "THROW UNSATISFIED << ABSENCE >> :> ?!? < "
+ << ENV.inCODE->str() << " >|=> "
+ << ENV.mARG->at(0).str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+ }
+
+ return( true );
+}
+
+
+bool AvmPrimitive_Absent::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionConstructor::newBoolean(
+ AvmCommunicationFactory::computeAbsence(ENV.mARG->outED,
+ ENV.mARG->at(0).to_ptr< InstanceOfPort >()) );
+
+ return( true );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of a UPDATE BUFFER program
+ ***************************************************************************
+ */
+bool AvmPrimitive_UpdateBuffer::run(ExecutionEnvironment & ENV)
+{
+ if( ENV.inCODE->size() == 1 )
+ {
+ switch( ENV.inCODE->first().classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ ExecutionEnvironment tmpENV(ENV, ENV.inCODE->first());
+ if( tmpENV.run() )
+ {
+ APExecutionData tmpED;
+ while( tmpENV.outEDS.nonempty() )
+ {
+ tmpENV.outEDS.pop_first_to( tmpED );
+
+ if( AvmCommunicationFactory::updateBuffer(tmpED) )
+ {
+ ENV.outEDS.append( tmpED );
+ }
+ }
+
+ ENV.spliceOutput(tmpENV);
+
+ return( true );
+ }
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_WARNING_ALERT
+ << "Unexpected argument KIND for an SYNCHRONIZE program\n"
+ << ENV.inCODE->toString( AVM_TAB1_INDENT )
+ << SEND_ALERT;
+
+ return( false );
+ }
+ }
+ }
+ else
+ {
+ APExecutionData anOutputED = ENV.inED;
+ if( AvmCommunicationFactory::updateBuffer(anOutputED) )
+ {
+ ENV.outEDS.append( anOutputED );
+
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH MIN
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_OBS::run(ExecutionEnvironment & ENV)
+{
+ if( ENV.mARG->at(2).isEqualTrue() )
+ {
+ //!! NO NEED PATH CONDITION UPDATE
+ ENV.appendOutput( ENV.mARG->outED );
+ }
+
+ else if( ENV.mARG->at(2).isEqualFalse() )
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << "THROW UNSATISFIED << OBS >> : "
+ << ENV.mARG->outED->mRID.strUniqId() << " |=> "
+ << ENV.inCODE->str() << std::endl;
+// AVM_OS_TRACE << "THROW UNSATISFIED << GUARD >> : "
+// << ENV.mARG->outED->mRID.strUniqId() << " , ";
+// AVM_OS_TRACE << ENV.inCODE->str() << " |=> "
+// << ENV.mARG->at(2).str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+ }
+
+ else
+ {
+ AVM_OS_TRACE << "OBS :> " << ENV.mARG->at(2).str() << std::endl;
+
+ if( not PathConditionProcessor::appendPathCondition(
+ ENV, ENV.mARG->outED, ENV.mARG->at(2)) )
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << "THROW UNSATISFIED << OBS >> : "
+ << ENV.mARG->outED->mRID.strUniqId() << " |=> "
+ << ENV.inCODE->str() << std::endl;
+// AVM_OS_TRACE << "THROW UNSATISFIED << GUARD >> : "
+// << ENV.mARG->outED->mRID.strUniqId() << " , ";
+// AVM_OS_TRACE << ENV.inCODE->str() << " |=> "
+// << ENV.mARG->at(2).str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+ }
+ }
+
+ return( true );
+}
+
+bool AvmPrimitive_OBS::seval(EvaluationEnvironment & ENV)
+{
+ if( ENV.mARG->at(0).is< AvmCode >() )
+ {
+ const BFCode & evtCondition = ENV.mARG->at(0).bfCode();
+
+ switch( evtCondition->getAvmOpCode() )
+ {
+ case AVM_OPCODE_INPUT:
+ case AVM_OPCODE_OUTPUT:
+ {
+ if( evtCondition->first().is< BaseInstanceForm >() )
+ {
+ BaseInstanceForm * ioInstance =
+ evtCondition->first().to_ptr< BaseInstanceForm >();
+
+ if( ioInstance->is< InstanceOfPort >() )
+ {
+ AvmCode * ioTrace = NULL;
+
+ ioTrace = ENV.searchTraceIO(
+ ENV.outED->getIOElementTrace(), evtCondition);
+
+ if( ioTrace != NULL )
+ {
+ ENV.outVAL = ENV.ioSubst( ENV.outED,
+ ENV.outED->mRID.getExecutable(),
+ evtCondition, ioTrace, ENV.mARG->at(1) );
+ }
+ else
+ {
+ ENV.outVAL = ExpressionConstant::BOOLEAN_FALSE;
+ }
+
+ return( true );
+ }
+ else if( ioInstance->is< InstanceOfData >() )
+ {
+ if( ENV.isAssigned(ENV.outED, ENV.outED->mRID,
+ ioInstance->to< InstanceOfData >()) )
+ {
+ if( not ENV.seval(ENV.mARG->at(1)) )
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ ENV.outVAL = ExpressionConstant::BOOLEAN_FALSE;
+ }
+
+ return( true );
+ }
+ }
+
+ ENV.outVAL = ExpressionConstant::BOOLEAN_FALSE;
+
+ return( true );
+ }
+
+ default:
+ {
+ BF evtCond = ENV.outVAL;
+
+ if( ENV.seval(ENV.mARG->at(1)) )
+ {
+ ENV.outVAL = ExpressionSimplifier::AND(
+ ENV.mARG->at(0), evtCond);
+
+ return( true );
+ }
+ break;
+ }
+ }
+ }
+
+ else if( ENV.mARG->at(0).isEqualTrue() )
+ {
+ return( ENV.seval(ENV.mARG->at(1)) );
+ }
+ else if( ENV.mARG->at(0).isNotEqualFalse() )
+ {
+ BF evtCond = ENV.outVAL;
+ if( ENV.seval(ENV.mARG->at(1)) )
+ {
+ ENV.outVAL = ExpressionSimplifier::AND(ENV.mARG->at(0), evtCond);
+
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmCommunicationPrimitive.h b/org.eclipse.efm.symbex/src/computer/primitive/AvmCommunicationPrimitive.h
new file mode 100644
index 0000000..1239eb2
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmCommunicationPrimitive.h
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCOMMUNICATIONPRIMITIVE_H_
+#define AVMCOMMUNICATIONPRIMITIVE_H_
+
+#include <computer/primitive/BaseAvmPrimitive.h>
+
+
+namespace sep
+{
+
+
+AVM_PRIMITIVE_RUN_CLASS(Input, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(InputVar, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(InputEnv, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(InputBuffer, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(InputRdv, BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_RUN_CLASS(InputFrom, BaseAvmPrimitive)
+
+
+
+AVM_PRIMITIVE_RUN_CLASS(Output, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(OutputTo, BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_RUN_CLASS(OutputVar, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(OutputEnv, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(OutputBuffer, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(OutputRdv, BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_RUN_EVAL_CLASS(Present, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_EVAL_CLASS(Absent, BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_RUN_EVAL_CLASS(OBS, BaseAvmPrimitive)
+
+
+/*
+ ***************************************************************************
+ * AVM BUFFER MANAGING
+ ***************************************************************************
+ */
+AVM_PRIMITIVE_RUN_CLASS(UpdateBuffer, BaseAvmPrimitive)
+
+
+
+}
+
+#endif /* AVMCOMMUNICATIONPRIMITIVE_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmCommunicationRdvPrimitive.cpp b/org.eclipse.efm.symbex/src/computer/primitive/AvmCommunicationRdvPrimitive.cpp
new file mode 100644
index 0000000..6158961
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmCommunicationRdvPrimitive.cpp
@@ -0,0 +1,1802 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 8 nov. 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmCommunicationRdvPrimitive.h"
+
+#include <computer/ExecutionDataFactory.h>
+#include <computer/ExecutionEnvironment.h>
+
+#include <computer/primitive/AvmSynchronizationFactory.h>
+
+#include <fml/executable/InstanceOfConnect.h>
+#include <fml/executable/InstanceOfMachine.h>
+#include <fml/executable/InstanceOfPort.h>
+#include <fml/executable/RoutingData.h>
+
+#include <fml/expression/StatementConstructor.h>
+
+#include <fml/infrastructure/ComProtocol.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/runtime/ExecutionConfiguration.h>
+#include <fml/runtime/ExecutionSynchronizationPoint.h>
+#include <fml/runtime/Message.h>
+#include <fml/runtime/RuntimeDef.h>
+
+
+
+namespace sep
+{
+
+
+static void print_trace(const APExecutionData & anED, OutStream & os)
+{
+ if( anED.invalid() )
+ {
+ return;
+ }
+
+ os << TAB << "ED@" << anED.raw_address();
+
+ if( anED->mEXEC_SYNC_POINT != NULL )
+ {
+ os << " RD_" << anED->mEXEC_SYNC_POINT->mRoutingData.raw_address()
+ << " C_" << avm_address_t(
+ anED->mEXEC_SYNC_POINT->mRoutingData.getConnect())
+ << "< mid:" << anED->mEXEC_SYNC_POINT->mRoutingData.getMID()
+ << " > " << anED->mEXEC_SYNC_POINT->mRoutingData
+ .getMachine()->getFullyQualifiedNameID()
+ << ( (anED->mEXEC_SYNC_POINT->isInput())? " <== " : " ==> " )
+ << anED->mEXEC_SYNC_POINT->mRoutingData
+ .getPort()->getFullyQualifiedNameID()
+
+ << " " << anED->getRunnableElementTrace().str();
+ }
+ else
+ {
+ os << " " << anED->getIOElementTrace().str();
+ }
+
+ os << EOL_FLUSH;
+}
+
+
+static void print_trace(const ListOfAPExecutionData & listofWaitingRDV,
+ OutStream & os)
+{
+ ListOfAPExecutionData::const_iterator itED = listofWaitingRDV.begin();
+ ListOfAPExecutionData::const_iterator endED = listofWaitingRDV.end();
+
+ for( ; itED != endED ; ++itED )
+ {
+ print_trace((*itED), os);
+
+// (*itED)->mEXEC_SYNC_POINT->toStream(AVM_OS_TRACE, TAB + "\t", "\t", "\n");
+ }
+}
+
+
+static void print_trace(const VectorOfAPExecutionData & tableofWaitingRDV,
+ OutStream & os)
+{
+ VectorOfAPExecutionData::const_iterator itED = tableofWaitingRDV.begin();
+ VectorOfAPExecutionData::const_iterator endED = tableofWaitingRDV.end();
+
+ for( ; itED != endED ; ++itED )
+ {
+ print_trace((*itED), os);
+
+// (*itED)->mEXEC_SYNC_POINT->toStream(AVM_OS_TRACE, TAB + "\t", "\t", "\n");
+ }
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// FUSION
+////////////////////////////////////////////////////////////////////////////////
+
+RdvConfigurationData * RdvConfigurationData::fusion(RdvConfigurationData * aRdvConf)
+{
+ RdvConfigurationData * aFusionRdvConf = new RdvConfigurationData(*this, aRdvConf);
+
+ for( avm_size_t idx = 0 ; idx < mMachineCount ; ++idx )
+ {
+ IN_ED_RDV[ idx ].append( aRdvConf->IN_ED_RDV[ idx ] );
+ OUT_ED_RDV[ idx ].append( aRdvConf->OUT_ED_RDV[ idx ] );
+
+ ED_MULTIRDV[ idx ].append( aRdvConf->ED_MULTIRDV[ idx ] );
+
+ RDVS[ idx ].append( aRdvConf->RDVS[ idx ] );
+
+ if( mAwaitingMultiRdvEDS[ idx ].invalid() &&
+ aRdvConf->mAwaitingMultiRdvEDS[ idx ].valid() )
+ {
+ mAwaitingMultiRdvEDS [ idx ] = aRdvConf->mAwaitingMultiRdvEDS[ idx ];
+ mAwaitingMultiRdvFlag[ idx ] = true;
+ }
+ }
+
+ return( aFusionRdvConf );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// RESIZE
+////////////////////////////////////////////////////////////////////////////////
+
+void RdvConfigurationData::resize(avm_size_t newSize)
+{
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( newSize <= mMachineCount )
+ << "Unexpected machine count for RDV Configuration Data !!!"
+ << SEND_EXIT;
+
+ if( newSize < mMachineCount )
+ {
+ IN_ED_RDV.resize( newSize );
+ OUT_ED_RDV.resize( newSize );
+
+ ED_MULTIRDV.resize( newSize );
+
+ mUsedMachineFlag.resize( newSize , false );
+
+ mAwaitingInputRdvFlag.resize( newSize , false );
+ mAwaitingOutputRdvFlag.resize( newSize , false );
+ mAwaitingMultiRdvFlag.resize( newSize , false );
+
+ mAwaitingMultiRdvEDS.resize( newSize );
+
+ mMachineCount = newSize;
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// FLAGS OPERATION
+////////////////////////////////////////////////////////////////////////////////
+
+bool RdvConfigurationData::isMultiRdvComplete()
+{
+ avm_size_t inCount = 0;
+ avm_size_t outCount = 0;
+
+ APExecutionData anED;
+
+ for( avm_size_t idx = 0 ; idx < mMachineCount; ++idx )
+ {
+ if( mAwaitingMultiRdvEDS[ idx ].valid() )
+ {
+ anED = mAwaitingMultiRdvEDS[ idx ];
+
+ if( anED->mEXEC_SYNC_POINT->isOutput() )
+ {
+ ++outCount;
+ }
+ else //if( anED->mEXEC_SYNC_POINT->isInput() )
+ {
+ ++inCount;
+ }
+ }
+ }
+
+
+ ComRouteData & outputComRoute = anED->mEXEC_SYNC_POINT->
+ mRoutingData.getConnect()->getOutputComRouteData();
+
+ switch( outputComRoute.getCast() )
+ {
+ case ComProtocol::PROTOCOL_UNICAST_KIND:
+ {
+ if( outCount != 1 )
+ {
+ return( false );
+ }
+ break;
+ }
+
+
+ case ComProtocol::PROTOCOL_MULTICAST_KIND:
+ {
+ if( outCount != outputComRoute.getMachinePorts().size() )
+ {
+ return( false );
+ }
+ break;
+ }
+
+ case ComProtocol::PROTOCOL_BROADCAST_KIND:
+
+ case ComProtocol::PROTOCOL_UNDEFINED_KIND:
+ default:
+ {
+ if( outCount == 0 )
+ {
+ return( false );
+ }
+ break;
+ }
+ }
+
+ ComRouteData & inputComRoute = anED->mEXEC_SYNC_POINT->
+ mRoutingData.getConnect()->getInputComRouteData();
+
+ switch( inputComRoute.getCast() )
+ {
+ case ComProtocol::PROTOCOL_UNICAST_KIND:
+ {
+ if( inCount != 1 )
+ {
+ return( false );
+ }
+ break;
+ }
+
+ case ComProtocol::PROTOCOL_MULTICAST_KIND:
+ {
+ if( inCount != inputComRoute.getMachinePorts().size() )
+ {
+ return( false );
+ }
+ break;
+ }
+
+ case ComProtocol::PROTOCOL_BROADCAST_KIND:
+
+ case ComProtocol::PROTOCOL_UNDEFINED_KIND:
+ default:
+ {
+ if( inCount == 0 )
+ {
+ return( false );
+ }
+ break;
+ }
+ }
+
+// return( (outCount == 1) && (inCount > 0) &&
+// anED->mEXEC_SYNC_POINT->mRoutingData.getConnect()->
+// getInputComRouteData().getMachinePorts().size() == (1 + inCount) );
+
+// return( (anED->mEXEC_SYNC_POINT->mRoutingData.getConnect()->getOutputPort().size()
+// + anED->mEXEC_SYNC_POINT->mRoutingData.getConnect()->
+// getInputComRouteData().getMachinePorts().size()) == count );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// SERIALIZATION
+////////////////////////////////////////////////////////////////////////////////
+
+void RdvConfigurationData::toStream(OutStream & os) const
+{
+// os << std::endl;
+ os << REPEAT("----------", 10) << std::endl;
+ os << "UsedMachineFlag :> " << mUsedMachineFlag << std::endl;
+ os << "AwaitingInput :> " << mAwaitingInputRdvFlag << std::endl;
+ os << "AwaitingOutput :> " << mAwaitingOutputRdvFlag << std::endl;
+
+ os << "AwaitingMulti :> " << mAwaitingMultiRdvFlag << std::endl;
+ os << "AwaitingInputMulti :> " << mAwaitingInputMultiRdvFlag << std::endl;
+ os << "AwaitingOutpuMulti :> " << mAwaitingOutputMultiRdvFlag << std::endl;
+
+ os << "Permformed RDV? :> " << hasPerformedRdvFlag << std::endl;
+ os << "Internal RDV? :> " << hasPossibleInternalRdvFlag << std::endl;
+ os << "Internal MULTI? :> " << hasPossibleInternalMultiRdvFlag << std::endl;
+
+ for( avm_size_t idx = 0 ; idx < mMachineCount ; ++idx )
+ {
+ if( IN_ED_RDV[ idx ].nonempty() || OUT_ED_RDV[ idx ].nonempty() ||
+ ED_MULTIRDV[ idx ].nonempty() || RDVS[ idx ].nonempty() )
+ {
+ os << REPEAT("----------", 10) << std::endl;
+ }
+
+// os << "free :> " << mFreeOffsetFlag[idx] << std::endl;
+
+ os << INCR_INDENT;
+ if( IN_ED_RDV[ idx ].nonempty() )
+ {
+ os << "INPUTS_RDV[ " << idx << " ] :>" << EOL;
+ print_trace(IN_ED_RDV[ idx ], os);
+ }
+
+ if( OUT_ED_RDV[ idx ].nonempty() )
+ {
+ os << "OUTPUTS_RDV[ " << idx << " ] :>" << EOL;
+ print_trace(OUT_ED_RDV[ idx ], os);
+ }
+
+ if( ED_MULTIRDV[ idx ].nonempty() )
+ {
+ os << "ED_MULTIRDV[ " << idx << " ] :>" << EOL;
+ print_trace(ED_MULTIRDV[ idx ], os);
+ }
+
+ if( RDVS[ idx ].nonempty() )
+ {
+ os << "RDVS[ " << idx << " ] :>" << EOL;
+ print_trace(RDVS[ idx ], os);
+ }
+ }
+
+ if( mAwaitingMultiRdvFlag.any() )
+ {
+ os << REPEAT("----------", 10) << std::endl;
+ os << "AWAITING_MULTI_RDV :>" << EOL;
+ print_trace(mAwaitingMultiRdvEDS, os);
+ }
+
+ os << DECR_INDENT;
+
+
+ os << REPEAT("==========", 10) << std::endl;
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// the RESUME RDV statement
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// GLOBAL EFFECTIVE RDV COUNT
+////////////////////////////////////////////////////////////////////////////////
+
+avm_size_t AvmCommunicationRdvPrimitive::GLOBAL_EFFECTIVE_RDV_COUNT = 0;
+
+avm_size_t AvmCommunicationRdvPrimitive::GLOBAL_EFFECTIVE_MULTI_RDV_COUNT = 0;
+
+
+void AvmCommunicationRdvPrimitive::reportGlobalStatistics(OutStream & os)
+{
+ if( GLOBAL_EFFECTIVE_RDV_COUNT > 0 )
+ {
+ os << EOL_TAB2 << "Effective RDV : " << GLOBAL_EFFECTIVE_RDV_COUNT;
+
+ if( GLOBAL_EFFECTIVE_MULTI_RDV_COUNT > 0 )
+ {
+ os << " & MULTI_RDV : " << GLOBAL_EFFECTIVE_MULTI_RDV_COUNT;
+ }
+ os << EOL;
+ }
+ else if( GLOBAL_EFFECTIVE_MULTI_RDV_COUNT > 0 )
+ {
+ os << EOL_TAB2 << "Effective MULTI_RDV : "
+ << GLOBAL_EFFECTIVE_MULTI_RDV_COUNT
+ << EOL;
+ }
+}
+
+/**
+ * COMPUTE ALL RDV
+ */
+bool AvmCommunicationRdvPrimitive::computeRdv(
+ AvmPrimitiveProcessor & aProcessor,
+ std::vector< ExecutionEnvironment > & tabOfENV)
+{
+ return( false );
+}
+
+
+/**
+ * the RESUME RDV instruction
+ */
+
+bool AvmCommunicationRdvPrimitive::haveRDV(APExecutionData & outED,
+ APExecutionData & inED)
+{
+ if( inED->mEXEC_SYNC_POINT->mRoutingData.getConnect() ==
+ outED->mEXEC_SYNC_POINT->mRoutingData.getConnect() )
+ {
+ return( inED->mEXEC_SYNC_POINT->mMessage.needSender(
+ outED->mEXEC_SYNC_POINT->mMessage.getSenderRID()) );
+ }
+
+ return( false );
+}
+
+static bool isAddRvdConf(RdvConfigurationData * aRdvConf,
+ avm_size_t idx, APExecutionData & anED)
+{
+ if( aRdvConf->mConnector
+ == anED->mEXEC_SYNC_POINT->mRoutingData.getConnect() )
+ {
+ bool returnFlag = true;
+
+ switch( anED->mEXEC_SYNC_POINT->mAwaitingPointNature )
+ {
+ case AWAITING_POINT_OUTPUT_NATURE:
+ {
+ switch( anED->mEXEC_SYNC_POINT->mRoutingData.
+ getConnect()->getOutputComRouteData().getCast() )
+ {
+ case ComProtocol::PROTOCOL_UNICAST_KIND:
+ {
+ if( aRdvConf->mAwaitingOutputMultiRdvFlag[idx] )
+ {
+ aRdvConf->mAwaitingOutputMultiRdvFlag[idx] = false;
+ returnFlag = aRdvConf->mAwaitingOutputMultiRdvFlag.none();
+ aRdvConf->mAwaitingOutputMultiRdvFlag[idx] = true;
+ }
+ else
+ {
+ returnFlag = aRdvConf->mAwaitingOutputMultiRdvFlag.none();
+ }
+ break;
+ }
+ default:
+ {
+ // NOTHING
+ break;
+ }
+ }
+ break;
+ }
+ case AWAITING_POINT_INPUT_NATURE:
+ {
+ switch( anED->mEXEC_SYNC_POINT->mRoutingData.
+ getConnect()->getInputComRouteData().getCast() )
+ {
+ case ComProtocol::PROTOCOL_UNICAST_KIND:
+ {
+ if( aRdvConf->mAwaitingInputMultiRdvFlag[idx] )
+ {
+ aRdvConf->mAwaitingInputMultiRdvFlag[idx] = false;
+ returnFlag = aRdvConf->mAwaitingInputMultiRdvFlag.none();
+ aRdvConf->mAwaitingInputMultiRdvFlag[idx] = true;
+ }
+ else
+ {
+ returnFlag = aRdvConf->mAwaitingInputMultiRdvFlag.none();
+ }
+ break;
+ }
+ default:
+ {
+ // NOTHING
+ break;
+ }
+ }
+ break;
+ }
+ default:
+ {
+ // NOTHING
+ break;
+ }
+ }
+ return returnFlag;
+ }
+
+ return false;
+}
+
+
+
+static void addRvdConf(bool isInitial,
+ ListOfRdvConfigurationData & multiRdvConf,
+ RdvConfigurationData * refRdvConf,
+ avm_size_t idx, ListOfAPExecutionData & theED)
+{
+ ListOfAPExecutionData::iterator itED;
+ ListOfAPExecutionData::iterator endED = theED.end();
+
+ avm_size_t edx;
+ avm_size_t edCount = theED.size();
+ Bitset isnotFound(edCount, true);
+
+ RdvConfigurationData * aRdvConf = NULL;
+
+ ListOfRdvConfigurationData::iterator itConf = multiRdvConf.begin();
+ ListOfRdvConfigurationData::iterator endConf = multiRdvConf.end();
+ for( ; itConf != endConf ; ++itConf )
+ {
+// AVM_OS_TRACE << REPEAT("++++++++++", 10) << std::endl;
+// AVM_OS_TRACE << REPEAT("++++++++++", 10) << std::endl;
+// (*itConf)->toStream(AVM_OS_TRACE);
+
+ for( itED = theED.begin() , edx = 0 ; itED != endED ; ++itED , ++edx)
+ {
+// AVM_OS_TRACE << ":=> ";
+// print_trace(*itED, AVM_OS_TRACE, "");
+
+ if( isAddRvdConf(*itConf, idx, *itED) )
+ {
+ isnotFound[edx] = false;
+
+ aRdvConf = (*itConf);
+ if( aRdvConf->mAwaitingMultiRdvEDS[idx].valid() )
+ {
+ multiRdvConf.insert(itConf , aRdvConf =
+ new RdvConfigurationData(*aRdvConf));
+ }
+ aRdvConf->mAwaitingMultiRdvEDS [ idx ] = (*itED);
+ aRdvConf->mAwaitingMultiRdvFlag[ idx ] = true;
+
+ aRdvConf->mAwaitingInputMultiRdvFlag [ idx ] =
+ (*itED)->mEXEC_SYNC_POINT->isInput();
+
+ aRdvConf->mAwaitingOutputMultiRdvFlag[ idx ] =
+ (*itED)->mEXEC_SYNC_POINT->isOutput();
+ aRdvConf->mUsedMachineFlag[ idx ] = true;
+
+// AVM_OS_TRACE << REPEAT("++++++++++", 10) << std::endl;
+// aRdvConf->toStream(AVM_OS_TRACE);
+ }
+ else if( isnotFound[edx] )
+ {
+ isnotFound[edx] = ((*itConf)->mConnector !=
+ (*itED)->mEXEC_SYNC_POINT->mRoutingData.getConnect());
+ }
+ }
+ }
+
+ if( isnotFound.any() )
+ {
+ for( itED = theED.begin() , edx = 0 ; itED != endED ; ++itED , ++edx)
+ {
+ if( isnotFound[edx] )
+ {
+// AVM_OS_TRACE << "|=> ";
+// print_trace(*itED, AVM_OS_TRACE, "");
+
+ if( isInitial )
+ {
+ aRdvConf = new RdvConfigurationData(refRdvConf);
+ aRdvConf->mConnector =
+ (*itED)->mEXEC_SYNC_POINT->mRoutingData.getConnect();
+ }
+ else
+ {
+ aRdvConf = new RdvConfigurationData(*refRdvConf);
+
+// if( aRdvConf->mConnector !=
+// (*itED)->mEXEC_SYNC_POINT->mRoutingData.getConnect() )
+// {
+// aRdvConf->mAwaitingMultiRdvFlag.reset();
+// for( avm_size_t i = 0 ; i < aRdvConf->mMachineCount; ++i )
+// {
+// aRdvConf->mAwaitingMultiRdvEDS[ i ] = NULL;
+// }
+// }
+ aRdvConf->IN_ED_RDV[ idx ].clear();
+ aRdvConf->OUT_ED_RDV[ idx ].clear();
+ aRdvConf->ED_MULTIRDV[ idx ].clear();
+ }
+
+ multiRdvConf.append( aRdvConf );
+
+ aRdvConf->mAwaitingMultiRdvEDS [ idx ] = (*itED);
+ aRdvConf->mAwaitingMultiRdvFlag[ idx ] = true;
+
+ aRdvConf->mAwaitingInputMultiRdvFlag [ idx ] =
+ (*itED)->mEXEC_SYNC_POINT->isInput();
+
+ aRdvConf->mAwaitingOutputMultiRdvFlag[ idx ] =
+ (*itED)->mEXEC_SYNC_POINT->isOutput();
+
+ aRdvConf->mUsedMachineFlag[ idx ] = true;
+
+// AVM_OS_TRACE << REPEAT("++++++++++", 10) << std::endl;
+// aRdvConf->toStream(AVM_OS_TRACE);
+ }
+ }
+ }
+}
+
+
+bool AvmCommunicationRdvPrimitive::resume_rdv(ListOfAPExecutionData & aRDV)
+{
+ // TRACE
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << REPEAT("==========", 10) << std::endl;
+ AVM_OS_TRACE << "==> BEGIN" << std::endl;
+ AVM_OS_TRACE << REPEAT("==========", 10) << std::endl;
+ mBaseRdvConf.toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ mEffectiveRdvCount = 0;
+ mEffectiveMultiRdvCount = 0;
+
+ if( computeAllRdv() )
+ {
+ aRDV.splice( RDV );
+
+ GLOBAL_EFFECTIVE_RDV_COUNT += mEffectiveRdvCount;
+ GLOBAL_EFFECTIVE_MULTI_RDV_COUNT += mEffectiveMultiRdvCount;
+
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << REPEAT("==========", 10) << std::endl;
+ AVM_OS_TRACE << "==> END :> count";
+ if( checkRdvFlag )
+ {
+ AVM_OS_TRACE << " : RDV[ " << mEffectiveRdvCount << " ]";
+ }
+ if( checkMultiRdvFlag )
+ {
+ AVM_OS_TRACE << " : MULTI_RDV[ " << mEffectiveMultiRdvCount << " ]";
+ }
+ AVM_OS_TRACE << " !!!" << std::endl;
+ AVM_OS_TRACE << REPEAT("==========", 10) << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ return( true );
+ }
+
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << REPEAT("==========", 10) << std::endl;
+ AVM_OS_TRACE << "==> END :> RDV count : ZERO !!!" << std::endl;
+ AVM_OS_TRACE << REPEAT("==========", 10) << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ return( false );
+}
+
+
+
+bool AvmCommunicationRdvPrimitive::computeAllRdv()
+{
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << "==> CHECK IN INITIAL" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ // Check INITIAL RDV
+ if( checkRdvFlag )
+ {
+ if( not checkInternalRdv(true, &mBaseRdvConf) )
+ {
+ // TODO ERREUR
+ }
+ }
+
+ // Check INITIAL MULTI RDV
+ if( checkMultiRdvFlag )
+ {
+ if( not checkInternalMultiRDV(true, &mBaseRdvConf) )
+ {
+ // TODO ERREUR
+ }
+ }
+
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ AVM_OS_INFO << "flag:> Rdv = " << checkRdvFlag << " MultiRdv = "
+ << checkMultiRdvFlag << std::endl
+ << "init:> Rdv = " << mEffectiveRdvCount << " MultiRdv = "
+ << mEffectiveMultiRdvCount << std::endl
+ << "NEXT_RDV_CONF:> " << NEXT_RDV_CONF.size() << std::endl
+ << "conf:> " << InstanceCounter<
+ RdvConfigurationData >::INSTANCE_ALIVE << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+
+ while( NEXT_RDV_CONF.nonempty() )
+ {
+ CURRENT_RDV_CONF.splice( NEXT_RDV_CONF );
+
+ if( not completeAllRdv() )
+ {
+ // TODO ERREUR
+ }
+
+ PREVIOUS_RDV_CONF.splice( CURRENT_RDV_CONF );
+
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ AVM_OS_INFO << "while:> Rdv = " << mEffectiveRdvCount << " MultiRdv = "
+ << mEffectiveMultiRdvCount << std::endl
+ << "NEXT_RDV_CONF:> " << NEXT_RDV_CONF.size() << std::endl
+ << "conf:> " << InstanceCounter<
+ RdvConfigurationData >::INSTANCE_ALIVE << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ }
+
+ return( RDV.nonempty() );
+}
+
+
+bool AvmCommunicationRdvPrimitive::completeAllRdv()
+{
+ ListOfRdvConfigurationData::iterator itRdvConf;
+ ListOfRdvConfigurationData::iterator endItRdvConf = CURRENT_RDV_CONF.end();
+
+ ListOfRdvConfigurationData::iterator itRdvConf2;
+ ListOfRdvConfigurationData::iterator endItRdvConf2 = PREVIOUS_RDV_CONF.end();
+
+ itRdvConf = CURRENT_RDV_CONF.begin();
+ for( ; itRdvConf != endItRdvConf ; ++ itRdvConf )
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << std::endl
+ << "completeAllRdv ==> BEGIN CHECKING :>" << std::endl;
+
+ (*itRdvConf)->toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ if( (*itRdvConf)->hasPerformedRdvFlag )
+ {
+
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << "==> CHECK IN INTERNAL" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ // CHECK for INTERNAL RDV in CURRENT CONF
+ if( (*itRdvConf)->hasPossibleInternalRdvFlag )
+ {
+ if( not checkInternalRdv(false, (*itRdvConf)) )
+ {
+ // TODO ERREUR
+ }
+ }
+
+ // Check internal MULTI_RDV
+ if( (*itRdvConf)->hasPossibleInternalMultiRdvFlag )
+ {
+ if( not checkInternalMultiRDV(false, *itRdvConf) )
+ {
+ // TODO ERREUR
+ }
+ }
+
+
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << "==> CHECK WITH INITIAL" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ // CHECK for RDV with INITIAL CONF
+ if( checkRdvFlag
+ && ((*itRdvConf)->mAwaitingInputRdvFlag.any()
+ || (*itRdvConf)->mAwaitingOutputRdvFlag.any())
+ && (((*itRdvConf)->mAwaitingInputRdvFlag ^
+ mBaseRdvConf.mAwaitingOutputRdvFlag).any()
+ || (mBaseRdvConf.mAwaitingInputRdvFlag ^
+ (*itRdvConf)->mAwaitingOutputRdvFlag).any()) )
+ {
+ if( not checkWithInitialRdv(*itRdvConf) )
+ {
+ // TODO ERREUR
+ }
+ }
+
+ if( checkMultiRdvFlag
+ && (*itRdvConf)->mAwaitingMultiRdvFlag.any()
+ && ((mBaseRdvConf.mAwaitingOutputRdvFlag.any()
+ && ((*itRdvConf)->mAwaitingMultiRdvFlag ^
+ mBaseRdvConf.mAwaitingOutputRdvFlag).any())
+ || (mBaseRdvConf.mAwaitingInputRdvFlag.any()
+ && ((*itRdvConf)->mAwaitingMultiRdvFlag ^
+ mBaseRdvConf.mAwaitingInputRdvFlag).any())) )
+ {
+ if( not checkWithInitialMultiRdv(*itRdvConf) )
+ {
+ // TODO ERREUR
+ }
+ }
+ }
+
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << "==> CHECK WITH EXTERNAL" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ // CHECK for RDV between CURRENT CONF
+ itRdvConf2 = CURRENT_RDV_CONF.begin();
+ for( ; itRdvConf2 != endItRdvConf ; ++ itRdvConf2 )
+ {
+ if( itRdvConf != itRdvConf2 )
+ {
+ if( checkRdvFlag
+ && (*itRdvConf)->hasPossibleExternalRdv(*itRdvConf2) )
+ {
+ if( not checkWithExternalRdv((*itRdvConf), (*itRdvConf2)) )
+ {
+ // TODO ERREUR
+ }
+ }
+
+ if( checkMultiRdvFlag && (*itRdvConf)->mAwaitingMultiRdvFlag.any()
+ && (*itRdvConf)->hasPossibleExternalMultiRdv(*itRdvConf2) )
+ {
+ if( not checkWithExternalMultiRdv((*itRdvConf), (*itRdvConf2)) )
+ {
+ // TODO ERREUR
+ }
+ }
+ }
+ }
+
+ // CHECK for RDV with PREVIOUS CONF
+ itRdvConf2 = PREVIOUS_RDV_CONF.begin();
+ for( ; itRdvConf2 != endItRdvConf2 ; ++ itRdvConf2 )
+ {
+ if( itRdvConf != itRdvConf2 )
+ {
+ if( checkRdvFlag && (*itRdvConf)->hasPossibleExternalRdv(*itRdvConf2) )
+ {
+ if( not checkWithExternalRdv((*itRdvConf), (*itRdvConf2)) )
+ {
+ // TODO ERREUR
+ }
+ }
+
+ if( checkMultiRdvFlag && (*itRdvConf)->mAwaitingMultiRdvFlag.any()
+ && (*itRdvConf)->hasPossibleExternalMultiRdv(*itRdvConf2) )
+ {
+ if( not checkWithExternalMultiRdv((*itRdvConf), (*itRdvConf2)) )
+ {
+ // TODO ERREUR
+ }
+ }
+ }
+ }
+ }
+
+ return( true );
+}
+
+
+
+bool AvmCommunicationRdvPrimitive::checkInternalRdv(
+ bool isInitial, RdvConfigurationData * aRdvConf)
+{
+ ListOfAPExecutionData::iterator itOutED;
+ ListOfAPExecutionData::iterator endOutED;
+
+ ListOfAPExecutionData::iterator itInED;
+ ListOfAPExecutionData::iterator endInED;
+
+ RdvConfigurationData * newRdvConf = NULL;
+
+ for( avm_size_t outIdx = 0 ; outIdx < aRdvConf->mMachineCount; ++outIdx )
+ {
+ if( aRdvConf->OUT_ED_RDV[ outIdx ].empty() )
+ {
+ continue;
+ }
+
+ itOutED = aRdvConf->OUT_ED_RDV[ outIdx ].begin();
+ endOutED = aRdvConf->OUT_ED_RDV[ outIdx ].end();
+ for( ; itOutED != endOutED ; ++itOutED )
+ {
+ for( avm_size_t inIdx = 0 ; inIdx < aRdvConf->mMachineCount ; ++inIdx )
+ {
+ if( (inIdx == outIdx) || aRdvConf->IN_ED_RDV[ inIdx ].empty() )
+ {
+ continue;
+ }
+
+ itInED = aRdvConf->IN_ED_RDV[ inIdx ].begin();
+ endInED = aRdvConf->IN_ED_RDV[ inIdx ].end();
+ for( ; itInED != endInED ; ++itInED )
+ {
+ if( haveRDV((*itOutED), (*itInED)) )
+ {
+ if( isInitial )
+ {
+ newRdvConf = new RdvConfigurationData( aRdvConf );
+
+ newRdvConf->mUsedMachineFlag[ outIdx ] = true;
+ newRdvConf->mUsedMachineFlag[ inIdx ] = true;
+ }
+ else
+ {
+ newRdvConf = new RdvConfigurationData( *aRdvConf );
+
+ newRdvConf->IN_ED_RDV[ inIdx ].clear();
+ newRdvConf->OUT_ED_RDV[ outIdx ].clear();
+
+ newRdvConf->ED_MULTIRDV[ inIdx ].clear();
+ }
+
+ newRdvConf->mAwaitingInputRdvFlag[ outIdx ] = false;
+ newRdvConf->mAwaitingOutputRdvFlag[ inIdx ] = false;
+
+// newRdvConf->updatePossibleInternalRdvFlag();
+// newRdvConf->updatePossibleInternalMultiRdvFlag();
+
+ if( compute_rdv(newRdvConf,
+ outIdx, (*itOutED), inIdx, (*itInED)) )
+ {
+ complete_rdv(newRdvConf);
+ }
+ else
+ {
+ // TODO ERREUR
+ delete( newRdvConf );
+ newRdvConf = NULL;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return( true );
+}
+
+
+bool AvmCommunicationRdvPrimitive::checkInternalMultiRDV(
+ bool isInitial, RdvConfigurationData * aRdvConf)
+{
+ ListOfRdvConfigurationData multiRdvConf;
+
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ AVM_OS_INFO << "checkInternalMultiRDV:> "
+ << InstanceCounter< RdvConfigurationData >::INSTANCE_ALIVE
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ for( avm_size_t idx = 0 ; idx < aRdvConf->mMachineCount; ++idx )
+ {
+ addRvdConf(isInitial, multiRdvConf,
+ aRdvConf, idx, aRdvConf->ED_MULTIRDV[idx]);
+
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ AVM_OS_INFO << "checkInternalMultiRDV:" << idx << "> "
+ << InstanceCounter< RdvConfigurationData >::INSTANCE_ALIVE
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ }
+
+ if( not compute_multirdv(multiRdvConf) )
+ {
+ // TODO ERREUR
+ }
+
+ return( true );
+}
+
+
+
+
+bool AvmCommunicationRdvPrimitive::checkWithInitialRdv(
+ RdvConfigurationData * aRdvConf)
+{
+ ListOfAPExecutionData::iterator itInED;
+ ListOfAPExecutionData::iterator endInED;
+
+ ListOfAPExecutionData::iterator itOutED;
+ ListOfAPExecutionData::iterator endOutED;
+
+ RdvConfigurationData * newRdvConf = NULL;
+
+ avm_size_t outIdx = 0;
+ avm_size_t inIdx = 0;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // COMPLETE OUTPUT WITH INITIAL INPUT
+ ////////////////////////////////////////////////////////////////////////////
+ if( aRdvConf->mAwaitingInputRdvFlag.any()
+ && mBaseRdvConf.mAwaitingOutputRdvFlag.any() )
+ {
+ for( inIdx = 0 ; inIdx < aRdvConf->mMachineCount ; ++inIdx )
+ {
+ if( mBaseRdvConf.IN_ED_RDV[ inIdx ].empty()
+ || aRdvConf->mUsedMachineFlag[ inIdx ] )
+ {
+ continue;
+ }
+
+ itInED = mBaseRdvConf.IN_ED_RDV[ inIdx ].begin();
+ endInED = mBaseRdvConf.IN_ED_RDV[ inIdx ].end();
+ for( ; itInED != endInED ; ++itInED )
+ {
+ for( outIdx = 0 ; (outIdx < aRdvConf->mMachineCount) ; ++outIdx )
+ {
+ if( (inIdx == outIdx)
+ || aRdvConf->OUT_ED_RDV[ outIdx ].empty() )
+ {
+ continue;
+ }
+
+ itOutED = aRdvConf->OUT_ED_RDV[ outIdx ].begin();
+ endOutED = aRdvConf->OUT_ED_RDV[ outIdx ].end();
+ for( ; itOutED != endOutED ; ++itOutED )
+ {
+ if( haveRDV((*itOutED), (*itInED)) )
+ {
+ newRdvConf = new RdvConfigurationData( *aRdvConf );
+
+ newRdvConf->IN_ED_RDV[ inIdx ].clear();
+ newRdvConf->OUT_ED_RDV[ outIdx ].clear();
+ newRdvConf->ED_MULTIRDV[ inIdx ].clear();
+
+ newRdvConf->mAwaitingInputRdvFlag[ outIdx ] = false;
+ newRdvConf->mAwaitingOutputRdvFlag[ inIdx ] = false;
+
+ newRdvConf->mUsedMachineFlag[ inIdx ] = true;
+
+ if( compute_rdv(newRdvConf,
+ outIdx, (*itOutED), inIdx, (*itInED)) )
+ {
+ complete_rdv(newRdvConf);
+ }
+ else
+ {
+ // TODO ERREUR
+ delete( newRdvConf );
+ newRdvConf = NULL;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // COMPLETE INPUT WITH INITIAL OUTPUT
+ ////////////////////////////////////////////////////////////////////////////
+ if( aRdvConf->mAwaitingOutputRdvFlag.any()
+ && mBaseRdvConf.mAwaitingInputRdvFlag.any())
+ {
+ for( outIdx = 0 ; (outIdx < aRdvConf->mMachineCount) ; ++outIdx )
+ {
+ if( mBaseRdvConf.OUT_ED_RDV[ outIdx ].empty()
+ || aRdvConf->mUsedMachineFlag[ outIdx ] )
+ {
+ continue;
+ }
+
+ itOutED = mBaseRdvConf.OUT_ED_RDV[ outIdx ].begin();
+ endOutED = mBaseRdvConf.OUT_ED_RDV[ outIdx ].end();
+ for( ; itOutED != endOutED ; ++itOutED )
+ {
+ for( inIdx = 0 ; inIdx < aRdvConf->mMachineCount ; ++inIdx )
+ {
+ if( (inIdx == outIdx) || aRdvConf->IN_ED_RDV[ inIdx ].empty() )
+ {
+ continue;
+ }
+
+ itInED = aRdvConf->IN_ED_RDV[ inIdx ].begin();
+ endInED = aRdvConf->IN_ED_RDV[ inIdx ].end();
+ for( ; itInED != endInED ; ++itInED )
+ {
+ if( haveRDV((*itOutED), (*itInED)) )
+ {
+ newRdvConf = new RdvConfigurationData( *aRdvConf );
+
+ newRdvConf->IN_ED_RDV[ inIdx ].clear();
+ newRdvConf->OUT_ED_RDV[ outIdx ].clear();
+ newRdvConf->ED_MULTIRDV[ inIdx ].clear();
+
+ newRdvConf->mAwaitingInputRdvFlag[ outIdx ] = false;
+ newRdvConf->mAwaitingOutputRdvFlag[ inIdx ] = false;
+
+ newRdvConf->mUsedMachineFlag[ outIdx ] = true;
+
+ if( not compute_rdv(newRdvConf,
+ outIdx, (*itOutED), inIdx, (*itInED)) )
+ {
+ // TODO ERREUR
+ }
+
+ complete_rdv(newRdvConf);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return( true );
+}
+
+
+bool AvmCommunicationRdvPrimitive::checkWithInitialMultiRdv(
+ RdvConfigurationData * aRdvConf)
+{
+ ListOfRdvConfigurationData multiRdvConf;
+
+// ((*itRdvConf)->mAwaitingMultiRdvFlag ^ mBaseRdvConf.mAwaitingOutputRdvFlag).any() ||
+// ((*itRdvConf)->mAwaitingMultiRdvFlag ^ mBaseRdvConf.mAwaitingInputRdvFlag).any()
+
+ for( avm_size_t idx = 0 ; idx < aRdvConf->mMachineCount; ++idx )
+ {
+ if( not aRdvConf->mAwaitingMultiRdvFlag[ idx ] )
+ {
+ addRvdConf(false, multiRdvConf,
+ aRdvConf, idx, mBaseRdvConf.ED_MULTIRDV[idx]);
+ }
+ }
+
+ if( not compute_multirdv(multiRdvConf) )
+ {
+ // TODO ERREUR
+ }
+
+ return( true );
+}
+
+
+
+bool AvmCommunicationRdvPrimitive::checkWithExternalRdv(
+ RdvConfigurationData * aRdvConf, RdvConfigurationData * otherRdvConf)
+{
+ ListOfAPExecutionData::iterator itInED;
+ ListOfAPExecutionData::iterator endInED;
+
+ ListOfAPExecutionData::iterator itOutED;
+ ListOfAPExecutionData::iterator endOutED;
+
+ RdvConfigurationData * newRdvConf = NULL;
+
+ avm_size_t outIdx = 0;
+ avm_size_t inIdx = 0;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // COMPLETE OUTPUT WITH OTHER INCOMPLETE RDV_CONF INPUT
+ ////////////////////////////////////////////////////////////////////////////
+ if( aRdvConf->mAwaitingInputRdvFlag.any()
+ && otherRdvConf->mAwaitingOutputRdvFlag.any())
+ {
+ for( outIdx = 0 ; outIdx < aRdvConf->mMachineCount ; ++outIdx )
+ {
+ if( otherRdvConf->IN_ED_RDV[ inIdx ].empty()
+ || aRdvConf->mUsedMachineFlag[ inIdx ] )
+ {
+ continue;
+ }
+
+ itInED = otherRdvConf->IN_ED_RDV[ inIdx ].begin();
+ endInED = otherRdvConf->IN_ED_RDV[ inIdx ].end();
+ for( ; itInED != endInED ; ++itInED )
+ {
+ for( outIdx = 0 ; (outIdx < aRdvConf->mMachineCount) ; ++outIdx )
+ {
+ if( (inIdx == outIdx) || aRdvConf->OUT_ED_RDV[ outIdx ].empty() )
+ {
+ continue;
+ }
+
+ itOutED = aRdvConf->OUT_ED_RDV[ outIdx ].begin();
+ endOutED = aRdvConf->OUT_ED_RDV[ outIdx ].end();
+ for( ; itOutED != endOutED ; ++itOutED )
+ {
+ if( haveRDV((*itOutED), (*itInED)) )
+ {
+ newRdvConf = aRdvConf->fusion( otherRdvConf );
+
+ newRdvConf->IN_ED_RDV[ inIdx ].clear();
+ newRdvConf->OUT_ED_RDV[ outIdx ].clear();
+ newRdvConf->ED_MULTIRDV[ inIdx ].clear();
+
+ newRdvConf->mAwaitingInputRdvFlag[ outIdx ] = false;
+ newRdvConf->mAwaitingOutputRdvFlag[ inIdx ] = false;
+
+ newRdvConf->mUsedMachineFlag[ inIdx ] = true;
+
+ if( compute_rdv(newRdvConf,
+ outIdx, (*itOutED), inIdx, (*itInED)) )
+ {
+ complete_rdv(newRdvConf);
+ }
+ else
+ {
+ // TODO ERREUR
+ delete( newRdvConf );
+ newRdvConf = NULL;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // COMPLETE INPUT WITH OTHER INCOMPLETE RDV_CONF OUTPUT
+ ////////////////////////////////////////////////////////////////////////////
+ if( aRdvConf->mAwaitingOutputRdvFlag.any()
+ && otherRdvConf->mAwaitingInputRdvFlag.any())
+ {
+ for( outIdx = 0 ; (outIdx < aRdvConf->mMachineCount) ; ++outIdx )
+ {
+ if( otherRdvConf->OUT_ED_RDV[ outIdx ].empty()
+ || aRdvConf->mUsedMachineFlag[ outIdx ] )
+ {
+ continue;
+ }
+
+ itOutED = otherRdvConf->OUT_ED_RDV[ outIdx ].begin();
+ endOutED = otherRdvConf->OUT_ED_RDV[ outIdx ].end();
+ for( ; itOutED != endOutED ; ++itOutED )
+ {
+ if( not (*itOutED)->mEXEC_SYNC_POINT->mRoutingData.isProtocolRDV() )
+ {
+ continue;
+ }
+
+ for( inIdx = 0 ; inIdx < aRdvConf->mMachineCount ; ++inIdx )
+ {
+ if( (inIdx == outIdx) || aRdvConf->IN_ED_RDV[ inIdx ].empty() )
+ {
+ continue;
+ }
+
+ itInED = aRdvConf->IN_ED_RDV[ inIdx ].begin();
+ endInED = aRdvConf->IN_ED_RDV[ inIdx ].end();
+ for( ; itInED != endInED ; ++itInED )
+ {
+ if( haveRDV((*itOutED), (*itInED)) )
+ {
+ newRdvConf = aRdvConf->fusion( otherRdvConf );
+
+ newRdvConf->IN_ED_RDV[ inIdx ].clear();
+ newRdvConf->OUT_ED_RDV[ outIdx ].clear();
+ newRdvConf->ED_MULTIRDV[ inIdx ].clear();
+
+ newRdvConf->mAwaitingInputRdvFlag[ outIdx ] = false;
+ newRdvConf->mAwaitingOutputRdvFlag[ inIdx ] = false;
+
+ newRdvConf->mUsedMachineFlag[ outIdx ] = true;
+
+ if( not compute_rdv(newRdvConf,
+ outIdx, (*itOutED), inIdx, (*itInED)) )
+ {
+ // TODO ERREUR
+ }
+
+ complete_rdv(newRdvConf);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return( true );
+}
+
+
+bool AvmCommunicationRdvPrimitive::checkWithExternalMultiRdv(
+ RdvConfigurationData * aRdvConf,
+ RdvConfigurationData * otherRdvConf)
+{
+ VectorOfAPExecutionData::iterator itED;
+ VectorOfAPExecutionData::iterator endED;
+
+ ListOfAPExecutionData::iterator endioED;
+
+ ListOfRdvConfigurationData multiRdvConf;
+
+ for( avm_size_t idx = 0 ; idx < aRdvConf->mMachineCount; ++idx )
+ {
+ if( not otherRdvConf->mAwaitingMultiRdvFlag[ idx ] )
+ {
+ if( aRdvConf->mAwaitingMultiRdvFlag.any() )
+ {
+ ListOfAPExecutionData listED;
+
+ itED = aRdvConf->mAwaitingMultiRdvEDS.begin();
+ endED = aRdvConf->mAwaitingMultiRdvEDS.end();
+ for( ; itED != endED ; ++itED )
+ {
+ if( (*itED).valid() )
+ {
+ listED.append( *itED );
+ }
+
+ }
+ addRvdConf(false, multiRdvConf, otherRdvConf, idx, listED);
+
+ }
+ addRvdConf(false, multiRdvConf,
+ otherRdvConf, idx, aRdvConf->ED_MULTIRDV[idx]);
+ }
+}
+
+ if( not compute_multirdv(multiRdvConf) )
+ {
+ // TODO ERREUR
+ }
+
+ return( true );
+}
+
+
+
+
+bool AvmCommunicationRdvPrimitive::resume_rdv(ExecutionEnvironment & ENV,
+ RdvConfigurationData * aRdvConf, avm_offset_t offset)
+{
+ if( not resume_rdv(ENV) )
+ {
+ return( false );
+ }
+
+ APExecutionData tmpED;
+
+ while( ENV.outEDS.nonempty() )
+ {
+ ENV.outEDS.pop_last_to( tmpED );
+
+ switch( tmpED->getAEES() )
+ {
+ case AEES_OK:
+ case AEES_STMNT_NOTHING:
+ case AEES_STMNT_RETURN:
+ {
+ aRdvConf->RDVS[ offset ].append( tmpED );
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as outEDS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+
+ while( ENV.exitEDS.nonempty() )
+ {
+ ENV.exitEDS.pop_last_to( tmpED );
+
+ switch( tmpED->getAEES() )
+ {
+ case AEES_STMNT_EXIT:
+ case AEES_STMNT_EXIT_ALL:
+ case AEES_STMNT_FATAL_ERROR:
+ case AEES_SYMBOLIC_EXECUTION_LIMITATION:
+ {
+ aRdvConf->RDVS[ offset ].append( tmpED );
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as exitEDS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+
+ while( ENV.syncEDS.nonempty() )
+ {
+ ENV.syncEDS.pop_last_to( tmpED );
+
+ switch( tmpED->getAEES() )
+ {
+ case AEES_WAITING_INCOM_RDV:
+ {
+ if( tmpED->mEXEC_SYNC_POINT->mRoutingData.isProtocolRDV() )
+ {
+ aRdvConf->IN_ED_RDV[ offset ].append( tmpED );
+ aRdvConf->mAwaitingOutputRdvFlag[ offset ] = true;
+ }
+ else if( tmpED->mEXEC_SYNC_POINT->mRoutingData.isProtocolMULTI_RDV() )
+ {
+ aRdvConf->ED_MULTIRDV[ offset ].append( tmpED );
+ aRdvConf->mAwaitingOutputMultiRdvFlag[ offset ] = true;
+ }
+ break;
+ }
+
+ case AEES_WAITING_OUTCOM_RDV:
+ {
+ if( tmpED->mEXEC_SYNC_POINT->mRoutingData.isProtocolRDV() )
+ {
+ aRdvConf->OUT_ED_RDV[ offset ].append( tmpED );
+ aRdvConf->mAwaitingInputRdvFlag[ offset ] = true;
+ }
+ else if( tmpED->mEXEC_SYNC_POINT->mRoutingData.isProtocolMULTI_RDV() )
+ {
+ aRdvConf->ED_MULTIRDV[ offset ].append( tmpED );
+ aRdvConf->mAwaitingInputMultiRdvFlag[ offset ] = true;
+ }
+ break;
+ }
+
+
+ case AEES_WAITING_JOIN_FORK:
+ {
+ aRdvConf->RDVS[ offset ].append( tmpED );
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as syncEDS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+
+ aRdvConf->hasPerformedRdvFlag = true;
+
+ return( true );
+}
+
+
+
+bool AvmCommunicationRdvPrimitive::compute_rdv(RdvConfigurationData * aRdvConf,
+ avm_offset_t outOffset, APExecutionData & outED,
+ avm_offset_t inOffset, APExecutionData & inED)
+{
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << std::endl << "Checking RDV :>"
+ << " Rdv = " << mEffectiveRdvCount
+ << " MultiRdv = " << mEffectiveMultiRdvCount
+ << " conf = "
+ << InstanceCounter< RdvConfigurationData >::INSTANCE_ALIVE
+ << std::endl;
+ aRdvConf->toStream( AVM_OS_TRACE );
+ print_trace(outED, AVM_OS_TRACE);
+ print_trace(inED, AVM_OS_TRACE);
+ AVM_OS_TRACE << REPEAT("__________", 10) << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ ////////////////////////////////////////////////////////////////////////////
+ // INPUT RDV
+ ////////////////////////////////////////////////////////////////////////////
+ ExecutionEnvironment inENV(aRdvConf->ENV, inED);
+
+ BFCode aTraceInput(OperatorManager::OPERATOR_INPUT_RDV,
+ inED->mEXEC_SYNC_POINT->mMessage.bfPort());
+
+ BFCode aTraceOutput(OperatorManager::OPERATOR_OUTPUT_RDV,
+ outED->mEXEC_SYNC_POINT->mMessage.bfPort());
+
+ Message::const_iterator itVar =
+ inED->mEXEC_SYNC_POINT->mMessage.beginParameters();
+ Message::const_iterator endVar =
+ inED->mEXEC_SYNC_POINT->mMessage.endParameters();
+ Message::const_iterator itValue =
+ outED->mEXEC_SYNC_POINT->mMessage.beginParameters();
+
+ for( ; itVar != endVar ; ++itVar , ++itValue )
+ {
+ inENV.inED.mwsetAEES( AEES_OK );
+ if( not inENV.setRvalue((*itVar).to_ptr< InstanceOfData >(), (*itValue)) )
+ {
+ return( false );
+ }
+
+ aTraceInput->append( *itValue );
+ aTraceOutput->append( *itValue );
+ }
+
+ ExecutionDataFactory::appendIOElementTrace(inENV.inED,
+ BF( new ExecutionConfiguration(inENV.inED->mRID,
+ aTraceInput, outED->mEXEC_SYNC_POINT->mMessage) ) );
+
+
+ if( not resume_rdv(inENV, aRdvConf, inOffset) )
+ {
+ return( false );
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // OUTPUT RDV
+ ////////////////////////////////////////////////////////////////////////////
+ ExecutionEnvironment outENV(aRdvConf->ENV, outED);
+
+ ExecutionDataFactory::appendIOElementTrace(outENV.inED,
+ BF( new ExecutionConfiguration(outENV.inED->mRID,
+ aTraceOutput, outED->mEXEC_SYNC_POINT->mMessage) ) );
+
+ if( not resume_rdv(outENV, aRdvConf, outOffset) )
+ {
+ return( false );
+ }
+
+
+ updatePossibleInternalRdvFlags(aRdvConf);
+
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ // TRACE
+ aRdvConf->toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ return( true );
+}
+
+
+bool AvmCommunicationRdvPrimitive::compute_multirdv(
+ ListOfRdvConfigurationData & multiRdvConf)
+{
+ RdvConfigurationData * aRdvConf = NULL;
+
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ AVM_OS_INFO << "compute_multirdv:b> "
+ << InstanceCounter< RdvConfigurationData >::INSTANCE_ALIVE
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ while( multiRdvConf.nonempty() )
+ {
+ multiRdvConf.pop_first_to( aRdvConf );
+// aRdvConf->updatePossibleInternalRdvFlag();
+// aRdvConf->updatePossibleInternalMultiRdvFlag();
+
+ if( aRdvConf->isMultiRdvComplete() )
+ {
+ if( not compute_multirdv(aRdvConf) )
+ {
+ delete( aRdvConf );
+ aRdvConf = NULL;
+
+ continue;
+ // TODO ERREUR
+ }
+ }
+
+ complete_rdv(aRdvConf, true);
+ }
+
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ AVM_OS_INFO << "compute_multirdv:e> "
+ << InstanceCounter< RdvConfigurationData >::INSTANCE_ALIVE
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ return( true );
+}
+
+bool AvmCommunicationRdvPrimitive::compute_multirdv(
+ RdvConfigurationData * aRdvConf)
+{
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ AVM_OS_TRACE << std::endl << "Checking MULTI_RDV :>"
+ << " Rdv = " << mEffectiveRdvCount
+ << " MultiRdv = " << mEffectiveMultiRdvCount
+ << " conf = "
+ << InstanceCounter< RdvConfigurationData >::INSTANCE_ALIVE
+ << std::endl;
+ aRdvConf->toStream( AVM_OS_TRACE );
+ print_trace(aRdvConf->mAwaitingMultiRdvEDS, AVM_OS_TRACE);
+ AVM_OS_TRACE << REPEAT("__________", 10) << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ Message anOutputMsg;
+ Message anInputMsg;
+ BFCode aTraceIO;
+
+ Message::const_iterator itVar;
+ Message::const_iterator endVar;
+ Message::const_iterator itValue;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // OUTPUT RDV
+ ////////////////////////////////////////////////////////////////////////////
+ for( avm_size_t idx = 0 ; idx < aRdvConf->mMachineCount; ++idx )
+ {
+ if( aRdvConf->mAwaitingMultiRdvEDS[ idx ].invalid() )
+ {
+ continue;
+ }
+ if( aRdvConf->mAwaitingMultiRdvEDS[ idx ]->mEXEC_SYNC_POINT->isInput() )
+ {
+ continue;
+ }
+ aRdvConf->mAwaitingMultiRdvFlag[ idx ] = false;
+ aRdvConf->mAwaitingInputMultiRdvFlag[ idx ] = false;
+
+ ExecutionEnvironment outENV(
+ aRdvConf->ENV, aRdvConf->mAwaitingMultiRdvEDS[ idx ]);
+ aRdvConf->mAwaitingMultiRdvEDS[ idx ].destroy();
+
+ anOutputMsg = outENV.inED->mEXEC_SYNC_POINT->mMessage;
+
+ aTraceIO = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_OUTPUT_RDV, anOutputMsg.bfPort());
+
+ aTraceIO->append( anOutputMsg.getParameters() );
+
+ ExecutionDataFactory::appendIOElementTrace(outENV.inED,
+ BF( new ExecutionConfiguration(
+ outENV.inED->mRID, aTraceIO, anOutputMsg) ) );
+
+ if( not resume_rdv(outENV, aRdvConf, idx) )
+ {
+ return( false );
+ }
+
+ if( anOutputMsg.hasParameter() )
+ {
+ break; // Only one sender with values on MULTI RDV
+ }
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // INPUT RDV
+ ////////////////////////////////////////////////////////////////////////////
+
+ for( avm_size_t idx = 0 ; idx < aRdvConf->mMachineCount; ++idx )
+ {
+ if( aRdvConf->mAwaitingMultiRdvEDS[ idx ].invalid() )
+ {
+ continue;
+ }
+ if( aRdvConf->mAwaitingMultiRdvEDS[ idx ]->mEXEC_SYNC_POINT->isOutput() )
+ {
+ continue;
+ }
+
+ aRdvConf->mAwaitingMultiRdvFlag[ idx ] = false;
+ aRdvConf->mAwaitingOutputMultiRdvFlag[ idx ] = false;
+
+ ExecutionEnvironment inENV(
+ aRdvConf->ENV, aRdvConf->mAwaitingMultiRdvEDS[ idx ]);
+ aRdvConf->mAwaitingMultiRdvEDS[ idx ].destroy();
+
+ anInputMsg = inENV.inED->mEXEC_SYNC_POINT->mMessage;
+
+ aTraceIO = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_INPUT_RDV, anInputMsg.bfPort());
+
+ if( anOutputMsg.hasParameter() )
+ {
+ itVar = anInputMsg.beginParameters();
+ endVar = anInputMsg.endParameters();
+ itValue = anOutputMsg.beginParameters();
+ for( ; itVar != endVar ; ++itVar , ++itValue )
+ {
+ aTraceIO->append( *itValue );
+
+ inENV.inED.mwsetAEES( AEES_OK );
+ if( not inENV.setRvalue(
+ (*itVar).to_ptr< InstanceOfData >(), (*itValue)) )
+ {
+ return( false );
+ }
+ }
+ }
+
+ ExecutionDataFactory::appendIOElementTrace(inENV.inED,
+ BF( new ExecutionConfiguration(
+ inENV.inED->mRID, aTraceIO, anInputMsg) ) );
+
+ if( not resume_rdv(inENV, aRdvConf, idx) )
+ {
+ return( false );
+ }
+ }
+
+ updatePossibleInternalRdvFlags(aRdvConf);
+
+AVM_IF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+ // TRACE
+ aRdvConf->toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ return( true );
+}
+
+
+void AvmCommunicationRdvPrimitive::complete_rdv(
+ RdvConfigurationData * & aRdvConf, bool isMulti)
+{
+ if( aRdvConf->isComplete() )
+ {
+ if( not completed_rdv(aRdvConf, isMulti) )
+ {
+ // TODO ERREUR
+ }
+
+ delete( aRdvConf );
+ aRdvConf = NULL;
+ }
+ else
+ {
+ NEXT_RDV_CONF.append( aRdvConf );
+ }
+}
+
+
+bool AvmCommunicationRdvPrimitive::completed_rdv(
+ RdvConfigurationData * aRdvConf, bool isMulti)
+{
+ ListOfAPExecutionData tmpListOfED;
+ APExecutionData tmpED;
+
+ ListOfAPExecutionData::iterator itED;
+ ListOfAPExecutionData::iterator endItED;
+
+ ListOfAPExecutionData fusionListOfED;
+ APExecutionData anED;
+
+ avm_size_t idx = 0;
+
+ for( idx = 0 ; idx < aRdvConf->mMachineCount; ++idx )
+ {
+ if( aRdvConf->RDVS[ idx ].nonempty() )
+ {
+ tmpListOfED.splice( aRdvConf->RDVS[ idx ] );
+ break;
+ }
+ }
+
+ for( ++idx ; idx < aRdvConf->mMachineCount; ++idx )
+ {
+ if( aRdvConf->RDVS[ idx ].nonempty() )
+ {
+ while( tmpListOfED.nonempty() )
+ {
+ tmpListOfED.pop_last_to( tmpED );
+
+ itED = aRdvConf->RDVS[ idx ].begin();
+ endItED = aRdvConf->RDVS[ idx ].end();
+ for( ; itED != endItED ; ++itED )
+ {
+ anED = AvmSynchronizationFactory::fusion(
+ aRdvConf->ENV.inED, tmpED, (*itED));
+ if( anED.valid() )
+ {
+ fusionListOfED.append( anED );
+ }
+ }
+
+ }
+
+ tmpListOfED.splice(fusionListOfED);
+ }
+ }
+
+ if( isMulti )
+ {
+ mEffectiveMultiRdvCount += tmpListOfED.size();
+ }
+ else
+ {
+ mEffectiveRdvCount += tmpListOfED.size();
+ }
+ RDV.splice( tmpListOfED );
+
+ return( true );
+}
+
+
+
+bool AvmCommunicationRdvPrimitive::resume_rdv(ExecutionEnvironment & tmpENV)
+{
+ tmpENV.inED.mwsetAEES( AEES_STEP_RESUME );
+
+ sep::destroy( tmpENV.inED->mEXEC_SYNC_POINT );
+ tmpENV.inED->mEXEC_SYNC_POINT = NULL;
+
+ tmpENV.inED->mSTATEMENT_QUEUE.pushCache();
+
+ if( tmpENV.decode_resume() )
+ {
+ return( tmpENV.hasOutputSyncIrq() );
+ }
+ else
+ {
+ return( false );
+ }
+}
+
+
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmCommunicationRdvPrimitive.h b/org.eclipse.efm.symbex/src/computer/primitive/AvmCommunicationRdvPrimitive.h
new file mode 100644
index 0000000..b38e862
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmCommunicationRdvPrimitive.h
@@ -0,0 +1,435 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 8 nov. 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCOMMUNICATIONRDVPRIMITIVE_H_
+#define AVMCOMMUNICATIONRDVPRIMITIVE_H_
+
+#include <common/AvmObject.h>
+
+#include <collection/Bitset.h>
+
+#include <computer/primitive/BaseAvmPrimitive.h>
+
+#include <fml/runtime/ExecutionData.h>
+
+
+namespace sep
+{
+
+class ExecutionEnvironment;
+class InstanceOfConnect;
+class OutStream;
+
+
+class RdvConfigurationData :
+ public AvmObject,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( RdvConfigurationData )
+{
+
+public:
+ /**
+ * ATTRIBUTES
+ */
+ ExecutionEnvironment & ENV;
+
+ avm_size_t mMachineCount;
+
+ VectorOfListOfAPExecutionData IN_ED_RDV;
+ VectorOfListOfAPExecutionData OUT_ED_RDV;
+
+ VectorOfListOfAPExecutionData ED_MULTIRDV;
+
+ VectorOfListOfAPExecutionData RDVS;
+ bool hasPerformedRdvFlag;
+
+ Bitset mUsedMachineFlag;
+
+ Bitset mAwaitingInputRdvFlag;
+ Bitset mAwaitingOutputRdvFlag;
+
+ Bitset mAwaitingMultiRdvFlag;
+ Bitset mAwaitingInputMultiRdvFlag;
+ Bitset mAwaitingOutputMultiRdvFlag;
+
+ InstanceOfConnect * mConnector;
+ VectorOfAPExecutionData mAwaitingMultiRdvEDS;
+
+ bool hasPossibleInternalRdvFlag;
+ bool hasPossibleInternalMultiRdvFlag;
+
+
+public:
+ RdvConfigurationData(ExecutionEnvironment & aENV, avm_size_t machineCount)
+ : AvmObject(),
+ ENV( aENV ),
+ mMachineCount( machineCount ),
+
+ IN_ED_RDV( mMachineCount ),
+ OUT_ED_RDV( mMachineCount ),
+
+ ED_MULTIRDV( mMachineCount ),
+
+ RDVS( mMachineCount ),
+ hasPerformedRdvFlag( false ),
+
+ mUsedMachineFlag( mMachineCount , false ),
+
+ mAwaitingInputRdvFlag( mMachineCount , false ),
+ mAwaitingOutputRdvFlag( mMachineCount , false ),
+
+ mAwaitingMultiRdvFlag( mMachineCount , false ),
+ mAwaitingInputMultiRdvFlag( mMachineCount , false ),
+ mAwaitingOutputMultiRdvFlag( mMachineCount , false ),
+
+ mConnector( NULL ),
+ mAwaitingMultiRdvEDS( mMachineCount ),
+
+ hasPossibleInternalRdvFlag( false ),
+ hasPossibleInternalMultiRdvFlag( false )
+ {
+ //!! NOTHING
+ }
+
+
+ RdvConfigurationData(RdvConfigurationData * aRdvConf)
+ : AvmObject(),
+ ENV( aRdvConf->ENV ),
+ mMachineCount( aRdvConf->mMachineCount ),
+
+ IN_ED_RDV( mMachineCount ),
+ OUT_ED_RDV( mMachineCount ),
+
+ ED_MULTIRDV( mMachineCount ),
+
+ RDVS( mMachineCount ),
+ hasPerformedRdvFlag( false ),
+
+ mUsedMachineFlag( mMachineCount , false ),
+
+ mAwaitingInputRdvFlag( mMachineCount , false ),
+ mAwaitingOutputRdvFlag( mMachineCount , false ),
+
+ mAwaitingMultiRdvFlag( mMachineCount , false ),
+ mAwaitingInputMultiRdvFlag( mMachineCount , false ),
+ mAwaitingOutputMultiRdvFlag( mMachineCount , false ),
+
+ mConnector( NULL ),
+ mAwaitingMultiRdvEDS( mMachineCount ),
+
+ hasPossibleInternalRdvFlag( false ),
+ hasPossibleInternalMultiRdvFlag( false )
+ {
+ //!! NOTHING
+ }
+
+
+ RdvConfigurationData(const RdvConfigurationData & aRdvConfData)
+ : AvmObject( aRdvConfData ),
+ ENV( aRdvConfData.ENV ),
+ mMachineCount( aRdvConfData.mMachineCount ),
+
+ IN_ED_RDV( aRdvConfData.IN_ED_RDV ),
+ OUT_ED_RDV( aRdvConfData.OUT_ED_RDV ),
+
+ ED_MULTIRDV( aRdvConfData.ED_MULTIRDV ),
+
+ RDVS( aRdvConfData.RDVS ),
+ hasPerformedRdvFlag( aRdvConfData.hasPerformedRdvFlag ),
+
+ mUsedMachineFlag( aRdvConfData.mUsedMachineFlag ),
+
+ mAwaitingInputRdvFlag( aRdvConfData.mAwaitingInputRdvFlag ),
+ mAwaitingOutputRdvFlag( aRdvConfData.mAwaitingOutputRdvFlag ),
+
+ mAwaitingMultiRdvFlag( aRdvConfData.mAwaitingMultiRdvFlag ),
+ mAwaitingInputMultiRdvFlag( aRdvConfData.mAwaitingInputMultiRdvFlag ),
+ mAwaitingOutputMultiRdvFlag( aRdvConfData.mAwaitingOutputMultiRdvFlag ),
+
+ mConnector( aRdvConfData.mConnector ),
+ mAwaitingMultiRdvEDS( aRdvConfData.mAwaitingMultiRdvEDS ),
+
+ hasPossibleInternalRdvFlag( aRdvConfData.hasPossibleInternalRdvFlag ),
+ hasPossibleInternalMultiRdvFlag(
+ aRdvConfData.hasPossibleInternalMultiRdvFlag )
+ {
+ //!! NOTHING
+ }
+
+
+ RdvConfigurationData(const RdvConfigurationData & aRdvConfData,
+ RdvConfigurationData * aRdvConf)
+ : AvmObject( aRdvConfData ),
+ ENV( aRdvConfData.ENV ),
+ mMachineCount( aRdvConfData.mMachineCount ),
+
+ IN_ED_RDV( aRdvConfData.IN_ED_RDV ),
+ OUT_ED_RDV( aRdvConfData.OUT_ED_RDV ),
+
+ ED_MULTIRDV( aRdvConfData.ED_MULTIRDV ),
+
+ RDVS( aRdvConfData.RDVS ),
+ hasPerformedRdvFlag(
+ aRdvConfData.hasPerformedRdvFlag
+ | aRdvConf->hasPerformedRdvFlag ),
+
+ mUsedMachineFlag(
+ aRdvConfData.mAwaitingInputRdvFlag
+ | aRdvConf->mAwaitingInputRdvFlag ),
+
+ mAwaitingInputRdvFlag(
+ aRdvConfData.mAwaitingInputRdvFlag
+ | aRdvConf->mAwaitingInputRdvFlag ),
+
+ mAwaitingOutputRdvFlag(
+ aRdvConfData.mAwaitingOutputRdvFlag
+ | aRdvConf->mAwaitingOutputRdvFlag ),
+
+ mAwaitingMultiRdvFlag(
+ aRdvConfData.mAwaitingMultiRdvFlag
+ | aRdvConf->mAwaitingMultiRdvFlag ),
+
+ mAwaitingInputMultiRdvFlag(
+ aRdvConfData.mAwaitingInputMultiRdvFlag
+ | aRdvConf->mAwaitingInputMultiRdvFlag ),
+
+ mAwaitingOutputMultiRdvFlag(
+ aRdvConfData.mAwaitingOutputMultiRdvFlag
+ | aRdvConf->mAwaitingOutputMultiRdvFlag ),
+
+ mConnector( aRdvConfData.mConnector ),
+ mAwaitingMultiRdvEDS( aRdvConfData.mAwaitingMultiRdvEDS ),
+
+ hasPossibleInternalRdvFlag( false ),
+ hasPossibleInternalMultiRdvFlag( false )
+ {
+ updatePossibleInternalRdvFlag();
+ updatePossibleInternalMultiRdvFlag();
+ }
+
+
+ virtual ~RdvConfigurationData()
+ {
+ //!! NOTHING
+ }
+
+
+ RdvConfigurationData * fusion(RdvConfigurationData * aRdvConf);
+
+ void resize(avm_size_t newSize);
+
+
+ inline bool isComplete()
+ {
+ return( mAwaitingInputRdvFlag.none()
+ && mAwaitingOutputRdvFlag.none()
+ && mAwaitingMultiRdvFlag.none() );
+ }
+
+ inline void updatePossibleInternalRdvFlag()
+ {
+ hasPossibleInternalRdvFlag =
+ ( mAwaitingInputRdvFlag.any() && mAwaitingOutputRdvFlag.any() );
+ }
+
+ inline void updatePossibleInternalMultiRdvFlag()
+ {
+ hasPossibleInternalMultiRdvFlag =
+ ( mAwaitingInputMultiRdvFlag.any()
+ || mAwaitingOutputMultiRdvFlag.any() );
+ }
+
+
+ inline bool hasPossibleExternalRdv(RdvConfigurationData * aRdvConf)
+ {
+ return( (hasPerformedRdvFlag
+ || aRdvConf->hasPerformedRdvFlag)
+ && (mUsedMachineFlag & aRdvConf->mUsedMachineFlag).none()
+ && ( (mAwaitingInputRdvFlag.any()
+ && aRdvConf->mAwaitingOutputRdvFlag.any())
+ || (aRdvConf->mAwaitingInputRdvFlag.any()
+ && mAwaitingOutputRdvFlag.any()) ) );
+ }
+
+
+ inline bool hasPossibleExternalMultiRdv(RdvConfigurationData * aRdvConf)
+ {
+ return( (hasPerformedRdvFlag || aRdvConf->hasPerformedRdvFlag) &&
+ (mUsedMachineFlag & aRdvConf->mUsedMachineFlag).none() );
+ }
+
+
+ bool isMultiRdvComplete();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SERIALIZATION
+ ////////////////////////////////////////////////////////////////////////////
+ virtual void toStream(OutStream & os) const;
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+// TYPEDEF for COLLECTION
+////////////////////////////////////////////////////////////////////////////////
+
+DEFINE_LIST_PTR(RdvConfigurationData);
+
+DEFINE_VECTOR_PTR(RdvConfigurationData);
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+
+
+class AvmCommunicationRdvPrimitive : public BaseAvmPrimitive
+{
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ RdvConfigurationData & mBaseRdvConf;
+
+ bool checkRdvFlag;
+ bool checkMultiRdvFlag;
+
+
+ ListOfRdvConfigurationData PREVIOUS_RDV_CONF;
+ ListOfRdvConfigurationData CURRENT_RDV_CONF;
+ ListOfRdvConfigurationData NEXT_RDV_CONF;
+
+ ListOfAPExecutionData RDV;
+
+ avm_uint64_t mEffectiveRdvCount;
+ avm_uint64_t mEffectiveMultiRdvCount;
+
+
+public:
+ AvmCommunicationRdvPrimitive(AvmPrimitiveProcessor & aProcessor,
+ RdvConfigurationData & aRdvConf, bool checkRdv, bool checkMultiRdv)
+ : BaseAvmPrimitive( aProcessor ),
+ mBaseRdvConf( aRdvConf ),
+ checkRdvFlag( checkRdv ),
+ checkMultiRdvFlag( checkMultiRdv ),
+ PREVIOUS_RDV_CONF( ),
+ CURRENT_RDV_CONF( ),
+ NEXT_RDV_CONF( ),
+ RDV( ),
+
+ mEffectiveRdvCount( 0 ),
+ mEffectiveMultiRdvCount( 0 )
+ {
+ //!! NOTHING
+ }
+
+
+ virtual ~AvmCommunicationRdvPrimitive()
+ {
+ while( PREVIOUS_RDV_CONF.nonempty() )
+ {
+ delete( PREVIOUS_RDV_CONF.pop_last() );
+ }
+
+ while( CURRENT_RDV_CONF.nonempty() )
+ {
+ delete( CURRENT_RDV_CONF.pop_last() );
+ }
+
+ while( NEXT_RDV_CONF.nonempty() )
+ {
+ delete( NEXT_RDV_CONF.pop_last() );
+ }
+ }
+
+
+ /**
+ * COMPUTE ALL RDV
+ */
+ static bool computeRdv(AvmPrimitiveProcessor & aProcessor,
+ std::vector< ExecutionEnvironment > & tabOfENV);
+
+ /**
+ * the RESUME RDV instruction
+ */
+
+ bool haveRDV(APExecutionData & outED, APExecutionData & inED);
+
+ inline void updatePossibleInternalRdvFlags(RdvConfigurationData * aRdvConf)
+ {
+ if( checkRdvFlag )
+ {
+ aRdvConf->updatePossibleInternalRdvFlag();
+ }
+ if( checkMultiRdvFlag )
+ {
+ aRdvConf->updatePossibleInternalMultiRdvFlag();
+ }
+ }
+
+ bool resume_rdv(ListOfAPExecutionData & aRDV);
+
+ bool computeAllRdv();
+
+ bool completeAllRdv();
+
+ bool checkInternalRdv(bool isInitial, RdvConfigurationData * aRdvConf);
+ bool checkInternalMultiRDV(bool isInitial, RdvConfigurationData * aRdvConf);
+
+ bool checkWithInitialRdv(RdvConfigurationData * aRdvConf);
+ bool checkWithInitialMultiRdv(RdvConfigurationData * aRdvConf);
+
+ bool checkWithExternalRdv(RdvConfigurationData * aRdvConf,
+ RdvConfigurationData * otherRdvConf);
+ bool checkWithExternalMultiRdv(RdvConfigurationData * aRdvConf,
+ RdvConfigurationData * otherRdvConf);
+
+
+ bool compute_rdv(RdvConfigurationData * aRdvConf,
+ avm_offset_t outOffset, APExecutionData & outED,
+ avm_offset_t inOffset, APExecutionData & inED);
+
+ bool compute_multirdv(ListOfRdvConfigurationData & multiRdvConf);
+ bool compute_multirdv(RdvConfigurationData * aRdvConf);
+
+
+ void complete_rdv(RdvConfigurationData * & aRdvConf, bool isMulti = false);
+ void complete_multirdv(RdvConfigurationData * & aRdvConf);
+
+ bool completed_rdv(RdvConfigurationData * aRdvConf, bool isMulti);
+
+
+ bool resume_rdv(ExecutionEnvironment & ENV,
+ RdvConfigurationData * aRdvConf, avm_offset_t offset);
+
+ bool resume_rdv(ExecutionEnvironment & tmpENV);
+
+
+ /**
+ * GLOBALS
+ */
+ static avm_size_t GLOBAL_EFFECTIVE_RDV_COUNT;
+ static avm_size_t GLOBAL_EFFECTIVE_MULTI_RDV_COUNT;
+
+ static void reportGlobalStatistics(OutStream & os);
+
+};
+
+
+
+}
+
+#endif /* AVMCOMMUNICATIONRDVPRIMITIVE_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmConcurrencyPrimitive.cpp b/org.eclipse.efm.symbex/src/computer/primitive/AvmConcurrencyPrimitive.cpp
new file mode 100644
index 0000000..6d556dd
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmConcurrencyPrimitive.cpp
@@ -0,0 +1,1192 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmConcurrencyPrimitive.h"
+
+#include <computer/ExecutionEnvironment.h>
+
+#include <computer/primitive/AvmCommunicationRdvPrimitive.h>
+#include <computer/primitive/AvmSynchronizationFactory.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+
+/**
+ ***************************************************************************
+ * execution of an INTERLEAVING program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Interleaving::run(ExecutionEnvironment & ENV)
+{
+ AvmCode::const_iterator it = ENV.inCODE->begin();
+ AvmCode::const_iterator endIt = ENV.inCODE->end();
+ for( ; it != endIt ; ++it )
+ {
+ ENV.run( *it );
+ }
+
+ return( true );
+}
+
+bool AvmPrimitive_RdvInterleaving::run(ExecutionEnvironment & ENV)
+{
+ ExecutionEnvironment tmpENV(ENV, BFCode::REF_NULL);
+ APExecutionData tmpED;
+
+ RdvConfigurationData aRdvConf(ENV, ENV.inCODE->size());
+ bool checkRdv = false;
+ bool checkMultiRdv = false;
+
+ bool hasCom = false;
+
+ avm_offset_t idx = 0;
+
+ ListOfAPExecutionData listofRDV;
+
+ AvmCode::const_iterator it = ENV.inCODE->begin();
+ AvmCode::const_iterator endIt = ENV.inCODE->end();
+ for( ; it != endIt ; ++it )
+ {
+ if( not tmpENV.run(*it) )
+ {
+ return( false );
+ }
+
+// AVM_OS_COUT << "AvmPrimitive_RdvInterleaving::run :>" << std::endl;
+// tmpENV.toStream(AVM_OS_COUT);
+
+ while( tmpENV.syncEDS.nonempty() )
+ {
+ tmpENV.syncEDS.pop_first_to( tmpED );
+
+ switch( tmpED->mAEES )
+ {
+ case AEES_WAITING_INCOM_RDV:
+ {
+ hasCom = true;
+
+ if( tmpED->mEXEC_SYNC_POINT->mRoutingData.isProtocolRDV() )
+ {
+ aRdvConf.IN_ED_RDV[ idx ].append( tmpED );
+ aRdvConf.mAwaitingOutputRdvFlag[ idx ] = true;
+ checkRdv = true;
+ }
+ else if( tmpED->mEXEC_SYNC_POINT->mRoutingData.
+ isProtocolMULTI_RDV() )
+ {
+ aRdvConf.ED_MULTIRDV[ idx ].append( tmpED );
+ aRdvConf.mAwaitingOutputMultiRdvFlag[ idx ] = true;
+ checkMultiRdv = true;
+ }
+
+ break;
+ }
+
+ case AEES_WAITING_OUTCOM_RDV:
+ {
+ hasCom = true;
+
+ if( tmpED->mEXEC_SYNC_POINT->mRoutingData.isProtocolRDV() )
+ {
+ aRdvConf.OUT_ED_RDV[ idx ].append( tmpED );
+ aRdvConf.mAwaitingInputRdvFlag[ idx ] = true;
+ checkRdv = true;
+ }
+ else if( tmpED->mEXEC_SYNC_POINT->mRoutingData.
+ isProtocolMULTI_RDV() )
+ {
+ aRdvConf.ED_MULTIRDV[ idx ].append( tmpED );
+ aRdvConf.mAwaitingInputMultiRdvFlag[ idx ] = true;
+ checkMultiRdv = true;
+ }
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+
+ if( hasCom )
+ {
+ idx = idx + 1;
+
+ hasCom = false;
+ }
+ }
+
+ // output EDS traitement
+ ENV.spliceOutput(tmpENV);
+
+ // Sync EDS traitement
+ if( idx > 1 )
+ {
+ aRdvConf.resize( idx );
+
+ if( checkRdv )
+ {
+ aRdvConf.updatePossibleInternalRdvFlag();
+ }
+ if( checkMultiRdv )
+ {
+ aRdvConf.updatePossibleInternalMultiRdvFlag();
+ }
+
+ if( aRdvConf.hasPossibleInternalRdvFlag || aRdvConf.hasPossibleInternalMultiRdvFlag )
+ {
+ AvmCommunicationRdvPrimitive rdvComputer(PRIMITIVE_PROCESSOR, aRdvConf, checkRdv, checkMultiRdv);
+
+ if( rdvComputer.resume_rdv(listofRDV) )
+ {
+ ENV.outEDS.splice( listofRDV );
+ }
+ }
+ }
+
+ return( true );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of an ASYNCHRONOUS program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Asynchronous::run(ExecutionEnvironment & ENV)
+{
+ AVM_OS_FATAL_ERROR_EXIT
+ << "TODO Primitive< |a| >::run( ENV )"
+ " a.k.a ASynchronous::run( ENV ) !!!"
+ << SEND_EXIT;
+
+ AvmCode::const_iterator endIt = ENV.inCODE->end();
+ for( AvmCode::const_iterator it = ENV.inCODE->begin() ; it != endIt ; ++it )
+ {
+ ENV.run( *it );
+ }
+
+ return( true );
+}
+
+
+bool AvmPrimitive_RdvAsynchronous::run(ExecutionEnvironment & ENV)
+{
+ AVM_OS_FATAL_ERROR_EXIT
+ << "TODO Primitive< ||a|| >::run( ENV )"
+ " a.k.a RDV< ASynchronous >::run( ENV ) !!!"
+ << SEND_EXIT;
+
+ AvmCode::const_iterator endIt = ENV.inCODE->end();
+ for( AvmCode::const_iterator it = ENV.inCODE->begin() ; it != endIt ; ++it )
+ {
+ ENV.run( *it );
+ }
+
+ return( true );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of a STRONG SYNCHRONOUS program
+ ***************************************************************************
+ */
+bool AvmPrimitive_StrongSynchronous::run(ExecutionEnvironment & ENV)
+{
+ ListOfAPExecutionData tmpListOfED;
+
+ ListOfAPExecutionData fusionListOfOutputED;
+
+ ListOfAPExecutionData::iterator itED;
+ ListOfAPExecutionData::iterator endItED;
+
+ APExecutionData tmpED;
+ APExecutionData anED;
+
+ AvmCode::const_iterator itEnd = ENV.inCODE->end();
+ AvmCode::const_iterator it = ENV.inCODE->begin();
+
+ // Initialisation du process
+ ExecutionEnvironment tmpENV(ENV, *it);
+ if( not tmpENV.run() )
+ {
+ return( false );
+ }
+
+ if( tmpENV.outEDS.nonempty() )
+ {
+ tmpListOfED.splice( tmpENV.outEDS );
+ }
+ else
+ {
+ // if an execution fail, this execution fail to!!!!!
+ return( false );
+ }
+
+ for( ++it ; it != itEnd ; ++it )
+ {
+ if( not tmpENV.run(*it) )
+ {
+ return( false );
+ }
+
+ if( tmpENV.outEDS.empty() )
+ {
+ // if a local execution fail, this global execution fail to!!!!!
+ return( false );
+ }
+
+
+ // COMPUTE STRONG FUSION
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ AVM_OS_TRACE << "<< " << ENV.inED->mRID.strUniqId()
+ << " |=> strong fusion for ED :> "
+ << "frstList( " << tmpENV.outEDS.size() << " )" << " with "
+ << "scndList( " << tmpListOfED.size() << " )" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+
+ if( tmpListOfED.empty() )
+ {
+ tmpListOfED.splice(tmpENV.outEDS);
+ }
+ else if( tmpENV.outEDS.nonempty() )
+ {
+ do
+ {
+ tmpENV.outEDS.pop_first_to( tmpED );
+
+ endItED = tmpListOfED.end();
+ for ( itED = tmpListOfED.begin() ; itED != endItED ; ++itED )
+ {
+ anED = AvmSynchronizationFactory::fusion(
+ ENV.inED, tmpED, (*itED));
+ if( anED.valid() )
+ {
+ fusionListOfOutputED.append( anED );
+ }
+ }
+ }
+ while( tmpENV.outEDS.nonempty() );
+
+ tmpListOfED.clear();
+ tmpListOfED.splice(fusionListOfOutputED);
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ AVM_OS_TRACE << ">> " << ENV.inED->mRID.strUniqId()
+ << " |=> result( " << tmpListOfED.size() << " )" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ }
+
+ ENV.outEDS.splice( tmpListOfED );
+
+ return( true );
+}
+
+
+bool AvmPrimitive_RdvStrongSynchronous::run(ExecutionEnvironment & ENV)
+{
+ AVM_OS_FATAL_ERROR_EXIT
+ << "TODO Primitive< ||and|| >::run( ENV )"
+ " a.k.a RDV< StrongSynchronous >::run( ENV ) !!!"
+ << SEND_EXIT;
+
+ AvmCode::const_iterator endIt = ENV.inCODE->end();
+ for( AvmCode::const_iterator it = ENV.inCODE->begin() ; it != endIt ; ++it )
+ {
+ ENV.run( *it );
+ }
+
+ return( true );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of a WEAK SYNCHRONOUS program
+ ***************************************************************************
+ */
+bool AvmPrimitive_WeakSynchronous::run(ExecutionEnvironment & ENV)
+{
+ ENV.inED->setEnabledLocalNodeCondition( true );
+
+ ListOfAPExecutionData oneListOfED;
+ ListOfAPExecutionData otherListOfED;
+ ListOfAPExecutionData resultListOfED;
+
+ AvmCode::const_iterator it = ENV.inCODE->begin();
+ AvmCode::const_iterator itEnd = ENV.inCODE->end();
+
+ // Initialisation du process
+ ExecutionEnvironment tmpENV(ENV, *it);
+ if( not tmpENV.run() )
+ {
+ return( false );
+ }
+ oneListOfED.splice( tmpENV.outEDS );
+
+ // Recurrence
+ for( ++it ; it != itEnd ; ++it )
+ {
+ if( not tmpENV.run(*it) )
+ {
+ return( false );
+ }
+
+ computeWeakSynchronous(ENV.inED,
+ oneListOfED, tmpENV.outEDS, resultListOfED);
+
+ oneListOfED.clear();
+ otherListOfED.clear();
+ while( resultListOfED.nonempty() )
+ {
+ resultListOfED.last()->setEnabledLocalNodeCondition( false );
+
+ oneListOfED.append( resultListOfED.pop_last() );
+ }
+ }
+
+ ENV.inED->setEnabledLocalNodeCondition( false );
+
+ ENV.outEDS.splice( oneListOfED );
+
+ return( true );
+}
+
+
+
+bool AvmPrimitive_WeakSynchronous::computeWeakSynchronous(
+ APExecutionData & anInputED, ListOfAPExecutionData & oneListOfED,
+ ListOfAPExecutionData & otherListOfED,
+ ListOfAPExecutionData & resultListOfED)
+{
+ if( otherListOfED.empty() )
+ {
+ resultListOfED.splice( oneListOfED );
+ }
+
+ else if( oneListOfED.empty() )
+ {
+ resultListOfED.splice( otherListOfED );
+ }
+
+ else
+ {
+ ListOfAPExecutionData::iterator itOther = otherListOfED.begin();
+ ListOfAPExecutionData::iterator endOther = otherListOfED.end();
+ for( ; itOther != endOther ; ++itOther )
+ {
+ if( not computeWeakSynchronous(anInputED,
+ *itOther, oneListOfED, resultListOfED) )
+ {
+ return( false );
+ }
+ }
+ }
+
+ resultListOfED.makeUnique();
+
+ return( true );
+}
+
+
+bool AvmPrimitive_WeakSynchronous::computeWeakSynchronous(
+ APExecutionData & anInputED, APExecutionData & oneED,
+ ListOfAPExecutionData & listOfOtherED,
+ CollectionOfAPExecutionData & listOfOutputED)
+{
+ APExecutionData anED;
+
+ ListOfAPExecutionData::iterator itOther;
+ ListOfAPExecutionData::iterator endOther = listOfOtherED.end();
+
+ // Fusion with OTHERS
+ for( itOther = listOfOtherED.begin() ; itOther != endOther ; ++itOther )
+ {
+ anED = AvmSynchronizationFactory::fusion(anInputED, oneED, *itOther);
+ if( anED != NULL )
+ {
+ listOfOutputED.append( anED );
+ }
+ }
+
+ // Compute OTHER where NOT ONE
+ if( not evalExclusive(anInputED, listOfOtherED, oneED, listOfOutputED) )
+ {
+ return( false );
+ }
+
+
+ // Compute ONE where NOT OTHERS
+ return( evalExclusive(anInputED, oneED, listOfOtherED, listOfOutputED) );
+}
+
+
+bool AvmPrimitive_WeakSynchronous::computeWeakSynchronous(
+ APExecutionData & anInputED, APExecutionData & oneED,
+ APExecutionData & otherED,
+ CollectionOfAPExecutionData & listOfOutputED)
+{
+ APExecutionData anED = AvmSynchronizationFactory::fusion(
+ anInputED, oneED, otherED);
+ if( anED.valid() )
+ {
+ listOfOutputED.append( anED );
+ }
+
+ // Compute OTHER where NOT ONE
+ if( not evalExclusive(anInputED, otherED, oneED, listOfOutputED) )
+ {
+ return( false );
+ }
+
+ // Compute ONE where NOT OTHERS
+ return( evalExclusive(anInputED, oneED, otherED, listOfOutputED) );
+}
+
+
+bool AvmPrimitive_RdvWeakSynchronous::run(ExecutionEnvironment & ENV)
+{
+ AVM_OS_FATAL_ERROR_EXIT
+ << "TODO Primitive< ||or|| >::run( ENV )"
+ " a.k.a RDV< WeakSynchronous >::run( ENV ) !!!"
+ << SEND_EXIT;
+
+ AvmCode::const_iterator endIt = ENV.inCODE->end();
+ for( AvmCode::const_iterator it = ENV.inCODE->begin() ; it != endIt ; ++it )
+ {
+ ENV.run( *it );
+ }
+
+ return( true );
+}
+
+
+
+
+
+/**
+ ***************************************************************************
+ * execution of a PARALLEL program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Parallel::run(ExecutionEnvironment & ENV)
+{
+// avm_offset_t idx;
+//
+// std::vector< ExecutionEnvironment > tabOfENV(
+// ENV.inCODE->size(), ExecutionEnvironment(ENV, ENV.inED) );
+//
+// AvmCode::const_iterator it = ENV.inCODE->begin();
+// AvmCode::const_iterator itEnd = ENV.inCODE->end();
+//
+// // Cas de l'éventuel premier exitEDS
+// for( idx = 0 ; it != itEnd ; ++it, ++idx )
+// {
+// if( not tabOfENV[idx].run(*it) )
+// {
+// return( false );
+// }
+// }
+
+ ListOfAPExecutionData fusionListOfOutputED;
+ ListOfAPExecutionData parallelOutputED;
+
+ ListOfAPExecutionData fusionListOfExitED;
+ ListOfAPExecutionData parallelExitED;
+
+ AvmCode::const_iterator it = ENV.inCODE->begin();
+ AvmCode::const_iterator itEnd = ENV.inCODE->end();
+
+ // Cas de l'éventuel premier exitEDS
+ for( ; (it != itEnd) && parallelExitED.empty() ; ++it )
+ {
+ ExecutionEnvironment tmpENV(ENV, *it);
+ if( tmpENV.run() )
+ {
+ ENV.spliceNotOutputExit(tmpENV);
+
+ if( tmpENV.exitEDS.nonempty() )
+ {
+ computeParallel(ENV.inED, tmpENV.exitEDS,
+ parallelOutputED, parallelExitED);
+ }
+
+ if( tmpENV.outEDS.nonempty() )
+ {
+ computeParallel(ENV.inED, tmpENV.outEDS,
+ parallelOutputED, fusionListOfOutputED);
+
+ parallelOutputED.clear();
+ parallelOutputED.splice(fusionListOfOutputED);
+ }
+ else if( tmpENV.exitEDS.nonempty() )
+ {
+ parallelOutputED.clear();
+ }
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ // Cas de cohabitation outEDS et exitEDS
+ for( ; (it != itEnd) && parallelOutputED.nonempty() ; ++it )
+ {
+ ExecutionEnvironment tmpENV(ENV, *it);
+ if( tmpENV.run() )
+ {
+ ENV.spliceNotOutputExit(tmpENV);
+
+ if( tmpENV.outEDS.nonempty() )
+ {
+ // Composition entre << purs Output >>
+ computeParallel(ENV.inED, tmpENV.outEDS,
+ parallelOutputED, fusionListOfOutputED);
+
+ // Composition avec les << Exit précédents >>
+ computeParallel(ENV.inED, tmpENV.outEDS,
+ parallelExitED, fusionListOfExitED);
+ }
+
+ if( tmpENV.exitEDS.nonempty() )
+ {
+ // Composition avec les << Output précédents >>
+ computeParallel(ENV.inED, tmpENV.exitEDS,
+ parallelOutputED, fusionListOfExitED);
+
+ // Composition entre << purs Exit >>
+ computeParallel(ENV.inED, tmpENV.exitEDS,
+ parallelExitED, fusionListOfExitED);
+
+ }
+
+ if( tmpENV.outEDS.nonempty() || tmpENV.exitEDS.nonempty() )
+ {
+ parallelOutputED.clear();
+ parallelOutputED.splice(fusionListOfOutputED);
+
+ parallelExitED.clear();
+ parallelExitED.splice(fusionListOfExitED);
+ }
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ // Cas ou tout le monde est contaminé par exitEDS
+ for( ; it != itEnd ; ++it )
+ {
+ ExecutionEnvironment tmpENV(ENV, *it);
+ if( tmpENV.run() )
+ {
+ ENV.spliceNotOutputExit(tmpENV);
+
+ if( tmpENV.outEDS.nonempty() )
+ {
+ computeParallel(ENV.inED, tmpENV.outEDS,
+ parallelExitED, fusionListOfExitED);
+ }
+ if( tmpENV.exitEDS.nonempty() )
+ {
+ computeParallel(ENV.inED, tmpENV.exitEDS,
+ parallelExitED, fusionListOfExitED);
+ }
+
+ if( tmpENV.outEDS.nonempty() || tmpENV.exitEDS.nonempty() )
+ {
+ parallelExitED.clear();
+ parallelExitED.splice(fusionListOfExitED);
+ }
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+
+ ENV.outEDS.splice( parallelOutputED );
+ ENV.exitEDS.splice( parallelExitED );
+
+ return( true );
+}
+
+
+void AvmPrimitive_Parallel::computeParallel(APExecutionData & refED,
+ ListOfAPExecutionData & outEDS,
+ ListOfAPExecutionData & prevParallelListOfOutputED,
+ ListOfAPExecutionData & listOfOutputED)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ AVM_OS_TRACE << "<< " << refED->mRID.strUniqId()
+ << " |=> parallel fusion for ED :> "
+ << "frstList( " << outEDS.size() << " ) with "
+ << "scndList( " << prevParallelListOfOutputED.size()
+ << " )" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+
+ if( prevParallelListOfOutputED.empty() )
+ {
+ listOfOutputED.splice(outEDS);
+ }
+ else if( outEDS.empty() )
+ {
+ listOfOutputED.splice(prevParallelListOfOutputED);
+ }
+ else
+ {
+ ListOfAPExecutionData::iterator itOutED;
+ ListOfAPExecutionData::iterator endOutED;
+
+ APExecutionData anED;
+
+ ListOfAPExecutionData::iterator itParallelED =
+ prevParallelListOfOutputED.begin();
+ ListOfAPExecutionData::iterator endParallelED =
+ prevParallelListOfOutputED.end();
+ endOutED = outEDS.end();
+ for( ; itParallelED != endParallelED ; ++itParallelED )
+ {
+ for( itOutED = outEDS.begin() ; itOutED != endOutED ; ++itOutED )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ AVM_OS_TRACE << "ED<frst> "
+ << (*itParallelED)->getRunnableElementTrace().str()
+ << std::endl << "ED<scnd> "
+ << (*itOutED)->getRunnableElementTrace().str()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ anED = AvmSynchronizationFactory::fusion(
+ refED, *itParallelED, *itOutED);
+ if( anED.valid() )
+ {
+ listOfOutputED.append( anED );
+ }
+ }
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+ AVM_OS_TRACE << ">> " << refED->mRID.strUniqId() << " |=> result( "
+ << listOfOutputED.size() << " )" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , COMPUTING , STATEMENT )
+}
+
+
+
+
+bool AvmPrimitive_RdvParallel::run(ExecutionEnvironment & ENV)
+{
+// avm_offset_t idx;
+//
+// std::vector< ExecutionEnvironment > tabOfENV(
+// ENV.inCODE->size(), ExecutionEnvironment(ENV, ENV.inED) );
+//
+// AvmCode::const_iterator it = ENV.inCODE->begin();
+// AvmCode::const_iterator itEnd = ENV.inCODE->end();
+//
+// // Cas de l'éventuel premier exitEDS
+// for( idx = 0 ; it != itEnd ; ++it, ++idx )
+// {
+// if( not tabOfENV[idx].run(*it) )
+// {
+// return( false );
+// }
+// }
+//
+// if( AvmCommunicationRdvPrimitive::computeRdv(PRIMITIVE_PROCESSOR, tabOfENV) )
+// {
+// computeParallel(ENV.inED, listofRDV,
+// parallelOutputED, fusionListOfOutputED);
+//
+// parallelOutputED.clear();
+// parallelOutputED.splice(fusionListOfOutputED);
+// }
+// else
+// {
+// return( false );
+// }
+
+
+ ListOfAPExecutionData fusionListOfOutputED;
+ ListOfAPExecutionData parallelOutputED;
+
+ ListOfAPExecutionData fusionListOfExitED;
+ ListOfAPExecutionData parallelExitED;
+
+ RdvConfigurationData aRdvConf(ENV, ENV.inCODE->size());
+ bool checkRdv = false;
+ bool checkMultiRdv = false;
+
+ bool hasCom = false;
+
+ avm_offset_t idx = 0;
+
+ ListOfAPExecutionData listofRDV;
+
+
+ AvmCode::const_iterator it = ENV.inCODE->begin();
+ AvmCode::const_iterator itEnd = ENV.inCODE->end();
+
+ // Cas de l'éventuel premier exitEDS
+ for( ; (it != itEnd) && parallelExitED.empty() ; ++it )
+ {
+ ExecutionEnvironment tmpENV(ENV, *it);
+ if( tmpENV.run() )
+ {
+ if( tmpENV.exitEDS.nonempty() )
+ {
+ computeParallel(ENV.inED, tmpENV.exitEDS,
+ parallelOutputED, parallelExitED);
+ }
+
+ if( tmpENV.outEDS.nonempty() )
+ {
+ computeParallel(ENV.inED, tmpENV.outEDS,
+ parallelOutputED, fusionListOfOutputED);
+
+ parallelOutputED.clear();
+ parallelOutputED.splice(fusionListOfOutputED);
+ }
+ else if( tmpENV.exitEDS.nonempty() )
+ {
+ parallelOutputED.clear();
+ }
+
+ if( tmpENV.syncEDS.nonempty() )
+ {
+ configureRdv(aRdvConf, tmpENV.syncEDS,
+ checkRdv, checkMultiRdv, hasCom, idx);
+ }
+
+ ENV.spliceNotOutputExit(tmpENV);
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ // Cas de cohabitation outEDS et exitEDS
+ for( ; (it != itEnd) && parallelOutputED.nonempty() ; ++it )
+ {
+ ExecutionEnvironment tmpENV(ENV, *it);
+ if( tmpENV.run() )
+ {
+ if( tmpENV.outEDS.nonempty() )
+ {
+ // Composition entre << purs Output >>
+ computeParallel(ENV.inED, tmpENV.outEDS,
+ parallelOutputED, fusionListOfOutputED);
+
+ // Composition avec les << Exit précédents >>
+ computeParallel(ENV.inED, tmpENV.outEDS,
+ parallelExitED, fusionListOfExitED);
+ }
+
+ if( tmpENV.exitEDS.nonempty() )
+ {
+ // Composition avec les << Output précédents >>
+ computeParallel(ENV.inED, tmpENV.outEDS,
+ parallelOutputED, fusionListOfExitED);
+
+ // Composition entre << purs Exit >>
+ computeParallel(ENV.inED, tmpENV.exitEDS,
+ parallelExitED, fusionListOfExitED);
+
+ }
+
+ if( tmpENV.outEDS.nonempty() || tmpENV.exitEDS.nonempty() )
+ {
+ parallelOutputED.clear();
+ parallelOutputED.splice(fusionListOfOutputED);
+
+ parallelExitED.clear();
+ parallelExitED.splice(fusionListOfExitED);
+ }
+
+ if( tmpENV.syncEDS.nonempty() )
+ {
+ configureRdv(aRdvConf, tmpENV.syncEDS,
+ checkRdv, checkMultiRdv, hasCom, idx);
+ }
+
+ ENV.spliceNotOutputExit(tmpENV);
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ // Cas ou tout le monde est contaminé par exitEDS
+ for( ; it != itEnd ; ++it )
+ {
+ ExecutionEnvironment tmpENV(ENV, *it);
+ if( tmpENV.run() )
+ {
+ if( tmpENV.outEDS.nonempty() )
+ {
+ computeParallel(ENV.inED, tmpENV.outEDS,
+ parallelExitED, fusionListOfExitED);
+ }
+ if( tmpENV.exitEDS.nonempty() )
+ {
+ computeParallel(ENV.inED, tmpENV.exitEDS,
+ parallelExitED, fusionListOfExitED);
+ }
+
+ if( tmpENV.outEDS.nonempty() || tmpENV.exitEDS.nonempty() )
+ {
+ parallelExitED.clear();
+ parallelExitED.splice(fusionListOfExitED);
+ }
+
+ if( tmpENV.syncEDS.nonempty() )
+ {
+ configureRdv(aRdvConf, tmpENV.syncEDS,
+ checkRdv, checkMultiRdv, hasCom, idx);
+ }
+
+ ENV.spliceNotOutputExit(tmpENV);
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+
+ if( idx > 1 )
+ {
+ aRdvConf.resize( idx );
+
+ if( checkRdv )
+ {
+ aRdvConf.updatePossibleInternalRdvFlag();
+ }
+ if( checkMultiRdv )
+ {
+ aRdvConf.updatePossibleInternalMultiRdvFlag();
+ }
+
+ if( aRdvConf.hasPossibleInternalRdvFlag ||
+ aRdvConf.hasPossibleInternalMultiRdvFlag )
+ {
+ AvmCommunicationRdvPrimitive rdvComputer(PRIMITIVE_PROCESSOR,
+ aRdvConf, checkRdv, checkMultiRdv);
+
+ if( rdvComputer.resume_rdv(listofRDV) )
+ {
+ computeParallel(ENV.inED, listofRDV,
+ parallelOutputED, fusionListOfOutputED);
+
+ parallelOutputED.clear();
+ parallelOutputED.splice(fusionListOfOutputED);
+ }
+ }
+ }
+
+
+ ENV.outEDS.splice( parallelOutputED );
+ ENV.exitEDS.splice( parallelExitED );
+
+ return( true );
+}
+
+
+void AvmPrimitive_RdvParallel::configureRdv(RdvConfigurationData & aRdvConf,
+ ListOfAPExecutionData & syncEDS, bool & checkRdv,
+ bool & checkMultiRdv, bool & hasCom, avm_offset_t & idx)
+{
+ APExecutionData tmpED;
+
+ while( syncEDS.nonempty() )
+ {
+ syncEDS.pop_first_to( tmpED );
+
+ switch( tmpED->mAEES )
+ {
+ case AEES_WAITING_INCOM_RDV:
+ {
+ hasCom = true;
+
+ if( tmpED->mEXEC_SYNC_POINT->mRoutingData.isProtocolRDV() )
+ {
+ aRdvConf.IN_ED_RDV[ idx ].append( tmpED );
+ aRdvConf.mAwaitingOutputRdvFlag[ idx ] = true;
+ checkRdv = true;
+ }
+ else if( tmpED->mEXEC_SYNC_POINT->mRoutingData.isProtocolMULTI_RDV() )
+ {
+ aRdvConf.ED_MULTIRDV[ idx ].append( tmpED );
+ aRdvConf.mAwaitingOutputMultiRdvFlag[ idx ] = true;
+ checkMultiRdv = true;
+ }
+
+ break;
+ }
+
+ case AEES_WAITING_OUTCOM_RDV:
+ {
+ hasCom = true;
+
+ if( tmpED->mEXEC_SYNC_POINT->mRoutingData.isProtocolRDV() )
+ {
+ aRdvConf.OUT_ED_RDV[ idx ].append( tmpED );
+ aRdvConf.mAwaitingInputRdvFlag[ idx ] = true;
+ checkRdv = true;
+ }
+ else if( tmpED->mEXEC_SYNC_POINT->mRoutingData.isProtocolMULTI_RDV() )
+ {
+ aRdvConf.ED_MULTIRDV[ idx ].append( tmpED );
+ aRdvConf.mAwaitingInputMultiRdvFlag[ idx ] = true;
+ checkMultiRdv = true;
+ }
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+ }
+ }
+ }
+
+ if( hasCom )
+ {
+ idx = idx + 1;
+
+ hasCom = false;
+ }
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of a PRODUCT program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Product::run(ExecutionEnvironment & ENV)
+{
+ ENV.inED->setEnabledLocalNodeCondition( true );
+
+ ListOfAPExecutionData oneListOfED;
+ ListOfAPExecutionData otherListOfED;
+ ListOfAPExecutionData resultListOfED;
+
+ AvmCode::const_iterator it = ENV.inCODE->begin();
+ AvmCode::const_iterator itEnd = ENV.inCODE->end();
+
+ // Initialisation du process
+ ExecutionEnvironment tmpENV(ENV, *it);
+ if( not tmpENV.run() )
+ {
+ return( false );
+ }
+ oneListOfED.splice( tmpENV.outEDS );
+
+ // Recurrence
+ for( ++it ; it != itEnd ; ++it )
+ {
+ if( not tmpENV.run(*it) )
+ {
+ return( false );
+ }
+
+ computeProduct(ENV.inED, oneListOfED, tmpENV.outEDS, resultListOfED);
+
+ oneListOfED.clear();
+ otherListOfED.clear();
+ while( resultListOfED.nonempty() )
+ {
+ resultListOfED.last()->setEnabledLocalNodeCondition( false );
+
+ oneListOfED.append( resultListOfED.pop_last() );
+ }
+ }
+
+ ENV.inED->setEnabledLocalNodeCondition( false );
+
+ ENV.outEDS.splice( oneListOfED );
+
+ return( true );
+}
+
+
+
+bool AvmPrimitive_Product::computeProduct(APExecutionData & anInputED,
+ ListOfAPExecutionData & oneListOfED,
+ ListOfAPExecutionData & otherListOfED,
+ ListOfAPExecutionData & resultListOfED)
+{
+ if( otherListOfED.empty() )
+ {
+ resultListOfED.splice( oneListOfED );
+ }
+
+ else if( oneListOfED.empty() )
+ {
+ resultListOfED.splice( otherListOfED );
+ }
+
+ else
+ {
+ ListOfAPExecutionData::iterator itOther = otherListOfED.begin();
+ ListOfAPExecutionData::iterator endOther = otherListOfED.end();
+ for( ; itOther != endOther ; ++itOther )
+ {
+ if( not computeProduct(anInputED,
+ *itOther, oneListOfED, resultListOfED) )
+ {
+ return( false );
+ }
+ }
+ }
+
+ resultListOfED.makeUnique();
+
+ return( true );
+}
+
+
+bool AvmPrimitive_Product::computeProduct(
+ APExecutionData & anInputED, APExecutionData & oneED,
+ ListOfAPExecutionData & listOfOtherED,
+ CollectionOfAPExecutionData & listOfOutputED)
+{
+ APExecutionData anED;
+
+ ListOfAPExecutionData::iterator itOther;
+ ListOfAPExecutionData::iterator endOther = listOfOtherED.end();
+
+ // Fusion with OTHERS
+ for( itOther = listOfOtherED.begin() ; itOther != endOther ; ++itOther )
+ {
+ anED = AvmSynchronizationFactory::fusion(anInputED, oneED, *itOther);
+ if( anED.valid() )
+ {
+ listOfOutputED.append( anED );
+ }
+ }
+
+ // Compute OTHER where NOT ONE
+ if( not evalExclusive(anInputED, listOfOtherED, oneED, listOfOutputED) )
+ {
+ return( false );
+ }
+
+
+ // Compute ONE where NOT OTHERS
+ return( evalExclusive(anInputED, oneED, listOfOtherED, listOfOutputED) );
+}
+
+
+bool AvmPrimitive_Product::computeProduct(APExecutionData & anInputED,
+ APExecutionData & oneED, APExecutionData & otherED,
+ CollectionOfAPExecutionData & listOfOutputED)
+{
+ APExecutionData anED = AvmSynchronizationFactory::fusion(
+ anInputED, oneED, otherED);
+ if( anED.valid() )
+ {
+ listOfOutputED.append( anED );
+ }
+
+ // Compute OTHER where NOT ONE
+ if( not evalExclusive(anInputED, otherED, oneED, listOfOutputED) )
+ {
+ return( false );
+ }
+
+ // Compute ONE where NOT OTHERS
+ return( evalExclusive(anInputED, oneED, otherED, listOfOutputED) );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of a SYNCHRONIZE program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Synchronize::run(ExecutionEnvironment & ENV)
+{
+ ExecutionEnvironment tmpENV(ENV, ENV.inCODE->first());
+
+ if( not tmpENV.run( ENV.inCODE->first() ) )
+ {
+ return( false );
+ }
+
+ APExecutionData tmpED;
+ while( tmpENV.syncEDS.nonempty() )
+ {
+ tmpENV.syncEDS.pop_first_to( tmpED );
+
+ switch( tmpED->mAEES )
+ {
+ case AEES_WAITING_INCOM_RDV:
+ case AEES_WAITING_OUTCOM_RDV:
+ case AEES_WAITING_JOIN_FORK:
+ {
+ break;
+ }
+
+ default:
+ {
+ ENV.outEDS.append(tmpED);
+
+ break;
+ }
+ }
+ }
+
+ ENV.spliceOutput(tmpENV);
+ ENV.spliceNotOutput(tmpENV);
+
+ return( true );
+}
+
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmConcurrencyPrimitive.h b/org.eclipse.efm.symbex/src/computer/primitive/AvmConcurrencyPrimitive.h
new file mode 100644
index 0000000..cfbd40e
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmConcurrencyPrimitive.h
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCONCURRENCYPRIMITIVE_H_
+#define AVMCONCURRENCYPRIMITIVE_H_
+
+#include <computer/primitive/AvmBaseConcurrencyPrimitive.h>
+#include <computer/primitive/BaseAvmPrimitive.h>
+
+#include <fml/runtime/ExecutionData.h>
+
+
+
+namespace sep
+{
+
+
+class RdvConfigurationData;
+
+
+AVM_PRIMITIVE_RUN_CLASS(Interleaving, BaseAvmPrimitive)
+AVM_PRIMITIVE_RUN_CLASS(RdvInterleaving, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(Asynchronous, BaseAvmPrimitive)
+AVM_PRIMITIVE_RUN_CLASS(RdvAsynchronous, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(StrongSynchronous, BaseAvmPrimitive)
+AVM_PRIMITIVE_RUN_CLASS(RdvStrongSynchronous, BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_RUN_CLASS_HEADER(WeakSynchronous, AvmBaseConcurrencyPrimitive)
+ bool computeWeakSynchronous(APExecutionData & anInputED,
+ APExecutionData & oneED, APExecutionData & otherED,
+ CollectionOfAPExecutionData & listOfOutputED);
+
+ bool computeWeakSynchronous(
+ APExecutionData & anInputED, APExecutionData & oneED,
+ ListOfAPExecutionData & listOfOtherED,
+ CollectionOfAPExecutionData & listOfOutputED);
+
+ bool computeWeakSynchronous(APExecutionData & anInputED,
+ ListOfAPExecutionData & oneListOfED,
+ ListOfAPExecutionData & otherListOfED,
+ ListOfAPExecutionData & resultListOfED);
+};
+
+AVM_PRIMITIVE_RUN_CLASS(RdvWeakSynchronous, AvmPrimitive_WeakSynchronous)
+
+
+
+AVM_PRIMITIVE_RUN_CLASS_HEADER(Parallel, BaseAvmPrimitive)
+ void computeParallel(APExecutionData & refED,
+ ListOfAPExecutionData & outEDS,
+ ListOfAPExecutionData & parallelListOfOutputED,
+ ListOfAPExecutionData & listOfOutputED);
+};
+
+AVM_PRIMITIVE_RUN_CLASS_HEADER(RdvParallel, AvmPrimitive_Parallel)
+ void configureRdv(RdvConfigurationData & aRdvConf,
+ ListOfAPExecutionData & syncEDS, bool & checkRdv,
+ bool & checkMultiRdv, bool & hasCom, avm_offset_t & idx);
+};
+
+
+
+
+AVM_PRIMITIVE_RUN_CLASS_HEADER(Product, AvmBaseConcurrencyPrimitive)
+ bool computeProduct(APExecutionData & anInputED, APExecutionData & oneED,
+ APExecutionData & otherED,
+ CollectionOfAPExecutionData & listOfOutputED);
+
+ bool computeProduct(APExecutionData & anInputED, APExecutionData & oneED,
+ ListOfAPExecutionData & listOfOtherED,
+ CollectionOfAPExecutionData & listOfOutputED);
+
+ bool computeProduct(APExecutionData & anInputED,
+ ListOfAPExecutionData & oneListOfED,
+ ListOfAPExecutionData & otherListOfED,
+ ListOfAPExecutionData & resultListOfED);
+};
+
+
+
+AVM_PRIMITIVE_RUN_CLASS(Synchronize, BaseAvmPrimitive)
+
+
+
+}
+
+#endif /* AVMCONCURRENCYPRIMITIVE_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmCtorPrimitive.cpp b/org.eclipse.efm.symbex/src/computer/primitive/AvmCtorPrimitive.cpp
new file mode 100644
index 0000000..fef0ef8
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmCtorPrimitive.cpp
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 12 avr. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmCtorPrimitive.h"
+
+#include <computer/EvaluationEnvironment.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+
+
+namespace sep
+{
+
+
+bool AvmPrimitive_Ctor::seval(EvaluationEnvironment & ENV)
+{
+ switch( ENV.inCODE->first().to_ptr<
+ BaseTypeSpecifier >()->getTypeSpecifierKind() )
+ {
+ case TYPE_OPERATOR_SPECIFIER:
+ case TYPE_AVMCODE_SPECIFIER:
+ case TYPE_PORT_SPECIFIER:
+ case TYPE_BUFFER_SPECIFIER:
+ case TYPE_CONNECTOR_SPECIFIER:
+ case TYPE_MACHINE_SPECIFIER:
+ return( false );
+
+ case TYPE_MESSAGE_SPECIFIER:
+ return( false );
+
+ default:
+ return( false );
+ }
+
+ return( false );
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmCtorPrimitive.h b/org.eclipse.efm.symbex/src/computer/primitive/AvmCtorPrimitive.h
new file mode 100644
index 0000000..e59ab30
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmCtorPrimitive.h
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 12 avr. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCTORPRIMITIVE_H_
+#define AVMCTORPRIMITIVE_H_
+
+#include <computer/primitive/BaseAvmPrimitive.h>
+
+
+namespace sep
+{
+
+
+AVM_PRIMITIVE_EVAL_CLASS(Ctor, BaseAvmPrimitive)
+
+
+} /* namespace sep */
+#endif /* AVMCTORPRIMITIVE_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmExpressionPrimitive.cpp b/org.eclipse.efm.symbex/src/computer/primitive/AvmExpressionPrimitive.cpp
new file mode 100644
index 0000000..ebc98cd
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmExpressionPrimitive.cpp
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 11 sept. 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmExpressionPrimitive.h"
+
+#include <common/BF.h>
+
+#include <computer/EvaluationEnvironment.h>
+
+#include <fml/expression/ExpressionConstructorImpl.h>
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// COMPARISON PLUS
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_EvalExpressionALU::seval(EvaluationEnvironment & ENV)
+{
+ AvmCode * inCODE = ENV.inCODE;
+
+ Operator * inOperator = inCODE->getOperator();
+
+ switch( inCODE->size() )
+ {
+ case 0:
+ {
+ ENV.outVAL = ENV.inFORM;
+
+ return( true );
+ }
+
+ case 1:
+ {
+ if( ENV.seval( inCODE->first() ) )
+ {
+ ENV.outVAL = ExpressionConstructor::
+ newExpr(inOperator, ENV.outVAL);
+
+ return( true );
+ }
+
+ return( false );
+ }
+
+ case 2:
+ {
+ BF leftVAL;
+
+ if( ENV.seval( inCODE->first() ) )
+ {
+ leftVAL = ENV.outVAL;
+
+ if( ENV.sevalChained( inCODE->second() ) )
+ {
+ ENV.outVAL = ExpressionConstructor::
+ newExpr(inOperator, leftVAL, ENV.outVAL);
+
+ return( true );
+ }
+ }
+
+ return( false );
+ }
+
+ default:
+ {
+ BFVector outVALs;
+
+ AvmCode::const_iterator itArg = inCODE->begin();
+ AvmCode::const_iterator endArg = inCODE->end();
+
+ if( ENV.seval( *itArg ) )
+ {
+ outVALs.append( ENV.outVAL );
+ }
+ else
+ {
+ return( false );
+ }
+ for( ++itArg ; itArg != endArg ; ++itArg )
+ {
+ if( ENV.sevalChained( *itArg ) )
+ {
+ outVALs.append( ENV.outVAL );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ ENV.outVAL = ExpressionConstructor::newExpr(inOperator, outVALs);
+
+ return( true );
+ }
+ }
+
+ return( true );
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmExpressionPrimitive.h b/org.eclipse.efm.symbex/src/computer/primitive/AvmExpressionPrimitive.h
new file mode 100644
index 0000000..fce97b5
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmExpressionPrimitive.h
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 11 sept. 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVM_COMPUTE_PRIMITIVE_AVMEXPRESSIONPRIMITIVE_H_
+#define AVM_COMPUTE_PRIMITIVE_AVMEXPRESSIONPRIMITIVE_H_
+
+#include <computer/primitive/BaseAvmPrimitive.h>
+
+
+namespace sep
+{
+
+
+AVM_PRIMITIVE_EVAL_CLASS(EvalExpressionALU, BaseAvmPrimitive)
+
+
+} /* namespace sep */
+
+#endif /* AVM_COMPUTE_PRIMITIVE_AVMEXPRESSIONPRIMITIVE_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmGuardPrimitive.cpp b/org.eclipse.efm.symbex/src/computer/primitive/AvmGuardPrimitive.cpp
new file mode 100644
index 0000000..f589d96
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmGuardPrimitive.cpp
@@ -0,0 +1,253 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmGuardPrimitive.h"
+
+#include <computer/EvaluationEnvironment.h>
+#include <computer/ExecutionEnvironment.h>
+
+#include <computer/PathConditionProcessor.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeID.h>
+
+#include <solver/api/SolverDef.h>
+#include <solver/api/SolverFactory.h>
+
+
+namespace sep
+{
+
+
+/**
+ ***************************************************************************
+ * execution of a GUARD program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Guard::run(ExecutionEnvironment & ENV)
+{
+AVM_IF_DEBUG_FLAG( STATEMENT_TEST_DECISION )
+ AVM_OS_TRACE << "guard :> " << ENV.mARG->at(0).str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_TEST_DECISION )
+
+ if( ENV.mARG->at(0).isEqualTrue() )
+ {
+ //!! NO NEED PATH CONDITION UPDATE
+ ENV.appendOutput( ENV.mARG->outED );
+ }
+
+ else if( ENV.mARG->at(0).isEqualFalse() )
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << "THROW UNSATISFIED << GUARD >> :> ctx: "
+ << ENV.mARG->outED->mRID.str() << EOL
+ << TAB << "condition: " << ENV.inCODE->str()
+ << " |=> " << ENV.mARG->at(0).str() << EOL_FLUSH;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+ }
+
+ else
+ {
+ if( not PathConditionProcessor::appendPathCondition(
+ ENV, ENV.mARG->outED, ENV.mARG->at(0)) )
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << "THROW UNSATISFIED << GUARD >> :> ctx: "
+ << ENV.mARG->outED->mRID.str() << EOL
+ << TAB << " PC: "
+ << ENV.mARG->outED->getAllPathCondition().str() << EOL
+ << TAB << "condition: " << ENV.inCODE->str() << EOL
+ << TAB << " |=> " << ENV.mARG->at(0).str()
+ << EOL_FLUSH;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+ }
+ }
+
+ return( true );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of a TIMED GUARD program
+ ***************************************************************************
+ */
+bool AvmPrimitive_TimedGuard::run(ExecutionEnvironment & ENV)
+{
+AVM_IF_DEBUG_FLAG( STATEMENT_TEST_DECISION )
+ AVM_OS_TRACE << "tguard :> " << ENV.mARG->at(0).str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_TEST_DECISION )
+
+ if( ENV.mARG->at(0).isEqualTrue() )
+ {
+ //!! NO NEED PATH CONDITION UPDATE
+ ENV.outEDS.append( ENV.mARG->outED );
+ }
+
+ else if( ENV.mARG->at(0).isEqualFalse() )
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << "THROW UNSATISFIED << GUARD >> :> ctx: "
+ << ENV.mARG->outED->mRID.str() << EOL
+ << TAB << "condition: " << ENV.inCODE->str()
+ << " |=> " << ENV.mARG->at(0).str() << EOL_FLUSH;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+ }
+
+ else
+ {
+ if( not PathConditionProcessor::appendPathTimedCondition(
+ ENV, ENV.mARG->outED, ENV.mARG->at(0)) )
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << "THROW UNSATISFIED << TGUARD >> :> ctx: "
+ << ENV.mARG->outED->mRID.str() << EOL
+ << TAB << " PC: "
+ << ENV.mARG->outED->getAllPathCondition().str() << EOL
+ << TAB << "condition: " << ENV.inCODE->str() << EOL
+ << TAB << " |=> " << ENV.mARG->at(0).str()
+ << EOL_FLUSH;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+ }
+ }
+
+ return( true );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of a EVENT program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Event::run(ExecutionEnvironment & ENV)
+{
+AVM_IF_DEBUG_FLAG( STATEMENT_TEST_DECISION )
+ AVM_OS_TRACE << "event :> " << ENV.mARG->at(0).str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_TEST_DECISION )
+
+ if( ENV.mARG->at(0).isEqualTrue() )
+ {
+ //!! NO NEED PATH CONDITION UPDATE
+ ENV.appendOutput( ENV.mARG->outED );
+ }
+ else if( ENV.mARG->at(0).isEqualFalse() )
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << "THROW UNSATISFIED << EVENT >> : "
+ << ENV.mARG->outED->mRID.strUniqId() << " , "
+ << ENV.inCODE->first().str() << " |=> "
+ << ENV.mARG->at(0).str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+ }
+ else
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << "THROW UNKNOWN SATISFIABILITY OF << EVENT >> : "
+ << ENV.mARG->outED->mRID.strUniqId() << " , "
+ << ENV.inCODE->first().str() << " |=> "
+ << ENV.mARG->at(0).str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+
+ return( false );
+ }
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a CHECK_SAT program
+ ***************************************************************************
+ */
+bool AvmPrimitive_CheckSat::run(ExecutionEnvironment & ENV)
+{
+ if( ENV.mARG->at(0).isBuiltinString() )
+ {
+ std::string theSolver = ENV.mARG->at(0).toBuiltinString();
+
+AVM_IF_DEBUG_FLAG( STATEMENT_TEST_DECISION )
+ AVM_OS_TRACE << "checkSat< " << theSolver << " > "
+ << ENV.mARG->at(1).str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_TEST_DECISION )
+
+ if( ENV.mARG->at(1).isEqualTrue() )
+ {
+ //!! NO NEED PATH CONDITION UPDATE
+ ENV.appendOutput( ENV.mARG->outED );
+ }
+
+ else if( ENV.mARG->at(1).isEqualFalse() )
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << "THROW UNSATISFIED << CHECK#SAT >> :> ctx: "
+ << ENV.mARG->outED->mRID.str() << EOL
+ << TAB << "condition: " << ENV.inCODE->str()
+ << " |=> " << ENV.mARG->at(0).str()
+ << EOL_FLUSH;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+ }
+
+ else if( SolverFactory::isWeakSatisfiable(SolverDef::toSolver(
+ theSolver, SolverDef::DEFAULT_SOLVER_KIND), ENV.mARG->at(1)) )
+ {
+ //!! NO NEED PATH CONDITION UPDATE
+ ENV.appendOutput( ENV.mARG->outED );
+ }
+ else
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << "THROW UNSATISFIED << CHECK#SAT >> :> ctx: "
+ << ENV.mARG->outED->mRID.str() << EOL
+ << TAB << " PC: "
+ << ENV.mARG->outED->getAllPathCondition().str() << EOL
+ << TAB << "condition: " << ENV.inCODE->str() << EOL
+ << TAB << " |=> " << ENV.mARG->at(0).str()
+ << EOL_FLUSH;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+ }
+
+ return( true );
+ }
+
+
+ else if( SolverFactory::isWeakSatisfiable(ENV.mARG->at(0)) )
+ {
+ //!! NO NEED PATH CONDITION UPDATE
+ ENV.appendOutput( ENV.mARG->outED );
+ }
+ else
+ {
+AVM_IF_DEBUG_FLAG( STATEMENT)
+ AVM_OS_TRACE << "THROW UNSATISFIED << CHECK#SAT >> :> ctx: "
+ << ENV.mARG->outED->mRID.str() << EOL
+ << TAB << " PC: "
+ << ENV.mARG->outED->getAllPathCondition().str() << EOL
+ << TAB << "condition: " << ENV.inCODE->str() << EOL
+ << TAB << " |=> " << ENV.mARG->at(0).str()
+ << EOL_FLUSH;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT)
+ }
+
+ return( true );
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmGuardPrimitive.h b/org.eclipse.efm.symbex/src/computer/primitive/AvmGuardPrimitive.h
new file mode 100644
index 0000000..bf28244
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmGuardPrimitive.h
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMGUARDPRIMITIVE_H_
+#define AVMGUARDPRIMITIVE_H_
+
+#include <computer/primitive/BaseAvmPrimitive.h>
+
+
+namespace sep
+{
+
+AVM_PRIMITIVE_RUN_CLASS(Guard, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(TimedGuard, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(Event, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(CheckSat, BaseAvmPrimitive)
+
+
+}
+
+#endif /* AVMGUARDPRIMITIVE_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmInputEnabledPrimitive.cpp b/org.eclipse.efm.symbex/src/computer/primitive/AvmInputEnabledPrimitive.cpp
new file mode 100644
index 0000000..3fc30e8
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmInputEnabledPrimitive.cpp
@@ -0,0 +1,298 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 févr. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmInputEnabledPrimitive.h"
+
+#include <builder/analysis/CommunicationDependency.h>
+
+#include <computer/ExecutionEnvironment.h>
+#include <computer/primitive/AvmCommunicationFactory.h>
+
+#include <fml/executable/RoutingData.h>
+
+
+namespace sep
+{
+
+/**
+ ***************************************************************************
+ * execution of a INPUT_ENABLED program
+ ***************************************************************************
+ */
+bool AvmPrimitive_InputEnabled::run(ExecutionEnvironment & ENV)
+{
+ APExecutionData outED = ENV.inED;
+
+ ListOfInstanceOfPort * ieComs = NULL;
+ ListOfInstanceOfPort * ieSaves = NULL;
+
+ ListOfInstanceOfPort ieMutableComs;
+ ListOfInstanceOfPort ieMutableSaves;
+
+ // case of a composite machine
+ if( outED->mRID.getExecutable()->isMutableCommunication() )
+ {
+ CommunicationDependency::computeInputEnabledCom((* outED), outED->mRID,
+ ieMutableComs, ENV.inCODE->first().to_ptr< AvmCode >() );
+
+ if( ieMutableComs.empty() )
+ {
+ return( ENV.run(ENV.inCODE->first().bfCode()) );
+ }
+
+ CommunicationDependency::computeInputEnabledSave((* outED), outED->mRID,
+ ieMutableSaves, ENV.inCODE->first().to_ptr< AvmCode >() );
+
+ ieComs = & ieMutableComs;
+ ieSaves = & ieMutableSaves;
+
+//!!! DEBUG TRACE
+AVM_IF_DEBUG_FLAG( STATEMENT_SCHEDULING )
+ AVM_OS_TRACE << std::endl << "InputEnabled:mutable> " << outED->mRID.str()
+ << std::endl;
+ outED->mRID.getExecutable()->getOnRun()->toStream(AVM_OS_TRACE);
+
+ outED->mRID.getExecutable()->toStreamStaticCom(AVM_OS_TRACE);
+
+ AVM_OS_TRACE << "com#input_enabled{" << std::endl;
+ BaseCompiledForm::toStreamStaticCom(AVM_OS_TRACE, ieMutableComs);
+ AVM_OS_TRACE << "}" << std::endl;
+
+ if( ieMutableSaves.nonempty() )
+ {
+ AVM_OS_TRACE << "com#input_enabled#save{" << std::endl;
+ BaseCompiledForm::toStreamStaticCom(AVM_OS_TRACE, ieMutableSaves);
+ AVM_OS_TRACE << "}" << std::endl;
+ }
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_SCHEDULING )
+//!!! END DEBUG TRACE
+ }
+ else
+ {
+ // the expected (input) communication element
+ ieComs = &( outED->mRID.getExecutable()->getInputEnabledCom() );
+
+ // the save (input) communication element
+ ieSaves = &( outED->mRID.getExecutable()->getInputEnabledSave() );
+
+//!!! DEBUG TRACE
+AVM_IF_DEBUG_FLAG( STATEMENT_SCHEDULING )
+ AVM_OS_TRACE << std::endl << "InputEnabled:final> " << outED->mRID.str()
+ << std::endl;
+ outED->mRID.getExecutable()->getOnRun()->toStream(AVM_OS_TRACE);
+ outED->mRID.getExecutable()->toStreamStaticCom(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_SCHEDULING )
+//!!! END DEBUG TRACE
+ }
+
+ ListOfMessage saveMessages;
+
+ // the Buffer Instance
+ InstanceOfBuffer * ieBuffer =
+ outED->mRID.getExecutable()->getInputEnabledBuffer().front();
+
+ // the runtime buffer machine RID
+ RuntimeID tmpRID = outED->getRuntimeContainerRID(ieBuffer);
+
+ // the runtime (reading) buffer
+ const BaseBufferForm & readableBuffer =
+ outED->getRuntime(tmpRID).getBuffer( ieBuffer );
+
+
+//!!! DEBUG TRACE
+AVM_IF_DEBUG_FLAG( STATEMENT_SCHEDULING )
+ AVM_OS_TRACE << ieBuffer->getNameID() << ":>" << std::endl;
+ readableBuffer.toFscn(AVM_OS_TRACE, tmpRID);
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_SCHEDULING )
+//!!! END DEBUG TRACE
+
+
+ if( readableBuffer.nonempty() )
+ {
+ // the runtime non-empty (writing) buffer
+ BaseBufferForm & writableBuffer = outED.getWritableRuntime(
+ tmpRID ).getWritableBuffer( ieBuffer );
+
+
+//!!! DEBUG TRACE
+AVM_IF_DEBUG_FLAG( STATEMENT_SCHEDULING )
+ AVM_OS_TRACE << std::endl << "InputEnabled:av> " << outED->mRID.str()
+ << std::endl;
+ outED->mRID.getExecutable()->getOnRun()->toStream(AVM_OS_TRACE);
+
+ AVM_OS_TRACE << "com#input_enabled<mutable>{" << std::endl;
+ BaseCompiledForm::toStreamStaticCom(AVM_OS_TRACE, *ieComs);
+ AVM_OS_TRACE << "}" << std::endl;
+
+ if( ieSaves->nonempty() )
+ {
+ AVM_OS_TRACE << "com#input_enabled#save<mutable>{" << std::endl;
+ BaseCompiledForm::toStreamStaticCom(AVM_OS_TRACE, *ieSaves);
+ AVM_OS_TRACE << "}" << std::endl;
+ }
+
+ AVM_OS_TRACE << ieBuffer->getNameID() << ":>" << std::endl;
+ writableBuffer.toFscn(AVM_OS_TRACE, tmpRID);
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_SCHEDULING )
+//!!! END DEBUG TRACE
+
+
+ ListOfSizeT ieMidComs;
+ RuntimeID aRoutingRID = outED->mRID;
+
+ ListOfInstanceOfPort::const_iterator itPort = ieComs->begin();
+ ListOfInstanceOfPort::const_iterator enItPort = ieComs->end();
+ for( ; itPort != enItPort ; ++itPort )
+ {
+ if( (*itPort)->hasInputRoutingData() )
+ {
+ ieMidComs.append( (*itPort)->getInputRoutingData().getMID() );
+ }
+ else
+ {
+ const RoutingData & aRoutingData = AvmCommunicationFactory::
+ searchInputRoutingData( outED, (*itPort), aRoutingRID );
+ if( aRoutingData.valid() )
+ {
+ ieMidComs.append( aRoutingData.getMID() );
+ }
+ }
+ }
+
+ if( ieSaves->empty() )
+ {
+ if( ieMidComs.nonempty() )
+ {
+ writableBuffer.popBefore( ieMidComs , outED->mRID);
+ }
+ else if( (*ieComs).nonempty() )
+ {
+ writableBuffer.popBefore( *ieComs , outED->mRID);
+ }
+ else
+ {
+ writableBuffer.popBefore( outED->mRID);
+ }
+ }
+ else
+ {
+ ListOfSizeT ieMidSaves;
+ enItPort = ieSaves->end();
+ for( itPort = ieSaves->begin() ; itPort != enItPort ; ++itPort )
+ {
+ if( (*itPort)->hasInputRoutingData() )
+ {
+ ieMidSaves.append(
+ (*itPort)->getInputRoutingData().getMID() );
+ }
+ }
+
+ while( writableBuffer.nonempty() )
+ {
+ if( ieMidComs.nonempty() )
+ {
+ if( ieMidComs.contains( writableBuffer.top().getMID() ) )
+ {
+ break;
+ }
+ }
+ else if( ieComs->contains( writableBuffer.top().getPort() ) )
+ {
+ break;
+ }
+
+ else if( ieMidSaves.nonempty() )
+ {
+ if( ieMidSaves.contains( writableBuffer.top().getMID() ) )
+ {
+ saveMessages.push_back( writableBuffer.pop() );
+ }
+ else
+ {
+ writableBuffer.pop();
+ }
+ }
+ else
+ {
+ if( ieSaves->contains( writableBuffer.top().getPort() ) )
+ {
+ saveMessages.push_back( writableBuffer.pop() );
+ }
+ else
+ {
+ writableBuffer.pop();
+ }
+ }
+ }
+ }
+
+ if( writableBuffer.nonempty() )
+ {
+//!!! DEBUG TRACE
+AVM_IF_DEBUG_FLAG( STATEMENT_SCHEDULING )
+ AVM_OS_TRACE << "InputEnabled:ap> FOUND COM !!!" << std::endl;
+
+ AVM_OS_TRACE << ieBuffer->getNameID() << ":>" << std::endl;
+ writableBuffer.toFscn(AVM_OS_TRACE, tmpRID);
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_SCHEDULING )
+//!!! END DEBUG TRACE
+ }
+
+ ExecutionEnvironment tmpENV(ENV, outED, ENV.inCODE->first().bfCode());
+ if( tmpENV.run() )
+ {
+ if( saveMessages.nonempty() )
+ {
+ restoreMessage(tmpRID, ieBuffer, saveMessages, tmpENV.outEDS );
+ restoreMessage(tmpRID, ieBuffer, saveMessages, tmpENV.syncEDS);
+ restoreMessage(tmpRID, ieBuffer, saveMessages, tmpENV.irqEDS );
+ restoreMessage(tmpRID, ieBuffer, saveMessages, tmpENV.exitEDS);
+ }
+
+ ENV.spliceOutput( tmpENV );
+
+ return( true );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ return( ENV.run(ENV.inCODE->first().bfCode()) );
+ }
+}
+
+
+void AvmPrimitive_InputEnabled::restoreMessage(
+ const RuntimeID & rieRID, InstanceOfBuffer * ieBuffer,
+ ListOfMessage & saveMessages, ListOfAPExecutionData EDS)
+{
+ ListOfAPExecutionData::iterator itED = EDS.begin();
+ ListOfAPExecutionData::iterator endED = EDS.end();
+ for( ; itED != endED ; ++itED )
+ {
+ (*itED).getWritableRuntime( rieRID ).getWritableBuffer(
+ ieBuffer ).restore( saveMessages );
+ }
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmInputEnabledPrimitive.h b/org.eclipse.efm.symbex/src/computer/primitive/AvmInputEnabledPrimitive.h
new file mode 100644
index 0000000..84162df
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmInputEnabledPrimitive.h
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 févr. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMINPUTENABLEDPRIMITIVE_H_
+#define AVMINPUTENABLEDPRIMITIVE_H_
+
+#include <computer/primitive/BaseAvmPrimitive.h>
+
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/Message.h>
+
+
+namespace sep
+{
+
+
+AVM_PRIMITIVE_RUN_CLASS_HEADER(InputEnabled, BaseAvmPrimitive)
+ void restoreMessage(
+ const RuntimeID & rieRID, InstanceOfBuffer * ieBuffer,
+ ListOfMessage & saveMessages, ListOfAPExecutionData EDS);
+
+};
+
+
+} /* namespace sep */
+
+#endif /* AVMINPUTENABLEDPRIMITIVE_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmInvokePrimitive.cpp b/org.eclipse.efm.symbex/src/computer/primitive/AvmInvokePrimitive.cpp
new file mode 100644
index 0000000..d6acd41
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmInvokePrimitive.cpp
@@ -0,0 +1,1454 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 2 nov. 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmInvokePrimitive.h"
+
+
+#include <builder/Loader.h>
+
+#include <computer/EvaluationEnvironment.h>
+#include <computer/ExecutionDataFactory.h>
+#include <computer/ExecutionEnvironment.h>
+
+#include <fml/executable/AvmLambda.h>
+#include <fml/executable/AvmProgram.h>
+#include <fml/executable/AvmTransition.h>
+#include <fml/executable/InstanceOfData.h>
+#include <fml/executable/InstanceOfMachine.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/BuiltinArray.h>
+
+#include <fml/runtime/ExecutionConfiguration.h>
+#include <fml/runtime/LocalRuntime.h>
+#include <fml/runtime/RuntimeForm.h>
+#include <fml/runtime/RuntimeLib.h>
+
+#include <fml/type/TypeManager.h>
+
+#include <sew/SymbexEngine.h>
+
+#include <util/ExecutionTime.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// execution of a INVOKE NEW meta program
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_InvokeNew::seval(EvaluationEnvironment & ENV)
+{
+ InstanceOfMachine * anInstanceDynamic =
+ ENV.mARG->at(0).to_ptr< InstanceOfMachine >();
+
+ ENV.outED = ENV.mARG->outED;
+
+ RuntimeID invokerRID = ENV.outED->mRID;
+
+ if( ENV.outED->couldBeInstanciated( anInstanceDynamic ) )
+ {
+ const RuntimeID & aCompositeRID =
+ ENV.outED->mRID.getCompositeComponentParent();
+
+ Operator * aScheduleOp = aCompositeRID.
+ getExecutable()->getOnConcurrencyOperator();
+
+ RuntimeForm * newRF =
+ ENV.PRIMITIVE_PROCESSOR.getLoader().dynamicLoadMachine(
+ ENV.outED, ENV.outED->mRID, anInstanceDynamic,
+ aCompositeRID, aScheduleOp );
+
+ // RUNNING onCREATE
+ if( not ENV.PRIMITIVE_PROCESSOR.getLoader().
+ finalizeRunningOnCreate(ENV, ENV.outED) )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "InvokeNew: Failed to finalize loading by "
+ "running << onCreate Primitive >> !!!"
+ << SEND_EXIT;
+ }
+
+ const RuntimeID & newRID = newRF->getRID();
+ ENV.outVAL = newRID;
+
+//[REGRESSION]!TODO
+ ExecutableForm * modelExecutable = newRID.getExecutable();
+ InstanceOfData * aVar = NULL;
+ avm_size_t offset = 0;
+ ENV.mARG->begin(1);
+ for( ; ENV.mARG->hasNext() ; ENV.mARG->next() , ++offset )
+ {
+ aVar = modelExecutable->rawParamData(offset);
+
+//AVM_OS_COUT << std::endl << invokerRID.strUniqId()
+// << " , " << newRID.getFullyQualifiedNameID()
+// << " |= " << aVar->getFullyQualifiedNameID()
+// << " " << ENV.mARG->current().str() << std::endl;
+
+ if( not ENV.setRvalue(ENV.outED, newRID, aVar, ENV.mARG->current()) )
+ {
+ return( false );
+ }
+ }
+
+
+ BFCode onStartProgram = anInstanceDynamic->getOnStart();
+ if( onStartProgram.valid() )
+ {
+ ExecutionEnvironment tmpENV(ENV, ENV.outED, newRID, onStartProgram);
+
+ if( tmpENV.run(PROCESS_STARTING_STATE) )
+ {
+ tmpENV.outEDS.pop_last_to( ENV.outED );
+
+ if( tmpENV.outEDS.nonempty() )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unsupported << new >> Primitive which execution "
+ "create more than one Execution Context :>\n"
+ << ENV.inCODE->toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+ }
+
+ ENV.outED.mwsetRuntimeFormState(newRID,
+ PROCESS_STARTING_STATE, PROCESS_IDLE_STATE);
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ ENV.outED.mwsetRuntimeFormState(newRID, PROCESS_IDLE_STATE);
+ }
+
+ ENV.outED->mRID = invokerRID;
+
+ return( true );
+ }
+ else
+ {
+ ENV.outVAL = RuntimeLib::RID_NIL;
+
+ return( true );
+ }
+}
+
+
+bool AvmPrimitive_InvokeNew::run(ExecutionEnvironment & ENV)
+{
+ InstanceOfMachine * anInstanceDynamic =
+ ENV.mARG->at(0).to_ptr< InstanceOfMachine >();
+
+ APExecutionData outED = ENV.mARG->outED;
+
+ RuntimeID invokerRID = outED->mRID;
+
+ if( outED->couldBeInstanciated( anInstanceDynamic ) )
+ {
+ const RuntimeID & aCompositeRID =
+ outED->mRID.getCompositeComponentParent();
+
+ Operator * aScheduleOp = aCompositeRID.
+ getExecutable()->getOnConcurrencyOperator();
+
+ RuntimeForm * newRF = ENV.getLoader().dynamicLoadMachine(outED,
+ outED->mRID, anInstanceDynamic, aCompositeRID, aScheduleOp );
+
+ // RUNNING onCREATE
+ if( not ENV.PRIMITIVE_PROCESSOR.getLoader().
+ finalizeRunningOnCreate(ENV, outED) )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "InvokeNew: Failed to finalize loading by "
+ "running << onCreate Primitive >> !!!"
+ << SEND_EXIT;
+ }
+
+ const RuntimeID & newRID = newRF->getRID();
+
+
+ BFCode onStartProgram = anInstanceDynamic->getOnStart();
+ if( onStartProgram.valid() )
+ {
+ ExecutionEnvironment tmpENV(ENV, outED, newRID, onStartProgram);
+
+ if( tmpENV.run(PROCESS_STARTING_STATE) )
+ {
+ ENV.spliceNotOutput( tmpENV );
+
+ ListOfAPExecutionData::iterator itED = tmpENV.outEDS.begin();
+ ListOfAPExecutionData::iterator endED = tmpENV.outEDS.end();
+ for( ; itED != endED ; ++itED )
+ {
+ (*itED).mwsetRuntimeFormState(newRID,
+ PROCESS_STARTING_STATE, PROCESS_IDLE_STATE);
+
+ (*itED)->mRID = invokerRID;
+
+ ENV.appendOutput( *itED );
+ }
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ else if( not ENV.appendOutput_mwsetPES(
+ outED, newRID, PROCESS_IDLE_STATE) )
+ {
+ outED->mRID = invokerRID;
+
+ if( not ENV.appendOutput_mwsetPES(
+ outED, newRID, PROCESS_IDLE_STATE) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+ else
+ {
+ return( true );
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// execution of a INVOKE ROUTINE program
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmBaseInvokePrimitive::pushLocalVars(
+ ExecutionEnvironment & ENV, const BaseAvmProgram & aProgram)
+{
+ ENV.inED.makeWritable();
+ ENV.inED->makeWritableLocalRuntimeStack();
+
+ LocalRuntime aLocalRuntime( aProgram );
+ ENV.inED->getLocalRuntimes()->push( aLocalRuntime );
+
+ EvaluationEnvironment eENV( ENV );
+
+ TableOfInstanceOfData::const_raw_iterator itData = aProgram.getData().begin();
+ TableOfInstanceOfData::const_raw_iterator endData = aProgram.getData().end();
+ for( avm_size_t i = 0 ; itData != endData ; ++itData , ++i )
+ {
+ if( (itData)->hasValue() )
+ {
+ eENV.seval( (itData)->getValue() );
+ aLocalRuntime.setData(i, eENV.outVAL);
+ }
+ else
+ {
+ BFList paramList;
+
+ aLocalRuntime.setData(i, ENV.createNewFreshParam(
+ ENV.inED->mRID, (itData), paramList) );
+
+ ENV.inED.appendParameters( paramList );
+ }
+ }
+
+ return( true );
+}
+
+
+bool AvmBaseInvokePrimitive::pushLocalVar1(ExecutionEnvironment & ENV,
+ const BaseAvmProgram & aProgram, const BF & aParam)
+{
+ ENV.inED.makeWritable();
+ ENV.inED->makeWritableLocalRuntimeStack();
+
+ LocalRuntime aLocalRuntime( aProgram );
+ ENV.inED->getLocalRuntimes()->push( aLocalRuntime );
+
+ aLocalRuntime.setData(static_cast< avm_size_t >(0), aParam);
+
+ return( true );
+}
+
+
+bool AvmBaseInvokePrimitive::pushLocalVars(ExecutionEnvironment & ENV,
+ const BaseAvmProgram & aProgram, ArrayBF * params)
+{
+ ENV.inED.makeWritable();
+ ENV.inED->makeWritableLocalRuntimeStack();
+
+ LocalRuntime aLocalRuntime( aProgram );
+ ENV.inED->getLocalRuntimes()->push( aLocalRuntime );
+
+ EvaluationEnvironment eENV( ENV );
+
+ TableOfInstanceOfData::const_raw_iterator itData = aProgram.getData().begin();
+ TableOfInstanceOfData::const_raw_iterator endData = aProgram.getData().end();
+ for( avm_size_t i = 0 ; itData != endData ; ++itData , ++i )
+ {
+ if( params->at(i).valid() )
+ {
+// eENV.seval( params->get(i) );
+// aLocalRuntime.setData(i, eENV.outVAL);
+ aLocalRuntime.setData(i, params->at(i));
+ }
+ else if( (itData)->hasValue() )
+ {
+ eENV.seval( (itData)->getValue() );
+ aLocalRuntime.setData(i, eENV.outVAL);
+ }
+ else
+ {
+ BFList paramList;
+
+ aLocalRuntime.setData(i, ENV.createNewFreshParam(
+ ENV.inED->mRID, (itData), paramList) );
+
+ ENV.inED.appendParameters( paramList );
+ }
+ }
+
+ return( true );
+}
+
+
+
+bool AvmBaseInvokePrimitive::popLocalVars(APExecutionData & anED)
+{
+ anED.makeWritable();
+ anED->makeWritableLocalRuntimeStack();
+
+ anED->getLocalRuntimes()->pop();
+
+ if( not anED->hasLocalRuntime() )
+ {
+ anED->destroyLocalRuntimeStack();
+ }
+
+ return( true );
+}
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// execution of a INVOKE EXECUTABLE routine
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+bool AvmPrimitive_InvokeRoutine::run(
+ ExecutionEnvironment & ENV, const AvmProgram & anAvmProgram)
+{
+ ExecutionTime theExecutionTimeManager(false);
+AVM_IF_DEBUG_FLAG( TIME )
+ theExecutionTimeManager.start_time();
+AVM_ENDIF_DEBUG_FLAG( TIME )
+
+
+ ExecutionEnvironment tmpENV(ENV, anAvmProgram.getCode());
+
+ tmpENV.inED.makeWritable();
+
+// ExecutionDataFactory::appendRunnableElementTrace(tmpENV.inED,
+// BF(new ExecutionConfiguration(tmpENV.inED->mRID, anAvmProgram)));
+
+ if( not tmpENV.run() )
+ {
+ return( false );
+ }
+
+ APExecutionData tmpED;
+
+ // OUTPUT EDS traitement
+ while( tmpENV.outEDS.nonempty() )
+ {
+ tmpENV.outEDS.pop_first_to( tmpED );
+
+ // Verification of EXECUTION ENDING STATUS
+ switch( tmpED->getAEES() )
+ {
+ case AEES_STMNT_NOTHING:
+ case AEES_STMNT_FINAL:
+ case AEES_STMNT_DESTROY:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ ENV.outEDS.append( tmpED );
+
+ break;
+ }
+ case AEES_OK:
+ {
+ ENV.outEDS.append( tmpED );
+
+ break;
+ }
+
+ case AEES_STMNT_EXIT:
+ case AEES_STMNT_EXIT_ALL:
+ case AEES_STMNT_FATAL_ERROR:
+ case AEES_SYMBOLIC_EXECUTION_LIMITATION:
+ {
+ ENV.exitEDS.append( tmpED );
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as outEDS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+ }
+
+ // IRQ EDS traitement
+ while( tmpENV.irqEDS.nonempty() )
+ {
+ tmpENV.irqEDS.pop_last_to( tmpED );
+
+ // Verification of EXECUTION ENDING STATUS
+ switch( tmpED->getAEES() )
+ {
+ case AEES_STMNT_BREAK:
+ case AEES_STMNT_CONTINUE:
+ case AEES_STMNT_RETURN:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ ENV.outEDS.append( tmpED );
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as irqEDS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+ }
+
+ // EXIT EDS traitement
+ ENV.spliceExit(tmpENV);
+
+ // Sync EDS traitement
+ ENV.spliceSync_mwStorePos(tmpENV);
+
+AVM_IF_DEBUG_FLAG( TIME )
+ theExecutionTimeManager.finish_time();
+ AVM_OS_TRACE << theExecutionTimeManager.time_stat();// << std::endl;
+AVM_ENDIF_DEBUG_FLAG( TIME )
+
+ return( true );
+}
+
+
+bool AvmPrimitive_InvokeRoutine::run(ExecutionEnvironment & ENV,
+ const AvmProgram & anAvmProgram, const BF & aParam)
+{
+ ExecutionTime theExecutionTimeManager(false);
+AVM_IF_DEBUG_FLAG( TIME )
+ theExecutionTimeManager.start_time();
+AVM_ENDIF_DEBUG_FLAG( TIME )
+
+
+ ExecutionEnvironment tmpENV(ENV, anAvmProgram.getCode());
+
+ tmpENV.inED.makeWritable();
+
+// ExecutionDataFactory::appendRunnableElementTrace(tmpENV.inED,
+// BF(new ExecutionConfiguration(tmpENV.inED->mRID, anAvmProgram)));
+
+ // Allocated local data table
+ pushLocalVar1(tmpENV, anAvmProgram, aParam);
+
+ if( not tmpENV.run() )
+ {
+ return( false );
+ }
+
+ APExecutionData tmpED;
+
+ // OUTPUT EDS traitement
+ while( tmpENV.outEDS.nonempty() )
+ {
+ tmpENV.outEDS.pop_first_to( tmpED );
+
+ // Verification of EXECUTION ENDING STATUS
+ switch( tmpED->getAEES() )
+ {
+ case AEES_STMNT_NOTHING:
+ case AEES_STMNT_FINAL:
+ case AEES_STMNT_DESTROY:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ // Free local data table
+ popLocalVars(tmpED);
+
+ ENV.outEDS.append( tmpED );
+
+ break;
+ }
+ case AEES_OK:
+ {
+ // Free local data table
+ popLocalVars(tmpED);
+
+ ENV.outEDS.append( tmpED );
+
+ break;
+ }
+
+ case AEES_STMNT_EXIT:
+ case AEES_STMNT_EXIT_ALL:
+ case AEES_STMNT_FATAL_ERROR:
+ case AEES_SYMBOLIC_EXECUTION_LIMITATION:
+ {
+ ENV.exitEDS.append( tmpED );
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as outEDS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+ }
+
+ // IRQ EDS traitement
+ while( tmpENV.irqEDS.nonempty() )
+ {
+ tmpENV.irqEDS.pop_last_to( tmpED );
+
+ // Verification of EXECUTION ENDING STATUS
+ switch( tmpED->getAEES() )
+ {
+ case AEES_STMNT_BREAK:
+ case AEES_STMNT_CONTINUE:
+ case AEES_STMNT_RETURN:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ // Free local data table
+ popLocalVars(tmpED);
+
+ ENV.outEDS.append( tmpED );
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as irqEDS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+ }
+
+ // EXIT EDS traitement
+ while( tmpENV.exitEDS.nonempty() )
+ {
+ tmpENV.exitEDS.pop_last_to( tmpED );
+
+ // Free local data table
+ popLocalVars(tmpED);
+
+ ENV.exitEDS.append( tmpED );
+ }
+
+
+ // Sync EDS traitement
+ ENV.spliceSync_mwStorePos(tmpENV);
+
+AVM_IF_DEBUG_FLAG( TIME )
+ theExecutionTimeManager.finish_time();
+ AVM_OS_TRACE << theExecutionTimeManager.time_stat();// << std::endl;
+AVM_ENDIF_DEBUG_FLAG( TIME )
+
+ return( true );
+}
+
+
+bool AvmPrimitive_InvokeRoutine::run(ExecutionEnvironment & ENV)
+{
+ const BF & aCode = ENV.inCODE->first();
+ const AvmProgram & anAvmProgram = aCode.to_ref< AvmProgram >();
+
+ ExecutionTime theExecutionTimeManager(false);
+AVM_IF_DEBUG_FLAG( TIME )
+ theExecutionTimeManager.start_time();
+AVM_ENDIF_DEBUG_FLAG( TIME )
+
+
+ ExecutionEnvironment tmpENV(ENV, anAvmProgram.getCode());
+
+ tmpENV.inED.makeWritable();
+
+ ExecutionDataFactory::appendRunnableElementTrace(tmpENV.inED,
+ BF(new ExecutionConfiguration(tmpENV.inED->mRID, aCode)));
+
+ if( anAvmProgram.hasData() )
+ {
+ if( ENV.inCODE->populated() )
+ {
+ pushLocalVars(tmpENV, anAvmProgram,
+ ENV.inCODE->second().to_ptr< ArrayBF >());
+ }
+ else
+ {
+ pushLocalVars(tmpENV, anAvmProgram);
+ }
+ }
+
+ if( not tmpENV.run() )
+ {
+ return( false );
+ }
+
+ APExecutionData tmpED;
+
+ // OUTPUT EDS traitement
+ while( tmpENV.outEDS.nonempty() )
+ {
+ tmpENV.outEDS.pop_first_to( tmpED );
+
+ // Verification of EXECUTION ENDING STATUS
+ switch( tmpED->getAEES() )
+ {
+ case AEES_STMNT_NOTHING:
+ case AEES_STMNT_FINAL:
+ case AEES_STMNT_DESTROY:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ // Free local data table
+ if( anAvmProgram.hasData() )
+ {
+ popLocalVars(tmpED);
+ }
+
+ ENV.outEDS.append( tmpED );
+
+ break;
+ }
+ case AEES_OK:
+ {
+ // Free local data table
+ if( anAvmProgram.hasData() )
+ {
+ popLocalVars(tmpED);
+ }
+
+ ENV.outEDS.append( tmpED );
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as outEDS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+ }
+
+ // IRQ EDS traitement
+ while( tmpENV.irqEDS.nonempty() )
+ {
+ tmpENV.irqEDS.pop_last_to( tmpED );
+
+ // Verification of EXECUTION ENDING STATUS
+ switch( tmpED->getAEES() )
+ {
+ case AEES_STMNT_BREAK:
+ case AEES_STMNT_CONTINUE:
+ case AEES_STMNT_RETURN:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ if( anAvmProgram.hasData() )
+ {
+ popLocalVars(tmpED);
+ }
+
+ ENV.outEDS.append( tmpED );
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as irqEDS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+ }
+
+ // EXIT EDS traitement
+ while( tmpENV.exitEDS.nonempty() )
+ {
+ tmpENV.exitEDS.pop_last_to( tmpED );
+
+ if( anAvmProgram.hasData() )
+ {
+ popLocalVars(tmpED);
+ }
+
+ ENV.exitEDS.append( tmpED );
+ }
+
+
+ // Sync EDS traitement
+ ENV.spliceSync_mwStorePos(tmpENV);
+
+AVM_IF_DEBUG_FLAG( TIME )
+ theExecutionTimeManager.finish_time();
+ AVM_OS_TRACE << theExecutionTimeManager.time_stat();// << std::endl;
+AVM_ENDIF_DEBUG_FLAG( TIME )
+
+ return( true );
+}
+
+
+bool AvmPrimitive_InvokeRoutine::resume(ExecutionEnvironment & ENV)
+{
+ const AvmProgram & anAvmProgram = ENV.inCODE->first().to_ref< AvmProgram >();
+
+ APExecutionData outED = ENV.inED;
+
+ // Verification of EXECUTION ENDING STATUS
+ switch( outED->getAEES() )
+ {
+ case AEES_STMNT_BREAK:
+ case AEES_STMNT_CONTINUE:
+ case AEES_STMNT_RETURN:
+
+ case AEES_STMNT_NOTHING:
+ case AEES_STMNT_FINAL:
+ case AEES_STMNT_DESTROY:
+ {
+ outED.mwsetAEES( AEES_OK );
+
+ // Free local data table
+ if( anAvmProgram.hasData() )
+ {
+ popLocalVars(outED);
+ }
+
+ ENV.outEDS.append( outED );
+
+ break;
+ }
+ case AEES_OK:
+ case AEES_STEP_RESUME:
+ {
+ if( anAvmProgram.hasData() )
+ {
+ popLocalVars(outED);
+ }
+
+ ENV.outEDS.append( outED );
+
+ break;
+ }
+
+ // Sync EDS traitement
+ case AEES_STEP_MARK:
+ case AEES_WAITING_INCOM_RDV:
+ case AEES_WAITING_OUTCOM_RDV:
+ case AEES_WAITING_JOIN_FORK:
+ {
+ ENV.appendSync_mwStorePos(outED);
+
+ break;
+ }
+
+ case AEES_STMNT_EXIT:
+ case AEES_STMNT_EXIT_ALL:
+ case AEES_STMNT_FATAL_ERROR:
+ case AEES_SYMBOLIC_EXECUTION_LIMITATION:
+ {
+ if( anAvmProgram.hasData() )
+ {
+ popLocalVars(outED);
+ }
+
+ ENV.exitEDS.append( outED );
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS :> "
+ << RuntimeDef::strAEES( outED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+
+ return( true );
+}
+
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// execution of a INVOKE TRANSITION transition
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_InvokeTransition::run(ExecutionEnvironment & ENV)
+{
+ const BF & aCode = ENV.inCODE->first();
+ const AvmProgram & anAvmProgram = aCode.to_ref< AvmTransition >();
+
+ ExecutionTime theExecutionTimeManager(false);
+AVM_IF_DEBUG_FLAG( TIME )
+ theExecutionTimeManager.start_time();
+AVM_ENDIF_DEBUG_FLAG( TIME )
+
+
+ ExecutionEnvironment tmpENV(ENV, anAvmProgram.getCode());
+
+ tmpENV.inED.makeWritable();
+
+ ExecutionDataFactory::appendRunnableElementTrace(tmpENV.inED,
+ BF(new ExecutionConfiguration(tmpENV.inED->mRID, aCode)));
+
+ if( not tmpENV.run() )
+ {
+ return( false );
+ }
+
+ APExecutionData tmpED;
+
+ // OUTPUT EDS traitement
+ while( tmpENV.outEDS.nonempty() )
+ {
+ tmpENV.outEDS.pop_first_to( tmpED );
+
+ // Verification of EXECUTION ENDING STATUS
+ switch( tmpED->getAEES() )
+ {
+ case AEES_STMNT_NOTHING:
+ case AEES_STMNT_FINAL:
+ case AEES_STMNT_DESTROY:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ ENV.outEDS.append( tmpED );
+
+ break;
+ }
+ case AEES_OK:
+ case AEES_STEP_RESUME:
+ {
+ ENV.outEDS.append( tmpED );
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as outEDS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+ }
+
+ // IRQ EDS traitement
+ while( tmpENV.irqEDS.nonempty() )
+ {
+ tmpENV.irqEDS.pop_last_to( tmpED );
+
+ // Verification of EXECUTION ENDING STATUS
+ switch( tmpED->getAEES() )
+ {
+ case AEES_STMNT_BREAK:
+ case AEES_STMNT_CONTINUE:
+ case AEES_STMNT_RETURN:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ ENV.outEDS.append( tmpED );
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as irqEDS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+ }
+
+ // EXIT EDS traitement
+ ENV.spliceExit(tmpENV);
+
+ // Sync EDS traitement
+ ENV.spliceSync_mwStorePos(tmpENV);
+
+AVM_IF_DEBUG_FLAG( TIME )
+ theExecutionTimeManager.finish_time();
+ AVM_OS_TRACE << theExecutionTimeManager.time_stat();// << std::endl;
+AVM_ENDIF_DEBUG_FLAG( TIME )
+
+ return( true );
+}
+
+
+bool AvmPrimitive_InvokeTransition::resume(ExecutionEnvironment & ENV)
+{
+ APExecutionData outED = ENV.inED;
+
+ // Verification of EXECUTION ENDING STATUS
+ switch( outED->getAEES() )
+ {
+ case AEES_STMNT_BREAK:
+ case AEES_STMNT_CONTINUE:
+ case AEES_STMNT_RETURN:
+
+ case AEES_STMNT_NOTHING:
+ case AEES_STMNT_FINAL:
+ case AEES_STMNT_DESTROY:
+ {
+ outED.mwsetAEES( AEES_OK );
+
+ ENV.outEDS.append( outED );
+
+ break;
+ }
+ case AEES_OK:
+ case AEES_STEP_RESUME:
+ {
+ ENV.outEDS.append( outED );
+
+ break;
+ }
+
+ // Sync EDS traitement
+ case AEES_STEP_MARK:
+ case AEES_WAITING_INCOM_RDV:
+ case AEES_WAITING_OUTCOM_RDV:
+ case AEES_WAITING_JOIN_FORK:
+ {
+ ENV.appendSync_mwStorePos(outED);
+
+ break;
+ }
+
+ case AEES_STMNT_EXIT:
+ case AEES_STMNT_EXIT_ALL:
+ case AEES_STMNT_FATAL_ERROR:
+ case AEES_SYMBOLIC_EXECUTION_LIMITATION:
+ {
+ ENV.exitEDS.append( outED );
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS :> "
+ << RuntimeDef::strAEES( outED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+
+ return( true );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// execution of a INVOKE EXECUTABLE program
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_InvokeMethod::run(ExecutionEnvironment & ENV)
+{
+ return( false );
+}
+
+bool AvmPrimitive_InvokeMethod::seval(EvaluationEnvironment & ENV)
+{
+ return( false );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// execution of a INVOKE FUNCTION program
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_InvokeFunction::seval(EvaluationEnvironment & ENV)
+{
+ return( false );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// execution of a INVOKE PROGRAM program
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_InvokeProgram::run(ExecutionEnvironment & ENV)
+{
+ const BF & aCode = ENV.inCODE->first();
+ const AvmProgram & anAvmProgram = aCode.to_ref< AvmProgram >();
+
+ ExecutionTime theExecutionTimeManager(false);
+AVM_IF_DEBUG_FLAG( TIME )
+ theExecutionTimeManager.start_time();
+AVM_ENDIF_DEBUG_FLAG( TIME )
+
+
+ ExecutionEnvironment tmpENV(ENV, anAvmProgram.getCode());
+
+ tmpENV.inED.makeWritable();
+
+ ExecutionDataFactory::appendRunnableElementTrace(tmpENV.inED,
+ BF(new ExecutionConfiguration(tmpENV.inED->mRID, aCode)));
+
+ if( anAvmProgram.hasData() )
+ {
+ if( ENV.inCODE->populated() )
+ {
+ pushLocalVars(tmpENV, anAvmProgram,
+ ENV.inCODE->second().to_ptr< ArrayBF >());
+ }
+ else
+ {
+ pushLocalVars(tmpENV, anAvmProgram);
+ }
+ }
+
+ if( not tmpENV.run() )
+ {
+ return( false );
+ }
+
+ APExecutionData tmpED;
+
+ // OUTPUT EDS traitement
+ while( tmpENV.outEDS.nonempty() )
+ {
+ tmpENV.outEDS.pop_first_to( tmpED );
+
+ // Verification of EXECUTION ENDING STATUS
+ switch( tmpED->getAEES() )
+ {
+ case AEES_STMNT_NOTHING:
+ case AEES_STMNT_FINAL:
+ case AEES_STMNT_DESTROY:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ // Free local data table
+ if( anAvmProgram.hasData() )
+ {
+ popLocalVars(tmpED);
+ }
+
+ ENV.outEDS.append( tmpED );
+
+ break;
+ }
+ case AEES_OK:
+ {
+ if( anAvmProgram.hasData() )
+ {
+ popLocalVars(tmpED);
+ }
+
+ ENV.outEDS.append( tmpED );
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as outEDS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+ }
+
+ // IRQ EDS traitement
+ while( tmpENV.irqEDS.nonempty() )
+ {
+ tmpENV.irqEDS.pop_last_to( tmpED );
+
+ // Verification of EXECUTION ENDING STATUS
+ switch( tmpED->getAEES() )
+ {
+ case AEES_STMNT_BREAK:
+ case AEES_STMNT_CONTINUE:
+ case AEES_STMNT_RETURN:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ if( anAvmProgram.hasData() )
+ {
+ popLocalVars(tmpED);
+ }
+
+ ENV.outEDS.append( tmpED );
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as irqEDS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+ }
+
+ // EXIT EDS traitement
+ while( tmpENV.exitEDS.nonempty() )
+ {
+ tmpENV.exitEDS.pop_last_to( tmpED );
+
+ if( anAvmProgram.hasData() )
+ {
+ popLocalVars(tmpED);
+ }
+
+ ENV.exitEDS.append( tmpED );
+ }
+
+
+ // Sync EDS traitement
+ ENV.spliceSync_mwStorePos(tmpENV);
+
+AVM_IF_DEBUG_FLAG( TIME )
+ theExecutionTimeManager.finish_time();
+ AVM_OS_TRACE << theExecutionTimeManager.time_stat();// << std::endl;
+AVM_ENDIF_DEBUG_FLAG( TIME )
+
+ return( true );
+}
+
+
+bool AvmPrimitive_InvokeProgram::resume(ExecutionEnvironment & ENV)
+{
+ const AvmProgram & anAvmProgram = ENV.inCODE->first().to_ref< AvmProgram >();
+
+ APExecutionData outED = ENV.inED;
+
+ // Verification of EXECUTION ENDING STATUS
+ switch( outED->getAEES() )
+ {
+ case AEES_STMNT_BREAK:
+ case AEES_STMNT_CONTINUE:
+ case AEES_STMNT_RETURN:
+
+ case AEES_STMNT_NOTHING:
+ case AEES_STMNT_FINAL:
+ case AEES_STMNT_DESTROY:
+ {
+ outED.mwsetAEES( AEES_OK );
+
+ // Free local data table
+ if( anAvmProgram.hasData() )
+ {
+ popLocalVars(outED);
+ }
+
+ ENV.outEDS.append( outED );
+
+ break;
+ }
+ case AEES_OK:
+ case AEES_STEP_RESUME:
+ {
+ if( anAvmProgram.hasData() )
+ {
+ popLocalVars(outED);
+ }
+
+ ENV.outEDS.append( outED );
+
+ break;
+ }
+
+ // Sync EDS traitement
+ case AEES_STEP_MARK:
+ case AEES_WAITING_INCOM_RDV:
+ case AEES_WAITING_OUTCOM_RDV:
+ case AEES_WAITING_JOIN_FORK:
+ {
+ ENV.appendSync_mwStorePos(outED);
+
+ break;
+ }
+
+ case AEES_STMNT_EXIT:
+ case AEES_STMNT_EXIT_ALL:
+ case AEES_STMNT_FATAL_ERROR:
+ case AEES_SYMBOLIC_EXECUTION_LIMITATION:
+ {
+ if( anAvmProgram.hasData() )
+ {
+ popLocalVars(outED);
+ }
+
+ ENV.exitEDS.append( outED );
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS :> "
+ << RuntimeDef::strAEES( outED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+
+ return( true );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// execution of a INVOKE LAMBDA APPLY program
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_InvokeLambdaApply::seval(EvaluationEnvironment & ENV)
+{
+ bool rtCode = true;
+
+ const AvmCode * applyCode = ENV.inCODE;
+
+ AvmCode::const_iterator itArg = applyCode->begin();
+ AvmCode::const_iterator endArg = applyCode->end();
+
+ // First arg is the lambda function
+ BF theFunction = (*itArg);
+ if( theFunction.isnot< AvmLambda >() )
+ {
+ if( not ENV.seval(theFunction) )
+ {
+ return( false );
+ }
+ theFunction = ENV.outVAL;
+ }
+
+ if( theFunction.is< AvmLambda >() )
+ {
+ // First paramater is in second position,
+ ++itArg;
+
+ const AvmLambda & aLambdaFun = theFunction.to_ref< AvmLambda >();
+
+ // CREATE LOCAL VARIABLE TABLE
+ if( not ENV.inED->hasLocalRuntimeStack())
+ {
+ ENV.inED->createLocalRuntimeStack();
+ }
+ LocalRuntime aLocalRuntime( aLambdaFun );
+
+
+ // COMPLETE REDUCTION :> the result is a TERM
+ if( aLambdaFun.boundVarCount() < applyCode->size() )
+ {
+ // INITIALIZE LOCAL VARIABLE TABLE
+ avm_size_t offset = 0;
+ avm_size_t endOffset = aLambdaFun.getData().size();
+ for( ; offset < endOffset ; ++itArg , ++offset )
+ {
+ if( not ENV.seval(*itArg ) )
+ {
+ return( false );
+ }
+ aLocalRuntime.setData(offset, ENV.outVAL);
+ }
+
+ // LOAD LOCAL VARIABLE TABLE
+ ENV.inED->getLocalRuntimes()->push( aLocalRuntime );
+
+ // REDUCTION
+ rtCode = ENV.seval(aLambdaFun.getExpression());
+ }
+
+ // PARTIAL REDUCTION :> the result is a Lambda Function
+ else
+ {
+ // NEW LAMBA EXPRESSION
+ avm_size_t newBoundVariableCount =
+ aLambdaFun.getData().size() - applyCode->size() + 1;
+
+ AvmLambda * substLambda = new AvmLambda(aLambdaFun.getContainer(),
+ newBoundVariableCount, aLambdaFun.getNature());
+
+ ENV.outVAL.renew( substLambda );
+
+ // INITIALIZE LOCAL VARIABLE TABLE
+ avm_size_t offset = 0;
+ for( ; itArg != endArg ; ++itArg , ++offset )
+ {
+ if( not ENV.seval(*itArg ) )
+ {
+ return( false );
+ }
+ aLocalRuntime.setData(offset, ENV.outVAL);
+ }
+
+ // SET NEW BOUND VARIABLE
+ TableOfInstanceOfData::const_raw_iterator itData =
+ aLambdaFun.getData().begin();
+ TableOfInstanceOfData::const_raw_iterator endData =
+ aLambdaFun.getData().end();
+ avm_offset_t newOffset = 0;
+ for( ; itData != endData ; ++itData , ++offset , ++newOffset )
+ {
+ Symbol lambdaVar( new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ substLambda, (itData)->getAstElement(),
+ TypeManager::UNIVERSAL, newOffset) );
+
+ substLambda->setData(newOffset, lambdaVar);
+
+ aLocalRuntime.setData(offset, lambdaVar);
+ }
+
+ // LOAD LOCAL VARIABLE TABLE
+ ENV.inED->getLocalRuntimes()->push( aLocalRuntime );
+
+ // REDUCTION
+ if( (rtCode = ENV.seval(aLambdaFun.getExpression())) )
+ {
+ substLambda->setExpression( ENV.outVAL );
+ }
+ }
+
+ // UNLOAD & DESTROY LOCAL VARIABLE TABLE
+ if( ENV.inED->hasLocalRuntime() )
+ {
+ ENV.inED->getLocalRuntimes()->pop();
+
+ if( not ENV.inED->hasLocalRuntime() )
+ {
+ ENV.inED->destroyLocalRuntimeStack();
+ }
+ }
+ }
+
+ else
+ {
+ BFCode theSubstCode( applyCode->getOperator() , theFunction );
+
+ for ( ++itArg ; itArg != endArg ; ++itArg )
+ {
+ if( not ENV.seval(*itArg ) )
+ {
+ return( false );
+ }
+ theSubstCode->append( ENV.outVAL );
+ }
+
+ ENV.outVAL = theSubstCode;
+ }
+
+ return( rtCode );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// execution of a INVOKE LAMBDA LET program
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_InvokeLambdaLet::seval(EvaluationEnvironment & ENV)
+{
+ return( false );
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmInvokePrimitive.h b/org.eclipse.efm.symbex/src/computer/primitive/AvmInvokePrimitive.h
new file mode 100644
index 0000000..2182034
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmInvokePrimitive.h
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 2 nov. 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMINVOKEPRIMITIVE_H_
+#define AVMINVOKEPRIMITIVE_H_
+
+#include <computer/primitive/BaseAvmPrimitive.h>
+
+
+namespace sep
+{
+
+
+class AvmProgram;
+class APExecutionData;
+class ArrayBF;
+class BF;
+class BaseAvmProgram;
+
+
+AVM_PRIMITIVE_RUN_EVAL_CLASS(InvokeNew, BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_CLASS_HEADER(AvmBaseInvokePrimitive, BaseAvmPrimitive)
+ bool pushLocalVar1(ExecutionEnvironment & ENV,
+ const BaseAvmProgram & aProgram, const BF & aParam);
+
+ bool pushLocalVars(ExecutionEnvironment & ENV,
+ const BaseAvmProgram & aProgram, ArrayBF * params);
+
+ bool pushLocalVars(ExecutionEnvironment & ENV,
+ const BaseAvmProgram & aProgram);
+
+ bool popLocalVars(APExecutionData & anED);
+};
+
+
+AVM_PRIMITIVE_RUN_RESUME_CLASS_HEADER(InvokeRoutine, AvmBaseInvokePrimitive)
+ bool run(ExecutionEnvironment & ENV, const AvmProgram & anAvmProgram);
+
+ bool run(ExecutionEnvironment & ENV,
+ const AvmProgram & anAvmProgram, const BF & aParam);
+};
+
+AVM_PRIMITIVE_RUN_RESUME_CLASS(InvokeTransition, BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_RUN_EVAL_CLASS(InvokeMethod, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_EVAL_CLASS(InvokeFunction, BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_RUN_RESUME_CLASS(InvokeProgram, AvmBaseInvokePrimitive)
+
+
+AVM_PRIMITIVE_EVAL_CLASS(InvokeLambdaApply, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_EVAL_CLASS(InvokeLambdaLet, BaseAvmPrimitive)
+
+
+
+
+}
+
+#endif /* AVMINVOKEPRIMITIVE_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmItePrimitive.cpp b/org.eclipse.efm.symbex/src/computer/primitive/AvmItePrimitive.cpp
new file mode 100644
index 0000000..96cd627
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmItePrimitive.cpp
@@ -0,0 +1,171 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmItePrimitive.h"
+
+#include <computer/EvaluationEnvironment.h>
+#include <computer/ExecutionEnvironment.h>
+
+#include <computer/PathConditionProcessor.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/ExpressionConstructor.h>
+
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeID.h>
+
+#include <solver/api/SolverFactory.h>
+
+
+namespace sep
+{
+
+
+/**
+ ***************************************************************************
+ * execution of an IF program
+ ***************************************************************************
+ */
+bool AvmPrimitive_If::run(ExecutionEnvironment & ENV)
+{
+ if( ENV.mARG->at(0).isEqualTrue() )
+ {
+ // THEN STATEMENT
+ ExecutionEnvironment tmpENV(ENV, ENV.mARG->outED, ENV.mARG->at(1).bfCode());
+ if( tmpENV.run() )
+ {
+ ENV.spliceOutput( tmpENV );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ else if( ENV.mARG->at(0).isEqualFalse() )
+ {
+ ENV.appendOutput( ENV.mARG->outED );
+// ENV.xappendOutED( ENV.mARG->outED , aProgram );
+ }
+
+ else
+ {
+ // THEN STATEMENT
+ ExecutionEnvironment tmpENV(ENV, ENV.mARG->outED, ENV.mARG->at(0));
+ if( PathConditionProcessor::appendPathCondition(tmpENV) )
+ {
+ if( tmpENV.runFromOutputs(ENV.mARG->at(1).bfCode()) )
+ {
+ ENV.spliceOutput( tmpENV );
+ }
+ else
+ {
+ return( false );
+ }
+
+ ////////////////////////////////////////////////////////////////
+ // CASE ELSE { NOP }
+ BF elseCond = ExpressionConstructor::notExpr(ENV.mARG->at(0));
+ if( not PathConditionProcessor::appendPathCondition(
+ ENV, ENV.mARG->outED, elseCond) )
+ {
+ // NOTHING
+ }
+ }
+ else
+ {
+ ////////////////////////////////////////////////////////////////
+ // CASE ELSE { NOP }
+ ENV.appendOutput( ENV.inED );
+ }
+ }
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of an IFE program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Ife::run(ExecutionEnvironment & ENV)
+{
+ if( ENV.mARG->at(0).isEqualTrue() )
+ {
+ // THEN STATEMENT
+ ExecutionEnvironment tmpENV(ENV, ENV.mARG->outED, ENV.mARG->at(1).bfCode());
+ if( tmpENV.run() )
+ {
+ ENV.spliceOutput( tmpENV );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ else if( ENV.mARG->at(0).isEqualFalse() )
+ {
+ // ELSE STATEMENT
+ ExecutionEnvironment tmpENV(ENV, ENV.mARG->at(2).bfCode());
+ if( tmpENV.run() )
+ {
+ ENV.spliceOutput( tmpENV );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ else
+ {
+ // THEN STATEMENT
+ ExecutionEnvironment thenENV(ENV, ENV.mARG->outED, ENV.mARG->at(0));
+ if( PathConditionProcessor::appendPathCondition(thenENV) )
+ {
+ if( thenENV.runFromOutputs(ENV.mARG->at(1).bfCode()) )
+ {
+ ENV.spliceOutput( thenENV );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ ////////////////////////////////////////////////////////////////
+ // ELSE STATEMENT
+ BF elseCond = ExpressionConstructor::notExpr(ENV.mARG->at(0));
+ ExecutionEnvironment elseENV(ENV, ENV.mARG->outED, elseCond);
+ if( PathConditionProcessor::appendPathCondition(elseENV) )
+ {
+ if( elseENV.runFromOutputs(ENV.mARG->at(2).bfCode()) )
+ {
+ ENV.spliceOutput( elseENV );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ }
+
+ return( true );
+}
+
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmItePrimitive.h b/org.eclipse.efm.symbex/src/computer/primitive/AvmItePrimitive.h
new file mode 100644
index 0000000..121fd88
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmItePrimitive.h
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMITEPRIMITIVE_H_
+#define AVMITEPRIMITIVE_H_
+
+#include <computer/primitive/BaseAvmPrimitive.h>
+
+
+namespace sep
+{
+
+AVM_PRIMITIVE_RUN_CLASS(If, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(Ife, BaseAvmPrimitive)
+
+
+}
+
+#endif /* AVMITEPRIMITIVE_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmIterationPrimitive.cpp b/org.eclipse.efm.symbex/src/computer/primitive/AvmIterationPrimitive.cpp
new file mode 100644
index 0000000..75f73dc
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmIterationPrimitive.cpp
@@ -0,0 +1,869 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmIterationPrimitive.h"
+
+#include <computer/EvaluationEnvironment.h>
+#include <computer/ExecutionEnvironment.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+
+/**
+ ***************************************************************************
+ * execution of a FOR program
+ ***************************************************************************
+ */
+bool AvmPrimitive_For::run(ExecutionEnvironment & ENV)
+{
+ return( run(ENV, ENV.inCODE->first()) );
+}
+
+
+bool AvmPrimitive_For::resume(ExecutionEnvironment & ENV)
+{
+ return( run(ENV, ENV.inCODE->third()) );
+}
+
+
+bool AvmPrimitive_For::run(ExecutionEnvironment & ENV, const BF & initStmnt)
+{
+ const BF & forCond = ENV.inCODE->second();
+ const BFCode & forIncr = ENV.inCODE->third().bfCode();
+ const BFCode & forStmnt = ENV.inCODE->fourth().bfCode();
+
+ ExecutionEnvironment stmntENV(ENV, BFCode::REF_NULL);
+
+ ExecutionEnvironment iterENV(ENV, initStmnt);
+
+ // INITIALISATION
+ if( not iterENV.run() )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Failed to RUN FOR< INIT > !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ APExecutionData tmpED;
+
+ while( iterENV.outEDS.nonempty() )
+ {
+ iterENV.outEDS.pop_first_to( tmpED );
+
+ // Evaluation of FOR CONDITION
+ EvaluationEnvironment condENV(ENV, tmpED);
+ if( not condENV.evalBoolean(forCond) )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Failed to EVAL FOR< CONDITION > !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ ENV.spliceFailure(condENV);
+
+
+ if( condENV.outVAL.isEqualTrue() )
+ {
+ // Evaluation of FOR STATEMENT
+ if( not stmntENV.run(condENV.outED, forStmnt) )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Failed to RUN FOR< STATEMENT > !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ else if( condENV.outVAL.isEqualFalse() )
+ {
+ ENV.outEDS.append( tmpED );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Throw unexpected "
+ "NON CONCRETE BOOLEAN VALUE FOR CONDITION : "
+ << tmpED->mRID.strUniqId()
+ << " ," << str_indent( condENV.outVAL )
+ << " |=>" << forCond.str() << " !!!"
+ << SEND_EXIT;
+ }
+
+ // OUTPUT EDS traitement
+ while( stmntENV.outEDS.nonempty() )
+ {
+ stmntENV.outEDS.pop_last_to( tmpED );
+
+ switch( tmpED->getAEES() )
+ {
+ case AEES_STMNT_NOTHING:
+ case AEES_STMNT_FINAL:
+ case AEES_STMNT_DESTROY:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ // Evaluation of FOR INCREMENT statement
+ if( not iterENV.run(tmpED, forIncr) )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Failed to RUN FOR< INCREMENT > !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ break;
+ }
+
+ case AEES_OK:
+ case AEES_STEP_RESUME:
+ {
+ // Evaluation of FOR INCREMENT statement
+ if( not iterENV.run(tmpED, forIncr) )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Failed to RUN FOR< INCREMENT > !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as outEDS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+
+ // IRQ EDS traitement
+ while( stmntENV.irqEDS.nonempty() )
+ {
+ stmntENV.irqEDS.pop_last_to( tmpED );
+
+ switch( tmpED->getAEES() )
+ {
+ case AEES_STMNT_BREAK:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ ENV.outEDS.append( tmpED );
+
+ break;
+ }
+ case AEES_STMNT_RETURN:
+ {
+ ENV.irqEDS.append( tmpED );
+
+ break;
+ }
+
+ case AEES_STMNT_CONTINUE:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ // Evaluation of FOR INCREMENT statement
+ if( not iterENV.run(tmpED, forIncr) )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Failed to RUN FOR< INCREMENT > !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as irqEDS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+
+ // Sync EDS traitement
+ ENV.spliceSync_mwStorePos(stmntENV);
+ }
+
+ ENV.spliceNotOutput(stmntENV);
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a FOR program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Foreach::run(ExecutionEnvironment & ENV)
+{
+ InstanceOfData * forIterator = ENV.mARG->at(0).to_ptr< InstanceOfData >();
+ const BF & forCollection = ENV.mARG->at(1);
+ const BFCode & forStatement = ENV.mARG->at(2).bfCode();
+
+ ExecutionEnvironment stmntENV(ENV, BFCode::REF_NULL);
+
+ ExecutionEnvironment iterENV(ENV, BFCode::REF_NULL);
+ iterENV.appendOutput( ENV.mARG->outED );
+
+ APExecutionData tmpED;
+
+ avm_size_t endOffset = forCollection.size();
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ while( iterENV.outEDS.nonempty() )
+ {
+ iterENV.outEDS.pop_first_to( tmpED );
+
+ if( ENV.setRvalue(tmpED, forIterator, forCollection.at(offset)) )
+ {
+ stmntENV.appendOutput( tmpED );
+ }
+ else
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Failed to INCREMENT FOREACH< ITERATOR > !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+
+ if( not stmntENV.runFromOutputs(forStatement) )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Failed to RUN FOREACH< STATEMENT > !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ ENV.spliceFailure( stmntENV );
+
+
+ // OUTPUT EDS traitement
+ while( stmntENV.outEDS.nonempty() )
+ {
+ stmntENV.outEDS.pop_last_to( tmpED );
+
+ switch( tmpED->getAEES() )
+ {
+ case AEES_STMNT_NOTHING:
+ case AEES_STMNT_FINAL:
+ case AEES_STMNT_DESTROY:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ iterENV.outEDS.append( tmpED );
+
+ break;
+ }
+
+ case AEES_OK:
+ case AEES_STEP_RESUME:
+ {
+ iterENV.outEDS.append( tmpED );
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as outEDS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+
+ // IRQ EDS traitement
+ while( stmntENV.irqEDS.nonempty() )
+ {
+ stmntENV.irqEDS.pop_last_to( tmpED );
+
+ switch( tmpED->getAEES() )
+ {
+ case AEES_STMNT_BREAK:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ ENV.outEDS.append( tmpED );
+
+ break;
+ }
+ case AEES_STMNT_RETURN:
+ {
+ ENV.irqEDS.append( tmpED );
+
+ break;
+ }
+
+ case AEES_STMNT_CONTINUE:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ iterENV.outEDS.append( tmpED );
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as irqEDS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+
+ // Sync EDS traitement
+ ENV.spliceSync_mwStorePos(stmntENV);
+ }
+
+ ENV.spliceOutput(iterENV);
+
+ return( true );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of a WHILE program
+ ***************************************************************************
+ */
+
+bool AvmPrimitive_WhileDo::run(ExecutionEnvironment & ENV)
+{
+ const BF & whileCond = ENV.inCODE->first();
+ const BFCode & doStmnt = ENV.inCODE->second().bfCode();
+
+ ListOfAPExecutionData tmpListOfInputED( ENV.inED );
+
+ ExecutionEnvironment stmntENV(ENV, BFCode::REF_NULL);
+
+ APExecutionData tmpED;
+
+ while( tmpListOfInputED.nonempty() )
+ {
+ tmpListOfInputED.pop_first_to( tmpED );
+
+ // Evaluation of WHILE_DO CONDITION
+ EvaluationEnvironment condENV(ENV, tmpED);
+ if( not condENV.evalBoolean(whileCond) )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Failed to EVAL WHILE_DO< CONDITION > !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ ENV.spliceFailure(condENV);
+
+
+ if( condENV.outVAL.isEqualTrue() )
+ {
+ // Evaluation of WHILE_DO STATEMENT
+ if( not stmntENV.run(condENV.outED, doStmnt) )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Failed to RUN WHILE_DO< STATEMENT > !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ else if( condENV.outVAL.isEqualFalse() )
+ {
+ ENV.outEDS.append( tmpED );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Throw unexpected "
+ "NON CONCRETE BOOLEAN VALUE FOR CONDITION : "
+ << tmpED->mRID.strUniqId()
+ << " ," << str_indent( condENV.outVAL )
+ << " |=>" << whileCond.str() << " !!!"
+ << SEND_EXIT;
+ }
+
+ // OUTPUT EDS traitement
+ while( stmntENV.outEDS.nonempty() )
+ {
+ stmntENV.outEDS.pop_last_to( tmpED );
+
+ switch( tmpED->getAEES() )
+ {
+ case AEES_STMNT_NOTHING:
+ case AEES_STMNT_FINAL:
+ case AEES_STMNT_DESTROY:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ tmpListOfInputED.append( tmpED );
+
+ break;
+ }
+
+ case AEES_OK:
+ case AEES_STEP_RESUME:
+ {
+ tmpListOfInputED.append( tmpED );
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as outEDS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+
+ // IRQ EDS traitement
+ while( stmntENV.irqEDS.nonempty() )
+ {
+ stmntENV.irqEDS.pop_last_to( tmpED );
+
+ switch( tmpED->getAEES() )
+ {
+ case AEES_STMNT_BREAK:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ ENV.outEDS.append( tmpED );
+
+ break;
+ }
+ case AEES_STMNT_RETURN:
+ {
+ ENV.irqEDS.append( tmpED );
+
+ break;
+ }
+
+ case AEES_STMNT_CONTINUE:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ // Evaluation of FOR INCREMENT statement
+ tmpListOfInputED.append( tmpED );
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as irqEDS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+
+
+ // Sync EDS traitement
+ ENV.spliceSync_mwStorePos(stmntENV);
+ }
+
+ ENV.spliceNotOutput(stmntENV);
+
+ return( true );
+}
+
+
+bool AvmPrimitive_WhileDo::resume(ExecutionEnvironment & ENV)
+{
+ return( run( ENV ) );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of a WHILE program
+ ***************************************************************************
+ */
+bool AvmPrimitive_DoWhile::run(ExecutionEnvironment & ENV)
+{
+ const BFCode & doStmnt = ENV.inCODE->first().bfCode();
+ const BF & whileCond = ENV.inCODE->second();
+
+ ListOfAPExecutionData tmpListOfInputED( ENV.inED );
+
+ ExecutionEnvironment stmntENV(ENV, BFCode::REF_NULL);
+
+ APExecutionData tmpED;
+
+ while( tmpListOfInputED.nonempty() )
+ {
+ // Evaluation of DO_WHILE STATEMENT
+ if( not stmntENV.run(tmpListOfInputED, doStmnt) )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Failed to RUN DO_WHILE< STATEMENT > !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ tmpListOfInputED.clear();
+
+ // OUTPUT EDS traitement
+ while( stmntENV.outEDS.nonempty() )
+ {
+ stmntENV.outEDS.pop_last_to( tmpED );
+
+ switch( tmpED->getAEES() )
+ {
+ case AEES_STMNT_NOTHING:
+ case AEES_STMNT_FINAL:
+ case AEES_STMNT_DESTROY:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ //!!! NO << break >> for these statement
+ }
+ case AEES_OK:
+ case AEES_STEP_RESUME:
+ {
+ // Evaluation of DO_WHILE CONDITION
+ EvaluationEnvironment condENV(ENV, tmpED);
+ if( not condENV.evalBoolean(whileCond) )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Failed to EVAL WHILE_DO< CONDITION > !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ ENV.spliceFailure(condENV);
+
+
+
+ if( condENV.outVAL.isEqualTrue() )
+ {
+ tmpListOfInputED.append( condENV.outED );
+ }
+ else if( condENV.outVAL.isEqualFalse() )
+ {
+ ENV.outEDS.append( tmpED );
+ }
+ else
+ {
+ tmpListOfInputED.clear();
+
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Throw unexpected "
+ "NON CONCRETE BOOLEAN VALUE FOR CONDITION : "
+ << tmpED->mRID.strUniqId()
+ << " ," << str_indent( condENV.outVAL )
+ << " |=>" << whileCond.str() << " !!!"
+ << SEND_EXIT;
+ }
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as outEDS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+
+ // IRQ EDS traitement
+ while( stmntENV.irqEDS.nonempty() )
+ {
+ stmntENV.irqEDS.pop_last_to( tmpED );
+
+ switch( tmpED->getAEES() )
+ {
+ case AEES_STMNT_BREAK:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ ENV.outEDS.append( tmpED );
+
+ break;
+ }
+ case AEES_STMNT_RETURN:
+ {
+ ENV.irqEDS.append( tmpED );
+
+ break;
+ }
+
+ case AEES_STMNT_CONTINUE:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ // Evaluation of DO_WHILE CONDITION
+ EvaluationEnvironment condENV(ENV, tmpED);
+ if( not condENV.evalBoolean(whileCond) )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Failed to EVAL WHILE_DO< CONDITION > !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ ENV.spliceFailure(condENV);
+
+
+ if( condENV.outVAL.isEqualTrue() )
+ {
+ tmpListOfInputED.append( condENV.outED );
+ }
+ else if( condENV.outVAL.isEqualFalse() )
+ {
+ ENV.outEDS.append( tmpED );
+ }
+ else
+ {
+ tmpListOfInputED.clear();
+
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Throw unexpected "
+ "NON CONCRETE BOOLEAN VALUE FOR CONDITION : "
+ << tmpED->mRID.strUniqId()
+ << " ," << str_indent( condENV.outVAL )
+ << " |=>" << whileCond.str() << " !!!"
+ << SEND_EXIT;
+ }
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as irqEDS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+
+ // Sync EDS traitement
+ ENV.spliceSync_mwStorePos(stmntENV);
+ }
+
+ ENV.spliceNotOutput(stmntENV);
+
+ return( true );
+}
+
+
+bool AvmPrimitive_DoWhile::resume(ExecutionEnvironment & ENV)
+{
+ const BFCode & doStmnt = ENV.inCODE->first().bfCode();
+ const BF & whileCond = ENV.inCODE->second();
+
+ ListOfAPExecutionData tmpListOfInputED( ENV.inED );
+
+ ExecutionEnvironment stmntENV(ENV, BFCode::REF_NULL);
+
+ APExecutionData tmpED;
+
+ while( tmpListOfInputED.nonempty() )
+ {
+ tmpListOfInputED.pop_first_to( tmpED );
+
+ // Evaluation of WHILE_DO CONDITION
+ EvaluationEnvironment condENV(ENV, tmpED);
+ if( not condENV.evalBoolean(whileCond) )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Failed to EVAL WHILE_DO< CONDITION > !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ ENV.spliceFailure(condENV);
+
+
+ if( condENV.outVAL.isEqualTrue() )
+ {
+ // Evaluation of WHILE_DO STATEMENT
+ if( not stmntENV.run(condENV.outED, doStmnt) )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Failed to RUN WHILE_DO< STATEMENT > !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ else if( condENV.outVAL.isEqualFalse() )
+ {
+ ENV.outEDS.append( tmpED );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Throw unexpected "
+ "NON CONCRETE BOOLEAN VALUE FOR CONDITION : "
+ << tmpED->mRID.strUniqId()
+ << " ," << str_indent( condENV.outVAL )
+ << " |=>" << whileCond.str() << " !!!"
+ << SEND_EXIT;
+ }
+
+ // OUTPUT EDS traitement
+ while( stmntENV.outEDS.nonempty() )
+ {
+ stmntENV.outEDS.pop_last_to( tmpED );
+
+ switch( tmpED->getAEES() )
+ {
+ case AEES_STMNT_NOTHING:
+ case AEES_STMNT_FINAL:
+ case AEES_STMNT_DESTROY:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ tmpListOfInputED.append( tmpED );
+
+ break;
+ }
+
+ case AEES_OK:
+ case AEES_STEP_RESUME:
+ {
+ tmpListOfInputED.append( tmpED );
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as outEDS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+
+ // IRQ EDS traitement
+ while( stmntENV.irqEDS.nonempty() )
+ {
+ stmntENV.irqEDS.pop_last_to( tmpED );
+
+ switch( tmpED->getAEES() )
+ {
+ case AEES_STMNT_BREAK:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ ENV.outEDS.append( tmpED );
+
+ break;
+ }
+ case AEES_STMNT_RETURN:
+ {
+ ENV.irqEDS.append( tmpED );
+
+ break;
+ }
+
+ case AEES_STMNT_CONTINUE:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ // Evaluation of FOR INCREMENT statement
+ tmpListOfInputED.append( tmpED );
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as irqEDS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+
+ // Sync EDS traitement
+ ENV.spliceSync_mwStorePos(stmntENV);
+ }
+
+ ENV.spliceNotOutput(stmntENV);
+
+ return( true );
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmIterationPrimitive.h b/org.eclipse.efm.symbex/src/computer/primitive/AvmIterationPrimitive.h
new file mode 100644
index 0000000..ad54bdd
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmIterationPrimitive.h
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMITERATIONPRIMITIVE_H_
+#define AVMITERATIONPRIMITIVE_H_
+
+#include <common/BF.h>
+#include <computer/primitive/BaseAvmPrimitive.h>
+
+
+namespace sep
+{
+
+
+AVM_PRIMITIVE_RUN_RESUME_CLASS_HEADER(For, BaseAvmPrimitive)
+ bool run(ExecutionEnvironment & ENV, const BF & initStmnt);
+};
+
+
+AVM_PRIMITIVE_RUN_CLASS(Foreach, BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_RUN_RESUME_CLASS(WhileDo, BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_RUN_RESUME_CLASS(DoWhile, BaseAvmPrimitive)
+
+
+}
+
+#endif /* AVMITERATIONPRIMITIVE_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmJumpPrimitive.cpp b/org.eclipse.efm.symbex/src/computer/primitive/AvmJumpPrimitive.cpp
new file mode 100644
index 0000000..5680ab0
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmJumpPrimitive.cpp
@@ -0,0 +1,140 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmJumpPrimitive.h"
+
+#include <computer/ExecutionDataFactory.h>
+
+#include <computer/EvaluationEnvironment.h>
+#include <computer/ExecutionEnvironment.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/builtin/String.h>
+
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/ExecutionData.h>
+
+
+namespace sep
+{
+
+
+/**
+ ***************************************************************************
+ * execution of a BREAK program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Break::run(ExecutionEnvironment & ENV)
+{
+ APExecutionData outED = ENV.inED;
+
+ ENV.appendIrq_mwsetAEES(outED, AEES_STMNT_BREAK);
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a CONTINUE program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Continue::run(ExecutionEnvironment & ENV)
+{
+ APExecutionData outED = ENV.inED;
+
+ ENV.appendIrq_mwsetAEES(outED, AEES_STMNT_CONTINUE);
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a RETURN program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Return::run(ExecutionEnvironment & ENV)
+{
+ if( ENV.inCODE->nonempty() )
+ {
+ ENV.mARG->outED->mVALUE = ENV.mARG->at(0);
+
+ ENV.appendIrq_mwsetAEES(ENV.mARG->outED, AEES_STMNT_RETURN);
+ }
+ else
+ {
+ APExecutionData outED = ENV.inED;
+
+ ENV.appendIrq_mwsetAEES(outED, AEES_STMNT_RETURN);
+ }
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a EXIT program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Exit::run(ExecutionEnvironment & ENV)
+{
+ APExecutionData outED = ENV.inED;
+
+ if( ENV.inCODE->empty() )
+ {
+ ENV.appendExit_mwsetAEES(outED, AEES_STMNT_EXIT);
+ }
+ else
+ {
+ ENV.appendExit_mwsetAEES(outED, AEES_STMNT_EXIT_ALL);
+
+ }
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a TRACE STEP program
+ ***************************************************************************
+ */
+bool AvmPrimitive_StepMark::run(ExecutionEnvironment & ENV)
+{
+ APExecutionData outED = ENV.inED;
+
+ if( ENV.inCODE->nonempty() )
+ {
+ if( ENV.inCODE->first().isBuiltinString() )
+ {
+ ExecutionDataFactory::appendIOElementTrace(outED, ENV.inCODE->first());
+ }
+ else
+ {
+ ExecutionDataFactory::appendIOElementTrace(outED,
+ BF( new String( ENV.inCODE->first().str() )) );
+ }
+ }
+
+ ENV.appendSync_mwsetAEES(outED, AEES_STEP_MARK);
+
+ return( true );
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmJumpPrimitive.h b/org.eclipse.efm.symbex/src/computer/primitive/AvmJumpPrimitive.h
new file mode 100644
index 0000000..d750c72
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmJumpPrimitive.h
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMJUMPPRIMITIVE_H_
+#define AVMJUMPPRIMITIVE_H_
+
+#include <computer/primitive/BaseAvmPrimitive.h>
+
+
+namespace sep
+{
+
+AVM_PRIMITIVE_RUN_CLASS(Break, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(Continue, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(Return, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(Exit, BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_RUN_CLASS(StepMark, BaseAvmPrimitive)
+
+
+
+}
+
+#endif /* AVMJUMPPRIMITIVE_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmLookupPrimitive.cpp b/org.eclipse.efm.symbex/src/computer/primitive/AvmLookupPrimitive.cpp
new file mode 100644
index 0000000..86cd5c9
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmLookupPrimitive.cpp
@@ -0,0 +1,632 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 3 juin 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmLookupPrimitive.h"
+
+#include <computer/EvaluationEnvironment.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/BuiltinArray.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/numeric/Float.h>
+#include <fml/numeric/Integer.h>
+
+#include <fml/type/TypeManager.h>
+
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// LOOKUP MACRO
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+#define linearInterpolation1D(x, xa, xb, ya, yb) \
+ ( ya + ( x - xa ) * (yb - ya) / (xb - xa) )
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// LOOKUP Int
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+double AvmPrimitive_Lookup_Int::lookup(double anInput,
+ ArrayFloat * anInputTable, ArrayFloat * anOutputTable)
+{
+ avm_offset_t index = 0;
+
+ for( ; index < anInputTable->size() ; ++index )
+ {
+ if( anInputTable->get(index) >= anInput )
+ {
+ break;
+ }
+ }
+
+ if( index == anInputTable->size() )
+ {
+ return anOutputTable->get(index-1);
+ }
+ else if( index == 0 )
+ {
+ return anOutputTable->get(0);
+ }
+ else if( anInput == anInputTable->get(index) )
+ {
+ return anOutputTable->get(index);
+ }
+ else
+ {
+ return linearInterpolation1D(anInput, anInputTable->get(index-1),
+ anInputTable->get(index), anOutputTable->get(index-1),
+ anOutputTable->get(index));
+ }
+}
+
+
+bool AvmPrimitive_Lookup_Int::seval(EvaluationEnvironment & ENV)
+{
+ BF inputValue = ENV.mARG->at(0);
+
+ const BF & inputTable = ENV.mARG->at(1);
+ const BF & outputTable = ENV.mARG->at(2);
+
+ // CASE of NUMERIC VALUE
+ if( inputValue.isInteger() )
+ {
+ ENV.outVAL = ExpressionConstructor::newExpr(
+ lookup(inputValue.toInteger(),
+ inputTable.to_ptr< ArrayFloat >(),
+ outputTable.to_ptr< ArrayFloat >()) );
+ }
+ else if( inputValue.isFloat() )
+ {
+ ENV.outVAL = ExpressionConstructor::newExpr(
+ lookup(inputValue.toFloat(),
+ inputTable.to_ptr< ArrayFloat >(),
+ outputTable.to_ptr< ArrayFloat >()) );
+ }
+ // CASE of SYMBOLIC VALUE
+ else if( inputValue.is< InstanceOfData >() )
+ {
+ ENV.outVAL = ENV.create(ENV.outED->mRID,
+ "lookupInt", TypeManager::FLOAT,
+ ExpressionConstructor::newCode(ENV.inCODE->getOperator(),
+ inputValue, inputTable, outputTable));
+ }
+ // CASE of SYMBOLIC EXPRESSION
+ else
+ {
+ ENV.outVAL = ENV.create(ENV.outED->mRID,
+ "lookupInt", TypeManager::FLOAT,
+ ExpressionConstructor::newCode(ENV.inCODE->getOperator(),
+ inputValue, inputTable, outputTable));
+ }
+
+ return( true );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// LOOKUP IntExt
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+double AvmPrimitive_Lookup_IntExt::lookup(double anInput,
+ ArrayFloat * anInputTable, ArrayFloat * anOutputTable)
+{
+ avm_offset_t index = 0;
+
+ for( ; index < anInputTable->size() ; ++index )
+ {
+ if( anInputTable->get(index) >= anInput )
+ {
+ break;
+ }
+ }
+
+ if( index == anInputTable->size() )
+ {
+ return linearInterpolation1D(anInput, anInputTable->get(index-2),
+ anInputTable->get(index-1), anOutputTable->get(index-2),
+ anOutputTable->get(index-1));
+ }
+ else if( anInput == anInputTable->get(index) )
+ {
+ return anOutputTable->get(index);
+ }
+ else if( index == 0 )
+ {
+ return linearInterpolation1D(anInput, anInputTable->get(0),
+ anInputTable->get(1), anOutputTable->get(0),
+ anOutputTable->get(1));
+ }
+ else
+ {
+ return linearInterpolation1D(anInput, anInputTable->get(index-1),
+ anInputTable->get(index), anOutputTable->get(index-1),
+ anOutputTable->get(index));
+ }
+}
+
+
+bool AvmPrimitive_Lookup_IntExt::seval(EvaluationEnvironment & ENV)
+{
+ BF inputValue = ENV.mARG->at(0);
+
+ const BF & inputTable = ENV.mARG->at(1);
+ const BF & outputTable = ENV.mARG->at(2);
+
+ // CASE of NUMERIC VALUE
+ if( inputValue.isInteger() )
+ {
+ ENV.outVAL = ExpressionConstructor::newExpr(
+ lookup(inputValue.toInteger(),
+ inputTable.to_ptr< ArrayFloat >(),
+ outputTable.to_ptr< ArrayFloat >()) );
+ }
+ else if( inputValue.isFloat() )
+ {
+ ENV.outVAL = ExpressionConstructor::newExpr(
+ lookup(inputValue.toFloat(),
+ inputTable.to_ptr< ArrayFloat >(),
+ outputTable.to_ptr< ArrayFloat >()) );
+ }
+ // CASE of SYMBOLIC VALUE
+ else if( inputValue.is< InstanceOfData >() )
+ {
+ ENV.outVAL = ENV.create(ENV.outED->mRID,
+ "lookupIntExt", TypeManager::FLOAT,
+ ExpressionConstructor::newCode(ENV.inCODE->getOperator(),
+ inputValue, inputTable, outputTable));
+ }
+ // CASE of SYMBOLIC EXPRESSION
+ else
+ {
+ ENV.outVAL = ENV.create(ENV.outED->mRID,
+ "lookupIntExt", TypeManager::FLOAT,
+ ExpressionConstructor::newCode(ENV.inCODE->getOperator(),
+ inputValue, inputTable, outputTable));
+ }
+
+ return( true );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// LOOKUP Nearest
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+double AvmPrimitive_Lookup_Nearest::lookup(double anInput,
+ ArrayFloat * anInputTable, ArrayFloat * anOutputTable)
+{
+ avm_offset_t index = 0;
+
+ for( ; index < anInputTable->size() ; ++index )
+ {
+ if( anInputTable->get(index) >= anInput )
+ {
+ break;
+ }
+ }
+
+ if( index == anInputTable->size() )
+ {
+ index = index - 1;
+ }
+ else if( index > 0 )
+ {
+ if( (anInput - anInputTable->get(index - 1)) <
+ (anInputTable->get(index) - anInput) )
+ {
+ index = index - 1;
+ }
+ }
+
+ return( anOutputTable->get(index) );
+}
+
+
+bool AvmPrimitive_Lookup_Nearest::seval(EvaluationEnvironment & ENV)
+{
+ BF inputValue = ENV.mARG->at(0);
+
+ const BF & inputTable = ENV.mARG->at(1);
+ const BF & outputTable = ENV.mARG->at(2);
+
+ // CASE of NUMERIC VALUE
+ if( inputValue.isInteger() )
+ {
+ ENV.outVAL = ExpressionConstructor::newExpr(
+ lookup(inputValue.toInteger(),
+ inputTable.to_ptr< ArrayFloat >(),
+ outputTable.to_ptr< ArrayFloat >()) );
+ }
+ else if( inputValue.isFloat() )
+ {
+ ENV.outVAL = ExpressionConstructor::newExpr(
+ lookup(inputValue.toFloat(),
+ inputTable.to_ptr< ArrayFloat >(),
+ outputTable.to_ptr< ArrayFloat >()) );
+ }
+ // CASE of SYMBOLIC VALUE
+ else if( inputValue.is< InstanceOfData >() )
+ {
+ ENV.outVAL = ENV.create(ENV.outED->mRID,
+ "lookupNearest", TypeManager::FLOAT,
+ ExpressionConstructor::newCode(ENV.inCODE->getOperator(),
+ inputValue, inputTable, outputTable));
+ }
+ // CASE of SYMBOLIC EXPRESSION
+ else
+ {
+ ENV.outVAL = ENV.create(ENV.outED->mRID,
+ "lookupNearest", TypeManager::FLOAT,
+ ExpressionConstructor::newCode(ENV.inCODE->getOperator(),
+ inputValue, inputTable, outputTable));
+ }
+
+ return( true );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// LOOKUP Below
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+double AvmPrimitive_Lookup_Below::lookup(double anInput,
+ ArrayFloat * anInputTable, ArrayFloat * anOutputTable)
+{
+ avm_offset_t index = 0;
+
+ for( ; index < anInputTable->size() ; ++index )
+ {
+ if( anInputTable->get(index) >= anInput )
+ {
+ break;
+ }
+ }
+
+ if( (index > 0) && (anInputTable->get(index) != anInput))
+ {
+ index = index - 1;
+ }
+
+ return( anOutputTable->get(index) );
+}
+
+
+bool AvmPrimitive_Lookup_Below::seval(EvaluationEnvironment & ENV)
+{
+ BF inputValue = ENV.mARG->at(0);
+
+ const BF & inputTable = ENV.mARG->at(1);
+ const BF & outputTable = ENV.mARG->at(2);
+
+ // CASE of NUMERIC VALUE
+ if( inputValue.isInteger() )
+ {
+ ENV.outVAL = ExpressionConstructor::newExpr(
+ lookup(inputValue.toInteger(),
+ inputTable.to_ptr< ArrayFloat >(),
+ outputTable.to_ptr< ArrayFloat >()) );
+ }
+ else if( inputValue.isFloat() )
+ {
+ ENV.outVAL = ExpressionConstructor::newExpr(
+ lookup(inputValue.toFloat(),
+ inputTable.to_ptr< ArrayFloat >(),
+ outputTable.to_ptr< ArrayFloat >()) );
+ }
+ // CASE of SYMBOLIC VALUE
+ else if( inputValue.is< InstanceOfData >() )
+ {
+ ENV.outVAL = ENV.create(ENV.outED->mRID,
+ "lookupBelow", TypeManager::FLOAT,
+ ExpressionConstructor::newCode(ENV.inCODE->getOperator(),
+ inputValue, inputTable, outputTable));
+ }
+ // CASE of SYMBOLIC EXPRESSION
+ else
+ {
+ ENV.outVAL = ENV.create(ENV.outED->mRID,
+ "lookupBelow", TypeManager::FLOAT,
+ ExpressionConstructor::newCode(ENV.inCODE->getOperator(),
+ inputValue, inputTable, outputTable));
+ }
+
+ return( true );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// LOOKUP Above
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+double AvmPrimitive_Lookup_Above::lookup(double anInput,
+ ArrayFloat * anInputTable, ArrayFloat * anOutputTable)
+{
+ avm_offset_t index = 0;
+
+ for( ; index < anInputTable->size() ; ++index )
+ {
+ if( anInputTable->get(index) >= anInput )
+ {
+ break;
+ }
+ }
+
+ if( (index == anInputTable->size()) &&
+ (anInputTable->get(index) != anInput))
+ {
+ index = index - 1;
+ }
+
+ return( anOutputTable->get(index) );
+}
+
+
+bool AvmPrimitive_Lookup_Above::seval(EvaluationEnvironment & ENV)
+{
+ BF inputValue = ENV.mARG->at(0);
+
+ const BF & inputTable = ENV.mARG->at(1);
+ const BF & outputTable = ENV.mARG->at(2);
+
+ // CASE of NUMERIC VALUE
+ if( inputValue.isInteger() )
+ {
+ ENV.outVAL = ExpressionConstructor::newExpr(
+ lookup(inputValue.toInteger(),
+ inputTable.to_ptr< ArrayFloat >(),
+ outputTable.to_ptr< ArrayFloat >()) );
+ }
+ else if( inputValue.isFloat() )
+ {
+ ENV.outVAL = ExpressionConstructor::newExpr(
+ lookup(inputValue.toFloat(),
+ inputTable.to_ptr< ArrayFloat >(),
+ outputTable.to_ptr< ArrayFloat >()) );
+ }
+ // CASE of SYMBOLIC VALUE
+ else if( inputValue.is< InstanceOfData >() )
+ {
+ ENV.outVAL = ENV.create(ENV.outED->mRID,
+ "lookupAbove", TypeManager::FLOAT,
+ ExpressionConstructor::newCode(ENV.inCODE->getOperator(),
+ inputValue, inputTable, outputTable));
+ }
+ // CASE of SYMBOLIC EXPRESSION
+ else
+ {
+ ENV.outVAL = ENV.create(ENV.outED->mRID,
+ "lookupAbove", TypeManager::FLOAT,
+ ExpressionConstructor::newCode(ENV.inCODE->getOperator(),
+ inputValue, inputTable, outputTable));
+ }
+
+ return( true );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// LOOKUP2D IntExt
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+double AvmPrimitive_Lookup2D_IntExt::lookup2D(
+ double anInput1, double anInput2,
+ ArrayFloat * anInputTable1, ArrayFloat * anInputTable2,
+ ArrayBF * anOutputTable)
+{
+ // Recherche ic1 et ic2 (index des colonnes à considérer)
+ avm_offset_t index = 0;
+ for( ; index < anInputTable2->size() ; ++index )
+ {
+ if( anInputTable2->get(index) >= anInput2 )
+ {
+ break;
+ }
+ }
+
+ avm_offset_t il1;
+ avm_offset_t il2;
+ avm_offset_t ic1;
+ avm_offset_t ic2;
+
+ if( index == anInputTable2->size() )
+ {
+ ic1 = index-2;
+ ic2 = index-1;
+ }
+ else if( anInput2 == anInputTable2->get(index) )
+ {
+ ic1 = index;
+ ic2 = index;
+ }
+ else if( index == 0 )
+ {
+ ic1 = 0;
+ ic2 = 1;
+ }
+ else
+ {
+ ic1 = index-1;
+ ic2 = index;
+ }
+
+ // Interpolation linéaire de anInput1 sur il1 puis sur il2
+ index = 0;
+ for( ; index < anInputTable1->size() ; ++index )
+ {
+ if( anInputTable1->get(index) >= anInput1 )
+ {
+ break;
+ }
+ }
+
+ double intermediateResult1;
+ double intermediateResult2;
+ if( index == anInputTable1->size() )
+ {
+ il1 = index - 2;
+ il2 = index - 1;
+
+ intermediateResult1 = linearInterpolation1D(anInput1,
+ anInputTable1->get(il1),anInputTable1->get(il2),
+ anOutputTable->at(il1).to_ptr< ArrayFloat >()->get(ic1),
+ anOutputTable->at(il1).to_ptr< ArrayFloat >()->get(ic2));
+
+ intermediateResult2 = linearInterpolation1D(anInput1,
+ anInputTable1->get(il1),anInputTable1->get(il2),
+ anOutputTable->at(il2).to_ptr< ArrayFloat >()->get(ic1),
+ anOutputTable->at(il2).to_ptr< ArrayFloat >()->get(ic2));
+ }
+ else if( anInput1 == anInputTable1->get(index) )
+ {
+ intermediateResult1 =
+ anOutputTable->at(index).to_ptr< ArrayFloat >()->get(ic1);
+
+ intermediateResult2 =
+ anOutputTable->at(index).to_ptr< ArrayFloat >()->get(ic2);
+ }
+ else if( index == 0 )
+ {
+ intermediateResult1 = linearInterpolation1D(anInput1,
+ anInputTable1->get(0),anInputTable1->get(1),
+ anOutputTable->at(0).to_ptr< ArrayFloat >()->get(ic1),
+ anOutputTable->at(1).to_ptr< ArrayFloat >()->get(ic1));
+
+ intermediateResult2 = linearInterpolation1D(anInput1,
+ anInputTable1->get(0),anInputTable1->get(1),
+ anOutputTable->at(0).to_ptr< ArrayFloat >()->get(ic2),
+ anOutputTable->at(1).to_ptr< ArrayFloat >()->get(ic2));
+ }
+ else
+ {
+ intermediateResult1 = linearInterpolation1D(anInput1,
+ anInputTable1->get(index-1),anInputTable1->get(index),
+ anOutputTable->at(index-1).to_ptr< ArrayFloat >()->get(ic1),
+ anOutputTable->at(index).to_ptr< ArrayFloat >()->get(ic1));
+
+ intermediateResult2 = linearInterpolation1D(anInput1,
+ anInputTable1->get(index-1),anInputTable1->get(index),
+ anOutputTable->at(index-1).to_ptr< ArrayFloat >()->get(ic2),
+ anOutputTable->at(index).to_ptr< ArrayFloat >()->get(ic2));
+ }
+
+ if ( ic1 == ic2 )
+ {
+ return( intermediateResult1 );
+ }
+
+ return( ((anInputTable2->get(ic2) - anInput2) /
+ (anInputTable2->get(ic2) - anInputTable2->get(ic1)) * intermediateResult1) +
+ ((anInput2 - anInputTable2->get(ic1)) /
+ (anInputTable2->get(ic2) - anInputTable2->get(ic1)) * intermediateResult2) );
+}
+
+
+bool AvmPrimitive_Lookup2D_IntExt::seval(EvaluationEnvironment & ENV)
+{
+ BF inputValue1 = ENV.mARG->at(0);
+ BF inputValue2 = ENV.mARG->at(1);
+
+ const BF & inputTable1 = ENV.mARG->at(2);
+ const BF & inputTable2 = ENV.mARG->at(3);
+ const BF & outputTable = ENV.mARG->at(4);
+
+
+ double fInput1;
+ // CASE of NUMERIC VALUE
+ if( inputValue1.isInteger() )
+ {
+ fInput1 = inputValue1.toInteger();
+ }
+ else if( inputValue1.isFloat() )
+ {
+ fInput1 = inputValue1.toFloat();
+ }
+ // CASE of SYMBOLIC VALUE
+ else if( inputValue1.is< InstanceOfData >() ||
+ inputValue2.is< InstanceOfData >() )
+ {
+ ENV.outVAL = ENV.create(ENV.outED->mRID, "lookup2DIntExt",
+ TypeManager::FLOAT, ExpressionConstructor::newCode(
+ ENV.inCODE->getOperator(), inputValue1, inputValue2,
+ inputTable1, inputTable2, outputTable ) );
+ return( true );
+ }
+ // CASE of SYMBOLIC EXPRESSION
+ else
+ {
+ ENV.outVAL = ENV.create(ENV.outED->mRID, "lookup2DIntExt",
+ TypeManager::FLOAT, ExpressionConstructor::newCode(
+ ENV.inCODE->getOperator(), inputValue1, inputValue2,
+ inputTable1, inputTable2, outputTable ) );
+ return( true );
+ }
+
+ // CASE of NUMERIC VALUE
+ if( inputValue2.isInteger() )
+ {
+ ENV.outVAL = ExpressionConstructor::newExpr(
+ lookup2D(fInput1, inputValue2.toInteger(),
+ inputTable1.to_ptr< ArrayFloat >(),
+ inputTable2.to_ptr< ArrayFloat >(),
+ outputTable.to_ptr< ArrayBF >()) );
+ }
+ else if( inputValue2.isFloat() )
+ {
+ ENV.outVAL = ExpressionConstructor::newExpr(
+ lookup2D(fInput1, inputValue2.toFloat(),
+ inputTable1.to_ptr< ArrayFloat >(),
+ inputTable2.to_ptr< ArrayFloat >(),
+ outputTable.to_ptr< ArrayBF >()) );
+ }
+ // CASE of SYMBOLIC EXPRESSION
+ else
+ {
+ ENV.outVAL = ENV.create(ENV.outED->mRID, "lookup2DIntExt",
+ TypeManager::FLOAT, ExpressionConstructor::newCode(
+ ENV.inCODE->getOperator(), inputValue1, inputValue2,
+ inputTable1, inputTable2, outputTable ) );
+ }
+
+ return( true );
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmLookupPrimitive.h b/org.eclipse.efm.symbex/src/computer/primitive/AvmLookupPrimitive.h
new file mode 100644
index 0000000..8d8d532
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmLookupPrimitive.h
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 3 juin 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMLOOKUPPRIMITIVE_H_
+#define AVMLOOKUPPRIMITIVE_H_
+
+#include <computer/primitive/BaseAvmPrimitive.h>
+
+#include <fml/expression/BuiltinArray.h>
+
+
+
+namespace sep
+{
+
+
+AVM_PRIMITIVE_EVAL_CLASS_HEADER(Lookup_Int, BaseAvmPrimitive)
+ static double lookup(double anInput,
+ ArrayFloat * anInputTable, ArrayFloat * anOutputTable);
+};
+
+
+AVM_PRIMITIVE_EVAL_CLASS_HEADER(Lookup_IntExt, BaseAvmPrimitive)
+ static double lookup(double anInput,
+ ArrayFloat * anInputTable, ArrayFloat * anOutputTable);
+};
+
+
+AVM_PRIMITIVE_EVAL_CLASS_HEADER(Lookup_Nearest, BaseAvmPrimitive)
+ static double lookup(double anInput,
+ ArrayFloat * anInputTable, ArrayFloat * anOutputTable);
+};
+
+
+AVM_PRIMITIVE_EVAL_CLASS_HEADER(Lookup_Below, BaseAvmPrimitive)
+ static double lookup(double anInput,
+ ArrayFloat * anInputTable, ArrayFloat * anOutputTable);
+};
+
+
+AVM_PRIMITIVE_EVAL_CLASS_HEADER(Lookup_Above, BaseAvmPrimitive)
+ static double lookup(double anInput,
+ ArrayFloat * anInputTable, ArrayFloat * anOutputTable);
+};
+
+
+AVM_PRIMITIVE_EVAL_CLASS_HEADER(Lookup2D_IntExt, BaseAvmPrimitive)
+ static double lookup2D(double anInput1, double anInput2,
+ ArrayFloat * anInputTable1, ArrayFloat * anInputTable2,
+ ArrayBF * anOutputTable);
+};
+
+
+
+}
+
+#endif /* AVMLOOKUPPRIMITIVE_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmMathPrimitive.cpp b/org.eclipse.efm.symbex/src/computer/primitive/AvmMathPrimitive.cpp
new file mode 100644
index 0000000..f49b8bd
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmMathPrimitive.cpp
@@ -0,0 +1,379 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 3 juin 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmMathPrimitive.h"
+
+#include <computer/EvaluationEnvironment.h>
+#include <computer/ExecutionEnvironment.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/ExpressionEval.h>
+
+
+namespace sep
+{
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH MIN
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_MIN::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionEval::min( ENV.mARG->at(0).bfCode() );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH MAX
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_MAX::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionEval::max( ENV.mARG->at(0).bfCode() );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH RANDOM
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_RANDOM::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionEval::random( ENV.mARG->at(0) );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH ABS
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_ABS::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionEval::abs( ENV.mARG->at(0) );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH CEIL
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_CEIL::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionEval::ceil( ENV.mARG->at(0) );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH FLOOR
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_FLOOR::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionEval::floor( ENV.mARG->at(0) );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH ROUND
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_ROUND::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionEval::round( ENV.mARG->at(0) );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH TRUNCATE
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_TRUNCATE::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionEval::truncate( ENV.mARG->at(0) );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH MOD
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_MOD::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionEval::mod(ENV.mARG->at(0), ENV.mARG->at(1));
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH SQRT
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_SQRT::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionEval::sqrt( ENV.mARG->at(0) );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH EXP
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_EXP::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionEval::exp( ENV.mARG->at(0) );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH LOG
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_LOG::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionEval::log( ENV.mARG->at(0) );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH SIN
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_SIN::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionEval::sin( ENV.mARG->at(0) );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH COS
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_COS::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionEval::cos( ENV.mARG->at(0) );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH TAN
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_TAN::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionEval::tan( ENV.mARG->at(0) );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH SINH
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_SINH::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionEval::sinh( ENV.mARG->at(0) );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH COSH
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_COSH::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionEval::cosh( ENV.mARG->at(0) );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH TANH
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_TANH::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionEval::tanh( ENV.mARG->at(0) );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH ASIN
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_ASIN::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionEval::asin( ENV.mARG->at(0) );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH ACOS
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_ACOS::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionEval::acos( ENV.mARG->at(0) );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH ATAN
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_ATAN::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionEval::atan( ENV.mARG->at(0) );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH ATAN2
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_ATAN2::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionEval::atan2(ENV.mARG->at(1), ENV.mARG->at(1));
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH ASINH
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_ASINH::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionEval::asinh( ENV.mARG->at(0) );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH ACOSH
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_ACOSH::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionEval::acosh( ENV.mARG->at(0) );
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// MATH ATANH
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_ATANH::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ExpressionEval::atanh( ENV.mARG->at(0) );
+
+ return( true );
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmMathPrimitive.h b/org.eclipse.efm.symbex/src/computer/primitive/AvmMathPrimitive.h
new file mode 100644
index 0000000..cb659c8
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmMathPrimitive.h
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 3 juin 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMMATHPRIMITIVE_H_
+#define AVMMATHPRIMITIVE_H_
+
+#include <computer/primitive/BaseAvmPrimitive.h>
+
+
+namespace sep
+{
+
+
+// MIN - MAX
+AVM_PRIMITIVE_EVAL_CLASS(MIN, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(MAX, BaseAvmPrimitive)
+
+// RANDOM
+AVM_PRIMITIVE_EVAL_CLASS(RANDOM, BaseAvmPrimitive)
+
+// ABS
+AVM_PRIMITIVE_EVAL_CLASS(ABS, BaseAvmPrimitive)
+
+// ROUNDING
+AVM_PRIMITIVE_EVAL_CLASS(CEIL, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(FLOOR, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(ROUND, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(TRUNCATE, BaseAvmPrimitive)
+
+
+// MOD
+AVM_PRIMITIVE_EVAL_CLASS(MOD, BaseAvmPrimitive)
+
+// EXP - LOG
+AVM_PRIMITIVE_EVAL_CLASS(SQRT, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_EVAL_CLASS(EXP, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(LOG, BaseAvmPrimitive)
+
+// TRIGONOMETRIC
+AVM_PRIMITIVE_EVAL_CLASS(SIN, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(COS, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(TAN, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_EVAL_CLASS(SINH, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(COSH, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(TANH, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_EVAL_CLASS(ASIN, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(ACOS, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(ATAN, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(ATAN2, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_EVAL_CLASS(ASINH, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(ACOSH, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(ATANH, BaseAvmPrimitive)
+
+
+
+}
+
+#endif /* AVMMATHPRIMITIVE_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmMetaPrimitive.cpp b/org.eclipse.efm.symbex/src/computer/primitive/AvmMetaPrimitive.cpp
new file mode 100644
index 0000000..19b7e33
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmMetaPrimitive.cpp
@@ -0,0 +1,303 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 14 mars 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmMetaPrimitive.h"
+
+#include <computer/EvaluationEnvironment.h>
+#include <computer/ExecutionDataFactory.h>
+#include <computer/ExecutionEnvironment.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/runtime/ExecutionConfiguration.h>
+
+
+namespace sep
+{
+
+
+/**
+ ***************************************************************************
+ * execution of an INFORMAL program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Informal::seval(EvaluationEnvironment & ENV)
+{
+ ExecutionDataFactory::appendIOElementTrace(ENV.outED,
+ BF(new ExecutionConfiguration(ENV.outED->mRID, ENV.inCODE)) );
+
+ return( true );
+}
+
+
+bool AvmPrimitive_Informal::run(ExecutionEnvironment & ENV)
+{
+ APExecutionData outED = ENV.inED;
+
+ ExecutionDataFactory::appendIOElementTrace(outED,
+ BF(new ExecutionConfiguration(outED->mRID, ENV.inCODE)) );
+
+ ENV.outEDS.append(outED);
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of an TRACE program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Trace::seval(EvaluationEnvironment & ENV)
+{
+ ExecutionDataFactory::appendIOElementTrace(ENV.outED,
+ BF(new ExecutionConfiguration(ENV.outED->mRID, ENV.inCODE)) );
+
+ return( true );
+}
+
+
+bool AvmPrimitive_Trace::run(ExecutionEnvironment & ENV)
+{
+ APExecutionData outED = ENV.inED;
+
+ ExecutionDataFactory::appendIOElementTrace(outED,
+ BF(new ExecutionConfiguration(outED->mRID, ENV.inCODE)) );
+
+ ENV.outEDS.append(outED);
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of an DEBUG program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Debug::seval(EvaluationEnvironment & ENV)
+{
+ if( ENV.inCODE->empty() )
+ {
+ ExecutionDataFactory::appendIOElementTrace(ENV.outED,
+ BF(new ExecutionConfiguration(ENV.outED->mRID, ENV.inCODE)) );
+ }
+ else
+ {
+ ExecutionDataFactory::appendIOElementTrace(ENV.outED,
+ BF(new ExecutionConfiguration(ENV.outED->mRID,
+ ENV.mARG->at(0))) );
+ }
+
+ return( true );
+}
+
+
+bool AvmPrimitive_Debug::run(ExecutionEnvironment & ENV)
+{
+ if( ENV.inCODE->empty() )
+ {
+ APExecutionData outED = ENV.inED;
+
+ ExecutionDataFactory::appendIOElementTrace(outED,
+ BF(new ExecutionConfiguration(outED->mRID, ENV.inCODE)) );
+
+ ENV.outEDS.append(outED);
+ }
+ else
+ {
+ ExecutionDataFactory::appendIOElementTrace(ENV.mARG->outED,
+ BF(new ExecutionConfiguration(ENV.mARG->outED->mRID,
+ ENV.mARG->at(0))) );
+
+ ENV.outEDS.append(ENV.mARG->outED);
+ }
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of an COMMENT program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Comment::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ENV.inCODE;
+
+ return( true );
+}
+
+
+bool AvmPrimitive_Comment::run(ExecutionEnvironment & ENV)
+{
+ ENV.outEDS.append( ENV.inED );
+
+ return( true );
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of an QUOTE program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Quote::run(ExecutionEnvironment & ENV)
+{
+ ENV.outEDS.append( ENV.inED );
+
+ return( true );
+}
+
+
+bool AvmPrimitive_Quote::seval(EvaluationEnvironment & ENV)
+{
+ ENV.outVAL = ENV.inCODE->first();
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of an META_EVAL program
+ ***************************************************************************
+ */
+bool AvmPrimitive_MetaEval::run(ExecutionEnvironment & ENV)
+{
+ BF codeToEval = ENV.inCODE->first();
+
+ switch( codeToEval.classKind() )
+ {
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ codeToEval = ENV.getRvalue( codeToEval.to_ptr< InstanceOfData >() );
+
+ break;
+ }
+
+ case FORM_AVMCODE_KIND:
+ {
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_EXIT( FAILED )
+ << "AvmPrimitive_MetaEval::run:> Unexpected a form KIND< "
+ << codeToEval.classKindName() << " >\n" << codeToEval.toString()
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+
+
+ EvaluationEnvironment eENV(ENV, codeToEval);
+ if( eENV.decode_seval() )
+ {
+ ENV.outEDS.append(eENV.outED);
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+bool AvmPrimitive_MetaEval::seval(EvaluationEnvironment & ENV)
+{
+ BF codeToEval = ENV.inCODE->first();
+
+ switch( codeToEval.classKind() )
+ {
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ codeToEval = ENV.getRvalue( codeToEval.to_ptr< InstanceOfData >() );
+
+ return( ENV.seval(codeToEval) );
+ }
+
+ case FORM_AVMCODE_KIND:
+ {
+ ENV.setCode( codeToEval.bfCode() );
+
+ return( sevalx2(ENV) );
+ }
+
+ default:
+ {
+ AVM_OS_EXIT( FAILED )
+ << "AvmPrimitive_MetaEval::run:> Unexpected a form KIND< "
+ << codeToEval.classKindName() << " >\n" << codeToEval.toString()
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of an META_RUN program
+ ***************************************************************************
+ */
+bool AvmPrimitive_MetaRun::run(ExecutionEnvironment & ENV)
+{
+ BF codeToRun = ENV.inCODE->first();
+
+ switch( codeToRun.classKind() )
+ {
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ codeToRun = ENV.getRvalue( codeToRun.to_ptr< InstanceOfData >() );
+
+ break;
+ }
+
+ case FORM_AVMCODE_KIND:
+ {
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_EXIT( FAILED )
+ << "AvmPrimitive_MetaEval::run:> Unexpected a form KIND< "
+ << codeToRun.classKindName() << " >\n" << codeToRun.toString()
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+
+ if( codeToRun.is< AvmCode >() )
+ {
+ return( ENV.run(codeToRun) );
+ }
+
+ return( false );
+}
+
+
+
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmMetaPrimitive.h b/org.eclipse.efm.symbex/src/computer/primitive/AvmMetaPrimitive.h
new file mode 100644
index 0000000..ab4e65b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmMetaPrimitive.h
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 14 mars 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMMETAPRIMITIVE_H_
+#define AVMMETAPRIMITIVE_H_
+
+#include <computer/primitive/BaseAvmPrimitive.h>
+
+
+namespace sep
+{
+
+
+AVM_PRIMITIVE_RUN_EVAL_CLASS(Informal, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_EVAL_CLASS(Trace, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_EVAL_CLASS(Debug, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_EVAL_CLASS(Comment, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_EVAL_CLASS(Quote, BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_RUN_EVAL_CLASS(MetaEval, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(MetaRun, BaseAvmPrimitive)
+
+
+
+} /* namespace sep */
+#endif /* AVMMETAPRIMITIVE_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmPrimitiveProcessor.cpp b/org.eclipse.efm.symbex/src/computer/primitive/AvmPrimitiveProcessor.cpp
new file mode 100644
index 0000000..b6a7907
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmPrimitiveProcessor.cpp
@@ -0,0 +1,1766 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 18 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmPrimitiveProcessor.h"
+
+#include <computer/ExecutionEnvironment.h>
+
+#include <computer/primitive/BaseAvmPrimitive.h>
+
+#include <computer/primitive/AvmActivityPrimitive.h>
+#include <computer/primitive/AvmAssignPrimitive.h>
+#include <computer/primitive/AvmBitwisePrimitive.h>
+#include <computer/primitive/AvmBufferPrimitive.h>
+#include <computer/primitive/AvmCommunicationPrimitive.h>
+#include <computer/primitive/AvmConcurrencyPrimitive.h>
+#include <computer/primitive/AvmCtorPrimitive.h>
+#include <computer/primitive/AvmExpressionPrimitive.h>
+#include <computer/primitive/AvmGuardPrimitive.h>
+#include <computer/primitive/AvmInputEnabledPrimitive.h>
+#include <computer/primitive/AvmInvokePrimitive.h>
+#include <computer/primitive/AvmItePrimitive.h>
+#include <computer/primitive/AvmIterationPrimitive.h>
+#include <computer/primitive/AvmJumpPrimitive.h>
+#include <computer/primitive/AvmLookupPrimitive.h>
+#include <computer/primitive/AvmMathPrimitive.h>
+#include <computer/primitive/AvmMetaPrimitive.h>
+#include <computer/primitive/AvmSchedulingPrimitive.h>
+#include <computer/primitive/AvmSequencePrimitive.h>
+#include <computer/primitive/AvmStatusPrimitive.h>
+
+#include <computer/EvaluationEnvironment.h>
+#include <computer/ExecutionEnvironment.h>
+
+#include <computer/instruction/InstructionEnvironment.h>
+
+#include <fml/executable/ExecutableLib.h>
+
+#include <fml/operator/Operator.h>
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/runtime/RuntimeDef.h>
+#include <fml/runtime/RuntimeLib.h>
+
+#include <sew/SymbexEngine.h>
+
+
+namespace sep
+{
+
+
+/**
+ * DESTRUCTOR
+ */
+AvmPrimitiveProcessor::~AvmPrimitiveProcessor()
+{
+ VectorOfAvmPrimitive::iterator it = AVM_PRIMITIVE_TABLE.begin();
+ VectorOfAvmPrimitive::iterator endIt = AVM_PRIMITIVE_TABLE.end();
+ for( ; it != endIt ; ++it )
+ {
+ if( ((*it) != DEFAULT_AVM_PRIMITIVE) &&
+ ((*it) != DEFAULT_INVOKE_ROUTINE) &&
+ ((*it) != DEFAULT_EVAL_EXPRESSION_ALU) )
+ {
+ delete( *it );
+ }
+ }
+
+ delete( DEFAULT_AVM_PRIMITIVE );
+ delete( DEFAULT_INVOKE_ROUTINE );
+ delete( DEFAULT_EVAL_EXPRESSION_ALU );
+}
+
+
+/**
+ * GETTER
+ * Builder
+ * Loader
+ */
+Builder & AvmPrimitiveProcessor::getBuilder()
+{
+ return( mSymbexEngine.getBuilder() );
+}
+
+Loader & AvmPrimitiveProcessor::getLoader()
+{
+ return( mSymbexEngine.getLoader() );
+}
+
+
+
+/**
+ * CONFIGURE
+ */
+bool AvmPrimitiveProcessor::configure()
+{
+ DEFAULT_AVM_PRIMITIVE = new BaseAvmPrimitive( *this );
+
+ DEFAULT_INVOKE_ROUTINE = new AvmPrimitive_InvokeRoutine( *this );
+
+ DEFAULT_EVAL_EXPRESSION_ALU = new AvmPrimitive_EvalExpressionALU( *this );
+
+ AVM_PRIMITIVE_TABLE.resize(
+ OperatorManager::TABLE_OF_OPERATOR.size(),
+ DEFAULT_AVM_PRIMITIVE);
+
+ if( not configureOther() )
+ {
+ return( false );
+ }
+
+ if( not configureMeta() )
+ {
+ return( false );
+ }
+
+ if( not configureLambdaPrimitive() )
+ {
+ return( false );
+ }
+
+ if( not configureActivityPrimitive() )
+ {
+ return( false );
+ }
+
+ if( not configureStatusPrimitive() )
+ {
+ return( false );
+ }
+
+ if( not configureConcurrencyPrimitive() )
+ {
+ return( false );
+ }
+ if( not configureBasicPrimitive() )
+ {
+ return( false );
+ }
+
+ if( not configureArithmeticPrimitive() )
+ {
+ return( false );
+ }
+ if( not configureBitwisePrimitive() )
+ {
+ return( false );
+ }
+ if( not configureLogicPrimitive() )
+ {
+ return( false );
+ }
+
+ if( not configureLookupPrimitive() )
+ {
+ return( false );
+ }
+ if( not configureMathematicPrimitive() )
+ {
+ return( false );
+ }
+
+ if( not configureStringPrimitive() )
+ {
+ return( false );
+ }
+
+ if( not configureIoltPrimitive() )
+ {
+ return( false );
+ }
+
+ return( true );
+}
+
+
+
+#define OPCODE_COMPUTER( OPID ) \
+ AVM_PRIMITIVE_TABLE[ OperatorManager::OPERATOR_##OPID->getOffset() ]
+
+#define SET_OPCODE_COMPUTER( OPID , CLASS ) \
+ AVM_PRIMITIVE_TABLE[ OperatorManager::OPERATOR_##OPID->getOffset() ] = new CLASS(*this)
+
+
+
+
+bool AvmPrimitiveProcessor::configureOther()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM NOP STATEMENT
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPUTER( NOP ) = new AvmPrimitive_Nop( *this );
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM UFI STATEMENT
+ ////////////////////////////////////////////////////////////////////////////
+// OPCODE_COMPUTER( UFI ) = mAvmUfiPrimitive = new AvmPrimitive_Ufi( *this );
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM FORM CONSTRUCTOR STATEMENT
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPUTER( CTOR ) = new AvmPrimitive_Ctor( *this );
+
+
+ return( true );
+}
+
+
+bool AvmPrimitiveProcessor::configureMeta()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM META STATEMENT
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPUTER( INFORMAL ) = new AvmPrimitive_Informal( *this );
+
+ OPCODE_COMPUTER( TRACE ) = new AvmPrimitive_Trace( *this );
+
+ OPCODE_COMPUTER( DEBUG ) = new AvmPrimitive_Debug( *this );
+
+ OPCODE_COMPUTER( COMMENT ) = new AvmPrimitive_Comment( *this );
+
+ OPCODE_COMPUTER( QUOTE ) = new AvmPrimitive_Quote( *this );
+
+ OPCODE_COMPUTER( META_EVAL ) = new AvmPrimitive_MetaEval( *this );
+ OPCODE_COMPUTER( META_RUN ) = new AvmPrimitive_MetaRun( *this );
+
+
+ return( true );
+}
+
+
+bool AvmPrimitiveProcessor::configureLambdaPrimitive()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // LAMBDA STATEMENT
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPUTER( APPLY ) = DEFAULT_AVM_PRIMITIVE;
+
+ OPCODE_COMPUTER( LAMBDA ) = DEFAULT_AVM_PRIMITIVE;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // LET STATEMENT
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPUTER( LET ) = DEFAULT_AVM_PRIMITIVE;
+
+
+ return( true );
+}
+
+
+bool AvmPrimitiveProcessor::configureActivityPrimitive()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM MACHINE MANAGING
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPUTER( CONTEXT_SWITCHER ) = new AvmPrimitive_ContextSwitcher( *this );
+
+ OPCODE_COMPUTER( INIT ) = new AvmPrimitive_Init( *this );
+ OPCODE_COMPUTER( FINAL ) = new AvmPrimitive_Final( *this );
+ OPCODE_COMPUTER( DESTROY ) = new AvmPrimitive_Destroy( *this );
+
+ OPCODE_COMPUTER( START ) = new AvmPrimitive_Start( *this );
+ OPCODE_COMPUTER( RESTART ) = new AvmPrimitive_Restart( *this );
+ OPCODE_COMPUTER( STOP ) = new AvmPrimitive_Stop( *this );
+
+ OPCODE_COMPUTER( WAIT ) = new AvmPrimitive_Wait( *this );
+
+ OPCODE_COMPUTER( SUSPEND ) = new AvmPrimitive_Suspend( *this );
+ OPCODE_COMPUTER( RESUME ) = new AvmPrimitive_Resume( *this );
+
+
+ OPCODE_COMPUTER( IENABLE_INVOKE ) = new AvmPrimitive_IEnableInvoke( *this );
+ OPCODE_COMPUTER( ENABLE_INVOKE ) = new AvmPrimitive_EnableInvoke( *this );
+ OPCODE_COMPUTER( ENABLE_SET ) = new AvmPrimitive_EnableSet( *this );
+
+ OPCODE_COMPUTER( IDISABLE_INVOKE ) = new AvmPrimitive_IDisableInvoke( *this );
+ OPCODE_COMPUTER( DISABLE_INVOKE ) = new AvmPrimitive_DisableInvoke( *this );
+ OPCODE_COMPUTER( DISABLE_SET ) = new AvmPrimitive_DisableSet( *this );
+ OPCODE_COMPUTER( DISABLE_CHILD ) = new AvmPrimitive_DisableChild( *this );
+ OPCODE_COMPUTER( DISABLE_SELF ) = new AvmPrimitive_DisableSelf( *this );
+ OPCODE_COMPUTER( DISABLE_SELVES ) = new AvmPrimitive_DisableSelves( *this );
+
+ OPCODE_COMPUTER( IABORT_INVOKE ) = new AvmPrimitive_IAbortInvoke( *this );
+ OPCODE_COMPUTER( ABORT_INVOKE ) = new AvmPrimitive_AbortInvoke( *this );
+ OPCODE_COMPUTER( ABORT_SET ) = new AvmPrimitive_AbortSet( *this );
+ OPCODE_COMPUTER( ABORT_CHILD ) = new AvmPrimitive_AbortChild( *this );
+ OPCODE_COMPUTER( ABORT_SELF ) = new AvmPrimitive_AbortSelf( *this );
+ OPCODE_COMPUTER( ABORT_SELVES ) = new AvmPrimitive_AbortSelves( *this );
+
+ OPCODE_COMPUTER( HISTORY_CLEAR ) = new AvmPrimitive_HistoryClear( *this );
+ OPCODE_COMPUTER( DEEP_HISTORY_INVOKE ) = new AvmPrimitive_DeepHistoryInvoke( *this );
+ OPCODE_COMPUTER( SHALLOW_HISTORY_INVOKE ) = new AvmPrimitive_ShallowHistoryInvoke( *this );
+
+ OPCODE_COMPUTER( IRUN ) = new AvmPrimitive_IRun( *this );
+ OPCODE_COMPUTER( RUN ) = new AvmPrimitive_Run( *this );
+
+ OPCODE_COMPUTER( RTC ) = new AvmPrimitive_Rtc( *this );
+
+
+ OPCODE_COMPUTER( INVOKE_NEW ) = new AvmPrimitive_InvokeNew( *this );
+
+ OPCODE_COMPUTER( INVOKE_ROUTINE ) = DEFAULT_INVOKE_ROUTINE;
+
+ OPCODE_COMPUTER( INVOKE_TRANSITION ) = new AvmPrimitive_InvokeTransition( *this );
+
+ OPCODE_COMPUTER( INVOKE_METHOD ) = new AvmPrimitive_InvokeMethod( *this );
+ OPCODE_COMPUTER( INVOKE_PROGRAM ) = new AvmPrimitive_InvokeProgram( *this );
+ OPCODE_COMPUTER( INVOKE_FUNCTION ) = new AvmPrimitive_InvokeFunction( *this );
+
+ OPCODE_COMPUTER( INVOKE_LAMBDA_APPLY ) = new AvmPrimitive_InvokeLambdaApply( *this );
+ OPCODE_COMPUTER( INVOKE_LAMBDA_LET ) = new AvmPrimitive_InvokeLambdaLet( *this );
+
+
+ OPCODE_COMPUTER( SCHEDULE_INVOKE ) = new AvmPrimitive_ScheduleInvoke( *this );
+ OPCODE_COMPUTER( SCHEDULE_GET ) = new AvmPrimitive_ScheduleGet( *this );
+ OPCODE_COMPUTER( SCHEDULE_IN ) = new AvmPrimitive_ScheduleIn( *this );
+ OPCODE_COMPUTER( SCHEDULE_SET ) = new AvmPrimitive_ScheduleSet( *this );
+
+ OPCODE_COMPUTER( DEFER_INVOKE ) = new AvmPrimitive_DeferInvoke( *this );
+ OPCODE_COMPUTER( DEFER_GET ) = new AvmPrimitive_DeferGet( *this );
+ OPCODE_COMPUTER( DEFER_SET ) = new AvmPrimitive_DeferSet( *this );
+
+ OPCODE_COMPUTER( GOTO ) = new AvmPrimitive_Goto( *this );
+
+ OPCODE_COMPUTER( FORK ) = new AvmPrimitive_Fork( *this );
+ OPCODE_COMPUTER( JOIN ) = new AvmPrimitive_Join( *this );
+
+ OPCODE_COMPUTER( INPUT_ENABLED ) = new AvmPrimitive_InputEnabled( *this );
+
+ OPCODE_COMPUTER( RDV ) = new AvmPrimitive_Rdv( *this );
+
+ OPCODE_COMPUTER( SYNCHRONIZE ) = new AvmPrimitive_Synchronize( *this );
+
+
+ return( true );
+}
+
+
+bool AvmPrimitiveProcessor::configureStatusPrimitive()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM MACHINE STATUS
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPUTER( STATUS_WAS ) = new AvmPrimitive_StatusWas( *this );
+ OPCODE_COMPUTER( STATUS_IS ) = new AvmPrimitive_StatusIs( *this );
+ OPCODE_COMPUTER( STATUS_BEING ) = new AvmPrimitive_StatusBeing( *this );
+ OPCODE_COMPUTER( STATUS_WILL ) = new AvmPrimitive_StatusWill( *this );
+
+ OPCODE_COMPUTER( CHANGED ) = new AvmPrimitive_Changed( *this );
+ OPCODE_COMPUTER( CHANGED_TO ) = new AvmPrimitive_ChangedTo( *this );
+
+ return( true );
+}
+
+
+bool AvmPrimitiveProcessor::configureConcurrencyPrimitive()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM PROGRAM SCHEDULING
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPUTER( ASYNCHRONOUS ) = new AvmPrimitive_Asynchronous( *this );
+ OPCODE_COMPUTER( STRONG_SYNCHRONOUS ) = new AvmPrimitive_StrongSynchronous( *this );
+ OPCODE_COMPUTER( WEAK_SYNCHRONOUS ) = new AvmPrimitive_WeakSynchronous( *this );
+ OPCODE_COMPUTER( INTERLEAVING ) = new AvmPrimitive_Interleaving( *this );
+ OPCODE_COMPUTER( PARALLEL ) = new AvmPrimitive_Parallel( *this );
+
+ OPCODE_COMPUTER( RDV_ASYNCHRONOUS ) = new AvmPrimitive_RdvAsynchronous( *this );
+ OPCODE_COMPUTER( RDV_STRONG_SYNCHRONOUS ) = new AvmPrimitive_RdvStrongSynchronous( *this );
+ OPCODE_COMPUTER( RDV_WEAK_SYNCHRONOUS ) = new AvmPrimitive_RdvWeakSynchronous( *this );
+ OPCODE_COMPUTER( RDV_INTERLEAVING ) = new AvmPrimitive_RdvInterleaving( *this );
+ OPCODE_COMPUTER( RDV_PARALLEL ) = new AvmPrimitive_RdvParallel( *this );
+
+
+ OPCODE_COMPUTER( EXCLUSIVE ) = new AvmPrimitive_Exclusive( *this );
+ OPCODE_COMPUTER( NONDETERMINISM ) = new AvmPrimitive_Nondeterminism( *this );
+
+ OPCODE_COMPUTER( PRIOR_GT ) = new AvmPrimitive_Prior( *this );
+ OPCODE_COMPUTER( PRIOR_LT ) = new AvmPrimitive_Prior( *this );
+
+ OPCODE_COMPUTER( SCHEDULE_AND_THEN ) = new AvmPrimitive_ScheduleAndThen( *this );
+ OPCODE_COMPUTER( SCHEDULE_OR_ELSE ) = new AvmPrimitive_ScheduleOrElse( *this );
+
+ OPCODE_COMPUTER( ATOMIC_SEQUENCE ) = new AvmPrimitive_AtomicSequence( *this );
+ OPCODE_COMPUTER( SEQUENCE ) = new AvmPrimitive_Sequence( *this );
+ OPCODE_COMPUTER( SEQUENCE_SIDE ) = new AvmPrimitive_SideSequence( *this );
+ OPCODE_COMPUTER( SEQUENCE_WEAK ) = new AvmPrimitive_WeakSequence( *this );
+
+ OPCODE_COMPUTER( PRODUCT ) = new AvmPrimitive_Product( *this );
+
+
+ return( true );
+}
+
+
+bool AvmPrimitiveProcessor::configureBasicPrimitive()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM BUFFER MANAGING
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPUTER( UPDATE_BUFFER ) = new AvmPrimitive_UpdateBuffer( *this );
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM PRIMITIVE STATEMENT
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPUTER( ASSIGN ) = new AvmPrimitive_Assignment( *this );
+ OPCODE_COMPUTER( ASSIGN_AFTER ) = new AvmPrimitive_AssignmentAfter( *this );
+ OPCODE_COMPUTER( ASSIGN_OP_AFTER ) = new AvmPrimitive_AssignmentOpAfter( *this );
+
+ OPCODE_COMPUTER( ASSIGN_REF ) = new AvmPrimitive_AssignmentRef( *this );
+ OPCODE_COMPUTER( ASSIGN_MACRO ) = new AvmPrimitive_AssignmentMacro( *this );
+
+ OPCODE_COMPUTER( ASSIGN_NEWFRESH ) = new AvmPrimitive_AssignNewFresh( *this );
+
+ OPCODE_COMPUTER( ASSIGN_RESET ) = new AvmPrimitive_AssignReset( *this );
+
+ OPCODE_COMPUTER( GUARD ) = new AvmPrimitive_Guard( *this );
+ OPCODE_COMPUTER( TIMED_GUARD ) = new AvmPrimitive_TimedGuard( *this );
+
+ OPCODE_COMPUTER( EVENT ) = new AvmPrimitive_Event( *this );
+ OPCODE_COMPUTER( CHECK_SAT ) = new AvmPrimitive_CheckSat( *this );
+
+
+ OPCODE_COMPUTER( INPUT ) = new AvmPrimitive_Input( *this );
+ OPCODE_COMPUTER( INPUT_FROM ) = new AvmPrimitive_InputFrom( *this );
+ // Optimized version of INPUT
+ OPCODE_COMPUTER( INPUT_VAR ) = new AvmPrimitive_InputVar( *this );
+ OPCODE_COMPUTER( INPUT_ENV ) = new AvmPrimitive_InputEnv( *this );
+ OPCODE_COMPUTER( INPUT_BUFFER ) = new AvmPrimitive_InputBuffer( *this );
+ OPCODE_COMPUTER( INPUT_RDV ) = new AvmPrimitive_InputRdv( *this );
+
+ OPCODE_COMPUTER( INPUT_FLOW ) = new AvmPrimitive_Input( *this );
+ OPCODE_COMPUTER( INPUT_BROADCAST ) = new AvmPrimitive_Input( *this );
+ OPCODE_COMPUTER( INPUT_DELEGATE ) = new AvmPrimitive_Input( *this );
+
+
+ OPCODE_COMPUTER( OUTPUT ) = new AvmPrimitive_Output( *this );
+ OPCODE_COMPUTER( OUTPUT_TO ) = new AvmPrimitive_OutputTo( *this );
+ // Optimized version of OUTPUT
+ OPCODE_COMPUTER( OUTPUT_VAR ) = new AvmPrimitive_OutputVar( *this );
+ OPCODE_COMPUTER( OUTPUT_ENV ) = new AvmPrimitive_OutputEnv( *this );
+ OPCODE_COMPUTER( OUTPUT_BUFFER ) = new AvmPrimitive_OutputBuffer( *this );
+ OPCODE_COMPUTER( OUTPUT_RDV ) = new AvmPrimitive_OutputRdv( *this );
+
+ OPCODE_COMPUTER( OUTPUT_FLOW ) = new AvmPrimitive_Output( *this );
+ OPCODE_COMPUTER( OUTPUT_BROADCAST ) = new AvmPrimitive_Output( *this );
+ OPCODE_COMPUTER( OUTPUT_DELEGATE ) = new AvmPrimitive_Output( *this );
+
+
+ OPCODE_COMPUTER( PRESENT ) = new AvmPrimitive_Present( *this );
+ OPCODE_COMPUTER( ABSENT ) = new AvmPrimitive_Absent( *this );
+
+ OPCODE_COMPUTER( IF ) = new AvmPrimitive_If( *this );
+ OPCODE_COMPUTER( IFE ) = new AvmPrimitive_Ife( *this );
+
+ OPCODE_COMPUTER( FOR ) = new AvmPrimitive_For( *this );
+ OPCODE_COMPUTER( FOREACH ) = new AvmPrimitive_Foreach( *this );
+ OPCODE_COMPUTER( WHILE_DO ) = new AvmPrimitive_WhileDo( *this );
+ OPCODE_COMPUTER( DO_WHILE ) = new AvmPrimitive_DoWhile( *this );
+
+ OPCODE_COMPUTER( BREAK ) = new AvmPrimitive_Break( *this );
+ OPCODE_COMPUTER( CONTINUE ) = new AvmPrimitive_Continue( *this );
+ OPCODE_COMPUTER( RETURN ) = new AvmPrimitive_Return( *this );
+ OPCODE_COMPUTER( EXIT ) = new AvmPrimitive_Exit( *this );
+
+ OPCODE_COMPUTER( STEP_MARK ) = new AvmPrimitive_StepMark( *this );
+
+
+ return( true );
+}
+
+
+bool AvmPrimitiveProcessor::configureBitwisePrimitive()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM BITWISE EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ OPCODE_COMPUTER( BNOT ) = new AvmPrimitive_BNOT( *this );
+
+ OPCODE_COMPUTER( BAND ) = new AvmPrimitive_BAND( *this );
+ OPCODE_COMPUTER( BOR ) = new AvmPrimitive_BOR( *this );
+ OPCODE_COMPUTER( BXOR ) = new AvmPrimitive_BXOR( *this );
+
+ OPCODE_COMPUTER( LSHIFT ) = new AvmPrimitive_LSHIFT( *this );
+ OPCODE_COMPUTER( RSHIFT ) = new AvmPrimitive_RSHIFT( *this );
+
+
+ return( true );
+}
+
+
+bool AvmPrimitiveProcessor::configureLogicPrimitive()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM PREDICAT EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ OPCODE_COMPUTER( NOT ) = DEFAULT_EVAL_EXPRESSION_ALU;
+
+ OPCODE_COMPUTER( AND ) = DEFAULT_EVAL_EXPRESSION_ALU;
+ OPCODE_COMPUTER( AND_THEN ) = DEFAULT_EVAL_EXPRESSION_ALU;
+ OPCODE_COMPUTER( NAND ) = DEFAULT_EVAL_EXPRESSION_ALU;
+
+ OPCODE_COMPUTER( XAND ) = DEFAULT_EVAL_EXPRESSION_ALU;
+
+ OPCODE_COMPUTER( OR ) = DEFAULT_EVAL_EXPRESSION_ALU;
+ OPCODE_COMPUTER( OR_ELSE ) = DEFAULT_EVAL_EXPRESSION_ALU;
+ OPCODE_COMPUTER( NOR ) = DEFAULT_EVAL_EXPRESSION_ALU;
+
+ OPCODE_COMPUTER( XOR ) = DEFAULT_EVAL_EXPRESSION_ALU;
+ OPCODE_COMPUTER( XNOR ) = DEFAULT_EVAL_EXPRESSION_ALU;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM COMPARISON EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ OPCODE_COMPUTER( EQ ) = DEFAULT_EVAL_EXPRESSION_ALU;
+ OPCODE_COMPUTER( NEQ ) = DEFAULT_EVAL_EXPRESSION_ALU;
+
+ OPCODE_COMPUTER( SEQ ) = DEFAULT_EVAL_EXPRESSION_ALU;
+ OPCODE_COMPUTER( NSEQ ) = DEFAULT_EVAL_EXPRESSION_ALU;
+
+ OPCODE_COMPUTER( LT ) = DEFAULT_EVAL_EXPRESSION_ALU;
+ OPCODE_COMPUTER( LTE ) = DEFAULT_EVAL_EXPRESSION_ALU;
+
+ OPCODE_COMPUTER( GT ) = DEFAULT_EVAL_EXPRESSION_ALU;
+ OPCODE_COMPUTER( GTE ) = DEFAULT_EVAL_EXPRESSION_ALU;
+
+
+ return( true );
+}
+
+
+bool AvmPrimitiveProcessor::configureArithmeticPrimitive()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM ARITHMETIC EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ OPCODE_COMPUTER( PLUS ) = DEFAULT_EVAL_EXPRESSION_ALU;
+ OPCODE_COMPUTER( MINUS ) = DEFAULT_EVAL_EXPRESSION_ALU;
+ OPCODE_COMPUTER( UMINUS ) = DEFAULT_EVAL_EXPRESSION_ALU;
+
+ OPCODE_COMPUTER( MULT ) = DEFAULT_EVAL_EXPRESSION_ALU;
+ OPCODE_COMPUTER( POW ) = DEFAULT_EVAL_EXPRESSION_ALU;
+
+ OPCODE_COMPUTER( DIV ) = DEFAULT_EVAL_EXPRESSION_ALU;
+
+ OPCODE_COMPUTER( MOD ) = new AvmPrimitive_MOD( *this );
+
+
+ return( true );
+}
+
+
+bool AvmPrimitiveProcessor::configureLookupPrimitive()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // LOOKUP STATEMENT
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPUTER( LOOKUP_INT ) = new AvmPrimitive_Lookup_Int( *this );
+
+ OPCODE_COMPUTER( LOOKUP_INT_EXT ) = new AvmPrimitive_Lookup_IntExt( *this );
+
+ OPCODE_COMPUTER( LOOKUP_NEAREST ) = new AvmPrimitive_Lookup_Nearest( *this );
+
+ OPCODE_COMPUTER( LOOKUP_BELOW ) = new AvmPrimitive_Lookup_Below( *this );
+
+ OPCODE_COMPUTER( LOOKUP_ABOVE ) = new AvmPrimitive_Lookup_Above( *this );
+
+
+ OPCODE_COMPUTER( LOOKUP2D_INT_EXT ) = new AvmPrimitive_Lookup2D_IntExt( *this );
+
+
+ return( true );
+}
+
+
+bool AvmPrimitiveProcessor::configureMathematicPrimitive()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM MATHEMATICAL FUNCTION
+ ////////////////////////////////////////////////////////////////////////////
+
+ // MIN - MAX
+ OPCODE_COMPUTER( MIN ) = new AvmPrimitive_MIN( *this );
+ OPCODE_COMPUTER( MAX ) = new AvmPrimitive_MAX( *this );
+
+ // RANDOM
+ OPCODE_COMPUTER( RANDOM ) = new AvmPrimitive_RANDOM( *this );
+
+ // ABS
+ OPCODE_COMPUTER( ABS ) = new AvmPrimitive_ABS( *this );
+
+ // ROUNDING
+ OPCODE_COMPUTER( CEIL ) = new AvmPrimitive_CEIL( *this );
+ OPCODE_COMPUTER( FLOOR ) = new AvmPrimitive_FLOOR( *this );
+ OPCODE_COMPUTER( ROUND ) = new AvmPrimitive_ROUND( *this );
+ OPCODE_COMPUTER( TRUNCATE ) = new AvmPrimitive_TRUNCATE( *this );
+
+
+ // EXP - LOG
+ OPCODE_COMPUTER( SQRT ) = new AvmPrimitive_SQRT( *this );
+
+ OPCODE_COMPUTER( EXP ) = new AvmPrimitive_EXP( *this );
+ OPCODE_COMPUTER( LOG ) = new AvmPrimitive_LOG( *this );
+
+ // TRIGONOMETRIC
+ OPCODE_COMPUTER( SIN ) = new AvmPrimitive_SIN( *this );
+ OPCODE_COMPUTER( COS ) = new AvmPrimitive_COS( *this );
+ OPCODE_COMPUTER( TAN ) = new AvmPrimitive_TAN( *this );
+
+ OPCODE_COMPUTER( SINH ) = new AvmPrimitive_SINH( *this );
+ OPCODE_COMPUTER( COSH ) = new AvmPrimitive_COSH( *this );
+ OPCODE_COMPUTER( TANH ) = new AvmPrimitive_TANH( *this );
+
+ OPCODE_COMPUTER( ASIN ) = new AvmPrimitive_ASIN( *this );
+ OPCODE_COMPUTER( ACOS ) = new AvmPrimitive_ACOS( *this );
+ OPCODE_COMPUTER( ATAN ) = new AvmPrimitive_ATAN( *this );
+ OPCODE_COMPUTER( ATAN2 ) = new AvmPrimitive_ATAN2( *this );
+
+ OPCODE_COMPUTER( ASINH ) = new AvmPrimitive_ASINH( *this );
+ OPCODE_COMPUTER( ACOSH ) = new AvmPrimitive_ACOSH( *this );
+ OPCODE_COMPUTER( ATANH ) = new AvmPrimitive_ATANH( *this );
+
+ return( true );
+}
+
+
+bool AvmPrimitiveProcessor::configureStringPrimitive()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // AVM STRING / COLLECTION OPERATOR
+ ////////////////////////////////////////////////////////////////////////////
+
+ OPCODE_COMPUTER( CONTAINS ) = new AvmPrimitive_CONTAINS( *this );
+
+ OPCODE_COMPUTER( IN ) = new AvmPrimitive_IN( *this );
+ OPCODE_COMPUTER( NOTIN ) = new AvmPrimitive_NOTIN( *this );
+
+ OPCODE_COMPUTER( SUBSET ) = DEFAULT_AVM_PRIMITIVE;
+ OPCODE_COMPUTER( SUBSETEQ ) = DEFAULT_AVM_PRIMITIVE;
+
+ OPCODE_COMPUTER( INTERSECT ) = DEFAULT_AVM_PRIMITIVE;
+
+ OPCODE_COMPUTER( STARTS_WITH ) = DEFAULT_AVM_PRIMITIVE;
+ OPCODE_COMPUTER( ENDS_WITH ) = DEFAULT_AVM_PRIMITIVE;
+ OPCODE_COMPUTER( CONCAT ) = DEFAULT_AVM_PRIMITIVE;
+
+
+ OPCODE_COMPUTER( APPEND ) = new AvmPrimitive_APPEND( *this );
+ OPCODE_COMPUTER( REMOVE ) = new AvmPrimitive_REMOVE( *this );
+ OPCODE_COMPUTER( CLEAR ) = new AvmPrimitive_CLEAR( *this );
+ OPCODE_COMPUTER( RESIZE ) = new AvmPrimitive_RESIZE( *this );
+
+ OPCODE_COMPUTER( PUSH ) = new AvmPrimitive_PUSH( *this );
+ OPCODE_COMPUTER( ASSIGN_TOP ) = new AvmPrimitive_ASSIGN_TOP( *this );
+ OPCODE_COMPUTER( TOP ) = new AvmPrimitive_TOP( *this );
+ OPCODE_COMPUTER( POP ) = new AvmPrimitive_POP( *this );
+ OPCODE_COMPUTER( POP_FROM ) = new AvmPrimitive_POP_FROM( *this );
+
+ OPCODE_COMPUTER( EMPTY ) = new AvmPrimitive_EMPTY( *this );
+ OPCODE_COMPUTER( NONEMPTY ) = new AvmPrimitive_NONEMPTY( *this );
+ OPCODE_COMPUTER( SINGLETON ) = new AvmPrimitive_SINGLETON( *this );
+ OPCODE_COMPUTER( POPULATED ) = new AvmPrimitive_POPULATED( *this );
+ OPCODE_COMPUTER( FULL ) = new AvmPrimitive_FULL( *this );
+
+ OPCODE_COMPUTER( SIZE ) = new AvmPrimitive_SIZE( *this );
+
+
+ return( true );
+}
+
+
+bool AvmPrimitiveProcessor::configureIoltPrimitive()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // IOLTL BEHAVIORAL PREDICAT
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPUTER( GLOBALLY ) = DEFAULT_AVM_PRIMITIVE;
+ OPCODE_COMPUTER( UNTIL ) = DEFAULT_AVM_PRIMITIVE;
+ OPCODE_COMPUTER( NEXT ) = DEFAULT_AVM_PRIMITIVE;
+ OPCODE_COMPUTER( EVENTUALLY ) = DEFAULT_AVM_PRIMITIVE;
+ OPCODE_COMPUTER( RELEASES ) = DEFAULT_AVM_PRIMITIVE;
+
+ OPCODE_COMPUTER( OBS ) = new AvmPrimitive_OBS( *this );
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // IOLTL LOGICAL PREDICAT
+ ////////////////////////////////////////////////////////////////////////////
+ OPCODE_COMPUTER( AND_T ) = DEFAULT_AVM_PRIMITIVE;
+ OPCODE_COMPUTER( OR_T ) = DEFAULT_AVM_PRIMITIVE;
+ OPCODE_COMPUTER( NOT_T ) = DEFAULT_AVM_PRIMITIVE;
+ OPCODE_COMPUTER( IMP_T ) = DEFAULT_AVM_PRIMITIVE;
+
+
+ return( true );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+//// TOOLS for POST-RUN
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+void AvmPrimitiveProcessor::postRun(
+ ExecutionContext & anEC, ListOfAPExecutionData & runEDS)
+{
+ if( runEDS.nonempty() )
+ {
+ avm_uint32_t nHeight = anEC.getHeight() + 1;
+ avm_uint32_t aWidth = anEC.getWidth();
+
+ ListOfAPExecutionData::iterator itED = runEDS.begin();
+ ListOfAPExecutionData::iterator endED = runEDS.end();
+ for( ; itED != endED ; ++itED )
+ {
+ switch( (*itED)->mAEES )
+ {
+ case AEES_STMNT_NOTHING:
+ {
+ if( not (*itED)->hasRunnableElementTrace() )
+ {
+ //!! NOTHING
+ break;
+ }
+
+ //!! NO BREAk
+ }
+
+ default:
+ {
+// if( ((*itED)->getExecutionContext() ==
+// theED->getExecutionContext())
+// /* || (not (*itED)->hasExecutionContext()) */ )
+ {
+ anEC.appendChildContext(
+ new ExecutionContext(anEC, *itED, nHeight, aWidth) );
+ }
+ break;
+ }
+ }
+ }
+ }
+}
+
+void AvmPrimitiveProcessor::postRun(
+ ExecutionContext & anEC, ExecutionEnvironment & ENV)
+{
+ postRun(anEC, ENV.outEDS);
+
+ postRun(anEC, ENV.exitEDS);
+
+ postRun(anEC, ENV.irqEDS);
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+//// the INIT statement
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+void AvmPrimitiveProcessor::init(ExecutionContext & anEC)
+{
+AVM_IF_DEBUG_NOT_FLAG( QUALIFIED_NAME_ID )
+ BaseCompiledForm::USE_ONLY_ID = true;
+AVM_ENDIF_DEBUG_NOT_FLAG( QUALIFIED_NAME_ID )
+
+// anEC.writeTraceBeforeExec(AVM_OS_TRACE);
+// anEC.writeTraceBeforeExec(AVM_OS_COUT);
+
+ // SAVE AND UNSET THE ASSIGN TABLE
+ anEC.resetDataBeforeEvaluation();
+
+ ExecutionEnvironment ENV(*this, (& anEC));
+
+ if( ENV.run(ENV.inED->getOnInit()) )
+ {
+ }
+
+ // POST-RUN
+ postRun(anEC, ENV);
+
+ // RESTORE THE ASSIGN TABLE
+ anEC.restoreDataAfterEvaluation();
+
+
+// anEC.writeTraceAfterExec(AVM_OS_TRACE);
+// anEC.writeTraceAfterExec(AVM_OS_COUT);
+
+AVM_IF_DEBUG_NOT_FLAG( QUALIFIED_NAME_ID )
+ BaseCompiledForm::USE_ONLY_ID = false;
+AVM_ENDIF_DEBUG_NOT_FLAG( QUALIFIED_NAME_ID )
+
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+//// the RUN statement
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * the RUN statement
+ */
+void AvmPrimitiveProcessor::run(ExecutionContext & anEC)
+{
+AVM_IF_DEBUG_NOT_FLAG( QUALIFIED_NAME_ID )
+ BaseCompiledForm::USE_ONLY_ID = true;
+AVM_ENDIF_DEBUG_NOT_FLAG( QUALIFIED_NAME_ID )
+
+// anEC.writeTraceBeforeExec(AVM_OS_TRACE);
+// anEC.writeTraceBeforeExec(AVM_OS_COUT);
+
+ // SAVE AND UNSET THE ASSIGN TABLE
+ anEC.resetDataBeforeEvaluation();
+
+
+ ExecutionEnvironment ENV(*this, (& anEC));
+
+ switch( ENV.inED->mAEES )
+ {
+ case AEES_STEP_MARK:
+ {
+ ENV.inED.mwsetAEES(AEES_STEP_RESUME);
+
+ if( decode_resume( ENV ) )
+ {
+ }
+
+ break;
+ }
+
+ case AEES_STMNT_NOTHING:
+ case AEES_STMNT_FINAL:
+ case AEES_STMNT_DESTROY:
+ {
+ if( not ENV.inED->isFinalizedOrDestroyed(ENV.inED->getSystemRID()) )
+ {
+ ENV.inED.mwsetAEES(AEES_OK);
+ }
+ //!! NO BREAk
+ }
+
+ case AEES_OK:
+ {
+ ENV.inED->setSystemRID();
+ if( ENV.inED->getOnSchedule()->empty() &&
+ (ENV.inED->getOnSchedule()->isOpCode(AVM_OPCODE_SCHEDULE_INVOKE)) )
+ {
+ if( ENV.run(ENV.inED->getSystemRuntime().getOnSchedule()) )
+ {
+ }
+ }
+ else if( ENV.run(ENV.inED->getOnSchedule()) )
+ {
+ }
+
+ break;
+ }
+
+ case AEES_WAITING_JOIN_FORK:
+ case AEES_STMNT_EXIT:
+ case AEES_STMNT_EXIT_ALL:
+ case AEES_STMNT_FATAL_ERROR:
+ case AEES_SYMBOLIC_EXECUTION_LIMITATION:
+ {
+ break;
+ }
+
+ case AEES_STMNT_BREAK:
+ case AEES_STMNT_CONTINUE:
+ case AEES_STMNT_RETURN:
+ case AEES_STEP_RESUME:
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected an input Execution Context for running"
+ " with the AVM EXECECUTION ENDING STATUS << "
+ << RuntimeDef::strAEES( ENV.inED->mAEES ) << " >> !!!"
+ << SEND_EXIT;
+ break;
+ }
+ }
+
+ // POST-RUN
+ postRun(anEC, ENV);
+
+ // RESTORE THE ASSIGN TABLE
+ anEC.restoreDataAfterEvaluation();
+
+
+// anEC.writeTraceAfterExec(AVM_OS_TRACE);
+// anEC.writeTraceAfterExec(AVM_OS_COUT);
+
+
+AVM_IF_DEBUG_NOT_FLAG( QUALIFIED_NAME_ID )
+ BaseCompiledForm::USE_ONLY_ID = false;
+AVM_ENDIF_DEBUG_NOT_FLAG( QUALIFIED_NAME_ID )
+}
+
+
+
+static bool isDebugProgram(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ /*
+ ***********************************************************************
+ * AVM MACHINE ACTIVITY
+ ***********************************************************************
+ */
+ case AVM_OPCODE_CONTEXT_SWITCHER:
+
+ case AVM_OPCODE_INIT:
+ case AVM_OPCODE_FINAL:
+ case AVM_OPCODE_DESTROY:
+
+ case AVM_OPCODE_START:
+ case AVM_OPCODE_RESTART:
+ case AVM_OPCODE_STOP:
+
+ case AVM_OPCODE_WAIT:
+
+ case AVM_OPCODE_SUSPEND:
+ case AVM_OPCODE_RESUME:
+
+ case AVM_OPCODE_IENABLE_INVOKE:
+ case AVM_OPCODE_ENABLE_INVOKE:
+ case AVM_OPCODE_ENABLE_SET:
+
+ case AVM_OPCODE_IDISABLE_INVOKE:
+ case AVM_OPCODE_DISABLE_INVOKE:
+ case AVM_OPCODE_DISABLE_SET:
+
+ case AVM_OPCODE_DISABLE_CHILD:
+ case AVM_OPCODE_DISABLE_SELF:
+ case AVM_OPCODE_DISABLE_SELVES:
+
+ case AVM_OPCODE_IABORT_INVOKE:
+ case AVM_OPCODE_ABORT_INVOKE:
+ case AVM_OPCODE_ABORT_SET:
+
+ case AVM_OPCODE_ABORT_CHILD:
+ case AVM_OPCODE_ABORT_SELF:
+ case AVM_OPCODE_ABORT_SELVES:
+
+ case AVM_OPCODE_HISTORY_CLEAR:
+ case AVM_OPCODE_DEEP_HISTORY_INVOKE:
+ case AVM_OPCODE_SHALLOW_HISTORY_INVOKE:
+
+ case AVM_OPCODE_IRUN:
+ case AVM_OPCODE_RUN:
+
+ case AVM_OPCODE_RTC:
+
+ case AVM_OPCODE_SCHEDULE_INVOKE:
+ case AVM_OPCODE_SCHEDULE_GET:
+ case AVM_OPCODE_SCHEDULE_SET:
+
+ case AVM_OPCODE_DEFER_INVOKE:
+ case AVM_OPCODE_DEFER_GET:
+ case AVM_OPCODE_DEFER_SET:
+
+ case AVM_OPCODE_FORK:
+ case AVM_OPCODE_JOIN:
+
+ case AVM_OPCODE_RDV:
+
+ case AVM_OPCODE_INPUT_ENABLED:
+
+ case AVM_OPCODE_SYNCHRONIZE:
+
+ case AVM_OPCODE_INVOKE_NEW:
+
+
+ /*
+ ***********************************************************************
+ * AVM PROGRAM SCHEDULING
+ ***********************************************************************
+ */
+ case AVM_OPCODE_ASYNCHRONOUS:
+ case AVM_OPCODE_STRONG_SYNCHRONOUS:
+ case AVM_OPCODE_WEAK_SYNCHRONOUS:
+ case AVM_OPCODE_INTERLEAVING:
+ case AVM_OPCODE_PARALLEL:
+
+ case AVM_OPCODE_EXCLUSIVE:
+
+ case AVM_OPCODE_NONDETERMINISM:
+
+
+ case AVM_OPCODE_PRIOR_GT:
+ case AVM_OPCODE_PRIOR_LT:
+
+// case AVM_OPCODE_ATOMIC_SEQUENCE:
+//
+// case AVM_OPCODE_SEQUENCE:
+// case AVM_OPCODE_SEQUENCE_SIDE:
+// case AVM_OPCODE_SEQUENCE_WEAK:
+//
+// case AVM_OPCODE_PRODUCT:
+
+ /*
+ ***********************************************************************
+ * LAMBDA STATEMENT
+ ***********************************************************************
+ */
+// case AVM_OPCODE_APPLY:
+//
+// case AVM_OPCODE_LAMBDA:
+//
+// case AVM_OPCODE_INVOKE_ROUTINE:
+
+ case AVM_OPCODE_INVOKE_TRANSITION:
+
+ case AVM_OPCODE_INVOKE_METHOD:
+ case AVM_OPCODE_INVOKE_PROGRAM:
+ case AVM_OPCODE_INVOKE_FUNCTION:
+
+// case AVM_OPCODE_INVOKE_LAMBDA_APPLY:
+// case AVM_OPCODE_INVOKE_LAMBDA_LET:
+
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+
+
+
+
+bool AvmPrimitiveProcessor::run(avm_offset_t opOffset, ExecutionEnvironment & ENV)
+{
+ const AvmCode * aCode = ENV.inCODE;
+
+ if( aCode == NULL )
+ {
+ return( false );
+ }
+
+AVM_IF_DEBUG_FLAG_AND( COMPUTING , AVM_DEBUG_FLAG_OR( STATEMENT,
+ AVM_DEBUG_FLAG_AND( PROGRAM ,
+ isDebugProgram(aCode->getOperator()) ) ) )
+
+ AVM_OS_TRACE << INCR_INDENT_TAB << "<< "
+ << ENV.inED->mRID.strUniqId() << " |=> ";
+ aCode->toStream( AVM_OS_TRACE << IGNORE_FIRST_TAB );
+
+ AVM_IF_DEBUG_LEVEL_FLAG( HIGH , DATA )
+ ENV.inED->toStreamData(AVM_OS_TRACE);
+ AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , DATA )
+
+ AVM_IF_DEBUG_LEVEL_GT_HIGH
+ AVM_OS_COUT << AVM_OS_TRACE.INDENT.TABS << "<< "
+ << ENV.inED->mRID.strUniqId() << " |=> ";
+ aCode->toStream( AVM_OS_COUT << IGNORE_FIRST_TAB );
+ AVM_ENDIF_DEBUG_LEVEL_GT_HIGH
+
+ AVM_OS_TRACE << std::flush;
+AVM_ENDIF_DEBUG_FLAG_AND( COMPUTING )
+
+
+ bool rtCode = false;
+
+ try
+ {
+ if( ENV.inCODE->hasInstruction() )
+ {
+ InstructionEnvironment INSTRUCTION_ENV(ENV);
+ if( (ENV.mARG = INSTRUCTION_ENV.itARG)->main_decode_eval_args(ENV.inCODE) )
+ {
+// while( ENV.mARG != NULL )
+ {
+ ENV.inED = ENV.mARG->outED;
+
+ rtCode = AVM_PRIMITIVE_TABLE[ opOffset ]->run(ENV) || rtCode;
+
+// ENV.mARG = INSTRUCTION_ENV.itARG = INSTRUCTION_ENV.itARG->NEXT;
+ }
+ }
+ }
+ else
+ {
+ rtCode = AVM_PRIMITIVE_TABLE[ opOffset ]->run(ENV);
+ }
+ }
+ catch( const AvmExitException & aee )
+ {
+ // TODO !!!
+// avm_set_exit_code( aee.mExitCode );
+ }
+ catch( const std::exception & e )
+ {
+ AVM_OS_WARN << std::endl << EMPHASIS(
+ "AvmPrimitiveProcessor::run< std::exception >",
+ e.what(), '*', 80);
+ }
+ catch( ... )
+ {
+ AVM_OS_WARN << std::endl << EMPHASIS( "AvmPrimitiveProcessor::"
+ "run< unknown::exception > !!!", '*', 80);
+ }
+
+
+AVM_IF_DEBUG_FLAG_AND( COMPUTING , AVM_DEBUG_FLAG_OR( STATEMENT,
+ AVM_DEBUG_FLAG_AND( PROGRAM ,
+ isDebugProgram(aCode->getOperator()) ) ) )
+
+ AVM_IF_DEBUG_LEVEL_GTE_HIGH
+
+ AVM_OS_TRACE << TAB_DECR_INDENT
+ << ">> " << ENV.inED->mRID.strUniqId()
+ << " |=> " << aCode->str() << std::endl;
+
+ AVM_IF_DEBUG_FLAG( DATA )
+ ENV.inED->toStreamData(AVM_OS_TRACE);
+ AVM_ENDIF_DEBUG_FLAG( DATA )
+
+ AVM_IF_DEBUG_LEVEL_GT_HIGH
+ AVM_OS_COUT << AVM_OS_TRACE.INDENT.TABS << " >> "
+ << ENV.inED->mRID.strUniqId()
+ << " |=> " << aCode->str() << std::endl;
+ AVM_ENDIF_DEBUG_LEVEL_GT_HIGH
+
+ AVM_OS_TRACE << std::flush;
+
+ AVM_DEBUG_ELSE
+
+ AVM_OS_TRACE << DECR_INDENT;
+
+ AVM_ENDIF_DEBUG_LEVEL_GTE_HIGH
+AVM_ENDIF_DEBUG_FLAG_AND( COMPUTING )
+
+ return( rtCode );
+}
+
+
+bool AvmPrimitiveProcessor::invokeRoutine(ExecutionEnvironment & ENV,
+ AvmProgram * aRoutine, const BF & aParam)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , STATEMENT )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "<< "
+ << ENV.inED->mRID.strUniqId() << " |=> invoke#routine "
+ << aRoutine->getFullyQualifiedNameID() << " " << aParam.str() << std::endl;
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , DATA )
+ ENV.inED->toStreamData(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , DATA )
+
+AVM_IF_DEBUG_LEVEL_GT_HIGH
+ AVM_OS_COUT << AVM_OS_TRACE.INDENT.TABS << "<< "
+ << ENV.inED->mRID.strUniqId()
+ << " |=> invoke#routine " << aRoutine->getFullyQualifiedNameID()
+ << " " << aParam.str() << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_GT_HIGH
+
+ AVM_OS_TRACE << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , STATEMENT )
+
+ bool rtCode = ( aRoutine->hasParam() )
+ ? DEFAULT_INVOKE_ROUTINE->run(ENV, *aRoutine, aParam)
+ : DEFAULT_INVOKE_ROUTINE->run(ENV, *aRoutine);
+
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , STATEMENT )
+AVM_IF_DEBUG_LEVEL_GTE_HIGH
+ AVM_OS_TRACE << TAB_DECR_INDENT << ">> "
+ << ENV.inED->mRID.strUniqId() << " |=> invoke#routine "
+ << aRoutine->getFullyQualifiedNameID() << " " << aParam.str() << std::endl;
+
+AVM_IF_DEBUG_FLAG( DATA )
+ ENV.inED->toStreamData(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_FLAG( DATA )
+
+AVM_IF_DEBUG_LEVEL_GT_HIGH
+ AVM_OS_COUT << AVM_OS_TRACE.INDENT.TABS << " >> "
+ << ENV.inED->mRID.strUniqId()
+ << " |=> invoke#routine " << aRoutine->getFullyQualifiedNameID()
+ << " " << aParam.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_GT_HIGH
+
+ AVM_OS_TRACE << std::flush;
+
+AVM_DEBUG_ELSE
+
+ AVM_OS_TRACE << DECR_INDENT;
+
+AVM_ENDIF_DEBUG_LEVEL_GTE_HIGH
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , STATEMENT )
+
+ return( rtCode );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// the RESUME & EVAL statement
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitiveProcessor::resume(ExecutionEnvironment & ENV)
+{
+ const AvmCode * aCode = ENV.inCODE;
+
+ if( aCode == NULL )
+ {
+ return( false );
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , STATEMENT )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "<<|| pos:"
+ << static_cast< avm_size_t >(
+ ENV.inEXEC_LOCATION->itCode - aCode->begin())
+// << " ?!? |=> " << aProgram->->str() << std::endl
+ << " " << ENV.inED->mRID.strUniqId() << " |=> ";
+ aCode->toStream( AVM_OS_TRACE << IGNORE_FIRST_TAB );
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , DATA )
+ ENV.inED->toStreamData(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , DATA )
+
+AVM_IF_DEBUG_LEVEL_GT_HIGH
+ AVM_OS_COUT << AVM_OS_TRACE.INDENT.TABS << "<<|| "
+ << ENV.inED->mRID.strUniqId() << " |=> ";
+ aCode->toStream( AVM_OS_COUT << IGNORE_FIRST_TAB );
+AVM_ENDIF_DEBUG_LEVEL_GT_HIGH
+
+ AVM_OS_TRACE << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , STATEMENT )
+
+
+ bool rtCode = AVM_PRIMITIVE_TABLE[ aCode->getOpOffset() ]->resume(ENV);
+
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , STATEMENT )
+AVM_IF_DEBUG_LEVEL_GTE_HIGH
+ AVM_OS_TRACE << TAB_DECR_INDENT << "||>> "
+ << ENV.inED->mRID.strUniqId()
+ << " |=> " << aCode->str() << std::endl;
+
+AVM_IF_DEBUG_FLAG( DATA )
+ ENV.inED->toStreamData(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_FLAG( DATA )
+
+AVM_IF_DEBUG_LEVEL_GT_HIGH
+ AVM_OS_COUT << AVM_OS_TRACE.INDENT.TABS << " ||>> "
+ << ENV.inED->mRID.strUniqId()
+ << " |=> " << aCode->str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_GT_HIGH
+
+ AVM_OS_TRACE << std::flush;
+
+AVM_DEBUG_ELSE
+
+ AVM_OS_TRACE << DECR_INDENT;
+
+AVM_ENDIF_DEBUG_LEVEL_GTE_HIGH
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , STATEMENT )
+
+ return( rtCode );
+}
+
+
+bool AvmPrimitiveProcessor::decode_resume(ExecutionEnvironment & ENV)
+{
+ APExecutionData tmpED = ENV.inED;
+ tmpED.makeWritable();
+ tmpED->mSTATEMENT_QUEUE.pushCache();
+
+ ListOfAPExecutionData tmpListOfInputED( tmpED );
+
+ ExecutionEnvironment tmpENV(ENV.PRIMITIVE_PROCESSOR);
+
+ while( tmpListOfInputED.nonempty() )
+ {
+ tmpListOfInputED.pop_first_to( tmpED );
+
+ if( not tmpENV.resume(ENV, tmpED) )
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Failed to RESUME< STATEMENT >!!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ while( tmpENV.outEDS.nonempty() )
+ {
+ tmpENV.outEDS.pop_last_to( tmpED );
+
+ switch( tmpED->getAEES() )
+ {
+ case AEES_STMNT_NOTHING:
+ case AEES_STMNT_FINAL:
+ case AEES_STMNT_DESTROY:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ //!!! NO << break >> for these statement
+ }
+
+ case AEES_STEP_RESUME:
+ {
+ if( tmpED->mSTATEMENT_QUEUE.nonempty() )
+ {
+ tmpListOfInputED.append( tmpED );
+ }
+ else
+ {
+ tmpED.mwsetAEES( AEES_OK );
+ ENV.outEDS.append( tmpED );
+ }
+
+ break;
+ }
+
+ case AEES_OK:
+ case AEES_STMNT_RETURN:
+ {
+ if( tmpED->mSTATEMENT_QUEUE.nonempty() )
+ {
+ tmpListOfInputED.append( tmpED );
+ }
+ else
+ {
+ ENV.outEDS.append( tmpED );
+ }
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS :> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+ }
+
+ // Sync EDS traitement
+ while( tmpENV.syncEDS.nonempty() )
+ {
+ tmpENV.syncEDS.first()->mSTATEMENT_QUEUE.pushCache();
+
+ ENV.appendSync( tmpENV.syncEDS.pop_first() );
+ }
+
+ // IRQ EDS traitement
+
+ ENV.spliceNotOutput(tmpENV);
+
+ return( true );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// the DECODE & EVAL statement
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * the EVAL instruction
+ */
+
+bool AvmPrimitiveProcessor::seval(EvaluationEnvironment & ENV)
+{
+ const AvmCode * anExpression = ENV.inCODE;
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , STATEMENT )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "<< "
+ << ENV.inED->mRID.strUniqId() << " , ED |-> ";
+ anExpression->toStream( AVM_OS_TRACE << IGNORE_FIRST_TAB );
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , DATA )
+ ENV.outED->toStreamData(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , DATA )
+
+AVM_IF_DEBUG_LEVEL_GT_HIGH
+ AVM_OS_COUT << AVM_OS_TRACE.INDENT.TABS << "<< ED |-> ";
+ anExpression->toStream( AVM_OS_COUT << IGNORE_FIRST_TAB );
+AVM_ENDIF_DEBUG_LEVEL_GT_HIGH
+
+ AVM_OS_TRACE << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , STATEMENT )
+
+
+ bool rtCode = false;
+ if( ENV.inCODE->hasInstruction() )
+ {
+ switch( ENV.inCODE->getInstruction()->getMainContext() )
+ {
+ case AVM_ARG_STANDARD_CTX:
+ {
+ InstructionEnvironment INSTRUCTION_ENV(ENV);
+
+ if( (ENV.mARG = INSTRUCTION_ENV.itARG)
+ ->main_decode_eval_args(ENV.inCODE) )
+ {
+ ENV.outED = ENV.mARG->outED;
+
+ rtCode = AVM_PRIMITIVE_TABLE
+ [anExpression->getOpOffset()]->seval(ENV);
+ }
+ break;
+ }
+
+ case AVM_ARG_ARGUMENT_CTX:
+ case AVM_ARG_PARAMETER_CTX:
+ case AVM_ARG_RETURN_CTX:
+ {
+ InstructionEnvironment INSTRUCTION_ENV(ENV, 1);
+
+ if( (ENV.mARG = INSTRUCTION_ENV.itARG)
+ ->main_decode_eval(ENV.inCODE) )
+ {
+ ENV.outED = ENV.mARG->outED;
+ ENV.outVAL = ENV.mARG->at(0);
+
+ rtCode = true;
+ }
+ break;
+ }
+
+ case AVM_ARG_UNDEFINED_CONTEXT:
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "AvmPrimitiveProcessor::seval :> Unexpected "
+ "opcode << " << ENV.inCODE->strDebug() << " >> !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+ else
+ {
+ rtCode = AVM_PRIMITIVE_TABLE[ anExpression->getOpOffset() ]->seval(ENV);
+ }
+
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , STATEMENT )
+AVM_IF_DEBUG_LEVEL_GTE_HIGH
+ AVM_OS_TRACE << TAB_DECR_INDENT << ">> "
+ << ENV.inED->mRID.strUniqId() << " , ED |-> "
+ << anExpression->str() << std::endl;
+
+AVM_IF_DEBUG_FLAG( DATA )
+ ENV.inED->toStreamData(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_FLAG( DATA )
+
+AVM_IF_DEBUG_LEVEL_GT_HIGH
+ AVM_OS_COUT << AVM_OS_TRACE.INDENT.TABS << " >> " <<
+ ENV.inED->mRID.strUniqId() << " , ED |-> "
+ << anExpression->str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_GT_HIGH
+
+ AVM_OS_TRACE << std::flush;
+
+AVM_DEBUG_ELSE
+
+ AVM_OS_TRACE << DECR_INDENT;
+
+AVM_ENDIF_DEBUG_LEVEL_GTE_HIGH
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , COMPUTING , STATEMENT )
+
+ return( rtCode );
+}
+
+
+bool AvmPrimitiveProcessor::seval_wrt_ARG(EvaluationEnvironment & ENV)
+{
+ return( AVM_PRIMITIVE_TABLE[ ENV.inCODE->getOpOffset() ]->seval(ENV) );
+}
+
+
+/**
+ * the DECODE EVAL instruction
+ */
+
+bool AvmPrimitiveProcessor::decode_seval(EvaluationEnvironment & ENV)
+{
+ switch( ENV.inFORM.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ ENV.inCODE = ENV.inFORM.bfCode();
+
+ return( seval(ENV) );
+ }
+
+
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ InstanceOfData * anInstance = ENV.inFORM.to_ptr< InstanceOfData >();
+
+ if( (anInstance->getModifier().hasNatureReference()) )
+ {
+ ENV.outVAL = ENV.getRvalue(ENV.outED, ENV.getRvalue(
+ ENV.outED, anInstance).to_ptr< InstanceOfData >() );
+ }
+ else if( (anInstance->getModifier().hasNatureMacro()) )
+ {
+ ENV.inFORM = ENV.getRvalue(ENV.outED, anInstance);
+
+ return( decode_seval(ENV) );
+ }
+ else if( anInstance->getModifier().hasFeatureMutable() )
+ {
+ ENV.outVAL = ENV.getRvalue(ENV.outED, anInstance);
+ }
+
+ else if( anInstance->isEnumSymbolPointer() )
+ {
+ ENV.outVAL = ( anInstance->hasValue() &&
+ (not anInstance->getModifier().hasFeatureUnsafe()) )
+ ? anInstance->getValue() : ENV.inFORM;
+ }
+
+ else if( ExecutableLib::MACHINE_SELF == anInstance )
+ {
+ ENV.outVAL = ENV.inED->mRID;
+ }
+
+ else if( ExecutableLib::MACHINE_PARENT == anInstance )
+ {
+ ENV.outVAL = ENV.inED->mRID.getPRID();
+ }
+
+ else
+ {
+ ENV.outVAL = ENV.inFORM;
+ }
+
+ return( true );
+ }
+
+
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ case FORM_BUILTIN_CHARACTER_KIND:
+ case FORM_BUILTIN_INTEGER_KIND:
+ case FORM_BUILTIN_RATIONAL_KIND:
+ case FORM_BUILTIN_FLOAT_KIND:
+ case FORM_BUILTIN_STRING_KIND:
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+
+ case FORM_OPERATOR_KIND:
+
+ case FORM_AVMLAMBDA_KIND:
+ case FORM_AVMPROGRAM_KIND:
+ case FORM_AVMTRANSITION_KIND:
+ case FORM_EXECUTABLE_MACHINE_KIND:
+ case FORM_EXECUTABLE_SYSTEM_KIND:
+ {
+ ENV.outVAL = ENV.inFORM;
+
+ return( true );
+ }
+
+
+// case FORM_UFI_KIND:
+// {
+// return( mAvmUfiPrimitive->s_evalUfi(ENV, ENV.inFORM.bfUFI()) );
+// }
+
+ case FORM_INSTANCE_MACHINE_KIND:
+ {
+ InstanceOfMachine * anInstance =
+ ENV.inFORM.to_ptr< InstanceOfMachine >();
+
+ if( anInstance->hasRuntimeRID() )
+ {
+ ENV.outVAL = anInstance->getRuntimeRID();
+ }
+
+ else if( ExecutableLib::MACHINE_NULL == anInstance )
+ {
+ ENV.outVAL = RuntimeLib::RID_NIL;
+ }
+
+ else if( ExecutableLib::MACHINE_ENVIRONMENT == anInstance )
+ {
+ ENV.outVAL = RuntimeLib::RID_ENVIRONMENT;
+ }
+
+ else
+ {
+ ENV.outVAL = ENV.outED->getRuntimeID(anInstance);
+ }
+
+ return( true );
+ }
+
+ case FORM_RUNTIME_ID_KIND:
+
+ case FORM_INSTANCE_PORT_KIND:
+ case FORM_INSTANCE_BUFFER_KIND:
+ case FORM_INSTANCE_CONNECTOR_KIND:
+ {
+ ENV.outVAL = ENV.inFORM;
+
+ return( true );
+ }
+
+
+ case FORM_ARRAY_BOOLEAN_KIND:
+ case FORM_ARRAY_INTEGER_KIND:
+ case FORM_ARRAY_RATIONAL_KIND:
+ case FORM_ARRAY_FLOAT_KIND:
+
+ case FORM_ARRAY_CHARACTER_KIND:
+ case FORM_ARRAY_IDENTIFIER_KIND:
+ case FORM_ARRAY_STRING_KIND:
+ case FORM_ARRAY_QUALIFIED_IDENTIFIER_KIND:
+ {
+ ENV.outVAL.renew( ENV.inFORM.to_ptr< BuiltinArray >()->getArrayBF() );
+
+ return( true );
+ }
+
+
+ case FORM_ARRAY_BF_KIND:
+ {
+ ArrayBF * inArray = ENV.inFORM.to_ptr< ArrayBF >();
+
+ ArrayBF * outArrayBF = new ArrayBF(
+ inArray->getTypeSpecifier(), inArray->size());
+
+ for( avm_size_t i = 0 ; i < inArray->size() ; ++i )
+ {
+ if( ENV.seval( inArray->at(i) ) )
+ {
+ outArrayBF->set(i, ENV.outVAL);
+ }
+ else
+ {
+ ENV.outVAL.renew( outArrayBF );
+
+ return( false );
+ }
+ }
+
+ ENV.outVAL.renew( outArrayBF );
+
+ return( true );
+ }
+
+
+ default:
+ {
+ if( ENV.inFORM.is< BuiltinList >() )
+ {
+ BuiltinList * inContainer = ENV.inFORM.to_ptr< BuiltinList >();
+
+ BuiltinList * outContainer = new BuiltinList(
+ inContainer->classKind(), inContainer->capacity());
+
+ BuiltinList::const_iterator it = inContainer->begin();
+ BuiltinList::const_iterator endIt = inContainer->end();
+ for( ; it != endIt ; ++it )
+ {
+ if( ENV.seval( *it ) )
+ {
+ outContainer->push(ENV.outVAL);
+ }
+ else
+ {
+ ENV.outVAL.renew( outContainer );
+
+ return( false );
+ }
+ }
+
+ ENV.outVAL.renew( outContainer );
+
+ return( true );
+ }
+
+ else if( ENV.inFORM.is< BuiltinVector >() )
+ {
+ BuiltinVector * inContainer = ENV.inFORM.to_ptr< BuiltinVector >();
+
+ BuiltinVector * outContainer = new BuiltinVector(
+ inContainer->classKind(),
+ ((BuiltinContainer *)inContainer)->capacity());
+
+ for( avm_size_t i = 0 ; i < inContainer->size() ; ++i )
+ {
+ if( ENV.seval( inContainer->at(i) ) )
+ {
+ outContainer->push(ENV.outVAL);
+ }
+ else
+ {
+ ENV.outVAL.renew( outContainer );
+
+ return( false );
+ }
+ }
+
+ ENV.outVAL.renew( outContainer );
+
+ return( true );
+ }
+
+ // TODO
+ AVM_OS_WARNING_ALERT
+ << "AvmPrimitiveProcessor is trying "
+ "to decode_seval the Expression\n"
+ << ENV.inFORM.toString( AVM_TAB1_INDENT )
+ << SEND_ALERT;
+
+ ENV.outVAL = ENV.inFORM;
+
+ return( false );
+ }
+ }
+
+ return( true );
+}
+
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmPrimitiveProcessor.h b/org.eclipse.efm.symbex/src/computer/primitive/AvmPrimitiveProcessor.h
new file mode 100644
index 0000000..f8ad8c4
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmPrimitiveProcessor.h
@@ -0,0 +1,196 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 18 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMPRIMITIVEPROCESSOR_H_
+#define AVMPRIMITIVEPROCESSOR_H_
+
+#include <collection/Typedef.h>
+
+#include <fml/operator/Operator.h>
+
+#include <fml/runtime/ExecutionData.h>
+
+
+namespace sep
+{
+
+
+class AvmPrimitive_EvalExpressionALU;
+class AvmPrimitive_InvokeRoutine;
+class AvmProgram;
+
+class BaseAvmPrimitive;
+class Builder;
+
+class Configuration;
+
+class EvaluationEnvironment;
+class ExecutionEnvironment;
+
+class Loader;
+
+class SymbexEngine;
+
+
+class AvmPrimitiveProcessor
+{
+
+protected:
+ /**
+ * TYPEDEF
+ */
+ typedef Vector< BaseAvmPrimitive * > VectorOfAvmPrimitive;
+
+ /**
+ * ATTRIBUTES
+ */
+ SymbexEngine & mSymbexEngine;
+
+ Configuration & mConfiguration;
+
+ VectorOfAvmPrimitive AVM_PRIMITIVE_TABLE;
+
+ AvmPrimitive_EvalExpressionALU * DEFAULT_EVAL_EXPRESSION_ALU;
+
+ AvmPrimitive_InvokeRoutine * DEFAULT_INVOKE_ROUTINE;
+
+ BaseAvmPrimitive * DEFAULT_AVM_PRIMITIVE;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmPrimitiveProcessor(
+ SymbexEngine & aSymbexEngine, Configuration & aConfiguration)
+ : mSymbexEngine( aSymbexEngine ),
+ mConfiguration( aConfiguration ),
+
+ AVM_PRIMITIVE_TABLE( ),
+ DEFAULT_EVAL_EXPRESSION_ALU( NULL ),
+ DEFAULT_INVOKE_ROUTINE( NULL ),
+ DEFAULT_AVM_PRIMITIVE( NULL )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AvmPrimitiveProcessor();
+
+
+ /**
+ * GETTER - SETTER
+ * mConfiguration
+ * mSymbexEngine
+ */
+ inline SymbexEngine & getSymbexEngine()
+ {
+ return( mSymbexEngine );
+ }
+
+ inline Configuration & getConfiguration()
+ {
+ return( mConfiguration );
+ }
+
+
+ /**
+ * GETTER
+ * Builder
+ * Loader
+ */
+ Builder & getBuilder();
+
+ Loader & getLoader();
+
+
+ /**
+ * CONFIGURE
+ */
+ bool configure();
+
+ bool configureOther();
+
+ bool configureMeta();
+
+ bool configureLambdaPrimitive();
+
+ bool configureActivityPrimitive();
+
+ bool configureStatusPrimitive();
+
+ bool configureConcurrencyPrimitive();
+ bool configureBasicPrimitive();
+
+ bool configureArithmeticPrimitive();
+ bool configureBitwisePrimitive();
+ bool configureLogicPrimitive();
+
+ bool configureLookupPrimitive();
+ bool configureMathematicPrimitive();
+
+ bool configureStringPrimitive();
+
+ bool configureIoltPrimitive();
+
+
+
+ /**
+ * the RUN statement
+ */
+
+ void postRun(ExecutionContext & anEC, ListOfAPExecutionData & runEDS);
+ void postRun(ExecutionContext & anEC, ExecutionEnvironment & ENV);
+
+
+ void init(ExecutionContext & anEC);
+
+
+ void run(ExecutionContext & anEC);
+
+ bool run(avm_offset_t opOffset, ExecutionEnvironment & ENV);
+
+
+ bool invokeRoutine(ExecutionEnvironment & ENV,
+ AvmProgram * aProgram, const BF & aParam);
+
+
+ /**
+ * the RESUME instruction
+ */
+ bool resume(ExecutionEnvironment & ENV);
+
+ bool decode_resume(ExecutionEnvironment & ENV);
+
+
+ /**
+ * the DECODE EVAL instruction
+ */
+ bool seval(EvaluationEnvironment & ENV);
+
+ bool seval_wrt_ARG(EvaluationEnvironment & ENV);
+
+
+ bool decode_seval(EvaluationEnvironment & ENV);
+
+};
+
+
+} /* namespace sep */
+
+#endif /* AVMPRIMITIVEPROCESSOR_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmSchedulingPrimitive.cpp b/org.eclipse.efm.symbex/src/computer/primitive/AvmSchedulingPrimitive.cpp
new file mode 100644
index 0000000..e8e77fc
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmSchedulingPrimitive.cpp
@@ -0,0 +1,378 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmSchedulingPrimitive.h"
+
+#include <computer/ExecutionEnvironment.h>
+#include <computer/PathConditionProcessor.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/ExpressionConstant.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+
+/**
+ ***************************************************************************
+ * execution of an EXCLUSIVE program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Exclusive::run(ExecutionEnvironment & ENV)
+{
+ ENV.inED->setEnabledLocalNodeCondition( true );
+
+ ListOfAPExecutionData oneListOfED;
+ ListOfAPExecutionData resultListOfED;
+
+ AvmCode::const_iterator it = ENV.inCODE->begin();
+ AvmCode::const_iterator itEnd = ENV.inCODE->end();
+
+ // Initialisation du process
+ ExecutionEnvironment tmpENV(ENV, *it);
+ if( not tmpENV.run() )
+ {
+ return( false );
+ }
+ oneListOfED.splice( tmpENV.outEDS );
+
+ // Recurrence
+ for( ++it ; it != itEnd ; ++it )
+ {
+ if( not tmpENV.run(*it) )
+ {
+ return( false );
+ }
+
+ // COMPUTE STRONG FUSION
+ if( oneListOfED.empty() )
+ {
+ resultListOfED.splice( tmpENV.outEDS );
+ }
+ else if( tmpENV.outEDS.empty() )
+ {
+ resultListOfED.splice( oneListOfED );
+ }
+
+ else
+ {
+ ListOfAPExecutionData::iterator itOther = tmpENV.outEDS.begin();
+ ListOfAPExecutionData::iterator endOther = tmpENV.outEDS.end();
+ for( ; itOther != endOther ; ++itOther )
+ {
+ // Compute OTHER where NOT ONE
+ if( not evalExclusive(ENV.inED,
+ oneListOfED, (*itOther), resultListOfED) )
+ {
+ //return( false );
+ }
+
+ // Compute ONE where NOT OTHERS
+ if( not evalExclusive(ENV.inED,
+ (*itOther), oneListOfED, resultListOfED) )
+ {
+ //return( false );
+ }
+ }
+
+ oneListOfED.clear();
+ resultListOfED.makeUnique();
+ }
+
+ while( resultListOfED.nonempty() )
+ {
+ resultListOfED.last()->setEnabledLocalNodeCondition( false );
+
+ oneListOfED.append( resultListOfED.pop_last() );
+ }
+ }
+
+ ENV.inED->setEnabledLocalNodeCondition( false );
+
+ ENV.outEDS.splice( oneListOfED );
+
+ ENV.spliceNotOutput( tmpENV );
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of an NONDETERMINISM program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Nondeterminism::run(ExecutionEnvironment & ENV)
+{
+ AvmCode::const_iterator endIt = ENV.inCODE->end();
+ for( AvmCode::const_iterator it = ENV.inCODE->begin() ; it != endIt ; ++it )
+ {
+ ENV.run( *it );
+ }
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of a PRIOR program
+ ***************************************************************************
+ */
+bool AvmPrimitive_Prior::run(ExecutionEnvironment & ENV)
+{
+ APExecutionData tmpED;
+
+ BF aPathCondition;
+ BF aPriorityCondition = ExpressionConstant::BOOLEAN_TRUE;
+
+ BFCode theNodeCondition( OperatorManager::OPERATOR_OR );
+
+ BF saveParamsRF = ENV.inED->bfParametersRuntimeForm();
+
+ BF bfUpdateParamsRF = saveParamsRF;
+ bfUpdateParamsRF.makeWritable();
+ ParametersRuntimeForm * updateParamsRF =
+ bfUpdateParamsRF.to_ptr< ParametersRuntimeForm >();
+
+ // Recurrence
+ AvmCode::const_iterator itEnd = ENV.inCODE->end();
+ for( AvmCode::const_iterator it = ENV.inCODE->begin() ; it != itEnd ; ++it )
+ {
+ ENV.inED->assignParametersRuntimeForm( bfUpdateParamsRF );
+
+ ExecutionEnvironment tmpENV(ENV, *it);
+ tmpENV.inED->setEnabledLocalNodeCondition( true );
+
+ tmpENV.run();
+
+ if( tmpENV.outEDS.nonempty() || tmpENV.exitEDS.nonempty() )
+ {
+ while( tmpENV.outEDS.nonempty() )
+ {
+ tmpENV.outEDS.pop_last_to( tmpED );
+
+ if( aPriorityCondition.isEqualTrue() )
+ {
+ aPathCondition = tmpED->getPathCondition();
+ }
+ else if( tmpED->getPathCondition().isEqualTrue() )
+ {
+ aPathCondition = aPriorityCondition;
+ }
+ else
+ {
+ aPathCondition = ExpressionConstructor::andExpr(
+ aPriorityCondition, tmpED->getPathCondition());
+
+ if( not PathConditionProcessor::isWeakSatisfiable(
+ aPathCondition) )
+ {
+ aPathCondition = ExpressionConstant::BOOLEAN_FALSE;
+
+AVM_IF_DEBUG_FLAG( STATEMENT_TEST_DECISION )
+ AVM_OS_TRACE << "PATH CONDITION : "
+ << tmpED->getPathCondition().str() << std::endl
+ << "PRIORITY CONDITION : " << aPriorityCondition.str() << std::endl
+ << "FIREABLE CONDITION : " << aPathCondition.str() << std::endl
+ << "THROW UNSATISFIED << PRIOR CONDITION >> : "
+ << tmpED->mRID.strUniqId() << " |=> " << (*it).str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_TEST_DECISION )
+ }
+ }
+
+ if( aPathCondition.isNotEqualFalse() )
+ {
+ if( tmpED->getAllNodeCondition().isNotEqualTrue() )
+ {
+ theNodeCondition->append( tmpED->getAllNodeCondition() );
+
+ updateParamsRF->update( tmpED->getAllNodeCondition() );
+ }
+
+ tmpED->setPathCondition( aPathCondition );
+ tmpED->setEnabledLocalNodeCondition( false );
+
+ ENV.outEDS.append( tmpED );
+ }
+ }
+
+ while( tmpENV.exitEDS.nonempty() )
+ {
+ tmpENV.exitEDS.pop_last_to( tmpED );
+
+ if( aPriorityCondition.isEqualTrue() )
+ {
+ aPathCondition = tmpED->getPathCondition();
+ }
+ else if( tmpED->getPathCondition().isEqualTrue() )
+ {
+ aPathCondition = aPriorityCondition;
+ }
+ else
+ {
+ aPathCondition = ExpressionConstructor::andExpr(
+ aPriorityCondition, tmpED->getPathCondition());
+
+ if( not PathConditionProcessor::isWeakSatisfiable(
+ aPathCondition) )
+ {
+ aPathCondition = ExpressionConstant::BOOLEAN_FALSE;
+
+AVM_IF_DEBUG_FLAG( STATEMENT_TEST_DECISION )
+ AVM_OS_TRACE << "PATH CONDITION : "
+ << tmpED->getPathCondition().str() << std::endl
+ << "PRIORITY CONDITION : " << aPriorityCondition.str() << std::endl
+ << "FIREABLE CONDITION : " << aPathCondition.str() << std::endl
+ << "THROW UNSATISFIED << PRIOR CONDITION >> : "
+ << tmpED->mRID.strUniqId() << " |=> " << (*it).str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_TEST_DECISION )
+ }
+ }
+
+ if( aPathCondition.isNotEqualFalse() )
+ {
+ if( tmpED->getAllNodeCondition().isNotEqualTrue() )
+ {
+ theNodeCondition->append( tmpED->getAllNodeCondition() );
+
+ updateParamsRF->update( tmpED->getAllNodeCondition() );
+ }
+
+ tmpED->setPathCondition( aPathCondition );
+ tmpED->setEnabledLocalNodeCondition( false );
+
+ ENV.exitEDS.append( tmpED );
+ }
+ }
+
+
+ if( theNodeCondition->empty() )
+ {
+ //aPriorityCondition = ExpressionConstant::BOOLEAN_FALSE; // <=> not true
+ break;
+ }
+
+ else if( theNodeCondition->populated() )
+ {
+ aPriorityCondition = ExpressionConstructor::notExpr(
+ theNodeCondition );
+ }
+ else
+ {
+ aPriorityCondition = ExpressionConstructor::notExpr(
+ theNodeCondition->pop_last() );
+ }
+
+ if( not PathConditionProcessor::isWeakSatisfiable(
+ aPriorityCondition) )
+ {
+ break;
+ }
+
+AVM_IF_DEBUG_FLAG( STATEMENT_TEST_DECISION )
+ AVM_OS_TRACE << "PRIORITY CONDITION : " << aPriorityCondition.str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( STATEMENT_TEST_DECISION )
+ }
+
+ ENV.spliceNotOutput( tmpENV );
+ }
+
+ ENV.inED->assignParametersRuntimeForm( saveParamsRF );
+
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of an AND#THEN program
+ ***************************************************************************
+ */
+bool AvmPrimitive_ScheduleAndThen::run(ExecutionEnvironment & ENV)
+{
+ ExecutionEnvironment tmpENV(ENV, BF::REF_NULL);
+
+ tmpENV.outEDS.append(tmpENV.inED);
+
+ AvmCode::const_iterator itArg = ENV.inCODE->begin();
+ AvmCode::const_iterator endArg = ENV.inCODE->end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ if( tmpENV.runFromOutputs( (*itArg).bfCode() ) )
+ {
+ if( tmpENV.outEDS.empty() && tmpENV.exitEDS.empty() &&
+ tmpENV.syncEDS.empty() && tmpENV.irqEDS.empty() )
+ {
+ break;
+ }
+ else
+ {
+ // THEN case
+ }
+ }
+ }
+
+ ENV.spliceOutput( tmpENV );
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * execution of an OR#ELSE program
+ ***************************************************************************
+ */
+bool AvmPrimitive_ScheduleOrElse::run(ExecutionEnvironment & ENV)
+{
+ ExecutionEnvironment tmpENV(ENV, BF::REF_NULL);
+
+ AvmCode::const_iterator itArg = ENV.inCODE->begin();
+ AvmCode::const_iterator endArg = ENV.inCODE->end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ if( tmpENV.run( (*itArg).bfCode() ) )
+ {
+ if( tmpENV.outEDS.nonempty() || tmpENV.exitEDS.nonempty() ||
+ tmpENV.syncEDS.nonempty() || tmpENV.irqEDS.nonempty() )
+ {
+ ENV.spliceOutput( tmpENV );
+
+ break;
+ }
+ else
+ {
+ // ELSE case
+ }
+ }
+
+ ENV.spliceOutput( tmpENV );
+ }
+
+ return( true );
+}
+
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmSchedulingPrimitive.h b/org.eclipse.efm.symbex/src/computer/primitive/AvmSchedulingPrimitive.h
new file mode 100644
index 0000000..14b04d4
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmSchedulingPrimitive.h
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMSCHEDULINGPRIMITIVE_H_
+#define AVMSCHEDULINGPRIMITIVE_H_
+
+#include <computer/primitive/AvmBaseConcurrencyPrimitive.h>
+#include <computer/primitive/BaseAvmPrimitive.h>
+
+
+namespace sep
+{
+
+AVM_PRIMITIVE_RUN_CLASS(Exclusive, sep::AvmBaseConcurrencyPrimitive)
+
+
+AVM_PRIMITIVE_RUN_CLASS(Nondeterminism, BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_RUN_CLASS(Prior, BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_RUN_CLASS(ScheduleAndThen, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_RUN_CLASS(ScheduleOrElse, BaseAvmPrimitive)
+
+
+}
+
+#endif /* AVMSCHEDULINGPRIMITIVE_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmSequencePrimitive.cpp b/org.eclipse.efm.symbex/src/computer/primitive/AvmSequencePrimitive.cpp
new file mode 100644
index 0000000..402788e
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmSequencePrimitive.cpp
@@ -0,0 +1,612 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmSequencePrimitive.h"
+
+#include <computer/ExecutionEnvironment.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+
+/**
+ ***************************************************************************
+ * execution of an ATOMIC SEQUENCE program
+ ***************************************************************************
+ */
+
+bool AvmPrimitive_AtomicSequence::run(ExecutionEnvironment & ENV)
+{
+ AvmCode::const_iterator itProg = ENV.inCODE->begin();
+ AvmCode::const_iterator itEnd = ENV.inCODE->end();
+
+ APExecutionData tmpED;
+
+ // Evaluation of FIRST SEQUENCIAL STATEMENT
+ ExecutionEnvironment tmpENV(ENV, (*itProg).bfCode());
+ if( not tmpENV.run() )
+ {
+ return( false );
+ }
+
+ for( ++itProg ; itProg != itEnd ; ++itProg )
+ {
+AVM_IF_DEBUG_LEVEL_OR_FLAG2( HIGH , COMPUTING , STATEMENT )
+ static avm_uint32_t ecCount = 8;
+ if( tmpENV.outEDS.size() > ecCount )
+ {
+ ecCount = (avm_uint32_t)( ecCount * 1.5 );
+ AVM_OS_TRACE << REPEAT("==========", 5) << std::endl
+ << ">>>> Execution from " << tmpENV.outEDS.size()
+ << " ECs" << std::endl;
+ }
+AVM_ENDIF_DEBUG_LEVEL_OR_FLAG2( HIGH , COMPUTING , STATEMENT )
+
+ // for output ED
+ if( tmpENV.outEDS.nonempty() )
+ {
+ if( not tmpENV.runFromOutputs((*itProg).bfCode()) )
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ ENV.spliceOutput( tmpENV );
+
+ return( true );
+}
+
+
+
+
+/**
+ ***************************************************************************
+ * execution of a SEQUENCE program
+ ***************************************************************************
+ */
+
+bool AvmPrimitive_Sequence::run(ExecutionEnvironment & ENV,
+ AvmCode::const_iterator itProg, AvmCode::const_iterator itEnd)
+{
+ APExecutionData tmpED;
+ RuntimeID tmpRID = ENV.inED->mRID;
+
+ ListOfAPExecutionData listOfCurrentED;
+
+ // Evaluation of FIRST SEQUENCIAL STATEMENT
+ ExecutionEnvironment tmpENV(ENV, (*itProg).bfCode());
+ if( tmpENV.run() )
+ {
+ listOfCurrentED.splice( tmpENV.outEDS );
+
+ // Sync EDS traitement
+ ENV.spliceSync_mwStorePos(tmpENV, (itProg + 1), itEnd);
+ }
+ else
+ {
+ return( false );
+ }
+
+ for( ++itProg ; itProg != itEnd ; ++itProg )
+ {
+AVM_IF_DEBUG_LEVEL_OR_FLAG2( HIGH , COMPUTING , STATEMENT )
+ static avm_uint32_t ecCount = 8;
+ if( listOfCurrentED.size() > ecCount )
+ {
+ ecCount = (avm_uint32_t)( ecCount * 1.5 );
+ AVM_OS_TRACE << REPEAT("==========", 5) << std::endl
+ << ">>>> Execution from " << listOfCurrentED.size()
+ << " ECs" << std::endl;
+ }
+AVM_ENDIF_DEBUG_LEVEL_OR_FLAG2( HIGH , COMPUTING , STATEMENT )
+
+ while( listOfCurrentED.nonempty() )
+ {
+// currentED.pop_first_to( tmpED );
+ listOfCurrentED.pop_last_to( tmpED );
+
+ switch( tmpED->mAEES )
+ {
+ case AEES_STMNT_NOTHING:
+ case AEES_STMNT_FINAL:
+ case AEES_STMNT_DESTROY:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ //!!! NO << break >> for these statement
+ }
+
+ // Evaluation of NEXT SEQUENCIAL STATEMENT
+ case AEES_OK:
+ case AEES_STEP_RESUME:
+ {
+ if( tmpED->mPreserveRID )
+ {
+ tmpED->mPreserveRID = false;
+ tmpRID = tmpED->mRID;
+ }
+ else
+ {
+ tmpED->mRID = tmpRID;
+ }
+
+ if( tmpENV.run(tmpED, (*itProg).bfCode()) )
+ {
+ // Sync EDS traitement
+ ENV.spliceSync_mwStorePos(tmpENV, (itProg + 1), itEnd);
+ }
+ else
+ {
+ return( false );
+ }
+
+ break;
+ }
+
+ default:
+ {
+ ENV.destroyOutED();
+
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as outEDS:> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+
+ listOfCurrentED.splice( tmpENV.outEDS );
+ }
+
+ ENV.outEDS.splice( listOfCurrentED );
+
+ ENV.spliceNotOutput(tmpENV);
+
+ return( true );
+}
+
+
+bool AvmPrimitive_Sequence::run(ExecutionEnvironment & ENV)
+{
+ AvmCode::const_iterator itProg = ENV.inCODE->begin();
+ AvmCode::const_iterator itEnd = ENV.inCODE->end();
+
+ APExecutionData tmpED;
+ RuntimeID tmpRID = ENV.inED->mRID;
+
+ ListOfAPExecutionData listOfCurrentED;
+
+ // Evaluation of FIRST SEQUENCIAL STATEMENT
+ ExecutionEnvironment tmpENV(ENV, (*itProg).bfCode());
+ if( tmpENV.run() )
+ {
+ listOfCurrentED.splice( tmpENV.outEDS );
+
+ // Sync EDS traitement
+ ENV.spliceSync_mwStorePos(tmpENV, (itProg + 1), itEnd);
+ }
+ else
+ {
+ return( false );
+ }
+
+ for( ++itProg ; itProg != itEnd ; ++itProg )
+ {
+AVM_IF_DEBUG_LEVEL_OR_FLAG2( HIGH , COMPUTING , STATEMENT )
+ static avm_uint32_t ecCount = 8;
+ if( listOfCurrentED.size() > ecCount )
+ {
+ ecCount = (avm_uint32_t)( ecCount * 1.5 );
+ AVM_OS_TRACE << REPEAT("==========", 5) << std::endl
+ << ">>>> Execution from " << listOfCurrentED.size()
+ << " ECs" << std::endl;
+ }
+AVM_ENDIF_DEBUG_LEVEL_OR_FLAG2( HIGH , COMPUTING , STATEMENT )
+
+ while( listOfCurrentED.nonempty() )
+ {
+// currentED.pop_first_to( tmpED );
+ listOfCurrentED.pop_last_to( tmpED );
+
+ switch( tmpED->mAEES )
+ {
+ case AEES_STMNT_NOTHING:
+ case AEES_STMNT_FINAL:
+ case AEES_STMNT_DESTROY:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ //!!! NO << break >> for these statement
+ }
+
+ // Evaluation of NEXT SEQUENCIAL STATEMENT
+ case AEES_OK:
+ case AEES_STEP_RESUME:
+ {
+ if( tmpED->mPreserveRID )
+ {
+ tmpED->mPreserveRID = false;
+ tmpRID = tmpED->mRID;
+ }
+ else
+ {
+ tmpED->mRID = tmpRID;
+ }
+
+ if( tmpENV.run(tmpED, (*itProg).bfCode()) )
+ {
+ // Sync EDS traitement
+ ENV.spliceSync_mwStorePos(tmpENV, (itProg + 1), itEnd);
+ }
+ else
+ {
+ return( false );
+ }
+
+ break;
+ }
+
+ default:
+ {
+ ENV.destroyOutED();
+
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as outEDS:> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+
+ listOfCurrentED.splice( tmpENV.outEDS );
+ }
+
+
+ ENV.outEDS.splice( listOfCurrentED );
+
+ ENV.spliceNotOutput(tmpENV);
+
+ return( true );
+}
+
+
+bool AvmPrimitive_Sequence::resume(ExecutionEnvironment & ENV)
+{
+ if( ENV.inEXEC_LOCATION->itCode != ENV.inEXEC_LOCATION->endCode )
+ {
+ return( run(ENV, ENV.inEXEC_LOCATION->itCode,
+ ENV.inEXEC_LOCATION->endCode) );
+ }
+ else
+ {
+ ENV.outEDS.append( ENV.inED );
+ return( true );
+ }
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of a SIDE_SEQUENCE program
+ ***************************************************************************
+ */
+bool AvmPrimitive_SideSequence::run(ExecutionEnvironment & ENV,
+ AvmCode::const_iterator itProg, AvmCode::const_iterator itEnd)
+{
+ APExecutionData tmpED;
+ RuntimeID tmpRID = ENV.inED->mRID;
+
+ ListOfAPExecutionData listOfCurrentED;
+ ListOfAPExecutionData listOfNextED;
+
+ // Evaluation of FIRST SEQUENCIAL STATEMENT
+ ExecutionEnvironment tmpENV(ENV, (*itProg).bfCode());
+ if( tmpENV.run() )
+ {
+ listOfCurrentED.splice( tmpENV.outEDS );
+
+ // Sync EDS traitement
+ ENV.spliceSync_mwStorePos(tmpENV, (itProg + 1), itEnd);
+ }
+ else
+ {
+ return( false );
+ }
+
+ for( ++itProg ; itProg != itEnd ; ++itProg )
+ {
+AVM_IF_DEBUG_LEVEL_OR_FLAG2( HIGH , COMPUTING , STATEMENT )
+ static avm_uint32_t ecCount = 8;
+ if( listOfCurrentED.size() > ecCount )
+ {
+ ecCount = (avm_uint32_t)( ecCount * 1.5 );
+ AVM_OS_TRACE << REPEAT("==========", 5) << std::endl
+ << ">>>> Execution from " << listOfCurrentED.size()
+ << " ECs" << std::endl;
+ }
+AVM_ENDIF_DEBUG_LEVEL_OR_FLAG2( HIGH , COMPUTING , STATEMENT )
+
+ while( listOfCurrentED.nonempty() )
+ {
+// currentED.pop_first_to( tmpED );
+ listOfCurrentED.pop_last_to( tmpED );
+
+ switch( tmpED->mAEES )
+ {
+ case AEES_STMNT_NOTHING:
+ case AEES_STMNT_FINAL:
+ case AEES_STMNT_DESTROY:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ //!!! NO << break >> for these statement
+ }
+
+ // Evaluation of NEXT SEQUENCIAL STATEMENT
+ case AEES_OK:
+ case AEES_STEP_RESUME:
+ {
+ if( tmpED->mPreserveRID )
+ {
+ tmpED->mPreserveRID = false;
+ tmpRID = tmpED->mRID;
+ }
+ else
+ {
+ tmpED->mRID = tmpRID;
+ }
+
+ if( tmpENV.run(tmpED, (*itProg).bfCode()) )
+ {
+ // Sync EDS traitement
+ ENV.spliceSync_mwStorePos(tmpENV, (itProg + 1), itEnd);
+ }
+ else
+ {
+ return( false );
+ }
+
+ if( tmpENV.outEDS.nonempty() )
+ {
+ listOfNextED.splice(tmpENV.outEDS);
+ }
+ else if( tmpENV.exitEDS.empty() && tmpENV.syncEDS.empty() )
+ {
+ ENV.outEDS.append( tmpED );
+ }
+
+ ENV.spliceNotOutput(tmpENV);
+
+ break;
+ }
+
+ default:
+ {
+ ENV.destroyOutED();
+
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as outEDS:> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+
+ listOfCurrentED.splice( listOfNextED );
+ }
+
+ ENV.outEDS.splice( listOfCurrentED );
+
+ return( true );
+}
+
+
+bool AvmPrimitive_SideSequence::run(ExecutionEnvironment & ENV)
+{
+ return( run(ENV, ENV.inCODE->begin(), ENV.inCODE->end()) );
+}
+
+
+bool AvmPrimitive_SideSequence::resume(ExecutionEnvironment & ENV)
+{
+ if( ENV.inEXEC_LOCATION->itCode != ENV.inEXEC_LOCATION->endCode )
+ {
+ return( run(ENV, ENV.inEXEC_LOCATION->itCode,
+ ENV.inEXEC_LOCATION->endCode) );
+ }
+ else
+ {
+ ENV.outEDS.append( ENV.inED );
+ return( true );
+ }
+}
+
+
+
+/**
+ ***************************************************************************
+ * execution of a WEAK_SEQUENCE program
+ ***************************************************************************
+ */
+bool AvmPrimitive_WeakSequence::run(ExecutionEnvironment & ENV,
+ AvmCode::const_iterator itProg, AvmCode::const_iterator itEnd)
+{
+ APExecutionData tmpED;
+ RuntimeID tmpRID = ENV.inED->mRID;
+
+ ListOfAPExecutionData listOfCurrentED;
+ ListOfAPExecutionData listOfNextED;
+
+ // Evaluation of FIRST SEQUENCIAL STATEMENT
+ ExecutionEnvironment tmpENV(ENV, (*itProg).bfCode());
+ if( tmpENV.run() )
+ {
+ if( tmpENV.outEDS.nonempty() )
+ {
+ listOfCurrentED.splice( tmpENV.outEDS );
+ }
+ else if( tmpENV.exitEDS.empty() && tmpENV.syncEDS.empty() )
+ {
+ listOfCurrentED.append( ENV.inED );
+ }
+ else
+ {
+ ENV.spliceOutput(tmpENV);
+
+ return( true );
+ }
+
+ // Sync EDS traitement
+ ENV.spliceSync_mwStorePos(tmpENV, (itProg + 1), itEnd);
+ }
+ else
+ {
+ return( false );
+ }
+
+ for( ++itProg ; itProg != itEnd ; ++itProg )
+ {
+AVM_IF_DEBUG_LEVEL_OR_FLAG2( HIGH , COMPUTING , STATEMENT )
+ static avm_uint32_t ecCount = 8;
+ if( listOfCurrentED.size() > ecCount )
+ {
+ ecCount = (avm_uint32_t)( ecCount * 1.5 );
+ AVM_OS_TRACE << REPEAT("==========", 5) << std::endl
+ << ">>>> Execution from " << listOfCurrentED.size()
+ << " ECs" << std::endl;
+ }
+AVM_ENDIF_DEBUG_LEVEL_OR_FLAG2( HIGH , COMPUTING , STATEMENT )
+
+ while( listOfCurrentED.nonempty() )
+ {
+// currentED.pop_first_to( tmpED );
+ listOfCurrentED.pop_last_to( tmpED );
+
+ switch( tmpED->mAEES )
+ {
+ case AEES_STMNT_NOTHING:
+ case AEES_STMNT_FINAL:
+ case AEES_STMNT_DESTROY:
+ {
+ tmpED.mwsetAEES( AEES_OK );
+
+ //!!! NO << break >> for these statement
+ }
+
+ // Evaluation of NEXT SEQUENCIAL STATEMENT
+ case AEES_OK:
+ case AEES_STEP_RESUME:
+ {
+ tmpED->mRID = tmpRID;
+
+ if( tmpENV.run(tmpED, (*itProg).bfCode()) )
+ {
+ // Sync EDS traitement
+ ENV.spliceSync_mwStorePos(tmpENV, (itProg + 1), itEnd);
+ }
+ else
+ {
+ ENV.outEDS.append( tmpED );
+ }
+
+ if( tmpENV.outEDS.nonempty() )
+ {
+ listOfNextED.splice(tmpENV.outEDS);
+ }
+ else if( tmpENV.exitEDS.empty() && tmpENV.syncEDS.empty() )
+ {
+ listOfNextED.append(tmpED);
+ }
+
+ ENV.spliceNotOutput(tmpENV);
+
+ break;
+ }
+
+ default:
+ {
+ ENV.destroyOutED();
+
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS as outEDS:> "
+ << RuntimeDef::strAEES( tmpED->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+
+ listOfCurrentED.splice( listOfNextED );
+ }
+
+
+ if( listOfCurrentED.singleton() )
+ {
+ tmpED = listOfCurrentED.back();
+
+ if( ENV.inED == tmpED )
+ {
+ return( true );
+ }
+ }
+
+ ENV.outEDS.splice( listOfCurrentED );
+
+ return( true );
+}
+
+
+bool AvmPrimitive_WeakSequence::run(ExecutionEnvironment & ENV)
+{
+ return( run(ENV, ENV.inCODE->begin(), ENV.inCODE->end()) );
+}
+
+
+bool AvmPrimitive_WeakSequence::resume(ExecutionEnvironment & ENV)
+{
+ if( ENV.inEXEC_LOCATION->itCode != ENV.inEXEC_LOCATION->endCode )
+ {
+ return( run(ENV, ENV.inEXEC_LOCATION->itCode,
+ ENV.inEXEC_LOCATION->endCode) );
+ }
+ else
+ {
+ ENV.outEDS.append( ENV.inED );
+ return( true );
+ }
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmSequencePrimitive.h b/org.eclipse.efm.symbex/src/computer/primitive/AvmSequencePrimitive.h
new file mode 100644
index 0000000..ff5ff8b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmSequencePrimitive.h
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMSEQUENCEPRIMITIVE_H_
+#define AVMSEQUENCEPRIMITIVE_H_
+
+#include <computer/primitive/BaseAvmPrimitive.h>
+
+#include <fml/expression/AvmCode.h>
+
+
+namespace sep
+{
+
+
+AVM_PRIMITIVE_RUN_CLASS(AtomicSequence, BaseAvmPrimitive)
+
+
+AVM_PRIMITIVE_RUN_RESUME_CLASS_HEADER(Sequence, BaseAvmPrimitive)
+ bool run(ExecutionEnvironment & ENV,
+ AvmCode::const_iterator itProg, AvmCode::const_iterator itEnd);
+};
+
+
+AVM_PRIMITIVE_RUN_RESUME_CLASS_HEADER(SideSequence, BaseAvmPrimitive)
+ bool run(ExecutionEnvironment & ENV,
+ AvmCode::const_iterator itProg, AvmCode::const_iterator itEnd);
+};
+
+
+AVM_PRIMITIVE_RUN_RESUME_CLASS_HEADER(WeakSequence, BaseAvmPrimitive)
+ bool run(ExecutionEnvironment & ENV,
+ AvmCode::const_iterator itProg, AvmCode::const_iterator itEnd);
+};
+
+
+
+}
+
+#endif /* AVMSEQUENCEPRIMITIVE_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmStatusPrimitive.cpp b/org.eclipse.efm.symbex/src/computer/primitive/AvmStatusPrimitive.cpp
new file mode 100644
index 0000000..f7def3d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmStatusPrimitive.cpp
@@ -0,0 +1,614 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmStatusPrimitive.h"
+
+#include <common/BF.h>
+
+#include <computer/EvaluationEnvironment.h>
+#include <computer/ExecutionDataFactory.h>
+#include <computer/ExecutionEnvironment.h>
+
+#include <fml/expression/ExpressionComparer.h>
+#include <fml/expression/ExpressionConstant.h>
+#include <fml/expression/ExpressionConstructor.h>
+
+#include <fml/operator/Operator.h>
+
+#include <fml/runtime/ExecutionConfiguration.h>
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// COMPUTE STATUS STATE
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+static bool firedTraceIsRun(const BF & aFiredTrace, const RuntimeID & aRID)
+{
+ if( aFiredTrace.invalid() )
+ {
+ return false;
+ }
+
+ switch( aFiredTrace.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ const AvmCode * anAvmCode = aFiredTrace.to_ptr< AvmCode >();
+
+ AvmCode::const_iterator it = anAvmCode->begin();
+ AvmCode::const_iterator itEnd = anAvmCode->end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( firedTraceIsRun((*it), aRID) )
+ {
+ return( true );
+ }
+ }
+
+ break;
+ }
+
+ case FORM_EXECUTION_CONFIGURATION_KIND:
+ {
+ const ExecutionConfiguration * anExecConf =
+ aFiredTrace.to_ptr< ExecutionConfiguration >();
+
+ if( aRID == anExecConf->getRuntimeID() )
+ {
+ return( anExecConf->getOperator()->
+ isOpCode( AVM_OPCODE_RUN ) );
+ }
+ break;
+ }
+
+ case FORM_EXECUTION_CONTEXT_KIND:
+ {
+ return( firedTraceIsRun( aFiredTrace.to_ptr<
+ ExecutionContext >()->getRunnableElementTrace(), aRID) );
+ }
+
+ case FORM_EXECUTION_DATA_KIND:
+ {
+ return( firedTraceIsRun(aFiredTrace.to_ptr<
+ ExecutionData >()->getRunnableElementTrace(), aRID)
+ || firedTraceIsRun(aFiredTrace.to_ptr< ExecutionData >()->
+ getExecutionContext()->getRunnableElementTrace(), aRID) );
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+
+ return( false );
+}
+
+
+
+static bool computeStatusStateIs(const APExecutionData & apED,
+ const RuntimeID & aRID, const AVM_OPCODE op)
+{
+ switch( op )
+ {
+ case AVM_OPCODE_RUN:
+ {
+ return( apED->isRunning(aRID) || firedTraceIsRun(apED, aRID) );
+ }
+
+ case AVM_OPCODE_SCHEDULE_INVOKE:
+ {
+ return( apED->isIdle(aRID) );
+ }
+
+ case AVM_OPCODE_START:
+ case AVM_OPCODE_RESTART:
+ {
+ return( apED->isDefinedPES(aRID) &&
+ (! apED->isLoaded(aRID)) &&
+ (! apED->isStarting(aRID)) &&
+ (! apED->isFinalized(aRID)) &&
+ (! apED->isDestroyed(aRID))
+ );
+ }
+
+
+ case AVM_OPCODE_ENABLE_INVOKE:
+ {
+ return( apED->isIdleOrRunning(aRID) );
+ }
+
+ case AVM_OPCODE_DISABLE_INVOKE:
+ case AVM_OPCODE_ABORT_INVOKE:
+ {
+ return( apED->isDisableOrAborted(aRID) );
+ }
+
+
+ case AVM_OPCODE_FINAL:
+ {
+ return( apED->isFinalized(aRID) );
+ }
+
+ case AVM_OPCODE_DESTROY:
+ {
+ return( apED->isDestroyed(aRID) );
+ }
+
+
+ case AVM_OPCODE_SUSPEND:
+ {
+ return( apED->isSuspended(aRID) );
+ }
+
+ case AVM_OPCODE_STOP:
+ {
+ return( apED->isStopped(aRID) );
+ }
+
+
+ case AVM_OPCODE_WAIT:
+ {
+ return( apED->isWaiting(aRID) );
+ }
+
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+
+static bool computeStatusBeing(const APExecutionData & prevED,
+ const APExecutionData & anED, const RuntimeID & aRID, AVM_OPCODE op)
+{
+ switch( op )
+ {
+ case AVM_OPCODE_RUN:
+ {
+ if( prevED.valid() )
+ {
+ return( (! firedTraceIsRun(prevED, aRID) ) &&
+ (anED->isRunning(aRID) || firedTraceIsRun(anED, aRID)) );
+ }
+ else
+ {
+ return( anED->isRunning(aRID) );
+ }
+ }
+
+ case AVM_OPCODE_SCHEDULE_INVOKE:
+ {
+ if( prevED.valid() )
+ {
+ return( (! prevED->isIdle(aRID)) && anED->isIdle(aRID) );
+ }
+ else
+ {
+ return( anED->isRunning(aRID) );
+ }
+ }
+
+ case AVM_OPCODE_START:
+ case AVM_OPCODE_RESTART:
+ {
+ if( prevED.valid() )
+ {
+ return( (! prevED->isStarting(aRID)) &&
+ anED->isStarting(aRID) );
+ }
+ else
+ {
+ return( anED->isStarting(aRID) );
+ }
+ }
+
+ case AVM_OPCODE_FINAL:
+ {
+ if( prevED.valid() )
+ {
+ return( (! prevED->isFinalizing(aRID)) &&
+ anED->isFinalizing(aRID) );
+ }
+ else
+ {
+ return( anED->isFinalizing(aRID) );
+ }
+ }
+
+ case AVM_OPCODE_ENABLE_INVOKE:
+ {
+ if( prevED.valid() )
+ {
+ return( prevED->isDisableOrAborted(aRID) &&
+ anED->isIdleOrRunning(aRID) );
+ }
+ else
+ {
+ return( anED->isIdleOrRunning(aRID) );
+ }
+ }
+
+ case AVM_OPCODE_DISABLE_INVOKE:
+ {
+ if( prevED.valid() )
+ {
+ return( prevED->isIdleOrRunning(aRID) &&
+ anED->isDisable(aRID) );
+ }
+ else
+ {
+ return( anED->isIdleOrRunning(aRID) );
+ }
+ }
+
+ case AVM_OPCODE_ABORT_INVOKE:
+ {
+ if( prevED.valid() )
+ {
+ return( prevED->isIdleOrRunning(aRID) &&
+ anED->isAborted(aRID) );
+ }
+ else
+ {
+ return( anED->isIdleOrRunning(aRID) );
+ }
+ }
+
+
+ case AVM_OPCODE_SUSPEND:
+ {
+ if( prevED.valid() )
+ {
+ return( (! prevED->isSuspended(aRID)) &&
+ anED->isSuspended(aRID) );
+ }
+ else
+ {
+ return( anED->isSuspended(aRID) );
+ }
+ }
+
+
+ case AVM_OPCODE_WAIT:
+ {
+ if( prevED.valid() )
+ {
+ return( (! prevED->isWaiting(aRID)) &&
+ anED->isWaiting(aRID) );
+ }
+ else
+ {
+ return( anED->isWaiting(aRID) );
+ }
+ }
+
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// STATUS WAS
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_StatusWas::seval(EvaluationEnvironment & ENV)
+{
+ if( ENV.inEC->hasPrevious() )
+ {
+ Operator * anOperator = ENV.mARG->at(0).to_ptr< Operator >();
+
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_ASSIGN:
+ {
+ ENV.outVAL = ExpressionConstructor::newBoolean(
+ ENV.isAssigned(ENV.mARG->outED.getPrevious(),
+ ENV.mARG->outED->mRID,
+ ENV.mARG->at(1).to_ptr< InstanceOfData >()));
+ return( true );
+ }
+
+ default:
+ {
+ const RuntimeID & aRID = ENV.mARG->at(1).bfRID();
+
+ if( aRID.valid() )
+ {
+ ENV.outVAL = ExpressionConstructor::newBoolean(
+ computeStatusStateIs(ENV.mARG->outED.getPrevious(),
+ aRID, anOperator->getAvmOpCode()));
+ return( true );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ }
+ }
+ else
+ {
+ ENV.outVAL = ExpressionConstant::BOOLEAN_FALSE;
+
+ return( true );
+ }
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// STATUS IS
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_StatusIs::seval(EvaluationEnvironment & ENV)
+{
+ Operator * anOperator = ENV.mARG->at(0).to_ptr< Operator >();
+
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_ASSIGN:
+ {
+ ENV.outVAL = ExpressionConstructor::newBoolean(
+ ENV.isAssigned(ENV.mARG->outED,
+ ENV.mARG->outED->mRID,
+ ENV.mARG->at(1).to_ptr< InstanceOfData >()) );
+ return( true );
+ }
+
+ default:
+ {
+ const RuntimeID & aRID = ENV.mARG->at(1).bfRID();
+
+ if( aRID.valid() )
+ {
+ ENV.outVAL = ExpressionConstructor::newBoolean(
+ computeStatusStateIs(ENV.mARG->outED, aRID,
+ anOperator->getAvmOpCode()));
+ return( true );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ }
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// STATUS BEING
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_StatusBeing::seval(EvaluationEnvironment & ENV)
+{
+ if( ENV.inEC->hasPrevious() )
+ {
+ Operator * anOperator = ENV.mARG->at(0).to_ptr< Operator >();
+
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_ASSIGN:
+ {
+ ENV.outVAL = ExpressionConstructor::newBoolean(
+ ENV.isAssigned(ENV.mARG->outED,
+ ENV.mARG->outED->mRID,
+ ENV.mARG->at(1).to_ptr< InstanceOfData >()) );
+ return( true );
+ }
+
+ default:
+ {
+ const RuntimeID & aRID = ENV.mARG->at(1).bfRID();
+
+ if( aRID.valid() )
+ {
+ ENV.outVAL = ExpressionConstructor::newBoolean(
+ computeStatusBeing(ENV.mARG->outED.getPrevious(),
+ ENV.mARG->outED, aRID,
+ anOperator->getAvmOpCode()));
+ return( true );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ }
+ }
+ else
+ {
+ ENV.outVAL = ExpressionConstant::BOOLEAN_FALSE;
+ }
+
+ return( true );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// STATUS WILL
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+bool AvmPrimitive_StatusWill::seval(EvaluationEnvironment & ENV)
+{
+ Operator * anOperator = ENV.mARG->at(0).to_ptr< Operator >();
+
+ bool evalStatusFlag = false;
+
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_ASSIGN:
+ {
+ InstanceOfData * lvalue = ENV.mARG->at(1).to_ptr< InstanceOfData >();
+
+ ExecutionContext::child_iterator endEC = ENV.inEC->end();
+ ExecutionContext::child_iterator itEC;
+
+ evalStatusFlag = false;
+ for( itEC = ENV.inEC->begin() ; itEC != endEC ; ++itEC )
+ {
+ if( ENV.isAssigned((*itEC)->getAPExecutionData(),
+ ENV.mARG->outED->mRID, lvalue) )
+ {
+ evalStatusFlag = true;
+ break;
+ }
+ }
+
+ ENV.outVAL = ExpressionConstructor::newBoolean(evalStatusFlag);
+
+ return( true );
+ }
+
+ default:
+ {
+ const RuntimeID & aRID = ENV.mARG->at(1).bfRID();
+
+ if( aRID.valid() )
+ {
+ ExecutionContext::child_iterator endEC = ENV.inEC->end();
+ ExecutionContext::child_iterator itEC;
+
+ for( itEC = ENV.inEC->begin() ; itEC != endEC ; ++itEC )
+ {
+ if( computeStatusStateIs((*itEC)->getAPExecutionData(),
+ aRID, anOperator->getAvmOpCode()) )
+ {
+ evalStatusFlag = true;
+ break;
+ }
+ }
+ ENV.outVAL =
+ ExpressionConstructor::newBoolean(
+ evalStatusFlag);
+ return( true );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ }
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// CHANGED
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmPrimitive_Changed::seval(EvaluationEnvironment & ENV)
+{
+ InstanceOfData * lvalue = ENV.mARG->at(0).to_ptr< InstanceOfData >();
+
+ bool isChangedFlag = true;
+
+ if( ENV.isAssigned(ENV.mARG->outED, ENV.mARG->outED->mRID, lvalue) )
+ {
+ isChangedFlag = true;
+ const BF & currentValue = ENV.getRvalue(ENV.mARG->outED,
+ ENV.mARG->outED->mRID, lvalue);
+
+ if( ENV.inEC->hasPrevious() )
+ {
+ isChangedFlag = currentValue.strNEQ(
+ ENV.getRvalue(ENV.mARG->outED.getPrevious(),
+ ENV.mARG->outED->mRID, lvalue));
+ }
+
+ if( (! isChangedFlag) && ENV.mARG->outED->hasExecutionContext() &&
+ (ENV.mARG->outED->getExecutionContext()->
+ getAPExecutionData() != ENV.mARG->outED) )
+ {
+ isChangedFlag = currentValue.strNEQ(
+ ENV.getRvalue(ENV.mARG->outED->getExecutionContext()->
+ getAPExecutionData(), ENV.mARG->outED->mRID, lvalue));
+ }
+ else
+ {
+ isChangedFlag = false;
+ }
+ }
+ else
+ {
+ isChangedFlag = false;
+ }
+
+ ENV.outVAL = ExpressionConstructor::newBoolean( isChangedFlag );
+
+ return( true );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// CHANGED TO
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+//!! TODO OPTIMIZATION
+bool AvmPrimitive_ChangedTo::seval(EvaluationEnvironment & ENV)
+{
+ InstanceOfData * lvalue = ENV.mARG->at(0).to_ptr< InstanceOfData >();
+
+ if( ENV.isAssigned(ENV.mARG->outED, ENV.mARG->outED->mRID, lvalue) )
+ {
+ const BF & currentValue = ENV.getRvalue(ENV.mARG->outED,
+ ENV.mARG->outED->mRID, lvalue);
+
+ ENV.outVAL = ExpressionConstructor::newBoolean(
+ currentValue.strNEQ( ENV.mARG->at(1) ) );
+ }
+ else
+ {
+ ENV.outVAL = ExpressionConstant::BOOLEAN_FALSE;
+ }
+
+ return( true );
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmStatusPrimitive.h b/org.eclipse.efm.symbex/src/computer/primitive/AvmStatusPrimitive.h
new file mode 100644
index 0000000..8a1867a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmStatusPrimitive.h
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMSTATUSPRIMITIVE_H_
+#define AVMSTATUSPRIMITIVE_H_
+
+#include <computer/primitive/BaseAvmPrimitive.h>
+
+
+namespace sep
+{
+
+
+AVM_PRIMITIVE_EVAL_CLASS(StatusWas, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(StatusIs, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(StatusBeing, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(StatusWill, BaseAvmPrimitive)
+
+AVM_PRIMITIVE_EVAL_CLASS(Changed, BaseAvmPrimitive)
+AVM_PRIMITIVE_EVAL_CLASS(ChangedTo, BaseAvmPrimitive)
+
+
+
+}
+
+#endif /* AVMSTATUSPRIMITIVE_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmSynchronizationFactory.cpp b/org.eclipse.efm.symbex/src/computer/primitive/AvmSynchronizationFactory.cpp
new file mode 100644
index 0000000..597f710
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmSynchronizationFactory.cpp
@@ -0,0 +1,1551 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 5 nov. 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmSynchronizationFactory.h"
+
+#include <fml/executable/InstanceOfData.h>
+#include <fml/executable/Router.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/AvmCodeFactory.h>
+#include <fml/expression/BuiltinArray.h>
+#include <fml/expression/ExpressionSimplifier.h>
+#include <fml/expression/StatementConstructor.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeForm.h>
+
+
+
+namespace sep
+{
+
+
+/*
+ *******************************************************************************
+ *******************************************************************************
+ * FUSION
+ * ExecutionData -- RuntimeForm
+ *******************************************************************************
+ *******************************************************************************
+ */
+
+BF AvmSynchronizationFactory::buildScheduleForm(Operator * buildOp,
+ const BF & refScheduleForm, const BF & frstScheduleForm,
+ const BF & sndScheduleForm)
+{
+ return( AvmCodeFactory::flattenCode( StatementConstructor::newCode(
+ buildOp, frstScheduleForm, sndScheduleForm) ) );
+}
+
+
+APExecutionData AvmSynchronizationFactory::fusion(const ExecutionData & refED,
+ const ExecutionData & firstED, const ExecutionData & sndED)
+{
+ avm_size_t refMachineCount = refED.getTableOfRuntime().size();
+
+ avm_size_t syncMachineCount = std::max(
+ sndED.getTableOfRuntime().size(),
+ firstED.getTableOfRuntime().size() );
+
+ APExecutionData newED( new ExecutionData(syncMachineCount) );
+
+ // fusion of ExecutionContext
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( firstED.hasExecutionContext() )
+ << "firstED must have ExecutionContext container !!!"
+ << SEND_EXIT;
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( sndED.hasExecutionContext() )
+ << "sndED must have ExecutionContext container !!!"
+ << SEND_EXIT;
+// AVM_OS_ASSERT_FATAL_ERROR_EXIT(
+// firstED.getExecutionContext() == sndED.getExecutionContext() )
+// << "firstED & sndED must have the same ExecutionContext container !!!"
+// << SEND_EXIT;
+
+ newED->setExecutionContext( firstED.getExecutionContext() );
+
+
+ // fusion of mAEES
+ newED->mAEES = RuntimeDef::syncAEES(firstED.mAEES, sndED.mAEES);
+ if( newED->mAEES == AEES_UNKNOWN_SYNC )
+ {
+ AVM_OS_ERROR_ALERT << "ExecutionData:> fusion of AEES FAILED : ( "
+ << RuntimeDef::strAEES(firstED.mAEES) << " |sync| "
+ << RuntimeDef::strAEES(sndED.mAEES) << " ) !!!"
+ << SEND_ALERT;
+
+ return( APExecutionData::REF_NULL );
+ }
+
+
+ // fusion of mRID
+ if( firstED.mRID == sndED.mRID )
+ {
+ newED->mRID = firstED.mRID;
+ }
+ else
+ {
+ newED->mRID = refED.mRID;
+
+// AVM_OS_WARNING_ALERT << "ExecutionData:> fusion of RID FAILED : ( ref< "
+// << refED->mRID.str() << " > , " << firstED.mRID.str()
+// << " != " << sndED.mRID.str() << " )"
+// << SEND_ALERT;
+//
+// return( APExecutionData::REF_NULL );
+ }
+
+
+ // fusion of onInit
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( firstED.hasOnInit() )
+ << "firstED must have onInit !!!"
+ << SEND_EXIT;
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( sndED.hasOnInit() )
+ << "sndED must have onInit !!!"
+ << SEND_EXIT;
+
+ if( refED.getOnInit() == firstED.getOnInit() )
+ {
+ newED->setOnInit( sndED.getOnInit() );
+ }
+ else if( refED.getOnInit() == sndED.getOnInit() )
+ {
+ newED->setOnInit( firstED.getOnInit() );
+ }
+ else if( firstED.getOnInit() == sndED.getOnInit() )
+ {
+ newED->setOnInit( firstED.getOnInit() );
+ }
+// else if( firstED.hasOnInit() && sndED.hasOnInit() )
+// {
+//// BFCode onInit = AvmCodeFactory::flattenCode(
+//// StatementConstructor::newCode(
+//// OperatorManager::OPERATOR_PARALLEL,
+//// firstED.getOnInit(), sndED.getOnInit()) );
+//// newED->setOnInit( onInit );
+//
+// AVM_OS_ERROR_ALERT << "ExecutionData:> fusion of routine OnInit FAILED :"
+// << "\n\t$0 = " << refED.getOnInit().str()
+// << "\n\t$1 = " << firstED.getOnInit().str()
+// << "\n\t$2 = " << sndED.getOnInit().str()
+// << SEND_ALERT;
+//
+// return( APExecutionData::REF_NULL );
+// }
+ else
+ {
+ AVM_OS_ERROR_ALERT << "ExecutionData:> fusion of routine OnInit FAILED :"
+ << "\n\t$0 = " << refED.getOnInit().str()
+ << "\n\t$1 = " << firstED.getOnInit().str()
+ << "\n\t$2 = " << sndED.getOnInit().str()
+ << SEND_ALERT;
+
+ return( APExecutionData::REF_NULL );
+ }
+
+ // fusion of onSchedule
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( firstED.hasOnSchedule() )
+ << "firstED must have onSchedule !!!"
+ << SEND_EXIT;
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( sndED.hasOnSchedule() )
+ << "sndED must have onSchedule !!!"
+ << SEND_EXIT;
+
+ if( refED.getOnSchedule() == firstED.getOnSchedule() )
+ {
+ newED->setOnSchedule( sndED.getOnSchedule() );
+ }
+ else if( refED.getOnSchedule() == sndED.getOnSchedule() )
+ {
+ newED->setOnSchedule( firstED.getOnSchedule() );
+ }
+ else if( firstED.getOnSchedule() == sndED.getOnSchedule() )
+ {
+ newED->setOnSchedule( firstED.getOnSchedule() );
+ }
+// else if( firstED.hasOnSchedule() && sndED.hasOnSchedule() )
+// {
+//// BFCode onSchedule = AvmCodeFactory::flattenCode(
+//// StatementConstructor::newCode(
+//// OperatorManager::OPERATOR_PARALLEL,
+//// firstED.getOnSchedule(), sndED.getOnSchedule()) );
+//// newED->setOnSchedule( onSchedule );
+//
+// AVM_OS_ERROR_ALERT << "ExecutionData:> fusion of routine OnSchedule FAILED :"
+// << "\n\t$0 = " << refED.getOnSchedule().str()
+// << "\n\t$1 = " << firstED.getOnSchedule().str()
+// << "\n\t$2 = " << sndED.getOnSchedule().str()
+// << SEND_ALERT;
+//
+// return( APExecutionData::REF_NULL );
+// }
+ else
+ {
+ AVM_OS_ERROR_ALERT << "ExecutionData:> fusion of routine OnSchedule FAILED :"
+ << "\n\t$0 = " << refED.getOnSchedule().str()
+ << "\n\t$1 = " << firstED.getOnSchedule().str()
+ << "\n\t$2 = " << sndED.getOnSchedule().str()
+ << SEND_ALERT;
+
+ return( APExecutionData::REF_NULL );
+ }
+
+
+ // fusion of RunnableElementTrace
+ if( firstED.hasRunnableElementTrace()
+ && sndED.hasRunnableElementTrace() )
+ {
+ if( firstED.getRunnableElementTrace() ==
+ sndED.getRunnableElementTrace() )
+ {
+ newED->setRunnableElementTrace(
+ firstED.getRunnableElementTrace() );
+ }
+ else
+ {
+ newED->setRunnableElementTrace( buildRunnableElementTrace(
+ OperatorManager::OPERATOR_PARALLEL,
+ refED.getRunnableElementTrace(),
+ firstED.getRunnableElementTrace(),
+ sndED.getRunnableElementTrace() ) );
+ }
+ }
+ else if( firstED.hasRunnableElementTrace() )
+ {
+ newED->setRunnableElementTrace( firstED.getRunnableElementTrace() );
+ }
+ else if( sndED.hasRunnableElementTrace() )
+ {
+ newED->setRunnableElementTrace( sndED.getRunnableElementTrace() );
+ }
+ else
+ {
+ newED->setRunnableElementTrace( refED.getRunnableElementTrace() );
+ }
+
+
+ // fusion of IOElementTrace
+ if( firstED.hasIOElementTrace() && sndED.hasIOElementTrace() )
+ {
+ if( firstED.getIOElementTrace() == sndED.getIOElementTrace() )
+ {
+ newED->setIOElementTrace( firstED.getIOElementTrace() );
+ }
+ else
+ {
+ newED->setIOElementTrace( buildIOElementTrace(
+ OperatorManager::OPERATOR_PARALLEL, refED.getIOElementTrace(),
+ firstED.getIOElementTrace(), sndED.getIOElementTrace() ) );
+ }
+ }
+ else if( firstED.hasIOElementTrace() )
+ {
+ newED->setIOElementTrace( firstED.getIOElementTrace() );
+ }
+ else if( sndED.hasIOElementTrace() )
+ {
+ newED->setIOElementTrace( sndED.getIOElementTrace() );
+ }
+ else
+ {
+ newED->setIOElementTrace( refED.getIOElementTrace() );
+ }
+
+
+ // fusion of NodeCondition
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( firstED.hasNodeCondition() )
+ << "firstED must have NodeCondition !!!"
+ << SEND_EXIT;
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( sndED.hasNodeCondition() )
+ << "sndED must have NodeCondition !!!"
+ << SEND_EXIT;
+
+ BF theNodeCondition = ExpressionSimplifier::simplif_and(
+ firstED.getNodeCondition(),
+ sndED.getNodeCondition());
+
+ newED->setNodeCondition( theNodeCondition );
+
+ if( theNodeCondition.isEqualFalse() )
+ {
+ return( APExecutionData::REF_NULL );
+ }
+
+
+ // fusion of NodeTimedCondition
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( firstED.hasNodeTimedCondition() )
+ << "firstED must have NodeTimedCondition !!!"
+ << SEND_EXIT;
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( sndED.hasNodeTimedCondition() )
+ << "sndED must have NodeTimedCondition !!!"
+ << SEND_EXIT;
+
+ BF theNodeTimedCondition = ExpressionSimplifier::simplif_and(
+ firstED.getNodeTimedCondition(),
+ sndED.getNodeTimedCondition());
+
+ newED->setNodeTimedCondition( theNodeTimedCondition );
+
+ if( theNodeTimedCondition.isEqualFalse() )
+ {
+ return( APExecutionData::REF_NULL );
+ }
+
+
+ // fusion of PathCondition
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( firstED.hasPathCondition() )
+ << "firstED must have PathCondition !!!"
+ << SEND_EXIT;
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( sndED.hasPathCondition() )
+ << "sndED must have PathCondition !!!"
+ << SEND_EXIT;
+
+ if( firstED.getPathCondition() == sndED.getPathCondition() )
+ {
+ newED->setPathCondition( firstED.getPathCondition() );
+ }
+ else
+ {
+ BF thePathCondition = ExpressionSimplifier::simplif_and(
+ firstED.getPathCondition(), sndED.getPathCondition());
+ if( thePathCondition.isEqualFalse() )
+ {
+ return( APExecutionData::REF_NULL );
+ }
+ else
+ {
+ newED->setPathCondition( thePathCondition );
+ }
+ }
+
+
+ // fusion of PathTimedCondition
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( firstED.hasPathTimedCondition() )
+ << "firstED must have PathTimedCondition !!!"
+ << SEND_EXIT;
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( sndED.hasPathTimedCondition() )
+ << "sndED must have PathTimedCondition !!!"
+ << SEND_EXIT;
+
+ if( firstED.getPathTimedCondition() == sndED.getPathTimedCondition() )
+ {
+ newED->setPathTimedCondition( firstED.getPathTimedCondition() );
+ }
+ else
+ {
+ BF thePathTimedCondition = ExpressionSimplifier::simplif_and(
+ firstED.getPathTimedCondition(),
+ sndED.getPathTimedCondition());
+ if( thePathTimedCondition.isEqualFalse() )
+ {
+ return( APExecutionData::REF_NULL );
+ }
+ else
+ {
+ newED->setPathTimedCondition( thePathTimedCondition );
+ }
+ }
+
+
+ // ExecutionData::PARAM_MACHINE_RUNTIME_OFFSET === 0
+ if( not fusion((* newED), refED.getParametersRuntimeForm(),
+ firstED.getParametersRuntimeForm(), sndED.getParametersRuntimeForm()) )
+ {
+ // AvmConcurrencyStatement Failed
+ return( APExecutionData::REF_NULL );
+ }
+
+ // ExecutionData::SYSTEM_RUNTIME_OFFSET === 1
+ avm_size_t offset = ExecutionData::SYSTEM_RUNTIME_OFFSET;
+ for( ; offset < refMachineCount ; ++offset )
+ {
+ // fusion of Process Eval State
+ newED->setRuntimeFormState( offset,
+ RuntimeDef::syncPES(
+ refED.getRuntimeFormState(offset),
+ firstED.getRuntimeFormState(offset),
+ sndED.getRuntimeFormState(offset) ) );
+
+ if( newED->isUndefinedPES(offset) )
+ {
+ AVM_OS_ERROR_ALERT << "ExecutionData:> "
+ "Fusion of Runtime State FAILED : "
+ "(ref != first) && (ref != snd) && (first != snd)"
+ "\n\tExecutionData Control Configuration:>"
+ << "\n\t$0: " << refED.strStateConf()
+ << "\n\t$1: " << firstED.strStateConf()
+ << "\n\t$2: " << sndED.strStateConf()
+
+ << "\n\tFiring Code:>"
+ << "\n\t$1: " << refED.getRunnableElementTrace().str()
+ << "\n\t$1: " << firstED.getRunnableElementTrace().str()
+ << "\n\t$2: " << sndED.getRunnableElementTrace().str()
+
+ << "\n\tTrace Code:>"
+ << "\n\t$0: " << refED.getIOElementTrace().str()
+ << "\n\t$1: " << firstED.getIOElementTrace().str()
+ << "\n\t$2: " << sndED.getIOElementTrace().str()
+
+ << "\n\tMachine Status:> " << refED.getRuntime(offset).str()
+ << "\n\tMachine Control Configuration:>"
+ << "\n\t$0: " << refED.strStateConf(refED.getRuntime(offset))
+ << "\n\t$1: " << firstED.strStateConf(firstED.getRuntime(offset))
+ << "\n\t$2: " << sndED.strStateConf(sndED.getRuntime(offset))
+
+ << "\n\t$0 = " << RuntimeDef::strPES(refED.getRuntimeFormState(offset))
+ << "\n\t$1 = " << RuntimeDef::strPES(firstED.getRuntimeFormState(offset))
+ << "\n\t$2 = " << RuntimeDef::strPES(sndED.getRuntimeFormState(offset))
+ << SEND_ALERT;
+
+ return( APExecutionData::REF_NULL );
+ }
+
+// // Propagate synchronized EVAL STATE form childs to parent
+// if( firstED.isFinalizedOrDestroyed(offset) ||
+// sndED.isFinalizedOrDestroyed(offset) )
+// {
+// RuntimeID aRID = newED->getRuntimeID(offset);
+// RuntimeForm * aRF = NULL;
+// while( aRID.hasPRID() && aRID.getPRID().hasKindAND() )
+// {
+// aRF = newED->getRuntimeForm( aRID = aRID.getPRID() );
+//
+// // TODO:> Child may not be synchronized ==> defined
+// TableOfRuntimeID::const_iterator it = aRF.beginChild();
+// TableOfRuntimeID::const_iterator endIt = aRF.endChild();
+// for( ; it != endIt ; ++it )
+// {
+// if( not newED->isFinalizedOrDestroyed(*it) )
+// {
+// break;
+// }
+// }
+//
+// if( it == endIt )
+// {
+// newED->setRuntimeFormState( aRID,
+// (firstED.isFinalized(offset) ||
+// sndED.isFinalized(offset)) ?
+// PROCESS_FINALIZED_STATE :
+// PROCESS_DESTROYED_STATE );
+// }
+// else
+// {
+// break;
+// }
+// }
+//
+// if( newED->isunRunnableSystem() )
+// {
+// newED->setAEES(AEES_STMNT_EXIT);
+// }
+// }
+
+ // fusion of Assign State
+ newED->getRuntimeFormStateTable()->setAssignedUnion(offset,
+ firstED.getAssigned(offset), sndED.getAssigned(offset));
+
+ // fusion of RuntimeForm
+ if( not fusion((* newED), refED.getRuntime(offset),
+ firstED.getRuntime(offset), sndED.getRuntime(offset)) )
+ {
+ // AvmConcurrencyStatement Failed
+ return( APExecutionData::REF_NULL );
+ }
+ }
+
+
+ if( refMachineCount != syncMachineCount )
+ {
+ // for new RuntimeForm since refED
+ const ExecutionData & maxED =
+ ( firstED.getTableOfRuntime().size() == syncMachineCount )
+ ? firstED : sndED;
+
+ if( firstED.getTableOfRuntime().size() == syncMachineCount )
+ {
+ if( sndED.getTableOfRuntime().size() != refMachineCount )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "sndED must have refMachineCount Machine !!!"
+ << SEND_EXIT;
+ }
+ }
+ else// if( sndED.getTableOfRuntime().size() == syncMachineCount )
+ {
+ if( firstED.getTableOfRuntime().size() != refMachineCount )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "firstED must have refMachineCount Machine !!!"
+ << SEND_EXIT;
+ }
+ }
+
+ for( ; offset < syncMachineCount ; ++offset )
+ {
+ // fusion of Process Eval State
+ newED->setRuntimeFormState(offset,
+ maxED.getRuntimeFormState(offset));
+
+ // fusion of Assign State
+ newED->getRuntimeFormStateTable()->
+ setAssigned(offset, maxED.getAssigned(offset));
+
+ // fusion of RuntimeForm
+ newED->assignRuntimeForm(offset,
+ const_cast< RuntimeForm * >( maxED.ptrRuntime(offset) ) );
+
+// // Propagate synchronized EVAL STATE form childs to parent
+// if( maxED.isFinalizedOrDestroyed(offset) )
+// {
+// RuntimeID aRID = newED->getRuntimeID(offset);
+// while( aRID.hasPRID() && aRID.getPRID().hasKindAND() )
+// {
+// const RuntimeForm & aRF =
+// newED->getRuntime( aRID = aRID.getPRID() );
+//
+// // TODO:> Child may not be synchronized / defined
+// TableOfRuntimeID::const_iterator it = aRF.beginChild();
+// TableOfRuntimeID::const_iterator endIt = aRF.endChild();
+// for( ; it != endIt ; ++it )
+// {
+// if( not newED->isFinalizedOrDestroyed(*it) )
+// {
+// break;
+// }
+// }
+//
+// if( it == endIt )
+// {
+// newED->setRuntimeFormState(aRID,
+// (firstED.isFinalized(offset) ||
+// sndED.isFinalized(offset)) ?
+// PROCESS_FINALIZED_STATE :
+// PROCESS_DESTROYED_STATE);
+// }
+// else
+// {
+// break;
+// }
+// }
+//
+// if( newED->isunRunnableSystem() )
+// {
+// newED->setAEES(AEES_STMNT_EXIT);
+// }
+// }
+ }
+ }
+
+
+ return( newED );
+}
+
+
+bool AvmSynchronizationFactory::fusion(const ExecutionData & newED,
+ const ParametersRuntimeForm & refParamsRF,
+ const ParametersRuntimeForm & firstParamsRF,
+ const ParametersRuntimeForm & sndParamsRF)
+{
+ if( ((& firstParamsRF) == (& sndParamsRF))
+ || ((& refParamsRF) == (& sndParamsRF)) )
+ {
+ newED.assignParametersRuntimeForm(
+ const_cast< ParametersRuntimeForm * >( & firstParamsRF ) );
+
+ return( true );
+ }
+ else if( (& refParamsRF) == (& firstParamsRF) )
+ {
+ newED.assignParametersRuntimeForm(
+ const_cast< ParametersRuntimeForm * >( & sndParamsRF ) );
+
+ return( true );
+ }
+ else
+ {
+ avm_size_t refParamsCount = refParamsRF.getParametersSize();
+
+ ParametersRuntimeForm * newParamsRF =
+ new ParametersRuntimeForm(refParamsRF.getRID(), refParamsCount);
+
+ newED.saveParametersRuntimeForm( newParamsRF );
+
+ avm_size_t offset = 0;
+ for( ; offset < refParamsCount ; ++offset )
+ {
+ // fusion of DATA
+ if( refParamsRF.rawParameter(offset)->getModifier().hasFeatureTransient() )
+ {
+ newParamsRF->setParameter(offset,
+ refParamsRF.getParameter(offset),
+ refParamsRF.getData(offset) );
+ }
+
+ else if( refParamsRF.getData(offset) == firstParamsRF.getData(offset) )
+ {
+ newParamsRF->setParameter(offset,
+ refParamsRF.getParameter(offset),
+ sndParamsRF.getData(offset) );
+ }
+ else if( refParamsRF.getData(offset) == sndParamsRF.getData(offset) )
+ {
+ newParamsRF->setParameter(offset,
+ refParamsRF.getParameter(offset),
+ firstParamsRF.getData(offset) );
+ }
+ // TODO Equality between Element
+ else if( firstParamsRF.getData(offset) == sndParamsRF.getData(offset) )
+ {
+ newParamsRF->setParameter(offset,
+ refParamsRF.getParameter(offset),
+ firstParamsRF.getData(offset) );
+ }
+ else if( //refParamsRF.getParameter(offset)->isTypedArrayOrStructure() &&
+ refParamsRF.getData(offset).is< ArrayBF >() &&
+ firstParamsRF.getData(offset).is< ArrayBF >() &&
+ sndParamsRF.getData(offset).is< ArrayBF >() )
+ {
+ BF syncValue = fusionArrayData(refParamsRF,
+ refParamsRF.getData(offset).to_ptr< ArrayBF >(),
+ firstParamsRF.getData(offset).to_ptr< ArrayBF >(),
+ sndParamsRF.getData(offset).to_ptr< ArrayBF >() );
+
+ if( syncValue.valid() )
+ {
+ newParamsRF->setParameter(offset,
+ refParamsRF.getParameter(offset), syncValue );
+ }
+ else
+ {
+ // AvmConcurrencyStatement Failed
+ AVM_OS_ERROR_ALERT
+ << "Runtime< " << refParamsRF.getRID().str()
+ << "> :> fusion of Data Table ARRAY Element FAILED "
+ ": (itFirstData != itSndData) :"
+ << "\n\t$0 = " << refParamsRF.getData(offset).str()
+ << "\n\t$1 = " << firstParamsRF.getData(offset).str()
+ << "\n\t$2 = " << sndParamsRF.getData(offset).str()
+ << SEND_ALERT;
+
+ return( false );
+ }
+ }
+ else if( refParamsRF.rawParameter(offset)->
+ getTypeSpecifier()->hasTypeComposite() )
+ {
+ // AvmConcurrencyStatement Failed
+ AVM_OS_WARNING_ALERT
+ << "Runtime< " << refParamsRF.getRID().str()
+ << "> :> fusion of Data Table ARRAY Element FAILED : "
+ "(itFirstData<array> != itSndData<array>) :"
+ << "\n\t$0 = " << refParamsRF.getData(offset).str()
+ << "\n\t$1 = " << firstParamsRF.getData(offset).str()
+ << "\n\t$2 = " << sndParamsRF.getData(offset).str()
+ << SEND_ALERT;
+
+ return( false );
+ }
+ else
+ {
+ // AvmConcurrencyStatement Failed
+ AVM_OS_ERROR_ALERT
+ << "Runtime< " << refParamsRF.getRID().str()
+ << "> :> fusion of Data Table Element FAILED : "
+ "(itFirstData != itSndData) :"
+ << "\n\t$0 = " << refParamsRF.getData(offset).str()
+ << "\n\t$1 = " << firstParamsRF.getData(offset).str()
+ << "\n\t$2 = " << sndParamsRF.getData(offset).str()
+ << SEND_ALERT;
+
+ return( false );
+ }
+ }
+
+ for( offset = refParamsCount ;
+ offset < firstParamsRF.getParametersSize() ; ++offset )
+ {
+ newParamsRF->appendParameter( firstParamsRF.getParameter(offset),
+ firstParamsRF.getData(offset) );
+ }
+
+ for( offset = refParamsCount ;
+ offset < sndParamsRF.getParametersSize() ; ++offset )
+ {
+ newParamsRF->appendParameter( sndParamsRF.getParameter(offset),
+ sndParamsRF.getData(offset) );
+ }
+ }
+
+ return( true );
+}
+
+
+bool AvmSynchronizationFactory::fusion(
+ const ExecutionData & newED, const RuntimeForm & refRF,
+ const RuntimeForm & firstRF, const RuntimeForm & sndRF)
+{
+ if( ((& firstRF) == (& sndRF)) || ((& refRF) == (& sndRF)) )
+ {
+ newED.assignRuntimeForm( firstRF.getOffset() ,
+ const_cast< RuntimeForm* >(& firstRF) );
+
+ return( true );
+ }
+ else if( &refRF == &firstRF )
+ {
+ newED.assignRuntimeForm( firstRF.getOffset() ,
+ const_cast< RuntimeForm* >(& sndRF) );
+
+ return( true );
+ }
+
+ // new synchronized RuntimeForm
+ RuntimeForm * newRF = new RuntimeForm( refRF.getRID() );
+
+ newED.saveRuntimeForm( newRF->getOffset() , newRF );
+
+ // fusion of InstanciationCount
+ if( refRF.getInstanciationCount() == firstRF.getInstanciationCount() )
+ {
+ newRF->setInstanciationCount( sndRF.getInstanciationCount() );
+ }
+ else if( refRF.getInstanciationCount() == sndRF.getInstanciationCount() )
+ {
+ newRF->setInstanciationCount( firstRF.getInstanciationCount() );
+ }
+ else if( firstRF.getInstanciationCount() != sndRF.getInstanciationCount() )
+ {
+ newRF->setInstanciationCount(
+ std::max(firstRF.getInstanciationCount(),
+ sndRF.getInstanciationCount() ) );
+ }
+
+ // fusion of ChildTable
+ if( refRF.getChildTable() == firstRF.getChildTable() )
+ {
+ newRF->setChildTable( sndRF.getChildTable() );
+ }
+ else if( refRF.getChildTable() == sndRF.getChildTable() )
+ {
+ newRF->setChildTable( firstRF.getChildTable() );
+ }
+ else if( firstRF.getChildTable() != sndRF.getChildTable() )
+ {
+ // TODO AvmConcurrencyStatement of Child Table
+ }
+ else
+ {
+ AVM_OS_ERROR_ALERT
+ << "Runtime< " << refRF.getRID().str()
+ << "> :> fusion of Child Table FAILED : "
+ "(ref != first) && (ref != snd) && (first = snd) :\n"
+ << refRF.getChildTable()->toString(AVM_TAB1_INDENT)
+ << firstRF.getChildTable()->toString(AVM_TAB1_INDENT)
+ << sndRF.getChildTable()->toString(AVM_TAB1_INDENT)
+ << SEND_ALERT;
+
+ return( false );
+ }
+
+ // fusion of DATA
+ if( not fusion((*newRF), refRF.getDataTable(),
+ firstRF.getDataTable(), sndRF.getDataTable()) )
+ {
+ return( false );
+ }
+
+ // fusion of BUFFER
+ if( not fusion((*newRF), refRF.getBufferTable(), firstRF.getBufferTable(),
+ sndRF.getBufferTable()) )
+ {
+ return( false );
+ }
+
+ // fusion of ROUTER
+ if( not fusion((*newRF), refRF.getRouter(),
+ firstRF.getRouter(), sndRF.getRouter()) )
+ {
+ return( false );
+ }
+
+
+//!?! Code pour évolution future
+// // fusion of NodeCondition
+// AVM_OS_ASSERT_FATAL_ERROR_EXIT( firstRF.hasNodeCondition() )
+// << "firstRF must have NodeCondition !!!"
+// << SEND_EXIT;
+// AVM_OS_ASSERT_FATAL_ERROR_EXIT( sndRF.hasNodeCondition() )
+// << "sndRF must have NodeCondition !!!"
+// << SEND_EXIT;
+//
+// BF theNodeCondition = ExpressionSimplifier::simplif_and(
+// firstRF.getNodeCondition(),
+// sndRF.getNodeCondition());
+//
+// newRF->setNodeCondition( theNodeCondition );
+//
+//
+// // fusion of NodeTimedCondition
+// AVM_OS_ASSERT_FATAL_ERROR_EXIT( firstRF.hasNodeTimedCondition() )
+// << "firstRF must have NodeTimedCondition !!!"
+// << SEND_EXIT;
+// AVM_OS_ASSERT_FATAL_ERROR_EXIT( sndRF.hasNodeTimedCondition() )
+// << "sndRF must have NodeTimedCondition !!!"
+// << SEND_EXIT;
+//
+// BF theNodeTimedCondition = ExpressionSimplifier::simplif_and(
+// firstRF.getNodeTimedCondition(),
+// sndRF.getNodeTimedCondition());
+//
+// newRF->setNodeTimedCondition( theNodeTimedCondition );
+
+
+ // fusion of onSchedule
+ if( refRF.getOnSchedule() == firstRF.getOnSchedule() )
+ {
+ newRF->setOnSchedule( sndRF.getOnSchedule() );
+ }
+ else if( refRF.getOnSchedule() == sndRF.getOnSchedule() )
+ {
+ newRF->setOnSchedule( firstRF.getOnSchedule() );
+ }
+ else if( firstRF.getOnSchedule() == sndRF.getOnSchedule() )
+ {
+ newRF->setOnSchedule( firstRF.getOnSchedule() );
+ }
+// else if( firstRF.hasOnSchedule() && sndRF.hasOnSchedule() )
+// {
+//// newRF->setOnSchedule( buildScheduleForm(
+//// OperatorManager::OPERATOR_PARALLEL, refRF.getOnSchedule(),
+//// firstRF.getOnSchedule(), sndRF.getOnSchedule()) );
+//
+// AVM_OS_ERROR_ALERT
+// << "Runtime< " << refRF.getRID().str()
+// << "> :> fusion of routine OnSchedule FAILED :"
+// << "\n\t$0 = " << refRF.getOnSchedule().str()
+// << "\n\t$1 = " << firstRF.getOnSchedule().str()
+// << "\n\t$2 = " << sndRF.getOnSchedule().str()
+// << SEND_ALERT;
+//
+// return( false );
+// }
+ else
+ {
+ AVM_OS_ERROR_ALERT
+ << "Runtime< " << refRF.getRID().str()
+ << "> :> fusion of routine OnSchedule FAILED :"
+ << "\n\t$0 = " << refRF.getOnSchedule().str()
+ << "\n\t$1 = " << firstRF.getOnSchedule().str()
+ << "\n\t$2 = " << sndRF.getOnSchedule().str()
+ << SEND_ALERT;
+
+ return( false );
+ }
+
+
+ // fusion of onDefer
+ if( refRF.getOnDefer() == firstRF.getOnDefer() )
+ {
+ newRF->setOnDefer( sndRF.getOnDefer() );
+ }
+ else if( refRF.getOnDefer() == sndRF.getOnDefer() )
+ {
+ newRF->setOnDefer( firstRF.getOnDefer() );
+ }
+ else if( firstRF.getOnDefer() == sndRF.getOnDefer() )
+ {
+ newRF->setOnDefer( firstRF.getOnDefer() );
+ }
+// else if( firstRF.hasOnDefer() && sndRF.hasOnDefer() )
+// {
+//// newRF->setOnDefer( buildScheduleForm(
+//// OperatorManager::OPERATOR_PARALLEL, refRF.getOnDefer(),
+//// firstRF.getOnDefer(), sndRF.getOnDefer()) );
+//
+// AVM_OS_ERROR_ALERT
+// << "Runtime< " << refRF.getRID().str()
+// << "> :> fusion of routine OnDefer FAILED :"
+// << "\n\t$0 = " << refRF.getOnDefer().str()
+// << "\n\t$1 = " << firstRF.getOnDefer().str()
+// << "\n\t$2 = " << sndRF.getOnDefer().str()
+// << SEND_ALERT;
+//
+// return( false );
+// }
+ else
+ {
+ AVM_OS_ERROR_ALERT
+ << "Runtime< " << refRF.getRID().str()
+ << "> :> fusion of routine OnDefer FAILED :"
+ << "\n\t$0 = " << refRF.getOnDefer().str()
+ << "\n\t$1 = " << firstRF.getOnDefer().str()
+ << "\n\t$2 = " << sndRF.getOnDefer().str()
+ << SEND_ALERT;
+
+ return( false );
+ }
+
+
+//!?! Code pour évolution future
+// // fusion of RunnableElementTrace
+// if( firstRF.hasRunnableElementTrace()
+// && sndRF.hasRunnableElementTrace() )
+// {
+// if( firstRF.getRunnableElementTrace() ==
+// sndRF.getRunnableElementTrace() )
+// {
+// newRF.setRunnableElementTrace(
+// firstRF.getRunnableElementTrace() );
+// }
+// else
+// {
+// newRF->setRunnableElementTrace( buildRunnableElementTrace(
+// OperatorManager::OPERATOR_PARALLEL,
+// refRF.getRunnableElementTrace(),
+// firsRF.>getRunnableElementTrace(),
+// sndRF.getRunnableElementTrace() ) );
+// }
+// }
+// else if( firstRF.hasRunnableElementTrace() )
+// {
+// newRF->setRunnableElementTrace( firstRF.getRunnableElementTrace() );
+// }
+// else if( sndRF.hasRunnableElementTrace() )
+// {
+// newRF->setRunnableElementTrace( sndRF.getRunnableElementTrace() );
+// }
+
+
+ return( true );
+}
+
+
+
+bool AvmSynchronizationFactory::fusion(RuntimeForm & aRF,
+ const APTableOfData & refDataTable,
+ const APTableOfData & firstDataTable,
+ const APTableOfData & sndDataTable)
+{
+ // fusion of DATA
+ if( firstDataTable.valid() && sndDataTable.valid() )
+ {
+ if( firstDataTable == sndDataTable )
+ {
+ aRF.setDataTable( firstDataTable );
+ }
+ else if( refDataTable == firstDataTable )
+ {
+ aRF.setDataTable( sndDataTable );
+ }
+ else if( refDataTable == sndDataTable )
+ {
+ aRF.setDataTable( firstDataTable );
+ }
+ else if( (refDataTable->size() == firstDataTable->size()) &&
+ (refDataTable->size() == sndDataTable->size()) )
+ {
+ // Comparison between all data
+ TableOfData * aDataTable = new TableOfData( refDataTable->size() );
+ aRF.setDataTable( aDataTable );
+
+ TableOfData::iterator itRef = refDataTable->begin();
+ TableOfData::iterator itRefEnd = refDataTable->end();
+ TableOfData::iterator itFirst = firstDataTable->begin();
+ TableOfData::iterator itSnd = sndDataTable->begin();
+
+ avm_size_t offset = 0;
+ for( ; itRef != itRefEnd ; ++itRef , ++itFirst, ++itSnd, ++offset )
+ {
+// AVM_OS_COUT << str_header( aRF.rawVariable(offset) ) << std::endl
+// << "ref:" << (*itRef).str(" ") << std::endl
+// << "fst:" << (*itFirst).str(" ") << std::endl
+// << "snd:" << (*itSnd).str(" ") << std::endl << std::endl;
+
+ if( (*itRef) == (*itFirst) )
+ {
+ aDataTable->set( offset , (*itSnd) );
+ }
+ else if( (*itRef) == (*itSnd) )
+ {
+ aDataTable->set( offset , (*itFirst) );
+ }
+ else if( (*itFirst) == (*itSnd) ) // TODO Equality between Element
+ {
+ aDataTable->set( offset , (*itFirst) );
+ }
+ else if( //aRF.getVariable(offset)->isTypedArrayOrStructure() &&
+ (*itRef).is< ArrayBF >() &&
+ (*itFirst).is< ArrayBF >() &&
+ (*itSnd).is< ArrayBF >() )
+ {
+ BF syncValue = fusionArrayData(aRF,
+ (*itRef).to_ptr< ArrayBF >(),
+ (*itFirst).to_ptr< ArrayBF >(),
+ (*itSnd).to_ptr< ArrayBF >() );
+
+ if( syncValue.valid() )
+ {
+ aDataTable->set( offset , syncValue );
+ }
+ else
+ {
+ // AvmConcurrencyStatement Failed
+ AVM_OS_ERROR_ALERT
+ << "Runtime< " << aRF.getRID().str()
+ << "> :> fusion of Data Table ARRAY Element "
+ "FAILED : (itFirstData != itSndData) :"
+ << "\n\t" << str_header( aRF.rawVariable(offset) )
+ << "\n\t$0 = " << (*itRef).str()
+ << "\n\t$1 = " << (*itFirst).str()
+ << "\n\t$2 = " << (*itSnd).str()
+ << SEND_ALERT;
+
+ return( false );
+ }
+ }
+ else if( aRF.rawVariable(offset)->
+ getTypeSpecifier()->hasTypeComposite() )
+ {
+ // AvmConcurrencyStatement Failed
+ AVM_OS_WARNING_ALERT
+ << "Runtime< " << aRF.getRID().str()
+ << "> :> fusion of Data Table ARRAY Element FAILED "
+ ": (itFirstData<array> != itSndData<array>) :"
+ << "\n\t" << str_header( aRF.rawVariable(offset) )
+ << "\n\t$0 = " << (*itRef).str()
+ << "\n\t$1 = " << (*itFirst).str()
+ << "\n\t$2 = " << (*itSnd).str()
+ << SEND_ALERT;
+
+ return( false );
+ }
+ else
+ {
+ // AvmConcurrencyStatement Failed
+ AVM_OS_ERROR_ALERT
+ << "Runtime< " << aRF.getRID().str()
+ << "> :> fusion of Data Table Element FAILED : "
+ "(itFirstData != itSndData) :"
+ << "\n\t" << str_header( aRF.rawVariable(offset) )
+ << "\n\t$0 = " << (*itRef).str()
+ << "\n\t$1 = " << (*itFirst).str()
+ << "\n\t$2 = " << (*itSnd).str()
+ << SEND_ALERT;
+
+ return( false );
+ }
+
+// if( (*itRef).is< BuiltinQueue >() )
+// {
+// AVM_OS_TRACE
+// << "Runtime< " << aRF.getRID().str()
+// << " , " << str_header( aRF.getVariable(offset) )
+// << " > :> " << std::endl
+// << "\n\t$0 = " << (*itRef).str()
+// << "\n\t$1 = " << (*itFirst).str()
+// << "\n\t$2 = " << (*itSnd).str()
+// << "\n\t$$ = " << aDataTable->at(offset).str()
+// << std::endl;
+// }
+ }
+ }
+ else
+ {
+ // AvmConcurrencyStatement Failed
+ AVM_OS_ERROR_ALERT
+ << "Runtime< " << aRF.getRID().str()
+ << "> :> fusion of Data Table Size FAILED : "
+ "((refDataTable->size() == firstDataTable->size()) && "
+ "(refDataTable->size() == sndDataTable->size())) :\n"
+ << refDataTable->toString(aRF.getVariables(), AVM_TAB1_INDENT)
+ << firstDataTable->toString(aRF.getVariables(), AVM_TAB1_INDENT)
+ << sndDataTable->toString(aRF.getVariables(), AVM_TAB1_INDENT)
+ << SEND_ALERT;
+
+ return( false );
+ }
+ }
+ else if( refDataTable.valid() )
+ {
+ // AvmConcurrencyStatement Failed
+ AVM_OS_ERROR_ALERT
+ << "Runtime< " << aRF.getRID().str()
+ << "> :> fusion of Data Table FAILED : (refDataTable != NULL) "
+ "&& ((firstDataTable == NULL) || (sndDataTable == NULL)) :\n"
+ << refDataTable->toString(aRF.getVariables(), AVM_TAB1_INDENT)
+ << firstDataTable->toString(aRF.getVariables(), AVM_TAB1_INDENT)
+ << sndDataTable->toString(aRF.getVariables(), AVM_TAB1_INDENT)
+ << SEND_ALERT;
+
+
+ return( false );
+ }
+
+ return( true );
+}
+
+
+BF AvmSynchronizationFactory::fusionArrayData(const RuntimeForm & aRF,
+ ArrayBF * refArray, ArrayBF * firstArray, ArrayBF * sndArray)
+{
+ ArrayBF * syncArray =
+ new ArrayBF(refArray->getTypeSpecifier(), refArray->size());
+ BF bfArray( syncArray );
+
+ for( avm_size_t offset = 0 ; offset < syncArray->size() ; ++offset )
+ {
+ //??? TABLEAUX
+ if( refArray->at(offset) == firstArray->at(offset) )
+ {
+ syncArray->set( offset , sndArray->at(offset) );
+ }
+ else if( refArray->at(offset) == sndArray->at(offset) )
+ {
+ syncArray->set( offset , firstArray->at(offset) );
+ }
+ // TODO Equality between Element
+ else if( firstArray->at(offset) == sndArray->at(offset) )
+ {
+ syncArray->set( offset , firstArray->at(offset) );
+ }
+ else if( refArray->at(offset).is< ArrayBF >() &&
+ firstArray->at(offset).is< ArrayBF >() &&
+ sndArray->at(offset).is< ArrayBF >() )
+ {
+ BF syncValue = fusionArrayData(aRF,
+ refArray->at(offset).to_ptr< ArrayBF >(),
+ firstArray->at(offset).to_ptr< ArrayBF >(),
+ sndArray->at(offset).to_ptr< ArrayBF >() );
+
+ if( syncValue.valid() )
+ {
+ syncArray->set( offset , syncValue );
+ }
+ else
+ {
+ // AvmConcurrencyStatement Failed
+ AVM_OS_ERROR_ALERT
+ << "Runtime< " << aRF.getRID().str()
+ << "> :> fusion of Data Table ARRAY Element FAILED : "
+ "(itFirstData[...] != itSndData[...]) :"
+ << "\n\t$0 = " << refArray->at(offset).str()
+ << "\n\t$1 = " << firstArray->at(offset).str()
+ << "\n\t$2 = " << sndArray->at(offset).str()
+ << SEND_ALERT;
+
+ return( BF::REF_NULL );
+ }
+ }
+// else if( aRF.getVariable(i)->
+// getTypeSpecifier()->isTypedComposite() )
+// {
+// // AvmConcurrencyStatement Failed
+// AVM_OS_WARNING_ALERT
+// << "Runtime< " << aRF.getRID().str()
+// << "> :> fusion of Data Table Element FAILED : "
+// "(itFirstData[...] != itSndData[...]) :"
+// << "\n\t$0 = " << refArray->at(offset).str()
+// << "\n\t$1 = " << firstArray->at(offset).str()
+// << "\n\t$2 = " << sndArray->at(offset).str()
+// << SEND_ALERT;
+//
+// return( BF::REF_NULL );
+// }
+ else
+ {
+ // AvmConcurrencyStatement Failed
+ AVM_OS_ERROR_ALERT
+ << "Runtime< " << aRF.getRID().str()
+ << "> :> fusion of Data Table Element FAILED : "
+ "(itFirstData[...] != itSndData[...]) :"
+ << "\n\t$0 = " << refArray->at(offset).str()
+ << "\n\t$1 = " << firstArray->at(offset).str()
+ << "\n\t$2 = " << sndArray->at(offset).str()
+ << SEND_ALERT;
+
+ return( BF::REF_NULL );
+ }
+ }
+
+ return( bfArray );
+}
+
+
+bool AvmSynchronizationFactory::fusion(RuntimeForm & aRF,
+ const TableOfBufferT & refBufferTable,
+ const TableOfBufferT & firstBufferTable,
+ const TableOfBufferT & sndBufferTable)
+{
+ // fusion of BUFFER
+ if( firstBufferTable.valid() && sndBufferTable.valid() )
+ {
+ if( firstBufferTable == sndBufferTable )
+ {
+ aRF.setBufferTable( firstBufferTable );
+ }
+ else if( refBufferTable == firstBufferTable )
+ {
+ aRF.setBufferTable( sndBufferTable );
+ }
+ else if( refBufferTable == sndBufferTable )
+ {
+ aRF.setBufferTable( firstBufferTable );
+ }
+ else if( (refBufferTable.size() == firstBufferTable.size()) &&
+ (refBufferTable.size() == sndBufferTable.size()) )
+ {
+ // Comparison between all data
+ TableOfBufferT aBufferTable( refBufferTable.size() );
+
+ TableOfBufferT::const_iterator itRef = refBufferTable.begin();
+ TableOfBufferT::const_iterator itRefEnd = refBufferTable.end();
+ TableOfBufferT::const_iterator itFirst = firstBufferTable.begin();
+ TableOfBufferT::const_iterator itSnd = sndBufferTable.begin();
+
+ avm_size_t offset = 0;
+ for( ; itRef != itRefEnd ; ++itRef , ++itFirst, ++itSnd, ++offset )
+ {
+ if( (*itRef)->equals( *(*itFirst) ) )
+ {
+ aBufferTable.assign( offset , (*itSnd) );
+ }
+ else if( (*itRef)->equals( *(*itSnd) ) )
+ {
+ aBufferTable.assign( offset , (*itFirst) );
+ }
+ else if( (*itFirst)->equals( *(*itSnd) ) ) // TODO Equality between Buffer
+ {
+ aBufferTable.assign( offset , (*itFirst) );
+ }
+ else
+ {
+ // AvmConcurrencyStatement Failed
+ AVM_OS_ERROR_ALERT
+ << "Runtime< " << aRF.getRID().str()
+ << "> :> fusion of Buffer Table Element FAILED : "
+ "(itFirstBuffer != itSndBuffer) :\n"
+ << (*itRef)->toString(AVM_TAB1_INDENT)
+ << (*itFirst)->toString(AVM_TAB1_INDENT)
+ << (*itSnd)->toString(AVM_TAB1_INDENT)
+ << SEND_ALERT;
+
+ return( false );
+ }
+ }
+ aRF.setBufferTable( aBufferTable );
+ }
+ else
+ {
+ // AvmConcurrencyStatement Failed
+ AVM_OS_ERROR_ALERT
+ << "Runtime< " << aRF.getRID().str()
+ << "> :> fusion of Buffer Table Size FAILED : "
+ "((refBufferTable->size() == firstBufferTable->size()) && "
+ "(refBufferTable->size() == sndBufferTable->size())) :\n"
+ << refBufferTable.toString(AVM_TAB1_INDENT)
+ << firstBufferTable.toString(AVM_TAB1_INDENT)
+ << sndBufferTable.toString(AVM_TAB1_INDENT)
+ << SEND_ALERT;
+
+ return( false );
+ }
+ }
+ else if( refBufferTable.valid() )
+ {
+ // AvmConcurrencyStatement Failed
+ AVM_OS_ERROR_ALERT
+ << "Runtime< " << aRF.getRID().str()
+ << "> :> fusion of Buffer Table FAILED : (refBufferTable != NULL) "
+ "&& ((firstBufferTable == NULL) || (sndBufferTable == NULL)) :\n"
+ << refBufferTable.toString(AVM_TAB1_INDENT)
+ << firstBufferTable.toString(AVM_TAB1_INDENT)
+ << sndBufferTable.toString(AVM_TAB1_INDENT)
+ << SEND_ALERT;
+
+ return( false );
+ }
+
+ return( true );
+}
+
+
+// TODO fusion ROUTER
+bool AvmSynchronizationFactory::fusion(RuntimeForm & aRF,
+ const Router & refRouter,
+ const Router & firstRouter,
+ const Router & sndRouter)
+{
+ // fusion of BUFFER
+ if( firstRouter.valid() && sndRouter.valid() )
+ {
+ if( firstRouter == sndRouter )
+ {
+ aRF.setRouter( firstRouter );
+ }
+ else if( refRouter == firstRouter )
+ {
+ aRF.setRouter( sndRouter );
+ }
+ else if( refRouter == sndRouter )
+ {
+ aRF.setRouter( firstRouter );
+ }
+ else
+ {
+ aRF.setRouter( refRouter );
+ }
+ }
+ else if( refRouter.valid() )
+ {
+ // AvmConcurrencyStatement Failed
+ AVM_OS_ERROR_ALERT
+ << "Runtime< " << aRF.getRID().str()
+ << "> :> fusion of Router FAILED : (refRouter != NULL) && "
+ "((firstRouter == NULL) || (sndRouter == NULL)) :\n"
+ << refRouter.toString(AVM_TAB1_INDENT)
+ << firstRouter.toString(AVM_TAB1_INDENT)
+ << sndRouter.toString(AVM_TAB1_INDENT)
+ << SEND_ALERT;
+
+ return( false );
+ }
+
+ return( true );
+}
+
+
+
+
+
+
+BF AvmSynchronizationFactory::syncBF(Operator * buildOp,
+ const BF & refBF, const BF & frstBF, const BF & sndBF)
+{
+ if( refBF.invalid() )
+ {
+ BFCode buildCode(buildOp, frstBF, sndBF);
+
+ return( AvmCodeFactory::flattenCode( buildCode ) );
+ }
+ else if( frstBF.isTEQ(sndBF) || refBF.isTEQ(sndBF) )
+ {
+ return( frstBF );
+ }
+
+ if( refBF.isTEQ(frstBF) )
+ {
+ return( sndBF );
+ }
+
+ else if( frstBF.is< AvmCode >() && sndBF.is< AvmCode >() &&
+ (frstBF.to_ptr< AvmCode >()->getOperator() ==
+ sndBF.to_ptr< AvmCode >()->getOperator()) )
+ {
+ AvmCode * frstCode = frstBF.to_ptr< AvmCode >();
+ AvmCode * sndCode = sndBF.to_ptr< AvmCode >();
+
+ avm_size_t frstSize = frstCode->size();
+ avm_size_t sndSize = sndCode->size();
+
+
+ if( refBF.valid() && refBF.isEQ(frstCode->first()) &&
+ refBF.isEQ(sndCode->first()) )
+ {
+ BFCode newCode(buildOp);
+ BFCode buildCode(frstCode->getOperator(), refBF, newCode);
+
+ if( frstSize == 2 )
+ {
+ newCode->append( frstCode->second() );
+ }
+ else if( frstSize > 2 )
+ {
+ BFCode restCode(frstCode->getOperator());
+
+ for( avm_size_t offset = 1 ; offset < frstSize ; ++offset )
+ {
+ restCode->append( frstCode->at(offset) );
+ }
+
+ newCode->append( restCode );
+ }
+
+ if( sndSize == 2 )
+ {
+ newCode->append( sndCode->second() );
+ }
+ else if( sndSize > 2 )
+ {
+ BFCode restCode(sndCode->getOperator());
+
+ for( avm_size_t offset = 1 ; offset < sndSize ; ++offset )
+ {
+ restCode->append( sndCode->at(offset) );
+ }
+
+ newCode->append( restCode );
+ }
+
+//AVM_OS_DEBUG << "sync:> " << AvmCodeFactory::flattenCode( buildCode ).str(" ")
+// << std::endl;
+
+ return( AvmCodeFactory::flattenCode( buildCode ) );
+ }
+ else if( refBF.is< AvmCode >() )
+ {
+ const BFCode & refCode = refBF.bfCode();
+
+ if( refCode->getOperator() == sndCode->getOperator() )
+ {
+ avm_size_t refSize = refCode->size();
+
+ BFCode buildCode( refCode->getOperator() );
+
+ avm_size_t k = 0;
+ for( ; (k < refSize) && (k < frstSize) && (k < sndSize) ; ++k )
+ {
+ if( frstCode->at(k).isEQ(sndCode->at(k)) &&
+ refCode->at(k).isEQ(sndCode->at(k)))
+ {
+ buildCode->append( refCode->at(k) );
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ BFCode newCode(buildOp);
+ buildCode.append( newCode );
+
+ if( frstSize == (k + 1) )
+ {
+ newCode->append( frstCode->last() );
+ }
+ else if( frstSize != k )
+ {
+ BFCode restCode(frstCode->getOperator());
+
+ for( avm_size_t idx = k ; idx < frstSize ; ++idx )
+ {
+ restCode->append( frstCode->at(idx) );
+ }
+
+ newCode->append( restCode );
+ }
+
+ if( sndSize == (k + 1) )
+ {
+ newCode->append( sndCode->last() );
+ }
+ else if( sndSize != k )
+ {
+ BFCode restCode(sndCode->getOperator());
+
+ for( avm_size_t idx = k ; idx < sndSize ; ++idx )
+ {
+ restCode->append( sndCode->at(idx) );
+ }
+
+ newCode->append( restCode );
+ }
+
+//AVM_OS_DEBUG << "sync:> " << AvmCodeFactory::flattenCode( buildCode ).str(" ")
+// << std::endl;
+
+ return( AvmCodeFactory::flattenCode( buildCode ) );
+ }
+ }
+
+ if( frstCode->first().isEQ(sndCode->first()) )
+ {
+ BFCode buildCode(frstCode->getOperator(),
+ frstCode->first());
+
+ avm_size_t k = 1;
+ for( ; (k < frstSize) && (k < sndSize) &&
+ frstCode->at(k).isEQ(sndCode->at(k)) ; ++k )
+ {
+ buildCode->append( frstCode->at(k) );
+ }
+
+ BFCode newCode(buildOp);
+ buildCode->append( newCode );
+
+ if( frstSize == (k + 1) )
+ {
+ newCode->append( frstCode->last() );
+ }
+ else if( frstSize != k )
+ {
+ BFCode restCode(frstCode->getOperator());
+
+ for( avm_size_t idx = k ; idx < frstSize ; ++idx )
+ {
+ restCode->append( frstCode->at(idx) );
+ }
+
+ newCode->append( restCode );
+ }
+
+ if( sndSize == (k + 1) )
+ {
+ newCode->append( sndCode->last() );
+ }
+ else if( sndSize != k )
+ {
+ BFCode restCode(sndCode->getOperator());
+
+ for( avm_size_t idx = k ; idx < sndSize ; ++idx )
+ {
+ restCode->append( sndCode->at(idx) );
+ }
+
+ newCode->append( restCode );
+ }
+
+ return( AvmCodeFactory::flattenCode( buildCode ) );
+ }
+ }
+
+ return( AvmCodeFactory::flattenCode( StatementConstructor::newCode(
+ buildOp, frstBF, sndBF) ) );
+}
+
+
+
+
+BF AvmSynchronizationFactory::buildRunnableElementTrace(
+ Operator * buildOp, const BF & refRunnableElementTrace,
+ const BF & frstRunnableElementTrace, const BF & sndRunnableElementTrace)
+{
+ return( syncBF(buildOp, refRunnableElementTrace,
+ frstRunnableElementTrace, sndRunnableElementTrace) );
+}
+
+BF AvmSynchronizationFactory::buildIOElementTrace(
+ Operator * buildOp, const BF & refIOElementTrace,
+ const BF & frstIOElementTrace, const BF & sndIOElementTrace)
+{
+ return( syncBF(buildOp, refIOElementTrace,
+ frstIOElementTrace, sndIOElementTrace) );
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/AvmSynchronizationFactory.h b/org.eclipse.efm.symbex/src/computer/primitive/AvmSynchronizationFactory.h
new file mode 100644
index 0000000..731261d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/AvmSynchronizationFactory.h
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 5 nov. 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMSYNCHRONIZATIONFACTORY_H_
+#define AVMSYNCHRONIZATIONFACTORY_H_
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeForm.h>
+#include <fml/runtime/TableOfData.h>
+
+
+namespace sep
+{
+
+class ArrayBF;
+class BF;
+class Router;
+
+class Operator;
+
+class RuntimeForm;
+
+
+class AvmSynchronizationFactory
+{
+
+private:
+ AvmSynchronizationFactory()
+ {
+ // NOTHING
+ }
+
+ virtual ~AvmSynchronizationFactory()
+ {
+ // NOTHING
+ }
+
+
+public:
+ /*
+ * FUSION
+ * ExecutionData -- RuntimeForm
+ */
+ static APExecutionData fusion(const ExecutionData & aRefED,
+ const ExecutionData & firstED, const ExecutionData & sndED);
+
+ inline static APExecutionData fusion(const APExecutionData & aRefED,
+ const APExecutionData & firstED, const APExecutionData & sndED)
+ {
+ return( fusion( (* aRefED) , (* firstED) , (* sndED) ) );
+ }
+
+ static bool fusion(const ExecutionData & newED,
+ const ParametersRuntimeForm & refParamsRF,
+ const ParametersRuntimeForm & firstParamsRF,
+ const ParametersRuntimeForm & sndParamsRF);
+
+ static bool fusion(const ExecutionData & newED, const RuntimeForm & refRF,
+ const RuntimeForm & firstRF, const RuntimeForm & sndRF);
+
+ static bool fusion(RuntimeForm & aRF,
+ const APTableOfData & refDataTable,
+ const APTableOfData & firstDataTable,
+ const APTableOfData & sndDataTable);
+
+ static BF fusionArrayData(
+ const RuntimeForm & aRF, ArrayBF * refArray,
+ ArrayBF * firstArray, ArrayBF * sndArray);
+
+ static bool fusion(RuntimeForm & aRF,
+ const TableOfBufferT & refBufferTable,
+ const TableOfBufferT & firstBufferTable,
+ const TableOfBufferT & sndBufferTable);
+
+ static bool fusion(RuntimeForm & aRF, const Router & refRouter,
+ const Router & firstRouter, const Router & sndRouter);
+
+
+
+ static BF syncBF(Operator * buildOp, const BF & refBF,
+ const BF & frstBF, const BF & sndBF);
+
+ static BF buildScheduleForm(
+ Operator * buildOp, const BF & refScheduleForm,
+ const BF & frstScheduleForm, const BF & sndScheduleForm);
+
+ static BF buildRunnableElementTrace(Operator * buildOp,
+ const BF & refRunnableElementTrace,
+ const BF & frstRunnableElementTrace,
+ const BF & sndRunnableElementTrace);
+
+ static BF buildIOElementTrace(
+ Operator * buildOp, const BF & refIOElementTrace,
+ const BF & frstIOElementTrace, const BF & sndIOElementTrace);
+
+
+
+
+
+};
+
+}
+
+#endif /* AVMSYNCHRONIZATIONFACTORY_H_ */
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/BaseAvmPrimitive.cpp b/org.eclipse.efm.symbex/src/computer/primitive/BaseAvmPrimitive.cpp
new file mode 100644
index 0000000..1a688f4
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/BaseAvmPrimitive.cpp
@@ -0,0 +1,139 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "BaseAvmPrimitive.h"
+
+
+#include <computer/primitive/AvmPrimitiveProcessor.h>
+
+#include <computer/EvaluationEnvironment.h>
+#include <computer/ExecutionEnvironment.h>
+
+#include <fml/expression/ExpressionConstructor.h>
+
+
+
+namespace sep
+{
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// RESUME
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool BaseAvmPrimitive::resume(ExecutionEnvironment & ENV)
+{
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unimplemented resume instruction for :>\n"
+ << ENV.inFORM.toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// EVAL
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool BaseAvmPrimitive::seval(EvaluationEnvironment & ENV)
+{
+ BFCode regEXPR( ENV.inCODE->getOperator() );
+
+ AvmCode::const_iterator itArg = ENV.inCODE->begin();
+ AvmCode::const_iterator endArg = ENV.inCODE->end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ ENV.seval(*itArg);
+
+ regEXPR->append( ENV.outVAL );
+ }
+
+ ENV.outVAL = regEXPR;
+
+ return( true );
+}
+
+/*
+bool BaseAvmPrimitive::meval(EvaluationEnvironment & ENV)
+{
+ long idx = 0;
+ long endIdx = ENV.outEDS.size();
+ BFCodeVector regEXPR( endIdx );
+ for( idx = 0 ; idx < endIdx ; ++idx )
+ {
+ regEXPR[ idx ] = ExpressionConstructor::newCode(
+ ENV.inCODE->getOperator() );
+ }
+
+ AvmCode::const_iterator itArg = ENV.inCODE->begin();
+ AvmCode::const_iterator endArg = ENV.inCODE->end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ ENV.meval(*itArg);
+
+ if( (long)(ENV.outEDS.size()) > endIdx )
+ {
+ regEXPR.resize( ENV.outEDS.size() );
+ for( idx = ENV.outEDS.size() - 1 ; idx >= endIdx ; --idx )
+ {
+ regEXPR[ idx ] = regEXPR[ ENV.mOffsets[ idx ] ]->clone();
+
+ regEXPR[ idx ]->append( ENV.outCODES[ idx ] );
+ }
+
+ endIdx = ENV.outEDS.size();
+ }
+ else
+ {
+ idx = endIdx - 1;
+ }
+
+ for( ; idx >= 0 ; --idx )
+ {
+ regEXPR[ idx ]->append( ENV.outCODES[ idx ] );
+ }
+ }
+
+ for( idx = 0 ; idx < endIdx ; ++idx )
+ {
+ ENV.outCODES[ idx ] = regEXPR[ idx ];
+ }
+
+ return( true );
+}
+*/
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+///// EVAL x 2
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool BaseAvmPrimitive::sevalx2(EvaluationEnvironment & ENV)
+{
+ if( BaseAvmPrimitive::seval(ENV) )
+ {
+ return( ENV.seval(ENV.outVAL) );
+ }
+
+ return( false );
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/computer/primitive/BaseAvmPrimitive.h b/org.eclipse.efm.symbex/src/computer/primitive/BaseAvmPrimitive.h
new file mode 100644
index 0000000..b2223b8
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/computer/primitive/BaseAvmPrimitive.h
@@ -0,0 +1,179 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mai 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BASEAVMPRIMITIVE_H_
+#define BASEAVMPRIMITIVE_H_
+
+#include <common/AvmObject.h>
+
+#include <computer/instruction/InstructionEnvironment.h>
+
+
+namespace sep
+{
+
+
+class AvmCode;
+class AvmPrimitiveProcessor;
+
+class ExecutionData;
+class EvaluationEnvironment;
+class ExecutionEnvironment;
+
+
+
+class BaseAvmPrimitive : public AvmObject
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BaseAvmPrimitive(AvmPrimitiveProcessor & aProcessor)
+ : AvmObject( ),
+ PRIMITIVE_PROCESSOR( aProcessor )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BaseAvmPrimitive()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * the RUN statement
+ */
+
+ inline virtual bool run(ExecutionEnvironment & ENV)
+ {
+ //!! NOTHING
+
+ return( true );
+ }
+
+
+ /**
+ * the RESUME instruction
+ */
+ virtual bool resume(ExecutionEnvironment & ENV);
+
+
+ /**
+ * the EVAL instruction
+ */
+ virtual bool seval(EvaluationEnvironment & ENV);
+
+ /**
+ * the EVAL x 2 instruction
+ */
+ virtual bool sevalx2(EvaluationEnvironment & ENV);
+
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ AvmPrimitiveProcessor & PRIMITIVE_PROCESSOR;
+
+
+};
+
+
+
+
+/**
+ * Macro for smart primitive declaration.
+ */
+#define AVM_PRIMITIVE_CLASS_HEADER(classname, supername) \
+class classname : public supername \
+{ \
+public: \
+ classname(AvmPrimitiveProcessor & aProcessor) \
+ : supername( aProcessor ) \
+ { /*!! NOTHING !!*/ } \
+ virtual ~classname() \
+ { /*!! NOTHING !!*/ }
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// PRIMITIVE:> RUN
+////////////////////////////////////////////////////////////////////////////////
+
+#define AVM_PRIMITIVE_RUN_CLASS_HEADER(classname, supername) \
+AVM_PRIMITIVE_CLASS_HEADER(AvmPrimitive_##classname, supername) \
+ virtual bool run(ExecutionEnvironment & ENV);
+
+
+#define AVM_PRIMITIVE_RUN_CLASS(classname, supername) \
+AVM_PRIMITIVE_RUN_CLASS_HEADER(classname, supername) \
+};
+
+
+
+#define AVM_PRIMITIVE_RUN_RESUME_CLASS_HEADER(classname, supername) \
+AVM_PRIMITIVE_CLASS_HEADER(AvmPrimitive_##classname, supername) \
+ virtual bool run(ExecutionEnvironment & ENV); \
+ virtual bool resume(ExecutionEnvironment & ENV);
+
+
+#define AVM_PRIMITIVE_RUN_RESUME_CLASS(classname, supername) \
+AVM_PRIMITIVE_RUN_RESUME_CLASS_HEADER(classname, supername) \
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// PRIMITIVE:> SEVAL
+////////////////////////////////////////////////////////////////////////////////
+
+#define AVM_PRIMITIVE_EVAL_CLASS_HEADER(classname, supername) \
+AVM_PRIMITIVE_CLASS_HEADER(AvmPrimitive_##classname, supername) \
+ virtual bool seval(EvaluationEnvironment & ENV);
+
+
+#define AVM_PRIMITIVE_EVAL_CLASS(classname, supername) \
+AVM_PRIMITIVE_EVAL_CLASS_HEADER(classname, supername) \
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// PRIMITIVE:> RUN & SEVAL
+////////////////////////////////////////////////////////////////////////////////
+
+#define AVM_PRIMITIVE_RUN_EVAL_CLASS_HEADER(classname, supername) \
+AVM_PRIMITIVE_CLASS_HEADER(AvmPrimitive_##classname, supername) \
+ virtual bool run(ExecutionEnvironment & ENV); \
+ virtual bool seval(EvaluationEnvironment & ENV);
+
+
+#define AVM_PRIMITIVE_RUN_EVAL_CLASS(classname, supername) \
+AVM_PRIMITIVE_RUN_EVAL_CLASS_HEADER(classname, supername) \
+};
+
+
+
+
+}
+
+#endif /* BASEAVMPRIMITIVE_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/CMakeLists.txt b/org.eclipse.efm.symbex/src/fam/CMakeLists.txt
new file mode 100644
index 0000000..aaa200a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/CMakeLists.txt
@@ -0,0 +1,23 @@
+# =============================================================================
+# CMake file for the FAM library
+# =============================================================================
+
+# C++ source files to take into account (all files matching patterns, recursively)
+file (GLOB_RECURSE FAM_CXX_SRC_FILES *.cpp *.h)
+
+# Target to build
+add_library (fam STATIC ${FAM_CXX_SRC_FILES})
+
+# Include directories (internal)
+target_include_directories (fam PUBLIC ..)
+# TODO : the previous form is an "all-catch" : every header of the project can be accessed
+# It is required because sources use relative path to src in their #include
+# This probably should be refactored to make build dependencies explicit in the CMakeLists
+
+# Target include directories (external)
+target_include_directories (fam PUBLIC ${GMP_INCLUDE_DIR} ${GMPXX_INCLUDE_DIR})
+target_include_directories (fam PUBLIC ${Boost_INCLUDE_DIRS})
+target_include_directories (fam PUBLIC ${CVC4_INCLUDE_DIR})
+
+
+add_dependencies(fam rescan_cvc4)
diff --git a/org.eclipse.efm.symbex/src/fam/README.md b/org.eclipse.efm.symbex/src/fam/README.md
new file mode 100644
index 0000000..6292834
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/README.md
@@ -0,0 +1,133 @@
+# EFM-SYMBEX::FAM - Formal Analysis Module
+
+## Source code structure
+
+### Interfaces
+
+### Classes
+
+### Factories
+
+## org.eclipse.efm.sep.fam
+Module d'Analyse Formelle
+
+### Require
+
+### Import
+* **org.eclipse.efm.sep.common**
+* **org.eclipse.efm.sep.core**
+ + Smart-Pointer
+
+### Export
+
+#### IFAM: Interface of Formal Analysis Module
+C'est l'interface que doit implémenter tout Module d'Analyse Formelle.
+Il fournit des services pour intervenir dans les différentes phases du SEW, Symbolic Execution Workflow, à savoir:
+
+* **configure**, MANDATORY
+ + Définit (et vérifie?) dans quelle phase du *SE-Workflow* il va intervenir
+ + Prise en compte la configuration fournit par l'utilisateur, défini dans son **fichier.sew** (ancienmment *fichier.favm*)
+
+* **preprocess**, OPTIONAL, s'il a un traitement à effectuer, en *preprocessing*, i.e. avant la phase dynamique du processus Diversity
+* **postprocess**, OPTIONAL, s'il a un traitement à effectuer, en *postprocessing*, i.e. après la phase dynamique du processus Diversity
+
+* **prefilter**, OPTIONAL, s'il a un traitement à effectuer, en *prefiltering*, i.e. pendant la phase dynamique du processus Diversity , mais avant l'exécution symbolique proprement dite
+
+* **postfilter**, OPTIONAL, s'il a un traitement à effectuer, en *postfiltering*, i.e. pendant la phase dynamique du processus Diversity , mais après l'exécution symbolique proprement dite
+
+
+* **report**, OPTIONAL, pour proposer un bilan de l'analyse formelle effectuée
+
+Soit par exemple:
+
+```cpp
+class MyFAM : public AutoRegisteredFAM< MyFAM >,
+{
+ // MANDATORY for Smart Pointer services
+ AVM_DECLARE_CLONABLE_CLASS( MyFAM )
+
+ /**
+ * MyFAM
+ * for automatic registration in the FAM repository
+ * the UFID key
+ * need for instanciation from the SEW specification file
+ */
+ AVM_INJECT_AUTO_REGISTER_UFID_KEY( "MyFAM" )
+ // end registration
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+
+public:
+ /**
+ * CONSTRUCTOR
+ */
+ MyFAM(CentralProcessorUnit & aManager, Form * aParameterForm)
+ : AutoRegisteredFAM(aManager, aParameterForm,
+ AVM_PRE_FILTERING_STAGE | AVM_POST_FILTERING_STAGE, ...),
+
+ /**
+ * CONFIGURE
+ */
+ bool configureImpl();
+
+ /**
+ * REPORT TRACE
+ */
+ virtual void reportDefault(OutStream & os) const;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PROCESSING API
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * preProcessing
+ */
+ virtual bool preprocess();
+
+ /**
+ * postprocessing
+ */
+ virtual bool postprocess();
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FILTERING API
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * preFiltering
+ */
+ virtual bool prefilter(ExecutionContext * anEC);
+
+ /**
+ * postFiltering
+ * Every post filter has to implement this method
+ */
+ virtual bool postfilter(ExecutionContext * anEC);
+};
+
+```
+
+
+#### CPU: Central Processor Unit
+C'est le scheduler qui gère l'activation les FAMs dans les différentes phases de l'exécution (voir *section MOE* dans le *fichier SEW/FAVM* de spécification du workflow)
+
+#### MPU: Main Processor Unit
+C'est le FAM principal, toujours actif, ayant la charge de
+
+* gérer les "critèrse d'arrêts" (voir *fichier SEW/FAVM* dans le fichier
+* détecter les *deadlocks* d'exécution (noeud sans fils en *postprefiltering*)
+* diverses traitementents internes, tel l'attribution d'un identifiant (numéro) de largeur dans le graphe d'exécution
+* ...
+
+
+#### Some FAMs
+* FAM Coverage (state / transition -- input / output, ...) :pour les analyses dédiées couvertures structurelles des modèles
+* FAM Hit or Jump : pour la sélection de comportement à partir de trace fournie par l'utilisateur
+* FAM Testing (Online / Offline) : pour calculer un verdict associé à un *objectif de test* en mode *online/offline*
+
+### Internal
+Les détails d'implémentation interne !
+
diff --git a/org.eclipse.efm.symbex/src/fam/api/AbstractProcessorUnit.cpp b/org.eclipse.efm.symbex/src/fam/api/AbstractProcessorUnit.cpp
new file mode 100644
index 0000000..f7941b1
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/api/AbstractProcessorUnit.cpp
@@ -0,0 +1,957 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 28 nov. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AbstractProcessorUnit.h"
+
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/ExecutableSystem.h>
+
+#include <fml/runtime/ExecutionContext.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <fam/queue/WaitingStrategy.h>
+
+#include <sew/SymbexDispatcher.h>
+#include <sew/SymbexEngine.h>
+#include <sew/SymbexEventManager.h>
+
+
+#include <boost/format.hpp>
+
+
+
+namespace sep
+{
+
+/*
+ * Precedence for processor, based on resource consumption,
+ * used to order processor in the Diversity process !
+ * For info: 0 for minimum resource requirement reserved by the main processor,
+ * the STOP CRITERIA, and a great number for example REDUNDANCY processor !
+ * {
+ * preProcessing , postProcessing ,
+ * filteringInitialize , filteringFinalize
+ * preFiltering , postFiltering
+ * }
+ */
+const avm_uint8_t AbstractProcessorUnit::DEFAULT_PRECEDENCE_OF_PROCESSOR[5] =
+ { 50 , 50 , 50 , 50 , 50 };
+
+const avm_uint8_t AbstractProcessorUnit::DEFAULT_PRECEDENCE_OF_MAIN_PROCESSOR[5] =
+ { 40 , 40 , 40 , 40 , 40 };
+
+
+const avm_uint8_t AbstractProcessorUnit::PRECEDENCE_OF_ACTIVE_COVERAGE_PROCESSOR[5] =
+ { 40 , 40 , 40 , 40 , 40 };
+
+const avm_uint8_t AbstractProcessorUnit::PRECEDENCE_OF_PASSIVE_COVERAGE_PROCESSOR[5] =
+ { 60 , 60 , 60 , 60 , 60 };
+
+
+const avm_uint8_t AbstractProcessorUnit::PRECEDENCE_OF_MAIN_PROCESSOR[5] =
+ { 0 , 0 , 0 , 0 , 0 };
+
+const avm_uint8_t AbstractProcessorUnit::PRECEDENCE_OF_EXTENDER_PROCESSOR[5] =
+ { 10 , 10 , 10 , 10 , 10 };
+
+const avm_uint8_t AbstractProcessorUnit::PRECEDENCE_OF_REDUNDANCY[5] =
+ { 100 , 100 , 100 , 100 , 100 };
+
+
+const avm_uint8_t AbstractProcessorUnit::PRECEDENCE_OF_TRANSITION_COVERAGE[5] =
+ { 40 , 40 , 40 , 40 , 40 };
+
+const avm_uint8_t AbstractProcessorUnit::PRECEDENCE_OF_HIT_OR_JUMP[5] =
+ { 40 , 40 , 40 , 40 , 40 };
+
+
+const avm_uint8_t AbstractProcessorUnit::PRECEDENCE_OF_FORMULA_COVERAGE[5] =
+ { 60 , 60 , 60 , 60 , 60 };
+
+const avm_uint8_t AbstractProcessorUnit::PRECEDENCE_OF_MACHINE_COVERAGE[5] =
+ { 60 , 60 , 60 , 60 , 60 };
+
+
+const avm_uint8_t AbstractProcessorUnit::PRECEDENCE_OF_TEST_OFFLINE[5] =
+ { 40 , 40 , 40 , 40 , 40 };
+
+
+const avm_uint8_t AbstractProcessorUnit::DEFAULT_PRECEDENCE_OF_SERIALIZER_PROCESSOR[5] =
+ { 75 , 75 , 75 , 75 , 75 };
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+AbstractProcessorUnit::AbstractProcessorUnit(SymbexControllerUnitManager & aManager,
+ WObject * wfParameterObject, avm_computing_process_stage_t requiredStage,
+ const avm_uint8_t * aPrecedence)
+: RunnableElement( CLASS_KIND_T( AbstractProcessorUnit ) , wfParameterObject ),
+IProcessorUnitTest( *this ),
+mControllerUnitManager( aManager ),
+ENV( aManager.getPrimitiveProcessor() ),
+
+mComputingStageRequired( requiredStage ),
+mComputingStageEnabled( AVM_UNDEFINED_STAGE ),
+
+mAutoConfigure( false ),
+mAutoStart( false ),
+
+mPrecedenceOfPreProcess( aPrecedence[0] ),
+mPrecedenceOfPostProcess( aPrecedence[1] ),
+
+mPrecedenceOfInitFilter( aPrecedence[2] ),
+
+mPrecedenceOfPreFilter( aPrecedence[3] ),
+mPrecedenceOfPostFilter( aPrecedence[4] ),
+
+mBeginningStepTimout( 0 ),
+mSliceCount( 0 ),
+
+mPreEvalTraceFormatter( ),
+mPostEvalTraceFormatter( ),
+
+mBoundEvalTraceFormatter( ),
+mReportEvalTraceFormatter( ),
+
+////////////////////////////////////////////////////////////////////////////////
+// Computing Variables
+ecQueue( NULL ),
+ecQueueIt( ),
+ecQueueItEnd( ),
+
+ecChildIt( ),
+ecChildItEnd( )
+{
+ //!! NOTHING
+}
+
+
+AbstractProcessorUnit::AbstractProcessorUnit(SymbexControllerUnitManager & aManager,
+ WObject * wfParameterObject, const avm_uint8_t * aPrecedence)
+: RunnableElement( CLASS_KIND_T( AbstractProcessorUnit ) , wfParameterObject ),
+IProcessorUnitTest( *this ),
+mControllerUnitManager( aManager ),
+ENV( aManager.getPrimitiveProcessor() ),
+
+mComputingStageRequired( AVM_UNDEFINED_STAGE ),
+mComputingStageEnabled( AVM_UNDEFINED_STAGE ),
+
+mAutoConfigure( false ),
+mAutoStart( false ),
+
+mPrecedenceOfPreProcess( aPrecedence[0] ),
+mPrecedenceOfPostProcess( aPrecedence[1] ),
+
+mPrecedenceOfInitFilter( aPrecedence[2] ),
+
+mPrecedenceOfPreFilter( aPrecedence[3] ),
+mPrecedenceOfPostFilter( aPrecedence[4] ),
+
+mBeginningStepTimout( 0 ),
+mSliceCount( 0 ),
+
+mPreEvalTraceFormatter( ),
+mPostEvalTraceFormatter( ),
+
+mBoundEvalTraceFormatter( ),
+mReportEvalTraceFormatter( ),
+
+////////////////////////////////////////////////////////////////////////////////
+// Computing Variables
+ecQueue( NULL ),
+ecQueueIt( ),
+ecQueueItEnd( ),
+
+ecChildIt( ),
+ecChildItEnd( )
+{
+ //!! NOTHING
+}
+
+
+
+/**
+ * CONSTRUCTOR
+ * Other
+ */
+AbstractProcessorUnit::AbstractProcessorUnit(class_kind_t aClassKind,
+ SymbexControllerUnitManager & aManager, WObject * wfParameterObject)
+: RunnableElement( aClassKind , wfParameterObject ),
+IProcessorUnitTest( *this ),
+mControllerUnitManager( aManager ),
+ENV( aManager.getPrimitiveProcessor() ),
+
+mComputingStageRequired( AVM_UNDEFINED_STAGE ),
+mComputingStageEnabled( AVM_UNDEFINED_STAGE ),
+
+mAutoConfigure( false ),
+mAutoStart( false ),
+
+mPrecedenceOfPreProcess( 0 ),
+mPrecedenceOfPostProcess( 0 ),
+
+mPrecedenceOfInitFilter( 0 ),
+
+mPrecedenceOfPreFilter( 0 ),
+mPrecedenceOfPostFilter( 0 ),
+
+mBeginningStepTimout( 0 ),
+mSliceCount( 0 ),
+
+mPreEvalTraceFormatter( ),
+mPostEvalTraceFormatter( ),
+
+mBoundEvalTraceFormatter( ),
+mReportEvalTraceFormatter( ),
+
+////////////////////////////////////////////////////////////////////////////////
+// Computing Variables
+ecQueue( NULL ),
+ecQueueIt( ),
+ecQueueItEnd( ),
+
+ecChildIt( ),
+ecChildItEnd( )
+{
+ //!! NOTHING
+}
+
+AbstractProcessorUnit::AbstractProcessorUnit(class_kind_t aClassKind,
+ SymbexEngine & anEngine, SymbexControllerUnitManager & aManager,
+ WObject * wfParameterObject)
+: RunnableElement( aClassKind, wfParameterObject ),
+IProcessorUnitTest( *this ),
+mControllerUnitManager( aManager ),
+ENV( anEngine.getPrimitiveProcessor() ),
+
+mComputingStageRequired( AVM_UNDEFINED_STAGE ),
+mComputingStageEnabled( AVM_UNDEFINED_STAGE ),
+
+mAutoConfigure( false ),
+mAutoStart( false ),
+
+mPrecedenceOfPreProcess( 0 ),
+mPrecedenceOfPostProcess( 0 ),
+
+mPrecedenceOfInitFilter( 0 ),
+
+mPrecedenceOfPreFilter( 0 ),
+mPrecedenceOfPostFilter( 0 ),
+
+mBeginningStepTimout( 0 ),
+mSliceCount( 0 ),
+
+mPreEvalTraceFormatter( ),
+mPostEvalTraceFormatter( ),
+
+mBoundEvalTraceFormatter( ),
+mReportEvalTraceFormatter( ),
+
+////////////////////////////////////////////////////////////////////////////////
+// Computing Variables
+ecQueue( NULL ),
+ecQueueIt( ),
+ecQueueItEnd( ),
+
+ecChildIt( ),
+ecChildItEnd( )
+{
+ //!! NOTHING
+}
+
+
+/**
+ * GETTER
+ * SymbexEngine
+ * Configuration
+ * SymbexDispatcher
+ *
+ */
+SymbexEngine & AbstractProcessorUnit::getSymbexEngine() const
+{
+ return( mControllerUnitManager.getSymbexEngine() );
+}
+
+Configuration & AbstractProcessorUnit::getConfiguration() const
+{
+ return( mControllerUnitManager.getSymbexEngine().getConfiguration() );
+}
+
+SymbexDispatcher & AbstractProcessorUnit::getSymbexDispatcher() const
+{
+ return( mControllerUnitManager.getSymbexEngine().getSymbexDispatcher() );
+}
+
+SymbexEventManager & AbstractProcessorUnit::getSymbexEventManager() const
+{
+ return( getSymbexDispatcher().getSymbexEventManager() );
+}
+
+SymbexControllerRequestManager &
+AbstractProcessorUnit::getSymbexRequestManager() const
+{
+ return( getSymbexDispatcher().getSymbexControllerRequestManager() );
+}
+
+/**
+ * new local ExecutableForm for Processor usage
+ */
+ExecutableForm * AbstractProcessorUnit::newLocalExecutableForm()
+{
+ ExecutableForm * localExec = new ExecutableForm(
+ getConfiguration().getExecutableSystem() , 0 );
+
+ if( hasParameterWObject() )
+ {
+ localExec->updateFullyQualifiedNameID(
+ getParameterWObject()->getFullyQualifiedNameID() );
+ }
+
+ return( localExec );
+}
+
+///**
+// * GETTER
+// * mProcessorManager
+// */
+//MainProcessorUnit & AbstractProcessorUnit::getMainProcessor()
+//{
+// return( mProcessorManager.getMainProcessor() );
+//}
+//
+//const MainProcessorUnit & AbstractProcessorUnit::getMainProcessor() const
+//{
+// return( mProcessorManager.getMainProcessor() );
+//}
+//
+//
+///**
+// * GETTER
+// * the Builder
+// */
+//Builder & AbstractProcessorUnit::getBuilder()
+//{
+// return( mProcessorManager.getBuilder() );
+//}
+//
+//
+///**
+// * GETTER
+// * AvmPrimitiveProcessor
+// */
+//AvmPrimitiveProcessor & AbstractProcessorUnit::getPrimitiveProcessor()
+//{
+// return( mProcessorManager.getPrimitiveProcessor() );
+//}
+
+/**
+ * GETTER
+ * theExecutionQueue
+ */
+ExecutionQueue & AbstractProcessorUnit::getExecutionQueue()
+{
+ return( mControllerUnitManager.getExecutionQueue() );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+
+bool AbstractProcessorUnit::preConfigure()
+{
+ WObject * theCONFIG = getParameterWObject();
+
+ theCONFIG = Query::getRegexWSequence(theCONFIG,
+ OR_WID2("manifest", "MANIFEST"), theCONFIG);
+
+ if( theCONFIG != WObject::_NULL_ )
+ {
+ mAutoStart = mControllerUnitManager.isAutoStart()
+ || Query::getRegexWPropertyBoolean(theCONFIG,
+ CONS_WID2("auto", "start"), false);
+
+ mAutoConfigure = mAutoStart
+ || mControllerUnitManager.isAutoConfigure()
+ || Query::getRegexWPropertyBoolean(theCONFIG,
+ CONS_WID2("auto", "conf(igure)?"), false);
+ }
+
+ return( mAutoConfigure || mAutoStart || isEnablePlugin() );
+}
+
+bool AbstractProcessorUnit::configure()
+{
+ // INITIALIZATION
+ mConfigFlag = RunnableElement::configure();
+
+ // For common parameters configuration
+ mConfigFlag = configureCommon() && mConfigFlag;
+
+ // standard processor user configuration
+ mConfigFlag = configureImpl() && mConfigFlag;
+
+ // auto registration
+ mConfigFlag = autoConfigureMOE() && mConfigFlag;
+
+ // scheduling configuration
+ mConfigFlag = configureLifecycleState() && mConfigFlag;
+
+ return( mConfigFlag );
+}
+
+
+bool AbstractProcessorUnit::configureCommon()
+{
+ bool isOK = true;
+
+ // For Eval Trace format
+ isOK = configureLog() && isOK;
+
+ return( isOK );
+}
+
+
+bool AbstractProcessorUnit::configureLog()
+{
+ bool isOK = true;
+
+ mPreEvalTraceFormatter = getDefaultPreEvalTraceFormatter();
+
+ mPostEvalTraceFormatter = getDefaultPostEvalTraceFormatter();
+
+ mBoundEvalTraceFormatter = getDefaultBoundEvalTraceFormatter();
+
+ mReportEvalTraceFormatter = getDefaultReportEvalTraceFormatter();
+
+ WObject * theLOG = Query::getWSequenceOrElse(
+ getParameterWObject(), "console", "LOG");
+ if( theLOG != WObject::_NULL_ )
+ {
+ mPreEvalTraceFormatter = Query::getWPropertyStringOrElse( theLOG,
+ "step", "eval", Query::getWPropertyString( theLOG, "format",
+ mPreEvalTraceFormatter) );
+
+ StringTools::replaceAll(mPreEvalTraceFormatter, "\\t", "\t");
+ StringTools::replaceAll(mPreEvalTraceFormatter, "\\n", "\n");
+
+
+ mPostEvalTraceFormatter = Query::getWPropertyStringOrElse( theLOG,
+ "result", "format", mPostEvalTraceFormatter );
+
+ StringTools::replaceAll(mPostEvalTraceFormatter, "\\t", "\t");
+ StringTools::replaceAll(mPostEvalTraceFormatter, "\\n", "\n");
+
+
+ mBoundEvalTraceFormatter = Query::getWPropertyStringOrElse( theLOG,
+ "bound", "format", mBoundEvalTraceFormatter );
+
+ StringTools::replaceAll(mBoundEvalTraceFormatter, "\\t", "\t");
+ StringTools::replaceAll(mBoundEvalTraceFormatter, "\\n", "\n");
+
+
+ mReportEvalTraceFormatter = Query::getWPropertyStringOrElse( theLOG,
+ "report", "format", mReportEvalTraceFormatter );
+
+ StringTools::replaceAll(mReportEvalTraceFormatter, "\\t", "\t");
+ StringTools::replaceAll(mReportEvalTraceFormatter, "\\n", "\n");
+ }
+
+ if( theLOG == NULL )
+ {
+ theLOG = getParameterWObject();
+ }
+
+ try
+ {
+ boost::format formatter(mPreEvalTraceFormatter);
+ }
+ catch(const boost::io::bad_format_string & bfs)
+ {
+ Query::reportErrorAttribute( theLOG, "eval", bfs.what());
+ isOK = false;
+ }
+
+ try
+ {
+ boost::format formatter(mPreEvalTraceFormatter);
+ }
+ catch(const boost::io::bad_format_string & bfs)
+ {
+ Query::reportErrorAttribute( theLOG, "result", bfs.what());
+ isOK = false;
+ }
+
+ try
+ {
+ boost::format formatter(mBoundEvalTraceFormatter);
+ }
+ catch(const boost::io::bad_format_string & bfs)
+ {
+ Query::reportErrorAttribute( theLOG, "bound", bfs.what());
+ isOK = false;
+ }
+
+ try
+ {
+ boost::format formatter(mReportEvalTraceFormatter);
+ }
+ catch(const boost::io::bad_format_string & bfs)
+ {
+ Query::reportErrorAttribute( theLOG, "report", bfs.what());
+ isOK = false;
+ }
+
+ return( isOK );
+}
+
+
+bool AbstractProcessorUnit::checkingConfiguration()
+{
+ if( requiresStrongEnableFilter() && (not isStrongEnableFilter()) )
+ {
+ AVM_OS_CLOG << strTypeId()
+ << ":> Failed to configure the CONTROLLER UNIT << "
+ << strUniqId() << " >> " << std::endl;
+
+ if( isEnablePrefilter() )
+ {
+ AVM_OS_CLOG << "This CONTROLLER UNIT must be "
+ "in the POST-FILTER scheduler also !"
+ << std::endl;
+ }
+ else
+ {
+ AVM_OS_CLOG << "This CONTROLLER UNIT must be "
+ "in the PRE-FILTER scheduler also !"
+ << std::endl;
+ }
+
+ return( false );
+ }
+
+ return true;
+}
+
+
+/**
+ * API
+ * Auto configure Model Of Execution in CPU
+ */
+bool AbstractProcessorUnit::autoConfigureMOE()
+{
+ bool isOK = true;
+
+ if( mAutoConfigure )
+ {
+ isOK = autoConfigureMOEImpl();
+ }
+
+ // checking of model of execution for processor
+ isOK = checkingConfiguration() && isOK;
+
+ return( isOK );
+}
+
+bool AbstractProcessorUnit::autoConfigureMOEImpl()
+{
+ bool isOK = true;
+
+ if( mComputingStageRequired != AVM_UNDEFINED_STAGE )
+ {
+ mComputingStageEnabled = mComputingStageRequired;
+
+//!![DEBUG]
+//mProcessorManager.toStream(
+// AVM_OS_DEBUG << "before autoConfigureMOEImpl< " << this->strUniqId()
+// << " >" << std::endl );
+
+ if( (mComputingStageRequired & AVM_PRE_PROCESSING_STAGE) != 0 )
+ {
+ if( not mControllerUnitManager.registerPreprocessor( this ) )
+ {
+ isOK = false;
+ }
+ }
+
+ if( (mComputingStageRequired & AVM_POST_PROCESSING_STAGE) != 0 )
+ {
+ if( not mControllerUnitManager.registerPostprocessor( this ) )
+ {
+ isOK = false;
+ }
+ }
+
+ if( (mComputingStageRequired & AVM_PRE_FILTERING_STAGE) != 0 )
+ {
+ if( not mControllerUnitManager.registerPrefilter( this ) )
+ {
+ isOK = false;
+ }
+ }
+
+ if( (mComputingStageRequired & AVM_POST_FILTERING_STAGE) != 0 )
+ {
+ if( not mControllerUnitManager.registerPostfilter( this ) )
+ {
+ isOK = false;
+ }
+ }
+
+//!![DEBUG]
+//mProcessorManager.toStream(
+// AVM_OS_DEBUG << std::endl << "after autoConfigureMOEImpl< "
+// << this->strUniqId() << " >" << std::endl );
+ }
+ else
+ {
+ AVM_OS_DEBUG << "TODO autoConfigureMOEImpl< "
+ << this->strUniqId() << " >" << std::endl;
+ }
+
+ return( isOK );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// ENABLE & REGISTER PROCESS PLUGIN
+////////////////////////////////////////////////////////////////////////////////
+
+void AbstractProcessorUnit::enablePreprocess(AbstractProcessorUnit * aProcessor)
+{
+ enablePreprocess();
+
+ mControllerUnitManager.addPreprocessor( aProcessor );
+}
+
+void AbstractProcessorUnit::enablePostprocess(AbstractProcessorUnit * aProcessor)
+{
+ enablePostprocess();
+
+ mControllerUnitManager.addPostprocessor( aProcessor );
+}
+
+
+void AbstractProcessorUnit::enablePrefilter(AbstractProcessorUnit * aProcessor)
+{
+ enablePrefilter();
+
+ mControllerUnitManager.addPrefilter( aProcessor );
+}
+
+void AbstractProcessorUnit::enablePostfilter(AbstractProcessorUnit * aProcessor)
+{
+ enablePostfilter();
+
+ mControllerUnitManager.addPostfilter( aProcessor );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// FILTER API
+////////////////////////////////////////////////////////////////////////////////
+
+bool AbstractProcessorUnit::prefilter()
+{
+ ecQueue = &( getExecutionQueue().getReadyQueue() );
+ ecQueueIt = ecQueue->begin();
+ ecQueueItEnd = ecQueue->end();
+ for( ; ecQueueIt != ecQueueItEnd ; )
+ {
+ if( not prefilter(* (*ecQueueIt)) )
+ {
+ getExecutionQueue().appendFailed( *ecQueueIt );
+
+ ecQueueIt = ecQueue->erase(ecQueueIt);
+ }
+ else
+ {
+ ++ecQueueIt;
+ }
+ }
+
+ return( getExecutionQueue().hasReady() );
+}
+
+
+bool AbstractProcessorUnit::postfilter()
+{
+ ecQueue = &( getExecutionQueue().getResultQueue() );
+ ecQueueIt = ecQueue->begin();
+ ecQueueItEnd = ecQueue->end();
+ for( ; ecQueueIt != ecQueueItEnd ; )
+ {
+ if( mBeginningStepTimout > 0 )
+ {
+ ++ecQueueIt;
+
+ --mBeginningStepTimout;
+ }
+ else
+ {
+ if( not postfilter(* (*ecQueueIt)) )
+ {
+ getExecutionQueue().appendFailed( *ecQueueIt );
+
+ ecQueueIt = ecQueue->erase(ecQueueIt);
+ }
+ else
+ {
+ ++ecQueueIt;
+ }
+
+ }
+ }
+
+ return( getExecutionQueue().hasResult() );
+}
+
+
+/**
+ * REPORT
+ */
+void AbstractProcessorUnit::reportHeader(
+ OutStream & os, const std::string & processorName) const
+{
+ os << TAB << processorName << " PROCESSOR";
+
+AVM_IF_DEBUG_FLAG( CONFIGURING )
+ if( isWeakEnableFilter() )
+ {
+ os << " using as ";
+
+ if( isStrongEnableFilter() )
+ {
+ os << "(PRE & POST)";
+ }
+ if( isEnablePrefilter() )
+ {
+ os << "PRE";
+ }
+ else if( isEnablePostfilter() )
+ {
+ os << "POST";
+ }
+
+ os << "-FILTER";
+ }
+
+ if( isWeakEnableProcess() )
+ {
+ os << (isWeakEnableFilter() ? " &" : " using" ) << " as ";
+
+ if( isStrongEnableProcess() )
+ {
+ os << "(PRE & POST)";
+ }
+ else if( isEnablePreprocess() )
+ {
+ os << "PRE";
+ }
+ else if( isEnablePostprocess() )
+ {
+ os << "POST";
+ }
+ os << "-PROCESS";
+ }
+AVM_ENDIF_DEBUG_FLAG_AND( CONFIGURING )
+
+ os << EOL;
+}
+
+
+void AbstractProcessorUnit::reportDefault(OutStream & os) const
+{
+ AVM_OS_VERBOSITY_MEDIUM( os )
+ << TAB << "FORMAL MODULE ANALYSIS< "
+ << ( isNamed() ? strFQN() : strUniqId() )
+ << " > DONE !!!" << EOL_FLUSH;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// PROCESSOR REQUEST API
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * REQUEUE_RESERVE
+ */
+void AbstractProcessorUnit::handleRequestRequeueReserveTable(
+ WaitingStrategy & aWaitingStrategy,
+ ListOfExecutionContext & aReserveQueue,
+ avm_uint8_t aWeightMin, avm_uint8_t aWeightMax)
+{
+ aWaitingStrategy.pushChild( aReserveQueue );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// PREFILTER REMOVE EC TOOLS
+////////////////////////////////////////////////////////////////////////////////
+
+avm_size_t AbstractProcessorUnit::remove(ExecutionContext * anEC,
+ OutStream & logger, const std::string & msg)
+{
+ avm_size_t ecCount = 1; // 1 for sep::destroyElement( anEC );
+
+ // First remove child
+ if( anEC->hasNext() )
+ {
+ ExecutionContext::rw_child_iterator itEC = anEC->begin();
+ for( ExecutionContext * tmpEC = NULL ; itEC != anEC->end() ; )
+ {
+ tmpEC = (*itEC);
+
+ tmpEC->setContainer( NULL );
+
+ itEC = anEC->eraseChildContext( itEC );
+
+ ecCount += AbstractProcessorUnit::remove( tmpEC , logger , msg );
+ }
+
+ anEC->clearChildContext();
+ }
+
+ // Effective remove
+ if( anEC->hasPrevious() )
+ {
+ anEC->getPrevious()->removeChildContext(anEC);
+ }
+
+ getSymbexEventManager().notifyEventDestroyCtx( anEC );
+
+
+AVM_IF_DEBUG_LEVEL_GTE_MEDIUM
+ logger << (( msg.empty() ) ? "A Plugin Processor remove the" : msg)
+ << " EC:> " << anEC->str_min() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_GTE_MEDIUM
+
+ sep::destroyElement( anEC );
+
+ return( ecCount );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// FINAL SLICING TOOLS
+////////////////////////////////////////////////////////////////////////////////
+
+bool AbstractProcessorUnit::isSliceableContext(ExecutionContext & anEC) const
+{
+ return( anEC.noneInfo(*this) );
+}
+
+
+void AbstractProcessorUnit::computeLeafEC(
+ const ListOfExecutionContext & listOfRootEC,
+ ListOfExecutionContext & listOfLeafEC)
+{
+ ListOfExecutionContext tmpListOfEC;
+
+ ListOfExecutionContext::const_iterator itEC = listOfRootEC.begin();
+ ListOfExecutionContext::const_iterator endEC = listOfRootEC.end();
+ for( ; itEC != endEC ; ++itEC )
+ {
+ if( (*itEC)->isLeafNode() )
+ {
+ listOfLeafEC.append( *itEC );
+ }
+ else
+ {
+ tmpListOfEC.append( (*itEC)->getNext() );
+ }
+ }
+
+ if( tmpListOfEC.nonempty() )
+ {
+ computeLeafEC(tmpListOfEC, listOfLeafEC);
+ }
+}
+
+
+void AbstractProcessorUnit::slice(ListOfExecutionContext & listOfLeafEC)
+{
+AVM_IF_DEBUG_FLAG( PROCESSOR )
+ AVM_OS_TRACE << getParameterWObject()->getFullyQualifiedNameID()
+ << " :> CUT BACK" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( PROCESSOR )
+
+ while( listOfLeafEC.nonempty() )
+ {
+ slice(listOfLeafEC, listOfLeafEC.pop_last());
+ }
+
+AVM_IF_DEBUG_FLAG( PROCESSOR )
+ AVM_OS_TRACE << getParameterWObject()->getFullyQualifiedNameID()
+ << " :> CUT BACK END ( count: " << mSliceCount << " )"
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( PROCESSOR )
+}
+
+void AbstractProcessorUnit::slice(
+ ListOfExecutionContext & listOfLeafEC,
+ ExecutionContext * leafEC)
+{
+ if( (leafEC != NULL) && leafEC->isLeafNode()
+ && isSliceableContext(* leafEC) )
+ {
+ ExecutionContext * containerEC = leafEC->getContainer();
+
+ if( containerEC != NULL )
+ {
+ ExecutionContext * tmpEC = NULL;
+
+ // Destroy des fils de theFatherEC sauf targetEC
+ ExecutionContext::rw_child_iterator it = containerEC->begin();
+ for( ; it != containerEC->end() ; )
+ {
+ tmpEC = (*it);
+ if( tmpEC->isLeafNode() && isSliceableContext(* tmpEC) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ tmpEC->traceMinimum(AVM_OS_TRACE << "\t");
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ it = containerEC->eraseChildContext(it);
+ ++mSliceCount;
+
+ listOfLeafEC.remove(tmpEC);
+
+ getSymbexEventManager().notifyEventDestroyCtx( tmpEC );
+
+ sep::destroyElement( tmpEC );
+ }
+ else
+ {
+ ++it;
+ }
+ }
+
+ slice(listOfLeafEC, containerEC);
+ }
+ }
+ else
+ {
+ }
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/api/AbstractProcessorUnit.h b/org.eclipse.efm.symbex/src/fam/api/AbstractProcessorUnit.h
new file mode 100644
index 0000000..422fe9b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/api/AbstractProcessorUnit.h
@@ -0,0 +1,1454 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 28 nov. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef ABSTRACTPROCESSORUNIT_H_
+#define ABSTRACTPROCESSORUNIT_H_
+
+#include <common/RunnableElement.h>
+#include <fam/api/IProcessorUnitTest.h>
+#include <fam/api/ProcessorUnitAutoRegistration.h>
+
+#include <computer/EvaluationEnvironment.h>
+
+#include <fml/runtime/ExecutionContext.h>
+
+#include <fml/workflow/WObject.h>
+
+
+namespace sep
+{
+
+
+typedef avm_uint8_t avm_computing_process_stage_t;
+
+enum {
+ AVM_UNDEFINED_STAGE = 0x0000,
+
+ AVM_PRE_PROCESSING_STAGE = 0x0001,
+ AVM_POST_PROCESSING_STAGE = 0x0002,
+
+ AVM_PREPOST_PROCESSING_STAGE = AVM_PRE_PROCESSING_STAGE
+ | AVM_POST_PROCESSING_STAGE,
+
+ AVM_PRE_FILTERING_STAGE = 0x0004,
+ AVM_POST_FILTERING_STAGE = 0x0008,
+
+ AVM_PREPOST_FILTERING_STAGE = AVM_PRE_FILTERING_STAGE
+ | AVM_POST_FILTERING_STAGE,
+
+ AVM_COMPUTING_ALL_STAGE = AVM_PREPOST_PROCESSING_STAGE
+ | AVM_PREPOST_FILTERING_STAGE,
+
+ AVM_COMPUTING_COMPOSITE_STAGE = 0x0010,
+
+};
+
+
+
+class WaitingStrategy;
+class AvmPrimitiveProcessor;
+
+class Builder;
+
+class Configuration;
+
+class ExecutableForm;
+class ExecutionContext;
+class ExecutionQueue;
+
+class MainProcessorUnit;
+
+class SymbexDispatcher;
+class SymbexControllerRequestManager;
+class SymbexControllerUnitManager;
+class SymbexEngine;
+class SymbexEventManager;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// FORMAL ANALYSIS MODULE POINTER
+////////////////////////////////////////////////////////////////////////////////
+
+class AbstractProcessorUnit :
+ public RunnableElement ,
+ public IProcessorUnitTest ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( AbstractProcessorUnit )
+{
+
+public:
+ /**
+ * PROCESSOR FACTORY
+ * for automatic registration in the processor repository
+ */
+ virtual const IProcessorUnitRegistration & REGISTER_TOOL() const = 0;
+
+ inline bool isRegisterTool(
+ const IProcessorUnitRegistration & aRegisterTool) const
+ {
+ return( REGISTER_TOOL().isEquals( aRegisterTool ) );
+ }
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ SymbexControllerUnitManager & mControllerUnitManager;
+
+ EvaluationEnvironment ENV;
+
+ avm_computing_process_stage_t mComputingStageRequired;
+ avm_computing_process_stage_t mComputingStageEnabled;
+
+ bool mAutoConfigure;
+ bool mAutoStart;
+
+ avm_uint8_t mPrecedenceOfPreProcess;
+ avm_uint8_t mPrecedenceOfPostProcess;
+
+ avm_uint8_t mPrecedenceOfInitFilter;
+
+ avm_uint8_t mPrecedenceOfPreFilter;
+ avm_uint8_t mPrecedenceOfPostFilter;
+
+ avm_size_t mBeginningStepTimout;
+
+ avm_size_t mSliceCount;
+
+ // For eval / report Trace format
+ std::string mPreEvalTraceFormatter;
+ std::string mPostEvalTraceFormatter;
+
+ std::string mBoundEvalTraceFormatter;
+ std::string mReportEvalTraceFormatter;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing Variables
+ ListOfExecutionContext * ecQueue;
+
+ ListOfExecutionContext::iterator ecQueueIt;
+ ListOfExecutionContext::iterator ecQueueItEnd;
+
+ ExecutionContext::rw_child_iterator ecChildIt;
+ ExecutionContext::rw_child_iterator ecChildItEnd;
+
+
+public:
+ /*
+ * Precedence for processor, based on resource consumption,
+ * used to order processor in the Diversity process !
+ * For info: 0 for minimum resource requirement reserved by STOP CRITERIA FILTER,
+ * and 255 maximum value for example REDUNDANCY FILTER
+ * Default value is the max !
+ * Processing: pre = 255 , post = 255
+ * Filtering : init = 255
+ * Filtering : pre = 255 , post = 255
+ */
+ static const avm_uint8_t DEFAULT_PRECEDENCE_OF_PROCESSOR[5];
+
+ static const avm_uint8_t DEFAULT_PRECEDENCE_OF_MAIN_PROCESSOR[5];
+
+
+ static const avm_uint8_t PRECEDENCE_OF_ACTIVE_COVERAGE_PROCESSOR[5];
+
+ static const avm_uint8_t PRECEDENCE_OF_PASSIVE_COVERAGE_PROCESSOR[5];
+
+
+ static const avm_uint8_t PRECEDENCE_OF_MAIN_PROCESSOR[5];
+
+ static const avm_uint8_t PRECEDENCE_OF_EXTENDER_PROCESSOR[5];
+
+ static const avm_uint8_t PRECEDENCE_OF_REDUNDANCY[5];
+
+
+ static const avm_uint8_t PRECEDENCE_OF_TRANSITION_COVERAGE[5];
+
+ static const avm_uint8_t PRECEDENCE_OF_HIT_OR_JUMP[5];
+
+
+ static const avm_uint8_t PRECEDENCE_OF_FORMULA_COVERAGE[5];
+
+ static const avm_uint8_t PRECEDENCE_OF_MACHINE_COVERAGE[5];
+
+ static const avm_uint8_t PRECEDENCE_OF_TEST_OFFLINE[5];
+
+
+ static const avm_uint8_t DEFAULT_PRECEDENCE_OF_SERIALIZER_PROCESSOR[5];
+
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AbstractProcessorUnit(
+ SymbexControllerUnitManager & aManager, WObject * wfParameterObject,
+ avm_computing_process_stage_t requiredStage,
+ const avm_uint8_t * aPrecedence = DEFAULT_PRECEDENCE_OF_PROCESSOR);
+
+ AbstractProcessorUnit(
+ SymbexControllerUnitManager & aManager, WObject * wfParameterObject,
+ const avm_uint8_t * aPrecedence = DEFAULT_PRECEDENCE_OF_PROCESSOR);
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ AbstractProcessorUnit(class_kind_t aClassKind,
+ SymbexControllerUnitManager & aManager, WObject * wfParameterObject);
+
+ AbstractProcessorUnit(class_kind_t aClassKind, SymbexEngine & anEngine,
+ SymbexControllerUnitManager & aManager, WObject * wfParameterObject);
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AbstractProcessorUnit()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTERS
+ * mPrecedenceOfPreProcess
+ * mPrecedenceOfPostProcess
+ */
+ avm_uint8_t getPrecedenceOfPreProcess() const
+ {
+ return mPrecedenceOfPreProcess;
+ }
+
+ avm_uint8_t getPrecedenceOfPostProcess() const
+ {
+ return mPrecedenceOfPostProcess;
+ }
+
+ /**
+ * GETTERS
+ * mPrecedenceOfInitFilter
+ * mPrecedenceOfPreFilter
+ * mPrecedenceOfPostFilter
+ */
+ avm_uint8_t getPrecedenceOfInitFilter() const
+ {
+ return mPrecedenceOfInitFilter;
+ }
+
+ avm_uint8_t getPrecedenceOfPreFilter() const
+ {
+ return mPrecedenceOfPreFilter;
+ }
+
+ avm_uint8_t getPrecedenceOfPostFilter() const
+ {
+ return mPrecedenceOfPostFilter;
+ }
+
+
+ /**
+ * new local ExecutableForm for ProcessorT usage
+ */
+ ExecutableForm * newLocalExecutableForm();
+
+
+ /**
+ * GETTER
+ * mProcessorManager
+ */
+ inline SymbexControllerUnitManager & getControllerUnitManager()
+ {
+ return( mControllerUnitManager );
+ }
+
+ inline const SymbexControllerUnitManager & getControllerUnitManager() const
+ {
+ return( mControllerUnitManager );
+ }
+
+ /**
+ * GETTER
+ * SymbexEngine
+ * Configuration
+ * SymbexDispatcher
+ *
+ */
+ SymbexEngine & getSymbexEngine() const;
+
+ Configuration & getConfiguration() const;
+
+ SymbexDispatcher & getSymbexDispatcher() const;
+
+ SymbexEventManager & getSymbexEventManager() const;
+
+ SymbexControllerRequestManager & getSymbexRequestManager() const;
+
+
+// /**
+// * GETTER
+// * mProcessorManager
+// */
+// MainProcessorUnit & getMainProcessor();
+//
+// const MainProcessorUnit & getMainProcessor() const;
+//
+//
+// /**
+// * GETTER
+// * the Builder
+// */
+// Builder & getBuilder();
+//
+// /**
+// * GETTER
+// * AvmPrimitiveProcessor
+// */
+// AvmPrimitiveProcessor & getPrimitiveProcessor();
+
+
+ /**
+ * GETTER - SETTER
+ * theExecutionQueue
+ */
+ ExecutionQueue & getExecutionQueue();
+
+
+ /**
+ * GETTER
+ * EvaluationEnvironment ENV
+ */
+ inline EvaluationEnvironment & getENV()
+ {
+ return( ENV );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // PLUGIN PROCESSOR KIND
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * GETTER
+ * mAutoConfigure
+ */
+ inline bool isAutoConfigure() const
+ {
+ return( mAutoConfigure );
+ }
+
+ /**
+ * GETTER - SETTER
+ * mComputingStageEnabled
+ */
+#define DISABLE_PLUGIN( kind , FLAG ) kind &= ( ~ ( FLAG ) )
+
+#define ENABLE_PLUGIN( kind , FLAG ) kind |= ( FLAG )
+
+
+#define IS_DISABLE_PLUGIN( kind , FLAG ) ( (kind & ( FLAG )) == 0 )
+
+#define IS_ENABLE_PLUGIN( kind , FLAG ) ( (kind & ( FLAG )) != 0 )
+
+#define IS_STRONG_ENABLE_PLUGIN( kind , FLAG ) ( (kind & ( FLAG )) == ( FLAG ) )
+
+
+ inline void enablePlugin(avm_computing_process_stage_t requiredStage,
+ bool bEnabled = true)
+ {
+ if( bEnabled )
+ {
+ ENABLE_PLUGIN( mComputingStageEnabled , requiredStage );
+ }
+ else
+ {
+ DISABLE_PLUGIN( mComputingStageEnabled , requiredStage );
+ }
+ }
+
+ inline bool isDisablePlugin() const
+ {
+ return( mComputingStageEnabled == AVM_UNDEFINED_STAGE );
+ }
+
+ inline bool isEnablePlugin() const
+ {
+ return( mComputingStageEnabled != AVM_UNDEFINED_STAGE );
+ }
+
+ inline bool isDisablePlugin(
+ avm_computing_process_stage_t requiredStage) const
+ {
+ return( IS_DISABLE_PLUGIN(
+ mComputingStageEnabled, requiredStage) );
+ }
+
+ inline bool isEnablePlugin(
+ avm_computing_process_stage_t requiredStage) const
+ {
+ return( IS_STRONG_ENABLE_PLUGIN(
+ mComputingStageEnabled, requiredStage) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PRE PROCESS
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline void enablePreprocess(bool bEnabled = true)
+ {
+ enablePlugin( AVM_PRE_PROCESSING_STAGE , bEnabled );
+ }
+
+ void enablePreprocess(AbstractProcessorUnit * aProcessor);
+
+ inline bool isDisablePreprocess() const
+ {
+ return( IS_DISABLE_PLUGIN(
+ mComputingStageEnabled, AVM_PRE_PROCESSING_STAGE) );
+ }
+
+ inline bool isEnablePreprocess() const
+ {
+ return( IS_STRONG_ENABLE_PLUGIN(
+ mComputingStageEnabled, AVM_PRE_PROCESSING_STAGE) );
+ }
+
+
+ // POST PROCESS
+ inline void enablePostprocess(bool bEnabled = true)
+ {
+ enablePlugin( AVM_POST_PROCESSING_STAGE , bEnabled );
+ }
+
+ void enablePostprocess(AbstractProcessorUnit * aProcessor);
+
+ inline bool isEnablePostprocess() const
+ {
+ return( IS_STRONG_ENABLE_PLUGIN(
+ mComputingStageEnabled, AVM_POST_PROCESSING_STAGE) );
+ }
+
+ inline bool isDisablePostprocess() const
+ {
+ return( IS_DISABLE_PLUGIN(
+ mComputingStageEnabled, AVM_POST_PROCESSING_STAGE) );
+ }
+
+
+ // PROCESS
+ inline void enableProcess(bool bEnabled)
+ {
+ enablePlugin( AVM_PREPOST_PROCESSING_STAGE , bEnabled );
+ }
+
+ inline bool isStrongDisableProcess() const
+ {
+ return( IS_DISABLE_PLUGIN(
+ mComputingStageEnabled, AVM_PREPOST_PROCESSING_STAGE) );
+ }
+
+
+ inline bool isStrongEnableProcess() const
+ {
+ return( IS_STRONG_ENABLE_PLUGIN(
+ mComputingStageEnabled, AVM_PREPOST_PROCESSING_STAGE) );
+ }
+
+ inline bool isWeakEnableProcess() const
+ {
+ return( IS_ENABLE_PLUGIN(
+ mComputingStageEnabled, AVM_PREPOST_PROCESSING_STAGE) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PRE FILTER
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline void enablePrefilter(bool bEnabled = true)
+ {
+ enablePlugin( AVM_PRE_FILTERING_STAGE , bEnabled );
+ }
+
+ void enablePrefilter(AbstractProcessorUnit * aProcessor);
+
+ inline bool isDisablePrefilter() const
+ {
+ return( IS_DISABLE_PLUGIN(
+ mComputingStageEnabled, AVM_PRE_FILTERING_STAGE) );
+ }
+
+ inline bool isEnablePrefilter() const
+ {
+ return( IS_STRONG_ENABLE_PLUGIN(
+ mComputingStageEnabled, AVM_PRE_FILTERING_STAGE) );
+ }
+
+
+
+ // POST FILTER
+ inline void enablePostfilter(bool bEnabled = true)
+ {
+ enablePlugin( AVM_POST_FILTERING_STAGE , bEnabled );
+ }
+
+ void enablePostfilter(AbstractProcessorUnit * aProcessor);
+
+ inline bool isEnablePostfilter() const
+ {
+ return( IS_STRONG_ENABLE_PLUGIN(
+ mComputingStageEnabled, AVM_POST_FILTERING_STAGE) );
+ }
+
+ inline bool isDisablePostfilter() const
+ {
+ return( IS_DISABLE_PLUGIN(
+ mComputingStageEnabled, AVM_POST_FILTERING_STAGE) );
+ }
+
+
+
+ // FILTER
+ inline void enableFilter(bool bEnabled)
+ {
+ enablePlugin( AVM_PREPOST_FILTERING_STAGE , bEnabled );
+ }
+
+ inline bool isDisableFilter() const
+ {
+ return( IS_DISABLE_PLUGIN(
+ mComputingStageEnabled, AVM_PREPOST_FILTERING_STAGE) );
+ }
+
+ inline bool isStrongEnableFilter() const
+ {
+ return( IS_STRONG_ENABLE_PLUGIN(
+ mComputingStageEnabled, AVM_PREPOST_FILTERING_STAGE) );
+ }
+
+ inline bool requiresStrongEnableFilter() const
+ {
+ return( IS_STRONG_ENABLE_PLUGIN(
+ mComputingStageRequired, AVM_PREPOST_FILTERING_STAGE) );
+ }
+
+
+ inline bool isWeakEnableFilter() const
+ {
+ return( IS_ENABLE_PLUGIN(
+ mComputingStageEnabled, AVM_PREPOST_FILTERING_STAGE) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // PLUGIN PROCESSOR API
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * FORMATTER
+ */
+ inline virtual std::string getDefaultPreEvalTraceFormatter() const
+ {
+ return( "" );
+ }
+
+ inline virtual std::string getDefaultPostEvalTraceFormatter() const
+ {
+ return( "" );
+ }
+
+
+ inline virtual std::string getDefaultBoundEvalTraceFormatter() const
+ {
+ return( "" );
+ }
+
+ inline virtual std::string getDefaultReportEvalTraceFormatter() const
+ {
+ return( "" );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool preConfigure();
+
+ virtual bool configure();
+
+ virtual bool configureImpl() = 0;
+
+
+ bool configureCommon();
+
+ bool configureLog();
+
+ bool checkingConfiguration();
+
+ /**
+ * API
+ * Auto configure Model Of Execution in CPU
+ */
+ virtual bool autoConfigureMOE();
+
+ virtual bool autoConfigureMOEImpl();// = 0;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // INIT / EXIT API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool initImpl()
+ {
+ //!! NOTHING
+ return true;
+ }
+
+ virtual bool exitImpl()
+ {
+ //!! NOTHING
+ return true;
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FILTERING API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline virtual bool filteringInitialize()
+ {
+ //!! NOTHING
+ return( true );
+ }
+
+ inline virtual bool filteringFinalize()
+ {
+ //!! NOTHING
+ return( true );
+ }
+
+
+ virtual bool prefilter();
+ inline virtual bool prefilter(ExecutionContext & anEC)
+ {
+ //!! NOTHING
+ return( true );
+ }
+
+ virtual bool postfilter();
+ inline virtual bool postfilter(ExecutionContext & anEC)
+ {
+ //!! NOTHING
+ return( true );
+ }
+
+
+ /**
+ * REPORT
+ */
+ void reportHeader(OutStream & os, const std::string & processorName) const;
+
+ virtual void reportDefault(OutStream & os) const;
+
+
+ /**
+ * EVAL TRACE
+ */
+ inline virtual void tracePreEval(
+ OutStream & os, const ExecutionContext & anEC) const
+ {
+ AVM_VERBOSITY_SWITCH_SILENT
+
+ traceSilentPreEval(os, anEC);
+
+ AVM_VERBOSITY_SWITCH_CASE_MINIMUM
+
+ traceMinimumPreEval(os, anEC);
+
+ AVM_VERBOSITY_SWITCH_CASE_MEDIUM
+
+ traceMediumPreEval(os, anEC);
+
+ AVM_VERBOSITY_SWITCH_CASE_MAXIMUM
+
+ traceMaximumPreEval(os, anEC);
+
+ AVM_VERBOSITY_SWITCH_END
+ }
+
+
+ inline virtual void traceSilentPreEval(
+ OutStream & os, const ExecutionContext & anEC) const
+ {
+ // SILENT => NOTHING
+ }
+
+ inline virtual void traceMinimumPreEval(
+ OutStream & os, const ExecutionContext & anEC) const
+ {
+ traceDefaultPreEval(os, anEC);
+ }
+
+ inline virtual void traceMediumPreEval(
+ OutStream & os, const ExecutionContext & anEC) const
+ {
+ traceDefaultPreEval(os, anEC);
+ }
+
+ inline virtual void traceMaximumPreEval(
+ OutStream & os, const ExecutionContext & anEC) const
+ {
+ traceDefaultPreEval(os, anEC);
+ }
+
+ inline virtual void traceDefaultPreEval(
+ OutStream & os, const ExecutionContext & anEC) const
+ {
+ //!! NOTHING
+ }
+
+
+ inline virtual void tracePostEval(
+ OutStream & os, const ExecutionContext & anEC) const
+ {
+ AVM_VERBOSITY_SWITCH_SILENT
+
+ traceSilentPostEval(os, anEC);
+
+ AVM_VERBOSITY_SWITCH_CASE_MINIMUM
+
+ traceMinimumPostEval(os, anEC);
+
+ AVM_VERBOSITY_SWITCH_CASE_MEDIUM
+
+ traceMediumPostEval(os, anEC);
+
+ AVM_VERBOSITY_SWITCH_CASE_MAXIMUM
+
+ traceMaximumPostEval(os, anEC);
+
+ AVM_VERBOSITY_SWITCH_END
+ }
+
+
+ inline virtual void traceSilentPostEval(
+ OutStream & os, const ExecutionContext & anEC) const
+ {
+ // SILENT => NOTHING
+ }
+
+ inline virtual void traceMinimumPostEval(
+ OutStream & os, const ExecutionContext & anEC) const
+ {
+ traceDefaultPostEval(os, anEC);
+ }
+
+ inline virtual void traceMediumPostEval(
+ OutStream & os, const ExecutionContext & anEC) const
+ {
+ traceDefaultPostEval(os, anEC);
+ }
+
+ inline virtual void traceMaximumPostEval(
+ OutStream & os, const ExecutionContext & anEC) const
+ {
+ traceDefaultPostEval(os, anEC);
+ }
+
+ inline virtual void traceDefaultPostEval(
+ OutStream & os, const ExecutionContext & anEC) const
+ {
+ //!! NOTHING
+ }
+
+
+ inline virtual void traceBoundEval(OutStream & os) const
+ {
+ //!! NOTHING
+ }
+
+ inline virtual void reportEval(OutStream & os) const
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PROCESSOR REQUEST API
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * STOP | RELEASE
+ * RESET | RESTART | CONTINUE
+ * REQUEUE_WAITING | REQUEUE_RESERVE
+ * HEURISTIC | GOAL_ACHIEVED
+ */
+ inline virtual void handleRequestStop()
+ {
+ //!! NOTHING
+ }
+
+ inline virtual void handleRequestRelease()
+ {
+ RunnableElement::setLifecycleReleased();
+ }
+
+
+ inline virtual void handleRequestReset()
+ {
+ //!! NOTHING
+ }
+
+ inline virtual void handleRequestRestart()
+ {
+ //!! NOTHING
+ }
+
+ inline virtual void handleRequestContinue()
+ {
+ //!! NOTHING
+ }
+
+
+ // the Waiting Queue Table
+ inline virtual void handleRequestRequeueWaitingTable(
+ WaitingStrategy & aWaitingStrategy,
+ avm_uint8_t aWeightMin, avm_uint8_t aWeightMax)
+ {
+ //!! NOTHING
+ }
+
+ virtual void handleRequestRequeueReserveTable(
+ WaitingStrategy & aWaitingStrategy,
+ ListOfExecutionContext & aReserveQueue,
+ avm_uint8_t aWeightMin, avm_uint8_t aWeightMax);
+
+
+ inline virtual void handleRequestHeuristic()
+ {
+ //!! NOTHING
+ }
+
+
+ inline virtual void handleRequestGoalAchieved()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // REMOVE EC TOOLS
+ ////////////////////////////////////////////////////////////////////////////
+
+ avm_size_t remove(ExecutionContext * anEC,
+ OutStream & logger = AVM_OS_TRACE, const std::string & msg = "");
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FINAL SLICING TOOLS
+ ////////////////////////////////////////////////////////////////////////////
+ virtual bool isSliceableContext(ExecutionContext & anEC) const;
+
+ void computeLeafEC(const ListOfExecutionContext & listOfEC,
+ ListOfExecutionContext & listOfLeafEC);
+
+ void slice(ListOfExecutionContext & listOfLeafEC);
+
+ void slice(ListOfExecutionContext & listOfLeafEC,
+ ExecutionContext * leafEC);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SERIALIZATION API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual std::string strTypeId() const
+ {
+ return( OSS() << "[p:" << (int)mPrecedenceOfPreProcess << ']'
+ << ( (mParameterWObject == WObject::_NULL_)
+ ? "fqn<process#unknown>"
+ : mParameterWObject->hasQualifiedTypeNameID()
+ ? mParameterWObject->getQualifiedTypeNameID()
+ : mParameterWObject->strUniqId() ) );
+ }
+
+ virtual std::string strUniqId() const
+ {
+ return( OSS() << "[p:" << (int)mPrecedenceOfPreProcess << ']'
+ << ( (mParameterWObject == NULL)
+ ? strFQN("null<WObject>")
+ : mParameterWObject->strFQN("<unamed-fam>") ) );
+ }
+
+ virtual void toStream(OutStream & os) const
+ {
+ if( mParameterWObject != NULL )
+ {
+ mParameterWObject->toStream(os);
+ }
+ else
+ {
+ os << TAB << "null<WObject as Parameter>" << EOL;
+ }
+ }
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+// FORMAL ANALYSIS MODULE SMART POINTER
+////////////////////////////////////////////////////////////////////////////////
+
+class FAM :
+ public SmartPointer< AbstractProcessorUnit , DestroyElementPolicy >,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( FAM )
+{
+
+private:
+ /**
+ * TYPEDEF
+ */
+ typedef SmartPointer< AbstractProcessorUnit ,
+ DestroyElementPolicy > base_this_type;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ FAM()
+ : base_this_type( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ explicit FAM(AbstractProcessorUnit * aFAM)
+ : base_this_type( aFAM )
+ {
+ //!! NOTHING
+ }
+
+public:
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~FAM()
+ {
+ //!! NOTHING
+ }
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // COMPUTING STAGE ENABLED API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline void enablePlugin(
+ avm_computing_process_stage_t requiredStage,
+ bool bEnabled = true)
+ {
+ mPTR->enablePlugin(requiredStage, bEnabled);
+ }
+
+ inline bool isDisablePlugin() const
+ {
+ return( mPTR->isDisablePlugin() );
+ }
+
+ inline bool isEnablePlugin() const
+ {
+ return( mPTR->isEnablePlugin() );
+ }
+
+
+ inline bool isEnablePreprocess() const
+ {
+ return( mPTR->isEnablePreprocess() );
+ }
+
+ inline bool isEnablePostprocess() const
+ {
+ return( mPTR->isEnablePostprocess() );
+ }
+
+
+ inline bool isEnablePrefilter() const
+ {
+ return( mPTR->isEnablePrefilter() );
+ }
+
+ inline bool isEnablePostfilter() const
+ {
+ return( mPTR->isEnablePostfilter() );
+ }
+
+
+ inline bool isWeakEnableFilter() const
+ {
+ return( mPTR->isWeakEnableFilter() );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline WObject * getParameterWObject() const
+ {
+ return mPTR->getParameterWObject();
+ }
+
+
+ inline bool configure()
+ {
+ return mPTR->configure();
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // INIT / EXIT API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline bool init()
+ {
+ return mPTR->init();
+ }
+
+ inline bool exit()
+ {
+ return mPTR->exit();
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // ( PRE / POST ) PROCESS API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline bool preprocess()
+ {
+ return mPTR->preprocess();
+ }
+
+ inline bool postprocess()
+ {
+ return mPTR->postprocess();
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FILTERING API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline bool filteringInitialize()
+ {
+ return mPTR->filteringInitialize();
+ }
+
+ inline bool filteringFinalize()
+ {
+ return mPTR->filteringFinalize();
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // ( PRE / POST ) FILTER API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline bool prefilter()
+ {
+ return mPTR->prefilter();
+ }
+
+ inline bool prefilter(ExecutionContext & anEC)
+ {
+ return mPTR->prefilter( anEC );
+ }
+
+
+ inline bool postfilter()
+ {
+ return mPTR->postfilter();
+ }
+
+ inline bool postfilter(ExecutionContext & anEC)
+ {
+ return mPTR->postfilter( anEC );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // REPORT API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline void report(OutStream & os) const
+ {
+ mPTR->report( os );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // UNIT TEST API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline void tddUnitReport(OutStream & os) const
+ {
+ mPTR->tddUnitReport( os );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // NON-REGRESSION TEST API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline void tddRegressionReport(OutStream & os) const
+ {
+ mPTR->tddRegressionReport( os );
+ }
+
+
+ /**
+ * REPORT
+ */
+ inline void reportHeader(
+ OutStream & os, const std::string & processorName) const
+ {
+ mPTR->reportHeader(os, processorName);
+ }
+
+
+ /**
+ * EVAL TRACE
+ */
+ inline void tracePreEval(
+ OutStream & os, const ExecutionContext & anEC) const
+ {
+ mPTR->tracePreEval(os, anEC);
+ }
+
+
+ inline void traceSilentPreEval(
+ OutStream & os, const ExecutionContext & anEC) const
+ {
+ mPTR->traceSilentPreEval(os, anEC);
+ }
+
+ inline void traceMinimumPreEval(
+ OutStream & os, const ExecutionContext & anEC) const
+ {
+ mPTR->traceMinimumPreEval(os, anEC);
+ }
+
+ inline void traceMediumPreEval(
+ OutStream & os, const ExecutionContext & anEC) const
+ {
+ mPTR->traceMediumPreEval(os, anEC);
+ }
+
+ inline void traceMaximumPreEval(
+ OutStream & os, const ExecutionContext & anEC) const
+ {
+ mPTR->traceMaximumPreEval(os, anEC);
+ }
+
+ inline void traceDefaultPreEval(
+ OutStream & os, const ExecutionContext & anEC) const
+ {
+ mPTR->traceDefaultPreEval(os, anEC);
+ }
+
+
+
+ inline void tracePostEval(
+ OutStream & os, const ExecutionContext & anEC) const
+ {
+ mPTR->tracePostEval(os, anEC);
+ }
+
+
+ inline void traceSilentPostEval(
+ OutStream & os, const ExecutionContext & anEC) const
+ {
+ mPTR->traceSilentPostEval(os, anEC);
+ }
+
+ inline void traceMinimumPostEval(
+ OutStream & os, const ExecutionContext & anEC) const
+ {
+ mPTR->traceMinimumPostEval(os, anEC);
+ }
+
+ inline void traceMediumPostEval(
+ OutStream & os, const ExecutionContext & anEC) const
+ {
+ mPTR->traceMediumPostEval(os, anEC);
+ }
+
+ inline void traceMaximumPostEval(
+ OutStream & os, const ExecutionContext & anEC) const
+ {
+ mPTR->traceMaximumPostEval(os, anEC);
+ }
+
+ inline void traceDefaultPostEval(
+ OutStream & os, const ExecutionContext & anEC) const
+ {
+ mPTR->traceDefaultPostEval(os, anEC);
+ }
+
+
+ inline void traceBoundEval(OutStream & os) const
+ {
+ mPTR->traceBoundEval( os );
+ }
+
+ inline void reportEval(OutStream & os) const
+ {
+ mPTR->reportEval( os );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PROCESSOR REQUEST API
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * STOP | RELEASE
+ * RESET | RESTART | CONTINUE
+ * REQUEUE_WAITING | REQUEUE_RESERVE
+ * HEURISTIC | GOAL_ACHIEVED
+ */
+ inline virtual void handleRequestStop()
+ {
+ mPTR->handleRequestStop();
+ }
+
+ inline virtual void handleRequestRelease()
+ {
+ mPTR->handleRequestRelease();
+ }
+
+
+ inline virtual void handleRequestReset()
+ {
+ mPTR->handleRequestReset();
+ }
+
+ inline virtual void handleRequestRestart()
+ {
+ mPTR->handleRequestRestart();
+ }
+
+ inline virtual void handleRequestContinue()
+ {
+ mPTR->handleRequestContinue();
+ }
+
+
+ // the Waiting Queue Table
+ inline virtual void handleRequestRequeueWaitingTable(
+ WaitingStrategy & aWaitingStrategy,
+ avm_uint8_t aWeightMin, avm_uint8_t aWeightMax)
+ {
+ mPTR->handleRequestRequeueWaitingTable(
+ aWaitingStrategy, aWeightMin, aWeightMax);
+ }
+
+ virtual void handleRequestRequeueReserveTable(
+ WaitingStrategy & aWaitingStrategy,
+ ListOfExecutionContext & aReserveQueue,
+ avm_uint8_t aWeightMin, avm_uint8_t aWeightMax)
+ {
+ mPTR->handleRequestRequeueReserveTable(
+ aWaitingStrategy, aReserveQueue, aWeightMin, aWeightMax);
+ }
+
+
+ inline virtual void handleRequestHeuristic()
+ {
+ mPTR->handleRequestHeuristic();
+ }
+
+
+ inline virtual void handleRequestGoalAchieved()
+ {
+ mPTR->handleRequestGoalAchieved();
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SERIALIZATION API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline std::string strTypeId() const
+ {
+ return mPTR->strTypeId();
+ }
+
+ inline std::string strUniqId() const
+ {
+ return mPTR->strUniqId();
+ }
+
+ inline void toStream(OutStream & os) const
+ {
+ mPTR->toStream( os );
+ }
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+// PROCESSOR UNIT AUTO REGISTRATION FACTORY
+// for automatic registration in the processor repository
+////////////////////////////////////////////////////////////////////////////////
+
+template< class ProcessorT >
+class AutoRegisteredProcessorUnit : public AbstractProcessorUnit
+{
+
+public:
+ /**
+ * TYPDEDEF
+ */
+ typedef AutoRegisteredProcessorUnit< ProcessorT > RegisteredProcessorUnit;
+
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AutoRegisteredProcessorUnit(SymbexControllerUnitManager & aManager,
+ WObject * wfParameterObject, avm_computing_process_stage_t requiredStage,
+ const avm_uint8_t * aPrecedence = DEFAULT_PRECEDENCE_OF_PROCESSOR)
+ : AbstractProcessorUnit(aManager, wfParameterObject, requiredStage, aPrecedence)
+ {
+ //!! NOTHING
+ }
+
+ AutoRegisteredProcessorUnit(
+ SymbexControllerUnitManager & aManager, WObject * wfParameterObject,
+ const avm_uint8_t * aPrecedence = DEFAULT_PRECEDENCE_OF_PROCESSOR)
+ : AbstractProcessorUnit(aManager, wfParameterObject, aPrecedence)
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ AutoRegisteredProcessorUnit(class_kind_t aClassKind,
+ SymbexControllerUnitManager & aManager, WObject * wfParameterObject)
+ : AbstractProcessorUnit(aClassKind, aManager, wfParameterObject)
+ {
+ //!! NOTHING
+ }
+
+ AutoRegisteredProcessorUnit(class_kind_t aClassKind, SymbexEngine & anEngine,
+ SymbexControllerUnitManager & aManager, WObject * wfParameterObject)
+ : AbstractProcessorUnit(aClassKind, anEngine, aManager, wfParameterObject)
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AutoRegisteredProcessorUnit()
+ {
+ // Force Instanciate
+ (void) & AUTO_REGISTER_TOOL;
+ }
+
+
+ /**
+ * PROCESSOR FACTORY
+ * for automatic registration in the processor repository
+ */
+ static struct AutoRegisterProcessorFactory :
+ public ProcessorUnitRegistrationImpl< ProcessorT >
+ {
+ AutoRegisterProcessorFactory()
+ : ProcessorUnitRegistrationImpl< ProcessorT >(
+ ProcessorT::QNID() , ProcessorT::QNID1() ,
+ ProcessorT::QNID2(), ProcessorT::QNID3() )
+ {
+ //!! NOTHING
+ }
+
+ } AUTO_REGISTER_TOOL;
+ // end registration
+
+
+ inline virtual IProcessorUnitRegistration & REGISTER_TOOL() const
+ {
+ return( AUTO_REGISTER_TOOL );
+ }
+
+ inline bool isRegisterTool(
+ const IProcessorUnitRegistration & aRegisterTool) const
+ {
+ return( AUTO_REGISTER_TOOL.isEquals( aRegisterTool ) );
+ }
+
+};
+
+
+template< class ProcessorT > typename
+AutoRegisteredProcessorUnit< ProcessorT >::AutoRegisterProcessorFactory
+AutoRegisteredProcessorUnit< ProcessorT >::AUTO_REGISTER_TOOL;
+
+
+#define AVM_INJECT_AUTO_REGISTER_QUALIFIED_ID_KEY( qnid ) \
+ public: \
+ static std::string QNID () { return( qnid ); } \
+ static std::string QNID1() { return( "" ); } \
+ static std::string QNID2() { return( "" ); } \
+ static std::string QNID3() { return( "" ); }
+
+#define AVM_INJECT_AUTO_REGISTER_QUALIFIED_ID_KEY_2( qnid , qnid1 ) \
+ public: \
+ static std::string QNID () { return( qnid ); } \
+ static std::string QNID1() { return( qnid1 ); } \
+ static std::string QNID2() { return( "" ); } \
+ static std::string QNID3() { return( "" ); }
+
+#define AVM_INJECT_AUTO_REGISTER_QUALIFIED_ID_KEY_3( qnid , qnid1 , qnid2 ) \
+ public: \
+ static std::string QNID () { return( qnid ); } \
+ static std::string QNID1() { return( qnid1 ); } \
+ static std::string QNID2() { return( qnid2 ); } \
+ static std::string QNID3() { return( "" ); }
+
+#define AVM_INJECT_AUTO_REGISTER_QUALIFIED_ID_KEY_4(qnid, qnid1, qnid2, qnid3) \
+ public: \
+ static std::string QNID () { return( qnid ); } \
+ static std::string QNID1() { return( qnid1 ); } \
+ static std::string QNID2() { return( qnid2 ); } \
+ static std::string QNID3() { return( qnid3 ); }
+
+
+
+} /* namespace sep */
+#endif /* ABSTRACTPROCESSORUNIT_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/api/CompositeControllerUnit.cpp b/org.eclipse.efm.symbex/src/fam/api/CompositeControllerUnit.cpp
new file mode 100644
index 0000000..fbe17ef
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/api/CompositeControllerUnit.cpp
@@ -0,0 +1,469 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 29 nov. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "CompositeControllerUnit.h"
+
+
+#include <fam/api/MainProcessorUnit.h>
+
+#include <fml/operator/Operator.h>
+#include <fml/operator/OperatorManager.h>
+
+#include <sew/SymbexControllerUnitManager.h>
+
+
+namespace sep
+{
+
+
+/**
+ * PROCESSOR FACTORY
+ * for automatic registration in the processor repository
+ * AbstractProcessorUnit::REGISTER_TOOL() is a pure virtual method
+ */
+IProcessorUnitRegistration & CompositeControllerUnit::REGISTER_TOOL() const
+{
+ return( MainProcessorUnit::AUTO_REGISTER_TOOL );
+}
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+CompositeControllerUnit::CompositeControllerUnit(
+ SymbexControllerUnitManager & aControllerUnitManager,
+ WObject * wfParameterObject)
+: AbstractProcessorUnit(CLASS_KIND_T( CompositeControllerUnit ),
+ aControllerUnitManager, wfParameterObject),
+ListOfControllerUnits( ),
+theOperator( OperatorManager::OPERATOR_SEQUENCE ),
+
+////////////////////////////////////////////////////////////////////////////
+// Computing Variables
+processorIt( ),
+processorItEnd( )
+{
+ mComputingStageEnabled |= AVM_COMPUTING_COMPOSITE_STAGE;
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////
+
+bool CompositeControllerUnit::configureControllerUnits()
+{
+ processorIt = begin();
+ processorItEnd = end();
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt)->preConfigure() )
+ {
+ if( not (*processorIt)->configure() )
+ {
+ AVM_OS_WARN << "Failed to configuring Controller Unit << "
+ << (*processorIt)->getParameterWObject()
+ ->getFullyQualifiedNameID()
+ << " >> " << std::endl;
+
+ return( false );
+ }
+ }
+ }
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////////////////////
+// REGISTER FOMAL ANALYSIS MODULE a.k.a. CONTROLLER UNIT API
+////////////////////////////////////////////////////////////////////////////
+
+AbstractProcessorUnit * CompositeControllerUnit::getControllerUnit(
+ const IProcessorUnitRegistration & aRegisterTool)
+{
+ processorIt = begin();
+ processorItEnd = end();
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt)->isRegisterTool( aRegisterTool ) )
+ {
+ return( (*processorIt) );
+ }
+ }
+
+ return( NULL );
+}
+
+
+AbstractProcessorUnit * CompositeControllerUnit::getControllerUnit(
+ WObject * wfProcessorObject)
+{
+ processorIt = begin();
+ processorItEnd = end();
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt)->getParameterWObject() == wfProcessorObject )
+ {
+ return( (*processorIt) );
+ }
+ }
+
+ return( NULL );
+}
+
+
+AbstractProcessorUnit * CompositeControllerUnit::getControllerUnit(
+ const std::string & aFullyQualifiedNameID)
+{
+ processorIt = begin();
+ processorItEnd = end();
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt)->getParameterWObject()
+ ->fqnEquals( aFullyQualifiedNameID ) )
+ {
+ return( (*processorIt) );
+ }
+ }
+
+ return( NULL );
+}
+
+
+bool CompositeControllerUnit::registerPreprocessor(AbstractProcessorUnit * aFAM)
+{
+ processorIt = begin();
+ processorItEnd = end();
+ iterator processorPosition = processorItEnd;
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt) == aFAM )
+ {
+ return false;
+ }
+ else if( processorPosition == processorItEnd )
+ {
+ if( (*processorIt)->getPrecedenceOfPreProcess() >
+ aFAM->getPrecedenceOfPreProcess() )
+ {
+ processorPosition = processorIt;
+ }
+ }
+ }
+
+ ListOfControllerUnits::insert(processorPosition, aFAM);
+
+ return true;
+}
+
+
+bool CompositeControllerUnit::registerPostprocessor(AbstractProcessorUnit * aFAM)
+{
+ processorIt = begin();
+ processorItEnd = end();
+ iterator processorPosition = processorItEnd;
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt) == aFAM )
+ {
+ return false;
+ }
+ else if( processorPosition == processorItEnd )
+ {
+ if( (*processorIt)->getPrecedenceOfPostProcess() >
+ aFAM->getPrecedenceOfPostProcess() )
+ {
+ processorPosition = processorIt;
+ }
+ }
+ }
+
+ ListOfControllerUnits::insert(processorPosition, aFAM);
+
+ return true;
+}
+
+
+bool CompositeControllerUnit::registerPrefilter(AbstractProcessorUnit * aFAM)
+{
+ processorIt = begin();
+ processorItEnd = end();
+ iterator processorPosition = processorItEnd;
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt) == aFAM )
+ {
+ return false;
+ }
+ else if( processorPosition == processorItEnd )
+ {
+ if( (*processorIt)->getPrecedenceOfPreFilter() >
+ aFAM->getPrecedenceOfPreFilter() )
+ {
+ processorPosition = processorIt;
+ }
+ }
+ }
+
+ ListOfControllerUnits::insert(processorPosition, aFAM);
+
+ return true;
+}
+
+
+bool CompositeControllerUnit::registerPostfilter(AbstractProcessorUnit * aFAM)
+{
+ processorIt = begin();
+ processorItEnd = end();
+ iterator processorPosition = processorItEnd;
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt) == aFAM )
+ {
+ return false;
+ }
+ else if( processorPosition == processorItEnd )
+ {
+ if( (*processorIt)->getPrecedenceOfPostFilter() >
+ aFAM->getPrecedenceOfPostFilter() )
+ {
+ processorPosition = processorIt;
+ }
+ }
+ }
+
+ ListOfControllerUnits::insert(processorPosition, aFAM);
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// INIT / EXIT API
+////////////////////////////////////////////////////////////////////////////////
+
+bool CompositeControllerUnit::initImpl()
+{
+ processorIt = begin();
+ processorItEnd = end();
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt)->isEnablePlugin() )
+ {
+ if( not (*processorIt)->init() )
+ {
+ AVM_OS_CLOG << "Failed to initing Controller Unit << "
+ << ( *processorIt)->getParameterWObject()
+ ->getFullyQualifiedNameID()
+ << " >> " << std::endl;
+
+ return( false );
+ }
+ }
+ }
+
+ return true;
+}
+
+bool CompositeControllerUnit::exitImpl()
+{
+ processorIt = begin();
+ processorItEnd = end();
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt)->isEnablePlugin() )
+ {
+ if( not (*processorIt)->exit() )
+ {
+ AVM_OS_CLOG << "Failed to exiting Controller Unit << "
+ << ( *processorIt)->getParameterWObject()
+ ->getFullyQualifiedNameID()
+ << " >> " << std::endl;
+
+ return( false );
+ }
+ }
+ }
+
+ return true;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// ( PRE / POST ) PROCESS API
+////////////////////////////////////////////////////////////////////////////////
+
+bool CompositeControllerUnit::preprocess()
+{
+ processorIt = begin();
+ processorItEnd = end();
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt)->isEnablePreprocess() )
+ {
+ if( not (*processorIt)->preprocess() )
+ {
+ AVM_OS_CLOG << "Failed to preprocessing Controller Unit << "
+ << ( *processorIt)->getParameterWObject()
+ ->getFullyQualifiedNameID()
+ << " >> " << std::endl;
+
+ return( false );
+ }
+ }
+ }
+
+ return( true );
+}
+
+bool CompositeControllerUnit::postprocess()
+{
+ processorIt = begin();
+ processorItEnd = end();
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt)->isEnablePostprocess() )
+ {
+ if( not (*processorIt)->postprocess() )
+ {
+ AVM_OS_CLOG << "Failed to postprocessing Controller Unit << "
+ << ( *processorIt)->getParameterWObject()
+ ->getFullyQualifiedNameID()
+ << " >> " << std::endl;
+
+ return( false );
+ }
+ }
+ }
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// FILTERING API
+////////////////////////////////////////////////////////////////////////////////
+
+bool CompositeControllerUnit::filteringInitialize()
+{
+ processorIt = begin();
+ processorItEnd = end();
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt)->isWeakEnableFilter() )
+ {
+ if( not (*processorIt)->filteringInitialize() )
+ {
+ return( false );
+ }
+ }
+ }
+
+ return( true );
+}
+
+bool CompositeControllerUnit::filteringFinalize()
+{
+ processorIt = begin();
+ processorItEnd = end();
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt)->isWeakEnableFilter() )
+ {
+ if( not (*processorIt)->filteringFinalize() )
+ {
+ return( false );
+ }
+ }
+ }
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// ( PRE / POST ) FILTER API
+////////////////////////////////////////////////////////////////////////////////
+
+bool CompositeControllerUnit::prefilter()
+{
+ processorIt = begin();
+ processorItEnd = end();
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt)->isEnablePrefilter() &&
+ (*processorIt)->isLifecycleRunnable() )
+ {
+ if( not (*processorIt)->prefilter() )
+ {
+ return( false );
+ }
+ }
+ }
+
+ return( mControllerUnitManager.getExecutionQueue().hasReady() );
+}
+
+
+bool CompositeControllerUnit::postfilter()
+{
+ processorIt = begin();
+ processorItEnd = end();
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt)->isEnablePostfilter() &&
+ (*processorIt)->isLifecycleRunnable() )
+ {
+ if( not (*processorIt)->postfilter() )
+ {
+ return( false );
+ }
+ }
+ }
+
+ return( mControllerUnitManager.getExecutionQueue().hasResult() );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// SERIALIZATION API
+////////////////////////////////////////////////////////////////////////////////
+
+void CompositeControllerUnit::toStream(
+ OutStream & os, const std::string & header) const
+{
+// if( mParameterWObject != WObject::_NULL_ )
+// {
+// mParameterWObject->toStream(os);
+// }
+
+ os << TAB << header << "{ "
+ << ( (theOperator != NULL) ? theOperator->str() : "" )
+ << EOL;
+
+ const_iterator processorIt = begin();
+ const_iterator processorItEnd = end();
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ os << TAB2 << (*processorIt)->strUniqId() << EOL;
+ }
+ os << TAB << "}" << EOL_FLUSH;
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/api/CompositeControllerUnit.h b/org.eclipse.efm.symbex/src/fam/api/CompositeControllerUnit.h
new file mode 100644
index 0000000..aa55ab1
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/api/CompositeControllerUnit.h
@@ -0,0 +1,228 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 29 nov. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef FAM_API_COMPOSITE_CONTROLLER_UNIT_H_
+#define FAM_API_COMPOSITE_CONTROLLER_UNIT_H_
+
+#include <fam/api/AbstractProcessorUnit.h>
+#include <collection/List.h>
+
+
+namespace sep
+{
+
+class ExecutionContext;
+class IProcessorUnitRegistration;
+class Operator;
+class SymbexControllerUnitManager;
+
+
+class CompositeControllerUnit :
+ public AbstractProcessorUnit ,
+ public List< AbstractProcessorUnit * >
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( CompositeControllerUnit )
+
+
+private:
+ /**
+ * PROCESSOR FACTORY
+ * for instantiation reason
+ * AbstractProcessorUnit::REGISTER_TOOL() is a pure virtual method
+ */
+ virtual IProcessorUnitRegistration & REGISTER_TOOL() const;
+
+
+protected:
+ /**
+ * TYPEDEF
+ */
+ typedef List< AbstractProcessorUnit * > ListOfControllerUnits;
+
+ typedef ListOfControllerUnits::iterator iterator;
+ typedef ListOfControllerUnits::const_iterator const_iterator;
+
+ /**
+ * ATTRIBUTE
+ */
+ Operator * theOperator;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing Variables
+ iterator processorIt;
+ iterator processorItEnd;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ CompositeControllerUnit(
+ SymbexControllerUnitManager & aControllerUnitManager,
+ WObject * wfParameterObject = NULL);
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~CompositeControllerUnit()
+ {
+ //!! NOTHING
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline virtual bool configure()
+ {
+ return true;
+ }
+
+ inline virtual bool configureImpl()
+ {
+ return true;
+ }
+
+ bool configureControllerUnits();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // REGISTER FOMAL ANALYSIS MODULE a.k.a. CONTROLLER UNIT API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline void addControllerUnit(AbstractProcessorUnit * aProcessor)
+ {
+ ListOfControllerUnits::add_union(aProcessor);
+ }
+
+ inline void appendControllerUnit(AbstractProcessorUnit * aProcessor)
+ {
+ ListOfControllerUnits::append(aProcessor);
+ }
+
+
+ AbstractProcessorUnit * getControllerUnit(
+ const IProcessorUnitRegistration & aRegisterTool);
+
+ AbstractProcessorUnit * getControllerUnit(WObject * wfProcessorObject);
+
+ AbstractProcessorUnit * getControllerUnit(
+ const std::string & aFullyQualifiedNameID);
+
+
+ bool registerPreprocessor(AbstractProcessorUnit * aFAM);
+
+ bool registerPostprocessor(AbstractProcessorUnit * aFAM);
+
+ bool registerPrefilter(AbstractProcessorUnit * aFAM);
+
+ bool registerPostfilter(AbstractProcessorUnit * aFAM);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // INIT / EXIT API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool initImpl();
+
+ virtual bool exitImpl();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // ( PRE / POST ) PROCESS API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool preprocess();
+
+ virtual bool postprocess();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FILTERING API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool filteringInitialize();
+
+ virtual bool filteringFinalize();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // ( PRE / POST ) FILTER API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool prefilter();
+
+ virtual bool postfilter();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PROCESSOR REQUEST API :> RELEASE
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline void handleRequestRelease(AbstractProcessorUnit * aRequestor)
+ {
+ ListOfControllerUnits::remove( aRequestor );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // REPORT API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline virtual void report(OutStream & os) const
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // UNIT TEST API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline virtual void tddUnitReport(OutStream & os) const
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // NON-REGRESSION TEST API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline virtual void tddRegressionReport(OutStream & os) const
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SERIALIZATION API
+ ////////////////////////////////////////////////////////////////////////////
+
+ void toStream(OutStream & os) const
+ {
+ toStream(os, "");
+ }
+
+ void toStream(OutStream & os, const std::string & header) const;
+
+};
+
+
+} /* namespace sep */
+
+#endif /* FAM_API_COMPOSITE_CONTROLLER_UNIT_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/api/ExtenderProcessorUnit.cpp b/org.eclipse.efm.symbex/src/fam/api/ExtenderProcessorUnit.cpp
new file mode 100644
index 0000000..6faad64
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/api/ExtenderProcessorUnit.cpp
@@ -0,0 +1,154 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 mars 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ExtenderProcessorUnit.h"
+
+#include <fam/api/MainProcessorUnit.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/trace/TraceFactory.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <sew/Configuration.h>
+
+
+namespace sep
+{
+
+
+ExtenderProcessorUnit::ExtenderProcessorUnit(
+ SymbexControllerUnitManager & aControllerUnitManager,
+ WObject * wfParameterObject)
+: RegisteredProcessorUnit( aControllerUnitManager , wfParameterObject ,
+ AVM_PRE_PROCESSING_STAGE , PRECEDENCE_OF_EXTENDER_PROCESSOR),
+mLocalExecutableForm( getConfiguration().getExecutableSystem() , 0 ),
+mTraceObjective( OperatorManager::OPERATOR_OR ),
+mTraceChecker( ENV, &mLocalExecutableForm )
+{
+ //!! NOTHING
+}
+
+
+/**
+ * CONFIGURE
+ */
+bool ExtenderProcessorUnit::configureImpl()
+{
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( hasParameterWObject() )
+ << "Unexpected NULL ExtenderProcessorUnit WObject !!!"
+ << SEND_EXIT;
+
+ WObject * theTRACE = Query::getRegexWSequence(
+ getParameterWObject(), OR_WID2("trace", "TRACE"));
+ if( (theTRACE == WObject::_NULL_) || theTRACE->hasnoOwnedElement() )
+ {
+ return true;
+ }
+
+ // Configuration of TRACE
+ TraceFactory traceFactory(getConfiguration(), ENV,
+ getParameterWObject(), &mLocalExecutableForm);
+
+ if( traceFactory.configure(& mTraceObjective) )
+ {
+// return( false );
+ }
+
+ return( true );
+}
+
+
+/**
+ * REPORT TRACE
+ */
+void ExtenderProcessorUnit::reportDefault(OutStream & os) const
+{
+ os << TAB << "EXECUTION CHAIN" << std::endl;
+}
+
+
+/**
+ * POST PROCESS
+ */
+bool ExtenderProcessorUnit::preprocess()
+{
+ ListOfExecutionContext potentialInputEC;
+ potentialInputEC.splice( getConfiguration().getInputContext() );
+
+ ListOfExecutionContext::const_iterator it = potentialInputEC.begin();
+ ListOfExecutionContext::const_iterator itEnd = potentialInputEC.end();
+ for( ; it != itEnd ; ++it )
+ {
+ collectContext(getConfiguration().getInputContext(), *(*it));
+ }
+
+ return( true );
+}
+
+
+void ExtenderProcessorUnit::collectContext(
+ ListOfExecutionContext & inputContext, ExecutionContext & anEC)
+{
+ if( anEC.hasChildContext() )
+ {
+ ExecutionContext::child_iterator it = anEC.begin();
+ ExecutionContext::child_iterator itEnd = anEC.end();
+ for( ; it != itEnd ; ++it )
+ {
+ collectContext(inputContext, *(*it));
+ }
+ }
+ // case of leaf EC
+ else if( anEC.hasFlags() || anEC.hasInfo() )
+ {
+ if( MainProcessorUnit::cleanFlagsIfReexecutable(anEC) )
+ {
+ appendIfRequiredExtension(inputContext, anEC);
+ }
+ }
+ else
+ {
+ appendIfRequiredExtension(inputContext, anEC);
+ }
+}
+
+
+void ExtenderProcessorUnit::appendIfRequiredExtension(
+ ListOfExecutionContext & inputContext, ExecutionContext & anEC)
+{
+ if( mTraceObjective.nonempty()
+ && mTraceChecker.isSat(anEC, mTraceObjective) )
+ {
+ anEC.getwFlags().addCoverageElementTrace();
+
+// TODO Create Info using the AvmCode of the mTraceObjective
+ anEC.addInfo(*this,
+ mTraceObjective.singleton()
+ ? mTraceObjective.first()
+ : mTraceObjective.first() );
+
+ anEC.getwFlags().addObjectiveAchievedTrace();
+ }
+ else
+ {
+ inputContext.append(& anEC);
+ }
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fam/api/ExtenderProcessorUnit.h b/org.eclipse.efm.symbex/src/fam/api/ExtenderProcessorUnit.h
new file mode 100644
index 0000000..d29f7d7
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/api/ExtenderProcessorUnit.h
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 mars 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef EXTENDERPROCESSORUNIT_H_
+#define EXTENDERPROCESSORUNIT_H_
+
+#include <fam/api/AbstractProcessorUnit.h>
+
+#include <collection/Typedef.h>
+
+#include <fml/executable/ExecutableForm.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/runtime/ExecutionContext.h>
+
+#include <fml/trace/TraceChecker.h>
+
+
+namespace sep
+{
+
+class SymbexControllerUnitManager;
+
+
+class ExtenderProcessorUnit :
+ public AutoRegisteredProcessorUnit< ExtenderProcessorUnit >
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( ExtenderProcessorUnit )
+
+
+ /**
+ * PROCESSOR FACTORY
+ * for automatic registration in the processor repository
+ * the [ [ FULLY ] QUALIFIED ] NAME ID
+ */
+ AVM_INJECT_AUTO_REGISTER_QUALIFIED_ID_KEY_3(
+ "symbex.extender",
+ "avm::processor.EXECUTION_CHAIN",
+ "avm::core.process.EXECUTION_CHAIN" )
+ // end registration
+
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ ExecutableForm mLocalExecutableForm;
+
+ AvmCode mTraceObjective;
+
+ TraceChecker mTraceChecker;
+
+public:
+ ExtenderProcessorUnit(SymbexControllerUnitManager & aControllerUnitManager,
+ WObject * wfParameterObject);
+
+ virtual ~ExtenderProcessorUnit()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONFIGURE
+ */
+ virtual bool configureImpl();
+
+
+ /**
+ * REPORT TRACE
+ */
+ inline virtual void reportSilent(OutStream & os) const
+ {
+ // SILENT => NOTHING
+ }
+
+ virtual void reportDefault(OutStream & os) const;
+
+
+ /**
+ * POST PROCESS
+ */
+ virtual bool preprocess();
+
+ void collectContext(
+ ListOfExecutionContext & inputContext, ExecutionContext & anEC);
+
+ void appendIfRequiredExtension(
+ ListOfExecutionContext & inputContext, ExecutionContext & anEC);
+};
+
+
+}
+
+#endif /* EXTENDERPROCESSORUNIT_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/api/IProcessorUnitTest.cpp b/org.eclipse.efm.symbex/src/fam/api/IProcessorUnitTest.cpp
new file mode 100644
index 0000000..25e765c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/api/IProcessorUnitTest.cpp
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 24 mars 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "IProcessorUnitTest.h"
+
+#include <util/avm_vfs.h>
+
+#include <fam/api/AbstractProcessorUnit.h>
+
+#include <sew/Configuration.h>
+#include <sew/Workflow.h>
+
+
+namespace sep
+{
+
+
+/**
+ * LOCAL CONFIGURATION
+ */
+// TEST DRIVEN DEVELOPMENT
+//section TDD
+// @report = "avm.tdd";
+//
+// @regression = true;
+// @unit = true;
+//endsection TDD
+
+bool IProcessorUnitTest::tddConfigureImpl()
+{
+ WObject * theTDD = Query::getRegexWSequence(
+ mProcessorUnit.getParameterWObject(), OR_WID2("tdd", "TDD"));
+ if( theTDD != WObject::_NULL_ )
+ {
+ // Locally enable or not non-regression testing
+ bool isRegressionTesting = Query::getWPropertyBoolean(
+ mProcessorUnit.getConfiguration().getWorkflow().getTDD(),
+ "regression", false);
+
+ isRegressionTesting = Query::getWPropertyBoolean(
+ theTDD, "regression", isRegressionTesting);
+
+ // Locally enable or not Unit testing
+ bool isUnitTesting = Workflow::INSTANCE->isTddUnitTesting();
+ isUnitTesting = Query::getWPropertyBoolean(
+ theTDD, "unit", isUnitTesting);
+
+ // Locally report file location
+ if( isRegressionTesting || isUnitTesting )
+ {
+ std::string tddLocation =
+ Query::getWPropertyString(theTDD, "report", "");
+ if( not tddLocation.empty() )
+ {
+ tddLocation = VFS::native_path(tddLocation, VFS::ProjectTddPath);
+ }
+ }
+ }
+
+ return( true );
+}
+
+/**
+ * ProcessorUnit
+ * report beginning / ending
+ */
+void IProcessorUnitTest::tddReportBeginning(OutStream & os) const
+{
+ if( mProcessorUnit.hasParameterWObject() )
+ {
+ os << TAB << "processor "
+ << mProcessorUnit.getParameterWObject()->getFullyQualifiedNameID()
+ << std::endl;
+ }
+}
+
+void IProcessorUnitTest::tddReportEnding(OutStream & os) const
+{
+ if( mProcessorUnit.hasParameterWObject() )
+ {
+ os << TAB << "// end processor "
+ << mProcessorUnit.getParameterWObject()->getFullyQualifiedNameID()
+ << std::endl << std::endl;
+ }
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/api/IProcessorUnitTest.h b/org.eclipse.efm.symbex/src/fam/api/IProcessorUnitTest.h
new file mode 100644
index 0000000..74b1e32
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/api/IProcessorUnitTest.h
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 24 mars 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef IPROCESSORUNITTEST_H_
+#define IPROCESSORUNITTEST_H_
+
+#include <printer/OutStream.h>
+
+
+namespace sep
+{
+
+class AbstractProcessorUnit;
+
+
+class IProcessorUnitTest
+{
+
+private:
+ /**
+ * ATTRIBUTES
+ */
+ AbstractProcessorUnit & mProcessorUnit;
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ IProcessorUnitTest(AbstractProcessorUnit & aProcessorUnit)
+ : mProcessorUnit( aProcessorUnit )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~IProcessorUnitTest()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * LOCAL CONFIGURATION
+ */
+ virtual bool tddConfigureImpl();
+
+
+ /**
+ * ProcessorUnit
+ * report beginning / ending
+ */
+ virtual void tddReportBeginning(OutStream & os) const;
+
+ virtual void tddReportEnding(OutStream & os) const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // UNIT TEST API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual void tddUnitReport(OutStream & os) const
+ {
+ tddReportBeginning(os);
+
+ os << INCR_INDENT;
+ tddUnitReportImpl(os);
+ os << DECR_INDENT;
+
+ tddReportEnding(os);
+ }
+
+ virtual void tddUnitReportImpl(OutStream & os) const
+ {
+ //!! TO IMPLEMENT
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // NON-REGRESSION TEST API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual void tddRegressionReport(OutStream & os) const
+ {
+ tddReportBeginning(os);
+
+ os << INCR_INDENT;
+ tddRegressionReportImpl(os);
+ os << DECR_INDENT;
+
+ tddReportEnding(os);
+ }
+
+ virtual void tddRegressionReportImpl(OutStream & os) const
+ {
+ //!! TO IMPLEMENT
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* IPROCESSORUNITTEST_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/api/MainProcessorUnit.cpp b/org.eclipse.efm.symbex/src/fam/api/MainProcessorUnit.cpp
new file mode 100644
index 0000000..64006ed
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/api/MainProcessorUnit.cpp
@@ -0,0 +1,1074 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "MainProcessorUnit.h"
+
+#include <fstream>
+
+#include <computer/primitive/AvmCommunicationRdvPrimitive.h>
+
+#include <fam/api/ProcessorUnitRepository.h>
+
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/ExecutionInformation.h>
+#include <fml/runtime/RuntimeDef.h>
+
+#include <fml/trace/TraceFactory.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <sew/Configuration.h>
+#include <sew/SymbexDispatcher.h>
+#include <sew/SymbexControllerRequestManager.h>
+#include <sew/Workflow.h>
+
+#include <solver/api/SolverFactory.h>
+
+#include <util/avm_vfs.h>
+
+#include <boost/format.hpp>
+
+
+namespace sep
+{
+
+
+/**
+ ***************************************************************************
+prototype filter::stop_criteria as avm::processor.MAIN is
+ section PROPERTY
+ @node = 50;
+
+ @report = 500000;
+ @save = 500000;
+
+ @eval = 100000;
+
+ @height = 1000;
+ @width = 100;
+
+ @loop#detection#trivial = true;
+ endsection PROPERTY
+
+ section LOG
+ // %1% --> eval step count
+ // %2% --> context count
+ // %3% --> context height
+ // %3% --> context width
+ @eval = "step:%1% , context:%2% , height:%3% , width:%4% ";
+ @result = "step:%1% , context:%2% , height:%3% , width:%4% ";
+ @report = "stop:%1% , context:%2% , height:%3% , width:%4% ";
+ endsection LOG
+endprototype
+ ***************************************************************************
+ */
+
+
+
+/**
+ * CONFIGURE
+ */
+bool MainProcessorUnit::configureImpl()
+{
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( hasParameterWObject() )
+ << "Unexpected a <null> MainProcessorUnit WObject !!!"
+ << SEND_EXIT;
+
+ // Shell config
+ WObject * configSHELL = Query::getRegexWSequence(
+ getParameterWObject(), Workflow::SECTION_SHELL_REGEX_ID);
+
+ mInconditionalStopMarkerLocation =
+ Query::getWPropertyString(configSHELL, "stop", "");
+ if( mInconditionalStopMarkerLocation.empty() )
+ {
+ mInconditionalStopMarkerLocation =
+ getConfiguration().getInconditionalStopMarkerLocation();
+ }
+ else
+ {
+ mInconditionalStopMarkerLocation =
+ VFS::native_path(mInconditionalStopMarkerLocation);
+
+ mInconditionalStopMarkerLocation = VFS::native_path(
+ mInconditionalStopMarkerLocation, VFS::WorkspaceLogPath);
+ }
+
+ mInconditionalStopMarkerCheckingPeriod = 1000;
+ mInconditionalStopMarkerFlag = false;
+
+
+AVM_IF_DEBUG_ENABLED
+ mConfigFlag = IDebugProcessorProvider::debugConfigureImpl(
+ getParameterWObject() ) || mConfigFlag;
+AVM_ENDIF_DEBUG_ENABLED
+
+
+ if( not hasParameterWObject() )
+ {
+ return( mConfigFlag );
+ }
+
+
+ WObject * thePROPERTY = Query::getWSequenceOrElse(
+ getParameterWObject(), "limit", "PROPERTY");
+ if( thePROPERTY != WObject::_NULL_ )
+ {
+ mNodeCountLimit = Query::getRegexWPropertySizeT(
+ thePROPERTY, SUFFIX_WID("node", "count"),
+ AVM_NUMERIC_MAX_SIZE_T, AVM_NUMERIC_MAX_SIZE_T);
+
+ mReportPoint = mReportFrequency =
+ Query::getWPropertySizeT(thePROPERTY, "report",
+ AVM_NUMERIC_MAX_SIZE_T, AVM_NUMERIC_MAX_SIZE_T);
+
+ mSavePoint = mSaveFrequency =
+ Query::getWPropertySizeT(thePROPERTY, "save",
+ AVM_NUMERIC_MAX_SIZE_T, AVM_NUMERIC_MAX_SIZE_T);
+// if( mSaveFrequency < 100 )
+// {
+//AVM_IF_DEBUG_FLAG( CONFIGURING )
+// AVM_OS_LOG << "Invalid save period << " << mSaveFrequency
+// << " >> => replace by << " << 10 * mSaveFrequency << " >> !!!"
+// << std::endl;
+//AVM_ENDIF_DEBUG_FLAG( CONFIGURING )
+//
+// mSavePoint = mSaveFrequency = 10 * mSaveFrequency;
+// }
+
+ mEvalStepLimit = Query::getRegexWPropertySizeT(thePROPERTY,
+ OR_WID2(SUFFIX_WID("(run|eval)", "step"), "step"),
+ AVM_NUMERIC_MAX_SIZE_T, AVM_NUMERIC_MAX_SIZE_T);
+
+ mNodeHeightLimit = Query::getRegexWPropertySizeT(
+ thePROPERTY, PREFIX_WID("node", "height"),
+ AVM_NUMERIC_MAX_SIZE_T, AVM_NUMERIC_MAX_SIZE_T);
+
+ mNodeWidthLimit = Query::getRegexWPropertySizeT(
+ thePROPERTY, PREFIX_WID("node", "width"),
+ AVM_NUMERIC_MAX_SIZE_T, AVM_NUMERIC_MAX_SIZE_T);
+ }
+
+
+ WObject * theEXTENDER = Query::getRegexWSequence(
+ getParameterWObject(), OR_WID2("extender", "EXTENDER"));
+ if( (theEXTENDER != WObject::_NULL_) && theEXTENDER->hasOwnedElement() )
+ {
+ // Configuration of TRACE
+ TraceFactory traceFactory(getConfiguration(), ENV,
+ getParameterWObject(), &mLocalExecutableForm);
+
+ if( not traceFactory.configure(theEXTENDER, & mTraceObjective) )
+ {
+ return( false );
+ }
+ }
+
+ return( mConfigFlag );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// PROCESSING API
+////////////////////////////////////////////////////////////////////////////////
+/**
+ * POST PROCESS
+ */
+bool MainProcessorUnit::collectExtendedContext()
+{
+ ListOfExecutionContext potentialInputEC;
+ potentialInputEC.splice( getConfiguration().getInputContext() );
+
+ ListOfExecutionContext::const_iterator it = potentialInputEC.begin();
+ ListOfExecutionContext::const_iterator itEnd = potentialInputEC.end();
+ for( ; it != itEnd ; ++it )
+ {
+ collectContext(getConfiguration().getInputContext(), *(*it));
+ }
+
+ return( true );
+}
+
+
+void MainProcessorUnit::collectContext(
+ ListOfExecutionContext & inputContext, ExecutionContext & anEC)
+{
+ if( anEC.hasChildContext() )
+ {
+ ExecutionContext::rw_child_iterator it = anEC.begin();
+ ExecutionContext::rw_child_iterator itEnd = anEC.end();
+ for( ; it != itEnd ; ++it )
+ {
+ collectContext(inputContext, *(*it));
+ }
+ }
+ // case of leaf EC
+ else if( anEC.hasFlags() || anEC.hasInfo() )
+ {
+ if( MainProcessorUnit::cleanFlagsIfReexecutable(anEC) )
+ {
+ appendIfRequiredExtension(inputContext, anEC);
+ }
+ }
+ else
+ {
+ appendIfRequiredExtension(inputContext, anEC);
+ }
+}
+
+
+void MainProcessorUnit::appendIfRequiredExtension(
+ ListOfExecutionContext & inputContext, ExecutionContext & anEC)
+{
+ if( mTraceObjective.nonempty()
+ && mTraceChecker.isSat(anEC, mTraceObjective) )
+ {
+ anEC.getwFlags().addCoverageElementTrace();
+
+// TODO Create Info using the AvmCode of the mTraceObjective
+ anEC.addInfo(*this,
+ mTraceObjective.singleton()
+ ? mTraceObjective.first()
+ : mTraceObjective.first() );
+
+ anEC.getwFlags().addObjectiveAchievedTrace();
+ }
+ else
+ {
+ inputContext.append(& anEC);
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// FILTERING API
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * preEval Filter
+ */
+bool MainProcessorUnit::prefilter()
+{
+ ecQueue = &( getExecutionQueue().getReadyQueue() );
+ ecQueueItEnd = ecQueue->end();
+ for( ecQueueIt = ecQueue->begin() ; ecQueueIt != ecQueueItEnd ; )
+ {
+ if( not prefilter(* (*ecQueueIt)) )
+ {
+ getExecutionQueue().appendFailed( *ecQueueIt );
+
+ ecQueueIt = ecQueue->erase(ecQueueIt);
+ }
+ else
+ {
+ ++ecQueueIt;
+ }
+ }
+
+ return( getExecutionQueue().hasReady() );
+}
+
+
+bool MainProcessorUnit::prefilter(ExecutionContext & anEC)
+{
+ avm_uint32_t theNextEvalNumber = getSymbexDispatcher().getEvalNumber();
+
+ if( (not mInconditionalStopMarkerFlag)
+ && (not mInconditionalStopMarkerLocation.empty())
+ && ((theNextEvalNumber % mInconditionalStopMarkerCheckingPeriod) == 0) )
+ {
+ checkReadEvalStopScript();
+ }
+
+ if( mInconditionalStopMarkerFlag )
+ {
+ anEC.getwFlags().setInterruptUserRequest();
+
+ return( false );
+ }
+
+
+ if( (mEvalStepLimit > theNextEvalNumber)
+
+// && (mNodeCountLimit >= anEC.getIdNumber())
+ && (mNodeCountLimit >= ExecutionContextHeader::ID_NUMBER)
+
+ && (mNodeHeightLimit >= anEC.getHeight())
+ && (mNodeWidthLimit >= anEC.getWidth()) )
+ {
+ if( theNextEvalNumber > mReportPoint )
+ {
+ AVM_OS_INFO << EOL << EMPHASIS("Report Point ...", '*', 80);
+ getControllerUnitManager().report( AVM_OS_TRACE );
+ getControllerUnitManager().report( AVM_OS_COUT );
+ getControllerUnitManager().report( AVM_OS_LOG );
+
+ mReportPoint = mReportPoint + mReportFrequency;
+ }
+
+ if( theNextEvalNumber > mSavePoint )
+ {
+ AVM_OS_WARN << EMPHASIS("Save Point ...", '*', 80);
+
+ getConfiguration().serializeComputingResult();
+
+ mSavePoint = mSavePoint + mSaveFrequency;
+ }
+ return( true );
+ }
+ else
+ {
+ ++mStopCount;
+
+ if( mEvalStepLimit <= theNextEvalNumber )
+ {
+ anEC.getwFlags().addReachedSymbexStepLimit();
+ }
+
+// if( mNodeCountLimit < anEC.getIdNumber() )
+ if( mNodeCountLimit < ExecutionContextHeader::ID_NUMBER )
+ {
+ anEC.getwFlags().addReachedNodeCountLimit();
+ }
+
+ if( mNodeHeightLimit < anEC.getHeight() )
+ {
+ anEC.getwFlags().addReachedNodeHeightLimit();
+ }
+ if( mNodeWidthLimit < anEC.getWidth() )
+ {
+ anEC.getwFlags().addReachedNodeWidthLimit();
+ }
+
+ return( false );
+ }
+}
+
+
+bool MainProcessorUnit::finalizePrefiltering()
+{
+// ecQueue = &( getExecutionQueue().getReadyQueue() );
+// ecQueueItEnd = ecQueue->end();
+// for( ecQueueIt = ecQueue->begin() ; ecQueueIt != ecQueueItEnd ; )
+// {
+// setContextWidth( *ecQueueIt );
+//
+// if( (*ecQueueIt)->getWidth() > mNodeWidthLimit )
+// {
+// (*ecQueueIt)->getwFlags().addReachedNodeWidthLimit();
+// (*ecQueueIt)->addInfo(*this, INFO_STOP_WIDTH_DATA);
+//
+// getExecutionQueue().appendFailed( *ecQueueIt );
+//
+// ecQueueIt = ecQueue->erase(ecQueueIt);
+// }
+// else
+// {
+// ++ecQueueIt;
+// }
+// }
+//
+// return( getExecutionQueue().hasReady() );
+
+ return( true );
+}
+
+
+/**
+ * postFilter
+ * Every post filter has to implement this method
+ */
+bool MainProcessorUnit::postfilter()
+{
+ ecQueue = &( getExecutionQueue().getResultQueue() );
+ ecQueueItEnd = ecQueue->end();
+ for( ecQueueIt = ecQueue->begin() ; ecQueueIt != ecQueueItEnd ; )
+ {
+ if( postfilter(* (*ecQueueIt)) )
+ {
+ ptrEC = (*ecQueueIt);
+ ++ecQueueIt;
+
+ switch( ptrEC->refExecutionData().getAEES() )
+ {
+ case AEES_OK:
+ case AEES_STMNT_NOTHING:
+ case AEES_STEP_MARK:
+ {
+ break;
+ }
+
+ case AEES_STMNT_FINAL:
+ {
+ APExecutionData & apED = ptrEC->getAPExecutionData();
+ if( not apED->isFinalized(apED->getSystemRID()) )
+ {
+ apED.mwsetAEES( AEES_OK );
+ }
+ break;
+ }
+
+ case AEES_STMNT_DESTROY:
+ {
+ APExecutionData & apED = ptrEC->getAPExecutionData();
+ if( not apED->isDestroyed(apED->getSystemRID()) )
+ {
+ apED.mwsetAEES( AEES_OK );
+ }
+ break;
+ }
+
+ case AEES_STMNT_EXIT:
+ {
+ break;
+ }
+
+ case AEES_STMNT_EXIT_ALL:
+ {
+ mInconditionalStopMarkerFlag = true;
+
+ ptrEC->getwFlags().setInterruptUserRequest();
+
+ break;
+ }
+
+ case AEES_STMNT_FATAL_ERROR:
+ {
+ mInconditionalStopMarkerFlag = true;
+
+ ptrEC->getwFlags().setExecutionFatalErrorTrace();
+
+ break;
+ }
+
+ case AEES_SYMBOLIC_EXECUTION_LIMITATION:
+ {
+ ptrEC->getwFlags().setExecutionSymbexLimitationTrace();
+
+ break;
+ }
+
+ case AEES_WAITING_INCOM_RDV:
+ case AEES_WAITING_OUTCOM_RDV:
+ {
+ // TODO !!! PAS NORMAL !!!
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected << WAITING_??COM_RDV >> "
+ "ENDIND EXECUTION STATUS !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+
+ case AEES_WAITING_JOIN_FORK:
+ {
+ break;
+ }
+
+ case AEES_STMNT_BREAK:
+ case AEES_STMNT_CONTINUE:
+ case AEES_STMNT_RETURN:
+ {
+ // TODO !!! PAS NORMAL !!!
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS :> "
+ << RuntimeDef::strAEES(
+ ptrEC->getExecutionData()->mAEES) << " !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS :> "
+ << RuntimeDef::strAEES(
+ ptrEC->getExecutionData()->mAEES) << " !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+ }
+ else
+ {
+ getExecutionQueue().appendFailed( *ecQueueIt );
+
+ ecQueueIt = ecQueue->erase(ecQueueIt);
+ }
+ }
+
+ return( getExecutionQueue().hasResult() );
+}
+
+
+bool MainProcessorUnit::postfilter(ExecutionContext & anEC)
+{
+// if( SolverFactory::solveParameters(anEC.getAPExecutionData()) )
+// {
+// AVM_OS_TRACE << "SolverFactory::solveParameters for "
+// << anEC.str_min() << std::endl << "Condition :> "
+// << anEC.getAPExecutionData()->getAllPathCondition().str()
+// << std::endl;
+// anEC.getAPExecutionData()->getParametersRuntimeForm()->toStreamData(
+// anEC.getAPExecutionData(), AVM_OS_TRACE, "\t");
+// }
+
+ // STAT for an EFFECTIVE EVAL CONTEXT
+ if( anEC.getHeight() > mMaxReachHeight )
+ {
+ mMaxReachHeight = anEC.getHeight();
+ }
+ if( anEC.getWidth() > mMaxReachWidth )
+ {
+ mMaxReachWidth = anEC.getWidth();
+ }
+
+ // STAT for an EFFECTIVE CONSTRUCT CONTEXT
+// ecEnd = anEC.end();
+// for( ecIt = anEC.begin() ; ecIt != ecEnd ; ++ecIt )
+// {
+// if( (*ecIt)->getHeight() > mMaxReachHeight )
+// {
+// mMaxReachHeight = (*ecIt)->getHeight();
+// }
+// if( (*ecIt)->getWidth() > mMaxReachWidth )
+// {
+// mMaxReachWidth = (*ecIt)->getWidth();
+// }
+// }
+
+ if( anEC.noChildContext() )
+ {
+ ++mDeadlockCount;
+
+ anEC.getwFlags().setExecutionDeadlockTrace();
+ }
+ else if( anEC.singleChildContext()
+ && (anEC.getExecutionData()
+ == anEC.firstChildContext()->getExecutionData()) )
+ {
+ ++mLivelockCount;
+
+ anEC.getwFlags().setExecutionLivelockTrace();
+ }
+ else
+ {
+ ecChildItEnd = anEC.end();
+ for( ecChildIt = anEC.begin() ; ecChildIt != ecChildItEnd ; ++ecChildIt )
+ {
+ ptrEC = (*ecChildIt);
+
+ switch( ptrEC->refExecutionData().getAEES() )
+ {
+ case AEES_STEP_MARK:
+ {
+ ptrEC->getwFlags().setExecutionStepMarkTrace();
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+ }
+ }
+
+ return( true );
+}
+
+
+bool MainProcessorUnit::finalizePostfiltering()
+{
+ childEC.clear();
+
+ ecQueue = &( getExecutionQueue().getResultQueue() );
+ while( ecQueue->nonempty() )
+ {
+ ecQueue->pop_first_to( ptrEC );
+
+ ecChildIt = ptrEC->begin();
+ ecChildItEnd = ptrEC->end();
+ for( ; ecChildIt != ecChildItEnd ; ++ecChildIt )
+ {
+ switch( (*ecChildIt)->refExecutionData().getAEES() )
+ {
+ case AEES_OK:
+ case AEES_STEP_MARK:
+ case AEES_WAITING_JOIN_FORK:
+ {
+ setContextWidth( *ecChildIt );
+
+ childEC.append( *ecChildIt );
+
+ break;
+ }
+
+ case AEES_STMNT_NOTHING:
+ {
+ if( ecChildIt == ptrEC->begin() )
+ {
+ /*ecChildIt =*/ ptrEC->eraseChildContext( ecChildIt );
+ }
+ else
+ {
+ ecChildIt = ptrEC->eraseChildContext( ecChildIt );
+
+ --ecChildIt;
+ }
+
+ break;
+ }
+
+ case AEES_STMNT_EXIT:
+ {
+ ++mStatementExitCount;
+
+ setContextWidth( *ecChildIt );
+
+ (*ecChildIt)->getwFlags().setExecutionStatementExitTrace();
+
+ break;
+ }
+
+ case AEES_STMNT_EXIT_ALL:
+ {
+ ++mStatementExitCount;
+ mInconditionalStopMarkerFlag = true;
+
+ setContextWidth( *ecChildIt );
+
+ ptrEC->getwFlags().setInterruptUserRequest();
+
+ break;
+ }
+
+ case AEES_STMNT_FATAL_ERROR:
+ {
+ ++mStatementFatalErrorCount;
+
+ ptrEC->getwFlags().setExecutionFatalErrorTrace();
+
+ break;
+ }
+
+ case AEES_SYMBOLIC_EXECUTION_LIMITATION:
+ {
+ ++mSymbolicExecutionLimitationCount;
+
+ ptrEC->getwFlags().setExecutionSymbexLimitationTrace();
+
+ break;
+ }
+
+
+ case AEES_WAITING_INCOM_RDV:
+ case AEES_WAITING_OUTCOM_RDV:
+
+ case AEES_STMNT_FINAL:
+ case AEES_STMNT_DESTROY:
+
+ case AEES_STMNT_BREAK:
+ case AEES_STMNT_CONTINUE:
+ case AEES_STMNT_RETURN:
+ {
+ // TODO !!! PAS NORMAL !!!
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS :> "
+ << RuntimeDef::strAEES( (*ecChildIt)->
+ getExecutionData()->mAEES ) << " !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ENDIND EXECUTION STATUS << "
+ << RuntimeDef::strAEES( (*ecChildIt)->
+ getExecutionData()->mAEES ) << " >> !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ }
+
+ getExecutionQueue().pushWaitingChild( childEC );
+
+ childEC.clear();
+ }
+
+ return( true );
+}
+
+
+
+void MainProcessorUnit::setContextWidth(ExecutionContext * anEC)
+{
+ // STAT after EVAL for WIDTH
+ if( anEC->hasContainer() && anEC->getContainer()->hasChildContext() )
+ {
+ if( (anEC->getContainer()->firstChildContext() == anEC) )
+ {
+ anEC->setWidth( anEC->getContainer()->getWidth() );
+ }
+ else
+ {
+ anEC->setWidth( getSymbexDispatcher().nextGlobalGraphWidth() );
+ }
+ }
+}
+
+
+
+/**
+ * MAIN PROCESSOR
+ * REPORT
+ */
+void MainProcessorUnit::reportSilent(OutStream & os) const
+{
+ if( mDeadlockCount > 0 )
+ {
+ os << EOL_TAB2 << "The DEADLOCK found : " << mDeadlockCount << EOL;
+ }
+ if( mLivelockCount > 0 )
+ {
+ os << TAB2 << "The LIVELOCK found : " << mLivelockCount << EOL;
+ }
+
+ if( mStatementExitCount > 0 )
+ {
+ os << TAB2 << "The RUN#EXIT count : " << mStatementExitCount << EOL;
+ }
+
+ if( mStatementFatalErrorCount > 0 )
+ {
+ os << TAB2 << "The FATAL#ERROR count : "
+ << mStatementFatalErrorCount << EOL;
+ }
+ if( mSymbolicExecutionLimitationCount > 0 )
+ {
+ os << TAB2 << "The SYMB#LIMIT count : "
+ << mSymbolicExecutionLimitationCount << EOL;
+ }
+
+ os << std::flush;
+}
+
+void MainProcessorUnit::reportMinimum(OutStream & os) const
+{
+ reportHeader(os, "STOP CRITERIA ");
+
+ os << TAB2 << "The CONTEXT count : "
+ << ExecutionContextHeader::ID_NUMBER << EOL;
+
+ os << TAB2 << "The RUN STEP count : "
+ << getSymbexDispatcher().getEvalNumber() << EOL << EOL;
+
+ os << TAB2 << "The Max HEIGHT reaching : " << mMaxReachHeight << EOL;
+
+ os << TAB2 << "The Max WIDTH reaching : " << mMaxReachWidth << EOL;
+
+ if( mDeadlockCount > 0 )
+ {
+ os << EOL_TAB2 << "The DEADLOCK found : " << mDeadlockCount << EOL;
+ }
+ if( mLivelockCount > 0 )
+ {
+ os << TAB2 << "The LIVELOCK found : " << mLivelockCount << EOL;
+ }
+
+ if( mStatementExitCount > 0 )
+ {
+ os << TAB2 << "The RUN#EXIT count : " << mStatementExitCount << EOL;
+ }
+
+ if( mStatementFatalErrorCount > 0 )
+ {
+ os << TAB2 << "The FATAL#ERROR count : "
+ << mStatementFatalErrorCount << EOL;
+ }
+ if( mSymbolicExecutionLimitationCount > 0 )
+ {
+ os << TAB2 << "The SYMB#LIMIT count : "
+ << mSymbolicExecutionLimitationCount << EOL;
+ }
+
+ os << std::flush;
+}
+
+
+void MainProcessorUnit::reportDefault(OutStream & os) const
+{
+ reportHeader(os, "STOP CRITERIA ");
+
+ os << TAB2 << "The CONTEXT count : "
+ << ExecutionContextHeader::ID_NUMBER << EOL << EOL;
+
+ os << TAB2 << "The RUN STEP count : "
+ << getSymbexDispatcher().getEvalNumber() << EOL;
+
+ os << TAB2 << "The GLOBAL STOP count : " << mStopCount << EOL << EOL;
+
+ os << TAB2 << "The Max HEIGHT reaching : " << mMaxReachHeight << EOL;
+
+ os << TAB2 << "The Max WIDTH reaching : " << mMaxReachWidth << EOL;
+
+ if( mDeadlockCount > 0 )
+ {
+ os << EOL_TAB2 << "The DEADLOCK found : " << mDeadlockCount << EOL;
+ }
+ if( mLivelockCount > 0 )
+ {
+ os << TAB2 << "The LIVELOCK found : " << mLivelockCount << EOL;
+ }
+ if( mStatementExitCount > 0 )
+ {
+ os << TAB2 << "The RUN#EXIT count : " << mStatementExitCount << EOL;
+ }
+
+ if( mStatementFatalErrorCount > 0 )
+ {
+ os << TAB2 << "The FATAL#ERROR count : "
+ << mStatementFatalErrorCount << EOL;
+ }
+ if( mSymbolicExecutionLimitationCount > 0 )
+ {
+ os << TAB2 << "The SYMB#LIMIT count : "
+ << mSymbolicExecutionLimitationCount << EOL;
+ }
+
+ AvmCommunicationRdvPrimitive::reportGlobalStatistics( os );
+
+ os << std::flush;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// NON-REGRESSION TEST API
+////////////////////////////////////////////////////////////////////////////////
+
+void MainProcessorUnit::tddRegressionReportImpl(OutStream & os)
+{
+// os << TAB << "CONTEXT count : "
+// << ExecutionContextHeader::ID_NUMBER << EOL;
+
+ os << TAB << "RUN STEP count : " << getSymbexDispatcher().getEvalNumber()
+ << EOL_FLUSH;
+}
+
+
+/**
+ * EVAL TRACE
+ */
+
+static int EVAL_STEP_CURRENT_WIDTH = 3;
+static int NODE_COUNT_CURRENT_WIDTH = 3;
+
+static int NODE_HEIGHT_CURRENT_WIDTH = 3;
+static int NODE_WIDTH_CURRENT_WIDTH = 3;
+
+
+static inline avm_size_t POW10( int n )
+{
+ switch( n )
+ {
+ case 3 : return( 1000 );
+ case 4 : return( 10000 );
+ case 5 : return( 100000 );
+ case 6 : return( 1000000 );
+ case 7 : return( 10000000 );
+ default: return( static_cast<avm_size_t>( std::pow(10, n) ) );
+ }
+}
+
+
+static inline std::string traceBound(avm_size_t limit, int width)
+{
+ std::ostringstream oss;
+ if( limit < AVM_NUMERIC_MAX_SIZE_T )
+ {
+ ( (limit < POW10(width))? oss << std::setw(width) : oss ) << limit;
+ }
+ else
+ {
+ oss << "+oo";
+ }
+
+ return( oss.str() );
+}
+
+
+void MainProcessorUnit::traceBoundEval(OutStream & os) const
+{
+ boost::format formatter(mBoundEvalTraceFormatter);
+ formatter.exceptions( boost::io::no_error_bits );
+
+// formatter.exceptions( boost::io::all_error_bits ^
+// ( boost::io::too_many_args_bit | boost::io::too_few_args_bit ) );
+
+ os << TAB << formatter
+ % traceBound(mEvalStepLimit , EVAL_STEP_CURRENT_WIDTH)
+ % traceBound(mNodeCountLimit , NODE_COUNT_CURRENT_WIDTH)
+ % traceBound(mNodeHeightLimit, NODE_HEIGHT_CURRENT_WIDTH)
+ % traceBound(mNodeWidthLimit , NODE_WIDTH_CURRENT_WIDTH)
+ << std::flush;
+}
+
+
+static inline std::string currentTrace(avm_size_t count, int & width)
+{
+ std::ostringstream oss;
+
+ oss << std::setw( ( count < POW10(width) )? width : ++width ) << count;
+
+ return( oss.str() );
+}
+
+
+//!! Warning: Unused static function
+//static std::string traceElement(avm_size_t count, avm_size_t limit, int width)
+//{
+// std::ostringstream oss;
+// oss << std::setw( width ) << count;
+// if( limit < AVM_NUMERIC_MAX_SIZE_T )
+// {
+// oss << " / " << std::setw( width ) << limit;
+// }
+//
+// return( oss.str() );
+//}
+
+
+void MainProcessorUnit::traceMinimumPreEval(
+ OutStream & os, const ExecutionContext & anEC) const
+{
+ boost::format formatter(mPreEvalTraceFormatter);
+ formatter.exceptions( boost::io::no_error_bits );
+
+// formatter.exceptions( boost::io::all_error_bits ^
+// ( boost::io::too_many_args_bit | boost::io::too_few_args_bit ) );
+
+// os << TAB << formatter
+// % traceElement(anEC->getEvalNumber(), mEvalStepLimit , 5)
+// % traceElement(anEC->getIdNumber() , mNodeNodeLimit , 6)
+// % traceElement(anEC->getHeight() , mNodeHeightLimit, 5)
+// % traceElement(anEC->getWidth() , mNodeWidthLimit , 5)
+
+ os << TAB << formatter
+ % currentTrace(anEC.getEvalNumber(), EVAL_STEP_CURRENT_WIDTH)
+ % currentTrace(anEC.getIdNumber() , NODE_COUNT_CURRENT_WIDTH)
+ % currentTrace(anEC.getHeight() , NODE_HEIGHT_CURRENT_WIDTH)
+ % currentTrace(anEC.getWidth() , NODE_WIDTH_CURRENT_WIDTH)
+ << std::flush;
+}
+
+
+void MainProcessorUnit::traceDefaultPreEval(
+ OutStream & os, const ExecutionContext & anEC) const
+{
+ os << TAB << DEFAULT_WRAP_DATA << "E[" << std::setw(4)
+ << anEC.getEvalNumber() << "] " << anEC.str_min()
+ << END_WRAP_EOL;
+}
+
+
+void MainProcessorUnit::traceMinimumPostEval(
+ OutStream & os, const ExecutionContext & anEC) const
+{
+ //!! NOTHING
+}
+
+void MainProcessorUnit::traceDefaultPostEval(
+ OutStream & os, const ExecutionContext & anEC) const
+{
+ anEC.traceDefaultPostEval( os << DEFAULT_WRAP_DATA );
+
+ os << END_WRAP;
+}
+
+
+void MainProcessorUnit::reportEval(OutStream & os) const
+{
+ boost::format formatter(mReportEvalTraceFormatter);
+ formatter.exceptions( boost::io::no_error_bits );
+
+// formatter.exceptions( boost::io::all_error_bits ^
+// ( boost::io::too_many_args_bit | boost::io::too_few_args_bit ) );
+
+// os << TAB << formatter
+// % traceElement(getSymbexDispatcher().getEvalNumber(), mEvalStepLimit, 5)
+//
+// % traceElement(ExecutionContext::getCreateCounter(), mNodeCountLimit, 6)
+//
+// % traceElement(mMaxReachHeight , mHeightLimit, 6)
+// % traceElement(mMaxReachWidth , mWidthLimit , 6)
+
+ os << TAB << formatter
+ % currentTrace( getSymbexDispatcher().getEvalNumber(),
+ EVAL_STEP_CURRENT_WIDTH)
+
+ % currentTrace(ExecutionContext::getCreateCounter(),
+ NODE_COUNT_CURRENT_WIDTH)
+
+ % currentTrace(mMaxReachHeight, NODE_HEIGHT_CURRENT_WIDTH)
+ % currentTrace(mMaxReachWidth , NODE_WIDTH_CURRENT_WIDTH)
+ << std::flush;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// DEBUG PROCESSING API
+////////////////////////////////////////////////////////////////////////////////
+
+bool MainProcessorUnit::debugEvalCommandImpl()
+{
+ return( false );
+}
+
+
+void MainProcessorUnit::checkReadEvalStopScript()
+{
+ std::ifstream anInconditionalStopMarkerStream(
+ mInconditionalStopMarkerLocation.c_str() );
+
+ if( anInconditionalStopMarkerStream.good() )
+ {
+ mInconditionalStopMarkerFlag = true;
+
+ if( isDebugScript(anInconditionalStopMarkerStream) )
+ {
+ mInconditionalStopMarkerFlag = false;
+
+ debugReadEvalScript(anInconditionalStopMarkerStream);
+ }
+ }
+
+ anInconditionalStopMarkerStream.close();
+
+ if( mInconditionalStopMarkerFlag )
+ {
+ AVM_OS_WARN << EMPHASIS("UNCONDITIONAL STOP !!!");
+
+ ++mStopCount;
+
+ getSymbexRequestManager().postRequestStop( this );
+ }
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fam/api/MainProcessorUnit.h b/org.eclipse.efm.symbex/src/fam/api/MainProcessorUnit.h
new file mode 100644
index 0000000..85d0a8b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/api/MainProcessorUnit.h
@@ -0,0 +1,312 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef MAINPROCESSORUNIT_H_
+#define MAINPROCESSORUNIT_H_
+
+#include <fam/api/AbstractProcessorUnit.h>
+#include <fam/debug/IDebugProcessorProvider.h>
+
+#include <common/AvmPointer.h>
+#include <common/BF.h>
+
+#include <fml/builtin/Identifier.h>
+#include <fml/executable/ExecutableForm.h>
+#include <fml/expression/AvmCode.h>
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/trace/TraceChecker.h>
+
+#include <sew/Configuration.h>
+
+
+namespace sep
+{
+
+
+class MainProcessorUnit :
+// public AvmCloneableClass< MainProcessorUnit >,
+ public AutoRegisteredProcessorUnit< MainProcessorUnit >,
+ public IDebugProcessorProvider
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( MainProcessorUnit )
+
+
+ /**
+ * MAIN PROCESSOR FACTORY
+ * for automatic registration in the processor repository
+ * the [ [ FULLY ] QUALIFIED ] NAME ID
+ */
+ AVM_INJECT_AUTO_REGISTER_QUALIFIED_ID_KEY_3(
+ "supervisor",
+ "avm::processor.MAIN",
+ "avm::core.filter.STOP_CRITERIA" )
+ // end registration
+
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ avm_size_t mNodeCountLimit;
+ avm_size_t mEvalStepLimit;
+ avm_size_t mNodeHeightLimit;
+ avm_size_t mNodeWidthLimit;
+
+ avm_size_t mReportFrequency;
+ avm_size_t mReportPoint;
+
+ avm_size_t mSaveFrequency;
+ avm_size_t mSavePoint;
+
+ avm_size_t mStopCount;
+
+ avm_size_t mDeadlockCount;
+ avm_size_t mLivelockCount;
+
+ avm_size_t mStatementExitCount;
+
+ avm_size_t mStatementFatalErrorCount;
+ avm_size_t mSymbolicExecutionLimitationCount;
+
+ avm_size_t mMaxReachHeight;
+ avm_size_t mMaxReachWidth;
+
+ std::string mInconditionalStopMarkerLocation;
+ avm_size_t mInconditionalStopMarkerCheckingPeriod;
+
+ bool mInconditionalStopMarkerFlag;
+
+ // Execution extension trace filter
+ ExecutableForm mLocalExecutableForm;
+
+ AvmCode mTraceObjective;
+
+ TraceChecker mTraceChecker;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing Variables
+ ExecutionContext * ptrEC;
+
+ ListOfExecutionContext childEC;
+
+
+public:
+
+ MainProcessorUnit(SymbexControllerUnitManager & aManager,
+ WObject * wfParameterObject = NULL)
+ : RegisteredProcessorUnit(aManager,
+ wfParameterObject, PRECEDENCE_OF_MAIN_PROCESSOR),
+ IDebugProcessorProvider( this ),
+
+ mNodeCountLimit ( AVM_NUMERIC_MAX_SIZE_T ),
+ mEvalStepLimit ( AVM_NUMERIC_MAX_SIZE_T ),
+ mNodeHeightLimit( AVM_NUMERIC_MAX_SIZE_T ),
+ mNodeWidthLimit ( AVM_NUMERIC_MAX_SIZE_T ),
+
+ mReportFrequency( AVM_NUMERIC_MAX_SIZE_T ),
+ mReportPoint( AVM_NUMERIC_MAX_SIZE_T ),
+
+ mSaveFrequency( AVM_NUMERIC_MAX_SIZE_T ),
+ mSavePoint( AVM_NUMERIC_MAX_SIZE_T ),
+
+ mStopCount( 0 ),
+
+ mDeadlockCount( 0 ),
+ mLivelockCount( 0 ),
+
+ mStatementExitCount( 0 ),
+
+ mStatementFatalErrorCount( 0 ),
+ mSymbolicExecutionLimitationCount( 0 ),
+
+ mMaxReachHeight( 1 ),
+ mMaxReachWidth( 1 ),
+
+ mInconditionalStopMarkerLocation(),
+ mInconditionalStopMarkerCheckingPeriod(AVM_NUMERIC_MAX_SIZE_T),
+
+ mInconditionalStopMarkerFlag( false ),
+
+ // Execution extension trace filter
+ mLocalExecutableForm( getConfiguration().getExecutableSystem() , 0 ),
+ mTraceObjective( OperatorManager::OPERATOR_OR ),
+ mTraceChecker( ENV, &mLocalExecutableForm ),
+
+////////////////////////////////////////////////////////////////////////////
+ // for local used
+ ptrEC( NULL ),
+ childEC( )
+ {
+ //!! NOTHING
+ }
+
+ virtual ~MainProcessorUnit()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * Return true if the EC is re-executable
+ * And clean the structural stop criteria info
+ * like EVAL, NODE, HEIGHT, WIDTH, ABSOLUTE_STOP_MARKER
+ */
+ inline static bool cleanFlagsIfReexecutable(ExecutionContext & anEC)
+ {
+ if( anEC.getFlags().isReexecutable() )
+ {
+ anEC.getwFlags().setReexecutable();
+
+ return( true );
+ }
+
+ return( false );
+ }
+
+
+ /**
+ * CONFIGURE
+ */
+ inline virtual std::string getDefaultPreEvalTraceFormatter() const
+ {
+ return( "\nstep:%1% , context:%2% , height:%3% , width:%4%" );
+ }
+
+ inline virtual std::string getDefaultPostEvalTraceFormatter() const
+ {
+ return( "\nstep:%1% , context:%2% , height:%3% , width:%4%" );
+ }
+
+
+ inline virtual std::string getDefaultBoundEvalTraceFormatter() const
+ {
+ return( "\nstep:%1% , context:%2% , height:%3% , width:%4%" );
+ }
+
+ inline virtual std::string getDefaultReportEvalTraceFormatter() const
+ {
+ return( "\nstop:%1% , context:%2% , height:%3% , width:%4%" );
+ }
+
+
+ bool configureImpl();
+
+
+ /**
+ * REPORT TRACE
+ */
+
+ virtual void reportSilent(OutStream & os) const;
+
+ virtual void reportMinimum(OutStream & os) const;
+
+ virtual void reportDefault(OutStream & os) const;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // NON-REGRESSION TEST API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual void tddRegressionReportImpl(OutStream & os);
+
+
+ /**
+ * EVAL TRACE
+ */
+ virtual void traceMinimumPreEval(
+ OutStream & os, const ExecutionContext & anEC) const;
+
+ virtual void traceDefaultPreEval(
+ OutStream & os, const ExecutionContext & anEC) const;
+
+
+ virtual void traceMinimumPostEval(
+ OutStream & os, const ExecutionContext & anEC) const;
+
+ virtual void traceDefaultPostEval(
+ OutStream & os, const ExecutionContext & anEC) const;
+
+
+ virtual void traceBoundEval(OutStream & os) const;
+
+ virtual void reportEval(OutStream & os) const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PROCESSING API
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * POST PROCESS
+ */
+ inline virtual bool preprocess()
+ {
+ if( mTraceObjective.nonempty() )
+ {
+ return( collectExtendedContext() );
+ }
+
+ return( true );
+ }
+
+
+ bool collectExtendedContext();
+
+ void collectContext(
+ ListOfExecutionContext & inputContext, ExecutionContext & anEC);
+
+ void appendIfRequiredExtension(
+ ListOfExecutionContext & inputContext, ExecutionContext & anEC);
+
+ inline virtual bool postprocess()
+ {
+ return( true );
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FILTERING API
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * preEval Filter
+ */
+ virtual bool prefilter();
+ virtual bool prefilter(ExecutionContext & anEC);
+
+ bool finalizePrefiltering();
+
+
+ /**
+ * postFilter
+ * Every post filter has to implement this method
+ */
+ virtual bool postfilter();
+ virtual bool postfilter(ExecutionContext & anEC);
+
+ bool finalizePostfiltering();
+
+ void setContextWidth(ExecutionContext * anEC);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DEBUG PROCESSING API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool debugEvalCommandImpl();
+
+ void checkReadEvalStopScript();
+
+};
+
+
+}
+
+#endif /*MAINPROCESSORUNIT_H_*/
diff --git a/org.eclipse.efm.symbex/src/fam/api/ProcessorUnitAutoRegistration.cpp b/org.eclipse.efm.symbex/src/fam/api/ProcessorUnitAutoRegistration.cpp
new file mode 100644
index 0000000..0baf2bd
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/api/ProcessorUnitAutoRegistration.cpp
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 3 mars 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ProcessorUnitAutoRegistration.h"
+
+#include <common/BF.h>
+
+#include <fam/api/ProcessorUnitRepository.h>
+
+#include <fml/workflow/WObject.h>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+IProcessorUnitRegistration::IProcessorUnitRegistration(
+ const std::string & aMainTypeID , const std::string & aTypeAliasID_1,
+ const std::string & aTypeAliasID_2, const std::string & aTypeAliasID_3)
+: mProcessorTypeID( aMainTypeID ),
+ mProcessorTypeAliasID_1( aTypeAliasID_1 ),
+ mProcessorTypeAliasID_2( aTypeAliasID_2 ),
+ mProcessorTypeAliasID_3( aTypeAliasID_3 )
+{
+ ProcessorUnitRepository::registerProcessorFactory(aMainTypeID, this);
+
+ if( not aTypeAliasID_1.empty() )
+ {
+ ProcessorUnitRepository::registerProcessorFactory(aTypeAliasID_1, this);
+ }
+ if( not aTypeAliasID_2.empty() )
+ {
+ ProcessorUnitRepository::registerProcessorFactory(aTypeAliasID_2, this);
+ }
+ if( not aTypeAliasID_3.empty() )
+ {
+ ProcessorUnitRepository::registerProcessorFactory(aTypeAliasID_3, this);
+ }
+}
+
+// API for ProcessorUnitRepository::register(...)
+bool IProcessorUnitRegistration::isTypeID(const WObject & wfObject) const
+{
+ return( isTypeID( wfObject.getQualifiedTypeNameID() ) );
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/api/ProcessorUnitAutoRegistration.h b/org.eclipse.efm.symbex/src/fam/api/ProcessorUnitAutoRegistration.h
new file mode 100644
index 0000000..7e1b8db
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/api/ProcessorUnitAutoRegistration.h
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 3 mars 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef PROCESSORUNITAUTOREGISTRATION_H_
+#define PROCESSORUNITAUTOREGISTRATION_H_
+
+#include <string>
+
+
+namespace sep
+{
+
+class OutStream;
+class BF;
+
+class WObject;
+
+class AbstractProcessorUnit;
+class SymbexControllerUnitManager;
+
+
+class IProcessorUnitRegistration
+{
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ std::string mProcessorTypeID;
+
+ // For deprecated Type Qualified Name/Alias ID
+ std::string mProcessorTypeAliasID_1;
+ std::string mProcessorTypeAliasID_2;
+ std::string mProcessorTypeAliasID_3;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ IProcessorUnitRegistration(const std::string & aMainTypeID,
+ const std::string & aTypeAliasID_1 = "",
+ const std::string & aTypeAliasID_2 = "",
+ const std::string & aTypeAliasID_3 = "");
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~IProcessorUnitRegistration()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // API for Processor Unit Registration
+ ////////////////////////////////////////////////////////////////////////////
+
+ // Equals Comparison
+ inline virtual bool isEquals(
+ const IProcessorUnitRegistration & aRegisterTool) const
+ {
+ return( this == (& aRegisterTool) );
+ }
+
+
+ // API for ProcessorUnitRepository::register(...)
+ inline const std::string & getTypeID() const
+ {
+ return( mProcessorTypeID );
+ }
+
+ inline bool isTypeID(const std::string & aTypeID) const
+ {
+ return( (not aTypeID.empty())
+ && ( (mProcessorTypeID == aTypeID)
+ || (mProcessorTypeAliasID_1 == aTypeID)
+ || (mProcessorTypeAliasID_2 == aTypeID)
+ || (mProcessorTypeAliasID_3 == aTypeID) ) );
+ }
+
+
+ bool isTypeID(const WObject & wfObject) const;
+
+ // API for ProcessorUnitRepository::create(...)
+ virtual AbstractProcessorUnit * newInstance(
+ SymbexControllerUnitManager & aControllerUnitManager,
+ WObject * wfParameterObject) = 0;
+
+};
+
+
+
+template< class ProcessorT >
+class ProcessorUnitRegistrationImpl : public IProcessorUnitRegistration
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ProcessorUnitRegistrationImpl(const std::string & aMainTypeID,
+ const std::string & aTypeAliasID_1 = "",
+ const std::string & aTypeAliasID_2 = "",
+ const std::string & aTypeAliasID_3 = "")
+ : IProcessorUnitRegistration(aMainTypeID,
+ aTypeAliasID_1, aTypeAliasID_2, aTypeAliasID_3)
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ProcessorUnitRegistrationImpl()
+ {
+ //!! NOTHING
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // API for ProcessorUnitRepository
+ ////////////////////////////////////////////////////////////////////////////
+
+ // API for ProcessorUnitRepository::create(...)
+ virtual AbstractProcessorUnit * newInstance(
+ SymbexControllerUnitManager & aControllerUnitManager,
+ WObject * wfParameterObject)
+ {
+ return( new ProcessorT(aControllerUnitManager, wfParameterObject) );
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* PROCESSORUNITAUTOREGISTRATION_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/api/ProcessorUnitFactory.cpp b/org.eclipse.efm.symbex/src/fam/api/ProcessorUnitFactory.cpp
new file mode 100644
index 0000000..19b0b00
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/api/ProcessorUnitFactory.cpp
@@ -0,0 +1,375 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 29 nov. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ProcessorUnitFactory.h"
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <fam/api/AbstractProcessorUnit.h>
+#include <fam/api/ProcessorUnitRepository.h>
+
+#include <fam/debug/AvmDebugProcessor.h>
+
+#include <sew/Workflow.h>
+#include <sew/SymbexControllerUnitManager.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CREATION
+////////////////////////////////////////////////////////////////////////////////
+
+AbstractProcessorUnit * ProcessorUnitFactory::create(
+ SymbexControllerUnitManager & aManager, WObject * wfProcessObject)
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( wfProcessObject )
+ << "Unexpected a <null> processor unit parameter WObject !!!"
+ << SEND_EXIT;
+
+ return( ProcessorUnitRepository::create(aManager, wfProcessObject) );
+}
+
+
+bool ProcessorUnitFactory::createList(
+ SymbexControllerUnitManager & aManager,
+ List< WObject * > & listOfProcessWObject)
+{
+ List< WObject * >::iterator it = listOfProcessWObject.begin();
+ List< WObject * >::iterator endIt = listOfProcessWObject.end();
+ for( ; it != endIt ; ++it )
+ {
+ AbstractProcessorUnit * tmpProcessor = create(aManager, (*it));
+
+ if( tmpProcessor != NULL )
+ {
+ aManager.append( tmpProcessor );
+ }
+ else
+ {
+ AVM_OS_ERROR_ALERT << "ProcessorUnitFactory::create:> "
+ "Unregistered Processor WObject Type ?" << std::endl
+ << str_header( *it )
+ << SEND_ALERT;
+
+ AVM_OS_WARN << incr_stream( *it );
+
+ return( false );
+ }
+ }
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+
+bool ProcessorUnitFactory::configure(
+ SymbexControllerUnitManager & aPluginProcessorManager,
+ WObject * wfDirectorObject, WObject * moeProfile)
+{
+ /////////////////////////////////////
+ // PROCESSORS CREATION
+ /////////////////////////////////////
+
+ // section worker / PROCESSOR
+ List< WObject * > listOfProcessWObject;
+ Query::getRegexWObjectInSequence(wfDirectorObject,
+ Workflow::SECTION_FAM_CONTAINERS_REGEX_ID, listOfProcessWObject);
+
+ if( not createList(aPluginProcessorManager, listOfProcessWObject) )
+ {
+ return( false );
+ }
+
+
+ /////////////////////////////////////
+ // WORKFLOW SCHEDULER INITIALIZATION
+ /////////////////////////////////////
+
+ if( not configureProcessorScheduler(AVM_PRE_PROCESSING_STAGE,
+ aPluginProcessorManager.getPreprocessor(),
+ Query::getRegexWPropertyValue(moeProfile,
+ CONS_WID2("pre", "process"), BF::REF_NULL)) )
+ {
+ AVM_OS_ERROR_ALERT
+ << "PreProcessorManager:> Configure preprocessor Failed !!!"
+ << SEND_ALERT;
+
+ return( false );
+ }
+
+ if( not configureProcessorScheduler(AVM_PRE_FILTERING_STAGE,
+ aPluginProcessorManager.getPrefilter(),
+ Query::getRegexWPropertyValue(moeProfile,
+ CONS_WID2("pre", "filter"), BF::REF_NULL)) )
+ {
+ AVM_OS_ERROR_ALERT << "ProcessorUnitFactory::configure:> "
+ "Configure prefilter Failed !!!"
+ << SEND_ALERT;
+
+ return( false );
+ }
+
+ if( not configureProcessorScheduler(AVM_POST_FILTERING_STAGE,
+ aPluginProcessorManager.getPostfilter(),
+ Query::getRegexWPropertyValue(moeProfile,
+ CONS_WID2("post", "filter"), BF::REF_NULL)) )
+ {
+ AVM_OS_ERROR_ALERT << "ProcessorUnitFactory::configure:> "
+ "Configure postfilter Failed !!!"
+ << SEND_ALERT;
+
+ return( false );
+ }
+
+ if( not configureProcessorScheduler(AVM_POST_PROCESSING_STAGE,
+ aPluginProcessorManager.getPostprocessor(),
+ Query::getRegexWPropertyValue(moeProfile,
+ CONS_WID2("post", "process"), BF::REF_NULL)) )
+ {
+ AVM_OS_ERROR_ALERT << "ProcessorUnitFactory::configure:> "
+ "Configure postprocessor Failed !!!"
+ << SEND_ALERT;
+
+ return( false );
+ }
+
+
+ /////////////////////////////////////
+ // PROCESSORS CONFIGURE
+ /////////////////////////////////////
+
+ if( not aPluginProcessorManager.configureControllerUnits() )
+ {
+ AVM_OS_WARN << "ProcessorUnitFactory::configure:> Failed !!!"
+ << std::endl;
+
+ return( false );
+ }
+
+/*
+ * NEW CONSISE SYNTAX
+supervisor {
+ limit 'of graph exploration' [
+ eval = 10
+ ...
+ ]
+ queue 'for graph exploration' [
+ strategy = 'BFS'
+ ...
+ ]
+ console [
+ format = "\nstep:%1% , context:%2% , height:%3% , width:%4%"
+ ...
+ ]
+}
+*/
+ /////////////////////////////////////
+ // MAIN PROCESSOR CONFIGURE
+ /////////////////////////////////////
+
+ MainProcessorUnit & theMainProcessor =
+ aPluginProcessorManager.getMainProcessor();
+
+ if( not theMainProcessor.hasParameterWObject() )
+ {
+ theMainProcessor.setParameterWObject(
+ Query::getRegisterWObject(wfDirectorObject,
+ MainProcessorUnit::AUTO_REGISTER_TOOL) );
+ }
+
+ if( not theMainProcessor.configure() )
+ {
+ AVM_OS_WARN << "ProcessorUnitFactory::configure:> Failed to "
+ "configure the default stop processor << "
+ << theMainProcessor.getParameterWObject()->getFullyQualifiedNameID()
+ << " >> " << std::endl;
+
+ return( false );
+ }
+
+
+ /////////////////////////////////////
+ // QUEUE PROCESSOR CONFIGURE
+ /////////////////////////////////////
+
+ ExecutionQueue & theQueueProcessor =
+ aPluginProcessorManager.getExecutionQueue();
+
+ WObject * queueWObject = Query::getRegexWObjectByNameID(
+ theMainProcessor.getParameterWObject(),
+ Workflow::SECTION_FAM_QUEUE_REGEX_ID, WObject::_NULL_);
+
+ if( queueWObject != WObject::_NULL_ )
+ {
+ queueWObject = theMainProcessor.getParameterWObject();
+ }
+ else
+ {
+ queueWObject = Query::getWPropertyWReference(
+ theMainProcessor.getParameterWObject(),
+ "queue", WObject::_NULL_);
+ if( queueWObject == WObject::_NULL_ )
+ {
+ //!! DEPRECATED
+ queueWObject = Query::getWPropertyWReference(
+ moeProfile, "queue", WObject::_NULL_);
+ if( queueWObject == WObject::_NULL_ )
+ {
+ queueWObject = Query::getRegisterWObject(moeProfile,
+ ExecutionQueue::AUTO_REGISTER_TOOL);
+ }
+ }
+ }
+
+ if( queueWObject != WObject::_NULL_ )
+ {
+ theQueueProcessor.setParameterWObject( queueWObject );
+ }
+
+ if( theQueueProcessor.hasParameterWObject() )
+ {
+ if( not theQueueProcessor.configureImpl() )
+ {
+ AVM_OS_WARN << "ProcessorUnitFactory::configure:> Failed to "
+ "configure the default queue processor << "
+ << theQueueProcessor
+ .getParameterWObject()->getFullyQualifiedNameID()
+ << " >> " << std::endl;
+
+ return( false );
+ }
+ }
+ else
+ {
+ AVM_OS_WARN << "ProcessorUnitFactory::configure:> Failed to "
+ "configure the default queue processor with a null wfObject !"
+ << std::endl;
+
+ return( false );
+ }
+
+
+ /////////////////////////////////////
+ // REDUNDANCY PROCESSOR CONFIGURE
+ /////////////////////////////////////
+
+ RedundancyFilter & theRedundancyProcessor =
+ aPluginProcessorManager.getRedundancyProcessor();
+
+ if( not theRedundancyProcessor.hasParameterWObject() )
+ {
+ theRedundancyProcessor.setParameterWObject(
+ theMainProcessor.getParameterWObject() );
+ }
+
+ if( not theRedundancyProcessor.configureImpl() )
+ {
+ AVM_OS_WARN << "ProcessorUnitFactory::configure:> Failed to "
+ "configure the default redundancy processor << "
+ << theRedundancyProcessor
+ .getParameterWObject()->getFullyQualifiedNameID()
+ << " >> " << std::endl;
+
+ return( false );
+ }
+
+AVM_IF_DEBUG_ENABLED_AND( aPluginProcessorManager.isAutoConfigure() )
+ AVM_OS_LOG << "ProcessorUnitFactory::autoconfigure <"
+ << aPluginProcessorManager.strUniqId() << ">" << std::endl;
+ aPluginProcessorManager.toStream( AVM_OS_LOG );
+AVM_ENDIF_DEBUG_FLAG_AND( CONFIGURING )
+
+ return true;
+}
+
+
+bool ProcessorUnitFactory::configureProcessorScheduler(
+ avm_computing_process_stage_t aRequirement,
+ CompositeControllerUnit & processorScheduler, const BF & aScheduler)
+{
+ if( aScheduler.valid() )
+ {
+ AbstractProcessorUnit * aProcessor = NULL;
+
+ if( WObjectManager::is( aScheduler ) )
+ {
+ aProcessor = processorScheduler.getControllerUnitManager().
+ getControllerUnit( WObjectManager::from( aScheduler ) );
+
+ if( aProcessor != NULL )
+ {
+ aProcessor->enablePlugin(aRequirement);
+
+ processorScheduler.append( aProcessor );
+ }
+ else
+ {
+ AVM_OS_ERROR_ALERT
+ << "configurePostprocess:> UnFound WObject << "
+ << WObjectManager::from( aScheduler )->strUniqId()
+ << " >> Processor using as processor !!!"
+ << SEND_ALERT;
+
+ return( false );
+ }
+ }
+ else if( aScheduler.is< AvmCode >() )
+ {
+ AvmCode * aCode = aScheduler.to_ptr< AvmCode >();
+
+ AvmCode::iterator it = aCode->begin();
+ for( ; it != aCode->end() ; ++it )
+ {
+ configureProcessorScheduler(
+ aRequirement, processorScheduler, (*it));
+ }
+ }
+ else
+ {
+ aProcessor = processorScheduler.getControllerUnitManager().
+ getControllerUnit( aScheduler.str() );
+
+ if( aProcessor != NULL )
+ {
+ aProcessor->enablePlugin(aRequirement);
+
+ processorScheduler.append( aProcessor );
+ }
+ else
+ {
+ AVM_OS_ERROR_ALERT
+ << "configurePostprocess:> UnFound WObject << "
+ << WObjectManager::from( aScheduler )->strUniqId()
+ << " >> Processor using as processor !!!"
+ << SEND_ALERT;
+
+ return( false );
+ }
+ }
+ }
+
+ return( true );
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/api/ProcessorUnitFactory.h b/org.eclipse.efm.symbex/src/fam/api/ProcessorUnitFactory.h
new file mode 100644
index 0000000..f2c0c3c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/api/ProcessorUnitFactory.h
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 29 nov. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef PROCESSORUNITFACTORY_H_
+#define PROCESSORUNITFACTORY_H_
+
+#include <collection/List.h>
+#include <fam/api/AbstractProcessorUnit.h>
+
+
+namespace sep
+{
+
+class CompositeControllerUnit;
+class SymbexControllerUnitManager;
+class WObject;
+
+
+class ProcessorUnitFactory
+{
+
+public:
+
+ ////////////////////////////////////////////////////////////////////////////
+ // LOADER / DISPOSER API
+ ////////////////////////////////////////////////////////////////////////////
+ static void load();
+ static void dispose();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CREATION
+ ////////////////////////////////////////////////////////////////////////////
+ static AbstractProcessorUnit * create(
+ SymbexControllerUnitManager & aManager, WObject * wfProcessObject);
+
+ static bool createList(SymbexControllerUnitManager & aManager,
+ List< WObject * > & listOfProcessWObject);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+ static bool configure(SymbexControllerUnitManager & aPluginProcessorManager ,
+ WObject * wfDirectorObject, WObject * moeProfile);
+
+ static bool configureProcessorScheduler(
+ avm_computing_process_stage_t aRequirement,
+ CompositeControllerUnit & processorScheduler,
+ const BF & aScheduler);
+
+};
+
+
+
+} /* namespace sep */
+#endif /* PROCESSORUNITFACTORY_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/api/ProcessorUnitRepository.cpp b/org.eclipse.efm.symbex/src/fam/api/ProcessorUnitRepository.cpp
new file mode 100644
index 0000000..a4888d8
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/api/ProcessorUnitRepository.cpp
@@ -0,0 +1,243 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 4 déc. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ProcessorUnitRepository.h"
+
+#include <collection/List.h>
+
+#include <fml/workflow/WObject.h>
+
+#include <fam/api/AbstractProcessorUnit.h>
+#include <fam/api/ProcessorUnitAutoRegistration.h>
+#include <fam/api/MainProcessorUnit.h>
+
+
+#include <fam/api/ExtenderProcessorUnit.h>
+#include <fam/api/MainProcessorUnit.h>
+
+#include <fam/coverage/AvmCoverageProcessor.h>
+#include <fam/coverage/FormulaCoverageFilter.h>
+#include <fam/coverage/TransitionCoverageFilter.h>
+
+#include <fam/debug/AvmDebugProcessor.h>
+
+#include <fam/hitorjump/AvmHitOrJumpProcessor.h>
+
+#include <fam/testing/OfflineTestProcessor.h>
+
+#include <fam/queue/ExecutionQueue.h>
+
+#include <fam/redundancy/RedundancyFilter.h>
+
+#include <fam/serializer/GraphVizExecutionGraphSerializer.h>
+#include <fam/serializer/GraphVizStatemachineSerializer.h>
+
+#include <fam/trace/AvmTraceGenerator.h>
+
+
+#include <sew/SymbexControllerUnitManager.h>
+
+#include <util/avm_string.h>
+
+
+namespace sep
+{
+
+////////////////////////////////////////////////////////////////////////////
+// REGISTRY
+////////////////////////////////////////////////////////////////////////////
+
+typedef std::map< std::string ,
+ IProcessorUnitRegistration * > MapOfProcessorFactory;
+
+
+void ProcessorUnitRepository::toStreamKeys(
+ OutStream & out, const std::string & header)
+{
+ out << TAB << header << "< keys: "
+ << getRepository().size() << " > {" << EOL;
+
+ MapOfProcessorFactory::const_iterator itProc = getRepository().begin();
+ MapOfProcessorFactory::const_iterator endProc = getRepository().end();
+ for( ; itProc != endProc ; ++itProc )
+ {
+ out << TAB2 << (*itProc).first << EOL;
+ }
+ out << TAB << "}" << EOL_FLUSH;
+}
+
+void ProcessorUnitRepository::toStreamAll(
+ OutStream & out, const std::string & header)
+{
+ out << TAB << header << "< keys: "
+ << getRepository().size() << " > {" << EOL;
+
+ List< IProcessorUnitRegistration * > alreadyPrinted;
+
+ MapOfProcessorFactory::const_iterator itProc = getRepository().begin();
+ MapOfProcessorFactory::const_iterator endProc = getRepository().end();
+ for( ; itProc != endProc ; ++itProc )
+ {
+ if( REGEX_STARTS( (*itProc).second->getTypeID() ,
+ "(symbex|avm::processor)" ) )
+ {
+ if( not alreadyPrinted.contains( (*itProc).second ) )
+ {
+ alreadyPrinted.append( (*itProc).second );
+
+ out << TAB2 << (*itProc).second->getTypeID() << EOL;
+ }
+ }
+ }
+ out << TAB << "}" << EOL_FLUSH;
+}
+
+void ProcessorUnitRepository::toStreamExported(
+ OutStream & out, const std::string & header)
+{
+#define PROCESSOR_FACTORY_SHOW_TYPE_ID( Processor ) \
+ out << TAB2 << Processor::AUTO_REGISTER_TOOL.getTypeID() << EOL;
+
+ out << TAB1 << header << "< exported > {" << EOL;
+
+ PROCESSOR_FACTORY_SHOW_TYPE_ID( MainProcessorUnit )
+ PROCESSOR_FACTORY_SHOW_TYPE_ID( ExecutionQueue )
+ PROCESSOR_FACTORY_SHOW_TYPE_ID( RedundancyFilter )
+ PROCESSOR_FACTORY_SHOW_TYPE_ID( AvmTraceGenerator )
+
+ PROCESSOR_FACTORY_SHOW_TYPE_ID( AvmDebugProcessor )
+
+ PROCESSOR_FACTORY_SHOW_TYPE_ID( AvmCoverageProcessor )
+ PROCESSOR_FACTORY_SHOW_TYPE_ID( FormulaCoverageFilter )
+ PROCESSOR_FACTORY_SHOW_TYPE_ID( TransitionCoverageFilter )
+
+ PROCESSOR_FACTORY_SHOW_TYPE_ID( AvmHitOrJumpProcessor )
+
+ PROCESSOR_FACTORY_SHOW_TYPE_ID( OfflineTestProcessor )
+
+ PROCESSOR_FACTORY_SHOW_TYPE_ID( ExtenderProcessorUnit )
+
+// PROCESSOR_FACTORY_SHOW_TYPE_ID( InputOutputFilter )
+//
+// PROCESSOR_FACTORY_SHOW_TYPE_ID( GraphSlicer )
+//
+// PROCESSOR_FACTORY_SHOW_TYPE_ID( AvmTraceDirector )
+
+ PROCESSOR_FACTORY_SHOW_TYPE_ID( GraphVizExecutionGraphSerializer )
+ PROCESSOR_FACTORY_SHOW_TYPE_ID( GraphVizStatemachineSerializer )
+
+ out << TAB1 << "}" << EOL_FLUSH;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CREATION
+////////////////////////////////////////////////////////////////////////////////
+
+AbstractProcessorUnit * ProcessorUnitRepository::create(
+ SymbexControllerUnitManager & aManager, WObject * wfProcessObject)
+{
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( not getRepository().empty() )
+ << "Unexpected an empty processor unit repository !!!"
+ << SEND_EXIT;
+
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( wfProcessObject )
+ "processor unit parameter WObject !!!"
+ << SEND_EXIT;
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , CONFIGURING )
+ AVM_OS_COUT << "Processor Type:> "
+ << wfProcessObject->getQualifiedTypeNameID() << EOL_FLUSH;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , CONFIGURING )
+
+
+ IProcessorUnitRegistration * aProcessorFactory = ProcessorUnitRepository::
+ getProcessorFactory( wfProcessObject->getQualifiedTypeNameID() );
+
+ if( aProcessorFactory != NULL )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , CONFIGURING )
+ AVM_OS_COUT << " ==> found :> "
+ << aProcessorFactory->getTypeID() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , CONFIGURING )
+
+ // Case of Main processor Factory
+ if( &(MainProcessorUnit::AUTO_REGISTER_TOOL) == aProcessorFactory )
+ {
+ if( aManager.getMainProcessor().hasParameterWObject() )
+ {
+ return( new MainProcessorUnit(aManager, wfProcessObject) );
+ }
+ else
+ {
+ aManager.getMainProcessor().
+ setParameterWObject(wfProcessObject);
+
+ return( &( aManager.getMainProcessor() ) );
+ }
+ }
+ else if( &(ExecutionQueue::AUTO_REGISTER_TOOL) == aProcessorFactory )
+ {
+ if( not aManager.getExecutionQueue().hasParameterWObject() )
+ {
+ aManager.getExecutionQueue().
+ setParameterWObject(wfProcessObject);
+ }
+
+ return( &( aManager.getExecutionQueue() ) );
+ }
+ else if( &(RedundancyFilter::AUTO_REGISTER_TOOL) == aProcessorFactory )
+ {
+ if( not aManager.getRedundancyProcessor().hasParameterWObject() )
+ {
+ aManager.getRedundancyProcessor().
+ setParameterWObject(wfProcessObject);
+ }
+
+ return( &( aManager.getExecutionQueue() ) );
+ }
+
+
+// else if( &(AvmDebugProcessor::AUTO_REGISTER_TOOL) == aProcessorFactory )
+// {
+// if( aManager.getDebugProcessor().hasParameterWObject() )
+// {
+// return( new AvmDebugProcessor(aManager, wfProcessObject) );
+// }
+// else
+// {
+// aManager.getDebugProcessor().setParameterWObject(wfProcessObject);
+//
+// return( &( aManager.getDebugProcessor() ) );
+// }
+// }
+
+
+ return( aProcessorFactory->newInstance( aManager , wfProcessObject ) );
+ }
+ else
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , CONFIGURING )
+ AVM_OS_COUT << " ==> Unfound in Reppsitory of "
+ << getRepository().size() << " elements" << std::endl;
+ toStreamKeys(AVM_OS_COUT);
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , CONFIGURING )
+ }
+
+ return( NULL );
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/api/ProcessorUnitRepository.h b/org.eclipse.efm.symbex/src/fam/api/ProcessorUnitRepository.h
new file mode 100644
index 0000000..295199a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/api/ProcessorUnitRepository.h
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 4 déc. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef PROCESSORUNITREPOSITORY_H_
+#define PROCESSORUNITREPOSITORY_H_
+
+#include <map>
+
+#include <common/BF.h>
+
+
+namespace sep
+{
+
+
+class AbstractProcessorUnit;
+class OutStream;
+
+class IProcessorUnitRegistration;
+
+class SymbexControllerUnitManager;
+
+class WObject;
+
+class ProcessorUnitRepository
+{
+
+
+public:
+
+ ////////////////////////////////////////////////////////////////////////////
+ // REGISTRY
+ ////////////////////////////////////////////////////////////////////////////
+
+ typedef std::map< std::string ,
+ IProcessorUnitRegistration * > MapOfProcessorFactory;
+
+ inline static MapOfProcessorFactory & getRepository()
+ {
+ static MapOfProcessorFactory mProcessorRepository;
+
+ return( mProcessorRepository );
+ }
+
+
+ inline static void registerProcessorFactory(const std::string & aTypeUFI,
+ IProcessorUnitRegistration * aProcessorRegistration)
+ {
+ getRepository()[ aTypeUFI ] = aProcessorRegistration;
+ }
+
+ inline static IProcessorUnitRegistration * getProcessorFactory(
+ const std::string & aTypeID)
+ {
+ return( getRepository()[ aTypeID ] );
+ }
+
+ static void toStreamKeys(OutStream & out,
+ const std::string & header = "processors");
+
+ static void toStreamAll(OutStream & out,
+ const std::string & header = "processors");
+
+ static void toStreamExported(OutStream & out,
+ const std::string & header = "export processors");
+
+
+
+ /**
+ * CREATION
+ */
+ static AbstractProcessorUnit * create(
+ SymbexControllerUnitManager & aManager, WObject * wfProcessObject);
+
+};
+
+
+} /* namespace sep */
+
+#endif /* PROCESSORUNITREPOSITORY_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageAbstractView.cpp b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageAbstractView.cpp
new file mode 100644
index 0000000..c3abf89
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageAbstractView.cpp
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 19 nov. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmCoverageAbstractView.h"
+
+#include "AvmCoverageProcessor.h"
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+AvmCoverageAbstractView::AvmCoverageAbstractView(
+ AvmCoverageProcessor & aCoverageProcessor, WObject * wfParameterObject)
+: RunnableElement( CLASS_KIND_T( AvmCoverageAbstractView ), wfParameterObject ),
+IHeuristicContextWeight( ),
+
+mCoverageProcessor( aCoverageProcessor ),
+mCoverageStatistics( aCoverageProcessor.getCoverageStatistics() ),
+mHeuristicProperty( aCoverageProcessor.mHeuristicProperty ),
+
+// Computing drive variable
+itQueue( ),
+endQueue( ),
+
+itEC( ),
+endEC( )
+{
+ //!! NOTHING
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageAbstractView.h b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageAbstractView.h
new file mode 100644
index 0000000..ed2dacd
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageAbstractView.h
@@ -0,0 +1,153 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 19 nov. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCOVERAGEABSTRACTVIEW_H_
+#define AVMCOVERAGEABSTRACTVIEW_H_
+
+#include <common/RunnableElement.h>
+#include <fam/coverage/AvmCoverageHeuristicProperty.h>
+
+#include <collection/Typedef.h>
+
+#include <fml/runtime/ExecutionContext.h>
+
+
+namespace sep
+{
+
+class AvmCoverageProcessor;
+class OutStream;
+
+class AvmCoverageStatistics;
+
+class ExecutionContext;
+
+
+class AvmCoverageAbstractView :
+ public RunnableElement,
+ public IHeuristicContextWeight
+{
+
+ /**
+ * ATTRIBUTES
+ */
+protected:
+ AvmCoverageProcessor & mCoverageProcessor;
+
+ AvmCoverageStatistics & mCoverageStatistics;
+
+ AvmCoverageHeuristicProperty & mHeuristicProperty;
+
+ // Computing drive variable
+ ListOfExecutionContext::iterator itQueue;
+ ListOfExecutionContext::iterator endQueue;
+
+ ExecutionContext::child_iterator itEC;
+ ExecutionContext::child_iterator endEC;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmCoverageAbstractView(
+ AvmCoverageProcessor & aCoverageProcessor, WObject * wfParameterObject);
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AvmCoverageAbstractView()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // COVERAGE PROCESSOR API
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline virtual bool configure()
+ {
+ // INITIALIZATION
+ mConfigFlag = RunnableElement::configure();
+
+ // standard processor/view user configuration
+ mConfigFlag = configureImpl() && mConfigFlag;
+
+ return( mConfigFlag );
+ }
+
+ virtual bool configureImpl() = 0;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // INIT / EXIT API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool initImpl()
+ {
+ //!! NOTHING
+ return true;
+ }
+
+ virtual bool exitImpl()
+ {
+ //!! NOTHING
+ return true;
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+// // REPORT API
+// ////////////////////////////////////////////////////////////////////////////
+// virtual void reportDefault(OutStream & os) const;
+//
+//
+// ////////////////////////////////////////////////////////////////////////////
+// // PROCESSOR PROCESSING API
+// ////////////////////////////////////////////////////////////////////////////
+// virtual bool preprocessing();
+//
+// virtual bool postprocessing();
+//
+//
+// ////////////////////////////////////////////////////////////////////////////
+// // PROCESSOR FILTERING API
+// ////////////////////////////////////////////////////////////////////////////
+// virtual bool prefiltering(ListOfExecutionContext & ecQueue);
+//
+// virtual bool postfiltering(ListOfExecutionContext & ecQueue);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SERIALIZATION API
+ ////////////////////////////////////////////////////////////////////////////
+ virtual void toStream(OutStream & os) const
+ {
+ //!! NOTHING
+ }
+
+};
+
+} /* namespace sep */
+
+#endif /* AVMCOVERAGEABSTRACTVIEW_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageDirectiveTraceBuilder.cpp b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageDirectiveTraceBuilder.cpp
new file mode 100644
index 0000000..7441200
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageDirectiveTraceBuilder.cpp
@@ -0,0 +1,1123 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 17 janv. 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmCoverageDirectiveTraceBuilder.h"
+
+#include <computer/primitive/AvmCommunicationFactory.h>
+
+#include <fml/executable/AvmTransition.h>
+
+#include <fml/expression/StatementTypeChecker.h>
+
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeForm.h>
+#include <fml/runtime/RuntimeID.h>
+
+#include <fam/coverage/AvmCoverageTransitionView.h>
+#include <fml/runtime/Message.h>
+
+
+namespace sep
+{
+
+
+/**
+ * Utils for TraceSequence
+ */
+void AvmTraceProperty::checkDecrementation(AvmTransition * aTransition)
+{
+ if( (mTransitionCoverage != NULL) &&
+ (not mTransitionCoverage->testTransitionCoverage(aTransition)) )
+ {
+ --mUncoveredCount;
+ }
+
+ if( aTransition->hasStatementGuardFamily() )
+ {
+ --mGuardCount;
+ }
+ else if( aTransition->isUnconditionalStatementFamily() )
+ {
+ --mUnconditionalCount;
+ }
+
+ if( aTransition->isUnstableSource() )
+ {
+ --mUnstableCount;
+ }
+}
+
+void AvmTraceProperty::checkIncrementation(AvmTransition * aTransition)
+{
+ if( (mTransitionCoverage != NULL) &&
+ (not mTransitionCoverage->testTransitionCoverage(aTransition)) )
+ {
+ ++mUncoveredCount;
+ }
+
+ if( aTransition->hasStatementGuardFamily() )
+ {
+ ++mGuardCount;
+ }
+ else if( aTransition->isUnconditionalStatementFamily() )
+ {
+ ++mUnconditionalCount;
+ }
+
+ if( aTransition->isUnstableSource() )
+ {
+ ++mUnstableCount;
+ }
+}
+
+
+void AvmTraceProperty::updadeSize()
+{
+ mSize = 0;
+ mUncoveredCount = 0;
+ mGuardCount = 0;
+ mUnconditionalCount = 0;
+ mUnstableCount = 0;
+
+ BFList::const_iterator itPoint = points.begin();
+ BFList::const_iterator endPoint = points.end();
+ for( ; itPoint != endPoint ; ++itPoint )
+ {
+ ++mSize;
+
+ checkIncrementation( (*itPoint).to_ptr< TracePoint >()->
+ object->as< AvmTransition >() );
+ }
+}
+
+
+bool AvmTraceProperty::compare( bool (* isComp)(avm_size_t, avm_size_t),
+ const AvmTraceProperty & aTraceElement )
+{
+ return( isComp(xSize(), aTraceElement.xSize()) );
+}
+
+
+/**
+ * Serialization
+ */
+void AvmTraceProperty::toStream(OutStream & os, bool verbose) const
+{
+ os << TAB << "trace#" << tid
+ << "<xsize:" << xSize() << ", size:" << mSize
+ << ", uncovered:" << mUncoveredCount
+ << ", guard:" << mGuardCount
+ << ", uncondional:" << mUnconditionalCount
+ << ", unstable:" << mUnstableCount << ">";
+ if( mEC != NULL )
+ {
+ if( verbose )
+ {
+ os << EOL_TAB << AVM_STR_INDENT;
+ mEC->traceMinimum(os);
+ os << END_INDENT;
+ }
+ else
+ {
+ os << "( ctx:" << mEC->getIdNumber() << " )";
+ }
+ }
+ if( points.nonempty() )
+ {
+ os << " --> " << backTransition()->getNameID();
+ }
+ os << " { " << combinator->strOp() << EOL;
+
+ if( verbose )
+ {
+ os << INCR_INDENT;
+ BFList::const_iterator itPoint = points.begin();
+ BFList::const_iterator endPoint = points.end();
+ for( AvmTransition * aTransition = NULL ; itPoint != endPoint ; ++itPoint )
+ {
+ aTransition = (*itPoint).to_ptr< TracePoint >()->
+ object->as< AvmTransition >();
+
+ (*itPoint).toStream(os);
+
+ os << TAB2 << "\t\t\t--> " << aTransition->strTargetId();
+ os << " \t==> " << aTransition->strStatementFamily() << EOL;
+ if ( aTransition->hasInternalCommunicationCode() )
+ {
+ os << TAB2 << "\t\t\t";
+ BaseCompiledForm::toStreamStaticCom(os,
+ aTransition->getInternalCommunicationCode() );
+ }
+ }
+ os << DECR_INDENT;
+ }
+ else
+ {
+ os << INCR_INDENT << points << DECR_INDENT;
+ }
+
+ os << TAB << "}" << EOL_FLUSH;
+}
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+AvmCoverageDirectiveTraceBuilder::AvmCoverageDirectiveTraceBuilder(
+ const ExecutionContext * anEC, TracePoint * tpTransition,
+ ENUM_HEURISTIC_CLASS anHeuristicClass,
+ avm_size_t pathCountLimit, avm_size_t pathSizeLimit)
+: IHeuristicClass( anHeuristicClass ),
+
+mEC( anEC ),
+mED( anEC->getAPExecutionData() ),
+mRID( tpTransition->RID ),
+
+mTransition( tpTransition->object->to< AvmTransition >() ),
+mTransitionPoint( tpTransition ),
+
+mTraceElement( ),
+
+mComputingPathCountLimit( pathCountLimit ),
+mComputingPathSizeLimit( pathSizeLimit ),
+
+mGoalAchievedFlag( false ),
+
+//mTransitionPath( ),
+//mExpectedInput( ),
+mVirtualBuffer(mTransition, NULL, 0, TYPE_MULTI_LIFO_SPECIFIER, -1),
+mEmitOutput( & mVirtualBuffer ),
+
+mTableOfRuntimeStatus( *( mED->getRuntimeFormStateTable() ) ),
+
+// computing variable for method << computePathToTransition >>
+anyTransitionPaths( ),
+prefixLoopTransitionPaths( ),
+
+outgoingTransitions( ),
+aTransitionPath( ),
+itTrans( ),
+endTrans( ),
+
+tgtInstance( NULL ),
+fwdMachine( NULL ),
+tgtMachine( NULL )
+{
+ //!! NOTHING
+}
+
+AvmCoverageDirectiveTraceBuilder::AvmCoverageDirectiveTraceBuilder(
+ const ExecutionContext * anEC, const RuntimeID & aRID,
+ AvmTransition * aTransition, ENUM_HEURISTIC_CLASS anHeuristicClass,
+ avm_size_t pathCountLimit, avm_size_t pathSizeLimit)
+: IHeuristicClass( anHeuristicClass ),
+
+mEC( anEC ),
+mED( anEC->getAPExecutionData() ),
+mRID( aRID ),
+
+mTransition( aTransition ),
+mTransitionPoint( NULL ),
+
+mTraceElement( ),
+
+mComputingPathCountLimit( pathCountLimit ),
+mComputingPathSizeLimit( pathSizeLimit ),
+
+mGoalAchievedFlag( false ),
+
+//mTransitionPath( ),
+//mExpectedInput( ),
+mVirtualBuffer(mTransition, NULL, 0, TYPE_MULTI_LIFO_SPECIFIER, -1),
+mEmitOutput( & mVirtualBuffer ),
+
+mTableOfRuntimeStatus( *( mED->getRuntimeFormStateTable() ) ),
+
+// computing variable for method << computePathToTransition >>
+anyTransitionPaths( ),
+prefixLoopTransitionPaths( ),
+
+outgoingTransitions( ),
+aTransitionPath( ),
+itTrans( ),
+endTrans( ),
+
+tgtInstance( NULL ),
+fwdMachine( NULL ),
+tgtMachine( NULL )
+{
+ //!! NOTHING
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Configure
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmCoverageDirectiveTraceBuilder::configure(
+ AvmTraceProperty & aTraceElement, const ExecutionContext * anEC,
+ TracePoint * tpTransition, ENUM_HEURISTIC_CLASS anHeuristicClass,
+ avm_size_t pathCountLimit, avm_size_t pathSizeLimit)
+{
+ mEC = anEC,
+ mED = anEC->getAPExecutionData();
+
+ mRID = tpTransition->RID;
+ mTransition = tpTransition->object->to< AvmTransition >();
+
+ mTransitionPoint = tpTransition;
+
+ mTraceElement.configure( aTraceElement );
+
+ mHeuristicClass = anHeuristicClass;
+
+ mComputingPathCountLimit = pathCountLimit;
+ mComputingPathSizeLimit = pathSizeLimit;
+
+ mTableOfRuntimeStatus.reset(
+ *( mED->getRuntimeFormStateTable() ), false);
+
+ return( true );
+}
+
+bool AvmCoverageDirectiveTraceBuilder::configure(
+ AvmTraceProperty & aTraceElement, const ExecutionContext * anEC,
+ const RuntimeID & aRID, AvmTransition * aTransition,
+ ENUM_HEURISTIC_CLASS anHeuristicClass,
+ avm_size_t pathCountLimit, avm_size_t pathSizeLimit)
+{
+ mEC = anEC,
+ mED = anEC->getAPExecutionData();
+
+ mRID = aRID;
+ mTransition = aTransition;
+
+ mTransitionPoint = NULL;
+
+ mTraceElement.configure( aTraceElement );
+
+ mHeuristicClass = anHeuristicClass;
+
+ mComputingPathCountLimit = pathCountLimit;
+ mComputingPathSizeLimit = pathSizeLimit;
+
+ mTableOfRuntimeStatus.reset( *( mED->getRuntimeFormStateTable() ), false);
+
+ return( true );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// API
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmCoverageDirectiveTraceBuilder::initialize()
+{
+ mGoalAchievedFlag = false;
+
+ mEmitOutput.clear();
+
+ if( mRID.invalid() )
+ {
+ if( mED->mRID.getExecutable()->getTransition().contains(mTransition) )
+ {
+ mRID = mED->mRID;
+ }
+
+ if( mRID.invalid() )
+ {
+ if( mTransitionPoint != NULL )
+ {
+ mTransitionPoint->updateRID( (* mED) );
+
+ mRID = mTransitionPoint->RID;
+ }
+ else
+ {
+ mRID = mED->getRuntimeID( mTransition->getExecutable() );
+ }
+ }
+ }
+
+ return( mRID.valid() );
+}
+
+
+bool AvmCoverageDirectiveTraceBuilder::computePath()
+{
+ if( initialize() )
+ {
+ AvmCommunicationFactory::collectBufferMessage(mED, mEmitOutput);
+
+ return( mGoalAchievedFlag = computePath(mRID, mTransition) );
+ }
+
+ return( false );
+}
+
+
+bool AvmCoverageDirectiveTraceBuilder::computePath(
+ AvmTraceProperty & aTraceElement)
+{
+ if( initialize() )
+ {
+ AvmCommunicationFactory::collectBufferMessage(mED, mEmitOutput);
+
+ if( computePath(mRID, mTransition) )
+ {
+ aTraceElement.copyTrace( mTraceElement );
+
+ mGoalAchievedFlag = true;
+
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+
+bool AvmCoverageDirectiveTraceBuilder::computePath(
+ AvmTraceProperty & aTraceElement, ExecutionContext * anEC,
+ const RuntimeID & aRID, AvmTransition * aTransition,
+ ENUM_HEURISTIC_CLASS anHeuristicClass,
+ avm_size_t pathCountLimit, avm_size_t pathSizeLimit)
+{
+ if( configure(aTraceElement, anEC, aRID, aTransition,
+ anHeuristicClass, pathCountLimit, pathSizeLimit) )
+ {
+ if( initialize() )
+ {
+ AvmCommunicationFactory::collectBufferMessage(mED, mEmitOutput);
+
+ if( computePath(mRID, mTransition) )
+ {
+ aTraceElement.copyTrace( mTraceElement );
+
+ mGoalAchievedFlag = true;
+
+ return( true );
+ }
+ }
+ }
+
+ return( false );
+}
+
+
+
+void AvmCoverageDirectiveTraceBuilder::report(OutStream & os)
+{
+ os << DEFAULT_WRAP_DATA;
+
+ if( mEC != NULL )
+ {
+ os << "from "; mEC->traceMinimum(os);
+ }
+ os << "Trace to reach (size:" << mTraceElement.mSize << ") :> "
+ << mTransition->strTransitionHeader() << std::endl;
+ mTraceElement.toStream(os);
+
+// os << "Expected Input :> " << std::endl;
+// BaseCompiledForm::toStreamStaticCom(os, mExpectedInput);
+// os << TAB << "Emit Output :>"; mEmitOutput.toStream(AVM_OS_TRACE);
+
+ os << ( mGoalAchievedFlag ? "NEW" : "NO" ) << " OBJECTIVE !!!"
+ << END_WRAP << std::endl;
+}
+
+
+
+bool AvmCoverageDirectiveTraceBuilder::computePath(
+ const RuntimeID & aRID, AvmTransition * aTransition)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << TAB << "computePath from :> ";
+ mEC->traceMinimum(AVM_OS_TRACE);
+ AVM_OS_TRACE << TAB2 << aRID.strUniqId() << " |==> ";
+ aTransition->toStreamHeader(AVM_OS_TRACE); AVM_OS_TRACE << std::endl;
+ if( aTransition->hasInternalCommunicationCode() )
+ {
+ AVM_OS_TRACE << TAB2 << "com |==> ";
+ BaseCompiledForm::toStreamStaticCom(AVM_OS_TRACE,
+ aTransition->getInternalCommunicationCode());
+ }
+// AVM_OS_TRACE << TAB << "Expected Input :> " << std::endl;
+// BaseCompiledForm::toStreamStaticCom(AVM_OS_TRACE, mExpectedInput);
+ AVM_OS_TRACE << TAB2 << "Emit Output :>"; mEmitOutput.toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << TAB << "end //computePath" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+
+ if( mED->isIdleOrRunning(aRID) )
+ {
+ return( fireTransition(aRID, aTransition) );
+ }
+ else
+ {
+ return( computePathToTransition(aRID, aTransition) );
+ }
+
+ return( false );
+}
+
+
+bool AvmCoverageDirectiveTraceBuilder::fireTransition(
+ const RuntimeID & aRID, AvmTransition * aTransition)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << std::endl
+ << TAB << "fireTransition :> " << aRID.strUniqId()
+ << " |==> " << aTransition->strTransitionHeader() << std::endl;
+// AVM_OS_TRACE << TAB2 << "Expected Input :> " << std::endl;
+// BaseCompiledForm::toStreamStaticCom(AVM_OS_TRACE, mExpectedInput);
+ AVM_OS_TRACE << TAB2 << "Emit Output :>"; mEmitOutput.toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << TAB << "end //fireTransition" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+
+ mTableOfRuntimeStatus.stateSet(aRID.getOffset(), PROCESS_SUSPENDED_STATE);
+
+ if( aTransition->hasInputCom() )
+ {
+ ListOfInstanceOfPort anInputTrace( aTransition->getInputCom() );
+ if( mEmitOutput.uncontains( anInputTrace /*, aRID*/ ) )
+ {
+ // trouver des émetteurs pour les INPUT attendu au regard de ED< SC >
+ while( anInputTrace.nonempty() )
+ {
+ if( computePathToInput(aRID, anInputTrace.front()) )
+ {
+ anInputTrace.pop_front();
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ if( anInputTrace.empty() )
+ {
+ traceTransition(aRID, aTransition);
+
+ return( true );
+ }
+ return( false );
+ }
+ else
+ {
+ traceTransition(aRID, aTransition);
+ }
+ }
+ else
+ {
+ traceTransition(aRID, aTransition);
+ }
+
+ return( true );
+}
+
+
+void AvmCoverageDirectiveTraceBuilder::traceTransition(
+ const RuntimeID & aRID, AvmTransition * aTransition)
+{
+ mTraceElement.append(aRID, aTransition);
+
+ // Virtual Eval Of aTransition
+ if( aTransition->hasOutputCom() )
+ {
+ ListOfInstanceOfPort::const_iterator itOutput =
+ aTransition->getOutputCom().begin();
+ ListOfInstanceOfPort::const_iterator endOutput =
+ aTransition->getOutputCom().end();
+ for( ; itOutput != endOutput ; ++itOutput )
+ {
+ mEmitOutput.push( Message(aRID, INCR_BF(*itOutput)) );
+ }
+ }
+}
+
+
+bool AvmCoverageDirectiveTraceBuilder::computePathToTransition(
+ const RuntimeID & aRID, AvmTransition * aTransition)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << std::endl
+ << TAB << "computePathToTransition using :> " << aRID.strUniqId()
+ << " |==> " << aTransition->strTransitionHeader() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+
+ RuntimeID tmpRID = aRID.getPRID();
+ for( ; tmpRID.valid() ; tmpRID = tmpRID.getPRID() )
+ {
+ if( mED->isIdleOrRunning(tmpRID) )
+ {
+ break;
+ }
+ }
+
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( tmpRID.valid() )
+ << "Unfound a Runnable Ancestor Statemachine !!!"
+ << SEND_EXIT;
+
+ const RuntimeForm & tmpRF = mED->getRuntime(tmpRID);
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << TAB2 << "Runnable Ancestor Statemachine :> "
+ << tmpRID.str() << std::endl
+ << TAB2 << "Runnable Ancestor State Scheduler :> {";
+ tmpRF.getOnSchedule()->toStreamRoutine( AVM_OS_TRACE )
+ << TAB2 << "}" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+
+ if( tmpRF.getOnSchedule()->isOpCode( AVM_OPCODE_RUN ) &&
+ tmpRF.getOnSchedule()->first().is< RuntimeID >() )
+ {
+ return( computePathFromRunnable(
+ tmpRF.getOnSchedule()->first().bfRID(), aTransition) );
+ }
+
+ return( false );
+}
+
+
+bool AvmCoverageDirectiveTraceBuilder::computeBasicPathFromRunnable(
+ const RuntimeID & aRID, AvmTransition * aTransition)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << std::endl
+ << TAB << "computeBasicPathFromRunnable using :> " << aRID.strUniqId()
+ << " |==> " << aTransition->strTransitionHeader() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+ if( not aRID.getExecutable()->
+ containsForwardReachableTransition(aTransition) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << TAB2 << "Unreachable transition :> "
+ << mTransition->strTransitionHeader() << std::endl
+ << TAB2 << "from : " << aRID.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+ return( false );
+ }
+
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << TAB << "Looking for a path to :> " << aRID.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+
+ ListOfAvmTransition oneTransitionPath;
+
+ if( computePathToTransition(aRID, aTransition, oneTransitionPath) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << INCR_INDENT;
+ AvmTransition::toStream(AVM_OS_TRACE, oneTransitionPath);
+ AVM_OS_TRACE << DECR_INDENT << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+ // All found path
+// ListOfListOfAvmTransition allTransitionPaths;
+// computePathToTransition(aRID, aTransition, allTransitionPaths);
+
+ RuntimeID tmpRID = aRID;
+ do
+ {
+ aTransition = oneTransitionPath.front();
+
+ if( fireTransition(tmpRID, aTransition) )
+ {
+ oneTransitionPath.pop_front();
+
+ computeTargetMachine(tmpRID, aTransition->getCode());
+ }
+ else
+ {
+ break;
+ }
+ }
+ while( oneTransitionPath.nonempty() );
+
+ return( oneTransitionPath.empty() );
+ }
+
+ return( false );
+}
+
+
+
+bool AvmCoverageDirectiveTraceBuilder::computeSmartPathFromRunnable(
+ const RuntimeID & aRID, AvmTransition * aTransition)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << std::endl
+ << TAB << "computeSmartPathFromRunnable using :> " << aRID.strUniqId()
+ << " |==> " << aTransition->strTransitionHeader() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+ if( not aRID.getExecutable()->
+ containsForwardReachableTransition(aTransition) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << TAB2 << "Unreachable transition :> "
+ << mTransition->strTransitionHeader() << std::endl
+ << TAB2 << "from : " << aRID.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+ return( false );
+ }
+
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << TAB << "Looking for a path to :> " << aRID.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+
+ avm_size_t saveTraceElementSize = mTraceElement.mSize;
+
+ if( mComputingPathSizeLimit <= saveTraceElementSize )
+ {
+ return( false );
+ }
+
+ // All found path
+ ListOfListOfAvmTransition allTransitionPaths;
+ computePathToTransition(aRID, aTransition, allTransitionPaths);
+
+ ListOfAvmTransition oneTransitionPath;
+ RuntimeID tmpRID;
+
+// if( computePathToTransition(aRID, aTransition, oneTransitionPath) )
+ while( allTransitionPaths.nonempty() )
+ {
+ oneTransitionPath.clear();
+ oneTransitionPath.splice( allTransitionPaths.front() );
+ allTransitionPaths.pop_front();
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << TAB << "Found Path --> "
+ << aTransition->getFullyQualifiedNameID() << std::endl << INCR_INDENT;
+ AvmTransition::toStream(AVM_OS_TRACE, oneTransitionPath);
+ AVM_OS_TRACE << DECR_INDENT << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+ tmpRID = aRID;
+ do
+ {
+ aTransition = oneTransitionPath.front();
+
+ if( fireTransition(tmpRID, aTransition) )
+ {
+ oneTransitionPath.pop_front();
+
+ computeTargetMachine(tmpRID, aTransition->getCode());
+ }
+ else
+ {
+ break;
+ }
+ }
+ while( oneTransitionPath.nonempty() );
+
+ if( oneTransitionPath.empty() )
+ {
+ return( true );
+ }
+ else if( allTransitionPaths.empty() )
+ {
+ return( false );
+ }
+
+ // BACKTRACK
+ else
+ {
+ mTraceElement.resize( saveTraceElementSize );
+ }
+ }
+
+ return( false );
+}
+
+
+bool AvmCoverageDirectiveTraceBuilder::computePathToInput(
+ const RuntimeID & aRID, InstanceOfPort * anInputTrace)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << TAB << "computePathToInput :> " << std::endl;
+ AVM_OS_TRACE << TAB2 << "Expected Input :> " << anInputTrace->getFullyQualifiedNameID() << std::endl;
+ AVM_OS_TRACE << TAB2 << "Emit Output :>"; mEmitOutput.toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << TAB << "end //computePathToInput" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+
+ ExecutableForm * tmpExecutable = NULL;
+ RuntimeID srcRID;
+
+ // Parcourir tous les états et repérer ceux contenant les bons output/outputTo
+ TableOfRuntimeT::const_iterator itRF = mED->getTableOfRuntime().begin();
+ TableOfRuntimeT::const_iterator endRF = mED->getTableOfRuntime().end();
+ for( ; itRF != endRF ; ++itRF )
+ {
+ srcRID = (*itRF)->getRID();
+ tmpExecutable = srcRID.getExecutable();
+
+ if( mTableOfRuntimeStatus.isSuspended(srcRID.getOffset()) )
+ {
+ //!! Exclude machine
+ }
+ else if( mED->isIdleOrRunning( srcRID ) &&
+ tmpExecutable->getForwardReachableTransition().nonempty() )
+ {
+ ListOfAvmTransition::const_iterator itTrans =
+ tmpExecutable->getForwardReachableTransition().begin();
+ ListOfAvmTransition::const_iterator endTrans =
+ tmpExecutable->getForwardReachableTransition().end();
+ for( ; itTrans != endTrans ; ++itTrans )
+ {
+ if( (*itTrans)->getOutputCom().contains(anInputTrace) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << TAB << "found Output in :> " << srcRID.strUniqId() << " |==> "
+ << (*itTrans)->strTransitionHeader() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+ if( tmpExecutable != (*itTrans)->getExecutable() )
+ {
+ if( computePathFromRunnable(srcRID, (*itTrans)) )
+ {
+ return( true );
+ }
+ }
+ else if( fireTransition(srcRID, (*itTrans)) )
+ {
+ return( true );
+ }
+ }
+ }
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << TAB << "Unfound Input :> " << anInputTrace->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+ return( false );
+}
+
+
+bool AvmCoverageDirectiveTraceBuilder::computePathToTransition(
+ const RuntimeID & aRID, AvmTransition * aTransition,
+ ListOfAvmTransition & oneTransitionPath)
+{
+ anyTransitionPaths.clear();
+
+ outgoingTransitions.clear();
+ tgtInstance = NULL;
+
+ // Initialization step
+ fwdMachine = aRID.getExecutable();
+ fwdMachine->getOutgoingTransition( outgoingTransitions );
+
+ tgtMachine = fwdMachine;
+
+ itTrans = outgoingTransitions.begin();
+ endTrans = outgoingTransitions.end();
+ for( ; itTrans != endTrans ; ++itTrans )
+ {
+ if( (tgtInstance = (*itTrans)->getTransitionTarget()) != NULL )
+ {
+ tgtMachine = tgtInstance->getExecutable();
+
+ if( tgtMachine->containsForwardReachableTransition(aTransition) )
+ {
+ anyTransitionPaths.append( ListOfAvmTransition(*itTrans) );
+ }
+ }
+ }
+
+
+ aTransitionPath.clear();
+
+ // Iterative step
+ while( anyTransitionPaths.nonempty() )
+ {
+ aTransitionPath.clear();
+ aTransitionPath.splice( anyTransitionPaths.front() );
+ anyTransitionPaths.pop_front();
+
+ tgtInstance = aTransitionPath.back()->getTransitionTarget();
+ if( tgtInstance == NULL )
+ {
+ continue;
+ }
+
+ fwdMachine = tgtInstance->getExecutable();
+ if( fwdMachine->getTransition().contains(aTransition) )
+ {
+ oneTransitionPath.splice( aTransitionPath );
+ oneTransitionPath.push_back( aTransition );
+
+ return( true );
+ }
+ else
+ {
+ outgoingTransitions.clear();
+ fwdMachine->getOutgoingTransition( outgoingTransitions );
+
+ itTrans = outgoingTransitions.begin();
+ endTrans = outgoingTransitions.end();
+ for( ; itTrans != endTrans ; ++itTrans )
+ {
+ if( not aTransitionPath.contains( *itTrans ) )
+ {
+ if( (tgtInstance = (*itTrans)->getTransitionTarget()) != NULL )
+ {
+ tgtMachine = tgtInstance->getExecutable();
+
+ if( tgtMachine->containsForwardReachableTransition(aTransition) )
+ {
+ if( (aTransitionPath.size() < mComputingPathSizeLimit) &&
+ (anyTransitionPaths.size() < mComputingPathCountLimit) )
+ {
+ anyTransitionPaths.push_back( aTransitionPath );
+ anyTransitionPaths.back().push_back( *itTrans );
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return( false );
+}
+
+
+bool AvmCoverageDirectiveTraceBuilder::computePathToTransition(
+ const RuntimeID & aRID, AvmTransition * aTransition,
+ ListOfListOfAvmTransition & allTransitionPaths)
+{
+ anyTransitionPaths.clear();
+ prefixLoopTransitionPaths.clear();
+
+ aTransitionPath.clear();
+
+ outgoingTransitions.clear();
+ tgtInstance = NULL;
+
+ // Initialization step
+ fwdMachine = aRID.getExecutable();
+ fwdMachine->getOutgoingTransition( outgoingTransitions );
+
+ tgtMachine = fwdMachine;
+
+ itTrans = outgoingTransitions.begin();
+ endTrans = outgoingTransitions.end();
+ for( ; itTrans != endTrans ; ++itTrans )
+ {
+ if( (tgtInstance = (*itTrans)->getTransitionTarget()) != NULL )
+ {
+ tgtMachine = tgtInstance->getExecutable();
+
+ if( tgtMachine->containsForwardReachableTransition(aTransition) )
+ {
+ anyTransitionPaths.append( ListOfAvmTransition(*itTrans) );
+ }
+ }
+ }
+
+ // Iterative step
+ while( anyTransitionPaths.nonempty() )
+ {
+// AVM_OS_TRACE << TAB << "TMP found paths :> " << std::endl;
+// ListOfListOfAvmTransition::const_iterator itList = allTransitionPaths.begin();
+// ListOfListOfAvmTransition::const_iterator endList = allTransitionPaths.end();
+// for( avm_size_t number = 0 ; itList != endList ; ++itList , ++number )
+// {
+// AVM_OS_TRACE << TAB << "Path number :" << number << ">"
+// << std::endl << INCR_INDENT;
+// AvmTransition::toStream(AVM_OS_TRACE, *itList);
+// AVM_OS_TRACE << std::endl << DECR_INDENT;
+// }
+//
+// AVM_OS_TRACE << TAB << "TMP Computing paths :> " << std::endl;
+// itList = anyTransitionPaths.begin();
+// endList = anyTransitionPaths.end();
+// for( avm_size_t number = 0 ; itList != endList ; ++itList , ++number )
+// {
+// AVM_OS_TRACE << TAB << "Path number :" << number << ">"
+// << std::endl << INCR_INDENT;
+// AvmTransition::toStream(AVM_OS_TRACE, *itList);
+// AVM_OS_TRACE << DECR_INDENT;
+// }
+// AVM_OS_TRACE << std::endl;
+
+ aTransitionPath.clear();
+ aTransitionPath.splice( anyTransitionPaths.front() );
+ anyTransitionPaths.pop_front();
+
+ tgtInstance = aTransitionPath.back()->getTransitionTarget();
+ if( tgtInstance == NULL )
+ {
+ continue;
+ }
+
+ fwdMachine = tgtInstance->getExecutable();
+ if( fwdMachine->getTransition().contains(aTransition) )
+ {
+ allTransitionPaths.push_back( aTransitionPath );
+ allTransitionPaths.back().push_back( aTransition );
+ }
+ else
+ {
+ outgoingTransitions.clear();
+ fwdMachine->getOutgoingTransition( outgoingTransitions );
+
+ itTrans = outgoingTransitions.begin();
+ endTrans = outgoingTransitions.end();
+ for( ; itTrans != endTrans ; ++itTrans )
+ {
+ if( aTransitionPath.contains( *itTrans ) )
+ {
+ prefixLoopTransitionPaths.push_back( aTransitionPath );
+ prefixLoopTransitionPaths.back().push_back( *itTrans );
+ }
+ else
+ {
+ if( (tgtInstance = (*itTrans)->getTransitionTarget()) != NULL )
+ {
+ tgtMachine = tgtInstance->getExecutable();
+
+ if( tgtMachine->containsForwardReachableTransition(aTransition) )
+ {
+ if( (aTransitionPath.size() < mComputingPathSizeLimit) &&
+ (anyTransitionPaths.size() < mComputingPathCountLimit) )
+ {
+ anyTransitionPaths.push_back( aTransitionPath );
+ anyTransitionPaths.back().push_back( *itTrans );
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << TAB << "List of found paths :> " << std::endl;
+ ListOfListOfAvmTransition::const_iterator itList = allTransitionPaths.begin();
+ ListOfListOfAvmTransition::const_iterator endList = allTransitionPaths.end();
+ for( avm_size_t number = 0 ; itList != endList ; ++itList , ++number )
+ {
+ AVM_OS_TRACE << TAB << "Path number :" << number << " --> "
+ << aTransition->getFullyQualifiedNameID() << std::endl << INCR_INDENT;
+ AvmTransition::toStream(AVM_OS_TRACE, *itList);
+ AVM_OS_TRACE << std::endl << DECR_INDENT;
+ }
+
+// AVM_OS_TRACE << TAB << "List of found prefix-paths :> " << std::endl;
+// itList = prefixLoopTransitionPaths.begin();
+// endList = prefixLoopTransitionPaths.end();
+// for( avm_size_t number = 0 ; itList != endList ; ++itList , ++number )
+// {
+// AVM_OS_TRACE << TAB << "Prefix number :" << number << "> "
+// << std::endl << INCR_INDENT;
+// AvmTransition::toStream(AVM_OS_TRACE, *itList);
+// AVM_OS_TRACE << std::endl << DECR_INDENT;
+// }
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+ return( allTransitionPaths.nonempty() );
+}
+
+
+void AvmCoverageDirectiveTraceBuilder::computeTargetMachine(
+ RuntimeID & aRID, AvmCode * aCode)
+{
+
+ switch( aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_ENABLE_INVOKE:
+ case AVM_OPCODE_ENABLE_SET:
+ {
+ const BF & targetMachine = aCode->first();
+
+ if( targetMachine.is< InstanceOfMachine >() )
+ {
+ if( (targetMachine.to_ptr< InstanceOfMachine >() !=
+ aRID.getInstance()) && mED->getRuntime(aRID).hasChild() )
+ {
+ aRID = mED->getRuntimeFormChild(aRID,
+ targetMachine.to_ptr< InstanceOfMachine >() );
+ }
+ }
+ else if( targetMachine.is< RuntimeID >() )
+ {
+ aRID = targetMachine.bfRID();
+ }
+
+ break;
+ }
+ case AVM_OPCODE_DISABLE_SELF:
+ {
+ aRID = aRID.getPRID();
+
+ break;
+ }
+ case AVM_OPCODE_DISABLE_SELVES:
+ {
+ if( aCode->first().isInteger() )
+ {
+ for( avm_uinteger_t level = aCode->first().toInteger() ;
+ level > 0 ; --level )
+ {
+ aRID = aRID.getPRID();
+ }
+ }
+ else
+ {
+ aRID = aRID.getPRID();
+ }
+
+ break;
+ }
+ default:
+ {
+ if( StatementTypeChecker::isSchedule(aCode) )
+ {
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator endIt = aCode->end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).is< AvmCode >() )
+ {
+ computeTargetMachine(aRID, (*it).to_ptr< AvmCode >());
+ }
+ }
+ }
+ break;
+ }
+ }
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageDirectiveTraceBuilder.h b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageDirectiveTraceBuilder.h
new file mode 100644
index 0000000..67e8499
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageDirectiveTraceBuilder.h
@@ -0,0 +1,544 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 17 janv. 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVM_PROCESS_COVERAGE_AVMCOVERAGEDIRECTIVETRACEBUILDER_H_
+#define AVM_PROCESS_COVERAGE_AVMCOVERAGEDIRECTIVETRACEBUILDER_H_
+
+#include <collection/List.h>
+#include <collection/Typedef.h>
+
+#include <fml/buffer/LifoBuffer.h>
+
+#include <fml/executable/AvmTransition.h>
+#include <fml/executable/InstanceOfBuffer.h>
+
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeID.h>
+
+#include <fml/trace/TracePoint.h>
+#include <fml/trace/TraceSequence.h>
+
+#include <fam/coverage/AvmCoverageHeuristicProperty.h>
+
+
+namespace sep
+{
+
+class AvmCoverageTransitionView;
+class OutStream;
+
+class ExecutableForm;
+class ExecutionContext;
+class APExecutionData;
+
+class InstanceOfMachine;
+class InstanceOfPort;
+
+class RuntimeForm;
+
+
+class AvmTraceProperty : public TraceSequence
+{
+
+public:
+ /**
+ * ATTRIBUTE
+ */
+ AvmCoverageTransitionView * mTransitionCoverage;
+
+ avm_size_t mSize;
+
+ avm_size_t mUncoveredCount;
+
+ avm_size_t mGuardCount;
+
+ avm_size_t mUnconditionalCount;
+
+ avm_size_t mUnstableCount;
+
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmTraceProperty(AvmCoverageTransitionView * aTransitionCoverage)
+ : TraceSequence( CLASS_KIND_T( AvmTraceProperty ) ),
+ mTransitionCoverage( aTransitionCoverage ),
+ mSize( 0 ),
+ mUncoveredCount( 0 ),
+ mGuardCount( 0 ),
+ mUnconditionalCount( 0 ),
+ mUnstableCount( 0 )
+ {
+ //!! NOTHING
+ }
+
+ AvmTraceProperty(ExecutionContext * anEC = NULL)
+ : TraceSequence( anEC ),
+ mTransitionCoverage( NULL ),
+ mSize( 0 ),
+ mUncoveredCount( 0 ),
+ mGuardCount( 0 ),
+ mUnconditionalCount( 0 ),
+ mUnstableCount( 0 )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ AvmTraceProperty(const TraceSequence & aTrace)
+ : TraceSequence( aTrace ),
+ mTransitionCoverage( NULL ),
+ mSize( 0 ),
+ mUncoveredCount( 0 ),
+ mGuardCount( 0 ),
+ mUnconditionalCount( 0 ),
+ mUnstableCount( 0 )
+ {
+ updadeSize();
+ }
+
+ AvmTraceProperty(const AvmTraceProperty & aTraceProperty)
+ : TraceSequence( aTraceProperty ),
+ mTransitionCoverage( aTraceProperty.mTransitionCoverage ),
+ mSize( aTraceProperty.mSize ),
+ mUncoveredCount( aTraceProperty.mUncoveredCount ),
+ mGuardCount( aTraceProperty.mGuardCount ),
+ mUnconditionalCount( aTraceProperty.mUnconditionalCount ),
+ mUnstableCount( aTraceProperty.mUnstableCount )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AvmTraceProperty()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * Configure
+ */
+ inline bool configure(AvmTraceProperty & aTraceElement)
+ {
+ clear();
+
+ mTransitionCoverage = aTraceElement.mTransitionCoverage;
+
+ return( true );
+ }
+
+
+ /**
+ * Utils for TraceSequence
+ */
+ void checkDecrementation(AvmTransition * aTransition);
+
+ void checkIncrementation(AvmTransition * aTransition);
+
+
+ inline void append(const RuntimeID & aRID, AvmTransition * aTransition)
+ {
+ points.push_back( BF( new TracePoint(
+ ENUM_TRACE_POINT::TRACE_TRANSITION_NATURE,
+ AVM_OPCODE_INVOKE_TRANSITION, aRID, aTransition) ) );
+
+ ++mSize;
+ checkIncrementation( aTransition );
+ }
+
+ inline void clear()
+ {
+ points.clear();
+ mSize = 0;
+ mUncoveredCount = 0;
+ mGuardCount = 0;
+ mUnconditionalCount = 0;
+ mUnstableCount = 0;
+ }
+
+ inline void copyTrace(AvmTraceProperty & aTraceElement)
+ {
+ TraceSequence::copyTrace( aTraceElement );
+
+ mTransitionCoverage = aTraceElement.mTransitionCoverage;
+
+ mSize = aTraceElement.mSize;
+ mUncoveredCount = aTraceElement.mUncoveredCount;
+ mGuardCount = aTraceElement.mGuardCount;
+ mUnconditionalCount = aTraceElement.mUnconditionalCount;
+ mUnstableCount = aTraceElement.mUnstableCount;
+ }
+
+
+ inline bool empty() const
+ {
+ return( mSize == 0 );
+ }
+
+
+ inline void pop_back(avm_size_t ptsCount)
+ {
+ mSize = mSize - ptsCount;
+ for( ; ptsCount > 0 ; --ptsCount )
+ {
+ checkDecrementation( backTransition() );
+
+ points.pop_back();
+ }
+ }
+
+ inline void pop_front(avm_size_t ptsCount)
+ {
+ mSize = mSize - ptsCount;
+ for( ; ptsCount > 0 ; --ptsCount )
+ {
+ checkDecrementation( frontTransition() );
+
+ points.pop_front();
+ }
+ }
+
+ inline void resize(avm_size_t newSize)
+ {
+ if( newSize == 0 )
+ {
+ clear();
+ }
+ else for( ; mSize > newSize ; --mSize )
+ {
+ checkDecrementation( backTransition() );
+
+ points.pop_back();
+ }
+ }
+
+
+ /**
+ * mSize
+ * mUnconditionalCount
+ * mUnstableCount
+ */
+ void updadeSize();
+
+
+ inline avm_size_t xSize() const
+ {
+// return( mSize );
+// return( mSize - mUnconditionalCount );
+// return( mSize - mUnconditionalCount - mUnstableCount );
+
+// if( backTransition()->isUnstableTarget() )
+// {
+// return( 2 * mSize + mGuardCount -
+// mUncoveredCount - mUnconditionalCount - mUnstableCount );
+// }
+// else
+ {
+ return( mSize + mGuardCount -
+ mUncoveredCount - mUnconditionalCount - mUnstableCount );
+ }
+ }
+
+
+ bool compare( bool (* isComp)(avm_size_t, avm_size_t),
+ const AvmTraceProperty & aTraceElement );
+
+ template< class Compare >
+ bool isInf(Compare isComp, const AvmTraceProperty & aTraceElement)
+ {
+ return( isComp(xSize(), aTraceElement.xSize()) );
+ }
+
+ template< class Compare >
+ bool isSup(Compare isComp, const AvmTraceProperty & aTraceElement)
+ {
+ return( isComp(xSize(), aTraceElement.xSize()) );
+ }
+
+
+ inline bool sizeEQ(const AvmTraceProperty & aTraceElement) const
+ {
+ return( xSize() == aTraceElement.xSize() );
+ }
+
+ inline bool sizeGT(const AvmTraceProperty & aTraceElement) const
+ {
+ return( xSize() > aTraceElement.xSize() );
+ }
+
+ inline bool sizeGTE(const AvmTraceProperty & aTraceElement) const
+ {
+ return( xSize() >= aTraceElement.xSize() );
+ }
+
+ inline bool sizeLT(const AvmTraceProperty & aTraceElement) const
+ {
+ return( xSize() < aTraceElement.xSize() );
+ }
+
+ inline bool sizeLTE(const AvmTraceProperty & aTraceElement) const
+ {
+ return( xSize() <= aTraceElement.xSize() );
+ }
+
+
+ /**
+ * back / front;
+ * AvmTransition
+ */
+ inline AvmTransition * backTransition() const
+ {
+ return( points.back().to_ptr< TracePoint >()->
+ object->to< AvmTransition >() );
+ }
+
+ inline AvmTransition * frontTransition() const
+ {
+ return( points.front().to_ptr< TracePoint >()->
+ object->to< AvmTransition >() );
+ }
+
+ /**
+ * Serialization
+ */
+ virtual void toStream(OutStream & os, bool verbose = false) const;
+
+};
+
+
+DEFINE_LIST_REF( AvmTraceProperty )
+
+
+
+class AvmCoverageDirectiveTraceBuilder : public IHeuristicClass
+{
+
+protected:
+ /**
+ * TYPEDEF
+ */
+ typedef List< ListOfAvmTransition > ListOfListOfAvmTransition;
+
+
+ /**
+ * ATTRIBUTE
+ */
+ const ExecutionContext * mEC;
+ APExecutionData mED;
+ RuntimeID mRID;
+ AvmTransition * mTransition;
+
+ TracePoint * mTransitionPoint;
+ AvmTraceProperty mTraceElement;
+
+ avm_size_t mComputingPathCountLimit;
+ avm_size_t mComputingPathSizeLimit;
+
+ bool mGoalAchievedFlag;
+
+// ListOfAvmTransition mTransitionPath;
+// ListOfInstanceOfPort mExpectedInput;
+ InstanceOfBuffer mVirtualBuffer;
+ LifoBuffer mEmitOutput;
+
+ TableOfRuntimeFormState mTableOfRuntimeStatus;
+
+
+ // computing variable for method << computePathToTransition >>
+ ListOfListOfAvmTransition anyTransitionPaths;
+ ListOfListOfAvmTransition prefixLoopTransitionPaths;
+
+ ListOfAvmTransition outgoingTransitions;
+ ListOfAvmTransition aTransitionPath;
+ ListOfAvmTransition::const_iterator itTrans;
+ ListOfAvmTransition::const_iterator endTrans;
+
+ InstanceOfMachine * tgtInstance;
+ ExecutableForm * fwdMachine;
+ ExecutableForm * tgtMachine;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmCoverageDirectiveTraceBuilder(
+ ENUM_HEURISTIC_CLASS anHeuristicClass = HEURISTIC_SMART_CLASS,
+ avm_size_t pathCountLimit = 32, avm_size_t pathSizeLimit = 32)
+ : IHeuristicClass( anHeuristicClass ),
+ mEC( NULL ),
+ mED( ),
+ mRID( ),
+
+ mTransition( NULL ),
+ mTransitionPoint( NULL ),
+
+ mTraceElement( ),
+
+ mComputingPathCountLimit( pathCountLimit ),
+ mComputingPathSizeLimit( pathSizeLimit ),
+
+ mGoalAchievedFlag( false ),
+
+ //mTransitionPath( ),
+ //mExpectedInput( ),
+ mVirtualBuffer(NULL, NULL, 0, TYPE_MULTI_LIFO_SPECIFIER, -1),
+ mEmitOutput( & mVirtualBuffer ),
+
+ mTableOfRuntimeStatus( 0 ),
+
+ // computing variable for method << computePathToTransition >>
+ anyTransitionPaths( ),
+ prefixLoopTransitionPaths( ),
+
+ outgoingTransitions( ),
+ aTransitionPath( ),
+ itTrans( ),
+ endTrans( ),
+
+ tgtInstance( NULL ),
+ fwdMachine( NULL ),
+ tgtMachine( NULL )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ AvmCoverageDirectiveTraceBuilder(
+ const ExecutionContext * anEC, TracePoint * tpTransition,
+ ENUM_HEURISTIC_CLASS anHeuristicClass = HEURISTIC_SMART_CLASS,
+ avm_size_t pathCountLimit = 64, avm_size_t pathSizeLimit = 64);
+
+ AvmCoverageDirectiveTraceBuilder(const ExecutionContext * anEC,
+ const RuntimeID & aRID, AvmTransition * aTransition,
+ ENUM_HEURISTIC_CLASS anHeuristicClass = HEURISTIC_SMART_CLASS,
+ avm_size_t pathCountLimit = 16, avm_size_t pathSizeLimit = 16);
+
+
+ /**
+ * mComputingPathCountLimit
+ * mComputingPathSizeLimit
+ */
+ void setComputingLimit(avm_size_t pathCountLimit, avm_size_t pathSizeLimit)
+ {
+ mComputingPathCountLimit = pathCountLimit;
+ mComputingPathSizeLimit = pathSizeLimit;
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Configure
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool configure(AvmTraceProperty & aTraceElement,
+ const ExecutionContext * anEC, TracePoint * tpTransition,
+ ENUM_HEURISTIC_CLASS anHeuristicClass = HEURISTIC_SMART_CLASS,
+ avm_size_t pathCountLimit = 64, avm_size_t pathSizeLimit = 64);
+
+ bool configure(AvmTraceProperty & aTraceElement,
+ const ExecutionContext * anEC,
+ const RuntimeID & aRID, AvmTransition * aTransition,
+ ENUM_HEURISTIC_CLASS anHeuristicClass = HEURISTIC_SMART_CLASS,
+ avm_size_t pathCountLimit = 16, avm_size_t pathSizeLimit = 16);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // API
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool initialize();
+
+ bool computePath();
+
+ bool computePath(AvmTraceProperty & aTraceElement);
+
+ bool computePath(AvmTraceProperty & aTraceElement, ExecutionContext * anEC,
+ const RuntimeID & aRID, AvmTransition * aTransition,
+ ENUM_HEURISTIC_CLASS anHeuristicClass = HEURISTIC_SMART_CLASS,
+ avm_size_t pathCountLimit = 16, avm_size_t pathSizeLimit = 16);
+
+ void report(OutStream & os);
+
+
+ bool computePath(const RuntimeID & aRID, AvmTransition * aTransition);
+
+ bool fireTransition(const RuntimeID & aRID, AvmTransition * aTransition);
+
+ void traceTransition(const RuntimeID & aRID, AvmTransition * aTransition);
+
+ bool computePathToTransition(
+ const RuntimeID & aRID, AvmTransition * aTransition);
+
+
+ inline bool computePathFromRunnable(
+ const RuntimeID & aRID, AvmTransition * aTransition)
+ {
+ switch( mHeuristicClass )
+ {
+ case IHeuristicClass::HEURISTIC_BASIC_CLASS:
+ {
+ return( computeBasicPathFromRunnable(aRID, aTransition) );
+ }
+
+ case IHeuristicClass::HEURISTIC_NAIVE_CLASS:
+ case IHeuristicClass::HEURISTIC_SMART_CLASS:
+ case IHeuristicClass::HEURISTIC_AGRESSIVE_CLASS:
+ case IHeuristicClass::HEURISTIC_NOTHING_ELSE_CLASS:
+ default:
+ {
+ return( computeSmartPathFromRunnable(aRID, aTransition) );
+ }
+ }
+ }
+
+ bool computeBasicPathFromRunnable(
+ const RuntimeID & aRID, AvmTransition * aTransition);
+
+ bool computeSmartPathFromRunnable(
+ const RuntimeID & aRID, AvmTransition * aTransition);
+
+
+ bool computePathToInput(
+ const RuntimeID & aRID, InstanceOfPort * anInputTrace);
+
+
+ bool computePathToTransition(
+ const RuntimeID & aRID, AvmTransition * aTransition,
+ ListOfAvmTransition & oneTransitionPath);
+
+ bool computePathToTransition(
+ const RuntimeID & aRID, AvmTransition * aTransition,
+ ListOfListOfAvmTransition & allTransitionPaths);
+
+ void computeTargetMachine(RuntimeID & aRID, AvmCode * aCode);
+
+};
+
+
+} /* namespace sep */
+
+#endif /* AVM_PROCESS_COVERAGE_AVMCOVERAGEDIRECTIVETRACEBUILDER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageHeuristicProperty.cpp b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageHeuristicProperty.cpp
new file mode 100644
index 0000000..b8d23c0
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageHeuristicProperty.cpp
@@ -0,0 +1,305 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 15 janv. 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmCoverageHeuristicProperty.h"
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+namespace sep
+{
+
+
+/**
+ *
+ * strHeuristicWeight
+ */
+std::string IHeuristicContextWeight::strHeuristicWeight(avm_uint8_t aWeight)
+{
+ switch( aWeight )
+ {
+ case WEIGHT_SELECTED_ACHIEVABLE : return( "SELECTED_ACHIEVABLE" );
+
+ case WEIGHT_CERTAINLY_ACHIEVABLE : return( "CERTAINLY_ACHIEVABLE" );
+ case WEIGHT_STRONGLY_ACHIEVABLE : return( "STRONGLY_ACHIEVABLE" );
+ case WEIGHT_WEAKLY_ACHIEVABLE : return( "WEAKLY_ACHIEVABLE" );
+
+ case WEIGHT_NON_PRIORITY : return( "NON_PRIORITY" );
+ case WEIGHT_UNKNOWN_ACHIEVABLE : return( "UNKNOWN_ACHIEVABLE" );
+
+ case WEIGHT_NON_ACHIEVABLE : return( "UNACHIEVABLE" );
+
+ default: return( to_string( static_cast< int >(aWeight) ) );
+ }
+}
+
+
+/**
+ * SETTER
+ * mHeuristicClass
+ */
+IHeuristicClass::ENUM_HEURISTIC_CLASS
+IHeuristicClass::incrHeuristicClass(ENUM_HEURISTIC_CLASS anHeuristicClass)
+{
+ switch( anHeuristicClass )
+ {
+ case HEURISTIC_BASIC_CLASS:
+ {
+ return( HEURISTIC_NAIVE_CLASS );
+ }
+
+ case HEURISTIC_NAIVE_CLASS:
+ {
+ return( HEURISTIC_SMART_CLASS );
+ }
+
+ case HEURISTIC_SMART_CLASS:
+ {
+ return( HEURISTIC_AGRESSIVE_CLASS );
+ }
+
+ case HEURISTIC_AGRESSIVE_CLASS:
+ {
+ return( HEURISTIC_NOTHING_ELSE_CLASS );
+ }
+
+ case HEURISTIC_NOTHING_ELSE_CLASS:
+ default:
+ {
+ return( HEURISTIC_NOTHING_ELSE_CLASS );
+ }
+ }
+}
+
+
+std::string IHeuristicClass::strHeuristicClass(
+ ENUM_HEURISTIC_CLASS anHeuristicClass)
+{
+ switch( anHeuristicClass )
+ {
+ case HEURISTIC_BASIC_CLASS:
+ {
+ return( "HEURISTIC_BASIC_CLASS" );
+ }
+
+ case HEURISTIC_NAIVE_CLASS:
+ {
+ return( "HEURISTIC_NAIVE_CLASS" );
+ }
+
+ case HEURISTIC_SMART_CLASS:
+ {
+ return( "HEURISTIC_SMART_CLASS" );
+ }
+
+ case HEURISTIC_AGRESSIVE_CLASS:
+ {
+ return( "HEURISTIC_AGRESSIVE_CLASS" );
+ }
+
+ case HEURISTIC_NOTHING_ELSE_CLASS:
+ {
+ return( "HEURISTIC_NOTHING_ELSE_CLASS" );
+ }
+
+ default:
+ {
+ return( "UNKNOWN< HEURISTIC_CLASS >" );
+ }
+ }
+}
+
+
+IHeuristicClass::ENUM_HEURISTIC_CLASS
+IHeuristicClass::toHeuristicClass(const std::string & strHeuristicClass)
+{
+ std::string aHeuristicClass = strHeuristicClass;
+ StringTools::tolower(aHeuristicClass);
+
+ if( aHeuristicClass == "basic" )
+ {
+ return( HEURISTIC_BASIC_CLASS );
+ }
+ else if( aHeuristicClass == "naive" )
+ {
+ return( HEURISTIC_NAIVE_CLASS );
+ }
+ else if( aHeuristicClass == "smart" )
+ {
+ return( HEURISTIC_SMART_CLASS );
+
+ }
+ else if( aHeuristicClass == "agressive" )
+ {
+ return( HEURISTIC_AGRESSIVE_CLASS );
+ }
+
+ return( HEURISTIC_BASIC_CLASS );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+
+/*******************************************************************************
+prototype process::processID as &avm::processor.PROCESSOR_TYPE_ID is
+ section HEURISTIC
+ // Active l'utilisation d'heuristique
+ @heuristic = true;
+
+ // choix de l'heuristique de départ
+ // basic | naive | smart | agressive
+ @heuristic#start = 'basic';
+
+ // Nombre d'essais d'heuristiques
+ @heuristic#trials = 7;
+
+ // Critère de satisfaction du succès des heuristiques
+ // taux de couverte / nombre d'élément restant...
+ @objective#rate = 95;
+ @objective#rest = 5;
+
+ // Limitation de la taille des chemins/traces couvrants recherchés
+ @directive#trace#heuristic = 'smart';
+ @directive#trace#count#limit = 8;
+ @directive#trace#size#limit = 8;
+
+ // Choix des contextes avec des transitions
+ // [ fortement | faiblement | autre ] tirables
+
+ // Limitations temporaire de la profondeur d'exploration
+ @coverage#height = 7;
+
+ // nombre de fois que la limite doit être atteint avant de l'augmenter
+ @coverage#height#reached#limit = 42;
+
+ @hit#strongly#random = false;
+ @hit#strongly#count = 1;
+
+ @hit#weakly#random = false;
+ @hit#weakly#count = 1;
+
+ @hit#other#random = false;
+ @hit#other#count = 1;
+
+ @scope = 'DETAILS'; // 'INSTANCE' | 'FORM' | 'DETAILS'
+ endsection HEURISTIC
+endprototype
+
+*******************************************************************************/
+
+bool AvmCoverageHeuristicProperty::configure(WObject * wfParameterObject)
+{
+ long intAttribute = 0;
+
+ WObject * thePROPERTY = Query::getRegexWSequence(
+ wfParameterObject, OR_WID2("property", "PROPERTY"));
+ if( thePROPERTY != WObject::_NULL_ )
+ {
+ mScope = Specifier::toDesignKind(
+ Query::getWPropertyString(thePROPERTY, "scope", "MODEL") );
+
+ mHeuristicEnabled = Query::getWPropertyBoolean(
+ thePROPERTY, "heuristic", true);
+ }
+
+
+ WObject * theHEURISTIC = Query::getRegexWSequence(wfParameterObject,
+ OR_WID2("heuristic", "HEURISTIC"), thePROPERTY);
+ if( theHEURISTIC != WObject::_NULL_ )
+ {
+ Specifier::DESIGN_KIND aScope = Specifier::toDesignKind(
+ Query::getWPropertyString(theHEURISTIC, "scope", "UNDEFINED") );
+ if( aScope != Specifier::DESIGN_UNDEFINED_KIND )
+ {
+ mScope = aScope;
+ }
+
+ // Heuristic enabling
+ mHeuristicEnabled = Query::getWPropertyBoolean(
+ theHEURISTIC, "heuristic", mHeuristicEnabled);
+
+ // Heuristic start class : basic | naive | smart | agressive
+ std::string strHeuristic = Query::getRegexWPropertyString(
+ theHEURISTIC, CONS_WID2("heuristic", "start"), "basic");
+ mHeuristicClass = toHeuristicClass(strHeuristic);
+
+ // Trials limit
+ mHeuristicTrialsLimit = Query::getRegexWPropertySizeT(
+ theHEURISTIC, CONS_WID2("heuristic", "trials"),
+ AVM_NUMERIC_MAX_SIZE_T, AVM_NUMERIC_MAX_SIZE_T);
+ mHeuristicTrialsCount = 0;
+
+ // Objective & Goal
+ intAttribute = Query::getRegexWPropertyInt(
+ theHEURISTIC, CONS_WID2("objective", "rate"), 100);
+ mCoverageRateGoal = ( (intAttribute > 0) &&
+ (intAttribute <= 100) ) ? intAttribute : 100;
+
+ mCoverageRestGoal = Query::getRegexWPropertySizeT(
+ theHEURISTIC, CONS_WID2("objective", "rest"), 0, 0);
+
+ // Directive Heuristic
+ strHeuristic = Query::getRegexWPropertyString(theHEURISTIC,
+ CONS_WID3("directive", "trace", "heuristic"), "smart");
+ mDirectiveTraceHeuristicClass = toHeuristicClass(strHeuristic);
+
+ mDirectiveTraceCountLimit = Query::getRegexWPropertyPosSizeT(
+ theHEURISTIC,
+ CONS_WID4("directive", "trace", "count", "limit"),
+ AVM_NUMERIC_MAX_SIZE_T, AVM_NUMERIC_MAX_SIZE_T);
+
+ mDirectiveTraceSizeLimit = Query::getRegexWPropertyPosSizeT(
+ theHEURISTIC,
+ CONS_WID4("directive", "trace", "size", "limit"),
+ AVM_NUMERIC_MAX_SIZE_T, AVM_NUMERIC_MAX_SIZE_T);
+
+
+ mCoverageHeight = mCoverageHeightPeriod =
+ Query::getRegexWPropertySizeT(theHEURISTIC,
+ CONS_WID2("lookahead", "depth") "|"
+ CONS_WID2("coverage", "height"), 0);
+
+ mCoverageHeightReachedLimit = Query::getRegexWPropertySizeT(
+ theHEURISTIC, CONS_WID2("lookahead", "width") "|"
+ CONS_WID4("coverage", "height", "reached", "limit"), 0);
+
+ // Options pour les transitions fortement tirables
+ mHitStronglyRandomFlag = Query::getRegexWPropertyBoolean(
+ theHEURISTIC, CONS_WID3("hit", "strongly", "random"), false);
+
+ mHitStronglyCount = Query::getRegexWPropertyPosSizeT(
+ theHEURISTIC, CONS_WID3("hit", "strongly", "count"), 1);
+
+ // Options pour les transitions faiblement tirables
+ mHitWeaklyRandomFlag = Query::getRegexWPropertyBoolean(
+ theHEURISTIC, CONS_WID3("hit", "weakly", "random"), false);
+
+ mHitWeaklyCount = Query::getRegexWPropertyPosSizeT(
+ theHEURISTIC, CONS_WID3("hit", "weakly", "count"), 1);
+
+ // Options pour les autres transitions tirables ?
+ mHitOtherRandomFlag = Query::getRegexWPropertyBoolean(
+ theHEURISTIC, CONS_WID3("hit", "other", "random"), false);
+
+ mHitOtherCount = Query::getRegexWPropertyPosSizeT(
+ theHEURISTIC, CONS_WID3("hit", "other", "count"), 1);
+ }
+
+ return( true );
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageHeuristicProperty.h b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageHeuristicProperty.h
new file mode 100644
index 0000000..0c20cea
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageHeuristicProperty.h
@@ -0,0 +1,307 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 15 janv. 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCOVERAGEHEURISTICPROPERTY_H_
+#define AVMCOVERAGEHEURISTICPROPERTY_H_
+
+#include <util/avm_numeric.h>
+#include <util/avm_string.h>
+
+#include <fml/common/SpecifierElement.h>
+
+
+namespace sep
+{
+
+class WObject;
+
+
+/**
+ * Execution Context Heuristic Weight
+ */
+class IHeuristicContextWeight
+{
+
+public:
+ enum ENUM_HEURISTIC_CLASS
+ {
+ WEIGHT_SELECTED_ACHIEVABLE = 0,
+
+ WEIGHT_CERTAINLY_ACHIEVABLE = 1,
+ WEIGHT_STRONGLY_ACHIEVABLE = 2,
+ WEIGHT_WEAKLY_ACHIEVABLE = 3,
+
+ WEIGHT_NON_PRIORITY = 4,
+ WEIGHT_UNKNOWN_ACHIEVABLE = 5,
+
+ WEIGHT_NON_ACHIEVABLE = 6,
+ };
+
+
+ static std::string strHeuristicWeight(avm_uint8_t aWeight);
+
+};
+
+
+/**
+ * Heuristic class
+ */
+class IHeuristicClass
+{
+
+public:
+
+ enum ENUM_HEURISTIC_CLASS
+ {
+ HEURISTIC_BASIC_CLASS,
+
+ HEURISTIC_NAIVE_CLASS,
+
+ HEURISTIC_SMART_CLASS,
+
+ HEURISTIC_AGRESSIVE_CLASS,
+
+ HEURISTIC_NOTHING_ELSE_CLASS
+ };
+
+
+ /*
+ * ATTRIBUTES
+ */
+ ENUM_HEURISTIC_CLASS mHeuristicClass;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ IHeuristicClass(
+ ENUM_HEURISTIC_CLASS anHeuristicClass = HEURISTIC_BASIC_CLASS)
+ : mHeuristicClass( anHeuristicClass )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ IHeuristicClass(const IHeuristicClass & aHeuristic)
+ : mHeuristicClass( aHeuristic.mHeuristicClass )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~IHeuristicClass()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * SETTER
+ * mHeuristicClass
+ */
+ static ENUM_HEURISTIC_CLASS incrHeuristicClass(
+ ENUM_HEURISTIC_CLASS anHeuristicClass);
+
+ inline void incrHeuristicClass()
+ {
+ mHeuristicClass = incrHeuristicClass( mHeuristicClass );
+ }
+
+
+ inline void resetHeuristicClass(
+ ENUM_HEURISTIC_CLASS anHeuristicClass = HEURISTIC_BASIC_CLASS)
+ {
+ mHeuristicClass = anHeuristicClass;
+ }
+
+
+ static std::string strHeuristicClass(ENUM_HEURISTIC_CLASS anHeuristicClass);
+
+ inline std::string strHeuristicClass() const
+ {
+ return( strHeuristicClass(mHeuristicClass) );
+ }
+
+ static ENUM_HEURISTIC_CLASS toHeuristicClass(
+ const std::string & strHeuristicClass);
+
+};
+
+
+
+/*
+ * The General Coverage Heuristic Property
+ */
+class AvmCoverageHeuristicProperty : public IHeuristicClass
+{
+
+public:
+ /*
+ * ATTRIBUTES
+ */
+ Specifier::DESIGN_KIND mScope;
+
+ bool mHeuristicEnabled;
+ avm_size_t mHeuristicTrialsLimit;
+ avm_size_t mHeuristicTrialsCount;
+
+ avm_size_t mCoverageRateGoal;
+ avm_size_t mCoverageRestGoal;
+
+ ENUM_HEURISTIC_CLASS mDirectiveTraceHeuristicClass;
+ avm_size_t mDirectiveTraceCountLimit;
+ avm_size_t mDirectiveTraceSizeLimit;
+
+ avm_size_t mCoverageHeightPeriod;
+ avm_size_t mCoverageHeight;
+
+ avm_size_t mCoverageHeightReachedCount;
+ avm_size_t mCoverageHeightReachedLimit;
+ bool mCoverageHeightReachedFlag;
+
+ bool mHitCertainlyRandomFlag;
+ avm_size_t mHitCertainlyCount;
+
+ bool mHitStronglyRandomFlag;
+ avm_size_t mHitStronglyCount;
+
+ bool mHitWeaklyRandomFlag;
+ avm_size_t mHitWeaklyCount;
+
+ bool mHitOtherRandomFlag;
+ avm_size_t mHitOtherCount;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmCoverageHeuristicProperty(
+ ENUM_HEURISTIC_CLASS anHeuristicClass = HEURISTIC_BASIC_CLASS)
+ : IHeuristicClass( anHeuristicClass ),
+
+ mScope( Specifier::DESIGN_MODEL_KIND ),
+
+ mHeuristicEnabled( true ),
+
+ mHeuristicTrialsLimit( 7 ),
+ mHeuristicTrialsCount( 0 ),
+
+ mCoverageRateGoal( 100 ),
+ mCoverageRestGoal( 0 ),
+
+ mDirectiveTraceHeuristicClass( HEURISTIC_SMART_CLASS ),
+ mDirectiveTraceCountLimit( 8 ),
+ mDirectiveTraceSizeLimit( 8 ),
+
+ mCoverageHeightPeriod( 0 ),
+ mCoverageHeight( 0 ),
+
+ mCoverageHeightReachedCount( 0 ),
+ mCoverageHeightReachedLimit( 1 ),
+ mCoverageHeightReachedFlag( false ),
+
+ mHitCertainlyRandomFlag( false ),
+ mHitCertainlyCount( 1 ),
+
+ mHitStronglyRandomFlag( false ),
+ mHitStronglyCount( 1 ),
+
+ mHitWeaklyRandomFlag( false ),
+ mHitWeaklyCount( 1 ),
+
+ mHitOtherRandomFlag( false ),
+ mHitOtherCount( 1 )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ AvmCoverageHeuristicProperty(const AvmCoverageHeuristicProperty & aCHP)
+ : IHeuristicClass( aCHP ),
+
+ mScope( aCHP.mScope ),
+
+ mHeuristicEnabled( aCHP.mHeuristicEnabled ),
+
+ mHeuristicTrialsLimit( aCHP.mHeuristicTrialsLimit ),
+ mHeuristicTrialsCount( aCHP.mHeuristicTrialsCount ),
+
+ mCoverageRateGoal( aCHP.mCoverageRateGoal ),
+ mCoverageRestGoal( aCHP.mCoverageRestGoal ),
+
+ mDirectiveTraceHeuristicClass( aCHP.mDirectiveTraceHeuristicClass ),
+ mDirectiveTraceCountLimit( aCHP.mDirectiveTraceCountLimit ),
+ mDirectiveTraceSizeLimit( aCHP.mDirectiveTraceSizeLimit ),
+
+ mCoverageHeightPeriod( aCHP.mCoverageHeightPeriod ),
+ mCoverageHeight( aCHP.mCoverageHeight ),
+
+ mCoverageHeightReachedCount( aCHP.mCoverageHeightReachedCount ),
+ mCoverageHeightReachedLimit( aCHP.mCoverageHeightReachedLimit ),
+ mCoverageHeightReachedFlag( aCHP.mCoverageHeightReachedFlag ),
+
+ mHitCertainlyRandomFlag( aCHP.mHitCertainlyRandomFlag ),
+ mHitCertainlyCount( aCHP.mHitCertainlyCount ),
+
+ mHitStronglyRandomFlag( aCHP.mHitStronglyRandomFlag ),
+ mHitStronglyCount( aCHP.mHitStronglyCount ),
+
+ mHitWeaklyRandomFlag( aCHP.mHitWeaklyRandomFlag ),
+ mHitWeaklyCount( aCHP.mHitWeaklyCount ),
+
+ mHitOtherRandomFlag( aCHP.mHitOtherRandomFlag ),
+ mHitOtherCount( aCHP.mHitOtherCount )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AvmCoverageHeuristicProperty()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool configure(WObject * wfParameterObject);
+
+};
+
+
+} /* namespace sep */
+
+#endif /* AVMCOVERAGEHEURISTICPROPERTY_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageOneTraceDriver.cpp b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageOneTraceDriver.cpp
new file mode 100644
index 0000000..b410c84
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageOneTraceDriver.cpp
@@ -0,0 +1,779 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 19 nov. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmCoverageOneTraceDriver.h"
+
+#include "AvmCoverageProcessor.h"
+#include "AvmCoverageTransitionView.h"
+
+#include <fml/executable/AvmTransition.h>
+
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeID.h>
+
+#include <fml/trace/TracePoint.h>
+
+#include <fam/coverage/AvmCoverageTransitionView.h>
+
+#include <fam/queue/WaitingStrategy.h>
+
+#include <sew/SymbexControllerRequestManager.h>
+
+#include <functional>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+AvmCoverageOneTraceDriver::AvmCoverageOneTraceDriver(
+ AvmCoverageProcessor & aCoverageProcessor, EvaluationEnvironment & anENV,
+ IHeuristicClass::ENUM_HEURISTIC_CLASS anHeuristicClass,
+ avm_size_t pathCountLimit, avm_size_t pathSizeLimit)
+: AvmCoverageAbstractView( aCoverageProcessor , NULL ),
+mTransitionCoverage( aCoverageProcessor.mTransitionCoverage ),
+ENV( anENV ),
+mTraceChecker( anENV ),
+
+mComputingPathCountLimit( pathCountLimit ),
+mComputingPathSizeLimit( pathSizeLimit ),
+mPathChecker(anHeuristicClass, pathCountLimit, pathSizeLimit),
+
+mTransitionTargetHistory( ),
+
+mCacheForDirectiveTraces( ),
+mDirectiveEC( NULL ),
+
+mDefaultPendingTraceSize( 4 ),
+
+mPendingTrace( & aCoverageProcessor.mTransitionCoverage ),
+
+mWaitingQueue( ),
+
+mGlobalUncoveredTransitions( ),
+mLastCollectedCoverCount( 0 ),
+
+mLocalUncoveredTransitions( ),
+
+// Computing drive variable
+saveWeightMin( 0 ),
+
+coverageMax( 0 ),
+coverageCount( 0 ),
+
+tmpTracePoint( NULL ),
+itTP( ),
+endTP( ),
+
+tmpTransition( NULL ),
+itTransition( ),
+endTransition( ),
+
+itTrace( ),
+endTrace( )
+{
+ // TODO Auto-generated constructor stub
+
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmCoverageOneTraceDriver::configureImpl()
+{
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// PROCESSOR FILTER API
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmCoverageOneTraceDriver::prefiltering(ListOfExecutionContext & ecQueue)
+{
+// endQueue = ecQueue.end();
+// for( itQueue = ecQueue.begin() ; itQueue != endQueue ; ++itQueue )
+// {
+//
+// }
+
+ return( true );
+}
+
+bool AvmCoverageOneTraceDriver::postfiltering(ListOfExecutionContext & ecQueue)
+{
+ itQueue = ecQueue.begin();
+ endQueue = ecQueue.end();
+ for( ; itQueue != endQueue ; ++itQueue )
+ {
+ if( (*itQueue) == mDirectiveEC )
+ {
+ if( drive() )
+ {
+ return( true );
+ }
+ }
+ }
+
+ mCoverageProcessor.setRequestRequeueWaiting();
+
+ return( false );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// PROCESSOR REQUEST API
+////////////////////////////////////////////////////////////////////////////////
+/**
+ * REQUEUE_WAITING
+ */
+bool AvmCoverageOneTraceDriver::requeueWaitingTable(
+ WaitingStrategy & aWaitingStrategy,
+ avm_uint8_t aWeightMin, avm_uint8_t aWeightMax)
+{
+ // Global Update Cache for Directive Traces !!!
+ updateCacheForDirectiveTraces();
+
+
+ mWaitingQueue.clear();
+
+ saveWeightMin = aWeightMin;
+
+ aWeightMin = aWaitingStrategy.splicePriorQueueTable(
+ mWaitingQueue, saveWeightMin, aWeightMax);
+
+// while( aWeightMin <= WEIGHT_WEAKLY_ACHIEVABLE )
+ while( aWeightMin <= WEIGHT_NON_PRIORITY )
+ {
+ itQueue = mWaitingQueue.begin();
+ endQueue = mWaitingQueue.end();
+ for( ; itQueue != endQueue ; ++itQueue )
+ {
+ if( checkDirectiveTrace(* (*itQueue)) )
+ {
+ (*itQueue)->setWeight( WEIGHT_SELECTED_ACHIEVABLE );
+
+ aWaitingStrategy.push( *itQueue );
+
+ itQueue = mWaitingQueue.erase( itQueue );
+
+ aWaitingStrategy.splice(aWeightMin, mWaitingQueue);
+
+ return( setDirectiveTrace() );
+ }
+ }
+
+ aWaitingStrategy.splice(aWeightMin, mWaitingQueue);
+
+ aWeightMin = aWaitingStrategy.splicePriorQueueTable(
+ mWaitingQueue, ++aWeightMin, aWeightMax);
+ }
+
+ aWaitingStrategy.splice(aWeightMin, mWaitingQueue);
+
+
+ if( mGlobalUncoveredTransitions.empty() )
+ {
+ mLastCollectedCoverCount = mCoverageStatistics.mNumberOfCovered;
+
+ mTransitionCoverage.collectUncoveredTransition(
+ mGlobalUncoveredTransitions);
+ }
+ else if( mLastCollectedCoverCount < mCoverageStatistics.mNumberOfCovered )
+ {
+ mLastCollectedCoverCount = mCoverageStatistics.mNumberOfCovered;
+
+ mTransitionCoverage.updateUncoveredTransition(
+ mGlobalUncoveredTransitions);
+ }
+
+
+ aWeightMin = aWaitingStrategy.splicePriorQueueTable(
+ mWaitingQueue, saveWeightMin, aWeightMax);
+
+ while( aWeightMin <= WEIGHT_UNKNOWN_ACHIEVABLE )
+ {
+ itQueue = mWaitingQueue.begin();
+ endQueue = mWaitingQueue.end();
+ for( ; itQueue != endQueue ; ++itQueue )
+ {
+ if( checkDirectiveTrace(*(*itQueue), mGlobalUncoveredTransitions) )
+ {
+ (*itQueue)->setWeight( WEIGHT_SELECTED_ACHIEVABLE );
+
+ aWaitingStrategy.push( *itQueue );
+
+ itQueue = mWaitingQueue.erase( itQueue );
+
+ aWaitingStrategy.splice(aWeightMin, mWaitingQueue);
+
+ return( setDirectiveTrace() );
+ }
+ }
+
+ aWaitingStrategy.splice(aWeightMin, mWaitingQueue);
+
+ aWeightMin = aWaitingStrategy.splicePriorQueueTable(
+ mWaitingQueue, ++aWeightMin, aWeightMax);
+ }
+
+ aWaitingStrategy.splice(aWeightMin, mWaitingQueue);
+
+ if( selectDirectiveTrace() )
+ {
+ aWaitingStrategy.remove( mDirectiveEC );
+
+ mDirectiveEC->setWeight( WEIGHT_SELECTED_ACHIEVABLE );
+
+ aWaitingStrategy.push( mDirectiveEC );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << "selectDirectiveTrace :> ";
+ mDirectiveEC->traceMinimum(AVM_OS_TRACE);
+ aWaitingStrategy.toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ resetFailedTransitionTargetHistory();
+
+ return( setDirectiveTrace() );
+ }
+
+ resetFailedTransitionTargetHistory();
+
+ mCoverageProcessor.setRequestHeuristic();
+
+ return( false );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// TRACE DRIVER API
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * UPDATE
+ * mCacheForDirectiveTraces
+ */
+void AvmCoverageOneTraceDriver::appendDirectiveTraces(AvmTraceProperty & aTrace)
+{
+ if( mCacheForDirectiveTraces.empty() )
+ {
+ mCacheForDirectiveTraces.push_back( aTrace );
+ }
+// else if( aTrace.isInf( std::less<avm_size_t>(),
+// mCacheForDirectiveTraces.front() ) )
+ else if( aTrace.sizeLT( mCacheForDirectiveTraces.front() ) )
+ {
+ mCacheForDirectiveTraces.push_front( aTrace );
+ }
+ else if( aTrace.sizeGT( mCacheForDirectiveTraces.back() ) )
+ {
+ mCacheForDirectiveTraces.push_back( aTrace );
+ }
+ else
+ {
+ itTrace = mCacheForDirectiveTraces.begin();
+ endTrace = mCacheForDirectiveTraces.end();
+ for( ; itTrace != endTrace ; ++itTrace )
+ {
+ if( aTrace.sizeLT( *itTrace ) )
+ {
+ break;
+ }
+ }
+ mCacheForDirectiveTraces.insert(itTrace, aTrace);
+ }
+}
+
+
+bool AvmCoverageOneTraceDriver::checkDirectiveContext(
+ const ExecutionContext & aDirectiveEC, AvmTransition * aTransition)
+{
+ itTrace = mCacheForDirectiveTraces.begin();
+ endTrace = mCacheForDirectiveTraces.end();
+ for( ; itTrace != endTrace ; ++itTrace )
+ {
+ if( ((& aDirectiveEC) == (*itTrace).mEC) &&
+ (aTransition == (*itTrace).backTransition()) )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+
+bool AvmCoverageOneTraceDriver::computeDirectiveTrace(
+ const ExecutionContext & aDirectiveEC, AvmTransition * aTransition)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << TAB << "AvmCoverageTraceDriver :>" << AVM_STR_INDENT;
+ aDirectiveEC.traceMinimum(AVM_OS_TRACE);
+ AVM_OS_TRACE << END_INDENT;
+ AVM_OS_TRACE << " |= " ; aTransition->toStreamHeader(AVM_OS_TRACE);
+ AVM_OS_TRACE << std::endl;// << INCR_INDENT;
+// AvmTransition::toStream(AVM_OS_TRACE, mTransitionTargetHistory);
+// AVM_OS_TRACE << DECR_INDENT;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+
+// if( mTransitionTargetHistory.contains(aTransition) )
+// {
+// return( false );
+// }
+// else
+ if( checkDirectiveContext(aDirectiveEC, aTransition) )
+ {
+ return( false );
+ }
+ else
+ {
+ mPendingTrace.clear();
+
+ mDirectiveEC = const_cast< ExecutionContext *>( & aDirectiveEC );
+
+ RuntimeID aRID = aDirectiveEC.refExecutionData().getRuntimeID(
+ aTransition->getExecutable() );
+
+ if( mPathChecker.computePath(mPendingTrace,
+ mDirectiveEC, aRID, aTransition,
+ mHeuristicProperty.mDirectiveTraceHeuristicClass,
+ mHeuristicProperty.mDirectiveTraceCountLimit,
+ mHeuristicProperty.mDirectiveTraceSizeLimit) )
+ {
+ mPendingTrace.mEC = (& aDirectiveEC);
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ mPathChecker.report(AVM_OS_COUT);
+ mPathChecker.report(AVM_OS_TRACE);
+ AVM_OS_TRACE << REPEAT(">>>>>>>>>>", 10) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ return( true );
+ }
+
+ return( false );
+ }
+}
+
+
+bool AvmCoverageOneTraceDriver::selectDirectiveTrace()
+{
+ if( mCacheForDirectiveTraces.nonempty() )
+ {
+ toStreamCache( AVM_OS_TRACE , "selectDirectiveTrace" );
+
+ mPendingTrace.clear();
+ mPendingTrace.copyTrace( mCacheForDirectiveTraces.front() );
+
+ mDirectiveEC = const_cast< ExecutionContext * >( mPendingTrace.mEC );
+
+ mCacheForDirectiveTraces.pop_front();
+
+ return( true );
+ }
+
+ return( false );
+}
+
+bool AvmCoverageOneTraceDriver::setDirectiveTrace()
+{
+ mTransitionTargetHistory.push_front( mPendingTrace.backTransition() );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << std::endl << REPEAT("++++++++++", 10) << std::endl;
+ AVM_OS_TRACE << "ObjectiveTrace:> " << mDirectiveEC->str_min() << std::endl;
+ mPendingTrace.toStream(AVM_OS_TRACE, true);
+ AVM_OS_TRACE << REPEAT("++++++++++", 10) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ return( true );
+}
+
+
+
+
+bool AvmCoverageOneTraceDriver::updateCacheForDirectiveTraces(
+ const ExecutionContext & anEC)
+{
+ bool isUpdated = false;
+
+ if( //(mLastCollectedCoverCount == mCoverageStatistics.mNumberOfCovered) ||
+ mCacheForDirectiveTraces.empty() )
+ {
+ return( isUpdated );
+ }
+
+ endTrace = mCacheForDirectiveTraces.end();
+ for( itTrace = mCacheForDirectiveTraces.begin() ; itTrace != endTrace ; )
+ {
+ if( (*itTrace).mEC == (& anEC) )
+ {
+ isUpdated = true;
+
+ itTrace = mCacheForDirectiveTraces.erase( itTrace );
+ }
+ else
+ {
+ ++itTrace;
+ }
+ }
+
+ return( isUpdated );
+}
+
+
+bool AvmCoverageOneTraceDriver::updateCacheForDirectiveTraces(
+ AvmTransition * aTransition)
+{
+ bool isUpdated = false;
+
+ mTransitionTargetHistory.remove( aTransition );
+
+ if( //(mLastCollectedCoverCount == mCoverageStatistics.mNumberOfCovered) ||
+ mCacheForDirectiveTraces.empty() )
+ {
+ return( isUpdated );
+ }
+
+ endTrace = mCacheForDirectiveTraces.end();
+ for( itTrace = mCacheForDirectiveTraces.begin() ; itTrace != endTrace ; )
+ {
+ tmpTransition = (*itTrace).backTransition();
+
+ if( tmpTransition == aTransition )
+ {
+ isUpdated = true;
+
+ itTrace = mCacheForDirectiveTraces.erase( itTrace );
+ }
+ else
+ {
+ ++itTrace;
+ }
+ }
+
+ return( isUpdated );
+}
+
+
+bool AvmCoverageOneTraceDriver::updateCacheForDirectiveTraces()
+{
+// mCacheForDirectiveTraces.clear();
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << "updateCacheForDirectiveTraces:> size: "
+ << mCacheForDirectiveTraces.size() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ updateTransitionTargetHistory();
+
+ bool isUpdated = false;
+
+ if( //(mLastCollectedCoverCount == mCoverageStatistics.mNumberOfCovered) ||
+ mCacheForDirectiveTraces.empty() )
+ {
+ return( isUpdated );
+ }
+
+ endTrace = mCacheForDirectiveTraces.end();
+ for( itTrace = mCacheForDirectiveTraces.begin() ; itTrace != endTrace ; )
+ {
+ tmpTransition = (*itTrace).backTransition();
+
+ if( (*itTrace).mEC->hasNext() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << "remove<EC>";
+ (*itTrace).mEC->traceMinimum( AVM_OS_TRACE );
+ AVM_OS_TRACE << "\ttransition:> " << tmpTransition->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+ isUpdated = true;
+
+ itTrace = mCacheForDirectiveTraces.erase( itTrace );
+ }
+ else if( mTransitionCoverage.testTransitionCoverage( tmpTransition ) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << "remove<transition> ";
+ (*itTrace).mEC->traceMinimum( AVM_OS_TRACE );
+ AVM_OS_TRACE << "\ttransition:> " << tmpTransition->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+ isUpdated = true;
+
+ itTrace = mCacheForDirectiveTraces.erase( itTrace );
+
+ mTransitionTargetHistory.remove( tmpTransition );
+ }
+ else
+ {
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << "preserve :> "; (*itTrace).mEC->traceMinimum( AVM_OS_TRACE );
+ AVM_OS_TRACE << "\ttransition:> " << tmpTransition->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+ ++itTrace;
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << "updateCacheForDirectiveTraces:> size<update>: "
+ << mCacheForDirectiveTraces.size() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ return( isUpdated );
+}
+
+
+bool AvmCoverageOneTraceDriver::updateTransitionTargetHistory()
+{
+ bool isUpdated = false;
+
+ ListOfAvmTransition::iterator itTransition = mTransitionTargetHistory.begin();
+ ListOfAvmTransition::iterator endTransition = mTransitionTargetHistory.end();
+ for( ; itTransition != endTransition ; )
+ {
+ if( mTransitionCoverage.testTransitionCoverage( *itTransition ) )
+ {
+ itTransition = mTransitionTargetHistory.erase( itTransition );
+
+ isUpdated = true;
+ }
+ else
+ {
+ ++itTransition;
+ }
+ }
+
+ return( isUpdated );
+}
+
+/**
+ * Compute a directive trace
+ */
+bool AvmCoverageOneTraceDriver::checkDirectiveTrace(
+ const ExecutionContext & anEC)
+{
+ mLocalUncoveredTransitions.clear();
+
+ mTransitionCoverage.collectUncoveredTransition(
+ anEC.refExecutionData(), mLocalUncoveredTransitions);
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << "checkDirectiveTrace:> local uncovered transitions count: "
+ << mLocalUncoveredTransitions.size() << std::endl;
+ VectorOfAvmTransition::const_iterator itTransition = mLocalUncoveredTransitions.begin();
+ VectorOfAvmTransition::const_iterator endTransition = mLocalUncoveredTransitions.end();
+ for( ; itTransition != endTransition ; ++itTransition )
+ {
+ AVM_OS_TRACE << "\t" << (*itTransition)->strTransitionHeader() << std::endl;
+ }
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+ return( checkDirectiveTrace(anEC, mLocalUncoveredTransitions) );
+}
+
+
+bool AvmCoverageOneTraceDriver::checkDirectiveTrace(
+ const ExecutionContext & anEC,
+ const VectorOfAvmTransition & tableofTransitions)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << std::endl << REPEAT("<<<<<<<<<<", 10) << std::endl;
+ AVM_OS_TRACE << "checkDirectiveTrace:> "; anEC.traceMinimum(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+ itTransition = tableofTransitions.begin();
+ endTransition = tableofTransitions.end();
+ for( ; itTransition != endTransition ; ++itTransition )
+ {
+ if( computeDirectiveTrace(anEC, *itTransition) )
+ {
+ if( mPendingTrace.mSize < mDefaultPendingTraceSize )
+ {
+ return( true );
+ }
+ else
+ {
+ appendDirectiveTraces( mPendingTrace );
+ }
+ }
+ }
+
+ return( false );
+}
+
+
+bool AvmCoverageOneTraceDriver::drive()
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << std::endl << REPEAT("==========", 10) << std::endl;
+ AVM_OS_TRACE << "DirectiveTrace:> " << mDirectiveEC->str_min() << std::endl;
+ mPendingTrace.toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ coverageMax = 0;
+
+ endTP = mPendingTrace.points.end();
+
+ endEC = mDirectiveEC->end();
+ for( itEC = mDirectiveEC->begin() ; itEC != endEC ; ++itEC )
+ {
+ coverageCount = 0;
+
+ for( itTP = mPendingTrace.points.begin() ; itTP != endTP ; ++itTP )
+ {
+ tmpTracePoint = (*itTP).to_ptr< TracePoint >();
+
+ if( mTraceChecker.isSatTransition(*(*itEC),
+ tmpTracePoint, (*itEC)->getRunnableElementTrace()) )
+ {
+ ++coverageCount;
+ }
+ else
+ {
+ if( (coverageCount > 0) && tmpTracePoint->object->
+ as< AvmTransition >()->isUnstableSource() )
+ {
+ coverageCount = 0;
+ }
+
+ break;
+ }
+ }
+
+ if( coverageCount > coverageMax )
+ {
+ coverageMax = coverageCount;
+
+ mDirectiveEC = (*itEC);
+
+ mDirectiveEC->setWeight( WEIGHT_STRONGLY_ACHIEVABLE );
+ }
+ else
+ {
+ mTransitionCoverage.computeWeight( *itEC );
+
+// (*itEC)->setWeight( WEIGHT_NON_PRIORITY );
+ }
+ }
+
+ if( coverageMax > 0 )
+ {
+ if( coverageMax < mPendingTrace.mSize )
+ {
+ mPendingTrace.pop_front( coverageMax );
+
+ mDirectiveEC->setWeight( WEIGHT_SELECTED_ACHIEVABLE );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << "HIT ! EC:> "; mDirectiveEC->traceMinimum(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+ else
+ {
+ mTransitionTargetHistory.pop_front();
+
+ mPendingTrace.clear();
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << "GOAL ACHIEVED !!!" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << REPEAT("==========", 10) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ return( true );
+ }
+ else
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_TRACE << "GOAL FAILED !!!" << std::endl;
+ AVM_OS_TRACE << REPEAT("==========", 10) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ return( false );
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// SERIALIZATION API
+////////////////////////////////////////////////////////////////////////////////
+
+void AvmCoverageOneTraceDriver::toStream(OutStream & os) const
+{
+ os << "Transition to reach :> ";
+
+ AvmTransition * aTransition = mPendingTrace.backTransition();
+
+ aTransition->toStreamHeader(os);
+ if( aTransition->hasInternalCommunicationCode() )
+ {
+ os << " ";
+ BaseCompiledForm::toStreamStaticCom(os,
+ aTransition->getInternalCommunicationCode());
+ }
+ os << EOL_FLUSH;
+
+ os << "Computed trace to reach it :> ";
+ mPendingTrace.toStream(os);
+
+ AVM_OS_TRACE << "GOAL " << ( goalAchieved() ? "ACHIEVED" : "FAILED" )
+ << " !!!" << std::endl;
+}
+
+
+void AvmCoverageOneTraceDriver::toStreamCache(
+ OutStream & os, const std::string strMessage) const
+{
+ os << TAB << strMessage << "<size: " << mCacheForDirectiveTraces.size()
+ << "> {" << EOL_INCR_INDENT;
+
+ ListOfAvmTraceProperty::const_iterator itTrace =
+ mCacheForDirectiveTraces.begin();
+ ListOfAvmTraceProperty::const_iterator endTrace =
+ mCacheForDirectiveTraces.end();
+ for( ; itTrace != endTrace ; ++itTrace )
+ {
+ (*itTrace).toStream(os, false);
+ }
+
+ os << TAB << "mTransitionTargetHistory<size: "
+ << mTransitionTargetHistory.size() << ">" << EOL;
+ AvmTransition::toStream(os, mTransitionTargetHistory);
+
+ os << DECR_INDENT_TAB << "}" << EOL_FLUSH;
+}
+
+
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageOneTraceDriver.h b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageOneTraceDriver.h
new file mode 100644
index 0000000..547df04
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageOneTraceDriver.h
@@ -0,0 +1,232 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 19 nov. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCOVERAGEONETRACEDRIVER_H_
+#define AVMCOVERAGEONETRACEDRIVER_H_
+
+#include "AvmCoverageAbstractView.h"
+
+#include <collection/Typedef.h>
+
+#include <fml/runtime/ExecutionContext.h>
+
+#include <fml/trace/TraceChecker.h>
+
+#include <fam/coverage/AvmCoverageDirectiveTraceBuilder.h>
+
+
+namespace sep
+{
+
+class WaitingStrategy;
+class AvmTransition;
+class AvmCoverageTransitionView;
+class EvaluationEnvironment;
+
+
+class AvmCoverageOneTraceDriver : public AvmCoverageAbstractView
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( AvmCoverageOneTraceDriver )
+
+
+protected:
+ AvmCoverageTransitionView & mTransitionCoverage;
+
+ EvaluationEnvironment & ENV;
+ TraceChecker mTraceChecker;
+
+ avm_size_t mComputingPathCountLimit;
+ avm_size_t mComputingPathSizeLimit;
+ AvmCoverageDirectiveTraceBuilder mPathChecker;
+
+ ListOfAvmTransition mTransitionTargetHistory;
+
+ ListOfAvmTraceProperty mCacheForDirectiveTraces;
+
+ ExecutionContext * mDirectiveEC;
+
+ avm_size_t mDefaultPendingTraceSize;
+
+ AvmTraceProperty mPendingTrace;
+
+ ListOfExecutionContext mWaitingQueue;
+
+ VectorOfAvmTransition mGlobalUncoveredTransitions;
+ avm_size_t mLastCollectedCoverCount;
+
+ VectorOfAvmTransition mLocalUncoveredTransitions;
+
+ // Computing drive variable
+ avm_uint8_t saveWeightMin;
+
+ avm_size_t coverageMax;
+ avm_size_t coverageCount;
+
+ TracePoint * tmpTracePoint;
+ BFList::const_iterator itTP;
+ BFList::const_iterator endTP;
+
+ AvmTransition * tmpTransition;
+ VectorOfAvmTransition::const_iterator itTransition;
+ VectorOfAvmTransition::const_iterator endTransition;
+
+ ListOfAvmTraceProperty::iterator itTrace;
+ ListOfAvmTraceProperty::iterator endTrace;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmCoverageOneTraceDriver(AvmCoverageProcessor & aCoverageProcessor,
+ EvaluationEnvironment & anENV,
+ IHeuristicClass::ENUM_HEURISTIC_CLASS
+ anHeuristicClass = IHeuristicClass::HEURISTIC_SMART_CLASS,
+ avm_size_t pathCountLimit = 8, avm_size_t pathSizeLimit = 8);
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AvmCoverageOneTraceDriver()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER
+ * mTransitionTargetHistory
+ */
+ inline bool couldRetry() const
+ {
+ return( mTransitionTargetHistory.nonempty() );
+ }
+
+ inline bool hasFailedTransitionTargetHistory()const
+ {
+ return( mTransitionTargetHistory.nonempty() );
+ }
+
+
+ inline void resetFailedTransitionTargetHistory()
+ {
+ mTransitionTargetHistory.clear();
+ }
+
+
+ /**
+ * UPDATE
+ * mCacheForDirectiveTraces
+ */
+ void appendDirectiveTraces(AvmTraceProperty & aTrace);
+
+ bool checkDirectiveContext(const ExecutionContext & aDirectiveEC);
+
+ bool checkDirectiveContext(
+ const ExecutionContext & aDirectiveEC,
+ AvmTransition * aTransition);
+
+ bool computeDirectiveTrace(
+ const ExecutionContext & aDirectiveEC,
+ AvmTransition * aTransition);
+
+ bool selectDirectiveTrace();
+ bool setDirectiveTrace();
+
+ bool updateCacheForDirectiveTraces(const ExecutionContext & anEC);
+
+ bool updateCacheForDirectiveTraces(AvmTransition * aTransition);
+
+ bool updateCacheForDirectiveTraces();
+
+ bool updateTransitionTargetHistory();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // COVERAGE PROCESSOR API
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline virtual bool configure()
+ {
+ return( true );
+ }
+
+ virtual bool configureImpl();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PROCESS API
+ ////////////////////////////////////////////////////////////////////////////
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FILTER API
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool prefiltering(ListOfExecutionContext & ecQueue);
+
+ bool postfiltering(ListOfExecutionContext & ecQueue);
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PROCESSOR REQUEST API
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * REQUEUE_WAITING
+ */
+ bool requeueWaitingTable(WaitingStrategy & aWaitingStrategy,
+ avm_uint8_t aWeightMin, avm_uint8_t aWeightMax);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // TRACE DRIVER API
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool checkDirectiveTrace(const ExecutionContext & anEC);
+
+ bool checkDirectiveTrace(const ExecutionContext & anEC,
+ const VectorOfAvmTransition & tableofTransitions);
+
+ inline bool goalAchieved() const
+ {
+ return( mPendingTrace.empty() );
+ }
+
+ bool drive();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SERIALIZATION API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual void toStream(OutStream & os) const;
+
+ virtual void toStreamCache(OutStream & os,
+ const std::string strMessage = "The Directive Trace Cache") const;
+
+
+};
+
+
+} /* namespace sep */
+
+#endif /* AVMCOVERAGEONETRACEDRIVER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageProcessor.cpp b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageProcessor.cpp
new file mode 100644
index 0000000..6cd2c65
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageProcessor.cpp
@@ -0,0 +1,670 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 19 nov. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmCoverageProcessor.h"
+
+#include <fam/queue/ExecutionQueue.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <sew/SymbexControllerRequestManager.h>
+
+
+namespace sep
+{
+
+
+/*
+prototype processor::coverage "coverage processor" as avm::processor.COVERAGE is
+ section PROPERTY
+ // Nombre de pas de calcul "cumulés" avant de débuter
+ // la vérification de la couverture
+ @begin_step = 0;
+
+ // Arrète l'exécution dès que la couverture est complète
+ @stop = true;
+
+ // Arrète l'exécution au plutôt
+ @minimize = true;
+
+ // Arrète l'exécution du chemin courant dès qu'un objectif est atteint
+ @break = true;
+
+ // Elagage du graphe des scénarios à la fin de la vérification
+ @slice = true;
+
+ // Active l'utilisation d'heuristique
+ @heuristic = true;
+
+ @scope = 'DETAILS'; // 'INSTANCE' | 'FORM' | 'DETAILS'
+ endsection PROPERTY
+
+
+ // Utilisé pour préciser les machines ou les transitions particulières à couvrir!
+ section DETAILS
+ @form = spec::ascenseur.ascenseur.controler;
+ @instance = spec::ascenseur.ascenseur.enregistrer;
+
+ @transition = spec::ascenseur.ascenseur.aller_a_l_etage.attente.transition#6;
+ endsection DETAILS
+
+
+ section HEURISTIC
+ // choix de l'heuristique de départ
+ // basic | naive | smart | agressive
+ @heuristic#start = 'basic';
+
+ // Nombre d'essais d'heuristiques
+ @heuristic#trials = 7;
+
+ // Critère de satisfaction du succès des heuristiques
+ // taux de couverte / nombre d'élément restant...
+ @objective#rate = 95;
+ @objective#rest = 5;
+
+
+ // Choix des contextes avec des transitions
+ // [ fortement | faiblement | autre ] tirables
+
+ // Limitations temporaire de la profondeur d'exploration
+ @coverage#height = 7;
+
+ // nombre de fois que la limite doit être atteint avant de l'augmenter
+ @coverage#height#reached#limit = 42;
+
+ @hit#strongly#random = false;
+ @hit#strongly#count = 1;
+
+ @hit#weakly#random = false;
+ @hit#weakly#count = 1;
+
+ @hit#other#random = false;
+ @hit#other#count = 1;
+ endsection HEURISTIC
+endprototype
+*/
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmCoverageProcessor::configureImpl()
+{
+ // SUPER CONFIGURATION
+ mConfigFlag = BaseCoverageFilter::configureImpl();
+
+ WObject * thePROPERTY = Query::getRegexWSequence(
+ getParameterWObject(), OR_WID2("property", "PROPERTY"));
+
+ if( thePROPERTY != WObject::_NULL_ )
+ {
+ mScope = Specifier::toDesignKind(
+ Query::getWPropertyString(thePROPERTY, "scope", "MODEL") );
+ }
+
+ mConfigFlag = mHeuristicProperty.configure( getParameterWObject() )
+ && mConfigFlag;
+
+ mConfigFlag = mTransitionCoverage.configure()
+ && mConfigFlag;
+
+ mConfigFlag = mOneTraceDriver.configure()
+ && mConfigFlag;
+
+ enablePreprocess( this );
+
+ return mConfigFlag;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// REPORT API
+////////////////////////////////////////////////////////////////////////////////
+
+void AvmCoverageProcessor::reportMinimum(OutStream & os) const
+{
+ os << TAB << "COVERAGE PROCESSOR" << EOL_FLUSH;
+
+ mTransitionCoverage.reportMinimum(os);
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SET EXIT CODE
+ mCoverageStatistics.setExitCode();
+}
+
+void AvmCoverageProcessor::reportDefault(OutStream & os) const
+{
+ reportHeader(os, "TRANSITION COVERAGE ");
+
+ mTransitionCoverage.reportDefault(os);
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SET EXIT CODE
+ mCoverageStatistics.setExitCode();
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// PROCESS API
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmCoverageProcessor::preprocess()
+{
+ return( BaseCoverageFilter::preprocess() );
+}
+
+
+bool AvmCoverageProcessor::postprocess()
+{
+ return( BaseCoverageFilter::postprocess() );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// PRE-FILTER API
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmCoverageProcessor::prefilter()
+{
+ ecQueue = &( getExecutionQueue().getReadyQueue() );
+
+// ecQueueIt = ecQueue->begin();
+// ecQueueItEnd = ecQueue->end();
+// for( ; ecQueueIt != ecQueueItEnd ; ++ecQueueIt )
+// {
+// prefilter(*ecQueueIt);
+// }
+
+ if( mCoverageStatistics.goalAchieved() && mStopFlag )
+ {
+ getSymbexRequestManager().postRequestStop( this );
+
+ return false;
+ }
+
+ switch( mHeuristicProperty.mHeuristicClass )
+ {
+ // SMART PASSIVE TRANSITION COVERAGE HEURISTIC
+ // Using :> HIGH PRIORITY CONTEXT
+ // w.r.t. TRANSITION FIREABILITY
+ case IHeuristicClass::HEURISTIC_BASIC_CLASS:
+ {
+ return( mTransitionCoverage.prefiltering(*ecQueue) );
+ }
+
+ // SMART ACTIVE TRANSITION COVERAGE HEURISTIC
+ // Using :> ONE TRACE DRIVEN
+ case IHeuristicClass::HEURISTIC_NAIVE_CLASS:
+ {
+ return( mOneTraceDriver.prefiltering(*ecQueue) );
+ }
+
+ // SMART ACTIVE TRANSITION COVERAGE HEURISTIC
+ // Using :> MANY TRACE DRIVEN
+ case IHeuristicClass::HEURISTIC_SMART_CLASS:
+ {
+ return( mManyTraceDriver.prefiltering(*ecQueue) );
+ }
+
+
+ case IHeuristicClass::HEURISTIC_AGRESSIVE_CLASS:
+
+ // SMART PASSIVE TRANSITION COVERAGE HEURISTIC
+ // Using :> PRIORITY CONTEXT
+ // w.r.t. TRANSITION FIREABILITY
+ case IHeuristicClass::HEURISTIC_NOTHING_ELSE_CLASS:
+ default:
+ {
+ return( mTransitionCoverage.prefiltering(*ecQueue) );
+ }
+ }
+
+ return( getExecutionQueue().hasReady() );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// POST-FILTER API
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmCoverageProcessor::postfilter()
+{
+ ecQueue = &( getExecutionQueue().getResultQueue() );
+
+ if( mCoverageStatistics.hasUncovered() )
+ {
+ mCoverageStatistics.backupCovered();
+
+ if( mTransitionCoverage.postfiltering(*ecQueue) )
+ {
+ if( mCoverageStatistics.goalAchieved() )
+ {
+ getSymbexRequestManager().postRequestGoalAchieved( this );
+
+ return( getExecutionQueue().hasResult() );
+ }
+ }
+
+
+ // Coverage without heuristic usage !!!
+ if( not mHeuristicProperty.mHeuristicEnabled )
+ {
+ return( getExecutionQueue().hasResult() );
+ }
+
+
+ if( mCoverageStatistics.updateFailedStep() )
+ {
+ //!!! TODO optimization decision
+ if( mCoverageStatistics.isSeriouslyFailedStep() )
+ {
+// incrHeuristicClass();
+
+ getSymbexRequestManager().postRequestRequeueWaiting( this );
+
+
+AVM_IF_DEBUG_FLAG( PROCESSOR )
+ AVM_OS_COUT << EMPHASIS(mHeuristicProperty.strHeuristicClass(), '*', 80);
+ AVM_OS_TRACE << EMPHASIS(mHeuristicProperty.strHeuristicClass(), '*', 80);
+AVM_ENDIF_DEBUG_FLAG( PROCESSOR )
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ mCoverageStatistics.toStreamFailedStep(AVM_OS_COUT,
+ "No new transition covered since << ", " step", " >> !!!\n");
+ mCoverageStatistics.toStreamFailedStep(AVM_OS_TRACE,
+ "No new transition covered since << ", " step", " >> !!!\n");
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+ else
+ {
+ mCoverageStatistics.resetFailedStep();
+ }
+
+ disableRequestStatus();
+
+AVM_IF_DEBUG_FLAG( PROCESSOR )
+ AVM_OS_COUT << EMPHASIS("postfilter :> " +
+ mHeuristicProperty.strHeuristicClass(), '*', 80);
+ AVM_OS_TRACE << EMPHASIS("postfilter :> " +
+ mHeuristicProperty.strHeuristicClass(), '*', 80);
+AVM_ENDIF_DEBUG_FLAG( PROCESSOR )
+
+ switch( mHeuristicProperty.mHeuristicClass )
+ {
+ // SMART PASSIVE TRANSITION COVERAGE HEURISTIC
+ // Using :> HIGH PRIORITY CONTEXT
+ // w.r.t. TRANSITION FIREABILITY
+ case IHeuristicClass::HEURISTIC_BASIC_CLASS:
+ {
+ if( mTransitionCoverage.computeHighPriorityContext(
+ (*ecQueue), getExecutionQueue().refWaitingStrategy()) )
+ {
+ //!! NOTHING
+ }
+
+ //!! FAILED CASE
+ else if( isRequestStatus( REQUEST_REQUEUE_WAITING_STATUS ) )
+ {
+ getSymbexRequestManager().postRequestRequeueWaiting( this );
+ }
+
+ // Require changing heuristic
+ else if( isRequestStatus( REQUEST_HEURISTIC_STATUS ) )
+ {
+ mHeuristicProperty.mHeuristicClass =
+ IHeuristicClass::HEURISTIC_NAIVE_CLASS;
+
+ getSymbexRequestManager().postRequestRequeueWaiting( this );
+ }
+
+ break;
+ }
+
+ // SMART ACTIVE TRANSITION COVERAGE HEURISTIC
+ // Using :> ONE TRACE DRIVEN
+ case IHeuristicClass::HEURISTIC_NAIVE_CLASS:
+ {
+ if( mOneTraceDriver.postfiltering(*ecQueue) )
+ {
+ if( mOneTraceDriver.goalAchieved() )
+ {
+ if( mCoverageStatistics.isSuccessfulStep() ||
+ getExecutionQueue().getWaitingStrategy()->
+ hasWaiting(WEIGHT_STRONGLY_ACHIEVABLE) )
+ {
+ mHeuristicProperty.mHeuristicClass =
+ IHeuristicClass::HEURISTIC_BASIC_CLASS;
+ }
+
+ getSymbexRequestManager().postRequestRequeueWaiting( this );
+ }
+ }
+
+ //!! FAILED CASE
+ else if( isRequestStatus( REQUEST_REQUEUE_WAITING_STATUS ) )
+ {
+ if( mCoverageStatistics.isSuccessfulStep() ||
+ getExecutionQueue().getWaitingStrategy()->
+ hasWaiting(WEIGHT_STRONGLY_ACHIEVABLE) )
+ {
+ mHeuristicProperty.mHeuristicClass =
+ IHeuristicClass::HEURISTIC_BASIC_CLASS;
+ }
+
+ getSymbexRequestManager().postRequestRequeueWaiting( this );
+ }
+
+ // Require changing heuristic
+ else if( isRequestStatus( REQUEST_HEURISTIC_STATUS ) )
+ {
+ mHeuristicProperty.mHeuristicClass =
+// IHeuristicClass::HEURISTIC_SMART_CLASS;
+ IHeuristicClass::HEURISTIC_NOTHING_ELSE_CLASS;
+
+ getSymbexRequestManager().postRequestRequeueWaiting( this );
+ }
+
+ break;
+ }
+
+ // SMART ACTIVE TRANSITION COVERAGE HEURISTIC
+ // Using :> MANY TRACE DRIVEN
+ case IHeuristicClass::HEURISTIC_SMART_CLASS:
+ {
+ if( mManyTraceDriver.postfiltering(*ecQueue) )
+ {
+ //!! NOTHING
+ }
+
+ //!! FAILED CASE
+ else if( isRequestStatus( REQUEST_REQUEUE_WAITING_STATUS ) )
+ {
+ getSymbexRequestManager().postRequestRequeueWaiting( this );
+ }
+
+ // Require changing heuristic
+ else if( isRequestStatus( REQUEST_HEURISTIC_STATUS ) )
+ {
+ mHeuristicProperty.mHeuristicClass =
+ IHeuristicClass::HEURISTIC_AGRESSIVE_CLASS;
+
+ getSymbexRequestManager().postRequestRequeueWaiting( this );
+ }
+
+ break;
+ }
+
+
+ case IHeuristicClass::HEURISTIC_AGRESSIVE_CLASS:
+
+ // SMART PASSIVE TRANSITION COVERAGE HEURISTIC
+ // Using :> PRIORITY CONTEXT
+ // w.r.t. TRANSITION FIREABILITY
+ case IHeuristicClass::HEURISTIC_NOTHING_ELSE_CLASS:
+ default:
+ {
+ if( mTransitionCoverage.computePriorityContext(
+ (*ecQueue), getExecutionQueue().refWaitingStrategy()) )
+ {
+ if( mCoverageStatistics.isSuccessfulStep() ||
+ getExecutionQueue().getWaitingStrategy()->
+ hasWaiting(WEIGHT_STRONGLY_ACHIEVABLE) )
+ {
+ mHeuristicProperty.mHeuristicClass =
+ IHeuristicClass::HEURISTIC_BASIC_CLASS;
+ }
+ }
+
+ //!! FAILED CASE
+ else if( isRequestStatus( REQUEST_REQUEUE_WAITING_STATUS ) )
+ {
+ getSymbexRequestManager().postRequestRequeueWaiting( this );
+ }
+
+ // Require changing heuristic
+ else if( isRequestStatus( REQUEST_HEURISTIC_STATUS ) )
+ {
+ if( mCoverageStatistics.isSuccessfulStep() ||
+ getExecutionQueue().getWaitingStrategy()->
+ hasWaiting(WEIGHT_STRONGLY_ACHIEVABLE) )
+ {
+ mHeuristicProperty.mHeuristicClass =
+ IHeuristicClass::HEURISTIC_BASIC_CLASS;
+ }
+ }
+
+ break;
+ }
+ }
+ }
+
+ return( getExecutionQueue().hasResult() );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// PROCESSOR REQUEST API
+////////////////////////////////////////////////////////////////////////////////
+/**
+ * STOP | RELEASE
+ * RESET | RESTART | CONTINUE
+ * REQUEUE_WAITING | REQUEUE_RESERVE
+ * HEURISTIC | GOAL_ACHIEVED
+ */
+void AvmCoverageProcessor::handleRequestRequeueWaitingTable(
+ WaitingStrategy & aWaitingStrategy,
+ avm_uint8_t aWeightMin, avm_uint8_t aWeightMax)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , QUEUE )
+ AVM_OS_TRACE << "AvmCoverageProcessor::handleRequestRequeueWaitingTable :>"
+ << std::endl;
+ aWaitingStrategy.toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , QUEUE )
+
+
+ while( true )
+ {
+ disableRequestStatus();
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << EMPHASIS("requeue :> " +
+ mHeuristicProperty.strHeuristicClass(), '*', 80);
+ AVM_OS_TRACE << EMPHASIS("requeue :> " +
+ mHeuristicProperty.strHeuristicClass(), '*', 80);
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ switch( mHeuristicProperty.mHeuristicClass )
+ {
+ case IHeuristicClass::HEURISTIC_BASIC_CLASS:
+ {
+ if( mTransitionCoverage.highRequeueWaitingTable(
+ aWaitingStrategy, aWeightMin, aWeightMax) )
+ {
+ return;
+ }
+
+ //!! FAILED CASE
+ else if( isRequestStatus( REQUEST_REQUEUE_WAITING_STATUS ) )
+ {
+ return;
+ }
+
+ // Require changing heuristic
+ else if( isRequestStatus( REQUEST_HEURISTIC_STATUS ) )
+ {
+ mHeuristicProperty.mHeuristicClass =
+ IHeuristicClass::HEURISTIC_NAIVE_CLASS;
+
+ //!! CONTINUE
+ }
+ else
+ {
+ return;
+ }
+
+ break;
+ }
+
+ case IHeuristicClass::HEURISTIC_NAIVE_CLASS:
+ {
+ if( mOneTraceDriver.requeueWaitingTable(
+ aWaitingStrategy, aWeightMin, aWeightMax) )
+ {
+ return;
+ }
+
+ //!! FAILED CASE
+ else if( isRequestStatus( REQUEST_REQUEUE_WAITING_STATUS ) )
+ {
+ mHeuristicProperty.mHeuristicClass =
+ IHeuristicClass::HEURISTIC_NOTHING_ELSE_CLASS;
+
+ //!! CONTINUE
+ }
+
+ // Require changing heuristic
+ else if( isRequestStatus( REQUEST_HEURISTIC_STATUS ) )
+ {
+ mHeuristicProperty.mHeuristicClass =
+// IHeuristicClass::HEURISTIC_SMART_CLASS;
+ IHeuristicClass::HEURISTIC_NOTHING_ELSE_CLASS;
+
+ //!! CONTINUE
+ }
+ else
+ {
+ return;
+ }
+
+ break;
+ }
+ case IHeuristicClass::HEURISTIC_SMART_CLASS:
+ {
+ if( mManyTraceDriver.requeueWaitingTable(
+ aWaitingStrategy, aWeightMin, aWeightMax) )
+ {
+ return;
+ }
+
+ //!! FAILED CASE
+ else if( isRequestStatus( REQUEST_REQUEUE_WAITING_STATUS ) )
+ {
+ return;
+ }
+
+ // Require changing heuristic
+ else if( isRequestStatus( REQUEST_HEURISTIC_STATUS ) )
+ {
+ mHeuristicProperty.mHeuristicClass =
+ IHeuristicClass::HEURISTIC_AGRESSIVE_CLASS;
+
+ //!! CONTINUE
+ }
+ else
+ {
+ return;
+ }
+
+ break;
+ }
+
+
+ case IHeuristicClass::HEURISTIC_AGRESSIVE_CLASS:
+
+ case IHeuristicClass::HEURISTIC_NOTHING_ELSE_CLASS:
+ default:
+ {
+ if( mTransitionCoverage.elseRequeueWaitingTable(
+ aWaitingStrategy, aWeightMin, aWeightMax) )
+ {
+ return;
+ }
+
+ //!! FAILED CASE
+ else if( isRequestStatus( REQUEST_REQUEUE_WAITING_STATUS ) )
+ {
+ return;
+ }
+
+ // Require changing heuristic
+ else if( isRequestStatus( REQUEST_HEURISTIC_STATUS ) )
+ {
+ if( getExecutionQueue().getWaitingStrategy()->
+ hasWaiting(WEIGHT_STRONGLY_ACHIEVABLE) )
+ {
+ mHeuristicProperty.mHeuristicClass =
+ IHeuristicClass::HEURISTIC_BASIC_CLASS;
+ }
+ return;
+ }
+ else
+ {
+ return;
+ }
+
+ break;
+ }
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// DEBUG PROCESSING API
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmCoverageProcessor::debugEvalCommandImpl()
+{
+ if( dbgDecodeCommand("-->") )
+ {
+ dbgCommandDirectiveTransition();
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+void AvmCoverageProcessor::dbgCommandDirectiveTransition()
+{
+ dbgCommandTransition();
+
+ AvmCoverageDirectiveTraceBuilder pathChecker(
+ mDebugSelectedContext, mDebugSelectedTransition,
+ IHeuristicClass::IHeuristicClass::HEURISTIC_SMART_CLASS, 64, 64);
+
+ if( pathChecker.computePath() )
+ {
+ AVM_OS_COUT << "GOAL ACHIEVED !!!" << std::endl;
+ }
+ else
+ {
+ AVM_OS_COUT << "FAILED !!!" << std::endl;
+ }
+
+ AVM_OS_COUT << std::endl;
+
+ pathChecker.report(AVM_OS_COUT);
+
+ AVM_OS_COUT << std::flush;
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageProcessor.h b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageProcessor.h
new file mode 100644
index 0000000..a3b8804
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageProcessor.h
@@ -0,0 +1,200 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 19 nov. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCOVERAGEPROCESSOR_H_
+#define AVMCOVERAGEPROCESSOR_H_
+
+#include <fam/coverage/BaseCoverageFilter.h>
+#include <fam/debug/IDebugProcessorProvider.h>
+
+#include <fam/coverage/AvmCoverageHeuristicProperty.h>
+#include <fam/coverage/AvmCoverageOneTraceDriver.h>
+#include <fam/coverage/AvmCoverageTransitionView.h>
+
+#include <fml/common/SpecifierElement.h>
+
+#include <fml/runtime/ExecutionContext.h>
+
+#include <sew/SymbexControllerRequestStatus.h>
+
+
+namespace sep
+{
+
+class SymbexControllerUnitManager;
+class WaitingStrategy;
+
+
+class AvmCoverageProcessor :
+ public AutoRegisteredCoverageProcessorUnit< AvmCoverageProcessor >,
+ public SymbexControllerRequestStatus,
+ public IDebugProcessorProvider
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( AvmCoverageProcessor )
+
+ /**
+ * PROCESSOR FACTORY
+ * for automatic registration in the processor repository
+ * the [ [ FULLY ] QUALIFIED ] NAME ID
+ */
+ AVM_INJECT_AUTO_REGISTER_QUALIFIED_ID_KEY_2(
+ "avm::processor.COVERAGE",
+ "avm::processor.COVERAGE_PROCESSOR")
+ // end registration
+
+
+ /**
+ * ATTRIBUTES
+ */
+public:
+ Specifier::DESIGN_KIND mScope;
+
+ AvmCoverageHeuristicProperty mHeuristicProperty;
+
+ AvmCoverageTransitionView mTransitionCoverage;
+
+ AvmCoverageOneTraceDriver mOneTraceDriver;
+
+// AvmCoverageManyTraceDriver mManyTraceDriver;
+ AvmCoverageOneTraceDriver mManyTraceDriver;
+
+protected:
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing variable
+ ExecutionContext::child_iterator itChildEC;
+ ExecutionContext::child_iterator endChildEC;
+
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmCoverageProcessor(SymbexControllerUnitManager & aControllerUnitManager,
+ WObject * wfParameterObject)
+ : RegisteredCoverageProcessorUnit( aControllerUnitManager , wfParameterObject,
+ AVM_PREPOST_FILTERING_STAGE,
+ PRECEDENCE_OF_ACTIVE_COVERAGE_PROCESSOR ),
+ SymbexControllerRequestStatus( REQUEST_UNDEFINED_STATUS ),
+ IDebugProcessorProvider( this ),
+
+ mScope( Specifier::DESIGN_MODEL_KIND ),
+
+ mHeuristicProperty( ),
+
+ mTransitionCoverage( *this , wfParameterObject ),
+ mOneTraceDriver ( *this , ENV ),
+ mManyTraceDriver( *this , ENV ),
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing variable
+ itChildEC( ),
+ endChildEC( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AvmCoverageProcessor()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // PLUGIN PROCESSOR API
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool configureImpl();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // REPORT API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual void reportMinimum(OutStream & os) const;
+
+ virtual void reportDefault(OutStream & os) const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PROCESS API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool preprocess();
+
+ virtual bool postprocess();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FILTER API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool prefilter();
+
+ virtual bool postfilter();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PROCESSOR REQUEST API
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * STOP | RELEASE
+ * RESET | RESTART | CONTINUE
+ * REQUEUE_WAITING | REQUEUE_RESERVE
+ * HEURISTIC | GOAL_ACHIEVED
+ */
+ virtual void handleRequestRequeueWaitingTable(
+ WaitingStrategy & aWaitingStrategy,
+ avm_uint8_t aWeightMin, avm_uint8_t aWeightMax);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DEBUG PROCESSING API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool debugEvalCommandImpl();
+
+ void dbgCommandDirectiveTransition();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SERIALIZATION API
+ ////////////////////////////////////////////////////////////////////////////
+ virtual void toStream(OutStream & os) const
+ {
+ if( mParameterWObject != NULL )
+ {
+ mParameterWObject->toStream(os);
+ }
+ }
+
+
+
+};
+
+} /* namespace sep */
+
+#endif /* AVMCOVERAGEPROCESSOR_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageStatistics.h b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageStatistics.h
new file mode 100644
index 0000000..c00abd2
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageStatistics.h
@@ -0,0 +1,446 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 5 févr. 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCOVERAGESTATISTICS_H_
+#define AVMCOVERAGESTATISTICS_H_
+
+#include <collection/Bitset.h>
+
+#include <util/avm_numeric.h>
+#include <util/avm_util.h>
+
+
+namespace sep
+{
+
+class OutStream;
+
+
+class AvmCoverageStatistics
+{
+
+public:
+ /*
+ * ATTRIBUTES
+ */
+ Bitset mCoverageBitset;
+
+ avm_size_t mNumberOfElements;
+ avm_size_t mNumberOfCovered;
+
+ avm_size_t mCoverageRateGoal;
+ avm_size_t mCoverageRestGoal;
+
+ avm_size_t mBackupOfCovered;
+
+ avm_size_t mNumberOfBacktrack;
+
+ avm_size_t mNumberOfFailedStep;
+ avm_size_t mNumberOfFailedHeuristic;
+
+ avm_size_t mNumberOfBlackHole;
+ avm_size_t mNumberOfBlackHoleTest;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmCoverageStatistics(avm_size_t objRate = 100, avm_size_t objRest = 0)
+ : mCoverageBitset( 0 , false ),
+ mNumberOfElements( 0 ),
+ mNumberOfCovered( 0 ),
+
+ mCoverageRateGoal( objRate ),
+ mCoverageRestGoal( objRest ),
+
+ mBackupOfCovered( 0 ),
+
+ mNumberOfBacktrack( 0 ),
+
+ mNumberOfFailedStep( 0 ),
+ mNumberOfFailedHeuristic( 0 ),
+
+ mNumberOfBlackHole( 0 ),
+ mNumberOfBlackHoleTest( 0 )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ AvmCoverageStatistics(const AvmCoverageStatistics & aCoverageStatistics)
+ : mCoverageBitset( aCoverageStatistics.mCoverageBitset ),
+ mNumberOfElements( aCoverageStatistics.mNumberOfElements ),
+ mNumberOfCovered( aCoverageStatistics.mNumberOfCovered ),
+
+ mCoverageRateGoal( aCoverageStatistics.mCoverageRateGoal ),
+ mCoverageRestGoal( aCoverageStatistics.mCoverageRestGoal ),
+
+ mBackupOfCovered( aCoverageStatistics.mBackupOfCovered ),
+
+ mNumberOfBacktrack( aCoverageStatistics.mNumberOfBacktrack ),
+
+ mNumberOfFailedStep( aCoverageStatistics.mNumberOfFailedStep ),
+ mNumberOfFailedHeuristic( aCoverageStatistics.mNumberOfFailedHeuristic ),
+
+ mNumberOfBlackHole( aCoverageStatistics.mNumberOfBlackHole ),
+ mNumberOfBlackHoleTest( aCoverageStatistics.mNumberOfBlackHoleTest )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AvmCoverageStatistics()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * Copy if coverage rate is best
+ */
+ inline double coverageRate() const
+ {
+ return( (mNumberOfElements == 0) ? 0.0 :
+ (static_cast< double >(mNumberOfCovered) / mNumberOfElements) );
+ }
+
+ inline void copyIfBestCoverageRate(const AvmCoverageStatistics & aStat)
+ {
+ if( (aStat.mNumberOfElements > 0) && ((mNumberOfElements == 0) ||
+ (this->coverageRate() < aStat.coverageRate()) ||
+ (mNumberOfElements < aStat.mNumberOfElements)) )
+ {
+ mCoverageBitset = aStat.mCoverageBitset;
+
+ mNumberOfElements = aStat.mNumberOfElements;
+ mNumberOfCovered = aStat.mNumberOfCovered;
+
+ mCoverageRateGoal = aStat.mCoverageRateGoal;
+ mCoverageRestGoal = aStat.mCoverageRestGoal;
+
+ mBackupOfCovered = aStat.mBackupOfCovered;
+
+ mNumberOfBacktrack = aStat.mNumberOfBacktrack;
+
+ mBackupOfCovered = aStat.mBackupOfCovered;
+ mNumberOfFailedStep = aStat.mNumberOfFailedStep;
+ mNumberOfFailedHeuristic = aStat.mNumberOfFailedHeuristic;
+
+ mNumberOfBlackHole = aStat.mNumberOfBlackHole;
+ mNumberOfBlackHoleTest = aStat.mNumberOfBlackHoleTest;
+ }
+ }
+
+
+ /**
+ * RESETTER
+ */
+ inline void resetCounter()
+ {
+ mCoverageBitset.clear();
+
+ mNumberOfElements = 0;
+ mNumberOfCovered = 0;
+ mBackupOfCovered = 0;
+ mNumberOfBacktrack = 0;
+
+ mNumberOfFailedStep = 0;
+ mNumberOfFailedHeuristic = 0;
+ }
+
+ inline void resetCoverageCounter()
+ {
+ mCoverageBitset.reset();
+
+ mNumberOfCovered = 0;
+ mBackupOfCovered = 0;
+
+ mNumberOfFailedStep = 0;
+ mNumberOfFailedHeuristic = 0;
+ }
+
+ inline void resetFailedStep()
+ {
+ mNumberOfFailedStep = 0;
+ mNumberOfFailedHeuristic = 0;
+ }
+
+ inline void setFailedHeuristic()
+ {
+ mNumberOfFailedHeuristic = 1;
+ }
+
+
+ /**
+ * mNumberOfElements
+ */
+ inline void addUncoveredElement()
+ {
+ ++mNumberOfElements;
+ }
+
+ inline void addUncoveredElement(avm_size_t count)
+ {
+ mNumberOfElements += count;
+ }
+
+
+ inline avm_size_t getNumberOfElements() const
+ {
+ return mNumberOfElements;
+ }
+
+ inline void setNumberOfElements(avm_size_t count)
+ {
+ mNumberOfElements = count;
+ }
+
+
+ /**
+ * mNumberOfCovered
+ */
+ inline void addCoveredElement()
+ {
+ ++mNumberOfCovered;
+ }
+
+ inline void addCoveredElement(avm_size_t count)
+ {
+ mNumberOfCovered += count;
+ }
+
+
+ inline avm_size_t getNumberOfCovered() const
+ {
+ return mNumberOfCovered;
+ }
+
+ inline void setNumberOfCovered(avm_size_t count)
+ {
+ mNumberOfCovered = count;
+ }
+
+
+ /**
+ * objectiveRate
+ * objectiveRest
+ */
+ inline void setObjectives(avm_size_t objRate = 100, avm_size_t objRest = 0)
+ {
+ mCoverageRateGoal = objRate;
+ mCoverageRestGoal = objRest;
+ }
+
+
+ /**
+ * mBackupOfCovered
+ * mNumberOfCovered
+ */
+ inline void backupCovered()
+ {
+ mBackupOfCovered = mNumberOfCovered;
+ }
+
+ inline bool hasNewlyCovered()
+ {
+ return( mBackupOfCovered < mNumberOfCovered );
+ }
+
+ inline bool isNewlyFailedStep()
+ {
+ return( mBackupOfCovered == mNumberOfCovered );
+ }
+
+
+ /**
+ * mNumberOfElements
+ * mNumberOfCovered
+ */
+ inline avm_size_t getNumberOfUncovered() const
+ {
+ return( mNumberOfElements - mNumberOfCovered );
+ }
+
+
+ /**
+ * mNumberOfElements
+ * mNumberOfFailedStep
+ */
+ inline bool hasFailedStep() const
+ {
+ return( mNumberOfFailedStep > 0 );
+ }
+
+ inline bool isSeriouslyFailedStep() const
+ {
+ return( (mNumberOfFailedStep % mNumberOfElements) == 0 );
+ }
+
+ inline bool isSuccessfulStep() const
+ {
+ return( mNumberOfFailedStep == 0 );
+ }
+
+ /**
+ * mNumberOfFailedStep
+ * mBackupOfCovered
+ * mNumberOfCovered
+ */
+ inline bool updateFailedStep()
+ {
+ if( mBackupOfCovered == mNumberOfCovered )
+ {
+ ++mNumberOfFailedStep;
+
+ return( true );
+ }
+
+ return( false );
+ }
+
+
+ /**
+ * mNumberOfFailedHeuristic
+ * mNumberOfFailedStep
+ * mBackupOfCovered
+ * mNumberOfCovered
+ */
+ inline bool updateFailedHeuristic()
+ {
+ if( mNumberOfFailedHeuristic > 0 )
+ {
+ ++mNumberOfFailedHeuristic;
+
+ return( isSeriouslyFailedStep() );
+ }
+
+ return( true );
+ }
+
+
+ /**
+ * mNumberOfBlackHole
+ * mNumberOfBlackHoleTest
+ */
+ inline std::string strBlackHoleRate() const
+ {
+ return( OSS() << mNumberOfBlackHole << "/" << mNumberOfBlackHoleTest );
+ }
+
+
+ /**
+ * Coverage Test
+ */
+ inline bool goalAchieved() const
+ {
+ // AssertTrue( mCoverageBitset.allTrue() ) ?
+ return( mNumberOfCovered == mNumberOfElements );
+ }
+
+ inline bool goalAchievedRate() const
+ {
+ return( ((100 * mNumberOfCovered) / mNumberOfElements)
+ >= mCoverageRateGoal );
+ }
+
+ inline bool goalAchievedRest() const
+ {
+ return( (mNumberOfElements - mNumberOfCovered) <= mCoverageRestGoal );
+ }
+
+ inline bool hasCovered() const
+ {
+ return( mNumberOfCovered > 0 );
+ }
+
+ inline bool hasUncovered() const
+ {
+ // AssertTrue( mCoverageBitset.anyFalse() )
+ return( mNumberOfCovered < mNumberOfElements );
+ }
+
+ /**
+ * set EXIT CODE
+ */
+ inline void setExitCode() const
+ {
+ if( goalAchieved() )
+ {
+ avm_set_exit_code( AVM_EXIT_COVERAGE_GOAL_ACHIEVED_CODE);
+ }
+ else if( (mNumberOfElements > 0) &&
+ (90 <= ((100 * mNumberOfCovered) / mNumberOfElements)) )
+ {
+ avm_set_exit_code( AVM_EXIT_COVERAGE_GOAL_ALMOST_ACHIEVED_CODE);
+ }
+ else
+ {
+ avm_set_exit_code( AVM_EXIT_COVERAGE_GOAL_UNACHIEVED_CODE);
+ }
+ }
+
+
+ /**
+ * to string
+ */
+ inline std::string strCoverageRate(const std::string & sep = " / ") const
+ {
+ return( OSS() << mNumberOfCovered << sep << mNumberOfElements );
+ }
+
+ inline std::string strCoverageRate(
+ bool isGoalAchieved, const std::string & sep = " / ") const
+ {
+ return( OSS()
+ << (isGoalAchieved ? mNumberOfElements : mNumberOfCovered)
+ << sep << mNumberOfElements );
+ }
+
+
+ /**
+ * Serialization
+ */
+ inline void toStreamCoverageRate(OutStream & os,
+ const std::string & prompt = "", const std::string & sep = " / ",
+ const std::string & eol = "\n") const
+ {
+ os << prompt << mNumberOfCovered << sep << mNumberOfElements
+ << eol << std::flush;
+ }
+
+ inline void toStreamFailedStep(OutStream & os,
+ const std::string & prompt = "", const std::string & name = " / ",
+ const std::string & eol = "\n") const
+ {
+ os << prompt << mNumberOfFailedStep << name
+ << ( (mNumberOfFailedStep > 0) ? "s" : "" )
+ << eol << std::flush;
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* AVMCOVERAGESTATISTICS_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageTraceDriver.cpp b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageTraceDriver.cpp
new file mode 100644
index 0000000..8b7c80d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageTraceDriver.cpp
@@ -0,0 +1,213 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 19 nov. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmCoverageTraceDriver.h"
+
+#include <builder/analysis/TransitionReachability.h>
+
+#include <fml/executable/AvmTransition.h>
+
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeID.h>
+
+#include <fml/trace/TracePoint.h>
+
+#include <fam/coverage/BaseCoverageFilter.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// TRACE DRIVER API
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmCoverageTraceDriver::initialize(
+ ExecutionContext * aDirectiveEC, AvmTransition * aTransition)
+{
+ if( mTransitionTargetHistory.contains( aTransition ) )
+ {
+ return( false );
+ }
+
+ mTransitionTargetHistory.push_front( aTransition );
+
+ mTransitionTarget = aTransition;
+ mDirectiveEC = aDirectiveEC;
+
+ mDirectiveTrace.points.clear();
+ mPendingTrace.points.clear();
+
+ RuntimeID aRID = mDirectiveEC->refExecutionData().getRuntimeID(
+ mTransitionTarget->getExecutable() );
+
+ TransitionReachability pathChecker(*mDirectiveEC, aRID, mTransitionTarget);
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << std::endl << REPEAT("<<<<<<<<<<", 10) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ if( (mInitializationFlag = pathChecker.computePath(mDirectiveTrace)) )
+ {
+ mPendingTrace.copyTrace( mDirectiveTrace );
+
+ mPendingTraceSize = mPendingTrace.points.size();
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ pathChecker.report(AVM_OS_COUT);
+ AVM_OS_COUT << REPEAT(">>>>>>>>>>", 10) << std::endl << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+
+ return( mInitializationFlag );
+}
+
+
+bool AvmCoverageTraceDriver::process(const ListOfExecutionContext & aResultQueue)
+{
+ ListOfExecutionContext::const_iterator ecQueueIt = aResultQueue.begin();
+ ListOfExecutionContext::const_iterator ecQueueItEnd = aResultQueue.end();
+ for( ; ecQueueIt != ecQueueItEnd ; ++ecQueueIt )
+ {
+ if( (*ecQueueIt) == mDirectiveEC )
+ {
+ return( drive() );
+ }
+ }
+
+ return( false );
+}
+
+
+bool AvmCoverageTraceDriver::drive()
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << std::endl << REPEAT("==========", 10) << std::endl;
+ AVM_OS_COUT << "Directive Trace:>" << std::endl;
+ mPendingTrace.toStream(AVM_OS_COUT);
+ AVM_OS_COUT << "Directive EC:> " << mDirectiveEC->str_min() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ ExecutionContext::child_iterator itEC = mDirectiveEC->begin();
+ ExecutionContext::child_iterator endEC = mDirectiveEC->end();
+
+ avm_size_t coverageMax = 0;
+ avm_size_t coverageCount = 0;
+
+ BFList::const_iterator itTP;
+ BFList::const_iterator endTP = mPendingTrace.points.end();
+
+ for( ; itEC != endEC ; ++itEC )
+ {
+ coverageCount = 0;
+
+ for( itTP = mPendingTrace.points.begin() ; itTP != endTP ; ++itTP )
+ {
+ if( mTraceChecker.isSatTransition(*(*itEC),
+ (*itTP).to_ptr< TracePoint >(),
+ (*itEC)->getRunnableElementTrace()) )
+ {
+ ++coverageCount;
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ if( coverageCount > coverageMax )
+ {
+ coverageMax = coverageCount;
+
+ mDirectiveEC = (*itEC);
+
+ mDirectiveEC->setWeight( WEIGHT_STRONGLY_ACHIEVABLE );
+ }
+ else
+ {
+ (*itEC)->setWeight( WEIGHT_NON_PRIORITY );
+ }
+ }
+
+ if( coverageMax > 0 )
+ {
+ if( coverageMax < mPendingTraceSize )
+ {
+ for( coverageCount = 0 ; coverageCount < coverageMax ; ++coverageCount )
+ {
+ mPendingTrace.points.pop_front();
+ }
+ mPendingTraceSize = mPendingTraceSize - coverageMax;
+
+ mDirectiveEC->setWeight( WEIGHT_CERTAINLY_ACHIEVABLE );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "HIT ! EC:> "; mDirectiveEC->traceDefault(AVM_OS_COUT);
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+ else
+ {
+ mTransitionTargetHistory.pop_front();
+
+ mPendingTrace.points.clear();
+ mPendingTraceSize = 0;
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "GOAL ACHIEVED !!!" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << REPEAT("==========", 10) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ return( true );
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << REPEAT("==========", 10) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ return( false );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// SERIALIZATION API
+////////////////////////////////////////////////////////////////////////////////
+
+void AvmCoverageTraceDriver::toStream(OutStream & os) const
+{
+ os << "Transition to reach :> ";
+ mTransitionTarget->toStreamHeader(os);
+ if( mTransitionTarget->hasInternalCommunicationCode() )
+ {
+ os << " ";
+ BaseCompiledForm::toStreamStaticCom(os,
+ mTransitionTarget->getInternalCommunicationCode());
+ }
+ os << EOL_FLUSH;
+
+ os << "Computed trace to reach it :> ";
+ mDirectiveTrace.toStream(os);
+
+ AVM_OS_COUT << "GOAL " << ( goalAchieved() ? "ACHIEVED" : "FAILED" )
+ << " !!!" << std::endl;
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageTraceDriver.h b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageTraceDriver.h
new file mode 100644
index 0000000..d2bfab3
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageTraceDriver.h
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 19 nov. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCOVERAGETRACEDRIVER_H_
+#define AVMCOVERAGETRACEDRIVER_H_
+
+#include <fam/coverage/AvmCoverageHeuristicProperty.h>
+
+#include <collection/Typedef.h>
+
+#include <fml/runtime/ExecutionContext.h>
+
+#include <fml/trace/TraceChecker.h>
+#include <fml/trace/TraceSequence.h>
+
+
+namespace sep
+{
+
+class AvmTransition;
+class EvaluationEnvironment;
+
+
+class AvmCoverageTraceDriver : public IHeuristicContextWeight
+{
+
+protected:
+ EvaluationEnvironment & ENV;
+ TraceChecker mTraceChecker;
+
+ bool mInitializationFlag;
+ AvmTransition * mTransitionTarget;
+ ListOfAvmTransition mTransitionTargetHistory;
+
+ ExecutionContext * mDirectiveEC;
+
+ TraceSequence mDirectiveTrace;
+
+ TraceSequence mPendingTrace;
+ avm_size_t mPendingTraceSize;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmCoverageTraceDriver(EvaluationEnvironment & anENV)
+ : IHeuristicContextWeight( ),
+ ENV( anENV ),
+ mTraceChecker( anENV ),
+ mInitializationFlag( false ),
+ mTransitionTarget( NULL ),
+ mTransitionTargetHistory( ),
+
+ mDirectiveEC( NULL ),
+ mDirectiveTrace( ),
+ mPendingTrace( ),
+ mPendingTraceSize( 0 )
+ {
+ // TODO Auto-generated constructor stub
+
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AvmCoverageTraceDriver()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * GETTER
+ * mDirectiveEC
+ * mTransitionTargetHistory
+ */
+ inline ExecutionContext * getDirectiveEC()
+ {
+ return( mDirectiveEC );
+ }
+
+ inline bool couldRetry()
+ {
+ return( mTransitionTargetHistory.nonempty() );
+ }
+
+ inline bool hasFailedTransitionTargetHistory()
+ {
+ return( mTransitionTargetHistory.nonempty() );
+ }
+
+
+ inline void resetFailedTransitionTargetHistory()
+ {
+ mTransitionTargetHistory.clear();
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // TRACE DRIVER API
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool initialize(ExecutionContext * aDirectiveEC, AvmTransition * aTransition);
+
+ inline bool goalAchieved() const
+ {
+ return( mPendingTrace.points.empty() );
+ }
+
+
+ bool process(const ListOfExecutionContext & aResultQueue);
+
+ bool drive();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SERIALIZATION API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual void toStream(OutStream & os) const;
+
+
+};
+
+
+} /* namespace sep */
+
+#endif /* AVMCOVERAGETRACEDRIVER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageTraceView.cpp b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageTraceView.cpp
new file mode 100644
index 0000000..1f504b0
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageTraceView.cpp
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 19 nov. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmCoverageTraceView.h"
+
+namespace sep
+{
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageTraceView.h b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageTraceView.h
new file mode 100644
index 0000000..51c36dc
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageTraceView.h
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 19 nov. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCOVERAGETRACEVIEW_H_
+#define AVMCOVERAGETRACEVIEW_H_
+
+#include <fam/coverage/AvmCoverageAbstractView.h>
+
+
+namespace sep
+{
+
+class AvmCoverageProcessor;
+class OutStream;
+class ExecutionContext;
+
+
+class AvmCoverageTraceView : public AvmCoverageAbstractView
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmCoverageTraceView(
+ AvmCoverageProcessor & aCoverageProcessor, WObject * wfParameterObject)
+ : AvmCoverageAbstractView( aCoverageProcessor , wfParameterObject )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AvmCoverageTraceView()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // COVERAGE PROCESSOR API
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool configureImpl();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // REPORT API
+ ////////////////////////////////////////////////////////////////////////////
+ virtual void reportDefault(OutStream & os) const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PROCESS API
+ ////////////////////////////////////////////////////////////////////////////
+ virtual bool preprocess();
+
+ virtual bool postprocess();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FILTER API
+ ////////////////////////////////////////////////////////////////////////////
+ virtual bool prefilter();
+ virtual bool prefilter(ExecutionContext & anEC);
+
+ virtual bool postfilter();
+ virtual bool postfilter(ExecutionContext & anEC);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SERIALIZATION API
+ ////////////////////////////////////////////////////////////////////////////
+ virtual void toStream(OutStream & os) const
+ {
+ //!! NOTHING
+ }
+
+};
+
+} /* namespace sep */
+
+#endif /* AVMCOVERAGETRACEVIEW_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageTransitionView.cpp b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageTransitionView.cpp
new file mode 100644
index 0000000..257cdc9
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageTransitionView.cpp
@@ -0,0 +1,3478 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 19 nov. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmCoverageTransitionView.h"
+
+#include "AvmCoverageProcessor.h"
+
+#include <computer/primitive/AvmCommunicationFactory.h>
+
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/ExecutableQuery.h>
+#include <fml/executable/ExecutableSystem.h>
+#include <fml/executable/InstanceOfMachine.h>
+
+#include <fml/expression/ExpressionConstructor.h>
+
+#include <fml/common/SpecifierElement.h>
+
+#include <fml/runtime/ExecutionConfiguration.h>
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeForm.h>
+#include <fml/runtime/RuntimeID.h>
+
+#include <fam/coverage/BaseCoverageFilter.h>
+
+#include <fam/queue/WaitingStrategy.h>
+#include <fam/queue/ExecutionQueue.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <sew/Configuration.h>
+#include <sew/SymbexControllerRequestManager.h>
+
+
+namespace sep
+{
+
+
+/**
+ ***************************************************************************
+prototype filter::transition_coverage as &avm::core.filter.PROGRAM_COVERAGE is
+ section PROPERTY
+ // Nombre de pas de calcul "cumulés" avant de débuter
+ // la vérification de la couverture
+ @begin_step = 0;
+
+ // Arrète l'exécution dès que la couverture est complète
+ @stop = true;
+
+ // Arrète l'exécution au plutôt
+ @minimize = true;
+
+ // Arrète l'exécution du chemin courant dès qu'un objectif est atteint
+ @break = true;
+
+ // Elagage du graphe des scénarios à la fin de la vérification
+ @slice = true;
+
+ // Active l'utilisation d'heuristique
+ @heuristic = true;
+
+ // choix de l'heuristique de départ
+ // basic | naive | smart | agressive
+ @heuristic#start = 'basic';
+
+ // Nombre d'essais d'heuristiques
+ @heuristic#trials = 7;
+
+ // Critère de satisfaction du succès des heuristiques
+ // taux de couverte / nombre d'élément restant...
+ @objective#rate = 95;
+ @objective#rest = 5;
+
+
+ // Choix des contextes avec des transitions
+ // [ fortement | faiblement | autre ] tirables
+
+ // Limitations temporaire de la profondeur d'exploration
+ @coverage#height = 7;
+
+ // nombre de fois que la limite doit être atteint avant de l'augmenter
+ @coverage#height#reached#limit = 42;
+
+ @hit#strongly#random = false;
+ @hit#strongly#count = 1;
+
+ @hit#weakly#random = false;
+ @hit#weakly#count = 1;
+
+ @hit#other#random = false;
+ @hit#other#count = 1;
+
+ @scope = 'DETAILS'; // 'INSTANCE' | 'FORM' | 'DETAILS'
+ endsection PROPERTY
+
+ // Utilisé pour préciser les machines ou les transitions particulières à couvrir!
+ section DETAILS
+ @form = spec::ascenseur.ascenseur.controler;
+ @instance = spec::ascenseur.ascenseur.enregistrer;
+
+ @transition = spec::ascenseur.ascenseur.aller_a_l_etage.attente.transition#6;
+ endsection DETAILS
+endprototype
+ ***************************************************************************
+ */
+
+
+/**
+ * DESTRUCTOR
+ */
+AvmCoverageTransitionView::~AvmCoverageTransitionView()
+{
+ if( mExecutableCoverageTable != NULL )
+ {
+ const ExecutionData & anED =
+ mCoverageProcessor.getConfiguration().getMainExecutionData();
+
+ if( mTransitionCoverageTable != NULL )
+ {
+ avm_size_t endOffset = mTransitionCoverageTable->size();
+ for( avm_size_t i = 0 ; i < endOffset ; ++i )
+ {
+ if( mTransitionCoverageTable->at(i)
+ != mExecutableCoverageTable->at(
+ anED.getRuntime(i).getExecutable()->getOffset()) )
+ {
+ delete( mTransitionCoverageTable->at(i) );
+ }
+ }
+
+ delete( mTransitionCoverageTable );
+ }
+
+ endOffset = mExecutableCoverageTable->size();
+ for( avm_size_t i = 0 ; i < endOffset ; ++i )
+ {
+ if( mExecutableCoverageTable->at(i) != NULL )
+ {
+ delete( mExecutableCoverageTable->at(i) );
+ }
+ }
+
+ delete( mExecutableCoverageTable );
+ }
+
+ else if( mTransitionCoverageTable != NULL )
+ {
+ avm_size_t endOffset = mTransitionCoverageTable->size();
+ for( avm_size_t i = 0 ; i < endOffset ; ++i )
+ {
+ if( mTransitionCoverageTable->at(i) != NULL )
+ {
+ delete( mTransitionCoverageTable->at(i) );
+ }
+ }
+
+ delete( mTransitionCoverageTable );
+ }
+}
+
+
+/**
+ * CONFIGURE
+ */
+bool AvmCoverageTransitionView::configureImpl()
+{
+ WObject * thePROPERTY = Query::getRegexWSequence(
+ getParameterWObject(), OR_WID2("property", "PROPERTY"));
+
+ if( thePROPERTY != WObject::_NULL_ )
+ {
+ const ExecutionData & anED =
+ mCoverageProcessor.getConfiguration().getMainExecutionData();
+
+ mTransitionCoverageTable =
+ new ArrayOfBitset(anED.getTableOfRuntime().size(), NULL);
+
+ ExecutableQuery XQuery( mCoverageProcessor.getConfiguration() );
+
+ XQuery.getRuntimeExecutable( mTableofRuntimeExecutable );
+
+ mScope = Specifier::toDesignKind(
+ Query::getWPropertyString(thePROPERTY, "scope", "MODEL") );
+
+ switch( mScope )
+ {
+ case Specifier::DESIGN_INSTANCE_KIND:
+ {
+ // INITIALISATION de la table de tous les PROGRAM
+ // associés à chacune des INSTANCE...
+ configureInstanceCoverageTableFlag(false);
+
+ break;
+ }
+
+ case Specifier::DESIGN_MODEL_KIND:
+ {
+ // INITIALISATION de la table de tous les PROGRAM
+ // associés à chacune des EXECUTABLE...
+ configureExecutableCoverageTableFlag(false);
+
+ break;
+ }
+
+ default: // for << @scope = 'DETAILS'; >>
+ {
+ WObject * theDETAILS = Query::getRegexWSequence(
+ getParameterWObject(), OR_WID2("details", "DETAILS"));
+
+ if( theDETAILS != WObject::_NULL_ )
+ {
+ ExecutableForm * anExecutable = NULL;
+ AvmTransition * aTransition = NULL;
+
+ ListOfExecutableForm listOfExecutable;
+ ListOfInstanceOfMachine listOfInstance;
+ ListOfAvmTransition listOfTransition;
+
+ WObject::const_iterator itWfO = theDETAILS->owned_begin();
+ WObject::const_iterator endWfO = theDETAILS->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty() )
+ {
+ const std::string & kind = (*itWfO)->getNameID();
+ const std::string & qnid = (*itWfO)->toStringValue();
+
+ if( (kind == "model") || (kind == "form") ||
+ (kind == "executable") )
+ {
+ anExecutable =
+ XQuery.getExecutableByQualifiedNameID(
+ qnid ).to_ptr< ExecutableForm >();
+ if( anExecutable != NULL )
+ {
+ listOfExecutable.append(anExecutable);
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound the machine "
+ << kind << " << " << qnid
+ << " >> as coverage processor parameter:> "
+ << getParameterWObject()
+ ->getFullyQualifiedNameID()
+ << std::endl;
+ }
+ }
+ else if( kind == "instance" )
+ {
+ const BF & anInstance = XQuery.searchMachine(
+ Specifier::DESIGN_INSTANCE_KIND, qnid);
+ if( anInstance.valid() )
+ {
+ listOfInstance.append(
+ anInstance.to_ptr< InstanceOfMachine >());
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound the machine "
+ << kind << " << " << qnid
+ << " >> as coverage processor parameter:> "
+ << getParameterWObject()
+ ->getFullyQualifiedNameID()
+ << std::endl;
+ }
+ }
+ else if( kind == "transition" )
+ {
+ aTransition =
+ XQuery.getTransitionByQualifiedNameID(
+ qnid ).to_ptr< AvmTransition >();
+ if( aTransition != NULL )
+ {
+ listOfTransition.append(aTransition);
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound the "
+ << kind << " << " << qnid
+ << " >> as coverage processor parameter:> "
+ << getParameterWObject()
+ ->getFullyQualifiedNameID()
+ << std::endl;
+ }
+ }
+ else if( kind == "program" )
+ {
+ aTransition =
+ XQuery.getTransitionByQualifiedNameID(
+ qnid ).to_ptr< AvmTransition >();
+ if( aTransition != NULL )
+ {
+ listOfTransition.append(aTransition);
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound the "
+ << kind << " << " << qnid
+ << " >> as coverage processor parameter:> "
+ << getParameterWObject()
+ ->getFullyQualifiedNameID()
+ << std::endl;
+ }
+ }
+ else
+ {
+ AVM_OS_WARN << "Unexpected attribute << "
+ << (*itWfO)->str()
+ << " >> as coverage processor parameter:> "
+ << getParameterWObject()
+ ->getFullyQualifiedNameID()
+ << std::endl;
+ }
+ }
+ }
+
+
+ // INITIALISATION de la table de tous les PROGRAM
+ // associés à chacun des EXECUTABLE...
+ configureExecutableCoverageTableFlag(true);
+
+ ListOfExecutableForm::iterator itExec = listOfExecutable.begin();
+ ListOfExecutableForm::iterator endExec = listOfExecutable.end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ configureExecutableCoverageTableFlag((*itExec), false);
+ }
+
+
+ // Cas des programmes
+ configureTransitionCoverageTableFlag(listOfTransition, false);
+
+
+ // INITIALISATION de la table de tous les PROGRAM
+ // associés à chacune des INSTANCE...
+ ListOfInstanceOfMachine::iterator itInst = listOfInstance.begin();
+ ListOfInstanceOfMachine::iterator endInst = listOfInstance.end();
+ for( ; itInst != endInst ; ++itInst )
+ {
+ if( (*itInst)->getExecutable()->hasTransition() )
+ {
+ configureInstanceCoverageTableFlag(anED,
+ anED.getRuntimeID(*itInst), false);
+ }
+ }
+
+
+ if( mExecutableCoverageTable != NULL)
+ {
+ if( mTransitionCoverageTable != NULL)
+ {
+ // INITIALISATION de la table de tous les PROGRAM
+ // associés à chacune des INSTANCE...
+ configureInstanceCoverageTableFlag();
+ }
+ else
+ {
+ mScope = Specifier::DESIGN_MODEL_KIND;
+ }
+ }
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound section << DETAILS >> "
+ "as coverage processor parameter:> "
+ << getParameterWObject()->getFullyQualifiedNameID()
+ << std::endl;
+ }
+
+ break;
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ AVM_OS_TRACE << "Uncovered Transition Count at the beginning :> "
+ << mCoverageStatistics.mNumberOfElements << std::endl << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ }
+
+
+ if( (mHeuristicProperty.mCoverageHeightPeriod == 0) ||
+ (mHeuristicProperty.mCoverageHeightPeriod == AVM_NUMERIC_MAX_SIZE_T) )
+ {
+ mHeuristicProperty.mCoverageHeight =
+ mHeuristicProperty.mCoverageHeightPeriod = 7;
+// mCoverageStatistics.mNumberOfElements;
+ }
+ mHeuristicProperty.mCoverageHeightReachedCount = 0;
+ mHeuristicProperty.mCoverageHeightReachedFlag = false;
+
+ if( mHeuristicProperty.mCoverageHeightReachedLimit == 0 )
+ {
+ mHeuristicProperty.mCoverageHeightReachedLimit =
+ mCoverageStatistics.mNumberOfElements;
+ }
+
+
+ return mConfigFlag;
+}
+
+
+void AvmCoverageTransitionView::configureExecutableCoverageTableFlag(bool value)
+{
+ if( mExecutableCoverageTable == NULL )
+ {
+ mExecutableCoverageTable = new ArrayOfBitset(mCoverageProcessor.
+ getConfiguration().getExecutableSystem().size(), NULL);
+ }
+
+ Bitset * tableOfFlag = NULL;
+ avm_size_t itTransition = 0;
+ avm_size_t endTransition = 0;
+
+ VectorOfExecutableForm::iterator itExec = mTableofRuntimeExecutable.begin();
+ VectorOfExecutableForm::iterator endExec = mTableofRuntimeExecutable.end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ if( (*itExec)->hasTransition() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING , (! value) )
+ AVM_OS_TRACE << "executable :> " << (*itExec)->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING )
+
+ tableOfFlag = mExecutableCoverageTable->at( (*itExec)->getOffset() );
+ if( tableOfFlag == NULL )
+ {
+ tableOfFlag = new Bitset((*itExec)->getTransition().size(), true);
+
+ mExecutableCoverageTable->set((*itExec)->getOffset(), tableOfFlag);
+ }
+
+ endTransition = (*itExec)->getTransition().size();
+ for( itTransition = 0 ; itTransition < endTransition ; ++itTransition )
+ {
+ if( (! value) && tableOfFlag->test(itTransition) )
+ {
+ tableOfFlag->set(itTransition, value);
+
+ if( not value )
+ {
+ mCoverageStatistics.addUncoveredElement();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ AVM_OS_TRACE << "\t" << "program :> "
+ << (*itExec)->rawTransition(itTransition)->getFullyQualifiedNameID()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ }
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING , (! value) )
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING )
+ }
+ else
+ {
+ mExecutableCoverageTable->set((*itExec)->getOffset(), NULL);
+ }
+ }
+}
+
+
+void AvmCoverageTransitionView::configureExecutableCoverageTableFlag(
+ ExecutableForm * anExecutable, bool value)
+{
+ if( mExecutableCoverageTable == NULL )
+ {
+ mExecutableCoverageTable = new ArrayOfBitset(mCoverageProcessor.
+ getConfiguration().getExecutableSystem().size(), NULL);
+ }
+
+ if( anExecutable->hasTransition() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING , (! value) )
+ AVM_OS_TRACE << "executable :> " << anExecutable->getFullyQualifiedNameID()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING )
+
+ Bitset * tableOfFlag =
+ mExecutableCoverageTable->at( anExecutable->getOffset() );
+ if( tableOfFlag == NULL )
+ {
+ tableOfFlag = new Bitset(anExecutable->getTransition().size(), true);
+
+ mExecutableCoverageTable->set(anExecutable->getOffset(), tableOfFlag);
+ }
+
+ avm_size_t endTransition = anExecutable->getTransition().size();
+ avm_size_t itTransition = 0;
+ for( ; itTransition < endTransition ; ++itTransition )
+ {
+ if( (! value) && tableOfFlag->test(itTransition) )
+ {
+ tableOfFlag->set(itTransition, value);
+
+ mCoverageStatistics.addUncoveredElement();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ AVM_OS_TRACE << "\t" << "program :> "
+ << anExecutable->rawTransition(itTransition)->getFullyQualifiedNameID()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING , (! value) )
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING )
+ }
+
+ // Cas des sous machine executable
+ if( anExecutable->hasInstanceStatic() )
+ {
+ TableOfSymbol::const_iterator it = anExecutable->instance_static_begin();
+ TableOfSymbol::const_iterator endIt = anExecutable->instance_static_end();
+ for( ; it != endIt ; ++it )
+ {
+ configureExecutableCoverageTableFlag((*it).getExecutable(), value);
+ }
+ }
+}
+
+
+void AvmCoverageTransitionView::configureInstanceCoverageTableFlag()
+{
+ if( mExecutableCoverageTable != NULL)
+ {
+ const ExecutionData & anED =
+ mCoverageProcessor.getConfiguration().getMainExecutionData();
+
+ RuntimeID aRID;
+
+ if( mTransitionCoverageTable == NULL )
+ {
+ mTransitionCoverageTable =
+ new ArrayOfBitset(anED.getTableOfRuntime().size(), NULL);
+ }
+
+ avm_size_t endMachine = mTransitionCoverageTable->size();
+ for( avm_size_t itMachine = 0 ; itMachine < endMachine ; ++itMachine )
+ {
+ aRID = anED.getRuntimeID(itMachine);
+ if( aRID.getExecutable()->hasTransition() &&
+ (mTransitionCoverageTable->at(itMachine) == NULL) )
+ {
+ mTransitionCoverageTable->set(itMachine,
+ mExecutableCoverageTable->at(
+ aRID.getExecutable()->getOffset()));
+ }
+ }
+ }
+}
+
+
+
+void AvmCoverageTransitionView::configureInstanceCoverageTableFlag(bool value)
+{
+ const ExecutionData & anED =
+ mCoverageProcessor.getConfiguration().getMainExecutionData();
+ RuntimeID aRID;
+ Bitset * tableOfFlag = NULL;
+
+ avm_size_t itTransition = 0;
+ avm_size_t endTransition = 0;
+
+ if( mTransitionCoverageTable == NULL )
+ {
+ mTransitionCoverageTable =
+ new ArrayOfBitset(anED.getTableOfRuntime().size(), NULL);
+ }
+
+ avm_size_t endMachine = mTransitionCoverageTable->size();
+ for( avm_size_t itMachine = 0 ; itMachine < endMachine ; ++itMachine )
+ {
+ aRID = anED.getRuntimeID(itMachine);
+ if( aRID.getExecutable()->hasTransition() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING , (not value) )
+ AVM_OS_TRACE << "machine :> " << aRID.getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING )
+
+ tableOfFlag = mTransitionCoverageTable->at( itMachine );
+ if( tableOfFlag == NULL )
+ {
+ tableOfFlag = new Bitset(
+ aRID.getExecutable()->getTransition().size(), true);
+
+ mTransitionCoverageTable->set(itMachine, tableOfFlag);
+ }
+
+ endTransition = aRID.getExecutable()->getTransition().size();
+ for( itTransition = 0 ; itTransition < endTransition ; ++itTransition )
+ {
+ if( (not value) && tableOfFlag->test(itTransition) )
+ {
+ tableOfFlag->set(itTransition, value);
+
+ if( not value )
+ {
+ mCoverageStatistics.addUncoveredElement();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ AVM_OS_TRACE << "\t" << "program :> "
+ << aRID.getExecutable()->rawTransition(itTransition)->getFullyQualifiedNameID()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ }
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING , (! value) )
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING )
+ }
+ else
+ {
+ mTransitionCoverageTable->set(itMachine, NULL);
+ }
+ }
+}
+
+
+void AvmCoverageTransitionView::configureInstanceCoverageTableFlag(
+ const ExecutionData & anED, const RuntimeID & aRID, bool value)
+{
+ if( mExecutableCoverageTable == NULL )
+ {
+ configureExecutableCoverageTableFlag( true );
+ }
+
+ if( mTransitionCoverageTable == NULL )
+ {
+ mTransitionCoverageTable =
+ new ArrayOfBitset(anED.getTableOfRuntime().size(), NULL);
+ }
+
+ ExecutableForm * anExecutable = aRID.getExecutable();
+
+ if( (anExecutable != NULL) &&
+ (mTransitionCoverageTable->at(aRID.getOffset()) == NULL) )
+ {
+ if( anExecutable->hasTransition() &&
+ mExecutableCoverageTable->at(anExecutable->getOffset()) == NULL )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING , (! value) )
+ AVM_OS_TRACE << "machine :> " << aRID.getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING )
+
+ Bitset * tableOfFlag =
+ mTransitionCoverageTable->at( aRID.getOffset() );
+ if( tableOfFlag == NULL )
+ {
+ tableOfFlag = new Bitset(
+ anExecutable->getTransition().size(), true);
+
+ mTransitionCoverageTable->set(aRID.getOffset(), tableOfFlag);
+ }
+
+ avm_size_t endTransition = anExecutable->getTransition().size();
+ avm_size_t itTransition = 0;
+ for( ; itTransition < endTransition ; ++itTransition )
+ {
+ if( (! value) && tableOfFlag->test(itTransition) )
+ {
+ tableOfFlag->set(itTransition, value);
+
+ mCoverageStatistics.addUncoveredElement();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ AVM_OS_TRACE << "\t" << "program :> "
+ << anExecutable->rawTransition(itTransition)->getFullyQualifiedNameID()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING , (! value) )
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING )
+ }
+ else if( anExecutable->hasTransition() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING , (! value) )
+ AVM_OS_TRACE << "machine :> " << aRID.getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING )
+
+ Bitset * tableOfFlag =
+ mTransitionCoverageTable->at( aRID.getOffset() );
+ if( tableOfFlag == NULL )
+ {
+ tableOfFlag = new Bitset(
+ anExecutable->getTransition().size(), true);
+
+ mTransitionCoverageTable->set(aRID.getOffset(), tableOfFlag);
+ }
+
+ avm_size_t endTransition = anExecutable->getTransition().size();
+ avm_size_t itTransition = 0;
+ for( ; itTransition < endTransition ; ++itTransition )
+ {
+ tableOfFlag->set(itTransition,
+ value && mExecutableCoverageTable->at(
+ anExecutable->getOffset())->test(itTransition) );
+
+ if( (! value) && mExecutableCoverageTable->at(
+ anExecutable->getOffset())->test(itTransition) )
+ {
+ mCoverageStatistics.addUncoveredElement();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ AVM_OS_TRACE << "\t" << "program :> "
+ << anExecutable->rawTransition(itTransition)->getFullyQualifiedNameID()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING , (! value) )
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING )
+ }
+
+ // Cas des sous machine instance
+ if( anED.getRuntime(aRID).hasChild() )
+ {
+ TableOfRuntimeID::const_iterator itSubMachine =
+ anED.getRuntime(aRID).beginChild();
+ TableOfRuntimeID::const_iterator endSubMachine =
+ anED.getRuntime(aRID).endChild();
+ for( ; itSubMachine != endSubMachine ; ++itSubMachine )
+ {
+ configureInstanceCoverageTableFlag(anED, (*itSubMachine), value);
+ }
+ }
+ }
+}
+
+
+void AvmCoverageTransitionView::configureTransitionCoverageTableFlag(
+ ListOfAvmTransition & listOfTransition, bool value)
+{
+ if( mExecutableCoverageTable == NULL )
+ {
+ mExecutableCoverageTable = new ArrayOfBitset(mCoverageProcessor.
+ getConfiguration().getExecutableSystem().size(), NULL);
+ }
+
+ Bitset * tableOfFlag = NULL;
+ avm_offset_t containerExecOffset = 0;
+
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING ,
+ (! value) && listOfTransition.nonempty() )
+ AVM_OS_TRACE << "program :> user details" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING )
+
+ ListOfAvmTransition::iterator itProg = listOfTransition.begin();
+ ListOfAvmTransition::iterator endProg = listOfTransition.end();
+ for( ; itProg != endProg ; ++itProg )
+ {
+ containerExecOffset = (*itProg)->getExecutableContainer()->getOffset();
+
+ tableOfFlag = mExecutableCoverageTable->at(containerExecOffset);
+ if( tableOfFlag == NULL )
+ {
+ tableOfFlag = new Bitset(
+ (*itProg)->getExecutableContainer()->getTransition().size(), true);
+
+ mExecutableCoverageTable->set(containerExecOffset, tableOfFlag);
+ }
+ if( (! value) && tableOfFlag->test( (*itProg)->getOffset() ) )
+ {
+ mExecutableCoverageTable->at( containerExecOffset )->set(
+ (*itProg)->getOffset(), value);
+
+ mCoverageStatistics.addUncoveredElement();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ AVM_OS_TRACE << "\t" << "program :> " << (*itProg)->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING ,
+ (! value) && listOfTransition.nonempty() )
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING )
+}
+
+
+Bitset * AvmCoverageTransitionView::getCoverageTableBitset(
+ const RuntimeID & aRID)
+{
+ switch( mScope )
+ {
+ case Specifier::DESIGN_MODEL_KIND:
+ {
+ return( mExecutableCoverageTable->at(
+ aRID.getExecutable()->getOffset() ) );
+ }
+ case Specifier::DESIGN_INSTANCE_KIND:
+ default:
+ {
+ return( mTransitionCoverageTable->at( aRID.getOffset() ) );
+ }
+ }
+}
+
+
+/*
+ * REPORT
+ */
+void AvmCoverageTransitionView::reportMinimum(OutStream & os) const
+{
+ if( mCoverageStatistics.goalAchieved() )
+ {
+ os << TAB2 << "All the << " << mCoverageStatistics.mNumberOfElements
+ << " >> transitions are covered !" << EOL;
+ }
+ else
+ {
+ os << TAB2 << "Warning: all the transitions are not covered !" << EOL;
+ mCoverageStatistics.toStreamCoverageRate( os << TAB2,
+ "Results: << ", " on "," >> are covered !\n" );
+
+ if( isReportDetails() )
+ {
+ os << TAB2 << "List of the << "
+ << mCoverageStatistics.getNumberOfUncovered()
+ << " >> transitions non covered:" << EOL2;
+
+ const ExecutionData & anED =
+ mCoverageProcessor.getConfiguration().getMainExecutionData();
+
+ RuntimeID aRID;
+
+ StringOutStream oss( os.INDENT );
+ bool hasOneUncoverdTransition = false;
+
+ avm_size_t offset;
+ avm_size_t endOffset;
+ AvmTransition * itTransition;
+
+ switch( mScope )
+ {
+ case Specifier::DESIGN_INSTANCE_KIND:
+ {
+ if( mTransitionCoverageTable == NULL )
+ {
+ break;
+ }
+
+ avm_size_t endMachine = mTransitionCoverageTable->size();
+ avm_size_t itMachine = 0;
+ for( ; itMachine < endMachine ; ++itMachine )
+ {
+ aRID = anED.getRuntimeID(itMachine);
+ if( aRID.getExecutable()->hasTransition() )
+ {
+ oss.str("");
+
+// oss << TAB2 << "instance :> " << aRID.getFullyQualifiedNameID() << EOL;
+ if( not aRID.getExecutable()->isReachableState() )
+ {
+ oss << TAB2 << "instance[ NO INCOMING TRANSITION ] :> "
+ << aRID.getFullyQualifiedNameID() << EOL;
+ }
+
+ hasOneUncoverdTransition = false;
+
+ endOffset = aRID.getExecutable()->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itTransition = aRID.getExecutable()->
+ getTransition().rawAt(offset);
+
+ if( not mTransitionCoverageTable->
+ at( aRID.getOffset() )->test( offset ) )
+ {
+ hasOneUncoverdTransition = true;
+ oss << TAB3 << itTransition->
+ strTransitionHeader() << EOL;
+ }
+ }
+ if( hasOneUncoverdTransition )
+ {
+ os << oss.str() << EOL;
+ }
+ }
+ }
+
+ break;
+ }
+
+ case Specifier::DESIGN_MODEL_KIND:
+ {
+ if( mExecutableCoverageTable == NULL )
+ {
+ break;
+ }
+
+ VectorOfExecutableForm::const_iterator itExec =
+ mTableofRuntimeExecutable.begin();
+ VectorOfExecutableForm::const_iterator endExec =
+ mTableofRuntimeExecutable.end();
+ for( avm_size_t indexExec = 0 ; itExec != endExec ;
+ ++itExec , ++indexExec )
+ {
+ if( (*itExec)->hasTransition() )
+ {
+ oss.str("");
+
+// oss << TAB2 << "model :> " << (*itExec)->getFullyQualifiedNameID() << EOL;
+ if( not (*itExec)->isReachableState() )
+ {
+ oss << TAB2 << "model[ NO INCOMING TRANSITION ] :> "
+ << (*itExec)->getFullyQualifiedNameID() << EOL;
+ }
+
+ hasOneUncoverdTransition = false;
+
+ endOffset = (*itExec)->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itTransition = (*itExec)->getTransition().rawAt(offset);
+
+ if( not mExecutableCoverageTable->
+ at((*itExec)->getOffset())->test( offset ) )
+ {
+ hasOneUncoverdTransition = true;
+ oss << TAB3 << itTransition->
+ strTransitionHeader() << EOL;
+ }
+ }
+ if( hasOneUncoverdTransition )
+ {
+ os << oss.str() << EOL;
+ }
+ }
+ }
+
+ break;
+ }
+
+ default:
+ {
+ if( mExecutableCoverageTable != NULL )
+ {
+ VectorOfExecutableForm::const_iterator itExec =
+ mTableofRuntimeExecutable.begin();
+ VectorOfExecutableForm::const_iterator endExec =
+ mTableofRuntimeExecutable.end();
+ for( avm_size_t indexExec = 0 ; itExec != endExec ;
+ ++itExec , ++indexExec )
+ {
+ if( (*itExec)->hasTransition() )
+ {
+ oss.str("");
+
+// oss << TAB2 << "model :> " << (*itExec)->getFullyQualifiedNameID() << EOL;
+ if( not (*itExec)->isReachableState() )
+ {
+ oss << TAB2 << "model[ NO INCOMING TRANSITION ] :> "
+ << (*itExec)->getFullyQualifiedNameID() << EOL;
+ }
+
+ hasOneUncoverdTransition = false;
+
+ endOffset = (*itExec)->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itTransition = (*itExec)->getTransition().rawAt(offset);
+
+ if( not mExecutableCoverageTable->
+ at((*itExec)->getOffset())->test( offset ) )
+ {
+ hasOneUncoverdTransition = true;
+ oss << TAB3 << itTransition->
+ strTransitionHeader() << EOL;
+ }
+ }
+ if( hasOneUncoverdTransition )
+ {
+ os << oss.str() << EOL;
+ }
+ }
+ }
+ }
+
+ if( mTransitionCoverageTable != NULL )
+ {
+ avm_size_t endMachine = mTransitionCoverageTable->size();
+ avm_size_t itMachine = 0;
+ for( ; itMachine < endMachine ; ++itMachine )
+ {
+ aRID = anED.getRuntimeID(itMachine);
+ if( aRID.getExecutable()->hasTransition() )
+ {
+ oss.str("");
+
+// oss << TAB2 << "instance :> " << aRID.getFullyQualifiedNameID() << EOL;
+ if( not aRID.getExecutable()->isReachableState() )
+ {
+ oss << TAB2 << "instance[ NO INCOMING TRANSITION ] :> "
+ << aRID.getFullyQualifiedNameID() << EOL;
+ }
+
+ hasOneUncoverdTransition = false;
+
+ endOffset = aRID.getExecutable()->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itTransition = aRID.getExecutable()->
+ getTransition().rawAt(offset);
+
+ if( (not mTransitionCoverageTable->
+ at(aRID.getOffset())->test(offset))
+ && mExecutableCoverageTable->
+ at(aRID.getExecutable()->getOffset())->
+ test(offset) )
+ {
+ hasOneUncoverdTransition = true;
+ oss << TAB3 << itTransition->
+ strTransitionHeader() << EOL;
+ }
+ }
+ if( hasOneUncoverdTransition )
+ {
+ os << oss.str() << EOL;
+ }
+ }
+ }
+ }
+
+ break;
+ }
+ }
+ }
+
+ if ( isReportDetails() && mCoverageStatistics.hasUncovered() )
+ {
+ mCoverageStatistics.toStreamCoverageRate( os << TAB2,
+ "Results: << ", " on "," >> are covered !\n" );
+ }
+ }
+
+//$ if( mSliceFlag )
+// {
+// os << TAB2 << "Number of nodes cut back: " << mSliceCount << EOL;
+//$ }
+
+ os << std::flush;
+}
+
+
+void AvmCoverageTransitionView::reportDefault(OutStream & os) const
+{
+//$ if( mHeuristicFlag )
+ {
+ os << std::boolalpha
+ << " < ch:" << mHeuristicProperty.mCoverageHeight
+ << " , chp:" << mHeuristicProperty.mCoverageHeightPeriod
+ << " , chrl:" << mHeuristicProperty.mCoverageHeightReachedLimit
+
+ << " ; hcr:" << mHeuristicProperty.mHitCertainlyRandomFlag
+ << " , hcc:" << mHeuristicProperty.mHitCertainlyCount
+
+ << " ; hsr:" << mHeuristicProperty.mHitStronglyRandomFlag
+ << " , hsc:" << mHeuristicProperty.mHitStronglyCount
+
+ << " ; hwr:" << mHeuristicProperty.mHitWeaklyRandomFlag
+ << " , hwc:" << mHeuristicProperty.mHitWeaklyCount
+
+ << " ; hor:" << mHeuristicProperty.mHitOtherRandomFlag
+ << " , hoc:" << mHeuristicProperty.mHitOtherCount
+ << " > "
+ << std::noboolalpha;
+ }
+
+ os << EOL_FLUSH;
+
+ if( mCoverageStatistics.goalAchieved() )
+ {
+ os << TAB2 << "All the << " << mCoverageStatistics.mNumberOfElements
+ << " >> transitions are covered !" << EOL;
+ }
+ else
+ {
+ os << TAB2 << "Warning: all the transitions are not covered !" << EOL;
+ mCoverageStatistics.toStreamCoverageRate( os << TAB2,
+ "Results: << ", " on "," >> are covered !\n" );
+
+ if( isReportDetails() )
+ {
+ os << TAB2 << "List of the << "
+ << mCoverageStatistics.getNumberOfUncovered()
+ << " >> transitions non covered:" << EOL << EOL;
+
+ const ExecutionData & anED =
+ mCoverageProcessor.getConfiguration().getMainExecutionData();
+
+ RuntimeID aRID;
+
+ StringOutStream oss( os.INDENT );
+ bool hasOneUncoverdTransition = false;
+
+ avm_size_t offset;
+ avm_size_t endOffset;
+ AvmTransition * itTransition;
+
+ switch( mScope )
+ {
+ case Specifier::DESIGN_INSTANCE_KIND:
+ {
+ if( mTransitionCoverageTable == NULL )
+ {
+ break;
+ }
+
+ avm_size_t endMachine = mTransitionCoverageTable->size();
+ avm_size_t itMachine = 0;
+ for( ; itMachine < endMachine ; ++itMachine )
+ {
+ aRID = anED.getRuntimeID(itMachine);
+ if( aRID.getExecutable()->hasTransition() )
+ {
+ oss.str("");
+
+ oss << TAB2 << "instance";
+ if( not aRID.getExecutable()->isReachableState() )
+ {
+ oss << "[ NO INCOMING TRANSITION ]";
+ }
+ oss << " :> " << aRID.getFullyQualifiedNameID() << EOL;
+
+ hasOneUncoverdTransition = false;
+
+ endOffset = aRID.getExecutable()->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itTransition = aRID.getExecutable()->
+ getTransition().rawAt(offset);
+
+ if( not mTransitionCoverageTable->
+ at( aRID.getOffset() )->test( offset ) )
+ {
+ hasOneUncoverdTransition = true;
+ oss << TAB3 << itTransition->
+ strTransitionHeader() << EOL;
+ }
+ }
+ if( hasOneUncoverdTransition )
+ {
+ os << oss.str() << EOL;
+ }
+ }
+ }
+
+ break;
+ }
+
+ case Specifier::DESIGN_MODEL_KIND:
+ {
+ if( mExecutableCoverageTable == NULL )
+ {
+ break;
+ }
+
+ VectorOfExecutableForm::const_iterator itExec =
+ mTableofRuntimeExecutable.begin();
+ VectorOfExecutableForm::const_iterator endExec =
+ mTableofRuntimeExecutable.end();
+ for( avm_size_t indexExec = 0 ; itExec != endExec ;
+ ++itExec , ++indexExec )
+ {
+ if( (*itExec)->hasTransition() )
+ {
+ oss.str("");
+
+ oss << TAB2 << "model";
+ if( not (*itExec)->isReachableState() )
+ {
+ oss << "[ NO INCOMING TRANSITION ]";
+ }
+ oss << " :> " << (*itExec)->getFullyQualifiedNameID() << EOL;
+
+ hasOneUncoverdTransition = false;
+
+ endOffset = (*itExec)->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itTransition = (*itExec)->getTransition().rawAt(offset);
+
+ if( not mExecutableCoverageTable->
+ at((*itExec)->getOffset())->test( offset ) )
+ {
+ hasOneUncoverdTransition = true;
+ oss << TAB3 << itTransition->
+ strTransitionHeader() << EOL;
+ }
+ }
+ if( hasOneUncoverdTransition )
+ {
+ os << oss.str() << EOL;
+ }
+ }
+ }
+
+ break;
+ }
+
+ default:
+ {
+ if( mExecutableCoverageTable != NULL )
+ {
+ VectorOfExecutableForm::const_iterator itExec =
+ mTableofRuntimeExecutable.begin();
+ VectorOfExecutableForm::const_iterator endExec =
+ mTableofRuntimeExecutable.end();
+ avm_size_t indexExec = 0;
+ for( ; itExec != endExec ; ++itExec , ++indexExec )
+ {
+ if( (*itExec)->hasTransition() )
+ {
+ oss.str("");
+
+ oss << TAB2 << "model";
+ if( not (*itExec)->isReachableState() )
+ {
+ oss << "[ NO INCOMING TRANSITION ]";
+ }
+ oss << " :> " << (*itExec)->getFullyQualifiedNameID() << EOL;
+
+
+ hasOneUncoverdTransition = false;
+
+ endOffset = (*itExec)->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itTransition = (*itExec)->getTransition().rawAt(offset);
+
+ if( not mExecutableCoverageTable->
+ at((*itExec)->getOffset())->test( offset ) )
+ {
+ hasOneUncoverdTransition = true;
+ oss << TAB3 << itTransition->
+ strTransitionHeader() << EOL;
+ }
+ }
+ if( hasOneUncoverdTransition )
+ {
+ os << oss.str() << EOL;
+ }
+ }
+ }
+ }
+
+ if( mTransitionCoverageTable != NULL )
+ {
+ avm_size_t endMachine = mTransitionCoverageTable->size();
+ avm_size_t itMachine = 0;
+ for( ; itMachine < endMachine ; ++itMachine )
+ {
+ aRID = anED.getRuntimeID(itMachine);
+ if( aRID.getExecutable()->hasTransition() )
+ {
+ oss.str("");
+
+ oss << TAB2 << "instance";
+ if( not aRID.getExecutable()->isReachableState() )
+ {
+ oss << "[ NO INCOMING TRANSITION ]";
+ }
+ oss << " :> " << aRID.getFullyQualifiedNameID() << EOL;
+
+ hasOneUncoverdTransition = false;
+
+ endOffset = aRID.getExecutable()->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itTransition = aRID.getExecutable()->
+ getTransition().rawAt(offset);
+
+ if( (not mTransitionCoverageTable->
+ at(aRID.getOffset())->test(offset))
+ && mExecutableCoverageTable->
+ at(aRID.getExecutable()->getOffset())->
+ test(offset) )
+ {
+ hasOneUncoverdTransition = true;
+ oss << TAB3 << itTransition->
+ strTransitionHeader() << EOL;
+ }
+ }
+ if( hasOneUncoverdTransition )
+ {
+ os << oss.str() << EOL;
+ }
+ }
+ }
+ }
+
+ break;
+ }
+ }
+ }
+
+ if ( isReportDetails() && mCoverageStatistics.hasUncovered() )
+ {
+ mCoverageStatistics.toStreamCoverageRate( os << TAB2,
+ "Results: << ", " on "," >> are covered !\n" );
+ }
+ }
+
+//$ if( mSliceFlag )
+// {
+// os << TAB2 << "Number of nodes cut back: " << mSliceCount << EOL;
+//$ }
+
+ os << std::flush;
+}
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// PROCESSOR FILTERING API
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmCoverageTransitionView::prefiltering(ListOfExecutionContext & ecQueue)
+{
+ mDirectiveFailedFlag = false;
+ mDirectiveHitEC = NULL;
+
+ endQueue = ecQueue.end();
+ for( itQueue = ecQueue.begin() ; itQueue != endQueue ; ++itQueue )
+ {
+ if( (*itQueue)->isWeight(WEIGHT_SELECTED_ACHIEVABLE) )
+ {
+ mDirectiveHitEC = (*itQueue);
+ }
+ else if( (mDirectiveHitEC == NULL) && (*itQueue)->
+ isWeight(WEIGHT_CERTAINLY_ACHIEVABLE) )
+ {
+ mDirectiveHitEC = (*itQueue);
+ }
+ else if( (mDirectiveHitEC == NULL) && (*itQueue)->
+ isWeight(WEIGHT_STRONGLY_ACHIEVABLE) )
+ {
+ mDirectiveHitEC = (*itQueue);
+ }
+ }
+
+ return( true );
+}
+
+
+bool AvmCoverageTransitionView::postfiltering(ListOfExecutionContext & ecQueue)
+{
+ endQueue = ecQueue.end();
+ for( itQueue = ecQueue.begin() ; itQueue != endQueue ; ++itQueue )
+ {
+ endEC = (*itQueue)->end();
+ for( itEC = (*itQueue)->begin() ; (itEC != endEC) ; ++itEC )
+ {
+// updateTransitionCoverageTable((*itEC),
+// (*itEC)->getRunnableElementTrace());
+ updateCoverageTable( *itEC );
+
+ if( mCoverageStatistics.goalAchieved() )
+ {
+ return( true );
+ }
+ }
+
+ if( mDirectiveHitEC == (*itQueue) )
+ {
+ mDirectiveFailedFlag = mCoverageStatistics.isNewlyFailedStep();
+ }
+ }
+
+ return( false );
+}
+
+
+void AvmCoverageTransitionView::updateCoverageTable(ExecutionContext * anEC)
+{
+ updateTransitionCoverageTable(anEC, anEC->getRunnableElementTrace());
+}
+
+
+
+/**
+ * Heuristic << High Priority Context >> implementation
+ * REQUEUE_WAITING part
+ */
+bool AvmCoverageTransitionView::computeHighPriorityContext(
+ ListOfExecutionContext & ecQueue,
+ WaitingStrategy & aWaitingStrategy)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ mCoverageStatistics.toStreamCoverageRate(AVM_OS_COUT ,
+ "Number of covered transitions = ", " / ", "\n");
+
+ mCoverageStatistics.toStreamCoverageRate(AVM_OS_TRACE,
+ "Number of covered transitions = ", " / ", "\n");
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ computeWeightOfResult(ecQueue);
+
+ if( mDirectiveFailedFlag && mCoverageStatistics.hasFailedStep() &&
+ (mHeuristicProperty.mHitStronglyCount == 1) )
+ {
+ if( aWaitingStrategy.hasWaiting(WEIGHT_STRONGLY_ACHIEVABLE) )
+ {
+ //!! NOTHING if Waiting Queue has BFS Strategy
+ return( true );
+ }
+ else
+ {
+ // goto failedCase:
+ }
+ }
+
+ // case of found certainly hit EC
+ else if( mCertainlyFireableTransitionCount > 0 )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "==> Next [ Certainly ] Fireable Count :> "
+ << mCertainlyFireableTransitionCount
+ << " Hit Count : " << mCertainlyHitEC.size() << std::endl;
+ AVM_OS_TRACE << "==> Next [ Certainly ] Fireable Count :> "
+ << mCertainlyFireableTransitionCount
+ << " Hit Count : " << mCertainlyHitEC.size() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ setHitWeight(mCertainlyHitEC, WEIGHT_SELECTED_ACHIEVABLE,
+ mHeuristicProperty.mHitCertainlyRandomFlag,
+ mHeuristicProperty.mHitCertainlyCount);
+
+ return( true );
+ }
+
+ // case of found strongly hit EC
+ else if( mStronglyFireableTransitionCount > 0 )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "==> Next [ Strongly ] Fireable Count :> "
+ << mStronglyFireableTransitionCount
+ << " Hit Count : " << mStronglyHitEC.size() << std::endl;
+ AVM_OS_TRACE << "==> Next [ Strongly ] Fireable Count :> "
+ << mStronglyFireableTransitionCount
+ << " Hit Count : " << mStronglyHitEC.size() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ setHitWeight(mStronglyHitEC, WEIGHT_SELECTED_ACHIEVABLE,
+ mHeuristicProperty.mHitStronglyRandomFlag,
+ mHeuristicProperty.mHitStronglyCount);
+
+ return( true );
+ }
+
+
+ // failedCase:
+ if( aWaitingStrategy.hasWaiting(WEIGHT_STRONGLY_ACHIEVABLE) )
+ {
+ mCoverageProcessor.setRequestRequeueWaiting();
+ }
+// else if( aWaitingStrategy.hasWaiting(WEIGHT_NON_PRIORITY) )
+// {
+// mCoverageProcessor.setRequest(
+// SymbexControllerRequestManager::AVM_REQUEUE_WAITING_REQUEST);
+// }
+ else
+ {
+ mCoverageProcessor.setRequestHeuristic();
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ if( (mCertainlyFireableTransitionCount == 0) &&
+ (mStronglyFireableTransitionCount == 0) &&
+ (mWeaklyFireableTransitionCount > 0) )
+ {
+ AVM_OS_COUT << "==> Next [ Weakly ] Fireable Count :> "
+ << mWeaklyFireableTransitionCount
+ << " Hit Count : " << mWeaklyHitEC.size() << std::endl;
+ AVM_OS_TRACE << "==> Next [ Weakly ] Fireable Count :> "
+ << mWeaklyFireableTransitionCount
+ << " Hit Count : " << mWeaklyHitEC.size() << std::endl;
+ }
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ return( false );
+}
+
+
+bool AvmCoverageTransitionView::highRequeueWaitingTable(
+ WaitingStrategy & aWaitingStrategy,
+ avm_uint8_t aWeightMin, avm_uint8_t aWeightMax)
+{
+ mCoverageStatistics.setFailedHeuristic();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_COUT << ">>>>>>> REQUEST REQUEUE <<<<<<<" << std::endl;
+ AVM_OS_TRACE << ">>>>>>> REQUEST REQUEUE <<<<<<<" << std::endl;
+
+ AVM_IF_DEBUG_LEVEL_FLAG( HIGH , TRANSITION )
+ report(AVM_OS_COUT);
+ report(AVM_OS_TRACE);
+ AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , TRANSITION )
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ do
+ {
+ mWaitingQueue.clear();
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , QUEUE )
+ AVM_OS_TRACE << "AvmCoverageTransitionView::highRequeueWaitingTable :>" << std::endl;
+ aWaitingStrategy.toStream(AVM_OS_COUT);
+ aWaitingStrategy.toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , QUEUE )
+
+// aWaitingStrategy.spliceQueueTable(mWaitingQueue, aWeightMax);
+
+ aWeightMin = aWaitingStrategy.splicePriorQueueTable(
+ mWaitingQueue, aWeightMin, aWeightMax);
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "REQUEUE QUEUE << "
+ << IHeuristicContextWeight::strHeuristicWeight(aWeightMin)
+ << " >> " << std::endl;
+ AVM_OS_TRACE << "REQUEUE QUEUE << "
+ << IHeuristicContextWeight::strHeuristicWeight(aWeightMin)
+ << " >> " << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ mCertainlyHitEC.clear();
+ mCertainlyFireableTransitionCount = 0;
+
+ mStronglyHitEC.clear();
+ mStronglyFireableTransitionCount = 0;
+
+ mWeaklyHitEC.clear();
+ mWeaklyFireableTransitionCount = 0;
+
+ ListOfExecutionContext::iterator ecQueueIt = mWaitingQueue.begin();
+ ListOfExecutionContext::iterator ecQueueItEnd = mWaitingQueue.end();
+ for( ; ecQueueIt != ecQueueItEnd ; ++ecQueueIt )
+ {
+ computeWeight( *ecQueueIt );
+
+ aWaitingStrategy.push( *ecQueueIt );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ if( (*ecQueueIt)->getWeight() <= WEIGHT_CERTAINLY_ACHIEVABLE )
+ {
+ AVM_OS_COUT << DEFAULT_WRAP_DATA << "REQUEUE candidate [ <= Certainly ] :> ";
+ (*ecQueueIt)->traceMinimum(AVM_OS_COUT); AVM_OS_COUT << END_WRAP;
+ fireableTransitionTrace(AVM_OS_COUT, (*ecQueueIt)->refExecutionData());
+
+ AVM_OS_TRACE << DEFAULT_WRAP_DATA << "REQUEUE candidate [ <= Certainly ] :> ";
+ (*ecQueueIt)->traceMinimum(AVM_OS_TRACE); AVM_OS_TRACE << END_WRAP;
+ fireableTransitionTrace(AVM_OS_TRACE, (*ecQueueIt)->refExecutionData());
+ }
+
+ else if( (*ecQueueIt)->getWeight() <= WEIGHT_STRONGLY_ACHIEVABLE )
+ {
+ AVM_OS_COUT << DEFAULT_WRAP_DATA << "REQUEUE candidate [ <= Strongly ] :> ";
+ (*ecQueueIt)->traceMinimum(AVM_OS_COUT); AVM_OS_COUT << END_WRAP;
+ fireableTransitionTrace(AVM_OS_COUT, (*ecQueueIt)->refExecutionData());
+
+ AVM_OS_TRACE << DEFAULT_WRAP_DATA << "REQUEUE candidate [ <= Strongly ] :> ";
+ (*ecQueueIt)->traceMinimum(AVM_OS_TRACE); AVM_OS_TRACE << END_WRAP;
+ fireableTransitionTrace(AVM_OS_TRACE, (*ecQueueIt)->refExecutionData());
+ }
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , QUEUE )
+ AVM_OS_TRACE << "AvmCoverageTransitionView::highRequeueWaitingTable :>" << std::endl;
+ aWaitingStrategy.toStream(AVM_OS_COUT);
+ aWaitingStrategy.toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , QUEUE )
+
+ // case of found certainly hit EC
+ if( mCertainlyFireableTransitionCount > 0 )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "==> REQUEUE candidate [ Certainly ] Fireable Count :> "
+ << mCertainlyFireableTransitionCount
+ << " Hit Count : " << mCertainlyHitEC.size() << std::endl;
+ AVM_OS_TRACE << "==> REQUEUE candidate [ Certainly ] Fireable Count :> "
+ << mCertainlyFireableTransitionCount
+ << " Hit Count : " << mCertainlyHitEC.size() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+
+ // case of found strongly hit EC
+ if( mStronglyFireableTransitionCount > 0 )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "==> REQUEUE candidate [ Strongly ] Fireable Count :> "
+ << mStronglyFireableTransitionCount
+ << " Hit Count : " << mStronglyHitEC.size() << std::endl;
+ AVM_OS_TRACE << "==> REQUEUE candidate [ Strongly ] Fireable Count :> "
+ << mStronglyFireableTransitionCount
+ << " Hit Count : " << mStronglyHitEC.size() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+
+ // case of found weakly hit EC
+ if( mWeaklyFireableTransitionCount > 0 )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "==> REQUEUE candidate [ Weakly ] Fireable Count :> "
+ << mWeaklyFireableTransitionCount
+ << " Hit Count : " << mWeaklyHitEC.size() << std::endl;
+ AVM_OS_TRACE << "==> REQUEUE candidate [ Weakly ] Fireable Count :> "
+ << mWeaklyFireableTransitionCount
+ << " Hit Count : " << mWeaklyHitEC.size() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+ }
+// while( ((++aWeightMin) <= WEIGHT_NON_PRIORITY) &&
+ while( ((++aWeightMin) <= WEIGHT_STRONGLY_ACHIEVABLE) &&
+// while( ((++aWeightMin) <= aWeightMax) &&
+ (mCertainlyFireableTransitionCount == 0) &&
+ (mStronglyFireableTransitionCount == 0) );
+
+ return( true );
+}
+
+
+/**
+ * Heuristic << Any Priority Context >> implementation
+ * REQUEUE_WAITING part
+ */
+bool AvmCoverageTransitionView::computePriorityContext(
+ ListOfExecutionContext & ecQueue,
+ WaitingStrategy & aWaitingStrategy)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ mCoverageStatistics.toStreamCoverageRate(AVM_OS_COUT ,
+ "Number of covered transitions = ", " / ", "\n");
+
+ mCoverageStatistics.toStreamCoverageRate(AVM_OS_TRACE,
+ "Number of covered transitions = ", " / ", "\n");
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ computeWeightOfResult(ecQueue);
+
+ // case of found certainly hit EC
+ if( mCertainlyFireableTransitionCount > 0 )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "==> Next [ Certainly ] Fireable Count :> "
+ << mCertainlyFireableTransitionCount
+ << " Hit Count : " << mCertainlyHitEC.size() << std::endl;
+ AVM_OS_TRACE << "==> Next [ Certainly ] Fireable Count :> "
+ << mCertainlyFireableTransitionCount
+ << " Hit Count : " << mCertainlyHitEC.size() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ setHitWeight(mCertainlyHitEC, WEIGHT_SELECTED_ACHIEVABLE,
+ mHeuristicProperty.mHitCertainlyRandomFlag,
+ mHeuristicProperty.mHitCertainlyCount);
+
+ mCoverageProcessor.setRequestHeuristic();
+
+ return( true );
+ }
+
+ // case of found strongly hit EC
+ if( mStronglyFireableTransitionCount > 0 )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "==> Next [ Strongly ] Fireable Count :> "
+ << mStronglyFireableTransitionCount
+ << " Hit Count : " << mStronglyHitEC.size() << std::endl;
+ AVM_OS_TRACE << "==> Next [ Strongly ] Fireable Count :> "
+ << mStronglyFireableTransitionCount
+ << " Hit Count : " << mStronglyHitEC.size() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ setHitWeight(mStronglyHitEC, WEIGHT_SELECTED_ACHIEVABLE,
+ mHeuristicProperty.mHitStronglyRandomFlag,
+ mHeuristicProperty.mHitStronglyCount);
+
+ mCoverageProcessor.setRequestHeuristic();
+
+ return( true );
+ }
+
+ // case of found weakly hit EC
+ else if( mWeaklyFireableTransitionCount > 0 )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "==> Next [ Weakly ] Fireable Count :> "
+ << mWeaklyFireableTransitionCount
+ << " Hit Count : " << mWeaklyHitEC.size() << std::endl;
+ AVM_OS_TRACE << "==> Next [ Weakly ] Fireable Count :> "
+ << mWeaklyFireableTransitionCount
+ << " Hit Count : " << mWeaklyHitEC.size() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ setHitWeight(mWeaklyHitEC, WEIGHT_SELECTED_ACHIEVABLE,
+ mHeuristicProperty.mHitWeaklyRandomFlag,
+ mHeuristicProperty.mHitWeaklyCount);
+
+ return( true );
+ }
+
+ else if( aWaitingStrategy.hasWaiting( WEIGHT_WEAKLY_ACHIEVABLE) )
+ {
+ mCoverageProcessor.setRequestRequeueWaiting();
+ }
+ else
+ {
+ mCoverageProcessor.setRequestHeuristic();
+ }
+
+ return( false );
+}
+
+
+bool AvmCoverageTransitionView::elseRequeueWaitingTable(
+ WaitingStrategy & aWaitingStrategy,
+ avm_uint8_t aWeightMin, avm_uint8_t aWeightMax)
+{
+ mCoverageStatistics.setFailedHeuristic();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_COUT << ">>>>>>> REQUEST REQUEUE <<<<<<<" << std::endl;
+ AVM_OS_TRACE << ">>>>>>> REQUEST REQUEUE <<<<<<<" << std::endl;
+
+ AVM_IF_DEBUG_LEVEL_FLAG( HIGH , TRANSITION )
+ report(AVM_OS_COUT);
+ report(AVM_OS_TRACE);
+ AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , TRANSITION )
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ do
+ {
+ mWaitingQueue.clear();
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , QUEUE )
+ AVM_OS_TRACE << "AvmCoverageTransitionView::elseRequeueWaitingTable :>" << std::endl;
+ aWaitingStrategy.toStream(AVM_OS_COUT);
+ aWaitingStrategy.toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , QUEUE )
+
+// aWaitingStrategy.spliceQueueTable(mWaitingQueue, aWeightMax);
+
+ aWeightMin = aWaitingStrategy.splicePriorQueueTable(
+ mWaitingQueue, aWeightMin, aWeightMax);
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "REQUEUE QUEUE << "
+ << IHeuristicContextWeight::strHeuristicWeight(aWeightMin)
+ << " >> " << std::endl;
+ AVM_OS_TRACE << "REQUEUE QUEUE << "
+ << IHeuristicContextWeight::strHeuristicWeight(aWeightMin)
+ << " >> " << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+
+ mCertainlyHitEC.clear();
+ mCertainlyFireableTransitionCount = 0;
+
+ mStronglyHitEC.clear();
+ mStronglyFireableTransitionCount = 0;
+
+ mWeaklyHitEC.clear();
+ mWeaklyFireableTransitionCount = 0;
+
+ ListOfExecutionContext::iterator ecQueueIt = mWaitingQueue.begin();
+ ListOfExecutionContext::iterator ecQueueItEnd = mWaitingQueue.end();
+ for( ; ecQueueIt != ecQueueItEnd ; ++ecQueueIt )
+ {
+ computeWeight( *ecQueueIt );
+
+ aWaitingStrategy.push( *ecQueueIt );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ if( (*ecQueueIt)->getWeight() <= WEIGHT_CERTAINLY_ACHIEVABLE )
+ {
+ AVM_OS_COUT << "REQUEUE candidate [ <= Certainly ] :> ";
+ (*ecQueueIt)->traceMinimum(AVM_OS_COUT);
+ fireableTransitionTrace(AVM_OS_COUT, (*ecQueueIt)->refExecutionData());
+
+ AVM_OS_TRACE << "REQUEUE candidate [ <= Certainly ] :> ";
+ (*ecQueueIt)->traceMinimum(AVM_OS_TRACE);
+ fireableTransitionTrace(AVM_OS_TRACE, (*ecQueueIt)->refExecutionData());
+ }
+
+ else if( (*ecQueueIt)->getWeight() <= WEIGHT_STRONGLY_ACHIEVABLE )
+ {
+ AVM_OS_COUT << "REQUEUE candidate [ <= Strongly ] :> ";
+ (*ecQueueIt)->traceMinimum(AVM_OS_COUT);
+ fireableTransitionTrace(AVM_OS_COUT, (*ecQueueIt)->refExecutionData());
+
+ AVM_OS_TRACE << "REQUEUE candidate [ <= Strongly ] :> ";
+ (*ecQueueIt)->traceMinimum(AVM_OS_TRACE);
+ fireableTransitionTrace(AVM_OS_TRACE, (*ecQueueIt)->refExecutionData());
+ }
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , QUEUE )
+ AVM_OS_TRACE << "AvmCoverageTransitionView::elseRequeueWaitingTable :>" << std::endl;
+ aWaitingStrategy.toStream(AVM_OS_COUT);
+ aWaitingStrategy.toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , QUEUE )
+
+ // case of found certainly hit EC
+ if( mCertainlyFireableTransitionCount > 0 )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "==> REQUEUE candidate [ Certainly ] Fireable Count :> "
+ << mCertainlyFireableTransitionCount
+ << " Hit Count : " << mCertainlyHitEC.size() << std::endl;
+ AVM_OS_TRACE << "==> REQUEUE candidate [ Certainly ] Fireable Count :> "
+ << mCertainlyFireableTransitionCount
+ << " Hit Count : " << mCertainlyHitEC.size() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+
+ // case of found strongly hit EC
+ if( mStronglyFireableTransitionCount > 0 )
+ {
+ AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "==> REQUEUE candidate [ Strongly ] Fireable Count :> "
+ << mStronglyFireableTransitionCount
+ << " Hit Count : " << mStronglyHitEC.size() << std::endl;
+ AVM_OS_TRACE << "==> REQUEUE candidate [ Strongly ] Fireable Count :> "
+ << mStronglyFireableTransitionCount
+ << " Hit Count : " << mStronglyHitEC.size() << std::endl;
+ AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+
+ // case of found weakly hit EC
+ if( mWeaklyFireableTransitionCount > 0 )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "==> REQUEUE candidate [ Weakly ] Fireable Count :> "
+ << mWeaklyFireableTransitionCount
+ << " Hit Count : " << mWeaklyHitEC.size() << std::endl;
+ AVM_OS_TRACE << "==> REQUEUE candidate [ Weakly ] Fireable Count :> "
+ << mWeaklyFireableTransitionCount
+ << " Hit Count : " << mWeaklyHitEC.size() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+ }
+ while( ((++aWeightMin) <= WEIGHT_NON_PRIORITY) &&
+// while( ((++aWeightMin) <= aWeightMax) &&
+ (mCertainlyFireableTransitionCount == 0) &&
+ (mStronglyFireableTransitionCount == 0) );
+
+ if( (mHeuristicProperty.mCoverageHeightReachedCount >
+ mHeuristicProperty.mCoverageHeightReachedLimit) &&
+ (mCertainlyFireableTransitionCount == 0) &&
+ (mStronglyFireableTransitionCount == 0) )
+ {
+ mHeuristicProperty.mCoverageHeightReachedCount = 0;
+ mHeuristicProperty.mCoverageHeightReachedFlag = false;
+
+ mHeuristicProperty.mCoverageHeight +=
+ mHeuristicProperty.mCoverageHeightPeriod;
+
+ mHeuristicProperty.mCoverageHeightReachedCount +=
+ mHeuristicProperty.mCoverageHeightReachedCount;
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "REQUEUE [ chp: " << mHeuristicProperty.mCoverageHeightPeriod
+ << " ] ==> New Coverage Height :> "
+ << mHeuristicProperty.mCoverageHeight << std::endl;
+
+ AVM_OS_TRACE << "REQUEUE [ chp: " << mHeuristicProperty.mCoverageHeightPeriod
+ << " ] ==> New Coverage Height :> "
+ << mHeuristicProperty.mCoverageHeight << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+
+ return( true );
+}
+
+
+/**
+ * Compute Hit Weigth for Execution Context
+ */
+void AvmCoverageTransitionView::setHitWeight(VectorOfExecutionContext & hitEC,
+ avm_uint8_t hitWeight, bool randomFlag, avm_size_t hitCount)
+{
+ if( randomFlag && (hitCount < hitEC.size()) )
+ {
+ maxRandomOffset = hitEC.size() - 1;
+ randomOffsetBitset.reset();
+ randomOffsetBitset.resize(maxRandomOffset + 1, false);
+
+ for( ; 0 < hitCount ; --hitCount )
+ {
+ do
+ {
+ offset = RANDOM::gen_uint(0, maxRandomOffset);
+ }
+ while( randomOffsetBitset[offset] );
+
+ randomOffsetBitset[offset] = true;
+
+ hitEC[ offset ]->setWeight( hitWeight );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << std::endl << DEFAULT_WRAP_DATA << "HIT :> ";
+ hitEC[ offset ]->traceMinimum(AVM_OS_COUT); AVM_OS_COUT << END_WRAP;
+ fireableTransitionTrace(AVM_OS_COUT , hitEC[ offset ]->refExecutionData());
+
+ AVM_OS_TRACE << std::endl << DEFAULT_WRAP_DATA << "HIT :> ";
+ hitEC[ offset ]->traceMinimum(AVM_OS_TRACE); AVM_OS_TRACE << END_WRAP;
+ fireableTransitionTrace(AVM_OS_TRACE, hitEC[ offset ]->refExecutionData());
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << std::endl;
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+
+ else
+ {
+ if( hitCount > hitEC.size() )
+ {
+ hitCount = hitEC.size();
+ }
+ for( offset = 0 ; offset < hitCount ; ++offset )
+ {
+ hitEC[ offset ]->setWeight( hitWeight );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << std::endl << DEFAULT_WRAP_DATA << "HIT :> ";
+ hitEC[ offset ]->traceMinimum(AVM_OS_COUT); AVM_OS_COUT << END_WRAP;
+ fireableTransitionTrace(AVM_OS_COUT , hitEC[ offset ]->refExecutionData());
+
+ AVM_OS_TRACE << std::endl << DEFAULT_WRAP_DATA << "HIT :> ";
+ hitEC[ offset ]->traceMinimum(AVM_OS_TRACE); AVM_OS_TRACE << END_WRAP;
+ fireableTransitionTrace(AVM_OS_TRACE, hitEC[ offset ]->refExecutionData());
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << std::endl;
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ }
+}
+
+/*
+ * weight: 1 if some transition of leaf EC will be fired
+ * weight: 2 if some transition of leaf EC could be fired
+ * weight: 3 else
+ */
+void AvmCoverageTransitionView::computeWeight(ExecutionContext * anEC)
+{
+ switch( mHeuristicProperty.mHeuristicClass )
+ {
+ case IHeuristicClass::HEURISTIC_BASIC_CLASS:
+ {
+// computeWeightNaive( anEC );
+ computeWeightSmart( anEC );
+ break;
+ }
+ case IHeuristicClass::HEURISTIC_NAIVE_CLASS:
+ {
+ computeWeightNaive( anEC );
+ break;
+ }
+ case IHeuristicClass::HEURISTIC_SMART_CLASS:
+ {
+ computeWeightSmart( anEC );
+ break;
+ }
+
+ case IHeuristicClass::HEURISTIC_AGRESSIVE_CLASS:
+ {
+ computeWeightAgressive( anEC );
+ break;
+ }
+
+ case IHeuristicClass::HEURISTIC_NOTHING_ELSE_CLASS:
+ default:
+ {
+ computeWeightSmart( anEC );
+ break;
+ }
+ }
+}
+
+
+void AvmCoverageTransitionView::computeWeightNaive(ExecutionContext * anEC)
+{
+ computePriorityWeight(anEC);
+
+ if( checkCertainlyPriorityWeight(anEC) )
+ {
+ return;
+ }
+
+ else if( checkNonPriorityWeight(anEC) )
+ {
+ return;
+ }
+
+ else if( checkStronglyPriorityWeight(anEC) )
+ {
+ return;
+ }
+ else if( checkWeaklyPriorityWeight(anEC) )
+ {
+ return;
+ }
+ else
+ {
+ anEC->setWeight( WEIGHT_UNKNOWN_ACHIEVABLE );
+ }
+}
+
+
+void AvmCoverageTransitionView::computeWeightSmart(ExecutionContext * anEC)
+{
+ computePriorityWeight(anEC);
+
+ if( checkCertainlyPriorityWeight(anEC) )
+ {
+ return;
+ }
+
+ if( checkStronglyPriorityWeight(anEC) )
+ {
+ return;
+ }
+
+ else if( checkNonPriorityWeight(anEC) )
+ {
+ return;
+ }
+
+ else if( checkWeaklyPriorityWeight(anEC) )
+ {
+ return;
+ }
+ else
+ {
+ anEC->setWeight( WEIGHT_UNKNOWN_ACHIEVABLE );
+ }
+}
+
+
+void AvmCoverageTransitionView::computeWeightAgressive(ExecutionContext * anEC)
+{
+ computePriorityWeight(anEC);
+
+ if( checkCertainlyPriorityWeight(anEC) )
+ {
+ return;
+ }
+
+ if( checkStronglyPriorityWeight(anEC) )
+ {
+ return;
+ }
+ else if( checkWeaklyPriorityWeight(anEC) )
+ {
+ return;
+ }
+ else
+ {
+ anEC->setWeight( WEIGHT_UNKNOWN_ACHIEVABLE );
+ }
+}
+
+
+bool AvmCoverageTransitionView::checkNonPriorityWeight(ExecutionContext * anEC)
+{
+ if( anEC->getHeight() > mHeuristicProperty.mCoverageHeight )
+ {
+ mHeuristicProperty.mCoverageHeightReachedFlag = true;
+
+ anEC->setWeight( WEIGHT_NON_PRIORITY );
+
+ return( true );
+ }
+ else if( anEC->getWeight() != WEIGHT_NON_PRIORITY )
+ {
+ if( isTrivialLoop(anEC) )
+ {
+ anEC->setWeight( WEIGHT_NON_ACHIEVABLE );
+
+ return( true );
+ }
+
+// if( isSyntaxicLoop(anEC) )
+// {
+// anEC->setWeight( WEIGHT_NON_ACHIEVABLE );
+//
+// return( true );
+// }
+
+ else if( isControlLoop(anEC) )
+ {
+ anEC->setWeight( WEIGHT_NON_PRIORITY );
+
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+
+void AvmCoverageTransitionView::computePriorityWeight(ExecutionContext * anEC)
+{
+ tmpCertainlyFireableTransitionCount = 0;
+ tmpStronglyFireableTransitionCount = 0;
+ tmpWeaklyFireableTransitionCount = 0;
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << ":> from "; anEC->traceMinimum(AVM_OS_COUT);
+ AVM_OS_TRACE << ":> from "; anEC->traceMinimum(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+ // compute :>
+// fireableTransitionCount( anEC->getAPExecutionData() );
+ fireableTransitionCount( anEC->refExecutionData() ,
+ anEC->refExecutionData().getSystemRuntime() );
+}
+
+
+
+bool AvmCoverageTransitionView::checkCertainlyPriorityWeight(
+ ExecutionContext * anEC)
+{
+ if( tmpCertainlyFireableTransitionCount > 0 )
+ {
+ anEC->setWeight( WEIGHT_SELECTED_ACHIEVABLE );
+
+ if( mCertainlyFireableTransitionCount <
+ tmpCertainlyFireableTransitionCount )
+ {
+ mCertainlyFireableTransitionCount =
+ tmpCertainlyFireableTransitionCount;
+
+ mCertainlyHitEC.clear();
+ mCertainlyHitEC.append( anEC );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "==> HIT EC [ Certain : "
+ << mCertainlyFireableTransitionCount << " ]:> ";
+ anEC->traceMinimum(AVM_OS_COUT);
+ AVM_OS_COUT << std::flush;
+
+ AVM_OS_TRACE << "==> HIT EC [ Certain : "
+ << mCertainlyFireableTransitionCount << " ]:> ";
+ anEC->traceMinimum(AVM_OS_TRACE);
+ AVM_OS_TRACE << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+ return( true );
+ }
+
+ else if( mCertainlyFireableTransitionCount ==
+ tmpCertainlyFireableTransitionCount )
+ {
+ mCertainlyHitEC.append( anEC );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "==> HIT EC [ Certain : "
+ << mCertainlyFireableTransitionCount << " ]:> ";
+ anEC->traceMinimum(AVM_OS_COUT);
+ AVM_OS_COUT << std::flush;
+
+ AVM_OS_TRACE << "==> HIT EC [ Certain : "
+ << mCertainlyFireableTransitionCount << " ]:> ";
+ anEC->traceMinimum(AVM_OS_TRACE);
+ AVM_OS_TRACE << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ }
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+bool AvmCoverageTransitionView::checkStronglyPriorityWeight(
+ ExecutionContext * anEC)
+{
+ if( tmpStronglyFireableTransitionCount > 0 )
+ {
+ anEC->setWeight( WEIGHT_STRONGLY_ACHIEVABLE );
+
+ if( mStronglyFireableTransitionCount <
+ tmpStronglyFireableTransitionCount )
+ {
+ mStronglyFireableTransitionCount =
+ tmpStronglyFireableTransitionCount;
+
+ mStronglyHitEC.clear();
+ mStronglyHitEC.append( anEC );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "==> HIT EC [ Strong : "
+ << mStronglyFireableTransitionCount << " ]:> ";
+ anEC->traceMinimum(AVM_OS_COUT);
+ AVM_OS_COUT << std::flush;
+
+ AVM_OS_TRACE << "==> HIT EC [ Strong : "
+ << mStronglyFireableTransitionCount << " ]:> ";
+ anEC->traceMinimum(AVM_OS_TRACE);
+ AVM_OS_TRACE << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+ return( true );
+ }
+
+ else if( mStronglyFireableTransitionCount ==
+ tmpStronglyFireableTransitionCount )
+ {
+ mStronglyHitEC.append( anEC );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "==> HIT EC [ Strong : "
+ << mStronglyFireableTransitionCount << " ]:> ";
+ anEC->traceMinimum(AVM_OS_COUT);
+ AVM_OS_COUT << std::flush;
+
+ AVM_OS_TRACE << "==> HIT EC [ Strong : "
+ << mStronglyFireableTransitionCount << " ]:> ";
+ anEC->traceMinimum(AVM_OS_TRACE);
+ AVM_OS_TRACE << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ }
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+bool AvmCoverageTransitionView::checkWeaklyPriorityWeight(
+ ExecutionContext * anEC)
+{
+ if( tmpWeaklyFireableTransitionCount > 0 )
+ {
+ anEC->setWeight( WEIGHT_WEAKLY_ACHIEVABLE );
+
+ if( mWeaklyFireableTransitionCount <
+ tmpWeaklyFireableTransitionCount )
+ {
+ mWeaklyFireableTransitionCount =
+ tmpWeaklyFireableTransitionCount;
+
+ mWeaklyHitEC.clear();
+ mWeaklyHitEC.append( anEC );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "==> HIT EC [ Weak : "
+ << mWeaklyFireableTransitionCount << " ]:> ";
+ anEC->traceMinimum(AVM_OS_COUT);
+ AVM_OS_COUT << std::flush;
+
+ AVM_OS_TRACE << "==> HIT EC [ Weak : "
+ << mWeaklyFireableTransitionCount << " ]:> ";
+ anEC->traceMinimum(AVM_OS_TRACE);
+ AVM_OS_TRACE << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+ return( true );
+ }
+
+ else if( mWeaklyFireableTransitionCount ==
+ tmpWeaklyFireableTransitionCount )
+ {
+ mWeaklyHitEC.append( anEC );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "==> HIT EC [ Weak : "
+ << mWeaklyFireableTransitionCount << " ]:> ";
+ anEC->traceMinimum(AVM_OS_COUT);
+ AVM_OS_COUT << std::flush;
+
+ AVM_OS_TRACE << "==> HIT EC [ Weak : "
+ << mWeaklyFireableTransitionCount << " ]:> ";
+ anEC->traceMinimum(AVM_OS_TRACE);
+ AVM_OS_TRACE << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ }
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+void AvmCoverageTransitionView::computeWeightOfResult(
+ const ListOfExecutionContext & ecQueue)
+{
+ mCertainlyHitEC.clear();
+ mCertainlyFireableTransitionCount = 0;
+
+ mStronglyHitEC.clear();
+ mStronglyFireableTransitionCount = 0;
+
+ mWeaklyHitEC.clear();
+ mWeaklyFireableTransitionCount = 0;
+
+ ListOfExecutionContext::const_iterator ecQueueIt = ecQueue.begin();
+ ListOfExecutionContext::const_iterator ecQueueItEnd = ecQueue.end();
+ for( ; ecQueueIt != ecQueueItEnd ; ++ecQueueIt )
+ {
+ endEC = (*ecQueueIt)->end();
+ for( itEC = (*ecQueueIt)->begin() ; (itEC != endEC) ; ++itEC )
+ {
+ computeWeight( *itEC );
+
+//AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+// if( (*itEC)->getWeight() == WEIGHT_CERTAINLY_ACHIEVABLE )
+// {
+// fireableTransitionTrace(AVM_OS_COUT , (*itEC)->getAPExecutionData());
+// fireableTransitionTrace(AVM_OS_TRACE, (*itEC)->getAPExecutionData());
+// }
+//AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+ }
+
+ // Count one time per step CoverageHeightReached
+ if( mHeuristicProperty.mCoverageHeightReachedFlag )
+ {
+ ++mHeuristicProperty.mCoverageHeightReachedCount;
+
+ mHeuristicProperty.mCoverageHeightReachedFlag = false;
+ }
+}
+
+
+avm_uint8_t AvmCoverageTransitionView::checkFireability(
+ const ExecutionData & anED, const RuntimeID & aRID,
+ AvmTransition * aTransition)
+{
+ if( aTransition->hasCode() && aTransition->getCode()->nonempty() &&
+ aTransition->getCode()->first().is< AvmCode >() )
+ {
+ const AvmCode * firstStatement =
+ aTransition->getCode()->first().to_ptr< AvmCode >();
+
+ switch( firstStatement->getOptimizedOpCode() )
+ {
+ case AVM_OPCODE_INPUT_ENV:
+ case AVM_OPCODE_OUTPUT_ENV:
+ {
+ if( aTransition->isStatementBasicFamily() )
+ {
+ return( WEIGHT_CERTAINLY_ACHIEVABLE );
+ }
+ else if( aTransition->hasConditionalComStatementFamily() )
+ {
+ return( WEIGHT_WEAKLY_ACHIEVABLE );
+ }
+ else
+ {
+ return( WEIGHT_STRONGLY_ACHIEVABLE );
+ }
+ }
+ default:
+ {
+ if( firstStatement->isOpCode( AVM_OPCODE_INPUT ) &&
+ firstStatement->first().is< InstanceOfPort >() )
+ {
+ if( AvmCommunicationFactory::computePresence(anED, aRID,
+ firstStatement->first().to_ptr< InstanceOfPort >()) )
+ {
+ if( aTransition->hasStatementGuardFamily() )
+ {
+ return( WEIGHT_STRONGLY_ACHIEVABLE );
+ }
+ else
+ {
+ return( WEIGHT_CERTAINLY_ACHIEVABLE );
+ }
+ }
+ else
+ {
+ return( WEIGHT_WEAKLY_ACHIEVABLE );
+ }
+ }
+
+ else if( aTransition->isStatementBasicFamily() )
+ {
+ return( WEIGHT_CERTAINLY_ACHIEVABLE );
+ }
+ else if( aTransition->hasConditionalComStatementFamily() )
+ {
+ return( WEIGHT_STRONGLY_ACHIEVABLE );
+ }
+ }
+ }
+ }
+
+ return( WEIGHT_SELECTED_ACHIEVABLE );
+}
+
+
+void AvmCoverageTransitionView::computeFireability(const ExecutionData & anED,
+ const RuntimeID & aRID, AvmTransition * aTransition)
+{
+ switch( checkFireability(anED, aRID, aTransition) )
+ {
+ case WEIGHT_CERTAINLY_ACHIEVABLE:
+ {
+ tmpCertainlyFireableTransitionCount += 1;
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "==> Fireable [ Certainly ] :> "
+ << aTransition->strTransitionHeader() << std::endl;
+ AVM_OS_TRACE << "==> Fireable [ Certainly ] :> "
+ << aTransition->strTransitionHeader() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+ break;
+ }
+
+ case WEIGHT_STRONGLY_ACHIEVABLE:
+ {
+ tmpStronglyFireableTransitionCount += 1;
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "==> Fireable [ Strongly ] :> "
+ << aTransition->strTransitionHeader() << std::endl;
+ AVM_OS_TRACE << "==> Fireable [ Strongly ] :> "
+ << aTransition->strTransitionHeader() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+ break;
+ }
+
+ case WEIGHT_WEAKLY_ACHIEVABLE:
+ default:
+ {
+ tmpWeaklyFireableTransitionCount += 1;
+ }
+ }
+}
+
+
+void AvmCoverageTransitionView::traceFireability(
+ OutStream & os, const ExecutionData & anED,
+ const RuntimeID & aRID, AvmTransition * aTransition)
+{
+ switch( checkFireability(anED, aRID, aTransition) )
+ {
+ case WEIGHT_CERTAINLY_ACHIEVABLE:
+ {
+ os << "==> [ Certainly ] Fireable :> "
+ << aTransition->strTransitionHeader()
+ << std::endl;
+
+ break;
+ }
+
+ case WEIGHT_STRONGLY_ACHIEVABLE:
+ {
+ os << "==> [ Strongly ] Fireable :> "
+ << aTransition->strTransitionHeader()
+ << std::endl;
+
+ break;
+ }
+
+ case WEIGHT_WEAKLY_ACHIEVABLE:
+ default:
+ {
+ os << "==> [ Weakly ] Fireable :> "
+ << aTransition->strTransitionHeader()
+ << std::endl;
+ }
+ }
+}
+
+
+bool AvmCoverageTransitionView::isControlLoop(ExecutionContext * anEC)
+{
+ for( tmpEC = anEC->getPrevious() ; tmpEC != NULL ; tmpEC = tmpEC->getPrevious() )
+ {
+ if( anEC->refExecutionData().getRuntimeFormStateTable()->equalsState(
+ tmpEC->refExecutionData().getRuntimeFormStateTable() ) )
+ {
+ return( true );
+ }
+ }
+ return( false );
+}
+
+
+bool AvmCoverageTransitionView::isSyntaxicLoop(ExecutionContext * anEC)
+{
+ tmpEC = anEC->getPrevious();
+ for( ; tmpEC != NULL ; tmpEC = tmpEC->getPrevious() )
+ {
+ if( anEC->refExecutionData().getRuntimeFormStateTable()->equalsState(
+ tmpEC->refExecutionData().getRuntimeFormStateTable() ) )
+ {
+ return( true );
+ }
+ }
+ return( false );
+}
+
+
+bool AvmCoverageTransitionView::isTrivialLoop(ExecutionContext * anEC)
+{
+ tmpEC = anEC->getPrevious();
+ for( ; tmpEC != NULL ; tmpEC = tmpEC->getPrevious() )
+ {
+ if( anEC->refExecutionData().isTEQ( tmpEC->getExecutionData() ) )
+ {
+ return( true );
+ }
+ }
+ return( false );
+}
+
+
+void AvmCoverageTransitionView::fireableTransitionCount(
+ const ExecutionData & anED, const RuntimeID & aRID)
+{
+ tmpEF = aRID.getExecutable();
+
+ tmpRuntimeTransitionBitset = getCoverageTableBitset( aRID );
+
+ if( tmpRuntimeTransitionBitset == NULL )
+ {
+ //!! NOTHING
+ }
+ //tmpEF->hasTransition()
+ else if( tmpRuntimeTransitionBitset->anyFalse() )
+ {
+ AvmTransition * aTransition;
+
+ avm_size_t endOffset = tmpEF->getTransition().size();
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ aTransition = tmpEF->getTransition().rawAt(offset);
+
+ if( not tmpRuntimeTransitionBitset->test(aTransition->getOffset()) )
+ {
+ computeFireability(anED, aRID, aTransition);
+ }
+ }
+ }
+
+// else if( tmpRuntimeTransitionBitset->allTrue() )
+// {
+// anED.setRuntimeFormState(itRID, PROCESS_SUSPENDED_STATE);
+// }
+}
+
+
+void AvmCoverageTransitionView::fireableTransitionCount(
+ const ExecutionData & anED)
+{
+ avm_size_t offset;
+ avm_size_t endOffset;
+ AvmTransition * aTransition;
+
+ itRF = anED.getTableOfRuntime().begin();
+ endRF = anED.getTableOfRuntime().end();
+ for( ; (itRF != endRF) ; ++itRF )
+ {
+ itRID = (*itRF)->getRID();
+
+ if( not anED.isIdleOrRunning( itRID ) )
+ {
+ continue;
+ }
+
+ tmpEF = itRID.getExecutable();
+
+ tmpRuntimeTransitionBitset = getCoverageTableBitset( itRID );
+
+ if( tmpRuntimeTransitionBitset == NULL )
+ {
+ //!! NOTHING
+ }
+ //tmpEF->hasTransition()
+ else if( anED.isIdleOrRunning( itRID ) &&
+ tmpRuntimeTransitionBitset->anyFalse() )
+ {
+ endOffset = tmpEF->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ aTransition = tmpEF->getTransition().rawAt(offset);
+
+ if( not tmpRuntimeTransitionBitset->
+ test(aTransition->getOffset()) )
+ {
+ computeFireability(anED, itRID, aTransition);
+ }
+ }
+ }
+
+// else if( tmpRuntimeTransitionBitset->allTrue() )
+// {
+// anED.setRuntimeFormState(itRID, PROCESS_SUSPENDED_STATE);
+// }
+
+ }
+}
+
+
+void AvmCoverageTransitionView::fireableTransitionCount(
+ const ExecutionData & anED, const RuntimeForm & aRF)
+{
+ if( not anED.isIdleOrRunning( aRF.getRID() ) )
+ {
+ return;
+ }
+
+ tmpEF = aRF.getRID().getExecutable();
+
+ if( tmpEF->hasTransition() )
+ {
+ tmpRuntimeTransitionBitset = getCoverageTableBitset( aRF.getRID() );
+
+ if( tmpRuntimeTransitionBitset->anyFalse() )
+ {
+ AvmTransition * atransition = NULL;
+
+ avm_size_t endOffset = tmpEF->getTransition().size();
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ atransition = tmpEF->getTransition().rawAt(offset);
+
+ if( not tmpRuntimeTransitionBitset->test(atransition->getOffset()) )
+ {
+ computeFireability(anED, aRF.getRID(), atransition);
+ }
+ }
+ }
+ }
+
+ if( aRF.hasChild() )
+ {
+ TableOfRuntimeID::const_iterator itRID = aRF.beginChild();
+ TableOfRuntimeID::const_iterator itRIDEnd = aRF.endChild();
+
+ for( ; itRID != itRIDEnd ; ++itRID )
+ {
+ if( anED.isIdleOrRunning( *itRID ) )
+ {
+ fireableTransitionCount(anED, anED.getRuntime(*itRID));
+ }
+ }
+ }
+}
+
+
+
+void AvmCoverageTransitionView::fireableTransitionTrace(
+ OutStream & os, const ExecutionData & anED)
+{
+ avm_size_t offset;
+ avm_size_t endOffset;
+ AvmTransition * aTransition = NULL;
+
+ itRF = anED.getTableOfRuntime().begin();
+ endRF = anED.getTableOfRuntime().end();
+ for( ; (itRF != endRF) ; ++itRF )
+ {
+ itRID = (*itRF)->getRID();
+
+ tmpEF = itRID.getExecutable();
+
+ tmpRuntimeTransitionBitset = getCoverageTableBitset( itRID );
+
+ if( tmpRuntimeTransitionBitset == NULL )
+ {
+ //!! NOTHINGclass APExecutionData;
+
+ }
+ //tmpEF->hasTransition()
+ else if( anED.isIdleOrRunning( itRID ) )
+ {
+ if( tmpRuntimeTransitionBitset->anyFalse() )
+ {
+ endOffset = tmpEF->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ aTransition = tmpEF->getTransition().rawAt(offset);
+
+ if( not tmpRuntimeTransitionBitset->
+ test(aTransition->getOffset()) )
+ {
+ traceFireability(os,
+ anED, itRID, aTransition);
+ }
+ }
+ }
+// else if( tmpRuntimeTransitionBitset->allTrue() )
+// {
+// os << "==> [ suspended ! ] machine :> "
+// << (*itRF)->getFullyQualifiedNameID() << std::endl;
+// }
+ }
+ }
+}
+
+
+void AvmCoverageTransitionView::fireableTransitionTrace(OutStream & os,
+ const ExecutionData & anED, const RuntimeForm & aRF)
+{
+ tmpEF = aRF.getRID().getExecutable();
+
+ if( tmpEF->hasTransition() )
+ {
+ tmpRuntimeTransitionBitset = getCoverageTableBitset( aRF.getRID() );
+
+ if( tmpRuntimeTransitionBitset->anyFalse() )
+ {
+ AvmTransition * aTransition = NULL;
+
+ avm_size_t endOffset = tmpEF->getTransition().size();
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ aTransition = tmpEF->getTransition().rawAt(offset);
+
+ if( not tmpRuntimeTransitionBitset->test(
+ aTransition->getOffset()) )
+ {
+ traceFireability(os, anED, aRF.getRID(), aTransition);
+ }
+ }
+ }
+ }
+
+ if( aRF.hasChild() )
+ {
+ TableOfRuntimeID::const_iterator itRID = aRF.beginChild();
+ TableOfRuntimeID::const_iterator itRIDEnd = aRF.endChild();
+
+ for( ; itRID != itRIDEnd ; ++itRID )
+ {
+ if( anED.isIdleOrRunning( *itRID ) )
+ {
+ fireableTransitionTrace(os, anED, anED.getRuntime(*itRID));
+ }
+ }
+ }
+}
+
+
+/**
+ * updateTransitionCoverageTable using new fresh Execution Context
+ */
+void AvmCoverageTransitionView::updateTransitionCoverageTable(
+ ExecutionContext * anEC, const BF & aFiredCode)
+{
+ if( aFiredCode.invalid() )
+ {
+ return;
+ }
+
+ // Vérification de la création de nouvelle instance dynamique
+ // par la commande ${ NEW , EXEC }
+ if( (mScope != Specifier::DESIGN_MODEL_KIND) &&
+ (anEC->refExecutionData().getTableOfRuntime().size() >
+ mTransitionCoverageTable->size()) )
+ {
+ //TODO
+ return;
+ }
+
+ switch( aFiredCode.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ const BFCode & anAvmCode = aFiredCode.bfCode();
+
+ AvmCode::iterator itEnd = anAvmCode->end();
+ for( AvmCode::iterator it = anAvmCode->begin() ; it != itEnd ; ++it )
+ {
+ updateTransitionCoverageTable(anEC, (*it));
+ }
+
+ break;
+ }
+
+ case FORM_EXECUTION_CONFIGURATION_KIND:
+ {
+ ExecutionConfiguration * anExecConf =
+ aFiredCode.to_ptr< ExecutionConfiguration >();
+
+ if( anExecConf->isTransition() )
+ {
+ updateTransitionCoverageTable(anEC,
+ anExecConf->getRuntimeID(), anExecConf->getTransition());
+
+// AvmTransition * firedTransition = anExecConf->getTransition();
+//
+// if( not mTransitionCoverageTable->
+// at( anExecConf->getRuntimeID().getOffset() )->
+// test( firedTransition->getOffset() ) )
+// {
+// mCoverageStatistics.addCoveredElement();
+//
+// mTransitionCoverageTable->at(
+// anExecConf->getRuntimeID().getOffset() )->
+// set(firedTransition->getOffset(), true);
+//
+// if( mExecutableCoverageTable != NULL )
+// {
+// mExecutableCoverageTable->at( firedTransition->
+// getExecutableContainer()->getOffset() )->
+// set(firedTransition->getOffset(), true);
+// }
+//
+// anEC->addInfo(mCoverageProcessor,
+// ExpressionConstructor::newString(
+// firedTransition->getNameID()) );
+//
+// mListOfPositiveEC.append( anEC );
+ }
+
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+}
+
+
+void AvmCoverageTransitionView::updateTransitionCoverageTable(
+ ExecutionContext * anEC, const RuntimeID & aRID,
+ AvmTransition * firedTransition)
+{
+ bool isNewlyCovered = false;
+
+ switch( mScope )
+ {
+ case Specifier::DESIGN_MODEL_KIND:
+ {
+ if( not mExecutableCoverageTable->at( firedTransition->
+ getExecutableContainer()->getOffset() )->
+ test(firedTransition->getOffset()) )
+ {
+ isNewlyCovered = true;
+
+ mExecutableCoverageTable->at( firedTransition->
+ getExecutableContainer()->getOffset() )->
+ set(firedTransition->getOffset(), true);
+ }
+
+ break;
+ }
+
+ case Specifier::DESIGN_INSTANCE_KIND:
+ {
+ if( not mTransitionCoverageTable->at( aRID.getOffset() )->
+ test( firedTransition->getOffset() ) )
+ {
+ isNewlyCovered = true;
+
+ mTransitionCoverageTable->at( aRID.getOffset() )->
+ set(firedTransition->getOffset(), true);
+ }
+
+ break;
+ }
+
+ default:
+ {
+ if( not mTransitionCoverageTable->at( aRID.getOffset() )->
+ test( firedTransition->getOffset() ) )
+ {
+ isNewlyCovered = true;
+
+ mTransitionCoverageTable->at( aRID.getOffset() )->
+ set(firedTransition->getOffset(), true);
+
+ if( mExecutableCoverageTable != NULL )
+ {
+ mExecutableCoverageTable->at( firedTransition->
+ getExecutableContainer()->getOffset() )->
+ set(firedTransition->getOffset(), true);
+ }
+ }
+
+ break;
+ }
+ }
+
+
+ if( isNewlyCovered )
+ {
+ mCoverageStatistics.addCoveredElement();
+
+ anEC->getwFlags().addCoverageElementTrace();
+
+ anEC->addInfo(mCoverageProcessor,
+ ExpressionConstructor::newString( firedTransition->getNameID() ));
+
+//$ mListOfPositiveEC.append( anEC );
+ }
+}
+
+
+bool AvmCoverageTransitionView::testTransitionCoverage(
+ AvmTransition * firedTransition)
+{
+ switch( mScope )
+ {
+ case Specifier::DESIGN_MODEL_KIND:
+ {
+ return( mExecutableCoverageTable->at( firedTransition->
+ getExecutableContainer()->getOffset() )->
+ test(firedTransition->getOffset()) );
+ }
+
+ case Specifier::DESIGN_INSTANCE_KIND:
+ {
+// return( mTransitionCoverageTable->at( aRID.getOffset() )->
+// test( firedTransition->getOffset() ) );
+
+ return( true );
+ }
+
+ default:
+ {
+ return( (mExecutableCoverageTable != NULL) ||
+ mExecutableCoverageTable->at( firedTransition->
+ getExecutableContainer()->getOffset() )->
+ test(firedTransition->getOffset()) );
+ }
+ }
+}
+
+
+/**
+ * Update uncovered transition table
+ */
+void AvmCoverageTransitionView::updateUncoveredTransition(
+ VectorOfAvmTransition & aTableofUncoveredTransition)
+{
+ avm_size_t endTransition = aTableofUncoveredTransition.size();
+ avm_size_t uncoveredOffset = 0;
+
+ avm_size_t offset = 0;
+ for( ; offset < endTransition ; ++offset )
+ {
+ if( not testTransitionCoverage( aTableofUncoveredTransition[offset] ) )
+ {
+ uncoveredOffset = offset;
+ break;
+ }
+ }
+
+ for( ++offset ; offset < endTransition ; ++offset )
+ {
+ if( not testTransitionCoverage(aTableofUncoveredTransition[offset]) )
+ {
+ aTableofUncoveredTransition[ uncoveredOffset++ ] =
+ aTableofUncoveredTransition[ offset ];
+ }
+ }
+
+ aTableofUncoveredTransition.resize( uncoveredOffset );
+
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "AvmCoverageTransitionView::updateUncoveredTransition:> count: "
+ << aTableofUncoveredTransition.size() << std::endl;
+ AVM_OS_TRACE << "AvmCoverageTransitionView::updateUncoveredTransition:> count: "
+ << aTableofUncoveredTransition.size() << std::endl;
+
+ VectorOfAvmTransition::const_iterator itTransition = aTableofUncoveredTransition.begin();
+ VectorOfAvmTransition::const_iterator endTransition = aTableofUncoveredTransition.end();
+ for( ; itTransition != endTransition ; ++itTransition )
+ {
+ AVM_OS_COUT << "\t" << (*itTransition)->strTransitionHeader() << std::endl;
+
+ AVM_OS_TRACE << "\t" << (*itTransition)->strTransitionHeader() << std::endl;
+ }
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+}
+
+
+/**
+ * Collect all uncovered transition
+ */
+//void AvmCoverageTransitionView::collectUncoveredTransition(
+// VectorOfAvmTransition & aTableofUncoveredTransition)
+//{
+// const ExecutionData & anED =
+// mCoverageProcessor.getConfiguration().getMainExecutionData();
+//
+// RuntimeID aRID;
+//
+// avm_size_t offset;
+// avm_size_t endOffset;
+// AvmTransition * itTransition;
+//
+// switch( mScope )
+// {
+// case Specifier::DESIGN_INSTANCE_KIND:
+// {
+// if( mTransitionCoverageTable == NULL )
+// {
+// break;
+// }
+//
+// avm_size_t endMachine = mTransitionCoverageTable->size();
+// for( avm_size_t itMachine = 0 ; itMachine < endMachine ; ++itMachine )
+// {
+// aRID = anED.getRuntimeID(itMachine);
+// if( aRID.getExecutable()->hasTransition() )
+// {
+// endOffset = aRID.getExecutable()->getTransition().size();
+// for( offset = 0 ; offset < endOffset ; ++offset )
+// {
+// itTransition = aRID.getExecutable()->getTransition().rawAt(offset);
+//
+// if( not mTransitionCoverageTable->
+// at( aRID.getOffset() )->test( offset ) )
+// {
+// aTableofUncoveredTransition.append( itTransition );
+//
+// if( aTableofUncoveredTransition.size() >=
+// mCoverageStatistics.getNumberOfUncovered() )
+// {
+//// return( true );
+// goto endComputing;
+// }
+// }
+// }
+// }
+// }
+//
+// break;
+// }
+//
+// case Specifier::DESIGN_MODEL_KIND:
+// {
+// if( mExecutableCoverageTable == NULL )
+// {
+// break;
+// }
+//
+// VectorOfExecutableForm::const_iterator itExec =
+// mTableofRuntimeExecutable.begin();
+// VectorOfExecutableForm::const_iterator endExec =
+// mTableofRuntimeExecutable.end();
+// for( avm_size_t indexExec = 0 ; itExec != endExec ;
+// ++itExec , ++indexExec )
+// {
+// if( (*itExec)->hasTransition() )
+// {
+// endOffset = (*itExec)->getTransition().size();
+// for( offset = 0 ; offset < endOffset ; ++offset )
+// {
+// itTransition = (*itExec)->getTransition().rawAt(offset);
+//
+// if( not mExecutableCoverageTable->
+// at((*itExec)->getOffset())->test( offset ) )
+// {
+// aTableofUncoveredTransition.append( itTransition );
+//
+// if( aTableofUncoveredTransition.size() >=
+// mCoverageStatistics.getNumberOfUncovered() )
+// {
+//// return( true );
+// goto endComputing;
+// }
+// }
+// }
+// }
+// }
+//
+// break;
+// }
+//
+// default:
+// {
+// if( mExecutableCoverageTable != NULL )
+// {
+// VectorOfExecutableForm::const_iterator itExec =
+// mTableofRuntimeExecutable.begin();
+// VectorOfExecutableForm::const_iterator endExec =
+// mTableofRuntimeExecutable.end();
+// for( avm_size_t indexExec = 0 ; itExec != endExec ;
+// ++itExec , ++indexExec )
+// {
+// if( (*itExec)->hasTransition() )
+// {
+// endOffset = (*itExec)->getTransition().size();
+// for( offset = 0 ; offset < endOffset ; ++offset )
+// {
+// itTransition = (*itExec)->getTransition().rawAt(offset);
+//
+// if( not mExecutableCoverageTable->
+// at((*itExec)->getOffset())->test( offset ) )
+// {
+// aTableofUncoveredTransition.append( itTransition );
+//
+// if( aTableofUncoveredTransition.size() >=
+// mCoverageStatistics.getNumberOfUncovered() )
+// {
+//// return( true );
+// goto endComputing;
+// }
+// }
+// }
+// }
+// }
+// }
+//
+// if( mTransitionCoverageTable != NULL )
+// {
+// avm_size_t endMachine = mTransitionCoverageTable->size();
+// for( avm_size_t itMachine = 0 ; itMachine < endMachine ; ++itMachine )
+// {
+// aRID = anED.getRuntimeID(itMachine);
+// if( aRID.getExecutable()->hasTransition() )
+// {
+// endOffset = aRID.getExecutable()->getTransition().size();
+// for( offset = 0 ; offset < endOffset ; ++offset )
+// {
+// itTransition = aRID.getExecutable()->getTransition().rawAt(offset);
+//
+// if( (not mTransitionCoverageTable->
+// at(aRID.getOffset())->test(offset))
+// && mExecutableCoverageTable->
+// at(aRID.getExecutable()->getOffset())->test(offset) )
+// {
+// aTableofUncoveredTransition.append( itTransition );
+//
+// if( aTableofUncoveredTransition.size() >=
+// mCoverageStatistics.getNumberOfUncovered() )
+// {
+//// return( true );
+// goto endComputing;
+// }
+// }
+// }
+// }
+// }
+// }
+//
+// break;
+// }
+// }
+//
+//
+//endComputing:
+//AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+// AVM_OS_COUT << "AvmCoverageTransitionView::collectUncoveredTransition:> count: "
+// << aTableofUncoveredTransition.size() << std::endl;
+// AVM_OS_TRACE << "AvmCoverageTransitionView::collectUncoveredTransition:> count: "
+// << aTableofUncoveredTransition.size() << std::endl;
+//
+// VectorOfAvmTransition::const_iterator itTransition = aTableofUncoveredTransition.begin();
+// VectorOfAvmTransition::const_iterator endTransition = aTableofUncoveredTransition.end();
+// for( ; itTransition != endTransition ; ++itTransition )
+// {
+// AVM_OS_COUT << "\t" << (*itTransition)->strTransitionHeader() << std::endl;
+//
+// AVM_OS_TRACE << "\t" << (*itTransition)->strTransitionHeader() << std::endl;
+// }
+//AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+//}
+
+
+
+inline static bool isPertinent(AvmTransition * aTransition)
+{
+ if( aTransition->hasTarget() )
+ {
+ return( not aTransition->isUnstableTarget() );
+ }
+
+ return( not aTransition->isUnstableSource() );
+}
+
+
+void AvmCoverageTransitionView::collectUncoveredTransition(
+ VectorOfAvmTransition & aTableofUncoveredTransition)
+{
+ const ExecutionData & anED =
+ mCoverageProcessor.getConfiguration().getMainExecutionData();
+
+ RuntimeID aRID;
+
+ avm_size_t offset;
+ avm_size_t endOffset;
+ AvmTransition * itTransition;
+
+ avm_size_t uncoveredCount = 0;
+
+ VectorOfAvmTransition nonPertinentTransition;
+
+ switch( mScope )
+ {
+ case Specifier::DESIGN_INSTANCE_KIND:
+ {
+ if( mTransitionCoverageTable == NULL )
+ {
+ break;
+ }
+
+ avm_size_t endMachine = mTransitionCoverageTable->size();
+ for( avm_size_t itMachine = 0 ; itMachine < endMachine ; ++itMachine )
+ {
+ aRID = anED.getRuntimeID(itMachine);
+ if( aRID.getExecutable()->hasTransition() )
+ {
+ endOffset = aRID.getExecutable()->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itTransition = aRID.getExecutable()->
+ getTransition().rawAt(offset);
+
+ if( not mTransitionCoverageTable->
+ at( aRID.getOffset() )->test( offset ) )
+ {
+ ++uncoveredCount;
+
+ if( isPertinent( itTransition ) )
+ {
+ aTableofUncoveredTransition.append( itTransition );
+ }
+ else
+ {
+ nonPertinentTransition.append( itTransition );
+ }
+
+ if( uncoveredCount >=
+ mCoverageStatistics.getNumberOfUncovered() )
+ {
+// return( true );
+ goto endComputing;
+ }
+ }
+ }
+ }
+ }
+
+ break;
+ }
+
+ case Specifier::DESIGN_MODEL_KIND:
+ {
+ if( mExecutableCoverageTable == NULL )
+ {
+ break;
+ }
+
+ VectorOfExecutableForm::const_iterator itExec =
+ mTableofRuntimeExecutable.begin();
+ VectorOfExecutableForm::const_iterator endExec =
+ mTableofRuntimeExecutable.end();
+ for( avm_size_t indexExec = 0 ; itExec != endExec ;
+ ++itExec , ++indexExec )
+ {
+ if( (*itExec)->hasTransition() )
+ {
+ endOffset = (*itExec)->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itTransition = (*itExec)->getTransition().rawAt(offset);
+
+ if( not mExecutableCoverageTable->
+ at((*itExec)->getOffset())->test( offset ) )
+ {
+ ++uncoveredCount;
+
+ if( isPertinent( itTransition ) )
+ {
+ aTableofUncoveredTransition.append( itTransition );
+ }
+ else
+ {
+ nonPertinentTransition.append( itTransition );
+ }
+
+ if( uncoveredCount >=
+ mCoverageStatistics.getNumberOfUncovered() )
+ {
+// return( true );
+ goto endComputing;
+ }
+ }
+ }
+ }
+ }
+
+ break;
+ }
+
+ default:
+ {
+ if( mExecutableCoverageTable != NULL )
+ {
+ VectorOfExecutableForm::const_iterator itExec =
+ mTableofRuntimeExecutable.begin();
+ VectorOfExecutableForm::const_iterator endExec =
+ mTableofRuntimeExecutable.end();
+ for( avm_size_t indexExec = 0 ; itExec != endExec ;
+ ++itExec , ++indexExec )
+ {
+ if( (*itExec)->hasTransition() )
+ {
+ endOffset = (*itExec)->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itTransition = (*itExec)->getTransition().rawAt(offset);
+
+ if( not mExecutableCoverageTable->
+ at((*itExec)->getOffset())->test( offset ) )
+ {
+ ++uncoveredCount;
+
+ if( isPertinent( itTransition ) )
+ {
+ aTableofUncoveredTransition.append( itTransition );
+ }
+ else
+ {
+ nonPertinentTransition.append( itTransition );
+ }
+
+ if( uncoveredCount >=
+ mCoverageStatistics.getNumberOfUncovered() )
+ {
+// return( true );
+ goto endComputing;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if( mTransitionCoverageTable != NULL )
+ {
+ avm_size_t endMachine = mTransitionCoverageTable->size();
+ for( avm_size_t itMachine = 0 ; itMachine < endMachine ; ++itMachine )
+ {
+ aRID = anED.getRuntimeID(itMachine);
+ if( aRID.getExecutable()->hasTransition() )
+ {
+ endOffset = aRID.getExecutable()->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itTransition = aRID.getExecutable()->
+ getTransition().rawAt(offset);
+
+ if( (not mTransitionCoverageTable->
+ at(aRID.getOffset())->test(offset))
+ && mExecutableCoverageTable->
+ at(aRID.getExecutable()->getOffset())->
+ test(offset) )
+ {
+ ++uncoveredCount;
+
+ if( isPertinent( itTransition ) )
+ {
+ aTableofUncoveredTransition.append( itTransition );
+ }
+ else
+ {
+ nonPertinentTransition.append( itTransition );
+ }
+
+ if( uncoveredCount >=
+ mCoverageStatistics.getNumberOfUncovered() )
+ {
+// return( true );
+ goto endComputing;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ break;
+ }
+ }
+
+
+endComputing:
+
+ aTableofUncoveredTransition.append( nonPertinentTransition );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_COUT << "AvmCoverageTransitionView::collectUncoveredTransition:> count: "
+ << aTableofUncoveredTransition.size() << std::endl;
+ AVM_OS_TRACE << "AvmCoverageTransitionView::collectUncoveredTransition:> count: "
+ << aTableofUncoveredTransition.size() << std::endl;
+
+ VectorOfAvmTransition::const_iterator itTransition = aTableofUncoveredTransition.begin();
+ VectorOfAvmTransition::const_iterator endTransition = aTableofUncoveredTransition.end();
+ for( ; itTransition != endTransition ; ++itTransition )
+ {
+ AVM_OS_COUT << "\t" << (*itTransition)->strTransitionHeader() << std::endl;
+
+ AVM_OS_TRACE << "\t" << (*itTransition)->strTransitionHeader() << std::endl;
+ }
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+}
+
+
+/**
+ * Collect uncovered transition in a given context
+ */
+void AvmCoverageTransitionView::collectUncoveredTransition(
+ const ExecutionData & anED, VectorOfAvmTransition & tableofTransitions)
+{
+ ExecutableForm * tmpExecutable = NULL;
+
+ ListOfAvmTransition listOfOutgoingTransition;
+ ListOfAvmTransition::const_iterator itTrans;
+ ListOfAvmTransition::const_iterator endTrans;
+
+ itRF = anED.getTableOfRuntime().begin();
+ endRF = anED.getTableOfRuntime().end();
+ for( ; itRF != endRF ; ++itRF )
+ {
+ itRID = (*itRF)->getRID();
+
+ tmpExecutable = itRID.getExecutable();
+
+ if( anED.isIdleOrRunning( itRID ) && tmpExecutable->hasTransition() )
+ {
+ tmpExecutable->getOutgoingTransition( listOfOutgoingTransition );
+
+ itTrans = listOfOutgoingTransition.begin();
+ endTrans = listOfOutgoingTransition.end();
+ for( ; itTrans != endTrans ; ++itTrans )
+ {
+ if( not testTransitionCoverage(*itTrans) )
+ {
+ tableofTransitions.append( *itTrans );
+ }
+ }
+ }
+ }
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageTransitionView.h b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageTransitionView.h
new file mode 100644
index 0000000..5528d4d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/coverage/AvmCoverageTransitionView.h
@@ -0,0 +1,317 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 19 nov. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCOVERAGETRANSITIONVIEW_H_
+#define AVMCOVERAGETRANSITIONVIEW_H_
+
+#include "AvmCoverageAbstractView.h"
+
+#include <collection/Bitset.h>
+#include <collection/Typedef.h>
+
+#include <fml/common/SpecifierElement.h>
+
+#include <fml/runtime/ExecutionContext.h>
+
+
+namespace sep
+{
+
+class WaitingStrategy;
+class AvmCoverageProcessor;
+class OutStream;
+class AvmTransition;
+
+class ExecutionContext;
+class ExecutionData;
+
+class RuntimeForm;
+class RuntimeID;
+
+
+class AvmCoverageTransitionView : public AvmCoverageAbstractView
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( AvmCoverageTransitionView )
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ Specifier::DESIGN_KIND mScope;
+
+ // Table des flag de couverture de transition pour chaque INSTANCE de machine
+ ArrayOfBitset * mExecutableCoverageTable;
+ ArrayOfBitset * mTransitionCoverageTable;
+
+ VectorOfExecutableForm mTableofRuntimeExecutable;
+
+ // Computing Local Variables
+ Bitset * tmpRuntimeTransitionBitset;
+
+ ExecutionContext * mDirectiveHitEC;
+ bool mDirectiveFailedFlag;
+
+ VectorOfExecutionContext mCertainlyHitEC;
+ avm_size_t mCertainlyFireableTransitionCount;
+ avm_size_t tmpCertainlyFireableTransitionCount;
+
+ VectorOfExecutionContext mStronglyHitEC;
+ avm_size_t mStronglyFireableTransitionCount;
+ avm_size_t tmpStronglyFireableTransitionCount;
+
+ VectorOfExecutionContext mWeaklyHitEC;
+ avm_size_t mWeaklyFireableTransitionCount;
+ avm_size_t tmpWeaklyFireableTransitionCount;
+
+ ListOfExecutionContext mWaitingQueue;
+
+ avm_offset_t offset;
+ avm_offset_t endOffset;
+
+ avm_offset_t maxRandomOffset;
+ Bitset randomOffsetBitset;
+
+ ExecutionContext * tmpEC;
+ ExecutableForm * tmpEF;
+ RuntimeID itRID;
+ TableOfRuntimeT::const_iterator itRF;
+ TableOfRuntimeT::const_iterator endRF;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmCoverageTransitionView(AvmCoverageProcessor & aCoverageProcessor,
+ WObject * wfParameterObject)
+ : AvmCoverageAbstractView( aCoverageProcessor , wfParameterObject ),
+ mScope( Specifier::DESIGN_MODEL_KIND ),
+
+ mExecutableCoverageTable( NULL ),
+ mTransitionCoverageTable( NULL ),
+ mTableofRuntimeExecutable( ),
+
+ // Computing Local Variables
+ tmpRuntimeTransitionBitset( NULL ),
+
+ mDirectiveHitEC( NULL ),
+ mDirectiveFailedFlag( false ),
+
+ mCertainlyHitEC( ),
+ mCertainlyFireableTransitionCount( 0 ),
+ tmpCertainlyFireableTransitionCount( 0 ),
+
+ mStronglyHitEC( ),
+ mStronglyFireableTransitionCount( 0 ),
+ tmpStronglyFireableTransitionCount( 0 ),
+
+ mWeaklyHitEC( ),
+ mWeaklyFireableTransitionCount( 0 ),
+ tmpWeaklyFireableTransitionCount( 0 ),
+
+ mWaitingQueue( ),
+
+ offset( 0 ),
+ endOffset( 0 ),
+
+ maxRandomOffset( 0 ),
+ randomOffsetBitset( ),
+
+ tmpEC( NULL ),
+ tmpEF( NULL ),
+ itRID( ),
+ itRF( ),
+ endRF( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AvmCoverageTransitionView();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // COVERAGE PROCESSOR API
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool configureImpl();
+
+ void configureExecutableCoverageTableFlag(bool value);
+ void configureExecutableCoverageTableFlag(
+ ExecutableForm * anExecutable, bool value);
+
+ void configureInstanceCoverageTableFlag();
+ void configureInstanceCoverageTableFlag(bool value);
+ void configureInstanceCoverageTableFlag(
+ const ExecutionData & anED, const RuntimeID & aRID, bool value);
+
+ void configureTransitionCoverageTableFlag(
+ ListOfAvmTransition & listOfTransition, bool value);
+
+
+ Bitset * getCoverageTableBitset(const RuntimeID & aRID);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // REPORT API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual void reportMinimum(OutStream & os) const;
+
+ virtual void reportDefault(OutStream & os) const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PROCESS API
+ ////////////////////////////////////////////////////////////////////////////
+
+//$ virtual bool preprocess();
+//
+// virtual bool postprocess();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PROCESSOR FILTERING API
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool prefiltering(ListOfExecutionContext & ecQueue);
+
+ bool postfiltering(ListOfExecutionContext & ecQueue);
+
+ virtual void updateCoverageTable(ExecutionContext * anEC);
+
+
+ /**
+ * Heuristic << High Priority Context >> implementation
+ * REQUEUE_WAITING part
+ */
+ bool computeHighPriorityContext(ListOfExecutionContext & ecQueue,
+ WaitingStrategy & aWaitingStrategy);
+
+ bool highRequeueWaitingTable(WaitingStrategy & aWaitingStrategy,
+ avm_uint8_t aWeightMin, avm_uint8_t aWeightMax);
+
+ /**
+ * Heuristic << Any Priority Context >> implementation
+ * REQUEUE_WAITING part
+ */
+ bool computePriorityContext(ListOfExecutionContext & ecQueue,
+ WaitingStrategy & aWaitingStrategy);
+
+ bool elseRequeueWaitingTable(WaitingStrategy & aWaitingStrategy,
+ avm_uint8_t aWeightMin, avm_uint8_t aWeightMax);
+
+
+ /**
+ * UTILS
+ */
+ void setHitWeight(VectorOfExecutionContext & hitEC,
+ avm_uint8_t hitWeight, bool randomFlag, avm_size_t hitCount);
+
+ void computeWeight(ExecutionContext * anEC);
+ void computeWeightNaive(ExecutionContext * anEC);
+ void computeWeightSmart(ExecutionContext * anEC);
+ void computeWeightAgressive(ExecutionContext * anEC);
+
+
+ bool checkNonPriorityWeight(ExecutionContext * anEC);
+
+ void computePriorityWeight(ExecutionContext * anEC);
+
+ bool checkCertainlyPriorityWeight(ExecutionContext * anEC);
+ bool checkStronglyPriorityWeight(ExecutionContext * anEC);
+ bool checkWeaklyPriorityWeight(ExecutionContext * anEC);
+
+
+ void computeWeightOfResult(const ListOfExecutionContext & ecQueue);
+
+
+ avm_uint8_t checkFireability(const ExecutionData & anED,
+ const RuntimeID & aRID, AvmTransition * aTransition);
+
+ void computeFireability(const ExecutionData & anED,
+ const RuntimeID & aRID, AvmTransition * aTransition);
+
+ void traceFireability(OutStream & os, const ExecutionData & anED,
+ const RuntimeID & aRID, AvmTransition * aTransition);
+
+
+ bool isControlLoop(ExecutionContext * anEC);
+ bool isSyntaxicLoop(ExecutionContext * anEC);
+ bool isTrivialLoop(ExecutionContext * anEC);
+
+ void fireableTransitionCount(
+ const ExecutionData & anED, const RuntimeID & aRID);
+
+ void fireableTransitionCount(const ExecutionData & anED);
+
+ void fireableTransitionCount(
+ const ExecutionData & anED, const RuntimeForm & aRF);
+
+ void fireableTransitionTrace(OutStream & os, const ExecutionData & anED);
+
+ void fireableTransitionTrace(OutStream & os,
+ const ExecutionData & anED, const RuntimeForm & aRF);
+
+ void updateTransitionCoverageTable(
+ ExecutionContext * anEC, const BF & aFiredCode);
+
+ void updateTransitionCoverageTable(ExecutionContext * anEC,
+ const RuntimeID & aRID, AvmTransition * firedTransition);
+
+ bool testTransitionCoverage(AvmTransition * firedTransition);
+
+
+ /**
+ * Collect uncovered transition
+ */
+ // Update uncovered table
+ void updateUncoveredTransition(
+ VectorOfAvmTransition & aTableofUncoveredTransition);
+
+ // Collect all uncovered
+ void collectUncoveredTransition(
+ VectorOfAvmTransition & aTableofUncoveredTransition);
+
+ // Collect uncovered in a given context
+ void collectUncoveredTransition(const ExecutionData & anED,
+ VectorOfAvmTransition & listofTransition);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SERIALIZATION API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual void toStream(OutStream & os) const
+ {
+ //!! NOTHING
+ }
+
+};
+
+} /* namespace sep */
+
+#endif /* AVMCOVERAGETRANSITIONVIEW_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/coverage/BaseCoverageFilter.cpp b/org.eclipse.efm.symbex/src/fam/coverage/BaseCoverageFilter.cpp
new file mode 100644
index 0000000..83f35fc
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/coverage/BaseCoverageFilter.cpp
@@ -0,0 +1,323 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 juil. 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "BaseCoverageFilter.h"
+
+#include <fam/queue/ExecutionQueue.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <sew/Configuration.h>
+#include <sew/Workflow.h>
+
+
+#include <boost/format.hpp>
+
+
+namespace sep
+{
+
+
+/**
+ *******************************************************************************
+prototype filter::machine_coverage as &avm::core.filter.MACHINE_COVERAGE is
+ section PROPERTY
+ // Nombre de pas de calcul "cumulés" avant de débuter la vérification de la couverture
+ @begin_step = 0;
+
+ // Arrète l'exécution dès que la couverture est complète
+ @stop = true;
+
+ // Arrète l'exécution au plutôt
+ @minimize = true;
+
+ // Arrète l'exécution du chemin courant dès qu'un objectif est atteint
+ @break = true;
+
+ // Elagage du graphe des scénarios à la fin de la vérification
+ @slice = true;
+
+ // Active l'utilisation d'heuristique
+ @heuristic = true;
+
+ // choix de l'heuristique de départ
+ // basic | naive | smart | agressive
+ @heuristic#start = 'basic';
+
+ // Nombre d'essais d'heuristiques
+ @heuristic#trials = 7;
+
+ // Critère de satisfaction du succès des heuristiques
+ // taux de couverte / nombre d'élément restant...
+ @objective#rate = 95;
+ @objective#rest = 5;
+ endsection PROPERTY
+
+ section LOG
+ // %1% --> number of Covered Elements
+ // %2% --> number of Elements
+ @eval = "coverage: %1% / %2%\n";
+ @result = "coverage: %1% / %2%\n";
+ @report = "coverage: %1% / %2%\n";
+ endsection LOG
+endprototype
+ *******************************************************************************
+ */
+
+/**
+ * CONFIGURE
+ */
+bool BaseCoverageFilter::configureImpl()
+{
+ mCoverageStatistics.resetCounter();
+
+ long intProperty = 0;
+
+ // Global config scope
+ WObject * sectionSYMBEX = getConfiguration().getWorkflow().getSYMBEX();
+
+ mBackwardAnalysisLookaheadDepth =
+ Query::getRegexWPropertySizeT( sectionSYMBEX, OR_WID2(
+ CONS_WID4("backward", "analysis", "lookahead", "depth"),
+ CONS_WID3("backward", "depth", "analyze") ), // @Deprecated
+ AVM_NUMERIC_MAX_SIZE_T, AVM_NUMERIC_MAX_SIZE_T);
+
+ mForwardAnalysisLookaheadDepth =
+ Query::getRegexWPropertySizeT( sectionSYMBEX,
+ CONS_WID4("forward", "analysis", "lookahead", "depth"),
+ AVM_NUMERIC_MAX_SIZE_T, AVM_NUMERIC_MAX_SIZE_T);
+
+
+ WObject * thePROPERTY = Query::getRegexWSequence(
+ getParameterWObject(), OR_WID2("property", "PROPERTY"));
+
+ if( thePROPERTY != WObject::_NULL_ )
+ {
+ intProperty = Query::getRegexWPropertyInt(
+ thePROPERTY, CONS_WID2("(start|begin)", "step"), 0);
+ if( intProperty < 0 )
+ {
+ AVM_OS_LOG << "Invalid eval begining step ! => replace by << "
+ << 1 << " >>" << std::endl;
+
+ mBeginningStepTimout = 0;
+ }
+ else
+ {
+ mBeginningStepTimout = intProperty;
+ }
+
+ mStopFlag = Query::getWPropertyBoolean(thePROPERTY, "stop", false);
+
+ mMinimizationFlag =
+ Query::getWPropertyBoolean(thePROPERTY, "minimize", true);
+
+ mNormalizationFlag =
+ Query::getWPropertyBoolean(thePROPERTY, "normalize", true);
+
+ mBreakFlag = Query::getWPropertyBoolean(thePROPERTY, "break", false);
+
+ mSliceFlag = Query::getWPropertyBoolean(thePROPERTY, "slice", false);
+ }
+
+
+ mConfigFlag = mHeuristicProperty.configure( getParameterWObject() )
+ && mConfigFlag;
+
+ WObject * theHEURISTIC = Query::getRegexWSequence(getParameterWObject(),
+ OR_WID2("heuristic", "HEURISTIC"), thePROPERTY);
+ if( (theHEURISTIC != WObject::_NULL_) /*&& mHeuristicFlag*/ )
+ {
+ mHeuristicProperty.mHeuristicClass =
+ AvmCoverageHeuristicProperty::toHeuristicClass(
+ Query::getRegexWPropertyString(theHEURISTIC,
+ CONS_WID2("heuristic", "start"), "basic") );
+
+ intProperty = Query::getRegexWPropertyInt(
+ theHEURISTIC, CONS_WID2("objective", "rate"), 100);
+ mCoverageStatistics.mCoverageRateGoal = ( (intProperty > 0) &&
+ (intProperty <= 100) ) ? intProperty : 100;
+
+ mCoverageStatistics.mCoverageRestGoal =
+ Query::getRegexWPropertySizeT(
+ theHEURISTIC, CONS_WID2("objective", "rest"), 0, 0);
+
+ // Local config scope
+ mBackwardAnalysisLookaheadDepth = Query::getRegexWPropertySizeT(
+ theHEURISTIC, OR_WID2(
+ CONS_WID4("backward", "analysis", "lookahead", "depth"),
+ CONS_WID3("backward", "depth", "analyze") ), // @Deprecated
+ mBackwardAnalysisLookaheadDepth,
+ mBackwardAnalysisLookaheadDepth);
+
+ mForwardAnalysisLookaheadDepth = Query::getRegexWPropertySizeT(
+ theHEURISTIC, CONS_WID4("forward", "analysis", "lookahead", "depth"),
+ mForwardAnalysisLookaheadDepth, mForwardAnalysisLookaheadDepth);
+ }
+
+ return true;
+}
+
+
+/**
+ * PRE-PROCESS
+ */
+bool BaseCoverageFilter::preprocess()
+{
+ if( mHeuristicProperty.mHeuristicEnabled )
+ {
+ if( not mStatemachineReachability.computeReachableComponent(
+ getConfiguration(), mBackwardAnalysisLookaheadDepth) )
+ {
+ return( false );
+ }
+
+AVM_IF_DEBUG_FLAG2( PRE_PROCESSING , EXECUTABLE )
+ getConfiguration().serializeDebugExecutable( "preprocess" );
+AVM_ENDIF_DEBUG_FLAG2( PRE_PROCESSING , EXECUTABLE )
+ }
+
+ return( true );
+}
+
+
+/**
+ * PRE-FILTER
+ */
+bool BaseCoverageFilter::prefilter()
+{
+ if( mCoverageStatistics.goalAchieved() && mStopFlag )
+ {
+ ecQueue = &( getExecutionQueue().getReadyQueue() );
+
+ ExecutionContext * anEC = NULL;
+ while( ecQueue->nonempty() )
+ {
+ ecQueue->pop_first_to( anEC );
+
+ getExecutionQueue().appendFailed( anEC );
+ }
+
+ return false;
+ }
+
+ return true;
+}
+
+
+/**
+ * FILTERING FINALIZE
+ */
+bool BaseCoverageFilter::filteringFinalize()
+{
+ if( mSliceFlag )
+ {
+ mListOfLeafEC.clear();
+
+ // ELAGAGE DANS TOUT LE GRAPH!!!!!
+ computeLeafEC(getConfiguration().getTrace(), mListOfLeafEC);
+
+ slice(mListOfLeafEC);
+ }
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// FINAL SLICING TOOLS
+////////////////////////////////////////////////////////////////////////////////
+
+bool BaseCoverageFilter::isSliceableContext(ExecutionContext & anEC) const
+{
+ if( mListOfPositiveEC.contains(& anEC) )
+ {
+ return( false );
+ }
+ else
+ {
+ return( AbstractProcessorUnit::isSliceableContext(anEC) );
+ }
+}
+
+
+/**
+ * GOAL_ACHIEVED
+ */
+void BaseCoverageFilter::handleRequestGoalAchieved()
+{
+ //!! NOTHING
+}
+
+/**
+ * EVAL TRACE
+ */
+void BaseCoverageFilter::traceMinimumPreEval(
+ OutStream & os, const ExecutionContext & anEC) const
+{
+ boost::format formatter(mPreEvalTraceFormatter);
+ formatter.exceptions( boost::io::no_error_bits );
+
+// formatter.exceptions( boost::io::all_error_bits ^
+// ( boost::io::too_many_args_bit | boost::io::too_few_args_bit ) );
+
+ os << formatter
+ % mCoverageStatistics.mNumberOfCovered
+ % mCoverageStatistics.mNumberOfElements
+ << std::flush;
+}
+
+
+void BaseCoverageFilter::traceDefaultPreEval(
+ OutStream & os, const ExecutionContext & anEC) const
+{
+ os << "coverage< " << getParameterWObject()->getNameID() << " >: "
+ << mCoverageStatistics.mNumberOfCovered << " / "
+ << mCoverageStatistics.mNumberOfElements << std::endl;
+}
+
+
+void BaseCoverageFilter::traceBoundEval(OutStream & os) const
+{
+ boost::format formatter(mBoundEvalTraceFormatter);
+ formatter.exceptions( boost::io::no_error_bits );
+
+// formatter.exceptions( boost::io::all_error_bits ^
+// ( boost::io::too_many_args_bit | boost::io::too_few_args_bit ) );
+
+ os << formatter
+ % mCoverageStatistics.mNumberOfCovered
+ % mCoverageStatistics.mNumberOfElements
+ << std::flush;
+}
+
+
+void BaseCoverageFilter::reportEval(OutStream & os) const
+{
+ boost::format formatter(mReportEvalTraceFormatter);
+ formatter.exceptions( boost::io::no_error_bits );
+
+// formatter.exceptions( boost::io::all_error_bits ^
+// ( boost::io::too_many_args_bit | boost::io::too_few_args_bit ) );
+
+ os << formatter
+ % mCoverageStatistics.mNumberOfCovered
+ % mCoverageStatistics.mNumberOfElements
+ << std::flush;
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fam/coverage/BaseCoverageFilter.h b/org.eclipse.efm.symbex/src/fam/coverage/BaseCoverageFilter.h
new file mode 100644
index 0000000..d2dbf95
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/coverage/BaseCoverageFilter.h
@@ -0,0 +1,314 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 juil. 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BASECOVERAGEFILTER_H_
+#define BASECOVERAGEFILTER_H_
+
+#include <fam/api/AbstractProcessorUnit.h>
+
+#include <fam/coverage/AvmCoverageHeuristicProperty.h>
+#include <fam/coverage/AvmCoverageStatistics.h>
+#include <fam/coverage/StatemachineReachability.h>
+
+#include <collection/Typedef.h>
+
+
+namespace sep
+{
+
+
+class BaseCoverageFilter :
+ public AbstractProcessorUnit,
+ public IHeuristicContextWeight
+{
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ bool mStopFlag;
+ bool mMinimizationFlag;
+ bool mNormalizationFlag;
+ bool mBreakFlag;
+ bool mSliceFlag;
+
+ avm_size_t mBackwardAnalysisLookaheadDepth;
+ avm_size_t mForwardAnalysisLookaheadDepth;
+
+ StatemachineReachability mStatemachineReachability;
+
+ AvmCoverageHeuristicProperty mHeuristicProperty;
+
+ AvmCoverageStatistics mCoverageStatistics;
+
+ ListOfExecutionContext mListOfLeafEC;
+ ListOfExecutionContext mListOfPositiveEC;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BaseCoverageFilter(SymbexControllerUnitManager & aManager, WObject * wfParameterObject,
+ avm_computing_process_stage_t requiredStage,
+ const avm_uint8_t * aPrecedence/* = DEFAULT_PRECEDENCE_OF_PROCESSOR*/)
+ : AbstractProcessorUnit(aManager, wfParameterObject, requiredStage, aPrecedence),
+ IHeuristicContextWeight( ),
+
+ mStopFlag( false ),
+
+ mMinimizationFlag( true ),
+ mNormalizationFlag( true ),
+
+ mBreakFlag( false ),
+ mSliceFlag( false ),
+
+ mBackwardAnalysisLookaheadDepth( AVM_NUMERIC_MAX_SIZE_T ),
+ mForwardAnalysisLookaheadDepth ( AVM_NUMERIC_MAX_SIZE_T ),
+
+ mStatemachineReachability( *this ),
+
+ mHeuristicProperty( IHeuristicClass::HEURISTIC_BASIC_CLASS ),
+
+ mCoverageStatistics( 100 , 0 ),
+
+ mListOfLeafEC(),
+ mListOfPositiveEC()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BaseCoverageFilter()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER
+ * mMinimizationFlag
+ * mNormalizationFlag
+ */
+ bool isMinimizationFlag()
+ {
+ return( mMinimizationFlag );
+ }
+
+ bool isNormalizationFlag()
+ {
+ return( mNormalizationFlag );
+ }
+
+
+ /**
+ * mCoverageStatistics
+ */
+ inline AvmCoverageStatistics & getCoverageStatistics()
+ {
+ return mCoverageStatistics;
+ }
+
+ inline void resetCoverageStatistics()
+ {
+ return mCoverageStatistics.resetCoverageCounter();
+ }
+
+
+ /**
+ * CONFIGURE
+ */
+ inline virtual std::string getDefaultPreEvalTraceFormatter() const
+ {
+ return( OSS() << " coverage< "
+ << getParameterWObject()->getFullyQualifiedNameID()
+ << " >: %1% / %2%" );
+ }
+
+ inline virtual std::string getDefaultPostEvalTraceFormatter() const
+ {
+ return( OSS() << " coverage< "
+ << getParameterWObject()->getFullyQualifiedNameID()
+ << " >: %1% / %2%" );
+ }
+
+
+ inline virtual std::string getDefaultBoundEvalTraceFormatter() const
+ {
+ return( OSS() << " coverage< "
+ << getParameterWObject()->getFullyQualifiedNameID()
+ << " >: %1% / %2%" );
+ }
+
+ inline virtual std::string getDefaultReportEvalTraceFormatter() const
+ {
+ return( OSS() << " coverage< "
+ << getParameterWObject()->getFullyQualifiedNameID()
+ << " >: %1% / %2%" );
+ }
+
+
+ virtual bool configureImpl();
+
+
+ /**
+ * PRE-FILTER
+ */
+ virtual bool prefilter();
+
+
+ /**
+ * PRE-PROCESS
+ */
+ virtual bool preprocess();
+
+ /**
+ * EXIT API
+ */
+ virtual bool exitImpl()
+ {
+ // SET EXIT CODE
+ mCoverageStatistics.setExitCode();
+
+ return true;
+ }
+
+
+ /**
+ * FILTERING FINALIZE
+ */
+ virtual bool filteringFinalize();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FINAL SLICING TOOLS
+ ////////////////////////////////////////////////////////////////////////////
+ virtual bool isSliceableContext(ExecutionContext & anEC) const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PROCESSOR REQUEST API
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * GOAL_ACHIEVED
+ */
+ virtual void handleRequestGoalAchieved();
+
+
+ /**
+ * EVAL TRACE
+ */
+ virtual void traceMinimumPreEval(
+ OutStream & os, const ExecutionContext & anEC) const;
+
+ virtual void traceDefaultPreEval(
+ OutStream & os, const ExecutionContext & anEC) const;
+
+
+ virtual void traceBoundEval(OutStream & os) const;
+
+ virtual void reportEval(OutStream & os) const;
+
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// PROCESSOR UNIT AUTO REGISTRATION FACTORY
+// for automatic registration in the processor repository
+////////////////////////////////////////////////////////////////////////////////
+
+template< class ProcessorT >
+class AutoRegisteredCoverageProcessorUnit : public BaseCoverageFilter
+{
+
+public:
+ /**
+ * TYPDEDEF
+ */
+ typedef AutoRegisteredCoverageProcessorUnit< ProcessorT >
+ RegisteredCoverageProcessorUnit;
+
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AutoRegisteredCoverageProcessorUnit(SymbexControllerUnitManager & aManager,
+ WObject * wfParameterObject, avm_computing_process_stage_t requiredStage,
+ const avm_uint8_t * aPrecedence/* = DEFAULT_PRECEDENCE_OF_PROCESSOR*/)
+ : BaseCoverageFilter(aManager, wfParameterObject, requiredStage, aPrecedence)
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AutoRegisteredCoverageProcessorUnit()
+ {
+ // Force Instanciate
+ (void) & AUTO_REGISTER_TOOL;
+ }
+
+
+ /**
+ * PROCESSOR FACTORY
+ * for automatic registration in the processor repository
+ */
+ static struct AutoRegisterProcessorFactory :
+ public ProcessorUnitRegistrationImpl< ProcessorT >
+ {
+ AutoRegisterProcessorFactory()
+ : ProcessorUnitRegistrationImpl< ProcessorT >(
+ ProcessorT::QNID() , ProcessorT::QNID1() ,
+ ProcessorT::QNID2(), ProcessorT::QNID3() )
+ {
+ //!! NOTHING
+ }
+
+ } AUTO_REGISTER_TOOL;
+ // end registration
+
+
+ /**
+ * API
+ */
+ inline const IProcessorUnitRegistration & REGISTER_TOOL() const
+ {
+ return( AUTO_REGISTER_TOOL );
+ }
+
+ inline bool isRegisterTool(
+ const IProcessorUnitRegistration & aRegisterTool) const
+ {
+ return( AUTO_REGISTER_TOOL.isEquals( aRegisterTool ) );
+ }
+
+};
+
+
+template< class ProcessorT > typename
+AutoRegisteredCoverageProcessorUnit< ProcessorT >::AutoRegisterProcessorFactory
+AutoRegisteredCoverageProcessorUnit< ProcessorT >::AUTO_REGISTER_TOOL;
+
+
+}
+
+#endif /* BASECOVERAGEFILTER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/coverage/FormulaCoverageFilter.cpp b/org.eclipse.efm.symbex/src/fam/coverage/FormulaCoverageFilter.cpp
new file mode 100644
index 0000000..f002a8c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/coverage/FormulaCoverageFilter.cpp
@@ -0,0 +1,1283 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 23 juil. 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "FormulaCoverageFilter.h"
+
+#include <builder/Builder.h>
+
+#include <collection/Bitset.h>
+
+#include <computer/EvaluationEnvironment.h>
+
+#include <fml/executable/AvmProgram.h>
+#include <fml/executable/BaseInstanceForm.h>
+#include <fml/executable/InstanceOfData.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/ExpressionConstructor.h>
+
+#include <fml/type/TypeSpecifier.h>
+
+#include <fml/runtime/ExecutionConfiguration.h>
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/ExecutionInformation.h>
+
+#include <fam/queue/ExecutionQueue.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <sew/Configuration.h>
+
+#include <solver/api/SolverFactory.h>
+
+#include <util/ExecutionTime.h>
+
+
+
+namespace sep
+{
+
+
+/**
+ ***************************************************************************
+prototype filter::formula_coverage as avm::core.filter.FORMULA_COVERAGE is
+ section PROPERTY
+ // Nombre de pas de calcul "cumulés" avant de débuter
+ // la vérification de la couverture
+ @begin_step = 0;
+
+ // Arrète l'exécution dès que la couverture est complète
+ @stop = true;
+
+ // Arrète l'exécution au plutôt
+ @minimize = true;
+
+ // Arrète l'exécution du chemin courant dès qu'un objectif est atteint
+ @break = true;
+
+ // Elagage du graphe des scénarios à la fin de la vérification
+ @slice = true;
+
+ // Active l'utilisation d'heuristique
+ @heuristic = true;
+
+ // choix de l'heuristique de départ
+ // basic | naive | smart | agressive
+ @heuristic#start = 'basic';
+
+ // Nombre d'essais d'heuristiques
+ @heuristic#trials = 7;
+
+ // Critère de satisfaction du succès des heuristiques
+ // taux de couverte / nombre d'élément restant...
+ @objective#rate = 95;
+ @objective#rest = 5;
+
+
+ @solver = 'CVC4'; // OMEGA | CVC4 | Z3 | YICES
+
+ endsection PROPERTY
+
+ section DATA
+ ( < Local Variable declaration >; )*
+ endsection DATA
+
+ section FORMULA
+ ( @label = < AvmCode >; )+
+ endsection FORMULA
+
+ section MOC
+ ( @moc = < AvmCode< label > >; )+
+ endsection MOC
+endprototype
+ ***************************************************************************
+ */
+
+void printLinkTable(OutStream & os, const BFVector & aFormulaTable,
+ VectorOfInt & aLinkTable, const std::string & title)
+{
+ os << title << "\n";
+
+ avm_size_t endIdx = aFormulaTable.size();
+ for( avm_size_t idx = 0; idx < endIdx ; ++idx )
+ {
+ os << "\t" << aLinkTable[idx] << ":> "
+ << aFormulaTable[idx].to_ptr< FormulaData >()->label << "\n"
+ << std::flush;
+ }
+}
+
+void printTruthTable(OutStream & os, const BFVector & aFormulaTable,
+ Bitset & aTruthTable, const std::string & title)
+{
+ os << title << "\n";
+
+ avm_size_t endIdx = aFormulaTable.size();
+ for( avm_size_t idx = 0; idx < endIdx ; ++idx )
+ {
+ os << "\t" << aTruthTable[idx] << ":> "
+ << aFormulaTable[idx].to_ptr< FormulaData >()->label << "\n"
+ << std::flush;
+ }
+}
+
+void reportTable(OutStream & os, const BFVector & aFormulaTable,
+ const std::string & title)
+{
+ os << TAB << title << EOL;
+
+ avm_size_t endIdx = aFormulaTable.size();
+ for( avm_size_t idx = 0; idx < endIdx ; ++idx )
+ {
+ if( aFormulaTable[idx].to_ptr< FormulaData >()->satEC.nonempty() )
+ {
+ aFormulaTable[idx].to_ptr< FormulaData >()->report(os);
+ }
+ }
+}
+
+
+
+bool FormulaCoverageFilter::configureImpl()
+{
+ // SUPER CONFIGURATION
+ mConfigFlag = BaseCoverageFilter::configureImpl();
+
+ mMocCoverageStatistics.resetCounter();
+
+ WObject * thePROPERTY = Query::getRegexWSequence(
+ getParameterWObject(), OR_WID2("property", "PROPERTY"));
+ if( thePROPERTY != WObject::_NULL_ )
+ {
+ std::string theSolverName = Query::getWPropertyString(thePROPERTY,
+ "solver", SolverDef::strSolver(SolverDef::SOLVER_CVC4_KIND));
+ if( theSolverName.empty() )
+ {
+ thePROPERTY->warningLocation(AVM_OS_WARN)
+ << "Unexpected empty solver engine kind !" << std::endl;
+ }
+ mSolverKind = SolverDef::toSolver(
+ theSolverName, SolverDef::DEFAULT_SOLVER_KIND);
+ }
+ else
+ {
+ mConfigFlag = false;
+ }
+
+
+ WObject * theDATA = Query::getRegexWSequence(
+ getParameterWObject(), OR_WID2("data", "DATA"));
+ if( theDATA != WObject::_NULL_ )
+ {
+ getConfiguration().getExecutableSystem().initProcessExecutableForm(
+ mLocalExecutableForm, theDATA->ownedSize());
+
+ List< WObject * > listOfLocalVar;
+ Query::getListWObject(theDATA, listOfLocalVar);
+
+ TypeSpecifier aTypeSpecifier;
+
+ List< WObject * >::iterator it = listOfLocalVar.begin();
+ List< WObject * >::iterator itEnd = listOfLocalVar.end();
+ for( avm_offset_t offset = 0 ; it != itEnd ; ++it , ++offset )
+ {
+ aTypeSpecifier = ENV.getBuilder().getCompiler().compileTypeSpecifier(
+ &mLocalExecutableForm, (*it)->getQualifiedTypeNameID() );
+
+//!![MIGRATION]
+ BF anInstance( new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ &mLocalExecutableForm, /*(*it)*/ NULL, aTypeSpecifier, offset) );
+ mLocalExecutableForm.setData( offset , anInstance );
+ }
+ }
+ else
+ {
+ getConfiguration().getExecutableSystem().
+ initProcessExecutableForm(mLocalExecutableForm, 0);
+ }
+
+
+ avm_size_t errorCount = 0;
+
+ WObject * theFORMULA = Query::getRegexWSequence(
+ getParameterWObject(), OR_WID2("formula", "FORMULA"));
+
+ if( theFORMULA != WObject::_NULL_ )
+ {
+ const BF & aTrigger = Query::getWPropertyValue(
+ thePROPERTY, "trigger", BF::REF_NULL);
+ if( aTrigger.valid() )
+ {
+// mTrigger = ENV.getBuilder().build(
+// getConfiguration()->getMainExecutionData(),
+// mLocalExecutableForm, aTrigger);
+
+ mTrigger = ENV.getBuilder().
+ compileExpression(&mLocalExecutableForm, aTrigger);
+
+AVM_IF_DEBUG_FLAG( CONFIGURING )
+ AVM_OS_LOG << TAB << " --> trigger : " << aTrigger.str() << " <-- " << EOL
+ << TAB << " --> build trigger : " << mTrigger.str() << " <-- "
+ << EOL << EOL << std::flush;
+AVM_ENDIF_DEBUG_FLAG( CONFIGURING )
+ }
+
+ WObject::const_iterator itWfO = theFORMULA->owned_begin();
+ WObject::const_iterator endWfO = theFORMULA->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty() )
+ {
+ if( appendFormula((*itWfO)->getValue(),
+ (*itWfO)->getNameID(), (*itWfO)).invalid() )
+ {
+ ++errorCount;
+ }
+ }
+ }
+ }
+ else
+ {
+ thePROPERTY->warningLocation(AVM_OS_WARN)
+ << "FORMULA section not found in filter< " +
+ getParameterWObject()->getFullyQualifiedNameID() + " > !" << std::endl;
+
+ mConfigFlag = false;
+ }
+
+
+ WObject * theMOC = Query::getRegexWSequence(
+ getParameterWObject(), OR_WID2("moc", "MOC"));
+
+ if( theMOC != WObject::_NULL_ )
+ {
+ WObject::const_iterator itWfO = theMOC->owned_begin();
+ WObject::const_iterator endWfO = theMOC->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty() )
+ {
+ if( appendMoc((*itWfO)->getValue(),
+ (*itWfO)->getNameID(), (*itWfO)).invalid() )
+ {
+ ++errorCount;
+ }
+ }
+ }
+ }
+
+ mConfigFlag = (errorCount == 0) && mConfigFlag;
+
+ return( mConfigFlag );
+}
+
+
+
+/*
+ * GETTER
+ * mVectorOfFormula
+ */
+BF FormulaCoverageFilter::appendFormula(const BF & aFormula,
+ const std::string & label, Element * favmFormula)
+{
+// BF aBuildFormula = ENV.getBuilder().build(
+// MainDataConfiguration::getInstance()->getMainExecutionContext()
+// ->getAPExecutionData(), mLocalExecutableForm, aFormula);
+
+ ENV.getBuilder().getAvmcodeCompiler().getSymbolTable().resetError();
+
+ BF aBuildFormula = ENV.getBuilder().
+ compileExpression(&mLocalExecutableForm, aFormula);
+
+ if( ENV.getBuilder().getAvmcodeCompiler().getSymbolTable().hasZeroError()
+ && aBuildFormula.valid() )
+ {
+ BF aFD( new FormulaData(aBuildFormula, label,
+ mFormulaTable.size(), favmFormula) );
+ mFormulaTable.append( aFD );
+ mListOfUncoveredFormula.append( aFD );
+
+
+ mCoverageStatistics.mNumberOfElements = mFormulaTable.size();
+
+ mFormulaTruthTable.resize(mCoverageStatistics.mNumberOfElements, false);
+ mFormulaLinkTable.resize(mCoverageStatistics.mNumberOfElements, 0);
+
+AVM_IF_DEBUG_FLAG( CONFIGURING )
+ AVM_OS_LOG << TAB << " --> formula " << label << " : "
+ << aFormula.str() << " <-- " << EOL
+ << TAB << " --> build formula " << label << " : "
+ << aBuildFormula.str() << " <-- "
+ << EOL << EOL << std::flush;
+AVM_ENDIF_DEBUG_FLAG( CONFIGURING )
+
+ return( aFD );
+ }
+ else
+ {
+ if( ENV.getBuilder().getAvmcodeCompiler().getSymbolTable().hasErrorMessage() )
+ {
+ AVM_OS_LOG << TAB << ENV.getBuilder().getAvmcodeCompiler().
+ getSymbolTable().getErrorMessage() << EOL << std::flush;
+ }
+
+ AVM_OS_COUT << TAB << " --> build formula FAILED :> " << label
+ << " : " << aFormula.str() << " <-- " << EOL << std::flush;
+ AVM_OS_LOG << TAB << " --> build formula FAILED :> " << label
+ << " : " << aFormula.str() << " <-- " << EOL << std::flush;
+
+
+ return( BF::REF_NULL );
+ }
+}
+
+
+
+/*
+ * GETTER
+ * mVectorOfMoc
+ */
+BF FormulaCoverageFilter::appendMoc(const BF & aMoc,
+ const std::string & label, Element * favmFormula)
+{
+ BF aBuildMoc = buildMoc( aMoc );
+
+ if( aBuildMoc.valid() )
+ {
+ BF aFD( new FormulaData(aBuildMoc, label,
+ mMocTable.size(), favmFormula) );
+ mMocTable.append( aFD );
+ mListOfUnCoveredMoc.append( mMocTable.last() );
+
+
+ mMocCoverageStatistics.mNumberOfElements = mMocTable.size();
+
+ mMocTruthTable.resize( mMocCoverageStatistics.mNumberOfElements , false );
+ mMocLinkTable.resize( mMocCoverageStatistics.mNumberOfElements , 0 );
+
+
+ mocAppendFormulaLink( aBuildMoc );
+
+AVM_IF_DEBUG_FLAG( CONFIGURING )
+ AVM_OS_LOG << TAB << " --> moc " << label
+ << " : " << aMoc.str() << " <-- " << EOL
+ << TAB << " --> build moc " << label
+ << " : " << aBuildMoc.str() << " <-- "
+ << EOL << EOL << std::flush;
+AVM_ENDIF_DEBUG_FLAG( CONFIGURING )
+
+
+ printLinkTable(AVM_OS_TRACE, mFormulaTable, mFormulaLinkTable,
+ "Configuration of the Formula Link Table");
+
+ return( aFD );
+ }
+ else
+ {
+ AVM_OS_LOG << TAB << " --> build moc FAILED :> " << label
+ << " : " << aMoc.str() << " <-- " << EOL << std::flush;
+
+ return( BF::REF_NULL );
+ }
+}
+
+
+BF FormulaCoverageFilter::buildMoc(const BF & aMoc)
+{
+ switch( aMoc.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ BFCode newMoc( aMoc.to_ptr< AvmCode >()->getOperator() );
+
+ BF bfMoc;
+
+ AvmCode::iterator itForm = aMoc.to_ptr< AvmCode >()->begin();
+ AvmCode::iterator endForm = aMoc.to_ptr< AvmCode >()->end();
+ for( ; itForm != endForm ; ++itForm )
+ {
+ if( (bfMoc = buildMoc(*itForm)).valid() )
+ {
+ newMoc->append( bfMoc );
+ }
+ else
+ {
+ return( BF::REF_NULL );
+ }
+ }
+
+ return( newMoc );
+ }
+
+ case FORM_UFI_KIND:
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ case FORM_BUILTIN_STRING_KIND:
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+ {
+ BF aFormula = getFormula(aMoc.str()) ;
+ if( aFormula.valid() )
+ {
+ return( aFormula );
+ }
+ else
+ {
+ return( BF::REF_NULL );
+ }
+ }
+
+ case FORM_EXEC_FILTER_FORMULA_DATA_KIND:
+ default:
+ {
+ return( aMoc );
+ }
+ }
+}
+
+
+/*
+ * REPORT
+ */
+void FormulaData::report(OutStream & os) const
+{
+ os << TAB << str() << EOL;
+
+ ListOfExecutionContext::const_iterator it = satEC.begin();
+ ListOfExecutionContext::const_iterator endIt = satEC.end();
+ for( ; it != endIt ; ++it )
+ {
+ os << TAB2 << "==>E[?] " << (*it)->str_min() << EOL;
+ }
+ os << std::flush;
+}
+
+
+void FormulaCoverageFilter::reportDefault(OutStream & os) const
+{
+ reportHeader(os, "FORMULA COVERAGE ");
+
+
+ if( mFormulaTable.nonempty() )
+ {
+ if( mCoverageStatistics.goalAchieved() )
+ {
+ os << TAB2 << "All the << " << mCoverageStatistics.mNumberOfElements
+ << " >> formulas are covered !" << EOL;
+ }
+ else
+ {
+ os << TAB2 << "Warning: all formulas are not covered !" << EOL;
+ mCoverageStatistics.toStreamCoverageRate( os << TAB2,
+ "Results: << ", " on "," >> are covered !\n" );
+
+ if( isReportDetails() && mListOfUncoveredFormula.nonempty() )
+ {
+ os << TAB2 << "List of the << "
+ << mCoverageStatistics.getNumberOfUncovered()
+ << " >> formulas non covered:" << EOL;
+
+ BFList::const_iterator itForm = mListOfUncoveredFormula.begin();
+ BFList::const_iterator endForm = mListOfUncoveredFormula.end();
+ for( ; itForm != endForm ; ++itForm )
+ {
+ os << TAB2 << " ==> " << (*itForm).str() << " <== " << EOL;
+ }
+
+ mCoverageStatistics.toStreamCoverageRate( os << TAB2,
+ "Results: << ", " on "," >> are covered !\n" );
+ }
+ }
+
+ if( mSliceFlag )
+ {
+ os << TAB2 << "Number of nodes cut back: " << mSliceCount << EOL;
+ }
+
+ }
+
+
+ if( mMocTable.nonempty() )
+ {
+ os << EOL;
+ if( mMocCoverageStatistics.goalAchieved() )
+ {
+ os << TAB2 << "All of the " << mMocTable.size()
+ << " MOCs are covered !" << EOL;
+ }
+ else
+ {
+ os << TAB2 << "Warning: all MOCs are not covered !" << EOL;
+ mMocCoverageStatistics.toStreamCoverageRate( os << TAB2,
+ "Results: << ", " on "," >> are covered !\n" );
+
+ if( isReportDetails() && mListOfUnCoveredMoc.nonempty() )
+ {
+ os << TAB2 << "List of the << "
+ << mMocCoverageStatistics.getNumberOfUncovered()
+ << " >> MOCs non covered:" << EOL;
+
+ BFList::const_iterator itForm = mListOfUnCoveredMoc.begin();
+ BFList::const_iterator endForm = mListOfUnCoveredMoc.end();
+ for( ; itForm != endForm ; ++itForm )
+ {
+ os << TAB2 << " ==> " << (*itForm).str() << " <== " << EOL;
+ }
+
+ mMocCoverageStatistics.toStreamCoverageRate( os << TAB2,
+ "Results: << ", " on "," >> are covered !\n" );
+ }
+ }
+ }
+
+ if( isReportDetails() )
+ {
+ os << EOL_INCR_INDENT;
+ reportTable(os, mFormulaTable, "FORMULA TABLE");
+ os << EOL;
+ reportTable(os, mMocTable, "MOC TABLE");
+ os << DECR_INDENT;
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SET EXIT CODE
+ mCoverageStatistics.setExitCode();
+}
+
+
+bool FormulaCoverageFilter::postfilter(ExecutionContext & anEC)
+{
+ if( mCoverageStatistics.hasUncovered() )
+ {
+ ExecutionTime mExecutionTimeManager(false);
+AVM_IF_DEBUG_FLAG( TIME )
+ mExecutionTimeManager.start_time();
+AVM_ENDIF_DEBUG_FLAG( TIME )
+
+
+ if( mTrigger.valid() )
+ {
+ if( ENV.eval(anEC.getAPExecutionData(),
+ anEC.getAPExecutionData()->getSystemRID(), mTrigger) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , SOLVING )
+ AVM_OS_COUT << "mTrigger:> " << ENV.outVAL.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , SOLVING )
+ if( ENV.outVAL.isEqualFalse() )
+ {
+ return( true );
+ }
+ }
+ }
+
+ checkFormula( & anEC );
+
+AVM_IF_DEBUG_FLAG( TIME )
+ AVM_OS_TRACE << "checkFormula< EC::id "
+ << anEC.getIdNumber() << " >" << std::endl;
+ mExecutionTimeManager.finish_time();
+ AVM_OS_TRACE << mExecutionTimeManager.time_stat();// << std::endl;
+AVM_ENDIF_DEBUG_FLAG( TIME )
+ }
+
+ else if( not mStopFlag )
+ {
+ if( mTrigger.valid() )
+ {
+ if( ENV.eval(anEC.getAPExecutionData(),
+ anEC.getAPExecutionData()->getSystemRID(), mTrigger) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , SOLVING )
+ AVM_OS_COUT << "mTrigger:> " << ENV.outVAL.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , SOLVING )
+ if( ENV.outVAL.isEqualFalse() )
+ {
+ return( true );
+ }
+ }
+ }
+
+ checkFormulaAfter( & anEC );
+ }
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// CHECK FORMULA
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool FormulaCoverageFilter::checksatFormula(ExecutionContext * anEC,
+ const BF & aFormula, FormulaData * aFD)
+{
+ BF condition = ExpressionConstructor::andExpr(
+ anEC->refExecutionData().getPathCondition(), aFormula);
+
+ if( SolverFactory::isStrongSatisfiable(mSolverKind, condition) )
+ {
+AVM_IF_DEBUG_FLAG( PROCESSOR )
+ AVM_OS_TRACE << TAB2 << "EC<" << anEC->getIdNumber()
+ << "> |= <" << aFD->label << "> " << aFormula.str()
+ << std::endl;
+
+ AVM_OS_COUT << TAB2 << "EC<" << anEC->getIdNumber()
+ << "> |= <" << aFD->label << "> " << aFormula.str()
+ << std::endl;
+AVM_ENDIF_DEBUG_FLAG( PROCESSOR )
+
+ anEC->getwFlags().addCoverageElementTrace();
+
+ anEC->addInfo(*this, ExpressionConstructor::newString( aFD->label ));
+
+ anEC->getUniqInformation()->getUniqFormulaCoverageFilterInfo()->
+ appendFormula( INCR_BF(aFD) );
+
+ aFD->satEC.append( anEC );
+
+ mListOfPositiveEC.append( anEC );
+
+ if( mBreakFlag && mMocTable.empty() )
+ {
+ anEC->getExecutionData()->setAEES( AEES_STMNT_EXIT );
+ }
+
+ return( true );
+ }
+ else
+ {
+ return( false );
+ }
+}
+
+
+
+
+void FormulaCoverageFilter::checkFormula(ExecutionContext * anEC)
+{
+ bool needCheckMoc = false;
+
+ FormulaData * itFD;
+ BFList::iterator itForm = mListOfUncoveredFormula.begin();
+ for( ; itForm != mListOfUncoveredFormula.end() ; )
+ {
+ itFD = (*itForm).to_ptr< FormulaData >();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+ AVM_OS_TRACE << " ==> checkFormula " << itFD->str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+
+ if( ((not mFormulaTruthTable[ itFD->offset ]) || (not mMinimizationFlag))
+ && checkFormula(anEC, itFD) )
+ {
+ mFormulaTruthTable[ itFD->offset ] = true;
+
+ itForm = mListOfUncoveredFormula.erase(itForm);
+
+ mCoverageStatistics.addCoveredElement();
+
+ needCheckMoc = true;
+
+
+AVM_IF_DEBUG_FLAG( PROCESSOR )
+ mCoverageStatistics.toStreamCoverageRate(AVM_OS_TRACE << TAB,
+ "Formula Coverage: " , "\n");
+ AVM_OS_TRACE << REPEAT("********", 10) << std::endl;
+
+ mCoverageStatistics.toStreamCoverageRate(AVM_OS_COUT << TAB,
+ "Formula Coverage: " , "\n");
+ AVM_OS_COUT << REPEAT("********", 10) << std::endl;
+AVM_ENDIF_DEBUG_FLAG( PROCESSOR )
+ }
+ else
+ {
+ ++itForm;
+ }
+ }
+
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+ printTruthTable(AVM_OS_TRACE, mFormulaTable, mFormulaTruthTable,
+ "Update of the Formula Truth Table");
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+
+ if( needCheckMoc )
+ {
+ if( mMocCoverageStatistics.hasUncovered() )
+ {
+ checkMoc( anEC );
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+ printTruthTable(AVM_OS_TRACE, mMocTable, mMocTruthTable,
+ "Update of the MOC Truth Table");
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+ printLinkTable(AVM_OS_TRACE, mFormulaTable, mFormulaLinkTable,
+ "Update of the Formula Link Table");
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+}
+
+
+bool FormulaCoverageFilter::checkFormula(
+ ExecutionContext * anEC, FormulaData * aFD)
+{
+ avm_size_t succesCount = 0;
+
+ ExecutionContext::child_iterator itEC = anEC->begin();
+ ExecutionContext::child_iterator endEC = anEC->end();
+ for( ; itEC != endEC ; ++itEC )
+ {
+ if( ENV.evalFormula(*(*itEC), &mLocalExecutableForm, aFD->formula) )
+ {
+ if( checksatFormula(*itEC, ENV.outVAL, aFD) )
+ {
+ ++succesCount;
+
+ if( mMinimizationFlag )
+ {
+ break;
+ }
+ }
+ }
+ }
+
+ return( succesCount > 0 );
+}
+
+
+
+void FormulaCoverageFilter::checkFormulaAfter(ExecutionContext * anEC)
+{
+ FormulaData * itFD;
+ BFVector::iterator itForm = mFormulaTable.begin();
+ BFVector::iterator endForm = mFormulaTable.end();
+ for( ; itForm != endForm ; ++itForm )
+ {
+ itFD = (*itForm).to_ptr< FormulaData >();
+
+ if( checkFormulaAfter(anEC, itFD) )
+ {
+ mFormulaTruthTable[ itFD->offset ] = true;
+
+ // OK
+ }
+ }
+}
+
+
+bool FormulaCoverageFilter::checkFormulaAfter(
+ ExecutionContext * anEC, FormulaData * aFD)
+{
+ APExecutionData apED;
+ avm_size_t succesCount = 0;
+
+ // Recherche des formules couvertes par les fils de anEC
+ ExecutionContext::child_iterator endEC = anEC->end();
+
+ switch( aFD->formula.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ const BFCode & aFormula = aFD->formula.bfCode();
+
+ switch( aFormula->getAvmOpCode() )
+ {
+ case AVM_OPCODE_OBS :
+ {
+ const BFCode & evtFormula = aFormula->first().bfCode();
+
+ const BF & constraintFormula = aFormula->second();
+
+ switch( evtFormula->getAvmOpCode() )
+ {
+ case AVM_OPCODE_INPUT :
+ case AVM_OPCODE_OUTPUT :
+ {
+ if( evtFormula->first().is< BaseInstanceForm >() )
+ {
+ BaseInstanceForm * ioInstance =
+ evtFormula->first().to_ptr< BaseInstanceForm >();
+
+ if( ioInstance->is< InstanceOfPort >() )
+ {
+ BF anExecFormula;
+
+ ExecutionContext::child_iterator itEC = anEC->begin();
+ for( ; itEC != endEC ; ++itEC )
+ {
+ apED = (*itEC)->getAPExecutionData();
+
+ BFCode ioTrace = ENV.searchTraceIO(
+ (*itEC)->getIOElementTrace(), evtFormula);
+
+ if( ioTrace.valid() )
+ {
+ anExecFormula = ENV.ioSubst( apED,
+ &mLocalExecutableForm, evtFormula,
+ ioTrace, constraintFormula );
+
+ if( checksatFormula(*itEC, anExecFormula, aFD) )
+ {
+ ++succesCount;
+ // OK
+ }
+ }
+ }
+ }
+ else if( ioInstance->is< InstanceOfData >() )
+ {
+ ExecutionContext::child_iterator itEC = anEC->begin();
+ for( ; itEC != endEC ; ++itEC )
+ {
+ apED = (*itEC)->getAPExecutionData();
+
+ if( ENV.isAssigned(apED, apED->getSystemRID(),
+ ioInstance->to< InstanceOfData >()) )
+ {
+ ENV.eval(apED, apED->getSystemRID(), constraintFormula);
+
+ if( checksatFormula(*itEC, ENV.outVAL, aFD) )
+ {
+ ++succesCount;
+ // OK
+ }
+ }
+ }
+ }
+ else
+ {
+ ++succesCount;
+ // OK
+ }
+ }
+
+ break;
+ }
+
+
+ default:
+ {
+ ExecutionContext::child_iterator itEC = anEC->begin();
+ for( ; itEC != endEC ; ++itEC )
+ {
+ apED = (*itEC)->getAPExecutionData();
+
+ ENV.eval(apED, apED->getSystemRID(), evtFormula);
+
+ if( ENV.outVAL.isEqualTrue() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+ AVM_OS_TRACE << " ==> Constraint Formula:> " << constraintFormula.str()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+
+ ENV.evalCondition(constraintFormula);
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+ AVM_OS_TRACE << " ==> EC<" << (*itEC)->getIdNumber()
+ << "> |=?= anExecFormula:> " << ENV.outVAL.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+
+ if( checksatFormula(*itEC, ENV.outVAL, aFD) )
+ {
+ ++succesCount;
+ // OK
+ }
+ }
+ }
+ break;
+ }
+
+ break;
+ }
+ }
+ default:
+ {
+ ExecutionContext::child_iterator itEC = anEC->begin();
+ for( ; itEC != endEC ; ++itEC )
+ {
+ apED = (*itEC)->getAPExecutionData();
+
+ ENV.eval(apED, apED->getSystemRID(), aFormula);
+
+ if( checksatFormula(*itEC, ENV.outVAL, aFD) )
+ {
+ ++succesCount;
+ // OK
+ }
+ }
+
+ break;
+ }
+ }
+
+ break;
+ }
+
+ default:
+ {
+ ExecutionContext::child_iterator itEC = anEC->begin();
+ for( ; itEC != endEC ; ++itEC )
+ {
+ apED = (*itEC)->getAPExecutionData();
+
+ ENV.eval(apED, apED->getSystemRID(), aFD->formula);
+
+ if( checksatFormula(*itEC, ENV.outVAL, aFD) )
+ {
+ ++succesCount;
+ // OK
+ }
+ }
+
+ break;
+ }
+ }
+
+ return( succesCount > 0 );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// CHECK MOC
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool FormulaCoverageFilter::checksatMoc(const BF & aMoc)
+{
+ switch( aMoc.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ const BFCode & aCode = aMoc.bfCode();
+
+ switch ( aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_NOT:
+ {
+ return( not checksatMoc(aCode->first()) );
+ }
+
+ case AVM_OPCODE_AND:
+ case AVM_OPCODE_STRONG_SYNCHRONOUS:
+ {
+ AvmCode::iterator itForm = aCode->begin();
+ AvmCode::iterator endForm = aCode->end();
+ for( ; itForm != endForm ; ++itForm )
+ {
+ if( not checksatMoc(*itForm) )
+ {
+ return( false );
+ }
+ }
+ return( true );
+ }
+
+ case AVM_OPCODE_OR:
+ case AVM_OPCODE_WEAK_SYNCHRONOUS:
+ {
+ AvmCode::iterator itForm = aCode->begin();
+ AvmCode::iterator endForm = aCode->end();
+ for( ; itForm != endForm ; ++itForm )
+ {
+ if( checksatMoc(*itForm) )
+ {
+ return( true );
+ }
+ }
+ return( false );
+ }
+
+ case AVM_OPCODE_XOR:
+ case AVM_OPCODE_EXCLUSIVE:
+ {
+ avm_size_t nbTrue = 0;
+
+ AvmCode::iterator itForm = aCode->begin();
+ AvmCode::iterator endForm = aCode->end();
+ for( ; itForm != endForm ; ++itForm )
+ {
+ if( checksatMoc(*itForm) )
+ {
+ ++nbTrue;
+ }
+ }
+ return( nbTrue == 1 );
+ }
+
+ case AVM_OPCODE_NAND:
+ {
+ AvmCode::iterator itForm = aCode->begin();
+ AvmCode::iterator endForm = aCode->end();
+ for( ; itForm != endForm ; ++itForm )
+ {
+ if( not checksatMoc(*itForm) )
+ {
+ return( true );
+ }
+ }
+ return( false );
+ }
+
+ case AVM_OPCODE_NOR:
+ {
+ AvmCode::iterator itForm = aCode->begin();
+ AvmCode::iterator endForm = aCode->end();
+ for( ; itForm != endForm ; ++itForm )
+ {
+ if( checksatMoc(*itForm) )
+ {
+ return( false );
+ }
+ }
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+ return( false );
+ }
+
+ case FORM_EXEC_FILTER_FORMULA_DATA_KIND:
+ {
+ return( mFormulaTruthTable[ aMoc.to_ptr< FormulaData >()->offset ] );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+void FormulaCoverageFilter::mocAppendFormulaLink(const BF & aMoc)
+{
+ switch( aMoc.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ AvmCode::iterator itForm = aMoc.to_ptr< AvmCode >()->begin();
+ AvmCode::iterator endForm = aMoc.to_ptr< AvmCode >()->end();
+ for( ; itForm != endForm ; ++itForm )
+ {
+ mocAppendFormulaLink( *itForm );
+ }
+ break;
+ }
+
+ case FORM_EXEC_FILTER_FORMULA_DATA_KIND:
+ {
+ (mFormulaLinkTable[ aMoc.to_ptr< FormulaData >()->offset ])++;
+ break;
+ }
+
+ default:
+ {
+ //!!! NOTHING
+ break;
+ }
+ }
+}
+
+void FormulaCoverageFilter::mocRemoveFormulaLink(const BF & aMoc)
+{
+ switch( aMoc.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ AvmCode::iterator itForm = aMoc.to_ptr< AvmCode >()->begin();
+ AvmCode::iterator endForm = aMoc.to_ptr< AvmCode >()->end();
+ for( ; itForm != endForm ; ++itForm )
+ {
+ mocRemoveFormulaLink( *itForm );
+ }
+ break;
+ }
+
+ case FORM_EXEC_FILTER_FORMULA_DATA_KIND:
+ {
+ (mFormulaLinkTable[ aMoc.to_ptr< FormulaData >()->offset ])--;
+ break;
+ }
+
+ default:
+ {
+ //!!! NOTHING
+ break;
+ }
+ }
+}
+
+void FormulaCoverageFilter::mocUpdateUncoveredFormula()
+{
+ BFList::iterator itForm = mListOfUncoveredFormula.begin();
+ for( ; itForm != mListOfUncoveredFormula.end() ; )
+ {
+ if( mFormulaLinkTable[ (*itForm).to_ptr< FormulaData >()->offset ] < 0 )
+ {
+ itForm = mListOfUncoveredFormula.erase(itForm);
+ }
+ else
+ {
+ ++itForm;
+ }
+ }
+}
+
+
+void FormulaCoverageFilter::checkMoc(ExecutionContext * anEC)
+{
+ FormulaData * itFD;
+ BFList::iterator itForm = mListOfUnCoveredMoc.begin();
+ for( ; itForm != mListOfUnCoveredMoc.end() ; )
+ {
+ itFD = (*itForm).to_ptr< FormulaData >();
+
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+ AVM_OS_TRACE << " ==> checkMoc " << itFD->str() << std::endl;
+//AVM_ANDIF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+
+ if( ((not mMocTruthTable[ itFD->offset ]) || (not mMinimizationFlag))
+ && checksatMoc(itFD->formula) )
+ {
+ mMocCoverageStatistics.addCoveredElement();
+
+AVM_IF_DEBUG_FLAG( PROCESSOR )
+ mMocCoverageStatistics.toStreamCoverageRate(AVM_OS_TRACE,
+ "Moc Coverage: ", " / ", " :> ");
+ AVM_OS_TRACE << itFD->str() << std::endl;
+ AVM_OS_TRACE << REPEAT("********", 10) << std::endl;
+
+ mMocCoverageStatistics.toStreamCoverageRate(AVM_OS_TRACE,
+ "Moc Coverage: ", " / ", " :> ");
+ AVM_OS_COUT << itFD->str() << std::endl;
+ AVM_OS_COUT << REPEAT("********", 10) << std::endl;
+AVM_ENDIF_DEBUG_FLAG( PROCESSOR )
+
+
+ mMocTruthTable[ itFD->offset ] = true;
+
+ mocRemoveFormulaLink( itFD->formula );
+
+
+ anEC->getwFlags().addCoverageElementTrace();
+
+ anEC->addInfo(*this, ExpressionConstructor::newString( itFD->label ));
+
+ anEC->getUniqInformation()->
+ getUniqFormulaCoverageFilterInfo()->appendMoc( *itForm );
+
+ itFD->satEC.append( anEC );
+
+ if( mBreakFlag )
+ {
+ anEC->getExecutionData()->setAEES( AEES_STMNT_EXIT );
+ }
+
+ itForm = mListOfUnCoveredMoc.erase(itForm);
+ }
+ else
+ {
+ ++itForm;
+ }
+ }
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// FormulaCoverageFilter Information
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Serialization
+ */
+void FormulaCoverageFilterInfo::toStream(OutStream & os) const
+{
+ if( mFormulaTable.nonempty() )
+ {
+ os << TAB << "FORMULA{" << EOL_INCR_INDENT;
+
+ BFList::const_iterator itForm = mFormulaTable.begin();
+ BFList::const_iterator endForm = mFormulaTable.end();
+ for( ; itForm != endForm ; ++itForm )
+ {
+ (*itForm).to_ptr< FormulaData >()->toStream(os);
+ }
+ os << DECR_INDENT_TAB << "}" << EOL_FLUSH;
+ }
+
+ if( mFormulaTable.nonempty() )
+ {
+ os << TAB << "FORMULA_MOC{" << EOL_INCR_INDENT;
+
+ BFList::const_iterator itForm = mMocTable.begin();
+ BFList::const_iterator endForm = mMocTable.end();
+ for( ; itForm != endForm ; ++itForm )
+ {
+ (*itForm).to_ptr< FormulaData >()->toStream(os);
+ }
+ os << DECR_INDENT_TAB << "}" << EOL_FLUSH;
+ }
+}
+
+void FormulaCoverageFilterInfo::toFscn(OutStream & os) const
+{
+ if( mFormulaTable.nonempty() )
+ {
+ os << TAB << "FORMULA{" << EOL_INCR_INDENT;
+
+ BFList::const_iterator itForm = mFormulaTable.begin();
+ BFList::const_iterator endForm = mFormulaTable.end();
+ for( ; itForm != endForm ; ++itForm )
+ {
+ (*itForm).to_ptr< FormulaData >()->toFscn(os);
+ }
+ os << DECR_INDENT_TAB << "}" << EOL << std::flush;
+ }
+
+ if( mMocTable.nonempty() )
+ {
+ os << TAB << "FORMULA_MOC{" << EOL_INCR_INDENT;
+
+ BFList::const_iterator itForm = mMocTable.begin();
+ BFList::const_iterator endForm = mMocTable.end();
+ for( ; itForm != endForm ; ++itForm )
+ {
+ (*itForm).to_ptr< FormulaData >()->toFscn(os);
+ }
+ os << DECR_INDENT_TAB << "}" << EOL_FLUSH;
+ }
+}
+
+
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fam/coverage/FormulaCoverageFilter.h b/org.eclipse.efm.symbex/src/fam/coverage/FormulaCoverageFilter.h
new file mode 100644
index 0000000..43f8777
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/coverage/FormulaCoverageFilter.h
@@ -0,0 +1,443 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 23 juil. 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef FORMULACOVERAGEFILTER_H_
+#define FORMULACOVERAGEFILTER_H_
+
+#include <fam/coverage/BaseCoverageFilter.h>
+
+#include <common/AvmPointer.h>
+#include <common/Element.h>
+#include <common/BF.h>
+
+#include <collection/Bitset.h>
+#include <collection/Typedef.h>
+
+#include <fml/executable/ExecutableForm.h>
+
+#include <sew/Configuration.h>
+
+#include <solver/api/SolverDef.h>
+
+
+namespace sep
+{
+
+class AvmCode;
+class ExecutionContext;
+class WObject;
+class SatSolver;
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// FormulaData
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+class FormulaData : public Element ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( FormulaData )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( FormulaData )
+
+
+public:
+ /**
+ * ATTRIBUTES
+ */
+ BF formula;
+ std::string label;
+ avm_offset_t offset;
+
+ Element * compiled;
+
+ ListOfExecutionContext satEC;
+
+
+public:
+ FormulaData(const BF & aFormula, const std::string & aLabel,
+ avm_offset_t anOffset, Element * favmFormula)
+ : Element( CLASS_KIND_T( FormulaData ) ),
+ formula( aFormula ),
+ label( aLabel ),
+ offset( anOffset ),
+
+ compiled( favmFormula ),
+ satEC( )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~FormulaData()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ ***************************************************************************
+ * SERIALIZATION
+ ***************************************************************************
+ */
+
+ virtual void report(OutStream & os) const;
+
+
+ inline std::string str() const
+ {
+ StringOutStream oss( AVM_NO_INDENT );
+
+ toStream(oss);
+
+ return( oss.str() );
+ }
+
+ inline void toStream(OutStream & os) const
+ {
+ os << TAB << "<< " << offset << ":" << label << ": "
+ << formula.str() << " >>" << EOL_FLUSH;
+ }
+
+ inline void toFscn(OutStream & os) const
+ {
+ os << TAB << str() << EOL << std::flush;
+ }
+
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// FormulaCoverageFilter
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+class FormulaCoverageFilter :
+ public AutoRegisteredCoverageProcessorUnit< FormulaCoverageFilter >
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( FormulaCoverageFilter )
+
+
+ /**
+ * PROCESSOR FACTORY
+ * for automatic registration in the processor repository
+ * the [ [ FULLY ] QUALIFIED ] NAME ID
+ */
+ AVM_INJECT_AUTO_REGISTER_QUALIFIED_ID_KEY_2(
+ "avm::processor.FORMULA_COVERAGE",
+ "avm::core.filter.FORMULA_COVERAGE" )
+ // end registration
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ SolverDef::SOLVER_KIND mSolverKind;
+
+ ExecutableForm mLocalExecutableForm;
+
+ BF mTrigger;
+
+
+ BFVector mFormulaTable;
+ BFList mListOfUncoveredFormula;
+
+ Bitset mFormulaTruthTable;
+ VectorOfInt mFormulaLinkTable;
+
+
+ BFVector mMocTable;
+ BFList mListOfUnCoveredMoc;
+
+ Bitset mMocTruthTable;
+ VectorOfInt mMocLinkTable;
+
+ AvmCoverageStatistics mMocCoverageStatistics;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ FormulaCoverageFilter(
+ SymbexControllerUnitManager & aManager, WObject * wfParameterObject)
+ : RegisteredCoverageProcessorUnit(aManager, wfParameterObject,
+ AVM_PREPOST_FILTERING_STAGE, PRECEDENCE_OF_FORMULA_COVERAGE),
+ mSolverKind( SolverDef::SOLVER_UNDEFINED_KIND ),
+ mLocalExecutableForm( getConfiguration().getExecutableSystem() , 0 ),
+ mTrigger( ),
+
+ mFormulaTable( ),
+ mListOfUncoveredFormula(),
+ mFormulaTruthTable(),
+ mFormulaLinkTable( ),
+
+ mMocTable( ),
+ mListOfUnCoveredMoc(),
+ mMocTruthTable(),
+ mMocLinkTable( ),
+ mMocCoverageStatistics( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~FormulaCoverageFilter()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONFIGURE
+ */
+ virtual bool configureImpl();
+
+
+ /**
+ * REPORT TRACE
+ */
+ virtual void reportDefault(OutStream & os) const;
+
+
+ /**
+ * postEval Filter
+ */
+ virtual bool postfilter(ExecutionContext & anEC);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CHECK FORMULA
+ ////////////////////////////////////////////////////////////////////////////
+ bool checksatFormula(ExecutionContext * anEC,
+ const BF & aFormula, FormulaData * aFD);
+
+ void checkFormula(ExecutionContext * anEC);
+ bool checkFormula(ExecutionContext * anEC, FormulaData * aFD);
+
+ void checkFormulaAfter(ExecutionContext * anEC);
+ bool checkFormulaAfter(ExecutionContext * anEC, FormulaData * aFD);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CHECK MOC
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool checksatMoc(const BF & aMoc);
+
+ void mocAppendFormulaLink(const BF & aMoc);
+ void mocRemoveFormulaLink(const BF & aMoc);
+ void mocUpdateUncoveredFormula();
+
+ void checkMoc(ExecutionContext * anEC);
+
+
+ /*
+ * GETTER
+ * mTrigger
+ */
+ inline void setTrigger(const BF & aTrigger)
+ {
+ mTrigger = aTrigger;
+ }
+
+ inline BF & getTrigger()
+ {
+ return( mTrigger);
+ }
+
+ /*
+ * GETTER
+ * mVectorOfFormula
+ */
+ BF appendFormula(const BF & aFormula,
+ const std::string & label, Element * favmFormula = NULL);
+
+ inline BF & getFormula(const std::string & label)
+ {
+ BFVector::iterator itForm = mFormulaTable.begin();
+ BFVector::iterator endForm = mFormulaTable.end();
+ for( ; itForm != endForm ; ++itForm )
+ {
+ if( (*itForm).to_ptr< FormulaData >()->label == label )
+ {
+ return( *itForm );
+ }
+ }
+
+ return( BF::REF_NULL );
+ }
+
+
+ inline BFVector & getFormulaTable()
+ {
+ return( mFormulaTable );
+ }
+
+
+ /*
+ * GETTER
+ * mListOfUncoveredFormula
+ */
+ inline const BFList & getListOfUnCoveredFormula() const
+ {
+ return( mListOfUncoveredFormula );
+ }
+
+
+ /*
+ * GETTER
+ * mVectorOfMoc
+ */
+ BF appendMoc(const BF & aMoc,
+ const std::string & label, Element * favmFormula = NULL);
+
+ inline BFVector & getMocTable()
+ {
+ return( mMocTable );
+ }
+
+ BF buildMoc(const BF & aMoc);
+
+};
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// FormulaCoverageFilter Information
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class FormulaCoverageFilterInfo :
+ public Element ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( FormulaCoverageFilterInfo )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( FormulaCoverageFilterInfo )
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ BFList mFormulaTable;
+
+ BFList mMocTable;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ FormulaCoverageFilterInfo()
+ : Element( CLASS_KIND_T( FormulaCoverageFilterInfo ) ),
+ mFormulaTable( ),
+ mMocTable( )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ FormulaCoverageFilterInfo(const FormulaCoverageFilterInfo & anInfo)
+ : Element( anInfo ),
+ mFormulaTable(anInfo.mFormulaTable),
+ mMocTable( anInfo.mMocTable )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~FormulaCoverageFilterInfo()
+ {
+ //!! NOTHING
+ }
+
+ /*
+ * GETTER -- SETTER
+ * mFormulaTable
+ */
+ inline void appendFormula(const BF & aFD)
+ {
+ mFormulaTable.append( aFD );
+ }
+
+ inline BFList & getFormulaTable()
+ {
+ return( mFormulaTable );
+ }
+
+
+ /*
+ * GETTER -- SETTER
+ * mMocTable
+ */
+ inline void appendMoc(BF & aFD)
+ {
+ mMocTable.append( aFD );
+ }
+
+ inline void appendMoc(BFList & aTable)
+ {
+ mMocTable.append( aTable );
+ }
+
+ inline void appendMoc(BFVector & aTable)
+ {
+ mMocTable.append( aTable );
+ }
+
+ inline BFList & getMocTable()
+ {
+ return( mMocTable );
+ }
+
+
+ /**
+ * Serialization
+ */
+ void toStream(OutStream & os) const;
+
+ void toFscn(OutStream & os) const;
+
+};
+
+
+
+}
+
+#endif /* FORMULACOVERAGEFILTER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/coverage/StatemachineReachability.cpp b/org.eclipse.efm.symbex/src/fam/coverage/StatemachineReachability.cpp
new file mode 100644
index 0000000..6948f4d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/coverage/StatemachineReachability.cpp
@@ -0,0 +1,371 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 16 juil. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "StatemachineReachability.h"
+
+#include <fam/coverage/BaseCoverageFilter.h>
+
+#include <fml/executable/AvmTransition.h>
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/ExecutableQuery.h>
+#include <fml/executable/ExecutableSystem.h>
+
+#include <fml/infrastructure/BehavioralPart.h>
+
+#include <fml/workflow/WObject.h>
+
+#include <sew/Configuration.h>
+
+
+namespace sep
+{
+
+/**
+ * Backward Reachability Analysis
+ */
+bool StatemachineReachability::computeBackwardReachableComponent(
+ const Configuration & aConfiguration)
+{
+ avm_size_t currentBackwardDepth = 0;
+
+ const Machine * aMachine;
+ AvmTransition * aCompiledTransition;
+ InstanceOfMachine * aSourceState;
+
+ const TableOfExecutableForm & executables =
+ aConfiguration.getExecutableSystem().getExecutables();
+
+ ListOfExecutableForm listOfTreatedStates;
+
+ TableOfExecutableForm::const_raw_iterator itExec = executables.begin();
+ TableOfExecutableForm::const_raw_iterator endExec = executables.end();
+
+ if( mBackwardAnalysisLookaheadDepth >= 1 )
+ {
+ ExecutableQuery XQuery( aConfiguration );
+
+ // Pour tous les états itExec
+ // on rajoute les transitions immédiatement entrantes dans BackwardReachableTransition
+ for( ; itExec != endExec ; ++itExec )
+ {
+ if( (itExec)->hasPrototypeInstance() )
+ {
+ aMachine = (itExec)->getAstMachine();
+ if( aMachine->hasIncomingTransition() )
+ {
+ // Pour l'état itExec on rajoute :
+ // - les transitions entrantes à la liste des BackwardReachableTransition
+ // - les états sources des transitions entrantes à la liste des BackwardReachableMachine
+ //
+ BehavioralPart::const_transition_iterator itTransition =
+ aMachine->getBehavior()->incoming_transition_begin();
+ BehavioralPart::const_transition_iterator endTransition =
+ aMachine->getBehavior()->incoming_transition_end();
+ for( ; itTransition != endTransition ; ++itTransition )
+ {
+ aCompiledTransition = XQuery.getTransitionByAstElement(
+ (itTransition) ).to_ptr< AvmTransition >();
+ (itExec)->addBackwardReachableTransition( aCompiledTransition );
+
+ aSourceState = aCompiledTransition->
+ getExecutableContainer()->getPrototypeInstance();
+ if( (aSourceState != NULL)
+ && ((itExec) != aSourceState->getExecutable())
+ && (not (itExec)->getBackwardReachableMachine().
+ contains( aSourceState )) )
+ {
+ (itExec)->addBackwardReachableMachine( aSourceState );
+ }
+ }
+ }
+ }
+ }
+ currentBackwardDepth = 1;
+ }
+
+ if( mBackwardAnalysisLookaheadDepth > currentBackwardDepth )
+ {
+ // Pour tous les états itExec, on ajoute par récursivité :
+ // - les transitions arrières non directement entrantes
+ // dans BackwardReachableTransition
+ // - les états sources de toutes les transitions arrières
+ // non directement entrantes dans BackwardReachableMachine
+ //
+ for( itExec = executables.begin() ; itExec != endExec ; ++itExec )
+ {
+ if( (itExec)->hasPrototypeInstance() )
+ {
+ computeBackwardReachableComponent( aConfiguration,
+ (itExec), listOfTreatedStates, currentBackwardDepth );
+ }
+ }
+ }
+
+ // Pour tous les états itExec :
+ // élimination de l'état itExec dans la liste BackwardReachableMachine
+ //
+ for( itExec = executables.begin() ; itExec != endExec ; ++itExec )
+ {
+ if( (itExec)->hasPrototypeInstance() )
+ {
+ if( (itExec)->getBackwardReachableMachine().nonempty() )
+ {
+ (itExec)->removeBackwardReachableMachine(
+ (itExec)->getPrototypeInstance() );
+ }
+
+ if( (itExec)->hasTransition()
+ && (not (itExec)->getSpecifier().
+ isPseudostateInitialOrStateStart())
+ && (not (itExec)->hasBackwardReachableMachine()) )
+ {
+ (itExec)->setReachableState( false );
+ }
+ }
+ }
+
+
+
+ // Affichage du résultat dans le fichier trace
+ //
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , CONFIGURING )
+
+ AVM_OS_TRACE << AVM_TAB1_INDENT;
+
+ for( itExec = executables.begin() ; itExec != endExec ; ++itExec )
+ {
+ if( (itExec)->hasPrototypeInstance() )
+ {
+ AVM_OS_TRACE << "Statemachine Reachability:> "
+ "compute backward reachable state/transition"
+ << std::endl
+ << TAB << "state :> "
+ << (itExec)->getFullyQualifiedNameID()
+ << std::endl
+ << "nb backward states :> "
+ << (itExec)->getBackwardReachableMachine().size()
+ << std::endl
+ << "nb backward transitions :> "
+ << (itExec)->getBackwardReachableTransition().size()
+ << std::endl;
+
+ AVM_IF_DEBUG_LEVEL_GTE_HIGH
+ ListOfInstanceOfMachine::iterator itState =
+ (itExec)->getBackwardReachableMachine().begin();
+ ListOfInstanceOfMachine::iterator endState =
+ (itExec)->getBackwardReachableMachine().end();
+ for( ; itState != endState ; ++itState )
+ {
+ AVM_OS_TRACE << TAB2 << "backward state :> "
+ << (* itState)->getFullyQualifiedNameID()
+ << std::endl;
+ }
+ AVM_ENDIF_DEBUG_LEVEL_GTE_HIGH
+
+ AVM_IF_DEBUG_LEVEL_FLAG( HIGH , TRANSITION )
+ ListOfAvmTransition::iterator itTransition =
+ (itExec)->getBackwardReachableTransition().begin();
+ ListOfAvmTransition::iterator endTransition =
+ (itExec)->getBackwardReachableTransition().end();
+ for( ; itTransition != endTransition ; ++itTransition )
+ {
+ AVM_OS_TRACE << TAB2 << "backward transition :> "
+ << (* itTransition)->getFullyQualifiedNameID()
+ << std::endl;
+ }
+ AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , TRANSITION )
+ }
+ }
+
+ AVM_OS_TRACE << END_INDENT;
+
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , CONFIGURING )
+
+ return( true );
+}
+
+
+void StatemachineReachability::computeBackwardReachableComponent(
+ const Configuration & aConfiguration, ExecutableForm * aState,
+ ListOfExecutableForm & aListOfTreatedStates,
+ avm_size_t theCurrentBackwardDepth)
+{
+
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+// AVM_OS_TRACE << "\t" << "state :> " << aState->getFullyQualifiedNameID()
+// << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ AvmTransition * aCompiledTransition;
+ ExecutableForm * aSourceState;
+ ExecutableForm * aContainerState;
+
+ const Machine * aMachine = aState->getAstMachine();
+ if( aMachine->hasIncomingTransition() )
+ {
+ ExecutableQuery XQuery( aConfiguration );
+
+ theCurrentBackwardDepth += 1;
+
+ // Pour chaque transition entrante
+ BehavioralPart::const_transition_iterator itTransition =
+ aMachine->getBehavior()->incoming_transition_begin();
+ BehavioralPart::const_transition_iterator endTransition =
+ aMachine->getBehavior()->incoming_transition_end();
+ for( ; itTransition != endTransition ; ++itTransition )
+ {
+ aCompiledTransition = XQuery.getTransitionByAstElement(
+ (itTransition) ).to_ptr< AvmTransition >();
+ aSourceState = aCompiledTransition->getExecutableContainer();
+
+ if( aSourceState->getSpecifier().
+ isPseudostateInitialOrStateStart() )
+ {
+ aContainerState = aSourceState->getExecutableContainer();
+ if( not aListOfTreatedStates.contains( aContainerState ) )
+ {
+ aListOfTreatedStates.append( aContainerState );
+ if( mBackwardAnalysisLookaheadDepth > theCurrentBackwardDepth )
+ {
+ computeBackwardReachableComponent(
+ aConfiguration, aContainerState,
+ aListOfTreatedStates, theCurrentBackwardDepth );
+ }
+
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+// AVM_OS_TRACE << "\t" << "aContainerState :> "
+// << aContainerState->getFullyQualifiedNameID() << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ }
+ aState->addBackwardReachableTransition(
+ aContainerState->getBackwardReachableTransition() );
+ aState->addBackwardReachableMachine(
+ aContainerState->getBackwardReachableMachine() );
+ }
+ else
+ {
+ if( not aListOfTreatedStates.contains( aSourceState ) )
+ {
+ aListOfTreatedStates.append( aSourceState );
+ if( mBackwardAnalysisLookaheadDepth > theCurrentBackwardDepth )
+ {
+ computeBackwardReachableComponent(
+ aConfiguration, aSourceState,
+ aListOfTreatedStates, theCurrentBackwardDepth );
+ }
+
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+// AVM_OS_TRACE << "\t" << "aSourceState :> "
+// << aSourceState->getFullyQualifiedNameID() << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ }
+ aState->addBackwardReachableTransition(
+ aSourceState->getBackwardReachableTransition() );
+ aState->addBackwardReachableMachine(
+ aSourceState->getBackwardReachableMachine() );
+ }
+ }
+ }
+}
+
+
+/**
+ * Forward Reachability Analysis
+ */
+bool StatemachineReachability::computeForwardReachableComponent(
+ const Configuration & aConfiguration)
+{
+ const TableOfExecutableForm & executables =
+ aConfiguration.getExecutableSystem().getExecutables();
+
+ ListOfInstanceOfMachine::iterator itMachine;
+ ListOfInstanceOfMachine::iterator endMachine;
+
+ TableOfExecutableForm::const_raw_iterator itExec = executables.begin();
+ TableOfExecutableForm::const_raw_iterator endExec = executables.end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ if( (itExec)->getSpecifier().
+ isPseudostateInitialOrStateStart() )
+ {
+ ListOfExecutableForm aTraceMachine( (itExec) );
+
+ computeForwardReachableComponent(
+ (itExec), aTraceMachine, (itExec));
+
+ itMachine = (itExec)->getForwardReachableMachine().begin();
+ endMachine = (itExec)->getForwardReachableMachine().end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ if( (*itMachine) != NULL )
+ {
+ ListOfExecutableForm newTraceMachine(
+ (*itMachine)->getExecutable() );
+
+ computeForwardReachableComponent(
+ (*itMachine)->getExecutable(),
+ newTraceMachine, (*itMachine)->getExecutable());
+ }
+ }
+ }
+ }
+
+ for( itExec = executables.begin() ; itExec != endExec ; ++itExec )
+ {
+ if( (itExec)->getForwardReachableMachine().nonempty() &&
+ (itExec)->hasPrototypeInstance() )
+ {
+ (itExec)->removeForwardReachableMachine(
+ (itExec)->getPrototypeInstance() );
+ }
+ }
+
+ return( true );
+}
+
+
+void StatemachineReachability::computeForwardReachableComponent(
+ ExecutableForm * execMachine,
+ ListOfExecutableForm & aTraceMachine, ExecutableForm * fwdMachine)
+{
+ ListOfAvmTransition listOfOutgoingTransition;
+ fwdMachine->getOutgoingTransition( listOfOutgoingTransition );
+
+ ListOfInstanceOfMachine listOfOutgoingMachine;
+ fwdMachine->getOutgoingMachine( listOfOutgoingMachine );
+
+ execMachine->addForwardReachableMachine(listOfOutgoingMachine);
+
+ execMachine->addForwardReachableTransition(listOfOutgoingTransition);
+
+ ListOfInstanceOfMachine::iterator itOutgoing = listOfOutgoingMachine.begin();
+ ListOfInstanceOfMachine::iterator endOutgoing = listOfOutgoingMachine.end();
+ for( ; itOutgoing != endOutgoing ; ++itOutgoing )
+ {
+ if( not aTraceMachine.contains( (*itOutgoing)->getExecutable() ) )
+ {
+ ListOfExecutableForm newTraceMachine( aTraceMachine );
+
+ newTraceMachine.append( (*itOutgoing)->getExecutable() );
+
+ computeForwardReachableComponent(execMachine,
+ newTraceMachine, (*itOutgoing)->getExecutable());
+ }
+ }
+}
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/coverage/StatemachineReachability.h b/org.eclipse.efm.symbex/src/fam/coverage/StatemachineReachability.h
new file mode 100644
index 0000000..b5d8465
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/coverage/StatemachineReachability.h
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 16 juil. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef STATEMACHINEREACHABILITY_H_
+#define STATEMACHINEREACHABILITY_H_
+
+#include <collection/Typedef.h>
+
+
+namespace sep
+{
+
+
+class AvmProgram;
+class BaseCoverageFilter;
+class Configuration;
+class InstanceOfMachine;
+
+
+class StatemachineReachability
+{
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ BaseCoverageFilter & mCoverageFilter;
+
+ avm_size_t mBackwardAnalysisLookaheadDepth;
+ avm_size_t mForwardAnalysisLookaheadDepth;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ StatemachineReachability(BaseCoverageFilter & aCoverageFilter)
+ : mCoverageFilter( aCoverageFilter ),
+ mBackwardAnalysisLookaheadDepth( AVM_NUMERIC_MAX_SIZE_T ),
+ mForwardAnalysisLookaheadDepth ( AVM_NUMERIC_MAX_SIZE_T )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~StatemachineReachability()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * Reachability Analysis
+ */
+ inline bool computeReachableComponent(
+ const Configuration & aConfiguration,
+ avm_size_t aBackwardAnalysisLookaheadDepth)
+ {
+ mBackwardAnalysisLookaheadDepth = aBackwardAnalysisLookaheadDepth;
+
+ bool isOK = computeBackwardReachableComponent( aConfiguration );
+
+ return( computeForwardReachableComponent(aConfiguration) || isOK );
+ }
+
+
+ /**
+ * Backward Reachability Analysis
+ */
+ bool computeBackwardReachableComponent(const Configuration & aConfiguration);
+
+ void computeBackwardReachableComponent(
+ const Configuration & aConfiguration, ExecutableForm * aState,
+ ListOfExecutableForm & aListOfTreatedStates,
+ avm_size_t theCurentBackwardDepth);
+
+
+ /**
+ * Forward Reachability Analysis
+ */
+ bool computeForwardReachableComponent(const Configuration & aConfiguration);
+
+ void computeForwardReachableComponent(ExecutableForm * execMachine,
+ ListOfExecutableForm & aTraceMachine, ExecutableForm * fwdMachine);
+
+};
+
+} /* namespace sep */
+#endif /* STATEMACHINEREACHABILITY_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/coverage/TransitionCoverageFilter.cpp b/org.eclipse.efm.symbex/src/fam/coverage/TransitionCoverageFilter.cpp
new file mode 100644
index 0000000..dcc1568
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/coverage/TransitionCoverageFilter.cpp
@@ -0,0 +1,3055 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 25 juil. 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * Alain Faivre (CEA LIST) alain.faivre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "TransitionCoverageFilter.h"
+
+#include <computer/primitive/AvmCommunicationFactory.h>
+
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/ExecutableQuery.h>
+#include <fml/executable/InstanceOfMachine.h>
+
+#include <fml/expression/ExpressionConstructor.h>
+
+#include <fml/common/SpecifierElement.h>
+
+
+#include <fml/runtime/ExecutionConfiguration.h>
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeForm.h>
+#include <fml/runtime/RuntimeID.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <fam/queue/WaitingStrategy.h>
+#include <fam/queue/ExecutionQueue.h>
+
+#include <sew/Configuration.h>
+#include <sew/SymbexControllerRequestManager.h>
+
+
+namespace sep
+{
+
+
+/**
+ ***************************************************************************
+prototype filter::transition_coverage as &avm::core.filter.PROGRAM_COVERAGE is
+ section PROPERTY
+ // Nombre de pas de calcul "cumulés" avant de débuter
+ // la vérification de la couverture
+ @begin_step = 0;
+
+ // Arrète l'exécution dès que la couverture est complète
+ @stop = true;
+
+ // Arrète l'exécution au plutôt
+ @minimize = true;
+
+ // Arrète l'exécution du chemin courant dès qu'un objectif est atteint
+ @break = true;
+
+ // Elagage du graphe des scénarios à la fin de la vérification
+ @slice = true;
+
+ // Active l'utilisation d'heuristique
+ @heuristic = true;
+
+ // choix de l'heuristique de départ
+ // basic | naive | smart | agressive
+ @heuristic#start = 'basic';
+
+ // Nombre d'essais d'heuristiques
+ @heuristic#trials = 7;
+
+ // Critère de satisfaction du succès des heuristiques
+ // taux de couverte / nombre d'élément restant...
+ @objective#rate = 95;
+ @objective#rest = 5;
+
+
+ // Choix des contextes avec des transitions
+ // [ fortement | faiblement | autre ] tirables
+
+ // Limitations temporaire de la profondeur d'exploration
+ @coverage#height = 7;
+
+ // nombre de fois que la limite doit être atteint avant de l'augmenter
+ @coverage#height#reached#limit = 42;
+
+ @hit#strongly#random = false;
+ @hit#strongly#count = 1;
+
+ @hit#weakly#random = false;
+ @hit#weakly#count = 1;
+
+ @hit#other#random = false;
+ @hit#other#count = 1;
+
+ @scope = 'DETAILS'; // 'INSTANCE' | 'FORM' | 'DETAILS'
+ endsection PROPERTY
+
+ // Utilisé pour préciser les machines ou les transitions particulières à couvrir!
+ section DETAILS
+ @form = spec::ascenseur.ascenseur.controler;
+ @instance = spec::ascenseur.ascenseur.enregistrer;
+
+ @transition = spec::ascenseur.ascenseur.aller_a_l_etage.attente.transition#6;
+ endsection DETAILS
+endprototype
+ ***************************************************************************
+ */
+
+
+/**
+ * DESTRUCTOR
+ */
+TransitionCoverageFilter::~TransitionCoverageFilter()
+{
+ if( mExecutableCoverageTable != NULL )
+ {
+ const ExecutionData & anED = getConfiguration().getMainExecutionData();
+
+ avm_size_t endOffset = mTransitionCoverageTable->size();
+ for( avm_size_t i = 0 ; i < endOffset ; ++i )
+ {
+ if( mTransitionCoverageTable->at(i) != mExecutableCoverageTable->
+ at(anED.getRuntime(i).getExecutable()->getOffset()) )
+ {
+ delete( mTransitionCoverageTable->at(i) );
+ }
+ }
+
+ delete( mTransitionCoverageTable );
+
+ endOffset = mExecutableCoverageTable->size();
+ for( avm_size_t i = 0 ; i < endOffset ; ++i )
+ {
+ if( mExecutableCoverageTable->at(i) != NULL )
+ {
+ delete( mExecutableCoverageTable->at(i) );
+ }
+ }
+
+ delete( mExecutableCoverageTable );
+ }
+
+ else if( mTransitionCoverageTable != NULL )
+ {
+ avm_size_t endOffset = mTransitionCoverageTable->size();
+ for( avm_size_t i = 0 ; i < endOffset ; ++i )
+ {
+ if( mTransitionCoverageTable->at(i) != NULL )
+ {
+ delete( mTransitionCoverageTable->at(i) );
+ }
+ }
+
+ delete( mTransitionCoverageTable );
+ }
+}
+
+
+/**
+ * CONFIGURE
+ */
+
+bool TransitionCoverageFilter::configureImpl()
+{
+ // SUPER CONFIGURATION
+ mConfigFlag = BaseCoverageFilter::configureImpl();
+
+ WObject * thePROPERTY = Query::getRegexWSequence(
+ getParameterWObject(), OR_WID2("property", "PROPERTY"));
+
+ if( thePROPERTY != WObject::_NULL_ )
+ {
+ mNbCoverage = Query::getWPropertyPosSizeT(
+ thePROPERTY, "nbCoverage", AVM_NUMERIC_MAX_SIZE_T);
+
+ mCoverageHeight = mCoverageHeightPeriod =
+ Query::getRegexWPropertySizeT(
+ thePROPERTY, CONS_WID2("coverage", "height"), 0);
+
+ mCoverageHeightReachedLimit = Query::getRegexWPropertySizeT(thePROPERTY,
+ CONS_WID4("coverage", "height", "reached", "limit"), 0);
+
+ // Options pour les transitions fortement tirables
+ mHitStronglyRandomFlag = Query::getRegexWPropertyBoolean(
+ thePROPERTY, CONS_WID3("hit", "strongly", "random"), false);
+
+ mHitStronglyCount = Query::getRegexWPropertyPosSizeT(
+ thePROPERTY, CONS_WID3("hit", "strongly", "count"), 1);
+
+ // Options pour les transitions faiblement tirables
+ mHitWeaklyRandomFlag = Query::getRegexWPropertyBoolean(
+ thePROPERTY, CONS_WID3("hit", "weakly", "random"), false);
+
+ mHitWeaklyCount = Query::getRegexWPropertyPosSizeT(
+ thePROPERTY, CONS_WID3("hit", "weakly", "count"), 1);
+
+ // Options pour les autres transitions tirables ?
+ mHitOtherRandomFlag = Query::getRegexWPropertyBoolean(
+ thePROPERTY, CONS_WID3("hit", "other", "random"), false);
+
+ mHitOtherCount = Query::getRegexWPropertyPosSizeT(
+ thePROPERTY, CONS_WID3("hit", "other", "count"), 1);
+
+
+ const ExecutionData & anED = getConfiguration().getMainExecutionData();
+
+ mTransitionCoverageTable = new ArrayOfBitset(
+ anED.getTableOfRuntime().size(), NULL);
+
+ ExecutableQuery XQuery( getConfiguration() );
+
+ XQuery.getRuntimeExecutable( mTableofRuntimeExecutable );
+
+ mScope = Specifier::toDesignKind(
+ Query::getWPropertyString(thePROPERTY, "scope", "MODEL") );
+
+ switch( mScope )
+ {
+ case Specifier::DESIGN_INSTANCE_KIND:
+ {
+ // INITIALISATION de la table de tous les PROGRAM
+ // associés à chacune des INSTANCE...
+ configureInstanceCoverageTableFlag(false);
+
+ break;
+ }
+
+ case Specifier::DESIGN_MODEL_KIND:
+ {
+ // INITIALISATION de la table de tous les PROGRAM
+ // associés à chacune des EXECUTABLE...
+ configureExecutableCoverageTableFlag(false);
+
+ break;
+ }
+
+ default: // for << @scope = 'DETAILS'; >>
+ {
+ WObject * theDETAILS = Query::getRegexWSequence(
+ getParameterWObject(), OR_WID2("details", "DETAILS"));
+
+ if( theDETAILS != WObject::_NULL_ )
+ {
+ ExecutableForm * anExecutable = NULL;
+ AvmTransition * aTransition = NULL;
+
+ ListOfExecutableForm listOfExecutable;
+ ListOfInstanceOfMachine listOfInstance;
+ ListOfAvmTransition listOfTransition;
+
+ WObject::const_iterator itWfO = theDETAILS->owned_begin();
+ WObject::const_iterator endWfO = theDETAILS->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty() )
+ {
+ const std::string & kind = (*itWfO)->getNameID();
+ const std::string & qnid = (*itWfO)->toStringValue();
+
+ if( (kind == "model") || (kind == "form") ||
+ (kind == "executable") )
+ {
+ anExecutable =
+ XQuery.getExecutableByQualifiedNameID(
+ qnid ).to_ptr< ExecutableForm >();
+ if( anExecutable != NULL )
+ {
+ listOfExecutable.append(anExecutable);
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound the machine "
+ << kind << " << " << qnid
+ << " >> as coverage processor parameter:> "
+ << getParameterWObject()
+ ->getFullyQualifiedNameID()
+ << std::endl;
+ }
+ }
+ else if( kind == "instance" )
+ {
+ const BF & anInstance = XQuery.searchMachine(
+ Specifier::DESIGN_INSTANCE_KIND, qnid);
+ if( anInstance.valid() )
+ {
+ listOfInstance.append(
+ anInstance.to_ptr< InstanceOfMachine >());
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound the machine "
+ << kind << " << " << qnid
+ << " >> as coverage processor parameter:> "
+ << getParameterWObject()
+ ->getFullyQualifiedNameID()
+ << std::endl;
+ }
+ }
+ else if( kind == "transition" )
+ {
+ aTransition =
+ XQuery.getTransitionByQualifiedNameID(
+ qnid ).to_ptr< AvmTransition >();
+ if( aTransition != NULL )
+ {
+ listOfTransition.append(aTransition);
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound the "
+ << kind << " << " << qnid
+ << " >> as coverage processor parameter:> "
+ << getParameterWObject()
+ ->getFullyQualifiedNameID()
+ << std::endl;
+ }
+ }
+ else if( kind == "program" )
+ {
+ aTransition =
+ XQuery.getTransitionByQualifiedNameID(
+ qnid ).to_ptr< AvmTransition >();
+ if( aTransition != NULL )
+ {
+ listOfTransition.append(aTransition);
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound the "
+ << kind << " << " << qnid
+ << " >> as coverage processor parameter:> "
+ << getParameterWObject()
+ ->getFullyQualifiedNameID()
+ << std::endl;
+ }
+ }
+ else
+ {
+ AVM_OS_WARN << "Unexpected attribute << "
+ << (*itWfO)->str()
+ << " >> as coverage processor parameter:> "
+ << getParameterWObject()
+ ->getFullyQualifiedNameID()
+ << std::endl;
+ }
+ }
+ }
+
+
+ // INITIALISATION de la table de tous les PROGRAM
+ // associés à chacun des EXECUTABLE...
+ configureExecutableCoverageTableFlag(true);
+
+ ListOfExecutableForm::iterator itExec = listOfExecutable.begin();
+ ListOfExecutableForm::iterator endExec = listOfExecutable.end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ configureExecutableCoverageTableFlag((*itExec), false);
+ }
+
+
+ // Cas des programmes
+ configureTransitionCoverageTableFlag(listOfTransition, false);
+
+
+ // INITIALISATION de la table de tous les PROGRAM
+ // associés à chacune des INSTANCE...
+ ListOfInstanceOfMachine::iterator itInst = listOfInstance.begin();
+ ListOfInstanceOfMachine::iterator endInst = listOfInstance.end();
+ for( ; itInst != endInst ; ++itInst )
+ {
+ if( (*itInst)->getExecutable()->hasTransition() )
+ {
+ configureInstanceCoverageTableFlag(anED,
+ anED.getRuntimeID(*itInst), false);
+ }
+ }
+
+
+ if( mExecutableCoverageTable != NULL)
+ {
+ if( mTransitionCoverageTable != NULL)
+ {
+ // INITIALISATION de la table de tous les PROGRAM
+ // associés à chacune des INSTANCE...
+ configureInstanceCoverageTableFlag();
+ }
+ else
+ {
+ mScope = Specifier::DESIGN_MODEL_KIND;
+ }
+ }
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound section << DETAILS >> "
+ "as coverage processor parameter:> "
+ << getParameterWObject()->getFullyQualifiedNameID()
+ << std::endl;
+ }
+
+ break;
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ AVM_OS_TRACE << "Uncovered Transition Count at the beginning :> "
+ << mCoverageStatistics.mNumberOfElements << std::endl << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ }
+
+
+ if( (mCoverageHeightPeriod == 0) ||
+ (mCoverageHeightPeriod == AVM_NUMERIC_MAX_SIZE_T) )
+ {
+ mCoverageHeight = mCoverageHeightPeriod = 7;
+// mCoverageStatistics.mNumberOfElements;
+ }
+ mCoverageHeightReachedCount = 0;
+ mCoverageHeightReachedFlag = false;
+
+ if( mCoverageHeightReachedLimit == 0 )
+ {
+ mCoverageHeightReachedLimit = mCoverageStatistics.mNumberOfElements;
+ }
+
+
+ enablePreprocess( this );
+
+ return mConfigFlag;
+}
+
+
+void TransitionCoverageFilter::configureExecutableCoverageTableFlag(bool value)
+{
+ if( mExecutableCoverageTable == NULL )
+ {
+ mExecutableCoverageTable = new ArrayOfBitset(
+ getConfiguration().getExecutableSystem().size(), NULL);
+ }
+
+ Bitset * tableOfFlag = NULL;
+ avm_size_t itTransition = 0;
+ avm_size_t endTransition = 0;
+
+ VectorOfExecutableForm::iterator itExec = mTableofRuntimeExecutable.begin();
+ VectorOfExecutableForm::iterator endExec = mTableofRuntimeExecutable.end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ if( (*itExec)->hasTransition() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING , (! value) )
+ AVM_OS_TRACE << "executable :> " << (*itExec)->getFullyQualifiedNameID()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING )
+
+ tableOfFlag = mExecutableCoverageTable->at((*itExec)->getOffset());
+ if( tableOfFlag == NULL )
+ {
+ tableOfFlag = new Bitset(
+ (*itExec)->getTransition().size(), true);
+
+ mExecutableCoverageTable->set(
+ (*itExec)->getOffset(), tableOfFlag);
+ }
+
+ endTransition = (*itExec)->getTransition().size();
+ for( itTransition = 0 ; itTransition < endTransition ; ++itTransition )
+ {
+ if( (not value) && tableOfFlag->test(itTransition) )
+ {
+ tableOfFlag->set(itTransition, value);
+
+ if( not value )
+ {
+ mCoverageStatistics.addUncoveredElement();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ AVM_OS_TRACE << "\t" << "program :> "
+ << (*itExec)->rawTransition(itTransition)->getFullyQualifiedNameID()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ }
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING , (! value) )
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING )
+ }
+ else
+ {
+ mExecutableCoverageTable->set((*itExec)->getOffset(), NULL);
+ }
+ }
+}
+
+
+void TransitionCoverageFilter::configureExecutableCoverageTableFlag(
+ ExecutableForm * anExecutable, bool value)
+{
+ if( mExecutableCoverageTable == NULL )
+ {
+ mExecutableCoverageTable = new ArrayOfBitset(
+ getConfiguration().getExecutableSystem().size(), NULL);
+ }
+
+ if( anExecutable->hasTransition() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING , (! value) )
+ AVM_OS_TRACE << "executable :> " << anExecutable->getFullyQualifiedNameID()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING )
+
+ Bitset * tableOfFlag =
+ mExecutableCoverageTable->at( anExecutable->getOffset() );
+ if( tableOfFlag == NULL )
+ {
+ tableOfFlag = new Bitset(anExecutable->getTransition().size(), true);
+
+ mExecutableCoverageTable->set(anExecutable->getOffset(), tableOfFlag);
+ }
+
+ avm_size_t endTransition = anExecutable->getTransition().size();
+ avm_size_t itTransition = 0;
+ for( ; itTransition < endTransition ; ++itTransition )
+ {
+ if( (! value) && tableOfFlag->test(itTransition) )
+ {
+ tableOfFlag->set(itTransition, value);
+
+ mCoverageStatistics.addUncoveredElement();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ AVM_OS_TRACE << "\t" << "program :> "
+ << anExecutable->rawTransition(itTransition)->getFullyQualifiedNameID()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING , (! value) )
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING )
+ }
+
+ // Cas des sous machine executable
+ if( anExecutable->hasInstanceStatic() )
+ {
+ TableOfSymbol::const_iterator it = anExecutable->instance_static_begin();
+ TableOfSymbol::const_iterator endIt = anExecutable->instance_static_end();
+ for( ; it != endIt ; ++it )
+ {
+ configureExecutableCoverageTableFlag((*it).getExecutable(), value);
+ }
+ }
+}
+
+
+void TransitionCoverageFilter::configureInstanceCoverageTableFlag()
+{
+ if( mExecutableCoverageTable != NULL)
+ {
+ const ExecutionData & anED = getConfiguration().getMainExecutionData();
+
+ RuntimeID aRID;
+
+ if( mTransitionCoverageTable == NULL )
+ {
+ mTransitionCoverageTable = new ArrayOfBitset(
+ anED.getTableOfRuntime().size(), NULL);
+ }
+
+ avm_size_t endMachine = mTransitionCoverageTable->size();
+ for( avm_size_t itMachine = 0 ; itMachine < endMachine ; ++itMachine )
+ {
+ aRID = anED.getRuntimeID(itMachine);
+ if( aRID.getExecutable()->hasTransition() &&
+ (mTransitionCoverageTable->at(itMachine) == NULL) )
+ {
+ mTransitionCoverageTable->set(itMachine,
+ mExecutableCoverageTable->at(
+ aRID.getExecutable()->getOffset()));
+ }
+ }
+ }
+}
+
+
+
+void TransitionCoverageFilter::configureInstanceCoverageTableFlag(bool value)
+{
+ const ExecutionData & anED = getConfiguration().getMainExecutionData();
+ RuntimeID aRID;
+ Bitset * tableOfFlag = NULL;
+
+ avm_size_t itTransition = 0;
+ avm_size_t endTransition = 0;
+
+ if( mTransitionCoverageTable == NULL )
+ {
+ mTransitionCoverageTable = new ArrayOfBitset(
+ anED.getTableOfRuntime().size(), NULL);
+ }
+
+ avm_size_t endMachine = mTransitionCoverageTable->size();
+ for( avm_size_t itMachine = 0 ; itMachine < endMachine ; ++itMachine )
+ {
+ aRID = anED.getRuntimeID(itMachine);
+ if( aRID.getExecutable()->hasTransition() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING , (! value) )
+ AVM_OS_TRACE << "machine :> " << aRID.getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING )
+
+ tableOfFlag = mTransitionCoverageTable->at( itMachine );
+ if( tableOfFlag == NULL )
+ {
+ tableOfFlag = new Bitset(
+ aRID.getExecutable()->getTransition().size(), true);
+
+ mTransitionCoverageTable->set(itMachine, tableOfFlag);
+ }
+
+ itTransition = 0;
+ endTransition = aRID.getExecutable()->getTransition().size();
+ for( ; itTransition < endTransition ; ++itTransition )
+ {
+ if( (! value) && tableOfFlag->test(itTransition) )
+ {
+ tableOfFlag->set(itTransition, value);
+
+ if( not value )
+ {
+ mCoverageStatistics.addUncoveredElement();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ AVM_OS_TRACE << "\t" << "program :> "
+ << aRID.getExecutable()->rawTransition(
+ itTransition )->getFullyQualifiedNameID()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ }
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING , (! value) )
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING )
+ }
+ else
+ {
+ mTransitionCoverageTable->set(itMachine, NULL);
+ }
+ }
+}
+
+
+void TransitionCoverageFilter::configureInstanceCoverageTableFlag(
+ const ExecutionData & anED, const RuntimeID & aRID, bool value)
+{
+ if( mExecutableCoverageTable == NULL )
+ {
+ configureExecutableCoverageTableFlag( true );
+ }
+
+ if( mTransitionCoverageTable == NULL )
+ {
+ mTransitionCoverageTable = new ArrayOfBitset(
+ anED.getTableOfRuntime().size(), NULL);
+ }
+
+ ExecutableForm * anExecutable = aRID.getExecutable();
+
+ if( (anExecutable != NULL) &&
+ (mTransitionCoverageTable->at(aRID.getOffset()) == NULL) )
+ {
+ if( anExecutable->hasTransition() &&
+ mExecutableCoverageTable->at(anExecutable->getOffset()) == NULL )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING , (! value) )
+ AVM_OS_TRACE << "machine :> " << aRID.getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING )
+
+ Bitset * tableOfFlag =
+ mTransitionCoverageTable->at( aRID.getOffset() );
+ if( tableOfFlag == NULL )
+ {
+ tableOfFlag = new Bitset(
+ anExecutable->getTransition().size(), true);
+
+ mTransitionCoverageTable->set(aRID.getOffset(), tableOfFlag);
+ }
+
+ avm_size_t endTransition = anExecutable->getTransition().size();
+ avm_size_t itTransition = 0;
+ for( ; itTransition < endTransition ; ++itTransition )
+ {
+ if( (not value) && tableOfFlag->test(itTransition) )
+ {
+ tableOfFlag->set(itTransition, value);
+
+ mCoverageStatistics.addUncoveredElement();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ AVM_OS_TRACE << "\t" << "program :> "
+ << anExecutable->rawTransition(itTransition)->getFullyQualifiedNameID()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING , (! value) )
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING )
+ }
+ else if( anExecutable->hasTransition() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING , (! value) )
+ AVM_OS_TRACE << "machine :> " << aRID.getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING )
+
+ Bitset * tableOfFlag =
+ mTransitionCoverageTable->at( aRID.getOffset() );
+ if( tableOfFlag == NULL )
+ {
+ tableOfFlag = new Bitset(
+ anExecutable->getTransition().size(), true);
+
+ mTransitionCoverageTable->set(aRID.getOffset(), tableOfFlag);
+ }
+
+ avm_size_t endTransition = anExecutable->getTransition().size();
+ avm_size_t itTransition = 0;
+ for( ; itTransition < endTransition ; ++itTransition )
+ {
+ tableOfFlag->set(itTransition,
+ value && mExecutableCoverageTable->at(
+ anExecutable->getOffset())->test(itTransition) );
+
+ if( (! value) && mExecutableCoverageTable->at(
+ anExecutable->getOffset())->test(itTransition) )
+ {
+ mCoverageStatistics.addUncoveredElement();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ AVM_OS_TRACE << "\t" << "program :> "
+ << anExecutable->rawTransition(itTransition)->getFullyQualifiedNameID()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING , (! value) )
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING )
+ }
+
+ // Cas des sous machine instance
+ if( anED.getRuntime(aRID).hasChild() )
+ {
+ TableOfRuntimeID::const_iterator itSubMachine =
+ anED.getRuntime(aRID).beginChild();
+ TableOfRuntimeID::const_iterator endSubMachine =
+ anED.getRuntime(aRID).endChild();
+ for( ; itSubMachine != endSubMachine ; ++itSubMachine )
+ {
+ configureInstanceCoverageTableFlag(anED, (*itSubMachine), value);
+ }
+ }
+ }
+}
+
+
+void TransitionCoverageFilter::configureTransitionCoverageTableFlag(
+ ListOfAvmTransition & listOfTransition, bool value)
+{
+ if( mExecutableCoverageTable == NULL )
+ {
+ mExecutableCoverageTable = new ArrayOfBitset(
+ getConfiguration().getExecutableSystem().size(), NULL);
+ }
+
+ Bitset * tableOfFlag = NULL;
+ avm_offset_t containerExecOffset = 0;
+
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING ,
+ (! value) && listOfTransition.nonempty() )
+ AVM_OS_TRACE << "program :> user details" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING )
+
+ ListOfAvmTransition::iterator itProg = listOfTransition.begin();
+ ListOfAvmTransition::iterator endProg = listOfTransition.end();
+ for( ; itProg != endProg ; ++itProg )
+ {
+ containerExecOffset = (*itProg)->getExecutableContainer()->getOffset();
+
+ tableOfFlag = mExecutableCoverageTable->at(containerExecOffset);
+ if( tableOfFlag == NULL )
+ {
+ tableOfFlag = new Bitset((*itProg)->getExecutableContainer()
+ ->getTransition().size(), true);
+
+ mExecutableCoverageTable->set(containerExecOffset, tableOfFlag);
+ }
+ if( (! value) && tableOfFlag->test( (*itProg)->getOffset() ) )
+ {
+ mExecutableCoverageTable->at( containerExecOffset )->set(
+ (*itProg)->getOffset(), value);
+
+ mCoverageStatistics.addUncoveredElement();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ AVM_OS_TRACE << "\t" << "program :> "
+ << (*itProg)->getFullyQualifiedNameID() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING ,
+ (! value) && listOfTransition.nonempty() )
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , CONFIGURING )
+}
+
+
+Bitset * TransitionCoverageFilter::getCoverageTableBitset(
+ const RuntimeID & aRID)
+{
+ switch( mScope )
+ {
+ case Specifier::DESIGN_MODEL_KIND:
+ {
+ return( mExecutableCoverageTable->at(
+ aRID.getExecutable()->getOffset() ) );
+ }
+ case Specifier::DESIGN_INSTANCE_KIND:
+ default:
+ {
+ return( mTransitionCoverageTable->at( aRID.getOffset() ) );
+ }
+ }
+}
+
+
+/*
+ * REPORT
+ */
+void TransitionCoverageFilter::reportMinimum(OutStream & os) const
+{
+ os << TAB << "TRANSITION COVERAGE PROCESSOR" << EOL_FLUSH;
+
+ if( mCoverageStatistics.goalAchieved() )
+ {
+ os << TAB2 << "All the << " << mCoverageStatistics.mNumberOfElements
+ << " >> transitions are covered !" << EOL;
+ }
+ else
+ {
+ os << TAB2 << "Warning: all the transitions are not covered !" << EOL;
+ mCoverageStatistics.toStreamCoverageRate( os << TAB2,
+ "Results: << ", " on "," >> are covered !\n" );
+
+ if( isReportDetails() )
+ {
+ os << TAB2 << "List of the << "
+ << mCoverageStatistics.getNumberOfUncovered()
+ << " >> transitions non covered:" << EOL2;
+
+ const ExecutionData & anED =
+ getConfiguration().getMainExecutionData();
+
+ RuntimeID aRID;
+
+ StringOutStream oss( os.INDENT );
+ bool hasOneUncoverdTransition = false;
+
+ avm_size_t offset;
+ avm_size_t endOffset;
+ AvmTransition * itTransition;
+
+ switch( mScope )
+ {
+ case Specifier::DESIGN_INSTANCE_KIND:
+ {
+ if( mTransitionCoverageTable == NULL )
+ {
+ break;
+ }
+
+ avm_size_t endMachine = mTransitionCoverageTable->size();
+ avm_size_t itMachine = 0;
+ for( ; itMachine < endMachine ; ++itMachine )
+ {
+ aRID = anED.getRuntimeID(itMachine);
+ if( aRID.getExecutable()->hasTransition() )
+ {
+ oss.str("");
+
+ if( not aRID.getExecutable()->isReachableState() )
+ {
+ oss << TAB2 << "instance[ NO INCOMING TRANSITION ] :> "
+ << aRID.getFullyQualifiedNameID() << EOL;
+ }
+
+ hasOneUncoverdTransition = false;
+
+ endOffset = aRID.getExecutable()->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itTransition = aRID.getExecutable()->
+ getTransition().rawAt(offset);
+
+ if( not mTransitionCoverageTable->
+ at( aRID.getOffset() )->test( offset ) )
+ {
+ hasOneUncoverdTransition = true;
+ oss << TAB3 << itTransition->
+ strTransitionHeader() << EOL;
+ }
+ }
+ if( hasOneUncoverdTransition )
+ {
+ os << oss.str() << EOL;
+ }
+ }
+ }
+
+ break;
+ }
+
+ case Specifier::DESIGN_MODEL_KIND:
+ {
+ if( mExecutableCoverageTable == NULL )
+ {
+ break;
+ }
+
+ VectorOfExecutableForm::const_iterator itExec =
+ mTableofRuntimeExecutable.begin();
+ VectorOfExecutableForm::const_iterator endExec =
+ mTableofRuntimeExecutable.end();
+ for( avm_size_t indexExec = 0 ; itExec != endExec ;
+ ++itExec , ++indexExec )
+ {
+ if( (*itExec)->hasTransition() )
+ {
+ oss.str("");
+
+ if( not (*itExec)->isReachableState() )
+ {
+ oss << TAB2 << "model[ NO INCOMING TRANSITION ] :> "
+ << (*itExec)->getFullyQualifiedNameID() << EOL;
+ }
+
+ hasOneUncoverdTransition = false;
+
+ endOffset = (*itExec)->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itTransition = (*itExec)->getTransition().rawAt(offset);
+
+ if( not mExecutableCoverageTable->
+ at((*itExec)->getOffset())->test( offset ) )
+ {
+ hasOneUncoverdTransition = true;
+ oss << TAB3 << itTransition->
+ strTransitionHeader() << EOL;
+ }
+ }
+ if( hasOneUncoverdTransition )
+ {
+ os << oss.str() << EOL;
+ }
+ }
+ }
+
+ break;
+ }
+
+ default:
+ {
+ if( mExecutableCoverageTable != NULL )
+ {
+ VectorOfExecutableForm::const_iterator itExec =
+ mTableofRuntimeExecutable.begin();
+ VectorOfExecutableForm::const_iterator endExec =
+ mTableofRuntimeExecutable.end();
+ for( avm_size_t indexExec = 0 ; itExec != endExec ;
+ ++itExec , ++indexExec )
+ {
+ if( (*itExec)->hasTransition() )
+ {
+ oss.str("");
+
+ if( not (*itExec)->isReachableState() )
+ {
+ oss << TAB2 << "model[ NO INCOMING TRANSITION ] :> "
+ << (*itExec)->getFullyQualifiedNameID() << EOL;
+ }
+
+ hasOneUncoverdTransition = false;
+
+ endOffset = (*itExec)->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itTransition = (*itExec)->getTransition().rawAt(offset);
+
+ if( not mExecutableCoverageTable->
+ at((*itExec)->getOffset())->test( offset ) )
+ {
+ hasOneUncoverdTransition = true;
+ oss << TAB3 << itTransition->
+ strTransitionHeader() << EOL;
+ }
+ }
+ if( hasOneUncoverdTransition )
+ {
+ os << oss.str() << EOL;
+ }
+ }
+ }
+ }
+
+ if( mTransitionCoverageTable != NULL )
+ {
+ avm_size_t endMachine = mTransitionCoverageTable->size();
+ avm_size_t itMachine = 0;
+ for( ; itMachine < endMachine ; ++itMachine )
+ {
+ aRID = anED.getRuntimeID(itMachine);
+ if( aRID.getExecutable()->hasTransition() )
+ {
+ oss.str("");
+
+ if( not aRID.getExecutable()->isReachableState() )
+ {
+ oss << TAB2 << "instance[ NO INCOMING TRANSITION ] :> "
+ << aRID.getFullyQualifiedNameID() << EOL;
+ }
+
+ hasOneUncoverdTransition = false;
+
+ endOffset = aRID.getExecutable()->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itTransition = aRID.getExecutable()->
+ getTransition().rawAt(offset);
+
+ if( (not mTransitionCoverageTable->
+ at(aRID.getOffset())->test(offset))
+ && mExecutableCoverageTable->
+ at(aRID.getExecutable()->getOffset())->
+ test(offset) )
+ {
+ hasOneUncoverdTransition = true;
+ oss << TAB3 << itTransition->
+ strTransitionHeader() << EOL;
+ }
+ }
+ if( hasOneUncoverdTransition )
+ {
+ os << oss.str() << EOL;
+ }
+ }
+ }
+ }
+
+ break;
+ }
+ }
+ }
+
+ if ( isReportDetails() && mCoverageStatistics.hasUncovered() )
+ {
+ mCoverageStatistics.toStreamCoverageRate( os << TAB2,
+ "Results: << ", " on "," >> are covered !\n" );
+ }
+ }
+
+ if( mSliceFlag )
+ {
+ os << TAB2 << "Number of nodes cut back: " << mSliceCount << EOL;
+ }
+
+ os << std::flush;
+}
+
+
+void TransitionCoverageFilter::reportDefault(OutStream & os) const
+{
+ reportHeader(os, "TRANSITION COVERAGE ");
+
+ if( mHeuristicProperty.mHeuristicEnabled )
+ {
+ os << std::boolalpha
+ << " < chp:" << mCoverageHeightPeriod
+ << " , ch:" << mCoverageHeight
+ << " ; hsr:" << mHitStronglyRandomFlag
+ << " , hsc:" << mHitStronglyCount
+ << " ; hwr:" << mHitWeaklyRandomFlag
+ << " , hwc:" << mHitWeaklyCount
+ << " ; hor:" << mHitOtherRandomFlag
+ << " , hoc:" << mHitOtherCount
+ << " > "
+ << std::noboolalpha;
+ }
+
+ os << EOL_FLUSH;
+
+ if( mCoverageStatistics.goalAchieved() )
+ {
+ os << TAB2 << "All the << " << mCoverageStatistics.mNumberOfElements
+ << " >> transitions are covered !" << EOL;
+ }
+ else
+ {
+ os << TAB2 << "Warning: all the transitions are not covered !" << EOL;
+ mCoverageStatistics.toStreamCoverageRate( os << TAB2,
+ "Results: << ", " on "," >> are covered !\n" );
+
+ if( isReportDetails() )
+ {
+ os << TAB2 << "List of the << "
+ << mCoverageStatistics.getNumberOfUncovered()
+ << " >> transitions non covered:" << EOL << EOL;
+
+ const ExecutionData & anED = getConfiguration().getMainExecutionData();
+ RuntimeID aRID;
+
+ StringOutStream oss( os.INDENT );
+ bool hasOneUncoverdTransition = false;
+
+ avm_size_t offset;
+ avm_size_t endOffset;
+ AvmTransition * itTransition;
+
+ switch( mScope )
+ {
+ case Specifier::DESIGN_INSTANCE_KIND:
+ {
+ if( mTransitionCoverageTable == NULL )
+ {
+ break;
+ }
+
+ avm_size_t endMachine = mTransitionCoverageTable->size();
+ avm_size_t itMachine = 0;
+ for( ; itMachine < endMachine ; ++itMachine )
+ {
+ aRID = anED.getRuntimeID(itMachine);
+ if( aRID.getExecutable()->hasTransition() )
+ {
+ oss.str("");
+
+ oss << TAB2 << "instance";
+ if( not aRID.getExecutable()->isReachableState() )
+ {
+ oss << "[ NO INCOMING TRANSITION ]";
+ }
+ oss << " :> " << aRID.getFullyQualifiedNameID() << EOL;
+
+ hasOneUncoverdTransition = false;
+
+ endOffset = aRID.getExecutable()->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itTransition = aRID.getExecutable()->
+ getTransition().rawAt(offset);
+
+ if( not mTransitionCoverageTable->
+ at( aRID.getOffset() )->test( offset ) )
+ {
+ hasOneUncoverdTransition = true;
+ oss << TAB3 << itTransition->
+ strTransitionHeader() << EOL;
+ }
+ }
+ if( hasOneUncoverdTransition )
+ {
+ os << oss.str() << EOL;
+ }
+ }
+ }
+
+ break;
+ }
+
+ case Specifier::DESIGN_MODEL_KIND:
+ {
+ if( mExecutableCoverageTable == NULL )
+ {
+ break;
+ }
+
+ VectorOfExecutableForm::const_iterator itExec =
+ mTableofRuntimeExecutable.begin();
+ VectorOfExecutableForm::const_iterator endExec =
+ mTableofRuntimeExecutable.end();
+ for( avm_size_t indexExec = 0 ; itExec != endExec ;
+ ++itExec , ++indexExec )
+ {
+ if( (*itExec)->hasTransition() )
+ {
+ oss.str("");
+
+ oss << TAB2 << "model";
+ if( not (*itExec)->isReachableState() )
+ {
+ oss << "[ NO INCOMING TRANSITION ]";
+ }
+ oss << " :> " << (*itExec)->getFullyQualifiedNameID() << EOL;
+
+ hasOneUncoverdTransition = false;
+
+ endOffset = (*itExec)->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itTransition = (*itExec)->getTransition().rawAt(offset);
+
+ if( not mExecutableCoverageTable->
+ at((*itExec)->getOffset())->test( offset ) )
+ {
+ hasOneUncoverdTransition = true;
+ oss << TAB3 << itTransition->
+ strTransitionHeader() << EOL;
+ }
+ }
+ if( hasOneUncoverdTransition )
+ {
+ os << oss.str() << EOL;
+ }
+ }
+ }
+
+ break;
+ }
+
+ default:
+ {
+ if( mExecutableCoverageTable != NULL )
+ {
+ VectorOfExecutableForm::const_iterator itExec =
+ mTableofRuntimeExecutable.begin();
+ VectorOfExecutableForm::const_iterator endExec =
+ mTableofRuntimeExecutable.end();
+ avm_size_t indexExec = 0;
+ for( ; itExec != endExec ; ++itExec , ++indexExec )
+ {
+ if( (*itExec)->hasTransition() )
+ {
+ oss.str("");
+
+ oss << TAB2 << "model";
+ if( not (*itExec)->isReachableState() )
+ {
+ oss << "[ NO INCOMING TRANSITION ]";
+ }
+ oss << " :> " << (*itExec)->getFullyQualifiedNameID() << EOL;
+
+
+ hasOneUncoverdTransition = false;
+
+ endOffset = (*itExec)->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itTransition = (*itExec)->getTransition().rawAt(offset);
+
+ if( not mExecutableCoverageTable->
+ at((*itExec)->getOffset())->test( offset ) )
+ {
+ hasOneUncoverdTransition = true;
+ oss << TAB3 << itTransition->
+ strTransitionHeader() << EOL;
+ }
+ }
+ if( hasOneUncoverdTransition )
+ {
+ os << oss.str() << EOL;
+ }
+ }
+ }
+ }
+
+ if( mTransitionCoverageTable != NULL )
+ {
+ avm_size_t endMachine = mTransitionCoverageTable->size();
+ avm_size_t itMachine = 0;
+ for( ; itMachine < endMachine ; ++itMachine )
+ {
+ aRID = anED.getRuntimeID(itMachine);
+ if( aRID.getExecutable()->hasTransition() )
+ {
+ oss.str("");
+
+ oss << TAB2 << "instance";
+ if( not aRID.getExecutable()->isReachableState() )
+ {
+ oss << "[ NO INCOMING TRANSITION ]";
+ }
+ oss << " :> " << aRID.getFullyQualifiedNameID() << EOL;
+
+ hasOneUncoverdTransition = false;
+
+ endOffset = aRID.getExecutable()->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itTransition = aRID.getExecutable()->
+ getTransition().rawAt(offset);
+
+ if( (not mTransitionCoverageTable->
+ at(aRID.getOffset())->test(offset))
+ && mExecutableCoverageTable->
+ at(aRID.getExecutable()->getOffset())->
+ test(offset) )
+ {
+ hasOneUncoverdTransition = true;
+ oss << TAB3 << itTransition->
+ strTransitionHeader() << EOL;
+ }
+ }
+ if( hasOneUncoverdTransition )
+ {
+ os << oss.str() << EOL;
+ }
+ }
+ }
+ }
+
+ break;
+ }
+ }
+ }
+
+ if ( isReportDetails() && mCoverageStatistics.hasUncovered() )
+ {
+ mCoverageStatistics.toStreamCoverageRate( os << TAB2,
+ "Results: << ", " on "," >> are covered !\n" );
+ }
+ }
+
+ if( mSliceFlag )
+ {
+ os << TAB2 << "Number of nodes cut back: " << mSliceCount << EOL;
+ }
+
+ os << std::flush;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// NON-REGRESSION TEST API
+////////////////////////////////////////////////////////////////////////////////
+
+void TransitionCoverageFilter::tddRegressionReportImpl(OutStream & os)
+{
+ os << TAB1 << "COVERED TRANSITIONS : ";
+ if( mCoverageStatistics.goalAchieved() )
+ {
+ os << mCoverageStatistics.mNumberOfElements << " / "
+ << mCoverageStatistics.mNumberOfElements << EOL;
+ }
+ else
+ {
+ os << mCoverageStatistics.getNumberOfUncovered() << " / "
+ << mCoverageStatistics.mNumberOfElements << EOL;
+ }
+
+//$ if( mSliceFlag )
+// {
+// os << TAB2 << "Number of nodes cut back: " << mSliceCount << EOL;
+//$ }
+
+ os << std::flush;
+}
+
+
+
+/**
+ * PRE-FILTER
+ */
+bool TransitionCoverageFilter::prefilter()
+{
+ bool mCondition =
+ ( mNbCoverage > mCoverageStatistics.mNumberOfElements ) ?
+ mCoverageStatistics.goalAchieved() && mStopFlag :
+ (mCoverageStatistics.mNumberOfCovered >= mNbCoverage);
+
+ if( mCondition )
+ {
+ getSymbexRequestManager().postRequestStop( this );
+
+ return false;
+ }
+
+ return( getExecutionQueue().hasReady() );
+}
+
+
+/**
+ * postEval Filter
+ */
+bool TransitionCoverageFilter::postfilter()
+{
+ ecQueue = &( getExecutionQueue().getResultQueue() );
+
+ if( mCoverageStatistics.hasUncovered() )
+ {
+ mCoverageStatistics.backupCovered();
+
+ ecQueueIt = ecQueue->begin();
+ ecQueueItEnd = ecQueue->end();
+ for( ; ecQueueIt != ecQueueItEnd ; ++ecQueueIt )
+ {
+ itEndEC = (*ecQueueIt)->end();
+ for( itEC = (*ecQueueIt)->begin() ; (itEC != itEndEC) ; ++itEC )
+ {
+ updateTransitionCoverageTable((*itEC) ,
+ (*itEC)->getRunnableElementTrace());
+ }
+ }
+
+
+ if( mHeuristicProperty.mHeuristicEnabled )
+ {
+ if( mTraceDirectiveRunningFlag )
+ {
+ if( runTraceDriver() )
+ {
+ //!! Continue driven
+ }
+ else
+ {
+ getSymbexRequestManager().postRequestRequeueWaiting( this );
+ }
+
+ if( mTraceDirectiveRunningFlag )
+ {
+ if( not mCoverageStatistics.updateFailedStep() )
+ {
+ mCoverageStatistics.resetFailedStep();
+ }
+
+ return( getExecutionQueue().hasResult() );
+ }
+ }
+
+
+ if( mCoverageStatistics.updateFailedStep() )
+ {
+ //!!! TODO optimization
+ if( mCoverageStatistics.isSeriouslyFailedStep() )
+ {
+ mHeuristicProperty.incrHeuristicClass();
+
+ getSymbexRequestManager().postRequestRequeueWaiting( this );
+
+
+AVM_IF_DEBUG_FLAG( PROCESSOR )
+ AVM_OS_INFO << EMPHASIS(mHeuristicProperty.strHeuristicClass(), '*', 80);
+AVM_ENDIF_DEBUG_FLAG( PROCESSOR )
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ mCoverageStatistics.toStreamFailedStep(AVM_OS_COUT,
+ "No new transition covered since << ", " step", " >> !!!\n");
+ mCoverageStatistics.toStreamFailedStep(AVM_OS_TRACE,
+ "No new transition covered since << ", " step", " >> !!!\n");
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+ else
+ {
+ mCoverageStatistics.resetFailedStep();
+ }
+
+
+ switch( mHeuristicProperty.mHeuristicClass )
+ {
+ case IHeuristicClass::HEURISTIC_BASIC_CLASS:
+ {
+ mHeuristicProperty.mHeuristicClass =
+ IHeuristicClass::HEURISTIC_BASIC_CLASS;
+
+ heuristicNaiveClassImpl();
+ break;
+ }
+ case IHeuristicClass::HEURISTIC_NAIVE_CLASS:
+ {
+ heuristicNaiveClassImpl();
+ break;
+ }
+ case IHeuristicClass::HEURISTIC_SMART_CLASS:
+ {
+ heuristicSmartClassImpl();
+ break;
+ }
+
+ case IHeuristicClass::HEURISTIC_AGRESSIVE_CLASS:
+ {
+ heuristicAgressiveClassImpl();
+ break;
+ }
+
+ case IHeuristicClass::HEURISTIC_NOTHING_ELSE_CLASS:
+ default:
+ {
+ heuristicNothingElseClassImpl();
+ break;
+ }
+ }
+ }
+ }
+
+ return( getExecutionQueue().hasResult() );
+}
+
+
+
+/**
+ * Heuristic NAIVE Class implementation
+ */
+void TransitionCoverageFilter::heuristicNaiveClassImpl()
+{
+ if( mCoverageStatistics.hasUncovered() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ mCoverageStatistics.toStreamCoverageRate(AVM_OS_COUT ,
+ "Number of covered transitions = ", " / ", "\n");
+
+ mCoverageStatistics.toStreamCoverageRate(AVM_OS_TRACE,
+ "Number of covered transitions = ", " / ", "\n");
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ computeWeightOfResult();
+
+ // case of found strong hit EC
+ if( mStronglyFireableTransitionCount > 0 )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_INFO << "==> Next [ Strongly ] Fireable Count :> "
+ << mStronglyFireableTransitionCount
+ << " Hit Count : " << mStronglyHitEC.size() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ setHitWeight(mStronglyHitEC, WEIGHT_SELECTED_ACHIEVABLE,
+ mHitStronglyRandomFlag, mHitStronglyCount);
+ }
+
+ // case of has waiting strong hit EC
+ else if( getExecutionQueue().getWaitingStrategy()->
+ hasWaiting(WEIGHT_STRONGLY_ACHIEVABLE) )
+ {
+ getSymbexRequestManager().postRequestRequeueWaiting( this );
+ }
+
+ // case of found weak hit EC
+ else if( mWeaklyFireableTransitionCount > 0 )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_INFO << "==> Next [ Weakly ] Fireable Count :> "
+ << mWeaklyFireableTransitionCount
+ << " Hit Count : " << mWeaklyHitEC.size() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ setHitWeight(mWeaklyHitEC, WEIGHT_SELECTED_ACHIEVABLE,
+ mHitWeaklyRandomFlag, mHitWeaklyCount);
+ }
+
+ //!!! TODO optimization
+ else// if( mCoverageStatistics.updateFailedHeuristic() )
+ {
+ getSymbexRequestManager().postRequestRequeueWaiting( this );
+ }
+ }
+}
+
+/**
+ * Heuristic SMART Class implementation
+ */
+void TransitionCoverageFilter::heuristicSmartClassImpl()
+{
+ heuristicNaiveClassImpl();
+}
+
+
+/**
+ * Heuristic AGRESSIVE Class implementation
+ */
+void TransitionCoverageFilter::heuristicAgressiveClassImpl()
+{
+ heuristicNaiveClassImpl();
+}
+
+
+/**
+ * Heuristic NOTHING HELSE Class implementation
+ */
+void TransitionCoverageFilter::heuristicNothingElseClassImpl()
+{
+ collectUncoveredTransition();
+
+ mHeuristicProperty.resetHeuristicClass(
+ IHeuristicClass::HEURISTIC_NAIVE_CLASS);
+
+AVM_IF_DEBUG_FLAG( PROCESSOR )
+ AVM_OS_INFO << EMPHASIS(mHeuristicProperty.strHeuristicClass(), '*', 80);
+AVM_ENDIF_DEBUG_FLAG( PROCESSOR )
+
+ heuristicNaiveClassImpl();
+
+
+ if( mCoverageStatistics.goalAchievedRate() )
+ {
+ if( mStopFlag )
+ {
+ getSymbexRequestManager().postRequestStop( this );
+ }
+
+AVM_IF_DEBUG_FLAG( PROCESSOR )
+ AVM_OS_INFO << "******* HEURISTIC GOAL ACHIEVED RATE : "
+ << mCoverageStatistics.mCoverageRateGoal << " % *******" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( PROCESSOR )
+ }
+
+ if( mCoverageStatistics.goalAchievedRest() )
+ {
+ if( mStopFlag )
+ {
+ getSymbexRequestManager().postRequestStop( this );
+ }
+
+AVM_IF_DEBUG_FLAG( PROCESSOR )
+ AVM_OS_INFO << "******* HEURISTIC GOAL ACHIEVED REST : "
+ << mCoverageStatistics.mCoverageRestGoal << " *******" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( PROCESSOR )
+ }
+
+
+ if( ++mHeuristicProperty.mHeuristicTrialsCount
+ > mHeuristicProperty.mHeuristicTrialsLimit )
+ {
+ if( mStopFlag )
+ {
+ getSymbexRequestManager().postRequestStop( this );
+ }
+
+AVM_IF_DEBUG_FLAG( PROCESSOR )
+ AVM_OS_INFO << "******* HEURISTIC TRIALS STOP : "
+ << mHeuristicProperty.mHeuristicTrialsLimit
+ << " *******" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( PROCESSOR )
+ }
+}
+
+
+
+/**
+ * Compute Hit Weigth for Execution Context
+ */
+void TransitionCoverageFilter::setHitWeight(VectorOfExecutionContext & hitEC,
+ avm_uint8_t hitWeight, bool randomFlag, avm_size_t hitCount)
+{
+ if( randomFlag && (hitCount < hitEC.size()) )
+ {
+ maxRandomOffset = hitEC.size() - 1;
+ randomOffsetBitset.reset();
+ randomOffsetBitset.resize(maxRandomOffset + 1, false);
+
+ for( ; 0 < hitCount ; --hitCount )
+ {
+ do
+ {
+ offset = RANDOM::gen_uint(0, maxRandomOffset);
+ }
+ while( randomOffsetBitset[offset] );
+
+ randomOffsetBitset[offset] = true;
+
+ hitEC[ offset ]->setWeight( hitWeight );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_INFO << std::endl << DEFAULT_WRAP_DATA << "HIT :> ";
+ hitEC[ offset ]->traceMinimum(AVM_OS_COUT );
+ hitEC[ offset ]->traceMinimum(AVM_OS_TRACE);
+ AVM_OS_INFO << END_WRAP;
+
+ fireableTransitionTrace(AVM_OS_COUT , hitEC[ offset ]->refExecutionData());
+ fireableTransitionTrace(AVM_OS_TRACE, hitEC[ offset ]->refExecutionData());
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_INFO << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+
+ else
+ {
+ if( hitCount > hitEC.size() )
+ {
+ hitCount = hitEC.size();
+ }
+ for( offset = 0 ; offset < hitCount ; ++offset )
+ {
+ hitEC[ offset ]->setWeight( hitWeight );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_INFO << std::endl << DEFAULT_WRAP_DATA << "HIT :> ";
+ hitEC[ offset ]->traceMinimum(AVM_OS_COUT );
+ hitEC[ offset ]->traceMinimum(AVM_OS_TRACE);
+ AVM_OS_INFO << END_WRAP;
+
+ fireableTransitionTrace(AVM_OS_COUT , hitEC[ offset ]->refExecutionData());
+ fireableTransitionTrace(AVM_OS_TRACE, hitEC[ offset ]->refExecutionData());
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_INFO << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+ }
+}
+
+/*
+ * weight: 1 if some transition of leaf EC will be fired
+ * weight: 2 if some transition of leaf EC could be fired
+ * weight: 3 else
+ */
+void TransitionCoverageFilter::computeWeight(ExecutionContext * anEC)
+{
+ switch( mHeuristicProperty.mHeuristicClass )
+ {
+ case IHeuristicClass::HEURISTIC_BASIC_CLASS:
+ {
+ mHeuristicProperty.mHeuristicClass =
+ IHeuristicClass::HEURISTIC_BASIC_CLASS;
+
+ computeWeightNaive( anEC );
+ break;
+ }
+ case IHeuristicClass::HEURISTIC_NAIVE_CLASS:
+ {
+ computeWeightNaive( anEC );
+ break;
+ }
+ case IHeuristicClass::HEURISTIC_SMART_CLASS:
+ {
+ computeWeightSmart( anEC );
+ break;
+ }
+
+ case IHeuristicClass::HEURISTIC_AGRESSIVE_CLASS:
+ {
+ computeWeightAgressive( anEC );
+ break;
+ }
+
+ case IHeuristicClass::HEURISTIC_NOTHING_ELSE_CLASS:
+ default:
+ {
+ computeWeightNaive( anEC );
+ break;
+ }
+ }
+}
+
+
+void TransitionCoverageFilter::computeWeightNaive(ExecutionContext * anEC)
+{
+ if( computeCheckNonPriorityWeight(anEC) )
+ {
+ return;
+ }
+
+ computePriorityWeight(anEC);
+
+ if( checkStronglyPriorityWeight(anEC) )
+ {
+ return;
+ }
+ else if( checkWeaklyPriorityWeight(anEC) )
+ {
+ return;
+ }
+ else
+ {
+ anEC->setWeight( WEIGHT_UNKNOWN_ACHIEVABLE );
+ }
+}
+
+
+void TransitionCoverageFilter::computeWeightSmart(ExecutionContext * anEC)
+{
+ computePriorityWeight(anEC);
+
+ if( checkStronglyPriorityWeight(anEC) )
+ {
+ return;
+ }
+
+ else if( computeCheckNonPriorityWeight(anEC) )
+ {
+ return;
+ }
+
+ else if( checkWeaklyPriorityWeight(anEC) )
+ {
+ return;
+ }
+ else
+ {
+ anEC->setWeight( WEIGHT_UNKNOWN_ACHIEVABLE );
+ }
+}
+
+
+void TransitionCoverageFilter::computeWeightAgressive(ExecutionContext * anEC)
+{
+ computePriorityWeight(anEC);
+
+ if( checkStronglyPriorityWeight(anEC) )
+ {
+ return;
+ }
+ else if( checkWeaklyPriorityWeight(anEC) )
+ {
+ return;
+ }
+ else
+ {
+ anEC->setWeight( WEIGHT_UNKNOWN_ACHIEVABLE );
+ }
+}
+
+
+bool TransitionCoverageFilter::computeCheckNonPriorityWeight(
+ ExecutionContext * anEC)
+{
+ if( anEC->getHeight() > mCoverageHeight )
+ {
+ mCoverageHeightReachedFlag = true;
+
+ anEC->setWeight( WEIGHT_NON_PRIORITY );
+
+ return( true );
+ }
+ else if( anEC->getWeight() != WEIGHT_NON_PRIORITY )
+ {
+ if( isTrivialLoop(anEC) )
+ {
+ anEC->setWeight( WEIGHT_NON_ACHIEVABLE );
+
+ return( true );
+ }
+
+// if( isSyntaxicLoop(anEC) )
+// {
+// anEC->setWeight( WEIGHT_NON_ACHIEVABLE );
+//
+// return( true );
+// }
+
+ else if( isControlLoop(anEC) )
+ {
+ anEC->setWeight( WEIGHT_NON_PRIORITY );
+
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+
+void TransitionCoverageFilter::computePriorityWeight(ExecutionContext * anEC)
+{
+ tmpStronglyFireableTransitionCount = 0;
+ tmpWeaklyFireableTransitionCount = 0;
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_INFO << ":> from "; anEC->traceMinimum(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+ // compute :>
+// fireableTransitionCount( anEC->getAPExecutionData() );
+ fireableTransitionCount( anEC->refExecutionData() ,
+ anEC->refExecutionData().getSystemRuntime() );
+}
+
+
+
+bool TransitionCoverageFilter::checkStronglyPriorityWeight(
+ ExecutionContext * anEC)
+{
+ if( tmpStronglyFireableTransitionCount > 0 )
+ {
+ anEC->setWeight( WEIGHT_STRONGLY_ACHIEVABLE );
+
+ if( mStronglyFireableTransitionCount
+ < tmpStronglyFireableTransitionCount )
+ {
+ mStronglyFireableTransitionCount =
+ tmpStronglyFireableTransitionCount;
+
+ mStronglyHitEC.clear();
+ mStronglyHitEC.append( anEC );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_INFO << "==> HIT EC [ Strong : "
+ << mStronglyFireableTransitionCount << " ]:> ";
+ anEC->traceMinimum(AVM_OS_COUT);
+ anEC->traceMinimum(AVM_OS_TRACE);
+ AVM_OS_INFO << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+ return( true );
+ }
+
+ else if( mStronglyFireableTransitionCount ==
+ tmpStronglyFireableTransitionCount )
+ {
+ mStronglyHitEC.append( anEC );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_INFO << "==> HIT EC [ Strong : "
+ << mStronglyFireableTransitionCount << " ]:> ";
+ anEC->traceMinimum(AVM_OS_COUT);
+ anEC->traceMinimum(AVM_OS_TRACE);
+ AVM_OS_INFO << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ }
+
+ return( true );
+ }
+
+ return( false );
+}
+
+bool TransitionCoverageFilter::checkWeaklyPriorityWeight(ExecutionContext * anEC)
+{
+ if( tmpWeaklyFireableTransitionCount > 0 )
+ {
+ anEC->setWeight( WEIGHT_WEAKLY_ACHIEVABLE );
+
+ if( mWeaklyFireableTransitionCount < tmpWeaklyFireableTransitionCount )
+ {
+ mWeaklyFireableTransitionCount = tmpWeaklyFireableTransitionCount;
+
+ mWeaklyHitEC.clear();
+ mWeaklyHitEC.append( anEC );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_INFO << "==> HIT EC [ Weak : "
+ << mWeaklyFireableTransitionCount << " ]:> ";
+ anEC->traceMinimum(AVM_OS_COUT);
+ anEC->traceMinimum(AVM_OS_TRACE);
+ AVM_OS_INFO << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+
+ return( true );
+ }
+
+ else if( mWeaklyFireableTransitionCount ==
+ tmpWeaklyFireableTransitionCount )
+ {
+ mWeaklyHitEC.append( anEC );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_INFO << "==> HIT EC [ Weak : "
+ << mWeaklyFireableTransitionCount << " ]:> ";
+ anEC->traceMinimum(AVM_OS_COUT);
+ anEC->traceMinimum(AVM_OS_TRACE);
+ AVM_OS_INFO << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ }
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+void TransitionCoverageFilter::computeWeightOfResult()
+{
+ mStronglyHitEC.clear();
+ mStronglyFireableTransitionCount = 0;
+
+ mWeaklyHitEC.clear();
+ mWeaklyFireableTransitionCount = 0;
+
+ ecQueueIt = ecQueue->begin();
+ for( ; ecQueueIt != ecQueueItEnd ; ++ecQueueIt )
+ {
+ itEndEC = (*ecQueueIt)->end();
+ for( itEC = (*ecQueueIt)->begin() ; (itEC != itEndEC) ; ++itEC )
+ {
+ computeWeight( *itEC );
+
+//AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+// if( (*itEC)->getWeight() == WEIGHT_SELECTED_ACHIEVABLE )
+// {
+// fireableTransitionTrace(AVM_OS_COUT , (*itEC)->getAPExecutionData());
+// fireableTransitionTrace(AVM_OS_TRACE, (*itEC)->getAPExecutionData());
+// }
+//AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+ }
+
+ // Count one time per step CoverageHeightReached
+ if( mCoverageHeightReachedFlag )
+ {
+ ++mCoverageHeightReachedCount;
+
+ mCoverageHeightReachedFlag = false;
+ }
+}
+
+
+void TransitionCoverageFilter::handleRequestRequeueWaitingTable(
+ WaitingStrategy & aWaitingStrategy,
+ avm_uint8_t aWeightMin, avm_uint8_t aWeightMax)
+{
+ mCoverageStatistics.setFailedHeuristic();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_INFO << ">>>>>>> REQUEST REQUEUE <<<<<<<" << std::endl;
+
+ AVM_IF_DEBUG_LEVEL_FLAG( HIGH , TRANSITION )
+ report(AVM_OS_COUT);
+ report(AVM_OS_TRACE);
+ AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , TRANSITION )
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ do
+ {
+ mWaitingQueue.clear();
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , QUEUE )
+ aWaitingStrategy.toStream(AVM_OS_COUT);
+ aWaitingStrategy.toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , QUEUE )
+
+// aWaitingStrategy.spliceQueueTable(mWaitingQueue, aWeightMax);
+
+ aWeightMin = aWaitingStrategy.splicePriorQueueTable(
+ mWaitingQueue, aWeightMin, aWeightMax);
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_INFO << "REQUEUE QUEUE << " << strHeuristicWeight(aWeightMin)
+ << " >> " << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+
+ mStronglyHitEC.clear();
+ mStronglyFireableTransitionCount = 0;
+
+ mWeaklyHitEC.clear();
+ mWeaklyFireableTransitionCount = 0;
+
+ ecQueueIt = mWaitingQueue.begin();
+ ecQueueItEnd = mWaitingQueue.end();
+ for( ; ecQueueIt != ecQueueItEnd ; ++ecQueueIt )
+ {
+ computeWeight( *ecQueueIt );
+
+ aWaitingStrategy.push( *ecQueueIt );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ if( (*ecQueueIt)->getWeight() <= WEIGHT_STRONGLY_ACHIEVABLE )
+ {
+ AVM_OS_INFO << DEFAULT_WRAP_DATA
+ << "REQUEUE candidate [ <= Strongly ] :> ";
+ (*ecQueueIt)->traceMinimum(AVM_OS_COUT );
+ (*ecQueueIt)->traceMinimum(AVM_OS_TRACE);
+ AVM_OS_INFO << END_WRAP;
+
+ fireableTransitionTrace(AVM_OS_COUT, (*ecQueueIt)->refExecutionData());
+ fireableTransitionTrace(AVM_OS_TRACE,(*ecQueueIt)->refExecutionData());
+ }
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , QUEUE )
+ aWaitingStrategy.toStream(AVM_OS_COUT);
+ aWaitingStrategy.toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , QUEUE )
+
+ // case of found strongly hit EC
+ if( mStronglyFireableTransitionCount > 0 )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_INFO << "==> REQUEUE candidate [ Strongly ] Fireable Count :> "
+ << mStronglyFireableTransitionCount
+ << " Hit Count : " << mStronglyHitEC.size() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+
+ // case of found weakly hit EC
+ if( mWeaklyFireableTransitionCount > 0 )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_INFO << "==> REQUEUE candidate [ Weakly ] Fireable Count :> "
+ << mWeaklyFireableTransitionCount
+ << " Hit Count : " << mWeaklyHitEC.size() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+ }
+ while( ((++aWeightMin) <= WEIGHT_NON_PRIORITY) &&
+// while( ((++aWeightMin) <= aWeightMax) &&
+ (mStronglyFireableTransitionCount == 0) );
+
+
+//AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ // Passer en mode DIRECTIF vers une transition WEAKLY_ACHIEVABLE à couvrir
+ // Calcul d'une trace vers cette transition
+ if( mStronglyFireableTransitionCount == 0 )
+ {
+ if( initializeTraceDriver(aWaitingStrategy) )
+ {
+ //!! NOTHING
+ }
+ }
+//AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+
+
+ if( (mCoverageHeightReachedCount > mCoverageHeightReachedLimit) &&
+ (mStronglyFireableTransitionCount == 0) )
+ {
+ mCoverageHeightReachedCount = 0;
+ mCoverageHeightReachedFlag = false;
+
+ mCoverageHeight += mCoverageHeightPeriod;
+ mCoverageHeightReachedCount += mCoverageHeightReachedCount;
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_INFO << "REQUEUE [ chp: " << mCoverageHeightPeriod
+ << " ] ==> New Coverage Height :> " << mCoverageHeight << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ }
+}
+
+
+bool TransitionCoverageFilter::testFireability(const ExecutionData & anED,
+ const RuntimeID & aReceiverRID, AvmTransition * aTransition)
+{
+ if( aTransition->hasCode() && aTransition->getCode()->nonempty() &&
+ aTransition->getCode()->first().is< AvmCode >() )
+ {
+ const AvmCode * firstStatement =
+ aTransition->getCode()->first().to_ptr< AvmCode >();
+
+ switch( firstStatement->getOptimizedOpCode() )
+ {
+ case AVM_OPCODE_INPUT_ENV:
+ case AVM_OPCODE_OUTPUT_ENV:
+ {
+ return( true );
+ }
+ default:
+ {
+ if( firstStatement->isOpCode( AVM_OPCODE_INPUT ) &&
+ firstStatement->first().is< InstanceOfPort >() )
+ {
+ return( AvmCommunicationFactory::computePresence(
+ anED, aReceiverRID,
+ firstStatement->first().to_ptr< InstanceOfPort >()) );
+ }
+ return( true );
+ }
+ }
+ }
+
+ return( true );
+}
+
+
+bool TransitionCoverageFilter::isControlLoop(ExecutionContext * anEC)
+{
+ tmpEC = anEC->getPrevious();
+ for( ; tmpEC != NULL ; tmpEC = tmpEC->getPrevious() )
+ {
+ if( anEC->refExecutionData().getRuntimeFormStateTable()->equalsState(
+ tmpEC->refExecutionData().getRuntimeFormStateTable() ) )
+ {
+ return( true );
+ }
+ }
+ return( false );
+}
+
+
+bool TransitionCoverageFilter::isSyntaxicLoop(ExecutionContext * anEC)
+{
+ tmpEC = anEC->getPrevious();
+ for( ; tmpEC != NULL ; tmpEC = tmpEC->getPrevious() )
+ {
+ if( anEC->refExecutionData().getRuntimeFormStateTable()->equalsState(
+ tmpEC->refExecutionData().getRuntimeFormStateTable() ) )
+ {
+ return( true );
+ }
+ }
+ return( false );
+}
+
+
+bool TransitionCoverageFilter::isTrivialLoop(ExecutionContext * anEC)
+{
+ tmpEC = anEC->getPrevious();
+ for( ; tmpEC != NULL ; tmpEC = tmpEC->getPrevious() )
+ {
+ if( anEC->refExecutionData().isTEQ( tmpEC->getExecutionData() ) )
+ {
+ return( true );
+ }
+ }
+ return( false );
+}
+
+
+void TransitionCoverageFilter::fireableTransitionCount(
+ const ExecutionData & anED, const RuntimeID & aRID)
+{
+ tmpEF = aRID.getExecutable();
+
+ tmpRuntimeTransitionBitset = getCoverageTableBitset( aRID );
+
+ if( tmpRuntimeTransitionBitset == NULL )
+ {
+ //!! NOTHING
+ }
+ //tmpEF->hasTransition()
+ else if( tmpRuntimeTransitionBitset->anyFalse() )
+ {
+ AvmTransition * aProg;
+
+ avm_size_t endOffset = tmpEF->getTransition().size();
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ aProg = tmpEF->getTransition().rawAt(offset);
+
+ if( not tmpRuntimeTransitionBitset->test(aProg->getOffset()) )
+ {
+ tmpWeaklyFireableTransitionCount += 1;
+
+ if( testFireability(anED, aRID, aProg) )
+ {
+ tmpStronglyFireableTransitionCount += 1;
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_INFO << "==> Fireable :> " << aProg->strTransitionHeader() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ }
+ }
+ }
+ }
+
+// else if( tmpRuntimeTransitionBitset->allTrue() )
+// {
+// anED.setRuntimeFormState((*itRF)->getRID(), PROCESS_SUSPENDED_STATE);
+// }
+}
+
+
+void TransitionCoverageFilter::fireableTransitionCount(
+ const ExecutionData & anED)
+{
+ avm_size_t offset;
+ avm_size_t endOffset;
+ AvmTransition * aProg;
+
+ itRF = anED.getTableOfRuntime().begin();
+ endRF = anED.getTableOfRuntime().end();
+ for( ; (itRF != endRF) ; ++itRF )
+ {
+ itRID = (*itRF)->getRID();
+
+ if( not anED.isIdleOrRunning( itRID ) )
+ {
+ continue;
+ }
+
+ tmpEF = itRID.getExecutable();
+
+ tmpRuntimeTransitionBitset = getCoverageTableBitset( itRID );
+
+ if( tmpRuntimeTransitionBitset == NULL )
+ {
+ //!! NOTHING
+ }
+ //tmpEF->hasTransition()
+ else if( anED.isIdleOrRunning( itRID ) &&
+ tmpRuntimeTransitionBitset->anyFalse() )
+ {
+ endOffset = tmpEF->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ aProg = tmpEF->getTransition().rawAt(offset);
+
+ if( not tmpRuntimeTransitionBitset->test(aProg->getOffset()) )
+ {
+ tmpWeaklyFireableTransitionCount += 1;
+
+ if( testFireability(anED, itRID, aProg) )
+ {
+ tmpStronglyFireableTransitionCount += 1;
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_INFO << "==> Fireable :> " << aProg->strTransitionHeader() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ }
+ }
+ }
+ }
+
+// else if( tmpRuntimeTransitionBitset->allTrue() )
+// {
+// anED.setRuntimeFormState(itRID, PROCESS_SUSPENDED_STATE);
+// }
+
+ }
+}
+
+
+void TransitionCoverageFilter::fireableTransitionCount(
+ const ExecutionData & anED, const RuntimeForm & aRF)
+{
+ if( not anED.isIdleOrRunning( aRF.getRID() ) )
+ {
+ return;
+ }
+
+ tmpEF = aRF.getRID().getExecutable();
+
+ if( tmpEF->hasTransition() )
+ {
+ tmpRuntimeTransitionBitset = getCoverageTableBitset( aRF.getRID() );
+
+ if( tmpRuntimeTransitionBitset->anyFalse() )
+ {
+ AvmTransition * aProg = NULL;
+
+ avm_size_t endOffset = tmpEF->getTransition().size();
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ aProg = tmpEF->getTransition().rawAt(offset);
+
+ if( not tmpRuntimeTransitionBitset->test(aProg->getOffset()) )
+ {
+ if( testFireability(anED, aRF.getRID(), aProg) )
+ {
+ tmpStronglyFireableTransitionCount += 1;
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ AVM_OS_INFO << "==> Fireable :> " << aProg->strTransitionHeader() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRANSITION )
+ }
+ else
+ {
+ tmpWeaklyFireableTransitionCount += 1;
+ }
+ }
+ }
+ }
+ }
+
+ if( aRF.hasChild() )
+ {
+ TableOfRuntimeID::const_iterator itRID = aRF.beginChild();
+ TableOfRuntimeID::const_iterator itRIDEnd = aRF.endChild();
+
+ for( ; itRID != itRIDEnd ; ++itRID )
+ {
+ if( anED.isIdleOrRunning( *itRID ) )
+ {
+ fireableTransitionCount(anED, anED.getRuntime(*itRID));
+ }
+ }
+ }
+}
+
+
+
+void TransitionCoverageFilter::fireableTransitionTrace(
+ OutStream & os, const ExecutionData & anED)
+{
+ avm_size_t offset;
+ avm_size_t endOffset;
+ AvmTransition * aProg = NULL;
+
+ itRF = anED.getTableOfRuntime().begin();
+ endRF = anED.getTableOfRuntime().end();
+ for( ; (itRF != endRF) ; ++itRF )
+ {
+ itRID = (*itRF)->getRID();
+
+ tmpEF = itRID.getExecutable();
+
+ tmpRuntimeTransitionBitset = getCoverageTableBitset( itRID );
+
+ if( tmpRuntimeTransitionBitset == NULL )
+ {
+ //!! NOTHING
+ }
+ //tmpEF->hasTransition()
+ else if( anED.isIdleOrRunning( itRID ) )
+ {
+ if( tmpRuntimeTransitionBitset->anyFalse() )
+ {
+ endOffset = tmpEF->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ aProg = tmpEF->getTransition().rawAt(offset);
+
+ if( not tmpRuntimeTransitionBitset->
+ test(aProg->getOffset()) )
+ {
+ if( testFireability(anED, itRID, aProg) )
+ {
+ os << "==> [ Strongly ] Fireable :> "
+ << aProg->strTransitionHeader() << std::endl;
+ }
+ else
+ {
+ os << "==> [ Weakly ] Fireable :> "
+ << aProg->strTransitionHeader() << std::endl;
+ }
+ }
+ }
+ }
+// else if( tmpRuntimeTransitionBitset->allTrue() )
+// {
+// os << "==> [ suspended ! ] machine :> "
+// << (*itRF)->getFullyQualifiedNameID() << std::endl;
+// }
+ }
+ }
+}
+
+
+void TransitionCoverageFilter::fireableTransitionTrace(OutStream & os,
+ const ExecutionData & anED, const RuntimeForm & aRF)
+{
+ tmpEF = aRF.getRID().getExecutable();
+
+ if( tmpEF->hasTransition() )
+ {
+ tmpRuntimeTransitionBitset = getCoverageTableBitset( aRF.getRID() );
+
+ if( tmpRuntimeTransitionBitset->anyFalse() )
+ {
+ AvmTransition * aProg = NULL;
+
+ avm_size_t endOffset = tmpEF->getTransition().size();
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ aProg = tmpEF->getTransition().rawAt(offset);
+
+ if( not tmpRuntimeTransitionBitset->test(aProg->getOffset()) )
+ {
+ if( testFireability(anED, aRF.getRID(), aProg) )
+ {
+ os << "==> [ Strongly ] Fireable :> "
+ << aProg->strTransitionHeader() << std::endl;
+ }
+ else
+ {
+ os << "==> [ Weakly ] Fireable :> "
+ << aProg->strTransitionHeader() << std::endl;
+ }
+ }
+ }
+ }
+ }
+
+ if( aRF.hasChild() )
+ {
+ TableOfRuntimeID::const_iterator itRID = aRF.beginChild();
+ TableOfRuntimeID::const_iterator itRIDEnd = aRF.endChild();
+
+ for( ; itRID != itRIDEnd ; ++itRID )
+ {
+ if( anED.isIdleOrRunning( *itRID ) )
+ {
+ fireableTransitionTrace(os, anED, anED.getRuntime(*itRID));
+ }
+ }
+ }
+}
+
+
+/**
+ * updateTransitionCoverageTable using new fresh Execution Context
+ */
+void TransitionCoverageFilter::updateTransitionCoverageTable(
+ ExecutionContext * anEC, const BF & aFiredCode)
+{
+ if( aFiredCode.invalid() )
+ {
+ return;
+ }
+
+ // Vérification de la création de nouvelle instance dynamique
+ // par la commande ${ NEW , EXEC }
+ if( (mScope != Specifier::DESIGN_MODEL_KIND) &&
+ (anEC->refExecutionData().getTableOfRuntime().size() >
+ mTransitionCoverageTable->size()) )
+ {
+ //TODO
+ return;
+ }
+
+ switch( aFiredCode.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ const BFCode & anAvmCode = aFiredCode.bfCode();
+
+ AvmCode::iterator itEnd = anAvmCode->end();
+ for( AvmCode::iterator it = anAvmCode->begin() ; it != itEnd ; ++it )
+ {
+ updateTransitionCoverageTable(anEC, (*it));
+ }
+
+ break;
+ }
+
+ case FORM_EXECUTION_CONFIGURATION_KIND:
+ {
+ ExecutionConfiguration * anExecConf =
+ aFiredCode.to_ptr< ExecutionConfiguration >();
+
+ if( anExecConf->isTransition() )
+ {
+ updateTransitionCoverageTable(anEC,
+ anExecConf->getRuntimeID(), anExecConf->getTransition());
+
+// AvmTransition * firedTransition = anExecConf->getTransition();
+//
+// if( not mTransitionCoverageTable->
+// at( anExecConf->getRuntimeID().getOffset() )->
+// test( firedTransition->getOffset() ) )
+// {
+// mCoverageStatistics.addCoveredElement();
+//
+// mTransitionCoverageTable->at(
+// anExecConf->getRuntimeID().getOffset() )->
+// set(firedTransition->getOffset(), true);
+//
+// if( mExecutableCoverageTable != NULL )
+// {
+// mExecutableCoverageTable->at( firedTransition->
+// getExecutableContainer()->getOffset() )->
+// set(firedTransition->getOffset(), true);
+// }
+//
+// anEC->addInfo(*this, ExpressionConstructor::newString(
+// firedTransition->getNameID() ) );
+//
+// mListOfPositiveEC.append( anEC );
+ }
+
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+}
+
+
+void TransitionCoverageFilter::updateTransitionCoverageTable(
+ ExecutionContext * anEC, const RuntimeID & aRID,
+ AvmTransition * firedTransition)
+{
+ bool isNewlyCovered = false;
+
+ switch( mScope )
+ {
+ case Specifier::DESIGN_MODEL_KIND:
+ {
+ if( not mExecutableCoverageTable->at( firedTransition->
+ getExecutableContainer()->getOffset() )->
+ test(firedTransition->getOffset()) )
+ {
+ isNewlyCovered = true;
+
+ mExecutableCoverageTable->at( firedTransition->
+ getExecutableContainer()->getOffset() )->
+ set(firedTransition->getOffset(), true);
+ }
+
+ break;
+ }
+
+ case Specifier::DESIGN_INSTANCE_KIND:
+ {
+ if( not mTransitionCoverageTable->at( aRID.getOffset() )->
+ test( firedTransition->getOffset() ) )
+ {
+ isNewlyCovered = true;
+
+ mTransitionCoverageTable->at( aRID.getOffset() )->
+ set(firedTransition->getOffset(), true);
+ }
+
+ break;
+ }
+
+ default:
+ {
+ if( not mTransitionCoverageTable->at( aRID.getOffset() )->
+ test( firedTransition->getOffset() ) )
+ {
+ isNewlyCovered = true;
+
+ mTransitionCoverageTable->at( aRID.getOffset() )->
+ set(firedTransition->getOffset(), true);
+
+ if( mExecutableCoverageTable != NULL )
+ {
+ mExecutableCoverageTable->at( firedTransition->
+ getExecutableContainer()->getOffset() )->
+ set(firedTransition->getOffset(), true);
+ }
+ }
+
+ break;
+ }
+ }
+
+
+ if( isNewlyCovered )
+ {
+ mCoverageStatistics.addCoveredElement();
+
+ anEC->getwFlags().addCoverageElementTrace();
+
+ anEC->addInfo(*this,
+ ExpressionConstructor::newString( firedTransition->getNameID() ));
+
+ mListOfPositiveEC.append( anEC );
+ }
+}
+
+
+bool TransitionCoverageFilter::testTransitionCoverage(AvmTransition * firedTransition)
+{
+ switch( mScope )
+ {
+ case Specifier::DESIGN_MODEL_KIND:
+ {
+ return( mExecutableCoverageTable->at( firedTransition->
+ getExecutableContainer()->getOffset() )->
+ test(firedTransition->getOffset()) );
+ }
+
+ case Specifier::DESIGN_INSTANCE_KIND:
+ {
+// return( mTransitionCoverageTable->at( aRID.getOffset() )->
+// test( firedTransition->getOffset() ) );
+
+ return( true );
+ }
+
+ default:
+ {
+ return( (mExecutableCoverageTable != NULL) ||
+ mExecutableCoverageTable->at( firedTransition->
+ getExecutableContainer()->getOffset() )->
+ test(firedTransition->getOffset()) );
+ }
+ }
+}
+
+
+/**
+ * mTableofUncoveredTransition
+ */
+void TransitionCoverageFilter::collectUncoveredTransition()
+{
+ if( mLastCollectedCoverCount < mCoverageStatistics.mNumberOfCovered )
+ {
+ mLastCollectedCoverCount = mCoverageStatistics.mNumberOfCovered;
+
+ mTableofUncoveredTransition.clear();
+
+// avm_size_t endTransition = mTableofUncoveredTransition.size();
+// for( avm_size_t offset = 0 ; offset < endTransition ; ++offset )
+// {
+// if( testTransitionCoverage(mTableofUncoveredTransition[offset]) )
+// {
+// mTableofUncoveredTransition[offset] =
+// mTableofUncoveredTransition[offset];
+// }
+// }
+ }
+ else
+ {
+ return;
+ }
+
+ const ExecutionData & anED = getConfiguration().getMainExecutionData();
+
+ RuntimeID aRID;
+
+ avm_size_t offset;
+ avm_size_t endOffset;
+ AvmTransition * itTransition;
+
+ switch( mScope )
+ {
+ case Specifier::DESIGN_INSTANCE_KIND:
+ {
+ if( mTransitionCoverageTable == NULL )
+ {
+ break;
+ }
+
+ avm_size_t endMachine = mTransitionCoverageTable->size();
+ for( avm_size_t itMachine = 0 ; itMachine < endMachine ; ++itMachine )
+ {
+ aRID = anED.getRuntimeID(itMachine);
+ if( aRID.getExecutable()->hasTransition() )
+ {
+ endOffset = aRID.getExecutable()->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itTransition = aRID.getExecutable()->
+ getTransition().rawAt(offset);
+
+ if( not mTransitionCoverageTable->
+ at( aRID.getOffset() )->test( offset ) )
+ {
+ mTableofUncoveredTransition.append( itTransition );
+
+ if( mTableofUncoveredTransition.size() >=
+ mCoverageStatistics.getNumberOfUncovered() )
+ {
+ return;
+ }
+ }
+ }
+ }
+ }
+
+ break;
+ }
+
+ case Specifier::DESIGN_MODEL_KIND:
+ {
+ if( mExecutableCoverageTable == NULL )
+ {
+ break;
+ }
+
+ VectorOfExecutableForm::const_iterator itExec =
+ mTableofRuntimeExecutable.begin();
+ VectorOfExecutableForm::const_iterator endExec =
+ mTableofRuntimeExecutable.end();
+ for( avm_size_t indexExec = 0 ; itExec != endExec ;
+ ++itExec , ++indexExec )
+ {
+ if( (*itExec)->hasTransition() )
+ {
+ endOffset = (*itExec)->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itTransition = (*itExec)->getTransition().rawAt(offset);
+
+ if( not mExecutableCoverageTable->
+ at((*itExec)->getOffset())->test( offset ) )
+ {
+ mTableofUncoveredTransition.append( itTransition );
+
+ if( mTableofUncoveredTransition.size() >=
+ mCoverageStatistics.getNumberOfUncovered() )
+ {
+ return;
+ }
+ }
+ }
+ }
+ }
+
+ break;
+ }
+
+ default:
+ {
+ if( mExecutableCoverageTable != NULL )
+ {
+ VectorOfExecutableForm::const_iterator itExec =
+ mTableofRuntimeExecutable.begin();
+ VectorOfExecutableForm::const_iterator endExec =
+ mTableofRuntimeExecutable.end();
+ for( avm_size_t indexExec = 0 ; itExec != endExec ;
+ ++itExec , ++indexExec )
+ {
+ if( (*itExec)->hasTransition() )
+ {
+ endOffset = (*itExec)->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itTransition = (*itExec)->getTransition().rawAt(offset);
+
+ if( not mExecutableCoverageTable->
+ at((*itExec)->getOffset())->test( offset ) )
+ {
+ mTableofUncoveredTransition.append( itTransition );
+
+ if( mTableofUncoveredTransition.size() >=
+ mCoverageStatistics.getNumberOfUncovered() )
+ {
+ return;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if( mTransitionCoverageTable != NULL )
+ {
+ avm_size_t endMachine = mTransitionCoverageTable->size();
+ for( avm_size_t itMachine = 0 ; itMachine < endMachine ; ++itMachine )
+ {
+ aRID = anED.getRuntimeID(itMachine);
+ if( aRID.getExecutable()->hasTransition() )
+ {
+ endOffset = aRID.getExecutable()->getTransition().size();
+ for( offset = 0 ; offset < endOffset ; ++offset )
+ {
+ itTransition = aRID.getExecutable()->
+ getTransition().rawAt(offset);
+
+ if( (not mTransitionCoverageTable->
+ at(aRID.getOffset())->test(offset))
+ && mExecutableCoverageTable->
+ at(aRID.getExecutable()->getOffset())->test(offset) )
+ {
+ mTableofUncoveredTransition.append( itTransition );
+
+ if( mTableofUncoveredTransition.size() >=
+ mCoverageStatistics.getNumberOfUncovered() )
+ {
+ return;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ break;
+ }
+ }
+
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+ AVM_OS_INFO << "TransitionCoverageFilter::collectUncoveredTransition:> count: "
+ << mTableofUncoveredTransition.size() << std::endl;
+
+ VectorOfAvmTransition::const_iterator itTransition = mTableofUncoveredTransition.begin();
+ VectorOfAvmTransition::const_iterator endTransition = mTableofUncoveredTransition.end();
+ for( ; itTransition != endTransition ; ++itTransition )
+ {
+ AVM_OS_INFO << "\t" << (*itTransition)->strTransitionHeader() << std::endl;
+ }
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRANSITION )
+}
+
+
+void TransitionCoverageFilter::collectUncoveredTransition(
+ const ExecutionData & anED, ListOfAvmTransition & listofTransition)
+{
+ ExecutableForm * tmpExecutable = NULL;
+
+ ListOfAvmTransition listOfOutgoingTransition;
+ ListOfAvmTransition::const_iterator itTrans;
+ ListOfAvmTransition::const_iterator endTrans;
+
+ itRF = anED.getTableOfRuntime().begin();
+ endRF = anED.getTableOfRuntime().end();
+ for( ; itRF != endRF ; ++itRF )
+ {
+ itRID = (*itRF)->getRID();
+
+ tmpExecutable = itRID.getExecutable();
+
+ if( anED.isIdleOrRunning( itRID )
+ && tmpExecutable->hasTransition() )
+ {
+ tmpExecutable->getOutgoingTransition( listOfOutgoingTransition );
+
+ itTrans = listOfOutgoingTransition.begin();
+ endTrans = listOfOutgoingTransition.end();
+ for( ; itTrans != endTrans ; ++itTrans )
+ {
+ if( not testTransitionCoverage(*itTrans) )
+ {
+ listofTransition.append( *itTrans );
+ }
+ }
+ }
+ }
+}
+
+
+/**
+ * mTraceDriver
+ */
+bool TransitionCoverageFilter::initializeTraceDriver(
+ WaitingStrategy & aWaitingStrategy)
+{
+ avm_uint8_t aWeightMin = 0;
+
+ mWaitingQueue.clear();
+
+ aWeightMin = aWaitingStrategy.splicePriorQueueTable(
+ mWaitingQueue, aWeightMin, WEIGHT_UNKNOWN_ACHIEVABLE);
+
+ ecQueueItEnd = mWaitingQueue.end();
+
+ if( mWeaklyFireableTransitionCount > 0 )
+ {
+ ecQueueIt = mWaitingQueue.begin();
+ for( ; ecQueueIt != ecQueueItEnd ; ++ecQueueIt )
+ {
+ if( initializeTraceDriver(*ecQueueIt) )
+ {
+ mTraceDirectiveRunningFlag = true;
+
+ (*ecQueueIt)->setWeight( WEIGHT_SELECTED_ACHIEVABLE );
+
+ aWaitingStrategy.push(mWaitingQueue);
+
+ return( true );
+ }
+ }
+ }
+
+
+ if( mLastCollectedCoverCount < mCoverageStatistics.mNumberOfCovered )
+ {
+ mLastDirectiveTransitionOffset = 0;
+ }
+ collectUncoveredTransition();
+
+ avm_size_t endTransition = mTableofUncoveredTransition.size();
+ if( mLastDirectiveTransitionOffset >= endTransition )
+ {
+ mLastDirectiveTransitionOffset = 0;
+ }
+
+ do
+ {
+ avm_size_t offset = mLastDirectiveTransitionOffset;
+ for( ; offset < endTransition ; ++offset )
+ {
+ ecQueueIt = mWaitingQueue.begin();
+ for( ; ecQueueIt != ecQueueItEnd ; ++ecQueueIt )
+ {
+ if( mTraceDriver.initialize(*ecQueueIt,
+ mTableofUncoveredTransition[offset]) )
+ {
+ ++mLastDirectiveTransitionOffset;
+
+ mTraceDirectiveRunningFlag = true;
+
+ (*ecQueueIt)->setWeight( WEIGHT_SELECTED_ACHIEVABLE );
+
+ aWaitingStrategy.push(mWaitingQueue);
+
+ return( true );
+ }
+ }
+ }
+
+ aWaitingStrategy.push(mWaitingQueue);
+
+ if( (++aWeightMin) <= WEIGHT_UNKNOWN_ACHIEVABLE )
+ {
+ mWaitingQueue.clear();
+
+ aWeightMin = aWaitingStrategy.splicePriorQueueTable(
+ mWaitingQueue, aWeightMin, WEIGHT_UNKNOWN_ACHIEVABLE);
+
+ ecQueueItEnd = mWaitingQueue.end();
+ }
+ else
+ {
+ break;
+ }
+ }
+ while( mWaitingQueue.nonempty() );
+
+ mTraceDriver.resetFailedTransitionTargetHistory();
+
+ return( false );
+}
+
+
+bool TransitionCoverageFilter::initializeTraceDriver(ExecutionContext * anEC)
+{
+ ListOfAvmTransition uncoveredTransition;
+ collectUncoveredTransition(anEC->refExecutionData(), uncoveredTransition);
+
+ while( uncoveredTransition.nonempty() )
+ {
+ if( mTraceDriver.initialize(anEC, uncoveredTransition.pop_first()) )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+
+bool TransitionCoverageFilter::runTraceDriver()
+{
+ if( mTraceDriver.process( getExecutionQueue().getResultQueue() ) )
+ {
+ if( mTraceDriver.goalAchieved() )
+ {
+ mTraceDirectiveRunningFlag = false;
+
+ mLastDirectiveTransitionOffset = 0;
+ }
+
+ return( true );
+ }
+ else
+ {
+ mTraceDirectiveRunningFlag = false;
+
+ return( false );
+ }
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fam/coverage/TransitionCoverageFilter.h b/org.eclipse.efm.symbex/src/fam/coverage/TransitionCoverageFilter.h
new file mode 100644
index 0000000..3c5513d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/coverage/TransitionCoverageFilter.h
@@ -0,0 +1,341 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 25 juil. 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * Alain Faivre (CEA LIST) alain.faivre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef FAM_COVERAGE_TRANSITIONCOVERAGEFILTER_H_
+#define FAM_COVERAGE_TRANSITIONCOVERAGEFILTER_H_
+
+#include <fam/coverage/BaseCoverageFilter.h>
+
+#include <collection/Bitset.h>
+#include <collection/Typedef.h>
+
+#include <fam/coverage/AvmCoverageTraceDriver.h>
+
+#include <fml/common/SpecifierElement.h>
+
+
+namespace sep
+{
+
+class WaitingStrategy;
+class AvmTransition;
+class ExecutionData;
+class RuntimeID;
+class SymbexControllerUnitManager;
+
+
+class TransitionCoverageFilter :
+ public AutoRegisteredCoverageProcessorUnit< TransitionCoverageFilter >
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( TransitionCoverageFilter )
+
+
+ /**
+ * PROCESSOR FACTORY
+ * for automatic registration in the processor repository
+ * the [ [ FULLY ] QUALIFIED ] NAME ID
+ */
+ AVM_INJECT_AUTO_REGISTER_QUALIFIED_ID_KEY_4(
+ "coverage#transition",
+ "avm::processor.TRANSITION_COVERAGE",
+ "avm::core.filter.PROGRAM_COVERAGE",
+ "avm::core.filter.TRANSITION_COVERAGE")
+ // end registration
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ Specifier::DESIGN_KIND mScope;
+
+ avm_size_t mNbCoverage;
+
+ avm_size_t mCoverageHeightPeriod;
+ avm_size_t mCoverageHeight;
+ avm_size_t mCoverageHeightReachedCount;
+ avm_size_t mCoverageHeightReachedLimit;
+ bool mCoverageHeightReachedFlag;
+
+
+ bool mHitStronglyRandomFlag;
+ avm_size_t mHitStronglyCount;
+
+ bool mHitWeaklyRandomFlag;
+ avm_size_t mHitWeaklyCount;
+
+ bool mHitOtherRandomFlag;
+ avm_size_t mHitOtherCount;
+
+ // Table des flags de couverture de transition
+ // pour chaque instance de machine executable
+ ArrayOfBitset * mExecutableCoverageTable;
+ ArrayOfBitset * mTransitionCoverageTable;
+
+ VectorOfExecutableForm mTableofRuntimeExecutable;
+
+
+ VectorOfAvmTransition mTableofUncoveredTransition;
+ avm_size_t mLastCollectedCoverCount;
+
+
+ // Utilisation d'une trace pour orienté/dirigé l'exécution vers une cible
+ bool mTraceDirectiveRunningFlag;
+ AvmCoverageTraceDriver mTraceDriver;
+
+ avm_size_t mLastDirectiveTransitionOffset;
+
+ // Computing Local Variables
+ Bitset * tmpRuntimeTransitionBitset;
+
+ avm_offset_t offset;
+ avm_offset_t endOffset;
+
+ avm_offset_t maxRandomOffset;
+ Bitset randomOffsetBitset;
+
+
+ ExecutionContext::child_iterator itEC;
+ ExecutionContext::child_iterator itEndEC;
+ ExecutionContext * tmpEC;
+ ExecutableForm * tmpEF;
+ RuntimeID itRID;
+ TableOfRuntimeT::const_iterator itRF;
+ TableOfRuntimeT::const_iterator endRF;
+
+
+ VectorOfExecutionContext mStronglyHitEC;
+ avm_size_t mStronglyFireableTransitionCount;
+ avm_size_t tmpStronglyFireableTransitionCount;
+
+ VectorOfExecutionContext mWeaklyHitEC;
+ avm_size_t mWeaklyFireableTransitionCount;
+ avm_size_t tmpWeaklyFireableTransitionCount;
+
+ ListOfExecutionContext mWaitingQueue;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TransitionCoverageFilter(
+ SymbexControllerUnitManager & aControllerUnitManager,
+ WObject * wfParameterObject)
+ : RegisteredCoverageProcessorUnit(aControllerUnitManager, wfParameterObject,
+ AVM_PREPOST_FILTERING_STAGE, PRECEDENCE_OF_TRANSITION_COVERAGE),
+ mScope( Specifier::DESIGN_MODEL_KIND ),
+
+ mNbCoverage( AVM_NUMERIC_MAX_SIZE_T ),
+
+ mCoverageHeightPeriod( 0 ),
+ mCoverageHeight( 0 ),
+ mCoverageHeightReachedCount( 0 ),
+ mCoverageHeightReachedLimit( 1 ),
+ mCoverageHeightReachedFlag( false ),
+
+ mHitStronglyRandomFlag( false ),
+ mHitStronglyCount( 1 ),
+
+ mHitWeaklyRandomFlag( false ),
+ mHitWeaklyCount( 1 ),
+
+ mHitOtherRandomFlag( false ),
+ mHitOtherCount( 1 ),
+
+ mExecutableCoverageTable( NULL ),
+ mTransitionCoverageTable( NULL ),
+ mTableofRuntimeExecutable( ),
+
+ mTableofUncoveredTransition( ),
+ mLastCollectedCoverCount( 0 ),
+
+ mTraceDirectiveRunningFlag( false ),
+ mTraceDriver( ENV ),
+
+ mLastDirectiveTransitionOffset( 0 ),
+
+ // Computing Local Variables
+ tmpRuntimeTransitionBitset( NULL ),
+
+ offset( 0 ),
+ endOffset( 0 ),
+
+ maxRandomOffset( 0 ),
+ randomOffsetBitset( ),
+
+ itEC( ),
+ itEndEC( ),
+ tmpEC( NULL ),
+ tmpEF( NULL ),
+ itRID( ),
+ itRF( ),
+ endRF( ),
+
+ mStronglyHitEC( ),
+ mStronglyFireableTransitionCount( 0 ),
+ tmpStronglyFireableTransitionCount( 0 ),
+
+ mWeaklyHitEC( ),
+ mWeaklyFireableTransitionCount( 0 ),
+ tmpWeaklyFireableTransitionCount( 0 ),
+
+ mWaitingQueue( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~TransitionCoverageFilter();
+
+
+ /**
+ * CONFIGURE
+ */
+ virtual bool configureImpl();
+
+
+ void configureExecutableCoverageTableFlag(bool value);
+ void configureExecutableCoverageTableFlag(
+ ExecutableForm * anExecutable, bool value);
+
+ void configureInstanceCoverageTableFlag();
+ void configureInstanceCoverageTableFlag(bool value);
+ void configureInstanceCoverageTableFlag(
+ const ExecutionData & anED, const RuntimeID & aRID, bool value);
+
+ void configureTransitionCoverageTableFlag(
+ ListOfAvmTransition & listOfTransition, bool value);
+
+
+ Bitset * getCoverageTableBitset(const RuntimeID & aRID);
+
+
+ /**
+ * REPORT TRACE
+ */
+ virtual void reportMinimum(OutStream & os) const;
+
+ virtual void reportDefault(OutStream & os) const;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // NON-REGRESSION TEST API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual void tddRegressionReportImpl(OutStream & os);
+
+
+ /**
+ * postEval Filter
+ */
+ virtual bool prefilter();
+
+ virtual bool postfilter();
+
+ // REQUEUE REQUEST for the Waiting Queue Table
+ virtual void handleRequestRequeueWaitingTable(
+ WaitingStrategy & aWaitingStrategy,
+ avm_uint8_t aWeightMin, avm_uint8_t aWeightMax);
+
+ /**
+ * Heuristic Class implementation
+ */
+ void heuristicNaiveClassImpl();
+
+ void heuristicSmartClassImpl();
+
+ void heuristicAgressiveClassImpl();
+
+ void heuristicNothingElseClassImpl();
+
+
+ void setHitWeight(VectorOfExecutionContext & hitEC,
+ avm_uint8_t hitWeight, bool randomFlag, avm_size_t hitCount);
+
+ void computeWeight(ExecutionContext * anEC);
+ void computeWeightNaive(ExecutionContext * anEC);
+ void computeWeightSmart(ExecutionContext * anEC);
+ void computeWeightAgressive(ExecutionContext * anEC);
+
+
+ bool computeCheckNonPriorityWeight(ExecutionContext * anEC);
+
+ void computePriorityWeight(ExecutionContext * anEC);
+
+ bool checkStronglyPriorityWeight(ExecutionContext * anEC);
+ bool checkWeaklyPriorityWeight(ExecutionContext * anEC);
+
+
+ void computeWeightOfResult();
+
+
+ bool testFireability(const ExecutionData & anED,
+ const RuntimeID & aReceiverRID, AvmTransition * aTransition);
+
+ bool isControlLoop(ExecutionContext * anEC);
+ bool isSyntaxicLoop(ExecutionContext * anEC);
+ bool isTrivialLoop(ExecutionContext * anEC);
+
+ void fireableTransitionCount(
+ const ExecutionData & anED, const RuntimeID & aRID);
+
+ void fireableTransitionCount(const ExecutionData & anED);
+
+ void fireableTransitionCount(
+ const ExecutionData & anED, const RuntimeForm & aRF);
+
+ void fireableTransitionTrace(OutStream & os, const ExecutionData & anED);
+
+ void fireableTransitionTrace(OutStream & os,
+ const ExecutionData & anED, const RuntimeForm & aRF);
+
+ void updateTransitionCoverageTable(
+ ExecutionContext * anEC, const BF & aFiredCode);
+
+ void updateTransitionCoverageTable(ExecutionContext * anEC,
+ const RuntimeID & aRID, AvmTransition * firedTransition);
+
+ bool testTransitionCoverage(AvmTransition * firedTransition);
+
+ /**
+ * mTableofUncoveredTransition
+ */
+ void collectUncoveredTransition();
+
+ void collectUncoveredTransition(const ExecutionData & anED,
+ ListOfAvmTransition & listofTransition);
+
+
+ /**
+ * mTraceDriver
+ */
+ bool initializeTraceDriver(WaitingStrategy & aWaitingStrategy);
+
+ bool initializeTraceDriver(ExecutionContext * anEC);
+
+ bool runTraceDriver();
+
+};
+
+
+}
+
+#endif /* FAM_COVERAGE_TRANSITIONCOVERAGEFILTER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/debug/AvmDebugProcessor.cpp b/org.eclipse.efm.symbex/src/fam/debug/AvmDebugProcessor.cpp
new file mode 100644
index 0000000..f4c1903
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/debug/AvmDebugProcessor.cpp
@@ -0,0 +1,187 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 27 janv. 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmDebugProcessor.h"
+
+#include <boost/format.hpp>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// REPORT API
+////////////////////////////////////////////////////////////////////////////////
+
+void AvmDebugProcessor::reportMinimum(OutStream & os) const
+{
+ reportHeader(os, "DEBUGGER ");
+
+ os << std::flush;
+}
+
+
+void AvmDebugProcessor::reportDefault(OutStream & os) const
+{
+ reportHeader(os, "DEBUGGER ");
+
+ os << std::flush;
+}
+
+
+bool AvmDebugProcessor::configureImpl()
+{
+ return( IDebugProcessorProvider::debugConfigureImpl( getParameterWObject() ) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// PROCESS API
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmDebugProcessor::preprocess()
+{
+ return( IDebugProcessorProvider::debugPreprocessing() );
+}
+
+bool AvmDebugProcessor::postprocess()
+{
+ return( IDebugProcessorProvider::debugPostprocessing() );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// INITIALIZE-FILTER API
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmDebugProcessor::filteringInitialize()
+{
+ return( IDebugProcessorProvider::debugFilteringInitialize() );
+}
+
+bool AvmDebugProcessor::filteringInitialize(ExecutionContext * anEC)
+{
+ return( IDebugProcessorProvider::debugFilteringInitialize(anEC) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// FINALIZE-FILTER API
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmDebugProcessor::finalizeFiltering()
+{
+ return( IDebugProcessorProvider::debugFilteringFinalize() );
+}
+
+bool AvmDebugProcessor::finalizeFiltering(ExecutionContext * anEC)
+{
+ return( IDebugProcessorProvider::debugFilteringFinalize(anEC) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// PRE-FILTER API
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmDebugProcessor::prefilter()
+{
+ return( IDebugProcessorProvider::debugPrefiltering() );
+}
+
+bool AvmDebugProcessor::prefilter(ExecutionContext & anEC)
+{
+ return( IDebugProcessorProvider::debugPrefiltering(& anEC) );
+}
+
+
+bool AvmDebugProcessor::finalizePrefiltering()
+{
+ return( IDebugProcessorProvider::debugPrefilteringFinalize() );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// POST-FILTER API
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmDebugProcessor::postfilter()
+{
+ return( IDebugProcessorProvider::debugPostfiltering() );
+}
+
+
+bool AvmDebugProcessor::postfilter(ExecutionContext & anEC)
+{
+ return( IDebugProcessorProvider::debugPostfiltering(& anEC) );
+}
+
+
+bool AvmDebugProcessor::finalizePostfiltering()
+{
+ return( IDebugProcessorProvider::debugPostfilteringFinalize() );
+}
+
+
+/**
+ * EVAL TRACE
+ */
+
+void AvmDebugProcessor::traceMinimumPreEval(
+ OutStream & os, const ExecutionContext & anEC) const
+{
+ boost::format formatter(mPreEvalTraceFormatter);
+ formatter.exceptions( boost::io::no_error_bits );
+
+// formatter.exceptions( boost::io::all_error_bits ^
+// ( boost::io::too_many_args_bit | boost::io::too_few_args_bit ) );
+}
+
+
+void AvmDebugProcessor::traceDefaultPreEval(
+ OutStream & os, const ExecutionContext & anEC) const
+{
+// os << TAB << "E[" << std::setw(4) << anEC->getEvalNumber() << "] "
+// << anEC->str_min() << EOL_FLUSH;
+}
+
+
+void AvmDebugProcessor::traceMinimumPostEval(
+ OutStream & os, const ExecutionContext & anEC) const
+{
+ //!! NOTHING
+}
+
+void AvmDebugProcessor::traceDefaultPostEval(
+ OutStream & os, const ExecutionContext & anEC) const
+{
+ //!! NOTHING
+}
+
+
+
+void AvmDebugProcessor::reportEval(OutStream & os) const
+{
+ boost::format formatter(mReportEvalTraceFormatter);
+ formatter.exceptions( boost::io::no_error_bits );
+
+// formatter.exceptions( boost::io::all_error_bits ^
+// ( boost::io::too_many_args_bit | boost::io::too_few_args_bit ) );
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/debug/AvmDebugProcessor.h b/org.eclipse.efm.symbex/src/fam/debug/AvmDebugProcessor.h
new file mode 100644
index 0000000..52140ce
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/debug/AvmDebugProcessor.h
@@ -0,0 +1,173 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 27 janv. 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMDEBUGPROCESSOR_H_
+#define AVMDEBUGPROCESSOR_H_
+
+#include <fam/api/AbstractProcessorUnit.h>
+
+#include <fam/debug/IDebugProcessorProvider.h>
+
+
+namespace sep
+{
+
+class SymbexControllerUnitManager;
+
+
+class AvmDebugProcessor :
+ public AutoRegisteredProcessorUnit< AvmDebugProcessor >,
+ public IDebugProcessorProvider
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( AvmDebugProcessor )
+
+
+ /**
+ * PROCESSOR FACTORY
+ * for automatic registration in the processor repository
+ * the [ [ FULLY ] QUALIFIED ] NAME ID
+ */
+ AVM_INJECT_AUTO_REGISTER_QUALIFIED_ID_KEY(
+ "avm::processor.DEBUGGER" )
+ // end registration
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmDebugProcessor(SymbexControllerUnitManager & aControllerUnitManager,
+ WObject * wfParameterObject = NULL)
+ : RegisteredProcessorUnit(aControllerUnitManager ,
+ wfParameterObject , PRECEDENCE_OF_MAIN_PROCESSOR),
+ IDebugProcessorProvider( this )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AvmDebugProcessor()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool configureImpl();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // REPORT API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline virtual void reportSilent(OutStream & os) const
+ {
+ // SILENT => NOTHING
+ }
+
+ virtual void reportMinimum(OutStream & os) const;
+
+ virtual void reportDefault(OutStream & os) const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PROCESS API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool preprocess();
+
+ virtual bool postprocess();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FILTERING API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool filteringInitialize();
+ virtual bool filteringInitialize(ExecutionContext * anEC);
+
+ virtual bool finalizeFiltering();
+ virtual bool finalizeFiltering(ExecutionContext * anEC);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // ( PRE / POST ) FILTER API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool prefilter();
+ virtual bool prefilter(ExecutionContext & anEC);
+
+ bool finalizePrefiltering();
+
+ virtual bool postfilter();
+ virtual bool postfilter(ExecutionContext & anEC);
+
+ bool finalizePostfiltering();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DEBUG PROCESSING API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline virtual bool debugEvalCommandImpl()
+ {
+ return( false );
+ }
+
+
+ /**
+ * EVAL TRACE
+ */
+ virtual void traceMinimumPreEval(
+ OutStream & os, const ExecutionContext & anEC) const;
+
+ virtual void traceDefaultPreEval(
+ OutStream & os, const ExecutionContext & anEC) const;
+
+
+ virtual void traceMinimumPostEval(
+ OutStream & os, const ExecutionContext & anEC) const;
+
+ virtual void traceDefaultPostEval(
+ OutStream & os, const ExecutionContext & anEC) const;
+
+ virtual void reportEval(OutStream & os) const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SERIALIZATION API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline virtual void toStream(OutStream & os) const
+ {
+ if( mParameterWObject != NULL )
+ {
+ mParameterWObject->toStream(os);
+ }
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* AVMDEBUGPROCESSOR_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/debug/IDebugProcessorProvider.cpp b/org.eclipse.efm.symbex/src/fam/debug/IDebugProcessorProvider.cpp
new file mode 100644
index 0000000..e981a1e
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/debug/IDebugProcessorProvider.cpp
@@ -0,0 +1,3399 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 27 janv. 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "IDebugProcessorProvider.h"
+
+#include <fstream>
+
+#include <util/avm_vfs.h>
+
+#include <fml/executable/ExecutableQuery.h>
+
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/RuntimeForm.h>
+
+#include <fml/template/TimedMachine.h>
+
+#include <fml/trace/TraceFactory.h>
+#include <fml/trace/TracePoint.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <fam/queue/ExecutionQueue.h>
+
+#include <fam/coverage/AvmCoverageDirectiveTraceBuilder.h>
+
+#include <sew/Configuration.h>
+#include <sew/SymbexControllerRequestManager.h>
+
+#include <boost/format.hpp>
+
+
+namespace sep
+{
+
+
+/**
+ * DESTRUCTOR
+ */
+IDebugProcessorProvider::~IDebugProcessorProvider()
+{
+ delete( mDebugTraceFactory );
+}
+
+
+/*
+prototype processor::debugger "debugger" as avm::processor.DEBUGGER is
+// Enable or not debuging in Diversity processes
+section DEBUG#SCHEDULING
+ @filter#detail = true;
+ @filter#initialize = true;
+
+ @prefilter = true;
+ @prefilter#detail = true;
+ @prefilter#finalize = true;
+
+ @postfilter = true;
+ @postfilter#detail = true;
+ @postfilter#finalize = true;
+
+ @preprocess = true;
+ @preprocess#detail= true;
+
+ @postprocess = true;
+ @postprocess#detail = true;
+endsection DEBUG#SCHEDULING
+
+section DEBUG#PROPERTY
+ // Absolute or relative (from LOCATION@log folder) script file path
+ @script = "path/to/file/diversity.dbg";
+
+ // Enable Debug Command Shell REPL
+ @shell = true;
+endsection DEBUG#PROPERTY
+
+section DEBUG#BREAKPOINT
+ // The step of first break
+ @step = 100;
+
+ // Break on this context ID number before his execution
+ @context = 21;
+
+ // The periodic break base on step count and the first break step
+ @period = 10;
+endsection DEBUG#BREAKPOINT
+
+section DEBUG#TRACE
+ @var = var#id;
+ @var = "machine#id->var#id";
+
+ @buffer = buffer#id;
+ @buffer = "machine#id->buffer#id";
+
+ @port = port#id;
+ @port = "machine#id->port#id;
+
+ @signal = signal#id;
+ @signal = "machine#id->signal#id";
+
+ @machine = machine#id;
+ @machine = "machine#id->machine#id";
+
+ @state = state#id;
+ @state = "machine#id->state#id";
+endsection DEBUG#TRACE
+endprototype
+*/
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+
+bool IDebugProcessorProvider::debugConfigureImpl(WObject * wfParameterObject)
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // DEBUG#PROPERTY
+ WObject * thePROPERTY = Query::getWSequenceOrElse(
+ wfParameterObject, "DEBUG#PROPERTY", "PROPERTY");
+
+ mDebugScriptFile = Query::getWPropertyString(thePROPERTY, "script", "");
+
+ if( not mDebugScriptFile.empty() )
+ {
+ mDebugScriptFile = VFS::native_path(
+ mDebugScriptFile, VFS::ProjectLogPath );
+ }
+
+ mDebugConsoleFlag = Query::getWPropertyBoolean(thePROPERTY, "shell", true);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DEBUG#SCHEDULING
+ WObject * theSCHEDULING = Query::getRegexWSequence(wfParameterObject,
+ CONS_WID2("debug", "scheduling") "|"
+ CONS_WID2("DEBUG", "SCHEDULING"), thePROPERTY);
+
+ mDebugFilteringDetailFlag = Query::getRegexWPropertyBoolean(
+ theSCHEDULING, CONS_WID2("filter", "detail"), false);
+
+ mDebugFilteringInitializeFlag = Query::getRegexWPropertyBoolean(
+ theSCHEDULING, CONS_WID2("filter", "initialize"), false);
+
+
+ mDebugPrefilteringFlag = Query::getWPropertyBoolean(
+ theSCHEDULING, "prefilter", false);
+
+ mDebugPrefilteringDetailFlag = Query::getRegexWPropertyBoolean(
+ theSCHEDULING, CONS_WID2("prefilter", "detail"),
+ mDebugFilteringDetailFlag);
+
+ mDebugPrefilteringFinalizeFlag = Query::getRegexWPropertyBoolean(
+ theSCHEDULING, CONS_WID2("prefilter", "finalize"), false);
+
+
+ mDebugPostfilteringFlag = Query::getWPropertyBoolean(
+ theSCHEDULING, "postfilter", false);
+
+ mDebugPostfilteringDetailFlag = Query::getRegexWPropertyBoolean(
+ theSCHEDULING, CONS_WID2("postfilter", "detail"),
+ mDebugFilteringDetailFlag);
+
+ mDebugPostfilteringFinalizeFlag = Query::getRegexWPropertyBoolean(
+ theSCHEDULING, CONS_WID2("postfilter", "finalize"), false);
+
+
+ mDebugPreprocessingFlag = Query::getWPropertyBoolean(
+ theSCHEDULING, "preprocess", false);
+
+ mDebugPreprocessingDetailFlag = Query::getRegexWPropertyBoolean(
+ theSCHEDULING, CONS_WID2("preprocess", "detail"), false);
+
+
+ mDebugPostprocessingFlag = Query::getWPropertyBoolean(
+ theSCHEDULING, "postprocess", false);
+
+ mDebugPostprocessingDetailFlag = Query::getRegexWPropertyBoolean(
+ theSCHEDULING, CONS_WID2("postprocess", "detail"), false);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DEBUG#BREAKPOINT
+ WObject * theBREAKPOINT = Query::getRegexWSequence(
+ wfParameterObject, CONS_WID2("(DEBUG", ")?BREAKPOINT"), thePROPERTY);
+
+ mDebugBreakpointEvalStep = std::max( static_cast< avm_integer_t>( 1 ),
+ Query::getWPropertyInteger(theBREAKPOINT, "step", 1) );
+
+ mDebugBreakpointEvalContext = std::max( static_cast< avm_integer_t>( 0 ),
+ Query::getWPropertyInteger(theBREAKPOINT, "context", 0) );
+
+ mDebugBreakpointEvalStepPeriod = std::max( static_cast< avm_integer_t>( 1 ),
+ Query::getWPropertyInteger(theBREAKPOINT, "period", 1) );
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Trace Factory tools
+ if( TimedMachine::SYSTEM_VAR_DELTA_TIME != NULL )
+ {
+ ExecutableQuery XQuery( mDebugConfiguration );
+
+ mDebugDeltaTimeVariable = XQuery.getDataByAstElement(
+ TimedMachine::SYSTEM_VAR_DELTA_TIME).to_ptr< InstanceOfData >();
+ }
+
+ mDebugTraceFactory = new TraceFactory(mDebugConfiguration,
+ mDebugProcessor->getENV(), wfParameterObject,
+ NULL, mDebugDeltaTimeVariable);
+
+ const ExecutionData & theMainED =
+ mDebugProcessor->getConfiguration().getMainExecutionData();
+
+ mDebugParametersMachine.RID = theMainED.getParametersRID();
+ mDebugParametersMachine.machine = mDebugParametersMachine.RID.getInstance();
+ mDebugParametersMachine.object = mDebugParametersMachine.machine;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DEBUG#TRACE
+ WObject * theTRACE = Query::getWSequenceOrElse(
+ wfParameterObject, "DEBUG#TRACE", "DEBUG");
+ if( (theTRACE != WObject::_NULL_)
+ && theTRACE->hasOwnedElement()
+ && mDebugTraceFactory->configure(
+ theTRACE, mDebugTraceSequence, (& theMainED)) )
+ {
+ BFList::const_iterator itPoint = mDebugTraceSequence.points.begin();
+ BFList::const_iterator endPoint = mDebugTraceSequence.points.end();
+ for( ; itPoint != endPoint ; ++itPoint )
+ {
+ if( (*itPoint).is< TracePoint >() )
+ {
+ dbgTracePoint = (*itPoint).to_ptr< TracePoint >();
+
+ switch( dbgTracePoint->nature )
+ {
+ case ENUM_TRACE_POINT::TRACE_COM_NATURE:
+ case ENUM_TRACE_POINT::TRACE_CHANNEL_NATURE:
+ case ENUM_TRACE_POINT::TRACE_MESSAGE_NATURE:
+ case ENUM_TRACE_POINT::TRACE_PORT_NATURE:
+ case ENUM_TRACE_POINT::TRACE_SIGNAL_NATURE:
+ {
+ mDebugSelectedPorts.append( dbgTracePoint );
+ break;
+ }
+ case ENUM_TRACE_POINT::TRACE_TIME_NATURE:
+ {
+ mDebugSelectedTimeVar = dbgTracePoint;
+ break;
+ }
+ case ENUM_TRACE_POINT::TRACE_VARIABLE_NATURE:
+ {
+ mDebugSelectedVars.append( dbgTracePoint );
+ break;
+ }
+ case ENUM_TRACE_POINT::TRACE_BUFFER_NATURE:
+ {
+ mDebugSelectedBuffers.append( dbgTracePoint );
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_MACHINE_NATURE:
+ {
+ mDebugSelectedMachines.append( dbgTracePoint );
+ break;
+ }
+ case ENUM_TRACE_POINT::TRACE_STATEMACHINE_NATURE:
+ {
+ mDebugSelectedStatemachines.append( dbgTracePoint );
+ break;
+ }
+ case ENUM_TRACE_POINT::TRACE_STATE_NATURE:
+ {
+ mDebugSelectedStates.append( dbgTracePoint );
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_TRANSITION_NATURE:
+ {
+ mDebugSelectedTransitions.append( dbgTracePoint );
+ break;
+ }
+ case ENUM_TRACE_POINT::TRACE_ROUTINE_NATURE:
+ {
+ mDebugSelectedRoutines.append( dbgTracePoint );
+ break;
+ }
+ case ENUM_TRACE_POINT::TRACE_RUNNABLE_NATURE:
+ {
+ mDebugSelectedRunnables.append( dbgTracePoint );
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+ }
+ }
+
+ if( mDebugSelectedVars.nonempty() )
+ {
+ mDebugSelectedVar = mDebugSelectedVars.first();
+ }
+
+ if( mDebugSelectedPorts.nonempty() )
+ {
+ mDebugSelectedPort = mDebugSelectedPorts.first();
+ }
+
+ if( mDebugSelectedBuffers.nonempty() )
+ {
+ mDebugSelectedBuffer = mDebugSelectedBuffers.first();
+ }
+
+ if( mDebugSelectedMachines.nonempty() )
+ {
+ mDebugSelectedMachine = mDebugSelectedMachines.first();
+ }
+
+ if( mDebugSelectedStates.nonempty() )
+ {
+ mDebugSelectedState = mDebugSelectedStates.first();
+ }
+
+ if( mDebugSelectedStatemachines.nonempty() )
+ {
+ mDebugSelectedStatemachine = mDebugSelectedStatemachines.first();
+ }
+
+ if( mDebugSelectedTransitions.nonempty() )
+ {
+ mDebugSelectedTransition = mDebugSelectedTransitions.first();
+ }
+
+ if( mDebugSelectedRoutines.nonempty() )
+ {
+ mDebugSelectedRoutine = mDebugSelectedRoutines.first();
+ }
+
+ if( mDebugSelectedRunnables.nonempty() )
+ {
+ mDebugSelectedRunnable = mDebugSelectedRunnables.first();
+ }
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Other Property
+ mDebugEvalStepCount = 0;
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// PROCESS API
+////////////////////////////////////////////////////////////////////////////////
+
+bool IDebugProcessorProvider::debugPreprocessing()
+{
+ if( mDebugPreprocessingFlag )
+ {
+ dbgQueue = &( mDebugProcessor->getExecutionQueue().getInitQueue() );
+
+ if( dbgQueue->nonempty() )
+ {
+ mDebugSelectedContext = dbgQueue->first();
+ }
+
+ mDebugPromptPrefix = "PREPROCESSING";
+
+ debugReadEvalCommand();
+
+ if( mDebugPreprocessingDetailFlag )
+ {
+ dbgQueueIt = dbgQueue->begin();
+ dbgQueueItEnd = dbgQueue->end();
+ for( ; dbgQueueIt != dbgQueueItEnd ; ++dbgQueueIt )
+ {
+ debugPreprocessing(*dbgQueueIt);
+ }
+ }
+ }
+
+ return( true );
+}
+
+bool IDebugProcessorProvider::debugPreprocessing(const ExecutionContext * anEC)
+{
+ if( mDebugEnabledFlag && mDebugPreprocessingFlag )
+ {
+ mDebugSelectedContext = anEC;
+
+ mDebugPromptPrefix = "PREPROCESSING#DETAIL";
+
+ debugReadEvalCommand();
+ }
+
+ return( true );
+}
+
+
+bool IDebugProcessorProvider::debugPostprocessing()
+{
+ if( mDebugPostprocessingFlag )
+ {
+ mDebugPromptPrefix = "POSTPROCESSING";
+
+ mDebugSelectedContext = NULL;
+
+ debugReadEvalCommand();
+
+ if( mDebugPostprocessingDetailFlag
+ && mDebugProcessor->getConfiguration().hasTrace() )
+ {
+ ListOfExecutionContext listOfRootEC(
+ mDebugProcessor->getConfiguration().getTrace().last() );
+
+ ListOfExecutionContext listOfLeafEC;
+
+ mDebugProcessor->computeLeafEC(listOfRootEC, listOfLeafEC);
+
+ dbgQueue = & listOfLeafEC;
+
+ //!! Detail on what ? leaf EC ?
+ dbgQueueIt = dbgQueue->begin();
+ dbgQueueItEnd = dbgQueue->end();
+ for( ; dbgQueueIt != dbgQueueItEnd ; ++dbgQueueIt )
+ {
+ debugPostprocessing(*dbgQueueIt);
+ }
+ }
+ }
+
+ return( true );
+}
+
+bool IDebugProcessorProvider::debugPostprocessing(const ExecutionContext * anEC)
+{
+ if( mDebugEnabledFlag && mDebugPreprocessingFlag )
+ {
+ mDebugSelectedContext = anEC;
+
+ mDebugPromptPrefix = "POSTPROCESSING#DETAIL";
+
+ debugReadEvalCommand();
+ }
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// ACTIVATOR TRIGGER TOOLS
+////////////////////////////////////////////////////////////////////////////////
+
+bool IDebugProcessorProvider::debugActivatorTriggering()
+{
+ dbgQueue = &( mDebugProcessor->getExecutionQueue().getReadyQueue() );
+
+ if( dbgQueue->nonempty() )
+ {
+ if( (++mDebugEvalStepCount >= mDebugBreakpointEvalStep) )
+ {
+ mDebugEnabledFlag = true;
+
+ mDebugBreakpointEvalStep =
+ mDebugEvalStepCount + mDebugBreakpointEvalStepPeriod;
+
+ if( dbgQueue->nonempty() )
+ {
+ mDebugSelectedContext = dbgQueue->first();
+ }
+ }
+ else
+ {
+ mDebugEnabledFlag = false;
+ }
+
+ if( mDebugBreakpointEvalContext > 0 )
+ {
+ dbgQueueIt = dbgQueue->begin();
+ dbgQueueItEnd = dbgQueue->end();
+ for( ; dbgQueueIt != dbgQueueItEnd ; ++dbgQueueIt )
+ {
+ if( (*dbgQueueIt)->getIdNumber() == mDebugBreakpointEvalContext )
+ {
+ mDebugEnabledFlag = true;
+
+ mDebugSelectedContext = (*dbgQueueIt);
+
+ mDebugBreakpointEvalContext = 0;
+
+ AVM_OS_COUT << std::endl << "Breakpoint Context reached :> ";
+ mDebugSelectedContext->traceMinimum( AVM_OS_COUT );
+ }
+ }
+ }
+ }
+ else
+ {
+ mDebugEnabledFlag = false;
+ }
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// INITIALIZE-FILTER API
+////////////////////////////////////////////////////////////////////////////////
+
+bool IDebugProcessorProvider::debugFilteringInitialize()
+{
+ dbgQueue = &( mDebugProcessor->getExecutionQueue().getInitQueue() );
+
+ if( mDebugEnabledFlag && mDebugPrefilteringFlag )
+ {
+ if( dbgQueue->nonempty() )
+ {
+ mDebugSelectedContext = dbgQueue->first();
+ }
+
+ mDebugPromptPrefix = "FILTERING#INITIALIZE";
+
+ debugReadEvalCommand();
+
+ if( mDebugFilteringDetailFlag )
+ {
+ dbgQueueIt = dbgQueue->begin();
+ dbgQueueItEnd = dbgQueue->end();
+ for( ; dbgQueueIt != dbgQueueItEnd ; ++dbgQueueIt )
+ {
+ debugFilteringInitialize(*dbgQueueIt);
+ }
+ }
+ }
+
+ return( true );
+}
+
+bool IDebugProcessorProvider::debugFilteringInitialize(const ExecutionContext * anEC)
+{
+ if( mDebugEnabledFlag && mDebugFilteringInitializeFlag )
+ {
+ mDebugSelectedContext = anEC;
+
+ mDebugPromptPrefix = "FILTERING#INITIALIZE#DETAIL";
+
+ debugReadEvalCommand();
+ }
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// FINALIZE-FILTER API
+////////////////////////////////////////////////////////////////////////////////
+
+bool IDebugProcessorProvider::debugFilteringFinalize()
+{
+ dbgQueue = &( mDebugProcessor->getExecutionQueue().getInitQueue() );
+
+ if( mDebugEnabledFlag && mDebugPrefilteringFlag )
+ {
+ if( dbgQueue->nonempty() )
+ {
+ mDebugSelectedContext = dbgQueue->first();
+ }
+
+ mDebugPromptPrefix = "FILTERING#FINALIZE";
+
+ debugReadEvalCommand();
+
+ if( mDebugFilteringDetailFlag )
+ {
+ dbgQueueIt = dbgQueue->begin();
+ dbgQueueItEnd = dbgQueue->end();
+ for( ; dbgQueueIt != dbgQueueItEnd ; ++dbgQueueIt )
+ {
+ debugFilteringFinalize(*dbgQueueIt);
+ }
+ }
+ }
+
+ return( true );
+}
+
+bool IDebugProcessorProvider::debugFilteringFinalize(const ExecutionContext * anEC)
+{
+ if( mDebugEnabledFlag && mDebugFilteringFinalizeFlag )
+ {
+ mDebugSelectedContext = anEC;
+
+ mDebugPromptPrefix = "FILTERING#FINALIZE#DETAIL";
+
+ debugReadEvalCommand();
+ }
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// PRE-FILTER API
+////////////////////////////////////////////////////////////////////////////////
+
+bool IDebugProcessorProvider::debugPrefiltering()
+{
+ debugActivatorTriggering();
+
+ if( mDebugEnabledFlag && mDebugPrefilteringFlag )
+ {
+ if( dbgQueue->nonempty() )
+ {
+ mDebugSelectedContext = dbgQueue->first();
+ }
+
+ mDebugPromptPrefix = "PREFILTERING";
+
+ debugReadEvalCommand();
+
+ if( mDebugPrefilteringDetailFlag )
+ {
+ dbgQueueIt = dbgQueue->begin();
+ dbgQueueItEnd = dbgQueue->end();
+ for( ; dbgQueueIt != dbgQueueItEnd ; ++dbgQueueIt )
+ {
+ debugPrefiltering(*dbgQueueIt);
+ }
+ }
+ }
+
+ return( true );
+}
+
+bool IDebugProcessorProvider::debugPrefiltering(const ExecutionContext * anEC)
+{
+ if( mDebugEnabledFlag && mDebugPrefilteringFlag )
+ {
+ mDebugSelectedContext = anEC;
+
+ mDebugPromptPrefix = "PREFILTERING#DETAIL";
+
+ debugReadEvalCommand();
+ }
+
+ return( true );
+}
+
+
+bool IDebugProcessorProvider::debugPrefilteringFinalize()
+{
+ if( mDebugEnabledFlag && mDebugPrefilteringFinalizeFlag )
+ {
+ dbgQueue = &( mDebugProcessor->getExecutionQueue().getReadyQueue() );
+
+ if( dbgQueue->nonempty() )
+ {
+ mDebugSelectedContext = dbgQueue->first();
+ }
+
+ mDebugPromptPrefix = "PREFILTERING#FINALIZE";
+
+ debugReadEvalCommand();
+ }
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// POST-FILTER API
+////////////////////////////////////////////////////////////////////////////////
+
+bool IDebugProcessorProvider::debugPostfiltering()
+{
+ dbgQueue = &( mDebugProcessor->getExecutionQueue().getResultQueue() );
+
+ if( mDebugEnabledFlag && mDebugPostfilteringFlag )
+ {
+ if( dbgQueue->nonempty() )
+ {
+ mDebugSelectedContext = dbgQueue->first();
+ }
+
+ mDebugPromptPrefix = "POSTFILTERING";
+
+ debugReadEvalCommand();
+
+ if( mDebugPostfilteringDetailFlag )
+ {
+ dbgQueueIt = dbgQueue->begin();
+ dbgQueueItEnd = dbgQueue->end();
+ for( ; dbgQueueIt != dbgQueueItEnd ; ++dbgQueueIt )
+ {
+ debugPostfiltering(*dbgQueueIt);
+ }
+ }
+ }
+
+ return( mDebugProcessor->getExecutionQueue().hasResult() );
+}
+
+
+bool IDebugProcessorProvider::debugPostfiltering(const ExecutionContext * anEC)
+{
+ if( mDebugEnabledFlag && mDebugPostfilteringFlag )
+ {
+ mDebugSelectedContext = anEC;
+
+ mDebugPromptPrefix = "POSTFILTERING#DETAIL";
+
+ debugReadEvalCommand();
+ }
+
+ return( true );
+}
+
+
+bool IDebugProcessorProvider::debugPostfilteringFinalize()
+{
+ if( mDebugEnabledFlag && mDebugPostfilteringFinalizeFlag )
+ {
+ dbgQueue = &( mDebugProcessor->getExecutionQueue().getResultQueue() );
+
+ if( dbgQueue->nonempty() )
+ {
+ mDebugSelectedContext = dbgQueue->first();
+ }
+
+ mDebugPromptPrefix = "POSTFILTERING#FINALIZE";
+
+ debugReadEvalCommand();
+ }
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// SCRIPT PROCESSING
+////////////////////////////////////////////////////////////////////////////////
+
+void IDebugProcessorProvider::debugReadEvalCommand()
+{
+ if( not mDebugScriptFile.empty() )
+ {
+ debugReadEvalScript();
+ }
+
+ if( mDebugConsoleFlag )
+ {
+ if( mDebugScriptFile.empty() )
+ {
+ AVM_OS_COUT << std::endl;
+ }
+
+ debugReadEvalCommandLoop();
+ }
+}
+
+
+void IDebugProcessorProvider::debugReadEvalScript()
+{
+ std::ifstream aScriptStream( mDebugScriptFile.c_str() );
+
+ if( isDebugScript(aScriptStream) )
+ {
+ debugReadEvalScript(aScriptStream);
+ }
+
+ aScriptStream.close();
+}
+
+bool IDebugProcessorProvider::isDebugScript(std::ifstream & aScriptStream)
+{
+ if( aScriptStream.good() )
+ {
+ std::getline(aScriptStream, dbgCommandLine);
+
+ StringTools::ltrim( dbgCommandLine );
+
+ if( (dbgCommandLine.find("#!diversity") == 0) ||
+ (dbgCommandLine.find("#!avm") == 0) )
+ {
+ return( aScriptStream.good() );
+ }
+ }
+
+ return( false );
+}
+
+void IDebugProcessorProvider::debugReadEvalScript(std::ifstream & aScriptStream)
+{
+ while( aScriptStream.good() )
+ {
+ std::getline(aScriptStream, dbgCommandLine);
+ StringTools::ltrim( dbgCommandLine );
+
+ if( dbgCommandLine.empty() )
+ {
+ //!! IGNORE SPACE --> continue
+ }
+ else
+ {
+ debugEvalCommand();
+ }
+ }
+}
+
+
+void IDebugProcessorProvider::debugReadEvalCommandLoop()
+{
+ dbgContinueREPL = true;
+
+ AVM_OS_COUT << "Enter a command [or help] ";
+
+ while( dbgContinueREPL )
+ {
+ AVM_OS_COUT << mDebugPromptPrefix
+ << " { step: " << mDebugEvalStepCount
+ << " ( + " << mDebugBreakpointEvalStepPeriod
+ << " )==> break: " << mDebugBreakpointEvalStep;
+ if( mDebugBreakpointEvalContext > 0 )
+ {
+ AVM_OS_COUT << " | ctx: " << mDebugBreakpointEvalContext;
+
+ }
+ AVM_OS_COUT << " } [ " << std::flush;
+
+ if( mDebugSelectedContext != NULL )
+ {
+ AVM_OS_COUT << ( mDebugTraceFullPathFlag ? "path" : "ctx" )
+ << ":" << mDebugSelectedContext->getIdNumber();
+ }
+ if( dbgDetailsMin || dbgDetailsMed || dbgDetailsMax )
+ {
+ AVM_OS_COUT << " , detail:";
+ if( dbgDetailsMax ) { AVM_OS_COUT << "*"; }
+ if( dbgDetailsMed ) { AVM_OS_COUT << "+"; }
+ if( dbgDetailsMin ) { AVM_OS_COUT << "-"; }
+ AVM_OS_COUT << " ";
+ }
+ AVM_OS_COUT << " ] :> " << std::flush;
+
+ if( not dbgCommandLine.empty() )
+ {
+ dbgCommandLineHistory.rremove( dbgCommandLine );
+ dbgCommandLineHistory.push_back( dbgCommandLine );
+ }
+
+ std::getline(std::cin, dbgCommandLine);
+ StringTools::ltrim( dbgCommandLine );
+
+ if( dbgCommandLine.empty() )
+ {
+ //!! IGNORE SPACE -->continue
+ }
+ else
+ {
+ if( dbgCommandLine[0] == '!' )
+ {
+ debugReadHistoryCommand();
+ }
+
+ debugEvalCommand();
+ }
+ }
+}
+
+
+void IDebugProcessorProvider::debugReadHistoryCommand()
+{
+ dbgOffset = AVM_NUMERIC_MAX_SIZE_T;
+
+ if( dbgCommandLine == "!!" )
+ {
+ dbgOffset = 0;
+ }
+ else if( dbgCommandLine.size() > 1 )
+ {
+ dbgCommandArg = dbgCommandLine.substr( 1 );
+
+ if( ::isdigit( dbgCommandArg[0] ) )
+ {
+ from_string<avm_size_t>(dbgCommandArg, dbgOffset);
+ }
+ else
+ {
+ VectorOfString::const_reverse_iterator cmdIt =
+ dbgCommandLineHistory.rbegin();
+ VectorOfString::const_reverse_iterator cmdItEnd =
+ dbgCommandLineHistory.rend();
+ for( dbgOffset = 0; cmdIt != cmdItEnd ; ++cmdIt, ++dbgOffset )
+ {
+ if( ((*cmdIt)[0] == dbgCommandArg[0]) &&
+ StringTools::startsWith((*cmdIt), dbgCommandArg) )
+ {
+ break;
+ }
+ }
+ }
+ }
+
+ if( dbgOffset < dbgCommandLineHistory.size() )
+ {
+ dbgCommandLine = dbgCommandLineHistory.reverse_at(dbgOffset);
+
+ AVM_OS_COUT << "history[" << dbgOffset << "] :> "
+ << dbgCommandLine << std::endl;
+ }
+}
+
+
+void IDebugProcessorProvider::debugEvalCommand()
+{
+ dbgDecodeCommandOk = false;
+
+ // First, try to eval specific processor command for local debugging reason
+ if( debugEvalCommandImpl() )
+ {
+ //!! NOTHING
+ }
+
+ else if( (dbgCommandLine[0] == '#') || ( (dbgCommandLine.size() >= 2) &&
+ (dbgCommandLine[0] == '/') && (dbgCommandLine[1] == '/') ) )
+ {
+ //!! IGNORE SINGLE LINE COMMENT -->continue
+ }
+
+ else if( dbgDecodeCommand("help", '?' , 'h') )
+ {
+ dbgCommandHelp();
+ }
+
+
+ else if( dbgDecodeCommand("echo") )
+ {
+ dbgCommandEcho();
+ }
+
+ else if( dbgDecodeCommand("print") )
+ {
+ dbgCommandPrint();
+ }
+
+ else if( dbgDecodeCommand("show") )
+ {
+ dbgCommandShow();
+ }
+
+
+ else if( dbgDecodeCommand("breakpoint", "bp") )
+ {
+ AVM_OS_COUT << "The step count : "
+ << mDebugEvalStepCount << std::endl;
+
+ AVM_OS_COUT << "Interaction period : "
+ << mDebugBreakpointEvalStepPeriod << std::endl;
+
+
+ AVM_OS_COUT << "Next step interaction breakpoint : "
+ << mDebugBreakpointEvalStep << std::endl;
+
+ AVM_OS_COUT << "Next context interaction breakpoint : "
+ << mDebugBreakpointEvalContext << std::endl;
+ }
+
+
+ else if( dbgDecodeCommand("config", "cfg") )
+ {
+ dbgCommandConfig();
+ }
+
+ else if( dbgDecodeCommand("scheduler", "sched") )
+ {
+ AVM_OS_COUT << "Diversity process Scheduler:" << std::endl;
+
+ mDebugProcessor->getControllerUnitManager().toStream( AVM_OS_COUT );
+ }
+
+
+ else if( dbgDecodeCommand("report", "rp") )
+ {
+ mDebugProcessor->getControllerUnitManager().report(AVM_OS_COUT);
+ }
+
+ else if( dbgDecodeCommand("save") )
+ {
+ mDebugProcessor->getConfiguration().serializeComputingResult();
+ AVM_OS_COUT << "DONE !!!" << std::endl << std::endl;
+ }
+
+
+ else if( dbgDecodeCommand("shell") )
+ {
+ if( not mDebugConsoleFlag )
+ {
+ mDebugConsoleFlag = true;
+
+ AVM_OS_COUT << std::endl;
+
+ mDebugPromptPrefix = "USER";
+
+ debugReadEvalCommandLoop();
+
+ mDebugConsoleFlag = false;
+ }
+ }
+
+
+ else if( dbgDecodeCommand("continue") )
+ {
+ dbgContinueREPL = false;
+ }
+
+
+ else if( dbgDecodeCommand("next", '+') )
+ {
+ dbgContinueREPL = false;
+
+ dbgCommandNext();
+ }
+
+
+ else if( dbgDecodeCommand("break") )
+ {
+ dbgContinueREPL = false;
+
+ dbgCommandBreak();
+ }
+
+
+ else if( dbgDecodeCommand("period") )
+ {
+ dbgCommandPeriod();
+ }
+
+
+ else if( dbgDecodeCommand("queue") )
+ {
+ dbgCommandQueue();
+ }
+
+ else if( dbgDecodeCommand("ec", "ctx") )
+ {
+ dbgCommandContext();
+ }
+
+ else if( dbgDecodeCommand("path") )
+ {
+ dbgCommandPath();
+ }
+
+
+ else if( dbgDecodeCommand("trace") )
+ {
+ dbgCommandTrace();
+ }
+
+ else if( isDebugStringCommand("detail") )
+ {
+ dbgCommandTraceDetailLevel();
+ }
+
+ else if( dbgDecodeCommand("fullpath") )
+ {
+ mDebugTraceFullPathFlag = not mDebugTraceFullPathFlag;
+ }
+
+
+ else if( dbgDecodeCommand("vars") )
+ {
+ dbgCommandVars();
+ }
+ else if( dbgDecodeCommand("var") )
+ {
+ dbgCommandVar();
+ }
+ else if( dbgDecodeCommand("time") )
+ {
+ dbgCommandTime();
+ }
+
+
+
+ else if( dbgDecodeCommand("coms") )
+ {
+ dbgCommandPorts(ENUM_TRACE_POINT::TRACE_COM_NATURE);
+ }
+ else if( dbgDecodeCommand("ports") )
+ {
+ dbgCommandPorts(ENUM_TRACE_POINT::TRACE_PORT_NATURE);
+ }
+ else if( dbgDecodeCommand("messages") )
+ {
+ dbgCommandPorts(ENUM_TRACE_POINT::TRACE_MESSAGE_NATURE);
+ }
+ else if( dbgDecodeCommand("signals") )
+ {
+ dbgCommandPorts(ENUM_TRACE_POINT::TRACE_SIGNAL_NATURE);
+ }
+
+
+ else if( dbgDecodeCommand("com") )
+ {
+ dbgCommandPort(ENUM_TRACE_POINT::TRACE_COM_NATURE);
+ }
+ else if( dbgDecodeCommand("port") )
+ {
+ dbgCommandPort(ENUM_TRACE_POINT::TRACE_PORT_NATURE);
+ }
+ else if( dbgDecodeCommand("message") )
+ {
+ dbgCommandPort(ENUM_TRACE_POINT::TRACE_MESSAGE_NATURE);
+ }
+ else if( dbgDecodeCommand("signal") )
+ {
+ dbgCommandPort(ENUM_TRACE_POINT::TRACE_SIGNAL_NATURE);
+ }
+
+
+
+ else if( dbgDecodeCommand("buffers") )
+ {
+ dbgCommandBuffers();
+ }
+ else if( dbgDecodeCommand("buffer") )
+ {
+ dbgCommandBuffer();
+ }
+
+
+ else if( dbgDecodeCommand("machines") )
+ {
+ dbgCommandMachines();
+ }
+ else if( dbgDecodeCommand("machine") )
+ {
+ dbgCommandMachine();
+ }
+
+ else if( dbgDecodeCommand("parameters", "parameter", "params", "param") )
+ {
+ dbgCommandParametersMachine();
+ }
+
+
+ else if( dbgDecodeCommand("states") )
+ {
+ dbgCommandStates();
+ }
+ else if( dbgDecodeCommand("state") )
+ {
+ dbgCommandState();
+ }
+
+
+ else if( dbgDecodeCommand("transitions", "transs") )
+ {
+ dbgCommandTransitions();
+ }
+ else if( dbgDecodeCommand("transition", "trans") )
+ {
+ dbgCommandTransition();
+ }
+
+ else if( dbgDecodeCommand("routines") )
+ {
+ dbgCommandRoutines();
+ }
+ else if( dbgDecodeCommand("routine") )
+ {
+ dbgCommandRoutine();
+ }
+
+
+ else if( dbgDecodeCommand("enable") )
+ {
+ dbgCommandEnableDisableProcess( true );
+ }
+
+
+ else if( dbgDecodeCommand("disable") )
+ {
+ dbgCommandEnableDisableProcess( false );
+ }
+
+
+ else if( dbgDecodeCommand("verbosity", "verbose") )
+ {
+ dbgCommandVerbosityLevel();
+ }
+
+
+ else if( dbgDecodeCommand("debug#level") )
+ {
+ dbgCommandDebugLevel();
+ }
+
+
+ else if( dbgDecodeCommand("debug#flag") )
+ {
+ dbgCommandDebugFlag( true );
+ }
+
+
+ else if( dbgDecodeCommand("debug#flag#off") )
+ {
+ dbgCommandDebugFlag( false );
+ }
+
+
+ else if( dbgDecodeCommand("bye", "stop") )
+ {
+ dbgContinueREPL = false;
+ }
+ else if( dbgDecodeCommand("stop") )
+ {
+ dbgContinueREPL = false;
+ }
+
+ else if( dbgDecodeCommand("exit", "quit") )
+ {
+ dbgContinueREPL = false;
+
+ mDebugProcessor->
+ getSymbexRequestManager().postRequestStop( mDebugProcessor );
+ }
+
+ else if( dbgDecodeCommand("history", "hty") )
+ {
+ dbgCommandHistory();
+ }
+
+ else
+ {
+ AVM_OS_COUT << "<Unknown Command>: " << dbgCommandLine
+ << std::endl << std::endl;
+// AVM_OS_COUT << DEBUG_SHELL_COMMAND_SUMMARY << std::endl;
+
+ dbgCommandLine = "";
+ }
+}
+
+
+void IDebugProcessorProvider::dbgCheckCommandDetailsArg()
+{
+ if( not dbgCommandArg.empty() )
+ {
+ if( dbgCommandArg[0] == '-' )
+ {
+ dbgDetailsMin = true;
+
+ StringTools::ltrim( dbgCommandArg , 1 );
+ }
+
+ if( dbgCommandArg[0] == '+' )
+ {
+ dbgDetailsMed = true;
+
+ StringTools::ltrim( dbgCommandArg , 1 );
+ }
+
+ if( dbgCommandArg[0] == '*' )
+ {
+ dbgDetailsMax = true;
+
+ StringTools::ltrim( dbgCommandArg , 1 );
+ }
+ }
+}
+
+
+std::string IDebugProcessorProvider::DEBUG_SHELL_COMMAND_SUMMARY =
+ "List of classes of commands :\n"
+ "\t? -- \n"
+ "\th -- \n"
+ "\thelp -- Print this help\n\n"
+
+ "\thistory -- help on command for invoking an old command\n"
+
+ "\tcontrol -- help on command for controlling the debug process\n"
+
+ "\tqueue -- help on command for analyzing the execution queue\n"
+
+ "\tctx -- help on command for execution context selection\n"
+
+ "\tdata -- help on command for analyzing the execution data\n\n"
+
+ "\tprint -- help on command for printing in the console: text message, ...\n"
+
+ "\treport -- help on command for reporting on a snapshot of the evaluation\n"
+
+ "\tbreakpoint -- help on command for setting step parameters\n"
+
+ "\toption -- help on command for enable specific debug process\n"
+
+ "\tlog -- help on command for enable debug level or flag\n\n"
+
+ "Type \"help\" followed by a class name for a list of commands in that class.\n";
+
+
+std::string IDebugProcessorProvider::DEBUG_SHELL_COMMAND_HISTORY =
+ "\thistory -- Print the command history list\n"
+ "\t!! -- Re-eval the last command\n"
+ "\t!N -- Re-eval the last N-th command\n"
+ "\t!prefix -- Re-eval the first of last command which starts with 'prefix'\n";
+
+
+
+std::string IDebugProcessorProvider::DEBUG_SHELL_COMMAND_CONTROL =
+ "\tbye -- \n"
+ "\tstop -- \n"
+ "\t+ -- \n"
+ "\tcontinue -- Stop the the interaction process, "
+ "continue Diversity processing\n\n"
+
+ "\tquit -- Quit the Diversity process\n"
+ "\texit -- Exit the Diversity process\n\n"
+
+ "\tbreak -- Continue until the next break for a given Context Number\n"
+ "\t\tbreak? : Waiting for the user gives a Context Number\n"
+ "\t\tbreak N : A Context Number N\n"
+
+ "\tnext -- Continue for a given Number of step until the next interaction\n"
+ "\t\tnext? : Waiting for the user gives a number of step\n"
+ "\t\tnexti : One step\n"
+ "\t\tnext N : A number N of step\n\n"
+
+ "\tperiod -- Set an interaction period number\n"
+ "\t\tperiod? : Waiting for the user gives an interaction period number\n"
+ "\t\tperiod N : An interaction period number\n";
+
+
+std::string IDebugProcessorProvider::DEBUG_SHELL_COMMAND_QUEUE =
+ "\tqueue -- Print all execution queue\n"
+ "\t\tqueue? : Waiting for the user selects a queue in "
+ "{ init , waiting , ready , result , failed }\n"
+ "\t\tqueue#init : the 'init' queue\n"
+ "\t\tqueue#waiting : the 'waiting' queue\n"
+ "\t\tqueue#ready : the 'ready' queue\n"
+ "\t\tqueue#result : the 'result' queue\n"
+ "\t\tqueue#failed : the 'failed' queue\n";
+
+
+std::string IDebugProcessorProvider::DEBUG_SHELL_COMMAND_CONTEX =
+ "\tpath -- Print current execution path from selected context\n"
+ "\tec -- \n"
+ "\tctx -- Print current execution context\n"
+ "\t\tctx? : Waiting for the user selects an execution context ID number\n"
+ "\t\tctx N : Select the given execution context N\n"
+ "\t\t\tSearching order: (1) current selection child, (2) ancestors, "
+ "(3) all the the execution graph !!!";
+
+
+std::string IDebugProcessorProvider::DEBUG_SHELL_COMMAND_DATA =
+ "\tvar -- Print value from selected Context for a selected variable\n"
+ "\t\tvar? : Waiting for the user gives a variable ID\n"
+ "\t\tvar ID : Select the given variable ID\n\n"
+
+ "\tport -- Print value from selected Context for a selected port\n"
+ "\t\tport? : Waiting for the user gives a port ID\n"
+ "\t\tport ID : Select the given port ID\n\n"
+
+ "\tbuffer -- Print value from selected Context for a selected buffer\n"
+ "\t\tbuffer? : Waiting for the user gives a buffer ID\n"
+ "\t\tbuffer ID : Select the given buffer ID\n\n"
+
+ "\tmachine -- Print selected machine runtime data\n"
+ "\t\tmachine? : Waiting for the user gives a machine ID\n"
+ "\t\tmachine ID : Select the given machine ID\n\n"
+
+ "\tstate -- Print a selected state code\n"
+ "\t\tstate? : Waiting for the user gives a state ID\n"
+ "\t\tstate ID : Select the given state ID\n\n"
+
+ "\ttransition -- Print a selected transition code\n"
+ "\t\ttransition? : Waiting for the user gives a transition ID\n"
+ "\t\ttransition ID : Select the given transition ID\n\n"
+
+ "\troutine -- Print a selected routine code\n"
+ "\t\troutine? : Waiting for the user gives a routine ID\n"
+ "\t\troutine ID : Select the given routine ID\n"
+
+ "\ttrace -- Trace of all selected data specified in << section DEBUG#TRACE >>\n"
+
+ "\tdetail -- Enable/disable detail level: "
+ "- for minimum , + for medium , * for maximum , nothing for default\n"
+
+ "\tfullpath -- Enable/disable the << full path trace flag >> for showing "
+ "selected data from the selected context to the root !\n";
+
+
+
+std::string IDebugProcessorProvider::DEBUG_SHELL_COMMAND_PRINT =
+ "\techo msg -- print the message text in the console'\n"
+
+ "\tprint -- print ...\n"
+ "\tshow -- shouw ...\n";
+
+
+std::string IDebugProcessorProvider::DEBUG_SHELL_COMMAND_REPORT =
+ "\tcfg -- \n"
+ "\tconfig -- Print current Diversity processing configuration\n"
+
+ "\tscheduler -- Print current Diversity processing scheduler\n"
+
+ "\trp -- \n"
+ "\treport -- Print current Diversity processing report\n"
+
+ "\tsave -- Save a snapshot of the Diversity process\n\n";
+
+
+std::string IDebugProcessorProvider::DEBUG_SHELL_COMMAND_BREAKPOINT =
+ "\tbp\n"
+ "\tbreakpoint -- Print breakpoints information:\n"
+ "\t\tThe step count and the interaction period for break\n"
+ "\t\tThe next step interaction breakpoint\n"
+ "\t\tThe next context interaction breakpoint\n";
+
+
+std::string IDebugProcessorProvider::DEBUG_SHELL_COMMAND_OPTION =
+ "\tenable -- Enable an ineraction for a givent process\n"
+ "\t\tenable? : Waiting for the user selects a process in "
+ "{ prefilter , postfilter , preprocess , postprocess }\n"
+ "\t\tenable#prefilter : the 'prefilter' process\n"
+ "\t\tenable#postfilter : the 'postfilter' process\n"
+ "\t\tenable#preprocess : the 'preprocess' process\n"
+ "\t\tenable#postprocess : the 'postprocess' process\n\n"
+
+
+ "\tdisable -- Disable an ineraction for a givent process\n"
+ "\t\tdisable? : Waiting for the user selects a process in "
+ "{ prefilter , postfilter , preprocess , postprocess }\n"
+ "\t\tdisable#prefilter : the 'prefilter' process\n"
+ "\t\tdisable#postfilter : the 'postfilter' process\n"
+ "\t\tdisable#preprocess : the 'preprocess' process\n"
+ "\t\tdisable#postprocess : the 'postprocess' process\n";
+
+
+std::string IDebugProcessorProvider::DEBUG_SHELL_COMMAND_LOG =
+ "\tverbosity -- Set verbosity at the given level : "
+ "SILENT < MINIMUM < MEDIUM < MAXIMUM\n"
+ "\t\tverbosity? : Waiting for the user gives a verbosity level\n\n"
+
+
+ "\tdebug#level -- Set debug#level at the given level : "
+ "ZERO < LOW < MEDIUM < HIGH < ULTRA\n"
+ "\t\tdebug#level? : Waiting from user a debug level\n\n"
+
+ "\tdebug#flag -- Set debug#flag at the given flag\n"
+ "\t\tdebug#flag? : Waiting for the user gives a debug flag\n"
+
+ "\tdebug#flag#off -- Unset the debug#flag for the given flag\n"
+ "\t\tdebug#flag#off? : Waiting from user a debug flag to off\n";
+
+
+
+void IDebugProcessorProvider::dbgCommandHelp()
+{
+ if( dbgCommandArg.empty() )
+ {
+ AVM_OS_COUT << DEBUG_SHELL_COMMAND_SUMMARY << std::endl;
+ }
+ else
+ {
+ if( dbgCommandArg == "?" )
+ {
+ AVM_OS_COUT << "Select a section { control , print , report , "
+ "step , queue , ctx , data , option , log } :> ";
+
+ std::getline(std::cin, dbgCommandArg);
+ StringTools::ltrim( dbgCommandArg );
+ }
+ else if( (dbgCommandArg[0] == '#') || (dbgCommandArg[0] == '?') )
+ {
+ dbgCommandArg = dbgCommandArg.substr( 1 );
+ }
+
+ if( dbgCommandArg.find("history") != std::string::npos )
+ {
+ AVM_OS_COUT << "Help on command for invoking an old command\n"
+ << DEBUG_SHELL_COMMAND_HISTORY << std::endl;
+ }
+ else if( dbgCommandArg.find("control") != std::string::npos )
+ {
+ AVM_OS_COUT << "Help on command for controlling the debug process\n"
+ << DEBUG_SHELL_COMMAND_CONTROL << std::endl;
+ }
+ else if( dbgCommandArg.find("queue") != std::string::npos )
+ {
+ AVM_OS_COUT << "Help on command for analyzing the execution queue\n"
+ << DEBUG_SHELL_COMMAND_QUEUE << std::endl;
+ }
+ else if( dbgCommandArg.find("ctx") != std::string::npos )
+ {
+ AVM_OS_COUT << "Help on command for execution context selection\n"
+ << DEBUG_SHELL_COMMAND_CONTEX << std::endl;
+ }
+ else if( dbgCommandArg.find("data") != std::string::npos )
+ {
+ AVM_OS_COUT << "Help on command for analyzing the execution data\n"
+ << DEBUG_SHELL_COMMAND_DATA << std::endl;
+ }
+
+ else if( dbgCommandArg.find("print") != std::string::npos )
+ {
+ AVM_OS_COUT << "Help on command for printing in the console: "
+ "text message, ...\n"
+ << DEBUG_SHELL_COMMAND_PRINT << std::endl;
+ }
+ else if( (dbgCommandArg.find("report") != std::string::npos) ||
+ (dbgCommandArg == "rp") )
+ {
+ AVM_OS_COUT << "Help on command for reporting on the evaluation snapshot\n"
+ << DEBUG_SHELL_COMMAND_REPORT << std::endl;
+ }
+ else if( (dbgCommandArg.find("breakpoint") != std::string::npos) ||
+ (dbgCommandArg.find("bp") != std::string::npos) )
+ {
+ AVM_OS_COUT << "Help on command for breakpoints informations\n"
+ << DEBUG_SHELL_COMMAND_BREAKPOINT << std::endl;
+ }
+ else if( dbgCommandArg.find("option") != std::string::npos )
+ {
+ AVM_OS_COUT << "Help on command for enable specific debug process\n"
+ << DEBUG_SHELL_COMMAND_OPTION << std::endl;
+ }
+ else if( dbgCommandArg.find("log") != std::string::npos )
+ {
+ AVM_OS_COUT << "Help on command for enable debug level or flag\n"
+ << DEBUG_SHELL_COMMAND_LOG << std::endl;
+ }
+ else
+ {
+ AVM_OS_COUT << DEBUG_SHELL_COMMAND_SUMMARY << std::endl;
+ }
+ }
+
+ AVM_OS_COUT << std::endl;
+
+}
+
+
+void IDebugProcessorProvider::dbgCommandHistory()
+{
+ if( dbgCommandArg.empty() )
+ {
+ dbgOffset = dbgCommandLineHistory.size();
+ }
+ else if( dbgCommandArg == "?" )
+ {
+ AVM_OS_COUT << "Enter an integer as history command count :> ";
+
+ std::cin >> dbgOffset;
+ }
+ else
+ {
+ if( (dbgCommandArg[0] == '#') || (dbgCommandArg[0] == '?') )
+ {
+ dbgCommandArg = dbgCommandArg.substr( 1 );
+ }
+
+ from_string<avm_size_t>(dbgCommandArg, dbgOffset);
+ }
+
+ avm_integer_t historyCount =
+ std::min(dbgOffset, dbgCommandLineHistory.size()) - 1;
+
+ AVM_OS_COUT << "Command history :> " << std::endl;
+ AVM_OS_COUT << "\t" << "0: <this history command> " << dbgCommandLine << std::endl;
+ for( dbgOffset = 1 ; historyCount >= 0 ; ++dbgOffset, --historyCount )
+ {
+ AVM_OS_COUT << "\t" << dbgOffset << ": "
+ << dbgCommandLineHistory[historyCount] << std::endl;
+ }
+}
+
+
+void IDebugProcessorProvider::dbgCommandConfig()
+{
+ mDebugProcessor->getControllerUnitManager().toStream( AVM_OS_COUT );
+
+ AVM_OS_COUT << std::endl;
+
+ AVM_OS_COUT << "The debug< enable > processes are :> "
+ << ( mDebugPrefilteringFlag ? " prefilter" : "" )
+ << ( mDebugPrefilteringFinalizeFlag ? " prefilter#finalize" : "" )
+ << ( mDebugPostfilteringFlag ? " postfilter" : "" )
+ << ( mDebugPostfilteringFinalizeFlag ? " postfilter#finalize" : "" )
+ << ( mDebugPreprocessingFlag ? " preprocess" : "" )
+ << ( mDebugPostprocessingFlag ? " postprocess" : "" )
+ << std::endl;
+
+ AVM_OS_COUT << "The step count : "
+ << mDebugEvalStepCount << std::endl;
+
+ AVM_OS_COUT << "Next interaction step : "
+ << mDebugBreakpointEvalStep << std::endl;
+
+ AVM_OS_COUT << "Interaction period : "
+ << mDebugBreakpointEvalStepPeriod << std::endl;
+
+ if( mDebugBreakpointEvalContext > 0 )
+ {
+ AVM_OS_COUT << "Next interaction ctx : "
+ << mDebugBreakpointEvalContext << std::endl;
+ }
+
+ AVM_OS_COUT << std::endl;
+
+
+ AVM_OS_COUT << "The user trace element :> ";
+ mDebugTraceSequence.toStream(AVM_OS_COUT);
+
+ AVM_OS_COUT << "detail :";
+ if( dbgDetailsMin || dbgDetailsMed || dbgDetailsMax )
+ {
+ if( dbgDetailsMin ) { AVM_OS_COUT << " MINIMUM"; }
+ if( dbgDetailsMed ) { AVM_OS_COUT << " MEDIUM" ; }
+ if( dbgDetailsMax ) { AVM_OS_COUT << " MAXIMUM"; }
+ }
+ else
+ {
+ AVM_OS_COUT << " DEFAULT";
+ }
+
+ AVM_OS_COUT << std::endl << std::endl;
+
+ if( mDebugSelectedContext != NULL )
+ {
+ AVM_OS_COUT << "Selected Context :> ";
+
+ mDebugSelectedContext->traceDefaultEval(AVM_OS_COUT);
+
+ AVM_OS_COUT << std::endl;
+ }
+
+
+ AVM_OS_COUT << "Verbosity level :> " << avm_strExecVerbosityLevel()
+ << std::endl;
+ AVM_OS_COUT << "Debug trace level :> " << avm_strDebugLevel()
+ << std::endl;
+ AVM_OS_COUT << "Debug trace flag :> " << avm_strDebugFlag(" | ")
+ << std::endl << std::endl;
+}
+
+
+void IDebugProcessorProvider::dbgCommandBreak()
+{
+ if( dbgCommandArg.empty() || (dbgCommandArg == "?") )
+ {
+ AVM_OS_COUT << "Enter an integer as step number :> ";
+
+ std::cin >> dbgIntValue;
+ }
+ else
+ {
+ if( (dbgCommandArg[0] == '#') || (dbgCommandArg[0] == '?') )
+ {
+ dbgCommandArg = dbgCommandArg.substr( 1 );
+ }
+
+ from_string<avm_integer_t>(dbgCommandArg, dbgIntValue);
+ }
+
+ mDebugBreakpointEvalContext =
+ std::max(static_cast< avm_integer_t>( 0 ), dbgIntValue);
+}
+
+
+void IDebugProcessorProvider::dbgCommandNext()
+{
+ if( dbgCommandArg.empty() )
+ {
+ // Continue until next predefined break step !!!
+ }
+ else if( dbgCommandArg[0] == 'i' )
+ {
+ mDebugBreakpointEvalStep = mDebugEvalStepCount + 1;
+ }
+ else
+ {
+ if( dbgCommandArg == "?" )
+ {
+ AVM_OS_COUT << "Enter an integer as step number :> ";
+
+ std::cin >> dbgIntValue;
+ }
+ else
+ {
+ if( (dbgCommandArg[0] == '#') || (dbgCommandArg[0] == '?') )
+ {
+ dbgCommandArg = dbgCommandArg.substr( 1 );
+ }
+
+ from_string<avm_integer_t>(dbgCommandArg, dbgIntValue);
+ }
+
+ mDebugBreakpointEvalStep = mDebugEvalStepCount +
+ std::max(static_cast< avm_integer_t>( 1 ), dbgIntValue);
+ }
+}
+
+
+void IDebugProcessorProvider::dbgCommandPeriod()
+{
+ if( dbgCommandArg.empty() || (dbgCommandArg == "?") )
+ {
+ AVM_OS_COUT << "Enter an integer as step interaction period :> ";
+
+ std::cin >> dbgIntValue;
+ }
+ else
+ {
+ if( (dbgCommandArg[0] == '#') || (dbgCommandArg[0] == '?') )
+ {
+ dbgCommandArg = dbgCommandArg.substr( 1 );
+ }
+
+ from_string<avm_integer_t>(dbgCommandArg, dbgIntValue);
+ }
+
+ mDebugBreakpointEvalStepPeriod =
+ std::max(static_cast< avm_integer_t>( 1 ), dbgIntValue);
+
+ mDebugBreakpointEvalStep =
+ mDebugEvalStepCount + mDebugBreakpointEvalStepPeriod;
+}
+
+
+void IDebugProcessorProvider::dbgCommandQueue()
+{
+ if( dbgCommandArg.empty() )
+ {
+ mDebugProcessor->getExecutionQueue().toStream(AVM_OS_COUT);
+ }
+ else
+ {
+ if( dbgCommandArg == "?" )
+ {
+ AVM_OS_COUT << "Select a queue "
+ "{ init , waiting , ready , result , failed } :> ";
+
+ std::getline(std::cin, dbgCommandArg);
+ StringTools::ltrim( dbgCommandArg );
+ }
+ else if( (dbgCommandArg[0] == '#') || (dbgCommandArg[0] == '?') )
+ {
+ dbgCommandArg = dbgCommandArg.substr( 1 );
+ }
+
+ if( dbgCommandArg.find("init") != std::string::npos )
+ {
+ AVM_OS_COUT << "the INIT QUEUE :> " << std::endl;
+ mDebugProcessor->getExecutionQueue().toStream(
+ mDebugProcessor->getExecutionQueue().getInitQueue(),
+ AVM_OS_COUT);
+ }
+ if( dbgCommandArg.find("waiting") != std::string::npos )
+ {
+ mDebugProcessor->getExecutionQueue().toStreamWaiting(AVM_OS_COUT);
+ }
+ if( dbgCommandArg.find("ready") != std::string::npos )
+ {
+ AVM_OS_COUT << "the READY QUEUE :> " << std::endl;
+ mDebugProcessor->getExecutionQueue().toStream(
+ mDebugProcessor->getExecutionQueue().getReadyQueue(),
+ AVM_OS_COUT);
+ }
+ if( dbgCommandArg.find("result") != std::string::npos )
+ {
+ AVM_OS_COUT << "the RESULT QUEUE :> " << std::endl;
+ mDebugProcessor->getExecutionQueue().toStream(
+ mDebugProcessor->getExecutionQueue().getResultQueue(),
+ AVM_OS_COUT);
+ }
+ if( dbgCommandArg.find("failed") != std::string::npos )
+ {
+ AVM_OS_COUT << "the FAILED QUEUE :> " << std::endl;
+ mDebugProcessor->getExecutionQueue().toStream(
+ mDebugProcessor->getExecutionQueue().getFailedQueue(),
+ AVM_OS_COUT);
+ }
+ }
+
+ AVM_OS_COUT << std::endl;
+}
+
+
+static const ExecutionContext * searchContext(
+ const ExecutionContext * anEC, avm_uint32_t ctxID)
+{
+ if( anEC->getIdNumber() == ctxID )
+ {
+ return( anEC );
+ }
+
+ else// if( anEC->nonempty() && (anEC->getIdNumber() < ctxID) )
+ {
+ ExecutionContext::child_iterator itEC = anEC->begin();
+ ExecutionContext::child_iterator endEC = anEC->end();
+ for( ; (itEC != endEC) ; ++itEC )
+ {
+ if( (anEC = searchContext((*itEC), ctxID)) != NULL )
+ {
+ return( anEC );
+ }
+ }
+ }
+
+ return( NULL );
+}
+
+void IDebugProcessorProvider::dbgCommandContext()
+{
+ if( dbgCommandArg.empty() && (mDebugSelectedContext != NULL) )
+ {
+ AVM_OS_COUT << "Selected Context :> ";
+
+ mDebugSelectedContext->traceDefaultEval(AVM_OS_COUT);
+
+ if( dbgDetailsMed || dbgDetailsMax )
+ {
+ mDebugSelectedContext->toDebugFet(AVM_OS_COUT);
+ }
+ else if( not dbgDetailsMin )
+ {
+ mDebugSelectedContext->toDebug(AVM_OS_COUT);
+ }
+
+ AVM_OS_COUT << std::endl;
+
+ return;
+ }
+
+
+ else if( dbgCommandArg.empty() || (dbgCommandArg == "?") )
+ {
+ AVM_OS_COUT << "Select an Execution Context :> ";
+
+ std::cin >> dbgIntValue;
+ }
+ else
+ {
+ if( (dbgCommandArg[0] == '#') || (dbgCommandArg[0] == '?') )
+ {
+ dbgCommandArg = dbgCommandArg.substr( 1 );
+ }
+
+ from_string<avm_integer_t>(dbgCommandArg, dbgIntValue);
+ }
+
+
+ dbgEC = NULL;
+
+ if( mDebugSelectedContext != NULL )
+ {
+ // Searching in the childs of theSelectedContext
+ dbgEC = searchContext( mDebugSelectedContext,
+ std::max(static_cast< avm_integer_t>( 0 ), dbgIntValue) );
+ if( dbgEC != NULL )
+ {
+ mDebugSelectedContext = dbgEC;
+ }
+
+ // If not found, Searching in the ancestors of theSelectedContext
+ if( dbgEC == NULL )
+ {
+ dbgEC = mDebugSelectedContext;
+ for( ; dbgEC != NULL ; dbgEC = dbgEC->getPrevious() )
+ {
+ if( dbgEC->getIdNumber() == dbgIntValue )
+ {
+ mDebugSelectedContext = dbgEC;
+ break;
+ }
+ }
+ }
+ }
+
+ // If not found, Searching in the current dbgQueue
+ if( dbgEC == NULL )
+ {
+ if( dbgQueue->nonempty() )
+ {
+ dbgQueueIt = dbgQueue->begin();
+ dbgQueueItEnd = dbgQueue->end();
+ for( ; dbgQueueIt != dbgQueueItEnd ; ++dbgQueueIt )
+ {
+ if( (*dbgQueueIt)->getIdNumber() == dbgIntValue )
+ {
+ mDebugSelectedContext = dbgEC = (*dbgQueueIt);
+ break;
+ }
+ }
+ }
+
+ // If not found, Searching in the Execution graph from the root context
+ if( dbgEC == NULL )
+ {
+ dbgEC = searchContext(
+ mDebugProcessor->getConfiguration().getFirstTrace(),
+ std::max(static_cast< avm_integer_t>( 0 ), dbgIntValue) );
+
+ if( dbgEC != NULL )
+ {
+ mDebugSelectedContext = dbgEC;
+ }
+ }
+ }
+
+
+ if( dbgEC == NULL )
+ {
+ AVM_OS_COUT << "Unfound Execution Context by id: " << dbgIntValue
+ << " !!! Unchange current selection ..."
+ << std::endl << std::endl;
+ }
+
+ if( mDebugSelectedContext != NULL )
+ {
+ AVM_OS_COUT << "Selected Context :> ";
+
+ mDebugSelectedContext->traceDefaultEval(AVM_OS_COUT);
+
+ if( dbgDetailsMed || dbgDetailsMax )
+ {
+ mDebugSelectedContext->toDebugFet(AVM_OS_COUT);
+ }
+ else if( not dbgDetailsMin )
+ {
+ mDebugSelectedContext->toDebug(AVM_OS_COUT);
+ }
+
+ AVM_OS_COUT << std::endl;
+ }
+}
+
+
+void IDebugProcessorProvider::dbgCommandPath()
+{
+ if( dbgCommandArg.empty() && (mDebugSelectedContext != NULL) )
+ {
+ dbgEC = mDebugSelectedContext;
+
+ AVM_OS_COUT << "Selected Path, current selected context :> " << std::endl;
+ dbgEC->traceDefaultEval(AVM_OS_COUT);
+
+ dbgEC->toDebug(AVM_OS_COUT);
+
+ AVM_OS_COUT << std::endl << "Ancestors :> " << std::endl;
+
+ dbgEC = dbgEC->getPrevious();
+ for( ; dbgEC != NULL ; dbgEC = dbgEC->getPrevious() )
+ {
+ dbgEC->traceDefault(AVM_OS_COUT);
+
+ dbgEC->toDebug(AVM_OS_COUT);
+ }
+
+ AVM_OS_COUT << std::endl;
+
+ return;
+ }
+
+
+ else if( dbgCommandArg.empty() || (dbgCommandArg == "?") )
+ {
+ AVM_OS_COUT << "Select an Execution Context :> ";
+
+ std::cin >> dbgIntValue;
+ }
+ else
+ {
+ if( (dbgCommandArg[0] == '#') || (dbgCommandArg[0] == '?') )
+ {
+ dbgCommandArg = dbgCommandArg.substr( 1 );
+ }
+
+ from_string<avm_integer_t>(dbgCommandArg, dbgIntValue);
+ }
+
+
+ dbgEC = NULL;
+
+ if( mDebugSelectedContext != NULL )
+ {
+ // Searching in the childs of mDebugSelectedContext
+ dbgEC = searchContext( mDebugSelectedContext,
+ std::max(static_cast< avm_integer_t>( 0 ), dbgIntValue) );
+ if( dbgEC != NULL )
+ {
+ mDebugSelectedContext = dbgEC;
+ }
+
+ // If not found, Searching in the ancestors of mDebugSelectedContext
+ if( dbgEC == NULL )
+ {
+ dbgEC = mDebugSelectedContext;
+ for( ; dbgEC != NULL ; dbgEC = dbgEC->getPrevious() )
+ {
+ if( dbgEC->getIdNumber() == dbgIntValue )
+ {
+ mDebugSelectedContext = dbgEC;
+ break;
+ }
+ }
+ }
+ }
+
+ // If not found, Searching in the current dbgQueue
+ if( dbgEC == NULL )
+ {
+ if( dbgQueue->nonempty() )
+ {
+ dbgQueueIt = dbgQueue->begin();
+ dbgQueueItEnd = dbgQueue->end();
+ for( ; dbgQueueIt != dbgQueueItEnd ; ++dbgQueueIt )
+ {
+ if( (*dbgQueueIt)->getIdNumber() == dbgIntValue )
+ {
+ mDebugSelectedContext = dbgEC = (*dbgQueueIt);
+ break;
+ }
+ }
+ }
+
+ // If not found, Searching in the Execution graph from the root context
+ if( dbgEC == NULL )
+ {
+ dbgEC = searchContext(
+ mDebugProcessor->getConfiguration().getFirstTrace(),
+ std::max(static_cast< avm_integer_t>( 0 ), dbgIntValue) );
+
+ if( dbgEC != NULL )
+ {
+ mDebugSelectedContext = dbgEC;
+ }
+ }
+ }
+
+ if( dbgEC != NULL )
+ {
+ AVM_OS_COUT << "Selected Path, current selected context :> " << std::endl;
+ dbgEC->traceDefaultEval(AVM_OS_COUT);
+
+ dbgEC->toDebug(AVM_OS_COUT);
+
+ AVM_OS_COUT << std::endl << "Ancestors :> " << std::endl;
+
+ dbgEC = dbgEC->getPrevious();
+ for( ; dbgEC != NULL ; dbgEC = dbgEC->getPrevious() )
+ {
+ dbgEC->traceDefault(AVM_OS_COUT);
+
+ dbgEC->toDebug(AVM_OS_COUT);
+ }
+
+ AVM_OS_COUT << std::endl;
+ }
+ else
+ {
+ AVM_OS_COUT << "Unfound Execution Context by id: " << dbgIntValue
+ << " !!! Unchange current selection ..."
+ << std::endl << std::endl;
+ }
+}
+
+
+void IDebugProcessorProvider::dbgCommandTrace()
+{
+ AVM_OS_COUT << "The user trace element :> ";
+ mDebugTraceSequence.toStream(AVM_OS_COUT );
+ AVM_OS_COUT << std::endl;
+}
+
+void IDebugProcessorProvider::dbgCommandTraceDetailLevel()
+{
+ if( not dbgCommandArg.empty() )
+ {
+ if( dbgCommandArg[0] == '-' )
+ {
+ dbgDetailsMin = not dbgDetailsMin;
+ }
+ else if( dbgCommandArg[0] == '+' )
+ {
+ dbgDetailsMed = not dbgDetailsMed;
+ }
+ else if( dbgCommandArg[0] == '*' )
+ {
+ dbgDetailsMax = not dbgDetailsMax;
+ }
+ }
+ else
+ {
+ dbgDetailsMin = dbgDetailsMed = dbgDetailsMax = false;
+ }
+
+ AVM_OS_COUT << "detail :";
+ if( dbgDetailsMin || dbgDetailsMed || dbgDetailsMax )
+ {
+ if( dbgDetailsMin ) { AVM_OS_COUT << " MINIMUM"; }
+ if( dbgDetailsMed ) { AVM_OS_COUT << " MEDIUM" ; }
+ if( dbgDetailsMax ) { AVM_OS_COUT << " MAXIMUM"; }
+ }
+ else
+ {
+ AVM_OS_COUT << " DEFAULT";
+ }
+
+ AVM_OS_COUT << std::endl << std::endl;
+}
+
+
+
+void IDebugProcessorProvider::dbgCommandVar()
+{
+ if( (dbgCommandArg.empty() && (mDebugSelectedVar == NULL)) ||
+ (dbgCommandArg == "?") )
+ {
+ AVM_OS_COUT << "Enter a variable ID :> ";
+
+ std::getline(std::cin, dbgCommandArg);
+ StringTools::ltrim( dbgCommandArg );
+ }
+ else
+ {
+ if( dbgCommandArg[0] == '?' )
+ {
+ dbgCommandArg = dbgCommandArg.substr( 1 );
+ }
+ }
+
+ if( not dbgCommandArg.empty() )
+ {
+ dbgTP = dbgTracePoint = new TracePoint(
+ ENUM_TRACE_POINT::TRACE_VARIABLE_NATURE, AVM_OPCODE_ASSIGN);
+
+ if( dbgTracePoint->configureVariable(mDebugConfiguration, dbgCommandArg) )
+ {
+ if( mDebugTraceSequence.containsPoint(dbgTracePoint, dbgTP) )
+ {
+ mDebugSelectedVar = dbgTP.to_ptr< TracePoint >();
+
+ mDebugSelectedVars.add_union( mDebugSelectedVar );
+ }
+ else
+ {
+ dbgTracePoint->tpid = ++(mDebugTraceFactory->TP_ID);
+
+ mDebugTraceSequence.points.append( dbgTP );
+
+ mDebugSelectedVars.append(
+ mDebugSelectedVar = dbgTracePoint );
+ }
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound variable << " << dbgCommandArg << " >> !"
+ << std::endl;
+ }
+ }
+
+
+ if( mDebugSelectedVar != NULL )
+ {
+ AVM_OS_COUT << "Selected variable :> ";
+ mDebugSelectedVar->toStream(AVM_OS_COUT);
+
+ if( mDebugSelectedContext != NULL )
+ {
+ dbgEC = mDebugSelectedContext;
+ do
+ {
+ AVM_OS_COUT << "With selected Context :> ";
+ dbgEC->traceMinimum(AVM_OS_COUT);
+
+ dbgPrintVarInfo( mDebugSelectedVar );
+ }
+ while( mDebugTraceFullPathFlag &&
+ ((dbgEC = dbgEC->getPrevious()) != NULL) );
+ }
+
+ AVM_OS_COUT << std::endl;
+ }
+}
+
+
+void IDebugProcessorProvider::dbgPrintVarInfo(TracePoint * aTP)
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( dbgEC ) << "Execution Context !!!"
+ << SEND_EXIT;
+
+ dbgED = dbgEC->getAPExecutionData();
+
+ if( aTP->RID.valid() )
+ {
+ dbgValue = mDebugProcessor->getENV().getRvalue(dbgED,
+ aTP->RID, aTP->object->to< InstanceOfData >() );
+ }
+ else if( (aTP->getExecutable() != NULL) &&
+ aTP->getExecutable()->hasInitialInstance() )
+ {
+ dbgValue = mDebugProcessor->getENV().getRvalue(
+ dbgED, aTP->object->to< InstanceOfData >() );
+ }
+ else
+ {
+ dbgValue = BF::REF_NULL;
+ }
+
+ if( dbgValue.valid() )
+ {
+ AVM_OS_COUT << " ==> var " << aTP->object->to< InstanceOfData >()->
+ getTypeSpecifier()->strT() << " " << aTP->object->getNameID()
+ << " = " << dbgValue.str() << std::endl;
+ }
+}
+
+void IDebugProcessorProvider::dbgCommandVars()
+{
+ AVM_OS_COUT << "Selected variables :> " << std::endl;
+ mDebugTraceFactory->toStream(AVM_OS_COUT, mDebugSelectedVars);
+
+ if( mDebugSelectedContext != NULL )
+ {
+ AVM_OS_COUT << "With selected Context :> ";
+ mDebugSelectedContext->debugDefault(AVM_OS_COUT);
+
+ dbgPointIt = mDebugSelectedVars.begin();
+ dbgPointItEnd = mDebugSelectedVars.end();
+ for( ; dbgPointIt != dbgPointItEnd ; ++dbgPointIt )
+ {
+ dbgPrintVarInfo( *dbgPointIt );
+ }
+ }
+
+ AVM_OS_COUT << std::endl;
+}
+
+
+void IDebugProcessorProvider::dbgCommandTime()
+{
+ if( (dbgCommandArg.empty() && (mDebugSelectedTimeVar == NULL)) ||
+ (dbgCommandArg == "?") )
+ {
+ AVM_OS_COUT << "Enter a time variable ID :> ";
+
+ std::getline(std::cin, dbgCommandArg);
+ StringTools::ltrim( dbgCommandArg );
+ }
+ else
+ {
+ if( dbgCommandArg[0] == '?' )
+ {
+ dbgCommandArg = dbgCommandArg.substr( 1 );
+ }
+ }
+
+ if( not dbgCommandArg.empty() )
+ {
+ dbgTP = dbgTracePoint = new TracePoint(
+ ENUM_TRACE_POINT::TRACE_TIME_NATURE, AVM_OPCODE_TIMED_GUARD);
+ dbgTracePoint->object = mDebugDeltaTimeVariable;
+
+ if( dbgTracePoint->configureVariable(mDebugConfiguration, dbgCommandArg) )
+ {
+ if( mDebugTraceSequence.containsPoint(dbgTracePoint, dbgTP) )
+ {
+ mDebugSelectedTimeVar = dbgTP.to_ptr< TracePoint >();
+
+ mDebugSelectedVars.add_union( mDebugSelectedTimeVar );
+ }
+ else
+ {
+ dbgTracePoint->tpid = ++(mDebugTraceFactory->TP_ID);
+
+ mDebugTraceSequence.points.append( dbgTP );
+
+ mDebugSelectedVars.append(
+ mDebugSelectedTimeVar = dbgTracePoint );
+ }
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound time variable << " << dbgCommandArg << " >> !"
+ << std::endl;
+ }
+ }
+
+ if( mDebugSelectedTimeVar != NULL )
+ {
+ AVM_OS_COUT << "Selected time variable :> ";
+ mDebugSelectedTimeVar->toStream(AVM_OS_COUT);
+
+ if( mDebugSelectedContext != NULL )
+ {
+ AVM_OS_COUT << "With selected Context :> ";
+ mDebugSelectedContext->debugDefault(AVM_OS_COUT);
+
+ dbgPrintVarInfo( mDebugSelectedTimeVar );
+ }
+
+ AVM_OS_COUT << std::endl;
+ }
+}
+
+
+void IDebugProcessorProvider::dbgCommandPort(
+ ENUM_TRACE_POINT::TRACE_NATURE nature)
+{
+ if( (dbgCommandArg.empty() && (mDebugSelectedPort == NULL)) ||
+ (dbgCommandArg == "?") )
+ {
+ AVM_OS_COUT << "Enter a port ID :> ";
+
+ std::getline(std::cin, dbgCommandArg);
+ StringTools::ltrim( dbgCommandArg );
+ }
+ else
+ {
+ if( dbgCommandArg[0] == '?' )
+ {
+ dbgCommandArg = dbgCommandArg.substr( 1 );
+ }
+ }
+
+ if( not dbgCommandArg.empty() )
+ {
+ dbgTP = dbgTracePoint = new TracePoint(nature, AVM_OPCODE_NULL);
+
+ if( dbgTracePoint->configurePort(
+ mDebugConfiguration, dbgCommandArg, mDebugSelectedPorts) )
+ {
+ if( mDebugTraceSequence.containsPoint(dbgTracePoint, dbgTP) )
+ {
+ mDebugSelectedPort = dbgTP.to_ptr< TracePoint >();
+
+ mDebugSelectedPorts.add_union( mDebugSelectedPort );
+ }
+ else
+ {
+ dbgTracePoint->tpid = ++(mDebugTraceFactory->TP_ID);
+
+ mDebugTraceSequence.points.append( dbgTP );
+
+ mDebugSelectedPorts.append(
+ mDebugSelectedPort = dbgTracePoint );
+ }
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound port << " << dbgCommandArg << " >> !"
+ << std::endl;
+ }
+ }
+
+ if( mDebugSelectedPort != NULL )
+ {
+ AVM_OS_COUT << "Selected port :> ";
+ mDebugSelectedPort->toStream(AVM_OS_COUT);
+
+ if( mDebugSelectedContext != NULL )
+ {
+ AVM_OS_COUT << "With selected Context :> ";
+ mDebugSelectedContext->debugDefault(AVM_OS_COUT);
+
+ dbgPrintPortInfo( mDebugSelectedPort );
+ }
+
+ }
+}
+
+void IDebugProcessorProvider::dbgPrintPortInfo(TracePoint * aTP)
+{
+
+}
+
+void IDebugProcessorProvider::dbgCommandPorts(
+ ENUM_TRACE_POINT::TRACE_NATURE nature)
+{
+ AVM_OS_COUT << "Selected ports :> " << std::endl;
+// mDebugTraceFactory->toStream(AVM_OS_COUT, mDebugSelectedPorts);
+ dbgPointIt = mDebugSelectedPorts.begin();
+ dbgPointItEnd = mDebugSelectedPorts.end();
+ for( ; dbgPointIt != dbgPointItEnd ; ++dbgPointIt )
+ {
+ switch( nature )
+ {
+ case ENUM_TRACE_POINT::TRACE_CHANNEL_NATURE:
+ case ENUM_TRACE_POINT::TRACE_MESSAGE_NATURE:
+ case ENUM_TRACE_POINT::TRACE_PORT_NATURE:
+ case ENUM_TRACE_POINT::TRACE_SIGNAL_NATURE:
+ {
+ if( (*dbgPointIt)->nature == nature )
+ {
+ (*dbgPointIt)->toStream(AVM_OS_COUT);
+ }
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_COM_NATURE:
+ default:
+ {
+ (*dbgPointIt)->toStream(AVM_OS_COUT);
+
+ break;
+ }
+ }
+ }
+
+ if( mDebugSelectedContext != NULL )
+ {
+ AVM_OS_COUT << "With selected Context :> ";
+ mDebugSelectedContext->debugDefault(AVM_OS_COUT);
+
+ dbgPointIt = mDebugSelectedPorts.begin();
+ dbgPointItEnd = mDebugSelectedPorts.end();
+ for( ; dbgPointIt != dbgPointItEnd ; ++dbgPointIt )
+ {
+ switch( nature )
+ {
+ case ENUM_TRACE_POINT::TRACE_CHANNEL_NATURE:
+ case ENUM_TRACE_POINT::TRACE_MESSAGE_NATURE:
+ case ENUM_TRACE_POINT::TRACE_PORT_NATURE:
+ case ENUM_TRACE_POINT::TRACE_SIGNAL_NATURE:
+ {
+ if( (*dbgPointIt)->nature == nature )
+ {
+ dbgPrintPortInfo( *dbgPointIt );
+ }
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_COM_NATURE:
+ default:
+ {
+ dbgPrintPortInfo( *dbgPointIt );
+
+ break;
+ }
+ }
+ }
+ }
+
+ AVM_OS_COUT << std::endl;
+}
+
+
+void IDebugProcessorProvider::dbgCommandBuffer()
+{
+ if( (dbgCommandArg.empty() && (mDebugSelectedBuffer == NULL)) ||
+ (dbgCommandArg == "?") )
+ {
+ AVM_OS_COUT << "Enter a buffer ID :> ";
+
+ std::getline(std::cin, dbgCommandArg);
+ StringTools::ltrim( dbgCommandArg );
+ }
+ else
+ {
+ if( dbgCommandArg[0] == '?' )
+ {
+ dbgCommandArg = dbgCommandArg.substr( 1 );
+ }
+ }
+
+ if( not dbgCommandArg.empty() )
+ {
+ dbgTP = dbgTracePoint = new TracePoint(
+ ENUM_TRACE_POINT::TRACE_BUFFER_NATURE, AVM_OPCODE_NULL);
+
+ if( dbgTracePoint->configureVariable(mDebugConfiguration, dbgCommandArg) )
+ {
+ if( mDebugTraceSequence.containsPoint(dbgTracePoint, dbgTP) )
+ {
+ mDebugSelectedBuffer = dbgTP.to_ptr< TracePoint >();
+
+ mDebugSelectedBuffers.add_union( mDebugSelectedBuffer );
+ }
+ else
+ {
+ dbgTracePoint->tpid = ++(mDebugTraceFactory->TP_ID);
+
+ mDebugTraceSequence.points.append( dbgTP );
+
+ mDebugSelectedBuffers.append(
+ mDebugSelectedBuffer = dbgTracePoint );
+ }
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound buffer << " << dbgCommandArg << " >> !"
+ << std::endl;
+ }
+ }
+
+ if( mDebugSelectedBuffer != NULL )
+ {
+ AVM_OS_COUT << "Selected buffer :> ";
+ mDebugSelectedBuffer->toStream(AVM_OS_COUT);
+
+ if( mDebugSelectedContext != NULL )
+ {
+ dbgEC = mDebugSelectedContext;
+ do
+ {
+ AVM_OS_COUT << "With selected Context :> ";
+ dbgEC->traceMinimum(AVM_OS_COUT);
+
+ dbgPrintBufferInfo( mDebugSelectedBuffer );
+ }
+ while( mDebugTraceFullPathFlag &&
+ ((dbgEC = dbgEC->getPrevious()) != NULL) );
+ }
+
+ }
+}
+
+void IDebugProcessorProvider::dbgPrintBufferInfo(TracePoint * aTP)
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( dbgEC ) << "Execution Context !!!"
+ << SEND_EXIT;
+
+ dbgED = dbgEC->getAPExecutionData();
+
+ if( aTP->RID.invalid() )
+ {
+ aTP->RID = dbgED->getRuntimeContainerRID(
+ aTP->object->to< InstanceOfBuffer >() );
+ }
+
+ if( aTP->RID.valid() )
+ {
+ dbgRF = dbgED->ptrRuntime( aTP->RID );
+
+ AVM_OS_COUT << " ==> buffer " << aTP->object->getNameID() << " = ";
+ dbgRF->getBuffer(
+ aTP->object->to< InstanceOfBuffer >() ).toStream(AVM_OS_COUT);
+ AVM_OS_COUT << std::endl;
+ }
+}
+
+void IDebugProcessorProvider::dbgCommandBuffers()
+{
+ AVM_OS_COUT << "Selected buffers :> " << std::endl;
+ mDebugTraceFactory->toStream(AVM_OS_COUT, mDebugSelectedBuffers);
+
+ if( mDebugSelectedContext != NULL )
+ {
+ AVM_OS_COUT << "With selected Context :> ";
+ mDebugSelectedContext->debugDefault(AVM_OS_COUT);
+
+ dbgPointIt = mDebugSelectedBuffers.begin();
+ dbgPointItEnd = mDebugSelectedBuffers.end();
+ for( ; dbgPointIt != dbgPointItEnd ; ++dbgPointIt )
+ {
+ dbgPrintBufferInfo( *dbgPointIt );
+ }
+ }
+
+ AVM_OS_COUT << std::endl;
+}
+
+
+void IDebugProcessorProvider::dbgCommandMachine()
+{
+ if( (dbgCommandArg.empty() && (mDebugSelectedMachine == NULL)) ||
+ (dbgCommandArg == "?") )
+ {
+ AVM_OS_COUT << "Enter a machine ID :> ";
+
+ std::getline(std::cin, dbgCommandArg);
+ StringTools::ltrim( dbgCommandArg );
+ }
+ else
+ {
+ if( dbgCommandArg[0] == '?' )
+ {
+ dbgCommandArg = dbgCommandArg.substr( 1 );
+ }
+ }
+
+ if( not dbgCommandArg.empty() )
+ {
+ dbgTP = dbgTracePoint = new TracePoint(
+ ENUM_TRACE_POINT::TRACE_MACHINE_NATURE, AVM_OPCODE_RUN);
+
+ if( dbgTracePoint->configureMachine(mDebugConfiguration, dbgCommandArg) )
+ {
+ if( mDebugTraceSequence.containsPoint(dbgTracePoint, dbgTP) )
+ {
+ mDebugSelectedMachine = dbgTP.to_ptr< TracePoint >();
+
+ mDebugSelectedMachines.add_union( mDebugSelectedMachine );
+ }
+ else
+ {
+ dbgTracePoint->tpid = ++(mDebugTraceFactory->TP_ID);
+
+ mDebugTraceSequence.points.append( dbgTP );
+
+ mDebugSelectedMachines.append(
+ mDebugSelectedMachine = dbgTracePoint );
+ }
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound machine << " << dbgCommandArg << " >> !"
+ << std::endl;
+ }
+ }
+
+ if( mDebugSelectedMachine != NULL )
+ {
+ AVM_OS_COUT << "Selected machine :> ";
+ mDebugSelectedMachine->toStream(AVM_OS_COUT);
+
+ if( mDebugSelectedContext != NULL )
+ {
+ AVM_OS_COUT << "With selected Context :> ";
+ mDebugSelectedContext->debugDefault(AVM_OS_COUT);
+
+ dbgPrintMachineInfo( mDebugSelectedMachine );
+ }
+
+ AVM_OS_COUT << std::endl;
+ }
+}
+
+void IDebugProcessorProvider::dbgPrintMachineInfo(TracePoint * aTP)
+{
+ if( aTP->RID.invalid() )
+ {
+ aTP->RID = mDebugSelectedContext->refExecutionData().
+ getRuntimeID( aTP->object->to< InstanceOfMachine >() );
+ }
+
+ if( aTP->RID.valid() )
+ {
+ dbgRF = mDebugSelectedContext->refExecutionData().ptrRuntime(aTP->RID);
+
+ dbgRF->toStream(AVM_OS_COUT);
+ }
+}
+
+void IDebugProcessorProvider::dbgCommandMachines()
+{
+ AVM_OS_COUT << "Selected machines :> " << std::endl;
+ mDebugTraceFactory->toStream(AVM_OS_COUT, mDebugSelectedMachines);
+
+ if( mDebugSelectedContext != NULL )
+ {
+ AVM_OS_COUT << "With selected Context :> ";
+ mDebugSelectedContext->debugDefault(AVM_OS_COUT);
+
+ dbgPointIt = mDebugSelectedMachines.begin();
+ dbgPointItEnd = mDebugSelectedMachines.end();
+ for( ; dbgPointIt != dbgPointItEnd ; ++dbgPointIt )
+ {
+ dbgPrintMachineInfo( *dbgPointIt );
+ }
+ }
+
+ AVM_OS_COUT << std::endl;
+}
+
+
+void IDebugProcessorProvider::dbgCommandParametersMachine()
+{
+ AVM_OS_COUT << "Parameters machine :> ";
+ mDebugParametersMachine.toStream(AVM_OS_COUT);
+
+ if( mDebugSelectedContext != NULL )
+ {
+ AVM_OS_COUT << "With selected Context :> ";
+ mDebugSelectedContext->debugDefault(AVM_OS_COUT);
+
+// dbgPrintMachineInfo( & mDebugParametersMachine );
+
+ if( dbgDetailsMax )
+ {
+ mDebugSelectedContext->refExecutionData().
+ getParametersRuntimeForm().toStream(AVM_OS_COUT);
+ }
+ else if( dbgDetailsMed )
+ {
+ mDebugSelectedContext->refExecutionData().
+ getParametersRuntimeForm().toStreamData(
+ mDebugSelectedContext->getExecutionData(), AVM_OS_COUT);
+ }
+ else
+ {
+ mDebugSelectedContext->refExecutionData().
+ getParametersRuntimeForm().toFscnData(AVM_OS_COUT,
+ mDebugSelectedContext->getExecutionData(), NULL);
+ }
+ }
+
+ AVM_OS_COUT << std::endl;
+}
+
+
+void IDebugProcessorProvider::dbgCommandState()
+{
+ if( (dbgCommandArg.empty() && (mDebugSelectedState == NULL)) ||
+ (dbgCommandArg == "?") )
+ {
+ AVM_OS_COUT << "Enter a state ID :> ";
+
+ std::getline(std::cin, dbgCommandArg);
+ StringTools::ltrim( dbgCommandArg );
+ }
+ else
+ {
+ if( dbgCommandArg[0] == '?' )
+ {
+ dbgCommandArg = dbgCommandArg.substr( 1 );
+ }
+ }
+
+ if( not dbgCommandArg.empty() )
+ {
+ dbgTP = dbgTracePoint = new TracePoint(
+ ENUM_TRACE_POINT::TRACE_STATE_NATURE, AVM_OPCODE_RUN);
+
+ if( dbgTracePoint->configureMachine(mDebugConfiguration, dbgCommandArg) )
+ {
+ if( mDebugTraceSequence.containsPoint(dbgTracePoint, dbgTP) )
+ {
+ mDebugSelectedState = dbgTP.to_ptr< TracePoint >();
+
+ mDebugSelectedStates.add_union( mDebugSelectedState );
+ }
+ else
+ {
+ dbgTracePoint->tpid = ++(mDebugTraceFactory->TP_ID);
+
+ mDebugTraceSequence.points.append( dbgTP );
+
+ mDebugSelectedStates.append(
+ mDebugSelectedState = dbgTracePoint );
+ }
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound state << " << dbgCommandArg << " >> !"
+ << std::endl;
+ }
+ }
+
+ if( mDebugSelectedState != NULL )
+ {
+ AVM_OS_COUT << "Selected state :> ";
+ mDebugSelectedState->toStream(AVM_OS_COUT);
+
+ if( mDebugSelectedContext != NULL )
+ {
+ AVM_OS_COUT << "With selected Context :> ";
+ mDebugSelectedContext->debugDefault(AVM_OS_COUT);
+
+ dbgPrintStateInfo( mDebugSelectedState );
+ }
+
+ AVM_OS_COUT << std::endl;
+ }
+}
+
+void IDebugProcessorProvider::dbgPrintStateInfo(TracePoint * aTP)
+{
+ dbgPrintMachineInfo( aTP );
+}
+
+void IDebugProcessorProvider::dbgCommandStates()
+{
+ AVM_OS_COUT << "Selected states :> " << std::endl;
+ mDebugTraceFactory->toStream(AVM_OS_COUT, mDebugSelectedStates);
+
+ if( mDebugSelectedContext != NULL )
+ {
+ AVM_OS_COUT << "With selected Context :> ";
+ mDebugSelectedContext->debugDefault(AVM_OS_COUT);
+
+ dbgPointIt = mDebugSelectedStates.begin();
+ dbgPointItEnd = mDebugSelectedStates.end();
+ for( ; dbgPointIt != dbgPointItEnd ; ++dbgPointIt )
+ {
+ dbgPrintStateInfo( *dbgPointIt );
+ }
+ }
+
+ AVM_OS_COUT << std::endl;
+}
+
+
+void IDebugProcessorProvider::dbgCommandStatemachine()
+{
+ if( (dbgCommandArg.empty() && (mDebugSelectedStatemachine == NULL)) ||
+ (dbgCommandArg == "?") )
+ {
+ AVM_OS_COUT << "Enter a statemachine ID :> ";
+
+ std::getline(std::cin, dbgCommandArg);
+ StringTools::ltrim( dbgCommandArg );
+ }
+ else
+ {
+ if( dbgCommandArg[0] == '?' )
+ {
+ dbgCommandArg = dbgCommandArg.substr( 1 );
+ }
+ }
+
+ if( not dbgCommandArg.empty() )
+ {
+ dbgTP = dbgTracePoint = new TracePoint(
+ ENUM_TRACE_POINT::TRACE_STATEMACHINE_NATURE, AVM_OPCODE_RUN);
+
+ if( dbgTracePoint->configureMachine(mDebugConfiguration, dbgCommandArg) )
+ {
+ if( mDebugTraceSequence.containsPoint(dbgTracePoint, dbgTP) )
+ {
+ mDebugSelectedStatemachine = dbgTP.to_ptr< TracePoint >();
+
+ mDebugSelectedStatemachines.add_union( mDebugSelectedStatemachine );
+ }
+ else
+ {
+ dbgTracePoint->tpid = ++(mDebugTraceFactory->TP_ID);
+
+ mDebugTraceSequence.points.append( dbgTP );
+
+ mDebugSelectedStatemachines.append(
+ mDebugSelectedStatemachine = dbgTracePoint );
+ }
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound statemachine << " << dbgCommandArg << " >> !"
+ << std::endl;
+ }
+ }
+
+ if( mDebugSelectedStatemachine != NULL )
+ {
+ AVM_OS_COUT << "Selected statemachine :> ";
+ mDebugSelectedStatemachine->toStream(AVM_OS_COUT);
+
+ if( mDebugSelectedContext != NULL )
+ {
+ AVM_OS_COUT << "With selected Context :> ";
+ mDebugSelectedContext->debugDefault(AVM_OS_COUT);
+
+ dbgPrintStatemachineInfo( mDebugSelectedStatemachine );
+ }
+
+ AVM_OS_COUT << std::endl;
+ }
+}
+
+void IDebugProcessorProvider::dbgPrintStatemachineInfo(TracePoint * aTP)
+{
+ dbgPrintMachineInfo( aTP );
+}
+
+void IDebugProcessorProvider::dbgCommandStatemachines()
+{
+ AVM_OS_COUT << "Selected statemachines :> " << std::endl;
+ mDebugTraceFactory->toStream(AVM_OS_COUT, mDebugSelectedStatemachines);
+
+ if( mDebugSelectedContext != NULL )
+ {
+ AVM_OS_COUT << "With selected Context :> ";
+ mDebugSelectedContext->debugDefault(AVM_OS_COUT);
+
+ dbgPointIt = mDebugSelectedStatemachines.begin();
+ dbgPointItEnd = mDebugSelectedStatemachines.end();
+ for( ; dbgPointIt != dbgPointItEnd ; ++dbgPointIt )
+ {
+ dbgPrintStatemachineInfo( *dbgPointIt );
+ }
+ }
+
+ AVM_OS_COUT << std::endl;
+}
+
+
+void IDebugProcessorProvider::dbgCommandTransition()
+{
+ if( (dbgCommandArg.empty() && (mDebugSelectedTransition == NULL)) ||
+ (dbgCommandArg == "?") )
+ {
+ AVM_OS_COUT << "Enter a transition ID :> ";
+
+ std::getline(std::cin, dbgCommandArg);
+ StringTools::ltrim( dbgCommandArg );
+ }
+ else
+ {
+ if( dbgCommandArg[0] == '?' )
+ {
+ dbgCommandArg = dbgCommandArg.substr( 1 );
+ }
+ }
+
+ if( not dbgCommandArg.empty() )
+ {
+ dbgTP = dbgTracePoint = new TracePoint(
+ ENUM_TRACE_POINT::TRACE_TRANSITION_NATURE,
+ AVM_OPCODE_INVOKE_TRANSITION);
+
+ if( dbgTracePoint->configureTransition(mDebugConfiguration, dbgCommandArg) )
+ {
+ if( mDebugTraceSequence.containsPoint(dbgTracePoint, dbgTP) )
+ {
+ mDebugSelectedTransition = dbgTP.to_ptr< TracePoint >();
+
+ mDebugSelectedTransitions.add_union( mDebugSelectedTransition );
+ }
+ else
+ {
+ dbgTracePoint->tpid = ++(mDebugTraceFactory->TP_ID);
+
+ mDebugTraceSequence.points.append( dbgTP );
+
+ mDebugSelectedTransitions.append(
+ mDebugSelectedTransition = dbgTracePoint );
+ }
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound transition << " << dbgCommandArg << " >> !"
+ << std::endl;
+ }
+ }
+
+ if( mDebugSelectedTransition != NULL )
+ {
+ AVM_OS_COUT << "Selected transition :> ";
+ mDebugSelectedTransition->toStream(AVM_OS_COUT);
+
+ if( mDebugSelectedContext != NULL )
+ {
+ AVM_OS_COUT << "With selected Context :> ";
+ mDebugSelectedContext->debugDefault(AVM_OS_COUT);
+
+ dbgPrintTransitionInfo( mDebugSelectedTransition );
+ }
+
+ AVM_OS_COUT << std::endl;
+ }
+}
+
+void IDebugProcessorProvider::dbgPrintTransitionInfo(TracePoint * aTP)
+{
+ AvmTransition * aTransition = aTP->object->to< AvmTransition >();
+
+ if( dbgDetailsMax && (mDebugSelectedContext != NULL) )
+ {
+ AVM_OS_COUT << AVM_TAB_INDENT;
+
+ aTransition->toStreamHeader(AVM_OS_COUT);
+ if( aTransition->hasInternalCommunicationCode() )
+ {
+ AVM_OS_COUT << " ";
+ BaseCompiledForm::toStreamStaticCom(AVM_OS_COUT,
+ aTransition->getInternalCommunicationCode());
+ }
+ AVM_OS_COUT << std::endl;
+ }
+
+ else if( dbgDetailsMed )
+ {
+ aTP->object->toStream(AVM_OS_COUT);
+ }
+ else
+ {
+ aTransition->toStreamHeader(AVM_OS_COUT);
+ AVM_OS_COUT << std::endl;
+ }
+}
+
+void IDebugProcessorProvider::dbgCommandTransitions()
+{
+ AVM_OS_COUT << "Selected transitions :> " << std::endl;
+ mDebugTraceFactory->toStream(AVM_OS_COUT, mDebugSelectedTransitions);
+
+ if( mDebugSelectedContext != NULL )
+ {
+ AVM_OS_COUT << "With selected Context :> ";
+ mDebugSelectedContext->debugDefault(AVM_OS_COUT);
+
+ dbgPointIt = mDebugSelectedTransitions.begin();
+ dbgPointItEnd = mDebugSelectedTransitions.end();
+ for( ; dbgPointIt != dbgPointItEnd ; ++dbgPointIt )
+ {
+ dbgPrintTransitionInfo( *dbgPointIt );
+ }
+ }
+
+ AVM_OS_COUT << std::endl;
+}
+
+
+void IDebugProcessorProvider::dbgCommandRoutine()
+{
+ if( (dbgCommandArg.empty() && (mDebugSelectedRoutine == NULL)) ||
+ (dbgCommandArg == "?") )
+ {
+ AVM_OS_COUT << "Enter a routine ID :> ";
+
+ std::getline(std::cin, dbgCommandArg);
+ StringTools::ltrim( dbgCommandArg );
+ }
+ else
+ {
+ if( dbgCommandArg[0] == '?' )
+ {
+ dbgCommandArg = dbgCommandArg.substr( 1 );
+ }
+ }
+
+ if( not dbgCommandArg.empty() )
+ {
+ dbgTP = dbgTracePoint = new TracePoint(
+ ENUM_TRACE_POINT::TRACE_ROUTINE_NATURE, AVM_OPCODE_NULL);
+
+ if( dbgTracePoint->configureRoutine(mDebugConfiguration, dbgCommandArg) )
+ {
+ if( mDebugTraceSequence.containsPoint(dbgTracePoint, dbgTP) )
+ {
+ mDebugSelectedRoutine = dbgTP.to_ptr< TracePoint >();
+
+ mDebugSelectedRoutines.add_union( mDebugSelectedRoutine );
+ }
+ else
+ {
+ dbgTracePoint->tpid = ++(mDebugTraceFactory->TP_ID);
+
+ mDebugTraceSequence.points.append( dbgTP );
+
+ mDebugSelectedRoutines.append(
+ mDebugSelectedRoutine = dbgTracePoint );
+ }
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound routine << " << dbgCommandArg << " >> !"
+ << std::endl;
+ }
+ }
+
+ if( mDebugSelectedRoutine != NULL )
+ {
+ AVM_OS_COUT << "Selected routine :> ";
+ mDebugSelectedRoutine->toStream(AVM_OS_COUT);
+
+ if( mDebugSelectedContext != NULL )
+ {
+ AVM_OS_COUT << "With selected Context :> ";
+ mDebugSelectedContext->debugDefault(AVM_OS_COUT);
+
+ dbgPrintRoutineInfo( mDebugSelectedRoutine );
+ }
+
+ }
+}
+
+void IDebugProcessorProvider::dbgPrintRoutineInfo(TracePoint * aTP)
+{
+
+}
+
+void IDebugProcessorProvider::dbgCommandRoutines()
+{
+ AVM_OS_COUT << "Selected routines :> " << std::endl;
+ mDebugTraceFactory->toStream(AVM_OS_COUT, mDebugSelectedRoutines);
+
+ if( mDebugSelectedContext != NULL )
+ {
+ AVM_OS_COUT << "With selected Context :> ";
+ mDebugSelectedContext->debugDefault(AVM_OS_COUT);
+
+ dbgPointIt = mDebugSelectedRoutines.begin();
+ dbgPointItEnd = mDebugSelectedRoutines.end();
+ for( ; dbgPointIt != dbgPointItEnd ; ++dbgPointIt )
+ {
+ dbgPrintRoutineInfo( *dbgPointIt );
+ }
+ }
+
+ AVM_OS_COUT << std::endl;
+}
+
+
+void IDebugProcessorProvider::dbgCommandRunnable()
+{
+ if( (dbgCommandArg.empty() && (mDebugSelectedRunnable == NULL)) ||
+ (dbgCommandArg == "?") )
+ {
+ AVM_OS_COUT << "Enter a runnable ID :> ";
+
+ std::getline(std::cin, dbgCommandArg);
+ StringTools::ltrim( dbgCommandArg );
+ }
+ else
+ {
+ if( dbgCommandArg[0] == '?' )
+ {
+ dbgCommandArg = dbgCommandArg.substr( 1 );
+ }
+ }
+
+ if( not dbgCommandArg.empty() )
+ {
+ dbgTP = dbgTracePoint = new TracePoint(
+ ENUM_TRACE_POINT::TRACE_RUNNABLE_NATURE, AVM_OPCODE_NULL);
+
+ if( dbgTracePoint->configureRunnable(mDebugConfiguration, dbgCommandArg) )
+ {
+ if( mDebugTraceSequence.containsPoint(dbgTracePoint, dbgTP) )
+ {
+ mDebugSelectedRunnable = dbgTP.to_ptr< TracePoint >();
+
+ mDebugSelectedRunnables.add_union( mDebugSelectedRunnable );
+ }
+ else
+ {
+ dbgTracePoint->tpid = ++(mDebugTraceFactory->TP_ID);
+
+ mDebugTraceSequence.points.append( dbgTP );
+
+ mDebugSelectedRunnables.append(
+ mDebugSelectedRunnable = dbgTracePoint );
+ }
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound runnable << " << dbgCommandArg << " >> !"
+ << std::endl;
+ }
+ }
+
+ if( mDebugSelectedRunnable != NULL )
+ {
+ AVM_OS_COUT << "Selected runnable :> ";
+ mDebugSelectedRunnable->toStream(AVM_OS_COUT);
+
+ if( mDebugSelectedContext != NULL )
+ {
+ AVM_OS_COUT << "With selected Context :> ";
+ mDebugSelectedContext->debugDefault(AVM_OS_COUT);
+
+ dbgPrintRunnableInfo( mDebugSelectedRunnable );
+ }
+
+ }
+}
+
+void IDebugProcessorProvider::dbgPrintRunnableInfo(TracePoint * aTP)
+{
+
+}
+
+void IDebugProcessorProvider::dbgCommandRunnables()
+{
+ AVM_OS_COUT << "Selected runnables :> " << std::endl;
+ mDebugTraceFactory->toStream(AVM_OS_COUT, mDebugSelectedRunnables);
+
+ if( mDebugSelectedContext != NULL )
+ {
+ AVM_OS_COUT << "With selected Context :> ";
+ mDebugSelectedContext->debugDefault(AVM_OS_COUT);
+
+ dbgPointIt = mDebugSelectedRunnables.begin();
+ dbgPointItEnd = mDebugSelectedRunnables.end();
+ for( ; dbgPointIt != dbgPointItEnd ; ++dbgPointIt )
+ {
+ dbgPrintRunnableInfo( *dbgPointIt );
+ }
+ }
+
+ AVM_OS_COUT << std::endl;
+}
+
+
+void IDebugProcessorProvider::dbgCommandEcho()
+{
+ StringTools::replaceAll(dbgCommandArg, "\\n", "\n");
+ StringTools::replaceAll(dbgCommandArg, "\\t", "\t");
+
+ if( (dbgCommandArg.size() > 2) && (
+ ((dbgCommandArg[0] == '"') &&
+ (dbgCommandArg[dbgCommandArg.size() - 1] == '"')) ||
+ ((dbgCommandArg[0] == '\'') &&
+ (dbgCommandArg[dbgCommandArg.size() - 1] == '\'')) ) )
+ {
+ dbgCommandArg = dbgCommandArg.substr( 1 , dbgCommandArg.size() - 2 );
+ }
+
+ AVM_OS_COUT << dbgCommandArg;
+}
+
+void IDebugProcessorProvider::dbgCommandPrint()
+{
+ dbgCommandEcho();
+}
+
+void IDebugProcessorProvider::dbgCommandShow()
+{
+ dbgCommandEcho();
+}
+
+
+
+void IDebugProcessorProvider::dbgCommandEnableDisableProcess(bool bStatus)
+{
+ if( dbgCommandArg.empty() )
+ {
+ }
+
+ else
+ {
+ if( dbgCommandArg == "?" )
+ {
+ AVM_OS_COUT << "Select a process { prefilter , "
+ "postfilter , preprocess , postprocess } :> ";
+
+ std::getline(std::cin, dbgCommandArg);
+ StringTools::ltrim( dbgCommandArg );
+ }
+ else if( (dbgCommandArg[0] == '#') || (dbgCommandArg[0] == '?') )
+ {
+ dbgCommandArg = dbgCommandArg.substr( 1 );
+ }
+
+ if( dbgCommandArg.find("all") != std::string::npos )
+ {
+ mDebugPrefilteringFlag = bStatus;
+ mDebugPrefilteringFinalizeFlag = bStatus;
+
+ mDebugPostfilteringFlag = bStatus;
+ mDebugPostfilteringFinalizeFlag = bStatus;
+
+ mDebugPreprocessingFlag = bStatus;
+ mDebugPostprocessingFlag = bStatus;
+ }
+
+ else if( dbgCommandArg.find("prefilter#finalize") != std::string::npos )
+ {
+ mDebugPrefilteringFinalizeFlag = bStatus;
+ }
+ else if( dbgCommandArg.find("prefilter") != std::string::npos )
+ {
+ mDebugPrefilteringFlag = bStatus;
+
+ mDebugProcessor->enablePrefilter( bStatus );
+ }
+
+ else if( dbgCommandArg.find("postfilter#finalize") != std::string::npos )
+ {
+ mDebugPostfilteringFinalizeFlag = bStatus;
+ }
+ else if( dbgCommandArg.find("postfilter") != std::string::npos )
+ {
+ mDebugPostfilteringFlag = bStatus;
+
+ mDebugProcessor->enablePostfilter( bStatus );
+ }
+
+ else if( dbgCommandArg.find("preprocess") != std::string::npos )
+ {
+ mDebugPreprocessingFlag = bStatus;
+
+ mDebugProcessor->enablePreprocess( bStatus );
+ }
+ else if( dbgCommandArg.find("postprocess") != std::string::npos )
+ {
+ mDebugPostprocessingFlag = bStatus;
+
+ mDebugProcessor->enablePostprocess( bStatus );
+ }
+ }
+
+
+ if( bStatus )
+ {
+ AVM_OS_COUT << "The debug< enable > processes are :> "
+ << ( mDebugPrefilteringFlag ? " prefilter" : "" )
+ << ( mDebugPrefilteringFinalizeFlag ? " prefilter#finalize" : "" )
+ << ( mDebugPostfilteringFlag ? " postfilter" : "" )
+ << ( mDebugPostfilteringFinalizeFlag ? " postfilter#finalize" : "" )
+ << ( mDebugPreprocessingFlag ? " preprocess" : "" )
+ << ( mDebugPostprocessingFlag ? " postprocess" : "" )
+ << std::endl;
+ }
+ else
+ {
+ AVM_OS_COUT << "The debug< disable > processes are :> "
+ << ( mDebugPrefilteringFlag ? "" : " prefilter" )
+ << ( mDebugPrefilteringFinalizeFlag ? "" : " prefilter#finalize" )
+ << ( mDebugPostfilteringFlag ? "" : " postfilter" )
+ << ( mDebugPostfilteringFinalizeFlag ? "" : " postfilter#finalize" )
+ << ( mDebugPreprocessingFlag ? "" : " preprocess" )
+ << ( mDebugPostprocessingFlag ? "" : " postprocess" )
+ << std::endl;
+ }
+
+ AVM_OS_COUT << std::endl;
+}
+
+
+void IDebugProcessorProvider::dbgCommandVerbosityLevel()
+{
+ if( (not dbgCommandArg.empty()) && (dbgCommandArg == "?") )
+ {
+ AVM_OS_COUT << "Enter a verbosity level "
+ "{ SILENT , MINIMUM , MEDIUM , MAXIMUM } :> ";
+
+ std::getline(std::cin, dbgCommandArg);
+ StringTools::ltrim( dbgCommandArg );
+ }
+ else if( (dbgCommandArg[0] == '#') || (dbgCommandArg[0] == '?') )
+ {
+ dbgCommandArg = dbgCommandArg.substr( 1 );
+ }
+
+ avm_setExecVerbosityLevel( dbgCommandArg );
+
+ AVM_OS_COUT << "Verbosity level :> " << avm_strExecVerbosityLevel()
+ << std::endl << std::endl;
+}
+
+
+void IDebugProcessorProvider::dbgCommandDebugLevel()
+{
+ if( (not dbgCommandArg.empty()) && (dbgCommandArg == "?") )
+ {
+ AVM_OS_COUT << "Enter a debug level "
+ "{ ZERO , LOW , MEDIUM , HIGH , ULTRA } :> ";
+
+ std::getline(std::cin, dbgCommandArg);
+ StringTools::ltrim( dbgCommandArg );
+ }
+ else if( (dbgCommandArg[0] == '#') || (dbgCommandArg[0] == '?') )
+ {
+ dbgCommandArg = dbgCommandArg.substr( 1 );
+ }
+
+ avm_setDebugLevel( dbgCommandArg );
+
+ AVM_OS_COUT << "Debug trace level :> " << avm_strDebugLevel()
+ << std::endl << std::endl;
+}
+
+
+void IDebugProcessorProvider::dbgCommandDebugFlag(bool bStatus)
+{
+ if( (not dbgCommandArg.empty()) && (dbgCommandArg == "?") )
+ {
+ AVM_OS_COUT << "Enter a debug flag "
+ "{ COMPUTING , PROGRAM , STATEMENT , BYTECODE , ... } :> ";
+
+ std::getline(std::cin, dbgCommandArg);
+ StringTools::ltrim( dbgCommandArg );
+ }
+
+ if( bStatus )
+ {
+ avm_setDebugFlag( dbgCommandArg );
+ }
+ else
+ {
+ avm_unsetDebugFlag( dbgCommandArg );
+ }
+
+ AVM_OS_COUT << "Debug trace flag :> " << avm_strDebugFlag(" | ")
+ << std::endl << std::endl;
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/debug/IDebugProcessorProvider.h b/org.eclipse.efm.symbex/src/fam/debug/IDebugProcessorProvider.h
new file mode 100644
index 0000000..f49a07f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/debug/IDebugProcessorProvider.h
@@ -0,0 +1,659 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 27 janv. 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef IDEBUGPROCESSORPROVIDER_H_
+#define IDEBUGPROCESSORPROVIDER_H_
+
+#include <util/avm_string.h>
+
+#include <collection/Typedef.h>
+
+#include <fam/api/AbstractProcessorUnit.h>
+
+#include <fml/runtime/ExecutionData.h>
+
+#include <fml/trace/TracePoint.h>
+#include <fml/trace/TraceSequence.h>
+
+#include <sew/Configuration.h>
+
+#include <fstream>
+
+
+namespace sep
+{
+
+class Configuration;
+
+class ExecutionContext;
+
+class InstanceOfData;
+
+class RuntimeForm;
+
+class TraceFactory;
+
+
+
+class IDebugProcessorProvider
+{
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ AbstractProcessorUnit * mDebugProcessor;
+ Configuration & mDebugConfiguration;
+
+ bool mDebugEnabledFlag;
+ bool mDebugConsoleFlag;
+
+ std::string mDebugScriptFile;
+
+ std::string mDebugPromptPrefix;
+
+ bool mDebugFilteringDetailFlag;
+ bool mDebugFilteringInitializeFlag;
+ bool mDebugFilteringFinalizeFlag;
+
+ bool mDebugPrefilteringFlag;
+ bool mDebugPrefilteringDetailFlag;
+ bool mDebugPrefilteringFinalizeFlag;
+
+ bool mDebugPostfilteringFlag;
+ bool mDebugPostfilteringDetailFlag;
+ bool mDebugPostfilteringFinalizeFlag;
+
+ bool mDebugPreprocessingFlag;
+ bool mDebugPreprocessingDetailFlag;
+
+ bool mDebugPostprocessingFlag;
+ bool mDebugPostprocessingDetailFlag;
+
+ avm_size_t mDebugEvalStepCount;
+ avm_size_t mDebugBreakpointEvalStep;
+ avm_size_t mDebugBreakpointEvalStepPeriod;
+
+ avm_size_t mDebugBreakpointEvalContext;
+
+ const ExecutionContext * mDebugSelectedContext;
+ bool mDebugTraceFullPathFlag;
+
+ TraceSequence mDebugTraceSequence;
+
+ TracePoint * mDebugSelectedVar;
+ ListOfTracePoint mDebugSelectedVars;
+
+ TracePoint * mDebugSelectedTimeVar;
+
+ TracePoint * mDebugSelectedPort;
+ ListOfTracePoint mDebugSelectedPorts;
+
+ TracePoint * mDebugSelectedBuffer;
+ ListOfTracePoint mDebugSelectedBuffers;
+
+ TracePoint mDebugParametersMachine;
+
+ TracePoint * mDebugSelectedMachine;
+ ListOfTracePoint mDebugSelectedMachines;
+
+ TracePoint * mDebugSelectedState;
+ ListOfTracePoint mDebugSelectedStates;
+
+ TracePoint * mDebugSelectedStatemachine;
+ ListOfTracePoint mDebugSelectedStatemachines;
+
+ TracePoint * mDebugSelectedTransition;
+ ListOfTracePoint mDebugSelectedTransitions;
+
+ TracePoint * mDebugSelectedRoutine;
+ ListOfTracePoint mDebugSelectedRoutines;
+
+ TracePoint * mDebugSelectedRunnable;
+ ListOfTracePoint mDebugSelectedRunnables;
+
+ // Trace Factory tools
+ TraceFactory * mDebugTraceFactory;
+ InstanceOfData * mDebugTimeVariable;
+ InstanceOfData * mDebugDeltaTimeVariable;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing Variables
+ BF dbgTP;
+ TracePoint * dbgTracePoint;
+ ListOfTracePoint::iterator dbgPointIt;
+ ListOfTracePoint::iterator dbgPointItEnd;
+
+ ListOfExecutionContext * dbgQueue;
+ ListOfExecutionContext::iterator dbgQueueIt;
+ ListOfExecutionContext::iterator dbgQueueItEnd;
+
+ bool dbgContinueREPL;
+
+ bool dbgDetailsMin;
+ bool dbgDetailsMed;
+ bool dbgDetailsMax;
+
+ bool dbgDecodeCommandOk;
+
+ VectorOfString dbgCommandLineHistory;
+ std::string dbgCommandLine;
+ std::string dbgCommandArg;
+
+ avm_integer_t dbgIntValue;
+ avm_size_t dbgOffset;
+
+ const ExecutionContext * dbgEC;
+ APExecutionData dbgED;
+ const RuntimeForm * dbgRF;
+ BF dbgValue;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ IDebugProcessorProvider(AbstractProcessorUnit * aProcessor)
+ : mDebugProcessor( aProcessor ),
+ mDebugConfiguration( aProcessor->getConfiguration() ),
+ mDebugEnabledFlag( false ),
+
+ mDebugConsoleFlag( true ),
+ mDebugScriptFile( ),
+
+ mDebugPromptPrefix( ),
+
+ mDebugFilteringDetailFlag( false ),
+ mDebugFilteringInitializeFlag( false ),
+ mDebugFilteringFinalizeFlag( false ),
+
+ mDebugPrefilteringFlag( false ),
+ mDebugPrefilteringDetailFlag( false ),
+ mDebugPrefilteringFinalizeFlag( false ),
+
+ mDebugPostfilteringFlag( false ),
+ mDebugPostfilteringDetailFlag( false ),
+ mDebugPostfilteringFinalizeFlag( false ),
+
+ mDebugPreprocessingFlag( false ),
+ mDebugPreprocessingDetailFlag( false ),
+
+ mDebugPostprocessingFlag( false ),
+ mDebugPostprocessingDetailFlag( false ),
+
+ mDebugEvalStepCount( 0 ),
+ mDebugBreakpointEvalStep( 0 ),
+ mDebugBreakpointEvalStepPeriod( 0 ),
+
+ mDebugBreakpointEvalContext( 0 ),
+
+ mDebugSelectedContext( NULL ),
+
+ mDebugTraceFullPathFlag( false ),
+
+ mDebugTraceSequence( ),
+
+ mDebugSelectedVar( NULL ),
+ mDebugSelectedVars( ),
+
+ mDebugSelectedTimeVar( NULL ),
+
+ mDebugSelectedPort( NULL ),
+ mDebugSelectedPorts( ),
+
+ mDebugSelectedBuffer( NULL ),
+ mDebugSelectedBuffers( ),
+
+ mDebugParametersMachine( ENUM_TRACE_POINT::TRACE_MACHINE_NATURE ),
+
+ mDebugSelectedMachine( NULL ),
+ mDebugSelectedMachines( ),
+
+ mDebugSelectedState( NULL ),
+ mDebugSelectedStates( ),
+
+ mDebugSelectedStatemachine( NULL ),
+ mDebugSelectedStatemachines( ),
+
+ mDebugSelectedTransition( NULL ),
+ mDebugSelectedTransitions( ),
+
+ mDebugSelectedRoutine( NULL ),
+ mDebugSelectedRoutines( ),
+
+ mDebugSelectedRunnable( NULL ),
+ mDebugSelectedRunnables( ),
+
+ // Trace Factory tools
+ mDebugTraceFactory( NULL ),
+ mDebugTimeVariable( NULL ),
+ mDebugDeltaTimeVariable( NULL ),
+
+ dbgTP( ),
+ dbgTracePoint( NULL ),
+ dbgPointIt( ),
+ dbgPointItEnd( ),
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing Variables
+ dbgQueue( NULL ),
+ dbgQueueIt( ),
+ dbgQueueItEnd( ),
+
+ dbgContinueREPL( true ),
+
+ dbgDetailsMin( false ),
+ dbgDetailsMed( false ),
+ dbgDetailsMax( false ),
+
+ dbgDecodeCommandOk( false ),
+
+ dbgCommandLineHistory( "help" ),
+ dbgCommandLine( ),
+ dbgCommandArg( ),
+
+ dbgIntValue( 0 ),
+ dbgOffset( 0 ),
+
+ dbgEC( NULL ),
+ dbgED( ),
+ dbgRF( NULL ),
+ dbgValue( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~IDebugProcessorProvider();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // PLUGIN PROCESSOR API
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool debugConfigureImpl(WObject * wfParameterObject);
+
+ /**
+ * TEST
+ */
+ inline bool isDebugEnabled() const
+ {
+ return( mDebugFilteringInitializeFlag || mDebugFilteringFinalizeFlag ||
+ mDebugPrefilteringFlag || mDebugPrefilteringFinalizeFlag ||
+ mDebugPostfilteringFlag || mDebugPostfilteringFinalizeFlag ||
+ mDebugPreprocessingFlag || mDebugPostprocessingFlag );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PROCESS API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool debugPreprocessing();
+
+ virtual bool debugPreprocessing(const ExecutionContext * anEC);
+
+ inline bool isDebugPreprocessing() const
+ {
+ return( mDebugPreprocessingFlag );
+ }
+
+
+ virtual bool debugPostprocessing();
+
+ virtual bool debugPostprocessing(const ExecutionContext * anEC);
+
+ inline bool isDebugPostprocessing() const
+ {
+ return( mDebugPostprocessingFlag );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FILTER API
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool debugActivatorTriggering();
+
+
+ bool debugFilteringInitialize();
+
+ bool debugFilteringInitialize(const ExecutionContext * anEC);
+
+ inline bool isDebugFilteringInitialize()
+ {
+ return( mDebugFilteringInitializeFlag );
+ }
+
+
+ bool debugFilteringFinalize();
+
+ bool debugFilteringFinalize(const ExecutionContext * anEC);
+
+ inline bool isDebugFilteringFinalize()
+ {
+ return( mDebugFilteringFinalizeFlag );
+ }
+
+
+ virtual bool debugPrefiltering();
+ virtual bool debugPrefiltering(const ExecutionContext * anEC);
+
+ inline bool isDebugPrefiltering() const
+ {
+ return( mDebugPrefilteringFlag );
+ }
+
+
+ bool debugPrefilteringFinalize();
+
+ inline bool isDebugPrefilteringFinalize()
+ {
+ return( mDebugPrefilteringFinalizeFlag );
+ }
+
+
+ virtual bool debugPostfiltering();
+ virtual bool debugPostfiltering(const ExecutionContext * anEC);
+
+ inline bool isDebugPostfiltering() const
+ {
+ return( mDebugPostfilteringFlag );
+ }
+
+
+ bool debugPostfilteringFinalize();
+
+ inline bool isDebugPostfilteringFinalize()
+ {
+ return( mDebugPostfilteringFinalizeFlag );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DEBUG PROCESSING
+ ////////////////////////////////////////////////////////////////////////////
+
+ void debugReadEvalCommand();
+
+
+ void debugReadEvalScript();
+
+ bool isDebugScript(std::ifstream & aScriptStream);
+
+ void debugReadEvalScript(std::ifstream & aScriptStream);
+
+
+ void debugReadEvalCommandLoop();
+
+ void debugReadHistoryCommand();
+
+ void debugEvalCommand();
+
+ /**
+ * API
+ * if return false,
+ * the default debug evaluation command will handle the current command
+ */
+ virtual bool debugEvalCommandImpl() = 0;
+
+ /**
+ * method for launch anywhere the REPL command loop !
+ */
+ inline void debugReadEvalCommandPrintLoop(
+ const std::string & aDebugPromptPrefix = "PROCESSOR#CTX",
+ ExecutionContext * aDebugSelectedContext = NULL)
+ {
+ mDebugPromptPrefix = aDebugPromptPrefix;
+
+ if( aDebugSelectedContext != NULL )
+ {
+ mDebugPromptPrefix = aDebugPromptPrefix;
+ }
+
+ debugReadEvalCommand();
+ }
+
+
+ /**
+ * Command decoder
+ */
+ inline bool isDebugStringCommand(const std::string & cmdString)
+ {
+ if( StringTools::startsWith(dbgCommandLine, cmdString) )
+ {
+ StringTools::ltrim( dbgCommandArg , cmdString.size());
+
+ return( dbgDecodeCommandOk = true );
+ }
+
+ return( false );
+ }
+
+ inline bool isDebugCharCommand(char cmdChar)
+ {
+ if( ((not dbgCommandLine.empty()) && (dbgCommandLine[0] == cmdChar)) &&
+ ((dbgCommandLine.size() == 1) || (not ::isalpha(dbgCommandLine[1]))) )
+ {
+ StringTools::ltrim( dbgCommandArg , 1 );
+
+ return( dbgDecodeCommandOk = true );
+ }
+
+ return( false );
+ }
+
+
+ void dbgCheckCommandDetailsArg();
+
+
+ inline bool dbgDecodeCommand(const std::string & cmdStr)
+ {
+ if( isDebugStringCommand(cmdStr) )
+ {
+ dbgCheckCommandDetailsArg() ;
+ }
+
+ return( dbgDecodeCommandOk );
+ }
+
+ inline bool dbgDecodeCommand(const std::string & cmdStr, char cmdChar)
+ {
+ if( isDebugStringCommand(cmdStr) || isDebugCharCommand(cmdChar) )
+ {
+ dbgCheckCommandDetailsArg() ;
+
+ dbgDecodeCommandOk = true;
+ }
+
+ return( dbgDecodeCommandOk );
+ }
+
+ inline bool dbgDecodeCommand(
+ const std::string & cmdStr, const std::string & cmdStr1)
+ {
+ if( isDebugStringCommand(cmdStr) || isDebugStringCommand(cmdStr1) )
+ {
+ dbgCheckCommandDetailsArg() ;
+ }
+
+ return( dbgDecodeCommandOk );
+ }
+
+ inline bool dbgDecodeCommand(const std::string & cmdStr,
+ const std::string & cmdStr1, const std::string & cmdStr2)
+ {
+ if( isDebugStringCommand(cmdStr) || isDebugStringCommand(cmdStr1) ||
+ isDebugStringCommand(cmdStr2) )
+ {
+ dbgCheckCommandDetailsArg() ;
+ }
+
+ return( dbgDecodeCommandOk );
+ }
+
+ inline bool dbgDecodeCommand(
+ const std::string & cmdStr, const std::string & cmdStr1,
+ const std::string & cmdStr2, const std::string & cmdStr3)
+ {
+ if( isDebugStringCommand(cmdStr) || isDebugStringCommand(cmdStr1) ||
+ isDebugStringCommand(cmdStr2) || isDebugStringCommand(cmdStr3) )
+ {
+ dbgCheckCommandDetailsArg() ;
+ }
+
+ return( dbgDecodeCommandOk );
+ }
+
+ inline bool dbgDecodeCommand(const std::string & cmdStr,
+ const std::string & cmdStr1, char cmdChar)
+ {
+ if( isDebugStringCommand(cmdStr) || isDebugStringCommand(cmdStr1) ||
+ isDebugCharCommand(cmdChar) )
+ {
+ dbgCheckCommandDetailsArg() ;
+ }
+
+ return( dbgDecodeCommandOk );
+ }
+
+ inline bool dbgDecodeCommand(
+ const std::string & cmdStr, char cmdChar, char cmdChar1)
+ {
+ if( isDebugStringCommand(cmdStr) ||
+ isDebugCharCommand(cmdChar) || isDebugCharCommand(cmdChar1) )
+ {
+ dbgCheckCommandDetailsArg() ;
+ }
+
+ return( dbgDecodeCommandOk );
+ }
+
+
+ static std::string DEBUG_SHELL_COMMAND_SUMMARY;
+
+ static std::string DEBUG_SHELL_COMMAND_HISTORY;
+
+ static std::string DEBUG_SHELL_COMMAND_CONTROL;
+
+ static std::string DEBUG_SHELL_COMMAND_QUEUE;
+
+ static std::string DEBUG_SHELL_COMMAND_CONTEX;
+
+ static std::string DEBUG_SHELL_COMMAND_DATA;
+
+ static std::string DEBUG_SHELL_COMMAND_PRINT;
+
+ static std::string DEBUG_SHELL_COMMAND_REPORT;
+
+ static std::string DEBUG_SHELL_COMMAND_BREAKPOINT;
+
+ static std::string DEBUG_SHELL_COMMAND_OPTION;
+
+ static std::string DEBUG_SHELL_COMMAND_LOG;
+
+
+
+ void dbgCommandHelp();
+
+ void dbgCommandHistory();
+
+
+ void dbgCommandConfig();
+
+ void dbgCommandBreak();
+
+ void dbgCommandNext();
+
+ void dbgCommandPeriod();
+
+ void dbgCommandQueue();
+
+ void dbgCommandContext();
+
+ void dbgCommandPath();
+
+ void dbgCommandTrace();
+
+ void dbgCommandTraceDetailLevel();
+
+ void dbgPrintVarInfo(TracePoint * aTP);
+ void dbgCommandVar();
+ void dbgCommandVars();
+
+ void dbgCommandTime();
+
+ void dbgPrintPortInfo(TracePoint * aTP);
+ void dbgCommandPort(ENUM_TRACE_POINT::TRACE_NATURE nature);
+ void dbgCommandPorts(ENUM_TRACE_POINT::TRACE_NATURE nature);
+
+ void dbgPrintBufferInfo(TracePoint * aTP);
+ void dbgCommandBuffer();
+ void dbgCommandBuffers();
+
+ void dbgPrintMachineInfo(TracePoint * aTP);
+ void dbgCommandMachine();
+ void dbgCommandMachines();
+
+ void dbgCommandParametersMachine();
+
+ void dbgPrintStateInfo(TracePoint * aTP);
+ void dbgCommandState();
+ void dbgCommandStates();
+
+ void dbgPrintStatemachineInfo(TracePoint * aTP);
+ void dbgCommandStatemachine();
+ void dbgCommandStatemachines();
+
+ void dbgPrintTransitionInfo(TracePoint * aTP);
+ void dbgCommandTransition();
+ void dbgCommandTransitions();
+
+ void dbgPrintRoutineInfo(TracePoint * aTP);
+ void dbgCommandRoutine();
+ void dbgCommandRoutines();
+
+ void dbgPrintRunnableInfo(TracePoint * aTP);
+ void dbgCommandRunnable();
+ void dbgCommandRunnables();
+
+ void dbgCommandEcho();
+ void dbgCommandPrint();
+ void dbgCommandShow();
+
+ void dbgCommandEnableDisableProcess(bool bStatus);
+
+ void dbgCommandVerbosityLevel();
+
+ void dbgCommandDebugLevel();
+
+ void dbgCommandDebugFlag(bool bStatus);
+
+};
+
+
+} /* namespace sep */
+
+#endif /* IDEBUGPROCESSORPROVIDER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/hitorjump/AvmHitOrJumpProcessor.cpp b/org.eclipse.efm.symbex/src/fam/hitorjump/AvmHitOrJumpProcessor.cpp
new file mode 100644
index 0000000..8715a88
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/hitorjump/AvmHitOrJumpProcessor.cpp
@@ -0,0 +1,1290 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 7 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmHitOrJumpProcessor.h"
+
+#include "HitOrderedProcessor.h"
+#include "HitUnorderedProcessor.h"
+
+#include <collection/Typedef.h>
+
+#include <fml/runtime/ExecutionContext.h>
+
+#include <fam/queue/ExecutionQueue.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <sew/SymbexControllerRequestManager.h>
+
+
+namespace sep
+{
+
+
+/*
+prototype process::hit_or_jump as &avm::processor.HIT_OR_JUMP is
+ section REPORT
+ @uri = std ":" ( "cout" | "cerr" )
+ | avm ":" ( "log" | "trace" )
+ | folder ":" path
+ | file ":" path
+ | filename ":" path
+ | socket ":" host ":" port
+ ;
+ @uri = ...;
+
+ @when = [ init ][:][ otf | (every | after | before)?value#unit][:][ exit ] ;
+ endsection REPORT
+
+ section SCHEDULING
+ @startup = 'waiting';
+ endsection SCHEDULING
+
+ section PROPERTY
+ // Nombre de pas de calcul "cumulés" avant de débuter la vérification de la couverture
+ @begin_step = 0;
+
+ // Arrète l'exécution dès que la couverture est complète
+ @stop = true;
+
+ // Elagage du graphe des scénarios à la fin de la vérification
+ @slice = true;
+
+ // Active l'utilisation d'heuristique
+ @heuristic = true;
+
+ // Cherche une trace globalement ou locale à chaque noeud racine...
+ @search#scope = 'GLOBALLY'; // GLOBALLY | LOCALLY ;
+
+ // |;| --> ordered (operator: sequence)
+ // |<| --> ordered (operator: order)
+ // |i| --> unordered (operator: interleaving)
+ // |regex| --> regex (operator: regex)
+ @scheduler = '|<|';
+
+
+ // Hauteur du jump
+ @jump#height = 4;
+
+ // the Jump trials limit exploration property
+ @jump#limit = 15;
+
+
+ // Choisir des traces avec ou sans trous
+ @hit#consecutive = false;
+
+ // Rechercher un maximum de traces solutions
+ // Possible backtracking
+ @hit#max = false;
+
+ // Ne faire qu'une tentative vers l'objectif (avoir de la chance!)
+ // Pas de backtrack
+ @hit#lucky = true;
+
+ // Nombre de chemins positifs sélectionnables ALEATOIREMENT
+ @hit#count = -1;
+
+ // Nombre de chemins négatifs sélectionnables ALEATOIREMENT
+ @jump#count = 1;
+
+ // Effectue une sélection finale (relativement à @hit#count)
+ // lorsque l'objectif est atteint !
+ @hit#final = true;
+
+ // Slice les hit/jump non retenus aléatoirement
+ @jump#slice = true;
+ endsection PROPERTY
+
+
+ // Declaration part
+ section POINT
+ @assign = "sens";
+
+ @newfresh = "sens";
+
+ @signal#sens = "sens";
+
+ @port = "env";
+
+ @input = "env";
+ @output = "env";
+
+ @output = "Thermostat->dt";
+ @input = "Thermostat->equip";
+ @output2 = "Equipment->error";
+ endsection POINT
+
+ section TRACE
+ @trace = ${ && "signal#sens" "output2" };
+ @trace = [ "signal#sens" , "output2" ];
+ @point = ( "signal#sens" || "output2" );
+ @composite = ${ xor "signal#sens" "output2" };
+
+
+ @assign = "sens";
+
+ @newfresh = "sens";
+
+ @signal = "sens";
+
+ @port = "env";
+
+ @input = "env";
+ @output = "env";
+
+ @output = "Thermostat->dt";
+ @input = "Thermostat->equip";
+ @output = "Equipment->error";
+
+ @transition = "Thermostat->transition#2#MSGm1#in";
+ @routine = "Thermostat->transition#2#MSGm1#in";
+
+ @machine = "Thermostat";
+
+ @state = "Thermostat->s4";
+
+ @formula = <expression>;
+
+
+ endsection TRACE
+endprototype
+*/
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmHitOrJumpProcessor::configureImpl()
+{
+ // SUPER CONFIGURATION
+ mConfigFlag = BaseCoverageFilter::configureImpl();
+
+ WObject * thePROPERTY = Query::getRegexWSequence(getParameterWObject(),
+ OR_WID2("property", "PROPERTY"), getParameterWObject());
+ if( thePROPERTY != WObject::_NULL_ )
+ {
+ std::string strScheduler = Query::getRegexWPropertyString(
+ thePROPERTY, CONS_WID2("search", "scope"), "GLOBALLY");
+ StringTools::toupper( strScheduler );
+ mGlobalSearchScopeFlag = ( strScheduler == "GLOBALLY" );
+
+
+ strScheduler = Query::getWPropertyString(thePROPERTY, "scheduler", "|;|");
+ scheduler = OperatorLib::toOpcode(strScheduler, AVM_OPCODE_NULL);
+ if( scheduler == AVM_OPCODE_NULL )
+ {
+ if( strScheduler == "ordered" )
+ {
+ scheduler = AVM_OPCODE_SEQUENCE;
+ }
+ else if( strScheduler == "unordered" )
+ {
+ scheduler = AVM_OPCODE_INTERLEAVING;
+ }
+ else if( strScheduler == "regex" )
+ {
+ scheduler = AVM_OPCODE_REGEX;
+ }
+ }
+ }
+
+
+ WObject * theHEURISTIC = Query::getRegexWSequence(getParameterWObject(),
+ OR_WID2("heuristic", "HEURISTIC"), thePROPERTY);
+ if( theHEURISTIC != WObject::_NULL_ )
+ {
+ // the Jump HEIGHT exploration property
+ long intAttribute = Query::getRegexWPropertyInt(
+ theHEURISTIC, CONS_WID2("jump", "height"), 7);
+ if( intAttribute < 0 )
+ {
+ mJumpHeight = mJumpDelta = 7;
+
+AVM_IF_DEBUG_FLAG( CONFIGURING )
+ AVM_OS_LOG << "Invalid jump height ! => replace by "
+ << mJumpDelta << " >" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( CONFIGURING )
+ }
+ else
+ {
+ mJumpHeight = mJumpDelta = intAttribute;
+ }
+
+ // the Jump trials limit exploration property
+ mJumpTrialsLimit = Query::getRegexWPropertyPosSizeT(
+ theHEURISTIC, CONS_WID3("jump", "(trials", ")?limit"),
+ AVM_NUMERIC_MAX_SIZE_T, AVM_NUMERIC_MAX_SIZE_T);
+
+ // the Hit CONSECUTIVE trace flag property
+ mHitConsecutiveFlag = Query::getRegexWPropertyBoolean(
+ theHEURISTIC, CONS_WID2("hit", "consecutive"), false);
+
+ // The Folding Flag when checking Trace Point satisfiability in one EC
+ mFoldingFlag = Query::getRegexWPropertyBoolean(
+ theHEURISTIC, CONS_WID2("hit", "folding"), true);
+
+
+ // the Hitter SELECTION only maximal prefix flag property
+ mHitMaxFlag = Query::getRegexWPropertyBoolean(
+ theHEURISTIC, CONS_WID2("hit", "max"), false);
+
+ // Compilation for coherence and optimization
+ if( mHitMaxFlag )
+ {
+ // the Hit LUCKY wish: Only one try, backtracking off
+ mHitLuckyFlag = false;
+
+ // Backtracking enabled !
+ mBacktrackFlag = true;
+
+ // the Hit COUNT selection property
+ mHitCount = AVM_NUMERIC_MAX_SIZE_T;
+ }
+ else
+ {
+ // the Hit LUCKY wish: Only one try, backtracking off
+ mHitLuckyFlag = Query::getRegexWPropertyBoolean(
+ theHEURISTIC, CONS_WID2("hit", "lucky"), false);
+
+ // Backtracking enabled ?
+ mBacktrackFlag = (not mHitLuckyFlag);
+
+ // the Hit COUNT selection property
+ mHitCount = Query::getRegexWPropertyPosSizeT(
+ theHEURISTIC, CONS_WID2("hit", "count"), 1);
+ }
+
+
+ // the Jump COUNT selection property
+ mJumpCount = Query::getRegexWPropertyPosSizeT(
+ theHEURISTIC, CONS_WID2("jump", "count"), 1);
+
+ // the Hit FINAL (after objective achieved) flags property mHitFinalFlag
+ mHitFinalFlag = Query::getRegexWPropertyBoolean(
+ theHEURISTIC, CONS_WID2("hit", "final"), true);
+
+ // the Jump SLICE (after each hit/jump) flags property
+ mJumpSliceFlag = (not mBacktrackFlag) &&
+ Query::getRegexWPropertyBoolean(
+ theHEURISTIC, CONS_WID2("jump", "slice"), true);
+ }
+ else
+ {
+ mConfigFlag = false;
+ }
+
+
+
+ // the Hit Processor configuration
+ switch( scheduler )
+ {
+ case AVM_OPCODE_INTERLEAVING:
+ {
+ mHitProcessor = new HitUnorderedProcessor(*this, ENV);
+ break;
+ }
+
+ case AVM_OPCODE_SEQUENCE:
+ case AVM_OPCODE_ATOMIC_SEQUENCE:
+ case AVM_OPCODE_SEQUENCE_WEAK:
+ case AVM_OPCODE_PRIOR_GT:
+ case AVM_OPCODE_NULL:
+ default:
+ {
+ mHitProcessor = new HitOrderedProcessor(*this, ENV);
+ break;
+ }
+ }
+
+ if( mHitProcessor->configure(getParameterWObject()) )
+ {
+ if( isUnordered() )
+ {
+ //mHitCount = AVM_NUMERIC_MAX_SIZE_T;
+ }
+ }
+ else
+ {
+ mConfigFlag = false;
+ }
+
+ enablePreprocess( this );
+
+ if( mConfigFlag )
+ {
+ // Registration to handler DestroyCtx event
+ getSymbexEventManager().registerHandlerEventDestroyCtx(this);
+ }
+
+ return( mConfigFlag );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// REPORT API
+////////////////////////////////////////////////////////////////////////////////
+
+void AvmHitOrJumpProcessor::reportMinimum(OutStream & os) const
+{
+ os << TAB << "HIT OR JUMP Coverage "
+ << mCoverageStatistics.strCoverageRate(mGoalAchieved) << " ==> "
+ << ((mGoalAchieved || mHitProcessor->goalAchieved()) ?
+ "DONE !" : "FAILED !")
+ << std::endl;
+
+ if( (not mHitProcessor->goalAchieved()) && (not mGoalAchieved)
+ && (mJumpTrialsCount > mJumpTrialsLimit) )
+ {
+ os << TAB << ">>> Retry with a greater < jump#limit="
+ << mJumpTrialsLimit << " > heuristic attribute ! <<<"
+ << std::endl;
+ }
+
+ mHitProcessor->reportMinimum(os);
+}
+
+
+void AvmHitOrJumpProcessor::reportDefault(OutStream & os) const
+{
+ os << TAB << "HIT OR JUMP[ " << mHitProcessor->strKind()
+ << " : " << ( mGlobalSearchScopeFlag ? "globally" : "locally" )
+ << " ] < heuristic:" << mHeuristicProperty.mHeuristicEnabled
+ << " , height:" << mJumpDelta << " , hit:";
+
+ ((mHitCount < AVM_NUMERIC_MAX_SIZE_T) ? os << mHitCount : os << "<all>")
+ << " , jump:";
+
+ ((mJumpCount < AVM_NUMERIC_MAX_SIZE_T) ? os << mJumpCount : os << "<all>")
+ << " ; backtrack:" << mBacktrackFlag << ":"
+ << mCoverageStatistics.mNumberOfBacktrack
+ << " , black_hole:" << mCoverageStatistics.strBlackHoleRate()
+ << " , slice:" << mSliceCount << " >: Coverage "
+ << mCoverageStatistics.strCoverageRate(mGoalAchieved) << " ==> "
+ << ((mGoalAchieved || mHitProcessor->goalAchieved()) ?
+ "DONE !" : "FAILED !")
+ << std::endl;
+
+ if( (not mHitProcessor->goalAchieved()) && (not mGoalAchieved)
+ && (mJumpTrialsCount > mJumpTrialsLimit) )
+ {
+ os << TAB << ">>> Retry with a greater < jump#limit="
+ << mJumpTrialsLimit << " > heuristic attribute ! <<<"
+ << std::endl;
+ }
+
+ mHitProcessor->reportDefault(os);
+
+ os << TAB << "HIT OR JUMP[ " << mHitProcessor->strKind()
+ << " ] < heuristic:" << mHeuristicProperty.mHeuristicEnabled
+ << " , height:" << mJumpDelta << " , hit:";
+
+ ((mHitCount < AVM_NUMERIC_MAX_SIZE_T) ? os << mHitCount : os << "<all>")
+ << " , jump:";
+
+ ((mJumpCount < AVM_NUMERIC_MAX_SIZE_T) ? os << mJumpCount : os << "<all>")
+ << " ; backtrack:" << mBacktrackFlag << ":"
+ << mCoverageStatistics.mNumberOfBacktrack
+ << " , black_hole:" << mCoverageStatistics.strBlackHoleRate()
+ << " , slice:" << mSliceCount << " >: Coverage "
+ << mCoverageStatistics.strCoverageRate(mGoalAchieved) << " ==> "
+ << ((mGoalAchieved || mHitProcessor->goalAchieved()) ?
+ "DONE !" : "FAILED !")
+ << EOL_FLUSH;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// NON-REGRESSION TEST API
+////////////////////////////////////////////////////////////////////////////////
+
+void AvmHitOrJumpProcessor::tddRegressionReportImpl(OutStream & os)
+{
+ os << TAB << "HIT OR JUMP COVERAGE : "
+ << mCoverageStatistics.strCoverageRate() << " ==> "
+ << (mHitProcessor->goalAchieved() ? "DONE !" : "FAILED !")
+ << EOL_FLUSH;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// PROCESS API
+////////////////////////////////////////////////////////////////////////////////
+
+//bool AvmHitOrJumpProcessor::preprocess()
+//{
+// return( true );
+//}
+//
+//
+//bool AvmHitOrJumpProcessor::postprocess()
+//{
+// //BaseCoverageFilter::postprocess();
+//
+// return( true );
+//}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// PRE-FILTER API
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmHitOrJumpProcessor::filteringInitialize()
+{
+ // Preserve every root context
+ mListOfPositiveEC.append( getExecutionQueue().getInitQueue() );
+ mInitialRootEC.append( getExecutionQueue().getInitQueue() );
+
+ if( mGlobalSearchScopeFlag )
+ {
+ mRelativeRootEC.append( getExecutionQueue().getInitQueue() );
+ }
+ else if( getExecutionQueue().hasInit() )
+ {
+ mBufferLocalRootEC.splice( getExecutionQueue().getInitQueue() );
+
+ mRelativeRootEC.append( mBufferLocalRootEC.front() );
+
+ // First Jump Height!
+ mJumpHeight = mJumpDelta + mBufferLocalRootEC.front()->getHeight();
+
+ getExecutionQueue().getInitQueue().append( mBufferLocalRootEC.front() );
+
+ mBufferLocalRootEC.pop_front();
+ }
+
+ mAbsoluteStopContextFlag = true;
+
+ mJumpTrialsCount = 0;
+
+ getSymbexRequestManager().postRequestContinue( this );
+
+ return( true );
+}
+
+
+bool AvmHitOrJumpProcessor::prefilter()
+{
+ ecQueue = &( getExecutionQueue().getReadyQueue() );
+
+ mAbsoluteStopContextFlag = false;
+
+ if( ecQueue->nonempty() )
+ {
+ ecQueueIt = ecQueue->begin();
+ ecQueueItEnd = ecQueue->end();
+ for( ; ecQueueIt != ecQueueItEnd ; )
+ {
+// prefilter(*ecQueueIt);
+
+ if( mHitProcessor->goalWillNeverAchieved( *ecQueueIt ) )
+ {
+ ecQueueIt = ecQueue->erase( ecQueueIt );
+ }
+
+ else if( (*ecQueueIt)->getHeight() >= mJumpHeight )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< jump< 1 > >>>>> EC< id:"
+ << (*ecQueueIt)->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ mRelativeLeafEC.append( *ecQueueIt );
+
+ ecQueueIt = ecQueue->erase( ecQueueIt );
+ }
+ else
+ {
+ ++ecQueueIt;
+ }
+ }
+ }
+
+ return( getExecutionQueue().hasReady() );
+}
+
+
+bool AvmHitOrJumpProcessor::prefilter(ExecutionContext & anEC)
+{
+ if( mHitProcessor->goalAchieved() && mStopFlag )
+ {
+ return( false );
+ }
+
+ return( true );
+}
+
+
+/**
+ * PROCESSOR REQUEST API :> CONITNUE
+ * Jump step
+ */
+void AvmHitOrJumpProcessor::handleRequestContinue()
+{
+ if( mRelativeRootEC.empty() )
+ {
+ if( not hojBacktrack() )
+ {
+ getSymbexRequestManager().postRequestGoalAchieved( this );
+ }
+
+ return;
+ }
+
+ if( mHitProcessor->hit(mJumpHeight) )
+ {
+ mSelectionCount = mHitCount;
+
+ mHitCaseFlag = true;
+
+ if( mHitProcessor->goalAchieved() )
+ {
+ mGoalAchieved = true;
+
+ if( mHitFinalFlag || mHitMaxFlag )
+ {
+ hojSelectionFinal();
+ }
+
+ if( mHitMaxFlag && hojBacktrack() )
+ {
+ return;
+ }
+
+ getSymbexRequestManager().postRequestGoalAchieved( this );
+
+ if( mStopFlag )
+ {
+ return;
+ }
+ }
+ }
+ else if( mHitConsecutiveFlag && (mCoverageStatistics.mNumberOfCovered > 0) )
+ {
+ getSymbexRequestManager().postRequestGoalAchieved( this );
+
+ return;
+ }
+ else
+ {
+ mSelectionCount = mJumpCount;
+
+ mHitCaseFlag = false;
+ }
+
+ if( mRelativeLeafEC.nonempty() )
+ {
+ hojSelection();
+ }
+ else
+ {
+ // Locally slice if mJumpSliceFlag
+ jumpSlice();
+
+ if( mBacktrackFlag && hojBacktrack() )
+ {
+ return;
+ }
+
+ mAbsoluteStopContextFlag = true;
+
+ mRelativeRootEC.clear();
+ }
+
+
+ if( ++mJumpTrialsCount > mJumpTrialsLimit )
+ {
+ getSymbexRequestManager().postRequestGoalAchieved( this );
+
+ return;
+ }
+
+ else if( mAbsoluteStopContextFlag )
+ {
+ mCoverageStatistics.copyIfBestCoverageRate(mFinalCoverageStatistics);
+
+ getSymbexRequestManager().postRequestGoalAchieved( this );
+ }
+ else if( mRelativeRootEC.nonempty() )
+ {
+ getSymbexRequestManager().postRequestContinue( this );
+
+ getExecutionQueue().appendReady( mRelativeRootEC );
+
+ mJumpHeight = mJumpHeight + mJumpDelta;
+
+ mAbsoluteStopContextFlag = true;
+ }
+
+ else if( not hojBacktrack() )
+ {
+ getSymbexRequestManager().postRequestGoalAchieved( this );
+ }
+}
+
+
+/**
+ * PROCESSOR REQUEST API :> GOAL_ACHIEVED
+ * Ending (positive or negative) locally or globally objective
+ */
+void AvmHitOrJumpProcessor::handleRequestGoalAchieved()
+{
+ if( mGlobalSearchScopeFlag || mBufferLocalRootEC.empty() )
+ {
+// mGoalAchieved = true;
+
+ getSymbexRequestManager().postRequestStop( this );
+ }
+ else
+ {
+ getExecutionQueue().handleRequestStop();
+
+ mRelativeRootEC.clear();
+ mRelativeRootEC.append( mBufferLocalRootEC.front() );
+
+
+ // Reinitialize parameters for restarting;
+ mJumpHeight = mJumpDelta + mBufferLocalRootEC.front()->getHeight();
+ mHitProcessor->resetConfig();
+ mCoverageStatistics.resetCoverageCounter();
+
+
+ getExecutionQueue().pushWaiting( mBufferLocalRootEC.front() );
+
+ mBufferLocalRootEC.pop_front();
+
+ mAbsoluteStopContextFlag = true;
+
+ mJumpTrialsCount = 0;
+
+ getSymbexRequestManager().postRequestContinue( this );
+ }
+}
+
+
+bool AvmHitOrJumpProcessor::hojBacktrack()
+{
+ if( mBacktrackHitEC.empty() )
+ {
+ return( false );
+ }
+
+ mFinalCoverageStatistics.copyIfBestCoverageRate( mCoverageStatistics );
+
+ ++( mFinalCoverageStatistics.mNumberOfBacktrack );
+ ++( mCoverageStatistics.mNumberOfBacktrack );
+
+ mBacktrackHitEC.pop_last_to( tmpEC );
+ getExecutionQueue().pushWaiting( tmpEC );
+
+ mCoverageStatistics = tmpEC->getUniqInformation()->
+ getUniqHitOrJumpObjectiveInfo()->
+ getCoverageStatistics();
+
+ mJumpHeight = tmpEC->getHeight() + mJumpDelta;
+
+ mRelativeRootEC.clear();
+ mRelativeRootEC.append( tmpEC );
+
+ mAbsoluteStopContextFlag = true;
+
+ getSymbexRequestManager().postRequestContinue( this );
+
+AVM_IF_DEBUG_LEVEL_GTE_MEDIUM
+ AVM_OS_COUT << "<<<<< HoJ Backtrack EC< id:"
+ << tmpEC->getIdNumber() << " > where "
+ << mCoverageStatistics.strCoverageRate() << " >>>>>" << std::endl;
+ AVM_OS_TRACE << "<<<<< HoJ Backtrack EC< id:"
+ << tmpEC->getIdNumber() << " > where "
+ << mCoverageStatistics.strCoverageRate() << " >>>>>" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_GTE_MEDIUM
+
+ return( true );
+}
+
+
+void AvmHitOrJumpProcessor::hojSelection()
+{
+AVM_IF_DEBUG_LEVEL_GTE_MEDIUM
+ AVM_OS_COUT << "<<<<< HoJ Coverage : "
+ << mCoverageStatistics.strCoverageRate() << " >>>>>" << std::endl;
+ AVM_OS_TRACE << "<<<<< HoJ Coverage : "
+ << mCoverageStatistics.strCoverageRate() << " >>>>>" << std::endl;
+
+ //!! current Relative Root& Leaf EC
+ ExecutionContext::traceMinimum(AVM_OS_TRACE,
+ mRelativeRootEC, "the Relative Root EC");
+
+ ExecutionContext::traceMinimum(AVM_OS_TRACE,
+ mRelativeLeafEC, "the Relative Leaf EC");
+AVM_ENDIF_DEBUG_LEVEL_GTE_MEDIUM
+
+
+ // Remove EC when Parent is in any BlackList
+ updateRelativeLeaf();
+
+ // Hit or JUMP
+ mRelativeRootEC.clear();
+
+ leafCount = mRelativeLeafEC.size();
+
+ if( leafCount == 0 )
+ {
+ // Locally slice if mJumpSliceFlag
+ jumpSlice();
+
+ return;
+ }
+
+ randomMax = leafCount - 1;
+
+ if( (mSelectionCount == 1) || (leafCount == 1) )
+ {
+ jumpOffset = (leafCount == 1) ? 0 : RANDOM::gen_uint(0, randomMax);
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< jump< 0 > >>>>> EC< id:"
+ << mRelativeLeafEC[jumpOffset]->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ if( mHitCaseFlag )
+ {
+ mHitProcessor->hitSelect( jumpOffset );
+ }
+ else if( mBacktrackFlag )
+ {
+ mBacktrackHitEC.remove( mRelativeLeafEC[jumpOffset] );
+ }
+
+ mRelativeRootEC.append( mRelativeLeafEC[jumpOffset] );
+ }
+
+ else if( mSelectionCount < leafCount )
+ {
+ jumpOffsetBitset.reset();
+ jumpOffsetBitset.resize(leafCount, false);
+
+ for( leafOffset = 0 ; leafOffset < mSelectionCount ; ++leafOffset )
+ {
+ do
+ {
+ jumpOffset = RANDOM::gen_uint(0, randomMax);
+ }
+ while( jumpOffsetBitset[jumpOffset] );
+
+ jumpOffsetBitset[jumpOffset] = true;
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< jump< 0 > >>>>> EC< id:"
+ << mRelativeLeafEC[jumpOffset]->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ if( mHitCaseFlag )
+ {
+ mHitProcessor->hitSelect( jumpOffset );
+ }
+ else if( mBacktrackFlag )
+ {
+ mBacktrackHitEC.remove( mRelativeLeafEC[jumpOffset] );
+ }
+
+ mRelativeRootEC.append( mRelativeLeafEC[jumpOffset] );
+ }
+ }
+
+ else
+ {
+ for( leafOffset = 0 ; leafOffset < leafCount ; ++leafOffset )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< jump< 0 > >>>>> EC< id:"
+ << mRelativeLeafEC[leafOffset]->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ if( mHitCaseFlag )
+ {
+ mHitProcessor->hitSelect( leafOffset );
+ }
+ else if( mBacktrackFlag )
+ {
+ mBacktrackHitEC.remove( mRelativeLeafEC[jumpOffset] );
+ }
+
+ mRelativeRootEC.append( mRelativeLeafEC[leafOffset] );
+ }
+ }
+
+ mRelativeLeafEC.clear();
+
+ // Locally slice if mJumpSliceFlag
+ jumpSlice();
+
+
+AVM_IF_DEBUG_LEVEL_GTE_MEDIUM
+ AVM_OS_TRACE << "<<<<< HoJ Coverage : "
+ << mCoverageStatistics.strCoverageRate() << " >>>>>" << std::endl;
+
+ //!! Next Relative Root EC
+ ExecutionContext::traceMinimum(AVM_OS_TRACE,
+ mRelativeRootEC, "the Relative Root EC");
+AVM_ENDIF_DEBUG_LEVEL_GTE_MEDIUM
+}
+
+
+void AvmHitOrJumpProcessor::hojSelectionFinal()
+{
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_COUT << "<<<<< HoJ Goal Achieved : "
+ << mCoverageStatistics.strCoverageRate() << " >>>>>" << std::endl;
+ AVM_OS_TRACE << "<<<<< HoJ Goal Achieved : "
+ << mCoverageStatistics.strCoverageRate() << " >>>>>" << std::endl;
+
+ ExecutionContext::traceMinimum(AVM_OS_TRACE,
+ mRelativeLeafEC, "the Relative Leaf EC");
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ // Hit Final
+ mRelativeRootEC.clear();
+
+ if( mHitMaxFlag )
+ {
+ mSelectionCount = mRelativeLeafEC.size();
+ }
+
+ leafCount = mRelativeLeafEC.size();
+ randomMax = leafCount - 1;
+
+ if( (mSelectionCount == 1) || (leafCount == 1) )
+ {
+ jumpOffset = (leafCount == 1) ? 0 : RANDOM::gen_uint(0, randomMax);
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< jump< goal achieved > >>>>> EC< id:"
+ << mRelativeLeafEC[jumpOffset]->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ mRelativeLeafEC[jumpOffset]->getwFlags().setObjectiveAchievedTrace();
+
+ mListOfPositiveEC.append( mRelativeLeafEC[jumpOffset] );
+ }
+
+ else if( mSelectionCount < leafCount )
+ {
+ jumpOffsetBitset.reset();
+ jumpOffsetBitset.resize(leafCount, false);
+
+ for( leafOffset = 0 ; leafOffset < mSelectionCount ; ++leafOffset )
+ {
+ do
+ {
+ jumpOffset = RANDOM::gen_uint(0, randomMax);
+ }
+ while( jumpOffsetBitset[jumpOffset] );
+
+ jumpOffsetBitset[jumpOffset] = true;
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< jump< goal achieved > >>>>> EC< id:"
+ << mRelativeLeafEC[jumpOffset]->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ mRelativeLeafEC[jumpOffset]->getwFlags().setObjectiveAchievedTrace();
+
+ mListOfPositiveEC.append( mRelativeLeafEC[jumpOffset] );
+ }
+ }
+
+ else
+ {
+ for( leafOffset = 0 ; leafOffset < leafCount ; ++leafOffset )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< jump< goal achieved > >>>>> EC< id:"
+ << mRelativeLeafEC[leafOffset]->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ mRelativeLeafEC[jumpOffset]->getwFlags().setObjectiveAchievedTrace();
+
+ mListOfPositiveEC.append( mRelativeLeafEC[leafOffset] );
+ }
+ }
+
+ mRelativeLeafEC.clear();
+
+ // Locally slice if mJumpSliceFlag
+ jumpSlice();
+
+
+AVM_IF_DEBUG_LEVEL_GTE_MEDIUM
+ AVM_OS_TRACE << "<<<<< HoJ Coverage : "
+ << mCoverageStatistics.strCoverageRate() << " >>>>>" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_GTE_MEDIUM
+}
+
+
+void AvmHitOrJumpProcessor::updateRelativeLeaf()
+{
+ jumpOffset = 0;
+ leafCount = mRelativeLeafEC.size();
+
+ // Position for Left Shift of non-BlackListed Context Leaf
+ randomMax = leafCount;
+
+ // Mark Blacklisted Context Leaf using NULL
+ for( leafOffset = 0 ; leafOffset < leafCount ; ++leafOffset )
+ {
+ tmpEC = mRelativeLeafEC[leafOffset];
+
+ if( mAbsoluteLeafEC.contains( tmpEC ) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< hoj< leaf failed > >>>>> EC< id:"
+ << mRelativeLeafEC[leafOffset]->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ mRelativeLeafEC[leafOffset] = NULL;
+
+ if( randomMax == leafCount )
+ {
+ randomMax = leafOffset;
+ }
+
+ continue;
+ }
+
+ for( jumpOffset = 0 ; jumpOffset < mJumpDelta ; ++jumpOffset )
+ {
+ if( tmpEC->isRoot() || mInitialRootEC.contains(tmpEC) )
+ {
+ break;
+ }
+ else if( mBlackHoleEC.contains( tmpEC ) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< hoj< leaf failed > >>>>> EC< id:"
+ << mRelativeLeafEC[leafOffset]->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ mRelativeLeafEC[leafOffset] = NULL;
+
+ if( randomMax == leafCount )
+ {
+ randomMax = leafOffset;
+ }
+
+ break;
+ }
+
+ tmpEC = tmpEC->getPrevious();
+ }
+
+ if( (randomMax < leafCount) && (mRelativeLeafEC[leafOffset] != NULL) )
+ {
+ mRelativeLeafEC[randomMax++] = mRelativeLeafEC[leafOffset];
+ }
+
+ }
+
+ // Remove NULL Context Leaf
+ if( randomMax < leafCount )
+ {
+ mRelativeLeafEC.resize( randomMax );
+ }
+}
+
+
+/**
+ * Slice leaf in mSliceableEC
+ * w.r.t. the hit/jump/preserved leaf in mRelativeRootEC/mPreservedEC
+ * and backward until mJumpDelta
+ */
+void AvmHitOrJumpProcessor::jumpSlice()
+{
+// //!! Blacktrack
+// ExecutionContext::traceMinimum(AVM_OS_TRACE,
+// mBacktrackHitEC, "the Backtrack Hit EC");
+//
+// //!! BlackHole ?
+// ExecutionContext::traceMinimum(AVM_OS_TRACE,
+// mBlackHoleEC, "the Black Hole EC");
+//
+// //!! DeadLock or Absolute Stop ?
+// ExecutionContext::traceMinimum(AVM_OS_TRACE,
+// mAbsoluteLeafEC, "the Absolute Leaf EC");
+
+ if( mJumpSliceFlag )
+ {
+ if( mHitLuckyFlag )
+ {
+ mBlackHoleEC.clear();
+ mAbsoluteLeafEC.clear();
+
+ jumpSliceLucky();
+ }
+ else // if( mBacktrackFlag )
+ {
+ jumpSliceBacktrack();
+ }
+
+AVM_IF_DEBUG_LEVEL_GTE_MEDIUM
+ AVM_OS_TRACE << "<<<<< Slice count : " << mSliceCount
+ << " >>>>>" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_GTE_MEDIUM
+ }
+
+ mSliceableEC.clear();
+}
+
+
+void AvmHitOrJumpProcessor::updatePreserved()
+{
+ mJumpPreservedEC.clear();
+ mJumpPreservedLeavesEC.clear();
+
+// ExecutionContext::traceMinimum(AVM_OS_TRACE,
+// mRelativeRootEC, "the Relative Root EC");
+
+ mJumpPreservedLeavesEC.append(mRelativeRootEC);
+
+ ecItEnd = mJumpPreservedLeavesEC.end();
+ for( ecIt = mJumpPreservedLeavesEC.begin() ; ecIt != ecItEnd ; ++ecIt )
+ {
+ tmpEC = (*ecIt);
+
+ mJumpPreservedEC.append( tmpEC );
+
+ if( tmpEC->isRoot() || mInitialRootEC.contains(tmpEC) )
+ {
+ continue;
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< preserved EC< id: "
+ << tmpEC->getIdNumber() << " > >>>>> " << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ for( jumpOffset = 1 ; jumpOffset < mJumpDelta ; ++jumpOffset )
+ {
+ tmpEC = tmpEC->getPrevious();
+
+ if( tmpEC->isRoot() || mInitialRootEC.contains(tmpEC) ||
+ mJumpPreservedEC.contains( tmpEC ) )
+ {
+ continue;
+ }
+
+ mJumpPreservedEC.append( tmpEC );
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< preserved EC< id: "
+ << tmpEC->getIdNumber() << " > >>>>> " << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ }
+ }
+}
+
+
+void AvmHitOrJumpProcessor::jumpSliceLucky()
+{
+ updatePreserved();
+
+// ExecutionContext::traceMinimum(AVM_OS_TRACE,
+// mJumpPreservedEC, "the Jump Preserved EC");
+//
+// ExecutionContext::traceMinimum(AVM_OS_TRACE,
+// mJumpPreservedLeavesEC, "the Jump Preserved Leaves EC");
+
+
+ ecItEnd = mJumpPreservedLeavesEC.end();
+ for( ecIt = mJumpPreservedLeavesEC.begin() ; ecIt != ecItEnd ; ++ecIt )
+ {
+ tmpEC = (*ecIt);
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< jumpSlice from preserved leaf EC< id: "
+ << tmpEC->getIdNumber() << " > >>>>> " << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ if( tmpEC->isRoot() || mInitialRootEC.contains(tmpEC) )
+ {
+ continue;
+ }
+
+ for( jumpOffset = 0 ; jumpOffset < mJumpDelta ; ++jumpOffset )
+ {
+ tmpEC = tmpEC->getPrevious();
+ if( tmpEC->isRoot() || mInitialRootEC.contains(tmpEC) )
+ {
+ break;
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< jumpSlice from preserved EC< id: "
+ << tmpEC->getIdNumber() << " > >>>>> " << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ endChildEC = tmpEC->end();
+ for( itChildEC = tmpEC->begin() ; itChildEC != endChildEC ; )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< jumpSlice ??? EC< id: " << (*itChildEC)->getIdNumber()
+ << " > >>>>> count:> " << mSliceCount << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ if( mJumpPreservedEC.contains( *itChildEC ) )
+ {
+ ++itChildEC;
+ }
+ else
+ {
+ prevEC = (*itChildEC);
+
+ itChildEC = tmpEC->eraseChildContext( itChildEC );
+ prevEC->setContainer( NULL );
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< jumpSlice EC< id: " << prevEC->getIdNumber()
+ << " > >>>>> " << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ mSliceCount = mSliceCount + AbstractProcessorUnit::remove(
+ prevEC, AVM_OS_TRACE, "<<<<< jumpSliceLucky" );
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< jumpSlice count: " << mSliceCount
+ << " >>>>>" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ }
+ }
+ }
+ }
+}
+
+
+void AvmHitOrJumpProcessor::jumpSliceBacktrack()
+{
+ //!! BlackHole ?
+ mSliceableEC.splice( mBlackHoleEC );
+
+ //!! DeadLock or Absolute Stop ?
+ mSliceableEC.splice( mAbsoluteLeafEC );
+
+// mSliceableEC.unique();
+
+ ecItEnd = mSliceableEC.end();
+ for( ecIt = mSliceableEC.begin() ; ecIt != ecItEnd ; ++ecIt )
+ {
+ tmpEC = (*ecIt);
+
+ for( jumpOffset = 0 ; jumpOffset <= mJumpDelta ; ++jumpOffset )
+ {
+ if( (tmpEC->hasNext() && (jumpOffset > 0)) || tmpEC->isRoot() ||
+ mListOfPositiveEC.contains(tmpEC) )
+ {
+ break;
+ }
+
+ prevEC = tmpEC->getPrevious();
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< jumpSlice EC< id: " << tmpEC->getIdNumber()
+ << " > >>>>>" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ mSliceCount = mSliceCount + AbstractProcessorUnit::remove(
+ tmpEC, AVM_OS_TRACE, "<<<<< jumpSliceBacktrack" );
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< jumpSlice count: " << mSliceCount
+ << " >>>>>" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+
+ tmpEC = prevEC;
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// POST-FILTER API
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmHitOrJumpProcessor::postfilter()
+{
+// ecQueue = &( getExecutionQueue().getResultQueue() );
+// ecQueueItEnd = ecQueue->end();
+// for( ecQueueIt = ecQueue->begin() ; ecQueueIt != ecQueueItEnd ; )
+// {
+// if( postfilter(*ecQueueIt) )
+// {
+// ++ecQueueIt;
+// }
+// else
+// {
+// ecQueueIt = ecQueue->erase(ecQueueIt);
+// }
+// }
+
+ return( getExecutionQueue().hasResult() );
+}
+
+
+bool AvmHitOrJumpProcessor::postfilter(ExecutionContext & anEC)
+{
+// if( mHitProcessor->hit(anEC) )
+// {
+// if( mHitProcessor->goalAchieved() && mStopFlag )
+// {
+// return( false );
+// }
+// }
+
+ return( true );
+}
+
+
+/**
+ * IHandlerEventDestroyCtx API
+ * Destroy Execution Context
+ */
+void AvmHitOrJumpProcessor::handleEventDestroyCtx(ExecutionContext * anEC)
+{
+ mBacktrackHitEC.remove( anEC );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////
+// FINAL SLICING TOOLS
+////////////////////////////////////////////////////////////////////////////
+
+bool AvmHitOrJumpProcessor::isSliceableContext(ExecutionContext & anEC) const
+{
+ if( mHitProcessor->goalAchieved() )
+ {
+ return( anEC.getFlags().noneObjectiveAchievedTrace()
+ && (not mInitialRootEC.contains(& anEC)) );
+ }
+ else
+ {
+ return( anEC.getFlags().noneCoverageElementTrace()
+ && (not mInitialRootEC.contains(& anEC))
+ && (not mListOfPositiveEC.contains(& anEC)) );
+ }
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/hitorjump/AvmHitOrJumpProcessor.h b/org.eclipse.efm.symbex/src/fam/hitorjump/AvmHitOrJumpProcessor.h
new file mode 100644
index 0000000..4f2da3d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/hitorjump/AvmHitOrJumpProcessor.h
@@ -0,0 +1,443 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 7 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMHITORJUMPPROCESSOR_H_
+#define AVMHITORJUMPPROCESSOR_H_
+
+#include <fam/coverage/BaseCoverageFilter.h>
+#include <sew/SymbexEventManager.h>
+
+#include <collection/Bitset.h>
+
+#include <fml/operator/OperatorLib.h>
+
+#include <fam/coverage/AvmCoverageStatistics.h>
+
+
+namespace sep
+{
+
+class BaseHitProcessor;
+class ExecutionContext;
+class SymbexControllerUnitManager;
+
+
+class AvmHitOrJumpProcessor :
+ public AutoRegisteredCoverageProcessorUnit< AvmHitOrJumpProcessor > ,
+ public IHandlerEventDestroyCtx
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( AvmHitOrJumpProcessor )
+
+
+ /**
+ * PROCESSOR FACTORY
+ * for automatic registration in the processor repository
+ * the [ [ FULLY ] QUALIFIED ] NAME ID
+ */
+ AVM_INJECT_AUTO_REGISTER_QUALIFIED_ID_KEY_2(
+ "coverage#behavior",
+ "avm::processor.HIT_OR_JUMP" )
+ // end registration
+
+
+public:
+ /**
+ * ATTRIBUTE
+ */
+ BaseHitProcessor * mHitProcessor;
+
+ bool mGlobalSearchScopeFlag;
+
+ AVM_OPCODE scheduler;
+
+ bool mFoldingFlag;
+
+ avm_size_t mJumpDelta;
+ avm_size_t mJumpHeight;
+
+ avm_size_t mJumpTrialsCount;
+ avm_size_t mJumpTrialsLimit;
+
+ bool mHitConsecutiveFlag;
+ bool mHitMaxFlag;
+ bool mHitLuckyFlag;
+ bool mBacktrackFlag;
+
+ avm_size_t mHitCount;
+ avm_size_t mJumpCount;
+
+ bool mHitFinalFlag;
+
+
+ bool mJumpSliceFlag;
+
+ AvmCoverageStatistics mFinalCoverageStatistics;
+
+ bool mGoalAchieved;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing Variables
+ bool mAbsoluteStopContextFlag;
+
+ bool mHitCaseFlag;
+
+ avm_size_t mSelectionCount;
+
+ ListOfExecutionContext mInitialRootEC;
+ ListOfExecutionContext mBufferLocalRootEC;
+
+ ListOfExecutionContext mRelativeRootEC;
+ VectorOfExecutionContext mRelativeLeafEC;
+
+ ListOfExecutionContext mAbsoluteLeafEC;
+ ListOfExecutionContext mBlackHoleEC;
+
+ ListOfExecutionContext mBacktrackHitEC;
+
+ ListOfExecutionContext mSliceableEC;
+ ListOfExecutionContext mJumpPreservedEC;
+ ListOfExecutionContext mJumpPreservedLeavesEC;
+
+protected:
+ ListOfExecutionContext::iterator ecIt;
+ ListOfExecutionContext::iterator ecItEnd;
+
+ ListOfExecutionContext::iterator itChildEC;
+ ListOfExecutionContext::iterator endChildEC;
+
+ ExecutionContext * tmpEC;
+ ExecutionContext * prevEC;
+
+ avm_size_t leafOffset;
+ avm_size_t leafCount;
+
+ avm_size_t randomMax;
+
+ avm_size_t jumpOffset;
+ Bitset jumpOffsetBitset;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmHitOrJumpProcessor(SymbexControllerUnitManager & aControllerUnitManager,
+ WObject * wfParameterObject)
+ : RegisteredCoverageProcessorUnit(aControllerUnitManager, wfParameterObject,
+ AVM_PRE_FILTERING_STAGE, PRECEDENCE_OF_HIT_OR_JUMP),
+ mHitProcessor( NULL ),
+
+ mGlobalSearchScopeFlag( true ),
+ scheduler( AVM_OPCODE_SEQUENCE ),
+
+ mFoldingFlag( true ),
+
+ mJumpDelta( 1 ),
+ mJumpHeight( mJumpDelta ),
+ mJumpTrialsCount( 0 ),
+ mJumpTrialsLimit( AVM_NUMERIC_MAX_SIZE_T ),
+
+ mHitConsecutiveFlag( false ),
+ mHitMaxFlag( false ),
+ mHitLuckyFlag( false ),
+ mBacktrackFlag( true ),
+
+ mHitCount( 1 ),
+ mJumpCount( 1 ),
+
+ mHitFinalFlag( true ),
+ mJumpSliceFlag( true ),
+
+ mFinalCoverageStatistics( ),
+
+ mGoalAchieved( false ),
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing Variables
+ mAbsoluteStopContextFlag( false ),
+ mHitCaseFlag( false ),
+
+ mSelectionCount( 1 ),
+
+ mInitialRootEC( ),
+ mBufferLocalRootEC( ),
+
+ mRelativeRootEC( ),
+ mRelativeLeafEC( ),
+
+ mAbsoluteLeafEC( ),
+ mBlackHoleEC( ),
+
+ mBacktrackHitEC( ),
+
+
+ mSliceableEC( ),
+ mJumpPreservedEC( ),
+ mJumpPreservedLeavesEC( ),
+
+ ecIt( ),
+ ecItEnd( ),
+
+ itChildEC( ),
+ endChildEC( ),
+
+ tmpEC( NULL ),
+ prevEC( NULL ),
+
+ leafOffset( 0 ),
+ leafCount( 0 ),
+
+ randomMax( 0 ),
+
+ jumpOffset( 0 ),
+ jumpOffsetBitset( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AvmHitOrJumpProcessor()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool configureImpl();
+
+
+ /**
+ * scheduler
+ */
+ inline bool isOrdered() const
+ {
+ return( scheduler == AVM_OPCODE_PRIOR_GT );
+ }
+
+ inline bool isRegex() const
+ {
+ return( scheduler == AVM_OPCODE_REGEX );
+ }
+
+ inline bool isUnordered() const
+ {
+ return( scheduler == AVM_OPCODE_INTERLEAVING );
+ }
+
+
+ inline std::string strScheduler() const
+ {
+ return( OperatorLib::to_string(scheduler) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // REPORT API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual void reportMinimum(OutStream & os) const;
+
+ virtual void reportDefault(OutStream & os) const;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // NON-REGRESSION TEST API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual void tddRegressionReportImpl(OutStream & os);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PROCESS API
+ ////////////////////////////////////////////////////////////////////////////
+
+// virtual bool preprocess();
+//
+// virtual bool postprocess();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FILTER API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool filteringInitialize();
+
+ virtual bool prefilter();
+ virtual bool prefilter(ExecutionContext & anEC);
+
+
+ /**
+ * PROCESSOR REQUEST API :> CONITNUE , GOAL_ACHIEVED
+ */
+ virtual void handleRequestContinue();
+
+ virtual void handleRequestGoalAchieved();
+
+ bool hojBacktrack();
+
+ void hojSelection();
+ void hojSelectionFinal();
+
+ void updateRelativeLeaf();
+
+
+ void updatePreserved();
+ void jumpSlice();
+ void jumpSliceBacktrack();
+ void jumpSliceLucky();
+
+ virtual bool postfilter();
+ virtual bool postfilter(ExecutionContext & anEC);
+
+
+ /**
+ * IHandlerEventDestroyCtx API
+ * Destroy Execution Context
+ */
+ virtual void handleEventDestroyCtx(ExecutionContext * anEC);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FINAL SLICING TOOLS
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool isSliceableContext(ExecutionContext & anEC) const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SERIALIZATION API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline virtual void toStream(OutStream & os) const
+ {
+ if( mParameterWObject != NULL )
+ {
+ mParameterWObject->toStream(os);
+ }
+ }
+
+};
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// AvmHitOrJumpObjective Information
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class HitOrJumpObjectiveInfo :
+ public Element ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( HitOrJumpObjectiveInfo )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( HitOrJumpObjectiveInfo )
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ AvmCoverageStatistics mCoverageStatistics;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ HitOrJumpObjectiveInfo()
+ : Element( CLASS_KIND_T( HitOrJumpObjectiveInfo ) ),
+ mCoverageStatistics( )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ HitOrJumpObjectiveInfo(const HitOrJumpObjectiveInfo & hojInfo)
+ : Element( hojInfo ),
+ mCoverageStatistics( hojInfo.mCoverageStatistics )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~HitOrJumpObjectiveInfo()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * mCoverageStatistics
+ */
+ AvmCoverageStatistics & getCoverageStatistics()
+ {
+ return mCoverageStatistics;
+ }
+
+ void setCoverageStatistics(
+ AvmCoverageStatistics & aCoverageStatistics, avm_size_t hitCount = 0)
+ {
+ mCoverageStatistics = aCoverageStatistics;
+
+ mCoverageStatistics.addCoveredElement(hitCount);
+ }
+
+ void setCoverageStatistics(AvmCoverageStatistics & aCoverageStatistics,
+ Bitset & coverageBitset, avm_size_t hitCount = 0)
+ {
+ mCoverageStatistics = aCoverageStatistics;
+
+ mCoverageStatistics.addCoveredElement(hitCount);
+
+ mCoverageStatistics.mCoverageBitset = coverageBitset;
+ }
+
+
+ /**
+ * Serialization
+ */
+ void toStream(OutStream & os) const
+ {
+ //!!! NOTHING
+ }
+
+ void toFscn(OutStream & os) const
+ {
+ //!!! NOTHING
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* AVMHITORJUMPPROCESSOR_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/hitorjump/BaseHitProcessor.cpp b/org.eclipse.efm.symbex/src/fam/hitorjump/BaseHitProcessor.cpp
new file mode 100644
index 0000000..8e95587
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/hitorjump/BaseHitProcessor.cpp
@@ -0,0 +1,380 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 7 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "BaseHitProcessor.h"
+
+#include <builder/Builder.h>
+
+#include <computer/EvaluationEnvironment.h>
+
+#include <fam/hitorjump/AvmHitOrJumpProcessor.h>
+
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/ExecutableSystem.h>
+#include <fml/executable/InstanceOfData.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/type/TypeSpecifier.h>
+
+#include <fml/trace/TraceFactory.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <sew/Configuration.h>
+
+#include <solver/api/SolverFactory.h>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+BaseHitProcessor::BaseHitProcessor(AvmHitOrJumpProcessor & hojProcessor,
+ EvaluationEnvironment & anENV, Operator * op)
+: mHitOrJumpProcessor( hojProcessor ),
+mCoverageStatistics( hojProcessor.getCoverageStatistics() ),
+ENV( anENV ),
+
+mSolverKind( SolverDef::SOLVER_UNDEFINED_KIND ),
+mLocalExecutableForm(
+ mHitOrJumpProcessor.getConfiguration().getExecutableSystem(), 0 ),
+mTraceChecker( anENV, &mLocalExecutableForm ),
+
+mTraceObjective( op ),
+isPureStateTransitionNatureFlag( false ),
+
+// Computing Local Variables
+traceOffset( 0 ),
+
+mRelativeRootEC( hojProcessor.mRelativeRootEC ),
+ecIt( ),
+ecItEnd( ),
+mRelativeLeafEC( hojProcessor.mRelativeLeafEC ),
+
+mAbsoluteLeafEC( hojProcessor.mAbsoluteLeafEC ),
+
+mBlackHoleEC( hojProcessor.mBlackHoleEC ),
+
+mBacktrackHitEC( hojProcessor.mBacktrackHitEC ),
+mBacktrackFlag( hojProcessor.mBacktrackFlag ),
+
+mJumpHeight( 0 ),
+
+mMaxHitEC( ),
+
+hitOffset( 0 ),
+hitOffsetEnd( 0 ),
+
+mHitCount( 0 ),
+
+ecChildIt( ),
+ecChildItEnd( )
+{
+ //!! NOTHING
+}
+
+
+/**
+ * GETTER
+ * mTraceObjective
+ */
+bool BaseHitProcessor::isPureStateTransitionObjective() const
+{
+ for( avm_size_t offset = 0 ; offset < mTraceObjective.size() ; ++offset )
+ {
+ if( mTraceChecker.isPointNature(mTraceObjective[offset],
+ ENUM_TRACE_POINT::TRACE_TRANSITION_NATURE) )
+ {
+ //!! CONTINUE
+ }
+ else if( mTraceChecker.isPointNature(mTraceObjective[offset],
+ ENUM_TRACE_POINT::TRACE_STATE_NATURE) )
+ {
+ //!! CONTINUE
+ }
+ else if( mTraceChecker.isPointNature(mTraceObjective[offset],
+ ENUM_TRACE_POINT::TRACE_STATEMACHINE_NATURE) )
+ {
+ //!! CONTINUE
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+}
+
+
+/*
+prototype process::hit_or_jump as &avm::processor.HIT_OR_JUMP is
+ section REPORT
+ ...
+ endsection REPORT
+
+ section PROPERTY
+ ...
+ endsection PROPERTY
+
+ // Declaration part
+ section POINT
+ @assign = "sens";
+
+ @newfresh = "sens";
+
+ @signal#sens = "sens";
+
+ @port = "env";
+
+ @input = "env";
+ @output = "env";
+
+ @output = "Thermostat->dt";
+ @input = "Thermostat->equip";
+ @output2 = "Equipment->error";
+ endsection POINT
+
+ section TRACE
+ @trace = ${ && "signal#sens" "output2" };
+ @trace = [ "signal#sens" , "output2" ];
+ @point = ( "signal#sens" || "output2" );
+ @composite = ${ xor "signal#sens" "output2" };
+
+ @assign = "sens";
+
+ @newfresh = "sens";
+
+ @signal = "sens";
+
+ @port = "env";
+
+ @input = "env";
+ @output = "env";
+
+ @output = "Thermostat->dt";
+ @input = "Thermostat->equip";
+ @output = "Equipment->error";
+ endsection TRACE
+endprototype
+*/
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+
+bool BaseHitProcessor::configure(WObject * wfParameterObject)
+{
+ const ExecutableSystem & anExecutableSystem =
+ mHitOrJumpProcessor.getConfiguration().getExecutableSystem();
+
+ mCoverageStatistics.resetCounter();
+
+
+ WObject * thePROPERTY = Query::getRegexWSequence(
+ wfParameterObject, OR_WID2("property", "PROPERTY"));
+ if( thePROPERTY != WObject::_NULL_ )
+ {
+ std::string mSolverName =
+ Query::getWPropertyString(thePROPERTY, "solver", "");
+ if( mSolverName.empty() )
+ {
+AVM_IF_DEBUG_FLAG( SOLVING )
+ thePROPERTY->warningLocation(AVM_OS_WARN)
+ << "Unexpected an empty solver engine kind!!!!!" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( SOLVING )
+ }
+ mSolverKind = SolverDef::toSolver(
+ mSolverName, SolverDef::DEFAULT_SOLVER_KIND);
+ }
+ else
+ {
+ mSolverKind = SolverDef::SOLVER_CVC4_KIND;
+ }
+
+ mTraceChecker.setSolverKind( mSolverKind );
+
+
+ WObject * theDATA = Query::getRegexWSequence(
+ wfParameterObject, OR_WID2("data", "DATA"));
+ if( theDATA != WObject::_NULL_ )
+ {
+ anExecutableSystem.initProcessExecutableForm(
+ mLocalExecutableForm, theDATA->ownedSize());
+
+ List< WObject * > listOfLocalVar;
+ Query::getListWObject(theDATA, listOfLocalVar);
+
+ TypeSpecifier aTypeSpecifier;
+
+ List< WObject * >::iterator it = listOfLocalVar.begin();
+ List< WObject * >::iterator itEnd = listOfLocalVar.end();
+ for( avm_offset_t offset = 0 ; it != itEnd ; ++it , ++offset )
+ {
+ aTypeSpecifier = ENV.getBuilder().getCompiler().
+ compileTypeSpecifier(&mLocalExecutableForm,
+ (*it)->getQualifiedTypeNameID() );
+
+ BF anInstance( new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ &mLocalExecutableForm, NULL, aTypeSpecifier,
+ (*it)->getFullyQualifiedNameID(), offset) );
+
+ mLocalExecutableForm.setData( offset , anInstance );
+ }
+ }
+ else
+ {
+ anExecutableSystem.initProcessExecutableForm(
+ mLocalExecutableForm, 0);
+ }
+
+
+ WObject * theTRACE = Query::getRegexWSequence(
+ wfParameterObject, OR_WID2("trace", "TRACE"));
+ if( (theTRACE == WObject::_NULL_) || theTRACE->hasnoOwnedElement() )
+ {
+ return true;
+ }
+
+ // Configuration of TRACE
+ TraceFactory traceFactory(mHitOrJumpProcessor.getConfiguration(),
+ ENV, wfParameterObject, &mLocalExecutableForm);
+
+ if( traceFactory.configure(& mTraceObjective) )
+ {
+// return( false );
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG( LOW , CONFIGURING )
+ AVM_OS_LOG << "The parsed trace :> " << std::endl;
+ mTraceObjective.toStream( AVM_OS_LOG << AVM_TAB1_INDENT );
+
+ mLocalExecutableForm.toStream( AVM_OS_LOG);
+
+ AVM_OS_LOG << END_INDENT << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( LOW , CONFIGURING )
+
+
+ mCoverageStatistics.mNumberOfElements = mTraceObjective.size();
+
+ mCoverageStatistics.mCoverageBitset.resize(
+ mCoverageStatistics.mNumberOfElements, false);
+
+
+ isPureStateTransitionNatureFlag = isPureStateTransitionObjective();
+
+ return( mCoverageStatistics.mNumberOfElements > 0 );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+
+bool BaseHitProcessor::resetConfig()
+{
+ mCoverageStatistics.resetCoverageCounter();
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// FILTERING TOOLS
+////////////////////////////////////////////////////////////////////////////////
+
+bool BaseHitProcessor::isAbsoluteLeaf(ExecutionContext * anEC)
+{
+ if( (not anEC->hasNext()) && ((anEC->getHeight() < mJumpHeight) ||
+ (not mRelativeLeafEC.contains(anEC)) ) )
+ {
+ //!! DeadLock or Absolute Stop ?
+ mAbsoluteLeafEC.append( anEC );
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< HoJ< DeadLock or Absolute Stop > >>>>> EC< id:"
+ << anEC->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// SERIALIZATION API
+////////////////////////////////////////////////////////////////////////////////
+
+void BaseHitProcessor::toStreamCovered(OutStream & os) const
+{
+ os << TAB << "hit<covered> { " << mHitOrJumpProcessor.strScheduler();
+ if( mCoverageStatistics.mCoverageBitset.anyTrue() )
+ {
+ os << EOL_INCR_INDENT;
+ for( avm_size_t traceOffset = 0 ;
+ traceOffset != mCoverageStatistics.mNumberOfElements ;
+ ++traceOffset )
+ {
+ if( mCoverageStatistics.mCoverageBitset.test(traceOffset) )
+ {
+ mTraceObjective[traceOffset].toStream(os);
+ }
+ }
+ os << DECR_INDENT_TAB ;
+ }
+ else
+ {
+ os << " ";
+ }
+ os << "}" << EOL;
+}
+
+
+void BaseHitProcessor::toStreamUncovered(OutStream & os) const
+{
+ os << TAB << "hit<uncovered> { " << mHitOrJumpProcessor.strScheduler();
+ if( mCoverageStatistics.mCoverageBitset.anyFalse() )
+ {
+ os << EOL_INCR_INDENT;
+ avm_size_t offset = 0;
+ for( ; offset != mCoverageStatistics.mNumberOfElements ; ++offset )
+ {
+ if( not mCoverageStatistics.mCoverageBitset.test(offset) )
+ {
+ mTraceObjective[offset].toStream(os);
+ }
+ }
+ os << DECR_INDENT_TAB ;
+ }
+ else
+ {
+ os << " ";
+ }
+ os << "}" << EOL;
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/hitorjump/BaseHitProcessor.h b/org.eclipse.efm.symbex/src/fam/hitorjump/BaseHitProcessor.h
new file mode 100644
index 0000000..3eaf818
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/hitorjump/BaseHitProcessor.h
@@ -0,0 +1,230 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 7 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BASEHITPROCESSOR_H_
+#define BASEHITPROCESSOR_H_
+
+#include <collection/BFContainer.h>
+
+#include <fml/executable/ExecutableForm.h>
+
+#include <fml/runtime/ExecutionContext.h>
+
+#include <fml/trace/TraceChecker.h>
+
+#include <fam/coverage/BaseCoverageFilter.h>
+
+#include <solver/api/SolverDef.h>
+
+
+
+namespace sep
+{
+
+class BF;
+
+class AvmCode;
+class AvmCoverageStatistics;
+class AvmHitOrJumpProcessor;
+
+class EvaluationEnvironment;
+class ExecutionContext;
+class ExecutableSystem;
+
+class Operator;
+
+
+class BaseHitProcessor
+{
+
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ AvmHitOrJumpProcessor & mHitOrJumpProcessor;
+
+ AvmCoverageStatistics & mCoverageStatistics;
+
+ EvaluationEnvironment & ENV;
+
+ SolverDef::SOLVER_KIND mSolverKind;
+
+ ExecutableForm mLocalExecutableForm;
+
+ TraceChecker mTraceChecker;
+
+ AvmCode mTraceObjective;
+ bool isPureStateTransitionNatureFlag;
+
+ // Computing Local Variables
+ avm_size_t traceOffset;
+
+ ListOfExecutionContext & mRelativeRootEC;
+
+ ListOfExecutionContext::iterator ecIt;
+ ListOfExecutionContext::iterator ecItEnd;
+
+ VectorOfExecutionContext & mRelativeLeafEC;
+
+ ListOfExecutionContext & mAbsoluteLeafEC;
+ ListOfExecutionContext & mBlackHoleEC;
+
+ ListOfExecutionContext & mBacktrackHitEC;
+ bool mBacktrackFlag;
+
+ avm_size_t mJumpHeight;
+
+ VectorOfExecutionContext mMaxHitEC;
+ avm_size_t hitOffset;
+ avm_size_t hitOffsetEnd;
+
+ avm_size_t mHitCount;
+
+ ExecutionContext::child_iterator ecChildIt;
+ ExecutionContext::child_iterator ecChildItEnd;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BaseHitProcessor(AvmHitOrJumpProcessor & hojProcessor,
+ EvaluationEnvironment & anENV, Operator * op);
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BaseHitProcessor()
+ {
+ //!! NOTHING
+ }
+
+
+ virtual std::string strKind() = 0;
+
+ /**
+ * GETTER
+ * mTraceObjective
+ */
+ bool isPureStateTransitionObjective() const;
+
+
+ /**
+ * Coverage Test
+ */
+ inline bool goalAchieved()
+ {
+ return( mCoverageStatistics.goalAchieved() );
+ }
+
+ inline bool hasUncovered()
+ {
+ return( mCoverageStatistics.hasUncovered() );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool configure(WObject * wfParameterObject);
+
+ virtual bool resetConfig();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // HIT FILTERING API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool goalWillNeverAchieved(ExecutionContext * anEC) = 0;
+
+ virtual bool hit(avm_size_t jumpHeight) = 0;
+
+ virtual void hitSelect(avm_size_t jumpOffset) = 0;
+
+
+ inline bool hit(ExecutionContext * anEC, const BF & arg)
+ {
+ return( mTraceChecker.isSat((* anEC), arg) );
+ }
+
+ // FILTERING TOOLS
+ bool isAbsoluteLeaf(ExecutionContext * anEC);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // WILL NEVER HIT FILTERING API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline bool willNeverHit(ExecutionContext * anEC, const BF & arg)
+ {
+ ++mCoverageStatistics.mNumberOfBlackHoleTest;
+
+ return( mTraceChecker.willNeverSat((* anEC), arg) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // REPORT API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline void reportMinimum(OutStream & os) const
+ {
+ if( mCoverageStatistics.hasUncovered() )
+ {
+ toStreamUncovered(os);
+ }
+ toStreamCovered(os);
+ }
+
+
+ inline void reportDefault(OutStream & os) const
+ {
+ if( mCoverageStatistics.hasUncovered() )
+ {
+ toStreamUncovered(os);
+ }
+
+ if( mCoverageStatistics.hasCovered() )
+ {
+ toStreamCovered(os);
+ }
+ }
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SERIALIZATION API
+ ////////////////////////////////////////////////////////////////////////////
+
+ void toStreamCovered(OutStream & os) const;
+
+ void toStreamUncovered(OutStream & os) const;
+
+ inline virtual void toStream(OutStream & os) const
+ {
+ toStreamUncovered(os);
+
+ toStreamCovered(os);
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* BASEHITPROCESSOR_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/hitorjump/HitOrderedProcessor.cpp b/org.eclipse.efm.symbex/src/fam/hitorjump/HitOrderedProcessor.cpp
new file mode 100644
index 0000000..04112d1
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/hitorjump/HitOrderedProcessor.cpp
@@ -0,0 +1,401 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 31 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "HitOrderedProcessor.h"
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/runtime/ExecutionContext.h>
+
+#include <fam/hitorjump/AvmHitOrJumpProcessor.h>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+HitOrderedProcessor::HitOrderedProcessor(
+ AvmHitOrJumpProcessor & hojProcessor, EvaluationEnvironment & anENV)
+: BaseHitProcessor(hojProcessor, anENV , OperatorManager::OPERATOR_SEQUENCE ),
+mLastObjective( )
+{
+ //!! NOTHING
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+
+bool HitOrderedProcessor::configure(WObject * wfParameterObject)
+{
+ bool mConfigFlag = BaseHitProcessor::configure(wfParameterObject);
+
+ if( isPureStateTransitionNatureFlag && mTraceObjective.nonempty() )
+ {
+ mLastObjective = mTraceObjective.last();
+ }
+
+ return( mConfigFlag );
+}
+
+
+bool HitOrderedProcessor::resetConfig()
+{
+ return( BaseHitProcessor::resetConfig() );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// HIT FILTERING API
+////////////////////////////////////////////////////////////////////////////////
+
+bool HitOrderedProcessor::goalWillNeverAchieved(ExecutionContext * anEC)
+{
+ if( mLastObjective.invalid() )
+ {
+ return( false );
+ }
+
+ else if( BaseHitProcessor::hit(anEC, mLastObjective) )
+ {
+ return( false );
+ }
+
+ else if( willNeverHit(anEC, mLastObjective) )
+ {
+ ++mCoverageStatistics.mNumberOfBlackHole;
+
+ mBlackHoleEC.append(anEC);
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< goalWillNeverAchieved< BLACK HOLE > >>>>>" << std::endl
+ << "EC:> " << anEC->str_min() << std::endl
+ << str_indent( mLastObjective ) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ return( true );
+ }
+
+ else
+ {
+ return( false );
+ }
+}
+
+
+
+bool HitOrderedProcessor::hit(avm_size_t jumpHeight)
+{
+ if( goalAchieved() )
+ {
+ return( true );
+ }
+
+ mJumpHeight = jumpHeight;
+
+
+ // ALGO for ORDERED
+ mHitCount = 0;
+ mMaxHitEC.clear();
+
+ ExecutionContext::child_iterator itChildEC;
+ ExecutionContext::child_iterator endChildEC;
+
+ ecIt = mRelativeRootEC.begin();
+ ecItEnd = mRelativeRootEC.end();
+ for( ; ecIt != ecItEnd ; ++ecIt )
+ {
+ itChildEC = (*ecIt)->begin();
+ endChildEC = (*ecIt)->end();
+ for( ; itChildEC != endChildEC ; ++itChildEC )
+ {
+ hit((*itChildEC), mCoverageStatistics.mNumberOfCovered, 0);
+ }
+ }
+
+ if( mHitCount > 0 )
+ {
+ traceOffset = mCoverageStatistics.mNumberOfCovered;
+ mCoverageStatistics.addCoveredElement( mHitCount );
+ // set the coverage bitset
+ for( ; traceOffset < mCoverageStatistics.mNumberOfCovered ; ++traceOffset )
+ {
+ mCoverageStatistics.mCoverageBitset.set(traceOffset, true);
+ }
+
+ mRelativeLeafEC.clear();
+
+ hitOffsetEnd = mMaxHitEC.size();
+ for( hitOffset = 0 ; hitOffset != hitOffsetEnd ; ++hitOffset )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< hit< candidate > >>>>> EC< id:"
+ << mMaxHitEC[ hitOffset ]->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ mMaxHitEC[ hitOffset ]->setWeight(0);
+
+ mRelativeLeafEC.append( mMaxHitEC[ hitOffset ] );
+ }
+
+ return( true );
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ return( false );
+}
+
+
+void HitOrderedProcessor::hit(ExecutionContext * anEC,
+ avm_size_t uncoveredOffset, avm_size_t hitCount)
+{
+ if( mBlackHoleEC.contains(anEC) )
+ {
+ return;
+ }
+
+ avm_size_t saveHitCount = hitCount;
+
+ for( ; uncoveredOffset != mCoverageStatistics.mNumberOfElements ;
+ ++uncoveredOffset )
+ {
+ if( BaseHitProcessor::hit(anEC, mTraceObjective[uncoveredOffset]) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< hit< 1 > >>>>> EC< id:"
+ << anEC->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ anEC->getwFlags().setCoverageElementTrace();
+
+ anEC->addInfo(mHitOrJumpProcessor, mTraceObjective[uncoveredOffset]);
+
+ ++hitCount;
+
+ if( not mHitOrJumpProcessor.mFoldingFlag )
+ {
+ break;
+ }
+ }
+
+ else
+ {
+ if( mHitOrJumpProcessor.mHitConsecutiveFlag &&
+ (saveHitCount == hitCount) && (uncoveredOffset > 0) )
+ {
+ // TODO
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< hit#consecutive< FAILED > >>>>> EC< id:"
+ << anEC->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ return;
+ }
+
+ if( willNeverReached(anEC, mTraceObjective[uncoveredOffset]) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< hit#never< 1 > >>>>> EC< id:"
+ << anEC->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ return;
+ }
+
+ break;
+ }
+ }
+
+
+ if( hitCount == mCoverageStatistics.getNumberOfUncovered() )
+ {
+ anEC->getwFlags().setObjectiveAchievedTrace();
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< hit< goal achieved > >>>>> EC< id:"
+ << anEC->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+
+ if( hitCount > mHitCount )
+ {
+ if( mBacktrackFlag )
+ {
+ hitOffsetEnd = mMaxHitEC.size();
+ for( hitOffset = 0 ; hitOffset != hitOffsetEnd ; ++hitOffset )
+ {
+ saveBacktrackable(mMaxHitEC[hitOffset], mHitCount);
+ }
+ }
+
+ mMaxHitEC.clear();
+
+ mHitCount = hitCount;
+ }
+
+ mMaxHitEC.push_back( anEC );
+ }
+
+ else if( anEC->hasNext() )
+ {
+ ExecutionContext::child_iterator itChildEC = anEC->begin();
+ ExecutionContext::child_iterator endChildEC = anEC->end();
+ for( ; itChildEC != endChildEC ; ++itChildEC )
+ {
+ hit((*itChildEC), uncoveredOffset, hitCount);
+ }
+ }
+
+ else if( isAbsoluteLeaf(anEC) )
+ {
+ //!! CONTINUE
+ }
+
+ else if( hitCount > mHitCount )
+ {
+ if( mBacktrackFlag )
+ {
+ hitOffsetEnd = mMaxHitEC.size();
+ for( hitOffset = 0 ; hitOffset != hitOffsetEnd ; ++hitOffset )
+ {
+ saveBacktrackable(mMaxHitEC[hitOffset], mHitCount);
+ }
+ }
+
+ mMaxHitEC.clear();
+
+ mHitCount = hitCount;
+
+ mMaxHitEC.push_back( anEC );
+ }
+
+ else if( (hitCount > 0) )
+ {
+ if( hitCount == mHitCount )
+ {
+ mMaxHitEC.push_back( anEC );
+ }
+ else
+ {
+ anEC->setWeightMax();
+
+ if( mBacktrackFlag )
+ {
+ saveBacktrackable(anEC, hitCount);
+ }
+ }
+ }
+
+ else if( hitCount == 0 )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< nop >>>>> EC< id:"
+ << anEC->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ anEC->setWeightMax();
+
+ if( mBacktrackFlag )
+ {
+ saveBacktrackable(anEC, hitCount);
+ }
+ }
+}
+
+
+void HitOrderedProcessor::hitSelect(avm_size_t jumpOffset)
+{
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< hit< 0 > >>>>> EC< id:"
+ << mMaxHitEC[ jumpOffset ]->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ mMaxHitEC[ jumpOffset ]->setWeight(0);
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// FILTERING TOOLS
+////////////////////////////////////////////////////////////////////////////////
+
+void HitOrderedProcessor::saveBacktrackable(
+ ExecutionContext * anEC, avm_size_t hitCount)
+{
+ if( anEC->hasNext() )
+ {
+ //!! NOTHING
+ }
+
+ else if( willNeverReached(anEC, mTraceObjective
+ [ mCoverageStatistics.getNumberOfCovered() + hitCount ]) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< hit#never< 1 > >>>>> EC< id:"
+ << anEC->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ }
+
+ else
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< hit< backtract > >>>>> EC< id:"
+ << anEC->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ anEC->getUniqInformation()->getUniqHitOrJumpObjectiveInfo()->
+ setCoverageStatistics( mCoverageStatistics , hitCount );
+
+ mBacktrackHitEC.append( anEC );
+ }
+}
+
+
+bool HitOrderedProcessor::willNeverReached(
+ ExecutionContext * anEC, const BF & arg)
+{
+ if( isAbsoluteLeaf(anEC) )
+ {
+ return( true );
+ }
+
+ else if( BaseHitProcessor::willNeverHit(anEC, arg) )
+ {
+ ++mCoverageStatistics.mNumberOfBlackHole;
+
+ mBlackHoleEC.append(anEC);
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< HoJ< BLACK HOLE > >>>>>" << std::endl
+ << "EC:> " << anEC->str_min() << std::endl
+ << str_indent( arg ) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ return( true );
+ }
+ else
+ {
+ return( false );
+ }
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/hitorjump/HitOrderedProcessor.h b/org.eclipse.efm.symbex/src/fam/hitorjump/HitOrderedProcessor.h
new file mode 100644
index 0000000..6e641c8
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/hitorjump/HitOrderedProcessor.h
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 31 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef HITORDEREDPROCESSOR_H_
+#define HITORDEREDPROCESSOR_H_
+
+#include "BaseHitProcessor.h"
+
+
+namespace sep
+{
+
+
+class AvmHitOrJumpProcessor;
+class ExecutionContext;
+class EvaluationEnvironment;
+
+
+class HitOrderedProcessor : public BaseHitProcessor
+{
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ BF mLastObjective;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ HitOrderedProcessor(AvmHitOrJumpProcessor & hojProcessor,
+ EvaluationEnvironment & anENV);
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~HitOrderedProcessor()
+ {
+ //!! NOTHING
+ }
+
+
+ inline std::string strKind()
+ {
+ return( "ordered" );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool configure(WObject * wfParameterObject);
+
+ virtual bool resetConfig();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // HIT FILTERING API
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool goalWillNeverAchieved(ExecutionContext * anEC);
+
+ bool hit(avm_size_t jumpHeight);
+
+ void hit(ExecutionContext * anEC,
+ avm_size_t uncoveredOffset, avm_size_t hitCount);
+
+ virtual void hitSelect(avm_size_t jumpOffset);
+
+
+ // FILTERING TOOLS
+ void saveBacktrackable(ExecutionContext * anEC, avm_size_t hitCount);
+
+ bool willNeverReached(ExecutionContext * anEC, const BF & arg);
+
+
+};
+
+
+} /* namespace sep */
+
+#endif /* HITORDEREDPROCESSOR_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/hitorjump/HitUnorderedProcessor.cpp b/org.eclipse.efm.symbex/src/fam/hitorjump/HitUnorderedProcessor.cpp
new file mode 100644
index 0000000..8698b1d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/hitorjump/HitUnorderedProcessor.cpp
@@ -0,0 +1,447 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 31 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "HitUnorderedProcessor.h"
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/runtime/ExecutionContext.h>
+
+#include <fam/hitorjump/AvmHitOrJumpProcessor.h>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+HitUnorderedProcessor::HitUnorderedProcessor(
+ AvmHitOrJumpProcessor & hojProcessor, EvaluationEnvironment & anENV)
+: BaseHitProcessor(hojProcessor, anENV,
+ OperatorManager::OPERATOR_INTERLEAVING),
+
+mHitCoverageBitset( ),
+mHitSelectedCoverageBitset( ),
+mHitSelectedEC( )
+{
+ //!! NOTHING
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+
+bool HitUnorderedProcessor::resetConfig()
+{
+ return( BaseHitProcessor::resetConfig() );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// HIT FILTERING API
+////////////////////////////////////////////////////////////////////////////////
+
+bool HitUnorderedProcessor::goalWillNeverAchieved(ExecutionContext * anEC)
+{
+ if( not isPureStateTransitionNatureFlag )
+ {
+ return( false );
+ }
+
+ else
+ {
+// traceOffset = 0;
+// for( ; traceOffset != mCoverageStatistics.mNumberOfElements ; ++traceOffset )
+// {
+// if( mCoverageStatistics.coverageBitset.test(traceOffset) )
+// {
+// //!! continue;
+// }
+// else if( BaseHitProcessor::willNeverHit(
+// anEC,mTraceObjective[traceOffset]) )
+// {
+// if( not BaseHitProcessor::hit(anEC,mTraceObjective[traceOffset]) )
+// {
+// ++mCoverageStatistics.mNumberOfBlackHole;
+//
+// mBlackHoleEC.append(anEC);
+//
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+// AVM_OS_TRACE << "<<<<< HoJ< BLACK HOLE > >>>>>" << std::endl
+// << "EC:> " << anEC->str_min() << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+//
+// return( true );
+// }
+// }
+// }
+
+ return( false );
+ }
+}
+
+
+bool HitUnorderedProcessor::hit(avm_size_t jumpHeight)
+{
+ if( goalAchieved() )
+ {
+ return( true );
+ }
+
+ mJumpHeight = jumpHeight;
+
+
+ // ALGO for UNORDERED
+ mHitCount = 0;
+ mMaxHitEC.clear();
+ mHitCoverageBitset.clear();
+
+ if( mRelativeRootEC.singleton() )
+ {
+ hit(mRelativeRootEC.front(), mCoverageStatistics.mCoverageBitset, 0);
+ }
+ else
+ {
+ ExecutionContext::child_iterator itChildEC;
+ ExecutionContext::child_iterator endChildEC;
+
+ ecItEnd = mRelativeRootEC.end();
+ for( ecIt = mRelativeRootEC.begin() ; ecIt != ecItEnd ; ++ecIt )
+ {
+ itChildEC = (*ecIt)->begin();
+ endChildEC = (*ecIt)->end();
+ for( ; itChildEC != endChildEC ; ++itChildEC )
+ {
+ hit((*itChildEC), hitCoverageBitset(*ecIt), 0);
+ }
+ }
+
+ mHitSelectedEC.clear();
+ mHitSelectedCoverageBitset.clear();
+ }
+
+
+ if( mHitCount > 0 )
+ {
+ mCoverageStatistics.addCoveredElement( mHitCount );
+
+ // based on mCoverageStatistics.mNumberOfCovered
+ if( mCoverageStatistics.goalAchieved() )
+ {
+ mCoverageStatistics.mCoverageBitset.set();
+ }
+
+ mRelativeLeafEC.clear();
+
+ hitOffsetEnd = mMaxHitEC.size();
+ for( hitOffset = 0 ; hitOffset != hitOffsetEnd ; ++hitOffset )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< hit< candidate > >>>>> EC< id:"
+ << mMaxHitEC[ hitOffset ]->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ mMaxHitEC[ hitOffset ]->setWeight(0);
+
+ mRelativeLeafEC.append( mMaxHitEC[ hitOffset ] );
+ }
+
+ return( true );
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ return( false );
+}
+
+
+void HitUnorderedProcessor::hit(ExecutionContext * anEC,
+ Bitset coverageBitset, avm_size_t hitCount)
+{
+ if( mBlackHoleEC.contains(anEC) )
+ {
+ return;
+ }
+
+ avm_size_t saveHitCount = hitCount;
+
+ traceOffset = 0;
+ for( ; traceOffset != mCoverageStatistics.mNumberOfElements ; ++traceOffset )
+ {
+ if( coverageBitset.test(traceOffset) )
+ {
+ //!! continue;
+ }
+ else if( BaseHitProcessor::hit(anEC, mTraceObjective[traceOffset]) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< hit< 1 > >>>>> EC< id:"
+ << anEC->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ anEC->getwFlags().setCoverageElementTrace();
+
+ anEC->addInfo(mHitOrJumpProcessor, mTraceObjective[traceOffset]);
+
+ coverageBitset.set(traceOffset, true),
+
+ ++hitCount;
+
+ if( not mHitOrJumpProcessor.mFoldingFlag )
+ {
+ break;
+ }
+ }
+ }
+
+
+ if( (saveHitCount == hitCount) )
+ {
+ if( mHitOrJumpProcessor.mHitConsecutiveFlag && coverageBitset.any() )
+ {
+ // TODO
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< hit#consecutive< FAILED > >>>>> EC< id:"
+ << anEC->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ return;
+ }
+ else if( willNeverHit(anEC, coverageBitset) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< hit#never< 1 > >>>>> EC< id:"
+ << anEC->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ return;
+ }
+ }
+
+
+ if( hitCount == mCoverageStatistics.getNumberOfUncovered() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ anEC->getwFlags().setObjectiveAchievedTrace();
+
+ AVM_OS_TRACE << "<<<<< hit< goal achieved > >>>>> EC< id:"
+ << anEC->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ if( hitCount > mHitCount )
+ {
+ if( mBacktrackFlag )
+ {
+ hitOffsetEnd = mMaxHitEC.size();
+ for( hitOffset = 0 ; hitOffset != hitOffsetEnd ; ++hitOffset )
+ {
+ saveBacktrackable(mMaxHitEC[hitOffset],
+ mHitCoverageBitset[hitOffset], mHitCount);
+ }
+ }
+
+ mMaxHitEC.clear();
+ mHitCoverageBitset.clear();
+
+ mHitCount = hitCount;
+ }
+
+ mMaxHitEC.push_back( anEC );
+ mHitCoverageBitset.push_back(coverageBitset);
+ }
+
+ else if( anEC->hasNext() )
+ {
+ ExecutionContext::child_iterator itChildEC = anEC->begin();
+ ExecutionContext::child_iterator endChildEC = anEC->end();
+ for( ; itChildEC != endChildEC ; ++itChildEC )
+ {
+ hit((*itChildEC), coverageBitset, hitCount);
+ }
+ }
+
+ else if( isAbsoluteLeaf(anEC) )
+ {
+ //!! CONTINUE
+ }
+
+ else if( hitCount > mHitCount )
+ {
+ if( mBacktrackFlag )
+ {
+ hitOffsetEnd = mMaxHitEC.size();
+ for( hitOffset = 0 ; hitOffset != hitOffsetEnd ; ++hitOffset )
+ {
+ saveBacktrackable(mMaxHitEC[hitOffset],
+ mHitCoverageBitset[hitOffset], mHitCount);
+ }
+ }
+
+ mMaxHitEC.clear();
+ mHitCoverageBitset.clear();
+
+ mHitCount = hitCount;
+
+ mMaxHitEC.push_back( anEC );
+ mHitCoverageBitset.push_back(coverageBitset);
+ }
+
+ else if( hitCount > 0 )
+ {
+ if( hitCount == mHitCount )
+ {
+ mMaxHitEC.push_back( anEC );
+ mHitCoverageBitset.push_back(coverageBitset);
+ }
+ else
+ {
+ anEC->setWeightMax();
+
+ if( mBacktrackFlag )
+ {
+ saveBacktrackable(anEC, coverageBitset, hitCount);
+ }
+ }
+ }
+
+ else if( hitCount == 0 )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< nop >>>>> EC< id:"
+ << anEC->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ anEC->setWeightMax();
+
+ if( mBacktrackFlag )
+ {
+ saveBacktrackable(anEC, coverageBitset, hitCount);
+ }
+ }
+}
+
+
+void HitUnorderedProcessor::hitSelect(avm_size_t jumpOffset)
+{
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< hit< 0 > >>>>> EC< id:"
+ << mMaxHitEC[ jumpOffset ]->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ mMaxHitEC[ jumpOffset ]->setWeight(0);
+
+ mCoverageStatistics.mCoverageBitset = mHitCoverageBitset[ jumpOffset ];
+
+ mHitSelectedEC.append( mMaxHitEC[ jumpOffset ] );
+ mHitSelectedCoverageBitset.append( mHitCoverageBitset[ jumpOffset ] );
+}
+
+
+Bitset & HitUnorderedProcessor::hitCoverageBitset(ExecutionContext * anEC)
+{
+ hitOffsetEnd = mHitSelectedEC.size();
+ for( hitOffset = 0 ; hitOffset != hitOffsetEnd ; ++hitOffset )
+ {
+ if( mHitSelectedEC[hitOffset] == anEC )
+ {
+ return( mHitSelectedCoverageBitset[hitOffset] );
+ }
+ }
+
+ return( mCoverageStatistics.mCoverageBitset );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// FILTERING TOOLS
+////////////////////////////////////////////////////////////////////////////////
+
+void HitUnorderedProcessor::saveBacktrackable(ExecutionContext * anEC,
+ Bitset & coverageBitset, avm_size_t hitCount)
+{
+ if( anEC->hasNext() )
+ {
+ //!! NOTHING
+ }
+
+ else if( willNeverHit(anEC, coverageBitset) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< hit#never< 1 > >>>>> EC< id:"
+ << anEC->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ }
+
+ else
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< hit< backtract > >>>>> EC< id:"
+ << anEC->getIdNumber() << " >" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ anEC->getUniqInformation()->getUniqHitOrJumpObjectiveInfo()->
+ setCoverageStatistics( mCoverageStatistics, coverageBitset );
+
+ mBacktrackHitEC.append( anEC );
+ }
+}
+
+
+bool HitUnorderedProcessor::willNeverHit(
+ ExecutionContext * anEC, Bitset & coverageBitset)
+{
+ if( isAbsoluteLeaf(anEC) )
+ {
+ return( true );
+ }
+ else if( not isPureStateTransitionNatureFlag )
+ {
+ return( false );
+ }
+
+ traceOffset = 0;
+ for( ; traceOffset != mCoverageStatistics.mNumberOfElements ; ++traceOffset )
+ {
+ if( coverageBitset.test(traceOffset) )
+ {
+ //!! continue;
+ }
+ else if( BaseHitProcessor::willNeverHit(
+ anEC,mTraceObjective[traceOffset]) )
+ {
+ ++mCoverageStatistics.mNumberOfBlackHole;
+
+ mBlackHoleEC.append(anEC);
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_TRACE << "<<<<< HoJ< BLACK HOLE > >>>>>" << std::endl
+ << "EC:> " << anEC->str_min() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/hitorjump/HitUnorderedProcessor.h b/org.eclipse.efm.symbex/src/fam/hitorjump/HitUnorderedProcessor.h
new file mode 100644
index 0000000..6f4a4d0
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/hitorjump/HitUnorderedProcessor.h
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 31 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef HITUNORDEREDPROCESSOR_H_
+#define HITUNORDEREDPROCESSOR_H_
+
+#include "BaseHitProcessor.h"
+
+#include <collection/Bitset.h>
+
+
+namespace sep
+{
+
+
+class AvmHitOrJumpProcessor;
+class ExecutionContext;
+class EvaluationEnvironment;
+
+
+class HitUnorderedProcessor : public BaseHitProcessor
+{
+
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ VectorOfBitset mHitCoverageBitset;
+
+ VectorOfBitset mHitSelectedCoverageBitset;
+
+ VectorOfExecutionContext mHitSelectedEC;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ HitUnorderedProcessor(AvmHitOrJumpProcessor & hojProcessor,
+ EvaluationEnvironment & anENV);
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~HitUnorderedProcessor()
+ {
+ //!! NOTHING
+ }
+
+
+ inline std::string strKind()
+ {
+ return( "unordered" );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool resetConfig();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // HIT FILTERING API
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool goalWillNeverAchieved(ExecutionContext * anEC);
+
+ bool hit(avm_size_t jumpHeight);
+
+ void hit(ExecutionContext * anEC,
+ Bitset coverageBitset, avm_size_t hitCount);
+
+
+ virtual void hitSelect(avm_size_t jumpOffset);
+
+ Bitset & hitCoverageBitset(ExecutionContext * anEC);
+
+
+ // FILTERING TOOLS
+ void saveBacktrackable(ExecutionContext * anEC,
+ Bitset & coverageBitset, avm_size_t hitCount);
+
+ bool willNeverHit(ExecutionContext * anEC, Bitset & coverageBitset);
+
+};
+
+
+} /* namespace sep */
+
+#endif /* HITUNORDEREDPROCESSOR_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/queue/ExecutionQueue.cpp b/org.eclipse.efm.symbex/src/fam/queue/ExecutionQueue.cpp
new file mode 100644
index 0000000..813bf4f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/queue/ExecutionQueue.cpp
@@ -0,0 +1,998 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "ExecutionQueue.h"
+
+#include "WaitingBasicStrategy.h"
+#include "WaitingStrategyBLOCK.h"
+#include "WaitingStrategyWEIGHT.h"
+
+#include <fam/api/MainProcessorUnit.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <sew/SymbexDispatcher.h>
+#include <sew/Workflow.h>
+
+namespace sep
+{
+
+
+/**
+ * DESTRUCTOR
+ */
+ExecutionQueue::~ExecutionQueue()
+{
+ // Unregistration
+ getSymbexDispatcher().getSymbexEventManager().
+ unregisterHandlerEventDestroyCtx(this);
+}
+
+
+
+/**
+ *******************************************************************************
+prototype execution_queue as avm::core.EXECUTION_QUEUE is
+ section PROPERTY
+ // 'ALL'
+
+ // 'BEST' | 'BEST_FIRST_SEARCH'
+ // 'BFS' | 'BREADTH_FIRST_SEARCH'
+ // 'DFS' | 'DEPTH_FIRST_SEARCH'
+ // 'RFS' | 'RANDOM_FIRST_SEARCH'
+ // 'XFS' | 'RANDOM_FIRST_SEARCH'
+
+ // 'FIRST' | 'LAST'
+
+ // 'BLOCK_{ ALL | BEST | BFS | DFS | RFS | XFS }'
+
+ // 'WEIGHT_{ ALL | BEST | BFS | DFS | RFS | XFS }'
+
+ // 'TARGET_FORMULA_{ ALL | BEST | BFS | DFS | RFS | XFS }'
+
+ @strategy = 'BFS';
+
+ // for WEIGHT_{ ALL | BEST | BFS | DFS | RFS | XFS } strategy
+ @weight = 8;
+
+ // for 'BLOCK_{ ALL | BEST | BFS | DFS | RFS | XFS }'
+ // local block height and width size
+ @block_height = 20;
+ @block_width = 30;
+
+ // next height and width limit ==> pour éviter toute explosion localisée
+ @height = 50;
+ @width = 30;
+ endsection PROPERTY
+endprototype
+ *******************************************************************************
+ */
+
+/*
+ * NEW CONSISE SYNTAX
+supervisor {
+ limit 'of graph exploration' [
+ eval = 10
+ ...
+ ]
+ queue 'for graph exploration' [
+ strategy = 'BFS'
+ ...
+ ]
+ // shortcut alternative
+ queue = 'BFS'
+
+ console [
+ format = "\nstep:%1% , context:%2% , height:%3% , width:%4%"
+ ...
+ ]
+}
+*/
+
+/**
+ * CONFIGURE
+ */
+bool ExecutionQueue::configureImpl()
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mParameterWObject )
+ << "ExecutionQueue WObject !!!"
+ << SEND_EXIT;
+
+ // INITIALIZATION
+ configureDebug();
+
+ // See ProcessorUnitFactory.cpp --> // QUEUE PROCESSOR CONFIGURE
+ mConfigFlag = true;
+
+ bool isnotDefinedWTypedObjectParameters = false;
+
+ WObject * wfQueue = mParameterWObject;
+
+ if( MainProcessorUnit::AUTO_REGISTER_TOOL.isTypeID( *mParameterWObject ) )
+ {
+ wfQueue = Query::getRegexWObjectByNameID(mParameterWObject,
+ PREFIX_WID("symbex", OR_WID2("queue" , "QUEUE")),
+ WObject::_NULL_);
+
+ if( wfQueue == WObject::_NULL_ )
+ {
+ return( mConfigFlag );
+ }
+ else if( wfQueue->isWTypedOrReference() )
+ {
+ if( wfQueue->isWPropertyWReference() )
+ {
+ wfQueue = wfQueue->getWReferenceValue();
+ }
+
+ if( ExecutionQueue::AUTO_REGISTER_TOOL.isTypeID( *wfQueue ) )
+ {
+ mParameterWObject = wfQueue;
+ }
+ else
+ {
+ AVM_OS_WARN << "ExecutionQueue::configure:> "
+ "Unexpected the WObject< "
+ << wfQueue->getFullyQualifiedNameID()
+ << " > as queue parameters defined in supervisor <"
+ << mParameterWObject->getFullyQualifiedNameID()
+ << " >! " << std::endl;
+
+ return( mConfigFlag = false );
+ }
+ }
+ else if( wfQueue->isWSequence() )
+ {
+ // case supervisor sequence parameters
+
+ isnotDefinedWTypedObjectParameters = true;
+ }
+ else if( wfQueue->isWPropertyString() )
+ {
+ // case supervisor single shortcut property parameter
+
+ isnotDefinedWTypedObjectParameters = true;
+ }
+ else
+ {
+ AVM_OS_WARN << "ExecutionQueue::configure:> "
+ "Unexpected the WObject< " << wfQueue->strHeader()
+ << " > as redundancy parameters defined in supervisor <"
+ << mParameterWObject->getFullyQualifiedNameID()
+ << " >! " << std::endl;
+
+ return( mConfigFlag = false );
+ }
+ }
+
+ WObject * theQUEUE = ( isnotDefinedWTypedObjectParameters ) ? wfQueue
+ : Query::getRegexWSequence(wfQueue, OR_WID4("property",
+ "PROPERTY", "queue", "QUEUE"), wfQueue);
+
+ if( theQUEUE != WObject::_NULL_ )
+ {
+ // case of standard sequence parameters or single property parameter
+ std::string strStrategy = ( theQUEUE->isWSequence() )
+ ? Query::getWPropertyStringOrElse(
+ theQUEUE, "strategy", "queue", "BFS")
+ : theQUEUE->strValue();
+
+ mStrategy = STRATEGY_UNDEFINED;
+
+ // popTo ALL STRATEGY
+ if( strStrategy.find("ALL") != std::string::npos )
+ {
+ mStrategy |= STRATEGY_ALL;
+ }
+
+ // BASIC STRATEGY
+ if( (strStrategy.find("BFS") != std::string::npos) ||
+ REGEX_FIND(strStrategy, CONS_WID3("BREADTH", "FIRST", "SEARCH")) )
+ {
+ mStrategy |= STRATEGY_BFS;
+ }
+ else if( (strStrategy.find("DFS") != std::string::npos) ||
+ REGEX_FIND(strStrategy, CONS_WID3("DEPTH", "FIRST", "SEARCH")) )
+ {
+ mStrategy |= STRATEGY_DFS;
+ }
+ else if( (strStrategy.find("RFS") != std::string::npos) ||
+ REGEX_FIND(strStrategy, CONS_WID3("RAMDOM", "FIRST", "SEARCH")) )
+ {
+ mStrategy |= STRATEGY_RFS;
+ }
+ else if( strStrategy.find("XFS") != std::string::npos )
+ {
+ mStrategy |= STRATEGY_XFS;
+ }
+
+ else if( (strStrategy.find("BEST") != std::string::npos) ||
+ REGEX_FIND(strStrategy, CONS_WID3("BEST", "FIRST", "SEARCH")) )
+ {
+ mStrategy |= STRATEGY_BFS;
+ }
+
+ else if( strStrategy.find("FIRST") != std::string::npos )
+ {
+ mStrategy |= STRATEGY_FIRST;
+ }
+ else if( strStrategy.find("LAST") != std::string::npos )
+ {
+ mStrategy |= STRATEGY_LAST;
+ }
+
+ // ORDER STRATEGY
+ else if( strStrategy.find("ORDER") != std::string::npos )
+ {
+ mStrategy |= STRATEGY_ORDER;
+ }
+
+ // Only basic configuration in the supervisor WObject
+ // Case in new concise syntax !
+ if( isnotDefinedWTypedObjectParameters )
+ {
+ //!! NOTHING ELSE ???
+ }
+
+ // BLOCK STRATEGY
+ if( strStrategy.find("BLOCK") != std::string::npos )
+ {
+ mStrategy |= STRATEGY_BLOCK;
+
+ avm_size_t aBlockHeightPeriod;
+ avm_size_t aBlockWidthPeriod;
+ avm_size_t aBlockHeight;
+ avm_size_t aBlockWidth;
+
+ avm_size_t aHeightLimit;
+ avm_size_t aWidthLimit;
+
+ // Block height limit
+ aHeightLimit = Query::getWPropertySizeT(theQUEUE, "height",
+ AVM_NUMERIC_MAX_SIZE_T, AVM_NUMERIC_MAX_SIZE_T);
+
+ // Block height period
+ aBlockHeightPeriod = aBlockHeight = Query::getRegexWPropertySizeT(
+ theQUEUE, CONS_WID2("block", "height"),
+ AVM_NUMERIC_MAX_SIZE_T, AVM_NUMERIC_MAX_SIZE_T);
+
+
+ // Block width limit
+ aWidthLimit = Query::getWPropertySizeT(theQUEUE, "width",
+ AVM_NUMERIC_MAX_SIZE_T, AVM_NUMERIC_MAX_SIZE_T);
+
+ // Block width period
+ aBlockWidthPeriod = aBlockWidth = Query::getRegexWPropertySizeT(
+ theQUEUE, CONS_WID2("block", "width"),
+ AVM_NUMERIC_MAX_SIZE_T, AVM_NUMERIC_MAX_SIZE_T);
+
+ configureWaitingBlockStrategy(aBlockHeightPeriod, aBlockWidthPeriod,
+ aBlockHeight, aBlockWidth, aHeightLimit, aWidthLimit);
+ }
+
+ // WEIGHT STRATEGY
+ else if( strStrategy.find("WEIGHT") != std::string::npos )
+ {
+ mStrategy |= STRATEGY_WEIGHT;
+
+ int anInteger = Query::getWPropertyInt(
+ theQUEUE, "weight", DEFAULT_QUEUE_COUNT);
+ if( (anInteger < 0) || (anInteger > (AVM_NUMERIC_MAX_INT8 - 1)) )
+ {
+ anInteger = (AVM_NUMERIC_MAX_INT8 - 1);
+
+AVM_IF_DEBUG_FLAG( CONFIGURING )
+ AVM_OS_LOG << "ExecutionQueue::configure:> Invalid weight value in [1,"
+ << (AVM_NUMERIC_MAX_INT8 - 1) << ">] ! => replace by < "
+ << anInteger << " >" << std::endl;
+AVM_ENDIF_DEBUG_FLAG( CONFIGURING )
+ }
+
+ if( mStrategy & STRATEGY_ALL )
+ {
+ configureWaitingWeightStrategyAll((avm_uint8_t) anInteger);
+ }
+ else
+ {
+ configureWaitingWeightStrategy((avm_uint8_t) anInteger);
+ }
+ }
+
+ if( mStrategy == STRATEGY_UNDEFINED )
+ {
+ AVM_OS_ERROR_ALERT << "ExecutionQueue::configure:> "
+ "Invalid strategy ATTRIBUTE !!!"
+ << SEND_ALERT;
+
+ mStrategy = STRATEGY_DFS;
+ }
+
+ if( mWaitingStrategy == NULL )
+ {
+ if( mStrategy & STRATEGY_ALL )
+ {
+ configureWaitingBasicStrategyAll();
+ }
+ else
+ {
+ configureWaitingBasicStrategy();
+ }
+
+ if( mWaitingStrategy == NULL )
+ {
+ AVM_OS_WARN << "ExecutionQueue::configure:> "
+ "Failed to configure waiting strategy !";
+
+ return( mConfigFlag = false );
+ }
+ }
+ }
+ else
+ {
+ AVM_OS_ERROR_ALERT << "ExecutionQueue::configure:> "
+ "Expected a <queue> or PROPERTY section !!!"
+ << SEND_ALERT;
+
+ return( mConfigFlag = false );
+ }
+
+ // Registration to handler DestroyCtx event
+ getSymbexEventManager().registerHandlerEventDestroyCtx(this);
+
+ return( mConfigFlag = true );
+}
+
+
+void ExecutionQueue::configureWaitingBasicStrategy()
+{
+ switch( mStrategy & STRATEGY_FAMILY_BASIC )
+ {
+ case STRATEGY_BFS:
+ {
+ mWaitingStrategy = new WaitingBasicStrategyBFS(1);
+ break;
+ }
+ case STRATEGY_DFS:
+ {
+ mWaitingStrategy = new WaitingBasicStrategyDFS(1);
+ break;
+ }
+ case STRATEGY_RFS:
+ case STRATEGY_XFS:
+ {
+ mWaitingStrategy = new WaitingBasicStrategyRFS(1);
+ break;
+ }
+
+ case STRATEGY_BEST:
+ {
+ mWaitingStrategy = new WaitingBasicStrategyBFS(1);
+ break;
+ }
+
+ case STRATEGY_FIRST:
+ {
+ mWaitingStrategy = new WaitingBasicStrategyFIRST(1);
+ break;
+ }
+ case STRATEGY_LAST:
+ {
+ mWaitingStrategy = new WaitingBasicStrategyLAST(1);
+ break;
+ }
+
+ case STRATEGY_ORDER:
+ {
+ mWaitingStrategy = new WaitingBasicStrategyORDER(1);
+ break;
+ }
+
+ default:
+ {
+ mWaitingStrategy = new WaitingBasicStrategyBFS(1);
+ break;
+ }
+ }
+}
+
+
+void ExecutionQueue::configureWaitingBasicStrategyAll()
+{
+ switch( mStrategy & STRATEGY_FAMILY_BASIC_ALL )
+ {
+ case STRATEGY_BFS:
+ {
+ mWaitingStrategy = new WaitingBasicStrategyALL<
+ WaitingBasicStrategyBFS >(1);
+ break;
+ }
+ case STRATEGY_DFS:
+ {
+ mWaitingStrategy = new WaitingBasicStrategyALL<
+ WaitingBasicStrategyDFS >(1);
+ break;
+ }
+ case STRATEGY_RFS:
+ case STRATEGY_XFS:
+ {
+ mWaitingStrategy = new WaitingBasicStrategyALL<
+ WaitingBasicStrategyRFS >(1);
+ break;
+ }
+
+ case STRATEGY_BEST:
+ {
+ mWaitingStrategy = new WaitingBasicStrategyALL<
+ WaitingBasicStrategyBFS >(1);
+ break;
+ }
+
+ case STRATEGY_FIRST:
+ {
+ mWaitingStrategy = new WaitingBasicStrategyALL<
+ WaitingBasicStrategyFIRST >(1);
+ break;
+ }
+ case STRATEGY_LAST:
+ {
+ mWaitingStrategy = new WaitingBasicStrategyALL<
+ WaitingBasicStrategyLAST >(1);
+ break;
+ }
+
+ case STRATEGY_ORDER:
+ {
+ mWaitingStrategy = new WaitingBasicStrategyALL<
+ WaitingBasicStrategyORDER >(1);
+ break;
+ }
+
+ case STRATEGY_ALL:
+ default:
+ {
+ mWaitingStrategy = new WaitingBasicStrategyALL<
+ WaitingBasicStrategyBFS >(1);
+ break;
+ }
+ }
+}
+
+
+
+void ExecutionQueue::configureWaitingBlockStrategy(
+ avm_size_t aBlockHeightPeriod, avm_size_t aBlockWidthPeriod,
+ avm_size_t aBlockHeight, avm_size_t aBlockWidth,
+ avm_size_t aHeightLimit, avm_size_t aWidthLimit)
+{
+ switch( mStrategy & STRATEGY_FAMILY_BASIC_ALL )
+ {
+ case STRATEGY_BFS:
+ {
+ mWaitingStrategy = new WaitingStrategyBLOCK_BFS(
+ getConfiguration(), 1, aBlockHeightPeriod,
+ aBlockWidthPeriod, aBlockHeight,
+ aBlockWidth, aHeightLimit, aWidthLimit);
+ break;
+ }
+ case STRATEGY_DFS:
+ {
+ mWaitingStrategy = new WaitingStrategyBLOCK_DFS(
+ getConfiguration(), 1, aBlockHeightPeriod,
+ aBlockWidthPeriod, aBlockHeight,
+ aBlockWidth, aHeightLimit, aWidthLimit);
+ break;
+ }
+ case STRATEGY_RFS:
+ case STRATEGY_XFS:
+ {
+ mWaitingStrategy = new WaitingStrategyBLOCK_RFS(
+ getConfiguration(), 1, aBlockHeightPeriod,
+ aBlockWidthPeriod, aBlockHeight,
+ aBlockWidth, aHeightLimit, aWidthLimit);
+ break;
+ }
+
+ case STRATEGY_BEST:
+ {
+ mWaitingStrategy = new WaitingStrategyBLOCK_BFS(
+ getConfiguration(), 1, aBlockHeightPeriod,
+ aBlockWidthPeriod, aBlockHeight,
+ aBlockWidth, aHeightLimit, aWidthLimit);
+ break;
+ }
+
+// case STRATEGY_FIRST:
+// case STRATEGY_LAST:
+//
+// case STRATEGY_ORDER:
+
+ case STRATEGY_ALL:
+ {
+ mWaitingStrategy = new WaitingStrategyBLOCK_ALL<
+ WaitingBasicStrategyALL< WaitingBasicStrategyBFS > >(
+ getConfiguration(), 1, aBlockHeightPeriod,
+ aBlockWidthPeriod, aBlockHeight,
+ aBlockWidth, aHeightLimit, aWidthLimit);
+ break;
+ }
+ default:
+ {
+ mWaitingStrategy = new WaitingStrategyBLOCK_BFS(
+ getConfiguration(), 1, aBlockHeightPeriod,
+ aBlockWidthPeriod, aBlockHeight,
+ aBlockWidth, aHeightLimit, aWidthLimit);
+ break;
+ }
+ }
+}
+
+
+void ExecutionQueue::configureWaitingWeightStrategy(avm_uint8_t maxWeight)
+{
+ switch( mStrategy & STRATEGY_FAMILY_BASIC )
+ {
+ case STRATEGY_BFS:
+ {
+ mWaitingStrategy = new WaitingStrategyWEIGHT<
+ WaitingBasicStrategyBFS >(maxWeight);
+ break;
+ }
+ case STRATEGY_DFS:
+ {
+ mWaitingStrategy = new WaitingStrategyWEIGHT<
+ WaitingBasicStrategyDFS >(maxWeight);
+ break;
+ }
+ case STRATEGY_RFS:
+ case STRATEGY_XFS:
+ {
+ mWaitingStrategy = new WaitingStrategyWEIGHT<
+ WaitingBasicStrategyRFS >(maxWeight);
+ break;
+ }
+
+ case STRATEGY_BEST:
+ {
+ mWaitingStrategy = new WaitingStrategyWEIGHT<
+ WaitingBasicStrategyBFS >(maxWeight);
+ break;
+ }
+
+ case STRATEGY_FIRST:
+ {
+ mWaitingStrategy = new WaitingStrategyWEIGHT<
+ WaitingBasicStrategyFIRST >(maxWeight);
+ break;
+ }
+ case STRATEGY_LAST:
+ {
+ mWaitingStrategy = new WaitingStrategyWEIGHT<
+ WaitingBasicStrategyLAST >(maxWeight);
+ break;
+ }
+
+// case STRATEGY_ORDER:
+
+ default:
+ {
+ mWaitingStrategy = new WaitingStrategyWEIGHT<
+ WaitingBasicStrategyBFS >(maxWeight);
+ break;
+ }
+ }
+}
+
+
+void ExecutionQueue::configureWaitingWeightStrategyAll(avm_uint8_t maxWeight)
+{
+ switch( mStrategy & STRATEGY_FAMILY_BASIC_ALL )
+ {
+ case STRATEGY_BFS:
+ {
+ mWaitingStrategy = new WaitingStrategyWEIGHT<
+ WaitingBasicStrategyALL<
+ WaitingBasicStrategyBFS > >(maxWeight);
+ break;
+ }
+ case STRATEGY_DFS:
+ {
+ mWaitingStrategy = new WaitingStrategyWEIGHT<
+ WaitingBasicStrategyALL<
+ WaitingBasicStrategyDFS > >(maxWeight);
+ break;
+ }
+ case STRATEGY_RFS:
+ case STRATEGY_XFS:
+ {
+ mWaitingStrategy = new WaitingStrategyWEIGHT<
+ WaitingBasicStrategyALL<
+ WaitingBasicStrategyRFS > >(maxWeight);
+ break;
+ }
+
+ case STRATEGY_BEST:
+ {
+ mWaitingStrategy = new WaitingStrategyWEIGHT<
+ WaitingBasicStrategyALL<
+ WaitingBasicStrategyBFS > >(maxWeight);
+ break;
+ }
+
+ case STRATEGY_FIRST:
+ {
+ mWaitingStrategy = new WaitingStrategyWEIGHT<
+ WaitingBasicStrategyALL<
+ WaitingBasicStrategyFIRST > >(maxWeight);
+ break;
+ }
+ case STRATEGY_LAST:
+ {
+ mWaitingStrategy = new WaitingStrategyWEIGHT<
+ WaitingBasicStrategyALL<
+ WaitingBasicStrategyLAST > >(maxWeight);
+ break;
+ }
+
+// case STRATEGY_ORDER:
+
+ case STRATEGY_ALL:
+ default:
+ {
+ mWaitingStrategy = new WaitingStrategyWEIGHT<
+ WaitingBasicStrategyALL<
+ WaitingBasicStrategyBFS > >(maxWeight);
+ break;
+ }
+ }
+}
+
+
+/**
+ * RECONFIGURATION
+ */
+bool ExecutionQueue::reconfigure(
+ ENUM_STRATEGY_T newStrategy, avm_uint8_t queueCount)
+{
+ if( (mStrategy == newStrategy) && (mWaitingStrategy != NULL) )
+ {
+ return( true );
+ }
+
+ if( newStrategy == STRATEGY_UNDEFINED)
+ {
+ return( false );
+ }
+ // Unsupported BLOCK strategy, see reconfigureBlock(...)
+ else if( (newStrategy & STRATEGY_BLOCK) != 0 )
+ {
+ return( false );
+ }
+
+ // destroy current waiting strategy
+ if( mWaitingStrategy != NULL )
+ {
+ delete mWaitingStrategy;
+
+ mWaitingStrategy = NULL;
+ }
+ mStrategy = newStrategy;
+
+ /**
+ * Reconfigure supported strategy
+ */
+ // WEIGHT strategy
+ if( (mStrategy & STRATEGY_WEIGHT) != 0 )
+ {
+ if( mStrategy & STRATEGY_ALL )
+ {
+ configureWaitingWeightStrategyAll(queueCount);
+ }
+ else
+ {
+ configureWaitingWeightStrategy(queueCount);
+ }
+ }
+
+ // ALL family strategy
+ else if( (mStrategy & STRATEGY_ALL) != 0 )
+ {
+ configureWaitingBasicStrategyAll();
+ }
+ // basic strategy
+ else
+ {
+ configureWaitingBasicStrategy();
+ }
+
+
+ if( mWaitingStrategy == NULL )
+ {
+ AVM_OS_WARN << "ExecutionQueue::reconfigure:> "
+ "Failed to reconfigure waiting strategy !";
+
+ return( false );
+ }
+
+ return( mWaitingStrategy != NULL );
+}
+
+
+bool ExecutionQueue::reconfigureBlock(ENUM_STRATEGY_T newStrategy,
+ avm_size_t aBlockHeightPeriod, avm_size_t aBlockWidthPeriod,
+ avm_size_t aBlockHeight, avm_size_t aBlockWidth,
+ avm_size_t aHeightLimit, avm_size_t aWidthLimit)
+{
+ if( (mStrategy == newStrategy) && (mWaitingStrategy != NULL) )
+ {
+ return( true );
+ }
+ else if( (newStrategy & STRATEGY_BLOCK) == 0 )
+ {
+ AVM_OS_WARN << "ExecutionQueue::reconfigureBlock:> "
+ "Unexpected a non-block as waiting strategy !";
+
+ return( false );
+ }
+
+ // destroy current waiting strategy
+ if( mWaitingStrategy != NULL )
+ {
+ delete mWaitingStrategy;
+
+ mWaitingStrategy = NULL;
+ }
+ mStrategy = newStrategy;
+
+ /**
+ * Reconfigure block strategy
+ */
+ configureWaitingBlockStrategy(aBlockHeightPeriod, aBlockWidthPeriod,
+ aBlockHeight, aBlockWidth, aHeightLimit, aWidthLimit);
+
+ if( mWaitingStrategy == NULL )
+ {
+ AVM_OS_WARN << "ExecutionQueue::reconfigureBlock:> "
+ "Failed to reconfigureBlock waiting strategy !";
+
+ return( false );
+ }
+
+ return( mWaitingStrategy != NULL );
+}
+
+
+/**
+ * GETTER - SETTER
+ * mWaitingStrategyStack
+ * mWaitingStrategy
+ */
+bool ExecutionQueue::pushWaitingStrategy(
+ WaitingStrategy * aWaitingStrategy, bool spliceContainedFlag)
+{
+ if( aWaitingStrategy == NULL )
+ {
+ return( false );
+ }
+
+ if( spliceContainedFlag )
+ {
+ aWaitingStrategy->splice( *mWaitingStrategy );
+ }
+
+ mWaitingStrategyStack.push( mWaitingStrategy );
+
+ mWaitingStrategy = aWaitingStrategy;
+
+ return( true );
+}
+
+bool ExecutionQueue::popWaitingStrategy(
+ bool spliceContainedFlag, bool destroyCurrentFlag)
+{
+ if( mWaitingStrategyStack.empty() )
+ {
+ return( false );
+ }
+
+ if( mWaitingStrategy != NULL )
+ {
+ if( spliceContainedFlag )
+ {
+ mWaitingStrategyStack.top()->splice( *mWaitingStrategy );
+ }
+ if( destroyCurrentFlag )
+ {
+ delete mWaitingStrategy;
+ }
+ }
+
+ mWaitingStrategy = mWaitingStrategyStack.top();
+
+ mWaitingStrategyStack.pop();
+
+ return( true );
+}
+
+
+/**
+ * REPORT TRACE
+ */
+void ExecutionQueue::reportDefault(OutStream & os) const
+{
+//AVM_IF_DEBUG_FLAG( PROCESSOR )
+ os << TAB << "EXECUTION QUEUE" << std::endl;
+
+ os << TAB2 << "strategy : " << strStrategy() << EOL_FLUSH;
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , REPORTING , COMPUTING )
+
+ os << incr_stream( *this );
+
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , REPORTING , COMPUTING )
+//AVM_ENDIF_DEBUG_FLAG( PROCESSOR )
+}
+
+
+/**
+ * TRACE Queue
+ */
+void ExecutionQueue::traceQueue(OutStream & os,
+ ListOfExecutionContext & aQueue, const std::string & aMessage)
+{
+ os << TAB << aMessage << " << size : " << aQueue.size() << " >> "
+ << EOL_INCR_INDENT;
+
+ ListOfExecutionContext::iterator it = aQueue.begin();
+ ListOfExecutionContext::iterator itEnd = aQueue.end();
+ for( ; it != itEnd ; ++it )
+ {
+ (*it)->traceDefault(os);
+ }
+ os << DECR_INDENT;
+}
+
+
+/**
+ * Serialization
+ */
+std::string ExecutionQueue::strStrategy() const
+{
+ if( mStrategy == STRATEGY_UNDEFINED )
+ {
+ return( "UNDEFINED" );
+ }
+ else
+ {
+ std::ostringstream oss;
+
+ if( (mStrategy & STRATEGY_BLOCK) != 0 )
+ {
+ oss << "#BLOCK";
+ }
+ if( (mStrategy & STRATEGY_WEIGHT) != 0 )
+ {
+ oss << "#WEIGHT";
+ }
+
+ if( (mStrategy & STRATEGY_ALL) != 0 )
+ {
+ oss << "#ALL";
+ }
+
+ if( (mStrategy & STRATEGY_DFS) != 0 )
+ {
+ oss << "#DFS";
+ }
+ if( (mStrategy & STRATEGY_BFS) != 0 )
+ {
+ oss << "#BFS";
+ }
+ if( (mStrategy & STRATEGY_RFS) != 0 )
+ {
+ oss << "#RFS";
+ }
+ if( (mStrategy & STRATEGY_XFS) != 0 )
+ {
+ oss << "#XFS";
+ }
+
+ if( (mStrategy & STRATEGY_BEST) != 0 )
+ {
+ oss << "#BEST";
+ }
+
+ if( (mStrategy & STRATEGY_FIRST) != 0 )
+ {
+ oss << "#FIRST";
+ }
+ if( (mStrategy & STRATEGY_LAST) != 0 )
+ {
+ oss << "#LAST";
+ }
+
+ if( (mStrategy & STRATEGY_ORDER) != 0 )
+ {
+ oss << "#ORDER";
+ }
+
+ return( oss.str() );
+ }
+}
+
+
+void ExecutionQueue::toStream(OutStream & os) const
+{
+ os << TAB << "queue " << strUniqId() << " {" << EOL;
+
+ if( mInitQueue.nonempty() )
+ {
+ os << TAB << "init< size: " << mInitQueue.size() << " >:"
+ << EOL_INCR_INDENT;
+
+ toStream(mInitQueue, os);
+ os << DECR_INDENT;
+ }
+
+ if( hasWaiting() )
+ {
+ mWaitingStrategy->toStream(os);
+ }
+
+ if( mFailedQueue.nonempty() )
+ {
+ os << TAB << "failed< size: " << mFailedQueue.size() << " >:"
+ << EOL_INCR_INDENT;
+
+ toStream(mFailedQueue, os);
+ os << DECR_INDENT;
+ }
+
+ if( mReadyQueue.nonempty() )
+ {
+ os << TAB << "ready< size: " << mReadyQueue.size() << " >:"
+ << EOL_INCR_INDENT;
+
+ toStream(mReadyQueue, os);
+ os << DECR_INDENT;
+ }
+
+ if( mResultQueue.nonempty() )
+ {
+ os << TAB << "result< size: " << mResultQueue.size() << " >:"
+ << EOL_INCR_INDENT;
+
+ toStream(mResultQueue, os);
+ os << DECR_INDENT;
+ }
+
+ os << TAB << "}" << EOL;
+}
+
+void ExecutionQueue::toStream(
+ const ListOfExecutionContext & aQueue, OutStream & os) const
+{
+ ListOfExecutionContext::const_iterator itEC = aQueue.begin();
+ ListOfExecutionContext::const_iterator itEnd = aQueue.end();
+ for( ; itEC != itEnd ; ++itEC )
+ {
+ if( ((*itEC) != NULL) && (*itEC)->isAlive() )
+ {
+ (*itEC)->traceDefault(os);
+ }
+
+ }
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fam/queue/ExecutionQueue.h b/org.eclipse.efm.symbex/src/fam/queue/ExecutionQueue.h
new file mode 100644
index 0000000..3b3ff8f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/queue/ExecutionQueue.h
@@ -0,0 +1,723 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef EXECUTIONQUEUE_H_
+#define EXECUTIONQUEUE_H_
+
+#include <fam/api/AbstractProcessorUnit.h>
+#include <sew/SymbexEventManager.h>
+
+#include "WaitingStrategy.h"
+
+#include <collection/Typedef.h>
+
+#include <fml/runtime/ExecutionContext.h>
+
+#include <stack>
+
+
+namespace sep
+{
+
+class AbstractProcessorUnit;
+class ExecutionContext;
+class SymbexControllerUnitManager;
+
+
+class ExecutionQueue :
+ public AutoRegisteredProcessorUnit< ExecutionQueue >,
+ public IHandlerEventDestroyCtx
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( ExecutionQueue )
+
+ /**
+ * MAIN PROCESSOR FACTORY
+ * for automatic registration in the processor repository
+ * the [ [ FULLY ] QUALIFIED ] NAME ID
+ */
+ AVM_INJECT_AUTO_REGISTER_QUALIFIED_ID_KEY_3(
+ "symbex.queue",
+ "avm::processor.EXECUTION_QUEUE",
+ "avm::core.EXECUTION_QUEUE" )
+ // end registration
+
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef avm_uint16_t ENUM_STRATEGY_T;
+
+ enum
+ {
+ STRATEGY_UNDEFINED = 0x0000,
+
+ // Basic Strategy Family
+ STRATEGY_BFS = 0x0001,
+
+ STRATEGY_DFS = 0x0002,
+
+ STRATEGY_RFS = 0x0004,
+ STRATEGY_XFS = 0x0008,
+
+ STRATEGY_BEST = 0x0010,
+ STRATEGY_FIRST = 0x0020,
+ STRATEGY_LAST = 0x0040,
+
+ STRATEGY_ORDER = 0x0080,
+
+ STRATEGY_FAMILY_BASIC = STRATEGY_BFS | STRATEGY_DFS
+ | STRATEGY_RFS | STRATEGY_XFS
+ | STRATEGY_BEST | STRATEGY_ORDER
+ | STRATEGY_FIRST | STRATEGY_LAST,
+
+ // for popTo ReadyQueue
+ STRATEGY_ALL = 0x0100,
+
+ STRATEGY_FAMILY_BASIC_ALL = STRATEGY_FAMILY_BASIC
+ | STRATEGY_ALL,
+
+
+ // Block Strategy
+ STRATEGY_BLOCK = 0x0200,
+
+ // Weight Strategy
+ STRATEGY_WEIGHT = 0x0400,
+
+ };
+
+ /**
+ * DEFAULT QUEUE COUNT
+ */
+ static const avm_uint8_t DEFAULT_QUEUE_COUNT = 8;
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ // les contextes qui attendent sagement qu'on les initialise afin
+ // qu'ils puissent étre mis dans la waiting!!!!
+ // Il n'y a pas de raison qu'on en traite qu'un seul à la fois!!!!!
+ ListOfExecutionContext mInitQueue;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // the waiting queue strategy & behavour
+ ////////////////////////////////////////////////////////////////////////////
+ // les contextes qui attendent sagement qu'on s'intéresse à eux pour passer
+ // l'audition conduisant à l'exécution !!!
+ WaitingStrategy * mWaitingStrategy;
+ std::stack< WaitingStrategy * > mWaitingStrategyStack;
+
+ // les contextes pres pour l'exécution: ils ont réussi l'audition des filtres...
+ // Il n'y a pas de raison qu'on en traite qu'un seul à la fois!!!
+ ListOfExecutionContext mReadyQueue;
+
+ // les contextes mis en réserve volontairement par un processeur,
+ // et pourraient faire l'objet d'une récupération futur....
+ ListOfExecutionContext mReserveQueue;
+
+ // les contextes ayant échoué à l'épreuve des filtres,
+ // et pourraient faire l'objet d'une épreuve de récupération futur...
+ ListOfExecutionContext mFailedQueue;
+
+ // les contextes venant d'etre exécutés
+ // Il n'y a pas de raison qu'on en traite qu'un seul à la fois!!!
+ ListOfExecutionContext mResultQueue;
+
+
+ /**
+ * Strategy
+ * DFS | BFS | RFS
+ * BLOCK_??? | WEIGHT_??? | TARGET_FORMULA_???
+ * STRATEGY_ORDER
+ */
+ ENUM_STRATEGY_T mStrategy;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ExecutionQueue(SymbexControllerUnitManager & aControllerUnitManager,
+ WObject * wfParameterObject = NULL)
+ : AutoRegisteredProcessorUnit( aControllerUnitManager ,
+ wfParameterObject , PRECEDENCE_OF_MAIN_PROCESSOR),
+ mInitQueue(),
+
+ mWaitingStrategy( NULL ),
+ mWaitingStrategyStack( ),
+
+ mReadyQueue(),
+
+ mReserveQueue(),
+ mFailedQueue(),
+
+ mResultQueue(),
+
+ mStrategy( STRATEGY_DFS )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ExecutionQueue();
+
+
+ /**
+ * CONFIGURE
+ */
+ virtual bool configureImpl();
+
+ void configureWaitingBasicStrategy();
+
+ void configureWaitingBasicStrategyAll();
+
+ void configureWaitingBlockStrategy(
+ avm_size_t aBlockHeightPeriod, avm_size_t aBlockWidthPeriod,
+ avm_size_t aBlockHeight, avm_size_t aBlockWidth,
+ avm_size_t aHeightLimit, avm_size_t aWidthLimit);
+
+ void configureWaitingWeightStrategy(avm_uint8_t maxWeight);
+ void configureWaitingWeightStrategyAll(avm_uint8_t maxWeight);
+
+
+ /**
+ * RECONFIGURATION
+ */
+ bool reconfigure(ENUM_STRATEGY_T newStrategy,
+ avm_uint8_t queueCount = DEFAULT_QUEUE_COUNT);
+
+ bool reconfigureBlock(ENUM_STRATEGY_T newStrategy,
+ avm_size_t aBlockHeightPeriod, avm_size_t aBlockWidthPeriod,
+ avm_size_t aBlockHeight, avm_size_t aBlockWidth,
+ avm_size_t aHeightLimit, avm_size_t aWidthLimit);
+
+
+ /**
+ * REPORT TRACE
+ */
+
+ inline virtual void reportSilent(OutStream & os) const
+ {
+ // SILENT => NOTHING
+ }
+
+ inline virtual void reportMinimum(OutStream & os) const
+ {
+ //!! NOTHING
+ }
+
+ virtual void reportDefault(OutStream & os) const;
+
+
+ /**
+ * GETTER - SETTER
+ * mInitQueue
+ */
+ inline void appendInit(ExecutionContext * anEC)
+ {
+ mInitQueue.append(anEC);
+ }
+
+ inline void appendInit(const ListOfExecutionContext & listOfEC)
+ {
+ mInitQueue.append(listOfEC);
+ }
+
+ inline ListOfExecutionContext & getInitQueue()
+ {
+ return( mInitQueue );
+ }
+
+ inline bool hasInit() const
+ {
+ return( mInitQueue.nonempty() );
+ }
+
+ inline void traceInit(OutStream & os)
+ {
+ traceQueue(os, mInitQueue, "EXECUTION INIT QUEUE");
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mWaitingStrategy
+ */
+ inline WaitingStrategy * getWaitingStrategy()
+ {
+ return( mWaitingStrategy );
+ }
+
+ inline WaitingStrategy & refWaitingStrategy()
+ {
+ return( *mWaitingStrategy );
+ }
+
+ inline bool hasWaitingStrategy() const
+ {
+ return( mWaitingStrategy != NULL );
+ }
+
+ inline void setWaitingStrategy(WaitingStrategy * aWaitingStrategy)
+ {
+ mWaitingStrategy = aWaitingStrategy;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mWaitingStrategy
+ * mWaitingStrategyStack
+ */
+ bool pushWaitingStrategy(WaitingStrategy * aWaitingStrategy,
+ bool spliceContainedFlag = true);
+
+ bool popWaitingStrategy(bool spliceContainedFlag = true,
+ bool destroyCurrentFlag = false);
+
+
+ /**
+ * hasWork()
+ */
+ inline bool hasWork() const
+ {
+ return( hasWaiting() || hasReady() );
+ }
+
+ /**
+ * GETTER - SETTER
+ * mWaitingQueue
+ */
+
+ inline void clearWaiting()
+ {
+ mWaitingStrategy->clearQueueTable();
+ }
+
+ inline void getWaiting(ListOfExecutionContext & alisOfEC)
+ {
+ mWaitingStrategy->getQueueTable( alisOfEC );
+ }
+
+ inline ListOfExecutionContext & getWaitingQueue()
+ {
+ return( mWaitingStrategy->getQueue() );
+ }
+
+ inline ListOfExecutionContext & getWaitingQueueCache()
+ {
+ return( mWaitingStrategy->getCache() );
+ }
+
+
+ inline bool hasWaiting() const
+ {
+ return( mWaitingStrategy->hasWaiting() );
+ }
+
+ inline bool hasWaitingCache() const
+ {
+ return( mWaitingStrategy->getCache().nonempty() );
+ }
+
+
+
+ inline ExecutionContext * topWaiting()
+ {
+ return( mWaitingStrategy->top() );
+ }
+
+ inline ExecutionContext * popWaiting()
+ {
+ return( mWaitingStrategy->pop() );
+ }
+
+ inline void popWaiting2Ready()
+ {
+ mWaitingStrategy->popTo( mReadyQueue );
+ }
+
+ inline void pushWaitingCache(ExecutionContext * anEC)
+ {
+ mWaitingStrategy->pushCache( anEC );
+ }
+
+ inline void spliceWaitingCache(ListOfExecutionContext & listOfEC)
+ {
+ while( listOfEC.nonempty() )
+ {
+ mWaitingStrategy->pushCache( listOfEC.pop_first() );
+ }
+ }
+
+ inline void pushWaiting(ExecutionContext * anEC)
+ {
+ mWaitingStrategy->push( anEC );
+ }
+
+ inline void pushWaiting(const ListOfExecutionContext & listOfEC)
+ {
+ mWaitingStrategy->push( listOfEC );
+ }
+
+ inline void pushInit2Waiting()
+ {
+ while( mInitQueue.nonempty() )
+ {
+ mWaitingStrategy->push( mInitQueue.pop_first() );
+ }
+ }
+
+
+ inline void pushWaitingChild(const ListOfExecutionContext & childEC)
+ {
+ mWaitingStrategy->pushChild( childEC );
+ }
+
+
+ inline avm_size_t sizeWaiting()
+ {
+ return( mWaitingStrategy->sizeWaiting() );
+ }
+
+
+ inline void traceWaiting(OutStream & os)
+ {
+ mWaitingStrategy->trace(os, "EXECUTION WAITING QUEUE");
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mReadyQueue
+ */
+ inline void appendReady(ExecutionContext * anEC)
+ {
+ mReadyQueue.append(anEC);
+ }
+
+ inline void appendReady(ListOfExecutionContext & listOfEC)
+ {
+ mReadyQueue.append(listOfEC);
+ }
+
+ inline void spliceReady(ListOfExecutionContext & listOfEC)
+ {
+ mReadyQueue.splice(listOfEC);
+ }
+
+ inline void clearReady()
+ {
+ mReadyQueue.clear();
+ }
+
+ inline ListOfExecutionContext & getReadyQueue()
+ {
+ return( mReadyQueue );
+ }
+
+ inline bool hasReady() const
+ {
+ return( mReadyQueue.nonempty() );
+ }
+
+ inline bool hasReadyWork() const
+ {
+ return( mReadyQueue.nonempty() );
+ }
+
+
+ inline void traceReady(OutStream & os)
+ {
+ traceQueue(os, mReadyQueue, "EXECUTION READY QUEUE");
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mReserveQueue
+ */
+ inline void appendReserve(ExecutionContext * anEC)
+ {
+ mReserveQueue.append(anEC);
+ }
+
+ inline void appendReserve(ListOfExecutionContext & listOfEC)
+ {
+ mReserveQueue.append(listOfEC);
+ }
+
+ inline void spliceReserve(ListOfExecutionContext & listOfEC)
+ {
+ mReserveQueue.splice(listOfEC);
+ }
+
+ inline ListOfExecutionContext & getReserveQueue()
+ {
+ return( mReserveQueue );
+ }
+
+ inline bool hasReserve() const
+ {
+ return( mReserveQueue.nonempty() );
+ }
+
+
+ inline void traceReserve(OutStream & os)
+ {
+ traceQueue(os, mReserveQueue, "EXECUTION LAST CHANCE QUEUE");
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mFailedQueue
+ */
+ inline void appendFailed(ExecutionContext * anEC)
+ {
+ mFailedQueue.append(anEC);
+ }
+
+ inline void appendFailed(ListOfExecutionContext & listOfEC)
+ {
+ mFailedQueue.append(listOfEC);
+ }
+
+ inline void spliceFailed(ListOfExecutionContext & listOfEC)
+ {
+ mFailedQueue.splice(listOfEC);
+ }
+
+ inline ListOfExecutionContext & getFailedQueue()
+ {
+ return( mFailedQueue );
+ }
+
+ inline bool hasFailed() const
+ {
+ return( mFailedQueue.nonempty() );
+ }
+
+
+ inline void traceFailed(OutStream & os)
+ {
+ traceQueue(os, mFailedQueue, "EXECUTION FAILED QUEUE");
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mResultQueue
+ */
+ inline void appendResult(ExecutionContext * anEC)
+ {
+ mResultQueue.append(anEC);
+ }
+
+ inline void appendResult(ListOfExecutionContext & listOfEC)
+ {
+ mResultQueue.append(listOfEC);
+ }
+
+ inline void spliceResult(ListOfExecutionContext & listOfEC)
+ {
+ mResultQueue.splice(listOfEC);
+ }
+
+ inline ListOfExecutionContext & getResultQueue()
+ {
+ return( mResultQueue );
+ }
+
+ inline bool hasResult() const
+ {
+ return( mResultQueue.nonempty() );
+ }
+
+
+ inline void traceResult(OutStream & os)
+ {
+ traceQueue(os, mResultQueue, "EXECUTION RESULT QUEUE");
+ }
+
+
+
+ /**
+ * TRACE Queue
+ */
+ static void traceQueue(OutStream & os, ListOfExecutionContext & aQueue,
+ const std::string & aMessage);
+
+
+ /**
+ * IHandlerEventDestroyCtx API
+ * Destroy Execution Context
+ */
+ inline virtual void handleEventDestroyCtx(ExecutionContext * anEC)
+ {
+ removeFailed(anEC);
+ removeInit(anEC);
+ removeWaiting(anEC);
+ removeReady(anEC);
+ removeReserve(anEC);
+ removeResult(anEC);
+ }
+
+ inline void removeFailed(ExecutionContext * anEC)
+ {
+ getFailedQueue().remove(anEC);
+ }
+
+ inline void removeInit(ExecutionContext * anEC)
+ {
+ getInitQueue().remove(anEC);
+ }
+
+ inline void removeWaiting(ExecutionContext * anEC)
+ {
+ mWaitingStrategy->remove(anEC);
+ }
+
+ inline void removeReady(ExecutionContext * anEC)
+ {
+ getReadyQueue().remove(anEC);
+ }
+
+ inline void removeReserve(ExecutionContext * anEC)
+ {
+ getReserveQueue().remove(anEC);
+ }
+
+ inline void removeResult(ExecutionContext * anEC)
+ {
+ getResultQueue().remove(anEC);
+ }
+
+
+
+
+ /**
+ * HEURISTIC
+ * BLOCK_DFS strategy
+ */
+ ExecutionContext * pop_BLOCK_DFS();
+ void push_BLOCK_DFS(ExecutionContext * anEC);
+ bool resetWaiting_BLOCK();
+
+
+ /**
+ * HEURISTIC
+ * BLOCK_BFS strategy
+ */
+ ExecutionContext * pop_BLOCK_BFS();
+ void push_BLOCK_BFS(ExecutionContext * anEC);
+
+
+ /**
+ * HEURISTIC
+ * BLOCK_BFS strategy
+ */
+ ExecutionContext * pop_BLOCK_XFS();
+ void push_BLOCK_XFS(ExecutionContext * anEC);
+
+
+ /**
+ * HEURISTIC
+ * ORDER strategy
+ */
+ ExecutionContext * pop_ORDER();
+ void push_ORDER(ExecutionContext * anEC);
+
+
+ /**
+ * HEURISTIC
+ * TARGET_FORMULA strategy
+ */
+ ExecutionContext * pop_TARGET_FORMULA();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PROCESSOR REQUEST API
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * STOP | RELEASE
+ * RESET | RESTART | CONTINUE
+ * REQUEUE_WAITING | REQUEUE_RESERVE
+ * HEURISTIC | GOAL_ACHIEVED
+ */
+ inline void handleRequestStop()
+ {
+ clearReady();
+
+ clearWaiting();
+ }
+
+ inline void handleRequestRelease()
+ {
+ //!! NOTHING
+ }
+
+
+ inline void handleRequestReset()
+ {
+ //!! NOTHING
+ }
+
+ inline void handleRequestRestart()
+ {
+ //!! NOTHING
+ }
+
+ inline void handleRequestContinue()
+ {
+ //!! NOTHING
+ }
+
+
+ inline void handleRequestRequeueWaiting(AbstractProcessorUnit * aRequestor)
+ {
+ mWaitingStrategy->handleRequestRequeueWaiting(aRequestor);
+ }
+
+ inline void handleRequestRequeueReserve(AbstractProcessorUnit * aRequestor)
+ {
+ mWaitingStrategy->handleRequestRequeueReserve(aRequestor, getReserveQueue());
+ }
+
+
+ /**
+ * Serialization
+ */
+ std::string strStrategy() const;
+
+ inline void toStreamWaiting(OutStream & os) const
+ {
+ mWaitingStrategy->toStream(os);
+ }
+
+ virtual void toStream(OutStream & os) const;
+
+ virtual void toStream(const ListOfExecutionContext & aQueue, OutStream & os) const;
+
+};
+
+
+}
+
+#endif /*EXECUTIONQUEUE_H_*/
diff --git a/org.eclipse.efm.symbex/src/fam/queue/WaitingBasicStrategy.h b/org.eclipse.efm.symbex/src/fam/queue/WaitingBasicStrategy.h
new file mode 100644
index 0000000..f187e35
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/queue/WaitingBasicStrategy.h
@@ -0,0 +1,271 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 18 févr. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef WAITINGBASICSTRATEGY_H_
+#define WAITINGBASICSTRATEGY_H_
+
+#include "WaitingStrategy.h"
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// ALL WAITING STRATEGY
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+template< class BasicStrategy >
+class WaitingBasicStrategyALL : public BasicStrategy
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ WaitingBasicStrategyALL(avm_uint8_t queueCount = 1)
+ : BasicStrategy( queueCount )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~WaitingBasicStrategyALL()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // POP WAITING BEHAVIOR API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline virtual void popTo(ListOfExecutionContext & aReadyQueue)
+ {
+ aReadyQueue.splice(BasicStrategy::mQueueCache.nonempty() ?
+ BasicStrategy::mQueueCache : BasicStrategy::mQueue);
+ }
+
+
+ inline virtual void popTo(avm_uint8_t aQueueTableOffset,
+ ListOfExecutionContext & aReadyQueue)
+ {
+ aReadyQueue.splice( BasicStrategy::mQueueTable
+ [ (aQueueTableOffset < BasicStrategy::mQueueCount) ?
+ aQueueTableOffset : BasicStrategy::mQueueCount ] );
+ }
+
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// BFS < BREADTH_FIRST_SEARCH > WAITING STRATEGY
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class WaitingBasicStrategyBFS :
+ public WaitingStrategyImpl<
+ StrategyPushBack , ChildIteratorFIFO , StrategyPopFront >
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ WaitingBasicStrategyBFS(avm_uint8_t queueCount = 1)
+ : WaitingStrategyImpl( queueCount )
+ {
+ //!! NOTHING
+ }
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// DFS < DEPTH_FIRST_SEARCH > WAITING STRATEGY
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class WaitingBasicStrategyDFS :
+ public WaitingStrategyImpl<
+ StrategyPushBack , ChildIteratorLIFO , StrategyPopBack >
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ WaitingBasicStrategyDFS(avm_uint8_t queueCount = 1)
+ : WaitingStrategyImpl( queueCount )
+ {
+ //!! NOTHING
+ }
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// RFS < RANDOM_FIRST_SEARCH > WAITING STRATEGY
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class WaitingBasicStrategyRFS :
+ public WaitingStrategyImpl<
+ StrategyPushBack , ChildIteratorFIFO , StrategyPopRandom >
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ WaitingBasicStrategyRFS(avm_uint8_t queueCount = 1)
+ : WaitingStrategyImpl( queueCount )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~WaitingBasicStrategyRFS()
+ {
+ //!! NOTHING
+ }
+
+
+ // UNDEF TOP FOR RANDOM ACCESS
+ inline virtual ExecutionContext * top()
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Illegal invocation of "
+ "<< WaitingBasicStrategyALL::top() >> !!!"
+ << SEND_EXIT;
+
+ return( NULL );
+ }
+
+ inline virtual ExecutionContext * top(avm_uint8_t aQueueTableOffset)
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Illegal invocation of "
+ "<< WaitingBasicStrategyRFS::top(queueOffset) >> !!!"
+ << SEND_EXIT;
+
+ return( NULL );
+ }
+
+ inline virtual ExecutionContext * topFrom(ListOfExecutionContext & aQueue)
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Illegal invocation of "
+ "<< WaitingBasicStrategyRFS::topFrom(queue) >> !!!"
+ << SEND_EXIT;
+
+ return( NULL );
+ }
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// FIRST WAITING STRATEGY
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class WaitingBasicStrategyFIRST :
+ public WaitingStrategyImpl<
+ StrategyPushFront , ChildIteratorLIFO , StrategyPopFront >
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ WaitingBasicStrategyFIRST(avm_uint8_t queueCount = 1)
+ : WaitingStrategyImpl( queueCount )
+ {
+ //!! NOTHING
+ }
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// LAST WAITING STRATEGY
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class WaitingBasicStrategyLAST :
+ public WaitingStrategyImpl<
+ StrategyPushBack , ChildIteratorLIFO , StrategyPopBack >
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ WaitingBasicStrategyLAST(avm_uint8_t queueCount = 1)
+ : WaitingStrategyImpl( queueCount )
+ {
+ //!! NOTHING
+ }
+};
+
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// ORDER WAITING STRATEGY
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class WaitingBasicStrategyORDER :
+ public WaitingStrategyImpl<
+ StrategyPushOrder , ChildIteratorFIFO , StrategyPopFront >
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ WaitingBasicStrategyORDER(avm_uint8_t queueCount = 1)
+ : WaitingStrategyImpl( queueCount )
+ {
+ //!! NOTHING
+ }
+};
+
+
+
+
+} /* namespace sep */
+#endif /* WAITINGBASICSTRATEGY_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/queue/WaitingStrategy.h b/org.eclipse.efm.symbex/src/fam/queue/WaitingStrategy.h
new file mode 100644
index 0000000..eb3dc8f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/queue/WaitingStrategy.h
@@ -0,0 +1,761 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 févr. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef FAM_QUEUE_WAITINGSTRATEGY_H_
+#define FAM_QUEUE_WAITINGSTRATEGY_H_
+
+
+#include <collection/Typedef.h>
+
+#include <fml/runtime/ExecutionContext.h>
+
+#include <fam/api/AbstractProcessorUnit.h>
+
+
+namespace sep
+{
+
+
+class AbstractProcessorUnit;
+
+class ExecutionContext;
+
+class TargetFilter;
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// ABSTRACT WAITING STRATEGY
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class WaitingStrategy
+{
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ // les contextes qui attendent sagement qu'on s'intéresse à eux pour passer
+ // l'audition conduisant à l'exécution !!!!!
+ avm_uint8_t mQueueCount;
+ ListOfExecutionContext * mQueueTable;
+ avm_uint8_t tOffset;
+
+ static const avm_uint8_t QUEUE_CACHE = 0;
+ static const avm_uint8_t QUEUE_OTHER = 1;
+
+ ListOfExecutionContext & mQueueCache;
+ ListOfExecutionContext & mQueue;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ WaitingStrategy(avm_uint8_t queueCount = 1)
+ : //mWaitingBasicStrategy( NULL ),
+ mQueueCount( queueCount ),
+ mQueueTable( new ListOfExecutionContext[mQueueCount + 1] ),
+ tOffset( 0 ),
+
+ mQueueCache( mQueueTable[QUEUE_CACHE] ),
+ mQueue( mQueueTable[QUEUE_OTHER] )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~WaitingStrategy()
+ {
+ delete( mQueueTable );
+ }
+
+ /**
+ * GETTER - SETTER
+ * Target Filter
+ */
+ inline virtual TargetFilter * getTargetFilter()
+ {
+ return( NULL );
+ }
+
+ inline virtual bool hasTargetFilter() const
+ {
+ return( false );
+ }
+
+ inline virtual void setTargetFilter(TargetFilter * aTargetFilter)
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mQueueTable
+ */
+ inline void clearQueueTable()
+ {
+ for( tOffset = 0 ; tOffset <= mQueueCount ; ++tOffset )
+ {
+ if( mQueueTable[ tOffset ].nonempty() )
+ {
+ mQueueTable[ tOffset ].clear();
+ }
+ }
+ }
+
+
+ inline ListOfExecutionContext * getQueueTable()
+ {
+ return( mQueueTable );
+ }
+
+ inline void getQueueTable(ListOfExecutionContext & listOfEC)
+ {
+ for( tOffset = 0 ; tOffset <= mQueueCount ; ++tOffset )
+ {
+ if( mQueueTable[ tOffset ].nonempty() )
+ {
+ listOfEC.append( mQueueTable[ tOffset ] );
+ }
+ }
+ }
+
+
+ inline void spliceQueueTable(ListOfExecutionContext & listOfEC)
+ {
+ for( tOffset = 0 ; tOffset <= mQueueCount ; ++tOffset )
+ {
+ if( mQueueTable[ tOffset ].nonempty() )
+ {
+ listOfEC.splice( mQueueTable[ tOffset ] );
+ }
+ }
+ }
+
+ inline void spliceQueueTable(
+ ListOfExecutionContext & listOfEC, avm_uint8_t tOffsetMax)
+ {
+ if( tOffsetMax > mQueueCount )
+ {
+ tOffsetMax = mQueueCount;
+ }
+ for( tOffset = 0 ; tOffset <= tOffsetMax ; ++tOffset )
+ {
+ if( mQueueTable[ tOffset ].nonempty() )
+ {
+ listOfEC.splice( mQueueTable[ tOffset ] );
+ }
+ }
+ }
+
+
+ inline avm_uint8_t splicePriorQueueTable(ListOfExecutionContext & listOfEC)
+ {
+ for( tOffset = 0 ; tOffset <= mQueueCount ; ++tOffset )
+ {
+ if( mQueueTable[ tOffset ].nonempty() )
+ {
+ listOfEC.splice( mQueueTable[ tOffset ] );
+ break;
+ }
+ }
+
+ return( tOffset );
+ }
+
+ inline avm_uint8_t splicePriorQueueTable(ListOfExecutionContext & listOfEC,
+ avm_uint8_t anOffsetMin, avm_uint8_t tOffsetMax)
+ {
+ for( tOffset = anOffsetMin ; tOffset <= tOffsetMax ; ++tOffset )
+ {
+
+ if( mQueueTable[ tOffset ].nonempty() )
+ {
+ listOfEC.splice( mQueueTable[ tOffset ] );
+ break;
+ }
+ }
+
+ return( tOffset );
+ }
+
+
+ inline void clearQueue()
+ {
+ mQueue.clear();
+ }
+
+ inline ListOfExecutionContext & getQueue()
+ {
+ return( mQueue );
+ }
+
+
+ inline void clearCache()
+ {
+ mQueueCache.clear();
+ }
+
+ inline ListOfExecutionContext & getCache()
+ {
+ return( mQueueCache );
+ }
+
+
+ inline bool hasWaiting()
+ {
+ for( tOffset = 0 ; tOffset <= mQueueCount ; ++tOffset )
+ {
+ if( mQueueTable[ tOffset ].nonempty() )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+ }
+
+ inline bool hasWaiting(avm_uint8_t tOffsetMax)
+ {
+ for( tOffset = 0 ; tOffset <= tOffsetMax ; ++tOffset )
+ {
+ if( mQueueTable[ tOffset ].nonempty() )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+ }
+
+
+ inline avm_size_t sizeWaiting() const
+ {
+ avm_size_t wsize = 0;
+ for( avm_size_t tOffset = 0 ; tOffset <= mQueueCount ; ++tOffset )
+ {
+ if( mQueueTable[ tOffset ].nonempty() )
+ {
+ wsize += mQueueTable[ tOffset ].size();
+ }
+ }
+
+ return( wsize );
+ }
+
+ inline void remove(ExecutionContext * anEC)
+ {
+ for( tOffset = 0 ; tOffset <= mQueueCount ; ++tOffset )
+ {
+ if( mQueueTable[ tOffset ].nonempty() )
+ {
+ mQueueTable[ tOffset ].remove(anEC);
+ }
+ }
+ }
+
+
+ inline void traceQueue(const ListOfExecutionContext & aQueue,
+ OutStream & os, const std::string & aMessage)
+ {
+ os << TAB << aMessage << " << size : " << aQueue.size() << " >> "
+ << EOL_INCR_INDENT;
+
+ ListOfExecutionContext::const_iterator it = aQueue.begin();
+ ListOfExecutionContext::const_iterator itEnd = aQueue.end();
+ for( ; it != itEnd ; ++it )
+ {
+ (*it)->traceDefault(os);
+ }
+ os << DECR_INDENT;
+ }
+
+ inline void trace(OutStream & os, const std::string & aMessage)
+ {
+ for( avm_size_t tOffset = 0 ; tOffset <= mQueueCount ; ++tOffset )
+ {
+ if( mQueueTable[ tOffset ].nonempty() )
+ {
+ traceQueue(mQueueTable[ tOffset ], os,
+ OSS() << aMessage << '[' << tOffset << ']');
+ }
+ }
+ }
+
+ inline void toStream(OutStream & os) const
+ {
+ os << TAB << "waiting< size: " << sizeWaiting() << " >:"
+ << EOL_INCR_INDENT;
+
+ for( avm_size_t tOffset = 0 ; tOffset <= mQueueCount ; ++tOffset )
+ {
+ if( mQueueTable[ tOffset ].nonempty() )
+ {
+ os << TAB2 << "table< weight:" << tOffset
+ << " , size:" << mQueueTable[ tOffset ].size()
+ << " >:" << EOL_INCR_INDENT;
+ toStream(mQueueTable[ tOffset ], os);
+ os << DECR_INDENT;
+ }
+ }
+ os << DECR_INDENT;
+ }
+
+ inline void toStream(
+ const ListOfExecutionContext & aQueue, OutStream & os) const
+ {
+ ListOfExecutionContext::const_iterator itEC = aQueue.begin();
+ ListOfExecutionContext::const_iterator itEnd = aQueue.end();
+ for( ; itEC != itEnd ; ++itEC )
+ {
+ (*itEC)->traceDefault(os);
+
+ }
+ }
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PUSH WAITING BEHAVIOR API
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * PUSH
+ */
+ virtual void push(ExecutionContext * anEC) = 0;
+
+ inline virtual void push(const ListOfExecutionContext & listofEC)
+ {
+ ListOfExecutionContext::const_iterator itEC = listofEC.begin();
+ ListOfExecutionContext::const_iterator endEC = listofEC.end();
+ for( ; itEC != endEC ; ++itEC )
+ {
+ push( *itEC );
+ }
+ }
+
+ virtual void push(avm_uint8_t aQueueTableOffset,
+ ExecutionContext * anEC) = 0;
+
+ virtual void push(ListOfExecutionContext & aQueue,
+ ExecutionContext * anEC) = 0;
+
+
+ inline virtual void pushCache(ExecutionContext * anEC)
+ {
+ push(mQueueCache, anEC);
+ }
+
+ /**
+ * SPLICE
+ */
+ inline virtual void splice(WaitingStrategy & aWaitingStrategy)
+ {
+ for( tOffset = 0 ; tOffset <= aWaitingStrategy.mQueueCount ; ++tOffset )
+ {
+ push( aWaitingStrategy.mQueueTable[ tOffset ] );
+ }
+
+ aWaitingStrategy.clearQueueTable();
+ }
+
+ inline virtual void splice(avm_uint8_t aQueueTableOffset,
+ ListOfExecutionContext & listofEC)
+ {
+ mQueueTable[ (aQueueTableOffset < mQueueCount) ?
+ aQueueTableOffset : mQueueCount ].splice( listofEC );
+ }
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PUSH#CHILD WAITING BEHAVIOR API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual void pushChild(const ListOfExecutionContext & childEC) = 0;
+
+ virtual void pushChild(avm_uint8_t aQueueTableOffset,
+ ListOfExecutionContext & childEC) = 0;
+
+ virtual void pushChild(ListOfExecutionContext & aQueue,
+ ListOfExecutionContext & childEC) = 0;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // POP WAITING BEHAVIOR API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual ExecutionContext * pop() = 0;
+
+ virtual void popTo(ListOfExecutionContext & aReadyQueue) = 0;
+
+ virtual ExecutionContext * pop(avm_uint8_t aQueueTableOffset) = 0;
+
+ virtual void popTo(avm_uint8_t aQueueTableOffset,
+ ListOfExecutionContext & aReadyQueue) = 0;
+
+ virtual ExecutionContext * popFrom(ListOfExecutionContext & aQueue) = 0;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // TOP WAITING BEHAVIOR API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual ExecutionContext * top() = 0;
+
+ virtual ExecutionContext * top(avm_uint8_t aQueueTableOffset) = 0;
+
+ virtual ExecutionContext * topFrom(ListOfExecutionContext & aQueue) = 0;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // REQUEUE REQUEST WAITING BEHAVIOR API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline virtual void handleRequestRequeueWaiting(
+ AbstractProcessorUnit * aRequestor)
+ {
+ aRequestor->handleRequestRequeueWaitingTable((*this), 0, mQueueCount);
+ }
+
+ inline virtual void handleRequestRequeueReserve(
+ AbstractProcessorUnit * aRequestor,
+ ListOfExecutionContext & aReserveQueue)
+ {
+ aRequestor->handleRequestRequeueReserveTable(
+ (*this), aReserveQueue, 0, mQueueCount );
+ }
+
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// BASIC STRATEGY PUSH
+////////////////////////////////////////////////////////////////////////////////
+
+struct StrategyPushBack
+{
+ inline static void push(ListOfExecutionContext & aQueue,
+ ExecutionContext * anEC)
+ {
+ aQueue.push_back( anEC );
+ }
+};
+
+struct StrategyPushFront
+{
+ inline static void push(ListOfExecutionContext & aQueue,
+ ExecutionContext * anEC)
+ {
+ aQueue.push_front( anEC );
+ }
+};
+
+struct StrategyPushOrder
+{
+ inline static void push(ListOfExecutionContext & aQueue,
+ ExecutionContext * anEC)
+ {
+ avm_uint8_t weight = anEC->getWeight();
+
+ ListOfExecutionContext::iterator itEC = aQueue.begin();
+ ListOfExecutionContext::iterator itEnd = aQueue.end();
+ for( ; itEC != itEnd ; ++itEC )
+ {
+ if( (*itEC)->getWeight() >= weight )
+ {
+ break;
+ }
+ }
+ aQueue.insert( itEC , anEC);
+ }
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+// BASIC STRATEGY PUSH for CHILD
+////////////////////////////////////////////////////////////////////////////////
+
+struct ChildIteratorFIFO
+{
+ typedef ListOfExecutionContext::const_iterator const_child_iterator;
+
+ inline static const_child_iterator begin_child(
+ const ListOfExecutionContext & childEC)
+ {
+ return( childEC.begin() );
+ }
+
+ inline static const_child_iterator end_child(
+ const ListOfExecutionContext & childEC)
+ {
+ return( childEC.end() );
+ }
+};
+
+
+struct ChildIteratorLIFO
+{
+ typedef ListOfExecutionContext::const_reverse_iterator const_child_iterator;
+
+ inline static const_child_iterator begin_child(
+ const ListOfExecutionContext & childEC)
+ {
+ return( childEC.rbegin() );
+ }
+
+ inline static const_child_iterator end_child(
+ const ListOfExecutionContext & childEC)
+ {
+ return( childEC.rend() );
+ }
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+// BASIC STRATEGY POP
+////////////////////////////////////////////////////////////////////////////////
+
+struct StrategyPopBack
+{
+ inline static ExecutionContext * popFrom(ListOfExecutionContext & aQueue)
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( aQueue.nonempty() )
+ << "Unexpected an empty execution Queue !!!"
+ << SEND_EXIT;
+
+ return( aQueue.pop_last() );
+ }
+
+ inline static ExecutionContext * topFrom(ListOfExecutionContext & aQueue)
+ {
+ if( aQueue.nonempty() )
+ {
+ return( aQueue.last() );
+ }
+
+ return( NULL );
+ }
+
+};
+
+struct StrategyPopFront
+{
+ inline static ExecutionContext * popFrom(ListOfExecutionContext & aQueue)
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( aQueue.nonempty() )
+ << "Unexpected an empty execution Queue !!!"
+ << SEND_EXIT;
+
+ return( aQueue.pop_first() );
+ }
+
+ inline static ExecutionContext * topFrom(ListOfExecutionContext & aQueue)
+ {
+ if( aQueue.nonempty() )
+ {
+ return( aQueue.first() );
+ }
+ return( NULL );
+ }
+
+};
+
+
+struct StrategyPopRandom
+{
+ inline static ExecutionContext * popFrom(ListOfExecutionContext & aQueue)
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( aQueue.nonempty() )
+ << "Unexpected an empty execution Queue !!!"
+ << SEND_EXIT;
+
+ return( aQueue.pop_index(RANDOM::gen_uint(0, aQueue.size() - 1)) );
+ }
+
+ inline static ExecutionContext * topFrom(ListOfExecutionContext & aQueue)
+ {
+ return( NULL );
+ }
+
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// ABSTRACT WAITING STRATEGY
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+template< class StrategyPush , class ChildIterator , class StrategyPop >
+class WaitingStrategyImpl :
+ public WaitingStrategy,
+ public ChildIterator
+{
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ WaitingStrategyImpl(avm_uint8_t queueCount = 1)
+ : WaitingStrategy( queueCount )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~WaitingStrategyImpl()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PUSH WAITING BEHAVIOR API
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * PUSH
+ */
+ inline virtual void push(ExecutionContext * anEC)
+ {
+ push( mQueue , anEC );
+ }
+
+ inline virtual void push(avm_uint8_t aQueueTableOffset,
+ ExecutionContext * anEC)
+ {
+ push( mQueueTable[ (aQueueTableOffset < mQueueCount) ?
+ aQueueTableOffset : mQueueCount ] , anEC );
+ }
+
+ inline virtual void push(ListOfExecutionContext & aQueue,
+ ExecutionContext * anEC)
+ {
+ StrategyPush::push( aQueue , anEC );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PUSH#CHILD WAITING BEHAVIOR API
+ ////////////////////////////////////////////////////////////////////////////
+
+ typename ChildIterator::const_child_iterator itEC;
+ typename ChildIterator::const_child_iterator itEnd;
+
+
+ inline virtual void pushChild(const ListOfExecutionContext & childEC)
+ {
+ itEC = ChildIterator::begin_child( childEC );
+ itEnd = ChildIterator::end_child( childEC );
+ for( ; itEC != itEnd ; ++itEC )
+ {
+ push( *itEC );
+ }
+ }
+
+ inline virtual void pushChild(avm_uint8_t aQueueTableOffset,
+ ListOfExecutionContext & childEC)
+ {
+ itEC = ChildIterator::begin_child( childEC );
+ itEnd = ChildIterator::end_child( childEC );
+ for( ; itEC != itEnd ; ++itEC )
+ {
+ push( aQueueTableOffset , *itEC );
+ }
+ }
+
+ inline virtual void pushChild(ListOfExecutionContext & aQueue,
+ ListOfExecutionContext & childEC)
+ {
+ itEC = ChildIterator::begin_child( childEC );
+ itEnd = ChildIterator::end_child( childEC );
+ for( ; itEC != itEnd ; ++itEC )
+ {
+ push( aQueue , *itEC );
+ }
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // POP WAITING BEHAVIOR API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline virtual ExecutionContext * pop()
+ {
+ return( popFrom(mQueueCache.nonempty() ? mQueueCache : mQueue) );
+ }
+
+ virtual void popTo(ListOfExecutionContext & aReadyQueue)
+ {
+ aReadyQueue.append( pop() );
+ }
+
+ inline virtual ExecutionContext * pop(avm_uint8_t aQueueTableOffset)
+ {
+ return( popFrom( mQueueTable[ (aQueueTableOffset < mQueueCount) ?
+ aQueueTableOffset : mQueueCount ] ) );
+ }
+
+ virtual void popTo(avm_uint8_t aQueueTableOffset,
+ ListOfExecutionContext & aReadyQueue)
+ {
+ aReadyQueue.append( pop(aQueueTableOffset) );
+ }
+
+ inline virtual ExecutionContext * popFrom(ListOfExecutionContext & aQueue)
+ {
+ return( StrategyPop::popFrom( aQueue ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // TOP WAITING BEHAVIOR API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline virtual ExecutionContext * top()
+ {
+ return( topFrom(mQueueCache.nonempty() ? mQueueCache : mQueue) );
+ }
+
+ inline virtual ExecutionContext * top(avm_uint8_t aQueueTableOffset)
+ {
+ return( topFrom( mQueueTable[ (aQueueTableOffset < mQueueCount) ?
+ aQueueTableOffset : mQueueCount ] ) );
+ }
+
+ inline virtual ExecutionContext * topFrom(ListOfExecutionContext & aQueue)
+ {
+ return( StrategyPop::topFrom( aQueue ) );
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* FAM_QUEUE_WAITINGSTRATEGY_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/queue/WaitingStrategyBLOCK.h b/org.eclipse.efm.symbex/src/fam/queue/WaitingStrategyBLOCK.h
new file mode 100644
index 0000000..3f2dcc4
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/queue/WaitingStrategyBLOCK.h
@@ -0,0 +1,691 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 févr. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef WAITINGSTRATEGYBLOCK_H_
+#define WAITINGSTRATEGYBLOCK_H_
+
+#include "WaitingStrategy.h"
+#include "WaitingBasicStrategy.h"
+
+#include <sew/Configuration.h>
+
+
+namespace sep
+{
+
+
+template< class BasicStrategy >
+class WaitingStrategyBLOCK : public BasicStrategy
+{
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ Configuration & mConfiguration;
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ WaitingStrategyBLOCK(
+ Configuration & aConfiguration, avm_uint8_t queueCount,
+ avm_size_t aBlockHeightPeriod, avm_size_t aBlockWidthPeriod,
+ avm_size_t aBlockHeight, avm_size_t aBlockWidth,
+ avm_size_t aHeightLimit, avm_size_t aWidthLimit)
+ : BasicStrategy( queueCount ),
+ mConfiguration( aConfiguration ),
+ mBlockHeightPeriod( aBlockHeightPeriod ),
+ mBlockWidthPeriod( aBlockWidthPeriod ),
+
+ mBlockHeight( aBlockHeight ),
+ mBlockWidth( aBlockWidth ),
+
+ mHeightLimit( aHeightLimit ),
+ mWidthLimit( aWidthLimit ),
+
+ mPushHeightMin( 0 ),
+ mPushWidthMin( 0 ),
+
+ mPushHeightMax( 0 ),
+ mPushWidthMax( 0 )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~WaitingStrategyBLOCK()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PUSH / PUSH#CHILD API
+ ////////////////////////////////////////////////////////////////////////////
+
+ void push(ExecutionContext * anEC)
+ {
+ if( (anEC->getHeight() <= mBlockHeight) &&
+ (anEC->getWidth() <= mBlockWidth) )
+ {
+ BasicStrategy::push(BasicStrategy::mQueueCache, anEC);
+ }
+ else
+ {
+ BasicStrategy::push(BasicStrategy::mQueue, anEC);
+ }
+
+ // For algo optimization
+ if( mPushHeightMax < anEC->getHeight() )
+ {
+ mPushHeightMax = anEC->getHeight();
+ }
+ if( mPushWidthMax < anEC->getWidth() )
+ {
+ mPushWidthMax = anEC->getWidth();
+ }
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // POP / TOP API
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool updateQueue()
+ {
+ mPushHeightMin = mPushHeightMax;
+ mPushWidthMin = mPushWidthMax;
+
+ ListOfExecutionContext::iterator itEC = BasicStrategy::mQueue.begin();
+ ListOfExecutionContext::iterator itEnd = BasicStrategy::mQueue.end();
+ while( itEC != itEnd )
+ {
+ // For algo optimization
+ if( mPushHeightMin > (*itEC)->getHeight() )
+ {
+ mPushHeightMin = (*itEC)->getHeight();
+ }
+ if( mPushWidthMin > (*itEC)->getWidth() )
+ {
+ mPushWidthMin = (*itEC)->getWidth();
+ }
+
+ if( ((*itEC)->getHeight() <= mBlockHeight) &&
+ ((*itEC)->getWidth() <= mBlockWidth) )
+ {
+ //BasicStrategy::push(BasicStrategy::mQueueCache, (*itEC));
+ BasicStrategy::mQueueCache.push_back( *itEC );
+
+ itEC = BasicStrategy::mQueue.erase(itEC);
+ }
+ else
+ {
+ ++itEC;
+ }
+ }
+
+ return( BasicStrategy::mQueueCache.nonempty() );
+ }
+
+ inline ExecutionContext * top()
+ {
+ if( BasicStrategy::mQueueCache.nonempty() )
+ {
+ return( BasicStrategy::topFrom( BasicStrategy::mQueueCache ) );
+ }
+
+ return( NULL );
+ }
+
+
+protected:
+ /*ATTRIBUTES*/
+ avm_size_t mBlockHeightPeriod;
+ avm_size_t mBlockWidthPeriod;
+
+ avm_size_t mBlockHeight;
+ avm_size_t mBlockWidth;
+
+ avm_size_t mHeightLimit;
+ avm_size_t mWidthLimit;
+
+ avm_size_t mPushHeightMin;
+ avm_size_t mPushWidthMin;
+
+ avm_size_t mPushHeightMax;
+ avm_size_t mPushWidthMax;
+
+};
+
+
+#define NEXT_INCR(M, P) (M + P - (M % P))
+
+
+
+
+template< class BasicStrategyALL >
+class WaitingStrategyBLOCK_ALL :
+ public WaitingStrategyBLOCK< BasicStrategyALL >
+{
+
+private:
+ /**
+ * TYPEDEF
+ */
+ typedef WaitingStrategyBLOCK< BasicStrategyALL > base_this_type;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ WaitingStrategyBLOCK_ALL(
+ Configuration & aConfiguration, avm_uint8_t queueCount,
+ avm_size_t aBlockHeightPeriod, avm_size_t aBlockWidthPeriod,
+ avm_size_t aBlockHeight, avm_size_t aBlockWidth,
+ avm_size_t aHeightLimit, avm_size_t aWidthLimit)
+ : base_this_type(aConfiguration, queueCount,
+ aBlockHeightPeriod, aBlockWidthPeriod,
+ aBlockHeight, aBlockWidth, aHeightLimit, aWidthLimit)
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // POP / TOP API
+ ////////////////////////////////////////////////////////////////////////////
+
+ ExecutionContext * pop()
+ {
+ return( NULL );
+ }
+
+
+ void popTo(ListOfExecutionContext & aReadyQueue)
+ {
+ static avm_size_t call_counter = 0;
+ ++call_counter;
+
+ if( BasicStrategyALL::mQueueCache.nonempty() )
+ {
+ aReadyQueue.splice( BasicStrategyALL::mQueueCache );
+ }
+ else if( BasicStrategyALL::mQueue.nonempty() )
+ {
+ while( true )
+ {
+ // Recherche par block en BFS à partir de la hauteur courante
+ while( (base_this_type::mBlockWidth < base_this_type::mWidthLimit) &&
+ (base_this_type::mBlockWidth < base_this_type::mPushWidthMax) )
+ {
+ base_this_type::mBlockWidth = std::min(base_this_type::mWidthLimit,
+ base_this_type::mBlockWidth + base_this_type::mBlockWidthPeriod);
+
+ AVM_OS_COUT << "update mBlockWidth [" << call_counter << "] :> "
+ << "H<" << base_this_type::mBlockHeightPeriod << ">[ "
+ << base_this_type::mPushHeightMin << " , " << base_this_type::mPushHeightMax << " ]"
+ << " => height:" << base_this_type::mBlockHeight << " <---> "
+ << "W<" << base_this_type::mBlockWidthPeriod << ">[ "
+ << base_this_type::mPushWidthMin << " , " << base_this_type::mPushWidthMax << " ]"
+ << " => width:" << base_this_type::mBlockWidth << std::endl;
+
+ if( base_this_type::updateQueue() )
+ {
+ aReadyQueue.splice( BasicStrategyALL::mQueueCache );
+ }
+ }
+
+// mConfiguration.saveTraceSpecification(AVM_OS_COUT);
+// mConfiguration.saveScenarii();
+
+ // Recherche par block BFS à partir
+ // d'une hauteur augmentée d'une taille de block
+ if( (base_this_type::mPushHeightMin < base_this_type::mHeightLimit) &&
+ (base_this_type::mPushWidthMin < base_this_type::mWidthLimit) )
+ {
+ base_this_type::mBlockHeight = std::min(base_this_type::mHeightLimit,
+ NEXT_INCR(base_this_type::mPushHeightMin, base_this_type::mBlockHeightPeriod));
+
+ base_this_type::mBlockWidth = std::min(base_this_type::mWidthLimit,
+ NEXT_INCR( base_this_type::mPushWidthMin , base_this_type::mBlockWidthPeriod));
+
+ AVM_OS_COUT << "update mBlockHeight[" << call_counter << "] :> "
+ << "H<" << base_this_type::mBlockHeightPeriod << ">[ "
+ << base_this_type::mPushHeightMin << " , " << base_this_type::mPushHeightMax << " ]"
+ << " => height:" << base_this_type::mBlockHeight << " <---> "
+ << "W<" << base_this_type::mBlockWidthPeriod << ">[ "
+ << base_this_type::mPushWidthMin << " , " << base_this_type::mPushWidthMax << " ]"
+ << " => width:" << base_this_type::mBlockWidth << std::endl;
+
+ if( base_this_type::updateQueue() )
+ {
+ aReadyQueue.splice( BasicStrategyALL::mQueueCache );
+ }
+ }
+
+ // Recherche par block DFS à partir
+ // d'un nouveau périmètre doublé
+ base_this_type::mBlockHeight = NEXT_INCR(base_this_type::mPushHeightMin, base_this_type::mBlockHeightPeriod);
+ base_this_type::mBlockWidth = NEXT_INCR(base_this_type::mPushWidthMin , base_this_type::mBlockWidthPeriod);
+
+ base_this_type::mHeightLimit += base_this_type::mHeightLimit;
+ base_this_type::mWidthLimit += base_this_type::mWidthLimit;
+
+ AVM_OS_COUT << "update mBlockLimit[" << call_counter << "] :> "
+ << "height:" << base_this_type::mHeightLimit
+ << " width:" << base_this_type::mWidthLimit
+ << " ==> reset mBlockSize :> "
+ << "H<" << base_this_type::mBlockHeightPeriod << ">[ "
+ << base_this_type::mPushHeightMin << " , " << base_this_type::mPushHeightMax << " ]"
+ << " => height:" << base_this_type::mBlockHeight << " <---> "
+ << "W<" << base_this_type::mBlockWidthPeriod << ">[ "
+ << base_this_type::mPushWidthMin << " , " << base_this_type::mPushWidthMax << " ]"
+ << " => width:" << base_this_type::mBlockWidth << std::endl;
+
+ if( base_this_type::updateQueue() )
+ {
+ aReadyQueue.splice( BasicStrategyALL::mQueueCache );
+ }
+ }
+ }
+ }
+
+};
+
+
+
+class WaitingStrategyBLOCK_BFS :
+ public WaitingStrategyBLOCK< WaitingBasicStrategyBFS >
+{
+
+private:
+ /**
+ * TYPEDEF
+ */
+ typedef WaitingStrategyBLOCK< WaitingBasicStrategyBFS > base_this_type;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ WaitingStrategyBLOCK_BFS(
+ Configuration & aConfiguration, avm_uint8_t queueCount,
+ avm_size_t aBlockHeightPeriod, avm_size_t aBlockWidthPeriod,
+ avm_size_t aBlockHeight, avm_size_t aBlockWidth,
+ avm_size_t aHeightLimit, avm_size_t aWidthLimit)
+ : base_this_type(aConfiguration, queueCount,
+ aBlockHeightPeriod, aBlockWidthPeriod,
+ aBlockHeight, aBlockWidth, aHeightLimit, aWidthLimit)
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // POP / TOP API
+ ////////////////////////////////////////////////////////////////////////////
+
+ ExecutionContext * pop()
+ {
+ static avm_size_t call_counter = 0;
+ ++call_counter;
+
+ if( WaitingBasicStrategyBFS::mQueueCache.nonempty() )
+ {
+ return( WaitingBasicStrategyBFS::popFrom(
+ WaitingBasicStrategyBFS::mQueueCache) );
+ }
+ else if( WaitingBasicStrategyBFS::mQueue.nonempty() )
+ {
+ while( true )
+ {
+ // Recherche par block en BFS à partir de la hauteur courante
+ while( (mBlockWidth < mWidthLimit) &&
+ (mBlockWidth < mPushWidthMax) )
+ {
+ mBlockWidth = std::min(mWidthLimit,
+ mBlockWidth + mBlockWidthPeriod);
+
+ AVM_OS_COUT << "update mBlockWidth [" << call_counter << "] :> "
+ << "H<" << mBlockHeightPeriod << ">[ "
+ << mPushHeightMin << " , " << mPushHeightMax << " ]"
+ << " => height:" << mBlockHeight << " <---> "
+ << "W<" << mBlockWidthPeriod << ">[ "
+ << mPushWidthMin << " , " << mPushWidthMax << " ]"
+ << " => width:" << mBlockWidth << std::endl;
+
+ if( updateQueue() )
+ {
+ return( WaitingBasicStrategyBFS::popFrom(
+ WaitingBasicStrategyBFS::mQueueCache) );
+ }
+ }
+
+// mConfiguration.saveTraceSpecification(AVM_OS_COUT);
+// mConfiguration.saveScenarii();
+
+ // Recherche par block BFS à partir
+ // d'une hauteur augmentée d'une taille de block
+ if( (mPushHeightMin < mHeightLimit) &&
+ (mPushWidthMin < mWidthLimit) )
+ {
+ mBlockHeight = std::min(mHeightLimit,
+ NEXT_INCR(mPushHeightMin, mBlockHeightPeriod));
+
+ mBlockWidth = std::min(mWidthLimit,
+ NEXT_INCR( mPushWidthMin , mBlockWidthPeriod));
+
+ AVM_OS_COUT << "update mBlockHeight[" << call_counter << "] :> "
+ << "H<" << mBlockHeightPeriod << ">[ "
+ << mPushHeightMin << " , " << mPushHeightMax << " ]"
+ << " => height:" << mBlockHeight << " <---> "
+ << "W<" << mBlockWidthPeriod << ">[ "
+ << mPushWidthMin << " , " << mPushWidthMax << " ]"
+ << " => width:" << mBlockWidth << std::endl;
+
+ if( updateQueue() )
+ {
+ return( WaitingBasicStrategyBFS::popFrom(
+ WaitingBasicStrategyBFS::mQueueCache) );
+ }
+ }
+
+ // Recherche par block DFS à partir
+ // d'un nouveau périmètre doublé
+ mBlockHeight = NEXT_INCR(mPushHeightMin, mBlockHeightPeriod);
+ mBlockWidth = NEXT_INCR(mPushWidthMin , mBlockWidthPeriod);
+
+ mHeightLimit += mHeightLimit;
+ mWidthLimit += mWidthLimit;
+
+ AVM_OS_COUT << "update mBlockLimit[" << call_counter << "] :> "
+ << "height:" << mHeightLimit
+ << " width:" << mWidthLimit
+ << " ==> reset mBlockSize :> "
+ << "H<" << mBlockHeightPeriod << ">[ "
+ << mPushHeightMin << " , " << mPushHeightMax << " ]"
+ << " => height:" << mBlockHeight << " <---> "
+ << "W<" << mBlockWidthPeriod << ">[ "
+ << mPushWidthMin << " , " << mPushWidthMax << " ]"
+ << " => width:" << mBlockWidth << std::endl;
+
+ if( updateQueue() )
+ {
+ return( WaitingBasicStrategyBFS::popFrom(
+ WaitingBasicStrategyBFS::mQueueCache) );
+ }
+ }
+ }
+
+ return( NULL );
+ }
+
+};
+
+
+
+
+class WaitingStrategyBLOCK_DFS :
+ public WaitingStrategyBLOCK< WaitingBasicStrategyDFS >
+{
+
+private:
+ /**
+ * TYPEDEF
+ */
+ typedef WaitingStrategyBLOCK< WaitingBasicStrategyDFS > base_this_type;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ WaitingStrategyBLOCK_DFS(
+ Configuration & aConfiguration, avm_uint8_t queueCount,
+ avm_size_t aBlockHeightPeriod, avm_size_t aBlockWidthPeriod,
+ avm_size_t aBlockHeight, avm_size_t aBlockWidth,
+ avm_size_t aHeightLimit, avm_size_t aWidthLimit)
+ : base_this_type(aConfiguration, queueCount,
+ aBlockHeightPeriod, aBlockWidthPeriod,
+ aBlockHeight, aBlockWidth, aHeightLimit, aWidthLimit)
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // POP / TOP API
+ ////////////////////////////////////////////////////////////////////////////
+
+ ExecutionContext * pop()
+ {
+ static avm_size_t call_counter = 0;
+ ++call_counter;
+
+ if( WaitingBasicStrategyDFS::mQueueCache.nonempty() )
+ {
+ return( WaitingBasicStrategyDFS::popFrom(
+ WaitingBasicStrategyDFS::mQueueCache) );
+ }
+ else if( WaitingBasicStrategyDFS::mQueue.nonempty() )
+ {
+ while( true )
+ {
+ // Recherche par block en DFS à partir de la largeur courante
+ while( (mBlockHeight < mHeightLimit) &&
+ (mBlockHeight < mPushHeightMax) )
+ {
+ mBlockHeight = std::min(mHeightLimit,
+ mBlockHeight + mBlockHeightPeriod);
+
+ AVM_OS_COUT << "update mBlockHeight[" << call_counter << "] :> "
+ << "H<" << mBlockHeightPeriod << ">[ "
+ << mPushHeightMin << " , " << mPushHeightMax << " ]"
+ << " => height:" << mBlockHeight << " <---> "
+ << "W<" << mBlockWidthPeriod << ">[ "
+ << mPushWidthMin << " , " << mPushWidthMax << " ]"
+ << " => width:" << mBlockWidth << std::endl;
+
+ if( updateQueue() )
+ {
+ return( WaitingBasicStrategyDFS::popFrom(
+ WaitingBasicStrategyDFS::mQueueCache) );
+ }
+ }
+
+// mConfiguration.saveTraceSpecification(AVM_OS_COUT);
+// mConfiguration.saveScenarii();
+
+ // Recherche par block DFS à partir
+ // d'une largeur augmentée d'une taille de block
+ if( (mPushWidthMin < mWidthLimit) &&
+ (mPushHeightMin < mHeightLimit) )
+ {
+ mBlockHeight = std::min(mHeightLimit,
+ NEXT_INCR(mPushHeightMin, mBlockHeightPeriod));
+
+ mBlockWidth = std::min(mWidthLimit,
+ NEXT_INCR( mPushWidthMin , mBlockWidthPeriod));
+
+ AVM_OS_COUT << "update mBlockWidth [" << call_counter << "] :> "
+ << "H<" << mBlockHeightPeriod << ">[ "
+ << mPushHeightMin << " , " << mPushHeightMax << " ]"
+ << " => height:" << mBlockHeight << " <---> "
+ << "W<" << mBlockWidthPeriod << ">[ "
+ << mPushWidthMin << " , " << mPushWidthMax << " ]"
+ << " => width:" << mBlockWidth << std::endl;
+
+ if( updateQueue() )
+ {
+ return( WaitingBasicStrategyDFS::popFrom(
+ WaitingBasicStrategyDFS::mQueueCache) );
+ }
+ }
+
+ // Recherche par block DFS à partir
+ // d'un nouveau périmètre doublé
+ else
+ {
+ mBlockHeight = NEXT_INCR(mPushHeightMin, mBlockHeightPeriod);
+ mBlockWidth = NEXT_INCR(mPushWidthMin , mBlockWidthPeriod);
+
+ mHeightLimit += mHeightLimit;
+ mWidthLimit += mWidthLimit;
+
+ AVM_OS_COUT << "update mBlockLimit[" << call_counter << "] :>"
+ << "height:" << mHeightLimit
+ << " width:" << mWidthLimit
+ << " ==> reset mBlockSize :> "
+ << "H<" << mBlockHeightPeriod << ">[ "
+ << mPushHeightMin << " , " << mPushHeightMax << " ]"
+ << " => height:" << mBlockHeight << " <---> "
+ << "W<" << mBlockWidthPeriod << ">[ "
+ << mPushWidthMin << " , " << mPushWidthMax << " ]"
+ << " => width:" << mBlockWidth << std::endl;
+
+ if( updateQueue() )
+ {
+ return( WaitingBasicStrategyDFS::popFrom(
+ WaitingBasicStrategyDFS::mQueueCache) );
+ }
+ }
+ }
+ }
+
+ return( NULL );
+ }
+
+};
+
+
+
+class WaitingStrategyBLOCK_RFS :
+ public WaitingStrategyBLOCK< WaitingBasicStrategyRFS >
+{
+
+private:
+ /**
+ * TYPEDEF
+ */
+ typedef WaitingStrategyBLOCK< WaitingBasicStrategyRFS > base_this_type;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ WaitingStrategyBLOCK_RFS(
+ Configuration & aConfiguration, avm_uint8_t queueCount,
+ avm_size_t aBlockHeightPeriod, avm_size_t aBlockWidthPeriod,
+ avm_size_t aBlockHeight, avm_size_t aBlockWidth,
+ avm_size_t aHeightLimit, avm_size_t aWidthLimit)
+ : base_this_type(aConfiguration, queueCount,
+ aBlockHeightPeriod, aBlockWidthPeriod,
+ aBlockHeight, aBlockWidth, aHeightLimit, aWidthLimit)
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // POP / TOP API
+ ////////////////////////////////////////////////////////////////////////////
+
+ ExecutionContext * pop()
+ {
+ static avm_size_t call_counter = 0;
+ ++call_counter;
+
+ if( WaitingBasicStrategyRFS::mQueueCache.nonempty() )
+ {
+ return( WaitingBasicStrategyRFS::popFrom(
+ WaitingBasicStrategyRFS::mQueueCache) );
+ }
+ else if( WaitingBasicStrategyRFS::mQueue.nonempty() )
+ {
+ while( true )
+ {
+ while( (mBlockHeight < mHeightLimit) ||
+ (mBlockWidth < mWidthLimit) )
+ {
+ // Recherche par block RFS à partir d'un périmètre augmenté,
+ // d'une taille de block en hauteur et/ou en largeur
+ mBlockHeight = std::min(mHeightLimit,
+ mBlockHeight + mBlockHeightPeriod);
+
+ mBlockWidth = std::min(mWidthLimit,
+ mBlockWidth + mBlockWidthPeriod);
+
+ AVM_OS_COUT << "update mBlockSize[" << call_counter << "] :> "
+ << "H[ " << mPushHeightMin << " , " << mPushHeightMax << " ]"
+ << " W[ " << mPushWidthMin << " , " << mPushWidthMax << " ]"
+ << "height:" << mBlockHeight
+ << " width:" << mBlockWidth << std::endl;
+
+ if( updateQueue() )
+ {
+ return( WaitingBasicStrategyRFS::popFrom(
+ WaitingBasicStrategyRFS::mQueueCache) );
+ }
+ }
+
+// mConfiguration.saveTraceSpecification(AVM_OS_COUT);
+// mConfiguration.saveScenarii();
+
+ // Recherche par block RFS à partir d'un périmètre augmenté
+ // d'une taille de block en hauteur et en largeur
+ // et en doublant le périmètre limite
+ mBlockHeight = mHeightLimit + mBlockHeightPeriod;
+ mBlockWidth = mWidthLimit + mBlockWidthPeriod;
+
+ mHeightLimit += mHeightLimit;
+ mWidthLimit += mWidthLimit;
+
+ AVM_OS_COUT << "update mBlockLimit[" << call_counter << "] :> "
+ << "height:" << mHeightLimit
+ << " width:" << mWidthLimit
+ << " ==> reset mBlockSize :> "
+ << "H[ " << mPushHeightMin << " , " << mPushHeightMax << " ]"
+ << " => height:" << mBlockHeight << " <---> "
+ << "W[ " << mPushWidthMin << " , " << mPushWidthMax << " ]"
+ << " => width:" << mBlockWidth << std::endl;
+
+ if( updateQueue() )
+ {
+ return( WaitingBasicStrategyRFS::popFrom(
+ WaitingBasicStrategyRFS::mQueueCache) );
+ }
+ }
+ }
+
+ return( NULL );
+ }
+
+};
+
+
+
+} /* namespace sep */
+#endif /* WAITINGSTRATEGYBLOCK_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/queue/WaitingStrategyWEIGHT.h b/org.eclipse.efm.symbex/src/fam/queue/WaitingStrategyWEIGHT.h
new file mode 100644
index 0000000..9f186cd
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/queue/WaitingStrategyWEIGHT.h
@@ -0,0 +1,155 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 févr. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef WAITINGSTRATEGYWEIGHT_H_
+#define WAITINGSTRATEGYWEIGHT_H_
+
+#include "WaitingStrategy.h"
+
+
+namespace sep
+{
+
+
+template< class BasicStrategy >
+class WaitingStrategyWEIGHT : public BasicStrategy
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ WaitingStrategyWEIGHT(avm_uint8_t queueCount)
+ : BasicStrategy( queueCount ),
+ mPushWeightMin( queueCount ),
+ mPushWeightMax( 0 )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~WaitingStrategyWEIGHT()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PUSH API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline void push(ExecutionContext * anEC)
+ {
+ BasicStrategy::tOffset = anEC->getWeight();
+
+ BasicStrategy::push(BasicStrategy::tOffset, anEC);
+
+ // For algo optimization
+ if( mPushWeightMin > BasicStrategy::tOffset )
+ {
+ mPushWeightMin = BasicStrategy::tOffset;
+ }
+ if( mPushWeightMax < BasicStrategy::tOffset )
+ {
+ mPushWeightMax = BasicStrategy::tOffset;
+ }
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // POP / TOP API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline ExecutionContext * pop()
+ {
+ for( ; mPushWeightMin <= mPushWeightMax ; ++mPushWeightMin )
+ {
+ if( BasicStrategy::mQueueTable[ mPushWeightMin ].nonempty() )
+ {
+ return( BasicStrategy::popFrom(
+ BasicStrategy::mQueueTable[ mPushWeightMin ] ) );
+ }
+ }
+
+// for( BasicStrategy::tOffset = 0 ;
+// BasicStrategy::tOffset <= BasicStrategy::mQueueCount ;
+// ++BasicStrategy::tOffset )
+// {
+// if( BasicStrategy::mQueueTable[ BasicStrategy::tOffset ].nonempty() )
+// {
+// return( BasicStrategy::pop(
+// BasicStrategy::mQueueTable[ BasicStrategy::tOffset ] ) );
+// }
+// }
+
+ return( NULL );
+ }
+
+
+ inline virtual void popTo(ListOfExecutionContext & aReadyQueue)
+ {
+ for( ; mPushWeightMin <= mPushWeightMax ; ++mPushWeightMin )
+ {
+ if( BasicStrategy::mQueueTable[ mPushWeightMin ].nonempty() )
+ {
+ BasicStrategy::popTo(mPushWeightMin, aReadyQueue);
+
+ break;
+ }
+ }
+ }
+
+
+ inline ExecutionContext * top()
+ {
+ for( ; mPushWeightMin <= mPushWeightMax ; ++mPushWeightMin )
+ {
+ if( BasicStrategy::mQueueTable[ mPushWeightMin ].nonempty() )
+ {
+ return( BasicStrategy::topFrom(
+ BasicStrategy::mQueueTable[ mPushWeightMin ] ) );
+ }
+ }
+
+ return( NULL );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PROCESSOR REQUEST API :> REQUEUE
+ ////////////////////////////////////////////////////////////////////////////
+
+ void handleRequestRequeue(AbstractProcessorUnit * aRequestor)
+ {
+ aRequestor->handleRequestRequeueWaitingTable( *this,
+ mPushWeightMin, mPushWeightMax );
+ }
+
+
+
+
+protected:
+ /*ATTRIBUTES*/
+ avm_uint8_t mPushWeightMin;
+ avm_uint8_t mPushWeightMax;
+
+};
+
+
+} /* namespace sep */
+#endif /* WAITINGSTRATEGYWEIGHT_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/redundancy/BaseDataComparator.cpp b/org.eclipse.efm.symbex/src/fam/redundancy/BaseDataComparator.cpp
new file mode 100644
index 0000000..6aa2572
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/redundancy/BaseDataComparator.cpp
@@ -0,0 +1,1227 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "BaseDataComparator.h"
+
+#include <fam/redundancy/RedundancyFilter.h>
+
+#include <fml/buffer/BaseBufferForm.h>
+#include <fml/buffer/BaseBufferQueue.h>
+#include <fml/buffer/RamBuffer.h>
+
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/ExecutableQuery.h>
+#include <fml/executable/InstanceOfData.h>
+#include <fml/executable/InstanceOfMachine.h>
+
+#include <fml/expression/ExpressionComparer.h>
+#include <fml/expression/ExpressionFactory.h>
+
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/Message.h>
+#include <fml/runtime/RuntimeForm.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <sew/Configuration.h>
+
+
+namespace sep
+{
+
+
+/**
+ * destroyMachineData
+ */
+
+void BaseDataComparator::destroyMachineData()
+{
+ mListOfSelectedIOMachine.clear();
+
+ mListOfAllVariable.clear();
+
+ mListOfSelectedPresburgerVariable.clear();
+
+ mListOfSelectedNonPresburgerVariable.clear();
+}
+
+
+/**
+ ***************************************************************************
+prototype filter::redundancy as avm::core.filter.REDUNDANCY is
+section PROPERTY
+ @predicate = 'INCLUSION'; // ( <= | INC | INCLUSION )
+ ( == | EQ | EQUALITY )
+ ( =a= | AEQ | ALPHA_EQUIV)
+ ( =s= | SEQ | SYNTAXIC_EQUALITY)
+ ( =t= | TEQ | TRIVIALLY_EQUALITY)
+ NONE
+
+ @solver = 'OMEGA'; // OMEGA | CVC3
+
+ @path_scope = 'ALL'; // ALL | CURRENT execution graph path
+
+ @data_scope = 'ALL'; // ALL data ; or DETAILS section
+ // DETAILS | DETAILS< exclude > some data,
+endsection PROPERTY
+
+section HEURISTIC
+ @communication = false;
+
+ @variable = true;
+ @path_condition = false;
+endsection HEURISTIC
+
+section DETAILS
+ @model = ufi;
+
+ @instance = ufi;
+
+ @variable = ufi;
+endsection DETAILS
+endprototype
+ ***************************************************************************
+ */
+
+/**
+ * CONFIGURE
+ */
+bool BaseDataComparator::configure(WObject * wfParameterObject)
+{
+ const ExecutionData & theED = mConfiguration.getMainExecutionData();
+
+ mMachineCount = theED.getTableOfRuntime().size();
+
+ WObject * thePROPERTY =
+ RedundancyFilter::AUTO_REGISTER_TOOL.isTypeID( *wfParameterObject )
+ ? Query::getRegexWSequence(wfParameterObject,
+ OR_WID2("property", "PROPERTY"), wfParameterObject)
+ : Query::getRegexWSequence(wfParameterObject,
+ OR_WID2("redundancy" , "REDUNDANCY"), wfParameterObject);
+
+ std::string path_scope = Query::getRegexWPropertyString(
+ thePROPERTY, CONS_WID2("path", "scope"), "ALL");
+ mCurrentPathScopeFlag =
+ ( (path_scope == "CURRENT") || (path_scope == "PARENT") );
+
+ std::string data_scope = Query::getRegexWPropertyString(
+ thePROPERTY, CONS_WID2("data", "scope"), "ALL");
+
+
+ WObject * theHEURISTIC =
+ RedundancyFilter::AUTO_REGISTER_TOOL.isTypeID( *wfParameterObject )
+ ? Query::getRegexWSequence(wfParameterObject,
+ OR_WID2("heuristic", "HEURISTIC"), thePROPERTY)
+ : Query::getRegexWSequence(wfParameterObject,
+ OR_WID2("redundancy" , "REDUNDANCY"), thePROPERTY);
+
+ if( theHEURISTIC != WObject::_NULL_ )
+ {
+ mUseCommunication = Query::getWPropertyBoolean(
+ theHEURISTIC, "communication", true);
+
+ mUseVariable = Query::getWPropertyBoolean(
+ theHEURISTIC, "variable", true);
+
+ mIgnorePathCondition = not Query::getRegexWPropertyBoolean(
+ theHEURISTIC, CONS_WID2("path", "condition"), true);
+ }
+
+
+ if( data_scope == "ALL" )
+ {
+ computeAllMachineData(theED);
+ }
+ // TODO configure for @data_scope = 'DETAILS';
+ else if( StringTools::startsWith(data_scope, "DETAILS") )
+ {
+ WObject * theDETAILS =
+ RedundancyFilter::AUTO_REGISTER_TOOL.isTypeID( *wfParameterObject )
+ ? Query::getRegexWSequence(wfParameterObject,
+ OR_WID2("details", "DETAILS"), thePROPERTY)
+ : Query::getRegexWSequence(wfParameterObject,
+ OR_WID2("redundancy" , "REDUNDANCY"), thePROPERTY);
+
+ if( theDETAILS != WObject::_NULL_ )
+ {
+ ExecutableForm * anExecutable = NULL;
+ InstanceOfMachine * aMachine = NULL;
+ InstanceOfData * aVariable = NULL;
+
+ ListOfExecutableForm listOfExecutable;
+ ListOfInstanceOfMachine listOfInstance;
+ ListOfInstanceOfData listOfVariable;
+
+ ExecutableQuery XQuery( mConfiguration );
+
+ WObject::const_iterator itWfO = theDETAILS->owned_begin();
+ WObject::const_iterator endWfO = theDETAILS->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty() )
+ {
+ const std::string & kind = (*itWfO)->getNameID();
+ const std::string & qnid = (*itWfO)->toStringValue();
+
+
+ if( (kind == "model") || (kind == "form") )
+ {
+ anExecutable = XQuery.getExecutable(
+ qnid ).to_ptr< ExecutableForm >();
+ if( anExecutable != NULL )
+ {
+ listOfExecutable.append(anExecutable);
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound the machine "
+ << kind << " << " << qnid
+ << " >> as processor parameter:> "
+ << wfParameterObject->getFullyQualifiedNameID()
+ << std::endl;
+ }
+ }
+ else if( kind == "instance" )
+ {
+ aMachine = XQuery.getMachine(
+ Specifier::DESIGN_INSTANCE_KIND, qnid).rawMachine();
+ if( aMachine != NULL )
+ {
+ listOfInstance.append(aMachine);
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound the machine "
+ << kind << " << " << qnid
+ << " >> as processor parameter:> "
+ << wfParameterObject->getFullyQualifiedNameID()
+ << std::endl;
+ }
+ }
+ // TODO: à faire pour les variables.
+ else if( kind == "variable" )
+ {
+ aVariable = XQuery.getData(
+ qnid ).to_ptr< InstanceOfData >();
+ if( aVariable != NULL )
+ {
+ listOfVariable.append(aVariable);
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound the " << kind << " << "
+ << qnid << " >> as processor parameter:> "
+ << wfParameterObject->getFullyQualifiedNameID()
+ << std::endl;
+ }
+ }
+ else
+ {
+ AVM_OS_WARN << "Unexpected attribute << "
+ << (*itWfO)->str() << " >> as processor parameter:> "
+ << wfParameterObject->getFullyQualifiedNameID()
+ << std::endl;
+ }
+ }
+ }
+
+
+ if( data_scope.find("exclude") != std::string::npos )
+ {
+ computeDetailsExcludeMachineData(theED,
+ listOfExecutable, listOfInstance, listOfVariable);
+ }
+ else
+ {
+ computeDetailsIncludeMachineData(theED,
+ listOfExecutable, listOfInstance, listOfVariable);
+ }
+
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound section << DETAILS >> as redundancy "
+ "detector parameter" << std::endl;
+ }
+ }
+ else
+ {
+ AVM_OS_ERROR_ALERT << "Unexpected REDUNDANCY filter << @data_scope = "
+ << data_scope << "; >> !!!" << std::endl
+ << "NB. << @data_scope = {[ 'ALL' | 'DETAILS' ]}; >> !!!"
+ << SEND_ALERT;
+
+ return( false );
+ }
+
+ return( true );
+}
+
+
+void BaseDataComparator::computeAllMachineData(const ExecutionData & anED)
+{
+ destroyMachineData();
+
+ selectIOMachine(anED, mListOfSelectedIOMachine);
+
+ selectAllVariable(anED, mListOfAllVariable);
+
+ selectPresburgerVariable(anED, mListOfSelectedPresburgerVariable);
+
+ selectNonPresburgerVariable(anED, mListOfSelectedNonPresburgerVariable);
+}
+
+
+
+
+void BaseDataComparator::computeDetailsIncludeMachineData(
+ const ExecutionData & anED,
+ ListOfExecutableForm & listOfExecutable,
+ ListOfInstanceOfMachine & listOfInstance,
+ ListOfInstanceOfData & listOfVariable)
+{
+ destroyMachineData();
+
+ // TODO: réécrire les 4 méthodes suivantes pour prendre en compte les
+ // DETAILS contenus dans les deux paramètres additionnels par rapport au cas ALL:
+
+ selectDetailsIOMachine(anED, mListOfSelectedIOMachine,
+ listOfExecutable, listOfInstance);
+
+ selectDetailsVariable(anED, mListOfAllVariable,
+ listOfExecutable, listOfInstance, listOfVariable);
+
+ selectDetailsPresburgerVariable(anED, mListOfSelectedPresburgerVariable,
+ listOfExecutable, listOfInstance, listOfVariable);
+
+ selectDetailsNonPresburgerVariable(
+ anED, mListOfSelectedNonPresburgerVariable,
+ listOfExecutable, listOfInstance, listOfVariable);
+
+ if( mListOfAllVariable.empty() )
+ {
+// AVM_OS_WARNING_ALERT
+// << "Attention la liste des variables utilisées pour le "
+// "calcul de la redondance est vide (cas DETAILS) !!!"
+// << SEND_ALERT;
+ }
+}
+
+
+static void excludeVariable(ListOfPairMachineData & includeListOfVariable,
+ ListOfExecutableForm & excludeListOfExecutable,
+ ListOfInstanceOfMachine & excludeListOfInstance,
+ ListOfInstanceOfData & excludeListOfVariable)
+{
+ ListOfExecutableForm::iterator itExec;
+ ListOfExecutableForm::iterator endExec;
+
+ ListOfInstanceOfMachine::iterator itRF;
+ ListOfInstanceOfMachine::iterator endRF;
+
+ ListOfInstanceOfData::iterator itVar;
+ ListOfInstanceOfData::iterator endVar;
+
+ bool hasEraseNothing;
+
+ ListOfPairMachineData::iterator itPairMachineData = includeListOfVariable.begin();
+ for( ; itPairMachineData != includeListOfVariable.end() ; )
+ {
+ hasEraseNothing = true;
+
+ itExec = excludeListOfExecutable.begin();
+ endExec = excludeListOfExecutable.end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ if( (*itPairMachineData).first().getExecutable() == (*itExec) )
+ {
+ itPairMachineData = includeListOfVariable.erase(itPairMachineData);
+ hasEraseNothing = false;
+ continue;
+ }
+ }
+
+ itRF = excludeListOfInstance.begin();
+ endRF = excludeListOfInstance.end();
+ for( ; itRF != endRF ; ++itRF )
+ {
+ if( (*itPairMachineData).first().getInstance() == (*itRF) )
+ {
+ itPairMachineData = includeListOfVariable.erase(itPairMachineData);
+ hasEraseNothing = false;
+ continue;
+ }
+ }
+
+ itVar = excludeListOfVariable.begin();
+ endVar = excludeListOfVariable.end();
+ for( ; itVar != endVar ; ++itVar )
+ {
+ (*itPairMachineData).second().remove( (*itVar) );
+ if( (*itPairMachineData).second().empty() )
+ {
+ itPairMachineData = includeListOfVariable.erase(itPairMachineData);
+ hasEraseNothing = false;
+ continue;
+ }
+ }
+
+ if( hasEraseNothing )
+ {
+ ++itPairMachineData;
+ }
+ }
+}
+
+
+void BaseDataComparator::computeDetailsExcludeMachineData(
+ const ExecutionData & anED,
+ ListOfExecutableForm & listOfExecutable,
+ ListOfInstanceOfMachine & listOfInstance,
+ ListOfInstanceOfData & listOfVariable)
+{
+ computeAllMachineData(anED);
+
+ excludeVariable(mListOfAllVariable,
+ listOfExecutable, listOfInstance, listOfVariable);
+
+ excludeVariable(mListOfSelectedPresburgerVariable,
+ listOfExecutable, listOfInstance, listOfVariable);
+
+ excludeVariable(mListOfSelectedNonPresburgerVariable,
+ listOfExecutable, listOfInstance, listOfVariable);
+
+}
+
+
+
+
+
+void BaseDataComparator::selectIOMachine(const ExecutionData & anED,
+ List< RuntimeID > & aListOfSelectedIOMachine)
+{
+ TableOfRuntimeT::const_iterator itRF = anED.getTableOfRuntime().begin();
+ TableOfRuntimeT::const_iterator itRFEnd = anED.getTableOfRuntime().end();
+ for( RuntimeID itRID ; itRF != itRFEnd ; ++itRF )
+ {
+ itRID = (*itRF)->getRID();
+
+ if( itRID.getExecutable()->hasBuffer() )
+ {
+ aListOfSelectedIOMachine.append( itRID );
+ }
+ }
+}
+
+void BaseDataComparator::selectDetailsIOMachine(
+ const ExecutionData & anED,
+ List< RuntimeID > & aListOfSelectedIOMachine,
+ ListOfExecutableForm & listOfExecutable,
+ ListOfInstanceOfMachine & listOfInstance)
+{
+ TableOfRuntimeT::const_iterator itRF = anED.getTableOfRuntime().begin();
+ TableOfRuntimeT::const_iterator itRFEnd = anED.getTableOfRuntime().end();
+ for( RuntimeID itRID ; itRF != itRFEnd ; ++itRF )
+ {
+ itRID = (*itRF)->getRID();
+
+ if( itRID.getExecutable()->hasBuffer()
+ && ( listOfExecutable.contains(itRID.getExecutable())
+ || listOfInstance.contains(itRID.getInstance()) ) )
+ {
+ aListOfSelectedIOMachine.append( itRID );
+ }
+ }
+}
+
+void BaseDataComparator::selectAllVariable(const ExecutionData & anED,
+ ListOfPairMachineData & aListOfSelectedVariable)
+{
+ TableOfInstanceOfData::const_raw_iterator itVar;
+ TableOfInstanceOfData::const_raw_iterator itVarEnd;
+
+ TableOfRuntimeT::const_iterator itRF = anED.getTableOfRuntime().begin();
+ TableOfRuntimeT::const_iterator itRFEnd = anED.getTableOfRuntime().end();
+ for( RuntimeForm * pRF = NULL ; itRF != itRFEnd ; ++itRF )
+ {
+ pRF = (*itRF);
+
+ if( pRF->getExecutable()->hasData() )
+ {
+ aListOfSelectedVariable.append( PairMachineData(pRF->getRID()) );
+ ListOfInstanceOfData & listOfData =
+ aListOfSelectedVariable.last().second();
+
+ itVar = pRF->getVariables().begin();
+ itVarEnd = pRF->getVariables().end();
+ for( ; itVar != itVarEnd ; ++itVar )
+ {
+ listOfData.append( (itVar) );
+ }
+
+ if( listOfData.empty() )
+ {
+ aListOfSelectedVariable.pop_last();
+ }
+ }
+ }
+}
+
+
+// todo: collecter toutes les variables dans les sous-machines ...
+//void BaseDataComparator::collectDetailsVariables(const RuntimeID & aRID,
+// ListOfPairMachineData & aListOfSelectedVariable,
+// ListOfExecutableForm & listOfExecutable,
+// ListOfInstanceOfMachine & listOfInstance)
+//{
+// PairMachineData * tmpPairMachineData = new PairMachineData(aRID);
+// TableOfInstanceOfData::const_raw_iterator itVar = aRID->getVariables().begin();
+// TableOfInstanceOfData::const_raw_iterator itVarEnd = aRID->getVariables().end();
+// for( ; itVar != itVarEnd ; ++itVar )
+// {
+// if( (itData)->anyModifierOfStateData()
+// && (itData)->hasTypeSpecifier()
+// && ((itData)->isTypedNumeric()
+// || (itData)->isTypedEnumeration()) )
+// {
+// tmpPairMachineData->second().append( (itData) );
+// }
+// }
+// if( tmpPairMachineData->second().nonempty() )
+// {
+// aListOfSelectedVariable.append(tmpPairMachineData);
+// }
+// else
+// {
+// delete( tmpPairMachineData );
+// }
+// TableOfRuntimeID::iterator itRecRID = (*itmachine)->beginChildTable() ;
+// TableOfRuntimeID::iterator itRecEnd = (*itmachine)->endChildTable() ;
+// for( ; itRecRID != itRecEnd ; ++itRecRID )
+// {
+// //itRecMachine
+// }
+//}
+
+
+
+avm_size_t BaseDataComparator::selectVariable(
+ ListOfInstanceOfData & listOfData, InstanceOfData * pData)
+{
+ if( pData->getModifier().anyModifierOfStateData() )
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( pData->hasTypeSpecifier() )
+ << "Unexpected variable << " << pData->getFullyQualifiedNameID()
+ << " >> without type specififer !!!"
+ << SEND_EXIT;
+
+ avm_size_t varCount = 0;
+
+ if( pData->isTypedNumeric() ||
+ pData->isTypedEnumeration() ||
+ pData->isTypedMachine() )
+ {
+ ++varCount;
+
+ listOfData.append( pData );
+ }
+ else if( pData->hasTypeArrayOrStructure() )
+ {
+ TableOfSymbol::iterator attrIt = pData->getAttribute()->begin();
+ TableOfSymbol::iterator attrEnd = pData->getAttribute()->end();
+ for( ; attrIt != attrEnd ; ++attrIt )
+ {
+ varCount += selectVariable(listOfData, (*attrIt).
+ data().getAliasTarget()->as< InstanceOfData >() );
+ }
+ }
+
+ return( varCount );
+ }
+
+ return( 0 );
+}
+
+
+avm_size_t BaseDataComparator::selectPresburgerVariable(
+ ListOfInstanceOfData & listOfData, InstanceOfData * pData)
+{
+ if( pData->getModifier().anyModifierOfStateData() )
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( pData->hasTypeSpecifier() )
+ << "Unexpected variable << " << pData->getFullyQualifiedNameID()
+ << " >> without type specififer !!!"
+ << SEND_EXIT;
+
+ avm_size_t varCount = 0;
+
+ if( pData->weaklyTypedInteger() ||
+ pData->isTypedEnumeration() ||
+ pData->isTypedMachine() )
+ {
+ ++varCount;
+
+ listOfData.append( pData );
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , CONFIGURING , REDUNDANCE )
+ AVM_OS_TRACE << "\tpresburger :> " << str_header( pData ) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , CONFIGURING , REDUNDANCE )
+ }
+ else if( pData->hasTypeArrayOrStructure() )
+ {
+ TableOfSymbol::iterator attrIt = pData->getAttribute()->begin();
+ TableOfSymbol::iterator attrEnd = pData->getAttribute()->end();
+ for( ; attrIt != attrEnd ; ++attrIt )
+ {
+ varCount += selectPresburgerVariable(listOfData, (*attrIt).
+ data().getAliasTarget()->as< InstanceOfData >() );
+ }
+ }
+ else
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , CONFIGURING , REDUNDANCE )
+ AVM_OS_TRACE << "\tNON presburger :> " << str_header( pData ) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , CONFIGURING , REDUNDANCE )
+ }
+
+ return( varCount );
+ }
+
+ return( 0 );
+}
+
+
+avm_size_t BaseDataComparator::selectNonPresburgerVariable(
+ ListOfInstanceOfData & listOfData, InstanceOfData * pData)
+{
+ if( pData->getModifier().anyModifierOfStateData() )
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( pData->hasTypeSpecifier() )
+ << "Unexpected variable << " << pData->getFullyQualifiedNameID()
+ << " >> without type specififer !!!"
+ << SEND_EXIT;
+
+ avm_size_t varCount = 0;
+
+ if( (not pData->weaklyTypedInteger()) &&
+ (not pData->isTypedEnumeration()) &&
+ (not pData->isTypedMachine()) )
+ {
+ ++varCount;
+
+ listOfData.append( pData );
+ }
+ else if( pData->hasTypeArrayOrStructure() )
+ {
+ TableOfSymbol::iterator attrIt = pData->getAttribute()->begin();
+ TableOfSymbol::iterator attrEnd = pData->getAttribute()->end();
+ for( ; attrIt != attrEnd ; ++attrIt )
+ {
+ selectNonPresburgerVariable(listOfData, (*attrIt).
+ data().getAliasTarget()->as< InstanceOfData >() );
+ }
+ }
+
+ return( varCount );
+ }
+
+ return( 0 );
+}
+
+
+// TODO: attention on ne prend pas en compte les SOUS-machines !!!
+void BaseDataComparator::selectDetailsVariable(const ExecutionData & anED,
+ ListOfPairMachineData & aListOfSelectedVariable,
+ ListOfExecutableForm & listOfExecutable,
+ ListOfInstanceOfMachine & listOfInstance,
+ ListOfInstanceOfData & listOfVariable)
+{
+ TableOfInstanceOfData::const_raw_iterator itVar;
+ TableOfInstanceOfData::const_raw_iterator itVarEnd;
+
+ ListOfInstanceOfData::iterator varIt;
+ ListOfInstanceOfData::iterator varEnd;
+
+ TableOfRuntimeT::const_iterator itRF = anED.getTableOfRuntime().begin();
+ TableOfRuntimeT::const_iterator itRFEnd = anED.getTableOfRuntime().end();
+ for( RuntimeForm * pRF = NULL ; itRF != itRFEnd ; ++itRF )
+ {
+ pRF = (*itRF);
+
+ if( pRF->getExecutable()->hasData() )
+ {
+ if( listOfInstance.contains(pRF->getInstance()) ||
+ listOfExecutable.contains(pRF->getExecutable()) )
+ {
+ aListOfSelectedVariable.append(
+ PairMachineData(pRF->getRID()) );
+ ListOfInstanceOfData & listOfData =
+ aListOfSelectedVariable.last().second();
+
+ itVar = pRF->getVariables().begin();
+ itVarEnd = pRF->getVariables().end();
+ for( ; itVar != itVarEnd ; ++itVar )
+ {
+ selectVariable(listOfData, (itVar));
+ }
+
+ // TODO: parcourir les children
+// TableOfRuntimeID::iterator itRecMachine = (*itmachine)->beginChildTable() ;
+// TableOfRuntimeID::iterator itRecEnd = (*itmachine)->endChildTable() ;
+// for( ; itRecMachine != itRecEnd ; ++itRecMachine )
+// {
+// }
+ }
+ else
+ {
+ aListOfSelectedVariable.append(
+ PairMachineData(pRF->getRID()) );
+ ListOfInstanceOfData & listOfData =
+ aListOfSelectedVariable.last().second();
+
+ varIt = listOfVariable.begin();
+ varEnd = listOfVariable.end();
+ for( ; varIt != varEnd ; ++varIt )
+ {
+ if( pRF->getExecutable()->containsAllData(*varIt) )
+ {
+ selectVariable(listOfData, (*varIt));
+ }
+ }
+
+ if( listOfData.empty() )
+ {
+ aListOfSelectedVariable.pop_last();
+ }
+ }
+ }
+ }
+}
+
+
+void BaseDataComparator::selectPresburgerVariable(const ExecutionData & anED,
+ ListOfPairMachineData & aListOfSelectedVariable)
+{
+ avm_size_t varCount = 0;
+
+ TableOfInstanceOfData::const_raw_iterator itVar;
+ TableOfInstanceOfData::const_raw_iterator itVarEnd;
+
+ TableOfRuntimeT::const_iterator itRF = anED.getTableOfRuntime().begin();
+ TableOfRuntimeT::const_iterator itRFEnd = anED.getTableOfRuntime().end();
+ for( RuntimeID itRID ; itRF != itRFEnd ; ++itRF )
+ {
+ itRID = (*itRF)->getRID();
+
+ if( itRID.getExecutable()->hasData() )
+ {
+ aListOfSelectedVariable.append( PairMachineData(itRID) );
+ ListOfInstanceOfData & listOfData = aListOfSelectedVariable.last().second();
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , CONFIGURING , REDUNDANCE )
+ AVM_OS_TRACE << "presburger machine :> " << itRID.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , CONFIGURING , REDUNDANCE )
+
+ itVar = itRID.getExecutable()->getBasicData().begin();
+ itVarEnd = itRID.getExecutable()->getBasicData().end();
+ for( ; itVar != itVarEnd ; ++itVar )
+ {
+ varCount += selectPresburgerVariable(listOfData, (itVar));
+ }
+
+ if( listOfData.empty() )
+ {
+ aListOfSelectedVariable.pop_last();
+ }
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , CONFIGURING , REDUNDANCE )
+ AVM_OS_TRACE << "Total:> " << varCount << std::endl << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , CONFIGURING , REDUNDANCE )
+}
+
+
+void BaseDataComparator::selectDetailsPresburgerVariable(
+ const ExecutionData & anED,
+ ListOfPairMachineData & aListOfSelectedVariable,
+ ListOfExecutableForm & listOfExecutable,
+ ListOfInstanceOfMachine & listOfInstance,
+ ListOfInstanceOfData & listOfVariable)
+{
+ avm_size_t varCount = 0;
+
+ TableOfInstanceOfData::const_raw_iterator itVar;
+ TableOfInstanceOfData::const_raw_iterator itVarEnd;
+
+ ListOfInstanceOfData::iterator varIt;
+ ListOfInstanceOfData::iterator varEnd;
+
+ TableOfRuntimeT::const_iterator itRF = anED.getTableOfRuntime().begin();
+ TableOfRuntimeT::const_iterator itRFEnd = anED.getTableOfRuntime().end();
+ for( RuntimeID itRID ; itRF != itRFEnd ; ++itRF )
+ {
+ itRID = (*itRF)->getRID();
+
+ if( itRID.getExecutable()->hasData() )
+ {
+ if( listOfExecutable.contains(itRID.getExecutable()) ||
+ listOfInstance.contains(itRID.getInstance()))
+ {
+ aListOfSelectedVariable.append( PairMachineData(itRID) );
+ ListOfInstanceOfData & listOfData = aListOfSelectedVariable.last().second();
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , CONFIGURING , REDUNDANCE )
+ AVM_OS_TRACE << "presburger machine :> " << itRID.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , CONFIGURING , REDUNDANCE )
+
+ itVar = itRID.getExecutable()->getBasicData().begin();
+ itVarEnd = itRID.getExecutable()->getBasicData().end();
+ for( ; itVar != itVarEnd ; ++itVar )
+ {
+ varCount += selectPresburgerVariable(listOfData, (itVar));
+ }
+
+ if( listOfData.empty() )
+ {
+ aListOfSelectedVariable.pop_last();
+ }
+ }
+ else
+ {
+ aListOfSelectedVariable.append(
+ PairMachineData(itRID) );
+ ListOfInstanceOfData & listOfData =
+ aListOfSelectedVariable.last().second();
+
+ varIt = listOfVariable.begin();
+ varEnd = listOfVariable.end();
+ for( ; varIt != varEnd ; ++varIt )
+ {
+ if( itRID.getExecutable()->containsAllData(*varIt) )
+ {
+ varCount += selectPresburgerVariable(listOfData, (*varIt));
+ }
+ }
+
+ if( listOfData.empty() )
+ {
+ aListOfSelectedVariable.pop_last();
+ }
+ }
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , CONFIGURING , REDUNDANCE )
+ AVM_OS_TRACE << "Total:> " << varCount << std::endl << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , CONFIGURING , REDUNDANCE )
+
+}
+
+void BaseDataComparator::selectNonPresburgerVariable(
+ const ExecutionData & anED,
+ ListOfPairMachineData & aListOfSelectedVariable)
+{
+ TableOfInstanceOfData::const_raw_iterator itVar;
+ TableOfInstanceOfData::const_raw_iterator itVarEnd;
+
+ TableOfRuntimeT::const_iterator itRF = anED.getTableOfRuntime().begin();
+ TableOfRuntimeT::const_iterator endRF = anED.getTableOfRuntime().end();
+ for( RuntimeForm * pRF = NULL ; itRF != endRF ; ++itRF )
+ {
+ pRF = (*itRF);
+
+ if( pRF->getExecutable()->hasData() )
+ {
+ aListOfSelectedVariable.append(
+ PairMachineData(pRF->getRID()) );
+ ListOfInstanceOfData & listOfData =
+ aListOfSelectedVariable.last().second();
+
+// AVM_OS_TRACE << "presburger machine :> "
+// << itRID.str() << std::endl;
+
+ itVar = pRF->getVariables().begin();
+ itVarEnd = pRF->getVariables().end();
+ for( ; itVar != itVarEnd ; ++itVar )
+ {
+ selectNonPresburgerVariable(listOfData, (itVar));
+ }
+
+ if( listOfData.empty() )
+ {
+ aListOfSelectedVariable.pop_last();
+ }
+ }
+ }
+}
+
+
+void BaseDataComparator::selectDetailsNonPresburgerVariable(
+ const ExecutionData & anED,
+ ListOfPairMachineData & aListOfSelectedVariable,
+ ListOfExecutableForm & listOfExecutable,
+ ListOfInstanceOfMachine & listOfInstance,
+ ListOfInstanceOfData & listOfVariable)
+{
+ TableOfInstanceOfData::const_raw_iterator itVar;
+ TableOfInstanceOfData::const_raw_iterator itVarEnd;
+
+ ListOfInstanceOfData::iterator varIt;
+ ListOfInstanceOfData::iterator varEnd;
+
+ TableOfRuntimeT::const_iterator itRF = anED.getTableOfRuntime().begin();
+ TableOfRuntimeT::const_iterator endRF = anED.getTableOfRuntime().end();
+ for( RuntimeForm * pRF = NULL ; itRF != endRF ; ++itRF )
+ {
+ pRF = (*itRF);
+
+ if( pRF->getExecutable()->hasData() )
+ {
+ if( listOfExecutable.contains(pRF->getExecutable()) ||
+ listOfInstance.contains(pRF->getInstance()) )
+ {
+ aListOfSelectedVariable.append(
+ PairMachineData(pRF->getRID()) );
+ ListOfInstanceOfData & listOfData =
+ aListOfSelectedVariable.last().second();
+
+// AVM_OS_TRACE << "Non presburger machine :> "
+// << itRID.str() << std::endl;
+
+ itVar = pRF->getVariables().begin();
+ itVarEnd = pRF->getVariables().end();
+ for( ; itVar != itVarEnd ; ++itVar )
+ {
+ selectNonPresburgerVariable(listOfData, (itVar));
+ }
+
+ if( listOfData.empty() )
+ {
+ aListOfSelectedVariable.pop_last();
+ }
+ }
+ else
+ {
+ aListOfSelectedVariable.append(
+ PairMachineData(pRF->getRID()) );
+ ListOfInstanceOfData & listOfData =
+ aListOfSelectedVariable.last().second();
+
+ varIt = listOfVariable.begin();
+ varEnd = listOfVariable.end();
+ for( ; varIt != varEnd ; ++varIt )
+ {
+ selectNonPresburgerVariable(listOfData, (*varIt));
+ }
+
+ if( listOfData.empty() )
+ {
+ aListOfSelectedVariable.pop_last();
+ }
+ }
+ }
+ }
+}
+
+
+/*
+ * REFRESH CURRENT PRESBURGER VARIABLE
+ */
+
+void BaseDataComparator::refreshCurrentVariables(
+ ListOfPairMachineData & currentVariables,
+ ListOfPairMachineData & referenceVariables,
+ const ExecutionData & newED, const ExecutionData & oldED)
+{
+ currentVariables.clear();
+
+ ListOfInstanceOfData::iterator itVar;
+ ListOfInstanceOfData::iterator endVar;
+
+ ListOfPairMachineData::iterator itPairMachineData = referenceVariables.begin();
+ ListOfPairMachineData::iterator endPairMachineData = referenceVariables.end();
+ for( ; itPairMachineData != endPairMachineData ; ++itPairMachineData )
+ {
+ if( (*itPairMachineData).second().nonempty() )
+ {
+ const RuntimeForm & newRF =
+ newED.getRuntime( (*itPairMachineData).first() );
+ const RuntimeForm & oldRF =
+ oldED.getRuntime( (*itPairMachineData).first() );
+
+ currentVariables.append( PairMachineData(newRF.getRID()) );
+ ListOfInstanceOfData & listOfData = currentVariables.last().second();
+
+ itVar = (*itPairMachineData).second().begin();
+ endVar = (*itPairMachineData).second().end();
+ for( ; itVar != endVar ; ++itVar )
+ {
+ if( not ExpressionComparer::isTEQ(
+ newRF.getData( (*itVar)->getOffset() ),
+ oldRF.getData( (*itVar)->getOffset() )) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , CONFIGURING , REDUNDANCE )
+ AVM_OS_TRACE << "current var :> " << newRF.getRID().str()
+ << ":" << (*itVar)->getNameID() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , CONFIGURING , REDUNDANCE )
+
+ listOfData.append( (*itVar) );
+ }
+ }
+
+ if( listOfData.empty() )
+ {
+ currentVariables.pop_last();
+ }
+ }
+ }
+}
+
+
+/*
+ * COMPARE
+ */
+bool BaseDataComparator::compareIO(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+{
+ newED = newEC.getExecutionData();
+ oldED = oldEC.getExecutionData();
+
+ TableOfBufferT::const_iterator itNewBuf;
+ TableOfBufferT::const_iterator itNewBufEnd;
+
+ TableOfBufferT::const_iterator itOldBuf;
+
+ // compare BUFFER
+ List< RuntimeID >::const_iterator itRID = getSelectedIOMachine().begin();
+ List< RuntimeID >::const_iterator endRID = getSelectedIOMachine().end();
+ for( ; itRID != endRID ; ++itRID )
+ {
+ newRF = newED->ptrRuntime( *itRID );
+ oldRF = oldED->ptrRuntime( *itRID );
+
+ if( newRF->hasBuffer()
+ && (newRF->getBufferTable() != oldRF->getBufferTable()) )
+ {
+ itNewBuf = newRF->getBufferTable().begin();
+ itNewBufEnd = newRF->getBufferTable().end();
+ itOldBuf = oldRF->getBufferTable().begin();
+ for( ; itNewBuf != itNewBufEnd ; ++itNewBuf, ++itOldBuf )
+ {
+ if( ((*itNewBuf) != (*itOldBuf))
+ && (not compareBUFFER(*itNewBuf, *itOldBuf)) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , REDUNDANCE )
+ AVM_OS_COUT << "oldRF :> " << oldRF->getRID().str() << std::endl;
+ oldRF->getBufferTable().toStream(AVM_OS_COUT);
+
+ AVM_OS_COUT << "newRF :> " << newRF->getRID().str() << std::endl;
+ newRF->getBufferTable().toStream(AVM_OS_COUT);
+
+ AVM_OS_COUT << ">>>>>>> false <<<<<<<" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , REDUNDANCE )
+
+ return( false );
+ }
+ }
+ }
+ }
+
+ return( true );
+}
+
+
+bool BaseDataComparator::compareBUFFER(
+ const BaseBufferForm * newBuf, const BaseBufferForm * oldBuf)
+{
+ switch( newBuf->classKind() )
+ {
+ case FORM_BUFFER_FIFO_KIND:
+ case FORM_BUFFER_LIFO_KIND:
+ {
+ const BaseBufferQueue * newMsgList = newBuf->to< BaseBufferQueue >();
+ const BaseBufferQueue * oldMsgList = oldBuf->to< BaseBufferQueue >();
+
+ if( newMsgList->nonempty()
+ && (newMsgList->size() == oldMsgList->size()) )
+ {
+ ListOfMessage::
+ const_iterator itNewMsg = newMsgList->beginMessages();
+ ListOfMessage::
+ const_iterator itNewMsgEnd = newMsgList->endMessages();
+ ListOfMessage::
+ const_iterator itOldMsg = oldMsgList->beginMessages();
+ for( ; itNewMsg != itNewMsgEnd ; ++itNewMsg, ++itOldMsg )
+ {
+ if( ((*itNewMsg) != (*itOldMsg))
+ && (not compareMESSAGE((*itNewMsg), (*itOldMsg))) )
+ {
+ return( false );
+ }
+ }
+ return( true );
+ }
+ return( newMsgList->empty() );
+ }
+
+ case FORM_BUFFER_MULTISET_KIND:
+ case FORM_BUFFER_SET_KIND:
+ { // TODO correct comparaison
+ const BaseBufferQueue * newMsgList = newBuf->to< BaseBufferQueue >();
+ const BaseBufferQueue * oldMsgList = oldBuf->to< BaseBufferQueue >();
+
+ if( newMsgList->size() == oldMsgList->size() )
+ {
+ ListOfMessage::
+ const_iterator itNewMsg = newMsgList->beginMessages();
+ ListOfMessage::
+ const_iterator itNewMsgEnd = newMsgList->endMessages();
+ ListOfMessage::
+ const_iterator itOldMsg = oldMsgList->beginMessages();
+ for( ; itNewMsg != itNewMsgEnd ; ++itNewMsg, ++itOldMsg )
+ {
+ if( ((*itNewMsg) != (*itOldMsg))
+ && (not compareMESSAGE((*itNewMsg), (*itOldMsg))) )
+ {
+ return( false );
+ }
+ }
+ return( true );
+ }
+ return( newMsgList->empty() );
+ }
+
+ case FORM_BUFFER_BROADCAST_KIND:
+ case FORM_BUFFER_RAM_KIND:
+ {
+ return( compareMESSAGE(
+ newBuf->to< RamBuffer >()->top(),
+ oldBuf->to< RamBuffer >()->top() ) );
+ }
+
+ default :
+ {
+ return( true );
+ }
+ }
+
+ return( true );
+}
+
+
+bool BaseDataComparator::compareMESSAGE(
+ const Message & newMsg, const Message & oldMsg)
+{
+ if( newMsg.getMID() == oldMsg.getMID() )
+ {
+// BFVector::const_iterator itNew = newMsg->begin();
+// BFVector::const_iterator itNewEnd = newMsg->end();
+// BFVector::const_iterator itOld = oldMsg->begin();
+// for( ; itNew != itNewEnd ; ++itNew, ++itOld )
+// {
+// if( not ExpressionComparer::isEQ(*itNew, *itOld) )
+// {
+// return( false );
+// }
+// }
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+
+bool BaseDataComparator::compare(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+{
+ if( mMachineCount != newEC.refExecutionData().getTableOfRuntime().size() )
+ {
+ mMachineCount = newEC.refExecutionData().getTableOfRuntime().size();
+
+ computeAllMachineData( newEC.refExecutionData() );
+ }
+
+ ++mComparisonCount;
+
+ if( compareTEQ(newEC, oldEC) )
+ {
+ return( true );
+ }
+ else if( mUseCommunication || mUseVariable )
+ {
+ return( (mUseCommunication ? compareIO(newEC, oldEC) : true)
+ && (mUseVariable ? compareDATA(newEC, oldEC) : true) );
+ }
+
+ return( true );
+}
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// TRIVIALLY DATA COMPARATOR
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool TriviallyDataComparison::compareDATA(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+{
+ newED = newEC.getExecutionData();
+ oldED = oldEC.getExecutionData();
+
+ // compare PC
+ if( mIgnorePathCondition || ExpressionComparer::isTEQ(
+ newED->getPathCondition(), oldED->getPathCondition() ) )
+ {
+ // compare DATAs
+ itPairMachineData = getAllVariable().begin();
+ endPairMachineData = getAllVariable().end();
+ for( ; itPairMachineData != endPairMachineData ; ++itPairMachineData )
+ {
+ if( (*itPairMachineData).second().nonempty() )
+ {
+ newRF = newED->ptrRuntime( (*itPairMachineData).first() );
+ oldRF = oldED->ptrRuntime( (*itPairMachineData).first() );
+
+ if( newRF->getDataTable() != oldRF->getDataTable() )
+ {
+ itVar = (*itPairMachineData).second().begin();
+ endVar = (*itPairMachineData).second().end();
+ for( ; itVar != endVar ; ++itVar )
+ {
+ if( not ExpressionComparer::isTEQ(
+ newRF->getData((*itVar)->getOffset()),
+ oldRF->getData((*itVar)->getOffset())) )
+ {
+ return( false );
+ }
+ }
+ }
+ }
+ }
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fam/redundancy/BaseDataComparator.h b/org.eclipse.efm.symbex/src/fam/redundancy/BaseDataComparator.h
new file mode 100644
index 0000000..00a4f70
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/redundancy/BaseDataComparator.h
@@ -0,0 +1,429 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef BaseDataComparator_H_
+#define BaseDataComparator_H_
+
+#include <collection/Typedef.h>
+
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+
+class BaseBufferForm;
+class Configuration;
+class ExecutableSystem;
+class Message;
+class RuntimeForm;
+
+
+class BaseDataComparator
+{
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ Configuration & mConfiguration;
+
+ avm_size_t mMachineCount;
+
+ bool mCurrentPathScopeFlag;
+
+ avm_size_t mComparisonCount;
+
+
+ List< RuntimeID > mListOfSelectedIOMachine;
+
+ ListOfPairMachineData mListOfAllVariable;
+
+
+ ListOfPairMachineData mListOfSelectedPresburgerVariable;
+
+ ListOfPairMachineData mListOfCurrentPresburgerVariable;
+
+ ListOfPairMachineData mListOfSelectedNonPresburgerVariable;
+
+ // Heuristic
+ bool mUseCommunication;
+ bool mUseVariable;
+ bool mIgnorePathCondition;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing Variables
+ ExecutionData * newED;
+ ExecutionData * oldED;
+
+ const RuntimeForm * newRF;
+ const RuntimeForm * oldRF;
+
+ ListOfPairMachineData::iterator itPairMachineData;
+ ListOfPairMachineData::iterator endPairMachineData;
+
+ ListOfInstanceOfData::iterator itVar;
+ ListOfInstanceOfData::iterator endVar;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BaseDataComparator(Configuration & aConfiguration)
+ : mConfiguration( aConfiguration ),
+ mMachineCount( 0 ),
+ mCurrentPathScopeFlag( false ),
+ mComparisonCount( 0 ),
+
+ mListOfSelectedIOMachine( ),
+ mListOfAllVariable( ),
+
+ mListOfSelectedPresburgerVariable( ),
+ mListOfCurrentPresburgerVariable( ),
+ mListOfSelectedNonPresburgerVariable( ),
+
+ // Heuristic
+ mUseCommunication( true ),
+ mUseVariable( true ),
+ mIgnorePathCondition( false ),
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing Variables
+ newED( NULL ),
+ oldED( NULL ),
+
+ newRF( NULL ),
+ oldRF( NULL ),
+
+ itPairMachineData( ),
+ endPairMachineData( ),
+
+ itVar( ),
+ endVar( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BaseDataComparator()
+ {
+ destroyMachineData();
+ }
+
+ void destroyMachineData();
+
+
+ /**
+ * CONFIGURE
+ */
+ virtual bool configure(WObject * wfParameterObject);
+
+ void computeAllMachineData(const ExecutionData & anED);
+
+ void computeDetailsIncludeMachineData(const ExecutionData & anED,
+ ListOfExecutableForm & listOfExecutable,
+ ListOfInstanceOfMachine & listOfInstance,
+ ListOfInstanceOfData & listOfVariable);
+
+ void computeDetailsExcludeMachineData(const ExecutionData & anED,
+ ListOfExecutableForm & listOfExecutable,
+ ListOfInstanceOfMachine & listOfInstance,
+ ListOfInstanceOfData & listOfVariable);
+
+
+ /*
+ * COMPARE
+ */
+ inline virtual bool compareDATA(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+ {
+ return( true );
+ }
+
+ virtual bool compareIO(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC);
+
+ virtual bool compareBUFFER(
+ const BaseBufferForm * newBuf, const BaseBufferForm *oldBuf);
+
+ virtual bool compareMESSAGE(
+ const Message & newMsg, const Message & oldMsg);
+
+
+ inline virtual bool compareTEQ(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+ {
+ return( newEC.getExecutionData() == oldEC.getExecutionData() );
+ }
+
+ virtual bool compare(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC);
+
+
+ /**
+ * GETTER - SETTER
+ * mCurrentPathScopeFlag
+ */
+ inline bool isCurrentPathScope()
+ {
+ return( mCurrentPathScopeFlag );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * the List Of Selected Machine and Variable
+ */
+
+ // IO Machine
+ inline const List< RuntimeID > & getSelectedIOMachine()
+ {
+ return( mListOfSelectedIOMachine );
+ }
+
+ static void selectDetailsIOMachine(const ExecutionData & anED,
+ List< RuntimeID > & aListOfSelectedIOMachine,
+ ListOfExecutableForm & listOfExecutable,
+ ListOfInstanceOfMachine & listOfInstance);
+
+ static void selectIOMachine(const ExecutionData & anED,
+ List< RuntimeID > & aListOfSelectedIOMachine);
+
+
+ // ALL Variable
+ inline ListOfPairMachineData & getAllVariable()
+ {
+ return( mListOfAllVariable );
+ }
+
+ static void selectAllVariable(const ExecutionData & anED,
+ ListOfPairMachineData & aListOfSelectedVariable);
+
+
+ static avm_size_t selectVariable(
+ ListOfInstanceOfData & listOfData, InstanceOfData * pData);
+
+ static avm_size_t selectPresburgerVariable(
+ ListOfInstanceOfData & listOfData, InstanceOfData * pData);
+
+ static avm_size_t selectNonPresburgerVariable(
+ ListOfInstanceOfData & listOfData, InstanceOfData * pData);
+
+
+ static void selectDetailsVariable(const ExecutionData & anED,
+ ListOfPairMachineData & aListOfSelectedVariable,
+ ListOfExecutableForm & listOfExecutable,
+ ListOfInstanceOfMachine & listOfInstance,
+ ListOfInstanceOfData & listOfVariable);
+
+
+ // PRESBURGER Variable
+ inline ListOfPairMachineData & getSelectedPresburgerVariable()
+ {
+ return( mListOfSelectedPresburgerVariable );
+ }
+
+ static void selectPresburgerVariable(const ExecutionData & anED,
+ ListOfPairMachineData & aListOfSelectedVariable);
+
+ static void selectDetailsPresburgerVariable(const ExecutionData & anED,
+ ListOfPairMachineData & aListOfSelectedVariable,
+ ListOfExecutableForm & listOfExecutable,
+ ListOfInstanceOfMachine & listOfInstance,
+ ListOfInstanceOfData & listOfVariable);
+
+
+ inline ListOfPairMachineData & getCurrentPresburgerVariable()
+ {
+ return( mListOfCurrentPresburgerVariable );
+ }
+
+ static void refreshCurrentVariables(
+ ListOfPairMachineData & currentVariables,
+ ListOfPairMachineData & referenceVariables,
+ const ExecutionData & newED, const ExecutionData & oldED);
+
+ // NON PRESBURGER Variable
+ inline ListOfPairMachineData & getSelectedNonPresburgerVariable()
+ {
+ return( mListOfSelectedNonPresburgerVariable );
+ }
+
+
+ static void selectNonPresburgerVariable(const ExecutionData & anED,
+ ListOfPairMachineData & aListOfSelectedVariable);
+
+ static void selectDetailsNonPresburgerVariable(const ExecutionData & anED,
+ ListOfPairMachineData & aListOfSelectedVariable,
+ ListOfExecutableForm & listOfExecutable,
+ ListOfInstanceOfMachine & listOfInstance,
+ ListOfInstanceOfData & listOfVariable);
+
+
+ inline virtual bool hasVariableComparison()
+ {
+ return( (mMachineCount > 0) && mListOfAllVariable.nonempty() );
+ }
+
+ /**
+ * strComparer
+ */
+ virtual std::string strComparer() const = 0;
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// TRIVIALLY DATA COMPARATOR
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class TriviallyDataComparison : public BaseDataComparator
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TriviallyDataComparison(Configuration & aConfiguration)
+ : BaseDataComparator( aConfiguration )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~TriviallyDataComparison()
+ {
+ //!! NOTHING
+ }
+
+
+ /*
+ * COMPARE
+ */
+ virtual bool compareDATA(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC);
+
+ virtual bool compare(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+ {
+ return( (newEC.getExecutionData() == oldEC.getExecutionData())
+ || (mUseVariable ? compareDATA(newEC, oldEC) : true) );
+ }
+
+ /**
+ * strComparer
+ */
+ inline virtual std::string strComparer() const
+ {
+ return( "=&= i.e. TEQ" );
+ }
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// NONE DATA COMPARATOR
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class NoneDataComparison : public BaseDataComparator
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ NoneDataComparison(Configuration & aConfiguration)
+ : BaseDataComparator( aConfiguration )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~NoneDataComparison()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONFIGURE
+ */
+ inline virtual bool configure(WObject * wfFilterObject)
+ {
+ return( true );
+ }
+
+
+ /*
+ * COMPARE
+ */
+ inline virtual bool compareDATA(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+ {
+ return( true );
+ }
+
+ inline virtual bool compareIO(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+ {
+ return( true );
+ }
+
+ inline virtual bool compareBUFFER(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+ {
+ return( true );
+ }
+
+ inline virtual bool compareMESSAGE(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+ {
+ return( true );
+ }
+
+
+ inline virtual bool compare(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+ {
+ return( true );
+ }
+
+ /**
+ * strComparer
+ */
+ inline virtual std::string strComparer() const
+ {
+ return( "NONE" );
+ }
+
+};
+
+
+}
+
+#endif /*BaseDataComparator_H_*/
diff --git a/org.eclipse.efm.symbex/src/fam/redundancy/ConfigurationComparator.cpp b/org.eclipse.efm.symbex/src/fam/redundancy/ConfigurationComparator.cpp
new file mode 100644
index 0000000..f049584
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/redundancy/ConfigurationComparator.cpp
@@ -0,0 +1,354 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "ConfigurationComparator.h"
+
+#include <fam/redundancy/RedundancyFilter.h>
+
+#include <fml/executable/ExecutableQuery.h>
+
+#include <fml/runtime/ExecutionConfiguration.h>
+#include <fml/runtime/RuntimeID.h>
+#include <fml/runtime/TableOfRuntimeFormState.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <sew/Configuration.h>
+
+
+namespace sep
+{
+
+
+bool BaseConfigurationComparator::equals(
+ const ExecutionData & firstED, const BF & firstSchedule,
+ const ExecutionData & sndED , const BF & sndSchedule)
+{
+ return( firstED.getRuntimeFormStateTable()->
+ equalsState( sndED.getRuntimeFormStateTable() ) );
+}
+
+/*!ALTERNATIVE!*
+bool BaseConfigurationComparator::equals2(
+ const ExecutionData & firstED, const BF & firstSchedule,
+ const ExecutionData & sndED , const BF & sndSchedule)
+{
+ if( firstSchedule.valid() && sndSchedule.valid() )
+ {
+// AVM_OS_TRACE << "Compare :" << std::endl;
+// AVM_OS_TRACE << "\t" << firstSchedule->str() << std::endl;
+// AVM_OS_TRACE << "\t" << sndSchedule->str() << std::endl;
+
+ if( firstSchedule == sndSchedule )
+ {
+ if( firstSchedule.is< RuntimeID >() )
+ {
+ return( equals(
+ firstED, firstED.getRuntime(
+ firstSchedule.bfRID() ).getOnSchedule(),
+ sndED, sndED.getRuntime(
+ sndSchedule.bfRID() ).getOnSchedule()) );
+ }
+ else if( firstSchedule.is< AvmCode >() )
+ {
+ AvmCode * scheduleCode = firstSchedule.to_ptr< AvmCode >();
+
+ AvmCode::iterator it = scheduleCode->begin();
+ for( ; it != scheduleCode->end() ; ++it )
+ {
+ if( not equals(firstED, *it, sndED, *it) )
+ {
+ return( false );
+ }
+ }
+ return( true );
+ }
+ else
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Unexpected Schedule Element Type << "
+ << firstSchedule.str() << " >> !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ else if( firstSchedule.classKind() == sndSchedule.classKind() )
+ {
+ if( firstSchedule.is< RuntimeID >() )
+ {
+ return( (firstSchedule == sndSchedule)&& equals(
+ firstED, firstED.getRuntime(
+ firstSchedule.bfRID() ).getOnSchedule(),
+ sndED, sndED.getRuntime(
+ sndSchedule.bfRID() ).getOnSchedule()) );
+ }
+ else if( firstSchedule.is< AvmCode >() )
+ {
+ AvmCode * firstCode = firstSchedule.to_ptr< AvmCode >();
+ AvmCode * sndCode = sndSchedule.to_ptr< AvmCode >();
+
+ if( (firstCode->sameOperator( sndCode )) &&
+ (firstCode->size() == sndCode->size()) )
+ {
+ AvmCode::iterator itFirst = firstCode->begin();
+ AvmCode::iterator itSnd = sndCode->begin();
+ for( ; itFirst != firstCode->end() ; ++itFirst , ++itSnd )
+ {
+ if( not equals(firstED, *itFirst, sndED, *itSnd) )
+ {
+ return( false );
+ }
+ }
+ return( true );
+ }
+
+ return( false );
+ }
+ else
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Unexpected Schedule Element Type!!!!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ return( firstSchedule == sndSchedule );
+ }
+}
+*!ALTERNATIVE!*/
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// ALL CONFIGURATION COMPARATOR
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool AllConfigurationComparator::equals(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+{
+ if( ((& newEC) == (& oldEC))
+ || (newEC.getExecutionData() == oldEC.getExecutionData()) )
+ {
+ return( true );
+ }
+
+ if( newEC.refExecutionData().getTableOfRuntime().size() !=
+ oldEC.refExecutionData().getTableOfRuntime().size() )
+ {
+ return( false );
+ }
+
+
+ return( equals(newEC.refExecutionData(),
+ newEC.refExecutionData().getOnSchedule(),
+ oldEC.refExecutionData(),
+ oldEC.refExecutionData().getOnSchedule() ) );
+
+// return( strStateConf(newEC.getExecutionData()) ==
+// strStateConf(oldEC.getExecutionData()) );
+}
+
+
+
+bool AllConfigurationComparator::equals(
+ const ExecutionData & firstED, const BF & firstSchedule,
+ const ExecutionData & sndED, const BF & sndSchedule)
+{
+ return( firstED.getRuntimeFormStateTable()->
+ equalsState( sndED.getRuntimeFormStateTable() ) );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// DETAILS CONFIGURATION COMPARATOR
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool DetailConfigurationComparator::configure(WObject * wfParameterObject)
+{
+ WObject * theDETAILS = Query::getRegexWSequence(wfParameterObject,
+ OR_WID2("control_state", "CONTROL_STATE"), wfParameterObject);
+
+ if( theDETAILS != WObject::_NULL_ )
+ {
+ const ExecutionData & theED = mConfiguration.getMainExecutionData();
+
+ ExecutableForm * anExecutable = NULL;
+
+ ListOfExecutableForm listOfExecutable;
+ ListOfInstanceOfMachine listOfInstance;
+
+ ExecutableQuery XQuery( mConfiguration );
+
+ WObject::const_iterator itWfO = theDETAILS->owned_begin();
+ WObject::const_iterator endWfO = theDETAILS->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty() )
+ {
+ const std::string & kind = (*itWfO)->getNameID();
+ const std::string & qnid = (*itWfO)->toStringValue();
+
+ if( (kind == "model") || (kind == "form") )
+ {
+ anExecutable = XQuery.getExecutable(
+ qnid ).to_ptr< ExecutableForm >();
+ if( anExecutable != NULL )
+ {
+ listOfExecutable.append(anExecutable);
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound the machine "<< kind << " << "
+ << qnid << " >> as processor parameter:> "
+ << wfParameterObject->strHeader()
+ << std::endl;
+ }
+ }
+ else if( kind == "instance" )
+ {
+ const BF & anInstance = XQuery.getMachine(
+ Specifier::DESIGN_INSTANCE_KIND, qnid );
+ if( anInstance.valid() )
+ {
+ listOfInstance.append(
+ anInstance.to_ptr< InstanceOfMachine >());
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound the machine " << kind << " << "
+ << qnid << " >> as processor parameter:> "
+ << wfParameterObject->strHeader()
+ << std::endl;
+ }
+ }
+ else
+ {
+ AVM_OS_WARN << "Unexpected attribute << "
+ << (*itWfO)->str()
+ << " >> as processor parameter:> "
+ << wfParameterObject->strHeader()
+ << std::endl;
+ }
+ }
+ }
+
+ computeIgnoreMachine(theED, listOfExecutable, listOfInstance);
+
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound section << DETAILS >> as state scope parameter";
+ }
+
+ return( true );
+
+}
+
+
+void DetailConfigurationComparator::appendFamilyMachine(
+ const ExecutionData & anED, const RuntimeID & aRID)
+{
+ if( aRID.invalid() )
+ {
+ return;
+ }
+
+ mListOfIgnoreMachine.append(aRID);
+
+ const RuntimeForm & aRF = anED.getRuntime(aRID);
+ if( aRF.hasChild() )
+ {
+ TableOfRuntimeID::const_iterator it = aRF.beginChild();
+ TableOfRuntimeID::const_iterator endIt = aRF.endChild();
+ for( ; it != endIt ; ++it )
+ {
+ appendFamilyMachine( anED , anED.getRuntime(*it).getRID() );
+ }
+ }
+}
+
+
+void DetailConfigurationComparator::computeIgnoreMachine(
+ const ExecutionData & anED, ListOfExecutableForm & listOfExecutable,
+ ListOfInstanceOfMachine & listOfInstance)
+{
+ ListOfInstanceOfMachine::iterator itMachine = listOfInstance.begin();
+ for( ; itMachine != listOfInstance.end() ; ++itMachine )
+ {
+ appendFamilyMachine( anED , anED.getRuntimeID(*itMachine) );
+ }
+}
+
+
+
+bool DetailConfigurationComparator::equals(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+{
+ if( restrictedRunnableElementTrace(newEC.getRunnableElementTrace()) )
+ {
+ return( false );
+ }
+ else
+ {
+ return( newEC.refExecutionData().getRuntimeFormStateTable()->equalsState(
+ oldEC.refExecutionData().getRuntimeFormStateTable() ) );
+ }
+}
+
+
+bool DetailConfigurationComparator::restrictedRunnableElementTrace(const BF & form)
+{
+ if( form.is< ExecutionConfiguration >() )
+ {
+ ExecutionConfiguration * aConf = form.to_ptr< ExecutionConfiguration >();
+
+ return( mListOfIgnoreMachine.contains(aConf->getRuntimeID()) );
+ }
+
+ else if( form.is< AvmCode >() )
+ {
+ AvmCode * aCode = form.to_ptr< AvmCode >();
+
+ AvmCode::iterator itCode = aCode->begin();
+ for( ; itCode != aCode->end() ; ++itCode )
+ {
+ if( not restrictedRunnableElementTrace(*itCode) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+
+ else
+ {
+ return( true );
+ }
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fam/redundancy/ConfigurationComparator.h b/org.eclipse.efm.symbex/src/fam/redundancy/ConfigurationComparator.h
new file mode 100644
index 0000000..433a4a7
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/redundancy/ConfigurationComparator.h
@@ -0,0 +1,230 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef CONFIGURATIONCOMPARATOR_H_
+#define CONFIGURATIONCOMPARATOR_H_
+
+#include "BaseDataComparator.h"
+
+#include <fml/runtime/ExecutionContext.h>
+
+
+namespace sep
+{
+
+
+class BaseConfigurationComparator : public BaseDataComparator
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BaseConfigurationComparator(Configuration & aConfiguration)
+ : BaseDataComparator( aConfiguration )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BaseConfigurationComparator()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONFIGURE
+ */
+ virtual bool configure(WObject * wfFilterObject)
+ {
+ //!! NOTHING
+
+ return( true );
+ }
+
+
+ /*
+ * COMPARE
+ */
+ inline virtual bool compare(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+ {
+ return( equals(newEC, oldEC) );
+ }
+
+
+ virtual bool equals(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+ {
+ if( ((& newEC) == (& oldEC))
+ || (newEC.getExecutionData() == oldEC.getExecutionData()) )
+ {
+ return( true );
+ }
+
+ if( newEC.refExecutionData().getTableOfRuntime().size() !=
+ oldEC.refExecutionData().getTableOfRuntime().size() )
+ {
+ return( false );
+ }
+
+
+ return( equals(newEC.refExecutionData(),
+ newEC.refExecutionData().getOnSchedule(),
+ oldEC.refExecutionData(),
+ oldEC.refExecutionData().getOnSchedule()) );
+ /*!ALTERNATIVE!*
+ return( newEC.refExecutionData().strStateConf()
+ == oldEC.refExecutionData().strStateConf() );
+ *!ALTERNATIVE!*/
+ }
+
+
+ virtual bool equals(const ExecutionData & firstED, const BF & firstSchedule,
+ const ExecutionData & sndED, const BF & sndSchedule);
+
+ /**
+ * strComparer
+ */
+ inline virtual std::string strComparer() const
+ {
+ return( "control_scope: ALL" );
+ }
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// ALL CONFIGURATION COMPARATOR
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class AllConfigurationComparator : public BaseConfigurationComparator
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AllConfigurationComparator(Configuration & aConfiguration)
+ : BaseConfigurationComparator( aConfiguration )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AllConfigurationComparator()
+ {
+ //!! NOTHING
+ }
+
+
+
+ /*
+ * COMPARE
+ */
+ virtual bool equals(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC);
+
+
+ virtual bool equals(
+ const ExecutionData & firstED, const BF & firstSchedule,
+ const ExecutionData & sndED , const BF & sndSchedule);
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// DETAILS CONFIGURATION COMPARATOR
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class RuntimeID;
+
+class DetailConfigurationComparator : public BaseConfigurationComparator
+{
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ List< RuntimeID > mListOfIgnoreMachine;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ DetailConfigurationComparator(Configuration & aConfiguration)
+ : BaseConfigurationComparator( aConfiguration ),
+ mListOfIgnoreMachine( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~DetailConfigurationComparator()
+ {
+ //!! NOTHING
+ }
+
+
+
+ /**
+ * CONFIGURE
+ */
+ virtual bool configure(WObject * wfParameterObject);
+
+ void computeIgnoreMachine(const ExecutionData & anED,
+ ListOfExecutableForm & listOfExecutable,
+ ListOfInstanceOfMachine & listOfInstance);
+
+ void appendFamilyMachine(
+ const ExecutionData & anED, const RuntimeID & aRID);
+
+
+ /*
+ * COMPARE
+ */
+
+ virtual bool equals(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC);
+
+ bool restrictedRunnableElementTrace(const BF & form);
+
+ /**
+ * strComparer
+ */
+ inline virtual std::string strComparer() const
+ {
+ return( "control_scope: DETAILS" );
+ }
+
+};
+
+
+
+}
+
+#endif /*CONFIGURATIONCOMPARATOR_H_*/
diff --git a/org.eclipse.efm.symbex/src/fam/redundancy/DataSolverComparator.cpp b/org.eclipse.efm.symbex/src/fam/redundancy/DataSolverComparator.cpp
new file mode 100644
index 0000000..446d945
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/redundancy/DataSolverComparator.cpp
@@ -0,0 +1,185 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "DataSolverComparator.h"
+
+#include <fam/redundancy/RedundancyFilter.h>
+
+#include <fml/runtime/ExecutionContext.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <sew/Configuration.h>
+
+#include <solver/api/SolverDef.h>
+#include <solver/api/SolverFactory.h>
+
+
+namespace sep
+{
+
+
+/**
+ * DESTRUCTOR
+ */
+BaseDataSolverComparator::~BaseDataSolverComparator()
+{
+ SolverFactory::destroy( mSolver );
+}
+
+
+/**
+ ***************************************************************************
+prototype filter::redundancy as avm::core.filter.REDUNDANCY is
+section PROPERTY
+ @predicate = 'INCLUSION'; // ( <= | INC | INCLUSION )
+ ( == | EQ | EQUALITY )
+ ( =a= | AEQ | ALPHA_EQUIV)
+ ( =s= | SEQ | SYNTAXIC_EQUALITY)
+ ( =t= | TEQ | TRIVIALLY_EQUALITY)
+ NONE
+
+ @solver = 'OMEGA'; // OMEGA | CVC3
+
+ @path_scope = 'ALL'; // ALL execution graph path | CURRENT execution graph path
+
+ @data_scope = 'ALL'; // ALL data ; or DETAILS section
+ // DETAILS | DETAILS< exclude > some data,
+endsection PROPERTY
+
+section HEURISTIC
+ @communication = false;
+
+ @variable = true;
+ @path_condition = false;
+endsection HEURISTIC
+
+section DETAILS
+ @model = ufi;
+
+ @instance = ufi;
+
+ @variable = ufi;
+endsection DETAILS
+endprototype
+***************************************************************************
+*/
+
+
+/**
+ * CONFIGURE
+ */
+bool BaseDataSolverComparator::configure(WObject * wfParameterObject)
+{
+ if( not BaseDataComparator::configure(wfParameterObject) )
+ {
+ return( false );
+ }
+
+ WObject * thePROPERTY =
+ RedundancyFilter::AUTO_REGISTER_TOOL.isTypeID( * wfParameterObject )
+ ? Query::getRegexWSequence(wfParameterObject,
+ OR_WID2("property", "PROPERTY"), wfParameterObject)
+ : Query::getRegexWSequence(wfParameterObject,
+ OR_WID2("redundancy" , "REDUNDANCY"), wfParameterObject);
+
+ std::string solverID = Query::getWPropertyString(thePROPERTY, "solver",
+ SolverDef::strSolver(SolverDef::SOLVER_OMEGA_KIND));
+
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( SolverDef::isAvailableSolver(
+ SolverDef::toSolver(solverID, SolverDef::SOLVER_UNDEFINED_KIND)) )
+ << "Redundancy: Unknown solver << " << solverID
+ << " >> as parameter (trying to use the default OMEGA solver)!!!"
+ << SEND_ALERT;
+
+ SolverDef::SOLVER_KIND solverKing =
+ SolverDef::toSolver(solverID, SolverDef::SOLVER_OMEGA_KIND);
+
+ if( not SolverDef::isAvailableSolver( solverKing ) )
+ {
+ AVM_OS_ERROR_ALERT<< "Redundancy: Unknown solver << "
+ << solverID << " >> !!!"
+ << SEND_EXIT;
+
+ mSolver = NULL;
+
+ return( false );
+ }
+
+ mSolver = SolverFactory::newSolver4CheckSatisfiability( solverKing );
+
+ if( mSolver != NULL )
+ {
+ mSolver->setCurrentPathScope( isCurrentPathScope() );
+
+ return( mSolver->configure(mConfiguration,
+ wfParameterObject, getSelectedPresburgerVariable()) );
+ }
+ else
+ {
+ AVM_OS_ERROR_ALERT << "Unexpected REDUNDANCY filter << @solver = "
+ << solverID << "; >> !!!" << std::endl
+ << "NB. << @solver = { 'OMEGA' | 'CVC4' }; >> !!!"
+ << SEND_ALERT;
+
+ return( false );
+ }
+
+ return( true );
+}
+
+
+
+/*
+ * COMPARE
+ */
+bool BaseDataSolverComparator::compare(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+{
+ if( mMachineCount != newEC.refExecutionData().getTableOfRuntime().size() )
+ {
+ mMachineCount = newEC.refExecutionData().getTableOfRuntime().size();
+
+ computeAllMachineData( newEC.refExecutionData() );
+
+ getSolver()->setSelectedVariable(
+ mConfiguration.getMainExecutionData(),
+ getSelectedPresburgerVariable() );
+ }
+
+ if( mCurrentPathScopeFlag )
+ {
+ refreshCurrentVariables(getCurrentPresburgerVariable(),
+ getSelectedPresburgerVariable(),
+ newEC.refExecutionData(), oldEC.refExecutionData());
+
+ getSolver()->setSelectedVariable(newEC.refExecutionData(),
+ getCurrentPresburgerVariable());
+ }
+
+ if( compareTEQ(newEC, oldEC) )
+ {
+ return( true );
+ }
+ else if( mUseCommunication || mUseVariable )
+ {
+ return( (mUseCommunication ? compareIO(newEC, oldEC) : true)
+ && (mUseVariable ? compareDATA(newEC, oldEC) : true) );
+ }
+
+ return( true );
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fam/redundancy/DataSolverComparator.h b/org.eclipse.efm.symbex/src/fam/redundancy/DataSolverComparator.h
new file mode 100644
index 0000000..dc8edbf
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/redundancy/DataSolverComparator.h
@@ -0,0 +1,184 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef DATASOLVERCOMPARATOR_H_
+#define DATASOLVERCOMPARATOR_H_
+
+#include "BaseDataComparator.h"
+
+#include <solver/api/SatSolver.h>
+
+
+namespace sep
+{
+
+
+class BaseDataSolverComparator : public BaseDataComparator
+{
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ SatSolver * mSolver;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BaseDataSolverComparator(Configuration & aConfiguration)
+ : BaseDataComparator( aConfiguration ),
+ mSolver( NULL )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BaseDataSolverComparator();
+
+
+ /**
+ * CONFIGURE
+ */
+ virtual bool configure(WObject * wfParameterObject);
+
+
+ /**
+ * GETTER - SETTER
+ * mSolver
+ */
+ inline SatSolver * getSolver()
+ {
+ return( mSolver );
+ }
+
+ inline virtual bool hasVariableComparison()
+ {
+ return( (mSolver != NULL) && mSolver->hasSelectedVariable() );
+ }
+
+
+ /*
+ * COMPARE
+ */
+ virtual bool compare(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC);
+
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// SOLVER EQUALITY
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class DataSolverEquality : public BaseDataSolverComparator
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ DataSolverEquality(Configuration & aConfiguration)
+ : BaseDataSolverComparator( aConfiguration )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~DataSolverEquality()
+ {
+ //!! NOTHING
+ }
+
+
+ /*
+ * COMPARE
+ */
+ inline virtual bool compareDATA(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+ {
+ return( getSolver()->isEqualSet(newEC, oldEC) );
+ }
+
+ /**
+ * strComparer
+ */
+ inline virtual std::string strComparer() const
+ {
+ return( "== i.e. EQ" );
+ }
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// SOLVER INCLUSION
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class DataSolverInclusion : public BaseDataSolverComparator
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ DataSolverInclusion(Configuration & aConfiguration)
+ : BaseDataSolverComparator( aConfiguration )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~DataSolverInclusion()
+ {
+ //!! NOTHING
+ }
+
+
+ /*
+ * COMPARE
+ */
+ virtual bool compareDATA(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+ {
+ return( getSolver()->isSubSet(newEC, oldEC) );
+ }
+
+ /**
+ * strComparer
+ */
+ inline virtual std::string strComparer() const
+ {
+ return( "<= i.e. INCLUSION" );
+ }
+
+};
+
+
+}
+
+#endif /*DATASOLVERCOMPARATOR_H_*/
diff --git a/org.eclipse.efm.symbex/src/fam/redundancy/DataSyntaxicEquivalence.cpp b/org.eclipse.efm.symbex/src/fam/redundancy/DataSyntaxicEquivalence.cpp
new file mode 100644
index 0000000..2aa0bf3
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/redundancy/DataSyntaxicEquivalence.cpp
@@ -0,0 +1,194 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "DataSyntaxicEquivalence.h"
+
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/ExecutionData.h>
+
+#include <fml/expression/ExpressionComparer.h>
+
+#include <fml/runtime/RuntimeForm.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// DATA SYNTAXIC EQUIVALENCE
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool DataSyntaxicEquivalence::compareMESSAGE(
+ const Message & newMsg, const Message & oldMsg)
+{
+ if( newMsg.getMID() == oldMsg.getMID() )
+ {
+ if( newMsg.hasParameter() )
+ {
+ Message::const_iterator itNew = newMsg.beginParameters();
+ Message::const_iterator itNewEnd = newMsg.endParameters();
+ Message::const_iterator itOld = oldMsg.beginParameters();
+ for( ; itNew != itNewEnd ; ++itNew, ++itOld )
+ {
+ if( not ExpressionComparer::isEQ(*itNew, *itOld) )
+ {
+ return( false );
+ }
+ }
+ }
+ return( true );
+ }
+
+ return( false );
+}
+
+
+/*
+ * COMPARE
+ */
+bool DataSyntaxicEquivalence::compareDATA(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+{
+ newED = newEC.getExecutionData();
+ oldED = oldEC.getExecutionData();
+
+ // compare PC
+ if( mIgnorePathCondition || ExpressionComparer::isEQ(
+ newED->getPathCondition(), oldED->getPathCondition() ) )
+ {
+ // compare DATAs
+ itPairMachineData = getAllVariable().begin();
+ endPairMachineData = getAllVariable().end();
+ for( ; itPairMachineData != endPairMachineData ; ++itPairMachineData )
+ {
+ if( (*itPairMachineData).second().nonempty() )
+ {
+ newRF = newED->ptrRuntime( (*itPairMachineData).first() );
+ oldRF = oldED->ptrRuntime( (*itPairMachineData).first() );
+
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , REDUNDANCE )
+ AVM_OS_COUT << "machine :> " << oldRF->getRID().str() << std::endl;
+ itVar = (*itPairMachineData).second().begin();
+ endVar = (*itPairMachineData).second().end();
+ for( ; itVar != endVar ; ++itVar )
+ {
+ AVM_OS_COUT << " " << str_header( *itVar ) << std::endl; }
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , REDUNDANCE )
+
+
+ if( newRF->getDataTable() != oldRF->getDataTable() )
+ {
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , REDUNDANCE )
+ AVM_OS_COUT << "oldRF :> " << oldRF->getRID().str() << std::endl;
+ oldRF->getDataTable()->toStream(AVM_OS_COUT, oldRF->getVariables());
+
+ AVM_OS_COUT << "newRF :> " << newRF->getRID().str() << std::endl;
+ newRF->getDataTable()->toStream(AVM_OS_COUT, newRF->getVariables());
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , REDUNDANCE )
+
+ itVar = (*itPairMachineData).second().begin();
+ endVar = (*itPairMachineData).second().end();
+ for( ; itVar != endVar ; ++itVar )
+ {
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , REDUNDANCE )
+ AVM_OS_COUT << str_header( *itVar ) << std::endl;
+ AVM_OS_COUT << " oldVal :> " << oldRF->getData((*itVar)->getOffset()).str()
+ << std::endl;
+ AVM_OS_COUT << " newVal :> " << newRF->getData((*itVar)->getOffset()).str()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , REDUNDANCE )
+
+ if( not ExpressionComparer::isEQ(
+ newRF->getData((*itVar)->getOffset()),
+ oldRF->getData((*itVar)->getOffset())) )
+ {
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , REDUNDANCE )
+ AVM_OS_COUT << str_header( *itVar ) << std::endl;
+ AVM_OS_COUT << " oldVal :> " << oldRF->getData((*itVar)->getOffset()).str()
+ << std::endl;
+ AVM_OS_COUT << " newVal :> " << newRF->getData((*itVar)->getOffset()).str()
+ << std::endl;
+ AVM_OS_COUT << ">>>>>>> false <<<<<<<" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , REDUNDANCE )
+
+ return( false );
+ }
+ }
+ }
+ }
+ }
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// DATA ALPHA EQUIVALENCE
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+bool DataAlphaEquivalence::compareDATA(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+{
+ newED = newEC.getExecutionData();
+ oldED = oldEC.getExecutionData();
+
+ // compare PC
+ if( mIgnorePathCondition || ExpressionComparer::isEQ(
+ newED->getPathCondition(), oldED->getPathCondition() ) )
+ {
+ // compare DATAs
+ itPairMachineData = getAllVariable().begin();
+ endPairMachineData = getAllVariable().end();
+ for( ; itPairMachineData != endPairMachineData ; ++itPairMachineData )
+ {
+ if( (*itPairMachineData).second().nonempty() )
+ {
+ newRF = newED->ptrRuntime( (*itPairMachineData).first() );
+ oldRF = oldED->ptrRuntime( (*itPairMachineData).first() );
+
+ if( newRF->getDataTable() != oldRF->getDataTable() )
+ {
+ itVar = (*itPairMachineData).second().begin();
+ endVar = (*itPairMachineData).second().end();
+ for( ; itVar != endVar ; ++itVar )
+ {
+ if( not ExpressionComparer::isEQ(
+ newRF->getData((*itVar)->getOffset()),
+ oldRF->getData((*itVar)->getOffset())) )
+ {
+ return( false );
+ }
+ }
+ }
+ }
+ }
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fam/redundancy/DataSyntaxicEquivalence.h b/org.eclipse.efm.symbex/src/fam/redundancy/DataSyntaxicEquivalence.h
new file mode 100644
index 0000000..6365785
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/redundancy/DataSyntaxicEquivalence.h
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef DataSyntaxicEquivalence_H_
+#define DataSyntaxicEquivalence_H_
+
+#include "BaseDataComparator.h"
+
+
+namespace sep
+{
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// DATA SYNTAXIC EQUIVALENCE
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class DataSyntaxicEquivalence : public BaseDataComparator
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ DataSyntaxicEquivalence(Configuration & aConfiguration)
+ : BaseDataComparator( aConfiguration )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~DataSyntaxicEquivalence()
+ {
+ //!! NOTHING
+ }
+
+
+ /*
+ * COMPARE
+ */
+ virtual bool compareMESSAGE(
+ const Message & newMsg, const Message & oldMsg);
+
+ virtual bool compareDATA(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC);
+
+ /**
+ * strComparer
+ */
+ inline virtual std::string strComparer() const
+ {
+ return( "=s= i.e. SEQ" );
+ }
+
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// DATA ALPHA EQUIVALENCE
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class DataAlphaEquivalence : public BaseDataComparator
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ DataAlphaEquivalence(Configuration & aConfiguration)
+ : BaseDataComparator( aConfiguration )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~DataAlphaEquivalence()
+ {
+ //!! NOTHING
+ }
+
+
+ /*
+ * COMPARE
+ */
+ virtual bool compareDATA(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC);
+
+ /**
+ * strComparer
+ */
+ inline virtual std::string strComparer() const
+ {
+ return( "=a= i.e. AEQ" );
+ }
+
+};
+
+
+}
+
+#endif /*DataSyntaxicEquivalence_H_*/
diff --git a/org.eclipse.efm.symbex/src/fam/redundancy/PathScopeIterator.h b/org.eclipse.efm.symbex/src/fam/redundancy/PathScopeIterator.h
new file mode 100644
index 0000000..7d591fe
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/redundancy/PathScopeIterator.h
@@ -0,0 +1,464 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef PATHSCOPEITERATOR_H_
+#define PATHSCOPEITERATOR_H_
+
+#include "ConfigurationComparator.h"
+
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/ExecutionData.h>
+
+
+namespace sep
+{
+
+
+class BasePathScopeIterator
+{
+
+protected:
+
+ /*
+ * ATTRIBUTES
+ */
+ const ExecutionContext * mInterestEC;
+
+ BaseConfigurationComparator * mConfigurationComparator;
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BasePathScopeIterator(BaseConfigurationComparator * aConfigComparator)
+ : mInterestEC( NULL ),
+ mConfigurationComparator( aConfigComparator )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BasePathScopeIterator()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONFIGURE
+ */
+ virtual bool configure(WObject * wfFilterObject)
+ {
+ //!! NOTHING
+ return( true );
+ }
+
+
+
+ /* ITERATOR
+ * theBeginEC to theEnd using theCurrentEC
+ */
+ virtual const ExecutionContext * begin(
+ const ExecutionContext * anInterestEC) = 0;
+
+ virtual const ExecutionContext * begin() = 0;
+
+
+ virtual const ExecutionContext * current() = 0;
+
+
+ virtual bool hasNext() = 0;
+
+ virtual const ExecutionContext * next() = 0;
+
+
+ virtual void hash(const ExecutionContext & anInterestEC) = 0;
+
+
+ /**
+ * HANDLER for Event Notification
+ * Destroy Execution Context
+ */
+ inline virtual void handleEventDestroyCtx(const ExecutionContext * anEC)
+ {
+ //!! NOTHING
+ }
+
+
+ /* GETTER - SETTER
+ * mInterestEC
+ */
+ inline const ExecutionContext * getInterest()
+ {
+ return( mInterestEC );
+ }
+
+ inline bool hasInterest() const
+ {
+ return( mInterestEC != NULL );
+ }
+
+ inline void setInterest(const ExecutionContext * anInterestEC)
+ {
+ mInterestEC = anInterestEC;
+ }
+
+
+ /* GETTER - SETTER
+ * mConfigurationComparator
+ */
+ inline BaseConfigurationComparator * getConfigurationComparator()
+ {
+ return( mConfigurationComparator );
+ }
+
+ inline bool hasConfigurationComparator() const
+ {
+ return( mConfigurationComparator != NULL );
+ }
+
+ inline void setConfigurationComparator(
+ BaseConfigurationComparator * aConfigurationComparator)
+ {
+ mConfigurationComparator = aConfigurationComparator;
+ }
+
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// ALL PATH SCOPE ITERATOR
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class AllPathScopeIterator : public BasePathScopeIterator
+{
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ ListOfConstExecutionContext mHashTable;
+
+ ListOfConstExecutionContext::const_iterator itBegin;
+ ListOfConstExecutionContext::const_iterator itEnd;
+
+ ListOfConstExecutionContext::const_iterator itCurrent;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AllPathScopeIterator(BaseConfigurationComparator * aConfigComparator)
+ : BasePathScopeIterator( aConfigComparator )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AllPathScopeIterator()
+ {
+ //!! NOTHING
+ }
+
+
+ /* ITERATOR
+ * theBegin to theEnd using theCurrent
+ * next
+ */
+ inline virtual const ExecutionContext * begin(
+ const ExecutionContext * anInterestEC)
+ {
+ mInterestEC = anInterestEC;
+
+ for( itCurrent = getHashTable().begin() ;
+ itCurrent != getHashTable().end() ; ++itCurrent )
+ {
+ if( getConfigurationComparator()->equals(
+ (* mInterestEC), (* (*itCurrent))) )
+ {
+ break;
+ }
+ }
+
+ itBegin = itCurrent;
+
+ return( (itCurrent != getHashTable().end())? (*itCurrent) : NULL );
+ }
+
+ inline virtual const ExecutionContext * begin()
+ {
+ return( (itBegin != getHashTable().end())? (*itBegin) : NULL );
+ }
+
+ virtual const ExecutionContext * current()
+ {
+ return( (itCurrent != getHashTable().end())? (*itCurrent) : NULL );
+ }
+
+
+ inline virtual bool hasNext()
+ {
+ return( itCurrent != getHashTable().end() );
+ }
+
+
+ inline virtual const ExecutionContext * next()
+ {
+ if( itCurrent != getHashTable().end() )
+ {
+ for( ++itCurrent ; itCurrent != getHashTable().end() ; ++itCurrent )
+ {
+ if( getConfigurationComparator()->equals(
+ (* mInterestEC), (* (*itCurrent))) )
+ {
+ return( *itCurrent );
+ }
+ }
+ }
+ return( NULL );
+ }
+
+
+ inline virtual void hash(const ExecutionContext & anInterestEC)
+ {
+ appendHash( & anInterestEC );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mHashTable
+ */
+ inline void appendHash(const ExecutionContext * anEC)
+ {
+ mHashTable.append( anEC );
+ }
+
+ inline ListOfConstExecutionContext & getHashTable()
+ {
+ return( mHashTable );
+ }
+
+ inline bool hasHash() const
+ {
+ return( mHashTable.nonempty() );
+ }
+
+
+ /**
+ * HANDLER for Event Notification
+ * Destroy Execution Context
+ */
+ inline virtual void handleEventDestroyCtx(const ExecutionContext * anEC)
+ {
+ mHashTable.remove( anEC );
+ }
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// CURRENT PATH SCOPE ITERATOR
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class CurrentPathScopeIterator : public BasePathScopeIterator
+{
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ const ExecutionContext * mBeginEC;
+ const ExecutionContext * mCurrentEC;
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ CurrentPathScopeIterator(BaseConfigurationComparator * aConfigComparator)
+ : BasePathScopeIterator( aConfigComparator ),
+ mBeginEC( NULL ),
+ mCurrentEC( NULL )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~CurrentPathScopeIterator()
+ {
+ //!! NOTHING
+ }
+
+
+ /* ITERATOR
+ * theBegin to theEnd using theCurrent
+ * next
+ */
+ inline virtual const ExecutionContext * begin(
+ const ExecutionContext * anInterestEC)
+ {
+ mCurrentEC = mInterestEC = anInterestEC;
+ return( mBeginEC = next() );
+ }
+
+ inline virtual const ExecutionContext * begin()
+ {
+ return( mBeginEC );
+ }
+
+
+ inline virtual const ExecutionContext * current()
+ {
+ return( mCurrentEC );
+ }
+
+
+ inline virtual bool hasNext()
+ {
+ return( mCurrentEC != NULL );
+ }
+
+ inline virtual const ExecutionContext * next()
+ {
+ if( mCurrentEC != NULL )
+ {
+ mCurrentEC = mCurrentEC->getContainer();
+ for( ; (mCurrentEC != NULL) ;
+ mCurrentEC = mCurrentEC->getContainer() )
+ {
+ if( getConfigurationComparator()
+ ->equals((* mInterestEC), (* mCurrentEC)) )
+ {
+ return( mCurrentEC->isnotRoot() ?
+ mCurrentEC : (mCurrentEC = NULL) );
+ }
+ }
+ }
+
+ return( mCurrentEC );
+ }
+
+ inline virtual void hash(const ExecutionContext & anInterestEC)
+ {
+ //!! NOTHING
+ }
+
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// PARENT PATH SCOPE ITERATOR
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class ParentPathScopeIterator : public BasePathScopeIterator
+{
+
+protected:
+
+ /*
+ * ATTRIBUTES
+ */
+ const ExecutionContext * mCurrentEC;
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ParentPathScopeIterator(BaseConfigurationComparator * aConfigComparator)
+ : BasePathScopeIterator( aConfigComparator ),
+ mCurrentEC( NULL )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ParentPathScopeIterator()
+ {
+ //!! NOTHING
+ }
+
+
+ /* ITERATOR
+ * theBegin to theEnd using theCurrent
+ * next
+ */
+ inline virtual const ExecutionContext * begin(
+ const ExecutionContext * anInterestEC)
+ {
+ mInterestEC = anInterestEC;
+
+ mInterestEC = mInterestEC->getContainer();
+ if( (mInterestEC != NULL)
+ && mInterestEC->isnotRoot()
+ && getConfigurationComparator()->equals(
+ (* mInterestEC), (* mInterestEC)) )
+ {
+ return( mInterestEC );
+ }
+
+ return( mInterestEC = NULL );
+ }
+
+ inline virtual const ExecutionContext * begin()
+ {
+ return( mInterestEC );
+ }
+
+
+ inline virtual const ExecutionContext * current()
+ {
+ return( mInterestEC );
+ }
+
+
+ inline virtual bool hasNext()
+ {
+ return( mInterestEC != NULL );
+ }
+
+ inline virtual const ExecutionContext * next()
+ {
+ return( mInterestEC = NULL );
+ }
+
+ inline virtual void hash(const ExecutionContext & anInterestEC)
+ {
+ //!! NOTHING
+ }
+
+};
+
+
+}
+
+#endif /*PATHSCOPEITERATOR_H_*/
diff --git a/org.eclipse.efm.symbex/src/fam/redundancy/RedundancyFilter.cpp b/org.eclipse.efm.symbex/src/fam/redundancy/RedundancyFilter.cpp
new file mode 100644
index 0000000..cecb6d9
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/redundancy/RedundancyFilter.cpp
@@ -0,0 +1,609 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "RedundancyFilter.h"
+
+#include "ConfigurationComparator.h"
+
+#include "PathScopeIterator.h"
+
+#include "BaseDataComparator.h"
+#include "DataSolverComparator.h"
+#include "DataSyntaxicEquivalence.h"
+
+#include <fam/api/MainProcessorUnit.h>
+
+#include <fam/queue/ExecutionQueue.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <sew/Configuration.h>
+#include <sew/Workflow.h>
+
+
+namespace sep
+{
+
+/**
+ * DESTRUCTOR
+ */
+RedundancyFilter::~RedundancyFilter()
+{
+ if( mRedundancyEnabledFlag )
+ {
+ // Unregistration
+ getSymbexEventManager().unregisterHandlerEventDestroyCtx(this);
+ }
+
+ destroy();
+}
+
+
+void RedundancyFilter::destroy()
+{
+ if( mConfigurationComparator != NULL )
+ {
+ delete mConfigurationComparator;
+ }
+
+ if( mPathScopeIterator != NULL )
+ {
+ delete mPathScopeIterator;
+ }
+
+ if( mExecutionDataComparator != NULL )
+ {
+ delete mExecutionDataComparator;
+ }
+}
+
+
+/**
+ ***************************************************************************
+prototype filter::redundancy as avm::core.filter.REDUNDANCY is
+section PROPERTY
+ @predicate = 'INCLUSION'; // ( <= | INC | INCLUSION )
+ ( == | EQ | EQUALITY )
+ ( =a= | AEQ | ALPHA_EQUIV)
+ ( =s= | SEQ | SYNTAXIC_EQUALITY)
+ ( =t= | TEQ | TRIVIALLY_EQUALITY)
+ NONE
+
+ @solver = 'OMEGA'; // OMEGA | CVC4
+
+ @path_scope = 'ALL'; // ALL execution graph path
+ CURRENT execution graph path
+ PARENT execution graph node
+
+ @data_scope = 'ALL'; // ALL data ; or DETAILS section
+ // DETAILS | DETAILS< exclude > some data,
+endsection PROPERTY
+
+section HEURISTIC
+ @communication = false;
+
+ @variable = true;
+ @path_condition = false;
+endsection HEURISTIC
+
+section DETAILS
+ @model = ufi;
+
+ @instance = ufi;
+
+ @variable = ufi;
+endsection DETAILS
+endprototype
+***************************************************************************
+*/
+
+/*
+ * NEW CONSISE SYNTAX
+supervisor {
+ limit 'of graph exploration' [
+ eval = 10
+ ...
+ ]
+ queue 'for graph exploration' [
+ strategy = 'BFS'
+ ...
+ ]
+ redundancy 'detection strategy' [
+ comparer = 'INCLUSION'
+ solver = 'OMEGA'
+ path_scope = 'CURRENT'
+ data_scope = 'ALL'
+ ] // end redundancy
+
+ console [
+ format = "\nstep:%1% , context:%2% , height:%3% , width:%4%"
+ ...
+ ]
+}
+*/
+
+
+bool RedundancyFilter::configureImpl()
+{
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( hasParameterWObject() )
+ << "Unexpected a <null> RedundancyFilter WObject !!!"
+ << SEND_EXIT;
+
+ mConfigFlag = true;
+
+ mRedundancyConfigurationFlag = false;
+
+ bool isnotDefinedWTypedObjectParameters = false;
+
+ WObject * wfRedundancy = mParameterWObject;
+
+ if( MainProcessorUnit::AUTO_REGISTER_TOOL.isTypeID( *mParameterWObject ) )
+ {
+ wfRedundancy = Query::getRegexWObjectByNameID(mParameterWObject,
+ PREFIX_WID("symbex", OR_WID2("redundancy", "REDUNDANCY")),
+ WObject::_NULL_);
+
+ if( wfRedundancy == WObject::_NULL_ )
+ {
+ mRedundancyEnabledFlag = false;
+
+ // Trivial Loop Detection Enabling
+ mTrivialLoopDetectionFlag =
+ Query::getRegexWPropertyBoolean(mParameterWObject,
+ CONS_WID3("loop", "detection", "trivial"), true);
+
+ return( mConfigFlag = true );
+ }
+ else if( wfRedundancy->isWTypedOrReference() )
+ {
+ if( wfRedundancy->isWPropertyWReference() )
+ {
+ wfRedundancy = wfRedundancy->getWReferenceValue();
+ }
+
+ if( RedundancyFilter::AUTO_REGISTER_TOOL.isTypeID( *wfRedundancy ) )
+ {
+ mParameterWObject = wfRedundancy;
+ }
+ else
+ {
+ AVM_OS_WARN << "RedundancyFilter::configure:> "
+ "Unexpected the WObject< "
+ << wfRedundancy->getFullyQualifiedNameID()
+ << " > as redundancy parameters defined in supervisor <"
+ << mParameterWObject->getFullyQualifiedNameID()
+ << " >! " << std::endl;
+
+ mRedundancyEnabledFlag = mConfigFlag = false;
+
+ return( mConfigFlag );
+ }
+ }
+ else if( wfRedundancy->isWSequence() )
+ {
+ isnotDefinedWTypedObjectParameters = true;
+ }
+ else if( not wfRedundancy->isWSequence() )
+ {
+ AVM_OS_WARN << "RedundancyFilter::configure:> "
+ "Unexpected the WObject< " << wfRedundancy->strHeader()
+ << " > as redundancy parameters defined in supervisor <"
+ << mParameterWObject->getFullyQualifiedNameID()
+ << " >! " << std::endl;
+
+ mRedundancyEnabledFlag = mConfigFlag = false;
+
+ return( mConfigFlag );
+ }
+ }
+
+ WObject * thePROPERTY = (isnotDefinedWTypedObjectParameters) ? wfRedundancy
+ : Query::getRegexWSequence(wfRedundancy, OR_WID4("property",
+ "PROPERTY", "redundancy", "REDUNDANCY"), wfRedundancy);
+
+
+ // Trivial Loop Detection Enabling
+ mTrivialLoopDetectionFlag =
+ Query::getRegexWPropertyBoolean(thePROPERTY,
+ CONS_WID3("loop", "detection", "trivial"), true);
+
+ if( (thePROPERTY == WObject::_NULL_)
+ || (thePROPERTY->isWTypedOrSequence()
+ && thePROPERTY->hasnoOwnedElement()) )
+ {
+ return( mConfigFlag );
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PREDICATE KIND
+ ////////////////////////////////////////////////////////////////////////////
+ std::string strPredicate = Query::getRegexWPropertyString(
+ thePROPERTY, OR_WID2("comparer", "predicate"), "");
+
+ if( strPredicate.empty() )
+ {
+ return( mConfigFlag );
+ }
+
+ else if( (strPredicate == "<=")
+ || (strPredicate == "INC")
+ || (strPredicate == "INCLUSION") )
+ {
+ mExecutionDataComparator =
+ new DataSolverInclusion( getConfiguration() );
+ }
+ else if( (strPredicate == "==")
+ || (strPredicate == "EQ")
+ || (strPredicate == "EQUALITY") )
+ {
+ mExecutionDataComparator =
+ new DataSolverEquality( getConfiguration() );
+ }
+ else if( (strPredicate == "=a=")
+ || (strPredicate == "AEQ")
+ || (strPredicate == "ALPHA_EQUIV") )
+ {
+ mExecutionDataComparator =
+ new DataAlphaEquivalence( getConfiguration() );
+ }
+ else if( (strPredicate == "=s=")
+ || (strPredicate == "SEQ")
+ || (strPredicate == "SYNTAXIC_EQUALITY") )
+ {
+ mExecutionDataComparator =
+ new DataSyntaxicEquivalence( getConfiguration() );
+ }
+ else if( (strPredicate == "=&=")
+ || (strPredicate == "=t=")
+ || (strPredicate == "TEQ")
+ || (strPredicate == "TRIVIALLY_EQUALITY") )
+ {
+ mExecutionDataComparator =
+ new TriviallyDataComparison( getConfiguration() );
+ strPredicate = "=t=";
+ }
+ else if( strPredicate == "NONE" )
+ {
+ mExecutionDataComparator = new NoneDataComparison( getConfiguration() );
+ }
+ else
+ {
+ AVM_OS_ERROR_ALERT << "Unexpected REDUNDANCY filter << @predicate = "
+ << strPredicate << "; >> !!!" << std::endl
+ << "NB. << @predicate = { 'INCLUSION' | 'EQUALITY' | "
+ "'ALPHA_EQUIV' | 'SYNTAXIC_EQUALITY' | 'TRIVIALLY_EQUALITY' | "
+ "'NONE' }; >> !!!"
+ << SEND_ALERT;
+
+ mConfigFlag = false;
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DATA SCOPE
+ ////////////////////////////////////////////////////////////////////////////
+ if( mExecutionDataComparator != NULL )
+ {
+ if( mExecutionDataComparator->configure( mParameterWObject ) )
+ {
+ if( (not mExecutionDataComparator->hasVariableComparison())
+ && (strPredicate != "=t=")
+ && (strPredicate != "NONE") )
+ {
+ delete mExecutionDataComparator;
+
+ mExecutionDataComparator =
+ new NoneDataComparison( getConfiguration() );
+ }
+ }
+ else
+ {
+ destroy();
+
+ mConfigFlag = false;
+ }
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // STATE SCOPE
+ ////////////////////////////////////////////////////////////////////////////
+ std::string control_scope = Query::getRegexWPropertyString(
+ thePROPERTY, CONS_WID2("control", "scope"), "ALL");
+ if( control_scope == "ALL" )
+ {
+ mConfigurationComparator =
+ new BaseConfigurationComparator( getConfiguration() );
+ }
+ else if( control_scope == "DETAILS" )
+ {
+ mConfigurationComparator =
+ new DetailConfigurationComparator( getConfiguration() );
+ }
+ else
+ {
+ AVM_OS_ERROR_ALERT
+ << "Unexpected REDUNDANCY filter << @control_scope = "
+ << control_scope << "; >> !!!" << std::endl
+ << "NB. << @control_scope = { 'ALL' | 'DETAILS' }; >> !!!"
+ << SEND_ALERT;
+
+ mConfigFlag = false;
+ }
+
+ mConfigFlag = mConfigurationComparator->configure( mParameterWObject )
+ && mConfigFlag;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PATH SCOPE
+ ////////////////////////////////////////////////////////////////////////////
+ std::string path_scope = Query::getRegexWPropertyString(
+ thePROPERTY, CONS_WID2("path", "scope"), "ALL");
+ if( path_scope == "ALL" )
+ {
+ mPathScopeIterator =
+ new AllPathScopeIterator(mConfigurationComparator);
+ }
+ else if( path_scope == "CURRENT" )
+ {
+ mPathScopeIterator =
+ new CurrentPathScopeIterator(mConfigurationComparator);
+ }
+ else if( path_scope == "PARENT" )
+ {
+ mPathScopeIterator =
+ new ParentPathScopeIterator(mConfigurationComparator);
+ }
+ else
+ {
+ AVM_OS_ERROR_ALERT << "Unexpected REDUNDANCY filter << @path_scope = "
+ << path_scope << "; >> !!!" << std::endl
+ << "NB. << @path_scope = { 'ALL' | 'CURRENT' | PARENT }; >> !!!"
+ << SEND_ALERT;
+
+ mConfigFlag = false;
+ }
+
+ if( mConfigFlag )
+ {
+ mConfigFlag = mPathScopeIterator->configure( mParameterWObject );
+
+ if( mConfigFlag )
+ {
+ // Registration to handler DestroyCtx event
+ getSymbexEventManager().registerHandlerEventDestroyCtx(this);
+ }
+ }
+
+ mRedundancyConfigurationFlag = mRedundancyEnabledFlag = mConfigFlag;
+
+ return( mConfigFlag );
+}
+
+
+/**
+ * preFilter
+ * Every pre filter has to implement this method
+ */
+bool RedundancyFilter::prefilter()
+{
+ ecQueue = &( getExecutionQueue().getReadyQueue() );
+ ecQueueItEnd = ecQueue->end();
+ for( ecQueueIt = ecQueue->begin() ; ecQueueIt != ecQueueItEnd ; )
+ {
+ if( not prefilter( * (*ecQueueIt)) )
+ {
+ getExecutionQueue().appendFailed( *ecQueueIt );
+
+ ecQueueIt = ecQueue->erase(ecQueueIt);
+ }
+ else
+ {
+ ++ecQueueIt;
+ }
+ }
+
+ return( getExecutionQueue().hasReady() );
+}
+
+
+bool RedundancyFilter::prefilter(ExecutionContext & anEC)
+{
+ if( trivialLoopDetection(anEC) )
+ {
+ return( false );
+ }
+
+ else if( mRedundancyEnabledFlag )
+ {
+ mPathScopeIterator->begin(& anEC);
+ for( ; mPathScopeIterator->hasNext() ; mPathScopeIterator->next() )
+ {
+ ++mRedundancyTest;
+
+ mCandidateEC = mPathScopeIterator->current();
+
+ if( getExecutionDataComparator()->compare(
+ anEC, (* mCandidateEC)) )
+ {
+ ++mRedundancyCount;
+
+ anEC.getwFlags().setExecutionRedundancyTrace();
+
+ anEC.addInfo(*this, mCandidateEC->getHeader());
+
+ const_cast< ExecutionContext * >( mCandidateEC )->
+ getwFlags().setExecutionRedundancyTargetTrace();
+
+ // DO DIAGNOSTIQ
+AVM_IF_DEBUG_LEVEL_OR_FLAG( MEDIUM , REDUNDANCE )
+ AVM_OS_TRACE << std::endl << DEFAULT_WRAP_DATA << "REDUNDANT EC :> ";
+ anEC.traceDefault(AVM_OS_TRACE);
+
+ AVM_OS_TRACE << "FOUND[" << std::setw(5)
+ << mRedundancyCount << "] :> ";
+ mCandidateEC->traceDefault(AVM_OS_TRACE);
+ AVM_OS_TRACE << END_WRAP_EOL;
+
+
+ AVM_OS_COUT << std::endl << DEFAULT_WRAP_DATA << "REDUNDANT EC :> ";
+ anEC.traceDefault(AVM_OS_COUT);
+
+ AVM_OS_COUT << "FOUND[" << std::setw(5)
+ << mRedundancyCount << "] :> ";
+ mCandidateEC->traceDefault(AVM_OS_COUT);
+ AVM_OS_COUT << END_WRAP_EOL;
+AVM_ENDIF_DEBUG_LEVEL_OR_FLAG( MEDIUM , REDUNDANCE )
+
+ return( false );
+ }
+ else
+ {
+ // DO DIAGNOSTIQ
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , REDUNDANCE )
+ AVM_OS_TRACE << DEFAULT_WRAP_DATA << "NEW EC :> ";
+ anEC.traceDefault(AVM_OS_TRACE);
+
+ AVM_OS_TRACE << "OLD EC :> ";
+ mCandidateEC->traceDefault(AVM_OS_TRACE);
+ AVM_OS_TRACE << END_WRAP_EOL;
+
+
+ AVM_OS_COUT << DEFAULT_WRAP_DATA << "NEW EC :> ";
+ anEC.traceDefault(AVM_OS_COUT);
+
+ AVM_OS_COUT << "OLD EC :> ";
+ mCandidateEC->traceDefault(AVM_OS_COUT);
+ AVM_OS_COUT << END_WRAP_EOL;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , REDUNDANCE )
+ }
+ }
+
+ mPathScopeIterator->hash( anEC );
+
+AVM_IF_DEBUG_ENABLED
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_ENABLED
+ }
+
+ return( true );
+}
+
+
+bool RedundancyFilter::trivialLoopDetection(ExecutionContext & anEC)
+{
+ ExecutionContext * prevEC = anEC.getPrevious();
+ bool foondLoop = false;
+
+ if( mTrivialLoopDetectionFlag )
+ {
+ for( ; (prevEC != NULL) && prevEC->isnotRoot() ;
+ prevEC = prevEC->getPrevious() )
+ {
+ if( anEC.refExecutionData().isTEQ( prevEC->getExecutionData() ) )
+ {
+ ++mTrivialLoopCount;
+
+ foondLoop = true;
+
+ break;
+ }
+ }
+ }
+ else if( (prevEC != NULL) && prevEC->isnotRoot()
+ && anEC.refExecutionData().isTEQ( prevEC->getExecutionData() ) )
+ {
+ ++mTrivialLoopCount;
+
+ foondLoop = true;
+ }
+
+ if( foondLoop )
+ {
+ anEC.getwFlags().setExecutionTrivialLoopTrace();
+
+ // DO DIAGNOSTIQ
+AVM_IF_DEBUG_LEVEL_OR_FLAG( MEDIUM , REDUNDANCE )
+ AVM_OS_TRACE << std::endl << "TRIVIAL LOOP DETECTION :> ";
+ anEC.traceDefault(AVM_OS_TRACE);
+
+ AVM_OS_TRACE << "FOUND[" << std::setw(5)
+ << mTrivialLoopCount << "] :> ";
+ prevEC->traceDefault(AVM_OS_TRACE);
+ AVM_OS_TRACE << std::endl;
+
+
+ AVM_OS_COUT << std::endl << "TRIVIAL LOOP :> ";
+ anEC.traceDefault(AVM_OS_COUT);
+
+ AVM_OS_COUT << "COUNT[" << std::setw(5)
+ << mTrivialLoopCount << "] :> ";
+ prevEC->traceDefault(AVM_OS_COUT);
+ AVM_OS_COUT << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_OR_FLAG( MEDIUM , REDUNDANCE )
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+/**
+ * IHandlerEventDestroyCtx API
+ * Destroy Execution Context
+ */
+void RedundancyFilter::handleEventDestroyCtx(ExecutionContext * anEC)
+{
+ mPathScopeIterator->handleEventDestroyCtx(anEC);
+}
+
+/**
+ * REPORT TRACE
+ */
+void RedundancyFilter::reportDefault(OutStream & os) const
+{
+ if( (mRedundancyTest > 0) || (mTrivialLoopTest > 0) )
+ {
+ reportHeader(os, "REDUNDANCY");
+
+ if( mRedundancyEnabledFlag && (mRedundancyTest > 0) )
+ {
+ os << TAB2 << "Comparer predicate: "
+ << mExecutionDataComparator->strComparer() << EOL
+ << TAB2 << "The redundancy count: " << mRedundancyCount
+ << " for " << mRedundancyTest << " tests !" << EOL_FLUSH;
+ }
+
+ if( mTrivialLoopDetectionFlag && (mTrivialLoopTest > 0) )
+ {
+ os << TAB2 << "The trivial loop count: " << mTrivialLoopCount
+ << " for " << mTrivialLoopTest << " tests !" << EOL_FLUSH;
+ }
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// NON-REGRESSION TEST API
+////////////////////////////////////////////////////////////////////////////////
+
+void RedundancyFilter::tddRegressionReportImpl(OutStream & os)
+{
+ os << TAB << "REDUNDANCY - positive detection count : "
+ << mRedundancyCount
+ << " for " << mRedundancyTest << " tests" << EOL_FLUSH;
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fam/redundancy/RedundancyFilter.h b/org.eclipse.efm.symbex/src/fam/redundancy/RedundancyFilter.h
new file mode 100644
index 0000000..9734933
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/redundancy/RedundancyFilter.h
@@ -0,0 +1,234 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef REDUNDANCYFILTER_H_
+#define REDUNDANCYFILTER_H_
+
+#include <fam/api/AbstractProcessorUnit.h>
+#include <sew/SymbexEventManager.h>
+
+#include <common/BF.h>
+
+#include <fml/builtin/Identifier.h>
+
+
+namespace sep
+{
+
+class BaseConfigurationComparator;
+class BaseDataComparator;
+class BasePathScopeIterator;
+
+class SymbexControllerUnitManager;
+
+
+class RedundancyFilter :
+ public AutoRegisteredProcessorUnit< RedundancyFilter >,
+ public IHandlerEventDestroyCtx
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( RedundancyFilter )
+
+
+ /**
+ * PROCESSOR FACTORY
+ * for automatic registration in the processor repository
+ * the [ [ FULLY ] QUALIFIED ] NAME ID
+ */
+ AVM_INJECT_AUTO_REGISTER_QUALIFIED_ID_KEY_3(
+ "symbex.redundancy",
+ "avm::processor.REDUNDANCY",
+ "avm::core.filter.REDUNDANCY")
+ // end registration
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ bool mTrivialLoopDetectionFlag;
+
+
+ bool mRedundancyConfigurationFlag;
+ bool mRedundancyEnabledFlag;
+
+ BaseConfigurationComparator * mConfigurationComparator;
+
+ BasePathScopeIterator * mPathScopeIterator;
+
+ BaseDataComparator * mExecutionDataComparator;
+
+ avm_size_t mTrivialLoopTest;
+ avm_size_t mTrivialLoopCount;
+
+ avm_size_t mRedundancyTest;
+ avm_size_t mRedundancyCount;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing Variable
+ const ExecutionContext * mCandidateEC;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ */
+ RedundancyFilter(SymbexControllerUnitManager & aControllerUnitManager,
+ WObject * wfParameterObject = NULL)
+ : RegisteredProcessorUnit(aControllerUnitManager, wfParameterObject,
+ AVM_PRE_FILTERING_STAGE, PRECEDENCE_OF_REDUNDANCY),
+ mTrivialLoopDetectionFlag( false ),
+ mRedundancyConfigurationFlag( false ),
+ mRedundancyEnabledFlag( false ),
+
+ mConfigurationComparator( NULL ),
+ mPathScopeIterator( NULL ),
+ mExecutionDataComparator( NULL ),
+
+ mTrivialLoopTest( 0 ),
+ mTrivialLoopCount( 0 ),
+
+ mRedundancyTest( 0 ),
+ mRedundancyCount( 0 ),
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing Variable
+ mCandidateEC( NULL )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~RedundancyFilter();
+
+ void destroy();
+
+ /**
+ * mRedundancyEnabledFlag
+ * mTrivialLoopDetectionFlag
+ */
+ inline void setEnabledRedundancyDetection(bool bEnabled = true )
+ {
+ // Enabling only if it was configured,
+ // i.e. mRedundancyConfigurationFlag is true !
+ mRedundancyEnabledFlag = (bEnabled && mRedundancyConfigurationFlag);
+ }
+
+ inline void setEnabledTrivialLoopDetection(bool bEnabled = true )
+ {
+ mTrivialLoopDetectionFlag = bEnabled;
+ }
+
+
+ /**
+ * CONFIGURE
+ */
+ bool configureImpl();
+
+
+ /**
+ * REPORT TRACE
+ */
+ virtual void reportDefault(OutStream & os) const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // NON-REGRESSION TEST API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual void tddRegressionReportImpl(OutStream & os);
+
+ /**
+ * preFilter
+ * Every pre filter has to implement this method
+ */
+ virtual bool prefilter();
+
+ virtual bool prefilter(ExecutionContext & anEC);
+
+ bool trivialLoopDetection(ExecutionContext & anEC);
+
+
+ /* GETTER - SETTER
+ * mConfigurationComparator
+ */
+ inline BaseConfigurationComparator * getConfigurationComparator()
+ {
+ return( mConfigurationComparator );
+ }
+
+ inline bool hasConfigurationComparator() const
+ {
+ return( mConfigurationComparator != NULL );
+ }
+
+ inline void setConfigurationComparator(
+ BaseConfigurationComparator * aConfigurationComparator)
+ {
+ mConfigurationComparator = aConfigurationComparator;
+ }
+
+
+ /* GETTER - SETTER
+ * mPathScopeIterator
+ */
+ inline BasePathScopeIterator * getPathScopeIterator()
+ {
+ return( mPathScopeIterator );
+ }
+
+ inline bool hasPathScopeIterator() const
+ {
+ return( mPathScopeIterator != NULL );
+ }
+
+ inline void setPathScopeIterator(BasePathScopeIterator * aPathScopeIterator)
+ {
+ mPathScopeIterator = aPathScopeIterator;
+ }
+
+
+ /* GETTER - SETTER
+ * mExecutionDataComparator
+ */
+ inline BaseDataComparator * getExecutionDataComparator()
+ {
+ return( mExecutionDataComparator );
+ }
+
+ inline bool hasExecutionDataComparator() const
+ {
+ return( mExecutionDataComparator != NULL );
+ }
+
+ inline void setExecutionDataComparator(
+ BaseDataComparator * anExecutionDataComparator)
+ {
+ mExecutionDataComparator = anExecutionDataComparator;
+ }
+
+
+ /**
+ * IHandlerEventDestroyCtx API
+ * Destroy Execution Context
+ */
+ virtual void handleEventDestroyCtx(ExecutionContext * anEC);
+
+};
+
+
+}
+
+#endif /*REDUNDANCYFILTER_H_*/
diff --git a/org.eclipse.efm.symbex/src/fam/serializer/GraphVizExecutionGraphSerializer.cpp b/org.eclipse.efm.symbex/src/fam/serializer/GraphVizExecutionGraphSerializer.cpp
new file mode 100644
index 0000000..9998aa9
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/serializer/GraphVizExecutionGraphSerializer.cpp
@@ -0,0 +1,1703 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 22 mars 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "GraphVizExecutionGraphSerializer.h"
+
+#include <fml/executable/AvmProgram.h>
+#include <fml/executable/AvmTransition.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/runtime/ExecutionConfiguration.h>
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/ExecutionInformation.h>
+#include <fml/runtime/RuntimeForm.h>
+#include <fml/runtime/RuntimeID.h>
+#include <fml/runtime/TableOfData.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <sew/Configuration.h>
+#include <sew/SymbexControllerUnitManager.h>
+
+#include <boost/format.hpp>
+
+
+namespace sep
+{
+
+
+/**
+ * GLOBAL HEADER / END
+ * %1% --> graph name-id
+ */
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_GLOBAL_HEADER_PATTERN = "digraph %1% {";
+
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_GLOBAL_END_PATTERN = "\n}";
+
+/**
+ * EXECUTION CONTEXT NODE
+ * %1% --> node#id
+ * %2% --> node#label
+ * %3% --> node#css
+ * %4% --> node#data
+ * %5% --> node#info
+ * %6% --> node#fired
+ * %7% --> node#trace
+ */
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_CONTEXT_NODE_PATTERN = "\nEC%1% [%2%%3%\n]%4%";
+
+/**
+ * EXECUTION CONTEXT NODE LABEL
+ * %1% --> node#id
+ * %2% --> node#header
+ * %3% --> node#data
+ * %4% --> node#info
+ * %5% --> node#fired
+ * %6% --> node#trace
+ */
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_CONTEXT_NODE_LABEL_PATTERN = "\n\tlabel=\"%2%%4%\"";
+
+/**
+ * EXECUTION CONTEXT NODE CSS
+ * %1% --> node#id
+ * %2% --> node#color
+ * %3% --> node#shape
+ * %4% --> node#style
+ */
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_CONTEXT_NODE_CSS_PATTERN =
+ "\n\tcolor=%2%\n\tshape=%3%\n\tstyle=%4%";
+
+// CSS PROFILE: COLOR / SHAPE
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_CONTEXT_NODE_COLOR = "lightblue";
+
+const std::string & GraphVizExecutionGraphSerializer::
+WARNING_CONTEXT_NODE_COLOR = "orange";
+
+const std::string & GraphVizExecutionGraphSerializer::
+ERROR_CONTEXT_NODE_COLOR = "red";
+
+const std::string & GraphVizExecutionGraphSerializer::
+ALERT_CONTEXT_NODE_COLOR = "red";
+
+
+const std::string & GraphVizExecutionGraphSerializer::
+OBJECTIVE_ACHIEVED_CONTEXT_NODE_COLOR = "lawngreen";
+
+const std::string & GraphVizExecutionGraphSerializer::
+OBJECTIVE_ACHIEVED_CONTEXT_NODE_SHAPE = "tripleoctagon";
+
+
+const std::string & GraphVizExecutionGraphSerializer::
+OBJECTIVE_FAILED_CONTEXT_NODE_COLOR = "orange";
+
+const std::string & GraphVizExecutionGraphSerializer::
+OBJECTIVE_FAILED_CONTEXT_NODE_SHAPE = "doubleoctagon";
+
+
+const std::string & GraphVizExecutionGraphSerializer::
+OBJECTIVE_ABORTED_CONTEXT_NODE_COLOR = "red";
+
+const std::string & GraphVizExecutionGraphSerializer::
+OBJECTIVE_ABORTED_CONTEXT_NODE_SHAPE = "octagon";
+
+
+const std::string & GraphVizExecutionGraphSerializer::
+COVERAGE_ELEMENT_CONTEXT_NODE_COLOR = "yellow";
+
+
+const std::string & GraphVizExecutionGraphSerializer::
+REDUNDANCY_CONTEXT_NODE_COLOR = "green";
+
+const std::string & GraphVizExecutionGraphSerializer::
+REDUNDANCY_CONTEXT_NODE_SHAPE = "cds";
+
+const std::string & GraphVizExecutionGraphSerializer::
+REDUNDANCY_TARGET_CONTEXT_NODE_COLOR = "greenyellow";
+
+const std::string & GraphVizExecutionGraphSerializer::
+REDUNDANCY_TARGET_CONTEXT_NODE_SHAPE = "septagon";
+
+// CSS PROFILE: SHAPE
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_CONTEXT_NODE_SHAPE = "ellipse";
+
+const std::string & GraphVizExecutionGraphSerializer::
+STATEMENT_EXIT_CONTEXT_NODE_SHAPE = "tripleoctagon";
+
+// CSS PROFILE: STYLE
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_CONTEXT_NODE_STYLE = "filled";
+
+
+/**
+ * EXECUTION CONTEXT EDGE
+ * %1% --> node#source#id
+ * %2% --> node#target#id
+ * %3% --> node#target#data
+ * %4% --> node#target#info
+ * %5% --> node#target#fired
+ * %6% --> node#target#trace
+ */
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_CONTEXT_EDGE_PATTERN = "\nEC%1% -> EC%2% [\n\tlabel=\"%5%%6%\"\n]";
+
+/**
+ * EXECUTION CONTEXT HEADER
+ * %1% --> ec#id
+ * %2% --> ec#eval
+ * %3% --> ec#hight
+ * %4% --> ec#width
+ * %5% --> ec#weight
+ * %6% --> statemachine configuration i.e. lifelines state identifier
+ */
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_CONTEXT_NODE_HEADER_PATTERN = "EC#%1%<Ev:%2%>\\n%6%";
+
+/**
+ * EXECUTION DATA
+ * %1% --> ec#id
+ * %2% --> ec#assign
+ * %3% --> ec#path#condition
+ * %4% --> ec#path#timed#condition
+ * %5% --> ec#node#condition
+ * %6% --> ec#node#timed#condition
+ */
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_CONTEXT_NODE_DATA_PATTERN = "\nEC%1% -> ED%1%\nED%1% "
+ "[\n\tlabel=\"%3%%4%%5%%6%%2%\"\n\tshape=box\n]";
+
+/**
+ * EXECUTION CONTEXT INFO
+ * %1% --> node#id
+ * %2% --> execution info
+ */
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_CONTEXT_NODE_INFO_PATTERN = "\n%2%";
+// "\nEC%1% -> EI%1%\nEI%1% [\n\tlabel=\"%2%\""
+// "\n\tshape=octagon\n\tcolor=yellow\n\tstyle=filled\n]";
+
+/**
+ * EXECUTION CONTEXT INFO
+ * %1% --> node#id
+ * %2% --> execution fired
+ */
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_CONTEXT_NODE_FIRED_PATTERN = "%2%";
+
+/**
+ * EXECUTION CONTEXT INFO
+ * %1% --> node#id
+ * %2% --> execution trace
+ */
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_CONTEXT_NODE_TRACE_PATTERN = "%2%";
+
+/**
+ * INFO
+ * %1% --> info id
+ * %2% --> info data
+ */
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_INFO_PATTERN = "%1%: %2%";
+
+const std::string & GraphVizExecutionGraphSerializer::
+STANDARD_INFO_PATTERN = "%2%";
+
+/**
+ * CONDITION
+ * %1% --> condition
+ */
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_PATH_CONDITION_PATTERN = "" /*"PC: %1%"*/;
+
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_PATH_TIMED_CONDITION_PATTERN = "" /*"PtC: %1%"*/;
+
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_NODE_CONDITION_PATTERN = "" /*"NC: %1%"*/;
+
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_NODE_TIMED_CONDITION_PATTERN = ""/*"NtC: %1%"*/;
+
+/**
+ * ASSIGN
+ * %1% --> machine runtime pid
+ * %2% --> machine container identifier
+ * %3% --> variable identifier
+ * %4% --> value
+ */
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_ASSIGN_PATTERN = "%1%:%2% = %3%";
+
+/**
+ * NEWFRESH
+ * %1% --> machine runtime pid
+ * %2% --> machine container identifier
+ * %3% --> variable identifier
+ * %4% --> value
+ */
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_NEWFRESH_PATTERN = "newfresh %1%->%2%( %3% )";
+
+/**
+ * INPUT / OUTPUT
+ * %1% --> machine runtime pid
+ * %2% --> machine container identifier
+ * %3% --> ( port | signal ) identifier
+ * %4% --> value
+ * %5% --> machine sender identifier name
+ * %6% --> machine receiver identifier name
+ */
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_INPUT_PATTERN = "%1%->%3% ? %4%";
+
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_OUTPUT_PATTERN = "%1%->%3% ! %4%";
+
+
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_INPUT_ENV_PATTERN = "env => %1%->%3% ? %4%";
+
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_OUTPUT_ENV_PATTERN = "env <= %1%->%3% ! %4%";
+
+
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_INPUT_RDV_PATTERN = "\tinput#rdv %2%->%3%%4%\n";
+
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_OUTPUT_RDV_PATTERN = "\toutput#rdv %2%->%3%%4%\n";
+
+
+/**
+ * LIFELINE STATE IDENTIFIER
+ * %1% --> lifeline runtime pid
+ * %2% --> lifeline identifier
+ * %3% --> state runtime pid
+ * %3% --> state identifier
+ */
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_LIFELINE_STATE_PATTERN = "%2%:%4%";
+
+/**
+ * MACHINE
+ * %1% --> machine runtime pid
+ * %2% --> machine container identifier
+ * %3% --> machine identifier
+ */
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_MACHINE_PATTERN = "%3%";
+
+/**
+ * TRANSITION
+ * %1% --> machine runtime pid
+ * %2% --> machine container identifier
+ * %3% --> transition identifier
+ */
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_TRANSITION_PATTERN = "%2%->%3%";
+
+/**
+ * ROUTINE
+ * %1% --> machine runtime pid
+ * %2% --> machine container identifier
+ * %3% --> routine identifier
+ */
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_ROUTINE_PATTERN = "%2%->%3%";
+
+/**
+ * VARIABLE
+ * %1% --> machine runtime pid
+ * %2% --> machine container identifier
+ * %3% --> variable identifier
+ */
+const std::string & GraphVizExecutionGraphSerializer::
+DEFAULT_VARIABLE_PATTERN = "%1%->%3%";
+
+
+
+
+
+/*******************************************************************************
+serializer += GraphVizExecutionGraphSerializer <name-id> "<description>" {
+ // ...
+
+@property:
+
+@trace:
+
+@format:
+
+@vfs:
+ file = "<save-file-path>"
+}
+*******************************************************************************/
+
+/**
+prototype processor::serializer#graph "serialize graph" as GraphVizExecutionGraphSerializer is
+section PROPERTY
+ @info#selection = 'ALL'; // ALL | MODIFIED
+ @data#selection = 'ALL'; // ALL | MODIFIED
+endsection PROPERTY
+
+section FORMAT
+ @line#wrap#width = 42;
+ @line#wrap#separator = "\\l";
+
+ // %1% --> graph name#id
+ @header = "digraph model_%1% {\n";
+ @end = "\n}";
+
+ // %1% --> node#id
+ // %2% --> node#label
+ // %3% --> node#css
+ // %4% --> node#data
+ // %5% --> node#info
+ // %6% --> node#fired
+ // %7% --> node#trace
+ @node = "\nEC%1% [%2%%3%\n]%5%%4%";
+
+ // %1% --> node#id
+ // %2% --> node#header
+ // %3% --> node#data
+ // %4% --> node#info
+ // %5% --> node#fired
+ // %6% --> node#trace
+ @node#label = "\n\tlabel=\"%2%\"";
+
+ // %1% --> node#id
+ // %2% --> node#color
+ // %3% --> node#shape
+ // %4% --> node#style
+ @node#css = "\n\tcolor=%2%\n\tshape=%3%\n\tstyle=%4%";
+
+ // %1% --> node#source#id
+ // %2% --> node#target#id
+ // %3% --> node#target#data
+ // %4% --> node#target#info
+ // %5% --> node#target#fired
+ // %6% --> node#target#trace
+ @edge = "\nEC%1% -> EC%2% [\n\tlabel=\"%5%%6%\"\n]";
+
+ // %1% --> ec#id
+ // %2% --> ec#eval
+ // %3% --> ec#hight
+ // %4% --> ec#width
+ // %5% --> ec#weight
+ // %6% --> statemachine configuration i.e. lifelines state identifier
+ @node#header = "EC#%1%<Ev:%2%>\n%6%";
+
+ // %1% --> ec#id
+ // %2% --> ec#assign
+ // %3% --> ec#path#condition
+ // %4% --> ec#path#timed#condition
+ // %5% --> ec#node#condition
+ // %6% --> ec#node#timed#condition
+ @node#data = "\nEC%1% -> ED%1%\nED%1% [\n\tlabel=\"%3%%4%%5%%6%%2%\"\n\tshape=box\n]";
+
+ // %1% --> node#id
+ // %2% --> execution info
+ @node#info = "\nEC%1% -> EI%1%\nEI%1% [\n\tlabel=\"%2%\"\n\tshape=box\n\tcolor=yellow\n\tstyle=filled\n]";
+
+ // %1% --> node#id
+ // %2% --> execution fired
+ @node#fired = "%2%";
+
+ // %1% --> node#id
+ // %2% --> execution trace
+ @node#trace = "%2%";
+
+
+ // %1% --> info id
+ // %2% --> info data
+ @info = "%2%";
+
+ // %1% --> condition
+ @path#condition = "PC: %1%";
+ @path#timed#condition = "PtC: %1%";
+ @node#condition = "NC: %1%";
+ @node#timed#condition = "NtC: %1%";
+
+ // %1% --> machine runtime pid
+ // %2% --> machine identifier name
+ // %3% --> port | signal | variable | machine | transition | routine
+ // %4% --> value
+ @assign = "%2%:%3%=%4%";
+
+ @newfresh = "newfresh(%1%:%3%) <- %4%";
+
+ @machine = "";
+ @machine = "run %1%:%3%";
+
+ @transition = "fired %3%";
+ @routine = "invoke %2%:%3%";
+
+ @input = "%3% ? %4%";
+ @input = "%1%->%3% ? %4%";
+
+ @input#env = "env => %1%->%3% ? %4%";
+
+ @output = "%3% ! %4%";
+ @output = "%1%->%3% ! %4%";
+
+ @output#env = "env <= %1%->%3% ! %4%";
+endsection FORMAT
+section TRACE
+ @machine = "[*]";
+
+ @state = "[*]";
+ @tatemachine = "[*]";
+
+ @transition = "[*]";
+
+ @routine = "[*]";
+
+ @com = "[*]";
+
+ @input = "[*]";
+ @output = "[*]";
+
+ @newfresh = "[*]";
+ @variable = "[*]";
+endsection TRACE
+section VFS
+ @file = "graph.gv";
+endsection VFS
+endprototype
+*/
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+
+bool GraphVizExecutionGraphSerializer::configureImpl()
+{
+ mConfigFlag = Serializer::configureImpl();
+
+ // the Trace Point Filter configuration
+ mConfigFlag = mTraceFilter.configure(getENV(), getParameterWObject())
+ && mConfigFlag;
+
+ avm_size_t error = 0;
+
+ // Standard profile
+ mContextNodeColor = DEFAULT_CONTEXT_NODE_COLOR;
+ mContextNodeShape = DEFAULT_CONTEXT_NODE_SHAPE;
+ mContextNodeStyle = DEFAULT_CONTEXT_NODE_STYLE;
+
+ mContextNodeSeparator = "\\n";
+
+ mInfoPattern = STANDARD_INFO_PATTERN;
+ mInfoJustification = "";
+ mInfoSeparator = "\\n";
+
+
+ WObject * theFORMAT = Query::getRegexWSequence(
+ getParameterWObject(), OR_WID2("format", "FORMAT"));
+ if( theFORMAT != WObject::_NULL_ )
+ {
+ mWrapData.SEPARATOR = Query::getRegexWPropertyString(theFORMAT,
+ CONS_WID3("line", "wrap", "separator"), mWrapData.SEPARATOR);
+ StringTools::replaceAll(mWrapData.SEPARATOR, "\\\\l", "\\l");
+
+ error += configureFormatter(theFORMAT,
+ mGlobalHeaderPattern, "header" ) ? 0 : 1;
+ error += configureFormatter(theFORMAT,
+ mGlobalEndPattern, "end" ) ? 0 : 1;
+
+ error += configureFormatter(theFORMAT,
+ mContextNodePattern, "node" ) ? 0 : 1;
+ error += configureFormatter(theFORMAT, mContextNodeLabelPattern,
+ CONS_WID2("node", "label"), true ) ? 0 : 1;
+ error += configureFormatter(theFORMAT, mContextNodeCssPattern,
+ CONS_WID2("node", "css"), true ) ? 0 : 1;
+
+ error += configureFormatter(theFORMAT,
+ mContextEdgePattern, "edge" ) ? 0 : 1;
+
+ error += configureFormatter(theFORMAT, mContextNodeHeaderPattern,
+ CONS_WID2("node", "header"), true ) ? 0 : 1;
+ error += configureFormatter(theFORMAT, mContextNodeDataPattern,
+ CONS_WID2("node", "data"), true ) ? 0 : 1;
+ error += configureFormatter(theFORMAT, mContextNodeInfoPattern,
+ CONS_WID2("node", "info"), true ) ? 0 : 1;
+ error += configureFormatter(theFORMAT, mContextNodeFiredPattern,
+ CONS_WID2("node", "fired"), true ) ? 0 : 1;
+ error += configureFormatter(theFORMAT, mContextNodeTracePattern,
+ CONS_WID2("node", "trace"), true ) ? 0 : 1;
+
+ error += configureFormatter(theFORMAT, mInfoPattern, "info" ) ? 0 : 1;
+
+ error += configureFormatter(theFORMAT, mPathConditionPattern,
+ CONS_WID2("path", "condition"), true ) ? 0 : 1;
+ error += configureFormatter(theFORMAT, mPathTimedConditionPattern,
+ CONS_WID3("path", "timed", "condition"), true ) ? 0 : 1;
+ error += configureFormatter(theFORMAT, mNodeConditionPattern,
+ CONS_WID2("node", "condition"), true ) ? 0 : 1;
+ error += configureFormatter(theFORMAT, mNodeTimedConditionPattern,
+ CONS_WID3("node", "timed", "condition"), true ) ? 0 : 1;
+
+ error += configureFormatter(theFORMAT,
+ mAssignPattern, "assign" ) ? 0 : 1;
+ error += configureFormatter(theFORMAT,
+ mNewfreshPattern, "newfresh" ) ? 0 : 1;
+
+ error += configureFormatter(theFORMAT,
+ mInputPattern, "input" ) ? 0 : 1;
+ error += configureFormatter(theFORMAT,
+ mOutputPattern, "output" ) ? 0 : 1;
+
+
+ error += configureFormatter(theFORMAT,
+ mInputEnvPattern, CONS_WID2("input", "env"), true ) ? 0 : 1;
+ error += configureFormatter(theFORMAT,
+ mOutputEnvPattern, CONS_WID2("output", "env"), true ) ? 0 : 1;
+
+ error += configureFormatter(theFORMAT,
+ mInputRdvPattern , CONS_WID2("input", "rdv"), true ) ? 0 : 1;
+ error += configureFormatter(theFORMAT,
+ mOutputRdvPattern, CONS_WID2("output", "rdv"), true) ? 0 : 1;
+
+
+ if( Query::hasWPropertyString(theFORMAT, "input") )
+ {
+ if( not Query::hasRegexWProperty(
+ theFORMAT, CONS_WID2("input", "env")) )
+ {
+ mInputEnvPattern = mInputPattern;
+ }
+ if( not Query::hasRegexWProperty(
+ theFORMAT, CONS_WID2("input", "rdv")) )
+ {
+ mInputRdvPattern = mInputPattern;
+ }
+ }
+
+ if( Query::hasWPropertyString(theFORMAT, "output") )
+ {
+ if( not Query::hasRegexWProperty(
+ theFORMAT, CONS_WID2("output", "env")) )
+ {
+ mOutputEnvPattern = mOutputPattern;
+ }
+
+ if( not Query::hasRegexWProperty(
+ theFORMAT, CONS_WID2("output", "rdv")) )
+ {
+ mOutputRdvPattern = mOutputPattern;
+ }
+ }
+
+
+ error += configureFormatter(theFORMAT, mLifelineStatePattern,
+ CONS_WID2("lifeline", "state"), true ) ? 0 : 1;
+
+ error += configureFormatter(theFORMAT,
+ mMachinePattern, "machine" ) ? 0 : 1;
+ error += configureFormatter(theFORMAT,
+ mTransitionPattern, "transition") ? 0 : 1;
+ error += configureFormatter(theFORMAT,
+ mRoutinePattern, "routine" ) ? 0 : 1;
+ error += configureFormatter(theFORMAT,
+ mVariablePattern, "variable" ) ? 0 : 1;
+ }
+// else // Standard profile
+// {
+// mContextNodeColor = DEFAULT_CONTEXT_NODE_COLOR;
+// mContextNodeShape = DEFAULT_CONTEXT_NODE_SHAPE;
+// mContextNodeStyle = DEFAULT_CONTEXT_NODE_STYLE;
+//
+// mContextNodeSeparator = "\\n";
+//
+// mInfoPattern = STANDARD_INFO_PATTERN;
+// mInfoJustification = "";
+// mInfoSeparator = "\\n";
+// }
+
+ mShowNodeHeaderFlag = (not mContextNodeHeaderPattern.empty());
+ mShowNodeDataFlag = (not mContextNodeDataPattern.empty());
+ mShowNodeInfoFlag = (not mContextNodeInfoPattern.empty());
+
+ mConfigFlag = (error == 0) && mConfigFlag;
+
+ return( mConfigFlag );
+}
+
+
+bool GraphVizExecutionGraphSerializer::configureFormatter(WObject * FORMAT,
+ std::string & formatPattern, const std::string & id, bool isRegex)
+{
+ formatPattern = isRegex
+ ? Query::getRegexWPropertyString(FORMAT, id, formatPattern)
+ : Query::getWPropertyString(FORMAT, id, formatPattern);
+
+ StringTools::replaceAll(formatPattern, "\\t" , "\t");
+ StringTools::replaceAll(formatPattern, "\\n" , "\n");
+ StringTools::replaceAll(formatPattern, "\\\"", "\"");
+
+ try
+ {
+ boost::format formatter(formatPattern);
+ }
+ catch(const boost::io::bad_format_string & bfs)
+ {
+ Query::reportErrorAttribute(FORMAT, id, bfs.what());
+
+ return( false );
+ }
+
+ return( true );
+}
+
+
+
+/**
+ * REPORT TRACE
+ */
+void GraphVizExecutionGraphSerializer::reportDefault(OutStream & os) const
+{
+ AVM_OS_VERBOSITY_MEDIUM( os )
+ << TAB << "GRAPHVIZ EXECUTION GRAPH SERIALIZER< "
+ << getParameterWObject()->getFullyQualifiedNameID()
+ << " > DONE !!!" << EOL_FLUSH;
+}
+
+
+/**
+ * FILTERING API
+ */
+bool GraphVizExecutionGraphSerializer::prefilter()
+{
+ return( true );
+}
+
+bool GraphVizExecutionGraphSerializer::postfilter()
+{
+ return( true );
+}
+
+
+/**
+ * POST-PROCESSING API
+ */
+bool GraphVizExecutionGraphSerializer::postprocess()
+{
+ const ExecutionContext & anEC = *( getConfiguration().getFirstTrace() );
+
+ bool saveFlag = String::USE_BACKSLASH_QUOTE;
+ String::USE_BACKSLASH_QUOTE = true;
+
+ beginStream();
+ while( hasStream() )
+ {
+ dotFormat(currentStream(), anEC);
+ }
+
+ String::USE_BACKSLASH_QUOTE = saveFlag;
+
+ closeStream();
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////
+// DEFAULT FORMAT API
+////////////////////////////////////////////////////////////////////////////
+
+void GraphVizExecutionGraphSerializer::format(
+ SymbexControllerUnitManager & aManager,
+ OutStream & out, const ExecutionContext & rootEC)
+{
+ AbstractProcessorUnit * existingSerializer =
+ aManager.getControllerUnit(
+ GraphVizExecutionGraphSerializer::AUTO_REGISTER_TOOL);
+
+ if( existingSerializer != NULL )
+ {
+ GraphVizExecutionGraphSerializer gvSerializer(
+ aManager, existingSerializer->getParameterWObject());
+
+ if( gvSerializer.configureImpl() )
+ {
+ gvSerializer.dotFormat(out, rootEC);
+
+ return;
+ }
+ }
+ else
+ {
+ GraphVizExecutionGraphSerializer gvSerializer(aManager, WObject::_NULL_);
+
+ if( gvSerializer.configureImpl() )
+ {
+ gvSerializer.dotFormat(out, rootEC);
+
+ return;
+ }
+ }
+
+ out << "digraph fscn {" << std::endl
+ << "ERROR [ " << std::endl
+ << "\tlabel=\""
+ << "Unfound,\n"
+ "in the current SymbexControllerUnitManager,\\n"
+ "an existing GraphVizExecutionGraphSerializer\\n"
+ "which configuration could be used\n"
+ "to configure the default GraphViz's serializer!\""
+ << std::endl
+ << "\tshape=tripleoctagon" << std::endl
+ << "\tcolor=red" << std::endl
+ << "\tstyle=filled" << std::endl
+ << "]" << std::endl
+ << "}" << std::endl;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// FORMAT API
+////////////////////////////////////////////////////////////////////////////////
+
+void GraphVizExecutionGraphSerializer::dotFormat(
+ OutStream & os, const ExecutionContext & rootEC)
+{
+ os.setSymbexValueCSS(mMultiValueArrayCSS,
+ mMultiValueParamsCSS, mMultiValueStructCSS);
+
+ doFormatHeader( os );
+
+ mDotFormatNodeWaitingQueue.push_back( & rootEC );
+
+ const ExecutionContext * itEC = NULL;
+ while( mDotFormatNodeWaitingQueue.nonempty() )
+ {
+ mDotFormatNodeWaitingQueue.pop_first_to( itEC );
+
+ dotFormatNode(os, (* itEC));
+ }
+
+ doFormatEnd( os );
+
+ os.restoreSymbexValueCSS();
+}
+
+/**
+ * GLOBAL HEADER
+ * %1% --> graph name-id
+ */
+void GraphVizExecutionGraphSerializer::doFormatHeader(OutStream & os)
+{
+ boost::format formatter(mGlobalHeaderPattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ os << formatter
+ % "fscn";
+}
+
+/**
+ * GLOBAL END
+ * %1% --> graph name#id
+ */
+void GraphVizExecutionGraphSerializer::doFormatEnd(OutStream & os)
+{
+ boost::format formatter(mGlobalEndPattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ os << formatter
+ % "fscn";
+}
+
+
+/**
+ * EXECUTION CONTEXT NODE
+ * %1% --> node#id
+ * %2% --> node#label
+ * %3% --> node#css
+ * %4% --> node#data
+ * %5% --> node#info
+ * %6% --> node#fired
+ * %7% --> node#trace
+ */
+void GraphVizExecutionGraphSerializer::dotFormatNode(
+ OutStream & os, const ExecutionContext & anEC)
+{
+ StringOutStream ecLabel;
+ StringOutStream ecCSS;
+
+ StringOutStream ecHeader;
+ StringOutStream ecData;
+ StringOutStream ecInfo;
+ StringOutStream ecFired;
+ StringOutStream ecTrace;
+
+ if( mShowNodeHeaderFlag )
+ {
+ dotFormatNodeHeader(ecHeader, anEC);
+ }
+ if( mShowNodeDataFlag )
+ {
+ dotFormatNodeData(ecData, anEC);
+ }
+ if( mShowNodeInfoFlag )
+ {
+ dotFormatNodeInfo(ecInfo, anEC);
+ }
+ if( mTraceFilter.hasRunnablePoint() )
+ {
+ dotFormatNodeRunnableTrace(ecFired, anEC);
+ }
+ if( mTraceFilter.hasIOTracePoint() )
+ {
+ dotFormatNodeIOTrace(ecFired, anEC);
+ }
+
+ /*
+ * EXECUTION CONTEXT NODE LABEL
+ * %1% --> node#id
+ * %2% --> node#header
+ * %3% --> node#data
+ * %4% --> node#info
+ * %5% --> node#fired
+ * %6% --> node#trace
+ */
+ boost::format formatterLabel(mContextNodeLabelPattern);
+ formatterLabel.exceptions( boost::io::no_error_bits );
+
+ ecLabel << formatterLabel
+ % anEC.getIdNumber()
+ % ecHeader.str()
+ % ecData.str()
+ % ecInfo.str()
+ % ecFired.str()
+ % ecTrace.str();
+
+ /*
+ * EXECUTION CONTEXT NODE CSS
+ * %1% --> node#id
+ * %2% --> node#color
+ * %3% --> node#shape
+ * %4% --> node#style
+ */
+ boost::format formatterCSS(mContextNodeCssPattern);
+ formatterCSS.exceptions( boost::io::no_error_bits );
+
+ ecCSS << formatterCSS
+ % anEC.getIdNumber()
+ % dotNodeColor( anEC )
+ % dotNodeShape( anEC )
+ % dotNodeStyle( anEC );
+
+ /*
+ * EXECUTION CONTEXT NODE
+ * %1% --> node#id
+ * %2% --> node#label
+ * %3% --> node#css
+ * %4% --> node#data
+ * %5% --> node#info
+ * %6% --> node#fired
+ * %7% --> node#trace
+ */
+ boost::format formatter(mContextNodePattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ os << formatter
+ % anEC.getIdNumber()
+ % ecLabel.str()
+ % ecCSS.str()
+ % ecData.str()
+ % ecInfo.str()
+ % ecFired.str()
+ % ecTrace.str();
+
+ ExecutionContext::child_iterator itEC = anEC.begin();
+ ExecutionContext::child_iterator endEC = anEC.end();
+ for( ; itEC != endEC ; ++itEC )
+ {
+ dotFormatEdge(os, anEC, *(*itEC));
+
+ mDotFormatNodeWaitingQueue.push_back( *itEC );
+ }
+}
+
+
+std::string GraphVizExecutionGraphSerializer::dotNodeColor(
+ const ExecutionContext & anEC)
+{
+ const ExecutionContextFlags & flags = anEC.getFlags();
+
+ if( flags.hasObjectiveAchieved() )
+ {
+ return( OBJECTIVE_ACHIEVED_CONTEXT_NODE_COLOR );
+ }
+ if( flags.hasObjectiveFailed() )
+ {
+ return( OBJECTIVE_FAILED_CONTEXT_NODE_COLOR );
+ }
+ if( flags.hasObjectiveAborted() )
+ {
+ return( OBJECTIVE_ABORTED_CONTEXT_NODE_COLOR );
+ }
+
+ if( flags.hasError() )
+ {
+ return( ERROR_CONTEXT_NODE_COLOR );
+ }
+
+ if( flags.hasAlert() )
+ {
+ return( ALERT_CONTEXT_NODE_COLOR );
+ }
+
+ if( flags.hasWarning() )
+ {
+ return( WARNING_CONTEXT_NODE_COLOR );
+ }
+
+ if( flags.hasRedundancy() )
+ {
+ return( REDUNDANCY_CONTEXT_NODE_COLOR );
+ }
+
+ if( flags.hasRedundancyTarget() )
+ {
+ return( REDUNDANCY_TARGET_CONTEXT_NODE_COLOR );
+ }
+
+ if( flags.hasCoverageElement() /*&& anEC.hasInfo()*/ )
+ {
+ return( COVERAGE_ELEMENT_CONTEXT_NODE_COLOR );
+ }
+
+ return( mContextNodeColor );
+}
+
+std::string GraphVizExecutionGraphSerializer::dotNodeShape(
+ const ExecutionContext & anEC)
+{
+ const ExecutionContextFlags & flags = anEC.getFlags();
+
+ if( flags.hasObjectiveAchieved() )
+ {
+ return( OBJECTIVE_ACHIEVED_CONTEXT_NODE_SHAPE );
+ }
+ if( flags.hasObjectiveFailed() )
+ {
+ return( OBJECTIVE_FAILED_CONTEXT_NODE_SHAPE );
+ }
+ if( flags.hasObjectiveAborted() )
+ {
+ return( OBJECTIVE_ABORTED_CONTEXT_NODE_SHAPE );
+ }
+
+ if( flags.isExecutionStatementExitTrace() )
+ {
+ return( STATEMENT_EXIT_CONTEXT_NODE_SHAPE );
+ }
+
+ if( flags.hasRedundancy() )
+ {
+ return( REDUNDANCY_CONTEXT_NODE_SHAPE );
+ }
+
+ if( flags.hasRedundancyTarget() )
+ {
+ return( REDUNDANCY_TARGET_CONTEXT_NODE_SHAPE );
+ }
+
+ return( mContextNodeShape );
+}
+
+std::string GraphVizExecutionGraphSerializer::dotNodeStyle(
+ const ExecutionContext & anEC)
+{
+ return( mContextNodeStyle );
+}
+
+
+/**
+ * EXECUTION CONTEXT EDGE
+ * %1% --> node#source#id
+ * %2% --> node#target#id
+ * %3% --> node#target#data
+ * %4% --> node#target#info
+ * %5% --> node#target#fired
+ * %6% --> node#target#trace
+ */
+void GraphVizExecutionGraphSerializer::dotFormatInfo(
+ OutStream & os, GenericInfoData * anInfo)
+{
+ std::string strInfo = anInfo->strData();
+ if( not strInfo.empty() )
+ {
+ boost::format formatter(mInfoPattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ os << formatter
+ % anInfo->strUID()
+ % strInfo
+ << mInfoJustification;
+ }
+}
+
+
+
+void GraphVizExecutionGraphSerializer::dotFormatEdge(OutStream & os,
+ const ExecutionContext & srcEC, const ExecutionContext & tgtEC)
+{
+ StringOutStream ecData;
+ StringOutStream ecInfo;
+ StringOutStream ecFired;
+ StringOutStream ecTrace;
+
+ if( mShowNodeDataFlag )
+ {
+ dotFormatNodeData(ecData, tgtEC);
+ }
+ if( mShowNodeInfoFlag )
+ {
+ dotFormatNodeInfo(ecInfo, tgtEC);
+ }
+ if( mTraceFilter.hasRunnablePoint() )
+ {
+ dotFormatNodeRunnableTrace(ecFired, tgtEC);
+ }
+ if( mTraceFilter.hasIOTracePoint() )
+ {
+ dotFormatNodeIOTrace(ecFired, tgtEC);
+ }
+
+ boost::format formatter(mContextEdgePattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ os << formatter
+ % srcEC.getIdNumber()
+ % tgtEC.getIdNumber()
+ % ecData.str()
+ % ecInfo.str()
+ % ecFired.str()
+ % ecTrace.str();
+}
+
+
+/**
+ * EXECUTION CONTEXT HEADER
+ * %1% --> ec#id
+ * %2% --> ec#eval
+ * %3% --> ec#hight
+ * %4% --> ec#width
+ * %5% --> ec#weight
+ * %6% --> statemachine configuration i.e. lifelines state identifier
+ */
+void GraphVizExecutionGraphSerializer::dotFormatNodeHeader(
+ OutStream & os, const ExecutionContext & anEC)
+{
+ boost::format formatter(mContextNodeHeaderPattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ os << formatter
+ % anEC.getIdNumber()
+ % anEC.getEvalNumber()
+ % anEC.getHeight()
+ % anEC.getWidth()
+ % anEC.getWeight()
+ % anEC.refExecutionData().strStateConf(mLifelineStatePattern);
+
+ if( anEC.getFlags().hasReachedLimitOrExecutionTrace() )
+ {
+ os << "\\n" << anEC.getFlags().str();
+ }
+}
+
+/**
+ * EXECUTION DATA
+ * %1% --> ec#id
+ * %2% --> ec#assign
+ * %3% --> ec#path#condition
+ * %4% --> ec#path#timed#condition
+ * %5% --> ec#node#condition
+ * %6% --> ec#node#timed#condition
+ */
+void GraphVizExecutionGraphSerializer::dotFormatNodeData(
+ OutStream & os, const ExecutionContext & anEC)
+{
+ StringOutStream edAssign;
+ StringOutStream edPC;
+ StringOutStream edPtC;
+ StringOutStream edFC;
+ StringOutStream edFtC;
+
+ bool hasData = false;
+
+ const ExecutionData & anED = anEC.refExecutionData();
+
+ if( mTraceFilter.hasPathConditionPoint()
+ && (not anED.getPathCondition().isEqualTrue()) )
+ {
+ dotFormatCondition(edPC, mPathConditionPattern,
+ anED.getPathCondition() );
+
+ hasData = true;
+ }
+ else if( mTraceFilter.hasPathConditionLeafNodePoint()
+ && anEC.isLeafNode()
+ && (not anED.getPathCondition().isEqualTrue()) )
+ {
+ dotFormatCondition(edPC, mPathConditionPattern,
+ anED.getPathCondition() );
+
+ hasData = true;
+ }
+
+ if( mTraceFilter.hasPathTimedConditionPoint()
+ && (not anED.getPathTimedCondition().isEqualTrue()) )
+ {
+ dotFormatCondition(edPtC, mPathTimedConditionPattern,
+ anED.getPathTimedCondition() );
+
+ hasData = true;
+ }
+ else if( mTraceFilter.hasPathTimedConditionLeafNodePoint()
+ && anEC.isLeafNode()
+ && (not anED.getPathTimedCondition().isEqualTrue()) )
+ {
+ dotFormatCondition(edPtC, mPathTimedConditionPattern,
+ anED.getPathTimedCondition() );
+
+ hasData = true;
+ }
+
+ if( mTraceFilter.hasNodeConditionPoint()
+ && (not anED.getNodeCondition().isEqualTrue()) )
+ {
+ dotFormatCondition(edFC, mNodeConditionPattern,
+ anED.getNodeCondition() );
+
+ hasData = true;
+ }
+ if( mTraceFilter.hasNodeTimedConditionPoint()
+ && (not anED.getNodeTimedCondition().isEqualTrue()) )
+ {
+ dotFormatCondition(edFtC, mNodeTimedConditionPattern,
+ anED.getNodeTimedCondition() );
+
+ hasData = true;
+ }
+
+ if( mTraceFilter.hasAssignPoint() )
+ {
+ dotFormatAssign(edAssign, anED, anEC.isnotRoot());
+
+ hasData = hasData || (not edAssign.str().empty());
+ }
+
+
+ if( hasData )
+ {
+ boost::format formatter(mContextNodeDataPattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ os << formatter
+ % anEC.getIdNumber()
+ % edAssign.str()
+ % edPC.str()
+ % edPtC.str()
+ % edFC.str()
+ % edFtC.str();
+ }
+}
+
+/**
+ * EXECUTION CONTEXT INFO
+ * %1% --> node#id
+ * %2% --> execution info
+ */
+void GraphVizExecutionGraphSerializer::dotFormatNodeInfo(
+ OutStream & os, const ExecutionContext & anEC)
+{
+ if( anEC.hasInfo() )
+ {
+ StringOutStream ecInfo;
+
+ BFList::const_raw_iterator<
+ GenericInfoData > itInfo = anEC.getInfos().begin();
+ BFList::const_raw_iterator<
+ GenericInfoData > endInfo = anEC.getInfos().end();
+ dotFormatInfo(ecInfo, itInfo);
+ for( ++itInfo ; itInfo != endInfo ; ++itInfo )
+ {
+ ecInfo << mInfoSeparator;
+ dotFormatInfo(ecInfo, itInfo);
+ }
+
+ std::string strInfo = ecInfo.str();
+ if( not strInfo.empty() )
+ {
+ boost::format formatter(mContextNodeInfoPattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ os << formatter
+ % anEC.getIdNumber()
+ % strInfo;
+ }
+ }
+}
+
+
+/**
+ * INFO
+ * %1% --> info id
+ * %2% --> info data
+ */
+/**
+ * EXECUTION CONTEXT INFO
+ * %1% --> node#id
+ * %2% --> execution fired
+ */
+void GraphVizExecutionGraphSerializer::dotFormatNodeRunnableTrace(
+ OutStream & os, const ExecutionContext & anEC)
+{
+ if( anEC.hasRunnableElementTrace() )
+ {
+ StringOutStream ecFired;
+ dotFormatRunnableTrace(ecFired, anEC.getRunnableElementTrace());
+
+ std::string strFired = ecFired.str();
+
+ if( not strFired.empty() )
+ {
+ boost::format formatter(mContextNodeFiredPattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ os << formatter
+ % anEC.getIdNumber()
+ % strFired;
+ }
+ }
+}
+
+/**
+ * FIRED
+ * running machine
+ * fired transition
+ * invoked routine
+ */
+void GraphVizExecutionGraphSerializer::dotFormatRunnableTrace(
+ OutStream & os, const BF & aFired)
+{
+ if( aFired.is< ExecutionConfiguration >() )
+ {
+ ExecutionConfiguration * aConf =
+ aFired.to_ptr< ExecutionConfiguration >();
+
+ if( aConf->isTransition() )
+ {
+ dotFormatTransition(os,
+ aConf->getRuntimeID(), aConf->getTransition());
+ }
+ else if( aConf->isOperator() &&
+ aConf->getOperator()->isOpCode( AVM_OPCODE_RUN ) )
+ {
+ dotFormatMachine(os, aConf->getRuntimeID());
+ }
+ }
+ else if( aFired.is< AvmCode >() )
+ {
+ AvmCode * aCode = aFired.to_ptr< AvmCode >();
+
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator endCode = aCode->end();
+ for( ; it != endCode ; ++it )
+ {
+ dotFormatRunnableTrace(os, (*it));
+ }
+ }
+}
+
+/**
+ * MACHINE
+ * %1% --> machine runtime pid
+ * %2% --> machine container identifier
+ * %3% --> machine identifier
+ */
+void GraphVizExecutionGraphSerializer::dotFormatMachine(
+ OutStream & os, const RuntimeID & aRID)
+{
+ if( mTraceFilter.pass(aRID) )
+ {
+ boost::format formatter(mMachinePattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ os << formatter
+ % aRID.strPid()
+ % aRID.getInstance()->getNameID()
+ % aRID.getInstance()->getNameID()
+ << mWrapData.SEPARATOR;
+ }
+}
+
+/**
+ * TRANSITION
+ * %1% --> machine runtime pid
+ * %2% --> machine container identifier
+ * %3% --> transition identifier
+ */
+void GraphVizExecutionGraphSerializer::dotFormatTransition(OutStream & os,
+ const RuntimeID & aRID, AvmTransition * aTransition)
+{
+ if( mTraceFilter.hasTransitionPoint() )
+ {
+ boost::format formatter(mTransitionPattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ os << formatter
+ % aRID.strPid()
+ % aRID.getInstance()->getNameID()
+ % aTransition->getNameID()
+ << mWrapData.SEPARATOR;
+ }
+}
+
+/**
+ * ROUTINE
+ * %1% --> machine runtime pid
+ * %2% --> machine container identifier
+ * %3% --> routine identifier
+ */
+void GraphVizExecutionGraphSerializer::dotFormatRoutine(OutStream & os,
+ const RuntimeID & aRID, AvmProgram * aRoutine)
+{
+ if( mTraceFilter.hasRoutinePoint() )
+ {
+ boost::format formatter(mRoutinePattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ os << formatter
+ % aRID.strPid()
+ % aRID.getInstance()->getNameID()
+ % aRoutine->getNameID()
+ << mWrapData.SEPARATOR;
+ }
+}
+
+
+/**
+ * EXECUTION CONTEXT INFO
+ * %1% --> node#id
+ * %2% --> execution trace
+ */
+void GraphVizExecutionGraphSerializer::dotFormatNodeIOTrace(
+ OutStream & os, const ExecutionContext & anEC)
+{
+ StringOutStream ecTrace;
+ dotFormatIOTrace(ecTrace, anEC.getIOElementTrace());
+
+ std::string strTrace = ecTrace.str();
+
+ if( not strTrace.empty() )
+ {
+ boost::format formatter(mContextNodeTracePattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ os << formatter
+ % anEC.getIdNumber()
+ % strTrace;
+ }
+}
+
+/**
+ * TRACE
+ * input ( port | signal | message ) [ values ]
+ * output ( port | signal | message ) [ values ]
+ * newfresh variable <- value
+ */
+void GraphVizExecutionGraphSerializer::dotFormatIOTrace(
+ OutStream & os, const BF & aTrace)
+{
+ if( aTrace.is< ExecutionConfiguration >() )
+ {
+ ExecutionConfiguration * aConf =
+ aTrace.to_ptr< ExecutionConfiguration >();
+
+ if( aConf->isAvmCode() )
+ {
+ AvmCode * aCode = aConf->getAvmCode();
+
+ switch( aCode->getOptimizedOpCode() )
+ {
+ case AVM_OPCODE_INPUT_ENV:
+ {
+ if( mTraceFilter.hasInputEnvPoint()
+ && mTraceFilter.pass(aCode) )
+ {
+ dotFormatInputOutput(os, mInputEnvPattern,
+ aConf->getRuntimeID(), aCode);
+ }
+ break;
+ }
+ case AVM_OPCODE_INPUT_RDV:
+ {
+ if( mTraceFilter.hasInputRdvPoint()
+ && mTraceFilter.pass(aCode) )
+ {
+ dotFormatInputOutput(os, mInputRdvPattern,
+ aConf->getRuntimeID(), aCode);
+ }
+ break;
+ }
+ case AVM_OPCODE_INPUT:
+ {
+ if( mTraceFilter.hasInputPoint()
+ && mTraceFilter.pass(aCode) )
+ {
+ dotFormatInputOutput(os, mInputPattern,
+ aConf->getRuntimeID(), aCode);
+ }
+ break;
+ }
+
+ case AVM_OPCODE_OUTPUT_ENV:
+ {
+ if( mTraceFilter.hasOutputEnvPoint()
+ && mTraceFilter.pass(aCode) )
+ {
+ dotFormatInputOutput(os, mOutputEnvPattern,
+ aConf->getRuntimeID(), aCode);
+ }
+ break;
+ }
+ case AVM_OPCODE_OUTPUT_RDV:
+ {
+ if( mTraceFilter.hasOutputRdvPoint()
+ && mTraceFilter.pass(aCode) )
+ {
+ dotFormatInputOutput(os, mOutputRdvPattern,
+ aConf->getRuntimeID(), aCode);
+ }
+ break;
+ }
+ case AVM_OPCODE_OUTPUT:
+ {
+ if( mTraceFilter.hasOutputPoint()
+ && mTraceFilter.pass(aCode) )
+ {
+ dotFormatInputOutput(os, mOutputPattern,
+ aConf->getRuntimeID(), aCode);
+ }
+ break;
+ }
+
+ case AVM_OPCODE_ASSIGN_NEWFRESH:
+ {
+ if( mTraceFilter.hasNewfreshPoint()
+ && mTraceFilter.pass(aCode) )
+ {
+ dotFormatNewfresh(os, aConf->getRuntimeID(), aCode);
+ }
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+ }
+ }
+ else if( aTrace.is< AvmCode >() )
+ {
+ AvmCode * aCode = aTrace.to_ptr< AvmCode >();
+
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator endCode = aCode->end();
+ for( ; it != endCode ; ++it )
+ {
+ dotFormatIOTrace(os, (*it));
+ }
+ }
+}
+
+/**
+ * INPUT / OUTPUT
+ * %1% --> machine runtime pid
+ * %2% --> machine container identifier
+ * %3% --> port | signal | message identifier
+ * %4% --> value
+ * %5% --> machine sender identifier name
+ * %6% --> machine receiver identifier name
+ */
+void GraphVizExecutionGraphSerializer::dotFormatInputOutput(
+ OutStream & os, const std::string & pattern,
+ const RuntimeID & aRID, AvmCode * aCode)
+{
+ InstanceOfPort * aPort = aCode->first().to_ptr< InstanceOfPort >();
+
+ OSS oss( AVM_STR_INDENT );
+
+ if( aCode->populated() )
+ {
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator endCode = aCode->end();
+ if( (++it) != endCode )
+ {
+ oss << os.VALUE_PARAMS_CSS.BEGIN;
+
+ aPort->getParameterType(0)->formatStream(oss, (*it));
+
+ avm_size_t offset = 1;
+ for( ++it ; it != endCode ; ++it , ++offset )
+ {
+ oss << os.VALUE_PARAMS_CSS.SEPARATOR;
+
+ aPort->getParameterType(offset)->formatStream(oss, (*it));
+ }
+
+ oss << os.VALUE_PARAMS_CSS.END;
+ }
+ }
+
+ boost::format formatter(pattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ RuntimeID ridContainer = aRID.getCommunicator( aPort );
+
+ os << mWrapData << formatter
+ % ridContainer.strPid()
+ % ridContainer.getInstance()->getNameID()
+ % aCode->first().to_ptr< InstanceOfPort >()->getNameID()
+ % oss.str();
+
+ os << END_WRAP << mWrapData.SEPARATOR;
+}
+
+
+/**
+ * NEWFRESH
+ * %1% --> machine runtime pid
+ * %2% --> machine container identifier
+ * %3% --> variable identifier
+ * %4% --> value
+ */
+void GraphVizExecutionGraphSerializer::dotFormatNewfresh(OutStream & os,
+ const RuntimeID & aRID, AvmCode * aCode)
+{
+ InstanceOfData * aVar = aCode->first().to_ptr< InstanceOfData >();
+
+ boost::format formatter(mNewfreshPattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ RuntimeID ridContainer = aRID.getAncestorContaining(aVar);
+
+ os << mWrapData << formatter
+ % ridContainer.strPid()
+ % ridContainer.getInstance()->getNameID()
+ % aVar->getNameID()
+ % aVar->strValue( aCode->second() );
+
+ os << END_WRAP << mWrapData.SEPARATOR;
+}
+
+
+/**
+ * CONDITION
+ * [ Timed ] [ Path | Fired ] Condition
+ */
+void GraphVizExecutionGraphSerializer::dotFormatCondition(OutStream & os,
+ const std::string & formatPattern, const BF & aCondition)
+{
+ boost::format formatter(formatPattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ os << mWrapData << formatter % aCondition.str();
+
+ os << END_WRAP << mWrapData.SEPARATOR;
+}
+
+/**
+ * ASSIGN
+ * Assignment: var = value
+ */
+void GraphVizExecutionGraphSerializer::dotFormatAssign(
+ OutStream & os, const ExecutionData & anED, bool isnotRoot)
+{
+ TableOfInstanceOfData::const_raw_iterator itVariable;
+ TableOfInstanceOfData::const_raw_iterator endVariable;
+
+ TableOfRuntimeT::const_iterator itRF = anED.getTableOfRuntime().begin();
+ TableOfRuntimeT::const_iterator endRF = anED.getTableOfRuntime().end();
+ RuntimeForm * pRF = NULL;
+ for( ++itRF; (itRF != endRF) ; ++itRF )
+ {
+ pRF = (*itRF);
+
+ if( pRF->hasData() )
+ {
+ itVariable = pRF->getExecutable()->getAllData().begin();
+ endVariable = pRF->getExecutable()->getAllData().end();
+ for( ; itVariable != endVariable ; ++itVariable )
+ {
+ if( mDataSelectionModifiedFlags && isnotRoot )
+ {
+ if( not anED.isAssigned(
+ pRF->getRID(), itVariable->getOffset()) )
+ {
+ continue;
+ }
+ }
+
+ if( mTraceFilter.pass(pRF->getRID(),
+ static_cast< InstanceOfData * >(itVariable)) )
+ {
+ dotFormatAssign(os, pRF->getRID(), itVariable,
+ pRF->getDataTable()->get(itVariable));
+ }
+ }
+ }
+ }
+}
+
+/**
+ * ASSIGN
+ * %1% --> machine runtime pid
+ * %2% --> machine container identifier
+ * %3% --> variable identifier
+ * %4% --> value
+ */
+void GraphVizExecutionGraphSerializer::dotFormatAssign(OutStream & os,
+ const RuntimeID & aRID, InstanceOfData * aVar, const BF & aValue)
+{
+ boost::format formatter(mAssignPattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ os << mWrapData << formatter
+ % aRID.strPid()
+ % aRID.getInstance()->getNameID()
+ % aVar->getNameID()
+ % aVar->strValue( aValue );
+
+ os << END_WRAP << mWrapData.SEPARATOR;
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/serializer/GraphVizExecutionGraphSerializer.h b/org.eclipse.efm.symbex/src/fam/serializer/GraphVizExecutionGraphSerializer.h
new file mode 100644
index 0000000..15b1843
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/serializer/GraphVizExecutionGraphSerializer.h
@@ -0,0 +1,432 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 22 mars 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef FAM_SERIALIZER_GRAPHVIZEXECUTIONGRAPHSERIALIZER_H_
+#define FAM_SERIALIZER_GRAPHVIZEXECUTIONGRAPHSERIALIZER_H_
+
+#include <fam/serializer/Serializer.h>
+
+#include <fml/trace/TraceFilter.h>
+
+
+namespace sep
+{
+
+class BF;
+class RuntimeID;
+
+class OutStream;
+
+class AvmCode;
+class AvmProgram;
+class AvmTransition;
+class AvmSerializerProcessor;
+
+class Configuration;
+
+class ExecutionContext;
+class ExecutionData;
+
+class GenericInfoData;
+class InstanceOfData;
+
+
+class GraphVizExecutionGraphSerializer :
+ public AutoRegisteredSerializerProcessorUnit< GraphVizExecutionGraphSerializer >
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( GraphVizExecutionGraphSerializer )
+
+
+ /**
+ * PROCESSOR FACTORY
+ * for automatic registration in the processor repository
+ * the [ [ FULLY ] QUALIFIED ] NAME ID
+ */
+ AVM_INJECT_AUTO_REGISTER_QUALIFIED_ID_KEY_2(
+ "serializer#symbex#graphviz",
+ "GraphVizExecutionGraphSerializer")
+ // end registration
+
+
+protected:
+ /**
+ * CONSTANTS
+ * DEFAULT PROFILE
+ */
+ static const std::string & DEFAULT_GLOBAL_HEADER_PATTERN;
+
+ static const std::string & DEFAULT_GLOBAL_END_PATTERN;
+
+
+ static const std::string & DEFAULT_CONTEXT_NODE_PATTERN;
+
+ static const std::string & DEFAULT_CONTEXT_NODE_LABEL_PATTERN;
+
+ static const std::string & DEFAULT_CONTEXT_NODE_CSS_PATTERN;
+
+
+ static const std::string & DEFAULT_CONTEXT_EDGE_PATTERN;
+
+ static const std::string & DEFAULT_CONTEXT_NODE_HEADER_PATTERN;
+
+ static const std::string & DEFAULT_CONTEXT_NODE_DATA_PATTERN;
+
+ static const std::string & DEFAULT_CONTEXT_NODE_INFO_PATTERN;
+
+ static const std::string & DEFAULT_CONTEXT_NODE_FIRED_PATTERN;
+
+ static const std::string & DEFAULT_CONTEXT_NODE_TRACE_PATTERN;
+
+ static const std::string & DEFAULT_INFO_PATTERN;
+
+ static const std::string & DEFAULT_PATH_CONDITION_PATTERN;
+
+ static const std::string & DEFAULT_PATH_TIMED_CONDITION_PATTERN;
+
+ static const std::string & DEFAULT_NODE_CONDITION_PATTERN;
+
+ static const std::string & DEFAULT_NODE_TIMED_CONDITION_PATTERN;
+
+ static const std::string & DEFAULT_ASSIGN_PATTERN;
+
+ static const std::string & DEFAULT_NEWFRESH_PATTERN;
+
+ static const std::string & DEFAULT_INPUT_PATTERN;
+ static const std::string & DEFAULT_OUTPUT_PATTERN;
+
+ static const std::string & DEFAULT_INPUT_ENV_PATTERN;
+ static const std::string & DEFAULT_OUTPUT_ENV_PATTERN;
+
+ static const std::string & DEFAULT_INPUT_RDV_PATTERN;
+ static const std::string & DEFAULT_OUTPUT_RDV_PATTERN;
+
+
+ static const std::string & DEFAULT_LIFELINE_STATE_PATTERN;
+
+ static const std::string & DEFAULT_MACHINE_PATTERN;
+
+ static const std::string & DEFAULT_TRANSITION_PATTERN;
+
+ static const std::string & DEFAULT_ROUTINE_PATTERN;
+
+ static const std::string & DEFAULT_VARIABLE_PATTERN;
+
+ /**
+ * CONSTANTS
+ * STANDARD PROFILE
+ */
+ static const std::string & STANDARD_INFO_PATTERN;
+
+ /**
+ * CONSTANTS
+ * CSS PROFILE
+ */
+ static const std::string & DEFAULT_CONTEXT_NODE_COLOR;
+
+ static const std::string & WARNING_CONTEXT_NODE_COLOR;
+ static const std::string & ERROR_CONTEXT_NODE_COLOR;
+ static const std::string & ALERT_CONTEXT_NODE_COLOR;
+
+ static const std::string & OBJECTIVE_ACHIEVED_CONTEXT_NODE_COLOR;
+ static const std::string & OBJECTIVE_ACHIEVED_CONTEXT_NODE_SHAPE;
+
+ static const std::string & OBJECTIVE_FAILED_CONTEXT_NODE_COLOR;
+ static const std::string & OBJECTIVE_FAILED_CONTEXT_NODE_SHAPE;
+
+ static const std::string & OBJECTIVE_ABORTED_CONTEXT_NODE_COLOR;
+ static const std::string & OBJECTIVE_ABORTED_CONTEXT_NODE_SHAPE;
+
+ static const std::string & COVERAGE_ELEMENT_CONTEXT_NODE_COLOR;
+
+ static const std::string & REDUNDANCY_CONTEXT_NODE_COLOR;
+ static const std::string & REDUNDANCY_CONTEXT_NODE_SHAPE;
+
+ static const std::string & REDUNDANCY_TARGET_CONTEXT_NODE_COLOR;
+ static const std::string & REDUNDANCY_TARGET_CONTEXT_NODE_SHAPE;
+
+ static const std::string & DEFAULT_CONTEXT_NODE_SHAPE;
+ static const std::string & STATEMENT_EXIT_CONTEXT_NODE_SHAPE;
+
+ static const std::string & DEFAULT_CONTEXT_NODE_STYLE;
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ TraceFilter mTraceFilter;
+
+ std::string mGlobalHeaderPattern;
+ std::string mGlobalEndPattern;
+
+ std::string mContextNodePattern;
+ std::string mContextNodeLabelPattern;
+ std::string mContextNodeCssPattern;
+ std::string mContextNodeColor;
+ std::string mContextNodeShape;
+ std::string mContextNodeStyle;
+ std::string mContextNodeSeparator;
+
+ std::string mContextEdgePattern;
+
+ std::string mContextNodeHeaderPattern;
+ std::string mContextNodeDataPattern;
+ std::string mContextNodeInfoPattern;
+ std::string mContextNodeFiredPattern;
+ std::string mContextNodeTracePattern;
+
+ std::string mInfoPattern;
+ std::string mInfoJustification;
+ std::string mInfoSeparator;
+
+ std::string mPathConditionPattern;
+ std::string mPathTimedConditionPattern;
+
+ std::string mNodeConditionPattern;
+ std::string mNodeTimedConditionPattern;
+
+ std::string mAssignPattern;
+ std::string mNewfreshPattern;
+
+ std::string mInputPattern;
+ std::string mOutputPattern;
+
+ std::string mInputEnvPattern;
+ std::string mOutputEnvPattern;
+
+ std::string mInputRdvPattern;
+ std::string mOutputRdvPattern;
+
+ std::string mLifelineStatePattern;
+
+ std::string mMachinePattern;
+ std::string mTransitionPattern;
+ std::string mRoutinePattern;
+ std::string mVariablePattern;
+
+ bool mUsedSingleExecutionContextNodeFlag;
+
+ bool mShowNodeHeaderFlag;
+ bool mShowNodeDataFlag;
+ bool mShowNodeInfoFlag;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // COMPUTING VARIABLE
+ ListOfConstExecutionContext mDotFormatNodeWaitingQueue;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ GraphVizExecutionGraphSerializer(
+ SymbexControllerUnitManager & aManager, WObject * wfParameterObject)
+ : RegisteredSerializerProcessorUnit(aManager, wfParameterObject,
+ AVM_POST_PROCESSING_STAGE, DEFAULT_PRECEDENCE_OF_SERIALIZER_PROCESSOR),
+
+ mGlobalHeaderPattern( DEFAULT_GLOBAL_HEADER_PATTERN ),
+ mGlobalEndPattern( DEFAULT_GLOBAL_END_PATTERN ),
+
+ mContextNodePattern( DEFAULT_CONTEXT_NODE_PATTERN ),
+ mContextNodeLabelPattern( DEFAULT_CONTEXT_NODE_LABEL_PATTERN ),
+ mContextNodeCssPattern( DEFAULT_CONTEXT_NODE_CSS_PATTERN ),
+
+ mContextNodeColor ( DEFAULT_CONTEXT_NODE_COLOR ),
+ mContextNodeShape ( DEFAULT_CONTEXT_NODE_SHAPE ),
+ mContextNodeStyle ( DEFAULT_CONTEXT_NODE_STYLE ),
+ mContextNodeSeparator( "\\n" ),
+
+ mContextEdgePattern( DEFAULT_CONTEXT_EDGE_PATTERN ),
+
+ mContextNodeHeaderPattern( DEFAULT_CONTEXT_NODE_HEADER_PATTERN ),
+
+ mContextNodeDataPattern( DEFAULT_CONTEXT_NODE_DATA_PATTERN ),
+
+ mContextNodeInfoPattern( DEFAULT_CONTEXT_NODE_INFO_PATTERN ),
+
+ mContextNodeFiredPattern( DEFAULT_CONTEXT_NODE_FIRED_PATTERN ),
+ mContextNodeTracePattern( DEFAULT_CONTEXT_NODE_TRACE_PATTERN ),
+
+ mInfoPattern( DEFAULT_INFO_PATTERN ),
+ mInfoJustification( "\\l" ),
+ mInfoSeparator( "" ),
+
+ mPathConditionPattern( DEFAULT_PATH_CONDITION_PATTERN ),
+ mPathTimedConditionPattern( DEFAULT_PATH_TIMED_CONDITION_PATTERN ),
+
+ mNodeConditionPattern( DEFAULT_NODE_CONDITION_PATTERN ),
+ mNodeTimedConditionPattern( DEFAULT_NODE_TIMED_CONDITION_PATTERN ),
+
+ mAssignPattern( DEFAULT_ASSIGN_PATTERN ),
+ mNewfreshPattern( DEFAULT_NEWFRESH_PATTERN ),
+
+ mInputPattern ( DEFAULT_INPUT_PATTERN ),
+ mOutputPattern( DEFAULT_OUTPUT_PATTERN ),
+
+ mInputEnvPattern ( DEFAULT_INPUT_ENV_PATTERN ),
+ mOutputEnvPattern( DEFAULT_OUTPUT_ENV_PATTERN ),
+
+ mInputRdvPattern ( DEFAULT_INPUT_RDV_PATTERN ),
+ mOutputRdvPattern( DEFAULT_OUTPUT_RDV_PATTERN ),
+
+ mLifelineStatePattern( DEFAULT_LIFELINE_STATE_PATTERN ),
+
+ mMachinePattern( DEFAULT_MACHINE_PATTERN ),
+ mTransitionPattern( DEFAULT_TRANSITION_PATTERN ),
+ mRoutinePattern( DEFAULT_ROUTINE_PATTERN ),
+ mVariablePattern( DEFAULT_VARIABLE_PATTERN ),
+
+ mUsedSingleExecutionContextNodeFlag( true ),
+
+ mShowNodeHeaderFlag( true ),
+ mShowNodeDataFlag( true ),
+ mShowNodeInfoFlag( true ),
+
+ ////////////////////////////////////////////////////////////////////////////
+ // COMPUTING VARIABLE
+ mDotFormatNodeWaitingQueue( )
+ {
+ mWrapData.SEPARATOR = "\\l";
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~GraphVizExecutionGraphSerializer()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONFIGURE
+ */
+ virtual bool configureImpl();
+
+ bool configureFormatter(WObject * FORMAT, std::string & formatPattern,
+ const std::string & id, bool isRegex = false);
+
+ /**
+ * REPORT TRACE
+ */
+ virtual void reportDefault(OutStream & os) const;
+
+
+ /**
+ * FILTERING API
+ */
+ virtual bool prefilter();
+ virtual bool postfilter();
+
+ /**
+ * POST-PROCESSING API
+ */
+ virtual bool postprocess();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DEFAULT FORMAT API
+ ////////////////////////////////////////////////////////////////////////////
+
+ static void format(SymbexControllerUnitManager & aManager,
+ OutStream & out, const ExecutionContext & rootEC);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FORMAT API
+ ////////////////////////////////////////////////////////////////////////////
+
+ void dotFormat(OutStream & os, const ExecutionContext & rootEC);
+
+ void doFormatHeader(OutStream & os);
+ void doFormatEnd(OutStream & os);
+
+ void dotFormatNode(OutStream & os, const ExecutionContext & anEC);
+
+ std::string dotNodeColor(const ExecutionContext & anEC);
+ std::string dotNodeShape(const ExecutionContext & anEC);
+ std::string dotNodeStyle(const ExecutionContext & anEC);
+
+ void dotFormatEdge(OutStream & os,
+ const ExecutionContext & srcEC, const ExecutionContext & tgtEC);
+
+ void dotFormatNodeHeader(OutStream & os, const ExecutionContext & anEC);
+
+ void dotFormatNodeData(OutStream & os, const ExecutionContext & anEC);
+
+ void dotFormatNodeInfo(OutStream & os, const ExecutionContext & anEC);
+
+ void dotFormatNodeRunnableTrace(
+ OutStream & os, const ExecutionContext & anEC);
+
+ void dotFormatNodeIOTrace(OutStream & os, const ExecutionContext & anEC);
+
+ /**
+ * INFO
+ */
+ void dotFormatInfo(OutStream & os, GenericInfoData * anInfo);
+
+ /**
+ * FIRED
+ * run machine
+ * fired transition
+ * invoke routine
+ */
+ void dotFormatRunnableTrace(OutStream & os, const BF & aFired);
+
+ void dotFormatMachine(OutStream & os, const RuntimeID & aRID);
+
+ void dotFormatTransition(OutStream & os,
+ const RuntimeID & aRID, AvmTransition * aTransition);
+
+ void dotFormatRoutine(OutStream & os,
+ const RuntimeID & aRID, AvmProgram * aRoutine);
+
+ /**
+ * TRACE
+ * input ( port | signal | message ) [ values ]
+ * output ( port | signal | message ) [ values ]
+ * newfresh variable <- value
+ */
+ void dotFormatIOTrace(OutStream & os, const BF & aTrace);
+
+ void dotFormatInputOutput(OutStream & os, const std::string & pattern,
+ const RuntimeID & aRID, AvmCode * aCode);
+
+ void dotFormatNewfresh(OutStream & os,
+ const RuntimeID & aRID, AvmCode * aCode);
+
+ /**
+ * DATA
+ * [ Timed ] Path Condition
+ * Assignment: var = value
+ */
+ void dotFormatCondition(OutStream & os,
+ const std::string & formatPattern, const BF & aCondition);
+
+ void dotFormatAssign(OutStream & os,
+ const ExecutionData & anED, bool isnotRoot = true);
+
+ void dotFormatAssign(OutStream & os, const RuntimeID & aRID,
+ InstanceOfData * aVar, const BF & aValue);
+
+};
+
+
+} /* namespace sep */
+
+#endif /* FAM_SERIALIZER_GRAPHVIZEXECUTIONGRAPHSERIALIZER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/serializer/GraphVizStatemachineSerializer.cpp b/org.eclipse.efm.symbex/src/fam/serializer/GraphVizStatemachineSerializer.cpp
new file mode 100644
index 0000000..ec7bc55
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/serializer/GraphVizStatemachineSerializer.cpp
@@ -0,0 +1,940 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 22 mars 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "GraphVizStatemachineSerializer.h"
+
+#include <fml/infrastructure/Machine.h>
+#include <fml/infrastructure/PropertyPart.h>
+#include <fml/infrastructure/System.h>
+
+#include <fml/infrastructure/BehavioralPart.h>
+#include <fml/infrastructure/CompositePart.h>
+#include <fml/infrastructure/PropertyPart.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <sew/Configuration.h>
+#include <sew/SymbexControllerUnitManager.h>
+
+
+namespace sep
+{
+
+
+/*******************************************************************************
+serializer += GraphVizStatemachineSerializer <name-id> "<description>" {
+ // ...
+
+@property:
+
+@trace:
+
+@format:
+
+@vfs:
+ file = "<save-file-path>"
+}
+*******************************************************************************/
+
+/*
+prototype processor::StatemachineSerializer as GraphVizStatemachineSerializer is
+section PROPERTY
+ @info#selection = 'ALL'; // ALL | MODIFIED
+ @data#selection = 'ALL'; // ALL | MODIFIED
+endsection PROPERTY
+
+section FORMAT
+ @line#wrap#width = 42;
+ @line#wrap#separator = "\\l";
+endsection FORMAT
+
+section REPORT
+ @uri = "stream:std:cout";
+ @uri = "stream:std:cerr";
+
+ @uri = "stream:avm:log";
+ @uri = "stream:avm:trace";
+
+ @uri = "folder:report";
+ @uri = "file:report/brusselator.report";
+ @uri = "filename:brusselator";
+
+ @uri = "socket:is006163.intra.cea.fr:123456";
+
+ @when = "init:after?10#step:otf:every?5#us:before?100#macro_step:exit";
+
+ @protocol = 'STATIC'; // STATIC | DYNAMIC | STREAM
+endsection REPORT
+
+
+section MACHINE
+ @machine = true;
+ @machine#instance = true;
+ @machine#model = true;
+ @machine#prototype = true;
+
+ @procedure = true;
+ @program = true;
+ @routine = true;
+
+ @statemachine = true;
+endsection MACHINE
+
+section STATEMACHINE
+ @transition = true;
+
+ @enable = true;
+ @disable = true;
+ @routine = true;
+ endsection STATEMACHINE
+
+section TRANSITION
+ @priority = true;
+endsection TRANSITION
+
+section STATEMENT
+ @assign = true;
+
+ @com = true;
+
+ @com#env = true;
+
+ @input = true;
+ @input#env = true;
+
+ @output = true;
+ @output#env = true;
+endsection STATEMENT
+endprototype
+*/
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+
+bool GraphVizStatemachineSerializer::configureImpl()
+{
+ mConfigFlag = Serializer::configureImpl();
+
+ WObject * theSECTION = Query::getRegexWSequence(
+ getParameterWObject(), OR_WID2("property", "PROPERTY"));
+ if( theSECTION != WObject::_NULL_ )
+ {
+
+ }
+
+ theSECTION = Query::getRegexWSequence(
+ getParameterWObject(), OR_WID2("machine", "MACHINE"));
+ if( theSECTION != WObject::_NULL_ )
+ {
+ mMachineFlag = Query::getWPropertyBoolean(
+ theSECTION, "machine", true);
+
+ mMachineInstanceFlag = Query::getRegexWPropertyBoolean(
+ theSECTION, CONS_WID2("machine", "instance"), true);
+ mMachineModelFlag = Query::getRegexWPropertyBoolean(
+ theSECTION, CONS_WID2("machine", "model"), true);
+ mMachinePrototypeFlag = Query::getRegexWPropertyBoolean(
+ theSECTION, CONS_WID2("machine", "prototype"), true);
+
+
+ mProcedureFlag = Query::getWPropertyBoolean(
+ theSECTION, "procedure", true);
+
+ mProgramFlag = Query::getWPropertyBoolean(
+ theSECTION, "program", true);
+
+ mRoutineFlag = Query::getWPropertyBoolean(
+ theSECTION, "routine", true);
+
+ mStatemachineFlag = Query::getWPropertyBoolean(
+ theSECTION, "statemachine", true);
+ }
+
+ theSECTION = Query::getRegexWSequence(
+ getParameterWObject(), OR_WID2("statemachine", "STATEMACHINE"));
+ if( theSECTION != WObject::_NULL_ )
+ {
+ mTransitionFlag = Query::getWPropertyBoolean(
+ theSECTION, "transition", true);
+
+ mStatemachineDisableFlag = Query::getWPropertyBoolean(
+ theSECTION, "disable", true);
+ mStatemachineEnableFlag = Query::getWPropertyBoolean(
+ theSECTION, "enable", true);
+ }
+
+ theSECTION = Query::getRegexWSequence(
+ getParameterWObject(), OR_WID2("transition", "TRANSITION"));
+ if( theSECTION != WObject::_NULL_ )
+ {
+ mTransitionPriorityFlag = Query::getWPropertyBoolean(
+ theSECTION, "priority", true);
+ }
+
+ theSECTION = Query::getRegexWSequence(
+ getParameterWObject(), OR_WID2("statement", "STATEMENT"));
+ if( theSECTION != WObject::_NULL_ )
+ {
+ mStatementAssignFlag = Query::getWPropertyBoolean(
+ theSECTION, "assign", false);
+
+ mStatementComFlag = Query::getWPropertyBoolean(
+ theSECTION, "com", false);
+ mStatementComEnvFlag = Query::getRegexWPropertyBoolean(
+ theSECTION, CONS_WID2("com", "env"), false);
+
+ mStatementInputFlag = Query::getWPropertyBoolean(
+ theSECTION, "input", false);
+ mStatementInputEnvFlag = Query::getRegexWPropertyBoolean(
+ theSECTION, CONS_WID2("input", "env"), false);
+
+ mStatementOuputFlag = Query::getWPropertyBoolean(
+ theSECTION, "output", false);
+ mStatementOuputEnvFlag = Query::getRegexWPropertyBoolean(
+ theSECTION, CONS_WID2("output", "env"), false);
+
+ mStatementGuardFlag = Query::getWPropertyBoolean(
+ theSECTION, "guard", false);
+ mStatementTestFlag = Query::getWPropertyBoolean(
+ theSECTION, "test", false);
+ }
+
+ return( mConfigFlag );
+}
+
+
+/**
+ * REPORT TRACE
+ */
+void GraphVizStatemachineSerializer::reportDefault(OutStream & os) const
+{
+ AVM_OS_VERBOSITY_MEDIUM( os )
+ << TAB << "GRAPHVIZ STATEMACHINE SERIALIZER< "
+ << getParameterWObject()->getFullyQualifiedNameID()
+ << " > DONE !!!" << EOL_FLUSH;
+}
+
+
+/**
+ * PRE-PROCESSING API
+ */
+bool GraphVizStatemachineSerializer::preprocess()
+{
+ bool saveFlag = String::USE_BACKSLASH_QUOTE;
+ String::USE_BACKSLASH_QUOTE = true;
+
+ beginStream();
+ while( hasStream() )
+ {
+ dotFormat(currentStream(), getConfiguration().getSpecification());
+ }
+
+ String::USE_BACKSLASH_QUOTE = saveFlag;
+
+ closeStream();
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////
+// DEFAULT FORMAT API
+////////////////////////////////////////////////////////////////////////////
+
+void GraphVizStatemachineSerializer::format(
+ SymbexControllerUnitManager & aManager,
+ OutStream & out, const System & aSystem)
+{
+ AbstractProcessorUnit * existingSerializer =
+ aManager.getControllerUnit(
+ GraphVizStatemachineSerializer::AUTO_REGISTER_TOOL);
+
+ if( existingSerializer != NULL )
+ {
+ GraphVizStatemachineSerializer gvSerializer(
+ aManager, existingSerializer->getParameterWObject());
+
+ if( gvSerializer.configureImpl() )
+ {
+ gvSerializer.dotFormat(out, aSystem);
+
+ return;
+ }
+ }
+ else
+ {
+ GraphVizStatemachineSerializer gvSerializer(aManager, WObject::_NULL_);
+
+ if( gvSerializer.configureImpl() )
+ {
+ gvSerializer.dotFormat(out, aSystem);
+
+ return;
+ }
+ }
+
+ out << "digraph fscn {" << std::endl
+ << "ERROR [ " << std::endl
+ << "\tlabel=\""
+ << "Unfound,\n"
+ "in the current SymbexControllerUnitManager,\\n"
+ "an existing GraphVizStatemachineSerializer\\n"
+ "which configuration could be used\n"
+ "to configure the default GraphViz's serializer!\""
+ << std::endl
+ << "\tshape=tripleoctagon" << std::endl
+ << "\tcolor=red" << std::endl
+ << "\tstyle=filled" << std::endl
+ << "]" << std::endl
+ << "}" << std::endl;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// FORMAT API
+////////////////////////////////////////////////////////////////////////////////
+
+void GraphVizStatemachineSerializer::dotFormat(
+ OutStream & os, const System & aSystem)
+{
+ os.setSymbexValueCSS(mMultiValueArrayCSS,
+ mMultiValueParamsCSS, mMultiValueStructCSS);
+
+ os << "digraph \"" << aSystem.getNameID() << "\" {" << EOL;
+
+ os << TAB << "compound = true;" << EOL;
+
+ os << TAB << "fontsize = 12" << EOL_INCR_INDENT;
+
+ dotFormatSystem(os, aSystem);
+
+ os << DECR_INDENT_TAB << "}" << EOL2_FLUSH;
+
+ os.restoreSymbexValueCSS();
+}
+
+
+void GraphVizStatemachineSerializer::dotFormatSystem(
+ OutStream & os, const System & aSystem)
+{
+ os << TAB << "subgraph \"cluster_" << aSystem.getFullyQualifiedNameID()
+ << "\" {" << EOL;
+
+ os << TAB2 << "label = \"SYSTEM " << aSystem.getFullyQualifiedNameID()
+ << "\"" << EOL2;
+
+ os << INCR_INDENT;
+
+ if( aSystem.hasProcedure() && mProcedureFlag )
+ {
+ CompositePart::const_procedure_iterator itMachine =
+ aSystem.getCompositePart()->procedure_begin();
+ CompositePart::const_procedure_iterator endMachine =
+ aSystem.getCompositePart()->procedure_end();
+ dotFormatMachine(os, itMachine);
+ for( ++itMachine; itMachine != endMachine ; ++itMachine )
+ {
+ os << EOL;
+ dotFormatMachine(os, itMachine);
+ }
+ }
+ if( aSystem.hasMachine() )
+ {
+ CompositePart::const_machine_iterator itMachine =
+ aSystem.getCompositePart()->machine_begin();
+ CompositePart::const_machine_iterator endMachine =
+ aSystem.getCompositePart()->machine_end();
+ dotFormatMachine(os, itMachine);
+ for( ++itMachine; itMachine != endMachine ; ++itMachine )
+ {
+ os << EOL;
+ dotFormatMachine(os, itMachine);
+ }
+ }
+
+ os << DECR_INDENT;
+
+ os << TAB << "}" << EOL_FLUSH;
+}
+
+
+void GraphVizStatemachineSerializer::dotFormatMachine(
+ OutStream & os, const Machine * aMachine)
+{
+ if( aMachine->getSpecifier().isMocCompositeStructure() )
+ {
+ if( aMachine->getSpecifier().isComponentProcedure()
+ && aMachine->getCompositePart()->getMachines().singleton()
+ && aMachine->getCompositePart()->getMachines().first().
+ to_ptr< Machine >()->getSpecifier().isDesignInstanceStatic()
+ && aMachine->getCompositePart()->getProcedures().empty() )
+ {
+ dotFormatStatemachineCall(os, aMachine);
+ }
+ else
+ {
+ dotFormatCompositeStructure(os, aMachine);
+ }
+ }
+
+ else if( aMachine->getSpecifier().isMocStateTransitionStructure() )
+ {
+ dotFormatStateTransitionStructure(os, aMachine);
+ }
+
+ else if( aMachine->getSpecifier().isState() )
+ {
+ dotFormatMachineSimpleState(os, aMachine);
+ }
+ else if( aMachine->getSpecifier().isPseudostate() )
+ {
+ dotFormatMachinePseudoState(os, aMachine);
+ }
+
+ else if( aMachine->getSpecifier().isDesignInstanceStatic() )
+ {
+ if( mMachineInstanceFlag
+ && ( mProcedureFlag
+ || (not aMachine->getSpecifier().isComponentProcedure()) ) )
+ {
+ dotFormatMachineCall(os, aMachine);
+ }
+ }
+
+ else //if( (not aMachine->getSpecifier().isComponentProcedure())
+// || mProcedureFlag )
+ {
+ dotFormatMachineDefault(os, aMachine);
+ }
+}
+
+
+void GraphVizStatemachineSerializer::dotFormatMachineModelInterface(
+ OutStream & os, const Machine * aMachine)
+{
+ os << TAB << "\"" << aMachine->getFullyQualifiedNameID()
+ << "#parameters\"" << EOL;
+
+ os << TAB << "[" << EOL;
+ os << TAB2 << "label = \"|{Parameters: ";
+ if( aMachine->hasVariableParameter() )
+ {
+ os << "Input";
+ if( aMachine->hasVariableReturn() )
+ {
+ os << " / Output";
+ }
+ }
+ else if( aMachine->hasVariableReturn() )
+ {
+ os << "Output";
+ }
+
+
+ if( aMachine->hasParamReturn() )
+ {
+ std::string strValue;
+
+ if( aMachine->hasVariableParameter() )
+ {
+ os << "|";
+
+ TableOfVariable::const_raw_iterator itParam =
+ aMachine->getVariableParameters().begin();
+ TableOfVariable::const_raw_iterator endIt =
+ aMachine->getVariableParameters().end();
+ for( ; itParam != endIt ; ++itParam )
+ {
+ os << (itParam)->strT() << " " << (itParam)->getNameID();
+ if( (itParam)->hasValue() )
+ {
+ strValue = (itParam)->prettyPrintableValue();
+
+ StringTools::replaceAll(strValue, "\"", "\\\"");
+
+ os << " := " << strValue;
+ }
+ os << "\n";
+ }
+
+ }
+
+ if( aMachine->hasVariableReturn() )
+ {
+ os << "|";
+
+ TableOfVariable::const_raw_iterator itParam =
+ aMachine->getVariableReturns().begin();
+ TableOfVariable::const_raw_iterator endIt =
+ aMachine->getVariableReturns().end();
+ for( ; itParam != endIt ; ++itParam )
+ {
+ os << (itParam)->strT() << " " << (itParam)->getNameID();
+ if( (itParam)->hasValue() )
+ {
+ strValue = (itParam)->prettyPrintableValue();
+
+ StringTools::replaceAll(strValue, "\"", "\\\"");
+
+ os << " =: " << strValue;
+ }
+ os << "\n";
+ }
+
+ }
+ }
+ os << "}|\"" << EOL;
+
+ os << TAB2 << "shape=Mrecord, style=bold, color=blue" << EOL;
+
+ os << TAB << "];" << EOL2;
+
+
+ if( aMachine->hasOutgoingTransition() )
+ {
+ BehavioralPart::const_transition_iterator itTransition =
+ aMachine->getBehavior()->outgoing_transition_begin();
+ BehavioralPart::const_transition_iterator endTransition =
+ aMachine->getBehavior()->outgoing_transition_end();
+ for( ; itTransition != endTransition ; ++itTransition )
+ {
+ os << EOL;
+ dotFormatTransition( os, itTransition);
+ }
+ }
+}
+
+
+void GraphVizStatemachineSerializer::dotFormatMachineCall(
+ OutStream & os, const Machine * aMachine)
+{
+ os << TAB << "\"" << aMachine->getFullyQualifiedNameID() << "\"" << EOL;
+
+ os << TAB << "[" << EOL;
+ os << TAB2 << "label = \"|{";
+ if( aMachine->getSpecifier().isComponentProcedure() )
+ {
+ os << "caller: " << aMachine->getContainerMachine()->getNameID();
+ }
+ else
+ {
+ os << "model: " << aMachine->getModelMachine()->getNameID();
+ }
+ os << "|" << aMachine->getNameID();
+
+ if( aMachine->hasParamReturn() )
+ {
+ std::string strValue;
+
+ if( aMachine->hasVariableParameter() )
+ {
+ os << "|";
+
+ TableOfVariable::const_raw_iterator itParam =
+ aMachine->getVariableParameters().begin();
+ TableOfVariable::const_raw_iterator endIt =
+ aMachine->getVariableParameters().end();
+ for( ; itParam != endIt ; ++itParam )
+ {
+ os << (itParam)->getNameID();
+ if( (itParam)->hasValue() )
+ {
+ strValue = (itParam)->prettyPrintableValue();
+
+ StringTools::replaceAll(strValue, "\"", "\\\"");
+
+ os << " := " << strValue;
+ }
+ os << "\n";
+ }
+
+ }
+
+ if( aMachine->hasVariableReturn() )
+ {
+ os << "|";
+
+ TableOfVariable::const_raw_iterator itParam =
+ aMachine->getVariableReturns().begin();
+ TableOfVariable::const_raw_iterator endIt =
+ aMachine->getVariableReturns().end();
+ for( ; itParam != endIt ; ++itParam )
+ {
+ os << (itParam)->getNameID();
+ if( (itParam)->hasValue() )
+ {
+ strValue = (itParam)->prettyPrintableValue();
+
+ StringTools::replaceAll(strValue, "\"", "\\\"");
+
+ os << "=:" << strValue;
+ }
+ os << "\n";
+ }
+
+ }
+ }
+ os << "}|\"" << EOL;
+
+ os << TAB2 << "shape=Mrecord, style=bold, color=orange" << EOL;
+
+ os << TAB << "];" << EOL;
+
+
+ if( aMachine->hasOutgoingTransition() )
+ {
+ BehavioralPart::const_transition_iterator itTransition =
+ aMachine->getBehavior()->outgoing_transition_begin();
+ BehavioralPart::const_transition_iterator endTransition =
+ aMachine->getBehavior()->outgoing_transition_end();
+ for( ; itTransition != endTransition ; ++itTransition )
+ {
+ os << EOL;
+ dotFormatTransition( os, itTransition);
+ }
+ }
+}
+
+
+void GraphVizStatemachineSerializer::dotFormatStatemachineCall(
+ OutStream & os, const Machine * aMachine)
+{
+ os << TAB << "\"" << aMachine->getFullyQualifiedNameID() << "\"" << EOL;
+
+ os << TAB << "[" << EOL;
+ os << TAB2 << "label = \"|\n" //<< aMachine->getNameID() << "\n\n|\n"
+ << aMachine->getCompositePart()->
+ getMachines().first().to_ptr< Machine >()->getNameID()
+ << "\n\n|\"" << EOL;
+
+ os << TAB2 << "shape=Mrecord, style=bold, color=orange" << EOL;
+
+ os << TAB << "];" << EOL;
+
+
+ if( aMachine->hasOutgoingTransition() )
+ {
+ BehavioralPart::const_transition_iterator itTransition =
+ aMachine->getBehavior()->outgoing_transition_begin();
+ BehavioralPart::const_transition_iterator endTransition =
+ aMachine->getBehavior()->outgoing_transition_end();
+ for( ; itTransition != endTransition ; ++itTransition )
+ {
+ os << EOL;
+ dotFormatTransition( os, itTransition);
+ }
+ }
+}
+
+
+void GraphVizStatemachineSerializer::dotFormatCompositeStructure(
+ OutStream & os, const Machine * aMachine)
+{
+ os << TAB << "subgraph \"cluster_" << aMachine->getFullyQualifiedNameID()
+ << "\" {" << EOL;
+
+ os << TAB2 << "label = \"" << aMachine->getNameID() << "\"" << EOL;
+ os << TAB2 << "style=bold" << ";" << EOL2;
+
+ // invisible target state
+ os << TAB2 << "\"" << aMachine->getFullyQualifiedNameID() << "\"" << EOL;
+ os << TAB2 << "[" << EOL;
+ os << TAB3 << "label = \"" << aMachine->getNameID() << "\"" << EOL;
+ os << TAB3 << "shape=point, style=invisible, color=white" << EOL;
+ os << TAB2 << "];" << EOL2;
+
+ os << INCR_INDENT;
+
+ if( aMachine->hasParamReturn() )
+ {
+ dotFormatMachineModelInterface(os, aMachine);
+ }
+
+ if( aMachine->hasProcedure() && mProcedureFlag )
+ {
+ CompositePart::const_procedure_iterator itMachine =
+ aMachine->getCompositePart()->procedure_begin();
+ CompositePart::const_procedure_iterator endMachine =
+ aMachine->getCompositePart()->procedure_end();
+ dotFormatMachine(os, itMachine);
+ for( ++itMachine; itMachine != endMachine ; ++itMachine )
+ {
+ os << EOL;
+ dotFormatMachine(os, itMachine);
+ }
+ }
+ if( aMachine->hasMachine() )
+ {
+ CompositePart::const_machine_iterator itMachine =
+ aMachine->getCompositePart()->machine_begin();
+ CompositePart::const_machine_iterator endMachine =
+ aMachine->getCompositePart()->machine_end();
+ dotFormatMachine(os, itMachine);
+ for( ++itMachine; itMachine != endMachine ; ++itMachine )
+ {
+ os << EOL;
+ dotFormatMachine(os, itMachine);
+ }
+ }
+
+ os << DECR_INDENT;
+
+ os << TAB << "}" << EOL;
+
+ if( aMachine->hasOutgoingTransition() )
+ {
+ BehavioralPart::const_transition_iterator itTransition =
+ aMachine->getBehavior()->outgoing_transition_begin();
+ BehavioralPart::const_transition_iterator endTransition =
+ aMachine->getBehavior()->outgoing_transition_end();
+ for( ; itTransition != endTransition ; ++itTransition )
+ {
+ os << EOL;
+ dotFormatTransition( os, itTransition);
+ }
+ }
+}
+
+
+void GraphVizStatemachineSerializer::dotFormatStateTransitionStructure(
+ OutStream & os, const Machine * aMachine)
+{
+ os << TAB << "subgraph \"cluster_"
+ << aMachine->getFullyQualifiedNameID() << "\" {" << EOL;
+
+ os << TAB2 << "label = \"" << aMachine->getNameID();
+// if( isMOE )
+// {
+// os << "\\l" << "\\l" << labelMOE);
+// }
+ os << "\"" << EOL_TAB2 << "style=dashed;" << EOL2;
+
+ // invisible target state for transitions
+ os << TAB2 << "\"" << aMachine->getFullyQualifiedNameID() << "\"" << EOL;
+ os << TAB2 << "[" << EOL;
+ os << TAB3 << "label = \"" << aMachine->getNameID();
+
+ os << "\"" << EOL;
+ os << TAB3 << "shape=point, style=invisible, color=white" << EOL;
+ os << TAB2 << "];" << EOL2;
+
+ os << INCR_INDENT;
+
+ if( aMachine->hasParamReturn() )
+ {
+ dotFormatMachineModelInterface(os, aMachine);
+ }
+
+ if( aMachine->hasProcedure() && mProcedureFlag )
+ {
+ CompositePart::const_procedure_iterator itMachine =
+ aMachine->getCompositePart()->procedure_begin();
+ CompositePart::const_procedure_iterator endMachine =
+ aMachine->getCompositePart()->procedure_end();
+ dotFormatMachine(os, itMachine);
+ for( ++itMachine; itMachine != endMachine ; ++itMachine )
+ {
+ os << EOL;
+ dotFormatMachine(os, itMachine);
+ }
+ }
+ if( aMachine->hasMachine() )
+ {
+ CompositePart::const_machine_iterator itMachine =
+ aMachine->getCompositePart()->machine_begin();
+ CompositePart::const_machine_iterator endMachine =
+ aMachine->getCompositePart()->machine_end();
+ dotFormatMachine(os, itMachine);
+ for( ++itMachine; itMachine != endMachine ; ++itMachine )
+ {
+ os << EOL;
+ dotFormatMachine(os, itMachine);
+ }
+ }
+
+ os << DECR_INDENT;
+
+ os << TAB << "}" << EOL;
+
+ if( aMachine->hasOutgoingTransition() )
+ {
+ BehavioralPart::const_transition_iterator itTransition =
+ aMachine->getBehavior()->outgoing_transition_begin();
+ BehavioralPart::const_transition_iterator endTransition =
+ aMachine->getBehavior()->outgoing_transition_end();
+ for( ; itTransition != endTransition ; ++itTransition )
+ {
+ os << EOL;
+ dotFormatTransition( os, itTransition);
+ }
+ }
+}
+
+
+void GraphVizStatemachineSerializer::dotFormatMachineDefault(
+ OutStream & os, const Machine * aMachine)
+{
+ if( aMachine->hasMachine() || aMachine->hasParamReturn() )
+ {
+ dotFormatCompositeStructure(os, aMachine);
+ }
+ else
+ {
+ os << TAB << "\"" << aMachine->getFullyQualifiedNameID() << "\"" << EOL;
+
+ os << TAB << "[" << EOL;
+ os << TAB2 << "label = \"" << aMachine->getNameID() << "\"" << EOL;
+
+ os << TAB2 << "shape=box, style=bold, color=blue" << EOL;
+
+ os << TAB << "];" << EOL;
+
+ if( aMachine->hasOutgoingTransition() )
+ {
+ BehavioralPart::const_transition_iterator itTransition =
+ aMachine->getBehavior()->outgoing_transition_begin();
+ BehavioralPart::const_transition_iterator endTransition =
+ aMachine->getBehavior()->outgoing_transition_end();
+ for( ; itTransition != endTransition ; ++itTransition )
+ {
+ os << EOL;
+ dotFormatTransition( os, itTransition);
+ }
+ }
+ }
+}
+
+
+void GraphVizStatemachineSerializer::dotFormatMachineSimpleState(
+ OutStream & os, const Machine * aMachine)
+{
+ os << TAB << "\"" << aMachine->getFullyQualifiedNameID() << "\"" << EOL;
+
+ os << TAB << "[" << EOL;
+ os << TAB2 << "label = \"" << aMachine->getNameID() << "\"" << EOL;
+
+ os << TAB2;
+ if( aMachine->getSpecifier().isStateStart() )
+ {
+ os << "shape=ellipse, style=\"bold,filled\", fillcolor=green";
+ }
+ else if( aMachine->getSpecifier().isStateFinal() )
+ {
+ os << "shape=Mcircle, style=\"bold,filled\", fillcolor=red";
+ }
+ else if( aMachine->getSpecifier().isStateSync() )
+ {
+ os << "shape=doublecircle, style=\"bold,filled\", color=orange";
+ }
+ else
+ {
+ os << "shape=ellipse, style=\"bold,filled\", color=skyblue";
+ }
+ os << EOL;
+
+ os << TAB << "];" << EOL;
+
+
+ if( aMachine->hasOutgoingTransition() )
+ {
+ BehavioralPart::const_transition_iterator itTransition =
+ aMachine->getBehavior()->outgoing_transition_begin();
+ BehavioralPart::const_transition_iterator endTransition =
+ aMachine->getBehavior()->outgoing_transition_end();
+ for( ; itTransition != endTransition ; ++itTransition )
+ {
+ os << EOL;
+ dotFormatTransition( os, itTransition);
+ }
+ }
+}
+
+
+void GraphVizStatemachineSerializer::dotFormatMachinePseudoState(
+ OutStream & os, const Machine * aMachine)
+{
+ os << TAB << "\"" << aMachine->getFullyQualifiedNameID() << "\"" << EOL;
+
+ os << TAB << "[" << EOL;
+ os << TAB2 << "label = \"" << aMachine->getNameID() << "\"" << EOL;
+
+ os << TAB2;
+ if( aMachine->getSpecifier().isPseudostateInitial() )
+ {
+ os << "shape=oval, style=\"filled\", fillcolor=green";
+ }
+ else if( aMachine->getSpecifier().isPseudostateJunction() )
+ {
+ os << "shape=octagon, style=\"filled\", fillcolor=green";
+ }
+ else if( aMachine->getSpecifier().isPseudostateChoice() )
+ {
+ os << "shape=octagon, style=\"filled\", fillcolor=orange";
+ }
+ else if( aMachine->getSpecifier().isPseudostateTerminal() )
+ {
+ os << "shape=Msquare, style=\"filled\", fillcolor=red";
+ }
+ else if( aMachine->getSpecifier().isPseudostateReturn() )
+ {
+ os << "shape=invhouse, style=\"filled\", fillcolor=greenyellow";
+ }
+ else
+ {
+ os << "shape=ellipse, style=\"filled\", color=cyan";
+ }
+ os << EOL;
+
+ os << TAB << "];" << EOL;
+
+
+ if( aMachine->hasOutgoingTransition() )
+ {
+ BehavioralPart::const_transition_iterator itTransition =
+ aMachine->getBehavior()->outgoing_transition_begin();
+ BehavioralPart::const_transition_iterator endTransition =
+ aMachine->getBehavior()->outgoing_transition_end();
+ for( ; itTransition != endTransition ; ++itTransition )
+ {
+ os << EOL;
+ dotFormatTransition( os, itTransition);
+ }
+ }
+}
+
+
+void GraphVizStatemachineSerializer::dotFormatTransition(
+ OutStream & os, const Transition * aTransition)
+{
+ // SOURCE -> TARGET
+ std::string targetUfi = (aTransition->hasTarget() ?
+ aTransition->getTarget().str() : "#Last#Active#State" );
+
+ os << TAB << "\"" << aTransition->getSource()->getFullyQualifiedNameID()
+ << "\" -> " << "\"" << targetUfi << "\" "
+ << "[ label = \"" << aTransition->getNameID() << "\"";
+
+ if( aTransition->hasMocElse() )
+ {
+ os << ", color=orange";
+ }
+
+ os << " ];" << EOL_FLUSH;
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/serializer/GraphVizStatemachineSerializer.h b/org.eclipse.efm.symbex/src/fam/serializer/GraphVizStatemachineSerializer.h
new file mode 100644
index 0000000..a47d630
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/serializer/GraphVizStatemachineSerializer.h
@@ -0,0 +1,208 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 22 mars 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef FAM_SERIALIZER_GRAPHVIZSTATEMACHINESERIALIZER_H_
+#define FAM_SERIALIZER_GRAPHVIZSTATEMACHINESERIALIZER_H_
+
+#include <fam/serializer/Serializer.h>
+
+
+namespace sep
+{
+
+class OutStream;
+class AvmSerializerProcessor;
+class Machine;
+class System;
+class Transition;
+
+
+class GraphVizStatemachineSerializer :
+ public AutoRegisteredSerializerProcessorUnit< GraphVizStatemachineSerializer >
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( GraphVizStatemachineSerializer )
+
+
+ /**
+ * PROCESSOR FACTORY
+ * for automatic registration in the processor repository
+ * the [ [ FULLY ] QUALIFIED ] NAME ID
+ */
+ AVM_INJECT_AUTO_REGISTER_QUALIFIED_ID_KEY_2(
+ "serializer#model#graphviz",
+ "GraphVizStatemachineSerializer")
+ // end registration
+
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ bool mMachineFlag;
+ bool mMachineInstanceFlag;
+ bool mMachineModelFlag;
+ bool mMachinePrototypeFlag;
+
+ bool mProcedureFlag;
+ bool mProgramFlag;
+ bool mRoutineFlag;
+
+ bool mStatemachineFlag;
+
+ bool mStatemachineDisableFlag;
+ bool mStatemachineEnableFlag;
+
+ bool mTransitionFlag;
+ bool mTransitionPriorityFlag;
+
+ bool mStatementFlag;
+ bool mStatementAssignFlag;
+
+ bool mStatementComFlag;
+ bool mStatementComEnvFlag;
+
+ bool mStatementInputFlag;
+ bool mStatementInputEnvFlag;
+
+ bool mStatementOuputFlag;
+ bool mStatementOuputEnvFlag;
+
+ bool mStatementGuardFlag;
+ bool mStatementTestFlag;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ GraphVizStatemachineSerializer(
+ SymbexControllerUnitManager & aManager, WObject * wfParameterObject)
+ : RegisteredSerializerProcessorUnit(aManager, wfParameterObject,
+ AVM_PRE_PROCESSING_STAGE, DEFAULT_PRECEDENCE_OF_SERIALIZER_PROCESSOR),
+
+ mMachineFlag( true ),
+
+ mMachineInstanceFlag( true ),
+ mMachineModelFlag( true ),
+ mMachinePrototypeFlag( true ),
+
+ mProcedureFlag( true ),
+ mProgramFlag( true ),
+ mRoutineFlag( true ),
+ mStatemachineFlag( true ),
+
+ mStatemachineDisableFlag( true ),
+ mStatemachineEnableFlag( true ),
+
+ mTransitionFlag( true ),
+ mTransitionPriorityFlag( false ),
+
+ mStatementFlag( false ),
+ mStatementAssignFlag( false ),
+
+ mStatementComFlag( true ),
+ mStatementComEnvFlag( false ),
+
+ mStatementInputFlag( false ),
+ mStatementInputEnvFlag( false ),
+
+ mStatementOuputFlag( false ),
+ mStatementOuputEnvFlag( false ),
+
+ mStatementGuardFlag( false ),
+ mStatementTestFlag( false )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~GraphVizStatemachineSerializer()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONFIGURE
+ */
+ virtual bool configureImpl();
+
+ /**
+ * REPORT TRACE
+ */
+ virtual void reportDefault(OutStream & os) const;
+
+ /**
+ * PRE-POST PROCESSING API
+ */
+ virtual bool preprocess();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DEFAULT FORMAT API
+ ////////////////////////////////////////////////////////////////////////////
+
+ static void format(SymbexControllerUnitManager & aManager,
+ OutStream & out, const System & aSystem);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FORMAT API
+ ////////////////////////////////////////////////////////////////////////////
+
+ void dotFormat(OutStream & os, const System & aSystem);
+
+ void dotFormatSystem(OutStream & os, const System & aSystem);
+
+ void dotFormatMachine(OutStream & os, const Machine * aMachine);
+
+
+ void dotFormatMachineModelInterface(
+ OutStream & os, const Machine * aMachine);
+
+ void dotFormatMachineCall(
+ OutStream & os, const Machine * aMachine);
+
+ void dotFormatStatemachineCall(
+ OutStream & os, const Machine * aMachine);
+
+ void dotFormatCompositeStructure(
+ OutStream & os, const Machine * aMachine);
+ void dotFormatStateTransitionStructure(
+ OutStream & os, const Machine * aMachine);
+
+ void dotFormatMachineDefault(
+ OutStream & os, const Machine * aMachine);
+
+
+ void dotFormatMachineSimpleState(
+ OutStream & os, const Machine * aMachine);
+
+ void dotFormatMachinePseudoState(
+ OutStream & os, const Machine * aMachine);
+
+ void dotFormatTransition(
+ OutStream & os, const Transition * aTransition);
+
+};
+
+
+} /* namespace sep */
+
+#endif /* FAM_SERIALIZER_GRAPHVIZSTATEMACHINESERIALIZER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/serializer/Serializer.cpp b/org.eclipse.efm.symbex/src/fam/serializer/Serializer.cpp
new file mode 100644
index 0000000..affb20d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/serializer/Serializer.cpp
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 22 mars 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "Serializer.h"
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <boost/format.hpp>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+prototype processor::serializer#graph "serialize graph" as avm::processor.SERIALIZER is
+section PROPERTY
+ @info#selection = 'ALL'; // ALL | MODIFIED
+ @data#selection = 'ALL'; // ALL | MODIFIED
+endsection PROPERTY
+
+section FORMAT
+ @line#wrap#width = 42;
+ @line#wrap#separator = "\\l";
+endsection FORMAT
+
+endprototype
+*/
+
+bool Serializer::configureImpl()
+{
+ WObject * thePROPERTY = Query::getRegexWSequence(
+ getParameterWObject(), OR_WID2("property", "PROPERTY"));
+ if( thePROPERTY != WObject::_NULL_ )
+ {
+ mInfoAllFlags = (Query::getRegexWPropertyString(
+ thePROPERTY, CONS_WID2("info", "selection"), "ALL") == "ALL");
+
+ mDataSelectionModifiedFlags = (Query::getRegexWPropertyString(
+ thePROPERTY, CONS_WID2("data", "selection"), "MODIFIED") == "MODIFIED");
+ }
+
+ WObject * theFORMAT = Query::getRegexWSequence(getParameterWObject(),
+ OR_WID2("format", "FORMAT"), thePROPERTY);
+ if( theFORMAT != WObject::_NULL_ )
+ {
+ mWrapData.LINE_WIDTH = Query::getRegexWPropertyPosSizeT(theFORMAT,
+ CONS_WID3("line", "wrap", "width"), mDefaultLineWrapWidth);
+
+ mWrapData.SEPARATOR = Query::getRegexWPropertyString(theFORMAT,
+ CONS_WID3("line", "wrap", "separator"), mWrapData.SEPARATOR);
+ StringTools::replaceAll(mWrapData.SEPARATOR, "\\t" , "\t");
+ StringTools::replaceAll(mWrapData.SEPARATOR, "\\n" , "\n");
+
+ mMultiValueArrayCSS.BEGIN = Query::getRegexWPropertyString(
+ theFORMAT, CONS_WID3("value", "array", "begin"), "[ ");
+ mMultiValueArrayCSS.SEPARATOR = Query::getRegexWPropertyString(
+ theFORMAT, CONS_WID3("value", "array", "separator"), " , ");
+ mMultiValueArrayCSS.END = Query::getRegexWPropertyString(
+ theFORMAT, CONS_WID3("value", "array", "end"), " ]");
+
+ mMultiValueParamsCSS.BEGIN = Query::getRegexWPropertyString(theFORMAT,
+ CONS_WID3("value", "param(eter)?s?", "begin"), "( ");
+ mMultiValueParamsCSS.SEPARATOR = Query::getRegexWPropertyString(theFORMAT,
+ CONS_WID3("value", "param(eter)?s?", "separator"), " , ");
+ mMultiValueParamsCSS.END = Query::getRegexWPropertyString(theFORMAT,
+ CONS_WID3("value", "param(eter)?s?", "end"), " )");
+
+ mMultiValueStructCSS.BEGIN = Query::getRegexWPropertyString(
+ theFORMAT, CONS_WID3("value", "struct", "begin"), "{ ");
+ mMultiValueStructCSS.SEPARATOR = Query::getRegexWPropertyString(
+ theFORMAT, CONS_WID3("value", "struct", "separator"), " , ");
+ mMultiValueStructCSS.END = Query::getRegexWPropertyString(
+ theFORMAT, CONS_WID3("value", "struct", "end"), " }");
+ }
+
+ return( true );
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/serializer/Serializer.h b/org.eclipse.efm.symbex/src/fam/serializer/Serializer.h
new file mode 100644
index 0000000..e4e8c3d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/serializer/Serializer.h
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 22 mars 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef FAM_SERIALIZER_SERIALIZER_H_
+#define FAM_SERIALIZER_SERIALIZER_H_
+
+#include <fam/api/AbstractProcessorUnit.h>
+
+#include <printer/OutStream.h>
+
+
+namespace sep
+{
+
+class Serializer : public AbstractProcessorUnit
+{
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ static const avm_size_t mDefaultLineWrapWidth = 42;
+
+ WrapData mWrapData;
+
+ bool mInfoAllFlags;
+ bool mDataSelectionModifiedFlags;
+
+ SymbexValueCSS mMultiValueArrayCSS;
+ SymbexValueCSS mMultiValueParamsCSS;
+ SymbexValueCSS mMultiValueStructCSS;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Serializer(SymbexControllerUnitManager & aManager, WObject * wfParameterObject,
+ avm_computing_process_stage_t requiredStage,
+ const avm_uint8_t * aPrecedence/* = DEFAULT_PRECEDENCE_OF_PROCESSOR*/)
+ : AbstractProcessorUnit(aManager, wfParameterObject, requiredStage, aPrecedence),
+ mWrapData( mDefaultLineWrapWidth , 0 , 4 ,"\n" ),
+
+ mInfoAllFlags( true ),
+ mDataSelectionModifiedFlags( true ),
+
+ mMultiValueArrayCSS ( DEFAULT_SYMBEX_VALUE_ARRAY_CSS ),
+ mMultiValueParamsCSS( DEFAULT_SYMBEX_VALUE_PARAMS_CSS ),
+ mMultiValueStructCSS( DEFAULT_SYMBEX_VALUE_STRUCT_CSS )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Serializer()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONFIGURE
+ */
+ bool configureImpl();
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+// PROCESSOR UNIT AUTO REGISTRATION FACTORY
+// for automatic registration in the processor repository
+////////////////////////////////////////////////////////////////////////////////
+
+template< class ProcessorT >
+class AutoRegisteredSerializerProcessorUnit : public Serializer
+{
+
+public:
+ /**
+ * TYPDEDEF
+ */
+ typedef AutoRegisteredSerializerProcessorUnit< ProcessorT >
+ RegisteredSerializerProcessorUnit;
+
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AutoRegisteredSerializerProcessorUnit(SymbexControllerUnitManager & aManager,
+ WObject * wfParameterObject, avm_computing_process_stage_t requiredStage,
+ const avm_uint8_t * aPrecedence/* = DEFAULT_PRECEDENCE_OF_PROCESSOR*/)
+ : Serializer(aManager, wfParameterObject, requiredStage, aPrecedence)
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AutoRegisteredSerializerProcessorUnit()
+ {
+ // Force Instanciate
+ (void) & AUTO_REGISTER_TOOL;
+ }
+
+
+ /**
+ * PROCESSOR FACTORY
+ * for automatic registration in the processor repository
+ */
+ static struct AutoRegisterProcessorFactory :
+ public ProcessorUnitRegistrationImpl< ProcessorT >
+ {
+ AutoRegisterProcessorFactory()
+ : ProcessorUnitRegistrationImpl< ProcessorT >(
+ ProcessorT::QNID() , ProcessorT::QNID1() ,
+ ProcessorT::QNID2(), ProcessorT::QNID3() )
+ {
+ //!! NOTHING
+ }
+
+ } AUTO_REGISTER_TOOL;
+ // end registration
+
+
+ /**
+ * API
+ */
+ inline const IProcessorUnitRegistration & REGISTER_TOOL() const
+ {
+ return( AUTO_REGISTER_TOOL );
+ }
+
+ inline bool isRegisterTool(
+ const IProcessorUnitRegistration & aRegisterTool) const
+ {
+ return( AUTO_REGISTER_TOOL.isEquals( aRegisterTool ) );
+ }
+
+};
+
+
+template< class ProcessorT > typename
+AutoRegisteredSerializerProcessorUnit< ProcessorT >::AutoRegisterProcessorFactory
+AutoRegisteredSerializerProcessorUnit< ProcessorT >::AUTO_REGISTER_TOOL;
+
+
+} /* namespace sep */
+
+#endif /* FAM_SERIALIZER_SERIALIZER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/testing/OfflineTestProcessor.cpp b/org.eclipse.efm.symbex/src/fam/testing/OfflineTestProcessor.cpp
new file mode 100644
index 0000000..1015fca
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/testing/OfflineTestProcessor.cpp
@@ -0,0 +1,3116 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: fev. 2012
+ *
+ * Contributors:
+ * Jose Escobedo (CEA LIST) jose.escobedo@cea.fr
+ * Mathilde Arnaud (CEA LIST) mathilde.arnaud@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "OfflineTestProcessor.h"
+
+#include <algorithm>
+#include <iostream>
+#include <fstream>
+#include <string>
+#include <sstream>
+#include <iterator>
+
+#include <boost/algorithm/string.hpp>
+#include <boost/lexical_cast.hpp>
+#include <boost/regex.hpp>
+#include <boost/tuple/tuple.hpp>
+#include <boost/tuple/tuple_comparison.hpp>
+
+#include <util/avm_util.h>
+#include <util/avm_vfs.h>
+
+#include <builder/Builder.h>
+
+#include <computer/primitive/AvmCommunicationFactory.h>
+#include <computer/PathConditionProcessor.h>
+
+#include <collection/Typedef.h>
+
+#include <fml/numeric/Float.h>
+#include <fml/numeric/Number.h>
+
+#include <fml/expression/ExpressionConstant.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/ExpressionTypeChecker.h>
+
+#include <fml/executable/ExecutableQuery.h>
+#include <fml/executable/InstanceOfData.h>
+
+#include <fml/infrastructure/ComProtocol.h>
+
+#include <fml/runtime/ExecutionConfiguration.h>
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/ExecutionInformation.h>
+#include <fml/runtime/RuntimeQuery.h>
+
+#include <fml/template/TimedMachine.h>
+
+#include <fml/trace/TraceFactory.h>
+
+#include <fam/api/ProcessorUnitRepository.h>
+#include <fam/queue/ExecutionQueue.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <sew/Configuration.h>
+
+#include <solver/api/SolverFactory.h>
+
+
+namespace sep
+{
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+OfflineTestProcessor::OfflineTestProcessor(
+ SymbexControllerUnitManager & aControllerUnitManager,
+ WObject * wfParameterObject)
+: RegisteredProcessorUnit(aControllerUnitManager , wfParameterObject,
+ AVM_PREPOST_FILTERING_STAGE | AVM_POST_PROCESSING_STAGE,
+ PRECEDENCE_OF_TEST_OFFLINE),
+
+INFO_OFFLINETEST_DATA( new Identifier( "OFFLINE_TEST" ) ),
+INFO_OFFLINETEST_DATA_PASS( new Identifier( "OFFLINE_TEST_PASS" ) ),
+INFO_OFFLINETEST_DATA_INCONC( new Identifier( "OFFLINE_TEST_INCONC" ) ),
+INFO_OFFLINETEST_DATA_FAIL( new Identifier( "OFFLINE_TEST_FAIL" ) ),
+INFO_OFFLINETEST_TP_PATH( new Identifier( "TEST_PURPOSE_PATH" ) ),
+INFO_OFFLINETEST_TARGET_STATE( new Identifier( "TARGET_STATE" ) ),
+
+theVerdictKind( VERDICT_UNDEFINED_KIND ),
+
+theSolverKind( SolverDef::SOLVER_CVC4_KIND ),
+theTrace( ),
+theMergeTrace( ),
+
+theTimedVarsVector( ),
+traceInPath( 0 ),
+verdictEmitted( false ),
+theVerdict( ),
+theTestPurpose( ),
+theTimeVarInstance( ),
+theLeavesECVector( ),
+timeReferenceInstance( ),
+theObsSignals( ),
+theTraceFilter( ),
+theErasedNodes( 0 ),
+timedFlag( ),
+
+theMainExecutionData( getConfiguration().getMainExecutionData() )
+{
+ //!! NOTHING
+}
+
+/*
+prototype process::offline_test "offline_test" as &avm::processor.OFFLINETEST is
+ section PROPERTY
+ // 'OMEGA' | 'CVC4' | 'Z3' | 'YICES'
+ @solver = 'CVC4';
+ endsection PROPERTY
+
+ section MERGED_TRACE
+ @mergedTraceFile="merged_trace.txt";
+ //optional
+ @timeVar="spec::system.deltaT";
+ //optional
+ @testPurposeFile="test_purpose.txt";
+ endsection MERGED_TRACE
+
+ section TIME_HANDLING
+ //optional
+ @currentTime = "inst::system.T";
+ endsection TIME_HANDLING
+
+ // deprecated
+ section OBSERVABLE_SIGNAL
+ @machine = "m1";
+ @port= "p1";
+ @sens = "?";
+ @machine = "m2";
+ @port= "p2";
+ @sens = "!";
+ endsection OBSERVABLE_SIGNAL
+
+ section OBSERVABLE
+ @input = "machine_instance1->signal1";
+ @output = "machine_instance2->signal2";
+ @input = "machine_instance3->signal1";
+ @output = "machine_instance3->signal2";
+ endsection
+
+ section CONTROLLABLE
+ @input = "machine_instance3->signal1";
+ endsection CONTROLLABLE
+
+
+endprototype
+ */
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+
+bool OfflineTestProcessor::configureImpl()
+{
+ WObject * thePROPERTY = Query::getRegexWSequence(
+ mParameterWObject, OR_WID2("property", "PROPERTY"));
+ std::string format;
+ if( thePROPERTY != WObject::_NULL_ )
+ {
+ std::string theSolverID =
+ Query::getWPropertyString(thePROPERTY, "solver", "");
+
+ theSolverKind = SolverDef::toSolver(
+ theSolverID, SolverDef::DEFAULT_SOLVER_KIND);
+
+ //TODO: add possibility to parameterize input format
+ //for the moment, two formats given as-is:
+ // the historical format and the basic xlia trace format
+ format = Query::getWPropertyString(
+ thePROPERTY, "format", "BASIC#XLIA");
+ }
+ else
+ {
+ theSolverKind = SolverDef::DEFAULT_SOLVER_KIND;
+ format = "BASIC#XLIA";
+ }
+
+ WObject * theMergedTrace = Query::getRegexWSequence(
+ mParameterWObject, OR_WID2("merged_trace", "MERGED_TRACE"));
+// WObject * theTimeHandling = Query::getRegexWSequence(
+// mParameterWObject , OR_WID2("time_handling", "TIME_HANDLING") );
+
+ TraceFactory traceFactory(getConfiguration(), ENV, mParameterWObject);
+
+ // Retrieving time info from the xfsp
+
+ if( TimedMachine::SYSTEM_VAR_DELTA_TIME != NULL )
+ {
+ ExecutableQuery XQuery( getConfiguration() );
+
+ timeReferenceInstance = XQuery.getDataByAstElement(
+ TimedMachine::SYSTEM_VAR_GLOBAL_TIME );
+
+ theTimeVarInstance = XQuery.getDataByAstElement(
+ TimedMachine::SYSTEM_VAR_DELTA_TIME );
+
+ timedFlag = true;
+ }
+ // TODO: changing time management, getting information directly from the xfsp
+ else
+ {
+ AVM_OS_LOG << "No time parameter found!" << std::endl;
+ timedFlag = false;
+ }
+
+ /*
+ else
+ {
+ std::string theCurrentTimeVar =
+ Query::getWPropertyString(theTimeHandling, "currentTime", "");
+
+ if( not theCurrentTimeVar.empty() )
+ {
+ timeReferenceInstance = RQuery.searchVariable(
+ theMainExecutionData, theCurrentTimeVar);
+ if( timeReferenceInstance.invalid() )
+ {
+ AVM_OS_WARN << "Unfound currentTime< " << theCurrentTimeVar
+ << "> parameter!" << std::endl;
+
+ mConfigFlag = false;
+ }
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound currentTime parameter!" << std::endl;
+
+ mConfigFlag = false;
+ }
+
+
+ std::string timeVar =
+ Query::getWPropertyString(theMergedTrace, "timeVar", "");
+
+ if( not timeVar.empty() )
+ {
+ theTimeVarInstance = RQuery.searchVariable(
+ theMainExecutionData, timeVar);
+ if( theTimeVarInstance.invalid() )
+ {
+ AVM_OS_LOG << "Unfound timeVar < " << timeVar << "> parameter!"
+ << std::endl;
+
+ mConfigFlag = false;
+ }
+ }
+ else
+ {
+ AVM_OS_WARN << "Unfound timeVar parameter!" << std::endl;
+
+ mConfigFlag = false;
+ }
+ }*/
+
+ std::string theMergedTracePath =
+ Query::getWPropertyString(theMergedTrace, "mergedTraceFile", "");
+
+ theMergedTracePath = VFS::native_path(
+ theMergedTracePath, VFS::ProjectSourcePath);
+
+ // initializing theTrace
+ if( not parseMergedTrace(traceFactory, format,
+ theMergedTracePath, theTrace, theTimeVarInstance) )
+ {
+ AVM_OS_WARN << "Error: Error while parsing the trace! " << std::endl;
+
+ mConfigFlag = false;
+
+ //TODO: check that this is useless and erase it
+ // initializing theMergeTrace
+ /*if( not parseMergedTrace(traceFactory,
+ theMergedTracePath, theMergeTrace, theTimeVarInstance) )
+ {
+ AVM_OS_WARN << "Error: Error while parsing merged trace! " << std::endl;
+
+ mConfigFlag = false;
+ }*/
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "The merge trace (sequence of duration/input/output) is: " << std::endl;
+ theTrace.toStream( AVM_OS_LOG << AVM_TAB_INDENT );
+ AVM_OS_LOG << END_INDENT << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ std::string testPurposePath =
+ Query::getWPropertyString(theMergedTrace, "testPurposeFile", "");
+
+ if( not testPurposePath.empty() )
+ {
+ testPurposePath = VFS::native_path(
+ testPurposePath, VFS::ProjectSourcePath);
+
+ if( not parseTestPurpose(testPurposePath, theTestPurpose) )
+ {
+ AVM_OS_WARN << "Error: Error while parsing test purpose! " << std::endl;
+
+ mConfigFlag = false;
+ }
+
+ }
+
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "The parsed trace is: " << std::endl;
+ printTrace(theTrace);
+
+ AVM_OS_LOG << "The test purpose (sequence of transition names) is: " << std::endl;
+ theTestPurpose.toStream( AVM_OS_LOG << AVM_TAB_INDENT );
+ AVM_OS_LOG << END_INDENT << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+
+ // Configuration of OBSERVABLE SIGNAL
+ WObject * theObservableSignals = Query::getRegexWSequence(mParameterWObject,
+ OR_WID2("observable", "OBSERVABLE"), WObject::_NULL_);
+
+ //TODO: tests !
+ // if nothing is declared in the configuration file
+ // the observable are set to be the signals appearing in the trace
+ if( (theObservableSignals == WObject::_NULL_) ||
+ theObservableSignals->hasnoOwnedElement() )
+ {
+ AVM_OS_LOG << "Warning : Observable ports are not configured" << std::endl
+ << "Deducing observable ports from the trace" <<std::endl;
+
+ BFList::raw_iterator< TracePoint > itPoint = theTrace.points.begin();
+ BFList::raw_iterator< TracePoint > endPoint = theTrace.points.end();
+ for( ; (itPoint != endPoint) ; ++itPoint )
+ {
+ if( (not itPoint->isTime())
+ && (not theObsSignals.containsPoint(itPoint, false)))
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_LOG << "Adding point: " << (*itPoint) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ theObsSignals.points.append(*itPoint);
+ }
+ }
+ }
+ // if the observable section contains something
+ // the observable signals are configured accordingly
+ else
+ {
+ mConfigFlag = traceFactory.configure(theObservableSignals, theObsSignals)
+ && mConfigFlag;
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ AVM_OS_LOG << "Configuration of OBSERVABLE SIGNAL: " << std::endl;
+ theObsSignals.toStream( AVM_OS_LOG << AVM_TAB_INDENT );
+ AVM_OS_LOG << END_INDENT << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+
+
+ // Configuration of CONTROLLABLE SIGNAL
+ mConfigFlag = theTraceFilter.configure(
+ ENV, getParameterWObject(), "controllable", "CONTROLLABLE")
+ && mConfigFlag;
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+ AVM_OS_LOG << "Configuration of CONTROLLABLE SIGNAL: " << std::endl;
+ theTraceFilter.toStream( AVM_OS_LOG << AVM_TAB_INDENT );
+ AVM_OS_LOG << END_INDENT << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , CONFIGURING )
+
+ // initialization
+ traceInPath = 0;
+ verdictEmitted = false;
+ theVerdict = "";
+ theErasedNodes = 0;
+
+ return mConfigFlag;
+}
+
+
+//TODO : parameterize input format
+bool OfflineTestProcessor::parseMergedTrace(
+ TraceFactory & aTraceFactory, const std::string & format,
+ const std::string & filePath,
+ TraceSequence & aMergeTrace, const BF & theTimeVar)
+{
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "File path of merged trace: " << filePath << std::endl
+ << "Trace format: " << format << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ std::ifstream fileTrace;
+ fileTrace.open(filePath.c_str(), std::ifstream::in);
+ if( fileTrace.is_open() )
+ {
+ if( StringTools::startsWith(format,"BASIC") )
+ {
+ return( aTraceFactory.parseBasicXliaTrace(
+ aMergeTrace, fileTrace, theTimeVar) );
+ }
+ else //if( StringTools::startsWith(format,"BASIC") )
+ {
+ return( aTraceFactory.parseBasicTrace(
+ aMergeTrace, fileTrace, theTimeVar) );
+ }
+ }
+ else
+ {
+ AVM_OS_WARN << "Error: cannot open file "
+ << filePath << std::endl;
+ }
+
+ return( false );
+}
+
+bool OfflineTestProcessor::parseMergedTrace(
+ TraceFactory & aTraceFactory, const std::string & filePath,
+ TraceSequence & aMergeTrace, const BF & theTimeVar)
+{
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "File path of merged trace: " << filePath << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ std::ifstream fileTrace;
+ fileTrace.open(filePath.c_str(), std::ifstream::in);
+ if( fileTrace.is_open() )
+ {
+ return( aTraceFactory.parseBasicTrace(
+ aMergeTrace, fileTrace, theTimeVar) );
+ }
+ else
+ {
+ AVM_OS_WARN << "Error: cannot open file "
+ << filePath << std::endl;
+ }
+
+ return( false );
+}
+
+
+bool OfflineTestProcessor::parseTestPurpose(
+ const std::string & filePath, TraceSequence & testPurpose)
+{
+ /*
+ * This function parses the test purpose given in a file
+ * as a sequence of transitions.
+ * If filePath is empty, no test purpose is specified
+ * The sequence of transitions is stored in the trace element testPurpose
+ */
+ if( filePath == "" )
+ {
+ AVM_OS_LOG << "Warning: No test purpose specified! " << std::endl;
+ }
+ else
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "The file path of the test purpose to parse is: "
+ << filePath << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ std::ifstream testPurposeFile;
+ testPurposeFile.open(filePath.c_str(), std::ifstream::in);
+ if( testPurposeFile.is_open() )
+ {
+ std::string oneLine;
+
+ while (testPurposeFile.good())
+ {
+ std::getline(testPurposeFile, oneLine);
+ TraceFactory::appendTransitionPoint(
+ getConfiguration(), testPurpose, oneLine);
+ }
+ }
+ else
+ {
+
+ AVM_OS_WARN << "Error: Error while reading test purpose file "
+ << filePath << std::endl;
+ return false;
+ }
+ }
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// REPORT API
+////////////////////////////////////////////////////////////////////////////////
+
+void OfflineTestProcessor::reportDefault(OutStream & os) const
+{
+ reportHeader(os, "AVM OFF-LINE TEST ");
+
+ os << EMPHASIS(theVerdict, '=', 80);
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// PRE-PROCESS API
+////////////////////////////////////////////////////////////////////////////////
+
+bool OfflineTestProcessor::preprocess()
+{
+ AVM_OS_WARN << "OfflineTestProcessor::preprocess()" << std::endl;
+
+ return( true );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// PRE-FILTER API
+////////////////////////////////////////////////////////////////////////////////
+
+bool OfflineTestProcessor::AssignValuesIfObservable(
+ ExecutionContext & anExecutionContext, TraceSequence & localTrace)
+{
+ bool valueAssigned = false;
+ if( anExecutionContext.hasIOElementTrace() )
+ {
+ const BF & theBF = anExecutionContext.getIOElementTrace();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+ AVM_OS_LOG << "OFFLINE TEST:: About to parse the trace: " << std::endl
+ << theBF.toString() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+
+ //TODO : change hasIO for matchesIO in a smart way
+ valueAssigned = hasIO(theBF, anExecutionContext, localTrace);
+ //valueAssigned = matches(theBF, anExecutionContext, localTrace);
+ }
+
+ return valueAssigned;
+}
+
+/*
+bool OfflineTestProcessor::matches(const BF & anElement,
+ ExecutionContext & anExecutionContext, TraceSequence & localTrace)
+{
+ bool valueAssigned = false;
+ if( anElement.is< AvmCode >() )
+ {
+ AvmCode * theAC = anElement.to_ptr< AvmCode >();
+ AvmCode::iterator it = theAC->begin();
+
+ switch( theAC->getAvmOpCode() )
+ {
+ case AVM_OPCODE_PARALLEL :
+ {
+ for( ; it != theAC->end() ; ++it )
+ {
+ if( hasIO( (*it), anExecutionContext, localTrace) )
+ {
+ valueAssigned = true;
+ }
+ }
+ break;
+ }
+
+ case AVM_OPCODE_SEQUENCE :
+ {
+ for( ; it != theAC->end() ; ++it )
+ {
+ if( hasIO( (*it), anExecutionContext, localTrace) )
+ {
+ valueAssigned = true;
+ }
+ else
+ {
+// valueAssigned = false;
+// break;
+ }
+ }
+ break;
+ }
+
+ default:
+ {
+ for( ; it != theAC->end() ; ++it )
+ {
+ if( hasIO( (*it), anExecutionContext, localTrace) )
+ {
+ valueAssigned = true;
+ }
+ }
+ break;
+ }
+ }
+ }
+ else if( anElement.is< ExecutionConfiguration >() )
+ {
+ ExecutionConfiguration * theEC = anElement.to_ptr< ExecutionConfiguration >();
+ valueAssigned = hasIO( theEC, anExecutionContext, localTrace);
+ }
+
+ return valueAssigned;
+} */
+
+bool OfflineTestProcessor::hasIO(const BF & anElement,
+ ExecutionContext & anExecutionContext, TraceSequence & localTrace)
+{
+ bool valueAssigned = false;
+ if( anElement.is< AvmCode >() )
+ {
+ AvmCode * theAC = anElement.to_ptr< AvmCode >();
+ AvmCode::iterator it = theAC->begin();
+
+ switch( theAC->getAvmOpCode() )
+ {
+ case AVM_OPCODE_PARALLEL :
+ {
+ for( ; it != theAC->end() ; ++it )
+ {
+ if( hasIO( (*it), anExecutionContext, localTrace) )
+ {
+ valueAssigned = true;
+ }
+ }
+ break;
+ }
+
+ case AVM_OPCODE_SEQUENCE :
+ {
+ for( ; it != theAC->end() ; ++it )
+ {
+ if( hasIO( (*it), anExecutionContext, localTrace) )
+ {
+ valueAssigned = true;
+ }
+ else
+ {
+// valueAssigned = false;
+// break;
+ }
+ }
+ break;
+ }
+
+ default:
+ {
+ for( ; it != theAC->end() ; ++it )
+ {
+ if( hasIO( (*it), anExecutionContext, localTrace) )
+ {
+ valueAssigned = true;
+ }
+ }
+ break;
+ }
+ }
+ }
+ else if( anElement.is< ExecutionConfiguration >() )
+ {
+ ExecutionConfiguration * theEC = anElement.to_ptr< ExecutionConfiguration >();
+ valueAssigned = hasIO( theEC, anExecutionContext, localTrace);
+ }
+
+ return valueAssigned;
+}
+
+
+bool OfflineTestProcessor::hasIO(
+ ExecutionConfiguration * anExecutionConfiguration,
+ ExecutionContext & anExecutionContext, TraceSequence & localTrace)
+{
+ // TODO: here, the exec configuration is the main? one.
+ // Maybe we will need to take into account cases where the input/outputs
+ // are considered from a sub-machine point of view.
+ bool valueAssigned = false;
+ if( anExecutionConfiguration->isAvmCode() )
+ {
+ const BFCode & theAC = anExecutionConfiguration->getAvmCode();
+
+ AVM_OS_LOG << "OfflineTestProcessor::hasIO < theAC > : "
+ << theAC.str() << std::endl;
+
+ switch( theAC->getAvmOpCode() )
+ {
+ case AVM_OPCODE_INPUT :
+ {
+ if( theAC->first().is< InstanceOfPort >())
+ {
+ InstanceOfPort * ioPort = theAC->first().to_ptr< InstanceOfPort >();
+ if( ioPort->hasAliasTarget() )
+ {
+ ioPort = ioPort->getAliasTarget()->as< InstanceOfPort >();
+ }
+
+ // the first item in the trace could be a delay,
+ // (but it may happen that here are two consecutive actions)
+ // (but there are never two consecutive time delays)
+ // so we compare ports with the first and second entries in the localObs
+ // we retrieve the next action in the localTrace
+ // either it is in the first TracePoint
+ // or the first TracePoint is a delay and so it must be the next one
+ TracePoint * aTracePoint = NULL;
+ if( localTrace.points.nonempty() )
+ {
+ aTracePoint = localTrace.points.first().to_ptr< TracePoint >();
+ if( aTracePoint->isTime() && localTrace.points.populated() )
+ {
+ aTracePoint = localTrace.points.second().to_ptr< TracePoint >();
+ }
+ }
+
+ if( (aTracePoint != NULL)
+ && (ioPort->getNameID() == aTracePoint->object->getNameID())
+ && ((aTracePoint->op == AVM_OPCODE_INPUT)
+ ||(aTracePoint->op == AVM_OPCODE_INPUT_ENV)))
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "OFFLINE TEST:: Input found on port: "
+ << ioPort->getNameID() << std::endl
+ << "with machine : " << ioPort->getRuntimeContainerRID().str() << std::endl
+ << "with machine 2 : " << anExecutionConfiguration->getRuntimeID().str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ valueAssigned = lookupValue(theAC, anExecutionContext,
+ anExecutionConfiguration, ioPort,
+ theAC->getAvmOpCode(), localTrace);
+ break;
+ }
+ const ExecutionData & anED = anExecutionContext.refExecutionData();
+ RuntimeID theRID = anExecutionConfiguration->getRuntimeID();
+
+ const RoutingData & ioRD = AvmCommunicationFactory::
+ searchInputRoutingData(anED, ioPort, theRID);
+
+ if( ioRD.valid() )
+ {
+ if( ioRD.getProtocol() == ComProtocol::PROTOCOL_ENVIRONMENT_KIND )
+ {
+ // we retrieve the next action in the localTrace
+ // either it is in the first TracePoint
+ // or the first TracePoint is a delay and so it must be the next one
+ TracePoint * aTracePoint = NULL;
+ if( localTrace.points.nonempty() )
+ {
+ aTracePoint = localTrace.points.first().to_ptr< TracePoint >();
+ if( aTracePoint->isTime() && localTrace.points.populated() )
+ {
+ aTracePoint = localTrace.points.second().to_ptr< TracePoint >();
+ }
+ }
+
+ if( (aTracePoint != NULL)
+ && (ioPort->getNameID() == aTracePoint->object->getNameID())
+ && ((aTracePoint->op == AVM_OPCODE_INPUT)
+ ||aTracePoint->op == AVM_OPCODE_INPUT_ENV))
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "OFFLINE TEST:: input from environment on port: "
+ << ioPort->getNameID() << std::endl
+ << "with machine : " << ioPort->getRuntimeContainerRID().str() << std::endl
+ << "with machine 2 : " << anExecutionConfiguration->getRuntimeID().str()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ valueAssigned = lookupValue(theAC,
+ anExecutionContext,
+ anExecutionConfiguration,
+ ioPort, theAC->getAvmOpCode(),
+ localTrace);
+ }
+ }
+ break;
+ }
+ }
+
+ break;
+ }
+
+ case AVM_OPCODE_OUTPUT :
+ {
+ if( theAC->first().is< InstanceOfPort >() )
+ {
+ InstanceOfPort * ioPort = theAC->first().to_ptr< InstanceOfPort >();
+ if( ioPort->hasAliasTarget() )
+ {
+ ioPort = ioPort->getAliasTarget()->as< InstanceOfPort >();
+ }
+
+ // we retrieve the next action in the localTrace
+ // either it is in the first TracePoint
+ // or the first TracePoint is a delay and so it must be the next one
+ TracePoint * aTracePoint = NULL;
+ if( localTrace.points.nonempty() )
+ {
+ aTracePoint = localTrace.points.first().to_ptr< TracePoint >();
+ if( aTracePoint->isTime() && localTrace.points.populated() )
+ {
+ aTracePoint = localTrace.points.
+ second().to_ptr< TracePoint >();
+ }
+ }
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+// AVM_OS_LOG << "OFFLINE TEST:: TracePoint considered: " << std::endl;
+// aTracePoint->toStream(AVM_OS_LOG << AVM_TAB_INDENT);
+// AVM_OS_LOG << "Compiled form name :" << ioPort->getNameID() << std::endl
+// << "TracePoint object Id :" <<aTracePoint->object->getNameID() << std::endl
+// << "TracePoint operator :" << aTracePoint->to_string(aTracePoint->op) << std::endl;
+// AVM_OS_LOG << END_INDENT << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+
+ if( (aTracePoint != NULL)
+ && (ioPort->getNameID() == aTracePoint->object->getNameID())
+ && ((aTracePoint->op == AVM_OPCODE_OUTPUT)
+ ||aTracePoint->op == AVM_OPCODE_OUTPUT_ENV))
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "OFFLINE TEST:: Output found on port: "
+ << ioPort->getNameID() << std::endl
+ << "with machine : " << ioPort->getRuntimeContainerRID().str() << std::endl
+ << "with machine 2 : " << anExecutionConfiguration->getRuntimeID().str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ valueAssigned = lookupValue(theAC, anExecutionContext,
+ anExecutionConfiguration, ioPort,
+ theAC->getAvmOpCode(), localTrace);
+ break;
+ }
+ const ExecutionData & anED = anExecutionContext.refExecutionData();
+ RuntimeID theRID = anExecutionConfiguration->getRuntimeID();
+
+ const RoutingData & ioRD = AvmCommunicationFactory::
+ searchOutputRoutingData(anED, ioPort, theRID);
+
+ if( ioRD.valid() )
+ {
+ if( ioRD.getProtocol() == ComProtocol::PROTOCOL_ENVIRONMENT_KIND )
+ {
+ // we retrieve the next action in the localTrace
+ // either it is in the first TracePoint
+ // or the first TracePoint is a delay and so it must be the next one
+ TracePoint * aTracePoint = NULL;
+ if( localTrace.points.nonempty() )
+ {
+ aTracePoint = localTrace.points.first().to_ptr< TracePoint >();
+ if( aTracePoint->isTime() && localTrace.points.populated() )
+ {
+ aTracePoint = localTrace.points.second().to_ptr< TracePoint >();
+ }
+ }
+
+ if( (aTracePoint != NULL)
+ && (ioPort->getNameID() == aTracePoint->object->getNameID())
+ && ((aTracePoint->op == AVM_OPCODE_OUTPUT)
+ ||aTracePoint->op == AVM_OPCODE_OUTPUT_ENV))
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "OFFLINE TEST:: output to environment on port: "
+ << ioPort->getNameID() << std::endl
+ << "with machine : " << ioPort->getRuntimeContainerRID().str() << std::endl
+ << "with machine 2 : " << anExecutionConfiguration->getRuntimeID().str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ valueAssigned = lookupValue(theAC,
+ anExecutionContext,
+ anExecutionConfiguration,
+ ioPort, theAC->getAvmOpCode(),
+ localTrace);
+ }
+ }
+ break;
+ }
+ }
+
+ break;
+ }
+
+ case AVM_OPCODE_ASSIGN_NEWFRESH :
+ {
+ valueAssigned = false;
+ break;
+ }
+
+
+ default :
+ {
+ valueAssigned = false;
+
+ // Pas de récursion car anExecutionConfiguration est atomique du point de vue la I/O-Trace
+// for(AvmCode::iterator it = theAC->begin() ; it != theAC->end() ; ++it )
+// {
+// if( hasIO( (*it), anExecutionContext, localTrace) )
+// {
+// valueAssigned = true;
+// }
+// }
+ break;
+ }
+ }
+ }
+
+ return valueAssigned;
+}
+
+bool OfflineTestProcessor::updateTime(
+ TracePoint * aTracePoint,
+ ExecutionContext & anExecutionContext,
+ TraceSequence * localTrace)
+{
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Time passing... add time constraint, input" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ const BF & currentTimeVar = ENV.getRvalue(
+ anExecutionContext.getAPExecutionData(),
+ anExecutionContext.refExecutionData().getSystemRID(),
+ timeReferenceInstance.to_ptr< InstanceOfData >());
+
+ // assign the delay to the difference of currtime - ref time
+ BF buildValue = ENV.getBuilder().build(
+ theMainExecutionData, aTracePoint->val(0));
+
+ //PathConditionProcessor::addPathTimedCondition(
+ // anExecutionContext.getExecutionData(),
+ anExecutionContext.getAPExecutionData().mwsetPathTimedCondition(
+ ExpressionConstructor::andExpr(
+ anExecutionContext.refExecutionData().getPathTimedCondition(),
+ ExpressionConstructor::eqExpr(
+ ExpressionConstructor::minusExpr(currentTimeVar,
+ anExecutionContext.getUniqInformation()->
+ getUniqOfflineTestProcessorInfo()->getTimeReference()),
+ buildValue)));
+
+ if( not SolverFactory::isSatisfiable(theSolverKind,
+ anExecutionContext.refExecutionData().getPathTimedCondition()) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+AVM_OS_LOG << "3. FAIL: path constraint not satisfiable (delay)" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ return false;
+ }
+
+ // remove read val
+ localTrace->points.remove_first();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "And the timed constraint is "
+ << anExecutionContext.refExecutionData().getPathTimedCondition().str()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ return true;
+}
+
+
+
+bool OfflineTestProcessor::lookupValue(
+ AvmCode * anAC, ExecutionContext & anExecutionContext,
+ ExecutionConfiguration * anExecutionConfiguration,
+ InstanceOfPort * aPort, AVM_OPCODE avmOpcode,
+ TraceSequence & localTrace)
+{
+ // assign the respective value (if found) to its respective variable
+
+ bool valueAssigned = false;
+ TracePoint * aTracePoint = NULL;
+ while( true )
+ {
+
+ avm_size_t nbParam = aPort->getParameterCount();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Number of parameters:" << nbParam << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ aTracePoint = localTrace.points.first().to_ptr< TracePoint >();
+
+ // considering communication actions
+//TODO: consider other observable actions (such as variable assignations) ?
+ if( (avmOpcode == AVM_OPCODE_OUTPUT) || (avmOpcode == AVM_OPCODE_INPUT) )
+ {
+ // compare action in tree with local obs: one or two steps
+ // 1. (conditional) : if the first value is a time var:
+ // assign the time to the data var
+ // and delete the trace point from the trace
+ // 2. compare action with trace element
+
+ if( aTracePoint->isTime() &&
+ ( (theTimeVarInstance == aTracePoint->object) /*||
+ (theTimeVarInstance->getNameID() == aTracePoint->object->getNameID())*/ ) )
+ {
+ // 1. case where first value is a time var
+ valueAssigned = updateTime(aTracePoint,
+ anExecutionContext, &localTrace);
+ if( not valueAssigned)
+ {
+ break;
+ }
+ //localTrace.points.remove_first();
+ }
+
+ // Step 2 : compare action in symbolic tree with trace element
+ //now reading what should be a signal
+ aTracePoint = localTrace.points.first().to_ptr< TracePoint >();
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_LOG << "The port in the trace is " << aTracePoint->object->str() << std::endl
+ << "And the port is " << aPort->getNameID()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ // now reading values to be compared
+
+ // the signal should correspond with the value in
+ // the trace, else it is simply not removed
+ if( aTracePoint->object->getNameID() == aPort->getNameID() )
+ {
+ //checking direction of signal
+ if( (avmOpcode == AVM_OPCODE_OUTPUT) &&
+ ((aTracePoint->op == AVM_OPCODE_INPUT) ||
+ (aTracePoint->op == AVM_OPCODE_INPUT_ENV)) )
+ {
+ AVM_OS_LOG << "OFFLINE TEST: WARNING! input when expecting output!"
+ << std::endl;
+ valueAssigned = false;
+ break;
+ }
+ if( (avmOpcode == AVM_OPCODE_INPUT) &&
+ ((aTracePoint->op == AVM_OPCODE_OUTPUT) ||
+ (aTracePoint->op == AVM_OPCODE_OUTPUT_ENV)) )
+ {
+ AVM_OS_LOG << "OFFLINE TEST: WARNING! output when expecting input!"
+ << std::endl;
+ valueAssigned = false;
+ break;
+ }
+
+
+ //each of the parameters must match
+ bool matchingParams = true;
+ //int paramNb = 0;
+
+ if( matchingParams )
+ {
+ RuntimeQuery RQuery( getConfiguration() );
+
+ for( avm_size_t i = 0 ; matchingParams && (i < nbParam) ; ++i )
+ {
+ if( anAC->get(i+1).is< InstanceOfData >() )
+ {
+ BF foundVar = RQuery.searchVariable(
+ anExecutionContext.refExecutionData(),
+ anExecutionConfiguration->getRuntimeID(),
+ anAC->get(i+1) );
+
+ if( foundVar.valid() )
+ {
+ matchingParams = assignValue(
+ anAC, anExecutionContext,
+ foundVar, aTracePoint, i );
+ }
+ else
+ {
+ AVM_OS_LOG << "lookupValue(...): "
+ "Unfound symbolic parameter :> "
+ << anAC->get(i+1) << std::endl;
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "cufi: " << anAC->get(i+1).to_ptr< InstanceOfData >()->getAstFullyQualifiedNameID() << std::endl
+ << "port: " << str_header( aPort ) << std::endl
+ << "rid : " << str_header( anExecutionConfiguration->getRuntimeID() ) << std::endl
+ << "com : " << str_header( anExecutionConfiguration->getRuntimeID().getCommunicator(aPort) ) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ }
+ }
+ else
+ {
+ matchingParams = assignValue(
+ anAC, anExecutionContext,
+ BF::REF_NULL, aTracePoint, i );
+ }
+
+ /*
+ if( anAC->get(i+1).is< InstanceOfData >() )
+ {
+ valueAssigned = assignValue(anAC, anExecutionContext,
+ aTracePoint, i);
+
+ }
+
+ else
+// if( anAC->get(i+1).isNumber()
+// || anAC->get(i+1).isBoolean()
+// || anAC->get(i+1).isBuiltinString()
+// || anAC->get(i+1).isEnumSymbol())
+ //TODO: check whether this is not problematic (certain types, machine, etc)
+ {
+ matchingParams = ((aTracePoint->val(i) == anAC->get(i+1)) && matchingParams);
+ }*/
+
+ }
+
+ if( matchingParams )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "OFFLINE TEST: com action corresponds to trace, delete it" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ localTrace.points.remove_first();
+ valueAssigned = true;
+ }
+
+ else
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "OFFLINE TEST: WARNING: com action : " ;
+ for( avm_size_t i = 0 ; i < nbParam; ++i )
+ {
+ AVM_OS_LOG << " " << anAC->get(i+1).str() ;
+ }
+ //aPort->getParameter(0)
+ AVM_OS_LOG << " does not correspond to trace : "
+ << aTracePoint->value.str()
+ << " , do not delete it (but deleting for the moment)"
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ valueAssigned = false;
+ anExecutionContext.getAPExecutionData().
+ mwsetPathCondition( ExpressionConstant::BOOLEAN_FALSE );
+ }
+ }
+ else
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "OFFLINE TEST: WARNING : number of parameters expected" << nbParam
+ << "while actual number of parameters given in the trace is"
+ << aTracePoint->valCount() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ }
+ break;
+ }
+ }
+ /*
+ //Now, treat case where local obs is an input
+ else if( avmOpcode == AVM_OPCODE_INPUT )
+ {
+ // check input in tree with local obs: on or two steps
+ // 1. if first element in trace is a time var
+ // assign time data and move on
+ // 2. compare element in trace against input
+ if( aTracePoint->isTime() &&
+ (theTimeVarInstance->getNameID() == aTracePoint->object->getNameID()) )
+ {
+ valueAssigned = updateTime(aTracePoint, anExecutionContext, &localTrace);
+ if( valueAssigned == false )
+ {
+ break;
+ }
+ localTrace.points.remove_first();
+ }
+
+ //now reading what should be a signal
+ aTracePoint = localTrace.points.first().to_ptr< TracePoint >();
+
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+// AVM_OS_LOG << "The port in the trace is " << aTracePoint->object->str() << std::endl
+// << "And the port is " << aPort->getNameID()
+// << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ // now reading input value to be compared
+ if( aTracePoint->object->getNameID() == aPort->getNameID() )
+ {
+
+ if( (aTracePoint->op == AVM_OPCODE_OUTPUT) ||
+ (aTracePoint->op == AVM_OPCODE_OUTPUT_ENV) )
+ {
+ AVM_OS_LOG << "OFFLINE TEST: WARNING! output when expecting input!"
+ << std::endl;
+ valueAssigned = false;
+ break;
+ }
+ // the input should correspond with the value in
+ // the trace, else it is simply not removed
+
+ bool matchingParams = (aTracePoint->valCount() == nbParam);
+
+ if( matchingParams )
+ {
+ for( avm_size_t i = 0 ; matchingParams && (i < nbParam) ; ++i )
+ {
+ //TODO: add conditional numeric/symbolic
+ if( anAC->get(i+1).is< InstanceOfData >() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Assigning value: " << aTracePoint->val(i) << "to variable: "
+ << anAC->get(i+1).to_ptr< InstanceOfData >()->getNameID()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ valueAssigned = assignValue(anAC,
+ anExecutionContext, aTracePoint, i);
+
+ }
+
+ else if( anAC->get(i+1).isNumber()
+ || anAC->get(i+1).isBoolean()
+ || anAC->get(i+1).isBuiltinString()
+ || anAC->get(i+1).isEnumSymbol() )
+ {
+ matchingParams = ((aTracePoint->val(i) ==
+ anAC->get(i+1)) && matchingParams);
+ }
+ else
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Unexpected Kind: " << anAC->get(i+1).classKindName() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ break;
+ }
+ }
+
+ if( matchingParams)
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "OFFLINE TEST: output corresponds to trace, delete it" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ localTrace.points.remove_first();
+ valueAssigned = true;
+ }
+ else
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "OFFLINE TEST: WARNING: input : " ;
+ for( avm_size_t i = 0 ; i < nbParam; ++i )
+ {
+ AVM_OS_LOG << "\t" << anAC->get(i+1).str() ;
+ }
+ //aPort->getParameter(0)
+ AVM_OS_LOG << " does not correspond to trace : "
+ << aTracePoint->value.str()
+ << " , do not delete it (but deleting for the moment)" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ valueAssigned = false;
+
+//
+ // TODO Modification de la path condition sans risque dans le smart pointer ExecutionData
+ //
+// if( not PathConditionProcessor::addPathCondition(
+// anExecutionContext.getAPExecutionData(),
+// ExpressionConstant::BOOLEAN_FALSE) )
+// {
+// //!! INSATISFIABLE PATH CONDITION
+// }
+
+ anExecutionContext.getAPExecutionData().
+ mwsetPathCondition( ExpressionConstant::BOOLEAN_FALSE );
+ }
+ }
+ else
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "OFFLINE TEST: WARNING : number of parameters expected" << nbParam
+ << "while actual number of parameters given in the trace is"
+ << aTracePoint->valCount() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ }
+ break;
+ }
+ }
+ break;*/
+ }
+
+ if( valueAssigned )
+ {
+ // Sometimes, the constraint is no longer valid, but it still appears
+ // in the graph
+
+ if( not SolverFactory::isSatisfiable(theSolverKind,
+ anExecutionContext.refExecutionData().getPathCondition()) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Warning! the path constraint after assigning the values is false !"
+ << "\n\t==> returning false, so the EC children won't be evaluated anymore !"
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ valueAssigned = false;
+ }
+ else
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "The constraint is satisfied !" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ }
+ }
+
+ return valueAssigned;
+}
+
+bool OfflineTestProcessor::assignValue(AvmCode * anAC,
+ ExecutionContext & anExecutionContext,
+ ExecutionConfiguration * anExecutionConfiguration,
+ InstanceOfPort * aPort,
+ TraceSequence & localTrace, int offset)
+{
+ // look for the respective value:
+ // simple search on the vector of pair of values until we find
+ // a match on the variable name; if found, "assign" the value...
+ // The value is assigned as a constraint in the Path Condition
+ TracePoint * aTracePoint = localTrace.points.first().to_ptr<TracePoint>();
+ if( aTracePoint->isTime() &&
+ ( (theTimeVarInstance == aTracePoint->object) /*||
+ (theTimeVarInstance->getNameID() == aTracePoint->object->getNameID())*/ ) )
+ {
+ // since the traces are of the form DELAY.ACTION, and since we may have consecutive
+ // inputs/outputs without delays in between (structures of data),
+ // if we are in such a case (a trace of the form 5.a?.a?), we verify that
+ // the FIRST item in the trace is a delay, and that the SECOND one is the input/output
+ // that we are expecting to see.
+ // This happens only once, since for the case when the trace is just a?
+ // (and 5.a? have been read), we compare directly with the FIRST item
+ // of the trace
+
+ // TODO: change this to take outputs into account (next step)
+ // if there is a passage of time observation, just add it
+ // to the path condition of the node (EC)
+ // emit verdicts according to output
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Assign value: Time passing... add time constraint" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ const BF & currentTimeVar = ENV.getRvalue(
+ anExecutionContext.getAPExecutionData(),
+ anExecutionContext.refExecutionData().getSystemRID(),
+ timeReferenceInstance.to_ptr< InstanceOfData >());
+
+ // assign the delay to the difference of currtime - ref time
+ BF buildValue = ENV.getBuilder().build(
+ theMainExecutionData, aTracePoint->val(0));
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "the vars are: curr timevar: "
+ << currentTimeVar.str() << std::endl
+ << "reference time:> " << std::endl
+ << "\tvar : " << anExecutionContext.getUniqInformation()->
+ getUniqOfflineTestProcessorInfo()->getTimeReference().str()
+ << std::endl
+ << "\tvalue : " << buildValue.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ anExecutionContext.getAPExecutionData().mwsetPathTimedCondition(
+ ExpressionConstructor::andExpr(
+ anExecutionContext.refExecutionData().getPathTimedCondition(),
+ ExpressionConstructor::eqExpr(
+ ExpressionConstructor::minusExpr(currentTimeVar,
+ anExecutionContext.getUniqInformation()->
+ getUniqOfflineTestProcessorInfo()->getTimeReference()),
+ buildValue)));
+
+ if( not SolverFactory::isSatisfiable(theSolverKind,
+ anExecutionContext.refExecutionData().getPathTimedCondition()) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "4. FAIL: path constraint not satisfiable due to delay"
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ return false;
+ }
+
+
+ localTrace.points.remove_first();
+ aTracePoint = localTrace.points.first().to_ptr<TracePoint>();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "And the second timed constraint is "
+ << anExecutionContext.refExecutionData().getPathTimedCondition().str()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ }
+
+ // everything is OK if the first value in the trace to be read corresponds
+ // to the one that we are looking for, else???
+ avm_size_t nbParam = aPort->getParameterCount();
+
+ if( (aTracePoint->object->getNameID() == aPort->getNameID()) &&
+ (nbParam == aTracePoint->valCount()) )
+ {
+ //int nbParam = aPort->getParameterCount();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Found in its place, variable: ";
+ for( avm_size_t i = 0 ; i < nbParam ; ++i )
+ {
+ AVM_OS_LOG << "\t" << anAC->get(i+1).to_ptr< InstanceOfData >()->getFullyQualifiedNameID();
+ }
+ AVM_OS_LOG << " in port " << aPort->getNameID()
+ << " == " << aTracePoint->object->str() << std::endl
+ << "with machine 3 : " << aPort->getRuntimeContainerRID().getNameID() << std::endl
+ << "with machine 4 : " << anExecutionConfiguration->getRuntimeID().getNameID() << std::endl
+ << "with machine 5 : " << anExecutionConfiguration->getRuntimeID().
+ getCommunicator(aPort).getNameID() << std::endl
+ << "About to assign value:> " << aTracePoint->value.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ RuntimeQuery RQuery( getConfiguration() );
+
+ for( avm_size_t i = 0 ; i < nbParam ; ++i )
+ {
+ // the value is stored in the trace point and accessed through the val method
+ BF buildValue = ENV.getBuilder().build(
+ theMainExecutionData, aTracePoint->val(i));
+
+ //TODO: check whether there is no issue with the management of strings
+ if( aTracePoint->val(i).isBuiltinString() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Assigning a string ! " << aTracePoint->val(i).str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ }
+ else
+ {
+ // TODO : tests
+ if( not PathConditionProcessor::addPathCondition(
+ anExecutionContext.getAPExecutionData(),
+ ExpressionConstructor::eqExpr(anAC->get(i+1), buildValue),
+ false) )
+ {
+ //!! INSATISFIABLE PATH CONDITION
+ return false; // ??? TODO
+
+ }
+ }
+
+ BF variableInstance = RQuery.searchVariable(
+ anExecutionContext.refExecutionData(),
+ anExecutionConfiguration->getRuntimeID(), anAC->get(i+1) );
+
+ if( variableInstance.valid() )
+ {
+ // Assign the value
+ ENV.setRvalue(anExecutionContext.getAPExecutionData(),
+ variableInstance.to_ptr< InstanceOfData >(), buildValue);
+ }
+ else
+ {
+ AVM_OS_LOG << "assignValue(...): Unfound symbolic parameter :> "
+ << anAC->get(i+1) << std::endl;
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+AVM_OS_LOG << "cufi: "
+ << anAC->get(i+1).to_ptr< InstanceOfData >()->getAstFullyQualifiedNameID() << std::endl
+ << "port: " << str_header( aPort ) << std::endl
+ << "rid : " << str_header( anExecutionConfiguration->getRuntimeID() ) << std::endl
+ << "com : " << str_header( anExecutionConfiguration->getRuntimeID().getCommunicator(aPort) )
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ }
+ }
+
+
+ localTrace.points.remove_first();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "After observing the local obs trace of size: "
+ << localTrace.points.size() << std::endl;
+ printTrace(localTrace);
+
+ AVM_OS_LOG << "And the all constraint is :>\n\t"
+ << anExecutionContext.refExecutionData().getAllPathCondition().str()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ return true;
+ }
+ else if( nbParam != aTracePoint->valCount() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "OFFLINE TEST: WARNING : number of parameters expected" << nbParam
+ << "while actual number of parameters given in the trace is"
+ << aTracePoint->valCount() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ }
+ else
+ {
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Input/Output not expected ("
+ << anAC->get(1).to_ptr< InstanceOfData >()->getAstFullyQualifiedNameID()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ }
+
+ return false;
+}
+
+
+
+bool OfflineTestProcessor::assignValue(
+ AvmCode * anAC, ExecutionContext & anExecutionContext,
+ const BF & variableInstance, TracePoint * aTracePoint, int paramNb)
+{
+
+ bool valueAssigned =false;
+ // the value is stored in the trace point and accessed through the val method
+
+ if(anAC->get(paramNb+1).isBuiltinString())
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Checking string equality! "
+ << anAC->get(paramNb+1).str()
+ << " =? "
+ << aTracePoint->val(paramNb).str()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ valueAssigned = (aTracePoint->val(paramNb) == anAC->get(paramNb+1));
+ }
+
+ else if(anAC->get(paramNb+1).isIdentifier())
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+AVM_OS_LOG << "Checking that identifiers match: "
+ << anAC->get(paramNb+1).str()
+ << " =? "
+ << aTracePoint->val(paramNb).str()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ valueAssigned =
+ (aTracePoint->val(paramNb).to_ptr< Identifier >()->getValue()
+ == anAC->get(paramNb+1).to_ptr< Identifier >()->getValue());
+ }
+
+ //gestion du type machine
+ else if( anAC->get(paramNb+1).is< RuntimeID >() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+AVM_OS_LOG << "Checking machine equality: "
+ << anAC->get(paramNb+1).str()
+ << " =? "
+ << aTracePoint->val(paramNb).str()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ RuntimeID machine = anAC->get(paramNb+1).as_bf< RuntimeID >();
+ valueAssigned = (aTracePoint->val(paramNb).isTEQ(machine.getInstance()));
+ }
+
+
+ // Const value
+ // TODO : testing equality between value in trace and at runtime properly
+ /*
+ else if( anAC->get(paramNb+1).isConstValue() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+AVM_OS_LOG << "Checking parameter equality: "
+ << anAC->get(paramNb+1).str()
+ << " =? "
+ << aTracePoint->val(paramNb).str()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ valueAssigned = (aTracePoint->val(paramNb).isEQ(anAC->get(paramNb+1)));
+ }*/
+
+ // Symbolic execution Value
+ else
+ {
+ BF buildValue = ENV.getBuilder().build(
+ theMainExecutionData, aTracePoint->val(paramNb));
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Assigning value: " << aTracePoint->val(paramNb)
+ << " to variable: " << anAC->get(paramNb+1).str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ //TODO: check whether there is no issue with the management of strings
+ if( aTracePoint->val(paramNb).isBuiltinString() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Assigning a string ! "
+ << aTracePoint->val(paramNb).str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ }
+ else {
+ if( not PathConditionProcessor::addPathCondition(
+ anExecutionContext.getAPExecutionData(),
+ ExpressionConstructor::eqExpr(anAC->get(paramNb+1), buildValue),
+ false ) )
+ //TODO : testing whether adding parameter false is better
+ {
+ //!! INSATISFIABLE PATH CONDITION
+ return false; // ??? TODO
+ }
+ }
+
+ return true;
+ }
+
+ return valueAssigned;
+}
+
+
+//bool OfflineTestProcessor::assignValue(AvmCode * anAC,
+// ExecutionContext & anExecutionContext,
+// ExecutionConfiguration * anExecutionConfiguration,
+// BF dataVar, InstanceOfPort * aPort,
+// TraceSequence & localTrace, int offset)
+//{
+// // look for the respective value:
+// // simple search on the vector of pair of values until we find
+// // a match on the variable name; if found, "assign" the value...
+// // The value is assigned as a constraint in the Path Condition
+// TracePoint * aTracePoint = localTrace.points.first().to_ptr<TracePoint>();
+// if( aTracePoint->isTime() &&
+// (theTimeVarInstance->getNameID() == aTracePoint->object->getNameID()) )
+// {
+// // since the traces are of the form DELAY.ACTION, and since we may have consecutive
+// // inputs/outputs without delays in between (structures of data),
+// // if we are in such a case (a trace of the form 5.a?.a?), we verify that
+// // the FIRST item in the trace is a delay, and that the SECOND one is the input/output
+// // that we are expecting to see.
+// // This happens only once, since for the case when the trace is just a?
+// // (and 5.a? have been read), we compare directly with the FIRST item
+// // of the trace
+//
+// // TODO: change this to take outputs into account (next step)
+// // if there is a passage of time observation, just add it
+// // to the path condition of the node (EC)
+// // emit verdicts according to output
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+// AVM_OS_LOG << "Assign value: Time passing... add time constraint" << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+//
+// const BF & currentTimeVar = ENV.getRvalue(
+// anExecutionContext.getAPExecutionData(),
+// anExecutionContext.refExecutionData().getSystemRID(),
+// timeReferenceInstance);
+//
+// // assign the delay to the difference of currtime - ref time
+// BF buildValue = ENV.getBuilder().build(
+// theMainExecutionData, aTracePoint->val(0));
+//
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+// AVM_OS_LOG << "the vars are: curr timevar: "
+// << currentTimeVar.str() << std::endl
+// << "reference time:> " << std::endl
+// << "\tvar : " << anExecutionContext.getUniqInformation()->
+// getUniqOfflineTestProcessorInfo()->getTimeReference().str() << std::endl
+// << "\tvalue : " << buildValue.str() << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+//
+// anExecutionContext.getAPExecutionData().mwsetPathTimedCondition(
+// ExpressionConstructor::andExpr(
+// anExecutionContext.refExecutionData().getPathTimedCondition(),
+// ExpressionConstructor::eqExpr(
+// ExpressionConstructor::minusExpr(currentTimeVar,
+// anExecutionContext.getUniqInformation()->
+// getUniqOfflineTestProcessorInfo()->getTimeReference()),
+// buildValue)));
+//
+// if( not SolverFactory::isSatisfiable(theSolverKind,
+// anExecutionContext.refExecutionData().getPathTimedCondition()) )
+// {
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+// AVM_OS_LOG << "4. FAIL: path constraint not satisfiable due to delay"
+// << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+// return false;
+// }
+//
+//
+// localTrace.points.remove_first();
+// aTracePoint = localTrace.points.first().to_ptr<TracePoint>();
+//
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+// AVM_OS_LOG << "And the second timed constraint is "
+// << anExecutionContext.refExecutionData().getPathTimedCondition().str()
+// << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+// }
+//
+// // everything is OK if the first value in the trace to be read corresponds
+// // to the one that we are looking for, else???
+//
+// if( aTracePoint->object->getNameID() == aPort->getNameID() )
+// {
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+// AVM_OS_LOG << "Found in its place, variable: "
+// << dataVar.to_ptr< InstanceOfData >()->getFullyQualifiedNameID()
+// << " in port " << aPort->getNameID()
+// << " == " << aTracePoint->object->str() << std::endl
+// << "with machine 3 : " << aPort->getRuntimeContainerRID().getNameID() << std::endl
+// << "with machine 4 : " << anExecutionConfiguration->getRuntimeID().getNameID() << std::endl
+// << "with machine 5 : " << anExecutionConfiguration->getRuntimeID().
+// getCommunicator(aPort).getNameID() << std::endl
+// << "About to assign value:> " << aTracePoint->val(0).str() << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+//
+// // for the moment, the value is stored in the third position of the list
+// // the value is stored in the trace point and accessed through the val method
+// BF buildValue = ENV.getBuilder().build(
+// theMainExecutionData, aTracePoint->val(0));
+//
+////TODO: check whether there is no issue with the management of strings
+// if( aTracePoint->val(0).isBuiltinString() )
+// {
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+// AVM_OS_LOG << "Assigning a string ! "
+// //<<dataVar.to_ptr< InstanceOfData >()->getAstFullyQualifiedNameID() << std::endl
+// //<< aTracePoint->val(0).str()
+// << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+// }
+// else {
+// anExecutionContext.getAPExecutionData().mwsetPathCondition(
+// ExpressionConstructor::andExpr(
+// anExecutionContext.refExecutionData().getPathCondition(),
+// ExpressionConstructor::eqExpr(dataVar, buildValue)));
+// }
+//
+// BF variableInstance = ENV.getBuilder().searchSymbolData(
+// theMainExecutionData, dataVar->getAstFullyQualifiedNameID());
+//
+// // Assign the value
+// ENV.setRvalue(anExecutionContext.getAPExecutionData(),
+// variableInstance, buildValue);
+// localTrace.points.remove_first();
+//
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+// AVM_OS_LOG << "After observing the local obs trace of size: "
+// << localTrace.points.size() << std::endl;
+// printTrace(localTrace);
+//
+// AVM_OS_LOG << "And the all constraint is :>\n\t"
+// << anExecutionContext.refExecutionData().getAllPathCondition().str()
+// << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+//
+// return true;
+// }
+// else
+// {
+//
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+// AVM_OS_LOG << "Input/Output not expected (" <<
+// dataVar.to_ptr< InstanceOfData >()->getAstFullyQualifiedNameID()
+// << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+// }
+//
+// return false;
+//}
+
+/*bool OfflineTestProcessor::reAssignValue(AvmCode * anAC,
+// ExecutionContext & anExecutionContext,
+// BF aValue, InstanceOfPort * aPort,
+// VectorOfPairOfVariableValue * aTable, int offset)
+//{
+// This version of the method is for changing the value
+// "associated" with port aPort
+
+
+ TripleOfPortVariableOffset aTuple;
+
+ VectorOfPairOfVariableValue::iterator it = aTable->begin();
+ VectorOfPairOfVariableValue::iterator itend = aTable->end();
+
+ // loop iterating on the vector of variable/values (parameters file)
+ for( ; it != itend ; ++it)
+ {
+ // loop iterating on the vector of modified variables
+ for (size_t i=0 ; i < theVectorOfPortVariableOffset.size() ; ++i )
+ {
+ aTuple = theVectorOfPortVariableOffset[i];
+ if( aPort != aTuple.get<0>().to_ptr< InstanceOfPort >() )
+ {
+ continue;
+ }
+ AVM_OS_LOG << "search mapping " << std::endl;
+
+ if( operator==(aTuple, boost::make_tuple(
+ aPort,(*it).first().to_ptr< InstanceOfData >(), offset)) )
+ {
+ AVM_OS_LOG << "mapping found!!! "
+ << aTuple.get<0>().to_ptr< InstanceOfPort >().getFullyQualifiedNameID()
+ << "," << aTuple.get<1>().to_ptr< InstanceOfData >().str()
+ << "," << aTuple.get<2>() << " con " << aPort->str()
+ << "," << (*it).first()->to< InstanceOfData >()->str()
+ << "," << offset << std::endl;
+
+ // Create a new simbolic var and assign the constraint
+
+
+ AVM_OS_LOG << "viendo ahora la symbolic var... para "
+ << (*it).first()->getAstFullyQualifiedNameID() << std::endl
+ << "viendo ahora la symbolic var... para "
+ << (*it).first()->getAstNameID() << std::endl;
+
+ InstanceOfMachine * theMainSpecification =
+ getConfiguration().getExecutableSystem().getSystemInstance();
+ if( theMainSpecification != NULL )
+ {
+ AVM_OS_LOG << "al menos no es null \n";
+ }
+ Variable * aVar = theMainSpecification->getExecutable()->
+ getAstMachine()->getVariable( (*it).first()->getAstNameID() );
+ const BF & ripvalue = ENV.getRvalue(anExecutionContext.getAPExecutionData(),
+ anExecutionContext.refExecutionData().getRuntimeID(theMainSpecification),
+ (*it).first().to_ptr< InstanceOfData >());
+ if( aVar != NULL )
+ {
+ InstanceOfData * varGlobalTime = theMainSpecification->
+ getExecutable()->getAllData().rawByCompiled(aVar);
+ AVM_OS_LOG << "VEMOSNOOOSSSS.........; "
+ << varGlobalTime->getFullyQualifiedNameID() << std::endl;
+ const BF & rvalue = ENV.getRvalue(anExecutionContext.getAPExecutionData(),
+ anExecutionContext.refExecutionData().getRuntimeID(theMainSpecification),
+ varGlobalTime);
+ AVM_OS_LOG << "VEMOSNOs MAS : " << rvalue.str();
+ }
+ if( ripvalue.valid() )
+ {
+ AVM_OS_LOG << "prvobemos a ver : " << ripvalue.str() << std::endl;
+ }
+ AVM_OS_LOG << "ES NULLLL \n";
+ // tuple found, replace with new value
+ BF buildValue = ENV.getBuilder().build(theMainExecutionData, aValue);
+ ENV.setRvalue(anExecutionContext.getAPExecutionData(),
+ (*it).first(), buildValue);
+ return true;
+ }
+ }
+ }
+ // return false;
+ //}
+ */
+
+void OfflineTestProcessor::transitionInList(
+ const BF & aFF, TraceSequence & aTestPurpose, bool & flag)
+{
+ if( aFF.is< ExecutionConfiguration >() )
+ {
+ ExecutionConfiguration * theEC = aFF.to_ptr< ExecutionConfiguration >();
+ if( theEC->hasCode() )
+ {
+ if( theEC->isTransition() )
+ {
+ if( aTestPurpose.containsObject(theEC->toTransition()) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Transition found in TP !"
+ << theEC->toTransition()->getAstNameID() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ flag = true;
+ }
+
+ //adding case where no test purpose is specified
+ //should not be used any more, treated in postprocess
+ /*
+ else if( aTestPurpose.points.empty() )
+ {
+ flag = true;
+ AVM_OS_WARN << "NB: The verdict was computed with no test purpose. " << std::endl;
+ }*/
+
+ }
+
+ }
+ }
+
+ else if( aFF.is< AvmCode >() )
+ {
+ const BFCode & theAC = aFF.bfCode();
+ BFCode newAC(theAC->getOperator());
+
+ BF bf;
+
+ for(AvmCode::iterator it = theAC->begin() ; it != theAC->end() ; ++it )
+ {
+ transitionInList((*it), aTestPurpose, flag);
+ }
+ }
+}
+
+bool OfflineTestProcessor::prefilter()
+{
+// ExecutionContext & delEC = NULL;
+
+ ecQueue = &( getExecutionQueue().getReadyQueue() );
+ ecQueueIt = ecQueue->begin();
+ ecQueueItEnd = ecQueue->end();
+ for( ; ecQueueIt != ecQueueItEnd ; )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << std::endl << std::endl << "Working with EC: "
+ << (*ecQueueIt)->str_min() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ if( not prefilter(* (*ecQueueIt)) )
+ {
+ AVM_OS_LOG << "OfflineTestProcessor::Prefilter won't continue here!"
+ << std::endl;
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Erasing EC: " << (*ecQueueIt)->str_min() << std::endl
+ << "\tIt's the " << (++theErasedNodes)
+ << "'nth EC that has been deleted !" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+// delEC = (*it);
+
+ ecQueueIt = ecQueue->erase(ecQueueIt);
+
+// AbstractProcessorUnit::remove(delEC ,
+// AVM_OS_LOG, "OfflineTestProcessor::remove");
+ }
+ else
+ {
+ ecQueueIt++;
+ }
+ }
+ return (getExecutionQueue().hasReady());
+}
+
+bool OfflineTestProcessor::hasIO(const BF & anElement)
+{
+ if( anElement.invalid() )
+ {
+ return (false);
+ }
+ else if( anElement.is< AvmCode >() )
+ {
+ AvmCode * theAC = anElement.to_ptr< AvmCode >();
+ switch (theAC->getAvmOpCode()){
+ //case AVM_OPCODE_ASSIGN_NEWFRESH :
+ case AVM_OPCODE_INPUT:
+ case AVM_OPCODE_OUTPUT:
+ {
+ return true;
+ }default:
+ {
+ for(AvmCode::iterator it = theAC->begin();it != theAC->end();++it)
+ {
+ if( hasIO( (*it) ) )
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+ }
+
+ }
+ else if( anElement.is< ExecutionConfiguration >() )
+ {
+ return (hasIO(anElement.to_ptr< ExecutionConfiguration >()->getCode()));
+ }
+
+
+ return false;
+}
+
+bool OfflineTestProcessor::portInObsSignals(const RuntimeID & runtimeCtx,
+ InstanceOfPort * port, AVM_OPCODE ioOpcode)
+{
+ BFList::const_iterator itPoint = theObsSignals.points.begin();
+ BFList::const_iterator endPoint = theObsSignals.points.end();
+ TracePoint * aTracepoint;
+ for( ; itPoint != endPoint ; ++itPoint)
+ {
+ if( (*itPoint).is< TracePoint >() )
+ {
+ aTracepoint = (*itPoint).to_ptr< TracePoint >();
+
+ if( aTracepoint->isCom(ioOpcode, runtimeCtx, port) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Found, port in machine: " << aTracepoint->toString() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ return true;
+ }
+ else
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_LOG << "NOT Found, port in machine (from tree): "
+ << runtimeCtx.getQualifiedNameID() << " -> " << TracePoint::to_string(ioOpcode)
+ << " port " << port->getQualifiedNameID() << std::endl;
+ AVM_OS_LOG << "NOT Found, comparing with (from obs signals): "
+ << aTracepoint->toString() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ }
+ }
+ }
+
+ return false;
+}
+
+bool OfflineTestProcessor::portInCtrlSignals(TracePoint * portTP)
+{
+ return( theTraceFilter.pass(portTP) );
+}
+
+bool OfflineTestProcessor::hasObservableSignal(
+ const BF & anElement)
+{
+ if( anElement.invalid() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "OfflineTestProcessor::hasObservableSignal:> "
+ "Invalid Trace, returning false !" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ return (false);
+ }
+ else if( anElement.is< AvmCode >() )
+ {
+ AvmCode * theAC = anElement.to_ptr< AvmCode >();
+
+ for(AvmCode::iterator it = theAC->begin() ; it != theAC->end() ; ++it )
+ {
+ if( hasObservableSignal( (*it)) )
+ {
+ return true;
+ }
+ }
+
+ }
+ else if( anElement.is< ExecutionConfiguration >() )
+ {
+ return( hasObservableSignal(
+ anElement.to_ptr< ExecutionConfiguration >()->getCode(),
+ anElement.to_ptr< ExecutionConfiguration >()) );
+ }
+
+ return false;
+}
+
+bool OfflineTestProcessor::hasObservableSignal(
+ const BF & anElement, const ExecutionConfiguration * anExexConf)
+{
+ if( anElement.invalid() )
+ {
+ return (false);
+ }
+ else if( anElement.is< AvmCode >() )
+ {
+ AvmCode * theAC = anElement.to_ptr< AvmCode >();
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PRE_FILTERING )
+ AVM_OS_LOG << "Analyzing I/O Element Trace "
+ << anElement << "with AvmOpCode : "
+ << TracePoint::to_string(theAC->getAvmOpCode()) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PRE_FILTERING )
+
+ switch( theAC->getAvmOpCode() )
+ {
+ //case AVM_OPCODE_ASSIGN_NEWFRESH :
+ case AVM_OPCODE_INPUT:
+ {
+ // hardwired comparison
+ if( theAC->first().is< InstanceOfPort >() )
+ {
+ InstanceOfPort * ioPort = theAC->first().to_ptr< InstanceOfPort >();
+ if( ioPort->hasAliasTarget() )
+ {
+ ioPort = ioPort->getAliasTarget()->as< InstanceOfPort >();
+ }
+
+ if( portInObsSignals(
+ anExexConf->getRuntimeID(),
+ ioPort, AVM_OPCODE_INPUT) )
+ {
+ return true;
+ }
+ }
+ break;
+ }
+ case AVM_OPCODE_OUTPUT:
+ {
+ // hardwired comparison
+ if( theAC->first().is< InstanceOfPort >() )
+ {
+ InstanceOfPort * ioPort = theAC->first().to_ptr< InstanceOfPort >();
+ if( ioPort->hasAliasTarget() )
+ {
+ ioPort = ioPort->getAliasTarget()->as< InstanceOfPort >();
+ }
+
+ if( portInObsSignals(
+ anExexConf->getRuntimeID(),
+ ioPort, AVM_OPCODE_OUTPUT) )
+ {
+ return true;
+ }
+ }
+ break;
+ }
+ default:
+ {
+ AvmCode::iterator it = theAC->begin();
+ for( ; it != theAC->end() ; ++it )
+ {
+ if( hasObservableSignal((*it), anExexConf) )
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+ }
+
+ return false;
+ }
+
+ return false;
+}
+
+bool OfflineTestProcessor::prefilter(ExecutionContext & anEC)
+{
+ TraceSequence theLocalTrace;
+
+ OfflineTestProcessorInfo * currentOfflineTestInfo = NULL;
+ OfflineTestProcessorInfo * previousOfflineTestInfo = NULL;
+
+ if( anEC.hasPrevious() )
+ {
+ // Get "trace" (vector of pair of variable value), which is
+ // the one of its parent (previous)
+ if( anEC.getPrevious()->hasInformation() )
+ {
+ previousOfflineTestInfo = anEC.getPrevious()->getInformation()->
+ getUniqOfflineTestProcessorInfo();
+
+ theLocalTrace = previousOfflineTestInfo->getLocalTrace();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+ AVM_OS_LOG << "Its previous EC: " << anEC.getPrevious()->str_min() << std::endl;
+ printTrace( previousOfflineTestInfo->getLastObs() , "The (Last Obs) trace:", "\t" );
+ AVM_OS_LOG << "Its previous trace size is: "
+ << previousOfflineTestInfo->getLocalTrace().points.size() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+ }
+ else
+ {
+ previousOfflineTestInfo = anEC.getPrevious()
+ ->getUniqInformation()->getUniqOfflineTestProcessorInfo();
+ }
+ }
+ else
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+ AVM_OS_LOG << "Warning in PROCESSOR Prefilter: node without previous? "
+ "Is it the Root ?" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+ }
+
+
+ currentOfflineTestInfo = anEC.getUniqInformation()->getUniqOfflineTestProcessorInfo();
+
+ if( anEC.getHeight() <= 0 )
+ {
+
+ currentOfflineTestInfo->setLocalTrace(theTrace);
+ makeLocalObs(currentOfflineTestInfo->getLastObs(), theTrace);
+
+ // Setting time reference when system is timed
+ if(timedFlag)
+ {
+ const BF & referenceTimeVar = ENV.getRvalue(anEC.getAPExecutionData(),
+ anEC.refExecutionData().getSystemRID(),
+ timeReferenceInstance.to_ptr< InstanceOfData >());
+
+ anEC.getUniqInformation()->
+ getUniqOfflineTestProcessorInfo()->
+ setTimeReference(referenceTimeVar);
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+ AVM_OS_LOG << "1. Setting time reference to " << referenceTimeVar.str()
+ << std::endl
+ << "The Time Reference Instance is: " << timeReferenceInstance.str()
+ << std::endl
+ << currentOfflineTestInfo->getTimeReference().str()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+ }
+
+
+ if( anEC.hasRunnableElementTrace() )
+ {
+ currentOfflineTestInfo->setLastTransition(
+ anEC.getRunnableElementTrace());
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+ AVM_OS_LOG << "Root does have Runnable Element Trace! " << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+ }
+ else
+ {
+ currentOfflineTestInfo->setLastTransition(BF::REF_NULL);
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+ AVM_OS_LOG << "Root does NOT have Runnable Element Trace! " << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+ }
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+ AVM_OS_LOG << "Root, assigning and skipping: " << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+
+ return true;
+ }
+
+
+ if( previousOfflineTestInfo->getTheAnalyzedMark() == true )
+ {
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+ AVM_OS_LOG << "Verdict already computed!!!!!!!!!! for EC: "
+ << anEC.str_min() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+
+ return false;
+
+ }
+ if( not hasObservableSignal(anEC.getIOElementTrace()) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+ AVM_OS_LOG << "jumping!!!!!!!! not interesting!!!!!!!! for EC: "
+ << anEC.str_min() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+ }
+
+ if(timedFlag)
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+ AVM_OS_LOG << "setting reference of father in EC: "
+ << anEC.str_min() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+
+ currentOfflineTestInfo->setTimeReference(
+ anEC.getPrevious()->getUniqInformation()->
+ getUniqOfflineTestProcessorInfo()->getTimeReference());
+ }
+
+ if( theTrace.points.empty()
+ || (not hasIO(anEC.getIOElementTrace()))
+ || (previousOfflineTestInfo->getTheAnalyzedMark() == true)
+ || (not hasObservableSignal(anEC.getIOElementTrace())) )
+ {
+
+ currentOfflineTestInfo->setLocalTrace(
+ previousOfflineTestInfo->getLocalTrace());
+
+ currentOfflineTestInfo->setLastObs(
+ previousOfflineTestInfo->getLastObs());
+
+ currentOfflineTestInfo->setLastTransition(
+ previousOfflineTestInfo->getLastTransition());
+
+ currentOfflineTestInfo->setTheAnalyzedMark(
+ previousOfflineTestInfo->getTheAnalyzedMark());
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+ AVM_OS_LOG << "Trace already read, or tau, or already failed/inconci, "
+ "or projecting,\nassigning and skipping EC: " << anEC.str_min()
+ << std::endl
+ << "Local Trace size : "
+ << currentOfflineTestInfo->getLocalTrace().points.size()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+
+ return true;
+ }
+
+ // the last observation is stored in the node (to find a match in the trace)
+ TraceSequence lastObs;
+ makeLocalObs(lastObs, theLocalTrace);
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+ AVM_OS_LOG << "The local trace is (assigned!): " << std::endl;
+ printTrace(theLocalTrace);
+ AVM_OS_COUT << "\nOfflineTestProcessor::prefilter(...) EC:> "
+ << anEC.str_min() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+
+
+ if( AssignValuesIfObservable(anEC, theLocalTrace) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+ AVM_OS_LOG << "Something was read " << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+
+ // assign last obs (since something was read/localObs was modified)
+ currentOfflineTestInfo->setLastObs(lastObs);
+ currentOfflineTestInfo->setLastTransition(
+ anEC.getRunnableElementTrace());
+ // each EC has its own copy of the trace
+ currentOfflineTestInfo->setLocalTrace(theLocalTrace);
+
+ // checking trace length
+ if( currentOfflineTestInfo->getLocalTrace().points.empty() )
+ {
+ // the trace is finished for this path, set the flag to true so we don't
+ // continue calculating
+ currentOfflineTestInfo->setTheAnalyzedMark(true);
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+ AVM_OS_LOG << "The flag was set to true, this tree path should stop at EC: "
+ << anEC.str_min() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+ }
+ }
+ else
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+ AVM_OS_LOG << "Nothing was read in this EC: " << anEC.str_min() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PRE_FILTERING )
+
+ // it was necessarily an input or an output that was not read, so we mark
+ // the entire path so we don't analyze it anymore (the verdict will be
+ // emitted later
+ currentOfflineTestInfo->setTheAnalyzedMark(true);
+
+ // assign last obs of parent (since nothing was read)
+ currentOfflineTestInfo->setLastObs(
+ previousOfflineTestInfo->getLastObs());
+
+ currentOfflineTestInfo->setLastTransition(
+ previousOfflineTestInfo->getLastTransition());
+
+ // each EC has its own copy of the trace
+ currentOfflineTestInfo->setLocalTrace(
+ previousOfflineTestInfo->getLocalTrace());
+ }
+ return true;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// POST-FILTER API
+////////////////////////////////////////////////////////////////////////////////
+
+bool OfflineTestProcessor::postfilter()
+{
+ ecQueue = &( getExecutionQueue().getResultQueue() );
+ ecQueueIt = ecQueue->begin();
+ ecQueueItEnd = ecQueue->end();
+ for( ; ecQueueIt != ecQueueItEnd ; )
+ {
+ if( not postfilter(* (*ecQueueIt)) )
+ {
+ AVM_OS_LOG << "FAIL in postfilter offline test!" << std::endl;
+
+ return false;
+ }
+ else
+ {
+ ++ecQueueIt;
+ }
+ }
+
+ return (getExecutionQueue().hasResult());
+}
+
+bool OfflineTestProcessor::postfilter(ExecutionContext & anEC)
+{
+ if( (anEC.getHeight() <= 0) || (theTrace.points.size() == 0) ||
+ (not hasIO(anEC.getIOElementTrace())) ||
+ (not hasObservableSignal(anEC.getIOElementTrace())) )
+ {
+ return true;
+ }
+
+ OfflineTestProcessorInfo * currentOfflineTestInfo =
+ anEC.getUniqInformation()->getUniqOfflineTestProcessorInfo();
+
+
+ // set THIS current time (since it is not a tau, nor it was projected)
+ // in case when the system is timed
+ if(timedFlag)
+ {
+ const BF & referenceTimeVar = ENV.getRvalue(
+ anEC.getAPExecutionData(),
+ anEC.refExecutionData().getSystemRID(),
+ timeReferenceInstance.to_ptr< InstanceOfData >() );
+
+ currentOfflineTestInfo->setTimeReference(referenceTimeVar);
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "2. Setting time reference to "
+ << referenceTimeVar.str()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ }
+
+
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+// AVM_OS_LOG << "The level nodes is now: " << std::endl;
+// ListOfExecutionContext::iterator itl = theLevelNodes.begin();
+// ListOfExecutionContext::iterator endItl = theLevelNodes.end();
+// for( ; itl != endItl ; itl++)
+// {
+// AVM_OS_LOG << "EC: " << (*itl)->str_min() << std::endl;
+// }
+// AVM_OS_LOG << "CUrr height: " << anEC.getHeight() << std::endl;
+// << "waiting top EC: " << getExecutionQueue().topWaiting()->str_min()
+// << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ /*
+ // only if the next context to execute is in a new level of the tree, we
+ // examine what happened with all the nodes in the same level
+ if( not getExecutionQueue().hasWaiting() ||
+ getExecutionQueue().topWaiting()->getHeight() != anEC.getHeight() )
+ {
+//we are in a new level:
+// 1. update height
+// 2. remove first obs from trace, keep it in lastObs
+// 3. according to the set of localObs of all execution contexts of the
+// previous height, give verdicts:
+// 3.1 if there is at least one empty obs, it is because it was
+// read/accepted by a node in the tree
+// 3.1.1 if the node for which the obs is empty is in the path,
+// if the trace is empty, incr PASS
+// 3.1.2 if the node for which the obs is empty is not in the path,
+// if the trace is empty, incr WeakPASS
+// 3.2 if the trace is empty:
+// 3.2.1 if PASS > 0 and WeakPASS > 0, emit WeakPASS
+// 3.2.2 if PASS > 0 and WeakPASS == 0, emit PASS
+// 3.2.3 if PASS == 0 and WeakPASS > 0, emit INCONCr
+// 3.3 if there is no empty obs, it is because no node read/accepted the trace:
+// 3.3.1 if lastObs is an input, emit INCONC?
+// 3.3.2 if lastObs is an output or a delay, emit FAIL
+// 3.4 if there is an obs and the trace is not empty, continue
+// 4. clear the level nodes
+
+
+ // step 1
+ theHeight = anEC.getHeight();
+
+ // step 2
+ TraceOfObs lastObs;
+ makeLocalObs(lastObs, theTrace);
+ removeOneObs(theTrace);
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "ahora el size de la trace es " << theTrace.size() <<std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ // step 3
+ // parcour all nodes in the list
+ ListOfExecutionContext::iterator itl = theLevelNodes.begin();
+ ListOfExecutionContext::iterator endItl = theLevelNodes.end();
+ int emptyObs = 0;
+ int weakPASS = 0;
+ int PASS = 0;
+ for( ; itl != endItl ; itl++)
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "verdict analizing EC: " << (*itl)->str_min() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ bool flag = false;
+ transitionInTestPurpose(
+ (*itl)->getRunnableElementTrace(), theTestPurpose, flag);
+
+ const TraceOfObs & aLocalObs = (*itl)->getUniqInformation()->
+ getUniqOfflineTestProcessorInfo()->getLocalObs();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "size of local obs is : " << aLocalObs.size() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ if( aLocalObs.empty() )
+ {
+ // it means this node accepted the head of the trace
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Size 0 for EC: " << (*itl)->str_min() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ emptyObs++;
+
+ if( theTrace.size() == 0 )
+ {
+ // weakPASS or PAS
+ flag=false;
+ transitionInTestPurpose(
+ (*itl)->getRunnableElementTrace(), theTestPurpose, flag);
+ if( flag )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Found in test purpose, pass!" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ PASS ++;
+ }
+ else
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Not found in test pourpose, weakPass" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ weakPASS ++;
+ }
+
+ }
+ }
+ }
+
+ // we delete the first transition in the list, since we changed of
+ // level in the tree
+ if( not theTestPurpose.empty() )
+ {
+ theTestPurpose.erase(theTestPurpose.begin());
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "NOW The test purpose (sequence of transition names) is: "
+ << std::endl;
+ for( VectorOfString::iterator i = theTestPurpose.begin() ;
+ i != theTestPurpose.end() ; ++i )
+ {
+ AVM_OS_LOG << *i << std::endl;
+ }
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ }
+ else
+ {
+ AVM_OS_WARN << "Error: Test purpose is empty before expected! "
+ << std::endl;
+ return false;
+ }
+
+ // step 3.2
+ if( theTrace.size() ==0 && emptyObs > 0 )
+ {
+ if( weakPASS > 0 )
+ {
+ if( PASS == 0 )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Verdict is InconcR!" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ verdictEmitted = true;
+ theVerdict = "INTONCr";
+ }
+ else
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Verdict is Weak Pass!" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ verdictEmitted = true;
+ theVerdict = "weakPASS";
+ }
+ }
+ else if( PASS > 0 )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Verdict is Pass!" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ verdictEmitted = true;
+ theVerdict = "PASS";
+ }
+
+
+ }
+
+ // step 3.3
+ // if there is no empty obs, it is because no node read/accepted
+ // the trace:
+ // 3.2.1 if lastObs is an input, emit INCONC?
+ // 3.2.2 if lastObs is an output or a delay, emit FAIL
+ if( emptyObs == 0 )
+ {
+ if( lastObs.first().first().is< InstanceOfData >() &&
+ (theTimeVarInstance->getNameID() ==
+ lastObs.first().first().to_ptr< InstanceOfData >()->getNameID()) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Sense of observation is: "
+ << lastObs.second().second().str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ if( lastObs.second().second().str() == "?" )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Verdict is Inconc?" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ verdictEmitted = true;
+ theVerdict = "INCONC?";
+ }
+ else {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Verdict is Fail!" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ verdictEmitted = true;
+ theVerdict = "FAIL";
+ }
+ }
+ else
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Sense of observation is: "
+ << lastObs.first().second().str() <<std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ if( lastObs.first().second().str() == "?" )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Verdict is Inconc? " << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ verdictEmitted = true;
+ theVerdict = "INCONC?";
+ }
+ else {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Verdict is Fail! " << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ verdictEmitted = true;
+ theVerdict = "FAIL";
+ }
+ }
+
+ }
+
+ // step 3.4
+ if( theTrace.size() > 0 && emptyObs > 0 )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Continue reading " << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ }
+
+ VectorOfExecutionContext::iterator it = anEC.begin();
+ VectorOfExecutionContext::iterator endIt = anEC.end();
+ for( ; it != endIt ; ++it )
+ {
+ // noop??
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Nested noop " << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ }
+
+ theLevelNodes.clear();
+ }
+ else
+ {www.npr.org/blogs/ed/2014/08/22/341898975/a-picture-of-language-the-fading-art-of-diagramming-sentences
+ // we are in the same level
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Not analyzing, out " << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ }
+*/
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "==> Rule: continue " << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ return( true );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// POST-PROCESS API
+////////////////////////////////////////////////////////////////////////////////
+
+void OfflineTestProcessor::searchLeaves(const ExecutionContext & anEC)
+{
+ if( anEC.isLeafNode() && anEC.isnotRoot() )
+ {
+ // it is a leaf, take its parent
+ // (the last leave is not evaluated by the filters)
+ if( not theLeavesECVector.contains(anEC.getPrevious()) )
+ {
+ theLeavesECVector.append( anEC.getPrevious() );
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "LEAF!!! local Trace size : "
+ << anEC.getPrevious()->getUniqInformation()->
+ getUniqOfflineTestProcessorInfo()->getLocalTrace().points.size()
+ << " => the EC: " << anEC.getPrevious()->str_min() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ }
+ }
+ else
+ {
+ // recursive lookup
+ ExecutionContext::child_iterator it = anEC.begin();
+ for( ; it != anEC.end() ; ++it )
+ {
+ searchLeaves( * (*it) );
+ }
+ }
+}
+
+bool OfflineTestProcessor::postprocess()
+{
+ AVM_OS_COUT << "OfflineTestProcessor::postprocess()" << std::endl;
+ AVM_OS_LOG << "OfflineTestProcessor::postprocess()" << std::endl;
+
+ theLeavesECVector.clear();
+ searchLeaves( getConfiguration().refFirstTrace() );
+ if( theLeavesECVector.empty() )
+ {
+ AVM_OS_LOG << "ZERO LEAVE :> FAILED !" << std::endl;
+ theVerdict = "FAILED";
+ return( true );
+ }
+
+ // list of execution contexts that will store the ones with the smallest traces
+ List< ExecutionContext * > smallestTraces;
+ smallestTraces.append(theLeavesECVector.first());
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "1. Smallest traces size :" << smallestTraces.size() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ VectorOfString repeatedTraces;
+
+ OfflineTestProcessorInfo * offlineTestInfo = NULL;
+
+ // aux var to find strings in lists
+ bool flag = false;
+
+ // check the local trace, last obs and last transition for every leaf
+ ListOfExecutionContext::iterator it = theLeavesECVector.begin();
+ ListOfExecutionContext::iterator endIt = theLeavesECVector.end();
+ for( ; it != endIt ; ++it )
+ {
+ offlineTestInfo = (*it)->getInformation()->getUniqOfflineTestProcessorInfo();
+
+ //theInformationVector.clear();
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "For this leave EC: " << (*it)->str_min() << std::endl
+ << "\tlast obs: " << std::endl;
+ //printTrace(offlineTestInfo->getLastObs());
+ if( offlineTestInfo->getLastTransition().valid() )
+ {
+ AVM_OS_LOG << "Last trans :" << std::endl
+ << offlineTestInfo->getLastTransition().str()
+ << std::endl;
+ AVM_OS_LOG << "Local trace size :" << std::endl
+ << offlineTestInfo->getLocalTrace().points.size()
+ << std::endl;
+ AVM_OS_LOG << "Local trace :" << std::endl;
+ }
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ if( offlineTestInfo->getLastTransition().valid() &&
+ (offlineTestInfo->getLocalTrace().points.size() <
+ smallestTraces.first()->getInformation()->
+ getUniqOfflineTestProcessorInfo()->getLocalTrace().points.size()) )
+ {
+ // we found a smaller trace: clear the list and initialize it with this EC
+ smallestTraces.clear();
+ smallestTraces.append((*it));
+ repeatedTraces.clear();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Is smallest!" << std::endl;
+ AVM_OS_LOG << offlineTestInfo->getTheAnalyzedMark() << std::endl;
+ if( offlineTestInfo->getTheAnalyzedMark() == true )
+ {
+ AVM_OS_LOG << "Is marked!" << std::endl;
+ }
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ }
+ else if( (offlineTestInfo->getLocalTrace().points.size() ==
+ smallestTraces.first()->getInformation()->
+ getUniqOfflineTestProcessorInfo()->getLocalTrace().points.size())
+ && offlineTestInfo->getLastTransition().valid() )
+ {
+ // we found another node/path accepting the trace
+ // we need to check if the transition is different that all the elements in the list...
+ flag = false;
+ // TODO: intelligent way to check for repeated transitions? is that possible?
+// transitionInList((*it)->getInformation()->
+// getUniqOfflineTestProcessorInfo()->getLastTransition(),
+// repeatedTraces, flag);
+ if( flag == false )
+ {
+ // different path accepting the same trace
+ smallestTraces.append((*it));
+ repeatedTraces.push_back(offlineTestInfo->getLastTransition().str());
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Is repeated!!!!" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ }
+ }
+ }
+
+ // now, smallestTraces is the list of smallest traces, let's emit a verdict
+
+ int PASS = 0, weakPASS = 0, INCONCi = 0, FAIL = 0;
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "2. Smallest traces size :" << smallestTraces.size() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+
+ // we go through the entire list...
+ endIt = smallestTraces.end();
+ for( it = smallestTraces.begin() ; it != endIt ; it++ )
+ {
+ offlineTestInfo = (*it)->getInformation()->getUniqOfflineTestProcessorInfo();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Smallest trace :" << std::endl;
+ printTrace(offlineTestInfo->getLocalTrace());
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ if( offlineTestInfo->getLocalTrace().points.size() == 0 )
+ {
+ bool flag = false;
+ // if no test purpose was specified, then PASS
+ if(theTestPurpose.points.empty())
+ {
+ AVM_OS_LOG << "NB: The verdict was computed with no test purpose. " << std::endl;
+ flag = true;
+ }
+ // else, is the last transition part of the test purpose ?
+ else{
+ transitionInList((*it)->getInformation()->
+ getUniqOfflineTestProcessorInfo()->getLastTransition(),
+ theTestPurpose, flag);
+ }
+ //is it a PASS, weakPASS or a INCONCr?
+ if( flag )
+ {
+ (*it)->getwFlags().addObjectiveAchievedTrace();
+
+ (*it)->addInfo(*this, INFO_OFFLINETEST_DATA_PASS);
+ PASS++;
+ }
+ else
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Size is 0, but transition not in TP of the EC: "
+ << (*it)->str_min() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ weakPASS++;
+ }
+ }
+ else
+ {
+ // retrieve the tracePoint of the first action in localTrace
+ // if aTracePoint is a controllable input, emit INCONC?
+ // if aTracePoint is an output or an uncontrollable input, emit FAIL
+
+ TracePoint * aTracePoint = offlineTestInfo->
+ getLocalTrace().points.first().to_ptr<TracePoint>();
+
+ if( aTracePoint->isTime()
+ && offlineTestInfo->getLocalTrace().points.populated()
+ && ( (theTimeVarInstance == aTracePoint->object)
+ /*|| (theTimeVarInstance->getNameID()
+ == aTracePoint->object->getNameID())*/ ) )
+ {
+ aTracePoint = offlineTestInfo->
+ getLocalTrace().points.second().to_ptr<TracePoint>();
+ }
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "(1) Direction of observation is: "
+ << aTracePoint->to_string(aTracePoint->op) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ if( (aTracePoint->op == AVM_OPCODE_INPUT_ENV) &&
+ portInCtrlSignals(aTracePoint) )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Verdict is Inconc? for the EC: " << (*it)->str_min()
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ INCONCi++;
+ break;
+ }
+ else if( (aTracePoint->op == AVM_OPCODE_INPUT) &&
+ portInCtrlSignals(aTracePoint) )
+ {
+ AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Verdict is Inconc? for the EC: " << (*it)->str_min()
+ << std::endl;
+ AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ INCONCi++;
+ break;
+ }
+ else
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Verdict is Fail! (output of the form d.a"
+ " --with a output or delay)" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ FAIL++;
+ break;
+ }
+
+ }
+
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "Counters: "
+ << "PASS: " << PASS << std::endl
+ << "WeakPASS: " << weakPASS << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+
+ // let's emit the verdict
+ if( PASS > 0 && weakPASS == 0 )
+ {
+ theVerdictKind = VERDICT_PASS_KIND;
+
+ theVerdict = " THE VERDICT IS : PASS ";
+ verdictEmitted = true;
+ }
+ else if( PASS > 0 && weakPASS > 0 )
+ {
+ theVerdictKind = VERDICT_WEAK_PASS_KIND;
+
+ theVerdict = " THE VERDICT IS : weakPASS ";
+ verdictEmitted = true;
+ }
+ else if( PASS == 0 && weakPASS > 0 )
+ {
+ theVerdictKind = VERDICT_INCONCr_KIND;
+
+ theVerdict = " THE VERDICT IS : INCONCr ";
+ verdictEmitted = true;
+ }
+ else if( INCONCi > 0 )
+ {
+ theVerdictKind = VERDICT_INCONCi_KIND;
+
+ theVerdict = " THE VERDICT IS : INCONCi ";
+ verdictEmitted = true;
+ }
+ else if( FAIL > 0 )
+ {
+ theVerdictKind = VERDICT_FAIL_KIND;
+
+ theVerdict = " THE VERDICT IS : FAIL ";
+ verdictEmitted = true;
+ }
+
+ else
+ {
+ theVerdictKind = VERDICT_ABORT_KIND;
+ }
+
+ if( verdictEmitted == true )
+ {
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+// AVM_OS_LOG << EMPHASIS(theVerdict, '=', 80);
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ }
+ else
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_WARN << "ERROR ! something went wrong, no verdict emitted! "
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ }
+
+ return true;
+}
+
+
+/**
+ * EXIT API
+ */
+bool OfflineTestProcessor::exitImpl()
+{
+ // SET EXIT CODE
+ switch( theVerdictKind )
+ {
+ case VERDICT_PASS_KIND:
+ {
+ avm_set_exit_code( AVM_EXIT_VERDICT_PASS_CODE );
+ break;
+ }
+ case VERDICT_WEAK_PASS_KIND:
+ {
+ avm_set_exit_code( AVM_EXIT_VERDICT_WEAK_PASS_CODE );
+ break;
+ }
+ case VERDICT_INCONCr_KIND:
+ {
+ avm_set_exit_code( AVM_EXIT_VERDICT_INCONCLUIVE_R_CODE);
+ break;
+ }
+ case VERDICT_INCONCi_KIND:
+ {
+ avm_set_exit_code( AVM_EXIT_VERDICT_INCONCLUIVE_INPUT_CODE );
+ break;
+ }
+ case VERDICT_FAIL_KIND:
+ {
+ avm_set_exit_code( AVM_EXIT_VERDICT_FAIL_CODE );
+ break;
+ }
+ case VERDICT_ABORT_KIND:
+ {
+ avm_set_exit_code( AVM_EXIT_VERDICT_ABORT_CODE );
+ break;
+ }
+ case VERDICT_UNDEFINED_KIND:
+ {
+ avm_set_exit_code( AVM_EXIT_VERDICT_UNDEFINED_CODE );
+ break;
+ }
+ default:
+ {
+ avm_set_exit_code( AVM_EXIT_VERDICT_ABORT_CODE );
+ break;
+ }
+ }
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// NON-REGRESSION TEST API
+////////////////////////////////////////////////////////////////////////////////
+
+void OfflineTestProcessor::tddRegressionReportImpl(OutStream & os)
+{
+ os << TAB << "THE VERDICT IS : ";
+
+ switch( theVerdictKind )
+ {
+ case VERDICT_PASS_KIND:
+ {
+ os << "PASS";
+ break;
+ }
+ case VERDICT_WEAK_PASS_KIND:
+ {
+ os << "WEAK_PASS";
+ break;
+ }
+ case VERDICT_INCONCr_KIND:
+ {
+ os << "INCONCr";
+ break;
+ }
+ case VERDICT_INCONCi_KIND:
+ {
+ os << "INCONCi";
+ break;
+ }
+ case VERDICT_FAIL_KIND:
+ {
+ os << "FAIL";
+ break;
+ }
+ case VERDICT_ABORT_KIND:
+ {
+ os << "ABORT";
+ break;
+ }
+ case VERDICT_UNDEFINED_KIND:
+ {
+ os << "UNDEFINED";
+ break;
+ }
+ default:
+ {
+ os << "ABORT";
+ break;
+ }
+ }
+
+ os << EOL_FLUSH;
+}
+
+/**
+ * Info Serialization
+ */
+void OfflineTestProcessorInfo::toStream(OutStream & os) const
+{
+ if( theLastObs.points.nonempty() )
+ {
+ os << TAB << "TABLE{" << EOL;
+
+ os << TAB << "}" << EOL_FLUSH;
+ }
+}
+
+void OfflineTestProcessorInfo::toFscn(OutStream & os) const
+{
+ if( theLastObs.points.nonempty() )
+ {
+ os << TAB << "TABLE{" << EOL;
+ os << TAB << "}" << EOL_FLUSH;
+ }
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/testing/OfflineTestProcessor.h b/org.eclipse.efm.symbex/src/fam/testing/OfflineTestProcessor.h
new file mode 100644
index 0000000..1af360c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/testing/OfflineTestProcessor.h
@@ -0,0 +1,592 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: fev 2012
+ *
+ * Contributors:
+ * Jose Escobedo (CEA LIST) jose.escobedo@cea.fr
+ * Mathilde Arnaud (CEA LIST) mathilde.arnaud@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef OFFLINETESTPROCESSOR_H_
+#define OFFLINETESTPROCESSOR_H_
+
+#include <fam/api/AbstractProcessorUnit.h>
+
+#include <common/BF.h>
+
+#include <collection/Typedef.h>
+
+#include <fml/executable/InstanceOfData.h>
+#include <fml/expression/AvmCode.h>
+#include <fml/builtin/Identifier.h>
+
+#include <fml/runtime/ExecutionData.h>
+
+#include <fml/trace/TraceFilter.h>
+#include <fml/trace/TracePoint.h>
+#include <fml/trace/TraceSequence.h>
+
+#include <solver/api/SolverDef.h>
+
+
+namespace sep
+{
+
+
+// list of port, sens, value or tvar, value
+// RESTRICTION: PORTS AND VARIABLES CANNOT SHARE THE SAME NAMESPACE!!!
+// this base structure is used to store observations of the form
+// CHANNEL [?, !] [VALUE, VARIABLE]
+//typedef List <BF> OneObs;
+//typedef TracePoint OneObs;
+/** TODO 2014/03/05
+Création d'une structure de donnée ad'hoc pour les << points d'observation >>
+*/
+
+// vector of obs
+// this structure stores a sequence (vector) of observations
+// it is used to store the trace of observations, as well
+// as a single observation (since we "can" have multiple communication channels,
+// a "single observation" can consists of multiple structures of type OneObs)
+//typedef Vector < OneObs > TraceOfObs;
+//typedef TraceSequence TraceOfObs;
+
+
+class RuntimeID;
+class SymbexControllerUnitManager;
+class TraceFactory;
+
+
+class OfflineTestProcessor :
+ public AutoRegisteredProcessorUnit< OfflineTestProcessor >
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( OfflineTestProcessor )
+
+
+ /**
+ * PROCESSOR FACTORY
+ * for automatic registration in the processor repository
+ * the [ [ FULLY ] QUALIFIED ] NAME ID
+ */
+ AVM_INJECT_AUTO_REGISTER_QUALIFIED_ID_KEY_3(
+ "test#offline",
+ "avm::processor.OFFLINE_TESTER",
+ "avm::processor.OFFLINETEST" )
+ // end registration
+
+ /**
+ * TYPEDEF
+ */
+ enum VERDICT_KIND
+ {
+ VERDICT_PASS_KIND,
+
+ VERDICT_WEAK_PASS_KIND,
+
+ VERDICT_INCONCr_KIND,
+ VERDICT_INCONCi_KIND,
+
+ VERDICT_FAIL_KIND,
+
+ VERDICT_ABORT_KIND,
+ VERDICT_UNDEFINED_KIND
+ };
+
+
+public:
+ /**
+ * INFO DATA
+ */
+ BF INFO_OFFLINETEST_DATA;
+ BF INFO_OFFLINETEST_DATA_PASS;
+ BF INFO_OFFLINETEST_DATA_INCONC;
+ BF INFO_OFFLINETEST_DATA_FAIL;
+ BF INFO_OFFLINETEST_TP_PATH;
+ BF INFO_OFFLINETEST_TARGET_STATE;
+
+ /**
+ * ATTRIBUTE
+ */
+ VERDICT_KIND theVerdictKind;
+
+protected:
+ // The user SOLVER choice
+ SolverDef::SOLVER_KIND theSolverKind;
+
+ // the trace is represented as a vector of lists
+ TraceSequence theTrace;
+ TraceSequence theMergeTrace;
+
+ // Vector of timed vars, so we know when there is an observation of "time"
+ VectorOfString theTimedVarsVector;
+
+ // counter that will tell us how many paths in the tree have accepted the "trace"
+ int traceInPath;
+
+ // we know if we have emitted a verdict by using this boolean (init to false)
+ bool verdictEmitted;
+ std::string theVerdict;
+
+ // test purpose given as a sequence of transition identifiers
+ // (associated with the symbolic execution tree)
+ TraceSequence theTestPurpose;
+
+ // timed var param
+ BF theTimeVarInstance;
+
+ // post-process/emission of verdicts
+ // Liste des ExecutionContext feuilles
+ ListOfExecutionContext theLeavesECVector;
+
+ // time of reference (tau and projection)
+ BF timeReferenceInstance;
+
+ // the observable signals to do the projection "à la volée"
+ TraceSequence theObsSignals;
+
+ //the controllable signals to compute correctly verdicts inconc/fail
+ TraceFilter theTraceFilter;
+
+ // erased nodes
+ int theErasedNodes;
+
+ // flag set to true if the system is timed
+ bool timedFlag;
+
+ const ExecutionData & theMainExecutionData;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ OfflineTestProcessor(
+ SymbexControllerUnitManager & aControllerUnitManager,
+ WObject * wfParameterObject);
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~OfflineTestProcessor()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // PLUGIN PROCESSOR API
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+ virtual bool configureImpl();
+
+ ////////////////////////////////////////////////////////////////////////////
+ // REPORT API
+ ////////////////////////////////////////////////////////////////////////////
+// TODO: fix bug to decomment this
+ virtual void reportDefault(OutStream & os) const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // NON-REGRESSION TEST API
+ ////////////////////////////////////////////////////////////////////////////
+ virtual void tddRegressionReportImpl(OutStream & os);
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PROCESS API
+ ////////////////////////////////////////////////////////////////////////////
+ virtual bool preprocess();
+
+ virtual bool postprocess();
+
+ /**
+ * EXIT API
+ */
+ virtual bool exitImpl();
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FILTER API
+ ////////////////////////////////////////////////////////////////////////////
+ bool AssignValuesIfObservable(
+ ExecutionContext & anExecutionContext,
+ TraceSequence & theLocalTrace);
+
+ bool hasIO(const BF & anElement,
+ ExecutionContext & anExecutionContext,
+ TraceSequence & theLocalTrace);
+
+ bool hasIO(ExecutionConfiguration * anExecutionConfiguration,
+ ExecutionContext & anExecutionContext,
+ TraceSequence & theLocalTrace);
+
+ bool updateTime(TracePoint * aTracePoint,
+ ExecutionContext & anExecutionContext,
+ TraceSequence * localTrace);
+
+ bool lookupValue(AvmCode * anAC, ExecutionContext & anExecutionContext,
+ ExecutionConfiguration * anExecutionConfiguration,
+ InstanceOfPort * aPort, AVM_OPCODE opcode,
+ TraceSequence & theLocalTrace);
+
+ bool hasIO(const BF & anElement);
+
+ bool hasObservableSignal(const BF & anElement);
+
+ bool hasObservableSignal(const BF & anElement,
+ const ExecutionConfiguration * anExexConf);
+
+ bool portInObsSignals(const RuntimeID & runtimeCtx,
+ InstanceOfPort * port, AVM_OPCODE ioOpcode);
+
+ bool portInCtrlSignals(TracePoint * portTP);
+
+ virtual bool prefilter();
+ virtual bool prefilter(ExecutionContext & anEC);
+
+ virtual bool postfilter();
+ virtual bool postfilter(ExecutionContext & anEC);
+
+ bool assignValue(AvmCode * anAC, ExecutionContext & anExecutionContext,
+ ExecutionConfiguration * anExecutionConfiguration,
+ InstanceOfPort * aPort, TraceSequence & localTrace, int offset = -1);
+
+ bool assignValue(AvmCode * anAC, ExecutionContext & anExecutionContext,
+ const BF & variableInstance, TracePoint * aTracePoint, int paramNb);
+
+// bool assignValue(AvmCode * anAC,
+// ExecutionContext & anExecutionContext,
+// ExecutionConfiguration * anExecutionConfiguration,
+// BF dataVar, InstanceOfPort * aPort,
+// TraceSequence & theLocalTrace, int offset = -1);
+
+// bool reAssignValue(AvmCode * anAC, EvaluationEnvironment theEnv,
+// ExecutionContext & anExecutionContext, BF aValue,
+// InstanceOfPort * aPort, VectorOfPairOfVariableValue * aTable,
+// int offset = -1);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SERIALIZATION API
+ ////////////////////////////////////////////////////////////////////////////
+ virtual void toStream(OutStream & os) const
+ {
+ if( mParameterWObject != WObject::_NULL_ )
+ {
+ mParameterWObject->toStream(os);
+ }
+ }
+
+ void printTrace(const TraceSequence & aTrace,
+ const std::string & title = "The (local) trace:",
+ const std::string & tab = "\t")
+ {
+ AVM_OS_LOG << tab << title << std::endl;
+ aTrace.toStream( AVM_OS_LOG << AVM_TAB_INDENT );
+ AVM_OS_LOG << END_INDENT << std::endl;
+// TraceSequence::const_iterator it = aTrace.begin();
+// for( ; it != aTrace.end() ; ++it )
+// {
+//// if ( (*it).first().is< InstanceOfData >()
+// && (theTimedVarsVector.getAstNameID()
+// == (*it).first().to_ptr<
+// InstanceOfData >()->getAstNameID()) )
+//// {
+//// AVM_OS_LOG << TAB << "XXXXXXXXXXXXXXtimevar: "
+//// << (*it).first().str() << std::endl;
+//// }
+// //AVM_OS_LOG << TAB << "XXXXXXXXXXXXXX22222: "
+// << (*it).first().to_ptr<
+// InstanceOfData >()->getAstNameID()
+// << std::endl;
+// if ( (*it).first().is< InstanceOfData >()
+// && (theTimeVarInstance->getAstNameID()
+// == (*it).first().to_ptr<
+// InstanceOfData >()->getAstNameID()) )
+// {
+// // it is a time var, print first and second values
+// AVM_OS_LOG << tab << "timevar: " << (*it).first().str() << std::endl
+// << tab << "value: " << (*it).second().str() << std::endl
+// << tab << REPEAT("==========", 5) << std::endl;
+// }
+// else
+// {
+// // it is a port, sens, value observation
+// AVM_OS_LOG << tab << "port: " << (*it).first().str() << std::endl
+// << tab << "sens: " << (*it).second().str() << std::endl
+// << tab << "value: " << (*it).at(3).str() << std::endl
+// << tab << REPEAT("==========", 5) << std::endl;
+// }
+// }
+ }
+
+ void makeLocalObs(TraceSequence & anObs, TraceSequence & aTrace)
+ {
+ /*
+ * Creates a single observation from the trace aTrace.
+ * A single observation can consist of multiple structures of type
+ * OneObs, since we may have multiple communication channels
+ */
+
+// anObs.clear();
+ anObs.points.clear();
+
+ // If the system is timed, a single observation consists of
+ // the time delay
+ // all communication actions occurring before the next time delay
+ if (aTrace.points.nonempty() && timedFlag)
+ {
+ // start with time obs
+ anObs.points.append( aTrace.points.first() );
+
+ BFList::raw_iterator< TracePoint > itPoint = aTrace.points.begin();
+ BFList::raw_iterator< TracePoint > endPoint = aTrace.points.end();
+ for( ++itPoint ; (itPoint != endPoint) ; ++itPoint )
+ {
+ if( itPoint->isTime() )
+ {
+ break;
+ }
+ else
+ {
+ anObs.points.append(*itPoint);
+ }
+ }
+ }
+
+ else if (aTrace.points.nonempty())
+ {
+ anObs.copyTrace(aTrace);
+ }
+
+// if (aTrace.points.size() >0)
+// {
+//
+// }
+
+ }
+
+ void removeOneObs(TraceSequence & aTrace)
+ {
+ /*
+ * Deletes one observation from the trace.
+ * We assume that one observation consists of a delay and
+ * of one or more inputs/outputs (up to the next delay).
+ */
+
+ if (aTrace.points.size() >0)
+ {
+ // start with time obs
+ aTrace.points.remove_first();
+
+ if (aTrace.points.size() >0)
+ {
+ BFList::const_iterator itPoint = aTrace.points.begin();
+ BFList::const_iterator endPoint = aTrace.points.end();
+ TracePoint * aTracePoint = (*itPoint).to_ptr< TracePoint >();
+ while ( (itPoint != endPoint) && !aTracePoint->isTime())
+ {
+ aTrace.points.remove_first();
+ aTracePoint = (*itPoint).to_ptr< TracePoint >();
+ }
+
+ }
+ }
+ }
+
+
+ bool parseMergedTrace(const std::string & filePath,
+ TraceSequence & aTrace, const BF & theTimeVar);
+
+ bool parseMergedTrace(
+ TraceFactory & aTraceFactory, const std::string & filePath,
+ TraceSequence & aMergeTrace, const BF & theTimeVar);
+
+ bool parseMergedTrace(TraceFactory & aTraceFactory,
+ const std::string &format, const std::string & filePath,
+ TraceSequence & aMergeTrace, const BF & theTimeVar);
+
+ bool parseTestPurpose(
+ const std::string & filePath, TraceSequence & testPurpose);
+
+ static void transitionInList(
+ const BF & aFF, TraceSequence & aTestPurpose, bool & flag);
+
+ // post-process API
+
+ void searchLeaves(const ExecutionContext & anEC);
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// OfflineTestProcessor Information
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class OfflineTestProcessorInfo :
+ public Element,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( OfflineTestProcessorInfo )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( OfflineTestProcessorInfo )
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ OfflineTestProcessorInfo()
+ : Element( CLASS_KIND_T( OfflineTestProcessorInfo ) ),
+ theLocalTrace( ),
+ theLastObs( ),
+ theLastTransition( ),
+ theAnalyzedMark( false ),
+ theTimeReference( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ OfflineTestProcessorInfo(const OfflineTestProcessorInfo & anInfo)
+ : Element( anInfo ),
+ theLocalTrace(anInfo.theLocalTrace),
+ theLastObs(anInfo.theLastObs),
+ theLastTransition(anInfo.theLastTransition),
+ theAnalyzedMark(anInfo.theAnalyzedMark),
+ theTimeReference(anInfo.theTimeReference)
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~OfflineTestProcessorInfo()
+ {
+ //!! NOTHING
+ }
+
+ /*
+ * GETTER -- SETTER
+ * theFormulaTable
+ */
+ inline TraceSequence & getLocalTrace()
+ {
+ return ( theLocalTrace );
+ }
+
+ inline void setLocalTrace(TraceSequence & aLocalTrace)
+ {
+ theLocalTrace = aLocalTrace;
+ }
+
+ //////////////
+
+ inline TraceSequence & getLastObs()
+ {
+ return ( theLastObs );
+ }
+
+ inline void setLastObs(TraceSequence & anObs)
+ {
+ theLastObs = anObs;
+ }
+
+ //////////////
+
+ inline BF & getLastTransition()
+ {
+ return ( theLastTransition );
+ }
+
+ inline const BF & getLastTransition() const
+ {
+ return ( theLastTransition );
+ }
+
+ inline void setLastTransition(const BF & aTrans)
+ {
+ theLastTransition = aTrans;
+ }
+
+ //////////////
+
+ inline BF & getTimeReference()
+ {
+ return ( theTimeReference );
+ }
+
+ inline const BF & getTimeReference() const
+ {
+ return ( theTimeReference );
+ }
+
+ inline void setTimeReference(const BF & aReference)
+ {
+ //aReference.makeWritable();
+ theTimeReference = aReference;
+ }
+
+ //////////////
+
+
+ inline bool getTheAnalyzedMark()
+ {
+ return ( theAnalyzedMark );
+ }
+
+ inline void setTheAnalyzedMark(bool mark)
+ {
+ theAnalyzedMark = mark;
+ }
+
+ /**
+ * Serialization
+ */
+ void toStream(OutStream & os) const;
+
+ void toFscn(OutStream & os) const;
+
+
+protected:
+
+ /*ATTRIBUTES*/
+
+ // each node has an associated local copy of the trace
+ TraceSequence theLocalTrace;
+ // each node has associated a last observation, used later to emit verdicts
+ TraceSequence theLastObs;
+ // each node has associated a last transition name, used later to emit verdicts
+ BF theLastTransition;
+ // boolean to indicate that a path should not be analyzed anymore
+ bool theAnalyzedMark;
+ // time reference to compute delays
+ BF theTimeReference;
+
+};
+
+
+
+
+
+} /* namespace sep */
+#endif /* OFFLINETESTPROCESSOR_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/trace/AbstractTraceBuilder.cpp b/org.eclipse.efm.symbex/src/fam/trace/AbstractTraceBuilder.cpp
new file mode 100644
index 0000000..844fc00
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/trace/AbstractTraceBuilder.cpp
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 6 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AbstractTraceBuilder.h"
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+
+namespace sep
+{
+
+////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////
+
+/*
+prototype process::trace_generator as &avm::processor.TRACE_GENERATOR is
+ section PROPERTY
+ ...
+ @data#selection = 'ALL'; // ALL | MODIFIED
+ ...
+ endsection PROPERTY
+
+ ...
+
+endprototype
+*/
+
+bool AbstractTraceBuilder::configure(WObject * wfParameterObject)
+{
+ WObject * thePROPERTY = Query::getRegexWSequence(
+ wfParameterObject, OR_WID2("property", "PROPERTY"));
+
+ if( thePROPERTY != WObject::_NULL_ )
+ {
+ mDataSelectionModifiedFlags = (Query::getRegexWPropertyString(
+ thePROPERTY, CONS_WID2("data", "selection"), "") == "MODIFIED");
+ }
+
+ return( configureImpl(wfParameterObject) );
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/trace/AbstractTraceBuilder.h b/org.eclipse.efm.symbex/src/fam/trace/AbstractTraceBuilder.h
new file mode 100644
index 0000000..8363012
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/trace/AbstractTraceBuilder.h
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 6 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef ABSTRACTTRACEBUILDER_H_
+#define ABSTRACTTRACEBUILDER_H_
+
+namespace sep
+{
+
+class AvmTraceGenerator;
+
+class WObject;
+
+class TraceManager;
+
+
+class AbstractTraceBuilder
+{
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ AvmTraceGenerator & mProcessor;
+
+ bool mDataSelectionModifiedFlags;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AbstractTraceBuilder(AvmTraceGenerator & aProcessor)
+ : mProcessor( aProcessor ),
+ mDataSelectionModifiedFlags( false )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AbstractTraceBuilder()
+ {
+ //!! NOTHING
+ }
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool configure(WObject * wfParameterObject);
+
+ virtual bool configureImpl(WObject * wfParameterObject) = 0;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONSTRUCTION API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual void build(TraceManager & aTraceManager) = 0;
+
+};
+
+
+} /* namespace sep */
+
+#endif /* ABSTRACTTRACEBUILDER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/trace/AbstractTraceFormatter.cpp b/org.eclipse.efm.symbex/src/fam/trace/AbstractTraceFormatter.cpp
new file mode 100644
index 0000000..5e61697
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/trace/AbstractTraceFormatter.cpp
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 6 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AbstractTraceFormatter.h"
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+
+namespace sep
+{
+
+/*
+prototype process::trace_generator as &avm::processor.TRACE_GENERATOR is
+ ...
+
+ section FORMAT
+ ...
+ @line#wrap#width = 80;
+ @line#wrap#separator = "\n\t";
+ ...
+ @value#array#begin = "[ ";
+ @value#array#separator = " , ";
+ @value#array#end = " ]";
+
+ @value#struct#begin = "{ ";
+ @value#struct#separator = " , ";
+ @value#struct#end = " }";
+ ...
+ endsection FORMAT
+
+ ...
+
+endprototype
+*/
+
+bool AbstractTraceFormatter::configure(WObject * wfParameterObject)
+{
+ WObject * thePROPERTY = Query::getRegexWSequence(
+ wfParameterObject, OR_WID2("property", "PROPERTY"));
+
+ if( thePROPERTY != WObject::_NULL_ )
+ {
+ mPrintLifelines = Query::getRegexWPropertyBoolean(
+ thePROPERTY, CONS_WID2("print", "lifelines"), false);
+ }
+
+ WObject * theFORMAT = Query::getRegexWSequence(
+ wfParameterObject, OR_WID2("format", "FORMAT"));
+
+ if( theFORMAT == WObject::_NULL_ ) {
+ theFORMAT = Query::getRegexWSequence(wfParameterObject,
+ OR_WID2("property", "PROPERTY"), wfParameterObject);
+ }
+
+ if( theFORMAT != WObject::_NULL_ )
+ {
+ mWrapData.LINE_WIDTH = Query::getRegexWPropertyPosSizeT(
+ theFORMAT, CONS_WID3("line", "wrap", "width"),
+ DEFAULT_WRAP_DATA.LINE_WIDTH);
+
+ mWrapData.SEPARATOR = Query::getRegexWPropertyString(theFORMAT,
+ CONS_WID3("line", "wrap", "separator"), mWrapData.SEPARATOR);
+ StringTools::replaceAll(mWrapData.SEPARATOR, "\\t" , "\t");
+ StringTools::replaceAll(mWrapData.SEPARATOR, "\\n" , "\n");
+
+ mMultiValueArrayCSS.BEGIN = Query::getRegexWPropertyString(
+ theFORMAT, CONS_WID3("value", "array", "begin"), "[ ");
+ mMultiValueArrayCSS.SEPARATOR = Query::getRegexWPropertyString(
+ theFORMAT, CONS_WID3("value", "array", "separator"), " , ");
+ mMultiValueArrayCSS.END = Query::getRegexWPropertyString(
+ theFORMAT, CONS_WID3("value", "array", "end"), " ]");
+
+ mMultiValueParamsCSS.BEGIN = Query::getRegexWPropertyString(theFORMAT,
+ CONS_WID3("value", "param(eter)?s?", "begin"), "( ");
+ mMultiValueParamsCSS.SEPARATOR = Query::getRegexWPropertyString(theFORMAT,
+ CONS_WID3("value", "param(eter)?s?", "separator"), " , ");
+ mMultiValueParamsCSS.END = Query::getRegexWPropertyString(theFORMAT,
+ CONS_WID3("value", "param(eter)?s?", "end"), " )");
+
+ mMultiValueStructCSS.BEGIN = Query::getRegexWPropertyString(
+ theFORMAT, CONS_WID3("value", "struct", "begin"), "{ ");
+ mMultiValueStructCSS.SEPARATOR = Query::getRegexWPropertyString(
+ theFORMAT, CONS_WID3("value", "struct", "separator"), " , ");
+ mMultiValueStructCSS.END = Query::getRegexWPropertyString(
+ theFORMAT, CONS_WID3("value", "struct", "end"), " }");
+ }
+
+ return( configureImpl(wfParameterObject) );
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/trace/AbstractTraceFormatter.h b/org.eclipse.efm.symbex/src/fam/trace/AbstractTraceFormatter.h
new file mode 100644
index 0000000..7ca405d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/trace/AbstractTraceFormatter.h
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 6 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef ABSTRACTTRACEFORMATTER_H_
+#define ABSTRACTTRACEFORMATTER_H_
+
+#include <printer/OutStream.h>
+
+
+namespace sep
+{
+
+class AvmTraceGenerator;
+
+class TraceManager;
+
+class WObject;
+
+
+class AbstractTraceFormatter
+{
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ AvmTraceGenerator & mTraceGenerator;
+
+ WrapData mWrapData;
+
+ SymbexValueCSS mMultiValueArrayCSS;
+ SymbexValueCSS mMultiValueParamsCSS;
+ SymbexValueCSS mMultiValueStructCSS;
+
+ // Lifelines
+ bool mPrintLifelines;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AbstractTraceFormatter(AvmTraceGenerator & aTraceGenerator)
+ : mTraceGenerator( aTraceGenerator ),
+ mWrapData( DEFAULT_WRAP_DATA.LINE_WIDTH, 0,
+ DEFAULT_WRAP_DATA.TAB_WIDTH, "\n" ),
+
+ mMultiValueArrayCSS ( DEFAULT_SYMBEX_VALUE_ARRAY_CSS ),
+ mMultiValueParamsCSS( DEFAULT_SYMBEX_VALUE_PARAMS_CSS ),
+ mMultiValueStructCSS( DEFAULT_SYMBEX_VALUE_STRUCT_CSS ),
+
+ // Lifelines
+ mPrintLifelines( true )
+
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AbstractTraceFormatter()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool configure(WObject * wfParameterObject);
+
+ virtual bool configureImpl(WObject * wfParameterObject) = 0;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // NUMERIZE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual void format(TraceManager & aTraceManager) = 0;
+
+};
+
+
+} /* namespace sep */
+
+#endif /* ABSTRACTTRACEFORMATTER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/trace/AvmTraceGenerator.cpp b/org.eclipse.efm.symbex/src/fam/trace/AvmTraceGenerator.cpp
new file mode 100644
index 0000000..258f591
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/trace/AvmTraceGenerator.cpp
@@ -0,0 +1,312 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 11 déc. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmTraceGenerator.h"
+
+#include "BasicTraceBuilder.h"
+#include "BasicTraceFormatter.h"
+#include "TTCNTraceFormatter.h"
+#include "TTCNTitanTraceFormatter.h"
+
+#include <collection/Typedef.h>
+
+#include <fml/template/TimedMachine.h>
+
+#include <fml/executable/ExecutableSystem.h>
+
+#include <fml/runtime/ExecutionContext.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <sew/Configuration.h>
+
+#include <fam/queue/ExecutionQueue.h>
+
+namespace sep
+{
+
+
+/*
+prototype process::trace_generator as &avm::processor.TRACE_GENERATOR is
+ section REPORT
+ @uri = std ":" ( "cout" | "cerr" )
+ | avm ":" ( "log" | "trace" )
+ | folder ":" path
+ | file ":" path
+ | filename ":" path
+ | socket ":" host ":" port
+ ;
+ @uri = ...;
+
+ @when = [ init ][:][ otf | (every | after | before)?value#unit][:][ exit ] ;
+
+endsection REPORT
+
+ section PROPERTY
+ // 'OMEGA' | 'CVC4' | 'Z3' | 'YICES'
+ @solver = 'CVC4';
+
+ // 'BASIC' | 'BASIC#XLIA' | 'BASIC#SDL'
+ // 'TTCN' | 'TTCN#XLIA' | 'TTCN#SDL'
+ @format = 'BASIC';
+
+ // Remove redundant <<numeric>> Trace !
+ // true | false
+ @normalize = true;
+
+ @numerizer = 'SOLVER'; // SOLVER | NONE | NEWFRESH
+
+ // true | false
+ @print_initialization_values = false;
+
+ @data#selection = 'ALL'; // ALL | MODIFIED
+ endsection PROPERTY
+
+ section TRACE
+ // AND --> conjunctive
+ // OR --> disjunctive
+ // XOR --> exclusive
+ // NOT --> negative
+ @combinator = 'OR';
+
+ @path#condition = "[*]";
+ @path#timed#condition = "[*]";
+
+ @time = "$delta";
+ @time = "$time";
+
+ @assign = "sens";
+
+ @newfresh = "sens";
+
+ @com = "env";
+
+ @signal = "sens";
+ @port = "env";
+
+ @input = "env";
+ @output = "env";
+
+ @output = "Thermostat->dt";
+ @input = "Thermostat->equip";
+ @output = "Equipment->error";
+
+ @transition = "t8";
+ @machine = "m1";
+ @procedure = "[*]";
+ endsection TRACE
+
+ section FORMAT
+ @line#wrap#width = 80;
+ @line#wrap#separator = "\n\t";
+
+ @value#struct#begin = "{ ";
+ @value#struct#separator = " , ";
+ @value#struct#end = " }";
+
+ @value#array#begin = "[ ";
+ @value#array#separator = " , ";
+ @value#array#end = " ]";
+
+ // %1% --> trace number
+ // %2% --> execution context leaf identifier
+ @header = "TRACE NUMBER %1%\n";
+ @end = "\n";
+
+ // %1% --> string message
+ // %2% --> execution context identifier
+ @comment = "//%1%";
+ @separator = "%1%" ;
+ @newline = "\n%1%";
+
+ // %1% --> step identifier
+ // %2% --> execution context identifier
+ @step#begin = "#step#begin %1%\n";
+ @step#end = "#step#end %1%\n";
+
+ // %1% --> condition
+ // %2% --> execution context identifier
+ @path#condition = "PC: %1%";
+ @path#timed#condition = "PtC: %1%";
+ @node#condition = "NC: %1%";
+ @node#timed#condition = "NtC: %1%";
+
+ // %1% --> machine runtime pid
+ // %2% --> machine container identifier
+ // %3% --> port | signal | variable | machine | transition | routine
+ // %4% --> value
+
+ @time = "\t%4%\n";
+
+ @assign = "\t%2%:%3% = %4%\n";
+
+ @newfresh = "\tnewfresh %2%->%3%( %4% )\n";
+
+ @transition = "\nfired %3%->%3%";
+
+ @machine = "\nrun %3%";
+
+ @procedure = "\ncall %3%";
+
+ @input = "\tinput %2%->%3%%4%\n";
+ @output = "\toutput %2%->%3%%4%\n";
+ endsection FORMAT
+endprototype
+*/
+
+
+/**
+ * DESTRUCTOR
+ */
+AvmTraceGenerator::~AvmTraceGenerator()
+{
+ delete( mTraceBuilder );
+
+ delete( mTraceFormatter );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmTraceGenerator::configureImpl()
+{
+ WObject * thePROPERTY = Query::getRegexWSequence(
+ getParameterWObject(), OR_WID2("property", "PROPERTY"));
+
+ if( thePROPERTY == WObject::_NULL_ )
+ {
+ mConfigFlag = false;
+ }
+
+ std::string solver = Query::getWPropertyString(thePROPERTY, "solver", "");
+
+ mSolverKind = SolverDef::toSolver(solver, SolverDef::DEFAULT_SOLVER_KIND);
+
+ mNormalizedFlag = Query::getWPropertyBoolean(thePROPERTY, "normalize", false);
+
+
+ // the Trace Point Numerizer configuration
+ mConfigFlag = mTraceNumerizer.configure(getParameterWObject())
+ && mConfigFlag;
+
+ // the Trace Point Filter configuration
+ mConfigFlag = mTracePointFilter.configure(ENV, getParameterWObject())
+ && mConfigFlag;
+
+ // the Trace Builder configuration
+ mTraceBuilder = new BasicTraceBuilder(*this, mSolverKind, mTracePointFilter);
+
+ mConfigFlag = (mTraceBuilder != NULL) &&
+ mTraceBuilder->configure(getParameterWObject())
+ && mConfigFlag;
+
+
+ // the Trace Formatter configuration
+ mTraceTypeID = Query::getWPropertyString(
+ thePROPERTY, "format", "BASIC#XLIA");
+ if( StringTools::startsWith(mTraceTypeID, "TTCN") )
+ {
+// if( StringTools::startsWith(mTraceTypeID, "TTCN#TITAN") )
+ if( mTraceTypeID.find("TITAN") != std::string::npos )
+ {
+ mTraceFormatter = new TTCNTitanTraceFormatter( *this );
+ }
+ else
+ {
+ mTraceFormatter = new TTCNTraceFormatter( *this );
+ }
+ }
+ else //if( StringTools::startsWith(format,"BASIC") )
+ {
+ mTraceFormatter = new BasicTraceFormatter( *this );
+ }
+
+ mConfigFlag = (mTraceFormatter != NULL)
+ && mTraceFormatter->configure(getParameterWObject())
+ && mConfigFlag;
+
+ return mConfigFlag;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// REPORT API
+////////////////////////////////////////////////////////////////////////////////
+
+void AvmTraceGenerator::reportDefault(OutStream & os) const
+{
+ os << TAB << mTraceTypeID << " TRACE GENERATOR" << EOL;
+
+ if( mTraceManager.nonempty() )
+ {
+ os << TAB2 << "The TRACE count : " << mTraceManager.size() << EOL;
+ os << TAB2 << "DONE !" << EOL_FLUSH;
+ }
+ else
+ {
+ os << TAB2 << "NO TRACE!" << EOL_FLUSH;
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// NON-REGRESSION TEST API
+////////////////////////////////////////////////////////////////////////////////
+
+void AvmTraceGenerator::tddRegressionReportImpl(OutStream & os)
+{
+ os << TAB << "NB TRACES : " << mTraceManager.size() << std::endl;
+
+ os << std::flush;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// PROCESS API
+////////////////////////////////////////////////////////////////////////////////
+
+bool AvmTraceGenerator::postprocess()
+{
+ ExecutionContext * rootEC = getConfiguration().getFirstTrace();
+ if( rootEC->isRoot() && rootEC->isLeafNode() )
+ {
+ return( true );
+ }
+
+ // Build Trace
+ mTraceBuilder->build( mTraceManager );
+
+ // Numerize all TraceSequence
+ mTraceNumerizer.numerize( mTraceManager );
+
+ // Normalize a Trace
+ if( mNormalizedFlag )
+ {
+ mTraceManager.normalize();
+
+ mTraceManager.resetTraceID();
+ }
+
+ // Format all TraceSequence
+ mTraceFormatter->format(mTraceManager);
+
+ return( true );
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/trace/AvmTraceGenerator.h b/org.eclipse.efm.symbex/src/fam/trace/AvmTraceGenerator.h
new file mode 100644
index 0000000..80c2923
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/trace/AvmTraceGenerator.h
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 11 déc. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMTRACEGENERATOR_H_
+#define AVMTRACEGENERATOR_H_
+
+#include <fam/api/AbstractProcessorUnit.h>
+
+#include "TraceManager.h"
+#include "TraceNumerizer.h"
+
+#include <fml/trace/TraceFilter.h>
+
+
+namespace sep
+{
+
+
+class AbstractTraceBuilder;
+class AbstractTraceFormatter;
+
+class ExecutableSystem;
+
+class SymbexControllerUnitManager;
+
+
+class AvmTraceGenerator :
+ public AutoRegisteredProcessorUnit< AvmTraceGenerator >
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( AvmTraceGenerator )
+
+
+ /**
+ * PROCESSOR FACTORY
+ * for automatic registration in the processor repository
+ * the [ [ FULLY ] QUALIFIED ] NAME ID
+ */
+ AVM_INJECT_AUTO_REGISTER_QUALIFIED_ID_KEY_3(
+ "serializer#symbex#trace#basic",
+ "serializer#symbex#trace#ttcn",
+ "avm::processor.TRACE_GENERATOR" )
+ // end registration
+
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ TraceManager mTraceManager;
+
+ SolverDef::SOLVER_KIND mSolverKind;
+
+ bool mNormalizedFlag;
+
+ std::string mTraceTypeID;
+
+ TraceFilter mTracePointFilter;
+
+ AbstractTraceBuilder * mTraceBuilder;
+
+ TraceNumerizer mTraceNumerizer;
+
+ AbstractTraceFormatter * mTraceFormatter;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmTraceGenerator(SymbexControllerUnitManager & aControllerUnitManager,
+ WObject * wfParameterObject)
+ : RegisteredProcessorUnit( aControllerUnitManager ,
+ wfParameterObject , AVM_POST_PROCESSING_STAGE ,
+ DEFAULT_PRECEDENCE_OF_SERIALIZER_PROCESSOR ),
+ mTraceManager( ),
+
+ mSolverKind( SolverDef::SOLVER_UNDEFINED_KIND ),
+ mNormalizedFlag( false ),
+ mTraceTypeID( "" ),
+
+ mTracePointFilter( ),
+ mTraceBuilder( NULL ),
+ mTraceNumerizer( ENV ),
+ mTraceFormatter( NULL )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AvmTraceGenerator();
+
+
+ /**
+ * mTracePointFilter
+ */
+ TraceFilter & getTraceFilter()
+ {
+ return( mTracePointFilter );
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool configureImpl();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // REPORT API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline virtual void reportSilent(OutStream & os) const
+ {
+ // SILENT => NOTHING
+ }
+
+ virtual void reportDefault(OutStream & os) const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // NON-REGRESSION TEST API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual void tddRegressionReportImpl(OutStream & os);
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PROCESS API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool postprocess();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SERIALIZATION API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual void toStream(OutStream & os) const
+ {
+ if( mParameterWObject != NULL )
+ {
+ mParameterWObject->toStream(os);
+ }
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* AVMTRACEGENERATOR_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/trace/BasicTraceBuilder.cpp b/org.eclipse.efm.symbex/src/fam/trace/BasicTraceBuilder.cpp
new file mode 100644
index 0000000..599422f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/trace/BasicTraceBuilder.cpp
@@ -0,0 +1,762 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 6 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "BasicTraceBuilder.h"
+
+
+#include <collection/Typedef.h>
+
+#include <computer/EvaluationEnvironment.h>
+
+#include <fml/executable/ExecutableSystem.h>
+
+#include <fml/expression/ExpressionFactory.h>
+
+#include <fml/runtime/ExecutionConfiguration.h>
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/RuntimeForm.h>
+#include <fml/runtime/TableOfData.h>
+
+#include <fml/template/TimedMachine.h>
+
+#include <fml/trace/TraceFilter.h>
+#include <fml/trace/TracePoint.h>
+#include <fml/trace/TraceSequence.h>
+
+#include <fml/type/TypeManager.h>
+
+#include <fam/trace/AvmTraceGenerator.h>
+#include <fam/trace/TraceManager.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <sew/Configuration.h>
+
+#include <solver/api/SolverFactory.h>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+BasicTraceBuilder::BasicTraceBuilder(AvmTraceGenerator & aProcessor,
+ SolverDef::SOLVER_KIND aSolverKind, TraceFilter & aTracePointFilter)
+: AbstractTraceBuilder( aProcessor ),
+ENV( aProcessor.getENV() ),
+
+isSDLFlag( false ),
+printInitValuesFlag( false ),
+
+mTraceManager( NULL ),
+mSolverKind( aSolverKind ),
+mTracePointFilter( aTracePointFilter ),
+
+mStepBeginSeparatorFlag( false ),
+mStepEndSeparatorFlag( false ),
+
+////////////////////////////////////////////////////////////////////////////
+// Computing Variables
+aTraceElement( NULL ),
+aTracePoint( NULL ),
+bfTP( ),
+TP_ID( 0 ),
+
+mTraceCache( ),
+aRootEC( NULL ),
+aTraceEC( NULL ),
+itEC( ),
+endEC( ),
+
+code( ),
+object( NULL ),
+value( )
+{
+ //!! NOTHING
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+/*
+prototype process::trace_generator as &avm::processor.TRACE_GENERATOR is
+ section REPORT
+ ...
+ endsection REPORT
+
+ section PROPERTY
+ ...
+ endsection PROPERTY
+
+ section TRACE
+ // AND --> conjunctive
+ // OR --> disjunctive
+ // XOR --> exclusive
+ // NOT --> negative
+ @combinator = 'OR';
+
+ @path#condition = "[*]";
+ @path#timed#condition = "[*]";
+
+ @time = "$delta";
+ @time = "$time";
+
+ @assign = "sens";
+
+ @newfresh = "sens";
+
+ @com = "env";
+
+ @signal = "sens";
+ @port = "env";
+
+ @input = "env";
+ @output = "env";
+
+ @output = "Thermostat->dt";
+ @input = "Thermostat->equip";
+ @output = "Equipment->error";
+
+ @transition = "t8";
+ @machine = "m1";
+ @procedure = "[*]";
+ endsection TRACE
+
+ section FORMAT
+ ...
+ endsection FORMAT
+endprototype
+*/
+bool BasicTraceBuilder::configureImpl(WObject * wfParameterObject)
+{
+ WObject * thePROPERTY = Query::getRegexWSequence(
+ wfParameterObject, OR_WID2("property", "PROPERTY"));
+
+ if( thePROPERTY == WObject::_NULL_ )
+ {
+ return false;
+ }
+
+ std::string format = Query::getWPropertyString(
+ thePROPERTY, "format", "BASIC#XLIA");
+ isSDLFlag = ( format.find("SDL") != std::string::npos );
+
+ printInitValuesFlag = Query::getRegexWPropertyBoolean(thePROPERTY,
+ CONS_WID2("show", "initialization") "|"
+ CONS_WID3("print", "initial", "values"), false);
+
+
+ WObject * theFORMAT = Query::getRegexWSequence(
+ wfParameterObject, OR_WID2("format", "FORMAT"));
+
+ if( theFORMAT != WObject::_NULL_ )
+ {
+ mStepBeginSeparatorFlag =
+ Query::hasRegexWProperty(
+ theFORMAT, CONS_WID2("step", "begin"));
+
+ mStepEndSeparatorFlag =
+ Query::hasRegexWProperty(
+ theFORMAT, CONS_WID2("step", "end"));
+ }
+
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CONSTRUCTION API
+////////////////////////////////////////////////////////////////////////////////
+
+void BasicTraceBuilder::build(TraceManager & aTraceManager)
+{
+ mTraceManager = (& aTraceManager);
+
+// updateFlags();
+
+ // Collect and Compute all TraceSequence
+ build( *( mProcessor.getConfiguration().getFirstTrace() ) );
+}
+
+
+void BasicTraceBuilder::build(const ExecutionContext & anEC)
+{
+ mTraceCache.push_back( & anEC );
+
+ if( anEC.isLeafNode() )
+ {
+ if( SolverFactory::isStrongSatisfiable(mSolverKind,
+ anEC.refExecutionData().getAllPathCondition()) )
+ {
+ buildTrace();
+ }
+ else
+ {
+AVM_IF_DEBUG_FLAG2( PROCESSOR , TRACE )
+ AVM_OS_TRACE << std::endl
+ << "BasicTraceBuilder::build:> Unsatisfiable PC << "
+ << anEC.refExecutionData().getAllPathCondition().str()
+ << " >> with solver << " << SolverDef::strSolver( mSolverKind )
+ << " >> for the EC:" << std::endl;
+ anEC.traceDefault( AVM_OS_TRACE );
+ anEC.refExecutionData().toStreamData( AVM_OS_TRACE );
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( PROCESSOR , TRACE )
+ }
+ }
+ else
+ {
+ ExecutionContext::child_iterator itEC = anEC.begin();
+ for( ; itEC != anEC.end() ; ++itEC )
+ {
+ build( *( *itEC ) );
+
+ mTraceCache.pop_back();
+ }
+ }
+}
+
+
+void BasicTraceBuilder::buildTrace()
+{
+ // La tête du chemin
+ aRootEC = mTraceCache.front();
+ // la queue du chemin
+ aTraceEC = mTraceCache.back();
+
+ aTraceElement = new TraceSequence(aTraceEC, mTraceManager->newTID());
+ mTraceManager->append( aTraceElement );
+
+ endEC = mTraceCache.end();
+
+
+ if( mTracePointFilter.hasPathConditionTracePoint()
+ && aTraceEC->refExecutionData().hasPathCondition() )
+ {
+ bfTP = aTracePoint = new TracePoint((* aTraceEC),
+ ENUM_TRACE_POINT::TRACE_PATH_CONDITION_NATURE_LEAF,
+ AVM_OPCODE_CHECK_SAT,
+ aTraceEC->refExecutionData().getPathCondition());
+
+ aTracePoint->tpid = ++TP_ID;
+ aTraceElement->points.append( bfTP );
+ }
+
+ if( mTracePointFilter.hasPathTimedConditionTracePoint()
+ && aTraceEC->refExecutionData().hasPathTimedCondition() )
+ {
+ bfTP = aTracePoint = new TracePoint((* aTraceEC),
+ ENUM_TRACE_POINT::TRACE_PATH_TIMED_CONDITION_NATURE_LEAF,
+ AVM_OPCODE_CHECK_SAT,
+ aTraceEC->refExecutionData().getPathTimedCondition());
+
+ aTracePoint->tpid = ++TP_ID;
+ aTraceElement->points.append( bfTP );
+ }
+
+
+ if( mTracePointFilter.hasNodeConditionPoint()
+ && aTraceEC->refExecutionData().hasNodeCondition() )
+ {
+ bfTP = aTracePoint = new TracePoint((* aTraceEC),
+ ENUM_TRACE_POINT::TRACE_NODE_CONDITION_NATURE_LEAF,
+ AVM_OPCODE_CHECK_SAT,
+ aTraceEC->refExecutionData().getNodeCondition());
+
+ aTracePoint->tpid = ++TP_ID;
+ aTraceElement->points.append( bfTP );
+ }
+
+ if( mTracePointFilter.hasNodeTimedConditionPoint()
+ && aTraceEC->refExecutionData().hasNodeTimedCondition() )
+ {
+ bfTP = aTracePoint = new TracePoint((* aTraceEC),
+ ENUM_TRACE_POINT::TRACE_NODE_TIMED_CONDITION_NATURE_LEAF,
+ AVM_OPCODE_CHECK_SAT,
+ aTraceEC->refExecutionData().getNodeTimedCondition());
+
+ aTracePoint->tpid = ++TP_ID;
+ aTraceElement->points.append( bfTP );
+ }
+
+
+ if( printInitValuesFlag )
+ {
+ printInitializationValues();
+ }
+
+ avm_size_t stepNumber = 0;
+ for( itEC = mTraceCache.begin() ; itEC != endEC ; ++itEC, ++stepNumber )
+ {
+ const ExecutionData & anED = (*itEC)->refExecutionData();
+
+ // BEGIN STEP
+ if( mStepBeginSeparatorFlag )
+ {
+ bfTP = aTracePoint = new TracePoint(*( *itEC ),
+ ENUM_TRACE_POINT::TRACE_STEP_BEGIN_NATURE,
+ to_string(stepNumber) );
+ aTraceElement->points.append( bfTP );
+ }
+
+
+ // the STEP
+ if( mTracePointFilter.hasAssignPoint() )
+ {
+ buildTraceVariable(*( *itEC ), aTraceElement, stepNumber > 0);
+ }
+
+ if( mTracePointFilter.hasRunnablePoint() )
+ {
+ buildTraceRunnable(*( *itEC ), aTraceElement,
+ anED.getRunnableElementTrace());
+ }
+
+ if( mTracePointFilter.hasIOTracePoint() )
+ {
+ buildTraceIO(*( *itEC ), aTraceElement, anED.getIOElementTrace());
+ }
+
+
+ // END STEP
+ if( mStepEndSeparatorFlag )
+ {
+ bfTP = aTracePoint = new TracePoint(*( *itEC ),
+ ENUM_TRACE_POINT::TRACE_STEP_END_NATURE,
+ to_string(stepNumber) );
+ aTraceElement->points.append( bfTP );
+ }
+ }
+
+ mTraceManager->reduce( aTraceElement );
+}
+
+
+void BasicTraceBuilder::buildTraceVariable(
+ const ExecutionContext & anEC, TraceSequence * aTraceElt, bool isnotRoot)
+{
+ const ExecutionData & anED = anEC.refExecutionData();
+
+ TableOfInstanceOfData::const_raw_iterator itVariable;
+ TableOfInstanceOfData::const_raw_iterator endVariable;
+
+ TableOfRuntimeT::const_iterator itRF = anED.getTableOfRuntime().begin();
+ TableOfRuntimeT::const_iterator endRF = anED.getTableOfRuntime().end();
+ RuntimeForm * pRF = NULL;
+ for( ++itRF; (itRF != endRF) ; ++itRF )
+ {
+ pRF = (*itRF);
+
+ if( pRF->hasData() )
+ {
+ itVariable = pRF->getExecutable()->getAllData().begin();
+ endVariable = pRF->getExecutable()->getAllData().end();
+ for( ; itVariable != endVariable ; ++itVariable )
+ {
+ if( mDataSelectionModifiedFlags && isnotRoot )
+ {
+ if( not anED.isAssigned(
+ pRF->getRID(), itVariable->getOffset()) )
+ {
+ continue;
+ }
+ }
+
+ if( mTracePointFilter.pass(pRF->getRID(),
+ static_cast< InstanceOfData * >(itVariable)) )
+ {
+ bfTP = aTracePoint = new TracePoint(anEC,
+ ENUM_TRACE_POINT::TRACE_VARIABLE_NATURE,
+ AVM_OPCODE_ASSIGN, pRF->getInstance(),
+ itVariable, pRF->getDataTable()->get(itVariable));
+
+ aTracePoint->RID = pRF->getRID();
+ aTracePoint->tpid = ++TP_ID;
+ aTraceElt->points.append( bfTP );
+ }
+ }
+ }
+ }
+}
+
+
+void BasicTraceBuilder::buildTraceIO(const ExecutionContext & anEC,
+ TraceSequence * aTraceElt, const BF & ioTrace)
+{
+ if( ioTrace.invalid() )
+ {
+ return;
+ }
+ else if( ioTrace.is< ExecutionConfiguration >() )
+ {
+ ExecutionConfiguration * aConf =
+ ioTrace.to_ptr< ExecutionConfiguration >();
+
+ object = mTracePointFilter.objectDeltaTime;
+
+ if( aConf->isAvmCode() )
+ {
+ AvmCode * aCode = aConf->getAvmCode();
+
+ aTracePoint = NULL;
+
+ switch( aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_ASSIGN_NEWFRESH:
+ {
+ object = aCode->first().to_ptr< BaseInstanceForm >();
+ value = aCode->second();
+
+ if( object == mTracePointFilter.objectDeltaTime )
+ {
+ bfTP = aTracePoint = new TracePoint(anEC, aConf,
+ ENUM_TRACE_POINT::TRACE_TIME_NATURE,
+ AVM_OPCODE_TIMED_GUARD,
+ aConf->getRuntimeID().getInstance(),
+ object, value);
+ }
+ else
+ {
+ bfTP = aTracePoint = new TracePoint(anEC,
+ aConf, aConf->getRuntimeID(), object, value);
+ }
+
+ break;
+ }
+
+ case AVM_OPCODE_INPUT:
+
+// case AVM_OPCODE_INPUT_FROM:
+//
+// case AVM_OPCODE_INPUT_SAVE:
+//
+// // Optimized version of INPUT
+// case AVM_OPCODE_INPUT_ENV:
+// case AVM_OPCODE_INPUT_VAR:
+// case AVM_OPCODE_INPUT_FLOW:
+// case AVM_OPCODE_INPUT_BUFFER:
+// case AVM_OPCODE_INPUT_RDV:
+// case AVM_OPCODE_INPUT_MULTI_RDV:
+// case AVM_OPCODE_INPUT_BROADCAST:
+// case AVM_OPCODE_INPUT_DELEGATE:
+
+ case AVM_OPCODE_OUTPUT:
+
+// case AVM_OPCODE_OUTPUT_TO:
+// // Optimized version of OUTPUT
+// case AVM_OPCODE_OUTPUT_ENV:
+// case AVM_OPCODE_OUTPUT_VAR:
+// case AVM_OPCODE_OUTPUT_FLOW:
+// case AVM_OPCODE_OUTPUT_BUFFER:
+// case AVM_OPCODE_OUTPUT_RDV:
+// case AVM_OPCODE_OUTPUT_MULTI_RDV:
+// case AVM_OPCODE_OUTPUT_BROADCAST:
+// case AVM_OPCODE_OUTPUT_DELEGATE:
+
+ default:
+ {
+ if( aCode->first().is< BaseInstanceForm >() )
+ {
+ object = aCode->first().to_ptr< BaseInstanceForm >();
+ value = BF::REF_NULL;
+
+ if( aCode->populated() )
+ {
+ if( aCode->size() >= 3 )
+ {
+ ArrayBF * values = new ArrayBF(
+ TypeManager::UNIVERSAL,
+ aCode->size() - (isSDLFlag? 2 : 1) );
+ value.setPointer(values);
+
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator endIt = aCode->end();
+ if( isSDLFlag )
+ {
+ --endIt;
+ }
+ avm_size_t offset = 0;
+ for( ++it; it != endIt ; ++offset , ++it )
+ {
+ values->set(offset, (*it));
+ }
+ }
+ else if( not isSDLFlag )
+ {
+ ArrayBF * values = new ArrayBF(
+ TypeManager::UNIVERSAL, 1);
+ value.setPointer(values);
+
+ values->set(0, aCode->second());
+ }
+ }
+
+ RuntimeID ridContainer = aConf->getRuntimeID();
+
+ if( object->is< InstanceOfPort >() )
+ {
+ ridContainer = aConf->getRuntimeID().getCommunicator(
+ object->to< InstanceOfPort >());
+
+ if( ridContainer.invalid() )
+ {
+ ridContainer = aConf->getRuntimeID();
+ }
+ }
+
+ bfTP = aTracePoint = new TracePoint(anEC, aConf,
+ ridContainer, object, value);
+ }
+ break;
+ }
+ }
+
+ if( mTracePointFilter.pass(aTracePoint) )
+ {
+ aTracePoint->tpid = ++TP_ID;
+ aTraceElt->points.append( bfTP );
+ }
+ }
+ }
+ else if( ioTrace.is< AvmCode >() )
+ {
+ AvmCode * ioCode = ioTrace.to_ptr< AvmCode >();
+
+ TraceSequence * subTrace = aTraceElt;
+ BF bfSubTrace;
+ if( not ioCode->isOpCode(aTraceElt->combinator) )
+ {
+ bfSubTrace = subTrace =
+ new TraceSequence(aTraceElt, ioCode->getOperator());
+ }
+
+ AvmCode::const_iterator it = ioCode->begin();
+ AvmCode::const_iterator endCode = ioCode->end();
+ for( ; it != endCode ; ++it )
+ {
+ buildTraceIO(anEC, subTrace, (*it));
+ }
+
+ if( (subTrace != aTraceElt) )
+ {
+ if( subTrace->points.singleton() )
+ {
+ aTraceElt->points.append( subTrace->points.pop_last() );
+ }
+ else if( subTrace->points.nonempty() )
+ {
+ aTraceElt->points.append( bfSubTrace );
+ }
+ }
+ }
+}
+
+
+void BasicTraceBuilder::buildTraceRunnable(const ExecutionContext & anEC,
+ TraceSequence * aTraceElt, const BF & aTrace)
+{
+ if( aTrace.invalid() )
+ {
+ return;
+ }
+ else if( aTrace.is< ExecutionConfiguration >() )
+ {
+ ExecutionConfiguration * aConf =
+ aTrace.to_ptr< ExecutionConfiguration >();
+
+ aTracePoint = NULL;
+
+ if( aConf->isAvmCode() )
+ {
+ bfTP = aTracePoint = new TracePoint(anEC, aConf,
+ ENUM_TRACE_POINT::TRACE_UNDEFINED_NATURE,
+ aConf->getAvmOpCode(),
+ aConf->getRuntimeID().getInstance(),
+ NULL, aConf->getCode());
+ }
+
+ else if( aConf->isTransition() )
+ {
+ bfTP = aTracePoint = new TracePoint(anEC, aConf,
+ ENUM_TRACE_POINT::TRACE_TRANSITION_NATURE,
+ AVM_OPCODE_INVOKE_TRANSITION,
+ aConf->getRuntimeID().getInstance(),
+ aConf->getTransition());
+ }
+
+ else if( aConf->isRoutine() )
+ {
+ bfTP = aTracePoint = new TracePoint(anEC, aConf,
+ ENUM_TRACE_POINT::TRACE_ROUTINE_NATURE,
+ AVM_OPCODE_NULL, //AVM_OPCODE_INVOKE_ROUTINE,
+ aConf->getRuntimeID().getInstance(), aConf->getProgram());
+ }
+
+ else if( aConf->isRunnable() )
+ {
+ bfTP = aTracePoint = new TracePoint(anEC, aConf,
+ ENUM_TRACE_POINT::TRACE_RUNNABLE_NATURE, AVM_OPCODE_RUN,
+ aConf->getRuntimeID().getInstance(), aConf->getProgram());
+ }
+
+ else if( aConf->isOperator() )
+ {
+ Operator * anOperator = aConf->getOperator();
+
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_RUN:
+ case AVM_OPCODE_IRUN:
+ case AVM_OPCODE_START:
+ {
+ RuntimeID ridContainer =
+ aConf->getRuntimeID().hasParent()
+ ? aConf->getRuntimeID().getParent()
+ : aConf->getRuntimeID();
+
+ bfTP = aTracePoint = new TracePoint(anEC, aConf,
+ ENUM_TRACE_POINT::TRACE_MACHINE_NATURE,
+ AVM_OPCODE_RUN, ridContainer,
+ aConf->getRuntimeID().getInstance());
+
+ break;
+ }
+
+ default:
+ {
+ bfTP = aTracePoint = new TracePoint(anEC, aConf,
+ ENUM_TRACE_POINT::TRACE_RUNNABLE_NATURE,
+ anOperator->getAvmOpCode(),
+ aConf->getRuntimeID().getInstance(),
+ & ( aConf->getRuntimeID().getExecutable()->
+ getOnActivityRoutine(
+ anOperator->getAvmOpCode()) ) );
+
+ break;
+ }
+ }
+ }
+
+ if( mTracePointFilter.pass(aTracePoint) )
+ {
+ aTracePoint->tpid = ++TP_ID;
+ aTraceElt->points.append( bfTP );
+ }
+ }
+ else if( aTrace.is< AvmCode >() )
+ {
+ AvmCode * ioCode = aTrace.to_ptr< AvmCode >();
+
+ TraceSequence * subTrace = aTraceElt;
+ BF bfSubTrace;
+ if( not ioCode->isOpCode(aTraceElt->combinator) )
+ {
+ bfSubTrace = subTrace =
+ new TraceSequence(aTraceElt, ioCode->getOperator());
+ }
+
+ AvmCode::const_iterator it = ioCode->begin();
+ AvmCode::const_iterator endCode = ioCode->end();
+ for( ; it != endCode ; ++it )
+ {
+ buildTraceRunnable(anEC, subTrace, (*it));
+ }
+
+ if( (subTrace != aTraceElt) )
+ {
+ if( subTrace->points.singleton() )
+ {
+ aTraceElt->points.append( subTrace->points.pop_last() );
+ }
+ else if( subTrace->points.nonempty() )
+ {
+ aTraceElt->points.append( bfSubTrace );
+ }
+ }
+ }
+}
+
+
+void BasicTraceBuilder::printInitializationValues()
+{
+ // !!!!!!!!!!!!!! Modif du 07/02/14 pour avoir les InitializationValues !!!!!!!!!!!!!!
+
+ bool atLeastOneInitialization = false;
+
+ TableOfInstanceOfData thePCVariableVector;
+ InstanceOfData * theVariable;
+
+ RuntimeID theRID = aTraceEC->refExecutionData().getParametersRID();
+ InstanceOfMachine * theMachine = theRID.getInstance();
+
+ ExpressionFactory::collectVariable(
+ aTraceEC->refExecutionData().getPathCondition(),
+ thePCVariableVector);
+
+ // Initialization beginning marker"
+ bfTP = aTracePoint = new TracePoint((* aTraceEC),
+ ENUM_TRACE_POINT::TRACE_INIT_BEGIN_NATURE,
+ to_string(aTraceElement->tid));
+ aTraceElement->points.append( bfTP );
+
+ for (avm_size_t k = 0 ; k < thePCVariableVector.size() ; k ++)
+ {
+ theVariable = thePCVariableVector.rawAt( k );
+
+ std::string varName = theVariable->getFullyQualifiedNameID();
+ std::string::size_type index = varName.find_last_of('#');
+ if( (index != std::string::npos) && (varName[index+1] == '0') )
+ {
+ atLeastOneInitialization = true;
+
+ bfTP = aTracePoint = new TracePoint((* aTraceEC), NULL,
+ ENUM_TRACE_POINT::TRACE_VARIABLE_NATURE,
+ AVM_OPCODE_ASSIGN,
+ theMachine, // instance de sa machine, NULL si on ne l'affiche pas
+ theVariable, // instance de la variable
+ thePCVariableVector[ k ]); // sa valeur dans l'EC
+
+ aTracePoint->RID = aTraceEC->refExecutionData().getParametersRID();
+
+ // Ajout dans la trace courante
+ aTraceElement->points.append( bfTP );
+ }
+ }
+
+ if( atLeastOneInitialization )
+ {
+ // Affichage saut de ligne pour séparer les "Initialization values" du scénario
+ bfTP = aTracePoint = new TracePoint((* aTraceEC),
+ ENUM_TRACE_POINT::TRACE_INIT_END_NATURE,
+ to_string(aTraceElement->tid));
+ aTraceElement->points.append( bfTP );
+ }
+ else
+ {
+ // Remove initialization beginning marker"
+ aTraceElement->points.remove_last();
+ }
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/trace/BasicTraceBuilder.h b/org.eclipse.efm.symbex/src/fam/trace/BasicTraceBuilder.h
new file mode 100644
index 0000000..d88d276
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/trace/BasicTraceBuilder.h
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 6 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BASICTRACEBUILDER_H_
+#define BASICTRACEBUILDER_H_
+
+#include "AbstractTraceBuilder.h"
+
+#include <collection/Typedef.h>
+
+#include <fml/runtime/ExecutionContext.h>
+
+#include <solver/api/SolverDef.h>
+
+
+namespace sep
+{
+
+class AvmTraceGenerator;
+class EvaluationEnvironment;
+class ExecutableSystem;
+class ExecutionData;
+
+class TraceFilter;
+class TraceManager;
+class TracePoint;
+class TraceSequence;
+
+
+class BasicTraceBuilder : public AbstractTraceBuilder
+{
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ EvaluationEnvironment & ENV;
+
+ bool isSDLFlag;
+ bool printInitValuesFlag;
+
+ TraceManager * mTraceManager;
+
+ SolverDef::SOLVER_KIND mSolverKind;
+
+ TraceFilter & mTracePointFilter;
+
+ bool mStepBeginSeparatorFlag;
+ bool mStepEndSeparatorFlag;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing Variables
+ TraceSequence * aTraceElement;
+ TracePoint * aTracePoint;
+ BF bfTP;
+ avm_size_t TP_ID;
+
+ ListOfConstExecutionContext mTraceCache;
+
+ const ExecutionContext * aRootEC;
+ const ExecutionContext * aTraceEC;
+ ListOfConstExecutionContext::const_iterator itEC;
+ ListOfConstExecutionContext::const_iterator endEC;
+
+ BF code;
+ BaseCompiledForm * object;
+ BF value;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BasicTraceBuilder(AvmTraceGenerator & aProcessor,
+ SolverDef::SOLVER_KIND aSolverKind,
+ TraceFilter & aTracePointFilter);
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BasicTraceBuilder()
+ {
+ //!! NOTHING
+ }
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool configureImpl(WObject * wfParameterObject);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONSTRUCTION API
+ ////////////////////////////////////////////////////////////////////////////
+
+ void build(TraceManager & aTraceManager);
+
+ void build(const ExecutionContext & anEC);
+
+ void buildTrace();
+
+ void buildTraceVariable(const ExecutionContext & anEC,
+ TraceSequence * aTraceElt, bool isnotRoot = true);
+
+ void buildTraceIO(const ExecutionContext & anEC,
+ TraceSequence * aTraceElt, const BF & ioTrace);
+
+ void buildTraceRunnable(const ExecutionContext & anEC,
+ TraceSequence * aTraceElt, const BF & aTrace);
+
+ void printInitializationValues();
+
+};
+
+
+} /* namespace sep */
+
+#endif /* BASICTRACEBUILDER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/trace/BasicTraceFormatter.cpp b/org.eclipse.efm.symbex/src/fam/trace/BasicTraceFormatter.cpp
new file mode 100644
index 0000000..567d29d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/trace/BasicTraceFormatter.cpp
@@ -0,0 +1,1012 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 11 déc. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "BasicTraceFormatter.h"
+
+#include "TraceManager.h"
+
+#include <common/SerializerFeature.h>
+
+#include <fam/trace/AvmTraceGenerator.h>
+
+#include <fml/executable/InstanceOfMachine.h>
+
+#include <fml/expression/BuiltinArray.h>
+
+#include <fml/runtime/ExecutionConfiguration.h>
+#include <fml/runtime/RuntimeLib.h>
+#include <fml/runtime/RuntimeQuery.h>
+
+#include <fml/trace/TracePoint.h>
+#include <fml/trace/TraceSequence.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <boost/format.hpp>
+
+
+namespace sep
+{
+
+
+/**
+ * ASSIGN
+ * %1% --> machine runtime pid
+ * %2% --> machine container identifier
+ * %3% --> variable identifier
+ * %4% --> value
+ */
+const std::string & BasicTraceFormatter::
+DEFAULT_ASSIGN_PATTERN = "\t%2%:%3% = %4%\n";
+
+/**
+ * NEWFRESH
+ * %1% --> machine runtime pid
+ * %2% --> machine container identifier
+ * %3% --> variable identifier
+ * %4% --> value
+ */
+const std::string & BasicTraceFormatter::
+DEFAULT_NEWFRESH_PATTERN = "\tnewfresh %2%->%3%( %4% )\n";
+
+/**
+ * INPUT / OUTPUT
+ * %1% --> machine runtime pid
+ * %2% --> machine container identifier
+ * %3% --> ( port | signal ) identifier
+ * %4% --> value
+ * %5% --> machine sender identifier name
+ * %6% --> machine receiver identifier name
+ */
+const std::string & BasicTraceFormatter::
+DEFAULT_INPUT_PATTERN = "\tinput %2%->%3%%4%\n";
+
+const std::string & BasicTraceFormatter::
+DEFAULT_OUTPUT_PATTERN = "\toutput %2%->%3%%4%\n";
+
+
+const std::string & BasicTraceFormatter::
+DEFAULT_INPUT_ENV_PATTERN = "\tinput#env %2%->%3%%4%\n";
+
+const std::string & BasicTraceFormatter::
+DEFAULT_OUTPUT_ENV_PATTERN = "\toutput#env %2%->%3%%4%\n";
+
+
+const std::string & BasicTraceFormatter::
+DEFAULT_INPUT_RDV_PATTERN = "\tinput#rdv %2%->%3%%4%\n";
+
+const std::string & BasicTraceFormatter::
+DEFAULT_OUTPUT_RDV_PATTERN = "\toutput#rdv %2%->%3%%4%\n";
+
+/**
+ * MACHINE
+ * %1% --> machine runtime pid
+ * %2% --> machine container identifier
+ * %3% --> machine identifier
+ */
+const std::string & BasicTraceFormatter::
+DEFAULT_MACHINE_PATTERN = "%3%";
+
+/**
+ * TRANSITION
+ * %1% --> machine runtime pid
+ * %2% --> machine container identifier
+ * %3% --> transition identifier
+ */
+const std::string & BasicTraceFormatter::
+DEFAULT_TRANSITION_PATTERN = "%2%->%3%";
+
+/**
+ * ROUTINE
+ * %1% --> machine runtime pid
+ * %2% --> machine container identifier
+ * %3% --> routine identifier
+ */
+const std::string & BasicTraceFormatter::
+DEFAULT_ROUTINE_PATTERN = "%2%->%3%";
+
+
+/*
+prototype process::trace_generator as &avm::processor.TRACE_GENERATOR is
+ ...
+ section FORMAT
+ @line#wrap#width = 80;
+ @line#wrap#separator = "\n\t";
+
+ @header = "TRACE LIST\n";
+ @end = "\n";
+
+ // %1% --> ->EC#id
+ // %2% --> ec#eval
+ // %3% --> ec#hight
+ // %4% --> ec#width
+ // %5% --> ec#weight
+ // %6% --> statemachine configuration i.e. control node
+ @context#qnid = "ctx< %1% > %6%";
+ @context#ufid = "ctx< %1% > %6%"; // @Deprecated
+
+ // %1% --> trace number
+ // %2% --> execution context leaf identifier
+ @header = "TRACE NUMBER %1%\n";
+ @end = "\n";
+
+ @init#begin = "\t// Initialization parameter values:\n";
+ @init#end = "\n";
+
+ // %1% --> string message
+ // %2% --> execution context identifier
+ @comment = "//%1%";
+ @separator = "%1%" ;
+ @newline = "\n%1%";
+
+ // %1% --> step identifier
+ // %2% --> execution context identifier
+ @step#begin = "#step#begin %1%\n";
+ @step#end = "#step#end %1%\n";
+
+ // %1% --> condition
+ // %2% --> execution context identifier
+ @path#condition = "PC: %1%";
+ @path#timed#condition = "PtC: %1%";
+ @node#condition = "NC: %1%";
+ @node#timed#condition = "NtC: %1%";
+
+ // %1% --> machine runtime pid
+ // %2% --> machine container identifier
+ // %3% --> port | signal | variable | machine | transition | routine
+ // %4% --> value
+
+ @time = "\t%4%\n";
+
+ @assign = "\t%2%:%3% = %4%\n";
+
+ @newfresh = "\tnewfresh %2%->%3%( %4% )\n";
+
+ @input = "\tinput %2%->%3%%4%\n";
+ @output = "\toutput %2%->%3%%4%\n";
+
+ @input#env = "\tINPUT %2%->%3%%4%\n";
+ @output#env = "\tOUTPUT %2%->%3%%4%\n";
+
+ endsection FORMAT
+ ...
+endprototype
+*/
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+
+bool BasicTraceFormatter::configure(WObject * FORMAT,
+ std::string & formatPattern, const std::string & id, bool isRegex)
+{
+ formatPattern = isRegex
+ ? Query::getRegexWPropertyString(FORMAT, id, formatPattern)
+ : Query::getWPropertyString(FORMAT, id, formatPattern);
+
+ StringTools::replaceAll(formatPattern, "\\t", "\t");
+ StringTools::replaceAll(formatPattern, "\\n", "\n");
+
+ StringTools::replaceAll(formatPattern, "\\\"", "\"");
+
+ try
+ {
+ boost::format formatter(formatPattern);
+ }
+ catch(const boost::io::bad_format_string & bfs)
+ {
+ Query::reportErrorAttribute(FORMAT, id, bfs.what());
+
+ return( false );
+ }
+
+ return( true );
+}
+
+bool BasicTraceFormatter::configureImpl(WObject * wfParameterObject)
+{
+ // default parameter
+ // %1% --> trace number
+ // %2% --> execution context leaf identifier
+ // @header = "TRACE NUMBER %1%\n";
+ // @end = "\n";
+
+ // %1% --> machine runtime pid
+ // %2% --> machine container identifier
+ // %3% --> port | signal | variable | machine | transition | routine
+ // %4% --> value
+
+ // @time = "\t%4%\n";
+ //
+ // @assign = "\t%2%:%3% = %4%\n";
+ //
+ // @newfresh = "\tnewfresh %2%->%3%( %4% )\n";
+ //
+ // @input = "\tinput %2%->%3%%4%\n";
+ // @output = "\toutput %2%->%3%%4%\n";
+
+ WObject * theFORMAT = Query::getRegexWSequence(
+ wfParameterObject, OR_WID2("format", "FORMAT"));
+
+ if( theFORMAT != WObject::_NULL_ )
+ {
+ avm_size_t error = 0;
+
+ error += configure(theFORMAT, mExecutionContextUfidPattern,
+ CONS_WID2("context", "(qn|uf)id"), true) ? 0 : 1;
+
+
+ error += configure(theFORMAT, mFileHeaderPattern,
+ CONS_WID2("file", "header"), true) ? 0 : 1;
+
+ error += configure(theFORMAT, mFileBeginPattern,
+ CONS_WID2("file", "begin"), true ) ? 0 : 1;
+
+ error += configure(theFORMAT, mFileEndPattern,
+ CONS_WID2("file", "end"), true ) ? 0 : 1;
+
+
+ error += configure(theFORMAT, mTestcaseHeaderPattern,
+ CONS_WID2("testcase", "header"), true) ? 0 : 1;
+
+ error += configure(theFORMAT, mTestcaseBeginPattern,
+ CONS_WID2("testcase", "begin"), true ) ? 0 : 1;
+
+ error += configure(theFORMAT, mTestcaseEndPattern,
+ CONS_WID2("testcase", "end"), true ) ? 0 : 1;
+
+
+ error += configure(theFORMAT, mLifelineHeaderPattern,
+ CONS_WID2("lifeline", "header"), true) ? 0 : 1;
+
+ error += configure(theFORMAT, mLifelineBeginPattern,
+ CONS_WID2("lifeline", "begin"), true ) ? 0 : 1;
+
+ error += configure(theFORMAT, mLifelineEndPattern,
+ CONS_WID2("lifeline", "end"), true ) ? 0 : 1;
+
+ error += configure(theFORMAT, mLifelineIdPattern,
+ CONS_WID2("lifeline", "id"), true ) ? 0 : 1;
+
+
+ error += configure(theFORMAT, mInitializationHeaderPattern,
+ CONS_WID2("init", "header"), true) ? 0 : 1;
+
+ error += configure(theFORMAT, mInitializationBeginPattern,
+ CONS_WID2("init", "begin"), true) ? 0 : 1;
+
+ error += configure(theFORMAT, mInitializationEndPattern,
+ CONS_WID2("init", "end"), true ) ? 0 : 1;
+
+
+ error += configure(theFORMAT, mStepHeaderPattern,
+ CONS_WID2("step", "header"), true) ? 0 : 1;
+
+ error += configure(theFORMAT,mStepBeginPattern,
+ CONS_WID2("step", "begin"), true ) ? 0 : 1;
+
+ error += configure(theFORMAT, mStepEndPattern,
+ CONS_WID2("step", "end"), true ) ? 0 : 1;
+
+
+ error += configure(theFORMAT, mCommentPattern , "comment" ) ? 0 : 1;
+
+ error += configure(theFORMAT, mSeparatorPattern, "separator") ? 0 : 1;
+
+ error += configure(theFORMAT, mNewlinePattern , "newline" ) ? 0 : 1;
+
+
+ error += configure(theFORMAT, mPathConditionPattern,
+ CONS_WID2("path", "condition"), true ) ? 0 : 1;
+
+ error += configure(theFORMAT,mPathTimedConditionPattern,
+ CONS_WID2("path#timed", "condition"), true ) ? 0 : 1;
+
+ error += configure(theFORMAT, mNodeConditionPattern,
+ CONS_WID2("node", "condition"), true ) ? 0 : 1;
+
+ error += configure(theFORMAT, mNodeTimedConditionPattern,
+ CONS_WID2("node#timed", "condition"), true ) ? 0 : 1;
+
+
+ error += configure(theFORMAT, mTimePattern , "time" ) ? 0 : 1;
+ error += configure(theFORMAT, mAssignPattern , "assign" ) ? 0 : 1;
+ error += configure(theFORMAT, mNewfreshPattern, "newfresh") ? 0 : 1;
+
+ error += configure(theFORMAT, mInputPattern , "input" ) ? 0 : 1;
+ error += configure(theFORMAT, mOutputPattern, "output") ? 0 : 1;
+
+
+ error += configure(theFORMAT, mInputEnvPattern,
+ CONS_WID2("input", "env"), true ) ? 0 : 1;
+
+ error += configure(theFORMAT, mOutputEnvPattern,
+ CONS_WID2("output", "env"), true) ? 0 : 1;
+
+
+ error += configure(theFORMAT, mInputRdvPattern,
+ CONS_WID2("input", "rdv"), true ) ? 0 : 1;
+
+ error += configure(theFORMAT, mOutputRdvPattern,
+ CONS_WID2("output", "rdv"), true) ? 0 : 1;
+
+
+ if( Query::hasWPropertyString(theFORMAT, "input") )
+ {
+ if( not Query::hasRegexWProperty(
+ theFORMAT, CONS_WID2("input", "env")) )
+ {
+ mInputEnvPattern = mInputPattern;
+ }
+ if( not Query::hasRegexWProperty(
+ theFORMAT, CONS_WID2("input", "rdv")) )
+ {
+ mInputRdvPattern = mInputPattern;
+ }
+ }
+
+ if( Query::hasWPropertyString(theFORMAT, "output") )
+ {
+ if( not Query::hasRegexWProperty(
+ theFORMAT, CONS_WID2("output", "env")) )
+ {
+ mOutputEnvPattern = mOutputPattern;
+ }
+ if( not Query::hasRegexWProperty(
+ theFORMAT, CONS_WID2("output", "rdv")) )
+ {
+ mOutputRdvPattern = mOutputPattern;
+ }
+ }
+
+ error += configure(theFORMAT,
+ mMachinePattern , "machine" ) ? 0 : 1;
+
+ error += configure(theFORMAT,
+ mTransitionPattern, "transition") ? 0 : 1;
+
+ error += configure(theFORMAT,
+ mRoutinePattern , "routine" ) ? 0 : 1;
+
+ error += configure(theFORMAT,
+ mRunnablePattern , "runnable" ) ? 0 : 1;
+
+ return( error == 0 );
+ }
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// FORMAT API
+////////////////////////////////////////////////////////////////////////////////
+
+void BasicTraceFormatter::format(TraceManager & aTraceManager)
+{
+ mTraceGenerator.beginStream();
+ while( mTraceGenerator.hasStream() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRACE )
+ mTraceGenerator.currentStream() << "format:> ";
+ mTraceGenerator.getTraceFilter().toStream(mTraceGenerator.currentStream());
+ mTraceGenerator.currentStream() << std::endl;
+
+ aTraceManager.toStream( mTraceGenerator.currentStream() );
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRACE )
+
+ format(mTraceGenerator.currentStream(), aTraceManager);
+ }
+
+ mTraceGenerator.closeStream();
+}
+
+
+void BasicTraceFormatter::format(OutStream & os, TraceManager & aTraceManager)
+{
+ os.setSymbexValueCSS(mMultiValueArrayCSS,
+ mMultiValueParamsCSS, mMultiValueStructCSS);
+
+ // En tête global
+ boost::format headformatter(mFileHeaderPattern);
+ headformatter.exceptions( boost::io::no_error_bits );
+ os << headformatter << std::flush;
+
+ boost::format beginformatter(mFileBeginPattern);
+ beginformatter.exceptions( boost::io::no_error_bits );
+ os << beginformatter << std::flush;
+
+ TraceManager::const_iterator it = aTraceManager.begin();
+ TraceManager::const_iterator endIt = aTraceManager.end();
+ for( ; it != endIt ; ++it )
+ {
+ aTraceElement = (*it);
+
+ formatTraceID(os, *aTraceElement, mTestcaseHeaderPattern);
+ formatTraceID(os, *aTraceElement, mTestcaseBeginPattern);
+
+ format(os, *aTraceElement);
+
+ formatTraceID(os, *aTraceElement, mTestcaseEndPattern);
+
+ if( mPrintLifelines )
+ {
+ formatLifelines(os, *aTraceElement);
+ os << std::endl;
+ }
+ }
+
+ // End global
+ boost::format endformatter(mFileEndPattern);
+ endformatter.exceptions( boost::io::no_error_bits );
+ os << endformatter << std::flush;
+
+ os.restoreSymbexValueCSS();
+}
+
+
+void BasicTraceFormatter::formatLifelines(
+ OutStream & os, const TraceSequence & aTraceElt)
+{
+ RuntimeQuery RQuery( mTraceGenerator.getConfiguration() );
+
+ Vector< RuntimeID > lifelines;
+ RQuery.getSystemLifelines(lifelines);
+
+ Vector< RuntimeID >::iterator itLifelineRID = lifelines.begin();
+ Vector< RuntimeID >::iterator endLifeline = lifelines.end();
+ for( ; itLifelineRID != endLifeline ; ++itLifelineRID)
+ {
+ TraceSequence lifelineTrace(aTraceElement->mEC, 0);
+
+ if( aTraceElt.toLifeline(lifelineTrace, *itLifelineRID) > 0 )
+ {
+ formatLifelineID(os, *itLifelineRID, mLifelineHeaderPattern);
+ formatLifelineID(os, *itLifelineRID, mLifelineBeginPattern);
+
+ format(os, lifelineTrace);
+
+ formatLifelineID(os, *itLifelineRID, mLifelineEndPattern);
+ }
+ }
+}
+
+
+/**
+ * EXECUTION CONTEXT HEADER
+ * %1% --> ec#id
+ * %2% --> ec#eval
+ * %3% --> ec#hight
+ * %4% --> ec#width
+ * %5% --> ec#weight
+ * %6% --> statemachine configuration i.e. control node
+ */
+std::string BasicTraceFormatter::strFormatExecutionContextUfid(
+ const ExecutionContext & anEC)
+{
+ if( anEC.isnotNull() )
+ {
+ StringOutStream oss;
+
+ boost::format formatter(mExecutionContextUfidPattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ oss << formatter
+ % anEC.getIdNumber()
+ % anEC.getEvalNumber()
+ % anEC.getHeight()
+ % anEC.getWidth()
+ % anEC.getWeight()
+ % anEC.refExecutionData().strStateConf();
+
+ return( oss.str() );
+ }
+
+ return( "ctx<null>" );
+}
+
+
+void BasicTraceFormatter::formatTraceID(OutStream & os,
+ const TraceSequence & aTraceElt, const std::string & pattern)
+{
+ boost::format formatter(pattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ os << formatter
+ % aTraceElt.tid
+ % strFormatExecutionContextUfid(
+ ExecutionContext::REF( aTraceElt.mEC ) )
+ << std::flush;
+}
+
+
+void BasicTraceFormatter::formatLifelineID(OutStream & os,
+ const RuntimeID & aLifeline, const std::string & pattern)
+{
+ boost::format formatter(pattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ os << formatter
+ % aLifeline.strPid()
+ % (aLifeline.hasParent() ? aLifeline.getParent().getNameID() : "")
+ % aLifeline.getNameID()
+ << std::flush;
+}
+
+
+void BasicTraceFormatter::formatString(OutStream & os,
+ const TracePoint & aTracePoint, const std::string & pattern)
+{
+ boost::format formatter(pattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ os << formatter
+ % ( aTracePoint.value.valid() ?
+ aTracePoint.value.as_ptr< String >()->getValue() : "" )
+ % strFormatExecutionContextUfid( aTracePoint.EC );
+}
+
+
+void BasicTraceFormatter::formatStep(OutStream & os,
+ const TracePoint & aTracePoint, const std::string & pattern)
+{
+ boost::format formatter(pattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ os << formatter
+ % ( aTracePoint.value.valid() ? aTracePoint.value.as_ptr<
+ String >()->getValue() : "" )
+ % strFormatExecutionContextUfid( aTracePoint.EC );
+}
+
+
+void BasicTraceFormatter::format(OutStream & os, const TraceSequence & aTraceElt)
+{
+ BFList::const_iterator it = aTraceElt.points.begin();
+ BFList::const_iterator endIt = aTraceElt.points.end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).is< TracePoint >() )
+ {
+ format(os, (*it).to_ref< TracePoint >());
+ }
+
+ else if( (*it).is< TraceSequence >() )
+ {
+ format(os, (*it).to_ref< TraceSequence >());
+ }
+ }
+}
+
+void BasicTraceFormatter::format(OutStream & os, const TracePoint & aTracePoint)
+{
+ switch( aTracePoint.nature )
+ {
+ case ENUM_TRACE_POINT::TRACE_COMMENT_NATURE:
+ {
+ formatString(os, aTracePoint, mCommentPattern);
+
+ break;
+ }
+ case ENUM_TRACE_POINT::TRACE_SEPARATOR_NATURE:
+ {
+ formatString(os, aTracePoint, mSeparatorPattern);
+
+ break;
+ }
+ case ENUM_TRACE_POINT::TRACE_NEWLINE_NATURE:
+ {
+ formatString(os, aTracePoint, mNewlinePattern);
+
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_STEP_HEADER_NATURE:
+ {
+ formatStep(os, aTracePoint, mStepHeaderPattern);
+
+ break;
+ }
+ case ENUM_TRACE_POINT::TRACE_STEP_BEGIN_NATURE:
+ {
+ formatStep(os, aTracePoint, mStepBeginPattern);
+
+ break;
+ }
+ case ENUM_TRACE_POINT::TRACE_STEP_END_NATURE:
+ {
+ formatStep(os, aTracePoint, mStepEndPattern);
+
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_INIT_HEADER_NATURE:
+ {
+ formatStep(os, aTracePoint, mInitializationHeaderPattern);
+
+ break;
+ }
+ case ENUM_TRACE_POINT::TRACE_INIT_BEGIN_NATURE:
+ {
+ formatStep(os, aTracePoint, mInitializationBeginPattern);
+
+ break;
+ }
+ case ENUM_TRACE_POINT::TRACE_INIT_END_NATURE:
+ {
+ formatStep(os, aTracePoint, mInitializationEndPattern);
+
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_PATH_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_PATH_CONDITION_NATURE_LEAF:
+ {
+ dotFormatCondition(os, mPathConditionPattern,
+ aTracePoint.value);
+
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_PATH_TIMED_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_PATH_TIMED_CONDITION_NATURE_LEAF:
+ {
+ dotFormatCondition(os, mPathTimedConditionPattern,
+ aTracePoint.value);
+
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_NODE_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_NODE_CONDITION_NATURE_LEAF:
+ {
+ dotFormatCondition(os, mNodeConditionPattern,
+ aTracePoint.value);
+
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_NODE_TIMED_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_NODE_TIMED_CONDITION_NATURE_LEAF:
+ {
+ dotFormatCondition(os, mNodeTimedConditionPattern,
+ aTracePoint.value);
+
+ break;
+ }
+
+ default:
+ {
+ switch( aTracePoint.op )
+ {
+ case AVM_OPCODE_TIMED_GUARD:
+ {
+ format(os, aTracePoint, mTimePattern);
+ break;
+ }
+
+ case AVM_OPCODE_ASSIGN:
+ {
+ wrap_format(os, aTracePoint, mAssignPattern);
+ break;
+ }
+
+ case AVM_OPCODE_ASSIGN_NEWFRESH:
+ {
+ format(os, aTracePoint, mNewfreshPattern);
+ break;
+ }
+
+ case AVM_OPCODE_INPUT:
+ {
+ formatIO(os, aTracePoint, mInputPattern);
+ break;
+ }
+ case AVM_OPCODE_INPUT_FROM:
+ {
+ formatIO(os, aTracePoint, mInputPattern);
+ break;
+ }
+ case AVM_OPCODE_INPUT_ENV:
+ {
+ formatIO(os, aTracePoint, mInputEnvPattern);
+ break;
+ }
+ case AVM_OPCODE_INPUT_RDV:
+ {
+ formatIO(os, aTracePoint, mInputRdvPattern);
+ break;
+ }
+
+ case AVM_OPCODE_OUTPUT:
+ {
+ formatIO(os, aTracePoint, mOutputPattern);
+ break;
+ }
+ case AVM_OPCODE_OUTPUT_TO:
+ {
+ formatIO(os, aTracePoint, mOutputPattern);
+ break;
+ }
+ case AVM_OPCODE_OUTPUT_ENV:
+ {
+ formatIO(os, aTracePoint, mOutputEnvPattern);
+ break;
+ }
+ case AVM_OPCODE_OUTPUT_RDV:
+ {
+ formatIO(os, aTracePoint, mOutputRdvPattern);
+ break;
+ }
+
+
+ case AVM_OPCODE_RUN:
+ {
+ format(os, aTracePoint, mMachinePattern);
+ break;
+ }
+
+ case AVM_OPCODE_INVOKE_TRANSITION:
+ {
+ format(os, aTracePoint, mTransitionPattern);
+ break;
+ }
+
+ case AVM_OPCODE_INVOKE_ROUTINE:
+ {
+ format(os, aTracePoint, mRoutinePattern);
+ break;
+ }
+
+ default:
+ {
+ switch( aTracePoint.nature )
+ {
+ case ENUM_TRACE_POINT::TRACE_MACHINE_NATURE:
+ case ENUM_TRACE_POINT::TRACE_STATEMACHINE_NATURE:
+ case ENUM_TRACE_POINT::TRACE_STATE_NATURE:
+ {
+ format(os, aTracePoint, mMachinePattern);
+
+ break;
+ }
+ case ENUM_TRACE_POINT::TRACE_TRANSITION_NATURE:
+ {
+ format(os, aTracePoint, mTransitionPattern);
+
+ break;
+ }
+ case ENUM_TRACE_POINT::TRACE_ROUTINE_NATURE:
+ {
+ format(os, aTracePoint, mRoutinePattern);
+
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_RUNNABLE_NATURE:
+ {
+ format(os, aTracePoint, mRunnablePattern);
+
+ break;
+ }
+
+ default:
+ {
+ aTracePoint.toStream(os);
+
+ break;
+ }
+ }
+
+ break;
+ }
+ }
+ break;
+ }
+ }
+}
+
+
+void BasicTraceFormatter::format(OutStream & os,
+ const TracePoint & aTracePoint, const std::string & pattern)
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( aTracePoint.machine )
+ << "TracePoint::machine !!!"
+ << SEND_EXIT;
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( aTracePoint.object )
+ << "TracePoint::object !!!"
+ << SEND_EXIT;
+
+ boost::format formatter(pattern);
+ formatter.exceptions( boost::io::no_error_bits );
+// formatter.exceptions( boost::io::all_error_bits ^
+// ( boost::io::too_many_args_bit | boost::io::too_few_args_bit ) );
+
+ ossValue.str("");
+ ossValue.setSymbexValueCSS(mMultiValueArrayCSS,
+ mMultiValueParamsCSS, mMultiValueStructCSS);
+
+ aTracePoint.formatValueStream( ossValue );
+
+ os << formatter
+ % (aTracePoint.RID.valid() ? aTracePoint.RID.strPid() : "<pid#?>")
+ % aTracePoint.machine->getNameID()
+ % aTracePoint.object->getNameID()
+ % ossValue.str();
+
+AVM_IF_DEBUG_LEVEL_FLAG2_AND( MEDIUM , PROCESSOR , TRACE ,
+ aTracePoint.EC.isnotNull() )
+
+ os << " ==> " << AVM_SPC_INDENT;
+ aTracePoint.EC.traceMinimum(os);
+ os << END_INDENT;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2_AND( MEDIUM , PROCESSOR , TRACE )
+
+ os << std::flush;
+}
+
+
+/**
+ * INPUT / OUTPUT
+ * %1% --> machine runtime pid
+ * %2% --> machine container identifier
+ * %3% --> ( port | signal ) identifier
+ * %4% --> value
+ * %5% --> machine sender identifier name
+ * %6% --> machine receiver identifier name
+ */
+static std::string formatLifelineId(
+ const RuntimeID & aLifeline, const std::string & pattern)
+{
+ if( aLifeline.valid() )
+ {
+ StringOutStream oss;
+
+ boost::format formatter(pattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ oss << formatter
+ % aLifeline.strPid()
+ % (aLifeline.hasParent() ?
+ aLifeline.getParent().getNameID() : "")
+ % aLifeline.getNameID()
+ << std::flush;
+
+ return( oss.str() );
+ }
+ else
+ {
+ return( RuntimeLib::RID_ENVIRONMENT.getNameID() );
+ }
+}
+
+void BasicTraceFormatter::formatIO(OutStream & os,
+ const TracePoint & aTracePoint, const std::string & pattern)
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( aTracePoint.machine )
+ << "TracePoint::machine !!!"
+ << SEND_EXIT;
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( aTracePoint.object )
+ << "TracePoint::object !!!"
+ << SEND_EXIT;
+
+ boost::format formatter(pattern);
+ formatter.exceptions( boost::io::no_error_bits );
+// formatter.exceptions( boost::io::all_error_bits ^
+// ( boost::io::too_many_args_bit | boost::io::too_few_args_bit ) );
+
+ ossValue.str("");
+ ossValue.setSymbexValueCSS(mMultiValueArrayCSS,
+ mMultiValueParamsCSS, mMultiValueStructCSS);
+
+ aTracePoint.formatValueStream( ossValue );
+
+ std::string sender;
+ std::string receiver;
+ if( (aTracePoint.config != NULL)
+ && aTracePoint.config->hasIOMessage() )
+ {
+ const Message ioMessage = aTracePoint.config->getIOMessage();
+ if( ioMessage.hasSenderRID() )
+ {
+ sender = formatLifelineId(
+ ioMessage.getSenderRID().getLifeline(),
+ mLifelineIdPattern);
+ }
+ if( ioMessage.hasReceiverRID() )
+ {
+ receiver = formatLifelineId(
+ ioMessage.getReceiverRID().getLifeline(),
+ mLifelineIdPattern);
+ }
+ }
+
+ os << formatter
+ % (aTracePoint.RID.valid() ? aTracePoint.RID.strPid() : "<pid#?>")
+ % aTracePoint.machine->getNameID()
+ % aTracePoint.object->getNameID()
+ % ossValue.str()
+ % sender
+ % receiver;
+
+AVM_IF_DEBUG_LEVEL_FLAG2_AND( MEDIUM , PROCESSOR , TRACE ,
+ aTracePoint.EC.isnotNull() )
+
+ os << " ==> " << AVM_SPC_INDENT;
+ aTracePoint.EC.traceMinimum(os);
+ os << END_INDENT;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2_AND( MEDIUM , PROCESSOR , TRACE )
+
+ os << std::flush;
+}
+
+
+void BasicTraceFormatter::wrap_format(OutStream & os,
+ const TracePoint & aTracePoint, const std::string & pattern)
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( aTracePoint.machine )
+ << "TracePoint::machine !!!"
+ << SEND_EXIT;
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( aTracePoint.object )
+ << "TracePoint::object !!!"
+ << SEND_EXIT;
+
+ OSS oss( AVM_STR_INDENT );
+ aTracePoint.formatValueStream( oss << IGNORE_FIRST_TAB );
+
+ boost::format formatter(pattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ os << mWrapData << formatter
+ % (aTracePoint.RID.valid() ? aTracePoint.RID.strPid() : "<pid#?>")
+ % aTracePoint.machine->getNameID()
+ % aTracePoint.object->getNameID()
+ % oss.str();
+
+ os << END_WRAP;
+
+AVM_IF_DEBUG_LEVEL_FLAG2_AND( MEDIUM , PROCESSOR , TRACE ,
+ aTracePoint.EC.isnotNull() )
+
+ os << " ==> " << AVM_SPC_INDENT;
+ aTracePoint.EC.traceMinimum(os);
+ os << END_INDENT;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2_AND( MEDIUM , PROCESSOR , TRACE )
+
+ os << std::flush;
+}
+
+
+/**
+ * DATA
+ * [ Timed ] Path Condition
+ * Assignment: var = value
+ */
+void BasicTraceFormatter::dotFormatCondition(OutStream & os,
+ const std::string & formatPattern, const BF & aCode)
+{
+ boost::format formatter(formatPattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ os << mWrapData << formatter % aCode.str();
+
+ os << END_WRAP;
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/trace/BasicTraceFormatter.h b/org.eclipse.efm.symbex/src/fam/trace/BasicTraceFormatter.h
new file mode 100644
index 0000000..66c56f0
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/trace/BasicTraceFormatter.h
@@ -0,0 +1,261 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 11 déc. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BASICTRACEFORMATTER_H_
+#define BASICTRACEFORMATTER_H_
+
+#include "AbstractTraceFormatter.h"
+
+
+namespace sep
+{
+
+
+class AvmTraceGenerator;
+class BF;
+class ExecutionContext;
+class RuntimeID;
+class TraceManager;
+class TracePoint;
+class TraceSequence;
+class WObject;
+
+
+class BasicTraceFormatter : public AbstractTraceFormatter
+{
+
+protected:
+ /**
+ * CONSTANTS
+ */
+ static const std::string & DEFAULT_ASSIGN_PATTERN;
+
+ static const std::string & DEFAULT_NEWFRESH_PATTERN;
+
+ static const std::string & DEFAULT_INPUT_PATTERN;
+ static const std::string & DEFAULT_OUTPUT_PATTERN;
+
+ static const std::string & DEFAULT_INPUT_ENV_PATTERN;
+ static const std::string & DEFAULT_OUTPUT_ENV_PATTERN;
+
+ static const std::string & DEFAULT_INPUT_RDV_PATTERN;
+ static const std::string & DEFAULT_OUTPUT_RDV_PATTERN;
+
+ static const std::string & DEFAULT_MACHINE_PATTERN;
+
+ static const std::string & DEFAULT_TRANSITION_PATTERN;
+
+ static const std::string & DEFAULT_ROUTINE_PATTERN;
+
+
+ /**
+ * ATTRIBUTES
+ */
+ std::string mFileHeaderPattern;
+ std::string mFileBeginPattern;
+ std::string mFileEndPattern;
+
+ std::string mExecutionContextUfidPattern;
+
+ std::string mTestcaseHeaderPattern;
+ std::string mTestcaseBeginPattern;
+ std::string mTestcaseEndPattern;
+
+ std::string mLifelineHeaderPattern;
+ std::string mLifelineBeginPattern;
+ std::string mLifelineEndPattern;
+
+ std::string mLifelineIdPattern;
+
+ std::string mInitializationHeaderPattern;
+ std::string mInitializationBeginPattern;
+ std::string mInitializationEndPattern;
+
+ std::string mStepHeaderPattern;
+ std::string mStepBeginPattern;
+ std::string mStepEndPattern;
+
+ std::string mCommentPattern;
+ std::string mSeparatorPattern;
+ std::string mNewlinePattern;
+
+ std::string mPathConditionPattern;
+ std::string mPathTimedConditionPattern;
+
+ std::string mNodeConditionPattern;
+ std::string mNodeTimedConditionPattern;
+
+ std::string mTimePattern;
+
+ std::string mAssignPattern;
+
+ std::string mNewfreshPattern;
+
+ std::string mInputPattern;
+ std::string mOutputPattern;
+
+ std::string mInputEnvPattern;
+ std::string mOutputEnvPattern;
+
+ std::string mInputRdvPattern;
+ std::string mOutputRdvPattern;
+
+ std::string mMachinePattern;
+ std::string mTransitionPattern;
+ std::string mRoutinePattern;
+
+ std::string mRunnablePattern;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing Variables
+ TraceSequence * aTraceElement;
+ StringOutStream ossValue;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BasicTraceFormatter(AvmTraceGenerator & aTraceGenerator)
+ : AbstractTraceFormatter( aTraceGenerator ),
+ mFileHeaderPattern( "" ),
+ mFileBeginPattern( "" ),
+ mFileEndPattern( "" ),
+
+ mExecutionContextUfidPattern( "ctx< %1% > %6%" ),
+
+ mTestcaseHeaderPattern( "TRACE NUMBER %1%\n" ),
+ mTestcaseBeginPattern( "" ),
+ mTestcaseEndPattern( "\n" ),
+
+ mLifelineHeaderPattern( "LIFELINE %3% {\n" ),
+ mLifelineBeginPattern( "" ),
+ mLifelineEndPattern( "} // end lifeline %3%\n" ),
+
+ mLifelineIdPattern( "%3%" ),
+
+ mInitializationHeaderPattern( "\t// Initialization parameter values:\n" ),
+ mInitializationBeginPattern( "" ),
+ mInitializationEndPattern( "\n" ),
+
+ mStepHeaderPattern( "#step#header %1%\n" ),
+ mStepBeginPattern ( "#step#begin %1%\n" ),
+ mStepEndPattern ( "#step#end %1%\n" ),
+
+ mCommentPattern ( "// %1%\n" ),
+ mSeparatorPattern( "%1%" ),
+ mNewlinePattern ( "\n%1%" ),
+
+ mPathConditionPattern( /*"PC: %1%"*/ ),
+ mPathTimedConditionPattern( /*"PtC: %1%"*/ ),
+
+ mNodeConditionPattern( /*"NC: %1%"*/ ),
+ mNodeTimedConditionPattern( /*"NtC: %1%"*/ ),
+
+ mTimePattern( "\t%3%\n" ),
+
+ mAssignPattern( DEFAULT_ASSIGN_PATTERN ),
+
+ mNewfreshPattern( DEFAULT_NEWFRESH_PATTERN ),
+
+ mInputPattern ( DEFAULT_INPUT_PATTERN ),
+ mOutputPattern( DEFAULT_OUTPUT_PATTERN ),
+
+ mInputEnvPattern ( DEFAULT_INPUT_ENV_PATTERN ),
+ mOutputEnvPattern( DEFAULT_OUTPUT_ENV_PATTERN ),
+
+ mInputRdvPattern ( DEFAULT_INPUT_RDV_PATTERN ),
+ mOutputRdvPattern( DEFAULT_OUTPUT_RDV_PATTERN ),
+
+ mMachinePattern ( "\trun %1%\n" ),
+ mTransitionPattern( "\tfire %1%->%2%\n" ),
+ mRoutinePattern ( "\teval %1%->%2%\n" ),
+
+ mRunnablePattern ( "\trun %1%->%2%\n" ),
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing Variables
+ aTraceElement( NULL ),
+ ossValue( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BasicTraceFormatter()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool configure(WObject * FORMAT, std::string & formatPattern,
+ const std::string & id, bool isRegex = false);
+
+ bool configureImpl(WObject * wfParameterObject);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FORMAT API
+ ////////////////////////////////////////////////////////////////////////////
+
+ void format(TraceManager & aTraceManager);
+
+ void format(OutStream & os, TraceManager & aTraceManager);
+
+ void formatLifelines(OutStream & os, const TraceSequence & aTraceElt);
+
+ std::string strFormatExecutionContextUfid(const ExecutionContext & anEC);
+
+ void formatTraceID(OutStream & os, const TraceSequence & aTraceElt,
+ const std::string & pattern);
+
+ void formatLifelineID(OutStream & os, const RuntimeID & aLifeline,
+ const std::string & pattern);
+
+ void formatString(OutStream & os, const TracePoint & aTracePoint,
+ const std::string & pattern);
+
+ void formatStep(OutStream & os, const TracePoint & aTracePoint,
+ const std::string & pattern);
+
+ void format(OutStream & os, const TraceSequence & aTraceElt);
+
+ void format(OutStream & os, const TracePoint & aTracePoint);
+
+ void format(OutStream & os, const TracePoint & aTracePoint,
+ const std::string & pattern);
+
+ void formatIO(OutStream & os, const TracePoint & aTracePoint,
+ const std::string & pattern);
+
+ void wrap_format(OutStream & os, const TracePoint & aTracePoint,
+ const std::string & pattern);
+
+ void dotFormatCondition(OutStream & os,
+ const std::string & formatPattern, const BF & aCode);
+
+};
+
+
+} /* namespace sep */
+
+#endif /* BASICTRACEFORMATTER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/trace/TTCNTitanTraceFormatter.cpp b/org.eclipse.efm.symbex/src/fam/trace/TTCNTitanTraceFormatter.cpp
new file mode 100644
index 0000000..3e809b2
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/trace/TTCNTitanTraceFormatter.cpp
@@ -0,0 +1,1342 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 6 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "TTCNTitanTraceFormatter.h"
+
+#include "TraceManager.h"
+
+#include <common/SerializerFeature.h>
+
+#include <fam/trace/AvmTraceGenerator.h>
+
+#include <fml/common/ModifierElement.h>
+
+#include <fml/executable/AvmProgram.h>
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/ExecutableSystem.h>
+#include <fml/executable/InstanceOfPort.h>
+
+#include <fml/expression/ExpressionTypeChecker.h>
+
+#include <fml/symbol/TableOfSymbol.h>
+
+#include <fml/runtime/ExecutionData.h>
+
+#include <fml/trace/TracePoint.h>
+#include <fml/trace/TraceSequence.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+#include <fml/type/ClassTypeSpecifier.h>
+#include <fml/type/ContainerTypeSpecifier.h>
+#include <fml/type/EnumTypeSpecifier.h>
+#include <fml/type/IntervalTypeSpecifier.h>
+#include <fml/type/TypeAliasSpecifier.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <sew/Configuration.h>
+
+#include <boost/format.hpp>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTANTS
+ * DEFAULT PROFILE
+ */
+const std::string & TTCNTitanTraceFormatter::DEFAULT_ENVIRONMENT_CHANNEL = "cEnv";
+
+
+const std::string & TTCNTitanTraceFormatter::DEFAULT_TESTCASES_STARTING_WRAPPER
+ = "\t\tf_start();";
+
+const std::string & TTCNTitanTraceFormatter::DEFAULT_TESTCASES_ENDING_WRAPPER
+ = "\t\tf_end();";
+
+
+const std::string & TTCNTitanTraceFormatter::DEFAULT_TESTCASES_STARTING_ENDING_IMPL =
+// %1% --> <system identifier>
+ "\tfunction f_start() runs on runsOn_%1% { }\n"
+ "\tfunction f_end() runs on runsOn_%1% { }";
+
+
+const std::string & TTCNTitanTraceFormatter::DEFAULT_TESTCASES_SENDING_WRAPPER
+// %1% --> <system identifier>
+// %2% --> <environment channel> | <(system|environment) port>
+// %3% --> <template port as type>
+// %4% --> <template port identifier>
+ = "\t\t%2%_send_%3%( %4% )";
+
+const std::string & TTCNTitanTraceFormatter::DEFAULT_TESTCASES_RECEIVING_WRAPPER
+// %1% --> <system identifier>
+// %2% --> <environment channel> | <(system|environment) port>
+// %3% --> <template port as type>
+// %4% --> <template port identifier>
+ = "\t\t%2%_receive_%3%( %4% )";
+
+
+const std::string & TTCNTitanTraceFormatter::DEFAULT_TESTCASES_SENDING_IMPL =
+// %1% --> <system identifier>
+// %2% --> <environment channel> | <(system|environment) port>
+// %3% --> <template port as type>
+// %4% --> <template port identifier>
+ "\tfunction %2%_send_%3%( template %3% pdu ) runs on runsOn_%1% {\n"
+ "\t%2%.send( %3% )\n"
+ "\t}";
+
+const std::string & TTCNTitanTraceFormatter::DEFAULT_TESTCASES_RECEIVING_IMPL =
+// %1% --> <system identifier>
+// %2% --> <environment channel> | <(system|environment) port>
+// %3% --> <template port as type>
+// %4% --> <template port identifier>
+ "\tfunction %2%_receive_%3%( template %3% pdu ) runs on runsOn_%1% {\n"
+ "\t\t%2%.receive( %3% )\n"
+ "\t}";
+
+
+const std::string & TTCNTitanTraceFormatter::DEFAULT_ADAPTATION_UTILS_IMPL =
+ "\t// A testcase could just call the function below, "
+ "when it needs to wait for a timeout.\n"
+ "\t// In case the user wants he can activated "
+ "altsteps in 'f_start()' to catch events \n"
+ "\t// during this time period"
+
+ "\tfunction f_waitForTimeout(float p_duration) {\n"
+ "\t\ttimer t;\n"
+ "\t\tt.start(p_duration);\n"
+ "\t\tt.timeout;\n"
+ "\t}";
+
+
+/*
+prototype process::trace_generator as &avm::processor.TRACE_GENERATOR is
+ section REPORT
+ ...
+endsection REPORT
+
+ section PROPERTY
+ // 'OMEGA' | 'CVC4' | 'Z3' | 'YICES'
+ @solver = 'Z3';
+
+ // 'BASIC' | 'TTCN' | 'TTCN#SDL' | 'TTCN#XLIA'
+ @format = 'BASIC';
+ endsection PROPERTY
+
+ section TRACE
+ ...
+ endsection FORMAT
+endprototype
+*/
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+
+bool TTCNTitanTraceFormatter::configureImpl(WObject * wfParameterObject)
+{
+ WObject * thePROPERTY = Query::getRegexWSequence(
+ wfParameterObject, OR_WID2("property", "PROPERTY"));
+
+ if( thePROPERTY == WObject::_NULL_ )
+ {
+ return false;
+ }
+
+ std::size_t error = 0;
+
+ std::string format =
+ Query::getWPropertyString(thePROPERTY, "format", "TTCN#SDL");
+
+ WObject * theFORMAT = Query::getWSequenceOrElse(
+ wfParameterObject, "interface", "format");
+
+ if( theFORMAT != WObject::_NULL_ )
+ {
+ mControlModuleName = Query::getRegexWPropertyString(theFORMAT,
+ CONS_WID3("control", "module", "name"),
+ "TTCN_ControlPart");
+
+ mDeclarationsModuleName = Query::getRegexWPropertyString(theFORMAT,
+ CONS_WID3("declarations", "module", "name"),
+ "TTCN_Declarations");
+
+ mTemplatesModuleName = Query::getRegexWPropertyString(theFORMAT,
+ CONS_WID3("templates", "module", "name"),
+ "TTCN_Templates");
+
+ mTestcasesModuleName = Query::getRegexWPropertyString(theFORMAT,
+ CONS_WID3("testcases", "module", "name"),
+ "TTCN_TestsAndControl");
+ }
+
+ WObject * theWRAPPER = Query::getWSequence(wfParameterObject, "wrapper");
+
+ if( theWRAPPER != WObject::_NULL_ )
+ {
+ error += configureFormatter(
+ theWRAPPER, mTestcasesStartingWrapper,
+ CONS_WID2("testcases", "starting"), true ) ? 0 : 1;
+
+ error += configureFormatter(
+ theWRAPPER, mTestcasesEndingWrapper,
+ CONS_WID2("testcases", "ending"), true ) ? 0 : 1;
+
+
+ error += configureFormatter(
+ theWRAPPER, mTestcasesSendingWrapper,
+ CONS_WID2("testcases", "sending"), true ) ? 0 : 1;
+
+ error += configureFormatter(
+ theWRAPPER, mTestcasesReceivingWrapper,
+ CONS_WID2("testcases", "receiving"), true ) ? 0 : 1;
+ }
+
+
+ WObject * theIMPLEMENTATION = Query::getWSequence(
+ wfParameterObject, "implementation");
+ if( theIMPLEMENTATION != WObject::_NULL_ )
+ {
+ error += configureFormatter(
+ theIMPLEMENTATION, mAdaptationStartingEndingImpl,
+ CONS_WID2("adaptation#starting", "ending"), true ) ? 0 : 1;
+
+
+ error += configureFormatter(
+ theIMPLEMENTATION, mAdaptationSendingImpl,
+ CONS_WID2("adaptation", "sending"), true ) ? 0 : 1;
+
+ error += configureFormatter(
+ theIMPLEMENTATION, mAdaptationReceivingImpl,
+ CONS_WID2("adaptation", "receiving"), true ) ? 0 : 1;
+
+ error += configureFormatter(
+ theIMPLEMENTATION, mAdaptationUtilsImpl,
+ CONS_WID2("adaptation", "utils"), true ) ? 0 : 1;
+ }
+
+ return( error == 0 );
+}
+
+bool TTCNTitanTraceFormatter::configureFormatter(WObject * FORMAT,
+ std::string & formatPattern, const std::string & id, bool isRegex)
+{
+ formatPattern = isRegex
+ ? Query::getRegexWPropertyString(FORMAT, id, formatPattern)
+ : Query::getWPropertyString(FORMAT, id, formatPattern);
+
+ StringTools::replaceAll(formatPattern, "\\t" , "\t");
+ StringTools::replaceAll(formatPattern, "\\n" , "\n");
+ StringTools::replaceAll(formatPattern, "\\\"", "\"");
+
+ try
+ {
+ boost::format formatter(formatPattern);
+ }
+ catch(const boost::io::bad_format_string & bfs)
+ {
+ Query::reportErrorAttribute(FORMAT, id, bfs.what());
+
+ return( false );
+ }
+
+ return( true );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// FORMAT API
+////////////////////////////////////////////////////////////////////////////////
+
+void TTCNTitanTraceFormatter::format(TraceManager & aTraceManager)
+{
+ format_impl(aTraceManager);
+
+ // Generation des fichiers TTCN_
+ //
+ std::string TTCN_folder = mTraceGenerator.getLastFolder().location;
+ std::ios_base::openmode theOpenMode = std::ios_base::out;
+
+ std::ostringstream ossScenarioFileURL;
+ std::string filename;
+
+ filename = mDeclarationsModuleName;
+ if( filename.empty() )
+ {
+ filename = "TTCN_Declarations";
+ }
+ ossScenarioFileURL << TTCN_folder << "/" << filename << ".ttcn3";
+ std::ofstream declStream(ossScenarioFileURL.str().c_str(), theOpenMode);
+ if ( declStream.is_open() )
+ {
+ declStream << module_TTCN_Declarations.str() << std::endl << std::endl;
+ declStream.close();
+ }
+
+ filename = mTemplatesModuleName;
+ if( filename.empty() )
+ {
+ filename = "TTCN_Templates";
+ }
+ ossScenarioFileURL.str("");
+ ossScenarioFileURL << TTCN_folder << "/" << filename << ".ttcn3";
+ std::ofstream templStream(ossScenarioFileURL.str().c_str(), theOpenMode);
+ if ( templStream.is_open() )
+ {
+ templStream << module_TTCN_Templates.str() << std::endl << std::endl;
+ templStream.close();
+ }
+
+ filename = mAdaptationModuleName;
+ if( filename.empty() )
+ {
+ filename = "TTCN_Adaptation";
+ }
+ ossScenarioFileURL.str("");
+ ossScenarioFileURL << TTCN_folder << "/" << filename << ".ttcn3";
+ std::ofstream adaptStream(ossScenarioFileURL.str().c_str(), theOpenMode);
+ if ( adaptStream.is_open() )
+ {
+ adaptStream << module_TTCN_Adaptation.str() << std::endl << std::endl;
+ adaptStream.close();
+ }
+
+ filename = mTestcasesModuleName;
+ if( filename.empty() )
+ {
+ filename = "TTCN_TestsAndControl";
+ }
+ ossScenarioFileURL.str("");
+ ossScenarioFileURL << TTCN_folder << "/" << filename << ".ttcn3";
+ std::ofstream testStream(ossScenarioFileURL.str().c_str(), theOpenMode);
+ if ( testStream.is_open() )
+ {
+ testStream << module_TTCN_TestsAndControl.str() << std::endl << std::endl;
+ testStream.close();
+ }
+
+ filename = mControlModuleName;
+ if( filename.empty() )
+ {
+ filename = "TTCN_ControlPart";
+ }
+ ossScenarioFileURL.str("");
+ ossScenarioFileURL << TTCN_folder << "/" << filename << ".ttcn3";
+ std::ofstream ctrlStream(ossScenarioFileURL.str().c_str(), theOpenMode);
+ if ( ctrlStream.is_open() )
+ {
+ ctrlStream << module_TTCN_ControlPart.str() << std::endl << std::endl;
+ ctrlStream.close();
+ }
+
+ // Affichage des resultats dans le fichier ttcn/trace
+ //
+ ossScenarioFileURL.str("");
+ ossScenarioFileURL << TTCN_folder << "/TTCN_global.ttcn3";
+ std::ofstream fileStream(ossScenarioFileURL.str().c_str(), theOpenMode);
+ if ( fileStream.is_open() )
+ {
+ fileStream << "****************************************************" << std::endl;
+ fileStream << " module_TTCN_Declarations " << std::endl;
+ fileStream << "****************************************************" << std::endl;
+ fileStream << module_TTCN_Declarations.str() << std::endl << std::endl;
+
+ fileStream << "****************************************************" << std::endl;
+ fileStream << " module_TTCN_Templates " << std::endl;
+ fileStream << "****************************************************" << std::endl;
+ fileStream << module_TTCN_Templates.str() << std::endl << std::endl;
+
+ fileStream << "****************************************************" << std::endl;
+ fileStream << " module_TTCN_Adaptation " << std::endl;
+ fileStream << "****************************************************" << std::endl;
+ fileStream << module_TTCN_Adaptation.str() << std::endl << std::endl;
+
+ fileStream << "****************************************************" << std::endl;
+ fileStream << " module_TTCN_TestsAndControl " << std::endl;
+ fileStream << "****************************************************" << std::endl;
+ fileStream << module_TTCN_TestsAndControl.str() << std::endl << std::endl;
+
+ fileStream << "****************************************************" << std::endl;
+ fileStream << " module_TTCN_ControlPart " << std::endl;
+ fileStream << "****************************************************" << std::endl;
+ fileStream << module_TTCN_ControlPart.str() << std::endl << std::endl;
+ fileStream.close();
+ }
+
+ mTraceGenerator.beginStream();
+ while( mTraceGenerator.hasStream() )
+ {
+ OutStream & os = mTraceGenerator.currentStream();
+
+AVM_IF_DEBUG_FLAG( PROCESSOR )
+ aTraceManager.toStream( os );
+AVM_ENDIF_DEBUG_FLAG( PROCESSOR )
+
+ os << "****************************************************" << std::endl;
+ os << " module_TTCN_Declarations " << std::endl;
+ os << "****************************************************" << std::endl;
+ os << module_TTCN_Declarations.str() << std::endl << std::endl;
+
+ os << "****************************************************" << std::endl;
+ os << " module_TTCN_Templates " << std::endl;
+ os << "****************************************************" << std::endl;
+ os << module_TTCN_Templates.str() << std::endl << std::endl;
+
+ os << "****************************************************" << std::endl;
+ os << " module_TTCN_Adaptation " << std::endl;
+ os << "****************************************************" << std::endl;
+ os << module_TTCN_Adaptation.str() << std::endl << std::endl;
+
+ os << "****************************************************" << std::endl;
+ os << " module_TTCN_TestsAndControl " << std::endl;
+ os << "****************************************************" << std::endl;
+ os << module_TTCN_TestsAndControl.str() << std::endl << std::endl;
+
+ os << "****************************************************" << std::endl;
+ os << " module_TTCN_ControlPart " << std::endl;
+ os << "****************************************************" << std::endl;
+ os << module_TTCN_ControlPart.str() << std::endl << std::endl;
+ }
+
+ mTraceGenerator.closeStream();
+}
+
+void TTCNTitanTraceFormatter::format_impl(TraceManager & aTraceManager)
+{
+ // Nom du system
+ systemName = mTraceGenerator.
+ getConfiguration().getExecutableSystem().getNameID();
+
+ // module TTCN_Declarations
+ //
+ formatHeader_TTCN_Declarations(module_TTCN_Declarations);
+
+ TraceManager::const_iterator it = aTraceManager.begin();
+ TraceManager::const_iterator endIt = aTraceManager.end();
+ for( ; it != endIt ; ++it )
+ {
+ aTraceElement = (*it);
+
+ format_TTCN_Declarations(aTraceElement);
+ }
+
+ format_TTCN_DeclarationsChannels();
+
+ formatEnd_TTCN_Declarations(module_TTCN_Declarations);
+
+ // module TTCN_Templates
+ // module TTCN_Adaptation
+ // module TTCN_TestsAndControl
+ // module TTCN_ControlPart
+ //
+ formatHeader_TTCN_Templates(module_TTCN_Templates);
+ formatHeader_TTCN_Adaptation(module_TTCN_Adaptation);
+ formatHeader_TTCN_TestsAndControl(module_TTCN_TestsAndControl);
+ formatHeader_TTCN_ControlPart(module_TTCN_ControlPart);
+
+ traceNumber = 1;
+ linkNumber = 0;
+ it = aTraceManager.begin();
+ endIt = aTraceManager.end();
+ for( ; it != endIt ; ++it )
+ {
+ formatHeader_TTCN_TestsAndControl_testcase(module_TTCN_TestsAndControl);
+
+ aTraceElement = (*it);
+
+ format_TTCN_Trace(aTraceElement);
+
+ formatEnd_TTCN_TestsAndControl_testcase(module_TTCN_TestsAndControl);
+
+ format_TTCN_ControlPart_execute(module_TTCN_ControlPart);
+
+ traceNumber ++;
+ linkNumber = 0;
+ }
+
+ formatEnd_TTCN_Templates(module_TTCN_Templates);
+ formatEnd_TTCN_Adaptation(module_TTCN_Adaptation);
+ formatEnd_TTCN_TestsAndControl(module_TTCN_TestsAndControl);
+ formatEnd_TTCN_ControlPart(module_TTCN_ControlPart);
+}
+
+void TTCNTitanTraceFormatter::formatHeader_TTCN_Declarations(std::ostream & os)
+{
+ os << "module " << mDeclarationsModuleName << " {" << std::endl;
+}
+
+void TTCNTitanTraceFormatter::formatEnd_TTCN_Declarations(std::ostream & os)
+{
+ if( not newTypesDeclaration.str().empty() )
+ {
+ os << "\t// New types declarations" << std::endl;
+ os << newTypesDeclaration.str();
+ }
+
+ os << "\t// Records declaration" << std::endl;
+ os << recordsDeclaration.str();
+
+ /*!! TODO code à supprimer après validation nouveau code pour les channels
+ os << "\t// Ports declaration" << std::endl;
+ os << "\ttype port port_cEnv message {" << std::endl;
+ os << portsDeclaration.str();
+ os << "\t}" << std::endl << std::endl;
+ */
+
+ if( not channelsDefinition.str().empty() )
+ {
+ os << "\t// Channels & ports declaration" << std::endl;
+ os << channelsDefinition.str();
+ }
+
+ // fin du module TTCN_Declarations
+ os << "}" << std::endl;
+}
+
+void TTCNTitanTraceFormatter::format_TTCN_Declarations(TraceSequence * aTraceElt)
+{
+ BFList::const_iterator it = aTraceElt->points.begin();
+ BFList::const_iterator endIt = aTraceElt->points.end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).is< TracePoint >() )
+ {
+ if( (*it).to_ptr< TracePoint >()->isVirtual() )
+ {
+ //!! NOTHING
+ }
+ else
+ {
+ format_TTCN_Declarations((*it).to_ptr< TracePoint >());
+ }
+ }
+
+ else if( (*it).is< TraceSequence >() )
+ {
+ format_TTCN_Declarations((*it).to_ptr< TraceSequence >());
+ }
+ }
+}
+
+void TTCNTitanTraceFormatter::format_TTCN_Declarations(TracePoint * aTracePoint)
+{
+ std::string paramName;
+ std::string paramType;
+
+// !!! Modif AFA - 23/05/2016 !!!
+// if( not listOfTreatedSignal.contains( aTracePoint->object ) )
+// {
+ if( not listOfTreatedSignalName.contains( aTracePoint->object->getNameID() ) )
+ {
+
+// listOfTreatedSignal.append( aTracePoint->object );
+ listOfTreatedSignalName.append( aTracePoint->object->getNameID() );
+
+ if( aTracePoint->object->is< InstanceOfPort >() )
+ {
+ InstanceOfPort * aPort = aTracePoint->object->to< InstanceOfPort >();
+
+ // Records declaration
+ //
+ ArrayOfBF::const_iterator it = aPort->getParameters().begin();
+ ArrayOfBF::const_iterator endIt = aPort->getParameters().end();
+
+ if( aPort->hasParameter() && it != endIt )
+ {
+ // signal avec au moins un paramètre à afficher
+ //
+ recordsDeclaration << "\ttype record "
+ << aTracePoint->object->getNameID() << " {";
+
+ std::string::size_type posOfDiese;
+
+ bool firstParameter = true;
+ for( ; it != endIt ; ++it )
+ {
+ recordsDeclaration << ( firstParameter ? "" : ",") << std::endl;
+
+ firstParameter = false;
+
+ // paramètre anonyme
+ if( (*it).is< BaseTypeSpecifier >() )
+ {
+ format_TTCN_Declarations(aTracePoint,
+ (*it).to_ptr< BaseTypeSpecifier >(), "unamed");
+
+ recordsDeclaration << "\t\t";
+ // le type
+ if( (*it).to_ptr< BaseTypeSpecifier >()->isTypedReal() )
+ {
+ recordsDeclaration << "float";
+ }
+ else
+ {
+ recordsDeclaration
+ << (*it).to_ptr< BaseTypeSpecifier >()->strT();
+ }
+ // le nom
+ recordsDeclaration << " " << "unamed";
+ }
+ // paramètre nommé
+ else if( (*it).is< InstanceOfData >() )
+ {
+ InstanceOfData * aParam = (*it).to_ptr< InstanceOfData >();
+
+ format_TTCN_Declarations(aTracePoint,
+ aParam->getTypeSpecifier(),
+ aParam->getTypeSpecifier()->strT());
+
+ recordsDeclaration << "\t\t";
+ // le type
+ if( aParam->getTypeSpecifier()->isTypedString() )
+ {
+ paramType = "charstring";
+ }
+ else if( aParam->getTypeSpecifier()->isTypedCharacter() )
+ {
+ paramType = "charstring";
+ }
+ else if( aParam->getTypeSpecifier()->isTypedReal())
+ {
+ paramType = "float";
+ }
+ else
+ {
+ paramType = aParam->getTypeSpecifier()->strT();
+ }
+
+ recordsDeclaration <<
+ ( aParam->getTypeSpecifier()->
+ hasTypePrimitive() ? "" : "TTCN_" )
+ << paramType;
+ // le nom
+ posOfDiese = aParam->getNameID().find_first_of('#');
+ if( (aParam->getNameID()[0] == '$')
+ || (aParam->getNameID()[0] == '#') )
+ {
+ paramName = aParam->getNameID().substr(1);
+ recordsDeclaration << " " << "param" << paramName;
+ }
+ else
+ {
+ recordsDeclaration << " " << aParam->getNameID();
+ }
+ }
+ // #bind expression parameter
+ else
+ {
+ }
+ }
+ recordsDeclaration << std::endl;
+ recordsDeclaration << "\t}" << std::endl << std::endl;
+ }
+ else
+ {
+ // signal sans paramètre à afficher
+ //
+ recordsDeclaration << "\ttype enumerated "
+ << aTracePoint->object->getNameID()
+ << " { e_" << aTracePoint->object->getNameID() << " }"
+ << std::endl << std::endl;
+ }
+
+
+/*
+ // Ports declaration
+ //
+ switch( aTracePoint->op )
+ {
+ case AVM_OPCODE_INPUT_ENV:
+ {
+ inoutSignalName = "out " + aTracePoint->object->getNameID();
+ break;
+ }
+
+ case AVM_OPCODE_OUTPUT_ENV:
+ {
+ inoutSignalName = "in " + aTracePoint->object->getNameID();
+ break;
+ }
+
+ default:
+ {
+ // Messsage erreur ???
+ break;
+ }
+ }
+*/
+
+ }
+ }
+
+
+ if( aTracePoint->object->is< InstanceOfPort >() )
+ {
+ InstanceOfPort * aPort = aTracePoint->object->to< InstanceOfPort >();
+ // Liste des channels associés aux signaux
+ if( aPort->hasRoutingChannel() )
+ {
+ std::string channelName = aPort->getRoutingChannel()->getNameID();
+ if( not ListOfChannelName.contains( channelName ) )
+ {
+ ListOfChannelName.append( channelName );
+ }
+ }
+ else
+ {
+//!![TRACE ] to delete
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+// AVM_OS_COUT << "Messsage erreur ??? : Signal non connecté : "
+// << str_header( aPort ) << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ }
+ }
+}
+
+void TTCNTitanTraceFormatter::format_TTCN_Declarations(TracePoint * aTracePoint,
+ BaseTypeSpecifier * aTS, std::string typeName)
+{
+ if( listOfTreatedType.contains( aTS ) )
+ {
+ return;
+ }
+
+ listOfTreatedType.append( aTS );
+
+ if( aTS->hasTypeContainer() )
+ {
+ ContainerTypeSpecifier * containerT = aTS->as< ContainerTypeSpecifier >();
+ avm_size_t sizeT = containerT->size();
+
+ switch( containerT->getTypeSpecifierKind() )
+ {
+ case TYPE_VECTOR_SPECIFIER:
+ case TYPE_REVERSE_VECTOR_SPECIFIER:
+ case TYPE_LIST_SPECIFIER:
+ case TYPE_SET_SPECIFIER:
+ case TYPE_MULTISET_SPECIFIER:
+ case TYPE_FIFO_SPECIFIER:
+ case TYPE_LIFO_SPECIFIER:
+ case TYPE_MULTI_FIFO_SPECIFIER:
+ case TYPE_MULTI_LIFO_SPECIFIER:
+ default:
+ {
+ format_TTCN_Declarations(aTracePoint,
+ containerT->getContentsTypeSpecifier(), typeName);
+
+ newTypesDeclaration << "\ttype "
+ << ( containerT->getContentsTypeSpecifier().
+ hasTypePrimitive() ? "" : "TTCN_" )
+ << containerT->getContentsTypeSpecifier().strT() << " "
+ << "TTCN_" << typeName << "[" << sizeT << "];"
+ << std::endl << std::endl;
+
+ break;
+ }
+ }
+ }
+
+ else if( aTS->isTypedClass() )
+ {
+ ClassTypeSpecifier * classType = aTS->as< ClassTypeSpecifier >();
+ avm_size_t sizeT = classType->size();
+
+ Symbol aField;
+
+ for( avm_size_t idx = 0 ; idx < sizeT ; ++idx )
+ {
+ aField = classType->getSymbolData(idx);
+
+ format_TTCN_Declarations(aTracePoint,
+ aField.getTypeSpecifier(),
+ aField.getTypeSpecifier()->strT());
+// aField.getTypeSpecifier()->getNameID());
+ }
+
+ // Type Structure/Record declaration
+ newTypesDeclaration << "\ttype record " << "TTCN_" << typeName << " {"
+ << std::endl;
+ for( avm_size_t idx = 0 ; idx < sizeT ; ++idx )
+ {
+ aField = classType->getSymbolData(idx);
+
+ newTypesDeclaration << "\t\t"
+ << ( aField.getTypeSpecifier()->hasTypePrimitive() ? "" : "TTCN_" )
+ << ( aField.getTypeSpecifier()->isTypedReal() ?
+ "float" : aField.getTypeSpecifier()->strT() )
+ << " " << aField.getNameID() << ((idx < (sizeT - 1)) ? "," : "")
+ << std::endl;
+ }
+ newTypesDeclaration << "\t}" << std::endl << std::endl;
+ }
+
+ else if( aTS->isTypedEnum() )
+ {
+ EnumTypeSpecifier * enumType = aTS->as< EnumTypeSpecifier >();
+
+ // Type enum declaration
+ newTypesDeclaration << "\ttype enumerated " << "TTCN_" << typeName
+ << " {" << std::endl;
+ newTypesDeclaration << "\t\t";
+
+ avm_size_t sizeT = enumType->getSymbolData().size();
+ for( avm_size_t idx = 0 ; idx < sizeT ; ++idx )
+ {
+ newTypesDeclaration << enumType->getSymbolData(idx).getNameID()
+ << ((idx < (sizeT - 1)) ? ", " : "\n");
+ }
+ newTypesDeclaration << "\t}" << std::endl << std::endl;
+ }
+
+ else if( aTS->isTypedInterval() )
+ {
+ IntervalTypeSpecifier * intervalTS = aTS->as< IntervalTypeSpecifier >();
+
+ newTypesDeclaration << "\ttype "
+ << ( intervalTS->getSupportTypeSpecifier().
+ hasTypePrimitive() ? "" : "TTCN_" )
+ << ( intervalTS->getSupportTypeSpecifier().isTypedReal() ?
+ "float" : intervalTS->getSupportTypeSpecifier().strT() )
+ << " TTCN_" << typeName
+ << " (" << intervalTS->getInfimum().str()
+ << " .. " << intervalTS->getSupremum().str()
+ << ");" << std::endl << std::endl;
+ }
+
+ else if( aTS->isTypedString() )
+ {
+ if( aTS->size() < AVM_NUMERIC_MAX_SIZE_T )
+ {
+ newTypesDeclaration << "\ttype charstring TTCN_" << typeName
+ << " length( " << aTS->getMinimumSize()
+ << " .. " << aTS->getMaximumSize() << " );"
+ << std::endl << std::endl;
+ }
+ }
+
+ else if( aTS->isTypedAlias() )
+ {
+ if( aTS->hasConstraint() )
+ {
+// format_TTCN_Declarations(aTracePoint,
+// aTS->as< TypeAliasSpecifier >()->targetTypeSpecifier(), typeName);
+
+ BaseTypeSpecifier * targetTS =
+ aTS->as< TypeAliasSpecifier >()->targetTypeSpecifier();
+
+ newTypesDeclaration << "\ttype "
+// << ( aTS->hasTypedPrimitive() ? "" : "TTCN_")
+ << targetTS->strT() << " " << "TTCN_" << typeName << "{ "
+ << aTS->getConstraint().as_ptr< AvmProgram >()->getCode().str()
+ << " };" << std::endl << std::endl;
+ }
+ else
+ {
+ format_TTCN_Declarations(aTracePoint,
+ aTS->as< TypeAliasSpecifier >()->targetTypeSpecifier(), typeName);
+ }
+ }
+
+ else if( aTS->weaklyTypedInteger() && (aTS->getBitSize() > 0) )
+ {
+ newTypesDeclaration << "\ttype integer" // << aTS->getNameID()
+ << " TTCN_" << typeName
+ << " (" << aTS->minIntegerValue()
+ << " .. " << aTS->maxIntegerValue()
+ << ");" << std::endl << std::endl;
+ }
+ else if( /*aTS->isTypedSimple() &&*/ aTS->hasConstraint() )
+ {
+ //!! TODO
+ newTypesDeclaration << "\ttype "
+ << /*( aTS->hasTypedPrimitive() ? "" : "TTCN_") <<*/ typeName
+ << " TTCN_" << aTS->strT() << "{ "
+ << aTS->getConstraint().as_ptr< AvmProgram >()->getCode().str()
+ << " };" << std::endl << std::endl;
+ }
+}
+
+
+void TTCNTitanTraceFormatter::format_TTCN_DeclarationsChannels()
+{
+ const ExecutableSystem & anExecutableSystem =
+ mTraceGenerator.getConfiguration().getExecutableSystem();
+
+ TableOfSymbol::const_iterator itChannel;
+ TableOfSymbol::const_iterator endChannel;
+
+ TableOfSymbol::const_iterator itPort;
+ TableOfSymbol::const_iterator endPort;
+
+ TableOfExecutableForm::const_raw_iterator itExec =
+ anExecutableSystem.getExecutables().begin();
+ TableOfExecutableForm::const_raw_iterator endExec =
+ anExecutableSystem.getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ itChannel = (itExec)->getChannel().begin();
+ endChannel = (itExec)->getChannel().end();
+ for( ; itChannel != endChannel ; ++itChannel )
+ {
+ channelsDefinition << "\ttype port port_" << (*itChannel).getNameID()
+ << " message {" << std::endl;
+
+ channelsDeclaration << "\t\tport port_" << (*itChannel).getNameID()
+ << " " << (*itChannel).getNameID() << ";" << std::endl;
+
+ itPort = (*itChannel).channel().getContents().begin();
+ endPort = (*itChannel).channel().getContents().end();
+ for( ; itPort != endPort ; ++itPort )
+ {
+// !!! Modif AFA - 23/05/2016 !!!
+// if( listOfTreatedSignal.contains( (*itPort).rawPort() ) )
+ if( listOfTreatedSignalName.contains(
+ (*itPort).rawPort()->getNameID() ) )
+ {
+ channelsDefinition << "\t\t"
+ << ( (*itPort).port().getModifier().isDirectionInput()
+ ? "out " : "in " )
+ << (*itPort).getNameID() << ";" << std::endl;
+ }
+ }
+ channelsDefinition << "\t}" << std::endl;
+ }
+ }
+}
+
+
+void TTCNTitanTraceFormatter::formatHeader_TTCN_Templates(std::ostream & os)
+{
+ os << "module " << mTemplatesModuleName << " {" << std::endl
+ << "\timport from " << mDeclarationsModuleName << " all;"
+ << std::endl << std::endl;
+}
+
+void TTCNTitanTraceFormatter::formatEnd_TTCN_Templates(std::ostream & os)
+{
+ os << ossTemplateList.str();
+
+ os << "}" << std::endl;
+}
+
+
+
+void TTCNTitanTraceFormatter::formatHeader_TTCN_Adaptation(std::ostream & os)
+{
+ os << "module " << mAdaptationModuleName << " {" << std::endl
+ << "\timport from " << mDeclarationsModuleName << " all;"
+ << std::endl << std::endl;
+}
+
+void TTCNTitanTraceFormatter::formatEnd_TTCN_Adaptation(std::ostream & os)
+{
+ os << "\t// Components declaration" << std::endl
+ << "\ttype component runsOn_" << systemName << " {" << std::endl
+ << channelsDeclaration.str()
+ << "\t}"
+ << std::endl
+ << "\ttype component " << systemName << " {" << std::endl
+ << channelsDeclaration.str()
+ << "\t}" << std::endl
+ << std::endl;
+
+
+ boost::format utilsFormatter( mAdaptationUtilsImpl);
+ utilsFormatter.exceptions( boost::io::no_error_bits );
+ os << "\t// Implementation of utility functions"
+ << std::endl
+ << utilsFormatter
+ % systemName
+ << std::endl << std::endl;
+
+ // Starting / Ending Testcases wrapper Implementation
+
+ boost::format startingEndingFormatter( mAdaptationStartingEndingImpl);
+ startingEndingFormatter.exceptions( boost::io::no_error_bits );
+ os << "\t// Implementation of testcases Starting / Ending wrappers"
+ << std::endl
+ << startingEndingFormatter
+ % systemName
+ << std::endl << std::endl;
+
+ os << "\t// Implementation of testcases Sending / Receiving wrappers"
+ << std::endl
+ << ossAdaptationList.str()
+ << std::endl;
+
+ os << "}" << std::endl;
+}
+
+
+
+void TTCNTitanTraceFormatter::formatHeader_TTCN_TestsAndControl(std::ostream & os)
+{
+ os << "module " << mTestcasesModuleName << " {" << std::endl << std::endl
+ << "\timport from " << mAdaptationModuleName << " all;" << std::endl
+// << "\timport from " << mDeclarationsModuleName << " all;" << std::endl
+ << "\timport from " << mTemplatesModuleName << " all;" << std::endl
+ << std::endl;
+}
+
+void TTCNTitanTraceFormatter::formatEnd_TTCN_TestsAndControl(std::ostream & os)
+{
+ os << "}" << std::endl;
+}
+
+void TTCNTitanTraceFormatter::formatHeader_TTCN_TestsAndControl_testcase(
+ std::ostream & os)
+{
+ int unsigned i;
+
+ boost::format startingFormatter( mTestcasesStartingWrapper);
+ startingFormatter.exceptions( boost::io::no_error_bits );
+
+ os << "\ttestcase TC_trace" << traceNumber << "() "
+ << "runs on runsOn_" << systemName << " system " << systemName << " {"
+ << std::endl
+ << mTestcasesStartingWrapper
+ << std::endl;
+
+ // Mapping of Channels
+ for(i = 0 ; i < ListOfChannelName.size() ; i++)
+ {
+ os << "\t\tmap(self:" << ListOfChannelName.get(i)
+ << ", system:" << ListOfChannelName.get(i) << ");" << std::endl;
+ }
+ ossTestcaseList.str("");
+}
+
+void TTCNTitanTraceFormatter::formatEnd_TTCN_TestsAndControl_testcase(
+ std::ostream & os)
+{
+ boost::format endingFormatter( mTestcasesEndingWrapper);
+ endingFormatter.exceptions( boost::io::no_error_bits );
+
+ os << ossTestcaseList.str()
+ << endingFormatter
+ << std::endl
+ << "\t}" << std::endl << std::endl;
+}
+
+void TTCNTitanTraceFormatter::formatHeader_TTCN_ControlPart(std::ostream & os)
+{
+ os << "module " << mControlModuleName << " {" << std::endl << std::endl
+ << "\timport from " << mTestcasesModuleName << " all;" << std::endl
+ << std::endl
+ << "\tcontrol {" << std::endl;
+}
+
+void TTCNTitanTraceFormatter::formatEnd_TTCN_ControlPart(std::ostream & os)
+{
+ os << "\t}" << std::endl
+ << "}" << std::endl;
+}
+
+void TTCNTitanTraceFormatter::format_TTCN_ControlPart_execute(std::ostream & os)
+{
+ os << "\t\texecute(TC_trace" << traceNumber << "());" << std::endl;
+}
+
+void TTCNTitanTraceFormatter::format_TTCN_Trace(TraceSequence * aTraceElt)
+{
+ BFList::const_iterator it = aTraceElt->points.begin();
+ BFList::const_iterator endIt = aTraceElt->points.end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).is< TracePoint >() )
+ {
+ if( (*it).to_ptr< TracePoint >()->isVirtual() )
+ {
+ //!! NOTHING
+ }
+ else
+ {
+ format_TTCN_Trace((*it).to_ptr< TracePoint >());
+ }
+ }
+
+ else if( (*it).is< TraceSequence >() )
+ {
+ format_TTCN_Trace((*it).to_ptr< TraceSequence >());
+ }
+ }
+}
+
+void TTCNTitanTraceFormatter::format_TTCN_Trace(TracePoint * aTracePoint)
+{
+ std::string template_TAB = "\t\t";
+ std::string template_incrTab = "\t";
+
+ if( aTracePoint->object->is< InstanceOfPort >() &&
+ ( ( aTracePoint->op == AVM_OPCODE_INPUT_ENV ) ||
+ ( aTracePoint->op == AVM_OPCODE_OUTPUT_ENV ) ) )
+ {
+ InstanceOfPort * aPort = aTracePoint->object->to< InstanceOfPort >();
+
+ std::ostringstream templateName;
+ templateName << aPort->getNameID()
+ << "_trace" << traceNumber
+ << "_LINK_" << linkNumber;
+
+ ArrayOfBF::const_iterator it = aPort->getParameters().begin();
+ ArrayOfBF::const_iterator endIt = aPort->getParameters().end();
+
+ if( aPort->hasParameter() && it != endIt )
+ {
+ // signal avec au moins un paramètre à afficher
+ //
+ ossTemplateList << "\ttemplate " << aPort->getNameID() << " ";
+ ossTemplateList << templateName.str() << " := {" << std::endl;
+
+ avm_size_t sizeT = aPort->getParameters().size() - 1;
+
+ for( avm_size_t offset = 0 ; it != endIt ; ++it , ++offset )
+ {
+ // paramètre anonyme
+ if( (*it).is< BaseTypeSpecifier >() )
+ {
+ // le nom
+ ossTemplateList << "\t\t" << "unamed";
+ // la valeur
+ ossTemplateList << " := " << aTracePoint->val(offset).str();
+ }
+ // paramètre nommé
+ else if( (*it).is< InstanceOfData >() )
+ {
+ InstanceOfData * aParam = (*it).to_ptr< InstanceOfData >();
+
+ format_TTCN_Templates(aTracePoint->val(offset),
+ aParam->getTypeSpecifier(), aParam->getNameID(),
+ offset, template_TAB, template_incrTab);
+ }
+ // #bind expression parameter
+ else
+ {
+ // Cf Arnault si cas erreur ???
+ }
+
+ ossTemplateList << ((offset+1 >= sizeT) ? "" : ",") << std::endl;
+ }
+ ossTemplateList << "\t}" << std::endl << std::endl;
+ }
+ else
+ {
+ // signal sans paramètre à afficher
+ //
+ ossTemplateList << "\ttemplate " << aPort->getNameID()
+ << " " << templateName.str() << " := ?;"
+ << std::endl << std::endl;
+ }
+
+ // TEST CASES
+ std::ostringstream ossActionName;
+
+ ossActionName << ( aPort->hasRoutingChannel() ?
+ aPort->getRoutingChannel()->getNameID() :
+ DEFAULT_ENVIRONMENT_CHANNEL )
+ << ( (aTracePoint->op == AVM_OPCODE_INPUT_ENV) ?
+ "_send_" : "_receive_" ) << aPort->getNameID();
+//
+// ossTestcaseList << "\t\t" << ossActionName.str()
+// << "(" << templateName.str() << ")" << std::endl;
+
+ boost::format wrapperFormatter(
+ (aTracePoint->op == AVM_OPCODE_INPUT_ENV) ?
+ mTestcasesSendingWrapper : mTestcasesReceivingWrapper);
+ wrapperFormatter.exceptions( boost::io::no_error_bits );
+
+ ossTestcaseList << wrapperFormatter
+ % systemName
+ % ( aPort->hasRoutingChannel() ?
+ aPort->getRoutingChannel()->getNameID() :
+ DEFAULT_ENVIRONMENT_CHANNEL )
+ % aPort->getNameID()
+ % templateName.str()
+ << std::endl;
+
+
+
+ if( not listOfAdaptationPortFunction.contains(ossActionName.str()) )
+ {
+ listOfAdaptationPortFunction.append( ossActionName.str() );
+
+ boost::format adaptationFormatter(
+ (aTracePoint->op == AVM_OPCODE_INPUT_ENV) ?
+ mAdaptationSendingImpl : mAdaptationReceivingImpl);
+ adaptationFormatter.exceptions( boost::io::no_error_bits );
+
+ ossAdaptationList << adaptationFormatter
+ % systemName
+ % ( aPort->hasRoutingChannel() ?
+ aPort->getRoutingChannel()->getNameID() :
+ DEFAULT_ENVIRONMENT_CHANNEL )
+ % aPort->getNameID()
+ % templateName.str()
+ << std::endl;
+ }
+
+ ++linkNumber;
+ }
+}
+
+void TTCNTitanTraceFormatter::format_TTCN_Templates(const BF & value,
+ BaseTypeSpecifier * aTS, std::string aParamName, avm_size_t anOffset,
+ const std::string & TAB, const std::string & CHAR)
+{
+ // Affichage de "nom := "
+ if( (aParamName[0] == '$') || (aParamName[0] == '#') )
+ {
+ std::string newParamName = aParamName.substr(1);
+ ossTemplateList << TAB << "param" << newParamName << " := " ;
+ }
+ else
+ {
+ ossTemplateList << TAB << aParamName << " := " ;
+ }
+
+ if( aTS->hasTypeContainer() )
+ {
+ ContainerTypeSpecifier * containerT = aTS->as< ContainerTypeSpecifier >();
+// avm_size_t sizeT = containerT->size();
+
+ switch( containerT->getTypeSpecifierKind() )
+ {
+ case TYPE_VECTOR_SPECIFIER:
+ case TYPE_REVERSE_VECTOR_SPECIFIER:
+ case TYPE_LIST_SPECIFIER:
+ case TYPE_SET_SPECIFIER:
+ case TYPE_FIFO_SPECIFIER:
+ case TYPE_LIFO_SPECIFIER:
+ case TYPE_MULTI_FIFO_SPECIFIER:
+ case TYPE_MULTI_LIFO_SPECIFIER:
+ default:
+ {
+ ossTemplateList << value.str();
+// if( not aTS->isTypedSimple() )
+// {
+// format_TTCN_Templates(aTracePoint,
+// containerT->getTypeSpecifier(), aParamName);
+// }
+ break;
+ }
+ }
+ }
+
+ else if( aTS->isTypedClass() )
+ {
+ ClassTypeSpecifier * classType = aTS->as< ClassTypeSpecifier >();
+ avm_size_t sizeT = classType->size();
+
+ Symbol aField;
+
+ ossTemplateList << "{" << std::endl;
+
+ for( avm_size_t idx = 0 ; idx < sizeT ; ++idx )
+ {
+ aField = classType->getSymbolData(idx);
+
+ format_TTCN_Templates(
+ value.to_ptr< ArrayBF >()->at( idx ),
+ aField.getTypeSpecifier(), aField.getNameID(),
+ idx, TAB + CHAR, CHAR);
+
+ ossTemplateList << (((idx+1) == sizeT) ? "" : ",") << std::endl;
+ }
+
+ ossTemplateList << TAB << "}";
+ }
+
+ else if( aTS->isTypedEnum() )
+ {
+ EnumTypeSpecifier * enumT = aTS->as< EnumTypeSpecifier >();
+
+ // Affichage de la valeur numérique
+ if( value.invalid() )
+ {
+ ossTemplateList << "NULL";
+ }
+ else if( value.is< ArrayBF >() )
+ {
+ ossTemplateList << "ARRAY<?>";
+ }
+ else if( value.is< InstanceOfData >() )
+ {
+ InstanceOfData * aSymbol = value.to_ptr< InstanceOfData >();
+
+ if( not enumT->hasSymbolData(aSymbol) )
+ {
+ AVM_OS_ERROR_ALERT
+ << "TTCNTitanTraceFormatter::format_TTCN_Templates"
+ << " :> Unexpected symbol\n<< " << str_header( aSymbol )
+ << " >>\nfor the enum type << "
+ << enumT->getFullyQualifiedNameID() << " >> !!!"
+ << SEND_ALERT;
+ }
+
+ ossTemplateList << aSymbol->getNameID();
+ }
+ else
+ {
+ const Symbol & aSymbol = enumT->getSymbolDataByValue(value);
+ if( aSymbol.valid() )
+ {
+ ossTemplateList << aSymbol.getNameID();
+ }
+ else
+ {
+ AVM_OS_ERROR_ALERT
+ << "TTCNTitanTraceFormatter::format_TTCN_Templates"
+ " :>\nUnexpected symbol value << "
+ << value.str() << " >> for the enum type << "
+ << enumT->getFullyQualifiedNameID()
+ << " >> for the parameter << param"
+ << aParamName << " >> !!!"
+ << SEND_ALERT;
+
+ ossTemplateList << enumT->getNameID()
+ << "[ " << value.str() << " ]";
+ }
+ }
+ }
+
+ else if( value.is< Character >() )
+ {
+ // On remplace 'x' par "x"
+ ossTemplateList << value.to_ptr< Character >()->strChar('"');
+ }
+ else //if( aTS->isTypedSimple() )
+ {
+ // Affichage de la valeur numérique
+ if( value.invalid() )
+ {
+ ossTemplateList << "NULL";
+ }
+ else if( value.is< ArrayBF >() )
+ {
+ ossTemplateList << value.to_ptr< ArrayBF >()->at( anOffset ).str();
+ }
+ else
+ {
+ ossTemplateList << value.str();
+ }
+ }
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/trace/TTCNTitanTraceFormatter.h b/org.eclipse.efm.symbex/src/fam/trace/TTCNTitanTraceFormatter.h
new file mode 100644
index 0000000..46f1073
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/trace/TTCNTitanTraceFormatter.h
@@ -0,0 +1,261 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 6 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef TTCNTITANTRACEFORMATTER_H_
+#define TTCNTITANTRACEFORMATTER_H_
+
+#include "AbstractTraceFormatter.h"
+
+#include <collection/List.h>
+
+
+namespace sep
+{
+
+
+class AvmTraceGenerator;
+
+class BF;
+class BaseTypeSpecifier;
+
+class ExecutionData;
+
+class TraceManager;
+class TracePoint;
+class TraceSequence;
+
+
+class TTCNTitanTraceFormatter : public AbstractTraceFormatter
+{
+
+protected:
+ /**
+ * CONSTANTS
+ * DEFAULT PROFILE
+ */
+ static const std::string & DEFAULT_ENVIRONMENT_CHANNEL;
+
+ static const std::string & DEFAULT_TESTCASES_STARTING_WRAPPER;
+
+ static const std::string & DEFAULT_TESTCASES_ENDING_WRAPPER;
+
+ static const std::string & DEFAULT_TESTCASES_STARTING_ENDING_IMPL;
+
+
+ static const std::string & DEFAULT_TESTCASES_SENDING_WRAPPER;
+
+ static const std::string & DEFAULT_TESTCASES_SENDING_IMPL;
+
+
+ static const std::string & DEFAULT_TESTCASES_RECEIVING_WRAPPER;
+
+ static const std::string & DEFAULT_TESTCASES_RECEIVING_IMPL;
+
+
+ static const std::string & DEFAULT_ADAPTATION_UTILS_IMPL;
+
+
+
+protected:
+ /**
+ * TYPEDEF
+ */
+ typedef List< BaseTypeSpecifier * > ListOfBaseTypeSpecifier;
+
+ typedef List< std::string > ListOfString;
+
+
+ /**
+ * ATTRIBUTES
+ */
+ TraceSequence * aTraceElement;
+ int traceNumber;
+ int linkNumber;
+
+ std::string systemName;
+
+ std::string mDeclarationsModuleName;
+ std::string mTemplatesModuleName;
+ std::string mAdaptationModuleName;
+ std::string mTestcasesModuleName;
+ std::string mControlModuleName;
+
+ std::string mTestcasesStartingWrapper;
+ std::string mTestcasesEndingWrapper;
+ std::string mTestcasesSendingWrapper;
+ std::string mTestcasesReceivingWrapper;
+
+ std::string mAdaptationUtilsImpl;
+ std::string mAdaptationStartingEndingImpl;
+ std::string mAdaptationSendingImpl;
+ std::string mAdaptationReceivingImpl;
+
+
+// !!! Modif AFA - 23/05/2016 !!!
+// ListOfInstanceOfPort listOfTreatedSignal;
+ ListOfString listOfTreatedSignalName;
+
+ ListOfBaseTypeSpecifier listOfTreatedType;
+
+ std::ostringstream module_TTCN_Declarations;
+ std::ostringstream module_TTCN_Templates;
+ std::ostringstream module_TTCN_Adaptation;
+ std::ostringstream module_TTCN_TestsAndControl;
+ std::ostringstream module_TTCN_ControlPart;
+
+ std::ostringstream newTypesDeclaration;
+
+ std::ostringstream recordsDeclaration;
+
+ std::ostringstream portsDeclaration;
+
+ std::ostringstream channelsDefinition;
+ std::ostringstream channelsDeclaration;
+ ListOfString ListOfChannelName;
+
+ ListOfString listOfAdaptationPortFunction;
+
+ std::ostringstream ossTemplateList;
+ std::ostringstream ossAdaptationList;
+ std::ostringstream ossTestcaseList;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TTCNTitanTraceFormatter(AvmTraceGenerator & aTraceGenerator)
+ : AbstractTraceFormatter( aTraceGenerator ),
+ aTraceElement( NULL ),
+ traceNumber( 1 ),
+ linkNumber( 0 ),
+
+ systemName( ),
+
+ mDeclarationsModuleName( "TTCN_Declarations" ),
+ mTemplatesModuleName( "TTCN_Templates" ),
+ mAdaptationModuleName( "TTCN_Adaptation" ),
+ mTestcasesModuleName( "TTCN_TestsAndControl" ),
+ mControlModuleName( "TTCN_ControlPart" ),
+
+ mTestcasesStartingWrapper ( DEFAULT_TESTCASES_STARTING_WRAPPER ),
+ mTestcasesEndingWrapper ( DEFAULT_TESTCASES_ENDING_WRAPPER ),
+ mTestcasesSendingWrapper ( DEFAULT_TESTCASES_SENDING_WRAPPER ),
+ mTestcasesReceivingWrapper( DEFAULT_TESTCASES_RECEIVING_WRAPPER ),
+
+ mAdaptationUtilsImpl( DEFAULT_ADAPTATION_UTILS_IMPL ),
+
+ mAdaptationStartingEndingImpl( DEFAULT_TESTCASES_STARTING_ENDING_IMPL ),
+ mAdaptationSendingImpl( DEFAULT_TESTCASES_SENDING_IMPL ),
+ mAdaptationReceivingImpl( DEFAULT_TESTCASES_RECEIVING_IMPL ),
+
+
+// !!! Modif AFA - 23/05/2016 !!!
+// listOfTreatedSignal( ),
+ listOfTreatedType( ),
+
+ module_TTCN_Declarations( ),
+ module_TTCN_Templates( ),
+ module_TTCN_Adaptation( ),
+ module_TTCN_TestsAndControl( ),
+ module_TTCN_ControlPart( ),
+
+ newTypesDeclaration( ),
+
+ recordsDeclaration( ),
+
+ portsDeclaration( ),
+ channelsDefinition( ),
+ channelsDeclaration( ),
+
+ listOfAdaptationPortFunction( ),
+
+ ossTemplateList( ),
+ ossAdaptationList( ),
+ ossTestcaseList( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~TTCNTitanTraceFormatter()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool configureImpl(WObject * wfParameterObject);
+
+ bool configureFormatter(
+ WObject * FORMAT, std::string & formatPattern,
+ const std::string & id, bool isRegex = false);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FORMAT API
+
+ ////////////////////////////////////////////////////////////////////////////
+
+ void format(TraceManager & aTraceManager);
+
+ void format_impl(TraceManager & aTraceManager);
+
+
+ void formatHeader_TTCN_Declarations(std::ostream & os);
+ void formatEnd_TTCN_Declarations(std::ostream & os);
+ void format_TTCN_Declarations(TraceSequence * aTraceElt);
+ void format_TTCN_Declarations(TracePoint * aTracePoint);
+ void format_TTCN_Declarations(TracePoint * aTracePoint,
+ BaseTypeSpecifier * aTS, std::string typeName);
+
+ void format_TTCN_DeclarationsChannels();
+
+ void formatHeader_TTCN_Templates(std::ostream & os);
+ void formatEnd_TTCN_Templates(std::ostream & os);
+ void format_TTCN_Templates(
+ const BF & value, BaseTypeSpecifier * aTS,
+ std::string typeName, avm_size_t anOffset,
+ const std::string & TAB, const std::string & CHAR);
+
+ void formatHeader_TTCN_Adaptation(std::ostream & os);
+ void formatEnd_TTCN_Adaptation(std::ostream & os);
+
+
+ void formatHeader_TTCN_TestsAndControl(std::ostream & os);
+ void formatEnd_TTCN_TestsAndControl(std::ostream & os);
+
+ void formatHeader_TTCN_TestsAndControl_testcase(std::ostream & os);
+ void formatEnd_TTCN_TestsAndControl_testcase(std::ostream & os);
+
+ void formatHeader_TTCN_ControlPart(std::ostream & os);
+ void formatEnd_TTCN_ControlPart(std::ostream & os);
+ void format_TTCN_ControlPart_execute(std::ostream & os);
+
+ void format_TTCN_Trace(TraceSequence * aTraceElt);
+ void format_TTCN_Trace(TracePoint * aTracePoint);
+
+};
+
+
+} /* namespace sep */
+
+#endif /* TTCNTITANTRACEFORMATTER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/trace/TTCNTraceFormatter.cpp b/org.eclipse.efm.symbex/src/fam/trace/TTCNTraceFormatter.cpp
new file mode 100644
index 0000000..1b7bcfe
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/trace/TTCNTraceFormatter.cpp
@@ -0,0 +1,1084 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 6 janv. 2014
+ *
+ * Contributors:
+ * Alain Faivre (CEA LIST) alain.faivre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "TTCNTraceFormatter.h"
+
+#include "TraceManager.h"
+
+#include <common/SerializerFeature.h>
+
+#include <fam/trace/AvmTraceGenerator.h>
+
+#include <fml/common/ModifierElement.h>
+
+#include <fml/executable/AvmProgram.h>
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/ExecutableSystem.h>
+#include <fml/executable/InstanceOfPort.h>
+
+#include <fml/expression/ExpressionTypeChecker.h>
+
+#include <fml/symbol/TableOfSymbol.h>
+
+#include <fml/runtime/ExecutionData.h>
+
+#include <fml/trace/TracePoint.h>
+#include <fml/trace/TraceSequence.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+#include <fml/type/ClassTypeSpecifier.h>
+#include <fml/type/ContainerTypeSpecifier.h>
+#include <fml/type/EnumTypeSpecifier.h>
+#include <fml/type/IntervalTypeSpecifier.h>
+#include <fml/type/TypeAliasSpecifier.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <sew/Configuration.h>
+
+
+namespace sep
+{
+
+
+/*
+prototype process::trace_generator as &avm::processor.TRACE_GENERATOR is
+ section REPORT
+ ...
+endsection REPORT
+
+ section PROPERTY
+ // 'OMEGA' | 'CVC4' | 'Z3' | 'YICES'
+ @solver = 'Z3';
+
+ // 'BASIC' | 'TTCN' | 'TTCN#SDL' | 'TTCN#XLIA'
+ @format = 'BASIC';
+ endsection PROPERTY
+
+ section TRACE
+ ...
+ endsection FORMAT
+endprototype
+*/
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+
+bool TTCNTraceFormatter::configureImpl(WObject * wfParameterObject)
+{
+ WObject * thePROPERTY = Query::getRegexWSequence(
+ wfParameterObject, OR_WID2("property", "PROPERTY"));
+
+ if( thePROPERTY == WObject::_NULL_ )
+ {
+ return false;
+ }
+
+ std::string format =
+ Query::getWPropertyString(thePROPERTY, "format", "TTCN.SDL");
+
+ isSDLFlag = ( format.find("SDL") != std::string::npos );
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// FORMAT API
+////////////////////////////////////////////////////////////////////////////////
+
+void TTCNTraceFormatter::format(TraceManager & aTraceManager)
+{
+ format_impl(aTraceManager);
+
+ // Generation des fichiers TTCN_
+ //
+ std::string TTCN_folder = mTraceGenerator.getLastFolder().location;
+ std::ios_base::openmode theOpenMode = std::ios_base::out;
+ std::ostringstream ossScenarioFileURL;
+
+ ossScenarioFileURL << TTCN_folder << "/TTCN_Declarations.ttcn3";
+ std::ofstream fileStream1(ossScenarioFileURL.str().c_str(), theOpenMode);
+ if ( fileStream1.is_open() )
+ {
+ fileStream1 << module_TTCN_Declarations.str() << std::endl << std::endl;
+ fileStream1.close();
+ }
+
+ ossScenarioFileURL.str("");
+ ossScenarioFileURL << TTCN_folder << "/TTCN_Templates.ttcn3";
+ std::ofstream fileStream2(ossScenarioFileURL.str().c_str(), theOpenMode);
+ if ( fileStream2.is_open() )
+ {
+ fileStream2 << module_TTCN_Templates.str() << std::endl << std::endl;
+ fileStream2.close();
+ }
+
+ ossScenarioFileURL.str("");
+ ossScenarioFileURL << TTCN_folder << "/TTCN_TestsAndControl.ttcn3";
+ std::ofstream fileStream3(ossScenarioFileURL.str().c_str(), theOpenMode);
+ if ( fileStream3.is_open() )
+ {
+ fileStream3 << module_TTCN_TestsAndControl.str()
+ << std::endl << std::endl;
+ fileStream3.close();
+ }
+
+ ossScenarioFileURL.str("");
+ ossScenarioFileURL << TTCN_folder << "/TTCN_ControlPart.ttcn3";
+ std::ofstream fileStream4(ossScenarioFileURL.str().c_str(), theOpenMode);
+ if ( fileStream4.is_open() )
+ {
+ fileStream4 << module_TTCN_ControlPart.str() << std::endl << std::endl;
+ fileStream4.close();
+ }
+
+ // Affichage des resultats dans le fichier ttcn/trace
+ //
+ ossScenarioFileURL.str("");
+ ossScenarioFileURL << TTCN_folder << "/TTCN_global.ttcn3";
+ std::ofstream fileStream5(ossScenarioFileURL.str().c_str(), theOpenMode);
+ if ( fileStream5.is_open() )
+ {
+ fileStream5 << "****************************************************" << std::endl;
+ fileStream5 << " module_TTCN_Declarations " << std::endl;
+ fileStream5 << "****************************************************" << std::endl;
+ fileStream5 << module_TTCN_Declarations.str() << std::endl << std::endl;
+ fileStream5 << "****************************************************" << std::endl;
+ fileStream5 << " module_TTCN_Templates " << std::endl;
+ fileStream5 << "****************************************************" << std::endl;
+ fileStream5 << module_TTCN_Templates.str() << std::endl << std::endl;
+ fileStream5 << "****************************************************" << std::endl;
+ fileStream5 << " module_TTCN_TestsAndControl " << std::endl;
+ fileStream5 << "****************************************************" << std::endl;
+ fileStream5 << module_TTCN_TestsAndControl.str() << std::endl << std::endl;
+ fileStream5 << "****************************************************" << std::endl;
+ fileStream5 << " module_TTCN_ControlPart " << std::endl;
+ fileStream5 << "****************************************************" << std::endl;
+ fileStream5 << module_TTCN_ControlPart.str() << std::endl << std::endl;
+ fileStream5.close();
+ }
+
+ mTraceGenerator.beginStream();
+ while( mTraceGenerator.hasStream() )
+ {
+ OutStream & os = mTraceGenerator.currentStream();
+
+AVM_IF_DEBUG_FLAG( PROCESSOR )
+ aTraceManager.toStream( os );
+AVM_ENDIF_DEBUG_FLAG( PROCESSOR )
+
+ os << "****************************************************" << std::endl;
+ os << " module_TTCN_Declarations " << std::endl;
+ os << "****************************************************" << std::endl;
+ os << module_TTCN_Declarations.str() << std::endl << std::endl;
+ os << "****************************************************" << std::endl;
+ os << " module_TTCN_Templates " << std::endl;
+ os << "****************************************************" << std::endl;
+ os << module_TTCN_Templates.str() << std::endl << std::endl;
+ os << "****************************************************" << std::endl;
+ os << " module_TTCN_TestsAndControl " << std::endl;
+ os << "****************************************************" << std::endl;
+ os << module_TTCN_TestsAndControl.str() << std::endl << std::endl;
+ os << "****************************************************" << std::endl;
+ os << " module_TTCN_ControlPart " << std::endl;
+ os << "****************************************************" << std::endl;
+ os << module_TTCN_ControlPart.str() << std::endl << std::endl;
+ }
+
+ mTraceGenerator.closeStream();
+}
+
+void TTCNTraceFormatter::format_impl(TraceManager & aTraceManager)
+{
+ // Nom du system
+ systemName = mTraceGenerator.
+ getConfiguration().getExecutableSystem().getNameID();
+
+ // module TTCN_Declarations
+ //
+ formatHeader_TTCN_Declarations(module_TTCN_Declarations);
+
+ TraceManager::const_iterator it = aTraceManager.begin();
+ TraceManager::const_iterator endIt = aTraceManager.end();
+ for( ; it != endIt ; ++it )
+ {
+ aTraceElement = (*it);
+
+ format_TTCN_Declarations(aTraceElement);
+ }
+
+ format_TTCN_DeclarationsChannels();
+
+
+ formatEnd_TTCN_Declarations(module_TTCN_Declarations);
+
+ // module TTCN_Templates
+ // module TTCN_TestsAndControl
+ // module TTCN_ControlPart
+ //
+ formatHeader_TTCN_Templates(module_TTCN_Templates);
+ formatHeader_TTCN_TestsAndControl(module_TTCN_TestsAndControl);
+ formatHeader_TTCN_ControlPart(module_TTCN_ControlPart);
+
+ traceNumber = 1;
+ linkNumber = 0;
+ it = aTraceManager.begin();
+ endIt = aTraceManager.end();
+ for( ; it != endIt ; ++it )
+ {
+ formatHeader_TTCN_TestsAndControl_testcase(module_TTCN_TestsAndControl);
+
+ aTraceElement = (*it);
+
+ format_TTCN_Templates(aTraceElement);
+
+ formatEnd_TTCN_TestsAndControl_testcase(module_TTCN_TestsAndControl);
+
+ format_TTCN_ControlPart_execute(module_TTCN_ControlPart);
+
+ traceNumber ++;
+ linkNumber = 0;
+ }
+
+ formatEnd_TTCN_Templates(module_TTCN_Templates);
+ formatEnd_TTCN_TestsAndControl(module_TTCN_TestsAndControl);
+ formatEnd_TTCN_ControlPart(module_TTCN_ControlPart);
+}
+
+void TTCNTraceFormatter::formatHeader_TTCN_Declarations(std::ostream & os)
+{
+ os << "module TTCN_Declarations {" << std::endl;
+}
+
+void TTCNTraceFormatter::formatEnd_TTCN_Declarations(std::ostream & os)
+{
+ if( not newTypesDeclaration.str().empty() )
+ {
+ os << "\t// New types declarations" << std::endl;
+ os << newTypesDeclaration.str();
+ }
+
+ os << "\t// Records declaration" << std::endl;
+ os << recordsDeclaration.str();
+
+ /*!! TODO code à supprimer après validation nouveau code pour les channels
+ os << "\t// Ports declaration" << std::endl;
+ os << "\ttype port port_cEnv message {" << std::endl;
+ os << portsDeclaration.str();
+ os << "\t}" << std::endl << std::endl;
+ */
+ os << "\t// Channels & ports declaration" << std::endl;
+ os << channelsDefinition.str();
+
+ os << "\t// TSI and MTC component declaration" << std::endl;
+ os << "\ttype component runsOn_" << systemName << " {" << std::endl;
+
+ /*!! TODO code à supprimer après validation nouveau code pour les channels
+ os << "\t\tport port_cEnv cEnv;" << std::endl;
+ */
+ os << channelsDeclaration.str();
+
+ os << "\t}" << std::endl;
+ os << "\ttype component " << systemName << " {" << std::endl;
+
+ /*!! TODO code à supprimer après validation nouveau code pour les channels
+ os << "\t\tport port_cEnv cEnv;" << std::endl;
+ */
+ os << channelsDeclaration.str();
+
+ os << "\t}" << std::endl;
+
+ // fin du module TTCN_Declarations
+ os << "}" << std::endl;
+}
+
+void TTCNTraceFormatter::format_TTCN_Declarations(TraceSequence * aTraceElt)
+{
+ BFList::const_iterator it = aTraceElt->points.begin();
+ BFList::const_iterator endIt = aTraceElt->points.end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).is< TracePoint >() )
+ {
+ if( (*it).to_ptr< TracePoint >()->isVirtual() )
+ {
+ //!! NOTHING
+ }
+ else
+ {
+ format_TTCN_Declarations((*it).to_ptr< TracePoint >());
+ }
+ }
+
+ else if( (*it).is< TraceSequence >() )
+ {
+ format_TTCN_Declarations((*it).to_ptr< TraceSequence >());
+ }
+ }
+}
+
+void TTCNTraceFormatter::format_TTCN_Declarations(TracePoint * aTracePoint)
+{
+ std::string paramName;
+ std::string paramType;
+
+// !!! Modif AFA - 23/05/2016 !!!
+// if( not listOfTreatedSignal.contains( aTracePoint->object ) )
+// {
+ if( not listOfTreatedSignalName.contains(
+ aTracePoint->object->getNameID() ) )
+ {
+
+// listOfTreatedSignal.append( aTracePoint->object );
+ listOfTreatedSignalName.append( aTracePoint->object->getNameID() );
+
+ if( aTracePoint->object->is< InstanceOfPort >() )
+ {
+ InstanceOfPort * aSignal =
+ aTracePoint->object->to< InstanceOfPort >();
+
+ // Records declaration
+ //
+ ArrayOfBF::const_iterator it = aSignal->getParameters().begin();
+ ArrayOfBF::const_iterator endIt = aSignal->getParameters().end();
+ if( isSDLFlag )
+ {
+ // ATTENTION : dans ce cas on ne prend pas en compte le dernier paramètre
+ // qui correspond au PID de l'émetteur
+ //
+ endIt = endIt - 1;
+ }
+
+ if( aSignal->hasParameter() && it != endIt )
+ {
+ // signal avec au moins un paramètre à afficher
+ //
+ recordsDeclaration << "\ttype record "
+ << aTracePoint->object->getNameID() << " {";
+
+ std::string::size_type posOfDiese;
+
+ bool firstParameter = true;
+ for( ; it != endIt ; ++it )
+ {
+ recordsDeclaration << ( firstParameter ? "" : ",")
+ << std::endl;
+
+ firstParameter = false;
+
+ // paramètre anonyme
+ if( (*it).is< BaseTypeSpecifier >() )
+ {
+ format_TTCN_Declarations(aTracePoint,
+ (*it).to_ptr< BaseTypeSpecifier >(), "unamed");
+
+ recordsDeclaration << "\t\t";
+ // le type
+ if( (*it).to_ptr< BaseTypeSpecifier >()->isTypedReal() )
+ {
+ recordsDeclaration << "float";
+ }
+ else
+ {
+ recordsDeclaration
+ << (*it).to_ptr< BaseTypeSpecifier >()->strT();
+ }
+ // le nom
+ recordsDeclaration << " " << "unamed";
+ }
+ // paramètre nommé
+ else if( (*it).is< InstanceOfData >() )
+ {
+ InstanceOfData * aParam = (*it).to_ptr< InstanceOfData >();
+
+ format_TTCN_Declarations(aTracePoint,
+ aParam->getTypeSpecifier(),
+ aParam->getTypeSpecifier()->strT());
+
+ recordsDeclaration << "\t\t";
+ // le type
+ if( aParam->getTypeSpecifier()->isTypedString() )
+ {
+ paramType = "charstring";
+ }
+ else if( aParam->getTypeSpecifier()->isTypedCharacter() )
+ {
+ paramType = "charstring";
+ }
+ else if( aParam->getTypeSpecifier()->isTypedReal())
+ {
+ paramType = "float";
+ }
+ else
+ {
+ paramType = aParam->getTypeSpecifier()->strT();
+ }
+
+ recordsDeclaration <<
+ ( aParam->getTypeSpecifier()->
+ hasTypePrimitive() ? "" : "TTCN_" )
+ << paramType;
+ // le nom
+ posOfDiese = aParam->getNameID().find_first_of('#');
+ if( (aParam->getNameID()[0] == '$')
+ || (aParam->getNameID()[0] == '#') )
+ {
+ paramName = aParam->getNameID().substr(1);
+ recordsDeclaration << " " << "param" << paramName;
+ }
+ else
+ {
+ recordsDeclaration << " " << aParam->getNameID();
+ }
+ }
+ // #bind expression parameter
+ else
+ {
+ }
+ }
+ recordsDeclaration << std::endl;
+ recordsDeclaration << "\t}" << std::endl << std::endl;
+ }
+ else
+ {
+ // signal sans paramètre à afficher
+ //
+ recordsDeclaration << "\ttype enumerated "
+ << aTracePoint->object->getNameID()
+ << " { e_" << aTracePoint->object->getNameID() << " }"
+ << std::endl << std::endl;
+ }
+
+
+/*
+ // Ports declaration
+ //
+ switch( aTracePoint->op )
+ {
+ case AVM_OPCODE_INPUT_ENV:
+ {
+ inoutSignalName = "out " + aTracePoint->object->getNameID();
+ break;
+ }
+
+ case AVM_OPCODE_OUTPUT_ENV:
+ {
+ inoutSignalName = "in " + aTracePoint->object->getNameID();
+ break;
+ }
+
+ default:
+ {
+ // Messsage erreur ???
+ break;
+ }
+ }
+*/
+
+ }
+ }
+
+
+ if( aTracePoint->object->is< InstanceOfPort >() )
+ {
+ InstanceOfPort * aSignal = aTracePoint->object->to< InstanceOfPort >();
+ // Liste des channels associés aux signaux
+ if( aSignal->hasRoutingChannel() )
+ {
+ std::string channelName = aSignal->getRoutingChannel()->getNameID();
+ if( not ListOfChannelName.contains( channelName ) )
+ {
+ ListOfChannelName.append( channelName );
+ }
+ }
+ else
+ {
+//!![TRACE ] to delete
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+// AVM_OS_COUT << "Messsage erreur ??? : Signal non connecté : "
+// << str_header( aSignal ) << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ }
+ }
+}
+
+void TTCNTraceFormatter::format_TTCN_Declarations(TracePoint * aTracePoint,
+ BaseTypeSpecifier * aTS, std::string typeName)
+{
+ if( listOfTreatedType.contains( aTS ) )
+ {
+ return;
+ }
+
+ listOfTreatedType.append( aTS );
+
+ if( aTS->hasTypeContainer() )
+ {
+ ContainerTypeSpecifier * containerT = aTS->as< ContainerTypeSpecifier >();
+ avm_size_t sizeT = containerT->size();
+
+ switch( containerT->getTypeSpecifierKind() )
+ {
+ case TYPE_VECTOR_SPECIFIER:
+ case TYPE_REVERSE_VECTOR_SPECIFIER:
+ case TYPE_LIST_SPECIFIER:
+ case TYPE_SET_SPECIFIER:
+ case TYPE_MULTISET_SPECIFIER:
+ case TYPE_FIFO_SPECIFIER:
+ case TYPE_LIFO_SPECIFIER:
+ case TYPE_MULTI_FIFO_SPECIFIER:
+ case TYPE_MULTI_LIFO_SPECIFIER:
+ default:
+ {
+ format_TTCN_Declarations(aTracePoint,
+ containerT->getContentsTypeSpecifier(), typeName);
+
+ newTypesDeclaration << "\ttype "
+ << ( containerT->getContentsTypeSpecifier().
+ hasTypePrimitive() ? "" : "TTCN_" )
+ << containerT->getContentsTypeSpecifier().strT() << " "
+ << "TTCN_" << typeName << "[" << sizeT << "];"
+ << std::endl << std::endl;
+
+ break;
+ }
+ }
+ }
+
+ else if( aTS->isTypedClass() )
+ {
+ ClassTypeSpecifier * classType = aTS->as< ClassTypeSpecifier >();
+ avm_size_t sizeT = classType->size();
+
+ Symbol aField;
+
+ for( avm_size_t idx = 0 ; idx < sizeT ; ++idx )
+ {
+ aField = classType->getSymbolData(idx);
+
+ format_TTCN_Declarations(aTracePoint, aField.getTypeSpecifier(),
+ aField.getTypeSpecifier()->strT());
+// aField.getTypeSpecifier()->getNameID());
+ }
+
+ // Type Structure/Record declaration
+ newTypesDeclaration << "\ttype record " << "TTCN_" << typeName << " {"
+ << std::endl;
+ for( avm_size_t idx = 0 ; idx < sizeT ; ++idx )
+ {
+ aField = classType->getSymbolData(idx);
+
+ newTypesDeclaration << "\t\t"
+ << ( aField.getTypeSpecifier()->hasTypePrimitive() ? "" : "TTCN_" )
+ << ( aField.getTypeSpecifier()->isTypedReal() ?
+ "float" : aField.getTypeSpecifier()->strT() )
+ << " " << aField.getNameID() << ((idx < (sizeT - 1)) ? "," : "")
+ << std::endl;
+ }
+ newTypesDeclaration << "\t}" << std::endl << std::endl;
+ }
+
+ else if( aTS->isTypedEnum() )
+ {
+ EnumTypeSpecifier * enumType = aTS->as< EnumTypeSpecifier >();
+
+ // Type enum declaration
+ newTypesDeclaration << "\ttype enumerated " << "TTCN_" << typeName
+ << " {" << std::endl;
+ newTypesDeclaration << "\t\t";
+
+ avm_size_t sizeT = enumType->getSymbolData().size();
+ for( avm_size_t idx = 0 ; idx < sizeT ; ++idx )
+ {
+ newTypesDeclaration << enumType->getSymbolData(idx).getNameID()
+ << ((idx < (sizeT - 1)) ? ", " : "\n");
+ }
+ newTypesDeclaration << "\t}" << std::endl << std::endl;
+ }
+
+ else if( aTS->isTypedInterval() )
+ {
+ IntervalTypeSpecifier * intervalTS = aTS->as< IntervalTypeSpecifier >();
+
+ newTypesDeclaration << "\ttype "
+ << ( intervalTS->getSupportTypeSpecifier().
+ hasTypePrimitive() ? "" : "TTCN_" )
+ << ( intervalTS->getSupportTypeSpecifier().isTypedReal() ?
+ "float" : intervalTS->getSupportTypeSpecifier().strT() )
+ << " TTCN_" << typeName
+ << " (" << intervalTS->getInfimum().str()
+ << " .. " << intervalTS->getSupremum().str()
+ << ");" << std::endl << std::endl;
+ }
+
+ else if( aTS->isTypedString() )
+ {
+ if( aTS->size() < AVM_NUMERIC_MAX_SIZE_T )
+ {
+ newTypesDeclaration << "\ttype charstring TTCN_" << typeName
+ << " length( " << aTS->getMinimumSize()
+ << " .. " << aTS->getMaximumSize() << " );"
+ << std::endl << std::endl;
+ }
+ }
+
+ else if( aTS->isTypedAlias() )
+ {
+ if( aTS->hasConstraint() )
+ {
+// format_TTCN_Declarations(aTracePoint,
+// aTS->as< TypeAliasSpecifier >()->targetTypeSpecifier(), typeName);
+
+ BaseTypeSpecifier * targetTS =
+ aTS->as< TypeAliasSpecifier >()->targetTypeSpecifier();
+
+ newTypesDeclaration << "\ttype "
+// << ( aTS->hasTypedPrimitive() ? "" : "TTCN_")
+ << targetTS->strT() << " " << "TTCN_" << typeName << "{ "
+ << aTS->getConstraint().as_ptr< AvmProgram >()->getCode().str()
+ << " };" << std::endl << std::endl;
+ }
+ else
+ {
+ format_TTCN_Declarations(aTracePoint,
+ aTS->as< TypeAliasSpecifier >()->targetTypeSpecifier(), typeName);
+ }
+ }
+
+ else if( aTS->weaklyTypedInteger() && (aTS->getBitSize() > 0) )
+ {
+ newTypesDeclaration << "\ttype integer" // << aTS->getNameID()
+ << " TTCN_" << typeName
+ << " (" << aTS->minIntegerValue()
+ << " .. " << aTS->maxIntegerValue()
+ << ");" << std::endl << std::endl;
+ }
+ else if( /*aTS->isTypedSimple() &&*/ aTS->hasConstraint() )
+ {
+ //!! TODO
+ newTypesDeclaration << "\ttype "
+ << /*( aTS->hasTypedPrimitive() ? "" : "TTCN_") <<*/ typeName << " "
+ << "TTCN_" << aTS->strT() << "{ "
+ << aTS->getConstraint().as_ptr< AvmProgram >()->getCode().str()
+ << " };" << std::endl << std::endl;
+ }
+}
+
+
+void TTCNTraceFormatter::format_TTCN_DeclarationsChannels()
+{
+ const ExecutableSystem & anExecutableSystem =
+ mTraceGenerator.getConfiguration().getExecutableSystem();
+
+ TableOfSymbol::const_iterator itChannel;
+ TableOfSymbol::const_iterator endChannel;
+
+ TableOfSymbol::const_iterator itPort;
+ TableOfSymbol::const_iterator endPort;
+
+ TableOfExecutableForm::const_raw_iterator itExec =
+ anExecutableSystem.getExecutables().begin();
+ TableOfExecutableForm::const_raw_iterator endExec =
+ anExecutableSystem.getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ itChannel = (itExec)->getChannel().begin();
+ endChannel = (itExec)->getChannel().end();
+ for( ; itChannel != endChannel ; ++itChannel )
+ {
+ channelsDefinition << "\ttype port port_"
+ << (*itChannel).getNameID() << " message {" << std::endl;
+
+ channelsDeclaration << "\t\tport port_" << (*itChannel).getNameID()
+ << " " << (*itChannel).getNameID() << ";" << std::endl;
+
+ itPort = (*itChannel).channel().getContents().begin();
+ endPort = (*itChannel).channel().getContents().end();
+ for( ; itPort != endPort ; ++itPort )
+ {
+// !!! Modif AFA - 23/05/2016 !!!
+// if( listOfTreatedSignal.contains( (*itPort).rawPort() ) )
+ if( listOfTreatedSignalName.contains(
+ (*itPort).rawPort()->getNameID() ) )
+
+ {
+ channelsDefinition << "\t\t"
+ << ( (*itPort).port().getModifier().isDirectionInput()
+ ? "out " : "in " )
+ << (*itPort).getNameID() << ";" << std::endl;
+ }
+ }
+ channelsDefinition << "\t}" << std::endl;
+ }
+ }
+}
+
+
+void TTCNTraceFormatter::formatHeader_TTCN_Templates(std::ostream & os)
+{
+ os << "module TTCN_Templates {" << std::endl;
+ os << "\timport from TTCN_Declarations all;" << std::endl << std::endl;
+}
+
+void TTCNTraceFormatter::formatEnd_TTCN_Templates(std::ostream & os)
+{
+ os << templateList.str();
+ os << "}" << std::endl;
+}
+
+void TTCNTraceFormatter::formatHeader_TTCN_TestsAndControl(std::ostream & os)
+{
+ int unsigned i;
+
+ os << "module TTCN_TestsAndControl {" << std::endl << std::endl;
+ os << "\timport from TTCN_Declarations all;" << std::endl;
+ os << "\timport from TTCN_Templates all;" << std::endl << std::endl;
+
+ os << "\taltstep RTDS_fail() runs on " << systemName << " {" << std::endl;
+ for(i = 0 ; i < ListOfChannelName.size() ; i++)
+ {
+ os << "\t\t[]" << ListOfChannelName.get(i)
+ << ".receive { setverdict(fail); };" << std::endl;
+ }
+ os << "\t}" << std::endl << std::endl;
+}
+
+void TTCNTraceFormatter::formatEnd_TTCN_TestsAndControl(std::ostream & os)
+{
+ os << "}" << std::endl;
+}
+
+void TTCNTraceFormatter::formatHeader_TTCN_TestsAndControl_testcase(std::ostream & os)
+{
+ int unsigned i;
+
+ os << "\ttestcase TC_trace" << traceNumber << "() "
+ << "runs on runsOn_" << systemName
+ << " system " << systemName << " {" << std::endl
+ << "\t\tactivate(RTDS_fail());" << std::endl;
+ for(i = 0 ; i < ListOfChannelName.size() ; i++)
+ {
+ os << "\t\tmap(self:" << ListOfChannelName.get(i)
+ << ",system:" << ListOfChannelName.get(i) << ");" << std::endl;
+ }
+ ossTestcaseList.str("");
+}
+
+void TTCNTraceFormatter::formatEnd_TTCN_TestsAndControl_testcase(std::ostream & os)
+{
+ os << ossTestcaseList.str();
+ os << "\t\tsetverdict(pass)" << std::endl;
+ os << "\t}" << std::endl << std::endl;
+}
+
+void TTCNTraceFormatter::formatHeader_TTCN_ControlPart(std::ostream & os)
+{
+ os << "module TTCN_ControlPart {" << std::endl << std::endl;
+ os << "\timport from TTCN_TestsAndControl all;" << std::endl << std::endl;
+
+ os << "\tcontrol {" << std::endl;
+}
+
+void TTCNTraceFormatter::formatEnd_TTCN_ControlPart(std::ostream & os)
+{
+ os << "\t}" << std::endl;
+ os << "}" << std::endl;
+}
+
+void TTCNTraceFormatter::format_TTCN_ControlPart_execute(std::ostream & os)
+{
+ os << "\t\texecute(TC_trace" << traceNumber << "());" << std::endl;
+}
+
+void TTCNTraceFormatter::format_TTCN_Templates(TraceSequence * aTraceElt)
+{
+ BFList::const_iterator it = aTraceElt->points.begin();
+ BFList::const_iterator endIt = aTraceElt->points.end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).is< TracePoint >() )
+ {
+ if( (*it).to_ptr< TracePoint >()->isVirtual() )
+ {
+ //!! NOTHING
+ }
+ else
+ {
+ format_TTCN_Templates((*it).to_ptr< TracePoint >());
+ }
+ }
+
+ else if( (*it).is< TraceSequence >() )
+ {
+ format_TTCN_Templates((*it).to_ptr< TraceSequence >());
+ }
+ }
+}
+
+void TTCNTraceFormatter::format_TTCN_Templates(TracePoint * aTracePoint)
+{
+ std::string template_TAB = "\t\t";
+ std::string template_incrTab = "\t";
+
+ if( aTracePoint->object->is< InstanceOfPort >() &&
+ ( ( aTracePoint->op == AVM_OPCODE_INPUT_ENV ) ||
+ ( aTracePoint->op == AVM_OPCODE_OUTPUT_ENV ) ) )
+ {
+ InstanceOfPort * aSignal = aTracePoint->object->to< InstanceOfPort >();
+
+ std::ostringstream templateName;
+ templateName << aSignal->getNameID()
+ << "_trace" << traceNumber
+ << "_LINK_" << linkNumber;
+
+ ArrayOfBF::const_iterator it = aSignal->getParameters().begin();
+ ArrayOfBF::const_iterator endIt = aSignal->getParameters().end();
+ if( isSDLFlag )
+ {
+ // ATTENTION : dans ce cas on ne prend pas en compte le dernier paramètre
+ // qui correspond au PID de l'émetteur
+ //
+ endIt = endIt - 1;
+ }
+
+ if( aSignal->hasParameter() && it != endIt )
+ {
+ // signal avec au moins un paramètre à afficher
+ //
+ templateList << "\ttemplate " << aSignal->getNameID() << " ";
+ templateList << templateName.str() << " := {" << std::endl;
+
+ avm_size_t sizeT = aSignal->getParameters().size() - 1;
+
+ for( avm_size_t offset = 0 ; it != endIt ; ++it , ++offset )
+ {
+ // paramètre anonyme
+ if( (*it).is< BaseTypeSpecifier >() )
+ {
+ // le nom
+ templateList << "\t\t" << "unamed";
+ // la valeur
+ templateList << " := " << aTracePoint->val(offset).str();
+ }
+ // paramètre nommé
+ else if( (*it).is< InstanceOfData >() )
+ {
+ InstanceOfData * aParam = (*it).to_ptr< InstanceOfData >();
+
+ format_TTCN_Templates(aTracePoint->val(offset),
+ aParam->getTypeSpecifier(), aParam->getNameID(),
+ offset, template_TAB, template_incrTab);
+ }
+ // #bind expression parameter
+ else
+ {
+ // Cf Arnault si cas erreur ???
+ }
+
+ templateList << ((offset+1 >= sizeT) ? "" : ",") << std::endl;
+ }
+ templateList << "\t}" << std::endl << std::endl;
+ }
+ else
+ {
+ // signal sans paramètre à afficher
+ //
+ templateList << "\ttemplate " << aSignal->getNameID()
+ << " " << templateName.str() << " := ?;"
+ << std::endl << std::endl;
+ }
+
+ if( aTracePoint->op == AVM_OPCODE_INPUT_ENV )
+ {
+ if( aSignal->hasRoutingChannel() )
+ {
+ ossTestcaseList << "\t\t"
+ << aSignal->getRoutingChannel()->getNameID()
+ << ".send(" << templateName.str() << ")" << std::endl;
+ }
+ else
+ {
+ ossTestcaseList << "\t\tcEnv.send("
+ << templateName.str() << ")" << std::endl;
+ }
+ }
+ else
+ {
+ if( aSignal->hasRoutingChannel() )
+ {
+ ossTestcaseList << "\t\t"
+ << aSignal->getRoutingChannel()->getNameID()
+ << ".receive(" << templateName.str() << ")"
+ << std::endl;
+ }
+ else
+ {
+ ossTestcaseList << "\t\tcEnv.receive("
+ << templateName.str() << ")" << std::endl;
+ }
+ }
+
+ linkNumber ++;
+ }
+}
+
+void TTCNTraceFormatter::format_TTCN_Templates(
+ const BF & value, BaseTypeSpecifier * aTS,
+ std::string aParamName, avm_size_t anOffset,
+ const std::string & TAB, const std::string & CHAR)
+{
+ // Affichage de "nom := "
+ if( (aParamName[0] == '$') || (aParamName[0] == '#') )
+ {
+ std::string newParamName = aParamName.substr(1);
+ templateList << TAB << "param" << newParamName << " := " ;
+ }
+ else
+ {
+ templateList << TAB << aParamName << " := " ;
+ }
+
+ if( aTS->hasTypeContainer() )
+ {
+ ContainerTypeSpecifier * containerT = aTS->as< ContainerTypeSpecifier >();
+// avm_size_t sizeT = containerT->size();
+
+ switch( containerT->getTypeSpecifierKind() )
+ {
+ case TYPE_VECTOR_SPECIFIER:
+ case TYPE_REVERSE_VECTOR_SPECIFIER:
+ case TYPE_LIST_SPECIFIER:
+ case TYPE_SET_SPECIFIER:
+ case TYPE_FIFO_SPECIFIER:
+ case TYPE_LIFO_SPECIFIER:
+ case TYPE_MULTI_FIFO_SPECIFIER:
+ case TYPE_MULTI_LIFO_SPECIFIER:
+ default:
+ {
+ templateList << value.str();
+// if( not aTS->isTypedSimple() )
+// {
+// format_TTCN_Templates(aTracePoint,
+// containerT->getTypeSpecifier(), aParamName);
+// }
+ break;
+ }
+ }
+ }
+
+ else if( aTS->isTypedClass() )
+ {
+ ClassTypeSpecifier * classType = aTS->as< ClassTypeSpecifier >();
+ avm_size_t sizeT = classType->size();
+
+ Symbol aField;
+
+ templateList << "{" << std::endl;
+
+ for( avm_size_t idx = 0 ; idx < sizeT ; ++idx )
+ {
+ aField = classType->getSymbolData(idx);
+
+ format_TTCN_Templates(
+ value.to_ptr< ArrayBF >()->at( idx ),
+ aField.getTypeSpecifier(), aField.getNameID(),
+ idx, TAB + CHAR, CHAR);
+
+ templateList << ((idx+1 >= sizeT) ? "" : ",") << std::endl;
+ }
+
+ templateList << TAB << "}" << std::endl;
+ }
+
+ else if( aTS->isTypedEnum() )
+ {
+ EnumTypeSpecifier * enumT = aTS->as< EnumTypeSpecifier >();
+
+ // Affichage de la valeur numérique
+ if( value.invalid() )
+ {
+ templateList << "NULL";
+ }
+ else if( value.is< ArrayBF >() )
+ {
+ templateList << "ARRAY<?>";
+ }
+ else if( value.is< InstanceOfData >() )
+ {
+ InstanceOfData * aSymbol = value.to_ptr< InstanceOfData >();
+
+ if( not enumT->hasSymbolData(aSymbol) )
+ {
+ AVM_OS_ERROR_ALERT << "TTCNTraceFormatter::format_TTCN_Templates"
+ << " :> Unexpected symbol\n<< " << str_header( aSymbol )
+ << " >>\nfor the enum type << "
+ << enumT->getFullyQualifiedNameID() << " >> !!!"
+ << SEND_ALERT;
+ }
+
+ templateList << aSymbol->getNameID();
+ }
+ else
+ {
+ const Symbol & aSymbol = enumT->getSymbolDataByValue(value);
+ if( aSymbol.valid() )
+ {
+ templateList << aSymbol.getNameID();
+ }
+ else
+ {
+ AVM_OS_ERROR_ALERT
+ << "TTCNTraceFormatter::format_TTCN_Templates"
+ " :>\nUnexpected symbol value << "
+ << value.str() << " >> for the enum type << "
+ << enumT->getFullyQualifiedNameID()
+ << " >> for the parameter << param"
+ << aParamName << " >> !!!"
+ << SEND_ALERT;
+
+ templateList << enumT->getNameID()
+ << "[ " << value.str() << " ]";
+ }
+ }
+ }
+
+ else if( value.is< Character >() )
+ {
+ // On remplace 'x' par "x"
+ templateList << value.to_ptr< Character >()->strChar('"');
+ }
+ else //if( aTS->isTypedSimple() )
+ {
+ // Affichage de la valeur numérique
+ if( value.invalid() )
+ {
+ templateList << "NULL";
+ }
+ else if( value.is< ArrayBF >() )
+ {
+ templateList << value.to_ptr< ArrayBF >()->at( anOffset ).str();
+ }
+ else
+ {
+ templateList << value.str();
+ }
+ }
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/trace/TTCNTraceFormatter.h b/org.eclipse.efm.symbex/src/fam/trace/TTCNTraceFormatter.h
new file mode 100644
index 0000000..0760723
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/trace/TTCNTraceFormatter.h
@@ -0,0 +1,186 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 6 janv. 2014
+ *
+ * Contributors:
+ * Alain Faivre (CEA LIST) alain.faivre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef TTCNTRACEFORMATTER_H_
+#define TTCNTRACEFORMATTER_H_
+
+#include "AbstractTraceFormatter.h"
+
+#include <collection/List.h>
+
+
+namespace sep
+{
+
+
+class AvmTraceGenerator;
+
+class BF;
+class BaseTypeSpecifier;
+
+class ExecutionData;
+
+class TraceManager;
+class TracePoint;
+class TraceSequence;
+
+
+class TTCNTraceFormatter : public AbstractTraceFormatter
+{
+
+protected:
+ /**
+ * TYPEDEF
+ */
+ typedef List< BaseTypeSpecifier * > ListOfBaseTypeSpecifier;
+
+ typedef List< std::string > ListOfString;
+
+
+ /**
+ * ATTRIBUTES
+ */
+ bool isSDLFlag;
+
+ TraceSequence * aTraceElement;
+ int traceNumber;
+ int linkNumber;
+
+ std::string systemName;
+
+// !!! Modif AFA - 23/05/2016 !!!
+// ListOfInstanceOfPort listOfTreatedSignal;
+ ListOfString listOfTreatedSignalName;
+
+ ListOfBaseTypeSpecifier listOfTreatedType;
+
+ std::ostringstream module_TTCN_Declarations;
+ std::ostringstream module_TTCN_Templates;
+ std::ostringstream module_TTCN_TestsAndControl;
+ std::ostringstream module_TTCN_ControlPart;
+
+ std::ostringstream newTypesDeclaration;
+
+ std::ostringstream recordsDeclaration;
+
+ std::ostringstream portsDeclaration;
+
+ std::ostringstream channelsDefinition;
+ std::ostringstream channelsDeclaration;
+ ListOfString ListOfChannelName;
+
+ std::ostringstream templateList;
+
+ std::ostringstream ossTestcaseList;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TTCNTraceFormatter(AvmTraceGenerator & aTraceGenerator)
+ : AbstractTraceFormatter( aTraceGenerator ),
+ isSDLFlag( true ),
+ aTraceElement( NULL ),
+ traceNumber( 1 ),
+ linkNumber( 0 ),
+
+ systemName( ),
+
+// !!! Modif AFA - 23/05/2016 !!!
+// listOfTreatedSignal( ),
+ listOfTreatedType( ),
+
+ module_TTCN_Templates( ),
+ module_TTCN_TestsAndControl( ),
+ module_TTCN_ControlPart( ),
+
+ newTypesDeclaration( ),
+
+ recordsDeclaration( ),
+
+ portsDeclaration( ),
+ channelsDefinition( ),
+ channelsDeclaration( ),
+
+ templateList( ),
+
+ ossTestcaseList( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~TTCNTraceFormatter()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool configureImpl(WObject * wfParameterObject);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FORMAT API
+ ////////////////////////////////////////////////////////////////////////////
+
+ void format(TraceManager & aTraceManager);
+
+ void format_impl(TraceManager & aTraceManager);
+
+
+ void formatHeader_TTCN_Declarations(std::ostream & os);
+ void formatEnd_TTCN_Declarations(std::ostream & os);
+ void format_TTCN_Declarations(TraceSequence * aTraceElt);
+ void format_TTCN_Declarations(TracePoint * aTracePoint);
+ void format_TTCN_Declarations(TracePoint * aTracePoint,
+ BaseTypeSpecifier * aTS, std::string typeName);
+
+ void format_TTCN_DeclarationsChannels();
+
+ void formatHeader_TTCN_Templates(std::ostream & os);
+ void formatEnd_TTCN_Templates(std::ostream & os);
+ void format_TTCN_Templates(
+ const BF & value, BaseTypeSpecifier * aTS,
+ std::string typeName, avm_size_t anOffset,
+ const std::string & TAB, const std::string & CHAR);
+
+
+ void formatHeader_TTCN_TestsAndControl(std::ostream & os);
+ void formatEnd_TTCN_TestsAndControl(std::ostream & os);
+
+ void formatHeader_TTCN_TestsAndControl_testcase(std::ostream & os);
+ void formatEnd_TTCN_TestsAndControl_testcase(std::ostream & os);
+
+ void formatHeader_TTCN_ControlPart(std::ostream & os);
+ void formatEnd_TTCN_ControlPart(std::ostream & os);
+ void format_TTCN_ControlPart_execute(std::ostream & os);
+
+ void format_TTCN_Templates(TraceSequence * aTraceElt);
+ void format_TTCN_Templates(TracePoint * aTracePoint);
+
+};
+
+
+} /* namespace sep */
+
+#endif /* TTCNTRACEFORMATTER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/trace/TraceManager.cpp b/org.eclipse.efm.symbex/src/fam/trace/TraceManager.cpp
new file mode 100644
index 0000000..4085938
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/trace/TraceManager.cpp
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 13 déc. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "TraceManager.h"
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// SERIALIZATION API
+////////////////////////////////////////////////////////////////////////////////
+
+void TraceManager::toStream(OutStream & os) const
+{
+ os << TAB << "Traces list :>" << EOL;
+
+ const_iterator endIt = end();
+ for( const_iterator it = begin() ; it != endIt ; ++it )
+ {
+ (*it)->toStream(os);
+ }
+ os << std::flush;
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/trace/TraceManager.h b/org.eclipse.efm.symbex/src/fam/trace/TraceManager.h
new file mode 100644
index 0000000..076d5c8
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/trace/TraceManager.h
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 13 déc. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef TRACEMANAGER_H_
+#define TRACEMANAGER_H_
+
+#include "TraceNormalizer.h"
+
+#include <collection/List.h>
+
+#include <fml/trace/TraceSequence.h>
+
+
+namespace sep
+{
+
+class TraceFormatter;
+
+
+class TraceManager : public APList< TraceSequence * >
+{
+
+public:
+ /**
+ * ATTRIBUTES
+ */
+ avm_size_t nextTID;
+
+ TraceNormalizer normalizer;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TraceManager()
+ : APList< TraceSequence * >( ),
+ nextTID( 0 ),
+
+ normalizer( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~TraceManager()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ avm_size_t currentTID() const
+ {
+ return( nextTID );
+ }
+
+ avm_size_t newTID()
+ {
+ return( ++nextTID );
+ }
+
+ void resetTID()
+ {
+ nextTID = 0;
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // REDUCING API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline void reduce(TraceSequence * aTraceElt)
+ {
+ normalizer.reduce(aTraceElt);
+ if( aTraceElt->points.nonempty() )
+ {
+ }
+ }
+
+ inline void normalize()
+ {
+ normalizer.normalize(this);
+ }
+
+ void resetTraceID()
+ {
+ normalizer.resetTraceID(this);
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SERIALIZATION API
+ ////////////////////////////////////////////////////////////////////////////
+ virtual void toStream(OutStream & os) const;
+
+};
+
+
+} /* namespace sep */
+
+#endif /* TRACEMANAGER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/trace/TraceNormalizer.cpp b/org.eclipse.efm.symbex/src/fam/trace/TraceNormalizer.cpp
new file mode 100644
index 0000000..f688c5a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/trace/TraceNormalizer.cpp
@@ -0,0 +1,205 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 16 déc. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "TraceNormalizer.h"
+
+#include "TraceManager.h"
+
+#include <fml/expression/ExpressionConstructor.h>
+
+#include <fml/trace/TracePoint.h>
+#include <fml/trace/TraceSequence.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// REDUCING API
+////////////////////////////////////////////////////////////////////////////////
+
+void TraceNormalizer::reduce(TraceSequence * aTraceElt)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRACE )
+ AVM_OS_TRACE << std::endl << "TraceNormalizer::reduce:> start" << std::endl;
+ aTraceElt->toStream( AVM_OS_TRACE );
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRACE )
+
+ TracePoint * prevAssignPoint = NULL;
+ TracePoint * prevTimePoint = NULL;
+ TracePoint * currentTracePoint = NULL;
+
+ BFList::iterator it = aTraceElt->points.begin();
+ BFList::iterator endIt = aTraceElt->points.end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).is< TracePoint >() )
+ {
+ currentTracePoint = (*it).to_ptr< TracePoint >();
+
+ // Reduce Assign Point
+ if( currentTracePoint->isAssign() )
+ {
+ if( (prevAssignPoint != NULL) &&
+ prevAssignPoint->isEQ(*currentTracePoint) )
+ {
+ aTraceElt->points.erase( it ); --it;
+ }
+ else
+ {
+ prevAssignPoint = currentTracePoint;
+
+ prevTimePoint = NULL;
+ }
+ }
+
+ // Reduce Time Point
+ else if( currentTracePoint->isTime() )
+ {
+ if( (prevTimePoint != NULL) &&
+ (prevTimePoint->object == currentTracePoint->object) )
+ {
+ prevTimePoint->value = ExpressionConstructor::addExpr(
+ prevTimePoint->value, currentTracePoint->value);
+
+ aTraceElt->points.erase( it ); --it;
+ }
+ else
+ {
+ prevTimePoint = currentTracePoint;
+ }
+ }
+
+ else if( currentTracePoint->isVirtual() )
+ {
+ //!! NOTHING
+ }
+ else
+ {
+ prevTimePoint = NULL;
+ }
+ }
+
+ else if( (*it).is< TraceSequence >() )
+ {
+ prevTimePoint = NULL;
+
+ reduce( (*it).to_ptr< TraceSequence >() );
+ }
+
+ else // Anything else
+ {
+ prevTimePoint = NULL;
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRACE )
+ AVM_OS_TRACE << std::endl << "TraceNormalizer::reduce:> result" << std::endl;
+ aTraceElt->toStream( AVM_OS_TRACE );
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRACE )
+}
+
+
+void TraceNormalizer::normalize(TraceManager * aTraceManager)
+{
+ TraceManager::iterator otherIt;
+
+ TraceManager::iterator it = aTraceManager->begin();
+ TraceManager::iterator endIt = aTraceManager->end();
+ for( ; it != endIt ; ++it )
+ {
+ for( otherIt = aTraceManager->begin() ; otherIt != it ; ++otherIt )
+ {
+ switch( (*it)->compare(*otherIt) )
+ {
+ case AVM_OPCODE_EQ:
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRACE )
+ AVM_OS_COUT << std::endl << "TraceManager::normalize:> "
+ << (*it)->str() << " = " << (*otherIt)->str() << std::endl;
+
+ AVM_IF_DEBUG_LEVEL_GTE_HIGH
+ (*it)->toStream(AVM_OS_COUT);
+ (*otherIt)->toStream(AVM_OS_COUT);
+ AVM_ENDIF_DEBUG_LEVEL_GTE_HIGH
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRACE )
+
+ otherIt = aTraceManager->erase(otherIt);
+ --otherIt;
+ break;
+ }
+
+ case AVM_OPCODE_GT:
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRACE )
+ AVM_OS_COUT << std::endl << "TraceManager::normalize:> "
+ << (*it)->str() << " > " << (*otherIt)->str() << std::endl;
+
+ AVM_IF_DEBUG_LEVEL_GTE_HIGH
+ (*it)->toStream(AVM_OS_COUT);
+ (*otherIt)->toStream(AVM_OS_COUT);
+ AVM_ENDIF_DEBUG_LEVEL_GTE_HIGH
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRACE )
+
+ otherIt = aTraceManager->erase(otherIt);
+ --otherIt;
+ break;
+ }
+
+ case AVM_OPCODE_LT:
+ {
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRACE )
+ AVM_OS_COUT << std::endl << "TraceManager::normalize:> "
+ << (*it)->str() << " < " << (*otherIt)->str() << std::endl;
+
+ AVM_IF_DEBUG_LEVEL_GTE_HIGH
+ (*it)->toStream(AVM_OS_COUT);
+ (*otherIt)->toStream(AVM_OS_COUT);
+ AVM_ENDIF_DEBUG_LEVEL_GTE_HIGH
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRACE )
+
+ it = aTraceManager->erase(it);
+// --it;
+ if( (--it) == otherIt )
+ {
+ --otherIt;
+ }
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+ }
+ }
+}
+
+
+void TraceNormalizer::resetTraceID(TraceManager * aTraceManager)
+{
+ aTraceManager->resetTID();
+
+ TraceManager::iterator it = aTraceManager->begin();
+ TraceManager::iterator endIt = aTraceManager->end();
+ for( ; it != endIt ; ++it )
+ {
+ (*it)->tid = aTraceManager->newTID();
+ }
+}
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/trace/TraceNormalizer.h b/org.eclipse.efm.symbex/src/fam/trace/TraceNormalizer.h
new file mode 100644
index 0000000..2a1bd95
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/trace/TraceNormalizer.h
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 16 déc. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef TRACENORMALIZER_H_
+#define TRACENORMALIZER_H_
+
+
+namespace sep
+{
+
+class TraceManager;
+class TraceSequence;
+
+
+class TraceNormalizer
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TraceNormalizer()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~TraceNormalizer()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // REDUCING API
+ ////////////////////////////////////////////////////////////////////////////
+
+ void reduce(TraceSequence * aTraceElt);
+
+ void normalize(TraceManager * aTraceManager);
+
+ void resetTraceID(TraceManager * aTraceManager);
+
+};
+
+
+} /* namespace sep */
+
+#endif /* TRACENORMALIZER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fam/trace/TraceNumerizer.cpp b/org.eclipse.efm.symbex/src/fam/trace/TraceNumerizer.cpp
new file mode 100644
index 0000000..4e5e738
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/trace/TraceNumerizer.cpp
@@ -0,0 +1,287 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 6 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "TraceNumerizer.h"
+
+#include "TraceManager.h"
+
+#include <computer/EvaluationEnvironment.h>
+
+#include <solver/api/SolverFactory.h>
+
+#include <fml/trace/TracePoint.h>
+#include <fml/trace/TraceSequence.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+
+/*
+prototype process::trace_generator as &avm::processor.TRACE_GENERATOR is
+ section PROPERTY
+ ...
+ // 'OMEGA' | 'CVC4' | 'Z3' | 'YICES'
+ @solver = 'CVC4';
+
+ @numerizer = 'SOLVER'; // SOLVER | NONE | NEWFRESH
+ ...
+ endsection PROPERTY
+
+ ...
+
+endprototype
+*/
+
+bool TraceNumerizer::configure(WObject * wfParameterObject)
+{
+ WObject * thePROPERTY = Query::getRegexWSequence(wfParameterObject,
+ OR_WID2("property", "PROPERTY"), wfParameterObject);
+
+ if( thePROPERTY != WObject::_NULL_ )
+ {
+ std::string strAttribrute = Query::getWPropertyString(
+ thePROPERTY, "numerizer", "SOLVER");
+ if( strAttribrute == "SOLVER" )
+ {
+ mNumerizerOperator = AVM_OPCODE_CHECK_SAT;
+ }
+ else if( strAttribrute == "NEWFRESH" )
+ {
+ mNumerizerOperator = AVM_OPCODE_ASSIGN_NEWFRESH;
+ }
+ else //if( strAttribrute == "NONE" )
+ {
+ mNumerizerOperator = AVM_OPCODE_NOP;
+ }
+
+
+ strAttribrute = Query::getWPropertyString(thePROPERTY, "solver", "");
+
+ mSolverKind = SolverDef::toSolver(
+ strAttribrute, SolverDef::DEFAULT_SOLVER_KIND);
+ }
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// NUMERIZE API
+////////////////////////////////////////////////////////////////////////////////
+
+void TraceNumerizer::numerize(TraceManager & aTraceManager)
+{
+ switch( mNumerizerOperator ) {
+ case AVM_OPCODE_CHECK_SAT:
+ {
+ numerizeSolver( aTraceManager );
+
+ break;
+ }
+ case AVM_OPCODE_ASSIGN_NEWFRESH:
+ {
+ numerizeNewfresh( aTraceManager );
+
+ break;
+ }
+ case AVM_OPCODE_NOP:
+ {
+ numerizeNothing( aTraceManager );
+
+ break;
+ }
+
+ default:
+ {
+ numerizeSolver( aTraceManager );
+
+ break;
+ }
+ }
+}
+
+
+void TraceNumerizer::numerizeSolver(TraceManager & aTraceManager)
+{
+ TraceManager::iterator it = aTraceManager.begin();
+ TraceManager::iterator endIt = aTraceManager.end();
+ while( it != endIt )
+ {
+ aTraceElement = (*it);
+
+ aTraceEC = aTraceElement->mEC;
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , SOLVING , TRACE )
+ AVM_OS_TRACE << "Avant la résolution par le solveur..." << EOL_FLUSH;
+ // aTraceEC->refExecutionData().toStreamData(AVM_OS_TRACE);
+ aTraceEC->refExecutionData().getParametersRuntimeForm().
+ toStreamData(aTraceEC->getExecutionData(), AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , SOLVING , TRACE )
+
+ modelED = SolverFactory::solve(mSolverKind, ENV, (* aTraceEC),
+ aTraceEC->refExecutionData().getAllPathCondition() );
+
+ if( modelED.invalid() )
+ {
+AVM_IF_DEBUG_ENABLED
+ AVM_OS_WARN << "Error checking model: trace < "
+ << aTraceElement->tid << " > for leaf context "
+ << aTraceEC->str_min() << std::endl << " |= "
+ << aTraceEC->refExecutionData().getAllPathCondition().wrapStr()
+ << std::endl;
+AVM_ENDIF_DEBUG_ENABLED
+
+ // iterator incrementation
+ it = aTraceManager.erase( it );
+
+ continue;
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , SOLVING , TRACE )
+ AVM_OS_TRACE << "Après la résolution par le solveur..." << EOL_FLUSH;
+// modelED->toStreamData(AVM_OS_TRACE);
+ modelED->getParametersRuntimeForm().toStreamData(modelED, AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , SOLVING , TRACE )
+
+ SolverFactory::setModel(ENV, modelED);
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , SOLVING , TRACE )
+ AVM_OS_TRACE << "Après la génération du modèle par le solveur..." << EOL_FLUSH;
+// modelED->toStreamData(AVM_OS_TRACE);
+ modelED->getParametersRuntimeForm().toStreamData(modelED, AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , SOLVING , TRACE )
+
+ numerize(aTraceElement);
+
+ SolverFactory::resetModel(modelED);
+
+ // iterator incrementation
+ ++it;
+ }
+}
+
+
+void TraceNumerizer::numerizeNewfresh(TraceManager & aTraceManager)
+{
+ TraceManager::const_iterator it = aTraceManager.begin();
+ TraceManager::const_iterator endIt = aTraceManager.end();
+ for( ; it != endIt ; ++it )
+ {
+ aTraceElement = (*it);
+
+ aTraceEC = aTraceElement->mEC;
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , SOLVING , TRACE )
+ AVM_OS_TRACE << "Avant la résolution par le solveur..." << EOL_FLUSH;
+ // aTraceEC->refExecutionData().toStreamData(AVM_OS_TRACE);
+ aTraceEC->refExecutionData().getParametersRuntimeForm().toStreamData(
+ aTraceEC->getExecutionData(), AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , SOLVING , TRACE )
+
+ modelED = SolverFactory::solveNewfresh(mSolverKind, ENV, (* aTraceEC),
+ aTraceEC->refExecutionData().getAllPathCondition() );
+
+ if( modelED.invalid() )
+ {
+AVM_IF_DEBUG_ENABLED
+ AVM_OS_WARN << "Error checking model for :> "
+ << aTraceEC->str_min() << std::endl << " |= "
+ << aTraceEC->refExecutionData().getAllPathCondition().str()
+ << std::endl;
+AVM_ENDIF_DEBUG_ENABLED
+
+ continue;
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , SOLVING , TRACE )
+ AVM_OS_TRACE << "Après la résolution / génération par le solveur..." << EOL_FLUSH;
+// modelED->toStreamData(AVM_OS_TRACE);
+ modelED->getParametersRuntimeForm().toStreamData(modelED, AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , SOLVING , TRACE )
+
+ numerize(aTraceElement);
+
+ SolverFactory::resetModel(modelED);
+ }
+}
+
+void TraceNumerizer::numerizeNothing(TraceManager & aTraceManager)
+{
+ //!! NOTHING
+}
+
+
+void TraceNumerizer::numerize(TraceSequence * aTraceElt)
+{
+ BFList::const_iterator it = aTraceElt->points.begin();
+ BFList::const_iterator endIt = aTraceElt->points.end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).is< TracePoint >() )
+ {
+ numerize( (*it).to_ptr< TracePoint >() );
+ }
+
+ else if( (*it).is< TraceSequence >() )
+ {
+ numerize( (*it).to_ptr< TraceSequence >() );
+ }
+ }
+}
+
+void TraceNumerizer::numerize(TracePoint * aTracePoint)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , SOLVING , TRACE )
+ AVM_OS_TRACE << "TraceNumerizer::numerize(TracePoint):> " << std::endl;
+ aTracePoint->toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , SOLVING , TRACE )
+
+ if( aTracePoint->value.invalid() )
+ {
+ //!! NOTING
+ }
+ else if( aTracePoint->value.is< ArrayBF >() )
+ {
+ if( ENV.eval(modelED, modelED->getSystemRID(), aTracePoint->value) )
+ {
+ aTracePoint->value = ENV.outVAL;
+ }
+ }
+ else if( aTracePoint->value.is< BuiltinForm >() )
+ {
+ //!! NOTING
+ }
+ else if( ENV.eval(modelED, modelED->getSystemRID(), aTracePoint->value) )
+ {
+ aTracePoint->value = ENV.outVAL;
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , SOLVING , TRACE )
+ aTracePoint->toStream(AVM_OS_TRACE);
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , SOLVING , TRACE )
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fam/trace/TraceNumerizer.h b/org.eclipse.efm.symbex/src/fam/trace/TraceNumerizer.h
new file mode 100644
index 0000000..084d056
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fam/trace/TraceNumerizer.h
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 6 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef TRACENUMERIZER_H_
+#define TRACENUMERIZER_H_
+
+#include <fml/runtime/ExecutionData.h>
+
+#include <solver/api/SolverDef.h>
+
+
+namespace sep
+{
+
+class ExecutionContext;
+class EvaluationEnvironment;
+
+class TraceManager;
+class TracePoint;
+class TraceSequence;
+
+
+class TraceNumerizer
+{
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ AVM_OPCODE mNumerizerOperator;
+
+ SolverDef::SOLVER_KIND mSolverKind;
+
+ EvaluationEnvironment & ENV;
+ APExecutionData modelED;
+
+ const ExecutionContext * aTraceEC;
+ TraceSequence * aTraceElement;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TraceNumerizer(EvaluationEnvironment & anENV)
+ : mNumerizerOperator( AVM_OPCODE_CHECK_SAT ),
+ mSolverKind( SolverDef::SOLVER_UNDEFINED_KIND ),
+ ENV( anENV ),
+ modelED( ),
+
+ aTraceEC( NULL ),
+ aTraceElement( NULL )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~TraceNumerizer()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool configure(WObject * wfParameterObject);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // NUMERIZE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ void numerize(TraceManager & aTraceManager);
+
+ void numerizeSolver(TraceManager & aTraceManager);
+ void numerizeNewfresh(TraceManager & aTraceManager);
+ void numerizeNothing(TraceManager & aTraceManager);
+
+ void numerize(TraceSequence * aTraceElt);
+ void numerize(TracePoint * aTracePoint);
+
+};
+
+
+} /* namespace sep */
+
+#endif /* TRACENUMERIZER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/CMakeLists.txt b/org.eclipse.efm.symbex/src/fml/CMakeLists.txt
new file mode 100644
index 0000000..600628a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/CMakeLists.txt
@@ -0,0 +1,21 @@
+# =============================================================================
+# CMake file for the FML library
+# =============================================================================
+
+# C++ source files to take into account (all files matching patterns, recursively)
+file (GLOB_RECURSE FML_CXX_SRC_FILES *.cpp *.h)
+
+# Target to build
+add_library (fml STATIC ${FML_CXX_SRC_FILES})
+
+# Include directories (internal)
+target_include_directories (fml PUBLIC ..) # FIXME : explicit the dependencies lib by lib
+
+# Target include directories (external)
+target_include_directories (fml PUBLIC ${GMP_INCLUDE_DIR} ${GMPXX_INCLUDE_DIR})
+target_include_directories (fml PUBLIC ${Boost_INCLUDE_DIRS})
+target_include_directories (fml PUBLIC ${CVC4_INCLUDE_DIR})
+
+
+add_dependencies(fml rescan_cvc4)
+
diff --git a/org.eclipse.efm.symbex/src/fml/README.md b/org.eclipse.efm.symbex/src/fml/README.md
new file mode 100644
index 0000000..f03fa90
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/README.md
@@ -0,0 +1,43 @@
+# EFM-SYMBEX-FML : Formal Modeling Language
+
+## Source code structure
+
+
+### Folder *Common*
+[Common Classes](common/README.md)
+
+
+### Folder *numeric*
+[Numeric Classes](numeric/README.md)
+
+
+### Folder *symbol*
+[Symbol Classes](symbol/README.md)
+
+
+### Folder *expression*
+[Expression Classes](expression/README.md)
+
+
+### Folder *operator*
+[Operator Classes](operator/README.md)
+
+
+### Folder *instruction*
+[Instruction Classes](instruction/README.md)
+
+
+### Folder *statement*
+[Base Classes](base/README.md)
+
+
+### Folder *type*
+[Type Classes](type/README.md)
+
+
+### Folder *infrastructure*
+[Infrastructure Classes](infrastructure/README.md)
+
+### Folder *runtime*
+[Runtime Classes](runtime/README.md)
+
diff --git a/org.eclipse.efm.symbex/src/fml/buffer/BaseBufferForm.cpp b/org.eclipse.efm.symbex/src/fml/buffer/BaseBufferForm.cpp
new file mode 100644
index 0000000..28e672b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/buffer/BaseBufferForm.cpp
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "BaseBufferForm.h"
+
+namespace sep
+{
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/buffer/BaseBufferForm.h b/org.eclipse.efm.symbex/src/fml/buffer/BaseBufferForm.h
new file mode 100644
index 0000000..3fe3bd5
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/buffer/BaseBufferForm.h
@@ -0,0 +1,220 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef BASEBUFFERFORM_H_
+#define BASEBUFFERFORM_H_
+
+#include <common/Element.h>
+
+#include <common/AvmPointer.h>
+
+#include <collection/Typedef.h>
+
+#include <fml/executable/InstanceOfBuffer.h>
+#include <fml/executable/InstanceOfPort.h>
+
+#include <fml/runtime/Message.h>
+
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+
+class RuntimeID;
+
+
+class BaseBufferForm :
+ public Element ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( BaseBufferForm )
+{
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ InstanceOfBuffer * mBufferIntance;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BaseBufferForm(class_kind_t aClassKind, InstanceOfBuffer * aBuffer)
+ : Element( aClassKind ),
+ mBufferIntance( aBuffer )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ * Abstract pur
+ */
+ BaseBufferForm(const BaseBufferForm & aBuffer)
+ : Element( aBuffer ),
+ mBufferIntance( aBuffer.mBufferIntance )
+ {
+ //!! NOTHING
+ }
+
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BaseBufferForm()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CLONE
+ */
+ virtual BaseBufferForm * clone() const = 0;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // BUFFER MANAGEMENT API
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * emptiness
+ * size
+ */
+ virtual bool empty() const = 0;
+
+ virtual bool nonempty() const = 0;
+
+ virtual bool singleton() const = 0;
+
+ virtual bool populated() const = 0;
+
+ virtual bool full() const = 0;
+
+ virtual avm_size_t size() const = 0;
+
+ /**
+ * Comparison
+ * operator==
+ */
+ virtual bool equals(const BaseBufferForm & aBuffer) const = 0;
+
+ /**
+ * clear
+ * resize
+ */
+ virtual void clear() = 0;
+
+ virtual void resize(avm_size_t newSize) = 0;
+ virtual void resize(avm_size_t newSize, const Message & aMsg) = 0;
+
+ /**
+ * push
+ * top
+ */
+ virtual bool push(const Message & aMsg) = 0;
+
+ virtual bool top(const Message & aMsg) = 0;
+
+ virtual const Message & top() const = 0;
+ virtual const Message & top(avm_size_t mid,
+ const RuntimeID & aReceiverRID
+ = RuntimeID::REF_NULL) const = 0;
+
+ inline virtual bool isTop(avm_size_t mid,
+ const RuntimeID & aReceiverRID
+ = RuntimeID::REF_NULL) const
+ {
+ return( top(mid, aReceiverRID).valid() );
+ }
+
+ /**
+ * contains
+ * uncontains
+ */
+ virtual bool contains(avm_size_t mid,
+ const RuntimeID & aReceiverRID
+ = RuntimeID::REF_NULL) const = 0;
+
+ virtual bool contains(InstanceOfPort * aSignal,
+ const RuntimeID & aReceiverRID
+ = RuntimeID::REF_NULL) const = 0;
+
+ virtual bool contains(ListOfInstanceOfPort & aSignalTrace,
+ const RuntimeID & aReceiverRID
+ = RuntimeID::REF_NULL) const = 0;
+
+ virtual bool uncontains(ListOfInstanceOfPort & aSignalTrace,
+ const RuntimeID & aReceiverRID
+ = RuntimeID::REF_NULL) const = 0;
+
+ /**
+ * pop
+ */
+ virtual Message pop() = 0;
+
+ virtual Message pop(avm_size_t mid,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) = 0;
+
+
+ virtual void popBefore(const RuntimeID & aReceiverRID) = 0;
+
+ virtual void popBefore(const ListOfInstanceOfPort & ieComs,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) = 0;
+
+ virtual void popBefore(const ListOfSizeT & ieComs,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) = 0;
+
+
+ /**
+ * remove
+ * copyTo
+ * restore
+ */
+ virtual void remove(InstanceOfPort * aPort) = 0;
+
+ virtual void copyTo(BaseBufferForm & aBuffer) const = 0;
+
+ virtual void restore(ListOfMessage & listOfMessage) = 0;
+
+
+ /**
+ * Serialize
+ */
+ virtual void toFscn(OutStream & os, const RuntimeID & aRID,
+ const BaseBufferForm * prevBuf = NULL) const = 0;
+
+
+ /**
+ * GETTER - SETTER
+ * theInstance
+ */
+ inline InstanceOfBuffer * getInstance() const
+ {
+ return( mBufferIntance );
+ }
+
+ inline bool hasInstance() const
+ {
+ return( mBufferIntance != NULL );
+ }
+
+};
+
+
+}
+
+#endif /*BASEBUFFERFORM_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/buffer/BaseBufferQueue.cpp b/org.eclipse.efm.symbex/src/fml/buffer/BaseBufferQueue.cpp
new file mode 100644
index 0000000..cff6495
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/buffer/BaseBufferQueue.cpp
@@ -0,0 +1,217 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "BaseBufferQueue.h"
+
+#include <fml/executable/InstanceOfMachine.h>
+
+#include <fml/infrastructure/Buffer.h>
+
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+/**
+ * Comparison
+ * operator==
+ */
+bool BaseBufferQueue::equals(const BaseBufferForm & aBuffer) const
+{
+ if( this == &aBuffer )
+ {
+ return( true );
+ }
+ else if( aBuffer.is< BaseBufferQueue >()
+ && (this->size() == aBuffer.size()) )
+ {
+ ListOfMessage::const_iterator itOther =
+ aBuffer.to< BaseBufferQueue >()->beginMessages();
+ ListOfMessage::const_iterator it = mMessages.begin();
+ ListOfMessage::const_iterator itEnd = mMessages.end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( ((*it) != (*itOther))
+ && (not (*it).equals( *itOther )) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+/**
+ * Serialization
+ */
+void BaseBufferQueue::toStream(OutStream & os) const
+{
+ os << TAB << "buffer ";
+ os << Buffer::str(getInstance()->getPolicySpecifierKind(), realCapacity());
+ os << " " << ( hasInstance() ? getInstance()->getFullyQualifiedNameID() : "_") << " {";
+
+ if( nonempty() )
+ {
+ AVM_DEBUG_REF_COUNTER(os);
+ os << EOL_INCR_INDENT;
+
+ ListOfMessage::const_iterator it = mMessages.begin();
+ ListOfMessage::const_iterator itEnd = mMessages.end();
+ for( ; it != itEnd ; ++it )
+ {
+AVM_IF_DEBUG_LEVEL_GTE_MEDIUM
+ (*it).toStream(os);
+AVM_ELSE
+ os << TAB << (*it).str() << EOL;
+AVM_ENDIF_DEBUG_LEVEL_GTE_MEDIUM
+ }
+ os << DECR_INDENT_TAB << "}";
+ }
+ else
+ {
+ os << " }";
+ AVM_DEBUG_REF_COUNTER(os);
+ }
+ os << EOL_FLUSH;
+}
+
+
+void BaseBufferQueue::toFscn(OutStream & out,
+ const RuntimeID & aRID, const BaseBufferForm * prevBuf) const
+{
+ StringOutStream oss( out.INDENT );
+
+ if(prevBuf == NULL)
+ {
+ if(size()==0)
+ {
+ oss << " ";
+ }
+ else
+ {
+ ListOfMessage::const_iterator it = mMessages.begin();
+ ListOfMessage::const_iterator itEnd = mMessages.end();
+ for( ; it != itEnd ; ++it )
+ {
+ (*it).toFscn(oss);
+ }
+ }
+ }
+ else if(prevBuf->is< BaseBufferQueue >())
+ {
+ bool hasDifference = false;
+ const BaseBufferQueue* prev = prevBuf->to< BaseBufferQueue >();
+ hasDifference = (size()!=prev->size());
+ if( not hasDifference )
+ {
+ ListOfMessage::const_iterator itPrev = prev->mMessages.begin();
+ ListOfMessage::const_iterator itPrevEnd = prev->mMessages.end();
+ ListOfMessage::const_iterator it = mMessages.begin();
+ ListOfMessage::const_iterator itEnd = mMessages.end();
+ for( ; (it != itEnd) && (itPrev != itPrevEnd) && (!hasDifference) ;
+ ++it , ++itPrev )
+ {
+ hasDifference = (it != itPrev);
+ }
+ }
+ if(hasDifference)
+ {
+ if(size()==0)
+ {
+ oss << " ";
+ }
+ else
+ {
+ ListOfMessage::const_iterator it = mMessages.begin();
+ ListOfMessage::const_iterator itEnd = mMessages.end();
+ for( ; it != itEnd ; ++it )
+ {
+ (*it).toFscn(oss);
+ }
+ }
+ }
+ }
+
+ if( not oss.str().empty() )
+ {
+ std::string bufferkind;
+ switch( classKind() )
+ {
+ case FORM_BUFFER_FIFO_KIND:
+ {
+ bufferkind = "FIFO";
+ break;
+ }
+ case FORM_BUFFER_LIFO_KIND:
+ {
+ bufferkind = "LIFO";
+ break;
+ }
+ case FORM_BUFFER_MULTISET_KIND:
+ {
+ bufferkind = "MULTISET";
+ break;
+ }
+ case FORM_BUFFER_SET_KIND:
+ {
+ bufferkind = "SET";
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
+
+ std::ostringstream osName;
+ if( hasInstance() )
+ {
+ if( getInstance()->hasRuntimeContainerRID() )
+ {
+ osName << getInstance()->getRuntimeContainerRID().
+ getInstance()->getNameID()
+ << "." << getInstance()->getNameID();
+ }
+ else
+ {
+ osName << ":pid#" << aRID.getRid()
+ << ":" << getInstance()->getNameID();
+ }
+ }
+ else
+ {
+ osName << ":pid#" << aRID.getRid();
+ }
+
+ out << TAB << osName.str() << ":"
+ << "<" << bufferkind << ">#" << getInstance()->getOffset() << "{";
+
+ if(oss.str().compare(" ")==0)
+ {
+ out << " }" << EOL_FLUSH;
+ }
+ else
+ {
+ out << EOL << oss.str()
+ << TAB << "}" << EOL_FLUSH;
+ }
+ }
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/buffer/BaseBufferQueue.h b/org.eclipse.efm.symbex/src/fml/buffer/BaseBufferQueue.h
new file mode 100644
index 0000000..1d12afb
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/buffer/BaseBufferQueue.h
@@ -0,0 +1,351 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef BASEBUFFERQUEUE_H_
+#define BASEBUFFERQUEUE_H_
+
+#include <fml/buffer/BaseBufferForm.h>
+#include <collection/BFContainer.h>
+
+#include <fml/runtime/Message.h>
+
+
+namespace sep
+{
+
+
+class RuntimeID;
+
+
+class BaseBufferQueue : public BaseBufferForm
+{
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef ListOfMessage::const_iterator const_iterator;
+
+protected:
+ /*
+ * ATTRIBUTE
+ */
+ ListOfMessage mMessages;
+
+ avm_size_t mCapacity;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BaseBufferQueue(class_kind_t aClassKind, InstanceOfBuffer * aBuffer)
+ : BaseBufferForm(aClassKind, aBuffer),
+ mMessages( ),
+ mCapacity( aBuffer->capacity() )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ BaseBufferQueue(const BaseBufferQueue & aBuffer)
+ : BaseBufferForm( aBuffer ),
+ mMessages( aBuffer.mMessages ),
+ mCapacity( aBuffer.mCapacity )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BaseBufferQueue()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mMessages
+ */
+ inline const_iterator beginMessages() const
+ {
+ return( mMessages.begin() );
+ }
+
+ inline const_iterator endMessages() const
+ {
+ return( mMessages.end() );
+ }
+
+ inline ListOfMessage & getMessages()
+ {
+ return( mMessages );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mCapacity
+ */
+ inline avm_size_t capacity() const
+ {
+ return( mCapacity );
+ }
+
+ inline long realCapacity() const
+ {
+ return( (mCapacity == AVM_NUMERIC_MAX_SIZE_T)? -1 : mCapacity );
+ }
+
+ inline void setCapacity(long aCapacity)
+ {
+ mCapacity = (aCapacity < 0) ? AVM_NUMERIC_MAX_SIZE_T : aCapacity;
+ }
+
+ inline bool isFinite() const
+ {
+ return( mCapacity < AVM_NUMERIC_MAX_SIZE_T );
+ }
+
+ inline bool isInfinite() const
+ {
+ return( mCapacity == AVM_NUMERIC_MAX_SIZE_T );
+ }
+
+
+ /**
+ * Comparison
+ * operator==
+ */
+ virtual bool equals(const BaseBufferForm & aBuffer) const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // BUFFER MANAGEMENT API
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * emptiness
+ * size
+ */
+ inline virtual bool empty() const
+ {
+ return( mMessages.empty() );
+ }
+
+ inline virtual bool nonempty() const
+ {
+ return( mMessages.nonempty() );
+ }
+
+ inline virtual bool singleton() const
+ {
+ return( mMessages.singleton() );
+ }
+
+ inline virtual bool populated() const
+ {
+ return( mMessages.populated() );
+ }
+
+ inline virtual bool full() const
+ {
+ return( size() == mCapacity );
+ }
+
+ inline virtual avm_size_t size() const
+ {
+ return( mMessages.size() );
+ }
+
+ /**
+ * clear
+ * resize
+ * remove
+ */
+ inline virtual void clear()
+ {
+ mMessages.clear();
+ }
+
+ inline virtual void resize(avm_size_t newSize)
+ {
+ if( mCapacity > newSize )
+ {
+ if( (mCapacity = size()) > newSize )
+ {
+ for( ; mCapacity > newSize ; --mCapacity )
+ {
+ pop();
+ }
+ return;
+ }
+ }
+ mCapacity = newSize;
+ }
+
+ inline virtual void resize(avm_size_t newSize, const Message & aMsg)
+ {
+ if( mCapacity > newSize )
+ {
+ if( (mCapacity = size()) > newSize )
+ {
+ for( ; mCapacity > newSize ; --mCapacity )
+ {
+ pop();
+ }
+ return;
+ }
+ }
+ else if( (mCapacity = size()) < newSize )
+ {
+ for( ; mCapacity < newSize ; ++mCapacity )
+ {
+ push(aMsg);
+ }
+ }
+
+ mCapacity = newSize;
+ }
+
+
+ inline virtual void remove(InstanceOfPort * aSignal)
+ {
+ ListOfMessage::iterator it = mMessages.begin();
+ for( ; it != mMessages.end() ; )
+ {
+ if( (*it).isSignal(aSignal) )
+ {
+ it = mMessages.erase(it);
+ }
+ else
+ {
+ ++it;
+ }
+ }
+ }
+
+
+ inline virtual void remove(const RuntimeID & aReceiverRID)
+ {
+ if( aReceiverRID.valid() )
+ {
+ ListOfMessage::iterator it = mMessages.begin();
+ for( ; it != mMessages.end() ; )
+ {
+ if( (*it).isReceiver(aReceiverRID) )
+ {
+ it = mMessages.erase( it );
+ }
+ else
+ {
+ ++it;
+ }
+ }
+ }
+ else
+ {
+ clear();
+ }
+ }
+
+
+
+ /**
+ * contains
+ * uncontains
+ */
+ inline virtual bool contains(avm_size_t mid,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) const
+ {
+ const_iterator it = mMessages.begin();
+ const_iterator itEnd = mMessages.end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it).isCompatible(mid, aReceiverRID) )
+ {
+ return( true );
+ }
+ }
+ return( false );
+ }
+
+
+ inline virtual bool contains(InstanceOfPort * aSignal,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) const
+ {
+ const_iterator it = mMessages.begin();
+ const_iterator itEnd = mMessages.end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it).isCompatible(aSignal, aReceiverRID) )
+ {
+ return( true );
+ }
+ }
+ return( false );
+ }
+
+
+ inline virtual bool contains(ListOfInstanceOfPort & aSignalTrace,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) const
+ {
+ ListOfInstanceOfPort::const_iterator itSignal = aSignalTrace.begin();
+ ListOfInstanceOfPort::const_iterator endSignal = aSignalTrace.end();
+ for( ; itSignal != endSignal ; ++itSignal )
+ {
+ if( not contains( *itSignal , aReceiverRID ) )
+ {
+ return( false );
+ }
+ }
+
+ return( itSignal == endSignal );
+ }
+
+
+ inline virtual bool uncontains(ListOfInstanceOfPort & aSignalTrace,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) const
+ {
+ ListOfInstanceOfPort::iterator itSignal = aSignalTrace.begin();
+ ListOfInstanceOfPort::iterator endSignal = aSignalTrace.end();
+ for( ; itSignal != endSignal ; )
+ {
+ if( contains( *itSignal, aReceiverRID ) )
+ {
+ itSignal = aSignalTrace.erase( itSignal );
+ }
+ }
+
+ return( aSignalTrace.nonempty() );
+ }
+
+
+ /**
+ * Serialization
+ */
+ virtual void toStream(OutStream & os) const;
+
+ virtual void toFscn(OutStream & os, const RuntimeID & aRID,
+ const BaseBufferForm * prevBuf = NULL) const;
+
+};
+
+
+}
+
+#endif /*BASEBUFFERQUEUE_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/buffer/BroadcastBuffer.cpp b/org.eclipse.efm.symbex/src/fml/buffer/BroadcastBuffer.cpp
new file mode 100644
index 0000000..877bc40
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/buffer/BroadcastBuffer.cpp
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "BroadcastBuffer.h"
+
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+
+void BroadcastBuffer::toStream(OutStream & os) const
+{
+ os << TAB << "buffer broadcast "
+ << ( hasInstance() ? getInstance()->getFullyQualifiedNameID() : "_")
+ << " {";
+
+ AVM_DEBUG_REF_COUNTER(os);
+ os << EOL_INCR_INDENT;
+
+ if( nonempty() )
+ {
+ mMessage.toStream(os);
+ }
+
+ os << DECR_INDENT_TAB << "}" << EOL_FLUSH;
+}
+
+
+void BroadcastBuffer::toFscn(OutStream & os,
+ const RuntimeID & aRID, const BaseBufferForm * prevBuf) const
+{
+ if( nonempty() )
+ {
+ bool hasDifference = (prevBuf == NULL);
+
+ if( (not hasDifference)
+ && prevBuf->is< BroadcastBuffer >() )
+ {
+ const BroadcastBuffer * prev = prevBuf->to< BroadcastBuffer >();
+ if(prev->mMessage!=mMessage)
+ {
+ hasDifference = true;
+ }
+ }
+
+ if( hasDifference )
+ {
+ os << TAB << ":pid#" << aRID.getRid() << ":" << "<BROADCAST>#"
+ << getInstance()->getOffset() << "{" << EOL_INCR_INDENT;
+
+ mMessage.toFscn(os);
+
+ os << DECR_INDENT_TAB << "}" << EOL_FLUSH;
+ }
+ }
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/buffer/BroadcastBuffer.h b/org.eclipse.efm.symbex/src/fml/buffer/BroadcastBuffer.h
new file mode 100644
index 0000000..71c6912
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/buffer/BroadcastBuffer.h
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef BROADCASTBUFFER_H_
+#define BROADCASTBUFFER_H_
+
+#include <fml/buffer/RamBuffer.h>
+
+
+namespace sep
+{
+
+
+class RuntimeID;
+
+
+class BroadcastBuffer : public RamBuffer
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( BroadcastBuffer )
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ Message mNextStepMessage;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BroadcastBuffer(InstanceOfBuffer * aBuffer)
+ : RamBuffer(CLASS_KIND_T( BroadcastBuffer ), aBuffer),
+ mNextStepMessage( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ BroadcastBuffer(const BroadcastBuffer & aBroadcast)
+ : RamBuffer( aBroadcast ),
+ mNextStepMessage( )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ ***************************************************************************
+ * UPDATE ==> push( mNextStepMessage )
+ ***************************************************************************
+ */
+ inline virtual void update()
+ {
+ mMessage.flush( mNextStepMessage );
+ }
+
+
+ /**
+ * BUFFER MANAGEMENT
+ */
+ virtual bool push(const Message & aMsg)
+ {
+ mNextStepMessage = aMsg;
+
+ return( true );
+ }
+
+ virtual bool top(const Message & aMsg)
+ {
+ mNextStepMessage = aMsg;
+
+ return( true );
+ }
+
+ /**
+ ***************************************************************************
+ * SERIALIZATION
+ ***************************************************************************
+ */
+ void toStream(OutStream & os) const;
+
+ void toFscn(OutStream & os, const RuntimeID & aRID,
+ const BaseBufferForm * prevBuf = NULL) const;
+
+};
+
+
+}
+
+#endif /*BROADCASTBUFFER_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/buffer/FifoBuffer.cpp b/org.eclipse.efm.symbex/src/fml/buffer/FifoBuffer.cpp
new file mode 100644
index 0000000..d5d4ff8
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/buffer/FifoBuffer.cpp
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "FifoBuffer.h"
+
+
+namespace sep
+{
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/buffer/FifoBuffer.h b/org.eclipse.efm.symbex/src/fml/buffer/FifoBuffer.h
new file mode 100644
index 0000000..7a0b369
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/buffer/FifoBuffer.h
@@ -0,0 +1,249 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef FIFOBUFFER_H_
+#define FIFOBUFFER_H_
+
+#include <fml/buffer/BaseBufferQueue.h>
+
+namespace sep
+{
+
+
+class FifoBuffer : public BaseBufferQueue
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( FifoBuffer )
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ FifoBuffer(InstanceOfBuffer * aBuffer)
+ : BaseBufferQueue(CLASS_KIND_T( FifoBuffer ), aBuffer)
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ FifoBuffer(const FifoBuffer & aFifo )
+ : BaseBufferQueue( aFifo )
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // BUFFER MANAGEMENT API
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * push
+ * top
+ */
+ inline virtual bool push(const Message & aMsg)
+ {
+ if( size() < capacity() )
+ {
+ mMessages.push_back(aMsg);
+
+ return( true );
+ }
+
+ return( false );
+ }
+
+
+ inline virtual bool top(const Message & aMsg)
+ {
+ if( nonempty() )
+ {
+ mMessages.front() = aMsg;
+
+ return( true );
+ }
+
+ return( false );
+ }
+
+ inline virtual const Message & top() const
+ {
+ if( nonempty() )
+ {
+ return( mMessages.front() );
+ }
+
+ return( Message::_NULL_ );
+ }
+
+ inline virtual const Message & top(avm_size_t mid,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) const
+ {
+ if( nonempty()
+ && mMessages.front().isCompatible(mid, aReceiverRID) )
+ {
+ return( mMessages.front() );
+ }
+
+ return( Message::_NULL_ );
+ }
+
+
+ /**
+ * contains
+ * uncontains
+ */
+ inline virtual bool contains(ListOfInstanceOfPort & aSignalTrace,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) const
+ {
+ ListOfInstanceOfPort::const_iterator itSignal = aSignalTrace.begin();
+ ListOfInstanceOfPort::const_iterator endSignal = aSignalTrace.end();
+ ListOfMessage::const_iterator it = mMessages.begin();
+ ListOfMessage::const_iterator itEnd = mMessages.end();
+ for( ; (it != itEnd) && (itSignal != endSignal) ; ++it )
+ {
+ if( (*it).isCompatible(*itSignal, aReceiverRID) )
+ {
+ ++itSignal;
+ }
+ }
+
+ return( itSignal == endSignal );
+ }
+
+
+ inline virtual bool uncontains(ListOfInstanceOfPort & aSignalTrace,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) const
+ {
+ ListOfInstanceOfPort::iterator itSignal = aSignalTrace.begin();
+ ListOfInstanceOfPort::iterator endSignal = aSignalTrace.end();
+ ListOfMessage::const_iterator it = mMessages.begin();
+ ListOfMessage::const_iterator itEnd = mMessages.end();
+ for( ; (it != itEnd) && (itSignal != endSignal) ; ++it )
+ {
+ if( (*it).isCompatible(*itSignal, aReceiverRID) )
+ {
+ itSignal = aSignalTrace.erase( itSignal );
+ }
+ }
+
+ return( aSignalTrace.nonempty() );
+ }
+
+
+ /**
+ * pop
+ */
+ inline virtual Message pop()
+ {
+ if( nonempty() )
+ {
+ Message aMsg = mMessages.front();
+ mMessages.pop_front();
+
+ return( aMsg );
+ }
+
+ return( Message::_NULL_ );
+ }
+
+
+ Message pop(avm_size_t mid,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL)
+ {
+ if( nonempty() )
+ {
+ Message aMsg = mMessages.front();
+ if( aMsg.isCompatible(mid, aReceiverRID) )
+ {
+ mMessages.pop_front();
+
+ return( aMsg );
+ }
+ }
+
+ return( Message::_NULL_ );
+ }
+
+
+ inline virtual void popBefore(const RuntimeID & aReceiverRID)
+ {
+ while( nonempty() && mMessages.front().isCompatible(aReceiverRID) )
+ {
+ mMessages.pop_front();
+ }
+ }
+
+ inline virtual void popBefore(const ListOfInstanceOfPort & ieComs,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL)
+ {
+ while( nonempty() && mMessages.front().isCompatible(aReceiverRID) )
+ {
+ if( mMessages.front().isCompatible(ieComs) )
+ {
+ break;
+ }
+ else
+ {
+ mMessages.pop_front();
+ }
+ }
+ }
+
+ inline virtual void popBefore(const ListOfSizeT & ieComs,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL)
+ {
+ while( nonempty() && mMessages.front().isCompatible(aReceiverRID) )
+ {
+ if( mMessages.front().isCompatible(ieComs) )
+ {
+ break;
+ }
+ else
+ {
+ mMessages.pop_front();
+ }
+ }
+ }
+
+
+ /**
+ * copyTo
+ * restore
+ */
+ inline virtual void copyTo(BaseBufferForm & aBuffer) const
+ {
+ ListOfMessage::const_iterator it = mMessages.begin();
+ ListOfMessage::const_iterator itEnd = mMessages.end();
+ for( ; it != itEnd ; ++it )
+ {
+ aBuffer.push( *it );
+ }
+ }
+
+ inline virtual void restore(ListOfMessage & listOfMessage)
+ {
+ listOfMessage.splice( mMessages );
+
+ mMessages.splice( listOfMessage );
+ }
+
+};
+
+
+}
+
+#endif /*FIFOBUFFER_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/buffer/LifoBuffer.cpp b/org.eclipse.efm.symbex/src/fml/buffer/LifoBuffer.cpp
new file mode 100644
index 0000000..34ab690
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/buffer/LifoBuffer.cpp
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "LifoBuffer.h"
+
+
+namespace sep
+{
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/buffer/LifoBuffer.h b/org.eclipse.efm.symbex/src/fml/buffer/LifoBuffer.h
new file mode 100644
index 0000000..8126a20
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/buffer/LifoBuffer.h
@@ -0,0 +1,251 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef LIFOBUFFER_H_
+#define LIFOBUFFER_H_
+
+#include <fml/buffer/BaseBufferQueue.h>
+
+namespace sep
+{
+
+
+class LifoBuffer : public BaseBufferQueue
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( LifoBuffer )
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ LifoBuffer(InstanceOfBuffer * aBuffer)
+ : BaseBufferQueue(CLASS_KIND_T( LifoBuffer ), aBuffer)
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ LifoBuffer(const LifoBuffer & aLifo )
+ : BaseBufferQueue( aLifo )
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // BUFFER MANAGEMENT API
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * push
+ * top
+ */
+ inline virtual bool push(const Message & aMsg)
+ {
+ if( size() < capacity() )
+ {
+ mMessages.push_back(aMsg);
+
+ return( true );
+ }
+
+ return( false );
+ }
+
+
+ inline virtual bool top(const Message & aMsg)
+ {
+ if( nonempty() )
+ {
+ mMessages.back() = aMsg;
+
+ return( true );
+ }
+
+ return( false );
+ }
+
+ inline virtual const Message & top() const
+ {
+ if( nonempty() )
+ {
+ return( mMessages.back() );
+ }
+
+ return( Message::_NULL_ );
+ }
+
+ inline virtual const Message & top(avm_size_t mid,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) const
+ {
+ if( nonempty() && mMessages.back().isCompatible(mid, aReceiverRID) )
+ {
+ return( mMessages.back() );
+ }
+
+ return( Message::_NULL_ );
+ }
+
+
+ /**
+ * contains
+ * uncontains
+ */
+ inline virtual bool contains(ListOfInstanceOfPort & aSignalTrace,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) const
+ {
+ ListOfInstanceOfPort::const_iterator itSignal = aSignalTrace.begin();
+ ListOfInstanceOfPort::const_iterator endSignal = aSignalTrace.end();
+ ListOfMessage::const_reverse_iterator it = mMessages.rbegin();
+ ListOfMessage::const_reverse_iterator itEnd = mMessages.rend();
+ for( ; (it != itEnd) && (itSignal != endSignal) ; ++it )
+ {
+ if( (*it).isCompatible(*itSignal, aReceiverRID) )
+ {
+ ++itSignal;
+ }
+ }
+
+ return( itSignal == endSignal );
+ }
+
+
+ inline virtual bool uncontains(ListOfInstanceOfPort & aSignalTrace,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) const
+ {
+ ListOfInstanceOfPort::iterator itSignal = aSignalTrace.begin();
+ ListOfInstanceOfPort::iterator endSignal = aSignalTrace.end();
+ ListOfMessage::const_reverse_iterator it = mMessages.rbegin();
+ ListOfMessage::const_reverse_iterator itEnd = mMessages.rend();
+ for( ; (it != itEnd) && (itSignal != endSignal) ; ++it )
+ {
+ if( (*it).isCompatible(*itSignal, aReceiverRID) )
+ {
+ itSignal = aSignalTrace.erase( itSignal );
+ }
+ }
+
+ return( aSignalTrace.nonempty() );
+ }
+
+
+ /**
+ * pop
+ */
+ inline virtual Message pop()
+ {
+ if( nonempty() )
+ {
+ Message aMsg = mMessages.pop_last();
+
+ return( aMsg );
+ }
+
+ return( Message::_NULL_ );
+ }
+
+
+ inline virtual Message pop(avm_size_t mid,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL)
+ {
+ if( nonempty() )
+ {
+ Message aMsg = mMessages.back();
+ if( aMsg.isCompatible(mid, aReceiverRID) )
+ {
+ mMessages.pop_back();
+
+ return( aMsg );
+ }
+ }
+
+ return( Message::_NULL_ );
+ }
+
+
+
+ inline virtual void popBefore(const RuntimeID & aReceiverRID)
+ {
+ while( nonempty() && mMessages.back().isCompatible(aReceiverRID) )
+ {
+ mMessages.pop_back();
+ }
+ }
+
+ inline virtual void popBefore(const ListOfInstanceOfPort & ieComs,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL)
+ {
+ while( nonempty() && mMessages.back().isCompatible(aReceiverRID) )
+ {
+ if( mMessages.back().isCompatible(ieComs) )
+ {
+ break;
+ }
+ else
+ {
+ mMessages.pop_back();
+ }
+ }
+ }
+
+ inline virtual void popBefore(const ListOfSizeT & ieComs,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL)
+ {
+ while( nonempty() && mMessages.back().isCompatible(aReceiverRID) )
+ {
+ if( mMessages.back().isCompatible(ieComs) )
+ {
+ break;
+ }
+ else
+ {
+ mMessages.pop_back();
+ }
+ }
+ }
+
+
+ /**
+ * copyTo
+ * restore
+ */
+ inline virtual void copyTo(BaseBufferForm & aBuffer) const
+ {
+ ListOfMessage::const_reverse_iterator it = mMessages.rbegin();
+ ListOfMessage::const_reverse_iterator itEnd = mMessages.rend();
+ for( ; it != itEnd ; ++it )
+ {
+ aBuffer.push( *it );
+ }
+ }
+
+ inline virtual void restore(ListOfMessage & listOfMessage)
+ {
+ while( listOfMessage.nonempty() )
+ {
+ mMessages.push_back( listOfMessage.back() );
+
+ listOfMessage.pop_back();
+ }
+ }
+
+};
+
+
+}
+
+#endif /*LIFOBUFFER_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/buffer/MultiFifoBuffer.cpp b/org.eclipse.efm.symbex/src/fml/buffer/MultiFifoBuffer.cpp
new file mode 100644
index 0000000..baf7c46
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/buffer/MultiFifoBuffer.cpp
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 3 févr. 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "MultiFifoBuffer.h"
+
+namespace sep
+{
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/buffer/MultiFifoBuffer.h b/org.eclipse.efm.symbex/src/fml/buffer/MultiFifoBuffer.h
new file mode 100644
index 0000000..702e26c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/buffer/MultiFifoBuffer.h
@@ -0,0 +1,281 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 3 févr. 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef MULTIFIFOBUFFER_H_
+#define MULTIFIFOBUFFER_H_
+
+#include <fml/buffer/BaseBufferQueue.h>
+
+namespace sep
+{
+
+
+class MultiFifoBuffer : public BaseBufferQueue
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( MultiFifoBuffer )
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ MultiFifoBuffer(InstanceOfBuffer * aBuffer)
+ : BaseBufferQueue(CLASS_KIND_T( MultiFifoBuffer ), aBuffer)
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ MultiFifoBuffer(const MultiFifoBuffer & aMultiFifo )
+ : BaseBufferQueue( aMultiFifo )
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // BUFFER MANAGEMENT API
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * push
+ * top
+ */
+ inline virtual bool push(const Message & aMsg)
+ {
+ if( size() < capacity() )
+ {
+ mMessages.push_back(aMsg);
+
+ return( true );
+ }
+
+ return( false );
+ }
+
+
+ inline virtual bool top(const Message & aMsg)
+ {
+ if( nonempty() )
+ {
+ mMessages.front() = aMsg;
+
+ return( true );
+ }
+
+ return( false );
+ }
+
+ inline virtual const Message & top() const
+ {
+ if( nonempty() )
+ {
+ return( mMessages.front() );
+ }
+
+ return( Message::_NULL_ );
+ }
+
+ inline virtual const Message & top(avm_size_t mid,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) const
+ {
+ ListOfMessage::const_iterator it = mMessages.begin();
+ ListOfMessage::const_iterator itEnd = mMessages.end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it).isCompatible(mid, aReceiverRID) )
+ {
+ return( *it );
+ }
+ }
+
+ return( Message::_NULL_ );
+ }
+
+
+ /**
+ * contains
+ * uncontains
+ */
+ inline virtual bool contains(ListOfInstanceOfPort & aSignalTrace,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) const
+ {
+ ListOfInstanceOfPort::const_iterator itSignal = aSignalTrace.begin();
+ ListOfInstanceOfPort::const_iterator endSignal = aSignalTrace.end();
+ ListOfMessage::const_iterator it = mMessages.begin();
+ ListOfMessage::const_iterator itEnd = mMessages.end();
+ for( ; (it != itEnd) && (itSignal != endSignal) ; ++it )
+ {
+ if( (*it).isCompatible(*itSignal, aReceiverRID) )
+ {
+ ++itSignal;
+ }
+ }
+
+ return( itSignal == endSignal );
+ }
+
+
+ inline virtual bool uncontains(ListOfInstanceOfPort & aSignalTrace,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) const
+ {
+ ListOfInstanceOfPort::iterator itSignal = aSignalTrace.begin();
+ ListOfInstanceOfPort::iterator endSignal = aSignalTrace.end();
+ ListOfMessage::const_iterator it = mMessages.begin();
+ ListOfMessage::const_iterator itEnd = mMessages.end();
+ for( ; (it != itEnd) && (itSignal != endSignal) ; ++it )
+ {
+ if( (*it).isCompatible(*itSignal, aReceiverRID) )
+ {
+ itSignal = aSignalTrace.erase( itSignal );
+ }
+ }
+
+ return( aSignalTrace.nonempty() );
+ }
+
+
+ /**
+ * pop
+ */
+ inline virtual Message pop()
+ {
+ if( nonempty() )
+ {
+ Message aMsg = mMessages.front();
+
+ mMessages.pop_front();
+
+ return( aMsg );
+ }
+
+ return( Message::_NULL_ );
+ }
+
+
+ Message pop(avm_size_t mid,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL)
+ {
+ if( nonempty() )
+ {
+ Message aMsg = mMessages.front();
+ if( aMsg.isCompatible(mid, aReceiverRID) )
+ {
+ mMessages.pop_front();
+
+ return( aMsg );
+ }
+ }
+
+ return( Message::_NULL_ );
+ }
+
+
+ inline virtual void popBefore(const RuntimeID & aReceiverRID)
+ {
+ ListOfMessage::iterator it = mMessages.begin();
+ for( ; it != mMessages.end() ; )
+ {
+ if( (*it).isCompatible(aReceiverRID) )
+ {
+ it = mMessages.erase( it );
+ }
+ else
+ {
+ ++it;
+ }
+ }
+ }
+
+ inline virtual void popBefore(const ListOfInstanceOfPort & ieComs,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL)
+ {
+ ListOfMessage::iterator it = mMessages.begin();
+ for( ; it != mMessages.end() ; )
+ {
+ if( (*it).isCompatible(aReceiverRID) )
+ {
+ if( (*it).isCompatible(ieComs) )
+ {
+ break;
+ }
+ else
+ {
+ it = mMessages.erase( it );
+ }
+ }
+ else
+ {
+ ++it;
+ }
+ }
+ }
+
+ inline virtual void popBefore(const ListOfSizeT & ieComs,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL)
+ {
+ ListOfMessage::iterator it = mMessages.begin();
+ for( ; it != mMessages.end() ; )
+ {
+ if( (*it).isCompatible(aReceiverRID) )
+ {
+ if( (*it).isCompatible(ieComs) )
+ {
+ break;
+ }
+ else
+ {
+ it = mMessages.erase( it );
+ }
+ }
+ else
+ {
+ ++it;
+ }
+ }
+ }
+
+
+ /**
+ * copyTo
+ * restore
+ */
+ inline virtual void copyTo(BaseBufferForm & aBuffer) const
+ {
+ ListOfMessage::const_iterator it = mMessages.begin();
+ ListOfMessage::const_iterator itEnd = mMessages.end();
+ for( ; it != itEnd ; ++it )
+ {
+ aBuffer.push( *it );
+ }
+ }
+
+ inline virtual void restore(ListOfMessage & listOfMessage)
+ {
+ listOfMessage.splice( mMessages );
+
+ mMessages.splice( listOfMessage );
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* MULTIFIFOBUFFER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/buffer/MultiLifoBuffer.cpp b/org.eclipse.efm.symbex/src/fml/buffer/MultiLifoBuffer.cpp
new file mode 100644
index 0000000..5183aad
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/buffer/MultiLifoBuffer.cpp
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 3 févr. 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "MultiLifoBuffer.h"
+
+namespace sep
+{
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/buffer/MultiLifoBuffer.h b/org.eclipse.efm.symbex/src/fml/buffer/MultiLifoBuffer.h
new file mode 100644
index 0000000..777e1ff
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/buffer/MultiLifoBuffer.h
@@ -0,0 +1,272 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 3 févr. 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef MULTILIFOBUFFER_H_
+#define MULTILIFOBUFFER_H_
+
+#include <fml/buffer/BaseBufferQueue.h>
+
+namespace sep
+{
+
+
+class MultiLifoBuffer : public BaseBufferQueue
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( MultiLifoBuffer )
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ MultiLifoBuffer(InstanceOfBuffer * aBuffer)
+ : BaseBufferQueue(CLASS_KIND_T( MultiLifoBuffer ), aBuffer)
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ MultiLifoBuffer(const MultiLifoBuffer & aMultiLifo )
+ : BaseBufferQueue( aMultiLifo )
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // BUFFER MANAGEMENT API
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * push
+ * top
+ */
+ inline virtual bool push(const Message & aMsg)
+ {
+ if( size() < capacity() )
+ {
+ mMessages.push_back(aMsg);
+
+ return( true );
+ }
+
+ return( false );
+ }
+
+
+ inline virtual bool top(const Message & aMsg)
+ {
+ if( nonempty() )
+ {
+ mMessages.back() = aMsg;
+
+ return( true );
+ }
+
+ return( false );
+ }
+
+ inline virtual const Message & top() const
+ {
+ if( nonempty() )
+ {
+ return( mMessages.back() );
+ }
+
+ return( Message::_NULL_ );
+ }
+
+ inline virtual const Message & top(avm_size_t mid,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) const
+ {
+ if( nonempty() && mMessages.back().isCompatible(mid, aReceiverRID) )
+ {
+ return( mMessages.back() );
+ }
+
+ return( Message::_NULL_ );
+ }
+
+
+ /**
+ * contains
+ * uncontains
+ */
+ inline virtual bool contains(ListOfInstanceOfPort & aSignalTrace,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) const
+ {
+ ListOfInstanceOfPort::const_iterator itSignal = aSignalTrace.begin();
+ ListOfInstanceOfPort::const_iterator endSignal = aSignalTrace.end();
+ ListOfMessage::const_reverse_iterator it = mMessages.rbegin();
+ ListOfMessage::const_reverse_iterator itEnd = mMessages.rend();
+ for( ; (it != itEnd) && (itSignal != endSignal) ; ++it )
+ {
+ if( (*it).isCompatible(*itSignal, aReceiverRID) )
+ {
+ ++itSignal;
+ }
+ }
+
+ return( itSignal == endSignal );
+ }
+
+
+ inline virtual bool uncontains(ListOfInstanceOfPort & aSignalTrace,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) const
+ {
+ ListOfInstanceOfPort::iterator itSignal = aSignalTrace.begin();
+ ListOfInstanceOfPort::iterator endSignal = aSignalTrace.end();
+ ListOfMessage::const_reverse_iterator it = mMessages.rbegin();
+ ListOfMessage::const_reverse_iterator itEnd = mMessages.rend();
+ for( ; (it != itEnd) && (itSignal != endSignal) ; ++it )
+ {
+ if( (*it).isCompatible(*itSignal, aReceiverRID) )
+ {
+ itSignal = aSignalTrace.erase( itSignal );
+ }
+ }
+
+ return( aSignalTrace.nonempty() );
+ }
+
+
+ /**
+ * pop
+ */
+ inline virtual Message pop()
+ {
+ if( nonempty() )
+ {
+ Message aMsg = mMessages.pop_last();
+
+ return( aMsg );
+ }
+
+ return( Message::_NULL_ );
+ }
+
+
+ inline virtual Message pop(avm_size_t mid,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL)
+ {
+ if( nonempty() )
+ {
+ Message aMsg = mMessages.back();
+ if( aMsg.isCompatible(mid, aReceiverRID) )
+ {
+ mMessages.pop_back();
+
+ return( aMsg );
+ }
+ }
+
+ return( Message::_NULL_ );
+ }
+
+
+
+ inline virtual void popBefore(const RuntimeID & aReceiverRID)
+ {
+ ListOfMessage::reverse_iterator it = mMessages.rbegin();
+ for( ; it != mMessages.rend() ; )
+ {
+ ++it;
+
+ if( (*it).isCompatible(aReceiverRID) )
+ {
+ mMessages.erase( it.base() );
+ }
+ }
+ }
+
+ inline virtual void popBefore(const ListOfInstanceOfPort & ieComs,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL)
+ {
+ ListOfMessage::reverse_iterator it = mMessages.rbegin();
+ for( ; it != mMessages.rend() ; )
+ {
+ ++it;
+
+ if( (*it).isCompatible(aReceiverRID) )
+ {
+ if( (*it).isCompatible(ieComs) )
+ {
+ break;
+ }
+ else
+ {
+ mMessages.erase( it.base() );
+ }
+ }
+ }
+ }
+
+ inline virtual void popBefore(const ListOfSizeT & ieComs,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL)
+ {
+ ListOfMessage::reverse_iterator it = mMessages.rbegin();
+ for( ; it != mMessages.rend() ; )
+ {
+ ++it;
+
+ if( (*it).isCompatible(aReceiverRID) )
+ {
+ if( (*it).isCompatible(ieComs) )
+ {
+ break;
+ }
+ else
+ {
+ mMessages.erase( it.base() );
+ }
+ }
+ }
+ }
+
+
+ /**
+ * copyTo
+ * restore
+ */
+ inline virtual void copyTo(BaseBufferForm & aBuffer) const
+ {
+ ListOfMessage::const_reverse_iterator it = mMessages.rbegin();
+ ListOfMessage::const_reverse_iterator itEnd = mMessages.rend();
+ for( ; it != itEnd ; ++it )
+ {
+ aBuffer.push( *it );
+ }
+ }
+
+ inline virtual void restore(ListOfMessage & listOfMessage)
+ {
+ while( listOfMessage.nonempty() )
+ {
+ mMessages.push_back( listOfMessage.back() );
+
+ listOfMessage.pop_back();
+ }
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* MULTILIFOBUFFER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/buffer/MultisetBuffer.cpp b/org.eclipse.efm.symbex/src/fml/buffer/MultisetBuffer.cpp
new file mode 100644
index 0000000..3d0b056
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/buffer/MultisetBuffer.cpp
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "MultisetBuffer.h"
+
+
+namespace sep
+{
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/buffer/MultisetBuffer.h b/org.eclipse.efm.symbex/src/fml/buffer/MultisetBuffer.h
new file mode 100644
index 0000000..15c6103
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/buffer/MultisetBuffer.h
@@ -0,0 +1,203 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef MULTISETBUFFER_H_
+#define MULTISETBUFFER_H_
+
+#include <fml/buffer/BaseBufferQueue.h>
+
+namespace sep
+{
+
+
+class MultisetBuffer : public BaseBufferQueue
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( MultisetBuffer )
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ MultisetBuffer(InstanceOfBuffer * aBuffer)
+ : BaseBufferQueue(CLASS_KIND_T( MultisetBuffer ), aBuffer)
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ MultisetBuffer(const MultisetBuffer & aMultiset )
+ : BaseBufferQueue( aMultiset )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * BUFFER MANAGEMENT
+ */
+ inline virtual bool push(const Message & aMsg)
+ {
+ if( size() < capacity() )
+ {
+ mMessages.push_back(aMsg);
+
+ return( true );
+ }
+
+ return( false );
+ }
+
+
+
+ inline virtual bool top(const Message & aMsg)
+ {
+ if( nonempty() )
+ {
+ mMessages.back() = aMsg;
+
+ return( true );
+ }
+
+ return( false );
+ }
+
+ inline virtual const Message & top() const
+ {
+ if( nonempty() )
+ {
+ return( mMessages.back() );
+ }
+
+ return( Message::_NULL_ );
+ }
+
+ inline virtual const Message & top(avm_size_t mid,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) const
+ {
+ ListOfMessage::const_iterator it = mMessages.begin();
+ ListOfMessage::const_iterator itEnd = mMessages.end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it).isCompatible(mid, aReceiverRID) )
+ {
+ return( (*it) );
+ }
+ }
+
+ return( Message::_NULL_ );
+ }
+
+
+
+ inline virtual Message pop()
+ {
+ if( nonempty() )
+ {
+ Message aMsg = mMessages.pop_last();
+
+ return( aMsg );
+ }
+
+ return( Message::_NULL_ );
+ }
+
+
+ inline virtual Message pop(avm_size_t mid,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL)
+ {
+ ListOfMessage::iterator it = mMessages.begin();
+ ListOfMessage::iterator itEnd = mMessages.end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it).isCompatible(mid, aReceiverRID) )
+ {
+ Message aMsg = (*it);
+
+ mMessages.erase(it);
+
+ return( aMsg );
+ }
+ }
+
+ return( Message::_NULL_ );
+ }
+
+
+ inline virtual void popBefore(const RuntimeID & aReceiverRID)
+ {
+ remove(aReceiverRID);
+ }
+
+ inline virtual void popBefore(const ListOfInstanceOfPort & ieComs,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL)
+ {
+ ListOfMessage::const_iterator it = mMessages.begin();
+ ListOfMessage::const_iterator itEnd = mMessages.end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it).isCompatible(ieComs, aReceiverRID) )
+ {
+ return;
+ }
+ }
+
+ remove(aReceiverRID);
+ }
+
+ inline virtual void popBefore(const ListOfSizeT & ieComs,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL)
+ {
+ ListOfMessage::const_iterator it = mMessages.begin();
+ ListOfMessage::const_iterator itEnd = mMessages.end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it).isCompatible(ieComs, aReceiverRID) )
+ {
+ return;
+ }
+ }
+
+ remove(aReceiverRID);
+ }
+
+
+ /**
+ * copyTo
+ * restore
+ */
+ inline virtual void copyTo(BaseBufferForm & aBuffer) const
+ {
+ ListOfMessage::const_iterator it = mMessages.begin();
+ ListOfMessage::const_iterator itEnd = mMessages.end();
+ for( ; it != itEnd ; ++it )
+ {
+ aBuffer.push( *it );
+ }
+ }
+
+ inline virtual void restore(ListOfMessage & listOfMessage)
+ {
+ mMessages.splice( listOfMessage );
+ }
+
+
+};
+
+}
+
+#endif /*MULTISETBUFFER_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/buffer/RamBuffer.cpp b/org.eclipse.efm.symbex/src/fml/buffer/RamBuffer.cpp
new file mode 100644
index 0000000..8e08f20
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/buffer/RamBuffer.cpp
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "RamBuffer.h"
+
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+
+void RamBuffer::toStream(OutStream & os) const
+{
+ os << TAB << "buffer ram "
+ << ( hasInstance() ? getInstance()->getFullyQualifiedNameID() : "_")
+ << " {";
+ AVM_DEBUG_REF_COUNTER(os);
+ os << EOL_INCR_INDENT;
+
+ if( nonempty() )
+ {
+ mMessage.toStream(os);
+ }
+
+ os << DECR_INDENT_TAB << "}" << EOL_FLUSH;
+}
+
+
+void RamBuffer::toFscn(OutStream & os,
+ const RuntimeID & aRID, const BaseBufferForm * prevBuf) const
+{
+ bool hasDifference = (prevBuf == NULL);
+
+ if( (not hasDifference)
+ && (prevBuf->classKind() == classKind())
+ && prevBuf->is< RamBuffer >() )
+ {
+ const RamBuffer* prev = prevBuf->to< RamBuffer >();
+ if(prev->mMessage!=mMessage)
+ {
+ hasDifference = true;
+ }
+ }
+
+ StringOutStream oss;
+
+ if( hasDifference )
+ {
+ if( nonempty() )
+ {
+ mMessage.toFscn(oss << AVM_STR_INDENT);
+ oss << END_INDENT;
+ }
+ else
+ {
+ oss << " ";
+ }
+
+ }
+
+ if( not oss.str().empty() )
+ {
+ std::string bufferkind;
+ switch( classKind() )
+ {
+ case FORM_BUFFER_RAM_KIND:
+ {
+ bufferkind = "RAM";
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+
+ os << TAB << ":pid#" << aRID.getRid() << ":" << "<"
+ << bufferkind << ">#" << getInstance()->getOffset() << "{";
+
+ if(oss.str().compare(" ")==0)
+ {
+ os << " }" << EOL_FLUSH;
+ }
+ else
+ {
+ os << oss.str() << " }" << EOL_FLUSH;
+ }
+ }
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/buffer/RamBuffer.h b/org.eclipse.efm.symbex/src/fml/buffer/RamBuffer.h
new file mode 100644
index 0000000..c5a79f7
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/buffer/RamBuffer.h
@@ -0,0 +1,333 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef RAMBUFFER_H_
+#define RAMBUFFER_H_
+
+#include <fml/buffer/BaseBufferForm.h>
+
+
+#include <fml/runtime/Message.h>
+
+
+namespace sep
+{
+
+
+class RuntimeID;
+
+
+
+class RamBuffer : public BaseBufferForm
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( RamBuffer )
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ Message mMessage;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ RamBuffer(InstanceOfBuffer * aBuffer)
+ : BaseBufferForm(CLASS_KIND_T( RamBuffer ), aBuffer),
+ mMessage( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ RamBuffer(const RamBuffer & aRam)
+ : BaseBufferForm( aRam ),
+ mMessage( aRam.mMessage )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ RamBuffer(class_kind_t aClassKind, InstanceOfBuffer * aBuffer)
+ : BaseBufferForm(aClassKind, aBuffer),
+ mMessage( )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~RamBuffer()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // BUFFER MANAGEMENT API
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * emptiness
+ * size
+ */
+ inline virtual bool empty() const
+ {
+ return( mMessage.invalid() );
+ }
+
+ inline virtual bool nonempty() const
+ {
+ return( mMessage.valid() );
+ }
+
+ inline virtual bool singleton()const
+ {
+ return( mMessage.valid() );
+ }
+
+ inline virtual bool populated()const
+ {
+ return( false );
+ }
+
+ inline virtual bool full() const
+ {
+ return( mMessage.valid() );
+ }
+
+ virtual avm_size_t size() const
+ {
+ return( mMessage.valid() ? 1 : 0 );
+ }
+
+ /**
+ * Comparison
+ * operator==
+ */
+ inline virtual bool equals(const BaseBufferForm & aBuffer) const
+ {
+ return( (this == &aBuffer)
+ || (aBuffer.is< RamBuffer >()
+ && mMessage.equals(
+ aBuffer.to< RamBuffer >()->mMessage ) ) );
+ }
+
+ /**
+ * clear
+ * resize
+ */
+ inline virtual void clear()
+ {
+ mMessage.destroy();
+ }
+
+
+ virtual void resize(avm_size_t newSize)
+ {
+ // NOTHING
+ }
+
+ inline virtual void resize(avm_size_t newSize, const Message & aMsg)
+ {
+ if( mMessage.invalid() )
+ {
+ mMessage = aMsg;
+ }
+ }
+
+
+ /**
+ * push
+ * top
+ */
+ inline virtual bool push(const Message & aMsg)
+ {
+ mMessage = aMsg;
+
+ return( true );
+ }
+
+
+ inline virtual bool top(const Message & aMsg)
+ {
+ mMessage = aMsg;
+
+ return( true );
+ }
+
+ inline virtual const Message & top() const
+ {
+ return( mMessage );
+ }
+
+ inline virtual const Message & top(avm_size_t mid,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) const
+ {
+ if( nonempty() && mMessage.isCompatible(mid, aReceiverRID) )
+ {
+ return( mMessage );
+ }
+
+ return( Message::_NULL_ );
+ }
+
+
+ /**
+ * contains
+ * uncontains
+ */
+ inline virtual bool contains(avm_size_t mid,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) const
+ {
+ return( nonempty() && mMessage.isCompatible(mid, aReceiverRID) );
+ }
+
+ inline virtual bool contains(InstanceOfPort * aSignal,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) const
+ {
+ return( nonempty() && mMessage.isCompatible(aSignal, aReceiverRID) );
+ }
+
+
+ inline virtual bool contains(ListOfInstanceOfPort & aSignalTrace,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) const
+ {
+ return( aSignalTrace.singleton() &&
+ contains(aSignalTrace.first(), aReceiverRID) );
+ }
+
+ inline virtual bool uncontains(ListOfInstanceOfPort & aSignalTrace,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) const
+ {
+ if( aSignalTrace.nonempty() &&
+ contains(aSignalTrace.first(), aReceiverRID) )
+ {
+ aSignalTrace.pop_first();
+ }
+
+ return( aSignalTrace.nonempty() );
+ }
+
+
+ /**
+ * pop
+ */
+ inline virtual Message pop()
+ {
+ return( mMessage );
+ }
+
+
+ inline virtual Message pop(avm_size_t mid,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL)
+ {
+ if( nonempty() && mMessage.isCompatible(mid, aReceiverRID) )
+ {
+ return( mMessage );
+ }
+
+ return( Message::_NULL_ );
+ }
+
+
+ inline virtual void popBefore(const RuntimeID & aReceiverRID)
+ {
+ if( mMessage.isCompatible(aReceiverRID) )
+ {
+ clear();
+ }
+ }
+
+ inline virtual void popBefore(const ListOfInstanceOfPort & ieComs,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL)
+ {
+ if( mMessage.isCompatible(aReceiverRID) )
+ {
+ if( not mMessage.isCompatible(ieComs) )
+ {
+ clear();
+ }
+ }
+ }
+
+ inline virtual void popBefore(const ListOfSizeT & ieComs,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL)
+ {
+ if( mMessage.isCompatible(aReceiverRID) )
+ {
+ if( not mMessage.isCompatible(ieComs) )
+ {
+ clear();
+ }
+ }
+ }
+
+
+ /**
+ * remove
+ * copyTo
+ * restore
+ */
+ inline virtual void remove(InstanceOfPort * aSignal)
+ {
+ if( mMessage.valid() &&
+ mMessage.isSignal(aSignal) )
+ {
+ mMessage.destroy();
+ }
+ }
+
+ inline virtual void copyTo(BaseBufferForm & aBuffer) const
+ {
+ if( mMessage.valid() )
+ {
+ aBuffer.push( mMessage );
+ }
+ }
+
+ inline virtual void restore(ListOfMessage & listOfMessage)
+ {
+ if( listOfMessage.nonempty() )
+ {
+ mMessage = listOfMessage.back();
+ }
+ }
+
+
+ /**
+ ***************************************************************************
+ * SERIALIZATION
+ ***************************************************************************
+ */
+ virtual void toStream(OutStream & os) const;
+
+ virtual void toFscn(OutStream & os, const RuntimeID & aRID,
+ const BaseBufferForm * prevBuf = NULL) const;
+
+};
+
+
+}
+
+#endif /*RAMBUFFER_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/buffer/SetBuffer.cpp b/org.eclipse.efm.symbex/src/fml/buffer/SetBuffer.cpp
new file mode 100644
index 0000000..042788d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/buffer/SetBuffer.cpp
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "SetBuffer.h"
+
+
+namespace sep
+{
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/buffer/SetBuffer.h b/org.eclipse.efm.symbex/src/fml/buffer/SetBuffer.h
new file mode 100644
index 0000000..91591aa
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/buffer/SetBuffer.h
@@ -0,0 +1,214 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef SETBUFFER_H_
+#define SETBUFFER_H_
+
+#include <fml/buffer/BaseBufferQueue.h>
+
+namespace sep
+{
+
+
+class SetBuffer : public BaseBufferQueue
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( SetBuffer )
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ SetBuffer(InstanceOfBuffer * aBuffer)
+ : BaseBufferQueue(CLASS_KIND_T( SetBuffer ), aBuffer)
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ SetBuffer(const SetBuffer & aSet )
+ : BaseBufferQueue( aSet )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * BUFFER MANAGEMENT
+ */
+ inline virtual bool push(const Message & aMsg)
+ {
+ if( size() < capacity() )
+ {
+ // Assume that is a set
+ ListOfMessage::const_iterator it = mMessages.begin();
+ ListOfMessage::const_iterator itEnd = mMessages.end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it).equals(aMsg) )
+ {
+ return( true );
+ }
+ }
+
+ mMessages.push_back(aMsg);
+
+ return( true );
+ }
+
+ return( false );
+ }
+
+
+
+ inline virtual bool top(const Message & aMsg)
+ {
+ if( nonempty() )
+ {
+ mMessages.back() = aMsg;
+
+ return( true );
+ }
+
+ return( false );
+ }
+
+ inline virtual const Message & top() const
+ {
+ if( nonempty() )
+ {
+ return( mMessages.back() );
+ }
+
+ return( Message::_NULL_ );
+ }
+
+ inline virtual const Message & top(avm_size_t mid,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL) const
+ {
+ ListOfMessage::const_iterator it = mMessages.begin();
+ ListOfMessage::const_iterator itEnd = mMessages.end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it).isCompatible(mid, aReceiverRID) )
+ {
+ return( (*it) );
+ }
+ }
+
+ return( Message::_NULL_ );
+ }
+
+
+ inline virtual Message pop()
+ {
+ if( nonempty() )
+ {
+ Message aMsg = mMessages.pop_last();
+
+ return( aMsg );
+ }
+
+ return( Message::_NULL_ );
+ }
+
+
+ inline virtual Message pop(avm_size_t mid,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL)
+ {
+ ListOfMessage::iterator it = mMessages.begin();
+ ListOfMessage::iterator itEnd = mMessages.end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it).isCompatible(mid, aReceiverRID) )
+ {
+ Message aMsg = (*it);
+
+ mMessages.erase(it);
+
+ return( aMsg );
+ }
+ }
+
+ return( Message::_NULL_ );
+ }
+
+
+ inline virtual void popBefore(const RuntimeID & aReceiverRID)
+ {
+ remove(aReceiverRID);
+ }
+
+ inline virtual void popBefore(const ListOfInstanceOfPort & ieComs,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL)
+ {
+ ListOfMessage::const_iterator it = mMessages.begin();
+ ListOfMessage::const_iterator itEnd = mMessages.end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it).isCompatible(ieComs, aReceiverRID) )
+ {
+ return;
+ }
+ }
+
+ remove(aReceiverRID);
+ }
+
+ inline virtual void popBefore(const ListOfSizeT & ieComs,
+ const RuntimeID & aReceiverRID = RuntimeID::REF_NULL)
+ {
+ ListOfMessage::const_iterator it = mMessages.begin();
+ ListOfMessage::const_iterator itEnd = mMessages.end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it).isCompatible(ieComs, aReceiverRID) )
+ {
+ return;
+ }
+ }
+
+ remove(aReceiverRID);
+ }
+
+
+ /**
+ * copyTo
+ * restore
+ */
+ inline virtual void copyTo(BaseBufferForm & aBuffer) const
+ {
+ ListOfMessage::const_iterator it = mMessages.begin();
+ ListOfMessage::const_iterator itEnd = mMessages.end();
+ for( ; it != itEnd ; ++it )
+ {
+ aBuffer.push( *it );
+ }
+ }
+
+ inline virtual void restore(ListOfMessage & listOfMessage)
+ {
+ mMessages.splice( listOfMessage );
+ }
+
+
+};
+
+
+}
+
+#endif /*SETBUFFER_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/builtin/Boolean.cpp b/org.eclipse.efm.symbex/src/fml/builtin/Boolean.cpp
new file mode 100644
index 0000000..c5294db
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/builtin/Boolean.cpp
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "Boolean.h"
+
+#include <common/BF.h>
+
+
+namespace sep
+{
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/builtin/Boolean.h b/org.eclipse.efm.symbex/src/fml/builtin/Boolean.h
new file mode 100644
index 0000000..a77d07b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/builtin/Boolean.h
@@ -0,0 +1,125 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef FML_EXPRESSION_BOOLEAN_H_
+#define FML_EXPRESSION_BOOLEAN_H_
+
+#include <fml/builtin/BuiltinForm.h>
+
+
+namespace sep
+{
+
+
+class Boolean :
+ public BuiltinForm,
+ public GenericBuiltinValue< bool , Boolean >
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( Boolean )
+
+
+private:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Boolean(bool aValue)
+ : BuiltinForm( CLASS_KIND_T( Boolean ) ),
+ GenericBuiltinValue( aValue )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ Boolean(const Boolean & aBoolean)
+ : BuiltinForm( aBoolean ),
+ GenericBuiltinValue( aBoolean )
+ {
+ //!! NOTHING
+ }
+
+
+public:
+ /**
+ * CREATOR
+ */
+ inline static Boolean * create(bool aValue)
+ {
+ return( new Boolean(aValue) );
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Boolean()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * VALUE TEST
+ */
+ inline virtual bool isEqualFalse() const
+ {
+ return( ! mValue );
+ }
+
+ inline virtual bool isNotEqualFalse() const
+ {
+ return( mValue );
+ }
+
+
+ inline virtual bool isEqualTrue() const
+ {
+ return( mValue );
+ }
+
+ inline virtual bool isNotEqualTrue() const
+ {
+ return( ! mValue );
+ }
+
+
+ /**
+ * Serialization
+ */
+ inline void toStream(OutStream & os) const
+ {
+ os << TAB << ( mValue ? "true" : "false" );
+ AVM_DEBUG_REF_COUNTER(os);
+ os << EOL << std::flush;
+ }
+
+ virtual std::string str() const
+ {
+ return( mValue ? "true" : "false" );
+ }
+
+ inline virtual std::string strNum(
+ avm_uint8_t precision = AVM_MUMERIC_PRECISION) const
+ {
+ return( mValue ? "true" : "false" );
+ }
+
+};
+
+
+}
+
+#endif /*FML_EXPRESSION_BOOLEAN_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/builtin/BuiltinForm.cpp b/org.eclipse.efm.symbex/src/fml/builtin/BuiltinForm.cpp
new file mode 100644
index 0000000..e3eb18b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/builtin/BuiltinForm.cpp
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "BuiltinForm.h"
+
+namespace sep
+{
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/builtin/BuiltinForm.h b/org.eclipse.efm.symbex/src/fml/builtin/BuiltinForm.h
new file mode 100644
index 0000000..c3426d2
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/builtin/BuiltinForm.h
@@ -0,0 +1,236 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef FML_EXPRESSION_BUILTIN_H_
+#define FML_EXPRESSION_BUILTIN_H_
+
+#include <common/Element.h>
+#include <common/AvmPointer.h>
+
+
+namespace sep
+{
+
+
+class BuiltinForm : public Element ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( BuiltinForm )
+{
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BuiltinForm(class_kind_t aClassKind)
+ : Element( aClassKind )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ BuiltinForm(const BuiltinForm & aBuiltin)
+ : Element( aBuiltin )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BuiltinForm()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * COMPARISON
+ * OPERATOR
+ */
+
+// virtual bool isEQ(const Element & bf) const = 0;
+//
+// virtual bool isNEQ(const Element & bf) const = 0;
+
+
+ /**
+ * SERIALIZATION
+ */
+ virtual void toStream(OutStream & os) const = 0;
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+
+};
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// GENERIC BUILTIN FORM
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+template< typename Value_T , class Class_T >
+class GenericBuiltinValue
+{
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ Value_T mValue;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ GenericBuiltinValue(Value_T aValue)
+ : mValue( aValue )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ GenericBuiltinValue(const GenericBuiltinValue & aBuiltin)
+ : mValue( aBuiltin.mValue )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~GenericBuiltinValue()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mValue
+ */
+ inline Value_T & getValue()
+ {
+ return( mValue );
+ }
+
+ inline const Value_T & getValue() const
+ {
+ return( mValue );
+ }
+
+ inline void setValue(Value_T aValue)
+ {
+ mValue = aValue;
+ }
+
+
+ /**
+ * COMPARISON
+ * OPERATOR
+ */
+ inline int compare(const Class_T & other) const
+ {
+ return( (mValue == other.mValue )? 0 :
+ ((mValue < other.mValue ) ? -1 : 1) );
+ }
+
+ inline bool operator==(const Class_T & other) const
+ {
+ return( mValue == other.mValue );
+ }
+
+ inline bool isEQ(const Class_T & other) const
+ {
+ return( mValue == other.mValue );
+ }
+
+ inline bool isNEQ(const Class_T & other) const
+ {
+ return( mValue != other.mValue );
+ }
+
+};
+
+
+
+template< class Class_T >
+class GenericBuiltinValueString :
+ public GenericBuiltinValue< std::string , Class_T >
+{
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ GenericBuiltinValueString(const std::string & aValue)
+ : GenericBuiltinValue< std::string , Class_T >( aValue )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ GenericBuiltinValueString(const GenericBuiltinValueString & aBuiltin)
+ : GenericBuiltinValue< std::string , Class_T >( aBuiltin )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~GenericBuiltinValueString()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * COMPARISON
+ * OPERATOR
+ */
+
+ inline int compare(const Class_T & other) const
+ {
+ return( GenericBuiltinValue< std::string , Class_T >::
+ mValue.compare( other.mValue ) );
+ }
+
+};
+
+
+}
+
+#endif /*FML_EXPRESSION_BUILTIN_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/builtin/Character.cpp b/org.eclipse.efm.symbex/src/fml/builtin/Character.cpp
new file mode 100644
index 0000000..d18bc05
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/builtin/Character.cpp
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "Character.h"
+
+namespace sep
+{
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/builtin/Character.h b/org.eclipse.efm.symbex/src/fml/builtin/Character.h
new file mode 100644
index 0000000..4aaddc9
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/builtin/Character.h
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef FML_EXPRESSION_CHARACTER_H_
+#define FML_EXPRESSION_CHARACTER_H_
+
+#include <fml/builtin/BuiltinForm.h>
+
+
+namespace sep
+{
+
+class Character :
+ public BuiltinForm,
+ public GenericBuiltinValue< char , Character >
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( Character )
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ char mQuoteChar;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Character(char aValue, char aQuote = '\'')
+ : BuiltinForm( CLASS_KIND_T( Character ) ),
+ GenericBuiltinValue( aValue ),
+ mQuoteChar( aQuote )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ Character(const Character & aCharacter)
+ : BuiltinForm( aCharacter ),
+ GenericBuiltinValue( aCharacter ),
+ mQuoteChar( aCharacter.mQuoteChar )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Character()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * Serialization
+ */
+ inline void toStream(OutStream & os) const
+ {
+ os << TAB << mQuoteChar << mValue << mQuoteChar;
+ AVM_DEBUG_REF_COUNTER(os);
+ os << EOL_FLUSH;
+ }
+
+ virtual std::string str() const
+ {
+ return( OSS() << mQuoteChar << mValue << mQuoteChar );
+ }
+
+ std::string strChar(char aQuote = '\'') const
+ {
+ return( OSS() << aQuote << mValue << aQuote );
+ }
+
+ inline virtual std::string strNum(
+ avm_uint8_t precision = AVM_MUMERIC_PRECISION) const
+ {
+ return( OSS() << mQuoteChar << mValue << mQuoteChar );
+ }
+
+};
+
+
+}
+
+#endif /*FML_EXPRESSION_CHARACTER_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/builtin/Identifier.cpp b/org.eclipse.efm.symbex/src/fml/builtin/Identifier.cpp
new file mode 100644
index 0000000..dc90537
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/builtin/Identifier.cpp
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "Identifier.h"
+
+namespace sep
+{
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/builtin/Identifier.h b/org.eclipse.efm.symbex/src/fml/builtin/Identifier.h
new file mode 100644
index 0000000..5d4c428
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/builtin/Identifier.h
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef FML_EXPRESSION_IDENTIFIER_H_
+#define FML_EXPRESSION_IDENTIFIER_H_
+
+#include <fml/builtin/BuiltinForm.h>
+
+
+namespace sep
+{
+
+class Identifier :
+ public BuiltinForm,
+ public GenericBuiltinValueString< Identifier >,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( Identifier )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( Identifier )
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Identifier(const std::string & aValue)
+ : BuiltinForm( CLASS_KIND_T( Identifier ) ),
+ GenericBuiltinValueString( aValue )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ Identifier(const Identifier & anIdentifier)
+ : BuiltinForm( anIdentifier ),
+ GenericBuiltinValueString( anIdentifier )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Identifier()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * Serialization
+ */
+ virtual void toStream(OutStream & os) const
+ {
+ os << TAB << mValue;
+ AVM_DEBUG_REF_COUNTER(os);
+ os << EOL_FLUSH;
+ }
+
+ virtual std::string str() const
+ {
+ return( mValue );
+ }
+
+ inline virtual std::string strNum(
+ avm_uint8_t precision = AVM_MUMERIC_PRECISION) const
+ {
+ return( mValue );
+ }
+
+
+
+};
+
+}
+
+#endif /*FML_EXPRESSION_IDENTIFIER_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/builtin/QualifiedIdentifier.cpp b/org.eclipse.efm.symbex/src/fml/builtin/QualifiedIdentifier.cpp
new file mode 100644
index 0000000..3849f7f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/builtin/QualifiedIdentifier.cpp
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "QualifiedIdentifier.h"
+
+
+namespace sep
+{
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/builtin/QualifiedIdentifier.h b/org.eclipse.efm.symbex/src/fml/builtin/QualifiedIdentifier.h
new file mode 100644
index 0000000..24898fc
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/builtin/QualifiedIdentifier.h
@@ -0,0 +1,178 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef FML_EXPRESSION_UFI_H_
+#define FML_EXPRESSION_UFI_H_
+
+#include <fml/builtin/BuiltinForm.h>
+
+#include <common/NamedElement.h>
+
+
+namespace sep
+{
+
+
+class QualifiedIdentifier :
+ public BuiltinForm,
+ public GenericBuiltinValueString< QualifiedIdentifier >,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( QualifiedIdentifier )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( QualifiedIdentifier )
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ bool mPositionalParameterFlag;
+
+ avm_offset_t mPositionOffset;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ QualifiedIdentifier(const std::string & aValue)
+ : BuiltinForm( CLASS_KIND_T( QualifiedIdentifier ) ),
+ GenericBuiltinValueString( aValue ),
+ mPositionalParameterFlag( false ),
+ mPositionOffset( 0 )
+ {
+ //!! NOTHING
+ }
+
+ QualifiedIdentifier(const std::string & aValue, avm_offset_t aPositionOffset)
+ : BuiltinForm( CLASS_KIND_T( QualifiedIdentifier ) ),
+ GenericBuiltinValueString( aValue ),
+ mPositionalParameterFlag( true ),
+ mPositionOffset( aPositionOffset )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ QualifiedIdentifier(const QualifiedIdentifier & aQID)
+ : BuiltinForm( aQID ),
+ GenericBuiltinValueString( aQID ),
+ mPositionalParameterFlag( aQID.mPositionalParameterFlag ),
+ mPositionOffset( aQID.mPositionOffset )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~QualifiedIdentifier()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONVERSION
+ */
+ std::string getLocator()
+ {
+ std::string::size_type sepPos = mValue.find(FQN_ID_ROOT_SEPARATOR);
+ if( sepPos != std::string::npos )
+ {
+ return( mValue.substr(0, sepPos) );
+ }
+ return( "" );
+ }
+
+ bool hasLocator()
+ {
+ return( mValue.find(FQN_ID_ROOT_SEPARATOR) != std::string::npos );
+ }
+
+
+ inline std::string getContainerQualifiedNameID()
+ {
+ return( NamedElement::getContainerQualifiedNameID(mValue) );
+ }
+
+ inline std::string getNameID()
+ {
+ return( NamedElement::extractNameID(mValue) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mPositionOffset
+ */
+ inline bool isPositionalParameter() const
+ {
+ return( mPositionalParameterFlag );
+ }
+
+ inline void sePositionalParameter(bool isPositionalParameter = true)
+ {
+ mPositionalParameterFlag = isPositionalParameter;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mPositionOffset
+ */
+ inline avm_offset_t getPositionOffset() const
+ {
+ return( mPositionOffset );
+ }
+
+ inline void sePositiontOffset(avm_offset_t aPositionOffset)
+ {
+ mPositionOffset = aPositionOffset;
+ }
+
+
+ /**
+ * Serialization
+ */
+ inline virtual void toStream(OutStream & os) const
+ {
+ os << TAB << mValue;
+ if( mPositionalParameterFlag )
+ {
+ os << ".$" << mPositionOffset;
+ }
+ AVM_DEBUG_REF_COUNTER(os);
+ os << EOL_FLUSH;
+ }
+
+ virtual std::string str() const
+ {
+ return( mValue );
+ }
+
+ inline virtual std::string strNum(
+ avm_uint8_t precision = AVM_MUMERIC_PRECISION) const
+ {
+ return( mValue );
+ }
+
+};
+
+
+}
+
+#endif /*FML_EXPRESSION_UFI_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/builtin/String.cpp b/org.eclipse.efm.symbex/src/fml/builtin/String.cpp
new file mode 100644
index 0000000..e4d53ab
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/builtin/String.cpp
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "String.h"
+
+
+namespace sep
+{
+
+
+/**
+ * GLOBALS
+ */
+char String::DEFAULT_DELIMITER = DOUBLE_QUOTE_DELIMITER;
+
+bool String::USE_BACKSLASH_QUOTE = false;
+
+const char String::BACKSLASH_CHAR = '\\';
+
+
+/**
+ * The empty string
+ * EMPTY
+ */
+BF String::_EMPTY_;
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/builtin/String.h b/org.eclipse.efm.symbex/src/fml/builtin/String.h
new file mode 100644
index 0000000..8539c71
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/builtin/String.h
@@ -0,0 +1,211 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef FML_EXPRESSION_STRING_H_
+#define FML_EXPRESSION_STRING_H_
+
+#include <fml/builtin/BuiltinForm.h>
+
+#include <common/BF.h>
+
+
+namespace sep
+{
+
+class String :
+ public BuiltinForm,
+ public GenericBuiltinValueString< String >
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( String )
+
+
+public:
+ /**
+ * GLOBALS
+ */
+ static const char DOUBLE_QUOTE_DELIMITER = '"';
+ static const char SINGLE_QUOTE_DELIMITER = '\'';
+
+ static char DEFAULT_DELIMITER;
+
+
+ static bool USE_BACKSLASH_QUOTE;
+
+ static const char BACKSLASH_CHAR;
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ char mQuoteChar;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ String(const std::string & aValue, char aQuote = DEFAULT_DELIMITER)
+ : BuiltinForm( CLASS_KIND_T( String ) ),
+ GenericBuiltinValueString( aValue ),
+ mQuoteChar( aQuote )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ String(const String & aString)
+ : BuiltinForm( aString ),
+ GenericBuiltinValueString( aString ),
+ mQuoteChar( aString.mQuoteChar )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~String()
+ {
+
+ }
+
+
+ /**
+ * mQuoteChar
+ */
+ inline char getQuoteChar() const
+ {
+ return mQuoteChar;
+ }
+
+
+ inline bool isDoubleQuote() const
+ {
+ return( mQuoteChar == DOUBLE_QUOTE_DELIMITER );
+ }
+
+ inline bool isSingleQuote() const
+ {
+ return( mQuoteChar == SINGLE_QUOTE_DELIMITER );
+ }
+
+
+ inline void setQuoteChar(char aQuoteChar)
+ {
+ mQuoteChar = aQuoteChar;
+ }
+
+
+ /**
+ * The empty string
+ * EMPTY
+ */
+ static BF _EMPTY_;
+
+
+ /**
+ * LOADER - DISPOSER
+ */
+ inline static void load()
+ {
+ _EMPTY_ = new String("");
+ }
+
+ inline static void dispose()
+ {
+ _EMPTY_.destroy();
+ }
+
+
+ /**
+ * CREATOR
+ */
+ inline static BF create(const std::string & aValue,
+ char aQuote = DEFAULT_DELIMITER)
+ {
+ return( aValue.empty() ? _EMPTY_ :
+ BF(new String(aValue, aQuote)) );
+ }
+
+
+ /**
+ * Operation
+ */
+ inline virtual avm_size_t size() const
+ {
+ return( mValue.size() );
+ }
+
+ /**
+ * Serialization
+ */
+ inline virtual void toStream(OutStream & os) const
+ {
+ if( mQuoteChar != '\0' )
+ {
+ if( USE_BACKSLASH_QUOTE )
+ {
+ os << TAB << String::BACKSLASH_CHAR << mQuoteChar
+ << mValue << String::BACKSLASH_CHAR << mQuoteChar;
+ }
+ else
+ {
+ os << TAB << mQuoteChar << mValue << mQuoteChar;
+ }
+ }
+ else
+ {
+ os << TAB << mValue;
+ }
+ AVM_DEBUG_REF_COUNTER(os);
+
+ os << EOL_FLUSH;
+ }
+
+ inline virtual std::string str() const
+ {
+ if( mQuoteChar != '\0' )
+ {
+ if( USE_BACKSLASH_QUOTE )
+ {
+ return( OSS() << String::BACKSLASH_CHAR << mQuoteChar
+ << mValue << String::BACKSLASH_CHAR << mQuoteChar );
+ }
+ else
+ {
+ return( OSS() << mQuoteChar << mValue << mQuoteChar );
+ }
+ }
+ else
+ {
+ return( mValue );
+ }
+ }
+
+ inline virtual std::string strNum(
+ avm_uint8_t precision = AVM_MUMERIC_PRECISION) const
+ {
+ return( str() );
+ }
+
+};
+
+
+}
+
+#endif /*FML_EXPRESSION_STRING_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/common/BasePointer.cpp b/org.eclipse.efm.symbex/src/fml/common/BasePointer.cpp
new file mode 100644
index 0000000..407f2cf
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/common/BasePointer.cpp
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 14 juin 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "BasePointer.h"
+
+namespace sep
+{
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/common/BasePointer.h b/org.eclipse.efm.symbex/src/fml/common/BasePointer.h
new file mode 100644
index 0000000..dfe30a4
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/common/BasePointer.h
@@ -0,0 +1,348 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 14 juin 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BASEPOINTER_H_
+#define BASEPOINTER_H_
+
+#include <common/BF.h>
+
+
+namespace sep
+{
+
+class Modifier;
+class ObjectElement;
+
+
+template< class ClassT >
+class BasePointer :
+// public AvmPointer< ClassT , DestroyElementPolicy >,
+ public BF
+
+{
+
+private:
+ /**
+ * TYPEDEF
+ */
+// typedef AvmPointer< ClassT , DestroyElementPolicy > base_this_type;
+ typedef BF base_this_type;
+
+protected:
+ typedef ClassT value_type;
+
+ typedef ClassT & reference;
+ typedef const ClassT & const_reference;
+
+
+ typedef ClassT * pointer;
+ typedef const ClassT * const_pointer;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BasePointer()
+ : base_this_type( )
+ {
+ //!!! NOTHING
+ }
+
+ explicit BasePointer(pointer ptr)
+ : base_this_type( ptr )
+ {
+ //!!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ BasePointer(const BasePointer & aPointer)
+ : base_this_type( aPointer )
+ {
+ //!! NOTHING
+ }
+
+ explicit BasePointer(const BF & aPointer)
+ : base_this_type( aPointer )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BasePointer()
+ {
+ //!!! NOTHING
+ }
+
+
+protected:
+ inline pointer raw_pointer() const
+ {
+ return( mPTR );
+ }
+
+ inline pointer ptrBase() const
+ {
+ return( static_cast< pointer >( mPTR ) );
+ }
+
+
+protected:
+ ////////////////////////////////////////////////////////////////////////////
+ // TYPE CAST
+ ////////////////////////////////////////////////////////////////////////////
+
+ // cast BF as specified pointer
+ template< class T >
+ inline T * as_ptr() const
+ {
+ // previous:> AVM_OS_ASSERT_WARNING_ALERT
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "raw_pointer in BasePointer::as_ptr< T >() !!!"
+ << SEND_EXIT;
+
+ return( (mPTR != NULL) ? mPTR->as< T >() : NULL );
+ }
+
+ template< class T >
+ inline T * to_ptr() const
+ {
+ return( mPTR->to< T >() );
+ }
+
+
+ // cast BF as specified reference
+ template< class T >
+ inline T & as_ref()
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "raw_pointer in BasePointer::as_ref< T >() !!!"
+ << SEND_EXIT;
+
+ return( *( mPTR->as< T >() ) );
+ }
+
+ template< class T >
+ inline const T & as_ref() const
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "raw_pointer in BasePointer::as_ref< T >() !!!"
+ << SEND_EXIT;
+
+ return( *( mPTR->as< T >() ) );
+ }
+
+
+ // cast BF as derived BF
+ template< class T >
+ inline T & as_bf()
+ {
+ return( static_cast< T & >( *this ) );
+ }
+
+ template< class T >
+ inline const T & as_bf() const
+ {
+ return( static_cast< const T & >( *this ) );
+ }
+
+
+
+protected:
+ /**
+ * CAST
+ */
+ inline operator pointer () const
+ {
+ return( ptrBase() );
+ }
+
+ /**
+ * OPERATORS
+ */
+ inline pointer operator-> () const
+ {
+ return( ptrBase() );
+ }
+
+
+public:
+ /**
+ * ASSIGNMENT
+ * BF
+ */
+
+ inline bool operator==(const_pointer aPtr) const
+ {
+ return( base_this_type::mPTR == aPtr );
+ }
+
+ inline bool operator==(pointer aPtr) const
+ {
+ return( base_this_type::mPTR == aPtr );
+ }
+
+ inline bool operator==(const BasePointer & other) const
+ {
+ return( base_this_type::mPTR == other.mPTR );
+ }
+
+
+ inline bool operator!=(const_pointer aPtr) const
+ {
+ return( base_this_type::mPTR != aPtr );
+ }
+
+ inline bool operator!=(const BasePointer & other) const
+ {
+ return( base_this_type::mPTR != other.mPTR );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // BaseCompiledForm
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * GETTER
+ * modifier of a USER FORM
+ */
+ inline virtual const Modifier & getModifier() const
+ {
+ return( ptrBase()->getModifier() );
+ }
+
+ inline virtual Modifier & getwModifier()
+ {
+ return( ptrBase()->getwModifier() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * theCompiledForm
+ */
+ inline const ObjectElement * getAstElement() const
+ {
+ return( ptrBase()->getAstElement() );
+ }
+
+ inline bool isAstElement(const ObjectElement * astElement) const
+ {
+ return( ptrBase()->isAstElement( astElement ) );
+ }
+
+ inline bool hasAstElement() const
+ {
+ return( ptrBase()->hasAstElement() );
+ }
+
+ inline std::string getAstFullyQualifiedNameID() const
+ {
+ return( ptrBase()->getAstFullyQualifiedNameID() );
+ }
+
+ inline std::string getAstNameID() const
+ {
+ return( ptrBase()->getAstNameID() );
+ }
+
+ /**
+ * GETTER - SETTER
+ * mFullyQualifiedNameID
+ */
+ inline std::string getFullyQualifiedNameID() const
+ {
+ return( ptrBase()->getFullyQualifiedNameID() );
+ }
+
+ inline bool hasFullyQualifiedNameID() const
+ {
+ return( ptrBase()->hasFullyQualifiedNameID() );
+ }
+
+ inline void setFullyQualifiedNameID(const std::string & aFQN_ID)
+ {
+ ptrBase()->setFullyQualifiedNameID( aFQN_ID );
+ }
+
+ inline void updateFullyQualifiedNameID()
+ {
+ ptrBase()->updateFullyQualifiedNameID();
+ }
+
+ inline bool fqnEquals(const std::string & aFullyQualifiedNameID,
+ bool enabledOnlyLocationComparisonElse = false) const
+ {
+ return( ptrBase()->fqnEquals(aFullyQualifiedNameID,
+ enabledOnlyLocationComparisonElse) );
+ }
+
+ inline bool fqnEndsWith(const std::string & aQualifiedNameID) const
+ {
+ return( ptrBase()->fqnEndsWith(aQualifiedNameID) );
+ }
+
+ /**
+ * GETTER - SETTER
+ * theId
+ */
+ inline std::string getNameID() const
+ {
+ return( ptrBase()->getNameID() );
+ }
+
+ inline bool hasNameID() const
+ {
+ return( ptrBase()->hasNameID() );
+ }
+
+ inline void setNameID(const std::string & aNameID)
+ {
+ ptrBase()->setNameID( aNameID );
+ }
+
+ void updateNameID()
+ {
+ ptrBase()->updateNameID();
+ }
+
+ inline void setAllNameID(const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID)
+ {
+ ptrBase()->setAllNameID( aFullyQualifiedNameID , aNameID );
+ }
+
+ inline void setAllNameID(const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID, const std::string & name)
+ {
+ ptrBase()->setAllNameID( aFullyQualifiedNameID , aNameID , name );
+ }
+
+};
+
+
+
+} /* namespace sep */
+
+#endif /* BASEPOINTER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/common/BehavioralElement.cpp b/org.eclipse.efm.symbex/src/fml/common/BehavioralElement.cpp
new file mode 100644
index 0000000..d7433fd
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/common/BehavioralElement.cpp
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 21 févr. 2017
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#include "BehavioralElement.h"
+
+
+namespace sep
+{
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/common/BehavioralElement.h b/org.eclipse.efm.symbex/src/fml/common/BehavioralElement.h
new file mode 100644
index 0000000..06d5b54
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/common/BehavioralElement.h
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 21 févr. 2017
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#ifndef FML_COMMON_BEHAVIORAL_ELEMENT_H_
+#define FML_COMMON_BEHAVIORAL_ELEMENT_H_
+
+#include <fml/common/ObjectElement.h>
+
+#include <base/ClassKindInfo.h>
+
+
+namespace sep
+{
+
+
+class BehavioralElement :
+ public ObjectElement,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( BehavioralElement )
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BehavioralElement(class_kind_t aClassKind, BehavioralElement * aContainer)
+ : ObjectElement( aClassKind , aContainer )
+ {
+ //!! NOTHING
+ }
+
+ BehavioralElement(class_kind_t aClassKind, BehavioralElement * aContainer,
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID,
+ const std::string & anUnrestrictedName)
+ : ObjectElement( aClassKind , aContainer , aFullyQualifiedNameID,
+ aNameID , anUnrestrictedName)
+ {
+ //!! NOTHING
+ }
+
+ BehavioralElement(class_kind_t aClassKind,
+ ObjectElement * aContainer, const std::string & aNameID)
+ : ObjectElement( aClassKind , aContainer , aNameID )
+ {
+ //!! NOTHING
+ }
+
+ BehavioralElement(class_kind_t aClassKind, BehavioralElement * aContainer,
+ const Modifier & aModifier, const std::string & aNameID)
+ : ObjectElement( aClassKind , aContainer , aModifier , aNameID )
+ {
+ //!! NOTHING
+ }
+
+ BehavioralElement(class_kind_t aClassKind,
+ BehavioralElement * aContainer, const BehavioralElement & aPattern)
+ : ObjectElement( aClassKind , aContainer , aPattern )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BehavioralElement()
+ {
+ //!! NOTHING
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* FML_COMMON_BEHAVIORAL_ELEMENT_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/common/CompiledElement.cpp b/org.eclipse.efm.symbex/src/fml/common/CompiledElement.cpp
new file mode 100644
index 0000000..74ffee3
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/common/CompiledElement.cpp
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mars 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "CompiledElement.h"
+
+
+namespace sep
+{
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/common/CompiledElement.h b/org.eclipse.efm.symbex/src/fml/common/CompiledElement.h
new file mode 100644
index 0000000..82aea64
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/common/CompiledElement.h
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 mars 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef FML_COMMON_COMPILEDELEMENT_H_
+#define FML_COMMON_COMPILEDELEMENT_H_
+
+
+namespace sep
+{
+
+
+class CompiledElement
+{
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ bool mCompiledFlag;
+
+ bool mOptimizedFlag;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ CompiledElement()
+ : mCompiledFlag( false ),
+ mOptimizedFlag( false )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ CompiledElement(const CompiledElement & anElement)
+ : mCompiledFlag( anElement.mCompiledFlag ),
+ mOptimizedFlag( anElement.mOptimizedFlag )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~CompiledElement()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mCompiledFlag
+ */
+ inline bool isCompiled() const
+ {
+ return( mCompiledFlag );
+ }
+
+ inline void setCompiled(bool isCompiled = true)
+ {
+ mCompiledFlag = isCompiled;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mOptimizedFlag
+ */
+ inline bool isOptimized() const
+ {
+ return( mOptimizedFlag );
+ }
+
+ inline void setOptimized(bool isOptimized = true)
+ {
+ mOptimizedFlag = isOptimized;
+ }
+
+ /**
+ * GETTER - SETTER
+ * mCompiledFlag
+ * mOptimizedFlag
+ */
+ inline void setCompiledOptimized(bool isCompiled, bool isOptimized)
+ {
+ setCompiled( isCompiled );
+
+ setOptimized( isOptimized );
+ }
+
+
+};
+
+
+} /* namespace sep */
+
+#endif /* FML_COMMON_COMPILEDELEMENT_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/common/LocationElement.cpp b/org.eclipse.efm.symbex/src/fml/common/LocationElement.cpp
new file mode 100644
index 0000000..541399f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/common/LocationElement.cpp
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 18 sept. 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "LocationElement.h"
+
+namespace sep
+{
+
+
+std::string LocationElement::mLastReportFileLocation = "";
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/common/LocationElement.h b/org.eclipse.efm.symbex/src/fml/common/LocationElement.h
new file mode 100644
index 0000000..e053bbc
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/common/LocationElement.h
@@ -0,0 +1,409 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 18 sept. 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef LOCATIONELEMENT_H_
+#define LOCATIONELEMENT_H_
+
+#include <printer/OutStream.h>
+
+
+namespace sep
+{
+
+
+class LocationElement
+{
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ static std::string mLastReportFileLocation;
+
+ std::string mFileLocation;
+
+ std::size_t mBeginLine;
+
+ std::size_t mEndLine;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ LocationElement()
+ : mFileLocation( ),
+ mBeginLine( 0 ),
+ mEndLine( 0 )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ LocationElement(const LocationElement & anElement)
+ : mFileLocation( anElement.mFileLocation ),
+ mBeginLine( anElement.mBeginLine ),
+ mEndLine( anElement.mEndLine )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ LocationElement(const std::string & aFileLocation,
+ const std::size_t aBeginLine, const std::size_t anEndLine)
+ : mFileLocation( aFileLocation ),
+ mBeginLine( aBeginLine ),
+ mEndLine( anEndLine )
+ {
+ //!! NOTHING
+ }
+
+ LocationElement(const std::string & aFileLocation, const std::size_t aLine)
+ : mFileLocation( aFileLocation ),
+ mBeginLine( aLine ),
+ mEndLine( aLine )
+ {
+ //!! NOTHING
+ }
+
+ LocationElement(const std::size_t aBeginLine, const std::size_t anEndLine)
+ : mFileLocation( ),
+ mBeginLine( aBeginLine ),
+ mEndLine( anEndLine )
+ {
+ //!! NOTHING
+ }
+
+ LocationElement(const std::size_t aLine)
+ : mFileLocation( ),
+ mBeginLine( aLine ),
+ mEndLine( aLine )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ */
+ virtual ~LocationElement()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mFileLocation
+ */
+ inline const std::string & getFileLocation() const
+ {
+ return( mFileLocation );
+ }
+
+ inline bool hasFileLocation() const
+ {
+ return( ! (mFileLocation.empty()) );
+ }
+
+ inline void setFileLocation(const std::string & aFileLocation)
+ {
+ mFileLocation = aFileLocation;
+ }
+
+
+ inline OutStream & reportFileLocation(OutStream & os) const
+ {
+// if( mFileLocation != mLastReportFileLocation )
+// {
+// os << mFileLocation std::endl;
+//
+// mLastReportFileLocation = mFileLocation;
+// }
+
+ os << mFileLocation << ":";
+
+ return( os );
+ }
+
+ inline PairOutStream & reportFileLocation(PairOutStream & os) const
+ {
+// if( mFileLocation != mLastReportFileLocation )
+// {
+// os << mFileLocation std::endl;
+//
+// mLastReportFileLocation = mFileLocation;
+// }
+
+ os << mFileLocation << ":";
+
+ return( os );
+ }
+
+ inline TripleOutStream & reportFileLocation(TripleOutStream & os) const
+ {
+// if( mFileLocation != mLastReportFileLocation )
+// {
+// os << mFileLocation std::endl;
+//
+// mLastReportFileLocation = mFileLocation;
+// }
+
+ os << mFileLocation << ":";
+
+ return( os );
+ }
+
+
+
+ /**
+ * GETTER - SETTER
+ * mBeginLine
+ */
+ inline std::size_t getBeginLine() const
+ {
+ return( mBeginLine );
+ }
+
+ inline bool hasBeginLine() const
+ {
+ return( mBeginLine > 0 );
+ }
+
+ inline void setBeginLine(const std::size_t aBeginLine)
+ {
+ mBeginLine = aBeginLine;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mEndLine
+ */
+ inline std::size_t getEndLine() const
+ {
+ return( mEndLine );
+ }
+
+ inline bool hasEndLine() const
+ {
+ return( mEndLine > 0 );
+ }
+
+ inline void setEndLine(const std::size_t anEndLine)
+ {
+ mEndLine = anEndLine;
+ }
+
+
+ /**
+ * SETTER
+ * mFileLocation
+ * mBeginLine
+ * mEndLine
+ */
+ inline void setLocation(const LocationElement & anElement)
+ {
+ mFileLocation = anElement.mFileLocation;
+
+ mBeginLine = anElement.mBeginLine;
+ mEndLine = anElement.mEndLine;
+ }
+
+ inline void setLocation(const std::string & aFileLocation,
+ const std::size_t aBeginLine, const std::size_t anEndLine)
+ {
+ mFileLocation = aFileLocation;
+
+ mBeginLine = aBeginLine;
+ mEndLine = anEndLine;
+ }
+
+ inline void setLocation(const std::string & aFileLocation,
+ const std::size_t aLine)
+ {
+ mFileLocation = aFileLocation;
+
+ mEndLine = mBeginLine = aLine;
+ }
+
+
+ inline void setLine(const std::size_t aBeginLine, const std::size_t anEndLine)
+ {
+ mBeginLine = aBeginLine;
+ mEndLine = anEndLine;
+ }
+
+ inline void setLine(const std::size_t aLine)
+ {
+ mEndLine = mBeginLine = aLine;
+ }
+
+
+ /**
+ ***************************************************************************
+ * SERIALIZATION
+ ***************************************************************************
+ */
+ inline std::string strLine() const
+ {
+ std::ostringstream oss;
+
+ if( mBeginLine != mEndLine )
+ {
+ oss << /*"line " <<*/ mBeginLine << " -> " << mEndLine;
+ }
+ else
+ {
+ oss << /*"line " <<*/ mBeginLine;
+ }
+
+ return( oss.str() );
+ }
+
+
+ inline std::string traceLine(
+ const std::string tab, bool singleLineComment = true) const
+ {
+ std::ostringstream oss(tab);
+
+ if( singleLineComment )
+ {
+ oss << "// " << strLine();
+ }
+ else
+ {
+ oss << "/*" << strLine() << "*/";
+ }
+
+ return( oss.str() );
+ }
+
+
+ inline std::string fatalErrorLocation() const
+ {
+ StringOutStream oss;
+
+ fatalErrorLocation(oss);
+
+ return( oss.str() );
+ }
+
+ inline OutStream & fatalErrorLocation(OutStream & os) const
+ {
+ reportFileLocation(os)
+ << strLine() << EOL_TAB << "Fatal error:> " << std::flush;
+
+ return( os );
+ }
+
+ inline PairOutStream & fatalErrorLocation(PairOutStream & os) const
+ {
+ reportFileLocation(os)
+ << strLine() << EOL_TAB << "Fatal error:> " << std::flush;
+
+ return( os );
+ }
+
+ inline TripleOutStream & fatalErrorLocation(TripleOutStream & os) const
+ {
+ reportFileLocation(os)
+ << strLine() << EOL_TAB << "Fatal error:> " << std::flush;
+
+ return( os );
+ }
+
+
+ inline std::string errorLocation() const
+ {
+ StringOutStream oss;
+
+ errorLocation(oss);
+
+ return( oss.str() );
+ }
+
+ inline OutStream & errorLocation(OutStream & os) const
+ {
+ reportFileLocation(os)
+ << strLine() << EOL_TAB << "Error:> " << std::flush;
+
+ return( os );
+ }
+
+ inline PairOutStream & errorLocation(PairOutStream & os) const
+ {
+ reportFileLocation(os)
+ << strLine() << EOL_TAB << "Error:> " << std::flush;
+
+ return( os );
+ }
+
+ inline TripleOutStream & errorLocation(TripleOutStream & os) const
+ {
+ reportFileLocation(os)
+ << strLine() << EOL_TAB << "Error:> " << std::flush;
+
+ return( os );
+ }
+
+
+ inline std::string warningLocation() const
+ {
+ StringOutStream oss;
+
+ warningLocation(oss);
+
+ return( oss.str() );
+ }
+
+ inline OutStream & warningLocation(OutStream & os) const
+ {
+ reportFileLocation(os)
+ << strLine() << EOL_TAB << "Warning:> " << std::flush;
+
+ return( os );
+ }
+
+ inline PairOutStream & warningLocation(PairOutStream & os) const
+ {
+ reportFileLocation(os)
+ << strLine() << EOL_TAB << "Warning:> " << std::flush;
+
+ return( os );
+ }
+
+ inline TripleOutStream & warningLocation(TripleOutStream & os) const
+ {
+ reportFileLocation(os)
+ << strLine() << EOL_TAB << "Warning:> " << std::flush;
+
+ return( os );
+ }
+
+};
+
+
+}
+
+#endif /* LOCATIONELEMENT_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/common/ModifierElement.cpp b/org.eclipse.efm.symbex/src/fml/common/ModifierElement.cpp
new file mode 100644
index 0000000..132048a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/common/ModifierElement.cpp
@@ -0,0 +1,382 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 18 mars 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ModifierElement.h"
+
+#include <sstream>
+
+#include <util/avm_string.h>
+
+
+namespace sep
+{
+
+/**
+ * PROPERTY MODIFIER
+ */
+Modifier Modifier::PROPERTY_UNDEFINED_MODIFIER;
+
+/**
+ * VISIBILITY
+ */
+Modifier Modifier::PROPERTY_PUBLIC_MODIFIER(
+ VISIBILITY_PUBLIC_KIND,
+ DIRECTION_UNDEFINED_KIND,
+ NATURE_UNDEFINED_KIND,
+ FEATURE_UNDEFINED_KIND
+);
+
+Modifier Modifier::PROPERTY_PROTECTED_MODIFIER(
+ VISIBILITY_PROTECTED_KIND,
+ DIRECTION_UNDEFINED_KIND,
+ NATURE_UNDEFINED_KIND,
+ FEATURE_UNDEFINED_KIND
+);
+
+Modifier Modifier::PROPERTY_PRIVATE_MODIFIER(
+ VISIBILITY_PRIVATE_KIND,
+ DIRECTION_UNDEFINED_KIND,
+ NATURE_UNDEFINED_KIND,
+ FEATURE_UNDEFINED_KIND
+);
+
+
+/**
+ * DIRECTION
+ */
+Modifier Modifier::PROPERTY_INOUT_DIRECTION(
+ VISIBILITY_UNDEFINED_KIND,
+ DIRECTION_INOUT_KIND,
+ NATURE_UNDEFINED_KIND,
+ FEATURE_UNDEFINED_KIND
+);
+
+/**
+ * NATURE
+ */
+Modifier Modifier::PROPERTY_MACRO_MODIFIER(
+ VISIBILITY_PRIVATE_KIND,
+ DIRECTION_UNDEFINED_KIND,
+ NATURE_MACRO_KIND,
+ FEATURE_UNDEFINED_KIND
+);
+
+
+
+/**
+ * ALIAS
+ */
+Modifier Modifier::PROPERTY_PUBLIC_VOLATILE_MODIFIER(
+ VISIBILITY_PUBLIC_KIND,
+ DIRECTION_UNDEFINED_KIND,
+ NATURE_UNDEFINED_KIND,
+ FEATURE_VOLATILE_KIND
+);
+
+Modifier Modifier::PROPERTY_PUBLIC_FINAL_STATIC_MODIFIER(
+ VISIBILITY_PUBLIC_KIND,
+ DIRECTION_UNDEFINED_KIND,
+ NATURE_UNDEFINED_KIND,
+ FEATURE_FINAL_KIND | FEATURE_STATIC_KIND
+);
+
+
+Modifier Modifier::PARAMETER_PUBLIC_FINAL_STATIC_MODIFIER(
+ VISIBILITY_PUBLIC_KIND,
+ DIRECTION_UNDEFINED_KIND,
+ NATURE_PARAMETER_KIND,
+ FEATURE_FINAL_KIND | FEATURE_STATIC_KIND
+);
+
+
+/**
+ * [ DIRECTION ] PARAMETER
+ */
+Modifier Modifier::PROPERTY_PARAMETER_MODIFIER(
+ VISIBILITY_PRIVATE_KIND,
+ DIRECTION_UNDEFINED_KIND,
+ NATURE_PARAMETER_KIND,
+ FEATURE_UNDEFINED_KIND
+);
+
+Modifier Modifier::PROPERTY_INPUT_PARAMETER_MODIFIER(
+ VISIBILITY_PRIVATE_KIND,
+ DIRECTION_INPUT_KIND,
+ NATURE_PARAMETER_KIND,
+ FEATURE_UNDEFINED_KIND
+);
+
+Modifier Modifier::PROPERTY_OUTPUT_PARAMETER_MODIFIER(
+ VISIBILITY_PRIVATE_KIND,
+ DIRECTION_OUTPUT_KIND,
+ NATURE_PARAMETER_KIND,
+ FEATURE_UNDEFINED_KIND
+);
+
+Modifier Modifier::PROPERTY_INOUT_PARAMETER_MODIFIER(
+ VISIBILITY_PRIVATE_KIND,
+ DIRECTION_INOUT_KIND,
+ NATURE_PARAMETER_KIND,
+ FEATURE_UNDEFINED_KIND
+);
+
+Modifier Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER(
+ VISIBILITY_PRIVATE_KIND,
+ DIRECTION_RETURN_KIND,
+ NATURE_PARAMETER_KIND,
+ FEATURE_UNDEFINED_KIND
+);
+
+
+/**
+ * [ BIND ] PARAMETER
+ */
+Modifier Modifier::PROPERTY_PARAMETER_BIND_MODIFIER(
+ VISIBILITY_PRIVATE_KIND,
+ DIRECTION_UNDEFINED_KIND,
+ NATURE_PARAMETER_BIND_KIND,
+ FEATURE_UNDEFINED_KIND
+);
+
+
+/**
+ * VISIBILITY KIND to STRING
+ */
+std::string Modifier::strVisibility(
+ bit_field_t visibilityKind, const std::string & separator)
+{
+ switch( visibilityKind )
+ {
+// case VISIBILITY_UNDEFINED_KIND:
+// return( "<visibility:undef>" + separator );
+ case VISIBILITY_PRIVATE_KIND:
+// return( "private" + separator );
+ return( "" );
+ case VISIBILITY_PUBLIC_KIND:
+ return( "public" + separator );
+ case VISIBILITY_PROTECTED_KIND:
+ return( "protected" + separator );
+ case VISIBILITY_PACKAGE_KIND:
+ return( "package" + separator );
+
+ default:
+ return( xstrVisibility(visibilityKind, separator) );
+ }
+}
+
+
+std::string Modifier::xstrVisibility(
+ bit_field_t visibilityKind, const std::string & separator)
+{
+ if( (visibilityKind != VISIBILITY_UNDEFINED_KIND) )
+// && (visibilityKind != VISIBILITY_PRIVATE_KIND) )
+ {
+ std::ostringstream oss;
+
+ if( (visibilityKind & VISIBILITY_PACKAGE_KIND) ==
+ VISIBILITY_PACKAGE_KIND )
+ {
+ oss << "package" << separator;
+ }
+ else if( (visibilityKind & VISIBILITY_PUBLIC_KIND) != 0 )
+ {
+ oss << "public" << separator;
+ }
+ else if( (visibilityKind & VISIBILITY_PROTECTED_KIND) != 0 )
+ {
+ oss << "protected" << separator;
+ }
+
+ return( oss.str() );
+ }
+
+ return( "<visibility:undef>" );
+}
+
+
+/**
+ * DIRECTION KIND to STRING
+ */
+std::string Modifier::strDirection(
+ bit_field_t directionKind, const std::string & separator)
+{
+ switch( directionKind )
+ {
+ case DIRECTION_UNDEFINED_KIND:
+ return( "" );
+
+ case DIRECTION_INPUT_KIND:
+ return( "input" + separator );
+ case DIRECTION_OUTPUT_KIND:
+ return( "output" + separator );
+ case DIRECTION_INOUT_KIND:
+ return( "inout" + separator );
+ case DIRECTION_RETURN_KIND:
+ return( "return" + separator );
+
+ default:
+ return( xstrDirection(directionKind, separator) );
+ }
+}
+
+std::string Modifier::xstrDirection(
+ bit_field_t directionKind, const std::string & separator)
+{
+ if( (directionKind != DIRECTION_UNDEFINED_KIND) )
+ {
+ std::ostringstream oss;
+
+ if( (directionKind & DIRECTION_RETURN_KIND) != 0 )
+ {
+ oss << "return" << separator;
+ }
+
+ if( (directionKind & DIRECTION_INOUT_KIND) == DIRECTION_INOUT_KIND )
+ {
+ oss << "inout" << separator;
+ }
+ else if( (directionKind & DIRECTION_INPUT_KIND) != 0 )
+ {
+ oss << "input" << separator;
+ }
+ else if( (directionKind & DIRECTION_OUTPUT_KIND) != 0 )
+ {
+ oss << "output" << separator;
+ }
+
+ return( oss.str() );
+ }
+
+ return( "<direction:undef>" );
+}
+
+
+Modifier::DIRECTION_KIND Modifier::toDirectionKind(const std::string & id)
+{
+ if( id == "inout" ) return DIRECTION_INOUT_KIND;
+ if( id == "input" ) return DIRECTION_INPUT_KIND;
+ if( id == "output" ) return DIRECTION_OUTPUT_KIND;
+
+ return DIRECTION_UNDEFINED_KIND;
+}
+
+
+/**
+ * FEATURE KIND to STRING
+ */
+std::string Modifier::strFeature(
+ bit_field_t featureKind, const std::string & separator)
+{
+ if( featureKind != FEATURE_UNDEFINED_KIND )
+ {
+ std::ostringstream oss;
+
+ if( (featureKind & FEATURE_FINAL_KIND) != 0 )
+ {
+ oss << "final" << separator;
+ }
+ if( (featureKind & FEATURE_STATIC_KIND) != 0 )
+ {
+ oss << "static" << separator;
+ }
+ if( (featureKind & FEATURE_TRANSIENT_KIND) != 0 )
+ {
+ oss << "transient" << separator;
+ }
+ if( (featureKind & FEATURE_VOLATILE_KIND) != 0 )
+ {
+ oss << "volatile" << separator;
+ }
+ if( (featureKind & FEATURE_UNSAFE_KIND) != 0 )
+ {
+ oss << "unsafe" << separator;
+ }
+
+ return( oss.str() );
+ }
+
+ return( "" /*"<feature:undef>"*/ );
+}
+
+
+/**
+ * NATURE KIND to STRING
+ */
+std::string Modifier::strNature(
+ bit_field_t nature, const std::string & separator)
+{
+ if( (nature != NATURE_UNDEFINED_KIND) )
+// && (nature != NATURE_VARIABLE_KIND) )
+ {
+ std::ostringstream oss;
+
+ if( (nature & NATURE_REFERENCE_KIND) != 0 )
+ {
+ oss << "reference" << separator;
+ }
+ if( (nature & NATURE_MACRO_KIND) != 0 )
+ {
+ oss << "macro" << separator;
+ }
+ if( (nature & NATURE_BIND_KIND) != 0 )
+ {
+ oss << "bind" << separator;
+ }
+
+ if( (nature & NATURE_PARAMETER_KIND) != 0 )
+ {
+ oss << "parameter" << separator;
+ }
+
+ return( oss.str() );
+ }
+
+ return( "" /*"<nature:undef>"*/ );
+}
+
+
+/**
+ * Serialization
+ */
+std::string Modifier::toString(bit_field_t enabledFields,
+ const std::string & separator) const
+{
+ std::ostringstream oss;
+
+ if( (enabledFields & FIELD_VISIBILITY_POSITION) != 0 )
+ {
+ oss << Modifier::strVisibility( visibility , separator );
+ }
+
+ if( (enabledFields & FIELD_DIRECTION_POSITION) != 0 )
+ {
+ oss << Modifier::strDirection ( direction , separator );
+ }
+
+ if( (enabledFields & FIELD_FEATURE_POSITION) != 0 )
+ {
+ oss << Modifier::strFeature( feature , separator );
+ }
+
+ if( (enabledFields & FIELD_NATURE_POSITION) != 0 )
+ {
+ oss << Modifier::strNature ( nature , separator );
+ }
+
+ return( oss.str() );
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/common/ModifierElement.h b/org.eclipse.efm.symbex/src/fml/common/ModifierElement.h
new file mode 100644
index 0000000..190dfc7
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/common/ModifierElement.h
@@ -0,0 +1,1681 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 18 mars 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef MODIFIERELEMENT_H_
+#define MODIFIERELEMENT_H_
+
+#include <string>
+
+#include <util/avm_numeric.h>
+
+
+namespace sep
+{
+
+
+struct Modifier
+{
+
+ /**
+ * VISIBILITY_KIND
+ * 2 bits
+ */
+ enum VISIBILITY_KIND
+ {
+ VISIBILITY_UNDEFINED_KIND = 0x00, // DEFAULT
+ VISIBILITY_PRIVATE_KIND = 0x00, // DEFAULT
+
+ VISIBILITY_PUBLIC_KIND = 0x01,
+
+ VISIBILITY_PROTECTED_KIND = 0x02,
+
+ VISIBILITY_PACKAGE_KIND = 0x03
+
+ };
+
+
+ /**
+ * DIRECTION_KIND
+ * 3 bits
+ */
+ enum DIRECTION_KIND
+ {
+ DIRECTION_UNDEFINED_KIND = 0x00, // DEFAULT
+
+ DIRECTION_INPUT_KIND = 0x01,
+
+ DIRECTION_OUTPUT_KIND = 0x02,
+
+ DIRECTION_INOUT_KIND = DIRECTION_INPUT_KIND
+ | DIRECTION_OUTPUT_KIND,
+
+ DIRECTION_RETURN_KIND = 0x04
+
+ };
+
+
+
+ /**
+ * NATURE_KIND
+ * 4 bits
+ */
+ enum NATURE_KIND
+ {
+ NATURE_UNDEFINED_KIND = 0x000, // DEFAULT
+ NATURE_VARIABLE_KIND = 0x000, // DEFAULT
+
+ NATURE_PARAMETER_KIND = 0x001,
+
+ NATURE_REFERENCE_KIND = 0x002,
+
+ NATURE_MACRO_KIND = 0x004,
+
+ NATURE_BIND_KIND = 0x008,
+
+ NATURE_PARAMETER_BIND_KIND = NATURE_PARAMETER_KIND
+ | NATURE_BIND_KIND,
+
+ NATURE_REFERENCE_MACRO_KIND = NATURE_REFERENCE_KIND
+ | NATURE_MACRO_KIND,
+
+ NATURE_PARAMETER_REFERENCE_MACRO_KIND
+ = NATURE_PARAMETER_KIND
+ | NATURE_REFERENCE_KIND
+ | NATURE_MACRO_KIND
+
+ };
+
+
+ /**
+ * FEATURE_KIND
+ * 5 bits
+ */
+ enum FEATURE_KIND
+ {
+ FEATURE_UNDEFINED_KIND = 0x000, // DEFAULT
+
+ FEATURE_FINAL_KIND = 0x001,
+ FEATURE_CONST_KIND = 0x001,
+
+ FEATURE_STATIC_KIND = 0x002,
+
+ FEATURE_TRANSIENT_KIND = 0x004,
+
+ FEATURE_VOLATILE_KIND = 0x008,
+
+ FEATURE_UNSAFE_KIND = 0x010,
+
+ FEATURE_FINAL_STATIC_KIND = FEATURE_FINAL_KIND
+ | FEATURE_STATIC_KIND
+
+ };
+
+
+ /**
+ * TYPEDEF
+ */
+ typedef unsigned short bit_field_t;
+
+ /**
+ * BIT FIELDS
+ */
+ bit_field_t visibility : 2;
+
+ bit_field_t direction : 3;
+
+ bit_field_t nature : 4;
+
+ bit_field_t feature : 5;
+
+
+ /**
+ * ENABLING POSITION
+ */
+ enum
+ {
+ FIELD_VISIBILITY_POSITION = 0x01,
+ FIELD_DIRECTION_POSITION = 0x02,
+ FIELD_NATURE_POSITION = 0x04,
+ FIELD_FEATURE_POSITION = 0x08,
+
+ ENABLE_ALL_FIELDS = 0xFF,
+
+ DISABLE_VISIBILITY_FIELD = (~ FIELD_VISIBILITY_POSITION),
+ DISABLE_DIRECTION_FIELD = (~ FIELD_DIRECTION_POSITION ),
+ DISABLE_FEATURE_DESIGN_FIELD = (~ FIELD_FEATURE_POSITION ),
+ DISABLE_NATURE_FIELD = (~ FIELD_NATURE_POSITION )
+
+ };
+
+
+ /**
+ * STATIC PROPERTY MODIFIER
+ */
+ static Modifier PROPERTY_UNDEFINED_MODIFIER;
+
+ /**
+ * VISIBILITY
+ */
+ static Modifier PROPERTY_PUBLIC_MODIFIER;
+
+ static Modifier PROPERTY_PROTECTED_MODIFIER;
+
+ static Modifier PROPERTY_PRIVATE_MODIFIER;
+
+ /**
+ * DIRECTION
+ */
+ static Modifier PROPERTY_INOUT_DIRECTION;
+
+ /**
+ * NATURE
+ */
+ static Modifier PROPERTY_MACRO_MODIFIER;
+
+ /**
+ * ALIAS
+ */
+ static Modifier PROPERTY_PUBLIC_VOLATILE_MODIFIER;
+
+ static Modifier PROPERTY_PUBLIC_FINAL_STATIC_MODIFIER;
+
+ static Modifier PARAMETER_PUBLIC_FINAL_STATIC_MODIFIER;
+
+ /**
+ * [ DIRECTION ] PARAMETER
+ */
+ static Modifier PROPERTY_PARAMETER_MODIFIER;
+
+ static Modifier PROPERTY_INPUT_PARAMETER_MODIFIER;
+
+ static Modifier PROPERTY_OUTPUT_PARAMETER_MODIFIER;
+
+ static Modifier PROPERTY_INOUT_PARAMETER_MODIFIER;
+
+ static Modifier PROPERTY_RETURN_PARAMETER_MODIFIER;
+
+ /**
+ * [ BIND ] PARAMETER
+ */
+ static Modifier PROPERTY_PARAMETER_BIND_MODIFIER;
+
+
+ /**
+ * CONSTRUCTORS
+ */
+ Modifier()
+ : visibility( VISIBILITY_UNDEFINED_KIND ),
+ direction ( DIRECTION_UNDEFINED_KIND ),
+ nature ( NATURE_UNDEFINED_KIND ),
+ feature ( FEATURE_UNDEFINED_KIND )
+ {
+ //!! NOTHING
+ }
+
+// Modifier(const Modifier & aModifier)
+// : visibility( aModifier.visibility ),
+// direction ( aModifier.direction ),
+// nature ( aModifier.nature ),
+// feature ( aModifier.feature )
+// {
+// //!! NOTHING
+// }
+
+ Modifier(bit_field_t visibilityKind, bit_field_t directionKind,
+ bit_field_t natureKind, bit_field_t featureKind)
+ : visibility( visibilityKind ),
+ direction ( directionKind ),
+ nature ( natureKind ),
+ feature ( featureKind )
+ {
+ //!! NOTHING
+ }
+
+ Modifier(NATURE_KIND natureKindind, FEATURE_KIND featureKindind)
+ : visibility( VISIBILITY_UNDEFINED_KIND ),
+ direction ( DIRECTION_UNDEFINED_KIND ),
+ nature ( natureKindind ),
+ feature ( featureKindind )
+ {
+ //!! NOTHING
+ }
+
+
+ Modifier(VISIBILITY_KIND visibilityKind)
+ : visibility( visibilityKind ),
+ direction ( DIRECTION_UNDEFINED_KIND ),
+ nature ( NATURE_UNDEFINED_KIND ),
+ feature ( FEATURE_UNDEFINED_KIND )
+ {
+ //!! NOTHING
+ }
+
+ Modifier(DIRECTION_KIND directionKind)
+ : visibility( VISIBILITY_UNDEFINED_KIND ),
+ direction ( directionKind ),
+ nature ( NATURE_UNDEFINED_KIND ),
+ feature ( FEATURE_UNDEFINED_KIND )
+ {
+ //!! NOTHING
+ }
+
+ Modifier(NATURE_KIND natureKind)
+ : visibility( VISIBILITY_UNDEFINED_KIND ),
+ direction ( DIRECTION_UNDEFINED_KIND ),
+ nature ( natureKind ),
+ feature ( FEATURE_UNDEFINED_KIND )
+ {
+ //!! NOTHING
+ }
+
+ Modifier(FEATURE_KIND featureKind)
+ : visibility( VISIBILITY_UNDEFINED_KIND ),
+ direction ( DIRECTION_UNDEFINED_KIND ),
+ nature ( NATURE_UNDEFINED_KIND ),
+ feature ( featureKind )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ ~Modifier()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * TESTER
+ */
+ inline bool hasModifier() const
+ {
+ return( (visibility != VISIBILITY_UNDEFINED_KIND)
+ || (direction != DIRECTION_UNDEFINED_KIND )
+ || (nature != NATURE_UNDEFINED_KIND )
+ || (feature != FEATURE_UNDEFINED_KIND ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // OPERATOR =
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline Modifier & override_ifdef(const Modifier & other)
+ {
+ if( other.visibility != VISIBILITY_UNDEFINED_KIND )
+ {
+ visibility = other.visibility;
+ }
+ if( other.direction != DIRECTION_UNDEFINED_KIND )
+ {
+ direction = other.direction;
+ }
+
+ nature |= other.nature;
+ feature |= other.feature;
+
+ return( *this );
+ }
+
+ inline Modifier & ifnot_define(const Modifier & other)
+ {
+ if( visibility == VISIBILITY_UNDEFINED_KIND )
+ {
+ visibility = other.visibility;
+ }
+ if( direction == DIRECTION_UNDEFINED_KIND )
+ {
+ direction = other.direction;
+ }
+
+ nature |= other.nature;
+ feature |= other.feature;
+
+ return( *this );
+ }
+
+
+ inline Modifier & operator=(const Modifier & other)
+ {
+ visibility = other.visibility;
+ direction = other.direction;
+ nature = other.nature;
+ feature = other.feature;
+
+ return( *this );
+ }
+
+ inline Modifier & operator=(VISIBILITY_KIND visibilityKind)
+ {
+ visibility = visibilityKind;
+
+ return( *this );
+ }
+
+ inline Modifier & operator=(DIRECTION_KIND directionKind)
+ {
+ direction = directionKind;
+
+ return( *this );
+ }
+
+ inline Modifier & operator=(NATURE_KIND natureKind)
+ {
+ nature = natureKind;
+
+ return( *this );
+ }
+
+ inline Modifier & operator=(FEATURE_KIND featureKind)
+ {
+ feature = featureKind;
+
+ return( *this );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // OPERATOR |=
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline Modifier & operator|=(const Modifier & other)
+ {
+ visibility |= other.visibility;
+ direction |= other.direction;
+ nature |= other.nature;
+ feature |= other.feature;
+
+ return( *this );
+ }
+
+ inline Modifier & operator|=(VISIBILITY_KIND visibilityKind)
+ {
+ visibility |= visibilityKind;
+
+ return( *this );
+ }
+
+ inline Modifier & operator|=(DIRECTION_KIND directionKind)
+ {
+ direction |= directionKind;
+
+ return( *this );
+ }
+
+ inline Modifier & operator|=(NATURE_KIND natureKind)
+ {
+ nature |= natureKind;
+
+ return( *this );
+ }
+
+ inline Modifier & operator|=(FEATURE_KIND featureKind)
+ {
+ feature |= featureKind;
+
+ return( *this );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // OPERATOR &=
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline Modifier & operator&=(const Modifier & other)
+ {
+ visibility &= other.visibility;
+ direction &= other.direction;
+ nature &= other.nature;
+ feature &= other.feature;
+
+ return( *this );
+ }
+
+ inline Modifier & operator&=(VISIBILITY_KIND visibilityKind)
+ {
+ visibility &= visibilityKind;
+
+ return( *this );
+ }
+
+ inline Modifier & operator&=(DIRECTION_KIND directionKind)
+ {
+ direction &= directionKind;
+
+ return( *this );
+ }
+
+ inline Modifier & operator&=(NATURE_KIND natureKind)
+ {
+ nature &= natureKind;
+
+ return( *this );
+ }
+
+ inline Modifier & operator&=(FEATURE_KIND featureKind)
+ {
+ feature &= featureKind;
+
+ return( *this );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // OPERATOR == !=
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline bool operator==(const Modifier & other) const
+ {
+ return( (visibility == other.visibility)
+ && (direction == other.direction )
+ && (nature == other.nature )
+ && (feature == other.feature ) );
+ }
+
+ inline bool operator!=(const Modifier & other) const
+ {
+ return( (visibility != other.visibility)
+ || (direction != other.direction )
+ || (nature != other.nature )
+ || (feature != other.feature ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // OPERATOR |
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline Modifier operator|(const Modifier & other) const
+ {
+ return( Modifier(
+ visibility | other.visibility,
+ direction | other.direction,
+ nature | other.nature,
+ feature | other.feature) );
+ }
+
+ inline Modifier operator|(VISIBILITY_KIND visibilityKind) const
+ {
+ return( Modifier(visibility | visibilityKind,
+ direction, nature, feature) );
+ }
+
+ inline Modifier operator|(DIRECTION_KIND directionKind) const
+ {
+ return( Modifier(visibility,
+ direction | directionKind, nature, feature) );
+ }
+
+ inline Modifier operator|(NATURE_KIND natureKind) const
+ {
+ return( Modifier(visibility,
+ direction, nature | natureKind, feature) );
+ }
+
+ inline Modifier operator|(FEATURE_KIND featureKind) const
+ {
+ return( Modifier(visibility,
+ direction, nature, feature | featureKind) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // OPERATOR &
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline Modifier operator&(const Modifier & other) const
+ {
+ return( Modifier(
+ visibility & other.visibility,
+ direction & other.direction,
+ nature & other.nature,
+ feature & other.feature) );
+ }
+
+ inline Modifier operator&(VISIBILITY_KIND visibilityKind) const
+ {
+ return( Modifier(visibility & visibilityKind,
+ direction, nature, feature) );
+ }
+
+ inline Modifier operator&(DIRECTION_KIND directionKind) const
+ {
+ return( Modifier(visibility,
+ direction & directionKind, nature, feature) );
+ }
+
+ inline Modifier operator&(NATURE_KIND natureKind) const
+ {
+ return( Modifier(visibility,
+ direction, nature & natureKind, feature) );
+ }
+
+ inline Modifier operator&(FEATURE_KIND featureKind) const
+ {
+ return( Modifier(visibility,
+ direction, nature, feature & featureKind) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // VISIBILITY KIND
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * GETTER - SETTER
+ * visibility
+ */
+ inline VISIBILITY_KIND getVisibilityKind() const
+ {
+ return( static_cast< VISIBILITY_KIND >( visibility ) );
+ }
+
+ inline bool hasVisibilityKind() const
+ {
+ return( visibility != VISIBILITY_UNDEFINED_KIND );
+ }
+
+ inline bool isVisibilityKind(VISIBILITY_KIND visibilityKind) const
+ {
+ return( visibility == visibilityKind );
+ }
+
+ inline Modifier & setVisibilityKind(VISIBILITY_KIND visibilityKind)
+ {
+ visibility = visibilityKind;
+
+ return( *this );
+ }
+
+ inline Modifier & unsetVisibilityKind()
+ {
+ visibility = VISIBILITY_UNDEFINED_KIND;
+
+ return( *this );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * "public" visibility
+ */
+ inline bool isVisibilityPublic() const
+ {
+ return( visibility == VISIBILITY_PUBLIC_KIND );
+ }
+
+ inline bool isVisibilityPublic(const Modifier & mask) const
+ {
+ return( ((visibility | mask.visibility) & VISIBILITY_PUBLIC_KIND) != 0 );
+ }
+
+ inline Modifier & setVisibilityPublic()
+ {
+ visibility = VISIBILITY_PUBLIC_KIND;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "private" visibility
+ */
+ inline bool isVisibilityPrivate() const
+ {
+ return( visibility == VISIBILITY_PRIVATE_KIND );
+ }
+
+ inline Modifier & setVisibilityPrivate()
+ {
+ visibility = VISIBILITY_PRIVATE_KIND;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "protected" visibility
+ */
+ inline bool isVisibilityProtected() const
+ {
+ return( visibility == VISIBILITY_PROTECTED_KIND );
+ }
+
+ inline Modifier & setVisibilityProtected()
+ {
+ visibility = VISIBILITY_PROTECTED_KIND;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "package" visibility
+ */
+ inline bool isVisibilityPackage() const
+ {
+ return( visibility == VISIBILITY_PACKAGE_KIND );
+ }
+
+ inline Modifier & setVisibilityPackage()
+ {
+ visibility = VISIBILITY_PACKAGE_KIND;
+
+ return( *this );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DIRECTION KIND
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * GETTER - SETTER
+ * direction
+ */
+ inline DIRECTION_KIND getDirectionKind() const
+ {
+ return( static_cast< DIRECTION_KIND >( direction ) );
+ }
+
+ inline bool hasDirectionKind() const
+ {
+ return( direction != DIRECTION_UNDEFINED_KIND );
+ }
+
+ inline bool hasDirectionKind(DIRECTION_KIND directionKind) const
+ {
+ return( (direction & directionKind) != 0 );
+ }
+
+
+ inline bool isDirectionKind(DIRECTION_KIND directionKind) const
+ {
+ return( direction == directionKind );
+ }
+
+ inline bool isnotDirectionKind(DIRECTION_KIND directionKind) const
+ {
+ return( direction != directionKind );
+ }
+
+
+ inline bool isDirectionKind(
+ DIRECTION_KIND directionKind, bool isStrongly) const
+ {
+ return( isStrongly ? (direction == directionKind)
+ : ((direction & directionKind) != 0) );
+ }
+
+ inline bool isnotDirectionKind(
+ DIRECTION_KIND directionKind, bool isStrongly) const
+ {
+ return( isStrongly ? (direction != directionKind)
+ : ((direction & directionKind) == 0) );
+ }
+
+
+ inline bool isDirectionUndefined() const
+ {
+ return( direction == DIRECTION_UNDEFINED_KIND );
+ }
+
+ inline Modifier & setDirectionKind(DIRECTION_KIND directionKind)
+ {
+ direction = directionKind;
+
+ return( *this );
+ }
+
+ inline Modifier & unsetDirectionKind()
+ {
+ direction = DIRECTION_UNDEFINED_KIND;
+
+ return( *this );
+ }
+
+
+ inline std::string strDirection() const
+ {
+ switch( direction )
+ {
+ case DIRECTION_INPUT_KIND: return( "input" );
+ case DIRECTION_OUTPUT_KIND: return( "output" );
+ case DIRECTION_INOUT_KIND: return( "inout" );
+ case DIRECTION_RETURN_KIND: return( "return" );
+
+ case DIRECTION_UNDEFINED_KIND: return( "undefined<direction#kind>" );
+
+ default: return( "unknown<direction#kind>" );
+ }
+ }
+
+
+
+ /**
+ * GETTER - SETTER
+ * "input" direction modifier
+ */
+ inline bool isDirectionInput() const
+ {
+ return( direction == DIRECTION_INPUT_KIND );
+ }
+
+ inline bool hasDirectionInput() const
+ {
+ return( (direction & DIRECTION_INPUT_KIND) != 0 );
+ }
+
+ inline Modifier & setDirectionInput()
+ {
+ direction = DIRECTION_INPUT_KIND;
+
+ return( *this );
+ }
+
+
+
+ /**
+ * GETTER - SETTER
+ * "instance" direction modifier
+ */
+ inline bool isDirectionOutput() const
+ {
+ return( direction == DIRECTION_OUTPUT_KIND );
+ }
+
+ inline bool hasDirectionOutput() const
+ {
+ return( (direction & DIRECTION_OUTPUT_KIND) != 0 );
+ }
+
+ inline Modifier & setDirectionOutput()
+ {
+ direction = DIRECTION_OUTPUT_KIND;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "prototype" direction modifier
+ */
+ inline bool isDirectionInout() const
+ {
+ return( direction == DIRECTION_INOUT_KIND );
+ }
+
+
+ inline Modifier & setDirectionInout()
+ {
+ direction = DIRECTION_INOUT_KIND;
+
+ return( *this );
+ }
+
+ inline Modifier & setDirectionInoutElse()
+ {
+ if( direction == DIRECTION_UNDEFINED_KIND )
+ {
+ direction = DIRECTION_INOUT_KIND;
+ }
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "runtime" direction modifier
+ */
+ inline bool isDirectionReturn() const
+ {
+ return( direction == DIRECTION_RETURN_KIND );
+ }
+
+ inline bool noDirectionReturn() const
+ {
+ return( direction != DIRECTION_RETURN_KIND );
+ }
+
+ inline Modifier & setDirectionReturn()
+ {
+ direction = DIRECTION_RETURN_KIND;
+
+ return( *this );
+ }
+
+ inline bool hasDirectionOtheThanReturn() const
+ {
+ return( (direction & DIRECTION_INOUT_KIND) != 0 );
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // NATURE KIND
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * GETTER - SETTER
+ * nature
+ */
+ inline bit_field_t getNatureKind() const
+ {
+ return( nature );
+ }
+
+ inline bool hasNatureKind() const
+ {
+ return( nature != NATURE_UNDEFINED_KIND );
+ }
+
+ inline bool hasNatureKind(bit_field_t kind) const
+ {
+ return( (nature & kind) != 0 );
+ }
+
+ inline bool isNatureKind(bit_field_t kind) const
+ {
+ return( nature == kind );
+ }
+
+ inline Modifier & addNatureKind(bit_field_t kind)
+ {
+ nature |= kind;
+
+ return( *this );
+ }
+
+ inline Modifier & remNatureKind(bit_field_t kind)
+ {
+ nature &= (~ kind);
+
+ return( *this );
+ }
+
+ inline Modifier & setNatureKind(bit_field_t kind)
+ {
+ nature = kind;
+
+ return( *this );
+ }
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FEATURE KIND
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * GETTER - SETTER
+ * feature
+ */
+ inline bit_field_t getFeatureKind() const
+ {
+ return( feature );
+ }
+
+ inline bool hasFeatureKind() const
+ {
+ return( feature != FEATURE_UNDEFINED_KIND );
+ }
+
+ inline bool hasFeatureKind(bit_field_t kind) const
+ {
+ return( (feature & kind) != 0 );
+ }
+
+ inline bool isFeatureKind(bit_field_t kind) const
+ {
+ return( feature == kind );
+ }
+
+
+ inline Modifier & addFeatureKind(bit_field_t kind)
+ {
+ feature |= kind;
+
+ return( *this );
+ }
+
+ inline Modifier & remFeatureKind(bit_field_t kind)
+ {
+ feature &= (~ kind);
+
+ return( *this );
+ }
+
+ inline Modifier & setFeatureKind(bit_field_t kind)
+ {
+ feature = kind;
+
+ return( *this );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * "variable" nature
+ */
+ inline bool hasNatureVariable() const
+ {
+ return( (nature & NATURE_VARIABLE_KIND) != 0 );
+ }
+
+ inline Modifier & setNatureVariable(bool bNatureVariable = true)
+ {
+ if( bNatureVariable )
+ {
+ nature |= NATURE_VARIABLE_KIND;
+ }
+ else
+ {
+ nature &= (~ NATURE_VARIABLE_KIND);
+ }
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "parameter" nature
+ */
+ inline bool hasNatureParameter() const
+ {
+ return( (nature & NATURE_PARAMETER_KIND) != 0 );
+ }
+
+ inline bool noNatureParameter() const
+ {
+ return( (nature & NATURE_PARAMETER_KIND) == 0 );
+ }
+
+ inline Modifier & setNatureParameter(bool bNatureParameter = true)
+ {
+ if( bNatureParameter )
+ {
+ nature |= NATURE_PARAMETER_KIND;
+ }
+ else
+ {
+ nature &= (~ NATURE_PARAMETER_KIND);
+ }
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "reference" nature
+ */
+ inline bool hasNatureReference() const
+ {
+ return( (nature & NATURE_REFERENCE_KIND) != 0 );
+ }
+
+ inline Modifier & setNatureReference(bool bNatureReference = true)
+ {
+ if( bNatureReference )
+ {
+ nature |= NATURE_REFERENCE_KIND;
+ }
+ else
+ {
+ nature &= (~ NATURE_REFERENCE_KIND);
+ }
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "macro" nature
+ */
+ inline bool hasNatureMacro() const
+ {
+ return( (nature & NATURE_MACRO_KIND) != 0 );
+ }
+
+ inline Modifier & setNatureMacro(bool bNatureMacro = true)
+ {
+ if( bNatureMacro )
+ {
+ nature |= NATURE_MACRO_KIND;
+ }
+ else
+ {
+ nature &= (~ NATURE_MACRO_KIND);
+ }
+
+ return( *this );
+ }
+
+
+ /**
+ * ALIAS
+ * GETTER - SETTER
+ * "reference" or "macro" modifier
+ */
+ inline bool anyNatureReferenceMacro() const
+ {
+ return( (nature & NATURE_REFERENCE_MACRO_KIND) != 0 );
+ }
+
+ inline bool noneNatureReferenceMacro() const
+ {
+ return( (nature & NATURE_REFERENCE_MACRO_KIND) == 0 );
+ }
+
+
+ /**
+ * ALIAS
+ * GETTER - SETTER
+ * "parameter" or "reference" or "macro" modifier
+ */
+ inline bool anyNatureParameterReferenceMacro() const
+ {
+ return( (nature & NATURE_PARAMETER_REFERENCE_MACRO_KIND) != 0 );
+ }
+
+ inline bool noneNatureParameterReferenceMacro() const
+ {
+ return( (nature & NATURE_PARAMETER_REFERENCE_MACRO_KIND) == 0 );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "bind" nature
+ */
+ inline bool hasNatureBind() const
+ {
+ return( (nature & NATURE_BIND_KIND) != 0 );
+ }
+
+ inline Modifier & setNatureBind(bool bNatureBind = true)
+ {
+ if( bNatureBind )
+ {
+ nature |= NATURE_BIND_KIND;
+ }
+ else
+ {
+ nature &= (~ NATURE_BIND_KIND);
+ }
+
+ return( *this );
+ }
+
+
+ /**
+ * ALIAS
+ * GETTER - SETTER
+ * "parameter" or "bind" modifier
+ */
+ inline bool hasNatureParameterBind() const
+ {
+ return( (nature & NATURE_PARAMETER_BIND_KIND) ==
+ NATURE_PARAMETER_BIND_KIND );
+ }
+
+ inline Modifier & setNatureParameterBind(bool bNatureParameterBind = true)
+ {
+ if( bNatureParameterBind )
+ {
+ nature |= NATURE_PARAMETER_BIND_KIND;
+ }
+ else
+ {
+ nature &= (~ NATURE_PARAMETER_BIND_KIND);
+ }
+
+ return( *this );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * "final" or "const" feature
+ */
+ inline bool hasFeatureFinal() const
+ {
+ return( (feature & FEATURE_FINAL_KIND) != 0 );
+ }
+
+ inline bool noFeatureFinal() const
+ {
+ return( (feature & FEATURE_FINAL_KIND) == 0 );
+ }
+
+ inline Modifier & setFeatureFinal(bool bFeatureFinal = true)
+ {
+ if( bFeatureFinal )
+ {
+ feature |= FEATURE_FINAL_KIND;
+ }
+ else
+ {
+ feature &= (~ FEATURE_FINAL_KIND);
+ }
+
+ return( *this );
+ }
+
+
+ inline bool hasFeatureConst() const
+ {
+ return( (feature & FEATURE_CONST_KIND) != 0 );
+ }
+
+ inline Modifier & setFeatureConst(bool bFeatureConst = true)
+ {
+ if( bFeatureConst )
+ {
+ feature |= FEATURE_CONST_KIND;
+ }
+ else
+ {
+ feature &= (~ FEATURE_CONST_KIND);
+ }
+
+ return( *this );
+ }
+
+
+ inline bool hasFeatureMutable() const
+ {
+ return( (feature & FEATURE_FINAL_KIND) == 0 );
+ }
+
+ inline Modifier & setFeatureMutable(bool bFeatureMutable = true)
+ {
+ if( bFeatureMutable )
+ {
+ feature &= (~ FEATURE_FINAL_KIND);
+ }
+ else
+ {
+ feature |= FEATURE_FINAL_KIND;
+ }
+
+ return( *this );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * "static" feature
+ */
+ inline bool hasFeatureStatic() const
+ {
+ return( (feature & FEATURE_STATIC_KIND) != 0 );
+ }
+
+ inline Modifier & setFeatureStatic(bool bFeatureStatic = true)
+ {
+ if( bFeatureStatic )
+ {
+ feature |= FEATURE_STATIC_KIND;
+ }
+ else
+ {
+ feature &= (~ FEATURE_STATIC_KIND);
+ }
+
+ return( *this );
+ }
+
+
+ /**
+ * ALIAS
+ * GETTER - SETTER
+ * "final static" modifier
+ */
+ inline bool hasFeatureFinalStatic() const
+ {
+ return( (feature & FEATURE_FINAL_STATIC_KIND) ==
+ FEATURE_FINAL_STATIC_KIND );
+ }
+
+ inline Modifier & setFeatureFinalStatic(bool bFeatureFinalStatic = true)
+ {
+ if( bFeatureFinalStatic )
+ {
+ feature |= FEATURE_FINAL_STATIC_KIND;
+ }
+ else
+ {
+ feature &= (~ FEATURE_FINAL_STATIC_KIND);
+ }
+
+ return( *this );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * "transient" feature
+ */
+ inline bool hasFeatureTransient() const
+ {
+ return( (feature & FEATURE_TRANSIENT_KIND) != 0 );
+ }
+
+ inline bool noFeatureTransient() const
+ {
+ return( (feature & FEATURE_TRANSIENT_KIND) == 0 );
+ }
+
+ inline Modifier & setFeatureTransient(bool bFeatureTransient = true)
+ {
+ if( bFeatureTransient )
+ {
+ feature |= FEATURE_TRANSIENT_KIND;
+ }
+ else
+ {
+ feature &= (~ FEATURE_TRANSIENT_KIND);
+ }
+
+ return( *this );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * "volatile" feature
+ */
+ inline bool hasFeatureVolatile() const
+ {
+ return( (feature & FEATURE_VOLATILE_KIND) != 0 );
+ }
+
+ inline bool hasFeatureVolatile(const Modifier & mask) const
+ {
+ return( ((feature | mask.feature) & FEATURE_VOLATILE_KIND) != 0 );
+ }
+
+ inline Modifier & setFeatureVolatile(bool bFeatureVolatile = true)
+ {
+ if( bFeatureVolatile )
+ {
+ feature |= FEATURE_VOLATILE_KIND;
+ }
+ else
+ {
+ feature &= (~ FEATURE_VOLATILE_KIND);
+ }
+
+ return( *this );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * "unsafe" feature
+ */
+ inline bool hasFeatureUnsafe() const
+ {
+ return( (feature & FEATURE_UNSAFE_KIND) != 0 );
+ }
+
+ inline Modifier & setFeatureUnsafe(bool bFeatureUnsafe = true)
+ {
+ if( bFeatureUnsafe )
+ {
+ feature |= FEATURE_UNSAFE_KIND;
+ }
+ else
+ {
+ feature &= (~ FEATURE_UNSAFE_KIND);
+ }
+
+ return( *this );
+ }
+
+
+ inline bool hasFeatureSafe() const
+ {
+ return( (feature & FEATURE_UNSAFE_KIND) == 0 );
+ }
+
+ inline Modifier & setFeatureSafe(bool bFeatureSafe = true)
+ {
+ if( bFeatureSafe )
+ {
+ feature &= (~ FEATURE_UNSAFE_KIND);
+ }
+ else
+ {
+ feature |= FEATURE_UNSAFE_KIND;
+ }
+
+ return( *this );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // MIX-IN MODIFIER
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * HYBRID ALIAS
+ * GETTER - SETTER
+ * "public final static" modifier
+ */
+ inline bool hasModifierPublicFinalStatic() const
+ {
+ return( isVisibilityPublic()
+ && hasFeatureFinalStatic() );
+ }
+
+ inline Modifier & setModifierPublicFinalStatic()
+ {
+ setVisibilityPublic();
+
+ setFeatureFinalStatic();
+
+ return( *this );
+ }
+
+
+ inline bool hasModifierPublicFinalStaticParameter() const
+ {
+ return( isVisibilityPublic()
+ && hasFeatureFinalStatic()
+ && hasNatureParameter() );
+ }
+
+ inline Modifier & setModifierPublicFinalStaticParameter()
+ {
+ setVisibilityPublic();
+
+ setModifierPublicFinalStatic();
+
+ setNatureParameter( true );
+
+ return( *this );
+ }
+
+
+ /**
+ * HYBRID ALIAS
+ * GETTER - SETTER
+ * "public volatile" modifier
+ */
+ inline bool hasModifierPublicVolatile() const
+ {
+ return( isVisibilityPublic()
+ && hasFeatureVolatile() );
+ }
+
+ inline Modifier & setModifierPublicVolatile()
+ {
+ setVisibilityPublic();
+
+ setFeatureVolatile( true );
+
+ return( *this );
+ }
+
+
+ /**
+ * ALIAS
+ * GETTER - SETTER
+ * "reference" , "macro" , final modifier
+ */
+ inline bool anyModifierFinalReferenceMacro() const
+ {
+ return( hasFeatureFinal()
+ || anyNatureReferenceMacro() );
+ }
+
+ inline bool noneModifierFinalReferenceMacro() const
+ {
+ return( noFeatureFinal()
+ && noneNatureReferenceMacro() );
+ }
+
+
+ /**
+ * ALIAS
+ * GETTER - SETTER
+ * "reference" , "macro" , "transient" modifier
+ */
+ inline bool anyModifierTransientReferenceMacro() const
+ {
+ return( hasFeatureTransient()
+ || anyNatureReferenceMacro() );
+ }
+
+ inline bool noneModifierTransientReferenceMacro() const
+ {
+ return( noFeatureTransient()
+ && noneNatureReferenceMacro() );
+ }
+
+
+
+ /**
+ * ALIAS
+ * GETTER - SETTER
+ * "bind return" modifier
+ */
+ inline bool hasModifierReturnBind() const
+ {
+ return( isDirectionReturn()
+ && hasNatureBind() );
+ }
+
+ inline Modifier & setModifierReturnBind()
+ {
+ setDirectionReturn();
+
+ setNatureBind( true );
+
+ return( *this );
+ }
+
+ /**
+ * ALIAS
+ * TEST
+ * for state data var modifier
+ * "reference" , "macro" , "transient" , "parameter" , "return"
+ */
+ bool anyModifierOfStateData() const
+ {
+ return( noFeatureTransient()
+ && noneNatureParameterReferenceMacro() );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Serialization
+ */
+ static std::string strVisibility(bit_field_t visibilityKind,
+ const std::string & separator = " ");
+
+ static std::string xstrVisibility(bit_field_t directionKind,
+ const std::string & separator = " ");
+
+
+ static std::string strDirection(bit_field_t directionKind,
+ const std::string & separator = " ");
+
+
+ static std::string xstrDirection(bit_field_t directionKind,
+ const std::string & separator = " ");
+
+ static Modifier::DIRECTION_KIND toDirectionKind(const std::string & id);
+
+ static std::string strFeature(bit_field_t featureKind,
+ const std::string & separator = " ");
+
+ static std::string strNature(bit_field_t natureKind,
+ const std::string & separator = " ");
+
+
+ std::string toString(bit_field_t enabledFields = ENABLE_ALL_FIELDS,
+ const std::string & separator = " ") const;
+
+ inline std::string toString(const std::string & separator) const
+ {
+ return( toString( ENABLE_ALL_FIELDS , separator) );
+ }
+
+ inline std::string toString_not(DIRECTION_KIND directionKind,
+ const std::string & separator = " ") const
+ {
+ if( isDirectionKind(directionKind) )
+ {
+ Modifier mdfr( *this );
+
+ return( mdfr.unsetDirectionKind().toString(separator) );
+ }
+ else
+ {
+ return( toString(separator) );
+ }
+ }
+
+ inline std::string toString_not(NATURE_KIND natureKind,
+ const std::string & separator = " ") const
+ {
+ if( hasNatureKind(natureKind) )
+ {
+ Modifier mdfr( *this );
+
+ return( mdfr.remNatureKind(natureKind).toString(separator) );
+ }
+ else
+ {
+ return( toString(separator) );
+ }
+ }
+
+ inline std::string toString_not(FEATURE_KIND featureKind,
+ const std::string & separator = " ") const
+ {
+ if( hasFeatureKind(featureKind) )
+ {
+ Modifier mdfr( *this );
+
+ return( mdfr.remFeatureKind(featureKind).toString(separator) );
+ }
+ else
+ {
+ return( toString(separator) );
+ }
+ }
+
+
+};
+
+
+//ostream & operator<<(ostream & os, const Modifier & aModifier)
+//{
+// os << Modifier::strVisibility( aModifier.visibility )
+// << Modifier::strDirection( aModifier.direction )
+// << Modifier::strFeature( aModifier.feature )
+// << Modifier::strNature( aModifier.nature );
+//
+// return( os );
+//}
+
+
+/**
+ * Modifier Implementation
+ */
+class ModifierImpl
+{
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ Modifier mModifier;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ */
+ ModifierImpl()
+ : mModifier( )
+ {
+ //!! NOTHING
+ }
+
+ ModifierImpl(const Modifier & aModifier)
+ : mModifier( aModifier )
+ {
+ //!! NOTHING
+ }
+
+ ModifierImpl(const ModifierImpl & aCopy)
+ : mModifier( aCopy.mModifier )
+ {
+ //!! NOTHING
+ }
+
+ ModifierImpl(const ModifierImpl * aCopy)
+ : mModifier( (aCopy != NULL) ?
+ aCopy->mModifier : Modifier::PROPERTY_UNDEFINED_MODIFIER )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ ~ModifierImpl()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER
+ * mModifier
+ */
+ inline const Modifier & getModifier() const
+ {
+ return( mModifier );
+ }
+
+ inline Modifier & getwModifier()
+ {
+ return( mModifier );
+ }
+
+ inline bool hasModifier() const
+ {
+ return( mModifier != Modifier::PROPERTY_UNDEFINED_MODIFIER );
+ }
+
+ inline void setModifier(const Modifier & aModifier)
+ {
+ mModifier = aModifier;
+ }
+
+};
+
+
+}
+
+#endif /* MODIFIERELEMENT_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/common/ObjectClassifier.cpp b/org.eclipse.efm.symbex/src/fml/common/ObjectClassifier.cpp
new file mode 100644
index 0000000..ebc784f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/common/ObjectClassifier.cpp
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 21 févr. 2017
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#include "ObjectClassifier.h"
+
+#include <fml/infrastructure/Machine.h>
+
+
+namespace sep
+{
+
+
+const Machine * ObjectClassifier::getContainerMachine() const
+{
+ return( mContainer->as< Machine >() );
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/common/ObjectClassifier.h b/org.eclipse.efm.symbex/src/fml/common/ObjectClassifier.h
new file mode 100644
index 0000000..2440de9
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/common/ObjectClassifier.h
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 21 févr. 2017
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#ifndef FML_COMMON_OBJECT_CLASSIFIER_H_
+#define FML_COMMON_OBJECT_CLASSIFIER_H_
+
+#include <common/NamedElement.h>
+#include <fml/common/TraceableElement.h>
+
+#include <base/ClassKindInfo.h>
+
+
+namespace sep
+{
+
+class Machine;
+class ObjectElement;
+
+
+class ObjectClassifier :
+ public NamedElement ,
+ public TraceableElement,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ObjectClassifier )
+{
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ ObjectElement * mContainer;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ObjectClassifier(class_kind_t aClassKind,
+ ObjectElement * aContainer, const std::string & aNameID)
+ : NamedElement( aClassKind , aNameID , aNameID , aNameID ),
+ TraceableElement( ),
+ mContainer( aContainer )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ObjectClassifier()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mContainer
+ */
+ inline ObjectElement * getContainer() const
+ {
+ return( mContainer );
+ }
+
+ inline bool hasContainer() const
+ {
+ return( mContainer != NULL );
+ }
+
+ inline void setContainer(ObjectElement * aContainer)
+ {
+ mContainer = aContainer;
+ }
+
+ const Machine * getContainerMachine() const;
+
+
+};
+
+} /* namespace sep */
+
+#endif /* FML_COMMON_OBJECT_CLASSIFIER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/common/ObjectElement.cpp b/org.eclipse.efm.symbex/src/fml/common/ObjectElement.cpp
new file mode 100644
index 0000000..4442fde
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/common/ObjectElement.cpp
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "ObjectElement.h"
+
+#include <fml/infrastructure/Machine.h>
+#include <fml/infrastructure/Package.h>
+
+
+namespace sep
+{
+
+
+
+/*
+ * ATTRIBUTES
+ */
+bool ObjectElement::USE_ONLY_ID = false;
+
+
+/**
+ * UTIL
+ * return <container-fully-qulified-name-id>.<name-id>
+ */
+std::string ObjectElement::makeFullyQualifiedNameID(
+ const ObjectElement * aContainer, const std::string & aNameID)
+{
+ if( aContainer == NULL )
+ {
+ return( FQN_ID_ROOT_SEPARATOR + aNameID );
+ }
+// else if( aContainer->is< System >() )
+// {
+// return( "spec::" + id );
+// }
+// else if( aContainer->is< Package >() )
+// {
+// return( "lib::" + aNameID );
+// }
+ else
+ {
+ return( aContainer->getFullyQualifiedNameID() + "." + aNameID );
+ }
+}
+
+/**
+ * GETTER
+ * the first Machine container
+ */
+Machine * ObjectElement::getContainerMachine() const
+{
+ ObjectElement * container = getContainer();
+ for( ; container != NULL ; container = container->getContainer() )
+ {
+ if( container->is< Machine >() )
+ {
+ return( container->to< Machine >() );
+ }
+ }
+
+ return( NULL );
+}
+
+/**
+ * GETTER
+ * the first PropertyElement container
+ */
+PropertyElement * ObjectElement::getContainerProperty() const
+{
+ ObjectElement * container = getContainer();
+ for( ; container != NULL ; container = container->getContainer() )
+ {
+ if( container->is< PropertyElement >() )
+ {
+ return( container->to< PropertyElement >() );
+ }
+ }
+
+ return( NULL );
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/common/ObjectElement.h b/org.eclipse.efm.symbex/src/fml/common/ObjectElement.h
new file mode 100644
index 0000000..9e7d95d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/common/ObjectElement.h
@@ -0,0 +1,335 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef FML_COMMON_OBJECTELEMENT_H_
+#define FML_COMMON_OBJECTELEMENT_H_
+
+#include <common/NamedElement.h>
+#include <fml/common/ModifierElement.h>
+#include <fml/common/TraceableElement.h>
+
+#include <base/ClassKindInfo.h>
+
+
+namespace sep
+{
+
+class Machine;
+class Modifier;
+class PropertyElement;
+class WObject;
+
+
+#define DEBUG_MEMORY_NEW AVM_OS_DEBUG << "new:> " \
+ << raw_address() << " : " << strHeader() << std::endl;
+
+#define DEBUG_MEMORY_DEL AVM_OS_DEBUG << "del:> " \
+ << raw_address() << " : " << strHeader() << std::endl;
+
+
+class ObjectElement :
+ public NamedElement ,
+ public ModifierImpl,
+ public TraceableElement,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ObjectElement )
+{
+
+ /*
+ * ATTRIBUTES
+ */
+ static bool USE_ONLY_ID;
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ ObjectElement * mContainer;
+
+ WObject * mWObject;
+
+ avm_offset_t mOffset;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ObjectElement(class_kind_t aClassKind, ObjectElement * aContainer,
+ const Modifier & aModifier = Modifier::PROPERTY_UNDEFINED_MODIFIER)
+ : NamedElement( aClassKind ),
+ ModifierImpl( aModifier ),
+ TraceableElement( ),
+ mContainer( aContainer ),
+ mWObject( NULL ),
+ mOffset( 0 )
+ {
+ //!! DEBUG_MEMORY_NEW;
+ }
+
+
+ ObjectElement(class_kind_t aClassKind, ObjectElement * aContainer,
+ const Modifier & aModifier,
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID)
+ : NamedElement( aClassKind , aFullyQualifiedNameID, aNameID ),
+ ModifierImpl( aModifier ),
+ TraceableElement( ),
+ mContainer( aContainer ),
+ mWObject( NULL ),
+ mOffset( 0 )
+ {
+ //!! DEBUG_MEMORY_NEW;
+ }
+
+ ObjectElement(class_kind_t aClassKind, ObjectElement * aContainer,
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID,
+ const std::string & anUnrestrictedName)
+ : NamedElement( aClassKind ,
+ aFullyQualifiedNameID, aNameID , anUnrestrictedName ),
+ ModifierImpl( ),
+ TraceableElement( ),
+ mContainer( aContainer ),
+ mWObject( NULL ),
+ mOffset( 0 )
+ {
+ //!! DEBUG_MEMORY_NEW;
+ }
+
+ ObjectElement(class_kind_t aClassKind, ObjectElement * aContainer,
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID)
+ : NamedElement( aClassKind , aFullyQualifiedNameID, aNameID ),
+ ModifierImpl( ),
+ TraceableElement( ),
+ mContainer( aContainer ),
+ mWObject( NULL ),
+ mOffset( 0 )
+ {
+ //!! DEBUG_MEMORY_NEW;
+ }
+
+ ObjectElement(class_kind_t aClassKind,
+ ObjectElement * aContainer, const std::string & aNameID)
+ : NamedElement( aClassKind ,
+ makeFullyQualifiedNameID(aContainer, aNameID) ,
+ aNameID , aNameID ),
+ ModifierImpl( ),
+ TraceableElement( ),
+ mContainer( aContainer ),
+ mWObject( NULL ),
+ mOffset( 0 )
+ {
+ //!! DEBUG_MEMORY_NEW;
+ }
+
+ ObjectElement(class_kind_t aClassKind, ObjectElement * aContainer,
+ const Modifier & aModifier, const std::string & aNameID)
+ : NamedElement( aClassKind ,
+ makeFullyQualifiedNameID(aContainer, aNameID) ,
+ aNameID , aNameID ),
+ ModifierImpl( aModifier ),
+ TraceableElement( ),
+ mContainer( aContainer ),
+ mWObject( NULL ),
+ mOffset( 0 )
+ {
+ //!! DEBUG_MEMORY_NEW;
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Using pattern
+ */
+ ObjectElement(class_kind_t aClassKind,
+ ObjectElement * aContainer, const ObjectElement & aPattern)
+ : NamedElement( aClassKind ,
+ makeFullyQualifiedNameID(aContainer, aPattern.getNameID()) ,
+ aPattern.getNameID() , aPattern.getUnrestrictedName() ),
+ ModifierImpl( aPattern.getModifier() ),
+ TraceableElement( ),
+ mContainer( aContainer ),
+ mWObject( NULL ),
+ mOffset( 0 )
+ {
+ //!! DEBUG_MEMORY_NEW;
+ }
+
+ ObjectElement(class_kind_t aClassKind, ObjectElement * aContainer,
+ const Modifier & aModifier, const ObjectElement & aPattern)
+ : NamedElement( aClassKind ,
+ makeFullyQualifiedNameID(aContainer, aPattern.getNameID()) ,
+ aPattern.getNameID() , aPattern.getUnrestrictedName() ),
+ ModifierImpl( aModifier ),
+ TraceableElement( ),
+ mContainer( aContainer ),
+ mWObject( NULL ),
+ mOffset( 0 )
+ {
+ //!! DEBUG_MEMORY_NEW;
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ ObjectElement(const ObjectElement & objElement)
+ : NamedElement( objElement ),
+ ModifierImpl( objElement ),
+ TraceableElement( objElement ),
+ mContainer( objElement.mContainer ),
+ mWObject( objElement.mWObject ),
+ mOffset( objElement.mOffset )
+ {
+ //!! DEBUG_MEMORY_NEW;
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ObjectElement()
+ {
+ //!! DEBUG_MEMORY_DEL;
+ }
+
+
+ /**
+ * SETTER
+ * Fully Qualified Name IDentifier
+ * mFullyQualifiedNameID
+ * mNameID
+ */
+ void updateFullyQualifiedNameID()
+ {
+ mFullyQualifiedNameID =
+ makeFullyQualifiedNameID(getContainer(), getNameID());
+ }
+
+ void fullyUpdateAllNameID(const std::string & aNameID)
+ {
+ mFullyQualifiedNameID =
+ makeFullyQualifiedNameID(getContainer(), aNameID);
+
+ mNameID = aNameID;
+ }
+
+
+ /**
+ * UTIL
+ * return <container-fully-qulified-name-id>.<name-id>
+ */
+ static std::string makeFullyQualifiedNameID(
+ const ObjectElement * aContainer, const std::string & aNameID);
+
+
+ /**
+ * GETTER - SETTER
+ * mContainer
+ */
+ inline ObjectElement * getContainer() const
+ {
+ return( mContainer );
+ }
+
+ inline bool hasContainer() const
+ {
+ return( mContainer != NULL );
+ }
+
+ inline void setContainer(ObjectElement * aContainer)
+ {
+ mContainer = aContainer;
+ }
+
+ inline void updateContainer(ObjectElement * aContainer)
+ {
+ mContainer = aContainer;
+
+ updateFullyQualifiedNameID();
+ }
+
+ /*
+ * UTIL
+ * the first specific type container
+ */
+ virtual Machine * getContainerMachine() const;
+
+ virtual PropertyElement * getContainerProperty() const;
+
+
+ /**
+ * GETTER - SETTER
+ * "design" of a USER FORM
+ */
+ inline WObject * getWObject() const
+ {
+ return( mWObject );
+ }
+
+ inline bool hasWObject() const
+ {
+ return( mWObject != NULL );
+ }
+
+ inline void setWObject(WObject * wfObject)
+ {
+ mWObject = wfObject;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mOffset
+ */
+ inline avm_offset_t getOffset() const
+ {
+ return( mOffset );
+ }
+
+ inline void setOffset(avm_offset_t anOffset)
+ {
+ mOffset = anOffset;
+ }
+
+
+ /**
+ * Serialization
+ */
+ inline virtual std::string strHeader() const
+ {
+ StringOutStream oss;
+
+ strHeader( oss );
+
+ return( oss.str() );
+ }
+
+ inline virtual void strHeader(OutStream & out) const
+ {
+ out << getModifier().toString() << getFullyQualifiedNameID();
+
+ if( hasUnrestrictedName() )
+ {
+ out << " '" << getUnrestrictedName() << "'";
+ }
+ }
+
+};
+
+
+}
+
+#endif /*FML_COMMON_OBJECTELEMENT_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/common/PropertyElement.cpp b/org.eclipse.efm.symbex/src/fml/common/PropertyElement.cpp
new file mode 100644
index 0000000..5a0ca6e
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/common/PropertyElement.cpp
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 8 avr. 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#include "PropertyElement.h"
+
+#include <fml/infrastructure/Machine.h>
+
+
+namespace sep
+{
+
+
+PropertyElement::PropertyElement(class_kind_t aClassKind, Machine * aContainer,
+ const Modifier & aModifier, const PropertyElement & aPattern)
+: ObjectElement( aClassKind , aContainer , aModifier , aPattern )
+{
+ //!! NOTHING
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/common/PropertyElement.h b/org.eclipse.efm.symbex/src/fml/common/PropertyElement.h
new file mode 100644
index 0000000..045e95b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/common/PropertyElement.h
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 8 avr. 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#ifndef FML_COMMON_PROPERTYELEMENT_H_
+#define FML_COMMON_PROPERTYELEMENT_H_
+
+#include <fml/common/ObjectElement.h>
+
+#include <base/ClassKindInfo.h>
+
+#include <common/AvmPointer.h>
+
+
+
+namespace sep
+{
+
+class Machine;
+class Modifier;
+
+class PropertyElement :
+ public ObjectElement,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( PropertyElement )
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ PropertyElement(class_kind_t aClassKind, ObjectElement * aContainer,
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID, const std::string & anUnrestrictedName)
+ : ObjectElement( aClassKind , aContainer ,
+ aFullyQualifiedNameID , aNameID , anUnrestrictedName )
+ {
+ //!! NOTHING
+ }
+
+ PropertyElement(class_kind_t aClassKind, ObjectElement * aContainer,
+ const Modifier & aModifier, const std::string & aNameID)
+ : ObjectElement( aClassKind , aContainer , aModifier , aNameID )
+ {
+ //!! NOTHING
+ }
+
+ PropertyElement(class_kind_t aClassKind,
+ ObjectElement * aContainer, const std::string & aNameID)
+ : ObjectElement( aClassKind , aContainer , aNameID )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ PropertyElement(class_kind_t aClassKind,
+ PropertyElement * aContainer, const PropertyElement & aPattern)
+ : ObjectElement( aClassKind , aContainer , aPattern )
+ {
+ //!! NOTHING
+ }
+
+ PropertyElement(class_kind_t aClassKind, Machine * aContainer,
+ const Modifier & aModifier, const PropertyElement & aPattern);
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ PropertyElement(const PropertyElement & aProperty)
+ : ObjectElement( aProperty )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~PropertyElement()
+ {
+ //!! NOTHING
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* FML_COMMON_PROPERTYELEMENT_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/common/README.md b/org.eclipse.efm.symbex/src/fml/common/README.md
new file mode 100644
index 0000000..26b8b98
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/common/README.md
@@ -0,0 +1,13 @@
+# EFM-SYMBEX : Common
+
+## Source code structure
+
+### Interfaces
+* **IAst**
+* **ICompiled**
+* **IRuntime**
+
+### Classes
+
+### Factories
+
diff --git a/org.eclipse.efm.symbex/src/fml/common/SpecifierElement.cpp b/org.eclipse.efm.symbex/src/fml/common/SpecifierElement.cpp
new file mode 100644
index 0000000..b4cad57
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/common/SpecifierElement.cpp
@@ -0,0 +1,802 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 21 avr. 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#include "SpecifierElement.h"
+
+#include <sstream>
+
+
+namespace sep
+{
+
+
+/**
+ * STATIC EXECUTABLE SPECIFIER
+ */
+Specifier Specifier::EXECUTABLE_UNDEFINED_SPECIFIER;
+
+Specifier Specifier::COMPONENT_PACKAGE_SPECIFIER(
+ Specifier::COMPONENT_UNDEFINED_KIND);//*COMPONENT_PACKAGE_KIND);
+
+Specifier Specifier::COMPONENT_SYSTEM_SPECIFIER(
+ Specifier::COMPONENT_SYSTEM_KIND );
+
+Specifier Specifier::COMPONENT_EXECUTABLE_SPECIFIER(
+ Specifier::COMPONENT_EXECUTABLE_KIND );
+
+Specifier Specifier::COMPONENT_PROCEDURE_SPECIFIER(
+ Specifier::COMPONENT_PROCEDURE_KIND );
+
+Specifier Specifier::EXECUTABLE_PROCEDURE_COMPOSITE_SPECIFIER(
+ Specifier::COMPONENT_PROCEDURE_KIND,
+ Specifier::MOC_COMPOSITE_STRUCTURE_KIND );
+
+Specifier Specifier::EXECUTABLE_PROCEDURE_MODEL_SPECIFIER(
+ Specifier::COMPONENT_PROCEDURE_KIND,
+ Specifier::DESIGN_MODEL_KIND );
+
+Specifier Specifier::EXECUTABLE_PROCEDURE_INSTANCE_STATIC_SPECIFIER(
+ Specifier::COMPONENT_PROCEDURE_KIND,
+ Specifier::DESIGN_INSTANCE_STATIC_KIND );
+
+
+/**
+ * EXECUTABLE DESIGN
+ */
+Specifier Specifier::DESIGN_MODEL_SPECIFIER(
+ Specifier::DESIGN_MODEL_KIND);
+
+Specifier Specifier::DESIGN_PROTOTYPE_STATIC_SPECIFIER(
+ Specifier::DESIGN_PROTOTYPE_STATIC_KIND);
+
+Specifier Specifier::DESIGN_INSTANCE_STATIC_SPECIFIER(
+ Specifier::DESIGN_INSTANCE_STATIC_KIND);
+
+Specifier Specifier::DESIGN_INSTANCE_DYNAMIC_SPECIFIER(
+ Specifier::DESIGN_INSTANCE_DYNAMIC_KIND);
+
+
+////////////////////////////////////////////////////////////////////////////////
+// SCOPE <KIND
+////////////////////////////////////////////////////////////////////////////////
+
+Specifier::SCOPE_KIND Specifier::toScope(const std::string & id)
+{
+ if( id == "machine" ) return SCOPE_MACHINE_KIND;
+
+ if( id == "program" ) return SCOPE_PROGRAM_KIND;
+
+ if( id == "transition" ) return SCOPE_TRANSITION_KIND;
+
+ if( id == "routine" ) return SCOPE_ROUTINE_KIND;
+
+ if( id == "runnable" ) return SCOPE_RUNNABLE_KIND;
+
+ return SCOPE_UNDEFINED_KIND;
+}
+
+
+std::string Specifier::strScope(SCOPE_KIND kind)
+{
+ switch( kind )
+ {
+ case SCOPE_MACHINE_KIND : return( "machine" );
+
+ case SCOPE_PROGRAM_KIND : return( "program" );
+
+ case SCOPE_TRANSITION_KIND : return( "transition" );
+
+ case SCOPE_ROUTINE_KIND : return( "routine" );
+
+ case SCOPE_RUNNABLE_KIND : return( "runnable" );
+
+ case SCOPE_UNDEFINED_KIND : return( "undefined<specifier#scope#kind>");
+
+ default : return( "unknown<specifier#scope#kind>" );
+ }
+}
+
+
+/**
+ * SETTER
+ */
+Specifier & Specifier::set(const std::string strSpecifier)
+{
+#define IF_IS( spec ) if( strSpecifier == spec )
+#define IF_HAS( spec ) if( strSpecifier.find(spec) != std::string::npos )
+
+ IF_HAS( "executable" ) { setComponentExecutable(); }
+ IF_HAS( "machine" ) { setComponentExecutable(); }
+ IF_HAS( "statemachine" ) { setComponentStatemachine(); }
+ IF_HAS( "system" ) { setComponentSystem(); }
+ IF_HAS( "procedure" ) { setComponentProcedure(); }
+
+ IF_HAS( "package" ) { /*setComponentPackage();*/ }
+
+
+ IF_HAS( "group" ) { setGroupMasK(); }
+ IF_HAS( "every" ) { setGroupEvery(); }
+ IF_HAS( "some" ) { setGroupSome(); }
+ IF_HAS( "except" ) { setGroupExcept(); }
+
+ IF_HAS( "composite" ) { setMocComposite(); }
+ IF_HAS( "and" ) { setMocCompositeStructure(); }
+
+ IF_HAS( "or" ) { setMocStateTransitionSystem(); }
+ IF_HAS( "STS" ) { setMocStateTransitionSystem(); }
+ IF_HAS( "stf" ) { setMocStateTransitionFlow(); }
+ IF_HAS( "STF" ) { setMocStateTransitionFlow(); }
+
+ IF_HAS( "flow" ) { setCompositeMocDataFlow(); }
+ IF_HAS( "DF" ) { setCompositeMocDataFlow(); }
+
+ IF_HAS( "simple" ) { setStateMocSIMPLE(); }
+ IF_HAS( "start" ) { setStateMocSTART(); }
+ IF_HAS( "final" ) { setStateMocFINAL(); }
+ IF_HAS( "sync" ) { setStateMocSYNC(); }
+
+ IF_HAS( "initial" ) { setPseudostateMocINITIAL(); }
+ IF_HAS( "terminal" ) { setPseudostateMocTERMINAL(); }
+ IF_HAS( "return" ) { setPseudostateMocRETURN(); }
+
+ IF_HAS( "junction" ) { setPseudostateMocJUNCTION(); }
+ IF_HAS( "choice" ) { setPseudostateMocCHOICE(); }
+
+ IF_HAS( "fork" ) { setPseudostateMocFORK(); }
+ IF_HAS( "join" ) { setPseudostateMocJOIN(); }
+
+ IF_HAS( "dhistory" ) { setPseudostateMocDEEP_HISTORY(); }
+ IF_HAS( "deepHistory" ) { setPseudostateMocDEEP_HISTORY(); }
+
+ IF_HAS( "shistory" ) { setPseudostateMocSHALLOW_HISTORY(); }
+ IF_HAS( "shallowHistory" ) { setPseudostateMocSHALLOW_HISTORY(); }
+
+ IF_HAS( "history" ) { setPseudostateMocSHALLOW_HISTORY(); }
+
+ return( *this );
+}
+
+
+Specifier & Specifier::setMoc(const std::string strSpecifier)
+{
+#define IF_HAS( spec ) if( strSpecifier.find(spec) != std::string::npos )
+
+ IF_HAS( "composite" ) { setMocComposite(); }
+ IF_HAS( "and" ) { setMocCompositeStructure(); }
+
+ IF_HAS( "or" ) { setMocStateTransitionSystem(); }
+ IF_HAS( "sts" ) { setMocStateTransitionSystem(); }
+ IF_HAS( "STS" ) { setMocStateTransitionSystem(); }
+ IF_HAS( "stf" ) { setMocStateTransitionFlow(); }
+ IF_HAS( "STF" ) { setMocStateTransitionFlow(); }
+
+ IF_HAS( "flow" ) { setCompositeMocDataFlow(); }
+ IF_HAS( "DF" ) { setCompositeMocDataFlow(); }
+
+ IF_HAS( "simple" ) { setStateMocSIMPLE(); }
+ IF_HAS( "start" ) { setStateMocSTART(); }
+ IF_HAS( "final" ) { setStateMocFINAL(); }
+ IF_HAS( "sync" ) { setStateMocSYNC(); }
+
+ IF_HAS( "initial" ) { setPseudostateMocINITIAL(); }
+ IF_HAS( "terminal" ) { setPseudostateMocTERMINAL(); }
+ IF_HAS( "return" ) { setPseudostateMocRETURN(); }
+
+ IF_HAS( "junction" ) { setPseudostateMocJUNCTION(); }
+ IF_HAS( "choice" ) { setPseudostateMocCHOICE(); }
+
+ IF_HAS( "fork" ) { setPseudostateMocFORK(); }
+ IF_HAS( "join" ) { setPseudostateMocJOIN(); }
+
+ IF_HAS( "dhistory" ) { setPseudostateMocDEEP_HISTORY(); }
+ IF_HAS( "deepHistory" ) { setPseudostateMocDEEP_HISTORY(); }
+
+ IF_HAS( "shistory" ) { setPseudostateMocSHALLOW_HISTORY(); }
+ IF_HAS( "shallowHistory" ) { setPseudostateMocSHALLOW_HISTORY(); }
+
+ IF_HAS( "history" ) { setPseudostateMocSHALLOW_HISTORY(); }
+
+ return( *this );
+}
+
+
+/**
+ * STRING TO DESIGN KIND
+ */
+Specifier::DESIGN_KIND Specifier::toDesignKind(const std::string & strDesign)
+{
+ std::string aDesign = strDesign;
+ StringTools::tolower(aDesign);
+
+ if( aDesign == "instance" )
+ {
+ return( Specifier::DESIGN_INSTANCE_KIND );
+ }
+ else if( (aDesign == "model") || (aDesign == "form") )
+ {
+ return( Specifier::DESIGN_MODEL_KIND );
+
+ }
+ else if( aDesign == "prototype" )
+ {
+ return( Specifier::DESIGN_PROTOTYPE_STATIC_KIND );
+ }
+
+ else if( aDesign == "dynamic" )
+ {
+ return( Specifier::DESIGN_DYNAMIC_KIND );
+ }
+ else if( aDesign == "runtime" )
+ {
+ return( Specifier::DESIGN_RUNTIME_KIND );
+ }
+// else if( aDesign == "meta" )
+// {
+// return( Specifier::DESIGN_META_KIND );
+// }
+ else
+ {
+ return( Specifier::DESIGN_UNDEFINED_KIND );
+ }
+}
+
+
+/**
+ * COMPONENT KIND to STRING
+ */
+std::string Specifier::keywordComponent(bit_field_t componentKind)
+{
+ switch( componentKind )
+ {
+ case COMPONENT_UNDEFINED_KIND:
+ return( "<keyword:component:undef>" );
+
+ case COMPONENT_SYSTEM_KIND:
+ return( "system" );
+
+ case COMPONENT_EXECUTABLE_KIND:
+ return( "executable" );
+
+ case COMPONENT_PROCEDURE_KIND:
+ return( "procedure" );
+
+ case COMPONENT_ROUTINE_KIND:
+ return( "routine" );
+
+ case COMPONENT_STATEMACHINE_KIND:
+ return( "statemachine" );
+
+ case COMPONENT_STATE_KIND:
+ return( "state" );
+
+ case COMPONENT_PSEUDOSTATE_KIND:
+// return( "pseudostate" );
+ return( "state" );
+
+ default:
+ return( xstrComponent(componentKind, "#") );
+ }
+}
+
+
+std::string Specifier::strComponent(
+ bit_field_t componentKind, const std::string & separator)
+{
+ switch( componentKind )
+ {
+ case COMPONENT_UNDEFINED_KIND:
+ return( "" );
+// return( "<component:undef>" + separator );
+
+ case COMPONENT_SYSTEM_KIND:
+ return( "system" + separator );
+
+ case COMPONENT_EXECUTABLE_KIND:
+ return( "executable" + separator );
+
+ case COMPONENT_PROCEDURE_KIND:
+ return( "procedure" + separator );
+
+ case COMPONENT_ROUTINE_KIND:
+ return( "routine" + separator );
+
+ case COMPONENT_STATEMACHINE_KIND:
+ return( "statemachine" + separator );
+
+ case COMPONENT_STATE_KIND:
+ return( "state" + separator );
+
+ case COMPONENT_PSEUDOSTATE_KIND:
+ return( "pseudostate" + separator );
+
+ default:
+ return( xstrComponent(componentKind, separator) );
+ }
+}
+
+
+std::string Specifier::xstrComponent(
+ bit_field_t componentKind, const std::string & separator)
+{
+ if( componentKind != COMPONENT_UNDEFINED_KIND)
+ {
+ std::ostringstream oss;
+
+ if( (componentKind & COMPONENT_SYSTEM_KIND) != 0 )
+ {
+ oss << "system" << separator;
+ }
+
+ if( (componentKind & COMPONENT_EXECUTABLE_KIND) != 0 )
+ {
+ oss << "executable" << separator;
+ }
+
+ if( (componentKind & COMPONENT_PROCEDURE_KIND) != 0 )
+ {
+ oss << "procedure" << separator;
+ }
+ if( (componentKind & COMPONENT_ROUTINE_KIND) != 0 )
+ {
+ oss << "routine" << separator;
+ }
+
+ if( (componentKind & COMPONENT_STATEMACHINE_KIND) != 0 )
+ {
+ oss << "statemachine" << separator;
+ }
+ if( (componentKind & COMPONENT_STATE_KIND) != 0 )
+ {
+ oss << "state" << separator;
+ }
+ if( (componentKind & COMPONENT_PSEUDOSTATE_KIND) != 0 )
+ {
+ oss << "pseudostate" << separator;
+ }
+
+ return( oss.str() );
+ }
+
+ return "<component:undef>";
+}
+
+
+/**
+ * COMPOSITE MOC to STRING
+ */
+std::string Specifier::strModelOfComputation(
+ bit_field_t modelOfComputationKind, const std::string & separator)
+{
+ switch( modelOfComputationKind )
+ {
+ case MOC_UNDEFINED_KIND:
+ return( "" );
+// return( "<composite:undef>" + separator );
+
+ case MOC_COMPOSITE_STRUCTURE_KIND:
+ return( "and" + separator );
+
+ case MOC_STATE_TRANSITION_STRUCTURE_KIND:
+ return( "or" + separator );
+
+ case MOC_STATE_TRANSITION_SYSTEM_KIND:
+ return( "#STS" + separator );
+
+ case MOC_STATE_TRANSITION_FLOW_KIND:
+ return( "#STF" + separator );
+
+ case MOC_DATA_FLOW_KIND:
+ return( "#DF" + separator );
+
+ case MOC_COMPOSITE_MASK_KIND:
+ return( "composite" + separator );
+
+ default:
+ return( "<composite:unknown>" + separator );
+ }
+}
+
+
+/**
+ * GROUP KIND to STRING
+ */
+std::string Specifier::strGroup(
+ bit_field_t groupKind, const std::string & separator)
+{
+ switch( groupKind )
+ {
+ case GROUP_UNDEFINED_KIND:
+ return( "" );
+// return( "<group:undef>" + separator );
+
+ case GROUP_EVERY_KIND:
+ return( "every" + separator );
+
+ case GROUP_SOME_KIND:
+ return( "some" + separator );
+
+ case GROUP_EXCEPT_KIND:
+ return( "except" + separator );
+
+ case GROUP_MASK_KIND:
+ return( "group" + separator );
+
+ default:
+ return( "<group:unknown>" + separator );
+ }
+}
+
+
+/**
+ * STATE MOC to STRING
+ */
+std::string Specifier::strStateMoc(
+ bit_field_t stateMoc, const std::string & separator)
+{
+ switch( stateMoc )
+ {
+ case STATE_UNDEFINED_MOC:
+ return( "" );
+// return( "<state:undef>" + separator );
+
+ case STATE_SIMPLE_MOC:
+ return( "simple" + separator );
+
+ case STATE_START_MOC:
+ return( "start" + separator );
+
+ case STATE_FINAL_MOC:
+ return( "final" + separator );
+
+ case STATE_SYNC_MOC:
+ return( "sync" + separator );
+
+ default:
+ return( xstrStateMoc(stateMoc, separator) );
+ }
+}
+
+
+std::string Specifier::xstrStateMoc(
+ bit_field_t stateMoc, const std::string & separator)
+{
+ if( stateMoc != STATE_UNDEFINED_MOC)
+ {
+ std::ostringstream oss;
+
+ if( (stateMoc & STATE_SIMPLE_MOC) != 0 )
+ {
+ oss << "simple" << separator;
+ }
+ if( (stateMoc & STATE_START_MOC) != 0 )
+ {
+ oss << "start" << separator;
+ }
+ if( (stateMoc & STATE_FINAL_MOC) != 0 )
+ {
+ oss << "final" << separator;
+ }
+ if( (stateMoc & STATE_SYNC_MOC) != 0 )
+ {
+ oss << "sync" << separator;
+ }
+
+ return( oss.str() );
+ }
+
+ return "<state:undef>";
+}
+
+
+/**
+ * PSEUDOSTATE MOC to STRING
+ */
+std::string Specifier::strPseudostateMoc(
+ bit_field_t pseudostateMoc, const std::string & separator)
+{
+ switch( pseudostateMoc )
+ {
+ case PSEUDOSTATE_UNDEFINED_MOC:
+ return( "" );
+// return( "<pseudostate:undef>" + separator );
+
+ case PSEUDOSTATE_INITIAL_MOC:
+ return( "initial" + separator );
+ case PSEUDOSTATE_TERMINAL_MOC:
+ return( "terminal" + separator );
+
+ case PSEUDOSTATE_RETURN_MOC:
+ return( "return" + separator );
+
+ case PSEUDOSTATE_JUNCTION_MOC:
+ return( "junction" + separator );
+ case PSEUDOSTATE_CHOICE_MOC:
+ return( "choice" + separator );
+
+ case PSEUDOSTATE_ENTRY_POINT_MOC:
+ return( "entryPoint" + separator );
+ case PSEUDOSTATE_EXIT_POINT_MOC:
+ return( "exitPoint" + separator );
+
+ case PSEUDOSTATE_FORK_MOC:
+ return( "fork" + separator );
+ case PSEUDOSTATE_JOIN_MOC:
+ return( "join" + separator );
+
+ case PSEUDOSTATE_DEEP_HISTORY_MOC:
+ return( "dhistory" + separator );
+ case PSEUDOSTATE_SHALLOW_HISTORY_MOC:
+ return( "shistory" + separator );
+
+ default:
+ return( xstrPseudostateMoc(pseudostateMoc, separator) );
+ }
+}
+
+
+std::string Specifier::xstrPseudostateMoc(
+ bit_field_t pseudostateMoc, const std::string & separator)
+{
+ if( pseudostateMoc != PSEUDOSTATE_UNDEFINED_MOC)
+ {
+ std::ostringstream oss;
+
+ if( (pseudostateMoc & PSEUDOSTATE_INITIAL_MOC) != 0 )
+ {
+ oss << "initial" << separator;
+ }
+ if( (pseudostateMoc & PSEUDOSTATE_TERMINAL_MOC) != 0 )
+ {
+ oss << "terminal" << separator;
+ }
+
+ if( (pseudostateMoc & PSEUDOSTATE_RETURN_MOC) != 0 )
+ {
+ oss << "return" << separator;
+ }
+
+ if( (pseudostateMoc & PSEUDOSTATE_JUNCTION_MOC) != 0 )
+ {
+ oss << "junction" << separator;
+ }
+ if( (pseudostateMoc & PSEUDOSTATE_CHOICE_MOC) != 0 )
+ {
+ oss << "choice" << separator;
+ }
+
+ if( (pseudostateMoc & PSEUDOSTATE_ENTRY_POINT_MOC) != 0 )
+ {
+ oss << "entryPoint" << separator;
+ }
+ if( (pseudostateMoc & PSEUDOSTATE_EXIT_POINT_MOC) != 0 )
+ {
+ oss << "exitPoint" << separator;
+ }
+
+ if( (pseudostateMoc & PSEUDOSTATE_FORK_MOC) != 0 )
+ {
+ oss << "fork" << separator;
+ }
+ if( (pseudostateMoc & PSEUDOSTATE_JOIN_MOC) != 0 )
+ {
+ oss << "join" << separator;
+ }
+
+ if( (pseudostateMoc & PSEUDOSTATE_DEEP_HISTORY_MOC) != 0 )
+ {
+ oss << "dhistory" << separator;
+ }
+ if( (pseudostateMoc & PSEUDOSTATE_SHALLOW_HISTORY_MOC) != 0 )
+ {
+ oss << "shistory" << separator;
+ }
+
+ return( oss.str() );
+ }
+
+ return "<pseudostate:undef>";
+}
+
+
+/**
+ * DESIGN KIND to STRING
+ */
+std::string Specifier::strFeature(
+ bit_field_t featureKind, const std::string & separator)
+{
+ if( (featureKind != FEATURE_UNDEFINED_KIND) )
+ {
+ std::ostringstream oss;
+
+ if( (featureKind & FEATURE_TIMED_KIND) != 0 )
+ {
+ oss << "timed" << separator;
+ }
+ if( (featureKind & FEATURE_INPUT_ENABLED_KIND) != 0 )
+ {
+ oss << "input_enabled" << separator;
+ }
+ if( (featureKind & FEATURE_LIFELINE_KIND) != 0 )
+ {
+ oss << "lifeline" << separator;
+ }
+
+ return( oss.str() );
+ }
+
+ return( "" /*"<feature:undef>"*/ );
+}
+
+
+/**
+ * DESIGN KIND to STRING
+ */
+std::string Specifier::strDesign_not(
+ DESIGN_KIND designKind, const std::string & separator) const
+{
+ if( isDesignKind(designKind) )
+ {
+ return( "" );
+ }
+ else if( isDesignPrototypeStatic() )
+ {
+ return( strDesign(this->design, separator) );
+ }
+ else
+ {
+ switch( designKind )
+ {
+ case DESIGN_MODEL_KIND:
+ case DESIGN_INSTANCE_KIND:
+ case DESIGN_DYNAMIC_KIND:
+ case DESIGN_STATIC_KIND:
+ case DESIGN_RUNTIME_KIND:
+ {
+ return( strDesign(this->design & (~ designKind), separator) );
+ }
+ default:
+ {
+ return( strDesign(this->design, separator) );
+ }
+ }
+ }
+}
+
+
+std::string Specifier::strDesign(
+ bit_field_t designKind, const std::string & separator)
+{
+ switch( designKind )
+ {
+ case DESIGN_UNDEFINED_KIND:
+ return( "" );
+// return( "<design:undef>" + separator );
+// case DESIGN_META_KIND:
+// return( "#meta" + separator );
+
+ case DESIGN_MODEL_KIND:
+ return( "#model" + separator );
+ case DESIGN_INSTANCE_KIND:
+ return( "#instance" + separator );
+ case DESIGN_STATIC_KIND:
+ return( "#static" + separator );
+ case DESIGN_DYNAMIC_KIND:
+ return( "#dynamic" + separator );
+ case DESIGN_RUNTIME_KIND:
+ return( "#runtime" + separator );
+
+ case DESIGN_INSTANCE_STATIC_KIND:
+ return( "#static#instance" + separator );
+ case DESIGN_INSTANCE_DYNAMIC_KIND:
+ return( "#dynamic#instance" + separator );
+
+ case DESIGN_PROTOTYPE_STATIC_KIND:
+// return( "#static #prototype" + separator );
+ return( "#prototype" + separator );
+ case DESIGN_PROTOTYPE_DYNAMIC_KIND:
+ return( "#dynamic #prototype" + separator );
+
+ default:
+ return( xstrDesign(designKind, separator) );
+ }
+}
+
+
+std::string Specifier::xstrDesign(
+ bit_field_t designKind, const std::string & separator)
+{
+ if( (designKind != DESIGN_UNDEFINED_KIND) )
+// && (designKind != DESIGN_META_KIND) )
+ {
+ std::ostringstream oss;
+
+ if( (designKind & DESIGN_MODEL_KIND) != 0 )
+ {
+ oss << "#model" << separator;
+ }
+ else if( (designKind & DESIGN_INSTANCE_KIND) != 0 )
+ {
+ oss << "#instance" << separator;
+ }
+ else if( (designKind & DESIGN_STATIC_KIND) != 0 )
+ {
+ oss << "#static" << separator;
+ }
+ else if( (designKind & DESIGN_DYNAMIC_KIND) != 0 )
+ {
+ oss << "#dynamic" << separator;
+ }
+ if( (designKind & DESIGN_RUNTIME_KIND) != 0 )
+ {
+ oss << "#runtime" << separator;
+ }
+
+ return( oss.str() );
+ }
+
+ return( "<design:undef>" );
+}
+
+
+/**
+ * Serialization
+ */
+std::string Specifier::SEPARATOR = " % ";
+
+
+std::string Specifier::toString(bit_field_t enabledFields,
+ const std::string & separator) const
+{
+ std::ostringstream oss;
+
+ if( (enabledFields & FIELD_FEATURE_POSITION) != 0 )
+ {
+ oss << Specifier::strFeature( feature , separator );
+ }
+
+ if( (enabledFields & FIELD_PSEUDOSTATE_POSITION) != 0 )
+ {
+ oss << Specifier::strPseudostateMoc( pseudostate , separator );
+ }
+ if( (enabledFields & FIELD_STATE_POSITION) != 0 )
+ {
+ oss << Specifier::strStateMoc( state , separator );
+ }
+
+ if( (enabledFields & FIELD_COMPUTATION_POSITION) != 0 )
+ {
+ oss << Specifier::strModelOfComputation( computation , separator );
+ }
+
+ if( (enabledFields & FIELD_DESIGN_POSITION) != 0 )
+ {
+ oss << Specifier::strDesign( design , separator);
+ }
+
+ if( (enabledFields & FIELD_GROUP_POSITION) != 0 )
+ {
+ oss << Specifier::strGroup ( group , separator );
+ }
+
+ if( (enabledFields & FIELD_COMPONENT_POSITION) != 0 )
+ {
+ oss << Specifier::strComponent( component , separator );
+ }
+
+ return( oss.str() );
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/common/SpecifierElement.h b/org.eclipse.efm.symbex/src/fml/common/SpecifierElement.h
new file mode 100644
index 0000000..7ad71b5
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/common/SpecifierElement.h
@@ -0,0 +1,2658 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 21 avr. 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#ifndef FML_COMMON_SPECIFIERELEMENT_H_
+#define FML_COMMON_SPECIFIERELEMENT_H_
+
+#include <util/avm_numeric.h>
+#include <util/avm_string.h>
+
+
+
+namespace sep
+{
+
+
+class Specifier
+{
+
+public:
+ /**
+ * SCOPE_KIND
+ * 3 bits
+ */
+ enum SCOPE_KIND
+ {
+ SCOPE_MACHINE_KIND,
+
+ SCOPE_PROGRAM_KIND,
+
+ SCOPE_TRANSITION_KIND,
+
+ SCOPE_ROUTINE_KIND,
+
+ SCOPE_RUNNABLE_KIND,
+
+ SCOPE_UNDEFINED_KIND
+ };
+
+ // Utils
+ static SCOPE_KIND toScope(const std::string & id);
+
+ static std::string strScope(SCOPE_KIND mMocKind);
+
+
+ /**
+ * COMPONENT_KIND
+ * 7 bits
+ */
+ enum COMPONENT_KIND {
+
+ COMPONENT_UNDEFINED_KIND = 0x000,
+
+ COMPONENT_SYSTEM_KIND = 0x001,
+
+ COMPONENT_EXECUTABLE_KIND = 0x002,
+
+
+ COMPONENT_PROCEDURE_KIND = 0x004,
+
+ COMPONENT_ROUTINE_KIND = 0x008,
+
+
+ COMPONENT_STATEMACHINE_KIND = 0x010,
+
+ COMPONENT_STATE_KIND = 0x020,//| COMPONENT_STATEMACHINE_KIND,
+
+ COMPONENT_PSEUDOSTATE_KIND = 0x040,//| COMPONENT_STATE_KIND,
+
+
+ FAMILY_COMPONENT_STATE_KIND = COMPONENT_STATE_KIND
+ | COMPONENT_PSEUDOSTATE_KIND,
+
+ FAMILY_COMPONENT_STATEMACHINE_KIND = COMPONENT_STATEMACHINE_KIND
+ | FAMILY_COMPONENT_STATE_KIND,
+
+ FAMILY_COMPONENT_COMPOSITE_KIND = COMPONENT_SYSTEM_KIND
+ | COMPONENT_STATEMACHINE_KIND
+ | COMPONENT_EXECUTABLE_KIND,
+
+
+ };
+
+
+ /**
+ * Model Of Computation
+ * MOC_KIND
+ * 6 bits
+ */
+ enum MOC_KIND {
+
+ MOC_UNDEFINED_KIND = 0x000,
+
+ MOC_COMPOSITE_MASK_KIND = 0x001,
+
+ MOC_COMPOSITE_STRUCTURE_KIND = 0x002 | MOC_COMPOSITE_MASK_KIND,
+
+
+ MOC_STATE_TRANSITION_STRUCTURE_KIND = 0x004 | MOC_COMPOSITE_MASK_KIND,
+
+ MOC_STATE_TRANSITION_SYSTEM_KIND = 0x008 | MOC_STATE_TRANSITION_STRUCTURE_KIND,
+
+ MOC_STATE_TRANSITION_FLOW_KIND = 0x010 | MOC_STATE_TRANSITION_STRUCTURE_KIND,
+
+
+ MOC_DATA_FLOW_KIND = 0x020 | MOC_COMPOSITE_MASK_KIND,
+
+ };
+
+
+ /**
+ * GROUP_KIND
+ * 3 bits
+ */
+ enum GROUP_KIND
+ {
+
+ GROUP_UNDEFINED_KIND = 0x000,
+
+ GROUP_MASK_KIND = 0x001,
+
+ GROUP_SOME_KIND = 0x002 | GROUP_MASK_KIND,
+
+ GROUP_EXCEPT_KIND = 0x004 | GROUP_MASK_KIND,
+
+ GROUP_EVERY_KIND = 0x006 | GROUP_MASK_KIND
+
+ };
+
+
+ /**
+ * STATE_MOC
+ * 4 bits
+ */
+ enum STATE_MOC
+ {
+
+ STATE_UNDEFINED_MOC = 0x000,
+
+ STATE_SIMPLE_MOC = 0x001,
+
+ STATE_START_MOC = 0x002,
+
+ STATE_FINAL_MOC = 0x004,
+
+ STATE_SYNC_MOC = 0x008
+
+ };
+
+
+ /**
+ * PSEUDOSTATE_MOC
+ * 11 bits
+ */
+ enum PSEUDOSTATE_MOC
+ {
+
+ PSEUDOSTATE_UNDEFINED_MOC = 0x000,
+
+ PSEUDOSTATE_INITIAL_MOC = 0x001,
+
+ PSEUDOSTATE_TERMINAL_MOC = 0x002,
+ PSEUDOSTATE_RETURN_MOC = 0x004,
+
+ FAMILY_PSEUDO_ENDING_MOC = PSEUDOSTATE_TERMINAL_MOC
+ | PSEUDOSTATE_RETURN_MOC,
+
+ PSEUDOSTATE_JUNCTION_MOC = 0x008,
+ PSEUDOSTATE_CHOICE_MOC = 0x010,
+
+ PSEUDOSTATE_ENTRY_POINT_MOC = 0x020,
+ PSEUDOSTATE_EXIT_POINT_MOC = 0x040,
+
+ FAMILY_PSEUDO_CONNECTION_POINT_MOC = PSEUDOSTATE_ENTRY_POINT_MOC
+ | PSEUDOSTATE_EXIT_POINT_MOC,
+
+ PSEUDOSTATE_FORK_MOC = 0x080,
+ PSEUDOSTATE_JOIN_MOC = 0x100,
+
+ PSEUDOSTATE_DEEP_HISTORY_MOC = 0x200,
+ PSEUDOSTATE_SHALLOW_HISTORY_MOC = 0x400,
+
+ FAMILY_PSEUDO_HISTORY_MOC = PSEUDOSTATE_DEEP_HISTORY_MOC
+ | PSEUDOSTATE_SHALLOW_HISTORY_MOC,
+
+ };
+
+
+ /**
+ * FEATURE_KIND
+ * 3 bits
+ */
+ enum FEATURE_KIND
+ {
+ FEATURE_UNDEFINED_KIND = 0x000, // DEFAULT
+
+ FEATURE_TIMED_KIND = 0x001,
+
+ FEATURE_INPUT_ENABLED_KIND = 0x002,
+
+ FEATURE_LIFELINE_KIND = 0x004
+
+ };
+
+
+
+ /**
+ * DESIGN_KIND
+ * 5 bits
+ */
+ enum DESIGN_KIND
+ {
+ DESIGN_UNDEFINED_KIND = 0x000, // UNUSED
+// DESIGN_META_KIND = 0x000, // UNUSED
+
+ DESIGN_MODEL_KIND = 0x001,
+
+ DESIGN_INSTANCE_KIND = 0x002,
+
+ DESIGN_STATIC_KIND = 0x004,
+
+ DESIGN_DYNAMIC_KIND = 0x008,
+
+ DESIGN_RUNTIME_KIND = 0x010,
+
+ DESIGN_INSTANCE_STATIC_KIND = DESIGN_INSTANCE_KIND
+ | DESIGN_STATIC_KIND,
+
+ DESIGN_INSTANCE_DYNAMIC_KIND = DESIGN_INSTANCE_KIND
+ | DESIGN_DYNAMIC_KIND,
+
+ // DEFAULT
+ DESIGN_PROTOTYPE_STATIC_KIND = DESIGN_INSTANCE_STATIC_KIND
+ | DESIGN_MODEL_KIND,
+
+ DESIGN_PROTOTYPE_DYNAMIC_KIND = DESIGN_INSTANCE_DYNAMIC_KIND
+ | DESIGN_MODEL_KIND,
+
+ DESIGN_INSTANCE_RUNTIME_KIND = DESIGN_INSTANCE_KIND
+ | DESIGN_RUNTIME_KIND,
+
+ };
+
+
+ /**
+ * TYPEDEF
+ */
+ typedef unsigned short bit_field_t;
+
+ /**
+ * BIT FIELDS
+ */
+ bit_field_t component : 7;
+
+ bit_field_t computation : 6;
+
+ bit_field_t group : 3;
+
+ bit_field_t state : 4;
+
+ bit_field_t pseudostate : 11;
+
+ bit_field_t feature : 3;
+
+ bit_field_t design : 5;
+
+
+ /**
+ * ENABLING POSITION
+ */
+ enum
+ {
+ FIELD_COMPONENT_POSITION = 0x001,
+ FIELD_COMPUTATION_POSITION = 0x002,
+ FIELD_GROUP_POSITION = 0x004,
+ FIELD_STATE_POSITION = 0x008,
+ FIELD_PSEUDOSTATE_POSITION = 0x010,
+ FIELD_FEATURE_POSITION = 0x020,
+ FIELD_DESIGN_POSITION = 0x040,
+
+ ENABLE_ALL_FIELDS = 0xFFF,
+
+ ENABLE_COMPONENT_DESIGN_FIELD = FIELD_COMPONENT_POSITION
+ | FIELD_DESIGN_POSITION,
+
+ DISABLE_COMPONENT_DESIGN_FIELD = (~ ENABLE_COMPONENT_DESIGN_FIELD),
+
+ ENABLE_FEATURE_DESIGN_FIELD = FIELD_FEATURE_POSITION
+ | FIELD_DESIGN_POSITION,
+
+ DISABLE_FEATURE_DESIGN_FIELD = (~ ENABLE_FEATURE_DESIGN_FIELD)
+
+ };
+
+
+ /**
+ * STATIC EXECUTABLE SPECIFIER
+ */
+ static Specifier EXECUTABLE_UNDEFINED_SPECIFIER;
+
+ static Specifier COMPONENT_PACKAGE_SPECIFIER;
+
+ static Specifier COMPONENT_SYSTEM_SPECIFIER;
+
+ static Specifier COMPONENT_EXECUTABLE_SPECIFIER;
+
+ static Specifier COMPONENT_PROCEDURE_SPECIFIER;
+
+ static Specifier EXECUTABLE_PROCEDURE_COMPOSITE_SPECIFIER;
+
+ static Specifier EXECUTABLE_PROCEDURE_MODEL_SPECIFIER;
+
+ static Specifier EXECUTABLE_PROCEDURE_INSTANCE_STATIC_SPECIFIER;
+
+ /**
+ * EXECUTABLE DESIGN
+ */
+ static Specifier DESIGN_MODEL_SPECIFIER;
+
+ static Specifier DESIGN_PROTOTYPE_STATIC_SPECIFIER;
+
+ static Specifier DESIGN_INSTANCE_STATIC_SPECIFIER;
+
+ static Specifier DESIGN_INSTANCE_DYNAMIC_SPECIFIER;
+
+
+
+ /**
+ * CONSTRUCTORS
+ */
+ Specifier()
+ : component( COMPONENT_UNDEFINED_KIND ),
+ computation( MOC_UNDEFINED_KIND ),
+
+ group( GROUP_UNDEFINED_KIND ),
+ state( STATE_UNDEFINED_MOC ),
+ pseudostate( PSEUDOSTATE_UNDEFINED_MOC ),
+
+ feature( FEATURE_UNDEFINED_KIND ),
+ design( DESIGN_UNDEFINED_KIND )
+ {
+ //!! NOTHING
+ }
+
+ Specifier(bit_field_t componentKind,
+ bit_field_t modelOfComputationKind, bit_field_t groupKind,
+ bit_field_t stateMoc, bit_field_t pseudostateMoc,
+ bit_field_t featureKind, bit_field_t designKind)
+ : component( componentKind ),
+ computation( modelOfComputationKind ),
+
+ group( groupKind ),
+ state( stateMoc ),
+ pseudostate( pseudostateMoc ),
+
+ feature( featureKind ),
+ design( designKind )
+ {
+ //!! NOTHING
+ }
+
+ Specifier(COMPONENT_KIND componentKind, MOC_KIND modelOfComputationKind)
+ : component( componentKind ),
+ computation( modelOfComputationKind ),
+
+ group( GROUP_UNDEFINED_KIND ),
+ state( STATE_UNDEFINED_MOC ),
+ pseudostate( PSEUDOSTATE_UNDEFINED_MOC ),
+
+ feature( FEATURE_UNDEFINED_KIND ),
+ design( DESIGN_UNDEFINED_KIND )
+ {
+ //!! NOTHING
+ }
+
+ Specifier(COMPONENT_KIND componentKind, DESIGN_KIND designKind)
+ : component( componentKind ),
+ computation( MOC_UNDEFINED_KIND ),
+
+ group( GROUP_UNDEFINED_KIND ),
+ state( STATE_UNDEFINED_MOC ),
+ pseudostate( PSEUDOSTATE_UNDEFINED_MOC ),
+
+ feature( FEATURE_UNDEFINED_KIND ),
+ design( designKind )
+ {
+ //!! NOTHING
+ }
+
+ Specifier(COMPONENT_KIND componentKind)
+ : component( componentKind ),
+ computation( MOC_UNDEFINED_KIND ),
+
+ group( GROUP_UNDEFINED_KIND ),
+ state( STATE_UNDEFINED_MOC ),
+ pseudostate ( PSEUDOSTATE_UNDEFINED_MOC ),
+
+ feature( FEATURE_UNDEFINED_KIND ),
+ design( DESIGN_UNDEFINED_KIND )
+ {
+ //!! NOTHING
+ }
+
+ Specifier(MOC_KIND modelOfComputationKind)
+ : component( COMPONENT_UNDEFINED_KIND ),
+ computation( modelOfComputationKind ),
+
+ group( GROUP_UNDEFINED_KIND ),
+ state( STATE_UNDEFINED_MOC ),
+ pseudostate ( PSEUDOSTATE_UNDEFINED_MOC ),
+
+ feature( FEATURE_UNDEFINED_KIND ),
+ design( DESIGN_UNDEFINED_KIND )
+ {
+ //!! NOTHING
+ }
+
+ Specifier(GROUP_KIND groupKind)
+ : component( COMPONENT_UNDEFINED_KIND ),
+ computation( MOC_UNDEFINED_KIND ),
+
+ group( groupKind ),
+ state( STATE_UNDEFINED_MOC ),
+ pseudostate ( PSEUDOSTATE_UNDEFINED_MOC ),
+
+ feature( FEATURE_UNDEFINED_KIND ),
+ design( DESIGN_UNDEFINED_KIND )
+ {
+ //!! NOTHING
+ }
+
+ Specifier(STATE_MOC stateMoc)
+ : component( COMPONENT_UNDEFINED_KIND ),
+ computation( MOC_UNDEFINED_KIND ),
+
+ group( GROUP_UNDEFINED_KIND ),
+ state( stateMoc ),
+ pseudostate ( PSEUDOSTATE_UNDEFINED_MOC ),
+
+ feature( FEATURE_UNDEFINED_KIND ),
+ design( DESIGN_UNDEFINED_KIND )
+ {
+ //!! NOTHING
+ }
+
+ Specifier(PSEUDOSTATE_MOC pseudostateMoc)
+ : component( COMPONENT_UNDEFINED_KIND ),
+ computation( MOC_UNDEFINED_KIND ),
+
+ group( GROUP_UNDEFINED_KIND ),
+ state( STATE_UNDEFINED_MOC ),
+ pseudostate ( pseudostateMoc ),
+
+ feature( FEATURE_UNDEFINED_KIND ),
+ design( DESIGN_UNDEFINED_KIND )
+ {
+ //!! NOTHING
+ }
+
+ Specifier(FEATURE_KIND featureKind)
+ : component( COMPONENT_UNDEFINED_KIND ),
+ computation( MOC_UNDEFINED_KIND ),
+
+ group( GROUP_UNDEFINED_KIND ),
+ state( STATE_UNDEFINED_MOC ),
+ pseudostate ( PSEUDOSTATE_UNDEFINED_MOC ),
+
+ feature( featureKind ),
+ design( DESIGN_UNDEFINED_KIND )
+ {
+ //!! NOTHING
+ }
+
+ Specifier(DESIGN_KIND designKind)
+ : component( COMPONENT_UNDEFINED_KIND ),
+ computation( MOC_UNDEFINED_KIND ),
+
+ group( GROUP_UNDEFINED_KIND ),
+ state( STATE_UNDEFINED_MOC ),
+ pseudostate ( PSEUDOSTATE_UNDEFINED_MOC ),
+
+ feature( FEATURE_UNDEFINED_KIND ),
+ design( designKind )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ ~Specifier()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * TESTER
+ */
+ inline bool isDefined() const
+ {
+ return( (component != COMPONENT_UNDEFINED_KIND )
+ || (computation != MOC_UNDEFINED_KIND )
+ || (group != GROUP_UNDEFINED_KIND )
+ || (state != STATE_UNDEFINED_MOC )
+ || (pseudostate != PSEUDOSTATE_UNDEFINED_MOC)
+ || (feature != FEATURE_UNDEFINED_KIND )
+ || (design != DESIGN_UNDEFINED_KIND ) );
+ }
+
+
+ inline bool isDefined(bit_field_t enabledFields) const
+ {
+ return( (((enabledFields & FIELD_COMPONENT_POSITION ) != 0)
+ && (component != COMPONENT_UNDEFINED_KIND ))
+
+ || (((enabledFields & FIELD_COMPUTATION_POSITION) != 0)
+ && (computation != MOC_UNDEFINED_KIND ))
+
+ || (((enabledFields & FIELD_GROUP_POSITION ) != 0)
+ && (group != GROUP_UNDEFINED_KIND ))
+
+ || (((enabledFields & FIELD_STATE_POSITION ) != 0)
+ && (state != STATE_UNDEFINED_MOC ))
+
+ || (((enabledFields & FIELD_PSEUDOSTATE_POSITION) != 0)
+ && (pseudostate != PSEUDOSTATE_UNDEFINED_MOC ))
+
+ || (((enabledFields & FIELD_FEATURE_POSITION ) != 0)
+ && (feature != FEATURE_UNDEFINED_KIND ))
+
+ || (((enabledFields & FIELD_DESIGN_POSITION ) != 0)
+ && (design != DESIGN_UNDEFINED_KIND )) );
+ }
+
+
+ inline bool isDefined_otherThan(const Specifier & other) const
+ {
+ return( ( (*this) & (~ other) ).isDefined() );
+ }
+
+
+ inline bool isUndefined() const
+ {
+ return( (component == COMPONENT_UNDEFINED_KIND )
+ && (computation == MOC_UNDEFINED_KIND )
+ && (group == GROUP_UNDEFINED_KIND )
+ && (state == STATE_UNDEFINED_MOC )
+ && (pseudostate == PSEUDOSTATE_UNDEFINED_MOC)
+ && (feature == FEATURE_UNDEFINED_KIND )
+ && (design == DESIGN_UNDEFINED_KIND ) );
+ }
+
+
+ /**
+ * SETTER
+ */
+ Specifier & set(const std::string strSpecifier);
+
+ Specifier & setMoc(const std::string strSpecifier);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // OPERATOR =
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline Specifier & override_ifdef(const Specifier & other)
+ {
+ if( other.component != COMPONENT_UNDEFINED_KIND )
+ {
+ component = other.component;
+ }
+
+ if( other.computation != MOC_UNDEFINED_KIND )
+ {
+ computation = other.computation;
+ }
+
+ if( other.group != GROUP_UNDEFINED_KIND )
+ {
+ group = other.group;
+ }
+
+ if( other.state != STATE_UNDEFINED_MOC )
+ {
+ state = other.state;
+ }
+ if( other.pseudostate != PSEUDOSTATE_UNDEFINED_MOC )
+ {
+ pseudostate = other.pseudostate;
+ }
+
+ if( other.feature != FEATURE_UNDEFINED_KIND )
+ {
+ feature = other.feature;
+ }
+
+ if( other.design != DESIGN_UNDEFINED_KIND )
+ {
+ design = other.design;
+ }
+
+ return( *this );
+ }
+
+ inline Specifier & ifnot_define(const Specifier & other)
+ {
+ if( component == COMPONENT_UNDEFINED_KIND )
+ {
+ component = other.component;
+ }
+
+ if( (computation <= MOC_COMPOSITE_MASK_KIND)
+ && (other.computation != MOC_UNDEFINED_KIND) )
+ {
+ computation = other.computation;
+ }
+
+ if( (group <= GROUP_MASK_KIND)
+ && (other.group != GROUP_UNDEFINED_KIND) )
+ {
+ group = other.group;
+ }
+
+ if( state == STATE_UNDEFINED_MOC )
+ {
+ state = other.state;
+ }
+ if( pseudostate == PSEUDOSTATE_UNDEFINED_MOC )
+ {
+ pseudostate = other.pseudostate;
+ }
+
+ if( feature == FEATURE_UNDEFINED_KIND )
+ {
+ feature = other.feature;
+ }
+
+ if( design == DESIGN_UNDEFINED_KIND )
+ {
+ design = other.design;
+ }
+
+ return( *this );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // OPERATOR &=
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline Specifier & operator&=(const Specifier & other)
+ {
+ component &= other.component;
+ computation &= other.computation;
+ group &= other.group;
+ state &= other.state;
+ pseudostate &= other.pseudostate;
+ feature &= other.feature;
+ design &= other.design;
+
+ return( *this );
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // OPERATOR |=
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline Specifier & operator|=(const Specifier & other)
+ {
+ component |= other.component;
+ computation |= other.computation;
+ group |= other.group;
+ state |= other.state;
+ pseudostate |= other.pseudostate;
+ feature |= other.feature;
+ design |= other.design;
+
+ return( *this );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // OPERATOR == !=
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline bool operator==(const Specifier & other) const
+ {
+ return( (component == other.component )
+ && (computation == other.computation )
+ && (group == other.group )
+ && (state == other.state )
+ && (pseudostate == other.pseudostate)
+ && (feature == other.feature )
+ && (design == other.design ) );
+ }
+
+ inline bool operator!=(const Specifier & other) const
+ {
+ return( (component != other.component )
+ || (computation != other.computation )
+ || (group != other.group )
+ || (state != other.state )
+ || (pseudostate != other.pseudostate)
+ || (feature != other.feature )
+ || (design != other.design ) );
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // OPERATOR |
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline Specifier operator|(const Specifier & other) const
+ {
+ return( Specifier(
+ component | other.component,
+ computation | other.computation,
+ group | other.group,
+ state | other.state,
+ pseudostate | other.pseudostate,
+ feature | other.feature,
+ design | other.design ) );
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // OPERATOR &
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline Specifier operator&(const Specifier & other) const
+ {
+ return( Specifier(
+ component & other.component,
+ computation & other.computation,
+ group & other.group,
+ state & other.state,
+ pseudostate & other.pseudostate,
+ feature & other.feature,
+ design & other.design ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // OPERATOR &
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline Specifier operator~() const
+ {
+ return( Specifier(
+ (~ component),
+ (~ computation),
+ (~ group),
+ (~ state),
+ (~ pseudostate),
+ (~ feature),
+ (~ design) ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // COMPONENT KIND
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * GETTER - SETTER
+ * component
+ */
+ inline COMPONENT_KIND getComponentKind() const
+ {
+ return( static_cast< COMPONENT_KIND >( component ) );
+ }
+
+ inline bool hasComponentKind() const
+ {
+ return( component != COMPONENT_UNDEFINED_KIND );
+ }
+
+ inline bool noneComponentKind() const
+ {
+ return( component == COMPONENT_UNDEFINED_KIND );
+ }
+
+ inline bool isComponentKind(COMPONENT_KIND componentKind) const
+ {
+ return( component == componentKind );
+ }
+
+ inline Specifier & addComponentKind(COMPONENT_KIND componentKind)
+ {
+ component |= componentKind;
+
+ return( *this );
+ }
+
+ inline Specifier & remComponentKind(COMPONENT_KIND componentKind)
+ {
+ component &= (~ componentKind);
+
+ return( *this );
+ }
+
+ inline Specifier & setComponentKind(COMPONENT_KIND componentKind)
+ {
+ component = componentKind;
+
+ return( *this );
+ }
+
+ inline Specifier & unsetComponentKind()
+ {
+ component = COMPONENT_UNDEFINED_KIND;
+
+ return( *this );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * "system" component
+ */
+ inline bool isComponentSystem() const
+ {
+ return( component == COMPONENT_SYSTEM_KIND );
+ }
+
+ inline Specifier & setComponentSystem()
+ {
+ component = COMPONENT_SYSTEM_KIND;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "executable" component
+ */
+ inline bool isComponentExecutable() const
+ {
+ return( component == COMPONENT_EXECUTABLE_KIND );
+ }
+
+ inline Specifier & setComponentExecutable()
+ {
+ component = COMPONENT_EXECUTABLE_KIND;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "procedure" component
+ */
+ inline bool isComponentProcedure() const
+ {
+ return( component == COMPONENT_PROCEDURE_KIND );
+ }
+
+ inline Specifier & setComponentProcedure()
+ {
+ component = COMPONENT_PROCEDURE_KIND;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "routine" component
+ */
+ inline bool isComponentRoutine() const
+ {
+ return( component == COMPONENT_ROUTINE_KIND );
+ }
+
+ inline Specifier & setComponentRoutine()
+ {
+ component = COMPONENT_ROUTINE_KIND;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "statemachine" component
+ */
+ inline bool isComponentStatemachine() const
+ {
+ return( component == COMPONENT_STATEMACHINE_KIND );
+ }
+
+ inline Specifier & setComponentStatemachine()
+ {
+ component = COMPONENT_STATEMACHINE_KIND;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "state" component
+ */
+ inline bool isComponentState() const
+ {
+ return( component == COMPONENT_STATE_KIND );
+ }
+
+ inline Specifier & setComponentState()
+ {
+ component = COMPONENT_STATE_KIND;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "pseudostate" component
+ */
+ inline bool isComponentPseudostate() const
+ {
+ return( component == COMPONENT_PSEUDOSTATE_KIND );
+ }
+
+ inline Specifier & setComponentPseudostate()
+ {
+ component = COMPONENT_PSEUDOSTATE_KIND;
+
+ return( *this );
+ }
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // MODEL OF COMPUTATION
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * GETTER - SETTER
+ * Model Of Computation
+ */
+ inline MOC_KIND getModelOfComputation() const
+ {
+ return( static_cast< MOC_KIND >( computation ) );
+ }
+
+ inline bool hasModelOfComputation() const
+ {
+ return( computation != MOC_UNDEFINED_KIND );
+ }
+
+ inline bool isModelOfComputation(MOC_KIND modelOfComputationKind) const
+ {
+ return( computation == modelOfComputationKind );
+ }
+
+ inline Specifier & setModelOfComputation(MOC_KIND modelOfComputationKind)
+ {
+ computation = modelOfComputationKind;
+
+ return( *this );
+ }
+
+ inline Specifier & unsetModelOfComputation()
+ {
+ computation = MOC_UNDEFINED_KIND;
+
+ return( *this );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * "composite" Model Of Computation
+ */
+ inline bool hasMocComposite() const
+ {
+ return( (computation & MOC_COMPOSITE_MASK_KIND) != 0 );
+ }
+
+ inline bool noneMocComposite() const
+ {
+ return( computation == MOC_UNDEFINED_KIND );
+ }
+
+ inline Specifier & setMocComposite()
+ {
+ computation = MOC_COMPOSITE_MASK_KIND;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "AND" as composite structure MOC
+ */
+ inline bool isMocCompositeStructure() const
+ {
+ return( computation == MOC_COMPOSITE_STRUCTURE_KIND );
+ }
+
+ inline Specifier & setMocCompositeStructure()
+ {
+ computation = MOC_COMPOSITE_STRUCTURE_KIND;
+
+ return( *this );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * "OR" as State Transition MOC
+ */
+ inline bool isMocStateTransitionStructure() const
+ {
+ return( (computation & MOC_STATE_TRANSITION_STRUCTURE_KIND)
+ == MOC_STATE_TRANSITION_STRUCTURE_KIND );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "OR" as State Transition System MOC
+ * has at least one state< simple >
+ */
+ inline bool isMocStateTransitionSystem() const
+ {
+ return( computation == MOC_STATE_TRANSITION_SYSTEM_KIND );
+ }
+
+ inline Specifier & setMocStateTransitionSystem()
+ {
+ computation = MOC_STATE_TRANSITION_SYSTEM_KIND;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "OR" as State Transition Flow MOC
+ * has only pseudostate
+ */
+ inline bool isMocStateTransitionFlow() const
+ {
+ return( computation == MOC_STATE_TRANSITION_FLOW_KIND );
+ }
+
+ inline Specifier & setMocStateTransitionFlow()
+ {
+ computation = MOC_STATE_TRANSITION_FLOW_KIND;
+
+ return( *this );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * "FLOW" as DataFlow computation
+ */
+ inline bool isCompositeMocDataFlow() const
+ {
+ return( computation == MOC_DATA_FLOW_KIND );
+ }
+
+ inline Specifier & setCompositeMocDataFlow()
+ {
+ computation = MOC_DATA_FLOW_KIND;
+
+ return( *this );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // GROUP KIND
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * GETTER - SETTER
+ * group
+ */
+ inline GROUP_KIND getGroupKind() const
+ {
+ return( static_cast< GROUP_KIND >( group ) );
+ }
+
+ inline bool hasGroupKind() const
+ {
+ return( group != GROUP_UNDEFINED_KIND );
+ }
+
+ inline bool isGroupKind(GROUP_KIND groupKind) const
+ {
+ return( group == groupKind );
+ }
+
+ inline Specifier & setGroupKind(GROUP_KIND groupKind)
+ {
+ group = groupKind;
+
+ return( *this );
+ }
+
+ inline Specifier & unsetGroupKind()
+ {
+ group = GROUP_UNDEFINED_KIND;
+
+ return( *this );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * "group"
+ */
+ inline bool hasGroupMask() const
+ {
+ return( (group & GROUP_MASK_KIND) != 0 );
+ }
+
+ inline Specifier & setGroupMasK()
+ {
+ group = GROUP_MASK_KIND;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "some" group
+ */
+ inline bool isGroupSome() const
+ {
+ return( group == GROUP_SOME_KIND );
+ }
+
+ inline Specifier & setGroupSome()
+ {
+ group = GROUP_SOME_KIND;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "except" group
+ */
+ inline bool isGroupExcept() const
+ {
+ return( group == GROUP_EXCEPT_KIND );
+ }
+
+ inline Specifier & setGroupExcept()
+ {
+ group = GROUP_EXCEPT_KIND;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "every" group
+ */
+ inline bool isGroupEvery() const
+ {
+ return( group == GROUP_EVERY_KIND );
+ }
+
+ inline Specifier & setGroupEvery()
+ {
+ group = GROUP_EVERY_KIND;
+
+ return( *this );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // STATE MOC
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * GETTER - SETTER
+ * state
+ */
+ inline STATE_MOC getStateMoc() const
+ {
+ return( static_cast< STATE_MOC >( state ) );
+ }
+
+ inline bool hasStateMoc() const
+ {
+ return( state != STATE_UNDEFINED_MOC );
+ }
+
+ inline bool noneStateMoc() const
+ {
+ return( state == STATE_UNDEFINED_MOC );
+ }
+
+ inline bool isStateMoc(STATE_MOC stateMoc) const
+ {
+ return( state == stateMoc );
+ }
+
+ inline Specifier & addStateMoc(STATE_MOC stateMoc)
+ {
+ state |= stateMoc;
+
+ return( *this );
+ }
+
+ inline Specifier & remStateMoc(STATE_MOC stateMoc)
+ {
+ state &= (~ stateMoc);
+
+ return( *this );
+ }
+
+ inline Specifier & setStateMoc(STATE_MOC stateMoc)
+ {
+ state = stateMoc;
+
+ return( *this );
+ }
+
+ inline Specifier & unsetStateMoc()
+ {
+ state = STATE_UNDEFINED_MOC;
+
+ return( *this );
+ }
+
+ /**
+ * MIX-IN with component "state"
+ */
+ inline bool isState() const
+ {
+ return( isComponentState() && hasStateMoc() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * "SIMPLE" state
+ */
+ inline bool isStateMocSIMPLE() const
+ {
+ return( state == STATE_SIMPLE_MOC );
+ }
+
+ inline Specifier & setStateMocSIMPLE()
+ {
+ state = STATE_SIMPLE_MOC;
+
+ return( *this );
+ }
+
+ /**
+ * MIX-IN with component "state"
+ */
+ inline bool isStateSimple() const
+ {
+ return( isComponentState() && isStateMocSIMPLE() );
+ }
+
+ inline Specifier & setStateSimple()
+ {
+ setComponentState();
+ setStateMocSIMPLE();
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "START" state
+ */
+ inline bool isStateMocSTART() const
+ {
+ return( state == STATE_START_MOC );
+ }
+
+ inline bool hasStateMocSTART() const
+ {
+ return( (state & STATE_START_MOC) != 0 );
+ }
+
+ inline Specifier & addStateMocSTART()
+ {
+ state |= STATE_START_MOC;
+
+ return( *this );
+ }
+
+ inline Specifier & setStateMocSTART()
+ {
+ state = STATE_START_MOC;
+
+ return( *this );
+ }
+
+ /**
+ * MIX-IN with component "state"
+ */
+ inline bool isStateStart() const
+ {
+ return( isComponentState() && isStateMocSTART() );
+ }
+
+ inline Specifier & setStateStart()
+ {
+ setComponentState();
+ setStateMocSTART();
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "FINAL" state
+ */
+ inline bool isStateMocFINAL() const
+ {
+ return( state == STATE_FINAL_MOC );
+ }
+
+ inline bool hasStateMocFINAL() const
+ {
+ return( (state & STATE_FINAL_MOC) != 0 );
+ }
+
+ inline Specifier & addStateMocFINAL()
+ {
+ state |= STATE_FINAL_MOC;
+
+ return( *this );
+ }
+
+ inline Specifier & setStateMocFINAL()
+ {
+ state = STATE_FINAL_MOC;
+
+ return( *this );
+ }
+
+ /**
+ * MIX-IN with component "state"
+ */
+ inline bool isStateFinal() const
+ {
+ return( isComponentState() && isStateMocFINAL() );
+ }
+
+ inline Specifier & setStateFinal()
+ {
+ setComponentState();
+ setStateMocFINAL();
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "SYNC" state
+ */
+ inline bool isStateMocSYNC() const
+ {
+ return( state == STATE_SYNC_MOC );
+ }
+
+ inline Specifier & setStateMocSYNC()
+ {
+ state = STATE_SYNC_MOC;
+
+ return( *this );
+ }
+
+ /**
+ * MIX-IN with component "state"
+ */
+ inline bool isStateSync() const
+ {
+ return( isComponentState() && isStateMocSYNC() );
+ }
+
+ inline Specifier & setStateSync()
+ {
+ setComponentState();
+ setStateMocSYNC();
+
+ return( *this );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PSEUDOSTATE MOC
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * GETTER - SETTER
+ * pseudostate
+ */
+ inline PSEUDOSTATE_MOC getPseudostateMoc() const
+ {
+ return( static_cast< PSEUDOSTATE_MOC >( pseudostate ) );
+ }
+
+ inline bool hasPseudostateMoc() const
+ {
+ return( pseudostate != PSEUDOSTATE_UNDEFINED_MOC );
+ }
+
+ inline bool nonePseudostateMoc() const
+ {
+ return( pseudostate == PSEUDOSTATE_UNDEFINED_MOC );
+ }
+
+ inline bool isPseudostateMoc(PSEUDOSTATE_MOC pseudostateMoc) const
+ {
+ return( pseudostate == pseudostateMoc );
+ }
+
+ inline Specifier & addPseudostateMoc(PSEUDOSTATE_MOC pseudostateMoc)
+ {
+ pseudostate |= pseudostateMoc;
+
+ return( *this );
+ }
+
+ inline Specifier & remPseudostateMoc(PSEUDOSTATE_MOC pseudostateMoc)
+ {
+ pseudostate &= (~ pseudostateMoc);
+
+ return( *this );
+ }
+
+ inline Specifier & setPseudostateMoc(PSEUDOSTATE_MOC pseudostateMoc)
+ {
+ pseudostate = pseudostateMoc;
+
+ return( *this );
+ }
+
+ inline Specifier & unsetPseudostateMoc()
+ {
+ pseudostate = PSEUDOSTATE_UNDEFINED_MOC;
+
+ return( *this );
+ }
+
+ /**
+ * MIX-IN with component "pseudostate"
+ */
+ inline bool isPseudostate() const
+ {
+ return( isComponentPseudostate() && hasPseudostateMoc() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * "INITIAL" pseudostate
+ */
+ inline bool isPseudostateMocINITIAL() const
+ {
+ return( pseudostate == PSEUDOSTATE_INITIAL_MOC );
+ }
+
+ inline bool hasPseudostateMocINITIAL() const
+ {
+ return( (pseudostate & PSEUDOSTATE_INITIAL_MOC) != 0 );
+ }
+
+ inline Specifier & addPseudostateMocINITIAL()
+ {
+ pseudostate |= PSEUDOSTATE_INITIAL_MOC;
+
+ return( *this );
+ }
+
+ inline Specifier & setPseudostateMocINITIAL()
+ {
+ pseudostate = PSEUDOSTATE_INITIAL_MOC;
+
+ return( *this );
+ }
+
+ /**
+ * MIX-IN with component "pseudostate"
+ */
+ inline bool isPseudostateInitial() const
+ {
+ return( isComponentPseudostate() && isPseudostateMocINITIAL() );
+ }
+
+ inline Specifier & setPseudostateInitial()
+ {
+ setComponentPseudostate();
+ setPseudostateMocINITIAL();
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "TERMINAL" pseudostate
+ */
+ inline bool isPseudostateMocTERMINAL() const
+ {
+ return( pseudostate == PSEUDOSTATE_TERMINAL_MOC );
+ }
+
+ inline bool hasPseudostateMocTERMINAL() const
+ {
+ return( (pseudostate & PSEUDOSTATE_TERMINAL_MOC) != 0 );
+ }
+
+ inline Specifier & addPseudostateMocTERMINAL()
+ {
+ pseudostate |= PSEUDOSTATE_TERMINAL_MOC;
+
+ return( *this );
+ }
+
+ inline Specifier & setPseudostateMocTERMINAL()
+ {
+ pseudostate = PSEUDOSTATE_TERMINAL_MOC;
+
+ return( *this );
+ }
+
+ /**
+ * MIX-IN with component "pseudostate"
+ */
+ inline bool isPseudostateTerminal() const
+ {
+ return( isComponentPseudostate() && isPseudostateMocTERMINAL() );
+ }
+
+ inline Specifier & setPseudostateTerminal()
+ {
+ setComponentPseudostate();
+ setPseudostateMocTERMINAL();
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "RETURN" pseudostate
+ */
+ inline bool isPseudostateMocRETURN() const
+ {
+ return( pseudostate == PSEUDOSTATE_RETURN_MOC );
+ }
+
+ inline bool hasPseudostateMocRETURN() const
+ {
+ return( (pseudostate & PSEUDOSTATE_RETURN_MOC) != 0 );
+ }
+
+ inline Specifier & addPseudostateMocRETURN()
+ {
+ pseudostate |= PSEUDOSTATE_RETURN_MOC;
+
+ return( *this );
+ }
+
+ inline Specifier & setPseudostateMocRETURN()
+ {
+ pseudostate = PSEUDOSTATE_RETURN_MOC;
+
+ return( *this );
+ }
+
+
+ /**
+ * MIX-IN with component "pseudostate"
+ */
+ inline bool isPseudostateReturn() const
+ {
+ return( isComponentPseudostate() && isPseudostateMocRETURN() );
+ }
+
+ inline Specifier & setPseudostateReturn()
+ {
+ setComponentPseudostate();
+ setPseudostateMocRETURN();
+
+ return( *this );
+ }
+
+ /**
+ * MIX-IN with component "pseudostate"
+ */
+ inline bool hasFamilyPseudostateENDING() const
+ {
+ return( (pseudostate & FAMILY_PSEUDO_ENDING_MOC) != 0 );
+ }
+
+ inline bool hasFamilyPseudostateEnding() const
+ {
+ return( isComponentPseudostate() && hasFamilyPseudostateENDING() );
+ }
+
+
+
+ /**
+ * GETTER - SETTER
+ * "JUNCTION" pseudostate
+ */
+ inline bool isPseudostateMocJUNCTION() const
+ {
+ return( pseudostate == PSEUDOSTATE_JUNCTION_MOC );
+ }
+
+ inline Specifier & setPseudostateMocJUNCTION()
+ {
+ pseudostate = PSEUDOSTATE_JUNCTION_MOC;
+
+ return( *this );
+ }
+
+ /**
+ * MIX-IN with component "pseudostate"
+ */
+ inline bool isPseudostateJunction() const
+ {
+ return( isComponentPseudostate() && isPseudostateMocJUNCTION() );
+ }
+
+ inline Specifier & setPseudostateJunction()
+ {
+ setComponentPseudostate();
+ setPseudostateMocJUNCTION();
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "CHOICE" pseudostate
+ */
+ inline bool isPseudostateMocCHOICE() const
+ {
+ return( pseudostate == PSEUDOSTATE_CHOICE_MOC );
+ }
+
+ inline Specifier & setPseudostateMocCHOICE()
+ {
+ pseudostate = PSEUDOSTATE_CHOICE_MOC;
+
+ return( *this );
+ }
+
+ /**
+ * MIX-IN with component "pseudostate"
+ */
+ inline bool isPseudostateChoice() const
+ {
+ return( isComponentPseudostate() && isPseudostateMocCHOICE() );
+ }
+
+ inline Specifier & setPseudostateChoice()
+ {
+ setComponentPseudostate();
+ setPseudostateMocCHOICE();
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "ENTRY_POINT" pseudostate
+ */
+ inline bool isPseudostateMocENTRY_POINT() const
+ {
+ return( pseudostate == PSEUDOSTATE_ENTRY_POINT_MOC );
+ }
+
+ inline Specifier & setPseudostateMocENTRY_POINT()
+ {
+ pseudostate = PSEUDOSTATE_ENTRY_POINT_MOC;
+
+ return( *this );
+ }
+
+ /**
+ * MIX-IN with component "pseudostate"
+ */
+ inline bool isPseudostateEntryPoint() const
+ {
+ return( isComponentPseudostate() && isPseudostateMocENTRY_POINT() );
+ }
+
+ inline Specifier & setPseudostateEntryPoint()
+ {
+ setComponentPseudostate();
+ setPseudostateMocENTRY_POINT();
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "EXIT_POINT" pseudostate
+ */
+ inline bool isPseudostateMocEXIT_POINT() const
+ {
+ return( pseudostate == PSEUDOSTATE_EXIT_POINT_MOC );
+ }
+
+ inline Specifier & setPseudostateMocEXIT_POINT()
+ {
+ pseudostate = PSEUDOSTATE_EXIT_POINT_MOC;
+
+ return( *this );
+ }
+
+ /**
+ * MIX-IN with component "pseudostate"
+ */
+ inline bool isPseudostateExitPoint() const
+ {
+ return( isComponentPseudostate() && isPseudostateMocEXIT_POINT() );
+ }
+
+ inline Specifier & setPseudostateExitPoint()
+ {
+ setComponentPseudostate();
+ setPseudostateMocEXIT_POINT();
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "CONECTION POINT" pseudostate
+ */
+ inline bool hasPseudostateMocConnectionPoint() const
+ {
+ return( (pseudostate & FAMILY_PSEUDO_CONNECTION_POINT_MOC) != 0 );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "FORK" pseudostate
+ */
+ inline bool isPseudostateMocFORK() const
+ {
+ return( pseudostate == PSEUDOSTATE_FORK_MOC );
+ }
+
+ inline Specifier & setPseudostateMocFORK()
+ {
+ pseudostate = PSEUDOSTATE_FORK_MOC;
+
+ return( *this );
+ }
+
+ /**
+ * MIX-IN with component "pseudostate"
+ */
+ inline bool isPseudostateFork() const
+ {
+ return( isComponentPseudostate() && isPseudostateMocFORK() );
+ }
+
+ inline Specifier & setPseudostateFork()
+ {
+ setComponentPseudostate();
+ setPseudostateMocFORK();
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "JOIN" pseudostate
+ */
+ inline bool isPseudostateMocJOIN() const
+ {
+ return( pseudostate == PSEUDOSTATE_JOIN_MOC );
+ }
+
+ inline Specifier & setPseudostateMocJOIN()
+ {
+ pseudostate = PSEUDOSTATE_JOIN_MOC;
+
+ return( *this );
+ }
+
+ /**
+ * MIX-IN with component "pseudostate"
+ */
+ inline bool isPseudostateJoin() const
+ {
+ return( isComponentPseudostate() && isPseudostateMocJOIN() );
+ }
+
+ inline Specifier & setPseudostateJoin()
+ {
+ setComponentPseudostate();
+ setPseudostateMocJOIN();
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "DHISTORY" pseudostate
+ */
+ inline bool isPseudostateMocDEEP_HISTORY() const
+ {
+ return( pseudostate == PSEUDOSTATE_DEEP_HISTORY_MOC );
+ }
+
+ inline bool hasPseudostateMocDEEP_HISTORY() const
+ {
+ return( (pseudostate & PSEUDOSTATE_DEEP_HISTORY_MOC) != 0 );
+ }
+
+ inline Specifier & addPseudostateMocDEEP_HISTORY()
+ {
+ pseudostate |= PSEUDOSTATE_DEEP_HISTORY_MOC;
+
+ return( *this );
+ }
+
+ inline Specifier & setPseudostateMocDEEP_HISTORY()
+ {
+ pseudostate = PSEUDOSTATE_DEEP_HISTORY_MOC;
+
+ return( *this );
+ }
+
+ /**
+ * MIX-IN with component "pseudostate"
+ */
+ inline bool isPseudostateDeepHistory() const
+ {
+ return( isComponentPseudostate() && isPseudostateMocDEEP_HISTORY() );
+ }
+
+ inline Specifier & setPseudostateDeepHistory()
+ {
+ setComponentPseudostate();
+ setPseudostateMocDEEP_HISTORY();
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "SHISTORY" pseudostate
+ */
+ inline bool isPseudostateMocSHALLOW_HISTORY() const
+ {
+ return( pseudostate == PSEUDOSTATE_SHALLOW_HISTORY_MOC );
+ }
+
+ inline bool hasPseudostateMocSHALLOW_HISTORY() const
+ {
+ return( (pseudostate & PSEUDOSTATE_SHALLOW_HISTORY_MOC) != 0 );
+ }
+
+ inline Specifier & addPseudostateMocSHALLOW_HISTORY()
+ {
+ pseudostate |= PSEUDOSTATE_SHALLOW_HISTORY_MOC;
+
+ return( *this );
+ }
+
+ inline Specifier & setPseudostateMocSHALLOW_HISTORY()
+ {
+ pseudostate = PSEUDOSTATE_SHALLOW_HISTORY_MOC;
+
+ return( *this );
+ }
+
+ /**
+ * MIX-IN with component "pseudostate"
+ */
+ inline bool isPseudostateShallowHistory() const
+ {
+ return( isComponentPseudostate() && isPseudostateMocSHALLOW_HISTORY() );
+ }
+
+ inline Specifier & setPseudostateShallowHistory()
+ {
+ setComponentPseudostate();
+ setPseudostateMocSHALLOW_HISTORY();
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "HISTORY" pseudostate
+ */
+ inline bool hasPseudostateMocHISTORY() const
+ {
+ return( (pseudostate & FAMILY_PSEUDO_HISTORY_MOC) != 0 );
+ }
+
+ /**
+ * MIX-IN with component "pseudostate"
+ */
+ inline bool hasPseudostateHistory() const
+ {
+ return( isComponentPseudostate() && hasPseudostateMocHISTORY() );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FEATURE KIND
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * GETTER - SETTER
+ * feature
+ */
+ inline FEATURE_KIND getFeatureKind() const
+ {
+ return( static_cast< FEATURE_KIND >( feature ) );
+ }
+
+ inline bool hasFeatureKind() const
+ {
+ return( feature != FEATURE_UNDEFINED_KIND );
+ }
+
+ inline bool hasFeatureKind(FEATURE_KIND designKind) const
+ {
+ return( (feature & designKind) != 0 );
+ }
+
+ inline bool isFeatureKind(FEATURE_KIND designKind) const
+ {
+ return( feature == designKind );
+ }
+
+ inline Specifier & setFeatureKind(FEATURE_KIND designKind)
+ {
+ feature = designKind;
+
+ return( *this );
+ }
+
+ inline Specifier & addFeatureKind(FEATURE_KIND designKind)
+ {
+ feature |= designKind;
+
+ return( *this );
+ }
+
+ inline Specifier & remFeatureKind(FEATURE_KIND designKind)
+ {
+ feature &= (~ designKind);
+
+ return( *this );
+ }
+
+ inline Specifier & unsetFeatureKind()
+ {
+ feature = FEATURE_UNDEFINED_KIND;
+
+ return( *this );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * "timed" feature
+ */
+ inline bool hasFeatureTimed() const
+ {
+ return( (feature & FEATURE_TIMED_KIND) != 0 );
+ }
+
+ inline bool noFeatureTimed() const
+ {
+ return( (feature & FEATURE_TIMED_KIND) == 0 );
+ }
+
+ inline Specifier & remFeatureTimed()
+ {
+ feature &= (~ FEATURE_TIMED_KIND);
+
+ return( *this );
+ }
+
+ inline Specifier & setFeatureTimed()
+ {
+ feature |= FEATURE_TIMED_KIND;
+
+ return( *this );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * "input_enabled" feature
+ */
+ inline bool hasFeatureInputEnabled() const
+ {
+ return( (feature & FEATURE_INPUT_ENABLED_KIND) != 0 );
+ }
+
+ inline bool noFeatureInputEnabled() const
+ {
+ return( (feature & FEATURE_INPUT_ENABLED_KIND) == 0 );
+ }
+
+ inline Specifier & remFeatureInputEnabled()
+ {
+ feature &= (~ FEATURE_INPUT_ENABLED_KIND);
+
+ return( *this );
+ }
+
+ inline Specifier & setFeatureInputEnabled()
+ {
+ feature |= FEATURE_INPUT_ENABLED_KIND;
+
+ return( *this );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * "input_enabled" feature
+ */
+ inline bool hasFeatureLifeline() const
+ {
+ return( (feature & FEATURE_LIFELINE_KIND) != 0 );
+ }
+
+ inline bool noFeatureLifeline() const
+ {
+ return( (feature & FEATURE_LIFELINE_KIND) == 0 );
+ }
+
+ inline Specifier & remFeatureLifeline()
+ {
+ feature &= (~ FEATURE_LIFELINE_KIND);
+
+ return( *this );
+ }
+
+ inline Specifier & setFeatureLifeline()
+ {
+ feature |= FEATURE_LIFELINE_KIND;
+
+ return( *this );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DESIGN KIND
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * GETTER - SETTER
+ * design
+ */
+ inline DESIGN_KIND getDesignKind() const
+ {
+ return( static_cast< DESIGN_KIND >( design ) );
+ }
+
+ inline bool hasDesignKind() const
+ {
+ return( design != DESIGN_UNDEFINED_KIND );
+ }
+
+ inline bool noneDesignKind() const
+ {
+ return( design == DESIGN_UNDEFINED_KIND );
+ }
+
+ inline bool hasDesignKind(DESIGN_KIND designKind) const
+ {
+ return( (design & designKind) != 0 );
+ }
+
+ inline bool isDesignKind(DESIGN_KIND designKind) const
+ {
+ return( design == designKind );
+ }
+
+ inline Specifier & setDesignKind(DESIGN_KIND designKind)
+ {
+ design = designKind;
+
+ return( *this );
+ }
+
+ inline Specifier & addDesignKind(DESIGN_KIND designKind)
+ {
+ design |= designKind;
+
+ return( *this );
+ }
+
+ inline Specifier & remDesignKind(DESIGN_KIND designKind)
+ {
+ design &= (~ designKind);
+
+ return( *this );
+ }
+
+ inline Specifier & unsetDesignKind()
+ {
+ design = DESIGN_UNDEFINED_KIND;
+
+ return( *this );
+ }
+
+ static DESIGN_KIND toDesignKind(const std::string & strDesign);
+
+
+ /**
+ * GETTER - SETTER
+ * "#model" design
+ */
+ inline bool isDesignModel() const
+ {
+ return(design == DESIGN_MODEL_KIND );
+ }
+
+ inline bool hasDesignModel() const
+ {
+ return( (design & DESIGN_MODEL_KIND) != 0 );
+ }
+
+ inline Specifier & setDesignModel()
+ {
+ design = DESIGN_MODEL_KIND;
+
+ return( *this );
+ }
+
+ inline Specifier & addDesignModel()
+ {
+ design |= DESIGN_MODEL_KIND;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "#instance" design
+ */
+ inline bool isDesignInstance() const
+ {
+ return(design == DESIGN_INSTANCE_KIND );
+ }
+
+ inline bool hasDesignInstance() const
+ {
+ return( (design & DESIGN_INSTANCE_KIND) != 0 );
+ }
+
+ inline Specifier & setDesignInstance()
+ {
+ design = DESIGN_INSTANCE_KIND;
+
+ return( *this );
+ }
+
+ inline Specifier & addDesignInstance()
+ {
+ design |= DESIGN_INSTANCE_KIND;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "#static" design
+ */
+ inline bool isDesignStatic() const
+ {
+ return(design == DESIGN_STATIC_KIND );
+ }
+
+ inline bool hasDesignStatic() const
+ {
+ return( (design & DESIGN_STATIC_KIND) != 0 );
+ }
+
+ inline Specifier & setDesignStatic()
+ {
+ design = DESIGN_STATIC_KIND;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "#static instance" design
+ */
+ inline bool isDesignInstanceStatic() const
+ {
+ return(design == DESIGN_INSTANCE_STATIC_KIND );
+ }
+
+ inline bool hasDesignInstanceStatic() const
+ {
+ return( (design & DESIGN_INSTANCE_STATIC_KIND) ==
+ DESIGN_INSTANCE_STATIC_KIND );
+ }
+
+ inline Specifier & setDesignInstanceStatic()
+ {
+ design = DESIGN_INSTANCE_STATIC_KIND;
+
+ return( *this );
+ }
+
+ inline Specifier & addDesignInstanceStatic()
+ {
+ design |= DESIGN_INSTANCE_STATIC_KIND;
+
+ return( *this );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * "#static prototype" design
+ */
+ inline bool isDesignPrototypeStatic() const
+ {
+ return(design == DESIGN_PROTOTYPE_STATIC_KIND );
+ }
+
+ inline Specifier & setDesignPrototypeStatic()
+ {
+ design = DESIGN_PROTOTYPE_STATIC_KIND;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "dynamic" design
+ */
+ inline bool isDesignDynamic() const
+ {
+ return(design == DESIGN_DYNAMIC_KIND );
+ }
+
+ inline bool hasDesignDynamic() const
+ {
+ return( (design & DESIGN_DYNAMIC_KIND) != 0 );
+ }
+
+ inline Specifier & setDesignDynamic()
+ {
+ design = DESIGN_DYNAMIC_KIND;
+
+ return( *this );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * "#dynamic instance" design
+ */
+ inline bool isDesignInstanceDynamic() const
+ {
+ return(design == DESIGN_INSTANCE_DYNAMIC_KIND );
+ }
+
+ inline bool hasDesignInstanceDynamic() const
+ {
+ return( (design & DESIGN_INSTANCE_DYNAMIC_KIND) ==
+ DESIGN_INSTANCE_DYNAMIC_KIND );
+ }
+
+ inline Specifier & setDesignInstanceDynamic()
+ {
+ design = DESIGN_INSTANCE_DYNAMIC_KIND;
+
+ return( *this );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * "instance [ dynamic ]" design
+ */
+ inline bool hasDesignInstanceNotModel() const
+ {
+ return( ((design & DESIGN_INSTANCE_KIND) != 0)
+ && ((design & DESIGN_MODEL_KIND) == 0) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * "runtime" design
+ */
+ inline bool isDesignRuntime() const
+ {
+ return(design == DESIGN_RUNTIME_KIND );
+ }
+
+ inline Specifier & setDesignRuntime()
+ {
+ design = DESIGN_RUNTIME_KIND;
+
+ return( *this );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // MIX-IN MODIFIER
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline bool isFamilyComponentComposite() const
+ {
+ return( hasMocComposite()
+ || ( (component & FAMILY_COMPONENT_COMPOSITE_KIND) != 0) );
+ }
+
+ inline bool isFamilyComponentState() const
+ {
+ return( (component & FAMILY_COMPONENT_STATE_KIND) != 0 );
+ }
+
+ inline bool isFamilyComponentStatemachine() const
+ {
+ return( ( (component & FAMILY_COMPONENT_STATEMACHINE_KIND) != 0)
+ || isMocStateTransitionStructure() );
+ }
+
+
+ inline bool isStateBasic() const
+ {
+ return( noneMocComposite() && (isState() || isPseudostate()) );
+ }
+
+ inline bool isStateComposite() const
+ {
+ return( hasMocComposite() && isState() );
+ }
+
+ inline bool isPseudostateInitialOrStateStart() const
+ {
+ return( isPseudostateInitial() || isStateStart() );
+ }
+
+ inline bool hasMocINITIAL_START() const
+ {
+ return( hasPseudostateMocINITIAL() || hasStateMocSTART() );
+ }
+
+ inline bool couldBeStateMocSIMPLE() const
+ {
+ return( noneStateMoc() && nonePseudostateMoc() && noneMocComposite() );
+ }
+
+
+
+ /**
+ * COMPONENT KIND to STRING
+ */
+ inline std::string keywordComponent() const
+ {
+ return( Specifier::keywordComponent( component ) );
+ }
+
+ static std::string keywordComponent(bit_field_t componentKind);
+
+
+ inline std::string strComponent(const std::string & separator = " ") const
+ {
+ return( Specifier::strComponent( component , separator ) );
+ }
+
+ static std::string strComponent(bit_field_t componentKind,
+ const std::string & separator = " ");
+
+ static std::string xstrComponent(bit_field_t direction,
+ const std::string & separator = " ");
+
+ /**
+ * COMPOSITE MOC to STRING
+ */
+ inline std::string strModelOfComputation(
+ const std::string & separator = " ") const
+ {
+ return( Specifier::strModelOfComputation( computation , separator ) );
+ }
+
+ static std::string strModelOfComputation(
+ bit_field_t modelOfComputationKind,
+ const std::string & separator = " ");
+
+ /**
+ * GROUP KIND to STRING
+ */
+ inline std::string strGroup(const std::string & separator = " ") const
+ {
+ return( Specifier::strGroup( group , separator ) );
+ }
+
+ static std::string strGroup(bit_field_t groupKind,
+ const std::string & separator = " ");
+
+ /**
+ * STATE MOC to STRING
+ */
+ inline std::string strStateMoc(const std::string & separator = " ") const
+ {
+ return( Specifier::strStateMoc( state , separator ) );
+ }
+
+ static std::string strStateMoc(bit_field_t stateMoc,
+ const std::string & separator = " ");
+
+ static std::string xstrStateMoc(bit_field_t stateMoc,
+ const std::string & separator = " ");
+
+ /**
+ * PSEUDOSTATE MOC to STRING
+ */
+ inline std::string strPseudostateMoc(
+ const std::string & separator = " ") const
+ {
+ return( Specifier::strPseudostateMoc( pseudostate , separator ) );
+ }
+
+ static std::string strPseudostateMoc(bit_field_t pseudostateMoc,
+ const std::string & separator = " ");
+
+ static std::string xstrPseudostateMoc(bit_field_t pseudostateMoc,
+ const std::string & separator = " ");
+
+ /**
+ * ANY-STATE MOC to STRING
+ */
+ inline std::string strAnyStateMoc(
+ const std::string & separator = " ") const
+ {
+ if( pseudostate != PSEUDOSTATE_UNDEFINED_MOC )
+ {
+ return( Specifier::strPseudostateMoc( pseudostate , separator ) );
+ }
+ else if( state != STATE_UNDEFINED_MOC )
+ {
+ return( Specifier::strStateMoc( pseudostate , separator ) );
+ }
+ else if( computation != MOC_UNDEFINED_KIND )
+ {
+ return( Specifier::strModelOfComputation( computation , separator ) );
+ }
+ else
+ {
+ return( "<any:state:undef>" );
+ }
+ }
+
+
+ /**
+ * FEATURE KIND to STRING
+ */
+ inline std::string strFeature(const std::string & separator = " ") const
+ {
+ return( Specifier::strFeature( feature , separator ) );
+ }
+
+ static std::string strFeature(bit_field_t featureKind,
+ const std::string & separator = " ");
+
+ /**
+ * DESIGN KIND to STRING
+ */
+ inline std::string strDesign(const std::string & separator = " ") const
+ {
+ return( Specifier::strDesign( design , separator ) );
+ }
+
+ std::string strDesign_not(DESIGN_KIND designKind,
+ const std::string & separator = " ") const;
+
+ static std::string strDesign(bit_field_t designKind,
+ const std::string & separator = " ");
+
+ static std::string xstrDesign(bit_field_t designKind,
+ const std::string & separator = " ");
+
+
+ /**
+ * Serialization
+ */
+ static std::string SEPARATOR;
+
+
+ inline std::string str(bit_field_t enabledFields,
+ const std::string & separator = SEPARATOR) const
+ {
+ return( StringTools::removeLastIfEndsWith(
+ toString(enabledFields, separator ), separator) );
+ }
+
+ inline std::string str(const std::string & separator = SEPARATOR) const
+ {
+ return( StringTools::removeLastIfEndsWith(
+ toString(ENABLE_ALL_FIELDS, separator ), separator) );
+ }
+
+ inline std::string str_otherThan(
+ Specifier::COMPONENT_KIND componentKing,
+ const std::string & separator = SEPARATOR) const
+ {
+ Specifier xSpecifier( *this );
+
+ xSpecifier.remComponentKind( componentKing );
+
+ return( StringTools::removeLastIfEndsWith(
+ xSpecifier.toString( separator ), separator) );
+
+ }
+
+ inline std::string str_otherThan(
+ Specifier::COMPONENT_KIND componentKing,
+ Specifier::STATE_MOC stateMoc,
+ const std::string & separator = SEPARATOR) const
+ {
+ Specifier xSpecifier( *this );
+
+ xSpecifier.remComponentKind( componentKing );
+
+ xSpecifier.remStateMoc( stateMoc );
+
+ return( StringTools::removeLastIfEndsWith(
+ xSpecifier.toString( separator ), separator) );
+
+ }
+
+ std::string toString(bit_field_t enabledFields = ENABLE_ALL_FIELDS,
+ const std::string & separator = " ") const;
+
+ inline std::string toString(const std::string & separator) const
+ {
+ return( toString( ENABLE_ALL_FIELDS , separator) );
+ }
+
+
+ std::string toString_not(DESIGN_KIND designKind,
+ const std::string & separator = " ") const
+ {
+ return( Specifier::strComponent( component , separator ) +
+ Specifier::strModelOfComputation( computation , separator ) +
+ Specifier::strGroup ( group , separator ) +
+ Specifier::strStateMoc( state , separator ) +
+ Specifier::strPseudostateMoc( pseudostate , separator ) +
+ Specifier::strFeature( feature , separator ) +
+ Specifier::strDesign_not( designKind , separator) );
+ }
+
+};
+
+
+
+class SpecifierImpl
+{
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ Specifier mSpecifier;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ */
+ SpecifierImpl()
+ : mSpecifier( )
+ {
+ //!! NOTHING
+ }
+
+ SpecifierImpl(const Specifier & aSpecifier)
+ : mSpecifier( aSpecifier )
+ {
+ //!! NOTHING
+ }
+
+ SpecifierImpl(const SpecifierImpl & aCopy)
+ : mSpecifier( aCopy.mSpecifier )
+ {
+ //!! NOTHING
+ }
+
+ SpecifierImpl(const SpecifierImpl * aCopy)
+ : mSpecifier( (aCopy != NULL) ?
+ aCopy->getSpecifier() : Specifier::EXECUTABLE_UNDEFINED_SPECIFIER )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ ~SpecifierImpl()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER
+ * mSpecifier
+ */
+ inline const Specifier & getSpecifier() const
+ {
+ return( mSpecifier );
+ }
+
+ inline Specifier & getwSpecifier()
+ {
+ return( mSpecifier );
+ }
+
+ inline bool hasSpecifier() const
+ {
+ return( mSpecifier.isDefined() );
+ }
+
+ inline bool hasSpecifier_otherThan(const Specifier & aSpecifier) const
+ {
+ return( mSpecifier.isDefined_otherThan( aSpecifier ) );
+ }
+
+ inline void setSpecifier(const Specifier & xSpecifier)
+ {
+ mSpecifier = xSpecifier;
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* FML_COMMON_SPECIFIERELEMENT_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/common/TraceableElement.cpp b/org.eclipse.efm.symbex/src/fml/common/TraceableElement.cpp
new file mode 100644
index 0000000..3d1a3d1
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/common/TraceableElement.cpp
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 21 mars 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "TraceableElement.h"
+
+namespace sep
+{
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/common/TraceableElement.h b/org.eclipse.efm.symbex/src/fml/common/TraceableElement.h
new file mode 100644
index 0000000..063d2fd
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/common/TraceableElement.h
@@ -0,0 +1,390 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 21 mars 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef FML_COMMON_TRACEABLEELEMENT_H_
+#define FML_COMMON_TRACEABLEELEMENT_H_
+
+#include <string>
+
+#include <common/Element.h>
+
+#include <fml/common/LocationElement.h>
+
+
+namespace sep
+{
+
+class TraceableElement
+{
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ bool mCommentFlag;
+
+ std::string mDescription;
+
+ LocationElement * mLocation;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TraceableElement()
+ : mCommentFlag( false ),
+ mDescription( ),
+ mLocation( NULL )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ TraceableElement(const TraceableElement & anElement)
+ : mCommentFlag( anElement.mCommentFlag ),
+ mDescription( anElement.mDescription),
+ mLocation( (anElement.mLocation == NULL) ? NULL :
+ new LocationElement( *(anElement.mLocation) ) )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~TraceableElement()
+ {
+ delete( mLocation );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mCommentFlag
+ */
+ inline bool isComment() const
+ {
+ return( mCommentFlag );
+ }
+
+ inline void setComment(bool isComment = true)
+ {
+ mCommentFlag = isComment;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mDescription
+ */
+ inline std::string getDescription() const
+ {
+ return( mDescription );
+ }
+
+ inline void setDescription(const std::string & aDescription)
+ {
+ mDescription = aDescription;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mLocation
+ */
+ inline LocationElement * getLocation() const
+ {
+ return( mLocation );
+ }
+
+ inline bool hasLocation() const
+ {
+ return( mLocation != NULL );
+ }
+
+
+ inline void setLocation(LocationElement * aLocation)
+ {
+ if( mLocation != NULL )
+ {
+ delete( mLocation );
+ }
+ mLocation = aLocation;
+ }
+
+ inline void copyLocation(LocationElement * aLocation)
+ {
+ if( aLocation != NULL )
+ {
+ setLocation(aLocation->getFileLocation(),
+ aLocation->getBeginLine(), aLocation->getEndLine());
+ }
+ else if( mLocation != NULL )
+ {
+ delete( mLocation );
+ mLocation = NULL;
+ }
+ }
+
+ inline void setLocation(const std::string & aFileLocation,
+ const avm_size_t beginLine, const avm_size_t endLine)
+ {
+ if( mLocation == NULL )
+ {
+ mLocation = new LocationElement(aFileLocation, beginLine, endLine);
+ }
+ else
+ {
+ mLocation->setLocation(aFileLocation, beginLine, endLine);
+ }
+ }
+
+
+ /**
+ * FATAL ERROR location
+ */
+ inline std::string fatalErrorLocation(
+ const TraceableElement * container = NULL) const
+ {
+ if( mLocation != NULL )
+ {
+ return( mLocation->fatalErrorLocation() );
+ }
+ else if( container != NULL )
+ {
+ return( container->fatalErrorLocation(NULL) );
+ }
+ else
+ {
+ return( ":fatal error< location#undefined >\n\t" );
+ }
+ }
+
+ inline OutStream & fatalErrorLocation(OutStream & os,
+ const TraceableElement * container = NULL) const
+ {
+ if( mLocation != NULL )
+ {
+ return( mLocation->fatalErrorLocation(os) );
+ }
+ else if( container != NULL )
+ {
+ return( container->fatalErrorLocation(os, NULL) );
+ }
+ else
+ {
+ return( os << ":fatal error< location#undefined >\n\t" );
+ }
+ }
+
+ inline PairOutStream & fatalErrorLocation(PairOutStream & os,
+ const TraceableElement * container = NULL) const
+ {
+ if( mLocation != NULL )
+ {
+ return( mLocation->fatalErrorLocation(os) );
+ }
+ else if( container != NULL )
+ {
+ return( container->fatalErrorLocation(os, NULL) );
+ }
+ else
+ {
+ return( os << ":fatal error< location#undefined >\n\t" );
+ }
+ }
+
+ inline TripleOutStream & fatalErrorLocation(TripleOutStream & os,
+ TraceableElement * container = NULL) const
+ {
+ if( mLocation != NULL )
+ {
+ return( mLocation->fatalErrorLocation(os) );
+ }
+ else if( container != NULL )
+ {
+ return( container->fatalErrorLocation(os, NULL) );
+ }
+ else
+ {
+ return( os << ":fatal error< location#undefined >\n\t" );
+ }
+ }
+
+
+ /**
+ * ERROR location
+ */
+ inline std::string errorLocation(
+ const TraceableElement * container = NULL) const
+ {
+ if( mLocation != NULL )
+ {
+ return( mLocation->errorLocation() );
+ }
+ else if( container != NULL )
+ {
+ return( container->errorLocation(NULL) );
+ }
+ else
+ {
+ return( ":error< location#undefined >\n\t" );
+ }
+ }
+
+ inline OutStream & errorLocation(OutStream & os,
+ const TraceableElement * container = NULL) const
+ {
+ if( mLocation != NULL )
+ {
+ return( mLocation->errorLocation(os) );
+ }
+ else if( container != NULL )
+ {
+ return( container->errorLocation(os, NULL) );
+ }
+ else
+ {
+ return( os << ":error< location#undefined >\n\t" );
+ }
+ }
+
+ inline PairOutStream & errorLocation(PairOutStream & os,
+ const TraceableElement * container = NULL) const
+ {
+ if( mLocation != NULL )
+ {
+ return( mLocation->errorLocation(os) );
+ }
+ else if( container != NULL )
+ {
+ return( container->errorLocation(os, NULL) );
+ }
+ else
+ {
+ return( os << ":error< location#undefined >\n\t" );
+ }
+ }
+
+ inline TripleOutStream & errorLocation(TripleOutStream & os,
+ const TraceableElement * container = NULL) const
+ {
+ if( mLocation != NULL )
+ {
+ return( mLocation->errorLocation(os) );
+ }
+ else if( container != NULL )
+ {
+ return( container->errorLocation(os, NULL) );
+ }
+ else
+ {
+ return( os << ":error< location#undefined >\n\t" );
+ }
+ }
+
+
+ /**
+ * WARNING location
+ */
+ inline std::string warningLocation(
+ const TraceableElement * container = NULL) const
+ {
+ if( mLocation != NULL )
+ {
+ return( mLocation->warningLocation() );
+ }
+ else if( container != NULL )
+ {
+ return( container->warningLocation(NULL) );
+ }
+ else
+ {
+ return( ":warning< location#undefined >\n\t" );
+ }
+ }
+
+ inline OutStream & warningLocation(OutStream & os,
+ const TraceableElement * container = NULL) const
+ {
+ if( mLocation != NULL )
+ {
+ return( mLocation->warningLocation(os) );
+ }
+ else if( container != NULL )
+ {
+ return( container->warningLocation(os, NULL) );
+ }
+ else
+ {
+ return( os << ":warning< location#undefined >\n\t" );
+ }
+ }
+
+ inline PairOutStream & warningLocation(PairOutStream & os,
+ const TraceableElement * container = NULL) const
+ {
+ if( mLocation != NULL )
+ {
+ return( mLocation->warningLocation(os) );
+ }
+ else if( container != NULL )
+ {
+ return( container->warningLocation(os, NULL) );
+ }
+ else
+ {
+ return( os << ":warning< location#undefined >\n\t" );
+ }
+ }
+
+ inline TripleOutStream & warningLocation(TripleOutStream & os,
+ const TraceableElement * container = NULL) const
+ {
+ if( mLocation != NULL )
+ {
+ return( mLocation->warningLocation(os) );
+ }
+ else if( container != NULL )
+ {
+ return( container->warningLocation(os, NULL) );
+ }
+ else
+ {
+ return( os << ":warning< location#undefined >\n\t" );
+ }
+ }
+
+ /**
+ * traceLine info
+ */
+ inline std::string traceLine(const std::string & tab,
+ bool singleLineComment = true) const
+ {
+ return( (mLocation != NULL ) ?
+ mLocation->traceLine(tab, singleLineComment) : "" );
+ }
+
+};
+
+} /* namespace sep */
+
+#endif /* FML_COMMON_TRACEABLEELEMENT_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/executable/AvmLambda.cpp b/org.eclipse.efm.symbex/src/fml/executable/AvmLambda.cpp
new file mode 100644
index 0000000..528b2bc
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/AvmLambda.cpp
@@ -0,0 +1,245 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 7 oct. 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmLambda.h"
+
+#include <fml/common/SpecifierElement.h>
+
+#include <fml/executable/AvmProgram.h>
+
+#include <fml/operator/OperatorManager.h>
+
+
+namespace sep
+{
+
+
+std::string AvmLambda::ANONYM_UFI = "lambda#anonym";
+
+std::string AvmLambda::APP_UFI = "lambda::app";
+
+std::string AvmLambda::FUN_UFI = "lambda::fun";
+
+std::string AvmLambda::LET_UFI = "lambda::let";
+
+
+
+/**
+ * SETTER
+ * updateFullyQualifiedNameID()
+ */
+void AvmLambda::updateFullyQualifiedNameID()
+{
+ switch( mLambdaNature )
+ {
+ case AVM_LAMBDA_APP_NATURE:
+ {
+ setFullyQualifiedNameID( APP_UFI );
+ break;
+ }
+
+ case AVM_LAMBDA_LET_NATURE:
+ {
+ setFullyQualifiedNameID( LET_UFI );
+ break;
+ }
+
+ case AVM_LAMBDA_FUN_NATURE:
+ default:
+ {
+ if( hasAstElement() )
+ {
+ std::string aFullyQualifiedNameID = getAstFullyQualifiedNameID();
+ setFullyQualifiedNameID( "program" +
+ aFullyQualifiedNameID.substr(
+ aFullyQualifiedNameID.find(FQN_ID_ROOT_SEPARATOR)) );
+ }
+ else
+ {
+ setAllNameID( ANONYM_UFI , "lambda#anonym" );
+ }
+
+ break;
+ }
+ }
+}
+
+
+/**
+ * Serialization
+ */
+void AvmLambda::toStream(OutStream & os) const
+{
+ switch( mLambdaNature )
+ {
+ case AVM_LAMBDA_APP_NATURE:
+ {
+ toStreamApp(os);
+
+ break;
+ }
+
+ case AVM_LAMBDA_LET_NATURE:
+ {
+ toStreamLet(os);
+
+ break;
+ }
+
+ case AVM_LAMBDA_FUN_NATURE:
+ default:
+ {
+ toStreamLambda(os);
+
+ break;
+ }
+ }
+}
+
+
+void AvmLambda::toStreamApp(OutStream & os) const
+{
+ //os << TAB << "apply ( ";
+ os << TAB << "${ app " << AVM_STR_INDENT;
+ toStreamLambda(os);
+ os << END_INDENT;
+ //os << " )( ";
+
+ TableOfInstanceOfData::const_raw_iterator itData = getData().begin();
+ TableOfInstanceOfData::const_raw_iterator endData = getData().end();
+ for( ; itData != endData ; ++itData )
+ {
+ if( (itData)->hasValue() )
+ {
+ os << TAB << " ${ := " << (itData)->str() << " "
+ << (itData)->strValue() << " }";
+ }
+ }
+ //os << " )" << EOL;
+ os << " }" << EOL << std::flush;
+}
+
+
+void AvmLambda::toStreamLambda(OutStream & os) const
+{
+ TableOfInstanceOfData::const_raw_iterator itData = getData().begin();
+ TableOfInstanceOfData::const_raw_iterator endData = getData().end();
+
+ //os << TAB << "lambda ";
+ os << TAB << "${ lambda ";
+
+ for( ; itData != endData ; ++itData )
+ {
+ os << (itData)->str() << " ";
+ }
+ os << std::flush;
+
+ //os << "->";
+
+ os << str_indent( getExpression() );
+
+ //os << EOL;
+ os << " }" << EOL_FLUSH;
+}
+
+
+void AvmLambda::toStreamLet(OutStream & os) const
+{
+ TableOfInstanceOfData::const_raw_iterator itData = getData().begin();
+ TableOfInstanceOfData::const_raw_iterator endData = getData().end();
+
+ if( os.INDENT.TABS.empty() )
+ {
+ //os << "let ";
+ os << "${ let ";
+ for( ; itData != endData ; ++itData )
+ {
+ if( (itData)->hasValue() )
+ {
+ os << "${ "
+ << OperatorManager::OPERATOR_ASSIGN->strOp() << " "
+ << (itData)->str() << " " << (itData)->strValue()
+ << " } ";
+ }
+ else
+ {
+ os << (itData)->str() << " ";
+ }
+ }
+ os << std::flush;
+
+ //os << "in";
+
+ os << str_indent( getExpression() ) << " }";
+ }
+ else
+ {
+ //os << TAB << "let " << EOL;
+ os << TAB << "${ let " << EOL;
+
+ for( ; itData != endData ; ++itData )
+ {
+ if( (itData)->hasValue() )
+ {
+ os << TAB2 << "${ "
+ << OperatorManager::OPERATOR_ASSIGN->strOp() << " "
+ << (itData)->str() << " " << (itData)->strValue()
+ << " }";
+ }
+ else
+ {
+ os << TAB2 << (itData)->str();
+ }
+
+ os << EOL;
+ }
+ os << std::flush;
+
+ //os << TAB << "in" << EOL;
+
+ os << incr_stream( getExpression() ) << TAB << "}" << EOL;
+ }
+
+ os << std::flush;
+}
+
+
+
+
+/*
+ * Convert to AvmProgram
+ */
+BF AvmLambda::convertToProgram(const std::string & id)
+{
+ AvmProgram * aProgram = new AvmProgram(Specifier::SCOPE_ROUTINE_KIND,
+ getContainer()->as< AvmProgram >(), getAstElement(), getDataSize());
+
+ aProgram->setAllNameID( aProgram->getFullyQualifiedNameID() + "." + id , id );
+ aProgram->setParamOffsetCount(0, getDataSize());
+
+ avm_size_t endOffset = getData().size();
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ aProgram->setData(offset, getData().get(offset));
+ }
+
+ aProgram->setCode( getExpression().bfCode() );
+
+ return( BF(aProgram) );
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/executable/AvmLambda.h b/org.eclipse.efm.symbex/src/fml/executable/AvmLambda.h
new file mode 100644
index 0000000..ff6f924
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/AvmLambda.h
@@ -0,0 +1,240 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 7 oct. 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMLAMBDA_H_
+#define AVMLAMBDA_H_
+
+
+
+#include <fml/executable/BaseAvmProgram.h>
+
+#include <common/AvmPointer.h>
+
+#include <fml/executable/AvmProgram.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <collection/Typedef.h>
+
+
+namespace sep
+{
+
+
+/**
+ * TYPE DECLARATIONS
+ */
+
+enum AVM_LAMBDA_NATURE
+{
+ AVM_LAMBDA_APP_NATURE,
+
+ AVM_LAMBDA_FUN_NATURE,
+
+ AVM_LAMBDA_LET_NATURE,
+
+ AVM_LAMBDA_UNDEFINED_NATURE
+};
+
+
+
+class AvmLambda :
+ public BaseAvmProgram ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( AvmLambda )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( AvmLambda )
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ AVM_LAMBDA_NATURE mLambdaNature;
+
+ BF mExpression;
+
+ bool mClosureFlag;
+
+
+public:
+ /**
+ * PREDEFINED UFI
+ */
+ static std::string ANONYM_UFI;
+
+ static std::string APP_UFI;
+
+ static std::string FUN_UFI;
+
+ static std::string LET_UFI;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmLambda(BaseAvmProgram * aContainer, avm_size_t aSize,
+ AVM_LAMBDA_NATURE aLambdaNature = AVM_LAMBDA_FUN_NATURE)
+ : BaseAvmProgram(CLASS_KIND_T( AvmLambda ), aContainer, NULL, aSize),
+ mLambdaNature( aLambdaNature ),
+ mExpression( ),
+ mClosureFlag( false )
+ {
+ updateFullyQualifiedNameID();
+
+// AVM_OS_COUT << "new:AvmLambda> " << ((long) this) << " ==> " << std::endl;
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AvmLambda()
+ {
+// AVM_OS_COUT << "del:AvmLambda> " << ((long) this) << " ==> " << toString() << std::endl;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mLambdaNature
+ */
+
+ inline AVM_LAMBDA_NATURE getNature() const
+ {
+ return( mLambdaNature );
+ }
+
+
+
+ inline bool isApp() const
+ {
+ return( mLambdaNature == AVM_LAMBDA_APP_NATURE );
+ }
+
+ inline bool isLambda() const
+ {
+ return( mLambdaNature == AVM_LAMBDA_FUN_NATURE );
+ }
+
+ inline bool isLet() const
+ {
+ return( mLambdaNature == AVM_LAMBDA_LET_NATURE );
+ }
+
+
+ /**
+ * SETTER
+ * mFullyQualifiedNameID
+ */
+ virtual void updateFullyQualifiedNameID();
+
+ inline bool isAnonym() const
+ {
+ return( fqnEquals( ANONYM_UFI ) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mExpression
+ */
+ inline BF & getExpression()
+ {
+ return( mExpression );
+ }
+
+ inline const BF & getExpression() const
+ {
+ return( mExpression );
+ }
+
+ inline bool hasExpression() const
+ {
+ return( mExpression.valid() );
+ }
+
+ inline void setExpression(const BF & aExpression)
+ {
+ mExpression = aExpression;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mClosureFlag
+ */
+ inline bool isClosed() const
+ {
+ return( mClosureFlag );
+ }
+
+ inline void setClosed()
+ {
+ mClosureFlag = true;
+ }
+
+ inline void setFree()
+ {
+ mClosureFlag = false;
+ }
+
+ inline void setClosureFlag(bool aClosureFlag)
+ {
+ mClosureFlag = aClosureFlag;
+ }
+
+
+ inline avm_size_t boundVarCount() const
+ {
+ return( getData().size() );
+ }
+
+// inline avm_size_t freeVarCount()
+// {
+// return( ( isClosed() )? 0 : '?' );
+// }
+
+
+ /**
+ * Serialization
+ */
+ inline void strHeader(OutStream & os) const
+ {
+ os << str_indent( this );
+ }
+
+ void toStream(OutStream & os) const;
+
+ void toStreamApp(OutStream & os) const;
+
+ void toStreamLambda(OutStream & os) const;
+
+ void toStreamLet(OutStream & os) const;
+
+
+ /*
+ * Convert to AvmProgram
+ */
+ BF convertToProgram(const std::string & id);
+
+};
+
+
+}
+
+#endif /* AVMLAMBDA_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/executable/AvmProgram.cpp b/org.eclipse.efm.symbex/src/fml/executable/AvmProgram.cpp
new file mode 100644
index 0000000..01c5260
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/AvmProgram.cpp
@@ -0,0 +1,491 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "AvmProgram.h"
+
+#include <fml/executable/ExecutableForm.h>
+
+
+
+namespace sep
+{
+
+
+std::string AvmProgram::ANONYM_UFI = "prog#anonym";
+
+
+
+/**
+ * SETTER
+ * updateFullyQualifiedNameID()
+ */
+void AvmProgram::updateFullyQualifiedNameID()
+{
+ std::string schema = Specifier::strScope( mScope );
+
+ if( hasAstElement() )
+ {
+ std::string aFullyQualifiedNameID = getAstFullyQualifiedNameID();
+ std::string aNameID =
+ NamedElement::extractNameID( aFullyQualifiedNameID );
+
+ setFullyQualifiedNameID(schema + aFullyQualifiedNameID.substr(
+ aFullyQualifiedNameID.find(FQN_ID_ROOT_SEPARATOR)) );
+
+ setNameID( aNameID );
+ }
+ else if( hasFullyQualifiedNameID() )
+ {
+ if( not hasNameID() )
+ {
+ setNameID( NamedElement::extractNameID(
+ getFullyQualifiedNameID() ) );
+ }
+ }
+ else if( hasNameID() )
+ {
+ if( hasContainer() )
+ {
+ std::string aFullyQualifiedNameID =
+ getContainer()->getFullyQualifiedNameID();
+
+ std::string::size_type pos =
+ aFullyQualifiedNameID.find(FQN_ID_ROOT_SEPARATOR);
+ setFullyQualifiedNameID( (pos != std::string::npos) ?
+ schema + aFullyQualifiedNameID.substr() : getNameID() );
+ }
+ else
+ {
+ setFullyQualifiedNameID( getNameID() );
+ }
+ }
+ else
+ {
+ setAllNameID( ANONYM_UFI , schema + "#anonym" );
+ }
+}
+
+
+
+/**
+ * GETTER
+ * any SYMBOL filtering by an optional type specifier family
+ */
+const BF & AvmProgram::getSymbol(
+ const std::string & aFullyQualifiedNameID,
+ avm_type_specifier_kind_t typeFamily) const
+{
+ {
+ const BF & foundSymbol = BaseAvmProgram::
+ getSymbol(aFullyQualifiedNameID, typeFamily);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ {
+ const BF & foundSymbol =
+ getConstData().getByFQNameID(aFullyQualifiedNameID);
+
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ {
+ const BF & foundSymbol = getSymbolData(aFullyQualifiedNameID);
+
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+const BF & AvmProgram::getSymbolByQualifiedNameID(
+ const std::string & aQualifiedNameID,
+ avm_type_specifier_kind_t typeFamily) const
+{
+ {
+ const BF & foundSymbol =
+ BaseAvmProgram::getSymbolByQualifiedNameID(
+ aQualifiedNameID, typeFamily);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ {
+ const BF & foundSymbol =
+ getConstData().getByQualifiedNameID(aQualifiedNameID);
+
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ {
+ const BF & foundSymbol =
+ getSymbolDataByQualifiedNameID(aQualifiedNameID);
+
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+const BF & AvmProgram::getSymbolByNameID(
+ const std::string & id, avm_type_specifier_kind_t typeFamily) const
+{
+ {
+ const BF & foundSymbol =
+ BaseAvmProgram::getSymbolByNameID(id, typeFamily);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ {
+ const BF & foundSymbol = getConstData().getByNameID(id);
+
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ {
+ const BF & foundSymbol = getSymbolDataByNameID(id);
+
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+const BF & AvmProgram::getymbolByAstElement(const ObjectElement * astElement,
+ avm_type_specifier_kind_t typeFamily) const
+{
+ {
+ const BF & foundSymbol =
+ BaseAvmProgram::getSymbolByAstElement(astElement, typeFamily);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ {
+ const BF & foundSymbol = getConstData().getByAstElement(astElement);
+
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ {
+ const BF & foundSymbol = getSymbolDataByAstElement(astElement);
+
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+/**
+ * Serialization
+ */
+void AvmProgram::strHeader(OutStream & out) const
+{
+ out << getModifier().toString()
+ << Specifier::strScope( mScope )
+ << "< id:" << getOffset() << " > ";
+
+AVM_IF_DEBUG_FLAG_AND( COMPILING , hasAstElement() )
+ out << "&" << getAstFullyQualifiedNameID() << " ";
+AVM_ENDIF_DEBUG_FLAG_AND( COMPILING )
+
+ out << /*(isScopeTransition() ? getNameID() :*/ getFullyQualifiedNameID();
+}
+
+
+void AvmProgram::toStreamData(OutStream & out) const
+{
+ TableOfInstanceOfData::const_raw_iterator itData = getData().begin();
+ TableOfInstanceOfData::const_raw_iterator endData = getData().end();
+
+ if( hasParam() )
+ {
+ out << TAB << "parameter:" << EOL_INCR_INDENT;
+ avm_size_t param = getParamCount();
+ for( ; param > 0 ; --param , ++itData )
+ {
+ (itData)->toStream(out);
+ }
+ out << DECR_INDENT;
+ }
+
+ if( hasReturn() )
+ {
+ out << TAB << "returns:" << EOL_INCR_INDENT;
+ for( avm_size_t ret = getReturnCount() ; ret > 0 ; --ret , ++itData )
+ {
+ (itData)->toStream(out);
+ }
+ out << DECR_INDENT;
+ }
+
+ if( hasTypeSpecifier() )
+ {
+ out << TAB << "type:" << EOL_INCR_INDENT;
+
+ getTypeSpecifier().toStream(out);
+
+ out << DECR_INDENT;
+ }
+
+
+ if( (hasData() && (getData().size() > getParamReturnCount()))
+ || hasConstData() || hasTypeSpecifier() )
+ {
+ out << TAB << "variable:" << EOL_INCR_INDENT;
+
+ if( hasConstData() )
+ {
+ getConstData().toStream(out);
+
+ out << EOL;
+ }
+
+ for( ; itData != endData ; ++itData )
+ {
+ (itData)->toStream(out);
+ }
+
+ out << DECR_INDENT;
+
+AVM_IF_DEBUG_FLAG( DATA )
+ if( mAllData != &mData )
+ {
+ out << TAB << "variable#all:" << EOL_INCR_INDENT;
+ itData = getAllData().begin();
+ endData = getAllData().end();
+ for( ; itData != endData ; ++itData )
+ {
+ (itData)->toStream(out);
+ }
+ out << DECR_INDENT;
+
+ }
+ if( mBasicData != &mData )
+ {
+ out << TAB << "variable#basic:" << EOL_INCR_INDENT;
+ itData = getBasicData().begin();
+ endData = getBasicData().end();
+
+AVM_IF_DEBUG_LEVEL_GTE_HIGH
+ for( ; itData != endData ; ++itData )
+ {
+ (itData)->toStream(out);
+ }
+AVM_ELSE
+ for( ; itData != endData ; ++itData )
+ {
+ out << TAB2 << str_header( *itData )
+ << ";" << EOL;
+ }
+AVM_ENDIF_DEBUG_LEVEL_GTE_HIGH
+
+ out << DECR_INDENT;
+ }
+AVM_ENDIF_DEBUG_FLAG( DATA )
+ }
+
+ if( getDataAlias().nonempty() )
+ {
+ out << TAB << "alias:" << EOL_INCR_INDENT;
+
+ TableOfInstanceOfData::const_raw_iterator itAlias = getDataAlias().begin();
+ TableOfInstanceOfData::const_raw_iterator endAlias = getDataAlias().end();
+ for( ; itAlias != endAlias ; ++itAlias )
+ {
+ (itAlias)->toStream(out);
+ }
+ out << DECR_INDENT;
+ }
+}
+
+
+void AvmProgram::toStreamStaticCom(OutStream & out) const
+{
+//AVM_IF_DEBUG_FLAG( COMMUNICATION )
+ if ( hasCommunicationCode() )
+ {
+ out << TAB << "communication"
+ << (isMutableCommunication() ? "" : "<final>");
+ BaseCompiledForm::toStreamStaticCom(out, getCommunicationCode());
+ }
+
+ if ( hasInternalCommunicationCode() )
+ {
+ out << TAB << "com#internal";
+ BaseCompiledForm::toStreamStaticCom(out, getInternalCommunicationCode());
+ }
+
+
+ if ( hasInputCom() )
+ {
+ out << TAB << "com#input{" << EOL;
+ BaseCompiledForm::toStreamStaticCom(out, getInputCom());
+ out << TAB << "}" << EOL;
+ }
+
+ if ( hasOutputCom() )
+ {
+ out << TAB << "com#output{" << EOL;
+ BaseCompiledForm::toStreamStaticCom(out, getOutputCom());
+ out << TAB << "}" << EOL;
+ }
+
+
+ if ( hasInputEnabledBuffer() )
+ {
+ out << TAB << "buffer#input_enabled{" << EOL;
+ BaseCompiledForm::toStreamStaticCom(out, getInputEnabledBuffer());
+ out << TAB << "}" << EOL;
+ }
+
+ if ( hasInputEnabledCom() )
+ {
+ out << TAB << "com#input_enabled{" << EOL;
+ BaseCompiledForm::toStreamStaticCom(out, getInputEnabledCom());
+ out << TAB << "}" << EOL;
+ }
+
+ if ( hasInputEnabledSave() )
+ {
+ out << TAB << "com#input_enabled#save{" << EOL;
+ BaseCompiledForm::toStreamStaticCom(out, getInputEnabledSave());
+ out << TAB << "}" << EOL;
+ }
+
+
+ if ( hasEnvironmentCom() )
+ {
+ out << TAB << "com#env";
+ BaseCompiledForm::toStreamStaticCom(out, getEnvironmentCom());
+ }
+
+ if ( hasEnvironmentInputCom() )
+ {
+ out << TAB << "com#input#env";
+ BaseCompiledForm::toStreamStaticCom(out, getEnvironmentInputCom());
+ }
+
+ if ( hasEnvironmentOutputCom() )
+ {
+ out << TAB << "com#output#env";
+ BaseCompiledForm::toStreamStaticCom(out, getEnvironmentOutputCom());
+ }
+//AVM_ENDIF_DEBUG_FLAG( COMMUNICATION )
+}
+
+
+void AvmProgram::toStream(OutStream & out) const
+{
+ // REFERENCE PROGRAM
+ if( out.preferablyFQN() )
+ {
+ out << TAB << ( isScopeTransition() ?
+ getNameID() : getFullyQualifiedNameID() );
+
+ AVM_DEBUG_REF_COUNTER(out);
+
+ return;
+ }
+
+ out << TAB << getModifier().toString()
+ << Specifier::strScope( mScope )
+ << "< id:" << getOffset() << " > ";
+
+AVM_IF_DEBUG_FLAG_AND( COMPILING , hasAstElement() )
+ out << "&" << getAstFullyQualifiedNameID() << " ";
+AVM_ENDIF_DEBUG_FLAG_AND( COMPILING )
+
+ out << ( isScopeTransition() ?
+ getNameID() : getFullyQualifiedNameID() ) << " {";
+ AVM_DEBUG_REF_COUNTER(out);
+ out << EOL;
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ if( hasContainer() )
+ {
+ out << TAB2 << "//container = "
+ << str_header( getContainer()->as< AvmProgram >() )
+ << ";" << EOL;
+ }
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+// out << TAB2 << "offset = " << getOffset() << ";" << EOL;
+
+
+ // Any program data
+ toStreamData(out);
+
+
+ out << TAB << "moe:" << EOL;
+
+ if( hasCode() )
+ {
+ out << TAB2 << "@run{" << INCR2_INDENT;
+
+ getCode()->toStreamRoutine( out );
+
+ out<< DECR2_INDENT_TAB2 << " }" << EOL;
+ }
+
+ if( hasStatementFamily() )
+ {
+ out << TAB << "opcode#family = " << strStatementFamily() << ";" << EOL;
+ }
+
+ // static class of Port/Message/Signal in communicated transition
+ out << INCR_INDENT;
+ toStreamStaticCom(out);
+ out << DECR_INDENT;
+
+ out << TAB << "}" << EOL << std::flush;
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/executable/AvmProgram.h b/org.eclipse.efm.symbex/src/fml/executable/AvmProgram.h
new file mode 100644
index 0000000..ebc0fd8
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/AvmProgram.h
@@ -0,0 +1,1275 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef AVMPROGRAM_H_
+#define AVMPROGRAM_H_
+
+#include <fml/executable/BaseAvmProgram.h>
+
+#include <common/AvmPointer.h>
+
+#include <collection/List.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/executable/InstanceOfBuffer.h>
+#include <fml/executable/InstanceOfData.h>
+#include <fml/executable/InstanceOfPort.h>
+
+#include <fml/common/ModifierElement.h>
+#include <fml/common/SpecifierElement.h>
+
+#include <fml/type/TableOfTypeSpecifier.h>
+
+#include <fml/infrastructure/Transition.h>
+
+
+namespace sep
+{
+
+
+class ExecutableForm;
+
+class ObjectElement;
+
+class TableOfAvmProgram;
+
+
+class AvmProgram :
+ public BaseAvmProgram ,
+ public IStatementFamily ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( AvmProgram )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( AvmProgram )
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ avm_offset_t mOffset;
+
+ Specifier::SCOPE_KIND mScope;
+
+
+ avm_offset_t mParamOffset;
+ avm_size_t mParamCount;
+
+ avm_offset_t mReturnOffset;
+ avm_size_t mReturnCount;
+
+ TableOfInstanceOfData mConstData;
+
+ TableOfTypeSpecifier mTableOfTypeSpecifier;
+
+ BFCode mCode;
+
+ // static class of Port/Message/Signal in communicated statement
+ BF mCommunicationCode;
+
+ BF mInternalCommunicationCode;
+
+ ListOfInstanceOfPort mInputCom;
+ ListOfInstanceOfPort mOutputCom;
+
+ ListOfInstanceOfBuffer mInputEnabledBuffer;
+ ListOfInstanceOfPort mInputEnabledCom;
+ ListOfInstanceOfPort mInputEnabledSave;
+
+ bool mMutableCommunicationFlag;
+
+ BF mEnvironmentCom;
+ BF mEnvironmentInputCom;
+ BF mEnvironmentOutputCom;
+
+public:
+ /**
+ * STATIC
+ */
+ static std::string ANONYM_UFI;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmProgram(Specifier::SCOPE_KIND aScope, AvmProgram * aContainer,
+ const ObjectElement * astProgram, avm_size_t aSize)
+ : BaseAvmProgram(CLASS_KIND_T( AvmProgram ), aContainer, astProgram, aSize),
+ IStatementFamily( AVM_STATEMENT_UNDEFINED_FAMILY ),
+
+ mOffset( 0 ),
+ mScope( aScope ),
+
+ mParamOffset( 0 ),
+ mParamCount( 0 ),
+ mReturnOffset( 0 ),
+ mReturnCount( 0 ),
+
+ mConstData( ),
+ mTableOfTypeSpecifier( ),
+
+ mCode( ),
+
+ mCommunicationCode( ),
+ mInternalCommunicationCode( ),
+
+ mInputCom( ),
+ mOutputCom( ),
+
+ mInputEnabledBuffer( ),
+ mInputEnabledCom( ),
+ mInputEnabledSave( ),
+
+ mMutableCommunicationFlag( false ),
+
+ mEnvironmentCom( ),
+ mEnvironmentInputCom( ),
+ mEnvironmentOutputCom( )
+ {
+ updateFullyQualifiedNameID();
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Default for Routine
+ */
+ AvmProgram(Specifier::SCOPE_KIND aScope, AvmProgram * aContainer,
+ const std::string & id, avm_size_t aSize)
+ : BaseAvmProgram(CLASS_KIND_T( AvmProgram ), aContainer, id, aSize),
+ IStatementFamily( AVM_STATEMENT_UNDEFINED_FAMILY ),
+
+ mOffset( 0 ),
+ mScope( aScope ),
+
+ mParamOffset( 0 ),
+ mParamCount( 0 ),
+ mReturnOffset( 0 ),
+ mReturnCount( 0 ),
+
+ mConstData( ),
+ mTableOfTypeSpecifier( ),
+
+ mCode( ),
+
+ mCommunicationCode( ),
+ mInternalCommunicationCode( ),
+
+ mInputCom( ),
+ mOutputCom( ),
+
+ mInputEnabledBuffer( ),
+ mInputEnabledCom( ),
+ mInputEnabledSave( ),
+
+ mMutableCommunicationFlag( false ),
+
+ mEnvironmentCom( ),
+ mEnvironmentInputCom( ),
+ mEnvironmentOutputCom( )
+ {
+ updateFullyQualifiedNameID();
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ AvmProgram(const AvmProgram & aProgram)
+ : BaseAvmProgram( aProgram ),
+ IStatementFamily( aProgram ),
+
+ mOffset( aProgram.mOffset ),
+ mScope( aProgram.mScope ),
+
+ mParamOffset( aProgram.mParamOffset ),
+ mParamCount( aProgram.mParamCount ),
+ mReturnOffset( aProgram.mReturnOffset ),
+ mReturnCount( aProgram.mReturnCount ),
+
+ mConstData( aProgram.mConstData ),
+ mTableOfTypeSpecifier( aProgram.mTableOfTypeSpecifier ),
+
+ mCode( aProgram.mCode ),
+
+ mCommunicationCode( aProgram.mCommunicationCode ),
+ mInternalCommunicationCode( aProgram.mInternalCommunicationCode ),
+
+ mInputCom( aProgram.mInputCom ),
+ mOutputCom( aProgram.mOutputCom ),
+
+ mInputEnabledBuffer( aProgram.mInputEnabledBuffer ),
+ mInputEnabledCom( aProgram.mInputEnabledCom ),
+ mInputEnabledSave( aProgram.mInputEnabledSave ),
+
+ mMutableCommunicationFlag( aProgram.mMutableCommunicationFlag ),
+
+ mEnvironmentCom( aProgram.mEnvironmentCom ),
+ mEnvironmentInputCom( aProgram.mEnvironmentInputCom ),
+ mEnvironmentOutputCom( aProgram.mEnvironmentOutputCom )
+ {
+ // !! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ AvmProgram(class_kind_t aClassKind,
+ Specifier::SCOPE_KIND aScope, AvmProgram * aContainer,
+ ObjectElement * aCompiled, avm_size_t aSize)
+ : BaseAvmProgram(aClassKind, aContainer, aCompiled, aSize),
+ IStatementFamily( AVM_STATEMENT_UNDEFINED_FAMILY ),
+
+ mOffset( 0 ),
+ mScope( aScope ),
+
+ mParamOffset( 0 ),
+ mParamCount( 0 ),
+ mReturnOffset( 0 ),
+ mReturnCount( 0 ),
+
+ mConstData( ),
+ mTableOfTypeSpecifier( ),
+
+ mCode( ),
+
+ mCommunicationCode( ),
+ mInternalCommunicationCode( ),
+
+ mInputCom( ),
+ mOutputCom( ),
+
+ mInputEnabledBuffer( ),
+ mInputEnabledCom( ),
+ mInputEnabledSave( ),
+
+ mMutableCommunicationFlag( false ),
+
+ mEnvironmentCom( ),
+ mEnvironmentInputCom( ),
+ mEnvironmentOutputCom( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AvmProgram()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mOffset
+ */
+ inline avm_offset_t getOffset() const
+ {
+ return( mOffset );
+ }
+
+ inline void setOffset(avm_offset_t anOffset)
+ {
+ mOffset = anOffset;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mScope
+ */
+ inline Specifier::SCOPE_KIND getScope() const
+ {
+ return( mScope );
+ }
+
+ inline bool isScope(Specifier::SCOPE_KIND aScope) const
+ {
+ return( (mScope == aScope)
+ || ( aScope == Specifier::SCOPE_UNDEFINED_KIND) );
+ }
+
+ inline void setScope(Specifier::SCOPE_KIND aScope)
+ {
+ mScope = aScope;
+ }
+
+
+ inline bool isScopeTransition() const
+ {
+ return( mScope == Specifier::SCOPE_TRANSITION_KIND );
+ }
+
+ inline void setScopeTransition()
+ {
+ mScope = Specifier::SCOPE_TRANSITION_KIND;
+ }
+
+ inline bool isScopeMachine() const
+ {
+ return( mScope == Specifier::SCOPE_MACHINE_KIND );
+ }
+
+ inline void setScopeMachine()
+ {
+ mScope = Specifier::SCOPE_MACHINE_KIND;
+ }
+
+
+ inline bool isScopeRoutine() const
+ {
+ return( mScope == Specifier::SCOPE_ROUTINE_KIND );
+ }
+
+ inline void setScopeRoutine()
+ {
+ mScope = Specifier::SCOPE_ROUTINE_KIND;
+ }
+
+
+ inline bool isScopeProgram() const
+ {
+ return( mScope == Specifier::SCOPE_PROGRAM_KIND );
+ }
+
+ inline void setScopeProgram()
+ {
+ mScope = Specifier::SCOPE_PROGRAM_KIND;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mParamOffset
+ * mParamCount
+ */
+ inline const BF & getParam(avm_offset_t offset) const
+ {
+ return( getData().at(offset) );
+ }
+
+ inline BaseTypeSpecifier * getParamTypeSpecifier(avm_offset_t offset) const
+ {
+ return( getData().rawAt(offset)->getTypeSpecifier() );
+ }
+
+
+ inline avm_offset_t getParamOffset() const
+ {
+ return( mParamOffset );
+ }
+
+ inline avm_size_t getParamCount() const
+ {
+ return( mParamCount );
+ }
+
+
+ inline InstanceOfData * rawParamData(avm_offset_t offset) const
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_OFFSET_EXIT( offset , mParamCount )
+ << "Unbound Instance parameter offset !!!"
+ << SEND_EXIT;
+
+ return( mData.rawAt(mParamOffset + offset) );
+ }
+
+ inline bool hasParam() const
+ {
+ return( mParamCount > 0 );
+ }
+
+ inline void setParamOffsetCount(avm_offset_t aParamOffset,
+ avm_size_t aParamCount)
+ {
+ mParamOffset = aParamOffset;
+ mParamCount = aParamCount;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mReturnOffset
+ * mReturnCount
+ */
+ inline const BF & getReturn(avm_offset_t offset) const
+ {
+ return( getData().at(mReturnOffset + offset) );
+ }
+
+ inline BaseTypeSpecifier * getReturnTypeSpecifier(avm_offset_t offset) const
+ {
+ return( getData().rawAt(mReturnOffset + offset)->getTypeSpecifier() );
+ }
+
+
+ inline avm_offset_t getReturnOffset() const
+ {
+ return( mReturnOffset );
+ }
+
+ inline avm_offset_t returnOffset(avm_offset_t offset) const
+ {
+ return( mReturnOffset + offset );
+ }
+
+ inline avm_size_t getReturnCount() const
+ {
+ return( mReturnCount );
+ }
+
+
+ inline InstanceOfData * rawReturnData(avm_offset_t offset) const
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_OFFSET_EXIT( offset , mReturnCount )
+ << "Unbound Instance parameter offset !!!"
+ << SEND_EXIT;
+
+ return( mData.rawAt(mReturnOffset + offset) );
+ }
+
+
+ inline bool hasReturn() const
+ {
+ return( mReturnCount > 0 );
+ }
+
+ inline void setReturnOffsetCount(avm_offset_t aReturnOffset,
+ avm_size_t aReturnCount)
+ {
+ mReturnOffset = aReturnOffset;
+ mReturnCount = aReturnCount;
+ }
+
+
+ /**
+ * GETTER
+ * mParamCount
+ * mReturnCount
+ */
+ inline avm_size_t getParamReturnCount() const
+ {
+ return( mParamCount + mReturnCount );
+ }
+
+ inline bool hasParamReturn() const
+ {
+ return( (mParamCount + mReturnCount) > 0 );
+ }
+
+
+ /**
+ * SETTER
+ * mFullyQualifiedNameID
+ */
+ virtual void updateFullyQualifiedNameID();
+
+ inline bool isAnonym() const
+ {
+ return( fqnEquals( ANONYM_UFI ) );
+ }
+
+
+ /*
+ * contains DATA
+ */
+ inline bool containsData(InstanceOfData * anInstance) const
+ {
+ return( BaseAvmProgram::containsData(anInstance) ||
+ mConstData.contains(anInstance) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mConstData
+ */
+ inline void appendConstData(const BF & anInstance)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( anInstance )
+ << "InstanceOfData !!!"
+ << SEND_EXIT;
+
+ anInstance.to_ptr< InstanceOfData >()->setContainer(this);
+
+ mConstData.append(anInstance);
+ }
+
+ inline void saveConstData(InstanceOfData * anInstance)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( anInstance )
+ << "InstanceOfData !!!"
+ << SEND_EXIT;
+
+ anInstance->setContainer(this);
+
+ mConstData.save(anInstance);
+ }
+
+ inline const TableOfInstanceOfData & getConstData() const
+ {
+ return( mConstData );
+ }
+
+
+ inline bool hasConstData() const
+ {
+ return( mConstData.nonempty() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mTypeSpecifier
+ */
+ inline void appendTypeSpecifier(const TypeSpecifier & aTypeSpecifier)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( aTypeSpecifier )
+ << "TypeSpecifier !!!"
+ << SEND_EXIT;
+
+ mTableOfTypeSpecifier.append(aTypeSpecifier);
+ }
+
+ inline TableOfTypeSpecifier & getTypeSpecifier()
+ {
+ return( mTableOfTypeSpecifier );
+ }
+
+ inline const TableOfTypeSpecifier & getTypeSpecifier() const
+ {
+ return( mTableOfTypeSpecifier );
+ }
+
+
+ inline const TypeSpecifier & getTypeSpecifier(avm_offset_t offset) const
+ {
+ return( mTableOfTypeSpecifier.get(offset) );
+ }
+
+ inline const TypeSpecifier & getTypeSpecifier(
+ const std::string & aFullyQualifiedNameID) const
+ {
+ return( mTableOfTypeSpecifier.getByFQNameID(
+ aFullyQualifiedNameID ) );
+ }
+
+
+ inline const TypeSpecifier & getTypeSpecifier(
+ const ObjectElement * astElement) const
+ {
+ return( mTableOfTypeSpecifier.getByAstElement(astElement) );
+ }
+
+
+ inline bool hasTypeSpecifier() const
+ {
+ return( mTableOfTypeSpecifier.nonempty() );
+ }
+
+
+
+ /**
+ * GETTER
+ * for EnumSymbolData
+ */
+ inline const BF & getSymbolData(
+ const std::string & aFullyQualifiedNameID) const
+ {
+ return( mTableOfTypeSpecifier.getSymbolData( aFullyQualifiedNameID ) );
+ }
+
+ inline const BF & getSymbolDataByQualifiedNameID(
+ const std::string & aQualifiedNameID) const
+ {
+ return( mTableOfTypeSpecifier.
+ getSymbolDataByQualifiedNameID(aQualifiedNameID) );
+ }
+
+ inline const BF & getSymbolDataByNameID(const std::string & aNameID) const
+ {
+ return( mTableOfTypeSpecifier.getSymbolDataByNameID( aNameID ) );
+ }
+
+ inline const BF & getSymbolDataByAstElement(
+ const ObjectElement * astElement) const
+ {
+ return( mTableOfTypeSpecifier.getSymbolDataByAstElement(astElement) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mCode
+ */
+ inline BFCode & getCode()
+ {
+ return( mCode );
+ }
+
+ inline const BFCode & getCode() const
+ {
+ return( mCode );
+ }
+
+ inline bool hasCode() const
+ {
+ return( mCode.valid() );
+ }
+
+ inline void setCode(const BFCode & aProgram)
+ {
+ mCode = aProgram;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * IOpcodeFamily
+ */
+ inline virtual void updateOpcodeFamily()
+ {
+ IStatementFamily::updateStatementFamily( mCode );
+ }
+
+
+ /**
+ * GETTER
+ * any SYMBOL filtering by an optional type specifier family
+ */
+ virtual const BF & getSymbol(
+ const std::string & aFullyQualifiedNameID,
+ avm_type_specifier_kind_t typeFamily) const;
+
+ virtual const BF & getSymbolByQualifiedNameID(
+ const std::string & aQualifiedNameID,
+ avm_type_specifier_kind_t typeFamily) const;
+
+ virtual const BF & getSymbolByNameID(const std::string & aNameID,
+ avm_type_specifier_kind_t typeFamily) const;
+
+
+ virtual const BF & getymbolByAstElement(const ObjectElement * astElement,
+ avm_type_specifier_kind_t typeFamily) const;
+
+
+ /**
+ * GETTER - SETTER
+ * mCommunicationCode
+ */
+ inline BF & getCommunicationCode()
+ {
+ return( mCommunicationCode );
+ }
+
+ inline const BF & getCommunicationCode() const
+ {
+ return( mCommunicationCode );
+ }
+
+ inline bool hasCommunicationCode() const
+ {
+ return( mCommunicationCode.valid() );
+ }
+
+ inline void setCommunicationCode(const BF & comCode)
+ {
+ mCommunicationCode = comCode;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mInternalCommunicationCode
+ */
+ inline BF & getInternalCommunicationCode()
+ {
+ return( mInternalCommunicationCode );
+ }
+
+ inline const BF & getInternalCommunicationCode() const
+ {
+ return( mInternalCommunicationCode );
+ }
+
+ inline bool hasInternalCommunicationCode() const
+ {
+ return( mInternalCommunicationCode.valid() );
+ }
+
+ inline void setInternalCommunicationCode(const BF & comCode)
+ {
+ mInternalCommunicationCode = comCode;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mInputCom
+ */
+ inline void addInputCom(InstanceOfPort * aPort)
+ {
+ mInputCom.add_union( aPort );
+ }
+
+ inline void addInputCom(ListOfInstanceOfPort & inputEnabledPort)
+ {
+ mInputCom.add_union( inputEnabledPort );
+ }
+
+
+ inline ListOfInstanceOfPort & getInputCom()
+ {
+ return( mInputCom );
+ }
+
+ inline const ListOfInstanceOfPort & getInputCom() const
+ {
+ return( mInputCom );
+ }
+
+
+ bool containsInputCom(InstanceOfPort * aPort) const
+ {
+ return( mInputCom.contains(aPort) );
+ }
+
+ inline bool hasInputCom() const
+ {
+ return( mInputCom.nonempty() );
+ }
+
+
+ inline void setInputCom(ListOfInstanceOfPort & inputEnabledPort)
+ {
+ mInputCom.clear();
+
+ mInputCom.add_union( inputEnabledPort );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mOutputCom
+ */
+ inline void addOutputCom(InstanceOfPort * aPort)
+ {
+ mOutputCom.add_union( aPort );
+ }
+
+ inline void addOutputCom(ListOfInstanceOfPort & inputEnabledPort)
+ {
+ mOutputCom.add_union( inputEnabledPort );
+ }
+
+
+ inline ListOfInstanceOfPort & getOutputCom()
+ {
+ return( mOutputCom );
+ }
+
+ inline const ListOfInstanceOfPort & getOutputCom() const
+ {
+ return( mOutputCom );
+ }
+
+
+ bool containsOutputCom(InstanceOfPort * aPort) const
+ {
+ return( mOutputCom.contains(aPort) );
+ }
+
+ inline bool hasOutputCom() const
+ {
+ return( mOutputCom.nonempty() );
+ }
+
+
+ inline void setOutputCom(ListOfInstanceOfPort & inputEnabledPort)
+ {
+ mOutputCom.clear();
+
+ mOutputCom.add_union( inputEnabledPort );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mInputEnabledBuffer
+ */
+ inline void addInputEnabledBuffer(InstanceOfBuffer * aBuffer)
+ {
+ mInputEnabledBuffer.add_union( aBuffer );
+ }
+
+ inline void addInputEnabledBuffer(ListOfInstanceOfBuffer & inputEnabledBuffer)
+ {
+ mInputEnabledBuffer.add_union( inputEnabledBuffer );
+ }
+
+
+ inline ListOfInstanceOfBuffer & getInputEnabledBuffer()
+ {
+ return( mInputEnabledBuffer );
+ }
+
+ inline const ListOfInstanceOfBuffer & getInputEnabledBuffer() const
+ {
+ return( mInputEnabledBuffer );
+ }
+
+
+ bool containsInputEnabledBuffer(InstanceOfBuffer * aBuffer) const
+ {
+ return( mInputEnabledBuffer.contains(aBuffer) );
+ }
+
+ inline bool hasInputEnabledBuffer() const
+ {
+ return( mInputEnabledBuffer.nonempty() );
+ }
+
+
+ inline void setInputEnabledBuffer(ListOfInstanceOfBuffer & inputEnabledBuffer)
+ {
+ mInputEnabledBuffer.clear();
+
+ mInputEnabledBuffer.add_union( inputEnabledBuffer );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mInputEnabledCom
+ */
+ inline void addInputEnabledCom(InstanceOfPort * aPort)
+ {
+ mInputEnabledCom.add_union( aPort );
+ }
+
+ inline void addInputEnabledCom(ListOfInstanceOfPort & inputEnabledPort)
+ {
+ mInputEnabledCom.add_union( inputEnabledPort );
+ }
+
+
+ inline ListOfInstanceOfPort & getInputEnabledCom()
+ {
+ return( mInputEnabledCom );
+ }
+
+ inline const ListOfInstanceOfPort & getInputEnabledCom() const
+ {
+ return( mInputEnabledCom );
+ }
+
+
+ bool containsInputEnabledCom(InstanceOfPort * aPort) const
+ {
+ return( mInputEnabledCom.contains(aPort) );
+ }
+
+ inline bool hasInputEnabledCom() const
+ {
+ return( mInputEnabledCom.nonempty() );
+ }
+
+
+ inline void setInputEnabledCom(ListOfInstanceOfPort & inputEnabledPort)
+ {
+ mInputEnabledCom.clear();
+
+ mInputEnabledCom.add_union( inputEnabledPort );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mInputEnabledSave
+ */
+ inline void addInputEnabledSave(InstanceOfPort * aPort)
+ {
+ mInputEnabledSave.add_union( aPort );
+ }
+
+ inline void addInputEnabledSave(ListOfInstanceOfPort & inputEnabledSavePort)
+ {
+ mInputEnabledSave.add_union( inputEnabledSavePort );
+ }
+
+
+ inline ListOfInstanceOfPort & getInputEnabledSave()
+ {
+ return( mInputEnabledSave );
+ }
+
+ inline const ListOfInstanceOfPort & getInputEnabledSave() const
+ {
+ return( mInputEnabledSave );
+ }
+
+
+ bool containsInputEnabledSave(InstanceOfPort * aPort) const
+ {
+ return( mInputEnabledSave.contains(aPort) );
+ }
+
+ inline bool hasInputEnabledSave() const
+ {
+ return( mInputEnabledSave.nonempty() );
+ }
+
+
+ inline void setInputEnabledSave(ListOfInstanceOfPort & inputEnabledSavePort)
+ {
+ mInputEnabledSave.clear();
+
+ mInputEnabledSave.add_union( inputEnabledSavePort );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mMutableCommunicationFlag
+ * MOC Attribute for mutable Schedule
+ */
+ bool isMutableCommunication() const
+ {
+ return( mMutableCommunicationFlag );
+ }
+
+ void setMutableCommunication(bool isMutableCommunication = true)
+ {
+ mMutableCommunicationFlag = isMutableCommunication;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mEnvironmentCom
+ */
+ inline BF & getEnvironmentCom()
+ {
+ return( mEnvironmentCom );
+ }
+
+ inline const BF & getEnvironmentCom() const
+ {
+ return( mEnvironmentCom );
+ }
+
+ inline bool hasEnvironmentCom() const
+ {
+ return( mEnvironmentCom.valid() );
+ }
+
+ inline void setEnvironmentCom(const BF & comCode)
+ {
+ mEnvironmentCom = comCode;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mEnvironmentInputCom
+ */
+ inline BF & getEnvironmentInputCom()
+ {
+ return( mEnvironmentInputCom );
+ }
+
+ inline const BF & getEnvironmentInputCom() const
+ {
+ return( mEnvironmentInputCom );
+ }
+
+ inline bool hasEnvironmentInputCom() const
+ {
+ return( mEnvironmentInputCom.valid() );
+ }
+
+ inline void setEnvironmentInputCom(const BF & comCode)
+ {
+ mEnvironmentInputCom = comCode;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mEnvironmentOutputCom
+ */
+ inline BF & getEnvironmentOutputCom()
+ {
+ return( mEnvironmentOutputCom );
+ }
+
+ inline const BF & getEnvironmentOutputCom() const
+ {
+ return( mEnvironmentOutputCom );
+ }
+
+ inline bool hasEnvironmentOutputCom() const
+ {
+ return( mEnvironmentOutputCom.valid() );
+ }
+
+ inline void setEnvironmentOutputCom(const BF & comCode)
+ {
+ mEnvironmentOutputCom = comCode;
+ }
+
+
+ /**
+ * Serialization
+ */
+ virtual void strHeader(OutStream & out) const;
+
+ void toStreamData(OutStream & out) const;
+
+ void toStreamStaticCom(OutStream & out) const;
+
+ virtual void toStream(OutStream & out) const;
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// AvmProgram
+// TYPE DEFINITION for TABLE , SMART POINTER and CONTAINER
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class TableOfAvmProgram :
+ public TableOfBF_T< AvmProgram >,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( TableOfAvmProgram )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( TableOfAvmProgram )
+
+
+/**
+ * TYPEDEF
+ */
+typedef TableOfBF_T< AvmProgram > BaseTableOfAvmProgram;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TableOfAvmProgram()
+ : BaseTableOfAvmProgram()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ TableOfAvmProgram(const TableOfAvmProgram & aTable)
+ : BaseTableOfAvmProgram( aTable )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~TableOfAvmProgram()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER
+ * For Instance
+ */
+ inline const BF & getByQualifiedNameID(
+ const std::string & aQualifiedNameID,
+ NamedElement::op_comparer_t op,
+ Specifier::SCOPE_KIND aScope) const
+ {
+ BaseTableOfAvmProgram::const_raw_iterator itProg = begin();
+ BaseTableOfAvmProgram::const_raw_iterator endProg = end();
+ for( ; itProg != endProg ; ++itProg )
+ {
+ if( itProg->isScope(aScope)
+ && static_cast< AvmProgram *>(
+ itProg )->compareID(aQualifiedNameID, op) )
+ {
+ return( *itProg );
+ }
+ }
+
+ return( BF::REF_NULL );
+ }
+
+ inline AvmProgram * rawByQualifiedNameID(
+ const std::string & aQualifiedNameID,
+ NamedElement::op_comparer_t op,
+ Specifier::SCOPE_KIND aScope) const
+ {
+ BaseTableOfAvmProgram::const_raw_iterator itProg = begin();
+ BaseTableOfAvmProgram::const_raw_iterator endProg = end();
+ for( ; itProg != endProg ; ++itProg )
+ {
+ if( itProg->isScope(aScope)
+ && static_cast< AvmProgram *>(
+ itProg )->compareID(aQualifiedNameID, op) )
+ {
+ return( itProg );
+ }
+ }
+
+ return( NULL );
+ }
+
+
+
+ inline const BF & getByFQNameID(const std::string & aFullyQualifiedNameID,
+ Specifier::SCOPE_KIND aScope = Specifier::SCOPE_UNDEFINED_KIND) const
+ {
+ BaseTableOfAvmProgram::const_raw_iterator itProg = begin();
+ BaseTableOfAvmProgram::const_raw_iterator endProg = end();
+ for( ; itProg != endProg ; ++itProg )
+ {
+ // STRICT:> compare LOCATOR & LOCATION (true:- retry only LOCATION)
+ if( itProg->isScope(aScope)
+ && itProg->fqnEquals( aFullyQualifiedNameID , true ) )
+ {
+ return( *itProg );
+ }
+ }
+
+ return( BF::REF_NULL );
+ }
+
+ inline const BF & getByQualifiedNameID(
+ const std::string & aQualifiedNameID,
+ Specifier::SCOPE_KIND aScope =
+ Specifier::SCOPE_UNDEFINED_KIND) const
+ {
+ BaseTableOfAvmProgram::const_raw_iterator itProg = begin();
+ BaseTableOfAvmProgram::const_raw_iterator endProg = end();
+ for( ; itProg != endProg ; ++itProg )
+ {
+ if( itProg->isScope(aScope)
+ && itProg->fqnEndsWith(aQualifiedNameID) )
+ {
+ return( *itProg );
+ }
+ }
+
+ return( BF::REF_NULL );
+ }
+
+
+ inline avm_size_t getByQualifiedNameID(
+ const std::string & aQualifiedNameID,
+ Specifier::SCOPE_KIND aScope, BFList & listofProgram) const
+ {
+ avm_size_t count = 0;
+
+ BaseTableOfAvmProgram::const_raw_iterator itProg = begin();
+ BaseTableOfAvmProgram::const_raw_iterator endProg = end();
+ for( ; itProg != endProg ; ++itProg )
+ {
+ if( itProg->isScope(aScope)
+ && itProg->fqnEndsWith(aQualifiedNameID) )
+ {
+ listofProgram.append( *itProg );
+
+ ++count;
+ }
+ }
+
+ return( count );
+ }
+
+ inline const BF & getByNameID(const std::string & id,
+ Specifier::SCOPE_KIND aScope =
+ Specifier::SCOPE_UNDEFINED_KIND) const
+ {
+ BaseTableOfAvmProgram::const_raw_iterator itProg = begin();
+ BaseTableOfAvmProgram::const_raw_iterator endProg = end();
+ for( ; itProg != endProg ; ++itProg )
+ {
+ if( itProg->isScope(aScope) && (itProg->getNameID() == id) )
+ {
+ return( *itProg );
+ }
+ }
+
+ return( BF::REF_NULL );
+ }
+
+
+ inline const BF & getByAstElement(const ObjectElement * astElement) const
+ {
+ BaseTableOfAvmProgram::const_raw_iterator it = begin();
+ BaseTableOfAvmProgram::const_raw_iterator endIt = end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (it)->isAstElement( astElement ) )
+ {
+ return( *it );
+ }
+ }
+
+ return( BF::REF_NULL );
+ }
+
+
+ /**
+ * Serialization
+ */
+ inline virtual void toStream(OutStream & os) const
+ {
+ BaseTableOfAvmProgram::const_raw_iterator itProg = begin();
+ BaseTableOfAvmProgram::const_raw_iterator endProg = end();
+ for( ; itProg != endProg ; ++itProg )
+ {
+ itProg->toStream(os);
+ os << EOL;
+ }
+ }
+
+ inline virtual void fqnStream(OutStream & os) const
+ {
+ BaseTableOfAvmProgram::const_raw_iterator itProg = begin();
+ BaseTableOfAvmProgram::const_raw_iterator endProg = end();
+ for( ; itProg != endProg ; ++itProg )
+ {
+ os << TAB << itProg->getFullyQualifiedNameID() << ";" << EOL;
+ }
+ }
+
+};
+
+
+}
+
+#endif /*AVMPROGRAM_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/executable/AvmTransition.cpp b/org.eclipse.efm.symbex/src/fml/executable/AvmTransition.cpp
new file mode 100644
index 0000000..a1dc4ee
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/AvmTransition.cpp
@@ -0,0 +1,296 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 5 janv. 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmTransition.h"
+
+#include <fml/executable/ExecutableForm.h>
+
+
+namespace sep
+{
+
+
+/**
+ * GETTER - SETTER
+ * mTarget machine
+ */
+InstanceOfMachine * AvmTransition::getTargetMarchine() const
+{
+ if( getTarget().is< InstanceOfMachine >() )
+ {
+ return( getTarget().to_ptr< InstanceOfMachine >() );
+ }
+ else if( getTarget().is< RuntimeID >() )
+ {
+ return( getTarget().bfRID().getInstance() );
+ }
+ else
+ {
+ return( NULL );
+ }
+}
+
+
+std::string AvmTransition::strTargetId() const
+{
+ if( getTarget().is< InstanceOfMachine >() )
+ {
+ return( getTarget().to_ptr< InstanceOfMachine >()->getNameID() );
+ }
+ else if( getTarget().is< RuntimeID >() )
+ {
+ return( getTarget().bfRID().strUniqId() );
+ }
+ else
+ {
+ return( "[-]" );
+ }
+}
+
+
+/**
+ * Control flow analysis
+ * source & targets Executable<machine> for Transition
+ */
+ExecutableForm * AvmTransition::getTransitionSource() const
+{
+ return( getContainer()->is< ExecutableForm >() ?
+ getContainer()->to< ExecutableForm >() : NULL );
+}
+
+
+InstanceOfMachine * AvmTransition::getrecTargetMachine(AvmCode * aCode)
+{
+ switch( aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_ENABLE_SET:
+ case AVM_OPCODE_GOTO:
+ {
+ const BF & targetMachine = aCode->first();
+
+ if( targetMachine.is< InstanceOfMachine >() )
+ {
+ return( targetMachine.to_ptr< InstanceOfMachine >() );
+ }
+ else if( targetMachine.is< RuntimeID >() )
+ {
+ return( targetMachine.bfRID().getInstance() );
+ }
+
+ break;
+ }
+ default:
+ {
+ InstanceOfMachine * targetMachine = NULL;
+
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator endIt = aCode->end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).is< AvmCode >() )
+ {
+ targetMachine = getrecTargetMachine( (*it).to_ptr< AvmCode >() );
+ if( targetMachine != NULL )
+ {
+ return( targetMachine );
+ }
+ }
+ }
+ break;
+ }
+ }
+
+ return( NULL );
+}
+
+
+void AvmTransition::getrecTargetMachine(
+ ListOfInstanceOfMachine & listOfTargets, AvmCode * aCode)
+{
+ switch( aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_ENABLE_INVOKE:
+ case AVM_OPCODE_ENABLE_SET:
+ case AVM_OPCODE_GOTO:
+ {
+ const BF & targetMachine = aCode->first();
+
+ if( targetMachine.is< InstanceOfMachine >() )
+ {
+ listOfTargets.add_union(
+ targetMachine.to_ptr< InstanceOfMachine >() );
+ }
+ else if( targetMachine.is< RuntimeID >() )
+ {
+ listOfTargets.add_union( targetMachine.bfRID().getInstance() );
+ }
+
+ break;
+ }
+ default:
+ {
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator endIt = aCode->end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).is< AvmCode >() )
+ {
+ getrecTargetMachine(listOfTargets, (*it).to_ptr< AvmCode >());
+ }
+ }
+
+ break;
+ }
+ }
+}
+
+
+/**
+ * TEST
+ * the source/target machine
+ */
+bool AvmTransition::isUnstableSource() const
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( getTransitionSource() )
+ << "Transition Source !!!"
+ << SEND_EXIT;
+
+ return( getTransitionSource()->getSpecifier().isPseudostate() );
+}
+
+
+bool AvmTransition::isUnstableTarget() const
+{
+ if( getTarget().is< InstanceOfMachine >() )
+ {
+ return( getTarget().to_ptr< InstanceOfMachine >()->
+ getSpecifier().isPseudostate() );
+ }
+ else if( getTarget().is< RuntimeID >() )
+ {
+ return( getTarget().bfRID().getSpecifier().isPseudostate() );
+ }
+ else
+ {
+ return( false );
+ }
+}
+
+
+/**
+ * Serialization
+ */
+void AvmTransition::strHeader(OutStream & out) const
+{
+ out << getModifier().toString()
+ << Specifier::strScope( mScope )
+ << "< id:" << getOffset() << " > ";
+
+AVM_IF_DEBUG_FLAG_AND( COMPILING , hasAstElement() )
+ out << "&" << getAstFullyQualifiedNameID() << " ";
+AVM_ENDIF_DEBUG_FLAG_AND( COMPILING )
+
+ out << /* getNameID() */ getFullyQualifiedNameID();
+}
+
+
+void AvmTransition::toStream(OutStream & out) const
+{
+ // REFERENCE PROGRAM
+ if( out.preferablyFQN() )
+ {
+ out << TAB << getNameID();
+
+ AVM_DEBUG_REF_COUNTER(out);
+
+ return;
+ }
+
+ out << TAB << getModifier().toString()
+ << Specifier::strScope( mScope )
+ << "< id:" << getOffset() << " > ";
+
+AVM_IF_DEBUG_FLAG_AND( COMPILING , hasAstElement() )
+ out << "&" << getAstFullyQualifiedNameID() << " ";
+AVM_ENDIF_DEBUG_FLAG_AND( COMPILING )
+
+ out << getNameID();
+ if( hasTarget() )
+ {
+ out << " --> " << ( getTarget().is< ObjectElement >()
+ ? getTarget().to_ptr< ObjectElement >()->getNameID()
+ : getTarget().str() );
+ }
+ out << " {";
+ AVM_DEBUG_REF_COUNTER(out);
+ out << EOL;
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ if( hasContainer() )
+ {
+ out << TAB2 << "//container = "
+ << str_header( getContainer()->as< AvmProgram >() )
+ << ";" << EOL;
+ }
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+// out << TAB2 << "offset = " << getOffset() << ";" << EOL;
+
+
+ // Any program data
+ toStreamData(out);
+
+
+ out << TAB << "moe:" << EOL;
+
+ if( hasCode() )
+ {
+ out << TAB2 << "@run{" << INCR2_INDENT;
+
+ getCode()->toStreamRoutine( out );
+
+ out << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+ if( hasStatementFamily() )
+ {
+ out << TAB2 << "opcode#family = " << strStatementFamily() << ";" << EOL;
+ }
+
+ // static class of Port/Message/Signal in communicated transition
+ out << INCR_INDENT;
+ toStreamStaticCom(out);
+ out << DECR_INDENT;
+
+ out << TAB << "}" << EOL << std::flush;
+}
+
+
+void AvmTransition::toStream(OutStream & out,
+ const ListOfAvmTransition & listofTransition)
+{
+ ListOfAvmTransition::const_iterator itTransition = listofTransition.begin();
+ ListOfAvmTransition::const_iterator endTransition = listofTransition.end();
+ for( ; itTransition != endTransition ; ++itTransition )
+ {
+ out << TAB;
+ (*itTransition)->toStreamHeader( out );
+ out << ";" << EOL;
+ }
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/executable/AvmTransition.h b/org.eclipse.efm.symbex/src/fml/executable/AvmTransition.h
new file mode 100644
index 0000000..097a52b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/AvmTransition.h
@@ -0,0 +1,210 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 5 janv. 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMTRANSITION_H_
+#define AVMTRANSITION_H_
+
+#include <fml/executable/AvmProgram.h>
+
+#include <collection/Typedef.h>
+
+#include <fml/executable/InstanceOfMachine.h>
+
+#include <fml/expression/AvmCode.h>
+
+
+namespace sep
+{
+
+class AvmTransition;
+
+class ExecutableForm;
+
+class ObjectElement;
+
+
+class AvmTransition :
+ public AvmProgram ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( AvmTransition )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( AvmTransition )
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ // Transition Target machine
+ BF mTarget;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmTransition(AvmProgram * aContainer,
+ ObjectElement * aCompiled, avm_size_t aSize)
+ : AvmProgram(CLASS_KIND_T( AvmTransition ),
+ Specifier::SCOPE_TRANSITION_KIND, aContainer, aCompiled, aSize),
+ mTarget( )
+ {
+ updateFullyQualifiedNameID();
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AvmTransition()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER
+ * theCompiledForm
+ */
+ inline const Transition * getAstTransition() const
+ {
+ return( getAstElement()->as< Transition >() );
+ }
+
+ inline bool isAstTransition() const
+ {
+ return( getAstElement()->is< Transition >() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mTarget machine
+ */
+ inline BF & getTarget()
+ {
+ return( mTarget );
+ }
+
+ inline const BF & getTarget() const
+ {
+ return( mTarget );
+ }
+
+ InstanceOfMachine * getTargetMarchine() const;
+
+ inline bool hasTarget() const
+ {
+ return( mTarget.valid() );
+ }
+
+ inline void setTarget(const BF & aTarget)
+ {
+ mTarget = aTarget;
+ }
+
+
+ std::string strTargetId() const;
+
+
+ /**
+ * Control flow analysis
+ * source & targets Executable<machine> for Program<transition>
+ */
+ ExecutableForm * getTransitionSource() const;
+
+
+ static InstanceOfMachine * getrecTargetMachine(AvmCode * aCode);
+
+ inline InstanceOfMachine * getTransitionTarget() const
+ {
+ if( hasTarget() )
+ {
+ return( getTargetMarchine() );
+ }
+ else
+ {
+ return( hasCode() ? getrecTargetMachine( getCode() ) : NULL );
+ }
+ }
+
+
+ static void getrecTargetMachine(
+ ListOfInstanceOfMachine & listOfTargets, AvmCode * aCode);
+
+ inline void getTransitionTarget(ListOfInstanceOfMachine & listOfTargets) const
+ {
+ if( hasCode() )
+ {
+ AvmTransition::getrecTargetMachine(listOfTargets, getCode());
+ }
+ }
+
+
+ /**
+ * TEST
+ * the source/target machine
+ */
+ bool isUnstableSource() const;
+ bool isUnstableTarget() const;
+
+ bool isUnstableSourceOrTarget() const;
+
+
+ /**
+ * Serialization
+ */
+ virtual void strHeader(OutStream & out) const;
+
+ inline std::string strTransitionHeader() const
+ {
+ StringOutStream oss;
+
+ toStreamHeader( oss );
+
+ return( oss.str() );
+ }
+
+ void toStreamHeader(OutStream & out) const
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( isAstTransition() )
+ << "Unexpected a non Transition program scope !!!"
+ << SEND_EXIT;
+
+ getAstTransition()->toStreamHeader(out);
+ }
+
+
+ virtual void toStream(OutStream & out) const;
+
+ static void toStream(OutStream & out,
+ const ListOfAvmTransition & listofTransition);
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// AvmTransition
+// TYPE DEFINITION for TABLE , SMART POINTER and CONTAINER
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+typedef TableOfBF_T< AvmTransition > TableOfTransition;
+
+
+
+} /* namespace sep */
+
+#endif /* AVMTRANSITION_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/executable/BaseAvmProgram.cpp b/org.eclipse.efm.symbex/src/fml/executable/BaseAvmProgram.cpp
new file mode 100644
index 0000000..f12e967
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/BaseAvmProgram.cpp
@@ -0,0 +1,367 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 8 oct. 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "BaseAvmProgram.h"
+
+#include <fml/executable/AvmProgram.h>
+#include <fml/executable/ExecutableForm.h>
+
+#include <fml/type/BaseSymbolTypeSpecifier.h>
+
+
+namespace sep
+{
+
+
+/**
+ * GETTER
+ * any SYMBOL filtering by an optional type specifier family
+ */
+const BF & BaseAvmProgram::getSymbol(
+ const std::string & aFullyQualifiedNameID,
+ avm_type_specifier_kind_t typeFamily) const
+{
+ const BF & foundSymbol =
+ getAllData().getByFQNameID( aFullyQualifiedNameID );
+
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+
+ return( getDataAlias().getByFQNameID( aFullyQualifiedNameID ) );
+}
+
+
+const BF & BaseAvmProgram::getSymbolByQualifiedNameID(
+ const std::string & aQualifiedNameID,
+ avm_type_specifier_kind_t typeFamily) const
+{
+ const BF & foundSymbol =
+ getAllData().getByQualifiedNameID( aQualifiedNameID );
+
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+
+ return( getDataAlias().getByQualifiedNameID( aQualifiedNameID ) );
+}
+
+
+const BF & BaseAvmProgram::getSymbolByNameID(
+ const std::string & aNameID, avm_type_specifier_kind_t typeFamily) const
+{
+ const BF & foundSymbol = getAllData().getByNameID( aNameID );
+
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+
+ return( getDataAlias().getByNameID(aNameID) );
+}
+
+
+const BF & BaseAvmProgram::getSymbolByAstElement(
+ const ObjectElement * astElement,
+ avm_type_specifier_kind_t typeFamily) const
+{
+ const BF & foundSymbol = getAllData().getByAstElement( astElement );
+
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+
+ return( getDataAlias().getByAstElement( astElement ) );
+}
+
+
+/**
+ * GETTER
+ * For AvmProgram - ExecutableForm Container
+ */
+const AvmProgram * BaseAvmProgram::getAvmProgramContainer() const
+{
+ BaseAvmProgram * aContainer = getContainer();
+
+ while( (aContainer != NULL) && (not aContainer->is< AvmProgram >()) )
+ {
+ aContainer = aContainer->getContainer();
+ }
+
+ return( static_cast< const AvmProgram * >( aContainer ) );
+}
+
+const AvmProgram * BaseAvmProgram::getAvmProgram() const
+{
+ if( this->is< AvmProgram >() )
+ {
+ return( static_cast< const AvmProgram * >( this ) );
+ }
+
+ return( getAvmProgramContainer() );
+}
+
+
+
+ExecutableForm * BaseAvmProgram::getExecutableContainer() const
+{
+ BaseAvmProgram * aContainer = getContainer();
+
+ while( (aContainer != NULL) && aContainer->isnot< ExecutableForm >() )
+ {
+ aContainer = aContainer->getContainer();
+ }
+
+ return( static_cast< ExecutableForm * >( aContainer ) );
+}
+
+ExecutableForm * BaseAvmProgram::getExecutable() const
+{
+ if( this->is< ExecutableForm >() )
+ {
+ return( static_cast< ExecutableForm * >(
+ const_cast< BaseAvmProgram * >(this) ) );
+ }
+
+ return( getExecutableContainer() );
+}
+
+
+/**
+ * UPDATE DATA TABLE
+ * mBasicData
+ * mallData
+ */
+
+void BaseAvmProgram::updateDataTable()
+{
+ if( getData().empty() )
+ {
+ return;
+ }
+
+ TableOfInstanceOfData::raw_iterator itData = mData.begin();
+ TableOfInstanceOfData::raw_iterator endData = mData.end();
+ for( ; itData != endData ; ++itData )
+ {
+ if( (itData)->getTypeSpecifier()->hasTypeArrayOrStructure() &&
+ (not (itData)->getModifier().hasNatureReference()) )
+ {
+ break;
+ }
+ }
+
+ if( itData == endData )
+ {
+ mBasicData = &mData;
+ mAllData = &mData;
+
+ return;
+ }
+
+
+ if( mBasicData != &mData )
+ {
+ sep::destroy( mBasicData );
+ }
+ if( mAllData != &mData )
+ {
+ sep::destroy( mAllData );
+ }
+
+// InstanceOfData * anInstance = getData().last();
+
+ TableOfInstanceOfData tableofAllData;
+ TableOfInstanceOfData tableofBasicData;
+ TableOfSymbol relativeDataPath;
+
+ // begin() --> it is typed simple
+ TableOfInstanceOfData::const_iterator it2 = mData.begin();
+ for( ; it2 != itData ; ++it2 )
+ {
+ tableofAllData.append( (*it2) );
+ tableofBasicData.append( (*it2) );
+ }
+
+ BaseTypeSpecifier * aTypeSpecifier = NULL;
+
+ // Analyse for it --> end()
+ for( ; itData != endData ; ++itData )
+ {
+ tableofAllData.append( (*itData) );
+
+ aTypeSpecifier = (itData)->referedTypeSpecifier();
+
+ if( (itData)->getModifier().hasNatureReference() )
+ {
+ tableofBasicData.append( (*itData) );
+ }
+ else if( aTypeSpecifier->hasTypeArrayOrStructure() )
+ {
+ collectAllData(tableofAllData, tableofBasicData,
+ (itData), relativeDataPath, (itData) );
+ }
+ else
+ {
+ tableofBasicData.append( (*itData) );
+ }
+ }
+
+ mAllData = new TableOfInstanceOfData(tableofAllData);
+ mBasicData = new TableOfInstanceOfData(tableofBasicData);
+}
+
+
+void BaseAvmProgram::collectAllData(TableOfInstanceOfData & tableofAllData,
+ TableOfInstanceOfData & tableofBasicData, InstanceOfData * mainInstance,
+ TableOfSymbol & relativeDataPath, InstanceOfData * anInstance)
+{
+ std::string pefixID = anInstance->getNameID();
+ std::ostringstream ossID;
+
+ if( anInstance->getTypeSpecifier()->hasTypeStructureOrChoiceOrUnion() )
+ {
+ TableOfSymbol::iterator itField = anInstance->getTypeSpecifier()->
+ to< BaseSymbolTypeSpecifier >()->getSymbolData().begin();
+
+ TableOfSymbol::iterator it = anInstance->getAttribute()->begin();
+ TableOfSymbol::iterator itEnd = anInstance->getAttribute()->end();
+ for( ; it != itEnd ; ++it , ++itField )
+ {
+ ossID.str( "" );
+ ossID << pefixID << "."
+ << NamedElement::extractNameID(
+ (*it).getFullyQualifiedNameID() );
+
+ InstanceOfData * newInstance = new InstanceOfData(
+ IPointerDataNature::POINTER_UFI_OFFSET_NATURE,
+ mainInstance->getContainer(), (*it).rawData());
+ newInstance->setSharedData( mainInstance );
+ newInstance->setNameID( ossID.str() );
+ relativeDataPath.append( *itField );
+ newInstance->setDataPath( relativeDataPath );
+
+ newInstance->setAliasTarget( (*it).rawData() );
+ (*it).setAliasTarget( newInstance );
+
+ const BF & saveInstance = tableofAllData.save( newInstance );
+ if( newInstance->getTypeSpecifier()->hasTypeSimpleOrCollection() )
+ {
+ tableofBasicData.append( saveInstance );
+ }
+
+ collectAllData(tableofAllData, tableofBasicData , mainInstance,
+ relativeDataPath, (*it).rawData());
+
+ relativeDataPath.pop_last();
+ }
+ }
+
+ else if( anInstance->getTypeSpecifier()->isTypedArray() )
+ {
+ TableOfSymbol::iterator it = anInstance->getAttribute()->begin();
+ TableOfSymbol::iterator itEnd = anInstance->getAttribute()->end();
+ for( ; it != itEnd ; ++it )
+ {
+ ossID.str( "" );
+ ossID << pefixID << "[" << (*it).getOffset() << "]";
+
+ InstanceOfData * newInstance = new InstanceOfData(
+ IPointerDataNature::POINTER_UFI_OFFSET_NATURE,
+ mainInstance->getContainer(), (*it).rawData());
+ newInstance->setSharedData( mainInstance );
+ newInstance->setNameID( ossID.str() );
+ relativeDataPath.append( *it );
+ newInstance->setDataPath( relativeDataPath );
+
+ (*it).setAliasTarget( newInstance );
+
+ const BF & saveInstance = tableofAllData.save( newInstance );
+ if( newInstance->getTypeSpecifier()->hasTypeSimpleOrCollection() )
+ {
+ tableofBasicData.append( saveInstance );
+ }
+
+ collectAllData(tableofAllData, tableofBasicData ,
+ mainInstance, relativeDataPath, (*it).rawData());
+
+ relativeDataPath.pop_last();
+ }
+ }
+}
+
+
+/**
+ * Serialization
+ */
+void BaseAvmProgram::toStream(OutStream & os) const
+{
+ os << TAB << getModifier().toString()
+ << "avmprogram " << getFullyQualifiedNameID();
+ AVM_DEBUG_REF_COUNTER(os);
+ os << " {" << EOL;
+
+ if( hasDataAlias() )
+ {
+ os << EOL << TAB << "alias:" << EOL_INCR_INDENT;
+
+ getDataAlias().toStream(os);
+
+ os << DECR_INDENT;
+ }
+
+ if( hasData() )
+ {
+ os << EOL << TAB << "variable:" << EOL_INCR_INDENT;
+
+ getData().toStream(os);
+
+ os << DECR_INDENT;
+
+AVM_IF_DEBUG_FLAG( DATA )
+ if( mAllData != &mData )
+ {
+ os << EOL;
+ os << TAB << "variable#all:" << EOL_INCR_INDENT;
+
+ getAllData().toStream(os);
+
+ os << DECR_INDENT;
+ }
+ if( mBasicData != &mData )
+ {
+ os << EOL;
+ os << TAB << "variable#basic:" << EOL;
+
+ TableOfInstanceOfData::const_raw_iterator itData =
+ getBasicData().begin();
+ TableOfInstanceOfData::const_raw_iterator endData =
+ getBasicData().end();
+ for( ; itData != endData ; ++itData )
+ {
+ os << TAB2 << str_header( *itData ) << ";" << EOL;
+ }
+ }
+AVM_ENDIF_DEBUG_FLAG( DATA )
+ }
+
+ os << TAB << "}" << EOL << std::flush;
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/executable/BaseAvmProgram.h b/org.eclipse.efm.symbex/src/fml/executable/BaseAvmProgram.h
new file mode 100644
index 0000000..08fbf4e
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/BaseAvmProgram.h
@@ -0,0 +1,599 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 8 oct. 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BASEAVMPROGRAM_H_
+#define BASEAVMPROGRAM_H_
+
+#include <fml/executable/BaseCompiledForm.h>
+
+#include <fml/executable/InstanceOfData.h>
+
+#include <fml/lib/AvmAnalysis.h>
+#include <fml/lib/ITypeSpecifier.h>
+
+#include <fml/symbol/TableOfSymbol.h>
+
+
+namespace sep
+{
+
+class AvmProgram;
+class ExecutableForm;
+class ObjectElement;
+
+
+class BaseAvmProgram :
+ public BaseCompiledForm ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( BaseAvmProgram )
+{
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef avm_uint8_t TFLAG;
+
+ enum
+ {
+ EXECUTABLE_UNDEFINED_FLAG = 0x00,
+
+ EXECUTABLE_COMPILED_FLAG = 0x01,
+
+ EXECUTABLE_OPTIMIZED_FLAG = 0x02,
+
+ EXECUTABLE_FINALIZED_FLAG = EXECUTABLE_COMPILED_FLAG
+ | EXECUTABLE_OPTIMIZED_FLAG
+ };
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ TFLAG mFlag;
+
+ TableOfInstanceOfData mData;
+
+ TableOfInstanceOfData * mBasicData;
+ TableOfInstanceOfData * mAllData;
+
+
+ TableOfInstanceOfData mDataAlias;
+
+ // Static Analysis Data
+ // The list of reachable machine per machine
+ STATIC_ANALYSIS::VARIABLE_DEPENDENCY_RING mVariableDependencyFlag;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BaseAvmProgram(class_kind_t aClassKind, BaseAvmProgram * aContainer,
+ const ObjectElement * astProgram, avm_size_t aSize)
+ : BaseCompiledForm(aClassKind, aContainer, astProgram),
+ mFlag( EXECUTABLE_UNDEFINED_FLAG ),
+
+ mData( aSize ),
+ mBasicData( &mData ),
+ mAllData( &mData ),
+ mDataAlias( ),
+
+ mVariableDependencyFlag( STATIC_ANALYSIS::UNDEFINED_DEPENDENCY )
+ {
+ // !! NOTHING
+ }
+
+ BaseAvmProgram(class_kind_t aClassKind, BaseAvmProgram * aContainer,
+ const std::string & aNameID, avm_size_t aSize)
+ : BaseCompiledForm(aClassKind, aContainer, aNameID),
+ mFlag( EXECUTABLE_UNDEFINED_FLAG ),
+
+ mData( aSize ),
+ mBasicData( &mData ),
+ mAllData( &mData ),
+ mDataAlias( ),
+
+ mVariableDependencyFlag( STATIC_ANALYSIS::UNDEFINED_DEPENDENCY )
+ {
+ // !! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ BaseAvmProgram(const BaseAvmProgram & aProgram)
+ : BaseCompiledForm( aProgram ),
+ mFlag( aProgram.mFlag ),
+
+ mData( aProgram.mData ),
+
+ mBasicData( (aProgram.mBasicData == &(aProgram.mData) )
+ ? &mData : aProgram.mBasicData ),
+
+ mAllData( (aProgram.mAllData == &(aProgram.mData) )
+ ? &mData : aProgram.mAllData ),
+ mDataAlias( aProgram.mDataAlias ),
+
+ mVariableDependencyFlag( aProgram.mVariableDependencyFlag )
+ {
+ // !! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BaseAvmProgram()
+ {
+ if( mBasicData != &mData )
+ {
+ sep::destroy( mBasicData );
+ }
+
+ if( mAllData != &mData )
+ {
+ sep::destroy( mAllData );
+ }
+ }
+
+
+ /**
+ * GETTER
+ * mContainer
+ */
+ inline BaseAvmProgram * getContainer() const
+ {
+ return( static_cast< BaseAvmProgram * >( mContainer ) );
+ }
+
+ /**
+ * GETTER
+ * For AvmProgram - ExecutableForm Container
+ */
+ const AvmProgram * getAvmProgramContainer() const;
+ const AvmProgram * getAvmProgram() const;
+
+ ExecutableForm * getExecutableContainer() const;
+ ExecutableForm * getExecutable() const;
+
+ inline bool isAncestor(BaseAvmProgram * omrProg)
+ {
+ BaseAvmProgram * aProg = getContainer();
+ for( ; aProg != NULL ; aProg = aProg->getContainer() )
+ {
+ if( aProg == omrProg )
+ {
+ return( true );
+ }
+ }
+ return( false );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mFlag
+ */
+ bool isCompiledFlag()
+ {
+ return( (mFlag & EXECUTABLE_COMPILED_FLAG) != 0 );
+ }
+
+ void setCompiledFlag()
+ {
+ mFlag = mFlag | EXECUTABLE_COMPILED_FLAG;
+ }
+
+
+ bool isOptimizedFlag()
+ {
+ return( (mFlag & EXECUTABLE_OPTIMIZED_FLAG) != 0 );
+ }
+
+ void setOptimizedFlag()
+ {
+ mFlag = mFlag | EXECUTABLE_OPTIMIZED_FLAG;
+ }
+
+
+ bool isFinalizedFlag()
+ {
+ return( (mFlag & EXECUTABLE_FINALIZED_FLAG) != 0 );
+ }
+
+
+ /**
+ * Initialize
+ */
+ inline void init(BaseAvmProgram * aContainer, avm_size_t aSize)
+ {
+ setContainer( aContainer );
+
+ mData.resize(aSize);
+
+ mBasicData = &mData;
+ mAllData = &mData;
+ }
+
+
+ /*
+ * contains DATA
+ */
+ inline bool containsData(InstanceOfData * anInstance) const
+ {
+ return( mData.contains(anInstance) ||
+ mDataAlias.contains(anInstance) );
+ }
+
+ inline bool containsData(const BF & anInstance) const
+ {
+ return( mData.contains(anInstance) ||
+ mDataAlias.contains(anInstance) );
+ }
+
+
+ inline bool containsAllData(InstanceOfData * anInstance) const
+ {
+ return( mAllData->contains(anInstance) ||
+ mDataAlias.contains(anInstance) );
+ }
+
+// inline bool containsAllData(const BF & anInstance) const
+// {
+// return( mAllData->contains(anInstance) ||
+// mDataAlias.contains(anInstance) );
+// }
+
+
+ /**
+ * GETTER - SETTER
+ * mData
+ */
+ inline const BF & saveData(InstanceOfData * anInstance)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( anInstance )
+ << "InstanceOfData !!!"
+ << SEND_EXIT;
+
+ anInstance->setContainer(this);
+
+ return( mData.save(anInstance) );
+ }
+
+ inline void appendData(const BFList & dataList)
+ {
+ mData.append( dataList );
+ }
+
+ inline void appendData(const BFVector & dataList)
+ {
+ mData.append( dataList );
+ }
+
+
+ inline const TableOfInstanceOfData & getData() const
+ {
+ return( mData );
+ }
+
+
+ inline avm_size_t getDataSize() const
+ {
+ return( mData.size() );
+ }
+
+
+ inline bool hasData() const
+ {
+ return( mData.nonempty() );
+ }
+
+
+ inline void setData(avm_offset_t offset, InstanceOfData * anInstance)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( anInstance )
+ << "InstanceOfData !!!"
+ << SEND_EXIT;
+
+ anInstance->setContainer(this);
+
+ mData.set(offset, anInstance);
+ }
+
+ inline void setData(avm_offset_t offset, const BF & anInstance)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( anInstance )
+ << "InstanceOfData !!!"
+ << SEND_EXIT;
+
+ anInstance.to_ptr< InstanceOfData >()->setContainer(this);
+
+ mData.set(offset, anInstance);
+ }
+
+
+ inline void setData(TableOfInstanceOfData & tableOfData)
+ {
+ resetData( tableOfData );
+
+ updateDataTable();
+ }
+
+ inline void resetData(TableOfInstanceOfData & tableOfData)
+ {
+// mData.realloc( tableOfData );
+
+ mData.clear();
+ mData.append( tableOfData );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mBasicData
+ */
+ inline const TableOfInstanceOfData & getBasicData() const
+ {
+ return( * mBasicData );
+ }
+
+ inline avm_size_t getBasicDataSize() const
+ {
+ return( getBasicData().size() );
+ }
+
+ inline bool hasBasicData() const
+ {
+ return( (mBasicData != NULL) && mBasicData->nonempty() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mAllData
+ */
+ inline const TableOfInstanceOfData & getAllData() const
+ {
+ return( * mAllData );
+ }
+
+ inline avm_size_t getAllDataSize() const
+ {
+ return( (mAllData != NULL) ? mAllData->size() : 0 );
+ }
+
+ inline bool hasAllData() const
+ {
+ return( (mAllData != NULL) && mAllData->nonempty() );
+ }
+
+
+ /**
+ * UPDATE DATA TABLE
+ * mBasicData
+ * mallData
+ */
+ void updateDataTable();
+
+ void collectAllData(TableOfInstanceOfData & tableofAllData,
+ TableOfInstanceOfData & tableofBasicData, InstanceOfData * mainInstance,
+ TableOfSymbol & relativeDataPath, InstanceOfData * anInstance);
+
+
+ /**
+ * GETTER - SETTER
+ * mDataAlias
+ */
+
+ inline void appendDataAlias(const Symbol & anAlias)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( anAlias )
+ << "InstanceOfData !!!"
+ << SEND_EXIT;
+
+ mDataAlias.append(anAlias);
+ }
+
+ inline const BF & saveDataAlias(InstanceOfData * anInstance)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( anInstance )
+ << "InstanceOfData !!!"
+ << SEND_EXIT;
+
+ return( mDataAlias.save(anInstance) );
+ }
+
+ inline const TableOfInstanceOfData & getDataAlias() const
+ {
+ return( mDataAlias );
+ }
+
+
+ bool hasDataAlias() const
+ {
+ return( mDataAlias.nonempty() );
+ }
+
+
+ /**
+ * GETTER
+ * any SYMBOL filtering by an optional type specifier family
+ */
+ virtual const BF & getSymbol(
+ const std::string & aFullyQualifiedNameID,
+ avm_type_specifier_kind_t typeFamily) const;
+
+ virtual const BF & getSymbolByQualifiedNameID(
+ const std::string & aQualifiedNameID,
+ avm_type_specifier_kind_t typeFamily) const;
+
+ virtual const BF & getSymbolByNameID(const std::string & aNameID,
+ avm_type_specifier_kind_t typeFamily) const;
+
+
+ virtual const BF & getSymbolByAstElement(
+ const ObjectElement * astElement,
+ avm_type_specifier_kind_t typeFamily) const;
+
+
+ /**
+ * GETTER
+ * any SYMBOL filtering by an optional type specifier family
+ * recursively in container
+ */
+ inline const BF & getSemSymbol(
+ const std::string & aFullyQualifiedNameID,
+ avm_type_specifier_kind_t typeFamily) const
+ {
+ const BaseAvmProgram * aProgram = this;
+ for( ; aProgram != NULL ; aProgram = aProgram->getContainer() )
+ {
+ const BF & theSymbol =
+ aProgram->getSymbol(aFullyQualifiedNameID, typeFamily);
+ if( theSymbol.valid() )
+ {
+ return( theSymbol );
+ }
+ }
+
+ return( BF::REF_NULL );
+ }
+
+
+ inline const BF & getSemSymbolByQualifiedNameID(
+ const std::string & aQualifiedNameID,
+ avm_type_specifier_kind_t typeFamily) const
+ {
+ const BaseAvmProgram * aProgram = this;
+ for( ; aProgram != NULL ; aProgram = aProgram->getContainer() )
+ {
+ const BF & theSymbol = aProgram->
+ getSymbolByQualifiedNameID(aQualifiedNameID, typeFamily);
+ if( theSymbol.valid() )
+ {
+ return( theSymbol );
+ }
+ }
+
+ return( BF::REF_NULL );
+ }
+
+
+ inline const BF & getSemSymbolByNameID(const std::string & aNameID,
+ avm_type_specifier_kind_t typeFamily) const
+ {
+ const BaseAvmProgram * aProgram = this;
+ for( ; aProgram != NULL ; aProgram = aProgram->getContainer() )
+ {
+ const BF & theSymbol =
+ aProgram->getSymbolByNameID(aNameID, typeFamily);
+ if( theSymbol.valid() )
+ {
+ return( theSymbol );
+ }
+ }
+
+ return( BF::REF_NULL );
+ }
+
+
+ inline const BF & getymbolByAstElement(
+ const ObjectElement * astElement,
+ avm_type_specifier_kind_t typeFamily) const
+ {
+ const BaseAvmProgram * aProgram = this;
+ for( ; aProgram != NULL ; aProgram = aProgram->getContainer() )
+ {
+ const BF & theSymbol =
+ aProgram->getSymbolByAstElement(astElement, typeFamily);
+ if( theSymbol.valid() )
+ {
+ return( theSymbol );
+ }
+ }
+
+ return( BF::REF_NULL );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // STATIC ANALYSIS ATTRIBUTE
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * GETTER - SETTER
+ * mVariableDependencyFlag
+ */
+
+ STATIC_ANALYSIS::VARIABLE_DEPENDENCY_RING getVariableDependent() const
+ {
+ return( mVariableDependencyFlag );
+ }
+
+ bool isVariableDependent() const
+ {
+ return( mVariableDependencyFlag == STATIC_ANALYSIS::DEPENDENT );
+ }
+
+ bool isVariableIndependent() const
+ {
+ return( mVariableDependencyFlag == STATIC_ANALYSIS::INDEPENDENT );
+ }
+
+ bool hasVariableDependency() const
+ {
+ return( mVariableDependencyFlag != STATIC_ANALYSIS::UNDEFINED_DEPENDENCY );
+ }
+
+
+ void setVariableDependent(bool isDependent = true)
+ {
+ mVariableDependencyFlag = ( isDependent ?
+ STATIC_ANALYSIS::DEPENDENT : STATIC_ANALYSIS::INDEPENDENT );
+ }
+
+ void setVariableDependent()
+ {
+ mVariableDependencyFlag = STATIC_ANALYSIS::DEPENDENT;
+ }
+
+ void setVariableIndependent()
+ {
+ mVariableDependencyFlag = STATIC_ANALYSIS::INDEPENDENT;
+ }
+
+
+ /**
+ * Serialization
+ */
+ virtual void toStream(OutStream & os) const;
+
+ virtual void toFscn(OutStream & os) const
+ {
+ toStream(os);
+ }
+
+};
+
+
+}
+
+#endif /* BASEAVMPROGRAM_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/executable/BaseCompiledForm.cpp b/org.eclipse.efm.symbex/src/fml/executable/BaseCompiledForm.cpp
new file mode 100644
index 0000000..5a589c0
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/BaseCompiledForm.cpp
@@ -0,0 +1,162 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "BaseCompiledForm.h"
+
+#include <fml/executable/BaseAvmProgram.h>
+#include <fml/executable/InstanceOfBuffer.h>
+#include <fml/executable/InstanceOfPort.h>
+
+
+namespace sep
+{
+
+
+bool BaseCompiledForm::USE_ONLY_ID = false;
+
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+BaseCompiledForm::BaseCompiledForm(class_kind_t aClassKind,
+ BaseAvmProgram * aContainer, const ObjectElement * astElement)
+: ObjectElement( aClassKind , aContainer , ( (astElement != NULL) ?
+ astElement->getModifier() : Modifier::PROPERTY_UNDEFINED_MODIFIER ) ),
+mAstElement( astElement )
+{
+ //!! NOTHING
+
+// updateFullyQualifiedNameID();
+}
+
+BaseCompiledForm::BaseCompiledForm(class_kind_t aClassKind,
+ BaseAvmProgram * aContainer, const std::string & aNameID)
+: ObjectElement( aClassKind , aContainer, aNameID ),
+mAstElement( NULL )
+{
+ //!! NOTHING
+}
+
+BaseCompiledForm::BaseCompiledForm(
+ class_kind_t aClassKind, BaseAvmProgram * aContainer,
+ const ObjectElement * astElement, const Modifier & aModifier)
+: ObjectElement( aClassKind , aContainer , aModifier ),
+mAstElement( astElement )
+{
+ updateNameID();
+}
+
+/**
+ * CONSTRUCTOR
+ * Other
+ */
+BaseCompiledForm::BaseCompiledForm(class_kind_t aClassKind,
+ BaseAvmProgram * aContainer, const ObjectElement * astElement,
+ const Modifier & aModifier, const std::string & aFullyQualifiedNameID)
+: ObjectElement( aClassKind , aContainer ,
+ aModifier , aFullyQualifiedNameID , "" ),
+mAstElement( astElement )
+{
+ updateNameID();
+}
+
+BaseCompiledForm::BaseCompiledForm(
+ class_kind_t aClassKind, BaseAvmProgram * aContainer,
+ const ObjectElement * astElement, const Modifier & aModifier,
+ const std::string & aFullyQualifiedNameID, const std::string & aNameID)
+: ObjectElement( aClassKind , aContainer ,
+ aModifier , aFullyQualifiedNameID , aNameID ),
+mAstElement( astElement )
+{
+ //!! NOTHING
+}
+
+
+/**
+ * Serialization
+ */
+void BaseCompiledForm::toStreamStaticCom(OutStream & out, const BF & comBF)
+{
+ out << /*TAB <<*/ "{";
+
+ if( comBF.is< BaseInstanceForm >() )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , COMMUNICATION )
+
+ out << EOL_TAB2 << str_header( comBF.to_ptr< BaseInstanceForm >() ) << EOL;
+
+AVM_ELSE
+
+ out << EOL_TAB2
+ << comBF.to_ptr< BaseInstanceForm >()->getFullyQualifiedNameID()
+ << EOL;
+
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , COMMUNICATION )
+ }
+ else if( comBF.is< AvmCode >() )
+ {
+ if( comBF.to_ptr< AvmCode >()->nonempty() )
+ {
+ ScopeIncrIndent asii(out);
+
+ comBF.to_ptr< AvmCode >()->toStreamRoutine( out );
+ }
+ else
+ {
+ //!! EMPTY
+ }
+ }
+ else
+ {
+ comBF.toStream( out << EOL_INCR_INDENT );
+ out << DECR_EOL;
+ }
+
+ out << TAB << "}" << EOL;
+}
+
+
+void BaseCompiledForm::toStreamStaticCom(OutStream & out,
+ const ListOfInstanceOfBuffer & ieBuffers)
+{
+ ListOfInstanceOfBuffer::const_iterator itBuffer = ieBuffers.begin();
+ ListOfInstanceOfBuffer::const_iterator itBufferEnd = ieBuffers.end();
+ for( ; itBuffer != itBufferEnd ; ++itBuffer )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , COMMUNICATION )
+ out << TAB2 << str_header( *itBuffer ) << EOL;
+AVM_ELSE
+ out << TAB2 << (*itBuffer)->getFullyQualifiedNameID() << EOL;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , COMMUNICATION )
+ }
+}
+
+
+void BaseCompiledForm::toStreamStaticCom(OutStream & out,
+ const ListOfInstanceOfPort & iePorts)
+{
+ ListOfInstanceOfPort::const_iterator itPort = iePorts.begin();
+ ListOfInstanceOfPort::const_iterator itPortEnd = iePorts.end();
+ for( ; itPort != itPortEnd ; ++itPort )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , COMMUNICATION )
+ out << TAB2 << str_header( *itPort ) << EOL;
+AVM_ELSE
+ out << TAB2 << (*itPort)->getFullyQualifiedNameID() << EOL;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , COMMUNICATION )
+ }
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/executable/BaseCompiledForm.h b/org.eclipse.efm.symbex/src/fml/executable/BaseCompiledForm.h
new file mode 100644
index 0000000..f5becc6
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/BaseCompiledForm.h
@@ -0,0 +1,231 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef BASECOMPILEDFORM_H_
+#define BASECOMPILEDFORM_H_
+
+#include <fml/common/ObjectElement.h>
+
+#include <collection/Typedef.h>
+
+
+namespace sep
+{
+
+class BaseAvmProgram;
+class BF;
+class OutStream;
+
+
+class BaseCompiledForm :
+ public ObjectElement ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( BaseCompiledForm )
+{
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ const ObjectElement * mAstElement;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BaseCompiledForm(class_kind_t aClassKind,
+ BaseAvmProgram * aContainer, const ObjectElement * astElement);
+
+ BaseCompiledForm(class_kind_t aClassKind,
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID)
+ : ObjectElement( aClassKind , NULL , aFullyQualifiedNameID , aNameID),
+ mAstElement( NULL )
+ {
+ //!! NOTHING
+ }
+
+ BaseCompiledForm(class_kind_t aClassKind,
+ BaseAvmProgram * aContainer, const std::string & aNameID);
+
+
+ BaseCompiledForm(class_kind_t aClassKind, BaseAvmProgram * aContainer,
+ const ObjectElement * astElement, const Modifier & aModifier);
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ BaseCompiledForm(class_kind_t aClassKind, BaseAvmProgram * aContainer,
+ const ObjectElement * astElement, const Modifier & aModifier,
+ const std::string & aFullyQualifiedNameID);
+
+ BaseCompiledForm(class_kind_t aClassKind, BaseAvmProgram * aContainer,
+ const ObjectElement * astElement, const Modifier & aModifier,
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID);
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ BaseCompiledForm(const BaseCompiledForm & aCompiledForm)
+ : ObjectElement( aCompiledForm ),
+ mAstElement( aCompiledForm.mAstElement )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BaseCompiledForm()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mAstElement
+ */
+ inline const ObjectElement * getAstElement() const
+ {
+ return( mAstElement );
+ }
+
+ inline bool isAstElement(const ObjectElement * astElement) const
+ {
+ return( mAstElement == astElement );
+ }
+
+ inline bool hasAstElement() const
+ {
+ return( mAstElement != NULL );
+ }
+
+ inline void setAstElement(const ObjectElement * astElement)
+ {
+ mAstElement = astElement;
+
+ updateFullyQualifiedNameID();
+ }
+
+ inline std::string getAstFullyQualifiedNameID() const
+ {
+ return( (mAstElement != NULL)?
+ mAstElement->getFullyQualifiedNameID() : "<fqn-id:null>" );
+ }
+
+ inline std::string getAstNameID() const
+ {
+ return( (mAstElement != NULL)?
+ mAstElement->getNameID() : "<name-id:null>" );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mFullyQualifiedNameID
+ */
+ inline virtual const std::string & getFullyQualifiedNameID() const
+ {
+ return( USE_ONLY_ID ? getNameID() : mFullyQualifiedNameID );
+ }
+
+ virtual void updateFullyQualifiedNameID() = 0;
+
+
+ /**
+ * GETTER - SETTER
+ * mNameID
+ */
+ inline virtual const std::string & getNameID() const
+ {
+ if( mNameID.empty() )
+ {
+ //? updateNameID();
+ return( NamedElement::UNNAMED_ID );
+ }
+ return( mNameID );
+ }
+
+ virtual void updateNameID()
+ {
+ mNameID = getAstNameID();
+ if( mNameID.empty() || NamedElement::isNull(mNameID) )
+ {
+ mNameID = NamedElement::extractNameID( mFullyQualifiedNameID );
+ }
+ }
+
+
+ virtual void updateUfid(avm_size_t instanceId)
+ {
+ mFullyQualifiedNameID =
+ (OSS() << mFullyQualifiedNameID << '#' << instanceId);
+
+ mNameID = (OSS() << mNameID << '#' << instanceId);
+ }
+
+ virtual void updateUfid(const std::string & dieseExtension)
+ {
+ mFullyQualifiedNameID =
+ (OSS() << mFullyQualifiedNameID << dieseExtension);
+
+ mNameID = (OSS() << mNameID << dieseExtension);
+ }
+
+
+ static bool USE_ONLY_ID;
+
+
+ /**
+ * GETTER
+ * Compiled Element Name
+ */
+ inline std::string getUnrestrictedName() const
+ {
+ return( getAstNameID() );
+ }
+
+
+ /**
+ * Serialization
+ */
+ virtual void strHeader(OutStream & out) const = 0;
+
+ virtual std::string strHeader() const
+ {
+ StringOutStream oss;
+
+ strHeader( oss );
+
+ return( oss.str() );
+ }
+
+
+ static void toStreamStaticCom(OutStream & out, const BF & comBF);
+
+ static void toStreamStaticCom(OutStream & out,
+ const ListOfInstanceOfBuffer & ieBuffers);
+
+ static void toStreamStaticCom(OutStream & out,
+ const ListOfInstanceOfPort & iePorts);
+
+};
+
+
+}
+
+#endif /*BASECOMPILEDFORM_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/executable/BaseInstanceForm.cpp b/org.eclipse.efm.symbex/src/fml/executable/BaseInstanceForm.cpp
new file mode 100644
index 0000000..734924d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/BaseInstanceForm.cpp
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 5 août 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "BaseInstanceForm.h"
+
+#include <fml/executable/BaseAvmProgram.h>
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/InstanceOfData.h>
+
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+/**
+ * GETTER
+ * mContainer
+ */
+BaseAvmProgram * BaseInstanceForm::getContainer() const
+{
+ return( static_cast< BaseAvmProgram * >( mContainer ) );
+}
+
+
+/**
+ * SETTER
+ * mFullyQualifiedNameID
+ */
+void BaseInstanceForm::updateFullyQualifiedNameID()
+{
+ if( hasAstElement() )
+ {
+ std::string aFullyQualifiedNameID = getAstFullyQualifiedNameID();
+
+ std::string::size_type pos =
+ aFullyQualifiedNameID.find(FQN_ID_ROOT_SEPARATOR);
+ if( pos != std::string::npos )
+ {
+ setFullyQualifiedNameID(
+ "inst" + aFullyQualifiedNameID.substr(pos) );
+ }
+ else
+ {
+ setFullyQualifiedNameID( aFullyQualifiedNameID );
+ }
+ }
+ else
+ {
+ setFullyQualifiedNameID("");
+ }
+
+ updateNameID();
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/executable/BaseInstanceForm.h b/org.eclipse.efm.symbex/src/fml/executable/BaseInstanceForm.h
new file mode 100644
index 0000000..776c083
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/BaseInstanceForm.h
@@ -0,0 +1,555 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 5 août 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BASEINSTANCEFORM_H_
+#define BASEINSTANCEFORM_H_
+
+#include <base/SmartPointer.h>
+
+#include <fml/executable/BaseCompiledForm.h>
+
+#include <collection/Array.h>
+
+#include <common/AvmPointer.h>
+
+#include <fml/common/ModifierElement.h>
+#include <fml/common/ObjectElement.h>
+
+#include <fml/lib/ITypeSpecifier.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+
+/**
+ * TYPEDEDEF
+ */
+typedef Array< InstanceOfMachine * > ArrayOfInstanceOfMachine;
+
+
+class BaseAvmProgram;
+class InstanceOfMachine;
+
+
+class BaseInstanceForm :
+ public BaseCompiledForm ,
+ public ITypeSpecifier ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( BaseInstanceForm )
+{
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ // the Type Specifier
+ BaseTypeSpecifier * mTypeSpecifier;
+
+ avm_offset_t mOffset;
+
+
+ // The runtime machine container for runtime parameters creation
+ RuntimeID mCreatorContainerRID;
+
+ // The runtime machine container for runtime data access optimization
+ RuntimeID mRuntimeContainerRID;
+
+ // the Relative Machine Path for an Alias Instance from this Machine Container
+ ArrayOfInstanceOfMachine * mRelativeMachinePath;
+
+ BaseInstanceForm * mAliasTarget;
+
+ avm_uint32_t mInstanciationCount;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * copy
+ */
+ BaseInstanceForm(const BaseInstanceForm & anInstance)
+ : BaseCompiledForm( anInstance ),
+ mTypeSpecifier( anInstance.mTypeSpecifier ),
+ mOffset( anInstance.mOffset ),
+
+ mCreatorContainerRID( anInstance.mCreatorContainerRID ),
+ mRuntimeContainerRID( anInstance.mRuntimeContainerRID ),
+ mRelativeMachinePath(
+ (anInstance.mRelativeMachinePath != NULL) ?
+ new ArrayOfInstanceOfMachine(
+ *(anInstance.mRelativeMachinePath)) : NULL ),
+
+ mAliasTarget( NULL ),
+ mInstanciationCount( anInstance.mInstanciationCount )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BaseInstanceForm(class_kind_t aClassKind,
+ BaseAvmProgram * aContainer, const ObjectElement * astElement,
+ BaseTypeSpecifier * aTypeSpecifier, avm_offset_t anOffset)
+ : BaseCompiledForm(aClassKind, aContainer, astElement),
+ mTypeSpecifier( aTypeSpecifier ),
+ mOffset( anOffset ),
+
+ mCreatorContainerRID( ),
+ mRuntimeContainerRID( ),
+ mRelativeMachinePath( ),
+
+ mAliasTarget( NULL ),
+ mInstanciationCount( 0 )
+ {
+ updateFullyQualifiedNameID();
+ }
+
+ BaseInstanceForm(class_kind_t aClassKind, BaseAvmProgram * aContainer,
+ const ObjectElement * astElement, BaseTypeSpecifier * aTypeSpecifier,
+ avm_offset_t anOffset, const Modifier & aModifier)
+ : BaseCompiledForm(aClassKind, aContainer, astElement, aModifier),
+ mTypeSpecifier( aTypeSpecifier ),
+ mOffset( anOffset ),
+
+ mCreatorContainerRID( ),
+ mRuntimeContainerRID( ),
+ mRelativeMachinePath( ),
+
+ mAliasTarget( NULL ),
+ mInstanciationCount( 0 )
+ {
+ updateFullyQualifiedNameID();
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ BaseInstanceForm(class_kind_t aClassKind, BaseAvmProgram * aContainer,
+ const ObjectElement * astElement, BaseTypeSpecifier * aTypeSpecifier,
+ const std::string & aFullyQualifiedNameID, avm_offset_t anOffset,
+ const Modifier & aModifier = Modifier::PROPERTY_UNDEFINED_MODIFIER)
+ : BaseCompiledForm(aClassKind, aContainer,
+ astElement, aModifier, aFullyQualifiedNameID),
+ mTypeSpecifier( aTypeSpecifier ),
+ mOffset( anOffset ),
+
+ mCreatorContainerRID( ),
+ mRuntimeContainerRID( ),
+ mRelativeMachinePath( NULL ),
+
+ mAliasTarget( NULL ),
+ mInstanciationCount( 0 )
+ {
+ //!! NOTHING
+ }
+
+
+ BaseInstanceForm(class_kind_t aClassKind, BaseAvmProgram * aContainer,
+ const ObjectElement * astElement, BaseTypeSpecifier * aTypeSpecifier,
+ const std::string & aFullyQualifiedNameID,
+ avm_offset_t anOffset, BaseInstanceForm * aParent)
+ : BaseCompiledForm(aClassKind, aContainer, astElement,
+ aParent->getModifier(), aFullyQualifiedNameID),
+ mTypeSpecifier( aTypeSpecifier ),
+ mOffset( anOffset ),
+
+ mCreatorContainerRID( ),
+ mRuntimeContainerRID( ),
+ mRelativeMachinePath( NULL ),
+
+ mAliasTarget( NULL ),
+ mInstanciationCount( 0 )
+ {
+ //!! NOTHING
+ }
+
+
+ BaseInstanceForm(
+ class_kind_t aClassKind, BaseTypeSpecifier * aTypeSpecifier,
+ std::string aFullyQualifiedNameID, avm_offset_t anOffset,
+ const Modifier & aModifier = Modifier::PROPERTY_UNDEFINED_MODIFIER)
+ : BaseCompiledForm(aClassKind,
+ NULL, NULL, aModifier, aFullyQualifiedNameID),
+ mTypeSpecifier( aTypeSpecifier ),
+ mOffset( anOffset ),
+
+ mCreatorContainerRID( ),
+ mRuntimeContainerRID( ),
+ mRelativeMachinePath( NULL ),
+
+ mAliasTarget( NULL ),
+ mInstanciationCount( 0 )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * for UFI
+ */
+ BaseInstanceForm(class_kind_t aClassKind,
+ BaseAvmProgram * aContainer, BaseInstanceForm * aParent)
+ : BaseCompiledForm( aClassKind, aContainer,
+ aParent->getAstElement(), aParent->getModifier(),
+ aParent->getFullyQualifiedNameID(), aParent->getNameID() ),
+ mTypeSpecifier( aParent->mTypeSpecifier ),
+ mOffset( aParent->mOffset ),
+
+ mCreatorContainerRID( ),
+ mRuntimeContainerRID( ),
+ mRelativeMachinePath(
+ ( aParent->hasMachinePath() ) ?
+ new ArrayOfInstanceOfMachine(
+ *(aParent->getMachinePath())) : NULL ),
+
+ mAliasTarget( NULL ),
+ mInstanciationCount( aParent->mInstanciationCount )
+ {
+ //!! NOTHING
+ }
+
+
+ BaseInstanceForm(class_kind_t aClassKind, BaseAvmProgram * aContainer,
+ const ObjectElement * astElement, BaseInstanceForm * aModel)
+ : BaseCompiledForm( aClassKind, aContainer, astElement),
+ mTypeSpecifier( aModel->mTypeSpecifier ),
+ mOffset( aModel->mOffset ),
+
+ mCreatorContainerRID( ),
+ mRuntimeContainerRID( ),
+ mRelativeMachinePath( ( aModel->hasMachinePath() ) ?
+ new ArrayOfInstanceOfMachine( *(aModel->getMachinePath()) ) : NULL ),
+
+ mAliasTarget( NULL ),
+ mInstanciationCount( aModel->mInstanciationCount )
+ {
+ updateFullyQualifiedNameID();
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * for Alias
+ */
+ BaseInstanceForm(class_kind_t aClassKind, BaseAvmProgram * aContainer,
+ BaseInstanceForm * anAliasTarget,
+ ArrayOfInstanceOfMachine * aRelativeMachinePath)
+ : BaseCompiledForm( aClassKind , aContainer,
+ anAliasTarget->getAstElement(), anAliasTarget->getModifier(),
+ anAliasTarget->getFullyQualifiedNameID(),
+ anAliasTarget->getNameID() ),
+ mTypeSpecifier( anAliasTarget->mTypeSpecifier ),
+ mOffset( anAliasTarget->mOffset ),
+
+ mCreatorContainerRID( ),
+ mRuntimeContainerRID( ),
+ mRelativeMachinePath( aRelativeMachinePath ),
+
+ mAliasTarget( anAliasTarget ),
+ mInstanciationCount( anAliasTarget->mInstanciationCount )
+ {
+ //!! NOTHING
+ }
+
+
+ BaseInstanceForm(class_kind_t aClassKind, BaseAvmProgram * aContainer,
+ BaseInstanceForm * anAliasTarget,
+ VectorOfInstanceOfMachine & aRelativeMachinePath)
+ : BaseCompiledForm( aClassKind , aContainer ,
+ anAliasTarget->getAstElement(), anAliasTarget->getModifier(),
+ anAliasTarget->getFullyQualifiedNameID(),
+ anAliasTarget->getNameID() ),
+ mTypeSpecifier( anAliasTarget->mTypeSpecifier ),
+ mOffset( anAliasTarget->mOffset ),
+
+ mCreatorContainerRID( ),
+ mRuntimeContainerRID( ),
+ mRelativeMachinePath(
+ ( aRelativeMachinePath.nonempty() ) ?
+ new ArrayOfInstanceOfMachine(aRelativeMachinePath) : NULL ),
+
+ mAliasTarget( anAliasTarget ),
+ mInstanciationCount( anAliasTarget->mInstanciationCount )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BaseInstanceForm()
+ {
+ delete( mRelativeMachinePath );
+ }
+
+
+ /**
+ * GETTER
+ * mContainer
+ */
+ BaseAvmProgram * getContainer() const;
+
+
+ /**
+ * SETTER
+ * mFullyQualifiedNameID
+ */
+ virtual void updateFullyQualifiedNameID();
+
+
+ /**
+ * GETTER - SETTER - TESTER
+ * mTypeSpecifier
+ */
+ inline virtual const BaseTypeSpecifier * thisTypeSpecifier() const
+ {
+ return( mTypeSpecifier );
+ }
+
+
+ inline BaseTypeSpecifier * getTypeSpecifier() const
+ {
+ return( mTypeSpecifier );
+ }
+
+ inline BaseTypeSpecifier * referedTypeSpecifier() const
+ {
+ return( (mTypeSpecifier != NULL) ?
+ mTypeSpecifier->referedTypeSpecifier() : mTypeSpecifier );
+ }
+
+
+ virtual avm_type_specifier_kind_t getTypeSpecifierKind() const
+ {
+ return( (mTypeSpecifier != NULL) ?
+ mTypeSpecifier->getTypeSpecifierKind() : TYPE_NULL_SPECIFIER );
+ }
+
+
+ inline bool hasTypeSpecifier() const
+ {
+ return( mTypeSpecifier != NULL );
+ }
+
+
+ inline void setTypeSpecifier(BaseTypeSpecifier * aTypeSpecifier)
+ {
+ mTypeSpecifier = aTypeSpecifier;
+ }
+
+
+ inline bool isTypeFamily(avm_type_specifier_kind_t typeFamily)
+ {
+ return( (mTypeSpecifier == NULL) ||
+ mTypeSpecifier->isTypeFamily( typeFamily ) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mOffset
+ */
+ inline avm_offset_t getOffset() const
+ {
+ return( mOffset );
+ }
+
+ inline void setOffset(avm_offset_t anOffset)
+ {
+ mOffset = anOffset;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mCreatorContainerID
+ */
+ inline const RuntimeID & getCreatorContainerRID() const
+ {
+ return( mCreatorContainerRID );
+ }
+
+ inline bool hasCreatorContainerRID() const
+ {
+ return( mCreatorContainerRID.valid() );
+ }
+
+ inline void setCreatorContainerRID(const RuntimeID & aRID)
+ {
+ mCreatorContainerRID = aRID;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mRuntimeContainerID
+ */
+ inline const RuntimeID & getRuntimeContainerRID() const
+ {
+ return( mRuntimeContainerRID );
+ }
+
+ inline bool hasRuntimeContainerRID() const
+ {
+ return( mRuntimeContainerRID.valid() );
+ }
+
+ inline void setRuntimeContainerRID(const RuntimeID & aRID)
+ {
+ mRuntimeContainerRID = aRID;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mRelativeMachinePath
+ */
+ inline void appendMachinePath(ArrayOfInstanceOfMachine & aliasPath)
+ {
+ if( mRelativeMachinePath == NULL )
+ {
+ mRelativeMachinePath = new ArrayOfInstanceOfMachine(aliasPath);
+ }
+ else
+ {
+ mRelativeMachinePath->realloc(aliasPath);
+ }
+ }
+
+ inline ArrayOfInstanceOfMachine * getMachinePath() const
+ {
+ return( mRelativeMachinePath );
+ }
+
+ inline bool hasMachinePath() const
+ {
+ return( (mRelativeMachinePath != NULL) &&
+ mRelativeMachinePath->nonempty() );
+ }
+
+
+ inline bool isAlias() const
+ {
+ return( (mRelativeMachinePath != NULL) &&
+ mRelativeMachinePath->nonempty() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mAliasTarget
+ */
+ inline BaseInstanceForm * getAliasTarget() const
+ {
+ return( mAliasTarget );
+ }
+
+ inline bool hasAliasTarget() const
+ {
+ return( mAliasTarget != NULL );
+ }
+
+ inline void setAliasTarget(BaseInstanceForm * anAliasTarget)
+ {
+ mAliasTarget = anAliasTarget;
+ }
+
+ /**
+ * GETTER - SETTER
+ * mInstanciationCount
+ */
+ inline void incrInstanciationCount(avm_uint32_t offset = 1)
+ {
+ mInstanciationCount += offset;
+ }
+
+ inline avm_uint32_t instanciationCountIncr()
+ {
+ return( mInstanciationCount++ );
+ }
+
+ inline avm_uint32_t getInstanciationCount() const
+ {
+ return( mInstanciationCount );
+ }
+
+ inline void setInstanciationCount(avm_uint32_t anIndex)
+ {
+ mInstanciationCount = anIndex;
+ }
+
+
+ /**
+ * is equals
+ */
+ inline virtual bool equals(BaseInstanceForm * anInstance) const
+ {
+ if( this == anInstance )
+ {
+ return( true );
+ }
+ else if( anInstance != NULL )
+ {
+ return( (this->getAliasTarget() == anInstance)
+ || (this == anInstance->getAliasTarget())
+ || (this->fqnEquals(
+ anInstance->getFullyQualifiedNameID() )) );
+ }
+ return( false );
+ }
+
+
+ /**
+ * Serialization
+ */
+// virtual void toStream(OutStream & os) const;
+
+ inline virtual void toFscn(OutStream & os) const
+ {
+ os << TAB2 << getFullyQualifiedNameID() << EOL_FLUSH;
+ }
+
+
+ inline virtual std::string str() const
+ {
+ return( getFullyQualifiedNameID() );
+ }
+
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// TYPE DEFINITION CONTAINER
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+DEFINE_VECTOR_PTR( BaseInstanceForm )
+
+
+}
+
+#endif /* BASEINSTANCEFORM_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/executable/ComRouteData.cpp b/org.eclipse.efm.symbex/src/fml/executable/ComRouteData.cpp
new file mode 100644
index 0000000..b090772
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/ComRouteData.cpp
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 18 oct. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include <fml/executable/ComRouteData.h>
+
+#include <fml/executable/InstanceOfMachine.h>
+#include <fml/executable/InstanceOfPort.h>
+
+#include <fml/infrastructure/ComProtocol.h>
+#include <fml/infrastructure/Port.h>
+
+
+namespace sep
+{
+
+
+static void strPM(OutStream & os, PairMachinePort * mp)
+{
+// if( (mp->first() == NULL) || mp->first()->isThis() ||
+// NamedElement::fqnStartsWith(mp->second()->getFullyQualifiedNameID(),
+// mp->first()->getFullyQualifiedNameID()) )
+// {
+// os << mp->second()->getFullyQualifiedNameID();
+// }
+// else
+// {
+// os << mp->first()->getFullyQualifiedNameID()
+// << "->" << mp->second()->getNameID();
+// }
+
+ if( mp != NULL )
+ {
+ os << ( (mp->first() != NULL) ? mp->first()->getNameID() : "machine<null> " )
+ << "->" << ( (mp->second() != NULL) ?
+ mp->second()->getNameID() : "port<null>" );
+ }
+ else
+ {
+ os << "(machine->port)<null>";
+ }
+}
+
+
+/**
+ * Serialization
+ */
+void ComRouteData::toStream(OutStream & out) const
+{
+ out << TAB << getModifier().strDirection();
+ if( hasCast() )
+ {
+ out << "< " << ComProtocol::to_string( getCast() ) << " >";
+ }
+
+ if( getMachinePorts().singleton() )
+ {
+ out << " ";
+ strPM(out, getMachinePorts().first());
+ out << ";" << EOL_FLUSH;
+ }
+ else if( getMachinePorts().nonempty() )
+ {
+ out << " {" << EOL;
+ VectorOfPairMachinePort::const_iterator it = getMachinePorts().begin();
+ VectorOfPairMachinePort::const_iterator endIt = getMachinePorts().end();
+ for( ; it != endIt ; ++it )
+ {
+ out << TAB2;
+ strPM(out, (*it));
+ out << ";" << EOL;
+ }
+ out << TAB << "}" << EOL_FLUSH;
+ }
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/executable/ComRouteData.h b/org.eclipse.efm.symbex/src/fml/executable/ComRouteData.h
new file mode 100644
index 0000000..515d1c2
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/ComRouteData.h
@@ -0,0 +1,204 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 18 oct. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef COMROUTEDATA_H_
+#define COMROUTEDATA_H_
+
+#include <common/AvmPointer.h>
+
+#include <collection/Typedef.h>
+
+#include <fml/lib/IComPoint.h>
+
+#include <fml/executable/BaseCompiledForm.h>
+#include <fml/executable/InstanceOfMachine.h>
+#include <fml/executable/InstanceOfPort.h>
+
+#include <fml/infrastructure/ComProtocol.h>
+#include <fml/infrastructure/Connector.h>
+
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+
+/**
+ * TYPEDEF
+ * Pair
+ * InstanceOfMachine
+ * InstanceOfPort
+ */
+typedef Pair< InstanceOfMachine * , InstanceOfPort * > PairMachinePort;
+
+DEFINE_LIST_PTR( PairMachinePort )
+
+DEFINE_VECTOR_PTR( PairMachinePort )
+
+
+class ComRouteData :
+ public BaseCompiledForm,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ComRouteData )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( ComRouteData )
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ // The list of OUTPUT Port
+ VectorOfPairMachinePort mMachinePorts;
+
+ ComProtocol::PROTOCOL_KIND mCast;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ComRouteData(const Connector * aConnector,
+ Modifier::DIRECTION_KIND ioDirection)
+ : BaseCompiledForm( CLASS_KIND_T( ComRouteData ) , NULL, aConnector ),
+ mMachinePorts( ),
+ mCast( ComProtocol::PROTOCOL_UNDEFINED_KIND )
+ {
+ getwModifier().setDirectionKind( ioDirection );
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ ComRouteData(const ComRouteData & aCRD)
+ : BaseCompiledForm( aCRD ),
+ mMachinePorts( aCRD.mMachinePorts ),
+ mCast( aCRD.mCast )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ComRouteData()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * SETTER
+ * mUFI
+ * mID
+ */
+ virtual void updateFullyQualifiedNameID()
+ {
+ if( hasAstElement() )
+ {
+ std::string aFullyQualifiedNameID = getAstFullyQualifiedNameID();
+
+ std::string::size_type pos =
+ aFullyQualifiedNameID.find(FQN_ID_ROOT_SEPARATOR);
+ if( pos != std::string::npos )
+ {
+ setFullyQualifiedNameID(
+ "com" + aFullyQualifiedNameID.substr(pos) );
+ }
+ else
+ {
+ setFullyQualifiedNameID( aFullyQualifiedNameID );
+ }
+ }
+ else
+ {
+ setFullyQualifiedNameID("");
+ }
+
+ updateNameID();
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mCast
+ */
+ inline ComProtocol::PROTOCOL_KIND getCast() const
+ {
+ return( mCast );
+ }
+
+ inline bool hasCast() const
+ {
+ return( mCast != ComProtocol::PROTOCOL_UNDEFINED_KIND );
+ }
+
+ inline void setCast(ComProtocol::PROTOCOL_KIND aCast)
+ {
+ mCast = aCast;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mMachinePorts
+ */
+ inline VectorOfPairMachinePort & getMachinePorts()
+ {
+ return( mMachinePorts );
+ }
+
+ inline const VectorOfPairMachinePort & getMachinePorts() const
+ {
+ return( mMachinePorts );
+ }
+
+ inline bool hasMachinePorts() const
+ {
+ return( mMachinePorts.nonempty() );
+ }
+
+ inline void appendMachinePort(PairMachinePort & aMachinePort)
+ {
+ mMachinePorts.append(&aMachinePort);
+ }
+
+ inline void appendMachinePort(
+ InstanceOfMachine * aMachine, InstanceOfPort * aPort)
+ {
+ mMachinePorts.append(new PairMachinePort(aMachine, aPort));
+ }
+
+
+ /**
+ * Serialization
+ */
+ inline void strHeader(OutStream & out) const
+ {
+ out << str_indent( this );
+ }
+
+ void toStream(OutStream & out) const;
+
+};
+
+
+} /* namespace sep */
+
+#endif /* COMROUTEDATA_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/executable/ExecutableForm.cpp b/org.eclipse.efm.symbex/src/fml/executable/ExecutableForm.cpp
new file mode 100644
index 0000000..a674fec
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/ExecutableForm.cpp
@@ -0,0 +1,1501 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "ExecutableForm.h"
+
+#include <collection/List.h>
+
+#include <fml/common/SpecifierElement.h>
+
+#include <fml/executable/ExecutableSystem.h>
+
+#include <fml/expression/StatementTypeChecker.h>
+
+#include <fml/infrastructure/BehavioralPart.h>
+#include <fml/infrastructure/Transition.h>
+
+
+namespace sep
+{
+
+
+/**
+ * SETTER
+ * updateFullyQualifiedNameID()
+ */
+void ExecutableForm::updateFullyQualifiedNameID(
+ const std::string & aFullyQualifiedNameID)
+{
+ std::string::size_type pos =
+ aFullyQualifiedNameID.find(FQN_ID_ROOT_SEPARATOR);
+ if( pos != std::string::npos )
+ {
+ setFullyQualifiedNameID( "exec" + aFullyQualifiedNameID.substr(pos) );
+ }
+ else
+ {
+ setFullyQualifiedNameID( "exec::" + aFullyQualifiedNameID );
+
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected UFI without LOCATOR for executable:> "
+ << aFullyQualifiedNameID << " !!!"
+ << SEND_EXIT;
+ }
+
+ setNameID( NamedElement::extractNameID( aFullyQualifiedNameID ) );
+}
+
+
+
+/**
+ * GETTER
+ * any SYMBOL filtering by an optional type specifier family
+ */
+
+#define IF_MUST_BE_MACHINE_SYMBOL \
+ if( (typeFamily == TYPE_MACHINE_SPECIFIER) || \
+ (typeFamily == TYPE_UNIVERSAL_SPECIFIER) || \
+ (typeFamily == TYPE_UNDEFINED_SPECIFIER) )
+
+
+#define IF_MUST_BE_GENERIC_PORT_SYMBOL \
+ if( (typeFamily == TYPE_PORT_SPECIFIER) || \
+ (typeFamily == TYPE_SIGNAL_SPECIFIER) || \
+ (typeFamily == TYPE_MESSAGE_SPECIFIER) || \
+ (typeFamily == TYPE_UNIVERSAL_SPECIFIER) || \
+ (typeFamily == TYPE_UNDEFINED_SPECIFIER) )
+
+
+#define IF_MUST_BE_CHANNEL_SYMBOL \
+ if( (typeFamily == TYPE_CHANNEL_SPECIFIER) || \
+ (typeFamily == TYPE_UNIVERSAL_SPECIFIER) || \
+ (typeFamily == TYPE_UNDEFINED_SPECIFIER) )
+
+
+#define IF_MUST_BE_BUFFER_SYMBOL \
+ if( (typeFamily == TYPE_BUFFER_SPECIFIER) || \
+ (typeFamily == TYPE_UNIVERSAL_SPECIFIER) || \
+ (typeFamily == TYPE_UNDEFINED_SPECIFIER) )
+
+
+#define IF_MUST_BE_CONNECTOR_SYMBOL \
+ if( (typeFamily == TYPE_CONNECTOR_SPECIFIER) || \
+ (typeFamily == TYPE_UNIVERSAL_SPECIFIER) || \
+ (typeFamily == TYPE_UNDEFINED_SPECIFIER) )
+
+
+#define ANYTHING_ELSE_CONDITION ( \
+ ( typeFamily != TYPE_MACHINE_SPECIFIER ) && \
+ ( typeFamily != TYPE_PORT_SPECIFIER ) && \
+ ( typeFamily != TYPE_SIGNAL_SPECIFIER ) && \
+ ( typeFamily != TYPE_MESSAGE_SPECIFIER ) && \
+ ( typeFamily != TYPE_CHANNEL_SPECIFIER ) && \
+ ( typeFamily != TYPE_BUFFER_SPECIFIER ) && \
+ ( typeFamily != TYPE_CONNECTOR_SPECIFIER ) )
+
+
+#define IF_COULD_BE_TYPE_SPECIFIER_SYMBOL \
+ if( ANYTHING_ELSE_CONDITION )
+
+
+#define IF_COULD_BE_TRANSITION_SYMBOL \
+ if( ANYTHING_ELSE_CONDITION )
+
+
+#define IF_COULD_BE_GENERIC_PROGRAM_SYMBOL \
+ if( ANYTHING_ELSE_CONDITION )
+
+
+
+const BF & ExecutableForm::getSymbol(
+ const std::string & aFullyQualifiedNameID,
+ avm_type_specifier_kind_t typeFamily) const
+{
+ IF_MUST_BE_GENERIC_PORT_SYMBOL
+ {
+ const Symbol & foundSymbol =
+ mTableOfPort.getByFQNameID( aFullyQualifiedNameID );
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ IF_MUST_BE_MACHINE_SYMBOL
+ {
+ const Symbol & foundSymbol =
+ mTableOfInstanceStatic.getByFQNameID( aFullyQualifiedNameID );
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+// IF_MUST_BE_MACHINE_SYMBOL
+// {
+// const Symbol & foundSymbol =
+ mTableOfInstanceModel.getByFQNameID( aFullyQualifiedNameID );
+// if( foundSymbol.valid() )
+// {
+// return( foundSymbol );
+// }
+// }
+
+ IF_MUST_BE_BUFFER_SYMBOL
+ {
+ const Symbol & foundSymbol =
+ mTableOfBuffer.getByFQNameID( aFullyQualifiedNameID );
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ IF_MUST_BE_CONNECTOR_SYMBOL
+ {
+ const Symbol & foundSymbol =
+ mTableOfChannel.getByFQNameID( aFullyQualifiedNameID );
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ IF_MUST_BE_CONNECTOR_SYMBOL
+ {
+ const Symbol & foundSymbol =
+ mTableOfConnect.getByFQNameID( aFullyQualifiedNameID );
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+
+ // UNCONDITIONAL
+ {
+ const BF & foundSymbol =
+ AvmProgram::getSymbol(aFullyQualifiedNameID, typeFamily);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+
+ IF_COULD_BE_TYPE_SPECIFIER_SYMBOL
+ {
+ const BF & foundSymbol =
+ getTypeSpecifier().getByFQNameID( aFullyQualifiedNameID );
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ IF_COULD_BE_TRANSITION_SYMBOL
+ {
+ const BF & foundSymbol =
+ getTransition().getByFQNameID( aFullyQualifiedNameID );
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ IF_COULD_BE_GENERIC_PROGRAM_SYMBOL
+ {
+ const BF & foundSymbol =
+ getProgram().getByFQNameID( aFullyQualifiedNameID );
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ // UNCONDITIONAL
+ {
+ const Symbol & foundSymbol =
+ getAlias().getByFQNameID( aFullyQualifiedNameID );
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+const BF & ExecutableForm::getSymbolByQualifiedNameID(
+ const std::string & aQualifiedNameID,
+ avm_type_specifier_kind_t typeFamily) const
+{
+ IF_MUST_BE_GENERIC_PORT_SYMBOL
+ {
+ const Symbol & foundSymbol =
+ mTableOfPort.getByQualifiedNameID( aQualifiedNameID );
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ IF_MUST_BE_MACHINE_SYMBOL
+ {
+ const Symbol & foundSymbol = mTableOfInstanceStatic.
+ getByQualifiedNameID( aQualifiedNameID );
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+ IF_MUST_BE_MACHINE_SYMBOL
+ {
+ const Symbol & foundSymbol = mTableOfInstanceDynamic.
+ getByQualifiedNameID( aQualifiedNameID );
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+// IF_MUST_BE_MACHINE_SYMBOL
+// {
+// const Symbol & foundSymbol =
+// mTableOfInstanceModel.getByQualifiedNameID(aQualifiedNameID);
+// if( foundSymbol.valid() )
+// {
+// return( foundSymbol );
+// }
+// }
+
+ IF_MUST_BE_BUFFER_SYMBOL
+ {
+ const Symbol & foundSymbol =
+ mTableOfBuffer.getByQualifiedNameID(aQualifiedNameID);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ IF_MUST_BE_CONNECTOR_SYMBOL
+ {
+ const Symbol & foundSymbol =
+ mTableOfConnect.getByQualifiedNameID(aQualifiedNameID);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+
+ // UNCONDITIONAL
+ {
+ const BF & foundSymbol =
+ AvmProgram::getSymbolByQualifiedNameID(
+ aQualifiedNameID, typeFamily);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+
+ IF_COULD_BE_TYPE_SPECIFIER_SYMBOL
+ {
+ const BF & foundSymbol = mTableOfTypeSpecifier.
+ getByQualifiedNameID( aQualifiedNameID );
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ IF_COULD_BE_TRANSITION_SYMBOL
+ {
+ const BF & foundSymbol = mTableOfTransition.
+ getByQualifiedNameID( aQualifiedNameID );
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ IF_COULD_BE_GENERIC_PROGRAM_SYMBOL
+ {
+ const BF & foundSymbol = mTableOfProgram.
+ getByQualifiedNameID( aQualifiedNameID );
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+
+// // UNCONDITIONAL
+// {
+// const Symbol & foundSymbol =
+// mTableOfAlias.getByQualifiedNameID( aQualifiedNameID );
+// if( foundSymbol.valid() )
+// {
+// return( foundSymbol );
+// }
+// }
+
+ return( BF::REF_NULL );
+}
+
+
+const BF & ExecutableForm::getSymbolByNameID(const std::string & aNameID,
+ avm_type_specifier_kind_t typeFamily) const
+{
+ IF_MUST_BE_GENERIC_PORT_SYMBOL
+ {
+ const Symbol & foundSymbol = mTableOfPort.getByNameID(aNameID);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ IF_MUST_BE_MACHINE_SYMBOL
+ {
+ const Symbol & foundSymbol =
+ mTableOfInstanceStatic.getByNameID(aNameID);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+// IF_MUST_BE_MACHINE_SYMBOL
+// {
+// const Symbol & foundSymbol =
+// mTableOfInstanceModel.getByNameID(aNameID);
+// if( foundSymbol.valid() )
+// {
+// return( foundSymbol );
+// }
+// }
+
+ IF_MUST_BE_BUFFER_SYMBOL
+ {
+ const Symbol & foundSymbol = mTableOfBuffer.getByNameID(aNameID);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ IF_MUST_BE_CONNECTOR_SYMBOL
+ {
+ const Symbol & foundSymbol = mTableOfConnect.getByNameID(aNameID);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+
+ // UNCONDITIONAL
+ {
+ const BF & foundSymbol =
+ AvmProgram::getSymbolByNameID(aNameID, typeFamily);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+
+ IF_COULD_BE_TYPE_SPECIFIER_SYMBOL
+ {
+ const BF & foundSymbol = mTableOfTypeSpecifier.getByNameID(aNameID);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ IF_COULD_BE_TRANSITION_SYMBOL
+ {
+ const BF & foundSymbol = mTableOfTransition.getByNameID(aNameID);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ IF_COULD_BE_GENERIC_PROGRAM_SYMBOL
+ {
+ const BF & foundSymbol = mTableOfProgram.getByNameID(aNameID);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+
+// // UNCONDITIONAL
+// {
+// const Symbol & foundSymbol = mTableOfAlias.getByNameID(id);
+// if( foundSymbol.valid() )
+// {
+// return( foundSymbol );
+// }
+// }
+
+ return( BF::REF_NULL );
+}
+
+
+const BF & ExecutableForm::getSymbolByAstElement(
+ const ObjectElement * astElement,
+ avm_type_specifier_kind_t typeFamily) const
+{
+ IF_MUST_BE_GENERIC_PORT_SYMBOL
+ {
+ const Symbol & foundSymbol = mTableOfPort.getByAstElement(astElement);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ IF_MUST_BE_MACHINE_SYMBOL
+ {
+ const Symbol & foundSymbol = getByAstInstanceStatic(astElement);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ IF_MUST_BE_BUFFER_SYMBOL
+ {
+ const Symbol & foundSymbol = mTableOfBuffer.getByAstElement(astElement);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ IF_MUST_BE_CHANNEL_SYMBOL
+ {
+ const Symbol & foundSymbol = mTableOfChannel.getByAstElement(astElement);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ IF_MUST_BE_CONNECTOR_SYMBOL
+ {
+ const Symbol & foundSymbol = mTableOfConnect.getByAstElement(astElement);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+
+ // UNCONDITIONAL
+ {
+ const BF & foundSymbol =
+ AvmProgram::getSymbolByAstElement(astElement, typeFamily);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+
+ IF_COULD_BE_TYPE_SPECIFIER_SYMBOL
+ {
+ const BF & foundSymbol = getTypeSpecifier().getByAstElement(astElement);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ IF_COULD_BE_TRANSITION_SYMBOL
+ {
+ const BF & foundSymbol = getTransition().getByAstElement(astElement);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ IF_COULD_BE_GENERIC_PROGRAM_SYMBOL
+ {
+ const BF & foundSymbol = getProgram().getByAstElement(astElement);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+
+ // UNCONDITIONAL
+ {
+ const Symbol & foundSymbol = getAlias().getByAstElement(astElement);
+ if( foundSymbol.valid() )
+ {
+ return( foundSymbol );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+/**
+ * GETTER - SETTER
+ * Machine Count
+ */
+avm_size_t ExecutableForm::getrecMachineCount() const
+{
+ avm_size_t count = 0;
+
+ if( hasInstanceStatic() )
+ {
+ TableOfSymbol::const_iterator itMachine = instance_static_begin();
+ TableOfSymbol::const_iterator endIt = instance_static_end();
+ for( ; itMachine != endIt ; ++itMachine )
+ {
+ count += 1;
+
+ if( (*itMachine).hasExecutable() )
+ {
+ count += (*itMachine).getExecutable()->getrecMachineCount();
+ }
+ }
+ }
+ return( count );
+}
+
+
+
+/**
+ * ExecutableForm::LCA
+ *
+ */
+const ExecutableForm * ExecutableForm::LCA(
+ const ExecutableForm * anExecutable) const
+{
+ List< const ExecutableForm * > containerListOfThis;
+ containerListOfThis.push_back(this);
+
+ ExecutableForm * containerOfThis = this->getExecutableContainer();
+ for ( ; containerOfThis != NULL ;
+ containerOfThis = containerOfThis->getExecutableContainer() )
+ {
+ containerListOfThis.push_back(containerOfThis);
+ }
+
+ List< const ExecutableForm * > containerListOfOtherExecutable;
+ containerListOfOtherExecutable.push_back(anExecutable);
+
+ ExecutableForm * containerOfOtherForm = anExecutable->getExecutableContainer();
+ for ( ; containerOfOtherForm != NULL ;
+ containerOfOtherForm = containerOfOtherForm->getExecutableContainer() )
+ {
+ containerListOfOtherExecutable.push_back(containerOfOtherForm);
+ }
+
+ List< const ExecutableForm * >::const_iterator otherIt;
+ List< const ExecutableForm * >::
+ const_iterator oneIt = containerListOfThis.begin();
+ for ( ; oneIt != containerListOfThis.end() ; oneIt++ )
+ {
+ otherIt = containerListOfOtherExecutable.begin();
+ for ( ; otherIt != containerListOfOtherExecutable.end() ; ++otherIt )
+ {
+ if( (*oneIt) == (*otherIt) )
+ {
+// AVM_OS_LOG << "LCA ( "
+// << oneExecutable->getFullyQualifiedNameID()
+// << " , " << otherExecutable->getFullyQualifiedNameID()
+// << " ) = " << (*oneIt)->getFullyQualifiedNameID();
+
+ return( *oneIt );
+ }
+ }
+ }
+
+ return( NULL );
+}
+
+
+/*
+ * GETTER - SETTER
+ * Single or Multiple
+ * Instanciation Information
+ * for Data Access optimisation
+ */
+void ExecutableForm::incrPossibleStaticInstanciationCount(avm_offset_t offset)
+{
+ mPossibleStaticInstanciationCount += offset;
+
+ if( mPossibleStaticInstanciationCount > 1 )
+ {
+ TableOfSymbol::const_iterator itInstabce = instance_static_begin();
+ TableOfSymbol::const_iterator endInstabce = instance_static_end();
+ for( ; itInstabce != endInstabce ; ++itInstabce )
+ {
+ (*itInstabce).getExecutable()->
+ incrPossibleStaticInstanciationCount(offset);
+ }
+ }
+}
+
+
+void ExecutableForm::incrPossibleDynamicInstanciationCount(avm_size_t offset)
+{
+ mPossibleDynamicInstanciationCount += offset;
+
+ if( mPossibleDynamicInstanciationCount > 1 )
+ {
+ TableOfSymbol::const_iterator itInstabce = instance_static_begin();
+ TableOfSymbol::const_iterator endInstabce = instance_static_end();
+ for( ; itInstabce != endInstabce ; ++itInstabce )
+ {
+ (*itInstabce).getExecutable()->
+ incrPossibleDynamicInstanciationCount(offset);
+ }
+ }
+}
+
+
+bool ExecutableForm::hasSingleRuntimeInstance()
+{
+// AVM_OS_COUT << strModifier() << "executable< mok:"
+// << getSpecifier().str()
+// << " , id:" << getOffset()
+// << " , pic:(static:" << mPossibleStaticInstanciationCount
+// << " , dynamic:" << mPossibleDynamicInstanciationCount << ")"
+// << " , instance:(init:" << mInitialInstanceCount
+// << " , max:" << ( (mMaximalInstanceCount == AVM_NUMERIC_MAX_SIZE_T) ?
+// -1 : static_cast< avm_int64_t >(mMaximalInstanceCount) )
+// << ") > " << getFullyQualifiedNameID() << std::endl;
+
+ if( (mPossibleStaticInstanciationCount > 1) ||
+ (mPossibleDynamicInstanciationCount > 0) )
+ {
+ return( false );
+ }
+
+ else
+ {
+ ExecutableForm * containerExec = getExecutableContainer();
+
+ if( (containerExec != NULL) &&
+ (not containerExec->hasSingleRuntimeInstance()) )
+ {
+ mPossibleDynamicInstanciationCount = 1;
+
+ return( false );
+ }
+
+ return( true );
+ }
+}
+
+
+/**
+ * GETTER - SETTER
+ * mMutableScheduleFlag
+ * MOC Attribute for mutable Schedule
+ */
+
+bool ExecutableForm::isInlinableSchedule() const
+{
+// if( not hasSingleRuntimeInstance() )
+// {
+// return( false );
+// }
+
+ TableOfSymbol::const_iterator itModel = instance_model_begin();
+ TableOfSymbol::const_iterator endModel = instance_model_end();
+ for( ; itModel != endModel ; ++itModel )
+ {
+ if( not (*itModel).getExecutable()->hasSingleRuntimeInstance() )
+ {
+ return( false );
+ }
+ }
+
+ return( (not mMutableScheduleFlag) );
+}
+
+
+
+/**
+ * GETTER
+ * on activity by opcode
+ */
+AvmProgram & ExecutableForm::getOnActivityRoutine(AVM_OPCODE opCode)
+{
+ switch( opCode )
+ {
+ case AVM_OPCODE_INIT:
+ {
+ return( getOnInitRoutine() );
+ }
+ case AVM_OPCODE_FINAL:
+ case AVM_OPCODE_DESTROY:
+ {
+ return( getOnFinalRoutine() );
+ }
+
+ case AVM_OPCODE_RETURN:
+ {
+ return( getOnReturnRoutine() );
+ }
+
+ case AVM_OPCODE_START:
+ case AVM_OPCODE_RESTART:
+ {
+ return( getOnStartRoutine() );
+ }
+ case AVM_OPCODE_STOP:
+ {
+ return( getOnStopRoutine() );
+ }
+
+// case AVM_OPCODE_WAIT:
+// case AVM_OPCODE_SUSPEND:
+// case AVM_OPCODE_RESUME:
+
+ case AVM_OPCODE_IENABLE_INVOKE:
+ {
+ return( getOnIEnableRoutine() );
+ }
+ case AVM_OPCODE_ENABLE_INVOKE:
+ {
+ return( getOnEnableRoutine() );
+ }
+// case AVM_OPCODE_ENABLE_SET:
+
+ case AVM_OPCODE_IDISABLE_INVOKE:
+ {
+ return( getOnIDisableRoutine() );
+ }
+ case AVM_OPCODE_DISABLE_INVOKE:
+ {
+ return( getOnDisableRoutine() );
+ }
+// case AVM_OPCODE_DISABLE_SET:
+
+// case AVM_OPCODE_DISABLE_CHILD:
+// case AVM_OPCODE_DISABLE_SELF:
+// case AVM_OPCODE_DISABLE_SELVES:
+
+ case AVM_OPCODE_IABORT_INVOKE:
+ {
+ return( getOnIAbortRoutine() );
+ }
+ case AVM_OPCODE_ABORT_INVOKE:
+ {
+ return( getOnAbortRoutine() );
+ }
+// case AVM_OPCODE_ABORT_SET:
+
+// case AVM_OPCODE_ABORT_CHILD:
+// case AVM_OPCODE_ABORT_SELF:
+// case AVM_OPCODE_ABORT_SELVES:
+
+ case AVM_OPCODE_IRUN:
+ {
+ return( getOnIRunRoutine() );
+ }
+ case AVM_OPCODE_RUN:
+ {
+ return( getOnRunRoutine() );
+ }
+
+ case AVM_OPCODE_RTC:
+ {
+ return( getOnRtcRoutine() );
+ }
+
+ case AVM_OPCODE_SCHEDULE_INVOKE:
+ {
+ return( getOnScheduleRoutine() );
+ }
+
+// case AVM_OPCODE_DEFER_INVOKE:
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ExecutableForm::getOnActivityRoutine:> "
+ "Unexpected AVM_OPCODE !!!"
+ << SEND_EXIT;
+
+ return( getOnScheduleRoutine() );
+ }
+ }
+}
+
+
+const BFCode & ExecutableForm::getOnActivity(AVM_OPCODE opCode) const
+{
+ switch( opCode )
+ {
+ case AVM_OPCODE_INIT:
+ {
+ return( getOnInit() );
+ }
+ case AVM_OPCODE_FINAL:
+ case AVM_OPCODE_DESTROY:
+ {
+ return( getOnFinal() );
+ }
+
+ case AVM_OPCODE_RETURN:
+ {
+ return( getOnReturn() );
+ }
+
+ case AVM_OPCODE_START:
+ case AVM_OPCODE_RESTART:
+ {
+ return( getOnStart() );
+ }
+ case AVM_OPCODE_STOP:
+ {
+ return( getOnStop() );
+ }
+
+// case AVM_OPCODE_WAIT:
+// case AVM_OPCODE_SUSPEND:
+// case AVM_OPCODE_RESUME:
+
+ case AVM_OPCODE_IENABLE_INVOKE:
+ {
+ return( getOnIEnable() );
+ }
+ case AVM_OPCODE_ENABLE_INVOKE:
+ {
+ return( getOnEnable() );
+ }
+// case AVM_OPCODE_ENABLE_SET:
+
+ case AVM_OPCODE_IDISABLE_INVOKE:
+ {
+ return( getOnIDisable() );
+ }
+ case AVM_OPCODE_DISABLE_INVOKE:
+ {
+ return( getOnDisable() );
+ }
+// case AVM_OPCODE_DISABLE_SET:
+
+// case AVM_OPCODE_DISABLE_CHILD:
+// case AVM_OPCODE_DISABLE_SELF:
+// case AVM_OPCODE_DISABLE_SELVES:
+
+ case AVM_OPCODE_IABORT_INVOKE:
+ {
+ return( getOnIAbort() );
+ }
+ case AVM_OPCODE_ABORT_INVOKE:
+ {
+ return( getOnAbort() );
+ }
+// case AVM_OPCODE_ABORT_SET:
+
+// case AVM_OPCODE_ABORT_CHILD:
+// case AVM_OPCODE_ABORT_SELF:
+// case AVM_OPCODE_ABORT_SELVES:
+
+ case AVM_OPCODE_IRUN:
+ {
+ return( getOnIRun() );
+ }
+ case AVM_OPCODE_RUN:
+ {
+ return( getOnRun() );
+ }
+
+ case AVM_OPCODE_RTC:
+ {
+ return( getOnRtc() );
+ }
+
+ case AVM_OPCODE_SCHEDULE_INVOKE:
+ {
+ return( getOnSchedule() );
+ }
+
+// case AVM_OPCODE_DEFER_INVOKE:
+
+ default:
+ {
+ return( BFCode::REF_NULL );
+ }
+ }
+}
+
+
+/**
+ * Serialization
+ */
+void ExecutableForm::header(OutStream & os) const
+{
+ os << getModifier().toString()
+ << getSpecifier().toString( Specifier::ENABLE_FEATURE_DESIGN_FIELD )
+ << "executable< moc: "
+ << getSpecifier().str( Specifier::DISABLE_FEATURE_DESIGN_FIELD )
+ << " , id:" << getOffset();
+
+ InstanceSpecifierPart::strMultiplicity(
+ os, mPossibleStaticInstanciationCount,
+ mPossibleDynamicInstanciationCount,
+ mMaximalInstanceCount, ", instanciation: [ ", " ]");
+
+//AVM_IF_DEBUG_ENABLED_AND(
+// getSpecifier().isFamilyComponentComposite()
+// && ( (mPossibleStaticInstanciationCount != 1)
+// || (mPossibleDynamicInstanciationCount > 0) ) )
+// os << " , pic:(static:" << mPossibleStaticInstanciationCount
+// << " , dynamic:" << mPossibleDynamicInstanciationCount << ")";
+//AVM_ENDIF_DEBUG_ENABLED
+//
+//AVM_IF_DEBUG_ENABLED_AND(
+// getSpecifier().isFamilyComponentComposite()
+// && ( (mInitialInstanceCount != 1)
+// || (mMaximalInstanceCount != AVM_NUMERIC_MAX_SIZE_T) ) )
+// os << " , instance:(init:" << mInitialInstanceCount << " , max:"
+// << ( (mMaximalInstanceCount == AVM_NUMERIC_MAX_SIZE_T) ?
+// -1 : static_cast< avm_int64_t >(mMaximalInstanceCount) )
+// << " )";
+//AVM_ENDIF_DEBUG_ENABLED
+
+ os << " > ";
+};
+
+
+void ExecutableForm::strHeader(OutStream & os) const
+{
+ header( os );
+
+AVM_IF_DEBUG_FLAG_AND( COMPILING , hasAstElement() )
+ os << "&" << getAstFullyQualifiedNameID() << " ";
+AVM_ENDIF_DEBUG_FLAG_AND( COMPILING )
+
+ os << getFullyQualifiedNameID();
+}
+
+
+void ExecutableForm::toStream(OutStream & os,
+ const TableOfRouter & aTableOfRouter, const std::string & sectionName)
+{
+ if( aTableOfRouter.nonempty() )
+ {
+ os << TAB << sectionName << EOL_INCR_INDENT;
+
+ TableOfRouter::const_iterator itRouter = aTableOfRouter.begin();
+ TableOfRouter::const_iterator endRouter = aTableOfRouter.end();
+
+ for( ; itRouter != endRouter ; ++itRouter )
+ {
+ if( (*itRouter).valid() )
+ {
+ (*itRouter).toStream(os);
+ }
+ else
+ {
+ os << TAB << "routeur<null>";
+ }
+
+ os << EOL_FLUSH;
+ }
+
+ if( aTableOfRouter.last().invalid() )
+ {
+ os << EOL;
+ }
+
+ os << DECR_INDENT;
+ }
+}
+
+
+void ExecutableForm::toStream(OutStream & os) const
+{
+ if( os.preferablyFQN() )
+ {
+ os << TAB << getFullyQualifiedNameID();
+
+ AVM_DEBUG_REF_COUNTER(os);
+
+ return;
+ }
+
+ header( os << TAB );
+
+AVM_IF_DEBUG_FLAG_AND( COMPILING , hasAstElement() )
+ os << "&" << getAstFullyQualifiedNameID() << " ";
+AVM_ENDIF_DEBUG_FLAG_AND( COMPILING )
+
+ os << getFullyQualifiedNameID() << " {" << EOL;
+
+//AVM_IF_DEBUG_ENABLED_AND(
+// getSpecifier().isFamilyComponentComposite()
+// && ( (mPossibleStaticInstanciationCount != 1)
+// || (mPossibleDynamicInstanciationCount > 0) ) )
+// os << TAB2 << "//possible_instanciation_count = (static:"
+// << mPossibleStaticInstanciationCount << " , dynamic:"
+// << mPossibleDynamicInstanciationCount << ");" << EOL;
+//AVM_ENDIF_DEBUG_ENABLED
+
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ if( hasContainer() )
+ {
+ os << TAB2 << "//container = "
+ << str_header( getContainer()->as< ExecutableForm >() )
+ << ";" << EOL;
+ }
+
+ if( hasPrototypeInstance() )
+ {
+ os << TAB2 << "//prototype = "
+ << str_header( getPrototypeInstance() )
+ << ";" << EOL;
+ }
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ // MOC Attribute
+ if( isInputEnabledCommunication() )
+ {
+ os << TAB2 << "input_enabled = true;" << EOL << std::flush;
+ }
+
+
+ // Any program data
+ toStreamData(os);
+
+ if( hasAlias() )
+ {
+ ( hasDataAlias() ? os : os << TAB << "alias:" ) << EOL_INCR_INDENT;
+
+ getAlias().toStream(os);
+
+ os << DECR_INDENT;
+ }
+
+
+ if( hasPort() )
+ {
+ if( (mMessageSignalCount == 0) ||
+ (mMessageSignalCount == getPort().size()) )
+ {
+ os << TAB << "port:" << EOL;
+ }
+ else
+ {
+ os << TAB << "port< ms: " << mMessageSignalCount << " >:" << EOL;
+ }
+
+ os << incr_stream( getPort() );
+ }
+
+
+ if( hasBuffer() )
+ {
+ os << TAB << "buffer:" << EOL_INCR_INDENT;
+
+ getBuffer().toStream(os);
+
+ os << DECR_INDENT;
+ }
+
+ if( hasChannel() )
+ {
+ os << TAB << "channel:" << EOL_INCR_INDENT;
+
+ getChannel().toStream(os);
+
+ os << DECR_INDENT;
+ }
+
+ if( hasConnect() )
+ {
+ os << TAB << "connection:" << "/* < " << getFullyQualifiedNameID() << " > */"
+ << EOL_INCR_INDENT;
+
+ getConnect().toStream(os);
+
+ os << DECR_INDENT;
+ }
+
+ if( hasRdvCommunication() )
+ {
+ os << EOL_TAB2 << "rdv_communication = true;" << EOL << EOL;
+ }
+
+ // Table of Router for Instance
+ toStream(os, mTableOfRouter4Instance, "router:");
+
+ // Table of Router for Model
+ toStream(os, mTableOfRouter4Model, "router#model:");
+
+
+ if( hasExecutable() )
+ {
+ os << TAB << "procedure:" << EOL_INCR_INDENT;
+
+ getExecutables().toStream(os);
+
+ os << DECR_INDENT;
+ }
+
+
+ if( hasInstanceModel() )
+ {
+ os << TAB << "model:" << EOL_INCR_INDENT;
+
+ getInstanceModel().toStream(os);
+
+ os << DECR_INDENT;
+ }
+
+ if( hasInstanceStatic() )
+ {
+ os << TAB << "instance:" << EOL_INCR_INDENT;
+
+ getInstanceStatic().toStream(os);
+
+ os << DECR_INDENT;
+ }
+
+ if( hasInstanceDynamic() )
+ {
+ os << TAB << "instance#dynamic:" << EOL_INCR_INDENT;
+
+ getInstanceDynamic().toStream(os);
+
+ os << DECR_INDENT;
+ }
+
+
+ if( hasTransition() )
+ {
+ os << TAB << "transition:" << EOL_INCR_INDENT;
+
+ getTransition().toStream(os);
+
+ os << DECR_INDENT;
+ }
+
+ if( hasProgram() )
+ {
+ os << TAB << "program:" << EOL_INCR_INDENT;
+
+ getProgram().toStream(os);
+
+ os << DECR_INDENT;
+ }
+
+ if( mTableOfAnonymousInnerRoutine.nonempty() )
+ {
+ os << TAB << "routine< anonymous#inner >:" << EOL_INCR_INDENT;
+
+ mTableOfAnonymousInnerRoutine.fqnStream(os);
+
+ os << DECR_INDENT;
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // STATIC ANALYSIS ATTRIBUTE
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+
+AVM_IF_DEBUG_FLAG2( COMPILING , DATA )
+ if( hasTransition() || hasProgram() )
+ {
+ TableOfInstanceOfData::const_raw_iterator itData;
+ TableOfInstanceOfData::const_raw_iterator endData;
+
+ if( getRequiredData().nonempty() )
+ {
+ os << TAB << "data#required:" << EOL;
+ itData = getRequiredData().begin();
+ endData = getRequiredData().end();
+ for( ; itData != endData ; ++itData )
+ {
+ os << TAB2 << itData->getFullyQualifiedNameID() << ";" << EOL;
+ }
+ }
+
+ if( getUselessData().nonempty() )
+ {
+ os << TAB << "data#useless:" << EOL;
+ itData = getUselessData().begin();
+ endData = getUselessData().end();
+ for( ; itData != endData ; ++itData )
+ {
+ os << TAB2 << itData->getFullyQualifiedNameID() << ";" << EOL;
+ }
+ }
+ }
+AVM_ENDIF_DEBUG_FLAG2( COMPILING , DATA )
+
+
+ if( hasVariableDependency() )
+ {
+ os << TAB << "dependency#variable = "
+ << STATIC_ANALYSIS::to_string( getVariableDependent() ) << EOL;
+ }
+
+
+ if( (not isReachableStateFlag)
+ && (not getSpecifier().isPseudostateInitialOrStateStart()) )
+ {
+ os << TAB2 << "reachable#machine = false;" << EOL;
+ }
+
+ if( hasBackwardReachableMachine() )
+ {
+ os << TAB << "reachable#backward#machine:" << EOL;
+
+ ListOfInstanceOfMachine::const_iterator itMachine =
+ getBackwardReachableMachine().begin();
+ ListOfInstanceOfMachine::const_iterator endMachine =
+ getBackwardReachableMachine().end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ os << TAB2 << str_header( *itMachine ) << ";" << EOL;
+ }
+ }
+
+ if( hasBackwardReachableTransition() )
+ {
+ os << TAB << "reachable#backward#transition:" << EOL;
+
+ OutStream osHierarchy( os );
+ osHierarchy.INDENT.CHAR = " ";
+
+ ListOfAvmTransition::const_iterator itProg =
+ getBackwardReachableTransition().begin();
+ ListOfAvmTransition::const_iterator endProg =
+ getBackwardReachableTransition().end();
+ for( ; itProg != endProg ; ++itProg )
+ {
+ os << TAB2 << str_header( *itProg ) << ";" << EOL;
+ }
+ }
+
+
+ if( hasForwardReachableMachine() )
+ {
+ os << TAB << "reachable#forward#machine:" << EOL;
+
+ OutStream osHierarchy( os );
+ osHierarchy.INDENT.CHAR = " ";
+
+ ListOfInstanceOfMachine::const_iterator itMachine =
+ getForwardReachableMachine().begin();
+ ListOfInstanceOfMachine::const_iterator endMachine =
+ getForwardReachableMachine().end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ os << TAB2 << str_header( *itMachine ) << ";" << EOL;
+ }
+ }
+
+ if( hasForwardReachableTransition() )
+ {
+ os << TAB << "reachable#forward#transition:" << EOL;
+
+ OutStream osHierarchy( os );
+ osHierarchy.INDENT.CHAR = " ";
+
+ ListOfAvmTransition::const_iterator itProg =
+ getForwardReachableTransition().begin();
+ ListOfAvmTransition::const_iterator endProg =
+ getForwardReachableTransition().end();
+ for( ; itProg != endProg ; ++itProg )
+ {
+ os << TAB2 << str_header( *itProg ) << ";" << EOL;
+ }
+ }
+
+
+ os << TAB << "moe:" << EOL;
+
+ if( hasOnCreate() )
+ {
+ os << TAB2 << "@create{" << INCR2_INDENT;
+ getOnCreate()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+ if( hasOnInit() )
+ {
+ os << TAB2 << "@init{" << INCR2_INDENT;
+ getOnInit()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+ if( hasOnReturn() )
+ {
+ os << TAB2 << "@return{" << INCR2_INDENT;
+ getOnReturn()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+ if( hasOnFinal() )
+ {
+ os << TAB2 << "@final{" << INCR2_INDENT;
+ getOnFinal()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+
+ if( hasOnStart() )
+ {
+ os << TAB2 << "@start{" << INCR2_INDENT;
+ getOnStart()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+ if( hasOnStop() )
+ {
+ os << TAB2 << "@stop{" << INCR2_INDENT;
+ getOnStop()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+
+ if( hasOnIEnable() )
+ {
+ os << TAB2 << "@ienable{" << INCR2_INDENT;
+ getOnIEnable()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+ if( hasOnEnable() )
+ {
+ os << TAB2 << "@enable{" << INCR2_INDENT;
+ getOnEnable()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+
+ if( hasOnIDisable() )
+ {
+ os << TAB2 << "@idisable{" << INCR2_INDENT;
+ getOnIDisable()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+ if( hasOnDisable() )
+ {
+ os << TAB2 << "@disable{" << INCR2_INDENT;
+ getOnDisable()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+
+ if( hasOnIAbort() )
+ {
+ os << TAB2 << "@iabort{" << INCR2_INDENT;
+ getOnIAbort()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+ if( hasOnAbort() )
+ {
+ os << TAB2 << "@abort{" << INCR2_INDENT;
+ getOnAbort()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+
+ if( hasOnIRun() )
+ {
+ os << TAB2 << "@irun{" << INCR2_INDENT;
+ getOnIRun()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+ if( hasOnRun() )
+ {
+ os << TAB2 << "@run{" << INCR2_INDENT;
+ getOnRun()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+
+ if( hasOnRtc() )
+ {
+ os << TAB2 << "@rtc{" << INCR2_INDENT;
+ getOnRtc()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+
+ if( hasOnSchedule() )
+ {
+ os << TAB2 << "@schedule" << (isMutableSchedule() ? "" : "<final>")
+ << "{" << INCR2_INDENT;
+ getOnSchedule()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+ else if( isMutableSchedule() )
+ {
+ os << TAB2 << "@schedule#mutable{ }" << EOL;
+ }
+
+
+ if( hasOnConcurrency() )
+ {
+ os << TAB2 << "@concurrency{";
+ if( getOnConcurrency()->empty() )
+ {
+ os << " " << getOnConcurrencyOperator()->strOp() << " ";
+ }
+ else
+ {
+ getOnConcurrency()->toStreamRoutine( os << INCR2_INDENT )
+ << DECR2_INDENT_TAB2;
+ }
+ os << "}" << EOL;
+ }
+
+
+ if( hasOnSynchronize() )
+ {
+ os << TAB2 << "@synchronize{" << INCR2_INDENT;
+ getOnSynchronize()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+
+ // static class of Port/Message/Signal in communicated transition
+ os << INCR_INDENT;
+ toStreamStaticCom(os);
+ os << DECR_INDENT;
+
+ os << TAB << "}" << EOL << std::flush;
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/executable/ExecutableForm.h b/org.eclipse.efm.symbex/src/fml/executable/ExecutableForm.h
new file mode 100644
index 0000000..e6fe1fd
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/ExecutableForm.h
@@ -0,0 +1,2466 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef EXECUTABLEFORM_H_
+#define EXECUTABLEFORM_H_
+
+#include <fml/executable/AvmProgram.h>
+#include <fml/common/SpecifierElement.h>
+
+#include <base/SmartTable.h>
+
+#include <collection/Typedef.h>
+#include <collection/Vector.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/executable/AvmTransition.h>
+#include <fml/executable/BaseInstanceForm.h>
+#include <fml/executable/InstanceOfBuffer.h>
+#include <fml/executable/InstanceOfConnect.h>
+#include <fml/executable/InstanceOfData.h>
+#include <fml/executable/InstanceOfMachine.h>
+#include <fml/executable/InstanceOfPort.h>
+#include <fml/executable/Router.h>
+
+#include <fml/symbol/Symbol.h>
+#include <fml/symbol/TableOfSymbol.h>
+
+#include <fml/infrastructure/InstanceSpecifierPart.h>
+#include <fml/infrastructure/Machine.h>
+#include <fml/infrastructure/System.h>
+
+
+namespace sep
+{
+
+class AvmCode;
+class ExecutableSystem;
+class ObjectElement;
+class Specifier;
+
+
+// TYPE DEFINITION for TABLE , SMART POINTER and CONTAINER
+typedef TableOfBF_T< ExecutableForm > TableOfExecutableForm;
+
+typedef SmartTable< InstanceOfBuffer , DestroyElementPolicy > TableOfBuffer;
+typedef SmartTable< InstanceOfConnect , DestroyElementPolicy > TableOfConnectT;
+typedef SmartTable< InstanceOfData , DestroyElementPolicy > TableOfVariableT;
+typedef SmartTable< InstanceOfMachine , DestroyElementPolicy > TableOfMachineT;
+typedef SmartTable< InstanceOfPort , DestroyElementPolicy > TableOfPortT;
+
+
+class ExecutableForm :
+ public AvmProgram ,
+ public SpecifierImpl,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ExecutableForm )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( ExecutableForm )
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ ExecutableSystem & mExecutableSystem;
+
+ avm_size_t mInitialInstanceCount;
+ avm_size_t mMaximalInstanceCount;
+
+ avm_size_t mPossibleStaticInstanciationCount;
+ avm_size_t mPossibleDynamicInstanciationCount;
+
+ TableOfSymbol mTableOfChannel;
+
+ TableOfSymbol mTableOfPort;
+ avm_size_t mMessageSignalCount;
+
+ TableOfSymbol mTableOfBuffer;
+ TableOfSymbol mTableOfConnect;
+
+ TableOfSymbol mTableOfInstanceModel;
+
+ TableOfSymbol mTableOfInstanceStatic;
+ InstanceOfMachine * mPrototypeInstance;
+
+ TableOfSymbol mTableOfInstanceDynamic;
+
+ TableOfTransition mTableOfTransition;
+
+ TableOfAvmProgram mTableOfProgram;
+
+ TableOfAvmProgram mTableOfAnonymousInnerRoutine;
+
+ TableOfExecutableForm mTableOfExecutable;
+
+ TableOfSymbol mTableOfAlias;
+
+
+ // Predefined routines
+ AvmProgram onCreateRoutine;
+ AvmProgram onInitRoutine;
+ AvmProgram onFinalRoutine;
+
+ AvmProgram onReturnRoutine;
+
+ AvmProgram onStartRoutine;
+ AvmProgram onStopRoutine;
+
+ AvmProgram onIEnableRoutine;
+ AvmProgram onEnableRoutine;
+
+ AvmProgram onIDisableRoutine;
+ AvmProgram onDisableRoutine;
+
+ AvmProgram onIAbortRoutine;
+ AvmProgram onAbortRoutine;
+
+ AvmProgram onIRunRoutine;
+ AvmProgram onRunRoutine;
+ AvmProgram onRtcRoutine;
+
+ AvmProgram onScheduleRoutine;
+ AvmProgram onConcurrencyRoutine;
+
+ AvmProgram onSynchronizeRoutine;
+
+
+ // Structural decompositon
+ bool mMainComponentFlag;
+
+ // MOC Attribute for mutable Schedule
+ bool mMutableScheduleFlag;
+
+
+ // Communication routing
+ TableOfRouter mTableOfRouter4Instance;
+
+ TableOfRouter mTableOfRouter4Model;
+
+ bool mRdvCommunicationFlag;
+
+ // MOC Attribute for Communication
+ bool mInputEnabledCommunicationFlag;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Static Analysis Information
+ ////////////////////////////////////////////////////////////////////////////
+
+ TableOfInstanceOfData mRequiredData;
+ TableOfInstanceOfData mUselessData;
+
+
+ // The list of backward reachable machine
+ ListOfInstanceOfMachine mBackwardReachableMachine;
+
+ // The list of backward reachable transition
+ ListOfAvmTransition mBackwardReachableTransition;
+
+
+ // The list of forward reachable machine
+ ListOfInstanceOfMachine mForwardReachableMachine;
+
+ // The list of forward reachable transition
+ ListOfAvmTransition mForwardReachableTransition;
+
+ // Default is << true >>
+ bool isReachableStateFlag;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ExecutableForm(ExecutableSystem & aExecutableSystem,
+ ExecutableForm * aContainer,
+ Machine * astMachine, avm_size_t aDataSize = 0)
+ : AvmProgram(CLASS_KIND_T( ExecutableForm ),
+ Specifier::SCOPE_MACHINE_KIND, aContainer, astMachine, aDataSize),
+ SpecifierImpl( astMachine ),
+
+ mExecutableSystem( aExecutableSystem ),
+
+ mInitialInstanceCount(
+ ((astMachine != NULL) && astMachine->hasInstanceSpecifier()) ?
+ astMachine->getInstanceSpecifier()->getInitialInstanceCount() : 1 ),
+ mMaximalInstanceCount(
+ ((astMachine != NULL) && astMachine->hasInstanceSpecifier()) ?
+ astMachine->getInstanceSpecifier()->getMaximalInstanceCount() : 1 ),
+
+ mPossibleStaticInstanciationCount( 0 ),
+ mPossibleDynamicInstanciationCount( 0 ),
+
+ mTableOfChannel( ),
+
+ mTableOfPort( ),
+ mMessageSignalCount( 0 ),
+
+ mTableOfBuffer( ),
+ mTableOfConnect( ),
+
+ mTableOfInstanceModel( ),
+
+ mTableOfInstanceStatic( ),
+ mPrototypeInstance( ),
+
+ mTableOfInstanceDynamic( ),
+
+ mTableOfTransition( ),
+ mTableOfProgram( ),
+ mTableOfAnonymousInnerRoutine( ),
+
+ mTableOfExecutable( ),
+
+ mTableOfAlias( ),
+
+ onCreateRoutine( Specifier::SCOPE_ROUTINE_KIND , this , "create" , 0 ),
+
+ onInitRoutine ( Specifier::SCOPE_ROUTINE_KIND , this , "init" , 0 ),
+ onFinalRoutine( Specifier::SCOPE_ROUTINE_KIND , this , "final" , 0 ),
+
+ onReturnRoutine( Specifier::SCOPE_ROUTINE_KIND , this , "return" , 0 ),
+
+ onStartRoutine( Specifier::SCOPE_ROUTINE_KIND , this , "start" , 0 ),
+ onStopRoutine ( Specifier::SCOPE_ROUTINE_KIND , this , "stop" , 0 ),
+
+ onIEnableRoutine( Specifier::SCOPE_ROUTINE_KIND , this , "ienable" , 0 ),
+ onEnableRoutine ( Specifier::SCOPE_ROUTINE_KIND , this , "enable" , 0 ),
+
+ onIDisableRoutine( Specifier::SCOPE_ROUTINE_KIND , this , "idisable" , 0 ),
+ onDisableRoutine ( Specifier::SCOPE_ROUTINE_KIND , this , "disable" , 0 ),
+
+ onIAbortRoutine( Specifier::SCOPE_ROUTINE_KIND , this , "iabort" , 0 ),
+ onAbortRoutine ( Specifier::SCOPE_ROUTINE_KIND , this , "abort" , 0 ),
+
+ onIRunRoutine( Specifier::SCOPE_ROUTINE_KIND , this , "irun" , 0 ),
+ onRunRoutine ( Specifier::SCOPE_ROUTINE_KIND , this , "run" , 0 ),
+ onRtcRoutine ( Specifier::SCOPE_ROUTINE_KIND , this , "rtc" , 0 ),
+
+ onScheduleRoutine ( Specifier::SCOPE_ROUTINE_KIND , this , "schedule" , 0 ),
+ onConcurrencyRoutine( Specifier::SCOPE_ROUTINE_KIND , this , "concurrency" , 0 ),
+
+ onSynchronizeRoutine( Specifier::SCOPE_ROUTINE_KIND , this , "synchronize" , 0 ),
+
+ mMainComponentFlag( ( (astMachine == NULL) ||
+ astMachine->getModifier().hasFeatureTransient() ) ? false : true ),
+
+ mMutableScheduleFlag( false ),
+
+ mTableOfRouter4Instance( ),
+
+ mTableOfRouter4Model( ),
+
+ mRdvCommunicationFlag( false ),
+
+ mInputEnabledCommunicationFlag( false ),
+
+ mRequiredData( ),
+ mUselessData( ),
+
+ mBackwardReachableMachine( ),
+ mBackwardReachableTransition( ),
+
+ mForwardReachableMachine( ),
+ mForwardReachableTransition( ),
+
+ isReachableStateFlag( true )
+ {
+ updateFullyQualifiedNameID();
+ }
+
+ ExecutableForm(ExecutableSystem & aExecutableSystem, avm_size_t aDataSize)
+ : AvmProgram(CLASS_KIND_T( ExecutableForm ),
+ Specifier::SCOPE_MACHINE_KIND, NULL, NULL, aDataSize),
+ SpecifierImpl( Specifier::COMPONENT_EXECUTABLE_SPECIFIER ),
+
+ mExecutableSystem( aExecutableSystem ),
+
+ mInitialInstanceCount( 1 ),
+ mMaximalInstanceCount( 1 ),
+
+ mPossibleStaticInstanciationCount( 0 ),
+ mPossibleDynamicInstanciationCount( 0 ),
+
+ mTableOfChannel( ),
+
+ mTableOfPort( ),
+ mMessageSignalCount( 0 ),
+
+ mTableOfBuffer( ),
+ mTableOfConnect( ),
+
+ mTableOfInstanceModel( ),
+
+ mTableOfInstanceStatic( ),
+ mPrototypeInstance( ),
+
+ mTableOfInstanceDynamic( ),
+
+ mTableOfTransition( ),
+ mTableOfProgram( ),
+ mTableOfAnonymousInnerRoutine( ),
+
+ mTableOfExecutable( ),
+
+ mTableOfAlias( ),
+
+ onCreateRoutine( Specifier::SCOPE_ROUTINE_KIND , this , "create" , 0 ),
+
+ onInitRoutine ( Specifier::SCOPE_ROUTINE_KIND , this , "init" , 0 ),
+ onFinalRoutine( Specifier::SCOPE_ROUTINE_KIND , this , "final" , 0 ),
+
+ onReturnRoutine( Specifier::SCOPE_ROUTINE_KIND , this , "return" , 0 ),
+
+ onStartRoutine( Specifier::SCOPE_ROUTINE_KIND , this , "start" , 0 ),
+ onStopRoutine ( Specifier::SCOPE_ROUTINE_KIND , this , "stop" , 0 ),
+
+ onIEnableRoutine( Specifier::SCOPE_ROUTINE_KIND , this , "ienable" , 0 ),
+ onEnableRoutine ( Specifier::SCOPE_ROUTINE_KIND , this , "enable" , 0 ),
+
+ onIDisableRoutine( Specifier::SCOPE_ROUTINE_KIND , this , "idisable" , 0 ),
+ onDisableRoutine ( Specifier::SCOPE_ROUTINE_KIND , this , "disable" , 0 ),
+
+ onIAbortRoutine( Specifier::SCOPE_ROUTINE_KIND , this , "iabort" , 0 ),
+ onAbortRoutine ( Specifier::SCOPE_ROUTINE_KIND , this , "abort" , 0 ),
+
+ onIRunRoutine( Specifier::SCOPE_ROUTINE_KIND , this , "irun" , 0 ),
+ onRunRoutine ( Specifier::SCOPE_ROUTINE_KIND , this , "run" , 0 ),
+ onRtcRoutine ( Specifier::SCOPE_ROUTINE_KIND , this , "rtc" , 0 ),
+
+ onScheduleRoutine ( Specifier::SCOPE_ROUTINE_KIND , this , "schedule" , 0 ),
+ onConcurrencyRoutine( Specifier::SCOPE_ROUTINE_KIND , this , "concurrency" , 0 ),
+
+ onSynchronizeRoutine( Specifier::SCOPE_ROUTINE_KIND , this , "synchronize" , 0 ),
+
+ mMainComponentFlag( false ),
+
+ mMutableScheduleFlag( false ),
+
+ mTableOfRouter4Instance( ),
+
+ mTableOfRouter4Model( ),
+
+ mRdvCommunicationFlag( false ),
+
+ mInputEnabledCommunicationFlag( false ),
+
+ mRequiredData( ),
+ mUselessData( ),
+
+ mBackwardReachableMachine( ),
+ mBackwardReachableTransition( ),
+
+ mForwardReachableMachine( ),
+ mForwardReachableTransition( ),
+
+ isReachableStateFlag( true )
+ {
+ updateFullyQualifiedNameID();
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ExecutableForm()
+ {
+ mRequiredData.clear();
+ mUselessData.clear();
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * is in SCOPE
+ */
+ inline bool isAncestorOf(const ExecutableForm * anExecutable)
+ {
+ while( (anExecutable != NULL) && (anExecutable != this) )
+ {
+ anExecutable = anExecutable->getExecutableContainer();
+ }
+ return( anExecutable == this );
+ }
+
+
+ /**
+ * SETTER
+ * mFullyQualifiedNameID
+ */
+ virtual void updateFullyQualifiedNameID(
+ const std::string & aFullyQualifiedNameID);
+
+ inline virtual void updateFullyQualifiedNameID()
+ {
+ if( hasAstElement() )
+ {
+ updateFullyQualifiedNameID( getAstFullyQualifiedNameID() );
+ }
+ else
+ {
+ setAllNameID( "exec#anonym" , "exec#anonym" );
+ }
+ }
+
+
+ /**
+ * LCA -LCRA
+ */
+ const ExecutableForm * LCA(
+ const ExecutableForm * anExecutable) const;
+
+ inline const ExecutableForm * LCRA(
+ const ExecutableForm * anExecutable) const
+ {
+ return( (this == anExecutable) ? this : LCA( anExecutable ) );
+ }
+
+
+ /**
+ * GETTER
+ * Compiled ObjectElement as Compiled Machine
+ */
+ inline const Machine * getAstMachine() const
+ {
+ return( getAstElement()->as< Machine >() );
+ }
+
+ inline bool isAstMachine() const
+ {
+ return( hasAstElement() && getAstElement()->is< Machine >() );
+ }
+
+
+ inline const System * getAstSystem() const
+ {
+ return( getAstElement()->as< System >() );
+ }
+
+ inline bool isCompiledSystem() const
+ {
+ return( hasAstElement() && getAstElement()->is< System >() );
+ }
+
+
+
+ /**
+ * Primitive inlining
+ */
+ bool isInlinableEnable() const
+ {
+ return( hasAstElement() && getAstElement()->is< Machine >() &&
+ getAstMachine()->isInlinableEnable() );
+ }
+
+ bool isInlinableProcedure() const
+ {
+ return( hasAstElement() && getAstElement()->is< Machine >() &&
+ getAstMachine()->isInlinableProcedure() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mInitialInstanceCount
+ */
+ inline avm_size_t getInitialInstanceCount() const
+ {
+ return( mInitialInstanceCount );
+ }
+
+ inline bool hasInitialInstance() const
+ {
+ return( mInitialInstanceCount > 0 );
+ }
+
+ inline void setInitialInstanceCount(avm_size_t anInitialInstanceCount)
+ {
+ mInitialInstanceCount = anInitialInstanceCount;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mMaximalInstanceCount
+ */
+ inline avm_size_t getMaximalInstanceCount() const
+ {
+ return( mMaximalInstanceCount );
+ }
+
+ inline bool hasMaximalInstance() const
+ {
+ return( mMaximalInstanceCount != AVM_NUMERIC_MAX_SIZE_T );
+ }
+
+ inline bool hasMaximalNewInstance() const
+ {
+ return( (mMaximalInstanceCount > mInitialInstanceCount) &&
+ (mMaximalInstanceCount != AVM_NUMERIC_MAX_SIZE_T) );
+ }
+
+ inline void setMaximalInstanceCount(avm_size_t aMaximalInstanceCount)
+ {
+ mMaximalInstanceCount = aMaximalInstanceCount;
+ }
+
+
+ /**
+ * SETTER
+ * mInitialInstanceCount
+ * mMaximalInstanceCount
+ */
+ inline void setInstanceCount(avm_size_t anInitialInstanceCount,
+ avm_size_t aMaximalInstanceCount)
+ {
+ mInitialInstanceCount = anInitialInstanceCount;
+
+ mMaximalInstanceCount = aMaximalInstanceCount;
+ }
+
+ inline avm_size_t getCreatedInstanceCount() const
+ {
+ return( mInitialInstanceCount );
+
+// return( (mMaximalInstanceCount != AVM_NUMERIC_MAX_SIZE_T) ?
+// mMaximalInstanceCount : mInitialInstanceCount );
+ }
+
+
+ /*
+ * GETTER - SETTER
+ * mPossibleStaticInstanciationCount
+ * mPossibleDynamicInstanciationCount
+ * Single or Multiple
+ * Instanciation Information
+ * for Data Access optimisation
+ */
+ inline avm_size_t getPossibleStaticInstanciationCount() const
+ {
+ return( mPossibleStaticInstanciationCount );
+ }
+
+ inline bool hasPossibleStaticInstanciation() const
+ {
+ return( mPossibleStaticInstanciationCount > 0 );
+ }
+
+ void incrPossibleStaticInstanciationCount(avm_offset_t offset = 1);
+
+
+ inline avm_size_t getPossibleDynamicInstanciationCount() const
+ {
+ return( mPossibleDynamicInstanciationCount );
+ }
+
+ inline bool hasPossibleDynamicInstanciation() const
+ {
+ return( mPossibleDynamicInstanciationCount > 0 );
+ }
+
+ void incrPossibleDynamicInstanciationCount(avm_size_t offset = 1);
+
+
+ bool hasSingleRuntimeInstance();
+
+
+ /**
+ * GETTER - SETTER
+ * mTableOfChannel
+ */
+ inline const Symbol & saveChannel(InstanceOfPort * anInstance)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( anInstance )
+ << "InstanceOfPort !!!"
+ << SEND_EXIT;
+
+ anInstance->setContainer(this);
+
+ return( mTableOfChannel.save(anInstance) );
+ }
+
+ inline TableOfSymbol & getChannel()
+ {
+ return( mTableOfChannel );
+ }
+
+ inline const TableOfSymbol & getChannel() const
+ {
+ return( mTableOfChannel );
+ }
+
+ inline bool hasChannel() const
+ {
+ return( mTableOfChannel.nonempty() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mTableOfPort
+ */
+ inline const Symbol & savePort(InstanceOfPort * anInstance)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( anInstance )
+ << "InstanceOfPort !!!"
+ << SEND_EXIT;
+
+ anInstance->setContainer(this);
+
+ return( mTableOfPort.save(anInstance) );
+ }
+
+ inline TableOfSymbol & getPort()
+ {
+ return( mTableOfPort );
+ }
+
+ inline const TableOfSymbol & getPort() const
+ {
+ return( mTableOfPort );
+ }
+
+
+ inline bool hasPort() const
+ {
+ return( mTableOfPort.nonempty() );
+ }
+
+ /**
+ * GETTER - SETTER
+ * mMessageSignalCount
+ */
+ inline avm_size_t getMessageSignalCount() const
+ {
+ return( mMessageSignalCount );
+ }
+
+ inline bool hasMessageSignalCount() const
+ {
+ return( mMessageSignalCount > 0 );
+ }
+
+ inline void setMessageSignalCount(avm_size_t count)
+ {
+ mMessageSignalCount = count;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mTableOfBuffer
+ */
+
+ inline const Symbol & saveBuffer(InstanceOfBuffer * anInstance)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( anInstance )
+ << "BaseInstanceForm !!!"
+ << SEND_EXIT;
+
+ anInstance->setContainer(this);
+
+ return( mTableOfBuffer.save(anInstance) );
+ }
+
+ inline TableOfSymbol & getBuffer()
+ {
+ return( mTableOfBuffer );
+ }
+
+ inline const TableOfSymbol & getBuffer() const
+ {
+ return( mTableOfBuffer );
+ }
+
+
+ inline bool hasBuffer() const
+ {
+ return( mTableOfBuffer.nonempty() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mTableOfConnect
+ */
+
+ inline const Symbol & saveConnect(InstanceOfConnect * anInstance)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( anInstance )
+ << "BaseInstanceForm !!!"
+ << SEND_EXIT;
+
+ anInstance->setContainer(this);
+
+ return( mTableOfConnect.save(anInstance) );
+ }
+
+ inline TableOfSymbol & getConnect()
+ {
+ return( mTableOfConnect );
+ }
+
+ inline const TableOfSymbol & getConnect() const
+ {
+ return( mTableOfConnect );
+ }
+
+
+ inline bool hasConnect() const
+ {
+ return( mTableOfConnect.nonempty() );
+ }
+
+
+ /**
+ * GETTER
+ * Communicated or Lifeline
+ */
+ inline bool isCommunicator() const
+ {
+ return( hasPort() || hasRouter4This() || hasConnect() );
+ }
+
+ inline bool isCommunicatorWith(InstanceOfPort * aPort) const
+ {
+ return( mTableOfPort.contains(aPort)
+ || (hasRouter4This() && getRouter4This().hasRouting(aPort)) );
+ }
+
+ inline bool isLifeline() const
+ {
+ return( getSpecifier().hasFeatureLifeline() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mDefault instance for using machine model
+ */
+ inline const Symbol & saveInstanceModel(InstanceOfMachine * anInstance)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( anInstance )
+ << "InstanceOfMachine !!!"
+ << SEND_EXIT;
+
+ anInstance->setContainer(this);
+
+ return( mTableOfInstanceModel.save( anInstance ) );
+ }
+
+ inline void appendInstanceModel(Symbol & aMachine)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( aMachine )
+ << "InstanceOfMachine !!!"
+ << SEND_EXIT;
+
+ aMachine.setContainer(this);
+
+ mTableOfInstanceModel.append( aMachine );
+ }
+
+
+ inline TableOfSymbol & getInstanceModel()
+ {
+ return( mTableOfInstanceModel );
+ }
+
+ inline const TableOfSymbol & getInstanceModel() const
+ {
+ return( mTableOfInstanceModel );
+ }
+
+ inline const Symbol & getByAstInstanceModel(
+ const ObjectElement * astElement) const
+ {
+ const Symbol & aModel =
+ mTableOfInstanceModel.getByAstElement(astElement);
+
+ // To ignore the THIS instance at offset 0 !!!
+ return( ( aModel.invalid() || aModel.isnotThis(this) ) ?
+ aModel : Symbol::REF_NULL );
+ }
+
+ inline bool hasInstanceModel() const
+ {
+ return( mTableOfInstanceModel.nonempty() );
+ }
+
+ inline bool hasInstanceModelThis() const
+ {
+ return( mTableOfInstanceModel.nonempty() &&
+ mTableOfInstanceModel.first().isThis() );
+ }
+
+
+ inline const Symbol & firstInstanceModel() const
+ {
+ return( hasInstanceModelThis() ?
+ mTableOfInstanceModel.second() :
+ mTableOfInstanceModel.first() );
+ }
+
+ inline bool hasOneInstanceModel() const
+ {
+ return( hasInstanceStaticThis()
+ && (mTableOfInstanceModel.size() == 2) );
+ }
+
+ inline avm_size_t sizeInstanceModel() const
+ {
+ // don't forget the instance THIS at offset 0 !!!
+ return( mTableOfInstanceModel.size()
+ - (hasInstanceStaticThis() ? 1 : 0) );
+ }
+
+
+
+ /**
+ * GETTER
+ * begin -- end
+ * iterator
+ */
+ inline TableOfSymbol::const_iterator instance_model_begin() const
+ {
+ // don't forget the instance THIS at offset 0 !!!
+ return( hasInstanceStaticThis() ?
+ ++(mTableOfInstanceModel.begin()) :
+ mTableOfInstanceModel.begin() );
+ }
+
+ inline TableOfSymbol::const_iterator instance_model_end() const
+ {
+ return( mTableOfInstanceModel.end() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mTableOfInstanceStatic
+ */
+ inline const Symbol & saveInstanceStatic(InstanceOfMachine * anInstance)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( anInstance )
+ << "InstanceOfMachine !!!"
+ << SEND_EXIT;
+
+ anInstance->setContainer(this);
+
+ return( mTableOfInstanceStatic.save(anInstance) );
+ }
+
+ inline TableOfSymbol & getInstanceStatic()
+ {
+ return( mTableOfInstanceStatic );
+ }
+
+ inline const TableOfSymbol & getInstanceStatic() const
+ {
+ return( mTableOfInstanceStatic );
+ }
+
+
+ inline const Symbol & getByAstInstanceStatic(
+ const ObjectElement * astElement) const
+ {
+ const Symbol & anInstance =
+ mTableOfInstanceStatic.getByAstElement(astElement);
+
+ // To ignore the THIS instance at offset 0 !!!
+ return( ( anInstance.invalid() || anInstance.isnotThis(this) ) ?
+ anInstance : Symbol::REF_NULL );
+ }
+
+
+ inline bool hasInstanceStatic() const
+ {
+ return( mTableOfInstanceStatic.nonempty() );
+ }
+
+ inline bool hasInstanceStaticThis() const
+ {
+ return( mTableOfInstanceStatic.nonempty() &&
+ mTableOfInstanceStatic.first().isThis() );
+ }
+
+ inline const Symbol & getInstanceStaticThis() const
+ {
+ return( mTableOfInstanceStatic.first() );
+ }
+
+ inline const Symbol & firstInstanceStatic() const
+ {
+ return( hasInstanceStaticThis() ?
+ mTableOfInstanceStatic.second() :
+ mTableOfInstanceStatic.first() );
+ }
+
+
+ inline bool hasOneInstanceStatic() const
+ {
+ return( hasInstanceStaticThis()
+ && (mTableOfInstanceStatic.size() == 2) );
+ }
+
+ inline avm_size_t sizeInstanceStatic() const
+ {
+ // don't forget the instance THIS at offset 0 !!!
+ return( mTableOfInstanceStatic.size()
+ - (hasInstanceStaticThis() ? 1 : 0) );
+ }
+
+
+ /**
+ * GETTER
+ * begin -- end
+ * iterator
+ */
+ inline TableOfSymbol::const_iterator instance_static_begin() const
+ {
+ // don't forget the instance THIS at offset 0 !!!
+ return( hasInstanceStaticThis() ?
+ ++(mTableOfInstanceStatic.begin()) :
+ mTableOfInstanceStatic.begin() );
+ }
+
+
+ inline TableOfSymbol::const_iterator instance_static_end() const
+ {
+ return( mTableOfInstanceStatic.end() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * Machine Count
+ */
+ avm_size_t getrecMachineCount() const;
+
+
+ /**
+ * GETTER
+ * mPrototypeInstance
+ */
+ inline InstanceOfMachine * getPrototypeInstance() const
+ {
+ return( mPrototypeInstance );
+ }
+
+ inline bool hasPrototypeInstance() const
+ {
+ return( mPrototypeInstance != NULL );
+ }
+
+ inline void setPrototypeInstance(InstanceOfMachine * anInstance)
+ {
+ mPrototypeInstance = anInstance;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mTableOfInstanceStatic
+ * mTableOfInstanceModel
+ * mTableOfInstanceDynamic
+ */
+ inline TableOfSymbol & getInstanceByDesign(Specifier::DESIGN_KIND aDesign)
+ {
+ switch( aDesign )
+ {
+ case Specifier::DESIGN_INSTANCE_KIND:
+ return( mTableOfInstanceStatic );
+
+ case Specifier::DESIGN_MODEL_KIND:
+ return( mTableOfInstanceModel );
+
+ case Specifier::DESIGN_DYNAMIC_KIND:
+ return( mTableOfInstanceDynamic );
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected instance design << "
+ << Specifier::strDesign(aDesign, "") << " >> !!!"
+ << SEND_EXIT;
+
+ return( mTableOfInstanceStatic );
+ }
+ }
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mDefault instance for using machine model
+ */
+ inline const Symbol & saveInstanceDynamic(InstanceOfMachine * anInstance)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( anInstance )
+ << "InstanceOfMachine !!!"
+ << SEND_EXIT;
+
+ anInstance->setContainer(this);
+
+ return( mTableOfInstanceDynamic.save( anInstance ) );
+ }
+
+ inline void appendInstanceDynamic(Symbol & aMachine)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( aMachine )
+ << "InstanceOfMachine !!!"
+ << SEND_EXIT;
+
+ aMachine.setContainer(this);
+
+ mTableOfInstanceDynamic.append( aMachine );
+ }
+
+
+ inline TableOfSymbol & getInstanceDynamic()
+ {
+ return( mTableOfInstanceDynamic );
+ }
+
+ inline const TableOfSymbol & getInstanceDynamic() const
+ {
+ return( mTableOfInstanceDynamic );
+ }
+
+ inline const Symbol & getByAstInstanceDynamic(
+ const ObjectElement * astElement) const
+ {
+ return( mTableOfInstanceDynamic.getByAstElement(astElement) );
+ }
+
+ inline bool hasInstanceDynamic() const
+ {
+ return( mTableOfInstanceDynamic.nonempty() );
+ }
+
+
+ /**
+ * GETTER
+ * begin -- end
+ * iterator
+ */
+ inline TableOfSymbol::const_iterator instance_dynamic_begin() const
+ {
+ // don't forget the instance THIS at offset 0 !!!
+ return( mTableOfInstanceDynamic.begin() );
+ }
+
+ inline TableOfSymbol::const_iterator instance_dynamic_end() const
+ {
+ return( mTableOfInstanceDynamic.end() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mTableOfTransition
+ */
+ inline const BF & saveTransition(AvmTransition * aTransition)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( aTransition )
+ << "AvmTransition !!!"
+ << SEND_EXIT;
+
+ aTransition->setContainer(this);
+ aTransition->setOffset( mTableOfTransition.size() );
+
+ return( mTableOfTransition.save(aTransition) );
+ }
+
+ inline TableOfTransition & getTransition()
+ {
+ return( mTableOfTransition );
+ }
+
+ inline const TableOfTransition & getTransition() const
+ {
+ return( mTableOfTransition );
+ }
+
+ inline AvmTransition * rawTransition(avm_offset_t offset) const
+ {
+ return( mTableOfTransition.rawAt(offset) );
+ }
+
+
+ inline const BF & getTransition(
+ const std::string & aFullyQualifiedNameID) const
+ {
+ return( mTableOfTransition.getByFQNameID( aFullyQualifiedNameID ) );
+ }
+
+ inline const BF & getTransitionByNameID(const std::string & aNameID) const
+ {
+ return( mTableOfTransition.getByNameID( aNameID ) );
+ }
+
+ inline const BF & getTransitionByQualifiedNameID(
+ const std::string & aQualifiedNameID) const
+ {
+ return( mTableOfTransition.getByQualifiedNameID( aQualifiedNameID ) );
+ }
+
+
+ inline const BF & getTransitionByAstElement(
+ const ObjectElement * astElement) const
+ {
+ return( mTableOfTransition.getByAstElement(astElement) );
+ }
+
+
+ inline bool hasTransition() const
+ {
+ return( mTableOfTransition.nonempty() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mTableOfProgram
+ */
+ inline void appendProgram(const BF & anAvmProgram)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( anAvmProgram )
+ << "AvmProgram !!!"
+ << SEND_EXIT;
+
+ anAvmProgram.to_ptr< AvmProgram >()->setContainer(this);
+ anAvmProgram.to_ptr< AvmProgram >()->setOffset( mTableOfProgram.size() );
+
+ mTableOfProgram.append(anAvmProgram);
+ }
+
+ inline const BF & saveProgram(AvmProgram * anAvmProgram)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( anAvmProgram )
+ << "AvmProgram !!!"
+ << SEND_EXIT;
+
+ anAvmProgram->setContainer(this);
+ anAvmProgram->setOffset( mTableOfProgram.size() );
+
+ return( mTableOfProgram.save(anAvmProgram) );
+ }
+
+ inline TableOfAvmProgram & getProgram()
+ {
+ return( mTableOfProgram );
+ }
+
+ inline const TableOfAvmProgram & getProgram() const
+ {
+ return( mTableOfProgram );
+ }
+
+ inline AvmProgram * rawProgram(avm_offset_t offset) const
+ {
+ return( mTableOfProgram.rawAt(offset) );
+ }
+
+
+ inline const BF & getProgram(const std::string & aFullyQualifiedNameID,
+ Specifier::SCOPE_KIND aScope =
+ Specifier::SCOPE_UNDEFINED_KIND) const
+ {
+ return( mTableOfProgram.getByFQNameID(aFullyQualifiedNameID, aScope) );
+ }
+
+ inline const BF & getProgramByNameID(const std::string & id,
+ Specifier::SCOPE_KIND aScope =
+ Specifier::SCOPE_UNDEFINED_KIND) const
+ {
+ return( mTableOfProgram.getByNameID(id, aScope) );
+ }
+
+ inline const BF & getProgramByQualifiedNameID(
+ const std::string & aQualifiedNameID,
+ Specifier::SCOPE_KIND aScope =
+ Specifier::SCOPE_UNDEFINED_KIND) const
+ {
+ return( mTableOfProgram.
+ getByQualifiedNameID(aQualifiedNameID, aScope) );
+ }
+
+
+ inline const BF & getProgramByAstElement(
+ const ObjectElement * astElement) const
+ {
+ return( mTableOfProgram.getByAstElement(astElement) );
+ }
+
+ inline bool hasProgram() const
+ {
+ return( mTableOfProgram.nonempty() );
+ }
+
+ /**
+ * GETTER - SETTER
+ * mTableOfAnonymousInnerRoutine
+ * like << variable::on_write >> or << type::constraint >> routines
+ */
+ inline const BF & saveAnonymousInnerRoutine(AvmProgram * aRoutine)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( aRoutine )
+ << "Anonymous Inner Routine as Program !!!"
+ << SEND_EXIT;
+
+ aRoutine->setContainer(this);
+ aRoutine->setOffset( mTableOfAnonymousInnerRoutine.size() );
+
+ return( mTableOfAnonymousInnerRoutine.save(aRoutine) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mTableOfExecutable
+ */
+ inline const BF & saveExecutable(ExecutableForm * anExecutable)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( anExecutable )
+ << "ExecutableForm !!!"
+ << SEND_EXIT;
+
+ anExecutable->setContainer(this);
+ anExecutable->setOffset( mTableOfExecutable.size() );
+
+ return( mTableOfExecutable.save(anExecutable) );
+ }
+
+ inline const TableOfExecutableForm & getExecutables() const
+ {
+ return( mTableOfExecutable );
+ }
+
+ inline bool hasExecutable() const
+ {
+ return( mTableOfExecutable.nonempty() );
+ }
+
+
+ /*
+ * contains DATA
+ */
+ inline bool containsData(InstanceOfData * anInstance) const
+ {
+ return( AvmProgram::containsData(anInstance) /*||
+ mTableOfAlias.contains(anInstance)*/ );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mTableOfAlias
+ */
+ inline void appendAlias(const Symbol & anInstance)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( anInstance )
+ << "InstanceOfData !!!"
+ << SEND_EXIT;
+
+ mTableOfAlias.append(anInstance);
+ }
+
+ inline const Symbol & saveAlias(BaseInstanceForm * anInstance)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( anInstance )
+ << "InstanceOfData !!!"
+ << SEND_EXIT;
+
+ return( mTableOfAlias.save(anInstance) );
+ }
+
+ inline TableOfSymbol & getAlias()
+ {
+ return( mTableOfAlias );
+ }
+
+ inline const TableOfSymbol & getAlias() const
+ {
+ return( mTableOfAlias );
+ }
+
+
+ inline bool hasAlias() const
+ {
+ return( mTableOfAlias.nonempty() );
+ }
+
+
+ /**
+ * GETTER
+ * any SYMBOL filtering by an optional type specifier family
+ */
+ virtual const BF & getSymbol(
+ const std::string & aFullyQualifiedNameID,
+ avm_type_specifier_kind_t typeFamily) const;
+
+ virtual const BF & getSymbolByQualifiedNameID(
+ const std::string & aQualifiedNameID,
+ avm_type_specifier_kind_t typeFamily) const;
+
+ virtual const BF & getSymbolByNameID(const std::string & aNameID,
+ avm_type_specifier_kind_t typeFamily) const;
+
+ virtual const BF & getSymbolByAstElement(const ObjectElement * astElement,
+ avm_type_specifier_kind_t typeFamily) const;
+
+
+ /**
+ * GETTER - SETTER
+ * onCreateRoutine
+ */
+ inline AvmProgram & getOnCreateRoutine()
+ {
+ return( onCreateRoutine );
+ }
+
+ inline BFCode & getOnCreate()
+ {
+ return( onCreateRoutine.getCode() );
+ }
+
+ inline const BFCode & getOnCreate() const
+ {
+ return( onCreateRoutine.getCode() );
+ }
+
+ inline bool hasOnCreate() const
+ {
+ return( onCreateRoutine.hasCode() );
+ }
+
+ inline void setOnCreate(const BFCode & aProgram)
+ {
+ onCreateRoutine.setCode( aProgram );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onInitRoutine
+ */
+ inline AvmProgram & getOnInitRoutine()
+ {
+ return( onInitRoutine );
+ }
+
+ inline BFCode & getOnInit()
+ {
+ return( onInitRoutine.getCode() );
+ }
+
+ inline const BFCode & getOnInit() const
+ {
+ return( onInitRoutine.getCode() );
+ }
+
+ inline bool hasOnInit() const
+ {
+ return( onInitRoutine.hasCode() );
+ }
+
+ inline void setOnInit(const BFCode & aProgram)
+ {
+ onInitRoutine.setCode( aProgram );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onFinalRoutine
+ */
+ inline AvmProgram & getOnFinalRoutine()
+ {
+ return( onFinalRoutine );
+ }
+
+ inline BFCode & getOnFinal()
+ {
+ return( onFinalRoutine.getCode() );
+ }
+
+ inline const BFCode & getOnFinal() const
+ {
+ return( onFinalRoutine.getCode() );
+ }
+
+ inline bool hasOnFinal() const
+ {
+ return( onFinalRoutine.hasCode() );
+ }
+
+ inline void setOnFinal(const BFCode & aProgram)
+ {
+ onFinalRoutine.setCode( aProgram );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onReturnRoutine
+ */
+ inline AvmProgram & getOnReturnRoutine()
+ {
+ return( onReturnRoutine );
+ }
+
+ inline BFCode & getOnReturn()
+ {
+ return( onReturnRoutine.getCode() );
+ }
+
+ inline const BFCode & getOnReturn() const
+ {
+ return( onReturnRoutine.getCode() );
+ }
+
+ inline bool hasOnReturn() const
+ {
+ return( onReturnRoutine.hasCode() );
+ }
+
+ inline void setOnReturn(const BFCode & aProgram)
+ {
+ onReturnRoutine.setCode( aProgram );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onStartRoutine
+ */
+ inline AvmProgram & getOnStartRoutine()
+ {
+ return( onStartRoutine );
+ }
+
+ inline BFCode & getOnStart()
+ {
+ return( onStartRoutine.getCode() );
+ }
+
+ inline const BFCode & getOnStart() const
+ {
+ return( onStartRoutine.getCode() );
+ }
+
+ inline bool hasOnStart() const
+ {
+ return( onStartRoutine.hasCode() );
+ }
+
+ inline void setOnStart(const BFCode & aProgram)
+ {
+ onStartRoutine.setCode( aProgram );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onStopRoutine
+ */
+ inline AvmProgram & getOnStopRoutine()
+ {
+ return( onStopRoutine );
+ }
+
+ inline BFCode & getOnStop()
+ {
+ return( onStopRoutine.getCode() );
+ }
+
+ inline const BFCode & getOnStop() const
+ {
+ return( onStopRoutine.getCode() );
+ }
+
+ inline bool hasOnStop() const
+ {
+ return( onStopRoutine.hasCode() );
+ }
+
+ inline void setOnStop(const BFCode & aProgram)
+ {
+ onStopRoutine.setCode( aProgram );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onIEnableRoutine
+ */
+ inline AvmProgram & getOnIEnableRoutine()
+ {
+ return( onIEnableRoutine );
+ }
+
+ inline BFCode & getOnIEnable()
+ {
+ return( onIEnableRoutine.getCode() );
+ }
+
+ inline const BFCode & getOnIEnable() const
+ {
+ return( onIEnableRoutine.getCode() );
+ }
+
+ inline bool hasOnIEnable() const
+ {
+ return( onIEnableRoutine.hasCode() );
+ }
+
+ inline void setOnIEnable(const BFCode & aProgram)
+ {
+ onIEnableRoutine.setCode( aProgram );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onEnableRoutine
+ */
+ inline AvmProgram & getOnEnableRoutine()
+ {
+ return( onEnableRoutine );
+ }
+
+ inline BFCode & getOnEnable()
+ {
+ return( onEnableRoutine.getCode() );
+ }
+
+ inline const BFCode & getOnEnable() const
+ {
+ return( onEnableRoutine.getCode() );
+ }
+
+ inline bool hasOnEnable() const
+ {
+ return( onEnableRoutine.hasCode() );
+ }
+
+ inline void setOnEnable(const BFCode & aProgram)
+ {
+ onEnableRoutine.setCode( aProgram );
+ }
+
+ /**
+ * GETTER - SETTER
+ * onIDisableRoutine
+ */
+ inline AvmProgram & getOnIDisableRoutine()
+ {
+ return( onIDisableRoutine );
+ }
+
+ inline BFCode & getOnIDisable()
+ {
+ return( onIDisableRoutine.getCode() );
+ }
+
+ inline const BFCode & getOnIDisable() const
+ {
+ return( onIDisableRoutine.getCode() );
+ }
+
+ inline bool hasOnIDisable() const
+ {
+ return( onIDisableRoutine.hasCode() );
+ }
+
+ inline void setOnIDisable(const BFCode & aProgram)
+ {
+ onIDisableRoutine.setCode( aProgram );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onDisableRoutine
+ */
+ inline AvmProgram & getOnDisableRoutine()
+ {
+ return( onDisableRoutine );
+ }
+
+ inline BFCode & getOnDisable()
+ {
+ return( onDisableRoutine.getCode() );
+ }
+
+ inline const BFCode & getOnDisable() const
+ {
+ return( onDisableRoutine.getCode() );
+ }
+
+ inline bool hasOnDisable() const
+ {
+ return( onDisableRoutine.hasCode() );
+ }
+
+ inline void setOnDisable(const BFCode & aProgram)
+ {
+ onDisableRoutine.setCode( aProgram );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onIAbortRoutine
+ */
+ inline AvmProgram & getOnIAbortRoutine()
+ {
+ return( onIAbortRoutine );
+ }
+
+ inline BFCode & getOnIAbort()
+ {
+ return( onIAbortRoutine.getCode() );
+ }
+
+ inline const BFCode & getOnIAbort() const
+ {
+ return( onIAbortRoutine.getCode() );
+ }
+
+ inline bool hasOnIAbort() const
+ {
+ return( onIAbortRoutine.hasCode() );
+ }
+
+ inline void setOnIAbort(const BFCode & aProgram)
+ {
+ onIAbortRoutine.setCode( aProgram );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onAbortRoutine
+ */
+ inline AvmProgram & getOnAbortRoutine()
+ {
+ return( onAbortRoutine );
+ }
+
+ inline BFCode & getOnAbort()
+ {
+ return( onAbortRoutine.getCode() );
+ }
+
+ inline const BFCode & getOnAbort() const
+ {
+ return( onAbortRoutine.getCode() );
+ }
+
+ inline bool hasOnAbort() const
+ {
+ return( onAbortRoutine.hasCode() );
+ }
+
+ inline void setOnAbort(const BFCode & aProgram)
+ {
+ onAbortRoutine.setCode( aProgram );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onIRunRoutine
+ */
+ inline AvmProgram & getOnIRunRoutine()
+ {
+ return( onIRunRoutine );
+ }
+
+ inline BFCode & getOnIRun()
+ {
+ return( onIRunRoutine.getCode() );
+ }
+
+ inline const BFCode & getOnIRun() const
+ {
+ return( onIRunRoutine.getCode() );
+ }
+
+ inline bool hasOnIRun() const
+ {
+ return( onIRunRoutine.hasCode() );
+ }
+
+ inline void setOnIRun(const BFCode & aProgram)
+ {
+ onIRunRoutine.setCode( aProgram );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onRunRoutine
+ */
+ inline AvmProgram & getOnRunRoutine()
+ {
+ return( onRunRoutine );
+ }
+
+ inline BFCode & getOnRun()
+ {
+ return( onRunRoutine.getCode() );
+ }
+
+ inline const BFCode & getOnRun() const
+ {
+ return( onRunRoutine.getCode() );
+ }
+
+ inline bool hasOnRun() const
+ {
+ return( onRunRoutine.hasCode() );
+ }
+
+ inline void setOnRun(const BFCode & aProgram)
+ {
+ onRunRoutine.setCode( aProgram );
+ }
+
+ /**
+ * GETTER - SETTER
+ * onRtcRoutine
+ */
+ inline AvmProgram & getOnRtcRoutine()
+ {
+ return( onRtcRoutine );
+ }
+
+ inline BFCode & getOnRtc()
+ {
+ return( onRtcRoutine.getCode() );
+ }
+
+ inline const BFCode & getOnRtc() const
+ {
+ return( onRtcRoutine.getCode() );
+ }
+
+ inline bool hasOnRtc() const
+ {
+ return( onRtcRoutine.hasCode() );
+ }
+
+ inline void setOnRtc(const BFCode & aProgram)
+ {
+ onRtcRoutine.setCode( aProgram );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mSchedule
+ */
+ inline AvmProgram & getOnScheduleRoutine()
+ {
+ return( onScheduleRoutine );
+ }
+
+ inline BFCode & getOnSchedule()
+ {
+ return( onScheduleRoutine.getCode() );
+ }
+
+ inline const BFCode & getOnSchedule() const
+ {
+ return( onScheduleRoutine.getCode() );
+ }
+
+ inline bool hasOnSchedule() const
+ {
+ return( onScheduleRoutine.hasCode() );
+ }
+
+ inline void setOnSchedule(const BFCode & aProgram)
+ {
+ onScheduleRoutine.setCode( aProgram );
+ }
+
+ inline bool hasUserRunningCode() const
+ {
+ return( hasOnRun() || hasOnRtc() || hasOnSchedule() );
+ }
+
+
+ /**
+ * GETTER
+ * mInitRoutine
+ * mEnableRoutine
+ * mRunRoutine
+ */
+ inline bool hasInitOrRun() const
+ {
+ return( hasOnInit() || hasOnRun() );
+ }
+
+ inline bool hasOnInitOrEnableOrRun() const
+ {
+ return( hasOnInit() || hasOnEnable() || hasOnRun() );
+ }
+
+
+ /**
+ * GETTER
+ * on activity by opcode
+ */
+ AvmProgram & getOnActivityRoutine(AVM_OPCODE opCode);
+
+ const BFCode & getOnActivity(AVM_OPCODE opCode) const;
+
+
+ /**
+ * GETTER - SETTER
+ * mComponentFlag
+ * Structural decompositon
+ */
+ bool isMainComponent() const
+ {
+ return( mMainComponentFlag );
+ }
+
+ void setMainComponent(bool isMainComponent = true)
+ {
+ mMainComponentFlag = isMainComponent;
+ }
+
+ bool isCompositeComponent() const
+ {
+ return( hasOnConcurrency() );
+ }
+
+
+
+ /**
+ * GETTER - SETTER
+ * mMutableScheduleFlag
+ * MOC Attribute for mutable Schedule
+ */
+ bool isMutableSchedule() const
+ {
+ return( mMutableScheduleFlag );
+ }
+
+ void setMutableSchedule(bool isMutableSchedule = true)
+ {
+ mMutableScheduleFlag = isMutableSchedule;
+ }
+
+ bool isInlinableSchedule() const;
+
+
+ /**
+ * GETTER - SETTER
+ * mConcurrency
+ */
+ inline AvmProgram & getOnConcurrencyRoutine()
+ {
+ return( onConcurrencyRoutine );
+ }
+
+ inline BFCode & getOnConcurrency()
+ {
+ return( onConcurrencyRoutine.getCode() );
+ }
+
+ inline const BFCode & getOnConcurrency() const
+ {
+ return( onConcurrencyRoutine.getCode() );
+ }
+
+ inline bool hasOnConcurrency() const
+ {
+ return( onConcurrencyRoutine.hasCode() );
+ }
+
+ inline void setOnConcurrency(const BFCode & aProgram)
+ {
+ onConcurrencyRoutine.setCode( aProgram );
+ }
+
+ inline Operator * getOnConcurrencyOperator() const
+ {
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT(
+ onConcurrencyRoutine.getCode() )
+ << " Concurrency Operator for "
+ << str_header( this ) << " !!!"
+ << SEND_EXIT;
+
+ return( onConcurrencyRoutine.getCode()->getOperator() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mSynchronize
+ */
+ inline AvmProgram & getOnSynchronizeRoutine()
+ {
+ return( onSynchronizeRoutine );
+ }
+
+ inline BFCode & getOnSynchronize()
+ {
+ return( onSynchronizeRoutine.getCode() );
+ }
+
+ inline const BFCode & getOnSynchronize() const
+ {
+ return( onSynchronizeRoutine.getCode() );
+ }
+
+ inline bool hasOnSynchronize() const
+ {
+ return( onSynchronizeRoutine.hasCode() );
+ }
+
+ inline void setOnSynchronize(const BFCode & aProgram)
+ {
+ onSynchronizeRoutine.setCode( aProgram );
+ }
+
+
+ /**
+ * GETTER
+ * the Schedulability property
+ */
+ inline bool isSchedulable() const
+ {
+ return( hasOnInit() && hasOnRun() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mTableOfRouter4Instance
+ */
+ inline TableOfRouter & getRouters4Instance()
+ {
+ return( mTableOfRouter4Instance );
+ }
+
+ inline const TableOfRouter & getRouters4Instance() const
+ {
+ return( mTableOfRouter4Instance );
+ }
+
+ inline bool hasRouter4Instance() const
+ {
+ return( mTableOfRouter4Instance.nonempty() );
+ }
+
+ inline void setRouters4Instance(const TableOfRouter & aRouterTable)
+ {
+ mTableOfRouter4Instance = aRouterTable;
+ }
+
+
+ inline void appendRouter4Instance(const Router & aRouter)
+ {
+ mTableOfRouter4Instance.append( aRouter );
+ }
+
+
+ inline Router & getRouter4Instance(avm_size_t offset)
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT(
+ offset , mTableOfRouter4Instance.size() )
+ << SEND_EXIT;
+
+
+ return( mTableOfRouter4Instance.get(offset) );
+ }
+
+ inline const Router & getRouter4Instance(avm_size_t offset) const
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT(
+ offset , mTableOfRouter4Instance.size() )
+ << SEND_EXIT;
+
+
+ return( mTableOfRouter4Instance.get(offset) );
+ }
+
+
+ inline Router & getRouter4This()
+ {
+ AVM_OS_ASSERT_FATAL_EMPTY_COLLECTION_EXIT( mTableOfRouter4Instance )
+ << "Table of Router for Instance !!!"
+ << SEND_EXIT;
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( hasInstanceStaticThis() )
+ << "Unexpected an executable without machine< this > !!!"
+ << SEND_EXIT;
+
+ return( mTableOfRouter4Instance.get(
+ getInstanceStaticThis().getOffset() ) );
+ }
+
+ inline const Router & getRouter4This() const
+ {
+ AVM_OS_ASSERT_FATAL_EMPTY_COLLECTION_EXIT( mTableOfRouter4Instance )
+ << "Table of Router for Instance !!!"
+ << SEND_EXIT;
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( hasInstanceStaticThis() )
+ << "Unexpected an executable without machine< this > !!!"
+ << SEND_EXIT;
+
+ return( mTableOfRouter4Instance.get(
+ getInstanceStaticThis().getOffset() ) );
+ }
+
+
+ inline bool hasRouter4This() const
+ {
+ return( mTableOfRouter4Instance.nonempty()
+ && hasInstanceStaticThis()
+ && mTableOfRouter4Instance.get(
+ getInstanceStaticThis().getOffset() ).valid() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mRouterTable4Prototype
+ */
+ inline const Router & getRouter4Prototype(ExecutableForm * aModel) const
+ {
+ if( mTableOfRouter4Instance.nonempty() )
+ {
+ TableOfRouter::const_iterator it = mTableOfRouter4Instance.begin();
+ TableOfRouter::const_iterator endIt = mTableOfRouter4Instance.end();
+
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).valid()
+ && ((*it).getMachine()->getExecutable() == aModel)
+ && (*it).getMachine()->
+ getSpecifier().isDesignPrototypeStatic() )
+ {
+ return( *it );
+ }
+ }
+ }
+
+ return( Router::_NULL_ );
+ }
+
+ inline const Router & getRouter4Prototype(InstanceOfMachine * aMachine) const
+ {
+ return( getRouter4Prototype(aMachine->getExecutable()) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mTableOfRouter4Model
+ */
+ inline TableOfRouter & getRouters4Model()
+ {
+ return( mTableOfRouter4Model );
+ }
+
+ inline const TableOfRouter & getRouters4Model() const
+ {
+ return( mTableOfRouter4Model );
+ }
+
+ inline bool hasRouter4Model() const
+ {
+ return( mTableOfRouter4Model.nonempty() );
+ }
+
+ inline void setRouters4Model(const TableOfRouter & aRouterTable)
+ {
+ mTableOfRouter4Model = aRouterTable;
+ }
+
+
+ inline void appendRouter4Model(const Router & aRouter)
+ {
+ mTableOfRouter4Model.append( aRouter );
+ }
+
+
+ inline Router & getRouter4Model(avm_size_t offset)
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT(
+ offset , mTableOfRouter4Model.size() )
+ << SEND_EXIT;
+
+ return( mTableOfRouter4Model.get(offset) );
+ }
+
+ inline const Router & getRouter4Model(avm_size_t offset) const
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT(
+ offset , mTableOfRouter4Model.size() )
+ << SEND_EXIT;
+
+ return( mTableOfRouter4Model.get(offset) );
+ }
+
+
+ inline const Router & getRouter4Model(const ExecutableForm * aModel) const
+ {
+ if( mTableOfRouter4Model.nonempty() )
+ {
+ TableOfRouter::const_iterator it = mTableOfRouter4Model.begin();
+ TableOfRouter::const_iterator endIt = mTableOfRouter4Model.end();
+
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).valid()
+ && ((*it).getMachine()->getExecutable() == aModel) )
+ {
+ return( *it );
+ }
+ }
+ }
+
+ return( Router::_NULL_ );
+ }
+
+ inline const Router & getRouter4Model(
+ const InstanceOfMachine * aMachine) const
+ {
+ return( getRouter4Model(aMachine->getExecutable()) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mRdvCommunicationFlag
+ */
+ inline bool hasRdvCommunication() const
+ {
+ return( mRdvCommunicationFlag );
+ }
+
+ void setRdvCommunication(bool aFlag = true)
+ {
+ mRdvCommunicationFlag = aFlag;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mInputEnabledCommunicationFlag
+ * MOC Attribute for Communication
+ */
+ bool isInputEnabledCommunication() const
+ {
+ return( mInputEnabledCommunicationFlag );
+ }
+
+ void setInputEnabledCommunication(bool isInputEnabled = true)
+ {
+ mInputEnabledCommunicationFlag = isInputEnabled;
+ }
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // STATIC ANALYSIS ATTRIBUTE
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * GETTER - SETTER
+ * mRequiredData
+ */
+ inline TableOfInstanceOfData & getRequiredData()
+ {
+ return( mRequiredData );
+ }
+
+ inline const TableOfInstanceOfData & getRequiredData() const
+ {
+ return( mRequiredData );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mUselessData
+ */
+ inline TableOfInstanceOfData & getUselessData()
+ {
+ return( mUselessData );
+ }
+
+ inline const TableOfInstanceOfData & getUselessData() const
+ {
+ return( mUselessData );
+ }
+
+
+ /**
+ * Control flow analysis
+ * source & targets Executable< [state]machine > for Transition
+ */
+ inline void getOutgoingMachine(ListOfInstanceOfMachine & listOfMachine)
+ {
+ for( avm_size_t offset = 0 ; offset < getTransition().size() ; ++offset )
+ {
+ getTransition().rawAt(offset)->getTransitionTarget( listOfMachine );
+ }
+ }
+
+ inline void getOutgoingTransition(ListOfAvmTransition & listOfTransition)
+ {
+ AvmTransition * aTransition;
+
+ for( avm_size_t offset = 0 ; offset < getTransition().size() ; ++offset )
+ {
+ aTransition = getTransition().rawAt(offset);
+
+ listOfTransition.append( aTransition );
+ }
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mListOfBackwardReachableMachine
+ */
+ inline void addBackwardReachableMachine(InstanceOfMachine * aMachine)
+ {
+ mBackwardReachableMachine.add_union( aMachine );
+ }
+
+ inline void addBackwardReachableMachine(
+ ListOfInstanceOfMachine & reachableMachines)
+ {
+ mBackwardReachableMachine.add_union( reachableMachines );
+ }
+
+
+ inline ListOfInstanceOfMachine & getBackwardReachableMachine()
+ {
+ return( mBackwardReachableMachine );
+ }
+
+ inline const ListOfInstanceOfMachine & getBackwardReachableMachine() const
+ {
+ return( mBackwardReachableMachine );
+ }
+
+
+ bool containsBackwardReachableMachine(InstanceOfMachine * aMachine) const
+ {
+ return( mBackwardReachableMachine.contains(aMachine) );
+ }
+
+ inline bool hasBackwardReachableMachine() const
+ {
+ return( mBackwardReachableMachine.nonempty() );
+ }
+
+
+ inline void removeBackwardReachableMachine(InstanceOfMachine * aMachine)
+ {
+ if( mBackwardReachableMachine.nonempty() )
+ {
+ mBackwardReachableMachine.remove( aMachine );
+ }
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mListOfBackwardReachableMachine
+ */
+ inline void addBackwardReachableTransition(AvmTransition * aTransition)
+ {
+ mBackwardReachableTransition.add_union( aTransition );
+ }
+
+ inline void addBackwardReachableTransition(
+ ListOfAvmTransition & reachableTransitions)
+ {
+ mBackwardReachableTransition.add_union( reachableTransitions );
+ }
+
+
+ inline ListOfAvmTransition & getBackwardReachableTransition()
+ {
+ return( mBackwardReachableTransition );
+ }
+
+ inline const ListOfAvmTransition & getBackwardReachableTransition() const
+ {
+ return( mBackwardReachableTransition );
+ }
+
+
+ bool containsBackwardReachableTransition(AvmTransition * aTransition) const
+ {
+ return( mBackwardReachableTransition.contains(aTransition) );
+ }
+
+ inline bool hasBackwardReachableTransition() const
+ {
+ return( mBackwardReachableTransition.nonempty() );
+ }
+
+
+ inline void removeBackwardReachableTransition(AvmTransition * aTransition)
+ {
+ if( mBackwardReachableTransition.nonempty() )
+ {
+ mBackwardReachableTransition.remove( aTransition );
+ }
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mListOfForwardReachableMachine
+ */
+ inline void addForwardReachableMachine(InstanceOfMachine * aMachine)
+ {
+ mForwardReachableMachine.add_union( aMachine );
+ }
+
+ inline void addForwardReachableMachine(
+ ListOfInstanceOfMachine & reachableMachines)
+ {
+ mForwardReachableMachine.add_union( reachableMachines );
+ }
+
+
+ inline ListOfInstanceOfMachine & getForwardReachableMachine()
+ {
+ return( mForwardReachableMachine );
+ }
+
+ inline const ListOfInstanceOfMachine & getForwardReachableMachine() const
+ {
+ return( mForwardReachableMachine );
+ }
+
+
+ bool containsForwardReachableMachine(InstanceOfMachine * aMachine) const
+ {
+ return( mForwardReachableMachine.contains(aMachine) );
+ }
+
+ inline bool hasForwardReachableMachine() const
+ {
+ return( mForwardReachableMachine.nonempty() );
+ }
+
+
+ inline void removeForwardReachableMachine(InstanceOfMachine * aMachine)
+ {
+ if( mForwardReachableMachine.nonempty() )
+ {
+ mForwardReachableMachine.remove( aMachine );
+ }
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mListOfForwardReachableMachine
+ */
+ inline void addForwardReachableTransition(AvmTransition * aTransition)
+ {
+ mForwardReachableTransition.add_union( aTransition );
+ }
+
+ inline void addForwardReachableTransition(
+ ListOfAvmTransition & reachableTransitions)
+ {
+ mForwardReachableTransition.add_union( reachableTransitions );
+ }
+
+
+ inline ListOfAvmTransition & getForwardReachableTransition()
+ {
+ return( mForwardReachableTransition );
+ }
+
+ inline const ListOfAvmTransition & getForwardReachableTransition() const
+ {
+ return( mForwardReachableTransition );
+ }
+
+
+ bool containsForwardReachableTransition(AvmTransition * aTransition) const
+ {
+ return( mForwardReachableTransition.contains(aTransition) );
+ }
+
+ inline bool hasForwardReachableTransition() const
+ {
+ return( mForwardReachableTransition.nonempty() );
+ }
+
+
+ inline void removeForwardReachableTransition(AvmTransition * aTransition)
+ {
+ if( mForwardReachableTransition.nonempty() )
+ {
+ mForwardReachableTransition.remove( aTransition );
+ }
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * isReachableStateFlag
+ */
+ bool isReachableState()
+ {
+ return( isReachableStateFlag );
+ }
+
+ void setReachableState(bool aReachableStateFlag)
+ {
+ isReachableStateFlag = aReachableStateFlag;
+ }
+
+
+ /**
+ * Serialization
+ */
+ void header(OutStream & os) const;
+
+ void strHeader(OutStream & os) const;
+
+ static void toStream(OutStream & os, const TableOfRouter & aTableOfRouter,
+ const std::string & sectionName = "router:");
+
+ void toStream(OutStream & os) const;
+
+};
+
+
+}
+
+#endif /*EXECUTABLEFORM_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/executable/ExecutableLib.cpp b/org.eclipse.efm.symbex/src/fml/executable/ExecutableLib.cpp
new file mode 100644
index 0000000..6265fde
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/ExecutableLib.cpp
@@ -0,0 +1,192 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 2 juil. 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ExecutableLib.h"
+
+#include <fml/common/ModifierElement.h>
+
+#include <fml/executable/BaseInstanceForm.h>
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/InstanceOfData.h>
+#include <fml/executable/InstanceOfMachine.h>
+#include <fml/executable/InstanceOfPort.h>
+
+#include <fml/type/TypeManager.h>
+
+
+namespace sep
+{
+
+/**
+ * PRE DEFINED MACHINE VARIABLE
+ */
+Symbol ExecutableLib::MACHINE_NULL;
+Symbol ExecutableLib::MACHINE_ENVIRONMENT;
+
+Symbol ExecutableLib::MACHINE_SELF;
+Symbol ExecutableLib::MACHINE_PARENT;
+Symbol ExecutableLib::MACHINE_COMMUNICATOR;
+
+Symbol ExecutableLib::MACHINE_COMPONENT_SELF;
+Symbol ExecutableLib::MACHINE_COMPONENT_PARENT;
+Symbol ExecutableLib::MACHINE_COMPONENT_COMMUNICATOR;
+
+Symbol ExecutableLib::MACHINE_SYSTEM;
+
+
+/**
+ * PRE DEFINED NULL FORM
+ */
+Symbol ExecutableLib::CHANNEL_NIL;
+Symbol ExecutableLib::PORT_NIL;
+Symbol ExecutableLib::BUFFER_NIL;
+
+
+/**
+ * BOTTOM
+ * TOP
+ */
+Symbol ExecutableLib::BOTTOM;
+Symbol ExecutableLib::TOP;
+
+Symbol ExecutableLib::_NULL_;
+
+Symbol ExecutableLib::_INFINITY_;
+
+
+/**
+ * LOADER
+ */
+void ExecutableLib::load()
+{
+ MACHINE_NULL = new InstanceOfMachine(NULL, NULL, NULL, NULL, 0,
+ Specifier::DESIGN_INSTANCE_STATIC_SPECIFIER);
+ MACHINE_NULL.machine().getwModifier().setModifierPublicFinalStatic();
+ MACHINE_NULL.setAllNameID("null#machine", "null#machine");
+// MACHINE_NULL.setAllNameID("null< machine >", "null< machine >");
+ MACHINE_NULL.machine().setInstanceModel(MACHINE_NULL.rawMachine());
+
+ MACHINE_SELF = new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ TypeManager::MACHINE, "const::self", 0,
+ Modifier::PROPERTY_PUBLIC_FINAL_STATIC_MODIFIER);
+
+ MACHINE_PARENT = new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ TypeManager::MACHINE, "const::parent", 0,
+ Modifier::PROPERTY_PUBLIC_FINAL_STATIC_MODIFIER);
+
+ MACHINE_COMMUNICATOR = new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ TypeManager::MACHINE, "const::machine#com", 0,
+ Modifier::PROPERTY_PUBLIC_FINAL_STATIC_MODIFIER);
+
+
+ MACHINE_COMPONENT_SELF = new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ TypeManager::MACHINE, "const::machine#component#self", 0,
+ Modifier::PROPERTY_PUBLIC_FINAL_STATIC_MODIFIER);
+
+ MACHINE_COMPONENT_PARENT = new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ TypeManager::MACHINE, "const::machine#component#parent", 0,
+ Modifier::PROPERTY_PUBLIC_FINAL_STATIC_MODIFIER);
+
+ MACHINE_COMPONENT_COMMUNICATOR = new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ TypeManager::MACHINE, "const::machine#component#communicator", 0,
+ Modifier::PROPERTY_PUBLIC_FINAL_STATIC_MODIFIER);
+
+
+ MACHINE_SYSTEM = new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ TypeManager::MACHINE, "const::system", 0,
+ Modifier::PROPERTY_PUBLIC_FINAL_STATIC_MODIFIER);
+
+ MACHINE_ENVIRONMENT = new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ TypeManager::MACHINE, "const::env", 0,
+ Modifier::PROPERTY_PUBLIC_FINAL_STATIC_MODIFIER);
+
+
+ CHANNEL_NIL = InstanceOfPort::newChannel(
+ NULL, NULL, AVM_NUMERIC_MAX_OFFSET);
+ CHANNEL_NIL.setAllNameID("null#channel", "null#channel");
+// CHANNEL_NIL.setAllNameID("null< channel >", "null< channel >");
+
+ PORT_NIL = new InstanceOfPort(NULL, NULL,
+ AVM_NUMERIC_MAX_OFFSET, 0, IComPoint::IO_UNDEFINED_NATURE);
+ PORT_NIL.setAllNameID("null#port", "null#port");
+// PORT_NIL.setAllNameID("null< port >", "null< port >");
+
+ BUFFER_NIL = new InstanceOfBuffer(NULL, NULL, AVM_NUMERIC_MAX_OFFSET,
+ TYPE_UNDEFINED_SPECIFIER, -1);
+ BUFFER_NIL.setAllNameID("null#buffer", "null#buffer");
+// BUFFER_NIL.setAllNameID("null< buffer >", "null< buffer >");
+
+
+ BOTTOM = new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ TypeManager::UNIVERSAL, "const::BOTTOM", 0,
+ Modifier::PROPERTY_PUBLIC_FINAL_STATIC_MODIFIER);
+
+ TOP = new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ TypeManager::UNIVERSAL, "const::TOP", 0,
+ Modifier::PROPERTY_PUBLIC_FINAL_STATIC_MODIFIER);
+
+ _NULL_ = new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ TypeManager::UNIVERSAL, "const::NULL", 0,
+ Modifier::PROPERTY_PUBLIC_FINAL_STATIC_MODIFIER);
+
+ _INFINITY_ = new InstanceOfData(
+ IPointerDataNature::POINTER_STANDARD_NATURE,
+ TypeManager::UNIVERSAL, "const::INFINITY", 0,
+ Modifier::PROPERTY_PUBLIC_FINAL_STATIC_MODIFIER);
+}
+
+
+/**
+ * DISPOSER
+ */
+void ExecutableLib::dispose()
+{
+ MACHINE_NULL.destroy();
+ MACHINE_ENVIRONMENT.destroy();
+
+ MACHINE_SELF.destroy();
+ MACHINE_PARENT.destroy();
+ MACHINE_COMMUNICATOR.destroy();
+ MACHINE_COMPONENT_SELF.destroy();
+ MACHINE_COMPONENT_PARENT.destroy();
+ MACHINE_COMPONENT_COMMUNICATOR.destroy();
+ MACHINE_SYSTEM.destroy();
+
+ CHANNEL_NIL.destroy();
+ PORT_NIL.destroy();
+ BUFFER_NIL.destroy();
+
+ BOTTOM.destroy();
+ TOP.destroy();
+
+ _NULL_.destroy();
+
+ _INFINITY_.destroy();
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/executable/ExecutableLib.h b/org.eclipse.efm.symbex/src/fml/executable/ExecutableLib.h
new file mode 100644
index 0000000..06e2f24
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/ExecutableLib.h
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 2 juil. 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef EXECUTABLELIB_H_
+#define EXECUTABLELIB_H_
+
+#include <common/BF.h>
+
+#include <fml/symbol/Symbol.h>
+
+
+namespace sep
+{
+
+
+class ExecutableLib
+{
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ExecutableLib()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ExecutableLib()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * LOADER - DISPOSER
+ */
+ static void load();
+ static void dispose();
+
+
+ /**
+ * PRE DEFINED MACHINE VARIABLE
+ */
+ static Symbol MACHINE_NULL;
+ static Symbol MACHINE_ENVIRONMENT;
+
+ static Symbol MACHINE_SELF;
+ static Symbol MACHINE_PARENT;
+ static Symbol MACHINE_COMMUNICATOR;
+
+ static Symbol MACHINE_COMPONENT_SELF;
+ static Symbol MACHINE_COMPONENT_PARENT;
+ static Symbol MACHINE_COMPONENT_COMMUNICATOR;
+
+ static Symbol MACHINE_SYSTEM;
+
+ /**
+ * PRE DEFINED NULL FORM
+ */
+ static Symbol CHANNEL_NIL;
+ static Symbol PORT_NIL;
+ static Symbol BUFFER_NIL;
+
+
+
+ /**
+ * BOTTOM
+ * TOP
+ */
+ static Symbol BOTTOM;
+ static Symbol TOP;
+
+ static Symbol _NULL_;
+
+ static Symbol _INFINITY_;
+
+
+};
+
+
+}
+
+#endif /* EXECUTABLELIB_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/executable/ExecutableQuery.cpp b/org.eclipse.efm.symbex/src/fml/executable/ExecutableQuery.cpp
new file mode 100644
index 0000000..9158c1f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/ExecutableQuery.cpp
@@ -0,0 +1,1138 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 8 mars 2017
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ExecutableQuery.h"
+
+#include <collection/Collection.h>
+
+#include <common/NamedElement.h>
+
+#include <fml/symbol/TableOfSymbol.h>
+
+
+namespace sep
+{
+
+
+/**
+ * GETTER
+ * List of all RUNTIME Executable Element
+ */
+void ExecutableQuery::getRuntimeExecutable(InstanceOfMachine * aMachine,
+ Collection< ExecutableForm * > & listOfExecutable)
+{
+ listOfExecutable.add_union( aMachine->getExecutable() );
+
+ TableOfSymbol::const_iterator it;
+ TableOfSymbol::const_iterator itEnd;
+
+ it = aMachine->getExecutable()->instance_model_begin();
+ itEnd = aMachine->getExecutable()->instance_model_end();
+ for( ; it != itEnd ; ++it )
+ {
+ getRuntimeExecutable((*it).rawMachine(), listOfExecutable);
+ }
+
+ it = aMachine->getExecutable()->instance_static_begin();
+ itEnd = aMachine->getExecutable()->instance_static_end();
+ for( ; it != itEnd ; ++it )
+ {
+ getRuntimeExecutable((*it).rawMachine(), listOfExecutable);
+ }
+}
+
+
+
+/**
+ * SEARCH
+ * AvmTransition
+ */
+const BF & ExecutableQuery::getTransitionByAstElement(
+ const ObjectElement * astElement) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ const BF & foundTransition =
+ (itExec)->getTransitionByAstElement(astElement);
+ if( foundTransition.valid() )
+ {
+ return( foundTransition );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+const BF & ExecutableQuery::getTransition(
+ const std::string & aFullyQualifiedNameID) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ const BF & foundTransition =
+ (itExec)->getTransition(aFullyQualifiedNameID);
+
+ if( foundTransition.valid() )
+ {
+ return( foundTransition );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+const BF & ExecutableQuery::getTransitionByNameID(
+ const std::string & aNameID) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ const BF & foundTransition = (itExec)->getTransitionByNameID( aNameID );
+ if( foundTransition.valid() )
+ {
+ return( foundTransition );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+const BF & ExecutableQuery::getTransitionByQualifiedNameID(
+ const std::string & aQualifiedNameID) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ const BF & foundTransition =
+ (itExec)->getTransitionByQualifiedNameID(aQualifiedNameID);
+
+ if( foundTransition.valid() )
+ {
+ return( foundTransition );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+/**
+ * SEARCH
+ * AvmProgram
+ */
+const BF & ExecutableQuery::getProgram(
+ const std::string & aFullyQualifiedNameID) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ const BF & foundProgram = (itExec)->getProgram(aFullyQualifiedNameID);
+
+ if( foundProgram.valid() )
+ {
+ return( foundProgram );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+
+/**
+ * SEARCH
+ * AvmProgram
+ * ExecutableForm
+ */
+const BF & ExecutableQuery::getExecutableOrProgram(
+ const std::string & aFullyQualifiedNameID) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ if( NamedElement::compareLocation(
+ itExec->getFullyQualifiedNameID(), aFullyQualifiedNameID) )
+ {
+ return( (*itExec) );
+ }
+ else
+ {
+ {
+ const BF & foundTransition =
+ itExec->getTransition(aFullyQualifiedNameID);
+
+ if( foundTransition.valid() )
+ {
+ return( foundTransition );
+ }
+ }
+ {
+ const BF & foundProgram =
+ itExec->getProgram(aFullyQualifiedNameID);
+
+ if( foundProgram.valid() )
+ {
+ return( foundProgram );
+ }
+ }
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+// Getter by AST-Element
+const BF & ExecutableQuery::getExecutableOrProgram(
+ const ObjectElement * astElement) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ if( itExec->isAstElement( astElement ) )
+ {
+ return( (*itExec) );
+ }
+ else
+ {
+ {
+ const BF & foundTransition =
+ itExec->getTransitionByAstElement(astElement);
+
+ if( foundTransition.valid() )
+ {
+ return( foundTransition );
+ }
+ }
+ {
+ const BF & foundProgram =
+ itExec->getProgramByAstElement(astElement);
+ if( foundProgram.valid() )
+ {
+ return( foundProgram );
+ }
+ }
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+/**
+ * SEARCH
+ * InstanceOfBuffer
+ */
+const Symbol & ExecutableQuery::getBuffer(
+ const std::string & aFullyQualifiedNameID) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ const Symbol & foundElement =
+ (itExec)->getBuffer().getByFQNameID( aFullyQualifiedNameID );
+
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+const Symbol & ExecutableQuery::getBufferByNameID(
+ const std::string & aNameID) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ const Symbol & foundElement =
+ (itExec)->getBuffer().getByNameID( aNameID );
+
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+const Symbol & ExecutableQuery::getBufferByQualifiedNameID(
+ const std::string & aQualifiedNameID) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ const Symbol & foundElement =
+ (itExec)->getBuffer().getByQualifiedNameID(aQualifiedNameID);
+
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+const Symbol & ExecutableQuery::getBufferByAstElement(
+ const ObjectElement * astElement) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ const Symbol & foundElement =
+ (itExec)->getBuffer().getByAstElement(astElement);
+
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+
+
+
+/**
+ * SEARCH
+ * InstanceOfData
+ */
+const BF & ExecutableQuery::getDataByNameID(const std::string & aNameID) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ {
+ const BF & foundElement =
+ (itExec)->getAllData().getByNameID( aNameID );
+
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+ {
+ const BF & foundElement =
+ (itExec)->getConstData().getByNameID( aNameID );
+
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+const BF & ExecutableQuery::getDataByQualifiedNameID(
+ const std::string & aQualifiedNameID) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ {
+ const BF & foundElement = (itExec)->getAllData().
+ getByQualifiedNameID(aQualifiedNameID);
+
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+ {
+ const BF & foundElement = (itExec)->getConstData().
+ getByQualifiedNameID(aQualifiedNameID);
+
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+const BF & ExecutableQuery::getData(
+ const std::string & aFullyQualifiedNameID) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ {
+ const BF & foundElement =
+ (itExec)->getAllData().getByFQNameID( aFullyQualifiedNameID );
+
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+ {
+ const BF & foundElement =
+ (itExec)->getConstData().getByFQNameID( aFullyQualifiedNameID );
+
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+const BF & ExecutableQuery::getDataByAstElement(
+ const ObjectElement * astElement) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ {
+ const BF & foundElement =
+ (itExec)->getAllData().getByAstElement(astElement);
+
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+ {
+ const BF & foundElement =
+ (itExec)->getConstData().getByAstElement(astElement);
+
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+/**
+ * SEARCH
+ * Symbol as InstanceOfPort
+ * by ID
+ */
+const Symbol & ExecutableQuery::getPortByNameID(const std::string & aNameID,
+ Modifier::DIRECTION_KIND ioDirection) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ const Symbol & foundElement = (itExec)->getPort().getByNameID(aNameID);
+
+ if( foundElement.valid()
+ && foundElement.getModifier().isDirectionKind(ioDirection) )
+ {
+ return( foundElement );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+
+const Symbol & ExecutableQuery::getPortByNameID(
+ const std::string & aNameID) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ const Symbol & foundElement = (itExec)->getPort().getByNameID(aNameID);
+
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+
+
+avm_size_t ExecutableQuery::getPortByNameID(
+ const std::string & aNameID, ListOfSymbol & listofPort,
+ Modifier::DIRECTION_KIND ioDirection, bool isStrongly) const
+{
+ avm_size_t count = 0;
+
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ count += (itExec)->getPort().getByNameID(aNameID, listofPort);
+ }
+
+ ListOfSymbol::iterator itPort = listofPort.begin();
+ ListOfSymbol::iterator endPort = listofPort.end();
+ for( ; itPort != endPort ; )
+ {
+ if( (*itPort).getModifier().
+ isnotDirectionKind(ioDirection, isStrongly) )
+ {
+ itPort = listofPort.erase(itPort);
+ }
+ else
+ {
+ ++itPort;
+ }
+ }
+
+
+ return( count );
+}
+
+
+avm_size_t ExecutableQuery::getPortByNameID(
+ const std::string & aNameID, ListOfSymbol & listofPort) const
+{
+ avm_size_t count = 0;
+
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ count += (itExec)->getPort().getByNameID(aNameID, listofPort);
+ }
+
+ return( count );
+}
+
+
+/**
+ * SEARCH
+ * Symbol as InstanceOfPort
+ * by [ [ FULLY ] QUALIFIED ] NAME ID
+ */
+const Symbol & ExecutableQuery::getPortByQualifiedNameID(
+ const std::string & aQualifiedNameID,
+ Modifier::DIRECTION_KIND ioDirection, bool isStrongly) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ const Symbol & foundElement =
+ (itExec)->getPort().getByQualifiedNameID(aQualifiedNameID);
+
+ if( foundElement.valid()
+ && foundElement.getModifier().
+ isDirectionKind(ioDirection, isStrongly) )
+ {
+ return( foundElement );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+
+avm_size_t ExecutableQuery::getPortByQualifiedNameID(
+ const std::string & aQualifiedNameID, ListOfSymbol & listofPort,
+ Modifier::DIRECTION_KIND ioDirection, bool isStrongly) const
+{
+ avm_size_t count = 0;
+
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ count += (itExec)->getPort().
+ getByQualifiedNameID(aQualifiedNameID, listofPort);
+ }
+
+ ListOfSymbol::iterator itPort = listofPort.begin();
+ ListOfSymbol::iterator endPort = listofPort.end();
+ for( ; itPort != endPort ; )
+ {
+ if( (*itPort).getModifier().isnotDirectionKind(ioDirection, isStrongly) )
+ {
+ itPort = listofPort.erase(itPort);
+ }
+ else
+ {
+ ++itPort;
+ }
+ }
+
+
+ return( count );
+}
+
+
+avm_size_t ExecutableQuery::getPortByQualifiedNameID(
+ const std::string & aQualifiedNameID, ListOfSymbol & listofPort) const
+{
+ avm_size_t count = 0;
+
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ count += (itExec)->getPort().
+ getByQualifiedNameID(aQualifiedNameID, listofPort);
+ }
+
+ return( count );
+}
+
+
+const Symbol & ExecutableQuery::getPort(
+ const std::string & aFullyQualifiedNameID) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ const Symbol & foundElement =
+ (itExec)->getPort().getByFQNameID( aFullyQualifiedNameID );
+
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+const Symbol & ExecutableQuery::getSemPort(const ExecutableForm * anExecutable,
+ const std::string & aFullyQualifiedNameID)
+{
+ for( ; anExecutable != NULL ;
+ anExecutable = anExecutable->getExecutableContainer() )
+ {
+ const Symbol & foundElement =
+ anExecutable->getPort().getByFQNameID( aFullyQualifiedNameID );
+ if( foundElement.valid() )
+ {
+ return foundElement;
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+
+const Symbol & ExecutableQuery::getPortByAstElement(
+ const ObjectElement * astElement) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ const Symbol & foundElement =
+ (itExec)->getPort().getByAstElement(astElement);
+
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+
+const Symbol & ExecutableQuery::getSemPortByAstElement(
+ const ExecutableForm * anExecutable, const ObjectElement * astElement)
+{
+ for( ; anExecutable != NULL ;
+ anExecutable = anExecutable->getExecutableContainer() )
+ {
+ const Symbol & foundElement =
+ anExecutable->getPort().getByAstElement( astElement );
+ if( foundElement.valid() )
+ {
+ return foundElement;
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+
+/**
+ * SEARCH
+ * InstanceOfChannel
+ */
+const Symbol & ExecutableQuery::getChannel(
+ const ObjectElement * astElement) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ const Symbol & foundElement =
+ (itExec)->getChannel().getByAstElement(astElement);
+
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+
+/**
+ * SEARCH
+ * InstanceOfMachine
+ */
+const Symbol & ExecutableQuery::getMachine(
+ Specifier::DESIGN_KIND aDesign,
+ const std::string & aFullyQualifiedNameID) const
+{
+ // STRICT:> compare LOCATOR & LOCATION [true:- retry only only LOCATION]
+ if( getSystem().fqnEquals( aFullyQualifiedNameID , true ) )
+ {
+ return( getSystem().getSystemInstance() );
+ }
+
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ const Symbol & foundElement = (itExec)->getInstanceByDesign(
+ aDesign ).getByFQNameID( aFullyQualifiedNameID );
+
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+const Symbol & ExecutableQuery::getMachineByNameID(
+ Specifier::DESIGN_KIND aDesign, const std::string & aNamleID) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ const Symbol & foundElement =
+ (itExec)->getInstanceByDesign(aDesign).getByNameID(aNamleID);
+
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+const Symbol & ExecutableQuery::getMachineByQualifiedNameID(
+ Specifier::DESIGN_KIND aDesign,
+ const std::string & aQualifiedNameID) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ const Symbol & foundElement = (itExec)->getInstanceByDesign(aDesign).
+ getByQualifiedNameID(aQualifiedNameID);
+
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+
+InstanceOfMachine * ExecutableQuery::rawMachineByNameID(
+ Specifier::DESIGN_KIND aDesign, const std::string & aNameID) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ InstanceOfMachine * foundElement =
+ (itExec)->getInstanceByDesign(
+ aDesign ).getByNameID(aNameID).rawMachine();
+
+ if( foundElement != NULL )
+ {
+ return( foundElement );
+ }
+ }
+
+ return( NULL );
+}
+
+InstanceOfMachine * ExecutableQuery::rawMachineByQualifiedNameID(
+ Specifier::DESIGN_KIND aDesign,
+ const std::string & aQualifiedNameID) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ InstanceOfMachine * foundElement = (itExec)->getInstanceByDesign(
+ aDesign ).getByQualifiedNameID(aQualifiedNameID).rawMachine();
+
+ if( foundElement != NULL )
+ {
+ return( foundElement );
+ }
+ }
+
+ return( NULL );
+}
+
+
+const Symbol & ExecutableQuery::getMachineByAstElement(
+ Specifier::DESIGN_KIND aDesign, const ObjectElement * astElement) const
+{
+ if( getSystem().rawSystemInstance()->isAstElement( astElement ) )
+ {
+ return( getSystem().getSystemInstance() );
+ }
+
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ const Symbol & foundElement =
+ (itExec)->getInstanceByDesign(aDesign).getByAstElement(astElement);
+
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+
+/**
+ * SEARCH
+ * Machine
+ */
+const BF & ExecutableQuery::searchMachine(
+ Specifier::DESIGN_KIND aDesign, const std::string & aQualifiedNameID )
+{
+ std::string::size_type pos = aQualifiedNameID.find("->");
+
+ if( pos != std::string::npos )
+ {
+ std::string mid = aQualifiedNameID.substr(0, pos);
+ std::string obj = aQualifiedNameID.substr(pos + 2);
+
+ InstanceOfMachine * mainMachine = NULL;
+
+ if( mid.find('.') == std::string::npos )
+ {
+ mainMachine = rawMachineByNameID(aDesign, mid);
+ }
+ else
+ {
+ mainMachine = rawMachineByQualifiedNameID(aDesign, mid);
+ }
+
+ if( mainMachine != NULL )
+ {
+ if( obj != "[*]" )
+ {
+ const BF & machine = mainMachine->getExecutable()->
+ getInstanceByDesign( aDesign ).getByNameID( obj );
+ if( machine.valid() )
+ {
+ return( machine );
+ }
+
+ }
+ }
+ else
+ {
+ const BF & machine =
+ getMachineByQualifiedNameID(aDesign, mid + "." + obj);
+ if( machine.valid() )
+ {
+ return( machine );
+ }
+ }
+ }
+ else
+ {
+ if( aQualifiedNameID.find('.') == std::string::npos )
+ {
+ const BF & machine = getMachineByNameID(aDesign, aQualifiedNameID);
+ if( machine.valid() )
+ {
+ return( machine );
+ }
+ }
+ else
+ {
+ const BF & machine =
+ getMachineByQualifiedNameID(aDesign, aQualifiedNameID);
+ if( machine.valid() )
+ {
+ return( machine );
+ }
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+/**
+ * SEARCH
+ * for Machine Instance Model
+ */
+const Symbol & ExecutableQuery::getInstanceModel(
+ const ObjectElement * astElement) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ const Symbol & foundElement =
+ (itExec)->getByAstInstanceModel( astElement );
+
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+const Symbol & ExecutableQuery::getSemInstanceModel(
+ const ExecutableForm * anExecutable,
+ const ObjectElement * astElement) const
+{
+ for( ; anExecutable != NULL ;
+ anExecutable = anExecutable->getExecutableContainer() )
+ {
+ const Symbol & foundInstance =
+ anExecutable->getByAstInstanceModel( astElement );
+ if( foundInstance.valid() && foundInstance.machine().isnotThis() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ return( getInstanceModel( astElement ) );
+}
+
+
+/**
+ * SEARCH
+ * for Machine Instance Static
+ */
+const Symbol & ExecutableQuery::getInstanceStatic(
+ const ObjectElement * astElement) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ const Symbol & foundElement =
+ (itExec)->getByAstInstanceStatic( astElement );
+
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+const Symbol & ExecutableQuery::getSemInstanceStatic(
+ const ExecutableForm * anExecutable,
+ const ObjectElement * astElement) const
+{
+ for( ; anExecutable != NULL ;
+ anExecutable = anExecutable->getExecutableContainer() )
+ {
+ const Symbol & foundInstance =
+ anExecutable->getByAstInstanceStatic( astElement );
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ return( getInstanceStatic( astElement ) );
+}
+
+
+/**
+ * SEARCH
+ * for Machine Instance Dynamic
+ */
+const Symbol & ExecutableQuery::getInstanceDynamic(
+ const ObjectElement * astElement) const
+{
+ // REVERSE because machines are insert after children
+ const_exec_iterator itExec = getSystem().getExecutables().begin();
+ const_exec_iterator endExec = getSystem().getExecutables().end();
+ for( ; itExec != endExec ; ++itExec )
+ {
+ const Symbol & foundElement =
+ (itExec)->getByAstInstanceDynamic( astElement );
+
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+const Symbol & ExecutableQuery::getSemInstanceDynamic(
+ const ExecutableForm * anExecutable,
+ const ObjectElement * astElement) const
+{
+ for( ; anExecutable != NULL ; anExecutable = anExecutable->getExecutableContainer() )
+ {
+ const Symbol & foundInstance =
+ anExecutable->getByAstInstanceDynamic( astElement );
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ return( getInstanceDynamic( astElement ) );
+}
+
+
+/**
+ * SEARCH
+ * any Instance
+ */
+const BF & ExecutableQuery::getInstanceByAstElement(
+ const ObjectElement * astElement) const
+{
+ if( getSystem().rawSystemInstance()->isAstElement( astElement ) )
+ {
+ return( getSystem().getSystemInstance() );
+ }
+
+ {
+ const BF & foundElement = getDataByAstElement(astElement);
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+ {
+ const Symbol & foundElement = getPortByAstElement(astElement);
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+ {
+ const Symbol & foundElement = getMachineByAstElement(
+ Specifier::DESIGN_INSTANCE_KIND, astElement);
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+ {
+ const Symbol & foundElement = getBufferByAstElement(astElement);
+ if( foundElement.valid() )
+ {
+ return( foundElement );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/executable/ExecutableQuery.h b/org.eclipse.efm.symbex/src/fml/executable/ExecutableQuery.h
new file mode 100644
index 0000000..7ad0c6a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/ExecutableQuery.h
@@ -0,0 +1,303 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 8 mars 2017
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef FML_EXECUTABLE_EXECUTABLEQUERY_H_
+#define FML_EXECUTABLE_EXECUTABLEQUERY_H_
+
+#include <fml/common/ModifierElement.h>
+#include <fml/common/SpecifierElement.h>
+
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/ExecutableSystem.h>
+
+#include <sew/Configuration.h>
+
+
+namespace sep
+{
+
+class BF;
+class ObjectElement;
+class Symbol;
+
+
+class ExecutableQuery
+{
+
+protected:
+ /**
+ * TYPEDEF
+ */
+ typedef TableOfExecutableForm::const_raw_iterator const_exec_iterator;
+
+ /**
+ * ATTRIBUTES
+ */
+ const Configuration & mConfiguration;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ */
+ ExecutableQuery(const Configuration & aConfiguration)
+ : mConfiguration( aConfiguration )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ExecutableQuery()
+ {
+ //!! NOTHING
+ }
+
+
+ /*
+ * GETTER
+ * the Executable System
+ */
+ inline const ExecutableSystem & getSystem() const
+ {
+ return( mConfiguration.getExecutableSystem() );
+ }
+
+
+ /**
+ * SEARCH
+ * ExecutableForm
+ */
+ inline const BF & getExecutable(
+ const std::string & aFullyQualifiedNameID) const
+ {
+ return( getSystem().getExecutables().getByFQNameID(
+ aFullyQualifiedNameID ) );
+ }
+
+
+ inline const BF & getExecutableByQualifiedNameID(
+ const std::string & aQualifiedNameID) const
+ {
+ return( getSystem().getExecutables().
+ getByQualifiedNameID(aQualifiedNameID) );
+ }
+
+
+ /**
+ * GETTER
+ * List of all RUNTIME Executable Element
+ */
+ inline void getRuntimeExecutable(
+ Collection< ExecutableForm * > & listOfExecutable)
+ {
+ listOfExecutable.append(
+ getSystem().rawSystemInstance()->getExecutable() );
+
+ getRuntimeExecutable(getSystem().rawSystemInstance(), listOfExecutable);
+ }
+
+ void getRuntimeExecutable(InstanceOfMachine * aMachine,
+ Collection< ExecutableForm * > & listOfExecutable);
+
+
+ /**
+ * SEARCH
+ * AvmTransition
+ */
+ const BF & getTransitionByAstElement(
+ const ObjectElement * astElement) const;
+
+ const BF & getTransition(const std::string & aFullyQualifiedNameID) const;
+
+ const BF & getTransitionByNameID(const std::string & aNameID) const;
+
+ const BF & getTransitionByQualifiedNameID(
+ const std::string & aQualifiedNameID) const;
+
+
+ /**
+ * SEARCH
+ * AvmProgram
+ */
+ const BF & getProgram(const std::string & aFullyQualifiedNameID) const;
+
+
+ /**
+ * SEARCH
+ * AvmProgram
+ * ExecutableForm
+ */
+ const BF & getExecutableOrProgram(
+ const std::string & aFullyQualifiedNameID) const;
+
+ // Getter by AST-Element
+ const BF & getExecutableOrProgram(const ObjectElement * astElement) const;
+
+
+ /**
+ * SEARCH
+ * InstanceOfBuffer
+ */
+ const Symbol & getBuffer(const std::string & aFullyQualifiedNameID) const;
+
+ const Symbol & getBufferByNameID(const std::string & aNameID) const;
+
+ const Symbol & getBufferByQualifiedNameID(
+ const std::string & aQualifiedNameID) const;
+
+ const Symbol & getBufferByAstElement(
+ const ObjectElement * astElement) const;
+
+
+ /**
+ * SEARCH
+ * InstanceOfData
+ */
+ const BF & getDataByNameID(const std::string & aNameID) const;
+ const BF & getDataByQualifiedNameID(
+ const std::string & aQualifiedNameID) const;
+
+ const BF & getData(const std::string & aFullyQualifiedNameID) const;
+ const BF & getDataByAstElement(const ObjectElement * astElement) const;
+
+
+ /**
+ * SEARCH
+ * Symbol as InstanceOfPort
+ * by ID
+ */
+ const Symbol & getPortByNameID(const std::string & aNameID,
+ Modifier::DIRECTION_KIND direction) const;
+
+ const Symbol & getPortByNameID(const std::string & aNameID) const;
+
+ avm_size_t getPortByNameID(
+ const std::string & aNameID, ListOfSymbol & listofPort,
+ Modifier::DIRECTION_KIND direction, bool isStrongly = true) const;
+
+ avm_size_t getPortByNameID(
+ const std::string & aNameID, ListOfSymbol & listofPort) const;
+
+
+ /**
+ * SEARCH
+ * Symbol as InstanceOfPort
+ * by [ [ FULLY ] QUALIFIED ] NAME ID
+ */
+ const Symbol & getPortByQualifiedNameID(
+ const std::string & aQualifiedNameID,
+ Modifier::DIRECTION_KIND direction,bool isStrongly = true) const;
+
+ avm_size_t getPortByQualifiedNameID(
+ const std::string & aQualifiedNameID, ListOfSymbol & listofPort,
+ Modifier::DIRECTION_KIND direction, bool isStrongly = true) const;
+
+ avm_size_t getPortByQualifiedNameID(
+ const std::string & aQualifiedNameID,
+ ListOfSymbol & listofPort) const;
+
+
+ const Symbol & getPort(const std::string & aFullyQualifiedNameID) const;
+
+ static const Symbol & getSemPort(const ExecutableForm * anExecutable,
+ const std::string & aFullyQualifiedNameID);
+
+ const Symbol & getPortByAstElement(const ObjectElement * astElement) const;
+
+ static const Symbol & getSemPortByAstElement(
+ const ExecutableForm * anExecutable,
+ const ObjectElement * astElement);
+
+
+ /**
+ * SEARCH
+ * InstanceOfChannel
+ */
+ const Symbol & getChannel(const ObjectElement * astElement) const;
+
+
+ /**
+ * SEARCH
+ * InstanceOfMachine
+ */
+ const Symbol & getMachine(Specifier::DESIGN_KIND aDesign,
+ const std::string & aFullyQualifiedNameID) const;
+
+ const Symbol & getMachineByNameID(Specifier::DESIGN_KIND aDesign,
+ const std::string & aNameID) const;
+
+ const Symbol & getMachineByQualifiedNameID(Specifier::DESIGN_KIND aDesign,
+ const std::string & aQualifiedNameID) const;
+
+ InstanceOfMachine * rawMachineByNameID(
+ Specifier::DESIGN_KIND aDesign, const std::string & aNameID) const;
+
+ InstanceOfMachine * rawMachineByQualifiedNameID(
+ Specifier::DESIGN_KIND aDesign,
+ const std::string & aQualifiedNameID) const;
+
+ const Symbol & getMachineByAstElement(Specifier::DESIGN_KIND aDesign,
+ const ObjectElement * astElement) const;
+
+ const BF & searchMachine(
+ Specifier::DESIGN_KIND aDesign,
+ const std::string & aQualifiedNameID);
+
+
+ /**
+ * SEARCH
+ * for Machine Instance Model
+ */
+ const Symbol & getInstanceModel(const ObjectElement * astElement) const;
+
+ const Symbol & getSemInstanceModel(
+ const ExecutableForm * anExecutable,
+ const ObjectElement * astElement) const;
+
+ /**
+ * SEARCH
+ * for Machine Instance Static
+ */
+ const Symbol & getInstanceStatic(const ObjectElement * astElement) const;
+
+ const Symbol & getSemInstanceStatic(
+ const ExecutableForm * anExecutable,
+ const ObjectElement * astElement) const;
+
+ /**
+ * SEARCH
+ * for Machine Instance Dynamic
+ */
+ const Symbol & getInstanceDynamic(const ObjectElement * astElement) const;
+
+ const Symbol & getSemInstanceDynamic(
+ const ExecutableForm * anExecutable,
+ const ObjectElement * astElement) const;
+
+
+ /**
+ * SEARCH
+ * any Instance
+ */
+ const BF & getInstanceByAstElement(const ObjectElement * astElement) const;
+
+};
+
+
+} /* namespace sep */
+
+#endif /* FML_EXECUTABLE_EXECUTABLEQUERY_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/executable/ExecutableSystem.cpp b/org.eclipse.efm.symbex/src/fml/executable/ExecutableSystem.cpp
new file mode 100644
index 0000000..427d812
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/ExecutableSystem.cpp
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ExecutableSystem.h"
+
+#include <fml/common/ModifierElement.h>
+
+#include <fml/executable/BaseInstanceForm.h>
+#include <fml/executable/ExecutableQuery.h>
+#include <fml/executable/InstanceOfData.h>
+#include <fml/executable/InstanceOfPort.h>
+
+#include <fml/workflow/UniFormIdentifier.h>
+
+
+namespace sep
+{
+
+
+/**
+ * SETTER
+ * updateFullyQualifiedNameID()
+ */
+void ExecutableSystem::updateFullyQualifiedNameID()
+{
+ if( hasAstElement() )
+ {
+ std::string aFullyQualifiedNameID = getAstFullyQualifiedNameID();
+
+ setAllNameID("sys" + aFullyQualifiedNameID.substr(
+ aFullyQualifiedNameID.find(FQN_ID_ROOT_SEPARATOR) ) ,
+ NamedElement::extractNameID( aFullyQualifiedNameID ));
+ }
+ else
+ {
+ setAllNameID( "sys#anonym" , "sys#anonym" );
+ }
+}
+
+
+/**
+ * Serialization
+ */
+void ExecutableSystem::strHeader(OutStream & os) const
+{
+ os << getModifier().toString() << "system";
+ if( hasSystemInstance() )
+ {
+ os << TAB << "< moc: " << getSpecifier().str() << " >";
+ }
+ os << " " << getNameID();
+}
+
+
+void ExecutableSystem::toStream(OutStream & os) const
+{
+ os << TAB << "xfsp< executable , 1.0 >:" << EOL2;
+
+
+ os << TAB << "// " << getModifier().toString()
+ << getSpecifier().toString( Specifier::ENABLE_FEATURE_DESIGN_FIELD )
+ << "system< moc: "
+ << getSpecifier().str( Specifier::DISABLE_FEATURE_DESIGN_FIELD )
+ << " > " << getNameID() << " {" << EOL;
+
+ os << TAB << "header:" << EOL<< TAB2
+ << "fqn_id = " << getFullyQualifiedNameID()
+ << EOL_TAB2
+ << "description = \"the result of the system compilation\""
+ << EOL_TAB2
+ << "count = " << getMachineCount() << EOL;
+
+ if( hasSystemInstance() )
+ {
+ os << EOL_TAB << "instance:"
+ << EOL_INCR_INDENT << TAB
+ << "// The Parameters Machine Instance" << EOL;
+ mParametersInstance.toStream(os);
+
+ os << EOL_TAB << "// The System Machine Instance" << EOL;
+ rawSystemInstance()->toStream(os);
+ os << DECR_INDENT;
+ }
+
+ os << EOL_TAB << "executable:" << EOL_INCR_INDENT;
+
+ mParametersExecutable.toStream(os);
+
+ TableOfExecutableForm::const_raw_iterator itExec = mExecutables.begin();
+ for( ; itExec != mExecutables.end() ; ++itExec )
+ {
+ os << EOL;
+ (itExec)->toStream(os);
+ }
+
+ os << EOL_DECR_INDENT << "// " << TAB << "}" << EOL_FLUSH;
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/executable/ExecutableSystem.h b/org.eclipse.efm.symbex/src/fml/executable/ExecutableSystem.h
new file mode 100644
index 0000000..89b0ab0
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/ExecutableSystem.h
@@ -0,0 +1,288 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef EXECUTABLESYSTEM_H_
+#define EXECUTABLESYSTEM_H_
+
+#include <common/AvmPointer.h>
+
+#include <fml/executable/BaseCompiledForm.h>
+
+#include <collection/Typedef.h>
+
+#include <fml/common/SpecifierElement.h>
+
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/ExecutableLib.h>
+#include <fml/executable/InstanceOfMachine.h>
+#include <fml/executable/InstanceOfPort.h>
+
+#include <fml/symbol/Symbol.h>
+
+#include <fml/runtime/RuntimeForm.h>
+#include <fml/runtime/RuntimeID.h>
+
+
+
+namespace sep
+{
+
+
+class AvmCode;
+
+class ObjectElement;
+
+class System;
+
+
+class ExecutableSystem :
+ public BaseCompiledForm ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ExecutableSystem )
+
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( ExecutableSystem )
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ TableOfExecutableForm mExecutables;
+
+ ExecutableForm mNullExecutable;
+ Symbol mNullInstance;
+
+ ExecutableForm mParametersExecutable;
+ InstanceOfMachine mParametersInstance;
+
+ Symbol mSystemInstance;
+
+ ExecutableForm * mDefaultProcessExecutableForm;
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ExecutableSystem(System & astSystem)
+ : BaseCompiledForm( CLASS_KIND_T( ExecutableSystem ) , NULL, &astSystem ),
+ mExecutables( ),
+
+ mNullExecutable( *this , 0 ),
+ mNullInstance( new InstanceOfMachine(
+ &mNullExecutable, NULL, &mNullExecutable, NULL, 0,
+ Specifier::DESIGN_INSTANCE_STATIC_SPECIFIER) ),
+
+ mParametersExecutable( *this, NULL, &astSystem, 0 ),
+ mParametersInstance( NULL, &astSystem, &mParametersExecutable, NULL, 0 ),
+
+ mSystemInstance( ),
+ mDefaultProcessExecutableForm( NULL )
+ {
+ mNullInstance.machine().setInstanceModel(mNullInstance.rawMachine());
+
+ ExecutableLib::MACHINE_NULL.setExecutable( &mNullExecutable );
+
+ mParametersExecutable.incrPossibleStaticInstanciationCount(1);
+ mParametersExecutable.setAllNameID("exec::#PARAMETERS#" , "#PARAMETERS#");
+
+ mParametersInstance.setAllNameID("inst::#PARAMETERS#" , "#PARAMETERS#");
+
+ updateFullyQualifiedNameID();
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ ExecutableSystem(const ExecutableSystem & anExecutable)
+ : BaseCompiledForm( anExecutable ),
+ mExecutables( anExecutable.mExecutables ),
+
+ mNullExecutable( anExecutable.mNullExecutable ),
+ mNullInstance( anExecutable.mNullInstance ),
+
+ mParametersExecutable( anExecutable.mParametersExecutable ),
+ mParametersInstance( anExecutable.mParametersInstance ),
+
+ mSystemInstance( anExecutable.mSystemInstance ),
+ mDefaultProcessExecutableForm(
+ (anExecutable.mDefaultProcessExecutableForm == NULL) ? NULL :
+ new ExecutableForm( *(anExecutable.mDefaultProcessExecutableForm) ) )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ExecutableSystem()
+ {
+ if( mDefaultProcessExecutableForm != NULL )
+ {
+ delete( mDefaultProcessExecutableForm );
+ }
+ }
+
+
+ /**
+ * SETTER
+ * updateFullyQualifiedNameID()
+ */
+ virtual void updateFullyQualifiedNameID();
+
+
+ /**
+ * GETTER API
+ * Specifier
+ */
+ const Specifier & getSpecifier() const
+ {
+ return( rawSystemInstance()->getExecutable()->getSpecifier() );
+ }
+
+
+ /**
+ * GETTER
+ * TableOfExecutableForm
+ */
+ inline const TableOfExecutableForm & getExecutables() const
+ {
+ return( mExecutables );
+ }
+
+
+ inline avm_size_t size() const
+ {
+ return( mExecutables.size() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mExecutableForm
+ */
+// inline ExecutableForm & newExecutable(ExecutableForm * aContainer,
+// const ObjectElement * aCompiled, avm_size_t aDataSize = 0)
+// {
+// mExecutables.push_front(
+// ExecutableForm(aContainer, aCompiled, aDataSize) );
+//
+// ExecutableForm & newExec = mExecutables.front();
+//
+// newExec.setOffset( size() - 1 );
+//
+// return( newExec );
+// }
+
+ inline const BF & saveExecutable(ExecutableForm * anExecutableForm)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( anExecutableForm )
+ << "ExecutableForm !!!"
+ << SEND_EXIT;
+
+ anExecutableForm->setOffset( mExecutables.size() );
+
+ return( mExecutables.save( anExecutableForm ) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mParametersInstance
+ */
+ inline const InstanceOfMachine * rawParametersInstance() const
+ {
+ return( & mParametersInstance );
+ }
+
+ inline InstanceOfMachine * rawParametersInstance()
+ {
+ return( & mParametersInstance );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mSystemInstance
+ */
+ inline InstanceOfMachine * rawSystemInstance() const
+ {
+ return( mSystemInstance.rawMachine() );
+ }
+
+ inline const Symbol & getSystemInstance() const
+ {
+ return( mSystemInstance );
+ }
+
+ inline bool hasSystemInstance() const
+ {
+ return( mSystemInstance.valid() );
+ }
+
+ inline const Symbol & setSystemInstance(InstanceOfMachine * anInstance)
+ {
+ mSystemInstance.renew( anInstance );
+
+ return( mSystemInstance );
+ }
+
+
+ /**
+ * mDefaultProcessExecutableForm
+ */
+ inline ExecutableForm * defaultExecutableForm()
+ {
+ if( mDefaultProcessExecutableForm != NULL )
+ {
+ mDefaultProcessExecutableForm = new ExecutableForm( *this , 0 );
+ }
+ return( mDefaultProcessExecutableForm );
+ }
+
+ /**
+ * NEW TMP EXECUTABLE
+ */
+ inline void initProcessExecutableForm(
+ ExecutableForm & anExecutableForm, avm_size_t aDataSize = 0) const
+ {
+ anExecutableForm.init(
+ rawSystemInstance()->getExecutable(), aDataSize);
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * Machine Count
+ */
+ inline avm_size_t getMachineCount() const
+ {
+ return( rawSystemInstance()->getExecutable()->getrecMachineCount() +1 );
+ }
+
+
+ /**
+ * Serialization
+ */
+ void strHeader(OutStream & os) const;
+
+ virtual void toStream(OutStream & os) const;
+
+};
+
+
+}
+
+#endif /*EXECUTABLESYSTEM_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/executable/InstanceOfBuffer.cpp b/org.eclipse.efm.symbex/src/fml/executable/InstanceOfBuffer.cpp
new file mode 100644
index 0000000..fdbcd07
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/InstanceOfBuffer.cpp
@@ -0,0 +1,172 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 21 mars 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "InstanceOfBuffer.h"
+
+#include <fml/common/ObjectElement.h>
+
+#include <fml/executable/ExecutableForm.h>
+
+#include <fml/infrastructure/Buffer.h>
+
+#include <fml/runtime/RuntimeID.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+#include <fml/type/TypeManager.h>
+
+#include <fml/infrastructure/Buffer.h>
+
+
+namespace sep
+{
+
+
+static const TypeSpecifier & getSpecifierType(
+ BaseAvmProgram * aContainer, Buffer * aBuffer)
+{
+// TypeSpecifier bfTS( TypeManager::newCollection(
+// aBuffer, aBuffer->getPolicySpecifierKind(),
+// TypeManager::UNIVERSAL, aBuffer->getCapacity()) );
+//
+// return( bfTS );
+
+ return( TypeManager::BUFFER );
+}
+
+static const TypeSpecifier & getSpecifierType(BaseAvmProgram * aContainer,
+ avm_type_specifier_kind_t aSpecifierKind, avm_size_t aCapacity)
+{
+// TypeSpecifier bfTS( TypeManager::newCollection(DataType::BUFFER,
+// aSpecifierKind, TypeManager::UNIVERSAL, aCapacity) );
+//
+// return( bfTS );
+
+ return( TypeManager::BUFFER );
+}
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+InstanceOfBuffer::InstanceOfBuffer(
+ BaseAvmProgram * aContainer, Buffer * aBuffer, avm_offset_t anOffset)
+: BaseInstanceForm(CLASS_KIND_T( InstanceOfBuffer ), aContainer, aBuffer,
+ getSpecifierType(aContainer, aBuffer), anOffset),
+mPolicySpecifierKind( aBuffer->getPolicySpecifierKind() ),
+mCapacity( aBuffer->getCapacity() )
+{
+
+}
+
+
+InstanceOfBuffer::InstanceOfBuffer( BaseAvmProgram * aContainer,
+ Buffer * aCompiled, avm_offset_t anOffset,
+ avm_type_specifier_kind_t aSpecifierKind, long aCapacity)
+: BaseInstanceForm(CLASS_KIND_T( InstanceOfBuffer ), aContainer, aCompiled,
+ getSpecifierType(aContainer, aSpecifierKind, aCapacity), anOffset),
+mPolicySpecifierKind( aSpecifierKind ),
+mCapacity( (aCapacity < 0) ? AVM_NUMERIC_MAX_SIZE_T : aCapacity )
+{
+ //!! NOTHING
+}
+
+
+/**
+ * Serialization
+ */
+void InstanceOfBuffer::strHeader(OutStream & out) const
+{
+ out << "buffer< id:" << getOffset() << " > "
+ << Buffer::str(mPolicySpecifierKind, realCapacity()) << " "
+ << getFullyQualifiedNameID();
+}
+
+
+void InstanceOfBuffer::toStream(OutStream & out) const
+{
+ if( out.preferablyFQN() )
+ {
+ out << TAB << getFullyQualifiedNameID();
+
+ AVM_DEBUG_REF_COUNTER(out);
+
+ return;
+ }
+
+ bool isEmpty = true;
+
+ out << TAB << getModifier().toString()
+ << "buffer< id:" << getOffset() << " > "
+ << Buffer::str(mPolicySpecifierKind, realCapacity())
+ << " " << getFullyQualifiedNameID();
+ AVM_DEBUG_REF_COUNTER(out);
+
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ out << " {" << EOL; isEmpty = false;
+
+ if( hasAstElement() )
+ {
+ out << TAB2 << "//compiled = "
+ << getAstFullyQualifiedNameID() << ";" << EOL;
+ }
+
+ out << TAB2 << "//container = "
+ << (hasContainer() ? getContainer()->getFullyQualifiedNameID() : "NULL")
+ << ";" << EOL;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ if( hasAliasTarget() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+ out << TAB2 << "target = "
+ << str_header( getAliasTarget()->as< InstanceOfBuffer >() )
+ << ";" << EOL;
+ }
+
+ if( hasCreatorContainerRID() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+ out << TAB2 << "rid#creator = " << getCreatorContainerRID().str()
+ << ";" << EOL;
+ }
+
+ if( hasRuntimeContainerRID() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+ out << TAB2 << "rid#container = " << getRuntimeContainerRID().str()
+ << ";" << EOL;
+ }
+
+ if( hasMachinePath() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+
+ out << TAB << "path#machine:" << EOL;
+ ArrayOfInstanceOfMachine::const_iterator it = getMachinePath()->begin();
+ ArrayOfInstanceOfMachine::const_iterator endIt = getMachinePath()->end();
+ for( ; it != endIt ; ++it )
+ {
+ out << TAB2 << (*it)->getFullyQualifiedNameID() << EOL;
+ }
+ }
+
+ ( isEmpty ? (out << ";") : (out << TAB << "}") ) << EOL_FLUSH;
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/executable/InstanceOfBuffer.h b/org.eclipse.efm.symbex/src/fml/executable/InstanceOfBuffer.h
new file mode 100644
index 0000000..a859225
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/InstanceOfBuffer.h
@@ -0,0 +1,158 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 21 mars 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef INSTANCEOFBUFFER_H_
+#define INSTANCEOFBUFFER_H_
+
+#include <fml/executable/BaseInstanceForm.h>
+
+#include <common/AvmPointer.h>
+
+#include <fml/lib/ITypeSpecifier.h>
+
+
+namespace sep
+{
+
+class BaseAvmProgram;
+class Buffer;
+
+
+class InstanceOfBuffer :
+ public BaseInstanceForm,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( InstanceOfBuffer )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( InstanceOfBuffer )
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ avm_type_specifier_kind_t mPolicySpecifierKind;
+
+ avm_size_t mCapacity;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ InstanceOfBuffer(BaseAvmProgram * aContainer,
+ Buffer * aBuffer, avm_offset_t anOffset);
+
+ InstanceOfBuffer(BaseAvmProgram * aContainer, Buffer * aCompiled,
+ avm_offset_t anOffset, avm_type_specifier_kind_t aSpecifierKind,
+ long aCapacity);
+
+ /**
+ * CONSTRUCTOR
+ * copy
+ */
+ InstanceOfBuffer(const InstanceOfBuffer & aBuffer)
+ : BaseInstanceForm( aBuffer ),
+ mPolicySpecifierKind( aBuffer.mPolicySpecifierKind ),
+ mCapacity( aBuffer.mCapacity )
+ {
+ //!! NOTHING
+ }
+
+
+
+
+ /**
+ * CONSTRUCTOR
+ * for Alias
+ */
+ InstanceOfBuffer(BaseAvmProgram * aContainer, InstanceOfBuffer * aTarget,
+ VectorOfInstanceOfMachine & aRelativeMachinePath)
+ : BaseInstanceForm(CLASS_KIND_T( InstanceOfBuffer ),
+ aContainer, aTarget, aRelativeMachinePath),
+ mPolicySpecifierKind( aTarget->mPolicySpecifierKind ),
+ mCapacity( aTarget->mCapacity )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~InstanceOfBuffer()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mPolicySpecifierKind
+ */
+ inline avm_type_specifier_kind_t getPolicySpecifierKind() const
+ {
+ return( mPolicySpecifierKind );
+ }
+
+ inline void setPolicySpecifierKind(avm_type_specifier_kind_t aSpecifierKind)
+ {
+ mPolicySpecifierKind = aSpecifierKind;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mCapacity
+ */
+ inline avm_size_t capacity() const
+ {
+ return( mCapacity );
+ }
+
+ inline long realCapacity() const
+ {
+ return( (mCapacity == AVM_NUMERIC_MAX_SIZE_T)? -1 : mCapacity );
+ }
+
+ inline void setCapacity(long aCapacity)
+ {
+ mCapacity = (aCapacity < 0) ? AVM_NUMERIC_MAX_SIZE_T : aCapacity;
+ }
+
+ inline bool isFinite() const
+ {
+ return( mCapacity < AVM_NUMERIC_MAX_SIZE_T );
+ }
+
+ inline bool isInfinite() const
+ {
+ return( mCapacity == AVM_NUMERIC_MAX_SIZE_T );
+ }
+
+
+ /**
+ * Serialization
+ */
+ void strHeader(OutStream & out) const;
+
+ void toStream(OutStream & out) const;
+
+};
+
+
+}
+
+#endif /* INSTANCEOFBUFFER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/executable/InstanceOfConnect.cpp b/org.eclipse.efm.symbex/src/fml/executable/InstanceOfConnect.cpp
new file mode 100644
index 0000000..8590d5f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/InstanceOfConnect.cpp
@@ -0,0 +1,144 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 21 mars 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "InstanceOfConnect.h"
+
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/InstanceOfMachine.h>
+
+#include <fml/infrastructure/Connector.h>
+
+#include <fml/runtime/RuntimeID.h>
+
+#include <fml/type/TypeManager.h>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+InstanceOfConnect::InstanceOfConnect(BaseAvmProgram * aContainer,
+ const Connector * aConnector, avm_offset_t anOffset,
+ ComProtocol::PROTOCOL_KIND aProtocol, ComProtocol::PROTOCOL_KIND aCast)
+: BaseInstanceForm(CLASS_KIND_T( InstanceOfConnect ), aContainer, aConnector,
+ TypeManager::CONNECTOR, anOffset),
+mTransfertFlag( false ),
+
+mMID( 0 ),
+
+mProtocol( aProtocol ),
+mCast( aCast ),
+
+mOutputComRouteData( aConnector , Modifier::DIRECTION_OUTPUT_KIND ),
+mInputComRouteData ( aConnector , Modifier::DIRECTION_INPUT_KIND )
+{
+ //!! NOTHING
+}
+
+
+
+/**
+ * Serialization
+ */
+void InstanceOfConnect::strHeader(OutStream & out) const
+{
+ out << "connector< id:" << getOffset() << " , mid:" << getMID() << " > "
+ << Connector::strProtocol(mProtocol, mCast)
+ << " " << getFullyQualifiedNameID();
+}
+
+
+void InstanceOfConnect::toStream(OutStream & out) const
+{
+ if( out.preferablyFQN() )
+ {
+ out << TAB << getFullyQualifiedNameID();
+
+ AVM_DEBUG_REF_COUNTER(out);
+
+ return;
+ }
+
+ out << TAB << getModifier().toString() << "connector< id:" << getOffset()
+ << " , mid:" << getMID() << " , "
+ << Connector::strProtocol(mProtocol, mCast) << " > "
+ << getFullyQualifiedNameID();
+ AVM_DEBUG_REF_COUNTER(out);
+ out << " {" << EOL;
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ if( hasAstElement() )
+ {
+ out << TAB2 << "//compiled = "
+ << getAstFullyQualifiedNameID() << ";" << EOL;
+ }
+
+ out << TAB2 << "//container = "
+ << (hasContainer() ? getContainer()->getFullyQualifiedNameID() : "NULL")
+ << ";" << EOL;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ if( hasAliasTarget() )
+ {
+ out << TAB2 << "target = "
+ << str_header( getAliasTarget()->as< InstanceOfConnect >() )
+ << ";" << EOL;
+ }
+
+ if( hasCreatorContainerRID() )
+ {
+ out << TAB2 << "rid#creator = " << getCreatorContainerRID().str()
+ << ";" << EOL;
+ }
+
+ if( hasRuntimeContainerRID() )
+ {
+ out << TAB2 << "rid#container = " << getRuntimeContainerRID().str()
+ << ";" << EOL;
+ }
+
+ if( hasMachinePath() )
+ {
+ out << TAB << "path#machine:" << EOL;
+ ArrayOfInstanceOfMachine::const_iterator it = getMachinePath()->begin();
+ ArrayOfInstanceOfMachine::const_iterator endIt = getMachinePath()->end();
+ for( ; it != endIt ; ++it )
+ {
+ out << TAB2 << (*it)->getFullyQualifiedNameID() << EOL;
+ }
+ }
+
+ out << INCR_INDENT;
+
+ if( hasOutputComRouteData() )
+ {
+ getOutputComRouteData().toStream(out);
+ }
+
+ if( hasInputComRouteData() )
+ {
+ getInputComRouteData().toStream(out);
+ }
+
+ out << DECR_INDENT_TAB << "}" << EOL_FLUSH;
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/executable/InstanceOfConnect.h b/org.eclipse.efm.symbex/src/fml/executable/InstanceOfConnect.h
new file mode 100644
index 0000000..54bc6ed
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/InstanceOfConnect.h
@@ -0,0 +1,262 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 21 mars 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef INSTANCEOFCONNECT_H_
+#define INSTANCEOFCONNECT_H_
+
+#include <common/AvmPointer.h>
+
+#include <fml/executable/BaseInstanceForm.h>
+
+#include <collection/Typedef.h>
+
+#include <fml/lib/IComPoint.h>
+
+#include <fml/executable/ComRouteData.h>
+
+#include <fml/infrastructure/ComProtocol.h>
+#include <fml/infrastructure/Connector.h>
+
+
+namespace sep
+{
+
+
+class BaseAvmProgram;
+class Connector;
+
+
+class InstanceOfConnect :
+ public BaseInstanceForm ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( InstanceOfConnect )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( InstanceOfConnect )
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ // The Transfert Flag
+ bool mTransfertFlag;
+
+ // The Message IDentifier
+ avm_size_t mMID;
+
+ // global ComRoute protocol & cast
+ ComProtocol::PROTOCOL_KIND mProtocol;
+ ComProtocol::PROTOCOL_KIND mCast;
+
+ ComRouteData mOutputComRouteData;
+ ComRouteData mInputComRouteData;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ InstanceOfConnect(BaseAvmProgram * aContainer, const Connector * aConnector,
+ avm_offset_t anOffset, ComProtocol::PROTOCOL_KIND aProtocol,
+ ComProtocol::PROTOCOL_KIND aCast);
+
+
+ /**
+ * CONSTRUCTOR
+ * copy
+ */
+ InstanceOfConnect(const InstanceOfConnect & aConnect)
+ : BaseInstanceForm( aConnect ),
+ mTransfertFlag( aConnect.mTransfertFlag ),
+
+ mMID( aConnect.mMID ),
+
+ mProtocol( aConnect.mProtocol ),
+ mCast( aConnect.mCast ),
+
+ mOutputComRouteData( aConnect.mOutputComRouteData ),
+ mInputComRouteData( aConnect.mInputComRouteData )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * for Alias
+ */
+ InstanceOfConnect(BaseAvmProgram * aContainer, InstanceOfConnect * aTarget,
+ VectorOfInstanceOfMachine & aRelativeMachinePath)
+ : BaseInstanceForm(CLASS_KIND_T( InstanceOfConnect ),
+ aContainer, aTarget, aRelativeMachinePath),
+ mTransfertFlag( aTarget->mTransfertFlag ),
+
+ mMID( aTarget->mMID ),
+
+ mProtocol( aTarget->mProtocol ),
+ mCast( aTarget->mCast ),
+
+ mOutputComRouteData( aTarget->mOutputComRouteData ),
+ mInputComRouteData( aTarget->mInputComRouteData )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~InstanceOfConnect()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER
+ * Compiled ObjectElement as Compiled COnnector
+ */
+ inline const Connector * getAstConnector() const
+ {
+ return( getAstElement()->as< Connector >() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mMID
+ */
+ inline avm_size_t getMID() const
+ {
+ return( mMID );
+ }
+
+ inline void setMID(avm_size_t mid)
+ {
+ mMID = mid;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mProtocol
+ */
+ inline ComProtocol::PROTOCOL_KIND getProtocol() const
+ {
+ return( mProtocol );
+ }
+
+ inline bool hasProtocol() const
+ {
+ return( mProtocol != ComProtocol::PROTOCOL_UNDEFINED_KIND );
+ }
+
+ inline void setProtocol(ComProtocol::PROTOCOL_KIND aProtocol)
+ {
+ mProtocol = aProtocol;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mCast
+ */
+ inline ComProtocol::PROTOCOL_KIND getCast() const
+ {
+ return( mCast );
+ }
+
+ inline bool hasCast() const
+ {
+ return( mCast != ComProtocol::PROTOCOL_UNDEFINED_KIND );
+ }
+
+ inline void setCast(ComProtocol::PROTOCOL_KIND aCast)
+ {
+ mCast = aCast;
+ }
+
+ inline void setProtocolCast(ComProtocol::PROTOCOL_KIND aProtocol,
+ ComProtocol::PROTOCOL_KIND aCast)
+ {
+ mProtocol = aProtocol;
+ mCast = aCast;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mOutputComRouteData
+ */
+ inline ComRouteData & getOutputComRouteData()
+ {
+ return( mOutputComRouteData );
+ }
+
+ inline const ComRouteData & getOutputComRouteData() const
+ {
+ return( mOutputComRouteData );
+ }
+
+ inline bool hasOutputComRouteData() const
+ {
+ return( mOutputComRouteData.hasMachinePorts() );
+ }
+
+ inline void appendOutputComRouteData(PairMachinePort & aMachinePort)
+ {
+ mOutputComRouteData.appendMachinePort(aMachinePort);
+ }
+
+ /**
+ * GETTER - SETTER
+ * mInputComRouteData
+ */
+ inline ComRouteData & getInputComRouteData()
+ {
+ return( mInputComRouteData );
+ }
+
+ inline const ComRouteData & getInputComRouteData() const
+ {
+ return( mInputComRouteData );
+ }
+
+ inline bool hasInputComRouteData() const
+ {
+ return( mInputComRouteData.hasMachinePorts() );
+ }
+
+ inline void appendInputComRouteData(PairMachinePort & aMachinePort)
+ {
+ mInputComRouteData.appendMachinePort(aMachinePort);
+ }
+
+
+ /**
+ * Serialization
+ */
+ void strHeader(OutStream & out) const;
+
+ void toStream(OutStream & out) const;
+
+};
+
+
+}
+
+#endif /* INSTANCEOFCONNECT_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/executable/InstanceOfData.cpp b/org.eclipse.efm.symbex/src/fml/executable/InstanceOfData.cpp
new file mode 100644
index 0000000..8148221
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/InstanceOfData.cpp
@@ -0,0 +1,502 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 5 août 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "InstanceOfData.h"
+
+#include <fml/executable/AvmProgram.h>
+#include <fml/executable/BaseAvmProgram.h>
+#include <fml/executable/InstanceOfMachine.h>
+
+#include <fml/expression/BuiltinArray.h>
+#include <fml/expression/ExpressionFactory.h>
+
+#include <fml/symbol/TableOfSymbol.h>
+
+#include <fml/runtime/RuntimeID.h>
+
+#include <fml/type/ContainerTypeSpecifier.h>
+#include <fml/type/EnumTypeSpecifier.h>
+
+
+namespace sep
+{
+
+
+/**
+ * DEFAULT
+ * Empty TableOfSymbol
+ */
+TableOfSymbol InstanceOfData::NULL_TABLE_OF_SYMBOL(0);
+
+
+/**
+ * SETTER
+ * updateFullyQualifiedNameID()
+ */
+void InstanceOfData::updateFullyQualifiedNameID()
+{
+ if( hasAstElement() )
+ {
+ std::string aFullyQualifiedNameID = getAstFullyQualifiedNameID();
+
+ std::string::size_type pos =
+ aFullyQualifiedNameID.find(FQN_ID_ROOT_SEPARATOR);
+ if( pos != std::string::npos )
+ {
+ setFullyQualifiedNameID( (getModifier().hasFeatureConst() ?
+ "const" : "inst") + aFullyQualifiedNameID.substr(pos) );
+ }
+ else
+ {
+ setFullyQualifiedNameID( aFullyQualifiedNameID );
+ }
+ }
+ else if( isTypedEnum() )
+ {
+ std::string aFullyQualifiedNameID = getFullyQualifiedNameID();
+
+ std::string::size_type pos =
+ aFullyQualifiedNameID.find(FQN_ID_ROOT_SEPARATOR);
+
+ if( pos != std::string::npos )
+ {
+ setFullyQualifiedNameID( "enum" + aFullyQualifiedNameID.substr(pos) );
+ }
+ }
+ else
+ {
+ setFullyQualifiedNameID("");
+ }
+
+ updateNameID();
+}
+
+
+/**
+ * GETTER - SETTER
+ * The Identifier
+ */
+void InstanceOfData::updateNameID()
+{
+ if( hasParent() )
+ {
+ std::string ufiSuffix =
+ NamedElement::extractNameID( mFullyQualifiedNameID );
+
+ if( getParent()->getTypeSpecifier()->isTypedArray() )
+ {
+ InstanceOfData * aParent = getParent();
+ while( (aParent != NULL) &&
+ aParent->getTypeSpecifier()->isTypedArray() )
+ {
+ aParent = aParent->getParent();
+ }
+
+ if( aParent != NULL )
+ {
+ setNameID( aParent->getNameID() + "." + ufiSuffix );
+ }
+ else
+ {
+ setNameID( ufiSuffix );
+ }
+ }
+ else
+ {
+ setNameID( getParent()->getNameID() + "." + ufiSuffix );
+ }
+ }
+ else if( hasDataPath() )
+ {
+ std::ostringstream oss;
+
+ TableOfSymbol::const_iterator it = getDataPath()->begin();
+ TableOfSymbol::const_iterator itEnd = getDataPath()->end();
+ for( ; it != itEnd ; ++it )
+ {
+ switch( (*it).getPointerNature() )
+ {
+ case IPointerDataNature::POINTER_FIELD_CLASS_ATTRIBUTE_NATURE:
+ case IPointerDataNature::POINTER_FIELD_CHOICE_ATTRIBUTE_NATURE:
+ case IPointerDataNature::POINTER_FIELD_UNION_ATTRIBUTE_NATURE:
+ {
+ oss << "." << NamedElement::extractNameID( (*it).getFullyQualifiedNameID() );
+ break;
+ }
+ case IPointerDataNature::POINTER_FIELD_ARRAY_OFFSET_NATURE:
+ {
+ oss << "[" << (*it).getOffset() << "]";
+ break;
+ }
+ case IPointerDataNature::POINTER_FIELD_ARRAY_INDEX_NATURE:
+ {
+ oss << "[" << (*it).strValue() << "]";
+ break;
+ }
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "InstanceOfData::updateNameID:> Unexpected "
+ "POINTER NATURE for the instance of data :>\n"
+ << (*it).toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+ break;
+ }
+ }
+ }
+ setNameID( oss.str() );
+ }
+ else
+ {
+ BaseInstanceForm::updateNameID();
+ }
+}
+
+
+/**
+ * GETTER
+ * mOnWriteRoutine
+ */
+const BFCode & InstanceOfData::getOnWriteCode() const
+{
+ return( (mOnWriteRoutine != NULL) ?
+ mOnWriteRoutine->getCode() : BFCode::REF_NULL );
+}
+
+
+/**
+ * GETTER - SETTER
+ * mValue
+ */
+ArrayBF * InstanceOfData::getArrayValue() const
+{
+ return( mValue.as_ptr< ArrayBF >() );
+}
+
+bool InstanceOfData::hasArrayValue() const
+{
+ return( mValue.is< ArrayBF >() );
+}
+
+
+BuiltinArray * InstanceOfData::getBuiltinArrayValue() const
+{
+ return( mValue.as_ptr< BuiltinArray >() );
+}
+
+bool InstanceOfData::hasBuiltinArrayValue() const
+{
+ return( mValue.is< BuiltinArray >() );
+}
+
+
+/**
+ * GETTER - SETTER
+ * mRelativeOffsetPath
+ */
+std::string InstanceOfData::strOffsetPath(const std::string & tab) const
+{
+ if( hasDataPath() )
+ {
+ std::ostringstream oss;
+
+ // +1 for << this >> which is the root of the path
+ avm_size_t pathLength = mRelativeDataPath->size() + 1;
+
+ oss << tab << "[ " << mRelativeOffsetPath[0];
+ for( avm_size_t k = 1 ; k < pathLength ; ++k )
+ {
+ oss << " , " << mRelativeOffsetPath[k];
+ }
+ oss << " ]";
+
+ return( oss.str() );
+ }
+
+ return( "" );
+}
+
+void InstanceOfData::updateOffsetPath()
+{
+ if( isUfiOffsetPointer() && hasDataPath() )
+ {
+ // +1 for << this >> which is the root of the path
+ avm_size_t pathLength = mRelativeDataPath->size() + 1;
+
+ mRelativeOffsetPath = new avm_size_t[ pathLength ];
+
+ mRelativeOffsetPath[0] = this->getOffset();
+ TableOfSymbol::const_iterator itPath = getDataPath()->begin();
+ for( avm_size_t k = 1 ; k < pathLength ; ++k, ++itPath )
+ {
+ mRelativeOffsetPath[k] = (*itPath).getOffset();
+ }
+ }
+}
+
+
+/**
+ * GETTER - SETTER
+ * mPointerNature
+ */
+bool InstanceOfData::isConcreteArrayIndex()
+{
+ return( isUfiOffsetPointer() && hasParent()
+ && getParent()->isTypedArray() );
+}
+
+bool InstanceOfData::isConcreteStructAttribute()
+{
+ return( hasParent() && isUfiOffsetPointer()
+ && getParent()->hasTypeStructureOrChoiceOrUnion() );
+}
+
+
+/**
+ * Format a value w.r.t. its type
+ */
+void InstanceOfData::formatStream(
+ OutStream & out, const BF & bfValue) const
+{
+ if( bfValue.is< ArrayBF >() )
+ {
+ formatStream(out, bfValue.as_ref< ArrayBF >());
+ }
+ else if( hasTypeSpecifier() )
+ {
+ getTypeSpecifier()->formatStream(out, bfValue);
+ }
+ else
+ {
+ out << bfValue.str();
+ }
+}
+
+
+void InstanceOfData::formatStream(
+ OutStream & out, const ArrayBF & arrayValue) const
+{
+ if( hasTypeSpecifier() )
+ {
+ getTypeSpecifier()->formatStream(out, arrayValue);
+ }
+ else
+ {
+ out << arrayValue[0].str();
+ for( avm_size_t offset = 1 ; offset < arrayValue.size() ; ++offset )
+ {
+ out << " , " << arrayValue[offset].str();
+ }
+ }
+}
+
+
+/**
+ * Serialization
+ */
+void InstanceOfData::strHeader(OutStream & out) const
+{
+ out << getModifier().toString() << "var< id:" << getOffset() << ", ptr:"
+ << IPointerDataNature::strPointer( getPointerNature() )
+ << ( hasOffsetPath() ? strOffsetPath(", mem:") : "" ) << " > "
+ << ( hasTypeSpecifier() ? getTypeSpecifier()->strT() : "" )
+ << " " << getFullyQualifiedNameID();
+
+AVM_IF_DEBUG_FLAG2_AND( COMPILING , QUALIFIED_NAME_ID , hasValue() )
+ out << " =";
+ strValue( out );
+AVM_ENDIF_DEBUG_FLAG2_AND( COMPILING , QUALIFIED_NAME_ID )
+
+ AVM_DEBUG_REF_COUNTER(out);
+}
+
+std::string InstanceOfData::strHeaderId() const
+{
+ StringOutStream oss;
+
+ oss << getModifier().toString() << "var< id:" << getOffset() << ", ptr:"
+ << IPointerDataNature::strPointer( getPointerNature() )
+ << ( hasOffsetPath() ? strOffsetPath(", mem:") : "" ) << " > "
+ << ( hasTypeSpecifier() ? getTypeSpecifier()->strT() : "" )
+ << " " << getNameID();
+
+AVM_IF_DEBUG_FLAG2_AND( COMPILING , QUALIFIED_NAME_ID , hasValue() )
+ oss << " =";
+ strValue( oss );
+AVM_ENDIF_DEBUG_FLAG2_AND( COMPILING , QUALIFIED_NAME_ID )
+
+ return( oss.str() );
+}
+
+
+void InstanceOfData::toStream(OutStream & out) const
+{
+ if( out.preferablyFQN() )
+ {
+ out << TAB << getFullyQualifiedNameID();
+
+ AVM_DEBUG_REF_COUNTER(out);
+
+ return;
+ }
+
+ bool isEmpty = true;
+
+ out << TAB << getModifier().toString_not( Modifier::FEATURE_CONST_KIND )
+ << ( getModifier().hasFeatureConst() ? "const" : "var" )
+ << "< id:" << getOffset() << ", ptr:"
+ << IPointerDataNature::strPointer( getPointerNature() )
+ << ( hasOffsetPath() ? strOffsetPath(", mem:") : "" )
+ << " > " ;
+
+ if( hasTypeSpecifier() )
+ {
+ out << getTypeSpecifier()->strT();
+ }
+
+ out << " " << getFullyQualifiedNameID() << " '" << getNameID() << "'";
+ AVM_DEBUG_REF_COUNTER(out);
+
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ out << " {" << EOL; isEmpty = false;
+
+ if( hasAstElement() )
+ {
+ out << TAB2 << "//compiled = "
+ << getAstFullyQualifiedNameID() << ";" << EOL;
+ }
+
+ out << TAB2 << "//container = "
+ << (hasContainer() ? getContainer()->getFullyQualifiedNameID() : "NULL")
+ << ";" << EOL;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ if( hasParent() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+ out << TAB2 << "parent = " << str_header( getParent() ) << ";" << EOL;
+ }
+
+ if( hasAliasTarget() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+ out << TAB2 << "target = "
+ << str_header( getAliasTarget()->as< InstanceOfData >() )
+ << ";" << EOL;
+ }
+
+ if( hasCreatorContainerRID() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+ out << TAB2 << "rid#creator = " << getCreatorContainerRID().str()
+ << ";" << EOL;
+ }
+
+ if( hasRuntimeContainerRID() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+ out << TAB2 << "rid#container = " << getRuntimeContainerRID().str()
+ << ";" << EOL;
+ }
+
+ if( hasValue() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+ out << TAB2 << "value =";
+ if( getValue().is< AvmCode >() )
+ {
+ out << str_indent( getValue().to_ptr< AvmCode >() ) << ";" << EOL;
+ }
+ else
+ {
+ strValue( out );
+ out << ";" << EOL;
+ }
+ }
+
+ if( hasBValue() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+ out << TAB2 << "bvalue =";
+ if( getBValue().is< AvmCode >() )
+ {
+ out << str_indent( getBValue().to_ptr< AvmCode >() ) << ";" << EOL;
+ }
+ else
+ {
+ strBValue( out );
+ out << ";" << EOL;
+ }
+ }
+
+ if( hasMachinePath() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+
+ out << TAB << "path#machine:" << EOL;
+ ArrayOfInstanceOfMachine::const_iterator it = getMachinePath()->begin();
+ ArrayOfInstanceOfMachine::const_iterator itEnd = getMachinePath()->end();
+ for( ; it != itEnd ; ++it )
+ {
+ out << TAB2 << (*it)->getFullyQualifiedNameID() << EOL;
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , DATA )
+ if( hasDataPath() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+
+ out << TAB << "path#data:" << EOL_INCR_INDENT;
+
+ getDataPath()->toStream(out);
+
+ out << DECR_INDENT;
+ }
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , DATA )
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , DATA )
+ if( hasAttribute() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+
+ out << TAB << "attribute:" << EOL_INCR_INDENT;
+
+ getAttribute()->toStream(out);
+
+ out << DECR_INDENT;
+ }
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , DATA )
+
+ if(hasOnWriteRoutine() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+
+ out << TAB << "moe:" << EOL;
+
+ if( hasOnWriteRoutine() )
+ {
+ out << TAB2 << "on_write = " << EOL_INCR2_INDENT;
+ getOnWriteRoutine()->toStream(out);
+ out << DECR2_INDENT;
+ }
+ }
+
+ ( isEmpty ? (out << ";") : (out << TAB << "}") ) << EOL_FLUSH;
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/executable/InstanceOfData.h b/org.eclipse.efm.symbex/src/fml/executable/InstanceOfData.h
new file mode 100644
index 0000000..6d90493
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/InstanceOfData.h
@@ -0,0 +1,833 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 5 août 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef INSTANCEOFDATA_H_
+#define INSTANCEOFDATA_H_
+
+#include <fml/executable/BaseInstanceForm.h>
+
+#include <common/AvmPointer.h>
+
+#include <collection/BFContainer.h>
+
+#include <fml/lib/AvmLang.h>
+
+#include <fml/symbol/TableOfSymbol.h>
+
+#include <fml/infrastructure/Variable.h>
+
+
+namespace sep
+{
+
+
+class ArrayBF;
+class AvmProgram;
+
+class BuiltinArray;
+class BaseAvmProgram;
+
+class Element;
+
+class ObjectElement;
+
+class Symbol;
+
+
+class InstanceOfData :
+ public BaseInstanceForm,
+ public IPointerDataNature,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( InstanceOfData )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( InstanceOfData )
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ POINTER_DATA_NATURE mPointerNature;
+
+ // Used to the container of store record/class or array data field instance
+ InstanceOfData * mParent;
+
+ // The Monitor Routine for Assignation
+ AvmProgram * mOnWriteRoutine;
+
+ // The initial value
+ BF mValue;
+
+ // The initial buffer value
+ BF mBufferValue;
+
+ // The variable Field table
+ // Used to store record/class or array data field instance
+ TableOfSymbol * mAttributeTable;
+
+ // The Relative Data Path for an Instance from this Data Container
+ TableOfSymbol * mRelativeDataPath;
+ avm_size_t * mRelativeOffsetPath;
+
+ // Mark use by some tools like Solver
+ avm_offset_t mMark;
+
+
+public:
+ /**
+ * DEFAULT
+ * Empty TableOfSymbol
+ */
+ static TableOfSymbol NULL_TABLE_OF_SYMBOL;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * copy
+ */
+ InstanceOfData(const InstanceOfData & aData)
+ : BaseInstanceForm( aData ),
+ mPointerNature( aData.mPointerNature ),
+ mParent( aData.mParent ),
+
+ mOnWriteRoutine( aData.mOnWriteRoutine ),
+
+ mValue( aData.mValue ),
+ mBufferValue( aData.mBufferValue ),
+
+ mAttributeTable( & NULL_TABLE_OF_SYMBOL ),
+
+ mRelativeDataPath( & NULL_TABLE_OF_SYMBOL ),
+ mRelativeOffsetPath( NULL ),
+
+ mMark( aData.mMark )
+ {
+ copyAttribute( aData.mAttributeTable );
+
+ copyDataPath( aData.mRelativeDataPath );
+ }
+
+
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ InstanceOfData(POINTER_DATA_NATURE aPointerNature,
+ BaseAvmProgram * aContainer, const ObjectElement * astElement,
+ BaseTypeSpecifier * aTypeSpecifier, avm_offset_t anOffset)
+ : BaseInstanceForm(CLASS_KIND_T( InstanceOfData ), aContainer,
+ astElement, aTypeSpecifier, anOffset),
+ mPointerNature( aPointerNature ),
+ mParent( NULL ),
+
+ mOnWriteRoutine( NULL ),
+
+ mValue( ),
+ mBufferValue( ),
+
+ mAttributeTable( & NULL_TABLE_OF_SYMBOL ),
+
+ mRelativeDataPath( & NULL_TABLE_OF_SYMBOL ),
+ mRelativeOffsetPath( NULL ),
+
+ mMark( 0 )
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( aTypeSpecifier )
+ << "InstanceOfData:> Unexpected an instance << "
+ << this->getFullyQualifiedNameID()
+ << " >> without typeSpecifier !!!"
+ << SEND_EXIT;
+ }
+
+ InstanceOfData(POINTER_DATA_NATURE aPointerNature,
+ BaseAvmProgram * aContainer, const ObjectElement * astElement,
+ BaseTypeSpecifier * aTypeSpecifier,
+ avm_offset_t anOffset, const Modifier & aModifier)
+ : BaseInstanceForm(CLASS_KIND_T( InstanceOfData ), aContainer,
+ astElement, aTypeSpecifier, anOffset, aModifier),
+ mPointerNature( aPointerNature ),
+ mParent( NULL ),
+
+ mOnWriteRoutine( NULL ),
+
+ mValue( ),
+ mBufferValue( ),
+
+ mAttributeTable( & NULL_TABLE_OF_SYMBOL ),
+
+ mRelativeDataPath( & NULL_TABLE_OF_SYMBOL ),
+ mRelativeOffsetPath( NULL ),
+
+ mMark( 0 )
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( aTypeSpecifier )
+ << "InstanceOfData:> Unexpected an instance << "
+ << this->getFullyQualifiedNameID()
+ << " >> without typeSpecifier !!!"
+ << SEND_EXIT;
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ InstanceOfData(POINTER_DATA_NATURE aPointerNature,
+ BaseAvmProgram * aContainer, const ObjectElement * astElement,
+ BaseTypeSpecifier * aTypeSpecifier,
+ const std::string & aFullyQualifiedNameID, avm_offset_t anOffset,
+ const Modifier & aModifier = Modifier::PROPERTY_UNDEFINED_MODIFIER)
+ : BaseInstanceForm(CLASS_KIND_T( InstanceOfData ), aContainer, astElement,
+ aTypeSpecifier, aFullyQualifiedNameID, anOffset, aModifier),
+ mPointerNature( aPointerNature ),
+ mParent( NULL ),
+
+ mOnWriteRoutine( NULL ),
+
+ mValue( ),
+ mBufferValue( ),
+
+ mAttributeTable( & NULL_TABLE_OF_SYMBOL ),
+
+ mRelativeDataPath( & NULL_TABLE_OF_SYMBOL ),
+ mRelativeOffsetPath( NULL ),
+
+ mMark( 0 )
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( aTypeSpecifier )
+ << "InstanceOfData:> Unexpected an instance << "
+ << this->getFullyQualifiedNameID()
+ << " >> without typeSpecifier !!!"
+ << SEND_EXIT;
+ }
+
+
+ InstanceOfData(POINTER_DATA_NATURE aPointerNature,
+ BaseAvmProgram * aContainer, const ObjectElement * astElement,
+ BaseTypeSpecifier * aTypeSpecifier,
+ const std::string & aFullyQualifiedNameID,
+ avm_offset_t anOffset, InstanceOfData * aParent)
+ : BaseInstanceForm(CLASS_KIND_T( InstanceOfData ), aContainer, astElement,
+ aTypeSpecifier, aFullyQualifiedNameID, anOffset, aParent),
+ mPointerNature( aPointerNature ),
+ mParent( NULL ),
+
+ mOnWriteRoutine( NULL ),
+
+ mValue( ),
+ mBufferValue( ),
+
+ mAttributeTable( & NULL_TABLE_OF_SYMBOL ),
+
+ mRelativeDataPath( & NULL_TABLE_OF_SYMBOL ),
+ mRelativeOffsetPath( NULL ),
+
+ mMark( 0 )
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( aTypeSpecifier )
+ << "InstanceOfData:> Unexpected an instance << "
+ << this->getFullyQualifiedNameID() << " >> without typeSpecifier !!!"
+ << SEND_EXIT;
+ }
+
+
+ InstanceOfData(POINTER_DATA_NATURE aPointerNature,
+ BaseTypeSpecifier * aTypeSpecifier,
+ const std::string & aFullyQualifiedNameID, avm_offset_t anOffset,
+ const Modifier & aModifier = Modifier::PROPERTY_UNDEFINED_MODIFIER)
+ : BaseInstanceForm(CLASS_KIND_T( InstanceOfData ),
+ aTypeSpecifier, aFullyQualifiedNameID, anOffset, aModifier),
+ mPointerNature( aPointerNature ),
+ mParent( NULL ),
+
+ mOnWriteRoutine( NULL ),
+
+ mValue( ),
+ mBufferValue( ),
+
+ mAttributeTable( & NULL_TABLE_OF_SYMBOL ),
+
+ mRelativeDataPath( & NULL_TABLE_OF_SYMBOL ),
+ mRelativeOffsetPath( NULL ),
+
+ mMark( 0 )
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( aTypeSpecifier )
+ << "InstanceOfData:> Unexpected an instance << "
+ << this->getFullyQualifiedNameID() << " >> without typeSpecifier !!!"
+ << SEND_EXIT;
+ }
+
+ /**
+ * CONSTRUCTOR
+ * for UFI
+ */
+ InstanceOfData(POINTER_DATA_NATURE aPointerNature,
+ BaseAvmProgram * aContainer, InstanceOfData * aParent,
+ const TableOfSymbol & aRelativeDataPath = NULL_TABLE_OF_SYMBOL)
+ : BaseInstanceForm(CLASS_KIND_T( InstanceOfData ), aContainer, aParent),
+ mPointerNature( aPointerNature ),
+ mParent( aParent->mParent ),
+
+ mOnWriteRoutine( aParent->mOnWriteRoutine ),
+
+ mValue( aParent->mValue ),
+ mBufferValue( aParent->mBufferValue ),
+
+ mAttributeTable( NULL ),
+ mRelativeDataPath( new TableOfSymbol(aRelativeDataPath) ),
+ mRelativeOffsetPath( NULL ),
+
+ mMark( 0 )
+ {
+ updateOffsetPath();
+
+ if( aRelativeDataPath.nonempty() )
+ {
+ setTypeSpecifier( aRelativeDataPath.back().getTypeSpecifier() );
+ setAstElement( aRelativeDataPath.back().getAstElement() );
+
+ setOnWriteRoutine(
+ aRelativeDataPath.back().data().getOnWriteRoutine() );
+
+ setValue( aRelativeDataPath.back().getValue() );
+
+ setBValue( aRelativeDataPath.back().data().getBValue() );
+ }
+
+ setAliasTarget( aParent );
+ }
+
+ InstanceOfData(POINTER_DATA_NATURE aPointerNature,
+ BaseAvmProgram * aContainer, InstanceOfData * aParent,
+ const TableOfSymbol & aRelativeDataPath, const Symbol & pathLeaf)
+ : BaseInstanceForm(CLASS_KIND_T( InstanceOfData ), aContainer, aParent),
+ mPointerNature( aPointerNature ),
+ mParent( aParent->mParent ),
+
+ mOnWriteRoutine( pathLeaf.data().mOnWriteRoutine ),
+
+ mValue( pathLeaf.data().mValue ),
+ mBufferValue( pathLeaf.data().mBufferValue ),
+
+ mAttributeTable( NULL ),
+ mRelativeDataPath( new TableOfSymbol(aRelativeDataPath, pathLeaf) ),
+ mRelativeOffsetPath( NULL ),
+
+ mMark( 0 )
+ {
+ updateOffsetPath();
+
+ setTypeSpecifier( pathLeaf.getTypeSpecifier() );
+ setAstElement( pathLeaf.getAstElement() );
+
+ setAliasTarget( aParent );
+ }
+
+
+
+ /**
+ * CONSTRUCTOR
+ * for RUNTIME UFI OFFSET
+ */
+ InstanceOfData(InstanceOfData * aModel,
+ InstanceOfData * aRoot, avm_size_t * aRelativeOffsetPath)
+ : BaseInstanceForm(CLASS_KIND_T( InstanceOfData ),
+ aModel->getContainer(), aRoot),
+ mPointerNature( POINTER_UFI_RUNTIME_NATURE ),
+ mParent( aModel ),
+
+ mOnWriteRoutine( aModel->mOnWriteRoutine ),
+
+ mValue( aModel->mValue ),
+ mBufferValue( aModel->mBufferValue ),
+
+ mAttributeTable( aModel->getAttribute() ),
+ mRelativeDataPath( aModel->getDataPath() ),
+ mRelativeOffsetPath( aRelativeOffsetPath ),
+
+ mMark( 0 )
+ {
+ setAllNameID(aModel->getFullyQualifiedNameID(), aModel->getNameID());
+
+ setRuntimeContainerRID( aRoot->getRuntimeContainerRID() );
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * for Alias
+ */
+ InstanceOfData(BaseAvmProgram * aContainer, InstanceOfData * aTarget,
+ VectorOfInstanceOfMachine & aRelativeMachinePath)
+ : BaseInstanceForm(CLASS_KIND_T( InstanceOfData ), aContainer, aTarget,
+ aRelativeMachinePath),
+ mPointerNature( aTarget->mPointerNature ),
+ mParent( aTarget->mParent ),
+
+ mOnWriteRoutine( aTarget->mOnWriteRoutine ),
+
+ mValue( aTarget->mValue ),
+ mBufferValue( aTarget->mBufferValue ),
+
+ mAttributeTable( & NULL_TABLE_OF_SYMBOL ),
+ mRelativeDataPath( & NULL_TABLE_OF_SYMBOL ),
+ mRelativeOffsetPath( NULL ),
+
+ mMark( 0 )
+ {
+ copyDataPath( aTarget->mRelativeDataPath );
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~InstanceOfData()
+ {
+ updateOffsetPath();
+
+ if( (mAttributeTable != (& NULL_TABLE_OF_SYMBOL)) &&
+ (mPointerNature != POINTER_UFI_RUNTIME_NATURE) )
+ {
+ delete( mAttributeTable );
+ mAttributeTable = NULL;
+ }
+
+ if( (mRelativeDataPath != (& NULL_TABLE_OF_SYMBOL)) &&
+ (mPointerNature != POINTER_UFI_RUNTIME_NATURE) )
+ {
+ delete( mRelativeDataPath );
+ mRelativeDataPath = NULL;
+ }
+
+ delete( mRelativeOffsetPath );
+ mRelativeOffsetPath = NULL;
+
+// AVM_OS_TRACE << "InstanceOfData::del :> "
+//// << "offset#" << getOffset() << FQN_ID_ROOT_SEPARATOR
+// << mFullyQualifiedNameID << std::endl;
+ }
+
+
+ /**
+ * GETTER
+ * Compiled ObjectElement as Compiled Variable
+ */
+ inline const Variable * getAstVariable() const
+ {
+ return( getAstElement()->as< Variable >() );
+ }
+
+ inline bool hasAstVariable() const
+ {
+ return( hasAstElement() && getAstElement()->is< Variable >() );
+ }
+
+
+ /**
+ * GETTER
+ * Qualified Name IDentifier
+ * QualifiedNameID using mFullyQualifiedNameID & mNameID
+ */
+ inline virtual std::string getQualifiedNameID() const
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM, DATA )
+
+ return( getFullyQualifiedNameID() );
+
+AVM_ELSE
+
+ return( (isStandardPointer() || isEnumSymbolPointer())
+ ? makeQualifiedNameID( getFullyQualifiedNameID(), getNameID() )
+ : makeQualifiedNameID( getFullyQualifiedNameID() ) );
+
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM, DATA )
+ }
+
+ /**
+ * GETTER
+ * mFullyQualifiedNameID
+ * mNameID
+ */
+ virtual void updateFullyQualifiedNameID();
+
+ inline void updateFullyQualifiedNameID(
+ const std::string & aFullyQualifiedNameID, const std::string & id)
+ {
+ setAllNameID( aFullyQualifiedNameID , id );
+ }
+
+ /**
+ * GETTER - SETTER
+ * mId
+ */
+ void updateNameID();
+
+
+ /**
+ * SETTER
+ * the SharedData
+ */
+ inline void setSharedData(InstanceOfData * sData)
+ {
+ setOffset( sData->getOffset() );
+
+// setModifier( sData->getModifier() );
+
+ mOnWriteRoutine = sData->mOnWriteRoutine;
+
+ mValue = sData->mValue;
+
+ mBufferValue = sData->mBufferValue;
+ }
+
+ /**
+ * GETTER - SETTER
+ * mParent
+ */
+ inline InstanceOfData * getParent() const
+ {
+ return( mParent );
+ }
+
+ inline bool hasParent() const
+ {
+ return( mParent != NULL );
+ }
+
+ inline void setParent(InstanceOfData * aParent)
+ {
+ mParent = aParent;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mAttributeTable
+ */
+ inline TableOfSymbol * getAttribute() const
+ {
+ return( mAttributeTable );
+ }
+
+ inline bool hasAttribute() const
+ {
+ return( (mAttributeTable != (& NULL_TABLE_OF_SYMBOL)) &&
+ (mAttributeTable != NULL) && mAttributeTable->nonempty() );
+ }
+
+ inline void setAttribute(TableOfSymbol * anAttributeTable)
+ {
+ mAttributeTable = ( anAttributeTable != NULL ) ?
+ anAttributeTable : (& NULL_TABLE_OF_SYMBOL);
+ }
+
+ inline void copyAttribute(TableOfSymbol * anAttributeTable)
+ {
+ mAttributeTable = ( anAttributeTable != NULL ) ?
+ new TableOfSymbol(*anAttributeTable) : (& NULL_TABLE_OF_SYMBOL);
+ }
+
+
+ inline void setAttribute(avm_offset_t offset, const Symbol & aWProperty)
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( hasAttribute() )
+ << "setAttribute:> Unexpected a <null> AttributeTable !!!"
+ << SEND_EXIT;
+
+ mAttributeTable->set(offset, aWProperty);
+ }
+
+ /**
+ * GETTER - SETTER
+ * mOnWriteRoutine
+ */
+ inline AvmProgram * getOnWriteRoutine() const
+ {
+ return( mOnWriteRoutine );
+ }
+
+ const BFCode & getOnWriteCode() const;
+
+
+ inline bool hasOnWriteRoutine() const
+ {
+ return( mOnWriteRoutine != NULL );
+ }
+
+ inline void setOnWriteRoutine(AvmProgram * onWriteRoutine)
+ {
+ mOnWriteRoutine = onWriteRoutine;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mValue
+ */
+
+ inline BF & getValue()
+ {
+ return( mValue );
+ }
+
+
+ inline const BF & getValue() const
+ {
+ return( mValue );
+ }
+
+ inline bool hasValue() const
+ {
+ return( mValue.valid() );
+ }
+
+
+ inline void setValue(const BF & aValue)
+ {
+ mValue = aValue;
+ }
+
+
+ // ArrayValue
+ ArrayBF * getArrayValue() const;
+
+ bool hasArrayValue() const;
+
+ // BuiltinArrayValue
+ BuiltinArray * getBuiltinArrayValue() const;
+
+ bool hasBuiltinArrayValue() const;
+
+ /**
+ * GETTER - SETTER
+ * mBufferValue
+ */
+
+ inline BF & getBValue()
+ {
+ return( mBufferValue );
+ }
+
+ inline const BF & getBValue() const
+ {
+ return( mBufferValue );
+ }
+
+ inline bool hasBValue() const
+ {
+ return( mBufferValue.valid() );
+ }
+
+
+ inline void setBValue(const BF & aBufferValue)
+ {
+ mBufferValue = aBufferValue;
+ }
+
+ inline void resetBValue(Element * aBufferValue)
+ {
+ mBufferValue.replacePointer( aBufferValue );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mRelativeDataPath
+ */
+ inline TableOfSymbol * getDataPath() const
+ {
+ return( mRelativeDataPath );
+ }
+
+ inline bool hasDataPath() const
+ {
+ return( (mRelativeDataPath != (& NULL_TABLE_OF_SYMBOL)) &&
+ (mRelativeDataPath != NULL) && mRelativeDataPath->nonempty() );
+ }
+
+ inline void setDataPath(TableOfSymbol * aRelativeDataPath)
+ {
+ mRelativeDataPath = (aRelativeDataPath != NULL) ?
+ aRelativeDataPath : (& NULL_TABLE_OF_SYMBOL);
+
+ updateOffsetPath();
+ }
+
+ inline void copyDataPath(TableOfSymbol * aRelativeDataPath)
+ {
+ mRelativeDataPath = (aRelativeDataPath != NULL) ?
+ new TableOfSymbol(*aRelativeDataPath) : (& NULL_TABLE_OF_SYMBOL);
+
+ updateOffsetPath();
+ }
+
+ inline void setDataPath(const TableOfSymbol & aRelativeDataPath)
+ {
+ mRelativeDataPath = new TableOfSymbol( aRelativeDataPath );
+
+ updateOffsetPath();
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mRelativeOffsetPath
+ */
+ inline avm_size_t * getOffsetPath() const
+ {
+ return( mRelativeOffsetPath );
+ }
+
+ inline avm_size_t getOffsetPath(avm_size_t idx) const
+ {
+ return( mRelativeOffsetPath[idx] );
+ }
+
+ bool hasOffsetPath() const
+ {
+ return( mRelativeOffsetPath != NULL );
+ }
+
+ inline void setOffsetPath(avm_size_t * anOffsetPath)
+ {
+ mRelativeOffsetPath = anOffsetPath;
+ }
+
+ std::string strOffsetPath(const std::string & tab = "") const;
+
+ void updateOffsetPath();
+
+
+
+ /**
+ * GETTER - SETTER
+ * mPointerNature
+ */
+ inline virtual POINTER_DATA_NATURE getPointerNature() const
+ {
+ return( mPointerNature );
+ }
+
+ bool isConcreteArrayIndex();
+
+ bool isConcreteStructAttribute();
+
+
+ /**
+ * GETTER - SETTER
+ * mMark
+ */
+ inline avm_offset_t getMark()
+ {
+ return( mMark );
+ }
+
+ inline void eraseMark()
+ {
+ mMark = 0;
+ }
+
+ inline void setMark(avm_offset_t aMark)
+ {
+ mMark = aMark;
+ }
+
+
+
+ /**
+ * Format a value w.r.t. its type
+ */
+ virtual void formatStream(OutStream & os, const BF & bfValue) const;
+
+ virtual void formatStream(OutStream & os, const ArrayBF & arrayValue) const;
+
+
+ /**
+ * Serialization
+ */
+ void strHeader(OutStream & os) const;
+
+ std::string strHeaderId() const;
+
+ void toStream(OutStream & os) const;
+
+
+ inline void strValue(OutStream & os, const BF & aValue) const
+ {
+ os << AVM_STR_INDENT; //<< IGNORE_FIRST_TAB;
+
+ if( aValue.valid() )
+ {
+ formatStream( os << TAB , aValue );
+ }
+ else
+ {
+ aValue.toStream( os );
+ }
+
+ os << END_INDENT;
+ }
+
+ inline void strValue(OutStream & os) const
+ {
+ strValue( os, mValue );
+ }
+
+ inline void strBValue(OutStream & os) const
+ {
+ strValue( os, mBufferValue );
+ }
+
+
+ inline std::string strValue(const BF & aValue) const
+ {
+ StringOutStream oss;
+
+ formatStream( oss , aValue );
+
+ return( oss.str() );
+ }
+
+
+ inline std::string strValue() const
+ {
+ return( mValue.valid() ? strValue(mValue) : mValue.str() );
+ }
+
+ inline std::string strBValue() const
+ {
+ return( mBufferValue.valid() ?
+ strValue(mBufferValue) : mBufferValue.str() );
+ }
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// InstanceOfData
+// TYPE DEFINITION for TABLE , SMART POINTER and CONTAINER
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+typedef TableOfBF_T< InstanceOfData > TableOfInstanceOfData;
+
+
+}
+
+#endif /* INSTANCEOFDATA_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/executable/InstanceOfMachine.cpp b/org.eclipse.efm.symbex/src/fml/executable/InstanceOfMachine.cpp
new file mode 100644
index 0000000..a918f07
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/InstanceOfMachine.cpp
@@ -0,0 +1,488 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 5 août 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "InstanceOfMachine.h"
+
+#include <fml/common/SpecifierElement.h>
+
+#include <fml/executable/AvmProgram.h>
+#include <fml/executable/ExecutableForm.h>
+
+#include <fml/runtime/RuntimeID.h>
+
+#include <fml/type/TypeManager.h>
+
+
+namespace sep
+{
+
+
+std::string InstanceOfMachine::THIS_FQN_SUFFIX = ".$this";
+std::string InstanceOfMachine::THIS_ID = "$this";
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+InstanceOfMachine::InstanceOfMachine(ExecutableForm * aContainer,
+ const Machine * astMachine, ExecutableForm * anExecutable,
+ InstanceOfMachine * anInstanceModel, avm_offset_t anOffset)
+: BaseInstanceForm(CLASS_KIND_T( InstanceOfMachine ),
+ aContainer, astMachine, TypeManager::MACHINE, anOffset),
+SpecifierImpl( astMachine ),
+
+mExecutable( anExecutable ),
+
+mThisFlag( false ),
+
+onCreateRoutine ( Specifier::SCOPE_ROUTINE_KIND , anExecutable , "create" , 0 ),
+onStartRoutine( Specifier::SCOPE_ROUTINE_KIND , anExecutable , "init" , 0 ),
+
+mPossibleDynamicInstanciationCount( 0 ),
+mMaximalInstanceCount( 1 ),
+mParamReturnTable( ),
+mReturnOffset( 0 ),
+mInstanceModel( anInstanceModel ),
+mRuntimeRID( ),
+mModifierAutoStart( true ),
+
+mInputEnabledBuffer( ),
+mInputEnabledCom( ),
+mInputEnabledSave( )
+{
+ updateFullyQualifiedNameID();
+}
+
+
+InstanceOfMachine::InstanceOfMachine(ExecutableForm * aContainer,
+ const Machine * astMachine, ExecutableForm * anExecutable,
+ InstanceOfMachine * anInstanceModel,
+ avm_offset_t anOffset, const Specifier & aSpecifier)
+: BaseInstanceForm(CLASS_KIND_T( InstanceOfMachine ),
+ aContainer, astMachine, TypeManager::MACHINE, anOffset),
+SpecifierImpl( aSpecifier ),
+
+mExecutable( anExecutable ),
+
+mThisFlag( false ),
+
+onCreateRoutine ( Specifier::SCOPE_ROUTINE_KIND , anExecutable , "create" , 0 ),
+onStartRoutine( Specifier::SCOPE_ROUTINE_KIND , anExecutable , "init" , 0 ),
+
+mPossibleDynamicInstanciationCount( 0 ),
+mMaximalInstanceCount( 1 ),
+mParamReturnTable( ),
+mReturnOffset( 0 ),
+mInstanceModel( anInstanceModel ),
+mRuntimeRID( ),
+mModifierAutoStart( true ),
+
+mInputEnabledBuffer( ),
+mInputEnabledCom( ),
+mInputEnabledSave( )
+{
+ updateFullyQualifiedNameID();
+}
+
+
+/**
+ * CONSTRUCTOR
+ * for the instance << this >>
+ */
+InstanceOfMachine * InstanceOfMachine::newThis(ExecutableForm * anExecutable,
+ InstanceOfMachine * anInstanceModel, avm_offset_t anOffset)
+{
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( anOffset == 0 )
+ << "Unexpected a non-zero offset< " << anOffset
+ << " > for the instance << this >> !!!" << std::endl
+ << str_header( anExecutable->getInstanceStatic() )
+ << str_header( anInstanceModel )
+ << SEND_EXIT;
+
+ InstanceOfMachine * thisInstance =
+ new InstanceOfMachine(anExecutable,
+ anExecutable->getAstMachine(),
+ anExecutable, anInstanceModel, 0);
+
+ thisInstance->getwSpecifier().setDesignInstanceStatic();
+ thisInstance->setInstanciationCount(1);
+
+ anInstanceModel->incrInstanciationCount();
+
+ thisInstance->setAllNameID(
+ thisInstance->getFullyQualifiedNameID() + THIS_FQN_SUFFIX,
+ THIS_ID );
+
+ thisInstance->setThis( true );
+
+ return( thisInstance );
+}
+
+
+InstanceOfMachine * InstanceOfMachine::newInstanceModelThis(
+ ExecutableForm * aContainer, Machine * aCompiled,
+ ExecutableForm * anExecutable, InstanceOfMachine * anInstanceModel,
+ avm_offset_t anOffset, const Specifier & aSpecifier)
+{
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( anOffset == 0 )
+ << "Unexpected a non-zero offset< " << anOffset
+ << " > for the instance << this >> !!!" << std::endl
+ << str_header( anExecutable->getInstanceStatic() )
+ << str_header( anInstanceModel )
+ << SEND_EXIT;
+
+ InstanceOfMachine * thisInstance = new InstanceOfMachine(aContainer,
+ aCompiled, anExecutable, NULL, anOffset, aSpecifier );
+
+ thisInstance->setAllNameID(
+ thisInstance->getFullyQualifiedNameID() + THIS_FQN_SUFFIX,
+ THIS_ID );
+
+ thisInstance->setThis( true );
+
+ return( thisInstance );
+}
+
+
+/**
+ * GETTER - SETTER
+ * mParamReturnTable
+ * mReturnOffset
+ */
+BaseTypeSpecifier * InstanceOfMachine::getParamType(avm_size_t offset) const
+{
+ return( hasExecutable() ?
+ getExecutable()->rawParamData(offset)->getTypeSpecifier() : NULL );
+}
+
+
+/**
+ * SETTER
+ * mFullyQualifiedNameID
+ */
+void InstanceOfMachine::updateFullyQualifiedNameID()
+{
+ std::string::size_type pos =
+ mFullyQualifiedNameID.find(FQN_ID_ROOT_SEPARATOR);
+ if( pos != std::string::npos )
+ {
+ setFullyQualifiedNameID( ( getSpecifier().isDesignModel() ? "model" :
+ ( getSpecifier().isDesignPrototypeStatic() ? "prot" : "inst" ) )
+ + mFullyQualifiedNameID.substr(pos) );
+ }
+}
+
+
+/**
+ * GETTER - SETTER
+ * mPossibleDynamicInstanciationCount
+ */
+void InstanceOfMachine::incrPossibleDynamicInstanciationCount(avm_size_t offset)
+{
+ if( mInstanceModel != NULL )
+ {
+ mInstanceModel->mPossibleDynamicInstanciationCount += offset;
+ }
+// else
+ {
+ mPossibleDynamicInstanciationCount += offset;
+ }
+
+ if( mExecutable != NULL )
+ {
+ mExecutable->incrPossibleDynamicInstanciationCount(offset);
+ }
+}
+
+
+/**
+ * Serialization
+ */
+void InstanceOfMachine::header(OutStream & out) const
+{
+ out << getModifier().toString() << getSpecifier().strFeature()
+ << getSpecifier().strDesign_not( Specifier::DESIGN_INSTANCE_KIND )
+ << "instance< id:" << getOffset();
+
+ InstanceSpecifierPart::strMultiplicity(
+ out, mInstanciationCount,
+ mPossibleDynamicInstanciationCount,
+ mMaximalInstanceCount, ", multiplicity: [ ", " ]");
+
+// if( mInstanciationCount != 1 )
+// {
+// out << ", init:" << mInstanciationCount;
+// }
+// if( mPossibleDynamicInstanciationCount > 0 )
+// {
+// out << ", dyna:" << mPossibleDynamicInstanciationCount;
+// }
+// if( hasMaximalNewInstance() )
+// {
+// out << ", max:" << getMaximalInstanceCount();
+// }
+
+ if( isThis() )
+ {
+ out << ", this";
+ }
+ if( not isAutoStart() )
+ {
+ out << ", autostart = false";
+ }
+
+ out << " >";
+
+AVM_IF_DEBUG_FLAG_OR( COMPILING , getSpecifier().isDesignInstanceStatic() )
+
+ out << " &" << ( hasExecutable() ?
+ getExecutable()->getFullyQualifiedNameID() : "null< executable >" );
+
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ out << " " << getFullyQualifiedNameID();
+}
+
+void InstanceOfMachine::strHeader(OutStream & out) const
+{
+ header( out );
+
+ if( hasParam() )
+ {
+ out << "( ";
+ TableOfData::const_iterator it = getParamReturnTable()->begin();
+ out << (*it).str();
+
+ TableOfData::const_iterator endIt = getParamReturnTable()->end();
+ for( ++it ; it != endIt ; ++it )
+ {
+ out << ", " << (*it).str();
+ }
+ out << " )";
+ }
+}
+
+
+void InstanceOfMachine::toStream(OutStream & out) const
+{
+ if( out.preferablyFQN() )
+ {
+ out << TAB << getFullyQualifiedNameID();
+
+ AVM_DEBUG_REF_COUNTER(out);
+
+ return;
+ }
+
+ bool isEmpty = true;
+
+ header( out << TAB );
+
+ AVM_DEBUG_REF_COUNTER(out);
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ out << " {" << EOL; isEmpty = false;
+
+ out << TAB << "//property:" << EOL;
+
+ if( hasAstElement() )
+ {
+ out << TAB2 << "//compiled = "
+ << getAstFullyQualifiedNameID() << ";" << EOL;
+ }
+
+ out << TAB2 << "//container = "
+ << (hasContainer() ? getContainer()->getFullyQualifiedNameID() : "null")
+ << ";" << EOL;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ if( hasInstanceModel() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+
+ out << TAB2 << "//model = "
+ << getInstanceModel()->getFullyQualifiedNameID() << ";" << EOL;
+ }
+
+ if( hasAliasTarget() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+ out << TAB2 << "target = "
+ << str_header( getAliasTarget()->as< InstanceOfMachine >() )
+ << ";" << EOL;
+ }
+
+ if( hasCreatorContainerRID() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+ out << TAB2 << "rid#creator = " << getCreatorContainerRID().str()
+ << ";" << EOL;
+ }
+
+ if( hasRuntimeContainerRID() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+ out << TAB2 << "rid#container = " << getRuntimeContainerRID().str()
+ << ";" << EOL;
+ }
+
+ if( hasRuntimeRID() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+ out << TAB2 << "rid#runtime = " << getRuntimeRID().str() << ";" << EOL;
+ }
+
+ if( hasMachinePath() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+
+ out << TAB << "path#machine:" << EOL;
+ ArrayOfInstanceOfMachine::const_iterator it = getMachinePath()->begin();
+ ArrayOfInstanceOfMachine::const_iterator endIt = getMachinePath()->end();
+ for( ; it != endIt ; ++it )
+ {
+ out << TAB2 << (*it)->getFullyQualifiedNameID() << EOL;
+ }
+ }
+
+ if( hasParamReturnTable() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+
+ TableOfData::const_iterator it = getParamReturnTable()->begin();
+ avm_offset_t offset = 0;
+ avm_offset_t endOffset = 0;
+
+ if( hasParam() )
+ {
+ out << TAB << "parameter:" << EOL;
+ endOffset = getParamCount();
+ for( offset = 0 ; offset < endOffset ; ++it , ++offset )
+ {
+ out << TAB2;
+ if( hasExecutable() )
+ {
+ out << str_header( getExecutable()->rawParamData(offset) );
+ }
+ else
+ {
+ out << "$" << offset;
+ }
+
+ if( (*it).valid() )
+ {
+ if( (*it).is< BaseInstanceForm >() )
+ {
+ out << " = &" << (*it).to_ptr<
+ BaseInstanceForm >()->getFullyQualifiedNameID();
+ }
+ else
+ {
+ out << " = " << (*it).str();
+ }
+ }
+ out << ";" << EOL;
+ }
+ }
+
+ if( hasReturn() )
+ {
+ out << TAB << "returns:" << EOL;
+ endOffset = getReturnCount();
+ for( offset = 0 ; offset < endOffset ; ++it , ++offset )
+ {
+ out << TAB2;
+ if( hasExecutable() )
+ {
+ out << str_header( getExecutable()->rawReturnData(offset) );
+ }
+ else
+ {
+ out << "$" << offset;
+ }
+
+ if( (*it).valid() )
+ {
+ if( (*it).is< BaseInstanceForm >() )
+ {
+ out << " = &" << (*it).to_ptr<
+ BaseInstanceForm >()->getFullyQualifiedNameID();
+ }
+ else
+ {
+ out << " = " << (*it).str();
+ }
+ }
+ out << ";" << EOL;
+ }
+ }
+ }
+
+//AVM_IF_DEBUG_FLAG( COMMUNICATION )
+ if ( hasInputEnabledBuffer() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+
+ out << TAB << "buffer#input_enabled{" << EOL;
+ toStreamStaticCom(out, getInputEnabledBuffer());
+ out << TAB << "}" << EOL;
+ }
+
+ if ( hasInputEnabledCom() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+
+ out << TAB << "com#input_enabled{" << EOL;
+ toStreamStaticCom(out, getInputEnabledCom());
+ out << TAB << "}" << EOL;
+ }
+
+ if ( hasInputEnabledSave() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+
+ out << TAB << "com#input_enabled#save{" << EOL;
+ toStreamStaticCom(out, getInputEnabledSave());
+ out << TAB << "}" << EOL;
+ }
+//AVM_ENDIF_DEBUG_FLAG( COMMUNICATION )
+
+ if( hasParamReturn() && (hasOnCreate() || hasOnStart()) )
+ {
+ out << TAB << "moe:" << EOL;
+
+ }
+ if( hasOnCreate() )
+ {
+ out << TAB2 << "@create{" << INCR2_INDENT;
+ getOnCreate()->toStreamRoutine( out );
+ out << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+ if( hasOnStart() )
+ {
+ out << TAB2 << "@start{" << INCR2_INDENT;
+ getOnStart()->toStreamRoutine( out );
+ out << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+
+ ( isEmpty ? (out << ";") : (out << TAB << "}") ) << EOL_FLUSH;
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/executable/InstanceOfMachine.h b/org.eclipse.efm.symbex/src/fml/executable/InstanceOfMachine.h
new file mode 100644
index 0000000..b25b430
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/InstanceOfMachine.h
@@ -0,0 +1,731 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 5 août 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef INSTANCEOFMACHINE_H_
+#define INSTANCEOFMACHINE_H_
+
+#include <fml/executable/BaseInstanceForm.h>
+#include <fml/common/SpecifierElement.h>
+
+#include <common/AvmPointer.h>
+
+#include <collection/Typedef.h>
+
+#include <fml/common/ModifierElement.h>
+
+#include <fml/executable/AvmProgram.h>
+#include <fml/executable/InstanceOfBuffer.h>
+#include <fml/executable/InstanceOfData.h>
+#include <fml/executable/InstanceOfPort.h>
+
+#include <fml/lib/IComPoint.h>
+
+#include <fml/runtime/RuntimeID.h>
+#include <fml/runtime/TableOfData.h>
+
+#include <fml/infrastructure/Machine.h>
+
+
+namespace sep
+{
+
+class BaseAvmProgram;
+
+class ExecutableForm;
+
+class Specifier;
+
+
+class InstanceOfMachine :
+ public BaseInstanceForm,
+ public SpecifierImpl,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( InstanceOfMachine )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( InstanceOfMachine )
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ // the Executable Code for Machine
+ ExecutableForm * mExecutable;
+
+ bool mThisFlag;
+
+ AvmProgram onCreateRoutine;
+ AvmProgram onStartRoutine;
+
+ avm_size_t mPossibleDynamicInstanciationCount;
+ avm_size_t mMaximalInstanceCount;
+
+ APTableOfData mParamReturnTable;
+
+ avm_size_t mReturnOffset;
+
+ InstanceOfMachine * mInstanceModel;
+
+ // The runtime machine RID for RID access optimization
+ RuntimeID mRuntimeRID;
+
+ bool mModifierAutoStart;
+
+ // static class of Port/Message/Signal in communicated statement
+ ListOfInstanceOfBuffer mInputEnabledBuffer;
+ ListOfInstanceOfPort mInputEnabledCom;
+ ListOfInstanceOfPort mInputEnabledSave;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ InstanceOfMachine(ExecutableForm * aContainer,
+ const Machine * astMachine, ExecutableForm * anExecutable,
+ InstanceOfMachine * anInstanceModel, avm_offset_t anOffset);
+
+ InstanceOfMachine(ExecutableForm * aContainer, const Machine * astMachine,
+ ExecutableForm * anExecutable, InstanceOfMachine * anInstanceModel,
+ avm_offset_t anOffset, const Specifier & aSpecifier);
+
+
+ /**
+ * CONSTRUCTOR
+ * copy
+ */
+ InstanceOfMachine(const InstanceOfMachine & aMachine)
+ : BaseInstanceForm( aMachine ),
+ SpecifierImpl( aMachine ),
+
+ mExecutable( aMachine.mExecutable ),
+
+ mThisFlag( aMachine.mThisFlag ),
+
+ onCreateRoutine ( aMachine.onCreateRoutine ),
+ onStartRoutine( aMachine.onStartRoutine ),
+
+ mPossibleDynamicInstanciationCount(
+ aMachine.mPossibleDynamicInstanciationCount ),
+ mMaximalInstanceCount( aMachine.mMaximalInstanceCount ),
+ mParamReturnTable( aMachine.mParamReturnTable ),
+ mReturnOffset( aMachine.mReturnOffset ),
+ mInstanceModel( aMachine.mInstanceModel ),
+ mRuntimeRID( aMachine.mRuntimeRID ),
+ mModifierAutoStart( aMachine.mModifierAutoStart ),
+
+ mInputEnabledBuffer( aMachine.mInputEnabledBuffer ),
+ mInputEnabledCom( aMachine.mInputEnabledCom ),
+ mInputEnabledSave( aMachine.mInputEnabledSave )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * for Alias
+ */
+ InstanceOfMachine(BaseAvmProgram * aContainer, InstanceOfMachine * aTarget,
+ VectorOfInstanceOfMachine & aRelativeMachinePath)
+ : BaseInstanceForm(CLASS_KIND_T( InstanceOfMachine ),
+ aContainer, aTarget, aRelativeMachinePath),
+ SpecifierImpl( aTarget->getSpecifier() ),
+
+ mExecutable( aTarget->mExecutable ),
+
+ mThisFlag( aTarget->mThisFlag ),
+
+ onCreateRoutine ( aTarget->onCreateRoutine ),
+ onStartRoutine( aTarget->onStartRoutine ),
+
+ mPossibleDynamicInstanciationCount(
+ aTarget->mPossibleDynamicInstanciationCount ),
+ mMaximalInstanceCount( aTarget->mMaximalInstanceCount ),
+ mParamReturnTable( aTarget->mParamReturnTable ),
+ mReturnOffset( aTarget->mReturnOffset ),
+ mInstanceModel( aTarget->mInstanceModel ),
+ mRuntimeRID( aTarget->mRuntimeRID ),
+ mModifierAutoStart( aTarget->mModifierAutoStart ),
+
+ mInputEnabledBuffer( aTarget->mInputEnabledBuffer ),
+ mInputEnabledCom( aTarget->mInputEnabledCom ),
+ mInputEnabledSave( aTarget->mInputEnabledSave )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~InstanceOfMachine()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER
+ * Compiled ObjectElement as Compiled Machine
+ */
+ inline const Machine * getAstMachine() const
+ {
+ return( getAstElement()->as< Machine >() );
+ }
+
+
+ /**
+ * SETTER
+ * mFullyQualifiedNameID
+ */
+ virtual void updateFullyQualifiedNameID();
+
+
+ /**
+ * GETTER - SETTER
+ * mExecutable
+ */
+ inline ExecutableForm * getExecutable() const
+ {
+ return( mExecutable );
+ }
+
+ inline bool hasExecutable() const
+ {
+ return( mExecutable != NULL );
+ }
+
+ inline void setExecutable(ExecutableForm * anExecutable)
+ {
+ mExecutable = anExecutable;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mExecutable
+ */
+ inline bool isThis() const
+ {
+ return( mThisFlag );
+ }
+
+ inline bool isnotThis() const
+ {
+ return( not mThisFlag );
+ }
+
+ inline bool isThis(const ExecutableForm * anExecutable) const
+ {
+ return( mThisFlag && (mExecutable == anExecutable) );
+ }
+
+ inline bool isnotThis(const ExecutableForm * anExecutable) const
+ {
+ return( (mExecutable != anExecutable) || (not mThisFlag) );
+ }
+
+ inline void setThis(bool isThisFlag = true)
+ {
+ mThisFlag = isThisFlag;
+ }
+
+ /**
+ * CONSTRUCTION
+ * the instance << this >>
+ */
+ static std::string THIS_FQN_SUFFIX;
+ static std::string THIS_ID;
+
+ static InstanceOfMachine * newThis(ExecutableForm * anExecutable,
+ InstanceOfMachine * anInstanceModel, avm_offset_t anOffset);
+
+ static InstanceOfMachine * newInstanceModelThis(
+ ExecutableForm * aContainer, Machine * aCompiled,
+ ExecutableForm * anExecutable, InstanceOfMachine * anInstanceModel,
+ avm_offset_t anOffset, const Specifier & aSpecifier);
+
+ /**
+ * GETTER - SETTER
+ * onCreateRoutine
+ */
+ inline AvmProgram & getOnCreateRoutine()
+ {
+ return( onCreateRoutine );
+ }
+
+ inline BFCode & getOnCreate()
+ {
+ return( onCreateRoutine.getCode() );
+ }
+
+ inline const BFCode & getOnCreate() const
+ {
+ return( onCreateRoutine.getCode() );
+ }
+
+ inline bool hasOnCreate() const
+ {
+ return( onCreateRoutine.hasCode() );
+ }
+
+ inline void setOnCreate(const BFCode & aProgram)
+ {
+ onCreateRoutine.setCode( aProgram );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onStartRoutine
+ */
+ inline AvmProgram & getOnStartRoutine()
+ {
+ return( onStartRoutine );
+ }
+
+ inline BFCode & getOnStart()
+ {
+ return( onStartRoutine.getCode() );
+ }
+
+ inline const BFCode & getOnStart() const
+ {
+ return( onStartRoutine.getCode() );
+ }
+
+ inline bool hasOnStart() const
+ {
+ return( onStartRoutine.hasCode() );
+ }
+
+ inline void setOnStart(const BFCode & aProgram)
+ {
+ onStartRoutine.setCode( aProgram );
+ }
+
+
+ /**
+ * UTIL
+ */
+ inline bool hasBehavior() const
+ {
+ return( hasOnCreate() || hasOnStart() );
+ }
+
+ /*
+ * GETTER - SETTER
+ * mPossibleDynamicInstanciationCount
+ * Single or Multiple
+ * Instanciation Information
+ * for Data Access optimisation
+ */
+ inline avm_size_t getStaticInstanciationCount() const
+ {
+ return( mInstanciationCount );
+ }
+
+ inline bool hasStaticInstanciation() const
+ {
+ return( mInstanciationCount > 0 );
+ }
+
+
+ inline avm_size_t getPossibleDynamicInstanciationCount() const
+ {
+ return( mPossibleDynamicInstanciationCount );
+ }
+
+ inline bool hasPossibleDynamicInstanciation() const
+ {
+ return( mPossibleDynamicInstanciationCount > 0 );
+ }
+
+ void incrPossibleDynamicInstanciationCount(avm_size_t offset = 1);
+
+
+ inline bool hasSingleRuntimeInstance()
+ {
+ return( (mInstanciationCount > 1) ||
+ (mPossibleDynamicInstanciationCount > 0) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mMaximalInstanceCount
+ */
+ inline avm_size_t getMaximalInstanceCount() const
+ {
+ return( mMaximalInstanceCount );
+ }
+
+ inline bool hasMaximalInstance() const
+ {
+ return( mMaximalInstanceCount != AVM_NUMERIC_MAX_SIZE_T );
+ }
+
+ inline bool hasMaximalNewInstance() const
+ {
+ return( (mMaximalInstanceCount > 1)
+ && (mMaximalInstanceCount != AVM_NUMERIC_MAX_SIZE_T) );
+ }
+
+ inline void setMaximalInstanceCount(avm_size_t aMaximalInstanceCount)
+ {
+ mMaximalInstanceCount = aMaximalInstanceCount;
+ }
+
+
+ inline void setInstanceCount(
+ avm_uint32_t anInitialCount, avm_size_t aMaximalInstanceCount)
+ {
+ BaseInstanceForm::setInstanciationCount( anInitialCount );
+
+ mMaximalInstanceCount = aMaximalInstanceCount;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mParamReturnTable
+ */
+ inline APTableOfData & getParamReturnTable()
+ {
+ return( mParamReturnTable );
+ }
+
+ inline const APTableOfData & getParamReturnTable() const
+ {
+ return( mParamReturnTable );
+ }
+
+
+ inline bool hasParamReturnTable() const
+ {
+ return( mParamReturnTable.valid() );
+ }
+
+
+ inline void setParamReturnTable(const APTableOfData & aParamTable)
+ {
+ mParamReturnTable = aParamTable;
+ }
+
+
+ inline BF & getParamReturn(avm_size_t offset)
+ {
+ return( mParamReturnTable->at(offset) );
+ }
+
+ inline const BF & getParamReturn(avm_size_t offset) const
+ {
+ return( mParamReturnTable->at(offset) );
+ }
+
+
+ inline bool hasParamReturn() const
+ {
+ return( mParamReturnTable.valid() && mParamReturnTable->nonempty() );
+ }
+
+ inline void setParamReturn(avm_size_t offset, const BF & aParam)
+ {
+ mParamReturnTable->set(offset, aParam);
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mParamReturnTable
+ * mReturnOffset
+ */
+
+ inline avm_size_t getParamOffset() const
+ {
+ return( 0 );
+ }
+
+ inline avm_size_t getParamCount() const
+ {
+ return( mReturnOffset );
+ }
+
+ inline BF & getParam(avm_size_t offset)
+ {
+ return( mParamReturnTable->at(offset) );
+ }
+
+ inline const BF & getParam(avm_size_t offset) const
+ {
+ return( mParamReturnTable->at(offset) );
+ }
+
+
+ BaseTypeSpecifier * getParamType(avm_size_t offset) const;
+
+
+ inline bool hasParam() const
+ {
+ return( mParamReturnTable.valid()
+ && mParamReturnTable->nonempty()
+ && (mReturnOffset > 0) );
+ }
+
+
+ inline void setParam(avm_size_t offset, const BF & aParam)
+ {
+ mParamReturnTable->set(offset, aParam);
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mParamReturnTable
+ * mReturnOffset
+ */
+ inline void setReturnOffset(avm_size_t aReturnOffset)
+ {
+ mReturnOffset = aReturnOffset;
+ }
+
+ inline avm_size_t getReturnCount() const
+ {
+ return( mParamReturnTable->size() - mReturnOffset );
+ }
+
+
+ inline bool hasReturn() const
+ {
+ return( mParamReturnTable.valid()
+ && (mReturnOffset < mParamReturnTable->size()) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mInstanceModel
+ */
+ inline InstanceOfMachine * getInstanceModel() const
+ {
+ return( mInstanceModel );
+ }
+
+ inline bool hasInstanceModel() const
+ {
+ return( mInstanceModel != NULL );
+ }
+
+ inline bool isInstanceModel(InstanceOfMachine * anOtherModel) const
+ {
+ return( (mInstanceModel != NULL)
+ && ( (mInstanceModel == anOtherModel)
+ || (anOtherModel->getSpecifier().isDesignPrototypeStatic()
+ && (mInstanceModel
+ == anOtherModel->getInstanceModel()) )));
+ }
+
+ inline void setInstanceModel(InstanceOfMachine * anInstanceModel)
+ {
+ mInstanceModel = anInstanceModel;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mRuntimeRID
+ */
+ inline const RuntimeID & getRuntimeRID() const
+ {
+ return( mRuntimeRID );
+ }
+
+ inline bool hasRuntimeRID() const
+ {
+ return( mRuntimeRID.valid() );
+ }
+
+ inline void setRuntimeRID(const RuntimeID & aRID)
+ {
+ mRuntimeRID = aRID;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * "autostart" modifier of Instance
+ */
+ inline bool isAutoStart() const
+ {
+ return( mModifierAutoStart );
+ }
+
+ inline void setAutoStart(bool bAutoStart = true)
+ {
+ mModifierAutoStart = bAutoStart;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mInputEnabledBuffer
+ */
+ inline void addInputEnabledBuffer(InstanceOfBuffer * aBuffer)
+ {
+ mInputEnabledBuffer.add_union( aBuffer );
+ }
+
+ inline void addInputEnabledBuffer(ListOfInstanceOfBuffer & inputEnabledBuffer)
+ {
+ mInputEnabledBuffer.add_union( inputEnabledBuffer );
+ }
+
+
+ inline ListOfInstanceOfBuffer & getInputEnabledBuffer()
+ {
+ return( mInputEnabledBuffer );
+ }
+
+ inline const ListOfInstanceOfBuffer & getInputEnabledBuffer() const
+ {
+ return( mInputEnabledBuffer );
+ }
+
+
+ bool containsInputEnabledBuffer(InstanceOfBuffer * aBuffer) const
+ {
+ return( mInputEnabledBuffer.contains(aBuffer) );
+ }
+
+ inline bool hasInputEnabledBuffer() const
+ {
+ return( mInputEnabledBuffer.nonempty() );
+ }
+
+
+ inline void setInputEnabledBuffer(ListOfInstanceOfBuffer & inputEnabledBuffer)
+ {
+ mInputEnabledBuffer.clear();
+
+ mInputEnabledBuffer.add_union( inputEnabledBuffer );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mInputEnabledCom
+ */
+ inline void addInputEnabledCom(InstanceOfPort * aPort)
+ {
+ mInputEnabledCom.add_union( aPort );
+ }
+
+ inline void addInputEnabledCom(ListOfInstanceOfPort & inputEnabledPort)
+ {
+ mInputEnabledCom.add_union( inputEnabledPort );
+ }
+
+
+ inline ListOfInstanceOfPort & getInputEnabledCom()
+ {
+ return( mInputEnabledCom );
+ }
+
+ inline const ListOfInstanceOfPort & getInputEnabledCom() const
+ {
+ return( mInputEnabledCom );
+ }
+
+
+ bool containsInputEnabledCom(InstanceOfPort * aPort) const
+ {
+ return( mInputEnabledCom.contains(aPort) );
+ }
+
+ inline bool hasInputEnabledCom() const
+ {
+ return( mInputEnabledCom.nonempty() );
+ }
+
+
+ inline void setInputEnabledCom(ListOfInstanceOfPort & inputEnabledPort)
+ {
+ mInputEnabledCom.clear();
+
+ mInputEnabledCom.add_union( inputEnabledPort );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mInputEnabledSave
+ */
+ inline void addInputEnabledSave(InstanceOfPort * aPort)
+ {
+ mInputEnabledSave.add_union( aPort );
+ }
+
+ inline void addInputEnabledSave(ListOfInstanceOfPort & inputEnabledSavePort)
+ {
+ mInputEnabledSave.add_union( inputEnabledSavePort );
+ }
+
+
+ inline ListOfInstanceOfPort & getInputEnabledSave()
+ {
+ return( mInputEnabledSave );
+ }
+
+ inline const ListOfInstanceOfPort & getInputEnabledSave() const
+ {
+ return( mInputEnabledSave );
+ }
+
+
+ bool containsInputEnabledSave(InstanceOfPort * aPort) const
+ {
+ return( mInputEnabledSave.contains(aPort) );
+ }
+
+ inline bool hasInputEnabledSave() const
+ {
+ return( mInputEnabledSave.nonempty() );
+ }
+
+
+ inline void setInputEnabledSave(ListOfInstanceOfPort & inputEnabledSavePort)
+ {
+ mInputEnabledSave.clear();
+
+ mInputEnabledSave.add_union( inputEnabledSavePort );
+ }
+
+
+ /**
+ * Serialization
+ */
+ void header(OutStream & out) const;
+
+ void strHeader(OutStream & out) const;
+
+ void toStream(OutStream & out) const;
+
+};
+
+
+}
+
+#endif /* INSTANCEOFMACHINE_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/executable/InstanceOfPort.cpp b/org.eclipse.efm.symbex/src/fml/executable/InstanceOfPort.cpp
new file mode 100644
index 0000000..254880a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/InstanceOfPort.cpp
@@ -0,0 +1,318 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 5 août 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "InstanceOfPort.h"
+
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/InstanceOfData.h>
+
+#include <fml/expression/BuiltinArray.h>
+
+#include <fml/runtime/RuntimeID.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+#include <fml/type/TypeManager.h>
+
+#include <fml/infrastructure/Port.h>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+InstanceOfPort::InstanceOfPort(BaseAvmProgram * aContainer,
+ PropertyElement * aCompiled, avm_offset_t anOffset,
+ avm_size_t aParameterCount, ENUM_IO_NATURE aNature)
+: BaseInstanceForm( CLASS_KIND_T( InstanceOfPort ),
+ aContainer, aCompiled, TypeManager::PORT, anOffset),
+mRouteOffset( anOffset ),
+mComPointNature( aNature ),
+
+mParameters(aParameterCount),
+mContents( ),
+
+mRoutingChannel( NULL ),
+
+mInputRoutingData( ),
+mOutputRoutingData( )
+{
+// AVM_OS_TRACE << "port::new :> " << getFullyQualifiedNameID() << std::endl;
+}
+
+
+/**
+ * Format a value w.r.t. its type
+ */
+void InstanceOfPort::formatStream(
+ OutStream & out, const BF & bfValue) const
+{
+ if( bfValue.is< ArrayBF >() )
+ {
+ formatStream(out, bfValue.as_ref< ArrayBF >());
+ }
+ else if( hasParameterType(0) )
+ {
+ getParameterType(0)->formatStream(out, bfValue);
+ }
+ else
+ {
+ out << bfValue.str();
+ }
+
+}
+
+void InstanceOfPort::formatStream(
+ OutStream & out, const ArrayBF & arrayValue) const
+{
+ out << out.VALUE_PARAMS_CSS.BEGIN;
+
+ if( hasParameterType(0) )
+ {
+ getParameterType(0)->formatStream(out, arrayValue[0]);
+ }
+ else
+ {
+ out << arrayValue[0].str();
+ }
+ for( avm_size_t offset = 1 ; offset < arrayValue.size() ; ++offset )
+ {
+ out << out.VALUE_PARAMS_CSS.SEPARATOR;
+
+ if( hasParameterType(offset) )
+ {
+ getParameterType(offset)->formatStream(out, arrayValue[offset]);
+ }
+ else
+ {
+ out << arrayValue[offset].str();
+ }
+ }
+
+ out << out.VALUE_PARAMS_CSS.END;
+}
+
+/**
+ * Serialization
+ */
+
+void InstanceOfPort::strParameter(OutStream & out, const BF & aParameter) const
+{
+ if( aParameter.is< BaseTypeSpecifier >() )
+ {
+ out << aParameter.to_ptr< BaseTypeSpecifier >()->strT();
+ }
+ else if( aParameter.is< InstanceOfData >() )
+ {
+ InstanceOfData * aVar = aParameter.to_ptr< InstanceOfData >();
+
+ out << aVar->strHeaderId();
+ if( aVar->hasValue() )
+ {
+ out << " = " << aVar->strValue();
+ }
+ }
+ // #bind expression parameter
+ else
+ {
+ out << "#bind " << aParameter.str();
+ }
+}
+
+void InstanceOfPort::strParameter(OutStream & out) const
+{
+ if( hasParameter() )
+ {
+ ArrayOfBF::const_iterator it = getParameters().begin();
+ ArrayOfBF::const_iterator endIt = getParameters().end();
+
+ out << "[ ";
+ strParameter(out, (*it));
+ for( ++it ; it != endIt ; ++it )
+ {
+ out << " , ";
+ strParameter(out, (*it));
+ }
+ out << " ]";
+ }
+}
+
+
+
+
+void InstanceOfPort::strHeader(OutStream & out) const
+{
+ out << getModifier().toString() << strComPointNature()
+ << "< id:" << getOffset() << " , route:" << getRouteOffset()
+ << " > " << getFullyQualifiedNameID();
+
+ strParameter(out);
+}
+
+
+std::string InstanceOfPort::strArg() const
+{
+ StringOutStream oss;
+
+ oss << getFullyQualifiedNameID();// << " '" << getNameID() << "'";
+
+ if( mRoutingChannel != NULL )
+ {
+ oss << "< #via " << mRoutingChannel->getFullyQualifiedNameID() << " >";
+ }
+
+ return( oss.str() );
+}
+
+
+void InstanceOfPort::toStream(OutStream & out) const
+{
+ if( out.preferablyFQN() )
+ {
+ out << TAB << getFullyQualifiedNameID();
+
+ AVM_DEBUG_REF_COUNTER(out);
+
+ return;
+ }
+
+ bool isEmpty = true;
+
+ out << TAB << getModifier().toString() << strComPointNature()
+ << "< id:" << getOffset() << " , route:" << getRouteOffset()
+ << " > " << getFullyQualifiedNameID();
+
+ AVM_DEBUG_REF_COUNTER(out);
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ out << " {" << EOL; isEmpty = false;
+
+ if( hasAstElement() )
+ {
+ out << TAB2 << "//compiled = "
+ << getAstFullyQualifiedNameID() << ";" << EOL;
+ }
+
+ out << TAB2 << "//container = "
+ << (hasContainer() ? getContainer()->getFullyQualifiedNameID() : "NULL")
+ << ";" << EOL;
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ if( hasAliasTarget() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+ out << TAB2 << "target = "
+ << str_header( getAliasTarget()->as< InstanceOfPort >() )
+ << ";" << EOL;
+ }
+
+ if( hasCreatorContainerRID() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+ out << TAB2 << "rid#creator = " << getCreatorContainerRID().str()
+ << ";" << EOL;
+ }
+
+ if( hasRuntimeContainerRID() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+ out << TAB2 << "rid#container = " << getRuntimeContainerRID().str()
+ << ";" << EOL;
+ }
+
+ if( hasInputRoutingData() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+ out << TAB2 << "routing#input#data = "
+ << getInputRoutingData().str() << ";" << EOL;
+ }
+
+ if( hasOutputRoutingData() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+ out << TAB2 << "routing#output#data = "
+ << getOutputRoutingData().str() << ";" << EOL;
+ }
+
+// os << TAB2 << "offset = " << getOffset() << ";" << EOL;
+
+ if( hasMachinePath() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+
+ out << TAB << "path#machine:" << EOL;
+ ArrayOfInstanceOfMachine::const_iterator it = getMachinePath()->begin();
+ ArrayOfInstanceOfMachine::const_iterator endIt = getMachinePath()->end();
+ for( ; it != endIt ; ++it )
+ {
+ out << TAB2 << (*it)->getFullyQualifiedNameID() << EOL;
+ }
+ }
+
+ if( hasParameter() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+
+ out << TAB << "parameter:" << EOL;
+ ArrayOfBF::const_iterator it = getParameters().begin();
+ ArrayOfBF::const_iterator endIt = getParameters().end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).is< BaseTypeSpecifier >() )
+ {
+ out << TAB2 << (*it).to_ptr< BaseTypeSpecifier >()->strT()
+ << ";" << EOL;
+ }
+ else if( (*it).is< InstanceOfData >() )
+ {
+ InstanceOfData * aVar = (*it).to_ptr< InstanceOfData >();
+
+ out << TAB2 << aVar->strHeaderId();
+ if( aVar->hasValue() )
+ {
+ out << " = " << aVar->strValue();
+ }
+ out << ";" << EOL;
+ }
+ // #bind expression parameter
+ else
+ {
+ out << TAB2 << "#bind " << (*it).str() << ";" << EOL;
+ }
+ }
+ }
+
+ if( hasContent() )
+ {
+ if( isEmpty ) { out << " {" << EOL; isEmpty = false; }
+
+ out << TAB << "contents:" << EOL;
+ TableOfSymbol::const_iterator it = getContents().begin();
+ TableOfSymbol::const_iterator endIt = getContents().end();
+ for( ; it != endIt ; ++it )
+ {
+ out << TAB2 << str_header( *it ) << EOL;
+ }
+ }
+
+ ( isEmpty ? (out << ";") : (out << TAB << "}") ) << EOL_FLUSH;
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/executable/InstanceOfPort.h b/org.eclipse.efm.symbex/src/fml/executable/InstanceOfPort.h
new file mode 100644
index 0000000..5d73925
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/InstanceOfPort.h
@@ -0,0 +1,422 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 5 août 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef INSTANCEOFPORT_H_
+#define INSTANCEOFPORT_H_
+
+#include <fml/executable/BaseInstanceForm.h>
+
+#include <common/AvmPointer.h>
+
+#include <fml/lib/IComPoint.h>
+
+#include <fml/executable/InstanceOfData.h>
+#include <fml/executable/RoutingData.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+
+#include <fml/infrastructure/Channel.h>
+#include <fml/infrastructure/Port.h>
+
+
+namespace sep
+{
+
+class ArrayBF;
+class BaseAvmProgram;
+class RoutingData;
+
+
+class InstanceOfPort :
+ public BaseInstanceForm,
+ public IComPoint,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( InstanceOfPort )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( InstanceOfPort )
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ avm_size_t mRouteOffset;
+
+ // the nature
+ ENUM_IO_NATURE mComPointNature;
+
+ // the Parameter Type Specifier
+ ArrayOfBF mParameters;
+
+ // the Contents of the port as channel
+ TableOfSymbol mContents;
+
+ InstanceOfPort * mRoutingChannel;
+
+ // The routing data access optimization
+ RoutingData mInputRoutingData;
+ RoutingData mOutputRoutingData;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ InstanceOfPort(BaseAvmProgram * aContainer,
+ PropertyElement * aCompiled, avm_offset_t anOffset,
+ avm_size_t aParameterCount, ENUM_IO_NATURE aNature);
+
+
+ /**
+ * CONSTRUCTOR
+ * copy
+ */
+ InstanceOfPort(const InstanceOfPort & aPort)
+ : BaseInstanceForm( aPort ),
+ mRouteOffset( aPort.mRouteOffset ),
+ mComPointNature( aPort.mComPointNature ),
+
+ mParameters( aPort.mParameters ),
+ mContents( aPort.mContents ),
+
+ mRoutingChannel( aPort.mRoutingChannel ),
+
+ mInputRoutingData( aPort.mInputRoutingData ),
+ mOutputRoutingData( aPort.mOutputRoutingData )
+ {
+ //!! NOTHING
+// AVM_OS_TRACE << "port::new :> " << getFullyQualifiedNameID() << std::endl;
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * via Channel
+ */
+ InstanceOfPort(BaseAvmProgram * aContainer, Port * chanPortCompiled,
+ InstanceOfPort * aChannel, InstanceOfPort * aTarget)
+ : BaseInstanceForm(CLASS_KIND_T( InstanceOfPort ),
+ aContainer, chanPortCompiled, aTarget),
+ mRouteOffset( aTarget->mRouteOffset ),
+ mComPointNature( aTarget->mComPointNature ),
+
+ mParameters( aTarget->mParameters ),
+ mContents( aTarget->mContents ),
+
+ mRoutingChannel( aChannel ),
+
+ mInputRoutingData( ),
+ mOutputRoutingData( )
+
+ {
+ setAliasTarget( aTarget );
+// AVM_OS_TRACE << "port::new :> " << getFullyQualifiedNameID() << std::endl;
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * for Alias
+ */
+ InstanceOfPort(BaseAvmProgram * aContainer, InstanceOfPort * aTarget,
+ VectorOfInstanceOfMachine & aRelativeMachinePath)
+ : BaseInstanceForm(CLASS_KIND_T( InstanceOfPort ), aContainer, aTarget,
+ aRelativeMachinePath),
+ mRouteOffset( aTarget->mRouteOffset ),
+ mComPointNature( aTarget->mComPointNature ),
+
+ mParameters( aTarget->mParameters ),
+ mContents( aTarget->mContents ),
+
+ mRoutingChannel( aTarget->mRoutingChannel ),
+
+ mInputRoutingData( ),
+ mOutputRoutingData( )
+
+ {
+ //!! NOTHING
+// AVM_OS_TRACE << "port::new :> " << getFullyQualifiedNameID() << std::endl;
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~InstanceOfPort()
+ {
+// AVM_OS_TRACE << "port::delete :> " << getFullyQualifiedNameID() << std::endl;
+ //!! NOTHING
+ }
+
+
+ /**
+ * Factory
+ * new Port à Channel
+ */
+ static InstanceOfPort * newChannel(BaseAvmProgram * aContainer,
+ Channel * aCompiled, avm_offset_t anOffset)
+ {
+ return( new InstanceOfPort(aContainer, aCompiled,
+ anOffset, 0, IO_CHANNEL_NATURE) );
+ }
+
+ /**
+ * GETTER - SETTER
+ * mRouteOffset
+ */
+ inline avm_size_t getRouteOffset() const
+ {
+ return( mRouteOffset );
+ }
+
+ inline void setRouteOffset(avm_size_t aRouteOffset)
+ {
+ mRouteOffset = aRouteOffset;
+ }
+
+
+ /**
+ * API
+ * IComPoint
+ * mComPointNature
+ * mComPointDirection
+ */
+ inline virtual ENUM_IO_NATURE getComPointNature() const
+ {
+ return( mComPointNature );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mParameters
+ */
+ inline ArrayOfBF & getParameters()
+ {
+ return( mParameters );
+ }
+
+ inline const ArrayOfBF & getParameters() const
+ {
+ return( mParameters );
+ }
+
+
+ inline const BF & getParameter(avm_size_t offset) const
+ {
+ return( mParameters[offset] );
+ }
+
+ inline BaseTypeSpecifier * getParameterType(avm_size_t offset) const
+ {
+ if( mParameters[offset].is< BaseTypeSpecifier >() )
+ {
+ return( mParameters[offset].to_ptr< BaseTypeSpecifier >() );
+ }
+ else if( mParameters[offset].is< BaseInstanceForm >() )
+ {
+ return( mParameters[offset].
+ to_ptr< BaseInstanceForm >()->getTypeSpecifier() );
+ }
+ return( NULL );
+ }
+
+
+ inline avm_size_t getParameterCount() const
+ {
+ return( mParameters.size() );
+ }
+
+
+ inline bool hasParameter() const
+ {
+ return( getParameterCount() > 0 );
+ }
+
+ inline bool hasParameterType(avm_size_t offset) const
+ {
+ if( offset < getParameterCount() )
+ {
+ if( mParameters[offset].is< BaseTypeSpecifier >() )
+ {
+ return( true );
+ }
+ else if( mParameters[offset].is< BaseInstanceForm >() )
+ {
+ return( mParameters[offset].
+ to_ptr< BaseInstanceForm >()->hasTypeSpecifier() );
+ }
+ }
+ return( false );
+ }
+
+ inline bool isParameterData(avm_size_t offset) const
+ {
+ return( mParameters[offset].is< InstanceOfData >() );
+ }
+
+
+ inline void setParameter(avm_size_t index, const BF & aParam)
+ {
+ mParameters[index]= aParam;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mContents
+ */
+ inline void appendContent(const Symbol & aSymbol)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( aSymbol )
+ << "Symbol as Channel content !!!"
+ << SEND_EXIT;
+
+ mContents.append(aSymbol);
+ }
+
+ inline TableOfSymbol & getContents()
+ {
+ return( mContents );
+ }
+
+ inline const TableOfSymbol & getContents() const
+ {
+ return( mContents );
+ }
+
+
+ inline const BF & getContent(avm_size_t offset) const
+ {
+ return( mContents[offset] );
+ }
+
+
+ inline avm_size_t getContentCount() const
+ {
+ return( mContents.size() );
+ }
+
+
+ inline bool hasContent() const
+ {
+ return( getContentCount() > 0 );
+ }
+
+
+ inline bool isContentData(avm_size_t offset) const
+ {
+ return( mContents[offset].is< InstanceOfData >() );
+ }
+
+ inline bool isContentPort(avm_size_t offset) const
+ {
+ return( mContents[offset].is< InstanceOfPort >() );
+ }
+
+
+ inline void setContent(avm_size_t index, const Symbol & aSymbol)
+ {
+ mContents[index]= aSymbol;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mRoutingChannel
+ */
+ inline InstanceOfPort * getRoutingChannel() const
+ {
+ return( mRoutingChannel );
+ }
+
+ inline bool hasRoutingChannel() const
+ {
+ return( mRoutingChannel != NULL );
+ }
+
+ inline void setRoutingChannel(InstanceOfPort * aRoutingChannel)
+ {
+ mRoutingChannel = aRoutingChannel;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mInputRoutingData
+ */
+ inline const RoutingData & getInputRoutingData() const
+ {
+ return( mInputRoutingData );
+ }
+
+ inline bool hasInputRoutingData() const
+ {
+ return( mInputRoutingData != NULL );
+ }
+
+ inline void setInputRoutingData(const RoutingData & anInputRoutingData)
+ {
+ mInputRoutingData = anInputRoutingData;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mOutputRoutingData
+ */
+ inline const RoutingData & getOutputRoutingData() const
+ {
+ return( mOutputRoutingData );
+ }
+
+ inline bool hasOutputRoutingData() const
+ {
+ return( mOutputRoutingData != NULL );
+ }
+
+ inline void setOutputRoutingData(const RoutingData & anOutputRoutingData)
+ {
+ mOutputRoutingData = anOutputRoutingData;
+ }
+
+
+ /**
+ * Format a value w.r.t. its type
+ */
+ virtual void formatStream(OutStream & out, const BF & bfValue) const;
+
+ virtual void formatStream(OutStream & out, const ArrayBF & arrayValue) const;
+
+
+ /**
+ * Serialization
+ */
+ void strParameter(OutStream & out, const BF & aParameter) const;
+ void strParameter(OutStream & out) const;
+
+ void strHeader(OutStream & out) const;
+
+ std::string strArg() const;
+
+ void toStream(OutStream & out) const;
+
+};
+
+
+}
+
+#endif /* INSTANCEOFPORT_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/executable/Router.cpp b/org.eclipse.efm.symbex/src/fml/executable/Router.cpp
new file mode 100644
index 0000000..fbd8baa
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/Router.cpp
@@ -0,0 +1,238 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "Router.h"
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/InstanceOfMachine.h>
+#include <fml/executable/InstanceOfPort.h>
+
+
+namespace sep
+{
+
+
+/*
+ * STATIC ATTRIBUTES
+ */
+Router Router::_NULL_;
+
+
+/**
+ * SETTER
+ * mInputRoutingTable
+ */
+void Router::appendInputRouting(InstanceOfPort * aPortInstance,
+ const RoutingData & aRoutingData)
+{
+ RoutingData & oldRoutingData =
+ getInputRouting( aPortInstance->getRouteOffset() );
+ if( oldRoutingData.valid() )
+ {
+ if( oldRoutingData.getMID() == aRoutingData.getMID() )
+ {
+ oldRoutingData.getBufferInstance().append(
+ aRoutingData.getBufferInstance() );
+
+ oldRoutingData.getBufferInstance().makeUnique();
+ }
+ else
+ {
+ AVM_OS_WARNING_ALERT
+ << "Unexpected a port < "
+ << aPortInstance->getFullyQualifiedNameID()
+ << " > with another routing<input> data in << "
+ << getMachine()->getFullyQualifiedNameID() << " >> !!!"
+ << SEND_ALERT;
+
+ AVM_OS_LOG << "Input Routing Data of port : "
+ << aPortInstance->getFullyQualifiedNameID() << std::endl;
+ oldRoutingData.toStream(AVM_OS_LOG << AVM_TAB_INDENT);
+ AVM_OS_LOG << END_INDENT << std::endl;
+ }
+ }
+ else
+ {
+ setInputRouting(aPortInstance->getRouteOffset(), aRoutingData);
+ }
+}
+
+void Router::setInputRouting(InstanceOfPort * aPortInstance,
+ const RoutingData & aRoutingData) const
+{
+ if( getInputRoutingTable().get(aPortInstance->getRouteOffset()).valid() )
+ {
+ AVM_OS_WARNING_ALERT
+ << "Unexpected a port < "
+ << aPortInstance->getFullyQualifiedNameID()
+ << " > with another routing<input> data in << "
+ << getMachine()->getFullyQualifiedNameID() + " >> !!!"
+ << SEND_ALERT;
+
+ AVM_OS_LOG << "Input Routing Data of port : "
+ << aPortInstance->getFullyQualifiedNameID() << std::endl;
+
+ getInputRoutingTable().get(aPortInstance->getRouteOffset()).
+ toStream(AVM_OS_LOG << AVM_TAB_INDENT);
+ AVM_OS_LOG << END_INDENT << std::endl;
+ }
+
+ setInputRouting(aPortInstance->getRouteOffset(), aRoutingData);
+}
+
+
+/**
+ * GETTER - SETTER
+ * mOutputRoutingTable
+ */
+void Router::appendOutputRouting(InstanceOfPort * aPortInstance,
+ const RoutingData & aRoutingData)
+{
+ RoutingData & oldRoutingData =
+ getOutputRouting( aPortInstance->getRouteOffset() );
+ if( oldRoutingData.valid() )
+ {
+ if( oldRoutingData.getMID() == aRoutingData.getMID() )
+ {
+ oldRoutingData.getBufferInstance().append(
+ aRoutingData.getBufferInstance() );
+
+ oldRoutingData.getBufferInstance().makeUnique();
+ }
+ else
+ {
+ AVM_OS_WARNING_ALERT
+ << "Unexpected a port < "
+ << aPortInstance->getFullyQualifiedNameID()
+ << " > with another routing<output> data in << "
+ << getMachine()->getFullyQualifiedNameID() << " >> !!!"
+ << SEND_ALERT;
+
+ AVM_OS_LOG << "Output Routing Data of port : "
+ << aPortInstance->getFullyQualifiedNameID() << std::endl;
+ oldRoutingData.toStream(AVM_OS_LOG << AVM_TAB_INDENT);
+
+ AVM_OS_LOG << END_INDENT << std::endl;
+ }
+ }
+ else
+ {
+ setOutputRouting(aPortInstance->getRouteOffset(), aRoutingData);
+ }
+}
+
+void Router::setOutputRouting(InstanceOfPort * aPortInstance,
+ const RoutingData & aRoutingData) const
+{
+ if( getOutputRoutingTable().get(aPortInstance->getRouteOffset()).valid() )
+ {
+ AVM_OS_WARNING_ALERT
+ << "Unexpected a port < "
+ << aPortInstance->getFullyQualifiedNameID()
+ << " > with another routing<output> data in << "
+ << getMachine()->getFullyQualifiedNameID() << " >> !!!"
+ << SEND_ALERT;
+
+ AVM_OS_LOG << "Output Routing Data of port : "
+ << aPortInstance->getFullyQualifiedNameID() << std::endl;
+
+ getOutputRoutingTable().get(aPortInstance->getRouteOffset()).
+ toStream(AVM_OS_LOG << AVM_TAB_INDENT);
+
+ AVM_OS_LOG << END_INDENT << std::endl;
+ }
+
+ setOutputRouting(aPortInstance->getRouteOffset(), aRoutingData);
+}
+
+
+/**
+ * TESTER
+ */
+bool Router::hasInputRouting(InstanceOfPort * aPort) const
+{
+ return( aPort->getModifier().hasDirectionInput()
+ && (aPort->getRouteOffset() < getInputRoutingTable().size())
+ && (getInputRouting(aPort->getRouteOffset()).getPort() == aPort) );
+}
+
+bool Router::hasOutputRouting(InstanceOfPort * aPort) const
+{
+ return( aPort->getModifier().hasDirectionOutput()
+ && (aPort->getRouteOffset() < getOutputRoutingTable().size())
+ && (getOutputRouting(aPort->getRouteOffset()).getPort() == aPort) );
+}
+
+
+/**
+ * Serialization
+ */
+void RouterElement::toStream(OutStream & os) const
+{
+ os << TAB << "router " << mMachine->getFullyQualifiedNameID();
+ if( mMachine->isThis() )
+ {
+ os << "< " << mMachine->getExecutable()->getFullyQualifiedNameID()
+ << " >";
+ }
+ AVM_DEBUG_REF_COUNTER(os);
+ os << " {" << EOL;
+
+ // routing table for INSTANCE
+ if( mInputRoutingTable.nonempty() )
+ {
+ os << TAB << "input:" << EOL_INCR_INDENT;
+
+ TableOfRoutingData::const_iterator it = mInputRoutingTable.begin();
+ TableOfRoutingData::const_iterator endIt = mInputRoutingTable.end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).valid() )
+ {
+ (*it).toStream(os);
+ }
+ else
+ {
+ os << TAB << "RoutingData<null>" << EOL;
+ }
+ }
+ os << DECR_INDENT;
+ }
+
+ if( mOutputRoutingTable.nonempty() )
+ {
+ os << TAB << "output:" << EOL_INCR_INDENT;
+
+ TableOfRoutingData::const_iterator it = mOutputRoutingTable.begin();
+ TableOfRoutingData::const_iterator endIt = mOutputRoutingTable.end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).valid() )
+ {
+ (*it).toStream(os);
+ }
+ else
+ {
+ os << TAB << "RoutingData<null>" << EOL;
+ }
+ }
+ os << DECR_INDENT;
+ }
+
+ os << TAB << "}" << EOL << std::flush;
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/executable/Router.h b/org.eclipse.efm.symbex/src/fml/executable/Router.h
new file mode 100644
index 0000000..ce38931
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/Router.h
@@ -0,0 +1,377 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef ROUTER_H_
+#define ROUTER_H_
+
+#include <base/SmartPointer.h>
+#include <common/Element.h>
+
+#include <collection/Vector.h>
+#include <common/BF.h>
+
+#include <fml/executable/RoutingData.h>
+
+
+namespace sep
+{
+
+
+class InstanceOfMachine;
+class InstanceOfPort;
+
+class Router;
+
+
+class RouterElement :
+ public Element ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( RouterElement )
+{
+
+ friend class Router;
+
+ AVM_DECLARE_CLONABLE_CLASS( RouterElement )
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ // The container instance
+ InstanceOfMachine * mMachine;
+
+ avm_size_t mRouteID;
+
+ TableOfRoutingData mInputRoutingTable;
+ TableOfRoutingData mOutputRoutingTable;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ RouterElement(InstanceOfMachine * aMachine,
+ avm_size_t aRouteID, avm_size_t msgCount = 0)
+ : Element( CLASS_KIND_T( Router ) ),
+ mMachine( aMachine ),
+ mRouteID( aRouteID ),
+ mInputRoutingTable( msgCount ),
+ mOutputRoutingTable( msgCount )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ explicit RouterElement(const RouterElement & anElement)
+ : Element( anElement ),
+ mMachine( anElement.mMachine ),
+ mRouteID( anElement.mRouteID ),
+ mInputRoutingTable( anElement.mInputRoutingTable ),
+ mOutputRoutingTable( anElement.mOutputRoutingTable )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~RouterElement()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * Serialization
+ */
+ virtual void toStream(OutStream & os) const;
+
+};
+
+
+class Router :
+ public SmartPointer< RouterElement , DestroyElementPolicy >,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( Router )
+{
+
+private:
+ /**
+ * TYPEDEF
+ */
+ typedef SmartPointer< RouterElement ,
+ DestroyElementPolicy > base_this_type;
+
+
+public:
+ /*
+ * STATIC ATTRIBUTES
+ */
+ static Router _NULL_;
+
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Router()
+ : base_this_type( )
+ {
+ //!! NOTHING
+ }
+
+ Router(InstanceOfMachine * aMachine,
+ avm_size_t aRouteID, avm_size_t msgCount = 0)
+ : base_this_type( new RouterElement(aMachine, aRouteID, msgCount) )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ Router(const Router & anElement)
+ : base_this_type( anElement )
+ {
+ //!! NOTHING
+ }
+
+public:
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Router()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * operator=
+ */
+ inline Router & operator=(const BF & other)
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( other.is< Router >() )
+ << "Invalid Assignment Cast of an inherit BF Class !!"
+ << SEND_EXIT;
+
+ if( base_this_type::mPTR != other.raw_pointer() )
+ {
+ release_acquire(
+ static_cast< RouterElement * >( other.raw_pointer() ) );
+ }
+ return( *this );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mMachine
+ */
+ inline InstanceOfMachine * getMachine() const
+ {
+ return( base_this_type::mPTR->mMachine );
+ }
+
+ inline bool hasMachine() const
+ {
+ return( base_this_type::mPTR->mMachine != NULL );
+ }
+
+
+ /**
+ * GETTER
+ * mRouteID
+ */
+ inline avm_size_t getRouteID() const
+ {
+ return( base_this_type::mPTR->mRouteID );
+ }
+
+ inline avm_size_t getTotalRouteCount() const
+ {
+ return( std::max(base_this_type::mPTR->mInputRoutingTable.size(),
+ base_this_type::mPTR->mOutputRoutingTable.size()) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mInputRoutingTable
+ */
+ inline TableOfRoutingData & getInputRoutingTable()
+ {
+ return( base_this_type::mPTR->mInputRoutingTable );
+ }
+
+ inline const TableOfRoutingData & getInputRoutingTable() const
+ {
+ return( base_this_type::mPTR->mInputRoutingTable );
+ }
+
+ inline RoutingData & getInputRouting(avm_offset_t offset)
+ {
+ return( base_this_type::mPTR->mInputRoutingTable.get(offset) );
+ }
+
+ inline const RoutingData & getInputRouting(avm_offset_t offset) const
+ {
+ return( base_this_type::mPTR->mInputRoutingTable.get(offset) );
+ }
+
+ inline bool hasInputRouting(avm_offset_t offset) const
+ {
+ return( base_this_type::mPTR->mInputRoutingTable.get(offset).valid() );
+ }
+
+ inline bool hasntInputRouting(avm_offset_t offset) const
+ {
+ return( base_this_type::mPTR->mInputRoutingTable.get(offset).invalid() );
+ }
+
+
+ inline void appendInputRouting(const RoutingData & aRoutingData) const
+ {
+ base_this_type::mPTR->mInputRoutingTable.append(aRoutingData);
+ }
+
+ void appendInputRouting(InstanceOfPort * aPortInstance,
+ const RoutingData & aRoutingData);
+
+
+ void setInputRouting(InstanceOfPort * aPortInstance,
+ const RoutingData & aRoutingData) const;
+
+ void setInputRouting(avm_offset_t offset,
+ const RoutingData & aRoutingData) const
+ {
+ base_this_type::mPTR->mInputRoutingTable.set(offset, aRoutingData);
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mOutputRoutingTable
+ */
+ inline TableOfRoutingData & getOutputRoutingTable()
+ {
+ return( base_this_type::mPTR->mOutputRoutingTable );
+ }
+
+ inline const TableOfRoutingData & getOutputRoutingTable() const
+ {
+ return( base_this_type::mPTR->mOutputRoutingTable );
+ }
+
+ inline RoutingData & getOutputRouting(avm_offset_t offset)
+ {
+ return( base_this_type::mPTR->mOutputRoutingTable.get(offset) );
+ }
+
+ inline const RoutingData & getOutputRouting(avm_offset_t offset) const
+ {
+ return( base_this_type::mPTR->mOutputRoutingTable.get(offset) );
+ }
+
+ inline bool hasOutputRouting(avm_offset_t offset) const
+ {
+ return( base_this_type::mPTR->mOutputRoutingTable.get(offset).valid() );
+ }
+
+ inline bool hasntOutputRouting(avm_offset_t offset) const
+ {
+ return( base_this_type::mPTR->mOutputRoutingTable.get(offset).invalid() );
+ }
+
+
+ inline void appendOutputRouting(const RoutingData & aRoutingData) const
+ {
+ base_this_type::mPTR->mOutputRoutingTable.append(aRoutingData);
+ }
+
+ void appendOutputRouting(InstanceOfPort * aPortInstance,
+ const RoutingData & aRoutingData);
+
+
+ void setOutputRouting(InstanceOfPort * aPortInstance,
+ const RoutingData & aRoutingData) const;
+
+ void setOutputRouting(avm_offset_t offset,
+ const RoutingData & aRoutingData) const
+ {
+ base_this_type::mPTR->mOutputRoutingTable.set(offset, aRoutingData);
+ }
+
+
+ /**
+ * TESTER
+ */
+ inline bool hasRouting(InstanceOfPort * aPort) const
+ {
+ return( hasInputRouting(aPort) || hasOutputRouting(aPort) );
+ }
+
+ bool hasInputRouting(InstanceOfPort * aPort) const;
+
+ bool hasOutputRouting(InstanceOfPort * aPort) const;
+
+
+ /**
+ * Serialization
+ */
+ inline virtual std::string toString(
+ const AvmIndent & indent = AVM_TAB_INDENT) const
+ {
+ if( base_this_type::mPTR != NULL )
+ {
+ StringOutStream oss(indent);
+
+ base_this_type::mPTR->toStream( oss );
+
+ return( oss.str() );
+ }
+ else
+ {
+ return( indent.TABS + "Router<null>" + indent.EOL );
+ }
+ }
+
+ inline void toStream(OutStream & os) const
+ {
+ if( base_this_type::mPTR != NULL )
+ {
+ base_this_type::mPTR->toStream(os);
+ }
+ else
+ {
+ os << "Router<null>" << std::flush;
+ }
+ }
+
+};
+
+
+/**
+ * TYPE DEFINITION
+ * TABLE of ROUTER
+ */
+typedef Vector< Router > TableOfRouter;
+
+
+
+
+}
+
+#endif /*ROUTER_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/executable/RoutingData.cpp b/org.eclipse.efm.symbex/src/fml/executable/RoutingData.cpp
new file mode 100644
index 0000000..de03c72
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/RoutingData.cpp
@@ -0,0 +1,128 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "RoutingData.h"
+
+#include <fml/executable/InstanceOfConnect.h>
+#include <fml/infrastructure/ComProtocol.h>
+
+
+namespace sep
+{
+
+
+/*
+ * STATIC ATTRIBUTES
+ */
+RoutingData RoutingData::_NULL_;
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+RoutingDataElement::RoutingDataElement(InstanceOfConnect * aConnector,
+ InstanceOfMachine * aMachine, InstanceOfPort * aPort)
+: Element( CLASS_KIND_T( RoutingData ) ),
+mMID( aConnector->getMID() ),
+mProtocol( aConnector->getProtocol() ),
+mConnect( aConnector ),
+mMachinePort(aMachine, aPort),
+mBufferInstance( ),
+mRuntimeRID( )
+{
+ //!! NOTHING
+}
+
+
+/**
+ * Serialization
+ */
+std::string RoutingData::str() const
+{
+ StringOutStream oss;
+
+ oss << "routing< " << ComProtocol::to_string( getProtocol() )
+ << " , mid:" << getMID()<< " >";
+
+ if( hasRuntimeRID() )
+ {
+ oss << " " << getRuntimeRID().str();
+ }
+
+ if( getBufferInstance().nonempty() )
+ {
+ oss << " [| ";
+ ListOfInstanceOfBuffer::const_iterator it = getBufferInstance().begin();
+ for( ; it != getBufferInstance().end() ; ++it )
+ {
+ oss << str_header( *it ) << " ";
+ }
+ oss << "|]";
+ }
+
+ return( oss.str() );
+}
+
+void RoutingDataElement::toStream(OutStream & os) const
+{
+ os << TAB << "routing< "
+ << ComProtocol::to_string(mProtocol)
+ << " , mid:" << mMID<< " > ";
+ if( getMachine()->isnotThis() )
+ {
+ os << ( mRuntimeRID.valid() ? mRuntimeRID.strUniqId() :
+ getMachine()->getFullyQualifiedNameID() ) << "->";
+ }
+ os << getPort()->getFullyQualifiedNameID() << " {";
+ AVM_DEBUG_REF_COUNTER(os);
+ os << EOL;
+
+// if( hasRuntimeRID() )
+// {
+// os << TAB2 << "rid#runtime = " << getRuntimeRID().str() << ";" << EOL;
+// }
+
+ if( mConnect != NULL )
+ {
+ os << TAB2 << "connector = "
+ << mConnect->getFullyQualifiedNameID() << ";" << EOL;
+ }
+
+// os << TAB2 << "machine = " << getMachine()->getFullyQualifiedNameID() << ";" << EOL;
+// os << TAB2 << "port = " << getPort()->getFullyQualifiedNameID() << ";" << EOL;
+
+ if( mBufferInstance.nonempty() )
+ {
+ os << TAB2 << "buffer = [|";
+ if( mBufferInstance.singleton() )
+ {
+ os << " " << str_header( mBufferInstance.first() ) << " ";
+ }
+ else
+ {
+ ListOfInstanceOfBuffer::const_iterator it = mBufferInstance.begin();
+ ListOfInstanceOfBuffer::const_iterator itEnd = mBufferInstance.end();
+ for( ; it != itEnd ; ++it )
+ {
+ os << EOL_TAB3 << str_header( *it );
+ }
+ os << EOL_TAB2;
+ }
+ os << "|];" << EOL;
+ }
+
+ os << TAB << "}" << EOL_FLUSH;
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/executable/RoutingData.h b/org.eclipse.efm.symbex/src/fml/executable/RoutingData.h
new file mode 100644
index 0000000..0e929e8
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/executable/RoutingData.h
@@ -0,0 +1,406 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef ROUTINGDATA_H_
+#define ROUTINGDATA_H_
+
+#include <base/SmartPointer.h>
+#include <common/Element.h>
+
+#include <collection/Pair.h>
+#include <collection/Vector.h>
+
+#include <fml/lib/IComPoint.h>
+
+#include <fml/executable/InstanceOfBuffer.h>
+
+#include <fml/infrastructure/ComProtocol.h>
+
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+
+class InstanceOfConnect;
+class InstanceOfMachine;
+class InstanceOfPort;
+
+class RoutingData;
+
+
+class RoutingDataElement :
+ public Element ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( RoutingDataElement )
+{
+
+ friend class RoutingData;
+
+ AVM_DECLARE_CLONABLE_CLASS( RoutingDataElement )
+
+public:
+ typedef Pair < InstanceOfMachine * , InstanceOfPort * > PairMachinePort;
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ // The Message Identifier
+ avm_size_t mMID;
+
+ // global protocol
+ ComProtocol::PROTOCOL_KIND mProtocol;
+
+ // The connector instance
+ InstanceOfConnect * mConnect;
+
+ // The concerned MACHINE and the PORT
+ PairMachinePort mMachinePort;
+
+ // list of local protocol and buffer
+ ListOfInstanceOfBuffer mBufferInstance;
+
+ // The runtime machine RID for RID access optimization
+ RuntimeID mRuntimeRID;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ RoutingDataElement(avm_size_t mid, InstanceOfMachine * aMachine,
+ InstanceOfPort * aPort, ComProtocol::PROTOCOL_KIND aProtocol)
+ : Element( CLASS_KIND_T( RoutingData ) ),
+ mMID( mid ),
+ mProtocol( aProtocol ),
+ mConnect( NULL ),
+ mMachinePort(aMachine, aPort),
+ mBufferInstance( ),
+ mRuntimeRID( )
+ {
+ //!! NOTHING
+ }
+
+ RoutingDataElement(InstanceOfConnect * aConnector,
+ InstanceOfMachine * aMachine, InstanceOfPort * aPort);
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ explicit RoutingDataElement(const RoutingDataElement & anElement)
+ : Element( anElement ),
+ mMID( anElement.mMID ),
+ mProtocol( anElement.mProtocol ),
+ mConnect( anElement.mConnect ),
+ mMachinePort( anElement.mMachinePort ),
+ mBufferInstance( anElement.mBufferInstance ),
+ mRuntimeRID( anElement.mRuntimeRID )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~RoutingDataElement()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * GETTER
+ * mMachinePort
+ */
+ inline InstanceOfMachine * getMachine() const
+ {
+ return( mMachinePort.first() );
+ }
+
+ inline InstanceOfPort * getPort() const
+ {
+ return( mMachinePort.second() );
+ }
+
+ /**
+ * Serialization
+ */
+ virtual void toStream(OutStream & os) const;
+
+};
+
+
+class RoutingData :
+ public SmartPointer< RoutingDataElement , DestroyElementPolicy >,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( RoutingData )
+{
+
+private:
+ /**
+ * TYPEDEF
+ */
+ typedef SmartPointer< RoutingDataElement ,
+ DestroyElementPolicy > base_this_type;
+
+ typedef Pair < InstanceOfMachine * , InstanceOfPort * > PairMachinePort;
+
+
+public:
+ /*
+ * STATIC ATTRIBUTES
+ */
+ static RoutingData _NULL_;
+
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ RoutingData()
+ : base_this_type( )
+ {
+ //!! NOTHING
+ }
+
+ RoutingData(avm_size_t mid, InstanceOfMachine * aMachine,
+ InstanceOfPort * aPort, ComProtocol::PROTOCOL_KIND aProtocol)
+ : base_this_type( new RoutingDataElement(mid, aMachine, aPort, aProtocol) )
+ {
+ //!! NOTHING
+ }
+
+ RoutingData(InstanceOfConnect * aConnector,
+ InstanceOfMachine * aMachine, InstanceOfPort * aPort)
+ : base_this_type( new RoutingDataElement(aConnector, aMachine, aPort) )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ RoutingData(const RoutingData & anElement)
+ : base_this_type( anElement )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~RoutingData()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mMID
+ */
+ inline avm_size_t getMID() const
+ {
+ return( base_this_type::mPTR->mMID );
+ }
+
+ inline void setMID(avm_size_t mid) const
+ {
+ base_this_type::mPTR->mMID = mid;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mProtocol
+ */
+ inline ComProtocol::PROTOCOL_KIND getProtocol() const
+ {
+ return( base_this_type::mPTR->mProtocol );
+ }
+
+ inline bool isProtocolENV() const
+ {
+ return( base_this_type::mPTR->mProtocol
+ == ComProtocol::PROTOCOL_ENVIRONMENT_KIND );
+ }
+
+ inline bool isnotProtocolENV() const
+ {
+ return( base_this_type::mPTR->mProtocol
+ != ComProtocol::PROTOCOL_ENVIRONMENT_KIND );
+ }
+
+ inline bool isProtocolBUFFER() const
+ {
+ return( base_this_type::mPTR->mProtocol
+ == ComProtocol::PROTOCOL_BUFFER_KIND );
+ }
+
+ inline bool isProtocolRDV() const
+ {
+ return( base_this_type::mPTR->mProtocol
+ == ComProtocol::PROTOCOL_RDV_KIND );
+ }
+
+ inline bool isProtocolMULTI_RDV() const
+ {
+ return( base_this_type::mPTR->mProtocol
+ == ComProtocol::PROTOCOL_MULTIRDV_KIND );
+ }
+
+ inline bool isProtocolANYCAST() const
+ {
+ return( base_this_type::mPTR->mProtocol
+ == ComProtocol::PROTOCOL_ANYCAST_KIND );
+ }
+
+ inline void setProtocol(ComProtocol::PROTOCOL_KIND aProtocol) const
+ {
+ base_this_type::mPTR->mProtocol = aProtocol;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mConnect
+ */
+ inline InstanceOfConnect * getConnect() const
+ {
+ return( base_this_type::mPTR->mConnect );
+ }
+
+ inline bool hasConnect() const
+ {
+ return( base_this_type::mPTR->mConnect != NULL );
+ }
+
+ inline void setConnect(InstanceOfConnect * anConnect) const
+ {
+ base_this_type::mPTR->mConnect = anConnect;
+ }
+
+
+ /**
+ * GETTER
+ * mMachinePort
+ */
+ inline PairMachinePort & getMachinePort() const
+ {
+ return( base_this_type::mPTR->mMachinePort );
+ }
+
+ inline InstanceOfMachine * getMachine() const
+ {
+ return( base_this_type::mPTR->mMachinePort.first() );
+ }
+
+ inline InstanceOfPort * getPort() const
+ {
+ return( base_this_type::mPTR->mMachinePort.second() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * tableOfBufferOffset
+ */
+ inline ListOfInstanceOfBuffer & getBufferInstance()
+ {
+ return( base_this_type::mPTR->mBufferInstance );
+ }
+
+ inline const ListOfInstanceOfBuffer & getBufferInstance() const
+ {
+ return( base_this_type::mPTR->mBufferInstance );
+ }
+
+ inline void appendBuffer(InstanceOfBuffer * aBuffer)
+ {
+ getBufferInstance().push_back(aBuffer);
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mRuntimeRID
+ */
+ inline const RuntimeID & getRuntimeRID() const
+ {
+ return( base_this_type::mPTR->mRuntimeRID );
+ }
+
+ inline bool hasRuntimeRID() const
+ {
+ return( base_this_type::mPTR->mRuntimeRID.valid() );
+ }
+
+ inline void setRuntimeRID(const RuntimeID & aRID) const
+ {
+ base_this_type::mPTR->mRuntimeRID = aRID;
+ }
+
+
+ /**
+ * Serialization
+ */
+ virtual std::string str() const;
+
+ inline virtual std::string toString(
+ const AvmIndent & indent = AVM_TAB_INDENT) const
+ {
+ if( base_this_type::mPTR != NULL )
+ {
+ StringOutStream oss(indent);
+
+ base_this_type::mPTR->toStream( oss );
+
+ return( oss.str() );
+ }
+ else
+ {
+ return( indent.TABS + "RoutingData<null>" + indent.EOL);
+ }
+ }
+
+ inline void toStream(OutStream & os) const
+ {
+ if( base_this_type::mPTR != NULL )
+ {
+ base_this_type::mPTR->toStream(os);
+ }
+ else
+ {
+ os << "RoutingData<null>" << std::flush;
+ }
+ }
+
+};
+
+
+/**
+ * TYPE DEFINITION
+ * TABLE of ROUTING DATA
+ */
+typedef Vector< RoutingData > TableOfRoutingData;
+
+
+}
+
+#endif /*ROUTINGDATA_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/expression/AvmCode.cpp b/org.eclipse.efm.symbex/src/fml/expression/AvmCode.cpp
new file mode 100644
index 0000000..9f06dec
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/AvmCode.cpp
@@ -0,0 +1,1427 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "AvmCode.h"
+
+#include <fml/common/BehavioralElement.h>
+#include <fml/common/ObjectElement.h>
+
+#include <fml/executable/AvmProgram.h>
+#include <fml/executable/BaseAvmProgram.h>
+#include <fml/executable/BaseCompiledForm.h>
+#include <fml/executable/BaseInstanceForm.h>
+
+#include <fml/expression/BuiltinArray.h>
+#include <fml/builtin/BuiltinForm.h>
+#include <fml/expression/ExpressionComparer.h>
+#include <fml/expression/ExpressionComparer.h>
+#include <fml/expression/StatementTypeChecker.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/runtime/RuntimeID.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+
+#include <fml/workflow/UniFormIdentifier.h>
+#include <fml/workflow/WObject.h>
+
+
+namespace sep
+{
+
+
+/**
+ * DEFAULT NULL
+ */
+BFCode BFCode::REF_NULL;
+
+
+/**
+ * COMPARISON
+ * OPERATOR
+ */
+int AvmCode::compare(const AvmCode & other) const
+{
+ if( this == &other )
+ {
+ return( 0 );
+ }
+ else if( sameOperator( other ) )
+ {
+ int cmpResult = 0;
+
+ AvmCode::const_iterator it = begin();
+ AvmCode::const_iterator endIt = end();
+
+ AvmCode::const_iterator itOther = other.begin();
+ AvmCode::const_iterator endOther = other.end();
+
+ for( ; (it != endIt) && (itOther != endOther) ; ++it , ++itOther )
+ {
+ cmpResult = (*it).compare( *itOther );
+ if( cmpResult != 0 )
+ {
+ return( cmpResult );
+ }
+ }
+
+ return( (size() == other.size()) ? 0 :
+ ((size() < other.size()) ? -1 : 1) );
+ }
+ else
+ {
+ return( (getAvmOpCode() < other.getAvmOpCode()) ? -1 : 1 );
+ }
+}
+
+bool AvmCode::isEQ(const AvmCode & other) const
+{
+ if( this == &other )
+ {
+ return( true );
+ }
+ else if( sameOperator( other ) && (size() == other.size()) )
+ {
+ AvmCode::const_iterator it = begin();
+ AvmCode::const_iterator endIt = end();
+ AvmCode::const_iterator itOther = other.begin();
+ for( ; it != endIt ; ++it , ++itOther )
+ {
+ if( not (*it).isEQ( *itOther ) )
+ {
+ return( false );
+ }
+ }
+ return( true );
+ }
+ else
+ {
+ return( false );
+ }
+}
+
+
+/**
+ * AvmCode::toStream
+ * Serialization
+ */
+OutStream & AvmCode::toDebug(OutStream & out) const
+{
+AVM_IF_DEBUG_NOT_FLAG_AND( BYTECODE , hasInstruction() )
+
+ AVM_DEBUG_ENABLE_FLAG( BYTECODE )
+
+ toStreamWithBytecode( out << TAB << "$" ) << EOL_FLUSH;
+
+ AVM_DEBUG_DISABLE_FLAG( BYTECODE )
+
+AVM_ELSE
+
+ toStream(out);
+
+AVM_ENDIF_DEBUG_NOT_FLAG_AND( BYTECODE )
+
+ return( out );
+}
+
+
+void AvmCode::toStreamPrefix(OutStream & out, const BF & arg)
+{
+ if( arg.invalid() )
+ {
+ out << TAB << "null<avmcode::arg>" << EOL;
+ }
+
+ else if( arg.is< BuiltinForm >() )
+ {
+ out << TAB << arg.to_ptr< BuiltinForm >()->str() << EOL;
+ }
+
+ else if( arg.is< Operator >() )
+ {
+ out << TAB << arg.to_ptr< Operator >()->standardSymbol();
+ arg.AVM_DEBUG_REF_COUNTER(out);
+ out << EOL;
+ }
+ else if( arg.is< Routine >() )
+ {
+ arg.to_ptr< Routine >()->toStreamInvoke(out);
+ }
+
+ else if( arg.is< PropertyElement >() )
+ {
+ out << TAB << "&"
+ << arg.to_ptr< PropertyElement >()->getFullyQualifiedNameID();
+ arg.AVM_DEBUG_REF_COUNTER(out);
+ out << EOL;
+ }
+ else if( arg.is< BaseInstanceForm >() )
+ {
+ out << TAB
+ << arg.to_ptr< BaseInstanceForm >()->getFullyQualifiedNameID();
+ arg.AVM_DEBUG_REF_COUNTER(out);
+ out << EOL;
+ }
+ else if( arg.is< BehavioralElement >() )
+ {
+ out << TAB << "&"
+ << arg.to_ptr< BehavioralElement >()->getFullyQualifiedNameID();
+ arg.AVM_DEBUG_REF_COUNTER(out);
+ out << EOL;
+ }
+
+ else if( WObjectManager::is( arg ) )
+ {
+ out << TAB << "&"
+ << WObjectManager::from( arg )->getFullyQualifiedNameID();
+ arg.AVM_DEBUG_REF_COUNTER(out);
+ out << EOL;
+ }
+
+ else if( arg.is< RuntimeID >() )
+ {
+ out << TAB << arg.bfRID().str() << EOL;
+ }
+
+ else if( arg.is_exactly< AvmProgram >() )
+ {
+ AvmProgram * aProg = arg.to_ptr< AvmProgram >();
+ if( aProg->isAnonym() )
+ {
+ aProg->toStream(out);
+ }
+ else
+ {
+ out << TAB << aProg->getFullyQualifiedNameID();
+ arg.AVM_DEBUG_REF_COUNTER(out);
+ out << EOL;
+ }
+ }
+ else if( arg.is< BaseAvmProgram >() )
+ {
+ out << TAB
+ << arg.to_ptr< BaseAvmProgram >()->getFullyQualifiedNameID();
+ arg.AVM_DEBUG_REF_COUNTER(out);
+ out << EOL;
+ }
+
+ else if( arg.is< BaseTypeSpecifier >() )
+ {
+ out << TAB
+ << arg.to_ptr< BaseTypeSpecifier >()->getFullyQualifiedNameID();
+ arg.AVM_DEBUG_REF_COUNTER(out);
+ out << EOL;
+ }
+
+ else if( arg.is< ObjectElement >() )
+ {
+ out << TAB << "&"
+ << arg.to_ptr< ObjectElement >()->getFullyQualifiedNameID();
+ arg.AVM_DEBUG_REF_COUNTER(out);
+ out << EOL;
+ }
+
+ else if( arg.is< BuiltinArray >() )
+ {
+ arg.to_ptr< BuiltinArray >()->toStream(out);
+ }
+
+ else if ( arg.is< AvmCode >() )
+ {
+ arg.to_ptr< AvmCode >()->toStreamPrefix(out);
+ }
+
+ else
+ {
+ out << arg;
+ }
+
+ out << std::flush;
+}
+
+
+OutStream & AvmCode::toStreamWithBytecode(OutStream & out) const
+{
+ out << "{ " << strOperator() << " "
+ << mInstruction->getMainBytecode().strCode()
+ << EOL_INCR_INDENT;
+
+ if( nonempty() )
+ {
+ const_iterator it = begin();
+ const_iterator itEnd = end();
+ for( avm_size_t argOffset = 0 ; it != itEnd ; ++it , ++argOffset )
+ {
+ out << TAB << "$( " << mInstruction->at(argOffset).strCode();
+
+ if( (*it).is< AvmCode >() )
+ {
+ out << " ";
+
+ if( (*it).to_ptr< AvmCode >()->hasInstruction() )
+ {
+ (*it).to_ptr< AvmCode >()->toStreamWithBytecode(out);
+ }
+ else
+ {
+ (*it).to_ptr< AvmCode >()->toStreamPrefix(
+ out << IGNORE_FIRST_TAB, false );
+ }
+ }
+ else
+ {
+ ScopeNewIndent asni(out, AVM_STR_INDENT);
+
+ toStreamPrefix( out , (*it) );
+ }
+ out << " )" << EOL;
+ }
+ }
+
+ out << DECR_INDENT_TAB << "}" << std::flush;
+
+ return( out );
+}
+
+
+OutStream & AvmCode::toStreamRoutine(OutStream & out) const
+{
+AVM_IF_DEBUG_FLAG( BYTECODE )
+
+ if( hasInstruction() )
+ {
+ toStreamWithBytecode( out << "$" ) << EOL_FLUSH;
+ }
+ else if( OperatorManager::isSchedule(mOperator) )
+ {
+ out << " " << strOperator() << EOL;
+
+ AvmCode::const_iterator it = begin();
+ AvmCode::const_iterator endIt = end();
+ for( ; it != endIt ; ++it )
+ {
+ toStreamPrefix(out, (*it));
+ }
+ }
+ else
+ {
+ toStreamPrefix( out << EOL );
+ }
+
+ return( out );
+
+AVM_ENDIF_DEBUG_FLAG( BYTECODE )
+
+ if( OperatorManager::isSchedule(mOperator) )
+ {
+ out << " " << strOperator() << EOL;
+
+ AvmCode::const_iterator it = begin();
+ AvmCode::const_iterator endIt = end();
+ for( ; it != endIt ; ++it )
+ {
+ prettyPrinter(out, (*it));
+ }
+ }
+ else
+ {
+ prettyPrinter( out << EOL );
+ }
+
+ return( out );
+}
+
+
+void AvmCode::toStreamPrefix(OutStream & out, bool printEOL) const
+{
+AVM_IF_DEBUG_FLAG_AND( BYTECODE , hasInstruction() )
+
+ toStreamWithBytecode( out << TAB << "$" ) << EOL_FLUSH;
+
+AVM_ELSE_IF( hasOperator() )
+
+ std::string strOperatorStd = strOperator();
+
+ out << TAB << "${" << strOperatorStd;
+
+ if( OperatorManager::isSchedule( mOperator ) ||
+ OperatorManager::isConditionnal( mOperator ) )
+ {
+ out << EOL_INCR_INDENT;
+ for( const_iterator it = begin() ; it != end() ; ++it )
+ {
+ toStreamPrefix(out, (*it));
+ }
+ out << DECR_INDENT_TAB << "}" << std::flush;
+ }
+
+ else if( OperatorManager::isActivity( mOperator )
+ && populated()
+ && second().is< AvmCode >()
+ && StatementTypeChecker::isAssign( second() ) )
+ {
+ const_iterator it = begin();
+ toStreamPrefix( (out << AVM_STR_INDENT), (*it) );
+ out << END_INDENT << EOL_INCR_INDENT;
+ for( ++it ; it != end() ; ++it )
+ {
+ toStreamPrefix(out, (*it));
+ }
+ out << DECR_INDENT_TAB << "}" << std::flush;
+ }
+
+ else //if( OperatorManager::isUfiOrCtor( mOperator ) )
+ {
+ out << AVM_STR_INDENT;
+ for( const_iterator it = begin() ; it != end() ; ++it )
+ {
+ toStreamPrefix(out, (*it));
+ }
+ out << END_INDENT << " }" << std::flush;
+ }
+
+ if( printEOL )
+ {
+ out << EOL_FLUSH;
+ }
+
+ return;
+
+AVM_ELSE_IF( nonempty() )
+
+ out << TAB << "{" << EOL_INCR_INDENT;
+ for( const_iterator it = begin() ; it != end() ; ++it )
+ {
+ toStreamPrefix(out, (*it));
+ }
+ out << DECR_INDENT_TAB << "}" << EOL_FLUSH;
+
+AVM_ENDIF_DEBUG_FLAG_AND( BYTECODE )
+}
+
+
+
+void AvmCode::prettyPrinter(OutStream & out, bool isStatement) const
+{
+// switch( mOperator->getFixNotation() )
+// {
+// case NOTATION_FUNCTION:
+// case NOTATION_INFIX:
+// case NOTATION_PREFIX:
+// case NOTATION_SUFFIX:
+// default:
+// }
+
+ switch( mOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_NULL:
+
+ // AVM NOP STATEMENT
+ case AVM_OPCODE_NOP:
+
+ case AVM_OPCODE_FAILED:
+ case AVM_OPCODE_THROW:
+
+ // AVM META STATEMENT
+ case AVM_OPCODE_INFORMAL:
+
+ case AVM_OPCODE_TRACE:
+
+ case AVM_OPCODE_DEBUG:
+
+ case AVM_OPCODE_COMMENT:
+
+ case AVM_OPCODE_QUOTE:
+
+ case AVM_OPCODE_META_EVAL:
+ case AVM_OPCODE_META_RUN:
+ {
+ prettyPrinterBasicStatement( out , isStatement );
+
+ break;
+ }
+
+ // AVM UFI STATEMENT
+ case AVM_OPCODE_UFI:
+ {
+ prettyPrinterDefault( out , false );
+
+ break;
+ }
+
+ // AVM FORM CONSTRUCTOR STATEMENT
+ case AVM_OPCODE_CTOR:
+ {
+ out << TAB << "ctor<" << AVM_STR_INDENT;
+
+ prettyPrinter( out , first() , false );
+
+ out << " >(";
+
+ prettyPrinter( out , second() , false );
+
+ out << " )" << END_INDENT_EOL;
+
+ break;
+ }
+
+ // AVM FORM REGEX STATEMENT
+ case AVM_OPCODE_REGEX:
+ {
+ prettyPrinterDefault( out , false );
+
+ break;
+ }
+
+ // AVM MACHINE MANAGING
+ case AVM_OPCODE_CONTEXT_SWITCHER:
+ {
+ out << TAB << "ctx<" << AVM_STR_INDENT;
+
+ prettyPrinter( out , first() , false );
+
+ out << TAB << "> " << END_INDENT << IGNORE_FIRST_TAB;
+
+ prettyPrinter( out , second() , isStatement );
+
+ break;
+ }
+
+ case AVM_OPCODE_INIT:
+ case AVM_OPCODE_FINAL:
+ case AVM_OPCODE_DESTROY:
+
+ case AVM_OPCODE_START:
+ case AVM_OPCODE_RESTART:
+ case AVM_OPCODE_STOP:
+
+ case AVM_OPCODE_WAIT:
+
+ case AVM_OPCODE_SUSPEND:
+ case AVM_OPCODE_RESUME:
+
+ case AVM_OPCODE_IENABLE_INVOKE:
+ case AVM_OPCODE_ENABLE_INVOKE:
+ case AVM_OPCODE_ENABLE_SET:
+
+ case AVM_OPCODE_IDISABLE_INVOKE:
+ case AVM_OPCODE_DISABLE_INVOKE:
+ case AVM_OPCODE_DISABLE_SET:
+ case AVM_OPCODE_DISABLE_CHILD:
+ case AVM_OPCODE_DISABLE_SELF:
+ case AVM_OPCODE_DISABLE_SELVES:
+
+ case AVM_OPCODE_IABORT_INVOKE:
+ case AVM_OPCODE_ABORT_INVOKE:
+ case AVM_OPCODE_ABORT_SET:
+ case AVM_OPCODE_ABORT_CHILD:
+ case AVM_OPCODE_ABORT_SELF:
+ case AVM_OPCODE_ABORT_SELVES:
+
+ case AVM_OPCODE_HISTORY_CLEAR:
+ case AVM_OPCODE_DEEP_HISTORY_INVOKE:
+ case AVM_OPCODE_SHALLOW_HISTORY_INVOKE:
+
+ case AVM_OPCODE_IRUN:
+ case AVM_OPCODE_RUN:
+ case AVM_OPCODE_RTC:
+
+ case AVM_OPCODE_SCHEDULE_INVOKE:
+ case AVM_OPCODE_SCHEDULE_GET:
+ case AVM_OPCODE_SCHEDULE_IN:
+ case AVM_OPCODE_SCHEDULE_SET:
+
+ case AVM_OPCODE_DEFER_INVOKE:
+ case AVM_OPCODE_DEFER_GET:
+ case AVM_OPCODE_DEFER_SET:
+
+ case AVM_OPCODE_GOTO:
+ {
+ prettyPrinterBasicStatement( out , isStatement );
+
+ break;
+ }
+
+ case AVM_OPCODE_FORK:
+ case AVM_OPCODE_JOIN:
+
+ case AVM_OPCODE_INPUT_ENABLED:
+
+ case AVM_OPCODE_RDV:
+
+ case AVM_OPCODE_SYNCHRONIZE:
+ {
+ prettyPrinterDefault( out , isStatement );
+
+ break;
+ }
+
+ case AVM_OPCODE_INVOKE_NEW:
+
+ case AVM_OPCODE_INVOKE_ROUTINE:
+
+ case AVM_OPCODE_INVOKE_TRANSITION:
+
+ case AVM_OPCODE_INVOKE_METHOD:
+ case AVM_OPCODE_INVOKE_PROGRAM:
+ case AVM_OPCODE_INVOKE_FUNCTION:
+
+ case AVM_OPCODE_INVOKE_LAMBDA_APPLY:
+ case AVM_OPCODE_INVOKE_LAMBDA_LET:
+ {
+ prettyPrinterBasicStatement( out , isStatement );
+
+ break;
+ }
+
+ // AVM MACHINE STATUS
+ case AVM_OPCODE_STATUS_WAS:
+ case AVM_OPCODE_STATUS_IS:
+ case AVM_OPCODE_STATUS_BEING:
+ case AVM_OPCODE_STATUS_WILL:
+
+ case AVM_OPCODE_CHANGED:
+ case AVM_OPCODE_CHANGED_TO:
+ {
+ prettyPrinterDefault( out , isStatement );
+
+ break;
+ }
+
+
+ // AVM PROGRAM SCHEDULING
+ case AVM_OPCODE_ASYNCHRONOUS:
+ case AVM_OPCODE_STRONG_SYNCHRONOUS:
+ case AVM_OPCODE_WEAK_SYNCHRONOUS:
+
+ case AVM_OPCODE_INTERLEAVING:
+ case AVM_OPCODE_PARTIAL_ORDER_REDUCTION:
+
+ case AVM_OPCODE_PARALLEL:
+
+ // Optimized version of concurrency for RDV synchronization
+ case AVM_OPCODE_RDV_ASYNCHRONOUS:
+ case AVM_OPCODE_RDV_STRONG_SYNCHRONOUS:
+ case AVM_OPCODE_RDV_WEAK_SYNCHRONOUS:
+
+ case AVM_OPCODE_RDV_INTERLEAVING:
+ case AVM_OPCODE_RDV_PARTIAL_ORDER_REDUCTION:
+
+ case AVM_OPCODE_RDV_PARALLEL:
+
+ case AVM_OPCODE_EXCLUSIVE:
+
+ case AVM_OPCODE_NONDETERMINISM:
+
+ case AVM_OPCODE_PRIOR_GT:
+ case AVM_OPCODE_PRIOR_LT:
+
+ case AVM_OPCODE_SCHEDULE_AND_THEN:
+ case AVM_OPCODE_SCHEDULE_OR_ELSE:
+
+ case AVM_OPCODE_ATOMIC_SEQUENCE:
+
+ case AVM_OPCODE_SEQUENCE:
+ case AVM_OPCODE_SEQUENCE_SIDE:
+ case AVM_OPCODE_SEQUENCE_WEAK:
+
+ case AVM_OPCODE_PRODUCT:
+
+ // AVM BUFFER MANAGING
+ case AVM_OPCODE_UPDATE_BUFFER:
+ {
+ prettyPrinterBlockStatement( out , isStatement );
+
+ break;
+ }
+
+ // LAMBDA STATEMENT
+ case AVM_OPCODE_APPLY:
+
+ case AVM_OPCODE_LAMBDA:
+
+ // FUNCTIONB STATEMENT
+ case AVM_OPCODE_FUN:
+
+
+ // LET STATEMENT
+ case AVM_OPCODE_LET:
+ {
+ prettyPrinterDefault( out , isStatement );
+
+ break;
+ }
+
+ // LOOKUP STATEMENT
+ case AVM_OPCODE_LOOKUP_INT_EXT:
+ case AVM_OPCODE_LOOKUP_INT:
+ case AVM_OPCODE_LOOKUP_NEAREST:
+ case AVM_OPCODE_LOOKUP_BELOW:
+ case AVM_OPCODE_LOOKUP_ABOVE:
+ case AVM_OPCODE_LOOKUP2D_INT_EXT:
+ {
+ prettyPrinterFunctional( out );
+
+ break;
+ }
+
+ // AVM PRIMITIVE STATEMENT
+ case AVM_OPCODE_ASSIGN:
+ case AVM_OPCODE_ASSIGN_AFTER:
+ case AVM_OPCODE_ASSIGN_OP:
+ case AVM_OPCODE_ASSIGN_OP_AFTER:
+ case AVM_OPCODE_ASSIGN_REF:
+ case AVM_OPCODE_ASSIGN_MACRO:
+ {
+ out << TAB << AVM_STR_INDENT;
+
+ AvmCode::const_iterator it = begin();
+ AvmCode::const_iterator endIt = end();
+
+ prettyPrinter(out, (*it), false);
+
+ BaseTypeSpecifier * aType = (*it).is< InstanceOfData >() ?
+ (*it).to_ptr< InstanceOfData >()->getTypeSpecifier() : NULL;
+
+ for( ++it ; it != endIt ; ++it )
+ {
+ out << TAB << strOperator();
+
+ prettyPrinter(out, (*it), aType);
+ }
+
+ ( isStatement ? (out << ";") : out ) << END_INDENT_EOL;
+
+ break;
+ }
+
+ case AVM_OPCODE_ASSIGN_NEWFRESH:
+ case AVM_OPCODE_ASSIGN_RESET:
+ {
+ prettyPrinterFunctional( out );
+
+ break;
+ }
+
+ case AVM_OPCODE_GUARD:
+ case AVM_OPCODE_TIMED_GUARD:
+
+ case AVM_OPCODE_EVENT:
+
+ case AVM_OPCODE_CHECK_SAT:
+ {
+ prettyPrinterBasicStatement( out , isStatement );
+
+ break;
+ }
+
+ case AVM_OPCODE_INPUT:
+ case AVM_OPCODE_INPUT_FROM:
+
+ case AVM_OPCODE_INPUT_SAVE:
+
+ // Optimized version of INPUT
+ case AVM_OPCODE_INPUT_ENV:
+ case AVM_OPCODE_INPUT_VAR:
+ case AVM_OPCODE_INPUT_FLOW:
+ case AVM_OPCODE_INPUT_BUFFER:
+ case AVM_OPCODE_INPUT_RDV:
+ case AVM_OPCODE_INPUT_MULTI_RDV:
+ case AVM_OPCODE_INPUT_BROADCAST:
+ case AVM_OPCODE_INPUT_DELEGATE:
+
+ case AVM_OPCODE_OUTPUT:
+ case AVM_OPCODE_OUTPUT_TO:
+ // Optimized version of OUTPUT
+ case AVM_OPCODE_OUTPUT_ENV:
+ case AVM_OPCODE_OUTPUT_VAR:
+ case AVM_OPCODE_OUTPUT_FLOW:
+ case AVM_OPCODE_OUTPUT_BUFFER:
+ case AVM_OPCODE_OUTPUT_RDV:
+ case AVM_OPCODE_OUTPUT_MULTI_RDV:
+ case AVM_OPCODE_OUTPUT_BROADCAST:
+ case AVM_OPCODE_OUTPUT_DELEGATE:
+ {
+ out << TAB << strOperator() << " " << AVM_NO_INDENT;
+
+ prettyPrinter(out, first(), false);
+
+ if( populated() )
+ {
+ AvmCode::const_iterator it = begin();
+ AvmCode::const_iterator endIt = end();
+
+ out << "(";
+
+ prettyPrinter(out, *(++it), false);
+
+ for( ++it ; it != endIt ; ++it )
+ {
+ out << ", ";
+ prettyPrinter(out, (*it), false);
+ }
+
+ out << ")";
+ }
+
+ out << ";" << END_INDENT_EOL;
+
+ break;
+ }
+
+ case AVM_OPCODE_PRESENT:
+ case AVM_OPCODE_ABSENT:
+ {
+ out << TAB << strOperator() << " " << AVM_NO_INDENT;
+
+ prettyPrinter(out, first(), false);
+
+ if( populated() )
+ {
+ AvmCode::const_iterator it = begin();
+ AvmCode::const_iterator endIt = end();
+
+ out << "(";
+
+ prettyPrinter(out, *(++it), false);
+
+ for( ++it ; it != endIt ; ++it )
+ {
+ out << ", ";
+ prettyPrinter(out, (*it), false);
+ }
+
+ out << ")";
+ }
+
+ ( isStatement ? (out << ";") : out ) << END_INDENT_EOL;
+
+ break;
+ }
+
+ case AVM_OPCODE_IF:
+ {
+ out << TAB << "if";
+
+ prettyPrinterCondition( out , first() );
+
+ prettyPrinterBlock( out << EOL , second() );
+
+ break;
+ }
+ case AVM_OPCODE_IFE:
+ {
+ out << TAB << "if";
+
+ prettyPrinterCondition( out , first() );
+
+ prettyPrinterBlock( out << EOL , second() );
+
+ out << TAB << "else" << EOL;
+
+ prettyPrinterBlock( out , third() );
+
+ break;
+ }
+
+ case AVM_OPCODE_WHERE:
+ {
+ out << TAB << "where";
+
+ prettyPrinterCondition( out , first() );
+
+ prettyPrinterBlock( out << EOL , second() );
+
+ break;
+ }
+ case AVM_OPCODE_WHERE_ELSE:
+ {
+ prettyPrinterCondition( out << TAB << "where" , first() );
+
+ prettyPrinterBlock( out << EOL , second() );
+
+ prettyPrinterBlock( out << TAB << "else" << EOL , third() );
+
+ break;
+ }
+
+ case AVM_OPCODE_FOR:
+ {
+ out << TAB << "for( " << AVM_NO_INDENT;
+
+ prettyPrinter( out , first() , false );
+ out << " ; ";
+ prettyPrinter( out , second() , false );
+ out << " ; ";
+ prettyPrinter( out , third() , false );
+
+ out << " )" << END_INDENT_EOL;
+
+ prettyPrinterBlock( out , fourth() );
+
+ break;
+ }
+
+ case AVM_OPCODE_FOREACH:
+ {
+ out << TAB << "for( " << AVM_NO_INDENT;
+
+ prettyPrinter( out , first() , false );
+ out << " : ";
+ prettyPrinter( out , second() , false );
+
+ out << " )" << END_INDENT_EOL;
+
+ prettyPrinterBlock( out , third() );
+
+ break;
+ }
+
+ case AVM_OPCODE_WHILE_DO:
+ {
+ prettyPrinterCondition( out << TAB << "while" , first() );
+
+ prettyPrinterBlock( out << EOL , second() );
+
+ break;
+ }
+ case AVM_OPCODE_DO_WHILE:
+ {
+ prettyPrinterBlock( out << TAB << "do" << EOL , first() );
+
+ prettyPrinterCondition( out << TAB << "while" , second() );
+
+ out << ";" << EOL;
+
+ break;
+ }
+
+ case AVM_OPCODE_BREAK:
+ case AVM_OPCODE_CONTINUE:
+ case AVM_OPCODE_RETURN:
+ case AVM_OPCODE_EXIT:
+ {
+ prettyPrinterBasicStatement( out , isStatement );
+
+ break;
+ }
+
+ case AVM_OPCODE_STEP_MARK:
+
+ // AVM QUANTIFIER EXPRESSION
+ case AVM_OPCODE_EXIST:
+ case AVM_OPCODE_FORALL:
+ {
+ prettyPrinterPrefix( out );
+
+ break;
+ }
+
+ // AVM PREDICAT EXPRESSION
+ case AVM_OPCODE_NOT:
+
+ case AVM_OPCODE_AND:
+ case AVM_OPCODE_AND_THEN:
+
+ case AVM_OPCODE_NAND:
+
+ case AVM_OPCODE_XAND:
+
+ case AVM_OPCODE_OR:
+ case AVM_OPCODE_OR_ELSE:
+
+ case AVM_OPCODE_NOR:
+
+ case AVM_OPCODE_XOR:
+ case AVM_OPCODE_XNOR:
+
+ // AVM INTEGER BIT A BIT OPERATOR
+ case AVM_OPCODE_BNOT:
+
+ case AVM_OPCODE_BAND:
+ case AVM_OPCODE_BOR:
+ case AVM_OPCODE_BXOR:
+
+ case AVM_OPCODE_LSHIFT:
+ case AVM_OPCODE_RSHIFT:
+
+ // AVM COMPARISON EXPRESSION
+
+ case AVM_OPCODE_EQ:
+ case AVM_OPCODE_NEQ:
+
+ case AVM_OPCODE_SEQ:
+ case AVM_OPCODE_NSEQ:
+
+ case AVM_OPCODE_LT:
+ case AVM_OPCODE_LTE:
+ case AVM_OPCODE_GT:
+ case AVM_OPCODE_GTE:
+
+ // AVM ARITHMETIC EXPRESSION
+
+ case AVM_OPCODE_PLUS:
+ case AVM_OPCODE_MINUS:
+ case AVM_OPCODE_UMINUS:
+
+ case AVM_OPCODE_MULT:
+ case AVM_OPCODE_POW:
+
+ case AVM_OPCODE_DIV:
+ case AVM_OPCODE_MOD:
+ {
+ prettyPrinterInfix( out );
+
+ break;
+ }
+
+ // AVM MATHEMATICAL FUNCTION
+ case AVM_OPCODE_MIN:
+ case AVM_OPCODE_MAX:
+
+ // RANDOM
+ case AVM_OPCODE_RANDOM:
+
+ // ROUNDING
+ case AVM_OPCODE_ABS:
+
+ case AVM_OPCODE_CEIL:
+ case AVM_OPCODE_FLOOR:
+ case AVM_OPCODE_ROUND:
+ case AVM_OPCODE_TRUNCATE:
+
+ // EXP - LOG
+ case AVM_OPCODE_SQRT:
+
+ case AVM_OPCODE_EXP:
+ case AVM_OPCODE_LN:
+ case AVM_OPCODE_LOG:
+
+ // TRIGONOMETRIC
+ case AVM_OPCODE_SIN:
+ case AVM_OPCODE_COS:
+ case AVM_OPCODE_TAN:
+
+ case AVM_OPCODE_SINH:
+ case AVM_OPCODE_COSH:
+ case AVM_OPCODE_TANH:
+
+ case AVM_OPCODE_ASIN:
+ case AVM_OPCODE_ACOS:
+ case AVM_OPCODE_ATAN:
+ case AVM_OPCODE_ATAN2:
+
+ case AVM_OPCODE_ASINH:
+ case AVM_OPCODE_ACOSH:
+ case AVM_OPCODE_ATANH:
+ {
+ prettyPrinterFunctional( out );
+
+ break;
+ }
+
+ // AVM STRING / CONTAINER OPERATOR
+ case AVM_OPCODE_CONTAINS:
+
+ case AVM_OPCODE_IN:
+ case AVM_OPCODE_NOTIN:
+
+ case AVM_OPCODE_SUBSET:
+ case AVM_OPCODE_SUBSETEQ:
+
+ case AVM_OPCODE_INTERSECT:
+
+ case AVM_OPCODE_STARTS_WITH:
+ case AVM_OPCODE_ENDS_WITH:
+
+ case AVM_OPCODE_CONCAT:
+ {
+ prettyPrinterInfix( out );
+
+ break;
+ }
+
+ case AVM_OPCODE_APPEND:
+
+ case AVM_OPCODE_REMOVE:
+ case AVM_OPCODE_CLEAR:
+
+ case AVM_OPCODE_RESIZE:
+
+ case AVM_OPCODE_SELECT:
+
+ case AVM_OPCODE_PUSH:
+ case AVM_OPCODE_ASSIGN_TOP:
+ case AVM_OPCODE_TOP:
+ case AVM_OPCODE_POP:
+ case AVM_OPCODE_POP_FROM:
+
+ case AVM_OPCODE_EMPTY:
+ case AVM_OPCODE_NONEMPTY:
+ case AVM_OPCODE_SINGLETON:
+ case AVM_OPCODE_POPULATED:
+ case AVM_OPCODE_FULL:
+
+ case AVM_OPCODE_SIZE:
+ {
+ prettyPrinterFunctional( out );
+
+ break;
+ }
+
+ // CTL* , IOLTL STATEMENT
+ case AVM_OPCODE_NECESSARILY:
+ case AVM_OPCODE_POSSIBLY:
+
+ case AVM_OPCODE_GLOBALLY:
+ case AVM_OPCODE_EVENTUALLY:
+
+ case AVM_OPCODE_NEXT:
+ {
+ prettyPrinterPrefix( out );
+
+ break;
+ }
+
+ case AVM_OPCODE_UNTIL:
+ case AVM_OPCODE_UNLESS:
+ case AVM_OPCODE_RELEASES:
+
+ case AVM_OPCODE_AND_T:
+ case AVM_OPCODE_OR_T:
+ case AVM_OPCODE_NOT_T:
+ case AVM_OPCODE_IMP_T:
+ {
+ prettyPrinterInfix( out );
+
+ break;
+ }
+
+ case AVM_OPCODE_OBS:
+ {
+ prettyPrinterPrefix( out );
+
+ break;
+ }
+
+ default:
+ {
+ toStreamPrefix( out );
+
+ break;
+ }
+ }
+
+ out << std::flush;
+}
+
+
+void AvmCode::prettyPrinterBasicStatement(
+ OutStream & out, bool isStatement) const
+{
+ out << TAB << ( isStatement ? "" : "(" ) << strOperator()
+ << AVM_STR_INDENT;
+
+ AvmCode::const_iterator it = begin();
+ AvmCode::const_iterator endIt = end();
+ for( ; it != endIt ; ++it )
+ {
+ prettyPrinter(out, (*it), false);
+ }
+
+ out << ( isStatement ? ";" : ")" ) << END_INDENT_EOL;
+}
+
+
+void AvmCode::prettyPrinterBlockStatement(
+ OutStream & out, bool isStatement) const
+{
+ out << TAB << "{ " << strOperator() << EOL_INCR_INDENT;
+
+ AvmCode::const_iterator it = begin();
+ AvmCode::const_iterator endIt = end();
+ for( ; it != endIt ; ++it )
+ {
+ prettyPrinter(out, (*it), isStatement);
+ }
+
+ out << DECR_INDENT_TAB << "}" << EOL;
+}
+
+
+void AvmCode::prettyPrinterDefault(OutStream & out, bool isStatement) const
+{
+ out << TAB << "${ " << strOperator() << EOL_INCR_INDENT;
+
+ AvmCode::const_iterator it = begin();
+ AvmCode::const_iterator endIt = end();
+ for( ; it != endIt ; ++it )
+ {
+ prettyPrinter(out, (*it), isStatement);
+ }
+
+ out << DECR_INDENT_TAB << "}" << EOL;
+}
+
+
+void AvmCode::prettyPrinterFunctional(OutStream & out) const
+{
+ out << TAB << strOperator() << "(" << AVM_NO_INDENT;
+
+ if( singleton() )
+ {
+ prettyPrinter(out, first(), false);
+ }
+ else if( populated() )
+ {
+ AvmCode::const_iterator it = begin();
+ AvmCode::const_iterator endIt = end();
+
+ prettyPrinter(out, (*it), false);
+
+ for( ++it ; it != endIt ; ++it )
+ {
+ out << ", ";
+ prettyPrinter(out, (*it), false);
+ }
+ }
+
+ out << ")" << END_INDENT_EOL;
+}
+
+
+void AvmCode::prettyPrinterInfix(OutStream & out) const
+{
+ out << TAB << "(" << AVM_NO_INDENT;
+
+ if( singleton() )
+ {
+ out << strOperator() << " ";
+
+ prettyPrinter(out, first(), false);
+ }
+ else if( populated() )
+ {
+ AvmCode::const_iterator it = begin();
+ AvmCode::const_iterator endIt = end();
+
+ prettyPrinter(out, (*it), false);
+
+ for( ++it ; it != endIt ; ++it )
+ {
+ out << " " << strOperator() << " ";
+
+ prettyPrinter(out, (*it), false);
+ }
+ }
+
+ out << ")" << END_INDENT_EOL;
+}
+
+
+void AvmCode::prettyPrinterPrefix(OutStream & out) const
+{
+ out << TAB << "(" << strOperator() << AVM_STR_INDENT;
+
+ AvmCode::const_iterator it = begin();
+ AvmCode::const_iterator endIt = end();
+ for( ; it != endIt ; ++it )
+ {
+ prettyPrinter(out, (*it), false);
+ }
+
+ out << ")" << END_INDENT_EOL;
+}
+
+
+void AvmCode::prettyPrinterSuffix(OutStream & out) const
+{
+ out << TAB << "(" << AVM_RTS_INDENT;
+
+ AvmCode::const_iterator it = begin();
+ AvmCode::const_iterator endIt = end();
+ for( ; it != endIt ; ++it )
+ {
+ prettyPrinter(out, (*it), false);
+ }
+
+ out << strOperator() << ")" << END_INDENT_EOL;
+}
+
+
+void AvmCode::prettyPrinter(OutStream & out, const BF & arg, bool isStatement)
+{
+ if( arg.invalid() )
+ {
+ out << TAB << "null<avmcode::arg>" << EOL;
+ }
+
+ else if( arg.is< AvmCode >() )
+ {
+ arg.to_ptr< AvmCode >()->prettyPrinter(out, isStatement);
+ }
+ else if( arg.is< BuiltinForm >() )
+ {
+ out << TAB << arg.to_ptr< BuiltinForm >()->str() << EOL;
+ }
+
+ else if( arg.is< Operator >() )
+ {
+ out << TAB << arg.to_ptr< Operator >()->standardSymbol();
+ arg.AVM_DEBUG_REF_COUNTER(out);
+ out << EOL;
+ }
+ else if( arg.is< Routine >() )
+ {
+ arg.to_ptr< Routine >()->toStreamInvoke(out);
+ }
+
+ else if( arg.is< PropertyElement >() )
+ {
+ out << TAB << "&"
+ << arg.to_ptr< PropertyElement >()->getQualifiedNameID();
+ arg.AVM_DEBUG_REF_COUNTER(out);
+ out << EOL;
+ }
+ else if( arg.is< BaseInstanceForm >() )
+ {
+ out << TAB //<< "&"
+ << arg.to_ptr< BaseInstanceForm >()->getQualifiedNameID();
+ arg.AVM_DEBUG_REF_COUNTER(out);
+ out << EOL;
+ }
+ else if( arg.is< BehavioralElement >() )
+ {
+ out << TAB << "&"
+ << arg.to_ptr< BehavioralElement >()->getQualifiedNameID();
+ arg.AVM_DEBUG_REF_COUNTER(out);
+ out << EOL;
+ }
+
+ else if( WObjectManager::is( arg ) )
+ {
+ out << TAB << "&"
+ << WObjectManager::from( arg )->getQualifiedNameID();
+ arg.AVM_DEBUG_REF_COUNTER(out);
+ out << EOL;
+ }
+
+ else if( arg.is< UniFormIdentifier >() )
+ {
+ out << TAB << arg.to_ptr< UniFormIdentifier >()->str() << EOL;
+ }
+
+ else if( arg.is< RuntimeID >() )
+ {
+ out << TAB << arg.bfRID().str() << EOL;
+ }
+
+ else if( arg.is_exactly< AvmProgram >() )
+ {
+ AvmProgram * aProg = arg.to_ptr< AvmProgram >();
+ if( aProg->isAnonym() )
+ {
+ aProg->toStream(out);
+ }
+ else
+ {
+ out << TAB << aProg->getQualifiedNameID();
+ arg.AVM_DEBUG_REF_COUNTER(out);
+ out << EOL;
+ }
+ }
+
+ else if( arg.is< BaseTypeSpecifier >() )
+ {
+ out << TAB << arg.to_ptr< BaseTypeSpecifier >()->strT();
+ arg.AVM_DEBUG_REF_COUNTER(out);
+ out << EOL;
+ }
+
+ else if( arg.is< ObjectElement >() )
+ {
+ out << TAB << "&"
+ << arg.to_ptr< ObjectElement >()->getQualifiedNameID();
+ arg.AVM_DEBUG_REF_COUNTER(out);
+ out << EOL;
+ }
+
+ else if( arg.is< BuiltinArray >() )
+ {
+ arg.to_ptr< BuiltinArray >()->toStream(out);
+ }
+
+ else
+ {
+ arg.toStream( out );
+ }
+}
+
+
+void AvmCode::prettyPrinter(OutStream & out,
+ const BF & arg, BaseTypeSpecifier * aType)
+{
+ if( aType != NULL )
+ {
+ aType->formatStream(out, arg);
+ }
+ else
+ {
+ prettyPrinter(out, arg, false);
+ }
+}
+
+
+void AvmCode::prettyPrinterCondition(OutStream & out, const BF & arg)
+{
+ out << AVM_STR_INDENT;
+
+ if( arg.is< AvmCode >() )
+ {
+ arg.to_ptr< AvmCode >()->prettyPrinter( out , false );
+ }
+ else
+ {
+ prettyPrinter(out << "( ", arg, false);
+ out << " )";
+ }
+
+ out << END_INDENT;
+}
+
+
+void AvmCode::prettyPrinterBlock(OutStream & out, const BF & arg)
+{
+ if( arg.is< AvmCode >() )
+ {
+ if( OperatorManager::isSchedule(arg.to_ptr< AvmCode >()->mOperator) )
+ {
+ arg.to_ptr< AvmCode >()->prettyPrinter( out, true );
+ }
+ else
+ {
+ out << TAB << "{" << EOL_INCR_INDENT;
+ arg.to_ptr< AvmCode >()->prettyPrinter( out, true );
+ out << DECR_INDENT_TAB << "}" << EOL;
+ }
+ }
+ else
+ {
+ out << TAB << "{" << EOL_INCR_INDENT;
+ prettyPrinter(out, arg, true);
+ out << DECR_INDENT_TAB << "}" << EOL;
+ }
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/expression/AvmCode.h b/org.eclipse.efm.symbex/src/fml/expression/AvmCode.h
new file mode 100644
index 0000000..efce4f1
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/AvmCode.h
@@ -0,0 +1,1182 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef AVMCODE_H_
+#define AVMCODE_H_
+
+#include <common/AvmPointer.h>
+#include <common/Element.h>
+
+//#include <collection/BFContainer.h>
+#include <collection/List.h>
+#include <collection/Vector.h>
+
+#include <computer/instruction/AvmInstruction.h>
+
+
+#include <fml/operator/Operator.h>
+
+
+namespace sep
+{
+
+class BaseTypeSpecifier;
+
+
+class AvmCode :
+ public Element ,
+ public Vector< BF > ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( AvmCode )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( AvmCode )
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef Vector< BF > this_container_type;
+
+ typedef this_container_type::const_iterator const_iterator;
+
+ typedef this_container_type::iterator iterator;
+
+ typedef this_container_type::const_reverse_iterator const_reverse_iterator;
+
+ typedef this_container_type::reverse_iterator reverse_iterator;
+
+ typedef this_container_type::size_type size_type;
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ Operator * mOperator;
+
+ AvmInstruction * mInstruction;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmCode()
+ : Element( CLASS_KIND_T( AvmCode ) ),
+ this_container_type(),
+ mOperator( NULL ),
+ mInstruction( NULL )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ AvmCode(const AvmCode & anElement)
+ : Element( anElement ),
+ this_container_type( anElement ),
+ mOperator( anElement.mOperator ),
+ mInstruction( (anElement.mInstruction == NULL) ? NULL
+ : new AvmInstruction( *(anElement.mInstruction) ) )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Others
+ */
+ AvmCode(Operator * anOperator)
+ : Element( CLASS_KIND_T( AvmCode ) ),
+ this_container_type( ),
+ mOperator( anOperator ),
+ mInstruction( NULL )
+ {
+ //!! NOTHING
+ }
+
+ AvmCode(Operator * anOperator, const BF & arg)
+ : Element( CLASS_KIND_T( AvmCode ) ),
+ this_container_type( arg ),
+ mOperator( anOperator ),
+ mInstruction( NULL )
+ {
+ //!! NOTHING
+ }
+
+ AvmCode(Operator * anOperator, const BF & arg1, const BF & arg2)
+ : Element( CLASS_KIND_T( AvmCode ) ),
+ this_container_type( arg1 , arg2 ),
+ mOperator( anOperator ),
+ mInstruction( NULL )
+ {
+ //!! NOTHING
+ }
+
+ AvmCode(Operator * anOperator, const BF & arg1,
+ const BF & arg2, const BF & arg3)
+ : Element( CLASS_KIND_T( AvmCode ) ),
+ this_container_type( arg1 , arg2 , arg3 ),
+ mOperator( anOperator ),
+ mInstruction( NULL )
+ {
+ //!! NOTHING
+ }
+
+ AvmCode(Operator * anOperator, const BF & arg1,
+ const BF & arg2, const BF & arg3, const BF & arg4)
+ : Element( CLASS_KIND_T( AvmCode ) ),
+ this_container_type( arg1 , arg2 , arg3 , arg4 ),
+ mOperator( anOperator ),
+ mInstruction( NULL )
+ {
+ //!! NOTHING
+ }
+
+ AvmCode(Operator * anOperator, const BF & arg1, const BF & arg2,
+ const BF & arg3, const BF & arg4, const BF & arg5)
+ : Element( CLASS_KIND_T( AvmCode ) ),
+ this_container_type( arg1 , arg2 , arg3 , arg4 , arg5 ),
+ mOperator( anOperator ),
+ mInstruction( NULL )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AvmCode()
+ {
+ delete ( mInstruction );
+ }
+
+
+ /**
+ * GETTER
+ * this_container_type
+ */
+ inline this_container_type & getArgs()
+ {
+ return( *this );
+ }
+
+ inline const this_container_type & getArgs() const
+ {
+ return( *this );
+ }
+
+
+ /**
+ * APPEND
+ * this_container_type
+ */
+ inline void append(const BF & anElement)
+ {
+// AVM_OS_ASSERT_FATAL_ERROR_EXIT( isUnique() )
+// << "ILLEGAL MODIFICATION OF A NON UNIQUE REFERENCE :> "
+// << strRefCount() << " " << str() << " !!!" !!!"
+// << SEND_EXIT;
+
+ this_container_type::append( anElement );
+ }
+
+ inline void append(const this_container_type & anElement)
+ {
+// AVM_OS_ASSERT_FATAL_ERROR_EXIT( isUnique() )
+// << "ILLEGAL MODIFICATION OF A NON UNIQUE REFERENCE :> "
+// << strRefCount() << " " << str() << " !!!"
+// << SEND_EXIT;
+
+ this_container_type::append( anElement );
+ }
+
+ inline void appendTail(const this_container_type & anElement)
+ {
+// AVM_OS_ASSERT_FATAL_ERROR_EXIT( isUnique() )
+// << "ILLEGAL MODIFICATION OF A NON UNIQUE REFERENCE :> "
+// << strRefCount() << " " << str() << " !!!"
+// << SEND_EXIT;
+
+ this_container_type::appendTail( anElement );
+ }
+
+ inline void append(const List< BF > & anElement)
+ {
+// AVM_OS_ASSERT_FATAL_ERROR_EXIT( isUnique() )
+// << "ILLEGAL MODIFICATION OF A NON UNIQUE REFERENCE :> "
+// << strRefCount() << " " << str() << " !!!"
+// << SEND_EXIT;
+
+ this_container_type::append( anElement );
+ }
+
+ inline void append(const List< BFCode > & anElement)
+ {
+// AVM_OS_ASSERT_FATAL_ERROR_EXIT( isUnique() )
+// << "ILLEGAL MODIFICATION OF A NON UNIQUE REFERENCE :> "
+// << strRefCount() << " " << str() << " !!!"
+// << SEND_EXIT;
+
+ this_container_type::append( anElement );
+ }
+
+
+ inline void appendFlat(const BF & anElement)
+ {
+ if( anElement.is< AvmCode >()
+ && getOperator()->isWeakAssociative()
+ && (anElement.to_ptr< AvmCode >()->getOperator() == getOperator()) )
+ {
+ append( anElement.to_ptr< AvmCode >()->getArgs() );
+ }
+ else
+ {
+ append( anElement );
+ }
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * for element of this_container_type
+ */
+ inline virtual BF & at(avm_size_t offset)
+ {
+ return( this_container_type::at(offset) );
+ }
+
+ inline virtual const BF & at(avm_size_t offset) const
+ {
+ return( this_container_type::at(offset) );
+ }
+
+
+ inline AvmCode * codeAt(avm_size_t offset)
+ {
+ return( this_container_type::at(offset).as_ptr< AvmCode >() );
+ }
+
+ inline const AvmCode * codeAt(avm_size_t offset) const
+ {
+ return( this_container_type::at(offset).as_ptr< AvmCode >() );
+ }
+
+
+ virtual BF & operator[](avm_size_t offset)
+ {
+ return( this_container_type::operator[](offset) );
+ }
+
+ virtual const BF & operator[](avm_size_t offset) const
+ {
+ return( this_container_type::operator[](offset) );
+ }
+
+
+ inline virtual BF & getWritable(avm_size_t offset)
+ {
+ this_container_type::at(offset).makeWritable();
+
+ return( this_container_type::operator[](offset) );
+ }
+
+ inline virtual void makeWritable(avm_size_t offset)
+ {
+ this_container_type::at(offset).makeWritable();
+ }
+
+
+ inline virtual void safe_set(avm_size_t index, const BF & anElement)
+ {
+ this_container_type::operator[](index) = anElement;
+ }
+
+ inline virtual void set(avm_size_t index, const BF & anElement)
+ {
+// AVM_OS_ASSERT_FATAL_ERROR_EXIT( isUnique() )
+// << "ILLEGAL MODIFICATION OF A NON UNIQUE REFERENCE :> "
+// << strRefCount() << " " << str() << " !!!"
+// << SEND_EXIT;
+
+ ////////////////////////////////////////////////////////////////////////
+ //!!! OPTIMISATION
+ ////////////////////////////////////////////////////////////////////////
+// this_container_type::set(index, anElement);
+
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( index , size() )
+ << SEND_EXIT;
+
+ this_container_type::operator[](index) = anElement;
+ }
+
+ inline avm_size_t size() const
+ {
+ return( this_container_type::size() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * for mOperator
+ */
+ inline Operator * getOperator() const
+ {
+ return( mOperator );
+ }
+
+ inline AVM_OPCODE getAvmOpCode() const
+ {
+ return( mOperator->getAvmOpCode() );
+ }
+
+ inline AVM_OPCODE getOptimizedOpCode() const
+ {
+ return( mOperator->getOptimizedOpCode() );
+ }
+
+ inline avm_offset_t getOpOffset() const
+ {
+ return( mOperator->getOffset() );
+ }
+
+
+ inline bool hasOperator() const
+ {
+ return( mOperator != NULL );
+ }
+
+ inline bool isOperator(Operator * op) const
+ {
+ return( mOperator->isEQ( op ) );
+ }
+
+ inline bool isnotOperator(Operator * op) const
+ {
+ return( mOperator->isNEQ( op ) );
+ }
+
+ inline bool isOpCode(AVM_OPCODE opCode) const
+ {
+ return( mOperator->isOpCode( opCode ) );
+ }
+
+ inline bool hasOpCode(AVM_OPCODE opCode1, AVM_OPCODE opCode2) const
+ {
+ return( mOperator->hasOpCode( opCode1 , opCode2 ) );
+ }
+
+ inline bool hasOpCode(AVM_OPCODE opCode1,
+ AVM_OPCODE opCode2, AVM_OPCODE opCode3) const
+ {
+ return( mOperator->hasOpCode( opCode1 , opCode2 , opCode3 ) );
+ }
+
+ inline bool isOpCode(Operator * op) const
+ {
+ return( mOperator->isOpCode( op ) );
+ }
+
+ inline bool isOptimizedOpCode(AVM_OPCODE opCode) const
+ {
+ return( mOperator->isOptimizedOpCode( opCode ) );
+ }
+
+ inline bool sameOperator(const AvmCode & aCode) const
+ {
+ return( mOperator->isEQ( aCode.mOperator ) );
+ }
+
+ inline bool sameOperator(AvmCode * aCode) const
+ {
+ return( mOperator->isEQ( aCode->mOperator ) );
+ }
+
+
+ inline bool isnotOpCode(AVM_OPCODE opCode) const
+ {
+ return( mOperator->isnotOpCode( opCode ) );
+ }
+
+
+ inline void setOperator(Operator * anOperator)
+ {
+ mOperator = anOperator;
+ }
+
+ inline const std::string & strOperator() const
+ {
+ return( mOperator->standardSymbol() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * for mInstruction
+ */
+ inline AvmInstruction * getInstruction() const
+ {
+ return( mInstruction );
+ }
+
+ inline bool hasInstruction() const
+ {
+ return( mInstruction != NULL );
+ }
+
+
+ inline AvmInstruction * newEmptyInstruction()
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( mInstruction == NULL )
+ << "Unexpected a code with AvmInstruction: "
+ << toStringWithBytecode()
+ << SEND_EXIT;
+
+ return( mInstruction = new AvmInstruction() );
+ }
+
+ inline AvmInstruction * newInstruction(avm_size_t aSize)
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( mInstruction == NULL )
+ << "Unexpected a code with AvmInstruction: "
+ << toStringWithBytecode()
+ << SEND_EXIT;
+
+ return( mInstruction = new AvmInstruction( aSize ) );
+ }
+
+ inline AvmInstruction * genInstruction()
+ {
+ return( newInstruction( size() ) );
+ }
+
+
+ inline void setInstruction(AvmInstruction * anInstruction)
+ {
+ mInstruction = anInstruction;
+ }
+
+
+ /**
+ * COMPARISON
+ * OPERATOR
+ */
+ int compare(const AvmCode & other) const;
+
+ inline bool operator==(const AvmCode & other) const
+ {
+ return( AvmCode::isEQ( other ) );
+ }
+
+ inline bool operator==(AvmCode * other) const
+ {
+ return( (other != NULL) && AvmCode::isEQ( *other ) );
+ }
+
+ inline bool operator!=(const AvmCode & other) const
+ {
+ return( (this != &other) && (not AvmCode::isEQ( other )) );
+ }
+
+ inline bool operator!=(AvmCode * other) const
+ {
+ return( (other == NULL)
+ || ((this != other)
+ && (not AvmCode::isEQ( *other ) ) ) );
+ }
+
+
+ bool isEQ(const AvmCode & other) const;
+
+ inline bool isEQ(AvmCode * other) const
+ {
+ return( (other != NULL) && AvmCode::isEQ( *other ) );
+ }
+
+
+ /**
+ * Serialization
+ */
+ std::string strDebug(const AvmIndent & indent = AVM_SPC_INDENT) const
+ {
+ StringOutStream oss(indent);
+
+ toDebug( oss );
+
+ return( oss.str() );
+ }
+
+ OutStream & toDebug(OutStream & out) const;
+
+ OutStream & toStreamWithBytecode(OutStream & out) const;
+
+ std::string toStringWithBytecode(
+ const AvmIndent & indent = AVM_TAB_INDENT) const
+ {
+ StringOutStream oss(indent);
+
+ toStreamWithBytecode( oss );
+
+ return( oss.str() );
+ }
+
+ OutStream & toStreamRoutine(OutStream & out) const;
+
+
+ void toStreamPrefix(OutStream & out, bool printEOL = true) const;
+
+ static void toStreamPrefix(OutStream & out, const BF & arg);
+
+
+ inline static void toStream(OutStream & out, const BF & arg)
+ {
+// toStreamPrefix(out, arg);
+
+ prettyPrinter(out, arg);
+ }
+
+ inline virtual void toStream(OutStream & out) const
+ {
+AVM_IF_DEBUG_FLAG( BYTECODE )
+
+ toStreamPrefix( out );
+
+ return;
+
+AVM_ENDIF_DEBUG_FLAG( BYTECODE )
+
+ prettyPrinter( out );
+ }
+
+
+ /**
+ * PRETTY PRINTER
+ */
+ void prettyPrinter(OutStream & out, bool isStatement = true) const;
+
+ void prettyPrinterBasicStatement(
+ OutStream & out, bool isStatement = true) const;
+
+ void prettyPrinterBlockStatement(
+ OutStream & out, bool isStatement = true) const;
+
+ void prettyPrinterDefault(OutStream & out, bool isStatement = true) const;
+
+ void prettyPrinterFunctional(OutStream & out) const;
+ void prettyPrinterInfix(OutStream & out) const;
+ void prettyPrinterPrefix(OutStream & out) const;
+ void prettyPrinterSuffix(OutStream & out) const;
+
+ static void prettyPrinter(OutStream & out,
+ const BF & arg, bool isStatement = true);
+
+ static void prettyPrinter(OutStream & out,
+ const BF & arg, BaseTypeSpecifier * aType);
+
+ static void prettyPrinterCondition(OutStream & out, const BF & arg);
+
+ static void prettyPrinterBlock(OutStream & out, const BF & arg);
+
+
+ /**
+ * toString
+ */
+ inline virtual std::string toString(
+ const AvmIndent & indent = AVM_TAB_INDENT) const
+ {
+ StringOutStream oss(indent);
+
+// toStream(oss);
+ prettyPrinter(oss);
+
+ return( oss.str() );
+ }
+
+ inline virtual std::string str() const
+ {
+ StringOutStream oss( AVM_STR_INDENT );
+
+// toStream(oss);
+ prettyPrinter( oss << IGNORE_FIRST_TAB );
+
+ return( oss.str() );
+ }
+
+};
+
+
+/**
+ * operator<<
+ */
+AVM_OS_STREAM( AvmCode )
+
+
+
+#define AVM_DEBUG_BFCODE_POINTER true
+#undef AVM_DEBUG_BFCODE_POINTER
+
+#if defined(AVM_DEBUG_BFCODE_POINTER)
+
+// #define AVM_DECLARE_DEBUG_BFCODE_PTR const AvmCode * debugPTR;
+//
+// #define AVM_INIT_DEBUG_BFCODE_PTR( ptr ) , debugPTR( ptr )
+//
+// #define AVM_ASSIGN_STMNT_DEBUG_BFCODE_PTR( ptr ) debugPTR = ptr;
+//
+// #define AVM_ASSIGN_EXPR_DEBUG_BFCODE_PTR( ptr ) debugPTR = ptr
+
+
+ #define AVM_DECLARE_DEBUG_BFCODE_PTR public: std::string dbgPTR;
+
+
+ #define AVM_STR_BFCODE_PTR( ptr ) ( (ptr != NULL) ? ptr->str() : "BFCode<null>" )
+
+ #define AVM_INIT_DEBUG_BFCODE_PTR_NULL , dbgPTR( "BFCode<null>" )
+
+ #define AVM_INIT_DEBUG_BFCODE_PTR( ptr ) , dbgPTR( AVM_STR_BFCODE_PTR(ptr) )
+
+ #define AVM_COPY_DEBUG_BFCODE_PTR( bf ) , dbgPTR( bf.dbgPTR )
+
+ #define AVM_ASSIGN_DEBUG_BFCODE_PTR( ptr ) dbgPTR = AVM_STR_BFCODE_PTR(ptr);
+
+#else
+
+ #define AVM_DECLARE_DEBUG_BFCODE_PTR
+
+ #define AVM_INIT_DEBUG_BFCODE_PTR( ptr )
+
+ #define AVM_ASSIGN_STMNT_DEBUG_BFCODE_PTR( ptr )
+
+ #define AVM_ASSIGN_EXPR_DEBUG_BFCODE_PTR( ptr ) ptr
+
+#endif
+
+
+
+
+class BFCode :
+ public BF ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( BFCode )
+{
+
+
+protected:
+ /**
+ * Only for debug facilities
+ */
+ AVM_DECLARE_DEBUG_BFCODE_PTR
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BFCode()
+ : BF()
+ AVM_INIT_DEBUG_BFCODE_PTR( NULL )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ BFCode(const BFCode & other)
+ : BF( other )
+ AVM_INIT_DEBUG_BFCODE_PTR( other.debugPTR )
+ {
+ //!! NOTHING
+ }
+
+// explicit BFCode(const BF & other)
+// : BF( ( other.is< AvmCode >() ) ? other : BFCode::REF_NULL )
+// AVM_INIT_DEBUG_BFCODE_PTR( ( other.is< AvmCode >() ) ?
+// static_cast< const AvmCode * >( other.raw_pointer() ) : NULL )
+// {
+// AVM_OS_ASSERT_FATAL_ERROR_EXIT( other.invalid() || other.is< AvmCode >() )
+// << "Invalid Constructor Cast of a BF to a BFCode !!!"
+// << SEND_EXIT;
+// }
+
+ explicit BFCode(AvmCode * aCode)
+ : BF( AVM_ASSIGN_EXPR_DEBUG_BFCODE_PTR( aCode ) )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Others
+ */
+ BFCode(Operator * anOperator)
+ : BF( AVM_ASSIGN_EXPR_DEBUG_BFCODE_PTR(
+ new AvmCode(anOperator) ) )
+ {
+ //!! NOTHING
+ }
+
+ BFCode(Operator * anOperator, const BF & arg)
+ : BF( AVM_ASSIGN_EXPR_DEBUG_BFCODE_PTR(
+ new AvmCode(anOperator, arg) ) )
+ {
+ //!! NOTHING
+ }
+
+ BFCode(Operator * anOperator, const BF & arg1, const BF & arg2)
+ : BF( AVM_ASSIGN_EXPR_DEBUG_BFCODE_PTR(
+ new AvmCode(anOperator, arg1, arg2) ) )
+ {
+ //!! NOTHING
+ }
+
+ BFCode(Operator * anOperator, const BF & arg1,
+ const BF & arg2, const BF & arg3)
+ : BF( AVM_ASSIGN_EXPR_DEBUG_BFCODE_PTR(
+ new AvmCode(anOperator, arg1, arg2, arg3) ) )
+ {
+ //!! NOTHING
+ }
+
+ BFCode(Operator * anOperator, const BF & arg1, const BF & arg2,
+ const BF & arg3, const BF & arg4)
+ : BF( AVM_ASSIGN_EXPR_DEBUG_BFCODE_PTR(
+ new AvmCode(anOperator, arg1, arg2, arg3, arg4) ) )
+ {
+ //!! NOTHING
+ }
+
+ BFCode(Operator * anOperator, const BF & arg1, const BF & arg2,
+ const BF & arg3, const BF & arg4, const BF & arg5)
+ : BF( AVM_ASSIGN_EXPR_DEBUG_BFCODE_PTR(
+ new AvmCode(anOperator, arg1, arg2, arg3, arg4, arg5) ) )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BFCode()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CAST
+ */
+
+//protected:
+ inline operator AvmCode * () const
+ {
+ return( static_cast< AvmCode * >( mPTR ) );
+ }
+
+
+ inline AvmCode * raw_pointer() const
+ {
+ return( static_cast< AvmCode * >( mPTR ) );
+ }
+
+
+ /**
+ * OPERATORS
+ */
+ inline AvmCode * operator-> () const
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "Unexpected a BFCode with a NULL Pointer !!!"
+ << SEND_EXIT;
+
+ return( static_cast< AvmCode * >( mPTR ) );
+ }
+
+
+ /**
+ * ASSIGNMENT
+ */
+ inline BFCode & operator=(AvmCode * aPtr)
+ {
+ if( mPTR != aPtr )
+ {
+ AVM_ASSIGN_STMNT_DEBUG_BFCODE_PTR( aPtr )
+
+ release( aPtr );
+ }
+ return( *this );
+ }
+
+ inline BFCode & operator=(const BFCode & other)
+ {
+ if( mPTR != other.mPTR )
+ {
+ AVM_ASSIGN_STMNT_DEBUG_BFCODE_PTR( other.debugPTR )
+
+ release_acquire( other.mPTR );
+ }
+ return( *this );
+ }
+
+ inline BFCode & operator=(const BF & other)
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT(
+ other.invalid() || other.is< AvmCode >() )
+ << "Invalid Assignment Cast of a BF to a BFCode !!!"
+ << SEND_EXIT;
+
+ if( mPTR != other.raw_pointer() )
+ {
+ AVM_ASSIGN_STMNT_DEBUG_BFCODE_PTR(
+ static_cast< AvmCode * >( other.raw_pointer() ) )
+
+ release_acquire( other.raw_pointer() );
+ }
+ return( *this );
+ }
+
+
+ /**
+ * COMPARISON
+ * OPERATOR
+ */
+ inline bool operator==(const AvmCode & other) const
+ {
+ return( other.operator==( raw_pointer() ) );
+ }
+
+ inline bool operator==(AvmCode * other) const
+ {
+ return( (mPTR == other)
+ || ((mPTR != NULL)
+ && raw_pointer()->operator==( other ) ) );
+ }
+
+
+ inline bool operator==(const BFCode & other) const
+ {
+ return( (mPTR == other.raw_pointer())
+ || ((mPTR != NULL)
+ && raw_pointer()->operator==( other.raw_pointer() ) ) );
+ }
+
+ inline bool operator==(const BF & other) const
+ {
+ return( (mPTR == other.raw_pointer())
+ || ((mPTR != NULL)
+ && other.is< AvmCode >()
+ && raw_pointer()->operator==(
+ other.to_ptr< AvmCode >() ) ) );
+ }
+
+
+ inline bool operator!=(const AvmCode & other) const
+ {
+ return( other.operator!=( raw_pointer() ) );
+ }
+
+ inline bool operator!=(AvmCode * other) const
+ {
+ return( (mPTR != other)
+ && ((mPTR == NULL)
+ || raw_pointer()->operator!=( other ) ) );
+ }
+
+
+ inline bool operator!=(const BFCode & other) const
+ {
+ return( (mPTR != other.raw_pointer())
+ && ((mPTR == NULL)
+ || raw_pointer()->operator!=( other.raw_pointer() ) ) );
+ }
+
+ inline bool operator!=(const BF & other) const
+ {
+ return( (mPTR != other.raw_pointer())
+ && ((mPTR == NULL)
+ || (other.is< AvmCode >()
+ && raw_pointer()->operator!=(
+ other.to_ptr< AvmCode >() ) ) ) );
+ }
+
+ /**
+ * COMPARISON
+ */
+ inline bool isEQ(const BF & other) const
+ {
+ return( BF::isEQ(other) );
+ }
+
+ inline bool isEQ(const BFCode & other) const
+ {
+ return( (mPTR == other.mPTR)
+ || ((mPTR != NULL)
+ && raw_pointer()->isEQ( other.raw_pointer() ) ) );
+ }
+
+
+ inline bool isNEQ(const BF & other) const
+ {
+ return( BF::isNEQ(other) );
+ }
+
+ inline bool isNEQ(const BFCode & other) const
+ {
+ return( not BFCode::isEQ(other) );
+ }
+
+
+public:
+
+ /**
+ * SETTER
+ * this_container_type
+ */
+ inline void append(const BF & anElement)
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( isWritable() )
+ << "ILLEGAL MODIFICATION OF A NON UNIQUE REFERENCE :> "
+ << strRefCount() << " " << str() << " !!!"
+ << SEND_EXIT;
+
+ static_cast< AvmCode * >( mPTR )->append(anElement);
+ }
+
+ inline void append(const List< BF > & anElement)
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( isWritable() )
+ << "ILLEGAL MODIFICATION OF A NON UNIQUE REFERENCE :> "
+ << strRefCount() << " " << str() << " !!!"
+ << SEND_EXIT;
+
+ static_cast< AvmCode * >( mPTR )->append( anElement );
+ }
+
+ inline void append(const List< BFCode > & anElement)
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( isWritable() )
+ << "ILLEGAL MODIFICATION OF A NON UNIQUE REFERENCE :> "
+ << strRefCount() << " " << str() << " !!!"
+ << SEND_EXIT;
+
+ static_cast< AvmCode * >( mPTR )->append( anElement );
+ }
+
+ inline void append(AvmCode::this_container_type & anElement)
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( isWritable() )
+ << "ILLEGAL MODIFICATION OF A NON UNIQUE REFERENCE :> "
+ << strRefCount() << " " << str() << " !!!"
+ << SEND_EXIT;
+
+ static_cast< AvmCode * >( mPTR )->append( anElement );
+ }
+
+
+ inline void appendFlat(const BF & anElement)
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( isWritable() )
+ << "ILLEGAL MODIFICATION OF A NON UNIQUE REFERENCE :> "
+ << strRefCount() << " " << str() << " !!!"
+ << SEND_EXIT;
+
+ static_cast< AvmCode * >( mPTR )->appendFlat( anElement );
+ }
+
+
+ inline AvmCode::this_container_type & getArgs()
+ {
+ return( static_cast< AvmCode * >( mPTR )->getArgs() );
+ }
+
+
+ inline void set(avm_size_t index, const BF & anElement)
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( isWritable() )
+ << "ILLEGAL MODIFICATION OF A NON UNIQUE REFERENCE :> "
+ << strRefCount() << " " << str() << " !!!"
+ << SEND_EXIT;
+
+ static_cast< AvmCode * >( mPTR )->set( index , anElement );
+ }
+
+ /**
+ * GETTER
+ * for BFCode
+ */
+ inline virtual BFCode & codeAt(avm_size_t offset)
+ {
+ return( static_cast< AvmCode * >( mPTR )->at(offset).bfCode() );
+ }
+
+ inline virtual const BFCode & codeAt(avm_size_t offset) const
+ {
+ return( static_cast< AvmCode * >( mPTR )->at(offset).bfCode() );
+ }
+
+ /**
+ * GETTER
+ * for iterators
+ */
+ inline AvmCode::iterator begin()
+ {
+ return( static_cast< AvmCode * >( mPTR )->begin() );
+ }
+
+ inline AvmCode::iterator end()
+ {
+ return( static_cast< AvmCode * >( mPTR )->end() );
+ }
+
+ inline AvmCode::const_iterator begin() const
+ {
+ return( static_cast< AvmCode * >( mPTR )->begin() );
+ }
+
+ inline AvmCode::const_iterator end() const
+ {
+ return( static_cast< AvmCode * >( mPTR )->end() );
+ }
+
+
+ /**
+ * GETTER
+ * for reverse_iterators
+ */
+ inline AvmCode::reverse_iterator rbegin()
+ {
+ return( static_cast< AvmCode * >( mPTR )->rbegin() );
+ }
+
+ inline AvmCode::reverse_iterator rend()
+ {
+ return( static_cast< AvmCode * >( mPTR )->rend() );
+ }
+
+ inline AvmCode::const_reverse_iterator rbegin() const
+ {
+ return( static_cast< AvmCode * >( mPTR )->rbegin() );
+ }
+
+ inline AvmCode::const_reverse_iterator rend() const
+ {
+ return( static_cast< AvmCode * >( mPTR )->rend() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * for mOperator
+ */
+ inline Operator * getOperator() const
+ {
+ return( static_cast< AvmCode * >( mPTR )->getOperator() );
+ }
+
+ inline AVM_OPCODE getAvmOpCode() const
+ {
+ return( static_cast< AvmCode * >( mPTR )->getAvmOpCode() );
+ }
+
+ inline bool hasOperator() const
+ {
+ return( static_cast< AvmCode * >( mPTR )->hasOperator() );
+ }
+
+ inline void setOperator(Operator * anOperator)
+ {
+ static_cast< AvmCode * >( mPTR )->setOperator( anOperator );
+ }
+
+
+ /**
+ * DEFAULT NULL
+ */
+ static BFCode REF_NULL;
+
+ /**
+ ***************************************************************************
+ * SERIALIZATION
+ ***************************************************************************
+ */
+ inline virtual void toStream(OutStream & out) const
+ {
+ if( mPTR != NULL )
+ {
+ static_cast< AvmCode * >( mPTR )->toStream(out);
+ }
+ else
+ {
+ out << TAB << "BFCode<null>" << EOL_FLUSH;
+ }
+ }
+
+
+ inline virtual std::string toString(
+ const AvmIndent & indent = AVM_TAB_INDENT) const
+ {
+ StringOutStream oss(indent);
+
+ toStream(oss);
+
+ return( oss.str() );
+ }
+
+ inline virtual std::string str() const
+ {
+ return( ( mPTR == NULL ) ? "BFCode<null>" :
+ static_cast< AvmCode * >( mPTR )->str() );
+ }
+
+
+ inline virtual void AVM_DEBUG_REF_COUNTER(OutStream & out) const
+ {
+ if( mPTR != NULL )
+ {
+ mPTR->AVM_DEBUG_REF_COUNTER(out);
+ }
+ else
+ {
+ out << "BFCode<null, ref:0>" << std::flush;
+ }
+ }
+
+ inline virtual std::string AVM_DEBUG_REF_COUNTER() const
+ {
+ return( ( mPTR != NULL ) ? mPTR->AVM_DEBUG_REF_COUNTER() :
+ "BFCode<null, ref:0>" );
+ }
+
+ inline virtual std::string strRefCount() const
+ {
+ return( ( mPTR != NULL ) ? mPTR->strRefCount() :
+ "BFCode<null, ref:0>" );
+ }
+
+};
+
+
+/**
+ * operator<<
+ */
+AVM_OS_STREAM( BFCode )
+
+
+}
+
+#endif /*AVMCODE_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/expression/AvmCodeFactory.cpp b/org.eclipse.efm.symbex/src/fml/expression/AvmCodeFactory.cpp
new file mode 100644
index 0000000..2ecc080
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/AvmCodeFactory.cpp
@@ -0,0 +1,189 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 16 déc. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmCodeFactory.h"
+
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/ExecutableLib.h>
+
+#include <fml/operator/OperatorManager.h>
+
+
+namespace sep
+{
+
+
+/**
+ * METHODS
+ * flatten AvmCode
+ */
+BF AvmCodeFactory::flatten(BF aCode)
+{
+ switch( aCode.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ return( AvmCodeFactory::flattenCode( aCode.bfCode() ) );
+ }
+
+ default:
+ {
+ return( aCode );
+ }
+ }
+}
+
+
+
+BFCode AvmCodeFactory::flattenCode(BFCode anAvmCode)
+{
+ Operator * anOperator = anAvmCode->getOperator();
+
+ AvmCode::this_container_type flattenArgs;
+ BFCode arg;
+ avm_size_t flatCount = 0;
+
+ AvmCode::iterator it = anAvmCode->begin();
+ AvmCode::iterator itEnd = anAvmCode->end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it).is< AvmCode >() )
+ {
+ arg = AvmCodeFactory::flattenCode( (*it).bfCode() );
+
+ if( anOperator->isWeakAssociative() &&
+ arg->isOperator( anOperator ) )
+ {
+ flattenArgs.append( arg->getArgs() );
+
+ ++flatCount;
+ }
+ else
+ {
+ flattenArgs.append( arg );
+
+ if( (*it).raw_pointer() != arg )
+ {
+ ++flatCount;
+ }
+ }
+ }
+ else
+ {
+ flattenArgs.append( (*it) );
+ }
+ }
+
+ if( flatCount > 0 )
+ {
+ if( anAvmCode->isUnique() )
+ {
+ anAvmCode->clear();
+ anAvmCode->append(flattenArgs);
+ }
+ else
+ {
+ anAvmCode = AvmCodeFactory::newCode(
+ anAvmCode->getOperator(), flattenArgs);
+ }
+ }
+
+ return( anAvmCode );
+}
+
+
+
+/**
+ * METHODS
+ * contains subCode with a specific operator
+ */
+bool AvmCodeFactory::contains(ExecutableForm * anExecutable,
+ const BFCode & aCode, AVM_OPCODE anOpcode)
+{
+ if( aCode.invalid() )
+ {
+ return( false );
+ }
+ else if( aCode->isOpCode(anOpcode) )
+ {
+ return true;
+ }
+ else if( OperatorManager::isActivity(aCode->getOperator()) &&
+ (aCode->empty() || (aCode->first() == ExecutableLib::MACHINE_SELF)) )
+ {
+ return( contains(anExecutable,
+ anExecutable->getOnActivity( aCode->getAvmOpCode() ),
+ anOpcode) );
+ }
+ else
+ {
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator itEnd = aCode->end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it).is< AvmCode >() )
+ {
+ if( contains(anExecutable, (*it).bfCode(), anOpcode) )
+ {
+ return true;
+ }
+ }
+ }
+
+ return( false );
+ }
+}
+
+
+bool AvmCodeFactory::contains(ExecutableForm * anExecutable,
+ const BFCode & aCode, AVM_OPCODE anOpcode1, AVM_OPCODE anOpcode2)
+{
+ if( aCode.invalid() )
+ {
+ return( false );
+ }
+ else if( aCode->isOpCode(anOpcode1) || aCode->isOpCode(anOpcode2) )
+ {
+ return true;
+ }
+ else if( OperatorManager::isActivity(aCode->getOperator()) &&
+ (aCode->empty() || (aCode->first() == ExecutableLib::MACHINE_SELF)) )
+ {
+ return( contains(anExecutable,
+ anExecutable->getOnActivity( aCode->getAvmOpCode() ),
+ anOpcode1, anOpcode2) );
+ }
+ else
+ {
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator itEnd = aCode->end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it).is< AvmCode >() )
+ {
+ if( contains(anExecutable, (*it).bfCode(), anOpcode1, anOpcode2) )
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/expression/AvmCodeFactory.h b/org.eclipse.efm.symbex/src/fml/expression/AvmCodeFactory.h
new file mode 100644
index 0000000..cd63e1b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/AvmCodeFactory.h
@@ -0,0 +1,440 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 16 déc. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMCODEFACTORY_H_
+#define AVMCODEFACTORY_H_
+
+#include <collection/BFContainer.h>
+#include <collection/Typedef.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/builtin/String.h>
+
+#include <computer/instruction/AvmBytecode.h>
+
+#include <fml/operator/Operator.h>
+#include <fml/operator/OperatorLib.h>
+#include <fml/operator/OperatorManager.h>
+
+
+namespace sep
+{
+
+
+class ExecutableForm;
+
+
+class AvmCodeFactory
+{
+
+public:
+
+ /**
+ * STATEMENT EXPRESSION
+ */
+ inline static BFCode newCode()
+ {
+ return( BFCode( new AvmCode() ) );
+ }
+
+ inline static BFCode newCode(Operator * anOperator)
+ {
+ return( BFCode( new AvmCode(anOperator) ) );
+ }
+
+ inline static BFCode newCode(Operator * anOperator, const BF & arg)
+ {
+ return( BFCode( new AvmCode( anOperator, arg) ) );
+ }
+
+ inline static BFCode newOptiNopCode(Operator * anOperator,
+ const BF & arg, avm_arg_operand_t operand)
+ {
+ AvmCode * aCode = new AvmCode( anOperator, arg);
+ aCode->setInstruction( AvmInstruction::nopsUnaryCode(operand) );
+
+ return( BFCode( aCode ) );
+ }
+
+
+
+ inline static BFCode newCode(Operator * anOperator,
+ const BF & arg1, const BF & arg2)
+ {
+ return( BFCode( new AvmCode(anOperator, arg1, arg2) ) );
+ }
+
+
+ inline static BFCode xnewCode(Operator * anOperator,
+ const BFCode & aCode1, const BFCode & aCode2)
+ {
+ if( aCode1.invalid() )
+ {
+ return( aCode2 );
+ }
+ else if( aCode2.invalid() )
+ {
+ return( aCode1 );
+ }
+ else
+ {
+ return( newCode(anOperator, aCode1, aCode2) );
+ }
+ }
+
+
+
+ inline static BFCode newCodeFlat(Operator * anOperator, const BFCode & aCode)
+ {
+ BFCode newCode( anOperator );
+
+ if( anOperator->isWeakAssociative() &&
+ (aCode->getOperator() == anOperator) )
+ {
+ newCode->append( aCode->getArgs() );
+ }
+ else
+ {
+ newCode->append( aCode );
+ }
+
+ return newCode;
+ }
+
+ inline static BFCode newCodeFlat(Operator * anOperator,
+ const BFCode & aCode, const BF & arg)
+ {
+ BFCode newCode( anOperator );
+
+ if( anOperator->isWeakAssociative() &&
+ (aCode->getOperator() == anOperator) )
+ {
+ newCode->append( aCode->getArgs() );
+ }
+ else
+ {
+ newCode->append( aCode );
+ }
+
+ newCode->append( arg );
+
+ return newCode;
+ }
+
+ inline static BFCode newCodeFlat(Operator * anOperator,
+ const BF & arg, const BFCode & aCode)
+ {
+ BFCode newCode( anOperator , arg );
+
+ if( anOperator->isWeakAssociative() &&
+ (aCode->getOperator() == anOperator) )
+ {
+ newCode->append( aCode->getArgs() );
+ }
+ else
+ {
+ newCode->append( aCode );
+ }
+
+ return newCode;
+ }
+
+ inline static BFCode newCodeFlat(Operator * anOperator,
+ const BFCode & aCode1, const BFCode & aCode2)
+ {
+ if( anOperator->isWeakAssociative() )
+ {
+ BFCode newCode( anOperator );
+
+ if( aCode1->getOperator() == anOperator )
+ {
+ newCode->append( aCode1->getArgs() );
+ }
+ else
+ {
+ newCode->append( aCode1 );
+ }
+
+ if( aCode2->getOperator() == anOperator )
+ {
+ newCode->append( aCode2->getArgs() );
+ }
+ else
+ {
+ newCode->append( aCode2 );
+ }
+
+ return newCode;
+ }
+ else
+ {
+ return( newCode(anOperator, aCode1, aCode2) );
+ }
+ }
+
+
+ inline static BFCode xnewCodeFlat(Operator * anOperator,
+ const BFCode & aCode1, const BFCode & aCode2)
+ {
+ if( aCode1.invalid() )
+ {
+ return( aCode2 );
+ }
+ else if( aCode2.invalid() )
+ {
+ return( aCode1 );
+ }
+ else
+ {
+ return( newCodeFlat(anOperator, aCode1, aCode2) );
+ }
+ }
+
+
+ inline static BFCode newCodeFlat(Operator * anOperator,
+ const BF & arg1, const BF & arg2)
+ {
+ if( arg1.is< AvmCode >() )
+ {
+ if( arg2.is< AvmCode >() )
+ {
+ return( newCodeFlat(anOperator, arg1.bfCode(), arg2.bfCode()) );
+ }
+ else
+ {
+ return( newCodeFlat(anOperator, arg1.bfCode(), arg2) );
+ }
+ }
+ else if( arg2.is< AvmCode >() )
+ {
+ return( newCodeFlat(anOperator, arg1, arg2.bfCode()) );
+ }
+ else
+ {
+ return( newCode(anOperator, arg1, arg2) );
+ }
+ }
+
+ inline static BFCode newCodeFlat(Operator * anOperator,
+ const BFCode & aCode1, const BFCode & aCode2, const BFCode & aCode3)
+ {
+ if( anOperator->isWeakAssociative() )
+ {
+ BFCode newCode( anOperator );
+
+ if( aCode1->getOperator() == anOperator )
+ {
+ newCode->append( aCode1->getArgs() );
+ }
+ else
+ {
+ newCode->append( aCode1 );
+ }
+
+ if( aCode2->getOperator() == anOperator )
+ {
+ newCode->append( aCode2->getArgs() );
+ }
+ else
+ {
+ newCode->append( aCode2 );
+ }
+
+ if( aCode3->getOperator() == anOperator )
+ {
+ newCode->append( aCode3->getArgs() );
+ }
+ else
+ {
+ newCode->append( aCode3 );
+ }
+
+ return newCode;
+ }
+ else
+ {
+ return( newCode(anOperator, aCode1, aCode2, aCode3) );
+ }
+ }
+
+
+ inline static BFCode xnewCodeFlat(Operator * anOperator,
+ const BFCode & aCode1, const BFCode & aCode2, const BFCode & aCode3)
+ {
+ if( aCode1.invalid() )
+ {
+ if( aCode2.invalid() )
+ {
+ return( aCode3 );
+ }
+ else if( aCode3.invalid() )
+ {
+ return( aCode2 );
+ }
+ else
+ {
+ return( newCodeFlat(anOperator, aCode2, aCode3) );
+ }
+ }
+ else if( aCode2.invalid() )
+ {
+ if( aCode3.invalid() )
+ {
+ return( aCode1 );
+ }
+ else
+ {
+ return( newCodeFlat(anOperator, aCode1, aCode3) );
+ }
+ }
+ else if( aCode3.invalid() )
+ {
+ return( newCodeFlat(anOperator, aCode1, aCode2) );
+ }
+ else
+ {
+ return( newCodeFlat(anOperator, aCode1, aCode2, aCode3) );
+ }
+ }
+
+
+ inline static BFCode newCodeFlatMiddle(Operator * anOperator,
+ const BFCode & aCode1, const BFCode & aCode2, const BFCode & aCode3)
+ {
+ if( anOperator->isWeakAssociative() &&
+ (aCode2->getOperator() == anOperator) )
+ {
+ BFCode newCode( anOperator , aCode1 );
+
+ newCode->append( aCode2->getArgs() );
+
+ newCode->append( aCode3 );
+
+ return newCode;
+ }
+ else
+ {
+ return( newCode(anOperator, aCode1, aCode2, aCode3) );
+ }
+ }
+
+
+ inline static BFCode newCode(Operator * anOperator,
+ const BF & arg1, const BF & arg2, const BF & arg3)
+ {
+ return( BFCode( new AvmCode(anOperator, arg1, arg2, arg3) ) );
+ }
+
+ inline static BFCode newCode(Operator * anOperator,
+ const BF & arg1, const BF & arg2, const BF & arg3, const BF & arg4)
+ {
+ return( BFCode( new AvmCode(anOperator, arg1, arg2, arg3, arg4) ) );
+ }
+
+ inline static BFCode newCode(Operator * anOperator, const BF & arg1,
+ const BF & arg2, const BF & arg3, const BF & arg4, const BF & arg5)
+ {
+ return( BFCode( new AvmCode(anOperator, arg1, arg2, arg3, arg4, arg5) ) );
+ }
+
+
+ inline static BFCode newCode(Operator * anOperator,
+ const BFCodeList & listOfArg)
+ {
+ BFCode aCode( new AvmCode(anOperator) );
+ aCode->append(listOfArg);
+
+ return( aCode );
+ }
+
+
+ inline static BFCode newCode(Operator * anOperator,
+ const BF & arg, const BFCodeList & listOfArg)
+ {
+ BFCode aCode( new AvmCode(anOperator, arg) );
+ aCode->append(listOfArg);
+
+ return( aCode );
+ }
+
+
+ inline static BFCode newCode(Operator * anOperator,
+ const AvmCode::this_container_type & listOfArg)
+ {
+ BFCode aCode( new AvmCode(anOperator) );
+ aCode->append(listOfArg);
+
+ return( aCode );
+ }
+
+ inline static BFCode newCode(Operator * anOperator,
+ const BF & arg, const AvmCode::this_container_type & listOfArg)
+ {
+ BFCode aCode( new AvmCode(anOperator, arg) );
+ aCode->append(listOfArg);
+
+ return( aCode );
+ }
+
+
+ inline static BFCode newCodeTail(Operator * anOperator,
+ const AvmCode::this_container_type & listOfArg)
+ {
+ BFCode aCode( new AvmCode(anOperator) );
+ aCode->appendTail(listOfArg);
+
+ return( aCode );
+ }
+
+
+ /**
+ * METHODS
+ * ${ comment arg }
+ * ${ comment "string" }
+ */
+ inline static BFCode newComment(const BF & arg)
+ {
+ return BFCode( new AvmCode(OperatorManager::OPERATOR_COMMENT, arg) );
+ }
+
+ inline static BFCode newComment(const std::string & comment)
+ {
+ return newComment( BF(new String(comment) ) );
+ }
+
+
+ /**
+ * METHODS
+ * flatten
+ */
+ static BF flatten(BF aCode);
+
+ static BFCode flattenCode(BFCode anAvmCode);
+
+
+ /**
+ * METHODS
+ * contains subCode with a specific operator
+ */
+ static bool contains(ExecutableForm * anExecutable,
+ const BFCode & aCode, AVM_OPCODE anOpcode);
+
+ static bool contains(ExecutableForm * anExecutable,
+ const BFCode & aCode, AVM_OPCODE anOpcode1, AVM_OPCODE anOpcode2);
+
+};
+
+} /* namespace sep */
+#endif /* AVMCODEFACTORY_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/expression/BuiltinArray.cpp b/org.eclipse.efm.symbex/src/fml/expression/BuiltinArray.cpp
new file mode 100644
index 0000000..7551862
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/BuiltinArray.cpp
@@ -0,0 +1,836 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 8 févr. 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "BuiltinArray.h"
+
+#include <computer/instruction/AvmInstruction.h>
+
+#include <fml/builtin/Boolean.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/builtin/Identifier.h>
+#include <fml/builtin/String.h>
+#include <fml/builtin/QualifiedIdentifier.h>
+
+#include <fml/type/BaseSymbolTypeSpecifier.h>
+#include <fml/type/TypeManager.h>
+
+
+namespace sep
+{
+
+/**
+ * CONSTRUCTOR
+ * Copy
+ */
+ArrayBF::ArrayBF(const ArrayBF & anArray)
+: _BuiltinArray_< BF >( anArray ),
+mElementTypeId( anArray.mElementTypeId ),
+mInstruction( (anArray.mInstruction == NULL) ? NULL
+ : new AvmInstruction( *(anArray.mInstruction) ) )
+{
+ //!!! NOTHING
+}
+
+
+/**
+ * INTERFACE
+ */
+bool ArrayBF::contains(const BF & arg) const
+{
+ for( avm_size_t offset = 0 ; offset < mSize ; ++offset )
+ {
+ if( mTable[offset] == arg )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+
+bool ArrayBF::startsWith(const ArrayBF & other) const
+{
+ if( mSize > other.mSize )
+ {
+ for( avm_size_t offset = 0 ; offset < other.mSize ; ++offset )
+ {
+ if( mTable[offset] != other.mTable[offset] )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+bool ArrayBF::endsWith(const ArrayBF & other) const
+{
+ if( mSize > other.mSize )
+ {
+ avm_size_t pos = mSize - other.mSize;
+ for( avm_size_t offset = 0 ; pos < mSize ; ++pos , ++offset )
+ {
+ if( mTable[pos] != other.mTable[offset] )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+/**
+ * TRIVIALLY EQUAL
+ */
+bool ArrayBF::isTEQ(const ArrayBF & other) const
+{
+ if( this == &other )
+ {
+ return( true );
+ }
+ else if( mSize == other.mSize )
+ {
+ for( avm_size_t offset = 0 ; offset < other.mSize ; ++offset )
+ {
+ if( not mTable[offset].isTEQ( other.mTable[offset] ) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+
+ return( false );
+}
+
+/**
+ * USUAL EQUAL
+ */
+int ArrayBF::compare(const ArrayBF & other) const
+{
+ if( this == &other )
+ {
+ return( 0 );
+ }
+ else
+ {
+ int cmpResult = 0;
+
+ for( avm_size_t offset = 0 ;
+ (offset < mSize) && (offset < other.mSize) ; ++offset )
+ {
+ cmpResult = mTable[offset].compare( other.mTable[offset] );
+ if( cmpResult != 0 )
+ {
+ return( cmpResult );
+ }
+ }
+
+ return( (mSize == other.mSize) ? 0 :
+ ((mSize < other.mSize) ? -1 : 1) );
+ }
+}
+
+bool ArrayBF::isEQ(const ArrayBF & other) const
+{
+ if( mSize == other.mSize )
+ {
+ for( avm_size_t offset = 0 ; offset < other.mSize ; ++offset )
+ {
+ if( not mTable[offset].isEQ( other.mTable[offset] ) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+
+ return( false );
+}
+
+/**
+ * SYNTAXIC EQUAL
+ */
+bool ArrayBF::isSEQ(const ArrayBF & other) const
+{
+ if( mSize == other.mSize )
+ {
+ for( avm_size_t offset = 0 ; offset < other.mSize ; ++offset )
+ {
+ if( not mTable[offset].strEQ( other.mTable[offset] ) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+/**
+ * CONSTRUCTOR
+ * Other
+ */
+ArrayBF::ArrayBF(const BFVector & anArray)
+: _BuiltinArray_< BF >( CLASS_KIND_T( ArrayBF ),
+ TypeManager::ARRAY_ANY, anArray),
+mElementTypeId( ClassKindInfoInitializer::TYPE_UNDEFINED_ID ),
+mInstruction( NULL )
+{
+ //!!! NOTHING
+}
+
+ArrayBF::ArrayBF(BaseTypeSpecifier * aTypeSpecifier, const BF & defaultValue)
+: _BuiltinArray_< BF >( CLASS_KIND_T( ArrayBF ),
+ aTypeSpecifier, aTypeSpecifier->size()),
+mElementTypeId( ClassKindInfoInitializer::TYPE_UNDEFINED_ID ),
+mInstruction( NULL )
+{
+ setAll( defaultValue );
+}
+
+
+
+ArrayInteger::ArrayInteger(avm_size_t aSize)
+: _BuiltinArray_< avm_integer_t >( CLASS_KIND_T( ArrayInteger ),
+ TypeManager::ARRAY_INTEGER, aSize)
+{
+ //!!! NOTHING
+}
+
+ArrayRational::ArrayRational(avm_size_t aSize)
+: _BuiltinArray_< PairInteger >( CLASS_KIND_T( ArrayRational ),
+ TypeManager::ARRAY_RATIONAL, aSize)
+{
+ //!!! NOTHING
+}
+
+ArrayFloat::ArrayFloat(avm_size_t aSize)
+: _BuiltinArray_< double >( CLASS_KIND_T( ArrayFloat ),
+ TypeManager::ARRAY_FLOAT, aSize)
+{
+ //!!! NOTHING
+}
+
+ArrayBoolean::ArrayBoolean(avm_size_t aSize)
+: _BuiltinArray_< bool >( CLASS_KIND_T( ArrayBoolean ),
+ TypeManager::ARRAY_BOOLEAN, aSize)
+{
+ //!!! NOTHING
+}
+
+ArrayCharacter::ArrayCharacter(avm_size_t aSize)
+: _BuiltinArray_< char >( CLASS_KIND_T( ArrayCharacter ),
+ TypeManager::ARRAY_CHARACTER, aSize)
+{
+ //!!! NOTHING
+}
+
+ArrayString::ArrayString(avm_size_t aSize)
+: _BuiltinArray_< std::string >( CLASS_KIND_T( ArrayString ),
+ TypeManager::ARRAY_STRING, aSize)
+{
+ //!!! NOTHING
+}
+
+ArrayIdentifier::ArrayIdentifier(avm_size_t aSize)
+: _BuiltinArray_< std::string >( CLASS_KIND_T( ArrayIdentifier ),
+ TypeManager::ARRAY_IDENTIFIER, aSize)
+{
+ //!!! NOTHING
+}
+
+ArrayQualifiedIdentifier::ArrayQualifiedIdentifier(avm_size_t aSize)
+: _BuiltinArray_< std::string >( CLASS_KIND_T( ArrayQualifiedIdentifier ),
+ TypeManager::ARRAY_QUALIFIED_IDENTIFIER, aSize)
+{
+ //!!! NOTHING
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// TO ARRAY
+////////////////////////////////////////////////////////////////////////////////
+
+class_kind_t BuiltinArray::getArrayTypeId(class_kind_t aTypeId)
+{
+ switch( aTypeId )
+ {
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ {
+ return( FORM_ARRAY_BOOLEAN_KIND );
+ }
+ case FORM_BUILTIN_CHARACTER_KIND:
+ {
+ return( FORM_ARRAY_CHARACTER_KIND );
+ }
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ return( FORM_ARRAY_INTEGER_KIND );
+ }
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ return( FORM_ARRAY_RATIONAL_KIND );
+ }
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ return( FORM_ARRAY_FLOAT_KIND );
+ }
+ case FORM_BUILTIN_STRING_KIND:
+ {
+ return( FORM_ARRAY_STRING_KIND );
+ }
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ {
+ return( FORM_ARRAY_IDENTIFIER_KIND );
+ }
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+ {
+ return( FORM_ARRAY_QUALIFIED_IDENTIFIER_KIND );
+ }
+
+ default:
+ {
+ return( FORM_ARRAY_BF_KIND );
+ }
+ }
+}
+
+class_kind_t BuiltinArray::getArrayTypeId(
+ class_kind_t classKindA, class_kind_t classKindB)
+{
+ if( classKindA == classKindB )
+ {
+ return( classKindA );
+ }
+ else if( (classKindA == FORM_ARRAY_BF_KIND)
+ || (classKindB == FORM_ARRAY_BF_KIND) )
+ {
+ return( FORM_ARRAY_BF_KIND );
+ }
+ else
+ {
+ switch( classKindA )
+ {
+ case FORM_BUILTIN_INTEGER_KIND:
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ if( classKindB == FORM_BUILTIN_FLOAT_KIND )
+ {
+ return( FORM_BUILTIN_FLOAT_KIND );
+ }
+ else
+ {
+ return( FORM_ARRAY_BF_KIND );
+ }
+ }
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ if( classKindB == FORM_BUILTIN_INTEGER_KIND )
+ {
+ return( FORM_BUILTIN_FLOAT_KIND );
+ }
+ else
+ {
+ return( FORM_ARRAY_BF_KIND );
+ }
+ }
+
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ {
+ if( classKindB == FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND )
+ {
+ return( FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND );
+ }
+ else
+ {
+ return( FORM_ARRAY_BF_KIND );
+ }
+ }
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+ {
+ if( classKindB == FORM_BUILTIN_IDENTIFIER_KIND )
+ {
+ return( FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND );
+ }
+ else
+ {
+ return( FORM_ARRAY_BF_KIND );
+ }
+ }
+
+ default:
+ {
+ return( FORM_ARRAY_BF_KIND );
+ }
+ }
+ }
+}
+
+
+BF BuiltinArray::create(const BFVector & array)
+{
+ if( array.nonempty() )
+ {
+ BFVector::const_iterator itEnd = array.end();
+ BFVector::const_iterator it = array.begin();
+
+ class_kind_t aTypeId = (*it).classKind();
+
+ for( ++it ; it != itEnd ; ++it )
+ {
+ aTypeId = BuiltinArray::getArrayTypeId( aTypeId , (*it).classKind() );
+ if( aTypeId == FORM_ARRAY_BF_KIND )
+ {
+ break;
+ }
+ }
+
+ switch( aTypeId = BuiltinArray::getArrayTypeId( aTypeId ) )
+ {
+ case FORM_ARRAY_BOOLEAN_KIND:
+ {
+ ArrayBoolean * builtinArray = new ArrayBoolean( array.size() );
+ avm_size_t idx = 0;
+ for( it = array.begin() ; it != itEnd ; ++it, ++idx )
+ {
+ builtinArray->set(idx, (*it).toBoolean());
+ }
+
+ return( BF(builtinArray) );
+ }
+ case FORM_ARRAY_CHARACTER_KIND:
+ {
+ ArrayCharacter * builtinArray = new ArrayCharacter( array.size() );
+ avm_size_t idx = 0;
+ for( it = array.begin() ; it != itEnd ; ++it, ++idx )
+ {
+ builtinArray->set(idx, (*it).toBoolean());
+ }
+
+ return( BF(builtinArray) );
+ }
+ case FORM_ARRAY_INTEGER_KIND:
+ {
+ ArrayInteger * builtinArray = new ArrayInteger( array.size() );
+ avm_size_t idx = 0;
+ for( it = array.begin() ; it != itEnd ; ++it, ++idx )
+ {
+ builtinArray->set(idx, (*it).toInteger());
+ }
+
+ return( BF(builtinArray) );
+ }
+ case FORM_ARRAY_RATIONAL_KIND:
+ {
+ ArrayRational * builtinArray = new ArrayRational( array.size() );
+ avm_size_t idx = 0;
+ for( it = array.begin() ; it != itEnd ; ++it, ++idx )
+ {
+ builtinArray->set(idx,
+ (*it).toNumerator(), (*it).toDenominator());
+ }
+
+ return( BF(builtinArray) );
+ }
+ case FORM_ARRAY_FLOAT_KIND:
+ {
+ ArrayFloat * builtinArray = new ArrayFloat( array.size() );
+ avm_size_t idx = 0;
+ for( it = array.begin() ; it != itEnd ; ++it, ++idx )
+ {
+ builtinArray->set(idx, (*it).toFloat());
+ }
+
+ return( BF(builtinArray) );
+ }
+ case FORM_ARRAY_STRING_KIND:
+ {
+ ArrayString * builtinArray = new ArrayString( array.size() );
+ avm_size_t idx = 0;
+ for( it = array.begin() ; it != itEnd ; ++it, ++idx )
+ {
+ builtinArray->set(idx, (*it).toBuiltinString());
+ }
+
+ return( BF(builtinArray) );
+ }
+ case FORM_ARRAY_IDENTIFIER_KIND:
+ {
+ ArrayIdentifier * builtinArray = new ArrayIdentifier( array.size() );
+ avm_size_t idx = 0;
+ for( it = array.begin() ; it != itEnd ; ++it, ++idx )
+ {
+ builtinArray->set(idx, (*it).toIdentifier());
+ }
+
+ return( BF(builtinArray) );
+ }
+ case FORM_ARRAY_QUALIFIED_IDENTIFIER_KIND:
+ {
+ ArrayQualifiedIdentifier * builtinArray =
+ new ArrayQualifiedIdentifier( array.size() );
+ avm_size_t idx = 0;
+ for( it = array.begin() ; it != itEnd ; ++it, ++idx )
+ {
+ builtinArray->set(idx, (*it).toUfi());
+ }
+
+ return( BF(builtinArray) );
+ }
+
+ default:
+ {
+ return( BF(new ArrayBF(TypeManager::ARRAY_ANY, array)) );
+ }
+ }
+ }
+
+ return( BF(new ArrayBF(TypeManager::ARRAY_ANY, array)) );
+}
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CAST
+////////////////////////////////////////////////////////////////////////////////
+
+ArrayBF * ArrayInteger::getArrayBF()
+{
+ ArrayBF * bfArray = new ArrayBF( CLASS_KIND_T( Integer ),
+ TypeManager::ARRAY_INTEGER, size() );
+
+ for( avm_size_t idx = 0 ; idx < size() ; ++idx )
+ {
+ bfArray->set(idx, ExpressionConstructor::newInteger(get(idx)));
+ }
+
+ return( bfArray );
+}
+
+
+
+ArrayBF * ArrayRational::getArrayBF()
+{
+ ArrayBF * bfArray = new ArrayBF( CLASS_KIND_T( Rational ),
+ TypeManager::ARRAY_RATIONAL, size() );
+
+ for( avm_size_t idx = 0 ; idx < size() ; ++idx )
+ {
+ bfArray->set(idx, ExpressionConstructor::newRational(
+ get(idx).first(), get(idx).second()));
+ }
+
+ return( bfArray );
+}
+
+ArrayBF * ArrayFloat::getArrayBF()
+{
+ ArrayBF * bfArray = new ArrayBF( CLASS_KIND_T( Float ),
+ TypeManager::ARRAY_FLOAT, size() );
+
+ for( avm_size_t idx = 0 ; idx < size() ; ++idx )
+ {
+ bfArray->set(idx, ExpressionConstructor::newFloat(get(idx)));
+ }
+
+ return( bfArray );
+}
+
+
+ArrayBF * ArrayCharacter::getArrayBF()
+{
+ ArrayBF * bfArray = new ArrayBF( CLASS_KIND_T( Character ),
+ TypeManager::ARRAY_CHARACTER, size() );
+
+ for( avm_size_t idx = 0 ; idx < size() ; ++idx )
+ {
+ bfArray->set(idx, ExpressionConstructor::newChar(get(idx)));
+ }
+
+ return( bfArray );
+}
+
+
+
+ArrayBF * ArrayBoolean::getArrayBF()
+{
+ ArrayBF * bfArray = new ArrayBF( CLASS_KIND_T( Boolean ),
+ TypeManager::ARRAY_BOOLEAN, size() );
+
+ for( avm_size_t idx = 0 ; idx < size() ; ++idx )
+ {
+ bfArray->set(idx, ExpressionConstructor::newBoolean(get(idx)));
+ }
+
+ return( bfArray );
+}
+
+
+
+ArrayBF * ArrayString::getArrayBF()
+{
+ ArrayBF * bfArray = new ArrayBF( CLASS_KIND_T( String ),
+ TypeManager::ARRAY_STRING, size() );
+
+ for( avm_size_t idx = 0 ; idx < size() ; ++idx )
+ {
+ bfArray->set(idx, BF(new String(get(idx))));
+ }
+
+ return( bfArray );
+}
+
+
+
+ArrayBF * ArrayIdentifier::getArrayBF()
+{
+ ArrayBF * bfArray = new ArrayBF( CLASS_KIND_T( Identifier ),
+ TypeManager::ARRAY_IDENTIFIER, size() );
+
+ for( avm_size_t idx = 0 ; idx < size() ; ++idx )
+ {
+ bfArray->set(idx, BF(new Identifier(get(idx))));
+ }
+
+ return( bfArray );
+}
+
+
+ArrayBF * ArrayQualifiedIdentifier::getArrayBF()
+{
+ ArrayBF * bfArray = new ArrayBF( CLASS_KIND_T( QualifiedIdentifier ),
+ TypeManager::ARRAY_QUALIFIED_IDENTIFIER, size() );
+
+ for( avm_size_t idx = 0 ; idx < size() ; ++idx )
+ {
+ bfArray->set(idx, BF(new QualifiedIdentifier(get(idx))));
+ }
+
+ return( bfArray );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// COPY
+////////////////////////////////////////////////////////////////////////////////
+
+void ArrayBF::copy(BuiltinArray * intputArray, avm_size_t count)
+{
+ switch( intputArray->classKind() )
+ {
+ case FORM_ARRAY_BOOLEAN_KIND:
+ {
+ ArrayBoolean * builtinArray = intputArray->to< ArrayBoolean >();
+ for( avm_size_t idx = 0 ; idx < count ; ++idx )
+ {
+ set(idx, ExpressionConstructor::newBoolean(builtinArray->get(idx)));
+ }
+ break;
+ }
+ case FORM_ARRAY_CHARACTER_KIND:
+ {
+ ArrayCharacter * builtinArray = intputArray->to< ArrayCharacter >();
+ for( avm_size_t idx = 0 ; idx < count ; ++idx )
+ {
+ set(idx, ExpressionConstructor::newChar(builtinArray->get(idx)));
+ }
+ break;
+ }
+ case FORM_ARRAY_INTEGER_KIND:
+ {
+ ArrayInteger * builtinArray = intputArray->to< ArrayInteger >();
+ for( avm_size_t idx = 0 ; idx < count ; ++idx )
+ {
+ set(idx, ExpressionConstructor::newInteger(builtinArray->get(idx)));
+ }
+ break;
+ }
+ case FORM_ARRAY_RATIONAL_KIND:
+ {
+ ArrayRational * builtinArray = intputArray->to< ArrayRational >();
+ for( avm_size_t idx = 0 ; idx < count ; ++idx )
+ {
+ set(idx, ExpressionConstructor::newRational(
+ builtinArray->get(idx).first(),
+ builtinArray->get(idx).second()));
+ }
+ break;
+ }
+ case FORM_ARRAY_FLOAT_KIND:
+ {
+ ArrayFloat * builtinArray = intputArray->to< ArrayFloat >();
+ for( avm_size_t idx = 0 ; idx < count ; ++idx )
+ {
+ set(idx, ExpressionConstructor::newFloat(builtinArray->get(idx)));
+ }
+ break;
+ }
+ case FORM_ARRAY_STRING_KIND:
+ {
+ ArrayString * builtinArray = intputArray->to< ArrayString >();
+ for( avm_size_t idx = 0 ; idx < count ; ++idx )
+ {
+ set(idx, ExpressionConstructor::newString(builtinArray->get(idx)));
+ }
+ break;
+ }
+ case FORM_ARRAY_IDENTIFIER_KIND:
+ {
+ ArrayIdentifier * builtinArray = intputArray->to< ArrayIdentifier >();
+ for( avm_size_t idx = 0 ; idx < count ; ++idx )
+ {
+ set(idx, ExpressionConstructor::newIdentifier(builtinArray->get(idx)));
+ }
+ break;
+ }
+ case FORM_ARRAY_QUALIFIED_IDENTIFIER_KIND:
+ {
+ ArrayQualifiedIdentifier * builtinArray =
+ intputArray->to< ArrayQualifiedIdentifier >();
+ for( avm_size_t idx = 0 ; idx < count ; ++idx )
+ {
+ set(idx, ExpressionConstructor::
+ newQualifiedIdentifier(builtinArray->get(idx)));
+ }
+ break;
+ }
+
+ case FORM_ARRAY_BF_KIND:
+ {
+ ArrayBF * builtinArray = intputArray->to< ArrayBF >();
+ for( avm_size_t idx = 0 ; idx < count ; ++idx )
+ {
+ if( builtinArray->get(idx).is_strictly< BuiltinArray >() )
+ {
+ set(idx, BF(builtinArray->get(idx).
+ to_ptr< BuiltinArray >()->getArrayBF()));
+ }
+ else
+ {
+ set(idx, builtinArray->get(idx));
+ }
+ }
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "ArrayManager::copy:> Unexpected input array for copy !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+}
+
+
+
+/**
+ ***************************************************************************
+ * SERIALIZATION
+ ***************************************************************************
+ */
+
+std::string ArrayBF::str() const
+{
+ StringOutStream oss( AVM_STR_INDENT );
+
+AVM_IF_DEBUG_FLAG_AND( BYTECODE , hasInstruction() )
+
+ AVM_DEBUG_DISABLE_FLAG( BYTECODE )
+
+ toStream( oss << IGNORE_FIRST_TAB );
+
+ AVM_DEBUG_ENABLE_FLAG( BYTECODE )
+
+AVM_ELSE
+
+ toStream( oss << IGNORE_FIRST_TAB );
+
+AVM_ENDIF_DEBUG_FLAG_AND( BYTECODE )
+
+ return( oss.str() );
+}
+
+void ArrayBF::toStream(OutStream & os) const
+{
+ os << TAB << AVM_DEBUG_REF_COUNTER();
+
+AVM_IF_DEBUG_FLAG_AND( BYTECODE , hasInstruction() )
+ getInstruction()->toStream(os);
+AVM_ENDIF_DEBUG_FLAG_AND( BYTECODE )
+
+ if( mTypeSpecifier->hasTypeStructureOrChoiceOrUnion() )
+ {
+ BaseSymbolTypeSpecifier * strucT =
+ mTypeSpecifier->as< BaseSymbolTypeSpecifier >();
+
+AVM_IF_DEBUG_FLAG( DATA )
+ os << "<" << strucT->strT() << ">";
+AVM_ENDIF_DEBUG_FLAG( DATA )
+
+ os << "{ ";
+ if( mSize > 0 )
+ {
+ os << strucT->getSymbolData(0).strValue( mTable[0] );
+ for( avm_size_t idx = 1 ; idx < mSize ; ++idx )
+ {
+ os << " , " << strucT->getSymbolData(idx).strValue( mTable[idx] );
+ }
+ }
+ os << " }";
+ }
+ else
+ {
+AVM_IF_DEBUG_FLAG( DATA )
+ os << "<" << mTypeSpecifier->strT() << ">";
+AVM_ENDIF_DEBUG_FLAG( DATA )
+
+ os << ( mTypeSpecifier->isTypedArray() ? "[ " : "{ " );
+ if( mSize > 0 )
+ {
+ os << mTable[0].str();
+ for( avm_size_t idx = 1 ; idx < mSize ; ++idx )
+ {
+ os << " , " << mTable[idx].str();
+ }
+ }
+ os << ( mTypeSpecifier->isTypedArray() ? " ]" : " }" );
+ }
+
+ os << EOL;
+}
+
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/expression/BuiltinArray.h b/org.eclipse.efm.symbex/src/fml/expression/BuiltinArray.h
new file mode 100644
index 0000000..e843973
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/BuiltinArray.h
@@ -0,0 +1,1403 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 8 févr. 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BUILTINARRAY_H_
+#define BUILTINARRAY_H_
+
+#include <fml/expression/BuiltinContainer.h>
+
+#include <collection/Pair.h>
+
+#include <common/BF.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+
+
+namespace sep
+{
+
+
+class ArrayBF;
+class AvmInstruction;
+
+
+class BuiltinArray :
+ public BuiltinCollection ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( BuiltinArray )
+{
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ BaseTypeSpecifier * mTypeSpecifier;
+
+ avm_size_t mSize;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BuiltinArray(class_kind_t aTypeId,
+ BaseTypeSpecifier * aTypeSpecifier, avm_size_t aSize = 0)
+ : BuiltinCollection( aTypeId ),
+ mTypeSpecifier( aTypeSpecifier ),
+ mSize( aSize )
+ {
+ //!!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ BuiltinArray(const BuiltinArray & anArray)
+ : BuiltinCollection( anArray ),
+ mTypeSpecifier( anArray.mTypeSpecifier ),
+ mSize( anArray.mSize )
+ {
+ //!!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BuiltinArray()
+ {
+ mSize = 0;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mTypeSpecifier
+ */
+ inline BaseTypeSpecifier * getTypeSpecifier() const
+ {
+ return( mTypeSpecifier );
+ }
+
+ inline avm_type_specifier_kind_t getTypeSpecifierKind() const
+ {
+ return( (mTypeSpecifier != NULL) ?
+ mTypeSpecifier->getTypeSpecifierKind() : TYPE_NULL_SPECIFIER );
+ }
+
+ inline bool hasTypeSpecifier() const
+ {
+ return( mTypeSpecifier != NULL );
+ }
+
+
+ inline void setTypeSpecifier(BaseTypeSpecifier * aTypeSpecifier)
+ {
+ mTypeSpecifier = aTypeSpecifier;
+ }
+
+
+ // size is constant
+ inline avm_size_t size() const
+ {
+ return( mSize );
+ }
+
+ inline avm_size_t capacity() const
+ {
+ return( mSize );
+ }
+
+ inline void setCapacity(long aCapacity)
+ {
+ AVM_OS_FATAL_ERROR_EXIT << "NO SENSE HERE !!!" << SEND_EXIT;
+ }
+
+
+ inline bool empty() const
+ {
+ return( mSize == 0 );
+ }
+
+ inline bool nonempty() const
+ {
+ return( mSize > 0 );
+ }
+
+ inline bool singleton() const
+ {
+ return( mSize == 1 );
+ }
+
+ inline bool populated() const
+ {
+ return( mSize > 1 );
+ }
+
+
+
+ inline virtual bool contains(const BF & arg) const
+ {
+ return( false );
+ }
+
+
+ // CAST
+ virtual ArrayBF * getArrayBF() = 0;
+
+
+ static class_kind_t getArrayTypeId(class_kind_t aTypeId);
+
+ static class_kind_t getArrayTypeId(
+ class_kind_t classKindA, class_kind_t classKindB);
+
+ static BF create(const BFVector & array);
+
+
+ /**
+ * Serialization
+ */
+ virtual std::string str(avm_size_t offset) const = 0;
+
+};
+
+
+
+template< typename T >
+class _BuiltinArray_ : public BuiltinArray
+{
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+
+ T * mTable;
+
+
+public:
+
+ /**
+ * TYPEDEF
+ * iterator
+ * reference
+ */
+ typedef T * iterator;
+ typedef const T * const_iterator;
+
+ typedef T & reference;
+ typedef const T & const_reference;
+
+ typedef std::vector< T > BaseVector;
+
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ _BuiltinArray_(class_kind_t aTypeId, BaseTypeSpecifier * aTypeSpecifier,
+ avm_size_t aSize = 0)
+ : BuiltinArray( aTypeId , aTypeSpecifier, aSize ),
+ mTable( NULL )
+ {
+ alloc( aSize );
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ _BuiltinArray_(const _BuiltinArray_ & anArray)
+ : BuiltinArray( anArray ),
+ mTable( NULL )
+ {
+ alloc( anArray );
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ _BuiltinArray_(class_kind_t aTypeId, BaseTypeSpecifier * aTypeSpecifier,
+ avm_size_t aSize, T defaultValue)
+ : BuiltinArray( aTypeId , aTypeSpecifier , aSize ),
+ mTable( NULL )
+ {
+ alloc( aSize , defaultValue );
+ }
+
+ _BuiltinArray_(class_kind_t aTypeId, BaseTypeSpecifier * aTypeSpecifier,
+ const BaseVector & anArray)
+ : BuiltinArray( aTypeId , aTypeSpecifier , anArray.size() ),
+ mTable( NULL )
+ {
+ alloc( anArray );
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~_BuiltinArray_()
+ {
+ destroyContent();
+
+ delete[] ( mTable );
+
+ mTable = NULL;
+ }
+
+ inline virtual void destroyContent()
+ {
+// for( avm_size_t offset = 0 ; offset < mSize ; ++offset )
+// {
+// sep::destroy( mTable[offset] );
+// }
+ }
+
+
+ /*
+ ***************************************************************************
+ * RESET
+ ***************************************************************************
+ */
+
+ void reset(T value)
+ {
+ for( avm_size_t offset = 0 ; offset < mSize ; ++offset )
+ {
+ mTable[offset] = value;
+ }
+ }
+
+
+ /*
+ ***************************************************************************
+ * ALLOCATION
+ ***************************************************************************
+ */
+
+ inline void alloc(avm_size_t aSize)
+ {
+ mSize = aSize;
+
+ mTable = ( (mSize > 0)? (new T[ mSize ]) : NULL );
+ }
+
+
+ inline void alloc(avm_size_t aSize, T defaultValue)
+ {
+ alloc( aSize );
+
+ for( avm_size_t offset = 0 ; offset < mSize ; ++offset )
+ {
+ mTable[offset] = defaultValue;
+ }
+ }
+
+
+ inline void alloc(const _BuiltinArray_ & anArray)
+ {
+ alloc( anArray.size() );
+
+ for( avm_size_t offset = 0 ; offset < mSize ; ++offset )
+ {
+// mTable[offset] = anArray[offset];
+ mTable[offset] = anArray.get(offset);
+ }
+ }
+
+
+ inline void alloc(const BaseVector & anArray)
+ {
+ alloc( anArray.size() );
+
+ for( avm_size_t offset = 0 ; offset < mSize ; ++offset )
+ {
+ mTable[offset] = anArray[offset];
+ }
+ }
+
+
+
+ /*
+ ***************************************************************************
+ * RE-ALLOCATION
+ ***************************************************************************
+ */
+
+ inline void realloc(avm_size_t aSize)
+ {
+ destroyContent();
+
+ if( mSize != aSize )
+ {
+ delete[] ( mTable );
+
+ alloc( aSize );
+ }
+ }
+
+
+ inline void realloc(avm_size_t aSize, T defaultValue)
+ {
+ destroyContent();
+
+ if( mSize != aSize )
+ {
+ delete[] ( mTable );
+
+ alloc( aSize );
+ }
+
+ reset( defaultValue );
+ }
+
+
+ inline void realloc(const _BuiltinArray_ & anArray)
+ {
+ destroyContent();
+
+ if( mSize != anArray.size() )
+ {
+ delete[] ( mTable );
+
+ alloc( anArray.size() );
+ }
+
+ for( avm_size_t offset = 0 ; offset < mSize ; ++offset )
+ {
+ mTable[offset] = anArray[offset];
+ }
+ }
+
+
+ inline void realloc(const BaseVector & anArray)
+ {
+ destroyContent();
+
+ if( mSize != anArray.size() )
+ {
+ delete[] ( mTable );
+
+ alloc( anArray.size() );
+ }
+
+ for( avm_size_t offset = 0 ; offset < mSize ; ++offset )
+ {
+ mTable[offset] = anArray[offset];
+ }
+ }
+
+
+ /*
+ ***************************************************************************
+ * RE-SIZE
+ ***************************************************************************
+ */
+
+ inline void resize(avm_size_t aSize)
+ {
+ if( mSize > 0 )
+ {
+ avm_size_t oldSize = mSize;
+ T * oldTable = mTable;
+
+ alloc( aSize );
+
+ if( aSize > oldSize )
+ {
+ aSize = oldSize;
+ }
+
+ for( avm_size_t offset = 0 ; offset < aSize ; ++offset )
+ {
+ mTable[offset] = oldTable[offset];
+ }
+
+ delete[] oldTable;
+ }
+
+ else
+ {
+ alloc(aSize);
+ }
+ }
+
+ inline void resize(avm_size_t aSize, T defaultValue)
+ {
+ if( mSize > 0 )
+ {
+ avm_size_t oldSize = mSize;
+ T * oldTable = mTable;
+
+ alloc( aSize );
+
+ avm_size_t offset = 0;
+
+ if( aSize > oldSize )
+ {
+ aSize = oldSize;
+ }
+
+ for( ; offset < aSize ; ++offset )
+ {
+ mTable[offset] = oldTable[offset];
+ }
+
+ for( ; offset < mSize ; ++offset )
+ {
+ mTable[offset] = defaultValue;
+ }
+
+ delete[] oldTable;
+ }
+
+ else
+ {
+ alloc(aSize, defaultValue);
+ }
+ }
+
+
+ /**
+ * ITERATOR
+ */
+
+ inline iterator begin()
+ {
+ return( mTable );
+ }
+
+ inline const_iterator begin() const
+ {
+ return( mTable );
+ }
+
+ inline iterator end()
+ {
+ return( mTable + mSize );
+ }
+
+ inline const_iterator end() const
+ {
+ return( mTable + mSize );
+ }
+
+
+
+ /**
+ * GETTER - SETTER
+ * mTable
+ */
+// inline const_reference at(avm_size_t offset) const
+// {
+// AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , mSize ) << SEND_EXIT;
+//
+// return( mTable[offset] );
+// }
+
+ inline reference get(avm_size_t offset)
+ {
+ return( mTable[offset] );
+ }
+
+
+ inline const_reference get(avm_size_t offset) const
+ {
+ return( mTable[offset] );
+ }
+
+
+ inline void set(avm_size_t offset, T arg)
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , mSize ) << SEND_EXIT;
+
+ mTable[offset] = arg;
+ }
+
+ inline void set(avm_size_t offset, reference arg)
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , mSize ) << SEND_EXIT;
+
+ mTable[offset] = arg;
+ }
+
+
+
+ // operator[]
+// inline reference operator[](avm_size_t offset)
+// {
+// return( mTable[offset] );
+// }
+//
+// inline const_reference operator[](avm_size_t offset) const
+// {
+// return( mTable[offset] );
+// }
+
+ // front() and back()
+ inline reference front()
+ {
+ return mTable[0];
+ }
+
+ inline const_reference front() const
+ {
+ return mTable[0];
+ }
+
+ inline reference back()
+ {
+ return mTable[mSize - 1];
+ }
+
+ inline const_reference back() const
+ {
+ return mTable[mSize - 1];
+ }
+
+
+ inline reference first()
+ {
+ return( mTable[0] );
+ }
+
+ inline const_reference first() const
+ {
+ return( mTable[0] );
+ }
+
+
+ inline reference second()
+ {
+ return( mTable[1] );
+ }
+
+ inline const_reference second() const
+ {
+ return( mTable[1] );
+ }
+
+
+ inline reference third()
+ {
+ return( mTable[2] );
+ }
+
+ inline const_reference third() const
+ {
+ return( mTable[2] );
+ }
+
+
+ /**
+ * contains a particular element
+ */
+ inline virtual bool contains(T anArray) const
+ {
+ for( avm_size_t offset = 0 ; offset < mSize ; ++offset )
+ {
+ if( mTable[offset] == anArray )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+ }
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// ArrayBF
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class ArrayBF :
+ public _BuiltinArray_< BF >,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ArrayBF )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( ArrayBF )
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ class_kind_t mElementTypeId;
+
+ AvmInstruction * mInstruction;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ ArrayBF(const ArrayBF & anArray);
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ ArrayBF(const BFVector & anArray);
+
+ ArrayBF(BaseTypeSpecifier * aTypeSpecifier, const BFVector & aVector)
+ : _BuiltinArray_< BF >(CLASS_KIND_T( ArrayBF ), aTypeSpecifier, aVector),
+ mElementTypeId( ClassKindInfoInitializer::TYPE_UNDEFINED_ID ),
+ mInstruction( NULL )
+ {
+ //!!! NOTHING
+ }
+
+ ArrayBF(BaseTypeSpecifier * aTypeSpecifier, avm_size_t aSize = 0)
+ : _BuiltinArray_< BF >(CLASS_KIND_T( ArrayBF ), aTypeSpecifier, aSize),
+ mElementTypeId( ClassKindInfoInitializer::TYPE_UNDEFINED_ID ),
+ mInstruction( NULL )
+ {
+ //!!! NOTHING
+ }
+
+
+ ArrayBF(class_kind_t eltTypeId, BaseTypeSpecifier * aTypeSpecifier,
+ avm_size_t aSize = 0)
+ : _BuiltinArray_< BF >(CLASS_KIND_T( ArrayBF ), aTypeSpecifier, aSize),
+ mElementTypeId( eltTypeId ),
+ mInstruction( NULL )
+ {
+ //!!! NOTHING
+ }
+
+
+ ArrayBF(BaseTypeSpecifier * aTypeSpecifier, avm_size_t aSize,
+ const BF & defaultValue)
+ : _BuiltinArray_< BF >(CLASS_KIND_T( ArrayBF ), aTypeSpecifier, aSize ),
+ mElementTypeId( defaultValue.classKind() ),
+ mInstruction( NULL )
+ {
+ setAll( defaultValue );
+ }
+
+ ArrayBF(BaseTypeSpecifier * aTypeSpecifier, const BF & defaultValue);
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ArrayBF()
+ {
+ delete[] ( mTable );
+
+ mSize = 0;
+ mTable = NULL;
+ }
+
+
+ /**
+ * INTERFACE
+ */
+ bool contains(const BF & arg) const;
+
+ bool startsWith(const ArrayBF & other) const;
+
+ bool endsWith(const ArrayBF & other) const;
+
+
+ /**
+ * TRIVIALLY EQUAL
+ */
+ bool isTEQ(const ArrayBF & other) const;
+
+ inline bool isNTEQ(const ArrayBF & other) const
+ {
+ return( not ArrayBF::isTEQ( other ) );
+ }
+
+ /**
+ * USUAL EQUAL
+ */
+ int compare(const ArrayBF & other) const;
+
+ bool isEQ(const ArrayBF & other) const;
+
+ inline bool isNEQ(const ArrayBF & other) const
+ {
+ return( not isEQ( other ) );
+ }
+
+ /**
+ * SYNTAXIC EQUAL
+ */
+ bool isSEQ(const ArrayBF & other) const;
+
+ inline bool isNSEQ(const ArrayBF & other) const
+ {
+
+ return( not ArrayBF::isSEQ( other ) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * for container of BF
+ */
+ inline virtual BF & at(avm_size_t offset)
+ {
+// AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , mSize ) << SEND_EXIT;
+
+ return( mTable[offset] );
+ }
+
+ inline virtual const BF & at(avm_size_t offset) const
+ {
+// AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , mSize ) << SEND_EXIT;
+
+ return( mTable[offset] );
+ }
+
+
+ inline BF & operator[](avm_size_t offset)
+ {
+ return( mTable[offset] );
+ }
+
+ inline const BF & operator[](avm_size_t offset) const
+ {
+ return( mTable[offset] );
+ }
+
+
+ inline virtual BF & get(avm_size_t offset)
+ {
+// AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , mSize ) << SEND_EXIT;
+
+ return( mTable[offset] );
+ }
+
+ inline virtual const BF & get(avm_size_t offset) const
+ {
+// AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , mSize ) << SEND_EXIT;
+
+ return( mTable[offset] );
+ }
+
+
+ inline virtual BF & getWritable(avm_size_t offset)
+ {
+// AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , mSize ) << SEND_EXIT;
+
+ mTable[offset].makeWritable();
+
+ return( mTable[offset] );
+ }
+
+ inline virtual void makeWritable(avm_size_t offset)
+ {
+// AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , mSize ) << SEND_EXIT;
+
+ mTable[offset].makeWritable();
+ }
+
+
+ inline void set(avm_size_t offset, const BF & arg)
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , mSize ) << SEND_EXIT;
+
+ if( (mElementTypeId != ClassKindInfoInitializer::TYPE_UNDEFINED_ID)
+ && (mElementTypeId != arg.classKind()) )
+ {
+ mElementTypeId = ClassKindInfoInitializer::TYPE_UNDEFINED_ID;
+ }
+
+ mTable[offset] = arg;
+ }
+
+ inline void setAll(const BF & arg)
+ {
+ for( avm_size_t offset = 0 ; offset < mSize ; ++offset )
+ {
+ mTable[offset] = arg;
+ }
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mElementTypeId
+ */
+ inline virtual class_kind_t getElementTypeId() const
+ {
+ return( mElementTypeId );
+ }
+
+ inline void setElementTypeId(class_kind_t aTypeId)
+ {
+ mElementTypeId = aTypeId;
+ }
+
+
+ // CAST
+ ArrayBF * getArrayBF()
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected invocation of ArrayBF::getArrayBF() !!!"
+ << SEND_EXIT;
+
+ return( this );
+ }
+
+ // COPY
+ void copy(BuiltinArray * intputArray, avm_size_t count);
+
+
+ /**
+ * GETTER - SETTER
+ * for mInstruction
+ */
+ inline AvmInstruction * getInstruction() const
+ {
+ return( mInstruction );
+ }
+
+ inline bool hasInstruction() const
+ {
+ return( mInstruction != NULL );
+ }
+
+ inline void setInstruction(AvmInstruction * anInstruction)
+ {
+ mInstruction = anInstruction;
+ }
+
+
+ /**
+ ***************************************************************************
+ * SERIALIZATION
+ ***************************************************************************
+ */
+ inline virtual std::string str(avm_size_t offset) const
+ {
+ return( mTable[offset].str() );
+ }
+
+ virtual std::string str() const;
+
+
+ virtual void toStream(OutStream & os) const;
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// Array of Builtin Type
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class ArrayInteger :
+ public _BuiltinArray_< avm_integer_t >,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ArrayInteger )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( ArrayInteger )
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ ArrayInteger(const ArrayInteger & anArray)
+ : _BuiltinArray_< avm_integer_t >( anArray )
+ {
+ //!!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ ArrayInteger(avm_size_t aSize = 0);
+
+
+ // CAST
+ ArrayBF * getArrayBF();
+
+
+ /**
+ ***************************************************************************
+ * SERIALIZATION
+ ***************************************************************************
+ */
+ inline virtual std::string str(avm_size_t offset) const
+ {
+ return( OSS() << mTable[offset] );
+ }
+
+ inline void toStream(OutStream & os) const
+ {
+ os << TAB << /*"%i"*/ "[ ";
+ if( mSize > 0 )
+ {
+ os << mTable[0];
+ for( avm_size_t offset = 1 ; offset < mSize ; ++offset )
+ {
+ os << " , " << mTable[offset];
+ }
+ }
+ os << " ]" << EOL_FLUSH;
+ }
+
+}; // end class ArrayInteger
+
+
+
+class ArrayRational :
+ public _BuiltinArray_< Pair< avm_integer_t , avm_integer_t > >,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ArrayRational )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( ArrayRational )
+
+ /**
+ * TYPEDEF
+ */
+ typedef Pair< avm_integer_t , avm_integer_t > PairInteger;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ ArrayRational(const ArrayRational & anArray)
+ : _BuiltinArray_< PairInteger >( anArray )
+ {
+ //!!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ ArrayRational(avm_size_t aSize = 0);
+
+
+ // CAST
+ ArrayBF * getArrayBF();
+
+
+ inline void set(avm_size_t offset,
+ avm_integer_t aNumer, avm_integer_t aDenom)
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , mSize ) << SEND_EXIT;
+
+ mTable[offset] = PairInteger(aNumer, aDenom);
+ }
+
+ /**
+ ***************************************************************************
+ * SERIALIZATION
+ ***************************************************************************
+ */
+ inline virtual std::string str(avm_size_t offset) const
+ {
+ return( OSS() << mTable[offset].first()
+ << '/' << mTable[offset].second() );
+ }
+
+ inline void toStream(OutStream & os) const
+ {
+ os << TAB << /*"%r"*/ "[ ";
+ if( mSize > 0 )
+ {
+ os << mTable[0].first() << '/' << mTable[0].second();
+ for( avm_size_t offset = 1 ; offset < mSize ; ++offset )
+ {
+ os << " , " << mTable[offset].first()
+ << '/' << mTable[offset].second();
+ }
+ }
+ os << " ]" << EOL_FLUSH;
+ }
+
+}; // end class ArrayRational
+
+
+
+class ArrayFloat :
+ public _BuiltinArray_< avm_float_t >,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ArrayFloat )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( ArrayFloat )
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ ArrayFloat(const ArrayFloat & anArray)
+ : _BuiltinArray_< double >( anArray )
+ {
+ //!!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ ArrayFloat(avm_size_t aSize = 0);
+
+
+ // CAST
+ ArrayBF * getArrayBF();
+
+
+ /**
+ ***************************************************************************
+ * SERIALIZATION
+ ***************************************************************************
+ */
+ inline virtual std::string str(avm_size_t offset) const
+ {
+ return( OSS() << mTable[offset] );
+ }
+
+ inline void toStream(OutStream & os) const
+ {
+ os << TAB << /*"%f"*/ "[ ";
+ if( mSize > 0 )
+ {
+ os << mTable[0];
+ for( avm_size_t offset = 1 ; offset < mSize ; ++offset )
+ {
+ os << " , " << mTable[offset];
+ }
+ }
+ os << " ]" << EOL_FLUSH;
+ }
+
+}; // end class ArrayFloat
+
+
+
+class ArrayBoolean :
+ public _BuiltinArray_< bool >,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ArrayBoolean )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( ArrayBoolean )
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ ArrayBoolean(const ArrayBoolean & anArray)
+ : _BuiltinArray_< bool >( anArray )
+ {
+ //!!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ ArrayBoolean(avm_size_t aSize = 0);
+
+
+ // CAST
+ ArrayBF * getArrayBF();
+
+
+ /**
+ ***************************************************************************
+ * SERIALIZATION
+ ***************************************************************************
+ */
+ inline virtual std::string str(avm_size_t offset) const
+ {
+ return( mTable[offset] ? "true" : "false" );
+ }
+
+ inline void toStream(OutStream & os) const
+ {
+ os << TAB << /*"%b"*/ "[ ";
+ if( mSize > 0 )
+ {
+ os << (mTable[0] ? "true" : "false");
+ for( avm_size_t offset = 1 ; offset < mSize ; ++offset )
+ {
+ os << " , " << (mTable[offset] ? "true" : "false");
+ }
+ }
+ os << " ]" << EOL_FLUSH;
+ }
+
+}; // end class ArrayBoolean
+
+
+
+class ArrayCharacter :
+ public _BuiltinArray_< char >,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ArrayCharacter )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( ArrayCharacter )
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ ArrayCharacter(const ArrayCharacter & anArray)
+ : _BuiltinArray_< char >( anArray )
+ {
+ //!!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ ArrayCharacter(avm_size_t aSize = 0);
+
+
+ // CAST
+ ArrayBF * getArrayBF();
+
+
+ /**
+ ***************************************************************************
+ * SERIALIZATION
+ ***************************************************************************
+ */
+ inline virtual std::string str(avm_size_t offset) const
+ {
+ return( OSS() << mTable[offset] );
+ }
+
+ inline void toStream(OutStream & os) const
+ {
+ os << TAB << /*"%c"*/ "[ ";
+ if( mSize > 0 )
+ {
+ os << "'" << mTable[0] << "'";
+
+ for( avm_size_t offset = 1 ; offset < mSize ; ++offset )
+ {
+ os << " , '" << mTable[offset] << "'";
+ }
+ }
+ os << " ]" << EOL_FLUSH;
+ }
+}; // end class ArrayCharacter
+
+
+
+class ArrayString :
+ public _BuiltinArray_< std::string >,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ArrayString )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( ArrayString )
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ ArrayString(const ArrayString & anArray)
+ : _BuiltinArray_< std::string >( anArray )
+ {
+ //!!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ ArrayString(avm_size_t aSize = 0);
+
+
+ // CAST
+ ArrayBF * getArrayBF();
+
+
+ /**
+ ***************************************************************************
+ * SERIALIZATION
+ ***************************************************************************
+ */
+ inline virtual std::string str(avm_size_t offset) const
+ {
+ return( OSS() << "\"" << mTable[offset] << "\"" );
+// return( OSS() << mTable[offset] );
+ }
+
+ inline void toStream(OutStream & os) const
+ {
+ os << TAB << /*"%s"*/ "[ ";
+ if( mSize > 0 )
+ {
+ os << "\"" << mTable[0] << "\"";
+
+ for( avm_size_t offset = 1 ; offset < mSize ; ++offset )
+ {
+ os << " , \"" << mTable[offset] << "\"";
+ }
+ }
+ os << " ]" << EOL_FLUSH;
+ }
+}; // end class ArrayString
+
+
+
+class ArrayIdentifier :
+ public _BuiltinArray_< std::string >,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ArrayIdentifier )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( ArrayIdentifier )
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ ArrayIdentifier(const ArrayIdentifier & anArray)
+ : _BuiltinArray_< std::string >( anArray )
+ {
+ //!!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ ArrayIdentifier(avm_size_t aSize = 0);
+
+
+ // CAST
+ ArrayBF * getArrayBF();
+
+
+ /**
+ ***************************************************************************
+ * SERIALIZATION
+ ***************************************************************************
+ */
+ inline virtual std::string str(avm_size_t offset) const
+ {
+ return( OSS() << mTable[offset] );
+ }
+
+ inline void toStream(OutStream & os) const
+ {
+ os << TAB << /*"%id"*/ "[ ";
+ if( mSize > 0 )
+ {
+ os << mTable[0];
+ for( avm_size_t offset = 1 ; offset < mSize ; ++offset )
+ {
+ os << " , " << mTable[offset];
+ }
+ }
+ os << " ]" << EOL_FLUSH;
+ }
+
+}; // end class ArrayIdentifier
+
+
+
+class ArrayQualifiedIdentifier :
+ public _BuiltinArray_< std::string >,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ArrayQualifiedIdentifier )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( ArrayQualifiedIdentifier )
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ ArrayQualifiedIdentifier(const ArrayQualifiedIdentifier & anArray)
+ : _BuiltinArray_< std::string >( anArray )
+ {
+ //!!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ ArrayQualifiedIdentifier(avm_size_t aSize = 0);
+
+
+ // CAST
+ ArrayBF * getArrayBF();
+
+
+ /**
+ ***************************************************************************
+ * SERIALIZATION
+ ***************************************************************************
+ */
+ inline virtual std::string str(avm_size_t offset) const
+ {
+ return( OSS() << mTable[offset] );
+ }
+
+ inline void toStream(OutStream & os) const
+ {
+ os << TAB << /*"%ufi"*/ "[ ";
+ if( mSize > 0 )
+ {
+ os << mTable[0];
+ for( avm_size_t offset = 1 ; offset < mSize ; ++offset )
+ {
+ os << " , " << mTable[offset];
+ }
+ }
+ os << " ]" << EOL_FLUSH;
+ }
+
+}; // end class ArrayQualifiedIdentifier
+
+
+}
+
+#endif /* BUILTINARRAY_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/expression/BuiltinContainer.cpp b/org.eclipse.efm.symbex/src/fml/expression/BuiltinContainer.cpp
new file mode 100644
index 0000000..7d174bc
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/BuiltinContainer.cpp
@@ -0,0 +1,200 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 6 avr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "BuiltinContainer.h"
+
+#include <fml/expression/BuiltinArray.h>
+#include <fml/expression/BuiltinQueue.h>
+#include <fml/expression/ExpressionConstructor.h>
+
+#include <fml/type/ContainerTypeSpecifier.h>
+
+
+
+namespace sep
+{
+
+
+/**
+ * CREATION
+ */
+BuiltinContainer * BuiltinContainer::create(ContainerTypeSpecifier * containerT)
+{
+ switch( containerT->getTypeSpecifierKind() )
+ {
+ case TYPE_VECTOR_SPECIFIER:
+ {
+ return( new BuiltinVector(containerT->size()) );
+ }
+ case TYPE_REVERSE_VECTOR_SPECIFIER:
+ {
+ return( new BuiltinReverseVector(containerT->size()) );
+ }
+
+ case TYPE_LIST_SPECIFIER:
+ {
+ return( new BuiltinList(containerT->size()) );
+ }
+
+ case TYPE_SET_SPECIFIER:
+ {
+ return( new BuiltinSet(containerT->size()) );
+ }
+
+ case TYPE_MULTISET_SPECIFIER:
+ {
+ return( new BuiltinBag(containerT->size()) );
+ }
+
+
+ case TYPE_FIFO_SPECIFIER:
+ case TYPE_MULTI_FIFO_SPECIFIER:
+ {
+ return( new BuiltinFifo(containerT->size()) );
+ }
+
+ case TYPE_LIFO_SPECIFIER:
+ case TYPE_MULTI_LIFO_SPECIFIER:
+ {
+ return( new BuiltinLifo(containerT->size()) );
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BuiltinContainer::create:> Unexpected "
+ "CONTAINER type for instantiation > !!!"
+ << SEND_EXIT;
+
+ return( new BuiltinList(containerT->size()) );
+ }
+ }
+}
+
+
+void BuiltinContainer::copy(BuiltinArray * intputArray, avm_size_t count)
+{
+ switch( intputArray->classKind() )
+ {
+ case FORM_ARRAY_BOOLEAN_KIND:
+ {
+ ArrayBoolean * builtinArray = intputArray->to< ArrayBoolean >();
+ for( avm_size_t idx = 0 ; idx < count ; ++idx )
+ {
+ add( ExpressionConstructor::newExpr(builtinArray->get(idx)) );
+ }
+ break;
+ }
+ case FORM_ARRAY_CHARACTER_KIND:
+ {
+ ArrayCharacter * builtinArray = intputArray->to< ArrayCharacter >();
+ for( avm_size_t idx = 0 ; idx < count ; ++idx )
+ {
+ add( ExpressionConstructor::newChar(builtinArray->get(idx)) );
+ }
+ break;
+ }
+ case FORM_ARRAY_INTEGER_KIND:
+ {
+ ArrayInteger * builtinArray = intputArray->to< ArrayInteger >();
+ for( avm_size_t idx = 0 ; idx < count ; ++idx )
+ {
+ add( ExpressionConstructor::newExpr(builtinArray->get(idx)) );
+ }
+ break;
+ }
+ case FORM_ARRAY_RATIONAL_KIND:
+ {
+ ArrayRational * builtinArray = intputArray->to< ArrayRational >();
+ for( avm_size_t idx = 0 ; idx < count ; ++idx )
+ {
+ add( ExpressionConstructor::newExpr(
+ builtinArray->get(idx).first(),
+ builtinArray->get(idx).second()) );
+ }
+ break;
+ }
+ case FORM_ARRAY_FLOAT_KIND:
+ {
+ ArrayFloat * builtinArray = intputArray->to< ArrayFloat >();
+ for( avm_size_t idx = 0 ; idx < count ; ++idx )
+ {
+ add( ExpressionConstructor::newExpr(builtinArray->get(idx)) );
+ }
+ break;
+ }
+ case FORM_ARRAY_STRING_KIND:
+ {
+ ArrayString * builtinArray = intputArray->to< ArrayString >();
+ for( avm_size_t idx = 0 ; idx < count ; ++idx )
+ {
+ add( ExpressionConstructor::newString(
+ builtinArray->get(idx)) );
+ }
+ break;
+ }
+ case FORM_ARRAY_IDENTIFIER_KIND:
+ {
+ ArrayIdentifier * builtinArray = intputArray->to< ArrayIdentifier >();
+ for( avm_size_t idx = 0 ; idx < count ; ++idx )
+ {
+ add( ExpressionConstructor::newIdentifier(builtinArray->get(idx)) );
+ }
+ break;
+ }
+ case FORM_ARRAY_QUALIFIED_IDENTIFIER_KIND:
+ {
+ ArrayQualifiedIdentifier * builtinArray =
+ intputArray->to< ArrayQualifiedIdentifier >();
+ for( avm_size_t idx = 0 ; idx < count ; ++idx )
+ {
+ add( ExpressionConstructor::
+ newQualifiedIdentifier(builtinArray->get(idx)) );
+ }
+ break;
+ }
+
+ case FORM_ARRAY_BF_KIND:
+ {
+ ArrayBF * builtinArray = intputArray->to< ArrayBF >();
+ for( avm_size_t idx = 0 ; idx < count ; ++idx )
+ {
+ if( builtinArray->get(idx).is_strictly< BuiltinArray >() )
+ {
+ add( BF(builtinArray->get(idx).
+ to_ptr< BuiltinArray >()->getArrayBF()) );
+ }
+ else
+ {
+ add( builtinArray->get(idx) );
+ }
+ }
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BuiltinContainer::copy:> "
+ "Unexpected input array for copy !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/expression/BuiltinContainer.h b/org.eclipse.efm.symbex/src/fml/expression/BuiltinContainer.h
new file mode 100644
index 0000000..048b36d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/BuiltinContainer.h
@@ -0,0 +1,1064 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 6 avr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BUILTINCONTAINER_H_
+#define BUILTINCONTAINER_H_
+
+#include <fml/builtin/BuiltinForm.h>
+
+#include <collection/BFContainer.h>
+
+
+namespace sep
+{
+
+
+class BuiltinArray;
+class ContainerTypeSpecifier;
+
+
+class BuiltinCollection :
+ public BuiltinForm ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( BuiltinCollection )
+{
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BuiltinCollection(class_kind_t aClassKind)
+ : BuiltinForm( aClassKind )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ BuiltinCollection(const BuiltinCollection & aBuiltinCollection)
+ : BuiltinForm( aBuiltinCollection )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BuiltinCollection()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mCapacity
+ */
+ virtual avm_size_t capacity() const = 0;
+
+ inline long realCapacity() const
+ {
+ return( (capacity() == AVM_NUMERIC_MAX_SIZE_T)? -1 : capacity() );
+ }
+
+ virtual void setCapacity(long aCapacity) = 0;
+
+ inline bool isFinite() const
+ {
+ return( capacity() < AVM_NUMERIC_MAX_SIZE_T );
+ }
+
+ inline bool isInfinite() const
+ {
+ return( capacity() == AVM_NUMERIC_MAX_SIZE_T );
+ }
+
+
+ /*
+ ***************************************************************************
+ * GETTER
+ * emptiness
+ ***************************************************************************
+ */
+ virtual bool empty() const = 0;
+
+ virtual bool nonempty() const = 0;
+
+ virtual bool singleton() const = 0;
+
+ virtual bool populated() const = 0;
+
+ inline virtual bool full() const
+ {
+ return( size() == capacity() );
+ }
+
+
+ virtual avm_size_t size() const = 0;
+
+ virtual void resize(avm_size_t newSize) = 0;
+
+
+ /**
+ * INTERFACE
+ */
+ virtual bool contains(const BF & arg) const = 0;
+
+};
+
+
+class BuiltinContainer :
+ public BuiltinCollection,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( BuiltinContainer )
+{
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ avm_size_t mCapacity;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BuiltinContainer(class_kind_t aClassKind)
+ : BuiltinCollection( aClassKind ),
+ mCapacity( AVM_NUMERIC_MAX_SIZE_T )
+ {
+ //!! NOTHING
+ }
+
+ BuiltinContainer(class_kind_t aClassKind, avm_size_t aCapacity)
+ : BuiltinCollection( aClassKind ),
+ mCapacity( aCapacity )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ BuiltinContainer(const BuiltinContainer & aBuiltinContainer)
+ : BuiltinCollection( aBuiltinContainer ),
+ mCapacity( aBuiltinContainer.mCapacity )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BuiltinContainer()
+ {
+ mCapacity = 0;
+ }
+
+
+ /**
+ * CREATION
+ */
+ static BuiltinContainer * create(ContainerTypeSpecifier * containerT);
+
+
+ /**
+ * GETTER - SETTER
+ * mCapacity
+ */
+ inline avm_size_t capacity() const
+ {
+ return( mCapacity );
+ }
+
+ inline void setCapacity(long aCapacity)
+ {
+ mCapacity = (aCapacity < 0) ? AVM_NUMERIC_MAX_SIZE_T : aCapacity;
+ }
+
+
+ /**
+ * INTERFACE
+ */
+ virtual BF & at(avm_size_t idx) = 0;
+ virtual const BF & at(avm_size_t idx) const = 0;
+
+
+ inline virtual BF & operator[](avm_size_t offset)
+ {
+ return( at(offset) );
+ }
+
+ inline virtual const BF & operator[](avm_size_t offset) const
+ {
+ return( at(offset) );
+ }
+
+ virtual BF & get(avm_size_t idx) = 0;
+ virtual const BF & get(avm_size_t idx) const = 0;
+
+ virtual BF & getWritable(avm_size_t offset) = 0;
+
+ virtual void makeWritable(avm_size_t offset) = 0;
+
+ virtual void set(avm_size_t idx, const BF & arg) = 0;
+
+
+ /**
+ * INTERFACE
+ */
+ virtual bool add(const BF & arg) = 0;
+
+ inline virtual bool push(const BF & arg)
+ {
+ return( add( arg ) );
+ }
+
+
+ virtual void erase(avm_size_t idx) = 0;
+
+ virtual void remove(const BF & arg) = 0;
+
+ virtual void clear() = 0;
+
+ void copy(BuiltinArray * intputArray, avm_size_t count);
+
+};
+
+
+
+class BuiltinList :
+ public BuiltinContainer,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( BuiltinList )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( BuiltinList )
+
+protected:
+ /**
+ * TYPEDEF
+ */
+ typedef BFList list_type;
+
+public:
+ typedef list_type::iterator iterator;
+ typedef list_type::const_iterator const_iterator;
+
+ typedef list_type::reverse_iterator reverse_iterator;
+ typedef list_type::const_reverse_iterator const_reverse_iterator;
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ list_type mData;
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BuiltinList()
+ : BuiltinContainer(CLASS_KIND_T( BuiltinList ) ),
+ mData( )
+ {
+ //!! NOTHING
+ }
+
+ BuiltinList(avm_size_t aCapacity)
+ : BuiltinContainer(CLASS_KIND_T( BuiltinList ), aCapacity ),
+ mData( )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ BuiltinList(class_kind_t aClassKind)
+ : BuiltinContainer( aClassKind ),
+ mData( )
+ {
+ //!! NOTHING
+ }
+
+ BuiltinList(class_kind_t aClassKind, avm_size_t aCapacity)
+ : BuiltinContainer( aClassKind , aCapacity ),
+ mData( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ BuiltinList(const BuiltinList & aBuiltinList)
+ : BuiltinContainer( aBuiltinList ),
+ mData( aBuiltinList.mData )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BuiltinList()
+ {
+ clear();
+ }
+
+
+ /**
+ * ITERATOR
+ */
+ inline iterator begin()
+ {
+ return( mData.begin() );
+ }
+
+ inline const_iterator begin() const
+ {
+ return( mData.begin() );
+ }
+
+
+ inline iterator end()
+ {
+ return( mData.end() );
+ }
+
+ inline const_iterator end() const
+ {
+ return( mData.end() );
+ }
+
+
+ /*
+ ***************************************************************************
+ * GETTER
+ * emptiness
+ ***************************************************************************
+ */
+ inline virtual bool empty() const
+ {
+ return( mData.empty() );
+ }
+
+ inline virtual bool nonempty() const
+ {
+ return( mData.nonempty() );
+ }
+
+ inline virtual bool singleton() const
+ {
+ return( mData.singleton() );
+ }
+
+ inline virtual bool populated() const
+ {
+ return( mData.populated() );
+ }
+
+
+ inline virtual avm_size_t size() const
+ {
+ return( mData.size() );
+ }
+
+ inline virtual void resize(avm_size_t newSize)
+ {
+ mData.resize(newSize);
+ }
+
+
+ /**
+ * INTERFACE
+ */
+ virtual BF & at(avm_size_t idx)
+ {
+ return( mData.at(idx) );
+ }
+
+ virtual const BF & at(avm_size_t idx) const
+ {
+ return( mData.at(idx) );
+ }
+
+
+ virtual BF & get(avm_size_t idx)
+ {
+ return( mData.get(idx) );
+ }
+
+ virtual const BF & get(avm_size_t idx) const
+ {
+ return( mData.get(idx) );
+ }
+
+ inline virtual BF & getWritable(avm_size_t idx)
+ {
+ iterator it = mData.begin();
+ iterator endIt = mData.end();
+ for( ; (it != endIt) && (idx > 0) ; ++it , --idx )
+ {
+ //!!! NOTHING
+ }
+
+ if( (idx == 0) && (it != endIt) )
+ {
+ (*it).makeWritable();
+
+ return( *it );
+ }
+ else
+ {
+ mData.last().makeWritable();
+
+ return( mData.last() );
+ }
+ }
+
+ inline virtual void makeWritable(avm_size_t idx)
+ {
+ iterator it = mData.begin();
+ iterator endIt = mData.end();
+ for( ; (it != endIt) && (idx > 0) ; ++it , --idx )
+ {
+ //!!! NOTHING
+ }
+
+ if( (idx == 0) && (it != endIt) )
+ {
+ (*it).makeWritable();
+ }
+ else
+ {
+ mData.last().makeWritable();
+ }
+ }
+
+ inline virtual void set(avm_size_t idx, const BF & arg)
+ {
+ iterator it = mData.begin();
+ iterator endIt = mData.end();
+ for( ; (it != endIt) && (idx > 0) ; ++it , --idx )
+ {
+ //!!! NOTHING
+ }
+
+ if( (idx == 0) && (it != endIt) )
+ {
+ (*it) = arg;
+ }
+ else
+ {
+ add(arg);
+ }
+ }
+
+
+ inline virtual bool add(const BF & arg)
+ {
+ if( size() < mCapacity)
+ {
+ mData.append(arg);
+ return( true );
+ }
+ return( false );
+ }
+
+
+ inline virtual bool contains(const BF & arg) const
+ {
+ return( mData.contains(arg) );
+ }
+
+
+ inline virtual bool intersect(const BuiltinList & aBuiltin) const
+ {
+ return( mData.intersect(aBuiltin.mData) );
+ }
+
+
+
+ inline virtual void erase(avm_size_t idx)
+ {
+ if( mData.nonempty() )
+ {
+ iterator it = mData.begin();
+ iterator endIt = mData.end();
+ for( ; (it != endIt) && (idx > 0) ; ++it , --idx )
+ {
+ //!!! NOTHING
+ }
+
+ if( (idx == 0) && (it != endIt) )
+ {
+ mData.erase(it);
+ }
+ }
+ }
+
+
+ inline virtual void remove(const BF & arg)
+ {
+ mData.remove(arg);
+ }
+
+ inline virtual void clear()
+ {
+ mData.clear();
+ }
+
+
+ /**
+ ***************************************************************************
+ * SERIALIZATION
+ ***************************************************************************
+ */
+ virtual void toStream(OutStream & os) const
+ {
+ os << TAB;
+
+AVM_IF_DEBUG_FLAG( DATA )
+
+ os << "<" << classKindName() << ">";
+
+AVM_ENDIF_DEBUG_FLAG( DATA )
+
+ os << "{ ";
+ if( mData.nonempty() )
+ {
+ const_iterator it = mData.begin();
+ const_iterator endIt = mData.end();
+ os << (*it).str();
+ for( ++it ; it != endIt ; ++it )
+ {
+ os << " , " << (*it).str();
+ }
+ }
+ os << " }" << EOL_FLUSH;
+ }
+
+};
+
+
+class BuiltinVector :
+ public BuiltinContainer,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( BuiltinVector )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( BuiltinVector )
+
+protected:
+ /**
+ * TYPEDEF
+ */
+ typedef BFVector vector_type;
+
+public:
+ typedef vector_type::iterator iterator;
+ typedef vector_type::const_iterator const_iterator;
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ vector_type mData;
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BuiltinVector()
+ : BuiltinContainer( CLASS_KIND_T( BuiltinVector ) ),
+ mData( )
+ {
+ //!! NOTHING
+ }
+
+ BuiltinVector(avm_size_t aCapacity)
+ : BuiltinContainer( CLASS_KIND_T( BuiltinVector ), aCapacity),
+ mData( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ BuiltinVector(const BuiltinVector & aBuiltinVector)
+ : BuiltinContainer( aBuiltinVector ),
+ mData( aBuiltinVector.mData )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BuiltinVector(class_kind_t aClassKind)
+ : BuiltinContainer( aClassKind ),
+ mData( )
+ {
+ //!! NOTHING
+ }
+
+ BuiltinVector(class_kind_t aClassKind, avm_size_t aCapacity)
+ : BuiltinContainer( aClassKind , aCapacity ),
+ mData( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BuiltinVector()
+ {
+ clear();
+ }
+
+
+ /**
+ * ITERATOR
+ */
+ inline iterator begin()
+ {
+ return( mData.begin() );
+ }
+
+ inline const_iterator begin() const
+ {
+ return( mData.begin() );
+ }
+
+
+ inline iterator end()
+ {
+ return( mData.end() );
+ }
+
+ inline const_iterator end() const
+ {
+ return( mData.end() );
+ }
+
+
+ /*
+ ***************************************************************************
+ * GETTER
+ * emptiness
+ ***************************************************************************
+ */
+ inline virtual bool empty() const
+ {
+ return( mData.empty() );
+ }
+
+ inline virtual bool nonempty() const
+ {
+ return( mData.nonempty() );
+ }
+
+ inline virtual bool singleton() const
+ {
+ return( mData.singleton() );
+ }
+
+ inline virtual bool populated() const
+ {
+ return( mData.populated() );
+ }
+
+
+ inline virtual avm_size_t size() const
+ {
+ return( mData.size() );
+ }
+
+ inline virtual void resize(avm_size_t newSize)
+ {
+ mData.resize(newSize);
+ }
+
+
+
+
+ /**
+ * INTERFACE
+ */
+ virtual BF & at(avm_size_t idx)
+ {
+ return( mData.at(idx) );
+ }
+
+ virtual const BF & at(avm_size_t idx) const
+ {
+ return( mData.at(idx) );
+ }
+
+
+ inline virtual BF & operator[](avm_size_t offset)
+ {
+ return( mData.operator[](offset) );
+ }
+
+ inline virtual const BF & operator[](avm_size_t offset) const
+ {
+ return( mData.operator[](offset) );
+ }
+
+
+ virtual BF & get(avm_size_t idx)
+ {
+ return( mData.get(idx) );
+ }
+
+ virtual const BF & get(avm_size_t idx) const
+ {
+ return( mData.get(idx) );
+ }
+
+
+ inline BF & getWritable(avm_size_t offset)
+ {
+ mData[offset].makeWritable();
+
+ return( mData[offset] );
+ }
+
+ inline void makeWritable(avm_size_t offset)
+ {
+ mData[offset].makeWritable();
+ }
+
+
+ inline virtual void set(avm_size_t idx, const BF & arg)
+ {
+ mData.set(idx, arg);
+ }
+
+
+ inline virtual bool add(const BF & arg)
+ {
+ if( size() < mCapacity)
+ {
+ mData.append(arg);
+ return( true );
+ }
+ return( false );
+ }
+
+
+ inline virtual bool contains(const BF & arg) const
+ {
+ return( mData.contains(arg) );
+ }
+
+
+ inline virtual void erase(avm_size_t idx)
+ {
+ mData.erase( mData.begin() + idx );
+ }
+
+
+ inline virtual void remove(const BF & arg)
+ {
+ mData.remove(arg);
+ }
+
+ inline virtual void clear()
+ {
+ mData.clear();
+ }
+
+
+ /**
+ ***************************************************************************
+ * SERIALIZATION
+ ***************************************************************************
+ */
+ virtual void toStream(OutStream & os) const
+ {
+ os << TAB;
+
+AVM_IF_DEBUG_FLAG( DATA )
+
+ os << "<" << classKindName() << ">";
+
+AVM_ENDIF_DEBUG_FLAG( DATA )
+
+ os << "[ ";
+ if( mData.nonempty() )
+ {
+ const_iterator it = mData.begin();
+ const_iterator endIt = mData.end();
+ os << (*it).str();
+ for( ++it ; it != endIt ; ++it )
+ {
+ os << " , " << (*it).str();
+ }
+ }
+ os << " ]" << EOL_FLUSH;
+ }
+
+};
+
+
+
+class BuiltinReverseVector : public BuiltinVector ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( BuiltinReverseVector )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( BuiltinReverseVector )
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BuiltinReverseVector()
+ : BuiltinVector(CLASS_KIND_T( BuiltinReverseVector ) )
+ {
+ //!! NOTHING
+ }
+
+ BuiltinReverseVector(avm_size_t aCapacity)
+ : BuiltinVector(CLASS_KIND_T( BuiltinReverseVector ), aCapacity)
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ BuiltinReverseVector(const BuiltinReverseVector & aBuiltinRVector)
+ : BuiltinVector( aBuiltinRVector )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BuiltinReverseVector()
+ {
+ clear();
+ }
+
+
+ /**
+ * INTERFACE
+ */
+ virtual BF & at(avm_size_t idx)
+ {
+ return( mData.reverse_at(idx) );
+ }
+
+ virtual const BF & at(avm_size_t idx) const
+ {
+ return( mData.reverse_at(idx) );
+ }
+
+
+ inline virtual BF & operator[](avm_size_t offset)
+ {
+ return( mData.reverse_at(offset) );
+ }
+
+ inline virtual const BF & operator[](avm_size_t offset) const
+ {
+ return( mData.reverse_at(offset) );
+ }
+
+
+ virtual BF & get(avm_size_t idx)
+ {
+ return( mData.reverse_get(idx) );
+ }
+
+ virtual const BF & get(avm_size_t idx) const
+ {
+ return( mData.reverse_get(idx) );
+ }
+
+ inline BF & getWritable(avm_size_t offset)
+ {
+ mData.reverse_get(offset).makeWritable();
+
+ return( mData.reverse_get(offset) );
+ }
+
+ inline void makeWritable(avm_size_t offset)
+ {
+ mData.reverse_get(offset).makeWritable();
+ }
+
+
+ inline virtual void set(avm_size_t idx, const BF & arg)
+ {
+ mData.reverse_set(idx, arg);
+ }
+
+};
+
+
+
+class BuiltinSet : public BuiltinList ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( BuiltinSet )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( BuiltinSet )
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BuiltinSet()
+ : BuiltinList( CLASS_KIND_T( BuiltinSet ) )
+ {
+ //!! NOTHING
+ }
+
+ BuiltinSet(avm_size_t aCapacity)
+ : BuiltinList( CLASS_KIND_T( BuiltinSet ) , aCapacity )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ BuiltinSet(const BuiltinSet & aBuiltinSet)
+ : BuiltinList( aBuiltinSet )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BuiltinSet()
+ {
+ }
+
+
+ /**
+ * INTERFACE
+ */
+ inline virtual bool add(const BF & arg)
+ {
+ if( size() < mCapacity )
+ {
+ if( not contains(arg) )
+ {
+ mData.push_back( arg );
+ }
+ return( true );
+ }
+ return( false );
+ }
+
+ inline virtual void set(avm_size_t idx, const BF & arg)
+ {
+ BuiltinList::remove(arg);
+ BuiltinList::set(idx, arg);
+ }
+
+};
+
+
+
+class BuiltinBag : public BuiltinList ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( BuiltinBag )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( BuiltinBag )
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BuiltinBag()
+ : BuiltinList( CLASS_KIND_T( BuiltinBag ) )
+ {
+ //!! NOTHING
+ }
+
+ BuiltinBag(avm_size_t aCapacity)
+ : BuiltinList( CLASS_KIND_T( BuiltinBag ) , aCapacity )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ BuiltinBag(const BuiltinBag & aBuiltinBag)
+ : BuiltinList( aBuiltinBag )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BuiltinBag()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * INTERFACE
+ */
+ inline virtual void set(avm_size_t idx, const BF & arg)
+ {
+ BuiltinList::set(idx, arg);
+ }
+
+};
+
+
+
+}
+
+#endif /* BUILTINCONTAINER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/expression/BuiltinQueue.cpp b/org.eclipse.efm.symbex/src/fml/expression/BuiltinQueue.cpp
new file mode 100644
index 0000000..d797fd2
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/BuiltinQueue.cpp
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 31 mars 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "BuiltinQueue.h"
+
+namespace sep
+{
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/expression/BuiltinQueue.h b/org.eclipse.efm.symbex/src/fml/expression/BuiltinQueue.h
new file mode 100644
index 0000000..d694a5b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/BuiltinQueue.h
@@ -0,0 +1,432 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 31 mars 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BUILTINQUEUE_H_
+#define BUILTINQUEUE_H_
+
+#include <fml/expression/BuiltinContainer.h>
+
+#include <common/BF.h>
+
+#include <collection/Typedef.h>
+
+
+namespace sep
+{
+
+
+class BuiltinQueue : public BuiltinList ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( BuiltinQueue )
+{
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BuiltinQueue(class_kind_t aClassKind )
+ : BuiltinList( aClassKind )
+ {
+ //!! NOTHING
+ }
+
+ BuiltinQueue(class_kind_t aClassKind, avm_size_t aCapacity)
+ : BuiltinList( aClassKind , aCapacity )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ BuiltinQueue(const BuiltinQueue & aQueue)
+ : BuiltinList( aQueue )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BuiltinQueue()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * INTERFACE
+ */
+ inline virtual void set(avm_size_t idx, const BF & arg)
+ {
+ iterator it = mData.begin();
+ iterator endIt = mData.end();
+ for( ; (it != endIt) && (idx > 0) ; ++it , --idx )
+ {
+ //!!! NOTHING
+ }
+
+ if( (idx == 0) && (it != endIt) )
+ {
+ (*it) = arg;
+ }
+ else
+ {
+ push(arg);
+ }
+ }
+
+
+ inline virtual void resize(avm_size_t newSize)
+ {
+ if( mCapacity > newSize )
+ {
+ if( (mCapacity = size()) > newSize )
+ {
+ for( ; mCapacity > newSize ; --mCapacity )
+ {
+ pop();
+ }
+ return;
+ }
+ }
+ mCapacity = newSize;
+ }
+
+ inline virtual void resize(avm_size_t newSize, const BF & arg)
+ {
+ if( mCapacity > newSize )
+ {
+ if( (mCapacity = size()) > newSize )
+ {
+ for( ; mCapacity > newSize ; --mCapacity )
+ {
+ pop();
+ }
+ return;
+ }
+ }
+
+ if( (mCapacity = size()) < newSize )
+ {
+ for( ; mCapacity < newSize ; ++mCapacity )
+ {
+ push(arg);
+ }
+ }
+
+ mCapacity = newSize;
+ }
+
+
+ virtual bool push(const BF & arg) = 0;
+
+ // assign_top
+ virtual bool top(const BF & arg) = 0;
+
+ virtual BF & top() = 0;
+ virtual const BF & top() const = 0;
+
+ virtual BF pop() = 0;
+
+ inline virtual BF pop(avm_size_t count)
+ {
+ BF elt;
+
+ iterator endIt = mData.end();
+ for( iterator it = mData.begin() ; (it != endIt) && (count >= 0) ; --count )
+ {
+ elt = pop();
+ }
+
+ return( pop() );
+ }
+
+
+ virtual BF pop_from(const BuiltinList & aList) const = 0;
+
+ virtual void remove_popable(const BF & arg) = 0;
+
+};
+
+
+
+class BuiltinFifo : public BuiltinQueue ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( BuiltinFifo )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( BuiltinFifo )
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BuiltinFifo()
+ : BuiltinQueue( CLASS_KIND_T( BuiltinFifo ) )
+ {
+ //!! NOTHING
+ }
+
+ BuiltinFifo(avm_size_t aCapacity)
+ : BuiltinQueue( CLASS_KIND_T( BuiltinFifo ) , aCapacity )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ BuiltinFifo(const BuiltinFifo & aFifo)
+ : BuiltinQueue( aFifo )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BuiltinFifo()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * INTERFACE
+ */
+ inline virtual bool push(const BF & arg)
+ {
+ if( size() < mCapacity )
+ {
+ mData.push_back( arg );
+ return( true );
+ }
+ return( false );
+ }
+
+ inline virtual bool top(const BF & arg)
+ {
+ if( nonempty() )
+ {
+ mData.pop_front();
+ mData.push_front( arg );
+ return( true );
+ }
+ return( false );
+ }
+
+ inline virtual BF & top()
+ {
+ if ( nonempty() )
+ {
+ return( mData.front() );
+ }
+ return( BF::REF_NULL );
+ }
+
+ inline virtual const BF & top() const
+ {
+ if ( nonempty() )
+ {
+ return( mData.front() );
+ }
+ return( BF::REF_NULL );
+ }
+
+
+ inline virtual BF pop()
+ {
+ if ( nonempty() )
+ {
+ return( mData.pop_first() );
+ }
+ return( BF::REF_NULL );
+ }
+
+
+ inline virtual BF pop_from(const BuiltinList & aList) const
+ {
+ const_reverse_iterator endIt = mData.rend();
+ for( const_reverse_iterator it = mData.rbegin() ; (it != endIt) ; ++it )
+ {
+ if( aList.contains(*it) )
+ {
+ return( *it );
+ }
+ }
+
+ return( BF::REF_NULL );
+ }
+
+
+
+ inline virtual void remove_popable(const BF & arg)
+ {
+ reverse_iterator endIt = mData.rend();
+ for( reverse_iterator it = mData.rbegin() ; (it != endIt) ; ++it )
+ {
+ if( (*it) == arg )
+ {
+ mData.erase( --( it.base() ) );
+
+ break;
+ }
+ }
+ }
+
+};
+
+
+
+class BuiltinLifo : public BuiltinQueue ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( BuiltinLifo )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( BuiltinLifo )
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BuiltinLifo()
+ : BuiltinQueue( CLASS_KIND_T( BuiltinLifo ) )
+ {
+ //!! NOTHING
+ }
+
+ BuiltinLifo(avm_size_t aCapacity)
+ : BuiltinQueue( CLASS_KIND_T( BuiltinLifo ) , aCapacity )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ BuiltinLifo(const BuiltinLifo & aLifo)
+ : BuiltinQueue( aLifo )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BuiltinLifo()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * INTERFACE
+ */
+ inline virtual bool push(const BF & arg)
+ {
+ if( size() < mCapacity )
+ {
+ mData.push_back( arg );
+ return( true );
+ }
+ return( false );
+ }
+
+
+ inline virtual bool top(const BF & arg)
+ {
+ if( nonempty() )
+ {
+ mData.pop_back();
+ mData.push_back( arg );
+ return( true );
+ }
+ return( false );
+ }
+
+ inline virtual BF & top()
+ {
+ if ( nonempty() )
+ {
+ return( mData.back() );
+ }
+ return( BF::REF_NULL );
+ }
+
+ inline virtual const BF & top() const
+ {
+ if ( nonempty() )
+ {
+ return( mData.back() );
+ }
+ return( BF::REF_NULL );
+ }
+
+
+ inline virtual BF pop()
+ {
+ if ( nonempty() )
+ {
+ return( mData.pop_last() );
+ }
+ return( BF::REF_NULL );
+ }
+
+
+ inline virtual BF pop_from(const BuiltinList & aList) const
+ {
+ const_iterator endIt = mData.end();
+ for( const_iterator it = mData.begin() ; (it != endIt) ; ++it )
+ {
+ if( aList.contains(*it) )
+ {
+ return( *it );
+ }
+ }
+
+ return( BF::REF_NULL );
+ }
+
+
+ inline virtual void remove_popable(const BF & arg)
+ {
+ iterator endIt = mData.end();
+ for( iterator it = mData.begin() ; (it != endIt) ; ++it )
+ {
+ if( (*it) == arg )
+ {
+ mData.erase( it );
+
+ break;
+ }
+ }
+ }
+
+};
+
+
+}
+
+#endif /* BUILTINQUEUE_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/expression/ExpressionComparer.cpp b/org.eclipse.efm.symbex/src/fml/expression/ExpressionComparer.cpp
new file mode 100644
index 0000000..8261d2f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/ExpressionComparer.cpp
@@ -0,0 +1,285 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 déc. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ExpressionComparer.h"
+
+#include <fml/common/ObjectElement.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/BuiltinArray.h>
+#include <fml/expression/ExpressionConstructor.h>
+
+#include <fml/runtime/ExecutionConfiguration.h>
+
+#include <fml/workflow/UniFormIdentifier.h>
+
+
+namespace sep
+{
+
+/**
+ * USUAL COMPARISON
+ */
+int ExpressionComparer::compare(const BF & frst, const BF & snd)
+{
+ if( frst.raw_pointer() == snd.raw_pointer() )
+ {
+ return( 0 );
+ }
+ else if( frst.valid() && snd.valid() )
+ {
+ if( frst.classKind() == snd.classKind() )
+ {
+ switch( frst.classKind() )
+ {
+ case FORM_INSTANCE_BUFFER_KIND:
+ case FORM_INSTANCE_CONNECTOR_KIND:
+ case FORM_INSTANCE_DATA_KIND:
+ case FORM_INSTANCE_MACHINE_KIND:
+ case FORM_INSTANCE_PORT_KIND:
+
+ case FORM_EXECUTABLE_MACHINE_KIND:
+ case FORM_AVMTRANSITION_KIND:
+ case FORM_AVMPROGRAM_KIND:
+ case FORM_AVMLAMBDA_KIND:
+ {
+ return( frst.to_ref< ObjectElement >().compareFQN(
+ snd.to_ref< ObjectElement >() ) );
+ }
+
+
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ {
+ return( frst.to_ref< Boolean >().compare(
+ snd.to_ref< Boolean >() ) );
+ }
+ case FORM_BUILTIN_CHARACTER_KIND:
+ {
+ return( frst.to_ref< Character >().compare(
+ snd.to_ref< Character >() ) );
+ }
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ return( frst.to_ref< Integer >().compare(
+ snd.to_ref< Integer >() ) );
+ }
+
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ return( frst.to_ref< Rational >().compare(
+ snd.to_ref< Rational >() ) );
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ return( frst.to_ref< Float >().compare(
+ snd.to_ref< Float >() ) );
+ }
+
+ case FORM_BUILTIN_STRING_KIND:
+ {
+ return( frst.to_ref< String >().compare(
+ snd.to_ref< String >() ) );
+ }
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ {
+ return( frst.to_ref< Identifier >().compare(
+ snd.to_ref< Identifier >() ) );
+ }
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+ {
+ return( frst.to_ref< QualifiedIdentifier >().compare(
+ snd.to_ref< QualifiedIdentifier >() ) );
+ }
+
+ case FORM_RUNTIME_ID_KIND:
+ {
+ return( frst.bfRID().compare( snd.bfRID() ) );
+ }
+
+ case FORM_EXECUTION_CONFIGURATION_KIND:
+ {
+ return( frst.to_ptr< ExecutionConfiguration >()->compare(
+ snd.to_ref< ExecutionConfiguration >() ) );
+ }
+
+ case FORM_UFI_KIND:
+ {
+ return( frst.to_ref< UniFormIdentifier >().compare(
+ snd.to_ref< UniFormIdentifier >() ) );
+ }
+
+
+ case FORM_AVMCODE_KIND:
+ {
+ return( frst.to_ref< AvmCode >().compare(
+ snd.to_ref< AvmCode >() ) );
+ }
+
+ case FORM_ARRAY_BF_KIND:
+ {
+ return( frst.to_ref< ArrayBF >().compare(
+ snd.to_ref< ArrayBF >() ) );
+ }
+
+ default:
+ {
+ return( frst.is< AvmCode >() ? 1 : (
+ snd.is< AvmCode >() ? -1 :
+ frst.str().compare( snd.str() ) ) );
+ }
+ }
+ }
+
+ else
+ {
+ return( ( frst.classKind() < snd.classKind() ) ? -1 : 1 );
+ }
+ }
+ else
+ {
+ return( frst.valid() ? 1 : -1 );
+ }
+}
+
+
+
+/**
+ * USUAL EQUALITY
+ */
+bool ExpressionComparer::isEQ(const BF & frst, const BF & snd)
+{
+ if( frst.raw_pointer() == snd.raw_pointer() )
+ {
+ return( true );
+ }
+ else if( frst.valid() && snd.valid() )
+ {
+ if( frst.classKind() == snd.classKind() )
+ {
+ switch( frst.classKind() )
+ {
+ case FORM_INSTANCE_BUFFER_KIND:
+ case FORM_INSTANCE_CONNECTOR_KIND:
+ case FORM_INSTANCE_DATA_KIND:
+ case FORM_INSTANCE_MACHINE_KIND:
+ case FORM_INSTANCE_PORT_KIND:
+
+ case FORM_EXECUTABLE_MACHINE_KIND:
+ case FORM_AVMTRANSITION_KIND:
+ case FORM_AVMPROGRAM_KIND:
+ case FORM_AVMLAMBDA_KIND:
+ {
+ return( frst.isTEQ( snd ) );
+ }
+
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ {
+ return( frst.to_ref< Boolean >().operator==(
+ snd.to_ref< Boolean >() ) );
+ }
+ case FORM_BUILTIN_CHARACTER_KIND:
+ {
+ return( frst.to_ref< Character >().operator==(
+ snd.to_ref< Character >() ) );
+ }
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ return( frst.to_ref< Integer >().operator==(
+ snd.to_ref< Integer >() ) );
+ }
+
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ return( frst.to_ref< Rational >().operator==(
+ snd.to_ref< Rational >() ) );
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ return( frst.to_ref< Float >().operator==(
+ snd.to_ref< Float >() ) );
+ }
+
+ case FORM_BUILTIN_STRING_KIND:
+ {
+ return( frst.to_ref< String >().operator==(
+ snd.to_ref< String >() ) );
+ }
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ {
+ return( frst.to_ref< Identifier >().operator==(
+ snd.to_ref< Identifier >() ) );
+ }
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+ {
+ return( frst.to_ref< QualifiedIdentifier >().operator==(
+ snd.to_ref< QualifiedIdentifier >() ) );
+ }
+
+ case FORM_RUNTIME_ID_KIND:
+ {
+ return( frst.bfRID() == snd.bfRID() );
+ }
+
+ case FORM_EXECUTION_CONFIGURATION_KIND:
+ {
+ return( frst.to_ptr< ExecutionConfiguration >()->
+ getRuntimeID().isTEQ( snd.to_ptr<
+ ExecutionConfiguration >()->getRuntimeID()) &&
+ frst.to_ptr< ExecutionConfiguration >()->getCode().isEQ(
+ snd.to_ptr< ExecutionConfiguration >()->getCode()) );
+ }
+
+ case FORM_UFI_KIND:
+ {
+ return( frst.to_ref< UniFormIdentifier >().isEQ(
+ snd.to_ref< UniFormIdentifier >() ) );
+ }
+
+
+ case FORM_AVMCODE_KIND:
+ {
+ return( frst.to_ref< AvmCode >().isEQ(
+ snd.to_ref< AvmCode >() ) );
+ }
+
+ case FORM_ARRAY_BF_KIND:
+ {
+ return( frst.to_ref< ArrayBF >().isEQ(
+ snd.to_ref< ArrayBF >() ) );
+ }
+
+ default:
+ {
+ return( frst.str() == snd.str() );
+ }
+ }
+ }
+
+ else
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ return( false );
+ }
+}
+
+
+} /* namespace sep */
+
diff --git a/org.eclipse.efm.symbex/src/fml/expression/ExpressionComparer.h b/org.eclipse.efm.symbex/src/fml/expression/ExpressionComparer.h
new file mode 100644
index 0000000..c10cbc2
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/ExpressionComparer.h
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 déc. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef EXPRESSIONCOMPARER_H_
+#define EXPRESSIONCOMPARER_H_
+
+#include <common/BF.h>
+
+
+namespace sep
+{
+
+class ArrayBF;
+class BFCode;
+class UniFormIdentifier;
+
+
+class ExpressionComparer
+{
+
+public:
+
+ /**
+ * USUAL COMPARISON
+ */
+ static int compare(const BF & frst, const BF & snd);
+
+
+ /**
+ * USUAL EQUALITY
+ */
+ static bool isEQ(const BF & frst, const BF & snd);
+
+
+ static inline bool isNEQ(const BF & frst, const BF & snd)
+ {
+ return( ! ExpressionComparer::isEQ(frst, snd) );
+ }
+
+
+ /**
+ * TRIVIAL EQUALITY
+ */
+ static inline bool isTEQ(const BF & frst, const BF & snd)
+ {
+ return( frst.raw_pointer() == snd.raw_pointer() );
+ }
+
+ static inline bool isNTEQ(const BF & frst, const BF & snd)
+ {
+ return( frst.raw_pointer() != snd.raw_pointer() );
+ }
+
+};
+
+
+}
+
+#endif /* EXPRESSIONCOMPARER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/expression/ExpressionConstant.cpp b/org.eclipse.efm.symbex/src/fml/expression/ExpressionConstant.cpp
new file mode 100644
index 0000000..1468f4a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/ExpressionConstant.cpp
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 sept. 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ExpressionConstant.h"
+
+#include <fml/builtin/Boolean.h>
+#include <fml/builtin/Character.h>
+#include <fml/numeric/Integer.h>
+#include <fml/builtin/String.h>
+
+namespace sep
+{
+
+
+/**
+ * CONSTANT EXPRESSION
+ */
+BF ExpressionConstant::BOOLEAN_TRUE;
+
+BF ExpressionConstant::BOOLEAN_FALSE;
+
+
+BF ExpressionConstant::CHARACTER_NULL;
+
+BF ExpressionConstant::STRING_EMPTY;
+
+
+Numeric ExpressionConstant::INTEGER_MINUS_TWO;
+
+Numeric ExpressionConstant::INTEGER_MINUS_ONE;
+
+Numeric ExpressionConstant::INTEGER_ZERO;
+
+Numeric ExpressionConstant::INTEGER_ONE;
+
+Numeric ExpressionConstant::INTEGER_TWO;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// LOADER / DISPOSER API
+////////////////////////////////////////////////////////////////////////////////
+
+void ExpressionConstant::load()
+{
+ BOOLEAN_TRUE = Boolean::create(true);
+
+ BOOLEAN_FALSE = Boolean::create(false);
+
+
+ INTEGER_MINUS_TWO = -2;
+
+ INTEGER_MINUS_ONE = -1;
+
+ INTEGER_ZERO = 0;
+
+ INTEGER_ONE = 1;
+
+ INTEGER_TWO = 2;
+
+
+ CHARACTER_NULL = new Character('\0');
+
+ STRING_EMPTY = String::create("");
+}
+
+
+void ExpressionConstant::dispose()
+{
+ BOOLEAN_TRUE.destroy();
+ BOOLEAN_FALSE.destroy();
+
+ INTEGER_MINUS_TWO.destroy();
+ INTEGER_MINUS_ONE.destroy();
+
+ INTEGER_ZERO.destroy();
+
+ INTEGER_ONE.destroy();
+ INTEGER_TWO.destroy();
+
+ CHARACTER_NULL.destroy();
+ STRING_EMPTY.destroy();
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/expression/ExpressionConstant.h b/org.eclipse.efm.symbex/src/fml/expression/ExpressionConstant.h
new file mode 100644
index 0000000..5f09c2d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/ExpressionConstant.h
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 sept. 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVM_MODEL_EXPRESSION_EXPRESSIONCONSTANT_H_
+#define AVM_MODEL_EXPRESSION_EXPRESSIONCONSTANT_H_
+
+#include <common/BF.h>
+
+#include <fml/numeric/Numeric.h>
+
+
+namespace sep
+{
+
+
+class ExpressionConstant
+{
+
+public:
+ /**
+ * CONSTANT EXPRESSION
+ */
+ static BF BOOLEAN_TRUE;
+ static BF BOOLEAN_FALSE;
+
+ static BF CHARACTER_NULL;
+
+ static BF STRING_EMPTY;
+
+ static Numeric INTEGER_MINUS_TWO;
+ static Numeric INTEGER_MINUS_ONE;
+ static Numeric INTEGER_ZERO;
+ static Numeric INTEGER_ONE;
+ static Numeric INTEGER_TWO;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // LOADER / DISPOSER API
+ ////////////////////////////////////////////////////////////////////////////
+ static void load();
+ static void dispose();
+
+};
+
+} /* namespace sep */
+
+#endif /* AVM_MODEL_EXPRESSION_EXPRESSIONCONSTANT_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/expression/ExpressionConstructor.cpp b/org.eclipse.efm.symbex/src/fml/expression/ExpressionConstructor.cpp
new file mode 100644
index 0000000..187fde9
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/ExpressionConstructor.cpp
@@ -0,0 +1,476 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 11 sept. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ExpressionConstructor.h"
+
+#include <util/avm_string.h>
+
+#include <fml/executable/ExecutableLib.h>
+#include <fml/executable/ExecutableQuery.h>
+#include <fml/executable/ExecutableSystem.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/runtime/RuntimeLib.h>
+#include <fml/runtime/RuntimeQuery.h>
+
+#include <fml/type/EnumTypeSpecifier.h>
+
+#include <fml/infrastructure/Machine.h>
+
+#include <sew/Configuration.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Decimal / UDecimal
+////////////////////////////////////////////////////////////////////////////////
+
+BF ExpressionConstructor::newDecimal(const std::string & aValue, char sep)
+{
+ std::string::size_type pos = aValue.find(sep);
+ if( pos != std::string::npos )
+ {
+ avm_integer_t aDecimalPart;
+ if( sep::from_string< avm_integer_t >(
+ aValue.substr(pos+1), aDecimalPart) )
+ {
+ if( aDecimalPart == 0 )
+ {
+ return( ExpressionConstructor::newInteger(
+ aValue.substr(0, pos) ) );
+ }
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "fail:> sep::from_string< integer_t>( "
+ << aValue.substr(pos+1) << ") !!!"
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+
+ std::string strNumer = std::string(aValue).erase(pos, 1);
+
+ std::string strDenom = OSS() <<
+ ( std::pow(10.0, aValue.size() - (pos + 1)) );
+
+ return( ExpressionConstructor::newRational(strNumer, strDenom) );
+ }
+ else
+ {
+ return( ExpressionConstructor::newInteger(aValue) );
+ }
+}
+
+
+BF ExpressionConstructor::newUDecimal(const std::string & aValue, char sep)
+{
+ std::string::size_type pos = aValue.find(sep);
+ if( pos != std::string::npos )
+ {
+ avm_uinteger_t aDecimalPart;
+ if( sep::from_string< avm_uinteger_t >(
+ aValue.substr(pos+1), aDecimalPart) )
+ {
+ if( aDecimalPart == 0 )
+ {
+ return( ExpressionConstructor::newInteger(
+ aValue.substr(0, pos) ) );
+ }
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "fail:> sep::from_string< uinteger_t>( "
+ << aValue.substr(pos+1) << ") !!!"
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+
+ std::string strNumer = std::string(aValue).erase(pos, 1);
+
+ std::string strDenom = OSS() <<
+ ( std::pow(10.0, aValue.size() - (pos + 1)) );
+
+ return( ExpressionConstructor::newRational(strNumer, strDenom) );
+ }
+ else
+ {
+ return( ExpressionConstructor::newInteger(aValue) );
+ }
+}
+
+
+BF ExpressionConstructor::newQualifiedIdentifier(
+ Machine * machine, const std::string & aNameID)
+{
+ return( ExpressionConstructor::newQualifiedIdentifier(
+ OSS() << machine->getFullyQualifiedNameID() << '.' << aNameID ) );
+}
+
+// new instance of Element Access FQN-ID :> machine<fqn>.element<name-id>
+BF ExpressionConstructor::newQualifiedIdentifier(
+ Machine * machine, const ObjectElement * objElement)
+{
+ return( ExpressionConstructor::newQualifiedIdentifier(
+ OSS() << machine->getFullyQualifiedNameID()
+ << '.' << objElement->getNameID() ) );
+}
+
+
+BF ExpressionConstructor::newQualifiedPositionalIdentifier(
+ Machine * machine, avm_offset_t aPositionOffset )
+{
+ return( BF(new QualifiedIdentifier(
+ machine->getFullyQualifiedNameID(), aPositionOffset ) ) );
+}
+
+
+/**
+ * SPECIFIC TYPED STRING VALUE as BUILTIN EXPRESSION
+ */
+BF ExpressionConstructor::newExpr(const Configuration & aConfiguration,
+ const ITypeSpecifier & aTypeSpecifier, const std::string & aValue)
+{
+ if( aTypeSpecifier.isTypedBoolean() )
+ {
+ return( ExpressionConstructor::newBoolean(aValue) );
+ }
+
+ if( aTypeSpecifier.isTypedCharacter() )
+ {
+ return( ExpressionConstructor::newChar(aValue) );
+ }
+ if( aTypeSpecifier.isTypedString() )
+ {
+ return( ExpressionConstructor::newString(aValue) );
+ }
+
+ else if( aTypeSpecifier.weaklyTypedUInteger() )
+ {
+ return( ExpressionConstructor::newInteger(aValue) );
+ }
+ else if( aTypeSpecifier.weaklyTypedInteger() )
+ {
+ return( ExpressionConstructor::newInteger(aValue) );
+ }
+
+ else if( aTypeSpecifier.weaklyTypedURational() )
+ {
+ return( ExpressionConstructor::newRational(aValue) );
+ }
+ else if( aTypeSpecifier.weaklyTypedRational() )
+ {
+ return( ExpressionConstructor::newRational(aValue) );
+ }
+
+ else if( aTypeSpecifier.weaklyTypedFloat() )
+ {
+ return( ExpressionConstructor::newFloat(aValue) );
+ }
+
+ else if( aTypeSpecifier.weaklyTypedUReal() )
+ {
+ return( ExpressionConstructor::newUDecimal(aValue) );
+ }
+ else if( aTypeSpecifier.weaklyTypedReal() )
+ {
+ return( ExpressionConstructor::newDecimal(aValue) );
+ }
+
+ else if( aTypeSpecifier.isTypedMachine() )
+ {
+ return( ExpressionConstructor::
+ newExprMachine(aConfiguration, aValue) );
+ }
+
+ else if( aTypeSpecifier.isTypedEnum() )
+ {
+ return( aTypeSpecifier.thisTypeSpecifier()->
+ as< EnumTypeSpecifier >()->getDataByNameID(aValue) );
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+BF ExpressionConstructor::newExprMachine(
+ const Configuration & aConfiguration, const std::string & aValue)
+{
+ ExecutableQuery XQuery( aConfiguration );
+
+ const Symbol & foundMachine =
+ XQuery.getMachineByQualifiedNameID(
+ Specifier::DESIGN_INSTANCE_KIND, aValue);
+
+ if( foundMachine.valid() )
+ {
+ return( foundMachine );
+ }
+ else if( aValue == ExecutableLib::MACHINE_ENVIRONMENT.getNameID() )
+ {
+ return( ExecutableLib::MACHINE_ENVIRONMENT );
+ }
+ else if( aValue == ExecutableLib::MACHINE_NULL.getNameID() )
+ {
+ return( ExecutableLib::MACHINE_NULL );
+ }
+
+ return( BF::REF_NULL );
+}
+
+BF ExpressionConstructor::newExprRuntine(
+ const Configuration & aConfiguration, const std::string & aValue)
+{
+ RuntimeQuery RQuery( aConfiguration );
+
+ const RuntimeID & foundRuntine = RQuery.getRuntineByQualifiedNameID(aValue);
+
+ if( foundRuntine.valid() )
+ {
+ return( foundRuntine );
+ }
+ else if( aValue == RuntimeLib::RID_ENVIRONMENT.getNameID() )
+ {
+ return( RuntimeLib::RID_ENVIRONMENT );
+ }
+ else if( aValue == RuntimeLib::RID_NIL.getNameID() )
+ {
+ return( RuntimeLib::RID_NIL );
+ }
+
+ return( RuntimeLib::RID_ENVIRONMENT );
+}
+
+
+/**
+ * SPECIFIC AVMCODE EXPRESSION
+ */
+
+////////////////////////////////////////////////////////////////////////////////
+// ADD < INCR | DECR > EXPRESSION
+////////////////////////////////////////////////////////////////////////////////
+
+BF ExpressionConstructor::addExpr(const BF & arg, avm_integer_t val)
+{
+ switch( arg.classKind() )
+ {
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ BF res = arg;
+ res.makeWritable();
+ res.to_ptr< Integer >()->addExpr(val);
+
+ return( res );
+ }
+
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ BF res = arg;
+ res.makeWritable();
+ res.to_ptr< Rational >()->addExpr(val);
+
+ return( res );
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ BF res = arg;
+ res.makeWritable();
+ res.to_ptr< Float >()->addExpr(val);
+
+ return( res );
+ }
+
+ default:
+ {
+ return( addExpr(arg, newUInteger(val)) );
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// FOR ALL EXPRESSION IMPLEMENTATION
+////////////////////////////////////////////////////////////////////////////////
+
+BF ExpressionConstructor::newExpr(Operator * anOperator, const BF & arg)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_AND:
+ case AVM_OPCODE_OR:
+ case AVM_OPCODE_PLUS:
+ case AVM_OPCODE_MULT:
+ case AVM_OPCODE_POW:
+ case AVM_OPCODE_DIV:
+ {
+ return( arg );
+ }
+
+ case AVM_OPCODE_NOT:
+ {
+ return( notExpr(arg) );
+ }
+
+ case AVM_OPCODE_UMINUS:
+ {
+ return( uminusExpr(arg) );
+ }
+
+ default:
+ {
+ return( newCode(anOperator, arg) );
+ }
+ }
+}
+
+BF ExpressionConstructor::newExpr(
+ Operator * anOperator, const BF & arg1, const BF & arg2)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_AND:
+ {
+ return( andExpr(arg1, arg2) );
+ }
+ case AVM_OPCODE_OR:
+ {
+ return( orExpr(arg1, arg2) );
+ }
+
+ case AVM_OPCODE_EXIST:
+ {
+ return( existExpr(arg1, arg2) );
+ }
+ case AVM_OPCODE_FORALL:
+ {
+ return( forallExpr(arg1, arg2) );
+ }
+
+ case AVM_OPCODE_EQ:
+ {
+ return( eqExpr(arg1, arg2) );
+ }
+ case AVM_OPCODE_NEQ:
+ {
+ return( neqExpr(arg1, arg2) );
+ }
+
+ case AVM_OPCODE_SEQ:
+ {
+ return( seqExpr(arg1, arg2) );
+ }
+ case AVM_OPCODE_NSEQ:
+ {
+ return( nseqExpr(arg1, arg2) );
+ }
+
+ case AVM_OPCODE_LT:
+ {
+ return( ltExpr(arg1, arg2) );
+ }
+ case AVM_OPCODE_LTE:
+ {
+ return( lteExpr(arg1, arg2) );
+ }
+ case AVM_OPCODE_GT:
+ {
+ return( gtExpr(arg1, arg2) );
+ }
+ case AVM_OPCODE_GTE:
+ {
+ return( gteExpr(arg1, arg2) );
+ }
+
+ case AVM_OPCODE_PLUS:
+ {
+ return( addExpr(arg1, arg2) );
+ }
+ case AVM_OPCODE_MINUS:
+ {
+ return( minusExpr(arg1, arg2) );
+ }
+
+ case AVM_OPCODE_MULT:
+ {
+ return( multExpr(arg1, arg2) );
+ }
+ case AVM_OPCODE_POW:
+ {
+ return( powExpr(arg1, arg2) );
+ }
+
+ case AVM_OPCODE_DIV:
+ {
+ return( divExpr(arg1, arg2) );
+ }
+
+ default:
+ {
+ return( newCode(anOperator, arg1, arg2) );
+ }
+ }
+}
+
+
+BF ExpressionConstructor::newExpr(
+ Operator * anOperator, const AvmCode::this_container_type & listOfArg)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_AND:
+ {
+ return( andExpr(listOfArg) );
+ }
+ case AVM_OPCODE_OR:
+ {
+ return( orExpr(listOfArg) );
+ }
+
+ case AVM_OPCODE_EXIST:
+ {
+ return( existExpr(listOfArg) );
+ }
+ case AVM_OPCODE_FORALL:
+ {
+ return( forallExpr(listOfArg) );
+ }
+
+ case AVM_OPCODE_PLUS:
+ {
+ return( addExpr(listOfArg) );
+ }
+ case AVM_OPCODE_MULT:
+ {
+ return( multExpr(listOfArg) );
+ }
+
+ default:
+ {
+ return( newCode(anOperator, listOfArg) );
+ }
+ }
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/expression/ExpressionConstructor.h b/org.eclipse.efm.symbex/src/fml/expression/ExpressionConstructor.h
new file mode 100644
index 0000000..9604a3e
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/ExpressionConstructor.h
@@ -0,0 +1,864 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 11 sept. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef EXPRESSIONCONSTRUCTOR_H_
+#define EXPRESSIONCONSTRUCTOR_H_
+
+#include <fml/expression/AvmCodeFactory.h>
+
+#include <common/BF.h>
+
+#include <fml/builtin/Boolean.h>
+#include <fml/builtin/Character.h>
+#include <fml/builtin/Identifier.h>
+#include <fml/builtin/String.h>
+#include <fml/builtin/QualifiedIdentifier.h>
+
+#include <fml/numeric/Float.h>
+#include <fml/numeric/Integer.h>
+#include <fml/numeric/Rational.h>
+
+#include <fml/numeric/Numeric.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/ExpressionConstant.h>
+#include <fml/expression/ExpressionConstructorImpl.h>
+
+#include <fml/lib/ITypeSpecifier.h>
+
+#include <fml/operator/Operator.h>
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/workflow/UniFormIdentifier.h>
+
+#include <cmath>
+
+
+
+namespace sep
+{
+
+class Configuration;
+class ObjectElement;
+class Machine;
+
+
+class ExpressionConstructor : public AvmCodeFactory
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// DEFAULT EXPRESSION CONSTRUCTOR IMPLEMENTATION
+////////////////////////////////////////////////////////////////////////////////
+#if( true )
+
+ #define DEFAULT_EXPRESSION_IMPL EXPRESSION::NATIVE_IMPL
+
+#endif
+
+
+public:
+
+ /**
+ * PRIMITIVE EXPRESSION
+ */
+ ////////////////////////////////////////////////////////////////////////////
+ // DEFAULT NEW BOOLEAN VALUE
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static const BF & newBoolean(bool aValue = false)
+ {
+ return( ( aValue )
+ ? ExpressionConstant::BOOLEAN_TRUE
+ : ExpressionConstant::BOOLEAN_FALSE );
+ }
+
+ inline static BF newBoolean(const char * aValue)
+ {
+ return( ( ::strcasecmp("true", aValue) == 0 )
+ ? ExpressionConstant::BOOLEAN_TRUE
+ : ExpressionConstant::BOOLEAN_FALSE );
+ }
+
+ inline static BF newBoolean(const std::string & aValue)
+ {
+ return( ( ::strcasecmp("true", aValue.c_str()) == 0)
+ ? ExpressionConstant::BOOLEAN_TRUE
+ : ExpressionConstant::BOOLEAN_FALSE );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DEFAULT NEW INTEGER VALUE
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static BF newInteger(Integer * aValue)
+ {
+ return( BF( aValue ) );
+ }
+
+ inline static BF newInteger(avm_integer_t aValue)
+ {
+ switch( aValue )
+ {
+ case 0: return( ExpressionConstant::INTEGER_ZERO );
+
+ case 1: return( ExpressionConstant::INTEGER_ONE );
+ case 2: return( ExpressionConstant::INTEGER_TWO );
+
+ case -1: return( ExpressionConstant::INTEGER_MINUS_ONE );
+ case -2: return( ExpressionConstant::INTEGER_MINUS_TWO );
+
+ default: return( BF( new Integer(aValue) ) );
+ }
+ }
+
+ inline static BF newUInteger(avm_uinteger_t aValue)
+ {
+ switch( aValue )
+ {
+ case 0: return( ExpressionConstant::INTEGER_ZERO );
+
+ case 1: return( ExpressionConstant::INTEGER_ONE );
+ case 2: return( ExpressionConstant::INTEGER_TWO );
+
+ default: return( BF( new Integer(aValue) ) );
+ }
+ }
+
+ inline static BF newInteger(const std::string & aValue)
+ {
+ return( BF( new Integer(aValue) ) );
+ }
+
+
+#if defined( _AVM_BUILTIN_NUMERIC_BOOST_ )
+
+ inline static BF newInteger(const Integer::RawValueType & aValue)
+ {
+ return( BF( new Integer(aValue) ) );
+ }
+
+#endif /* _AVM_BUILTIN_NUMERIC_GMP_ */
+
+
+#if defined( _AVM_BUILTIN_NUMERIC_GMP_ )
+
+ inline static BF newInteger(const mpz_t & aValue)
+ {
+ return( BF( new Integer(aValue) ) );
+ }
+
+ inline static BF newInteger(const Integer::RawValueType & aValue)
+ {
+ return( BF( new Integer(aValue) ) );
+ }
+
+#endif /* _AVM_BUILTIN_NUMERIC_GMP_ */
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DEFAULT NEW RATIONAL VALUE
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static BF newRational(Rational * aValue)
+ {
+ return( BF( aValue ) );
+ }
+
+ inline static BF newRational(avm_integer_t aNumer)
+ {
+ return( BF( new Rational(aNumer) ) );
+ }
+
+ inline static BF newURational(avm_uinteger_t aNumer)
+ {
+ return( BF( new Rational(aNumer) ) );
+ }
+
+ inline static BF newRational(avm_integer_t aNumer, avm_integer_t aDenom)
+ {
+ if( aDenom != 0 )
+ {
+ return( (aNumer == 0) ? ExpressionConstant::INTEGER_ZERO :
+ BF( new Rational(aNumer, aDenom) ) );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "fail:> newRational< "
+ << aNumer << " / " << aDenom << " > !!!"
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+ }
+
+ inline static BF newRational(avm_integer_t aNumer, avm_uinteger_t aDenom)
+ {
+ if( aDenom != 0 )
+ {
+ return( (aNumer == 0) ? ExpressionConstant::INTEGER_ZERO :
+ BF( new Rational(aNumer, aDenom) ) );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "fail:> newRational< "
+ << aNumer << " / " << aDenom << " > !!!"
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+ }
+
+ inline static BF newURational(avm_uinteger_t aNumer, avm_uinteger_t aDenom)
+ {
+ if( aDenom != 0 )
+ {
+ return( (aNumer == 0) ? ExpressionConstant::INTEGER_ZERO :
+ BF( new Rational(aNumer, aDenom) ) );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "fail:> newRational< "
+ << aNumer << " / " << aDenom << " > !!!"
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+ }
+
+ inline static BF newRational(const std::string & aValue)
+ {
+ return( BF( new Rational(aValue) ) );
+ }
+
+ inline static BF newRational(
+ const std::string & strNumer, const std::string & strDenom)
+ {
+ return( BF( new Rational(strNumer, strDenom) ) );
+ }
+
+
+#if defined( _AVM_BUILTIN_NUMERIC_BOOST_ )
+
+ inline static BF newRational(
+ const Integer::RawValueType & aNumer,
+ const Integer::RawValueType & aDenom)
+ {
+ return( BF( new Rational(aNumer, aDenom) ) );
+ }
+
+#endif /* _AVM_BUILTIN_NUMERIC_GMP_ */
+
+
+#if defined( _AVM_BUILTIN_NUMERIC_GMP_ )
+
+ inline static BF newRational(const mpz_t & aNumer, const mpz_t & aDenom)
+ {
+ return( BF( new Rational(aNumer, aDenom) ) );
+ }
+
+ inline static BF newRational(
+ const Integer::RawValueType & aNumer,
+ const Integer::RawValueType & aDenom)
+ {
+ return( BF( new Rational(aNumer, aDenom) ) );
+ }
+
+
+ inline static BF newRational(const mpq_t & aValue)
+ {
+ return( BF( new Rational( aValue ) ) );
+ }
+
+#endif /* _AVM_BUILTIN_NUMERIC_GMP_ */
+
+ inline static BF newRational(const Rational::RawValueType & aValue)
+ {
+ return( BF( new Rational(aValue) ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Decimal / UDecimal
+ ////////////////////////////////////////////////////////////////////////////
+
+ static BF newDecimal(const std::string & aValue, char sep = '.');
+
+ static BF newUDecimal(const std::string & aValue, char sep = '.');
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DEFAULT NEW FLOAT VALUE
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static BF newFloat(Float * aValue)
+ {
+ return( BF( aValue ) );
+ }
+
+ inline static BF newFloat(avm_integer_t aValue)
+ {
+ return( BF( new Float(static_cast< avm_float_t >(aValue)) ) );
+ }
+
+ inline static BF newUFloat(avm_uinteger_t aValue)
+ {
+ return( BF( new Float(static_cast< avm_float_t >(aValue)) ) );
+ }
+
+ inline static BF newFloat(avm_float_t aValue)
+ {
+ return( BF( new Float(aValue) ) );
+ }
+
+ inline static BF newFloat(const std::string & aValue)
+ {
+ return( BF( new Float(aValue) ) );
+ }
+
+
+#if defined( _AVM_BUILTIN_NUMERIC_BOOST_ )
+
+ inline static BF newFloat(const Rational::RawValueType & aValue)
+ {
+ return( BF( new Float( Float::RawValueType(aValue) ) ) );
+ }
+
+ inline static BF newFloat(const Float::RawValueType & aValue)
+ {
+ return( BF( new Float(aValue) ) );
+ }
+
+#endif /* _AVM_BUILTIN_NUMERIC_GMP_ */
+
+
+#if defined( _AVM_BUILTIN_NUMERIC_GMP_ )
+
+ inline static BF newFloat(const mpq_t & aValue)
+ {
+ return( BF( new Float( Float::RawValueType(
+ Rational::RawValueType(aValue)) ) ) );
+ }
+
+ inline static BF newFloat(const Rational::RawValueType & aValue)
+ {
+ return( BF( new Float( Float::RawValueType(aValue) ) ) );
+ }
+
+ inline static BF newFloat(const mpf_t & aValue)
+ {
+ return( BF( new Float( Float::RawValueType(aValue) ) ) );
+ }
+
+ inline static BF newFloat(const Float::RawValueType & aValue)
+ {
+ return( BF( new Float(aValue) ) );
+ }
+
+#endif /* _AVM_BUILTIN_NUMERIC_GMP_ */
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DEFAULT NEW NUMERIC VALUE
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static BF newNumeric(const Numeric & aNumeric)
+ {
+ return( BF( aNumeric ) );
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Char / String / Identifier / QualifiedIdentifier
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static BF newChar(Character * aValue)
+ {
+ return( BF( aValue ) );
+ }
+
+ inline static BF newChar(char aValue = ' ')
+ {
+ return( BF( new Character(aValue) ) );
+ }
+
+ inline static BF newChar(const std::string & aValue)
+ {
+ return( BF( new Character(aValue.at(0)) ) );
+ }
+
+ inline static BF newString(const std::string & aValue = "",
+ char aQuote = String::DEFAULT_DELIMITER)
+ {
+ return( String::create(aValue, aQuote) );
+ }
+
+ inline static BF newSingleQuoteString(const std::string & aValue = "",
+ char aQuote = String::SINGLE_QUOTE_DELIMITER)
+ {
+ return( String::create(aValue, aQuote) );
+ }
+
+ inline static BF newDoubleQuoteString(const std::string & aValue = "",
+ char aQuote = String::DOUBLE_QUOTE_DELIMITER)
+ {
+ return( String::create(aValue, aQuote) );
+ }
+
+ inline static BF newIdentifier(const std::string & aValue = "")
+ {
+ return( BF( new Identifier(aValue) ) );
+ }
+
+ inline static BF newQualifiedIdentifier(const std::string & aValue = "")
+ {
+ return( BF( new QualifiedIdentifier(aValue) ) );
+ }
+
+ // new instance of Element Access FQN-ID :> machine<fqn>.element<name-id>
+ static BF newQualifiedIdentifier(
+ Machine * machine, const std::string & aNameID);
+
+ static BF newQualifiedIdentifier(Machine * machine,
+ const ObjectElement * objElement);
+
+ static BF newQualifiedPositionalIdentifier(
+ Machine * machine, avm_offset_t aPositionOffset );
+
+
+ inline static BF newMachineVarUFI(
+ const BF & aMachine, const BF & aVariable)
+ {
+ UniFormIdentifier * anUFI = new UniFormIdentifier(false);
+ anUFI->appendFieldMachine( aMachine );
+ anUFI->appendFieldVariable( aVariable );
+
+ return( BF( anUFI ) );
+ }
+
+
+ /**
+ * SPECIFIC NUMERIC EXPRESSION
+ */
+ inline static BF newExpr(bool aValue)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::newExpr( aValue ) );
+ }
+
+ inline static BF newExpr(avm_integer_t aValue)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::newExpr( aValue ) );
+ }
+
+
+ inline static BF newExpr(avm_integer_t aNumer, avm_integer_t aDenom)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::newExpr( aNumer, aDenom ) );
+ }
+
+ inline static BF newExpr(avm_integer_t aNumer, avm_uinteger_t aDenom)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::newExpr( aNumer, aDenom ) );
+ }
+
+ inline static BF newExpr(avm_uinteger_t aNumer, avm_uinteger_t aDenom)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::newExpr( aNumer, aDenom ) );
+ }
+
+ inline static BF newExpr(
+ const Integer & aNumer, const Integer & aDenom)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::newExpr( aNumer, aDenom ) );
+ }
+
+
+ inline static BF newExpr(float aValue)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::newExpr( aValue ) );
+ }
+
+ inline static BF newExpr(double aValue)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::newExpr( aValue ) );
+ }
+
+
+ /**
+ * SPECIFIC STRING VALUE as BUILTIN EXPRESSION
+ */
+ inline static BF newExprBoolean(const std::string & aValue)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::newBoolean( aValue ) );
+ }
+
+ inline static BF newExprBoolean(const char * aValue)
+ {
+ return( (aValue != NULL)
+ ? ExpressionConstructorImpl< DEFAULT_EXPRESSION_IMPL >::
+ newBoolean( std::string(aValue) )
+ : ExpressionConstructorImpl< DEFAULT_EXPRESSION_IMPL >::
+ newBoolean( false ) );
+ }
+
+
+ inline static BF newExprInteger(const std::string & aValue)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::newInteger( aValue ) );
+ }
+
+ inline static BF newExprInteger(const char * aValue)
+ {
+ return( (aValue != NULL)
+ ? ExpressionConstructorImpl< DEFAULT_EXPRESSION_IMPL >::
+ newInteger( std::string(aValue) )
+ : ExpressionConstructorImpl< DEFAULT_EXPRESSION_IMPL >::
+ newInteger( 0 ) );
+ }
+
+
+ inline static BF newExprRational(const std::string & aValue)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::newRational( aValue ) );
+ }
+
+ inline static BF newExprRational(const char * aValue)
+ {
+ return( (aValue != NULL)
+ ? ExpressionConstructorImpl< DEFAULT_EXPRESSION_IMPL >::
+ newRational( std::string(aValue) )
+ : ExpressionConstructorImpl< DEFAULT_EXPRESSION_IMPL >::
+ newRational( 0 ) );
+ }
+
+
+ inline static BF newExprFloat(const std::string & aValue)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::newFloat( aValue ) );
+ }
+
+ inline static BF newExprFloat(const char * aValue)
+ {
+ return( (aValue != NULL)
+ ? ExpressionConstructorImpl< DEFAULT_EXPRESSION_IMPL >::
+ newFloat( std::string(aValue) )
+ : ExpressionConstructorImpl< DEFAULT_EXPRESSION_IMPL >::
+ newFloat( 0.0 ) );
+ }
+
+
+ inline static BF newExprNumber(const std::string & aValue)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::newExprNumber( aValue ) );
+ }
+
+ inline static BF newExprNumber(const char * aValue)
+ {
+ return( (aValue != NULL)
+ ? ExpressionConstructorImpl< DEFAULT_EXPRESSION_IMPL >::
+ newExprNumber( std::string(aValue) )
+ : ExpressionConstructorImpl< DEFAULT_EXPRESSION_IMPL >::
+ newInteger( 0 ) );
+ }
+
+
+ static BF newExprMachine(const Configuration & aConfiguration,
+ const std::string & aValue);
+
+ static BF newExprRuntine(const Configuration & aConfiguration,
+ const std::string & aValue);
+
+
+ /**
+ * SPECIFIC TYPED STRING VALUE as BUILTIN EXPRESSION
+ */
+ static BF newExpr(const Configuration & aConfiguration,
+ const ITypeSpecifier & aTypeSpecifier, const std::string & aValue);
+
+
+ /**
+ * SPECIFIC AVMCODE EXPRESSION
+ */
+ inline static BF newExpr(const BF & anElement)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::newExpr( anElement ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // QUANTIFIER EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ static BF existExpr(const BF & boundVar, const BF & formula)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::existExpr( boundVar, formula ) );
+ }
+
+ static BF existExpr(const AvmCode::this_container_type & listOfArg)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::existExpr( listOfArg ) );
+ }
+
+
+ static BF forallExpr(const BF & boundVar, const BF & formula)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::forallExpr( boundVar, formula ) );
+ }
+
+ static BF forallExpr(const AvmCode::this_container_type & listOfArg)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::forallExpr( listOfArg ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // AND EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static BF andExpr(const BF & arg0, const BF & arg1)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::andExpr( arg0, arg1 ) );
+ }
+
+ inline static BF andExpr(const AvmCode::this_container_type & listOfArg)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::andExpr( listOfArg ) );
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // OR EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static BF orExpr(const BF & arg0, const BF & arg1)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::orExpr( arg0, arg1 ) );
+ }
+
+ inline static BF orExpr(const AvmCode::this_container_type & listOfArg)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::orExpr( listOfArg ) );
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // NOT EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static BF notExpr(const BF & arg)
+ {
+ if( arg.isEqualTrue() )
+ {
+ return( ExpressionConstant::BOOLEAN_FALSE );
+
+// return( ExpressionConstructorImpl<
+// DEFAULT_EXPRESSION_IMPL >::newExpr( false ) );
+ }
+ else if( arg.isEqualFalse() )
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+
+// return( ExpressionConstructorImpl<
+// DEFAULT_EXPRESSION_IMPL >::newExpr( true ) );
+ }
+ else
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::notExpr( arg ) );
+ }
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // [ NOT ] EQUAL EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static BF eqExpr(const BF & arg0, const BF & arg1)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::eqExpr( arg0, arg1 ) );
+ }
+
+ inline static BF neqExpr(const BF & arg0, const BF & arg1)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::neqExpr( arg0, arg1 ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // [ NOT ] SYNTAXIC EQUAL EXPRESSION
+ // FOR ALL EXPRESSION IMPLEMENTATION
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static BF seqExpr(const BF & arg0, const BF & arg1)
+ {
+ return( newCode(OperatorManager::OPERATOR_SEQ, arg0, arg1) );
+ }
+
+ inline static BF nseqExpr(const BF & arg0, const BF & arg1)
+ {
+ return( newCode(OperatorManager::OPERATOR_NSEQ, arg0, arg1) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // COMPARE EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static BF gtExpr(const BF & arg0, const BF & arg1)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::gtExpr( arg0, arg1 ) );
+ }
+
+ inline static BF gteExpr(const BF & arg0, const BF & arg1)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::gteExpr( arg0, arg1 ) );
+ }
+
+ inline static BF ltExpr(const BF & arg0, const BF & arg1)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::ltExpr( arg0, arg1 ) );
+ }
+
+ inline static BF lteExpr(const BF & arg0, const BF & arg1)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::lteExpr( arg0, arg1 ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // ADD EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ static BF addExpr(const BF & arg, avm_integer_t val);
+
+ inline static BF addExpr(const BF & arg0, const BF & arg1)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::addExpr( arg0, arg1 ) );
+ }
+
+ inline static BF addExpr(const AvmCode::this_container_type & listOfArg)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::addExpr( listOfArg ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // UMINUS EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static BF uminusExpr(const BF & arg)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::uminusExpr( arg ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // MINUS EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static BF minusExpr(const BF & arg0, const BF & arg1)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::minusExpr( arg0, arg1 ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // MULT EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static BF multExpr(const BF & arg0, const BF & arg1)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::multExpr( arg0, arg1 ) );
+ }
+
+ inline static BF multExpr(const AvmCode::this_container_type & listOfArg)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::multExpr( listOfArg ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // POW EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static BF powExpr(const BF & arg0, const BF & arg1)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::powExpr( arg0, arg1 ) );
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DIV EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static BF divExpr(const BF & arg0, const BF & arg1)
+ {
+ return( ExpressionConstructorImpl<
+ DEFAULT_EXPRESSION_IMPL >::divExpr( arg0, arg1 ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FOR ALL EXPRESSION IMPLEMENTATION
+ ////////////////////////////////////////////////////////////////////////////
+
+ static BF newExpr(Operator * anOperator, const BF & arg);
+
+ static BF newExpr(Operator * anOperator, const BF & arg1, const BF & arg2);
+
+ static BF newExpr(Operator * anOperator,
+ const AvmCode::this_container_type & listOfArg);
+
+};
+
+
+}
+
+#endif /* EXPRESSIONCONSTRUCTOR_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/expression/ExpressionConstructorImpl.cpp b/org.eclipse.efm.symbex/src/fml/expression/ExpressionConstructorImpl.cpp
new file mode 100644
index 0000000..03552d5
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/ExpressionConstructorImpl.cpp
@@ -0,0 +1,1492 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 juin 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ExpressionConstructorImpl.h"
+
+#include <fml/expression/ExpressionConstant.h>
+#include <fml/expression/ExpressionConstructor.h>
+
+#include <fml/numeric/Numeric.h>
+
+
+namespace sep
+{
+
+/**
+ * SPECIFIC AVMCODE EXPRESSION
+ */
+static bool appendLogicTerm(const BF & term,
+ AvmCode::this_container_type & resArgs)
+{
+ if( resArgs.empty() )
+ {
+ resArgs.append( term );
+ }
+ else
+ {
+ AvmCode * aCode;
+
+ int cmpResult;
+
+ bool coef1;
+ BF expr1;
+
+ bool coef2 = true;
+ BF expr2 = term;
+ if( term.is< AvmCode >() )
+ {
+ aCode = term.to_ptr< AvmCode >();
+
+ if( aCode->isOpCode(AVM_OPCODE_NOT) )
+ {
+ coef2 = false;
+ expr2 = aCode->first();
+ }
+ }
+
+ AvmCode::iterator itArg = resArgs.begin();
+ AvmCode::iterator endArg = resArgs.end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ //case A * (<sign> B) + C + ... with (<sign> B)
+ coef1 = true;
+ expr1 = (*itArg);
+ if( (*itArg).is< AvmCode >() )
+ {
+ aCode = (*itArg).to_ptr< AvmCode >();
+
+ if( aCode->isOpCode(AVM_OPCODE_NOT) )
+ {
+ coef1 = false;
+ expr1 = aCode->first();
+ }
+ }
+
+ if( (cmpResult = expr1.compare( expr2 )) == 0 )
+ {
+ return( coef1 == coef2 );
+ }
+ else if( cmpResult > 0 )
+ {
+ resArgs.insert(itArg, term);
+
+ return( true );
+ }
+ }
+
+ resArgs.append( term );
+ }
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AND EXPRESSION
+////////////////////////////////////////////////////////////////////////////////
+
+inline static bool andFlatExpr(const BF & term,
+ AvmCode::this_container_type & resArgs)
+{
+ if( term.is< AvmCode >() )
+ {
+ AvmCode * argCode = term.to_ptr< AvmCode >();
+
+ if( term.to_ptr< AvmCode >()->isOpCode(AVM_OPCODE_AND) )
+ {
+ AvmCode::const_iterator itArg = argCode->begin();
+ AvmCode::const_iterator endArg = argCode->end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ if( (*itArg).isEqualTrue() )
+ {
+ //continue;
+ }
+ else if( (*itArg).isEqualFalse() )
+ {
+ return( false );
+ }
+ else if( not appendLogicTerm(*itArg, resArgs) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+ else
+ {
+ return( appendLogicTerm(term, resArgs) );
+ }
+ }
+ else
+ {
+ return( appendLogicTerm(term, resArgs) );
+ }
+}
+
+
+BF ExpressionConstructorNative::andExpr(const BF & arg0, const BF & arg1)
+{
+ if( arg0.isEqualFalse() || arg1.isEqualFalse() )
+ {
+ return( ExpressionConstant::BOOLEAN_FALSE );
+ }
+ else if( arg0.isEqualTrue() )
+ {
+ return( arg1 );
+ }
+ else if( arg1.isEqualTrue() )
+ {
+ return( arg0 );
+ }
+
+ else
+ {
+ BFCode resCode( OperatorManager::OPERATOR_AND );
+
+ if( andFlatExpr(arg0, resCode->getArgs()) )
+ {
+ if( andFlatExpr(arg1, resCode->getArgs()) )
+ {
+ if( resCode->empty() )
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+ else
+ {
+ return( resCode->singleton() ? resCode->first() : resCode );
+ }
+ }
+ }
+
+ return( ExpressionConstant::BOOLEAN_FALSE );
+ }
+}
+
+
+BF ExpressionConstructorNative::andExpr(
+ const AvmCode::this_container_type & listOfArg)
+{
+ if( listOfArg.nonempty() )
+ {
+ BFCode resCode( OperatorManager::OPERATOR_AND );
+
+ AvmCode::const_iterator itArg = listOfArg.begin();
+ AvmCode::const_iterator endArg = listOfArg.end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ if( (*itArg).isEqualTrue() )
+ {
+ //continue;
+ }
+ else if( (*itArg).isEqualFalse() )
+ {
+ return( ExpressionConstant::BOOLEAN_FALSE );
+ }
+ else if( not andFlatExpr(*itArg, resCode->getArgs()) )
+ {
+ return( ExpressionConstant::BOOLEAN_FALSE );
+ }
+ }
+
+ if( resCode->empty() )
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+ else
+ {
+ return( resCode->singleton() ? resCode->first() : resCode );
+ }
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ExpressionConstructorNative::andExpr(...) "
+ "with an empty argument list"
+ << SEND_EXIT;
+
+ return( ExpressionConstant::BOOLEAN_FALSE );
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// OR EXPRESSION
+////////////////////////////////////////////////////////////////////////////////
+
+inline static bool orFlatExpr(const BF & term,
+ AvmCode::this_container_type & resArgs)
+{
+ if( term.is< AvmCode >() )
+ {
+ AvmCode * argCode = term.to_ptr< AvmCode >();
+
+ if( term.to_ptr< AvmCode >()->isOpCode(AVM_OPCODE_OR) )
+ {
+ AvmCode::const_iterator itArg = argCode->begin();
+ AvmCode::const_iterator endArg = argCode->end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ if( (*itArg).isEqualTrue() )
+ {
+ return( false );
+ }
+ else if( (*itArg).isEqualFalse() )
+ {
+ //continue;
+ }
+ else if( not appendLogicTerm(*itArg, resArgs) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+ else
+ {
+ return( appendLogicTerm(term, resArgs) );
+ }
+ }
+ else
+ {
+ return( appendLogicTerm(term, resArgs) );
+ }
+}
+
+
+BF ExpressionConstructorNative::orExpr(const BF & arg0, const BF & arg1)
+{
+ if( arg0.isEqualTrue() || arg1.isEqualTrue() )
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+ else if( arg0.isEqualFalse() )
+ {
+ return( arg1 );
+ }
+ else if( arg1.isEqualFalse() )
+ {
+ return( arg0 );
+ }
+
+ else
+ {
+ BFCode resCode( OperatorManager::OPERATOR_OR );
+
+ if( orFlatExpr(arg0, resCode->getArgs()) )
+ {
+ if( orFlatExpr(arg1, resCode->getArgs()) )
+ {
+ if( resCode->empty() )
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+ else
+ {
+ return( resCode->singleton() ? resCode->first() : resCode );
+ }
+ }
+ }
+
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+}
+
+
+BF ExpressionConstructorNative::orExpr(
+ const AvmCode::this_container_type & listOfArg)
+{
+ if( listOfArg.nonempty() )
+ {
+ BFCode resCode( OperatorManager::OPERATOR_OR );
+
+ AvmCode::const_iterator itArg = listOfArg.begin();
+ AvmCode::const_iterator endArg = listOfArg.end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ if( (*itArg).isEqualTrue() )
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+ else if( (*itArg).isEqualFalse() )
+ {
+ //continue;
+ }
+ else if( not orFlatExpr(*itArg, resCode->getArgs()) )
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+ }
+
+ if( resCode->empty() )
+ {
+ return( ExpressionConstant::BOOLEAN_FALSE);
+ }
+ else
+ {
+ return( resCode->singleton() ? resCode->first() : resCode );
+ }
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected ExpressionConstructorNative::orExpr(...) "
+ "with an empty argument list"
+ << SEND_EXIT;
+
+ return( ExpressionConstant::BOOLEAN_FALSE);
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////
+// QUANTIFIER EXPRESSION
+////////////////////////////////////////////////////////////////////////////////////
+
+BF ExpressionConstructorNative::existExpr(
+ const BF & boundVar, const BF & formula)
+{
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_EXIST, boundVar, formula) );
+}
+
+BF ExpressionConstructorNative::existExpr(
+ const AvmCode::this_container_type & listOfArg)
+{
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_EXIST, listOfArg) );
+}
+
+
+BF ExpressionConstructorNative::forallExpr(
+ const BF & boundVar, const BF & formula)
+{
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_FORALL, boundVar, formula) );
+}
+
+BF ExpressionConstructorNative::forallExpr(
+ const AvmCode::this_container_type & listOfArg)
+{
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_FORALL, listOfArg) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////
+// NOT EXPRESSION
+////////////////////////////////////////////////////////////////////////////////////
+
+BF ExpressionConstructorNative::notExpr(const BF & arg)
+{
+ if( arg.isEqualTrue() )
+ {
+ return( ExpressionConstant::BOOLEAN_FALSE );
+ }
+ else if( arg.isEqualFalse() )
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+ else if( arg.is< AvmCode >() )
+ {
+ AvmCode * aCode = arg.to_ptr< AvmCode >();
+
+ switch( aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_EQ:
+ {
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_NEQ, aCode->getArgs()) );
+ }
+ case AVM_OPCODE_NEQ:
+ {
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_EQ, aCode->getArgs()) );
+ }
+
+ case AVM_OPCODE_SEQ:
+ {
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_NSEQ, aCode->getArgs()) );
+ }
+ case AVM_OPCODE_NSEQ:
+ {
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_SEQ, aCode->getArgs()) );
+ }
+
+ case AVM_OPCODE_LT:
+ {
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_GTE, aCode->getArgs()) );
+ }
+ case AVM_OPCODE_LTE:
+ {
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_GT, aCode->getArgs()) );
+ }
+ case AVM_OPCODE_GT:
+ {
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_LTE, aCode->getArgs()) );
+ }
+ case AVM_OPCODE_GTE:
+ {
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_LT, aCode->getArgs()) );
+ }
+
+ case AVM_OPCODE_NOT:
+ {
+ return( aCode->first() );
+ }
+
+ case AVM_OPCODE_AND:
+ {
+ BFCode resCode( OperatorManager::OPERATOR_OR );
+
+ AvmCode::const_iterator itArg = aCode->begin();
+ AvmCode::const_iterator endArg = aCode->end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ resCode->append( notExpr( *itArg ) );
+ }
+
+ return( resCode );
+ }
+ case AVM_OPCODE_NAND:
+ {
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_AND, aCode->getArgs()) );
+ }
+
+// case AVM_OPCODE_XAND:
+// {
+// return( ExpressionConstructor::newCode(
+// OperatorManager::OPERATOR_OR, aCode->getArgs()) );
+// }
+
+ case AVM_OPCODE_OR:
+ {
+ BFCode resCode( OperatorManager::OPERATOR_AND );
+
+ AvmCode::const_iterator itArg = aCode->begin();
+ AvmCode::const_iterator endArg = aCode->end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ resCode->append( notExpr( *itArg ) );
+ }
+
+ return( resCode );
+ }
+ case AVM_OPCODE_NOR:
+ {
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_OR, aCode->getArgs()) );
+ }
+
+ case AVM_OPCODE_XOR:
+ {
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_XNOR, aCode->getArgs()) );
+ }
+ case AVM_OPCODE_XNOR:
+ {
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_XOR, aCode->getArgs()) );
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+ }
+
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_NOT, arg) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////
+// COMPARE EXPRESSION
+////////////////////////////////////////////////////////////////////////////////////
+
+template< typename OP_T > BF compare(
+ const BF & lhArg, const BF & rhArg, Operator * cmpOp, OP_T cmp)
+{
+ //case X rel_op Y ==> diff := X - Y
+ BF diff = ExpressionConstructorNative::minusExpr(lhArg, rhArg);
+
+ //case diff = <num>
+ if( diff.is< Number >() )
+ {
+ return( ExpressionConstructorNative::newBoolean(
+ cmp(diff.to_ptr< Number >()->sign(), 0) ) );
+ }
+
+ //case diff = <term>
+ else if( diff.is< AvmCode >() )
+ {
+ AvmCode * diffCode = diff.to_ptr< AvmCode >();
+
+ //case diff = A + B + ...
+ if( diffCode->isOpCode(AVM_OPCODE_PLUS) )
+ {
+ BFCode lhCode( OperatorManager::OPERATOR_PLUS );
+ BFCode rhCode( OperatorManager::OPERATOR_PLUS );
+
+ AvmCode::const_iterator itArg = diffCode->begin();
+ AvmCode::const_iterator endArg = diffCode->end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ //case diff = A + B + ... + <num>
+ if( (*itArg).is< Number >() )
+ {
+ rhCode->append( ExpressionConstructorNative::
+ uminusExpr( *itArg ) );
+ }
+
+ else if( (*itArg).is< AvmCode >() )
+ {
+ AvmCode * argCode = (*itArg).to_ptr< AvmCode >();
+
+ //case diff = (- A) + B + C +...
+ if( argCode->isOpCode(AVM_OPCODE_UMINUS) )
+ {
+ rhCode->append( argCode->first() );
+ }
+ //case diff = (- <num> * X * Y * ...) + A + B + ...
+ else if( argCode->isOpCode(AVM_OPCODE_MULT)
+ && argCode->first().is< Number >()
+ && argCode->first().to_ptr<
+ Number >()->strictlyNegative() )
+ {
+ rhCode->append( ExpressionConstructorNative::
+ uminusExpr( *itArg ) );
+ }
+ else
+ {
+ lhCode->append( *itArg );
+ }
+ }
+ else
+ {
+ lhCode->append( *itArg );
+ }
+ }
+
+ BFCode cmpCode( cmpOp );
+
+ if( lhCode->singleton() )
+ {
+ cmpCode->append( lhCode->first() );
+ }
+ else if( lhCode->populated() )
+ {
+ cmpCode->append( lhCode );
+ }
+ else
+ {
+ cmpCode->append( ExpressionConstant::INTEGER_ZERO );
+ }
+
+ if( rhCode->singleton() )
+ {
+ cmpCode->append( rhCode->first() );
+ }
+ else if( rhCode->populated() )
+ {
+ cmpCode->append( rhCode );
+ }
+ else
+ {
+ cmpCode->append( ExpressionConstant::INTEGER_ZERO );
+ }
+
+ return( cmpCode );
+ }
+ }
+
+ return( ExpressionConstructor::newCode(cmpOp, diff,
+ ExpressionConstant::INTEGER_ZERO) );
+}
+
+
+BF ExpressionConstructorNative::eqExpr(const BF & arg0, const BF & arg1)
+{
+ return( compare(arg0, arg1,
+ OperatorManager::OPERATOR_EQ, std::equal_to<int>()) );
+}
+
+BF ExpressionConstructorNative::neqExpr(const BF & arg0, const BF & arg1)
+{
+ return( compare(arg0, arg1,
+ OperatorManager::OPERATOR_NEQ, std::not_equal_to<int>()) );
+}
+
+
+BF ExpressionConstructorNative::gtExpr(const BF & arg0, const BF & arg1)
+{
+ return( compare(arg0, arg1,
+ OperatorManager::OPERATOR_GT, std::greater<int>()) );
+}
+
+
+BF ExpressionConstructorNative::gteExpr(const BF & arg0, const BF & arg1)
+{
+ return( compare(arg0, arg1,
+ OperatorManager::OPERATOR_GTE, std::greater_equal<int>()) );
+}
+
+BF ExpressionConstructorNative::ltExpr(const BF & arg0, const BF & arg1)
+{
+ return( compare(arg0, arg1,
+ OperatorManager::OPERATOR_LT, std::less<int>()) );
+}
+
+BF ExpressionConstructorNative::lteExpr(const BF & arg0, const BF & arg1)
+{
+ return( compare(arg0, arg1,
+ OperatorManager::OPERATOR_LTE, std::less_equal<int>()) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// ADD EXPRESSION
+// Normalization : <term> + <term> + ... + <num>
+////////////////////////////////////////////////////////////////////////////////
+
+BF ExpressionConstructorNative::addNumber(const BF & num0, const BF & num1)
+{
+ if( num0.is< Number >() )
+ {
+ if( num0.to_ptr< Number >()->isZero() )
+ {
+ return( num1 );
+ }
+ else if( num1.is< Number >() )
+ {
+ if( num1.to_ptr< Number >()->isZero() )
+ {
+ return( num0 );
+ }
+
+ return( ExpressionConstructor::newNumeric(
+ Numeric::acquire( num0.to_ptr< Number >() ).add(
+ Numeric::acquire( num1.to_ptr< Number >() ) ) ) );
+ }
+
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_PLUS, num1, num0) );
+ }
+ else if( num1.is< Number >() )
+ {
+ if( num1.to_ptr< Number >()->isZero() )
+ {
+ return( num0 );
+ }
+ }
+
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_PLUS, num0, num1) );
+}
+
+
+static void addExpr(const BF & term,
+ AvmCode::this_container_type & resArgs, Numeric & resNumberArg)
+{
+ if( term.is< Number >() )
+ {
+ resNumberArg += term;
+ }
+ else if( resArgs.empty() )
+ {
+ resArgs.append( term );
+ }
+ else
+ {
+ AvmCode * aCode;
+
+ Numeric coef_sum;
+
+ int cmpResult;
+
+ Numeric coef1;
+ BF expr1;
+
+ Numeric coef2 = ExpressionConstant::INTEGER_ONE;
+ BF expr2 = term;
+ if( term.is< AvmCode >() )
+ {
+ aCode = term.to_ptr< AvmCode >();
+
+ if( aCode->isOpCode(AVM_OPCODE_MULT)
+ && aCode->first().is< Number >() )
+ {
+ coef2 = aCode->first();
+ if( aCode->size() == 2 )
+ {
+ expr2 = aCode->second();
+ }
+ else
+ {
+ expr2 = ExpressionConstructor::newCodeTail(
+ OperatorManager::OPERATOR_MULT, aCode->getArgs());
+ }
+ }
+ else if( aCode->isOpCode(AVM_OPCODE_UMINUS) )
+ {
+ coef2 = ExpressionConstant::INTEGER_MINUS_ONE;
+ expr2 = aCode->first();
+ }
+ }
+
+ AvmCode::iterator itArg = resArgs.begin();
+ AvmCode::iterator endArg = resArgs.end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ //case A + (<num>*B) + C + ... with <num> * B
+ coef1 = ExpressionConstant::INTEGER_ONE;
+ expr1 = (*itArg);
+ if( (*itArg).is< AvmCode >() )
+ {
+ aCode = (*itArg).to_ptr< AvmCode >();
+
+ if( aCode->isOpCode(AVM_OPCODE_MULT)
+ && aCode->first().is< Number >() )
+ {
+ coef1 = aCode->first();
+ if( aCode->size() == 2 )
+ {
+ expr1 = aCode->second();
+ }
+ else
+ {
+ expr1 = ExpressionConstructor::newCodeTail(
+ OperatorManager::OPERATOR_MULT, aCode->getArgs());
+ }
+ }
+ else if( aCode->isOpCode(AVM_OPCODE_UMINUS) )
+ {
+ coef1 = ExpressionConstant::INTEGER_MINUS_ONE;
+ expr1 = aCode->first();
+ }
+ }
+
+ //==> A + (<num> + <num>)*B + C + ...
+ if( (cmpResult = expr1.compare( expr2 )) == 0 )
+ {
+ coef_sum = ExpressionConstructorNative::addNumber(coef1, coef2);
+ if( coef_sum.isZero() )
+ {
+ itArg = resArgs.erase( itArg );
+ }
+ else
+ {
+ (*itArg) = ExpressionConstructorNative::multExpr(
+ coef_sum, expr1);
+ }
+
+ return;
+ }
+ else if( cmpResult > 0 )
+ {
+ resArgs.insert(itArg, term);
+
+ return;
+ }
+ }
+
+ resArgs.append( term );
+ }
+}
+
+
+inline static void addFlatExpr(const BF & term,
+ AvmCode::this_container_type & resArgs, Numeric & resNumberArg)
+{
+ if( term.is< AvmCode >() )
+ {
+ AvmCode * argCode = term.to_ptr< AvmCode >();
+
+ if(term.to_ptr< AvmCode >()->isOpCode(AVM_OPCODE_PLUS) )
+ {
+ AvmCode::const_iterator itArg = argCode->begin();
+ AvmCode::const_iterator endArg = argCode->end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ addExpr(*itArg, resArgs, resNumberArg);
+ }
+ }
+ else
+ {
+ addExpr(term, resArgs, resNumberArg);
+ }
+ }
+ else
+ {
+ addExpr(term, resArgs, resNumberArg);
+ }
+}
+
+
+BF ExpressionConstructorNative::addExpr(const BF & arg0, const BF & arg1)
+{
+ if( arg0.isEqualZero() )
+ {
+ return( arg1 );
+ }
+ else if( arg1.isEqualZero() )
+ {
+ return( arg0 );
+ }
+ else if( arg0.is< Number >() && arg1.is< Number >() )
+ {
+ return( addNumber(arg0, arg1) );
+ }
+ else
+ {
+ BFCode resCode( OperatorManager::OPERATOR_PLUS );
+
+ Numeric numTerm = ExpressionConstant::INTEGER_ZERO;
+
+ addFlatExpr(arg0, resCode->getArgs(), numTerm);
+
+ addFlatExpr(arg1, resCode->getArgs(), numTerm);
+
+ if( resCode->empty() )
+ {
+ return( numTerm );
+ }
+ else if( not numTerm.isZero() )
+ {
+ resCode->append( numTerm );
+ }
+
+ return( resCode->singleton() ? resCode->first() : resCode );
+ }
+}
+
+
+BF ExpressionConstructorNative::addExpr(
+ const AvmCode::this_container_type & listOfArg)
+{
+ BFCode resCode( OperatorManager::OPERATOR_PLUS );
+
+ Numeric numTerm = ExpressionConstant::INTEGER_ZERO;
+
+ AvmCode::const_iterator itArg = listOfArg.begin();
+ AvmCode::const_iterator endArg = listOfArg.end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ addFlatExpr(*itArg, resCode->getArgs(), numTerm);
+ }
+
+ if( resCode->empty() )
+ {
+ return( numTerm );
+ }
+ else if( not numTerm.isZero() )
+ {
+ resCode->append( numTerm );
+ }
+
+ return( resCode->singleton() ? resCode->first() : resCode );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// MINUS EXPRESSION
+////////////////////////////////////////////////////////////////////////////////
+
+BF ExpressionConstructorNative::minusExpr(const BF & arg0, const BF & arg1)
+{
+ return( addExpr(arg0, uminusExpr(arg1)) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// UMINUS EXPRESSION
+////////////////////////////////////////////////////////////////////////////////
+
+BF ExpressionConstructorNative::uminusExpr(const BF & arg)
+{
+// switch( arg.classKind() )
+// {
+// //case - <integer>
+// case FORM_BUILTIN_INTEGER_KIND:
+// {
+// BF res = arg;
+// res.makeWritable();
+// res.to_ptr< Integer >()->uminus();
+//
+// return( res );
+// }
+//
+// //case - <rational>
+// case FORM_BUILTIN_RATIONAL_KIND:
+// {
+// BF res = arg;
+// res.makeWritable();
+// res.to_ptr< Rational >()->uminus();
+//
+// return( res );
+// }
+//
+// //case - <float>
+// case FORM_BUILTIN_FLOAT_KIND:
+// {
+// BF res = arg;
+// res.makeWritable();
+// res.to_ptr< Float >()->uminus();
+//
+// return( res );
+// }
+//
+// default:
+// {
+// break;
+// }
+// }
+
+
+ if( arg.is< Number >() )
+ {
+ return( ExpressionConstructor::newNumeric(
+ Numeric::acquire( arg.to_ptr< Number >() ).uminus() ) );
+ }
+
+ //case - <term>
+ else if( arg.is< AvmCode >() )
+ {
+ AvmCode * aCode = arg.to_ptr< AvmCode >();
+
+ switch( aCode->getAvmOpCode() )
+ {
+ //case - (A + B + ...)
+ case AVM_OPCODE_PLUS:
+ {
+ BFCode resCode( OperatorManager::OPERATOR_PLUS );
+
+ AvmCode::const_iterator itArg = aCode->begin();
+ AvmCode::const_iterator endArg = aCode->end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ resCode->append( uminusExpr( *itArg ) );
+ }
+
+ return( resCode );
+ }
+
+ //case - (A - B - ...)
+ case AVM_OPCODE_MINUS:
+ {
+ AvmCode::const_iterator itArg = aCode->begin();
+
+ BFCode resCode( OperatorManager::OPERATOR_PLUS,
+ uminusExpr( *itArg ) );
+
+ AvmCode::const_iterator endArg = aCode->end();
+ for( ++itArg ; itArg != endArg ; ++itArg )
+ {
+ resCode->append( *itArg );
+ }
+
+ return( resCode );
+ }
+
+ //case - (- <term>)
+ case AVM_OPCODE_UMINUS:
+ {
+ return( aCode->first() );
+ }
+
+ //case - (A * B * ...)
+ case AVM_OPCODE_MULT:
+ {
+ //case +- (<num> * A * B * ...)
+ if( aCode->first().is< Number >() )
+ {
+ AvmCode::const_iterator itArg = aCode->begin();
+
+ BFCode resCode( OperatorManager::OPERATOR_MULT );
+
+ if( not (*itArg).to_ptr< Number >()->isNegativeOne() )
+ {
+ resCode->append( uminusExpr( *itArg ) );
+ }
+
+ AvmCode::const_iterator endArg = aCode->end();
+ for( ++itArg ; itArg != endArg ; ++itArg )
+ {
+ resCode->append( *itArg );
+ }
+
+ //==> (- <num>) * A * B * ...
+ return( resCode );
+ }
+
+ //==> (- 1) * A * B * ...
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_MULT ,
+ ExpressionConstant::INTEGER_MINUS_ONE,
+ aCode->getArgs()) );
+ }
+
+ //case - (A / B )
+ case AVM_OPCODE_DIV:
+ {
+ //==> ((- 1) * A) / B
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_DIV ,
+ uminusExpr( aCode->first() ), aCode->second()) );
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+ }
+
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_UMINUS, arg) );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// MULT EXPRESSION
+// Normalization : <num> * <term> * <term> * ...
+////////////////////////////////////////////////////////////////////////////////
+
+static bool multExpr(const BF & term,
+ AvmCode::this_container_type & resMultArgs,
+ Numeric & resNumberCoef, bool & expandAddExpr)
+{
+ if( resNumberCoef.isZero() )
+ {
+ return( false );
+ }
+ else if( term.is< Number >() )
+ {
+ if( term.to_ptr< Number >()->isZero() )
+ {
+ resNumberCoef = ExpressionConstant::INTEGER_ZERO;
+
+ return( false );
+ }
+ else
+ {
+ resNumberCoef *= term;
+ }
+ }
+ else if( resMultArgs.empty() )
+ {
+ if( term.is< AvmCode >() &&
+ term.to_ptr< AvmCode >()->isOpCode(AVM_OPCODE_PLUS) )
+ {
+ resMultArgs.append( term.to_ptr< AvmCode >()->getArgs() );
+
+ expandAddExpr = true;
+ }
+ else
+ {
+ resMultArgs.append( term );
+ }
+ }
+ else if( expandAddExpr )
+ {
+ AvmCode::this_container_type resAddArgs( resMultArgs );
+ resMultArgs.clear();
+
+ Numeric numTerm = ExpressionConstant::INTEGER_ZERO;
+
+ AvmCode::const_iterator itArg = resAddArgs.begin();
+ AvmCode::const_iterator endArg = resAddArgs.end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ addFlatExpr(ExpressionConstructorNative::multExpr(term, *itArg),
+ resMultArgs, numTerm);
+ }
+
+ if( not numTerm.isZero() )
+ {
+ if( resMultArgs.empty() )
+ {
+ resMultArgs.append( numTerm );
+ }
+ }
+ }
+ else if( term.is< AvmCode >() &&
+ term.to_ptr< AvmCode >()->isOpCode(AVM_OPCODE_PLUS) )
+ {
+ BF multArg = resMultArgs.singleton() ? resMultArgs.first() :
+ ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_MULT, resMultArgs);
+
+ resMultArgs.clear();
+ Numeric numTerm = ExpressionConstant::INTEGER_ZERO;
+
+ AvmCode * aCode = term.to_ptr< AvmCode >();
+ AvmCode::const_iterator itArg = aCode->begin();
+ AvmCode::const_iterator endArg = aCode->end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ addFlatExpr(ExpressionConstructorNative::multExpr(multArg, *itArg),
+ resMultArgs, numTerm);
+ }
+
+ if( not numTerm.isZero() )
+ {
+ if( resMultArgs.empty() )
+ {
+ resMultArgs.append( numTerm );
+ }
+ }
+
+ expandAddExpr = true;
+ }
+
+ else
+ {
+ AvmCode * aCode;
+
+ Numeric coef_sum;
+
+ int cmpResult;
+
+ Numeric exponent1;
+ BF expr1;
+
+ Numeric exponent2 = ExpressionConstant::INTEGER_ONE;
+ BF expr2 = term;
+ if( term.is< AvmCode >() )
+ {
+ aCode = term.to_ptr< AvmCode >();
+
+ if( aCode->isOpCode(AVM_OPCODE_POW)
+ && aCode->second().is< Number >() )
+ {
+ expr2 = aCode->first();
+ exponent2 = aCode->second();
+ }
+ }
+
+ AvmCode::iterator itArg = resMultArgs.begin();
+ AvmCode::iterator endArg = resMultArgs.end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ //case A * (B^<num>) + C + ... with B ^ <num>
+ exponent1 = ExpressionConstant::INTEGER_ONE;
+ expr1 = (*itArg);
+ if( (*itArg).is< AvmCode >() )
+ {
+ aCode = (*itArg).to_ptr< AvmCode >();
+
+ if( aCode->isOpCode(AVM_OPCODE_POW)
+ && aCode->second().is< Number >() )
+ {
+ expr1 = aCode->first();
+ exponent1 = aCode->second();
+ }
+ }
+
+ if( (cmpResult = expr1.compare( expr2 )) == 0 )
+ {
+ coef_sum = ExpressionConstructorNative::
+ addNumber(exponent1, exponent2);
+ if( coef_sum.isZero() )
+ {
+ itArg = resMultArgs.erase( itArg );
+ }
+ else
+ {
+ //==> A + B^(<num> + <num>) + C + ...
+ (*itArg) = ExpressionConstructorNative::powExpr(
+ expr1, coef_sum );
+ }
+
+ return( true );
+ }
+ else if( cmpResult > 0 )
+ {
+ resMultArgs.insert(itArg, term);
+
+ return( true );
+ }
+ }
+
+ resMultArgs.append( term );
+ }
+
+ return( true );
+}
+
+
+inline static bool multFlatExpr(const BF & term,
+ AvmCode::this_container_type & resArgs,
+ Numeric & resNumberCoef, bool & expandAddExpr)
+{
+ if( term.is< AvmCode >() )
+ {
+ AvmCode * argCode = term.to_ptr< AvmCode >();
+
+ if( term.to_ptr< AvmCode >()->isOpCode(AVM_OPCODE_MULT) )
+ {
+ AvmCode::const_iterator itArg = argCode->begin();
+ AvmCode::const_iterator endArg = argCode->end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ if( (*itArg).isEqualZero() )
+ {
+ return( false );
+ }
+ else
+ {
+ multExpr(*itArg, resArgs, resNumberCoef, expandAddExpr);
+ }
+ }
+
+ return( true );
+ }
+ else if( argCode->isOpCode(AVM_OPCODE_UMINUS) )
+ {
+ //==> numTerm := (- numTerm)
+ resNumberCoef = ( - resNumberCoef );
+
+ //==> A * C * ... * <expr>
+ return( multExpr(argCode->first(), resArgs,
+ resNumberCoef, expandAddExpr) );
+ }
+ else
+ {
+ return( multExpr(term, resArgs, resNumberCoef, expandAddExpr) );
+ }
+ }
+ else
+ {
+ return( multExpr(term, resArgs, resNumberCoef, expandAddExpr) );
+ }
+}
+
+
+inline static BF multCoefExpr(const Numeric & numCoef,
+ BFCode & resCode, bool expandAddExpr)
+{
+ if( resCode->empty() || numCoef.isZero() )
+ {
+ return( numCoef );
+ }
+ else
+ {
+ if( expandAddExpr )
+ {
+ resCode->setOperator( OperatorManager::OPERATOR_PLUS );
+ }
+
+ if( numCoef.isOne() )
+ {
+ return( resCode->singleton() ? resCode->first() : resCode );
+ }
+
+ else if( expandAddExpr )
+ {
+ AvmCode::iterator itRes = resCode->begin();
+ AvmCode::iterator endRes = resCode->end();
+ for( ; itRes != endRes ; ++itRes )
+ {
+ (*itRes) = ExpressionConstructorNative::multExpr(numCoef, *itRes);
+ }
+
+ return( resCode );
+ }
+ else
+ {
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_MULT,
+ numCoef, resCode->getArgs()) );
+ }
+ }
+}
+
+
+BF ExpressionConstructorNative::multExpr(const BF & arg0, const BF & arg1)
+{
+ if( arg0.is< Number >() )
+ {
+ if( arg0.to_ptr< Number >()->isZero() )
+ {
+ return( ExpressionConstant::INTEGER_ZERO );
+ }
+ else if( arg0.to_ptr< Number >()->isOne() )
+ {
+ return( arg1 );
+ }
+
+ if( arg1.is< Number >() )
+ {
+ if( arg1.to_ptr< Number >()->isZero() )
+ {
+ return( ExpressionConstant::INTEGER_ZERO );
+ }
+ else if( arg1.to_ptr< Number >()->isOne() )
+ {
+ return( arg0 );
+ }
+
+ return( ExpressionConstructor::newNumeric(
+ Numeric::acquire( arg0.to_ptr< Number >() ).mult(
+ Numeric::acquire( arg1.to_ptr< Number >() ) ) ) );
+ }
+
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_MULT, arg0, arg1) );
+ }
+
+ else if( arg1.is< Number >() )
+ {
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_MULT, arg1, arg0) );
+ }
+
+ else
+ {
+ BFCode resCode( OperatorManager::OPERATOR_MULT );
+
+ Numeric numTerm = ExpressionConstant::INTEGER_ONE;
+ bool expandAddExpr = false;
+
+ if( multFlatExpr(arg0, resCode->getArgs(), numTerm, expandAddExpr) )
+ {
+ if( multFlatExpr(arg1, resCode->getArgs(), numTerm, expandAddExpr) )
+ {
+ return( multCoefExpr(numTerm, resCode, expandAddExpr) );
+ }
+ }
+
+ return( ExpressionConstant::INTEGER_ZERO );
+ }
+}
+
+
+BF ExpressionConstructorNative::multExpr(
+ const AvmCode::this_container_type & listOfArg)
+{
+ BFCode resCode( OperatorManager::OPERATOR_MULT );
+
+ Numeric numTerm = ExpressionConstant::INTEGER_ONE;
+ bool expandAddExpr = false;
+
+ AvmCode::const_iterator itArg = listOfArg.begin();
+ AvmCode::const_iterator endArg = listOfArg.end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ if( (*itArg).isEqualZero() )
+ {
+ return( ExpressionConstant::INTEGER_ZERO );
+ }
+ else if( not multFlatExpr(*itArg,
+ resCode->getArgs(), numTerm, expandAddExpr) )
+ {
+ return( ExpressionConstant::INTEGER_ZERO );
+ }
+ }
+
+ return( multCoefExpr(numTerm, resCode, expandAddExpr) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// POW EXPRESSION
+////////////////////////////////////////////////////////////////////////////////
+
+BF ExpressionConstructorNative::powExpr(const BF & arg0, const BF & arg1)
+{
+ if( arg1.is< Number >() )
+ {
+ if( arg1.to_ptr< Number >()->isZero() )
+ {
+ return( ExpressionConstant::INTEGER_ONE );
+ }
+ else if( arg1.to_ptr< Number >()->isOne() )
+ {
+ return( arg0 );
+ }
+
+ if( arg0.is< Number >() )
+ {
+ if( arg0.to_ptr< Number >()->isZero()
+ || arg0.to_ptr< Number >()->isOne() )
+ {
+ return( arg0 );
+ }
+ else if( arg1.to_ptr< Number >()->isUInteger() )
+ {
+ return( ExpressionConstructor::newNumeric(
+ Numeric::acquire( arg0.to_ptr< Number >() ).pow(
+ arg1.to_ptr< Number >()->toUInteger() ) ) );
+ }
+ }
+ }
+
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_POW, arg0, arg1) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// DIV EXPRESSION
+////////////////////////////////////////////////////////////////////////////////
+
+BF ExpressionConstructorNative::divExpr(const BF & arg0, const BF & arg1)
+{
+ if( arg1.is< Number >() )
+ {
+ if( arg1.to_ptr< Number >()->isZero() )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Division of " << arg0.str() << " by zero !!!"
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+ else if( arg1.to_ptr< Number >()->isOne() )
+ {
+ return( arg0 );
+ }
+ else if( arg0.is< Number >() )
+ {
+ if( arg0.to_ptr< Number >()->isZero() )
+ {
+ return( arg0 );
+ }
+
+ return( ExpressionConstructor::newNumeric(
+ Numeric::acquire( arg0.to_ptr< Number >() ).div(
+ Numeric::acquire( arg1.to_ptr< Number >() ) ) ) );
+ }
+ }
+
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_DIV, arg0, arg1) );
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/expression/ExpressionConstructorImpl.h b/org.eclipse.efm.symbex/src/fml/expression/ExpressionConstructorImpl.h
new file mode 100644
index 0000000..47d6254
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/ExpressionConstructorImpl.h
@@ -0,0 +1,696 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 juin 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef EXPRESSIONCONSTRUCTORIMPL_H_
+#define EXPRESSIONCONSTRUCTORIMPL_H_
+
+/**
+ * DEFINE MACRO W.R.T. LICENSE CONSTRAINT
+ */
+#if defined( _ECLIPSE_PUBLIC_LICENSE_ )
+
+#else
+
+#endif /* _ECLIPSE_PUBLIC_LICENSE_ */
+
+
+#include <fml/lib/AvmLang.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/AvmCodeFactory.h>
+#include <fml/builtin/Boolean.h>
+#include <fml/builtin/Character.h>
+#include <fml/numeric/Float.h>
+#include <fml/builtin/Identifier.h>
+#include <fml/numeric/Integer.h>
+#include <fml/numeric/Rational.h>
+#include <fml/builtin/String.h>
+#include <fml/builtin/QualifiedIdentifier.h>
+
+#include <fml/expression/ExpressionConstant.h>
+
+#include <cmath>
+#include <cstring>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// COMMON IMPLEMENTATION
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+template< class EpressionCtr >
+class CommonExpressionConstructorImpl
+{
+
+public:
+ inline static BF seqExpr(const BF & arg0, const BF & arg1)
+ {
+ return( EpressionCtr::newBoolean( arg0.isEQ(arg1) ) );
+ }
+
+ inline static BF nseqExpr(const BF & arg0, const BF & arg1)
+ {
+ return( EpressionCtr::newBoolean( arg0.isNEQ(arg1) ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // OPERATOR EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static BF newExpr(Operator * anOperator, const BF & arg)
+ {
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_AND:
+ case AVM_OPCODE_OR:
+ case AVM_OPCODE_PLUS:
+ case AVM_OPCODE_MULT:
+ case AVM_OPCODE_POW:
+ case AVM_OPCODE_DIV:
+ {
+ return( arg );
+ }
+
+ case AVM_OPCODE_NOT:
+ {
+ return( EpressionCtr::notExpr(arg) );
+ }
+
+ case AVM_OPCODE_UMINUS:
+ {
+ return( EpressionCtr::uminusExpr(arg) );
+ }
+
+ default:
+ {
+ return( AvmCodeFactory::newCode(anOperator, arg) );
+ }
+ }
+ }
+
+ inline static BF newExpr(
+ Operator * anOperator, const BF & arg1, const BF & arg2)
+ {
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_AND:
+ {
+ return( EpressionCtr::andExpr(arg1, arg2) );
+ }
+ case AVM_OPCODE_OR:
+ {
+ return( EpressionCtr::orExpr(arg1, arg2) );
+ }
+
+ case AVM_OPCODE_EXIST:
+ {
+ return( EpressionCtr::existExpr(arg1, arg2) );
+ }
+ case AVM_OPCODE_FORALL:
+ {
+ return( EpressionCtr::forallExpr(arg1, arg2) );
+ }
+
+ case AVM_OPCODE_EQ:
+ {
+ return( EpressionCtr::eqExpr(arg1, arg2) );
+ }
+ case AVM_OPCODE_NEQ:
+ {
+ return( EpressionCtr::neqExpr(arg1, arg2) );
+ }
+
+ case AVM_OPCODE_SEQ:
+ {
+ return( EpressionCtr::seqExpr(arg1, arg2) );
+ }
+ case AVM_OPCODE_NSEQ:
+ {
+ return( EpressionCtr::nseqExpr(arg1, arg2) );
+ }
+
+ case AVM_OPCODE_LT:
+ {
+ return( EpressionCtr::ltExpr(arg1, arg2) );
+ }
+ case AVM_OPCODE_LTE:
+ {
+ return( EpressionCtr::lteExpr(arg1, arg2) );
+ }
+ case AVM_OPCODE_GT:
+ {
+ return( EpressionCtr::gtExpr(arg1, arg2) );
+ }
+ case AVM_OPCODE_GTE:
+ {
+ return( EpressionCtr::gteExpr(arg1, arg2) );
+ }
+
+ case AVM_OPCODE_PLUS:
+ {
+ return( EpressionCtr::addExpr(arg1, arg2) );
+ }
+ case AVM_OPCODE_MINUS:
+ {
+ return( EpressionCtr::minusExpr(arg1, arg2) );
+ }
+
+ case AVM_OPCODE_MULT:
+ {
+ return( EpressionCtr::multExpr(arg1, arg2) );
+ }
+ case AVM_OPCODE_POW:
+ {
+ return( EpressionCtr::powExpr(arg1, arg2) );
+ }
+
+ case AVM_OPCODE_DIV:
+ {
+ return( EpressionCtr::divExpr(arg1, arg2) );
+ }
+
+ default:
+ {
+ return( AvmCodeFactory::newCode(anOperator, arg1, arg2) );
+ }
+ }
+ }
+
+
+ inline static BF newExpr(Operator * anOperator,
+ const AvmCode::this_container_type & listOfArg)
+ {
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_AND:
+ {
+ return( EpressionCtr::andExpr(listOfArg) );
+ }
+ case AVM_OPCODE_OR:
+ {
+ return( EpressionCtr::orExpr(listOfArg) );
+ }
+
+ case AVM_OPCODE_PLUS:
+ {
+ return( EpressionCtr::addExpr(listOfArg) );
+ }
+ case AVM_OPCODE_MULT:
+ {
+ return( EpressionCtr::multExpr(listOfArg) );
+ }
+
+ default:
+ {
+ return( AvmCodeFactory::newCode(anOperator, listOfArg) );
+ }
+ }
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // INCR / DECR EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static BF addExpr(const BF & arg, avm_integer_t val)
+ {
+ switch( arg.classKind() )
+ {
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ BF res = arg;
+ res.makeWritable();
+ res.to_ptr< Integer >()->addExpr(val);
+ return( res );
+ }
+
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ BF res = arg;
+ res.makeWritable();
+ res.to_ptr< Rational >()->addExpr(val);
+ return( res );
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ BF res = arg;
+ res.makeWritable();
+ res.to_ptr< Float >()->addExpr(val);
+ return( res );
+ }
+
+ default:
+ {
+ return( EpressionCtr::addExpr(arg,
+ EpressionCtr::newInteger(val)) );
+ }
+ }
+ }
+
+ inline static BF powExpr(const BF & arg, avm_uinteger_t val)
+ {
+ switch( arg.classKind() )
+ {
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ BF res = arg;
+ res.makeWritable();
+ res.to_ptr< Integer >()->set_pow(val);
+ return( res );
+ }
+
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ BF res = arg;
+ res.makeWritable();
+ res.to_ptr< Rational >()->set_pow(val);
+ return( res );
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ BF res = arg;
+ res.makeWritable();
+ res.to_ptr< Float >()->set_pow(val);
+ return( res );
+ }
+
+ default:
+ {
+ return( EpressionCtr::powExpr(arg,
+ EpressionCtr::newUInteger(val)) );
+ }
+ }
+ }
+
+};
+
+
+/**
+ * ExpressionConstructorImpl
+ * TRAITS
+ */
+template< EXPRESSION::IMPLEMENTATION_KIND expr_impl_kind >
+class ExpressionConstructorImpl;
+
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// NATIVE_IMPL
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class ExpressionConstructorNative :
+ public CommonExpressionConstructorImpl< ExpressionConstructorNative >
+{
+
+public:
+ /**
+ * PRIMITIVE EXPRESSION
+ */
+ inline static const BF & newBoolean(bool aValue = false)
+ {
+ return( ( aValue )
+ ? ExpressionConstant::BOOLEAN_TRUE
+ : ExpressionConstant::BOOLEAN_FALSE );
+ }
+
+ inline static BF newBoolean(const char * aValue)
+ {
+ return( ( ::strcasecmp("true", aValue) == 0 )
+ ? ExpressionConstant::BOOLEAN_TRUE
+ : ExpressionConstant::BOOLEAN_FALSE );
+ }
+
+ inline static BF newBoolean(const std::string & aValue)
+ {
+ return( ( ::strcasecmp("true", aValue.c_str()) == 0)
+ ? ExpressionConstant::BOOLEAN_TRUE
+ : ExpressionConstant::BOOLEAN_FALSE );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // NEW INTEGER VALUE
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static BF newInteger(avm_integer_t aValue)
+ {
+ switch( aValue )
+ {
+ case 0: return( ExpressionConstant::INTEGER_ZERO );
+
+ case 1: return( ExpressionConstant::INTEGER_ONE );
+ case 2: return( ExpressionConstant::INTEGER_TWO );
+
+ case -1: return( ExpressionConstant::INTEGER_MINUS_ONE );
+ case -2: return( ExpressionConstant::INTEGER_MINUS_TWO );
+
+ default: return( BF( new Integer(aValue) ) );
+ }
+ }
+
+ inline static BF newUInteger(avm_uinteger_t aValue)
+ {
+ switch( aValue )
+ {
+ case 0: return( ExpressionConstant::INTEGER_ZERO );
+
+ case 1: return( ExpressionConstant::INTEGER_ONE );
+ case 2: return( ExpressionConstant::INTEGER_TWO );
+
+ default: return( BF( new Integer(aValue) ) );
+ }
+ }
+
+ inline static BF newInteger(const std::string & aValue)
+ {
+ return( BF( new Integer(aValue) ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // NEW RATIONAL VALUE
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static BF newRational(avm_integer_t aNumer)
+ {
+ return( BF( new Rational(aNumer) ) );
+ }
+
+ inline static BF newURational(avm_uinteger_t aNumer)
+ {
+ return( BF( new Rational(aNumer) ) );
+ }
+
+ inline static BF newRational(avm_integer_t aNumer, avm_integer_t aDenom)
+ {
+ return( BF( new Rational(aNumer, aDenom) ) );
+ }
+
+ inline static BF newRational(avm_integer_t aNumer, avm_uinteger_t aDenom)
+ {
+ return( BF( new Rational(aNumer, aDenom) ) );
+ }
+
+ inline static BF newURational(avm_uinteger_t aNumer, avm_uinteger_t aDenom)
+ {
+ return( BF( new Rational(aNumer, aDenom) ) );
+ }
+
+ inline static BF newRational(const std::string & aValue)
+ {
+ std::string::size_type pos = aValue.find('/');
+ if( pos != std::string::npos )
+ {
+ return( BF( new Rational(
+ aValue.substr(0, pos), aValue.substr(pos+1)) ) );
+ }
+ else if( (pos = aValue.find('.')) != std::string::npos )
+ {
+ Integer aNumer( std::string(aValue).erase(pos, 1) );
+
+ Integer aDenom( 10 );
+ aDenom.set_pow( aValue.size() - (pos + 1) );
+
+ return( BF( new Rational(aNumer, aDenom) ) );
+ }
+ else
+ {
+ return( BF( new Rational(aValue, 1) ) );
+ }
+ }
+
+ inline static BF newRational(
+ const std::string & strNumer, const std::string & strDenom)
+ {
+ return( BF( new Rational(strNumer, strDenom) ) );
+ }
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // NEW FLOAT VALUE
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static BF newFloat(avm_integer_t aValue)
+ {
+ return( BF( new Float(static_cast< avm_float_t >(aValue)) ) );
+ }
+
+ inline static BF newUFloat(avm_uinteger_t aValue)
+ {
+ return( BF( new Float(static_cast< avm_float_t >(aValue)) ) );
+ }
+
+ inline static BF newFloat(avm_float_t aValue)
+ {
+ return( BF( new Float(aValue) ) );
+ }
+
+ inline static BF newFloat(const std::string & aValue)
+ {
+ return( BF( new Float(aValue) ) );
+ }
+
+
+ /**
+ * SPECIFIC NUMERIC EXPRESSION
+ */
+ inline static BF newExpr(bool aValue)
+ {
+ return( newBoolean(aValue) );
+ }
+
+
+ inline static BF newExpr(avm_integer_t aValue)
+ {
+ switch( aValue )
+ {
+ case 0: return( ExpressionConstant::INTEGER_ZERO );
+
+ case 1: return( ExpressionConstant::INTEGER_ONE );
+ case 2: return( ExpressionConstant::INTEGER_TWO );
+
+ case -1: return( ExpressionConstant::INTEGER_MINUS_ONE );
+ case -2: return( ExpressionConstant::INTEGER_MINUS_TWO );
+
+ default: return( BF( new Integer(aValue) ) );
+ }
+ }
+
+
+ inline static BF newExpr(avm_integer_t aNumer, avm_integer_t aDenom)
+ {
+ return( BF( new Rational(aNumer, aDenom) ) );
+ }
+
+ inline static BF newExpr(avm_integer_t aNumer, avm_uinteger_t aDenom)
+ {
+ return( BF( new Rational(aNumer, aDenom) ) );
+ }
+
+ inline static BF newExpr(avm_uinteger_t aNumer, avm_uinteger_t aDenom)
+ {
+ return( BF( new Rational(aNumer, aDenom) ) );
+ }
+
+ inline static BF newExpr(
+ const Integer & aNumer, const Integer & aDenom)
+ {
+ return( BF( new Rational(aNumer, aDenom) ) );
+ }
+
+
+ inline static BF newExpr(float aValue)
+ {
+ return( BF( new Float(aValue) ) );
+ }
+
+ inline static BF newExpr(double aValue)
+ {
+ return( BF( new Float(aValue) ) );
+ }
+
+
+ inline static BF newExprNumber(const std::string & aValue)
+ {
+ std::string::size_type pos = aValue.find('/');
+ if( pos != std::string::npos )
+ {
+ return( BF( new Rational(
+ aValue.substr(0, pos), aValue.substr(pos+1)) ) );
+ }
+ else if( (pos = aValue.find('.')) != std::string::npos )
+ {
+ Integer aNumer( std::string(aValue).erase(pos, 1) );
+
+ Integer aDenom( 10 );
+ aDenom.set_pow( aValue.size() - (pos + 1) );
+
+ return( BF( new Rational(aNumer, aDenom) ) );
+ }
+ else
+ {
+ return( BF( new Integer(aValue) ) );
+ }
+ }
+
+
+ /**
+ * SPECIFIC AVMCODE EXPRESSION
+ */
+
+ inline static BF newExpr(const BF & anElement)
+ {
+ return( anElement );
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // AND EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ static BF andExpr(const BF & arg0, const BF & arg1);
+
+ static BF andExpr(const AvmCode::this_container_type & listOfArg);
+
+ ////////////////////////////////////////////////////////////////////////////
+ // OR EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ static BF orExpr(const BF & arg0, const BF & arg1);
+
+ static BF orExpr(const AvmCode::this_container_type & listOfArg);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // QUANTIFIER EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ static BF existExpr(const BF & boundVar, const BF & formula);
+
+ static BF existExpr(const AvmCode::this_container_type & listOfArg);
+
+
+ static BF forallExpr(const BF & boundVar, const BF & formula);
+
+ static BF forallExpr(const AvmCode::this_container_type & listOfArg);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // NOT EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ static BF notExpr(const BF & arg);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // COMPARE EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ static BF eqExpr(const BF & arg0, const BF & arg1);
+
+ static BF neqExpr(const BF & arg0, const BF & arg1);
+
+ static BF gtExpr(const BF & arg0, const BF & arg1);
+
+ static BF gteExpr(const BF & arg0, const BF & arg1);
+
+ static BF ltExpr(const BF & arg0, const BF & arg1);
+
+ static BF lteExpr(const BF & arg0, const BF & arg1);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // ADD EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ static BF addNumber(const BF & num0, const BF & num1);
+
+ static BF addExpr(const BF & arg0, const BF & arg1);
+
+ static BF addExpr(const AvmCode::this_container_type & listOfArg);
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // MINUS EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ static BF minusExpr(const BF & arg0, const BF & arg1);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // UMINUS EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ static BF uminusExpr(const BF & arg);
+
+ ////////////////////////////////////////////////////////////////////////////
+ // MULT EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ static BF multExpr(const BF & arg0, const BF & arg1);
+
+ static BF multExpr(const AvmCode::this_container_type & listOfArg);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // POW EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ static BF powExpr(const BF & arg0, const BF & arg1);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DIV EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ static BF divExpr(const BF & arg0, const BF & arg1);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // OPERATOR EXPRESSION
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static BF newExpr(Operator * anOperator,
+ const AvmCode::this_container_type & listOfArg)
+ {
+ return( CommonExpressionConstructorImpl::newExpr(anOperator, listOfArg) );
+ }
+
+};
+
+
+template< >
+class ExpressionConstructorImpl< EXPRESSION::NATIVE_IMPL > :
+ public ExpressionConstructorNative
+{
+ /* NOTHING ELSE */
+};
+
+
+} /* namespace sep */
+#endif /* EXPRESSIONCONSTRUCTORIMPL_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/expression/ExpressionEval.cpp b/org.eclipse.efm.symbex/src/fml/expression/ExpressionEval.cpp
new file mode 100644
index 0000000..b47be7d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/ExpressionEval.cpp
@@ -0,0 +1,586 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 déc. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ExpressionEval.h"
+
+#include <fml/executable/ExecutableLib.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/ExpressionConstructor.h>
+
+#include <fml/operator/OperatorManager.h>
+
+
+namespace sep
+{
+
+
+BF ExpressionEval::value(const BFCode & aCode, bool destroy_arg)
+{
+ switch( aCode.getAvmOpCode() )
+ {
+ case AVM_OPCODE_RANDOM:
+ {
+ return( ExpressionEval::random(aCode->first()) );
+ }
+
+ case AVM_OPCODE_ABS:
+ {
+ return( ExpressionEval::abs(aCode->first()) );
+ }
+ case AVM_OPCODE_CEIL:
+ {
+ return( ExpressionEval::ceil(aCode->first()) );
+ }
+ case AVM_OPCODE_FLOOR:
+ {
+ return( ExpressionEval::floor(aCode->first()) );
+ }
+ case AVM_OPCODE_ROUND:
+ {
+ return( ExpressionEval::round(aCode->first()) );
+ }
+ case AVM_OPCODE_TRUNCATE:
+ {
+ return( ExpressionEval::truncate(aCode->first()) );
+ }
+
+
+ case AVM_OPCODE_MIN:
+ {
+ return( ExpressionEval::min(aCode) );
+ }
+ case AVM_OPCODE_MAX:
+ {
+ return( ExpressionEval::max(aCode) );
+ }
+
+
+ case AVM_OPCODE_MOD:
+ {
+ return( ExpressionEval::mod(aCode->first(),
+ aCode->second()) );
+ }
+
+ case AVM_OPCODE_SQRT:
+ {
+ return( ExpressionEval::sqrt(aCode->first()) );
+ }
+
+ case AVM_OPCODE_EXP:
+ {
+ return( ExpressionEval::exp(aCode->first()) );
+ }
+ case AVM_OPCODE_LN:
+ {
+ return( ExpressionEval::ln(aCode->first()) );
+ }
+ case AVM_OPCODE_LOG:
+ {
+ return( ExpressionEval::log(aCode->first()) );
+ }
+
+ case AVM_OPCODE_SIN:
+ {
+ return( ExpressionEval::sin(aCode->first()) );
+ }
+ case AVM_OPCODE_COS:
+ {
+ return( ExpressionEval::cos(aCode->first()) );
+ }
+ case AVM_OPCODE_TAN:
+ {
+ return( ExpressionEval::tan(aCode->first()) );
+ }
+
+ case AVM_OPCODE_SINH:
+ {
+ return( ExpressionEval::sinh(aCode->first()) );
+ }
+ case AVM_OPCODE_COSH:
+ {
+ return( ExpressionEval::cosh(aCode->first()) );
+ }
+ case AVM_OPCODE_TANH:
+ {
+ return( ExpressionEval::tanh(aCode->first()) );
+ }
+
+ case AVM_OPCODE_ASIN:
+ {
+ return( ExpressionEval::asin(aCode->first()) );
+ }
+ case AVM_OPCODE_ACOS:
+ {
+ return( ExpressionEval::acos(aCode->first()) );
+ }
+ case AVM_OPCODE_ATAN:
+ {
+ return( ExpressionEval::atan(aCode->first()) );
+ }
+ case AVM_OPCODE_ATAN2:
+ {
+ return( ExpressionEval::atan2(aCode->first(),
+ aCode->second()) );
+ }
+
+ case AVM_OPCODE_ASINH:
+ {
+ return( ExpressionEval::asinh(aCode->first()) );
+ }
+ case AVM_OPCODE_ACOSH:
+ {
+ return( ExpressionEval::acosh(aCode->first()) );
+ }
+ case AVM_OPCODE_ATANH:
+ {
+ return( ExpressionEval::atanh(aCode->first()) );
+ }
+
+
+ default:
+ {
+ return( aCode );
+ }
+ }
+}
+
+
+BF ExpressionEval::random(const BF & aCode)
+{
+ return( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_RANDOM, aCode) );
+}
+
+
+BF ExpressionEval::abs(const BF & aCode)
+{
+ return( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_ABS, aCode) );
+}
+
+
+BF ExpressionEval::ceil(const BF & aCode)
+{
+ if( aCode.isInteger() )
+ {
+ return( aCode );
+ }
+
+ return( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_CEIL, aCode) );
+}
+
+
+BF ExpressionEval::floor(const BF & aCode)
+{
+ if( aCode.isInteger() )
+ {
+ return( aCode );
+ }
+
+ return( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_FLOOR, aCode) );
+}
+
+
+BF ExpressionEval::round(const BF & aCode)
+{
+ if( aCode.isInteger() )
+ {
+ return( aCode );
+ }
+
+ return( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_ROUND, aCode) );
+}
+
+
+BF ExpressionEval::truncate(const BF & aCode)
+{
+ if( aCode.isInteger() )
+ {
+ return( aCode );
+ }
+
+ return( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_TRUNCATE, aCode) );
+}
+
+
+BF ExpressionEval::min(const BF & aCode1, const BF & aCode2)
+{
+ if( aCode1 == ExecutableLib::_INFINITY_ )
+ {
+ return( aCode2 );
+ }
+ else if( aCode2 == ExecutableLib::_INFINITY_ )
+ {
+ return( aCode1 );
+ }
+
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_MIN, aCode1, aCode2) );
+}
+
+
+BF ExpressionEval::max(const BF & aCode1, const BF & aCode2)
+{
+ if( aCode1 == ExecutableLib::_INFINITY_ )
+ {
+ return( aCode1 );
+ }
+ else if( aCode2 == ExecutableLib::_INFINITY_ )
+ {
+ return( aCode2 );
+ }
+
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_MAX, aCode1, aCode2) );
+}
+
+
+
+BF ExpressionEval::min(const BFCode & aCode)
+{
+ AvmCode::size_type argCount = aCode->size();
+
+ if( argCount > 2 )
+ {
+ BFList symbolicValue;
+ BF minValue;
+
+ AvmCode::iterator itArg = aCode->begin();
+ AvmCode::iterator endArg = aCode->end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ if ( (*itArg).isNumeric() )
+ {
+ minValue = (*itArg);
+
+ // NEXT
+ ++itArg;
+
+ break;
+ }
+ else if( (*itArg) != ExecutableLib::_INFINITY_ )
+ {
+ symbolicValue.add_union( (*itArg) );
+ }
+ }
+
+ for( ; itArg != endArg ; ++itArg )
+ {
+ if( (*itArg) == ExecutableLib::_INFINITY_ )
+ {
+// continue;
+ }
+
+ else if ( (*itArg).isNumeric() )
+ {
+ minValue = ExpressionEval::min(minValue, *itArg);
+ }
+ else
+ {
+ symbolicValue.add_union( (*itArg) );
+ }
+ }
+
+ if( symbolicValue.nonempty() )
+ {
+ BFCode newCode(OperatorManager::OPERATOR_MIN);
+ if( minValue.valid() )
+ {
+ newCode->append( minValue );
+ }
+ newCode->append( symbolicValue );
+
+ return( newCode );
+ }
+ else if( minValue.valid() )
+ {
+ return( minValue );
+ }
+ else if( aCode->nonempty() )
+ {
+ return( aCode->first() );
+ }
+ else
+ {
+ return( aCode );
+ }
+ }
+ else if( argCount == 2 )
+ {
+ return( ExpressionEval::min(aCode->first(), aCode->second()) );
+ }
+ else if( argCount == 1 )
+ {
+ return( aCode->first() );
+ }
+ else
+ {
+ return( aCode );
+ }
+}
+
+BF ExpressionEval::max(const BFCode & aCode)
+{
+ AvmCode::size_type argCount = aCode->size();
+
+ if( argCount > 2 )
+ {
+ BFList symbolicValue;
+ BF maxValue;
+
+ AvmCode::iterator itArg = aCode->begin();
+ AvmCode::iterator endArg = aCode->end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ if( (*itArg) == ExecutableLib::_INFINITY_ )
+ {
+ return( *itArg );
+ }
+
+ else if ( (*itArg).isNumeric() )
+ {
+ maxValue = (*itArg);
+
+ // NEXT
+ ++itArg;
+
+ break;
+ }
+ else
+ {
+ symbolicValue.add_union( (*itArg) );
+ }
+ }
+
+ for( ; itArg != endArg ; ++itArg )
+ {
+ if( (*itArg) == ExecutableLib::_INFINITY_ )
+ {
+ return( (*itArg) );
+ }
+
+ else if ( (*itArg).isNumeric() )
+ {
+ maxValue = ExpressionEval::max(maxValue, *itArg);
+ }
+ else
+ {
+ symbolicValue.add_union( (*itArg) );
+ }
+ }
+
+ if( symbolicValue.nonempty() )
+ {
+ BFCode newCode(OperatorManager::OPERATOR_MAX);
+ if( maxValue.valid() )
+ {
+ newCode->append( maxValue );
+ }
+ newCode->append( symbolicValue );
+
+ return( newCode );
+ }
+ else if( maxValue.valid() )
+ {
+ return( maxValue );
+ }
+ else if( aCode->nonempty() )
+ {
+ return( aCode->first() );
+ }
+ else
+ {
+ return( aCode );
+ }
+ }
+ else if( argCount == 2 )
+ {
+ return( ExpressionEval::max(aCode->first(), aCode->second()) );
+ }
+ else if( argCount == 1 )
+ {
+ return( aCode->first() );
+ }
+ else
+ {
+ return( aCode );
+ }
+}
+
+
+
+BF ExpressionEval::mod(const BF & aCode1, const BF & aCode2)
+{
+ return( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_MOD, aCode1, aCode2) );
+}
+
+
+
+
+BF ExpressionEval::sqrt(const BF & aCode)
+{
+ return( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_SQRT, aCode) );
+}
+
+
+BF ExpressionEval::exp(const BF & aCode)
+{
+ return( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_EXP, aCode) );
+}
+
+
+BF ExpressionEval::ln(const BF & aCode)
+{
+ switch( aCode.classKind() )
+ {
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ if( aCode.to_ptr< Integer >()->toInteger() > 0 )
+ {
+// return( ExpressionConstructor::newFloat(
+// ::ln(aCode.to_ptr< Integer >()->toInteger())) );
+ }
+ break;
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ if( aCode.toFloat() > 0 )
+ {
+// return( ExpressionConstructor::newFloat(
+// ::ln(aCode.toFloat())) );
+ }
+ break;
+ }
+
+
+ default:
+ {
+ break;
+ }
+ }
+
+ return( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_LN, aCode) );
+}
+
+
+BF ExpressionEval::log(const BF & aCode)
+{
+ return( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_LOG, aCode) );
+}
+
+
+
+
+BF ExpressionEval::sin(const BF & aCode)
+{
+ return( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_SIN, aCode) );
+}
+
+BF ExpressionEval::cos(const BF & aCode)
+{
+ return( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_COS, aCode) );
+}
+
+BF ExpressionEval::tan(const BF & aCode)
+{
+ return( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_TAN, aCode) );
+}
+
+
+
+
+
+BF ExpressionEval::sinh(const BF & aCode)
+{
+ return( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_SINH, aCode) );
+}
+
+BF ExpressionEval::cosh(const BF & aCode)
+{
+ return( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_COSH, aCode) );
+}
+
+BF ExpressionEval::tanh(const BF & aCode)
+{
+ return( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_TANH, aCode) );
+}
+
+
+
+BF ExpressionEval::asin(const BF & aCode)
+{
+ return( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_ASIN, aCode) );
+}
+
+BF ExpressionEval::acos(const BF & aCode)
+{
+ return( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_ACOS, aCode) );
+}
+
+BF ExpressionEval::atan(const BF & aCode)
+{
+ return( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_ATAN, aCode) );
+}
+
+
+BF ExpressionEval::atan2(const BF & aCode1, const BF & aCode2)
+{
+ return( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_ATAN2, aCode1, aCode2) );
+}
+
+
+
+BF ExpressionEval::asinh(const BF & aCode)
+{
+ return( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_ASINH, aCode) );
+}
+
+BF ExpressionEval::acosh(const BF & aCode)
+{
+ return( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_ACOSH, aCode) );
+}
+
+BF ExpressionEval::atanh(const BF & aCode)
+{
+ return( ExpressionConstructor::newExpr(
+ OperatorManager::OPERATOR_ATANH, aCode) );
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/expression/ExpressionEval.h b/org.eclipse.efm.symbex/src/fml/expression/ExpressionEval.h
new file mode 100644
index 0000000..362e40c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/ExpressionEval.h
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 déc. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef EXPRESSIONEVAL_H_
+#define EXPRESSIONEVAL_H_
+
+#include <common/BF.h>
+
+
+
+namespace sep
+{
+
+
+class AvmCode;
+
+
+
+class ExpressionEval
+{
+
+public:
+
+ static BF value(const BFCode & aCode, bool destroy_arg = true);
+
+
+ static BF random(const BF & aCode);
+
+ static BF abs(const BF & aCode);
+ static BF ceil(const BF & aCode);
+ static BF floor(const BF & aCode);
+ static BF round(const BF & aCode);
+ static BF truncate(const BF & aCode);
+
+
+ static BF min(const BF & frst, const BF & snd);
+ static BF max(const BF & frst, const BF & snd);
+
+ static BF min(const BFCode & aCode);
+ static BF max(const BFCode & aCode);
+
+
+ static BF mod(const BF & aCode1, const BF & aCode2);
+
+ static BF sqrt(const BF & aCode);
+
+ static BF exp(const BF & aCode);
+ static BF ln(const BF & aCode);
+ static BF log(const BF & aCode);
+
+ static BF sin(const BF & aCode);
+ static BF cos(const BF & aCode);
+ static BF tan(const BF & aCode);
+
+ static BF sinh(const BF & aCode);
+ static BF cosh(const BF & aCode);
+ static BF tanh(const BF & aCode);
+
+ static BF asin(const BF & aCode);
+ static BF acos(const BF & aCode);
+ static BF atan(const BF & aCode);
+ static BF atan2(const BF & aCode1, const BF & aCode2);
+
+ static BF asinh(const BF & aCode);
+ static BF acosh(const BF & aCode);
+ static BF atanh(const BF & aCode);
+
+
+
+};
+
+}
+
+#endif /* EXPRESSIONEVAL_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/expression/ExpressionFactory.cpp b/org.eclipse.efm.symbex/src/fml/expression/ExpressionFactory.cpp
new file mode 100644
index 0000000..3b89b7b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/ExpressionFactory.cpp
@@ -0,0 +1,1272 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 9 juil. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ExpressionFactory.h"
+
+#include <fml/builtin/Boolean.h>
+#include <fml/builtin/Character.h>
+#include <fml/builtin/Identifier.h>
+#include <fml/builtin/String.h>
+#include <fml/builtin/QualifiedIdentifier.h>
+
+#include <fml/numeric/Float.h>
+#include <fml/numeric/Integer.h>
+#include <fml/numeric/Rational.h>
+
+#include <fml/expression/ExpressionConstant.h>
+#include <fml/expression/ExpressionTypeChecker.h>
+#include <fml/expression/StatementConstructor.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/lib/AvmOperationFactory.h>
+
+
+namespace sep
+{
+
+
+/**
+ * LOADER
+ */
+void ExpressionFactory::load()
+{
+ ///////////////////////////////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////////////////////////////
+ // SPECIFIC EDEN IMPLEMENTATION or NOT
+ ///////////////////////////////////////////////////////////////////////////////////////////////
+
+ ExpressionConstant::load();
+
+ String::load();
+
+ OperatorManager::load();
+
+ AvmOperationFactory::load();
+}
+
+
+/**
+ * DISPOSER
+ */
+void ExpressionFactory::dispose()
+{
+ AvmOperationFactory::dispose();
+
+ OperatorManager::dispose();
+
+ String::dispose();
+
+ ExpressionConstant::dispose();
+}
+
+
+/**
+ * CONFIGURE
+ */
+bool ExpressionFactory::configure()
+{
+ return( true );
+}
+
+
+
+/**
+ * COMPARISON
+ * with TRUE & FALSE
+ */
+
+bool ExpressionFactory::isBoolean(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ //case CLASS_KIND_T( Boolean ):
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+bool ExpressionFactory::toBoolean(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ {
+ return( value.to_ptr< Boolean >()->getValue() );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+bool ExpressionFactory::isEqualFalse(const BF & value)
+{
+ switch ( value.classKind() )
+ {
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ {
+ return( value.to_ptr< Boolean >()->getValue() == false );
+ }
+
+ default :
+ {
+ return( false );
+ }
+ }
+}
+
+bool ExpressionFactory::isNotEqualFalse(const BF & value)
+{
+ switch ( value.classKind() )
+ {
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ {
+ return( value.to_ptr< Boolean >()->getValue() != false );
+ }
+
+ default :
+ {
+ return( true );
+ }
+ }
+}
+
+
+bool ExpressionFactory::isEqualTrue(const BF & value)
+{
+ switch ( value.classKind() )
+ {
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ {
+ return( value.to_ptr< Boolean >()->getValue() == true );
+ }
+
+ default :
+ {
+ return( false );
+ }
+ }
+}
+
+bool ExpressionFactory::isNotEqualTrue(const BF & value)
+{
+ switch ( value.classKind() )
+ {
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ {
+ return( value.to_ptr< Boolean >()->getValue() != true );
+ }
+
+ default :
+ {
+ return( true );
+ }
+ }
+}
+
+
+
+
+
+/**
+ * GETTER
+ * for simple or numeric kind
+ */
+
+bool ExpressionFactory::isNumber(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_INTEGER_KIND:
+ case FORM_BUILTIN_RATIONAL_KIND:
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+bool ExpressionFactory::isInt32(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ return( value.to_ptr< Integer >()->isInt32() );
+ }
+
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ return( value.to_ptr< Rational >()->isInt32() );
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ return( value.to_ptr< Float >()->isInt32() );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+avm_int32_t ExpressionFactory::toInt32(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ return( value.to_ptr< Integer >()->toInt32() );
+ }
+
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ return( value.to_ptr< Rational >()->toInt32() );
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ return( value.to_ptr< Float >()->toInt32() );
+ }
+
+ default:
+ {
+ return( 0 );
+ }
+ }
+}
+
+
+bool ExpressionFactory::isInt64(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ return( value.to_ptr< Integer >()->isInt64() );
+ }
+
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ return( value.to_ptr< Rational >()->isInt64() );
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ return( value.to_ptr< Float >()->isInt64() );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+avm_int64_t ExpressionFactory::toInt64(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ return( value.to_ptr< Integer >()->toInt64() );
+ }
+
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ return( value.to_ptr< Rational >()->toInt64() );
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ return( value.to_ptr< Float >()->toInt64() );
+ }
+
+ default:
+ {
+ return( 0 );
+ }
+ }
+}
+
+
+bool ExpressionFactory::isInteger(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ return( true );
+ }
+
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ return( value.to_ptr< Rational >()->isInteger() );
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ return( value.to_ptr< Float >()->isInteger() );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+avm_integer_t ExpressionFactory::toInteger(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ return( value.to_ptr< Integer >()->toInteger() );
+ }
+
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ return( value.to_ptr< Rational >()->toInteger() );
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ return( value.to_ptr< Float >()->toInteger() );
+ }
+
+ default:
+ {
+ return( 0 );
+ }
+ }
+}
+
+
+bool ExpressionFactory::isPosInteger(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ return( value.to_ptr< Integer >()->isPosInteger() );
+ }
+
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ return( value.to_ptr< Rational >()->isPosInteger() );
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ return( value.to_ptr< Float >()->isPosInteger() );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+bool ExpressionFactory::isUInteger(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ return( value.to_ptr< Integer >()->isUInteger() );
+ }
+
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ return( value.to_ptr< Rational >()->isUInteger() );
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ return( value.to_ptr< Float >()->isUInteger() );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+avm_uinteger_t ExpressionFactory::toUInteger(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ return( value.to_ptr< Integer >()->toUInteger() );
+ }
+
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ return( value.to_ptr< Rational >()->toUInteger() );
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ return( value.to_ptr< Float >()->toUInteger() );
+ }
+
+ default:
+ {
+ return( 0 );
+ }
+ }
+}
+
+
+
+
+
+bool ExpressionFactory::isRational(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_INTEGER_KIND:
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ return( true );
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ return( value.to_ptr< Float >()->isRational() );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+avm_integer_t ExpressionFactory::toDenominator(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ return( value.to_ptr< Integer >()->toDenominator() );
+ }
+
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ return( value.to_ptr< Rational >()->toDenominator() );
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ return( value.to_ptr< Float >()->toDenominator() );
+ }
+
+ default:
+ {
+ return( 0 );
+ }
+ }
+}
+avm_integer_t ExpressionFactory::toNumerator(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ return( value.to_ptr< Integer >()->toNumerator() );
+ }
+
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ return( value.to_ptr< Rational >()->toNumerator() );
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ return( value.to_ptr< Float >()->toNumerator() );
+ }
+
+ default:
+ {
+ return( 0 );
+ }
+ }
+}
+
+
+bool ExpressionFactory::isFloat(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_INTEGER_KIND:
+ case FORM_BUILTIN_RATIONAL_KIND:
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+avm_float_t ExpressionFactory::toFloat(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ return( value.to_ptr< Integer >()->toFloat() );
+ }
+
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ return( value.to_ptr< Rational >()->toFloat() );
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ return( value.to_ptr< Float >()->toFloat() );
+ }
+
+ default:
+ {
+ return( 0 );
+ }
+ }
+}
+
+
+bool ExpressionFactory::isReal(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_INTEGER_KIND:
+ case FORM_BUILTIN_RATIONAL_KIND:
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+avm_real_t ExpressionFactory::toReal(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ return( value.to_ptr< Integer >()->toReal() );
+ }
+
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ return( value.to_ptr< Rational >()->toReal() );
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ return( value.to_ptr< Float >()->toReal() );
+ }
+
+ default:
+ {
+ return( 0 );
+ }
+ }
+}
+
+
+
+bool ExpressionFactory::isCharacter(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_CHARACTER_KIND:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+char ExpressionFactory::toCharacter(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_CHARACTER_KIND:
+ {
+ return( value.to_ptr< Character >()->getValue() );
+ }
+
+ default:
+ {
+ return( 0 );
+ }
+ }
+}
+
+
+
+bool ExpressionFactory::isIdentifier(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+
+ return( false );
+}
+
+std::string ExpressionFactory::toIdentifier(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ {
+ return( value.to_ptr< Identifier >()->getValue() );
+ }
+
+ default:
+ {
+ return( "" );
+ }
+ }
+}
+
+
+bool ExpressionFactory::isUfi(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+std::string ExpressionFactory::toUfi(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+ {
+ return( value.to_ptr< QualifiedIdentifier >()->getValue() );
+ }
+
+ default:
+ {
+ return( "" );
+ }
+ }
+}
+
+
+bool ExpressionFactory::isUfid(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+std::string ExpressionFactory::toUfid(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ {
+ return( value.to_ptr< Identifier >()->getValue() );
+ }
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+ {
+ return( value.to_ptr< QualifiedIdentifier >()->getValue() );
+ }
+
+ default:
+ {
+ return( "" );
+ }
+ }
+}
+
+
+bool ExpressionFactory::isEnumSymbol(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ return( value.to_ptr< InstanceOfData >()->isEnumSymbolPointer() );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+
+ return( false );
+}
+
+std::string ExpressionFactory::strEnumSymbol(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ return( value.to_ptr< InstanceOfData >()->getFullyQualifiedNameID() );
+ }
+
+ default:
+ {
+ return( "" );
+ }
+ }
+}
+
+
+bool ExpressionFactory::isBuiltinString(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_STRING_KIND:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+
+ return( false );
+}
+
+std::string ExpressionFactory::toBuiltinString(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_STRING_KIND:
+ {
+ return( value.to_ptr< String >()->getValue() );
+ }
+
+ default:
+ {
+ return( "" );
+ }
+ }
+}
+
+
+
+bool ExpressionFactory::isBuiltinValue(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ default:
+ {
+ return( value.is< BuiltinForm >() );
+ }
+ }
+}
+
+
+
+bool ExpressionFactory::isConstValue(const BF & value)
+{
+ switch( value.classKind() )
+ {
+ // BUILTIN VALUE
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ case FORM_BUILTIN_INTEGER_KIND:
+ case FORM_BUILTIN_RATIONAL_KIND:
+ case FORM_BUILTIN_FLOAT_KIND:
+
+ case FORM_BUILTIN_CHARACTER_KIND:
+ case FORM_BUILTIN_STRING_KIND:
+
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+
+ // BUILTIN OPERATOR
+ case FORM_OPERATOR_KIND:
+
+ // BUILTIN ARRAY
+ case FORM_ARRAY_BOOLEAN_KIND:
+ case FORM_ARRAY_CHARACTER_KIND:
+ case FORM_ARRAY_INTEGER_KIND:
+ case FORM_ARRAY_RATIONAL_KIND:
+ case FORM_ARRAY_FLOAT_KIND:
+ case FORM_ARRAY_STRING_KIND:
+ case FORM_ARRAY_IDENTIFIER_KIND:
+ case FORM_ARRAY_QUALIFIED_IDENTIFIER_KIND:
+
+ {
+ return( true );
+ }
+
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ return( value.to_ptr< InstanceOfData >()->isEnumSymbolPointer() );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+/**
+ * COLLECT VARIABLE OR CLAUSE
+ */
+
+void ExpressionFactory::collectVariable(
+ const BF & anExpr, BFCollection & listOfVar)
+{
+ switch( anExpr.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ collectVariable(anExpr.bfCode(), listOfVar);
+
+ break;
+ }
+
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ listOfVar.add_union( anExpr );
+
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+}
+
+
+void ExpressionFactory::collectVariable(
+ const BFCode & aCode, BFCollection & listOfVar)
+{
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator itEnd = aCode->end();
+ for( ; it != itEnd ; ++it )
+ {
+ collectVariable((*it), listOfVar);
+ }
+}
+
+
+void ExpressionFactory::collectsFreeVariable(const BF & anExpr,
+ BFCollection & listOfBoundVar, BFCollection & listOfVar)
+{
+ switch( anExpr.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ collectsFreeVariable(anExpr.bfCode(), listOfBoundVar, listOfVar);
+
+ break;
+ }
+
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ if( not listOfBoundVar.contains(anExpr) )
+ {
+ listOfVar.add_union( anExpr );
+ }
+
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+}
+
+void ExpressionFactory::collectsFreeVariable(const BFCode & aCode,
+ BFCollection & listOfBoundVar, BFCollection & listOfVar)
+{
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator itEnd = aCode->end();
+ for( ; it != itEnd ; ++it )
+ {
+ collectsFreeVariable((*it), listOfBoundVar, listOfVar);
+ }
+}
+
+
+bool ExpressionFactory::containsVariable(
+ const BF & anExpr, InstanceOfData * aVariable)
+{
+ switch( anExpr.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ return( containsVariable(anExpr.bfCode() , aVariable) );
+ }
+
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ if( anExpr.to_ptr< InstanceOfData >() == aVariable )
+ {
+ return( true );
+ }
+
+ return( false );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+bool ExpressionFactory::containsVariable(
+ const BFCode & aCode, InstanceOfData * aVariable)
+{
+
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator itEnd = aCode->end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( containsVariable((*it), aVariable) )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+
+bool ExpressionFactory::containsVariable(
+ const BF & anExpr, BFCollection & listOfVar)
+{
+ switch( anExpr.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ return( containsVariable(anExpr.bfCode() , listOfVar) );
+ }
+
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ if( listOfVar.contains( anExpr ) )
+ {
+ return( true );
+ }
+
+ return( false );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+bool ExpressionFactory::containsVariable(
+ const BFCode & aCode, BFCollection & listOfVar)
+{
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator itEnd = aCode->end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( containsVariable((*it), listOfVar) )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+
+/**
+ * COLLECT VARIABLE OR CLAUSE
+ */
+
+
+void ExpressionFactory::collectsClause(
+ const BF & anExpr, BFCollection & listOfClause)
+{
+ switch( anExpr.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ collectsClause(anExpr.bfCode() , listOfClause);
+
+ break;
+ }
+
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ listOfClause.append( anExpr );
+
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+}
+
+void ExpressionFactory::collectsClause(
+ const BFCode & aCode, BFCollection & listOfClause)
+{
+ if( aCode->isOpCode( AVM_OPCODE_AND ) )
+ {
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator itEnd = aCode->end();
+ for( ; it != itEnd ; ++it )
+ {
+ listOfClause.append( (*it) );
+ }
+ }
+ else
+ {
+ listOfClause.append( aCode );
+ }
+}
+
+
+void ExpressionFactory::collectsClause(
+ const BF & anExpr, BFCollection & listOfBoundVar,
+ BFCollection & listOfBoundClause, BFCollection & listOfFreeClause)
+{
+ switch( anExpr.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ collectsClause( anExpr.bfCode() , listOfBoundVar,
+ listOfBoundClause, listOfFreeClause );
+
+ break;
+ }
+
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ if( ExpressionFactory::containsVariable(anExpr, listOfBoundVar) )
+ {
+ listOfBoundClause.append( anExpr );
+ }
+ else
+ {
+ listOfFreeClause.append( anExpr );
+ }
+
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+}
+
+
+void ExpressionFactory::collectsClause(
+ const BFCode & aCode, BFCollection & listOfBoundVar,
+ BFCollection & listOfBoundClause, BFCollection & listOfFreeClause)
+{
+ if( aCode->isOpCode( AVM_OPCODE_AND ) )
+ {
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator itEnd = aCode->end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( containsVariable((*it), listOfBoundVar) )
+ {
+ listOfBoundClause.append( (*it) );
+ }
+ else
+ {
+ listOfFreeClause.append( (*it) );
+ }
+ }
+ }
+ else
+ {
+ if( ExpressionFactory::containsVariable(aCode, listOfBoundVar) )
+ {
+ listOfBoundClause.append( aCode );
+ }
+ else
+ {
+ listOfFreeClause.append( aCode );
+ }
+ }
+}
+
+
+void ExpressionFactory::deduceTrivialAssignmentsFromConjonction(
+ const BF & anExpr, BFCodeCollection & listOfAssignments)
+{
+ switch( anExpr.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ const BFCode & aCode = anExpr.bfCode();
+
+ if( aCode->isOpCode( AVM_OPCODE_AND ) )
+ {
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator itEnd = aCode->end();
+ for( ; it != itEnd ; ++it )
+ {
+ deduceTrivialAssignmentsFromConjonction(
+ (*it), listOfAssignments);
+ }
+ }
+ else if( aCode->hasOpCode( AVM_OPCODE_EQ, AVM_OPCODE_SEQ ) )
+ {
+ if( aCode->first().is< InstanceOfData >()
+ && aCode->first().to_ptr< InstanceOfData >()->
+ getModifier().noneModifierFinalReferenceMacro()
+ && ExpressionTypeChecker::
+ isFinalSymbolicBasicSymbol(aCode->second()) )
+ {
+ listOfAssignments.append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ASSIGN,
+ aCode->first(), aCode->second()) );
+ }
+ else if( aCode->second().is< InstanceOfData >()
+ && aCode->second().to_ptr<InstanceOfData >()->
+ getModifier().noneModifierFinalReferenceMacro()
+ && ExpressionTypeChecker::
+ isFinalSymbolicBasicSymbol(aCode->first()) )
+ {
+ listOfAssignments.append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ASSIGN,
+ aCode->second(), aCode->first()) );
+ }
+ }
+ else if( aCode->isOpCode( AVM_OPCODE_NOT ) )
+ {
+ if( aCode->first().is< InstanceOfData >()
+ && aCode->first().to_ptr< InstanceOfData >()->
+ getModifier().noneModifierFinalReferenceMacro()
+ && aCode->first().to_ptr< InstanceOfData >()->isTypedBoolean() )
+ {
+ listOfAssignments.append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ASSIGN,
+ aCode->first(), ExpressionConstant::BOOLEAN_FALSE) );
+ }
+ }
+
+
+ break;
+ }
+
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ if( anExpr.to_ptr< InstanceOfData >()->
+ getModifier().noneModifierFinalReferenceMacro()
+ && anExpr.to_ptr< InstanceOfData >()->isTypedBoolean() )
+ {
+ listOfAssignments.append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ASSIGN,
+ anExpr, ExpressionConstant::BOOLEAN_TRUE) );
+ }
+
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+}
+
+
+
+}
+
diff --git a/org.eclipse.efm.symbex/src/fml/expression/ExpressionFactory.h b/org.eclipse.efm.symbex/src/fml/expression/ExpressionFactory.h
new file mode 100644
index 0000000..07a6062
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/ExpressionFactory.h
@@ -0,0 +1,185 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 9 juil. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef EXPRESSIONFACTORY_H_
+#define EXPRESSIONFACTORY_H_
+
+#include <common/BF.h>
+
+#include <collection/BFContainer.h>
+#include <collection/Typedef.h>
+
+#include <fml/executable/BaseInstanceForm.h>
+#include <fml/executable/InstanceOfData.h>
+
+#include <fml/expression/AvmCode.h>
+
+
+namespace sep
+{
+
+
+class ExpressionFactory
+{
+public:
+
+ /**
+ * LOADER - DISPOSER
+ */
+ static void load();
+ static void dispose();
+
+
+ /**
+ * CONFIGURE
+ */
+ static bool configure();
+
+
+ /**
+ * NUMERIC or SIMPLE TYPE TEST & CAST
+ */
+ static bool isBoolean(const BF & value);
+ static bool toBoolean(const BF & value);
+
+ /**
+ * COMPARISON
+ * with TRUE & FALSE
+ */
+ static bool isEqualFalse(const BF & value);
+ static bool isNotEqualFalse(const BF & value);
+
+ static bool isEqualTrue(const BF & value);
+ static bool isNotEqualTrue(const BF & value);
+
+
+ static bool isNumber(const BF & value);
+
+ inline static bool isNumeric(const BF & value)
+ {
+ return( isNumber(value) );
+ }
+
+ static bool isInt32(const BF & value);
+ static avm_int32_t toInt32(const BF & value);
+
+ static bool isInt64(const BF & value);
+ static avm_int64_t toInt64(const BF & value);
+
+ static bool isInteger(const BF & value);
+ static avm_integer_t toInteger(const BF & value);
+
+ static bool isPosInteger(const BF & value);
+
+ static bool isUInteger(const BF & value);
+ static avm_uinteger_t toUInteger(const BF & value);
+
+ static bool isRational(const BF & value);
+ static avm_integer_t toDenominator(const BF & value);
+ static avm_integer_t toNumerator(const BF & value);
+
+ static bool isFloat(const BF & value);
+ static avm_float_t toFloat(const BF & value);
+
+ static bool isReal(const BF & value);
+ static avm_real_t toReal(const BF & value);
+
+
+ static bool isCharacter(const BF & value);
+ static char toCharacter(const BF & value);
+
+ static bool isIdentifier(const BF & value);
+ static std::string toIdentifier(const BF & value);
+
+ static bool isUfi(const BF & value);
+ static std::string toUfi(const BF & value);
+
+ static bool isUfid(const BF & value);
+ static std::string toUfid(const BF & value);
+
+ static bool isEnumSymbol(const BF & value);
+ static std::string strEnumSymbol(const BF & value);
+
+ static bool isBuiltinString(const BF & value);
+ static std::string toBuiltinString(const BF & value);
+
+
+ static bool isBuiltinValue(const BF & value);
+
+ static bool isConstValue(const BF & value);
+
+
+ /**
+ * COLLECT VARIABLE OR CLAUSE
+ */
+ static void collectVariable(const BF & anExpr, BFCollection & listOfVar);
+
+ static void collectVariable(const BFCode & aCode, BFCollection & listOfVar);
+
+
+ inline static void collectVariable(const BF & anExpr,
+ VectorOfBaseInstanceForm & listOfElement)
+ {
+ BFVector listOfVar;
+
+ collectVariable(anExpr, listOfVar);
+
+ BFVector::raw_iterator< InstanceOfData > itVar = listOfVar.begin();
+ BFVector::raw_iterator< InstanceOfData > endVar = listOfVar.end();
+ for( ; itVar != endVar ; ++itVar )
+ {
+ listOfElement.append( itVar );
+ }
+ }
+
+
+ static void collectsFreeVariable(const BF & anExpr,
+ BFCollection & listOfBoundVar, BFCollection & listOfVar);
+
+ static void collectsFreeVariable(const BFCode & aCode,
+ BFCollection & listOfBoundVar, BFCollection & listOfVar);
+
+
+ static bool containsVariable(const BF & anExpr, InstanceOfData * aVariable);
+
+ static bool containsVariable(const BFCode & aCode, InstanceOfData * aVariable);
+
+
+ static bool containsVariable(const BF & anExpr, BFCollection & listOfVar);
+
+ static bool containsVariable(const BFCode & aCode, BFCollection & listOfVar);
+
+
+ static void collectsClause(const BF & anExpr, BFCollection & listOfClause);
+
+ static void collectsClause(const BFCode & aCode, BFCollection & listOfClause);
+
+
+ static void collectsClause(const BF & anExpr, BFCollection & listOfBoundVar,
+ BFCollection & listOfBoundClause, BFCollection & listOfFreeClause);
+
+ static void collectsClause(const BFCode & aCode, BFCollection & listOfBoundVar,
+ BFCollection & listOfBoundClause, BFCollection & listOfFreeClause);
+
+
+ static void deduceTrivialAssignmentsFromConjonction(
+ const BF & anExpr, BFCodeCollection & listOfAssignments);
+
+};
+
+
+}
+
+#endif /* EXPRESSIONFACTORY_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/expression/ExpressionSimplifier.cpp b/org.eclipse.efm.symbex/src/fml/expression/ExpressionSimplifier.cpp
new file mode 100644
index 0000000..9362f4c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/ExpressionSimplifier.cpp
@@ -0,0 +1,620 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 12 janv. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ExpressionSimplifier.h"
+
+#include <fml/executable/BaseInstanceForm.h>
+
+#include <fml/builtin/Boolean.h>
+#include <fml/builtin/BuiltinForm.h>
+#include <fml/expression/ExpressionConstant.h>
+#include <fml/expression/ExpressionConstructor.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// ARITHMETIC SIMPLIFIER
+////////////////////////////////////////////////////////////////////////////////
+
+BF ExpressionSimplifier::PLUS(const BF & lhs, const BF & rhs)
+{
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_PLUS, lhs, rhs) );
+}
+
+BF ExpressionSimplifier::PLUS(Vector< BF > & args)
+{
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_PLUS, args) );
+}
+
+
+BF ExpressionSimplifier::MINUS(const BF & lhs, const BF & rhs)
+{
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_MINUS, lhs, rhs) );
+}
+
+BF ExpressionSimplifier::UMINUS(const BF & arg)
+{
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_UMINUS, arg) );
+}
+
+
+BF ExpressionSimplifier::MULT(const BF & lhs, const BF & rhs)
+{
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_MULT, lhs, rhs) );
+}
+
+BF ExpressionSimplifier::MULT(Vector< BF > & args)
+{
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_MULT, args) );
+}
+
+
+BF ExpressionSimplifier::POW(const BF & lhs, const BF & rhs)
+{
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_POW, lhs, rhs) );
+}
+
+BF ExpressionSimplifier::DIV(const BF & lhs, const BF & rhs)
+{
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_DIV, lhs, rhs) );
+}
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// COMPARER SIMPLIFIER
+////////////////////////////////////////////////////////////////////////////////
+
+BF ExpressionSimplifier::EQ(const BF & lhs, const BF & rhs)
+{
+ if( lhs.isTEQ(rhs) )
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+ else if( lhs.classKind() == rhs.classKind() )
+ {
+ if( lhs.isEQ( rhs ) )
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+ }
+
+ return( ExpressionConstructor::eqExpr(lhs, rhs) );
+}
+
+BF ExpressionSimplifier::NEQ(const BF & lhs, const BF & rhs)
+{
+ if( lhs.isTEQ(rhs) )
+ {
+ return( ExpressionConstant::BOOLEAN_FALSE );
+ }
+ else if( lhs.classKind() == rhs.classKind() )
+ {
+ if( lhs.isEQ( rhs ) )
+ {
+ return( ExpressionConstant::BOOLEAN_FALSE );
+ }
+ }
+
+ return( ExpressionConstructor::neqExpr(lhs, rhs) );
+}
+
+
+
+BF ExpressionSimplifier::SEQ(const BF & lhs, const BF & rhs)
+{
+ return( ( lhs.isTEQ(rhs) || (lhs.str() == rhs.str()) )
+ ? ExpressionConstant::BOOLEAN_TRUE
+ : ExpressionConstant::BOOLEAN_FALSE );
+}
+
+BF ExpressionSimplifier::NSEQ(const BF & lhs, const BF & rhs)
+{
+ return( ( lhs.isTEQ(rhs) || (lhs.str() == rhs.str()) )
+ ? ExpressionConstant::BOOLEAN_FALSE
+ : ExpressionConstant::BOOLEAN_TRUE );
+}
+
+
+
+BF ExpressionSimplifier::LT(const BF & lhs, const BF & rhs)
+{
+ if( lhs.isTEQ(rhs) )
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+ else if( lhs.classKind() == rhs.classKind() )
+ {
+ if( lhs.is< Number >() )
+ {
+ return( lhs.isEQ( rhs )
+ ? ExpressionConstant::BOOLEAN_TRUE
+ : ExpressionConstant::BOOLEAN_FALSE );
+ }
+ }
+
+ return( ExpressionConstructor::ltExpr(lhs, rhs) );
+}
+
+BF ExpressionSimplifier::LTE(const BF & lhs, const BF & rhs)
+{
+ if( lhs.isTEQ(rhs) )
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+ else if( lhs.classKind() == rhs.classKind() )
+ {
+ if( lhs.is< BuiltinForm >() && rhs.is< BuiltinForm >() )
+ {
+ return( lhs.isEQ( rhs )
+ ? ExpressionConstant::BOOLEAN_TRUE
+ : ExpressionConstant::BOOLEAN_FALSE );
+ }
+ }
+
+ return( ExpressionConstructor::lteExpr(lhs, rhs) );
+}
+
+BF ExpressionSimplifier::GT(const BF & lhs, const BF & rhs)
+{
+ if( lhs.isTEQ(rhs) )
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+ else if( lhs.classKind() == rhs.classKind() )
+ {
+ if( lhs.is< BuiltinForm >() && rhs.is< BuiltinForm >() )
+ {
+ return( lhs.isEQ( rhs )
+ ? ExpressionConstant::BOOLEAN_TRUE
+ : ExpressionConstant::BOOLEAN_FALSE );
+ }
+ }
+
+ return( ExpressionConstructor::gtExpr(lhs, rhs) );
+}
+
+BF ExpressionSimplifier::GTE(const BF & lhs, const BF & rhs)
+{
+ if( lhs.isTEQ(rhs) )
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+ else if( lhs.classKind() == rhs.classKind() )
+ {
+ if( lhs.is< BuiltinForm >() && rhs.is< BuiltinForm >() )
+ {
+ return( lhs.isEQ( rhs )
+ ? ExpressionConstant::BOOLEAN_TRUE
+ : ExpressionConstant::BOOLEAN_FALSE );
+ }
+ }
+
+ return( ExpressionConstructor::gteExpr(lhs, rhs) );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// LOGIC SIMPLIFIER
+////////////////////////////////////////////////////////////////////////////////
+
+BF ExpressionSimplifier::NOT(const BF & arg)
+{
+ if( arg.isEqualTrue() )
+ {
+ return( ExpressionConstant::BOOLEAN_FALSE );
+ }
+ else if( arg.isEqualFalse() )
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+ else
+ {
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_NOT, arg) );
+ }
+}
+
+BF ExpressionSimplifier::AND(const BF & lhs, const BF & rhs)
+{
+ if( lhs.isEqualFalse() || rhs.isEqualFalse() )
+ {
+ return( ExpressionConstant::BOOLEAN_FALSE );
+ }
+ else if( lhs.isEqualTrue() )
+ {
+ return( rhs );
+ }
+ else if( rhs.isEqualTrue() || (lhs == rhs) )
+ {
+ return( lhs );
+ }
+ else
+ {
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_AND, lhs, rhs) );
+ }
+}
+
+BF ExpressionSimplifier::AND(Vector< BF > & args)
+{
+ BFCode resEXPR( OperatorManager::OPERATOR_AND );
+
+ AvmCode::const_iterator itRes;
+ AvmCode::const_iterator endRes;
+
+ AvmCode::const_iterator itArg = args.begin();
+ AvmCode::const_iterator endArg = args.end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ if( (*itArg).isEqualFalse() )
+ {
+ return( ExpressionConstant::BOOLEAN_FALSE );
+ }
+ else if( (*itArg).isNotEqualTrue() )
+ {
+ endRes = resEXPR->end();
+ for( itRes = resEXPR->begin() ; itRes != endRes ; ++itRes )
+ {
+ if( (*itArg).isEQ( *itRes ) )
+ {
+ break;
+ }
+ }
+
+ if( itRes == endRes )
+ {
+ resEXPR->append( (*itArg) );
+ }
+ }
+ }
+
+ if( resEXPR->populated() )
+ {
+ return( resEXPR );
+ }
+ else if( resEXPR->nonempty() )
+ {
+ return( resEXPR->first() );
+ }
+ else
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+}
+
+
+BF ExpressionSimplifier::NAND(const BF & lhs, const BF & rhs)
+{
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_AND, lhs, rhs) );
+}
+
+BF ExpressionSimplifier::NAND(Vector< BF > & args)
+{
+ BFCode resEXPR( OperatorManager::OPERATOR_NAND );
+
+ AvmCode::const_iterator itRes;
+ AvmCode::const_iterator endRes;
+
+ AvmCode::const_iterator itArg = args.begin();
+ AvmCode::const_iterator endArg = args.end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ if( (*itArg).isEqualFalse() )
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+ else if( (*itArg).isNotEqualTrue() )
+ {
+ endRes = resEXPR->end();
+ for( itRes = resEXPR->begin() ; itRes != endRes ; ++itRes )
+ {
+ if( (*itArg).isEQ( *itRes ) )
+ {
+ break;
+ }
+ }
+
+ if( itRes == endRes )
+ {
+ resEXPR->append( (*itArg) );
+ }
+ }
+ }
+
+ if( resEXPR->populated() )
+ {
+ return( resEXPR );
+ }
+ else if( resEXPR->nonempty() )
+ {
+ return( resEXPR->first() );
+ }
+ else
+ {
+ return( ExpressionConstant::BOOLEAN_FALSE );
+ }
+}
+
+
+BF ExpressionSimplifier::XAND(const BF & lhs, const BF & rhs)
+{
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_XAND, lhs, rhs) );
+}
+
+BF ExpressionSimplifier::XAND(Vector< BF > & args)
+{
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_XAND, args) );
+}
+
+
+
+
+BF ExpressionSimplifier::OR(const BF & lhs, const BF & rhs)
+{
+ if( lhs.isEqualTrue() || rhs.isEqualTrue() )
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+ else if( lhs.isEqualFalse() )
+ {
+ return( rhs );
+ }
+ else if( rhs.isEqualFalse() || (lhs == rhs) )
+ {
+ return( lhs );
+ }
+ else
+ {
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_OR, lhs, rhs) );
+ }
+}
+
+BF ExpressionSimplifier::OR(Vector< BF > & args)
+{
+ BFCode resEXPR( OperatorManager::OPERATOR_OR );
+
+ AvmCode::const_iterator itRes;
+ AvmCode::const_iterator endRes;
+
+ AvmCode::const_iterator itArg = args.begin();
+ AvmCode::const_iterator endArg = args.end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ if( (*itArg).isEqualTrue() )
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+ else if( (*itArg).isNotEqualFalse() )
+ {
+ endRes = resEXPR->end();
+ for( itRes = resEXPR->begin() ; itRes != endRes ; ++itRes )
+ {
+ if( (*itArg).isEQ( *itRes ) )
+ {
+ break;
+ }
+ }
+
+ if( itRes == endRes )
+ {
+ resEXPR->append( (*itArg) );
+ }
+ }
+ }
+
+ if( resEXPR->populated() )
+ {
+ return( resEXPR );
+ }
+ else if( resEXPR->nonempty() )
+ {
+ return( resEXPR->first() );
+ }
+ else
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+}
+
+
+BF ExpressionSimplifier::NOR(const BF & lhs, const BF & rhs)
+{
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_NOR, lhs, rhs) );
+}
+
+BF ExpressionSimplifier::NOR(Vector< BF > & args)
+{
+ BFCode resEXPR( OperatorManager::OPERATOR_NOR );
+
+ AvmCode::const_iterator itRes;
+ AvmCode::const_iterator endRes;
+
+ AvmCode::const_iterator itArg = args.begin();
+ AvmCode::const_iterator endArg = args.end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ if( (*itArg).isEqualTrue() )
+ {
+ return( ExpressionConstant::BOOLEAN_FALSE );
+ }
+ else if( (*itArg).isNotEqualFalse() )
+ {
+ endRes = resEXPR->end();
+ for( itRes = resEXPR->begin() ; itRes != endRes ; ++itRes )
+ {
+ if( (*itArg).isEQ( *itRes ) )
+ {
+ break;
+ }
+ }
+
+ if( itRes == endRes )
+ {
+ resEXPR->append( (*itArg) );
+ }
+ }
+ }
+
+ if( resEXPR->populated() )
+ {
+ return( resEXPR );
+ }
+ else if( resEXPR->nonempty() )
+ {
+ return( resEXPR->first() );
+ }
+ else
+ {
+ return( ExpressionConstant::BOOLEAN_FALSE );
+ }
+}
+
+
+
+BF ExpressionSimplifier::XOR(const BF & lhs, const BF & rhs)
+{
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_XOR, lhs, rhs) );
+}
+
+BF ExpressionSimplifier::XOR(Vector< BF > & args)
+{
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_XOR, args) );
+}
+
+
+BF ExpressionSimplifier::XNOR(const BF & lhs, const BF & rhs)
+{
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_XNOR, lhs, rhs) );
+}
+
+BF ExpressionSimplifier::XNOR(Vector< BF > & args)
+{
+ return( ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_XNOR, args) );
+}
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// PREDICATE SIMPLIFIER
+////////////////////////////////////////////////////////////////////////////////
+
+BF ExpressionSimplifier::simplif(const BF & expr)
+{
+ if ( expr.valid() )
+ {
+ return( expr );
+
+ AVM_OS_WARNING_ALERT
+ << "Todo: simplif the Expression\n"
+ << expr.toString( AVM_TAB1_INDENT )
+ << SEND_ALERT;
+ }
+
+ return( expr );
+}
+
+
+
+BF ExpressionSimplifier::simplif_and(const BF & arg0, const BF & arg1)
+{
+ if( arg0.isEqualFalse() || arg1.isEqualFalse() )
+ {
+ return( ExpressionConstant::BOOLEAN_FALSE );
+ }
+ else if( arg1.isEqualTrue() )
+ {
+ return( arg0 );
+ }
+ else if( arg0.isEqualTrue() || (arg0 == arg1) )
+ {
+ return( arg1 );
+ }
+
+ else
+ {
+ return( ExpressionSimplifier::simplif(
+ ExpressionConstructor::andExpr(arg0, arg1)) );
+ }
+}
+
+
+BF ExpressionSimplifier::simplif_or(const BF & arg0, const BF & arg1)
+{
+ if( arg0.isEqualTrue() || arg1.isEqualTrue() )
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+ else if( arg1.isEqualFalse() )
+ {
+ return( arg0 );
+ }
+ else if( arg0.isEqualFalse() || (arg0 == arg1) )
+ {
+ return( arg1 );
+ }
+
+ else
+ {
+ return( ExpressionSimplifier::simplif(
+ ExpressionConstructor::orExpr(arg0, arg1)) );
+ }
+}
+
+
+BF ExpressionSimplifier::simplif_not(const BF & arg0)
+{
+ if( arg0.isEqualTrue() )
+ {
+ return( ExpressionConstant::BOOLEAN_FALSE );
+ }
+ else if( arg0.isEqualFalse() )
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+
+ else
+ {
+ return( ExpressionSimplifier::simplif(
+ ExpressionConstructor::notExpr(arg0)) );
+ }
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/expression/ExpressionSimplifier.h b/org.eclipse.efm.symbex/src/fml/expression/ExpressionSimplifier.h
new file mode 100644
index 0000000..5f73054
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/ExpressionSimplifier.h
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 12 janv. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef EXPRESSIONSIMPLIFIER_H_
+#define EXPRESSIONSIMPLIFIER_H_
+
+#include <common/BF.h>
+
+#include <collection/Vector.h>
+
+#include <fml/expression/AvmCode.h>
+
+
+namespace sep
+{
+
+
+class ExpressionSimplifier
+{
+
+public:
+
+ ////////////////////////////////////////////////////////////////////////////
+ // ARITHMETIC SIMPLIFIER
+ ////////////////////////////////////////////////////////////////////////////
+
+ static BF PLUS(const BF & lhs, const BF & rhs);
+ static BF PLUS(Vector< BF > & args);
+
+ static BF MINUS(const BF & lhs, const BF & rhs);
+
+ static BF UMINUS(const BF & arg);
+
+ static BF MULT(const BF & lhs, const BF & rhs);
+ static BF MULT(Vector< BF > & args);
+
+ static BF POW(const BF & lhs, const BF & rhs);
+
+ static BF DIV(const BF & lhs, const BF & rhs);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // COMPARER SIMPLIFIER
+ ////////////////////////////////////////////////////////////////////////////
+
+ static BF EQ(const BF & lhs, const BF & rhs);
+ static BF NEQ(const BF & lhs, const BF & rhs);
+
+ static BF SEQ(const BF & lhs, const BF & rhs);
+ static BF NSEQ(const BF & lhs, const BF & rhs);
+
+ static BF LT(const BF & lhs, const BF & rhs);
+ static BF LTE(const BF & lhs, const BF & rhs);
+
+ static BF GT(const BF & lhs, const BF & rhs);
+ static BF GTE(const BF & lhs, const BF & rhs);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // LOGIC SIMPLIFIER
+ ////////////////////////////////////////////////////////////////////////////
+
+ static BF NOT(const BF & arg);
+
+ static BF AND(const BF & lhs, const BF & rhs);
+ static BF AND(Vector< BF > & args);
+
+ static BF NAND(const BF & lhs, const BF & rhs);
+ static BF NAND(Vector< BF > & args);
+
+ static BF XAND(const BF & lhs, const BF & rhs);
+ static BF XAND(Vector< BF > & args);
+
+ static BF OR(const BF & lhs, const BF & rhs);
+ static BF OR(Vector< BF > & args);
+
+ static BF NOR(const BF & lhs, const BF & rhs);
+ static BF NOR(Vector< BF > & args);
+
+ static BF XOR(const BF & lhs, const BF & rhs);
+ static BF XOR(Vector< BF > & args);
+
+ static BF XNOR(const BF & lhs, const BF & rhs);
+ static BF XNOR(Vector< BF > & args);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PREDICATE SIMPLIFIER
+ ////////////////////////////////////////////////////////////////////////////
+
+ static BF simplif(const BF & expr);
+
+ static BF simplif_and(const BF & arg0, const BF & arg1);
+
+ static BF simplif_or(const BF & arg0, const BF & arg1);
+
+ static BF simplif_not(const BF & arg0);
+
+};
+
+
+} /* namespace sep */
+#endif /* EXPRESSIONSIMPLIFIER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/expression/ExpressionTypeChecker.cpp b/org.eclipse.efm.symbex/src/fml/expression/ExpressionTypeChecker.cpp
new file mode 100644
index 0000000..9533ec6
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/ExpressionTypeChecker.cpp
@@ -0,0 +1,1325 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 18 sept. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ExpressionTypeChecker.h"
+
+#include <fml/executable/InstanceOfMachine.h>
+#include <fml/expression/BuiltinArray.h>
+#include <fml/builtin/Identifier.h>
+#include <fml/builtin/QualifiedIdentifier.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+#include <fml/type/ClassTypeSpecifier.h>
+#include <fml/type/ContainerTypeSpecifier.h>
+#include <fml/type/EnumTypeSpecifier.h>
+#include <fml/type/IntervalTypeSpecifier.h>
+#include <fml/type/TypeAliasSpecifier.h>
+#include <fml/type/TypeManager.h>
+
+
+namespace sep
+{
+
+
+bool ExpressionTypeChecker::isFinalSymbolicBasicSymbol(const BF & anElement)
+{
+ if( anElement.is< Identifier >() || anElement.is< QualifiedIdentifier >() )
+ {
+ return( false );
+ }
+ else if( anElement.is< BuiltinForm >() )
+ {
+ return( true );
+ }
+
+ else if( anElement.is< InstanceOfData >() )
+ {
+ InstanceOfData * anInstance = anElement.to_ptr< InstanceOfData >();
+
+ if( anInstance->isTypedEnum() )
+ {
+ return( anInstance->isEnumSymbolPointer() );
+ }
+ else if( anInstance->isTypedMachine() )
+ {
+ return( true );
+ }
+// else if( anInstance->getModifier().hasModifierPublicFinalStatic() )
+// {
+// return( true );
+// }
+ }
+
+ else if( anElement.is< InstanceOfMachine >()
+ && anElement.to_ptr< InstanceOfMachine >()->
+ getModifier().hasModifierPublicFinalStatic() )
+ {
+ return( true );
+ }
+
+ else if( anElement.is< BaseInstanceForm >()
+ && anElement.to_ptr< BaseInstanceForm >()->
+ getModifier().hasModifierPublicFinalStatic() )
+ {
+ return( true );
+ }
+
+ else if( anElement.is_strictly< BuiltinArray >() )
+ {
+ return( true );
+ }
+
+ return( false );
+}
+
+
+bool ExpressionTypeChecker::isFinalSymbolicCompositeSymbol(const BF & anElement)
+{
+ if( anElement.is< BuiltinArray >() )
+ {
+ return( isFinalSymbolicCompositeSymbol(anElement.to_ptr< BuiltinArray >()) );
+ }
+ else
+ {
+ return( false );
+ }
+}
+
+
+bool ExpressionTypeChecker::isFinalSymbolicCompositeSymbol(
+ BuiltinArray * arrayForm)
+{
+ if( arrayForm->is_strictly< ArrayBF >() )
+ {
+ return( true );
+ }
+ if( arrayForm->is< ArrayBF >() )
+ {
+ ArrayBF * bfArray = arrayForm->to< ArrayBF >();
+ for( avm_size_t idx = 0 ; idx < bfArray->size() ; ++idx )
+ {
+ if( not isFinalSymbolicSymbol( bfArray->at(idx) ) )
+ {
+ return( false );
+ }
+ }
+ }
+
+ return( false );
+}
+
+
+bool ExpressionTypeChecker::isMachine(const BF & anExpr)
+{
+ if( (anExpr.is< BaseInstanceForm >() &&
+ anExpr.to_ptr< BaseInstanceForm >()->isTypedMachine()) ||
+ anExpr.is< RuntimeID >() )
+ {
+ return( true );
+ }
+ else
+ {
+ return( StatementTypeChecker::isMachine( anExpr ) );
+ }
+}
+
+
+bool ExpressionTypeChecker::isArray(
+ ContainerTypeSpecifier * refTypeSpecifier, const BF & anExpr)
+{
+ if( anExpr.is< ArrayBF >() )
+ {
+ ArrayBF * bArray = anExpr.to_ptr< ArrayBF >();
+ for( avm_size_t idx = 1 ; idx < bArray->size() ; ++idx )
+ {
+ if( not isTyped(refTypeSpecifier->getContentsTypeSpecifier(),
+ bArray->at(idx)) )
+ {
+ return( false );
+ }
+ }
+ return( true );
+ }
+ else if( anExpr.is< BuiltinArray >() )
+ {
+ BuiltinArray * bArray = anExpr.to_ptr< BuiltinArray >();
+
+ if( refTypeSpecifier == bArray->getTypeSpecifier() )
+ {
+ return( true );
+ }
+ else if( bArray->getTypeSpecifier()->isTypedArray() &&
+ (refTypeSpecifier->getContentsTypeSpecifier() == bArray->
+ getTypeSpecifier()->as< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier()) )
+ {
+ return( true );
+ }
+ else
+ {
+ AVM_OS_WARN << "ExpressionTypeChecker::isArray :> ref< @ "
+ << refTypeSpecifier << "->" << refTypeSpecifier->strT()
+ << " > =/= dtype< @ "
+ << bArray->getTypeSpecifier()
+ << "-> " << bArray->getTypeSpecifier()->strT()
+ << " >" << std::endl;
+
+// bArray->getTypeSpecifier()->toStream(AVM_OS_WARN);
+ }
+ return( ExpressionTypeChecker::weaklyTyped(
+ refTypeSpecifier->getContentsTypeSpecifier(),
+ bArray->getTypeSpecifier()) );
+ }
+ else if( anExpr.is< BaseInstanceForm >() )
+ {
+ return( ExpressionTypeChecker::weaklyTyped(
+ refTypeSpecifier->getContentsTypeSpecifier(),
+ anExpr.to_ptr< BaseInstanceForm >()->getTypeSpecifier()) );
+ }
+
+ else return( false );
+}
+
+
+bool ExpressionTypeChecker::isClass(
+ ClassTypeSpecifier * refTypeSpecifier, const BF & anExpr)
+{
+ if( anExpr.is< BuiltinArray >() )
+ {
+ BuiltinArray * bArray = anExpr.to_ptr< BuiltinArray >();
+
+ if( refTypeSpecifier == bArray->getTypeSpecifier() )
+ {
+ return( true );
+ }
+ else if( refTypeSpecifier->size() != bArray->size() )
+ {
+ return( false );
+ }
+ else if( bArray->hasTypeSpecifier() &&
+ anExpr.is_strictly< BuiltinArray >() &&
+ bArray->getTypeSpecifier()->hasTypeContainer() )
+ {
+ BaseTypeSpecifier * eltTS = bArray->getTypeSpecifier()->
+ as< ContainerTypeSpecifier >()->getContentsTypeSpecifier();
+
+ TableOfSymbol::const_iterator it =
+ refTypeSpecifier->getSymbolData().begin();
+ TableOfSymbol::const_iterator endIt =
+ refTypeSpecifier->getSymbolData().end();
+ for( ; it != endIt ; ++it )
+ {
+ if( not ExpressionTypeChecker::isTyped(
+ (*it).getTypeSpecifier(), eltTS) )
+ {
+ AVM_OS_WARN << "ExpressionTypeChecker::isClass :> ref< "
+ << (*it).getTypeSpecifier()->strT()
+ << " > =/= dtype< " << eltTS->strT() << " >"
+ << std::endl;
+
+ return( false );
+ }
+ }
+ return( true );
+ }
+ else if( bArray->is< ArrayBF >() )
+ {
+ ArrayBF * bfArray = bArray->to< ArrayBF >();
+
+ TableOfSymbol::const_iterator it =
+ refTypeSpecifier->getSymbolData().begin();
+ TableOfSymbol::const_iterator endIt =
+ refTypeSpecifier->getSymbolData().end();
+ for( avm_size_t offset = 0; it != endIt ; ++it , ++offset )
+ {
+ if( not ExpressionTypeChecker::isTyped(
+ (*it).getTypeSpecifier(), bfArray->at(offset)) )
+ {
+ AVM_OS_WARN << "ExpressionTypeChecker::isClass :> ref< "
+ << (*it).getTypeSpecifier()->strT() << " > =/= arg<"
+ << str_indent( bfArray->at(offset) ) << " >"
+ << std::endl;
+
+ return( false );
+ }
+ }
+ return( true );
+ }
+ }
+ else if( anExpr.is< BaseInstanceForm >() )
+ {
+ return( ExpressionTypeChecker::isTyped(refTypeSpecifier,
+ anExpr.to_ptr< BaseInstanceForm >()->getTypeSpecifier()) );
+ }
+ else if( anExpr.is< ArrayBF >() )
+ {
+ ArrayBF * bfArray = anExpr.to_ptr< ArrayBF >();
+
+ if( refTypeSpecifier->getSymbolData().size() != bfArray->size() )
+ {
+ return( false );
+ }
+
+ TableOfSymbol::const_iterator it =
+ refTypeSpecifier->getSymbolData().begin();
+ TableOfSymbol::const_iterator endIt =
+ refTypeSpecifier->getSymbolData().end();
+ for( avm_size_t offset = 0; it != endIt ; ++it , ++offset )
+ {
+ if( not ExpressionTypeChecker::isTyped(
+ (*it).getTypeSpecifier(), bfArray->get(offset)) )
+ {
+ AVM_OS_WARN << "ExpressionTypeChecker::isClass :> ref< "
+ << (*it).getTypeSpecifier()->strT()
+ << " > =/= dtype< " << bfArray->get(offset).str()
+ << " >" << std::endl;
+ return( false );
+ }
+ }
+ return( true );
+ }
+
+ return( false );
+}
+
+
+bool ExpressionTypeChecker::isCollection(
+ ContainerTypeSpecifier * refTypeSpecifier, const BF & anExpr)
+{
+ if( anExpr.is< ArrayBF >() )
+ {
+ ArrayBF * bArray = anExpr.to_ptr< ArrayBF >();
+ for( avm_size_t idx = 1 ; idx < bArray->size() ; ++idx )
+ {
+ if( not isTyped(refTypeSpecifier->getContentsTypeSpecifier(),
+ bArray->at(idx)) )
+ {
+ return( false );
+ }
+ }
+ return( true );
+ }
+ else if( anExpr.is< BuiltinContainer >() )
+ {
+ BuiltinContainer * bArray = anExpr.to_ptr< BuiltinContainer >();
+ for( avm_size_t idx = 1 ; idx < bArray->size() ; ++idx )
+ {
+ if( not isTyped(refTypeSpecifier->getContentsTypeSpecifier(),
+ bArray->at(idx)) )
+ {
+ return( false );
+ }
+ }
+ return( true );
+ }
+ else if( anExpr.is< BuiltinArray >() )
+ {
+ BuiltinArray * bArray = anExpr.to_ptr< BuiltinArray >();
+
+ if( refTypeSpecifier == bArray->getTypeSpecifier() )
+ {
+ return( true );
+ }
+ else if( bArray->getTypeSpecifier()->isTypedArray() &&
+ (refTypeSpecifier->getContentsTypeSpecifier() == bArray->
+ getTypeSpecifier()->as< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier()) )
+ {
+ return( true );
+ }
+ else
+ {
+ AVM_OS_WARN << "ExpressionTypeChecker::isCollection :> ref< @ "
+ << refTypeSpecifier << "->" << refTypeSpecifier->strT()
+ << " > =/= dtype< @ "
+ << bArray->getTypeSpecifier()
+ << "-> " << bArray->getTypeSpecifier()->strT()
+ << " >" << std::endl;
+
+// bArray->getTypeSpecifier()->toStream(AVM_OS_WARN);
+ }
+ return( ExpressionTypeChecker::weaklyTyped(
+ refTypeSpecifier->getContentsTypeSpecifier(),
+ bArray->getTypeSpecifier()) );
+ }
+ else if( anExpr.is< BaseInstanceForm >() )
+ {
+ return( ExpressionTypeChecker::weaklyTyped(
+ refTypeSpecifier->getContentsTypeSpecifier(),
+ anExpr.to_ptr< BaseInstanceForm >()->getTypeSpecifier()) );
+ }
+ else if( anExpr.is< AvmCode >() )
+ {
+ AvmCode * aCode = anExpr.to_ptr< AvmCode >();
+
+ if( OperatorManager::isContainerOperation(aCode->getOperator()) )
+ {
+ return( ExpressionTypeChecker::isTyped(
+ refTypeSpecifier, aCode->first()) );
+ }
+ if( OperatorManager::isContainerElementAccess(aCode->getOperator()) )
+ {
+ if( aCode->first().is< BaseInstanceForm >() )
+ {
+ BaseTypeSpecifier * bts = aCode->first().
+ to_ptr< BaseInstanceForm >()->getTypeSpecifier();
+
+ return( bts->hasTypeContainer() &&
+ ExpressionTypeChecker::isTyped(refTypeSpecifier,
+ bts->as< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier()) );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ else return( false );
+ }
+
+ else return( false );
+}
+
+
+bool ExpressionTypeChecker::isVector(const BF & anExpr)
+{
+ if( anExpr.is< BuiltinVector >() )
+ {
+ return( true );
+ }
+ else if( anExpr.is< BaseInstanceForm >() )
+ {
+ return( anExpr.to_ptr< BaseInstanceForm >()->
+ getTypeSpecifier()->hasTypeVector() );
+ }
+ else if( anExpr.is< AvmCode >() )
+ {
+ AvmCode * aCode = anExpr.to_ptr< AvmCode >();
+
+ if( OperatorManager::isContainerOperation(aCode->getOperator()) )
+ {
+ return( ExpressionTypeChecker::isVector( aCode->first() ) );
+ }
+ else if( OperatorManager::isCtor( aCode->getOperator() ) )
+ {
+ return( aCode->first().is< BaseTypeSpecifier >() &&
+ aCode->first().to_ptr<
+ BaseTypeSpecifier >()->hasTypeVector() );
+ }
+
+ else return( false );
+ }
+
+ else return( false );
+}
+
+
+bool ExpressionTypeChecker::isEnum(
+ EnumTypeSpecifier * refTypeSpecifier, const BF & anExpr)
+{
+ if( anExpr.is< InstanceOfData >() )
+ {
+ if( refTypeSpecifier == anExpr.to_ptr< InstanceOfData >()->getTypeSpecifier() )
+ {
+ return( true );
+ }
+ else
+ {
+ AVM_OS_WARN << "ExpressionTypeChecker::isEnum :> ref< @ "
+ << refTypeSpecifier->strT() << " > =/= dtype< @ "
+ << anExpr.to_ptr< InstanceOfData >()->getTypeSpecifier()->strT()
+ << " >" << std::endl;
+
+ return( false);
+ }
+ }
+ else if( anExpr.is< BaseInstanceForm >() )
+ {
+ return( ExpressionTypeChecker::isTyped(refTypeSpecifier,
+ anExpr.to_ptr< BaseInstanceForm >()->getTypeSpecifier()) );
+ }
+
+ else if( anExpr.isNumeric() )
+ {
+ return( refTypeSpecifier->hasSymbolDataWithValue(anExpr) );
+ }
+
+ else if( anExpr.is< AvmCode >() )
+ {
+ AvmCode * aCode = anExpr.to_ptr< AvmCode >();
+
+ if( OperatorManager::isContainerElementAccess(aCode->getOperator()) )
+ {
+ if( aCode->first().is< BaseInstanceForm >() )
+ {
+ BaseTypeSpecifier * bts = aCode->first().
+ to_ptr< BaseInstanceForm >()->getTypeSpecifier();
+
+ return( bts->hasTypeContainer() &&
+ ExpressionTypeChecker::isTyped(refTypeSpecifier,
+ bts->as< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier()) );
+ }
+ }
+ }
+
+ return( false );
+}
+
+
+
+bool ExpressionTypeChecker::isEnum(const BF & anExpr)
+{
+ if( anExpr.is< BaseInstanceForm >() )
+ {
+ return( anExpr.to_ptr< BaseInstanceForm >()->isTypedEnum() );
+ }
+
+ else return( false );
+}
+
+
+
+bool ExpressionTypeChecker::isCharacter(const BF & anExpr)
+{
+ if( anExpr.isCharacter() )
+ {
+ return( true );
+ }
+ else if( anExpr.is< BaseInstanceForm >() )
+ {
+ return( anExpr.to_ptr< BaseInstanceForm >()->isTypedCharacter() );
+ }
+ else if( anExpr.is< AvmCode >() )
+ {
+ AvmCode * aCode = anExpr.to_ptr< AvmCode >();
+
+ if( aCode->hasInstruction() && (aCode->getInstruction()->
+ getMainProcessor() == AVM_ARG_CHARACTER_CPU) )
+ {
+ return( true );
+ }
+
+ else if( OperatorManager::isCtor( aCode->getOperator() ) )
+ {
+ return( aCode->first().is< BaseTypeSpecifier >() &&
+ aCode->first().to_ptr< BaseTypeSpecifier >()->
+ isTypedCharacter() );
+ }
+ else if( OperatorManager::isAssign( aCode->getOperator() ) )
+ {
+ if( aCode->first().is< BaseInstanceForm >() )
+ {
+ return( aCode->first().to_ptr< BaseInstanceForm >()
+ ->isTypedCharacter() );
+ }
+ else if( OperatorManager::isAssignBinary( aCode->getOperator() ) )
+ {
+ return( ExpressionTypeChecker::isCharacter(aCode->second()) );
+ }
+ return( false );
+ }
+ else if( OperatorManager::isCharacter( aCode->getOperator() ) )
+ {
+ for(AvmCode::iterator it = aCode->begin() ; it != aCode->end() ; ++it)
+ {
+ if( not ExpressionTypeChecker::isCharacter( *it ) )
+ {
+ return( false );
+ }
+ }
+ return( true );
+ }
+ else if( OperatorManager::isContainerElementAccess(
+ aCode->getOperator() ) )
+ {
+ if( aCode->first().is< BaseInstanceForm >() )
+ {
+ BaseTypeSpecifier * bts = aCode->first().
+ to_ptr< BaseInstanceForm >()->getTypeSpecifier();
+
+ return( bts->hasTypeContainer() &&
+ bts->as< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier().isTypedCharacter() );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ else return( false );
+ }
+
+ else return( false );
+}
+
+
+bool ExpressionTypeChecker::isString(const BF & anExpr)
+{
+ if( anExpr.isBuiltinString() )
+ {
+ return( true );
+ }
+ else if( anExpr.is< BaseInstanceForm >() )
+ {
+ return( anExpr.to_ptr< BaseInstanceForm >()->isTypedString() );
+ }
+ else if( anExpr.is< AvmCode >() )
+ {
+ AvmCode * aCode = anExpr.to_ptr< AvmCode >();
+
+ if( aCode->hasInstruction() && (aCode->getInstruction()->
+ getMainProcessor() == AVM_ARG_STRING_CPU) )
+ {
+ return( true );
+ }
+
+ else if( OperatorManager::isCtor( aCode->getOperator() ) )
+ {
+ return( aCode->first().is< BaseTypeSpecifier >() &&
+ aCode->first().to_ptr< BaseTypeSpecifier >()->isTypedString() );
+ }
+ else if( OperatorManager::isAssign( aCode->getOperator() ) )
+ {
+ if( aCode->first().is< BaseInstanceForm >() )
+ {
+ return( aCode->first().to_ptr< BaseInstanceForm >()
+ ->isTypedString() );
+ }
+ else if( OperatorManager::isAssignBinary( aCode->getOperator() ) )
+ {
+ return( ExpressionTypeChecker::isString(aCode->second()) );
+ }
+ return( false );
+ }
+ else if( OperatorManager::isString( aCode->getOperator() ) )
+ {
+ for(AvmCode::iterator it = aCode->begin() ; it != aCode->end() ; ++it)
+ {
+ if( not ExpressionTypeChecker::isString( *it ) )
+ {
+ return( false );
+ }
+ }
+ return( true );
+ }
+ else if( OperatorManager::isContainerElementAccess(
+ aCode->getOperator() ) )
+ {
+ if( aCode->first().is< BaseInstanceForm >() )
+ {
+ BaseTypeSpecifier * bts = aCode->first().
+ to_ptr< BaseInstanceForm >()->getTypeSpecifier();
+
+ return( bts->hasTypeContainer() &&
+ bts->as< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier().isTypedString() );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ else return( false );
+ }
+
+ else return( false );
+}
+
+
+
+bool ExpressionTypeChecker::isBoolean(const BF & anExpr, bool stronglyTypedFlag)
+{
+ if( anExpr.isBoolean() )
+ {
+ return( true );
+ }
+ else if( anExpr.is< BaseInstanceForm >() )
+ {
+ return( anExpr.to_ptr< BaseInstanceForm >()->isTypedBoolean() );
+ }
+ else if( anExpr.is< AvmCode >() )
+ {
+ AvmCode * aCode = anExpr.to_ptr< AvmCode >();
+
+ if( OperatorManager::isCtor( aCode->getOperator() ) )
+ {
+ return( aCode->first().is< BaseTypeSpecifier >() &&
+ aCode->first().to_ptr< BaseTypeSpecifier >()->
+ isTypedBoolean() );
+ }
+ else if( OperatorManager::isAssign( aCode->getOperator() ) )
+ {
+ if( aCode->first().is< BaseInstanceForm >() )
+ {
+ return(aCode->first().to_ptr< BaseInstanceForm >()
+ ->isTypedBoolean() );
+ }
+ else if( OperatorManager::isAssignBinary( aCode->getOperator() ) )
+ {
+ return( ExpressionTypeChecker::isBoolean(aCode->second(),
+ stronglyTypedFlag) );
+ }
+ return( false );
+ }
+ else if( OperatorManager::isRelational( aCode->getOperator() ) )
+ {
+ return( true );
+ }
+
+ else if( OperatorManager::isPropositional( aCode->getOperator() ) )
+ {
+ if( stronglyTypedFlag )
+ {
+ for(AvmCode::iterator it = aCode->begin() ; it != aCode->end() ; ++it)
+ {
+ if( not ExpressionTypeChecker::isBoolean( *it ) )
+ {
+ return( false );
+ }
+ }
+ }
+ return( true );
+ }
+
+ else if( OperatorManager::isContainerElementAccess(
+ aCode->getOperator() ) )
+ {
+ if( aCode->first().is< BaseInstanceForm >() )
+ {
+ BaseTypeSpecifier * bts = aCode->first().
+ to_ptr< BaseInstanceForm >()->getTypeSpecifier();
+
+ return( bts->hasTypeContainer() &&
+ bts->as< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier().isTypedBoolean() );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ else return( false );
+ }
+
+ else return( false );
+}
+
+
+bool ExpressionTypeChecker::isInteger(const BF & anExpr)
+{
+ if( anExpr.isWeakInteger() )
+ {
+ return( true );
+ }
+ else if( anExpr.is< BaseInstanceForm >() )
+ {
+ return( anExpr.to_ptr< BaseInstanceForm >()->weaklyTypedInteger() );
+ }
+ else if( anExpr.is< AvmCode >() )
+ {
+ AvmCode * aCode = anExpr.to_ptr< AvmCode >();
+
+ if( OperatorManager::isCtor( aCode->getOperator() ) )
+ {
+ return( aCode->first().is< BaseTypeSpecifier >() &&
+ aCode->first().to_ptr< BaseTypeSpecifier >()->
+ weaklyTypedInteger() );
+ }
+ else if( OperatorManager::isAssign( aCode->getOperator() ) )
+ {
+ if( aCode->first().is< BaseInstanceForm >() )
+ {
+ return( aCode->first().to_ptr< BaseInstanceForm >()
+ ->weaklyTypedInteger() );
+ }
+ else if( OperatorManager::isAssignBinary( aCode->getOperator() ) )
+ {
+ return( ExpressionTypeChecker::isInteger(aCode->second()) );
+ }
+ return( false );
+ }
+ else if( OperatorManager::isArithmetic( aCode->getOperator() ) )
+ {
+ for(AvmCode::iterator it = aCode->begin() ; it != aCode->end() ; ++it)
+ {
+ if( not ExpressionTypeChecker::isInteger( *it ) )
+ {
+ return( false );
+ }
+ }
+ return( true );
+ }
+ else if( OperatorManager::isCodomainInteger( aCode->getOperator() ) )
+ {
+ return( true );
+ }
+ else if( OperatorManager::isContainerElementAccess(
+ aCode->getOperator() ) )
+ {
+ if( aCode->first().is< BaseInstanceForm >() )
+ {
+ BaseTypeSpecifier * bts = aCode->first().
+ to_ptr< BaseInstanceForm >()->getTypeSpecifier();
+
+ return( bts->hasTypeContainer() &&
+ bts->as< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier().weaklyTypedInteger() );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ else return( false );
+ }
+
+ else return( false );
+}
+
+
+bool ExpressionTypeChecker::isRational(const BF & anExpr)
+{
+ if( anExpr.isWeakRational() )
+ {
+ return( true );
+ }
+ else if( anExpr.is< BaseInstanceForm >() )
+ {
+ return( anExpr.to_ptr< BaseInstanceForm >()->weaklyTypedRational() );
+ }
+ else if( anExpr.is< AvmCode >() )
+ {
+ AvmCode * aCode = anExpr.to_ptr< AvmCode >();
+
+ if( OperatorManager::isCtor( aCode->getOperator() ) )
+ {
+ return( aCode->first().is< BaseTypeSpecifier >() &&
+ aCode->first().to_ptr< BaseTypeSpecifier >()->
+ weaklyTypedRational() );
+ }
+ else if( OperatorManager::isAssign( aCode->getOperator() ) )
+ {
+ if( aCode->first().is< BaseInstanceForm >() )
+ {
+ return( aCode->first().to_ptr< BaseInstanceForm >()
+ ->weaklyTypedRational() );
+ }
+ else if( OperatorManager::isAssignBinary( aCode->getOperator() ) )
+ {
+ return( ExpressionTypeChecker::isRational(aCode->second()) );
+ }
+ return( false );
+ }
+ else if( OperatorManager::isArithmetic( aCode->getOperator() ) )
+ {
+ for(AvmCode::iterator it = aCode->begin() ; it != aCode->end() ; ++it)
+ {
+ if( not ExpressionTypeChecker::isRational( *it ) )
+ {
+ return( false );
+ }
+ }
+ return( true );
+ }
+ else if( OperatorManager::isCodomainRational( aCode->getOperator() ) )
+ {
+ return( true );
+ }
+ else if( OperatorManager::isContainerElementAccess(
+ aCode->getOperator() ) )
+ {
+ if( aCode->first().is< BaseInstanceForm >() )
+ {
+ BaseTypeSpecifier * bts = aCode->first().
+ to_ptr< BaseInstanceForm >()->getTypeSpecifier();
+
+ return( bts->hasTypeContainer() &&
+ bts->as< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier().weaklyTypedRational() );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ else return( false );
+ }
+
+ else return( false );
+}
+
+
+bool ExpressionTypeChecker::isFloat(const BF & anExpr)
+{
+ if( anExpr.isWeakFloat() )
+ {
+ return( true );
+ }
+ else if( anExpr.is< BaseInstanceForm >() )
+ {
+ return( anExpr.to_ptr< BaseInstanceForm >()->weaklyTypedFloat() );
+ }
+ else if( anExpr.is< AvmCode >() )
+ {
+ AvmCode * aCode = anExpr.to_ptr< AvmCode >();
+
+ if( OperatorManager::isCtor( aCode->getOperator() ) )
+ {
+ return( aCode->first().is< BaseTypeSpecifier >() &&
+ aCode->first().to_ptr< BaseTypeSpecifier >()->
+ weaklyTypedFloat() );
+ }
+ else if( OperatorManager::isAssign( aCode->getOperator() ) )
+ {
+ if( aCode->first().is< BaseInstanceForm >() )
+ {
+ return( aCode->first().to_ptr< BaseInstanceForm >()
+ ->weaklyTypedFloat() );
+ }
+ else if( OperatorManager::isAssignBinary( aCode->getOperator() ) )
+ {
+ return( ExpressionTypeChecker::isFloat(aCode->second()) );
+ }
+ return( false );
+ }
+ else if( OperatorManager::isArithmetic( aCode->getOperator() ) )
+ {
+ for(AvmCode::iterator it = aCode->begin() ; it != aCode->end() ; ++it)
+ {
+ if( not ExpressionTypeChecker::isFloat( *it ) )
+ {
+ return( false );
+ }
+ }
+ return( true );
+ }
+ else if( OperatorManager::isCodomainFloat( aCode->getOperator() ) )
+ {
+ return( true );
+ }
+ else if( OperatorManager::isContainerElementAccess(
+ aCode->getOperator() ) )
+ {
+ if( aCode->first().is< BaseInstanceForm >() )
+ {
+ BaseTypeSpecifier * bts = aCode->first().
+ to_ptr< BaseInstanceForm >()->getTypeSpecifier();
+
+ return( bts->hasTypeContainer() &&
+ bts->as< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier().weaklyTypedFloat() );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ else return( false );
+ }
+
+ else return( false );
+}
+
+
+bool ExpressionTypeChecker::isReal(const BF & anExpr)
+{
+ if( anExpr.isWeakReal() )
+ {
+ return( true );
+ }
+ else if( anExpr.is< BaseInstanceForm >() )
+ {
+ return( anExpr.to_ptr< BaseInstanceForm >()->weaklyTypedReal() );
+ }
+ else if( anExpr.is< AvmCode >() )
+ {
+ AvmCode * aCode = anExpr.to_ptr< AvmCode >();
+
+ if( OperatorManager::isCtor( aCode->getOperator() ) )
+ {
+ return( aCode->first().is< BaseTypeSpecifier >() &&
+ aCode->first().to_ptr< BaseTypeSpecifier >()->
+ weaklyTypedReal() );
+ }
+ else if( OperatorManager::isAssign( aCode->getOperator() ) )
+ {
+ if( aCode->first().is< BaseInstanceForm >() )
+ {
+ return( aCode->first().to_ptr<
+ BaseInstanceForm >()->weaklyTypedReal() );
+ }
+ else if( OperatorManager::isAssignBinary( aCode->getOperator() ) )
+ {
+ return( ExpressionTypeChecker::isReal(aCode->second()) );
+ }
+ return( false );
+ }
+ else if( OperatorManager::isArithmetic( aCode->getOperator() ) )
+ {
+ for(AvmCode::iterator it = aCode->begin() ; it != aCode->end() ; ++it)
+ {
+ if( not ExpressionTypeChecker::isReal( *it ) )
+ {
+ return( false );
+ }
+ }
+ return( true );
+ }
+ else if( OperatorManager::isCodomainReal( aCode->getOperator() ) )
+ {
+ return( true );
+ }
+ else if( OperatorManager::isContainerElementAccess(
+ aCode->getOperator() ) )
+ {
+ if( aCode->first().is< BaseInstanceForm >() )
+ {
+ BaseTypeSpecifier * bts = aCode->first().
+ to_ptr< BaseInstanceForm >()->getTypeSpecifier();
+
+ return( bts->hasTypeContainer() &&
+ bts->as< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier().weaklyTypedReal() );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ else return( false );
+ }
+
+ else return( false );
+}
+
+
+bool ExpressionTypeChecker::isOperator(const BF & anExpr)
+{
+ if( anExpr.is< Operator >() )
+ {
+ return( true );
+ }
+ else if( anExpr.is< BaseInstanceForm >() )
+ {
+ return( ExpressionTypeChecker::weaklyTyped(TypeManager::OPERATOR,
+ anExpr.to_ptr< BaseInstanceForm >()->getTypeSpecifier()) );
+ }
+
+ else return( false );
+}
+
+
+bool ExpressionTypeChecker::isAvmCode(const BF & anExpr)
+{
+ if( anExpr.is< AvmCode >() )
+ {
+ return( true );
+ }
+
+ else if( anExpr.is< BaseInstanceForm >() )
+ {
+ return( ExpressionTypeChecker::weaklyTyped(TypeManager::AVMCODE,
+ anExpr.to_ptr< BaseInstanceForm >()->getTypeSpecifier()) );
+ }
+
+ else return( false );
+}
+
+
+bool ExpressionTypeChecker::isCtor(
+ BaseTypeSpecifier * refTypeSpecifier, AvmCode * aCode)
+{
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT(
+ OperatorManager::isCtor( aCode->getOperator() ) )
+ << "Unexpected ctor< ? >( ? ) expression :> "
+ << IGNORE_FIRST_TAB << aCode
+ << SEND_EXIT;
+
+ return( aCode->first().is< BaseTypeSpecifier >() &&
+ ExpressionTypeChecker::weaklyTyped(refTypeSpecifier,
+ aCode->first().to_ptr< BaseTypeSpecifier >()) );
+}
+
+
+bool ExpressionTypeChecker::isNewfresh(
+ BaseTypeSpecifier * refTypeSpecifier, AvmCode * aCode)
+{
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT(
+ OperatorManager::isNewfresh( aCode->getOperator() ) )
+ << "Unexpected newfresh( ? ) expression :> "
+ << IGNORE_FIRST_TAB << aCode
+ << SEND_EXIT;
+
+ return( aCode->first().is< BaseInstanceForm >() &&
+ ExpressionTypeChecker::weaklyTyped(refTypeSpecifier,
+ aCode->first().to_ptr< BaseInstanceForm >()->getTypeSpecifier()) );
+}
+
+
+bool ExpressionTypeChecker::isTyped(BaseTypeSpecifier * refTypeSpecifier,
+ BaseTypeSpecifier * aTypeSpecifier)
+{
+ if( refTypeSpecifier == aTypeSpecifier )
+ {
+ return( true );
+ }
+
+ while( true )
+ {
+ if( refTypeSpecifier->is< TypeAliasSpecifier >() )
+ {
+ refTypeSpecifier = refTypeSpecifier->
+ to< TypeAliasSpecifier >()->targetTypeSpecifier();
+ }
+ else if( refTypeSpecifier->is< IntervalTypeSpecifier >() )
+ {
+ refTypeSpecifier = refTypeSpecifier->
+ to< IntervalTypeSpecifier >()->getSupportTypeSpecifier();
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ while( true )
+ {
+ if( aTypeSpecifier->is< TypeAliasSpecifier >() )
+ {
+ aTypeSpecifier = aTypeSpecifier->
+ to< TypeAliasSpecifier >()->targetTypeSpecifier();
+ }
+ else if( aTypeSpecifier->is< IntervalTypeSpecifier >() )
+ {
+ aTypeSpecifier = aTypeSpecifier->
+ to< IntervalTypeSpecifier >()->getSupportTypeSpecifier();
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ if( refTypeSpecifier == aTypeSpecifier )
+ {
+ return( true );
+ }
+
+
+// else if( refTypeSpecifier->isTypeSpecifierKind( aTypeSpecifier ) )
+// {
+// return( true );
+// }
+
+ return( false );
+}
+
+
+
+bool ExpressionTypeChecker::isTyped(
+ BaseTypeSpecifier * refTypeSpecifier, const BF & arg)
+{
+ while( true )
+ {
+ if( refTypeSpecifier->is< TypeAliasSpecifier >() )
+ {
+ refTypeSpecifier = refTypeSpecifier->
+ to< TypeAliasSpecifier >()->targetTypeSpecifier();
+ }
+ else if( refTypeSpecifier->is< IntervalTypeSpecifier >() )
+ {
+ refTypeSpecifier = refTypeSpecifier->
+ to< IntervalTypeSpecifier >()->getSupportTypeSpecifier();
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ if( refTypeSpecifier->hasTypedClockTime() )
+ {
+ if( refTypeSpecifier->is< ContainerTypeSpecifier >() )
+ {
+ refTypeSpecifier = refTypeSpecifier->
+ to< ContainerTypeSpecifier >()->getContentsTypeSpecifier();
+ }
+ }
+
+ if( arg.is< BaseInstanceForm >() )
+ {
+ return( ExpressionTypeChecker::weaklyTyped(refTypeSpecifier,
+ arg.to_ptr< BaseInstanceForm >()->getTypeSpecifier()) );
+ }
+
+ else if( ExpressionTypeChecker::isCtor(arg) )
+ {
+ return( ExpressionTypeChecker::isCtor(
+ refTypeSpecifier, arg.to_ptr< AvmCode >() ) );
+ }
+
+ else if( ExpressionTypeChecker::isNewfresh(arg) )
+ {
+ return( ExpressionTypeChecker::isNewfresh(
+ refTypeSpecifier, arg.to_ptr< AvmCode >() ) );
+ }
+
+ switch( refTypeSpecifier->getTypeSpecifierKind() )
+ {
+ case TYPE_BOOLEAN_SPECIFIER:
+ {
+ return( ExpressionTypeChecker::isBoolean(arg) );
+ }
+
+ case TYPE_CHARACTER_SPECIFIER:
+ {
+ return( ExpressionTypeChecker::isCharacter(arg) );
+ }
+
+ case TYPE_STRING_SPECIFIER:
+ {
+ return( ExpressionTypeChecker::isString(arg) );
+ }
+
+ case TYPE_INTEGER_SPECIFIER:
+ case TYPE_UINTEGER_SPECIFIER:
+ case TYPE_POS_INTEGER_SPECIFIER:
+ {
+ return( ExpressionTypeChecker::isInteger(arg) );
+ }
+
+ case TYPE_RATIONAL_SPECIFIER:
+ case TYPE_URATIONAL_SPECIFIER:
+ {
+ return( ExpressionTypeChecker::isRational(arg) );
+ }
+
+ case TYPE_FLOAT_SPECIFIER:
+ case TYPE_UFLOAT_SPECIFIER:
+ {
+ return( ExpressionTypeChecker::isFloat(arg) );
+ }
+
+ case TYPE_REAL_SPECIFIER:
+ case TYPE_UREAL_SPECIFIER:
+ {
+ return( ExpressionTypeChecker::isReal(arg) );
+ }
+
+
+ case TYPE_INTERVAL_SPECIFIER:
+ {
+ return( ExpressionTypeChecker::isTyped( refTypeSpecifier->to<
+ IntervalTypeSpecifier >()->getSupportTypeSpecifier(), arg) );
+ }
+
+
+ case TYPE_CLOCK_SPECIFIER:
+ {
+ return( ExpressionTypeChecker::isClock(arg) );
+ }
+
+ case TYPE_TIME_SPECIFIER:
+ {
+ return( ExpressionTypeChecker::isTime(arg) );
+ }
+ case TYPE_CONTINUOUS_TIME_SPECIFIER:
+ {
+ return( ExpressionTypeChecker::isCTime(arg) );
+ }
+ case TYPE_DISCRETE_TIME_SPECIFIER:
+ {
+ return( ExpressionTypeChecker::isDTime(arg) );
+ }
+
+
+ case TYPE_MACHINE_SPECIFIER:
+ {
+ return( ExpressionTypeChecker::isMachine(arg) );
+ }
+
+ case TYPE_PORT_SPECIFIER:
+ {
+ return( ExpressionTypeChecker::isPort(arg) );
+ }
+
+ case TYPE_BUFFER_SPECIFIER:
+ {
+ return( ExpressionTypeChecker::isBuffer(arg) );
+ }
+
+ case TYPE_MESSAGE_SPECIFIER:
+ {
+ return( ExpressionTypeChecker::isMessage(arg) );
+ }
+
+
+ case TYPE_OPERATOR_SPECIFIER:
+ {
+ return( ExpressionTypeChecker::isOperator(arg) );
+ }
+
+ case TYPE_AVMCODE_SPECIFIER:
+ {
+ return( ExpressionTypeChecker::isAvmCode(arg) );
+ }
+
+ case TYPE_ENUM_SPECIFIER:
+ {
+ return( ExpressionTypeChecker::isEnum(
+ refTypeSpecifier->to< EnumTypeSpecifier >(), arg) );
+ }
+
+ case TYPE_ARRAY_SPECIFIER:
+ {
+ return( ExpressionTypeChecker::isArray(
+ refTypeSpecifier->to< ContainerTypeSpecifier >(), arg) );
+ }
+
+ case TYPE_CLASS_SPECIFIER:
+ {
+ return( ExpressionTypeChecker::isClass(
+ refTypeSpecifier->to< ClassTypeSpecifier >(), arg) );
+ }
+
+ case TYPE_UNIVERSAL_SPECIFIER:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ if( refTypeSpecifier->hasTypeCollection() )
+ {
+ return( ExpressionTypeChecker::isCollection(
+ refTypeSpecifier->to< ContainerTypeSpecifier >(), arg) );
+ }
+
+ else if( arg.is< AvmCode >() )
+ {
+
+ }
+
+ return( false );
+ }
+ }
+
+ return( true );
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/expression/ExpressionTypeChecker.h b/org.eclipse.efm.symbex/src/fml/expression/ExpressionTypeChecker.h
new file mode 100644
index 0000000..982cba9
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/ExpressionTypeChecker.h
@@ -0,0 +1,256 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 18 sept. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef EXPRESSIONTYPECHECKER_H_
+#define EXPRESSIONTYPECHECKER_H_
+
+#include <common/BF.h>
+
+#include <fml/executable/BaseInstanceForm.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/lib/ITypeSpecifier.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/runtime/RuntimeID.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+
+
+namespace sep
+{
+
+
+class Element;
+class ContainerTypeSpecifier;
+class ClassTypeSpecifier;
+class EnumTypeSpecifier;
+
+
+class ExpressionTypeChecker
+{
+public:
+
+ static bool isFinalSymbolicBasicSymbol(const BF & anElement);
+
+ static bool isFinalSymbolicCompositeSymbol(const BF & anElement);
+
+ static bool isFinalSymbolicCompositeSymbol(BuiltinArray * arrayForm);
+
+ inline static bool isFinalSymbolicSymbol(const BF & anElement)
+ {
+ return( isFinalSymbolicBasicSymbol(anElement) ||
+ isFinalSymbolicCompositeSymbol(anElement) );
+ }
+
+
+ inline static bool isMacro(const BF & anExpr)
+ {
+ return( (anExpr.is< BaseInstanceForm >() &&
+ anExpr.to_ptr< BaseInstanceForm >()->getModifier().hasNatureMacro()) ||
+ (anExpr.is< AvmCode >() &&
+ isMacro(anExpr.to_ptr< AvmCode >())) );
+ }
+
+ inline static bool isMacro(AvmCode * aCode)
+ {
+ return( OperatorManager::isQuote( aCode->getOperator() ) );
+ }
+
+
+ static bool isMachine(const BF & anExpr);
+
+ inline static bool isPort(const BF & anExpr)
+ {
+ return( anExpr.is< BaseInstanceForm >() &&
+ anExpr.to_ptr< BaseInstanceForm >()->isTypedPort() );
+ }
+
+ inline static bool isBuffer(const BF & anExpr)
+ {
+ return( anExpr.is< BaseInstanceForm >() &&
+ anExpr.to_ptr< BaseInstanceForm >()->isTypedBuffer() );
+ }
+
+ inline static bool isMessage(const BF & anExpr)
+ {
+ return( anExpr.is< BaseInstanceForm >() &&
+ anExpr.to_ptr< BaseInstanceForm >()->isTypedMessage() );
+ }
+
+
+ inline static bool isEnumeration(const BF & anExpr)
+ {
+ return( isEnum(anExpr) || isCharacter(anExpr) || isBoolean(anExpr) );
+ }
+
+ static bool isArray(
+ ContainerTypeSpecifier * refTypeSpecifier, const BF & anExpr);
+
+ static bool isClass(
+ ClassTypeSpecifier * refTypeSpecifier, const BF & anExpr);
+
+ static bool isCollection(
+ ContainerTypeSpecifier * refTypeSpecifier, const BF & anExpr);
+
+ static bool isVector(const BF & anExpr);
+
+
+ static bool isEnum(
+ EnumTypeSpecifier * refTypeSpecifier, const BF & anExpr);
+
+ static bool isEnum(const BF & anExpr);
+
+ static bool isCharacter(const BF & anExpr);
+
+ static bool isString(const BF & anExpr);
+
+
+ static bool isBoolean(const BF & anExpr, bool stronglyTypedFlag = true);
+
+ inline static bool isNumeric(const BF & anExpr)
+ {
+ return( isReal(anExpr) || isEnum(anExpr) );
+// || isFloat(anExpr) || isRational(anExpr) || isInteger(anExpr) );
+ }
+
+ static bool isInteger(const BF & anExpr);
+
+ static bool isRational(const BF & anExpr);
+
+ static bool isFloat(const BF & anExpr);
+
+ static bool isReal(const BF & anExpr);
+
+
+ static bool isOperator(const BF & anExpr);
+
+ static bool isAvmCode(const BF & anExpr);
+
+
+ inline static bool isClock(const BF & anExpr)
+ {
+ return( isReal(anExpr) );
+ }
+
+ inline static bool isTime(const BF & anExpr)
+ {
+ return( isReal(anExpr) );
+ }
+
+ inline static bool isCTime(const BF & anExpr)
+ {
+ return( isReal(anExpr) );
+ }
+
+ inline static bool isDTime(const BF & anExpr)
+ {
+ return( isInteger(anExpr) );
+ }
+
+
+ inline static bool isCtor(const BF & anExpr)
+ {
+ return( anExpr.is< AvmCode >() &&
+ isCtor(anExpr.to_ptr< AvmCode >()) );
+ }
+
+ inline static bool isCtor(AvmCode * aCode)
+ {
+ return( OperatorManager::isCtor( aCode->getOperator() ) );
+ }
+
+ static bool isCtor(BaseTypeSpecifier * refTypeSpecifier, AvmCode * aCode);
+
+
+ inline static bool isNewfresh(const BF & anExpr)
+ {
+ return( anExpr.is< AvmCode >() &&
+ isNewfresh(anExpr.to_ptr< AvmCode >()) );
+ }
+
+ inline static bool isNewfresh(AvmCode * aCode)
+ {
+ return( OperatorManager::isNewfresh( aCode->getOperator() ) );
+ }
+
+ static bool isNewfresh(BaseTypeSpecifier * refTypeSpecifier, AvmCode * aCode);
+
+
+ inline static bool isLookup(const BF & anExpr)
+ {
+ return( anExpr.is< AvmCode >() &&
+ isLookup(anExpr.to_ptr< AvmCode >()) );
+ }
+
+ inline static bool isLookup(AvmCode * aCode)
+ {
+ return( OperatorManager::isLookup( aCode->getOperator() ) );
+ }
+
+
+ inline static bool isLookup1D(const BF & anExpr)
+ {
+ return( anExpr.is< AvmCode >() &&
+ isLookup1D(anExpr.to_ptr< AvmCode >()) );
+ }
+
+ inline static bool isLookup1D(AvmCode * aCode)
+ {
+ return( OperatorManager::isLookup1D( aCode->getOperator() ) );
+ }
+
+
+ inline static bool isLookup2D(const BF & anExpr)
+ {
+ return( anExpr.is< AvmCode >() &&
+ isLookup2D(anExpr.to_ptr< AvmCode >()) );
+ }
+
+ inline static bool isLookup2D(AvmCode * aCode)
+ {
+ return( OperatorManager::isLookup2D( aCode->getOperator() ) );
+ }
+
+
+ static bool isTyped(BaseTypeSpecifier * refTypeSpecifier,
+ BaseTypeSpecifier * aTypeSpecifier);
+
+
+ inline static bool weaklyTyped(BaseTypeSpecifier * refTypeSpecifier,
+ BaseTypeSpecifier * aTypeSpecifier)
+ {
+ if( isTyped(refTypeSpecifier, aTypeSpecifier) )
+ {
+ return( true );
+ }
+ else
+ {
+ return( refTypeSpecifier->weaklyTyped(
+ aTypeSpecifier->getTypeSpecifierKind()) );
+ }
+ }
+
+
+ static bool isTyped(BaseTypeSpecifier * refTypeSpecifier, const BF & arg);
+
+
+};
+
+}
+
+#endif /* EXPRESSIONTYPECHECKER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/expression/README.md b/org.eclipse.efm.symbex/src/fml/expression/README.md
new file mode 100644
index 0000000..7e97c52
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/README.md
@@ -0,0 +1,13 @@
+# EFM-SYMBEX : Expression
+
+## Source code structure
+
+### Interfaces
+* **IExpression**
+
+### Classes
+* **ExpressionImpl**
+
+### Factories
+* **Expression** as Smart Pointer
+
diff --git a/org.eclipse.efm.symbex/src/fml/expression/StatementConstructor.cpp b/org.eclipse.efm.symbex/src/fml/expression/StatementConstructor.cpp
new file mode 100644
index 0000000..722fc53
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/StatementConstructor.cpp
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 23 sept. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "StatementConstructor.h"
+
+namespace sep
+{
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/expression/StatementConstructor.h b/org.eclipse.efm.symbex/src/fml/expression/StatementConstructor.h
new file mode 100644
index 0000000..351cb8d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/StatementConstructor.h
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 23 sept. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef STATEMENTCONSTRUCTOR_H_
+#define STATEMENTCONSTRUCTOR_H_
+
+#include <fml/expression/AvmCodeFactory.h>
+
+
+namespace sep
+{
+
+class StatementConstructor : public AvmCodeFactory
+{
+
+public:
+ /**
+ * NOP STATEMENT
+ */
+ inline static BFCode nopCode()
+ {
+ return( StatementConstructor::newCode( OperatorManager::OPERATOR_NOP ) );
+ }
+
+
+
+};
+
+
+}
+
+#endif /* STATEMENTCONSTRUCTOR_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/expression/StatementFactory.cpp b/org.eclipse.efm.symbex/src/fml/expression/StatementFactory.cpp
new file mode 100644
index 0000000..a5d9052
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/StatementFactory.cpp
@@ -0,0 +1,391 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 23 sept. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "StatementFactory.h"
+
+#include <fml/executable/AvmProgram.h>
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/ExecutableLib.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/runtime/ExecutionData.h>
+
+
+namespace sep
+{
+
+
+/**
+ * COLLECT
+ * [state]machine
+ */
+void StatementFactory::collectRunMachine(ExecutableForm * anExecutableForm,
+ const BF & aStatement, ListOfInstanceOfMachine & listOfMachine)
+{
+ switch( aStatement.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ AvmCode* aCode = aStatement.to_ptr< AvmCode >();
+
+ switch( aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_RUN:
+
+// case AVM_OPCODE_RESUME:
+// case AVM_OPCODE_RESTART:
+ case AVM_OPCODE_START:
+ {
+ if( aCode->first().is< InstanceOfMachine >() )
+ {
+ listOfMachine.add_union(
+ aCode->first().to_ptr< InstanceOfMachine >() );
+ }
+ break;
+ }
+
+ default:
+ {
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator itEnd = aCode->end();
+ for( ; it != itEnd ; ++it )
+ {
+ collectRunMachine(anExecutableForm, (*it), listOfMachine);
+ }
+
+ break;
+ }
+ }
+
+ break;
+ }
+
+ case FORM_INSTANCE_MACHINE_KIND:
+ {
+// listOfMachine.add_union( aStatement.to_ptr< InstanceOfMachine >() );
+
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+}
+
+
+void StatementFactory::collectActivityMachine(
+ ExecutableForm * anExecutableForm, AVM_OPCODE opCode,
+ const BF & aStatement, ListOfInstanceOfMachine & listOfMachine)
+{
+ switch( aStatement.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ AvmCode* aCode = aStatement.to_ptr< AvmCode >();
+
+ if( aCode->isOpCode(opCode) )
+ {
+ if( aCode->first().is< InstanceOfMachine >() )
+ {
+ listOfMachine.add_union(
+ aCode->first().to_ptr< InstanceOfMachine >() );
+ }
+ }
+ else
+ {
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator itEnd = aCode->end();
+ for( ; it != itEnd ; ++it )
+ {
+ collectActivityMachine(
+ anExecutableForm, opCode, (*it), listOfMachine);
+ }
+ }
+
+ break;
+ }
+
+ case FORM_INSTANCE_MACHINE_KIND:
+ {
+// listOfMachine.add_union( aStatement.to_ptr< InstanceOfMachine >() );
+
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+}
+
+
+void StatementFactory::collectActivityMachine(ExecutableForm * anExecutableForm,
+ AVM_OPCODE opCode1, AVM_OPCODE opCode2,
+ const BF & aStatement, ListOfInstanceOfMachine & listOfMachine)
+{
+ switch( aStatement.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ AvmCode* aCode = aStatement.to_ptr< AvmCode >();
+
+ if( aCode->isOpCode(opCode1) || aCode->isOpCode(opCode2) )
+ {
+ if( aCode->first().is< InstanceOfMachine >() )
+ {
+ listOfMachine.add_union(
+ aCode->first().to_ptr< InstanceOfMachine >() );
+ }
+ }
+ else
+ {
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator itEnd = aCode->end();
+ for( ; it != itEnd ; ++it )
+ {
+ collectActivityMachine(anExecutableForm,
+ opCode1, opCode2, (*it), listOfMachine);
+ }
+ }
+
+ break;
+ }
+
+ case FORM_INSTANCE_MACHINE_KIND:
+ {
+// listOfMachine.add_union( aStatement.to_ptr< InstanceOfMachine >() );
+
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+}
+
+
+/**
+ * COLLECT
+ * Transition
+ */
+void StatementFactory::collectInvokeTransition(ExecutableForm * anExecutableForm,
+ const BF & aStatement, ListOfAvmTransition & listOfTransition)
+{
+ switch( aStatement.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ AvmCode* aCode = aStatement.to_ptr< AvmCode >();
+
+ switch( aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_INVOKE_TRANSITION:
+ {
+ if( aCode->first().is< AvmTransition >() )
+ {
+ listOfTransition.add_union(
+ aCode->first().to_ptr< AvmTransition >() );
+ }
+ break;
+ }
+
+ case AVM_OPCODE_SCHEDULE_INVOKE:
+ {
+ if( aCode->empty() )
+ {
+ collectInvokeTransition(anExecutableForm,
+ anExecutableForm->getOnSchedule(),
+ listOfTransition );
+ }
+ break;
+ }
+
+ default:
+ {
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator itEnd = aCode->end();
+ for( ; it != itEnd ; ++it )
+ {
+ collectInvokeTransition(
+ anExecutableForm, (*it), listOfTransition);
+ }
+
+ break;
+ }
+ }
+
+ break;
+ }
+
+
+ case FORM_AVMTRANSITION_KIND:
+ {
+// listOfTransition.add_union( aStatement.to_ptr< AvmTransition >() );
+
+ break;
+ }
+
+
+ default:
+ {
+ break;
+ }
+ }
+}
+
+
+
+/**
+ * COLLECT
+ * RID
+ */
+void StatementFactory::collectRID(const BF & aStatement,
+ List< RuntimeID > & listOfRID)
+{
+ switch( aStatement.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ AvmCode::iterator it = aStatement.to_ptr< AvmCode >()->begin();
+ AvmCode::iterator itEnd = aStatement.to_ptr< AvmCode >()->end();
+ for( ; it != itEnd ; ++it )
+ {
+ collectRID((*it), listOfRID);
+ }
+
+ break;
+ }
+
+ case FORM_RUNTIME_ID_KIND:
+ {
+ listOfRID.add_union( aStatement.bfRID() );
+
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+}
+
+
+
+/**
+ * CONTAINS
+ * Activity on RID
+ */
+bool StatementFactory::containsOperationOnRID(AvmCode * aCode,
+ const AVM_OPCODE opActivity, const RuntimeID & aRID)
+{
+ if( aCode->nonempty() )
+ {
+ AvmCode::iterator it = aCode->begin();
+
+ if( aCode->isOpCode(opActivity) && ((aRID == (*it))
+ /*|| aCode->contains(aRID)*/) )
+ {
+ return( true );
+ }
+
+ AvmCode::iterator itEnd = aCode->end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it).is< AvmCode >() && containsOperationOnRID(
+ (*it).to_ptr< AvmCode >(), opActivity, aRID) )
+ {
+ return( true );
+ }
+ }
+ }
+
+ return( false );
+}
+
+
+/**
+ * get activity
+ * ExecutableForm
+ * or
+ * RuntimeID
+ */
+ExecutableForm * StatementFactory::getActivityTargetExecutable(
+ AvmProgram * anAvmProgram, AvmCode * aCode)
+{
+// AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( aCode ) << "AvmCode !!!"
+// << SEND_EXIT;
+
+ if( aCode->empty() )
+ {
+ return( anAvmProgram->getExecutable() );
+ }
+ else // if( aCode->singleton() )
+ {
+ if( aCode->first() == ExecutableLib::MACHINE_SELF )
+ {
+ return( anAvmProgram->getExecutable() );
+ }
+ else if( aCode->first().is< InstanceOfMachine >() )
+ {
+ return( aCode->first().to_ptr< InstanceOfMachine >()
+ ->getExecutable() );
+ }
+ else if( aCode->first().is< RuntimeID >() )
+ {
+ return( aCode->first().as_bf< RuntimeID >().getExecutable() );
+ }
+ }
+
+ return( NULL );
+}
+
+
+const RuntimeID & StatementFactory::getActivityTargetRID(
+ const ExecutionData & anED, const RuntimeID & aRID, AvmCode * aCode)
+{
+ if( aCode->empty() )
+ {
+ return( aRID );
+ }
+ else // if( aCode->singleton() )
+ {
+ if( aCode->first() == ExecutableLib::MACHINE_SELF )
+ {
+ return( aRID );
+ }
+ else if( aCode->first().is< RuntimeID >() )
+ {
+ return( aCode->first().as_bf< RuntimeID >() );
+ }
+ else if( aCode->first().is< InstanceOfMachine >() )
+ {
+ return( anED.getRuntimeID(
+ aCode->first().to_ptr< InstanceOfMachine >()) );
+ }
+ }
+
+ return( RuntimeID::REF_NULL );
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/expression/StatementFactory.h b/org.eclipse.efm.symbex/src/fml/expression/StatementFactory.h
new file mode 100644
index 0000000..322c9cd
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/StatementFactory.h
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 23 sept. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef STATEMENTFACTORY_H_
+#define STATEMENTFACTORY_H_
+
+#include <collection/Typedef.h>
+
+#include <fml/executable/AvmTransition.h>
+#include <fml/executable/ExecutableLib.h>
+#include <fml/executable/InstanceOfMachine.h>
+
+#include <fml/operator/OperatorLib.h>
+
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+class AvmCode;
+class AvmProgram;
+class ExecutableForm;
+class ExecutionData;
+class Operator;
+
+
+class StatementFactory
+{
+
+public:
+
+ /**
+ * COLLECT
+ * [state]machine
+ */
+ static void collectRunMachine(ExecutableForm * anExecutableForm,
+ const BF & aStatement, ListOfInstanceOfMachine & listOfMachine);
+
+ static void collectActivityMachine(
+ ExecutableForm * anExecutableForm, AVM_OPCODE opCode,
+ const BF & aStatement, ListOfInstanceOfMachine & listOfMachine);
+
+ static void collectActivityMachine(ExecutableForm * anExecutableForm,
+ AVM_OPCODE opCode1, AVM_OPCODE opCode2,
+ const BF & aStatement, ListOfInstanceOfMachine & listOfMachine);
+
+
+ /**
+ * COLLECT
+ * Transition
+ */
+ static void collectInvokeTransition(ExecutableForm * anExecutableForm,
+ const BF & aStatement, ListOfAvmTransition & listOfTransition);
+
+
+ /**
+ * COLLECT
+ * RID
+ */
+ static void collectRID(const BF & aStatement,
+ List< RuntimeID > & listOfRID);
+
+
+ /**
+ * CONTAINS
+ * Activity on RID
+ */
+ static bool containsOperationOnRID(AvmCode * aCode,
+ const AVM_OPCODE opActivity, const RuntimeID & aRID);
+
+
+ /**
+ * is activity statement is
+ * void
+ * or
+ * singleton const::machine#self
+ */
+ inline static bool isActivityOnSelf(AvmCode * aCode)
+ {
+// AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( aCode ) << "AvmCode" ); !!!"
+// << SEND_EXIT;
+
+ return( aCode->empty() || (aCode->singleton() &&
+ aCode->first() == ExecutableLib::MACHINE_SELF) );
+ }
+
+
+ /**
+ * get activity
+ * ExecutableForm
+ * or
+ * RuntimeID
+ */
+ static ExecutableForm * getActivityTargetExecutable(
+ AvmProgram * anAvmProgram, AvmCode * aCode);
+
+
+ static const RuntimeID & getActivityTargetRID(
+ const ExecutionData & anED,
+ const RuntimeID & aRID, AvmCode * aCode);
+
+
+};
+
+
+}
+
+#endif /* STATEMENTFACTORY_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/expression/StatementTypeChecker.cpp b/org.eclipse.efm.symbex/src/fml/expression/StatementTypeChecker.cpp
new file mode 100644
index 0000000..2b58e07
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/StatementTypeChecker.cpp
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 25 sept. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "StatementTypeChecker.h"
+
+
+namespace sep
+{
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/expression/StatementTypeChecker.h b/org.eclipse.efm.symbex/src/fml/expression/StatementTypeChecker.h
new file mode 100644
index 0000000..9e09238
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/expression/StatementTypeChecker.h
@@ -0,0 +1,239 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 25 sept. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef STATEMENTTYPECHECKER_H_
+#define STATEMENTTYPECHECKER_H_
+
+#include <common/BF.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/operator/OperatorManager.h>
+
+
+namespace sep
+{
+
+
+class Element;
+
+
+class StatementTypeChecker
+{
+
+public:
+
+ ////////////////////////////////////////////////////////////////////////////
+ // KIND CHECKER
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static bool isStructured(const BF & aCode)
+ {
+ return( aCode.is< AvmCode >() &&
+ isStructured(aCode.to_ptr< AvmCode >()) );
+ }
+
+ inline static bool isStructured(AvmCode * aCode)
+ {
+ return( OperatorManager::isSchedule( aCode->getOperator() ) ||
+ OperatorManager::isConditionnal( aCode->getOperator() ) );
+ }
+
+
+ inline static bool isAssign(const BF & aCode)
+ {
+ return( aCode.is< AvmCode >() &&
+ isAssign(aCode.to_ptr< AvmCode >()) );
+ }
+
+ inline static bool isAssign(AvmCode * aCode)
+ {
+ return( OperatorManager::isAssign( aCode->getOperator() ) );
+ }
+
+
+ inline static bool isSequence(const BF & aCode)
+ {
+ return( aCode.is< AvmCode >() &&
+ isSequence(aCode.to_ptr< AvmCode >()) );
+ }
+
+ inline static bool isSequence(AvmCode * aCode)
+ {
+ return( OperatorManager::isSequence( aCode->getOperator() ) );
+ }
+
+
+ inline static bool isSchedule(const BF & aCode)
+ {
+ return( aCode.is< AvmCode >() &&
+ isSchedule(aCode.to_ptr< AvmCode >()) );
+ }
+
+ inline static bool isSchedule(AvmCode * aCode)
+ {
+ return( OperatorManager::isSchedule( aCode->getOperator() ) );
+ }
+
+
+ inline static bool isMachine(const BF & aCode)
+ {
+ return( aCode.is< AvmCode >() &&
+ isMachine(aCode.to_ptr< AvmCode >()) );
+ }
+
+ inline static bool isMachine(AvmCode * aCode)
+ {
+ return( OperatorManager::isMachine( aCode->getOperator() ) );
+ }
+
+
+ inline static bool isActivity(const BF & aCode)
+ {
+ return( aCode.is< AvmCode >() &&
+ isActivity(aCode.to_ptr< AvmCode >()) );
+ }
+
+ inline static bool isActivity(AvmCode * aCode)
+ {
+ return( OperatorManager::isActivity( aCode->getOperator() ) );
+ }
+
+
+ inline static bool isInvokeNew(const BF & aCode)
+ {
+ return( aCode.is< AvmCode >() &&
+ isInvokeNew(aCode.to_ptr< AvmCode >()) );
+ }
+
+ inline static bool isInvokeNew(AvmCode * aCode)
+ {
+ return( aCode->getOperator() == OperatorManager::OPERATOR_INVOKE_NEW );
+ }
+
+
+ inline static bool isCommunication(const BF & aCode)
+ {
+ return( aCode.is< AvmCode >() &&
+ isCommunication(aCode.to_ptr< AvmCode >()) );
+ }
+
+ inline static bool isCommunication(AvmCode * aCode)
+ {
+ return( OperatorManager::isCommunication( aCode->getOperator() ) );
+ }
+
+
+ inline static bool isConditionnal(const BF & aCode)
+ {
+ return( aCode.is< AvmCode >() &&
+ isConditionnal(aCode.to_ptr< AvmCode >()) );
+ }
+
+ inline static bool isConditionnal(AvmCode * aCode)
+ {
+ return( OperatorManager::isConditionnal( aCode->getOperator() ) );
+ }
+
+
+ inline static bool isStatement(const BF & aCode)
+ {
+ return( aCode.is< AvmCode >() &&
+ isStatement(aCode.to_ptr< AvmCode >()) );
+ }
+
+ inline static bool isStatement(AvmCode * aCode)
+ {
+ return( OperatorManager::isStatement( aCode->getOperator() ) );
+ }
+
+
+ inline static bool isAtomicStatement(const BF & aCode)
+ {
+ return( aCode.is< AvmCode >() &&
+ isAtomicStatement(aCode.to_ptr< AvmCode >()) );
+ }
+
+ inline static bool isAtomicStatement(AvmCode * aCode)
+ {
+ return( OperatorManager::isAtomicStatement( aCode->getOperator() ) );
+ }
+
+
+ inline static bool isAtomicSequence(const BF & aCode)
+ {
+ return( aCode.is< AvmCode >() &&
+ isAtomicSequence(aCode.to_ptr< AvmCode >()) );
+ }
+
+ inline static bool isAtomicSequence(AvmCode * aCode)
+ {
+ return( aCode->isOpCode( AVM_OPCODE_ATOMIC_SEQUENCE ) );
+ }
+
+
+ inline static bool isStrongAtomicSequence(const BF & aCode)
+ {
+ return( aCode.is< AvmCode >() &&
+ isStrongAtomicSequence(aCode.to_ptr< AvmCode >()) );
+ }
+
+ inline static bool isStrongAtomicSequence(AvmCode * aCode)
+ {
+ return( aCode->isOpCode( AVM_OPCODE_ATOMIC_SEQUENCE ) &&
+ (aCode->empty() || isAtomicStatement(aCode->last())) );
+ }
+
+
+ inline static bool isComment(const BF & aCode)
+ {
+ return( aCode.is< AvmCode >() &&
+ isComment(aCode.to_ptr< AvmCode >()) );
+ }
+
+ inline static bool isComment(AvmCode * aCode)
+ {
+ return( aCode->isOpCode( AVM_OPCODE_COMMENT ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // EMPTYNESS CHECKER
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static bool isEmptySchedule(AvmCode * aCode)
+ {
+ return( aCode->empty() &&
+ OperatorManager::isSchedule( aCode->getOperator() ) );
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DO SOMETHING CHECKER
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static bool doSomething(AvmCode * aCode)
+ {
+ return( aCode->nonempty() || (! isSchedule(aCode)) );
+ }
+
+
+
+
+};
+
+
+}
+
+#endif /* STATEMENTTYPECHECKER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/BehavioralPart.cpp b/org.eclipse.efm.symbex/src/fml/infrastructure/BehavioralPart.cpp
new file mode 100644
index 0000000..e179b7a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/BehavioralPart.cpp
@@ -0,0 +1,294 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 22 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "BehavioralPart.h"
+
+#include <fml/infrastructure/Machine.h>
+#include <fml/infrastructure/Transition.h>
+
+
+namespace sep
+{
+
+
+/**
+ * UTIL
+ */
+Routine & BehavioralPart::getActivity(AVM_OPCODE opcodeActivity)
+{
+ switch( opcodeActivity )
+ {
+ case AVM_OPCODE_INVOKE_NEW : return( onCreateRoutine );
+
+ case AVM_OPCODE_INIT : return( onInitRoutine );
+ case AVM_OPCODE_FINAL : return( onReturnRoutine );
+
+ case AVM_OPCODE_RETURN : return( onReturnRoutine );
+
+ case AVM_OPCODE_START : return( onStartRoutine );
+ case AVM_OPCODE_STOP : return( onStopRoutine );
+
+ case AVM_OPCODE_IENABLE_INVOKE : return( onIEnableRoutine );
+ case AVM_OPCODE_ENABLE_INVOKE : return( onEnableRoutine );
+
+ case AVM_OPCODE_IDISABLE_INVOKE: return( onIDisableRoutine );
+ case AVM_OPCODE_DISABLE_INVOKE : return( onDisableRoutine );
+
+ case AVM_OPCODE_IABORT_INVOKE : return( onIAbortRoutine );
+ case AVM_OPCODE_ABORT_INVOKE : return( onAbortRoutine );
+
+ case AVM_OPCODE_IRUN: return( onIRunRoutine );
+ case AVM_OPCODE_RUN : return( onRunRoutine );
+ case AVM_OPCODE_RTC : return( onRtcRoutine );
+
+ case AVM_OPCODE_SCHEDULE_INVOKE: return( onScheduleRoutine );
+
+ case AVM_OPCODE_SYNCHRONIZE : return( onSynchronizeRoutine );
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BehavioralPart::getActivity:> Unknown Activity !!!"
+ << SEND_EXIT;
+
+ return( onRunRoutine );
+ }
+ }
+}
+
+const Routine & BehavioralPart::getActivity(AVM_OPCODE opcodeActivity) const
+{
+ switch( opcodeActivity )
+ {
+ case AVM_OPCODE_INVOKE_NEW : return( onCreateRoutine );
+
+ case AVM_OPCODE_INIT : return( onInitRoutine );
+ case AVM_OPCODE_FINAL : return( onReturnRoutine );
+
+ case AVM_OPCODE_RETURN : return( onReturnRoutine );
+
+ case AVM_OPCODE_START : return( onStartRoutine );
+ case AVM_OPCODE_STOP : return( onStopRoutine );
+
+ case AVM_OPCODE_IENABLE_INVOKE : return( onIEnableRoutine );
+ case AVM_OPCODE_ENABLE_INVOKE : return( onEnableRoutine );
+
+ case AVM_OPCODE_IDISABLE_INVOKE: return( onIDisableRoutine );
+ case AVM_OPCODE_DISABLE_INVOKE : return( onDisableRoutine );
+
+ case AVM_OPCODE_IABORT_INVOKE : return( onIAbortRoutine );
+ case AVM_OPCODE_ABORT_INVOKE : return( onAbortRoutine );
+
+ case AVM_OPCODE_IRUN: return( onIRunRoutine );
+ case AVM_OPCODE_RUN : return( onRunRoutine );
+ case AVM_OPCODE_RTC : return( onRtcRoutine );
+
+ case AVM_OPCODE_SCHEDULE_INVOKE: return( onScheduleRoutine );
+
+ case AVM_OPCODE_SYNCHRONIZE : return( onSynchronizeRoutine );
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "BehavioralPart::getActivity:> Unknown Activity !!!"
+ << SEND_EXIT;
+
+ return( onRunRoutine );
+ }
+ }
+}
+
+
+/**
+ * Serialization
+ */
+void BehavioralPart::toStreamRoutine(OutStream & os) const
+{
+ os << TAB << "routine:" << EOL_INCR_INDENT;
+
+ const_routine_iterator it = mRoutines.begin();
+ const_routine_iterator endIt = mRoutines.end();
+ for( ; it != endIt ; ++it )
+ {
+ (it)->toStream(os);
+ }
+
+ os << DECR_INDENT;
+}
+
+void BehavioralPart::toStreamAnonymousInnerRoutine(OutStream & os) const
+{
+ os << TAB << "/*routine< anonymous#inner >: [" << EOL;
+
+ const_routine_iterator it = mAnonymousInnerRoutines.begin();
+ const_routine_iterator endIt = mAnonymousInnerRoutines.end();
+ for( ; it != endIt ; ++it )
+ {
+ os << TAB2 << (it)->getFullyQualifiedNameID() << ";" << EOL;
+// os << TAB2 << str_header( *it ) << ";" << EOL;
+ }
+ os << TAB << "] // end routine" << "*/" << EOL2_FLUSH;
+}
+
+
+void BehavioralPart::toStreamMoe(OutStream & os) const
+{
+ /**
+ * Transitions Part
+ */
+ if( hasOutgoingTransition() )
+ {
+ if( not getContainerMachine()->getSpecifier().isStateBasic() )
+ {
+ os << TAB << "transition" /*<< "< outgoing >"*/ << ":" << EOL;
+ }
+
+ os << INCR_INDENT;
+ const_transition_iterator it = outgoing_transition_begin();
+ const_transition_iterator endIt = outgoing_transition_end();
+ for( ; it != endIt ; ++it )
+ {
+ (it)->toStream(os);
+ }
+ os << DECR_INDENT;
+ }
+
+ if( hasIncomingTransition() )
+ {
+ os << TAB << "/*transition< incoming >: [" << EOL_INCR_INDENT;
+ const_transition_iterator it = incoming_transition_begin();
+ const_transition_iterator endIt = incoming_transition_end();
+ for( ; it != endIt ; ++it )
+ {
+ os << TAB2 << str_header( *it ) << ";" << EOL;
+ }
+ os << DECR_INDENT_TAB << "] // end transition" << "*/" << EOL_FLUSH;
+ }
+
+
+ if( getContainer()->isnot< Machine >() ||
+ (not getContainerMachine()->getSpecifier().isStateBasic()) )
+ {
+ os << TAB << getNameID() << ":" << EOL;
+ }
+
+ /**
+ * Routines Part
+ */
+ os << INCR_INDENT;
+
+ if( hasOnCreate() )
+ {
+ getOnCreateRoutine().toStream(os);
+ }
+
+ if( hasOnInit() )
+ {
+ getOnInitRoutine().toStream(os);
+ }
+
+ if( hasOnFinal() )
+ {
+ getOnFinalRoutine().toStream(os);
+ }
+
+ if( hasOnReturn() )
+ {
+ getOnReturnRoutine().toStream(os);
+ }
+
+
+ if( hasOnStart() )
+ {
+ getOnStartRoutine().toStream(os);
+ }
+
+ if( hasOnStop() )
+ {
+ getOnStopRoutine().toStream(os);
+ }
+
+
+ if( hasOnIEnable() )
+ {
+ getOnIEnableRoutine().toStream(os);
+ }
+
+ if( hasOnEnable() )
+ {
+ getOnEnableRoutine().toStream(os);
+ }
+
+
+ if( hasOnIDisable() )
+ {
+ getOnIDisableRoutine().toStream(os);
+ }
+
+ if( hasOnDisable() )
+ {
+ getOnDisableRoutine().toStream(os);
+ }
+
+
+ if( hasOnIAbort() )
+ {
+ getOnIAbortRoutine().toStream(os);
+ }
+
+ if( hasOnAbort() )
+ {
+ getOnAbortRoutine().toStream(os);
+ }
+
+
+ if( hasOnIRun() )
+ {
+ getOnIRunRoutine().toStream(os);
+ }
+
+ if( hasOnRun() )
+ {
+ getOnRunRoutine().toStream(os);
+ }
+
+
+ if( hasOnRtc() )
+ {
+ getOnRtcRoutine().toStream(os);
+ }
+
+
+ if( hasOnConcurrency() )
+ {
+ getOnConcurrencyRoutine().toStream(os);
+ }
+
+ if( hasOnSchedule() )
+ {
+ getOnScheduleRoutine().toStream(os);
+ }
+
+ if( hasOnSynchronize() )
+ {
+ getOnSynchronizeRoutine().toStream(os);
+ }
+
+ os << DECR_INDENT;
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/BehavioralPart.h b/org.eclipse.efm.symbex/src/fml/infrastructure/BehavioralPart.h
new file mode 100644
index 0000000..4b2d46c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/BehavioralPart.h
@@ -0,0 +1,982 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 22 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef FML_INFRASTRUCTURE_BEHAVIORALPART_H_
+#define FML_INFRASTRUCTURE_BEHAVIORALPART_H_
+
+#include <fml/common/ObjectClassifier.h>
+#include <fml/common/ObjectElement.h>
+
+#include <collection/BFContainer.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/operator/OperatorLib.h>
+
+#include <fml/infrastructure/Routine.h>
+#include <fml/infrastructure/Transition.h>
+
+#include <fml/workflow/WObject.h>
+
+
+namespace sep
+{
+
+class Machine;
+
+
+class BehavioralPart : public ObjectClassifier ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( BehavioralPart )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( BehavioralPart )
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef TableOfBF_T< Transition > TableOfTransition;
+
+ typedef TableOfTransition::const_raw_iterator const_transition_iterator;
+
+
+ typedef TableOfBF_T< Routine > TableOfRoutine;
+
+ typedef TableOfRoutine::const_raw_iterator const_routine_iterator;
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ TableOfTransition mOutgoingTransitions;
+
+ TableOfTransition mIncomingTransitions;
+
+ Routine onCreateRoutine;
+
+ Routine onInitRoutine;
+ Routine onFinalRoutine;
+
+ Routine onReturnRoutine;
+
+ Routine onStartRoutine;
+ Routine onStopRoutine;
+
+ Routine onIEnableRoutine;
+ Routine onEnableRoutine;
+
+ Routine onIDisableRoutine;
+ Routine onDisableRoutine;
+
+ Routine onIAbortRoutine;
+ Routine onAbortRoutine;
+
+ Routine onIRunRoutine;
+ Routine onRunRoutine;
+ Routine onRtcRoutine;
+
+ Routine onConcurrencyRoutine;
+ Routine onScheduleRoutine;
+
+ Routine onSynchronizeRoutine;
+
+
+ TableOfRoutine mRoutines;
+
+ TableOfRoutine mAnonymousInnerRoutines;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BehavioralPart(ObjectElement * aContainer,
+ const std::string & aNameID = "moe")
+ : ObjectClassifier( CLASS_KIND_T( BehavioralPart ) , aContainer , aNameID ),
+ mOutgoingTransitions( ),
+ mIncomingTransitions( ),
+
+ onCreateRoutine( *this , "create" ),
+ onInitRoutine( *this , "init" ),
+ onFinalRoutine( *this , "final" ),
+
+ onReturnRoutine( *this , "return" ),
+
+ onStartRoutine( *this , "start" ),
+ onStopRoutine( *this , "stop" ),
+
+ onIEnableRoutine( *this , "ienable" ),
+ onEnableRoutine( *this , "enable" ),
+
+ onIDisableRoutine( *this , "idisable" ),
+ onDisableRoutine( *this , "disable" ),
+
+ onIAbortRoutine( *this , "iabort" ),
+ onAbortRoutine( *this , "abort" ),
+
+ onIRunRoutine( *this , "irun" ),
+ onRunRoutine( *this , "run" ),
+ onRtcRoutine( *this , "rtc" ),
+
+ onConcurrencyRoutine( *this , "concurrency" ),
+ onScheduleRoutine( *this , "schedule" ),
+
+ onSynchronizeRoutine( *this , "synchronized" ),
+
+ mRoutines( ),
+ mAnonymousInnerRoutines( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BehavioralPart()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mOutgoingTransitions
+ */
+ inline const TableOfTransition & getOutgoingTransitions() const
+ {
+ return( mOutgoingTransitions );
+ }
+
+ inline bool hasOutgoingTransition() const
+ {
+ return( mOutgoingTransitions.nonempty() );
+ }
+
+ inline void appendOutgoingTransition(const BF & aTransition)
+ {
+ mOutgoingTransitions.append( aTransition );
+ }
+
+ inline void saveOutgoingTransition(Transition * aTransition)
+ {
+ mOutgoingTransitions.append( BF(aTransition) );
+ }
+
+ /**
+ * [ CONST ] ITERATOR
+ */
+ inline const_transition_iterator outgoing_transition_begin() const
+ {
+ return( mOutgoingTransitions.begin() );
+ }
+
+ inline const_transition_iterator outgoing_transition_end() const
+ {
+ return( mOutgoingTransitions.end() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mTransitions
+ * Attention ! pas de SmartPointer pour cet attribut
+ * Problème de référence circulaire au << delete avec le model ARC >>
+ */
+ inline const TableOfTransition & getIncomingTransitions() const
+ {
+ return( mIncomingTransitions );
+ }
+
+ inline bool hasIncomingTransition() const
+ {
+ return( mIncomingTransitions.nonempty() );
+ }
+
+ inline void appendIncomingTransition(const BF & aTransition)
+ {
+ mIncomingTransitions.append( aTransition );
+ }
+
+
+ /**
+ * [ CONST ] ITERATOR
+ */
+ inline const_transition_iterator incoming_transition_begin() const
+ {
+ return( mIncomingTransitions.begin() );
+ }
+
+ inline const_transition_iterator incoming_transition_end() const
+ {
+ return( mIncomingTransitions.end() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onCreateRoutine
+ */
+ inline Routine & getOnCreateRoutine()
+ {
+ return( onCreateRoutine );
+ }
+
+ inline const Routine & getOnCreateRoutine() const
+ {
+ return( onCreateRoutine );
+ }
+
+ inline const BFCode & getOnCreate() const
+ {
+ return( onCreateRoutine.getCode() );
+ }
+
+ inline bool hasOnCreate() const
+ {
+ return( onCreateRoutine.hasCode() );
+ }
+
+ inline void setOnCreate(const BFCode & aCode)
+ {
+ onCreateRoutine.setCode( aCode );
+ }
+
+ inline void seqOnCreate(const BFCode & aCode)
+ {
+ onCreateRoutine.seqCode( aCode );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onInitRoutine
+ */
+ inline Routine & getOnInitRoutine()
+ {
+ return( onInitRoutine );
+ }
+
+ inline const Routine & getOnInitRoutine() const
+ {
+ return( onInitRoutine );
+ }
+
+ inline const BFCode & getOnInit() const
+ {
+ return( onInitRoutine.getCode() );
+ }
+
+ inline bool hasOnInit() const
+ {
+ return( onInitRoutine.hasCode() );
+ }
+
+ inline void setOnInit(const BFCode & aCode)
+ {
+ onInitRoutine.setCode( aCode );
+ }
+
+ inline void seqOnInit(const BFCode & aCode)
+ {
+ onInitRoutine.seqCode( aCode );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onFinalRoutine
+ */
+ inline Routine & getOnFinalRoutine()
+ {
+ return( onFinalRoutine );
+ }
+
+ inline const Routine & getOnFinalRoutine() const
+ {
+ return( onFinalRoutine );
+ }
+
+ inline const BFCode & getOnFinal() const
+ {
+ return( onFinalRoutine.getCode() );
+ }
+
+ inline bool hasOnFinal() const
+ {
+ return( onFinalRoutine.hasCode() );
+ }
+
+ inline void setOnFinal(const BFCode & aCode)
+ {
+ onFinalRoutine.setCode( aCode );
+ }
+
+ inline void seqOnFinal(const BFCode & aCode)
+ {
+ onFinalRoutine.seqCode( aCode );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onReturnRoutine
+ */
+ inline Routine & getOnReturnRoutine()
+ {
+ return( onReturnRoutine );
+ }
+
+ inline const Routine & getOnReturnRoutine() const
+ {
+ return( onReturnRoutine );
+ }
+
+ inline const BFCode & getOnReturn() const
+ {
+ return( onReturnRoutine.getCode() );
+ }
+
+ inline bool hasOnReturn() const
+ {
+ return( onReturnRoutine.hasCode() );
+ }
+
+ inline void setOnReturn(const BFCode & aCode)
+ {
+ onReturnRoutine.setCode( aCode );
+ }
+
+ inline void seqOnReturn(const BFCode & aCode)
+ {
+ onReturnRoutine.seqCode( aCode );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onStartRoutine
+ */
+ inline Routine & getOnStartRoutine()
+ {
+ return( onStartRoutine );
+ }
+
+ inline const Routine & getOnStartRoutine() const
+ {
+ return( onStartRoutine );
+ }
+
+ inline const BFCode & getOnStart() const
+ {
+ return( onStartRoutine.getCode() );
+ }
+
+ inline bool hasOnStart() const
+ {
+ return( onStartRoutine.hasCode() );
+ }
+
+ inline void setOnStart(const BFCode & aCode)
+ {
+ onStartRoutine.setCode( aCode );
+ }
+
+ inline void seqOnStart(const BFCode & aCode)
+ {
+ onStartRoutine.seqCode( aCode );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onStopRoutine
+ */
+ inline Routine & getOnStopRoutine()
+ {
+ return( onStopRoutine );
+ }
+
+ inline const Routine & getOnStopRoutine() const
+ {
+ return( onStopRoutine );
+ }
+
+ inline const BFCode & getOnStop() const
+ {
+ return( onStopRoutine.getCode() );
+ }
+
+ inline bool hasOnStop() const
+ {
+ return( onStopRoutine.hasCode() );
+ }
+
+ inline void setOnStop(const BFCode & aCode)
+ {
+ onStopRoutine.setCode( aCode );
+ }
+
+ inline void seqOnStop(const BFCode & aCode)
+ {
+ onStopRoutine.seqCode( aCode );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onEnableRoutine
+ */
+ inline Routine & getOnEnableRoutine()
+ {
+ return( onEnableRoutine );
+ }
+
+ inline const Routine & getOnEnableRoutine() const
+ {
+ return( onEnableRoutine );
+ }
+
+ inline const BFCode & getOnEnable() const
+ {
+ return( onEnableRoutine.getCode() );
+ }
+
+ inline bool hasOnEnable() const
+ {
+ return( onEnableRoutine.hasCode() );
+ }
+
+ inline void setOnEnable(const BFCode & aCode)
+ {
+ onEnableRoutine.setCode( aCode );
+ }
+
+ inline void seqOnEnable(const BFCode & aCode)
+ {
+ onEnableRoutine.seqCode( aCode );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onIEnableRoutine
+ */
+ inline Routine & getOnIEnableRoutine()
+ {
+ return( onIEnableRoutine );
+ }
+
+ inline const Routine & getOnIEnableRoutine() const
+ {
+ return( onIEnableRoutine );
+ }
+
+ inline const BFCode & getOnIEnable() const
+ {
+ return( onIEnableRoutine.getCode() );
+ }
+
+ inline bool hasOnIEnable() const
+ {
+ return( onIEnableRoutine.hasCode() );
+ }
+
+ inline void setOnIEnable(const BFCode & aCode)
+ {
+ onIEnableRoutine.setCode( aCode );
+ }
+
+ inline void seqOnIEnable(const BFCode & aCode)
+ {
+ onIEnableRoutine.seqCode( aCode );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onDisableRoutine
+ */
+ inline Routine & getOnDisableRoutine()
+ {
+ return( onDisableRoutine );
+ }
+
+ inline const Routine & getOnDisableRoutine() const
+ {
+ return( onDisableRoutine );
+ }
+
+ inline const BFCode & getOnDisable() const
+ {
+ return( onDisableRoutine.getCode() );
+ }
+
+ inline bool hasOnDisable() const
+ {
+ return( onDisableRoutine.hasCode() );
+ }
+
+ inline void setOnDisable(const BFCode & aCode)
+ {
+ onDisableRoutine.setCode( aCode );
+ }
+
+ inline void seqOnDisable(const BFCode & aCode)
+ {
+ onDisableRoutine.seqCode( aCode );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onIDisableRoutine
+ */
+ inline Routine & getOnIDisableRoutine()
+ {
+ return( onIDisableRoutine );
+ }
+
+ inline const Routine & getOnIDisableRoutine() const
+ {
+ return( onIDisableRoutine );
+ }
+
+ inline const BFCode & getOnIDisable() const
+ {
+ return( onIDisableRoutine.getCode() );
+ }
+
+ inline bool hasOnIDisable() const
+ {
+ return( onIDisableRoutine.hasCode() );
+ }
+
+ inline void setOnIDisable(const BFCode & aCode)
+ {
+ onIDisableRoutine.setCode( aCode );
+ }
+
+ inline void seqOnIDisable(const BFCode & aCode)
+ {
+ onIDisableRoutine.seqCode( aCode );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onAbortRoutine
+ */
+ inline Routine & getOnAbortRoutine()
+ {
+ return( onAbortRoutine );
+ }
+
+ inline const Routine & getOnAbortRoutine() const
+ {
+ return( onAbortRoutine );
+ }
+
+ inline const BFCode & getOnAbort() const
+ {
+ return( onAbortRoutine.getCode() );
+ }
+
+ inline bool hasOnAbort() const
+ {
+ return( onAbortRoutine.hasCode() );
+ }
+
+ inline void setOnAbort(const BFCode & aCode)
+ {
+ onAbortRoutine.setCode( aCode );
+ }
+
+ inline void seqOnAbort(const BFCode & aCode)
+ {
+ onAbortRoutine.seqCode( aCode );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onIAbortRoutine
+ */
+ inline Routine & getOnIAbortRoutine()
+ {
+ return( onIAbortRoutine );
+ }
+
+ inline const Routine & getOnIAbortRoutine() const
+ {
+ return( onIAbortRoutine );
+ }
+
+ inline const BFCode & getOnIAbort() const
+ {
+ return( onIAbortRoutine.getCode() );
+ }
+
+ inline bool hasOnIAbort() const
+ {
+ return( onIAbortRoutine.hasCode() );
+ }
+
+ inline void setOnIAbort(const BFCode & aCode)
+ {
+ onIAbortRoutine.setCode( aCode );
+ }
+
+ inline void seqOnIAbort(const BFCode & aCode)
+ {
+ onIAbortRoutine.seqCode( aCode );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onIRunRoutine
+ */
+ inline Routine & getOnIRunRoutine()
+ {
+ return( onIRunRoutine );
+ }
+
+ inline const Routine & getOnIRunRoutine() const
+ {
+ return( onIRunRoutine );
+ }
+
+ inline const BFCode & getOnIRun() const
+ {
+ return( onIRunRoutine.getCode() );
+ }
+
+ inline bool hasOnIRun() const
+ {
+ return( onIRunRoutine.hasCode() );
+ }
+
+ inline void setOnIRun(const BFCode & aCode)
+ {
+ onIRunRoutine.setCode( aCode );
+ }
+
+ inline void seqOnIRun(const BFCode & aCode)
+ {
+ onIRunRoutine.seqCode( aCode );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onRunRoutine
+ */
+ inline Routine & getOnRunRoutine()
+ {
+ return( onRunRoutine );
+ }
+
+ inline const Routine & getOnRunRoutine() const
+ {
+ return( onRunRoutine );
+ }
+
+ inline const BFCode & getOnRun() const
+ {
+ return( onRunRoutine.getCode() );
+ }
+
+ inline bool hasOnRun() const
+ {
+ return( onRunRoutine.hasCode() );
+ }
+
+ inline void setOnRun(const BFCode & aCode)
+ {
+ onRunRoutine.setCode( aCode );
+ }
+
+ inline void seqOnRun(const BFCode & aCode)
+ {
+ onRunRoutine.seqCode( aCode );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * onRtcRoutine
+ */
+ inline Routine & getOnRtcRoutine()
+ {
+ return( onRtcRoutine );
+ }
+
+ inline const Routine & getOnRtcRoutine() const
+ {
+ return( onRtcRoutine );
+ }
+
+ inline const BFCode & getOnRtc() const
+ {
+ return( onRtcRoutine.getCode() );
+ }
+
+ inline bool hasOnRtc() const
+ {
+ return( onRtcRoutine.hasCode() );
+ }
+
+ inline void setOnRtc(const BFCode & aCode)
+ {
+ onRtcRoutine.setCode( aCode );
+ }
+
+ inline void seqOnRtc(const BFCode & aCode)
+ {
+ onRtcRoutine.seqCode( aCode );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * theSchedule
+ */
+ inline Routine & getOnScheduleRoutine()
+ {
+ return( onScheduleRoutine );
+ }
+
+ inline const Routine & getOnScheduleRoutine() const
+ {
+ return( onScheduleRoutine );
+ }
+
+ inline const BFCode & getOnSchedule() const
+ {
+ return( onScheduleRoutine.getCode() );
+ }
+
+ inline bool hasOnSchedule() const
+ {
+ return( onScheduleRoutine.hasCode() );
+ }
+
+ inline void setOnSchedule(const BFCode & aCode)
+ {
+ onScheduleRoutine.setCode( aCode );
+ }
+
+ inline void seqOnSchedule(const BFCode & aCode)
+ {
+ onScheduleRoutine.seqCode( aCode );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * theConcurrency
+ */
+ inline Routine & getOnConcurrencyRoutine()
+ {
+ return( onConcurrencyRoutine );
+ }
+
+ inline const Routine & getOnConcurrencyRoutine() const
+ {
+ return( onConcurrencyRoutine );
+ }
+
+ inline const BFCode & getOnConcurrency() const
+ {
+ return( onConcurrencyRoutine.getCode() );
+ }
+
+ inline bool hasOnConcurrency() const
+ {
+ return( onConcurrencyRoutine.hasCode() );
+ }
+
+ inline void setOnConcurrency(const BFCode & aCode)
+ {
+ onConcurrencyRoutine.setCode( aCode );
+ }
+
+ inline void seqOnConcurrency(const BFCode & aCode)
+ {
+ onConcurrencyRoutine.seqCode( aCode );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * theSynchronize
+ */
+ inline Routine & getOnSynchronizeRoutine()
+ {
+ return( onSynchronizeRoutine );
+ }
+
+ inline const Routine & getOnSynchronizeRoutine() const
+ {
+ return( onSynchronizeRoutine );
+ }
+
+ inline const BFCode & getOnSynchronize() const
+ {
+ return( onSynchronizeRoutine.getCode() );
+ }
+
+ inline bool hasOnSynchronize() const
+ {
+ return( onSynchronizeRoutine.hasCode() );
+ }
+
+ inline void setOnSynchronize(const BFCode & aCode)
+ {
+ onSynchronizeRoutine.setCode( aCode );
+ }
+
+
+ /**
+ * UTIL
+ */
+ Routine & getActivity(AVM_OPCODE opcodeActivity);
+
+ const Routine & getActivity(AVM_OPCODE opcodeActivity) const;
+
+
+
+ /**
+ * GETTER - SETTER
+ * User Routines
+ */
+ inline void appendRoutine(const BF & routine)
+ {
+ mRoutines.append(routine);
+ }
+
+ inline void saveRoutine(Routine * routine)
+ {
+ mRoutines.append( BF(routine) );
+ }
+
+ Routine * rawRoutineByNameID(const std::string & id) const
+ {
+ return( mRoutines.rawByNameID(id) );
+ }
+
+ const TableOfRoutine & getRoutines() const
+ {
+ return( mRoutines );
+ }
+
+
+ inline bool hasRoutine() const
+ {
+ return( mRoutines.nonempty() );
+ }
+
+
+ /**
+ * [ CONST ] ITERATOR
+ */
+ inline const_routine_iterator routine_begin() const
+ {
+ return( mRoutines.begin() );
+ }
+
+ inline const_routine_iterator routine_end() const
+ {
+ return( mRoutines.end() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mAnonymousInnerRoutines
+ * like << variable::on_write >> or << type::constraint >> routines
+ */
+ inline void saveAnonymousInnerRoutine(Routine * routine)
+ {
+ mAnonymousInnerRoutines.append( BF(routine) );
+ }
+
+ inline bool hasAnonymousInnerRoutine() const
+ {
+ return( mAnonymousInnerRoutines.nonempty() );
+ }
+
+ /**
+ * TESTER
+ * mRoutines
+ * mAutomaticRoutines
+ */
+ inline bool hasAnyRoutine() const
+ {
+ return( mRoutines.nonempty() || mAnonymousInnerRoutines.nonempty() );
+ }
+
+
+ /**
+ * Serialization
+ */
+ virtual void strHeader(OutStream & os) const
+ {
+ os << "moe:";
+ }
+
+
+ void toStreamRoutine(OutStream & os) const;
+
+ void toStreamAnonymousInnerRoutine(OutStream & os) const;
+
+ inline void toStreamAnyRoutine(OutStream & os) const
+ {
+ if( mAnonymousInnerRoutines.nonempty() )
+ {
+ toStreamAnonymousInnerRoutine(os);
+ }
+
+ if( mRoutines.nonempty() )
+ {
+ toStreamRoutine( os );
+ }
+ }
+
+ void toStreamMoe(OutStream & os) const;
+
+ inline void toStream(OutStream & os) const
+ {
+ if( mAnonymousInnerRoutines.nonempty() )
+ {
+ toStreamAnonymousInnerRoutine(os);
+ }
+
+ if( mRoutines.nonempty() )
+ {
+ toStreamRoutine( os );
+ }
+
+ toStreamMoe(os);
+ }
+
+};
+
+
+}
+
+#endif /* FML_INFRASTRUCTURE_BEHAVIORALPART_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/Buffer.cpp b/org.eclipse.efm.symbex/src/fml/infrastructure/Buffer.cpp
new file mode 100644
index 0000000..173c5f0
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/Buffer.cpp
@@ -0,0 +1,230 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 18 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "Buffer.h"
+
+#include <fml/infrastructure/Machine.h>
+#include <fml/infrastructure/PropertyPart.h>
+
+
+namespace sep
+{
+
+std::string Buffer::ANONYM_ID = "_#buffer";
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+Buffer::Buffer(Machine * aContainer, const std::string & id,
+ avm_type_specifier_kind_t aSpecifierKind, int aSize)
+: PropertyElement(CLASS_KIND_T( Buffer ), aContainer, id),
+mPolicySpecifierKind( aSpecifierKind ),
+mSize( aSize ),
+mMessage( )
+{
+ //!! NOTHING
+}
+
+Buffer::Buffer(const PropertyPart & aPropertyPart, const std::string & id,
+ avm_type_specifier_kind_t aSpecifierKind, int aSize)
+: PropertyElement(CLASS_KIND_T( Buffer ), aPropertyPart.getContainer(), id),
+mPolicySpecifierKind( aSpecifierKind ),
+mSize( aSize ),
+mMessage( )
+{
+ //!! NOTHING
+}
+
+
+/**
+ * Serialization
+ */
+std::string Buffer::str(avm_type_specifier_kind_t aSpecifierKind)
+{
+ std::ostringstream os;
+
+ switch( aSpecifierKind )
+ {
+ case TYPE_FIFO_SPECIFIER:
+ {
+ os << "fifo";
+ break;
+ }
+ case TYPE_LIFO_SPECIFIER:
+ {
+ os << "lifo";
+ break;
+ }
+
+ case TYPE_MULTI_FIFO_SPECIFIER:
+ {
+ os << "multififo";
+ break;
+ }
+ case TYPE_MULTI_LIFO_SPECIFIER:
+ {
+ os << "multilifo";
+ break;
+ }
+
+ case TYPE_MULTISET_SPECIFIER:
+ {
+ os << "multiset";
+ break;
+ }
+
+ case TYPE_SET_SPECIFIER:
+ {
+ os << "set";
+ break;
+ }
+
+ case TYPE_RAM_SPECIFIER:
+ {
+ os << "ram";
+ break;
+ }
+
+ case TYPE_UNDEFINED_SPECIFIER:
+ {
+ os << "undefined<buffer#kind>";
+ break;
+ }
+ default:
+ {
+ os << "unknown<buffer#kind>";
+ break;
+ }
+ }
+
+ return( os.str() );
+}
+
+
+std::string Buffer::str(avm_type_specifier_kind_t aSpecifierKind, long aSize)
+{
+ std::ostringstream os;
+ switch( aSpecifierKind )
+ {
+ case TYPE_FIFO_SPECIFIER:
+ {
+ os << "fifo<";
+ break;
+ }
+ case TYPE_LIFO_SPECIFIER:
+ {
+ os << "lifo<";
+ break;
+ }
+
+ case TYPE_MULTI_FIFO_SPECIFIER:
+ {
+ os << "multififo<";
+ break;
+ }
+ case TYPE_MULTI_LIFO_SPECIFIER:
+ {
+ os << "multilifo<";
+ break;
+ }
+
+ case TYPE_MULTISET_SPECIFIER:
+ {
+ os << "multiset<";
+ break;
+ }
+
+ case TYPE_SET_SPECIFIER:
+ {
+ os << "set<";
+ break;
+ }
+
+ case TYPE_RAM_SPECIFIER:
+ {
+ os << "ram";
+ break;
+ }
+
+ case TYPE_UNDEFINED_SPECIFIER:
+ {
+ os << "undefined<buffer#kind , ";
+ break;
+ }
+ default:
+ {
+ os << "unknown<buffer#kind , ";
+ break;
+ }
+ }
+
+ if( aSpecifierKind != TYPE_RAM_SPECIFIER )
+ {
+ if( aSize > 0 )
+ {
+ os << aSize << ">";
+ }
+ else
+ {
+ os << "*>";
+ }
+ }
+
+ return( os.str() );
+}
+
+
+void Buffer::strMessage(OutStream & os) const
+{
+ if( mMessage.nonempty() )
+ {
+ BFList::const_iterator it = mMessage.begin();
+ BFList::const_iterator endIt = mMessage.end();
+
+ os << "[ " << (*it).str();
+ for( ++it ; it != endIt ; ++it )
+ {
+ os << " , " << (*it).str();
+ }
+ os << " ]";
+ }
+}
+
+
+void Buffer::strHeader(OutStream & os) const
+{
+ os << getModifier().toString() << "buffer "
+ << Buffer::str(mPolicySpecifierKind, mSize)
+ << " " << getNameID() ;
+
+ strMessage( os );
+}
+
+
+void Buffer::toStream(OutStream & os) const
+{
+ os << TAB << getModifier().toString() << "buffer "
+ << Buffer::str(mPolicySpecifierKind, mSize)
+ << " " << getNameID();
+
+ strMessage( os );
+
+ os << ";" << EOL_FLUSH;
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/Buffer.h b/org.eclipse.efm.symbex/src/fml/infrastructure/Buffer.h
new file mode 100644
index 0000000..1c13219
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/Buffer.h
@@ -0,0 +1,158 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 18 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BUFFER_H_
+#define BUFFER_H_
+
+#include <fml/common/PropertyElement.h>
+
+#include <collection/BFContainer.h>
+
+#include <fml/lib/ITypeSpecifier.h>
+
+
+namespace sep
+{
+
+class BF;
+class ObjectElement;
+class PropertyPart;
+
+
+class Buffer : public PropertyElement ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( Buffer )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( Buffer )
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ avm_type_specifier_kind_t mPolicySpecifierKind;
+
+ int mSize;
+
+ BFList mMessage;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Buffer(Machine * aContainer, const std::string & id,
+ avm_type_specifier_kind_t aSpecifierKind, int aSize);
+
+ Buffer(const PropertyPart & aPropertyPart, const std::string & id,
+ avm_type_specifier_kind_t aSpecifierKind, int aSize);
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Buffer()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mPolicySpecifierKind
+ */
+ inline avm_type_specifier_kind_t getPolicySpecifierKind() const
+ {
+ return( mPolicySpecifierKind );
+ }
+
+ inline void setPolicySpecifierKind(avm_type_specifier_kind_t aSpecifierKind)
+ {
+ mPolicySpecifierKind = aSpecifierKind;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mSize
+ */
+ inline avm_size_t getCapacity() const
+ {
+ return( ( mSize < 0 ) ? AVM_NUMERIC_MAX_SIZE_T : mSize );
+ }
+
+ inline int getSize() const
+ {
+ return( mSize );
+ }
+
+ inline void setSize(int aSize)
+ {
+ mSize = aSize;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mMessage
+ */
+ inline BFList & getMessages()
+ {
+ return( mMessage );
+ }
+
+ inline bool hasMessage() const
+ {
+ return( mMessage.nonempty() );
+ }
+
+ inline void appendMessage(const BF & aParameter)
+ {
+ mMessage.append( aParameter );
+ }
+
+
+ /**
+ * Serialization
+ */
+ static std::string str(avm_type_specifier_kind_t aSpecifierKind);
+ static std::string str(avm_type_specifier_kind_t aSpecifierKind, long aSize);
+
+ void strMessage(OutStream & os) const;
+
+ void strHeader(OutStream & os) const;
+
+ void toStream(OutStream & os) const;
+
+
+public:
+
+ /**
+ * ATTRIBUTES
+ */
+ static std::string ANONYM_ID;
+
+ inline bool isAnonymID() const
+ {
+ return( getNameID().empty() || (getNameID().find(ANONYM_ID) == 0) );
+ }
+
+};
+
+
+}
+
+#endif /* BUFFER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/Channel.cpp b/org.eclipse.efm.symbex/src/fml/infrastructure/Channel.cpp
new file mode 100644
index 0000000..5f0006f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/Channel.cpp
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "Channel.h"
+
+#include <util/avm_assert.h>
+
+#include <fml/infrastructure/Machine.h>
+#include <fml/infrastructure/Port.h>
+#include <fml/infrastructure/PropertyPart.h>
+
+
+namespace sep
+{
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+Channel::Channel(const PropertyPart & aPropertyPart,
+ const std::string & aNameID, const Modifier & aModifier)
+: PropertyElement(CLASS_KIND_T( Channel ),
+ aPropertyPart.getContainer(), aModifier, aNameID),
+ComProtocol( PROTOCOL_UNDEFINED_KIND , IComPoint::IO_CHANNEL_NATURE ),
+mContents( new PropertyPart(this, "contents") )
+{
+ //!! NOTHING
+}
+
+
+
+/**
+ * GETTER
+ * the container
+ */
+Machine * Channel::getContainerMachine() const
+{
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( getContainer()->is< Machine >() )
+ << "Invalid << Channel Container >> Type <"
+ << getContainer()->classKindName() << "> Cast !!!"
+ << SEND_EXIT;
+
+ return( getContainer()->to< Machine >() );
+}
+
+
+/**
+ * GETTER
+ * mContents
+ */
+bool Channel::hasContents() const
+{
+ return( (mContents != NULL) && mContents->nonempty() );
+}
+
+/**
+ * GETTER - SETTER
+ * mContents
+ * Signals
+ */
+void Channel::appendSignal(const Modifier & aModifier, const BF & aSignal)
+{
+ mContents->appendSignal( BF( new Signal(this, aModifier, aSignal) ) );
+}
+
+BF Channel::getSignal(Modifier::DIRECTION_KIND ioDirection, const BF & aSignal)
+{
+ PropertyPart::TableOfSignal::const_raw_iterator itSignal =
+ mContents->getSignals().begin();
+ PropertyPart::TableOfSignal::const_raw_iterator endSignal =
+ mContents->getSignals().end();
+ for( ; itSignal != endSignal ; ++itSignal )
+ {
+ if( (aSignal == (itSignal)->getSignalModel())
+ && (itSignal)->getModifier().isDirectionKind(ioDirection) )
+ {
+ return( *itSignal );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+/**
+ * Serialization
+ */
+void Channel::toStream(OutStream & out) const
+{
+ out << TAB << getModifier().toString(Modifier::DISABLE_DIRECTION_FIELD)
+ << "channel";
+
+ toStreamProtocolCast( out , false );
+
+ if( not getModifier().isDirectionInout() )
+ {
+ out << " " << getModifier().strDirection();
+ }
+
+ out << " " << getNameID() << " {" << EOL;
+
+ if( hasContents() )
+ {
+ getContents()->toStream(out);
+ }
+
+ out << TAB << "}" << EOL_FLUSH;
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/Channel.h b/org.eclipse.efm.symbex/src/fml/infrastructure/Channel.h
new file mode 100644
index 0000000..4917250
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/Channel.h
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef CHANNEL_H_
+#define CHANNEL_H_
+
+#include <fml/common/PropertyElement.h>
+
+#include <fml/infrastructure/ComProtocol.h>
+
+
+namespace sep
+{
+
+class BF;
+class Machine;
+class Modifier;
+class ObjectElement;
+class PropertyPart;
+
+
+class Channel :
+ public PropertyElement,
+ public ComProtocol,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( Channel )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( Channel )
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ PropertyPart * mContents;
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Channel(const PropertyPart & aPropertyPart, const std::string & aNameID,
+ const Modifier & aModifier = Modifier::PROPERTY_INOUT_DIRECTION);
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Channel()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER
+ * the container
+ */
+ virtual Machine * getContainerMachine() const ;
+
+
+ /**
+ * GETTER - SETTER
+ * mContents
+ */
+ inline PropertyPart * getContents() const
+ {
+ return( mContents );
+ }
+
+ bool hasContents() const;
+
+ inline void setContents(PropertyPart * aContents)
+ {
+ mContents = aContents;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mContents
+ * Signals
+ */
+ void appendSignal(const Modifier & aModifier, const BF & aSignal);
+
+ BF getSignal(Modifier::DIRECTION_KIND ioDirection, const BF & aSignal);
+
+
+ /**
+ * Serialization
+ */
+ void strHeader(OutStream & out) const
+ {
+ out << str_indent( this );
+ }
+
+ void toStream(OutStream & out) const;
+
+};
+
+
+} /* namespace sep */
+
+#endif /* CHANNEL_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/ComPoint.cpp b/org.eclipse.efm.symbex/src/fml/infrastructure/ComPoint.cpp
new file mode 100644
index 0000000..35e4772
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/ComPoint.cpp
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 juil. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ComPoint.h"
+
+#include <fml/infrastructure/Machine.h>
+#include <fml/infrastructure/Port.h>
+
+
+namespace sep
+{
+
+/**
+ * Serialization
+ */
+void ComPoint::toStream(OutStream & out) const
+{
+ if( mMachinePortQualifiedNameID.valid() )
+ {
+ if( mMachine != NULL )
+ {
+ out << mMachine->getFullyQualifiedNameID() << "->";
+ }
+
+ toStreamProtocolCast( out << mMachinePortQualifiedNameID.str() );
+ }
+ else if( mPort != NULL )
+ {
+ if( (mMachine != NULL) && (mPort->getContainer() != mMachine) )
+ {
+ out << mMachine->getFullyQualifiedNameID()
+ << "->" << mPort->getNameID();
+ }
+ else
+ {
+ out << mPort->getFullyQualifiedNameID();
+ }
+
+ toStreamProtocolCast( out );
+ }
+ else
+ {
+ out << "ComPoint<null>";
+ }
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/ComPoint.h b/org.eclipse.efm.symbex/src/fml/infrastructure/ComPoint.h
new file mode 100644
index 0000000..21520a6
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/ComPoint.h
@@ -0,0 +1,184 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 juil. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef FML_INFRASTRUCTURE_CONNECTOR_END_H_
+#define FML_INFRASTRUCTURE_CONNECTOR_END_H_
+
+#include <common/Element.h>
+#include <fml/infrastructure/ComProtocol.h>
+#include <fml/common/TraceableElement.h>
+
+#include <common/AvmPointer.h>
+#include <common/BF.h>
+
+#include <fml/common/ObjectElement.h>
+
+#include <fml/lib/AvmLang.h>
+#include <fml/lib/IComPoint.h>
+
+
+namespace sep
+{
+
+class Machine;
+class Port;
+
+
+class ComPoint :
+ public Element,
+ public ComProtocol,
+ public TraceableElement,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ComPoint )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( ComPoint )
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ Machine * mMachine;
+ Port * mPort;
+
+ BF mMachinePortQualifiedNameID;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ComPoint()
+ : Element( CLASS_KIND_T( ComPoint ) ),
+ ComProtocol( PROTOCOL_UNDEFINED_KIND ),
+ TraceableElement( ),
+ mMachine( NULL ),
+ mPort( NULL ),
+ mMachinePortQualifiedNameID( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ComPoint()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mMachine
+ */
+ inline Machine * getMachine()
+ {
+ return( mMachine );
+ }
+
+ inline bool hasMachine()
+ {
+ return( mMachine != NULL );
+ }
+
+ inline void setMachine(Machine * aMachine)
+ {
+ mMachine = aMachine;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mPort
+ */
+ inline Port * getPort() const
+ {
+ return( mPort );
+ }
+
+ inline bool hasPort()
+ {
+ return( mPort != NULL );
+ }
+
+
+ /**
+ * SETTER
+ * mMachine
+ * mPort
+ */
+ inline void setMachinePort(Machine * aMachine, Port * aPort)
+ {
+ mMachine = aMachine;
+
+ mPort = aPort;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mMachinePortQualifiedNameID
+ */
+ inline BF & getMachinePortQualifiedNameID()
+ {
+ return( mMachinePortQualifiedNameID );
+ }
+
+ inline bool hasMachinePortQualifiedNameID()
+ {
+ return( mMachinePortQualifiedNameID.valid() );
+ }
+
+ inline void setMachinePort(const BF & bf)
+ {
+ mMachinePortQualifiedNameID = bf;
+ }
+
+
+ inline bool isMachineAllPort()
+ {
+ return( mMachinePortQualifiedNameID == XLIA_SYNTAX::ID_ALL );
+ }
+
+ inline void setMachineAllSignal(Machine * aMachine)
+ {
+ mMachine = aMachine;
+ mMachinePortQualifiedNameID = XLIA_SYNTAX::ID_ALL;
+ }
+
+
+ /**
+ * Serialization
+ */
+ inline virtual std::string str() const
+ {
+ StringOutStream oss( AVM_NO_INDENT );
+
+ toStream( oss );
+
+ return( oss.str() );
+ }
+
+ void toStream(OutStream & out) const;
+
+};
+
+
+} /* namespace sep */
+
+#endif /* FML_INFRASTRUCTURE_CONNECTOR_END_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/ComProtocol.cpp b/org.eclipse.efm.symbex/src/fml/infrastructure/ComProtocol.cpp
new file mode 100644
index 0000000..245a39c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/ComProtocol.cpp
@@ -0,0 +1,314 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ComProtocol.h"
+
+#include <util/avm_string.h>
+
+namespace sep
+{
+
+ComProtocol::PROTOCOL_KIND ComProtocol::to_cast(PROTOCOL_KIND protocol)
+{
+ switch( protocol )
+ {
+ case PROTOCOL_ENVIRONMENT_KIND : return( PROTOCOL_UNDEFINED_KIND );
+
+ case PROTOCOL_TRANSFERT_KIND : return( PROTOCOL_UNDEFINED_KIND );
+
+ case PROTOCOL_BUFFER_KIND : return( PROTOCOL_UNDEFINED_KIND );
+
+ case PROTOCOL_RDV_KIND : return( PROTOCOL_UNICAST_KIND );
+ case PROTOCOL_MULTIRDV_KIND : return( PROTOCOL_MULTICAST_KIND );
+
+ case PROTOCOL_FLOW_KIND : return( PROTOCOL_UNDEFINED_KIND );
+
+ case PROTOCOL_BROADCAST_KIND : return( protocol );
+ case PROTOCOL_MULTICAST_KIND : return( protocol );
+ case PROTOCOL_UNICAST_KIND : return( protocol );
+ case PROTOCOL_ANYCAST_KIND : return( protocol );
+
+ case PROTOCOL_UNDEFINED_KIND : return( protocol );
+
+ default : return( PROTOCOL_UNDEFINED_KIND );
+ }
+}
+
+std::string ComProtocol::to_string(PROTOCOL_KIND protocol)
+{
+ switch( protocol )
+ {
+ case PROTOCOL_ENVIRONMENT_KIND : return( "env" );
+
+ case PROTOCOL_TRANSFERT_KIND : return( "transfert" );
+
+ case PROTOCOL_BUFFER_KIND : return( "buffer" );
+
+ case PROTOCOL_RDV_KIND : return( "rdv" );
+ case PROTOCOL_MULTIRDV_KIND : return( "multirdv" );
+
+ case PROTOCOL_FLOW_KIND : return( "flow" );
+
+ case PROTOCOL_BROADCAST_KIND : return( "broadcast" );
+
+ case PROTOCOL_MULTICAST_KIND : return( "multicast" );
+ case PROTOCOL_UNICAST_KIND : return( "unicast" );
+ case PROTOCOL_ANYCAST_KIND : return( "anycast" );
+
+ case PROTOCOL_UNDEFINED_KIND : return( "undefined<protocol#kind>" );
+
+ default : return( "unknown<protocol#kind>" );
+ }
+}
+
+
+std::string ComProtocol::strProtocol(
+ PROTOCOL_KIND aProtocol, PROTOCOL_KIND aCast)
+{
+ switch ( aProtocol )
+ {
+ case PROTOCOL_ENVIRONMENT_KIND:
+ {
+ return( "env" );
+ }
+
+ case PROTOCOL_BUFFER_KIND:
+ {
+ return( OSS() << "buffer , " << ComProtocol::strCast(aCast) );
+ }
+
+ case PROTOCOL_RDV_KIND:
+ {
+ return( OSS() << "rdv , " << ComProtocol::strCast(aCast) );
+ }
+ case PROTOCOL_MULTIRDV_KIND:
+ {
+ return( OSS() << "multirdv , " << ComProtocol::strCast(aCast) );
+ }
+
+ case PROTOCOL_FLOW_KIND:
+ {
+ return( OSS() << "flow , " << ComProtocol::strCast(aCast) );
+ }
+
+ case PROTOCOL_UNDEFINED_KIND:
+ {
+ return( OSS() << "undefined<protocol#kind> , "
+ << ComProtocol::strCast(aCast) );
+ }
+
+ default :
+ {
+ return( OSS() << "unexpected<"
+ << to_string(aProtocol) << " , "
+ << to_string(aCast) << ">" );
+ }
+ }
+}
+
+
+std::string ComProtocol::strProtocol(PROTOCOL_KIND aProtocol)
+{
+ switch ( aProtocol )
+ {
+ case PROTOCOL_ENVIRONMENT_KIND:
+ {
+ return( "env" );
+ }
+
+ case PROTOCOL_BUFFER_KIND:
+ {
+ return( "buffer" );
+ }
+
+ case PROTOCOL_RDV_KIND:
+ {
+ return( "rdv" );
+ }
+ case PROTOCOL_MULTIRDV_KIND:
+ {
+ return( "multirdv" );
+ }
+
+ case PROTOCOL_FLOW_KIND:
+ {
+ return( "flow" );
+ }
+
+
+ case PROTOCOL_ANYCAST_KIND:
+ {
+ return( "anycast" );
+ }
+ case PROTOCOL_UNICAST_KIND:
+ {
+ return( "unicast" );
+ }
+ case PROTOCOL_BROADCAST_KIND:
+ {
+ return( "broadcast" );
+ }
+ case PROTOCOL_MULTICAST_KIND:
+ {
+ return( "multicast" );
+ }
+ case PROTOCOL_UNDEFINED_KIND:
+ {
+ return( "undefined<protocol#kind>" );
+ }
+
+ default :
+ {
+ return( OSS() << "unexpected<"
+ << to_string(aProtocol) << ">" );
+ }
+ }
+}
+
+
+std::string ComProtocol::strCast(PROTOCOL_KIND aCast)
+{
+ switch ( aCast )
+ {
+ case PROTOCOL_UNICAST_KIND:
+ {
+ return( "unicast" );
+ }
+
+ case PROTOCOL_ANYCAST_KIND:
+ {
+ return( "anycast" );
+ }
+
+ case PROTOCOL_BROADCAST_KIND:
+ {
+ return( "broadcast" );
+ }
+ case PROTOCOL_MULTICAST_KIND:
+ {
+ return( "multicast" );
+ }
+
+ case PROTOCOL_UNDEFINED_KIND:
+ {
+ return( "undefined<cast#kind>" );
+ }
+
+ default :
+ {
+ return( OSS() << "unexpected<"
+ << to_string(aCast) << ">" );
+ }
+ }
+}
+
+
+OutStream & ComProtocol::toStreamProtocolCast(
+ OutStream & out, bool mustBeDefined) const
+{
+ if( mProtocol == PROTOCOL_UNDEFINED_KIND )
+ {
+ if( (mCast != PROTOCOL_UNDEFINED_KIND) || mustBeDefined )
+ {
+ out << "< " << ComProtocol::strCast(mCast) << " >";
+ }
+ }
+ else
+ {
+ out << "< ";
+
+ switch ( mProtocol )
+ {
+ case PROTOCOL_ENVIRONMENT_KIND:
+ {
+ out << "env";
+
+ break;
+ }
+
+ case PROTOCOL_BUFFER_KIND:
+ {
+ out << "buffer";
+
+ if( mBuffer != NULL )
+ {
+ out << ": ";
+ if( mBuffer->isAnonymID() )
+ {
+ out << Buffer::str(mBuffer->getPolicySpecifierKind(),
+ mBuffer->getSize());
+ }
+ else
+ {
+ out << mBuffer->getNameID();
+ }
+ }
+ else if( mBufferUfid.valid() )
+ {
+ out << ": " << mBufferUfid.str();
+ }
+ else
+ {
+ out << " , " << ComProtocol::strCast(mCast);
+ }
+
+ break;
+ }
+
+ case PROTOCOL_RDV_KIND:
+ {
+ out << "rdv" << " , " << ComProtocol::strCast(mCast);
+
+ break;
+ }
+ case PROTOCOL_MULTIRDV_KIND:
+ {
+ out << "multirdv" << " , " << ComProtocol::strCast(mCast);
+
+ break;
+ }
+
+ case PROTOCOL_FLOW_KIND:
+ {
+ out << "flow" << " , " << ComProtocol::strCast(mCast);
+
+ break;
+ }
+
+ case PROTOCOL_UNDEFINED_KIND:
+ {
+ out << "undefined<protocol#kind>" << " , "
+ << ComProtocol::strCast(mCast);
+
+ break;
+ }
+
+ default :
+ {
+ out << "unexpected<" << to_string(mProtocol)
+ << " , " << to_string(mCast) << ">";
+
+ break;
+ }
+ }
+
+ out << " >";
+ }
+
+ return( out );
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/ComProtocol.h b/org.eclipse.efm.symbex/src/fml/infrastructure/ComProtocol.h
new file mode 100644
index 0000000..66e0375
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/ComProtocol.h
@@ -0,0 +1,274 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef COMPROTOCOL_H_
+#define COMPROTOCOL_H_
+
+
+#include <fml/lib/IComPoint.h>
+
+#include <fml/infrastructure/Buffer.h>
+
+
+namespace sep
+{
+
+class ComProtocol
+{
+
+public:
+ /**
+ * ENUM TYPEDEF
+ */
+ enum PROTOCOL_KIND
+ {
+ PROTOCOL_ENVIRONMENT_KIND,
+
+ PROTOCOL_TRANSFERT_KIND,
+
+ PROTOCOL_BUFFER_KIND,
+
+ PROTOCOL_RDV_KIND,
+ PROTOCOL_MULTIRDV_KIND,
+
+ PROTOCOL_FLOW_KIND,
+
+ PROTOCOL_BROADCAST_KIND,
+
+ PROTOCOL_MULTICAST_KIND,
+ PROTOCOL_UNICAST_KIND,
+
+ PROTOCOL_ANYCAST_KIND,
+
+ PROTOCOL_UNDEFINED_KIND
+ };
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ IComPoint::ENUM_IO_NATURE mComPointNature;
+
+ PROTOCOL_KIND mProtocol;
+ PROTOCOL_KIND mCast;
+
+ Buffer * mBuffer;
+
+ BF mBufferUfid;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ComProtocol(PROTOCOL_KIND aProtocol,
+ IComPoint::ENUM_IO_NATURE aNature = IComPoint::IO_PORT_NATURE)
+ : mComPointNature( aNature ),
+ mProtocol( aProtocol ),
+ mCast( to_cast(aProtocol) ),
+ mBuffer( NULL ),
+ mBufferUfid( )
+ {
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ComProtocol()
+ {
+ }
+
+
+ /**
+ * GETTER - TESTER - SETTER
+ * mComPointNature
+ */
+ inline IComPoint::ENUM_IO_NATURE getNature() const
+ {
+ return( mComPointNature );
+ }
+
+
+ inline bool isPort() const
+ {
+ return( mComPointNature == IComPoint::IO_PORT_NATURE );
+ }
+
+ inline bool isSignal() const
+ {
+ return( mComPointNature == IComPoint::IO_SIGNAL_NATURE );
+ }
+
+
+ inline void setNature(IComPoint::ENUM_IO_NATURE aNature)
+ {
+ mComPointNature = aNature;
+ }
+
+ /**
+ * GETTER - SETTER
+ * mProtocol
+ */
+ inline PROTOCOL_KIND getProtocol() const
+ {
+ return( mProtocol );
+ }
+
+ inline bool hasProtocol() const
+ {
+ return( mProtocol != PROTOCOL_UNDEFINED_KIND );
+ }
+
+ inline void setProtocol(PROTOCOL_KIND aProtocol)
+ {
+ mProtocol = aProtocol;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mCast
+ */
+ inline PROTOCOL_KIND getCast() const
+ {
+ return( mCast );
+ }
+
+ inline bool hasCast() const
+ {
+ return( mCast != PROTOCOL_UNDEFINED_KIND );
+ }
+
+ inline void setCast(PROTOCOL_KIND aCast)
+ {
+ mCast = aCast;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mProtocol
+ * mCast
+ */
+ inline void setProtocolCast(PROTOCOL_KIND aProtocol,
+ PROTOCOL_KIND aCast)
+ {
+ mProtocol = aProtocol;
+ mCast = aCast;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mBuffer
+ */
+ inline Buffer * getBuffer() const
+ {
+ return( mBuffer );
+ }
+
+ inline bool hasBuffer() const
+ {
+ return( mBuffer != NULL );
+ }
+
+ inline void setBuffer(const BF & aBuffer)
+ {
+ if( aBuffer.is< Buffer >() )
+ {
+ mBuffer = aBuffer.to_ptr< Buffer >();
+ mBufferUfid = aBuffer;
+ }
+ else
+ {
+ mBufferUfid = aBuffer;
+ }
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mBufferUfid
+ */
+ inline BF & getBufferUfid()
+ {
+ return( mBufferUfid );
+ }
+
+ inline const BF & getBufferUfid() const
+ {
+ return( mBufferUfid );
+ }
+
+ inline bool hasBufferUfid() const
+ {
+ return( mBufferUfid.valid() );
+ }
+
+ inline std::string strBufferUfid() const
+ {
+ return( mBufferUfid.str() );
+ }
+
+ /**
+ * Update
+ */
+ inline void update(ComProtocol * cp)
+ {
+ mProtocol = cp->mProtocol;
+ mCast = cp->mCast;
+ mBuffer = cp->mBuffer;
+ mBufferUfid = cp->mBufferUfid;
+ }
+
+
+ /**
+ * Serialization
+ */
+ static PROTOCOL_KIND to_cast(PROTOCOL_KIND protocol);
+
+ static std::string to_string(PROTOCOL_KIND protocol);
+
+
+ static std::string strProtocol(PROTOCOL_KIND aProtocol);
+
+ static std::string strProtocol(
+ PROTOCOL_KIND aProtocol, PROTOCOL_KIND aCast);
+
+ static std::string strCast(PROTOCOL_KIND aCast);
+
+
+ inline std::string strProtocolCast(bool mustBeDefined = false) const
+ {
+ StringOutStream oss( AVM_NO_INDENT );
+
+ toStreamProtocolCast( oss );
+
+ return( oss.str() );
+ }
+
+ OutStream & toStreamProtocolCast(
+ OutStream & out, bool mustBeDefined = false) const;
+
+};
+
+
+}
+
+#endif /* COMPROTOCOL_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/ComRoute.cpp b/org.eclipse.efm.symbex/src/fml/infrastructure/ComRoute.cpp
new file mode 100644
index 0000000..5c9f7c4
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/ComRoute.cpp
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 18 oct. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ComRoute.h"
+
+#include <fml/infrastructure/Connector.h>
+#include <fml/infrastructure/Port.h>
+
+
+
+namespace sep
+{
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+ComRoute::ComRoute(Connector * aContainer, const Modifier & aModifier)
+: ObjectElement( CLASS_KIND_T( ComRoute ) , aContainer , aModifier ),
+ComProtocol( PROTOCOL_UNDEFINED_KIND ),
+mComPoints( )
+{
+ //!! NOTHING
+}
+
+
+/**
+ * SETTER
+ * mComPoints
+ */
+void ComRoute::setComPoint(ComPoint * aComPoint,
+ Modifier::DIRECTION_KIND ioDirection)
+{
+ mComPoints.append( BF(aComPoint) );
+
+ if( getModifier().isDirectionUndefined() )
+ {
+ getwModifier().setDirectionKind( aComPoint->hasPort()
+ ? aComPoint->getPort()->getModifier().getDirectionKind()
+ : ioDirection );
+ }
+}
+
+
+/**
+ * Serialization
+ */
+void ComRoute::toStream(OutStream & out) const
+{
+ out << TAB << getModifier().strDirection();
+
+ toStreamProtocolCast( out ) << " " ;
+
+ if( mComPoints.singleton() )
+ {
+ out << mComPoints.first().to_ptr< ComPoint >()->str() << ";" << EOL;
+ }
+ else
+ {
+ out << "{" << EOL;
+ if( mComPoints.nonempty() )
+ {
+ BFList::const_raw_iterator< ComPoint > it = mComPoints.begin();
+ BFList::const_raw_iterator< ComPoint > endIt = mComPoints.end();
+ for( ; it != endIt ; ++it )
+ {
+ out << TAB2 << (it)->str() << ";" << EOL;
+ }
+ }
+ out << TAB << "}" << EOL_FLUSH;
+ }
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/ComRoute.h b/org.eclipse.efm.symbex/src/fml/infrastructure/ComRoute.h
new file mode 100644
index 0000000..e09c0b5
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/ComRoute.h
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 18 oct. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef COMROUTE_H_
+#define COMROUTE_H_
+
+#include <fml/common/ObjectElement.h>
+#include <fml/infrastructure/ComProtocol.h>
+
+#include <collection/BFContainer.h>
+
+#include <fml/infrastructure/ComPoint.h>
+#include <fml/infrastructure/Port.h>
+
+
+namespace sep
+{
+
+class Connector;
+class Modifier;
+
+
+class ComRoute :
+ public ObjectElement,
+ public ComProtocol,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ComRoute )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( ComRoute )
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ BFList mComPoints;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ComRoute(Connector * aContainer,
+ const Modifier & aModifier = Modifier::PROPERTY_INOUT_DIRECTION);
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ComRoute()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mComPoints
+ */
+ inline const BFList & getComPoints() const
+ {
+ return( mComPoints );
+ }
+
+ inline void appendComPoint(const BF & aComPoint)
+ {
+ mComPoints.append( aComPoint );
+ }
+
+ inline void saveComPoint(ComPoint * aComPoint)
+ {
+ mComPoints.append( BF(aComPoint) );
+ }
+
+ void setComPoint(ComPoint * aComPoint,
+ Modifier::DIRECTION_KIND ioDirection);
+
+
+ /**
+ * Serialization
+ */
+ void toStream(OutStream & out) const;
+
+};
+
+
+} /* namespace sep */
+
+#endif /* COMROUTE_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/CompositePart.cpp b/org.eclipse.efm.symbex/src/fml/infrastructure/CompositePart.cpp
new file mode 100644
index 0000000..3721989
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/CompositePart.cpp
@@ -0,0 +1,325 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 29 mars 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "CompositePart.h"
+
+#include <fml/infrastructure/BehavioralPart.h>
+#include <fml/infrastructure/Transition.h>
+
+
+namespace sep
+{
+
+
+/**
+ * COPY TO
+ */
+void CompositePart::copyMachineTo(
+ Collection< Machine * > & rawContainer) const
+{
+ const_machine_iterator it = machine_begin();
+ const_machine_iterator endIt = machine_end();
+ for( ; it != endIt ; ++it )
+ {
+ rawContainer.append( it );
+ }
+}
+
+
+/**
+ * GETTER for PARSER / COMPILER
+ * Machine
+ */
+Machine * CompositePart::rawExecutableMachineByQualifiedNameID(
+ const std::string & aQualifiedNameID) const
+{
+ return( mMachines.rawByNameID(aQualifiedNameID) );
+
+ const_machine_iterator it = machine_begin();
+ const_machine_iterator endIt = machine_end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (it)->getSpecifier().hasDesignModel()
+ && (it)->fqnEndsWith(aQualifiedNameID) )
+ {
+ return( it );
+ }
+ }
+ return( NULL );
+}
+
+
+/**
+ * DISPATCH
+ * mOwnedElements
+ */
+void CompositePart::dispatchOwnedElement(const BF & anElement)
+{
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( anElement )
+ << "Executable Machine owned element !!!"
+ << SEND_EXIT;
+
+ Machine * aMachine = anElement.to_ptr< Machine >();
+
+ if( aMachine->getSpecifier().isDesignInstanceStatic() )
+ {
+ appendMachine( anElement );
+
+ appendInstanceStatic( anElement );
+ }
+ else if( aMachine->getSpecifier().isDesignInstanceDynamic() )
+ {
+ appendInstanceDynamic( anElement );
+ }
+ else if( aMachine->getSpecifier().isFamilyComponentState() )
+ {
+ appendMachine( anElement );
+
+ appendState( anElement );
+ }
+ else if( aMachine->getSpecifier().isComponentProcedure() )
+ {
+ appendProcedure( anElement );
+ }
+ else
+ {
+ appendMachine( anElement );
+ }
+}
+
+
+/**
+ * GETTER - SETTER
+ * mOutgoingTransitions
+ */
+void CompositePart::appendOutgoingTransitionToEveryState(Machine * aGroupState)
+{
+ if( aGroupState->hasOutgoingTransition() )
+ {
+ BehavioralPart * aGroupStateBehavior = aGroupState->getBehavior();
+ BehavioralPart::const_transition_iterator endTransition =
+ aGroupStateBehavior->outgoing_transition_end();
+ BehavioralPart::const_transition_iterator itTransition;
+ Transition * newTransition;
+
+ CompositePart * aGroupCompositePart = aGroupState->getCompositePart();
+ const_state_iterator itMachine = aGroupCompositePart->state_begin();
+ const_state_iterator endMachine = aGroupCompositePart->state_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ if( (itMachine)->getSpecifier().isStateSimple()
+ && (not (itMachine)->getSpecifier().hasGroupMask()) )
+ {
+ itTransition = aGroupStateBehavior->outgoing_transition_begin();
+ for( ; itTransition != endTransition ; ++itTransition )
+ {
+ newTransition = new Transition((itMachine), (itTransition));
+
+ (itMachine)->getUniqBehaviorPart()->
+ saveOutgoingTransition( newTransition );
+ }
+ }
+ }
+ }
+}
+
+
+void CompositePart::appendOutgoingTransitionToSomeState(Machine * aGroupState)
+{
+ if( aGroupState->hasOutgoingTransition() )
+ {
+ BehavioralPart * aGroupStateBehavior = aGroupState->getBehavior();
+ BehavioralPart::const_transition_iterator endTransition =
+ aGroupStateBehavior->outgoing_transition_end();
+ BehavioralPart::const_transition_iterator itTransition;
+ Transition * newTransition;
+
+ const ListOfString & listofId = aGroupState->getGroupId();
+
+ CompositePart * aGroupCompositePart = aGroupState->getCompositePart();
+ const_state_iterator itMachine = aGroupCompositePart->state_begin();
+ const_state_iterator endMachine = aGroupCompositePart->state_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ if( (itMachine)->getSpecifier().isStateSimple()
+ && (not (itMachine)->getSpecifier().hasGroupMask())
+ && listofId.contains((itMachine)->getNameID()) )
+ {
+ itTransition = aGroupStateBehavior->outgoing_transition_begin();
+ for( ; itTransition != endTransition ; ++itTransition )
+ {
+ newTransition = new Transition((itMachine), (itTransition));
+
+ (itMachine)->getUniqBehaviorPart()->
+ saveOutgoingTransition( newTransition );
+ }
+ }
+ }
+ }
+}
+
+void CompositePart::appendOutgoingTransitionToExceptState(Machine * aGroupState)
+{
+ if( aGroupState->hasOutgoingTransition() )
+ {
+ BehavioralPart * aGroupStateBehavior = aGroupState->getBehavior();
+ BehavioralPart::const_transition_iterator endTransition =
+ aGroupStateBehavior->outgoing_transition_end();
+ BehavioralPart::const_transition_iterator itTransition;
+ Transition * newTransition;
+
+ const ListOfString & listofId = aGroupState->getGroupId();
+
+ CompositePart * aGroupCompositePart = aGroupState->getCompositePart();
+ const_state_iterator itMachine = aGroupCompositePart->state_begin();
+ const_state_iterator endMachine = aGroupCompositePart->state_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ if( (itMachine)->getSpecifier().isStateSimple()
+ && (not (itMachine)->getSpecifier().hasGroupMask())
+ && (not listofId.contains((itMachine)->getNameID())) )
+ {
+ itTransition = aGroupStateBehavior->outgoing_transition_begin();
+ for( ; itTransition != endTransition ; ++itTransition )
+ {
+ newTransition = new Transition((itMachine), (itTransition));
+
+ (itMachine)->getUniqBehaviorPart()->
+ saveOutgoingTransition( newTransition );
+ }
+ }
+ }
+ }
+}
+
+
+void CompositePart::expandGroupStatemachine()
+{
+ const_state_iterator itMachine = state_begin();
+ const_state_iterator endMachine = state_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ if( (itMachine)->getSpecifier().hasGroupMask() )
+ {
+ if( (itMachine)->getSpecifier().isGroupEvery())
+ {
+ appendOutgoingTransitionToEveryState( (itMachine) );
+ }
+ else if( (itMachine)->getSpecifier().isGroupSome())
+ {
+ appendOutgoingTransitionToSomeState( (itMachine) );
+ }
+ else if( (itMachine)->getSpecifier().isGroupExcept() )
+ {
+ appendOutgoingTransitionToExceptState( (itMachine) );
+ }
+ }
+ }
+}
+
+
+/**
+ * Serialization
+ */
+void CompositePart::toStream(OutStream & os) const
+{
+ if( hasProcedure() )
+ {
+ os << TAB << "procedure:" << EOL_INCR_INDENT;
+ const_procedure_iterator it = procedure_begin();
+ const_procedure_iterator endIt = procedure_end();
+ for( ; it != endIt ; ++it )
+ {
+ (it)->toStream(os);
+ os << EOL;
+ }
+ os << DECR_INDENT;
+ }
+
+ if( hasState() )
+ {
+ const std::string & sequenceName = ( getContainerMachine()->
+ getSpecifier().isComponentStatemachine() ?
+ "region" : "statemachine" );
+
+ os << TAB << "/*" << sequenceName << ": [" << EOL_INCR_INDENT
+ << str_header( mStates ) << DECR_INDENT_TAB
+ << "] // end " << sequenceName << "*/" << EOL2_FLUSH;
+
+// os << TAB << sequenceName << ":" << EOL_INCR_INDENT;
+//
+// const_state_iterator it = state_begin();
+// const_state_iterator endIt = state_end();
+// for( ; it != endIt ; ++it )
+// {
+// (it)->toStream(os);
+// os << EOL;
+// }
+// os << DECR_INDENT;
+ }
+
+ if( hasMachine() )
+ {
+ os << TAB << getNameID() /*composite*/ << ":" << EOL_INCR_INDENT;
+
+ const_machine_iterator it = machine_begin();
+ const_machine_iterator endIt = machine_end();
+ for( ; it != endIt ; ++it )
+ {
+ (it)->toStream(os);
+ os << EOL;
+ }
+ os << DECR_INDENT;
+ }
+
+ if( hasInstanceStatic() )
+ {
+ os << TAB << "/*instance: [" << EOL_INCR_INDENT
+ << str_header( mInstanceStatics ) << DECR_INDENT_TAB
+ << "] // end instance*/" << EOL2_FLUSH;
+
+// os << TAB << "instance:" << EOL_INCR_INDENT;
+//
+// const_instance_iterator it = instance_begin();
+// const_instance_iterator endIt = instance_end();
+// for( ; it != endIt ; ++it )
+// {
+// (it)->toStream(os);
+// }
+// os << DECR_INDENT;
+ }
+
+ if( hasInstanceDynamic() )
+ {
+// os << TAB << "/*#dynamic instance: [" << EOL_INCR_INDENT
+// << str_header( mInstanceDynamics ) << DECR_INDENT_TAB
+// << "] // end dynamic*/" << EOL2_FLUSH;
+
+ os << TAB << "instance#dynamic:" << EOL_INCR_INDENT;
+ const_machine_iterator it = instance_dynamic_begin();
+ const_machine_iterator endIt = instance_dynamic_end();
+ for( ; it != endIt ; ++it )
+ {
+ (it)->toStream(os);
+ os << EOL;
+ }
+ os << DECR_INDENT;
+ }
+
+ os << std::flush;
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/CompositePart.h b/org.eclipse.efm.symbex/src/fml/infrastructure/CompositePart.h
new file mode 100644
index 0000000..f7b3d01
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/CompositePart.h
@@ -0,0 +1,361 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 29 mars 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef FML_INFRASTRUCTURE_COMPOSITEPART_H_
+#define FML_INFRASTRUCTURE_COMPOSITEPART_H_
+
+#include <fml/common/ObjectClassifier.h>
+
+#include <collection/BFContainer.h>
+#include <collection/Collection.h>
+
+#include <fml/infrastructure/Machine.h>
+
+
+namespace sep
+{
+
+
+class Machine;
+
+
+class CompositePart :
+ public ObjectClassifier,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( CompositePart )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( CompositePart )
+
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef TableOfBF_T< Machine > TableOfMachine;
+
+ typedef TableOfMachine::const_raw_iterator const_procedure_iterator;
+
+ typedef TableOfMachine::const_raw_iterator const_state_iterator;
+
+ typedef TableOfMachine::const_raw_iterator const_machine_iterator;
+
+ typedef TableOfMachine::const_raw_iterator const_instance_iterator;
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ TableOfMachine mProcedures;
+
+ TableOfMachine mStates;
+
+ TableOfMachine mMachines;
+
+ TableOfMachine mInstanceStatics;
+
+ TableOfMachine mInstanceDynamics;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ CompositePart(Machine * aContainer,
+ const std::string & aNameID = "composite")
+ : ObjectClassifier( CLASS_KIND_T( CompositePart ) , aContainer , aNameID ),
+ mProcedures( ),
+ mStates( ),
+ mMachines( ),
+ mInstanceStatics( ),
+ mInstanceDynamics( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~CompositePart()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DISPATCH
+ * mOwnedElements
+ */
+ void dispatchOwnedElement(const BF & anElement);
+
+
+ /**
+ * GETTER - SETTER
+ * mProcedures
+ */
+ inline const TableOfMachine & getProcedures() const
+ {
+ return( mProcedures );
+ }
+
+ inline bool hasProcedure() const
+ {
+ return( mProcedures.nonempty() );
+ }
+
+ inline void appendProcedure(const BF & aProcedure)
+ {
+ mProcedures.append( aProcedure );
+ }
+
+ inline void saveProcedure(Machine * aProcedure)
+ {
+ mProcedures.append( BF(aProcedure) );
+ }
+
+
+ /**
+ * [ CONST ] ITERATOR
+ */
+ inline const_procedure_iterator procedure_begin() const
+ {
+ return( mProcedures.begin() );
+ }
+
+ inline const_procedure_iterator procedure_end() const
+ {
+ return( mProcedures.end() );
+ }
+
+ /**
+ * GETTER for PARSER / COMPILER
+ * Procedure
+ */
+ inline const BF & getProcedureByNameID(const std::string & aNameID) const
+ {
+ return( mProcedures.getByNameID(aNameID) );
+ }
+
+ inline Machine * rawProcedureByNameID(const std::string & aNameID) const
+ {
+ return( mProcedures.rawByNameID(aNameID) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mStates
+ */
+ inline const TableOfMachine & getStates() const
+ {
+ return( mStates );
+ }
+
+ inline bool hasState() const
+ {
+ return( mStates.nonempty() );
+ }
+
+ inline void appendState(const BF & aState)
+ {
+ mStates.append( aState );
+ }
+
+ inline void saveState(Machine * aState)
+ {
+ mStates.append( BF(aState) );
+ }
+
+
+ /**
+ * [ CONST ] ITERATOR
+ */
+ inline const_state_iterator state_begin() const
+ {
+ return( mStates.begin() );
+ }
+
+ inline const_state_iterator state_end() const
+ {
+ return( mStates.end() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mOutgoingTransitions
+ */
+ void appendOutgoingTransitionToEveryState(Machine * aGroupState);
+
+ void appendOutgoingTransitionToSomeState(Machine * aGroupState);
+
+ void appendOutgoingTransitionToExceptState(Machine * aGroupState);
+
+ void expandGroupStatemachine();
+
+
+ /**
+ * GETTER - SETTER
+ * mMachines
+ */
+ inline const TableOfMachine & getMachines() const
+ {
+ return( mMachines );
+ }
+
+ inline bool hasMachine() const
+ {
+ return( mMachines.nonempty() );
+ }
+
+ inline void appendMachine(const BF & aMachine)
+ {
+ mMachines.append( aMachine );
+ }
+
+ inline void saveMachine(Machine * aMachine)
+ {
+ mMachines.append( BF(aMachine) );
+ }
+
+
+ /**
+ * COPY TO
+ */
+ void copyMachineTo(Collection< Machine * > & rawContainer) const;
+
+
+ /**
+ * [ CONST ] ITERATOR
+ */
+ inline const_machine_iterator machine_begin() const
+ {
+ return( mMachines.begin() );
+ }
+
+ inline const_machine_iterator machine_end() const
+ {
+ return( mMachines.end() );
+ }
+
+
+ /**
+ * GETTER for PARSER / COMPILER
+ * Machine
+ */
+ inline const BF & getMachineByNameID(const std::string & aNameID) const
+ {
+ return( mMachines.getByNameID(aNameID) );
+ }
+
+ inline Machine * rawMachineByNameID(const std::string & aNameID) const
+ {
+ return( mMachines.rawByNameID(aNameID) );
+ }
+
+
+ Machine * rawExecutableMachineByQualifiedNameID(
+ const std::string & aQualifiedNameID) const;
+
+
+ /**
+ * GETTER - SETTER
+ * mInstanceStatics
+ */
+ inline const TableOfMachine & getInstanceStatics() const
+ {
+ return( mInstanceStatics );
+ }
+
+ inline bool hasInstanceStatic() const
+ {
+ return( mInstanceStatics.nonempty() );
+ }
+
+ inline void appendInstanceStatic(const BF & anInstance)
+ {
+ mInstanceStatics.append( anInstance );
+ }
+
+ inline void saveInstanceStatic(Machine * anInstance)
+ {
+ mInstanceStatics.append( BF(anInstance) );
+ }
+
+
+ /**
+ * [ CONST ] ITERATOR
+ */
+ inline const_instance_iterator instance_static_begin() const
+ {
+ return( mInstanceStatics.begin() );
+ }
+
+ inline const_instance_iterator instance_static_end() const
+ {
+ return( mInstanceStatics.end() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mInstanceDynamics
+ */
+ inline const TableOfMachine & getInstanceDynamics() const
+ {
+ return( mInstanceDynamics );
+ }
+
+ inline bool hasInstanceDynamic() const
+ {
+ return( mInstanceDynamics.nonempty() );
+ }
+
+ inline void appendInstanceDynamic(const BF & anInstanceDynamic)
+ {
+ mInstanceDynamics.append( anInstanceDynamic );
+ }
+
+ inline void saveInstanceDynamic(Machine * anInstanceDynamic)
+ {
+ mInstanceDynamics.append( BF(anInstanceDynamic) );
+ }
+
+
+ /**
+ * [ CONST ] ITERATOR
+ */
+ inline const_instance_iterator instance_dynamic_begin() const
+ {
+ return( mInstanceDynamics.begin() );
+ }
+
+ inline const_instance_iterator instance_dynamic_end() const
+ {
+ return( mInstanceDynamics.end() );
+ }
+
+
+ /**
+ * Serialization
+ */
+ void toStream(OutStream & os) const;
+
+};
+
+
+} /* namespace sep */
+
+#endif /* FML_INFRASTRUCTURE_COMPOSITEPART_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/Connector.cpp b/org.eclipse.efm.symbex/src/fml/infrastructure/Connector.cpp
new file mode 100644
index 0000000..08ea952
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/Connector.cpp
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 18 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "Connector.h"
+
+#include <fml/lib/IComPoint.h>
+
+#include <fml/infrastructure/InteractionPart.h>
+#include <fml/infrastructure/Machine.h>
+
+
+namespace sep
+{
+
+
+std::string Connector::ANONYM_ID = "_#connector";
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+Connector::Connector(const InteractionPart & anInteractionPart)
+: ObjectElement( CLASS_KIND_T( Connector ), anInteractionPart.getContainer()),
+ComProtocol( PROTOCOL_UNDEFINED_KIND ),
+mComRoutes( )
+{
+ //!! NOTHING
+}
+
+
+/**
+ * Serialization
+ */
+void Connector::toStream(OutStream & out) const
+{
+ out << TAB << getModifier().toString()
+ << (isPort() ? "connector" : "route");
+
+ toStreamProtocolCast( out , true ) << " " << getNameID() << " {" << EOL;
+
+ if( mComRoutes.nonempty() )
+ {
+ ScopeIncrIndent asii(out);
+
+ route_iterator endIt = mComRoutes.end();
+ for( route_iterator it = mComRoutes.begin() ; it != endIt ; ++it )
+ {
+ (*it)->toStream(out);
+ }
+ }
+
+ out << TAB << "}" << EOL << std::flush;
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/Connector.h b/org.eclipse.efm.symbex/src/fml/infrastructure/Connector.h
new file mode 100644
index 0000000..8f1893a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/Connector.h
@@ -0,0 +1,136 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 18 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef FML_INFRASTRUCTURE_CONNECTOR_H_
+#define FML_INFRASTRUCTURE_CONNECTOR_H_
+
+#include <fml/common/ObjectElement.h>
+#include <fml/infrastructure/ComProtocol.h>
+
+#include <common/AvmPointer.h>
+
+#include <collection/Typedef.h>
+
+
+#include <fml/infrastructure/ComRoute.h>
+
+
+namespace sep
+{
+
+
+class InteractionPart;
+
+
+class Connector :
+ public ObjectElement,
+ public ComProtocol,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( Connector )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( Connector )
+
+protected:
+ /**
+ * TYPEDEF
+ */
+ typedef APList < ComRoute * > APListOfComRoute;
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef APListOfComRoute::const_iterator route_iterator;
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ APListOfComRoute mComRoutes;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Connector(const InteractionPart & anInteractionPart);
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Connector()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mComRoutes
+ */
+ inline route_iterator begin() const
+ {
+ return( mComRoutes.begin() );
+ }
+
+ inline route_iterator end() const
+ {
+ return( mComRoutes.end() );
+ }
+
+
+ inline APListOfComRoute & getComRoutes()
+ {
+ return( mComRoutes );
+ }
+
+ inline const APListOfComRoute & getComRoutes() const
+ {
+ return( mComRoutes );
+ }
+
+ inline void appendComRoute(ComRoute * aComRoute)
+ {
+ mComRoutes.append( aComRoute );
+ }
+
+
+ /**
+ * Serialization
+ */
+ void toStream(OutStream & out) const;
+
+
+public:
+
+ /**
+ * ATTRIBUTES
+ */
+ static std::string ANONYM_ID;
+
+ inline bool isAnonymID() const
+ {
+ return( getNameID().empty() || (getNameID().find(ANONYM_ID) == 0) );
+ }
+
+};
+
+
+}
+
+#endif /* FML_INFRASTRUCTURE_CONNECTOR_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/DataType.cpp b/org.eclipse.efm.symbex/src/fml/infrastructure/DataType.cpp
new file mode 100644
index 0000000..3d48df3
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/DataType.cpp
@@ -0,0 +1,792 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 15 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "DataType.h"
+
+#include <fml/type/BaseTypeSpecifier.h>
+#include <fml/type/ContainerTypeSpecifier.h>
+#include <fml/type/TypeManager.h>
+
+#include <fml/infrastructure/BehavioralPart.h>
+#include <fml/infrastructure/Machine.h>
+#include <fml/infrastructure/Routine.h>
+#include <fml/infrastructure/PropertyPart.h>
+
+
+namespace sep
+{
+
+
+std::string DataType::ANONYM_ID = "_#type";
+
+
+/**
+ * CONSTRUCTOR
+ * Interval
+ */
+DataType::DataType(Machine * aContainer, const std::string & aNameID,
+ const BF & aTypeSpecifier, IIntervalKind::KIND anIntervalKind,
+ const BF & anInfimum, const BF & aSupremum)
+: ObjectElement(CLASS_KIND_T( DataType ), aContainer, aNameID),
+mSpecifierKind( TYPE_INTERVAL_SPECIFIER ),
+mTypeSpecifier( aTypeSpecifier ),
+mConstraintRoutine( NULL ),
+
+mMinimumSize( 1 ),
+mMaximumSize( 1 ),
+
+mPropertyPart( NULL ),
+mBehavioralSpecification( NULL ),
+
+mIntervalKind( anIntervalKind ),
+mInfimum( anInfimum ),
+mSupremum( aSupremum )
+{
+//!! NOTHING
+}
+
+/**
+ * CONSTRUCTOR
+ * Container
+ * Alias
+ */
+DataType::DataType(ObjectElement * aContainer,
+ const std::string & aNameID,
+ avm_type_specifier_kind_t aSpecifierKind,
+ const BF & aTypeSpecifier, long maxSize)
+: ObjectElement(CLASS_KIND_T( DataType ), aContainer, aNameID),
+mSpecifierKind( aSpecifierKind ),
+mTypeSpecifier( aTypeSpecifier ),
+mConstraintRoutine( NULL ),
+
+mMinimumSize( 0 ),
+mMaximumSize( maxSize ),
+
+mPropertyPart( NULL ),
+mBehavioralSpecification( NULL ),
+
+mIntervalKind( IIntervalKind::CLOSED ),
+mInfimum( ),
+mSupremum( )
+{
+ //!! NOTHING
+}
+
+/**
+ * CONSTRUCTOR
+ * Enum
+ * Structure
+ * Union
+ */
+DataType::DataType(ObjectElement * aContainer,
+ const std::string & aNameID,
+ avm_type_specifier_kind_t aSpecifierKind)
+: ObjectElement(CLASS_KIND_T( DataType ), aContainer, aNameID),
+mSpecifierKind( aSpecifierKind ),
+mTypeSpecifier( ),
+mConstraintRoutine( NULL ),
+
+mMinimumSize( 1 ),
+mMaximumSize( 1 ),
+
+mPropertyPart( NULL ),
+mBehavioralSpecification( NULL ),
+
+mIntervalKind( IIntervalKind::CLOSED ),
+mInfimum( ),
+mSupremum( )
+{
+ //!! NOTHING
+}
+
+
+/**
+ * CONSTRUCTOR
+ * Copy
+ */
+DataType::DataType(const DataType & aDataType)
+: ObjectElement( aDataType ),
+mSpecifierKind( aDataType.mSpecifierKind ),
+mTypeSpecifier( aDataType.mTypeSpecifier ),
+mConstraintRoutine( aDataType.mConstraintRoutine ),
+
+mMinimumSize( aDataType.mMinimumSize ),
+mMaximumSize( aDataType.mMaximumSize ),
+
+mPropertyPart( (aDataType.mPropertyPart == NULL) ?
+ NULL : new PropertyPart( *(aDataType.mPropertyPart) ) ),
+
+mBehavioralSpecification( (aDataType.mBehavioralSpecification == NULL) ?
+ NULL : new BehavioralPart( *(aDataType.mBehavioralSpecification) ) ),
+
+
+mIntervalKind( aDataType.mIntervalKind ),
+mInfimum( aDataType.mInfimum ),
+mSupremum( aDataType.mSupremum )
+{
+ //!! NOTHING
+}
+
+
+/**
+ * DESTRUCTOR
+ */
+DataType::~DataType()
+{
+ delete( mPropertyPart );
+
+ delete( mBehavioralSpecification );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// INTERVAL
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+/**
+ * CONSTRUCTOR
+ * Interval
+ */
+DataType * DataType::newInterval(
+ Machine * aContainer, const std::string & aNameID,
+ const BF & aTypeSpecifier, IIntervalKind::KIND anIntervalKind,
+ const BF & anInfimum, const BF & aSupremum)
+{
+ return( new DataType(aContainer, aNameID, aTypeSpecifier,
+ anIntervalKind, anInfimum, aSupremum) );
+}
+
+/**
+ * GETTER
+ * Interval Length
+ */
+avm_integer_t DataType::getIntervalLength()
+{
+ avm_integer_t infBound = AVM_NUMERIC_MIN_INTEGER;
+ avm_integer_t supBound = AVM_NUMERIC_MAX_INTEGER;
+
+ if( mInfimum.isUInteger() )
+ {
+ infBound = mInfimum.toUInteger();
+ }
+ else if( mInfimum.is< Variable >() )
+ {
+ Variable * aVar = mInfimum.to_ptr< Variable >();
+
+ if( aVar->hasValue() && aVar->getValue().isUInteger() )
+ {
+ infBound = aVar->getValue().toUInteger();
+ }
+ else
+ {
+ return( -1 );
+ }
+ }
+ else
+ {
+ return( -1 );
+ }
+
+
+ if( mSupremum.isUInteger() )
+ {
+ supBound = mSupremum.toUInteger();
+ }
+ else if( mSupremum.is< Variable >() )
+ {
+ Variable * aVar = mSupremum.to_ptr< Variable >();
+
+ if( aVar->hasValue() && aVar->getValue().isUInteger() )
+ {
+ supBound = aVar->getValue().toUInteger();
+ }
+ else
+ {
+ return( -1 );
+ }
+ }
+ else
+ {
+ return( -1 );
+ }
+
+
+ return( supBound - infBound + ( isCLOSED() ? 1 : 0 ) );
+}
+
+
+
+/**
+ * Serialization
+ */
+void DataType::toStreamInterval(OutStream & os) const
+{
+ os << " interval< " << getTypeSpecifier().str() << strIso_Interval() << " >";
+
+ if( hasConstraintRoutine() )
+ {
+ os << " {" << EOL_INCR_INDENT;
+ getConstraintRoutine()->toStream(os);
+ os << DECR_INDENT_TAB << "}";
+ }
+ else
+ {
+ os << ";";
+ }
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CONTAINER
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * CONSTRUCTOR
+ * Container
+ */
+DataType * DataType::newContainer(
+ Machine * aContainer, const std::string & aNameID,
+ avm_type_specifier_kind_t aSpecifierKind, long aSize)
+{
+ return( new DataType(aContainer, aNameID,
+ aSpecifierKind, TypeManager::UNIVERSAL, aSize) );
+}
+
+DataType * DataType::newContainer(
+ Machine * aContainer, const std::string & aNameID,
+ avm_type_specifier_kind_t aSpecifierKind,
+ const BF & aTypeSpecifier, long aSize)
+{
+ return( new DataType(aContainer, aNameID,
+ aSpecifierKind, aTypeSpecifier, aSize) );
+}
+
+/**
+ * Serialization
+ */
+std::string DataType::strContainerId(
+ avm_type_specifier_kind_t aSpecifierKind, const BF & baseT, long aSize)
+{
+ std::ostringstream oss;
+
+ if( aSpecifierKind != TYPE_ARRAY_SPECIFIER )
+ {
+ oss << ContainerTypeSpecifier::strSpecifierKing(aSpecifierKind) << "<";
+ }
+
+ if( baseT.valid() )
+ {
+ if( baseT == TypeManager::UNIVERSAL)
+ {
+ oss << "<universal>";
+ }
+ else if( baseT.is< BaseTypeSpecifier >() )
+ {
+ oss << baseT.to_ptr< BaseTypeSpecifier >()->strT();
+ }
+ else if( baseT.is< DataType >() )
+ {
+ oss << baseT.to_ptr< DataType >()->strT();
+ }
+ else if( baseT.is< ObjectElement >() )
+ {
+ oss << baseT.to_ptr< ObjectElement >()->getNameID();
+ }
+ else
+ {
+ oss << "<type>";
+ }
+ }
+ else
+ {
+ oss << "<null>";
+ }
+
+ if( aSpecifierKind != TYPE_ARRAY_SPECIFIER )
+ {
+ if( aSize >= 0 )
+ {
+ oss << " , " << aSize << ">";
+ }
+ else
+ {
+ oss << " , * >";
+ }
+ }
+ else
+ {
+ oss << "[ " << aSize << " ]";
+ }
+
+ return( oss.str() );
+}
+
+
+std::string DataType::strContainerId(
+ avm_type_specifier_kind_t aSpecifierKind, long aSize)
+{
+ std::ostringstream os;
+
+ os << ContainerTypeSpecifier::strSpecifierKing(aSpecifierKind);
+
+ if( aSize >= 0 )
+ {
+ os << "<" << aSize << ">";
+ }
+ else
+ {
+ os << "<*>";
+ }
+
+ return( os.str() );
+}
+
+
+std::string DataType::strContainerType() const
+{
+ std::ostringstream oss;
+
+ if( isTypedArray() )
+ {
+ if( mTypeSpecifier.is< BaseTypeSpecifier >() )
+ {
+ oss << mTypeSpecifier.to_ptr< BaseTypeSpecifier >()->strT();
+ }
+ else if( mTypeSpecifier.is< DataType >() )
+ {
+ oss << mTypeSpecifier.to_ptr< DataType >()->strT();
+ }
+
+ oss << "[ " << mMaximumSize << " ]";
+ }
+ else
+ {
+ oss << ContainerTypeSpecifier::strSpecifierKing(mSpecifierKind);
+
+ if( mTypeSpecifier.valid() )
+ {
+ if( mTypeSpecifier.is< BaseTypeSpecifier >() )
+ {
+ oss << "< " << mTypeSpecifier.to_ptr<
+ BaseTypeSpecifier >()->strT();
+ }
+ else if( mTypeSpecifier.is< DataType >() )
+ {
+ oss << "< " << mTypeSpecifier.to_ptr< DataType >()->strT();
+ }
+ else if( mTypeSpecifier.is< ObjectElement >() )
+ {
+ oss << "< "
+ << mTypeSpecifier.to_ptr< ObjectElement >()->getNameID();
+ }
+ else
+ {
+ oss << "< ?";
+ }
+ }
+ else
+ {
+ oss << "< null<type>";
+ }
+
+ if( mMaximumSize >= 0 )
+ {
+ oss << " , " << mMaximumSize;
+ }
+
+ oss << " >";
+ }
+
+ return( oss.str() );
+}
+
+
+void DataType::toStreamContainer(OutStream & os) const
+{
+ os << " " << strContainerType();
+
+ if( hasConstraintRoutine() )
+ {
+ os << " {" << EOL_INCR_INDENT;
+ getConstraintRoutine()->toStream(os);
+ os << DECR_INDENT_TAB << "}";
+ }
+ else
+ {
+ os << ";";
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// ENUMERATIOIN
+// STRUCTURE
+// UNION
+////////////////////////////////////////////////////////////////////////////////
+/**
+ * GETTER
+ * mPropertyPart
+ */
+bool DataType::hasProperty() const
+{
+ return( (mPropertyPart != NULL)
+ && mPropertyPart->nonempty() );
+}
+
+/**
+ * GETTER - SETTER
+ * mBehavioralSpecification
+ */
+BehavioralPart * DataType::getUniqBehaviorPart()
+{
+ if( mBehavioralSpecification == NULL )
+ {
+ mBehavioralSpecification = new BehavioralPart(this, "moe");
+ }
+
+ return( mBehavioralSpecification );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// ENUMERATIOIN
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * CONSTRUCTOR
+ * Enum
+ */
+DataType * DataType::newEnum(
+ const PropertyPart & aPropertyPart, const std::string & aNameID)
+{
+ DataType * newDataType = new DataType(
+ aPropertyPart.getContainer(), aNameID, TYPE_ENUM_SPECIFIER );
+
+ newDataType->setPropertyPart( new PropertyPart(newDataType, "symbol") );
+
+ return( newDataType );
+}
+
+/**
+ * GETTER
+ * Enumeration Size
+ * Interval Length
+ */
+avm_size_t DataType::getEnumSize()
+{
+ return( (mPropertyPart != NULL) ? mPropertyPart->getVariables().size() : 0 );
+}
+
+/**
+ * GETTER - SETTER
+ * mVariables
+ */
+void DataType::appendVariable(const BF & aVariable)
+{
+ mPropertyPart->appendVariable( aVariable );
+}
+
+void DataType::saveVariable(Variable * aVariable)
+{
+ mPropertyPart->saveOwnedVariable( aVariable );
+}
+
+
+/**
+ * Serialization
+ */
+void DataType::toStreamEnum(OutStream & os) const
+{
+ os << " enum {" << EOL_FLUSH;
+
+ if( mPropertyPart->hasVariable() )
+ {
+ TableOfVariable::const_raw_iterator it =
+ mPropertyPart->getVariables().begin();
+ TableOfVariable::const_raw_iterator endIt =
+ mPropertyPart->getVariables().end();
+
+ os << TAB2 << (it)->getNameID();
+ if( (it)->hasValue() )
+ {
+ os << " = " << (it)->strValue();
+ }
+ for( ++it ; it != endIt ; ++it )
+ {
+ os << "," << EOL;
+
+ os << TAB2 << (it)->getNameID();
+ if( (it)->hasValue() )
+ {
+ os << " = " << (it)->strValue();
+ }
+ }
+ os << EOL;
+ }
+
+ os << TAB << "}";
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// STRUCTURE
+////////////////////////////////////////////////////////////////////////////////
+/**
+ * CONSTRUCTOR
+ * Structure
+ */
+DataType * DataType::newStructure(
+ const PropertyPart & aPropertyPart, const std::string & aNameID)
+{
+ DataType * newDataType = new DataType(
+ aPropertyPart.getContainer(), aNameID, TYPE_CLASS_SPECIFIER );
+
+ newDataType->setPropertyPart( new PropertyPart(newDataType, "property") );
+
+ return( newDataType );
+}
+
+/**
+ * Serialization
+ */
+void DataType::toStreamStructure(OutStream & os) const
+{
+ os << " struct {" << EOL_FLUSH;
+
+ if( hasProperty() )
+ {
+ mPropertyPart->toStream(os);
+ }
+
+ if( hasBehavior() && mBehavioralSpecification->hasAnyRoutine() )
+ {
+ mBehavioralSpecification->toStreamAnyRoutine( os << EOL );
+ }
+
+ os << TAB << "}";
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CHOICE
+////////////////////////////////////////////////////////////////////////////////
+/**
+ * CONSTRUCTOR
+ * Choice
+ */
+DataType * DataType::newChoice(
+ const PropertyPart & aPropertyPart, const std::string & aNameID)
+{
+ DataType * newDataType = new DataType(
+ aPropertyPart.getContainer(), aNameID, TYPE_CHOICE_SPECIFIER );
+
+ newDataType->setPropertyPart( new PropertyPart(newDataType, "property") );
+
+ return( newDataType );
+}
+
+/**
+ * Serialization
+ */
+void DataType::toStreamChoice(OutStream & os) const
+{
+ os << " choice {" << EOL_FLUSH;
+
+ if( hasProperty() )
+ {
+ mPropertyPart->toStream(os);
+ }
+
+ os << TAB << "}";
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// UNION
+////////////////////////////////////////////////////////////////////////////////
+/**
+ * CONSTRUCTOR
+ * Union
+ */
+DataType * DataType::newUnion(
+ const PropertyPart & aPropertyPart, const std::string & aNameID)
+{
+ DataType * newDataType = new DataType(
+ aPropertyPart.getContainer(), aNameID, TYPE_UNION_SPECIFIER );
+
+ newDataType->setPropertyPart( new PropertyPart(newDataType, "property") );
+
+ return( newDataType );
+}
+
+/**
+ * Serialization
+ */
+void DataType::toStreamUnion(OutStream & os) const
+{
+ os << " union {" << EOL_FLUSH;
+
+ if( hasProperty() )
+ {
+ mPropertyPart->toStream(os);
+ }
+
+ os << TAB << "}";
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// ALIAS
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * CONSTRUCTOR
+ * Alias
+ */
+DataType * DataType::newAlias(const PropertyPart & aPropertyPart,
+ const std::string & aNameID, const BF & aTypeSpecifier)
+{
+ return( new DataType(aPropertyPart.getContainer(),
+ aNameID, TYPE_ALIAS_SPECIFIER, aTypeSpecifier, 1) );
+}
+
+/**
+ * Serialization
+ */
+void DataType::toStreamAlias(OutStream & os) const
+{
+ if( mTypeSpecifier.is< BaseTypeSpecifier >() )
+ {
+ os << " " << mTypeSpecifier.to_ptr< BaseTypeSpecifier >()->strT();
+ }
+ else if( mTypeSpecifier.is< DataType >() )
+ {
+ os << " " << mTypeSpecifier.to_ptr< DataType >()->strT();
+ }
+ else
+ {
+ os << str_indent( mTypeSpecifier );
+ }
+
+ if( mConstraintRoutine!= NULL )
+ {
+ os << " {" << EOL_INCR_INDENT;
+ mConstraintRoutine->toStream(os);
+ os << DECR_INDENT_TAB << "}";
+ }
+ else
+ {
+ os << ";";
+ }
+}
+
+
+
+
+/**
+ * Serialization
+ */
+std::string DataType::strTypeSpecifier(const BF & aTypeSpecifier)
+{
+ if( aTypeSpecifier.valid() )
+ {
+ if( aTypeSpecifier.is< BaseTypeSpecifier >() )
+ {
+ return aTypeSpecifier.to_ptr< BaseTypeSpecifier >()->strT();
+ }
+ else if( aTypeSpecifier.is< DataType >() )
+ {
+ return aTypeSpecifier.to_ptr< DataType >()->strT();
+ }
+ else
+ {
+ return( OSS() << "type< " << aTypeSpecifier.str() << ">" );
+ }
+ }
+ else
+ {
+ return( "type<null>" );
+ }
+}
+
+
+void DataType::strHeader(OutStream & os) const
+{
+ os << getModifier().toString()
+ << "type " << getFullyQualifiedNameID(); //<< getNameID();
+
+ if( hasUnrestrictedName() )
+ {
+ os << " \"" << getUnrestrictedName() << "\"";
+ }
+}
+
+
+void DataType::toStream(OutStream & os) const
+{
+ if( os.preferablyFQN() )
+ {
+ os << TAB << getFullyQualifiedNameID();
+
+ AVM_DEBUG_REF_COUNTER(os);
+
+ return;
+ }
+
+ os << TAB << getModifier().toString() << "type " << getNameID();
+
+
+ if( hasTypeContainer() )
+ {
+ toStreamContainer(os);
+ }
+ else if( isTypedInterval() )
+ {
+ toStreamInterval(os);
+ }
+ else if( isTypedEnum() )
+ {
+ toStreamEnum(os);
+ }
+ else if( isTypedStructure() )
+ {
+ toStreamStructure(os);
+ }
+
+ else if( isTypedChoice() )
+ {
+ toStreamChoice(os);
+ }
+
+ else if( isTypedUnion() )
+ {
+ toStreamUnion(os);
+ }
+
+ else// if( isTypedAlias() )
+ {
+ toStreamAlias(os);
+ }
+
+
+ os << EOL_FLUSH;
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/DataType.h b/org.eclipse.efm.symbex/src/fml/infrastructure/DataType.h
new file mode 100644
index 0000000..02aa4bc
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/DataType.h
@@ -0,0 +1,572 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 15 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef TYPEDEF_H_
+#define TYPEDEF_H_
+
+#include <fml/common/ObjectElement.h>
+
+#include <common/BF.h>
+
+#include <fml/lib/ITypeSpecifier.h>
+
+#include <fml/infrastructure/Routine.h>
+
+
+namespace sep
+{
+
+class BehavioralPart;
+
+class Machine;
+
+class PropertyPart;
+
+
+
+class DataType :
+ public ObjectElement ,
+ public ITypeSpecifier,
+ public IIntervalKind,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( DataType )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( DataType )
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ avm_type_specifier_kind_t mSpecifierKind;
+
+ // for Alias, Interval Support, Container Contents
+ BF mTypeSpecifier;
+
+ // for general purpose
+ Routine * mConstraintRoutine;
+
+ // for Container
+ long mMinimumSize;
+ long mMaximumSize;
+
+ // for Structure or Union
+ PropertyPart * mPropertyPart;
+ BehavioralPart * mBehavioralSpecification;
+
+
+ // for Interval
+ IIntervalKind::KIND mIntervalKind;
+
+ BF mInfimum;
+ BF mSupremum;
+
+
+private:
+ /**
+ * CONSTRUCTOR
+ * Interval
+ */
+ DataType(Machine * aContainer, const std::string & aNameID,
+ const BF & aTypeSpecifier, IIntervalKind::KIND anIntervalKind,
+ const BF & anInfimum, const BF & aSupremum);
+
+ /**
+ * CONSTRUCTOR
+ * Container
+ * Alias
+ */
+ DataType(ObjectElement * aContainer, const std::string & aNameID,
+ avm_type_specifier_kind_t aSpecifierKind,
+ const BF & aTypeSpecifier, long aSize);
+
+ /**
+ * CONSTRUCTOR
+ * Enum
+ * Structure
+ * Union
+ */
+ DataType(ObjectElement * aContainer, const std::string & aNameID,
+ avm_type_specifier_kind_t aSpecifierKind);
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ DataType(const DataType & aDataType);
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~DataType();
+
+
+ /**
+ * GETTER
+ * ITypeSpecifier API
+ */
+
+ inline virtual const BaseTypeSpecifier * thisTypeSpecifier() const
+ {
+ return( NULL );
+ }
+
+ inline virtual avm_type_specifier_kind_t getTypeSpecifierKind() const
+ {
+ return( mSpecifierKind );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mTypeSpecifier
+ */
+ inline const BF & getTypeSpecifier() const
+ {
+ return( mTypeSpecifier );
+ }
+
+ inline bool hasTypeSpecifier() const
+ {
+ return( mTypeSpecifier.valid() );
+ }
+
+ inline void setTypeSpecifier(const BF & aType)
+ {
+ mTypeSpecifier = aType;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mConstraint
+ */
+ inline Routine * getConstraintRoutine() const
+ {
+ return( mConstraintRoutine );
+ }
+
+ inline bool hasConstraintRoutine() const
+ {
+ return( mConstraintRoutine != NULL );
+ }
+
+ inline void setConstraintRoutine(Routine * aConstraintRoutine)
+ {
+ mConstraintRoutine = aConstraintRoutine;
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // INTERVAL
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * CONSTRUCTOR
+ * Interval
+ */
+ static DataType * newInterval(
+ Machine * aContainer, const std::string & aNameID,
+ const BF & aTypeSpecifier, IIntervalKind::KIND anIntervalKind,
+ const BF & anInfimum, const BF & aSupremum);
+
+ /**
+ * GETTER - SETTER
+ * mIntervalKind
+ * IIntervalKind API
+ */
+ inline virtual IIntervalKind::KIND getIntervalKind() const
+ {
+ return( mIntervalKind );
+ }
+
+
+ /**
+ * GETTER
+ * the Interval TypeSpecifier Support
+ */
+ inline const BF & getIntervalTypeSpecifier() const
+ {
+ return( mTypeSpecifier );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mInfimum
+ */
+ inline const BF & getIntervalInfimum() const
+ {
+ return( mInfimum );
+ }
+
+ inline bool hasIntervalInfimum() const
+ {
+ return( mInfimum.valid() );
+ }
+
+ inline void setIntervalInfimum(const BF & anInfimum)
+ {
+ mInfimum = anInfimum;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mSupremum
+ */
+ inline const BF & getIntervalSupremum()const
+ {
+ return( mSupremum );
+ }
+
+ inline bool hasIntervalSupremum() const
+ {
+ return( mSupremum.valid() );
+ }
+
+ inline void setIntervalSupremum(const BF & aSupremum)
+ {
+ mSupremum = aSupremum;
+ }
+
+
+ /**
+ * GETTER
+ * Interval Length
+ */
+ avm_integer_t getIntervalLength();
+
+ /**
+ * Serialization
+ */
+ inline std::string strIso_Interval() const
+ {
+ return( IIntervalKind::to_string(
+ mIntervalKind, mInfimum, mSupremum) );
+ }
+
+ inline std::string strT_Interval() const
+ {
+ if( getFullyQualifiedNameID().empty() || getNameID().empty() )
+ {
+ return( strIso_Interval() );
+ }
+ else
+ {
+ return( getNameID() );
+ }
+ }
+
+ void toStreamInterval(OutStream & os) const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONTAINER
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * CONSTRUCTOR
+ * Container
+ */
+ static DataType * newContainer(
+ Machine * aContainer, const std::string & aNameID,
+ avm_type_specifier_kind_t aSpecifierKind, long aSize);
+
+ static DataType * newContainer(
+ Machine * aContainer, const std::string & aNameID,
+ avm_type_specifier_kind_t aSpecifierKind,
+ const BF & aTypeSpecifier, long aSize);
+
+ /**
+ * GETTER
+ * the Container TypeSpecifier of contents
+ */
+ inline const BF & getContentsTypeSpecifier() const
+ {
+ return( mTypeSpecifier );
+ }
+
+ inline avm_type_specifier_kind_t getContainerSpecifierKind() const
+ {
+ return( mSpecifierKind );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mMinimumSize
+ */
+ inline long getMinimumSize() const
+ {
+ return( mMinimumSize );
+ }
+
+ inline void setMinimumSize(long minSize)
+ {
+ mMinimumSize = minSize;
+ }
+
+ /**
+ * GETTER - SETTER
+ * mMaximumSize
+ */
+ inline long getMaximumSize() const
+ {
+ return( mMaximumSize );
+ }
+
+ inline void setMaximumSize(long maxSize)
+ {
+ mMaximumSize = maxSize;
+ }
+
+
+ inline long size()
+ {
+ return( mMaximumSize );
+ }
+
+ inline void setSize(long maxSize)
+ {
+ mMaximumSize = maxSize;
+ }
+
+ /**
+ * SETTER
+ * mMinimumSize
+ * mMaximumSize
+ */
+ inline void setSize(long minSize, long maxSize)
+ {
+ mMinimumSize = minSize;
+ mMaximumSize = maxSize;
+ }
+
+
+ /**
+ * Serialization
+ */
+ inline static std::string strContainerId(std::string aNameID,
+ avm_type_specifier_kind_t aSpecifierKind, const BF & baseT, long aSize)
+ {
+ return( aNameID.empty() ?
+ strContainerId(aSpecifierKind, baseT, aSize) : aNameID );
+ }
+
+ static std::string strContainerId(
+ avm_type_specifier_kind_t aSpecifierKind,
+ const BF & baseT, long aSize);
+
+ static std::string strContainerId(
+ avm_type_specifier_kind_t aSpecifierKind, long aSize);
+
+
+ std::string strContainerType() const;
+
+ std::string strT_Container() const
+ {
+ return( isAnonymID() ? strContainerType() : getNameID() );
+ }
+
+ void toStreamContainer(OutStream & os) const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // ENUMERATIOIN
+ // STRUCTURE
+ // UNION
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * GETTER - SETTER
+ * mPropertyPart
+ */
+ inline PropertyPart * getPropertyPart() const
+ {
+ return( mPropertyPart );
+ }
+
+ bool hasProperty() const;
+
+ inline void setPropertyPart(PropertyPart * aPropertyPart)
+ {
+ mPropertyPart = aPropertyPart;
+ }
+
+ /**
+ * GETTER - SETTER
+ * BehavioralPart
+ */
+ BehavioralPart * getUniqBehaviorPart();
+
+ inline BehavioralPart * getBehaviorPart() const
+ {
+ return( mBehavioralSpecification );
+ }
+
+ bool hasBehavior() const
+ {
+ return( mBehavioralSpecification != NULL );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // ENUMERATIOIN
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * CONSTRUCTOR
+ * Enumeration
+ */
+ static DataType * newEnum(
+ const PropertyPart & aPropertyPart, const std::string & aNameID);
+
+ /**
+ * GETTER
+ * Enumeration Size
+ */
+ avm_size_t getEnumSize();
+
+ /**
+ * GETTER - SETTER
+ * mVariables
+ */
+ void appendVariable(const BF & aVariable);
+
+ void saveVariable(Variable * aVariable);
+
+
+ /**
+ * Serialization
+ */
+ void toStreamEnum(OutStream & os) const;
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // STRUCTURE
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * CONSTRUCTOR
+ * Structure
+ */
+ static DataType * newStructure(
+ const PropertyPart & aPropertyPart, const std::string & aNameID);
+
+ /**
+ * Serialization
+ */
+ void toStreamStructure(OutStream & os) const;
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // UNION
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * CONSTRUCTOR
+ * Union
+ */
+ static DataType * newUnion(
+ const PropertyPart & aPropertyPart, const std::string & aNameID);
+
+ /**
+ * Serialization
+ */
+ void toStreamUnion(OutStream & os) const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CHOICE
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * CONSTRUCTOR
+ * Union
+ */
+ static DataType * newChoice(
+ const PropertyPart & aPropertyPart, const std::string & aNameID);
+
+ /**
+ * Serialization
+ */
+ void toStreamChoice(OutStream & os) const;
+
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // ALIAS
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * CONSTRUCTOR
+ * Alias
+ */
+ static DataType * newAlias(const PropertyPart & aPropertyPart,
+ const std::string & aNameID, const BF & aTypeSpecifier);
+
+ /**
+ * Serialization
+ */
+ void toStreamAlias(OutStream & os) const;
+
+
+
+
+
+ /**
+ * Serialization
+ */
+ static std::string strTypeSpecifier(const BF & aType);
+
+ inline virtual std::string strT() const
+ {
+ if( hasTypeContainer() )
+ {
+ return( strT_Container() );
+ }
+ else if( isTypedInterval() )
+ {
+ return( strT_Interval() );
+ }
+
+ return( getNameID() );
+ }
+
+
+ virtual void strHeader(OutStream & os) const;
+
+ virtual void toStream(OutStream & os) const;
+
+
+public:
+
+ /**
+ * ATTRIBUTES
+ */
+ static std::string ANONYM_ID;
+
+ inline bool isAnonymID() const
+ {
+ return( getNameID().empty()
+ || (getNameID().find(ANONYM_ID) == 0) );
+ }
+
+};
+
+
+} /* namespace sep */
+
+
+
+#endif /* TYPEDEF_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/InstanceSpecifierPart.cpp b/org.eclipse.efm.symbex/src/fml/infrastructure/InstanceSpecifierPart.cpp
new file mode 100644
index 0000000..2ae57d2
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/InstanceSpecifierPart.cpp
@@ -0,0 +1,172 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 1 avr. 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "InstanceSpecifierPart.h"
+
+#include <fml/infrastructure/Machine.h>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+InstanceSpecifierPart::InstanceSpecifierPart(
+ Machine * aContainer, const std::string & aNameID)
+: ObjectClassifier( CLASS_KIND_T( InstanceSpecifierPart ) ,
+ aContainer , aNameID),
+mModel( ),
+
+mInitialInstanceCount( 1 ),
+mMaximalInstanceCount( AVM_NUMERIC_MAX_SIZE_T ),
+
+mPossibleDynamicInstanciationCount( 0 ),
+
+mModifierAutoStart( true )
+{
+ //!! NOTHING
+}
+
+InstanceSpecifierPart::InstanceSpecifierPart(Machine * aContainer,
+ const BF & aModel, avm_size_t anInitialInstanceCount,
+ avm_size_t aMaximalInstanceCount, const std::string & aNameID)
+: ObjectClassifier( CLASS_KIND_T( InstanceSpecifierPart ) ,
+ aContainer , aNameID),
+mModel( aModel ),
+
+mInitialInstanceCount( anInitialInstanceCount ),
+mMaximalInstanceCount( aMaximalInstanceCount ),
+
+mPossibleDynamicInstanciationCount( 0 ),
+
+mModifierAutoStart( true )
+{
+ //!! NOTHING
+}
+
+
+/**
+ * Serialization
+ */
+void InstanceSpecifierPart::strMultiplicity(OutStream & os,
+ avm_size_t anInitialCount, avm_size_t aMaximalCount,
+ const std::string & leftSeparator, const std::string & rightSeparator)
+{
+ if( aMaximalCount == AVM_NUMERIC_MAX_SIZE_T )
+ {
+ if( anInitialCount == 0 )
+ {
+ os << leftSeparator << "*" << rightSeparator;
+ }
+ else if( anInitialCount == 1 )
+ {
+ os << leftSeparator << "+" << rightSeparator;
+ }
+ else
+ {
+ os << leftSeparator << anInitialCount << ", +" << rightSeparator;
+ }
+ }
+ else if( anInitialCount != aMaximalCount )
+ {
+ os << leftSeparator << anInitialCount
+ << ", " << aMaximalCount << rightSeparator;
+ }
+ else
+ {
+ os << leftSeparator << anInitialCount << rightSeparator;
+ }
+}
+
+
+void InstanceSpecifierPart::strMultiplicity(
+ OutStream & os, avm_size_t anInitialCount,
+ avm_size_t aPossibleDynamicCount, avm_size_t aMaximalCount,
+ const std::string & leftSeparator, const std::string & rightSeparator)
+{
+ if( aPossibleDynamicCount > 0 )
+ {
+ os << leftSeparator << anInitialCount
+ << ", " << aPossibleDynamicCount << ", ";
+
+ if( aMaximalCount != AVM_NUMERIC_MAX_SIZE_T )
+ {
+ os << aMaximalCount << rightSeparator;
+ }
+ else
+ {
+ os << "+" << rightSeparator;
+ }
+ }
+ else
+ {
+ InstanceSpecifierPart::strMultiplicity(os, anInitialCount,
+ aMaximalCount, leftSeparator, rightSeparator);
+ }
+}
+
+
+inline static bool showMultiplicity(
+ const Machine * aMachine, avm_size_t anInitialCount,
+ avm_size_t aPossibleDynamicCount, avm_size_t aMaximalCount)
+{
+ return( ( aMachine->getSpecifier().isFamilyComponentState()
+ && (anInitialCount == 1) && (aPossibleDynamicCount == 0)
+ && (aMaximalCount == AVM_NUMERIC_MAX_SIZE_T) ) ? false : true );
+}
+
+void InstanceSpecifierPart::header(OutStream & os, bool & hasChevron) const
+{
+ if( hasModel() )
+ {
+ if( hasChevron ) { os << " , "; }
+ else { os << "< "; hasChevron = true; }
+
+ os << "model: " << ((getModel().is< Machine >()) ?
+ getModel().to_ptr< Machine >()->getNameID() : getModel().str());
+ }
+
+ if( showMultiplicity(getContainerMachine(), mInitialInstanceCount,
+ mPossibleDynamicInstanciationCount, mMaximalInstanceCount) )
+ {
+ if( hasChevron ) { os << " , "; }
+ else { os << "< "; hasChevron = true; }
+
+ InstanceSpecifierPart::strMultiplicity(
+ os, mInitialInstanceCount,
+ mPossibleDynamicInstanciationCount,
+ mMaximalInstanceCount, "instance: [ ", " ]");
+ }
+
+ if( not isAutoStart() )
+ {
+ if( hasChevron ) { os << " , "; }
+ else { os << "< "; hasChevron = true; }
+ os << "autostart = false";
+ }
+}
+
+
+void InstanceSpecifierPart::toStream(OutStream & os) const
+{
+ os << TAB << "@" << getNameID() << ":" << EOL;
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/InstanceSpecifierPart.h b/org.eclipse.efm.symbex/src/fml/infrastructure/InstanceSpecifierPart.h
new file mode 100644
index 0000000..e54529f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/InstanceSpecifierPart.h
@@ -0,0 +1,203 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 1 avr. 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef FML_INFRASTRUCTURE_INSTANCESPECIFIERPART_H_
+#define FML_INFRASTRUCTURE_INSTANCESPECIFIERPART_H_
+
+#include <fml/common/ObjectClassifier.h>
+#include <fml/common/ObjectElement.h>
+
+#include <common/AvmPointer.h>
+#include <common/BF.h>
+
+
+namespace sep
+{
+
+class Machine;
+
+
+class InstanceSpecifierPart :
+ public ObjectClassifier,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( InstanceSpecifierPart )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( InstanceSpecifierPart )
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ BF mModel;
+
+ avm_size_t mInitialInstanceCount;
+ avm_size_t mMaximalInstanceCount;
+
+ avm_size_t mPossibleDynamicInstanciationCount;
+
+ bool mModifierAutoStart;
+
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ InstanceSpecifierPart(Machine * aContainer,
+ const std::string & aNameID = "instance");
+
+ InstanceSpecifierPart(Machine * aContainer, const BF & aModel,
+ avm_size_t anInitialInstanceCount = 1,
+ avm_size_t aMaximalInstanceCount = AVM_NUMERIC_MAX_SIZE_T,
+ const std::string & aNameID = "instance");
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~InstanceSpecifierPart()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * the Model Specifier
+ */
+ inline const BF & getModel() const
+ {
+ return( mModel );
+ }
+
+ inline bool hasModel() const
+ {
+ return( mModel.valid() );
+ }
+
+ inline void setModel(const BF & aModel)
+ {
+ mModel = aModel;
+ }
+
+ inline std::string strModel() const
+ {
+ return( mModel.is< ObjectElement >() ?
+ mModel.to_ptr< ObjectElement >()->getFullyQualifiedNameID() :
+ mModel.str() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mInitialInstanceCount
+ */
+ inline avm_size_t getInitialInstanceCount() const
+ {
+ return( mInitialInstanceCount );
+ }
+
+ bool hasInitialInstance() const
+ {
+ return( mInitialInstanceCount > 0 );
+ }
+
+ inline void setInitialInstanceCount(avm_size_t anInitialInstanceCount)
+ {
+ mInitialInstanceCount = anInitialInstanceCount;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mMaximalInstanceCount
+ */
+ inline avm_size_t getMaximalInstanceCount() const
+ {
+ return( mMaximalInstanceCount );
+ }
+
+ bool hasMaximalInstance() const
+ {
+ return( mMaximalInstanceCount != AVM_NUMERIC_MAX_SIZE_T );
+ }
+
+ inline bool hasMaximalNewInstance() const
+ {
+ return( (mMaximalInstanceCount > 1) &&
+ (mMaximalInstanceCount != AVM_NUMERIC_MAX_SIZE_T) );
+ }
+
+ inline void setMaximalInstanceCount(avm_size_t aMaximalInstanceCount)
+ {
+ mMaximalInstanceCount = aMaximalInstanceCount;
+ }
+
+
+ /**
+ * SETTER
+ * mInitialInstanceCount
+ * mMaximalInstanceCount
+ */
+ inline void setInstanceCount(
+ avm_size_t anInitialInstanceCount,
+ avm_size_t aMaximalInstanceCount)
+ {
+ mInitialInstanceCount = anInitialInstanceCount;
+
+ mMaximalInstanceCount = aMaximalInstanceCount;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * "autostart" modifier of Instance
+ */
+ inline bool isAutoStart() const
+ {
+ return( mModifierAutoStart );
+ }
+
+ inline void setAutoStart(bool bAutoStart = true)
+ {
+ mModifierAutoStart = bAutoStart;
+ }
+
+
+ /**
+ * Serialization
+ */
+ static void strMultiplicity(OutStream & os,
+ avm_size_t anInitialCount, avm_size_t aMaximalCount,
+ const std::string & leftSeparator = "[ ",
+ const std::string & rightSeparator = " ]");
+
+ static void strMultiplicity(OutStream & os, avm_size_t anInitialCount,
+ avm_size_t aPossibleDynamicCount, avm_size_t aMaximalCount,
+ const std::string & leftSeparator = "[ ",
+ const std::string & rightSeparator = " ]");
+
+ void header(OutStream & os, bool & hasChevron) const;
+
+ void toStream(OutStream & os) const;
+
+};
+
+
+} /* namespace sep */
+
+#endif /* FML_INFRASTRUCTURE_INSTANCESPECIFIERPART_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/InteractionPart.cpp b/org.eclipse.efm.symbex/src/fml/infrastructure/InteractionPart.cpp
new file mode 100644
index 0000000..04a70f6
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/InteractionPart.cpp
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 22 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "InteractionPart.h"
+
+#include <fml/infrastructure/Machine.h>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+InteractionPart::InteractionPart(
+ Machine * aContainer, const std::string & aNameID)
+: ObjectClassifier( CLASS_KIND_T( InteractionPart ) , aContainer, aNameID),
+ComProtocol( PROTOCOL_UNDEFINED_KIND ),
+mConnectors( )
+{
+ //!! NOTHING
+}
+
+
+/**
+ * Serialization
+ */
+void InteractionPart::toStream(OutStream & out) const
+{
+ out << TAB << "@" << getNameID();
+
+ toStreamProtocolCast( out ) << ":" << EOL_FLUSH;
+
+ if( mConnectors.nonempty() )
+ {
+ ScopeIncrIndent asdii(out);
+
+ const_connector_iterator it = mConnectors.begin();
+ const_connector_iterator endIt = mConnectors.end();
+ for( ; it != endIt ; ++it )
+ {
+ (it)->toStream(out);
+ }
+ }
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/InteractionPart.h b/org.eclipse.efm.symbex/src/fml/infrastructure/InteractionPart.h
new file mode 100644
index 0000000..97f8d8d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/InteractionPart.h
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 22 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef FML_INFRASTRUCTURE_INTERACTIONPART_H_
+#define FML_INFRASTRUCTURE_INTERACTIONPART_H_
+
+#include <fml/common/ObjectClassifier.h>
+
+#include <fml/infrastructure/ComProtocol.h>
+
+#include <collection/BFContainer.h>
+
+#include <fml/infrastructure/Connector.h>
+
+
+namespace sep
+{
+
+
+class Machine;
+
+
+class InteractionPart :
+ public ObjectClassifier,
+ public ComProtocol,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( InteractionPart )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( InteractionPart )
+
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef TableOfBF_T< Connector > TableOfConnector;
+
+ typedef TableOfConnector::raw_iterator connector_iterator;
+ typedef TableOfConnector::const_raw_iterator const_connector_iterator;
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ TableOfConnector mConnectors;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ InteractionPart(Machine * aContainer, const std::string & aNameID = "com");
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~InteractionPart()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mConnectors
+ */
+ inline const TableOfConnector & getConnectors() const
+ {
+ return( mConnectors );
+ }
+
+ inline bool hasConnector() const
+ {
+ return( mConnectors.empty() );
+ }
+
+ inline void appendConnector(const BF & aConnector)
+ {
+ mConnectors.append( aConnector );
+ }
+
+ inline void saveConnector(Connector * aConnector)
+ {
+ mConnectors.append( BF(aConnector) );
+ }
+
+
+ /**
+ * [ CONST ] ITERATOR
+ */
+ inline const_connector_iterator connector_begin() const
+ {
+ return( mConnectors.begin() );
+ }
+
+ inline const_connector_iterator connector_end() const
+ {
+ return( mConnectors.end() );
+ }
+
+
+ /**
+ * Serialization
+ */
+ void toStream(OutStream & out) const;
+
+};
+
+
+}
+
+#endif /* FML_INFRASTRUCTURE_INTERACTIONPART_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/Machine.cpp b/org.eclipse.efm.symbex/src/fml/infrastructure/Machine.cpp
new file mode 100644
index 0000000..ef89839
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/Machine.cpp
@@ -0,0 +1,673 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 18 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "Machine.h"
+
+#include <fml/type/TypeManager.h>
+
+#include <fml/infrastructure/Buffer.h>
+#include <fml/infrastructure/Channel.h>
+#include <fml/infrastructure/Connector.h>
+#include <fml/infrastructure/Port.h>
+#include <fml/infrastructure/Routine.h>
+#include <fml/infrastructure/Variable.h>
+
+#include <fml/infrastructure/BehavioralPart.h>
+#include <fml/infrastructure/CompositePart.h>
+#include <fml/infrastructure/InstanceSpecifierPart.h>
+#include <fml/infrastructure/InteractionPart.h>
+#include <fml/infrastructure/ModelOfComputationPart.h>
+#include <fml/infrastructure/PropertyPart.h>
+
+
+namespace sep
+{
+
+////////////////////////////////////////////////////////////////////////////////
+// MACHINE POINTER
+////////////////////////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////////////////////////
+// MACHINE SMART POINTER
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+Machine::Machine(Machine * aContainer,
+ const std::string & aNameID, const Specifier & aMocSpecifier)
+: BehavioralElement(CLASS_KIND_T( Machine ), aContainer, aNameID),
+SpecifierImpl( aMocSpecifier ),
+
+mGroupId( ),
+mOwnedElements( ),
+mOwnedElementsSpecifier( ),
+mModel( ),
+
+mPropertyDeclaration( this , "property" ),
+
+mModelOfComputation( NULL ),
+
+mCompositeSpecification( new CompositePart(this, "composite") ),
+
+mInteractionSpecification( NULL ),
+mBehavioralSpecification( NULL ),
+mInstanceSpecifier( new InstanceSpecifierPart(this, "instance") )
+{
+ //!! NOTHING
+}
+
+
+/**
+ * CONSTRUCTOR
+ * Other
+ */
+Machine::Machine(Machine * aContainer, const std::string & aNameID,
+ const Specifier & aMocSpecifier, const BF & aModel,
+ avm_size_t anInitialInstanceCount, avm_size_t aMaximalInstanceCount)
+: BehavioralElement(CLASS_KIND_T( Machine ), aContainer, aNameID),
+SpecifierImpl( aMocSpecifier ),
+
+mGroupId( ),
+mOwnedElements( ),
+mOwnedElementsSpecifier( ),
+mModel( aModel ),
+
+mPropertyDeclaration( this , "property" ),
+
+mModelOfComputation( NULL ),
+
+mCompositeSpecification( new CompositePart(this, "composite") ),
+
+mInteractionSpecification( NULL ),
+mBehavioralSpecification( NULL ),
+mInstanceSpecifier( new InstanceSpecifierPart(this, aModel,
+ anInitialInstanceCount, aMaximalInstanceCount, "instance") )
+{
+ //!! NOTHING
+}
+
+Machine::Machine(class_kind_t aClassKind, Machine * aContainer,
+ const std::string & aFullyQualifiedNameID, const std::string & aNameID,
+ const std::string & name, const Specifier & aMocSpecifier)
+: BehavioralElement(aClassKind, aContainer, aFullyQualifiedNameID, aNameID, name),
+SpecifierImpl( aMocSpecifier ),
+
+mGroupId( ),
+mOwnedElements( ),
+mOwnedElementsSpecifier( ),
+mModel( ),
+
+mPropertyDeclaration( this , "property" ),
+
+mModelOfComputation( NULL ),
+
+mCompositeSpecification( new CompositePart(this, "composite") ),
+
+mInteractionSpecification( NULL ),
+mBehavioralSpecification( NULL ),
+mInstanceSpecifier( new InstanceSpecifierPart(this, "instance") )
+{
+ //!! NOTHING
+}
+
+
+/**
+ * DESTRUCTOR
+ */
+Machine::~Machine()
+{
+ delete mModelOfComputation;
+ delete mCompositeSpecification;
+ delete mInteractionSpecification;
+ delete mBehavioralSpecification;
+ delete mInstanceSpecifier;
+}
+
+
+/**
+ * SETTER
+ * mGroupId
+ */
+void Machine::setGroupId()
+{
+ if( getSpecifier().hasGroupMask() )
+ {
+ StringOutStream oss;
+
+ oss << ( getSpecifier().isGroupEvery() ? "[*" :
+ ( getSpecifier().isGroupExcept() ? "[^" : "[" ) );
+ if( mGroupId.nonempty() )
+ {
+ ListOfString::const_iterator it = mGroupId.begin();
+ ListOfString::const_iterator endIt = mGroupId.end();
+ oss << (*it);
+ for( ++it ; it != endIt ; ++it)
+ {
+ oss << " , " << (*it);
+ }
+ }
+ oss << "]";
+
+ fullyUpdateAllNameID( oss.str() );
+ }
+}
+
+void Machine::expandGroupStatemachine()
+{
+ if( mCompositeSpecification != NULL )
+ {
+ mCompositeSpecification->expandGroupStatemachine();
+ }
+}
+
+
+/**
+ * GETTER
+ * the machine container
+ * LC[R]A
+ */
+const Machine * Machine::LCA(const Machine * aMachine) const
+{
+ List< const Machine * > containerListOfThis;
+ const Machine * itContainer = this->getContainerMachine();
+ for ( ; itContainer != NULL ;
+ itContainer = itContainer->getContainerMachine() )
+ {
+ containerListOfThis.push_back(itContainer);
+ }
+
+ List< const Machine * >::iterator it;
+ List< const Machine * >::iterator endIt = containerListOfThis.end();
+ itContainer = aMachine->getContainerMachine();
+ for ( ; itContainer != NULL ;
+ itContainer = itContainer->getContainerMachine() )
+ {
+ for ( it = containerListOfThis.begin() ; it != endIt ; ++it )
+ {
+ if ( (*it) == itContainer )
+ {
+// AVM_OS_LOG << "LCA( " << this->getFullyQualifiedNameID()
+// << " , " << aMachine->getFullyQualifiedNameID()
+// << " ) = " << itContainer->getFullyQualifiedNameID();
+
+ return( itContainer );
+ }
+ }
+ }
+
+ return( NULL );
+}
+
+
+
+/**
+ * DISPATCH
+ * mOwnedElements
+ */
+void Machine::dispatchOwnedElement(const BF & anElement)
+{
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( anElement )
+ << "Executable Machine owned element !!!"
+ << SEND_EXIT;
+
+ switch( anElement.classKind() )
+ {
+ // PROPERTY ELEMENT
+ case FORM_XFSP_VARIABLE_KIND:
+ case FORM_XFSP_DATATYPE_KIND:
+ case FORM_XFSP_BUFFER_KIND:
+ case FORM_XFSP_CHANNEL_KIND:
+ case FORM_XFSP_PORT_KIND:
+ {
+ mPropertyDeclaration.dispatchOwnedElement( anElement );
+ break;
+ }
+
+ // COMPOSITE STRUCTURE ELEMENT
+
+ case FORM_XFSP_MACHINE_KIND:
+ {
+ addOwnedElementSpecifier(
+ anElement.to_ptr< Machine >()->getSpecifier() );
+
+ getUniqCompositePart()->dispatchOwnedElement( anElement );
+
+ break;
+ }
+
+ case FORM_XFSP_TRANSITION_KIND:
+ {
+ getUniqBehaviorPart()->appendOutgoingTransition( anElement );
+ break;
+ }
+
+ // INTERACTION ELEMENT
+ case FORM_XFSP_CONNECTOR_KIND:
+ {
+ getUniqInteraction()->appendConnector( anElement );
+ break;
+ }
+
+ // BEHAVIORAL ELEMENT
+ case FORM_XFSP_ROUTINE_KIND:
+ {
+ getUniqBehaviorPart()->appendRoutine( anElement );
+ break;
+ }
+
+
+ case FORM_XFSP_PACKAGE_KIND:
+
+ default:
+ { // TODO
+ AVM_OS_FATAL_ERROR_EXIT
+ << "dispatchOwnedElement() unexpected object, typeinfo: "
+ << anElement.classKindInfo() << "\n\t<< "
+ << anElement.to_ptr< ObjectElement >()->strHeader()
+ << " >> !!!"
+ << SEND_EXIT;
+ break;
+ }
+ }
+}
+
+
+/**
+ * GETTER - SETTER
+ * mModelOfComputation
+ */
+ModelOfComputationPart * Machine::getUniqModelOfComputation()
+{
+ if( mModelOfComputation == NULL )
+ {
+ mModelOfComputation = new ModelOfComputationPart(this, "moc");
+ }
+
+ return( mModelOfComputation );
+}
+
+/**
+ * GETTER - SETTER
+ * mCompositeSpecification
+ */
+CompositePart * Machine::getUniqCompositePart()
+{
+ if( mCompositeSpecification == NULL )
+ {
+ mCompositeSpecification = new CompositePart(this, "composite");
+ }
+
+ return( mCompositeSpecification );
+}
+
+
+/**
+ * GETTER - SETTER
+ * mCompositeSpecification->mProcedures
+ */
+bool Machine::hasProcedure() const
+{
+ return( (mCompositeSpecification != NULL) &&
+ mCompositeSpecification->hasProcedure() );
+}
+
+void Machine::saveProcedure(Machine * aProcedure)
+{
+ mCompositeSpecification->saveProcedure( aProcedure );
+}
+
+/**
+ * GETTER - SETTER
+ * mCompositeSpecification->mStates
+ */
+bool Machine::hasState() const
+{
+ return( (mCompositeSpecification != NULL) &&
+ mCompositeSpecification->hasState() );
+}
+
+
+/**
+ * GETTER - SETTER
+ * mCompositeSpecification->mMachines
+ */
+bool Machine::hasMachine() const
+{
+ return( (mCompositeSpecification != NULL) &&
+ mCompositeSpecification->hasMachine() );
+}
+
+void Machine::saveMachine(Machine * aMachine)
+{
+ mCompositeSpecification->saveMachine( aMachine );
+}
+
+
+/**
+ * GETTER - SETTER
+ * mInteractionSpecification
+ */
+InteractionPart * Machine::getUniqInteraction()
+{
+ if( mInteractionSpecification == NULL )
+ {
+ mInteractionSpecification = new InteractionPart(this, "com");
+ }
+
+ return( mInteractionSpecification );
+}
+
+
+/**
+ * GETTER - SETTER
+ * mBehavioralSpecification
+ */
+BehavioralPart * Machine::getUniqBehaviorPart()
+{
+ if( mBehavioralSpecification == NULL )
+ {
+ mBehavioralSpecification = new BehavioralPart(this, "moe");
+ }
+
+ return( mBehavioralSpecification );
+}
+
+
+bool Machine::hasRunnableBehavior() const
+{
+ return( (mBehavioralSpecification != NULL)
+ && (mBehavioralSpecification->hasOnRun()
+ || mBehavioralSpecification->hasOnSchedule()
+ || mBehavioralSpecification->hasOnConcurrency()) );
+}
+
+bool Machine::hasOnEnable() const
+{
+ return( ( (mBehavioralSpecification != NULL)
+ && mBehavioralSpecification->hasOnEnable() )
+ || getSpecifier().hasPseudostateHistory() );
+}
+
+bool Machine::isInlinableEnable() const
+{
+ return( (not getSpecifier().isPseudostate())
+ && (mBehavioralSpecification != NULL)
+ && (mBehavioralSpecification->hasOnEnable()
+ || mBehavioralSpecification->hasOnIEnable()) );
+}
+
+
+/**
+ * GETTER - SETTER
+ * mBehavioralSpecification->mOutgoingTransitions
+ * mBehavioralSpecification->mIncomingTransitions
+ */
+bool Machine::hasOutgoingTransition() const
+{
+ return( (mBehavioralSpecification != NULL)
+ && mBehavioralSpecification->hasOutgoingTransition() );
+}
+
+bool Machine::hasIncomingTransition() const
+{
+ return( (mBehavioralSpecification != NULL)
+ && mBehavioralSpecification->hasIncomingTransition() );
+}
+
+
+/**
+ * GETTER - SETTER
+ * mInstanceSpecifier
+ */
+InstanceSpecifierPart * Machine::getUniqInstanceSpecifier()
+{
+ if( mInstanceSpecifier == NULL )
+ {
+ mInstanceSpecifier = new InstanceSpecifierPart(this, "instance");
+ }
+
+ return( mInstanceSpecifier );
+}
+
+/**
+ * GETTER - SETTER
+ * "autostart" modifier of Instance
+ */
+bool Machine::isAutoStart() const
+{
+ return( hasInstanceSpecifier()
+ && getInstanceSpecifier()->isAutoStart() );
+}
+
+void Machine::setAutoStart(bool bAutoStart)
+{
+ getUniqInstanceSpecifier()->setAutoStart( bAutoStart );
+}
+
+
+/**
+ * GETTER - SETTER
+ * mDeclarationParameter
+ */
+const TableOfVariable & Machine::getVariableParameters() const
+{
+ return( mPropertyDeclaration.getVariableParameters() );
+}
+
+const BF & Machine::getVariableParameter(avm_size_t offset) const
+{
+ return( mPropertyDeclaration.getVariableParameter(offset) );
+}
+
+avm_size_t Machine::getVariableParametersCount() const
+{
+ return( mPropertyDeclaration.getVariableParametersCount() );
+}
+
+avm_offset_t Machine::getVariableParameterOffset(const std::string & aNameID) const
+{
+ return( mPropertyDeclaration.getVariableParameterOffsetByNameID(aNameID) );
+}
+
+
+/**
+ * GETTER - SETTER
+ * mDeclarationReturn
+ */
+const TableOfVariable & Machine::getVariableReturns() const
+{
+ return( mPropertyDeclaration.getVariableReturns() );
+}
+
+const BF & Machine::getVariableReturn(avm_size_t offset) const
+{
+ return( mPropertyDeclaration.getVariableReturn(offset) );
+}
+
+avm_offset_t Machine::getVariableReturnsCount() const
+{
+ return( mPropertyDeclaration.getVariableReturnsCount() );
+}
+
+avm_offset_t Machine::getVariableReturnOffset(const std::string & aNameID) const
+{
+ return( mPropertyDeclaration.getVariableReturnOffsetByNameID(aNameID) );
+}
+
+
+/**
+ * GETTER - SETTER
+ * mPropertyPart
+ */
+bool Machine::hasProperty() const
+{
+ return( mPropertyDeclaration.nonempty() );
+}
+
+bool Machine::hasPortSignal() const
+{
+ return( mPropertyDeclaration.hasPort()
+ || mPropertyDeclaration.hasSignal() );
+}
+
+
+/**
+ * Serialization
+ */
+void Machine::header(OutStream & os) const
+{
+ os << getModifier().toString()
+ << getSpecifier().strDesign_not(
+ Specifier::DESIGN_PROTOTYPE_STATIC_KIND)
+ << getSpecifier().keywordComponent();
+
+ bool hasChevron = false;
+
+ if( hasSpecifier_otherThan( Specifier(
+ getSpecifier().getComponentKind() ).setStateMocSIMPLE() ) )
+ {
+ Specifier aSpecifier( getSpecifier() );
+ aSpecifier.unsetComponentKind();
+ aSpecifier.remStateMoc( Specifier::STATE_SIMPLE_MOC );
+ aSpecifier.unsetDesignKind();
+
+ if( aSpecifier.isDefined() )
+ {
+ hasChevron = true;
+
+ os << "< " << aSpecifier.str();
+ }
+ }
+
+ if( hasOwnedElementsSpecifier() )
+ {
+ Specifier aSpecifier( getOwnedElementsSpecifier() );
+ aSpecifier.unsetDesignKind();
+
+ if( aSpecifier.isDefined() )
+ {
+ if( hasChevron ) { os << " , "; }
+ else { os << "< "; hasChevron = true; }
+
+ os << "owned: " << aSpecifier.str();
+ }
+ }
+
+ if( hasInstanceSpecifier() )
+ {
+ mInstanceSpecifier->header(os, hasChevron);
+ }
+
+ os << ( hasChevron ? " > " : " " );
+
+ if( getSpecifier().hasGroupMask() )
+ {
+ os << ( getSpecifier().isGroupEvery() ? "[*" :
+ ( getSpecifier().isGroupExcept() ? "[^" : "[" ) );
+ if( mGroupId.nonempty() )
+ {
+ ListOfString::const_iterator it = mGroupId.begin();
+ ListOfString::const_iterator endIt = mGroupId.end();
+ os << (*it);
+ for( ++it ; it != endIt ; ++it)
+ {
+ os << " , " << (*it);
+ }
+ }
+ os << "]";
+ }
+ else
+ {
+ os << getNameID();
+ }
+}
+
+
+void Machine::strHeader(OutStream & os) const
+{
+ header( os );
+
+ mPropertyDeclaration.strVariableParameters(os, " [ ", " ]", ", ");
+
+ mPropertyDeclaration.strVariableReturns(os, " returns: [ ", " ]", ", ");
+}
+
+
+void Machine::toStream(OutStream & os) const
+{
+ os << TAB;
+
+ header( os );
+
+ os << " {" << EOL;
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ if( mOwnedElements.nonempty() )
+ {
+ os << TAB << "/*owned: [" << EOL_INCR_INDENT
+ << str_header( mOwnedElements ) << DECR_INDENT_TAB
+ << "] // end owned*/" << EOL2_FLUSH;
+ }
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+
+ if( hasProperty() )
+ {
+ mPropertyDeclaration.toStream(os);
+ os << EOL;
+ }
+
+ if( (mBehavioralSpecification != NULL) &&
+ mBehavioralSpecification->hasAnyRoutine() )
+ {
+ mBehavioralSpecification->toStreamAnyRoutine( os );
+ }
+
+ if( mCompositeSpecification != NULL )
+ {
+ mCompositeSpecification->toStream( os );
+ }
+
+ if( mModelOfComputation != NULL )
+ {
+ mModelOfComputation->toStream(os);
+ }
+
+ if( mInteractionSpecification != NULL )
+ {
+ mInteractionSpecification->toStream(os);
+ os << EOL;
+ }
+
+ if( mBehavioralSpecification != NULL )
+ {
+ mBehavioralSpecification->toStreamMoe(os);
+ os << EOL;
+ }
+
+ os << TAB << "}" << EOL_FLUSH;
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/Machine.h b/org.eclipse.efm.symbex/src/fml/infrastructure/Machine.h
new file mode 100644
index 0000000..fab290e
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/Machine.h
@@ -0,0 +1,664 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 18 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef MACHINE_H_
+#define MACHINE_H_
+
+#include <fml/infrastructure/MachineQuery.h>
+
+#include <fml/common/BehavioralElement.h>
+#include <fml/common/SpecifierElement.h>
+
+#include <common/AvmPointer.h>
+#include <common/BF.h>
+
+#include <collection/BFContainer.h>
+#include <collection/Typedef.h>
+
+#include <fml/common/ObjectElement.h>
+
+//#include <fml/infrastructure/BehavioralPart.h>
+//#include <fml/infrastructure/CompositePart.h>
+//#include <fml/infrastructure/InteractionPart.h>
+//#include <fml/infrastructure/ModelOfComputationPart.h>
+#include <fml/infrastructure/PropertyPart.h>
+
+
+namespace sep
+{
+
+class BehavioralPart;
+class CompositePart;
+class InstanceSpecifierPart;
+class InteractionPart;
+class ModelOfComputationPart;
+class PropertyPart;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// MACHINE POINTER
+////////////////////////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////////////////////////
+// MACHINE SMART POINTER
+////////////////////////////////////////////////////////////////////////////////
+
+class Machine :
+ public MachineQuery,
+ public BehavioralElement,
+ public SpecifierImpl,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( Machine )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( Machine )
+
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef TableOfBF_T< ObjectElement > TableOfOwnedElement;
+
+ typedef TableOfOwnedElement::const_raw_iterator const_owned_iterator;
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ ListOfString mGroupId;
+
+ TableOfOwnedElement mOwnedElements;
+ Specifier mOwnedElementsSpecifier;
+
+
+ BF mModel;
+
+ PropertyPart mPropertyDeclaration;
+
+ ModelOfComputationPart * mModelOfComputation;
+
+ CompositePart * mCompositeSpecification;
+
+ InteractionPart * mInteractionSpecification;
+
+ BehavioralPart * mBehavioralSpecification;
+
+ InstanceSpecifierPart * mInstanceSpecifier;
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Executable
+ */
+ Machine(Machine * aContainer, const std::string & aNameID,
+ const Specifier & aMocSpecifier);
+
+ /**
+ * CONSTRUCTOR
+ * Instance
+ */
+ Machine(Machine * aContainer, const std::string & aNameID,
+ const Specifier & aMocSpecifier, const BF & model,
+ avm_size_t anInitialInstanceCount = 1,
+ avm_size_t aMaximalInstanceCount = AVM_NUMERIC_MAX_SIZE_T);
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ Machine(class_kind_t aClassKind, Machine * aContainer,
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID, const std::string & name,
+ const Specifier & aMocSpecifier);
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Machine();
+
+ /**
+ * API
+ * MachineQuery
+ */
+ inline virtual const Machine * thisMachine() const
+ {
+ return( this );
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * executable
+ */
+ inline static Machine * newExecutable(Machine * aContainer,
+ const std::string & aNameID, Specifier aMocSpecifier)
+ {
+ if( aMocSpecifier.noneComponentKind() )
+ {
+ aMocSpecifier.setComponentExecutable();
+ }
+ if( aMocSpecifier.noneDesignKind() )
+ {
+ aMocSpecifier.setDesignPrototypeStatic();
+ }
+
+ return( new Machine(aContainer, aNameID, aMocSpecifier) );
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Statemachine
+ */
+ inline static Machine * newState(Machine * aContainer,
+ const std::string & aNameID, Specifier aMocSpecifier)
+ {
+ if( aMocSpecifier.noneDesignKind() )
+ {
+ aMocSpecifier.setDesignPrototypeStatic();
+ }
+
+ aMocSpecifier.hasPseudostateMoc()
+ ? aMocSpecifier.setComponentPseudostate()
+ : aMocSpecifier.setComponentState();
+
+ return( new Machine(aContainer, aNameID, aMocSpecifier) );
+ }
+
+ inline static Machine * newPseudotate(Machine * aContainer,
+ const std::string & aNameID, Specifier aMocSpecifier)
+ {
+ if( aMocSpecifier.noneDesignKind() )
+ {
+ aMocSpecifier.setDesignPrototypeStatic();
+ }
+
+ return( new Machine(aContainer, aNameID,
+ aMocSpecifier.setComponentPseudostate() ) );
+ }
+
+ inline static Machine * newStatemachine(Machine * aContainer,
+ const std::string & aNameID, Specifier aMocSpecifier)
+ {
+ if( aMocSpecifier.noneDesignKind() )
+ {
+ aMocSpecifier.setDesignPrototypeStatic();
+ }
+
+ return( new Machine(aContainer, aNameID,
+ aMocSpecifier.setComponentStatemachine() ) );
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Instance
+ */
+ static Machine * newInstance(Machine * aContainer,
+ const std::string & aNameID, const BF & aModel,
+ avm_size_t anInitialInstanceCount = 1,
+ avm_size_t aMaximalInstanceCount = AVM_NUMERIC_MAX_SIZE_T)
+ {
+ Specifier aSpecifier(
+ Specifier::COMPONENT_EXECUTABLE_KIND,
+ Specifier::DESIGN_INSTANCE_STATIC_KIND);
+
+ return( new Machine(aContainer, aNameID, aSpecifier, aModel,
+ anInitialInstanceCount, aMaximalInstanceCount) );
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Procedure
+ */
+ inline static Machine * newProcedure(
+ Machine * aContainer, const std::string & aNameID,
+ const Specifier & aMocSpecifier)
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( aMocSpecifier.isComponentProcedure() )
+ << "Machine::newProcedure:> Unexpected Specifier << "
+ << aMocSpecifier.str() << " >> !!!"
+ << SEND_EXIT;
+
+ return( new Machine(aContainer, aNameID, aMocSpecifier ) );
+ }
+
+ inline static Machine * newProcedureInstance(Machine * aContainer,
+ const std::string & aNameID, const BF & aModel)
+ {
+ return( new Machine(aContainer, aNameID,
+ Specifier::EXECUTABLE_PROCEDURE_INSTANCE_STATIC_SPECIFIER,
+ aModel) );
+ }
+
+
+ /**
+ * GETTER
+ * the machine container
+ * LC[R]A
+ */
+ inline virtual Machine * getContainerMachine() const
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT(
+ hasContainer() && getContainer()->is< Machine >() )
+ << "Invalid << Machine Container >> Type <"
+ << (hasContainer() ?
+ getContainer()->classKindName() : "null<container>")
+ << "> Cast !!!"
+ << SEND_EXIT;
+
+ return( getContainer()->to< Machine >() );
+ }
+
+ const Machine * LCA(const Machine * aMachine) const;
+
+ inline const Machine * LCRA(const Machine * aMachine) const
+ {
+ return( (this == aMachine) ? this : LCA( aMachine ) );
+ }
+
+
+ /**
+ * GETTER - DISPATCH - SAVE
+ * mOwnedElements
+ */
+ inline const TableOfOwnedElement & getOwnedElements() const
+ {
+ return( mOwnedElements );
+ }
+
+ void dispatchOwnedElement(const BF & anElement);
+
+ inline const BF & saveOwnedElement(ObjectElement * ptrElement)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( ptrElement )
+ << "Executable Machine owned element !!!"
+ << SEND_EXIT;
+
+ ptrElement->setOffset( mOwnedElements.size() );
+
+ mOwnedElements.append( INCR_BF( ptrElement ) );
+
+ dispatchOwnedElement( mOwnedElements.last() );
+
+ return( mOwnedElements.last() );
+ }
+
+
+ /**
+ * [ CONST ] ITERATOR
+ */
+ inline const_owned_iterator owned_begin() const
+ {
+ return( mOwnedElements.begin() );
+ }
+
+ inline const_owned_iterator owned_end() const
+ {
+ return( mOwnedElements.end() );
+ }
+
+
+ /**
+ * GETTER
+ * mOwnedElementsSpecifier
+ */
+ inline const Specifier & getOwnedElementsSpecifier() const
+ {
+ return( mOwnedElementsSpecifier );
+ }
+
+ inline bool hasOwnedElementsSpecifier() const
+ {
+ return( mOwnedElementsSpecifier.isDefined() );
+ }
+
+ inline void addOwnedElementSpecifier(const Specifier & ownedSpecifier)
+ {
+ mOwnedElementsSpecifier |= ownedSpecifier;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * the Type Specifier
+ */
+ inline const BF & getType() const
+ {
+ return( mModel );
+ }
+
+ inline bool hasType() const
+ {
+ return( mModel.valid() );
+ }
+
+ inline std::string strType() const
+ {
+ return( mModel.is< Machine >() ?
+ mModel.to_ptr< Machine >()->getFullyQualifiedNameID() :
+ mModel.str() );
+ }
+
+
+ /**
+ * GETTER
+ * the machine type model
+ */
+ inline const Machine * getModelMachine() const
+ {
+ if( getSpecifier().hasDesignModel() )
+ {
+ return( this );
+ }
+ else //if( isDesignInstance() )
+ {
+ return( mModel.is< Machine >() ?
+ mModel.to_ptr< Machine >() : NULL );
+ }
+ }
+
+ inline bool hasModelMachine() const
+ {
+ return( getSpecifier().hasDesignModel()
+ || (getSpecifier().hasDesignInstance()
+ && mModel.is< Machine >()) );
+ }
+
+
+ /**
+ * GETTER - TEST
+ * MachineMocKindImpl
+ */
+ inline bool isFamilyMachineComposite() const
+ {
+ return( getSpecifier().isFamilyComponentComposite()
+ || ( mModel.valid() && mModel.is_exactly< Machine >()
+ && mModel.to_ptr< Machine >()->isFamilyMachineComposite() ) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mDeclarationParameter
+ */
+ const TableOfVariable & getVariableParameters() const;
+
+ const BF & getVariableParameter(avm_size_t offset) const;
+
+ avm_size_t getVariableParametersCount() const;
+
+ avm_offset_t getVariableParameterOffset(const std::string & aNameID) const;
+
+ inline bool hasVariableParameter() const
+ {
+ return( getVariableParametersCount() > 0 );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mDeclarationReturn
+ */
+ const TableOfVariable & getVariableReturns() const;
+
+ const BF & getVariableReturn(avm_size_t offset) const;
+
+ avm_offset_t getVariableReturnsCount() const;
+
+ avm_offset_t getVariableReturnOffset(const std::string & aNameID) const;
+
+ inline bool hasVariableReturn() const
+ {
+ return( getVariableReturnsCount() > 0 );
+ }
+
+
+ /**
+ * GETTER
+ * mDeclarationParameter
+ * mDeclarationReturn
+ */
+ inline avm_offset_t getParamReturnCount() const
+ {
+ return( getVariableParametersCount() + getVariableReturnsCount() );
+ }
+
+ inline bool hasParamReturn() const
+ {
+ return( getParamReturnCount() > 0 );
+ }
+
+ /**
+ * GETTER - SETTER
+ * mPropertyPart
+ */
+ inline virtual const PropertyPart & getPropertyPart() const
+ {
+ return( mPropertyDeclaration );
+ }
+
+ inline PropertyPart & getPropertyPart()
+ {
+ return( mPropertyDeclaration );
+ }
+
+
+ bool hasProperty() const;
+
+ bool hasPortSignal() const;
+
+
+ /**
+ * GETTER - SETTER
+ * mGroupId
+ */
+ inline const ListOfString & getGroupId() const
+ {
+ return( mGroupId );
+ }
+
+ bool hasGroupId() const
+ {
+ return( mGroupId.empty() );
+ }
+
+ inline void appendGroupId(const std::string & aNameID)
+ {
+ mGroupId.append(aNameID);
+ }
+
+ void setGroupId();
+
+ void expandGroupStatemachine();
+
+
+ /**
+ * GETTER - SETTER
+ * mModelOfComputation
+ */
+ inline ModelOfComputationPart * getModelOfComputation()
+ {
+ return( mModelOfComputation );
+ }
+
+ ModelOfComputationPart * getUniqModelOfComputation();
+
+ inline bool hasModelOfComputation() const
+ {
+ return( mModelOfComputation != NULL );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mCompositeSpecification
+ */
+ inline virtual const CompositePart * getCompositePart() const
+ {
+ return( mCompositeSpecification );
+ }
+
+ inline CompositePart * getCompositePart()
+ {
+ return( mCompositeSpecification );
+ }
+
+ CompositePart * getUniqCompositePart();
+
+ inline bool hasCompositePart() const
+ {
+ return( mCompositeSpecification != NULL );
+ }
+
+ /**
+ * GETTER - SETTER
+ * mCompositeSpecification->mProcedures
+ */
+ bool hasProcedure() const;
+
+ void saveProcedure(Machine * aProcedure);
+
+ /**
+ * GETTER - SETTER
+ * mCompositeSpecification->mStates
+ */
+ bool hasState() const;
+
+ /**
+ * GETTER - SETTER
+ * mCompositeSpecification->mMachines
+ */
+ bool hasMachine() const;
+
+ void saveMachine(Machine * aMachine);
+
+
+ /**
+ * GETTER - SETTER
+ * mInteractionSpecification
+ */
+ inline const InteractionPart * getInteraction() const
+ {
+ return( mInteractionSpecification );
+ }
+
+ InteractionPart * getUniqInteraction();
+
+ inline bool hasInteraction() const
+ {
+ return( mInteractionSpecification != NULL );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mBehavioralSpecification
+ */
+ BehavioralPart * getUniqBehaviorPart();
+
+ inline virtual BehavioralPart * getBehaviorPart() const
+ {
+ return( mBehavioralSpecification );
+ }
+
+ inline virtual bool hasBehaviorPart() const
+ {
+ return( mBehavioralSpecification != NULL );
+ }
+
+
+ inline BehavioralPart * getBehavior() const
+ {
+ return( mBehavioralSpecification );
+ }
+
+ inline bool hasBehavior() const
+ {
+ return( (mBehavioralSpecification != NULL)
+ /*&& mBehavioralSpecification->nonempty()*/ );
+ }
+
+ inline bool noBehavior() const
+ {
+ return( (mBehavioralSpecification == NULL)
+ /*|| mBehavioralSpecification->empty()*/ );
+ }
+
+
+ bool hasRunnableBehavior() const;
+
+ bool hasOnEnable() const;
+
+ bool isInlinableEnable() const;
+
+ bool isInlinableProcedure() const
+ {
+ return( true );
+ }
+
+ /**
+ * GETTER - SETTER
+ * mBehavioralSpecification->mOutgoingTransitions
+ * mBehavioralSpecification->mIncomingTransitions
+ */
+ bool hasOutgoingTransition() const;
+
+ bool hasIncomingTransition() const;
+
+
+ /**
+ * GETTER - SETTER
+ * mInstanceSpecifier
+ */
+ inline InstanceSpecifierPart * getInstanceSpecifier() const
+ {
+ return( mInstanceSpecifier );
+ }
+
+ InstanceSpecifierPart * getUniqInstanceSpecifier();
+
+ inline bool hasInstanceSpecifier() const
+ {
+ return( mInstanceSpecifier != NULL );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "autostart" modifier of Instance
+ */
+ bool isAutoStart() const;
+
+ void setAutoStart(bool bAutoStart = true);
+
+
+ /**
+ * Serialization
+ */
+ void header(OutStream & os) const;
+
+ virtual void strHeader(OutStream & os) const;
+
+ virtual void toStream(OutStream & os) const;
+
+};
+
+
+}
+
+#endif /* MACHINE_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/MachineQuery.cpp b/org.eclipse.efm.symbex/src/fml/infrastructure/MachineQuery.cpp
new file mode 100644
index 0000000..524bc2d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/MachineQuery.cpp
@@ -0,0 +1,807 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 8 mars 2017
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "Machine.h"
+
+#include <fml/infrastructure/BehavioralPart.h>
+#include <fml/infrastructure/CompositePart.h>
+#include <fml/infrastructure/PropertyPart.h>
+
+
+namespace sep
+{
+
+
+/**
+ * GETTER for PARSER / COMPILER
+ * any Object Element
+ */
+const BF & MachineQuery::getPropertyByNameID(const std::string & aNameID) const
+{
+ return( getPropertyPart().getPropertyByNameID(aNameID) );
+}
+
+const BF & MachineQuery::getrecFormByNameID(const std::string & aNameID) const
+{
+ const BF & form = getPropertyByNameID(aNameID);
+ if( form.valid() )
+ {
+ return( form );
+ }
+
+ CompositePart::const_machine_iterator itMachine =
+ getCompositePart()->machine_begin();
+ CompositePart::const_machine_iterator endMachine =
+ getCompositePart()->machine_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ const BF & form = (itMachine)->getPropertyByNameID(aNameID);
+ if( form.valid() )
+ {
+ return( form );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+const BF & MachineQuery::getsemFormByNameID(const std::string & aNameID) const
+{
+ const Machine * machine = thisMachine();
+
+ const BF & form = machine->getPropertyByNameID(aNameID);
+ if( form.valid() )
+ {
+ return( form );
+ }
+
+ while( machine->hasContainer() &&
+ machine->getContainer()->is< Machine >() )
+ {
+ machine = machine->getContainer()->to< Machine >();
+
+ const BF & form = machine->getPropertyByNameID(aNameID);
+ if( form.valid() )
+ {
+ return( form );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+const BF & MachineQuery::getPropertyByQualifiedNameID(
+ const std::string & aQualifiedNameID) const
+{
+ return( getPropertyPart().
+ getPropertyByQualifiedNameID(aQualifiedNameID) );
+}
+
+const BF & MachineQuery::getrecFormByQualifiedNameID(
+ const std::string & aQualifiedNameID) const
+{
+ const BF & form = getPropertyByQualifiedNameID(aQualifiedNameID);
+ if( form.valid() )
+ {
+ return( form );
+ }
+
+ CompositePart::const_machine_iterator itMachine =
+ getCompositePart()->machine_begin();
+ CompositePart::const_machine_iterator endMachine =
+ getCompositePart()->machine_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ const BF & form =
+ (itMachine)->getPropertyByQualifiedNameID(aQualifiedNameID);
+ if( form.valid() )
+ {
+ return( form );
+ }
+ }
+
+ return( BF::REF_NULL );
+
+ return( BF::REF_NULL );
+}
+
+const BF & MachineQuery::getsemFormByQualifiedNameID(
+ const std::string & aQualifiedNameID) const
+{
+ const Machine * machine = thisMachine();
+
+ const BF & form = machine->getPropertyByQualifiedNameID(aQualifiedNameID);
+ if( form.valid() )
+ {
+ return( form );
+ }
+
+ while( machine->hasContainer()
+ && machine->getContainer()->is< Machine >() )
+ {
+ machine = machine->getContainer()->to< Machine >();
+
+ const BF & form =
+ machine->getPropertyByQualifiedNameID(aQualifiedNameID);
+ if( form.valid() )
+ {
+ return( form );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+/**
+ * GETTER for PARSER / COMPILER
+ * Variable
+ */
+const BF & MachineQuery::getVariable(const std::string & aQualifiedNameID) const
+{
+ return( getPropertyPart().getVariable(aQualifiedNameID) );
+}
+
+const BF & MachineQuery::getrecVariable(
+ const std::string & aQualifiedNameID) const
+{
+ const BF & var = getVariable(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+
+ CompositePart::const_machine_iterator itMachine =
+ getCompositePart()->machine_begin();
+ CompositePart::const_machine_iterator endMachine =
+ getCompositePart()->machine_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ const BF & var = (itMachine)->getrecVariable(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+const BF & MachineQuery::getsemVariable(
+ const std::string & aQualifiedNameID) const
+{
+ const Machine * machine = thisMachine();
+
+ const BF & var = machine->getVariable(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+
+ while( machine->hasContainer()
+ && machine->getContainer()->is< Machine >() )
+ {
+ machine = machine->getContainer()->to< Machine >();
+
+ const BF & var = machine->getVariable(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+/*
+ * TYPEDEF VARIABLE
+ * as ENUMERATION | STRUCTURE
+ */
+
+const BF & MachineQuery::getDataType(const std::string & aQualifiedNameID) const
+{
+ return( getPropertyPart().getDataType(aQualifiedNameID) );
+}
+
+const BF & MachineQuery::getrecDataType(
+ const std::string & aQualifiedNameID) const
+{
+ const BF & var = getDataType(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+
+ CompositePart::const_machine_iterator itMachine =
+ getCompositePart()->machine_begin();
+ CompositePart::const_machine_iterator endMachine =
+ getCompositePart()->machine_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ const BF & var = (itMachine)->getrecDataType(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+const BF & MachineQuery::getsemDataType(
+ const std::string & aQualifiedNameID) const
+{
+ const Machine * machine = thisMachine();
+
+ const BF & var = machine->getDataType(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+
+ while( machine->hasContainer()
+ && machine->getContainer()->is< Machine >() )
+ {
+ machine = machine->getContainer()->to< Machine >();
+
+ const BF & var = machine->getDataType(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+/**
+ * GETTER for PARSER / COMPILER
+ * Buffer
+ */
+const BF & MachineQuery::getBuffer(const std::string & aQualifiedNameID) const
+{
+ return( getPropertyPart().getBuffer(aQualifiedNameID) );
+}
+
+const BF & MachineQuery::getrecBuffer(const std::string & aQualifiedNameID) const
+{
+ const BF & var = getBuffer(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+
+ CompositePart::const_machine_iterator itMachine =
+ getCompositePart()->machine_begin();
+ CompositePart::const_machine_iterator endMachine =
+ getCompositePart()->machine_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ const BF & var = (itMachine)->getrecBuffer(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+const BF & MachineQuery::getsemBuffer(
+ const std::string & aQualifiedNameID) const
+{
+ const Machine * machine = thisMachine();
+
+ const BF & var = machine->getBuffer(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+
+ while( machine->hasContainer()
+ && machine->getContainer()->is< Machine >() )
+ {
+ machine = machine->getContainer()->to< Machine >();
+
+ const BF & var = machine->getBuffer(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+/**
+ * GETTER for PARSER / COMPILER
+ * Channel
+ */
+const BF & MachineQuery::getChannel(const std::string & aQualifiedNameID) const
+{
+ return( getPropertyPart().getChannel(aQualifiedNameID) );
+}
+
+const BF & MachineQuery::getrecChannel(
+ const std::string & aQualifiedNameID) const
+{
+ const BF & var = getChannel(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+
+ CompositePart::const_machine_iterator itMachine =
+ getCompositePart()->machine_begin();
+ CompositePart::const_machine_iterator endMachine =
+ getCompositePart()->machine_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ const BF & var = (itMachine)->getrecChannel(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+const BF & MachineQuery::getsemChannel(
+ const std::string & aQualifiedNameID) const
+{
+ const Machine * machine = thisMachine();
+
+ const BF & var = machine->getChannel(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+
+ while( machine->hasContainer()
+ && machine->getContainer()->is< Machine >() )
+ {
+ machine = machine->getContainer()->to< Machine >();
+
+ const BF & var = machine->getChannel(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+/**
+ * GETTER for PARSER / COMPILER
+ * Port
+ */
+const BF & MachineQuery::getPort(const std::string & aQualifiedNameID) const
+{
+ return( getPropertyPart().getPort(aQualifiedNameID) );
+}
+
+const BF & MachineQuery::getrecPort(const std::string & aQualifiedNameID) const
+{
+ const BF & var = getPort(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+
+ CompositePart::const_machine_iterator itMachine =
+ getCompositePart()->machine_begin();
+ CompositePart::const_machine_iterator endMachine =
+ getCompositePart()->machine_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ const BF & var = (itMachine)->getrecPort(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+const BF & MachineQuery::getsemPort(const std::string & aQualifiedNameID) const
+{
+ const Machine * machine = thisMachine();
+
+ const BF & var = machine->getPort(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+
+ while( machine->hasContainer()
+ && machine->getContainer()->is< Machine >() )
+ {
+ machine = machine->getContainer()->to< Machine >();
+
+ const BF & var = machine->getPort(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+/**
+ * GETTER for PARSER / COMPILER
+ * Signal
+ */
+const BF & MachineQuery::getSignal(const std::string & aQualifiedNameID) const
+{
+ return( getPropertyPart().getSignal(aQualifiedNameID) );
+}
+
+const BF & MachineQuery::getrecSignal(
+ const std::string & aQualifiedNameID) const
+{
+ const BF & var = getSignal(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+
+ CompositePart::const_machine_iterator itMachine =
+ getCompositePart()->machine_begin();
+ CompositePart::const_machine_iterator endMachine =
+ getCompositePart()->machine_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ const BF & var = (itMachine)->getrecSignal(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+const BF & MachineQuery::getsemSignal(
+ const std::string & aQualifiedNameID) const
+{
+ const Machine * machine = thisMachine();
+
+ const BF & var = machine->getSignal(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+ while( machine->hasContainer()
+ && machine->getContainer()->is< Machine >() )
+ {
+ machine = machine->getContainer()->to< Machine >();
+
+ const BF & var = machine->getSignal(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+/**
+ * GETTER for PARSER / COMPILER
+ * Port / Signal
+ */
+const BF & MachineQuery::getPortSignal(
+ const std::string & aQualifiedNameID) const
+{
+ return( getPropertyPart().getPortSignal(aQualifiedNameID) );
+}
+
+const BF & MachineQuery::getrecPortSignal(
+ const std::string & aQualifiedNameID) const
+{
+ {
+ const BF & var = getPortSignal(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+ }
+
+ CompositePart::const_machine_iterator itMachine =
+ getCompositePart()->machine_begin();
+ CompositePart::const_machine_iterator endMachine =
+ getCompositePart()->machine_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ const BF & var = (itMachine)->getrecPortSignal(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+const BF & MachineQuery::getsemPortSignal(
+ const std::string & aQualifiedNameID) const
+{
+ const Machine * machine = thisMachine();
+
+ {
+ const BF & var = machine->getPortSignal(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+ }
+ while( machine->hasContainer()
+ && machine->getContainer()->is< Machine >() )
+ {
+ machine = machine->getContainer()->to< Machine >();
+
+ const BF & var = machine->getPortSignal(aQualifiedNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+/**
+ * GETTER for PARSER / COMPILER
+ * Routine
+ */
+Routine * MachineQuery::rawRoutineByNameID(const std::string & aNameID) const
+{
+ return( (not hasBehaviorPart()) ? NULL :
+ getBehaviorPart()->rawRoutineByNameID(aNameID) );
+}
+
+Routine * MachineQuery::rawsemRoutineByNameID(const std::string & aNameID) const
+{
+ const Machine * machine = thisMachine();
+
+ Routine * routine = machine->rawRoutineByNameID(aNameID);
+
+ while( (routine == NULL) && machine->hasContainer() &&
+ machine->getContainer()->is< Machine >() )
+ {
+ machine = machine->getContainer()->to< Machine >();
+
+ routine = machine->rawRoutineByNameID(aNameID);
+ }
+
+ return( routine );
+}
+
+
+/**
+ * GETTER for PARSER / COMPILER
+ * Procedure
+ */
+Machine * MachineQuery::rawProcedureByNameID(const std::string & aNameID) const
+{
+ return( (getCompositePart() == NULL) ? NULL :
+ getCompositePart()->rawProcedureByNameID(aNameID) );
+}
+
+Machine * MachineQuery::rawsemProcedureByNameID(
+ const std::string & aNameID) const
+{
+ const Machine * machine = thisMachine();
+
+ Machine * procedure = machine->rawProcedureByNameID(aNameID);
+
+ while( (procedure == NULL) && machine->hasContainer() &&
+ machine->getContainer()->is< Machine >() )
+ {
+ machine = machine->getContainer()->to< Machine >();
+
+ procedure = machine->rawProcedureByNameID(aNameID);
+ }
+
+ return( procedure );
+}
+
+
+/**
+ * GETTER for PARSER / COMPILER
+ * Machine
+ */
+Machine * MachineQuery::getMachineByNameID(const std::string & aNameID) const
+{
+ if( thisMachine()->getNameID() == aNameID )
+ {
+ return( const_cast< Machine * >( thisMachine() ) );
+ }
+
+ return( (getCompositePart() == NULL) ? NULL :
+ getCompositePart()->rawMachineByNameID(aNameID) );
+}
+
+
+Machine * MachineQuery::getsemMachineByNameID(const std::string & aNameID) const
+{
+ Machine * machine = const_cast< Machine * >( thisMachine() );
+ Machine * sm = machine->getMachineByNameID(aNameID);
+
+ while( (sm == NULL) && machine->hasContainer() &&
+ machine->getContainer()->is< Machine >() )
+ {
+ machine = machine->getContainer()->to< Machine >();
+
+ sm = machine->getMachineByNameID(aNameID);
+ }
+
+ return( sm );
+}
+
+
+Machine * MachineQuery::getMachine(
+ const std::string & aQualifiedNameID) const
+{
+ Machine * machine = getCompositePart()->
+ getMachines().rawByQualifiedNameID(aQualifiedNameID);
+ if( machine != NULL )
+ {
+ return( machine );
+ }
+
+ if( thisMachine()->fqnEquals( aQualifiedNameID , false ) )
+ {
+ return( const_cast< Machine * >( thisMachine() ) );
+ }
+
+ return( machine );
+}
+
+Machine * MachineQuery::getrecMachine(const std::string & aQualifiedNameID,
+ Machine * ignoreChildMachine) const
+{
+ Machine * machine = NULL;
+
+ if( (machine = getMachine(aQualifiedNameID)) != NULL )
+ {
+ return( machine );
+ }
+
+ CompositePart::const_machine_iterator itMachine =
+ getCompositePart()->machine_begin();
+ CompositePart::const_machine_iterator endMachine =
+ getCompositePart()->machine_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ if( ((itMachine) != ignoreChildMachine) &&
+ ((machine = (itMachine)->getrecMachine(aQualifiedNameID)) != NULL) )
+ {
+ return( machine );
+ }
+ }
+
+ return( machine );
+}
+
+Machine * MachineQuery::getsemMachine(
+ const std::string & aQualifiedNameID) const
+{
+ const Machine * machine = thisMachine();
+
+ Machine * sm = machine->getMachine(aQualifiedNameID);
+
+ while( (sm == NULL) && machine->hasContainer() &&
+ machine->getContainer()->is< Machine >() )
+ {
+ machine = machine->getContainer()->to< Machine >();
+
+ sm = machine->getMachine(aQualifiedNameID);
+ }
+
+ return( sm );
+}
+
+
+
+Machine * MachineQuery::getsemMachine(
+ const std::vector< std::string > & aQualifiedNameID) const
+{
+ std::vector< std::string >::const_iterator it = aQualifiedNameID.begin();
+ std::vector< std::string >::const_iterator endIt = aQualifiedNameID.end();
+
+ Machine * sm = thisMachine()->getsemMachineByNameID(*it);
+
+ for( ++it; (sm != NULL) && (it != endIt) ; ++it)
+ {
+ sm = sm->getMachineByNameID(*it);
+ }
+
+ return( sm );
+}
+
+
+
+Machine * MachineQuery::getExecutableMachine(
+ const std::string & aQualifiedNameID) const
+{
+ Machine * machine = getCompositePart()->
+ rawExecutableMachineByQualifiedNameID(aQualifiedNameID);
+ if( machine != NULL )
+ {
+ return( machine );
+ }
+
+ return( machine );
+}
+
+Machine * MachineQuery::getrecExecutableMachine(
+ const std::string & aQualifiedNameID) const
+{
+ Machine * machine = NULL;
+
+ if( (machine = getExecutableMachine(aQualifiedNameID)) != NULL )
+ {
+ return( machine );
+ }
+
+ CompositePart::const_machine_iterator itMachine =
+ getCompositePart()->machine_begin();
+ CompositePart::const_machine_iterator endMachine =
+ getCompositePart()->machine_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ if( (machine = (itMachine)->getrecExecutableMachine(aQualifiedNameID)) != NULL )
+ {
+ return( machine );
+ }
+ }
+
+ return( machine );
+}
+
+Machine * MachineQuery::getsemExecutableMachine(
+ const std::string & aQualifiedNameID) const
+{
+ const Machine * machine = thisMachine();
+
+ Machine * sm = machine->getExecutableMachine(aQualifiedNameID);
+
+ while( (sm == NULL) && machine->hasContainer() &&
+ machine->getContainer()->is< Machine >() )
+ {
+ machine = machine->getContainer()->to< Machine >();
+
+ sm = machine->getExecutableMachine(aQualifiedNameID);
+ }
+
+ return( sm );
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/MachineQuery.h b/org.eclipse.efm.symbex/src/fml/infrastructure/MachineQuery.h
new file mode 100644
index 0000000..4e2b216
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/MachineQuery.h
@@ -0,0 +1,176 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 8 mars 2017
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef FML_INFRASTRUCTURE_MACHINEQUERY_H_
+#define FML_INFRASTRUCTURE_MACHINEQUERY_H_
+
+#include <cstddef>
+#include <string>
+#include <vector>
+
+
+namespace sep
+{
+
+class BF;
+class BehavioralPart;
+class CompositePart;
+class PropertyPart;
+class Machine;
+class Routine;
+
+
+class MachineQuery
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Executable
+ */
+ MachineQuery()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~MachineQuery()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * API
+ */
+ virtual const Machine * thisMachine() const = 0;
+
+ virtual const PropertyPart & getPropertyPart() const = 0;
+
+ virtual const CompositePart * getCompositePart() const = 0;
+
+ virtual BehavioralPart * getBehaviorPart() const = 0;
+
+ virtual bool hasBehaviorPart() const = 0;
+
+
+ /**
+ * GETTER for PARSER / COMPILER
+ * any Object Element
+ */
+
+ const BF & getPropertyByNameID(const std::string & aNameID) const;
+ const BF & getrecFormByNameID(const std::string & aNameID) const;
+ const BF & getsemFormByNameID(const std::string & aNameID) const;
+
+ const BF & getPropertyByQualifiedNameID(const std::string & aQualifiedNameID) const;
+ const BF & getrecFormByQualifiedNameID(const std::string & aQualifiedNameID) const;
+ const BF & getsemFormByQualifiedNameID(const std::string & aQualifiedNameID) const;
+
+
+ /**
+ * GETTER for PARSER / COMPILER
+ * Variable
+ */
+ const BF & getVariable(const std::string & aQualifiedNameID) const;
+ const BF & getrecVariable(const std::string & aQualifiedNameID) const;
+ const BF & getsemVariable(const std::string & aQualifiedNameID) const;
+
+ const BF & getDataType(const std::string & aQualifiedNameID) const;
+ const BF & getrecDataType(const std::string & aQualifiedNameID) const;
+ const BF & getsemDataType(const std::string & aQualifiedNameID) const;
+
+ /**
+ * GETTER for PARSER / COMPILER
+ * Buffer
+ */
+ const BF & getBuffer(const std::string & aQualifiedNameID) const;
+ const BF & getrecBuffer(const std::string & aQualifiedNameID) const;
+ const BF & getsemBuffer(const std::string & aQualifiedNameID) const;
+
+ /**
+ * GETTER for PARSER / COMPILER
+ * Channel
+ */
+ const BF & getChannel(const std::string & aQualifiedNameID) const;
+ const BF & getrecChannel(const std::string & aQualifiedNameID) const;
+ const BF & getsemChannel(const std::string & aQualifiedNameID) const;
+
+ /**
+ * GETTER for PARSER / COMPILER
+ * Port
+ */
+ const BF & getPort(const std::string & aQualifiedNameID) const;
+ const BF & getrecPort(const std::string & aQualifiedNameID) const;
+ const BF & getsemPort(const std::string & aQualifiedNameID) const;
+
+
+ /**
+ * GETTER for PARSER / COMPILER
+ * Signal
+ */
+ const BF & getSignal(const std::string & aQualifiedNameID) const;
+ const BF & getrecSignal(const std::string & aQualifiedNameID) const;
+ const BF & getsemSignal(const std::string & aQualifiedNameID) const;
+
+
+ /**
+ * GETTER for PARSER / COMPILER
+ * Port / Signal
+ */
+ const BF & getPortSignal(const std::string & aQualifiedNameID) const;
+ const BF & getrecPortSignal(const std::string & aQualifiedNameID) const;
+ const BF & getsemPortSignal(const std::string & aQualifiedNameID) const;
+
+
+ /**
+ * GETTER for PARSER / COMPILER
+ * Routine
+ */
+ Routine * rawRoutineByNameID(const std::string & aNameID) const;
+ Routine * rawsemRoutineByNameID(const std::string & aNameID) const;
+
+ /**
+ * GETTER for PARSER / COMPILER
+ * Procedure
+ */
+ Machine * rawProcedureByNameID(const std::string & aNameID) const;
+ Machine * rawsemProcedureByNameID(const std::string & aNameID) const;
+
+ /**
+ * GETTER for PARSER / COMPILER
+ * Machine
+ */
+ Machine * getMachineByNameID(const std::string & aNameID) const;
+ Machine * getsemMachineByNameID(const std::string & aNameID) const;
+
+ Machine * getMachine(const std::string & aQualifiedNameID) const;
+ Machine * getrecMachine(const std::string & aQualifiedNameID,
+ Machine * ignoreChildMachine = NULL) const;
+ Machine * getsemMachine(const std::string & aQualifiedNameID) const;
+
+ Machine * getsemMachine(const std::vector< std::string > & aQualifiedNameID) const;
+
+ Machine * getExecutableMachine(const std::string & aQualifiedNameID) const;
+ Machine * getrecExecutableMachine(const std::string & aQualifiedNameID) const;
+ Machine * getsemExecutableMachine(const std::string & aQualifiedNameID) const;
+
+};
+
+
+} /* namespace sep */
+
+#endif /* FML_INFRASTRUCTURE_MACHINEQUERY_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/ModelOfComputationPart.cpp b/org.eclipse.efm.symbex/src/fml/infrastructure/ModelOfComputationPart.cpp
new file mode 100644
index 0000000..b3cb1d6
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/ModelOfComputationPart.cpp
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 22 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ModelOfComputationPart.h"
+
+#include <fml/infrastructure/Machine.h>
+
+
+namespace sep
+{
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+ModelOfComputationPart::ModelOfComputationPart(
+ Machine * aContainer, const std::string aNameID)
+: ObjectClassifier( CLASS_KIND_T( ModelOfComputationPart ) ,
+ aContainer , aNameID)
+{
+ //!! NOTHING
+}
+
+
+/**
+ * Serialization
+ */
+void ModelOfComputationPart::toStream(OutStream & os) const
+{
+ os << TAB << "@" << getNameID() << ":" << EOL;
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/ModelOfComputationPart.h b/org.eclipse.efm.symbex/src/fml/infrastructure/ModelOfComputationPart.h
new file mode 100644
index 0000000..1b9067d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/ModelOfComputationPart.h
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 22 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef FML_INFRASTRUCTURE_MODELOFCOMPUTATIONPART_H_
+#define FML_INFRASTRUCTURE_MODELOFCOMPUTATIONPART_H_
+
+#include <fml/common/ObjectClassifier.h>
+
+#include <common/AvmPointer.h>
+
+
+namespace sep
+{
+
+class Machine;
+
+
+class ModelOfComputationPart :
+ public ObjectClassifier ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ModelOfComputationPart )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( ModelOfComputationPart )
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ModelOfComputationPart(Machine * aContainer,
+ const std::string aNameID = "moc");
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ModelOfComputationPart()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * Serialization
+ */
+ void toStream(OutStream & os) const;
+
+
+};
+
+
+}
+
+#endif /* FML_INFRASTRUCTURE_MODELOFCOMPUTATIONPART_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/Package.cpp b/org.eclipse.efm.symbex/src/fml/infrastructure/Package.cpp
new file mode 100644
index 0000000..815a6fa
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/Package.cpp
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 22 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "Package.h"
+
+#include <fml/infrastructure/CompositePart.h>
+#include <fml/infrastructure/PropertyPart.h>
+
+
+namespace sep
+{
+
+/**
+ * Serialization
+ */
+
+void Package::strHeader(OutStream & os) const
+{
+ os << getModifier().toString() << "package " << getNameID();
+}
+
+
+void Package::toStream(OutStream & os) const
+{
+ os << TAB << getModifier().toString()
+ << "package " << getNameID() << EOL << std::flush;
+
+ if( mPackages.nonempty() )
+ {
+ os << TAB << "import:" << EOL;
+ os << TAB2 << "include {" << EOL;
+ TableOfMachine::const_raw_iterator it = mPackages.begin();
+ TableOfMachine::const_raw_iterator endIt = mPackages.end();
+ for( ; it != endIt ; ++it )
+ {
+ os << TAB3 << (it)->as< Package >()->getLocation() << ";" << EOL;
+ }
+
+ os << TAB2 << "}" << EOL2_FLUSH;
+ }
+
+ if( hasProperty() )
+ {
+ getPropertyPart().toStream(os);
+ os << EOL;
+ }
+
+ if( mCompositeSpecification != NULL )
+ {
+ mCompositeSpecification->toStream( os );
+ }
+
+ os << std::flush;
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/Package.h b/org.eclipse.efm.symbex/src/fml/infrastructure/Package.h
new file mode 100644
index 0000000..58ecf91
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/Package.h
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 22 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef LIBRARY_H_
+#define LIBRARY_H_
+
+#include <fml/infrastructure/Machine.h>
+
+#include <fml/common/SpecifierElement.h>
+
+#include <collection/BFContainer.h>
+
+#include <common/AvmPointer.h>
+#include <common/BF.h>
+
+
+namespace sep
+{
+
+class Machine;
+
+
+class Package : public Machine ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( Package )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( Package )
+
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef TableOfBF_T< Machine > TableOfMachine;
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ TableOfMachine mPackages;
+
+ std::string mLocation;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Package(const std::string & id)
+ : Machine(CLASS_KIND_T( Package ), NULL, "pack::" + id,
+ id, id, Specifier::COMPONENT_PACKAGE_SPECIFIER),
+ mPackages( ),
+ mLocation( )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Package()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mLocation
+ */
+ inline std::string getLocation() const
+ {
+ return( mLocation );
+ }
+
+ inline void setLocation(const std::string & aLocation)
+ {
+ mLocation = aLocation;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mPackages
+ */
+ inline const TableOfMachine & getPackages() const
+ {
+ return( mPackages );
+ }
+
+ inline void appendPackage(const BF & aPackage)
+ {
+ mPackages.append( aPackage );
+ }
+
+
+ /**
+ * Serialization
+ */
+ void strHeader(OutStream & os) const;
+
+ void toStream(OutStream & os) const;
+
+};
+
+
+}
+
+#endif /* LIBRARY_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/Port.cpp b/org.eclipse.efm.symbex/src/fml/infrastructure/Port.cpp
new file mode 100644
index 0000000..11b3479
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/Port.cpp
@@ -0,0 +1,180 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 17 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "Port.h"
+
+#include <fml/infrastructure/Channel.h>
+#include <fml/infrastructure/Machine.h>
+#include <fml/infrastructure/PropertyPart.h>
+
+#include <fml/type/TypeManager.h>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+Port::Port(const PropertyPart & aPropertyPart, const std::string & aNameID,
+ IComPoint::ENUM_IO_NATURE aNature, const Modifier & aModifier)
+: PropertyElement( CLASS_KIND_T( Port ),
+ aPropertyPart.getContainer() , aModifier , aNameID ),
+mModel( ),
+mComPointNature( aNature ),
+mComposite( false ),
+
+mContents( new PropertyPart(this, "contents") ),
+
+mRoutingChannel( NULL )
+{
+ //!! NOTHING
+}
+
+
+Port::Port(Channel * aChannel,
+ const Modifier & aModifier, const BF & portPattern)
+: PropertyElement(CLASS_KIND_T( Port ), aChannel, portPattern.to_ref< Port >()),
+mModel( portPattern ),
+mComPointNature( portPattern.to_ptr< Port >()->mComPointNature ),
+mComposite( false ),
+
+mContents( new PropertyPart(this, "contents") ),
+
+mRoutingChannel( aChannel )
+{
+ getwModifier().override_ifdef( aModifier );
+}
+
+
+/**
+ * GETTER
+ * mContents
+ */
+bool Port::hasContents() const
+{
+ return( (mContents != NULL) && mContents->nonempty() );
+}
+
+
+/**
+ * GETTER - SETTER
+ * mParameters
+ */
+const TableOfVariable & Port::getParameters() const
+{
+ return( mContents->getVariables() );
+}
+
+avm_size_t Port::getParametersCount() const
+{
+ return( mContents->getVariables().size() );
+}
+
+avm_offset_t Port::getParameterOffset(const std::string & label) const
+{
+ return( mContents->getVariables().getOffsetByNameID(label) );
+}
+
+void Port::appendParameter(const BF & aParam)
+{
+ mContents->appendVariable( aParam );
+}
+
+void Port::saveParameter(Variable * aParam)
+{
+ mContents->saveOwnedVariable( aParam );
+}
+
+
+/**
+ * GETTER
+ * the container
+ */
+Machine * Port::getContainerMachine()
+{
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( getContainer()->is< Machine >() )
+ << "Invalid << Port Container >> Type <"
+ << getContainer()->classKindName() << "> Cast !!!"
+ << SEND_EXIT;
+
+ return( getContainer()->to< Machine >() );
+}
+
+
+/**
+ * Serialization
+ */
+void Port::toStream(OutStream & out) const
+{
+ out << TAB << getModifier().toString()
+ << IComPoint::str_nature( getComPointNature() );
+
+ if( hasSignalModel() )
+ {
+ out << "< " << getSignalModel()->getNameID() << " >";
+ }
+
+ out << " " << getNameID();
+
+ if( mContents->hasVariable() )
+ {
+ TableOfVariable::const_raw_iterator it =
+ mContents->getVariables().begin();
+ TableOfVariable::const_raw_iterator endIt =
+ mContents->getVariables().end();
+
+ out << "(";
+ for( std::string sep = "" ; it != endIt ; ++it )
+ {
+ out << sep; if( sep.empty() ) { sep = ", "; }
+
+ if( (it)->getModifier().hasNatureParameterBind() )
+ {
+ out << "#bind " << (it)->strValue();
+ }
+ else if( (it)->getModifier().hasNatureParameter() )
+ {
+ out << (it)->strTypeSpecifier();
+
+ if( not (it)->getNameID().empty() )
+ {
+ out << " " << (it)->getNameID();
+
+ if( (it)->hasValue() )
+ {
+ out << " = " << (it)->strValue();
+ }
+ }
+ else if( (it)->hasValue() )
+ {
+ out << " " << (it)->strValue();
+ }
+ }
+ else
+ {
+ out << str_header( *it );
+ }
+ }
+ out << ")";
+ }
+
+ out << ";" << EOL_FLUSH;
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/Port.h b/org.eclipse.efm.symbex/src/fml/infrastructure/Port.h
new file mode 100644
index 0000000..ba76f52
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/Port.h
@@ -0,0 +1,210 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 17 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef PORT_H_
+#define PORT_H_
+
+#include <fml/common/PropertyElement.h>
+
+#include <fml/lib/IComPoint.h>
+
+#include <common/BF.h>
+
+#include <fml/infrastructure/Variable.h>
+
+
+namespace sep
+{
+
+
+class Channel;
+class Machine;
+class Modifier;
+class ObjectElement;
+class PropertyPart;
+
+
+/**
+ * TYPEDEF
+ */
+class Port;
+
+typedef Port Signal;
+
+
+
+class Port :
+ public PropertyElement,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( Port )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( Port )
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ BF mModel;
+
+ IComPoint::ENUM_IO_NATURE mComPointNature;
+
+ bool mComposite;
+
+ PropertyPart * mContents;
+
+ Channel * mRoutingChannel;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Port(const PropertyPart & aPropertyPart,
+ const std::string & aNameID, IComPoint::ENUM_IO_NATURE aNature,
+ const Modifier & aModifier = Modifier::PROPERTY_INOUT_DIRECTION);
+
+ Port(Channel * aChannel,
+ const Modifier & aModifier, const BF & aPortPattern);
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Port()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER
+ * the container
+ */
+ virtual Machine * getContainerMachine();
+
+
+ /**
+ * GETTER - SETTER
+ * mModel
+ */
+ inline Signal * getSignalModel() const
+ {
+ return( mModel.to_ptr< Port >() );
+ }
+
+ inline bool hasSignalModel() const
+ {
+ return( mModel.is< Port >() );
+ }
+
+
+ /**
+ * mComPointNature
+ */
+ inline IComPoint::ENUM_IO_NATURE getComPointNature() const
+ {
+ return( mComPointNature );
+ }
+
+ inline bool isSignal() const
+ {
+ return( mComPointNature == IComPoint::IO_SIGNAL_NATURE );
+ }
+
+
+ /**
+ * isComposite
+ */
+ inline bool isComposite() const
+ {
+ return( mComposite );
+ }
+
+ inline bool isBasic() const
+ {
+ return( not mComposite );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mContents
+ */
+ inline PropertyPart * getContents() const
+ {
+ return( mContents );
+ }
+
+ bool hasContents() const;
+
+ inline void setContents(PropertyPart * aContents)
+ {
+ mContents = aContents;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mParameters
+ */
+ const TableOfVariable & getParameters() const;
+
+ avm_size_t getParametersCount() const;
+
+ avm_offset_t getParameterOffset(const std::string & label) const;
+
+ void appendParameter(const BF & aParam);
+
+ void saveParameter(Variable * aParam);
+
+
+ /**
+ * GETTER - SETTER
+ * mRoutingChannel
+ */
+ inline Channel * getRoutingChannel() const
+ {
+ return( mRoutingChannel );
+ }
+
+ inline bool hasRoutingChannel() const
+ {
+ return( mRoutingChannel != NULL );
+ }
+
+ inline void setRoutingChannel(Channel * aRoutingChannel)
+ {
+ mRoutingChannel = aRoutingChannel;
+ }
+
+
+ /**
+ * Serialization
+ */
+ void strHeader(OutStream & out) const
+ {
+ out << str_indent( this );
+ }
+
+ void toStream(OutStream & out) const;
+
+};
+
+
+}
+
+#endif /* PORT_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/PropertyPart.cpp b/org.eclipse.efm.symbex/src/fml/infrastructure/PropertyPart.cpp
new file mode 100644
index 0000000..e1b8959
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/PropertyPart.cpp
@@ -0,0 +1,198 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 22 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "PropertyPart.h"
+
+
+namespace sep
+{
+
+/**
+ * DISPATCH
+ * mOwnedElements
+ */
+void PropertyPart::dispatchOwnedElement(const BF & anElement)
+{
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( anElement )
+ << "Executable Machine owned element !!!"
+ << SEND_EXIT;
+
+ switch( anElement.classKind() )
+ {
+ // PROPERTY ELEMENT
+ case FORM_XFSP_VARIABLE_KIND:
+ {
+ dispatchOwnedVariable( anElement );
+
+ break;
+ }
+
+ case FORM_XFSP_DATATYPE_KIND:
+ {
+ mDataTypes.append( anElement );
+ break;
+ }
+
+ case FORM_XFSP_BUFFER_KIND:
+ {
+ mBuffers.append( anElement );
+ break;
+ }
+
+ case FORM_XFSP_CHANNEL_KIND:
+ {
+ mChannels.append( anElement );
+ break;
+ }
+
+ case FORM_XFSP_PORT_KIND:
+ {
+ mPorts.append( anElement );
+ break;
+ }
+
+
+ default:
+ { // TODO
+ AVM_OS_FATAL_ERROR_EXIT
+ << "dispatchOwnedElement() unexpected object, typeinfo: "
+ << anElement.classKindInfo() << "\n\t<< "
+ << anElement.to_ptr< ObjectElement >()->strHeader()
+ << " >> !!!"
+ << SEND_EXIT;
+ break;
+ }
+ }
+}
+
+
+/**
+ * DISPATCH - SAVE
+ * using Variable::Modifier
+ * mVariables
+ * mVariableParameters
+ * mVariableReturns
+ */
+void PropertyPart::dispatchOwnedVariable(const BF & aVariable)
+{
+ mVariables.append( aVariable );
+
+ const Modifier & aModifier =
+ aVariable.to_ptr< Variable >()->getModifier();
+
+ if( aModifier.hasNatureParameter() )
+ {
+ if( aModifier.isDirectionReturn() )
+ {
+ mVariableReturns.append( aVariable );
+ }
+ else //if( aModifier.hasDirectionOtheThanReturn() )
+ {
+ mVariableParameters.append( aVariable );
+ }
+ }
+}
+
+
+/**
+ * Serialization
+ */
+void PropertyPart::strVariableParameters(OutStream & os,
+ const std::string & begin, const std::string & end,
+ const std::string & sep) const
+{
+ if( mVariableParameters.nonempty() )
+ {
+ os << begin;
+
+ const_variable_iterator it = var_parameter_begin();
+ const_variable_iterator endIt = var_parameter_end();
+
+ (it)->strParameter(os);
+ for( ++it ; it != endIt ; ++it )
+ {
+ (it)->strParameter( os << sep );
+ }
+
+ os << end;
+ }
+}
+
+void PropertyPart::strVariableReturns(OutStream & os,
+ const std::string & begin, const std::string & end,
+ const std::string & sep) const
+{
+ if( mVariableReturns.nonempty() )
+ {
+ os << begin;
+
+ const_variable_iterator it = var_return_begin();
+ const_variable_iterator endIt = var_return_end();
+
+ (it)->strReturn(os);
+ for( ++it ; it != endIt ; ++it )
+ {
+ (it)->strReturn( os << sep );
+ }
+
+ os << end;
+ }
+}
+
+
+void PropertyPart::toStream(OutStream & os) const
+{
+ os << TAB << "@" << getNameID() << ":" << EOL_INCR_INDENT;
+
+ if( mOwnedElements.nonempty() )
+ {
+ mOwnedElements.toStream(os);
+ }
+
+// if( mDataTypes.nonempty() )
+// {
+// mDataTypes.toStream(os);
+// }
+//
+// if( mBuffers.nonempty() )
+// {
+// mBuffers.toStream(os);
+// }
+//
+// if( mPorts.nonempty() )
+// {
+// mPorts.toStream(os);
+// }
+//
+// if( mSignals.nonempty() )
+// {
+// mSignals.toStream(os);
+// }
+//
+// if( mChannels.nonempty() )
+// {
+// mChannels.toStream(os);
+// }
+//
+// if( mVariables.nonempty() )
+// {
+// mVariables.toStream(os);
+// }
+
+ os << DECR_INDENT << std::flush;
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/PropertyPart.h b/org.eclipse.efm.symbex/src/fml/infrastructure/PropertyPart.h
new file mode 100644
index 0000000..8758d5e
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/PropertyPart.h
@@ -0,0 +1,596 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 22 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef FML_INFRASTRUCTURE_PROPERTYPART_H_
+#define FML_INFRASTRUCTURE_PROPERTYPART_H_
+
+#include <fml/common/ObjectClassifier.h>
+#include <fml/common/ObjectElement.h>
+
+#include <collection/BFContainer.h>
+
+#include <fml/infrastructure/Buffer.h>
+#include <fml/infrastructure/Channel.h>
+#include <fml/infrastructure/DataType.h>
+#include <fml/infrastructure/Port.h>
+#include <fml/infrastructure/Variable.h>
+
+
+namespace sep
+{
+
+
+class PropertyPart : public ObjectClassifier ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( PropertyPart )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( PropertyPart )
+
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef TableOfBF_T< Buffer > TableOfBuffer;
+
+ typedef TableOfBF_T< Port > TableOfPort;
+
+ typedef TableOfBF_T< Signal > TableOfSignal;
+
+ typedef TableOfBF_T< Channel > TableOfChannel;
+
+ typedef TableOfBF_T< DataType > TableOfDataType;
+
+ typedef TableOfBF_T< Variable > TableOfVariable;
+
+ typedef TableOfBF_T< ObjectElement > TableOfOwnedElement;
+
+ /**
+ * ITERATORS
+ */
+
+ typedef TableOfOwnedElement::const_raw_iterator const_owned_iterator;
+
+ typedef TableOfDataType::const_raw_iterator const_type_iterator;
+
+ typedef TableOfVariable::const_raw_iterator const_variable_iterator;
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ TableOfOwnedElement mOwnedElements;
+
+ TableOfBuffer mBuffers;
+
+ TableOfPort mPorts;
+
+ TableOfSignal mSignals;
+
+ TableOfChannel mChannels;
+
+ TableOfDataType mDataTypes;
+
+ TableOfVariable mVariables;
+
+ TableOfVariable mVariableParameters;
+
+ TableOfVariable mVariableReturns;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ PropertyPart(ObjectElement * aContainer, const std::string & aNameID)
+ : ObjectClassifier( CLASS_KIND_T( PropertyPart ) , aContainer , aNameID ),
+ mOwnedElements( ),
+ mBuffers( ),
+ mPorts( ),
+ mSignals( ),
+ mChannels( ),
+ mDataTypes( ),
+ mVariables( ),
+ mVariableParameters( ),
+ mVariableReturns( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ PropertyPart(const PropertyPart & aPart)
+ : ObjectClassifier( aPart ),
+ mOwnedElements( aPart.mOwnedElements ),
+ mBuffers( aPart.mBuffers ),
+ mPorts( aPart.mPorts ),
+ mSignals( aPart.mSignals ),
+ mChannels( aPart.mChannels ),
+ mDataTypes( aPart.mDataTypes ),
+ mVariables( aPart.mVariables ),
+ mVariableParameters( aPart.mVariableParameters ),
+ mVariableReturns( aPart.mVariableReturns )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~PropertyPart()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - DISPATCH - SAVE
+ * mOwnedElements
+ */
+ inline const TableOfOwnedElement & getOwnedElements() const
+ {
+ return( mOwnedElements );
+ }
+
+
+ /**
+ * [ CONST ] ITERATOR
+ */
+ inline const_owned_iterator owned_begin() const
+ {
+ return( mOwnedElements.begin() );
+ }
+
+ inline const_owned_iterator owned_end() const
+ {
+ return( mOwnedElements.end() );
+ }
+
+
+ /**
+ * DISPATCH - SAVE
+ * mOwnedElements
+ */
+ void dispatchOwnedElement(const BF & anElement);
+
+ inline const BF & saveOwnedElement(ObjectElement * ptrElement)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( ptrElement )
+ << "Property owned element !!!"
+ << SEND_EXIT;
+
+ // Should be set by the executable machine container !
+ ptrElement->setOffset( mOwnedElements.size() );
+
+ mOwnedElements.append( INCR_BF( ptrElement ) );
+
+ dispatchOwnedElement( mOwnedElements.last() );
+
+ return( mOwnedElements.last() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mBuffers
+ */
+ inline void appendBuffer(const BF & aBuffer)
+ {
+ mBuffers.append( aBuffer );
+
+ mOwnedElements.append( aBuffer );
+ }
+
+ inline const TableOfBuffer & getBuffers() const
+ {
+ return( mBuffers );
+ }
+
+ inline const BF & getBuffer(const std::string & aQualifiedNameID) const
+ {
+ return( mBuffers.getByQualifiedNameID(aQualifiedNameID) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mPorts
+ */
+ inline void appendPort(const BF & aPort)
+ {
+ mPorts.append( aPort );
+
+ mOwnedElements.append( aPort );
+ }
+
+ inline const TableOfPort & getPorts() const
+ {
+ return( mPorts );
+ }
+
+ inline const BF & getPort(const std::string & aQualifiedNameID) const
+ {
+ return( mPorts.getByQualifiedNameID(aQualifiedNameID) );
+ }
+
+ inline bool hasPort() const
+ {
+ return( mPorts.nonempty() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mSignals
+ */
+ inline void appendSignal(const BF & aSignal)
+ {
+ mSignals.append( aSignal );
+
+ mOwnedElements.append( aSignal );
+ }
+
+ inline const TableOfSignal & getSignals() const
+ {
+ return( mSignals );
+ }
+
+ inline const BF & getSignal(const std::string & aQualifiedNameID) const
+ {
+ return( mSignals.getByQualifiedNameID(aQualifiedNameID) );
+ }
+
+ inline bool hasSignal() const
+ {
+ return( mSignals.nonempty() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mPorts / mSignals
+ */
+ inline const BF & getPortSignal(const std::string & aQualifiedNameID) const
+ {
+ const BF & port = mPorts.getByQualifiedNameID(aQualifiedNameID);
+ if( port.valid() )
+ {
+ return( port );
+ }
+ else
+ {
+ return( mSignals.getByQualifiedNameID(aQualifiedNameID) );
+ }
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mBuffers
+ */
+ inline void appendChannel(const BF & aChannel)
+ {
+ mChannels.append( aChannel );
+
+ mOwnedElements.append( aChannel );
+ }
+
+ inline const TableOfChannel & getChannels() const
+ {
+ return( mChannels );
+ }
+
+ inline const BF & getChannel(const std::string & aQualifiedNameID) const
+ {
+ return( mChannels.getByQualifiedNameID(aQualifiedNameID) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mDataTypes
+ */
+ inline void appendDataType(const BF & aDataType)
+ {
+ mDataTypes.append( aDataType );
+
+ mOwnedElements.append( aDataType );
+ }
+
+ inline const TableOfDataType & getDataTypes() const
+ {
+ return( mDataTypes );
+ }
+
+ inline const BF & getDataType(const std::string & aQualifiedNameID) const
+ {
+ return( mDataTypes.getByQualifiedNameID(aQualifiedNameID) );
+ }
+
+
+ /**
+ * [ CONST ] ITERATOR
+ */
+ inline const_type_iterator type_begin() const
+ {
+ return( mDataTypes.begin() );
+ }
+
+ inline const_type_iterator type_end() const
+ {
+ return( mDataTypes.end() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mVariables
+ */
+ inline void appendVariable(const BF & aVariable)
+ {
+ mVariables.append( aVariable );
+
+ mOwnedElements.append( aVariable );
+ }
+
+ inline const TableOfVariable & getVariables() const
+ {
+ return( mVariables );
+ }
+
+ inline const BF & getVariable(const std::string & aQualifiedNameID) const
+ {
+ return( mVariables.getByQualifiedNameID(aQualifiedNameID) );
+ }
+
+ inline bool hasVariable() const
+ {
+ return( mVariables.nonempty() );
+ }
+
+// inline void saveVariable(Variable * aVariable)
+// {
+// appendVariable( BF(aVariable) );
+// }
+
+
+ /**
+ * [ CONST ] ITERATOR
+ */
+ inline const_variable_iterator variable_begin() const
+ {
+ return( mVariables.begin() );
+ }
+
+ inline const_variable_iterator variable_end() const
+ {
+ return( mVariables.end() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mVariableParameters
+ */
+ inline void appendVariableParameter(const BF & aVariable)
+ {
+ mVariableParameters.append( aVariable );
+
+ mOwnedElements.append( aVariable );
+ }
+
+ inline const TableOfVariable & getVariableParameters() const
+ {
+ return( mVariableParameters );
+ }
+
+ inline const BF & getVariableParameter(
+ const std::string & aQualifiedNameID) const
+ {
+ return( mVariableParameters.getByQualifiedNameID(aQualifiedNameID) );
+ }
+
+ inline bool hasVariableParameter() const
+ {
+ return( mVariableParameters.nonempty() );
+ }
+
+
+ /**
+ * [ CONST ] ITERATOR
+ */
+ inline const_variable_iterator var_parameter_begin() const
+ {
+ return( mVariableParameters.begin() );
+ }
+
+ inline const_variable_iterator var_parameter_end() const
+ {
+ return( mVariableParameters.end() );
+ }
+
+
+ /**
+ * UTIL
+ * mVariables as Parameters
+ */
+ inline const BF & getVariableParameter(avm_size_t offset) const
+ {
+ return( mVariableParameters.get( offset ) );
+ }
+
+ inline avm_offset_t getVariableParametersCount() const
+ {
+ return( mVariableParameters.size() );
+ }
+
+ inline avm_offset_t getVariableParameterOffsetByNameID(
+ const std::string & aNameID) const
+ {
+ return( mVariableParameters.getOffsetByNameID( aNameID ) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mVariableReturns
+ */
+ inline void appendVariableReturn(const BF & aVariable)
+ {
+ mVariableReturns.append( aVariable );
+
+ mOwnedElements.append( aVariable );
+ }
+
+ inline const TableOfVariable & getVariableReturns() const
+ {
+ return( mVariableReturns );
+ }
+
+ inline const BF & getVariableReturn(
+ const std::string & aQualifiedNameID) const
+ {
+ return( mVariableReturns.getByQualifiedNameID(aQualifiedNameID) );
+ }
+
+ inline bool hasVariableReturn() const
+ {
+ return( mVariableReturns.nonempty() );
+ }
+
+
+ /**
+ * [ CONST ] ITERATOR
+ */
+ inline const_variable_iterator var_return_begin() const
+ {
+ return( mVariableReturns.begin() );
+ }
+
+ inline const_variable_iterator var_return_end() const
+ {
+ return( mVariableReturns.end() );
+ }
+
+
+ /**
+ * UTIL
+ * mVariables as Returns
+ */
+ inline const BF & getVariableReturn(avm_size_t offset) const
+ {
+ return( mVariableReturns.get( offset ) );
+ }
+
+ inline avm_offset_t getVariableReturnsCount() const
+ {
+ return( mVariableReturns.size() );
+ }
+
+ inline avm_offset_t getVariableReturnOffsetByNameID(
+ const std::string & aNameID) const
+ {
+ return( mVariableReturns.getOffsetByNameID( aNameID ) );
+ }
+
+
+ /**
+ * DISPATCH - SAVE
+ * using Variable::Modifier
+ * mVariables
+ * mVariableParameters
+ * mVariableReturns
+ * mVariableInternals
+ */
+ void dispatchOwnedVariable(const BF & aVariable);
+
+ inline const BF & saveOwnedVariable(Variable * aVariable)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( aVariable )
+ << "Property Variable owned element !!!"
+ << SEND_EXIT;
+
+ // Should be set by the executable machine container !
+ aVariable->setOffset( mOwnedElements.size() );
+
+ mOwnedElements.append( INCR_BF( aVariable ) );
+
+ dispatchOwnedVariable( mOwnedElements.last() );
+
+ return( mOwnedElements.last() );
+ }
+
+
+ /**
+ * GETTER
+ * general
+ */
+ inline bool empty() const
+ {
+ return( mOwnedElements.empty() );
+ }
+
+ inline bool nonempty() const
+ {
+ return( mOwnedElements.nonempty() );
+ }
+
+
+ /**
+ * GETTER for
+ * PARSER
+ * COMPILER
+ */
+ inline const BF & getPropertyByNameID(const std::string & aNameID) const
+ {
+ return( mOwnedElements.getByNameID(aNameID) );
+ }
+
+ inline const BF & getPropertyByQualifiedNameID(
+ const std::string & aQualifiedNameID) const
+ {
+ return( mOwnedElements.getByQualifiedNameID(aQualifiedNameID) );
+ }
+
+
+ /**
+ * Serialization
+ */
+ void strVariableParameters(OutStream & os,
+ const std::string & begin = " [ ",
+ const std::string & end = " ]",
+ const std::string & sep = ", ") const;
+
+ void strVariableReturns(OutStream & os,
+ const std::string & begin = " returns: [ ",
+ const std::string & end = " ]",
+ const std::string & sep = ", ") const;
+
+ void toStream(OutStream & os) const;
+
+};
+
+
+}
+
+#endif /* FML_INFRASTRUCTURE_PROPERTYPART_H_ */
+
+
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/README.md b/org.eclipse.efm.symbex/src/fml/infrastructure/README.md
new file mode 100644
index 0000000..67c5808
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/README.md
@@ -0,0 +1,80 @@
+# EFM-SYMBEX : Infrastructure
+
+## Object lyfe cycle / stage
+
+### Modeling
+
+### Compiled
+
+### Runtime
+
+
+## Elements
+
+Modeling | Compiled | Runtime
+-------------------|-------------------|-------------------
+System | ExecutableSystem | Execution Context/Data
+System | ExecutableForm | RuntimeForm
+ | |
+Machine | ExecutableForm | RuntimeForm
+Machine | InstanceOfMachine | Optimized Runtime Process Access
+ | |
+Statemachine | ExecutableForm | RuntimeForm
+Statemachine | InstanceOfMachine | Optimized Runtime Process Access
+ | |
+State | ExecutableForm | ?? RuntimeForm
+State | InstanceOfMachine | ?? Optimized Runtime Process Access
+ | |
+Procedure | ExecutableForm | RuntimeForm
+Procedure | InstanceOfMachine | Optimized Runtime Process Access
+ | |
+Instance | InstanceOfMachine | Optimized Runtime Process Access
+Instance | InstanceOfMachine | Specific Primitive Routine Code
+ | |
+Primitive Routine | Program | Optimized
+Routine | Program | Optimized
+Transition | Program | Optimized
+Transition | Program | Optimized
+ | |
+Variable | InstanceOfData | Optimized Runtime [L/R] Value Access
+Buffer | InstanceOfBuffer | Optimized Runtime Concrete Buffer Access
+Port | InstanceOfPort | Optimized Runtime Routing Data Access
+Signal/Message | | Message Data
+Connector | InstanceOfConnector |
+ | |
+Expression | Bytecode | Optimized Bytecode
+Instruction | Bytecode | Optimized Bytecode
+ | |
+
+## Source code structure
+
+### Interfaces
+
+### Classes
+* **System**
+* **Machine**
+* **Behavior**
+* **Routine**
+* **Procedure**
+* **Instance**
+* **Connector**
+* **Router**
+* **Message**
+
+#### Behavior
+* **Statemachine**
+* **Region**
+* **State**
+* **Pseudstate**
+* **Transition**
+
+#### Statemachine Behavior
+* **Statemachine**
+* **Region**
+* **State**
+* **Pseudstate**
+* **Transition**
+
+### Factories
+
+
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/Routine.cpp b/org.eclipse.efm.symbex/src/fml/infrastructure/Routine.cpp
new file mode 100644
index 0000000..6d781c9
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/Routine.cpp
@@ -0,0 +1,504 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 7 déc. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "Routine.h"
+
+#include <fml/common/BehavioralElement.h>
+
+#include <fml/infrastructure/BehavioralPart.h>
+#include <fml/infrastructure/Machine.h>
+#include <fml/infrastructure/Variable.h>
+
+#include <fml/expression/BuiltinArray.h>
+
+#include <fml/operator/OperatorManager.h>
+#include <fml/workflow/UniFormIdentifier.h>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+Routine::Routine(Machine * aContainer,
+ const std::string & aNameID, const Modifier & aModifier,
+ const Specifier & aSpecifier, const BF & aModel)
+: BehavioralElement( CLASS_KIND_T( Routine ) ,
+ aContainer, aModifier , aNameID ),
+SpecifierImpl( aSpecifier ),
+
+mModel( aModel ),
+
+mParameters( ),
+mReturns( ),
+mCode( )
+{
+ //!! NOTHING
+}
+
+
+Routine::Routine(const BehavioralPart & aBehavioralPart,
+ const std::string & aNameID, const Specifier & aSpecifier)
+: BehavioralElement( CLASS_KIND_T( Routine ),
+ aBehavioralPart.getContainer(), aNameID ),
+SpecifierImpl( aSpecifier ),
+
+mModel( BF::REF_NULL ),
+
+mParameters( ),
+mReturns( ),
+mCode( )
+{
+ //!! NOTHING
+}
+
+
+Routine * Routine::newDefine(Machine * aContainer, const std::string & aNameID)
+{
+ return( new Routine(aContainer, aNameID,
+ Specifier::DESIGN_MODEL_SPECIFIER) );
+}
+
+Routine * Routine::newInvoke(Machine * aContainer, const BF & aModel)
+{
+ return( new Routine(aContainer,
+ aModel.as_ptr< Routine >()->getNameID(),
+ Specifier::DESIGN_INSTANCE_DYNAMIC_SPECIFIER, aModel) );
+}
+
+
+/**
+ * GETTER
+ * from vector of parameters / returns
+ */
+const BF & Routine::getByNameID(
+ const BFVector & params, const std::string & aNameID)
+{
+ BFVector::const_iterator it = params.begin();
+ BFVector::const_iterator endIt = params.end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).is< Variable >() &&
+ ((*it).to_ptr< Variable >()->getNameID() == aNameID) )
+ {
+ return( *it );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+avm_offset_t Routine::getOffsetByNameID(
+ const BFVector & params, const std::string & label)
+{
+ BFVector::const_iterator it = params.begin();
+ BFVector::const_iterator endIt = params.end();
+ for( avm_offset_t offset ; it != endIt ; ++it , ++offset )
+ {
+ if( (*it).is< Variable >() &&
+ ((*it).to_ptr< Variable >()->getNameID() == label) )
+ {
+ return( offset );
+ }
+ }
+
+ return( AVM_NO_OFFSET );
+}
+
+
+/**
+ * TESTER
+ * mParameters
+ * mReturns
+ */
+//!! Warning: Unused static function
+//static bool isContained(const BFVector & params, Variable * aParam)
+//{
+// BFVector::const_iterator it = params.begin();
+// BFVector::const_iterator endIt = params.end();
+// for( avm_offset_t offset ; it != endIt ; ++it , ++offset )
+// {
+// if( (*it).isTEQ(aParam) )
+// {
+// return( true );
+// }
+// }
+//
+// return( false );
+//}
+
+
+bool Routine::hasParameterOffset(Variable * aParameter) const
+{
+ return( (aParameter->getOffset() < mParameters.size()) &&
+ mParameters[ aParameter->getOffset() ].isTEQ(aParameter) );
+}
+
+void Routine::saveParameter(Variable * anInput)
+{
+ mParameters.append( BF(anInput) );
+}
+
+
+bool Routine::hasReturnOffset(Variable * aReturn) const
+{
+ return( (aReturn->getOffset() < mReturns.size()) &&
+ mReturns[ aReturn->getOffset() ].isTEQ(aReturn) );
+}
+
+void Routine::saveReturn(Variable * anOutput)
+{
+ mReturns.append( BF(anOutput) );
+}
+
+
+/**
+ * MACRO
+ * INLINING
+ */
+BFCode Routine::inlineCode(const BFCode & aCode) const
+{
+ if( aCode->isOpCode( AVM_OPCODE_RETURN ) )
+ {
+ return( BFCode::REF_NULL );
+ }
+ else
+ {
+ BFCode newCode( aCode->getOperator() );
+ BF substArg;
+
+ AvmCode::const_iterator itArg = aCode->begin();
+ AvmCode::const_iterator itEndArg = aCode->end();
+ for( ; itArg != itEndArg ; ++itArg )
+ {
+ if( (substArg = inlineCode(*itArg)).valid() )
+ {
+ newCode->append( substArg );
+ }
+ else
+ {
+ return( BFCode::REF_NULL );
+ }
+ }
+
+ return( newCode );
+ }
+}
+
+
+BF Routine::inlineCode(const BF & aCode) const
+{
+ switch( aCode.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ return( inlineCode( aCode.bfCode() ) );
+ }
+
+ case FORM_XFSP_VARIABLE_KIND:
+ {
+ Variable * aVar = aCode.to_ptr< Variable >();
+
+ if( getModel()->hasParameterOffset( aVar ) )
+ {
+ if( (aVar->getOffset() < mParameters.size()) &&
+ mParameters[ aVar->getOffset() ].valid() )
+ {
+ return( mParameters[ aVar->getOffset() ] );
+ }
+ else if( aVar->hasValue() )
+ {
+ return( aVar->getValue() );
+ }
+ else if( aVar->getModifier().hasNatureMacro()
+ && aVar->hasBinding() )
+ {
+ return( aVar->getBinding() );
+ }
+
+ return( BFCode::REF_NULL );
+ }
+ else if( getModel()->hasReturnOffset( aVar ) )
+ {
+ if( (aVar->getOffset() < mReturns.size()) &&
+ mReturns[ aVar->getOffset() ].valid() )
+ {
+ return( mReturns[ aVar->getOffset() ] );
+ }
+ else if( aVar->hasValue() )
+ {
+ return( aVar->getValue() );
+ }
+ else if( aVar->getModifier().hasNatureMacro()
+ && aVar->hasBinding() )
+ {
+ return( aVar->getBinding() );
+ }
+
+ return( BFCode::REF_NULL );
+ }
+
+ return( aCode );
+ }
+
+ case FORM_UFI_KIND:
+ {
+ UniFormIdentifier * anUFI = aCode.to_ptr< UniFormIdentifier >();
+
+ UniFormIdentifier::ListOfField::const_iterator itField = anUFI->begin();
+ UniFormIdentifier::ListOfField::const_iterator endField = anUFI->end();
+
+ BF newCode;
+ BF substArg;
+
+ if( (substArg = inlineCode(*itField)).valid() )
+ {
+ if( substArg.is< UniFormIdentifier >() )
+ {
+ newCode = anUFI = new UniFormIdentifier(
+ substArg.to_ref< UniFormIdentifier >() );
+ }
+ else
+ {
+ newCode = anUFI = new UniFormIdentifier(anUFI->getLocator());
+
+ anUFI->appendField( substArg , (*itField).getScheme() );
+ }
+
+ for( ++itField ; itField != endField ; ++itField )
+ {
+ if( (substArg = inlineCode(*itField)).valid() )
+ {
+ anUFI->appendField( substArg , (*itField).getScheme() );
+ }
+ else
+ {
+ return( BFCode::REF_NULL );
+ }
+ }
+
+ return( newCode );
+ }
+ else
+ {
+ return( BFCode::REF_NULL );
+ }
+ }
+
+ case FORM_ARRAY_BF_KIND:
+ {
+ ArrayBF * arrayIn = aCode.to_ptr< ArrayBF >();
+
+ ArrayBF * arrayOut = new ArrayBF(
+ arrayIn->getTypeSpecifier(), arrayIn->size());
+
+ BF newCode( arrayOut );
+ BF substArg;
+
+ for( avm_size_t idx = 0 ; idx < arrayIn->size() ; ++idx )
+ {
+ if( (substArg = inlineCode(arrayIn->at(idx))).valid() )
+ {
+ arrayOut->set(idx, substArg);
+ }
+ else
+ {
+ return( BFCode::REF_NULL );
+ }
+ }
+
+ return( newCode );
+ }
+
+ default:
+ {
+ return( aCode );
+ }
+ }
+
+ return( aCode );
+}
+
+
+/**
+ * Serialization
+ */
+void Routine::strParameters(OutStream & os, const std::string & sep) const
+{
+ BFVector::const_iterator it = mParameters.begin();
+ BFVector::const_iterator endIt = mParameters.end();
+
+ os << "(";
+ if( (*it).is< Variable >() )
+ {
+ os << "$" << (*it).to_ptr< Variable >()->getOffset() << ": ";
+ (*it).to_ptr< Variable >()->strParameter(os);
+ }
+ else
+ {
+ os << (*it).str();
+ }
+ for( ++it ; it != endIt ; ++it )
+ {
+ os << ", ";
+ if( (*it).is< Variable >() )
+ {
+ os << "$" << (*it).to_ptr< Variable >()->getOffset() << ": ";
+ (*it).to_ptr< Variable >()->strParameter(os);
+ }
+ else
+ {
+ os << (*it).str();
+ }
+ }
+ os << ")";
+}
+
+void Routine::strReturns(OutStream & os, const std::string & sep) const
+{
+ BFVector::const_iterator it = mReturns.begin();
+ BFVector::const_iterator endIt = mReturns.end();
+
+ os << "(";
+ if( (*it).is< Variable >() )
+ {
+ os << "$" << (*it).to_ptr< Variable >()->getOffset() << ": ";
+ (*it).to_ptr< Variable >()->strReturn(os);
+ }
+ else
+ {
+ os << (*it).str();
+ }
+ for( ++it ; it != endIt ; ++it )
+ {
+ os << ", ";
+ if( (*it).is< Variable >() )
+ {
+ os << "$" << (*it).to_ptr< Variable >()->getOffset() << ": ";
+ (*it).to_ptr< Variable >()->strReturn(os);
+ }
+ else
+ {
+ os << (*it).str();
+ }
+ }
+ os << ")";
+}
+
+
+void Routine::strHeader(OutStream & os) const
+{
+ os << getModifier().toString();
+
+ if( getSpecifier().isDesignPrototypeStatic() )
+ {
+ os << getSpecifier().toString_not(
+ Specifier::DESIGN_PROTOTYPE_STATIC_KIND) << "@";
+ }
+ else
+ {
+ os << getSpecifier().toString() << "routine ";
+ }
+
+ os << getNameID();
+
+ if( mParameters.nonempty() )
+ {
+ strParameters(os);
+ }
+ if( mReturns.nonempty() )
+ {
+ os << " --> ";
+
+ strReturns(os);
+ }
+}
+
+
+void Routine::toStream(OutStream & os) const
+{
+ strHeader( os << TAB );
+
+ os << "{";
+ if( mCode.valid() )
+ {
+ mCode->toStreamRoutine( os << INCR_INDENT ) << DECR_INDENT_TAB;
+ }
+ os << "}" << EOL_FLUSH;
+}
+
+
+
+void Routine::strInvokeParameters(OutStream & os, const std::string & sep) const
+{
+ BFVector::const_iterator it = mParameters.begin();
+ BFVector::const_iterator endIt = mParameters.end();
+
+ os << "(";
+ AvmCode::toStream(os, *it);
+ for( ++it ; it != endIt ; ++it )
+ {
+ os << ", ";
+ AvmCode::toStream(os, *it);
+ }
+ os << ")";
+}
+
+void Routine::strInvokeReturns(OutStream & os, const std::string & sep) const
+{
+ BFVector::const_iterator it = mReturns.begin();
+ BFVector::const_iterator endIt = mReturns.end();
+
+ os << "(";
+ AvmCode::toStream(os, *it);
+ for( ++it ; it != endIt ; ++it )
+ {
+ os << ", ";
+ AvmCode::toStream(os, *it);
+ }
+ os << ")";
+}
+
+
+void Routine::toStreamInvoke(OutStream & os, const std::string & sep) const
+{
+ os << TAB << getNameID() << AVM_NO_INDENT;
+
+ if( mParameters.nonempty() )
+ {
+ strInvokeParameters(os, sep);
+ }
+ else
+ {
+ os << "()";
+ }
+
+ if( mReturns.nonempty() )
+ {
+ os << " --> ";
+ strInvokeReturns(os, sep);
+ }
+
+ AVM_DEBUG_REF_COUNTER(os);
+
+ os << END_INDENT << EOL_FLUSH;
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/Routine.h b/org.eclipse.efm.symbex/src/fml/infrastructure/Routine.h
new file mode 100644
index 0000000..171d466
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/Routine.h
@@ -0,0 +1,410 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 7 déc. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef ROUTINE_H_
+#define ROUTINE_H_
+
+#include <fml/common/BehavioralElement.h>
+#include <fml/common/SpecifierElement.h>
+
+#include <collection/BFContainer.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/StatementConstructor.h>
+#include <fml/expression/StatementTypeChecker.h>
+
+#include <fml/operator/Operator.h>
+
+
+namespace sep
+{
+
+class BehavioralPart;
+
+class Machine;
+
+class ObjectElement;
+
+class Variable;
+
+
+class Routine :
+ public BehavioralElement,
+ public SpecifierImpl,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( Routine )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( Routine )
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ BF mModel;
+
+ BFVector mParameters;
+
+ BFVector mReturns;
+
+ BFCode mCode;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Routine(Machine * aContainer, const std::string & aNameID,
+ const Modifier & aModifier, const Specifier & aSpecifier,
+ const BF & aModel = BF::REF_NULL);
+
+
+ Routine(BehavioralElement * aContainer, const std::string & aNameID,
+ const Specifier & aSpecifier =
+ Specifier::DESIGN_PROTOTYPE_STATIC_SPECIFIER,
+ const BF & aModel = BF::REF_NULL)
+ : BehavioralElement( CLASS_KIND_T( Routine ), aContainer, aNameID ),
+ SpecifierImpl( aSpecifier ),
+
+ mModel( aModel ),
+
+ mParameters( ),
+ mReturns( ),
+ mCode( )
+ {
+ //!! NOTHING
+ }
+
+ Routine(const BehavioralPart & aBehavioralPart,
+ const std::string & aNameID,
+ const Specifier & aSpecifier =
+ Specifier::DESIGN_PROTOTYPE_STATIC_SPECIFIER);
+
+
+public:
+ inline static Routine * newDefine(
+ Machine * aContainer, Modifier aModifier,
+ Specifier aSpecifier, const std::string & aNameID)
+ {
+
+ return( new Routine(aContainer, aNameID, aModifier,
+ aSpecifier.setDesignModel()) );
+ }
+
+ static Routine * newDefine(
+ Machine * aContainer, const std::string & aNameID);
+
+ inline static Routine * newDefine(
+ const BehavioralPart & aBehavioralPart,
+ const std::string & aNameID)
+ {
+
+ return( new Routine(aBehavioralPart, aNameID,
+ Specifier::DESIGN_MODEL_SPECIFIER) );
+ }
+
+ inline static Routine * newInvoke(
+ BehavioralElement * aContainer, const std::string & aNameID)
+ {
+ return( new Routine(aContainer, aNameID,
+ Specifier::DESIGN_INSTANCE_DYNAMIC_SPECIFIER) );
+ }
+
+ static Routine * newInvoke(Machine * aContainer, const BF & aModel);
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Routine()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * the Type Specifier
+ */
+ inline const BF & getType() const
+ {
+ return( mModel );
+ }
+
+// inline bool hasType() const
+// {
+// return( mModel.valid() );
+// }
+//
+// inline void setType(const BF & aType)
+// {
+// mModel = aType;
+// }
+//
+
+ /**
+ * GETTER - SETTER
+ * mModel as Routine Model
+ */
+ inline Routine * getModel() const
+ {
+ return( mModel.as_ptr< Routine >() );
+ }
+
+ inline bool hasModel() const
+ {
+ return( mModel.is< Routine >() );
+ }
+
+ inline void setModel(const BF & aModel)
+ {
+ mModel = aModel;
+
+ if( aModel.is< Routine >() )
+ {
+ BehavioralElement::setNameID(
+ aModel.to_ptr< Routine >()->getNameID() );
+ }
+ else
+ {
+ BehavioralElement::setNameID( aModel.str() );
+ }
+ }
+
+ // Model as Invokable Operator
+ inline Operator * getModelOperator() const
+ {
+ return( mModel.as_ptr< Operator >() );
+ }
+
+ inline bool hasModelOperator() const
+ {
+ return( mModel.is< Operator >() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mCode
+ */
+ inline BFCode & getCode()
+ {
+ return( mCode );
+ }
+
+ inline const BFCode & getCode() const
+ {
+ return( mCode );
+ }
+
+ inline bool hasCode() const
+ {
+ return( mCode.valid() );
+ }
+
+ inline bool doSomething() const
+ {
+ return( mCode.valid() && StatementTypeChecker::doSomething(mCode) );
+ }
+
+ inline void setCode(const BFCode & aCode)
+ {
+ mCode = aCode;
+ }
+
+ inline void seqCode(const BFCode & aCode)
+ {
+ if( mCode.valid() )
+ {
+ mCode = StatementConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE, mCode, aCode);
+ }
+ else
+ {
+ mCode = aCode;
+ }
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mParameters
+ */
+ inline BFVector & getParameters()
+ {
+ return( mParameters );
+ }
+
+ inline const BF & getParameter(avm_offset_t offset) const
+ {
+ return( mParameters[offset] );
+ }
+
+ inline const BF & getParameter(const std::string & aNameID) const
+ {
+ return( getByNameID(mParameters, aNameID) );
+ }
+
+ avm_offset_t getParameterOffset(const std::string & label) const
+ {
+ return( getOffsetByNameID(mParameters, label) );
+ }
+
+
+ inline bool hasParameters() const
+ {
+ return( mParameters.nonempty() );
+ }
+
+ bool hasParameterOffset(Variable * aParameter) const;
+
+
+ inline void appendParameter(const BF & anInput)
+ {
+ mParameters.append( anInput );
+ }
+
+ void saveParameter(Variable * anInput);
+
+ inline void appendParameter(const std::string & label, const BF & anInput)
+ {
+ mParameters.append( anInput );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mReturns
+ */
+ inline BFVector & getReturns()
+ {
+ return( mReturns );
+ }
+
+ inline const BF & getReturn(avm_offset_t offset) const
+ {
+ return( mReturns[offset] );
+ }
+
+ inline const BF & getReturn(const std::string & aNameID) const
+ {
+ return( getByNameID(mReturns, aNameID) );
+ }
+
+ avm_offset_t getReturnOffset(const std::string & label) const
+ {
+ return( getOffsetByNameID(mReturns, label) );
+ }
+
+
+ inline bool hasReturns() const
+ {
+ return( mReturns.nonempty() );
+ }
+
+ bool hasReturnOffset(Variable * aReturn) const;
+
+
+ inline void appendReturn(const BF & anOutput)
+ {
+ mReturns.append( anOutput );
+ }
+
+ void saveReturn(Variable * anOutput);
+
+ inline void appendReturn(const std::string & label, const BF & anOutput)
+ {
+ mReturns.append( anOutput );
+ }
+
+
+ /**
+ * GETTER
+ * the parameters / returns
+ */
+ inline const BF & getParamReturn(const std::string & aNameID) const
+ {
+ const BF & bfParam = getParameter(aNameID);
+
+ return( bfParam.valid() ? bfParam : getReturn(aNameID) );
+
+ }
+
+ static const BF & getByNameID(
+ const BFVector & params, const std::string & aNameID);
+
+ static avm_offset_t getOffsetByNameID(
+ const BFVector & params, const std::string & label);
+
+
+ /**
+ * MACRO
+ * INLINING
+ */
+ inline bool isInlinableStatement() const
+ {
+ return( getSpecifier().isDesignInstanceDynamic() && hasModel()
+ && getModel()->getModifier().hasNatureMacro() );
+ }
+
+ inline BFCode inlineStatement() const
+ {
+ return( inlineCode( getModel()->mCode ) );
+ }
+
+
+ inline bool isInlinableExpression() const
+ {
+ return( getSpecifier().isDesignInstanceDynamic() && hasModel()
+ && getModel()->getModifier().hasNatureMacro()
+ && getModel()->getReturns().singleton()
+ && getModel()->getCode()->isOpCode( AVM_OPCODE_RETURN ) );
+ }
+
+ inline BF inlineExpression() const
+ {
+ return( inlineCode( getModel()->mCode->first() ) );
+ }
+
+
+ BFCode inlineCode(const BFCode & aCode) const;
+
+ BF inlineCode(const BF & aCode) const;
+
+
+ /**
+ * Serialization
+ */
+ void strParameters(OutStream & os, const std::string & sep = ", ") const;
+
+ void strReturns(OutStream & os, const std::string & sep = ", ") const;
+
+ void strHeader(OutStream & os) const;
+
+ void toStream(OutStream & os) const;
+
+
+ void strInvokeParameters(OutStream & os, const std::string & sep = ", ") const;
+
+ void strInvokeReturns(OutStream & os, const std::string & sep = ", ") const;
+
+ void toStreamInvoke(OutStream & os, const std::string & sep = ", ") const;
+
+};
+
+
+} /* namespace sep */
+#endif /* ROUTINE_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/System.cpp b/org.eclipse.efm.symbex/src/fml/infrastructure/System.cpp
new file mode 100644
index 0000000..11b5d50
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/System.cpp
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 17 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "System.h"
+
+#include <collection/Typedef.h>
+
+#include <fml/infrastructure/Package.h>
+
+#include <fml/workflow/WObject.h>
+
+
+namespace sep
+{
+
+
+/**
+ * Serialization
+ */
+
+void System::strHeader(OutStream & os) const
+{
+ os << getModifier().toString()
+ << getSpecifier().strDesign_not(
+ Specifier::DESIGN_PROTOTYPE_STATIC_KIND)
+ << getSpecifier().keywordComponent();
+
+ if( getSpecifier().isDefined(Specifier::DISABLE_COMPONENT_DESIGN_FIELD) )
+ {
+ os << "< " << getSpecifier().str(
+ Specifier::DISABLE_COMPONENT_DESIGN_FIELD) << " >";
+ }
+
+ os << " " << getNameID();
+}
+
+
+void System::toStream(OutStream & os) const
+{
+ if( hasWObject() )
+ {
+ getWObject()->toStream(os);
+ }
+
+ os << TAB << "@FormalML< system , 1.0 >:" << EOL2_FLUSH;
+
+ Machine::toStream(os);
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/System.h b/org.eclipse.efm.symbex/src/fml/infrastructure/System.h
new file mode 100644
index 0000000..0316c4d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/System.h
@@ -0,0 +1,122 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 17 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef SYSTEM_H_
+#define SYSTEM_H_
+
+#include <fml/infrastructure/Machine.h>
+
+#include <collection/BFContainer.h>
+
+#include <fml/infrastructure/Package.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// SYSTEM POINTER
+////////////////////////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////////////////////////
+// SYSTEM SMART POINTER
+////////////////////////////////////////////////////////////////////////////////
+
+
+
+class System :
+ public Machine,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( System )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( System )
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ BFList mPackages;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ System(const std::string & aNameID)
+ : Machine(CLASS_KIND_T( System ), NULL, "spec::" + aNameID,
+ aNameID, aNameID, Specifier::COMPONENT_SYSTEM_SPECIFIER),
+ mPackages( )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~System()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER
+ * the machine container
+ * LC[R]A
+ */
+ inline virtual Machine * getContainerMachine() const
+ {
+ return( hasContainer() ? getContainer()->to< Machine >() : NULL );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mPackages
+ */
+ inline BFList & getPackages()
+ {
+ return( mPackages );
+ }
+
+ inline const BFList & getPackages() const
+ {
+ return( mPackages );
+ }
+
+ inline void appendPackage(const BF & aPackage)
+ {
+ mPackages.append( aPackage );
+ }
+
+
+ /**
+ * Serialization
+ */
+ void strHeader(OutStream & os) const;
+
+ void toStream(OutStream & os) const;
+
+};
+
+
+}
+
+#endif /* SYSTEM_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/Transition.cpp b/org.eclipse.efm.symbex/src/fml/infrastructure/Transition.cpp
new file mode 100644
index 0000000..4623f97
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/Transition.cpp
@@ -0,0 +1,365 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 18 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "Transition.h"
+
+#include <fml/infrastructure/Machine.h>
+#include <fml/infrastructure/PropertyPart.h>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+Transition::Transition(Machine * aContainer)
+: BehavioralElement( CLASS_KIND_T( Transition ), aContainer),
+SpecifierImpl( ),
+
+mMocKind( MOC_SIMPLE_KIND ),
+
+mPriority( 0 ),
+mProbability( 0.0 ),
+mTokenCount( 0 ),
+
+mSource( aContainer ),
+mTarget( ),
+
+mDeclaration( NULL ),
+mStatement( )
+{
+ //!! NOTHING
+}
+
+Transition::Transition(Machine * aContainer,
+ const std::string & aNameID, MOC_KIND aKind)
+: BehavioralElement( CLASS_KIND_T( Transition ), aContainer, aNameID),
+SpecifierImpl( ),
+
+mMocKind( aKind ),
+
+mPriority( 0 ),
+mProbability( 0.0 ),
+mTokenCount( 0 ),
+
+mSource( aContainer ),
+mTarget( ),
+
+mDeclaration( NULL ),
+mStatement( )
+{
+ //!! NOTHING
+}
+
+Transition::Transition(Machine * aContainer, const Transition * aTransPattern)
+: BehavioralElement(CLASS_KIND_T( Transition ), aContainer, (*aTransPattern)),
+ SpecifierImpl( aTransPattern ),
+
+mMocKind( aTransPattern->mMocKind ),
+
+mPriority( aTransPattern->mPriority ),
+mProbability( aTransPattern->mProbability ),
+mTokenCount( aTransPattern->mTokenCount ),
+
+mSource( aContainer ),
+mTarget( aTransPattern->mTarget ),
+
+mDeclaration( (aTransPattern->mDeclaration == NULL) ? NULL :
+ new PropertyPart( *(aTransPattern->mDeclaration) ) ),
+mStatement( aTransPattern->mStatement )
+{
+
+}
+
+
+/**
+ * DESTRUCTOR
+ */
+Transition::~Transition()
+{
+ delete mDeclaration;
+}
+
+
+/**
+ * GETTER - SETTER
+ * mDeclaration
+ */
+
+bool Transition::hasDeclaration() const
+{
+ return( (mDeclaration != NULL) && mDeclaration->nonempty() );
+}
+
+
+
+/**
+ * GETTER - SETTER
+ * UFI , ID
+ */
+void Transition::updateNameID(const std::string & aNameID)
+{
+ setFullyQualifiedNameID(
+ ObjectElement::makeFullyQualifiedNameID(
+ getContainer()->as< Machine >(), aNameID) );
+
+ setNameID(aNameID);
+
+ setUnrestrictedName(aNameID);
+}
+
+
+/**
+ * GETTER - SETTER
+ * mSource
+ */
+Machine * Transition::getSourceContainer() const
+{
+ return( mSource->getContainerMachine() );
+}
+
+
+/**
+ * Serialization
+ */
+Transition::MOC_KIND Transition::toMocKind(const std::string & id)
+{
+ if( id == "simple" ) return MOC_SIMPLE_KIND;
+
+ if( id == "abort" ) return MOC_ABORT_KIND;
+
+ if( id == "final" ) return MOC_FINAL_KIND;
+
+ if( id == "else" ) return MOC_ELSE_KIND;
+
+ if( id == "internal" ) return MOC_INTERNAL_KIND;
+
+ if( id == "auto" ) return MOC_AUTO_KIND;
+
+ if( id == "flow" ) return MOC_FLOW_KIND;
+
+ return MOC_UNDEFINED_KIND;
+}
+
+
+std::string Transition::strMocKind(
+ moc_kind_t mask, const std::string & SEPARATOR) const
+{
+ moc_kind_t kind = mMocKind & mask;
+
+ switch( kind )
+ {
+ case MOC_SIMPLE_KIND : return( "simple" );
+ case MOC_ABORT_KIND : return( "abort" );
+ case MOC_FINAL_KIND : return( "final" );
+
+ case MOC_ELSE_KIND : return( "else" );
+
+ case MOC_INTERNAL_KIND : return( "internal");
+
+ case MOC_AUTO_KIND : return( "auto" );
+
+ case MOC_FLOW_KIND : return( "flow" );
+
+ case MOC_UNDEFINED_KIND : return( "undefined<transition#kind>" );
+
+ default :
+ {
+ std::string strKind = "";
+ std::string sep = "";
+
+ if( kind & MOC_SIMPLE_KIND )
+ {
+ strKind = "simple";
+ sep = SEPARATOR;
+ }
+ else if( kind & MOC_ABORT_KIND )
+ {
+ strKind = "abort";
+ sep = SEPARATOR;
+ }
+ else if( kind & MOC_FINAL_KIND )
+ {
+ strKind = "final";
+ sep = SEPARATOR;
+ }
+
+ if( kind & MOC_ELSE_KIND )
+ {
+ strKind = strKind + sep + "else";
+ }
+
+ if( strKind.empty() )
+ {
+ return( "unknown<transition#kind>" );
+ }
+ else
+ {
+ return( strKind );
+ }
+
+ }
+ }
+}
+
+
+void Transition::strHeader(OutStream & os) const
+{
+ os << getModifier().toString() << "transition";
+ if( not isMocSimple() )
+ {
+ os << "< " << strMocKind( ~ MOC_SIMPLE_KIND );
+ if( mPriority != 0 )
+ {
+ os << " , " << mPriority;
+ }
+ if( mProbability != 0 )
+ {
+ os << " , " << mProbability;
+ }
+ os << " >";
+ }
+ else if( mPriority != 0 )
+ {
+ os << "< " << mPriority;
+ if( mProbability != 0 )
+ {
+ os << " , " << mProbability;
+ }
+ os << " >";
+ }
+ else if( mProbability != 0 )
+ {
+ os << "< " << mProbability << " >";
+ }
+
+ os << " " << getNameID();
+
+ if( mTarget.valid() )
+ {
+ if( mTokenCount != 0 )
+ {
+ os << "(" << mTokenCount << ")";
+ }
+
+ os << " : " << str_header( getContainer()->as< Machine >() ) << " --> "
+ << (mTarget.is< Machine >() ?
+ mTarget.to_ptr< Machine >()->getNameID() : mTarget.str());
+ }
+}
+
+
+void Transition::toStreamHeader(OutStream & os) const
+{
+ os << getModifier().toString()
+ << "transition " << getNameID() << " : "
+ << getSource()->getNameID();
+
+ if( mTarget.is< Machine >() || mTarget.is< Variable >() )
+ {
+ os << " --> " << mTarget.to_ptr< ObjectElement >()->getNameID();
+ }
+ else if( mTarget.valid() )
+ {
+ os << " --> " << mTarget.str();
+ }
+
+ os << std::flush;
+}
+
+
+void Transition::toStream(OutStream & os) const
+{
+ os << TAB << "transition";
+ if( not isMocSimple() )
+ {
+ os << "< " << strMocKind( ~ MOC_SIMPLE_KIND );
+ if( mPriority != 0 )
+ {
+ os << " , " << mPriority;
+ }
+ if( mProbability != 0 )
+ {
+ os << " , " << mProbability;
+ }
+ os << " >";
+ }
+ else if( mPriority != 0 )
+ {
+ os << "< " << mPriority;
+ if( mProbability != 0 )
+ {
+ os << " , " << mProbability;
+ }
+ os << " >";
+ }
+ else if( mProbability != 0 )
+ {
+ os << "< " << mProbability << " >";
+ }
+
+ if( mTokenCount != 0 )
+ {
+ os << "(" << mTokenCount << ")";
+ }
+
+ os << " " << getNameID();
+
+ if( mTarget.valid() )
+ {
+ os << " --> " << mTarget.str();
+ }
+
+ if( hasDeclaration() )
+ {
+ os << " {" << EOL;
+
+ mDeclaration->toStream(os);
+ os << EOL;
+
+ if( mStatement.valid() )
+ {
+ os << TAB << "moe:" << EOL;
+
+ os << TAB2 << "@run{" << INCR2_INDENT;
+ mStatement->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+ os << TAB << "}" << EOL;
+ }
+
+ else if( mStatement.valid() )
+ {
+ mStatement->toStreamRoutine( os << " {" << INCR_INDENT )
+ << DECR_INDENT_TAB << "}";
+ }
+ else
+ {
+ os << ";";
+ }
+
+ os << EOL << std::flush;
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/Transition.h b/org.eclipse.efm.symbex/src/fml/infrastructure/Transition.h
new file mode 100644
index 0000000..08d9868
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/Transition.h
@@ -0,0 +1,378 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 18 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef TRANSITION_H_
+#define TRANSITION_H_
+
+#include <fml/common/BehavioralElement.h>
+#include <fml/common/SpecifierElement.h>
+
+#include <common/AvmPointer.h>
+#include <common/BF.h>
+
+#include <fml/expression/AvmCode.h>
+
+
+namespace sep
+{
+
+class Machine;
+class PropertyPart;
+
+
+class Transition :
+ public BehavioralElement,
+ public SpecifierImpl,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( Transition )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( Transition )
+
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef avm_uint8_t moc_kind_t;
+
+ enum MOC_KIND
+ {
+ MOC_UNDEFINED_KIND = 0x000,
+
+
+ MOC_SIMPLE_KIND = 0x001,
+
+ MOC_ABORT_KIND = 0x002,
+
+ MOC_FINAL_KIND = 0x004,
+
+
+ MOC_ELSE_KIND = 0x010,
+
+
+ MOC_INTERNAL_KIND = 0x020,
+
+ MOC_AUTO_KIND = 0x040,
+
+
+ MOC_FLOW_KIND = 0x080,
+
+ //ELSE CASE
+ MOC_SIMPLE_ELSE_KIND = MOC_ELSE_KIND | MOC_SIMPLE_KIND,
+ MOC_ABORT_ELSE_KIND = MOC_ELSE_KIND | MOC_ABORT_KIND,
+ MOC_FINAL_ELSE_KIND = MOC_ELSE_KIND | MOC_FINAL_KIND,
+
+ MOC_INTERNAL_ELSE_KIND = MOC_ELSE_KIND | MOC_INTERNAL_KIND,
+ MOC_AUTO_ELSE_KIND = MOC_ELSE_KIND | MOC_AUTO_KIND,
+ MOC_FLOW_ELSE_KIND = MOC_ELSE_KIND | MOC_FLOW_KIND,
+
+
+ MOC_MASK_ALL_KIND = 0x0FF
+ };
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ moc_kind_t mMocKind;
+
+ int mPriority;
+
+ float mProbability;
+
+ int mTokenCount;
+
+ Machine * mSource;
+ BF mTarget;
+
+ PropertyPart * mDeclaration;
+
+ BFCode mStatement;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Transition(Machine * aContainer);
+
+ Transition(Machine * aContainer, const std::string & aNameID,
+ MOC_KIND aKind = MOC_SIMPLE_KIND);
+
+ Transition(Machine * aContainer, const Transition * aTransitionPattern);
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Transition();
+
+
+ /**
+ * GETTER - SETTER
+ * UFI , ID
+ */
+ void updateNameID(const std::string & id);
+
+
+ /**
+ * GETTER - SETTER
+ * mMocKind
+ */
+ inline moc_kind_t getMocKind() const
+ {
+ return( mMocKind );
+ }
+
+ inline void setMocKind(moc_kind_t aMocKind)
+ {
+ mMocKind = aMocKind;
+ }
+
+ inline bool hasMocSimple() const
+ {
+ return( mMocKind & MOC_SIMPLE_KIND );
+ }
+
+ inline bool isMocSimple() const
+ {
+ return( mMocKind == MOC_SIMPLE_KIND );
+ }
+
+ inline bool isMocSimpleOrElse() const
+ {
+ return( (mMocKind == MOC_ELSE_KIND)
+ || (mMocKind == MOC_SIMPLE_ELSE_KIND) );
+ }
+
+
+ inline bool hasMocAbort() const
+ {
+ return( mMocKind & MOC_ABORT_KIND );
+ }
+
+ inline bool isMocAbort() const
+ {
+ return( mMocKind == MOC_ABORT_KIND );
+ }
+
+ inline bool isMocAbortElse() const
+ {
+ return( mMocKind == MOC_ABORT_ELSE_KIND );
+ }
+
+
+ inline bool hasMocFinal() const
+ {
+ return( mMocKind & MOC_FINAL_KIND );
+ }
+
+ inline bool isMocFinal() const
+ {
+ return( mMocKind == MOC_FINAL_KIND );
+ }
+
+ inline bool isMocFinalElse() const
+ {
+ return( mMocKind == MOC_FINAL_ELSE_KIND );
+ }
+
+
+ inline bool hasMocElse() const
+ {
+ return( mMocKind & MOC_ELSE_KIND );
+ }
+
+ inline bool isMocElse() const
+ {
+ return( mMocKind == MOC_ELSE_KIND );
+ }
+
+
+ inline bool isMocInternal() const
+ {
+ return( mMocKind == MOC_INTERNAL_KIND );
+ }
+
+ inline bool isMocAuto() const
+ {
+ return( mMocKind == MOC_AUTO_KIND );
+ }
+
+ inline bool isMocFlow() const
+ {
+ return( mMocKind == MOC_AUTO_KIND );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mPriority
+ */
+ inline int getPriority() const
+ {
+ return( mPriority );
+ }
+
+ inline void setPriority(int aPriority)
+ {
+ mPriority = aPriority;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mProbability
+ */
+ inline float getProbability() const
+ {
+ return( mProbability );
+ }
+
+ inline void setProbability(float aProbability)
+ {
+ mProbability = aProbability;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mTokenCount
+ */
+ inline int getTokenCount() const
+ {
+ return( mTokenCount );
+ }
+
+ inline void setTokenCount(int aTokenCount)
+ {
+ mTokenCount = aTokenCount;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mSource
+ */
+ inline Machine * getSource() const
+ {
+ return( mSource );
+ }
+
+ inline void setSource(Machine * aSource)
+ {
+ mSource = aSource;
+ }
+
+ Machine * getSourceContainer() const;
+
+
+ /**
+ * GETTER - SETTER
+ * mTarget
+ */
+ inline BF & getTarget()
+ {
+ return( mTarget );
+ }
+
+ inline const BF & getTarget() const
+ {
+ return( mTarget );
+ }
+
+ inline bool hasTarget() const
+ {
+ return( mTarget.valid() );
+ }
+
+ inline void setTarget(const BF & aTarget)
+ {
+ mTarget = aTarget;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mDeclaration
+ */
+ inline PropertyPart * getDeclaration() const
+ {
+ return( mDeclaration );
+ }
+
+ bool hasDeclaration() const;
+
+ inline void setDeclaration(PropertyPart * aDeclaration)
+ {
+ mDeclaration = aDeclaration;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mStatement
+ */
+ inline const BFCode & getStatement() const
+ {
+ return( mStatement );
+ }
+
+ inline bool hasStatement() const
+ {
+ return( mStatement.valid() );
+ }
+
+ inline void setStatement(const BFCode & aStatement)
+ {
+ mStatement = aStatement;
+ }
+
+
+ /**
+ * Serialization
+ */
+ static MOC_KIND toMocKind(const std::string & id);
+
+ std::string strMocKind(
+ moc_kind_t mask = MOC_MASK_ALL_KIND,
+ const std::string & SEPARATOR = "%") const;
+
+
+ virtual void strHeader(OutStream & os) const;
+
+
+ inline std::string strTransitionHeader() const
+ {
+ StringOutStream oss;
+
+ toStreamHeader( oss );
+
+ return( oss.str() );
+ }
+
+ void toStreamHeader(OutStream & os) const;
+
+
+ virtual void toStream(OutStream & os) const;
+
+};
+
+
+}
+
+#endif /* TRANSITION_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/TransitionMoc.cpp b/org.eclipse.efm.symbex/src/fml/infrastructure/TransitionMoc.cpp
new file mode 100644
index 0000000..d89e2ae
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/TransitionMoc.cpp
@@ -0,0 +1,266 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 sept. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "TransitionMoc.h"
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <fml/operator/Operator.h>
+#include <fml/operator/OperatorManager.h>
+
+#include <printer/OutStream.h>
+
+
+namespace sep
+{
+
+
+/**
+ *******************************************************************************
+ * MODEL OF COMPILATION
+ *******************************************************************************
+ *
+prototype spec::system.statemachine.mos4transition "mos4transition" as &meta::xlia.moc.Transition is
+section PRIORITY
+ @user = |>|;
+
+ @lca = |>|;
+ @source = |>|;
+ @target = |>|;
+endsection PRIORITY
+section MOE
+ @run{
+ ${ |;|
+ ${ disable }
+ ${ run }
+ ${ enable }
+ }
+ }
+endsection MOE
+endprototype
+*/
+
+
+void TransitionMoc::setFlags(WObject * moc)
+{
+//!![MIGRATION]
+// WObject * thePRIORITY = Query::getRegexWSequence(moc,
+// OR_WID2("priority", "PRIORITY"));
+//
+// if( thePRIORITY != WObject::_NULL_ )
+// {
+// WObject * aWProperty =
+// Query::getWProperty(thePRIORITY, "priority", WObject::_NULL_);
+// if( aWProperty == WObject::_NULL_ )
+// {
+// aWProperty = Query::getWProperty(
+// thePRIORITY, "user", WObject::_NULL_);
+// }
+//
+// // DEFAULT
+// theUserPriorityEnabledFlag = false;
+// if( aWProperty != WObject::_NULL_ )
+// {
+// theUserPriorityEnabledFlag = true;
+//
+// // DEFAULT
+// theUserPriorityMinFirstFlag = true;
+// if( aWProperty->getValue().is< Operator >() )
+// {
+// theUserPriorityMinFirstFlag = ( aWProperty->getOperatorValue() ==
+// OperatorManager::OPERATOR_PRIOR_LT );
+// }
+// }
+//
+//
+// aWProperty = Query::getWProperty(thePRIORITY, "lca", NULL);
+//
+// // DEFAULT
+// theLcaEnabledFlag = false;
+// if( aWProperty != NULL )
+// {
+// theLcaEnabledFlag = true;
+//
+// // DEFAULT
+// theLcaMinFirstFlag = true;
+// if( aWProperty->getValue().is< Operator >() )
+// {
+// theLcaMinFirstFlag = ( aWProperty->getOperatorValue() ==
+// OperatorManager::OPERATOR_PRIOR_LT );
+// }
+// }
+//
+//
+// aWProperty = Query::getWProperty( thePRIORITY, "source", NULL);
+//
+// // DEFAULT
+// theSourceEnabledFlag = false;
+// if( aWProperty != NULL )
+// {
+// theSourceEnabledFlag = true;
+//
+// // DEFAULT
+// theSourceMinFirstFlag = true;
+// if( aWProperty->getValue().is< Operator >() )
+// {
+// theSourceMinFirstFlag = ( aWProperty->getOperatorValue() ==
+// OperatorManager::OPERATOR_PRIOR_LT );
+// }
+// }
+//
+//
+// aWProperty = Query::getWProperty(thePRIORITY, "target", NULL);
+//
+// // DEFAULT
+// theTargetEnabledFlag = false;
+// if( aWProperty != NULL )
+// {
+// theTargetEnabledFlag = true;
+//
+// // DEFAULT
+// theTargetMinFirstFlag = true;
+// if( aWProperty->getValue().is< Operator >() )
+// {
+// theTargetMinFirstFlag = ( aWProperty->getOperatorValue() ==
+// OperatorManager::OPERATOR_PRIOR_LT );
+// }
+// }
+//
+//
+// WObject * theMOE = Query::getRegexWSequence(moc, OR_WID2("moe", "MOE"));
+//
+// if( theMOE != WObject::_NULL_ )
+// {
+// // DEFAULT
+// theMoeRun = MOE_DRE_RUN;
+//
+// const BFCode & moeRun = Query::getWPropertyAvmCode(theMOE, "run");
+// if( moeRun.valid() && (moeRun->size() == 3) )
+// {
+// if( (moeRun->first().is< Operator >() && moeRun->first().
+// to_ptr< Operator >()->isOpCode( AVM_OPCODE_RUN )) ||
+// (moeRun->first().is< AvmCode >() && moeRun->first().
+// to_ptr< AvmCode >()->isOpCode( AVM_OPCODE_RUN )) )
+// {
+// theMoeRun = MOE_RDE_RUN;
+// }
+// if( (moeRun->second().is< Operator >() && moeRun->second().
+// to_ptr< Operator >()->isOpCode( AVM_OPCODE_RUN )) ||
+// (moeRun->second().is< AvmCode >() && moeRun->second().
+// to_ptr< AvmCode >()->isOpCode( AVM_OPCODE_RUN )) )
+// {
+// theMoeRun = MOE_DRE_RUN;
+// }
+// if( (moeRun->third().is< Operator >() && moeRun->third().
+// to_ptr< Operator >()->isOpCode( AVM_OPCODE_RUN )) ||
+// (moeRun->third().is< AvmCode >() && moeRun->third().
+// to_ptr< AvmCode >()->isOpCode( AVM_OPCODE_RUN )) )
+// {
+// theMoeRun = MOE_DER_RUN;
+// }
+// }
+// }
+// else
+// {
+// theMoeRun = MOE_UNDEFINED_RUN;
+// }
+// }
+}
+
+/**
+ * Serialization
+ */
+void TransitionMoc::toStream(OutStream & out) const
+{
+ out << TAB << "transition {" << EOL;
+
+ if( theUserPriorityEnabledFlag || theLcaEnabledFlag
+ || theSourceEnabledFlag || theTargetEnabledFlag )
+ {
+ out << TAB2 << "priority:" << EOL;
+ }
+
+ // User specific priority number
+ if( theUserPriorityEnabledFlag )
+ {
+ out << TAB3 << "user = "
+ << ((theUserPriorityMinFirstFlag)? "|<|" : "|>|") << ";" << EOL;
+ }
+
+ // Implicit formalism priority
+ if( theLcaEnabledFlag )
+ {
+ out << TAB3 << "lca = "
+ << ((theLcaMinFirstFlag)? "|<|" : "|>|") << ";" << EOL;
+ }
+ if( theSourceEnabledFlag )
+ {
+ out << TAB3 << "source = "
+ << ((theSourceMinFirstFlag)? "|<|" : "|>|") << ";" << EOL;
+ }
+ if( theTargetEnabledFlag )
+ {
+ out << TAB3 << "target = "
+ << ((theTargetMinFirstFlag)? "|<|" : "|>|") << ";" << EOL;
+ }
+
+ if( theMoeRun != MOE_UNDEFINED_RUN )
+ {
+ out << TAB2 << "moe:" << EOL
+ << TAB3 << "@run { " << EOL;
+
+ switch( theMoeRun )
+ {
+ case MOE_RDE_RUN:
+ {
+ out << "${ run } ${ disable } ${ enable }";
+ break;
+ }
+
+ case MOE_DRE_RUN:
+ {
+ out << "${ disable } ${ run } ${ enable }";
+ break;
+ }
+
+ case MOE_DER_RUN:
+ {
+ out << "${ disable } ${ enable } ${ run }";
+ break;
+ }
+
+ case MOE_UNDEFINED_RUN:
+ default:
+ {
+ //!!! NOTHING
+ break;
+ }
+ }
+
+ out << " }" << EOL;
+
+ }
+
+ out << TAB << "}" << EOL_FLUSH;
+}
+
+
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/TransitionMoc.h b/org.eclipse.efm.symbex/src/fml/infrastructure/TransitionMoc.h
new file mode 100644
index 0000000..ac12c06
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/TransitionMoc.h
@@ -0,0 +1,321 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 sept. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef TRANSITIONMOC_H_
+#define TRANSITIONMOC_H_
+
+
+namespace sep
+{
+
+
+class WObject;
+
+class OutStream;
+
+
+class TransitionMoc
+{
+
+public:
+ enum MOE_RUN_MOC
+ {
+ // RUN DISABLE ENABLE
+ MOE_UNDEFINED_RUN,
+
+ MOE_RDE_RUN,
+ MOE_DRE_RUN,
+ MOE_DER_RUN,
+ };
+
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TransitionMoc()
+ : theMoeRun( MOE_UNDEFINED_RUN ),
+
+ theUserPriorityEnabledFlag( false ),
+ theUserPriorityMinFirstFlag( true ),
+
+ theLcaEnabledFlag( false ),
+ theLcaMinFirstFlag( false ),
+
+ theSourceEnabledFlag( false ),
+ theSourceMinFirstFlag( false ),
+
+ theTargetEnabledFlag( false ),
+ theTargetMinFirstFlag( false )
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Others
+ */
+ TransitionMoc(MOE_RUN_MOC moeRun)
+ : theMoeRun( moeRun ),
+
+ theUserPriorityEnabledFlag( false ),
+ theUserPriorityMinFirstFlag( true ),
+
+ theLcaEnabledFlag( false ),
+ theLcaMinFirstFlag( false ),
+
+ theSourceEnabledFlag( false ),
+ theSourceMinFirstFlag( false ),
+
+ theTargetEnabledFlag( false ),
+ theTargetMinFirstFlag( false )
+ {
+ //!!! NOTHING
+ }
+
+ TransitionMoc(MOE_RUN_MOC moeRun, bool user)
+ : theMoeRun( moeRun ),
+
+ theUserPriorityEnabledFlag( true ),
+ theUserPriorityMinFirstFlag( user ),
+
+ theLcaEnabledFlag( false ),
+ theLcaMinFirstFlag( false ),
+
+ theSourceEnabledFlag( false ),
+ theSourceMinFirstFlag( false ),
+
+ theTargetEnabledFlag( false ),
+ theTargetMinFirstFlag( false )
+ {
+ //!!! NOTHING
+ }
+
+ TransitionMoc(MOE_RUN_MOC moeRun, bool user, bool lca)
+ : theMoeRun( moeRun ),
+
+ theUserPriorityEnabledFlag( true ),
+ theUserPriorityMinFirstFlag( user ),
+
+ theLcaEnabledFlag( true ),
+ theLcaMinFirstFlag( lca ),
+
+ theSourceEnabledFlag( false ),
+ theSourceMinFirstFlag( false ),
+
+ theTargetEnabledFlag( false ),
+ theTargetMinFirstFlag( false )
+ {
+ //!!! NOTHING
+ }
+
+ TransitionMoc(MOE_RUN_MOC moeRun, bool user, bool lca, bool source)
+ : theMoeRun( moeRun ),
+
+ theUserPriorityEnabledFlag( true ),
+ theUserPriorityMinFirstFlag( user ),
+
+ theLcaEnabledFlag( true ),
+ theLcaMinFirstFlag( lca ),
+
+ theSourceEnabledFlag( true ),
+ theSourceMinFirstFlag( source ),
+
+ theTargetEnabledFlag( false ),
+ theTargetMinFirstFlag( false )
+ {
+ //!!! NOTHING
+ }
+
+ TransitionMoc(MOE_RUN_MOC moeRun, bool user, bool lca, bool source, bool target)
+ : theMoeRun( moeRun ),
+
+ theUserPriorityEnabledFlag( true ),
+ theUserPriorityMinFirstFlag( user ),
+
+ theLcaEnabledFlag( true ),
+ theLcaMinFirstFlag( lca ),
+
+ theSourceEnabledFlag( true ),
+ theSourceMinFirstFlag( source ),
+
+ theTargetEnabledFlag( true ),
+ theTargetMinFirstFlag( target )
+ {
+ //!!! NOTHING
+ }
+
+
+ TransitionMoc(WObject * moc)
+ {
+ setFlags(moc);
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~TransitionMoc()
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * Set all flags using old FSP form
+ */
+ void setFlags(WObject * moc);
+
+
+ /**
+ * GETTER - SETTER
+ * theMoeRun
+ */
+ inline MOE_RUN_MOC getMoeRun() const
+ {
+ return( theMoeRun );
+ }
+
+ inline void setMoeRun(MOE_RUN_MOC aMocKind)
+ {
+ theMoeRun = aMocKind;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * theUserPriorityEnabledFlag
+ * theUserPriorityMinFirstFlag
+ */
+ inline bool isUserPriorityEnabled() const
+ {
+ return( theUserPriorityEnabledFlag );
+ }
+
+ inline bool isUserPriorityMinFirst() const
+ {
+ return( theUserPriorityMinFirstFlag );
+ }
+
+ inline void setUserPriorityMinFirst(bool minFirst)
+ {
+ theUserPriorityEnabledFlag = true;
+ theUserPriorityMinFirstFlag = minFirst;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * theLcaEnabledFlag
+ * theLcaMinFirstFlag
+ */
+ inline bool isLcaEnabled() const
+ {
+ return( theLcaEnabledFlag );
+ }
+
+ inline bool isLcaMinFirst() const
+ {
+ return( theLcaMinFirstFlag );
+ }
+
+ inline void setLcaMinFirst(bool minFirst)
+ {
+ theLcaEnabledFlag = true;
+ theLcaMinFirstFlag = minFirst;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * theSourceEnabledFlag
+ * theSourceMinFirstFlag
+ */
+ inline bool isSourceEnabled() const
+ {
+ return( theSourceEnabledFlag );
+ }
+
+ inline bool isSourceMinFirst() const
+ {
+ return( theSourceMinFirstFlag );
+ }
+
+ inline void setSourceMinFirst(bool minFirst)
+ {
+ theSourceEnabledFlag = true;
+ theSourceMinFirstFlag = minFirst;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * theTargetEnabledFlag
+ * theTargetMinFirstFlag
+ */
+ inline bool isTargetEnabled() const
+ {
+ return( theTargetEnabledFlag );
+ }
+
+ inline bool isTargetMinFirst() const
+ {
+ return( theTargetMinFirstFlag );
+ }
+
+ inline void setTargetMinFirst(bool minFirst)
+ {
+ theTargetEnabledFlag = true;
+ theTargetMinFirstFlag = minFirst;
+ }
+
+
+ /**
+ * Serialization
+ */
+ virtual void toStream(OutStream & out) const;
+
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+
+ // TRANSITION ACTIVITY SCHEDULER
+ MOE_RUN_MOC theMoeRun;
+
+
+ // MULTI TRANSITION SCHEDULING
+ // User specific priority number
+ bool theUserPriorityEnabledFlag;
+ bool theUserPriorityMinFirstFlag;
+
+ // Implicit formalism priority
+ bool theLcaEnabledFlag;
+ bool theLcaMinFirstFlag;
+
+ bool theSourceEnabledFlag;
+ bool theSourceMinFirstFlag;
+
+ bool theTargetEnabledFlag;
+ bool theTargetMinFirstFlag;
+
+
+};
+
+} /* namespace sep */
+#endif /* TRANSITIONMOC_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/Variable.cpp b/org.eclipse.efm.symbex/src/fml/infrastructure/Variable.cpp
new file mode 100644
index 0000000..e5efe53
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/Variable.cpp
@@ -0,0 +1,195 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 17 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "Variable.h"
+
+#include <fml/type/BaseTypeSpecifier.h>
+
+#include <fml/infrastructure/DataType.h>
+#include <fml/infrastructure/Machine.h>
+#include <fml/infrastructure/PropertyPart.h>
+
+#include <fml/operator/OperatorManager.h>
+
+
+namespace sep
+{
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+Variable::Variable(const PropertyPart & aPropertyPart,
+ const Modifier & aModifier, const BF & aType,
+ const std::string & aNameID, const BF & aValue)
+: PropertyElement( CLASS_KIND_T( Variable ),
+ aPropertyPart.getContainer(), aModifier, aNameID ),
+mType( aType ),
+mValue( aValue ),
+
+mBinding( ),
+
+onWriteRoutine( NULL )
+{
+ //!! NOTHING
+}
+
+
+Variable::Variable(Machine * aContainer, const Modifier & aModifier,
+ const Variable * aVariablePattern, const BF & aParam)
+: PropertyElement( CLASS_KIND_T( Variable ) ,
+ aContainer , aModifier , (*aVariablePattern) ),
+mType( aVariablePattern->getType() ),
+mValue( aParam ),
+
+mBinding( aVariablePattern->mBinding ),
+
+onWriteRoutine( aVariablePattern->onWriteRoutine )
+{
+ setModifier( aVariablePattern->getModifier() );
+}
+
+
+/**
+ * str Type
+ */
+std::string Variable::strT()
+{
+ if( getType().is< BaseTypeSpecifier >() )
+ {
+ return( getType().to_ptr< BaseTypeSpecifier >()->strT() );
+ }
+ else if( getType().is< DataType >() )
+ {
+ return( getType().to_ptr< DataType >()->strT() );
+ }
+ if( getType().is< ObjectElement >() )
+ {
+ return( getType().to_ptr< ObjectElement >()->getNameID() );
+ }
+ else
+ {
+ return( getType().str() );
+ }
+}
+
+
+/**
+ * UTIL
+ */
+Operator * Variable::getAssignOperator() const
+{
+ if( getModifier().hasNatureMacro() )
+ {
+ return( OperatorManager::OPERATOR_ASSIGN_MACRO );
+ }
+ else if( getModifier().hasNatureReference() )
+ {
+ return( OperatorManager::OPERATOR_ASSIGN_REF );
+ }
+
+ return( OperatorManager::OPERATOR_ASSIGN );
+}
+
+
+/**
+ * GETTER
+ * BehavioralPart Routine Container
+ */
+BehavioralPart * Variable::getContainerOfRoutines() const
+{
+ const ObjectElement * container = this->getContainer();
+ for( ; container != NULL ; container = container->getContainer() )
+ {
+ if( container->is< Machine >() )
+ {
+ return( container->to< Machine >()->getBehaviorPart() );
+ }
+ else if( container->is< DataType >() )
+ {
+ return( container->to< DataType >()->getBehaviorPart() );
+ }
+ }
+
+ return( NULL );
+}
+
+BehavioralPart * Variable::getUniqContainerOfRoutines() const
+{
+ ObjectElement * container = this->getContainer();
+ for( ; container != NULL ; container = container->getContainer() )
+ {
+ if( container->is< Machine >() )
+ {
+ return( container->to< Machine >()->getUniqBehaviorPart() );
+ }
+ else if( container->is< DataType >() )
+ {
+ return( container->to< DataType >()->getUniqBehaviorPart() );
+ }
+ }
+
+ return( NULL );
+}
+
+
+/**
+ * Serialization
+ */
+void Variable::toStream(OutStream & os) const
+{
+ os << TAB << getModifier().toString_not( Modifier::FEATURE_CONST_KIND )
+ << ( getModifier().hasFeatureConst() ? "const" /*"val"*/ : "var" )
+ << " " << strTypeSpecifier() << " " << getNameID();
+
+ if( mValue.valid() )
+ {
+// os << " " << getAssignOperator()->str() << " " << mValue.str();
+ os << " = " << mValue.str();
+ }
+
+ if( onWriteRoutine != NULL )
+ {
+ os << " { " << EOL_INCR_INDENT;
+
+ onWriteRoutine->toStream(os);
+
+ os << DECR_INDENT_TAB << "}";
+ }
+ else
+ {
+ os << ";";
+ }
+
+ os << EOL << std::flush;
+}
+
+
+void Variable::toStreamParameter(OutStream & os) const
+{
+ os << TAB << getModifier().toString()
+ << strTypeSpecifier() << " " << getNameID();
+
+ if( mValue.valid() )
+ {
+ os << " = " << mValue.str();
+ }
+
+ os << EOL_FLUSH;
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/infrastructure/Variable.h b/org.eclipse.efm.symbex/src/fml/infrastructure/Variable.h
new file mode 100644
index 0000000..4b45e87
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/infrastructure/Variable.h
@@ -0,0 +1,344 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 17 févr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef VARIABLE_H_
+#define VARIABLE_H_
+
+#include <fml/common/PropertyElement.h>
+
+#include <common/BF.h>
+
+#include <collection/BFContainer.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+
+#include <fml/infrastructure/DataType.h>
+#include <fml/infrastructure/Routine.h>
+
+#include <fml/executable/InstanceOfData.h>
+
+
+namespace sep
+{
+
+class BehavioralPart;
+
+class Machine;
+
+class ObjectElement;
+class Operator;
+
+class PropertyPart;
+
+
+class Variable : public PropertyElement ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( Variable )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( Variable )
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ BF mType;
+
+ BF mValue;
+
+ BF mBinding;
+
+ Routine * onWriteRoutine;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Variable(ObjectElement * aContainer, const BF & aType,
+ const std::string & aQualifiedNameID,
+ const std::string & aNameID, const BF & aValue = BF::REF_NULL)
+ : PropertyElement( CLASS_KIND_T( Variable ),
+ aContainer , aQualifiedNameID , aNameID , aNameID ),
+ mType( aType ),
+ mValue( ),
+
+ mBinding( ),
+
+ onWriteRoutine( NULL )
+ {
+ //!! NOTHING
+ }
+
+ Variable(ObjectElement * aContainer,
+ const Modifier & aModifier, const BF & aType,
+ const std::string & aNameID, const BF & aValue = BF::REF_NULL)
+ : PropertyElement(CLASS_KIND_T( Variable ), aContainer, aModifier, aNameID),
+ mType( aType ),
+ mValue( aValue ),
+
+ mBinding( ),
+
+ onWriteRoutine( NULL )
+ {
+ //!! NOTHING
+ }
+
+ Variable(const PropertyPart & aPropertyPart,
+ const Modifier & aModifier, const BF & aType,
+ const std::string & aNameID, const BF & aValue = BF::REF_NULL);
+
+ Variable(Machine * aContainer, const Modifier & aModifier,
+ const Variable * aVariablePattern, const BF & aParam);
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Variable()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER
+ * Qualified Name IDentifier
+ * QualifiedNameID using mFullyQualifiedNameID & mNameID
+ */
+ inline virtual std::string getQualifiedNameID() const
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM, DATA )
+
+ return( getFullyQualifiedNameID() );
+
+AVM_ELSE
+
+ return( PropertyElement::getQualifiedNameID() );
+
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM, DATA )
+ }
+
+
+ /**
+ * UTIL
+ */
+ Operator * getAssignOperator() const;
+
+
+ /**
+ * GETTER - SETTER
+ * the Type Specifier
+ */
+ inline const BF & getType() const
+ {
+ return( mType );
+ }
+
+ inline bool hasType() const
+ {
+ return( mType.valid() );
+ }
+
+ std::string strT();
+
+
+ inline DataType * getDataType() const
+ {
+ return( getType().as_ptr< DataType >() );
+ }
+
+ inline bool hasDataType()
+ {
+ return( getType().is< DataType >() );
+ }
+
+
+ inline BaseTypeSpecifier * getTypeSpecifier() const
+ {
+ return( getType().as_ptr< BaseTypeSpecifier >() );
+ }
+
+ inline bool hasTypeSpecifier()
+ {
+ return( getType().is< BaseTypeSpecifier >() );
+ }
+
+
+ inline std::string strTypeSpecifier() const
+ {
+ return( DataType::strTypeSpecifier( getType() ) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mValue
+ */
+ inline BF & getValue()
+ {
+ return( mValue );
+ }
+
+ inline const BF & getValue() const
+ {
+ return( mValue );
+ }
+
+ inline bool hasValue() const
+ {
+ return( mValue.valid() );
+ }
+
+ inline void setValue(const BF & aValue)
+ {
+ mValue = aValue;
+ }
+
+ inline std::string strValue() const
+ {
+ return( mValue.str() );
+ }
+
+ inline std::string prettyPrintableValue() const
+ {
+ return( mValue.is< ObjectElement >()
+ ? mValue.to_ptr< ObjectElement >()->getNameID()
+ : mValue.str() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mBinding
+ */
+ inline BF & getBinding()
+ {
+ return( mBinding );
+ }
+
+ inline const BF & getBinding() const
+ {
+ return( mBinding );
+ }
+
+ inline bool hasBinding() const
+ {
+ return( mBinding.valid() );
+ }
+
+ inline void setBinding(const BF & aBinding)
+ {
+ mBinding = aBinding;
+ }
+
+
+ /**
+ * GETTER
+ * BehavioralPart Routine Container
+ */
+ BehavioralPart * getContainerOfRoutines() const;
+
+ BehavioralPart * getUniqContainerOfRoutines() const;
+
+ /**
+ * GETTER - SETTER
+ * onWrite
+ */
+ inline Routine * getOnWriteRoutine() const
+ {
+ return( onWriteRoutine );
+ }
+
+ inline bool hasOnWrite() const
+ {
+ return( onWriteRoutine != NULL );
+ }
+
+ inline void setOnWriteRoutine(Routine * aWriteRoutine)
+ {
+ onWriteRoutine = aWriteRoutine;
+ }
+
+
+ /**
+ * Serialization
+ */
+ void strParameter(OutStream & os) const
+ {
+ os << getModifier().toString_not(Modifier::NATURE_PARAMETER_KIND) //<< "var "
+ << strTypeSpecifier() << " " << getNameID();
+
+ if( getModifier().hasNatureMacro() && hasBinding() )
+ {
+ os << " (::= " << getBinding().str() << ")";
+ }
+ if( hasValue() )
+ {
+ os << " = " << strValue();
+ }
+ }
+
+ void strReturn(OutStream & os) const
+ {
+ os << getModifier().toString_not(Modifier::DIRECTION_RETURN_KIND) //<< "var "
+ << strTypeSpecifier() << " " << getNameID();
+
+ if( getModifier().hasNatureMacro() && hasBinding() )
+ {
+ os << " (::= " << getBinding().str() << ")";
+ }
+ if( hasValue() )
+ {
+ os << " = " << strValue();
+ }
+ }
+
+
+ void strHeader(OutStream & os) const
+ {
+ os << getModifier().toString() << "var "
+ << strTypeSpecifier() << " " << getFullyQualifiedNameID();
+
+ if( hasBinding() )
+ {
+ os << " $bind " << getBinding().str();
+ }
+
+AVM_IF_DEBUG_FLAG2_AND( COMPILING , QUALIFIED_NAME_ID , hasValue() )
+ os << " = " << strValue();
+AVM_ENDIF_DEBUG_FLAG2_AND( COMPILING , QUALIFIED_NAME_ID )
+ }
+
+ void toStream(OutStream & os) const;
+
+ void toStreamParameter(OutStream & os) const;
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// TYPE DEFINITION for SMART POINTER and CONTAINER
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+typedef TableOfBF_T< Variable > TableOfVariable;
+
+
+}
+
+#endif /* VARIABLE_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/lib/AvmAnalysis.cpp b/org.eclipse.efm.symbex/src/fml/lib/AvmAnalysis.cpp
new file mode 100644
index 0000000..5399b28
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/lib/AvmAnalysis.cpp
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 25 juil. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmAnalysis.h"
+
+namespace sep
+{
+
+
+std::string STATIC_ANALYSIS::to_string(
+ STATIC_ANALYSIS::VARIABLE_DEPENDENCY_RING status)
+{
+ switch ( status )
+ {
+ case DEPENDENT : return( "dependent" );
+
+ case INDEPENDENT : return( "independent" );
+
+
+ case UNDEFINED_DEPENDENCY : return( "undefined<dependency>" );
+
+ case UNKNOWN_DEPENDENCY :
+ default : return( "unknown<dependency>" );
+ }
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/lib/AvmAnalysis.h b/org.eclipse.efm.symbex/src/fml/lib/AvmAnalysis.h
new file mode 100644
index 0000000..e71626d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/lib/AvmAnalysis.h
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 25 juil. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMANALYSIS_H_
+#define AVMANALYSIS_H_
+
+#include <string>
+
+
+namespace sep
+{
+
+
+class STATIC_ANALYSIS
+{
+
+public:
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // VARIABLE_DEPENDENCY
+ ////////////////////////////////////////////////////////////////////////////////
+
+ enum VARIABLE_DEPENDENCY_RING {
+ UNDEFINED_DEPENDENCY,
+
+ DEPENDENT,
+
+ INDEPENDENT,
+
+ UNKNOWN_DEPENDENCY
+ };
+
+ static std::string to_string(VARIABLE_DEPENDENCY_RING status);
+
+
+};
+
+
+} /* namespace sep */
+#endif /* AVMANALYSIS_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/lib/AvmLang.cpp b/org.eclipse.efm.symbex/src/fml/lib/AvmLang.cpp
new file mode 100644
index 0000000..615cabe
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/lib/AvmLang.cpp
@@ -0,0 +1,146 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 2 avr. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmLang.h"
+
+#include <fml/expression/ExpressionConstructor.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// GENERIC XLIA SYNTAX
+////////////////////////////////////////////////////////////////////////////////
+
+BF XLIA_SYNTAX::ID_ALL = ExpressionConstructor::newIdentifier( "[*]" );
+
+
+////////////////////////////////////////////////////////////////////////////////
+// LOADER / DISPOSER API
+////////////////////////////////////////////////////////////////////////////////
+
+void XLIA_SYNTAX::load()
+{
+ //!! NOTHING
+}
+
+
+void XLIA_SYNTAX::dispose()
+{
+ ID_ALL.destroy();
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// VARIABLE DATA
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * COMMUNICATION PROTOCOL KIND TO STRING
+ */
+
+#define PRINT_POINTER_NATURE( OBJ ) \
+ case IPointerDataNature::POINTER_##OBJ##_NATURE : \
+ return( QUOTEME( POINTER_##OBJ ) )
+
+std::string IPointerDataNature::strPointerDataNature(
+ IPointerDataNature::POINTER_DATA_NATURE aNature)
+{
+ switch ( aNature )
+ {
+ PRINT_POINTER_NATURE( STANDARD );
+
+ PRINT_POINTER_NATURE( FIELD_ARRAY_INDEX );
+ PRINT_POINTER_NATURE( FIELD_ARRAY_OFFSET );
+ PRINT_POINTER_NATURE( FIELD_CLASS_ATTRIBUTE );
+ PRINT_POINTER_NATURE( FIELD_UNION_ATTRIBUTE );
+
+ PRINT_POINTER_NATURE( ENUM_SYMBOL );
+
+ PRINT_POINTER_NATURE( UFI_OFFSET );
+ PRINT_POINTER_NATURE( UFI_MIXED );
+
+ PRINT_POINTER_NATURE( UFI_RUNTIME );
+
+ PRINT_POINTER_NATURE( UNDEFINED );
+
+ default : return( "POINTER_UNKNOWN_NATURE" );
+ }
+}
+
+std::string IPointerDataNature::strPointer(const POINTER_DATA_NATURE aNature)
+{
+ switch ( aNature )
+ {
+ case IPointerDataNature::POINTER_STANDARD_NATURE:
+ {
+ return( "std" );
+ }
+
+ case IPointerDataNature::POINTER_FIELD_ARRAY_INDEX_NATURE:
+ {
+ return( "index#symbex" );
+ }
+ case IPointerDataNature::POINTER_FIELD_ARRAY_OFFSET_NATURE:
+ {
+ return( "index#offset" );
+ }
+ case IPointerDataNature::POINTER_FIELD_CLASS_ATTRIBUTE_NATURE:
+ {
+ return( "attr" );
+ }
+ case IPointerDataNature::POINTER_FIELD_CHOICE_ATTRIBUTE_NATURE:
+ {
+ return( "choice" );
+ }
+ case IPointerDataNature::POINTER_FIELD_UNION_ATTRIBUTE_NATURE:
+ {
+ return( "union" );
+ }
+ case IPointerDataNature::POINTER_ENUM_SYMBOL_NATURE:
+ {
+ return( "enum" );
+ }
+
+ case IPointerDataNature::POINTER_UFI_OFFSET_NATURE:
+ {
+ return( "ufi" );
+ }
+ case IPointerDataNature::POINTER_UFI_MIXED_NATURE:
+ {
+ return( "mix" );
+ }
+
+ case IPointerDataNature::POINTER_UFI_RUNTIME_NATURE:
+ {
+ return( "runtime" );
+ }
+
+ case IPointerDataNature::POINTER_UNDEFINED_NATURE:
+ {
+ return( "undef" );
+ }
+
+ default :
+ {
+ return( strPointerDataNature(aNature) );
+ }
+ }
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/lib/AvmLang.h b/org.eclipse.efm.symbex/src/fml/lib/AvmLang.h
new file mode 100644
index 0000000..5ffe39f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/lib/AvmLang.h
@@ -0,0 +1,194 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 2 avr. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMLANG_H_
+#define AVMLANG_H_
+
+#include <string>
+
+#include <util/avm_numeric.h>
+#include <common/BF.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// GENERIC XLIA SYNTAX
+////////////////////////////////////////////////////////////////////////////////
+
+class XLIA_SYNTAX
+{
+
+public:
+ ////////////////////////////////////////////////////////////////////////////
+ // LOADER / DISPOSER API
+ ////////////////////////////////////////////////////////////////////////////
+ static void load();
+ static void dispose();
+
+public:
+ static BF ID_ALL;
+};
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// EXPRESSION IMPLEMENTATION KIND
+////////////////////////////////////////////////////////////////////////////////
+
+class EXPRESSION
+{
+
+public:
+
+ enum IMPLEMENTATION_KIND
+ {
+ NATIVE_IMPL,
+
+ GINAC_IMPL,
+
+ CVC4_IMPL,
+
+ UNDEFINED_IMPL
+ };
+
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// VARIABLE DATA
+////////////////////////////////////////////////////////////////////////////////
+
+class IPointerDataNature
+{
+
+public:
+
+ enum POINTER_DATA_NATURE
+ {
+ POINTER_STANDARD_NATURE,
+
+ POINTER_UFI_OFFSET_NATURE,
+
+ POINTER_UFI_MIXED_NATURE,
+
+ POINTER_UFI_RUNTIME_NATURE,
+
+ POINTER_ENUM_SYMBOL_NATURE,
+
+ POINTER_FIELD_ARRAY_INDEX_NATURE,
+ POINTER_FIELD_ARRAY_OFFSET_NATURE,
+
+ POINTER_FIELD_CLASS_ATTRIBUTE_NATURE,
+
+ POINTER_FIELD_CHOICE_ATTRIBUTE_NATURE,
+
+ POINTER_FIELD_UNION_ATTRIBUTE_NATURE,
+
+ POINTER_UNDEFINED_NATURE
+ };
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~IPointerDataNature()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * STATIC
+ */
+ static std::string strPointerDataNature(POINTER_DATA_NATURE aNature);
+
+ static std::string strPointer(const POINTER_DATA_NATURE aNature);
+
+
+ /**
+ * API
+ */
+ virtual POINTER_DATA_NATURE getPointerNature() const = 0;
+
+
+ inline bool hasArrayIndexPointer() const
+ {
+ return( (getPointerNature() == POINTER_FIELD_ARRAY_INDEX_NATURE) ||
+ (getPointerNature() == POINTER_UFI_MIXED_NATURE) );
+ }
+
+ inline bool isFieldArrayIndexPointer() const
+ {
+ return( getPointerNature() == POINTER_FIELD_ARRAY_INDEX_NATURE );
+ }
+
+ inline bool isFieldArrayOffsetPointer() const
+ {
+ return( getPointerNature() == POINTER_FIELD_ARRAY_OFFSET_NATURE );
+ }
+
+
+ inline bool isFieldClassAttributePointer() const
+ {
+ return( getPointerNature() == POINTER_FIELD_CLASS_ATTRIBUTE_NATURE );
+ }
+
+ inline bool isFieldChoiceAttributePointer() const
+ {
+ return( getPointerNature() == POINTER_FIELD_CHOICE_ATTRIBUTE_NATURE );
+ }
+
+ inline bool isFieldUnionAttributePointer() const
+ {
+ return( getPointerNature() == POINTER_FIELD_UNION_ATTRIBUTE_NATURE );
+ }
+
+
+ inline bool isEnumSymbolPointer() const
+ {
+ return( getPointerNature() == POINTER_ENUM_SYMBOL_NATURE );
+ }
+
+
+ inline bool isUfiOffsetPointer() const
+ {
+ return( getPointerNature() == POINTER_UFI_OFFSET_NATURE );
+ }
+
+ inline bool isUfiMixedPointer() const
+ {
+ return( getPointerNature() == POINTER_UFI_MIXED_NATURE );
+ }
+
+ inline bool isUfiRuntimePointer() const
+ {
+ return( getPointerNature() == POINTER_UFI_RUNTIME_NATURE );
+ }
+
+ inline bool isStandardPointer() const
+ {
+ return( getPointerNature() == POINTER_STANDARD_NATURE );
+ }
+
+
+};
+
+
+
+} /* namespace sep */
+#endif /* AVMLANG_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/lib/AvmOperationExpression.cpp b/org.eclipse.efm.symbex/src/fml/lib/AvmOperationExpression.cpp
new file mode 100644
index 0000000..97d7dc7
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/lib/AvmOperationExpression.cpp
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 27 nov. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmOperationExpression.h"
+
+#include <fml/executable/BaseInstanceForm.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/infrastructure/Variable.h>
+
+
+namespace sep
+{
+
+
+std::map< std::string , Operator * > AvmOperationExpression::theOtherMap;
+
+
+
+
+/**
+ * LOADER
+ */
+void AvmOperationExpression::load()
+{
+ putOther("random" , OperatorManager::OPERATOR_RANDOM);
+
+ putOther("abs" , OperatorManager::OPERATOR_ABS);
+
+ putOther("ceil" , OperatorManager::OPERATOR_CEIL);
+ putOther("floor" , OperatorManager::OPERATOR_FLOOR);
+ putOther("round" , OperatorManager::OPERATOR_ROUND);
+ putOther("trunc" , OperatorManager::OPERATOR_TRUNCATE);
+
+ // EXP - LOG
+ putOther("sqrt" , OperatorManager::OPERATOR_SQRT);
+
+ putOther("exp" , OperatorManager::OPERATOR_EXP);
+ putOther("ln" , OperatorManager::OPERATOR_LN);
+ putOther("log" , OperatorManager::OPERATOR_LOG);
+
+ // TRIGONOMETRIC
+ putOther("sin" , OperatorManager::OPERATOR_SIN);
+ putOther("cos" , OperatorManager::OPERATOR_COS);
+ putOther("tan" , OperatorManager::OPERATOR_TAN);
+
+ putOther("sinh" , OperatorManager::OPERATOR_SINH);
+ putOther("cosh" , OperatorManager::OPERATOR_COSH);
+ putOther("tanh" , OperatorManager::OPERATOR_TANH);
+
+ putOther("asin" , OperatorManager::OPERATOR_ASIN);
+ putOther("acos" , OperatorManager::OPERATOR_ACOS);
+ putOther("atan" , OperatorManager::OPERATOR_ATAN);
+ putOther("atan2" , OperatorManager::OPERATOR_ATAN2);
+
+ putOther("asinh" , OperatorManager::OPERATOR_ASINH);
+ putOther("acosh" , OperatorManager::OPERATOR_ACOSH);
+ putOther("atanh" , OperatorManager::OPERATOR_ATANH);
+}
+
+
+/**
+ * DISPOSER
+ */
+void AvmOperationExpression::dispose()
+{
+ theOtherMap.clear();
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/lib/AvmOperationExpression.h b/org.eclipse.efm.symbex/src/fml/lib/AvmOperationExpression.h
new file mode 100644
index 0000000..fff4777
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/lib/AvmOperationExpression.h
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 27 nov. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMOPERATIONEXPRESSION_H_
+#define AVMOPERATIONEXPRESSION_H_
+
+#include <map>
+
+#include <fml/operator/Operator.h>
+
+
+namespace sep
+{
+
+
+class BF;
+
+
+class AvmOperationExpression
+{
+
+public:
+ /**
+ * LOADER - DISPOSER
+ */
+ static void load();
+ static void dispose();
+
+
+ /**
+ * GETTER - SETTER
+ * theOtherMap
+ */
+ static std::map< std::string , Operator * > theOtherMap;
+
+ inline static Operator * getOther(const std::string & method)
+ {
+ return( theOtherMap[ method ] );
+ }
+
+ inline static bool isOther(const std::string & method)
+ {
+ return( theOtherMap.find( method ) != theOtherMap.end() );
+ }
+
+ inline static void putOther(const std::string & method, Operator * anOperator)
+ {
+ theOtherMap[ method ] = anOperator;
+ }
+
+
+
+ /**
+ * GETTER - SETTER
+ */
+ inline static Operator * get(const std::string & method)
+ {
+ return( getOther(method) );
+ }
+
+ inline static Operator * get(const BF & aReceiver, const std::string & method)
+ {
+ return( get(method) );
+ }
+
+ inline static bool exist(const std::string & method)
+ {
+ return( isOther(method) );
+ }
+
+ inline static bool exist(const std::string & method, Operator * anOperator)
+ {
+ return( anOperator == getOther(method) );
+ }
+
+
+ inline static void put(const std::string & method, Operator * anOperator)
+ {
+ putOther(method, anOperator);
+ }
+
+
+};
+
+
+
+} /* namespace sep */
+#endif /* AVMOPERATIONEXPRESSION_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/lib/AvmOperationFactory.cpp b/org.eclipse.efm.symbex/src/fml/lib/AvmOperationFactory.cpp
new file mode 100644
index 0000000..6689a3c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/lib/AvmOperationFactory.cpp
@@ -0,0 +1,244 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 5 avr. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmOperationFactory.h"
+
+#include <fml/executable/BaseInstanceForm.h>
+#include <fml/executable/InstanceOfData.h>
+#include <fml/executable/InstanceOfMachine.h>
+
+#include <fml/expression/BuiltinContainer.h>
+
+#include <fml/lib/AvmOperationExpression.h>
+#include <fml/lib/AvmOperationMachine.h>
+#include <fml/lib/AvmOperationVariable.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/runtime/RuntimeID.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+
+#include <fml/infrastructure/Machine.h>
+#include <fml/infrastructure/Variable.h>
+
+
+namespace sep
+{
+
+
+std::map< std::string , Operator * > AvmOperationFactory::theGlobalMap;
+
+
+/**
+ * LOADER
+ */
+void AvmOperationFactory::load()
+{
+ AvmOperationExpression::load();
+
+ AvmOperationMachine::load();
+
+ AvmOperationVariable::load();
+}
+
+
+/**
+ * DISPOSER
+ */
+void AvmOperationFactory::dispose()
+{
+ AvmOperationVariable::dispose();
+
+ AvmOperationMachine::dispose();
+
+ AvmOperationExpression::dispose();
+
+ theGlobalMap.clear();
+}
+
+
+
+/**
+ * GETTER - SETTER
+ */
+Operator * AvmOperationFactory::get(const std::string & method)
+{
+ Operator * op = NULL;
+
+ if( (op = getGlobal(method)) != NULL )
+ {
+ return( op );
+ }
+
+ if( (op = AvmOperationVariable::get(method)) != NULL )
+ {
+ return( op );
+ }
+
+ if( (op = AvmOperationMachine::get(method)) != NULL )
+ {
+ return( op );
+ }
+
+ return( AvmOperationExpression::get(method) );
+}
+
+
+Operator * AvmOperationFactory::get(const BF & aReceiver,
+ const std::string & method)
+{
+ if( aReceiver.is< BaseInstanceForm >() )
+ {
+ return( get(aReceiver.to_ptr< BaseInstanceForm >(), method) );
+ }
+ else if( aReceiver.is< Machine >() ||
+ aReceiver.is< InstanceOfMachine >() ||
+ aReceiver.is< RuntimeID >() )
+ {
+ return( AvmOperationMachine::get(method) );
+ }
+
+ else if( aReceiver.is< Variable >() )
+ {
+ Variable * aVar = aReceiver.to_ptr< Variable >();
+
+ if( aVar->hasTypeSpecifier() )
+ {
+ BaseTypeSpecifier * varTS = aVar->getTypeSpecifier();
+ if( varTS->isTypedMachine() )
+ {
+ Operator * opVar = AvmOperationMachine::get(method);
+ if( opVar != NULL )
+ {
+ return( opVar );
+ }
+ }
+
+ Operator * opVar = AvmOperationVariable::get(varTS, method);
+ if( opVar != NULL )
+ {
+ return( opVar );
+ }
+ }
+ }
+
+ else if( aReceiver.is< InstanceOfData >() )
+ {
+ InstanceOfData * aData = aReceiver.to_ptr< InstanceOfData >();
+
+ if( aData->hasTypeSpecifier() )
+ {
+ BaseTypeSpecifier * varTS = aData->getTypeSpecifier();
+ if( varTS->isTypedMachine() )
+ {
+ return( AvmOperationMachine::get(method) );
+ }
+ else
+ {
+ Operator * opVar = AvmOperationVariable::get(varTS, method);
+ if( opVar != NULL )
+ {
+ return( opVar );
+ }
+ }
+ }
+ }
+
+ else if( aReceiver.is< BuiltinCollection >() ||
+ aReceiver.is< String >() )
+ {
+ return( AvmOperationVariable::get(method) );
+ }
+ else
+ {
+ Operator * opExpr = AvmOperationExpression::get(aReceiver, method);
+ if( opExpr != NULL )
+ {
+ return( opExpr );
+ }
+ }
+
+ return( get(method) );
+}
+
+Operator * AvmOperationFactory::get(
+ BaseInstanceForm * anInstance, const std::string & method)
+{
+ if( anInstance->isTypedMachine() || anInstance->is< InstanceOfMachine >() )
+ {
+ return( AvmOperationMachine::get(anInstance, method) );
+ }
+ else
+ {
+ Operator * opVar = AvmOperationVariable::get(anInstance, method);
+ if( opVar != NULL )
+ {
+ return( opVar );
+ }
+
+ return( getGlobal(method) );
+ }
+}
+
+
+
+bool AvmOperationFactory::exist(const std::string & method)
+{
+ return( isGlobal(method) ||
+ AvmOperationVariable::exist(method) ||
+ AvmOperationMachine::exist(method) ||
+ AvmOperationExpression::exist(method) );
+}
+
+
+bool AvmOperationFactory::exist(BaseInstanceForm * anInstance,
+ const std::string & method)
+{
+ return( AvmOperationVariable::exist(anInstance, method) ||
+ AvmOperationMachine::exist(anInstance, method) ||
+ isGlobal(method) );
+}
+
+
+bool AvmOperationFactory::exist(const std::string & method, Operator * anOperator)
+{
+ return( (anOperator == getGlobal(method)) ||
+ AvmOperationVariable::exist(method, anOperator) ||
+ AvmOperationMachine::exist(method, anOperator) ||
+ AvmOperationExpression::exist(method, anOperator) );
+}
+
+
+
+void AvmOperationFactory::put(const std::string & method, Operator * anOperator)
+{
+ if( exist(method, anOperator) )
+ {
+ return;
+ }
+ putGlobal(method, anOperator);
+}
+
+
+void AvmOperationFactory::put(BaseInstanceForm * anInstance,
+ const std::string & method, Operator * anOperator)
+{
+ putGlobal(method, anOperator);
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/lib/AvmOperationFactory.h b/org.eclipse.efm.symbex/src/fml/lib/AvmOperationFactory.h
new file mode 100644
index 0000000..8695a2f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/lib/AvmOperationFactory.h
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 5 avr. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMOPERATIONFACTORY_H_
+#define AVMOPERATIONFACTORY_H_
+
+#include <map>
+
+#include <fml/operator/Operator.h>
+
+
+namespace sep
+{
+
+
+class BF;
+class BaseInstanceForm;
+
+
+class AvmOperationFactory
+{
+
+
+public:
+ /**
+ * LOADER - DISPOSER
+ */
+ static void load();
+ static void dispose();
+
+
+ /**
+ * GETTER - SETTER
+ * theGlobalMap
+ */
+ static std::map< std::string , Operator * > theGlobalMap;
+
+ inline static Operator * getGlobal(const std::string & method)
+ {
+ return( theGlobalMap[ method ] );
+ }
+
+ inline static bool isGlobal(const std::string & method)
+ {
+ return( theGlobalMap.find( method ) != theGlobalMap.end() );
+ }
+
+ inline static void putGlobal(const std::string & method,
+ Operator * anOperator)
+ {
+ theGlobalMap[ method ] = anOperator;
+ }
+
+ inline static void resetGlobal(const std::string & method)
+ {
+ return( theGlobalMap.clear() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ */
+ static Operator * get(const std::string & method);
+
+ static Operator * get(const BF & aReceiver, const std::string & method);
+
+ static Operator * get(BaseInstanceForm * anInstance,
+ const std::string & method);
+
+
+ static bool exist(const std::string & method);
+
+ static bool exist(BaseInstanceForm * anInstance,
+ const std::string & method);
+
+ static bool exist(const std::string & method, Operator * anOperator);
+
+
+ static void put(const std::string & method, Operator * anOperator);
+
+ static void put(BaseInstanceForm * anInstance,
+ const std::string & method, Operator * anOperator);
+
+
+};
+
+
+
+} /* namespace sep */
+#endif /* AVMOPERATIONFACTORY_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/lib/AvmOperationMachine.cpp b/org.eclipse.efm.symbex/src/fml/lib/AvmOperationMachine.cpp
new file mode 100644
index 0000000..968e47b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/lib/AvmOperationMachine.cpp
@@ -0,0 +1,153 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 3 avr. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmOperationMachine.h"
+
+#include <fml/executable/BaseInstanceForm.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/infrastructure/Machine.h>
+
+
+namespace sep
+{
+
+
+std::map< std::string , Operator * > AvmOperationMachine::theActivityMap;
+
+std::map< std::string , Operator * > AvmOperationMachine::theStatusMap;
+
+std::map< std::string , Operator * > AvmOperationMachine::theOtherMap;
+
+
+
+/**
+ * LOADER
+ */
+void AvmOperationMachine::load()
+{
+ putActivity("init" , OperatorManager::OPERATOR_INIT);
+ putActivity("final" , OperatorManager::OPERATOR_FINAL);
+ putActivity("destroy" , OperatorManager::OPERATOR_DESTROY);
+
+ putActivity("start" , OperatorManager::OPERATOR_START);
+ putActivity("restart" , OperatorManager::OPERATOR_RESTART);
+ putActivity("stop" , OperatorManager::OPERATOR_STOP);
+
+
+ putActivity("ienable" , OperatorManager::OPERATOR_IENABLE_INVOKE);
+ putActivity("enable" , OperatorManager::OPERATOR_ENABLE_INVOKE);
+ putActivity("enable#set" , OperatorManager::OPERATOR_ENABLE_SET);
+
+
+ putActivity("idisable" , OperatorManager::OPERATOR_IDISABLE_INVOKE);
+ putActivity("disable" , OperatorManager::OPERATOR_DISABLE_INVOKE);
+ putActivity("disable#set" , OperatorManager::OPERATOR_DISABLE_SET);
+
+ putActivity("disable#child" , OperatorManager::OPERATOR_DISABLE_CHILD);
+ putActivity("disable#selves" , OperatorManager::OPERATOR_DISABLE_SELVES);
+
+
+ putActivity("iabort" , OperatorManager::OPERATOR_IABORT_INVOKE);
+ putActivity("abort" , OperatorManager::OPERATOR_ABORT_INVOKE);
+ putActivity("abort#set" , OperatorManager::OPERATOR_ABORT_SET);
+
+ putActivity("abort#child" , OperatorManager::OPERATOR_ABORT_CHILD);
+ putActivity("abort#selves" , OperatorManager::OPERATOR_ABORT_SELVES);
+
+
+ putActivity("irun" , OperatorManager::OPERATOR_IRUN);
+ putActivity("run" , OperatorManager::OPERATOR_RUN);
+ putActivity("rtc" , OperatorManager::OPERATOR_RTC);
+
+ putActivity("schedule" , OperatorManager::OPERATOR_SCHEDULE_INVOKE);
+ putActivity("schedule#run" , OperatorManager::OPERATOR_SCHEDULE_INVOKE);
+ putActivity("schedule#get" , OperatorManager::OPERATOR_SCHEDULE_GET);
+ putActivity("schedule#in" , OperatorManager::OPERATOR_SCHEDULE_IN);
+ putActivity("schedule#set" , OperatorManager::OPERATOR_SCHEDULE_SET);
+
+ putActivity("defer" , OperatorManager::OPERATOR_DEFER_INVOKE);
+ putActivity("defer#run" , OperatorManager::OPERATOR_DEFER_INVOKE);
+ putActivity("defer#get" , OperatorManager::OPERATOR_DEFER_GET);
+ putActivity("defer#set" , OperatorManager::OPERATOR_DEFER_SET);
+
+ putActivity("suspend" , OperatorManager::OPERATOR_SUSPEND);
+ putActivity("resume" , OperatorManager::OPERATOR_RESUME);
+ putActivity("wait" , OperatorManager::OPERATOR_WAIT);
+
+
+ putStatus("status_was" , OperatorManager::OPERATOR_STATUS_WAS);
+ putStatus("status_is" , OperatorManager::OPERATOR_STATUS_IS);
+ putStatus("status_being" , OperatorManager::OPERATOR_STATUS_BEING);
+ putStatus("status_will" , OperatorManager::OPERATOR_STATUS_WILL);
+
+ putStatus("changed" , OperatorManager::OPERATOR_CHANGED);
+ putStatus("changed_to" , OperatorManager::OPERATOR_CHANGED_TO);
+}
+
+
+/**
+ * DISPOSER
+ */
+void AvmOperationMachine::dispose()
+{
+ theActivityMap.clear();
+
+ theStatusMap.clear();
+
+ theOtherMap.clear();
+}
+
+
+
+/**
+ * GETTER - SETTER
+ */
+Operator * AvmOperationMachine::get(const std::string & method)
+{
+ Operator * op = NULL;
+
+ if( (op = getActivity(method)) != NULL )
+ {
+ return( op );
+ }
+
+ if( (op = getStatus(method)) != NULL )
+ {
+ return( op );
+ }
+
+ return( getOther(method) );
+}
+
+
+Operator * AvmOperationMachine::get(const BF & aReceiver,
+ const std::string & method)
+{
+ if( aReceiver.is_exactly< Machine >() )
+ {
+ return( get(aReceiver.to_ptr< Machine >(), method) );
+ }
+ else if( aReceiver.is< BaseInstanceForm >() )
+ {
+ return( get(aReceiver.to_ptr< BaseInstanceForm >(), method) );
+ }
+ return( get(method) );
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/lib/AvmOperationMachine.h b/org.eclipse.efm.symbex/src/fml/lib/AvmOperationMachine.h
new file mode 100644
index 0000000..a98508e
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/lib/AvmOperationMachine.h
@@ -0,0 +1,169 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 3 avr. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMOPERATIONMACHINE_H_
+#define AVMOPERATIONMACHINE_H_
+
+#include <map>
+
+#include <fml/operator/Operator.h>
+
+
+namespace sep
+{
+
+
+class BF;
+class BaseInstanceForm;
+class Machine;
+
+
+class AvmOperationMachine
+{
+
+public:
+ /**
+ * LOADER - DISPOSER
+ */
+ static void load();
+ static void dispose();
+
+
+
+ /**
+ * GETTER - SETTER
+ * theActivityMap
+ */
+ static std::map< std::string , Operator * > theActivityMap;
+
+ inline static Operator * getActivity(const std::string & method)
+ {
+ return( theActivityMap[ method ] );
+ }
+
+ inline static bool isActivity(const std::string & method)
+ {
+ return( theActivityMap.find( method ) != theActivityMap.end() );
+ }
+
+ inline static void putActivity(const std::string & method,
+ Operator * anOperator)
+ {
+ theActivityMap[ method ] = anOperator;
+ }
+
+
+
+ /**
+ * GETTER - SETTER
+ * theStatusMap
+ */
+ static std::map< std::string , Operator * > theStatusMap;
+
+ inline static Operator * getStatus(const std::string & method)
+ {
+ return( theStatusMap[ method ] );
+ }
+
+ inline static bool isStatus(const std::string & method)
+ {
+ return( theStatusMap.find( method ) != theStatusMap.end() );
+ }
+
+ inline static void putStatus(const std::string & method,
+ Operator * anOperator)
+ {
+ theStatusMap[ method ] = anOperator;
+ }
+
+
+
+ /**
+ * GETTER - SETTER
+ * theOtherMap
+ */
+ static std::map< std::string , Operator * > theOtherMap;
+
+ inline static Operator * getOther(const std::string & method)
+ {
+ return( theOtherMap[ method ] );
+ }
+
+ inline static bool isOther(const std::string & method)
+ {
+ return( theOtherMap.find( method ) != theOtherMap.end() );
+ }
+
+ inline static void putOther(const std::string & method,
+ Operator * anOperator)
+ {
+ theOtherMap[ method ] = anOperator;
+ }
+
+
+
+ /**
+ * GETTER - SETTER
+ */
+ static Operator * get(const std::string & method);
+
+ static Operator * get(const BF & aReceiver, const std::string & method);
+
+ inline static Operator * get(Machine * aMachine, const std::string & method)
+ {
+ return( get(method) );
+ }
+
+ inline static Operator * get(BaseInstanceForm * anInstance,
+ const std::string & method)
+ {
+ return( get(method) );
+ }
+
+
+ inline static bool exist(const std::string & method)
+ {
+ return( isActivity(method) || isStatus(method) ||
+ isOther(method) );
+ }
+
+ inline static bool exist(BaseInstanceForm * anInstance,
+ const std::string & method)
+ {
+ return( exist(method) );
+ }
+
+ inline static bool exist(const std::string & method, Operator * anOperator)
+ {
+ return( (anOperator == getActivity(method)) ||
+ (anOperator == getStatus(method)) ||
+ (anOperator == getOther(method)) );
+ }
+
+
+ inline static void put(BaseInstanceForm * anInstance,
+ const std::string & method, Operator * anOperator)
+ {
+ putOther(method, anOperator);
+ }
+
+
+
+
+
+};
+
+} /* namespace sep */
+#endif /* AVMOPERATIONMACHINE_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/lib/AvmOperationVariable.cpp b/org.eclipse.efm.symbex/src/fml/lib/AvmOperationVariable.cpp
new file mode 100644
index 0000000..a46b9bb
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/lib/AvmOperationVariable.cpp
@@ -0,0 +1,402 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 4 avr. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmOperationVariable.h"
+
+#include <fml/executable/BaseInstanceForm.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/infrastructure/Variable.h>
+
+
+namespace sep
+{
+
+
+std::map< std::string , Operator * > AvmOperationVariable::theVariableMap;
+
+std::map< std::string , Operator * > AvmOperationVariable::theContainerMap;
+
+std::map< std::string , Operator * > AvmOperationVariable::theQueueMap;
+
+std::map< std::string , Operator * > AvmOperationVariable::theTimeMap;
+
+std::map< std::string , Operator * > AvmOperationVariable::theActivityMap;
+
+std::map< std::string , Operator * > AvmOperationVariable::theOtherMap;
+
+
+
+
+/**
+ * LOADER
+ */
+void AvmOperationVariable::load()
+{
+ putVariable("newfresh" , OperatorManager::OPERATOR_ASSIGN_NEWFRESH);
+ putVariable("reset" , OperatorManager::OPERATOR_ASSIGN_RESET);
+
+ putVariable("changed" , OperatorManager::OPERATOR_CHANGED);
+ putVariable("changed_to" , OperatorManager::OPERATOR_CHANGED_TO);
+
+
+ putContainer("contains" , OperatorManager::OPERATOR_CONTAINS);
+ putContainer("in" , OperatorManager::OPERATOR_IN);
+ putContainer("notin" , OperatorManager::OPERATOR_NOTIN);
+ putContainer("subset" , OperatorManager::OPERATOR_SUBSET);
+ putContainer("subseteq" , OperatorManager::OPERATOR_SUBSETEQ);
+ putContainer("intersect" , OperatorManager::OPERATOR_INTERSECT);
+
+ putContainer("starts_with" , OperatorManager::OPERATOR_STARTS_WITH);
+ putContainer("ends_with" , OperatorManager::OPERATOR_ENDS_WITH);
+ putContainer("concat" , OperatorManager::OPERATOR_CONCAT);
+
+ putContainer("empty" , OperatorManager::OPERATOR_EMPTY);
+ putContainer("nonempty" , OperatorManager::OPERATOR_NONEMPTY);
+ putContainer("singleton" , OperatorManager::OPERATOR_SINGLETON);
+ putContainer("populated" , OperatorManager::OPERATOR_POPULATED);
+ putContainer("full" , OperatorManager::OPERATOR_FULL);
+ putContainer("size" , OperatorManager::OPERATOR_SIZE);
+
+ putContainer("append" , OperatorManager::OPERATOR_APPEND);
+ putContainer("remove" , OperatorManager::OPERATOR_REMOVE);
+
+ putContainer("clear" , OperatorManager::OPERATOR_CLEAR);
+ putContainer("resize" , OperatorManager::OPERATOR_RESIZE);
+
+ putContainer("select" , OperatorManager::OPERATOR_SELECT);
+
+ putQueue("push" , OperatorManager::OPERATOR_PUSH);
+ putQueue("assign_top" , OperatorManager::OPERATOR_ASSIGN_TOP);
+ putQueue("top" , OperatorManager::OPERATOR_TOP);
+ putQueue("pop" , OperatorManager::OPERATOR_POP);
+ putQueue("pop_from" , OperatorManager::OPERATOR_POP_FROM);
+ putQueue("remove_popable" , OperatorManager::OPERATOR_REMOVE);
+
+ putActivity("ienable" , OperatorManager::OPERATOR_IENABLE_INVOKE);
+ putActivity("enable" , OperatorManager::OPERATOR_ENABLE_INVOKE);
+ putActivity("enable#set" , OperatorManager::OPERATOR_ENABLE_SET);
+
+ putActivity("idisable" , OperatorManager::OPERATOR_IDISABLE_INVOKE);
+ putActivity("disable" , OperatorManager::OPERATOR_DISABLE_INVOKE);
+ putActivity("disable#set" , OperatorManager::OPERATOR_DISABLE_SET);
+
+ putActivity("iabort" , OperatorManager::OPERATOR_IABORT_INVOKE);
+ putActivity("abort" , OperatorManager::OPERATOR_ABORT_INVOKE);
+ putActivity("abort#set" , OperatorManager::OPERATOR_ABORT_SET);
+}
+
+
+/**
+ * DISPOSER
+ */
+void AvmOperationVariable::dispose()
+{
+ theVariableMap.clear();
+
+ theContainerMap.clear();
+
+ theQueueMap.clear();
+
+ theTimeMap.clear();
+
+ theActivityMap.clear();
+
+ theOtherMap.clear();
+}
+
+
+/**
+ * GETTER - SETTER
+ */
+Operator * AvmOperationVariable::get(const std::string & method)
+{
+ Operator * op = NULL;
+
+ if( (op = getContainer(method)) != NULL )
+ {
+ return( op );
+ }
+
+ if( (op = getQueue(method)) != NULL )
+ {
+ return( op );
+ }
+
+ if( (op = getTime(method)) != NULL )
+ {
+ return( op );
+ }
+
+ if( (op = getActivity(method)) != NULL )
+ {
+ return( op );
+ }
+
+ if( (op = getVariable(method)) != NULL )
+ {
+ return( op );
+ }
+
+ return( getOther(method) );
+}
+
+
+Operator * AvmOperationVariable::get(const BF & aReceiver,
+ const std::string & method)
+{
+ if( aReceiver.is< Variable >() )
+ {
+ return( get(aReceiver.to_ptr< Variable >(), method) );
+ }
+ else if( aReceiver.is< BaseInstanceForm >() )
+ {
+ return( get(aReceiver.to_ptr< BaseInstanceForm >(), method) );
+ }
+ return( get(method) );
+}
+
+
+
+
+Operator * AvmOperationVariable::get(
+ Variable * aVariable, const std::string & method)
+{
+ if( (aVariable->hasTypeSpecifier() &&
+ (aVariable->getTypeSpecifier()->hasTypeContainer() ||
+ aVariable->getTypeSpecifier()->isTypedBuffer() ||
+ aVariable->getTypeSpecifier()->hasTypeContainer() ||
+ aVariable->getTypeSpecifier()->isTypedString() ) ) )
+ {
+ Operator * opContainer = getContainer(method);
+ if( opContainer != NULL )
+ {
+ return( opContainer );
+ }
+ }
+
+ if( aVariable->hasTypeSpecifier() &&
+ aVariable->getTypeSpecifier()->hasTypeQueue() )
+ {
+ Operator * opQueue = getQueue(method);
+ if( opQueue != NULL )
+ {
+ return( opQueue );
+ }
+ }
+
+ if( aVariable->hasTypeSpecifier() &&
+ (aVariable->getTypeSpecifier()->isTypedMachine() ||
+ aVariable->getTypeSpecifier()->weaklyTypedInteger() ) )
+ {
+ Operator * opActivity = getActivity(method);
+ if( opActivity != NULL )
+ {
+ return( opActivity );
+ }
+ }
+
+ if( aVariable->hasTypeSpecifier()
+ && aVariable->getTypeSpecifier()->hasTypedClockTime() )
+ {
+ Operator * opTime = getTime(method);
+ if( opTime != NULL )
+ {
+ return( opTime );
+ }
+ }
+ else
+ {
+ Operator * opVar = getVariable(method);
+ if( opVar != NULL )
+ {
+ return( opVar );
+ }
+ }
+
+ return( getOther(method) );
+}
+
+
+Operator * AvmOperationVariable::get(
+ BaseInstanceForm * anInstance, const std::string & method)
+{
+ if( anInstance->hasTypeContainer() ||
+ anInstance->isTypedBuffer() ||
+ anInstance->isTypedString() )
+ {
+ Operator * opContainer = getContainer(method);
+ if( opContainer != NULL )
+ {
+ return( opContainer );
+ }
+ }
+
+ if( anInstance->hasTypeQueue() )
+ {
+ Operator * opQueue = getQueue(method);
+ if( opQueue != NULL )
+ {
+ return( opQueue );
+ }
+ }
+
+ if( anInstance->hasTypeSpecifier() && (
+ anInstance->getTypeSpecifier()->isTypedMachine() ||
+ anInstance->getTypeSpecifier()->weaklyTypedInteger() ) )
+ {
+ Operator * opActivity = getActivity(method);
+ if( opActivity != NULL )
+ {
+ return( opActivity );
+ }
+ }
+
+ if( anInstance->hasTypedClockTime() )
+ {
+ Operator * opTime = getTime(method);
+ if( opTime != NULL )
+ {
+ return( opTime );
+ }
+ }
+ else
+ {
+ Operator * opVar = getVariable(method);
+ if( opVar != NULL )
+ {
+ return( opVar );
+ }
+ }
+
+ return( getOther(method) );
+}
+
+
+Operator * AvmOperationVariable::get(
+ BaseTypeSpecifier * aTypeSpecifier, const std::string & method)
+{
+ if( aTypeSpecifier->hasTypeContainer() ||
+ aTypeSpecifier->isTypedBuffer() ||
+ aTypeSpecifier->isTypedString() )
+ {
+ Operator * opContainer = getContainer(method);
+ if( opContainer != NULL )
+ {
+ return( opContainer );
+ }
+ }
+
+ if( aTypeSpecifier->hasTypeQueue() )
+ {
+ Operator * opQueue = getQueue(method);
+ if( opQueue != NULL )
+ {
+ return( opQueue );
+ }
+ }
+
+ if( aTypeSpecifier->isTypedMachine() ||
+ aTypeSpecifier->weaklyTypedInteger() )
+ {
+ Operator * opActivity = getActivity(method);
+ if( opActivity != NULL )
+ {
+ return( opActivity );
+ }
+ }
+
+ if( aTypeSpecifier->hasTypedTime() )
+ {
+ Operator * opTime = getTime(method);
+ if( opTime != NULL )
+ {
+ return( opTime );
+ }
+ }
+ else
+ {
+ Operator * opVar = getVariable(method);
+ if( opVar != NULL )
+ {
+ return( opVar );
+ }
+ }
+
+ return( getOther(method) );
+}
+
+
+bool AvmOperationVariable::exist(BaseInstanceForm * anInstance,
+ const std::string & method)
+{
+ if( (anInstance->hasTypeContainer() || anInstance->isTypedBuffer()) &&
+ isContainer(method) )
+ {
+ return( true );
+ }
+
+ if( anInstance->hasTypeQueue() && isQueue(method) )
+ {
+ return( true );
+ }
+
+ if( isActivity(method) && anInstance->hasTypeSpecifier() && (
+ anInstance->getTypeSpecifier()->isTypedMachine() ||
+ anInstance->getTypeSpecifier()->weaklyTypedInteger() ) )
+ {
+ return( true );
+ }
+
+ if( isVariable(method) )
+ {
+ return( true );
+ }
+
+ return( isOther(method) );
+}
+
+
+
+void AvmOperationVariable::put(BaseInstanceForm * anInstance,
+ const std::string & method, Operator * anOperator)
+{
+ if( anInstance->hasTypedClockTime() )
+ {
+ putTime(method, anOperator);
+ }
+ else if( anInstance->hasTypeQueue() )
+ {
+ putQueue(method, anOperator);
+ }
+ else if( anInstance->hasTypeContainer() ||
+ anInstance->isTypedBuffer() )
+ {
+ putContainer(method, anOperator);
+ }
+ else if( anInstance->hasTypeSpecifier() && (
+ anInstance->getTypeSpecifier()->isTypedMachine() ||
+ anInstance->getTypeSpecifier()->weaklyTypedInteger() ) )
+ {
+ putActivity(method, anOperator);
+ }
+
+ putOther(method, anOperator);
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/lib/AvmOperationVariable.h b/org.eclipse.efm.symbex/src/fml/lib/AvmOperationVariable.h
new file mode 100644
index 0000000..e8b3e5e
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/lib/AvmOperationVariable.h
@@ -0,0 +1,229 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 4 avr. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMOPERATIONVARIABLE_H_
+#define AVMOPERATIONVARIABLE_H_
+
+#include <map>
+
+#include <fml/operator/Operator.h>
+
+
+namespace sep
+{
+
+
+class BF;
+class BaseInstanceForm;
+class Variable;
+
+
+
+class AvmOperationVariable
+{
+
+public:
+ /**
+ * LOADER - DISPOSER
+ */
+ static void load();
+ static void dispose();
+
+
+ /**
+ * GETTER - SETTER
+ * theVariableMap
+ */
+ static std::map< std::string , Operator * > theVariableMap;
+
+ inline static Operator * getVariable(const std::string & method)
+ {
+ return( theVariableMap[ method ] );
+ }
+
+ inline static bool isVariable(const std::string & method)
+ {
+ return( theVariableMap.find( method ) != theVariableMap.end() );
+ }
+
+ inline static void putVariable(const std::string & method,
+ Operator * anOperator)
+ {
+ theVariableMap[ method ] = anOperator;
+ }
+
+
+
+ /**
+ * GETTER - SETTER
+ * theContainerMap
+ */
+ static std::map< std::string , Operator * > theContainerMap;
+
+ inline static Operator * getContainer(const std::string & method)
+ {
+ return( theContainerMap[ method ] );
+ }
+
+ inline static bool isContainer(const std::string & method)
+ {
+ return( theContainerMap.find( method ) != theContainerMap.end() );
+ }
+
+ inline static void putContainer(const std::string & method,
+ Operator * anOperator)
+ {
+ theContainerMap[ method ] = anOperator;
+ }
+
+
+
+ /**
+ * GETTER - SETTER
+ * theQueueMap
+ */
+ static std::map< std::string , Operator * > theQueueMap;
+
+ inline static Operator * getQueue(const std::string & method)
+ {
+ return( theQueueMap[ method ] );
+ }
+
+ inline static bool isQueue(const std::string & method)
+ {
+ return( theQueueMap.find( method ) != theQueueMap.end() );
+ }
+
+ inline static void putQueue(const std::string & method, Operator * anOperator)
+ {
+ theQueueMap[ method ] = anOperator;
+ }
+
+
+
+ /**
+ * GETTER - SETTER
+ * theTimeMap
+ */
+ static std::map< std::string , Operator * > theTimeMap;
+
+ inline static Operator * getTime(const std::string & method)
+ {
+ return( theTimeMap[ method ] );
+ }
+
+ inline static bool isTime(const std::string & method)
+ {
+ return( theTimeMap.find( method ) != theTimeMap.end() );
+ }
+
+ inline static void putTime(const std::string & method, Operator * anOperator)
+ {
+ theTimeMap[ method ] = anOperator;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * theActivityMap
+ */
+ static std::map< std::string , Operator * > theActivityMap;
+
+ inline static Operator * getActivity(const std::string & method)
+ {
+ return( theActivityMap[ method ] );
+ }
+
+ inline static bool isActivity(const std::string & method)
+ {
+ return( theActivityMap.find( method ) != theActivityMap.end() );
+ }
+
+ inline static void putActivity(const std::string & method,
+ Operator * anOperator)
+ {
+ theActivityMap[ method ] = anOperator;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * theOtherMap
+ */
+ static std::map< std::string , Operator * > theOtherMap;
+
+ inline static Operator * getOther(const std::string & method)
+ {
+ return( theOtherMap[ method ] );
+ }
+
+ inline static bool isOther(const std::string & method)
+ {
+ return( theOtherMap.find( method ) != theOtherMap.end() );
+ }
+
+ inline static void putOther(const std::string & method, Operator * anOperator)
+ {
+ theOtherMap[ method ] = anOperator;
+ }
+
+
+
+ /**
+ * GETTER - SETTER
+ */
+ static Operator * get(const std::string & method);
+
+ static Operator * get(const BF & aReceiver, const std::string & method);
+
+ static Operator * get(Variable * aVariable, const std::string & method);
+
+ static Operator * get(BaseInstanceForm * anInstance,
+ const std::string & method);
+
+ static Operator * get(BaseTypeSpecifier * aTypeSpecifier,
+ const std::string & method);
+
+
+ inline static bool exist(const std::string & method)
+ {
+ return( isVariable(method) || isContainer(method) ||
+ isQueue(method) || isTime(method) ||
+ isActivity(method) || isOther(method) );
+ }
+
+ static bool exist(BaseInstanceForm * anInstance, const std::string & method);
+
+ inline static bool exist(const std::string & method, Operator * anOperator)
+ {
+ return( (anOperator == getVariable(method)) ||
+ (anOperator == getContainer(method)) ||
+ (anOperator == getQueue(method)) ||
+ (anOperator == getTime(method)) ||
+ (anOperator == getActivity(method)) ||
+ (anOperator == getOther(method)) );
+ }
+
+
+ static void put(BaseInstanceForm * anInstance,
+ const std::string & method, Operator * anOperator);
+
+
+};
+
+
+
+} /* namespace sep */
+#endif /* AVMOPERATIONVARIABLE_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/lib/IComPoint.cpp b/org.eclipse.efm.symbex/src/fml/lib/IComPoint.cpp
new file mode 100644
index 0000000..aa03823
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/lib/IComPoint.cpp
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 juin 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "IComPoint.h"
+
+namespace sep
+{
+
+////////////////////////////////////////////////////////////////////////////////
+// COMMUNICATION POINT : KIND & DIRECTION
+////////////////////////////////////////////////////////////////////////////////
+
+IComPoint::ENUM_IO_NATURE IComPoint::to_nature(const std::string & id)
+{
+ if( id == "message" ) return IO_MESSAGE_NATURE;
+
+ if( id == "port" ) return IO_PORT_NATURE;
+
+ if( id == "signal" ) return IO_SIGNAL_NATURE;
+
+ return IO_UNDEFINED_NATURE;
+}
+
+
+std::string IComPoint::SEPARATOR = "%";
+
+std::string IComPoint::str_nature(
+ IComPoint::ENUM_IO_NATURE nature, IComPoint::ENUM_IO_NATURE mask)
+{
+ std::string strNature = "";
+ std::string sep = "";
+
+ nature = nature & mask;
+
+ if( (nature & IO_CHANNEL_NATURE) != 0 )
+ {
+ strNature = "channel";
+ sep = SEPARATOR;
+ }
+ if( (nature & IO_MESSAGE_NATURE) != 0 )
+ {
+ strNature = "message";
+ sep = SEPARATOR;
+ }
+ if( (nature & IO_PORT_NATURE) != 0 )
+ {
+ strNature = "port";
+ sep = SEPARATOR;
+ }
+ if( (nature & IO_SIGNAL_NATURE) != 0 )
+ {
+ strNature = "signal";
+ sep = SEPARATOR;
+ }
+
+ return( strNature );
+}
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/lib/IComPoint.h b/org.eclipse.efm.symbex/src/fml/lib/IComPoint.h
new file mode 100644
index 0000000..b4ffaad
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/lib/IComPoint.h
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 juin 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef ICOMPOINT_H_
+#define ICOMPOINT_H_
+
+#include <string>
+
+#include <util/avm_numeric.h>
+
+
+namespace sep
+{
+
+////////////////////////////////////////////////////////////////////////////////
+// COMMUNICATION POINT : KIND & DIRECTION
+////////////////////////////////////////////////////////////////////////////////
+
+class IComPoint
+{
+
+public:
+ /**
+ * ComPoint NATURE
+ */
+ typedef avm_uint8_t ENUM_IO_NATURE;
+
+ enum
+ {
+ IO_CHANNEL_NATURE = 0x001,
+
+ IO_MESSAGE_NATURE = 0x002,
+
+ IO_PORT_NATURE = 0x004,
+
+ IO_SIGNAL_NATURE = 0x008,
+
+
+ IO_MASK_ALL_NATURE = 0x0FF,
+
+ IO_UNDEFINED_NATURE = 0x000
+ };
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~IComPoint()
+ {
+ //!! NOTHING
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // NATURE
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * STATIC
+ */
+ static ENUM_IO_NATURE to_nature(const std::string & id);
+
+ static std::string str_nature(ENUM_IO_NATURE nature,
+ ENUM_IO_NATURE mask = IO_MASK_ALL_NATURE);
+
+ static std::string SEPARATOR;
+
+ /**
+ * API
+ */
+ virtual ENUM_IO_NATURE getComPointNature() const = 0;
+
+// ENUM_IO_NATURE getComPointNature() const
+// {
+// return( mNature );
+// }
+
+
+ inline bool isPort() const
+ {
+ return( getComPointNature() == IO_PORT_NATURE );
+ }
+
+ inline bool isSignal() const
+ {
+ return( getComPointNature() == IO_SIGNAL_NATURE );
+ }
+
+ inline std::string strComPointNature() const
+ {
+ return( IComPoint::str_nature( getComPointNature() ) );
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* ICOMPOINT_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/lib/ITracePoint.cpp b/org.eclipse.efm.symbex/src/fml/lib/ITracePoint.cpp
new file mode 100644
index 0000000..98becc8
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/lib/ITracePoint.cpp
@@ -0,0 +1,311 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 juin 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ITracePoint.h"
+
+#include <fml/workflow/Query.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// TRACE POINT
+////////////////////////////////////////////////////////////////////////////////
+
+ENUM_TRACE_POINT::TRACE_NATURE ENUM_TRACE_POINT::to_nature(
+ IComPoint::ENUM_IO_NATURE io)
+{
+ switch( io )
+ {
+ case IComPoint::IO_CHANNEL_NATURE : return( TRACE_CHANNEL_NATURE );
+
+ case IComPoint::IO_MESSAGE_NATURE : return( TRACE_MESSAGE_NATURE );
+
+ case IComPoint::IO_PORT_NATURE : return( TRACE_PORT_NATURE );
+
+ case IComPoint::IO_SIGNAL_NATURE : return( TRACE_SIGNAL_NATURE );
+
+ case IComPoint::IO_UNDEFINED_NATURE : return( TRACE_UNDEFINED_NATURE );
+
+ default : return( TRACE_UNDEFINED_NATURE );
+ }
+}
+
+
+ENUM_TRACE_POINT::TRACE_NATURE ENUM_TRACE_POINT::to_nature(
+ const std::string & id)
+{
+ if( id == "com" ) return TRACE_COM_NATURE;
+
+ if( id == "channel" ) return TRACE_CHANNEL_NATURE;
+
+ if( id == "message" ) return TRACE_MESSAGE_NATURE;
+
+ if( id == "port" ) return TRACE_PORT_NATURE;
+
+ if( id == "signal" ) return TRACE_SIGNAL_NATURE;
+
+ if( id == "time" ) return TRACE_TIME_NATURE;
+
+ if( id == "var" ) return TRACE_VARIABLE_NATURE;
+ if( id == "variable" ) return TRACE_VARIABLE_NATURE;
+// if( id == "assign" ) return TRACE_VARIABLE_NATURE;
+// if( id == "newfresh" ) return TRACE_VARIABLE_NATURE;
+
+ if( id == "buffer" ) return TRACE_BUFFER_NATURE;
+
+ if( id == "formula" ) return TRACE_FORMULA_NATURE;
+
+ if( id == "condition" ) return TRACE_CONDITION_NATURE;
+ if( id == "decision" ) return TRACE_DECISION_NATURE;
+
+ if( REGEX_MATCH(id, CONS_WID2("path", "condition")) ) return TRACE_PATH_CONDITION_NATURE;
+ if( REGEX_MATCH(id, CONS_WID2("node", "condition")) ) return TRACE_NODE_CONDITION_NATURE;
+
+ if( REGEX_MATCH(id, CONS_WID3("path", "condition", "leaf")) ) {
+ return TRACE_PATH_CONDITION_NATURE_LEAF;
+ }
+ if( REGEX_MATCH(id, CONS_WID3("node", "condition", "leaf")) ) {
+ return TRACE_NODE_CONDITION_NATURE_LEAF;
+ }
+
+ if( REGEX_MATCH(id, CONS_WID3("path", "timed", "condition")) ) {
+ return TRACE_PATH_TIMED_CONDITION_NATURE;
+ }
+ if( REGEX_MATCH(id, CONS_WID3("node", "timed", "condition")) ) {
+ return TRACE_NODE_TIMED_CONDITION_NATURE;
+ }
+
+ if( REGEX_MATCH(id, CONS_WID4(
+ "path", "timed", "condition", "(leaf|end|last|tail)")) ) {
+ return TRACE_PATH_TIMED_CONDITION_NATURE_LEAF;
+ }
+ if( REGEX_MATCH(id, CONS_WID4(
+ "node", "timed", "condition", "(leaf|end|last|tail)")) ) {
+ return TRACE_NODE_TIMED_CONDITION_NATURE_LEAF;
+ }
+
+ if( id == "machine" ) return TRACE_MACHINE_NATURE;
+ if( id == "state" ) return TRACE_STATE_NATURE;
+ if( id == "statemachine" ) return TRACE_STATEMACHINE_NATURE;
+
+ if( id == "transition" ) return TRACE_TRANSITION_NATURE;
+ if( id == "routine" ) return TRACE_ROUTINE_NATURE;
+
+ if( id == "runnable" ) return TRACE_RUNNABLE_NATURE;
+
+ if( REGEX_MATCH(id, CONS_WID2(
+ "init", "header")) ) return TRACE_INIT_HEADER_NATURE;
+
+ if( REGEX_MATCH(id, CONS_WID2(
+ "init", "begin" )) ) return TRACE_INIT_BEGIN_NATURE;
+
+ if( REGEX_MATCH(id, CONS_WID2(
+ "init", "end" )) ) return TRACE_INIT_END_NATURE;
+
+
+ if( REGEX_MATCH(id, CONS_WID2(
+ "step", "header")) ) return TRACE_STEP_HEADER_NATURE;
+
+ if( REGEX_MATCH(id, CONS_WID2(
+ "step", "begin" )) ) return TRACE_STEP_BEGIN_NATURE;
+
+ if( REGEX_MATCH(id, CONS_WID2(
+ "step", "end" )) ) return TRACE_STEP_END_NATURE;
+
+
+ if( id == "comment" ) return TRACE_COMMENT_NATURE;
+ if( id == "separator" ) return TRACE_SEPARATOR_NATURE;
+ if( id == "newline" ) return TRACE_NEWLINE_NATURE;
+
+ if( id == "composite" ) return TRACE_COMPOSITE_NATURE;
+ if( id == "trace" ) return TRACE_COMPOSITE_NATURE;
+ if( id == "point" ) return TRACE_COMPOSITE_NATURE;
+
+ return TRACE_UNDEFINED_NATURE;
+}
+
+
+bool ENUM_TRACE_POINT::is_com(ENUM_TRACE_POINT::TRACE_NATURE nature)
+{
+ switch( nature )
+ {
+ case TRACE_COM_NATURE :
+ case TRACE_CHANNEL_NATURE :
+ case TRACE_MESSAGE_NATURE :
+ case TRACE_PORT_NATURE :
+ case TRACE_SIGNAL_NATURE : return( true );
+
+ default : return( false );
+ }
+}
+
+bool ENUM_TRACE_POINT::is_com(const std::string & id)
+{
+ if( (id == "com" ) ||
+ (id == "channel" ) ||
+ (id == "message" ) ||
+ (id == "port" ) ||
+ (id == "signal" ) )
+ {
+ return true;
+ }
+
+ return( false );
+}
+
+
+std::string ENUM_TRACE_POINT::to_string(ENUM_TRACE_POINT::TRACE_NATURE nature)
+{
+ switch( nature )
+ {
+ case TRACE_COMPOSITE_NATURE : return( "composite" );
+
+ case TRACE_COM_NATURE : return( "com" );
+
+ case TRACE_CHANNEL_NATURE : return( "channel" );
+ case TRACE_MESSAGE_NATURE : return( "message" );
+
+ case TRACE_PORT_NATURE : return( "port" );
+ case TRACE_SIGNAL_NATURE : return( "signal" );
+
+ case TRACE_TIME_NATURE : return( "time" );
+ case TRACE_VARIABLE_NATURE : return( "variable" );
+ case TRACE_BUFFER_NATURE : return( "buffer" );
+
+ case TRACE_FORMULA_NATURE : return( "formula" );
+
+ case TRACE_CONDITION_NATURE : return( "condition" );
+ case TRACE_DECISION_NATURE : return( "decision" );
+
+ case TRACE_PATH_CONDITION_NATURE : return( "path#conditon" );
+ case TRACE_NODE_CONDITION_NATURE : return( "node#conditon" );
+
+ case TRACE_PATH_CONDITION_NATURE_LEAF : return( "path#conditon#leaf" );
+ case TRACE_NODE_CONDITION_NATURE_LEAF : return( "node#conditon#leaf" );
+
+ case TRACE_PATH_TIMED_CONDITION_NATURE: return( "path#timed#conditon" );
+ case TRACE_NODE_TIMED_CONDITION_NATURE: return( "node#timed#conditon" );
+
+ case TRACE_PATH_TIMED_CONDITION_NATURE_LEAF: return( "path#timed#conditon#leaf" );
+ case TRACE_NODE_TIMED_CONDITION_NATURE_LEAF: return( "node#timed#conditon#leaf" );
+
+ case TRACE_MACHINE_NATURE : return( "machine" );
+ case TRACE_STATE_NATURE : return( "state" );
+ case TRACE_STATEMACHINE_NATURE : return( "statemachine" );
+
+ case TRACE_TRANSITION_NATURE : return( "transition" );
+ case TRACE_ROUTINE_NATURE : return( "routine" );
+
+ case TRACE_RUNNABLE_NATURE : return( "runnable" );
+
+ case TRACE_STEP_HEADER_NATURE : return( "step#header" );
+ case TRACE_STEP_BEGIN_NATURE : return( "step#begin" );
+ case TRACE_STEP_END_NATURE : return( "step#end" );
+
+ case TRACE_INIT_HEADER_NATURE : return( "init#header" );
+ case TRACE_INIT_BEGIN_NATURE : return( "init#begin" );
+ case TRACE_INIT_END_NATURE : return( "init#end" );
+
+ case TRACE_COMMENT_NATURE : return( "comment" );
+ case TRACE_SEPARATOR_NATURE : return( "separator" );
+ case TRACE_NEWLINE_NATURE : return( "newline" );
+
+ case TRACE_UNDEFINED_NATURE : return( "undefined<point#nature>" );
+
+ default : return( "unknown<point#nature>" );
+ }
+}
+
+
+std::string ENUM_TRACE_POINT::to_uid(
+ ENUM_TRACE_POINT::TRACE_NATURE nature, AVM_OPCODE op)
+{
+ switch( nature )
+ {
+ case TRACE_COMPOSITE_NATURE : return( "composite" );
+
+ case TRACE_COM_NATURE : return( "com" );
+
+ case TRACE_CHANNEL_NATURE : return( "channel" );
+ case TRACE_MESSAGE_NATURE : return( "message" );
+
+ case TRACE_PORT_NATURE : return( "port" );
+ case TRACE_SIGNAL_NATURE : return( "signal" );
+
+ case TRACE_TIME_NATURE : return( "time" );
+
+ case TRACE_VARIABLE_NATURE :
+ {
+ switch( op )
+ {
+ case AVM_OPCODE_ASSIGN : return( "assign" );
+ case AVM_OPCODE_ASSIGN_NEWFRESH: return( "newfresh" );
+ default : return( "variable" );
+ }
+ return( "variable" );
+ }
+
+ case TRACE_BUFFER_NATURE : return( "buffer" );
+
+ case TRACE_FORMULA_NATURE : return( "formula" );
+
+ case TRACE_CONDITION_NATURE : return( "condition" );
+ case TRACE_DECISION_NATURE : return( "decision" );
+
+ case TRACE_PATH_CONDITION_NATURE : return( "path#conditon" );
+ case TRACE_NODE_CONDITION_NATURE : return( "node#conditon" );
+
+ case TRACE_PATH_CONDITION_NATURE_LEAF: return( "path#conditon#leaf" );
+ case TRACE_NODE_CONDITION_NATURE_LEAF: return( "node#conditon#leaf" );
+
+ case TRACE_PATH_TIMED_CONDITION_NATURE: return( "path#timed#conditon" );
+ case TRACE_NODE_TIMED_CONDITION_NATURE: return( "node#timed#conditon" );
+
+ case TRACE_PATH_TIMED_CONDITION_NATURE_LEAF: return( "path#timed#conditon#leaf" );
+ case TRACE_NODE_TIMED_CONDITION_NATURE_LEAF: return( "node#timed#conditon#leaf" );
+
+ case TRACE_MACHINE_NATURE : return( "machine" );
+ case TRACE_STATE_NATURE : return( "state" );
+ case TRACE_STATEMACHINE_NATURE : return( "statemachine" );
+
+ case TRACE_TRANSITION_NATURE : return( "transition" );
+ case TRACE_ROUTINE_NATURE : return( "routine" );
+
+ case TRACE_RUNNABLE_NATURE : return( "runnable" );
+
+ case TRACE_STEP_HEADER_NATURE : return( "step#header" );
+ case TRACE_STEP_BEGIN_NATURE : return( "step#begin" );
+ case TRACE_STEP_END_NATURE : return( "step#end" );
+
+ case TRACE_INIT_HEADER_NATURE : return( "init#header" );
+ case TRACE_INIT_BEGIN_NATURE : return( "init#begin" );
+ case TRACE_INIT_END_NATURE : return( "init#end" );
+
+ case TRACE_COMMENT_NATURE : return( "comment" );
+ case TRACE_SEPARATOR_NATURE : return( "separator" );
+ case TRACE_NEWLINE_NATURE : return( "newline" );
+
+ case TRACE_UNDEFINED_NATURE : return( "undefined<point#nature>" );
+
+ default : return( "unknown<point#nature>" );
+ }
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/lib/ITracePoint.h b/org.eclipse.efm.symbex/src/fml/lib/ITracePoint.h
new file mode 100644
index 0000000..476525f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/lib/ITracePoint.h
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 juin 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef ITRACEPOINT_H_
+#define ITRACEPOINT_H_
+
+#include <fml/lib/IComPoint.h>
+
+#include <fml/operator/OperatorLib.h>
+
+
+namespace sep
+{
+
+
+class ITracePoint
+{
+public:
+
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+// TRACE POINT
+////////////////////////////////////////////////////////////////////////////////
+
+class ENUM_TRACE_POINT
+{
+
+public:
+
+ enum TRACE_NATURE
+ {
+ TRACE_COMPOSITE_NATURE,
+
+
+ TRACE_COM_NATURE,
+
+ TRACE_CHANNEL_NATURE,
+
+ TRACE_MESSAGE_NATURE,
+
+ TRACE_PORT_NATURE,
+
+ TRACE_SIGNAL_NATURE,
+
+ TRACE_BUFFER_NATURE,
+
+
+ TRACE_TIME_NATURE,
+
+ TRACE_VARIABLE_NATURE,
+
+ TRACE_FORMULA_NATURE,
+
+ TRACE_CONDITION_NATURE,
+ TRACE_DECISION_NATURE,
+
+ TRACE_PATH_CONDITION_NATURE,
+ TRACE_PATH_CONDITION_NATURE_LEAF,
+
+ TRACE_PATH_TIMED_CONDITION_NATURE,
+ TRACE_PATH_TIMED_CONDITION_NATURE_LEAF,
+
+ TRACE_NODE_CONDITION_NATURE,
+ TRACE_NODE_CONDITION_NATURE_LEAF,
+
+ TRACE_NODE_TIMED_CONDITION_NATURE,
+ TRACE_NODE_TIMED_CONDITION_NATURE_LEAF,
+
+ TRACE_MACHINE_NATURE,
+
+ TRACE_STATE_NATURE,
+
+ TRACE_STATEMACHINE_NATURE,
+
+
+ TRACE_TRANSITION_NATURE,
+
+ TRACE_ROUTINE_NATURE,
+
+ TRACE_RUNNABLE_NATURE,
+
+ // VIRTUAL ELEMENT
+ TRACE_COMMENT_NATURE,
+ TRACE_SEPARATOR_NATURE,
+ TRACE_NEWLINE_NATURE,
+
+ TRACE_INIT_HEADER_NATURE,
+ TRACE_INIT_BEGIN_NATURE,
+ TRACE_INIT_END_NATURE,
+
+ TRACE_STEP_HEADER_NATURE,
+ TRACE_STEP_BEGIN_NATURE,
+ TRACE_STEP_END_NATURE,
+
+ TRACE_UNDEFINED_NATURE
+ };
+
+ /**
+ * STATIC
+ */
+ static TRACE_NATURE to_nature(IComPoint::ENUM_IO_NATURE io);
+
+ static TRACE_NATURE to_nature(const std::string & id);
+
+
+ static bool is_com(TRACE_NATURE nature);
+
+ static bool is_com(const std::string & id);
+
+
+ static std::string to_string(TRACE_NATURE nature);
+
+ static std::string to_uid(TRACE_NATURE nature, AVM_OPCODE op);
+
+};
+
+
+} /* namespace sep */
+
+#endif /* ITRACEPOINT_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/lib/ITypeSpecifier.cpp b/org.eclipse.efm.symbex/src/fml/lib/ITypeSpecifier.cpp
new file mode 100644
index 0000000..0b5f370
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/lib/ITypeSpecifier.cpp
@@ -0,0 +1,513 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 27 févr. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ITypeSpecifier.h"
+
+#include <common/BF.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+#include <fml/type/ContainerTypeSpecifier.h>
+#include <fml/type/IntervalTypeSpecifier.h>
+
+
+namespace sep
+{
+
+///////////////////
+// CLOCK TYPE
+///////////////////
+
+bool ITypeSpecifier::weaklyTypedClockInteger() const
+{
+ return( (getTypeSpecifierKind() == TYPE_CLOCK_SPECIFIER) &&
+ ( thisTypeSpecifier()->isnot< ContainerTypeSpecifier >() ||
+ thisTypeSpecifier()->to< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier().weaklyTypedInteger() ) );
+}
+
+bool ITypeSpecifier::weaklyTypedClockRational() const
+{
+ return( (getTypeSpecifierKind() == TYPE_CLOCK_SPECIFIER) &&
+ ( thisTypeSpecifier()->isnot< ContainerTypeSpecifier >() ||
+ thisTypeSpecifier()->to< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier().weaklyTypedRational() ) );
+}
+
+bool ITypeSpecifier::weaklyTypedClockFloat() const
+{
+ return( (getTypeSpecifierKind() == TYPE_CLOCK_SPECIFIER) &&
+ ( thisTypeSpecifier()->isnot< ContainerTypeSpecifier >() ||
+ thisTypeSpecifier()->to< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier().weaklyTypedFloat() ) );
+}
+
+
+bool ITypeSpecifier::weaklyTypedClockReal() const
+{
+ return( (getTypeSpecifierKind() == TYPE_CLOCK_SPECIFIER) &&
+ ( thisTypeSpecifier()->isnot< ContainerTypeSpecifier >() ||
+ thisTypeSpecifier()->to< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier().weaklyTypedReal() ) );
+}
+
+
+///////////////////
+// TIME TYPE
+///////////////////
+
+bool ITypeSpecifier::weaklyTypedTimeInteger() const
+{
+ return( (getTypeSpecifierKind() == TYPE_DISCRETE_TIME_SPECIFIER) ||
+ ( isTypedTime() &&
+ ( thisTypeSpecifier()->isnot< ContainerTypeSpecifier >() ||
+ thisTypeSpecifier()->to< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier().weaklyTypedInteger() ) ) );
+}
+
+
+bool ITypeSpecifier::weaklyTypedTimeRational() const
+{
+ return( hasTypedTime() &&
+ ( thisTypeSpecifier()->isnot< ContainerTypeSpecifier >() ||
+ thisTypeSpecifier()->to< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier().weaklyTypedRational() ) );
+}
+
+bool ITypeSpecifier::weaklyTypedTimeFloat() const
+{
+ return( (getTypeSpecifierKind() == TYPE_CONTINUOUS_TIME_SPECIFIER) ||
+ ( isTypedTime() &&
+ ( thisTypeSpecifier()->isnot< ContainerTypeSpecifier >() ||
+ thisTypeSpecifier()->to< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier().weaklyTypedFloat() ) ) );
+ }
+
+bool ITypeSpecifier::weaklyTypedTimeReal() const
+{
+ return( (getTypeSpecifierKind() == TYPE_CONTINUOUS_TIME_SPECIFIER) ||
+ ( isTypedTime() &&
+ ( thisTypeSpecifier()->isnot< ContainerTypeSpecifier >() ||
+ thisTypeSpecifier()->to< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier().weaklyTypedReal() ) ) );
+}
+
+
+///////////////////
+// CLOCK/TIME TYPE
+///////////////////
+
+bool ITypeSpecifier::weaklyTypedClockTimeInteger() const
+{
+ return( (getTypeSpecifierKind() == TYPE_DISCRETE_TIME_SPECIFIER) ||
+ ( isTypedClockTime() &&
+ ( thisTypeSpecifier()->isnot< ContainerTypeSpecifier >() ||
+ thisTypeSpecifier()->to< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier().weaklyTypedInteger() ) ) );
+}
+
+bool ITypeSpecifier::weaklyTypedClockTimeRational() const
+{
+ return( hasTypedClockTime() &&
+ ( thisTypeSpecifier()->isnot< ContainerTypeSpecifier >() ||
+ thisTypeSpecifier()->to< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier().weaklyTypedRational() ) );
+}
+
+bool ITypeSpecifier::weaklyTypedClockTimeFloat() const
+{
+ return( (getTypeSpecifierKind() == TYPE_CONTINUOUS_TIME_SPECIFIER) ||
+ ( isTypedClockTime() &&
+ ( thisTypeSpecifier()->isnot< ContainerTypeSpecifier >() &&
+ thisTypeSpecifier()->to< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier().weaklyTypedFloat() ) ) );
+}
+
+bool ITypeSpecifier::weaklyTypedClockTimeReal() const
+{
+ return( (getTypeSpecifierKind() == TYPE_CONTINUOUS_TIME_SPECIFIER) ||
+ ( isTypedClockTime() &&
+ ( thisTypeSpecifier()->isnot< ContainerTypeSpecifier >() ||
+ thisTypeSpecifier()->to< ContainerTypeSpecifier >()->
+ getContentsTypeSpecifier().weaklyTypedReal() ) ) );
+}
+
+
+///////////////////
+// INTEGER TYPE
+///////////////////
+
+bool ITypeSpecifier::weaklyTypedUInteger() const
+{
+ return( isTypedUInteger() ||
+ weaklyTypedClockTimeInteger() ||
+ (isTypedInterval() && (thisTypeSpecifier() != NULL) &&
+ thisTypeSpecifier()->as< IntervalTypeSpecifier >()->
+ getSupportTypeSpecifier().weaklyTypedUInteger()) );
+}
+
+bool ITypeSpecifier::weaklyTypedInteger() const
+{
+ return( isTypedInteger() || //isTypedUInteger() ||
+ weaklyTypedClockTimeInteger() ||
+ ( isTypedInterval() && (thisTypeSpecifier() != NULL) &&
+ thisTypeSpecifier()->as< IntervalTypeSpecifier >()->
+ getSupportTypeSpecifier().weaklyTypedInteger() ) );
+}
+
+
+///////////////////
+// RATIONAL TYPE
+///////////////////
+
+bool ITypeSpecifier::weaklyTypedURational() const
+{
+ return( isTypedURational() || weaklyTypedUInteger() ||
+ weaklyTypedClockTimeRational() ||
+ (isTypedInterval() &&
+ thisTypeSpecifier()->as< IntervalTypeSpecifier >()
+ ->getSupportTypeSpecifier().weaklyTypedURational()) );
+}
+
+bool ITypeSpecifier::weaklyTypedRational() const
+{
+ return( isTypedRational() || //isTypedURational() ||
+ weaklyTypedInteger() ||
+ weaklyTypedClockTimeRational() ||
+ ( isTypedInterval() &&
+ thisTypeSpecifier()->as< IntervalTypeSpecifier >()
+ ->getSupportTypeSpecifier().weaklyTypedRational()) );
+}
+
+
+///////////////////
+// FLOAT TYPE
+///////////////////
+
+bool ITypeSpecifier::weaklyTypedUFloat() const
+{
+ return( isTypedUFloat() || weaklyTypedURational() ||
+ weaklyTypedClockTimeFloat() ||
+ ( isTypedInterval() &&
+ thisTypeSpecifier()->as< IntervalTypeSpecifier >()
+ ->getSupportTypeSpecifier().weaklyTypedUFloat()) );
+}
+
+bool ITypeSpecifier::weaklyTypedFloat() const
+{
+ return( isTypedFloat() || weaklyTypedRational() ||
+ weaklyTypedClockTimeFloat() ||
+ ( isTypedInterval() &&
+ thisTypeSpecifier()->as< IntervalTypeSpecifier >()
+ ->getSupportTypeSpecifier().weaklyTypedFloat()) );
+}
+
+
+///////////////////
+// REAL TYPE
+///////////////////
+
+bool ITypeSpecifier::weaklyTypedUReal() const
+{
+ return( isTypedUReal() || weaklyTypedUFloat() || weaklyTypedClockTimeReal() ||
+ (isTypedInterval() && thisTypeSpecifier()->as< IntervalTypeSpecifier >()
+ ->getSupportTypeSpecifier().weaklyTypedUReal()));
+}
+
+bool ITypeSpecifier::weaklyTypedReal() const
+{
+ return( isTypedReal() || weaklyTypedFloat() || weaklyTypedClockTimeReal() ||
+ (isTypedInterval() && thisTypeSpecifier()->as< IntervalTypeSpecifier >()
+ ->getSupportTypeSpecifier().weaklyTypedReal()));
+}
+
+
+//////////////////////////////
+// TYPE ALGEBRA
+//////////////////////////////
+
+bool ITypeSpecifier::isTypeFamily(avm_type_specifier_kind_t typeFamily)
+{
+ if( (getTypeSpecifierKind() == typeFamily) ||
+ (typeFamily == TYPE_UNIVERSAL_SPECIFIER) ||
+ (typeFamily == TYPE_UNDEFINED_SPECIFIER) )
+ {
+ return( true );
+ }
+ else switch( typeFamily )
+ {
+ case TYPE_UNIVERSAL_SPECIFIER:
+ case TYPE_UNDEFINED_SPECIFIER:
+ {
+ return( true );
+ }
+
+ case TYPE_PORT_SPECIFIER:
+ case TYPE_SIGNAL_SPECIFIER:
+ case TYPE_MESSAGE_SPECIFIER:
+ {
+ switch( getTypeSpecifierKind() )
+ {
+ case TYPE_PORT_SPECIFIER:
+ case TYPE_SIGNAL_SPECIFIER:
+ case TYPE_MESSAGE_SPECIFIER:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+
+ return( false );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+bool ITypeSpecifier::weaklyTyped(avm_type_specifier_kind_t otherTSK)
+{
+ if( getTypeSpecifierKind() == otherTSK )
+ {
+ return( true );
+ }
+ else switch( getTypeSpecifierKind() )
+ {
+ case TYPE_POS_INTEGER_SPECIFIER:
+ {
+ return( weaklyTypedUInteger() );
+ }
+ case TYPE_UINTEGER_SPECIFIER:
+ {
+ return( weaklyTypedUInteger() );
+ }
+ case TYPE_INTEGER_SPECIFIER:
+ {
+ return( weaklyTypedInteger() );
+ }
+
+ case TYPE_URATIONAL_SPECIFIER:
+ {
+ return( weaklyTypedURational() );
+ }
+ case TYPE_RATIONAL_SPECIFIER:
+ {
+ return( weaklyTypedRational() );
+ }
+
+ case TYPE_UFLOAT_SPECIFIER:
+ {
+ return( weaklyTypedUFloat() );
+ }
+ case TYPE_FLOAT_SPECIFIER:
+ {
+ return( weaklyTypedFloat() );
+ }
+
+ case TYPE_UREAL_SPECIFIER:
+ {
+ return( weaklyTypedUReal() );
+ }
+ case TYPE_REAL_SPECIFIER:
+ {
+ return( weaklyTypedReal() );
+ }
+
+ case TYPE_CLOCK_SPECIFIER:
+ case TYPE_TIME_SPECIFIER:
+ case TYPE_CONTINUOUS_TIME_SPECIFIER:
+ {
+ return( weaklyTypedReal() );
+ }
+ case TYPE_DISCRETE_TIME_SPECIFIER:
+ {
+ return( weaklyTypedInteger() );
+ }
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+//////////////////////////////
+// NUMERIC TYPE
+//////////////////////////////
+
+bool ITypeSpecifier::isTypedNumeric() const
+{
+ switch( getTypeSpecifierKind() )
+ {
+ case TYPE_INTEGER_SPECIFIER:
+ case TYPE_RATIONAL_SPECIFIER:
+ case TYPE_FLOAT_SPECIFIER:
+ case TYPE_REAL_SPECIFIER:
+
+ case TYPE_POS_INTEGER_SPECIFIER:
+
+ case TYPE_UINTEGER_SPECIFIER:
+ case TYPE_URATIONAL_SPECIFIER:
+ case TYPE_UFLOAT_SPECIFIER:
+ case TYPE_UREAL_SPECIFIER:
+
+ case TYPE_CLOCK_SPECIFIER:
+ case TYPE_TIME_SPECIFIER:
+ case TYPE_CONTINUOUS_TIME_SPECIFIER:
+ case TYPE_DISCRETE_TIME_SPECIFIER:
+ return( true );
+
+ case TYPE_INTERVAL_SPECIFIER:
+ return( thisTypeSpecifier()->as< IntervalTypeSpecifier >()->
+ getSupportTypeSpecifier().isTypedNumeric() );
+
+ default:
+ return( false );
+ }
+}
+
+
+/**
+ * TYPE SPECIFICER KIND TO STRING
+ */
+
+std::string ITypeSpecifier::strSpecifierKind() const
+{
+#define PRINT_TYPE_SPECIFIER_KIND( OBJ ) \
+ case TYPE_##OBJ##_SPECIFIER : return( QUOTEME( TYPE_##OBJ ) )
+
+ switch ( getTypeSpecifierKind() )
+ {
+ PRINT_TYPE_SPECIFIER_KIND( BOOLEAN );
+
+ PRINT_TYPE_SPECIFIER_KIND( CHARACTER );
+
+ PRINT_TYPE_SPECIFIER_KIND( POS_INTEGER );
+
+ PRINT_TYPE_SPECIFIER_KIND( UINTEGER );
+ PRINT_TYPE_SPECIFIER_KIND( INTEGER );
+
+ PRINT_TYPE_SPECIFIER_KIND( URATIONAL );
+ PRINT_TYPE_SPECIFIER_KIND( RATIONAL );
+
+ PRINT_TYPE_SPECIFIER_KIND( UFLOAT );
+ PRINT_TYPE_SPECIFIER_KIND( FLOAT );
+
+ PRINT_TYPE_SPECIFIER_KIND( UREAL );
+ PRINT_TYPE_SPECIFIER_KIND( REAL );
+
+ PRINT_TYPE_SPECIFIER_KIND( CONTINUOUS_TIME );
+ PRINT_TYPE_SPECIFIER_KIND( DISCRETE_TIME );
+
+ PRINT_TYPE_SPECIFIER_KIND( INTERVAL );
+
+ PRINT_TYPE_SPECIFIER_KIND( STRING );
+
+ PRINT_TYPE_SPECIFIER_KIND( IDENTIFIER );
+ PRINT_TYPE_SPECIFIER_KIND( QUALIFIED_IDENTIFIER );
+
+ PRINT_TYPE_SPECIFIER_KIND( BUFFER );
+ PRINT_TYPE_SPECIFIER_KIND( CONNECTOR );
+ PRINT_TYPE_SPECIFIER_KIND( PORT );
+ PRINT_TYPE_SPECIFIER_KIND( MACHINE );
+
+ PRINT_TYPE_SPECIFIER_KIND( OPERATOR );
+
+ PRINT_TYPE_SPECIFIER_KIND( LAMBDA );
+
+ PRINT_TYPE_SPECIFIER_KIND( ARRAY );
+ PRINT_TYPE_SPECIFIER_KIND( CLASS );
+ PRINT_TYPE_SPECIFIER_KIND( ENUM );
+ PRINT_TYPE_SPECIFIER_KIND( UNION );
+
+ PRINT_TYPE_SPECIFIER_KIND( VECTOR );
+ PRINT_TYPE_SPECIFIER_KIND( LIST );
+ PRINT_TYPE_SPECIFIER_KIND( SET );
+ PRINT_TYPE_SPECIFIER_KIND( MULTISET );
+
+ PRINT_TYPE_SPECIFIER_KIND( FIFO );
+ PRINT_TYPE_SPECIFIER_KIND( LIFO );
+ PRINT_TYPE_SPECIFIER_KIND( MULTI_FIFO );
+ PRINT_TYPE_SPECIFIER_KIND( MULTI_LIFO );
+
+ PRINT_TYPE_SPECIFIER_KIND( RAM );
+
+ PRINT_TYPE_SPECIFIER_KIND( ALIAS );
+
+ PRINT_TYPE_SPECIFIER_KIND( UNIVERSAL );
+
+ PRINT_TYPE_SPECIFIER_KIND( NULL );
+
+ PRINT_TYPE_SPECIFIER_KIND( UNDEFINED );
+
+ default : return( "TYPE_UNKNOWN_SPECIFIER" );
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// INTERVAL::KIND
+////////////////////////////////////////////////////////////////////////////////
+
+std::string IIntervalKind::to_string(KIND kind, const BF & inf, const BF & sup)
+{
+ char leftChar;
+ char rightChar;
+
+ switch( kind )
+ {
+ case IIntervalKind::CLOSED:
+ {
+ leftChar = '[';
+ rightChar = ']';
+ break;
+ }
+
+ case IIntervalKind::LOPEN:
+ {
+ leftChar = ']';
+ rightChar = ']';
+ break;
+ }
+
+ case IIntervalKind::ROPEN:
+ {
+ leftChar = '[';
+ rightChar = '[';
+ break;
+ }
+
+ case IIntervalKind::OPEN:
+ default:
+ {
+ leftChar = ']';
+ rightChar = '[';
+ break;
+ }
+ }
+
+ return( OSS() << leftChar << inf.str() << ',' << sup.str() << rightChar );
+}
+
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/lib/ITypeSpecifier.h b/org.eclipse.efm.symbex/src/fml/lib/ITypeSpecifier.h
new file mode 100644
index 0000000..933f9f0
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/lib/ITypeSpecifier.h
@@ -0,0 +1,964 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 27 févr. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef ITYPESPECIFIER_H_
+#define ITYPESPECIFIER_H_
+
+#include <string>
+
+
+namespace sep
+{
+
+class BF;
+
+
+enum TYPE_SPECIFIER
+{
+ ///////////////////
+ // UNDEFINED
+ ///////////////////
+
+ TYPE_UNDEFINED_SPECIFIER,
+
+ //////////////////////////////
+ // PRIMITIVE TYPE
+ //////////////////////////////
+
+ // ENUMERATION
+ TYPE_BOOLEAN_SPECIFIER,
+
+ TYPE_CHARACTER_SPECIFIER,
+
+ TYPE_ENUM_SPECIFIER,
+
+ // STRING
+ TYPE_STRING_SPECIFIER,
+
+ TYPE_IDENTIFIER_SPECIFIER,
+ TYPE_QUALIFIED_IDENTIFIER_SPECIFIER,
+
+ // NUMERIC
+ TYPE_POS_INTEGER_SPECIFIER,
+
+ TYPE_UINTEGER_SPECIFIER,
+
+ TYPE_INTEGER_SPECIFIER,
+
+
+ TYPE_URATIONAL_SPECIFIER,
+
+ TYPE_RATIONAL_SPECIFIER,
+
+
+ TYPE_UFLOAT_SPECIFIER,
+
+ TYPE_FLOAT_SPECIFIER,
+
+
+ TYPE_UREAL_SPECIFIER,
+
+ TYPE_REAL_SPECIFIER,
+
+
+ ///////////////////
+ // CLOCK / TIME TYPE
+ ///////////////////
+
+ TYPE_CLOCK_SPECIFIER,
+
+ TYPE_TIME_SPECIFIER,
+
+ TYPE_CONTINUOUS_TIME_SPECIFIER,
+
+ TYPE_DISCRETE_TIME_SPECIFIER,
+
+
+ ///////////////////
+ // INTERVAL TYPE
+ ///////////////////
+
+ TYPE_INTERVAL_SPECIFIER,
+
+
+ //////////////////////////////
+ // TABLE STRUCTURE
+ //////////////////////////////
+
+ // ARRAY
+ TYPE_ARRAY_SPECIFIER,
+
+ // BUILTIN ARRAY
+// TYPE_ARRAY_BOOLEAN_SPECIFIER,
+// TYPE_ARRAY_CHARACTER_SPECIFIER,
+// TYPE_ARRAY_INTEGER_SPECIFIER,
+// TYPE_ARRAY_FLOAT_SPECIFIER,
+//
+// TYPE_ARRAY_STRING_SPECIFIER,
+// TYPE_ARRAY_IDENTIFIER_SPECIFIER,
+// TYPE_ARRAY_UFI_SPECIFIER,
+// TYPE_ARRAY_ENUM_SPECIFIER,
+//
+// TYPE_ARRAY_FORM_SPECIFIER,
+
+
+ //////////////////////////////
+ // CONTAINER TYPE
+ //////////////////////////////
+
+ TYPE_FIFO_SPECIFIER,
+
+ TYPE_LIFO_SPECIFIER,
+
+
+ TYPE_MULTI_FIFO_SPECIFIER,
+
+ TYPE_MULTI_LIFO_SPECIFIER,
+
+
+ TYPE_RAM_SPECIFIER,
+
+
+ TYPE_VECTOR_SPECIFIER,
+
+ TYPE_REVERSE_VECTOR_SPECIFIER,
+
+ TYPE_LIST_SPECIFIER,
+
+ TYPE_SET_SPECIFIER,
+
+ TYPE_MULTISET_SPECIFIER,
+
+ //////////////////////////////
+ // LAMBDA TYPE
+ //////////////////////////////
+
+ TYPE_LAMBDA_SPECIFIER,
+
+
+ //////////////////////////////
+ // COMPOSITE TYPE
+ //////////////////////////////
+
+ // USER CLASS STRUCTURE
+ TYPE_CLASS_SPECIFIER,
+
+ // USER UNION STRUCTURE
+ TYPE_UNION_SPECIFIER,
+
+ // USER CHOICE STRUCTURE
+ TYPE_CHOICE_SPECIFIER,
+
+
+
+ ///////////////////
+ // XLIA FORM TYPE
+ ///////////////////
+
+ // OPERATOR
+ TYPE_OPERATOR_SPECIFIER,
+
+ // AVMCODE
+ TYPE_AVMCODE_SPECIFIER,
+
+ // CHANNEL
+ TYPE_CHANNEL_SPECIFIER,
+
+ // PORT
+ TYPE_PORT_SPECIFIER,
+
+ // MESSAGE
+ TYPE_MESSAGE_SPECIFIER,
+
+ // SIGNAL
+ TYPE_SIGNAL_SPECIFIER,
+
+ // BUFFER
+ TYPE_BUFFER_SPECIFIER,
+
+ // CONNECT
+ TYPE_CONNECTOR_SPECIFIER,
+
+ // MACHINE
+ TYPE_MACHINE_SPECIFIER,
+
+
+ ///////////////////
+ // ALIAS TYPEDEF
+ ///////////////////
+
+ TYPE_ALIAS_SPECIFIER,
+
+
+ ///////////////////
+ // UNIVERSAL TYPE
+ ///////////////////
+
+ TYPE_UNIVERSAL_SPECIFIER,
+
+
+ ///////////////////
+ // NULL TYPE
+ ///////////////////
+
+ TYPE_NULL_SPECIFIER,
+
+
+};
+
+
+//typedef std::uint64_t avm_type_specifier_kind_t;
+typedef TYPE_SPECIFIER avm_type_specifier_kind_t;
+
+
+class BaseTypeSpecifier;
+
+
+
+class ITypeSpecifier
+{
+
+
+public:
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ITypeSpecifier()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER
+ */
+
+ virtual const BaseTypeSpecifier * thisTypeSpecifier() const = 0;
+
+ virtual avm_type_specifier_kind_t getTypeSpecifierKind() const = 0;
+
+
+ //////////////////////////////
+ // TYPE ALGEBRA
+ //////////////////////////////
+
+ inline bool isTyped(avm_type_specifier_kind_t otherTSK)
+ {
+ return( getTypeSpecifierKind() == otherTSK );
+ }
+
+ bool isTypeFamily(avm_type_specifier_kind_t typeFamily);
+
+ bool weaklyTyped(avm_type_specifier_kind_t otherTSK);
+
+
+ //////////////////////////////
+ // PRIMITIVE TYPE
+ //////////////////////////////
+
+ inline bool isTypedEnumeration() const
+ {
+ switch( getTypeSpecifierKind() )
+ {
+ case TYPE_BOOLEAN_SPECIFIER:
+ case TYPE_CHARACTER_SPECIFIER:
+ case TYPE_ENUM_SPECIFIER:
+ return( true );
+
+ default:
+ return( false );
+ }
+ }
+
+ inline bool isTypedBoolean() const
+ {
+ return( getTypeSpecifierKind() == TYPE_BOOLEAN_SPECIFIER );
+ }
+
+ inline bool isTypedCharacter() const
+ {
+ return( getTypeSpecifierKind() == TYPE_CHARACTER_SPECIFIER );
+ }
+
+ inline bool isTypedString() const
+ {
+ return( getTypeSpecifierKind() == TYPE_STRING_SPECIFIER );
+ }
+
+ inline bool isTypedEnum() const
+ {
+ return( getTypeSpecifierKind() == TYPE_ENUM_SPECIFIER );
+ }
+
+
+ inline bool isTypedIdentifier() const
+ {
+ return( getTypeSpecifierKind() == TYPE_IDENTIFIER_SPECIFIER );
+ }
+
+ inline bool isTypedQualifiedIdentifier() const
+ {
+ return( getTypeSpecifierKind() == TYPE_QUALIFIED_IDENTIFIER_SPECIFIER );
+ }
+
+ inline bool weaklyTypedIdentifier() const
+ {
+ return( (getTypeSpecifierKind() == TYPE_IDENTIFIER_SPECIFIER)
+ || (getTypeSpecifierKind() == TYPE_QUALIFIED_IDENTIFIER_SPECIFIER) );
+ }
+
+
+ bool isTypedNumeric() const;
+
+
+ ///////////////////
+ // CLOCK TYPE
+ ///////////////////
+
+ inline bool hasTypedClock() const
+ {
+ return( isTypedClock() );
+ }
+
+ inline bool isTypedClock() const
+ {
+ return( getTypeSpecifierKind() == TYPE_CLOCK_SPECIFIER );
+ }
+
+ bool weaklyTypedClockInteger() const;
+
+ bool weaklyTypedClockRational() const;
+
+ bool weaklyTypedClockFloat() const;
+
+ bool weaklyTypedClockReal() const;
+
+
+ ///////////////////
+ // TIME TYPE
+ ///////////////////
+
+ inline bool hasTypedTime() const
+ {
+ return( (getTypeSpecifierKind() == TYPE_TIME_SPECIFIER)
+ || (getTypeSpecifierKind() == TYPE_DISCRETE_TIME_SPECIFIER)
+ || (getTypeSpecifierKind() == TYPE_CONTINUOUS_TIME_SPECIFIER) );
+ }
+
+ inline bool isTypedTime() const
+ {
+ return( getTypeSpecifierKind() == TYPE_TIME_SPECIFIER );
+ }
+
+ bool isTypedContinuousTime() const
+ {
+ return( getTypeSpecifierKind() == TYPE_CONTINUOUS_TIME_SPECIFIER );
+ }
+
+ bool isTypedDiscreteTime() const
+ {
+ return( getTypeSpecifierKind() == TYPE_DISCRETE_TIME_SPECIFIER );
+ }
+
+ bool weaklyTypedTimeInteger() const;
+
+ bool weaklyTypedTimeFloat() const;
+
+ bool weaklyTypedTimeRational() const;
+
+ bool weaklyTypedTimeReal() const;
+
+
+ ///////////////////
+ // CLOCK/TIME TYPE
+ ///////////////////
+
+ inline bool hasTypedClockTime() const
+ {
+ return( hasTypedClock() || hasTypedTime() );
+ }
+
+ inline bool isTypedClockTime() const
+ {
+ return( isTypedClock() || isTypedTime() );
+ }
+
+ bool weaklyTypedClockTimeInteger() const;
+
+ bool weaklyTypedClockTimeRational() const;
+
+ bool weaklyTypedClockTimeFloat() const;
+
+ bool weaklyTypedClockTimeReal() const;
+
+
+
+ ///////////////////
+ // INTEGER TYPE
+ ///////////////////
+
+ inline bool isTypedPosInteger() const
+ {
+ return( getTypeSpecifierKind() == TYPE_POS_INTEGER_SPECIFIER );
+ }
+
+ inline bool isTypedUInteger() const
+ {
+ return( (getTypeSpecifierKind() == TYPE_UINTEGER_SPECIFIER)
+ || isTypedPosInteger() );
+ }
+
+ bool weaklyTypedUInteger() const;
+
+ inline bool isTypedInteger() const
+ {
+ return( (getTypeSpecifierKind() == TYPE_INTEGER_SPECIFIER)
+ || isTypedUInteger() );
+ }
+
+ bool weaklyTypedInteger() const;
+
+
+ ///////////////////
+ // RATIONAL TYPE
+ ///////////////////
+
+ inline bool isTypedURational() const
+ {
+ return( getTypeSpecifierKind() == TYPE_URATIONAL_SPECIFIER );
+ }
+
+ bool weaklyTypedURational() const;
+
+ inline bool isTypedRational() const
+ {
+ return( (getTypeSpecifierKind() == TYPE_RATIONAL_SPECIFIER)
+ || isTypedURational() );
+ }
+
+ bool weaklyTypedRational() const;
+
+
+ ///////////////////
+ // FLOAT TYPE
+ ///////////////////
+
+ inline bool isTypedUFloat() const
+ {
+ return( getTypeSpecifierKind() == TYPE_UFLOAT_SPECIFIER );
+ }
+
+ bool weaklyTypedUFloat() const;
+
+ inline bool isTypedFloat() const
+ {
+ return( (getTypeSpecifierKind() == TYPE_FLOAT_SPECIFIER)
+ || isTypedUFloat() );
+ }
+
+ bool weaklyTypedFloat() const;
+
+
+ ///////////////////
+ // REAL TYPE
+ ///////////////////
+
+ inline bool isTypedUReal() const
+ {
+ return( getTypeSpecifierKind() == TYPE_UREAL_SPECIFIER );
+ }
+
+ bool weaklyTypedUReal() const;
+
+ inline bool isTypedReal() const
+ {
+ return( (getTypeSpecifierKind() == TYPE_REAL_SPECIFIER)
+ || isTypedUReal() );
+ }
+
+ bool weaklyTypedReal() const;
+
+
+ ///////////////////
+ // INTERVAL TYPE
+ ///////////////////
+
+ inline bool isTypedInterval() const
+ {
+ return( getTypeSpecifierKind() == TYPE_INTERVAL_SPECIFIER );
+ }
+
+
+
+ ///////////////////
+ // XKIA FORM TYPE
+ ///////////////////
+
+ inline bool isTypedOperator() const
+ {
+ return( getTypeSpecifierKind() == TYPE_OPERATOR_SPECIFIER );
+ }
+
+ inline bool isTypedAvmcode() const
+ {
+ return( getTypeSpecifierKind() == TYPE_AVMCODE_SPECIFIER );
+ }
+
+ inline bool isTypedChannel() const
+ {
+ return( getTypeSpecifierKind() == TYPE_CHANNEL_SPECIFIER );
+ }
+
+ inline bool isTypedPort() const
+ {
+ return( getTypeSpecifierKind() == TYPE_PORT_SPECIFIER );
+ }
+
+ inline bool isTypedMessage() const
+ {
+ return( getTypeSpecifierKind() == TYPE_MESSAGE_SPECIFIER );
+ }
+
+ inline bool isTypedSignal() const
+ {
+ return( getTypeSpecifierKind() == TYPE_SIGNAL_SPECIFIER );
+ }
+
+ inline bool isTypedBuffer() const
+ {
+ return( getTypeSpecifierKind() == TYPE_BUFFER_SPECIFIER );
+ }
+
+ inline bool isTypedConnection() const
+ {
+ return( getTypeSpecifierKind() == TYPE_CONNECTOR_SPECIFIER );
+ }
+
+ inline bool isTypedMachine() const
+ {
+ return( getTypeSpecifierKind() == TYPE_MACHINE_SPECIFIER );
+ }
+
+
+ inline bool hasTypeXliaForm() const
+ {
+ switch( getTypeSpecifierKind() )
+ {
+ case TYPE_OPERATOR_SPECIFIER:
+ case TYPE_AVMCODE_SPECIFIER:
+ case TYPE_PORT_SPECIFIER:
+ case TYPE_BUFFER_SPECIFIER:
+ case TYPE_SIGNAL_SPECIFIER:
+ case TYPE_CONNECTOR_SPECIFIER:
+ case TYPE_MACHINE_SPECIFIER:
+ return( true );
+
+ default:
+ return( false );
+ }
+ }
+
+
+ //////////////////////////////
+ // ARRAY TYPE
+ //////////////////////////////
+
+ inline bool isTypedArray() const
+ {
+ return( getTypeSpecifierKind() == TYPE_ARRAY_SPECIFIER );
+ }
+
+
+ //////////////////////////////
+ // CONTAINER TYPE
+ //////////////////////////////
+
+ inline bool isTypedVector() const
+ {
+ return( getTypeSpecifierKind() == TYPE_VECTOR_SPECIFIER );
+ }
+
+ inline bool isTypedReverseVector() const
+ {
+ return( getTypeSpecifierKind() == TYPE_REVERSE_VECTOR_SPECIFIER );
+ }
+
+ inline bool hasTypeVector() const
+ {
+ switch( getTypeSpecifierKind() )
+ {
+ case TYPE_VECTOR_SPECIFIER:
+ case TYPE_REVERSE_VECTOR_SPECIFIER:
+ return( true );
+
+ default:
+ return( false );
+ }
+ }
+
+
+ inline bool isTypedList() const
+ {
+ return( getTypeSpecifierKind() == TYPE_LIST_SPECIFIER );
+ }
+
+ inline bool isTypedSet() const
+ {
+ return( getTypeSpecifierKind() == TYPE_SET_SPECIFIER );
+ }
+
+ inline bool isTypedMultiset() const
+ {
+ return( getTypeSpecifierKind() == TYPE_MULTISET_SPECIFIER );
+ }
+
+
+ inline bool isTypedFifo() const
+ {
+ return( getTypeSpecifierKind() == TYPE_FIFO_SPECIFIER );
+ }
+
+ inline bool isTypedLifo() const
+ {
+ return( getTypeSpecifierKind() == TYPE_LIFO_SPECIFIER );
+ }
+
+
+ inline bool isTypedMultiFifo() const
+ {
+ return( getTypeSpecifierKind() == TYPE_MULTI_FIFO_SPECIFIER );
+ }
+
+ inline bool isTypedMultiLifo() const
+ {
+ return( getTypeSpecifierKind() == TYPE_MULTI_LIFO_SPECIFIER );
+ }
+
+
+ inline bool isTypedRam() const
+ {
+ return( getTypeSpecifierKind() == TYPE_RAM_SPECIFIER );
+ }
+
+
+ inline bool hasTypeArrayVector() const
+ {
+ switch( getTypeSpecifierKind() )
+ {
+ case TYPE_ARRAY_SPECIFIER:
+ case TYPE_VECTOR_SPECIFIER:
+ case TYPE_REVERSE_VECTOR_SPECIFIER:
+ return( true );
+
+ default:
+ return( false );
+ }
+ }
+
+ inline bool hasTypeQueue() const
+ {
+ switch( getTypeSpecifierKind() )
+ {
+ case TYPE_FIFO_SPECIFIER:
+ case TYPE_LIFO_SPECIFIER:
+
+ case TYPE_MULTI_FIFO_SPECIFIER:
+ case TYPE_MULTI_LIFO_SPECIFIER:
+
+ case TYPE_RAM_SPECIFIER:
+ return( true );
+
+ default:
+ return( false );
+ }
+ }
+
+
+ inline bool hasTypeListCollection() const
+ {
+ switch( getTypeSpecifierKind() )
+ {
+ case TYPE_LIST_SPECIFIER:
+ case TYPE_SET_SPECIFIER:
+ case TYPE_MULTISET_SPECIFIER:
+ return( true );
+
+ default:
+ return( hasTypeQueue() );
+ }
+ }
+
+ inline bool hasTypeCollection() const
+ {
+ return( hasTypeVector() || hasTypeListCollection() );
+ }
+
+ inline bool hasTypeContainer() const
+ {
+ return( isTypedArray() || hasTypeCollection() );
+ }
+
+
+ //////////////////////////////
+ // COMPOSITE TYPE
+ //////////////////////////////
+
+ inline bool isTypedStructure() const
+ {
+ return( getTypeSpecifierKind() == TYPE_CLASS_SPECIFIER );
+ }
+
+ inline bool isTypedClass() const
+ {
+ return( getTypeSpecifierKind() == TYPE_CLASS_SPECIFIER );
+ }
+
+
+ inline bool isTypedChoice() const
+ {
+ return( getTypeSpecifierKind() == TYPE_CHOICE_SPECIFIER );
+ }
+
+ inline bool isTypedUnion() const
+ {
+ return( getTypeSpecifierKind() == TYPE_UNION_SPECIFIER );
+ }
+
+ inline bool hasTypeChoiceOrUnion() const
+ {
+ return( (getTypeSpecifierKind() == TYPE_CHOICE_SPECIFIER)
+ || (getTypeSpecifierKind() == TYPE_UNION_SPECIFIER) );
+ }
+
+ inline bool hasTypeStructureOrChoiceOrUnion() const
+ {
+ return( (getTypeSpecifierKind() == TYPE_CLASS_SPECIFIER )
+ || (getTypeSpecifierKind() == TYPE_CHOICE_SPECIFIER )
+ || (getTypeSpecifierKind() == TYPE_UNION_SPECIFIER) );
+ }
+
+
+ //////////////////////////////
+ // LAMBDA TYPE
+ //////////////////////////////
+
+ inline bool isTypedLambda() const
+ {
+ return( getTypeSpecifierKind() == TYPE_LAMBDA_SPECIFIER );
+ }
+
+
+ //////////////////////////////
+ // ALIAS TYPE
+ //////////////////////////////
+
+ inline bool isTypedAlias() const
+ {
+ return( getTypeSpecifierKind() == TYPE_ALIAS_SPECIFIER );
+ }
+
+
+ //////////////////////////////
+ // UNIVERSAL TYPE
+ //////////////////////////////
+
+ inline bool isTypedUniversal() const
+ {
+ return( getTypeSpecifierKind() == TYPE_UNIVERSAL_SPECIFIER );
+ }
+
+
+ //////////////////////////////
+ // CATEGORY TYPE
+ //////////////////////////////
+
+ inline bool hasTypePrimitive() const
+ {
+ switch( getTypeSpecifierKind() )
+ {
+ case TYPE_BOOLEAN_SPECIFIER:
+ case TYPE_CHARACTER_SPECIFIER:
+ case TYPE_STRING_SPECIFIER:
+
+ case TYPE_INTEGER_SPECIFIER:
+ case TYPE_RATIONAL_SPECIFIER:
+ case TYPE_FLOAT_SPECIFIER:
+ case TYPE_REAL_SPECIFIER:
+
+ case TYPE_POS_INTEGER_SPECIFIER:
+
+ case TYPE_UINTEGER_SPECIFIER:
+ case TYPE_URATIONAL_SPECIFIER:
+ case TYPE_UFLOAT_SPECIFIER:
+ case TYPE_UREAL_SPECIFIER:
+
+ case TYPE_CLOCK_SPECIFIER:
+ case TYPE_TIME_SPECIFIER:
+ case TYPE_CONTINUOUS_TIME_SPECIFIER:
+ case TYPE_DISCRETE_TIME_SPECIFIER:
+ return( true );
+
+ default:
+ return( false );
+ }
+ }
+
+ inline bool hasTypeBasic() const
+ {
+ return( isTypedBoolean() || isTypedNumeric() ||
+ isTypedCharacter() || isTypedString() ||
+ hasTypeXliaForm() );
+ }
+
+ inline bool hasTypeSimple() const
+ {
+ return( hasTypeBasic() || isTypedEnum() );
+ }
+
+ inline bool hasTypeSimpleOrCollection() const
+ {
+ return( hasTypeSimple() || hasTypeCollection() );
+ }
+
+ inline bool hasTypeArrayOrStructure() const
+ {
+ return( isTypedArray() || isTypedStructure() );
+ }
+
+ inline bool hasTypeComposite() const
+ {
+ return( hasTypeContainer() || isTypedStructure() );
+ }
+
+
+ inline bool hasTypeEnumOrComposite() const
+ {
+ return( isTypedEnum() || hasTypeComposite() );
+ }
+
+
+ /**
+ * Serialization
+ */
+ std::string strSpecifierKind() const;
+
+};
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// INTERVAL::KIND
+////////////////////////////////////////////////////////////////////////////////
+
+class IIntervalKind
+{
+
+public:
+
+ enum KIND
+ {
+ CLOSED = 0x00,
+
+ LOPEN = 0x01,
+
+ ROPEN = 0x02,
+
+ OPEN = 0x03,
+ };
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~IIntervalKind()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * API
+ */
+ virtual KIND getIntervalKind() const = 0;
+
+
+ inline bool isCLOSED()const
+ {
+ return( getIntervalKind() == CLOSED );
+ }
+
+ inline bool isLOPEN()const
+ {
+ return( getIntervalKind() == LOPEN );
+ }
+
+ inline bool isROPEN()const
+ {
+ return( getIntervalKind() == ROPEN );
+ }
+
+ inline bool isOPEN()const
+ {
+ return( getIntervalKind() == OPEN );
+ }
+
+
+ inline bool isLClosed()const
+ {
+ return( (getIntervalKind() & LOPEN) == 0 );
+ }
+
+ inline bool isLOpen()const
+ {
+ return( (getIntervalKind() & LOPEN) != 0 );
+ }
+
+ inline bool isRClosed()const
+ {
+ return( (getIntervalKind() & ROPEN) == 0 );
+ }
+
+ inline bool isROpen()const
+ {
+ return( (getIntervalKind() & ROPEN) != 0 );
+ }
+
+
+ /**
+ * STATIC
+ */
+ /**
+ * Compute interval nature
+ */
+ inline static KIND computeKind(char left, char right)
+ {
+ bool lOpen = (left == ']') || (left == '(') || (left == ')');
+ bool rOpen = (left == '[') || (left == ')') || (left == '(');
+
+ return( lOpen ?
+ ( rOpen ? IIntervalKind::OPEN : IIntervalKind::LOPEN ) :
+ ( rOpen ? IIntervalKind::ROPEN : IIntervalKind::CLOSED ) );
+ }
+
+
+ static std::string to_string(KIND kind, const BF & inf, const BF & sup);
+
+};
+
+
+} /* namespace sep */
+#endif /* ITYPESPECIFIER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/numeric/Float.cpp b/org.eclipse.efm.symbex/src/fml/numeric/Float.cpp
new file mode 100644
index 0000000..e94af70
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/numeric/Float.cpp
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "Float.h"
+
+
+namespace sep
+{
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/numeric/Float.h b/org.eclipse.efm.symbex/src/fml/numeric/Float.h
new file mode 100644
index 0000000..a9686cb
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/numeric/Float.h
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef FML_EXPRESSION_FLOAT_H_
+#define FML_EXPRESSION_FLOAT_H_
+
+#if defined( _AVM_BUILTIN_NUMERIC_GMP_ )
+
+#include <fml/numeric/gmp/FloatImpl.h>
+
+#elif defined( _AVM_BUILTIN_NUMERIC_BOOST_ )
+
+#include <fml/numeric/boost/FloatImpl.h>
+
+#else
+
+#include <fml/numeric/basic/FloatImpl.h>
+
+#endif /* _AVM_BUILTIN_NUMERIC_GMP_ */
+
+
+namespace sep
+{
+
+
+}
+
+#endif /*FML_EXPRESSION_FLOAT_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/numeric/Integer.cpp b/org.eclipse.efm.symbex/src/fml/numeric/Integer.cpp
new file mode 100644
index 0000000..5bb7d4c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/numeric/Integer.cpp
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "Integer.h"
+
+
+namespace sep
+{
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/numeric/Integer.h b/org.eclipse.efm.symbex/src/fml/numeric/Integer.h
new file mode 100644
index 0000000..fe083c6
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/numeric/Integer.h
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef FML_EXPRESSION_INTEGER_H_
+#define FML_EXPRESSION_INTEGER_H_
+
+#if defined( _AVM_BUILTIN_NUMERIC_GMP_ )
+
+#include <fml/numeric/gmp/IntegerImpl.h>
+
+#elif defined( _AVM_BUILTIN_NUMERIC_BOOST_ )
+
+#include <fml/numeric/boost/IntegerImpl.h>
+
+#else
+
+#include <fml/numeric/basic/IntegerImpl.h>
+
+#endif /* _AVM_BUILTIN_NUMERIC_GMP_ */
+
+
+
+namespace sep
+{
+
+
+}
+
+#endif /*FML_EXPRESSION_INTEGER_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/numeric/Number.cpp b/org.eclipse.efm.symbex/src/fml/numeric/Number.cpp
new file mode 100644
index 0000000..9f72718
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/numeric/Number.cpp
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 mars 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "Number.h"
+
+namespace sep
+{
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/numeric/Number.h b/org.eclipse.efm.symbex/src/fml/numeric/Number.h
new file mode 100644
index 0000000..e767633
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/numeric/Number.h
@@ -0,0 +1,408 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 mars 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef FML_EXPRESSION_NUMBER_H_
+#define FML_EXPRESSION_NUMBER_H_
+
+#include <fml/builtin/BuiltinForm.h>
+
+
+namespace sep
+{
+
+class Number : public BuiltinForm ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( Number )
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Number(class_kind_t aClassKind)
+ : BuiltinForm( aClassKind )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ Number(const Number & aNumber)
+ : BuiltinForm( aNumber )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Number()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * SIGN TESTS
+ */
+ virtual int sign() const = 0;
+
+
+ inline virtual bool isPositive() const
+ {
+ return( sign() >= 0 );
+ }
+
+ inline virtual bool strictlyPositive() const
+ {
+ return( sign() > 0 );
+ }
+
+
+ inline virtual bool isNegative() const
+ {
+ return( sign() <= 0 );
+ }
+
+ inline virtual bool strictlyNegative() const
+ {
+ return( sign() < 0 );
+ }
+
+
+ /**
+ * BASICS TESTS
+ */
+ virtual bool isZero() const = 0;
+
+ virtual bool isOne() const = 0;
+
+ virtual bool isNegativeOne() const = 0;
+
+
+ /**
+ * CONVERSION
+ */
+ virtual bool isInt32() const = 0;
+ virtual avm_int32_t toInt32() const = 0;
+
+ virtual bool isInt64() const = 0;
+ virtual avm_int64_t toInt64() const = 0;
+
+
+ virtual bool isInteger() const = 0;
+ virtual avm_integer_t toInteger() const = 0;
+
+ virtual bool isUInteger() const = 0;
+ virtual avm_uinteger_t toUInteger() const = 0;
+
+
+ virtual bool isRational() const = 0;
+ virtual avm_integer_t toDenominator() const = 0;
+ virtual avm_integer_t toNumerator() const = 0;
+
+
+ virtual bool isFloat() const = 0;
+ virtual avm_float_t toFloat() const = 0;
+
+ virtual bool isReal() const = 0;
+ virtual avm_real_t toReal() const = 0;
+
+
+// /**
+// * INCREMENT
+// * DECREMENT
+// */
+// virtual void addExpr(avm_integer_t aValue = 1) = 0;
+// virtual void minExpr(avm_integer_t aValue = 1) = 0;
+//
+// /**
+// * uminus
+// */
+// virtual void uminus() = 0;
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// GENERIC BUILTIN FORM
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+template< typename Value_T , class Class_T >
+class GenericNumberClass
+{
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ Value_T mValue;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ GenericNumberClass(const Value_T & aValue)
+ : mValue( aValue )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ GenericNumberClass(const GenericNumberClass & aNumber)
+ : mValue( aNumber.mValue )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~GenericNumberClass()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mValue
+ */
+ inline Value_T & getValue()
+ {
+ return( mValue );
+ }
+
+ inline const Value_T & getValue() const
+ {
+ return( mValue );
+ }
+
+ inline void setValue(Value_T aValue)
+ {
+ mValue = aValue;
+ }
+
+
+ /**
+ * INCREMENT
+ * DECREMENT
+ */
+#ifdef _AVM_NEED_INT64_T_OVERLOADS_
+
+ void addExpr(avm_integer_t aValue = 1)
+ {
+ mValue = (mValue + static_cast< long >( aValue ));
+ }
+
+ void minExpr(avm_integer_t aValue = 1)
+ {
+ mValue = (mValue - static_cast< long >( aValue ));
+ }
+
+#else
+
+ void addExpr(avm_integer_t aValue = 1)
+ {
+ mValue = (mValue + aValue);
+ }
+
+ void minExpr(avm_integer_t aValue = 1)
+ {
+ mValue = (mValue - aValue);
+ }
+
+#endif /* _AVM_NEED_INT64_T_OVERLOADS_ */
+
+
+ /**
+ * uminus
+ */
+ void uminus()
+ {
+ mValue = (- mValue);
+ }
+
+
+ /**
+ * ASSIGN
+ * OPERATOR
+ */
+ template< class Number_T >
+ Class_T & operator=(const Number_T & x)
+ {
+ if( this == &x )
+ {
+ return *this;
+ }
+
+ mValue = x.mValue;
+
+ return( *this );
+ }
+
+
+ template< class Number_T >
+ Class_T & operator+=(const Number_T & other)
+ {
+ mValue += other.mValue;
+
+ return( *this );
+ }
+
+ template< class Number_T >
+ Class_T & operator-=(const Number_T & other)
+ {
+ mValue -= other.mValue;
+
+ return( *this );
+ }
+
+
+ template< class Number_T >
+ Class_T & operator*=(const Number_T & other)
+ {
+ mValue *= other.mValue;
+
+ return( *this );
+ }
+
+ template< class Number_T >
+ Class_T & operator/=(const Number_T & other)
+ {
+ mValue /= other.mValue;
+
+ return( *this );
+ }
+
+
+ /**
+ * ARITHMETIC
+ * OPERATOR
+ */
+ Class_T operator-() const
+ {
+ return( Class_T( - mValue ) );
+ }
+
+ template< class Number_T >
+ Class_T operator+(const Number_T & other) const
+ {
+ return( Class_T( mValue + other.mValue ) );
+ }
+
+ template< class Number_T >
+ Class_T operator-(const Number_T & other) const
+ {
+ return( Class_T( mValue - other.mValue ) );
+ }
+
+
+ template< class Number_T >
+ Class_T operator*(const Number_T & other) const
+ {
+ return( Class_T( mValue * other.mValue ) );
+ }
+
+ template< class Number_T >
+ Class_T operator/(const Number_T & other) const
+ {
+ return( Class_T( mValue / other.mValue ) );
+ }
+
+
+ /**
+ * COMPARISON
+ * OPERATOR
+ */
+ // EQUAL
+ template< class Number_T >
+ inline bool operator==(const Number_T & other) const
+ {
+ return( mValue == other.mValue );
+ }
+
+ template< class Number_T >
+ inline bool isEQ(const Number_T & other) const
+ {
+ return( mValue == other.mValue );
+ }
+
+
+ // NOT EQUAL
+ template< class Number_T >
+ inline bool operator!=(const Number_T & other) const
+ {
+ return( mValue != other.mValue );
+ }
+
+ template< class Number_T >
+ inline bool isNEQ(const Number_T & other) const
+ {
+ return( mValue != other.mValue );
+ }
+
+
+ // COMPARE
+ template< class Number_T >
+ inline int compare(const Number_T & other) const
+ {
+ return( (mValue < other.getValue()) ? -1 :
+ (mValue == other.getValue()) ? 0 : 1 );
+ }
+
+
+ // < <= > >=
+ template< class Number_T >
+ bool operator< (const Number_T & other) const
+ {
+ return( mValue < other.mValue );
+ }
+
+ template< class Number_T >
+ bool operator<=(const Number_T & other) const
+ {
+ return( mValue <= other.mValue );
+ }
+
+ template< class Number_T >
+ bool operator> (const Number_T & other) const
+ {
+ return( mValue > other.mValue );
+ }
+
+ template< class Number_T >
+ bool operator>=(const Number_T & other) const
+ {
+ return( mValue >= other.mValue );
+ }
+
+};
+
+
+} /* namespace sep */
+#endif /* FML_EXPRESSION_NUMBER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/numeric/Numeric.cpp b/org.eclipse.efm.symbex/src/fml/numeric/Numeric.cpp
new file mode 100644
index 0000000..665a61c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/numeric/Numeric.cpp
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 1 mars 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "Numeric.h"
+
+
+namespace sep
+{
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/numeric/Numeric.h b/org.eclipse.efm.symbex/src/fml/numeric/Numeric.h
new file mode 100644
index 0000000..4018e01
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/numeric/Numeric.h
@@ -0,0 +1,1510 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 1 mars 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef FML_EXPRESSION_NUMERIC_H_
+#define FML_EXPRESSION_NUMERIC_H_
+
+#include <base/ClassKindInfo.h>
+#include <base/SmartPointer.h>
+#include <fml/numeric/Number.h>
+
+#include <util/avm_assert.h>
+#include <common/BF.h>
+
+
+#if defined( _AVM_BUILTIN_NUMERIC_GMP_ )
+
+#include <fml/numeric/gmp/NumericImpl.h>
+
+#elif defined( _AVM_BUILTIN_NUMERIC_BOOST_ )
+
+#include <fml/numeric/boost/NumericImpl.h>
+
+#else
+
+#include <fml/numeric/basic/NumericImpl.h>
+
+#endif /* _AVM_BUILTIN_NUMERIC_GMP_ */
+
+
+#include <fml/numeric/Integer.h>
+#include <fml/numeric/Rational.h>
+#include <fml/numeric/Float.h>
+
+
+namespace sep
+{
+
+
+class Operator;
+
+
+class Numeric :
+ public SmartPointer< Number , DestroyElementPolicy >,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( Numeric )
+{
+
+private:
+ /**
+ * TYPEDEF
+ */
+ typedef SmartPointer< Number , DestroyElementPolicy > base_this_type;
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Numeric()
+ : base_this_type( )
+ {
+ //!! NOTHING
+ }
+
+ Numeric(Number * aNumber)
+ : base_this_type( aNumber )
+ {
+ //!! NOTHING
+ }
+
+
+ Numeric(const Integer & aNumber)
+ : base_this_type( new Integer(aNumber) )
+ {
+ //!! NOTHING
+ }
+
+ Numeric(Integer * aNumber)
+ : base_this_type( aNumber )
+ {
+ //!! NOTHING
+ }
+
+ Numeric(const Rational & aNumber)
+ : base_this_type( new Rational(aNumber) )
+ {
+ //!! NOTHING
+ }
+
+ Numeric(Rational * aNumber)
+ : base_this_type( aNumber )
+ {
+ //!! NOTHING
+ }
+
+
+ Numeric(const Float & aNumber)
+ : base_this_type( new Float(aNumber) )
+ {
+ //!! NOTHING
+ }
+
+ Numeric(Float * aNumber)
+ : base_this_type( aNumber )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Builtin
+ */
+// // avm_int8_t
+// Numeric(avm_int8_t aNumber)
+// : base_this_type( new Integer( aNumber ) )
+// {
+// //!! NOTHING
+// }
+//
+// // avm_uint8_t
+// Numeric(avm_uint8_t aNumber)
+// : base_this_type( new Integer( aNumber ) )
+// {
+// //!! NOTHING
+// }
+//
+// // avm_int16_t
+// Numeric(avm_int16_t aNumber)
+// : base_this_type( new Integer( aNumber ) )
+// {
+// //!! NOTHING
+// }
+//
+// // avm_uint16_t
+// Numeric(avm_uint16_t aNumber)
+// : base_this_type( new Integer( aNumber ) )
+// {
+// //!! NOTHING
+// }
+//
+// // avm_int32_t
+// Numeric(avm_int32_t aNumber)
+// : base_this_type( new Integer( aNumber ) )
+// {
+// //!! NOTHING
+// }
+//
+// // avm_uint32_t
+// Numeric(avm_uint32_t aNumber)
+// : base_this_type( new Integer( aNumber ) )
+// {
+// //!! NOTHING
+// }
+
+ // int
+ Numeric(int aNumber)
+ : base_this_type( new Integer( aNumber ) )
+ {
+ //!! NOTHING
+ }
+
+ // uint32_t
+ Numeric(unsigned int aNumber)
+ : base_this_type( new Integer( aNumber ) )
+ {
+ //!! NOTHING
+ }
+
+#ifdef _AVM_NEED_INT64_T_OVERLOADS_
+
+ // long
+ Numeric(long aNumber)
+ : base_this_type( new Integer( aNumber ) )
+ {
+ //!! NOTHING
+ }
+
+ // unsigned long
+ Numeric(unsigned long aNumber)
+ : base_this_type( new Integer( aNumber ) )
+ {
+ //!! NOTHING
+ }
+
+#endif /* _AVM_NEED_INT64_T_OVERLOADS_ */
+
+ // avm_integer_t i.e. avm_int64_t
+ Numeric(avm_integer_t aNumber)
+ : base_this_type( new Integer( aNumber ) )
+ {
+ //!! NOTHING
+ }
+
+ Numeric(avm_uinteger_t aNumber)
+ : base_this_type( new Integer( aNumber ) )
+ {
+ //!! NOTHING
+ }
+
+
+ // Integer / Integer
+ Numeric(const Integer & aNumerator, const Integer & aDenominator)
+ : base_this_type( new Rational(aNumerator, aDenominator) )
+ {
+ //!! NOTHING
+ }
+
+ // avm_integer_t / avm_integer_t i.e. avm_int64_t / avm_int64_t
+ Numeric(avm_integer_t aNumerator, avm_integer_t aDenominator)
+ : base_this_type( new Rational(aNumerator, aDenominator) )
+ {
+ //!! NOTHING
+ }
+
+ // avm_uinteger_t / avm_integer_t i.e. avm_uint64_t / avm_int64_t
+ Numeric(avm_uinteger_t aNumerator, avm_integer_t aDenominator)
+ : base_this_type( new Rational(aNumerator, aDenominator) )
+ {
+ //!! NOTHING
+ }
+
+ // avm_integer_t / avm_uinteger_t i.e. avm_int64_t / avm_uint64_t
+ Numeric(avm_integer_t aNumerator, avm_uinteger_t aDenominator)
+ : base_this_type( new Rational(aNumerator, aDenominator) )
+ {
+ //!! NOTHING
+ }
+
+ // std::string / avm_integer_t i.e. std::string / avm_int64_t
+ Numeric(const std::string & aNumerator, avm_integer_t aDenominator)
+ : base_this_type( new Rational(aNumerator, aDenominator) )
+ {
+ //!! NOTHING
+ }
+
+ // avm_integer_t / std::string i.e. avm_integer_t / std::string
+ Numeric(avm_integer_t aNumerator, const std::string & aDenominator)
+ : base_this_type( new Rational(aNumerator, aDenominator) )
+ {
+ //!! NOTHING
+ }
+
+ // std::string / std::string
+ Numeric(const std::string & aNumerator, const std::string & aDenominator)
+ : base_this_type( new Rational(aNumerator, aDenominator) )
+ {
+ //!! NOTHING
+ }
+
+
+ // float
+ Numeric(float aNumber)
+ : base_this_type( new Float( aNumber ) )
+ {
+ //!! NOTHING
+ }
+
+ // avm_float_t i.e. double
+ Numeric(avm_float_t aNumber)
+ : base_this_type( new Float( aNumber ) )
+ {
+ //!! NOTHING
+ }
+
+ // const std::string &
+ Numeric(const std::string & aNumber)
+ : base_this_type( )
+ {
+ setStringNumber( aNumber );
+ }
+
+ inline void setStringNumber(const std::string & aNumber)
+ {
+ std::string::size_type pos = aNumber.find('/');
+ if( pos != std::string::npos)
+ {
+ release( new Rational(
+ aNumber.substr(0, pos), aNumber.substr(pos+1) ) );
+ }
+ else if( (pos = aNumber.find('.')) != std::string::npos )
+ {
+ release( new Float( aNumber ) );
+
+// replacePointer( new Rational(
+// std::string(aNumber).erase(pos, 1),
+// Integer::pow(10, aNumber.size() - (pos + 1)) ) );
+ }
+ else
+ {
+ release( new Integer( aNumber ) );
+ }
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ Numeric(const Numeric & aNumeric)
+ : base_this_type( aNumeric )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Numeric()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * ACQUIRE POINTER
+ */
+ static Numeric acquire(Number * aNumber)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( aNumber )
+ << "Number in Numeric::acquire() !!!"
+ << SEND_EXIT;
+
+ aNumber->incrRefCount();
+ return( Numeric( aNumber ) );
+ }
+
+ /**
+ * GETTER
+ * ClassKindInfo
+ */
+ inline class_kind_t classKind() const
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "raw_pointer in Numeric::classKind() !!!"
+ << SEND_EXIT;
+
+ return( mPTR->classKind() );
+ }
+
+ inline const std::string & classKindName() const
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "raw_pointer in Numeric::classKindName() !!!"
+ << SEND_EXIT;
+
+ return( mPTR->classKindName() );
+ }
+
+ inline std::string classKindInfo() const
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "raw_pointer in Numeric::classKindInfo() !!!"
+ << SEND_EXIT;
+
+ return( mPTR->classKindInfo() );
+ }
+
+ // Check if Numeric is a handle to a T, including base classes.
+ template<class T >
+ inline bool is() const
+ {
+ return( (mPTR != NULL) && mPTR->is< T >() );
+ }
+
+ template< class T >
+ inline const T & to_ref() const
+ {
+ return( mPTR->to_ref< T >() );
+ }
+
+
+ /**
+ * operator= <expression>
+ */
+ inline Numeric & operator=(const BF & anExpression)
+ {
+ if( mPTR != anExpression.raw_pointer() )
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( anExpression.is< Number >() )
+ << "Invalid Assignment Cast of a <BF> to a <Numeric> !!!"
+ << SEND_EXIT;
+
+ release_acquire( anExpression.to_ptr< Number >() );
+ }
+
+ return( *this );
+ }
+
+ /**
+ * operator=
+ */
+
+ // Integer
+ inline Numeric & operator=(const Integer & aNumber)
+ {
+ return( this->operator=( Numeric( aNumber ) ) );
+ }
+
+ // Rational
+ inline Numeric & operator=(const Rational & aNumber)
+ {
+ return( this->operator=( Numeric( aNumber ) ) );
+ }
+
+ // Float
+ inline Numeric & operator=(const Float & aNumber)
+ {
+ return( this->operator=( Numeric( aNumber ) ) );
+ }
+
+// // avm_int8_t
+// inline Numeric & operator=(avm_int8_t aNumber)
+// {
+// return( this->operator=( Numeric( aNumber ) ) );
+// }
+//
+// // avm_uint8_t
+// inline Numeric & operator=(avm_uint8_t aNumber)
+// {
+// return( this->operator=( Numeric( aNumber ) ) );
+// }
+//
+// // avm_int16_t
+// inline Numeric & operator=(avm_int16_t aNumber)
+// {
+// return( this->operator=( Numeric( aNumber ) ) );
+// }
+//
+// // avm_uint16_t
+// inline Numeric & operator=(avm_uint16_t aNumber)
+// {
+// return( this->operator=( Numeric( aNumber ) ) );
+// }
+//
+// // avm_int32_t
+// inline Numeric & operator=(avm_int32_t aNumber)
+// {
+// return( this->operator=( Numeric( aNumber ) ) );
+// }
+//
+// // avm_uint32_t
+// inline Numeric & operator=(avm_uint32_t aNumber)
+// {
+// return( this->operator=( Numeric( aNumber ) ) );
+// }
+
+ // int
+ inline Numeric & operator=(int aNumber)
+ {
+ return( this->operator=( Numeric( aNumber ) ) );
+ }
+
+ // unsigned int
+ inline Numeric & operator=(unsigned int aNumber)
+ {
+ return( this->operator=( Numeric( aNumber ) ) );
+ }
+
+#ifdef _AVM_NEED_INT64_T_OVERLOADS_
+
+ // long
+ inline Numeric & operator=(long aNumber)
+ {
+ return( this->operator=( Numeric( aNumber ) ) );
+ }
+
+ // unsigned long
+ inline Numeric & operator=(unsigned long aNumber)
+ {
+ return( this->operator=( Numeric( aNumber ) ) );
+ }
+
+#endif /* _AVM_NEED_INT64_T_OVERLOADS_ */
+
+ // avm_integer_t
+ inline Numeric & operator=(avm_integer_t aNumber)
+ {
+ return( this->operator=( Numeric( aNumber ) ) );
+ }
+
+ // avm_uinteger_t
+ inline Numeric & operator=(avm_uinteger_t aNumber)
+ {
+ return( this->operator=( Numeric( aNumber ) ) );
+ }
+
+ // float
+ inline Numeric & operator=(float aNumber)
+ {
+ return( this->operator=( Numeric( aNumber ) ) );
+ }
+
+ // avm_float_t i.e. double
+ inline Numeric & operator=(avm_float_t aNumber)
+ {
+ return( this->operator=( Numeric( aNumber ) ) );
+ }
+
+
+ // const std::string &
+ inline Numeric & operator=(const std::string & aNumber)
+ {
+ return( this->operator=( Numeric( aNumber ) ) );
+ }
+
+
+ /**
+ * SIGN TESTS
+ */
+ inline int sign() const
+ {
+ return( mPTR->sign() );
+ }
+
+
+ inline bool isPositive() const
+ {
+ return( mPTR->isPositive() );
+ }
+
+ inline bool strictlyPositive() const
+ {
+ return( mPTR->strictlyPositive() );
+ }
+
+
+ inline bool isNegative() const
+ {
+ return( mPTR->isNegative() );
+ }
+
+ inline bool strictlyNegative() const
+ {
+ return( mPTR->strictlyNegative() );
+ }
+
+ /**
+ * BASICS TESTS
+ */
+ inline bool isZero() const
+ {
+ return( mPTR->isZero() );
+ }
+
+ inline bool isOne() const
+ {
+ return( mPTR->isOne() );
+ }
+
+ inline bool isNegativeOne() const
+ {
+ return( mPTR->isNegativeOne() );
+ }
+
+ /**
+ * CONVERSION
+ */
+ // Int32
+ inline bool isInt32() const
+ {
+ return( mPTR->isInt32() );
+ }
+
+ inline avm_int32_t toInt32() const
+ {
+ return( mPTR->toInt32() );
+ }
+
+ // Int64
+ inline bool isInt64() const
+ {
+ return( mPTR->isInt64() );
+ }
+
+ inline avm_int64_t toInt64() const
+ {
+ return( mPTR->toInt64() );
+ }
+
+ // Integer
+ inline bool isInteger() const
+ {
+ return( mPTR->isInteger() );
+ }
+
+ inline avm_integer_t toInteger() const
+ {
+ return( mPTR->toInteger() );
+ }
+
+ // Rational
+ inline bool isRational() const
+ {
+ return( mPTR->sign() );
+ }
+
+ inline avm_integer_t toDenominator() const
+ {
+ return( mPTR->sign() );
+ }
+
+ inline avm_integer_t toNumerator() const
+ {
+ return( mPTR->sign() );
+ }
+
+ // Float
+ inline bool isFloat() const
+ {
+ return( mPTR->sign() );
+ }
+
+ inline avm_float_t toFloat() const
+ {
+ return( mPTR->sign() );
+ }
+
+ // Real
+ inline bool isReal() const
+ {
+ return( mPTR->sign() );
+ }
+
+ inline avm_real_t toReal() const
+ {
+ return( mPTR->sign() );
+ }
+
+
+ /**
+ * POINTER TRIVIALLY EQUAL COMPARISON
+ */
+ inline bool isTEQ(const Numeric & aNumeric) const
+ {
+ return( mPTR == aNumeric.mPTR );
+ }
+
+ inline bool isTEQ(const Number & aNumber) const
+ {
+ return( mPTR == &aNumber );
+ }
+
+ inline bool isTEQ(const Number * aNumber) const
+ {
+ return( mPTR == aNumber );
+ }
+
+ inline bool isTEQ(const BF & anExpression) const
+ {
+ return( mPTR == anExpression.raw_pointer() );
+ }
+
+
+ inline bool isNTEQ(const Numeric & aNumeric) const
+ {
+ return( mPTR != aNumeric.mPTR );
+ }
+
+ inline bool isNTEQ(const Number & aNumber) const
+ {
+ return( mPTR != (& aNumber) );
+ }
+
+ inline bool isNTEQ(const Number * aNumber) const
+ {
+ return( mPTR != aNumber );
+ }
+
+ inline bool isNTEQ(const BF & anExpression) const
+ {
+ return( mPTR != anExpression.raw_pointer() );
+ }
+
+
+ /**
+ * COMPARISON
+ */
+ inline bool isEQ(const Numeric & aNumeric) const
+ {
+ return( this->operator==( aNumeric ) );
+ }
+
+ inline bool isEQ(const Number & aNumber) const
+ {
+ return( this->operator==( aNumber ) );
+ }
+
+ inline bool isEQ(const BF & anExpression) const
+ {
+ return( this->operator==( anExpression.as_ref< Number >() ) );
+ }
+
+
+ inline bool isNEQ(const Numeric & aNumeric) const
+ {
+ return( this->operator!=( aNumeric ) );
+ }
+
+ inline bool isNEQ(const Number & aNumber) const
+ {
+ return( this->operator!=( aNumber ) );
+ }
+
+ inline bool isNEQ(const BF & anExpression) const
+ {
+ return( this->operator!=( anExpression.as_ref< Number >() ) );
+ }
+
+
+ inline bool strEQ(const Numeric & aNumeric) const
+ {
+ return( this->operator==( aNumeric ) );
+ }
+
+ inline bool strEQ(const Number & aNumber) const
+ {
+ return( this->operator==( aNumber ) );
+ }
+
+ inline bool strEQ(const BF & anExpression) const
+ {
+ return( this->operator==( anExpression.as_ref< Number >() ) );
+ }
+
+
+ inline bool strNEQ(const Numeric & aNumeric) const
+ {
+ return( this->operator!=( aNumeric ) );
+ }
+
+ inline bool strNEQ(const Number & aNumber) const
+ {
+ return( this->operator!=( aNumber ) );
+ }
+
+ inline bool strNEQ(const BF & anExpression) const
+ {
+ return( this->operator!=( anExpression.as_ref< Number >() ) );
+ }
+
+
+////////////////////////////////////////////////////////////////////////////////
+// bool operator...
+////////////////////////////////////////////////////////////////////////////////
+
+#define BOOL_OPERATION_AUX(op, number, numeric) \
+ switch( numeric.classKind() ) \
+ { \
+ case FORM_BUILTIN_INTEGER_KIND: \
+ return( op(number, numeric.to_ref< Integer >()) ); \
+ case FORM_BUILTIN_RATIONAL_KIND: \
+ return( op(number, numeric.to_ref< Rational >()) ); \
+ case FORM_BUILTIN_FLOAT_KIND: \
+ return( op(number, numeric.to_ref< Float >()) ); \
+ default: \
+ { \
+ AVM_OS_FATAL_ERROR_EXIT << "Unexpected a <Numeric> type info << " \
+ << numeric.classKindInfo() << " >> !!!" << SEND_EXIT; \
+ return( false ); \
+ } \
+ }
+
+#define BOOL_OPERATION(op, N1, N2) \
+ switch( N1.classKind() ) \
+ { \
+ case FORM_BUILTIN_INTEGER_KIND: \
+ BOOL_OPERATION_AUX(op, N1.to_ref< Integer >(), N2) \
+ case FORM_BUILTIN_RATIONAL_KIND: \
+ BOOL_OPERATION_AUX(op, N1.to_ref< Rational >(), N2) \
+ case FORM_BUILTIN_FLOAT_KIND: \
+ BOOL_OPERATION_AUX(op, N1.to_ref< Float >(), N2) \
+ default: \
+ { \
+ AVM_OS_FATAL_ERROR_EXIT << "Unexpected a <Numeric> type info << " \
+ << N1.classKindInfo() << " >> !!!" << SEND_EXIT; \
+ return( false ); \
+ } \
+ }
+
+
+ /**
+ * compare
+ */
+ int compare(const Numeric & aNumeric) const
+ {
+ if( mPTR == aNumeric.mPTR )
+ {
+ return( 0 );
+ }
+
+ BOOL_OPERATION( sep::numeric::compare , (*this) , aNumeric )
+ }
+
+ int compare(const Number & aNumber) const
+ {
+ if( mPTR == (& aNumber) )
+ {
+ return( 0 );
+ }
+
+ BOOL_OPERATION( sep::numeric::compare , (*this) , aNumber )
+ }
+
+ int compare(const BF & anExpression) const
+ {
+ if( mPTR == anExpression.raw_pointer() )
+ {
+ return( 0 );
+ }
+
+ BOOL_OPERATION( sep::numeric::compare ,
+ (*this) , anExpression.as_ref< Number >() )
+ }
+
+
+ /**
+ * operator==
+ */
+ inline bool operator==(const Numeric & aNumeric) const
+ {
+ if( mPTR == aNumeric.mPTR )
+ {
+ return( true );
+ }
+
+ BOOL_OPERATION( sep::numeric::operator== , (*this) , aNumeric )
+ }
+
+ inline bool operator==(const Number & aNumber) const
+ {
+ if( mPTR == (& aNumber) )
+ {
+ return( true );
+ }
+
+ BOOL_OPERATION( sep::numeric::operator== , (*this) , aNumber )
+ }
+
+ inline bool operator==(const BF & anExpression) const
+ {
+ if( mPTR == anExpression.raw_pointer() )
+ {
+ return( true );
+ }
+
+ BOOL_OPERATION( sep::numeric::operator== ,
+ (*this) , anExpression.as_ref< Number >() )
+ }
+
+
+ /**
+ * operator!=
+ */
+ inline bool operator!=(const Numeric & aNumeric) const
+ {
+ if( mPTR == aNumeric.mPTR )
+ {
+ return( false );
+ }
+
+ BOOL_OPERATION( sep::numeric::operator!= , (*this) , aNumeric )
+ }
+
+ inline bool operator!=(const Number & aNumber) const
+ {
+ if( mPTR == (& aNumber) )
+ {
+ return( false );
+ }
+
+ BOOL_OPERATION( sep::numeric::operator!= , (*this) , aNumber )
+ }
+
+ inline bool operator!=(const BF & anExpression) const
+ {
+ if( mPTR == anExpression.raw_pointer() )
+ {
+ return( false );
+ }
+
+ BOOL_OPERATION( sep::numeric::operator!= ,
+ (*this) , anExpression.as_ref< Number >() )
+ }
+
+
+ /**
+ * operator<
+ */
+ inline bool operator<(const Numeric & aNumeric) const
+ {
+ if( mPTR == aNumeric.mPTR )
+ {
+ return( false );
+ }
+
+ BOOL_OPERATION( sep::numeric::operator< , (*this) , aNumeric )
+ }
+
+ inline bool operator<(const Number & aNumber) const
+ {
+ if( mPTR == (& aNumber) )
+ {
+ return( false );
+ }
+
+ BOOL_OPERATION( sep::numeric::operator< , (*this) , aNumber )
+ }
+
+ inline bool operator<(const BF & anExpression) const
+ {
+ if( mPTR == anExpression.raw_pointer() )
+ {
+ return( false );
+ }
+
+ BOOL_OPERATION( sep::numeric::operator< ,
+ (*this) , anExpression.as_ref< Number >() )
+ }
+
+ /**
+ * operator<=
+ */
+ inline bool operator<=(const Numeric & aNumeric) const
+ {
+ if( mPTR == aNumeric.mPTR )
+ {
+ return( true );
+ }
+
+ BOOL_OPERATION( sep::numeric::operator<= , (*this) , aNumeric )
+ }
+
+ inline bool operator<=(const Number & aNumber) const
+ {
+ if( mPTR == (& aNumber) )
+ {
+ return( true );
+ }
+
+ BOOL_OPERATION( sep::numeric::operator<= , (*this) , aNumber )
+ }
+
+ inline bool operator<=(const BF & anExpression) const
+ {
+ if( mPTR == anExpression.raw_pointer() )
+ {
+ return( true );
+ }
+
+ BOOL_OPERATION( sep::numeric::operator<= ,
+ (*this) , anExpression.as_ref< Number >() )
+ }
+
+
+ /**
+ * operator>
+ */
+ inline bool operator>(const Numeric & aNumeric) const
+ {
+ if( mPTR == aNumeric.mPTR )
+ {
+ return( false );
+ }
+
+ BOOL_OPERATION( sep::numeric::operator> , (*this) , aNumeric )
+ }
+
+ inline bool operator>(const Number & aNumber) const
+ {
+ if( mPTR == (& aNumber) )
+ {
+ return( false );
+ }
+
+ BOOL_OPERATION( sep::numeric::operator> , (*this) , aNumber )
+ }
+
+ inline bool operator>(const BF & anExpression) const
+ {
+ if( mPTR == anExpression.raw_pointer() )
+ {
+ return( false );
+ }
+
+ BOOL_OPERATION( sep::numeric::operator> ,
+ (*this) , anExpression.as_ref< Number >() )
+ }
+
+
+ /**
+ * operator>=
+ */
+ inline bool operator>=(const Numeric & aNumeric) const
+ {
+ if( mPTR == aNumeric.mPTR )
+ {
+ return( true );
+ }
+
+ BOOL_OPERATION( sep::numeric::operator>= , (*this) , aNumeric )
+ }
+
+ inline bool operator>=(const Number & aNumber) const
+ {
+ if( mPTR == (& aNumber) )
+ {
+ return( true );
+ }
+
+ BOOL_OPERATION( sep::numeric::operator>= , (*this) , aNumber )
+ }
+
+ inline bool operator>=(const BF & anExpression) const
+ {
+ if( mPTR == anExpression.raw_pointer() )
+ {
+ return( true );
+ }
+
+ BOOL_OPERATION( sep::numeric::operator>= ,
+ (*this) , anExpression.as_ref< Number >() )
+ }
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Numeric operator...
+////////////////////////////////////////////////////////////////////////////////
+
+#define ARITHMETIC_OPERATION_AUX(op, number, numeric) \
+ switch( numeric.classKind() ) \
+ { \
+ case FORM_BUILTIN_INTEGER_KIND: \
+ return( Numeric( op(number, numeric.to_ref< Integer >()) ) ); \
+ case FORM_BUILTIN_RATIONAL_KIND: \
+ return( Numeric( op(number, numeric.to_ref< Rational >()) ) ); \
+ case FORM_BUILTIN_FLOAT_KIND: \
+ return( Numeric( op(number, numeric.to_ref< Float >()) ) ); \
+ default: \
+ { \
+ AVM_OS_FATAL_ERROR_EXIT << "Unexpected a <Numeric> type info << " \
+ << numeric.classKindInfo() << " >> !!!" << SEND_EXIT; \
+ return( Numeric(0) ); \
+ } \
+ }
+
+#define ARITHMETIC_OPERATION(op, N1, N2) \
+ switch( N1.classKind() ) \
+ { \
+ case FORM_BUILTIN_INTEGER_KIND: \
+ ARITHMETIC_OPERATION_AUX(op, N1.to_ref< Integer >(), N2) \
+ case FORM_BUILTIN_RATIONAL_KIND: \
+ ARITHMETIC_OPERATION_AUX(op, N1.to_ref< Rational >(), N2) \
+ case FORM_BUILTIN_FLOAT_KIND: \
+ ARITHMETIC_OPERATION_AUX(op, N1.to_ref< Float >(), N2) \
+ default: \
+ { \
+ AVM_OS_FATAL_ERROR_EXIT << "Unexpected a <Numeric> type info << " \
+ << N1.classKindInfo() << " >> !!!" << SEND_EXIT; \
+ return( Numeric(0) ); \
+ } \
+ }
+
+#define ARITHMETIC_UNARY_OPERATION(op, N) \
+ switch( N.classKind() ) \
+ { \
+ case FORM_BUILTIN_INTEGER_KIND: \
+ return( Numeric( op(N.to_ref< Integer >()) ) ); \
+ case FORM_BUILTIN_RATIONAL_KIND: \
+ return( Numeric( op(N.to_ref< Rational >()) ) ); \
+ case FORM_BUILTIN_FLOAT_KIND: \
+ return( Numeric( op(N.to_ref< Float >()) ) ); \
+ default: \
+ { \
+ AVM_OS_FATAL_ERROR_EXIT << "Unexpected a <Numeric> type info << " \
+ << N.classKindInfo() << " >> !!!" << SEND_EXIT; \
+ return( Numeric(0) ); \
+ } \
+ }
+
+#define ARITHMETIC_OPERATION_NUM(op, numeric, number) \
+ switch( numeric.classKind() ) \
+ { \
+ case FORM_BUILTIN_INTEGER_KIND: \
+ return( Numeric( op(numeric.to_ref< Integer >(), number) ) ); \
+ case FORM_BUILTIN_RATIONAL_KIND: \
+ return( Numeric( op(numeric.to_ref< Rational >(), number) ) ); \
+ case FORM_BUILTIN_FLOAT_KIND: \
+ return( Numeric( op(numeric.to_ref< Float >(), number) ) ); \
+ default: \
+ { \
+ AVM_OS_FATAL_ERROR_EXIT << "Unexpected a <Numeric> type info << " \
+ << numeric.classKindInfo() << " >> !!!" << SEND_EXIT; \
+ return( Numeric(0) ); \
+ } \
+ }
+
+
+ /**
+ * operator+
+ */
+ inline Numeric operator+(const Numeric & aNumeric) const
+ {
+ if( aNumeric.isZero() )
+ {
+ return( *this );
+ }
+
+ ARITHMETIC_OPERATION( sep::numeric::operator+ , (*this) , aNumeric )
+ }
+
+ inline Numeric operator+(const Number & aNumber) const
+ {
+ if( aNumber.isZero() )
+ {
+ return( *this );
+ }
+
+ ARITHMETIC_OPERATION( sep::numeric::operator+ , (*this) , aNumber )
+ }
+
+ inline Numeric operator+(const BF & anExpression) const
+ {
+ return( this->operator+( anExpression.as_ref< Number >() ) );
+ }
+
+ // operator+=
+ inline Numeric & operator+=(const Numeric & aNumeric)
+ {
+ this->operator=( this->operator+( aNumeric ) );
+
+ return( *this );
+ }
+
+ inline Numeric & operator+=(const BF & anExpression)
+ {
+ this->operator=( this->operator+( anExpression ) );
+
+ return( *this );
+ }
+
+
+ /**
+ * operator++
+ */
+ inline Numeric operator++()
+ {
+ this->operator=( this->operator+( Integer(1) ) );
+
+ return( *this );
+ }
+
+ inline Numeric operator++(int)
+ {
+ Numeric tmp( *this );
+
+ this->operator=( this->operator+( Integer(1) ) );
+
+ return( tmp );
+ }
+
+ /**
+ * operator-
+ */
+ inline Numeric operator-() const
+ {
+ ARITHMETIC_UNARY_OPERATION( sep::numeric::operator- , (*this) )
+ }
+
+ /**
+ * operator--
+ */
+ inline Numeric operator--()
+ {
+ this->operator=( this->operator-( Integer(1) ) );
+
+ return( *this );
+ }
+
+ inline Numeric operator--(int)
+ {
+ Numeric tmp( *this );
+
+ this->operator=( this->operator-( Integer(1) ) );
+
+ return( tmp );
+ }
+
+ /**
+ * operator-
+ */
+ inline Numeric operator-(const Numeric & aNumeric) const
+ {
+ if( aNumeric.isZero() )
+ {
+ return( *this );
+ }
+
+ ARITHMETIC_OPERATION( sep::numeric::operator- , (*this) , aNumeric )
+ }
+
+ inline Numeric operator-(const Number & aNumber) const
+ {
+ if( aNumber.isZero() )
+ {
+ return( *this );
+ }
+
+ ARITHMETIC_OPERATION( sep::numeric::operator- , (*this) , aNumber )
+ }
+
+ inline Numeric operator-(const BF & anExpression) const
+ {
+ return( this->operator-( anExpression.as_ref< Number >() ) );
+ }
+
+ // operator-=
+ inline Numeric & operator-=(const Numeric & aNumeric)
+ {
+ this->operator=( this->operator-( aNumeric ) );
+
+ return( *this );
+ }
+
+ inline Numeric & operator-=(const BF & anExpression)
+ {
+ this->operator=( this->operator-( anExpression ) );
+
+ return( *this );
+ }
+
+
+ /**
+ * operator*
+ */
+ inline Numeric operator*(const Numeric & aNumeric) const
+ {
+ if( aNumeric.isOne() )
+ {
+ return( *this );
+ }
+
+ ARITHMETIC_OPERATION( sep::numeric::operator* , (*this) , aNumeric )
+ }
+
+ inline Numeric operator*(const Number & aNumber) const
+ {
+ if( aNumber.isOne() )
+ {
+ return( *this );
+ }
+
+ ARITHMETIC_OPERATION( sep::numeric::operator* , (*this) , aNumber )
+ }
+
+ inline Numeric operator*(const BF & anExpression) const
+ {
+ return( this->operator*( anExpression.as_ref< Number >() ) );
+ }
+
+ // operator*=
+ inline Numeric & operator*=(const Numeric & aNumeric)
+ {
+ this->operator=( this->operator*( aNumeric ) );
+
+ return( *this );
+ }
+
+ inline Numeric & operator*=(const BF & anExpression)
+ {
+ this->operator=( this->operator*( anExpression ) );
+
+ return( *this );
+ }
+
+
+ /**
+ * operator/
+ */
+ inline Numeric operator/(const Numeric & aNumeric) const
+ {
+ if( aNumeric.isOne() )
+ {
+ return( *this );
+ }
+
+ ARITHMETIC_OPERATION( sep::numeric::operator/ , (*this) , aNumeric )
+ }
+
+ inline Numeric operator/(const Number & aNumber) const
+ {
+ if( aNumber.isOne() )
+ {
+ return( *this );
+ }
+
+ ARITHMETIC_OPERATION( sep::numeric::operator/ , (*this) , aNumber )
+ }
+
+ inline Numeric operator/(const BF & anExpression) const
+ {
+ return( this->operator/( anExpression.as_ref< Number >() ) );
+ }
+
+ // operator/=
+ inline Numeric & operator/=(const Numeric & aNumeric)
+ {
+ this->operator=( this->operator/( aNumeric ) );
+
+ return( *this );
+ }
+
+ inline Numeric & operator/=(const BF & anExpression)
+ {
+ this->operator=( this->operator/( anExpression ) );
+
+ return( *this );
+ }
+
+
+ /**
+ * COMPARISON OPERATION
+ */
+ inline bool eq(const Numeric & arg)
+ {
+ return( this->operator==( arg ) );
+ }
+
+ inline bool neq(const Numeric & arg)
+ {
+ return( this->operator!=( arg ) );
+ }
+
+
+ inline bool lt(const Numeric & arg)
+ {
+ return( this->operator<( arg ) );
+ }
+
+ inline bool lte(const Numeric & arg)
+ {
+ return( this->operator<=( arg ) );
+ }
+
+
+ inline bool gt(const Numeric & arg)
+ {
+ return( this->operator>( arg ) );
+ }
+
+ inline bool gte(const Numeric & arg)
+ {
+ return( this->operator>=( arg ) );
+ }
+
+
+ /**
+ * ARITHMETIC OPERATION
+ */
+ inline Numeric add(const Numeric & arg)
+ {
+ return( this->operator+( arg ) );
+ }
+
+ inline Numeric incr(avm_uinteger_t val = 1)
+ {
+ return( this->operator+( Integer(val) ) );
+ }
+
+ inline Numeric minus(const Numeric & arg)
+ {
+ return( this->operator-( arg ) );
+ }
+
+ inline Numeric uminus()
+ {
+ return( this->operator-() );
+ }
+
+ inline Numeric decr(avm_uinteger_t val = 1)
+ {
+ return( this->operator-( Integer(val) ) );
+ }
+
+ inline Numeric mult(const Numeric & arg)
+ {
+ return( this->operator*( arg ) );
+ }
+
+ inline Numeric pow(avm_uinteger_t anExponent)
+ {
+ ARITHMETIC_OPERATION_NUM( sep::numeric::pow , (*this) , anExponent )
+ }
+
+ inline Numeric div(const Numeric & arg)
+ {
+ return( this->operator/( arg ) );
+ }
+
+ inline Numeric inv()
+ {
+ ARITHMETIC_UNARY_OPERATION( sep::numeric::inverse , (*this) )
+ }
+
+
+ /**
+ * Serialization
+ */
+ inline void toStream(OutStream & os) const
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "raw_pointer in Numeric::toStream(OutStream &) !!!"
+ << SEND_EXIT;
+
+ mPTR->toStream( os );
+ }
+
+ inline void toStream(PairOutStream & os) const
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "raw_pointer in Numeric::toStream(PairOutStream &) !!!"
+ << SEND_EXIT;
+
+ mPTR->toStream( os.OS1 );
+ mPTR->toStream( os.OS2 );
+ }
+
+ inline void toStream(TripleOutStream & os) const
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "raw_pointer in Numeric::toStream(TripleOutStream &) !!!"
+ << SEND_EXIT;
+
+ mPTR->toStream( os.OS1 );
+ mPTR->toStream( os.OS2 );
+ mPTR->toStream( os.OS3 );
+ }
+
+
+ inline std::string toString(
+ const AvmIndent & indent = AVM_TAB_INDENT) const
+ {
+ StringOutStream oss(indent);
+
+ toStream( oss );
+
+ return( oss.str() );
+ }
+
+ inline std::string str() const
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "raw_pointer in Numeric::str() !!!"
+ << SEND_EXIT;
+
+ return( mPTR->str() );
+ }
+
+
+};
+
+
+/**
+ * operator<<
+ */
+AVM_OS_STREAM( Numeric )
+
+
+inline OutStream & operator<<(OutStream & os, const Integer & aNumber)
+{
+ aNumber.toStream( os );
+
+ return( os );
+}
+
+/**
+ * Serialization
+ */
+inline OutStream & operator<<(OutStream & os, const Rational & aNumber)
+{
+ aNumber.toStream( os );
+
+ return( os );
+}
+
+/**
+ * Serialization
+ */
+inline OutStream & operator<<(OutStream & os, const Float & aNumber)
+{
+ aNumber.toStream( os );
+
+ return( os );
+}
+
+
+
+} /* namespace sep */
+#endif /* FML_EXPRESSION_NUMERIC_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/numeric/README.md b/org.eclipse.efm.symbex/src/fml/numeric/README.md
new file mode 100644
index 0000000..79e547b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/numeric/README.md
@@ -0,0 +1,16 @@
+# EFM-SYMBEX : Numeric
+
+## Source code structure
+
+### Interfaces
+* **INumeric**
+
+### Classes
+* **Integer**
+* **Rational**
+* **Float**
+* **Real**
+
+### Factories
+* **Numeric** as Smart Pointer
+
diff --git a/org.eclipse.efm.symbex/src/fml/numeric/Rational.cpp b/org.eclipse.efm.symbex/src/fml/numeric/Rational.cpp
new file mode 100644
index 0000000..5b2f121
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/numeric/Rational.cpp
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 1 mars 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "Rational.h"
+
+
+namespace sep
+{
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/numeric/Rational.h b/org.eclipse.efm.symbex/src/fml/numeric/Rational.h
new file mode 100644
index 0000000..1d81ab0
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/numeric/Rational.h
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 1 mars 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef FML_EXPRESSION_RATIONAL_H_
+#define FML_EXPRESSION_RATIONAL_H_
+
+#if defined( _AVM_BUILTIN_NUMERIC_GMP_ )
+
+#include <fml/numeric/gmp/RationalImpl.h>
+
+#elif defined( _AVM_BUILTIN_NUMERIC_BOOST_ )
+
+#include <fml/numeric/boost/RationalImpl.h>
+
+#else
+
+#include <fml/numeric/basic/RationalImpl.h>
+
+#endif /* _AVM_BUILTIN_NUMERIC_GMP_ */
+
+
+namespace sep
+{
+
+
+} /* namespace sep */
+
+#endif /* FML_EXPRESSION_RATIONAL_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/numeric/basic/FloatImpl.h b/org.eclipse.efm.symbex/src/fml/numeric/basic/FloatImpl.h
new file mode 100644
index 0000000..16526c1
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/numeric/basic/FloatImpl.h
@@ -0,0 +1,379 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 mai 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#ifndef FML_NUMERIC_BASIC_FLOATIMPL_H_
+#define FML_NUMERIC_BASIC_FLOATIMPL_H_
+
+#include <fml/numeric/Number.h>
+
+#include <fml/numeric/Integer.h>
+#include <fml/numeric/Rational.h>
+
+#include <cmath>
+
+namespace sep
+{
+
+
+class Float :
+ public Number,
+ public GenericNumberClass< avm_float_t , Float >
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( Float )
+
+
+ /**
+ * TYPEDEF
+ */
+public:
+ typedef avm_float_t RawValueType;
+
+private:
+ typedef GenericNumberClass< RawValueType , Float > ThisNumberClass;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Float(const Rational & aRational)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType( aRational.toFloat() ) )
+ {
+ //!! NOTHING
+ }
+
+ Float(const Integer & anInteger)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType( anInteger.getValue() ) )
+ {
+ //!! NOTHING
+ }
+
+
+ // avm_float_t i.e. double
+ Float(avm_float_t aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ // float
+ Float(float aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ // avm_integer_t i.e. avm_int64_t
+ Float(avm_integer_t aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ // avm_uinteger_t i.e. avm_uint64_t
+ Float(avm_uinteger_t aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+#ifdef _AVM_NEED_INT64_T_OVERLOADS_
+
+ // long
+ Float(long aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ Float(unsigned long aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+#endif /* _AVM_NEED_INT64_T_OVERLOADS_ */
+
+ // int32_t
+ Float(int aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ // uint32_t
+ Float(unsigned int aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ // std::string
+ Float(const std::string & aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( sep::string_to< avm_float_t >(aValue, std::dec) )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ Float(const Float & aFloat)
+ : Number( aFloat ),
+ ThisNumberClass( aFloat )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Float()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * BASICS TESTS
+ */
+ inline virtual int sign() const
+ {
+ return( (ThisNumberClass::mValue < 0) ? -1 :
+ (ThisNumberClass::mValue > 0) );
+ }
+
+
+ inline virtual bool isPositive() const
+ {
+ return( ThisNumberClass::mValue >= 0 );
+ }
+
+ inline virtual bool strictlyPositive() const
+ {
+ return( ThisNumberClass::mValue > 0 );
+ }
+
+
+ inline virtual bool isNegative() const
+ {
+ return( ThisNumberClass::mValue <= 0 );
+ }
+
+ inline virtual bool strictlyNegative() const
+ {
+ return( ThisNumberClass::mValue < 0 );
+ }
+
+
+ inline virtual bool isZero() const
+ {
+ return( ThisNumberClass::mValue == 0 );
+ }
+
+ inline virtual bool isOne() const
+ {
+ return( ThisNumberClass::mValue == 1 );
+ }
+
+ inline virtual bool isNegativeOne() const
+ {
+ return( ThisNumberClass::mValue == -1 );
+ }
+
+
+ /**
+ * CONVERSION
+ */
+ inline virtual bool isInt32() const
+ {
+ return( (ThisNumberClass::mValue ==
+ static_cast< avm_int32_t >( ThisNumberClass::mValue )) &&
+ (AVM_NUMERIC_MIN_INT <= ThisNumberClass::mValue) &&
+ (ThisNumberClass::mValue <= AVM_NUMERIC_MAX_INT) );
+ }
+
+ inline virtual avm_int32_t toInt32() const
+ {
+ return( static_cast< avm_int32_t >( ThisNumberClass::mValue ) );
+ }
+
+ inline virtual bool isInt64() const
+ {
+ return( (ThisNumberClass::mValue ==
+ static_cast< avm_int64_t >( ThisNumberClass::mValue )) &&
+ (AVM_NUMERIC_MIN_LONG <= ThisNumberClass::mValue) &&
+ (ThisNumberClass::mValue <= AVM_NUMERIC_MIN_LONG) );
+ }
+
+ inline virtual avm_int64_t toInt64() const
+ {
+ return( static_cast< avm_int64_t >( ThisNumberClass::mValue ) );
+ }
+
+
+ inline virtual bool isInteger() const
+ {
+ return( ThisNumberClass::mValue ==
+ static_cast< avm_integer_t >( ThisNumberClass::mValue ) );
+ }
+
+ inline virtual avm_integer_t toInteger() const
+ {
+ return( static_cast< avm_integer_t >( ThisNumberClass::mValue ) );
+ }
+
+
+ inline virtual bool isPosInteger() const
+ {
+ return( ThisNumberClass::mValue ==
+ static_cast< avm_uinteger_t >( ThisNumberClass::mValue ) );
+ }
+
+
+ inline virtual bool isUInteger() const
+ {
+ return( ThisNumberClass::mValue ==
+ static_cast< avm_uinteger_t >( ThisNumberClass::mValue ) );
+ }
+
+ inline virtual avm_uinteger_t toUInteger() const
+ {
+ return( static_cast< avm_uinteger_t >( ThisNumberClass::mValue ) );
+ }
+
+
+ inline virtual bool isRational() const
+ {
+ return( true );
+ }
+
+ virtual avm_integer_t toDenominator() const
+ {
+ return( static_cast< avm_integer_t >( ThisNumberClass::mValue ) );
+ }
+
+ virtual avm_integer_t toNumerator() const
+ {
+ return( static_cast< avm_integer_t >( ThisNumberClass::mValue ) );
+ }
+
+
+ inline virtual bool isFloat() const
+ {
+ return( true );
+ }
+
+ inline virtual avm_float_t toFloat() const
+ {
+ return( ThisNumberClass::mValue );
+ }
+
+
+ inline virtual bool isReal() const
+ {
+ return( true );
+ }
+
+ inline virtual avm_real_t toReal() const
+ {
+ return( static_cast< avm_real_t >( ThisNumberClass::mValue ) );
+ }
+
+
+ /**
+ * math function
+ */
+ inline void set_pow(avm_uinteger_t anExponent)
+ {
+ ThisNumberClass::mValue = std::pow(ThisNumberClass::mValue, anExponent);
+ }
+
+ inline void set_pow(double aValue, avm_uinteger_t anExponent)
+ {
+ ThisNumberClass::mValue = std::pow(aValue, anExponent);
+ }
+
+
+ /**
+ * Serialization
+ */
+ virtual void toStream(OutStream & os) const
+ {
+ os << TAB << OS_FLOAT_PRECISION << mValue;
+ AVM_DEBUG_REF_COUNTER(os);
+ os << EOL_FLUSH;
+ }
+
+ virtual std::string str() const
+ {
+ return( OSS() << OS_REAL_PRECISION << mValue );
+ }
+
+ inline virtual std::string strNum(
+ avm_uint8_t precision = AVM_MUMERIC_PRECISION) const
+ {
+ return( OSS() << std::fixed
+ << std::setprecision( precision ) << mValue );
+ }
+
+};
+
+
+/**
+ * Operators
+ */
+inline Float::RawValueType operator+ (Float::RawValueType aFLoat,
+ const Rational::RawValueType & aRational)
+{
+ return( static_cast< Float::RawValueType >( aFLoat + aRational.toFloat() ) );
+}
+
+inline Float::RawValueType operator- (Float::RawValueType aFLoat,
+ const Rational::RawValueType & aRational)
+{
+ return( static_cast< Float::RawValueType >( aFLoat - aRational.toFloat() ) );
+}
+
+inline Float::RawValueType operator* (Float::RawValueType aFLoat,
+ const Rational::RawValueType & aRational)
+{
+ return( static_cast< Float::RawValueType >( aFLoat * aRational.toFloat() ) );
+}
+
+inline Float::RawValueType operator/ (Float::RawValueType aFLoat,
+ const Rational::RawValueType & aRational)
+{
+ return( static_cast< Float::RawValueType >( aFLoat / aRational.toFloat() ) );
+}
+
+
+} /* namespace sep */
+
+#endif /* FML_NUMERIC_BASIC_FLOATIMPL_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/numeric/basic/IntegerImpl.h b/org.eclipse.efm.symbex/src/fml/numeric/basic/IntegerImpl.h
new file mode 100644
index 0000000..2908d5d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/numeric/basic/IntegerImpl.h
@@ -0,0 +1,331 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 mai 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#ifndef FML_NUMERIC_BASIC_INTEGERIMPL_H_
+#define FML_NUMERIC_BASIC_INTEGERIMPL_H_
+
+#include <fml/numeric/Number.h>
+
+
+namespace sep
+{
+
+class Integer :
+ public Number,
+ public GenericNumberClass< avm_integer_t , Integer >
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( Integer )
+
+
+ /**
+ * TYPEDEF
+ */
+public:
+ typedef avm_integer_t RawValueType;
+
+private:
+ typedef GenericNumberClass< RawValueType , Integer > ThisNumberClass;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ // avm_integer_t i.e. avm_int64_t
+ Integer(avm_integer_t aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( avm_integer_t(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ // avm_uinteger_t i.e. avm_uint64_t
+ Integer(avm_uinteger_t aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( avm_integer_t(aValue) )
+ {
+ //!! NOTHING
+ }
+
+#ifdef _AVM_NEED_INT64_T_OVERLOADS_
+
+ // long
+ Integer(long aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( avm_integer_t(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ // unsigned long
+ Integer(unsigned long aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( avm_integer_t(aValue) )
+ {
+ //!! NOTHING
+ }
+
+#endif /* _AVM_NEED_INT64_T_OVERLOADS_ */
+
+ // int32_t
+ Integer(int aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( avm_integer_t(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ // uint32_t
+ Integer(unsigned int aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( avm_integer_t(aValue) )
+ {
+ //!! NOTHING
+ }
+
+
+ Integer(const std::string & aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( sep::string_to< avm_integer_t >(aValue, std::dec) )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ Integer(const Integer & anInteger)
+ : Number( anInteger ),
+ ThisNumberClass( anInteger )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Integer()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * BASICS TESTS
+ */
+ virtual inline int sign() const
+ {
+ return( (ThisNumberClass::mValue < 0) ? -1 :
+ (ThisNumberClass::mValue > 0) );
+ }
+
+ virtual inline bool strictlyPositive() const
+ {
+ return( ThisNumberClass::mValue > 0 );
+ }
+
+ virtual inline bool strictlyNegative() const
+ {
+ return( ThisNumberClass::mValue < 0 );
+ }
+
+ virtual inline bool isZero() const
+ {
+ return( ThisNumberClass::mValue == 0 );
+ }
+
+ virtual inline bool isOne() const
+ {
+ return( ThisNumberClass::mValue == 1 );
+ }
+
+ virtual inline bool isNegativeOne() const
+ {
+ return( ThisNumberClass::mValue == -1 );
+ }
+
+
+ /**
+ * CONVERSION
+ */
+ inline virtual bool isInt32() const
+ {
+ return( (AVM_NUMERIC_MIN_INT32 <= ThisNumberClass::mValue) &&
+ (ThisNumberClass::mValue <= AVM_NUMERIC_MAX_INT32) );
+ }
+
+ inline virtual avm_int32_t toInt32() const
+ {
+ return( static_cast< avm_int32_t >( ThisNumberClass::mValue ) );
+ }
+
+
+ inline virtual bool isInt64() const
+ {
+ return( (AVM_NUMERIC_MIN_INT64 <= ThisNumberClass::mValue) &&
+ (ThisNumberClass::mValue <= AVM_NUMERIC_MAX_INT64) );
+ }
+
+ inline virtual avm_int64_t toInt64() const
+ {
+ return( static_cast< avm_int64_t >( ThisNumberClass::mValue ) );
+ }
+
+
+ inline virtual bool isInteger() const
+ {
+ return( true );
+ }
+
+ inline virtual avm_integer_t toInteger() const
+ {
+ return( static_cast< avm_integer_t >( ThisNumberClass::mValue ) );
+ }
+
+
+ inline virtual bool isPosInteger() const
+ {
+ return( ThisNumberClass::mValue >= 0 );
+ }
+
+ inline virtual bool isUInteger() const
+ {
+ return( ThisNumberClass::mValue >= 0 );
+ }
+
+
+ inline virtual avm_uinteger_t toUInteger() const
+ {
+ return( static_cast< avm_uinteger_t >( ThisNumberClass::mValue ) );
+ }
+
+
+ inline virtual bool isRational() const
+ {
+ return( true );
+ }
+
+ virtual avm_integer_t toNumerator() const
+ {
+ return( static_cast< avm_integer_t >( ThisNumberClass::mValue ) );
+ }
+
+ virtual avm_integer_t toDenominator() const
+ {
+ return( static_cast< avm_integer_t >( 1 ) );
+ }
+
+
+ inline virtual bool isFloat() const
+ {
+ return( true );
+ }
+
+ inline virtual avm_float_t toFloat() const
+ {
+ return( static_cast< avm_float_t >( ThisNumberClass::mValue ) );
+ }
+
+
+ inline virtual bool isReal() const
+ {
+ return( true );
+ }
+
+ inline virtual avm_real_t toReal() const
+ {
+ return( static_cast< avm_real_t >( ThisNumberClass::mValue ) );
+ }
+
+
+ /**
+ * math function
+ */
+ inline static avm_uinteger_t ipow(
+ avm_uinteger_t aValue, avm_uinteger_t anExponent)
+ {
+ avm_uinteger_t aResult = 1;
+ for( ; anExponent > 0; --anExponent )
+ {
+ aResult *= aValue;
+ }
+
+// while( anExponent != 0 )
+// {
+// if( (anExponent & 1) == 1 )
+// {
+// aResult *= aValue;
+// }
+//
+// anExponent >>= 1;
+// aValue *= aValue;
+// }
+
+ return( aResult );
+ }
+
+ inline void set_pow(avm_uinteger_t anExponent)
+ {
+ ThisNumberClass::mValue =
+ Integer::ipow(ThisNumberClass::mValue, anExponent);
+ }
+
+ inline void set_pow(avm_uinteger_t aValue, avm_uinteger_t anExponent)
+ {
+ ThisNumberClass::mValue = Integer::ipow(aValue, anExponent);
+ }
+
+
+ inline Integer pow(avm_uinteger_t anExponent) const
+ {
+ return( Integer( Integer::ipow(ThisNumberClass::mValue, anExponent) ) );
+ }
+
+ inline static Integer pow(avm_uinteger_t aValue, avm_uinteger_t anExponent)
+ {
+ return( Integer( Integer::ipow(aValue, anExponent) ) );
+ }
+
+
+ /**
+ * Serialization
+ */
+ inline void toStream(OutStream & os) const
+ {
+ os << TAB << mValue;
+ AVM_DEBUG_REF_COUNTER(os);
+ os << EOL << std::flush;
+ }
+
+ virtual std::string str() const
+ {
+ return( OSS() << mValue );
+ }
+
+ inline virtual std::string strNum(
+ avm_uint8_t precision = AVM_MUMERIC_PRECISION) const
+ {
+ return( OSS() << mValue );
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* FML_NUMERIC_BASIC_INTEGERIMPL_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/numeric/basic/NumericImpl.h b/org.eclipse.efm.symbex/src/fml/numeric/basic/NumericImpl.h
new file mode 100644
index 0000000..b5c90a2
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/numeric/basic/NumericImpl.h
@@ -0,0 +1,697 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 16 mai 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#ifndef FML_NUMERIC_BASIC_NUMERICIMPL_H_
+#define FML_NUMERIC_BASIC_NUMERICIMPL_H_
+
+#include <fml/numeric/basic/IntegerImpl.h>
+#include <fml/numeric/basic/RationalImpl.h>
+#include <fml/numeric/basic/FloatImpl.h>
+
+
+namespace sep
+{
+namespace numeric
+{
+
+
+/**
+ * compare Float
+ * with ...
+ */
+inline int compare(const Float & num1, const Float & num2)
+{
+ return( num1.compare( num2 ) );
+}
+
+inline int compare(const Float & num1, const Integer & num2)
+{
+ return( num1.compare( num2 ) );
+}
+
+inline int compare(const Float & num1, const Rational & num2)
+{
+ return( num1.compare( Float( num2.toFloat() ) ) );
+}
+
+
+/**
+ * compare Rational
+ * with ...
+ */
+inline int compare(const Rational & num1, const Rational & num2)
+{
+ return( num1.compare( num2 ) );
+}
+
+inline int compare(const Rational & num1, const Integer & num2)
+{
+ return( num1.compare( num2 ) );
+}
+
+inline int compare(const Rational & num1, const Float & num2)
+{
+ return( - compare( num2, num1 ) );
+}
+
+
+/**
+ * compare Integer
+ * with ...
+ */
+inline int compare(const Integer & num1, const Integer & num2)
+{
+ return( num1.compare( num2 ) );
+}
+
+inline int compare(const Integer & num1, const Rational & num2)
+{
+ return( - compare( num2, num1 ) );
+}
+
+inline int compare(const Integer & num1, const Float & num2)
+{
+ return( - compare( num2, num1 ) );
+}
+
+
+/**
+ * operator==
+ */
+// Integer == Number
+inline bool operator==(const Integer & num1, const Integer & num2)
+{
+ return( num1.getValue() == num2.getValue() );
+}
+
+inline bool operator==(const Integer & num1, const Rational & num2)
+{
+ return( num1.getValue() == num2.getValue() );
+}
+
+inline bool operator==(const Integer & num1, const Float & num2)
+{
+ return( num1.getValue() == num2.getValue() );
+}
+
+
+// Rational == Number
+inline bool operator==(const Rational & num1, const Rational & num2)
+{
+ return( num1.getValue() == num2.getValue() );
+}
+
+inline bool operator==(const Rational & num1, const Integer & num2)
+{
+ return( num1.getValue() == num2.getValue() );
+}
+
+inline bool operator==(const Rational & num1, const Float & num2)
+{
+ return( num1.toFloat() == num2.getValue() );
+}
+
+
+// Float == Number
+inline bool operator==(const Float & num1, const Float & num2)
+{
+ return( num1.getValue() == num2.getValue() );
+}
+
+inline bool operator==(const Float & num1, const Rational & num2)
+{
+ return( num1.getValue() == num2.toFloat() );
+}
+
+inline bool operator==(const Float & num1, const Integer & num2)
+{
+ return( num1.getValue() == num2.getValue() );
+}
+
+
+/**
+ * operator!=
+ */
+// Integer != Number
+inline bool operator!=(const Integer & num1, const Integer & num2)
+{
+ return( num1.getValue() != num2.getValue() );
+}
+
+inline bool operator!=(const Integer & num1, const Rational & num2)
+{
+ return( num1.getValue() != num2.getValue() );
+}
+
+inline bool operator!=(const Integer & num1, const Float & num2)
+{
+ return( num1.getValue() != num2.getValue() );
+}
+
+
+// Rational != Number
+inline bool operator!=(const Rational & num1, const Rational & num2)
+{
+ return( num1.getValue() != num2.getValue() );
+}
+
+inline bool operator!=(const Rational & num1, const Integer & num2)
+{
+ return( num1.getValue() != num2.getValue() );
+}
+
+inline bool operator!=(const Rational & num1, const Float & num2)
+{
+ return( num1.toFloat() != num2.getValue() );
+}
+
+
+// Float != Number
+inline bool operator!=(const Float & num1, const Float & num2)
+{
+ return( num1.getValue() != num2.getValue() );
+}
+
+inline bool operator!=(const Float & num1, const Rational & num2)
+{
+ return( num1.getValue() != num2.toFloat() );
+}
+
+inline bool operator!=(const Float & num1, const Integer & num2)
+{
+ return( num1.getValue() != num2.getValue() );
+}
+
+
+/**
+ * operator<
+ */
+// Integer < Number
+inline bool operator<(const Integer & num1, const Integer & num2)
+{
+ return( num1.getValue() < num2.getValue() );
+}
+
+inline bool operator<(const Integer & num1, const Rational & num2)
+{
+ return( num1.getValue() < num2.getValue() );
+}
+
+inline bool operator<(const Integer & num1, const Float & num2)
+{
+ return( num1.getValue() < num2.getValue() );
+}
+
+
+// Rational < Number
+inline bool operator<(const Rational & num1, const Rational & num2)
+{
+ return( num1.getValue() < num2.getValue() );
+}
+
+inline bool operator<(const Rational & num1, const Integer & num2)
+{
+ return( num1.getValue() < num2.getValue() );
+}
+
+inline bool operator<(const Rational & num1, const Float & num2)
+{
+ return( num1.toFloat() < num2.getValue() );
+}
+
+
+// Float < Number
+inline bool operator<(const Float & num1, const Float & num2)
+{
+ return( num1.getValue() < num2.getValue() );
+}
+
+inline bool operator<(const Float & num1, const Rational & num2)
+{
+ return( num1.getValue() < num2.toFloat() );
+}
+
+inline bool operator<(const Float & num1, const Integer & num2)
+{
+ return( num1.getValue() < num2.getValue() );
+}
+
+/**
+ * operator<=
+ */
+// Integer <= Number
+inline bool operator<=(const Integer & num1, const Integer & num2)
+{
+ return( num1.getValue() <= num2.getValue() );
+}
+
+inline bool operator<=(const Integer & num1, const Rational & num2)
+{
+ return( num1.getValue() <= num2.getValue() );
+}
+
+inline bool operator<=(const Integer & num1, const Float & num2)
+{
+ return( num1.getValue() <= num2.getValue() );
+}
+
+
+// Rational <= Number
+inline bool operator<=(const Rational & num1, const Rational & num2)
+{
+ return( num1.getValue() <= num2.getValue() );
+}
+
+inline bool operator<=(const Rational & num1, const Integer & num2)
+{
+ return( num1.getValue() <= num2.getValue() );
+}
+
+inline bool operator<=(const Rational & num1, const Float & num2)
+{
+ return( num1.toFloat() <= num2.getValue() );
+}
+
+
+// Float <= Number
+inline bool operator<=(const Float & num1, const Float & num2)
+{
+ return( num1.getValue() <= num2.getValue() );
+}
+
+inline bool operator<=(const Float & num1, const Rational & num2)
+{
+ return( num1.getValue() <= num2.toFloat() );
+}
+
+inline bool operator<=(const Float & num1, const Integer & num2)
+{
+ return( num1.getValue() <= num2.getValue() );
+}
+
+
+/**
+ * operator>
+ */
+// Integer > Number
+inline bool operator>(const Integer & num1, const Integer & num2)
+{
+ return( num1.getValue() > num2.getValue() );
+}
+
+inline bool operator>(const Integer & num1, const Rational & num2)
+{
+ return( num1.getValue() > num2.getValue() );
+}
+
+inline bool operator>(const Integer & num1, const Float & num2)
+{
+ return( num1.getValue() > num2.getValue() );
+}
+
+
+// Rational > Number
+inline bool operator>(const Rational & num1, const Rational & num2)
+{
+ return( num1.getValue() > num2.getValue() );
+}
+
+inline bool operator>(const Rational & num1, const Integer & num2)
+{
+ return( num1.getValue() > num2.getValue() );
+}
+
+inline bool operator>(const Rational & num1, const Float & num2)
+{
+ return( num1.toFloat() > num2.getValue() );
+}
+
+
+// Float > Number
+inline bool operator>(const Float & num1, const Float & num2)
+{
+ return( num1.getValue() > num2.getValue() );
+}
+
+inline bool operator>(const Float & num1, const Rational & num2)
+{
+ return( num1.getValue() > num2.toFloat() );
+}
+
+inline bool operator>(const Float & num1, const Integer & num2)
+{
+ return( num1.getValue() > num2.getValue() );
+}
+
+/**
+ * operator>=
+ */
+// Integer >= Number
+inline bool operator>=(const Integer & num1, const Integer & num2)
+{
+ return( num1.getValue() >= num2.getValue() );
+}
+
+inline bool operator>=(const Integer & num1, const Rational & num2)
+{
+ return( num1.getValue() >= num2.getValue() );
+}
+
+inline bool operator>=(const Integer & num1, const Float & num2)
+{
+ return( num1.getValue() >= num2.getValue() );
+}
+
+
+// Rational >= Number
+inline bool operator>=(const Rational & num1, const Rational & num2)
+{
+ return( num1.getValue() >= num2.getValue() );
+}
+
+inline bool operator>=(const Rational & num1, const Integer & num2)
+{
+ return( num1.getValue() >= num2.getValue() );
+}
+
+inline bool operator>=(const Rational & num1, const Float & num2)
+{
+ return( num1.toFloat() >= num2.getValue() );
+}
+
+
+// Float >= Number
+inline bool operator>=(const Float & num1, const Float & num2)
+{
+ return( num1.getValue() >= num2.getValue() );
+}
+
+inline bool operator>=(const Float & num1, const Rational & num2)
+{
+ return( num1.getValue() >= num2.toFloat() );
+}
+
+inline bool operator>=(const Float & num1, const Integer & num2)
+{
+ return( num1.getValue() >= num2.getValue() );
+}
+
+
+/**
+ * operator+
+ */
+// Integer + Number
+inline Integer operator+(const Integer & num1, const Integer & num2)
+{
+ return( Integer(num1.getValue() + num2.getValue()) );
+}
+
+inline Rational operator+(const Integer & num1, const Rational & num2)
+{
+ return( Rational(Rational(num1).getValue() + num2.getValue()) );
+}
+
+inline Float operator+(const Integer & num1, const Float & num2)
+{
+ return( Float(num1.getValue() + num2.getValue()) );
+}
+
+
+// Rational + Number
+inline Rational operator+(const Rational & num1, const Rational & num2)
+{
+ return( Rational(num1.getValue() + num2.getValue()) );
+}
+
+inline Rational operator+(const Rational & num1, const Integer & num2)
+{
+ return( Rational(num1.getValue() + Rational(num2).getValue()) );
+}
+
+inline Float operator+(const Rational & num1, const Float & num2)
+{
+ return( Float(num1.toFloat() + num2.getValue()) );
+}
+
+
+// Float + Number
+inline Float operator+(const Float & num1, const Float & num2)
+{
+ return( Float(num1.getValue() + num2.getValue()) );
+}
+
+inline Float operator+(const Float & num1, const Rational & num2)
+{
+ return( Float(num1.getValue() + num2.toFloat()) );
+}
+
+inline Float operator+(const Float & num1, const Integer & num2)
+{
+ return( Float(num1.getValue() + num2.getValue() ) );
+}
+
+
+/**
+ * operator-
+ */
+inline Integer operator-(const Integer & num)
+{
+ return( Integer(- num.getValue()) );
+}
+
+inline Rational operator-(const Rational & num)
+{
+ return( Rational(- num.getValue()) );
+}
+
+inline Float operator-(const Float & num)
+{
+ return( Float(- num.getValue()) );
+}
+
+
+/**
+ * operator-
+ */
+// Integer - Number
+inline Integer operator-(const Integer & num1, const Integer & num2)
+{
+ return( Integer(num1.getValue() - num2.getValue()) );
+}
+
+inline Rational operator-(const Integer & num1, const Rational & num2)
+{
+ return( Rational(Rational(num1).getValue() - num2.getValue()) );
+}
+
+inline Float operator-(const Integer & num1, const Float & num2)
+{
+ return( Float(num1.getValue() - num2.getValue()) );
+}
+
+
+// Rational - Number
+inline Rational operator-(const Rational & num1, const Rational & num2)
+{
+ return( Rational(num1.getValue() - num2.getValue()) );
+}
+
+inline Rational operator-(const Rational & num1, const Integer & num2)
+{
+ return( Rational(num1.getValue() - Rational(num2).getValue()) );
+}
+
+inline Float operator-(const Rational & num1, const Float & num2)
+{
+ return( Float(num1.toFloat() - num2.getValue()) );
+}
+
+
+// Float - Number
+inline Float operator-(const Float & num1, const Float & num2)
+{
+ return( Float(num1.getValue() - num2.getValue()) );
+}
+
+inline Float operator-(const Float & num1, const Rational & num2)
+{
+ return( Float(num1.getValue() - num2.getValue()) );
+}
+
+inline Float operator-(const Float & num1, const Integer & num2)
+{
+ return( Float(num1.getValue() - num2.getValue() ) );
+}
+
+
+/**
+ * operator*
+ */
+// Integer * Number
+inline Integer operator*(const Integer & num1, const Integer & num2)
+{
+ return( Integer(num1.getValue() * num2.getValue()) );
+}
+
+inline Rational operator*(const Integer & num1, const Rational & num2)
+{
+ return( Rational(num1.getValue() * num2.rawNumerator() ,
+ num2.rawDenominator()) );
+}
+
+inline Float operator*(const Integer & num1, const Float & num2)
+{
+ return( Float(num1.getValue() * num2.getValue()) );
+}
+
+
+// Rational * Number
+inline Rational operator*(const Rational & num1, const Rational & num2)
+{
+ return( Rational(num1.getValue() * num2.getValue()) );
+}
+
+inline Rational operator*(const Rational & num1, const Integer & num2)
+{
+ return( Rational(num1.rawNumerator() * num2.getValue(),
+ num1.rawDenominator()) );
+}
+
+inline Float operator*(const Rational & num1, const Float & num2)
+{
+ return( Float(num1.toFloat() * num2.getValue()) );
+}
+
+
+// Float * Number
+inline Float operator*(const Float & num1, const Float & num2)
+{
+ return( Float(num1.getValue() * num2.getValue()) );
+}
+
+inline Float operator*(const Float & num1, const Rational & num2)
+{
+ return( Float(num1.getValue() * num2.toFloat()) );
+}
+
+inline Float operator*(const Float & num1, const Integer & num2)
+{
+ return( Float(num1.getValue() * num2.getValue() ) );
+}
+
+
+/**
+ * pow
+ */
+inline Integer pow(const Integer & num, avm_uinteger_t anExponent)
+{
+ return( Integer( num.pow(anExponent) ) );
+}
+
+inline Rational pow(const Rational & num, avm_uinteger_t anExponent)
+{
+ Rational result( num );
+ result.set_pow( anExponent );
+
+ return( Rational( result ) );
+}
+
+inline Float pow(const Float & num, avm_uinteger_t anExponent)
+{
+ Float result( num );
+ result.set_pow( anExponent );
+
+ return( Float( result ) );
+}
+
+
+/**
+ * operator/
+ */
+// Integer / Number
+inline Rational operator/(const Integer & num1, const Integer & num2)
+{
+ return( Rational( num1.getValue() , num2.getValue() ) );
+}
+
+inline Rational operator/(const Integer & num1, const Rational & num2)
+{
+ return( Rational(num1.getValue() * num2.rawDenominator() ,
+ num2.rawNumerator() ) );
+}
+
+inline Float operator/(const Integer & num1, const Float & num2)
+{
+ return( Float(num1.getValue() / num2.getValue()) );
+}
+
+
+// Rational / Number
+inline Rational operator/(const Rational & num1, const Rational & num2)
+{
+ return( Rational(num1.getValue() / num2.getValue()) );
+}
+
+inline Rational operator/(const Rational & num1, const Integer & num2)
+{
+ return( Rational(num1.rawNumerator() ,
+ num1.rawDenominator() * num2.getValue()) );
+}
+
+inline Float operator/(const Rational & num1, const Float & num2)
+{
+ return( Float(num1.toFloat() / num2.getValue()) );
+}
+
+// Float / Number
+inline Float operator/(const Float & num1, const Float & num2)
+{
+ return( Float(num1.getValue() / num2.getValue()) );
+}
+
+inline Float operator/(const Float & num1, const Rational & num2)
+{
+ return( Float(num1.getValue() / num2.toFloat()) );
+}
+
+inline Float operator/(const Float & num1, const Integer & num2)
+{
+ return( Float(num1.getValue() / num2.getValue() ) );
+}
+
+
+/**
+ * inverse
+ */
+inline Rational inverse(const Integer & num)
+{
+ return( Rational( Integer(1) , num ) );
+}
+
+inline Rational inverse(const Rational & num)
+{
+ return( Rational( num.rawDenominator() , num.rawNumerator() ) );
+}
+
+inline Float inverse(const Float & num)
+{
+ return( Float( 1 / num.getValue() ) );
+}
+
+
+} /* namespace numeric */
+} /* namespace sep */
+
+#endif /* FML_NUMERIC_BASIC_NUMERICIMPL_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/numeric/basic/RationalImpl.h b/org.eclipse.efm.symbex/src/fml/numeric/basic/RationalImpl.h
new file mode 100644
index 0000000..574c6f8
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/numeric/basic/RationalImpl.h
@@ -0,0 +1,818 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 mai 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#ifndef FML_NUMERIC_BASIC_RATIONALIMPL_H_
+#define FML_NUMERIC_BASIC_RATIONALIMPL_H_
+
+#include <fml/numeric/Number.h>
+
+#include <fml/numeric/Integer.h>
+
+#include <cmath>
+
+
+namespace sep
+{
+
+
+template< typename Num_T , typename Den_T >
+class BasicRational
+{
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef Num_T TNum;
+ typedef Den_T TDen;
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ Num_T mNumerator;
+ Den_T mDenominator;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BasicRational(Num_T aNumerator, Den_T aDenominator)
+ : mNumerator( aNumerator ),
+ mDenominator( aDenominator )
+ {
+ simplif();
+ }
+
+
+ BasicRational(const std::string & aNumerator, Den_T aDenominator)
+ : mNumerator( sep::string_to< Num_T >(aNumerator, std::dec) ),
+ mDenominator( aDenominator )
+ {
+ simplif();
+ }
+
+ BasicRational(Num_T aNumerator, const std::string & aDenominator)
+ : mNumerator( aNumerator ),
+ mDenominator( sep::string_to< Num_T >(aDenominator, std::dec) )
+ {
+ simplif();
+ }
+
+ BasicRational(const std::string & aNumerator,
+ const std::string & aDenominator)
+ : mNumerator( sep::string_to< Num_T >(aNumerator , std::dec) ),
+ mDenominator( sep::string_to< Den_T >(aDenominator, std::dec) )
+ {
+ simplif();
+ }
+
+ BasicRational(const std::string & aRational)
+ : mNumerator( 0 ),
+ mDenominator( 1 )
+ {
+ fromString(this, aRational);
+
+ simplif();
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ BasicRational(const BasicRational & aRational)
+ : mNumerator ( aRational.mNumerator ),
+ mDenominator( aRational.mDenominator )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BasicRational()
+ {
+ //!! NOTHING
+ }
+
+
+ inline static void fromString(BasicRational * rop, const std::string & aValue)
+ {
+ std::string::size_type pos = aValue.find('/');
+ if( pos != std::string::npos)
+ {
+ rop->mNumerator = sep::string_to< Num_T >(
+ aValue.substr(0, pos), std::dec);
+ rop->mDenominator = sep::string_to< Num_T >(
+ aValue.substr(pos+1), std::dec);
+ }
+ else if( (pos = aValue.find('.')) != std::string::npos )
+ {
+ rop->mNumerator = sep::string_to< Num_T >(
+ std::string(aValue).erase(pos, 1), std::dec);
+
+ rop->mDenominator = Integer::ipow(10, aValue.size() - (pos + 1));
+ }
+ else
+ {
+ rop->mNumerator = sep::string_to< Num_T >(aValue, std::dec);
+ rop->mDenominator = 1;
+ }
+ }
+
+ /**
+ * GETTER - SETTER
+ * ThisNumberClass::mValue
+ */
+ inline Den_T gcd(Den_T a, Den_T b)
+ {
+ Den_T tmp;
+ while( b != 0 )
+ {
+ tmp = b;
+ b = a % b;
+ a = tmp;
+ }
+
+ return( a );
+ }
+
+ inline bool simplif()
+ {
+ if( mDenominator != 1 )
+ {
+ Den_T d = gcd((mNumerator < 0) ? (-mNumerator) : mNumerator,
+ mDenominator);
+
+ if( (d != 0) && (d != 1) )
+ {
+ mNumerator = static_cast< Num_T >( mNumerator / d );
+ mDenominator = static_cast< Den_T >( mDenominator / d );
+ }
+ }
+
+ return( true );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * ThisNumberClass::mValue
+ */
+ inline Num_T rawNumerator() const
+ {
+ return( mNumerator );
+ }
+
+ inline Den_T rawDenominator() const
+ {
+ return( mDenominator );
+ }
+
+
+ inline void setValue(Num_T aNumerator, Den_T aDenominator)
+ {
+ mNumerator = aNumerator;
+ mDenominator = aDenominator;
+
+ simplif();
+ }
+
+ inline void setValue(Num_T aValue)
+ {
+ mNumerator = aValue;
+ mDenominator = 1;
+ }
+
+
+ /**
+ * CONVERSION
+ */
+ inline virtual avm_float_t toFloat() const
+ {
+ return( static_cast< avm_float_t >( mNumerator / mDenominator ) );
+ }
+
+
+ /**
+ * COMPARISON
+ * OPERATOR
+ */
+ // operator==
+ inline bool operator==(const BasicRational & other) const
+ {
+ return( ( mDenominator == other.mDenominator ) ?
+ (mNumerator == other.mNumerator) :
+ (mNumerator * other.mDenominator ==
+ mDenominator * other.mNumerator) );
+ }
+
+ inline bool operator==(avm_integer_t aValue) const
+ {
+ return( mNumerator == mDenominator * aValue );
+ }
+
+ // operator!=
+ inline bool operator!=(const BasicRational & other) const
+ {
+ return( ! operator==(other) );
+ }
+
+ inline bool operator!=(avm_integer_t aValue) const
+ {
+ return( mNumerator != mDenominator * aValue );
+ }
+
+ // operator<
+ inline bool operator<(const BasicRational & other) const
+ {
+ return( ( mDenominator == other.mDenominator ) ?
+ (mNumerator < other.mNumerator) :
+ (mNumerator * other.mDenominator <
+ mDenominator * other.mNumerator) );
+ }
+
+ inline bool operator<(avm_integer_t aValue) const
+ {
+ return( mNumerator < mDenominator * aValue );
+ }
+
+ // operator<=
+ inline bool operator<=(const BasicRational & other) const
+ {
+ return( ( mDenominator == other.mDenominator ) ?
+ (mNumerator <= other.mNumerator) :
+ (mNumerator * other.mDenominator <=
+ mDenominator * other.mNumerator) );
+ }
+
+ inline bool operator<=(avm_integer_t aValue) const
+ {
+ return( mNumerator <= mDenominator * aValue );
+ }
+
+ // operator>
+ inline bool operator>(const BasicRational & other) const
+ {
+ return( ( mDenominator == other.mDenominator ) ?
+ (mNumerator > other.mNumerator) :
+ (mNumerator * other.mDenominator >
+ mDenominator * other.mNumerator) );
+ }
+
+ inline bool operator>(avm_integer_t aValue) const
+ {
+ return( mNumerator > mDenominator * aValue );
+ }
+
+ // operator>=
+ inline bool operator>=(const BasicRational & other) const
+ {
+ return( ( mDenominator == other.mDenominator ) ?
+ (mNumerator >= other.mNumerator) :
+ (mNumerator * other.mDenominator >=
+ mDenominator * other.mNumerator) );
+ }
+
+ inline bool operator>=(avm_integer_t aValue) const
+ {
+ return( mNumerator > mDenominator * aValue );
+ }
+
+
+ /**
+ * ARITHMETIC
+ * OPERATOR
+ */
+ // operator+
+ inline BasicRational operator+(const BasicRational & other)
+ {
+ return( BasicRational((mNumerator * other.mDenominator) +
+ (mDenominator * other.mNumerator) ,
+ mDenominator * other.mDenominator) );
+ }
+
+ inline BasicRational operator+(avm_integer_t aValue)
+ {
+ return( BasicRational(mNumerator + mDenominator * aValue ,
+ mDenominator) );
+ }
+
+ // operator-
+ inline BasicRational & operator-()
+ {
+ return( BasicRational(- mNumerator , mDenominator) );
+ }
+
+
+ inline BasicRational operator-(avm_integer_t aValue)
+ {
+ return( BasicRational(mNumerator - mDenominator * aValue ,
+ mDenominator) );
+ }
+
+ inline BasicRational operator-(const BasicRational & other)
+ {
+ return( BasicRational((mNumerator * other.mDenominator) -
+ (mDenominator * other.mNumerator) ,
+ mDenominator * other.mDenominator) );
+ }
+
+ // operator*
+ inline BasicRational operator*(const BasicRational & other)
+ {
+ return( BasicRational(mNumerator * other.mNumerator ,
+ mDenominator * other.mDenominator) );
+ }
+
+ inline BasicRational & operator*(avm_integer_t aValue)
+ {
+ return( BasicRational(mNumerator * aValue , mDenominator) );
+ }
+
+ // operator/
+ inline BasicRational operator/(const BasicRational & other)
+ {
+ return( BasicRational(mNumerator * other.mDenominator ,
+ mDenominator * other.mNumerator) );
+ }
+
+ inline BasicRational operator/(avm_integer_t aValue)
+ {
+ return( BasicRational(mNumerator , mDenominator * aValue) );
+ }
+
+
+ /**
+ * math function
+ */
+ inline void set_pow(avm_uinteger_t anExponent)
+ {
+ mNumerator = Integer::ipow(mNumerator, anExponent);
+ mDenominator = Integer::ipow(mDenominator, anExponent);
+ }
+
+};
+
+
+
+class Rational :
+ public Number,
+ public GenericNumberClass<
+ BasicRational< avm_integer_t , avm_integer_t > , Rational >
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( Rational )
+
+
+ /**
+ * TYPEDEF
+ */
+public:
+ typedef BasicRational< avm_integer_t , avm_integer_t > RawValueType;
+
+private:
+ typedef GenericNumberClass< RawValueType , Rational > ThisNumberClass;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Rational(const RawValueType & aValue)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ // Integer / Integer
+ Rational(const Integer & aNumerator, const Integer & aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(aNumerator.getValue(), aDenominator.getValue()) )
+ {
+ //!! NOTHING
+ }
+
+ Rational(avm_integer_t aNumerator, avm_integer_t aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(aNumerator, aDenominator) )
+ {
+ //!! NOTHING
+ }
+
+ Rational(avm_integer_t aNumerator, avm_uinteger_t aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(aNumerator, aDenominator) )
+ {
+ //!! NOTHING
+ }
+
+ Rational(avm_uinteger_t aNumerator, avm_integer_t aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(aNumerator, aDenominator) )
+ {
+ //!! NOTHING
+ }
+
+ Rational(avm_uinteger_t aNumerator, avm_uinteger_t aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(aNumerator, aDenominator) )
+ {
+ //!! NOTHING
+ }
+
+ Rational(const Integer & aNumerator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(aNumerator.getValue(), 1) )
+ {
+ //!! NOTHING
+ }
+
+ // avm_integer_t i.e. avm_int64_t
+ Rational(avm_integer_t aNumerator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(aNumerator, 1) )
+ {
+ //!! NOTHING
+ }
+
+ // avm_uinteger_t i.e. avm_uint64_t
+ Rational(avm_uinteger_t aNumerator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(aNumerator, 1) )
+ {
+ //!! NOTHING
+ }
+
+#ifdef _AVM_NEED_INT64_T_OVERLOADS_
+
+ // long
+ Rational(long aNumerator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(aNumerator, 1) )
+ {
+ //!! NOTHING
+ }
+
+ // unsigned long
+ Rational(unsigned long aNumerator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(aNumerator, 1) )
+ {
+ //!! NOTHING
+ }
+
+#endif /* _AVM_NEED_INT64_T_OVERLOADS_ */
+
+ // int32_t
+ Rational(int aNumerator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(aNumerator, 1) )
+ {
+ //!! NOTHING
+ }
+
+ // uint32_t
+ Rational(unsigned int aNumerator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(aNumerator, 1) )
+ {
+ //!! NOTHING
+ }
+
+ // std::string / avm_integer_t
+ Rational(const std::string & aNumerator, avm_integer_t aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(aNumerator, aDenominator) )
+ {
+ //!! NOTHING
+ }
+
+ // avm_integer_t / std::string
+ Rational(avm_integer_t aNumerator, const std::string & aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(aNumerator, aDenominator) )
+ {
+ //!! NOTHING
+ }
+
+ // std::string / std::string
+ Rational(const std::string & aNumerator, const std::string & aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(aNumerator, aDenominator) )
+ {
+ //!! NOTHING
+ }
+
+ // std::string
+ Rational(const std::string & aRational)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(aRational) )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ Rational(const Rational & aRational)
+ : Number( aRational ),
+ ThisNumberClass( aRational )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Rational()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * ThisNumberClass::mValue
+ */
+ inline Integer getNumerator() const
+ {
+ return( Integer( ThisNumberClass::mValue.rawNumerator() ) );
+ }
+
+ inline Integer getDenominator() const
+ {
+ return( Integer( ThisNumberClass::mValue.rawDenominator() ) );
+ }
+
+
+ inline Integer::RawValueType rawNumerator() const
+ {
+ return( ThisNumberClass::mValue.rawNumerator() );
+ }
+
+ inline Integer::RawValueType rawDenominator() const
+ {
+ return( ThisNumberClass::mValue.rawDenominator() );
+ }
+
+
+ inline void setValue(avm_integer_t aNumerator, avm_integer_t aDenominator)
+ {
+ ThisNumberClass::mValue = RawValueType(aNumerator, aDenominator);
+ }
+
+ inline void setValue(avm_integer_t aValue)
+ {
+ ThisNumberClass::mValue = RawValueType(aValue, 1);
+ }
+
+
+ /**
+ * BASICS TESTS
+ */
+ virtual inline int sign() const
+ {
+ return( (ThisNumberClass::mValue.rawNumerator() < 0) ? -1 :
+ (ThisNumberClass::mValue.rawNumerator() > 0) );
+ }
+
+ virtual inline bool strictlyPositive() const
+ {
+ return( ThisNumberClass::mValue.rawNumerator() > 0 );
+ }
+
+ virtual inline bool strictlyNegative() const
+ {
+ return( ThisNumberClass::mValue.rawNumerator() < 0 );
+ }
+
+ virtual inline bool isZero() const
+ {
+ return( ThisNumberClass::mValue.rawNumerator() == 0 );
+ }
+
+ virtual inline bool isOne() const
+ {
+ return( ThisNumberClass::mValue.rawNumerator() ==
+ ThisNumberClass::mValue.rawDenominator() );
+ }
+
+ virtual inline bool isNegativeOne() const
+ {
+ return( (ThisNumberClass::mValue.rawNumerator() ==
+ ThisNumberClass::mValue.rawDenominator()) &&
+ strictlyNegative() );
+ }
+
+
+ /**
+ * CONVERSION
+ */
+ inline virtual bool isInt32() const
+ {
+ return( (ThisNumberClass::mValue.rawDenominator() == 1) &&
+ (static_cast< avm_integer_t >(AVM_NUMERIC_MIN_INT) <=
+ ThisNumberClass::mValue.rawNumerator()) &&
+ (ThisNumberClass::mValue.rawNumerator() <=
+ static_cast< avm_integer_t >(AVM_NUMERIC_MAX_INT)) );
+ }
+
+ inline virtual avm_int32_t toInt32() const
+ {
+ return( static_cast< avm_int32_t >(
+ ThisNumberClass::mValue.rawNumerator() ) );
+ }
+
+ inline virtual bool isInt64() const
+ {
+ return( (ThisNumberClass::mValue.rawDenominator() == 1) &&
+ (static_cast< avm_integer_t >(AVM_NUMERIC_MIN_LONG) <=
+ ThisNumberClass::mValue.rawNumerator()) &&
+ (ThisNumberClass::mValue.rawNumerator() <=
+ static_cast< avm_integer_t >(AVM_NUMERIC_MAX_LONG)) );
+ }
+
+ inline virtual avm_int64_t toInt64() const
+ {
+ return( static_cast< avm_int64_t >(
+ ThisNumberClass::mValue.rawNumerator() ) );
+ }
+
+
+ inline virtual bool isInteger() const
+ {
+ return( ThisNumberClass::mValue.rawDenominator() == 1 );
+ }
+
+ inline virtual avm_integer_t toInteger() const
+ {
+ if( isInteger() )
+ {
+ return( ThisNumberClass::mValue.rawNumerator() );
+ }
+ else
+ {
+ return( static_cast< avm_integer_t >( toFloat() ) );
+ }
+ }
+
+
+ inline virtual bool isPosInteger() const
+ {
+ return( (ThisNumberClass::mValue.rawDenominator() == 1) &&
+ (ThisNumberClass::mValue.rawNumerator() >= 0) );
+ }
+
+
+ inline virtual bool isUInteger() const
+ {
+ return( (ThisNumberClass::mValue.rawDenominator() == 1) &&
+ (ThisNumberClass::mValue.rawNumerator() >= 0) );
+ }
+
+ inline virtual avm_uinteger_t toUInteger() const
+ {
+ if( isUInteger() )
+ {
+ return( static_cast< avm_uinteger_t >(
+ ThisNumberClass::mValue.rawNumerator() ) );
+ }
+ else if( toFloat() >= 0 )
+ {
+ return( static_cast< avm_uinteger_t >( toFloat() ) );
+ }
+
+ return( static_cast< avm_uinteger_t >( -1 ) );
+ }
+
+
+ inline virtual bool isRational() const
+ {
+ return( true );
+ }
+
+ virtual avm_integer_t toDenominator() const
+ {
+ return( ThisNumberClass::mValue.rawDenominator() );
+ }
+
+ virtual avm_integer_t toNumerator() const
+ {
+ return( ThisNumberClass::mValue.rawNumerator() );
+ }
+
+
+ inline virtual bool isFloat() const
+ {
+ return( true );
+ }
+
+ inline virtual avm_float_t toFloat() const
+ {
+ return( static_cast< avm_float_t >(
+ ThisNumberClass::mValue.rawNumerator() /
+ ThisNumberClass::mValue.rawDenominator()) );
+ }
+
+
+ inline virtual bool isReal() const
+ {
+ return( true );
+ }
+
+ inline virtual avm_real_t toReal() const
+ {
+ return( static_cast< avm_real_t >(
+ ThisNumberClass::mValue.rawNumerator() /
+ ThisNumberClass::mValue.rawDenominator()) );
+ }
+
+
+ /**
+ * math function
+ */
+ inline void set_pow(avm_uinteger_t anExponent)
+ {
+ ThisNumberClass::mValue.set_pow( anExponent );
+ }
+
+
+ /**
+ * Serialization
+ */
+ inline void toStream(OutStream & os) const
+ {
+ os << TAB << rawNumerator();
+ if( rawDenominator() != 1 )
+ {
+ os << "/" << rawDenominator();
+ }
+ AVM_DEBUG_REF_COUNTER(os);
+ os << EOL_FLUSH;
+ }
+
+ virtual std::string str() const
+ {
+ if( rawDenominator() != 1 )
+ {
+ return( OSS() << rawNumerator() << '/' << rawDenominator() );
+ }
+ else
+ {
+ return( OSS() << rawNumerator() );
+ }
+ }
+
+ inline virtual std::string strNum(
+ avm_uint8_t precision = AVM_MUMERIC_PRECISION) const
+ {
+ if( rawDenominator() != 1 )
+ {
+ return( OSS() << rawNumerator() << '/' << rawDenominator() );
+ }
+ else
+ {
+ return( OSS() << rawNumerator() );
+ }
+ }
+
+ inline virtual std::string strNumerator(
+ avm_uint8_t precision = AVM_MUMERIC_PRECISION) const
+ {
+ return( OSS() << rawNumerator() );
+ }
+
+ inline virtual std::string strDenominator(
+ avm_uint8_t precision = AVM_MUMERIC_PRECISION) const
+ {
+ return( OSS() << rawDenominator() );
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* FML_NUMERIC_BASIC_RATIONALIMPL_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/numeric/boost/FloatImpl.h b/org.eclipse.efm.symbex/src/fml/numeric/boost/FloatImpl.h
new file mode 100644
index 0000000..b7f2698
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/numeric/boost/FloatImpl.h
@@ -0,0 +1,404 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 17 mai 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#ifndef FML_NUMERIC_BOOST_FLOATIMPL_H_
+#define FML_NUMERIC_BOOST_FLOATIMPL_H_
+
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#include <boost/multiprecision/detail/default_ops.hpp>
+
+#include <fml/numeric/Number.h>
+
+#include <fml/numeric/Integer.h>
+#include <fml/numeric/Rational.h>
+
+
+namespace sep
+{
+
+
+class Float :
+ public Number,
+ public GenericNumberClass< boost::multiprecision::number<
+ boost::multiprecision::cpp_dec_float<0> > , Float >
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( Float )
+
+
+ /**
+ * TYPEDEF
+ */
+public:
+ typedef boost::multiprecision::number<
+ boost::multiprecision::cpp_dec_float<0> > RawValueType;
+
+private:
+ typedef GenericNumberClass< RawValueType , Float > ThisNumberClass;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ // RawValueType
+ Float(const RawValueType & aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType( aValue ) )
+ {
+ //!! NOTHING
+ }
+
+ // Rational
+ Float(const Rational & aRational)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType( aRational.getValue() ) )
+ {
+ //!! NOTHING
+ }
+
+ // Integer
+ Float(const Integer & anInteger)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType( anInteger.getValue() ) )
+ {
+ //!! NOTHING
+ }
+
+ // avm_float_t i.e. double
+ Float(avm_float_t aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ // float
+ Float(float aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+#ifdef _AVM_NEED_INT64_T_OVERLOADS_
+
+ // avm_integer_t i.e. avm_int64_t
+ Float(avm_integer_t aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType( static_cast< long >(aValue) ) )
+ {
+ //!! NOTHING
+ }
+
+ // avm_uinteger_t i.e. avm_uint64_t
+ Float(avm_uinteger_t aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType( static_cast< unsigned long >(aValue) ) )
+ {
+ //!! NOTHING
+ }
+
+ // long
+ Float(long aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType( aValue ) )
+ {
+ //!! NOTHING
+ }
+
+ Float(unsigned long aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType( aValue ) )
+ {
+ //!! NOTHING
+ }
+
+#else
+
+ // avm_integer_t i.e. avm_int64_t
+ Float(avm_integer_t aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ // avm_uinteger_t i.e. avm_uint64_t
+ Float(avm_uinteger_t aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+#endif /* _AVM_NEED_INT64_T_OVERLOADS_ */
+
+ // int32_t
+ Float(int aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ // uint32_t
+ Float(unsigned int aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ // std::string
+ Float(const std::string & aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ Float(const Float & aFloat)
+ : Number( aFloat ),
+ ThisNumberClass( aFloat )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Float()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * BASICS TESTS
+ */
+ virtual inline int sign() const
+ {
+ return( ThisNumberClass::mValue.sign() );
+ }
+
+ virtual inline bool isZero() const
+ {
+ return( ThisNumberClass::mValue.is_zero() );
+ }
+
+ virtual inline bool isOne() const
+ {
+ return( ThisNumberClass::mValue == 1 );
+ }
+
+ virtual inline bool isNegativeOne() const
+ {
+ return( ThisNumberClass::mValue == -1 );
+ }
+
+
+ /**
+ * CONVERSION
+ */
+#define CPP_FLOAT_IS_INTEGER(CPP_FLOAT, INT_T) \
+ ( CPP_FLOAT == CPP_FLOAT.convert_to< INT_T >() )
+// && boost::multiprecision::default_ops::check_in_range< INT_T >( CPP_FLOAT )
+
+#define CPP_FLOAT_IS_POSITIVE_INTEGER(CPP_FLOAT, INT_T) \
+ ( CPP_FLOAT.sign() >= 0 ) \
+ && ( CPP_FLOAT == CPP_FLOAT.convert_to< INT_T >() )
+// && boost::multiprecision::default_ops::check_in_range< INT_T >( CPP_FLOAT )
+
+
+ inline virtual bool isInt32() const
+ {
+ return( CPP_FLOAT_IS_INTEGER(ThisNumberClass::mValue, avm_int32_t) );
+ }
+
+ inline virtual avm_int32_t toInt32() const
+ {
+ return( ThisNumberClass::mValue.convert_to< avm_int32_t >() );
+ }
+
+
+ inline virtual bool isInt64() const
+ {
+ return( CPP_FLOAT_IS_INTEGER(ThisNumberClass::mValue, avm_int64_t) );
+ }
+
+ inline virtual avm_int64_t toInt64() const
+ {
+ return( ThisNumberClass::mValue.convert_to< avm_int64_t >() );
+ }
+
+
+ inline virtual bool isInteger() const
+ {
+ return( CPP_FLOAT_IS_INTEGER(ThisNumberClass::mValue, avm_integer_t) );
+ }
+
+ inline virtual avm_integer_t toInteger() const
+ {
+ return( ThisNumberClass::mValue.convert_to< avm_integer_t >() );
+ }
+
+
+ inline virtual bool isPosInteger() const
+ {
+ return( CPP_FLOAT_IS_POSITIVE_INTEGER(
+ ThisNumberClass::mValue, avm_uinteger_t) );
+ }
+
+
+ inline virtual bool isUInteger() const
+ {
+ return( CPP_FLOAT_IS_POSITIVE_INTEGER(
+ ThisNumberClass::mValue, avm_uinteger_t) );
+ }
+
+ inline virtual avm_uinteger_t toUInteger() const
+ {
+ return( ThisNumberClass::mValue.convert_to< avm_uinteger_t >() );
+ }
+
+
+ inline virtual bool isRational() const
+ {
+ return( isInteger() );
+ }
+
+ virtual avm_integer_t toNumerator() const
+ {
+ return( ThisNumberClass::mValue.convert_to< avm_integer_t >() );
+ }
+
+ virtual avm_integer_t toDenominator() const
+ {
+ return( static_cast< avm_integer_t >( 1 ) );
+ }
+
+
+#define CPP_FLOAT_IS_FLOAT(CPP_FLOAT, FLOAT_T) \
+ ( CPP_FLOAT == CPP_FLOAT.convert_to< FLOAT_T >() )
+// && boost::multiprecision::default_ops::check_in_range< FLOAT_T >( CPP_FLOAT )
+
+
+ inline virtual bool isFloat() const
+ {
+// return( false );
+ return( CPP_FLOAT_IS_FLOAT(ThisNumberClass::mValue, avm_float_t) );
+ }
+
+
+ inline virtual avm_float_t toFloat() const
+ {
+ return( ThisNumberClass::mValue.convert_to< avm_float_t >() );
+ }
+
+
+ inline virtual bool isReal() const
+ {
+// return( false );
+ return( CPP_FLOAT_IS_FLOAT(ThisNumberClass::mValue, avm_real_t) );
+ }
+
+ inline virtual avm_real_t toReal() const
+ {
+ return( ThisNumberClass::mValue.convert_to< avm_real_t >() );
+ }
+
+
+ /**
+ * math function
+ */
+ inline void set_pow(avm_uinteger_t anExponent)
+ {
+ ThisNumberClass::mValue = boost::multiprecision::pow(
+ ThisNumberClass::mValue, anExponent);
+ }
+
+ inline void set_pow(double aValue, avm_uinteger_t anExponent)
+ {
+ ThisNumberClass::mValue = boost::multiprecision::pow(
+ RawValueType(aValue), anExponent);
+ }
+
+
+ /**
+ * Serialization
+ */
+ virtual void toStream(OutStream & os) const
+ {
+ os << TAB /*<< OS_FLOAT_PRECISION*/ << mValue.str();
+ AVM_DEBUG_REF_COUNTER(os);
+ os << EOL_FLUSH;
+ }
+
+ virtual std::string str() const
+ {
+ return( mValue.str() );
+ }
+
+ inline virtual std::string strNum(
+ avm_uint8_t precision = AVM_MUMERIC_PRECISION) const
+ {
+ return( OSS() << std::fixed
+ << std::setprecision( precision ) << mValue );
+ }
+
+};
+
+
+/**
+ * Operators
+ */
+inline Float::RawValueType operator+ (Float::RawValueType aFLoat,
+ const Rational::RawValueType & aRational)
+{
+ return( static_cast< Float::RawValueType >( aFLoat +
+ aRational.convert_to< Float::RawValueType >() ) );
+}
+
+inline Float::RawValueType operator- (Float::RawValueType aFLoat,
+ const Rational::RawValueType & aRational)
+{
+ return( static_cast< Float::RawValueType >( aFLoat -
+ aRational.convert_to< Float::RawValueType >() ) );
+}
+
+inline Float::RawValueType operator* (Float::RawValueType aFLoat,
+ const Rational::RawValueType & aRational)
+{
+ return( static_cast< Float::RawValueType >( aFLoat *
+ aRational.convert_to< Float::RawValueType >() ) );
+}
+
+inline Float::RawValueType operator/ (Float::RawValueType aFLoat,
+ const Rational::RawValueType & aRational)
+{
+ return( static_cast< Float::RawValueType >( aFLoat /
+ aRational.convert_to< Float::RawValueType >() ) );
+}
+
+
+} /* namespace sep */
+
+#endif /* FML_NUMERIC_BOOST_FLOATIMPL_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/numeric/boost/IntegerImpl.h b/org.eclipse.efm.symbex/src/fml/numeric/boost/IntegerImpl.h
new file mode 100644
index 0000000..b74792c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/numeric/boost/IntegerImpl.h
@@ -0,0 +1,349 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 17 mai 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#ifndef FML_NUMERIC_BOOST_INTEGERIMPL_H_
+#define FML_NUMERIC_BOOST_INTEGERIMPL_H_
+
+#include <boost/multiprecision/cpp_int.hpp>
+#include <boost/multiprecision/detail/default_ops.hpp>
+#include <boost/multiprecision/cpp_dec_float.hpp>
+
+#include <fml/numeric/Number.h>
+
+
+namespace sep
+{
+
+
+class Integer :
+ public Number,
+ public GenericNumberClass< boost::multiprecision::cpp_int , Integer >
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( Integer )
+
+
+ /**
+ * TYPEDEF
+ */
+public:
+ typedef boost::multiprecision::cpp_int RawValueType;
+
+private:
+ typedef GenericNumberClass< RawValueType , Integer > ThisNumberClass;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Integer(const RawValueType & aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( aValue )
+ {
+ //!! NOTHING
+ }
+
+#ifdef _AVM_NEED_INT64_T_OVERLOADS_
+
+ // avm_integer_t i.e. avm_int64_t
+ Integer(avm_integer_t aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( RawValueType( static_cast< long >( aValue ) ) )
+ {
+ //!! NOTHING
+ }
+
+ // avm_uinteger_t i.e. avm_uint64_t
+ Integer(avm_uinteger_t aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( RawValueType( static_cast< unsigned long >( aValue ) ) )
+ {
+ //!! NOTHING
+ }
+
+ // long
+ Integer(long aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( RawValueType( aValue ) )
+ {
+ //!! NOTHING
+ }
+
+ Integer(unsigned long aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( RawValueType( aValue ) )
+ {
+ //!! NOTHING
+ }
+
+#else
+
+ // avm_integer_t i.e. avm_int64_t
+ Integer(avm_integer_t aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ // avm_uinteger_t i.e. avm_uint64_t
+ Integer(avm_uinteger_t aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+#endif /* _AVM_NEED_INT64_T_OVERLOADS_ */
+
+ // int32_t
+ Integer(int aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ // uint32_t
+ Integer(unsigned int aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ // std::string
+ Integer(const std::string & aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ Integer(const Integer & anInteger)
+ : Number( anInteger ),
+ ThisNumberClass( anInteger )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Integer()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * BASICS TESTS
+ */
+ virtual inline int sign() const
+ {
+ return( ThisNumberClass::mValue.sign() );
+ }
+
+ virtual inline bool isZero() const
+ {
+ return( ThisNumberClass::mValue.is_zero() );
+ }
+
+ virtual inline bool isOne() const
+ {
+ return( ThisNumberClass::mValue == 1 );
+ }
+
+ virtual inline bool isNegativeOne() const
+ {
+ return( ThisNumberClass::mValue == -1 );
+ }
+
+
+ /**
+ * CONVERSION
+ */
+#define CPP_INT_IS_INTEGER(CPP_INT, INT_T) \
+ ( CPP_INT == CPP_INT.convert_to< INT_T >() )
+// && boost::multiprecision::default_ops::check_in_range< INT_T >( CPP_INT )
+
+#define CPP_INT_IS_POSITIVE_INTEGER(CPP_INT, INT_T) \
+ ( CPP_INT.sign() >= 0 ) \
+ && ( CPP_INT == CPP_INT.convert_to< INT_T >() )
+// && boost::multiprecision::default_ops::check_in_range< INT_T >( CPP_INT )
+
+
+ inline virtual bool isInt32() const
+ {
+ return( CPP_INT_IS_INTEGER(ThisNumberClass::mValue, avm_int32_t) );
+ }
+
+ inline virtual avm_int32_t toInt32() const
+ {
+ return( ThisNumberClass::mValue.convert_to< avm_int32_t >() );
+ }
+
+
+ inline virtual bool isInt64() const
+ {
+ return( CPP_INT_IS_INTEGER(ThisNumberClass::mValue, avm_int64_t) );
+ }
+
+ inline virtual avm_int64_t toInt64() const
+ {
+ return( ThisNumberClass::mValue.convert_to< avm_int64_t >() );
+ }
+
+
+ inline virtual bool isInteger() const
+ {
+ return( CPP_INT_IS_INTEGER(ThisNumberClass::mValue, avm_integer_t) );
+ }
+
+ inline virtual avm_integer_t toInteger() const
+ {
+ return( ThisNumberClass::mValue.convert_to< avm_integer_t >() );
+ }
+
+
+ inline virtual bool isPosInteger() const
+ {
+ return( CPP_INT_IS_POSITIVE_INTEGER(
+ ThisNumberClass::mValue, avm_uinteger_t) );
+ }
+
+
+ inline virtual bool isUInteger() const
+ {
+ return( CPP_INT_IS_POSITIVE_INTEGER(
+ ThisNumberClass::mValue, avm_uinteger_t) );
+ }
+
+ inline virtual avm_uinteger_t toUInteger() const
+ {
+ return( ThisNumberClass::mValue.convert_to< avm_uinteger_t >() );
+ }
+
+
+ inline virtual bool isRational() const
+ {
+ return( isInteger() );
+ }
+
+ virtual avm_integer_t toNumerator() const
+ {
+ return( ThisNumberClass::mValue.convert_to< avm_integer_t >() );
+ }
+
+ virtual avm_integer_t toDenominator() const
+ {
+ return( static_cast< avm_integer_t >( 1 ) );
+ }
+
+
+#define CPP_INT_IS_FLOAT(CPP_INT, FLOAT_T) \
+ boost::multiprecision::default_ops::check_in_range< FLOAT_T >( \
+ CPP_INT.convert_to< boost::multiprecision::cpp_dec_float<0> >() )
+// ( CPP_INT == CPP_INT.convert_to< FLOAT_T >() )
+
+
+ inline virtual bool isFloat() const
+ {
+ return( false );
+// return( CPP_INT_IS_FLOAT(ThisNumberClass::mValue, avm_float_t) );
+ }
+
+
+ inline virtual avm_float_t toFloat() const
+ {
+ return( ThisNumberClass::mValue.convert_to< avm_float_t >() );
+ }
+
+
+ inline virtual bool isReal() const
+ {
+ return( false );
+// return( CPP_INT_IS_FLOAT(ThisNumberClass::mValue, avm_real_t) );
+ }
+
+ inline virtual avm_real_t toReal() const
+ {
+ return( ThisNumberClass::mValue.convert_to< avm_real_t >() );
+ }
+
+
+ /**
+ * math function
+ */
+ inline void set_pow(avm_uinteger_t anExponent)
+ {
+ ThisNumberClass::mValue = boost::multiprecision::pow(
+ ThisNumberClass::mValue, anExponent);
+ }
+
+ inline void set_pow(avm_uinteger_t aValue, avm_uinteger_t anExponent)
+ {
+ ThisNumberClass::mValue = boost::multiprecision::pow(
+ RawValueType(aValue), anExponent);
+ }
+
+
+ inline Integer pow(avm_uinteger_t anExponent) const
+ {
+ return( Integer( boost::multiprecision::pow(
+ ThisNumberClass::mValue, anExponent) ) );
+ }
+
+ inline static Integer pow(avm_uinteger_t aValue, avm_uinteger_t anExponent)
+ {
+ return( Integer( boost::multiprecision::pow(
+ RawValueType(aValue), anExponent) ) );
+ }
+
+
+ /**
+ * Serialization
+ */
+ inline void toStream(OutStream & os) const
+ {
+ os << TAB << mValue;
+ AVM_DEBUG_REF_COUNTER(os);
+ os << EOL << std::flush;
+ }
+
+ virtual std::string str() const
+ {
+ return( OSS() << mValue );
+ }
+
+ inline virtual std::string strNum(
+ avm_uint8_t precision = AVM_MUMERIC_PRECISION) const
+ {
+ return( OSS() << mValue );
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* FML_NUMERIC_BOOST_INTEGERIMPL_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/numeric/boost/NumericImpl.h b/org.eclipse.efm.symbex/src/fml/numeric/boost/NumericImpl.h
new file mode 100644
index 0000000..8203b1b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/numeric/boost/NumericImpl.h
@@ -0,0 +1,705 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 17 mai 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#ifndef FML_NUMERIC_BOOST_NUMERICIMPL_H_
+#define FML_NUMERIC_BOOST_NUMERICIMPL_H_
+
+#include <fml/numeric/boost/IntegerImpl.h>
+#include <fml/numeric/boost/RationalImpl.h>
+#include <fml/numeric/boost/FloatImpl.h>
+
+
+namespace sep
+{
+namespace numeric
+{
+
+
+/**
+ * compare Float
+ * with ...
+ */
+inline int compare(const Float & num1, const Float & num2)
+{
+ return( num1.getValue().compare( num2.getValue() ) );
+}
+
+inline int compare(const Float & num1, const Integer & num2)
+{
+ return( num1.getValue().compare(
+ num2.getValue().convert_to< Float::RawValueType >() ) );
+}
+
+inline int compare(const Float & num1, const Rational & num2)
+{
+ return( num1.getValue().compare(
+ num2.getValue().convert_to< Float::RawValueType >() ) );
+}
+
+
+/**
+ * compare Rational
+ * with ...
+ */
+inline int compare(const Rational & num1, const Rational & num2)
+{
+ return( num1.getValue().compare( num2.getValue() ) );
+}
+
+inline int compare(const Rational & num1, const Integer & num2)
+{
+ return( num1.getValue().compare( num2.getValue() ) );
+}
+
+inline int compare(const Rational & num1, const Float & num2)
+{
+ return( - compare( num2, num1 ) );
+}
+
+
+/**
+ * compare Integer
+ * with ...
+ */
+inline int compare(const Integer & num1, const Integer & num2)
+{
+ return( num1.getValue().compare( num2.getValue() ) );
+}
+
+inline int compare(const Integer & num1, const Rational & num2)
+{
+ return( - compare( num2, num1 ) );
+}
+
+inline int compare(const Integer & num1, const Float & num2)
+{
+ return( - compare( num2, num1 ) );
+}
+
+
+/**
+ * operator==
+ */
+// Integer == Number
+inline bool operator==(const Integer & num1, const Integer & num2)
+{
+ return( num1.getValue() == num2.getValue() );
+}
+
+inline bool operator==(const Integer & num1, const Rational & num2)
+{
+ return( num1.getValue() == num2.getValue() );
+}
+
+inline bool operator==(const Integer & num1, const Float & num2)
+{
+ return( num1.getValue().convert_to< Float::RawValueType >() == num2.getValue() );
+}
+
+
+// Rational == Number
+inline bool operator==(const Rational & num1, const Rational & num2)
+{
+ return( num1.getValue() == num2.getValue() );
+}
+
+inline bool operator==(const Rational & num1, const Integer & num2)
+{
+ return( num1.getValue() == num2.getValue() );
+}
+
+inline bool operator==(const Rational & num1, const Float & num2)
+{
+ return( num1.getValue() == num2.getValue() );
+}
+
+
+// Float == Number
+inline bool operator==(const Float & num1, const Float & num2)
+{
+ return( num1.getValue() == num2.getValue() );
+}
+
+inline bool operator==(const Float & num1, const Rational & num2)
+{
+ return( num1.getValue() == num2.getValue() );
+}
+
+inline bool operator==(const Float & num1, const Integer & num2)
+{
+ return( num1.getValue() ==
+ num2.getValue().convert_to< Float::RawValueType >() );
+}
+
+
+/**
+ * operator!=
+ */
+// Integer != Number
+inline bool operator!=(const Integer & num1, const Integer & num2)
+{
+ return( num1.getValue() != num2.getValue() );
+}
+
+inline bool operator!=(const Integer & num1, const Rational & num2)
+{
+ return( num1.getValue() != num2.getValue() );
+}
+
+inline bool operator!=(const Integer & num1, const Float & num2)
+{
+ return( num1.getValue() != num2.getValue() );
+}
+
+
+// Rational != Number
+inline bool operator!=(const Rational & num1, const Rational & num2)
+{
+ return( num1.getValue() != num2.getValue() );
+}
+
+inline bool operator!=(const Rational & num1, const Integer & num2)
+{
+ return( num1.getValue() != num2.getValue() );
+}
+
+inline bool operator!=(const Rational & num1, const Float & num2)
+{
+ return( num1.getValue() != num2.getValue() );
+}
+
+
+// Float != Number
+inline bool operator!=(const Float & num1, const Float & num2)
+{
+ return( num1.getValue() != num2.getValue() );
+}
+
+inline bool operator!=(const Float & num1, const Rational & num2)
+{
+ return( num1.getValue() != num2.getValue() );
+}
+
+inline bool operator!=(const Float & num1, const Integer & num2)
+{
+ return( num1.getValue() !=
+ num2.getValue().convert_to< Float::RawValueType >() );
+}
+
+
+/**
+ * operator<
+ */
+// Integer < Number
+inline bool operator<(const Integer & num1, const Integer & num2)
+{
+ return( num1.getValue() < num2.getValue() );
+}
+
+inline bool operator<(const Integer & num1, const Rational & num2)
+{
+ return( num1.getValue() < num2.getValue() );
+}
+
+inline bool operator<(const Integer & num1, const Float & num2)
+{
+ return( num1.getValue() < num2.getValue() );
+}
+
+
+// Rational < Number
+inline bool operator<(const Rational & num1, const Rational & num2)
+{
+ return( num1.getValue() < num2.getValue() );
+}
+
+inline bool operator<(const Rational & num1, const Integer & num2)
+{
+ return( num1.getValue() < num2.getValue() );
+}
+
+inline bool operator<(const Rational & num1, const Float & num2)
+{
+ return( num1.getValue() < num2.getValue() );
+}
+
+
+// Float < Number
+inline bool operator<(const Float & num1, const Float & num2)
+{
+ return( num1.getValue() < num2.getValue() );
+}
+
+inline bool operator<(const Float & num1, const Rational & num2)
+{
+ return( num1.getValue() < num2.getValue() );
+}
+
+inline bool operator<(const Float & num1, const Integer & num2)
+{
+ return( num1.getValue() <
+ num2.getValue().convert_to< Float::RawValueType >() );
+}
+
+/**
+ * operator<=
+ */
+// Integer <= Number
+inline bool operator<=(const Integer & num1, const Integer & num2)
+{
+ return( num1.getValue() <= num2.getValue() );
+}
+
+inline bool operator<=(const Integer & num1, const Rational & num2)
+{
+ return( num1.getValue() <= num2.getValue() );
+}
+
+inline bool operator<=(const Integer & num1, const Float & num2)
+{
+ return( num1.getValue() <= num2.getValue() );
+}
+
+
+// Rational <= Number
+inline bool operator<=(const Rational & num1, const Rational & num2)
+{
+ return( num1.getValue() <= num2.getValue() );
+}
+
+inline bool operator<=(const Rational & num1, const Integer & num2)
+{
+ return( num1.getValue() <= num2.getValue() );
+}
+
+inline bool operator<=(const Rational & num1, const Float & num2)
+{
+ return( num1.getValue() <= num2.getValue() );
+}
+
+
+// Float <= Number
+inline bool operator<=(const Float & num1, const Float & num2)
+{
+ return( num1.getValue() <= num2.getValue() );
+}
+
+inline bool operator<=(const Float & num1, const Rational & num2)
+{
+ return( num1.getValue() <= num2.getValue() );
+}
+
+inline bool operator<=(const Float & num1, const Integer & num2)
+{
+ return( num1.getValue() <=
+ num2.getValue().convert_to< Float::RawValueType >() );
+}
+
+
+/**
+ * operator>
+ */
+// Integer > Number
+inline bool operator>(const Integer & num1, const Integer & num2)
+{
+ return( num1.getValue() > num2.getValue() );
+}
+
+inline bool operator>(const Integer & num1, const Rational & num2)
+{
+ return( num1.getValue() > num2.getValue() );
+}
+
+inline bool operator>(const Integer & num1, const Float & num2)
+{
+ return( num1.getValue() > num2.getValue() );
+}
+
+
+// Rational > Number
+inline bool operator>(const Rational & num1, const Rational & num2)
+{
+ return( num1.getValue() > num2.getValue() );
+}
+
+inline bool operator>(const Rational & num1, const Integer & num2)
+{
+ return( num1.getValue() > num2.getValue() );
+}
+
+inline bool operator>(const Rational & num1, const Float & num2)
+{
+ return( num1.getValue() > num2.getValue() );
+}
+
+
+// Float > Number
+inline bool operator>(const Float & num1, const Float & num2)
+{
+ return( num1.getValue() > num2.getValue() );
+}
+
+inline bool operator>(const Float & num1, const Rational & num2)
+{
+ return( num1.getValue() > num2.getValue() );
+}
+
+inline bool operator>(const Float & num1, const Integer & num2)
+{
+ return( num1.getValue() >
+ num2.getValue().convert_to< Float::RawValueType >() );
+}
+
+/**
+ * operator>=
+ */
+// Integer >= Number
+inline bool operator>=(const Integer & num1, const Integer & num2)
+{
+ return( num1.getValue() >= num2.getValue() );
+}
+
+inline bool operator>=(const Integer & num1, const Rational & num2)
+{
+ return( num1.getValue() >= num2.getValue() );
+}
+
+inline bool operator>=(const Integer & num1, const Float & num2)
+{
+ return( num1.getValue() >= num2.getValue() );
+}
+
+
+// Rational >= Number
+inline bool operator>=(const Rational & num1, const Rational & num2)
+{
+ return( num1.getValue() >= num2.getValue() );
+}
+
+inline bool operator>=(const Rational & num1, const Integer & num2)
+{
+ return( num1.getValue() >= num2.getValue() );
+}
+
+inline bool operator>=(const Rational & num1, const Float & num2)
+{
+ return( num1.getValue() >= num2.getValue() );
+}
+
+
+// Float >= Number
+inline bool operator>=(const Float & num1, const Float & num2)
+{
+ return( num1.getValue() >= num2.getValue() );
+}
+
+inline bool operator>=(const Float & num1, const Rational & num2)
+{
+ return( num1.getValue() >= num2.getValue() );
+}
+
+inline bool operator>=(const Float & num1, const Integer & num2)
+{
+ return( num1.getValue() >=
+ num2.getValue().convert_to< Float::RawValueType >() );
+}
+
+
+/**
+ * operator+
+ */
+// Integer + Number
+inline Integer operator+(const Integer & num1, const Integer & num2)
+{
+ return( Integer(num1.getValue() + num2.getValue()) );
+}
+
+inline Rational operator+(const Integer & num1, const Rational & num2)
+{
+ return( Rational(num1.getValue() + num2.getValue()) );
+}
+
+inline Float operator+(const Integer & num1, const Float & num2)
+{
+ return( Float(num1.getValue() + num2.getValue()) );
+}
+
+
+// Rational + Number
+inline Rational operator+(const Rational & num1, const Rational & num2)
+{
+ return( Rational(num1.getValue() + num2.getValue()) );
+}
+
+inline Rational operator+(const Rational & num1, const Integer & num2)
+{
+ return( Rational(num1.getValue() + num2.getValue()) );
+}
+
+inline Float operator+(const Rational & num1, const Float & num2)
+{
+ return( Float(num1.getValue() + num2.getValue()) );
+}
+
+
+// Float + Number
+inline Float operator+(const Float & num1, const Float & num2)
+{
+ return( Float(num1.getValue() + num2.getValue()) );
+}
+
+inline Float operator+(const Float & num1, const Rational & num2)
+{
+ return( Float(num1.getValue() + num2.getValue()) );
+}
+
+inline Float operator+(const Float & num1, const Integer & num2)
+{
+ return( Float(num1.getValue() +
+ num2.getValue().convert_to< Float::RawValueType >() ) );
+}
+
+
+/**
+ * operator-
+ */
+inline Integer operator-(const Integer & num)
+{
+ return( Integer(- num.getValue()) );
+}
+
+inline Rational operator-(const Rational & num)
+{
+ return( Rational(- num.getValue()) );
+}
+
+inline Float operator-(const Float & num)
+{
+ return( Float(- num.getValue()) );
+}
+
+
+/**
+ * operator-
+ */
+// Integer - Number
+inline Integer operator-(const Integer & num1, const Integer & num2)
+{
+ return( Integer(num1.getValue() - num2.getValue()) );
+}
+
+inline Rational operator-(const Integer & num1, const Rational & num2)
+{
+ return( Rational(num1.getValue() - num2.getValue()) );
+}
+
+inline Float operator-(const Integer & num1, const Float & num2)
+{
+ return( Float(num1.getValue() - num2.getValue()) );
+}
+
+
+// Rational - Number
+inline Rational operator-(const Rational & num1, const Rational & num2)
+{
+ return( Rational(num1.getValue() - num2.getValue()) );
+}
+
+inline Rational operator-(const Rational & num1, const Integer & num2)
+{
+ return( Rational(num1.getValue() - num2.getValue()) );
+}
+
+inline Float operator-(const Rational & num1, const Float & num2)
+{
+ return( Float(num1.getValue() - num2.getValue()) );
+}
+
+
+// Float - Number
+inline Float operator-(const Float & num1, const Float & num2)
+{
+ return( Float(num1.getValue() - num2.getValue()) );
+}
+
+inline Float operator-(const Float & num1, const Rational & num2)
+{
+ return( Float(num1.getValue() - num2.getValue()) );
+}
+
+inline Float operator-(const Float & num1, const Integer & num2)
+{
+ return( Float(num1.getValue() -
+ num2.getValue().convert_to< Float::RawValueType >() ) );
+}
+
+
+/**
+ * operator*
+ */
+// Integer * Number
+inline Integer operator*(const Integer & num1, const Integer & num2)
+{
+ return( Integer(num1.getValue() * num2.getValue()) );
+}
+
+inline Rational operator*(const Integer & num1, const Rational & num2)
+{
+ return( Rational(num1.getValue() * num2.getValue()) );
+}
+
+inline Float operator*(const Integer & num1, const Float & num2)
+{
+ return( Float(num1.getValue() * num2.getValue()) );
+}
+
+
+// Rational * Number
+inline Rational operator*(const Rational & num1, const Rational & num2)
+{
+ return( Rational(num1.getValue() * num2.getValue()) );
+}
+
+inline Rational operator*(const Rational & num1, const Integer & num2)
+{
+ return( Rational(num1.getValue() * num2.getValue()) );
+}
+
+inline Float operator*(const Rational & num1, const Float & num2)
+{
+ return( Float(num1.getValue() * num2.getValue()) );
+}
+
+
+// Float * Number
+inline Float operator*(const Float & num1, const Float & num2)
+{
+ return( Float(num1.getValue() * num2.getValue()) );
+}
+
+inline Float operator*(const Float & num1, const Rational & num2)
+{
+ return( Float(num1.getValue() * num2.getValue()) );
+}
+
+inline Float operator*(const Float & num1, const Integer & num2)
+{
+ return( Float(num1.getValue() *
+ num2.getValue().convert_to< Float::RawValueType >() ) );
+}
+
+
+/**
+ * pow
+ */
+inline Integer pow(const Integer & num, avm_uinteger_t anExponent)
+{
+ return( Integer( num.pow(anExponent) ) );
+}
+
+inline Rational pow(const Rational & num, avm_uinteger_t anExponent)
+{
+ Rational result( num );
+ result.set_pow( anExponent );
+
+ return( Rational( result ) );
+}
+
+inline Float pow(const Float & num, avm_uinteger_t anExponent)
+{
+ Float result( num );
+ result.set_pow( anExponent );
+
+ return( Float( result ) );
+}
+
+
+/**
+ * operator/
+ */
+// Integer / Number
+inline Rational operator/(const Integer & num1, const Integer & num2)
+{
+ return( Rational( num1.getValue() , num2.getValue() ) );
+}
+
+inline Rational operator/(const Integer & num1, const Rational & num2)
+{
+ return( Rational(num1.getValue() / num2.getValue()) );
+}
+
+inline Float operator/(const Integer & num1, const Float & num2)
+{
+ return( Float(num1.getValue() / num2.getValue()) );
+}
+
+
+// Rational / Number
+inline Rational operator/(const Rational & num1, const Rational & num2)
+{
+ return( Rational(num1.getValue() / num2.getValue()) );
+}
+
+inline Rational operator/(const Rational & num1, const Integer & num2)
+{
+ return( Rational(num1.getValue() / num2.getValue()) );
+}
+
+inline Float operator/(const Rational & num1, const Float & num2)
+{
+ return( Float(num1.getValue() / num2.getValue()) );
+}
+
+// Float / Number
+inline Float operator/(const Float & num1, const Float & num2)
+{
+ return( Float(num1.getValue() / num2.getValue()) );
+}
+
+inline Float operator/(const Float & num1, const Rational & num2)
+{
+ return( Float(num1.getValue() / num2.getValue()) );
+}
+
+inline Float operator/(const Float & num1, const Integer & num2)
+{
+ return( Float(num1.getValue() /
+ num2.getValue().convert_to< Float::RawValueType >() ) );
+}
+
+
+/**
+ * inverse
+ */
+inline Rational inverse(const Integer & num)
+{
+ return( Rational( Integer(1) , num ) );
+}
+
+inline Rational inverse(const Rational & num)
+{
+ return( Rational( num.rawDenominator() , num.rawNumerator() ) );
+}
+
+inline Float inverse(const Float & num)
+{
+ return( Float( 1 / num.getValue() ) );
+}
+
+
+} /* namespace numeric */
+} /* namespace sep */
+
+#endif /* FML_NUMERIC_BOOST_NUMERICIMPL_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/numeric/boost/RationalImpl.h b/org.eclipse.efm.symbex/src/fml/numeric/boost/RationalImpl.h
new file mode 100644
index 0000000..2dda500
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/numeric/boost/RationalImpl.h
@@ -0,0 +1,539 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 mai 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#ifndef FML_NUMERIC_BOOST_RATIONALIMPL_H_
+#define FML_NUMERIC_BOOST_RATIONALIMPL_H_
+
+#include <boost/multiprecision/cpp_int.hpp>
+#include <boost/multiprecision/detail/default_ops.hpp>
+
+#include <fml/numeric/Number.h>
+
+#include <fml/numeric/Integer.h>
+
+#include <cmath>
+
+
+namespace sep
+{
+
+
+class Rational :
+ public Number,
+ public GenericNumberClass< boost::multiprecision::cpp_rational , Rational >
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( Rational )
+
+
+ /**
+ * TYPEDEF
+ */
+public:
+ typedef boost::multiprecision::cpp_rational RawValueType;
+
+private:
+ typedef GenericNumberClass< RawValueType , Rational > ThisNumberClass;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ // RawValueType
+ Rational(const RawValueType & aValue)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( aValue )
+ {
+ simplif();
+ }
+
+ // Integer / Integer
+ Rational(const Integer & aNumerator, const Integer & aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(
+ aNumerator.getValue(), aDenominator.getValue() ) )
+ {
+ simplif();
+ }
+
+ // Integer::RawValueType / Integer::RawValueType
+ // i.e boost::multiprecision::cpp_int / boost::multiprecision::cpp_int
+ Rational(const Integer::RawValueType & aNumerator,
+ const Integer::RawValueType & aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(aNumerator, aDenominator) )
+ {
+ simplif();
+ }
+
+ // avm_integer_t / avm_integer_t i.e. avm_int64_t / avm_int64_t
+ Rational(avm_integer_t aNumerator, avm_integer_t aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(
+ Integer::RawValueType( aNumerator ),
+ Integer::RawValueType( aDenominator ) ) )
+ {
+ simplif();
+ }
+
+ // avm_integer_t / avm_uinteger_t i.e. avm_int64_t / avm_uint64_t
+ Rational(avm_integer_t aNumerator, avm_uinteger_t aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(
+ Integer::RawValueType( aNumerator ),
+ Integer::RawValueType( aDenominator ) ) )
+ {
+ simplif();
+ }
+
+ // avm_uinteger_t / avm_integer_t i.e. avm_uint64_t / avm_int64_t
+ Rational(avm_uinteger_t aNumerator, avm_integer_t aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(
+ Integer::RawValueType( aNumerator ),
+ Integer::RawValueType( aDenominator ) ) )
+ {
+ simplif();
+ }
+
+ // avm_uinteger_t / avm_uinteger_t i.e. avm_uint64_t / avm_uint64_t
+ Rational(avm_uinteger_t aNumerator, avm_uinteger_t aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(
+ Integer::RawValueType( aNumerator ),
+ Integer::RawValueType( aDenominator ) ) )
+ {
+ //!! NOTHING
+ }
+
+ // std::string / avm_integer_t i.e. std::string / avm_int64_t
+ Rational(const std::string & aNumerator, avm_integer_t aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(
+ Integer::RawValueType( aNumerator ),
+ Integer::RawValueType( aDenominator ) ) )
+ {
+ simplif();
+ }
+
+ // avm_integer_t / std::string i.e. avm_int64_t / std::string
+ Rational(avm_integer_t aNumerator, const std::string & aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(
+ Integer::RawValueType( aNumerator ),
+ Integer::RawValueType( aDenominator ) ) )
+ {
+ simplif();
+ }
+
+ // std::string / std::string
+ Rational(const std::string & aNumerator, const std::string & aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(
+ Integer::RawValueType(aNumerator),
+ Integer::RawValueType(aDenominator) ) )
+ {
+ simplif();
+ }
+
+ // Integer
+ Rational(const Integer & aNumerator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType( aNumerator.getValue() ) )
+ {
+ simplif();
+ }
+
+ // Integer::RawValueType i.e boost::multiprecision::cpp_int
+ Rational(const Integer::RawValueType & aNumerator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(aNumerator) )
+ {
+ simplif();
+ }
+
+ // avm_integer_t i.e. avm_int64_t
+ Rational(avm_integer_t aNumerator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType( Integer::RawValueType( aNumerator ) ) )
+ {
+ simplif();
+ }
+
+ // avm_uinteger_t i.e. avm_uint64_t
+ Rational(avm_uinteger_t aNumerator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType( Integer::RawValueType( aNumerator ) ) )
+ {
+ simplif();
+ }
+
+#ifdef _AVM_NEED_INT64_T_OVERLOADS_
+
+ // long
+ Rational(long aNumerator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType( Integer::RawValueType(aNumerator) ) )
+ {
+ simplif();
+ }
+
+ // unsigned long
+ Rational(unsigned long aNumerator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType( Integer::RawValueType(aNumerator) ) )
+ {
+ simplif();
+ }
+
+#endif /* _AVM_NEED_INT64_T_OVERLOADS_ */
+
+ // int32_t
+ Rational(int aNumerator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType( Integer::RawValueType(aNumerator) ) )
+ {
+ simplif();
+ }
+
+ // uint32_t
+ Rational(unsigned int aNumerator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType( Integer::RawValueType(aNumerator) ) )
+ {
+ simplif();
+ }
+
+ // std::string
+ Rational(const std::string & aRational)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType( ) )
+ {
+ fromString(ThisNumberClass::mValue, aRational);
+
+ simplif();
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ Rational(const Rational & aRational)
+ : Number( aRational ),
+ ThisNumberClass( aRational )
+ {
+ simplif();
+ }
+
+
+ inline static void fromString(RawValueType & rop, const std::string & aValue)
+ {
+ std::string::size_type pos = aValue.find('/');
+ if( pos != std::string::npos)
+ {
+ rop = RawValueType( aValue );
+ }
+ else if( (pos = aValue.find('.')) != std::string::npos )
+ {
+ Integer aNumer( std::string(aValue).erase(pos, 1) );
+
+ Integer aDenom = Integer::pow(10, aValue.size() - (pos + 1));
+
+ rop = RawValueType( aNumer.getValue(), aDenom.getValue() );
+ }
+ else
+ {
+ rop = RawValueType( aValue );
+ }
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Rational()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * ThisNumberClass::mValue
+ */
+ bool simplif()
+ {
+ return( true );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * ThisNumberClass::mValue
+ */
+ inline Integer getNumerator() const
+ {
+ return( Integer( boost::multiprecision::numerator(
+ ThisNumberClass::mValue ) ) );
+ }
+
+ inline Integer getDenominator() const
+ {
+ return( Integer( boost::multiprecision::denominator(
+ ThisNumberClass::mValue ) ) );
+ }
+
+
+ inline Integer::RawValueType rawNumerator() const
+ {
+ return( boost::multiprecision::numerator(
+ ThisNumberClass::mValue ) );
+ }
+
+ inline Integer::RawValueType rawDenominator() const
+ {
+ return( boost::multiprecision::denominator(
+ ThisNumberClass::mValue ) );
+ }
+
+
+ inline void setValue(avm_integer_t aNumerator, avm_integer_t aDenominator)
+ {
+ ThisNumberClass::mValue = RawValueType(
+ Integer::RawValueType( aNumerator ),
+ Integer::RawValueType( aDenominator ) );
+ }
+
+
+ inline void setValue(avm_integer_t aValue)
+ {
+ ThisNumberClass::mValue = RawValueType( Integer(aValue).getValue() );
+ }
+
+
+ /**
+ * BASICS TESTS
+ */
+ virtual inline int sign() const
+ {
+ return( ThisNumberClass::mValue.sign() );
+ }
+
+ virtual inline bool isZero() const
+ {
+ return( ThisNumberClass::mValue.is_zero() );
+ }
+
+ virtual inline bool isOne() const
+ {
+ return( ThisNumberClass::mValue == 1 );
+ }
+
+ virtual inline bool isNegativeOne() const
+ {
+ return( ThisNumberClass::mValue == -1 );
+ }
+
+
+ /**
+ * CONVERSION
+ */
+#define CPP_RAT_IS_INTEGER(RAT_NUM_INT, RAT_DEN_INT, INT_T) \
+ ( RAT_DEN_INT == 1 ) \
+ && ( RAT_NUM_INT == RAT_NUM_INT.convert_to< INT_T >() )
+// && boost::multiprecision::default_ops::check_in_range< INT_T >( RAT_NUM_INT )
+
+#define CPP_RAT_IS_POSITIVE_INTEGER(RAT_NUM_INT, RAT_DEN_INT, INT_T) \
+ ( RAT_NUM_INT.sign() >= 0 ) \
+ && ( RAT_DEN_INT == 1 ) \
+ && ( RAT_NUM_INT == RAT_NUM_INT.convert_to< INT_T >() )
+// && boost::multiprecision::default_ops::check_in_range< INT_T >( RAT_NUM_INT )
+
+
+ inline virtual bool isInt32() const
+ {
+ return( CPP_RAT_IS_INTEGER(
+ rawNumerator(), rawDenominator(), avm_int32_t) );
+ }
+
+ inline virtual avm_int32_t toInt32() const
+ {
+ return( ThisNumberClass::mValue.convert_to< avm_int32_t >() );
+ }
+
+
+ inline virtual bool isInt64() const
+ {
+ return( CPP_RAT_IS_INTEGER(
+ rawNumerator(), rawDenominator(), avm_int64_t) );
+ }
+
+ inline virtual avm_int64_t toInt64() const
+ {
+ return( ThisNumberClass::mValue.convert_to< avm_int64_t >() );
+ }
+
+
+ inline virtual bool isInteger() const
+ {
+ return( CPP_RAT_IS_INTEGER(
+ rawNumerator(), rawDenominator(), avm_integer_t) );
+ }
+
+ inline virtual avm_integer_t toInteger() const
+ {
+ return( ThisNumberClass::mValue.convert_to< avm_integer_t >() );
+ }
+
+
+ inline virtual bool isPosInteger() const
+ {
+ return( CPP_RAT_IS_POSITIVE_INTEGER(
+ rawNumerator(), rawDenominator(), avm_uinteger_t) );
+ }
+
+
+ inline virtual bool isUInteger() const
+ {
+ return( CPP_RAT_IS_POSITIVE_INTEGER(
+ rawNumerator(), rawDenominator(), avm_uinteger_t) );
+ }
+
+ inline virtual avm_uinteger_t toUInteger() const
+ {
+ return( ThisNumberClass::mValue.convert_to< avm_uinteger_t >() );
+ }
+
+
+ inline virtual bool isRational() const
+ {
+ return( isInteger() );
+ }
+
+ virtual avm_integer_t toNumerator() const
+ {
+ return( ThisNumberClass::mValue.convert_to< avm_integer_t >() );
+ }
+
+ virtual avm_integer_t toDenominator() const
+ {
+ return( static_cast< avm_integer_t >( 1 ) );
+ }
+
+
+#define CPP_INT_IS_FLOAT(CPP_INT, FLOAT_T) \
+ boost::multiprecision::default_ops::check_in_range< FLOAT_T >( \
+ CPP_INT.convert_to< boost::multiprecision::cpp_dec_float<0> >() )
+// ( CPP_INT == CPP_INT.convert_to< FLOAT_T >() )
+
+
+ inline virtual bool isFloat() const
+ {
+ return( false );
+// return( CPP_INT_IS_FLOAT(ThisNumberClass::mValue, avm_float_t) );
+ }
+
+
+ inline virtual avm_float_t toFloat() const
+ {
+ return( ThisNumberClass::mValue.convert_to< avm_float_t >() );
+ }
+
+
+ inline virtual bool isReal() const
+ {
+ return( false );
+// return( CPP_INT_IS_FLOAT(ThisNumberClass::mValue, avm_real_t) );
+ }
+
+ inline virtual avm_real_t toReal() const
+ {
+ return( ThisNumberClass::mValue.convert_to< avm_real_t >() );
+ }
+
+
+ /**
+ * math function
+ */
+ inline void set_pow(avm_uinteger_t anExponent)
+ {
+ Integer::RawValueType num = boost::multiprecision::pow(
+ boost::multiprecision::numerator(ThisNumberClass::mValue),
+ anExponent);
+
+ Integer::RawValueType den = boost::multiprecision::pow(
+ boost::multiprecision::denominator(ThisNumberClass::mValue),
+ anExponent);
+
+ ThisNumberClass::mValue = boost::multiprecision::cpp_rational(num, den);
+ }
+
+
+ /**
+ * Serialization
+ */
+ inline void toStream(OutStream & os) const
+ {
+ os << TAB << ThisNumberClass::mValue;
+ AVM_DEBUG_REF_COUNTER(os);
+ os << EOL_FLUSH;
+ }
+
+ virtual std::string str() const
+ {
+ if( rawDenominator() != 1 )
+ {
+ return( OSS() << rawNumerator() << '/' << rawDenominator() );
+ }
+ else
+ {
+ return( OSS() << rawNumerator() );
+ }
+ }
+
+ inline virtual std::string strNum(
+ avm_uint8_t precision = AVM_MUMERIC_PRECISION) const
+ {
+ if( rawDenominator() != 1 )
+ {
+ return( OSS() << rawNumerator() << '/' << rawDenominator() );
+ }
+ else
+ {
+ return( OSS() << rawNumerator() );
+ }
+ }
+
+ inline virtual std::string strNumerator(
+ avm_uint8_t precision = AVM_MUMERIC_PRECISION) const
+ {
+ return( OSS() << rawNumerator() );
+ }
+
+ inline virtual std::string strDenominator(
+ avm_uint8_t precision = AVM_MUMERIC_PRECISION) const
+ {
+ return( OSS() << rawDenominator() );
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* FML_NUMERIC_BOOST_RATIONALIMPL_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/numeric/gmp/FloatImpl.h b/org.eclipse.efm.symbex/src/fml/numeric/gmp/FloatImpl.h
new file mode 100644
index 0000000..c786fe9
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/numeric/gmp/FloatImpl.h
@@ -0,0 +1,407 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 mai 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#ifndef FML_NUMERIC_GMP_FLOATIMPL_H_
+#define FML_NUMERIC_GMP_FLOATIMPL_H_
+
+#include <gmpxx.h>
+
+#include <fml/numeric/Number.h>
+
+#include <fml/numeric/Integer.h>
+#include <fml/numeric/Rational.h>
+
+
+namespace sep
+{
+
+
+class Float :
+ public Number,
+ public GenericNumberClass< mpf_class , Float >
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( Float )
+
+
+ /**
+ * TYPEDEF
+ */
+public:
+ typedef mpf_class RawValueType;
+
+private:
+ typedef GenericNumberClass< RawValueType , Float > ThisNumberClass;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ // RawValueType
+ Float(const RawValueType & aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType( aValue ) )
+ {
+ //!! NOTHING
+ }
+
+ // mpq_class
+ Float(const mpq_class & aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType( aValue ) )
+ {
+ //!! NOTHING
+ }
+
+ // mpq_t
+ Float(const mpq_t & aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType( mpq_class(aValue) ) )
+ {
+ //!! NOTHING
+ }
+
+
+ // mpz_class
+ Float(const mpz_class & aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ // mpz_t
+ Float(const mpz_t & aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType( mpz_class(aValue) ) )
+ {
+ //!! NOTHING
+ }
+
+ // Rational
+ Float(const Rational & aRational)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType( aRational.getValue() ) )
+ //ThisNumberClass( RawValueType( static_cast<sep::BasicRational>(aRational).getValue() ) )
+ //ThisNumberClass( RawValueType( reinterpret_cast<__gmp_expr>(aRational).getValue() ) )
+ //ThisNumberClass( RawValueType( reinterpret_cast<GenericNumberClass>(aRational).getValue() ) )
+ //ThisNumberClass( RawValueType( reinterpret_cast<GenericNumberClass<mpq_class , Rational>>(aRational).getValue() ) )
+ {
+ //!! NOTHING
+ }
+
+ // Integer
+ Float(const Integer & anInteger)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType( anInteger.getValue() ) )
+ //ThisNumberClass( RawValueType( reinterpret_cast<GenericNumberClass>(anInteger).getValue() ) )
+ //ThisNumberClass( RawValueType( reinterpret_cast<GenericNumberClass<mpz_class , Integer>>(anInteger).getValue() ) )
+ {
+ //!! NOTHING
+ }
+
+ // avm_float_t
+ Float(avm_float_t aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+#ifdef _AVM_NEED_INT64_T_OVERLOADS_
+
+ // avm_integer_t i.e. avm_int64_t
+ Float(avm_integer_t aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType( static_cast< long >(aValue) ) )
+ {
+ //!! NOTHING
+ }
+
+ // avm_uinteger_t i.e. avm_uint64_t
+ Float(avm_uinteger_t aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType( static_cast< unsigned long >(aValue) ) )
+ {
+ //!! NOTHING
+ }
+
+ // long
+ Float(long aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType( aValue ) )
+ {
+ //!! NOTHING
+ }
+
+ Float(unsigned long aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType( aValue ) )
+ {
+ //!! NOTHING
+ }
+
+#else
+
+ // avm_integer_t i.e. avm_int64_t
+ Float(avm_integer_t aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ // avm_uinteger_t i.e. avm_uint64_t
+ Float(avm_uinteger_t aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+#endif /* _AVM_NEED_INT64_T_OVERLOADS_ */
+
+ // int32_t
+ Float(int aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ // uint32_t
+ Float(unsigned int aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ // std::string
+ Float(const std::string & aValue)
+ : Number( CLASS_KIND_T( Float ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ Float(const Float & aFloat)
+ : Number( aFloat ),
+ ThisNumberClass( aFloat )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Float()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * BASICS TESTS
+ */
+ virtual inline int sign() const
+ {
+ return( mpf_sgn(ThisNumberClass::mValue.get_mpf_t()) );
+ }
+
+ virtual inline bool isZero() const
+ {
+ return( sign() == 0 );
+ }
+
+ virtual inline bool isOne() const
+ {
+ return( mpf_cmp_si(ThisNumberClass::mValue.get_mpf_t(), 1) == 0 );
+ }
+
+ virtual inline bool isNegativeOne() const
+ {
+ return( mpf_cmp_si(ThisNumberClass::mValue.get_mpf_t(), -1) == 0 );
+ }
+
+
+ /**
+ * CONVERSION
+ */
+#define MPF_IS_INTEGER(MPF_VAL, INF, SUP) \
+ (mpf_cmp_si(MPF_VAL.get_mpf_t(), MPF_VAL.get_si()) == 0) && \
+ (mpf_cmp_si(MPF_VAL.get_mpf_t(), INF) >= 0) && \
+ (mpf_cmp_ui(MPF_VAL.get_mpf_t(), SUP) <= 0)
+
+#define MPF_IS_POSITIVE_INTEGER(MPF_VAL, SUP) (sign() >= 0) && \
+ (mpf_cmp_ui(MPF_VAL.get_mpf_t(), MPF_VAL.get_ui()) == 0) && \
+ (mpf_cmp_ui(MPF_VAL.get_mpf_t(), SUP) <= 0)
+
+
+ inline virtual bool isInt32() const
+ {
+ return( MPF_IS_INTEGER(ThisNumberClass::mValue,
+ AVM_NUMERIC_MIN_INT32, AVM_NUMERIC_MAX_INT32) );
+ }
+
+ inline virtual avm_int32_t toInt32() const
+ {
+ return( static_cast< avm_int32_t >(
+ ThisNumberClass::mValue.get_si() ) );
+ }
+
+
+ inline virtual bool isInt64() const
+ {
+ return( MPF_IS_INTEGER(ThisNumberClass::mValue,
+ AVM_NUMERIC_MIN_INT64, AVM_NUMERIC_MAX_INT64) );
+ }
+
+ inline virtual avm_int64_t toInt64() const
+ {
+ return( static_cast< avm_int64_t >(
+ ThisNumberClass::mValue.get_si() ) );
+ }
+
+
+ inline virtual bool isInteger() const
+ {
+ return( MPF_IS_INTEGER(ThisNumberClass::mValue,
+ AVM_NUMERIC_MIN_INTEGER, AVM_NUMERIC_MAX_INTEGER) );
+ }
+
+ inline virtual avm_integer_t toInteger() const
+ {
+ return( static_cast< avm_integer_t >(
+ ThisNumberClass::mValue.get_si() ) );
+ }
+
+
+ inline virtual bool isPosInteger() const
+ {
+ return( MPF_IS_POSITIVE_INTEGER(
+ ThisNumberClass::mValue, AVM_NUMERIC_MAX_UINTEGER) );
+ }
+
+
+ inline virtual bool isUInteger() const
+ {
+ return( MPF_IS_POSITIVE_INTEGER(
+ ThisNumberClass::mValue, AVM_NUMERIC_MAX_UINTEGER) );
+ }
+
+ inline virtual avm_uinteger_t toUInteger() const
+ {
+ return( static_cast< avm_uinteger_t >(
+ ThisNumberClass::mValue.get_ui() ) );
+ }
+
+
+ inline virtual bool isRational() const
+ {
+ return( true );
+ }
+
+ virtual avm_integer_t toDenominator() const
+ {
+ return( static_cast< avm_integer_t >(
+ mpq_class(ThisNumberClass::mValue).get_den().get_si() ) );
+ }
+
+ virtual avm_integer_t toNumerator() const
+ {
+ return( static_cast< avm_integer_t >(
+ mpq_class(ThisNumberClass::mValue).get_num().get_si() ) );
+ }
+
+
+ inline virtual bool isFloat() const
+ {
+ return( true );
+ }
+
+ inline virtual avm_float_t toFloat() const
+ {
+ return( static_cast< avm_float_t >(
+ ThisNumberClass::mValue.get_d() ) );
+ }
+
+
+ inline virtual bool isReal() const
+ {
+ return( true );
+ }
+
+ inline virtual avm_real_t toReal() const
+ {
+ return( static_cast< avm_real_t >(
+ ThisNumberClass::mValue.get_d() ) );
+ }
+
+
+ /**
+ * math function
+ */
+ inline void set_pow(avm_uinteger_t anExponent)
+ {
+ RawValueType mpResult;
+
+ mpf_pow_ui( mpResult.get_mpf_t(),
+ ThisNumberClass::mValue.get_mpf_t(), anExponent );
+
+ ThisNumberClass::mValue = mpResult;
+ }
+
+ inline void set_pow(double aValue, avm_uinteger_t anExponent)
+ {
+ mpf_pow_ui( ThisNumberClass::mValue.get_mpf_t(),
+ RawValueType(aValue).get_mpf_t(), anExponent );
+ }
+
+
+ /**
+ * Serialization
+ */
+ virtual void toStream(OutStream & os) const
+ {
+ os << TAB << OS_FLOAT_PRECISION << mValue;
+ AVM_DEBUG_REF_COUNTER(os);
+ os << EOL_FLUSH;
+ }
+
+ virtual std::string str() const
+ {
+ return( OSS() /*<< OS_REAL_PRECISION*/ << mValue );
+ }
+
+ inline virtual std::string strNum(
+ avm_uint8_t precision = AVM_MUMERIC_PRECISION) const
+ {
+ return( OSS() << std::fixed
+ << std::setprecision( precision ) << mValue );
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* FML_NUMERIC_GMP_FLOATIMPL_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/numeric/gmp/IntegerImpl.h b/org.eclipse.efm.symbex/src/fml/numeric/gmp/IntegerImpl.h
new file mode 100644
index 0000000..c85fc28
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/numeric/gmp/IntegerImpl.h
@@ -0,0 +1,375 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 mai 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#ifndef FML_NUMERIC_GMP_INTEGERIMPL_H_
+#define FML_NUMERIC_GMP_INTEGERIMPL_H_
+
+#include <gmpxx.h>
+
+#include <fml/numeric/Number.h>
+
+
+namespace sep
+{
+
+
+class Integer :
+ public Number,
+ public GenericNumberClass< mpz_class , Integer >
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( Integer )
+
+
+ /**
+ * TYPEDEF
+ */
+public:
+ typedef mpz_class RawValueType;
+
+private:
+ typedef GenericNumberClass< RawValueType , Integer > ThisNumberClass;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ // RawValueType i.e. mpz_class
+ Integer(const RawValueType & aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( aValue )
+ {
+ //!! NOTHING
+ }
+
+ // mpz_t
+ Integer(const mpz_t & aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+
+#ifdef _AVM_NEED_INT64_T_OVERLOADS_
+
+ // avm_integer_t i.e. avm_int64_t
+ Integer(avm_integer_t aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( RawValueType( static_cast< long >( aValue ) ) )
+ {
+ //!! NOTHING
+ }
+
+ // avm_uinteger_t i.e. avm_uint64_t
+ Integer(avm_uinteger_t aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( RawValueType( static_cast< unsigned long >( aValue ) ) )
+ {
+ //!! NOTHING
+ }
+
+ // long
+ Integer(long aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( RawValueType( aValue ) )
+ {
+ //!! NOTHING
+ }
+
+ Integer(unsigned long aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( RawValueType( aValue ) )
+ {
+ //!! NOTHING
+ }
+
+#else
+
+ // avm_integer_t i.e. avm_int64_t
+ Integer(avm_integer_t aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ // avm_uinteger_t i.e. avm_uint64_t
+ Integer(avm_uinteger_t aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+#endif /* _AVM_NEED_INT64_T_OVERLOADS_ */
+
+ // int32_t
+ Integer(int aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ // uint32_t
+ Integer(unsigned int aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ // std::string
+ Integer(const std::string & aValue)
+ : Number( CLASS_KIND_T( Integer ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ Integer(const Integer & anInteger)
+ : Number( anInteger ),
+ ThisNumberClass( anInteger )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Integer()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * BASICS TESTS
+ */
+ virtual inline int sign() const
+ {
+ return( mpz_sgn(ThisNumberClass::mValue.get_mpz_t()) );
+ }
+
+ virtual inline bool isZero() const
+ {
+ return( sign() == 0 );
+ }
+
+ virtual inline bool isOne() const
+ {
+ return( mpz_cmp_si(ThisNumberClass::mValue.get_mpz_t(), 1) == 0 );
+ }
+
+ virtual inline bool isNegativeOne() const
+ {
+ return( mpz_cmp_si(ThisNumberClass::mValue.get_mpz_t(), -1) == 0 );
+ }
+
+
+ /**
+ * CONVERSION
+ */
+#define MPZ_IS_INTEGER(MPZ_VAL, INF, SUP) \
+ (mpz_cmp_si(MPZ_VAL.get_mpz_t(), MPZ_VAL.get_si()) == 0) && \
+ (mpz_cmp_si(MPZ_VAL.get_mpz_t(), INF) >= 0) && \
+ (mpz_cmp_ui(MPZ_VAL.get_mpz_t(), SUP) <= 0)
+
+#define MPZ_IS_POSITIVE_INTEGER(MPZ_VAL, SUP) \
+ (mpz_sgn( MPZ_VAL.get_mpz_t() ) >= 0) && \
+ (mpz_cmp_ui(MPZ_VAL.get_mpz_t(), MPZ_VAL.get_ui()) == 0) && \
+ (mpz_cmp_ui(MPZ_VAL.get_mpz_t(), SUP) <= 0)
+
+
+ inline virtual bool isInt32() const
+ {
+ return( MPZ_IS_INTEGER(ThisNumberClass::mValue,
+ AVM_NUMERIC_MIN_INT32, AVM_NUMERIC_MAX_INT32) );
+ }
+
+ inline virtual avm_int32_t toInt32() const
+ {
+ return( static_cast< avm_int32_t >(
+ ThisNumberClass::mValue.get_si() ) );
+ }
+
+ inline virtual bool isInt64() const
+ {
+ return( MPZ_IS_INTEGER(ThisNumberClass::mValue,
+ AVM_NUMERIC_MIN_INT64, AVM_NUMERIC_MAX_INT64) );
+ }
+
+ inline virtual avm_int64_t toInt64() const
+ {
+ return( static_cast< avm_int64_t >(
+ ThisNumberClass::mValue.get_si() ) );
+ }
+
+
+ inline virtual bool isInteger() const
+ {
+ return( MPZ_IS_INTEGER(ThisNumberClass::mValue,
+ AVM_NUMERIC_MIN_INTEGER, AVM_NUMERIC_MAX_INTEGER) );
+ }
+
+ inline virtual avm_integer_t toInteger() const
+ {
+ return( static_cast< avm_integer_t >(
+ ThisNumberClass::mValue.get_si() ) );
+ }
+
+
+ inline virtual bool isPosInteger() const
+ {
+ return( MPZ_IS_POSITIVE_INTEGER(
+ ThisNumberClass::mValue, AVM_NUMERIC_MAX_UINTEGER ) );
+ }
+
+
+ inline virtual bool isUInteger() const
+ {
+ return( MPZ_IS_POSITIVE_INTEGER(
+ ThisNumberClass::mValue, AVM_NUMERIC_MAX_UINTEGER ) );
+ }
+
+ inline virtual avm_uinteger_t toUInteger() const
+ {
+ return( static_cast< avm_uinteger_t >(
+ ThisNumberClass::mValue.get_ui() ) );
+ }
+
+
+ inline virtual bool isRational() const
+ {
+ return( isInteger() );
+ }
+
+ virtual avm_integer_t toNumerator() const
+ {
+ return( static_cast< avm_integer_t >(
+ ThisNumberClass::mValue.get_si() ) );
+ }
+
+ virtual avm_integer_t toDenominator() const
+ {
+ return( static_cast< avm_integer_t >( 1 ) );
+ }
+
+
+#define MPZ_IS_FLOAT(MPZ_VAL, INF, SUP) \
+ (mpz_cmp_d(MPZ_VAL.get_mpz_t(), MPZ_VAL.get_d()) == 0) && \
+ (mpz_cmp_d(MPZ_VAL.get_mpz_t(), INF) >= 0) && \
+ (mpz_cmp_d(MPZ_VAL.get_mpz_t(), SUP) <= 0)
+
+
+ inline virtual bool isFloat() const
+ {
+ return( MPZ_IS_INTEGER(ThisNumberClass::mValue,
+ AVM_NUMERIC_MIN_FLOAT_T, AVM_NUMERIC_MAX_FLOAT_T) );
+ }
+
+ inline virtual avm_float_t toFloat() const
+ {
+ return( static_cast< avm_float_t >(
+ ThisNumberClass::mValue.get_d() ) );
+ }
+
+
+ inline virtual bool isReal() const
+ {
+ return( MPZ_IS_INTEGER(ThisNumberClass::mValue,
+ AVM_NUMERIC_MIN_REAL_T, AVM_NUMERIC_MAX_REAL_T) );
+ }
+
+ inline virtual avm_real_t toReal() const
+ {
+ return( static_cast< avm_real_t >(
+ ThisNumberClass::mValue.get_d() ) );
+ }
+
+
+ /**
+ * math function
+ */
+ inline void set_pow(avm_uinteger_t anExponent)
+ {
+ RawValueType mpResult;
+
+ mpz_pow_ui( mpResult.get_mpz_t(),
+ ThisNumberClass::mValue.get_mpz_t(), anExponent );
+
+ ThisNumberClass::mValue = mpResult;
+ }
+
+ inline void set_pow(avm_uinteger_t aValue, avm_uinteger_t anExponent)
+ {
+ mpz_ui_pow_ui( ThisNumberClass::mValue.get_mpz_t(), aValue, anExponent );
+ }
+
+
+ inline Integer pow(avm_uinteger_t anExponent) const
+ {
+ RawValueType mpResult;
+
+ mpz_pow_ui( mpResult.get_mpz_t(),
+ ThisNumberClass::mValue.get_mpz_t(), anExponent );
+
+ return( Integer(mpResult) );
+ }
+
+ inline static Integer pow(avm_uinteger_t aValue, avm_uinteger_t anExponent)
+ {
+ RawValueType mpResult;
+
+ mpz_ui_pow_ui( mpResult.get_mpz_t(), aValue, anExponent );
+
+ return( Integer(mpResult) );
+ }
+
+
+ /**
+ * Serialization
+ */
+ inline void toStream(OutStream & os) const
+ {
+ os << TAB << mValue;
+ AVM_DEBUG_REF_COUNTER(os);
+ os << EOL << std::flush;
+ }
+
+ virtual std::string str() const
+ {
+ return( OSS() << mValue );
+ }
+
+ inline virtual std::string strNum(
+ avm_uint8_t precision = AVM_MUMERIC_PRECISION) const
+ {
+ return( OSS() << mValue );
+ }
+
+};
+
+} /* namespace sep */
+
+#endif /* FML_NUMERIC_GMP_INTEGERIMPL_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/numeric/gmp/NumericImpl.h b/org.eclipse.efm.symbex/src/fml/numeric/gmp/NumericImpl.h
new file mode 100644
index 0000000..eb856e3
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/numeric/gmp/NumericImpl.h
@@ -0,0 +1,698 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 16 mai 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#ifndef FML_NUMERIC_GMP_NUMERICIMPL_H_
+#define FML_NUMERIC_GMP_NUMERICIMPL_H_
+
+//#include <fml/numeric/Number.h>
+
+#include <fml/numeric/gmp/IntegerImpl.h>
+#include <fml/numeric/gmp/RationalImpl.h>
+#include <fml/numeric/gmp/FloatImpl.h>
+
+#include <gmpxx.h>
+
+
+namespace sep
+{
+namespace numeric
+{
+
+
+/**
+ * compare Integer
+ * with ...
+ */
+inline int compare(const Integer & num1, const Integer & num2)
+{
+ return( cmp(num1.getValue(), num2.getValue()) );
+ //return( cmp(reinterpret_cast<GenericNumberClass>(num1).getValue(), reinterpret_cast<GenericNumberClass>(num2).getValue()) );
+}
+
+inline int compare(const Integer & num1, const Rational & num2)
+{
+ return( cmp(num1.getValue(), num2.getValue()) );
+}
+
+inline int compare(const Integer & num1, const Float & num2)
+{
+ return( cmp(num1.getValue(), num2.getValue()) );
+}
+
+
+/**
+ * compare Rational
+ * with ...
+ */
+inline int compare(const Rational & num1, const Rational & num2)
+{
+ return( cmp(num1.getValue(), num2.getValue()) );
+}
+
+inline int compare(const Rational & num1, const Integer & num2)
+{
+ return( cmp(num1.getValue(), num2.getValue()) );
+}
+
+inline int compare(const Rational & num1, const Float & num2)
+{
+ return( cmp(num1.getValue(), num2.getValue()) );
+}
+
+
+/**
+ * compare Float
+ * with ...
+ */
+inline int compare(const Float & num1, const Float & num2)
+{
+ return( cmp(num1.getValue(), num2.getValue()) );
+}
+
+inline int compare(const Float & num1, const Integer & num2)
+{
+ return( cmp(num1.getValue(), num2.getValue()) );
+}
+
+inline int compare(const Float & num1, const Rational & num2)
+{
+ return( cmp(num1.getValue(), num2.getValue()) );
+}
+
+
+/**
+ * operator==
+ */
+// Integer == Number
+inline bool operator==(const Integer & num1, const Integer & num2)
+{
+ return( num1.getValue() == num2.getValue() );
+}
+
+inline bool operator==(const Integer & num1, const Rational & num2)
+{
+ return( num1.getValue() == num2.getValue() );
+}
+
+inline bool operator==(const Integer & num1, const Float & num2)
+{
+ return( num1.getValue() == num2.getValue() );
+}
+
+
+// Rational == Number
+inline bool operator==(const Rational & num1, const Rational & num2)
+{
+ return( num1.getValue() == num2.getValue() );
+}
+
+inline bool operator==(const Rational & num1, const Integer & num2)
+{
+ return( num1.getValue() == num2.getValue() );
+}
+
+inline bool operator==(const Rational & num1, const Float & num2)
+{
+ return( num1.getValue() == num2.getValue() );
+}
+
+
+// Float == Number
+inline bool operator==(const Float & num1, const Float & num2)
+{
+ return( num1.getValue() == num2.getValue() );
+}
+
+inline bool operator==(const Float & num1, const Rational & num2)
+{
+ return( num1.getValue() == num2.getValue() );
+}
+
+inline bool operator==(const Float & num1, const Integer & num2)
+{
+ return( num1.getValue() == num2.getValue() );
+}
+
+
+/**
+ * operator!=
+ */
+// Integer != Number
+inline bool operator!=(const Integer & num1, const Integer & num2)
+{
+ return( num1.getValue() != num2.getValue() );
+}
+
+inline bool operator!=(const Integer & num1, const Rational & num2)
+{
+ return( num1.getValue() != num2.getValue() );
+}
+
+inline bool operator!=(const Integer & num1, const Float & num2)
+{
+ return( num1.getValue() != num2.getValue() );
+}
+
+
+// Rational != Number
+inline bool operator!=(const Rational & num1, const Rational & num2)
+{
+ return( num1.getValue() != num2.getValue() );
+}
+
+inline bool operator!=(const Rational & num1, const Integer & num2)
+{
+ return( num1.getValue() != num2.getValue() );
+}
+
+inline bool operator!=(const Rational & num1, const Float & num2)
+{
+ return( num1.getValue() != num2.getValue() );
+}
+
+
+// Float != Number
+inline bool operator!=(const Float & num1, const Float & num2)
+{
+ return( num1.getValue() != num2.getValue() );
+}
+
+inline bool operator!=(const Float & num1, const Rational & num2)
+{
+ return( num1.getValue() != num2.getValue() );
+}
+
+inline bool operator!=(const Float & num1, const Integer & num2)
+{
+ return( num1.getValue() != num2.getValue() );
+}
+
+
+/**
+ * operator<
+ */
+// Integer < Number
+inline bool operator<(const Integer & num1, const Integer & num2)
+{
+ return( num1.getValue() < num2.getValue() );
+}
+
+inline bool operator<(const Integer & num1, const Rational & num2)
+{
+ return( num1.getValue() < num2.getValue() );
+}
+
+inline bool operator<(const Integer & num1, const Float & num2)
+{
+ return( num1.getValue() < num2.getValue() );
+}
+
+
+// Rational < Number
+inline bool operator<(const Rational & num1, const Rational & num2)
+{
+ return( num1.getValue() < num2.getValue() );
+}
+
+inline bool operator<(const Rational & num1, const Integer & num2)
+{
+ return( num1.getValue() < num2.getValue() );
+}
+
+inline bool operator<(const Rational & num1, const Float & num2)
+{
+ return( num1.getValue() < num2.getValue() );
+}
+
+
+// Float < Number
+inline bool operator<(const Float & num1, const Float & num2)
+{
+ return( num1.getValue() < num2.getValue() );
+}
+
+inline bool operator<(const Float & num1, const Rational & num2)
+{
+ return( num1.getValue() < num2.getValue() );
+}
+
+inline bool operator<(const Float & num1, const Integer & num2)
+{
+ return( num1.getValue() < num2.getValue() );
+}
+
+/**
+ * operator<=
+ */
+// Integer <= Number
+inline bool operator<=(const Integer & num1, const Integer & num2)
+{
+ return( num1.getValue() <= num2.getValue() );
+}
+
+inline bool operator<=(const Integer & num1, const Rational & num2)
+{
+ return( num1.getValue() <= num2.getValue() );
+}
+
+inline bool operator<=(const Integer & num1, const Float & num2)
+{
+ return( num1.getValue() <= num2.getValue() );
+}
+
+
+// Rational <= Number
+inline bool operator<=(const Rational & num1, const Rational & num2)
+{
+ return( num1.getValue() <= num2.getValue() );
+}
+
+inline bool operator<=(const Rational & num1, const Integer & num2)
+{
+ return( num1.getValue() <= num2.getValue() );
+}
+
+inline bool operator<=(const Rational & num1, const Float & num2)
+{
+ return( num1.getValue() <= num2.getValue() );
+}
+
+
+// Float <= Number
+inline bool operator<=(const Float & num1, const Float & num2)
+{
+ return( num1.getValue() <= num2.getValue() );
+}
+
+inline bool operator<=(const Float & num1, const Rational & num2)
+{
+ return( num1.getValue() <= num2.getValue() );
+}
+
+inline bool operator<=(const Float & num1, const Integer & num2)
+{
+ return( num1.getValue() <= num2.getValue() );
+}
+
+
+/**
+ * operator>
+ */
+// Integer > Number
+inline bool operator>(const Integer & num1, const Integer & num2)
+{
+ return( num1.getValue() > num2.getValue() );
+}
+
+inline bool operator>(const Integer & num1, const Rational & num2)
+{
+ return( num1.getValue() > num2.getValue() );
+}
+
+inline bool operator>(const Integer & num1, const Float & num2)
+{
+ return( num1.getValue() > num2.getValue() );
+}
+
+
+// Rational > Number
+inline bool operator>(const Rational & num1, const Rational & num2)
+{
+ return( num1.getValue() > num2.getValue() );
+}
+
+inline bool operator>(const Rational & num1, const Integer & num2)
+{
+ return( num1.getValue() > num2.getValue() );
+}
+
+inline bool operator>(const Rational & num1, const Float & num2)
+{
+ return( num1.getValue() > num2.getValue() );
+}
+
+
+// Float > Number
+inline bool operator>(const Float & num1, const Float & num2)
+{
+ return( num1.getValue() > num2.getValue() );
+}
+
+inline bool operator>(const Float & num1, const Rational & num2)
+{
+ return( num1.getValue() > num2.getValue() );
+}
+
+inline bool operator>(const Float & num1, const Integer & num2)
+{
+ return( num1.getValue() > num2.getValue() );
+}
+
+/**
+ * operator>=
+ */
+// Integer >= Number
+inline bool operator>=(const Integer & num1, const Integer & num2)
+{
+ return( num1.getValue() >= num2.getValue() );
+}
+
+inline bool operator>=(const Integer & num1, const Rational & num2)
+{
+ return( num1.getValue() >= num2.getValue() );
+}
+
+inline bool operator>=(const Integer & num1, const Float & num2)
+{
+ return( num1.getValue() >= num2.getValue() );
+}
+
+
+// Rational >= Number
+inline bool operator>=(const Rational & num1, const Rational & num2)
+{
+ return( num1.getValue() >= num2.getValue() );
+}
+
+inline bool operator>=(const Rational & num1, const Integer & num2)
+{
+ return( num1.getValue() >= num2.getValue() );
+}
+
+inline bool operator>=(const Rational & num1, const Float & num2)
+{
+ return( num1.getValue() >= num2.getValue() );
+}
+
+
+// Float >= Number
+inline bool operator>=(const Float & num1, const Float & num2)
+{
+ return( num1.getValue() >= num2.getValue() );
+}
+
+inline bool operator>=(const Float & num1, const Rational & num2)
+{
+ return( num1.getValue() >= num2.getValue() );
+}
+
+inline bool operator>=(const Float & num1, const Integer & num2)
+{
+ return( num1.getValue() >= num2.getValue() );
+}
+
+
+/**
+ * operator+
+ */
+// Integer + Number
+inline Integer operator+(const Integer & num1, const Integer & num2)
+{
+ return( Integer(num1.getValue() + num2.getValue()) );
+}
+
+inline Rational operator+(const Integer & num1, const Rational & num2)
+{
+ return( Rational(num1.getValue() + num2.getValue()) );
+}
+
+inline Float operator+(const Integer & num1, const Float & num2)
+{
+ return( Float(num1.getValue() + num2.getValue()) );
+}
+
+
+// Rational + Number
+inline Rational operator+(const Rational & num1, const Rational & num2)
+{
+ return( Rational(num1.getValue() + num2.getValue()) );
+}
+
+inline Rational operator+(const Rational & num1, const Integer & num2)
+{
+ return( Rational(num1.getValue() + num2.getValue()) );
+}
+
+inline Float operator+(const Rational & num1, const Float & num2)
+{
+ return( Float(num1.getValue() + num2.getValue()) );
+}
+
+
+// Float + Number
+inline Float operator+(const Float & num1, const Float & num2)
+{
+ return( Float(num1.getValue() + num2.getValue()) );
+}
+
+inline Float operator+(const Float & num1, const Rational & num2)
+{
+ return( Float(num1.getValue() + num2.getValue()) );
+}
+
+inline Float operator+(const Float & num1, const Integer & num2)
+{
+ return( Float(num1.getValue() + num2.getValue()) );
+}
+
+
+/**
+ * operator-
+ */
+inline Integer operator-(const Integer & num)
+{
+ return( Integer(- num.getValue()) );
+}
+
+inline Rational operator-(const Rational & num)
+{
+ return( Rational(- num.getValue()) );
+}
+
+inline Float operator-(const Float & num)
+{
+ return( Float(- num.getValue()) );
+}
+
+
+/**
+ * operator-
+ */
+// Integer - Number
+inline Integer operator-(const Integer & num1, const Integer & num2)
+{
+ return( Integer(num1.getValue() - num2.getValue()) );
+}
+
+inline Rational operator-(const Integer & num1, const Rational & num2)
+{
+ return( Rational(num1.getValue() - num2.getValue()) );
+}
+
+inline Float operator-(const Integer & num1, const Float & num2)
+{
+ return( Float(num1.getValue() - num2.getValue()) );
+}
+
+
+// Rational - Number
+inline Rational operator-(const Rational & num1, const Rational & num2)
+{
+ return( Rational(num1.getValue() - num2.getValue()) );
+}
+
+inline Rational operator-(const Rational & num1, const Integer & num2)
+{
+ return( Rational(num1.getValue() - num2.getValue()) );
+}
+
+inline Float operator-(const Rational & num1, const Float & num2)
+{
+ return( Float(num1.getValue() - num2.getValue()) );
+}
+
+
+// Float - Number
+inline Float operator-(const Float & num1, const Float & num2)
+{
+ return( Float(num1.getValue() - num2.getValue()) );
+}
+
+inline Float operator-(const Float & num1, const Rational & num2)
+{
+ return( Float(num1.getValue() - num2.getValue()) );
+}
+
+inline Float operator-(const Float & num1, const Integer & num2)
+{
+ return( Float(num1.getValue() - num2.getValue()) );
+}
+
+
+/**
+ * operator*
+ */
+// Integer * Number
+inline Integer operator*(const Integer & num1, const Integer & num2)
+{
+ return( Integer(num1.getValue() * num2.getValue()) );
+}
+
+inline Rational operator*(const Integer & num1, const Rational & num2)
+{
+ return( Rational(num1.getValue() * num2.getValue()) );
+}
+
+inline Float operator*(const Integer & num1, const Float & num2)
+{
+ return( Float(num1.getValue() * num2.getValue()) );
+}
+
+
+// Rational * Number
+inline Rational operator*(const Rational & num1, const Rational & num2)
+{
+ return( Rational(num1.getValue() * num2.getValue()) );
+}
+
+inline Rational operator*(const Rational & num1, const Integer & num2)
+{
+ return( Rational(num1.getValue() * num2.getValue()) );
+}
+
+inline Float operator*(const Rational & num1, const Float & num2)
+{
+ return( Float(num1.getValue() * num2.getValue()) );
+}
+
+
+// Float * Number
+inline Float operator*(const Float & num1, const Float & num2)
+{
+ return( Float(num1.getValue() * num2.getValue()) );
+}
+
+inline Float operator*(const Float & num1, const Rational & num2)
+{
+ return( Float(num1.getValue() * num2.getValue()) );
+}
+
+inline Float operator*(const Float & num1, const Integer & num2)
+{
+ return( Float(num1.getValue() * num2.getValue()) );
+}
+
+
+/**
+ * pow
+ */
+inline Integer pow(const Integer & num, avm_uinteger_t anExponent)
+{
+ return( Integer( num.pow(anExponent) ) );
+}
+
+inline Rational pow(const Rational & num, avm_uinteger_t anExponent)
+{
+ Rational result( num );
+ result.set_pow( anExponent );
+
+ return( Rational( result ) );
+}
+
+inline Float pow(const Float & num, avm_uinteger_t anExponent)
+{
+ Float result( num );
+ result.set_pow( anExponent );
+
+ return( Float( result ) );
+}
+
+
+/**
+ * operator/
+ */
+// Integer / Number
+inline Rational operator/(const Integer & num1, const Integer & num2)
+{
+ return( Rational( num1.getValue() , num2.getValue() ) );
+}
+
+inline Rational operator/(const Integer & num1, const Rational & num2)
+{
+ return( Rational(num1.getValue() / num2.getValue()) );
+}
+
+inline Float operator/(const Integer & num1, const Float & num2)
+{
+ return( Float(num1.getValue() / num2.getValue()) );
+}
+
+
+// Rational / Number
+inline Rational operator/(const Rational & num1, const Rational & num2)
+{
+ return( Rational(num1.getValue() / num2.getValue()) );
+}
+
+inline Rational operator/(const Rational & num1, const Integer & num2)
+{
+ return( Rational(num1.getValue() / num2.getValue()) );
+}
+
+inline Float operator/(const Rational & num1, const Float & num2)
+{
+ return( Float(num1.getValue() / num2.getValue()) );
+}
+
+// Float / Number
+inline Float operator/(const Float & num1, const Float & num2)
+{
+ return( Float(num1.getValue() / num2.getValue()) );
+}
+
+inline Float operator/(const Float & num1, const Rational & num2)
+{
+ return( Float(num1.getValue() / num2.getValue()) );
+}
+
+inline Float operator/(const Float & num1, const Integer & num2)
+{
+ return( Float(num1.getValue() / num2.getValue()) );
+}
+
+
+/**
+ * inverse
+ */
+inline Rational inverse(const Integer & num)
+{
+ return( Rational( Integer(1) , num ) );
+}
+
+inline Rational inverse(const Rational & num)
+{
+ return( Rational( num.rawDenominator() , num.rawNumerator() ) );
+}
+
+inline Float inverse(const Float & num)
+{
+ return( Float( 1 / num.getValue() ) );
+}
+
+
+} /* namespace numeric */
+} /* namespace sep */
+
+#endif /* FML_NUMERIC_GMP_NUMERICIMPL_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/numeric/gmp/RationalImpl.h b/org.eclipse.efm.symbex/src/fml/numeric/gmp/RationalImpl.h
new file mode 100644
index 0000000..4b90683
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/numeric/gmp/RationalImpl.h
@@ -0,0 +1,561 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 10 mai 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#ifndef FML_NUMERIC_GMP_RATIONALIMPL_H_
+#define FML_NUMERIC_GMP_RATIONALIMPL_H_
+
+#include <gmpxx.h>
+
+#include <fml/numeric/Number.h>
+
+#include <fml/numeric/Integer.h>
+
+#include <cmath>
+
+
+namespace sep
+{
+
+
+class Rational :
+ public Number,
+ public GenericNumberClass< mpq_class , Rational >
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( Rational )
+
+
+ /**
+ * TYPEDEF
+ */
+public:
+ typedef mpq_class RawValueType;
+
+private:
+ typedef GenericNumberClass< RawValueType , Rational > ThisNumberClass;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ // RawValueType
+ Rational(const RawValueType & aValue)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( aValue )
+ {
+ simplif();
+ }
+
+ // mpq_t
+ Rational(const mpq_t & aValue)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(aValue) )
+ {
+ simplif();
+ }
+
+ // Integer / Integer
+ Rational(const Integer & aNumerator, const Integer & aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(
+ aNumerator.getValue(), aDenominator.getValue()) )
+ {
+ simplif();
+ }
+
+ // Integer::RawValueType / Integer::RawValueType
+ // i.e mpz_class / mpz_class
+ Rational(const Integer::RawValueType & aNumerator,
+ const Integer::RawValueType & aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(aNumerator, aDenominator) )
+ {
+ simplif();
+ }
+
+ // mpz_t / mpz_t
+ Rational(const mpz_t & aNumerator, const mpz_t & aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(
+ Integer::RawValueType(aNumerator),
+ Integer::RawValueType(aDenominator)) )
+ {
+ simplif();
+ }
+
+ // avm_integer_t / avm_integer_t i.e. avm_int64_t / avm_int64_t
+ Rational(avm_integer_t aNumerator, avm_integer_t aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(
+ Integer( aNumerator ).getValue(),
+ Integer( aDenominator ).getValue() ) )
+ {
+ simplif();
+ }
+
+ // avm_integer_t / avm_uinteger_t i.e. avm_int64_t / avm_uint64_t
+ Rational(avm_integer_t aNumerator, avm_uinteger_t aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(
+ Integer( aNumerator ).getValue(),
+ Integer( aDenominator ).getValue() ) )
+ {
+ simplif();
+ }
+
+ // avm_uinteger_t / avm_integer_t i.e. avm_uint64_t / avm_int64_t
+ Rational(avm_uinteger_t aNumerator, avm_integer_t aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(
+ Integer( aNumerator ).getValue(),
+ Integer( aDenominator ).getValue() ) )
+ {
+ simplif();
+ }
+
+ // avm_uinteger_t / avm_uinteger_t i.e. avm_uint64_t / avm_uint64_t
+ Rational(avm_uinteger_t aNumerator, avm_uinteger_t aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(
+ Integer( aNumerator ).getValue(),
+ Integer( aDenominator ).getValue() ) )
+ {
+ //!! NOTHING
+ }
+
+ // std::string / avm_integer_t i.e. std::string / avm_int64_t
+ Rational(const std::string & aNumerator, avm_integer_t aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(
+ Integer( aNumerator ).getValue(),
+ Integer( aDenominator ).getValue() ) )
+ {
+ simplif();
+ }
+
+ // avm_integer_t / std::string i.e. avm_int64_t / std::string
+ Rational(avm_integer_t aNumerator, const std::string & aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(
+ Integer( aNumerator ).getValue(),
+ Integer( aDenominator ).getValue() ) )
+ {
+ simplif();
+ }
+
+ // std::string / std::string
+ Rational(const std::string & aNumerator, const std::string & aDenominator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(
+ Integer::RawValueType(aNumerator),
+ Integer::RawValueType(aDenominator) ) )
+ {
+ simplif();
+ }
+
+ // Integer
+ Rational(const Integer & aNumerator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType( aNumerator.getValue() ) )
+ {
+ simplif();
+ }
+
+ // Integer::RawValueType i.e. mpz_class
+ Rational(const Integer::RawValueType & aNumerator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType(aNumerator) )
+ {
+ simplif();
+ }
+
+ // mpz_t
+ Rational(const mpz_t & aNumerator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType( Integer::RawValueType(aNumerator) ) )
+ {
+ simplif();
+ }
+
+ // avm_integer_t i.e. avm_int64_t
+ Rational(avm_integer_t aNumerator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType( Integer( aNumerator ).getValue() ) )
+ {
+ simplif();
+ }
+
+ // avm_uinteger_t i.e. avm_uint64_t
+ Rational(avm_uinteger_t aNumerator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType( Integer( aNumerator ).getValue() ) )
+ {
+ simplif();
+ }
+
+#ifdef _AVM_NEED_INT64_T_OVERLOADS_
+
+ // long
+ Rational(long aNumerator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType( Integer::RawValueType(aNumerator) ) )
+ {
+ simplif();
+ }
+
+ // unsigned long
+ Rational(unsigned long aNumerator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType( Integer::RawValueType(aNumerator) ) )
+ {
+ simplif();
+ }
+
+#endif /* _AVM_NEED_INT64_T_OVERLOADS_ */
+
+ // int32_t
+ Rational(int aNumerator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType( Integer::RawValueType(aNumerator) ) )
+ {
+ simplif();
+ }
+
+ // uint32_t
+ Rational(unsigned int aNumerator)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType( Integer::RawValueType(aNumerator) ) )
+ {
+ simplif();
+ }
+
+ // std::string
+ Rational(const std::string & aRational)
+ : Number( CLASS_KIND_T( Rational ) ),
+ ThisNumberClass( RawValueType( ) )
+ {
+ fromString(ThisNumberClass::mValue, aRational);
+
+ simplif();
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ Rational(const Rational & aRational)
+ : Number( aRational ),
+ ThisNumberClass( aRational )
+ {
+ simplif();
+ }
+
+
+ inline static void fromString(RawValueType & rop, const std::string & aValue)
+ {
+ std::string::size_type pos = aValue.find('/');
+ if( pos != std::string::npos)
+ {
+ rop = RawValueType( aValue );
+ }
+ else if( (pos = aValue.find('.')) != std::string::npos )
+ {
+ Integer aNumer( std::string(aValue).erase(pos, 1) );
+
+ Integer aDenom = Integer::pow(10, aValue.size() - (pos + 1));
+
+ rop = RawValueType( aNumer.getValue(), aDenom.getValue() );
+ }
+ else
+ {
+ rop = RawValueType( aValue );
+ }
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Rational()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * ThisNumberClass::mValue
+ */
+ bool simplif()
+ {
+ ThisNumberClass::mValue.canonicalize();
+
+ return( true );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * ThisNumberClass::mValue
+ */
+ inline Integer getNumerator() const
+ {
+ return( Integer( ThisNumberClass::mValue.get_num() ) );
+ }
+
+ inline Integer getDenominator() const
+ {
+ return( Integer( ThisNumberClass::mValue.get_den() ) );
+ }
+
+
+ inline const Integer::RawValueType & rawNumerator() const
+ {
+ return( ThisNumberClass::mValue.get_num() );
+ }
+
+ inline const Integer::RawValueType & rawDenominator() const
+ {
+ return( ThisNumberClass::mValue.get_den() );
+ }
+
+
+ inline void setValue(avm_integer_t aNumerator, avm_integer_t aDenominator)
+ {
+ ThisNumberClass::mValue = RawValueType(
+ Integer( aNumerator ).getValue(),
+ Integer( aDenominator ).getValue() );
+ }
+
+
+ inline void setValue(avm_integer_t aValue)
+ {
+ ThisNumberClass::mValue = RawValueType( Integer( aValue ).getValue() );
+ }
+
+
+ /**
+ * BASICS TESTS
+ */
+ virtual inline int sign() const
+ {
+ return( mpq_sgn(ThisNumberClass::mValue.get_mpq_t()) );
+ }
+
+ virtual inline bool isZero() const
+ {
+ return( sign() == 0 );
+ }
+
+ virtual inline bool isOne() const
+ {
+ return( mpq_cmp_si(
+ ThisNumberClass::mValue.get_mpq_t(), 1, 1) == 0 );
+ }
+
+ virtual inline bool isNegativeOne() const
+ {
+ return( mpq_cmp_si(
+ ThisNumberClass::mValue.get_mpq_t(), -1, 1) == 0 );
+ }
+
+
+ /**
+ * CONVERSION
+ */
+#define MPQ_IS_INTEGER( MPQ_NUM, MPQ_DEN, INF, SUP) \
+ (mpz_cmp_si(MPQ_DEN.get_mpz_t(), 1 ) == 0) && \
+ (mpz_cmp_si(MPQ_NUM.get_mpz_t(), INF) >= 0) && \
+ (mpz_cmp_ui(MPQ_NUM.get_mpz_t(), SUP) <= 0)
+
+#define MPQ_IS_POSITIVE_INTEGER(MPQ_NUM, MPQ_DEN, SUP) \
+ (sign() >= 0) && \
+ (mpz_cmp_si(MPQ_DEN.get_mpz_t(), 1 ) == 0) && \
+ (mpz_cmp_ui(MPQ_NUM.get_mpz_t(), MPQ_NUM.get_ui()) == 0) && \
+ (mpz_cmp_ui(MPQ_NUM.get_mpz_t(), SUP) <= 0)
+
+
+ inline virtual bool isInt32() const
+ {
+ return( MPQ_IS_INTEGER(rawNumerator(), rawDenominator(),
+ AVM_NUMERIC_MIN_INT32, AVM_NUMERIC_MAX_INT32) );
+ }
+
+ inline virtual avm_int32_t toInt32() const
+ {
+ return( static_cast< avm_int32_t >( rawNumerator().get_si() ) );
+ }
+
+ inline virtual bool isInt64() const
+ {
+ return( MPQ_IS_INTEGER(rawNumerator(), rawDenominator(),
+ AVM_NUMERIC_MIN_INT64, AVM_NUMERIC_MAX_INT64) );
+ }
+
+ inline virtual avm_int64_t toInt64() const
+ {
+ return( static_cast< avm_int64_t >( rawNumerator().get_si() ) );
+ }
+
+
+ inline virtual bool isInteger() const
+ {
+ return( MPQ_IS_INTEGER(rawNumerator(), rawDenominator(),
+ AVM_NUMERIC_MIN_INTEGER, AVM_NUMERIC_MAX_INTEGER) );
+ }
+
+ inline virtual avm_integer_t toInteger() const
+ {
+ return( rawNumerator().get_si() );
+ }
+
+
+ inline virtual bool isPosInteger() const
+ {
+ return( MPQ_IS_POSITIVE_INTEGER(rawNumerator(),
+ rawDenominator(), AVM_NUMERIC_MAX_UINTEGER) );
+ }
+
+
+ inline virtual bool isUInteger() const
+ {
+ return( MPQ_IS_POSITIVE_INTEGER(rawNumerator(),
+ rawDenominator(), AVM_NUMERIC_MAX_UINTEGER) );
+ }
+
+ inline virtual avm_uinteger_t toUInteger() const
+ {
+ return( static_cast< avm_uinteger_t >( rawNumerator().get_ui() ) );
+ }
+
+
+ inline virtual bool isRational() const
+ {
+ return( true );
+ }
+
+ virtual avm_integer_t toDenominator() const
+ {
+ return( rawDenominator().get_si() );
+ }
+
+ virtual avm_integer_t toNumerator() const
+ {
+ return( rawNumerator().get_si() );
+ }
+
+
+ inline virtual bool isFloat() const
+ {
+ return( true );
+ }
+
+ inline virtual avm_float_t toFloat() const
+ {
+ return( static_cast< avm_float_t >( ThisNumberClass::mValue.get_d() ) );
+ }
+
+
+ inline virtual bool isReal() const
+ {
+ return( true );
+ }
+
+ inline virtual avm_real_t toReal() const
+ {
+ return( static_cast< avm_real_t >( ThisNumberClass::mValue.get_d() ) );
+ }
+
+
+ /**
+ * math function
+ */
+ inline void set_pow(avm_uinteger_t anExponent)
+ {
+// RawValueType mpResult;
+//
+// mpq_pow_ui( mpResult.get_mpq_t(),
+// ThisNumberClass::mValue.get_mpq_t(), anExponent );
+//
+// ThisNumberClass::mValue = mpResult;
+
+ mpz_pow_ui( mpq_numref(ThisNumberClass::mValue.get_mpq_t()),
+ mpq_numref(ThisNumberClass::mValue.get_mpq_t()), anExponent );
+
+ mpz_pow_ui( mpq_denref(ThisNumberClass::mValue.get_mpq_t()),
+ mpq_denref(ThisNumberClass::mValue.get_mpq_t()), anExponent );
+ }
+
+
+ /**
+ * Serialization
+ */
+ inline void toStream(OutStream & os) const
+ {
+ os << TAB << rawNumerator();
+ if( rawDenominator() != 1 )
+ {
+ os << "/" << rawDenominator();
+ }
+ AVM_DEBUG_REF_COUNTER(os);
+ os << EOL_FLUSH;
+ }
+
+ virtual std::string str() const
+ {
+ if( rawDenominator() != 1 )
+ {
+ return( OSS() << rawNumerator() << '/' << rawDenominator() );
+ }
+ else
+ {
+ return( OSS() << rawNumerator() );
+ }
+ }
+
+ inline virtual std::string strNum(
+ avm_uint8_t precision = AVM_MUMERIC_PRECISION) const
+ {
+ if( rawDenominator() != 1 )
+ {
+ return( OSS() << rawNumerator() << '/' << rawDenominator() );
+ }
+ else
+ {
+ return( OSS() << rawNumerator() );
+ }
+ }
+
+ inline virtual std::string strNumerator(
+ avm_uint8_t precision = AVM_MUMERIC_PRECISION) const
+ {
+ return( OSS() << rawNumerator() );
+ }
+
+ inline virtual std::string strDenominator(
+ avm_uint8_t precision = AVM_MUMERIC_PRECISION) const
+ {
+ return( OSS() << rawDenominator() );
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* FML_NUMERIC_GMP_RATIONALIMPL_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/operator/Operator.cpp b/org.eclipse.efm.symbex/src/fml/operator/Operator.cpp
new file mode 100644
index 0000000..1e95e0c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/operator/Operator.cpp
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "Operator.h"
+
+#include <common/BF.h>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+Operator::Operator(
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID,
+ AVM_OPCODE anAvmOpCode, AVM_OPCODE anOptimizedOpCode,
+ ALGEBRA_QUALIFIER anAlgebraQualifier, FIX_NOTATION aFixNotation,
+ const std::string & aStandardSymbol,
+ const std::string & aSyntaxMIXFIX,
+ const std::string & aSymbolQEPCAD)
+: NamedElement(CLASS_KIND_T( Operator ),
+ aFullyQualifiedNameID, aNameID, aStandardSymbol),
+mAvmOpCode( anAvmOpCode ),
+mOptimizedOpCode( anOptimizedOpCode ),
+mOffset( 0 ),
+
+mAlgebraQualifier( anAlgebraQualifier ),
+mFixNotation( aFixNotation ),
+
+mStandardSymbol( aStandardSymbol ),
+mSyntaxMIXFIX( aSyntaxMIXFIX ),
+mSymbolQEPCAD( aSymbolQEPCAD )
+{
+ //!! NOTHING
+}
+
+
+
+/**
+ * Serialization
+ */
+void Operator::toStream(OutStream & os,
+ ENUM_PRINT_OPERATOR_FORMAT printFormat) const
+{
+ switch( printFormat )
+ {
+ case PRINT_OPERATOR_NAME_FORMAT:
+ {
+ os << getNameID();
+ break;
+ }
+ case PRINT_OPERATOR_SYMBOL_FORMAT:
+ {
+ os << mStandardSymbol;
+ break;
+ }
+ case PRINT_OPERATOR_MIXFIX_FORMAT:
+ {
+ os << mSyntaxMIXFIX;
+ break;
+ }
+ case PRINT_OPERATOR_CAS_QEPCAD_FORMAT:
+ {
+ os << mSymbolQEPCAD;
+ break;
+ }
+ case PRINT_OPERATOR_UNDEFINED_FORMAT:
+ default:
+ {
+ os << getFullyQualifiedNameID();
+ break;
+ }
+ }
+
+ os << std::flush;
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/operator/Operator.h b/org.eclipse.efm.symbex/src/fml/operator/Operator.h
new file mode 100644
index 0000000..c8d374a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/operator/Operator.h
@@ -0,0 +1,274 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef OPERATOR_H_
+#define OPERATOR_H_
+
+#include <common/NamedElement.h>
+
+#include <common/AvmPointer.h>
+
+#include <fml/operator/OperatorLib.h>
+
+
+namespace sep
+{
+
+
+class Operator : public NamedElement ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( Operator )
+{
+
+ AVM_DECLARE_UNCLONABLE_CLASS( Operator )
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ AVM_OPCODE mAvmOpCode;
+
+ AVM_OPCODE mOptimizedOpCode;
+
+ avm_offset_t mOffset;
+
+ ALGEBRA_QUALIFIER mAlgebraQualifier;
+ FIX_NOTATION mFixNotation;
+
+ std::string mStandardSymbol;
+
+ std::string mSyntaxMIXFIX;
+
+ std::string mSymbolQEPCAD;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Operator(const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID,
+ AVM_OPCODE anAvmOpCode, AVM_OPCODE anOptimizedOpCode,
+ ALGEBRA_QUALIFIER anAlgebraQualifier, FIX_NOTATION aFixNotation,
+ const std::string & aStandardSymbol,
+ const std::string & aSyntaxMIXFIX,
+ const std::string & aSymbolQEPCAD);
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Operator()
+ {
+ //!! NOTHING
+ }
+
+
+ /*
+ * GETTER
+ * mAvmOpCode
+ */
+ inline AVM_OPCODE getAvmOpCode() const
+ {
+ return( mAvmOpCode );
+ }
+
+ /*
+ * GETTER
+ * mOptimizedOpCode
+ */
+ inline AVM_OPCODE getOptimizedOpCode() const
+ {
+ return( mOptimizedOpCode );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mOffset
+ */
+ inline avm_offset_t getOffset() const
+ {
+ return( mOffset );
+ }
+
+ inline void setOffset(avm_offset_t anOffset)
+ {
+ mOffset = anOffset;
+ }
+
+
+ /*
+ * GETTER
+ * mAlgebraQualifier
+ */
+ inline ALGEBRA_QUALIFIER getAlgebraQualifier() const
+ {
+ return( mAlgebraQualifier );
+ }
+
+ inline bool isAssociative() const
+ {
+ return( (mAlgebraQualifier == ALGEBRA_ASSOC ) ||
+ (mAlgebraQualifier == ALGEBRA_ASSOC_COMM) );
+ }
+
+ inline bool isWeakAssociative() const
+ {
+ return( (mAlgebraQualifier == ALGEBRA_ASSOC ) ||
+ (mAlgebraQualifier == ALGEBRA_ASSOC_COMM ) ||
+ (mAlgebraQualifier == ALGEBRA_LEFT_ASSOC ) ||
+ (mAlgebraQualifier == ALGEBRA_RIGHT_ASSOC) );
+ }
+
+ inline bool isCommutative() const
+ {
+ return( (mAlgebraQualifier == ALGEBRA_COMM ) ||
+ (mAlgebraQualifier == ALGEBRA_ASSOC_COMM) );
+ }
+
+ /*
+ * GETTER
+ * the NAME
+ */
+
+ inline const std::string & standardSymbol() const
+ {
+ return( mStandardSymbol );
+ }
+
+ inline const std::string & mixfixSyntax() const
+ {
+ return( mSyntaxMIXFIX );
+ }
+
+ inline const std::string & qepcadSymbol() const
+ {
+ return( mSymbolQEPCAD );
+ }
+
+
+ /*
+ * GETTER
+ * mFixNotation
+ */
+ inline FIX_NOTATION getFixNotation() const
+ {
+ return( mFixNotation );
+ }
+
+
+ /**
+ * COMPARISON EQUAL
+ * for mOperator
+ */
+ inline bool isEQ(Operator * op) const
+ {
+ return( (this == op) || (mAvmOpCode == op->mAvmOpCode) );
+ }
+
+ inline bool isNEQ(Operator * op) const
+ {
+ return( (this != op) && (mAvmOpCode != op->mAvmOpCode) );
+ }
+
+ inline bool isOpCode(AVM_OPCODE opCode) const
+ {
+ return( mAvmOpCode == opCode );
+ }
+
+ inline bool hasOpCode(AVM_OPCODE opCode1, AVM_OPCODE opCode2) const
+ {
+ return( (mAvmOpCode == opCode1) ||
+ (mAvmOpCode == opCode2) );
+ }
+
+ inline bool hasOpCode(AVM_OPCODE opCode1,
+ AVM_OPCODE opCode2, AVM_OPCODE opCode3) const
+ {
+ return( (mAvmOpCode == opCode1) ||
+ (mAvmOpCode == opCode2) ||
+ (mAvmOpCode == opCode3) );
+ }
+
+ inline bool isOpCode(Operator * op) const
+ {
+ return( mAvmOpCode == op->mAvmOpCode );
+ }
+
+ inline bool isOptimizedOpCode(AVM_OPCODE opCode) const
+ {
+ return( mOptimizedOpCode == opCode );
+ }
+
+
+ inline bool isnotOpCode(AVM_OPCODE opCode) const
+ {
+ return( mAvmOpCode != opCode );
+ }
+
+
+ /**
+ * Serialization
+ */
+ inline virtual void toStream(OutStream & os) const
+ {
+ os << TAB;
+ toStream(os, PRINT_OPERATOR_SYMBOL_FORMAT);
+ os << EOL;
+ }
+
+ virtual void toStream(OutStream & os,
+ ENUM_PRINT_OPERATOR_FORMAT printFormat) const;
+
+
+ inline virtual std::string toString(
+ const AvmIndent & indent = AVM_TAB_INDENT) const
+ {
+ StringOutStream oss;
+
+ oss << TAB;
+ toStream(oss, PRINT_OPERATOR_SYMBOL_FORMAT);
+ oss << EOL;
+
+ return( oss.str() );
+ }
+
+ inline virtual std::string str() const
+ {
+ return( mStandardSymbol );
+ }
+
+
+ inline std::string strOp(ENUM_PRINT_OPERATOR_FORMAT
+ printFormat = PRINT_OPERATOR_SYMBOL_FORMAT) const
+ {
+ StringOutStream oss;
+
+ toStream(oss, printFormat);
+
+ return( oss.str() );
+ }
+
+
+ inline const std::string & strSMT() const
+ {
+ return( mStandardSymbol );
+ }
+
+};
+
+
+}
+
+#endif /*OPERATOR_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/operator/OperatorLib.cpp b/org.eclipse.efm.symbex/src/fml/operator/OperatorLib.cpp
new file mode 100644
index 0000000..b7ca277
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/operator/OperatorLib.cpp
@@ -0,0 +1,328 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 22 juin 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "OperatorLib.h"
+
+#include <fml/expression/AvmCode.h>
+
+
+namespace sep
+{
+
+
+/**
+ * TEST
+ */
+bool OperatorLib::isPropositional(AVM_OPCODE opcode)
+{
+ switch( opcode )
+ {
+ /*
+ ***********************************************************************
+ * AVM PROPOSITIONAL EXPRESSION
+ ***********************************************************************
+ */
+ case AVM_OPCODE_NOT:
+
+ case AVM_OPCODE_AND:
+ case AVM_OPCODE_NAND:
+
+ case AVM_OPCODE_XAND:
+
+ case AVM_OPCODE_OR:
+ case AVM_OPCODE_NOR:
+
+ case AVM_OPCODE_XOR:
+ case AVM_OPCODE_XNOR:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+
+std::string OperatorLib::to_string(FIX_NOTATION fix)
+{
+ switch( fix )
+ {
+ case NOTATION_INFIX : return( "infix" );
+ case NOTATION_PREFIX : return( "prefix" );
+ case NOTATION_SUFFIX : return( "suffix" );
+ case NOTATION_FUNCTION : return( "function" );
+ case NOTATION_STATEMENT: return( "statement" );
+
+ default: return( "fix#unknown" );
+ }
+}
+
+FIX_NOTATION OperatorLib::to_fix(
+ const std::string & fix, FIX_NOTATION defaultFix)
+{
+ if( fix == "infix" ) return( NOTATION_INFIX );
+ if( fix == "prefix" ) return( NOTATION_PREFIX );
+ if( fix == "suffix" ) return( NOTATION_SUFFIX );
+ if( fix == "function" ) return( NOTATION_FUNCTION );
+ if( fix == "statement" ) return( NOTATION_STATEMENT );
+
+ return( defaultFix );
+}
+
+
+std::string OperatorLib::to_string(AVM_OPCODE opcode,
+ ENUM_PRINT_OPERATOR_FORMAT printFormat)
+{
+ switch( opcode )
+ {
+ case AVM_OPCODE_ASSIGN: return( ":=" );
+ case AVM_OPCODE_ASSIGN_AFTER: return( "=:" );
+ case AVM_OPCODE_ASSIGN_MACRO: return( "::=" );
+
+ case AVM_OPCODE_EQ: return( "=" );
+
+ case AVM_OPCODE_NEQ: return( "!=" );
+ case AVM_OPCODE_SEQ: return( "===" );
+ case AVM_OPCODE_NSEQ: return( "=/=" );
+
+ case AVM_OPCODE_BAND: return( "&" );
+ case AVM_OPCODE_BOR: return( "|" );
+ case AVM_OPCODE_BXOR: return( "^" );
+ case AVM_OPCODE_BNOT: return( "~" );
+
+ case AVM_OPCODE_PLUS : return( "+" );
+ case AVM_OPCODE_MINUS: return( "-" );
+ case AVM_OPCODE_UMINUS: return( "-" );
+ case AVM_OPCODE_MOD: return( "%" );
+ case AVM_OPCODE_MULT: return( "*" );
+ case AVM_OPCODE_DIV: return( "/" );
+ case AVM_OPCODE_POW: return( "^" );
+
+ case AVM_OPCODE_LT: return( "<" );
+ case AVM_OPCODE_LTE: return( "<=" );
+ case AVM_OPCODE_GT: return( ">" );
+ case AVM_OPCODE_GTE: return( ">=" );
+
+ case AVM_OPCODE_NOT: return( "not" );
+ case AVM_OPCODE_AND: return( "and" );
+ case AVM_OPCODE_OR : return( "or" );
+ case AVM_OPCODE_XOR: return( "xor" );
+
+ case AVM_OPCODE_SEQUENCE : return( "|;|" );
+ case AVM_OPCODE_ATOMIC_SEQUENCE : return( "|§|" );
+ case AVM_OPCODE_SEQUENCE_WEAK : return( "|;;|" );
+
+ case AVM_OPCODE_INTERLEAVING : return( "|i|" );
+
+ case AVM_OPCODE_PRIOR_GT : return( "|<|" );
+
+ case AVM_OPCODE_REGEX : return( "|regex|" );
+
+ default: return( "opcode#unknown" );
+ }
+}
+
+
+AVM_OPCODE OperatorLib::toOpcode(
+ const std::string & op, AVM_OPCODE defaultOpcode)
+{
+ if( op == "NOT" ) return( AVM_OPCODE_NOT );
+ if( op == "AND" ) return( AVM_OPCODE_AND );
+ if( op == "OR" ) return( AVM_OPCODE_OR );
+ if( op == "XOR" ) return( AVM_OPCODE_XOR );
+
+ if( op == "|;|" ) return( AVM_OPCODE_SEQUENCE );
+ if( op == "|§|" ) return( AVM_OPCODE_ATOMIC_SEQUENCE );
+ if( op == "|;;|" ) return( AVM_OPCODE_SEQUENCE_WEAK );
+
+ if( op == "|i|" ) return( AVM_OPCODE_INTERLEAVING );
+
+ if( op == "|<|" ) return( AVM_OPCODE_PRIOR_GT );
+
+ if( op == "|regex|" ) return( AVM_OPCODE_REGEX );
+
+ return( defaultOpcode );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// OperatorFamily
+////////////////////////////////////////////////////////////////////////////////
+
+IStatementFamily::avm_opcode_family
+IStatementFamily::computeStatementFamily(AVM_OPCODE opcode)
+{
+ switch( opcode )
+ {
+// case AVM_OPCODE_IF :
+// case AVM_OPCODE_IFE :
+//
+// case AVM_OPCODE_WHERE :
+// case AVM_OPCODE_WHERE_ELSE :
+//
+// case AVM_OPCODE_FOR :
+// case AVM_OPCODE_FOREACH :
+// case AVM_OPCODE_WHILE_DO :
+// case AVM_OPCODE_DO_WHILE :
+
+ case AVM_OPCODE_GUARD :
+ case AVM_OPCODE_TIMED_GUARD :
+ case AVM_OPCODE_EVENT :
+ case AVM_OPCODE_CHECK_SAT :
+ return( AVM_STATEMENT_GUARD_FAMILY );
+
+
+ case AVM_OPCODE_INPUT :
+ case AVM_OPCODE_INPUT_FROM :
+ return AVM_STATEMENT_INPUT_FAMILY;
+
+ case AVM_OPCODE_INPUT_ENV :
+ return AVM_STATEMENT_INPUT_ENV_FAMILY;
+
+ case AVM_OPCODE_INPUT_RDV :
+ return AVM_STATEMENT_INPUT_SYNC_FAMILY;
+
+ case AVM_OPCODE_INPUT_MULTI_RDV :
+ return AVM_STATEMENT_INPUT_SYNC_FAMILY;
+
+ case AVM_OPCODE_INPUT_BUFFER :
+ return AVM_STATEMENT_INPUT_ASYNC_FAMILY;
+ case AVM_OPCODE_INPUT_BROADCAST :
+ return AVM_STATEMENT_INPUT_ASYNC_FAMILY;
+
+
+ case AVM_OPCODE_OUTPUT :
+ case AVM_OPCODE_OUTPUT_TO :
+ return AVM_STATEMENT_OUTPUT_FAMILY;
+
+ case AVM_OPCODE_OUTPUT_ENV :
+ return AVM_STATEMENT_OUTPUT_ENV_FAMILY;
+
+ case AVM_OPCODE_OUTPUT_RDV :
+ return AVM_STATEMENT_OUTPUT_SYNC_FAMILY;
+
+ case AVM_OPCODE_OUTPUT_MULTI_RDV :
+ return AVM_STATEMENT_OUTPUT_SYNC_FAMILY;
+
+ case AVM_OPCODE_OUTPUT_BUFFER :
+ return AVM_STATEMENT_OUTPUT_ASYNC_FAMILY;
+
+ case AVM_OPCODE_OUTPUT_BROADCAST :
+ return AVM_STATEMENT_OUTPUT_ASYNC_FAMILY;
+
+ case AVM_OPCODE_ASSIGN :
+ case AVM_OPCODE_ASSIGN_AFTER :
+ case AVM_OPCODE_ASSIGN_OP :
+ case AVM_OPCODE_ASSIGN_OP_AFTER :
+ case AVM_OPCODE_ASSIGN_REF :
+ case AVM_OPCODE_ASSIGN_MACRO :
+ case AVM_OPCODE_ASSIGN_NEWFRESH :
+ case AVM_OPCODE_ASSIGN_RESET :
+ return AVM_STATEMENT_BASIC_FAMILY;
+
+ default: return AVM_STATEMENT_UNDEFINED_FAMILY;
+ }
+}
+
+
+IStatementFamily::avm_opcode_family
+IStatementFamily::computeStatementFamily(AvmCode * aCode)
+{
+ avm_opcode_family opcodeFamily =
+ computeStatementFamily( aCode->getOptimizedOpCode() );
+
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator itEnd = aCode->end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it).is< AvmCode >() )
+ {
+ opcodeFamily = opcodeFamily |
+ computeStatementFamily( (*it).to_ptr< AvmCode >() );
+ }
+ }
+
+ return( opcodeFamily );
+}
+
+
+std::string IStatementFamily::strStatementFamily(avm_opcode_family mask) const
+{
+ std::ostringstream ossFamily;
+
+ const std::string SEPARATOR = " | ";
+ std::string sep = "";
+
+ avm_opcode_family opcodeFamily = theStatementFamily & mask;
+
+ if( opcodeFamily == AVM_STATEMENT_UNDEFINED_FAMILY )
+ {
+ return( "<?opcode>" );
+ }
+
+ if( (opcodeFamily & AVM_STATEMENT_BASIC_FAMILY) != 0 )
+ {
+ ossFamily << sep << "basic"; sep = SEPARATOR;
+ }
+ if( (opcodeFamily & AVM_STATEMENT_GUARD_FAMILY) != 0 )
+ {
+ ossFamily << sep << "guard"; sep = SEPARATOR;
+ }
+
+ if( (opcodeFamily & AVM_STATEMENT_INPUT_FAMILY) != 0 )
+ {
+ ossFamily << sep << "input"; sep = SEPARATOR;
+ }
+ if( (opcodeFamily & AVM_STATEMENT_INPUT_ENV_FAMILY) != 0 )
+ {
+ ossFamily << sep << "input#env"; sep = SEPARATOR;
+ }
+ if( (opcodeFamily & AVM_STATEMENT_INPUT_SYNC_FAMILY) != 0 )
+ {
+ ossFamily << sep << "input#sync"; sep = SEPARATOR;
+ }
+ if( (opcodeFamily & AVM_STATEMENT_INPUT_ASYNC_FAMILY) != 0 )
+ {
+ ossFamily << sep << "input#async"; sep = SEPARATOR;
+ }
+
+ if( (opcodeFamily & AVM_STATEMENT_OUTPUT_FAMILY) != 0 )
+ {
+ ossFamily << sep << "output"; sep = SEPARATOR;
+ }
+ if( (opcodeFamily & AVM_STATEMENT_OUTPUT_ENV_FAMILY) != 0 )
+ {
+ ossFamily << sep << "output#env"; sep = SEPARATOR;
+ }
+ if( (opcodeFamily & AVM_STATEMENT_OUTPUT_SYNC_FAMILY) != 0 )
+ {
+ ossFamily << sep << "output#sync"; sep = SEPARATOR;
+ }
+ if( (opcodeFamily & AVM_STATEMENT_OUTPUT_ASYNC_FAMILY) != 0 )
+ {
+ ossFamily << sep << "output#async"; sep = SEPARATOR;
+ }
+
+
+ return( ossFamily.str() );
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/operator/OperatorLib.h b/org.eclipse.efm.symbex/src/fml/operator/OperatorLib.h
new file mode 100644
index 0000000..15c3f21
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/operator/OperatorLib.h
@@ -0,0 +1,837 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 22 juin 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef OPERATORLIB_H_
+#define OPERATORLIB_H_
+
+#include <util/avm_numeric.h>
+#include <util/avm_string.h>
+
+
+namespace sep
+{
+
+
+/**
+ * ENUMERATE DECLARATIONS
+ */
+enum ALGEBRA_QUALIFIER
+{
+ ALGEBRA_STD,
+
+ ALGEBRA_ASSOC,
+ ALGEBRA_LEFT_ASSOC,
+ ALGEBRA_RIGHT_ASSOC,
+
+ ALGEBRA_COMM,
+
+ ALGEBRA_ASSOC_COMM
+};
+
+
+enum FIX_NOTATION
+{
+ NOTATION_INFIX,
+ NOTATION_PREFIX,
+ NOTATION_SUFFIX,
+
+ NOTATION_FUNCTION,
+
+ NOTATION_STATEMENT
+};
+
+
+enum AVM_OPCODE
+{
+ AVM_OPCODE_NULL,
+
+ /*
+ ***************************************************************************
+ * AVM NOP STATEMENT
+ ***************************************************************************
+ */
+ AVM_OPCODE_NOP,
+
+ AVM_OPCODE_FAILED,
+ AVM_OPCODE_THROW,
+
+
+ /*
+ ***************************************************************************
+ * AVM META STATEMENT
+ ***************************************************************************
+ */
+ AVM_OPCODE_INFORMAL,
+
+ AVM_OPCODE_TRACE,
+
+ AVM_OPCODE_DEBUG,
+
+ AVM_OPCODE_COMMENT,
+
+ AVM_OPCODE_QUOTE,
+
+ AVM_OPCODE_META_EVAL,
+ AVM_OPCODE_META_RUN,
+
+
+ /*
+ ***************************************************************************
+ * AVM UFI STATEMENT
+ ***************************************************************************
+ */
+ AVM_OPCODE_UFI,
+
+ /*
+ ***************************************************************************
+ * AVM FORM CONSTRUCTOR STATEMENT
+ ***************************************************************************
+ */
+ AVM_OPCODE_CTOR,
+
+ /*
+ ***************************************************************************
+ * AVM FORM REGEX STATEMENT
+ ***************************************************************************
+ */
+ AVM_OPCODE_REGEX,
+
+
+ /*
+ ***************************************************************************
+ * AVM MACHINE MANAGING
+ ***************************************************************************
+ */
+ AVM_OPCODE_CONTEXT_SWITCHER,
+
+ AVM_OPCODE_INIT,
+ AVM_OPCODE_FINAL,
+ AVM_OPCODE_DESTROY,
+
+ AVM_OPCODE_START,
+ AVM_OPCODE_RESTART,
+ AVM_OPCODE_STOP,
+
+ AVM_OPCODE_WAIT,
+
+ AVM_OPCODE_SUSPEND,
+ AVM_OPCODE_RESUME,
+
+ AVM_OPCODE_IENABLE_INVOKE,
+ AVM_OPCODE_ENABLE_INVOKE,
+ AVM_OPCODE_ENABLE_SET,
+
+ AVM_OPCODE_IDISABLE_INVOKE,
+ AVM_OPCODE_DISABLE_INVOKE,
+ AVM_OPCODE_DISABLE_SET,
+ AVM_OPCODE_DISABLE_CHILD,
+ AVM_OPCODE_DISABLE_SELF,
+ AVM_OPCODE_DISABLE_SELVES,
+
+ AVM_OPCODE_IABORT_INVOKE,
+ AVM_OPCODE_ABORT_INVOKE,
+ AVM_OPCODE_ABORT_SET,
+ AVM_OPCODE_ABORT_CHILD,
+ AVM_OPCODE_ABORT_SELF,
+ AVM_OPCODE_ABORT_SELVES,
+
+ AVM_OPCODE_HISTORY_CLEAR,
+ AVM_OPCODE_DEEP_HISTORY_INVOKE,
+ AVM_OPCODE_SHALLOW_HISTORY_INVOKE,
+
+ AVM_OPCODE_IRUN,
+ AVM_OPCODE_RUN,
+ AVM_OPCODE_RTC,
+
+ AVM_OPCODE_SCHEDULE_INVOKE,
+ AVM_OPCODE_SCHEDULE_GET,
+ AVM_OPCODE_SCHEDULE_IN,
+ AVM_OPCODE_SCHEDULE_SET,
+
+ AVM_OPCODE_DEFER_INVOKE,
+ AVM_OPCODE_DEFER_GET,
+ AVM_OPCODE_DEFER_SET,
+
+
+ AVM_OPCODE_GOTO,
+
+ AVM_OPCODE_FORK,
+ AVM_OPCODE_JOIN,
+
+ AVM_OPCODE_INPUT_ENABLED,
+
+ AVM_OPCODE_RDV,
+
+ AVM_OPCODE_SYNCHRONIZE,
+
+
+ AVM_OPCODE_INVOKE_NEW,
+
+ AVM_OPCODE_INVOKE_ROUTINE,
+
+ AVM_OPCODE_INVOKE_TRANSITION,
+
+ AVM_OPCODE_INVOKE_METHOD,
+ AVM_OPCODE_INVOKE_PROGRAM,
+ AVM_OPCODE_INVOKE_FUNCTION,
+
+ AVM_OPCODE_INVOKE_LAMBDA_APPLY,
+ AVM_OPCODE_INVOKE_LAMBDA_LET,
+
+
+ /*
+ ***************************************************************************
+ * AVM MACHINE STATUS
+ ***************************************************************************
+ */
+ AVM_OPCODE_STATUS_WAS,
+ AVM_OPCODE_STATUS_IS,
+ AVM_OPCODE_STATUS_BEING,
+ AVM_OPCODE_STATUS_WILL,
+
+ AVM_OPCODE_CHANGED,
+ AVM_OPCODE_CHANGED_TO,
+
+
+ /*
+ ***************************************************************************
+ * AVM PROGRAM SCHEDULING
+ ***************************************************************************
+ */
+ AVM_OPCODE_ASYNCHRONOUS,
+ AVM_OPCODE_STRONG_SYNCHRONOUS,
+ AVM_OPCODE_WEAK_SYNCHRONOUS,
+
+ AVM_OPCODE_INTERLEAVING,
+ AVM_OPCODE_PARTIAL_ORDER_REDUCTION,
+
+
+ AVM_OPCODE_PARALLEL,
+
+ // Optimized version of concurrency for RDV synchronization
+ AVM_OPCODE_RDV_ASYNCHRONOUS,
+ AVM_OPCODE_RDV_STRONG_SYNCHRONOUS,
+ AVM_OPCODE_RDV_WEAK_SYNCHRONOUS,
+
+ AVM_OPCODE_RDV_INTERLEAVING,
+ AVM_OPCODE_RDV_PARTIAL_ORDER_REDUCTION,
+
+ AVM_OPCODE_RDV_PARALLEL,
+
+ AVM_OPCODE_EXCLUSIVE,
+
+ AVM_OPCODE_NONDETERMINISM,
+
+ AVM_OPCODE_PRIOR_GT,
+ AVM_OPCODE_PRIOR_LT,
+
+ AVM_OPCODE_SCHEDULE_AND_THEN,
+ AVM_OPCODE_SCHEDULE_OR_ELSE,
+
+ AVM_OPCODE_ATOMIC_SEQUENCE,
+
+ AVM_OPCODE_SEQUENCE,
+ AVM_OPCODE_SEQUENCE_SIDE,
+ AVM_OPCODE_SEQUENCE_WEAK,
+
+ AVM_OPCODE_PRODUCT,
+
+
+ /*
+ ***************************************************************************
+ * AVM BUFFER MANAGING
+ ***************************************************************************
+ */
+ AVM_OPCODE_UPDATE_BUFFER,
+
+
+ /*
+ ***************************************************************************
+ * LAMBDA STATEMENT
+ ***************************************************************************
+ */
+ AVM_OPCODE_APPLY,
+
+ AVM_OPCODE_LAMBDA,
+
+
+ /*
+ ***************************************************************************
+ * FUNCTIONB STATEMENT
+ ***************************************************************************
+ */
+ AVM_OPCODE_FUN,
+
+
+ /*
+ ***************************************************************************
+ * LET STATEMENT
+ ***************************************************************************
+ */
+ AVM_OPCODE_LET,
+
+ /*
+ ***************************************************************************
+ * LOOKUP STATEMENT
+ ***************************************************************************
+ */
+ AVM_OPCODE_LOOKUP_INT_EXT,
+ AVM_OPCODE_LOOKUP_INT,
+ AVM_OPCODE_LOOKUP_NEAREST,
+ AVM_OPCODE_LOOKUP_BELOW,
+ AVM_OPCODE_LOOKUP_ABOVE,
+ AVM_OPCODE_LOOKUP2D_INT_EXT,
+
+ /*
+ ***************************************************************************
+ * AVM PRIMITIVE STATEMENT
+ ***************************************************************************
+ */
+ AVM_OPCODE_ASSIGN,
+ AVM_OPCODE_ASSIGN_AFTER,
+ AVM_OPCODE_ASSIGN_OP,
+ AVM_OPCODE_ASSIGN_OP_AFTER,
+ AVM_OPCODE_ASSIGN_REF,
+ AVM_OPCODE_ASSIGN_MACRO,
+
+ AVM_OPCODE_ASSIGN_NEWFRESH,
+
+ AVM_OPCODE_ASSIGN_RESET,
+
+
+ AVM_OPCODE_GUARD,
+ AVM_OPCODE_TIMED_GUARD,
+
+ AVM_OPCODE_EVENT,
+
+ AVM_OPCODE_CHECK_SAT,
+
+ AVM_OPCODE_INPUT,
+ AVM_OPCODE_INPUT_FROM,
+
+ AVM_OPCODE_INPUT_SAVE,
+
+ // Optimized version of INPUT
+ AVM_OPCODE_INPUT_ENV,
+ AVM_OPCODE_INPUT_VAR,
+ AVM_OPCODE_INPUT_FLOW,
+ AVM_OPCODE_INPUT_BUFFER,
+ AVM_OPCODE_INPUT_RDV,
+ AVM_OPCODE_INPUT_MULTI_RDV,
+ AVM_OPCODE_INPUT_BROADCAST,
+ AVM_OPCODE_INPUT_DELEGATE,
+
+ AVM_OPCODE_OUTPUT,
+ AVM_OPCODE_OUTPUT_TO,
+ // Optimized version of OUTPUT
+ AVM_OPCODE_OUTPUT_ENV,
+ AVM_OPCODE_OUTPUT_VAR,
+ AVM_OPCODE_OUTPUT_FLOW,
+ AVM_OPCODE_OUTPUT_BUFFER,
+ AVM_OPCODE_OUTPUT_RDV,
+ AVM_OPCODE_OUTPUT_MULTI_RDV,
+ AVM_OPCODE_OUTPUT_BROADCAST,
+ AVM_OPCODE_OUTPUT_DELEGATE,
+
+ AVM_OPCODE_PRESENT,
+ AVM_OPCODE_ABSENT,
+
+ AVM_OPCODE_IF,
+ AVM_OPCODE_IFE,
+
+ AVM_OPCODE_WHERE,
+ AVM_OPCODE_WHERE_ELSE,
+
+ AVM_OPCODE_FOR,
+ AVM_OPCODE_FOREACH,
+ AVM_OPCODE_WHILE_DO,
+ AVM_OPCODE_DO_WHILE,
+
+ AVM_OPCODE_BREAK,
+ AVM_OPCODE_CONTINUE,
+ AVM_OPCODE_RETURN,
+ AVM_OPCODE_EXIT,
+
+ AVM_OPCODE_STEP_MARK,
+
+
+ /*
+ ***************************************************************************
+ * AVM QUANTIFIER EXPRESSION
+ ***************************************************************************
+ */
+ AVM_OPCODE_EXIST,
+ AVM_OPCODE_FORALL,
+
+
+ /*
+ ***************************************************************************
+ * AVM PREDICAT EXPRESSION
+ ***************************************************************************
+ */
+ AVM_OPCODE_NOT,
+
+ AVM_OPCODE_AND,
+ AVM_OPCODE_AND_THEN,
+
+ AVM_OPCODE_NAND,
+
+ AVM_OPCODE_XAND,
+
+ AVM_OPCODE_OR,
+ AVM_OPCODE_OR_ELSE,
+
+ AVM_OPCODE_NOR,
+
+ AVM_OPCODE_XOR,
+ AVM_OPCODE_XNOR,
+
+
+ /*
+ ***************************************************************************
+ * AVM INTEGER BIT A BIT OPERATOR
+ ***************************************************************************
+ */
+ AVM_OPCODE_BNOT,
+
+ AVM_OPCODE_BAND,
+ AVM_OPCODE_BOR,
+ AVM_OPCODE_BXOR,
+
+ AVM_OPCODE_LSHIFT,
+ AVM_OPCODE_RSHIFT,
+
+
+ /*
+ ***************************************************************************
+ * AVM COMPARISON EXPRESSION
+ ***************************************************************************
+ */
+
+ AVM_OPCODE_EQ,
+ AVM_OPCODE_NEQ,
+
+ AVM_OPCODE_SEQ,
+ AVM_OPCODE_NSEQ,
+
+ AVM_OPCODE_LT,
+ AVM_OPCODE_LTE,
+ AVM_OPCODE_GT,
+ AVM_OPCODE_GTE,
+
+
+ /*
+ ***************************************************************************
+ * AVM ARITHMETIC EXPRESSION
+ ***************************************************************************
+ */
+
+ AVM_OPCODE_PLUS,
+ AVM_OPCODE_MINUS,
+ AVM_OPCODE_UMINUS,
+
+ AVM_OPCODE_MULT,
+ AVM_OPCODE_POW,
+
+ AVM_OPCODE_DIV,
+ AVM_OPCODE_MOD,
+
+ AVM_OPCODE_MIN,
+ AVM_OPCODE_MAX,
+
+
+ /*
+ ***************************************************************************
+ * AVM MATHEMATICAL FUNCTION
+ ***************************************************************************
+ */
+ // RANDOM
+ AVM_OPCODE_RANDOM,
+
+ // ROUNDING
+ AVM_OPCODE_ABS,
+
+ AVM_OPCODE_CEIL,
+ AVM_OPCODE_FLOOR,
+ AVM_OPCODE_ROUND,
+ AVM_OPCODE_TRUNCATE,
+
+
+ // EXP - LOG
+ AVM_OPCODE_SQRT,
+
+ AVM_OPCODE_EXP,
+ AVM_OPCODE_LN,
+ AVM_OPCODE_LOG,
+
+ // TRIGONOMETRIC
+ AVM_OPCODE_SIN,
+ AVM_OPCODE_COS,
+ AVM_OPCODE_TAN,
+
+ AVM_OPCODE_SINH,
+ AVM_OPCODE_COSH,
+ AVM_OPCODE_TANH,
+
+ AVM_OPCODE_ASIN,
+ AVM_OPCODE_ACOS,
+ AVM_OPCODE_ATAN,
+ AVM_OPCODE_ATAN2,
+
+ AVM_OPCODE_ASINH,
+ AVM_OPCODE_ACOSH,
+ AVM_OPCODE_ATANH,
+
+
+ /*
+ ***************************************************************************
+ * AVM STRING / CONTAINER OPERATOR
+ ***************************************************************************
+ */
+ AVM_OPCODE_CONTAINS,
+
+ AVM_OPCODE_IN,
+ AVM_OPCODE_NOTIN,
+
+ AVM_OPCODE_SUBSET,
+ AVM_OPCODE_SUBSETEQ,
+
+ AVM_OPCODE_INTERSECT,
+
+ AVM_OPCODE_STARTS_WITH,
+ AVM_OPCODE_ENDS_WITH,
+
+ AVM_OPCODE_CONCAT,
+
+
+ AVM_OPCODE_APPEND,
+
+ AVM_OPCODE_REMOVE,
+ AVM_OPCODE_CLEAR,
+
+ AVM_OPCODE_RESIZE,
+
+ AVM_OPCODE_SELECT,
+
+ AVM_OPCODE_PUSH,
+ AVM_OPCODE_ASSIGN_TOP,
+ AVM_OPCODE_TOP,
+ AVM_OPCODE_POP,
+ AVM_OPCODE_POP_FROM,
+
+ AVM_OPCODE_EMPTY,
+ AVM_OPCODE_NONEMPTY,
+ AVM_OPCODE_SINGLETON,
+ AVM_OPCODE_POPULATED,
+ AVM_OPCODE_FULL,
+
+ AVM_OPCODE_SIZE,
+
+ /*
+ ***************************************************************************
+ * CTL* , IOLTL STATEMENT
+ ***************************************************************************
+ */
+ AVM_OPCODE_NECESSARILY, // A :> in All path
+ AVM_OPCODE_POSSIBLY, // E :> the Exist a path
+
+ AVM_OPCODE_GLOBALLY, // G , \square , [] :> always in the future
+ AVM_OPCODE_EVENTUALLY, // F , \diamond ' <> :> (or Finally) some time in the Future
+
+ AVM_OPCODE_NEXT, // X , \circle , o :> neXtime
+
+ AVM_OPCODE_UNTIL, // U :> (p U q ) <=> p holds Until q holds (and ! p)
+
+ AVM_OPCODE_UNLESS, // W :> (p W q ) <=> Weak Until (or waiting for)
+ // <=> (G p) or (p U q)
+ // as long as q is false, p must be true
+
+ AVM_OPCODE_RELEASES, // R :> (p R q ) <=> q holds Until p holds (with q)
+ // <=> not ((not p) U (not q))
+ AVM_OPCODE_AND_T,
+ AVM_OPCODE_OR_T,
+ AVM_OPCODE_NOT_T,
+ AVM_OPCODE_IMP_T,
+
+ AVM_OPCODE_OBS,
+
+};
+
+
+
+enum ENUM_PRINT_OPERATOR_FORMAT
+{
+ PRINT_OPERATOR_UNDEFINED_FORMAT,
+
+ PRINT_OPERATOR_NAME_FORMAT,
+
+ PRINT_OPERATOR_SYMBOL_FORMAT,
+
+ PRINT_OPERATOR_MIXFIX_FORMAT,
+
+ PRINT_OPERATOR_CAS_QEPCAD_FORMAT
+};
+
+
+
+class OperatorLib
+{
+
+public:
+
+ /**
+ * TEST
+ */
+ static bool isPropositional(AVM_OPCODE opcode);
+
+
+ static std::string to_string(FIX_NOTATION fix);
+
+ static FIX_NOTATION to_fix(const std::string & op,
+ FIX_NOTATION defaultFix = NOTATION_INFIX);
+
+
+ static std::string to_string(AVM_OPCODE opcode,
+ ENUM_PRINT_OPERATOR_FORMAT printFormat =
+ PRINT_OPERATOR_SYMBOL_FORMAT);
+
+ static AVM_OPCODE toOpcode(const std::string & op,
+ AVM_OPCODE defaultOpcode = AVM_OPCODE_NULL);
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+// OperatorFamily
+////////////////////////////////////////////////////////////////////////////////
+
+class AvmCode;
+
+
+class IStatementFamily
+{
+
+public:
+
+ typedef avm_uint32_t avm_opcode_family;
+
+ enum
+ {
+ AVM_STATEMENT_UNDEFINED_FAMILY = 0x00000,
+
+ AVM_STATEMENT_BASIC_FAMILY = 0x00001,
+
+ AVM_STATEMENT_GUARD_FAMILY = 0x00002,
+
+
+ AVM_STATEMENT_INPUT_FAMILY = 0x00010,
+ AVM_STATEMENT_INPUT_ENV_FAMILY = 0x00020,
+ AVM_STATEMENT_INPUT_SYNC_FAMILY = 0x00040,
+ AVM_STATEMENT_INPUT_ASYNC_FAMILY = 0x00080,
+
+ AVM_STATEMENT_INPUT_ANY_FAMILY = AVM_STATEMENT_INPUT_FAMILY
+ | AVM_STATEMENT_INPUT_ENV_FAMILY
+ | AVM_STATEMENT_INPUT_SYNC_FAMILY
+ | AVM_STATEMENT_INPUT_ASYNC_FAMILY,
+
+
+ AVM_STATEMENT_OUTPUT_FAMILY = 0x00100,
+ AVM_STATEMENT_OUTPUT_ENV_FAMILY = 0x00200,
+ AVM_STATEMENT_OUTPUT_SYNC_FAMILY = 0x00400,
+ AVM_STATEMENT_OUTPUT_ASYNC_FAMILY = 0x00800,
+
+ AVM_STATEMENT_OUTPUT_ANY_FAMILY = AVM_STATEMENT_OUTPUT_FAMILY
+ | AVM_STATEMENT_OUTPUT_ENV_FAMILY
+ | AVM_STATEMENT_OUTPUT_SYNC_FAMILY
+ | AVM_STATEMENT_OUTPUT_ASYNC_FAMILY,
+
+
+ AVM_STATEMENT_COM_FAMILY = AVM_STATEMENT_INPUT_FAMILY
+ | AVM_STATEMENT_OUTPUT_FAMILY,
+
+ AVM_STATEMENT_COM_ENV_FAMILY = AVM_STATEMENT_INPUT_ENV_FAMILY
+ | AVM_STATEMENT_OUTPUT_ENV_FAMILY,
+
+ AVM_STATEMENT_COM_ASYNC_FAMILY = AVM_STATEMENT_INPUT_ASYNC_FAMILY
+ | AVM_STATEMENT_OUTPUT_ASYNC_FAMILY,
+
+ AVM_STATEMENT_COM_SYNC_FAMILY = AVM_STATEMENT_INPUT_SYNC_FAMILY
+ | AVM_STATEMENT_OUTPUT_SYNC_FAMILY,
+
+ AVM_STATEMENT_COM_ANY_FAMILY = AVM_STATEMENT_INPUT_ANY_FAMILY
+ | AVM_STATEMENT_OUTPUT_ANY_FAMILY,
+
+
+ AVM_STATEMENT_UNCONDIONAL_CLASS = AVM_STATEMENT_BASIC_FAMILY
+ | AVM_STATEMENT_COM_ENV_FAMILY,
+
+
+ AVM_STATEMENT_COM_CONDITIONAL_CLASS = AVM_STATEMENT_COM_FAMILY
+ | AVM_STATEMENT_COM_ASYNC_FAMILY
+ | AVM_STATEMENT_COM_SYNC_FAMILY,
+
+ AVM_STATEMENT_CONDIONAL_CLASS = AVM_STATEMENT_GUARD_FAMILY
+ | AVM_STATEMENT_COM_CONDITIONAL_CLASS,
+
+
+ AVM_STATEMENT_MASK_ALL_FAMILY = 0xFFFFF,
+
+ };
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ avm_opcode_family theStatementFamily;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ IStatementFamily(avm_opcode_family
+ aCodeFamily = AVM_STATEMENT_UNDEFINED_FAMILY)
+ : theStatementFamily( aCodeFamily )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~IStatementFamily()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * GETTER - SETTER
+ * theCodeFamily
+ */
+ inline avm_opcode_family getStatementFamily() const
+ {
+ return( theStatementFamily );
+ }
+
+ inline bool hasStatementFamily() const
+ {
+ return( theStatementFamily != AVM_STATEMENT_UNDEFINED_FAMILY );
+ }
+
+ inline void setStatementFamily(avm_opcode_family aCodeFamily)
+ {
+ theStatementFamily = aCodeFamily;
+ }
+
+
+ inline void updateStatementFamily(AvmCode * aCode)
+ {
+ theStatementFamily = computeStatementFamily( aCode );
+ }
+
+ static avm_opcode_family computeStatementFamily(AVM_OPCODE opcode);
+
+ static avm_opcode_family computeStatementFamily(AvmCode * aCode);
+
+ /**
+ * TEST
+ * theCodeFamily
+ */
+ inline bool hasStatementBasicFamily() const
+ {
+ return( (theStatementFamily & AVM_STATEMENT_BASIC_FAMILY) != 0 );
+ }
+
+ inline bool isStatementBasicFamily() const
+ {
+ return( theStatementFamily == AVM_STATEMENT_BASIC_FAMILY );
+ }
+
+
+ inline bool hasStatementGuardFamily() const
+ {
+ return( (theStatementFamily & AVM_STATEMENT_GUARD_FAMILY) != 0 );
+ }
+
+ inline bool hasStatementInputFamily() const
+ {
+ return( (theStatementFamily & AVM_STATEMENT_INPUT_ANY_FAMILY) != 0 );
+ }
+
+ inline bool hasStatementOutputFamily() const
+ {
+ return( (theStatementFamily & AVM_STATEMENT_OUTPUT_ANY_FAMILY) != 0 );
+ }
+
+ inline bool hasStatementComFamily() const
+ {
+ return( (theStatementFamily & AVM_STATEMENT_COM_ANY_FAMILY) != 0 );
+ }
+
+
+ inline bool hasConditionalStatementFamily() const
+ {
+ return( (theStatementFamily & AVM_STATEMENT_CONDIONAL_CLASS) != 0 );
+ }
+
+ inline bool hasConditionalComStatementFamily() const
+ {
+ return( (theStatementFamily & AVM_STATEMENT_COM_CONDITIONAL_CLASS) != 0 );
+ }
+
+ inline bool isGuardConditionalStatementFamily() const
+ {
+ return( (theStatementFamily & (~ (AVM_STATEMENT_UNCONDIONAL_CLASS |
+ AVM_STATEMENT_GUARD_FAMILY)) ) == 0 );
+ }
+
+
+ inline bool hasUnconditionalStatementFamily() const
+ {
+ return( (theStatementFamily & AVM_STATEMENT_UNCONDIONAL_CLASS) != 0 );
+ }
+
+ inline bool isUnconditionalStatementFamily() const
+ {
+ return( (theStatementFamily & (~ AVM_STATEMENT_UNCONDIONAL_CLASS)) == 0 );
+ }
+
+
+ inline bool hasUnconditionalComStatementFamily() const
+ {
+ return( (theStatementFamily & AVM_STATEMENT_COM_ENV_FAMILY) != 0 );
+ }
+
+ inline bool isUnconditionalComStatementFamily() const
+ {
+ return( (theStatementFamily & (~ (AVM_STATEMENT_COM_ENV_FAMILY |
+ AVM_STATEMENT_BASIC_FAMILY))) == 0 );
+ }
+
+
+ /**
+ * Serialization
+ */
+ std::string strStatementFamily(
+ avm_opcode_family mask = AVM_STATEMENT_MASK_ALL_FAMILY) const;
+
+};
+
+
+}
+
+#endif /* OPERATORLIB_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/operator/OperatorManager.cpp b/org.eclipse.efm.symbex/src/fml/operator/OperatorManager.cpp
new file mode 100644
index 0000000..c97cae4
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/operator/OperatorManager.cpp
@@ -0,0 +1,2780 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 15 août 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "OperatorManager.h"
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/operator/Operator.h>
+
+
+namespace sep
+{
+
+
+std::map< std::string , Operator * > OperatorManager::theOperatorsMap;
+
+BFVector OperatorManager::TABLE_OF_OPERATOR;
+
+
+
+/*
+ *******************************************************************************
+ * AVM NOP STATEMENT
+ *******************************************************************************
+ */
+Operator * OperatorManager::OPERATOR_NOP = NULL;
+
+
+/*
+ *******************************************************************************
+ * AVM META STATEMENT
+ *******************************************************************************
+ */
+Operator * OperatorManager::OPERATOR_INFORMAL = NULL;
+
+Operator * OperatorManager::OPERATOR_TRACE = NULL;
+
+Operator * OperatorManager::OPERATOR_DEBUG = NULL;
+
+Operator * OperatorManager::OPERATOR_COMMENT = NULL;
+
+Operator * OperatorManager::OPERATOR_QUOTE = NULL;
+
+Operator * OperatorManager::OPERATOR_META_EVAL = NULL;
+Operator * OperatorManager::OPERATOR_META_RUN = NULL;
+
+
+/*
+ *******************************************************************************
+ * AVM UFI STATEMENT
+ *******************************************************************************
+ */
+Operator * OperatorManager::OPERATOR_UFI = NULL;
+
+
+/*
+ *******************************************************************************
+ * AVM FORM CONSTRUCTOR STATEMENT
+ *******************************************************************************
+ */
+Operator * OperatorManager::OPERATOR_CTOR = NULL;
+
+/*
+ *******************************************************************************
+ * AVM MACHINE MANAGING
+ *******************************************************************************
+ */
+Operator * OperatorManager::OPERATOR_CONTEXT_SWITCHER = NULL;
+
+Operator * OperatorManager::OPERATOR_INIT = NULL;
+Operator * OperatorManager::OPERATOR_FINAL = NULL;
+Operator * OperatorManager::OPERATOR_DESTROY = NULL;
+
+Operator * OperatorManager::OPERATOR_START = NULL;
+Operator * OperatorManager::OPERATOR_RESTART = NULL;
+Operator * OperatorManager::OPERATOR_STOP = NULL;
+
+Operator * OperatorManager::OPERATOR_WAIT = NULL;
+
+Operator * OperatorManager::OPERATOR_SUSPEND = NULL;
+Operator * OperatorManager::OPERATOR_RESUME = NULL;
+
+Operator * OperatorManager::OPERATOR_IENABLE_INVOKE = NULL;
+Operator * OperatorManager::OPERATOR_ENABLE_INVOKE = NULL;
+Operator * OperatorManager::OPERATOR_ENABLE_SET = NULL;
+
+Operator * OperatorManager::OPERATOR_IDISABLE_INVOKE = NULL;
+Operator * OperatorManager::OPERATOR_DISABLE_INVOKE = NULL;
+Operator * OperatorManager::OPERATOR_DISABLE_SET = NULL;
+Operator * OperatorManager::OPERATOR_DISABLE_CHILD = NULL;
+Operator * OperatorManager::OPERATOR_DISABLE_SELF = NULL;
+Operator * OperatorManager::OPERATOR_DISABLE_SELVES = NULL;
+
+Operator * OperatorManager::OPERATOR_IABORT_INVOKE = NULL;
+Operator * OperatorManager::OPERATOR_ABORT_INVOKE = NULL;
+Operator * OperatorManager::OPERATOR_ABORT_SET = NULL;
+Operator * OperatorManager::OPERATOR_ABORT_CHILD = NULL;
+Operator * OperatorManager::OPERATOR_ABORT_SELF = NULL;
+Operator * OperatorManager::OPERATOR_ABORT_SELVES = NULL;
+
+Operator * OperatorManager::OPERATOR_HISTORY_CLEAR = NULL;
+Operator * OperatorManager::OPERATOR_DEEP_HISTORY_INVOKE = NULL;
+Operator * OperatorManager::OPERATOR_SHALLOW_HISTORY_INVOKE = NULL;
+
+
+Operator * OperatorManager::OPERATOR_IRUN = NULL;
+Operator * OperatorManager::OPERATOR_RUN = NULL;
+Operator * OperatorManager::OPERATOR_RTC = NULL;
+
+Operator * OperatorManager::OPERATOR_INVOKE_NEW = NULL;
+
+Operator * OperatorManager::OPERATOR_INVOKE_ROUTINE = NULL;
+
+Operator * OperatorManager::OPERATOR_INVOKE_TRANSITION = NULL;
+
+Operator * OperatorManager::OPERATOR_INVOKE_METHOD = NULL;
+Operator * OperatorManager::OPERATOR_INVOKE_PROGRAM = NULL;
+Operator * OperatorManager::OPERATOR_INVOKE_FUNCTION = NULL;
+
+Operator * OperatorManager::OPERATOR_INVOKE_LAMBDA_APPLY = NULL;
+Operator * OperatorManager::OPERATOR_INVOKE_LAMBDA_LET = NULL;
+
+Operator * OperatorManager::OPERATOR_GOTO = NULL;
+
+Operator * OperatorManager::OPERATOR_SCHEDULE_INVOKE = NULL;
+Operator * OperatorManager::OPERATOR_SCHEDULE_GET = NULL;
+Operator * OperatorManager::OPERATOR_SCHEDULE_IN = NULL;
+Operator * OperatorManager::OPERATOR_SCHEDULE_SET = NULL;
+
+Operator * OperatorManager::OPERATOR_DEFER_INVOKE = NULL;
+Operator * OperatorManager::OPERATOR_DEFER_GET = NULL;
+Operator * OperatorManager::OPERATOR_DEFER_SET = NULL;
+
+Operator * OperatorManager::OPERATOR_FORK = NULL;
+Operator * OperatorManager::OPERATOR_JOIN = NULL;
+
+Operator * OperatorManager::OPERATOR_INPUT_ENABLED = NULL;
+
+Operator * OperatorManager::OPERATOR_RDV = NULL;
+
+Operator * OperatorManager::OPERATOR_SYNCHRONIZE = NULL;
+
+
+/*
+ *******************************************************************************
+ * AVM DATA STATUS
+ *******************************************************************************
+ */
+Operator * OperatorManager::OPERATOR_STATUS_WAS = NULL;
+Operator * OperatorManager::OPERATOR_STATUS_IS = NULL;
+Operator * OperatorManager::OPERATOR_STATUS_BEING = NULL;
+Operator * OperatorManager::OPERATOR_STATUS_WILL = NULL;
+
+Operator * OperatorManager::OPERATOR_CHANGED = NULL;
+Operator * OperatorManager::OPERATOR_CHANGED_TO = NULL;
+
+
+/*
+ *******************************************************************************
+ * AVM PROGRAM SCHEDULING
+ *******************************************************************************
+ */
+Operator * OperatorManager::OPERATOR_ASYNCHRONOUS = NULL;
+Operator * OperatorManager::OPERATOR_STRONG_SYNCHRONOUS = NULL;
+Operator * OperatorManager::OPERATOR_WEAK_SYNCHRONOUS = NULL;
+
+Operator * OperatorManager::OPERATOR_INTERLEAVING = NULL;
+Operator * OperatorManager::OPERATOR_PARTIAL_ORDER_REDUCTION = NULL;
+
+Operator * OperatorManager::OPERATOR_PARALLEL = NULL;
+
+// Optimized version of concurrency for RDV synchronization
+Operator * OperatorManager::OPERATOR_RDV_ASYNCHRONOUS = NULL;
+Operator * OperatorManager::OPERATOR_RDV_STRONG_SYNCHRONOUS = NULL;
+Operator * OperatorManager::OPERATOR_RDV_WEAK_SYNCHRONOUS = NULL;
+
+Operator * OperatorManager::OPERATOR_RDV_INTERLEAVING = NULL;
+Operator * OperatorManager::OPERATOR_RDV_PARTIAL_ORDER_REDUCTION = NULL;
+
+Operator * OperatorManager::OPERATOR_RDV_PARALLEL = NULL;
+
+
+Operator * OperatorManager::OPERATOR_EXCLUSIVE = NULL;
+Operator * OperatorManager::OPERATOR_NONDETERMINISM = NULL;
+
+Operator * OperatorManager::OPERATOR_PRIOR_GT = NULL;
+Operator * OperatorManager::OPERATOR_PRIOR_LT = NULL;
+
+Operator * OperatorManager::OPERATOR_SCHEDULE_AND_THEN = NULL;
+Operator * OperatorManager::OPERATOR_SCHEDULE_OR_ELSE = NULL;
+
+Operator * OperatorManager::OPERATOR_ATOMIC_SEQUENCE = NULL;
+
+Operator * OperatorManager::OPERATOR_SEQUENCE = NULL;
+Operator * OperatorManager::OPERATOR_SEQUENCE_SIDE = NULL;
+Operator * OperatorManager::OPERATOR_SEQUENCE_WEAK = NULL;
+
+Operator * OperatorManager::OPERATOR_PRODUCT = NULL;
+
+
+/*
+ *******************************************************************************
+ * AVM BUFFER MANAGING
+ *******************************************************************************
+ */
+Operator * OperatorManager::OPERATOR_UPDATE_BUFFER = NULL;
+
+
+/*
+ *******************************************************************************
+ * LAMBDA STATEMENT
+ *******************************************************************************
+ */
+Operator * OperatorManager::OPERATOR_APPLY = NULL;
+
+Operator * OperatorManager::OPERATOR_LAMBDA = NULL;
+
+
+/*
+ *******************************************************************************
+ * LET STATEMENT
+ *******************************************************************************
+ */
+Operator * OperatorManager::OPERATOR_LET = NULL;
+
+
+/*
+ *******************************************************************************
+ * AVM PRIMITIVE STATEMENT
+ *******************************************************************************
+ */
+Operator * OperatorManager::OPERATOR_ASSIGN = NULL;
+Operator * OperatorManager::OPERATOR_ASSIGN_AFTER = NULL;
+Operator * OperatorManager::OPERATOR_ASSIGN_OP = NULL;
+Operator * OperatorManager::OPERATOR_ASSIGN_OP_AFTER = NULL;
+Operator * OperatorManager::OPERATOR_ASSIGN_REF = NULL;
+Operator * OperatorManager::OPERATOR_ASSIGN_MACRO = NULL;
+
+Operator * OperatorManager::OPERATOR_ASSIGN_NEWFRESH = NULL;
+
+Operator * OperatorManager::OPERATOR_ASSIGN_RESET = NULL;
+
+
+Operator * OperatorManager::OPERATOR_GUARD = NULL;
+Operator * OperatorManager::OPERATOR_TIMED_GUARD = NULL;
+
+Operator * OperatorManager::OPERATOR_EVENT = NULL;
+Operator * OperatorManager::OPERATOR_CHECK_SAT = NULL;
+
+
+Operator * OperatorManager::OPERATOR_INPUT = NULL;
+Operator * OperatorManager::OPERATOR_INPUT_FROM = NULL;
+
+Operator * OperatorManager::OPERATOR_INPUT_SAVE = NULL;
+
+// Optimized version of INPUT
+Operator * OperatorManager::OPERATOR_INPUT_VAR = NULL;
+Operator * OperatorManager::OPERATOR_INPUT_FLOW = NULL;
+
+Operator * OperatorManager::OPERATOR_INPUT_ENV = NULL;
+Operator * OperatorManager::OPERATOR_INPUT_BUFFER = NULL;
+Operator * OperatorManager::OPERATOR_INPUT_RDV = NULL;
+Operator * OperatorManager::OPERATOR_INPUT_BROADCAST = NULL;
+Operator * OperatorManager::OPERATOR_INPUT_DELEGATE = NULL;
+
+
+Operator * OperatorManager::OPERATOR_OUTPUT = NULL;
+Operator * OperatorManager::OPERATOR_OUTPUT_TO = NULL;
+
+// Optimized version of OUTPUT
+Operator * OperatorManager::OPERATOR_OUTPUT_VAR = NULL;
+Operator * OperatorManager::OPERATOR_OUTPUT_FLOW = NULL;
+
+Operator * OperatorManager::OPERATOR_OUTPUT_ENV = NULL;
+Operator * OperatorManager::OPERATOR_OUTPUT_BUFFER = NULL;
+Operator * OperatorManager::OPERATOR_OUTPUT_RDV = NULL;
+Operator * OperatorManager::OPERATOR_OUTPUT_BROADCAST = NULL;
+Operator * OperatorManager::OPERATOR_OUTPUT_DELEGATE = NULL;
+
+
+Operator * OperatorManager::OPERATOR_PRESENT = NULL;
+Operator * OperatorManager::OPERATOR_ABSENT = NULL;
+
+
+Operator * OperatorManager::OPERATOR_IF = NULL;
+Operator * OperatorManager::OPERATOR_IFE = NULL;
+
+Operator * OperatorManager::OPERATOR_FOR = NULL;
+Operator * OperatorManager::OPERATOR_FOREACH = NULL;
+Operator * OperatorManager::OPERATOR_WHILE_DO = NULL;
+Operator * OperatorManager::OPERATOR_DO_WHILE = NULL;
+
+Operator * OperatorManager::OPERATOR_BREAK = NULL;
+Operator * OperatorManager::OPERATOR_CONTINUE = NULL;
+Operator * OperatorManager::OPERATOR_RETURN = NULL;
+Operator * OperatorManager::OPERATOR_EXIT = NULL;
+
+Operator * OperatorManager::OPERATOR_STEP_MARK = NULL;
+
+
+/*
+ *******************************************************************************
+ * AVM PREDICAT EXPRESSION
+ *******************************************************************************
+ */
+Operator * OperatorManager::OPERATOR_EXIST = NULL;
+Operator * OperatorManager::OPERATOR_FORALL = NULL;
+
+Operator * OperatorManager::OPERATOR_NOT = NULL;
+
+Operator * OperatorManager::OPERATOR_AND = NULL;
+Operator * OperatorManager::OPERATOR_AND_THEN = NULL;
+
+Operator * OperatorManager::OPERATOR_NAND = NULL;
+
+Operator * OperatorManager::OPERATOR_XAND = NULL;
+
+Operator * OperatorManager::OPERATOR_OR = NULL;
+Operator * OperatorManager::OPERATOR_OR_ELSE = NULL;
+
+Operator * OperatorManager::OPERATOR_NOR = NULL;
+
+Operator * OperatorManager::OPERATOR_XOR = NULL;
+Operator * OperatorManager::OPERATOR_XNOR = NULL;
+
+
+/*
+ *******************************************************************************
+ * AVM COMPARISON EXPRESSION
+ *******************************************************************************
+ */
+Operator * OperatorManager::OPERATOR_EQ = NULL;
+Operator * OperatorManager::OPERATOR_NEQ = NULL;
+
+Operator * OperatorManager::OPERATOR_SEQ = NULL;
+Operator * OperatorManager::OPERATOR_NSEQ = NULL;
+
+Operator * OperatorManager::OPERATOR_LT = NULL;
+Operator * OperatorManager::OPERATOR_LTE = NULL;
+Operator * OperatorManager::OPERATOR_GT = NULL;
+Operator * OperatorManager::OPERATOR_GTE = NULL;
+
+
+
+/*
+ *******************************************************************************
+ * AVM BITWISE EXPRESSION
+ *******************************************************************************
+ */
+Operator * OperatorManager::OPERATOR_BNOT = NULL;
+
+Operator * OperatorManager::OPERATOR_BAND = NULL;
+Operator * OperatorManager::OPERATOR_BOR = NULL;
+Operator * OperatorManager::OPERATOR_BXOR = NULL;
+
+Operator * OperatorManager::OPERATOR_LSHIFT = NULL;
+Operator * OperatorManager::OPERATOR_RSHIFT = NULL;
+
+
+/*
+ *******************************************************************************
+ * AVM ARITHMETIC EXPRESSION
+ *******************************************************************************
+ */
+Operator * OperatorManager::OPERATOR_PLUS = NULL;
+Operator * OperatorManager::OPERATOR_MINUS = NULL;
+Operator * OperatorManager::OPERATOR_UMINUS = NULL;
+
+Operator * OperatorManager::OPERATOR_MULT = NULL;
+Operator * OperatorManager::OPERATOR_POW = NULL;
+
+Operator * OperatorManager::OPERATOR_DIV = NULL;
+Operator * OperatorManager::OPERATOR_MOD = NULL;
+
+Operator * OperatorManager::OPERATOR_MIN = NULL;
+Operator * OperatorManager::OPERATOR_MAX = NULL;
+
+
+/*
+ *******************************************************************************
+ * LOOKUP STATEMENT
+ *******************************************************************************
+ */
+Operator * OperatorManager::OPERATOR_LOOKUP_INT_EXT = NULL;
+Operator * OperatorManager::OPERATOR_LOOKUP_INT = NULL;
+Operator * OperatorManager::OPERATOR_LOOKUP_NEAREST = NULL;
+Operator * OperatorManager::OPERATOR_LOOKUP_BELOW = NULL;
+Operator * OperatorManager::OPERATOR_LOOKUP_ABOVE = NULL;
+Operator * OperatorManager::OPERATOR_LOOKUP2D_INT_EXT = NULL;
+
+
+/*
+ *******************************************************************************
+ * AVM MATHEMATICAL FUNCTION
+ *******************************************************************************
+ */
+ // RANDOM
+Operator * OperatorManager::OPERATOR_RANDOM = NULL;
+
+// ROUNDING
+Operator * OperatorManager::OPERATOR_ABS = NULL;
+
+Operator * OperatorManager::OPERATOR_CEIL = NULL;
+Operator * OperatorManager::OPERATOR_FLOOR = NULL;
+Operator * OperatorManager::OPERATOR_ROUND = NULL;
+Operator * OperatorManager::OPERATOR_TRUNCATE = NULL;
+
+
+// EXP - LOG
+Operator * OperatorManager::OPERATOR_SQRT = NULL;
+
+Operator * OperatorManager::OPERATOR_EXP = NULL;
+Operator * OperatorManager::OPERATOR_LN = NULL;
+Operator * OperatorManager::OPERATOR_LOG = NULL;
+
+// TRIGONOMETRIC
+Operator * OperatorManager::OPERATOR_SIN = NULL;
+Operator * OperatorManager::OPERATOR_COS = NULL;
+Operator * OperatorManager::OPERATOR_TAN = NULL;
+
+Operator * OperatorManager::OPERATOR_SINH = NULL;
+Operator * OperatorManager::OPERATOR_COSH = NULL;
+Operator * OperatorManager::OPERATOR_TANH = NULL;
+
+Operator * OperatorManager::OPERATOR_ASIN = NULL;
+Operator * OperatorManager::OPERATOR_ACOS = NULL;
+Operator * OperatorManager::OPERATOR_ATAN = NULL;
+Operator * OperatorManager::OPERATOR_ATAN2 = NULL;
+
+Operator * OperatorManager::OPERATOR_ASINH = NULL;
+Operator * OperatorManager::OPERATOR_ACOSH = NULL;
+Operator * OperatorManager::OPERATOR_ATANH = NULL;
+
+
+/*
+ *******************************************************************************
+ * AVM STRING / COLLECTION OPERATOR
+ *******************************************************************************
+ */
+Operator * OperatorManager::OPERATOR_CONTAINS = NULL;
+
+Operator * OperatorManager::OPERATOR_IN = NULL;
+Operator * OperatorManager::OPERATOR_NOTIN = NULL;
+
+Operator * OperatorManager::OPERATOR_SUBSET = NULL;
+Operator * OperatorManager::OPERATOR_SUBSETEQ = NULL;
+
+Operator * OperatorManager::OPERATOR_INTERSECT = NULL;
+
+Operator * OperatorManager::OPERATOR_STARTS_WITH = NULL;
+Operator * OperatorManager::OPERATOR_ENDS_WITH = NULL;
+
+Operator * OperatorManager::OPERATOR_CONCAT = NULL;
+
+Operator * OperatorManager::OPERATOR_APPEND = NULL;
+
+Operator * OperatorManager::OPERATOR_REMOVE = NULL;
+Operator * OperatorManager::OPERATOR_CLEAR = NULL;
+
+Operator * OperatorManager::OPERATOR_RESIZE = NULL;
+
+Operator * OperatorManager::OPERATOR_SELECT = NULL;
+
+Operator * OperatorManager::OPERATOR_PUSH = NULL;
+Operator * OperatorManager::OPERATOR_ASSIGN_TOP = NULL;
+Operator * OperatorManager::OPERATOR_TOP = NULL;
+Operator * OperatorManager::OPERATOR_POP = NULL;
+Operator * OperatorManager::OPERATOR_POP_FROM = NULL;
+
+Operator * OperatorManager::OPERATOR_EMPTY = NULL;
+Operator * OperatorManager::OPERATOR_NONEMPTY = NULL;
+Operator * OperatorManager::OPERATOR_SINGLETON = NULL;
+Operator * OperatorManager::OPERATOR_POPULATED = NULL;
+Operator * OperatorManager::OPERATOR_FULL = NULL;
+
+Operator * OperatorManager::OPERATOR_SIZE = NULL;
+
+
+/*
+ *******************************************************************************
+ * IOLTL BEHAVIORAL PREDICAT
+ *******************************************************************************
+ */
+Operator * OperatorManager::OPERATOR_GLOBALLY = NULL;
+Operator * OperatorManager::OPERATOR_UNTIL = NULL;
+Operator * OperatorManager::OPERATOR_NEXT = NULL;
+Operator * OperatorManager::OPERATOR_EVENTUALLY = NULL;
+Operator * OperatorManager::OPERATOR_RELEASES = NULL;
+Operator * OperatorManager::OPERATOR_OBS = NULL;
+
+
+/*
+ *******************************************************************************
+ * IOLTL LOGICAL PREDICAT
+ *******************************************************************************
+ */
+Operator * OperatorManager::OPERATOR_AND_T = NULL;
+Operator * OperatorManager::OPERATOR_OR_T = NULL;
+Operator * OperatorManager::OPERATOR_NOT_T = NULL;
+Operator * OperatorManager::OPERATOR_IMP_T = NULL;
+
+
+
+/**
+ * LOADER
+ */
+void OperatorManager::load()
+{
+
+// Operator print string format: NAME_ID, ALGEBRA_*, *FIX, SYMBOL, MIXFIX, QEPCAD
+
+#define NEW_STATEMENT( OP , NAME ) \
+ OPERATOR_##OP = newOpStatement( \
+ AVM_OPCODE_##OP , AVM_OPCODE_##OP , "operator::" #OP , NAME )
+
+#define NEW_STATEMENT_INVOKE( OP , NAME ) \
+ OPERATOR_##OP##_INVOKE = newOpStatement( \
+ AVM_OPCODE_##OP##_INVOKE , AVM_OPCODE_##OP##_INVOKE , \
+ "operator::" #OP "#INVOKE" , NAME )
+
+#define NEW_STATEMENT_DESC( OP , DESC , STR ) \
+ OPERATOR_##OP##_##DESC = newOpStatement( \
+ AVM_OPCODE_##OP##_##DESC , "operator::" #OP , STR )
+
+#define NEW_STATEMENT_DIESE( OP , DIESE , NAME ) \
+ OPERATOR_##OP##_##DIESE = newOpStatement( \
+ AVM_OPCODE_##OP##_##DIESE , AVM_OPCODE_##OP##_##DIESE , \
+ "operator::" #OP "#" #DIESE , NAME )
+
+#define NEW_STATEMENT_OPTI( OP , OPTI , NAME ) \
+ OPERATOR_##OP##_##OPTI = newOpStatement( AVM_OPCODE_##OP , \
+ AVM_OPCODE_##OP##_##OPTI , "operator::" #OP "_" #OPTI , NAME )
+
+
+#define NEW_FUNCTION( OP , NAME ) \
+ OPERATOR_##OP = newOperator( AVM_OPCODE_##OP , AVM_OPCODE_##OP , \
+ "operator::" #OP , NAME , ALGEBRA_STD , NOTATION_FUNCTION , \
+ NAME , NAME "(_)" , NAME )
+
+
+#define NEW_OP_ASSOC_COM( OP , NAME , SYMBOL ) \
+ OPERATOR_##OP = newOperatorAssocCom( AVM_OPCODE_##OP , \
+ AVM_OPCODE_##OP , "operator::" #OP , NAME , SYMBOL )
+
+#define NEW_OP_ASSOC_COM_FULL( OP , NAME , SYMBOL , MIXFIX, QEPCAD ) \
+ OPERATOR_##OP = newOperatorAssocCom( AVM_OPCODE_##OP , \
+ "operator::" #OP , NAME , SYMBOL , MIXFIX, QEPCAD )
+
+#define NEW_OP_ASSOC_COM_RDV( OP , NAME , SYMBOL ) \
+ OPERATOR_RDV_##OP = newOperatorAssocCom( \
+ AVM_OPCODE_RDV_##OP , AVM_OPCODE_RDV##_##OP , \
+ "operator::RDV_" #OP , NAME , SYMBOL )
+
+
+#define NEW_OP_ASSOC( OP , NAME , SYMBOL ) \
+ OPERATOR_##OP = newOperatorAssoc( \
+ AVM_OPCODE_##OP , "operator::" #OP , NAME , SYMBOL )
+
+#define NEW_OP_LEFT_ASSOC( OP , NAME , SYMBOL ) \
+ OPERATOR_##OP = newOperatorLeftAssoc( \
+ AVM_OPCODE_##OP , "operator::" #OP , NAME , SYMBOL )
+
+#define NEW_OP_RIGHT_ASSOC( OP , NAME , SYMBOL ) \
+ OPERATOR_##OP = newOperatorRightAssoc( \
+ AVM_OPCODE_##OP , "operator::" #OP , NAME , SYMBOL )
+
+#define NEW_OP_RIGHT_ASSOC_DIESE( OP , DIESE , NAME , SYMBOL ) \
+ OPERATOR_##OP##_##DIESE = newOperatorRightAssoc( \
+ AVM_OPCODE_##OP##_##DIESE , \
+ "operator::" #OP "#" #DIESE , NAME , SYMBOL )
+
+
+#define NEW_OP_INFIX( OP , NAME ) \
+ OPERATOR_##OP = newOperatorStdInfix( \
+ AVM_OPCODE_##OP , "operator::" #OP , NAME , NAME )
+
+#define NEW_OP_INFIX_FULL( OP , NAME , SYMBOL , MIXFIX, QEPCAD ) \
+ OPERATOR_##OP = newOperatorStdInfix( AVM_OPCODE_##OP , \
+ "operator::" #OP , NAME , SYMBOL , MIXFIX, QEPCAD )
+
+
+#define NEW_OP_PREFIX( OP , NAME ) \
+ OPERATOR_##OP = newOperatorStdPrefix( \
+ AVM_OPCODE_##OP , "operator::" #OP , NAME , NAME )
+
+#define NEW_OP_PREFIX_SYMB( OP , NAME , SYMBOL ) \
+ OPERATOR_##OP = newOperatorStdPrefix( \
+ AVM_OPCODE_##OP , "operator::" #OP , NAME , SYMBOL )
+
+#define NEW_OP_PREFIX_FULL( OP , NAME , SYMBOL , MIXFIX, QEPCAD ) \
+ OPERATOR_##OP = newOperatorStdPrefix( AVM_OPCODE_##OP , \
+ "operator::" #OP , NAME , SYMBOL , MIXFIX, QEPCAD )
+
+
+ /*
+ ***************************************************************************
+ * AVM NOP STATEMENT
+ ***************************************************************************
+ */
+ NEW_STATEMENT( NOP , "nop" );
+
+ /*
+ ***************************************************************************
+ * AVM META STATEMENT
+ ***************************************************************************
+ */
+ NEW_STATEMENT( INFORMAL , "informal" );
+ NEW_STATEMENT( TRACE , "trace" );
+ NEW_STATEMENT( DEBUG , "debug" );
+ NEW_STATEMENT( COMMENT , "comment" );
+ NEW_STATEMENT( QUOTE , "quote" );
+ NEW_STATEMENT( META_EVAL , "meta_eval" );
+ NEW_STATEMENT( META_RUN , "meta_run" );
+
+ /*
+ ***************************************************************************
+ * AVM UFI STATEMENT
+ ***************************************************************************
+ */
+ NEW_STATEMENT( UFI , "ufi" );
+
+ /*
+ ***************************************************************************
+ * AVM CONSTRUCTOR & CAST STATEMENT
+ ***************************************************************************
+ */
+ NEW_STATEMENT( CTOR , "ctor" );
+
+ /*
+ ***************************************************************************
+ * AVM MACHINE MANAGING
+ ***************************************************************************
+ */
+ NEW_STATEMENT( CONTEXT_SWITCHER, "ctx" );
+
+ NEW_STATEMENT( INIT , "init" );
+ NEW_STATEMENT( FINAL , "final" );
+ NEW_STATEMENT( DESTROY , "destroy" );
+
+ NEW_STATEMENT( START , "start" );
+ NEW_STATEMENT( RESTART , "restart" );
+
+ NEW_STATEMENT( STOP , "stop" );
+ NEW_STATEMENT( WAIT , "wait" );
+
+ NEW_STATEMENT( SUSPEND , "suspend" );
+ NEW_STATEMENT( RESUME , "resume" );
+
+ NEW_STATEMENT_INVOKE( IENABLE , "ienable" );
+ NEW_STATEMENT_INVOKE( ENABLE , "enable" );
+
+ NEW_STATEMENT_DIESE( ENABLE , SET , "enable#set" );
+
+ NEW_STATEMENT_INVOKE( IDISABLE , "idisable" );
+ NEW_STATEMENT_INVOKE( DISABLE , "disable" );
+
+ NEW_STATEMENT_DIESE( DISABLE , SET , "disable#set" );
+ NEW_STATEMENT_DIESE( DISABLE , CHILD , "disable#child" );
+ NEW_STATEMENT_DIESE( DISABLE , SELF , "disable#self" );
+ NEW_STATEMENT_DIESE( DISABLE , SELVES , "disable#selves");
+
+ NEW_STATEMENT_INVOKE( IABORT , "iabort" );
+ NEW_STATEMENT_INVOKE( ABORT , "abort" );
+
+ NEW_STATEMENT_DIESE( ABORT , SET , "abort#set" );
+ NEW_STATEMENT_DIESE( ABORT , CHILD , "abort#child" );
+ NEW_STATEMENT_DIESE( ABORT , SELF , "abort#self" );
+ NEW_STATEMENT_DIESE( ABORT , SELVES , "abort#selves");
+
+ NEW_STATEMENT_DIESE( HISTORY , CLEAR , "history#clear" );
+ NEW_STATEMENT_INVOKE( DEEP_HISTORY , "deep_history#invoke" );
+ NEW_STATEMENT_INVOKE( SHALLOW_HISTORY , "shallow_history#invoke" );
+
+ NEW_STATEMENT( IRUN, "irun");
+ NEW_STATEMENT( RUN , "run" );
+ NEW_STATEMENT( RTC , "rtc" );
+
+ NEW_STATEMENT( INVOKE_NEW , "invoke#new" );
+
+ NEW_STATEMENT( INVOKE_ROUTINE , "invoke#routine" );
+
+ NEW_STATEMENT( INVOKE_TRANSITION, "invoke#transition");
+
+ NEW_STATEMENT( INVOKE_METHOD , "invoke#method" );
+ NEW_STATEMENT( INVOKE_PROGRAM , "invoke#program" );
+ NEW_STATEMENT( INVOKE_FUNCTION , "invoke#function" );
+
+ NEW_STATEMENT( INVOKE_LAMBDA_APPLY, "invoke#apply" );
+ NEW_STATEMENT( INVOKE_LAMBDA_LET , "invoke#let" );
+
+ NEW_STATEMENT( GOTO, "goto");
+
+ NEW_STATEMENT_DIESE( SCHEDULE , INVOKE, "schedule" );
+ NEW_STATEMENT_DIESE( SCHEDULE , GET , "schedule#get");
+ NEW_STATEMENT_DIESE( SCHEDULE , IN , "schedule#in" );
+ NEW_STATEMENT_DIESE( SCHEDULE , SET , "schedule#set");
+
+ NEW_STATEMENT_DIESE( DEFER , INVOKE, "defer" );
+ NEW_STATEMENT_DIESE( DEFER , GET , "defer#get");
+ NEW_STATEMENT_DIESE( DEFER , SET , "defer#set");
+
+ NEW_OP_ASSOC_COM( FORK , "fork" , "|fork|" );
+ NEW_OP_ASSOC_COM( JOIN , "join" , "|join|" );
+
+ NEW_STATEMENT( INPUT_ENABLED, "input_enabled");
+
+ NEW_STATEMENT( RDV, "rdv");
+
+ NEW_STATEMENT( SYNCHRONIZE, "synchronize");
+
+ /*
+ ***************************************************************************
+ * AVM DATA STATUS
+ ***************************************************************************
+ */
+ NEW_FUNCTION( STATUS_WAS , "status#was" );
+ NEW_FUNCTION( STATUS_IS , "status#is" );
+ NEW_FUNCTION( STATUS_BEING , "status#being" );
+ NEW_FUNCTION( STATUS_WILL , "status#will" );
+ NEW_FUNCTION( CHANGED , "changed" );
+ NEW_FUNCTION( CHANGED_TO , "changed#to" );
+
+ /*
+ ***************************************************************************
+ * AVM PROGRAM SCHEDULING
+ ***************************************************************************
+ */
+ NEW_OP_ASSOC_COM( ASYNCHRONOUS , "async" , "|a|");
+
+ NEW_OP_ASSOC_COM( STRONG_SYNCHRONOUS , "strong_sync" , "|and|");
+
+ NEW_OP_ASSOC_COM( WEAK_SYNCHRONOUS , "weak_sync" , "|or|");
+
+ NEW_OP_ASSOC_COM( INTERLEAVING , "interleaving" , "|i|");
+
+ NEW_OP_ASSOC_COM( PARTIAL_ORDER_REDUCTION , "partial_order_reduction" , "|por|");
+
+ NEW_OP_ASSOC_COM( PARALLEL , "parallel" , "|,|");
+
+ // Optimized version of concurrency for RDV synchronization
+ NEW_OP_ASSOC_COM_RDV( ASYNCHRONOUS , "rdv_async" , "||a||");
+
+ NEW_OP_ASSOC_COM_RDV( STRONG_SYNCHRONOUS , "rdv_strong_sync" , "||and||");
+
+ NEW_OP_ASSOC_COM_RDV( WEAK_SYNCHRONOUS , "rdv_weak_sync" , "||or||");
+
+ NEW_OP_ASSOC_COM_RDV( INTERLEAVING , "rdv_interleaving" , "||i||");
+
+ NEW_OP_ASSOC_COM( RDV_PARTIAL_ORDER_REDUCTION ,
+ "rdv_partial_order_reduction" , "||por||");
+
+ NEW_OP_ASSOC_COM_RDV( PARALLEL , "rdv_parallel" , "||,||");
+
+ NEW_OP_ASSOC_COM( EXCLUSIVE , "exclusive" , "|xor|");
+
+ NEW_OP_ASSOC_COM( NONDETERMINISM , "indeterminism" , "|/\\|");
+
+ NEW_OP_LEFT_ASSOC( PRIOR_GT , "prior_gt" , "|>|");
+ NEW_OP_LEFT_ASSOC( PRIOR_LT , "prior_lt" , "|<|");
+
+ NEW_OP_ASSOC_COM( SCHEDULE_AND_THEN , "|and#then|" , "|and#then|");
+ NEW_OP_ASSOC_COM( SCHEDULE_OR_ELSE , "|or#else|" , "|or#else|" );
+
+ NEW_OP_ASSOC( ATOMIC_SEQUENCE , "atomic" , "|§|" );
+ NEW_OP_ASSOC( SEQUENCE , "seq" , "|;|" );
+ NEW_OP_ASSOC( SEQUENCE_SIDE , "seq_side" , "|/;|" );
+ NEW_OP_ASSOC( SEQUENCE_WEAK , "seq_weak" , "|;;|" );
+
+ NEW_OP_ASSOC_COM( PRODUCT , "prod" , "|x|");
+
+ /*
+ ***************************************************************************
+ * AVM BUFFER MANAGING
+ ***************************************************************************
+ */
+ NEW_FUNCTION( UPDATE_BUFFER , "UpdateBuffer" );
+
+ /*
+ ***************************************************************************
+ * LAMBDA STATEMENT
+ ***************************************************************************
+ */
+ NEW_FUNCTION( APPLY , "apply" );
+ NEW_FUNCTION( LAMBDA , "lambda" );
+
+ /*
+ ***************************************************************************
+ * LET STATEMENT
+ ***************************************************************************
+ */
+ NEW_OP_PREFIX( LET , "let" );
+
+ /*
+ ***************************************************************************
+ * LOOKUP STATEMENT
+ ***************************************************************************
+ */
+ NEW_FUNCTION( LOOKUP_INT_EXT , "lookupie" );
+ NEW_FUNCTION( LOOKUP_INT , "lookupi" );
+ NEW_FUNCTION( LOOKUP_NEAREST , "lookupn" );
+ NEW_FUNCTION( LOOKUP_BELOW , "lookupb" );
+ NEW_FUNCTION( LOOKUP_ABOVE , "lookupa" );
+ NEW_FUNCTION( LOOKUP2D_INT_EXT , "lookup2die" );
+
+
+ /*
+ ***************************************************************************
+ * AVM PRIMITIVE STATEMENT
+ ***************************************************************************
+ */
+ NEW_OP_RIGHT_ASSOC( ASSIGN , "assign" , ":=" );
+
+ NEW_OP_RIGHT_ASSOC_DIESE( ASSIGN , AFTER , "assign#after" , "=:" );
+ NEW_OP_RIGHT_ASSOC_DIESE( ASSIGN , OP , "assign#op" , ":=" );
+ NEW_OP_RIGHT_ASSOC_DIESE( ASSIGN , OP_AFTER, "assign#op#after", "=:" );
+ NEW_OP_RIGHT_ASSOC_DIESE( ASSIGN , REF , "assign#ref" , "<-" );
+ NEW_OP_RIGHT_ASSOC_DIESE( ASSIGN , MACRO , "assign#macro" , "::=");
+
+ NEW_FUNCTION( ASSIGN_NEWFRESH , "newfresh" );
+ NEW_FUNCTION( ASSIGN_RESET , "reset" );
+
+ NEW_STATEMENT( GUARD , "guard" );
+ NEW_STATEMENT( TIMED_GUARD, "tguard" );
+
+ NEW_STATEMENT( EVENT , "event" );
+
+ NEW_STATEMENT( CHECK_SAT , "check_sat" );
+
+ NEW_STATEMENT( INPUT , "input" );
+
+ NEW_STATEMENT( INPUT_FROM , "input_from");
+ NEW_STATEMENT( INPUT_SAVE , "input#save");
+
+ // Optimized version of INPUT
+ NEW_STATEMENT_OPTI( INPUT , VAR , "input#var" );
+ NEW_STATEMENT_OPTI( INPUT , FLOW , "input#flow" );
+
+ NEW_STATEMENT_OPTI( INPUT , ENV , "input#env" );
+ NEW_STATEMENT_OPTI( INPUT , BUFFER, "input#buffer");
+ NEW_STATEMENT_OPTI( INPUT , RDV , "input#rdv" );
+
+ NEW_STATEMENT_OPTI( INPUT , BROADCAST, "input#broadcast");
+ NEW_STATEMENT_OPTI( INPUT , DELEGATE , "input#delegate" );
+
+ NEW_STATEMENT( OUTPUT, "output");
+
+ NEW_STATEMENT( OUTPUT_TO, "output_to");
+
+ // Optimized version of OUTPUT
+ NEW_STATEMENT_OPTI( OUTPUT , VAR , "output#var" );
+ NEW_STATEMENT_OPTI( OUTPUT , FLOW , "output#flow" );
+
+ NEW_STATEMENT_OPTI( OUTPUT , ENV , "output#env" );
+ NEW_STATEMENT_OPTI( OUTPUT , BUFFER, "output#buffer");
+ NEW_STATEMENT_OPTI( OUTPUT , RDV , "output#rdv" );
+
+ NEW_STATEMENT_OPTI( OUTPUT , BROADCAST, "output#broadcast");
+ NEW_STATEMENT_OPTI( OUTPUT , DELEGATE , "output#delegate" );
+
+ NEW_STATEMENT( PRESENT, "present");
+ NEW_STATEMENT( ABSENT , "absent" );
+
+ NEW_OP_PREFIX(IF , "if" );
+ NEW_OP_PREFIX(IFE , "ife" );
+
+ NEW_STATEMENT( FOR , "for" );
+ NEW_STATEMENT( FOREACH , "foreach" );
+ NEW_STATEMENT( WHILE_DO , "while_do" );
+ NEW_STATEMENT( DO_WHILE , "do_while" );
+
+ NEW_STATEMENT( BREAK , "break" );
+ NEW_STATEMENT( CONTINUE , "continue" );
+
+ NEW_STATEMENT( RETURN , "return" );
+ NEW_STATEMENT( EXIT , "exit" );
+
+ NEW_STATEMENT( STEP_MARK , "step_mark" );
+
+ /*
+ ***************************************************************************
+ * AVM PREDICAT EXPRESSION
+ ***************************************************************************
+ */
+ NEW_OP_PREFIX( EXIST , "exist" );
+ NEW_OP_PREFIX( FORALL , "forall" );
+
+ NEW_OP_PREFIX_FULL(NOT , "not", "!", "!_", "~");
+
+ NEW_OP_ASSOC_COM_FULL( AND , "and" , "&&", "_&_", "/\\");
+
+ NEW_OP_INFIX( AND_THEN , "and#then" );
+
+ NEW_OP_ASSOC_COM( NAND , "nand" , "nand" );
+ NEW_OP_ASSOC_COM( XAND , "xand" , "xand" );
+
+ NEW_OP_ASSOC_COM_FULL( OR , "or" , "||", "_|_", "\\/");
+
+ NEW_OP_INFIX( OR_ELSE , "or#else" );
+
+ NEW_OP_ASSOC_COM( NOR , "nor" , "nor" );
+ NEW_OP_ASSOC_COM( XOR , "xor" , "xor" );
+ NEW_OP_ASSOC_COM( XNOR , "xnor" , "xnor" );
+
+ /*
+ ***************************************************************************
+ * AVM COMPARISON EXPRESSION
+ ***************************************************************************
+ */
+ NEW_OP_INFIX_FULL( SEQ , "seq" , "===", "_===_", "===");
+ NEW_OP_INFIX_FULL( NSEQ , "nseq" , "=!=", "_=!=_", "=/=");
+
+ /*
+ ***************************************************************************
+ * AVM COMPARISON EXPRESSION
+ ***************************************************************************
+ */
+ NEW_OP_INFIX_FULL( EQ , "eq" , "==", "_==_", "=" );
+ NEW_OP_INFIX_FULL( NEQ , "neq" , "!=", "_!=_", "/=");
+
+ NEW_OP_INFIX_FULL( LT , "lt" , "<" , "_<_" , "<" );
+ NEW_OP_INFIX_FULL( LTE , "lte" , "<=", "_<=_", "<=");
+
+ NEW_OP_INFIX_FULL( GT , "gt" , ">" , "_>_" , ">" );
+ NEW_OP_INFIX_FULL( GTE , "gte" , ">=", "_>=_", ">=");
+
+ /*
+ ***************************************************************************
+ * AVM BITWISE EXPRESSION
+ ***************************************************************************
+ */
+ NEW_OP_PREFIX_FULL( BNOT , "bnot" , "~" , "_bnot_", "bnot");
+
+ NEW_OP_INFIX( BAND , "band" );
+ NEW_OP_INFIX( BOR , "bor" );
+ NEW_OP_INFIX( BXOR , "bxor" );
+
+ NEW_OP_INFIX_FULL( LSHIFT , "lshift" , "<<", "_lshift_", "lshift");
+ NEW_OP_INFIX_FULL( RSHIFT , "rshift" , ">>", "_rshift_", "rshift");
+
+ /*
+ ***************************************************************************
+ * AVM ARITHMETIC EXPRESSION
+ ***************************************************************************
+ */
+ NEW_OP_ASSOC_COM( PLUS , "plus" , "+");
+
+ NEW_OP_LEFT_ASSOC( MINUS , "minus" , "-");
+
+ NEW_OP_PREFIX_SYMB( UMINUS , "uminus" , "-");
+
+ NEW_OP_ASSOC_COM_FULL( MULT , "mult" , "*", "_*_", " ");
+
+ NEW_OP_RIGHT_ASSOC( POW , "pow" , "^");
+
+ NEW_OP_LEFT_ASSOC( DIV , "div" , "/");
+ NEW_OP_LEFT_ASSOC( MOD , "mod" , "%");
+
+ NEW_OP_ASSOC_COM( MIN , "min" , "min" );
+ NEW_OP_ASSOC_COM( MAX , "max" , "max" );
+
+ /*
+ ***************************************************************************
+ * AVM MATHEMATICAL FUNCTION
+ ***************************************************************************
+ */
+ // RANDOM
+ NEW_FUNCTION( RANDOM , "random" );
+
+ // ABS
+ NEW_FUNCTION( ABS , "abs" );
+
+ // ROUNDING
+ NEW_FUNCTION( CEIL , "ceil" );
+ NEW_FUNCTION( FLOOR , "floor" );
+ NEW_FUNCTION( ROUND , "round" );
+
+ NEW_FUNCTION( TRUNCATE , "trunc" );
+
+ // EXP - LOG
+ NEW_FUNCTION( SQRT , "sqrt" );
+ NEW_FUNCTION( EXP , "exp" );
+ NEW_FUNCTION( LN , "ln" );
+ NEW_FUNCTION( LOG , "log" );
+
+
+ // TRIGONOMETRIC
+ NEW_FUNCTION( SIN , "sin" );
+ NEW_FUNCTION( COS , "cos" );
+ NEW_FUNCTION( TAN , "tan" );
+
+ NEW_FUNCTION( SINH , "sinh" );
+ NEW_FUNCTION( COSH , "cosh" );
+ NEW_FUNCTION( TANH , "tanh" );
+
+ NEW_FUNCTION( ASIN , "asin" );
+ NEW_FUNCTION( ACOS , "acos" );
+ NEW_FUNCTION( ATAN , "atan" );
+
+ NEW_FUNCTION( ATAN2 , "atan2" );
+
+ NEW_FUNCTION( ASINH , "asinh" );
+ NEW_FUNCTION( ACOSH , "acosh" );
+ NEW_FUNCTION( ATANH , "atanh" );
+
+ /*
+ ***************************************************************************
+ * AVM STRING / COLLECTION OPERATOR
+ ***************************************************************************
+ */
+ NEW_OP_INFIX( CONTAINS , "contains" );
+
+ NEW_OP_INFIX( IN , "in" );
+ NEW_OP_INFIX( NOTIN , "notin" );
+
+ NEW_OP_INFIX( SUBSET , "subset" );
+ NEW_OP_INFIX( SUBSETEQ , "subseteq" );
+
+ NEW_OP_INFIX( INTERSECT , "intersect" );
+
+ NEW_OP_INFIX( STARTS_WITH , "start_with" );
+ NEW_OP_INFIX( ENDS_WITH , "end_with" );
+
+ NEW_OP_INFIX( CONCAT , "concat" );
+ NEW_OP_PREFIX( APPEND , "append" );
+ NEW_OP_PREFIX( REMOVE , "remove" );
+ NEW_OP_PREFIX( CLEAR , "clear" );
+ NEW_OP_PREFIX( RESIZE , "resize" );
+ NEW_OP_PREFIX( SELECT , "select" );
+
+ NEW_OP_PREFIX_SYMB( PUSH , "push" , "<=<");
+
+ NEW_OP_PREFIX_SYMB( ASSIGN_TOP , "assign_top" , "^=<");
+
+ NEW_OP_PREFIX_SYMB( TOP , "top" , "^=>");
+ NEW_OP_PREFIX_SYMB( POP , "pop" , ">=>");
+
+ NEW_OP_PREFIX_SYMB( POP_FROM , "pop_from" , ">?>");
+
+ NEW_FUNCTION( EMPTY , "empty" );
+ NEW_FUNCTION( NONEMPTY , "nonempty" );
+ NEW_FUNCTION( SINGLETON , "singleton" );
+ NEW_FUNCTION( POPULATED , "populated" );
+
+ NEW_FUNCTION( FULL , "full" );
+ NEW_FUNCTION( SIZE , "size" );
+
+ /*
+ ***************************************************************************
+ * IOLTL BEHAVIORAL PREDICAT
+ ***************************************************************************
+ */
+ NEW_OP_PREFIX( GLOBALLY , "globally" );
+ NEW_OP_INFIX ( UNTIL , "until" );
+ NEW_OP_PREFIX( NEXT , "next" );
+
+ NEW_OP_PREFIX_SYMB( EVENTUALLY , "eventually" , "evtly");
+ NEW_OP_PREFIX_SYMB( RELEASES , "releases" , "rels" );
+
+ NEW_OP_PREFIX( OBS , "obs" );
+
+
+ /*
+ ***************************************************************************
+ * IOLTL LOGICAL PREDICAT
+ ***************************************************************************
+ */
+ NEW_OP_INFIX_FULL ( AND_T , "and_t" , "&", "_&_", " /\\");
+ NEW_OP_INFIX_FULL ( OR_T , "or_t" , "|", "_|_", "OR-T");
+
+ NEW_OP_PREFIX_FULL( NOT_T , "not_t" , "!", "!_", "NOT-T");
+
+ NEW_OP_INFIX_FULL ( IMP_T , "imp_t" , "->", "_->_", "IMPLIES-T");
+}
+
+
+/**
+ * DISPOSER
+ */
+void OperatorManager::dispose()
+{
+ theOperatorsMap.clear();
+
+ TABLE_OF_OPERATOR.clear();
+
+ /*
+ ***************************************************************************
+ * AVM NOP STATEMENT
+ ***************************************************************************
+ */
+ OPERATOR_NOP = NULL;
+
+ /*
+ ***************************************************************************
+ * AVM NOP STATEMENT
+ ***************************************************************************
+ */
+ OPERATOR_INFORMAL = NULL;
+
+ OPERATOR_TRACE = NULL;
+ OPERATOR_DEBUG = NULL;
+
+ OPERATOR_COMMENT = NULL;
+ OPERATOR_QUOTE = NULL;
+
+ OPERATOR_META_EVAL = NULL;
+ OPERATOR_META_RUN = NULL;
+
+
+ /*
+ ***************************************************************************
+ * AVM UFI STATEMENT
+ ***************************************************************************
+ */
+ OPERATOR_UFI = NULL;
+
+ /*
+ ***************************************************************************
+ * AVM FORM CONSTRUCTOR STATEMENT
+ ***************************************************************************
+ */
+ OPERATOR_CTOR = NULL;
+
+ /*
+ ***************************************************************************
+ * AVM MACHINE MANAGING
+ ***************************************************************************
+ */
+ OPERATOR_CONTEXT_SWITCHER = NULL;
+
+ OPERATOR_INIT = NULL;
+ OPERATOR_FINAL = NULL;
+ OPERATOR_DESTROY = NULL;
+
+ OPERATOR_START = NULL;
+ OPERATOR_RESTART = NULL;
+ OPERATOR_STOP = NULL;
+
+ OPERATOR_WAIT = NULL;
+
+ OPERATOR_SUSPEND = NULL;
+ OPERATOR_RESUME = NULL;
+
+ OPERATOR_IENABLE_INVOKE = NULL;
+ OPERATOR_ENABLE_INVOKE = NULL;
+ OPERATOR_ENABLE_SET = NULL;
+
+ OPERATOR_IDISABLE_INVOKE = NULL;
+ OPERATOR_DISABLE_INVOKE = NULL;
+ OPERATOR_DISABLE_SET = NULL;
+ OPERATOR_DISABLE_CHILD = NULL;
+ OPERATOR_DISABLE_SELF = NULL;
+ OPERATOR_DISABLE_SELVES = NULL;
+
+ OPERATOR_IABORT_INVOKE = NULL;
+ OPERATOR_ABORT_INVOKE = NULL;
+ OPERATOR_ABORT_SET = NULL;
+ OPERATOR_ABORT_CHILD = NULL;
+ OPERATOR_ABORT_SELF = NULL;
+ OPERATOR_ABORT_SELVES = NULL;
+
+ OPERATOR_HISTORY_CLEAR = NULL;
+ OPERATOR_DEEP_HISTORY_INVOKE = NULL;
+ OPERATOR_SHALLOW_HISTORY_INVOKE = NULL;
+
+ OPERATOR_IRUN = NULL;
+ OPERATOR_RUN = NULL;
+ OPERATOR_RTC = NULL;
+
+ OPERATOR_INVOKE_NEW = NULL;
+
+ OPERATOR_INVOKE_ROUTINE = NULL;
+
+ OPERATOR_INVOKE_TRANSITION = NULL;
+
+ OPERATOR_INVOKE_METHOD = NULL;
+ OPERATOR_INVOKE_PROGRAM = NULL;
+ OPERATOR_INVOKE_FUNCTION = NULL;
+
+ OPERATOR_INVOKE_LAMBDA_APPLY = NULL;
+ OPERATOR_INVOKE_LAMBDA_LET = NULL;
+
+ OPERATOR_GOTO = NULL;
+
+ OPERATOR_SCHEDULE_INVOKE = NULL;
+ OPERATOR_SCHEDULE_GET = NULL;
+ OPERATOR_SCHEDULE_IN = NULL;
+ OPERATOR_SCHEDULE_SET = NULL;
+
+ OPERATOR_DEFER_INVOKE = NULL;
+ OPERATOR_DEFER_GET = NULL;
+ OPERATOR_DEFER_SET = NULL;
+
+ OPERATOR_FORK = NULL;
+ OPERATOR_JOIN = NULL;
+
+ OPERATOR_INPUT_ENABLED = NULL;
+
+ OPERATOR_RDV = NULL;
+
+ OPERATOR_SYNCHRONIZE = NULL;
+
+ /*
+ ***************************************************************************
+ * AVM DATA STATUS
+ ***************************************************************************
+ */
+
+ OPERATOR_STATUS_WAS = NULL;
+ OPERATOR_STATUS_IS = NULL;
+ OPERATOR_STATUS_BEING = NULL;
+ OPERATOR_STATUS_WILL = NULL;
+
+ OPERATOR_CHANGED = NULL;
+ OPERATOR_CHANGED_TO = NULL;
+
+
+ /*
+ ***************************************************************************
+ * AVM PROGRAM SCHEDULING
+ ***************************************************************************
+ */
+ OPERATOR_ASYNCHRONOUS = NULL;
+ OPERATOR_STRONG_SYNCHRONOUS = NULL;
+ OPERATOR_WEAK_SYNCHRONOUS = NULL;
+
+ OPERATOR_INTERLEAVING = NULL;
+ OPERATOR_PARTIAL_ORDER_REDUCTION = NULL;
+
+ OPERATOR_PARALLEL = NULL;
+
+ //// Optimized version of concurrency for RDV synchronization
+ OPERATOR_RDV_ASYNCHRONOUS = NULL;
+ OPERATOR_RDV_STRONG_SYNCHRONOUS = NULL;
+ OPERATOR_RDV_WEAK_SYNCHRONOUS = NULL;
+
+ OPERATOR_RDV_INTERLEAVING = NULL;
+ OPERATOR_RDV_PARTIAL_ORDER_REDUCTION = NULL;
+
+ OPERATOR_RDV_PARALLEL = NULL;
+
+ OPERATOR_EXCLUSIVE = NULL;
+
+ OPERATOR_NONDETERMINISM = NULL;
+
+ OPERATOR_PRIOR_GT = NULL;
+ OPERATOR_PRIOR_LT = NULL;
+
+ OPERATOR_SCHEDULE_AND_THEN = NULL;
+ OPERATOR_SCHEDULE_OR_ELSE = NULL;
+
+ OPERATOR_ATOMIC_SEQUENCE = NULL;
+
+ OPERATOR_SEQUENCE = NULL;
+ OPERATOR_SEQUENCE_SIDE = NULL;
+ OPERATOR_SEQUENCE_WEAK = NULL;
+
+ OPERATOR_PRODUCT = NULL;
+
+ /*
+ ***************************************************************************
+ * AVM BUFFER MANAGING
+ ***************************************************************************
+ */
+ OPERATOR_UPDATE_BUFFER = NULL;
+
+ /*
+ ************************** *************************************************
+ * LAMBDA STATEMENT
+ ***************************************************************************
+ */
+ OPERATOR_APPLY = NULL;
+ OPERATOR_LAMBDA = NULL;
+
+ /*
+ ***************************************************************************
+ * LET STATEMENT
+ ***************************************************************************
+ */
+ OPERATOR_LET = NULL;
+
+ /*
+ ***************************************************************************
+ * LOOKUP STATEMENT
+ ***************************************************************************
+ */
+ OPERATOR_LOOKUP_INT_EXT = NULL;
+ OPERATOR_LOOKUP_INT = NULL;
+ OPERATOR_LOOKUP_NEAREST = NULL;
+ OPERATOR_LOOKUP_BELOW = NULL;
+ OPERATOR_LOOKUP_ABOVE = NULL;
+ OPERATOR_LOOKUP2D_INT_EXT = NULL;
+
+ /*
+ ***************************************************************************
+ * AVM PRIMITIVE STATEMENT
+ ***************************************************************************
+ */
+ OPERATOR_ASSIGN = NULL;
+ OPERATOR_ASSIGN_AFTER = NULL;
+ OPERATOR_ASSIGN_OP = NULL;
+ OPERATOR_ASSIGN_OP_AFTER = NULL;
+ OPERATOR_ASSIGN_REF = NULL;
+ OPERATOR_ASSIGN_MACRO = NULL;
+
+ OPERATOR_ASSIGN_NEWFRESH = NULL;
+ OPERATOR_ASSIGN_RESET = NULL;
+
+ OPERATOR_GUARD = NULL;
+ OPERATOR_TIMED_GUARD = NULL;
+
+ OPERATOR_EVENT = NULL;
+
+ OPERATOR_CHECK_SAT = NULL;
+
+
+ OPERATOR_INPUT = NULL;
+ OPERATOR_INPUT_FROM = NULL;
+
+ OPERATOR_INPUT_SAVE = NULL;
+
+ OPERATOR_INPUT_VAR = NULL;
+ OPERATOR_INPUT_FLOW = NULL;
+
+ OPERATOR_INPUT_ENV = NULL;
+ OPERATOR_INPUT_BUFFER = NULL;
+ OPERATOR_INPUT_RDV = NULL;
+ OPERATOR_INPUT_BROADCAST = NULL;
+ OPERATOR_INPUT_DELEGATE = NULL;
+
+
+ OPERATOR_OUTPUT = NULL;
+ OPERATOR_OUTPUT_TO = NULL;
+
+ OPERATOR_OUTPUT_VAR = NULL;
+ OPERATOR_OUTPUT_FLOW = NULL;
+
+ OPERATOR_OUTPUT_ENV = NULL;
+ OPERATOR_OUTPUT_BUFFER = NULL;
+ OPERATOR_OUTPUT_RDV = NULL;
+ OPERATOR_OUTPUT_BROADCAST = NULL;
+ OPERATOR_OUTPUT_DELEGATE = NULL;
+
+
+ OPERATOR_PRESENT = NULL;
+ OPERATOR_ABSENT = NULL;
+
+
+ OPERATOR_IF = NULL;
+ OPERATOR_IFE = NULL;
+
+ OPERATOR_FOR = NULL;
+ OPERATOR_FOREACH = NULL;
+
+ OPERATOR_WHILE_DO = NULL;
+ OPERATOR_DO_WHILE = NULL;
+
+ OPERATOR_BREAK = NULL;
+ OPERATOR_CONTINUE = NULL;
+ OPERATOR_RETURN = NULL;
+
+ OPERATOR_EXIT = NULL;
+
+ OPERATOR_STEP_MARK = NULL;
+
+
+ /*
+ ***************************************************************************
+ * AVM PREDICAT EXPRESSION
+ ***************************************************************************
+ */
+ OPERATOR_EXIST = NULL;
+ OPERATOR_FORALL = NULL;
+
+ OPERATOR_NOT = NULL;
+
+ OPERATOR_AND = NULL;
+ OPERATOR_AND_THEN = NULL;
+ OPERATOR_NAND = NULL;
+ OPERATOR_XAND = NULL;
+
+ OPERATOR_OR = NULL;
+ OPERATOR_OR_ELSE = NULL;
+ OPERATOR_NOR = NULL;
+ OPERATOR_XOR = NULL;
+ OPERATOR_XNOR = NULL;
+
+
+ /*
+ ***************************************************************************
+ * AVM COMPARISON EXPRESSION
+ ***************************************************************************
+ */
+ OPERATOR_SEQ = NULL;
+ OPERATOR_NSEQ = NULL;
+
+
+ /*
+ ***************************************************************************
+ * AVM COMPARISON EXPRESSION
+ ***************************************************************************
+ */
+ OPERATOR_EQ = NULL;
+ OPERATOR_NEQ = NULL;
+
+ OPERATOR_LT = NULL;
+ OPERATOR_LTE = NULL;
+
+ OPERATOR_GT = NULL;
+ OPERATOR_GTE = NULL;
+
+ /*
+ ***************************************************************************
+ * AVM BITWISE EXPRESSION
+ ***************************************************************************
+ */
+ OPERATOR_BNOT = NULL;
+ OPERATOR_BAND = NULL;
+
+ OPERATOR_BOR = NULL;
+ OPERATOR_BXOR = NULL;
+
+ OPERATOR_LSHIFT = NULL;
+ OPERATOR_RSHIFT = NULL;
+
+
+ /*
+ ***************************************************************************
+ * AVM ARITHMETIC EXPRESSION
+ ***************************************************************************
+ */
+ OPERATOR_PLUS = NULL;
+
+ OPERATOR_MINUS = NULL;
+ OPERATOR_UMINUS = NULL;
+
+ OPERATOR_MULT = NULL;
+
+ OPERATOR_POW = NULL;
+
+ OPERATOR_DIV = NULL;
+
+ OPERATOR_MOD = NULL;
+
+ OPERATOR_MIN = NULL;
+ OPERATOR_MAX = NULL;
+
+
+ /*
+ ***************************************************************************
+ * AVM MATHEMATICAL FUNCTION
+ ***************************************************************************
+ */
+
+ //// RANDOM
+ OPERATOR_RANDOM = NULL;
+
+ //// ROUNDING
+ OPERATOR_ABS = NULL;
+ OPERATOR_CEIL = NULL;
+ OPERATOR_FLOOR = NULL;
+ OPERATOR_ROUND = NULL;
+
+ OPERATOR_TRUNCATE = NULL;
+
+
+ //// EXP - LOG
+ OPERATOR_SQRT = NULL;
+
+ OPERATOR_EXP = NULL;
+ OPERATOR_LN = NULL;
+ OPERATOR_LOG = NULL;
+
+
+ //// TRIGONOMETRIC
+ OPERATOR_SIN = NULL;
+ OPERATOR_COS = NULL;
+ OPERATOR_TAN = NULL;
+
+ OPERATOR_SINH = NULL;
+ OPERATOR_COSH = NULL;
+ OPERATOR_TANH = NULL;
+
+ OPERATOR_ASIN = NULL;
+ OPERATOR_ACOS = NULL;
+ OPERATOR_ATAN = NULL;
+ OPERATOR_ATAN2 = NULL;
+
+ OPERATOR_ASINH = NULL;
+ OPERATOR_ACOSH = NULL;
+ OPERATOR_ATANH = NULL;
+
+ /*
+ ***************************************************************************
+ * AVM STRING // COLLECTION OPERATOR
+ ***************************************************************************
+ */
+ OPERATOR_CONTAINS = NULL;
+
+ OPERATOR_IN = NULL;
+ OPERATOR_NOTIN = NULL;
+
+ OPERATOR_SUBSET = NULL;
+ OPERATOR_SUBSETEQ = NULL;
+
+ OPERATOR_INTERSECT = NULL;
+
+ OPERATOR_STARTS_WITH = NULL;
+ OPERATOR_ENDS_WITH = NULL;
+
+ OPERATOR_CONCAT = NULL;
+ OPERATOR_APPEND = NULL;
+
+ OPERATOR_REMOVE = NULL;
+ OPERATOR_CLEAR = NULL;
+ OPERATOR_RESIZE = NULL;
+ OPERATOR_SELECT = NULL;
+
+ OPERATOR_PUSH = NULL;
+ OPERATOR_ASSIGN_TOP = NULL;
+ OPERATOR_TOP = NULL;
+ OPERATOR_POP = NULL;
+ OPERATOR_POP_FROM = NULL;
+
+ OPERATOR_EMPTY = NULL;
+ OPERATOR_NONEMPTY = NULL;
+
+ OPERATOR_SINGLETON = NULL;
+ OPERATOR_POPULATED = NULL;
+
+ OPERATOR_FULL = NULL;
+
+ OPERATOR_SIZE = NULL;
+
+ /*
+ ***************************************************************************
+ * IOLTL BEHAVIORAL PREDICAT
+ ***************************************************************************
+ */
+ OPERATOR_GLOBALLY = NULL;
+ OPERATOR_UNTIL = NULL;
+ OPERATOR_NEXT = NULL;
+ OPERATOR_EVENTUALLY = NULL;
+ OPERATOR_RELEASES = NULL;
+ OPERATOR_OBS = NULL;
+
+ /*
+ ***************************************************************************
+ * IOLTL LOGICAL PREDICAT
+ ***************************************************************************
+ */
+ OPERATOR_AND_T = NULL;
+ OPERATOR_OR_T = NULL;
+ OPERATOR_NOT_T = NULL;
+ OPERATOR_IMP_T = NULL;
+// */
+}
+
+
+/**
+ * Operator
+ */
+Operator * OperatorManager::newOperator(
+ AVM_OPCODE anAvmOpCode, AVM_OPCODE anOptimizedOpCode,
+ const std::string & aFullyQualifiedNameID, const std::string & aNameID,
+ ALGEBRA_QUALIFIER anAlgebraQualifier, FIX_NOTATION aFixQualifier,
+ const std::string & aStandardSymbol, const std::string & aSyntaxMIXFIX,
+ const std::string & aSymbolQEPCAD)
+{
+ Operator * theNewOperator( new Operator(aFullyQualifiedNameID, aNameID,
+ anAvmOpCode, anOptimizedOpCode, anAlgebraQualifier, aFixQualifier,
+ aStandardSymbol, aSyntaxMIXFIX, aSymbolQEPCAD) );
+
+ registerOp( theNewOperator );
+
+ return( theNewOperator );
+}
+
+
+
+/**
+ * TESTER
+ */
+
+bool OperatorManager::isQuote(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_QUOTE:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+bool OperatorManager::isMeta(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_META_EVAL:
+ case AVM_OPCODE_META_RUN:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+bool OperatorManager::isMetaEval(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_META_EVAL:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+bool OperatorManager::isMetaRun(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_META_RUN:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+bool OperatorManager::isAssignBinary(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_ASSIGN:
+ case AVM_OPCODE_ASSIGN_AFTER:
+ case AVM_OPCODE_ASSIGN_OP_AFTER:
+ case AVM_OPCODE_ASSIGN_REF:
+ case AVM_OPCODE_ASSIGN_MACRO:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+bool OperatorManager::isAssignUnary(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_ASSIGN_NEWFRESH:
+ case AVM_OPCODE_ASSIGN_RESET:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+bool OperatorManager::isUfi(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_UFI:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+bool OperatorManager::isCtor(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_CTOR:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+bool OperatorManager::isUfiOrCtor(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_UFI:
+ case AVM_OPCODE_CTOR:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+bool OperatorManager::isNewfresh(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_ASSIGN_NEWFRESH:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+
+bool OperatorManager::isSequence(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_ATOMIC_SEQUENCE:
+
+ case AVM_OPCODE_SEQUENCE:
+ case AVM_OPCODE_SEQUENCE_SIDE:
+ case AVM_OPCODE_SEQUENCE_WEAK:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+bool OperatorManager::isSchedule(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ /*
+ ***************************************************************************
+ * AVM PROGRAM SCHEDULING
+ ***************************************************************************
+ */
+ case AVM_OPCODE_ATOMIC_SEQUENCE:
+
+ case AVM_OPCODE_SEQUENCE:
+ case AVM_OPCODE_SEQUENCE_SIDE:
+ case AVM_OPCODE_SEQUENCE_WEAK:
+
+ case AVM_OPCODE_INPUT_ENABLED:
+
+ case AVM_OPCODE_ASYNCHRONOUS:
+ case AVM_OPCODE_STRONG_SYNCHRONOUS:
+ case AVM_OPCODE_WEAK_SYNCHRONOUS:
+ case AVM_OPCODE_INTERLEAVING:
+ case AVM_OPCODE_PARALLEL:
+
+ case AVM_OPCODE_EXCLUSIVE:
+ case AVM_OPCODE_NONDETERMINISM:
+
+ case AVM_OPCODE_PRIOR_GT:
+ case AVM_OPCODE_PRIOR_LT:
+
+ case AVM_OPCODE_SCHEDULE_AND_THEN:
+ case AVM_OPCODE_SCHEDULE_OR_ELSE:
+
+ case AVM_OPCODE_FORK:
+
+ case AVM_OPCODE_PRODUCT:
+
+ case AVM_OPCODE_CONTEXT_SWITCHER:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+bool OperatorManager::isMachine(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ /*
+ ***************************************************************************
+ * AVM MACHINE ACTIVITY
+ ***************************************************************************
+ */
+ case AVM_OPCODE_SCHEDULE_GET:
+
+ case AVM_OPCODE_INVOKE_NEW:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+bool OperatorManager::isActivity(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ /*
+ ***************************************************************************
+ * AVM PROGRAM ACTIVITY
+ ***************************************************************************
+ */
+ case AVM_OPCODE_INIT:
+ case AVM_OPCODE_FINAL:
+ case AVM_OPCODE_DESTROY:
+
+ case AVM_OPCODE_START:
+ case AVM_OPCODE_RESTART:
+ case AVM_OPCODE_STOP:
+
+ case AVM_OPCODE_WAIT:
+
+ case AVM_OPCODE_SUSPEND:
+ case AVM_OPCODE_RESUME:
+
+ case AVM_OPCODE_IENABLE_INVOKE:
+ case AVM_OPCODE_ENABLE_INVOKE:
+ case AVM_OPCODE_ENABLE_SET:
+
+ case AVM_OPCODE_IDISABLE_INVOKE:
+ case AVM_OPCODE_DISABLE_INVOKE:
+ case AVM_OPCODE_DISABLE_SET:
+
+ case AVM_OPCODE_DISABLE_CHILD:
+ case AVM_OPCODE_DISABLE_SELF:
+ case AVM_OPCODE_DISABLE_SELVES:
+
+ case AVM_OPCODE_IABORT_INVOKE:
+ case AVM_OPCODE_ABORT_INVOKE:
+ case AVM_OPCODE_ABORT_SET:
+
+ case AVM_OPCODE_ABORT_CHILD:
+ case AVM_OPCODE_ABORT_SELF:
+ case AVM_OPCODE_ABORT_SELVES:
+
+ case AVM_OPCODE_IRUN:
+ case AVM_OPCODE_RUN:
+
+ case AVM_OPCODE_RTC:
+
+ case AVM_OPCODE_SCHEDULE_INVOKE:
+
+ case AVM_OPCODE_DEFER_INVOKE:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+bool OperatorManager::isCommunication(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ /*
+ ***************************************************************************
+ * AVM PROGRAM COMMUNICATION
+ ***************************************************************************
+ */
+ case AVM_OPCODE_INPUT:
+ case AVM_OPCODE_INPUT_FROM:
+
+ case AVM_OPCODE_INPUT_SAVE:
+
+ case AVM_OPCODE_OUTPUT:
+ case AVM_OPCODE_OUTPUT_TO:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+bool OperatorManager::isArithmetic(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ /*
+ ***********************************************************************
+ * AVM ARITHMETIC EXPRESSION
+ ***********************************************************************
+ */
+
+ case AVM_OPCODE_PLUS:
+ case AVM_OPCODE_MINUS:
+ case AVM_OPCODE_UMINUS:
+
+ case AVM_OPCODE_MULT:
+ case AVM_OPCODE_POW:
+
+ case AVM_OPCODE_DIV:
+ case AVM_OPCODE_MOD:
+
+ case AVM_OPCODE_BNOT:
+ case AVM_OPCODE_BAND:
+ case AVM_OPCODE_BOR:
+ case AVM_OPCODE_BXOR:
+ case AVM_OPCODE_LSHIFT:
+ case AVM_OPCODE_RSHIFT:
+
+ case AVM_OPCODE_RANDOM:
+
+ case AVM_OPCODE_ABS:
+ case AVM_OPCODE_CEIL:
+ case AVM_OPCODE_FLOOR:
+ case AVM_OPCODE_ROUND:
+ case AVM_OPCODE_TRUNCATE:
+
+ case AVM_OPCODE_SQRT:
+ case AVM_OPCODE_EXP:
+ case AVM_OPCODE_LN:
+ case AVM_OPCODE_LOG:
+
+ case AVM_OPCODE_SIN:
+ case AVM_OPCODE_COS:
+ case AVM_OPCODE_TAN:
+
+ case AVM_OPCODE_SINH:
+ case AVM_OPCODE_COSH:
+ case AVM_OPCODE_TANH:
+
+ case AVM_OPCODE_ASIN:
+ case AVM_OPCODE_ACOS:
+ case AVM_OPCODE_ATAN:
+ case AVM_OPCODE_ATAN2:
+
+ case AVM_OPCODE_ASINH:
+ case AVM_OPCODE_ACOSH:
+ case AVM_OPCODE_ATANH:
+
+ case AVM_OPCODE_MAX:
+ case AVM_OPCODE_MIN:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+bool OperatorManager::isBoolean(const Operator * anOperator)
+{
+ return( isRelational(anOperator) || isPropositional(anOperator) );
+}
+
+
+bool OperatorManager::isRelational(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ /*
+ ***********************************************************************
+ * AVM RELATIONAL EXPRESSION
+ ***********************************************************************
+ */
+
+ case AVM_OPCODE_EQ:
+ case AVM_OPCODE_NEQ:
+
+ case AVM_OPCODE_SEQ:
+ case AVM_OPCODE_NSEQ:
+
+ case AVM_OPCODE_LT:
+ case AVM_OPCODE_LTE:
+ case AVM_OPCODE_GT:
+ case AVM_OPCODE_GTE:
+
+ case AVM_OPCODE_EMPTY:
+ case AVM_OPCODE_NONEMPTY:
+ case AVM_OPCODE_SINGLETON:
+ case AVM_OPCODE_POPULATED:
+ case AVM_OPCODE_FULL:
+
+ case AVM_OPCODE_IN:
+ case AVM_OPCODE_NOTIN:
+ case AVM_OPCODE_CONTAINS:
+
+ case AVM_OPCODE_SUBSET:
+ case AVM_OPCODE_SUBSETEQ:
+
+ case AVM_OPCODE_INTERSECT:
+
+ case AVM_OPCODE_STARTS_WITH:
+ case AVM_OPCODE_ENDS_WITH:
+
+
+ case AVM_OPCODE_PRESENT:
+ case AVM_OPCODE_ABSENT:
+
+
+ case AVM_OPCODE_SCHEDULE_IN:
+
+ case AVM_OPCODE_STATUS_BEING:
+ case AVM_OPCODE_STATUS_IS:
+ case AVM_OPCODE_STATUS_WAS:
+ case AVM_OPCODE_STATUS_WILL:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+bool OperatorManager::isPropositional(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ /*
+ ***********************************************************************
+ * AVM PROPOSITIONAL EXPRESSION
+ ***********************************************************************
+ */
+ case AVM_OPCODE_EXIST:
+ case AVM_OPCODE_FORALL:
+
+ case AVM_OPCODE_NOT:
+
+ case AVM_OPCODE_AND:
+ case AVM_OPCODE_NAND:
+
+ case AVM_OPCODE_XAND:
+
+ case AVM_OPCODE_OR:
+ case AVM_OPCODE_NOR:
+
+ case AVM_OPCODE_XOR:
+ case AVM_OPCODE_XNOR:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+
+
+bool OperatorManager::isTemporalLogic(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ /*
+ ***********************************************************************
+ * IOLTL STATEMENT
+ ***********************************************************************
+ */
+ case AVM_OPCODE_GLOBALLY:
+ case AVM_OPCODE_UNTIL:
+ case AVM_OPCODE_NEXT:
+ case AVM_OPCODE_EVENTUALLY:
+ case AVM_OPCODE_RELEASES:
+ case AVM_OPCODE_OBS:
+
+ case AVM_OPCODE_AND_T:
+ case AVM_OPCODE_OR_T:
+ case AVM_OPCODE_NOT_T:
+ case AVM_OPCODE_IMP_T:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+
+bool OperatorManager::isConditionnal(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_IF:
+ case AVM_OPCODE_IFE:
+
+ case AVM_OPCODE_AND_THEN:
+ case AVM_OPCODE_OR_ELSE:
+
+ case AVM_OPCODE_FOR:
+ case AVM_OPCODE_FOREACH:
+ case AVM_OPCODE_WHILE_DO:
+ case AVM_OPCODE_DO_WHILE:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+
+bool OperatorManager::isStatement(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ /*
+ ***********************************************************************
+ * AVM NOP STATEMENT
+ ***********************************************************************
+ */
+ case AVM_OPCODE_NOP:
+
+
+ /*
+ ***********************************************************************
+ * AVM MACHINE ACTIVITY
+ ***********************************************************************
+ */
+ case AVM_OPCODE_INIT:
+ case AVM_OPCODE_FINAL:
+ case AVM_OPCODE_DESTROY:
+
+ case AVM_OPCODE_START:
+ case AVM_OPCODE_RESTART:
+ case AVM_OPCODE_STOP:
+
+ case AVM_OPCODE_WAIT:
+
+ case AVM_OPCODE_SUSPEND:
+ case AVM_OPCODE_RESUME:
+
+ case AVM_OPCODE_IENABLE_INVOKE:
+ case AVM_OPCODE_ENABLE_INVOKE:
+ case AVM_OPCODE_ENABLE_SET:
+
+ case AVM_OPCODE_IDISABLE_INVOKE:
+ case AVM_OPCODE_DISABLE_INVOKE:
+ case AVM_OPCODE_DISABLE_SET:
+
+ case AVM_OPCODE_DISABLE_CHILD:
+ case AVM_OPCODE_DISABLE_SELF:
+ case AVM_OPCODE_DISABLE_SELVES:
+
+ case AVM_OPCODE_IABORT_INVOKE:
+ case AVM_OPCODE_ABORT_INVOKE:
+ case AVM_OPCODE_ABORT_SET:
+
+ case AVM_OPCODE_ABORT_CHILD:
+ case AVM_OPCODE_ABORT_SELF:
+ case AVM_OPCODE_ABORT_SELVES:
+
+ case AVM_OPCODE_HISTORY_CLEAR:
+ case AVM_OPCODE_DEEP_HISTORY_INVOKE:
+ case AVM_OPCODE_SHALLOW_HISTORY_INVOKE:
+
+ case AVM_OPCODE_IRUN:
+ case AVM_OPCODE_RUN:
+
+ case AVM_OPCODE_RTC:
+
+ case AVM_OPCODE_SCHEDULE_INVOKE:
+ case AVM_OPCODE_SCHEDULE_GET:
+ case AVM_OPCODE_SCHEDULE_SET:
+
+ case AVM_OPCODE_DEFER_INVOKE:
+ case AVM_OPCODE_DEFER_GET:
+ case AVM_OPCODE_DEFER_SET:
+
+ case AVM_OPCODE_FORK:
+
+ case AVM_OPCODE_JOIN:
+
+ case AVM_OPCODE_RDV:
+
+ case AVM_OPCODE_INPUT_ENABLED:
+
+ case AVM_OPCODE_SYNCHRONIZE:
+
+
+ case AVM_OPCODE_INVOKE_NEW:
+
+
+ /*
+ ***********************************************************************
+ * AVM MACHINE STATUS
+ ***********************************************************************
+ */
+ case AVM_OPCODE_STATUS_BEING:
+ case AVM_OPCODE_STATUS_IS:
+ case AVM_OPCODE_STATUS_WAS:
+ case AVM_OPCODE_STATUS_WILL:
+
+
+ /*
+ ***********************************************************************
+ * AVM PROGRAM SCHEDULING
+ ***********************************************************************
+ */
+ case AVM_OPCODE_ASYNCHRONOUS:
+ case AVM_OPCODE_STRONG_SYNCHRONOUS:
+ case AVM_OPCODE_WEAK_SYNCHRONOUS:
+ case AVM_OPCODE_INTERLEAVING:
+ case AVM_OPCODE_PARALLEL:
+
+ case AVM_OPCODE_EXCLUSIVE:
+
+ case AVM_OPCODE_NONDETERMINISM:
+
+
+ case AVM_OPCODE_PRIOR_GT:
+ case AVM_OPCODE_PRIOR_LT:
+
+ case AVM_OPCODE_ATOMIC_SEQUENCE:
+
+ case AVM_OPCODE_SEQUENCE:
+ case AVM_OPCODE_SEQUENCE_SIDE:
+ case AVM_OPCODE_SEQUENCE_WEAK:
+
+
+ case AVM_OPCODE_PRODUCT:
+
+
+ /*
+ ***********************************************************************
+ * AVM BUFFER MANAGING
+ ***********************************************************************
+ */
+ case AVM_OPCODE_UPDATE_BUFFER:
+
+
+ /*
+ ***********************************************************************
+ * LAMBDA STATEMENT
+ ***********************************************************************
+ */
+ case AVM_OPCODE_APPLY:
+
+ case AVM_OPCODE_LAMBDA:
+
+ case AVM_OPCODE_INVOKE_ROUTINE:
+
+ case AVM_OPCODE_INVOKE_TRANSITION:
+
+ case AVM_OPCODE_INVOKE_METHOD:
+ case AVM_OPCODE_INVOKE_PROGRAM:
+ case AVM_OPCODE_INVOKE_FUNCTION:
+
+ case AVM_OPCODE_INVOKE_LAMBDA_APPLY:
+ case AVM_OPCODE_INVOKE_LAMBDA_LET:
+
+
+ /*
+ ***********************************************************************
+ * LET STATEMENT
+ ***********************************************************************
+ */
+ case AVM_OPCODE_LET:
+
+
+ /*
+ ***********************************************************************
+ * AVM PRIMITIVE STATEMENT
+ ***********************************************************************
+ */
+ case AVM_OPCODE_ASSIGN:
+ case AVM_OPCODE_ASSIGN_AFTER:
+ case AVM_OPCODE_ASSIGN_OP_AFTER:
+ case AVM_OPCODE_ASSIGN_REF:
+ case AVM_OPCODE_ASSIGN_MACRO:
+
+ case AVM_OPCODE_ASSIGN_NEWFRESH:
+ case AVM_OPCODE_ASSIGN_RESET:
+
+ case AVM_OPCODE_GUARD:
+
+ case AVM_OPCODE_CHECK_SAT:
+
+ case AVM_OPCODE_INPUT:
+ case AVM_OPCODE_INPUT_FROM:
+
+ case AVM_OPCODE_INPUT_SAVE:
+
+ case AVM_OPCODE_OUTPUT:
+ case AVM_OPCODE_OUTPUT_TO:
+
+ case AVM_OPCODE_PRESENT:
+ case AVM_OPCODE_ABSENT:
+
+ case AVM_OPCODE_IF:
+ case AVM_OPCODE_IFE:
+
+ case AVM_OPCODE_FOR:
+ case AVM_OPCODE_FOREACH:
+ case AVM_OPCODE_WHILE_DO:
+ case AVM_OPCODE_DO_WHILE:
+
+ case AVM_OPCODE_BREAK:
+ case AVM_OPCODE_CONTINUE:
+ case AVM_OPCODE_RETURN:
+ case AVM_OPCODE_EXIT:
+
+ case AVM_OPCODE_STEP_MARK:
+
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+bool OperatorManager::isAtomicStatement(const Operator * anOperator)
+{
+ switch( anOperator->getOptimizedOpCode() )
+ {
+ case AVM_OPCODE_NOP:
+ case AVM_OPCODE_COMMENT:
+ case AVM_OPCODE_INFORMAL:
+ case AVM_OPCODE_QUOTE:
+ case AVM_OPCODE_TRACE:
+
+ case AVM_OPCODE_ASSIGN:
+ case AVM_OPCODE_ASSIGN_AFTER:
+ case AVM_OPCODE_ASSIGN_OP_AFTER:
+ case AVM_OPCODE_ASSIGN_REF:
+ case AVM_OPCODE_ASSIGN_MACRO:
+
+ case AVM_OPCODE_ASSIGN_NEWFRESH:
+
+ case AVM_OPCODE_ASSIGN_RESET:
+
+ case AVM_OPCODE_GUARD:
+ case AVM_OPCODE_TIMED_GUARD:
+
+ case AVM_OPCODE_EVENT:
+
+ case AVM_OPCODE_CHECK_SAT:
+
+
+ case AVM_OPCODE_IENABLE_INVOKE:
+ case AVM_OPCODE_ENABLE_INVOKE:
+ case AVM_OPCODE_ENABLE_SET:
+
+ case AVM_OPCODE_IDISABLE_INVOKE:
+ case AVM_OPCODE_DISABLE_INVOKE:
+ case AVM_OPCODE_DISABLE_SET:
+ case AVM_OPCODE_DISABLE_CHILD:
+ case AVM_OPCODE_DISABLE_SELF:
+ case AVM_OPCODE_DISABLE_SELVES:
+
+ case AVM_OPCODE_IABORT_INVOKE:
+ case AVM_OPCODE_ABORT_INVOKE:
+ case AVM_OPCODE_ABORT_SET:
+ case AVM_OPCODE_ABORT_CHILD:
+ case AVM_OPCODE_ABORT_SELF:
+ case AVM_OPCODE_ABORT_SELVES:
+
+
+ case AVM_OPCODE_INPUT_ENV:
+ case AVM_OPCODE_INPUT_VAR:
+ case AVM_OPCODE_INPUT_FLOW:
+ case AVM_OPCODE_INPUT_BUFFER:
+ case AVM_OPCODE_INPUT_BROADCAST:
+
+ case AVM_OPCODE_OUTPUT_ENV:
+ case AVM_OPCODE_OUTPUT_VAR:
+ case AVM_OPCODE_OUTPUT_FLOW:
+ case AVM_OPCODE_OUTPUT_BUFFER:
+ case AVM_OPCODE_OUTPUT_BROADCAST:
+
+
+ case AVM_OPCODE_PRESENT:
+ case AVM_OPCODE_ABSENT:
+
+
+ case AVM_OPCODE_CONCAT:
+
+ case AVM_OPCODE_REMOVE:
+ case AVM_OPCODE_CLEAR:
+
+ case AVM_OPCODE_RESIZE:
+
+ case AVM_OPCODE_SELECT:
+
+ case AVM_OPCODE_PUSH:
+ case AVM_OPCODE_POP:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+
+bool OperatorManager::isCharacter(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+// case AVM_OPCODE_UNICODE:
+// {
+// return( true );
+// }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+bool OperatorManager::isString(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_CONCAT:
+ case AVM_OPCODE_PLUS:
+ case AVM_OPCODE_REMOVE:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+bool OperatorManager::isLookup(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ /*
+ ***********************************************************************
+ * AVM LOOKUP EXPRESSION
+ ***********************************************************************
+ */
+
+ case AVM_OPCODE_LOOKUP_INT_EXT:
+ case AVM_OPCODE_LOOKUP_INT:
+ case AVM_OPCODE_LOOKUP_NEAREST:
+ case AVM_OPCODE_LOOKUP_BELOW:
+ case AVM_OPCODE_LOOKUP_ABOVE:
+ case AVM_OPCODE_LOOKUP2D_INT_EXT:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+bool OperatorManager::isLookup1D(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ /*
+ ***********************************************************************
+ * AVM LOOKUP1D EXPRESSION
+ ***********************************************************************
+ */
+
+ case AVM_OPCODE_LOOKUP_INT_EXT:
+ case AVM_OPCODE_LOOKUP_INT:
+ case AVM_OPCODE_LOOKUP_NEAREST:
+ case AVM_OPCODE_LOOKUP_BELOW:
+ case AVM_OPCODE_LOOKUP_ABOVE:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+bool OperatorManager::isLookup2D(const Operator * anOperator)
+{
+ if( anOperator->isOpCode( AVM_OPCODE_LOOKUP2D_INT_EXT ) )
+ {
+ return( true );
+ }
+ else
+ {
+ return( false );
+ }
+}
+
+
+bool OperatorManager::isContainerElementAccess(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_TOP:
+ case AVM_OPCODE_POP:
+ case AVM_OPCODE_POP_FROM:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+bool OperatorManager::isContainerOperation(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_APPEND:
+ case AVM_OPCODE_REMOVE:
+ case AVM_OPCODE_CLEAR:
+ case AVM_OPCODE_RESIZE:
+
+ case AVM_OPCODE_SELECT:
+
+ case AVM_OPCODE_INTERSECT:
+ case AVM_OPCODE_CONCAT
+ :
+ case AVM_OPCODE_PUSH:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+/**
+ * Codomain of function
+ */
+bool OperatorManager::isCodomainBoolean(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+bool OperatorManager::isCodomainCharacter(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+bool OperatorManager::isCodomainString(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+bool OperatorManager::isCodomainInteger(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_SIZE:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+bool OperatorManager::isCodomainRational(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_SIZE:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( isCodomainInteger(anOperator) );
+ }
+ }
+}
+
+bool OperatorManager::isCodomainFloat(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_SIZE:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( isCodomainRational(anOperator) );
+ }
+ }
+}
+
+bool OperatorManager::isCodomainReal(const Operator * anOperator)
+{
+ switch( anOperator->getAvmOpCode() )
+ {
+ case AVM_OPCODE_SIZE:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( isCodomainFloat(anOperator) );
+ }
+ }
+}
+
+
+
+/**
+ * REGISTRATION
+ */
+void OperatorManager::registerOp(Operator * anOperator)
+{
+ if( isalpha( *(anOperator->getNameID().begin()) ) )
+ {
+ theOperatorsMap[ anOperator->getNameID() ] = anOperator;
+ }
+
+ anOperator->setOffset( TABLE_OF_OPERATOR.size() );
+
+ TABLE_OF_OPERATOR.push_back( BF(anOperator) );
+}
+
+
+Operator * OperatorManager::getOp(const std::string & strOperator)
+{
+ return( theOperatorsMap[ strOperator ] );
+}
+
+
+Operator * OperatorManager::toOperator(
+ const std::string & op, Operator * defaultOp)
+{
+ if( op == "NOT" ) return( OperatorManager::OPERATOR_NOT );
+ if( op == "AND" ) return( OperatorManager::OPERATOR_AND );
+ if( op == "OR" ) return( OperatorManager::OPERATOR_OR );
+ if( op == "XOR" ) return( OperatorManager::OPERATOR_XOR );
+
+ if( op == "|;|" ) return( OperatorManager::OPERATOR_SEQUENCE );
+ if( op == "|;;|" ) return( OperatorManager::OPERATOR_SEQUENCE_WEAK );
+ if( op == "|i|" ) return( OperatorManager::OPERATOR_INTERLEAVING );
+
+ return( defaultOp );
+}
+
+
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/operator/OperatorManager.h b/org.eclipse.efm.symbex/src/fml/operator/OperatorManager.h
new file mode 100644
index 0000000..4fe8f95
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/operator/OperatorManager.h
@@ -0,0 +1,782 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 15 août 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef OPERATORMANAGER_H_
+#define OPERATORMANAGER_H_
+
+#include <map>
+
+#include <collection/BFContainer.h>
+
+#include <fml/operator/Operator.h>
+#include <fml/operator/OperatorLib.h>
+
+
+namespace sep
+{
+
+
+class OperatorManager
+{
+
+public:
+
+ /**
+ * LOADER - DISPOSER
+ */
+ static void load();
+ static void dispose();
+
+
+ static Operator * newOperator(
+ AVM_OPCODE anAvmOpCode, AVM_OPCODE anOptimizedOpCode,
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID,
+ ALGEBRA_QUALIFIER anAlgebraQualifier,
+ FIX_NOTATION aFixQualifier,
+ const std::string & aStandardSymbol,
+ const std::string & aSyntaxMIXFIX,
+ const std::string & aSymbolQEPCAD);
+
+
+ static inline Operator * newOperatorAssocCom(AVM_OPCODE anAvmOpCode,
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID,
+ const std::string & aStandardSymbol,
+ const std::string & aSyntaxMIXFIX,
+ const std::string & aSymbolQEPCAD)
+ {
+ return( newOperator(anAvmOpCode, anAvmOpCode,
+ aFullyQualifiedNameID, aNameID,
+ ALGEBRA_ASSOC_COMM, NOTATION_INFIX,
+ aStandardSymbol, aSyntaxMIXFIX, aSymbolQEPCAD) );
+ }
+
+ static inline Operator * newOperatorAssocCom(AVM_OPCODE anAvmOpCode,
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID,
+ const std::string & aStandardSymbol)
+ {
+ return( newOperator(anAvmOpCode, anAvmOpCode,
+ aFullyQualifiedNameID, aNameID,
+ ALGEBRA_ASSOC_COMM, NOTATION_INFIX,
+ aStandardSymbol, "_" + aStandardSymbol + "_", aStandardSymbol) );
+ }
+
+ static inline Operator * newOperatorAssocCom(
+ AVM_OPCODE anAvmOpCode, AVM_OPCODE anOptimizedOpCode,
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID,
+ const std::string & aStandardSymbol)
+ {
+ return( newOperator(anAvmOpCode, anOptimizedOpCode,
+ aFullyQualifiedNameID, aNameID,
+ ALGEBRA_ASSOC_COMM, NOTATION_INFIX,
+ aStandardSymbol, "_" + aStandardSymbol + "_", aStandardSymbol) );
+ }
+
+
+ static inline Operator * newOperatorAssoc(AVM_OPCODE anAvmOpCode,
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID,
+ const std::string & aStandardSymbol)
+ {
+ return( newOperator(anAvmOpCode, anAvmOpCode,
+ aFullyQualifiedNameID, aNameID,
+ ALGEBRA_ASSOC, NOTATION_INFIX,
+ aStandardSymbol, "_" + aStandardSymbol + "_", aStandardSymbol) );
+ }
+
+ static inline Operator * newOperatorLeftAssoc(AVM_OPCODE anAvmOpCode,
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID,
+ const std::string & aStandardSymbol)
+ {
+ return( newOperator(anAvmOpCode, anAvmOpCode,
+ aFullyQualifiedNameID, aNameID,
+ ALGEBRA_LEFT_ASSOC, NOTATION_INFIX,
+ aStandardSymbol, "_" + aStandardSymbol + "_", aStandardSymbol) );
+ }
+
+ static inline Operator * newOperatorRightAssoc(AVM_OPCODE anAvmOpCode,
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID,
+ const std::string & aStandardSymbol)
+ {
+ return( newOperator(anAvmOpCode, anAvmOpCode,
+ aFullyQualifiedNameID, aNameID,
+ ALGEBRA_RIGHT_ASSOC, NOTATION_INFIX,
+ aStandardSymbol, "_" + aStandardSymbol + "_", aStandardSymbol) );
+ }
+
+
+ static inline Operator * newOperatorStdInfix(AVM_OPCODE anAvmOpCode,
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID,
+ const std::string & aStandardSymbol,
+ const std::string & aSyntaxMIXFIX,
+ const std::string & aSymbolQEPCAD)
+ {
+ return( newOperator(anAvmOpCode, anAvmOpCode,
+ aFullyQualifiedNameID, aNameID,
+ ALGEBRA_STD, NOTATION_INFIX,
+ aStandardSymbol, aSyntaxMIXFIX, aSymbolQEPCAD) );
+ }
+
+ static inline Operator * newOperatorStdInfix(AVM_OPCODE anAvmOpCode,
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID,
+ const std::string & aStandardSymbol)
+ {
+ return( newOperator(anAvmOpCode, anAvmOpCode,
+ aFullyQualifiedNameID, aNameID,
+ ALGEBRA_STD, NOTATION_INFIX,
+ aStandardSymbol, "_" + aStandardSymbol + "_", aStandardSymbol) );
+ }
+
+
+ static inline Operator * newOperatorStdPrefix(AVM_OPCODE anAvmOpCode,
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID,
+ const std::string & aStandardSymbol,
+ const std::string & aSyntaxMIXFIX,
+ const std::string & aSymbolQEPCAD)
+ {
+ return( newOperator(anAvmOpCode, anAvmOpCode,
+ aFullyQualifiedNameID, aNameID,
+ ALGEBRA_STD, NOTATION_PREFIX,
+ aStandardSymbol, aSyntaxMIXFIX, aSymbolQEPCAD) );
+ }
+
+ static inline Operator * newOperatorStdPrefix(AVM_OPCODE anAvmOpCode,
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID, const std::string & aStandardSymbol)
+ {
+ return( newOperator(anAvmOpCode, anAvmOpCode,
+ aFullyQualifiedNameID, aNameID,
+ ALGEBRA_STD, NOTATION_PREFIX,
+ aStandardSymbol, aStandardSymbol + "_", aStandardSymbol) );
+ }
+
+
+ static inline Operator * newOpStatement(
+ AVM_OPCODE anAvmOpCode, AVM_OPCODE anOptimizedOpCode,
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID)
+ {
+ return( newOperator(anAvmOpCode, anOptimizedOpCode,
+ aFullyQualifiedNameID, aNameID,
+ ALGEBRA_STD, NOTATION_STATEMENT,
+ aNameID, aNameID, aNameID) );
+ }
+
+
+ /**
+ * TESTER
+ */
+ static bool isQuote(const Operator * anOperator);
+
+ static bool isMeta(const Operator * anOperator);
+ static bool isMetaEval(const Operator * anOperator);
+ static bool isMetaRun(const Operator * anOperator);
+
+
+ static inline bool isAssign(const Operator * anOperator)
+ {
+ return( isAssignBinary(anOperator) || isAssignUnary(anOperator) );
+ }
+
+ static bool isAssignBinary(const Operator * anOperator);
+ static bool isAssignUnary(const Operator * anOperator);
+
+
+ static bool isUfi(const Operator * anOperator);
+ static bool isCtor(const Operator * anOperator);
+
+ static bool isUfiOrCtor(const Operator * anOperator);
+
+ static bool isNewfresh(const Operator * anOperator);
+
+ static bool isSequence(const Operator * anOperator);
+
+ static bool isSchedule(const Operator * anOperator);
+
+ static bool isMachine(const Operator * anOperator);
+
+ static bool isActivity(const Operator * anOperator);
+
+ static bool isCommunication(const Operator * anOperator);
+
+ static bool isConditionnal(const Operator * anOperator);
+
+ static bool isStatement(const Operator * anOperator);
+
+ static bool isAtomicStatement(const Operator * anOperator);
+
+
+ static bool isArithmetic(const Operator * anOperator);
+
+ static bool isBoolean(const Operator * anOperator);
+ static bool isRelational(const Operator * anOperator);
+ static bool isPropositional(const Operator * anOperator);
+
+ static bool isTemporalLogic(const Operator * anOperator);
+
+
+ static bool isCharacter(const Operator * anOperator);
+ static bool isString(const Operator * anOperator);
+
+ static bool isLookup(const Operator * anOperator);
+ static bool isLookup1D(const Operator * anOperator);
+ static bool isLookup2D(const Operator * anOperator);
+
+ static bool isContainerElementAccess(const Operator * anOperator);
+
+ static bool isContainerOperation(const Operator * anOperator);
+
+
+ /**
+ * Codomain of function
+ */
+ static bool isCodomainBoolean(const Operator * anOperator);
+
+ static bool isCodomainCharacter(const Operator * anOperator);
+
+ static bool isCodomainString(const Operator * anOperator);
+
+ static bool isCodomainInteger(const Operator * anOperator);
+
+ static bool isCodomainRational(const Operator * anOperator);
+
+ static bool isCodomainFloat(const Operator * anOperator);
+
+ static bool isCodomainReal(const Operator * anOperator);
+
+
+
+ /**
+ * REGISTRATION
+ */
+ static void registerOp(Operator * anOperator);
+ static Operator * getOp(const std::string & strOperator);
+
+ static Operator * toOperator(const std::string & op, Operator * defaultOp);
+
+ /**
+ * ATTRIBUTES
+ */
+ static std::map< std::string , Operator * > theOperatorsMap;
+
+ static BFVector TABLE_OF_OPERATOR;
+
+
+#define CONST_BF_OP(op) \
+ sep::OperatorManager::TABLE_OF_OPERATOR[ op->getOffset() ]
+
+#define CONST_BF_OPERATOR(op) \
+ sep::OperatorManager::TABLE_OF_OPERATOR[ \
+ sep::OperatorManager::OPERATOR_##op->getOffset() ]
+
+
+
+
+ /*
+ ***************************************************************************
+ * AVM NOP STATEMENT
+ ***************************************************************************
+ */
+ static Operator * OPERATOR_NOP;
+
+
+ /*
+ ***************************************************************************
+ * AVM META STATEMENT
+ ***************************************************************************
+ */
+ static Operator * OPERATOR_INFORMAL;
+
+ static Operator * OPERATOR_TRACE;
+
+ static Operator * OPERATOR_DEBUG;
+
+ static Operator * OPERATOR_COMMENT;
+
+ static Operator * OPERATOR_QUOTE;
+
+ static Operator * OPERATOR_META_EVAL;
+ static Operator * OPERATOR_META_RUN;
+
+ /*
+ ***************************************************************************
+ * AVM UFI STATEMENT
+ ***************************************************************************
+ */
+ static Operator * OPERATOR_UFI;
+
+
+ /*
+ ***************************************************************************
+ * AVM FORM CONSTRUCTOR STATEMENT
+ ***************************************************************************
+ */
+ static Operator * OPERATOR_CTOR;
+
+
+ /*
+ ***************************************************************************
+ * AVM MACHINE MANAGING
+ ***************************************************************************
+ */
+ static Operator * OPERATOR_CONTEXT_SWITCHER;
+
+ static Operator * OPERATOR_INIT;
+ static Operator * OPERATOR_FINAL;
+ static Operator * OPERATOR_DESTROY;
+
+ static Operator * OPERATOR_START;
+ static Operator * OPERATOR_RESTART;
+ static Operator * OPERATOR_STOP;
+
+ static Operator * OPERATOR_WAIT;
+
+ static Operator * OPERATOR_SUSPEND;
+ static Operator * OPERATOR_RESUME;
+
+
+ static Operator * OPERATOR_IENABLE_INVOKE;
+ static Operator * OPERATOR_ENABLE_INVOKE;
+ static Operator * OPERATOR_ENABLE_SET;
+
+ static Operator * OPERATOR_IDISABLE_INVOKE;
+ static Operator * OPERATOR_DISABLE_INVOKE;
+ static Operator * OPERATOR_DISABLE_SET;
+ static Operator * OPERATOR_DISABLE_CHILD;
+ static Operator * OPERATOR_DISABLE_SELF;
+ static Operator * OPERATOR_DISABLE_SELVES;
+
+ static Operator * OPERATOR_IABORT_INVOKE;
+ static Operator * OPERATOR_ABORT_INVOKE;
+ static Operator * OPERATOR_ABORT_SET;
+ static Operator * OPERATOR_ABORT_CHILD;
+ static Operator * OPERATOR_ABORT_SELF;
+ static Operator * OPERATOR_ABORT_SELVES;
+
+ static Operator * OPERATOR_HISTORY_CLEAR;
+ static Operator * OPERATOR_DEEP_HISTORY_INVOKE;
+ static Operator * OPERATOR_SHALLOW_HISTORY_INVOKE;
+
+ static Operator * OPERATOR_IRUN;
+ static Operator * OPERATOR_RUN;
+ static Operator * OPERATOR_RTC;
+
+ static Operator * OPERATOR_INVOKE_NEW;
+
+ static Operator * OPERATOR_INVOKE_ROUTINE;
+
+ static Operator * OPERATOR_INVOKE_TRANSITION;
+
+ static Operator * OPERATOR_INVOKE_METHOD;
+ static Operator * OPERATOR_INVOKE_PROGRAM;
+ static Operator * OPERATOR_INVOKE_FUNCTION;
+
+ static Operator * OPERATOR_INVOKE_LAMBDA_APPLY;
+ static Operator * OPERATOR_INVOKE_LAMBDA_LET;
+
+ static Operator * OPERATOR_GOTO;
+
+ static Operator * OPERATOR_SCHEDULE_INVOKE;
+ static Operator * OPERATOR_SCHEDULE_GET;
+ static Operator * OPERATOR_SCHEDULE_IN;
+ static Operator * OPERATOR_SCHEDULE_SET;
+
+ static Operator * OPERATOR_DEFER_INVOKE;
+ static Operator * OPERATOR_DEFER_GET;
+ static Operator * OPERATOR_DEFER_SET;
+
+ static Operator * OPERATOR_FORK;
+ static Operator * OPERATOR_JOIN;
+
+ static Operator * OPERATOR_INPUT_ENABLED;
+
+ static Operator * OPERATOR_RDV;
+
+ static Operator * OPERATOR_SYNCHRONIZE;
+
+
+ /*
+ ***************************************************************************
+ * AVM DATA STATUS
+ ***************************************************************************
+ */
+ static Operator * OPERATOR_STATUS_WAS;
+ static Operator * OPERATOR_STATUS_IS;
+ static Operator * OPERATOR_STATUS_BEING;
+ static Operator * OPERATOR_STATUS_WILL;
+
+ static Operator * OPERATOR_CHANGED;
+ static Operator * OPERATOR_CHANGED_TO;
+
+
+ /*
+ ***************************************************************************
+ * AVM PROGRAM SCHEDULING
+ ***************************************************************************
+ */
+ static Operator * OPERATOR_ASYNCHRONOUS;
+ static Operator * OPERATOR_STRONG_SYNCHRONOUS;
+ static Operator * OPERATOR_WEAK_SYNCHRONOUS;
+
+ static Operator * OPERATOR_INTERLEAVING;
+ static Operator * OPERATOR_PARTIAL_ORDER_REDUCTION;
+
+ static Operator * OPERATOR_PARALLEL;
+
+ static Operator * OPERATOR_RDV_ASYNCHRONOUS;
+ static Operator * OPERATOR_RDV_STRONG_SYNCHRONOUS;
+ static Operator * OPERATOR_RDV_WEAK_SYNCHRONOUS;
+
+ static Operator * OPERATOR_RDV_INTERLEAVING;
+ static Operator * OPERATOR_RDV_PARTIAL_ORDER_REDUCTION;
+
+ static Operator * OPERATOR_RDV_PARALLEL;
+
+ static Operator * OPERATOR_EXCLUSIVE;
+ static Operator * OPERATOR_NONDETERMINISM;
+
+ static Operator * OPERATOR_PRIOR_GT;
+ static Operator * OPERATOR_PRIOR_LT;
+
+ static Operator * OPERATOR_SCHEDULE_AND_THEN;
+ static Operator * OPERATOR_SCHEDULE_OR_ELSE;
+
+ static Operator * OPERATOR_ATOMIC_SEQUENCE;
+
+ static Operator * OPERATOR_SEQUENCE;
+ static Operator * OPERATOR_SEQUENCE_SIDE;
+ static Operator * OPERATOR_SEQUENCE_WEAK;
+
+ static Operator * OPERATOR_PRODUCT;
+
+
+ /*
+ ***************************************************************************
+ * AVM BUFFER MANAGING
+ ***************************************************************************
+ */
+ static Operator * OPERATOR_UPDATE_BUFFER;
+
+
+ /*
+ ***************************************************************************
+ * LAMBDA STATEMENT
+ ***************************************************************************
+ */
+ static Operator * OPERATOR_APPLY;
+
+ static Operator * OPERATOR_LAMBDA;
+
+
+ /*
+ ***************************************************************************
+ * LET STATEMENT
+ ***************************************************************************
+ */
+ static Operator * OPERATOR_LET;
+
+
+ /*
+ ***************************************************************************
+ * AVM PRIMITIVE STATEMENT
+ ***************************************************************************
+ */
+ static Operator * OPERATOR_ASSIGN;
+ static Operator * OPERATOR_ASSIGN_AFTER;
+ static Operator * OPERATOR_ASSIGN_OP;
+ static Operator * OPERATOR_ASSIGN_OP_AFTER;
+ static Operator * OPERATOR_ASSIGN_REF;
+ static Operator * OPERATOR_ASSIGN_MACRO;
+
+ static Operator * OPERATOR_ASSIGN_NEWFRESH;
+
+ static Operator * OPERATOR_ASSIGN_RESET;
+
+ static Operator * OPERATOR_GUARD;
+ static Operator * OPERATOR_TIMED_GUARD;
+
+ static Operator * OPERATOR_EVENT;
+ static Operator * OPERATOR_CHECK_SAT;
+
+
+ static Operator * OPERATOR_INPUT;
+ static Operator * OPERATOR_INPUT_FROM;
+
+ static Operator * OPERATOR_INPUT_SAVE;
+
+ // Optimized version of INPUT
+ static Operator * OPERATOR_INPUT_VAR;
+ static Operator * OPERATOR_INPUT_FLOW;
+
+ static Operator * OPERATOR_INPUT_ENV;
+ static Operator * OPERATOR_INPUT_BUFFER;
+ static Operator * OPERATOR_INPUT_RDV;
+ static Operator * OPERATOR_INPUT_BROADCAST;
+ static Operator * OPERATOR_INPUT_DELEGATE;
+
+
+ static Operator * OPERATOR_OUTPUT;
+ static Operator * OPERATOR_OUTPUT_TO;
+
+ // Optimized version of OUTPUT
+ static Operator * OPERATOR_OUTPUT_VAR;
+ static Operator * OPERATOR_OUTPUT_FLOW;
+
+ static Operator * OPERATOR_OUTPUT_ENV;
+ static Operator * OPERATOR_OUTPUT_BUFFER;
+ static Operator * OPERATOR_OUTPUT_RDV;
+ static Operator * OPERATOR_OUTPUT_BROADCAST;
+ static Operator * OPERATOR_OUTPUT_DELEGATE;
+
+
+ static Operator * OPERATOR_PRESENT;
+ static Operator * OPERATOR_ABSENT;
+
+
+ static Operator * OPERATOR_IF;
+ static Operator * OPERATOR_IFE;
+
+ static Operator * OPERATOR_FOR;
+ static Operator * OPERATOR_FOREACH;
+ static Operator * OPERATOR_WHILE_DO;
+ static Operator * OPERATOR_DO_WHILE;
+
+ static Operator * OPERATOR_BREAK;
+ static Operator * OPERATOR_CONTINUE;
+ static Operator * OPERATOR_RETURN;
+ static Operator * OPERATOR_EXIT;
+
+ static Operator * OPERATOR_STEP_MARK;
+
+
+ /*
+ ***************************************************************************
+ * AVM PREDICAT EXPRESSION
+ ***************************************************************************
+ */
+ static Operator * OPERATOR_EXIST;
+ static Operator * OPERATOR_FORALL;
+
+ static Operator * OPERATOR_NOT;
+
+ static Operator * OPERATOR_AND;
+ static Operator * OPERATOR_AND_THEN;
+
+ static Operator * OPERATOR_NAND;
+
+ static Operator * OPERATOR_XAND;
+
+ static Operator * OPERATOR_OR;
+ static Operator * OPERATOR_OR_ELSE;
+
+ static Operator * OPERATOR_NOR;
+
+ static Operator * OPERATOR_XOR;
+ static Operator * OPERATOR_XNOR;
+
+
+ /*
+ ***************************************************************************
+ * AVM BITWISE EXPRESSION
+ ***************************************************************************
+ */
+ static Operator * OPERATOR_BNOT;
+
+ static Operator * OPERATOR_BAND;
+ static Operator * OPERATOR_BOR;
+ static Operator * OPERATOR_BXOR;
+
+ static Operator * OPERATOR_LSHIFT;
+ static Operator * OPERATOR_RSHIFT;
+
+
+ /*
+ ***************************************************************************
+ * AVM SYNTAXIC COMPARISON EXPRESSION
+ ***************************************************************************
+ */
+ static Operator * OPERATOR_SEQ;
+ static Operator * OPERATOR_NSEQ;
+
+
+ /*
+ ***************************************************************************
+ * AVM COMPARISON EXPRESSION
+ ***************************************************************************
+ */
+ static Operator * OPERATOR_EQ;
+ static Operator * OPERATOR_NEQ;
+
+ static Operator * OPERATOR_LT;
+ static Operator * OPERATOR_LTE;
+ static Operator * OPERATOR_GT;
+ static Operator * OPERATOR_GTE;
+
+
+ /*
+ ***************************************************************************
+ * AVM ARITHMETIC EXPRESSION
+ ***************************************************************************
+ */
+ static Operator * OPERATOR_PLUS;
+ static Operator * OPERATOR_MINUS;
+ static Operator * OPERATOR_UMINUS;
+
+ static Operator * OPERATOR_MULT;
+ static Operator * OPERATOR_POW;
+
+ static Operator * OPERATOR_DIV;
+ static Operator * OPERATOR_MOD;
+
+ static Operator * OPERATOR_MIN;
+ static Operator * OPERATOR_MAX;
+
+
+ /*
+ ***************************************************************************
+ * LOOKUP STATEMENT
+ ***************************************************************************
+ */
+ static Operator * OPERATOR_LOOKUP_INT_EXT;
+ static Operator * OPERATOR_LOOKUP_INT;
+ static Operator * OPERATOR_LOOKUP_NEAREST;
+ static Operator * OPERATOR_LOOKUP_BELOW;
+ static Operator * OPERATOR_LOOKUP_ABOVE;
+ static Operator * OPERATOR_LOOKUP2D_INT_EXT;
+
+
+ /*
+ ***************************************************************************
+ * AVM MATHEMATICAL FUNCTION
+ ***************************************************************************
+ */
+ // ROUNDING
+ static Operator * OPERATOR_RANDOM;
+
+ static Operator * OPERATOR_ABS;
+
+ static Operator * OPERATOR_CEIL;
+ static Operator * OPERATOR_FLOOR;
+ static Operator * OPERATOR_ROUND;
+ static Operator * OPERATOR_TRUNCATE;
+
+ // EXP - LOG
+ static Operator * OPERATOR_SQRT;
+
+ static Operator * OPERATOR_EXP;
+ static Operator * OPERATOR_LN;
+ static Operator * OPERATOR_LOG;
+
+ // TRIGONOMETRIC
+ static Operator * OPERATOR_SIN;
+ static Operator * OPERATOR_COS;
+ static Operator * OPERATOR_TAN;
+
+ static Operator * OPERATOR_SINH;
+ static Operator * OPERATOR_COSH;
+ static Operator * OPERATOR_TANH;
+
+ static Operator * OPERATOR_ASIN;
+ static Operator * OPERATOR_ACOS;
+ static Operator * OPERATOR_ATAN;
+ static Operator * OPERATOR_ATAN2;
+
+ static Operator * OPERATOR_ASINH;
+ static Operator * OPERATOR_ACOSH;
+ static Operator * OPERATOR_ATANH;
+
+ /*
+ ***************************************************************************
+ * AVM STRING / COLLECTION OPERATOR
+ ***************************************************************************
+ */
+ static Operator * OPERATOR_CONTAINS;
+
+ static Operator * OPERATOR_IN;
+ static Operator * OPERATOR_NOTIN;
+
+ static Operator * OPERATOR_SUBSET;
+ static Operator * OPERATOR_SUBSETEQ;
+
+ static Operator * OPERATOR_INTERSECT;
+
+ static Operator * OPERATOR_STARTS_WITH;
+ static Operator * OPERATOR_ENDS_WITH;
+
+ static Operator * OPERATOR_CONCAT;
+
+ static Operator * OPERATOR_APPEND;
+
+ static Operator * OPERATOR_REMOVE;
+ static Operator * OPERATOR_CLEAR;
+
+ static Operator * OPERATOR_RESIZE;
+
+ static Operator * OPERATOR_SELECT;
+
+ static Operator * OPERATOR_PUSH;
+ static Operator * OPERATOR_ASSIGN_TOP;
+ static Operator * OPERATOR_TOP;
+ static Operator * OPERATOR_POP;
+ static Operator * OPERATOR_POP_FROM;
+
+ static Operator * OPERATOR_EMPTY;
+ static Operator * OPERATOR_NONEMPTY;
+ static Operator * OPERATOR_SINGLETON;
+ static Operator * OPERATOR_POPULATED;
+ static Operator * OPERATOR_FULL;
+
+ static Operator * OPERATOR_SIZE;
+
+
+ /*
+ ***************************************************************************
+ * IOLTL BEHAVIORAL PREDICAT
+ ***************************************************************************
+ */
+ static Operator * OPERATOR_GLOBALLY;
+ static Operator * OPERATOR_UNTIL;
+ static Operator * OPERATOR_NEXT;
+ static Operator * OPERATOR_EVENTUALLY;
+ static Operator * OPERATOR_RELEASES;
+ static Operator * OPERATOR_OBS;
+
+
+ /*
+ ***************************************************************************
+ * IOLTL LOGICAL PREDICAT
+ ***************************************************************************
+ */
+ static Operator * OPERATOR_AND_T;
+ static Operator * OPERATOR_OR_T;
+ static Operator * OPERATOR_NOT_T;
+ static Operator * OPERATOR_IMP_T;
+
+
+
+
+};
+
+}
+
+#endif /* OPERATORMANAGER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/operator/README.md b/org.eclipse.efm.symbex/src/fml/operator/README.md
new file mode 100644
index 0000000..059c7be
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/operator/README.md
@@ -0,0 +1,12 @@
+# EFM-SYMBEX : Operator
+
+## Source code structure
+
+### Interfaces
+* **IOperator**
+
+### Classes
+
+### Factories
+* **Operator** as Smart Pointer
+
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/ExecutionConfiguration.cpp b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionConfiguration.cpp
new file mode 100644
index 0000000..095e712
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionConfiguration.cpp
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "ExecutionConfiguration.h"
+
+
+namespace sep
+{
+
+
+/**
+ * Serialization
+ */
+std::string ExecutionConfiguration::str() const
+{
+ if( is< Operator >() )
+ {
+ return( OSS() << getRuntimeID().str()
+ << FQN_ID_ROOT_SEPARATOR << getOperator()->strOp() );
+ }
+ else
+ {
+ StringOutStream oss( AVM_STR_INDENT );
+
+ toStream( oss << IGNORE_FIRST_TAB );
+
+ return( oss.str() );
+ }
+}
+
+void ExecutionConfiguration::toStream(OutStream & os) const
+{
+ std::string str4Program;
+
+ os << TAB << "(:pid#" << getRuntimeID().getRid() << " ,"; // << " |= ";
+
+ if( isWeakProgram() )
+ {
+ os << " " << toProgram()->getNameID();
+ }
+ else if( isAvmCode() )
+ {
+ toAvmCode()->toStreamPrefix( os << AVM_STR_INDENT );
+ os << END_INDENT;
+ }
+ else
+ {
+ os << str_indent( getCode() );
+ }
+
+ AVM_DEBUG_REF_COUNTER(os);
+
+ os << ")" << EOL_FLUSH;
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/ExecutionConfiguration.h b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionConfiguration.h
new file mode 100644
index 0000000..71f40ce
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionConfiguration.h
@@ -0,0 +1,287 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef EXECUTIONCONFIGURATION_H_
+#define EXECUTIONCONFIGURATION_H_
+
+#include <common/AvmPointer.h>
+#include <common/Element.h>
+#include <common/BF.h>
+
+#include <fml/executable/AvmProgram.h>
+#include <fml/executable/AvmTransition.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/operator/Operator.h>
+
+#include <fml/runtime/Message.h>
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+
+class ExecutionConfiguration : public Element ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ExecutionConfiguration )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( ExecutionConfiguration )
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ RuntimeID mRuntimeID;
+
+ Message mIOMessage;
+
+ BF mCode;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ExecutionConfiguration(const RuntimeID & aRID, const BF & aCode)
+ : Element( CLASS_KIND_T( ExecutionConfiguration ) ),
+ mRuntimeID( aRID ),
+ mIOMessage( ),
+ mCode( aCode )
+ {
+ //!! NOTHING
+ }
+
+ ExecutionConfiguration(const RuntimeID & aRID,
+ const BF & aCode, const Message & ioMessage)
+ : Element( CLASS_KIND_T( ExecutionConfiguration ) ),
+ mRuntimeID( aRID ),
+ mIOMessage( ioMessage ),
+ mCode( aCode )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ ExecutionConfiguration(const ExecutionConfiguration & anExecConf)
+ : Element( anExecConf ),
+ mRuntimeID( anExecConf.mRuntimeID ),
+ mIOMessage( anExecConf.mIOMessage ),
+ mCode( anExecConf.mCode )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ExecutionConfiguration()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * Serialization
+ */
+ virtual std::string str() const;
+
+ virtual void toStream(OutStream & os) const;
+
+
+
+ /**
+ * GETTER - SETTER
+ * mRuntimeID
+ */
+ inline const RuntimeID & getRuntimeID() const
+ {
+ return( mRuntimeID );
+ }
+
+ inline bool hasRuntimeID() const
+ {
+ return( mRuntimeID.valid() );
+ }
+
+ inline void setRuntimeID(const RuntimeID & aRID)
+ {
+ mRuntimeID = aRID;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mMessage
+ */
+ inline const Message & getIOMessage()
+ {
+ if( mIOMessage.invalid()
+ && mCode.is< AvmCode >() && mCode.to_ptr< AvmCode >()->nonempty()
+ && mCode.to_ptr< AvmCode >()->first().is< Message >() )
+ {
+ mIOMessage = mCode.to_ptr< AvmCode >()->first();
+ }
+
+ return( mIOMessage );
+ }
+
+ inline bool hasIOMessage() const
+ {
+ return( mIOMessage.valid()
+ || (mCode.is< AvmCode >()
+ && mCode.to_ptr< AvmCode >()->nonempty()
+ && mCode.to_ptr< AvmCode >()->first().is< Message >()) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mCode
+ */
+ inline const BF & getCode() const
+ {
+ return( mCode );
+ }
+
+ inline bool hasCode() const
+ {
+ return( mCode.valid() );
+ }
+
+ inline void setCode(const BF & aCode)
+ {
+ mCode = aCode;
+ }
+
+ /**
+ * GETTER - SETTER
+ * Parameter iterator
+ */
+
+ // Operator
+ inline bool isOperator() const
+ {
+ return( mCode.is< Operator >() );
+ }
+
+ inline Operator * getOperator() const
+ {
+ return( isOperator() ? getCode().to_ptr< Operator >() : NULL );
+ }
+
+
+ // AvmCode
+ inline bool isAvmCode() const
+ {
+ return( mCode.is< AvmCode >() );
+ }
+
+ inline const BFCode & getAvmCode() const
+ {
+ return( isAvmCode() ? getCode().bfCode() : BFCode::REF_NULL );
+ }
+
+ inline const BFCode & toAvmCode() const
+ {
+ return( getCode().bfCode() );
+ }
+
+ inline AVM_OPCODE getAvmOpCode() const
+ {
+ return( isAvmCode() ? mCode.to_ptr< AvmCode >()->getAvmOpCode()
+ : AVM_OPCODE_NULL );
+ }
+
+ inline AVM_OPCODE getOptimizedOpCode() const
+ {
+ return( isAvmCode() ? mCode.to_ptr< AvmCode >()->getOptimizedOpCode()
+ : AVM_OPCODE_NULL );
+ }
+
+
+ // AvmProgram - AvmTransition - AvmRoutine
+ inline bool isTransition() const
+ {
+ return( mCode.is< AvmTransition >() );
+ }
+
+ inline AvmTransition * getTransition() const
+ {
+ return( isTransition() ? getCode().to_ptr< AvmTransition >() : NULL );
+ }
+
+ inline AvmTransition * toTransition() const
+ {
+ return( getCode().to_ptr< AvmTransition >() );
+ }
+
+ inline bool isRoutine() const
+ {
+ return( mCode.is_exactly< AvmProgram >() &&
+ getCode().to_ptr< AvmProgram >()->isScopeRoutine() );
+ }
+
+ inline bool isRunnable() const
+ {
+ return( mCode.is_exactly< AvmProgram >() &&
+ getCode().to_ptr< AvmProgram >()->isScopeRoutine() );
+ }
+
+
+ inline bool isProgram() const
+ {
+ return( mCode.is_exactly< AvmProgram >() );
+ }
+
+ inline bool isWeakProgram() const
+ {
+ return( mCode.is< AvmProgram >() );
+ }
+
+ inline AvmProgram * getProgram() const
+ {
+ return( isWeakProgram() ? getCode().to_ptr< AvmProgram >() : NULL );
+ }
+
+ inline AvmProgram * toProgram() const
+ {
+ return( getCode().to_ptr< AvmProgram >() );
+ }
+
+
+ /**
+ * COMPARISON
+ * OPERATOR
+ */
+ inline int compare(const ExecutionConfiguration & other) const
+ {
+ int cmpResult = mRuntimeID.compare( other.mRuntimeID );
+
+ return( (cmpResult == 0) ? mCode.compare( other.mCode ) : cmpResult );
+ }
+
+
+};
+
+
+
+}
+
+#endif /*EXECUTIONCONFIGURATION_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/ExecutionContext.cpp b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionContext.cpp
new file mode 100644
index 0000000..ce81ac6
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionContext.cpp
@@ -0,0 +1,875 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include <fml/runtime/ExecutionContext.h>
+
+
+#include <fml/expression/StatementConstructor.h>
+
+#include <fml/operator/OperatorManager.h>
+
+
+namespace sep
+{
+
+
+/**
+ * ID_NUMBER
+ */
+avm_uint32_t ExecutionContextHeader::ID_NUMBER = 0;
+
+
+/**
+ * TRACE CONSTANT
+ */
+avm_size_t ExecutionContext::EC_CHILD_TRACE_DEFAULT_SIZE = 42;
+
+avm_size_t ExecutionContext::EXECUTION_CONTEXT_CHILD_TRACE_MAX =
+ EC_CHILD_TRACE_DEFAULT_SIZE;
+
+
+/*
+ * DEFAULT NULL REFERENCE
+ */
+ExecutionContext ExecutionContext::_NULL_;
+
+/**
+ * LCA -LCRA
+ */
+const ExecutionContext * ExecutionContext::LCA(
+ const ExecutionContext * anEC) const
+{
+ const ExecutionContext * containerOfThis = this;
+ const ExecutionContext * containerOfEC = anEC;
+
+ while( containerOfThis->getHeight() < containerOfEC->getHeight() )
+ {
+ containerOfEC = containerOfEC->getContainer();
+ }
+ while( containerOfEC->getHeight() < containerOfThis->getHeight() )
+ {
+ containerOfThis = containerOfThis->getContainer();
+ }
+
+ while( containerOfThis != containerOfEC )
+ {
+ containerOfThis = containerOfThis->getContainer();
+ containerOfEC = containerOfEC->getContainer();
+ }
+
+ return( containerOfThis );
+}
+
+
+/**
+ * Serialization
+ */
+void ExecutionContext::toDebug(OutStream & out) const
+{
+ out << TAB << "EC:" << "<"
+ << "Id:" << getIdNumber() << ";"
+ << "Ev:" << getEvalNumber() << ";"
+ << "H:" << getHeight() << ";"
+ << "W:" << getWidth() //<< ";"
+// << "Q:" << ((avm_uint32_t) getWeight())
+ << ">{" << INCR_INDENT;
+
+ if( hasExecutionData() )
+ {
+ out << " SC: " << refExecutionData().strStateConfToFscn() << EOL;
+ }
+
+ if( hasRunnableElementTrace() )
+ {
+ out << TAB << "EXE : "; getRunnableElementTrace().toStream(out);
+ }
+
+ if( hasIOElementTrace() )
+ {
+ out << TAB << "TRACE : "; getIOElementTrace().toStream(out);
+ }
+
+ // FLAGS
+ if( hasFlags() )
+ {
+ out << TAB << "/*FLAGS{ " << getFlags().str() << " }*/" << EOL;
+ }
+
+ // INFORMATION
+ if( hasInformation())
+ {
+ if( getInformation()->hasInfo() )
+ {
+ out << TAB << "INFO{" << EOL_INCR_INDENT;
+ getInformation()->toFscnInfo(out);
+ out << DECR_INDENT_TAB << "}" << EOL_FLUSH;
+ }
+
+ if( getInformation()->hasSpecificInfo() )
+ {
+ out << TAB << "/*INFORMATION{" << EOL_INCR_INDENT;
+ getInformation()->toFscn(out);
+ out << DECR_INDENT_TAB << "}*/" << EOL_FLUSH;
+ }
+ }
+ // END INFORMATION
+
+
+ if( hasNodeCondition() && getNodeCondition().isNotEqualTrue() )
+ {
+ out << DEFAULT_WRAP_DATA << TAB << "NC:"
+ << str_indent( getNodeCondition() ) << END_WRAP_EOL;
+ }
+
+ if( hasNodeTimedCondition() &&
+ getNodeTimedCondition().isNotEqualTrue() )
+ {
+ out << DEFAULT_WRAP_DATA << TAB << "NtC:"
+ << str_indent( getNodeTimedCondition() ) << END_WRAP_EOL;
+ }
+
+ if( hasExecutionData() )
+ {
+ ScopeIncrIndent asii(out);
+
+ refExecutionData().toFscn(out, hasPrevious() ?
+ getPrevious()->getExecutionData() : NULL);
+ }
+
+ out << DECR_INDENT_TAB << "}" << EOL;
+}
+
+
+void ExecutionContext::toDebugFet(OutStream & out) const
+{
+ out << TAB << "ec( "
+ << "Id:" << getIdNumber() << " , "
+ << "Pr:" << getPrevIdNumber() << " , "
+ << "Ev:" << getEvalNumber() << " , "
+ << "H:" << getHeight() << " , "
+ << "W:" << getWidth() << " , "
+ << "Q:" << getStrWeight()
+ << " )" ;
+
+ AVM_DEBUG_REF_COUNTER(out);
+ out << " {" << EOL_INCR_INDENT;
+
+ if( hasNodeCondition() &&
+ getNodeCondition().isNotEqualTrue() )
+ {
+ out << DEFAULT_WRAP_DATA << TAB << "fired#condition ="
+ << str_indent( getNodeCondition() )
+ << ";" << END_WRAP_EOL;
+ }
+
+ if( hasNodeTimedCondition() &&
+ getNodeTimedCondition().isNotEqualTrue() )
+ {
+ out << DEFAULT_WRAP_DATA << TAB << "fired#timed#condition ="
+ << str_indent( getNodeTimedCondition() ) << ";" << END_WRAP_EOL;
+ }
+
+ if( hasRunnableElementTrace() )
+ {
+ out << TAB << "fired =" << str_indent( getRunnableElementTrace() )
+ << ";" << EOL_FLUSH;
+ }
+
+ if( hasIOElementTrace() )
+ {
+ out << TAB << "trace =" << str_indent( getIOElementTrace() )
+ << ";" << EOL_FLUSH;
+ }
+
+
+ if( hasInformation() )
+ {
+ getInformation()->toStream(out);
+ }
+
+ if( hasExecutionData() )
+ {
+ refExecutionData().toStream(out);
+ }
+
+
+ out << DECR_INDENT_TAB << "}" << EOL_FLUSH;
+}
+
+
+
+void ExecutionContext::toStream(OutStream & out) const
+{
+ out << TAB << getFlags().toString(" ") << "ec( "
+ << "Id:" << getIdNumber() << " , "
+ << "Pr:" << getPrevIdNumber() << " , "
+ << "Ev:" << getEvalNumber() << " , "
+ << "H:" << getHeight() << " , "
+ << "W:" << getWidth() << " , "
+ << "Q:" << getStrWeight()
+ << " )" ;
+
+ AVM_DEBUG_REF_COUNTER(out);
+ out << " {" << EOL_INCR_INDENT;
+
+ if( hasNodeCondition() && getNodeCondition().isNotEqualTrue() )
+ {
+ out << DEFAULT_WRAP_DATA << TAB << "nodecondition ="
+ << str_indent( getNodeCondition() ) << ";" << END_WRAP_EOL;
+ }
+
+ if( hasNodeTimedCondition() && getNodeTimedCondition().isNotEqualTrue() )
+ {
+ out << DEFAULT_WRAP_DATA << TAB << "nodetimedcondition ="
+ << str_indent( getNodeTimedCondition() ) << ";" << END_WRAP_EOL;
+ }
+
+ if( hasRunnableElementTrace() )
+ {
+ out << TAB << "fired =" << str_indent( getRunnableElementTrace() )
+ << ";" << EOL_FLUSH;
+ }
+
+ if( hasIOElementTrace() )
+ {
+ out << TAB << "trace =" << str_indent( getIOElementTrace() )
+ << ";" << EOL_FLUSH;
+ }
+
+
+ if( hasInformation() )
+ {
+ getInformation()->toStream(out);
+ }
+
+ if( hasExecutionData() )
+ {
+ refExecutionData().toStream(out);
+ }
+
+ out << DECR_INDENT;
+
+
+ if( hasChildContext() )
+ {
+ out << EOL_TAB << "ec:" << EOL_INCR_INDENT;
+ for( child_iterator it = begin() ; it != end() ; ++it )
+ {
+ (*it)->toStream(out);
+ }
+ out << DECR_INDENT;
+ }
+
+ out << TAB << "}" << EOL_FLUSH;
+}
+
+
+void ExecutionContext::toFscn(OutStream & out,
+ const ExecutionData * aPreviousExecData) const
+{
+ out << TAB << "EC:" << "<"
+ << "Id:" << getIdNumber() << ";"
+ << "Ev:" << getEvalNumber() << ";"
+ << "H:" << getHeight() << ";"
+ << "W:" << getWidth() //<< ";"
+// << "Q:" << ((avm_uint32_t) getWeight())
+ << ">{" ;
+
+ if( hasExecutionData() )
+ {
+ out << " SC: " << refExecutionData().strStateConfToFscn() << EOL;
+
+ avm_size_t indexAlias = 0;
+ bool isAlias = false;
+ if( (getPrevious() != NULL) )
+ {
+ // Recherche des nouveaux PID
+ if(refExecutionData().getTableOfRuntime().size()
+ > getPrevious()->refExecutionData().getTableOfRuntime().size())
+ {
+ indexAlias = getPrevious()
+ ->refExecutionData().getTableOfRuntime().size();
+ isAlias = true;
+ }
+ }
+ else
+ {
+ isAlias = true;
+ }
+
+ if( isAlias )
+ {
+ out << TAB2 << "ALIAS{" << EOL;
+
+ for( avm_size_t i = indexAlias ;
+ i < refExecutionData().getTableOfRuntime().size() ; ++i)
+ {
+ const RuntimeID & currentRID =
+ refExecutionData().getTableOfRuntime().at(i)->getRID();
+
+ out << TAB3 << ":ppid#" << currentRID.getPRid()
+ << ":" << "pid#" << currentRID.getRid();
+
+ if( currentRID.getInstance()->
+ getSpecifier().isDesignPrototypeStatic() )
+ {
+ out << " = "
+ << currentRID.getInstance()->getAstFullyQualifiedNameID()
+ << ";" << EOL;
+ }
+ else if( currentRID.getInstance()->
+ getSpecifier().isDesignInstance() )
+ {
+ out << " = "
+ << currentRID.getInstance()->getAstFullyQualifiedNameID()
+ << ";";
+
+ out << " // model is "
+ << currentRID.getExecutable()->getAstFullyQualifiedNameID()
+ << ";" << EOL;
+ }
+ else
+ {
+ out << " = " << currentRID.getFullyQualifiedNameID() << ";"
+ << " // model is "
+ << currentRID.getExecutable()->getAstFullyQualifiedNameID()
+ << ";" << EOL;
+ }
+
+
+ if( currentRID.getInstance()->hasExecutable() )
+ {
+ const TableOfSymbol & rfBuffers =
+ currentRID.getExecutable()->getBuffer();
+ if(rfBuffers.nonempty()){
+ out << TAB4 << "BUFFER NUMBER = " << rfBuffers.size()
+ << ";" << EOL;
+
+ out << TAB4 << "/*BUFFER{" << EOL;
+
+ TableOfSymbol::const_iterator itBuffer = rfBuffers.begin();
+ TableOfSymbol::const_iterator endBuffer = rfBuffers.end();
+ for( ; itBuffer != endBuffer ; ++itBuffer )
+ {
+ out << TAB5 << ":ppid#" << currentRID.getPRid()
+ << ":" << "pid#" << currentRID.getRid()
+ << ":" << (*itBuffer).getNameID() << " = ";
+ out << ( ((*itBuffer).hasAstElement()) ?
+ (*itBuffer).getAstFullyQualifiedNameID()
+ : (*itBuffer).getFullyQualifiedNameID() )
+ << ";" << EOL;
+ }
+
+ out << TAB4 << "}*/" << EOL;
+ }
+
+ if( currentRID.getExecutable()->hasData() )
+ {
+ out << TAB4 << "DATA{" << EOL;
+
+ TableOfInstanceOfData::const_raw_iterator itData =
+ currentRID.getExecutable()->getBasicData().begin();
+ TableOfInstanceOfData::const_raw_iterator endData =
+ currentRID.getExecutable()->getBasicData().end();
+ for( ; (itData != endData) ; ++itData )
+ {
+ out << TAB5 << ":ppid#" << currentRID.getPRid()
+ << ":pid#" << currentRID.getRid() << ":"
+ << (itData)->getNameID() << " = "
+ << ( ( (itData)->hasAstElement() )
+ ? (itData)->getAstFullyQualifiedNameID()
+ : (itData)->getFullyQualifiedNameID() )
+ << ";" << EOL;
+ }
+
+ out << TAB4 << "}" << EOL;
+ }
+
+ if( currentRID.getExecutable()->hasPort() )
+ {
+ out << TAB4 << "INTERFACE{" << EOL;
+
+ TableOfSymbol & rfInterface =
+ currentRID.getExecutable()->getPort();
+ TableOfSymbol::iterator itPort = rfInterface.begin();
+ for( ; itPort != rfInterface.end() ; ++itPort )
+ {
+ out << TAB5 << ":ppid#" << currentRID.getPRid()
+ << ":pid#" << currentRID.getRid() << ":"
+ << (*itPort).getNameID() << " = "
+ << (*itPort).getAstFullyQualifiedNameID()
+ << ";" << EOL;
+ }
+
+ out << TAB4 << "}" << EOL;
+ }
+ }
+ }
+ out << TAB2 << "}" << EOL;
+ }
+ }
+
+ if( hasRunnableElementTrace() )
+ {
+ out << DEFAULT_WRAP_DATA << TAB2 << "EXE:"
+ << str_indent( getRunnableElementTrace() ) << END_WRAP_EOL;
+ }
+
+ if( hasIOElementTrace() )
+ {
+ out << DEFAULT_WRAP_DATA << TAB2 << "TRACE:"
+ << str_indent( getIOElementTrace() ) << END_WRAP_EOL;
+ }
+
+ // FLAGS
+ if( hasFlags() )
+ {
+ out << TAB2 << "/*FLAGS{ " << getFlags().str() << " }*/" << EOL;
+ }
+
+ // INFORMATION
+ if( hasInformation() )
+ {
+ if( getInformation()->hasInfo() )
+ {
+ out << TAB2 << "INFO{" << EOL_INCR2_INDENT;
+ getInformation()->toFscnInfo(out);
+ out << DECR2_INDENT_TAB2 << "}" << EOL_FLUSH;
+ }
+
+ if( getInformation()->hasSpecificInfo() )
+ {
+ out << TAB2 << "/*INFORMATION{" << EOL_INCR2_INDENT;
+ getInformation()->toFscn(out);
+ out << DECR2_INDENT_TAB2 << "}*/" << EOL_FLUSH;
+ }
+ }
+ // END INFORMATION
+
+
+ if( hasNodeCondition() && getNodeCondition().isNotEqualTrue() )
+ {
+ out << DEFAULT_WRAP_DATA << TAB2 << "NC:"
+ << str_indent( getNodeCondition() ) << END_WRAP_EOL;
+ }
+
+ if( hasNodeTimedCondition() &&
+ getNodeTimedCondition().isNotEqualTrue() )
+ {
+ out << DEFAULT_WRAP_DATA << TAB2 << "NtC:"
+ << str_indent( getNodeTimedCondition() ) << END_WRAP_EOL;
+ }
+
+ if( hasExecutionData() )
+ {
+ ScopeIncrIndent asii(out);
+
+ refExecutionData().toFscn(out, aPreviousExecData);
+ }
+
+
+ if( hasChildContext() )
+ {
+ out << INCR_INDENT;
+
+ for( child_iterator it = begin() ; it != end() ; ++it )
+ {
+ (*it)->toFscn(out, getExecutionData());
+ }
+
+ out << DECR_INDENT;
+ }
+
+ out << TAB << "}" << EOL;
+}
+
+
+/**
+ * ExecutionContext::str_min
+ *
+ */
+std::string ExecutionContext::str_min() const
+{
+ return( OSS() << str_position() << " "
+ << refExecutionData().strStateConf() );
+}
+
+
+/**
+ * ExecutionContext::str_Positions
+ *
+ */
+std::string ExecutionContext::str_position() const
+{
+ std::ostringstream oss;
+
+ oss << "Id:" /*<< std::setw(4)*/ << getIdNumber();
+
+ oss << " PE:";
+ if( hasContainer() )
+ {
+ //oss /*<< std::setw(4)*/ << getContainer()->getIdNumber();
+ oss /*<< std::setw(4)*/ << getContainer()->getEvalNumber();
+ }
+ else
+ {
+ oss << "ROOT";
+ }
+
+ oss << " H:" /*<< std::setw(4)*/ << getHeight();
+ oss << " W:" /*<< std::setw(4)*/ << getWidth();
+ oss << " Q:" /*<< std::setw(2)*/ << getStrWeight();
+
+ return( oss.str() );
+}
+
+
+/**
+ * traceMinimum
+ *
+ */
+void ExecutionContext::traceMinimum(OutStream & out) const
+{
+ out << TAB << "ctx:" << getIdNumber();
+
+ if( getWeight() != 0 )
+ {
+ out << " Q:" << getStrWeight();
+ }
+ out << " " << refExecutionData().strStateConf() << EOL;
+}
+
+void ExecutionContext::traceDefault(OutStream & out) const
+{
+ out << TAB << "ctx:" << getIdNumber();
+ if( getWeight() != 0 )
+ {
+ out << " Q:" << getStrWeight();
+ }
+
+ out << " " << refExecutionData().strStateConf() << "|=> fired ";
+
+ if( hasRunnableElementTrace() )
+ {
+ out << getRunnableElementTrace().str();
+ }
+ else
+ {
+ out << "nothing in " << refExecutionData().getSystemRID().str();
+ }
+
+ out << EOL;
+}
+
+void ExecutionContext::debugDefault(OutStream & out) const
+{
+ out << TAB << "ctx:" << getIdNumber();
+ if( getWeight() != 0 )
+ {
+ out << " Q:" << getStrWeight();
+ }
+ out << " " << refExecutionData().strStateConf() << EOL;
+
+ if( hasRunnableElementTrace() )
+ {
+ getRunnableElementTrace().toStream(out << TAB << "EXE : ");
+ }
+ if( hasIOElementTrace() )
+ {
+ getIOElementTrace().toStream(out << TAB << "TRACE : ");
+ }
+}
+
+
+void ExecutionContext::traceMinimum(OutStream & out,
+ ListOfExecutionContext & listofEC, const std::string & header)
+{
+ out << TAB << header << " {" << EOL_INCR_INDENT;
+ ListOfExecutionContext::const_iterator itEC = listofEC.begin();
+ ListOfExecutionContext::const_iterator endEC = listofEC.end();
+ for( ; itEC != endEC ; ++itEC )
+ {
+ (*itEC)->traceMinimum(out);
+ }
+
+ out << DECR_INDENT_TAB << "}" << EOL_FLUSH;
+}
+
+void ExecutionContext::traceMinimum(OutStream & out,
+ VectorOfExecutionContext & listofEC, const std::string & header)
+{
+ out << TAB << header << " {" << EOL_INCR_INDENT;
+ VectorOfExecutionContext::const_iterator itEC = listofEC.begin();
+ VectorOfExecutionContext::const_iterator endEC = listofEC.end();
+ for( ; itEC != endEC ; ++itEC )
+ {
+ (*itEC)->traceMinimum(out);
+ }
+
+ out << DECR_INDENT_TAB << "}" << EOL_FLUSH;
+}
+
+
+void ExecutionContext::traceDefault(OutStream & out,
+ ListOfExecutionContext & listofEC, const std::string & header)
+{
+ out << TAB << header << " {" << EOL_INCR_INDENT;
+ ListOfExecutionContext::const_iterator itEC = listofEC.begin();
+ ListOfExecutionContext::const_iterator endEC = listofEC.end();
+ for( ; itEC != endEC ; ++itEC )
+ {
+ (*itEC)->traceDefault(out);
+ }
+
+ out << DECR_INDENT_TAB << "}" << EOL_FLUSH;
+}
+
+void ExecutionContext::traceDefault(OutStream & out,
+ VectorOfExecutionContext & listofEC, const std::string & header)
+{
+ out << TAB << header << " {" << EOL_INCR_INDENT;
+ VectorOfExecutionContext::const_iterator itEC = listofEC.begin();
+ VectorOfExecutionContext::const_iterator endEC = listofEC.end();
+ for( ; itEC != endEC ; ++itEC )
+ {
+ (*itEC)->traceDefault(out);
+ }
+
+ out << DECR_INDENT_TAB << "}" << EOL_FLUSH;
+}
+
+
+void ExecutionContext::debugDefault(OutStream & out,
+ ListOfExecutionContext & listofEC, const std::string & header)
+{
+ out << TAB << header << " {" << EOL_INCR_INDENT;
+ ListOfExecutionContext::const_iterator itEC = listofEC.begin();
+ ListOfExecutionContext::const_iterator endEC = listofEC.end();
+ for( ; itEC != endEC ; ++itEC )
+ {
+ (*itEC)->debugDefault(out);
+ }
+
+ out << DECR_INDENT_TAB << "}" << EOL_FLUSH;
+}
+
+void ExecutionContext::debugDefault(OutStream & out,
+ VectorOfExecutionContext & listofEC, const std::string & header)
+{
+ out << TAB << header << " {" << EOL_INCR_INDENT;
+ VectorOfExecutionContext::const_iterator itEC = listofEC.begin();
+ VectorOfExecutionContext::const_iterator endEC = listofEC.end();
+ for( ; itEC != endEC ; ++itEC )
+ {
+ (*itEC)->debugDefault(out);
+ }
+
+ out << DECR_INDENT_TAB << "}" << EOL_FLUSH;
+}
+
+
+/**
+ * OK
+ */
+void ExecutionContext::writeTraceAfterExec(OutStream & out) const
+{
+ avm_size_t count = 1;
+ child_iterator it = begin();
+ child_iterator endIt = end();
+ for( ; (it != endIt) && (count < EXECUTION_CONTEXT_CHILD_TRACE_MAX);
+ ++it , ++count )
+ {
+ out << TAB << "==>E[?] " << (*it)->str_min() << "|=> fired ";
+
+ if( (*it)->hasRunnableElementTrace() )
+ {
+ out << (*it)->getRunnableElementTrace().str();
+ }
+ else
+ {
+ out << "machine#main " << refExecutionData().getSystemRID().str();
+ }
+
+ out << EOL;
+ }
+
+ if( it != endIt )
+ {
+ out << TAB << "==>E[?] " << mChildContexts.last()->str_min()
+ << "|=> fired ";
+
+ if( mChildContexts.last()->hasRunnableElementTrace() )
+ {
+ out << mChildContexts.last()->getRunnableElementTrace().str();
+ }
+ else
+ {
+ out << "machine#main " << refExecutionData().getSystemRID().str();
+ }
+
+ out << EOL;
+ }
+
+ if( count == EXECUTION_CONTEXT_CHILD_TRACE_MAX )
+ {
+ out << REPEAT("--------", 10) << EOL
+ << "<< PRINT " << EXECUTION_CONTEXT_CHILD_TRACE_MAX << " OF "
+ << size() << " EXECUTION CONTEXT RESULT >> " << EOL;
+
+ if( EXECUTION_CONTEXT_CHILD_TRACE_MAX == EC_CHILD_TRACE_DEFAULT_SIZE )
+ {
+ out << REPEAT("--------", 10) << EOL
+ << "==> You could fix that limit using the integer attribute"
+ " << @ec_size = <integer>; >> in the section TRACE " << EOL;
+ }
+ }
+
+ out << REPEAT("--------", 10) << EOL_FLUSH;
+}
+
+
+void ExecutionContext::traceDefaultPostEval(OutStream & out) const
+{
+ avm_size_t count = 1;
+
+ child_iterator it = begin();
+ child_iterator endIt = end();
+ for( ; (it != endIt) &&
+ (count < ExecutionContext::EXECUTION_CONTEXT_CHILD_TRACE_MAX);
+ ++it , ++count )
+ {
+ out << TAB << "==> ctx:" << (*it)->getIdNumber();
+ if( (*it)->getWeight() != 0 )
+ {
+ out << " Q:" << (*it)->getStrWeight();
+ }
+ out << " " << (*it)->refExecutionData().strStateConf();
+
+ out << EOL_TAB << "|=> fired ";
+
+ if( (*it)->hasRunnableElementTrace() )
+ {
+ out << (*it)->getRunnableElementTrace().str();
+ }
+ else
+ {
+ out << "nothing in " << refExecutionData().getSystemRID().str();
+ }
+
+ out << EOL;
+ }
+
+ if( it != endIt )
+ {
+ out << TAB << "==> ctx:" << mChildContexts.last()->getIdNumber();
+ if( mChildContexts.last()->getWeight() != 0 )
+ {
+ out << " Q:" << mChildContexts.last()->getStrWeight();
+ }
+ out << " " << mChildContexts.last()->refExecutionData().strStateConf();
+
+ out << EOL_TAB << "|=> fired ";
+
+ if( mChildContexts.last()->hasRunnableElementTrace() )
+ {
+ out << mChildContexts.last()->getRunnableElementTrace().str();
+ }
+ else
+ {
+ out << "nothing in " << refExecutionData().getSystemRID().str();
+ }
+
+ out << EOL;
+ }
+
+ if( count == EXECUTION_CONTEXT_CHILD_TRACE_MAX )
+ {
+ out << REPEAT("--------", 10) << EOL
+ << "<< PRINT " << EXECUTION_CONTEXT_CHILD_TRACE_MAX << " OF "
+ << size() << " EXECUTION CONTEXT RESULT >> " << EOL;
+
+ if( EXECUTION_CONTEXT_CHILD_TRACE_MAX == EC_CHILD_TRACE_DEFAULT_SIZE )
+ {
+ out << REPEAT("--------", 10) << EOL
+ << "==> You could fix that limit using the integer attribute"
+ " << @ec_size = <integer>; >> in the section TRACE " << EOL;
+ }
+ }
+
+ out << REPEAT("--------", 10) << EOL_FLUSH;
+}
+
+
+/**
+ * OK
+ */
+void ExecutionContext::writeTraceBeforeExec(OutStream & out) const
+{
+AVM_VERBOSITY_SWITCH_SILENT
+
+ out << TAB << "step[" << std::setw(4) << getEvalNumber() << "] "
+ << "context[" << std::setw(6) << getIdNumber()
+ << " / " << std::setw(6) << ExecutionContextHeader::ID_NUMBER
+ << "] " << std::flush;
+
+AVM_VERBOSITY_SWITCH_CASE_MINIMUM
+
+ out << TAB << "step[" << std::setw(4) << getEvalNumber() << "] "
+ << "context[" << std::setw(6) << getIdNumber()
+ << " / " << std::setw(6) << ExecutionContextHeader::ID_NUMBER
+ << "] " << std::flush;
+
+AVM_VERBOSITY_SWITCH_CASE_MEDIUM
+
+ out << TAB << "E[" << std::setw(4) << getEvalNumber() << "] "
+ << str_min() << EOL_FLUSH;
+
+AVM_VERBOSITY_SWITCH_CASE_MAXIMUM
+
+ out << TAB << "E[" << std::setw(4) << getEvalNumber() << "] "
+ << str_min() << EOL_FLUSH;
+
+AVM_VERBOSITY_SWITCH_END
+}
+
+
+/**
+ * OK
+ */
+void ExecutionContext::writeTraceForDeadlock(OutStream & out,
+ avm_uint32_t nDeadlockCounter) const
+{
+ out << TAB << " ==> DEADLOCK : " << nDeadlockCounter << "<=="
+ << TAB << " << NO FIREABLE TRANSITIONS FOUND >>" << EOL
+ << TAB << REPEAT("-------", 6) << EOL_FLUSH;
+}
+
+/**
+ * OK
+ */
+void ExecutionContext::writeTraceForRedundancy(OutStream & out,
+ ExecutionContext * aRedundantExecContext,
+ avm_uint32_t nRedundancyCounter) const
+{
+ out << TAB << " ==> REDUNDANCE : " << nRedundancyCounter << " <=="
+ << std::endl
+ << TAB << " E[" << std::setw(4)
+ << aRedundantExecContext->getEvalNumber()
+ << "] " << aRedundantExecContext->str_min()
+ << std::endl
+ << TAB << REPEAT("-------", 6) << EOL_FLUSH;
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/ExecutionContext.h b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionContext.h
new file mode 100644
index 0000000..1f940a0
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionContext.h
@@ -0,0 +1,1318 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef EXECUTIONCONTEXT_H_
+#define EXECUTIONCONTEXT_H_
+
+#include <common/Element.h>
+#include <fml/runtime/ExecutionContextFlags.h>
+
+#include <collection/List.h>
+#include <collection/Vector.h>
+
+#include <common/BF.h>
+
+#include <fml/expression/ExpressionConstant.h>
+#include <fml/expression/ExpressionConstructor.h>
+
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/ExecutionInformation.h>
+
+
+namespace sep
+{
+
+class AbstractProcessorUnit;
+class ExecutionContext;
+class RuntimeID;
+
+
+/**
+ * TYPEDEF
+ */
+typedef List < ExecutionContext * > ListOfExecutionContext;
+typedef Vector< ExecutionContext * > VectorOfExecutionContext;
+
+typedef List < const ExecutionContext * > ListOfConstExecutionContext;
+typedef Vector< const ExecutionContext * > VectorOfConstExecutionContext;
+
+
+class ExecutionContextHeader :
+ public Element ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ExecutionContextHeader )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( ExecutionContextHeader )
+
+
+public:
+ /**
+ * ATTRIBUTES
+ * static
+ */
+ static avm_uint32_t ID_NUMBER;
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ avm_uint32_t mIdNumber;
+ avm_uint32_t mEvalNumber;
+
+ avm_uint32_t mHeight;
+ avm_uint32_t mWidth;
+
+ avm_uint8_t mWeight;
+
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ExecutionContextHeader()
+ : Element( CLASS_KIND_T( ExecutionContextHeader ) ),
+ mIdNumber( ID_NUMBER++ ),
+ mEvalNumber( 0 ),
+ mHeight( 0 ),
+ mWidth( 1 ),
+ mWeight( 0 )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ ExecutionContextHeader(const ExecutionContextHeader & aHeader)
+ : Element( aHeader ),
+ mIdNumber( ID_NUMBER++ ),
+ mEvalNumber( aHeader.mEvalNumber ),
+ mHeight( aHeader.mHeight ),
+ mWidth( aHeader.mWidth ),
+ mWeight( 0 )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ ExecutionContextHeader(avm_uint32_t aHeight, avm_uint32_t aWidth)
+ : Element( CLASS_KIND_T( ExecutionContextHeader ) ),
+ mIdNumber( ID_NUMBER++ ),
+ mEvalNumber( 0 ),
+ mHeight( aHeight ),
+ mWidth( aWidth ),
+ mWeight( 0 )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ExecutionContextHeader()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * ID_NUMBER
+ */
+ inline static avm_uint32_t getCreateCounter()
+ {
+ return( ID_NUMBER );
+ }
+
+ inline static void setCreateCounter(avm_uint32_t aCreateCounter)
+ {
+ ID_NUMBER = aCreateCounter;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mIdNumber
+ */
+ inline avm_uint32_t getIdNumber() const
+ {
+ return( mIdNumber );
+ }
+
+ inline void setIdNumber(avm_uint32_t anIdNumber)
+ {
+ mIdNumber = anIdNumber;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ *
+ */
+ inline avm_uint32_t getEvalNumber() const
+ {
+ return( mEvalNumber );
+ }
+
+ inline void setEvalNumber(avm_uint32_t anEvalNumber)
+ {
+ mEvalNumber = anEvalNumber;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mHeight
+ */
+ inline avm_uint32_t getHeight() const
+ {
+ return( mHeight );
+ }
+
+ inline void setHeight(avm_uint32_t aHeight)
+ {
+ mHeight = aHeight;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mWidth
+ */
+ inline avm_uint32_t getWidth() const
+ {
+ return( mWidth );
+ }
+
+ inline void setWidth(avm_uint32_t aWidth)
+ {
+ mWidth = aWidth;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mWeight
+ */
+ inline avm_uint8_t getWeight() const
+ {
+ return( mWeight );
+ }
+
+ inline avm_uint32_t getStrWeight() const
+ {
+ return( mWeight );
+ }
+
+ inline static avm_uint8_t getWeightMax()
+ {
+ return( AVM_NUMERIC_MAX_UINT8 );
+ }
+
+ inline bool isWeightMax() const
+ {
+ return( mWeight == AVM_NUMERIC_MAX_UINT8 );
+ }
+
+ inline bool isWeight(avm_uint8_t aWeight) const
+ {
+ return( mWeight == aWeight );
+ }
+
+
+ inline void setWeight(avm_uint8_t aWeight)
+ {
+ mWeight = aWeight;
+ }
+
+
+ inline void setWeightMax()
+ {
+ mWeight = AVM_NUMERIC_MAX_UINT8;
+ }
+
+
+ inline void decrWeight(avm_uint8_t aWeight = 1)
+ {
+ if( mWeight != AVM_NUMERIC_MAX_UINT8 )
+ {
+ mWeight -= aWeight;
+ }
+ }
+
+ inline void incrWeight(avm_uint8_t aWeight = 1)
+ {
+ if( mWeight != AVM_NUMERIC_MAX_UINT8 )
+ {
+ mWeight += aWeight;
+ }
+ }
+
+
+ /**
+ ***************************************************************************
+ * SERIALIZATION
+ ***************************************************************************
+ */
+
+ inline virtual std::string str() const
+ {
+ StringOutStream oss;
+
+ oss << "Id:" << getIdNumber() << ", Ev:" << getEvalNumber()
+ << ", H:" << getHeight() << ", W:" << getWidth();
+ if( getWeight() > 0 )
+ {
+ oss << ", Q:" << getStrWeight();
+ }
+
+ return( oss.str() );
+ }
+
+ virtual void toStream(OutStream & out) const
+ {
+ out << TAB
+ << "Id:" << getIdNumber() << " , Ev:" << getEvalNumber()
+ << " , H:" << getHeight() << " , W:" << getWidth()
+ << " , Q:" << getStrWeight()
+ << EOL_FLUSH;
+ }
+
+};
+
+
+
+class ExecutionContext : public Element ,
+ public ExecutionContextFlagsImpl ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ExecutionContext )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( ExecutionContext )
+
+public:
+ /**
+ * TRACE CONSTANT
+ */
+ static avm_size_t EC_CHILD_TRACE_DEFAULT_SIZE;
+
+ static avm_size_t EXECUTION_CONTEXT_CHILD_TRACE_MAX;
+
+ /*
+ * DEFAULT NULL REFERENCE
+ */
+ static ExecutionContext _NULL_;
+
+
+protected:
+ /**
+ * TYPEDEF
+ */
+ typedef APList < ExecutionContext * > APListOfExecutionContext;
+
+public:
+ typedef APListOfExecutionContext::iterator rw_child_iterator;
+
+ typedef APListOfExecutionContext::const_iterator child_iterator;
+
+
+ /**
+ * ATTRIBUTES
+ */
+ ExecutionContext * mContainer;
+ APListOfExecutionContext mChildContexts;
+
+ BF mHeader;
+
+ APExecutionData mExecutionData;
+
+ BF mNodeCondition;
+ BF mNodeTimedCondition;
+
+ BF mRunnableElementTrace;
+ BF mIOElementTrace;
+
+ TableOfRuntimeFormState::TableOfAssignedFlag mTableOfAssignedFlag;
+
+ BF mInformation;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ExecutionContext()
+ : Element( CLASS_KIND_T( ExecutionContext ) ),
+ mContainer( NULL ),
+ mChildContexts( ),
+ mHeader(),
+ mExecutionData( ),
+ mNodeCondition( ),
+ mNodeTimedCondition( ),
+ mRunnableElementTrace( ),
+ mIOElementTrace( ),
+ mTableOfAssignedFlag( NULL ),
+ mInformation( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ ExecutionContext(const ExecutionContext & aContext)
+ : Element( aContext ),
+ mContainer( aContext.mContainer ),
+ mChildContexts( aContext.mChildContexts ),
+
+ mHeader( aContext.mHeader ),
+ mExecutionData( aContext.mExecutionData ),
+ mNodeCondition( aContext.mNodeCondition ),
+ mNodeTimedCondition( aContext.mNodeTimedCondition ),
+ mRunnableElementTrace( aContext.mRunnableElementTrace ),
+ mIOElementTrace( aContext.mIOElementTrace ),
+ mTableOfAssignedFlag( aContext.mTableOfAssignedFlag ),
+ mInformation( aContext.mInformation )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Others
+ */
+ ExecutionContext(APExecutionData & anExecutionData,
+ avm_uint32_t aHeight, avm_uint32_t aWidth)
+ : Element( CLASS_KIND_T( ExecutionContext ) ),
+ mContainer( NULL ),
+ mChildContexts( ),
+
+ mHeader( new ExecutionContextHeader(aHeight , aWidth) ),
+ mExecutionData( anExecutionData ),
+ mNodeCondition( anExecutionData->getNodeCondition() ),
+ mNodeTimedCondition( anExecutionData->getNodeTimedCondition() ),
+ mRunnableElementTrace( anExecutionData->getRunnableElementTrace() ),
+ mIOElementTrace( anExecutionData->getIOElementTrace() ),
+ mTableOfAssignedFlag( anExecutionData->getTableOfAssignedFlag() ),
+ mInformation( )
+ {
+ anExecutionData->setExecutionContext( this );
+ }
+
+ ExecutionContext(const ExecutionContext & aContainer,
+ APExecutionData & anExecutionData,
+ avm_uint32_t aHeight, avm_uint32_t aWidth)
+ : Element( CLASS_KIND_T( ExecutionContext ) ),
+ mContainer( const_cast< ExecutionContext * >(& aContainer) ),
+ mChildContexts( ),
+
+ mHeader( new ExecutionContextHeader(aHeight , aWidth) ),
+ mExecutionData( anExecutionData ),
+ mNodeCondition( anExecutionData->getNodeCondition() ),
+ mNodeTimedCondition( anExecutionData->getNodeTimedCondition() ),
+ mRunnableElementTrace( anExecutionData->getRunnableElementTrace() ),
+ mIOElementTrace( anExecutionData->getIOElementTrace() ),
+ mTableOfAssignedFlag( anExecutionData->getTableOfAssignedFlag() ),
+ mInformation( )
+ {
+ anExecutionData->setExecutionContext( this );
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ExecutionContext()
+ {
+ if( hasContainer() )
+ {
+ //getContainer()->remove(this);
+ }
+ }
+
+ inline void destroy()
+ {
+ mChildContexts.clear();
+
+ mHeader.destroy();
+
+ mExecutionData.destroy();
+
+ mNodeCondition.destroy();
+ mNodeTimedCondition.destroy();
+
+ mRunnableElementTrace.destroy();
+ mIOElementTrace.destroy();
+
+ mInformation.destroy();
+ }
+
+ /**
+ * _NULL_
+ */
+ inline bool isNull() const
+ {
+ return( this == (& ExecutionContext::_NULL_) );
+ }
+
+ inline bool isnotNull() const
+ {
+ return( this != (& ExecutionContext::_NULL_) );
+ }
+
+ /**
+ * cast to reference
+ */
+ inline static const ExecutionContext & REF(const ExecutionContext * anEC)
+ {
+ return( ( anEC != NULL ) ? (* anEC) : ExecutionContext::_NULL_ );
+ }
+
+ /**
+ * GETTER - SETTER
+ * mContainer
+ */
+ inline ExecutionContext * getContainer() const
+ {
+ return( mContainer );
+ }
+
+ inline const ExecutionContext & refContainer() const
+ {
+ return( * mContainer );
+ }
+
+
+ inline bool hasContainer() const
+ {
+ return( mContainer != NULL );
+ }
+
+ inline void setContainer(ExecutionContext * anEC)
+ {
+ mContainer = anEC;
+ }
+
+
+ /**
+ * CLONE
+ */
+ inline virtual ExecutionContext * cloneData() const
+ {
+ ExecutionContext * mCloneEC = new ExecutionContext( *this );
+ mCloneEC->getAPExecutionData().makeWritable();
+
+ return( mCloneEC );
+ }
+
+
+ /**
+ * INITIALIZATION with EXECUTION DATA / CONTEXT
+ */
+ inline void initialize(const ExecutionContext & anInitialContext)
+ {
+ mContainer = anInitialContext.mContainer;
+ mChildContexts = anInitialContext.mChildContexts;
+
+ mHeader = anInitialContext.mHeader;
+ mExecutionData = anInitialContext.mExecutionData;
+
+ mNodeCondition = anInitialContext.mNodeCondition;
+ mNodeTimedCondition = anInitialContext.mNodeTimedCondition;
+
+ mRunnableElementTrace = anInitialContext.mRunnableElementTrace;
+ mIOElementTrace = anInitialContext.mIOElementTrace;
+
+ mTableOfAssignedFlag = anInitialContext.mTableOfAssignedFlag;
+
+ mInformation = anInitialContext.mInformation;
+ }
+
+ inline void initialize(const APExecutionData & anInitialData,
+ avm_uint32_t aHeight = 0, avm_uint32_t aWidth = 1)
+ {
+ mContainer = NULL;
+
+ mHeader = new ExecutionContextHeader(aHeight, aWidth);
+ mExecutionData = anInitialData;
+
+ if( anInitialData.valid() )
+ {
+ mNodeCondition = anInitialData->getNodeCondition();
+ mNodeTimedCondition = anInitialData->getNodeTimedCondition();
+
+ mRunnableElementTrace = anInitialData->getRunnableElementTrace();
+ mIOElementTrace = anInitialData->getIOElementTrace();
+
+ mTableOfAssignedFlag = anInitialData->getTableOfAssignedFlag();
+ }
+ }
+
+
+ /**
+ * RESET DATA BEFORE EVALUATION
+ */
+ inline void resetDataBeforeEvaluation()
+ {
+ mExecutionData->setNodeCondition( ExpressionConstant::BOOLEAN_TRUE );
+ mExecutionData->setNodeTimedCondition( ExpressionConstant::BOOLEAN_TRUE );
+
+ mExecutionData->setRunnableElementTrace( BF::REF_NULL );
+ mExecutionData->setIOElementTrace( BF::REF_NULL );
+
+ // Due to basic pointer, not smart pointer
+ mTableOfAssignedFlag = mExecutionData->getTableOfAssignedFlag();
+ mExecutionData->setTableOfAssignedFlag( NULL );
+ }
+
+
+ /**
+ * RESTORE DATA AFTER EVALUATION
+ */
+ inline void restoreDataAfterEvaluation()
+ {
+ mExecutionData->setNodeCondition( mNodeCondition );
+ mExecutionData->setNodeTimedCondition( mNodeTimedCondition );
+
+ mExecutionData->setRunnableElementTrace( mRunnableElementTrace );
+ mExecutionData->setIOElementTrace( mIOElementTrace );
+
+ mExecutionData->setTableOfAssignedFlag( mTableOfAssignedFlag );
+ }
+
+
+
+ /**
+ * GETTER
+ * mChildContexts
+ * Iterators
+ */
+ inline rw_child_iterator begin()
+ {
+ return( mChildContexts.begin() );
+ }
+
+ inline rw_child_iterator end()
+ {
+ return( mChildContexts.end() );
+ }
+
+ inline rw_child_iterator eraseChildContext(
+ const rw_child_iterator & itChildCtx)
+ {
+ return( mChildContexts.erase( itChildCtx ) );
+ }
+
+
+ inline child_iterator begin() const
+ {
+ return( mChildContexts.begin() );
+ }
+
+ inline child_iterator end() const
+ {
+ return( mChildContexts.end() );
+ }
+
+
+ /**
+ * GETTER
+ * mChildContexts
+ */
+ inline ExecutionContext * firstChildContext() const
+ {
+ return( mChildContexts.first() );
+ }
+
+ inline ExecutionContext * lastChildContext() const
+ {
+ return( mChildContexts.last() );
+ }
+
+
+ inline bool hasChildContext() const
+ {
+ return( mChildContexts.nonempty() );
+ }
+
+ inline bool noChildContext() const
+ {
+ return( mChildContexts.empty() );
+ }
+
+ inline bool populatedChildContext() const
+ {
+ return( mChildContexts.populated() );
+ }
+
+ inline bool singleChildContext() const
+ {
+ return( mChildContexts.singleton() );
+ }
+
+
+ inline bool isLeafNode() const
+ {
+ return( mChildContexts.empty() );
+ }
+
+ inline avm_size_t size() const
+ {
+ return( mChildContexts.size() );
+ }
+
+
+ /**
+ * SETTER
+ * mChildContexts
+ */
+ inline void appendChildContext(ExecutionContext * anEC)
+ {
+ mChildContexts.append( anEC );
+ }
+
+ inline void clearChildContext()
+ {
+ mChildContexts.clear();
+ }
+
+ inline void popLastChildContextTo(ExecutionContext * & anEC)
+ {
+ mChildContexts.pop_last_to( anEC );
+ }
+
+ inline void removeChildContext(ExecutionContext * anEC)
+ {
+ mChildContexts.remove( anEC );
+ }
+
+
+
+ inline APListOfExecutionContext & getNext()
+ {
+ return( mChildContexts );
+ }
+
+ inline bool hasNext() const
+ {
+ return( mChildContexts.nonempty() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mHeader
+ */
+ inline const BF & getHeader() const
+ {
+ return( mHeader );
+ }
+
+ inline ExecutionContextHeader * rawHeader() const
+ {
+ return( mHeader.to_ptr< ExecutionContextHeader >() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * Container
+ */
+ inline bool isRoot() const
+ {
+ return( not hasContainer() );
+ }
+
+ inline bool isnotRoot() const
+ {
+ return( hasContainer() );
+ }
+
+
+ inline ExecutionContext * getPrevious() const
+ {
+ return( getContainer() );
+ }
+
+
+ inline APExecutionData & getPreviousExecutionData()
+ {
+ return( getContainer()->getAPExecutionData() );
+ }
+
+ inline const APExecutionData & getPreviousExecutionData() const
+ {
+ return( getContainer()->getAPExecutionData() );
+ }
+
+ inline bool hasPrevious() const
+ {
+ return( hasContainer() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mHeader trace indices
+ */
+ inline static avm_uint32_t getCreateCounter()
+ {
+ return( ExecutionContextHeader::ID_NUMBER );
+ }
+
+ inline avm_uint32_t getIdNumber() const
+ {
+ return( rawHeader()->getIdNumber() );
+ }
+
+
+ inline avm_uint32_t getEvalNumber() const
+ {
+ return( rawHeader()->getEvalNumber() );
+ }
+
+ inline bool isEvaluated() const
+ {
+ return( rawHeader()->getEvalNumber() > 0 );
+ }
+
+ inline void setEvalNumber(avm_uint32_t anEvalNumber)
+ {
+ rawHeader()->setEvalNumber(anEvalNumber);
+ }
+
+
+ inline avm_uint32_t getHeight() const
+ {
+ return( rawHeader()->getHeight() );
+ }
+
+ inline void setHeight(avm_uint32_t aHeight)
+ {
+ rawHeader()->setHeight(aHeight);
+ }
+
+
+ inline avm_uint32_t getWidth() const
+ {
+ return( rawHeader()->getWidth() );
+ }
+
+ inline void setWidth(avm_uint32_t aWidth)
+ {
+ rawHeader()->setWidth(aWidth);
+ }
+
+
+ inline avm_uint8_t getWeight() const
+ {
+ return( rawHeader()->getWeight() );
+ }
+
+ inline avm_uint32_t getStrWeight() const
+ {
+ return( rawHeader()->getStrWeight() );
+ }
+
+ inline static avm_uint8_t getWeightMax()
+ {
+ return( ExecutionContextHeader::getWeightMax() );
+ }
+
+ inline bool isWeightMax() const
+ {
+ return( rawHeader()->isWeightMax() );
+ }
+
+ inline bool isWeight(avm_uint8_t aWeight) const
+ {
+ return( rawHeader()->isWeight(aWeight) );
+ }
+
+
+ inline void setWeight(avm_uint8_t aWeight)
+ {
+ rawHeader()->setWeight(aWeight);
+ }
+
+ inline void setWeightMax()
+ {
+ rawHeader()->setWeightMax();
+ }
+
+
+ inline avm_uint32_t getPrevEvalNumber() const
+ {
+ return( isRoot() ? 0 : getContainer()->getEvalNumber() );
+ }
+
+ inline avm_uint32_t getPrevHeight() const
+ {
+ return( isRoot() ? 0 : getContainer()->getHeight() );
+ }
+
+ inline avm_uint32_t getPrevIdNumber() const
+ {
+ return( isRoot() ? 0 : getContainer()->getIdNumber() );
+ }
+
+ inline avm_uint32_t getPrevWidth() const
+ {
+ return( isRoot() ? 0 : getContainer()->getWidth() );
+ }
+
+ inline avm_uint8_t getPrevsWeight() const
+ {
+ return( isRoot() ? 0 : getContainer()->getWeight() );
+ }
+
+
+ /**
+ * LCA -LCRA
+ */
+ const ExecutionContext * LCA(const ExecutionContext * anEC) const ;
+
+ /**
+ * GETTER - SETTER
+ * mExecutionData
+ */
+ inline APExecutionData & getAPExecutionData()
+ {
+ return( mExecutionData );
+ }
+
+ inline const APExecutionData & getAPExecutionData() const
+ {
+ return( mExecutionData );
+ }
+
+ inline ExecutionData * getExecutionData() const
+ {
+ return( mExecutionData );
+ }
+
+ inline const ExecutionData & refExecutionData() const
+ {
+ return( * mExecutionData );
+ }
+
+ inline ExecutionData & rwExecutionData() const
+ {
+ return( * mExecutionData );
+ }
+
+
+ inline bool hasExecutionData() const
+ {
+ return( mExecutionData.valid() );
+ }
+
+ inline void setExecutionData(const APExecutionData & anExecutionData)
+ {
+ mExecutionData = anExecutionData;
+ }
+
+ inline void makeWritableExecutionData()
+ {
+ mExecutionData.makeWritable();
+ }
+
+
+
+ /**
+ * GETTER - SETTER
+ * mRunnableElementTrace
+ */
+ inline BF & getRunnableElementTrace()
+ {
+ return( mRunnableElementTrace );
+ }
+
+ inline const BF & getRunnableElementTrace() const
+ {
+ return( mRunnableElementTrace );
+ }
+
+ inline bool hasRunnableElementTrace() const
+ {
+ return( mRunnableElementTrace.valid() );
+ }
+
+ inline void setRunnableElementTrace(const BF & aRunnableElementTrace)
+ {
+ mRunnableElementTrace = aRunnableElementTrace;
+ }
+
+
+ /**
+ * GETTER
+ * tableOfRuntimeFormState
+ */
+
+ bool checkRunningForm(const RuntimeID & aRID)
+ {
+ return( getAPExecutionData()->checkRunningForm(
+ getRunnableElementTrace(), aRID) );
+ }
+
+
+ /**
+ * GETTER
+ * mTableOfAssignedFlag
+ */
+ TableOfRuntimeFormState::TableOfAssignedFlag getTableOfAssignedFlag() const
+ {
+ return( mTableOfAssignedFlag );
+ }
+
+ void setTableOfAssignedFlag(
+ TableOfRuntimeFormState::TableOfAssignedFlag aTableOfAssignedFlag)
+ {
+ mTableOfAssignedFlag = aTableOfAssignedFlag;
+ }
+
+
+
+ /**
+ * GETTER
+ * mNodeCondition && mNodeTimedCondition
+ */
+ inline BF getAllNodeCondition() const
+ {
+ return( ExpressionConstructor::andExpr(
+ mNodeCondition, mNodeTimedCondition) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mNodeCondition
+ */
+ inline BF & getNodeCondition()
+ {
+ return( mNodeCondition );
+ }
+
+ inline const BF & getNodeCondition() const
+ {
+ return( mNodeCondition );
+ }
+
+ inline bool hasNodeCondition() const
+ {
+ return( mNodeCondition.valid() );
+ }
+
+ inline void setNodeCondition(const BF & aCondition)
+ {
+ mNodeCondition = aCondition;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mNodeTimedCondition
+ */
+ inline BF & getNodeTimedCondition()
+ {
+ return( mNodeTimedCondition );
+ }
+
+ inline const BF & getNodeTimedCondition() const
+ {
+ return( mNodeTimedCondition );
+ }
+
+ inline bool hasNodeTimedCondition() const
+ {
+ return( mNodeTimedCondition.valid() );
+ }
+
+ inline void setNodeTimedCondition(const BF & aTimedCondition)
+ {
+ mNodeTimedCondition = aTimedCondition;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mIOElementTrace
+ */
+ inline BF & getIOElementTrace()
+ {
+ return( mIOElementTrace );
+ }
+
+ inline const BF & getIOElementTrace() const
+ {
+ return( mIOElementTrace );
+ }
+
+ inline bool hasIOElementTrace() const
+ {
+ return( mIOElementTrace.valid() );
+ }
+
+ inline void setIOElementTrace(const BF & anIOElementTrace)
+ {
+ mIOElementTrace = anIOElementTrace;
+ }
+
+
+ /**
+ * GETTER - SETTER - TESTER
+ * mInformation
+ */
+ inline void addInfo(
+ const AbstractProcessorUnit & aProcessor, const BF & aData)
+ {
+ getUniqInformation()->addInfo(aProcessor, aData);
+ }
+
+ inline void addInfo(const AbstractProcessorUnit & aProcessor,
+ const BF & anID, const BF & aData)
+ {
+ getUniqInformation()->addInfo(aProcessor, anID, aData);
+ }
+
+ inline static void addInfo(ListOfExecutionContext & listOfEC,
+ const AbstractProcessorUnit & aProcessor, const BF & aData)
+ {
+ ListOfExecutionContext::iterator it = listOfEC.begin();
+ ListOfExecutionContext::iterator itEnd = listOfEC.end();
+ for( ; it != itEnd ; ++it )
+ {
+ (*it)->addInfo(aProcessor,aData);
+ }
+ }
+
+ inline GenericInfoData * getInfo(
+ const AbstractProcessorUnit & aProcessor, const BF & anID) const
+ {
+ return( mInformation.invalid() ? NULL :
+ mInformation.to_ptr< ExecutionInformation >()->
+ getInfo(aProcessor, anID) );
+ }
+
+
+ inline const BF & getInfoData(
+ const IProcessorUnitRegistration & aRegisterTool) const
+ {
+ return( mInformation.invalid() ? BF::REF_NULL :
+ mInformation.to_ptr< ExecutionInformation >()->
+ getInfoData(aRegisterTool) );
+ }
+
+ inline const BF & getInfoData(const AbstractProcessorUnit & aProcessor) const
+ {
+ return( mInformation.invalid() ? BF::REF_NULL :
+ mInformation.to_ptr< ExecutionInformation >()->
+ getInfoData(aProcessor) );
+ }
+
+ inline const BF & getInfoData(
+ const AbstractProcessorUnit & aProcessor, const BF & anID) const
+ {
+ return( mInformation.invalid() ? BF::REF_NULL :
+ mInformation.to_ptr< ExecutionInformation >()->
+ getInfoData(aProcessor, anID) );
+ }
+
+
+ inline const BFList & getInfos() const
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mInformation )
+ << "Execution Information !!!"
+ << SEND_EXIT;
+
+ return( getInformation()->getInfos() );
+ }
+
+ inline bool hasInfo() const
+ {
+ return( mInformation.valid() &&
+ mInformation.to_ptr< ExecutionInformation >()->hasInfo() );
+ }
+
+ inline bool hasInfo(const AbstractProcessorUnit & aProcessor) const
+ {
+ return( mInformation.valid() && mInformation.to_ptr<
+ ExecutionInformation >()->hasInfo(aProcessor) );
+ }
+
+ inline bool noneInfo(const AbstractProcessorUnit & aProcessor) const
+ {
+ return( mInformation.invalid() || mInformation.to_ptr<
+ ExecutionInformation >()->noneInfo(aProcessor) );
+ }
+
+ inline bool hasInfo(
+ const AbstractProcessorUnit & aProcessor, const BF & anID) const
+ {
+ return( mInformation.valid() && mInformation.to_ptr<
+ ExecutionInformation >()-> hasInfo(aProcessor, anID) );
+ }
+
+
+ inline bool hasInfoWithData(
+ const AbstractProcessorUnit & aProcessor, const BF & aData) const
+ {
+ return( mInformation.valid() && mInformation.to_ptr<
+ ExecutionInformation >()->hasInfoWithData(aProcessor, aData) );
+ }
+
+ inline bool hasInfo(const BF & anID) const
+ {
+ return( mInformation.valid() &&
+ mInformation.to_ptr< ExecutionInformation >()->hasInfo(anID) );
+ }
+
+ inline bool hasInfo(Element * anID) const
+ {
+ return( mInformation.valid() &&
+ mInformation.to_ptr< ExecutionInformation >()->hasInfo(anID) );
+ }
+
+
+ inline ExecutionInformation * getUniqInformation()
+ {
+ if( not hasInformation() )
+ {
+ mInformation.setPointer( new ExecutionInformation() );
+ }
+ return( mInformation.to_ptr< ExecutionInformation >() );
+ }
+
+ inline ExecutionInformation * getInformation() const
+ {
+ return( mInformation.to_ptr< ExecutionInformation >() );
+ }
+
+ inline bool hasInformation() const
+ {
+ return( mInformation.valid() );
+ }
+
+ inline void setInformation(ExecutionInformation * anInformation)
+ {
+ mInformation.setPointer( anInformation );
+ }
+
+
+ /**
+ * Serialization
+ */
+ void toDebug(OutStream & out) const;
+
+ void toDebugFet(OutStream & out) const;
+
+
+ template< class OS_T >
+ OS_T & osStrPosition(OS_T & out) const
+ {
+ out << "Id:" /*<< std::setw(4)*/ << getIdNumber();
+
+ out << " PE:";
+ if ( hasContainer() )
+ {
+ out /*<< std::setw(4)*/ << getContainer()->getEvalNumber();
+ }
+ else
+ {
+ out << "ROOT";
+ }
+
+ out << " H:" /*<< std::setw(4)*/ << getHeight()
+ << " W:" /*<< std::setw(4)*/ << getWidth()
+ << " Q:" /*<< std::setw(2)*/ << getStrWeight();
+
+ return( out );
+ }
+
+
+ inline virtual std::string str() const
+ {
+ return( osStrPosition( OSS() << "EC< " ) << " > "
+ << refExecutionData().strStateConf() );
+ }
+
+ virtual void toStream(OutStream & out) const;
+
+ virtual void toFscn(OutStream & out,
+ const ExecutionData * aPreviousExecData) const;
+
+ std::string str_min() const;
+ std::string str_position() const;
+
+ void traceMinimum(OutStream & out) const;
+ void traceDefault(OutStream & out) const;
+ void debugDefault(OutStream & out) const;
+
+
+ static void traceMinimum(OutStream & out,
+ ListOfExecutionContext & listofEC, const std::string & header = "");
+
+ static void traceMinimum(OutStream & out,
+ VectorOfExecutionContext & listofEC, const std::string & header = "");
+
+
+ static void traceDefault(OutStream & out,
+ ListOfExecutionContext & listofEC, const std::string & header = "");
+
+ static void traceDefault(OutStream & out,
+ VectorOfExecutionContext & listofEC, const std::string & header = "");
+
+ static void debugDefault(OutStream & out,
+ ListOfExecutionContext & listofEC, const std::string & header = "");
+
+ static void debugDefault(OutStream & out,
+ VectorOfExecutionContext & listofEC, const std::string & header = "");
+
+
+ void writeTraceAfterExec(OutStream & out) const;
+ void traceDefaultPostEval(OutStream & out) const;
+
+ inline void traceDefaultEval(OutStream & out) const
+ {
+ traceDefault(out);
+ if( hasNext() )
+ {
+ traceDefaultPostEval(out);
+ }
+ }
+
+
+ void writeTraceBeforeExec(OutStream & out) const;
+
+ void writeTraceForDeadlock(OutStream & out,
+ avm_uint32_t nDeadlockCounter) const;
+
+ void writeTraceForRedundancy(OutStream & out,
+ ExecutionContext * aRedundantExecContext,
+ avm_uint32_t nRedundancyCounter) const;
+
+};
+
+
+} /* namespace sep */
+
+#endif /*EXECUTIONCONTEXT_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/ExecutionContextFlags.cpp b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionContextFlags.cpp
new file mode 100644
index 0000000..e7df668
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionContextFlags.cpp
@@ -0,0 +1,179 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 avr. 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#include "ExecutionContextFlags.h"
+
+#include <sstream>
+
+namespace sep
+{
+
+/**
+ * Default Separator
+ */
+std::string ExecutionContextFlags::SEPARATOR = " & ";
+
+
+/**
+ * REACHED LIMIT to STRING
+ */
+std::string ExecutionContextFlags::strReachedLimit(
+ bit_field_t reachedLimit, const std::string & separator)
+{
+ if( (reachedLimit != REACHED_UNDEFINED_LIMIT) )
+ {
+ std::ostringstream oss;
+
+ oss << "REACHED-";
+
+ if( (reachedLimit & REACHED_NODE_HEIGHT_LIMIT) != 0 )
+ {
+ oss << "NODE-HEIGHT-";
+ }
+ if( (reachedLimit & REACHED_NODE_WIDTH_LIMIT) != 0 )
+ {
+ oss << "NODE-WIDTH-";
+ }
+ if( (reachedLimit & REACHED_NODE_COUNT_LIMIT) != 0 )
+ {
+ oss << "NODE-COUNT-";
+ }
+ if( (reachedLimit & REACHED_SYMBEX_STEP_LIMIT) != 0 )
+ {
+ oss << "SYMBEX-STEP-";
+ }
+
+ oss << "LIMIT" << separator;
+
+ return( oss.str() );
+ }
+
+ return( "" /*"<limit:unreached>"*/ );
+}
+
+
+/**
+ * INTERRUPT REQUEST to STRING
+ */
+std::string ExecutionContextFlags::strInterruptRequest(
+ bit_field_t interruptRequest, const std::string & separator)
+{
+ switch( interruptRequest )
+ {
+ case INTERRUPT_UNDEFINED_REQUEST:
+ return( "" );
+// return( "<interrupt:undef>" + separator );
+
+ case INTERRUPT_FAM_REQUEST:
+ return( "FAM_IRQ" + separator );
+
+ case INTERRUPT_USER_REQUEST:
+ return( "USER_IRQ" + separator );
+
+ default:
+ return( "<interrupt:unknown>" + separator );
+ }
+}
+
+
+/**
+ * EXECUTION TRACE to STRING
+ */
+std::string ExecutionContextFlags::strExecutionTrace(
+ bit_field_t executionTrace, const std::string & separator)
+{
+ switch( executionTrace )
+ {
+ case EXECUTION_UNDEFINED_TRACE:
+ return( "" );
+// return( "<component:undef>" + separator );
+
+ case EXECUTION_DEADLOCK_TRACE:
+ return( "DEADLOCK" + separator );
+
+ case EXECUTION_TRIVIAL_LOOP_TRACE:
+ return( "TRIVIAL-LOOP" + separator );
+
+ case EXECUTION_LIVELOCK_TRACE:
+ return( "LIVELOCK" + separator );
+
+ case EXECUTION_REDUNDANCY_TRACE:
+ return( "REDUNDANCY-LEAF" + separator );
+
+ case EXECUTION_REDUNDANCY_TARGET_TRACE:
+ return( "REDUNDANCY-TARGET" + separator );
+
+ case EXECUTION_STATEMENT_EXIT_TRACE:
+ return( "STATEMENT-EXIT" + separator );
+
+ case EXECUTION_FATAL_ERROR_TRACE:
+ return( "FATAL-ERROR" + separator );
+
+ case EXECUTION_SYMBEX_LIMIT_TRACE:
+ return( "SYMBEX-LIMITATION" + separator );
+
+ case EXECUTION_EXCEPTION_TRACE:
+ return( "EXCEPTION" + separator );
+
+ case EXECUTION_STEP_MARK_TRACE:
+ return( "STEP-MARK" + separator );
+
+ default:
+ return( "<execution:unknown>" + separator );
+ }
+}
+
+
+/**
+ * ANALYSIS TRACE to STRING
+ */
+std::string ExecutionContextFlags::strAnalysisTrace(
+ bit_field_t analysisTrace, const std::string & separator)
+{
+ if( analysisTrace != FAM_UNDEFINED_TRACE )
+ {
+ std::ostringstream oss;
+
+ if( (analysisTrace & FAM_COVERAGE_ELEMENT_TRACE) != 0 )
+ {
+ oss << "COVERAGE-ELEMENT" << separator;
+ }
+
+ if( (analysisTrace & FAM_OBJECTIVE_ACHIEVED_TRACE) != 0 )
+ {
+ oss << "OBJECTIVE-ACHIEVED" << separator;
+ }
+
+ if( (analysisTrace & FAM_OBJECTIVE_FAILED_TRACE) != 0 )
+ {
+ oss << "OBJECTIVE-FAILED" << separator;
+ }
+
+ if( (analysisTrace & FAM_OBJECTIVE_ABORTED_TRACE) != 0 )
+ {
+ oss << "OBJECTIVE-ABORTED" << separator;
+ }
+
+ return( oss.str() );
+ }
+
+ return( "" );
+// return( "<analysis:undef>" + separator );
+}
+
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/ExecutionContextFlags.h b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionContextFlags.h
new file mode 100644
index 0000000..bd0ac67
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionContextFlags.h
@@ -0,0 +1,1029 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 avr. 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#ifndef FML_RUNTIME_EXECUTIONCONTEXTFLAGS_H_
+#define FML_RUNTIME_EXECUTIONCONTEXTFLAGS_H_
+
+#include <util/avm_string.h>
+
+
+namespace sep
+{
+
+struct ExecutionContextFlags
+{
+
+ /**
+ * REACHED_LIMIT
+ * 4 bits
+ */
+ enum REACHED_LIMIT
+ {
+ REACHED_UNDEFINED_LIMIT = 0x00,
+
+ REACHED_NODE_HEIGHT_LIMIT = 0x01,
+
+ REACHED_NODE_WIDTH_LIMIT = 0x02,
+
+ REACHED_NODE_COUNT_LIMIT = 0x04,
+
+ REACHED_SYMBEX_STEP_LIMIT = 0x08,
+
+ };
+
+ /**
+ * INTERRUPT_REQUEST
+ * 2 bits
+ */
+ enum INTERRUPT_REQUEST
+ {
+ INTERRUPT_UNDEFINED_REQUEST = 0x00,
+
+ INTERRUPT_FAM_REQUEST = 0x01,
+
+ INTERRUPT_USER_REQUEST = 0x02,
+
+ };
+
+ /**
+ * EXECUTION_TRACE
+ * 4 bits
+ */
+ enum EXECUTION_TRACE
+ {
+ EXECUTION_UNDEFINED_TRACE = 0x00,
+
+ EXECUTION_DEADLOCK_TRACE = 0x01,
+
+ EXECUTION_TRIVIAL_LOOP_TRACE = 0x02,
+
+ EXECUTION_LIVELOCK_TRACE = 0x03,
+
+ EXECUTION_REDUNDANCY_TRACE = 0x04,
+
+ EXECUTION_REDUNDANCY_TARGET_TRACE = 0x05,
+
+ EXECUTION_STATEMENT_EXIT_TRACE = 0x06,
+
+ EXECUTION_FATAL_ERROR_TRACE = 0x07,
+
+ EXECUTION_SYMBEX_LIMIT_TRACE = 0x08,
+
+ EXECUTION_EXCEPTION_TRACE = 0x09,
+
+ EXECUTION_STEP_MARK_TRACE = 0x0A
+
+ };
+
+ /**
+ * FORMAL ANALYSIS MODULE as FAM_TRACE
+ * 3 bits
+ */
+ enum FAM_TRACE
+ {
+ FAM_UNDEFINED_TRACE = 0x00,
+
+ FAM_COVERAGE_ELEMENT_TRACE = 0x01,
+
+ FAM_OBJECTIVE_ACHIEVED_TRACE = 0x02,
+
+ FAM_OBJECTIVE_FAILED_TRACE = 0x04,
+
+ FAM_OBJECTIVE_ABORTED_TRACE = 0x08,
+
+ };
+
+
+
+ /**
+ * TYPEDEF
+ */
+ typedef unsigned short bit_field_t;
+
+ /**
+ * BIT FIELDS
+ */
+ bit_field_t limit : 4;
+
+ bit_field_t interrupt : 2;
+
+ bit_field_t execution : 4;
+
+ bit_field_t analysis : 4;
+
+
+
+ /**
+ * CONSTRUCTORS
+ */
+ ExecutionContextFlags()
+ : limit( REACHED_UNDEFINED_LIMIT ),
+ interrupt( INTERRUPT_UNDEFINED_REQUEST ),
+ execution( EXECUTION_UNDEFINED_TRACE ),
+ analysis( FAM_UNDEFINED_TRACE )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ ~ExecutionContextFlags()
+ {
+ //!! NOTHING
+ }
+
+
+
+ /**
+ * TESTER - SETTER
+ */
+ inline bool isDefined() const
+ {
+ return( (limit != REACHED_UNDEFINED_LIMIT )
+ || (interrupt != EXECUTION_UNDEFINED_TRACE)
+ || (execution != EXECUTION_UNDEFINED_TRACE)
+ || (analysis != EXECUTION_UNDEFINED_TRACE ) );
+ }
+
+ inline bool hasReachedLimitOrExecutionTrace() const
+ {
+ return( (limit != REACHED_UNDEFINED_LIMIT )
+ || (execution != EXECUTION_UNDEFINED_TRACE) );
+ }
+
+ inline bool isUndefined() const
+ {
+ return( (limit == REACHED_UNDEFINED_LIMIT )
+ && (interrupt == EXECUTION_UNDEFINED_TRACE)
+ && (execution == EXECUTION_UNDEFINED_TRACE)
+ && (analysis == EXECUTION_UNDEFINED_TRACE ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // REACHED LIMIT
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * GETTER - SETTER
+ * limit
+ */
+ inline REACHED_LIMIT getReachedLimit() const
+ {
+ return( static_cast< REACHED_LIMIT >( limit ) );
+ }
+
+ inline bool hasReachedLimit() const
+ {
+ return( limit != REACHED_UNDEFINED_LIMIT );
+ }
+
+ inline bool noneReachedLimit() const
+ {
+ return( limit == REACHED_UNDEFINED_LIMIT );
+ }
+
+ inline bool isReachedLimit(REACHED_LIMIT reachedLimit) const
+ {
+ return( limit == reachedLimit );
+ }
+
+ inline ExecutionContextFlags & addReachedLimit(REACHED_LIMIT reachedLimit)
+ {
+ limit |= reachedLimit;
+
+ return( *this );
+ }
+
+ inline ExecutionContextFlags & remReachedLimit(REACHED_LIMIT reachedLimit)
+ {
+ limit &= (~ reachedLimit);
+
+ return( *this );
+ }
+
+ inline ExecutionContextFlags & setReachedLimit(REACHED_LIMIT reachedLimit)
+ {
+ limit = reachedLimit;
+
+ return( *this );
+ }
+
+ inline ExecutionContextFlags & unsetReachedLimit()
+ {
+ limit = REACHED_UNDEFINED_LIMIT;
+
+ return( *this );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * "node height" limit
+ */
+ inline bool isReachedNodeHeightLimit() const
+ {
+ return( limit == REACHED_NODE_HEIGHT_LIMIT );
+ }
+
+ inline bool hasReachedNodeHeightLimit() const
+ {
+ return( (limit & REACHED_NODE_HEIGHT_LIMIT) != 0 );
+ }
+
+ inline ExecutionContextFlags & addReachedNodeHeightLimit()
+ {
+ limit |= REACHED_NODE_HEIGHT_LIMIT;
+
+ return( *this );
+ }
+
+ inline ExecutionContextFlags & setReachedNodeHeightLimit()
+ {
+ limit = REACHED_NODE_HEIGHT_LIMIT;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "node width" limit
+ */
+ inline bool isReachedNodeWidthLimit() const
+ {
+ return( limit == REACHED_NODE_WIDTH_LIMIT );
+ }
+
+ inline bool hasReachedNodeWidthLimit() const
+ {
+ return( (limit & REACHED_NODE_WIDTH_LIMIT) != 0 );
+ }
+
+ inline ExecutionContextFlags & addReachedNodeWidthLimit()
+ {
+ limit |= REACHED_NODE_WIDTH_LIMIT;
+
+ return( *this );
+ }
+
+ inline ExecutionContextFlags & setReachedNodeWidthLimit()
+ {
+ limit = REACHED_NODE_WIDTH_LIMIT;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "node count" limit
+ */
+ inline bool isReachedNodeCountLimit() const
+ {
+ return( limit == REACHED_NODE_COUNT_LIMIT );
+ }
+
+ inline bool hasReachedNodeCountLimit() const
+ {
+ return( (limit & REACHED_NODE_COUNT_LIMIT) != 0 );
+ }
+
+ inline ExecutionContextFlags & addReachedNodeCountLimit()
+ {
+ limit |= REACHED_NODE_COUNT_LIMIT;
+
+ return( *this );
+ }
+
+ inline ExecutionContextFlags & setReachedNodeCountLimit()
+ {
+ limit = REACHED_NODE_COUNT_LIMIT;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "execution step" limit
+ */
+ inline bool isReachedSymbexStepLimit() const
+ {
+ return( limit == REACHED_SYMBEX_STEP_LIMIT );
+ }
+
+ inline bool hasReachedSymbexStepLimit() const
+ {
+ return( (limit & REACHED_SYMBEX_STEP_LIMIT) != 0 );
+ }
+
+
+ inline ExecutionContextFlags & addReachedSymbexStepLimit()
+ {
+ limit |= REACHED_SYMBEX_STEP_LIMIT;
+
+ return( *this );
+ }
+
+ inline ExecutionContextFlags & setReachedSymbexStepLimit()
+ {
+ limit = REACHED_SYMBEX_STEP_LIMIT;
+
+ return( *this );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // REACHED LIMIT
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * GETTER - SETTER
+ * interrupt
+ */
+ inline INTERRUPT_REQUEST getInterruptRequest() const
+ {
+ return( static_cast< INTERRUPT_REQUEST >( interrupt ) );
+ }
+
+ inline bool hasInterruptRequest() const
+ {
+ return( interrupt != REACHED_UNDEFINED_LIMIT );
+ }
+
+ inline bool noneInterruptRequest() const
+ {
+ return( interrupt == REACHED_UNDEFINED_LIMIT );
+ }
+
+ inline bool isInterruptRequest(INTERRUPT_REQUEST interruptRequest) const
+ {
+ return( interrupt == interruptRequest );
+ }
+
+ inline ExecutionContextFlags & setInterruptRequest(
+ INTERRUPT_REQUEST interruptRequest)
+ {
+ interrupt = interruptRequest;
+
+ return( *this );
+ }
+
+ inline ExecutionContextFlags & unsetInterruptRequest()
+ {
+ interrupt = REACHED_UNDEFINED_LIMIT;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "formal analysis module" as "fam" request
+ */
+ inline bool isInterruptModuleRequest() const
+ {
+ return( interrupt == INTERRUPT_FAM_REQUEST );
+ }
+
+ inline ExecutionContextFlags & setInterruptModuleRequest()
+ {
+ interrupt = INTERRUPT_FAM_REQUEST;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "fam" request
+ */
+ inline bool isInterruptUserRequest() const
+ {
+ return( interrupt == INTERRUPT_USER_REQUEST );
+ }
+
+ inline ExecutionContextFlags & setInterruptUserRequest()
+ {
+ interrupt = INTERRUPT_USER_REQUEST;
+
+ return( *this );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // EXECUTION TRACE
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * GETTER - SETTER
+ * execution
+ */
+ inline EXECUTION_TRACE getExecutionTrace() const
+ {
+ return( static_cast< EXECUTION_TRACE >( execution ) );
+ }
+
+ inline bool hasExecutionTrace() const
+ {
+ return( execution != EXECUTION_UNDEFINED_TRACE );
+ }
+
+ inline bool noneExecutionTrace() const
+ {
+ return( execution == EXECUTION_UNDEFINED_TRACE );
+ }
+
+ inline bool isExecutionTrace(EXECUTION_TRACE reachedLimit) const
+ {
+ return( execution == reachedLimit );
+ }
+
+ inline ExecutionContextFlags & addExecutionTrace(EXECUTION_TRACE reachedLimit)
+ {
+ execution |= reachedLimit;
+
+ return( *this );
+ }
+
+ inline ExecutionContextFlags & remExecutionTrace(EXECUTION_TRACE reachedLimit)
+ {
+ execution &= (~ reachedLimit);
+
+ return( *this );
+ }
+
+ inline ExecutionContextFlags & setExecutionTrace(EXECUTION_TRACE reachedLimit)
+ {
+ execution = reachedLimit;
+
+ return( *this );
+ }
+
+ inline ExecutionContextFlags & unsetExecutionTrace()
+ {
+ execution = EXECUTION_UNDEFINED_TRACE;
+
+ return( *this );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * "deadlock" execution
+ */
+ inline bool isExecutionDeadlockTrace() const
+ {
+ return( execution == EXECUTION_DEADLOCK_TRACE );
+ }
+
+ inline ExecutionContextFlags & setExecutionDeadlockTrace()
+ {
+ execution = EXECUTION_DEADLOCK_TRACE;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "trivial_loop" execution
+ */
+ inline bool isExecutionTrivialLoopTrace() const
+ {
+ return( execution == EXECUTION_TRIVIAL_LOOP_TRACE );
+ }
+
+ inline ExecutionContextFlags & setExecutionTrivialLoopTrace()
+ {
+ execution = EXECUTION_TRIVIAL_LOOP_TRACE;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "livelock" execution
+ */
+ inline bool isExecutionLivelockTrace() const
+ {
+ return( execution == EXECUTION_LIVELOCK_TRACE );
+ }
+
+ inline ExecutionContextFlags & setExecutionLivelockTrace()
+ {
+ execution = EXECUTION_LIVELOCK_TRACE;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "redundancy" execution
+ */
+ inline bool isExecutionRedundancyTrace() const
+ {
+ return( execution == EXECUTION_REDUNDANCY_TRACE );
+ }
+
+ inline ExecutionContextFlags & setExecutionRedundancyTrace()
+ {
+ execution = EXECUTION_REDUNDANCY_TRACE;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "redundancy target" execution
+ */
+ inline bool isExecutionRedundancyTargetTrace() const
+ {
+ return( execution == EXECUTION_REDUNDANCY_TARGET_TRACE );
+ }
+
+ inline bool noneExecutionRedundancyTargetTrace() const
+ {
+ return( execution != EXECUTION_REDUNDANCY_TARGET_TRACE );
+ }
+
+ inline ExecutionContextFlags & setExecutionRedundancyTargetTrace()
+ {
+ execution = EXECUTION_REDUNDANCY_TARGET_TRACE;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "statement_exit" execution
+ */
+ inline bool isExecutionStatementExitTrace() const
+ {
+ return( execution == EXECUTION_STATEMENT_EXIT_TRACE );
+ }
+
+ inline ExecutionContextFlags & setExecutionStatementExitTrace()
+ {
+ execution = EXECUTION_STATEMENT_EXIT_TRACE;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "fatal_error" execution
+ */
+ inline bool isExecutionFatalErrorTrace() const
+ {
+ return( execution == EXECUTION_FATAL_ERROR_TRACE );
+ }
+
+ inline ExecutionContextFlags & setExecutionFatalErrorTrace()
+ {
+ execution = EXECUTION_FATAL_ERROR_TRACE;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "boundary" execution
+ */
+ inline bool isExecutionSymbexLimitationTrace() const
+ {
+ return( execution == EXECUTION_SYMBEX_LIMIT_TRACE );
+ }
+
+ inline ExecutionContextFlags & setExecutionSymbexLimitationTrace()
+ {
+ execution = EXECUTION_SYMBEX_LIMIT_TRACE;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "exception" execution
+ */
+ inline bool isExecutionExceptionTrace() const
+ {
+ return( execution == EXECUTION_EXCEPTION_TRACE );
+ }
+
+ inline ExecutionContextFlags & setExecutionExceptionTrace()
+ {
+ execution = EXECUTION_EXCEPTION_TRACE;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "step_mark" execution
+ */
+ inline bool isExecutionStepMarkTrace() const
+ {
+ return( execution == EXECUTION_STEP_MARK_TRACE );
+ }
+
+ inline ExecutionContextFlags & setExecutionStepMarkTrace()
+ {
+ execution = EXECUTION_STEP_MARK_TRACE;
+
+ return( *this );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // ANALYSIS TRACE
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * GETTER - SETTER
+ * analysis
+ */
+ inline FAM_TRACE getAnalysisTrace() const
+ {
+ return( static_cast< FAM_TRACE >( analysis ) );
+ }
+
+ inline bool hasAnalysisTrace() const
+ {
+ return( analysis != REACHED_UNDEFINED_LIMIT );
+ }
+
+ inline bool noneAnalysisTrace() const
+ {
+ return( analysis == REACHED_UNDEFINED_LIMIT );
+ }
+
+ inline bool hasAnalysisTrace(FAM_TRACE analysisTrace) const
+ {
+ return( (analysis & analysisTrace) != 0 );
+ }
+
+ inline bool isAnalysisTrace(FAM_TRACE analysisTrace) const
+ {
+ return( analysis == analysisTrace );
+ }
+
+ inline ExecutionContextFlags & setAnalysisTrace(FAM_TRACE analysisTrace)
+ {
+ analysis = analysisTrace;
+
+ return( *this );
+ }
+
+ inline ExecutionContextFlags & unsetAnalysisTrace()
+ {
+ analysis = FAM_UNDEFINED_TRACE;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "coverage" analysis
+ */
+ inline bool hasCoverageElementTrace() const
+ {
+ return( (analysis & FAM_COVERAGE_ELEMENT_TRACE) != 0 );
+ }
+
+ inline bool isCoverageElementTrace() const
+ {
+ return( analysis == FAM_COVERAGE_ELEMENT_TRACE );
+ }
+
+ inline bool noneCoverageElementTrace() const
+ {
+ return( (analysis & FAM_COVERAGE_ELEMENT_TRACE) == 0 );
+ }
+
+ inline ExecutionContextFlags & addCoverageElementTrace()
+ {
+ analysis |= FAM_COVERAGE_ELEMENT_TRACE;
+
+ return( *this );
+ }
+
+ inline ExecutionContextFlags & setCoverageElementTrace()
+ {
+ analysis = FAM_COVERAGE_ELEMENT_TRACE;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "coverage" analysis
+ */
+ inline bool hasObjectiveAchievedTrace() const
+ {
+ return( (analysis & FAM_OBJECTIVE_ACHIEVED_TRACE) != 0 );
+ }
+
+ inline bool isObjectiveAchievedTrace() const
+ {
+ return( analysis == FAM_OBJECTIVE_ACHIEVED_TRACE );
+ }
+
+ inline bool noneObjectiveAchievedTrace() const
+ {
+ return( (analysis & FAM_OBJECTIVE_ACHIEVED_TRACE) == 0 );
+ }
+
+ inline ExecutionContextFlags & addObjectiveAchievedTrace()
+ {
+ analysis |= FAM_OBJECTIVE_ACHIEVED_TRACE;
+
+ return( *this );
+ }
+
+ inline ExecutionContextFlags & setObjectiveAchievedTrace()
+ {
+ analysis = FAM_OBJECTIVE_ACHIEVED_TRACE;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "coverage" analysis
+ */
+ inline bool hasObjectiveFailedTrace() const
+ {
+ return( (analysis & FAM_OBJECTIVE_FAILED_TRACE) != 0 );
+ }
+
+ inline bool isObjectiveFailedTrace() const
+ {
+ return( analysis == FAM_OBJECTIVE_FAILED_TRACE );
+ }
+
+ inline ExecutionContextFlags & addObjectiveFailedTrace()
+ {
+ analysis |= FAM_OBJECTIVE_FAILED_TRACE;
+
+ return( *this );
+ }
+
+ inline ExecutionContextFlags & setObjectiveFailedTrace()
+ {
+ analysis = FAM_OBJECTIVE_FAILED_TRACE;
+
+ return( *this );
+ }
+
+ /**
+ * GETTER - SETTER
+ * "coverage" analysis
+ */
+ inline bool hasObjectiveAbortedTrace() const
+ {
+ return( (analysis & FAM_OBJECTIVE_ABORTED_TRACE) != 0 );
+ }
+
+ inline bool isObjectiveAbortedTrace() const
+ {
+ return( analysis == FAM_OBJECTIVE_ABORTED_TRACE );
+ }
+
+ inline ExecutionContextFlags & addObjectiveAbortedTrace()
+ {
+ analysis |= FAM_OBJECTIVE_ABORTED_TRACE;
+
+ return( *this );
+ }
+
+ inline ExecutionContextFlags & setObjectiveAbortedTrace()
+ {
+ analysis = FAM_OBJECTIVE_ABORTED_TRACE;
+
+ return( *this );
+ }
+
+
+ /**
+ * REEXECUTABILITY
+ */
+ inline bool isReexecutable() const
+ {
+ return( noneExecutionTrace() );
+ }
+
+ inline ExecutionContextFlags & setReexecutable()
+ {
+ limit = REACHED_UNDEFINED_LIMIT;
+
+ interrupt = INTERRUPT_UNDEFINED_REQUEST;
+
+ return( *this );
+ }
+
+
+ /**
+ * CATEGORY TEST
+ */
+ inline bool hasError() const
+ {
+ return( isExecutionFatalErrorTrace()
+ || isExecutionSymbexLimitationTrace() );
+ }
+
+ inline bool hasAlert() const
+ {
+ return( isExecutionDeadlockTrace()
+ || isExecutionLivelockTrace()
+ || isExecutionStatementExitTrace() );
+ }
+
+ inline bool hasWarning() const
+ {
+ return( hasReachedLimit() );
+ }
+
+ inline bool hasCoverageElement() const
+ {
+ return( hasCoverageElementTrace() );
+ }
+
+ inline bool hasObjectiveAchieved() const
+ {
+ return( hasObjectiveAchievedTrace() );
+ }
+
+ inline bool hasObjectiveFailed() const
+ {
+ return( hasObjectiveFailedTrace() );
+ }
+
+ inline bool hasObjectiveAborted() const
+ {
+ return( hasObjectiveAbortedTrace() );
+ }
+
+ inline bool hasRedundancy() const
+ {
+ return( isExecutionTrivialLoopTrace()
+ || isExecutionRedundancyTrace() );
+ }
+
+ inline bool hasRedundancyTarget() const
+ {
+ return( isExecutionRedundancyTargetTrace() );
+ }
+
+
+ /**
+ * Default Separator
+ */
+ static std::string SEPARATOR;
+
+ /**
+ * REACHED LIMIT to STRING
+ */
+ inline std::string strReachedLimit(
+ const std::string & separator = " & ") const
+ {
+ return( ExecutionContextFlags::strReachedLimit(
+ limit , separator ) );
+ }
+
+ static std::string strReachedLimit(bit_field_t reachedLimit,
+ const std::string & separator = SEPARATOR);
+
+ /**
+ * INTERRUPT REQUEST to STRING
+ */
+ inline std::string strInterruptRequest(
+ const std::string & separator = " & ") const
+ {
+ return( ExecutionContextFlags::strInterruptRequest(
+ interrupt , separator ) );
+ }
+
+ static std::string strInterruptRequest(bit_field_t interruptRequest,
+ const std::string & separator = SEPARATOR);
+
+
+ /**
+ * EXECUTION TRACE to STRING
+ */
+ inline std::string strExecutionTrace(
+ const std::string & separator = " ") const
+ {
+ return( ExecutionContextFlags::strExecutionTrace(
+ execution , separator ) );
+ }
+
+ static std::string strExecutionTrace(bit_field_t executionTrace,
+ const std::string & separator = SEPARATOR);
+
+ /**
+ * ANALYSIS TRACE to STRING
+ */
+ inline std::string strAnalysisTrace(
+ const std::string & separator = " ") const
+ {
+ return( ExecutionContextFlags::strAnalysisTrace(
+ analysis , separator ) );
+ }
+
+ static std::string strAnalysisTrace(bit_field_t analysisTrace,
+ const std::string & separator = SEPARATOR);
+
+ /**
+ * Serialization
+ */
+ inline std::string str(const std::string & separator = SEPARATOR) const
+ {
+ return( StringTools::removeLastIfEndsWith(
+ toString( separator ), separator) );
+ }
+
+ inline std::string toString(
+ const std::string & separator = SEPARATOR) const
+ {
+ return( ExecutionContextFlags::strReachedLimit(
+ limit , separator ) +
+ ExecutionContextFlags::strInterruptRequest(
+ interrupt , separator ) +
+ ExecutionContextFlags::strExecutionTrace(
+ execution , separator ) +
+ ExecutionContextFlags::strAnalysisTrace(
+ analysis , separator ) );
+ }
+
+
+};
+
+
+class ExecutionContextFlagsImpl
+{
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ ExecutionContextFlags mFlags;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ */
+ ExecutionContextFlagsImpl()
+ : mFlags( )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ ~ExecutionContextFlagsImpl()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * GETTER
+ * mFlags
+ */
+ inline const ExecutionContextFlags & getFlags() const
+ {
+ return( mFlags );
+ }
+
+ inline ExecutionContextFlags & getwFlags()
+ {
+ return( mFlags );
+ }
+
+ inline bool hasFlags() const
+ {
+ return( mFlags.isDefined() );
+ }
+
+ inline void setFlags(const ExecutionContextFlags & flags)
+ {
+ mFlags = flags;
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* FML_RUNTIME_EXECUTIONCONTEXTFLAGS_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/ExecutionData.cpp b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionData.cpp
new file mode 100644
index 0000000..41300a2
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionData.cpp
@@ -0,0 +1,1027 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ExecutionData.h"
+
+#include <fml/executable/BaseInstanceForm.h>
+
+#include <fml/runtime/ExecutionConfiguration.h>
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/RuntimeDef.h>
+
+#include <boost/format.hpp>
+
+
+namespace sep
+{
+
+
+/*ATTRIBUTES*/
+avm_size_t ExecutionData::PARAM_MACHINE_RUNTIME_OFFSET = 0;
+avm_size_t ExecutionData::SYSTEM_RUNTIME_OFFSET = 1;
+
+
+
+/**
+ * GETTER
+ * mTableOfRuntimeForm
+ */
+
+const RuntimeID & ExecutionData::getRuntimeID(
+ const ExecutableForm * anExecutable) const
+{
+ TableOfRuntimeT::const_iterator it = mTableOfRuntime.begin();
+ TableOfRuntimeT::const_iterator itEnd = mTableOfRuntime.end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it)->getRID().getExecutable() == anExecutable )
+ {
+ return( (*it)->getRID() );
+ }
+ }
+
+ return( RuntimeID::REF_NULL );
+}
+
+
+const RuntimeID & ExecutionData::getRuntimeID(
+ InstanceOfMachine * anInstance) const
+{
+ if( anInstance->hasRuntimeRID() )
+ {
+ return( anInstance->getRuntimeRID() );
+ }
+ else if( anInstance->isAlias() )
+ {
+ if( anInstance->hasAliasTarget() &&
+ anInstance->getAliasTarget()->as< InstanceOfMachine >()->
+ hasRuntimeRID() )
+ {
+ const RuntimeID & tmpRID =
+ anInstance->getAliasTarget()->getRuntimeContainerRID();
+
+ anInstance->setRuntimeRID( tmpRID );
+
+ return( tmpRID );
+ }
+
+ ArrayOfInstanceOfMachine::iterator it =
+ anInstance->getMachinePath()->begin();
+
+ RuntimeID tmpRID = mRID;
+
+ // SEARCH of the LCA(RID) of the current RID an the ALIAS container
+ tmpRID = tmpRID.getAncestorContaining( *it );
+ if( tmpRID.valid() )
+ {
+ ArrayOfInstanceOfMachine::iterator itEnd =
+ anInstance->getMachinePath()->end();
+
+ // Use of Alias PATH to find the INSTANCE of variable
+ for( ; it != itEnd ; ++it )
+ {
+ tmpRID = getRuntime(tmpRID).getChild((*it)->getOffset());
+ }
+
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT(
+ tmpRID.getExecutable()->getBuffer().at( anInstance
+ ->getOffset() ).isAstElement( anInstance->getAstElement() ) )
+ << "Assign error " << tmpRID.getExecutable()->getBuffer().at(
+ anInstance->getOffset()).getFullyQualifiedNameID()
+ << " != " << anInstance->getFullyQualifiedNameID()
+ << SEND_EXIT;
+
+ return( getRuntime(tmpRID).getChild(anInstance->getOffset()) );
+ }
+ }
+
+// if( anInstance->getSpecifier().isDesignInstanceStatic() )
+ {
+ for( RuntimeID aRID = mRID ; aRID.valid() ; aRID = aRID.getPRID() )
+ {
+ if( anInstance->getContainer() == aRID.getExecutable() )
+ {
+ return( getRuntime(aRID).getChild(anInstance->getOffset()) );
+ }
+ }
+ }
+// else if( anInstance->getSpecifier().isDesignModel() )
+// {
+// return( mTableOfRuntimeForm->getRID(anInstance->getExecutable()) );
+// }
+
+ TableOfRuntimeT::const_iterator it = mTableOfRuntime.begin();
+ TableOfRuntimeT::const_iterator itEnd = mTableOfRuntime.end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it)->getRID().getInstance() == anInstance )
+ {
+ return( (*it)->getRID() );
+ }
+ }
+
+ return( RuntimeID::REF_NULL );
+}
+
+
+const RuntimeID & ExecutionData::getRuntimeID(
+ const std::string & aFullyQualifiedNameID) const
+{
+ TableOfRuntimeT::const_iterator it = mTableOfRuntime.begin();
+ TableOfRuntimeT::const_iterator itEnd = mTableOfRuntime.end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( NamedElement::compareLocation(
+ (*it)->getFullyQualifiedNameID(), aFullyQualifiedNameID) )
+ {
+ return( (*it)->getRID() );
+ }
+ }
+
+ return( RuntimeID::REF_NULL );
+}
+
+const RuntimeID & ExecutionData::getRuntimeIDByNameID(
+ const std::string & aNameID) const
+{
+ TableOfRuntimeT::const_iterator it = mTableOfRuntime.begin();
+ TableOfRuntimeT::const_iterator itEnd = mTableOfRuntime.end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it)->getNameID() == aNameID )
+ {
+ return( (*it)->getRID() );
+ }
+ }
+
+ return( RuntimeID::REF_NULL );
+}
+
+
+RuntimeID ExecutionData::getRuntimeContainerRID(
+ const RuntimeID & aRID, BaseInstanceForm * anInstance) const
+{
+ if( anInstance->hasRuntimeContainerRID() )
+ {
+ return( anInstance->getRuntimeContainerRID() );
+ }
+ else if( anInstance->isAlias() )
+ {
+ RuntimeID tmpRID = aRID;
+
+ if( anInstance->hasAliasTarget() &&
+ anInstance->getAliasTarget()->hasRuntimeContainerRID() )
+ {
+ anInstance->setRuntimeContainerRID( tmpRID =
+ anInstance->getAliasTarget()->getRuntimeContainerRID() );
+
+ return( tmpRID );
+ }
+
+ ArrayOfInstanceOfMachine::iterator it =
+ anInstance->getMachinePath()->begin();
+
+ // SEARCH of the LCA(RID) of the current RID an the ALIAS container
+ tmpRID = tmpRID.getAncestorContaining( *it );
+ if( tmpRID.valid() )
+ {
+ ArrayOfInstanceOfMachine::iterator itEnd =
+ anInstance->getMachinePath()->end();
+
+ // Use of Alias PATH to find the INSTANCE of variable
+ for( ; it != itEnd ; ++it )
+ {
+ tmpRID = getRuntimeFormChild(tmpRID, (*it));
+ }
+
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT(
+ tmpRID.getExecutable()->getBuffer().at( anInstance
+ ->getOffset() ).isAstElement( anInstance->getAstElement() ) )
+ << "Assign error " << tmpRID.getExecutable()->getBuffer().
+ at(anInstance->getOffset()).getFullyQualifiedNameID()
+ << " != " << anInstance->getFullyQualifiedNameID()
+ << SEND_EXIT;
+
+ return( tmpRID );
+ }
+ }
+ else
+ {
+ // SEARCH of the RUNTIME FORM container
+ // where this INSTANCE of variable was declared
+ return( aRID.getAncestorContaining( anInstance ) );
+ }
+
+ return( RuntimeID::REF_NULL );
+}
+
+
+/**
+ * GETTER
+ * for data in RuntimeForm DataTable
+ */
+//const BF & ExecutionData::getData(const std::string & aFullyQualifiedNameID) const
+//{
+// TableOfRuntimeT::const_iterator it = mTableOfRuntime.begin();
+// TableOfRuntimeT::const_iterator itEnd = mTableOfRuntime.end();
+// for( ; it != itEnd ; ++it )
+// {
+// const BF & foundData = (*it)->getData(aFullyQualifiedNameID);
+// if( foundData.valid() )
+// {
+// return( foundData );
+// }
+// }
+//
+// return( BF::REF_NULL );
+//}
+
+const BF & ExecutionData::getDataByQualifiedNameID(
+ const std::string & aQualifiedNameID, InstanceOfData * & var) const
+{
+ TableOfRuntimeT::const_iterator it = mTableOfRuntime.begin();
+ TableOfRuntimeT::const_iterator itEnd = mTableOfRuntime.end();
+ for( ; it != itEnd ; ++it )
+ {
+ const BF & foundData =
+ (*it)->getDataByQualifiedNameID(aQualifiedNameID, var);
+ if( foundData.valid() )
+ {
+ return( foundData );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+const BF & ExecutionData::getDataByNameID(const std::string & aNameID) const
+{
+ TableOfRuntimeT::const_iterator it = mTableOfRuntime.begin();
+ TableOfRuntimeT::const_iterator itEnd = mTableOfRuntime.end();
+ for( ; it != itEnd ; ++it )
+ {
+ const BF & foundData = (*it)->getDataByNameID(aNameID);
+ if( foundData.valid() )
+ {
+ return( foundData );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+/**
+ * GETTER
+ * mSaveTableOfAssignedFlag
+ */
+TableOfRuntimeFormState::TableOfAssignedFlag
+ExecutionData::getSaveTableOfAssignedFlag() const
+{
+ return( mExecutionContext->getTableOfAssignedFlag() );
+}
+
+
+
+/**
+ * GETTER
+ * tableOfRuntimeFormState
+ */
+bool ExecutionData::checkRunningForm(const BF & aRunnableElementTrace,
+ const RuntimeID & aRID)
+{
+ if( aRunnableElementTrace.is< ExecutionConfiguration >() )
+ {
+ ExecutionConfiguration * anExecConf =
+ aRunnableElementTrace.to_ptr< ExecutionConfiguration >();
+
+ return( anExecConf->getRuntimeID() == aRID );
+ }
+
+ else if( aRunnableElementTrace.is< AvmCode >() )
+ {
+ AvmCode * aCode = aRunnableElementTrace.to_ptr< AvmCode >();
+
+ for( AvmCode::iterator it = aCode->begin() ; it != aCode->end() ; ++it )
+ {
+ if( checkRunningForm(*it, aRID) )
+ {
+ return( true );
+ }
+ }
+ }
+
+ return( false);
+}
+
+
+/**
+ * INSTANCIATION BOUND TEST
+ */
+bool ExecutionData::couldBeInstanciated(InstanceOfMachine * anInstance) const
+{
+ ExecutableForm * anExecutable = anInstance->getExecutable();
+
+ if( anExecutable->hasMaximalInstance() )
+ {
+ avm_size_t anInstanciationCount = 0;
+
+ TableOfRuntimeT::const_iterator it = mTableOfRuntime.begin();
+ TableOfRuntimeT::const_iterator endIt = mTableOfRuntime.end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it)->getExecutable() == anExecutable )
+ {
+ ++anInstanciationCount;
+ }
+ }
+
+//!![TRACE]: to delete
+//AVM_OS_DEBUG << "Instanciation Count: " << anInstanciationCount
+// << " ?<=? max: " << anExecutable->getMaximalInstanceCount() << std::endl;
+
+ return( anInstanciationCount <= anExecutable->getMaximalInstanceCount() );
+ }
+
+ return( true );
+}
+
+
+
+
+/**
+ * string of a state configuration of an ExecutionData
+ */
+void ExecutionData::toStreamStateIdleOrRunning(
+ OutStream & os, const RuntimeForm & aRF) const
+{
+ if( aRF.hasOnSchedule()
+ && aRF.getOnSchedule()->singleton()
+ && aRF.getOnSchedule()->first().is< RuntimeID >()
+ /*&& (aRF.getRID() != aRF.getOnSchedule()->first().bfRID())*/ )
+ {
+ if( aRF.getExecutable()->hasTransition() )
+ {
+ os << aRF.getRID().strUniqId() << " ( ";
+ }
+
+ if( isIdleOrRunning(aRF.getOnSchedule()->first().bfRID()) )
+ {
+ toStreamStateIdleOrRunning(os,
+ getRuntime(aRF.getOnSchedule()->first().bfRID()) );
+
+ if( aRF.getExecutable()->hasTransition() )
+ {
+ os << " )";
+ }
+ }
+ }
+
+ else if( aRF.hasChild() )
+ {
+ TableOfRuntimeID::const_iterator itRID = aRF.beginChild();
+ TableOfRuntimeID::const_iterator itRIDEnd = aRF.endChild();
+
+ if( aRF.getExecutable()->hasTransition() )
+ {
+ os << aRF.getRID().strUniqId() << " ";
+ }
+
+ bool needComa = false;
+ for( ; itRID != itRIDEnd ; ++itRID )
+ {
+ if( isIdleOrRunning( *itRID ) )
+ {
+ if( needComa )
+ {
+ os << " , ";
+ }
+ else
+ {
+ os << "( ";
+ needComa = true;
+ }
+ toStreamStateIdleOrRunning(os, getRuntime(*itRID));
+ }
+ }
+ if( needComa )
+ {
+ os << " )";
+ }
+ }
+ else
+ {
+ os << aRF.getRID().strUniqId();
+ }
+}
+
+
+/**
+ * string of a state configuration of an ExecutionData
+ *
+ * LIFELINE STATE IDENTIFIER
+ * %1% --> lifeline runtime pid
+ * %2% --> lifeline identifier
+ * %3% --> state runtime pid
+ * %4% --> state identifier
+ */
+OutStream & ExecutionData::toStreamLifelineStateFormat(
+ OutStream & os, const RuntimeForm & aRF,
+ const std::string & formatLifelineStatePattern) const
+{
+ boost::format formatter(formatLifelineStatePattern);
+ formatter.exceptions( boost::io::no_error_bits );
+
+ RuntimeID ridLifeline = aRF.getRID().getLifeline();
+
+ os << formatter
+ % ridLifeline.strPid()
+ % ridLifeline.getInstance()->getNameID()
+ % aRF.getRID().strPid()
+ % aRF.getRID().getNameID();
+
+ return( os );
+}
+
+
+void ExecutionData::toStreamStateConf(
+ OutStream & os, const RuntimeForm & aRF,
+ const std::string & formatLifelineStatePattern) const
+{
+ if ( aRF.hasOnSchedule() )
+ {
+ if( aRF.getOnSchedule()->singleton()
+ && aRF.getOnSchedule()->first().is< RuntimeID >()
+ && (aRF.getRID() != aRF.getOnSchedule()->first().bfRID()) )
+ {
+ if( aRF.getExecutable()->hasTransition() )
+ {
+ toStreamLifelineStateFormat(os, aRF, formatLifelineStatePattern)
+ << " ( ";
+ }
+
+ toStreamStateConf(os,
+ getRuntime( aRF.getOnSchedule()->first().bfRID() ),
+ formatLifelineStatePattern );
+
+ if( aRF.getExecutable()->hasTransition() )
+ {
+ os << " )";
+ }
+
+ return;
+ }
+ }
+
+ if( aRF.hasChild() )
+ {
+ TableOfRuntimeID::const_iterator itRID = aRF.beginChild();
+ TableOfRuntimeID::const_iterator itRIDEnd = aRF.endChild();
+
+ if( aRF.getExecutable()->hasTransition() )
+ {
+ toStreamLifelineStateFormat(os, aRF, formatLifelineStatePattern)
+ << " ";
+ }
+
+ os << "( ";
+ for( bool needComa = false ; itRID != itRIDEnd ; ++itRID )
+ {
+ if( (*itRID).getExecutable()->hasOnInitOrEnableOrRun() )
+ {
+ if( isRunnable( *itRID ) || isFinalizedOrDestroyed( *itRID ) )
+ {
+ if( needComa )
+ {
+ os << " , ";
+ }
+ else
+ {
+ needComa = true;
+ }
+ toStreamStateConf(os, getRuntime(*itRID),
+ formatLifelineStatePattern );
+ }
+ }
+ }
+ os << " )";
+ }
+ else
+ {
+ if( isFinalized( aRF.getRID() ) )
+ {
+ os << "<final>";
+ }
+ else if( isDestroyed( aRF.getRID() ) )
+ {
+ os << "<destroy>";
+ }
+
+ toStreamLifelineStateFormat(os, aRF, formatLifelineStatePattern);
+ }
+}
+
+
+/**
+ * string of a state configuration of an ExecutionData to Fscn
+ */
+void ExecutionData::toStreamStateConfToFscn(
+ OutStream & os, const RuntimeForm & aRF) const
+{
+ if ( aRF.hasOnSchedule() )
+ {
+ if( aRF.getOnSchedule()->singleton()
+ && aRF.getOnSchedule()->first().is< RuntimeID >()
+ && getRuntime(aRF.getOnSchedule()->first().bfRID()).isInstanciated() )
+ {
+ toStreamStateConfToFscn(os,
+ getRuntime( aRF.getOnSchedule()->first().bfRID() ) );
+
+ return;
+ }
+ }
+
+ if( aRF.hasChild() )
+ {
+ TableOfRuntimeID::const_iterator itRID = aRF.beginChild();
+ TableOfRuntimeID::const_iterator itRIDEnd = aRF.endChild();
+
+ os << "( " ;
+ for( bool needComa = false ; itRID != itRIDEnd ; ++itRID )
+ {
+ if( (*itRID).getExecutable()->hasOnInitOrEnableOrRun()
+ && getRuntime(*itRID).isInstanciated() )
+ {
+ if( needComa )
+ {
+ os << " , ";
+ }
+ else
+ {
+ needComa = true;
+ }
+ toStreamStateConfToFscn(os, getRuntime((*itRID)) );
+ }
+ }
+ os << " )";
+ }
+ else
+ {
+ os << aRF.getRID().strUniqId();
+ }
+}
+
+
+/**
+ * Serialization
+ */
+void ExecutionData::toStream(OutStream & os) const
+{
+ os << TAB << "ed";
+
+ const std::string conf = strStateConf();
+ if( conf[0] == '(' )
+ {
+ os << conf;
+ }
+ else
+ {
+ os << '(' << conf << ')';
+ }
+
+ AVM_DEBUG_REF_COUNTER(os);
+ os << " {" << EOL_FLUSH;
+
+// os << TAB2 << "name = \"" << strStateConf() << "\";" << EOL_FLUSH;
+
+ if ( hasRunnableElementTrace() )
+ {
+ os << TAB2 << "fired = " << getRunnableElementTrace().str()
+ << ";" << EOL_FLUSH;
+ }
+
+ if ( hasIOElementTrace() )
+ {
+ os << TAB2 << "trace = " << getIOElementTrace().str() << ";" << EOL_FLUSH;
+ }
+
+ os << TAB2 << "exec_status = "
+ << RuntimeDef::strAEES( getAEES() ) << ";" << EOL_FLUSH;
+
+ if ( hasNodeCondition() && getNodeCondition().isNotEqualTrue() )
+ {
+ os << TAB2 << "firedcondition = "
+ << getNodeCondition().wrapStr( os.INDENT.tab2Size(18) )
+ << ";" << EOL;
+ }
+
+ if ( hasNodeTimedCondition() &&
+ getNodeTimedCondition().isNotEqualTrue() )
+ {
+ os << TAB2 << "firedtimedcondition = "
+ << getNodeTimedCondition().wrapStr( os.INDENT.tab2Size(23) )
+ << ";" << EOL;
+ }
+
+ if( hasPathCondition() && getPathCondition().isNotEqualTrue() )
+ {
+ os << TAB2 << "pathcondition = "
+ << getPathCondition().wrapStr( os.INDENT.tab2Size(17) )
+ << ";";
+ getPathCondition().AVM_DEBUG_REF_COUNTER(os);
+ os << EOL_FLUSH;
+ }
+ else if( not hasPathCondition() )
+ {
+ os << TAB2 << "pathcondition = NULL;" << EOL;
+ }
+
+ if( hasPathTimedCondition() && getPathTimedCondition().isNotEqualTrue() )
+ {
+ os << TAB2 << "pathtimedcondition = "
+ << getPathTimedCondition().wrapStr( os.INDENT.tab2Size(22) )
+ << ";";
+ getPathTimedCondition().AVM_DEBUG_REF_COUNTER(os);
+ os << EOL_FLUSH;
+ }
+ else if( not hasPathTimedCondition() )
+ {
+ os << TAB2 << "pathtimedcondition = NULL;" << EOL;
+ }
+
+ os << TAB2 << "@init{" << INCR2_INDENT;
+ getOnInit()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL_FLUSH;
+
+ os << TAB2 << "@schedule{" << INCR2_INDENT;
+ getOnSchedule()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL_FLUSH;
+
+ os << TAB2 << "rid = " << getRID().str() << ";" << EOL_FLUSH;
+
+
+// if( hasParam() )
+// {
+// os << EOL;
+// os << TAB << "parameter:";
+// tableOfParam->AVM_DEBUG_REF_COUNTER(os);
+// os << EOL;
+//
+// tableOfParam->toStream(os);
+// }
+
+
+//AVM_IF_DEBUG_ENABLED_AND( hasTableOfRID() )
+// os << EOL;
+//
+// AVM_IF_DEBUG_LEVEL_GT_MEDIUM
+// os << TAB << "rid:" << EOL_INCR_INDENT;
+// TableOfRuntimeID::const_iterator it = mTableOfRID->begin();
+// TableOfRuntimeID::const_iterator itEnd = mTableOfRID->end();
+// for( ; it != itEnd ; ++it )
+// {
+// (*it).toStream(os);
+// }
+// os << DECR_INDENT;
+// AVM_ELSEIF_DEBUG_LEVEL_GT_LOW
+// os << TAB2 << "rid = [| ";
+// TableOfRuntimeID::const_iterator it = mTableOfRID->begin();
+// TableOfRuntimeID::const_iterator itEnd = mTableOfRID->end();
+// for( ; it != itEnd ; ++it )
+// {
+// os << (*it).getOffset() << " ";
+// }
+// os << "|];" << EOL_FLUSH;
+// AVM_ENDIF_DEBUG_LEVEL_GT_LOW
+//AVM_ENDIF_DEBUG_ENABLED_AND
+
+
+ if( hasLocalRuntimeStack() )
+ {
+ os << EOL_TAB << "local: ";
+ getLocalRuntimes()->AVM_DEBUG_REF_COUNTER(os);
+
+ os << EOL_INCR_INDENT;
+ getLocalRuntimes()->toStream(os);
+ os << DECR_INDENT;
+ }
+
+ if ( getTableOfRuntime().nonempty() )
+ {
+ os << EOL_TAB << "runtime#state:" << EOL_INCR_INDENT;
+ mTableOfRFStateFlags->toStream(*this, os);
+
+ os << EOL_DECR_INDENT << TAB << "runtime:" << EOL_INCR_INDENT;
+
+AVM_IF_DEBUG_LEVEL_GTE_MEDIUM
+ TableOfRuntimeT::const_iterator it = mTableOfRuntime.begin();
+ TableOfRuntimeT::const_iterator itEnd = mTableOfRuntime.end();
+ for( ; it != itEnd ; ++it )
+ {
+ (*it)->toStream(this, os);
+ }
+AVM_ENDIF_DEBUG_LEVEL_GTE_MEDIUM
+
+ os << DECR_INDENT;
+ }
+
+ if( mSTATEMENT_QUEUE.nonempty() )
+ {
+ os << EOL_INCR_INDENT;
+ mSTATEMENT_QUEUE.toStream(os);
+ os << DECR_INDENT;
+ }
+
+ if( mEXEC_SYNC_POINT != NULL )
+ {
+ os << EOL_INCR_INDENT;
+ mEXEC_SYNC_POINT->toStream(os);
+ os << DECR_INDENT;
+ }
+
+ os << TAB << "}" << EOL_FLUSH;
+}
+
+void ExecutionData::toStreamData(OutStream & os) const
+{
+
+ os << TAB << "ed<data>";
+ AVM_DEBUG_REF_COUNTER(os);
+ os << " {" << EOL;
+
+ os << TAB2 << "name = \"" << strStateConf() << "\";" << EOL_FLUSH;
+
+
+ if ( hasRunnableElementTrace() )
+ {
+ os << TAB2 << "fired = " << getRunnableElementTrace().str()
+ << ";" << EOL_FLUSH;
+ }
+
+ if ( hasIOElementTrace() )
+ {
+ os << TAB2 << "trace = " << getIOElementTrace().str() << ";" << EOL_FLUSH;
+ }
+
+ os << TAB2 << "exec_status = "
+ << RuntimeDef::strAEES( getAEES() ) << ";" << EOL_FLUSH;
+
+ if ( hasNodeCondition() && getNodeCondition().isNotEqualTrue() )
+ {
+ os << TAB2 << "nodecondition = "
+ << getNodeCondition().wrapStr( os.INDENT.tab2Size(18) )
+ << ";" << EOL_FLUSH;
+ }
+
+ if ( hasPathCondition() && getPathCondition().isNotEqualTrue() )
+ {
+ os << TAB2 << "pathcondition = "
+ << getPathCondition().wrapStr( os.INDENT.tab2Size(17) )
+ << ";" << EOL_FLUSH;
+ }
+
+ if( hasOnInit() )
+ {
+ os << TAB2 << "@init{" << INCR2_INDENT;
+ getOnInit()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL_FLUSH;
+ }
+
+ if( hasOnSchedule() )
+ {
+ os << TAB2 << "@schedule{" << INCR2_INDENT;
+ getOnSchedule()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL_FLUSH;
+ }
+
+// if( hasParam() )
+// {
+// os << EOL;
+// os << TAB << "parameter:" << EOL;
+// tableOfParam->toStream(os, TAB2, CHAR, EOL);
+// }
+
+ if ( getTableOfRuntime().nonempty() )
+ {
+ os << EOL_TAB << "runtime:" << EOL_INCR_INDENT;
+
+ TableOfRuntimeT::const_iterator it = mTableOfRuntime.begin();
+ TableOfRuntimeT::const_iterator itEnd = mTableOfRuntime.end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it)->hasDataTable() )
+ {
+ (*it)->toStreamData(this, os);
+ }
+ }
+
+ os << DECR_INDENT;
+ }
+
+ if( mSTATEMENT_QUEUE.nonempty() )
+ {
+ os << EOL_INCR_INDENT;
+ mSTATEMENT_QUEUE.toStream(os);
+ os << DECR_INDENT;
+ }
+
+ if( mEXEC_SYNC_POINT != NULL )
+ {
+ os << EOL_INCR_INDENT;
+ mEXEC_SYNC_POINT->toStream(os);
+ os << DECR_INDENT;
+ }
+
+ os << TAB << "}" << EOL_FLUSH;
+}
+
+void ExecutionData::toFscn(OutStream & os,
+ const ExecutionData * aPreviousExecData) const
+{
+// os << TAB << "SC: " << strStateConfToFscn() << EOL;
+
+ if( (aPreviousExecData == NULL)
+ || (aPreviousExecData->getPathCondition()
+ != getPathCondition()) )
+ {
+ os << TAB << "PC: "
+ << getPathCondition().wrapStr( os.INDENT.tab2Size(4) )
+ << EOL;
+ }
+
+ if( (aPreviousExecData == NULL)
+ || (aPreviousExecData->getPathTimedCondition()
+ != getPathTimedCondition()) )
+ {
+ os << TAB << "PtC: "
+ << getPathTimedCondition().wrapStr( os.INDENT.tab2Size(5) )
+ << EOL;
+ }
+
+ // DATA
+ StringOutStream oss( os.INDENT );
+ oss << INCR_INDENT;
+
+ TableOfRuntimeT::const_iterator it = mTableOfRuntime.begin();
+ TableOfRuntimeT::const_iterator itEnd = mTableOfRuntime.end();
+
+ if( aPreviousExecData != NULL )
+ {
+ TableOfRuntimeT::const_iterator itPrev =
+ aPreviousExecData->mTableOfRuntime.begin();
+ TableOfRuntimeT::const_iterator itPrevEnd =
+ aPreviousExecData->mTableOfRuntime.end();
+ TableOfRuntimeT::const_iterator it = mTableOfRuntime.begin();
+ TableOfRuntimeT::const_iterator itEnd = mTableOfRuntime.end();
+ for( ; (it != itEnd) && (itPrev != itPrevEnd) ; ++it , ++itPrev )
+ {
+ if( (*it)->hasDataTable() && (*it)->isNTEQ(*itPrev) )
+ {
+ (*it)->toFscnData(oss, this, *itPrev);
+ }
+ }
+
+ for( ; (it != itEnd) ; ++it)
+ {
+ if( (*it)->hasDataTable() )
+ {
+ (*it)->toFscnData(oss, this, NULL);
+ }
+ }
+ }
+ else
+ {
+ TableOfRuntimeT::const_iterator it = mTableOfRuntime.begin();
+ TableOfRuntimeT::const_iterator itEnd = mTableOfRuntime.end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it)->hasDataTable() )
+ {
+ (*it)->toFscnData(oss, this, NULL);
+ }
+ }
+ }
+
+ if( not oss.str().empty() )
+ {
+ os << TAB << "DATA{" << EOL;
+ os << oss.str();
+ os << TAB << "}" << EOL;
+ }
+ // END DATA
+
+ // BUFFER
+ StringOutStream osb( os.INDENT );
+ osb << INCR_INDENT;
+
+ it = getTableOfRuntime().begin();
+ itEnd = getTableOfRuntime().end();
+
+ if( aPreviousExecData != NULL )
+ {
+ TableOfRuntimeT::const_iterator itPrev =
+ aPreviousExecData->getTableOfRuntime().begin();
+ TableOfRuntimeT::const_iterator itPrevEnd =
+ aPreviousExecData->getTableOfRuntime().end();
+ for( ; (it != itEnd) && (itPrev != itPrevEnd) ; ++it , ++itPrev )
+ {
+ if( (*it)->hasBufferTable() && (*it)->isNTEQ(*itPrev) )
+ {
+ (*it)->toFscnBuffer(osb, this, (*itPrev));
+ }
+ }
+
+ for( ; (it != itEnd) ; ++it)
+ {
+ if( (*it)->hasBufferTable() )
+ {
+ (*it)->toFscnBuffer(osb, this, NULL);
+ }
+ }
+ }
+ else
+ {
+ TableOfRuntimeT::const_iterator it = mTableOfRuntime.begin();
+ TableOfRuntimeT::const_iterator itEnd = mTableOfRuntime.end();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it)->hasBufferTable() )
+ {
+ (*it)->toFscnBuffer(osb, this, NULL);
+ }
+ }
+ }
+
+ if( not osb.str().empty() )
+ {
+ os << TAB << "BUFFER{" << EOL;
+ os << osb.str();
+ os << TAB << "}" << EOL;
+ }
+ // END BUFFER
+
+
+ if( mSTATEMENT_QUEUE.nonempty() )
+ {
+ os << TAB << "/*" << EOL;
+ mSTATEMENT_QUEUE.toStream(os);
+ os << TAB << "*/" << EOL;
+ }
+
+ if( mEXEC_SYNC_POINT != NULL )
+ {
+ os << TAB << "/*" << EOL;
+ mEXEC_SYNC_POINT->toStream(os);
+ os << TAB << "*/" << EOL;
+ }
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * DEFAULT NULL
+ */
+APExecutionData APExecutionData::REF_NULL;
+
+
+
+/**
+ * GETTER - SETTER
+ * the Previous ExecutionData
+ */
+
+APExecutionData & APExecutionData::getPrevious()
+{
+ return( raw_pointer()->getExecutionContext()->getPreviousExecutionData() );
+}
+
+const APExecutionData & APExecutionData::getPrevious() const
+{
+ return( raw_pointer()->getExecutionContext()->getPreviousExecutionData() );
+}
+
+bool APExecutionData::hasPrevious() const
+{
+ return( raw_pointer()->hasExecutionContext() &&
+ raw_pointer()->getExecutionContext()->hasPrevious() );
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/ExecutionData.h b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionData.h
new file mode 100644
index 0000000..900376c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionData.h
@@ -0,0 +1,1646 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef EXECUTIONDATA_H_
+#define EXECUTIONDATA_H_
+
+#include <base/SmartTable.h>
+
+#include <common/AvmPointer.h>
+#include <common/Element.h>
+#include <common/BF.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <collection/Typedef.h>
+
+#include <fml/expression/ExpressionConstructor.h>
+
+#include <fml/runtime/ExecutionLocation.h>
+#include <fml/runtime/ExecutionSynchronizationPoint.h>
+#include <fml/runtime/LocalRuntime.h>
+#include <fml/runtime/RuntimeForm.h>
+#include <fml/runtime/RuntimeID.h>
+#include <fml/runtime/TableOfRuntimeFormState.h>
+
+
+namespace sep
+{
+
+class BaseBufferForm;
+class BaseInstanceForm;
+class Bitset;
+
+class ExecutionContext;
+class ExecutableForm;
+
+class InstanceOfMachine;
+
+
+/**
+ * TYPEDEF
+ */
+typedef SmartTable< RuntimeForm , DestroyElementPolicy > TableOfRuntimeT;
+
+
+class ExecutionData : public Element ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ExecutionData )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( ExecutionData )
+
+
+public:
+ /**
+ * ATTRIBUTES
+ * static
+ */
+ static avm_size_t PARAM_MACHINE_RUNTIME_OFFSET;
+
+ static avm_size_t SYSTEM_RUNTIME_OFFSET;
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ ExecutionContext * mExecutionContext;
+
+ BF mPathCondition;
+ BF mPathTimedCondition;
+
+ bool mGlobalNodeConditionEnabledFlag;
+ bool mLocalNodeConditionEnabledFlag;
+
+ BF mNodeCondition;
+ BF mNodeTimedCondition;
+ BF mRunnableElementTrace;
+ BF mIOElementTrace;
+
+ BFCode mOnInit;
+ BFCode mOnSchedule;
+
+ TableOfRuntimeT mTableOfRuntime;
+
+ APTableOfRuntimeFormState mTableOfRFStateFlags;
+
+ APStackOfLocalRuntime mStackOfLocalRuntime;
+
+public:
+ /**
+ * ATTRIBUTES
+ * public
+ */
+ RuntimeID mRID;
+ bool mPreserveRID;
+
+ // Routine Parameter[s] or Return Statement value[s]
+ BF mVALUE;
+
+ AVM_EXEC_ENDING_STATUS mAEES;
+
+ ExecutionLocationQueue mSTATEMENT_QUEUE;
+
+ ExecutionSynchronizationPoint * mEXEC_SYNC_POINT;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ExecutionData( avm_size_t aMachineCount )
+ : Element( CLASS_KIND_T( ExecutionData ) ),
+ mExecutionContext( NULL ),
+
+ mPathCondition( ),
+ mPathTimedCondition( ),
+
+ mGlobalNodeConditionEnabledFlag( true ),
+ mLocalNodeConditionEnabledFlag( false ),
+
+ mNodeCondition( ),
+ mNodeTimedCondition( ),
+
+ mRunnableElementTrace( ),
+ mIOElementTrace( ),
+
+ mOnInit( ),
+ mOnSchedule( ),
+
+ mTableOfRuntime( aMachineCount ),
+
+ mTableOfRFStateFlags( new TableOfRuntimeFormState(aMachineCount) ),
+ mStackOfLocalRuntime( ),
+
+ // public Attributes
+ mRID( ),
+ mPreserveRID( false ),
+ mVALUE( ),
+
+ mAEES( AEES_OK ),
+
+ mSTATEMENT_QUEUE( ),
+ mEXEC_SYNC_POINT( NULL )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ ExecutionData(const ExecutionData & anED)
+ : Element( anED ),
+ mExecutionContext( anED.mExecutionContext ),
+
+ mPathCondition( anED.mPathCondition ),
+ mPathTimedCondition( anED.mPathTimedCondition ),
+
+ mGlobalNodeConditionEnabledFlag( anED.mGlobalNodeConditionEnabledFlag ),
+ mLocalNodeConditionEnabledFlag( anED.mLocalNodeConditionEnabledFlag ),
+
+ mNodeCondition( anED.mNodeCondition ),
+ mNodeTimedCondition( anED.mNodeTimedCondition ),
+
+ mRunnableElementTrace( anED.mRunnableElementTrace ),
+ mIOElementTrace( anED.mIOElementTrace ),
+
+ mOnInit( anED.mOnInit ),
+ mOnSchedule( anED.mOnSchedule ),
+
+ mTableOfRuntime( anED.mTableOfRuntime ),
+
+ mTableOfRFStateFlags( anED.mTableOfRFStateFlags ),
+ mStackOfLocalRuntime( anED.mStackOfLocalRuntime ),
+
+ // public Attributes
+ mRID(anED.mRID),
+ mPreserveRID( anED.mPreserveRID ),
+ mVALUE( anED.mVALUE ),
+
+ mAEES( anED.mAEES ),
+
+ mSTATEMENT_QUEUE( anED.mSTATEMENT_QUEUE ),
+ mEXEC_SYNC_POINT( (anED.mEXEC_SYNC_POINT != NULL) ?
+ new ExecutionSynchronizationPoint( *(anED.mEXEC_SYNC_POINT) ) : NULL )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ExecutionData()
+ {
+ delete( mEXEC_SYNC_POINT );
+ }
+
+
+ /**
+ * resize
+ */
+ void resize(avm_size_t newMachineCount)
+ {
+ mTableOfRuntime.makeWritableResize( newMachineCount );
+
+ mTableOfRFStateFlags.makeWritable();
+ mTableOfRFStateFlags->resize(newMachineCount);
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mExecutionContext
+ */
+ inline ExecutionContext * getExecutionContext() const
+ {
+ return( mExecutionContext );
+ }
+
+ inline bool hasExecutionContext() const
+ {
+ return( mExecutionContext != NULL );
+ }
+
+ inline void setExecutionContext(ExecutionContext * anExecutionContext)
+ {
+ mExecutionContext = anExecutionContext;
+ }
+
+
+ /**
+ * GETTER
+ * mPathCondition && mPathTimedCondition
+ */
+ inline BF getAllPathCondition() const
+ {
+ if( mPathTimedCondition.valid()
+ && mPathTimedCondition.isNotEqualTrue() )
+ {
+ return( ExpressionConstructor::andExpr(
+ mPathCondition, mPathTimedCondition) );
+ }
+ else
+ {
+ return( mPathCondition );
+ }
+ }
+
+
+ inline BF andPathTimedCondition(const BF & aCondition) const
+ {
+ if( mPathTimedCondition.valid() )
+ {
+ if( mPathTimedCondition.isEqualTrue() )
+ {
+ return( aCondition );
+ }
+ else if( mPathTimedCondition.isEqualFalse() )
+ {
+ return( mPathTimedCondition );
+ }
+
+ return( ExpressionConstructor::andExpr(
+ mPathTimedCondition, aCondition) );
+ }
+ else
+ {
+ return( aCondition );
+ }
+ }
+
+ /**
+ * GETTER - SETTER
+ * mPathCondition
+ */
+ inline const BF & getPathCondition() const
+ {
+ return( mPathCondition );
+ }
+
+ inline bool hasPathCondition() const
+ {
+ return( mPathCondition.valid() );
+ }
+
+ inline void setPathCondition(const BF & aPathCondition)
+ {
+ mPathCondition = aPathCondition;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mPathTimedCondition
+ */
+ inline const BF & getPathTimedCondition() const
+ {
+ return( mPathTimedCondition );
+ }
+
+ inline bool hasPathTimedCondition() const
+ {
+ return( mPathTimedCondition.valid() );
+ }
+
+ inline void setPathTimedCondition(const BF & aPathTimedCondition)
+ {
+ mPathTimedCondition = aPathTimedCondition;
+ }
+
+
+
+ /**
+ * GETTER
+ * mNodeCondition && mNodeTimedCondition
+ */
+ inline BF getAllNodeCondition() const
+ {
+ if( mNodeTimedCondition.valid() && mNodeTimedCondition.isNotEqualTrue() )
+ {
+ return( ExpressionConstructor::andExpr(
+ mNodeCondition, mNodeTimedCondition) );
+ }
+ else
+ {
+ return( mNodeCondition );
+ }
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mNodeCondition
+ */
+ inline const BF & getNodeCondition() const
+ {
+ return( mNodeCondition );
+ }
+
+ inline bool hasNodeCondition() const
+ {
+ return( mNodeCondition.valid() );
+ }
+
+ inline void setNodeCondition(const BF & aCondition)
+ {
+ mNodeCondition = aCondition;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mNodeTimedCondition
+ */
+ inline const BF & getNodeTimedCondition() const
+ {
+ return( mNodeTimedCondition );
+ }
+
+ inline bool hasNodeTimedCondition() const
+ {
+ return( mNodeTimedCondition.valid() );
+ }
+
+ inline void setNodeTimedCondition(const BF & aTimedCondition)
+ {
+ mNodeTimedCondition = aTimedCondition;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mGlobalNodeConditionEnabledFlag
+ * mLocalNodeConditionEnabledFlag
+ */
+ inline bool isEnabledNodeCondition() const
+ {
+ return( mGlobalNodeConditionEnabledFlag ||
+ mLocalNodeConditionEnabledFlag );
+ }
+
+ inline void setEnabledGlobalNodeCondition(bool aCondition = true)
+ {
+ mGlobalNodeConditionEnabledFlag = aCondition;
+ }
+
+ inline void setEnabledLocalNodeCondition(bool aCondition = true)
+ {
+ mLocalNodeConditionEnabledFlag = aCondition;
+ }
+
+
+ /**
+ * Serialization
+ */
+ void toStream(OutStream & os) const;
+
+ inline std::string str() const
+ {
+ return( strStateConf() );
+ }
+
+ void toStreamData(OutStream & os) const;
+
+ void toFscn(OutStream & os, const ExecutionData * aPreviousExecData) const;
+
+
+ /**
+ * string of a state configuration of an ExecutionData
+ * !UNUSED!
+ inline std::string strStateIdleOrRunning() const
+ {
+ if( getSystemRuntimeForm()->hasOnSchedule()
+ || getSystemRuntimeForm()->hasChild() )
+ {
+ return( strStateIdleOrRunning( getSystemRuntimeForm() ) );
+ }
+ else
+ {
+ return( "(" + strStateIdleOrRunning( getSystemRuntime() ) + ")" );
+ }
+ }
+
+ inline std::string strStateIdleOrRunning(const RuntimeForm & aRF) const
+ {
+ StringOutStream oss;
+
+ toStreamStateIdleOrRunning(oss, aRF);
+
+ return( oss.str() );
+ }
+ * !UNUSED!
+ */
+
+ void toStreamStateIdleOrRunning(
+ OutStream & os, const RuntimeForm & aRF) const;
+
+ /**
+ * string of a state configuration of an ExecutionData
+ *
+ * LIFELINE STATE IDENTIFIER
+ * %1% --> lifeline runtime pid
+ * %2% --> lifeline identifier
+ * %3% --> state runtime pid
+ * %4% --> state identifier
+ */
+ OutStream & toStreamLifelineStateFormat(
+ OutStream & os, const RuntimeForm & aRF,
+ const std::string & formatLifelineStatePattern = "%3%:%4%") const;
+
+ inline std::string strStateConf(
+ const std::string & formatLifelineStatePattern = "%3%:%4%") const
+ {
+ if( getSystemRuntime().hasOnSchedule() )
+ {
+ return( strStateConf(
+ getSystemRuntime() , formatLifelineStatePattern ) );
+ }
+ else
+ {
+ return( "(" + strStateConf( getSystemRuntime() ,
+ formatLifelineStatePattern ) + ")" );
+ }
+ }
+
+ std::string strStateConf(const RuntimeForm & aRF,
+ const std::string & formatLifelineStatePattern = "%3%:%4%") const
+ {
+ StringOutStream oss;
+
+ toStreamStateConf(oss, aRF, formatLifelineStatePattern);
+
+ return( oss.str() );
+ }
+
+ void toStreamStateConf(OutStream & os, const RuntimeForm & aRF,
+ const std::string & formatLifelineStatePattern = "%3%:%4%") const;
+
+
+ /**
+ * string of a state configuration of an ExecutionData
+ */
+ inline std::string strStateConfToFscn() const
+ {
+ if( getSystemRuntime().hasOnSchedule()
+ || getSystemRuntime().hasChild() )
+ {
+ return( strStateConfToFscn( getSystemRuntime() ) );
+ }
+ else
+ {
+ return( "(" + strStateConfToFscn( getSystemRuntime() ) + ")" );
+ }
+ }
+
+ inline std::string strStateConfToFscn(const RuntimeForm & aRF) const
+ {
+ StringOutStream oss;
+
+ toStreamStateConfToFscn(oss, aRF);
+
+ return( oss.str() );
+ }
+
+ void toStreamStateConfToFscn(
+ OutStream & os, const RuntimeForm & aRF) const;
+
+
+ /**
+ * GETTER - SETTER
+ * mRunnableElementTrace
+ */
+ inline BF & getRunnableElementTrace()
+ {
+ return( mRunnableElementTrace );
+ }
+
+ inline const BF & getRunnableElementTrace() const
+ {
+ return( mRunnableElementTrace );
+ }
+
+ inline bool hasRunnableElementTrace() const
+ {
+ return( mRunnableElementTrace.valid() );
+ }
+
+ inline void setRunnableElementTrace(const BF & aRunnableElementTrace)
+ {
+ mRunnableElementTrace = aRunnableElementTrace;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mIOElementTrace
+ */
+ inline BF & getIOElementTrace()
+ {
+ return( mIOElementTrace );
+ }
+
+ inline const BF & getIOElementTrace() const
+ {
+ return( mIOElementTrace );
+ }
+
+ inline bool hasIOElementTrace() const
+ {
+ return( mIOElementTrace.valid() );
+ }
+
+ inline void setIOElementTrace(const BF & anIOElementTrace)
+ {
+ mIOElementTrace = anIOElementTrace;
+ }
+
+
+ /**
+ * GETTER
+ * mRunnableElementTrace
+ * mIOElementTrace
+ */
+//$DELETE
+ inline bool notEvaluated() const
+ {
+ return( mRunnableElementTrace.invalid()
+ && mIOElementTrace.invalid() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mOnInit
+ */
+ inline const BFCode & getOnInit() const
+ {
+ return( mOnInit );
+ }
+
+ inline bool hasOnInit() const
+ {
+ return( mOnInit.valid() );
+ }
+
+ inline void setOnInit(const BFCode & onInit)
+ {
+ mOnInit = onInit;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mOnSchedule
+ */
+ inline const BFCode & getOnSchedule() const
+ {
+ return( mOnSchedule );
+ }
+
+ inline bool hasOnSchedule() const
+ {
+ return( mOnSchedule.valid() );
+ }
+
+ inline void setOnSchedule(const BFCode & onSchedule)
+ {
+ mOnSchedule = onSchedule;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mTableOfRuntimeForm
+ */
+ inline const TableOfRuntimeT & getTableOfRuntime() const
+ {
+ return( mTableOfRuntime );
+ }
+
+
+ inline RuntimeForm & getRuntime(avm_size_t offset)
+ {
+ return( mTableOfRuntime.ref(offset) );
+ }
+
+ inline const RuntimeForm & getRuntime(avm_size_t offset) const
+ {
+ return( mTableOfRuntime.ref(offset) );
+ }
+
+
+ inline RuntimeForm & getRuntime(const RuntimeID & aRID)
+ {
+ return( mTableOfRuntime.ref( aRID.getOffset() ) );
+ }
+
+ inline const RuntimeForm & getRuntime(const RuntimeID & aRID) const
+ {
+ return( mTableOfRuntime.ref( aRID.getOffset() ) );
+ }
+
+
+ inline const RuntimeForm * ptrRuntime(avm_size_t offset) const
+ {
+ return( mTableOfRuntime.at(offset) );
+ }
+
+ inline RuntimeForm * ptrRuntime(const RuntimeID & aRID)
+ {
+ return( mTableOfRuntime.at( aRID.getOffset() ) );
+ }
+
+ inline const RuntimeForm * ptrRuntime(const RuntimeID & aRID) const
+ {
+ return( mTableOfRuntime.at( aRID.getOffset() ) );
+ }
+
+
+ inline const RuntimeID & getRuntimeID(avm_size_t rid) const
+ {
+ return( mTableOfRuntime.at(rid)->getRID() );
+ }
+
+ const RuntimeID & getRuntimeID(const ExecutableForm * anExecutable) const;
+
+ const RuntimeID & getRuntimeID(InstanceOfMachine * anInstance) const;
+
+ const RuntimeID & getRuntimeID(
+ const std::string & aFullyQualifiedNameID) const;
+
+ const RuntimeID & getRuntimeIDByNameID(const std::string & aNameID) const;
+
+
+ RuntimeID getRuntimeContainerRID(const RuntimeID & aRID,
+ BaseInstanceForm * anInstance) const;
+
+ RuntimeID getRuntimeContainerRID(BaseInstanceForm * anInstance) const
+ {
+ return( getRuntimeContainerRID(mRID, anInstance) );
+ }
+
+
+ inline const BFCode & getRuntimeFormOnSchedule(const RuntimeID & aRID) const
+ {
+ return( mTableOfRuntime.at(aRID.getOffset())->getOnSchedule() );
+ }
+
+ inline const BFCode & getRuntimeFormOnDefer(const RuntimeID & aRID) const
+ {
+ return( mTableOfRuntime.at(aRID.getOffset())->getOnDefer() );
+ }
+
+
+
+ // assign <==> release_acquire
+ inline void saveRuntimeForm(avm_size_t offset, RuntimeForm * aRF) const
+ {
+ mTableOfRuntime.set(offset, aRF);
+ }
+
+ // assign <==> release_acquire
+ inline void assignRuntimeForm(avm_size_t offset, RuntimeForm * aRF) const
+ {
+ mTableOfRuntime.assign(offset, aRF);
+ }
+
+
+ /***************************************************************************
+ ***************************************************************************
+ * GETTER - SETTER
+ * mTableOfRuntime
+ *
+ * make writable
+ ***************************************************************************
+ */
+ inline RuntimeForm & getWritableRuntime(const RuntimeID & aRID)
+ {
+ return( mTableOfRuntime.refWritable( aRID.getOffset() ) );
+ }
+
+
+ /**
+ * GETTER
+ * for data in RuntimeForm DataTable
+ */
+ const BF & getDataByQualifiedNameID(
+ const std::string & aQualifiedNameID, InstanceOfData * & var) const;
+
+ const BF & getDataByNameID(const std::string & aNameID) const;
+
+
+ /**
+ * GETTER - SETTER
+ * mTableOfRFStateFlags
+ */
+ inline const APTableOfRuntimeFormState & getRuntimeFormStateTable() const
+ {
+ return( mTableOfRFStateFlags );
+ }
+
+
+ inline PROCESS_EVAL_STATE getRuntimeFormState(avm_size_t rid) const
+ {
+ return( mTableOfRFStateFlags->stateAt(rid) );
+ }
+
+ inline PROCESS_EVAL_STATE getRuntimeFormState(
+ const RuntimeID & aRID) const
+ {
+ return( mTableOfRFStateFlags->stateAt( aRID.getOffset() ) );
+ }
+
+ bool checkRunningForm(
+ const BF & aRunnableElementTrace, const RuntimeID & aRID);
+
+
+ // CREATED STATE
+ inline bool isCreated(const RuntimeID & aRID) const
+ {
+ return( mTableOfRFStateFlags->isCreated( aRID.getOffset() ) );
+ }
+
+ // LOADED STATE
+ inline bool isLoaded(const RuntimeID & aRID) const
+ {
+ return( mTableOfRFStateFlags->isLoaded( aRID.getOffset() ) );
+ }
+
+ // STARTING STATE
+ inline bool isStarting(const RuntimeID & aRID) const
+ {
+ return( mTableOfRFStateFlags->isStarting( aRID.getOffset() ) );
+ }
+
+ inline bool isIniting(const RuntimeID & aRID) const
+ {
+ return( mTableOfRFStateFlags->isIniting( aRID.getOffset() ) );
+ }
+
+ // STOPPING STATE
+ inline bool isStopping(const RuntimeID & aRID) const
+ {
+ return( mTableOfRFStateFlags->isStopping( aRID.getOffset() ) );
+ }
+
+ // STOPPED STATE
+ inline bool isStopped(const RuntimeID & aRID) const
+ {
+ return( mTableOfRFStateFlags->isStopped( aRID.getOffset() ) );
+ }
+
+ // FINALIZING STATE
+ inline bool isFinalizing(const RuntimeID & aRID) const
+ {
+ return( mTableOfRFStateFlags->isFinalizing( aRID.getOffset() ) );
+ }
+
+ // FINALIZED STATE
+ inline bool isFinalized(const RuntimeID & aRID) const
+ {
+ return( mTableOfRFStateFlags->isFinalized( aRID.getOffset() ) );
+ }
+
+ // DESTROYED STATE
+ inline bool isDestroyed(const RuntimeID & aRID) const
+ {
+ return( mTableOfRFStateFlags->isDestroyed( aRID.getOffset() ) );
+ }
+
+ // FINALIZED or DESTROYED STATE
+ inline bool isFinalizedOrDestroyed(const RuntimeID & aRID) const
+ {
+ return( mTableOfRFStateFlags->
+ isFinalizedOrDestroyed( aRID.getOffset() ) );
+ }
+
+ // ALIVE STATE
+ inline bool isAlive(const RuntimeID & aRID) const
+ {
+ return( mTableOfRFStateFlags->isAlive( aRID.getOffset() ) );
+ }
+
+ // SUPENDED STATE
+ inline bool isSuspended(const RuntimeID & aRID) const
+ {
+ return( mTableOfRFStateFlags->isSuspended( aRID.getOffset() ) );
+ }
+
+ // WAITING STATE
+ inline bool isWaiting(const RuntimeID & aRID) const
+ {
+ return( mTableOfRFStateFlags->isWaiting( aRID.getOffset() ) );
+ }
+
+ // WAITING JOIN STATE
+ inline bool isWaitingJoin(const RuntimeID & aRID) const
+ {
+ return( mTableOfRFStateFlags->isWaitingJoin( aRID.getOffset() ) );
+ }
+
+ // DISABLE STATE
+ inline bool isDisable(const RuntimeID & aRID) const
+ {
+ return( mTableOfRFStateFlags->isDisable( aRID.getOffset() ) );
+ }
+
+ // DISABLE STATE
+ inline bool isAborted(const RuntimeID & aRID) const
+ {
+ return( mTableOfRFStateFlags->isAborted( aRID.getOffset() ) );
+ }
+
+ // DISABLE or ABORTED STATE
+ inline bool isDisableOrAborted(const RuntimeID & aRID) const
+ {
+ return( mTableOfRFStateFlags->isDisableOrAborted( aRID.getOffset() ) );
+ }
+
+ // IDLE STATE
+ inline bool isIdle() const
+ {
+ return( mTableOfRFStateFlags->isIdle( mRID.getOffset() ) );
+ }
+
+ inline bool isIdle(const RuntimeID & aRID) const
+ {
+ return( mTableOfRFStateFlags->isIdle( aRID.getOffset() ) );
+ }
+
+ // RUNNING STATE
+ inline bool isRunning(const RuntimeID & aRID) const
+ {
+ return( mTableOfRFStateFlags->isRunning( aRID.getOffset() ) );
+ }
+
+ // IDLE or RUNNING STATE
+ inline bool isIdleOrRunning(const RuntimeID & aRID) const
+ {
+ return( mTableOfRFStateFlags->isIdleOrRunning( aRID.getOffset() ) );
+ }
+
+ // RUNNABLE STATE
+ inline bool isRunnable(const RuntimeID & aRID) const
+ {
+ return( mTableOfRFStateFlags->isRunnable( aRID.getOffset() ) );
+ }
+
+ inline bool isunRunnable(const RuntimeID & aRID) const
+ {
+ return( mTableOfRFStateFlags->isunRunnable( aRID.getOffset() ) );
+ }
+
+ inline bool isunRunnableSystem() const
+ {
+ return( mTableOfRFStateFlags->isunRunnable( SYSTEM_RUNTIME_OFFSET ) );
+ }
+
+ // CREATED or RUNNABLE STATE
+ inline bool isCreatedOrRunnable(const RuntimeID & aRID) const
+ {
+ return( mTableOfRFStateFlags->isCreatedOrRunnable( aRID.getOffset() ) );
+ }
+
+ // DEFINED / UNDEFINED STATE
+ inline bool isDefinedPES(const RuntimeID & aRID) const
+ {
+ return( mTableOfRFStateFlags->isDefined( aRID.getOffset() ) );
+ }
+
+ inline bool isUndefinedPES(avm_offset_t offset) const
+ {
+ return( mTableOfRFStateFlags->isUndefined( offset ) );
+ }
+
+ inline void makeWritableRuntimeFormStateTable()
+ {
+ mTableOfRFStateFlags.makeWritable();
+ }
+
+ inline void mwsetRuntimeFormState(const RuntimeID & aRID,
+ PROCESS_EVAL_STATE aPES)
+ {
+ makeWritableRuntimeFormStateTable();
+
+ mTableOfRFStateFlags->stateSet(aRID.getOffset(), aPES);
+ }
+
+ inline void setRuntimeFormState(const RuntimeID & aRID,
+ PROCESS_EVAL_STATE aPES)
+ {
+ mTableOfRFStateFlags->stateSet(aRID.getOffset(), aPES);
+ }
+
+
+ inline void mwsetRuntimeFormState(avm_size_t rid,
+ PROCESS_EVAL_STATE aPES)
+ {
+ makeWritableRuntimeFormStateTable();
+
+ mTableOfRFStateFlags->stateSet(rid, aPES);
+ }
+
+ inline void setRuntimeFormState(avm_size_t rid,
+ PROCESS_EVAL_STATE aPES)
+ {
+ mTableOfRFStateFlags->stateSet(rid, aPES);
+ }
+
+
+ // ASSIGNABILITY
+ inline Bitset * getAssigned(avm_size_t rid) const
+ {
+ return( mTableOfRFStateFlags->getAssigned(rid) );
+ }
+
+ inline bool isAssigned(const RuntimeID & aRID, avm_size_t rid) const
+ {
+ return( mTableOfRFStateFlags->isAssigned(aRID.getOffset(), rid) );
+ }
+
+
+ inline void mwsetAssigned(const RuntimeID & aRID,
+ avm_offset_t varOffset, bool flag = true)
+ {
+ makeWritableRuntimeFormStateTable();
+
+ mTableOfRFStateFlags->setAssigned(*this,
+ aRID.getOffset(), varOffset, flag);
+ }
+
+ inline void setAssigned(const RuntimeID & aRID,
+ avm_offset_t varOffset, bool flag = true)
+ {
+ mTableOfRFStateFlags->setAssigned(*this,
+ aRID.getOffset(), varOffset, flag);
+ }
+
+
+ /**
+ * GETTER
+ * mTableOfAssignedFlag
+ */
+ TableOfRuntimeFormState::TableOfAssignedFlag getTableOfAssignedFlag()
+ {
+ return( mTableOfRFStateFlags->getTableOfAssignedFlag() );
+ }
+
+ void setTableOfAssignedFlag(
+ TableOfRuntimeFormState::TableOfAssignedFlag aTableOfAssignedFlag)
+ {
+ mTableOfRFStateFlags->setTableOfAssignedFlag( aTableOfAssignedFlag );
+ }
+
+
+ /**
+ * GETTER
+ * mSaveTableOfAssignedFlag
+ */
+ TableOfRuntimeFormState::
+ TableOfAssignedFlag getSaveTableOfAssignedFlag() const;
+
+ /**
+ * GETTER - SETTER
+ * RuntimeForm CHILD
+ */
+ inline const RuntimeID & getRuntimeFormChild(const RuntimeID & aRID,
+ const InstanceOfMachine * anInstance) const
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( getRuntime(aRID).getChild(
+ anInstance->getOffset() ).getInstance() == anInstance )
+ << "Fatal Error: Bad child< "
+ << anInstance->getQualifiedNameID()
+ << " > Offset in runtime machine< "
+ << aRID.getQualifiedNameID() << " >!!!"
+ << SEND_EXIT;
+
+ return( getRuntime(aRID).getChild(anInstance->getOffset()) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mStackOfLocalRuntime
+ */
+ inline void createLocalRuntimeStack()
+ {
+ mStackOfLocalRuntime =
+ APStackOfLocalRuntime( new StackOfLocalRuntime() );
+ }
+
+ inline void destroyLocalRuntimeStack()
+ {
+ mStackOfLocalRuntime.destroy();
+ }
+
+ inline APStackOfLocalRuntime & getLocalRuntimes()
+ {
+ return( mStackOfLocalRuntime );
+ }
+
+ inline const APStackOfLocalRuntime & getLocalRuntimes() const
+ {
+ return( mStackOfLocalRuntime );
+ }
+
+
+ inline bool hasLocalRuntime() const
+ {
+ return( mStackOfLocalRuntime.valid()
+ && mStackOfLocalRuntime->nonempty() );
+ }
+
+ inline bool hasLocalRuntimeStack() const
+ {
+ return( mStackOfLocalRuntime.valid() );
+ }
+
+ inline void makeWritableLocalRuntimeStack()
+ {
+ if( mStackOfLocalRuntime.valid() )
+ {
+ mStackOfLocalRuntime.makeWritable();
+ }
+ else
+ {
+ mStackOfLocalRuntime.replacePointer( new StackOfLocalRuntime() );
+ }
+ }
+
+ inline void setLocalRuntime(avm_size_t offset,
+ const LocalRuntime & aLocalRuntime)
+ {
+ mStackOfLocalRuntime->setLocalRuntime(offset, aLocalRuntime);
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mParametersRuntimeForm
+ */
+ inline const ParametersRuntimeForm & getParametersRuntimeForm() const
+ {
+ return( static_cast< const ParametersRuntimeForm & >(
+ mTableOfRuntime.ref(PARAM_MACHINE_RUNTIME_OFFSET) ) );
+ }
+
+ inline ParametersRuntimeForm & getWritableParametersRuntimeForm()
+ {
+ ParametersRuntimeForm & pRF = static_cast< ParametersRuntimeForm & >(
+ mTableOfRuntime.refWritable(PARAM_MACHINE_RUNTIME_OFFSET) );
+
+ pRF.resetOffset();
+
+ return( pRF );
+
+// return( static_cast< ParametersRuntimeForm & >(
+// mTableOfRuntime.refWritable(
+// PARAM_MACHINE_RUNTIME_OFFSET) ) );
+ }
+
+ inline BF bfParametersRuntimeForm() const
+ {
+ return( mTableOfRuntime.to_sp< BF >( PARAM_MACHINE_RUNTIME_OFFSET ) );
+ }
+
+
+ inline const RuntimeID & getParametersRID() const
+ {
+ return( getRuntime(PARAM_MACHINE_RUNTIME_OFFSET).getRID() );
+ }
+
+ inline const BF & saveParameter(InstanceOfData * anInstance)
+ {
+ return( getWritableParametersRuntimeForm().saveParameter(anInstance) );
+ }
+
+ inline void appendParameters(BFList & paramList)
+ {
+ getWritableParametersRuntimeForm().appendParameters(paramList);
+ }
+
+
+ inline void saveParametersRuntimeForm(
+ ParametersRuntimeForm * paramsRF) const
+ {
+ mTableOfRuntime.set(PARAM_MACHINE_RUNTIME_OFFSET, paramsRF);
+ }
+
+ inline void assignParametersRuntimeForm(
+ ParametersRuntimeForm * paramsRF) const
+ {
+ mTableOfRuntime.assign(PARAM_MACHINE_RUNTIME_OFFSET, paramsRF);
+ }
+
+ inline void assignParametersRuntimeForm(const BF & paramsRF) const
+ {
+ mTableOfRuntime.assign(PARAM_MACHINE_RUNTIME_OFFSET,
+ paramsRF.to_ptr< RuntimeForm >() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * System RuntimeForm
+ */
+ inline const RuntimeForm & getSystemRuntime() const
+ {
+ return( getRuntime(SYSTEM_RUNTIME_OFFSET) );
+ }
+
+ inline const RuntimeID & getSystemRID() const
+ {
+ return( getRuntime(SYSTEM_RUNTIME_OFFSET).getRID() );
+ }
+
+ inline void setSystemRID()
+ {
+ setRID( getSystemRID() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mRID
+ */
+ inline const RuntimeID & getRID() const
+ {
+ return( mRID );
+ }
+
+ inline void setRID(const RuntimeID & aRID)
+ {
+ mRID = aRID;
+ }
+
+ /*
+ * GETTER - SETTER
+ * Avm Ending Execution Status
+ */
+ inline AVM_EXEC_ENDING_STATUS getAEES() const
+ {
+ return( mAEES );
+ }
+
+ inline void setAEES(AVM_EXEC_ENDING_STATUS anAEES)
+ {
+ mAEES = anAEES;
+ }
+
+
+ /*
+ * GETTER - SETTER
+ * Avm Execution Synchronization Point
+ */
+ inline void pushExecSyncPoint(
+ ExecutionSynchronizationPoint * anExecSyncPoint)
+ {
+ if( mEXEC_SYNC_POINT == NULL )
+ {
+ mEXEC_SYNC_POINT = anExecSyncPoint;
+ }
+ else
+ {
+ ExecutionSynchronizationPoint * lastESP = mEXEC_SYNC_POINT;
+ while( lastESP->next != NULL )
+ {
+ lastESP = lastESP->next;
+ }
+ lastESP->next = anExecSyncPoint;
+ }
+ }
+
+
+ /**
+ * INSTANCIATION BOUND TEST
+ */
+ bool couldBeInstanciated(InstanceOfMachine * anInstance) const;
+
+
+ /**
+ * COMPARISON
+ * OPERATOR
+ *
+ * TRIVIAL EQUALITY
+ */
+ virtual bool isTEQ(const ExecutionData * anED) const
+ {
+ if( this == anED )
+ {
+ return( true );
+ }
+ else if( mTableOfRFStateFlags->equalsState(
+ anED->mTableOfRFStateFlags ) )
+ {
+ return( (mTableOfRuntime == anED->mTableOfRuntime)
+ && mPathCondition.isTEQ(anED->mPathCondition)
+ && mPathTimedCondition.isTEQ(anED->mPathTimedCondition)
+ && (mStackOfLocalRuntime == anED->mStackOfLocalRuntime) );
+ }
+ return( false );
+ }
+
+ inline bool isTNEQ(const ExecutionData * anED) const
+ {
+ return( not isTEQ( anED ) );
+ }
+
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// AVM SMART POINTER FOR ExecutionData
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+#define AVM_DEBUG_EXECUTION_DATA_POINTER true
+#undef AVM_DEBUG_EXECUTION_DATA_POINTER
+
+#if defined(AVM_DEBUG_EXECUTION_DATA_POINTER)
+
+ #define AVM_DECLARE_DEBUG_EXECUTION_DATA_PTR const ExecutionData * debugPTR;
+
+ #define AVM_INIT_DEBUG_EXECUTION_DATA_PTR( ptr ) , debugPTR( ptr )
+
+ #define AVM_ASSIGN_STMNT_DEBUG_EXECUTION_DATA_PTR( ptr ) debugPTR = ptr;
+
+ #define AVM_ASSIGN_EXPR_DEBUG_EXECUTION_DATA_PTR( ptr ) debugPTR = ptr
+
+#else
+
+ #define AVM_DECLARE_DEBUG_EXECUTION_DATA_PTR
+
+ #define AVM_INIT_DEBUG_EXECUTION_DATA_PTR( ptr )
+
+ #define AVM_ASSIGN_STMNT_DEBUG_EXECUTION_DATA_PTR( ptr )
+
+ #define AVM_ASSIGN_EXPR_DEBUG_EXECUTION_DATA_PTR( ptr ) ptr
+
+#endif
+
+
+class APExecutionData :
+ public AvmPointer< ExecutionData , DestroyElementPolicy >
+{
+
+private:
+ /**
+ * TYPEDEF
+ */
+ typedef AvmPointer< ExecutionData , DestroyElementPolicy > base_this_type;
+
+
+protected:
+ /**
+ * Only for debug facilities
+ */
+ AVM_DECLARE_DEBUG_EXECUTION_DATA_PTR
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ APExecutionData()
+ : base_this_type( )
+ AVM_INIT_DEBUG_EXECUTION_DATA_PTR( NULL )
+ {
+ //!!! NOTHING
+ }
+
+ explicit APExecutionData(ExecutionData * anED)
+ : base_this_type( AVM_ASSIGN_EXPR_DEBUG_EXECUTION_DATA_PTR( anED ) )
+ {
+ //!!! NOTHING
+ }
+
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~APExecutionData()
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * resize
+ */
+ void resize(avm_size_t newMachineCount)
+ {
+ makeWritable();
+
+ raw_pointer()->resize(newMachineCount);
+ }
+
+
+ /**
+ * GETTER
+ * the Previous ExecutionData
+ */
+ APExecutionData & getPrevious();
+
+ const APExecutionData & getPrevious() const;
+
+ bool hasPrevious() const;
+
+
+ inline void mwsetPathCondition(const BF & mCondition)
+ {
+ makeWritable();
+
+ raw_pointer()->setPathCondition( mCondition );
+
+ }
+
+ inline void mwsetPathTimedCondition(const BF & mCondition)
+ {
+ makeWritable();
+
+ raw_pointer()->setPathTimedCondition( mCondition );
+
+ }
+
+
+ /**
+ * SETTER
+ * make Modifiable
+ */
+ inline void makeModifiableParamTable()
+ {
+ makeWritable();
+
+ // TODO Revoir la gestion de la liste des nouveaux parametres
+// if( hasParam() && getParam()->isMultiple() )
+// {
+// decRefCounter( getParam() );
+// setParam( new TableOfInstance() );
+// }
+ }
+
+
+ inline void makeModifiableLocalRuntime(LocalRuntime & aLocalRuntime)
+ {
+ makeWritable();
+
+ raw_pointer()->makeWritableLocalRuntimeStack();
+
+ aLocalRuntime.makeWritable();
+
+ raw_pointer()->setLocalRuntime(
+ aLocalRuntime.getOffset() , aLocalRuntime );
+ }
+
+
+ inline RuntimeForm & getWritableRuntime(const RuntimeID & aRID)
+ {
+ makeWritable();
+
+ return( raw_pointer()->getWritableRuntime(aRID) );
+
+ }
+
+ inline APTableOfData & getWritableRuntimeDataTable(const RuntimeID & aRID)
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT(
+ raw_pointer()->getRuntime(aRID).hasDataTable() )
+ << "Unexpected RuntimeForm without data !!!"
+ << SEND_EXIT;
+
+ makeWritable();
+
+ return( raw_pointer()->getWritableRuntime(aRID).getWritableDataTable() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mTableOfRFStateFlags
+ */
+
+ inline void mwsetRuntimeFormState(
+ const RuntimeID & aRID, PROCESS_EVAL_STATE aPES)
+ {
+ makeWritable();
+
+ raw_pointer()->mwsetRuntimeFormState(aRID.getOffset(), aPES);
+ }
+
+ inline void mwsetRuntimeFormState(PROCESS_EVAL_STATE aPES)
+ {
+ mwsetRuntimeFormState(raw_pointer()->mRID, aPES);
+ }
+
+ inline void mwsetRuntimeFormState(const RuntimeID & aRID,
+ PROCESS_EVAL_STATE oldPES, PROCESS_EVAL_STATE aPES)
+ {
+ makeWritable();
+
+ if( raw_pointer()->getRuntimeFormState(aRID) == oldPES )
+ {
+ raw_pointer()->mwsetRuntimeFormState(aRID.getOffset(), aPES);
+
+ raw_pointer()->setAEES( RuntimeDef::PES_to_AEES(
+ aPES, raw_pointer()->getAEES() ) );
+ }
+ }
+
+
+ /**
+ * SETTER
+ * mOnSchedule
+ */
+ inline void mwsetRuntimeFormOnSchedule(
+ const RuntimeID & aRID, const BFCode & onSchedule)
+ {
+ if( aRID.getExecutable()->isMutableSchedule() &&
+ (onSchedule != raw_pointer()->getRuntime(aRID).getOnSchedule()) )
+ {
+ makeWritable();
+
+ raw_pointer()->getWritableRuntime(aRID).setOnSchedule( onSchedule );
+ }
+ }
+
+ inline void mwsetRuntimeFormOnScheduleAndIdle(const RuntimeID & aRID)
+ {
+ mwsetRuntimeFormOnSchedule(aRID.getPRID(), aRID.getOnRunning());
+
+// mwsetRuntimeFormOnSchedule(aRID.getPRID(),
+// aRID.hasOnRunning() ? aRID.getOnRunning() :
+// StatementConstructor::newOptiNopCode(
+// OperatorManager::OPERATOR_RUN, aRID,
+// AVM_ARG_MACHINE_RID) );
+
+ if( not raw_pointer()->isIdle() )
+ {
+ raw_pointer()->mwsetRuntimeFormState(aRID, PROCESS_IDLE_STATE);
+ }
+ }
+
+
+ /**
+ * SETTER
+ * mDefer
+ */
+ inline void mwsetRuntimeFormOnDefer(
+ const RuntimeID & aRID, const BFCode & onDefer)
+ {
+ makeWritable();
+
+ raw_pointer()->getWritableRuntime( aRID ).setOnDefer( onDefer );
+ }
+
+
+ /*
+ * GETTER - SETTER
+ * Avm Execution Synchronization Point
+ */
+ inline void pushExecSyncPoint(
+ ExecutionSynchronizationPoint * anExecSyncPoint)
+ {
+ makeWritable();
+
+ raw_pointer()->pushExecSyncPoint( anExecSyncPoint );
+ }
+
+ /*
+ * SETTER
+ * Avm Ending Execution Status
+ */
+ inline void mwsetAEES(AVM_EXEC_ENDING_STATUS anAEES)
+ {
+ makeWritable();
+
+ raw_pointer()->setAEES( anAEES );
+ }
+
+
+ /**
+ * SETTER
+ * mIOElementTrace
+ */
+ inline void mwsetIOElementTrace(const BF & anIOElementTrace)
+ {
+ makeWritable();
+
+ raw_pointer()->setIOElementTrace( anIOElementTrace );
+ }
+
+
+ /**
+ * SETTER
+ * mRunnableElementTrace
+ */
+ inline void mwsetRunnableElementTrace(const BF & aRunnableElementTrace)
+ {
+ makeWritable();
+
+ raw_pointer()->setRunnableElementTrace(aRunnableElementTrace);
+ }
+
+
+ /**
+ * SETTER
+ * mRID
+ */
+
+ inline void mwsetRID(const RuntimeID & aRID)
+ {
+ makeWritable();
+ raw_pointer()->setRID( aRID );
+ }
+
+
+
+ /**
+ * GETTER - SETTER
+ * mParametersRuntimeForm
+ */
+ inline const BF & saveParameter(InstanceOfData * anInstance)
+ {
+ makeWritable();
+
+ return( raw_pointer()->saveParameter(anInstance) );
+ }
+
+ inline void appendParameters(BFList & paramList)
+ {
+ makeWritable();
+
+ raw_pointer()->appendParameters(paramList);
+ }
+
+
+ inline ParametersRuntimeForm & getWritableParametersRuntimeForm()
+ {
+ makeWritable();
+
+ return( raw_pointer()->getWritableParametersRuntimeForm() );
+ }
+
+
+
+
+ /**
+ * COMPARISON
+ * OPERATOR
+ *
+ * TRIVIAL EQUALITY
+ */
+ inline bool isTEQ(const APExecutionData & prevED)
+ {
+ return( raw_pointer()->isTEQ( prevED.raw_pointer() ) );
+ }
+
+ inline bool isTNEQ(const APExecutionData & prevED)
+ {
+ return( raw_pointer()->isTNEQ( prevED.raw_pointer() ) );
+ }
+
+
+ /**
+ * DEFAULT NULL
+ */
+ static APExecutionData REF_NULL;
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+// TYPE DEFINITION for CONTAINER
+////////////////////////////////////////////////////////////////////////////////
+
+typedef Collection< APExecutionData > CollectionOfAPExecutionData;
+
+typedef List < APExecutionData > ListOfAPExecutionData;
+
+typedef Vector < APExecutionData > VectorOfAPExecutionData;
+
+typedef Vector < ListOfAPExecutionData > VectorOfListOfAPExecutionData;
+
+
+}
+
+#endif /*EXECUTIONDATA_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/ExecutionInformation.cpp b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionInformation.cpp
new file mode 100644
index 0000000..c844726
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionInformation.cpp
@@ -0,0 +1,666 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 11 oct. 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ExecutionInformation.h"
+
+#include <fam/api/AbstractProcessorUnit.h>
+
+#include <fam/coverage/FormulaCoverageFilter.h>
+
+#include <fam/hitorjump/AvmHitOrJumpProcessor.h>
+
+#include <fam/testing/OfflineTestProcessor.h>
+
+#include <fml/trace/TracePoint.h>
+
+
+namespace sep
+{
+
+
+/**
+ * GETTER - SETTER
+ * mProcessorRegisterTool
+ */
+bool GenericInfoData::isInfo(const AbstractProcessorUnit & aProcessor) const
+{
+ return( isInfo(aProcessor.REGISTER_TOOL()) || /*TODO &&*/
+ isID(aProcessor.getParameterWObject()) );
+}
+
+bool GenericInfoData::isInfo(
+ const AbstractProcessorUnit & aProcessor, const BF & anID) const
+{
+ return( isInfo(aProcessor.REGISTER_TOOL()) && isID(anID) );
+}
+
+
+/**
+ * Serialization
+ */
+
+std::string GenericInfoData::strUID() const
+{
+ return( mID.valid()
+ ? ( mID.isBuiltinString() ? mID.toBuiltinString() : mID.str() )
+ : "" );
+}
+
+void GenericInfoData::toStream(OutStream & out) const
+{
+ out << TAB << "info ";
+
+ if ( hasID() )
+ {
+ out << "\"" << getID().str() << "\" {" << EOL;
+ }
+
+ if ( hasData() )
+ {
+ if( getData().is< ExecutionContextHeader >() )
+ {
+ ExecutionContextHeader * ech =
+ getData().to_ptr< ExecutionContextHeader >();
+
+ out << TAB2 << "EC< "
+ << "Id:" << ech->getIdNumber() << " , "
+ << "Ev:" << ech->getEvalNumber() << " , "
+ << "H:" << ech->getHeight() << " , "
+ << "W:" << ech->getWidth() << " >;" << EOL;
+ }
+ else if( getData().isBuiltinString() )
+ {
+ out << TAB2 << getData().toBuiltinString() << EOL;
+ }
+ else
+ {
+ out << TAB2 << getData().str() << EOL;
+ }
+ }
+
+ out << TAB << "}" << EOL_FLUSH;
+}
+
+
+void GenericInfoData::toFscn(OutStream & out) const
+{
+ out << TAB << "<ID:";
+ if ( hasID() )
+ {
+ out << "\"";
+ if( getID().is< AbstractProcessorUnit >() )
+ {
+ AbstractProcessorUnit * anAPU =
+ getID().to_ptr< AbstractProcessorUnit >();
+ out << anAPU->getParameterWObject()->getFullyQualifiedNameID();
+ }
+ else
+ {
+ out << getID().str();
+ }
+ out << "\"";
+ }
+ else
+ {
+ out << "\"NULL\"";
+ }
+
+ if ( hasData() )
+ {
+ out << ",";
+
+ if( getData().is< ExecutionContextHeader >() )
+ {
+ ExecutionContextHeader * ech =
+ getData().to_ptr< ExecutionContextHeader >();
+
+ out << "Id=\"" << ech->getIdNumber() << "\", "
+ << "Ev=\"" << ech->getEvalNumber() << "\", "
+ << "H=\"" << ech->getHeight() << "\", "
+ << "W=\"" << ech->getWidth() << "\"";
+ }
+ else if( getData().is< String >() )
+ {
+ out << "kind=\"" << getData().to_ptr< String >()->getValue()
+ << "\"";
+ }
+ else if( getData().is< AvmCode >() )
+ {
+ out << "avmcode= \"" << getData().str() << "\"";
+ }
+ else if( getData().isInteger() )
+ {
+ out << "value=\"" << getData().toInteger() << "\"";
+ }
+ else if( getData().is< TracePoint >() )
+ {
+ out << "hoj=\"" << getData().to_ptr< TracePoint >()->str() << "\"";
+ }
+ else
+ {
+ out << "kind=\"" << getData()._str() << "\"";
+ }
+ }
+
+ out << ">" << EOL_FLUSH;
+}
+
+
+
+/**
+ * DESTRUCTOR
+ */
+ExecutionInformation::~ExecutionInformation()
+{
+ sep::destroyElement( mFormulaCoverageFilterInfo );
+
+ sep::destroyElement( mHitOrJumpObjectiveInfo );
+
+ sep::destroyElement( mOfflineTestProcessorInfo );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// GenericInfoData
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * APPEND
+ * mGenericInfos
+ */
+void ExecutionInformation::addInfo(const AbstractProcessorUnit & aProcessor,
+ const BF & anID, const BF & aData)
+{
+ mGenericInfos.append( BF( new GenericInfoData(
+ aProcessor.REGISTER_TOOL(), anID, aData) ) );
+}
+
+void ExecutionInformation::addInfo(
+ const AbstractProcessorUnit & aProcessor, const BF & aData)
+{
+ mGenericInfos.append( BF( new GenericInfoData(aProcessor.REGISTER_TOOL(),
+ WObjectManager::toBF(aProcessor.getParameterWObject()), aData) ) );
+}
+
+
+/**
+ * GETTER
+ * mGenericInfos
+ */
+GenericInfoData * ExecutionInformation::getInfo(
+ const IProcessorUnitRegistration & aRegisterTool) const
+{
+ BFList::const_raw_iterator< GenericInfoData > itInfo = mGenericInfos.begin();
+ BFList::const_raw_iterator< GenericInfoData > endInfo = mGenericInfos.end();
+ for( ; itInfo != endInfo ; ++itInfo )
+ {
+ if( itInfo->isInfo(aRegisterTool) )
+ {
+ return( itInfo );
+ }
+ }
+
+ return( NULL );
+}
+
+GenericInfoData * ExecutionInformation::getInfo(
+ const AbstractProcessorUnit & aProcessor) const
+{
+ BFList::const_raw_iterator< GenericInfoData > itInfo = mGenericInfos.begin();
+ BFList::const_raw_iterator< GenericInfoData > endInfo = mGenericInfos.end();
+ for( ; itInfo != endInfo ; ++itInfo )
+ {
+ if( itInfo->isInfo(aProcessor) )
+ {
+ return( itInfo );
+ }
+ }
+
+ return( NULL );
+}
+
+GenericInfoData * ExecutionInformation::getInfo(
+ const AbstractProcessorUnit & aProcessor, const BF & anID) const
+{
+ BFList::const_raw_iterator< GenericInfoData > itInfo = mGenericInfos.begin();
+ BFList::const_raw_iterator< GenericInfoData > endInfo = mGenericInfos.end();
+ for( ; itInfo != endInfo ; ++itInfo )
+ {
+ if( itInfo->isInfo(aProcessor, anID) )
+ {
+ return( itInfo );
+ }
+ }
+
+ return( NULL );
+}
+
+
+GenericInfoData * ExecutionInformation::getInfoWithData(
+ const AbstractProcessorUnit & aProcessor, const BF & aData) const
+{
+ BFList::const_raw_iterator< GenericInfoData > itInfo = mGenericInfos.begin();
+ BFList::const_raw_iterator< GenericInfoData > endInfo = mGenericInfos.end();
+ for( ; itInfo != endInfo ; ++itInfo )
+ {
+ if( itInfo->isInfo(aProcessor) && itInfo->isData(aData) )
+ {
+ return( itInfo );
+ }
+ }
+
+ return( NULL );
+}
+
+GenericInfoData * ExecutionInformation::getInfo(const BF & anID) const
+{
+ BFList::const_raw_iterator< GenericInfoData > itInfo = mGenericInfos.begin();
+ BFList::const_raw_iterator< GenericInfoData > endInfo = mGenericInfos.end();
+ for( ; itInfo != endInfo ; ++itInfo )
+ {
+ if( itInfo->isID(anID) )
+ {
+ return( itInfo );
+ }
+ }
+
+ return( NULL );
+}
+
+GenericInfoData * ExecutionInformation::getInfo(Element * anID) const
+{
+ BFList::const_raw_iterator< GenericInfoData > itInfo = mGenericInfos.begin();
+ BFList::const_raw_iterator< GenericInfoData > endInfo = mGenericInfos.end();
+ for( ; itInfo != endInfo ; ++itInfo )
+ {
+ if( itInfo->isID(anID) )
+ {
+ return( itInfo );
+ }
+ }
+
+ return( NULL );
+}
+
+GenericInfoData * ExecutionInformation::getInfo(
+ Element * anID, const BF & aData) const
+{
+ BFList::const_raw_iterator< GenericInfoData > itInfo = mGenericInfos.begin();
+ BFList::const_raw_iterator< GenericInfoData > endInfo = mGenericInfos.end();
+ for( ; itInfo != endInfo ; ++itInfo )
+ {
+ if( itInfo->isID(anID) && itInfo->isData(aData) )
+ {
+ return( itInfo );
+ }
+ }
+
+ return( NULL );
+}
+
+GenericInfoData * ExecutionInformation::getInfo(
+ const std::string & anID, AVM_OPCODE aPredicate) const
+{
+ BFList::const_raw_iterator< GenericInfoData > itInfo = mGenericInfos.begin();
+ BFList::const_raw_iterator< GenericInfoData > endInfo = mGenericInfos.end();
+ for( ; itInfo != endInfo ; ++itInfo )
+ {
+ if( itInfo->isID(anID, aPredicate) )
+ {
+ return( itInfo );
+ }
+ }
+
+ return( NULL );
+}
+
+
+GenericInfoData * ExecutionInformation::getInfoByData(const BF & aData) const
+{
+ BFList::const_raw_iterator< GenericInfoData > itInfo = mGenericInfos.begin();
+ BFList::const_raw_iterator< GenericInfoData > endInfo = mGenericInfos.end();
+ for( ; itInfo != endInfo ; ++itInfo )
+ {
+ if( itInfo->isData(aData) )
+ {
+ return( itInfo );
+ }
+ }
+
+ return( NULL );
+}
+
+GenericInfoData * ExecutionInformation::getInfoByData(
+ const std::string & aData, AVM_OPCODE aPredicate) const
+{
+ BFList::const_raw_iterator< GenericInfoData > itInfo = mGenericInfos.begin();
+ BFList::const_raw_iterator< GenericInfoData > endInfo = mGenericInfos.end();
+ for( ; itInfo != endInfo ; ++itInfo )
+ {
+ if( itInfo->isData(aData, aPredicate) )
+ {
+ return( itInfo );
+ }
+ }
+
+ return( NULL );
+}
+
+
+/**
+ * REMOVE
+ * mGenericInfos
+ */
+void ExecutionInformation::removeInfo(
+ const IProcessorUnitRegistration & aRegisterTool)
+{
+ BFList::raw_iterator< GenericInfoData > itInfo = mGenericInfos.begin();
+ BFList::raw_iterator< GenericInfoData > endInfo = mGenericInfos.end();
+ for( ; itInfo != endInfo ; )
+ {
+ if( itInfo->isInfo(aRegisterTool) )
+ {
+ itInfo = mGenericInfos.erase( itInfo );
+ }
+ else
+ {
+ ++itInfo;
+ }
+ }
+}
+
+void ExecutionInformation::removeInfo(const AbstractProcessorUnit & aProcessor)
+{
+ BFList::raw_iterator< GenericInfoData > itInfo = mGenericInfos.begin();
+ BFList::raw_iterator< GenericInfoData > endInfo = mGenericInfos.end();
+ for( ; itInfo != endInfo ; )
+ {
+ if( itInfo->isInfo(aProcessor) )
+ {
+ itInfo = mGenericInfos.erase( itInfo );
+ }
+ else
+ {
+ ++itInfo;
+ }
+ }
+}
+
+
+void ExecutionInformation::removeInfo(const BF & anID)
+{
+ BFList::raw_iterator< GenericInfoData > itInfo = mGenericInfos.begin();
+ BFList::raw_iterator< GenericInfoData > endInfo = mGenericInfos.end();
+ for( ; itInfo != endInfo ; )
+ {
+ if( itInfo->isID(anID) )
+ {
+ itInfo = mGenericInfos.erase( itInfo );
+ }
+ else
+ {
+ ++itInfo;
+ }
+ }
+}
+
+void ExecutionInformation::removeInfo(Element * anID)
+{
+ BFList::raw_iterator< GenericInfoData > itInfo = mGenericInfos.begin();
+ BFList::raw_iterator< GenericInfoData > endInfo = mGenericInfos.end();
+ for( ; itInfo != endInfo ; )
+ {
+ if( itInfo->isID(anID) )
+ {
+ itInfo = mGenericInfos.erase( itInfo );
+ }
+ else
+ {
+ ++itInfo;
+ }
+ }
+}
+
+void ExecutionInformation::removeInfo(
+ const std::string & anID, AVM_OPCODE aPredicate)
+{
+ BFList::raw_iterator< GenericInfoData > itInfo = mGenericInfos.begin();
+ BFList::raw_iterator< GenericInfoData > endInfo = mGenericInfos.end();
+ for( ; itInfo != endInfo ; )
+ {
+ if( itInfo->isID(anID, aPredicate) )
+ {
+ itInfo = mGenericInfos.erase( itInfo );
+ }
+ else
+ {
+ ++itInfo;
+ }
+ }
+}
+
+
+void ExecutionInformation::removeInfoByData(const BF & aData)
+{
+ BFList::raw_iterator< GenericInfoData > itInfo = mGenericInfos.begin();
+ BFList::raw_iterator< GenericInfoData > endInfo = mGenericInfos.end();
+ for( ; itInfo != endInfo ; )
+ {
+ if( itInfo->isData(aData) )
+ {
+ itInfo = mGenericInfos.erase( itInfo );
+ }
+ else
+ {
+ ++itInfo;
+ }
+ }
+}
+
+void ExecutionInformation::removeInfoByData(
+ const std::string & aData, AVM_OPCODE aPredicate)
+{
+ BFList::raw_iterator< GenericInfoData > itInfo = mGenericInfos.begin();
+ BFList::raw_iterator< GenericInfoData > endInfo = mGenericInfos.end();
+ for( ; itInfo != endInfo ; )
+ {
+ if( itInfo->isData(aData, aPredicate) )
+ {
+ itInfo = mGenericInfos.erase( itInfo );
+ }
+ else
+ {
+ ++itInfo;
+ }
+ }
+}
+
+
+
+/**
+ * GETTER
+ * Info Data
+ */
+const BF & ExecutionInformation::getInfoData(
+ const IProcessorUnitRegistration & aRegisterTool) const
+{
+ BFList::const_raw_iterator< GenericInfoData > itInfo = mGenericInfos.begin();
+ BFList::const_raw_iterator< GenericInfoData > endInfo = mGenericInfos.end();
+ for( ; itInfo != endInfo ; ++itInfo )
+ {
+ if( itInfo->isInfo(aRegisterTool) )
+ {
+ return( itInfo->getData() );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+const BF & ExecutionInformation::getInfoData(
+ const AbstractProcessorUnit & aProcessor) const
+{
+ BFList::const_raw_iterator< GenericInfoData > itInfo = mGenericInfos.begin();
+ BFList::const_raw_iterator< GenericInfoData > endInfo = mGenericInfos.end();
+ for( ; itInfo != endInfo ; ++itInfo )
+ {
+ if( itInfo->isInfo(aProcessor) )
+ {
+ return( itInfo->getData() );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+const BF & ExecutionInformation::getInfoData(
+ const AbstractProcessorUnit & aProcessor, const BF & anID) const
+{
+ BFList::const_raw_iterator< GenericInfoData > itInfo = mGenericInfos.begin();
+ BFList::const_raw_iterator< GenericInfoData > endInfo = mGenericInfos.end();
+ for( ; itInfo != endInfo ; ++itInfo )
+ {
+ if( itInfo->isInfo(aProcessor, anID) )
+ {
+ return( itInfo->getData() );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+const BF & ExecutionInformation::getInfoData(const BF & anID) const
+{
+ BFList::const_raw_iterator< GenericInfoData > itInfo = mGenericInfos.begin();
+ BFList::const_raw_iterator< GenericInfoData > endInfo = mGenericInfos.end();
+ for( ; itInfo != endInfo ; ++itInfo )
+ {
+ if( itInfo->isID(anID) )
+ {
+ return( itInfo->getData() );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+const BF & ExecutionInformation::getInfoData(Element * anID) const
+{
+ BFList::const_raw_iterator< GenericInfoData > itInfo = mGenericInfos.begin();
+ BFList::const_raw_iterator< GenericInfoData > endInfo = mGenericInfos.end();
+ for( ; itInfo != endInfo ; ++itInfo )
+ {
+ if( itInfo->isID(anID) )
+ {
+ return( itInfo->getData() );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+/**
+ * Serialization
+ */
+void ExecutionInformation::toStreamInfo(OutStream & out) const
+{
+ BFList::const_raw_iterator< GenericInfoData > itInfo = mGenericInfos.begin();
+ BFList::const_raw_iterator< GenericInfoData > endInfo = mGenericInfos.end();
+ for( ; itInfo != endInfo ; ++itInfo )
+ {
+ itInfo->toStream(out);
+ }
+}
+
+void ExecutionInformation::toFscnInfo(OutStream & out) const
+{
+ BFList::const_raw_iterator< GenericInfoData > itInfo = mGenericInfos.begin();
+ BFList::const_raw_iterator< GenericInfoData > endInfo = mGenericInfos.end();
+ for( ; itInfo != endInfo ; ++itInfo )
+ {
+ itInfo->toFscn(out);
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// FormulaCoverageFilter Information
+////////////////////////////////////////////////////////////////////////////////
+
+FormulaCoverageFilterInfo *
+ExecutionInformation::getUniqFormulaCoverageFilterInfo()
+{
+ if( mFormulaCoverageFilterInfo == NULL )
+ {
+ mFormulaCoverageFilterInfo = new FormulaCoverageFilterInfo();
+ }
+ return( mFormulaCoverageFilterInfo );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AvmHitOrJumpObjective Information
+////////////////////////////////////////////////////////////////////////////////
+
+HitOrJumpObjectiveInfo * ExecutionInformation::getUniqHitOrJumpObjectiveInfo()
+{
+ if( mHitOrJumpObjectiveInfo == NULL )
+ {
+ mHitOrJumpObjectiveInfo = new HitOrJumpObjectiveInfo();
+ }
+ return( mHitOrJumpObjectiveInfo );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// OfflineTestProcessor Information
+////////////////////////////////////////////////////////////////////////////////
+
+OfflineTestProcessorInfo *
+ExecutionInformation::getUniqOfflineTestProcessorInfo()
+{
+ if( mOfflineTestProcessorInfo == NULL )
+ {
+ mOfflineTestProcessorInfo = new OfflineTestProcessorInfo();
+ }
+ return( mOfflineTestProcessorInfo );
+}
+
+
+/**
+ * Serialization
+ */
+void ExecutionInformation::toStream(OutStream & out) const
+{
+ toStreamInfo(out);
+
+ if( mFormulaCoverageFilterInfo != NULL )
+ {
+ mFormulaCoverageFilterInfo->toStream(out);
+ }
+}
+
+void ExecutionInformation::toFscn(OutStream & out) const
+{
+ if( mFormulaCoverageFilterInfo != NULL )
+ {
+ mFormulaCoverageFilterInfo->toFscn(out);
+ }
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/ExecutionInformation.h b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionInformation.h
new file mode 100644
index 0000000..d4156e6
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionInformation.h
@@ -0,0 +1,531 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 11 oct. 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef EXECUTIONINFORMATION_H_
+#define EXECUTIONINFORMATION_H_
+
+#include <common/AvmPointer.h>
+#include <common/Element.h>
+
+#include <common/BF.h>
+
+#include <collection/BFContainer.h>
+
+#include <fml/operator/OperatorLib.h>
+
+
+namespace sep
+{
+
+class AbstractProcessorUnit;
+class IProcessorUnitRegistration;
+
+class FormulaCoverageFilterInfo;
+
+class HitOrJumpObjectiveInfo;
+
+class OfflineTestProcessorInfo;
+
+
+/**
+ * Generic Info < id , data >
+ * @property id : have to be a Processor Register Tool
+ * @property data : anything
+ */
+class GenericInfoData : public Element ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( GenericInfoData )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( GenericInfoData )
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ const IProcessorUnitRegistration & mProcessorRegisterTool;
+ BF mID;
+ BF mData;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ GenericInfoData(const IProcessorUnitRegistration & aProcessorRegisterTool,
+ const BF & anID, const BF & aData)
+ : Element( CLASS_KIND_T( GenericInfoData ) ),
+ mProcessorRegisterTool( aProcessorRegisterTool ),
+ mID( anID ),
+ mData( aData )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ GenericInfoData(const GenericInfoData & anInfoData)
+ : Element( anInfoData ),
+ mProcessorRegisterTool( anInfoData.mProcessorRegisterTool ),
+ mID( anInfoData.mID ),
+ mData( anInfoData.mData )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~GenericInfoData()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mProcessorRegisterTool
+ */
+ inline const IProcessorUnitRegistration & getProcessorRegisterTool() const
+ {
+ return( mProcessorRegisterTool );
+ }
+
+ inline bool isInfo(
+ const IProcessorUnitRegistration & aProcessorRegisterTool) const
+ {
+ return( (& mProcessorRegisterTool) == (& aProcessorRegisterTool) );
+ }
+
+ bool isInfo(const AbstractProcessorUnit & aProcessor) const;
+ bool isInfo(const AbstractProcessorUnit & aProcessor, const BF & anID) const;
+
+
+ /**
+ * GETTER - SETTER
+ * mID
+ */
+ inline const BF & getID() const
+ {
+ return( mID );
+ }
+
+ inline bool hasID() const
+ {
+ return( mID.valid() );
+ }
+
+ inline bool isID(const BF & anID) const
+ {
+ return( mID.isTEQ(anID) || (mID.str() == anID.str()) );
+ }
+
+ inline bool isID(Element * anID) const
+ {
+ return( mID.isTEQ(anID) );
+ }
+
+ inline bool isID(const std::string & anID,
+ AVM_OPCODE aPredicate = AVM_OPCODE_EQ) const
+ {
+ switch( aPredicate )
+ {
+ case AVM_OPCODE_EQ:
+ case AVM_OPCODE_SEQ:
+ {
+ return( strID() == anID );
+ }
+ case AVM_OPCODE_STARTS_WITH:
+ case AVM_OPCODE_GTE:
+ {
+ return( strID().find(anID) == 0 );
+ }
+ case AVM_OPCODE_CONTAINS:
+ {
+ return( strID().find(anID) != std::string::npos );
+ }
+
+ default:
+ {
+ return( strID() == anID );
+ }
+ }
+ }
+
+
+ inline std::string strID() const
+ {
+ return( mID.invalid() ? ""
+ : ( mID.isBuiltinString() ?
+ mID.toBuiltinString() : mID.str() ) );
+ }
+
+ std::string strUID() const;
+
+ /**
+ * GETTER - SETTER
+ * mData
+ */
+ inline const BF & getData() const
+ {
+ return( mData );
+ }
+
+
+ inline bool hasData() const
+ {
+ return( mData.valid() );
+ }
+
+ inline bool isData(const BF & aData) const
+ {
+ return( mData.isEQ(aData) );
+ }
+
+ inline bool isData(const std::string & aData,
+ AVM_OPCODE aPredicate = AVM_OPCODE_EQ) const
+ {
+ switch( aPredicate )
+ {
+ case AVM_OPCODE_EQ:
+ case AVM_OPCODE_SEQ:
+ {
+ return( strData() == aData );
+ }
+ case AVM_OPCODE_STARTS_WITH:
+ case AVM_OPCODE_GTE:
+ {
+ return( strData().find(aData) == 0 );
+ }
+ case AVM_OPCODE_CONTAINS:
+ {
+ return( strData().find(aData) != std::string::npos );
+ }
+
+ default:
+ {
+ return( strData() == aData );
+ }
+ }
+ }
+
+
+ inline std::string strData() const
+ {
+ return( mData.invalid() ? ""
+ : ( mData.isBuiltinString() ?
+ mData.toBuiltinString() : mData.str() ) );
+ }
+
+ inline void setData(const BF & aData)
+ {
+ mData = aData;
+ }
+
+
+ /**
+ * Serialization
+ */
+ virtual void toStream(OutStream & out) const;
+
+ virtual void toFscn(OutStream & out) const;
+
+};
+
+
+/**
+ * ExecutionInformation
+ */
+class ExecutionInformation : public Element ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ExecutionInformation )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( ExecutionInformation )
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ BFList mGenericInfos;
+
+ FormulaCoverageFilterInfo * mFormulaCoverageFilterInfo;
+
+ HitOrJumpObjectiveInfo * mHitOrJumpObjectiveInfo;
+
+ OfflineTestProcessorInfo * mOfflineTestProcessorInfo;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ExecutionInformation()
+ : Element( CLASS_KIND_T( ExecutionInformation ) ),
+ mGenericInfos(),
+
+ mFormulaCoverageFilterInfo( NULL ),
+ mHitOrJumpObjectiveInfo( NULL ),
+ mOfflineTestProcessorInfo( NULL )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ ExecutionInformation(const ExecutionInformation & anExecInfo)
+ : Element( anExecInfo ),
+ mGenericInfos( anExecInfo.mGenericInfos ),
+
+ mFormulaCoverageFilterInfo( anExecInfo.mFormulaCoverageFilterInfo ),
+ mHitOrJumpObjectiveInfo( anExecInfo.mHitOrJumpObjectiveInfo ),
+ mOfflineTestProcessorInfo( anExecInfo.mOfflineTestProcessorInfo )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ExecutionInformation();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // GenericInfoData
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * APPEND
+ * mGenericInfos
+ */
+ void addInfo(const IProcessorUnitRegistration & aRegisterTool,
+ const BF & anID, const BF & aData)
+ {
+ mGenericInfos.append( BF(
+ new GenericInfoData(aRegisterTool, anID, aData) ) );
+ }
+
+ void addInfo(const AbstractProcessorUnit & aProcessor,
+ const BF & anID, const BF & aData);
+
+ void addInfo(const AbstractProcessorUnit & aProcessor, const BF & aData);
+
+
+ /**
+ * GETTER
+ * mGenericInfos
+ */
+ inline const BFList & getInfos() const
+ {
+ return( mGenericInfos );
+ }
+
+ inline BFList & getInfos()
+ {
+ return( mGenericInfos );
+ }
+
+
+ GenericInfoData * getInfo(
+ const IProcessorUnitRegistration & aRegisterTool) const;
+
+ GenericInfoData * getInfo(const AbstractProcessorUnit & aProcessor) const;
+ GenericInfoData * getInfo(
+ const AbstractProcessorUnit & aProcessor, const BF & anID) const;
+ GenericInfoData * getInfoWithData(
+ const AbstractProcessorUnit & aProcessor, const BF & aData) const;
+
+ GenericInfoData * getInfo(const BF & anID) const;
+ GenericInfoData * getInfo(Element * anID) const;
+ GenericInfoData * getInfo(Element * anID, const BF & aData) const;
+ GenericInfoData * getInfo(const std::string & anID,
+ AVM_OPCODE aPredicate = AVM_OPCODE_EQ) const;
+
+ GenericInfoData * getInfoByData(const BF & aData) const;
+ GenericInfoData * getInfoByData(const std::string & aData,
+ AVM_OPCODE aPredicate = AVM_OPCODE_EQ) const;
+
+ /**
+ * TESTER
+ * mGenericInfos
+ */
+ inline bool hasInfo() const
+ {
+ return( mGenericInfos.nonempty() );
+ }
+
+ inline bool noneInfo() const
+ {
+ return( mGenericInfos.empty() );
+ }
+
+
+ inline bool hasInfo(const IProcessorUnitRegistration & aRegisterTool) const
+ {
+ return( getInfo(aRegisterTool) != NULL );
+ }
+
+ bool hasInfo(const AbstractProcessorUnit & aProcessor) const
+ {
+ return( getInfo(aProcessor) != NULL );
+ }
+
+ bool noneInfo(const AbstractProcessorUnit & aProcessor) const
+ {
+ return( getInfo(aProcessor) == NULL );
+ }
+
+ bool hasInfo(
+ const AbstractProcessorUnit & aProcessor, const BF & anID) const
+ {
+ return( getInfo(aProcessor, anID) != NULL );
+ }
+
+ bool hasInfoWithData(
+ const AbstractProcessorUnit & aProcessor, const BF & aData) const
+ {
+ return( getInfoWithData(aProcessor, aData) != NULL );
+ }
+
+
+ inline bool hasInfo(const BF & anID) const
+ {
+ return( getInfo(anID) != NULL );
+ }
+
+ inline bool hasInfo(Element * anID) const
+ {
+ return( getInfo(anID) != NULL );
+ }
+
+ inline bool hasInfo(const std::string & anID,
+ AVM_OPCODE aPredicate = AVM_OPCODE_EQ) const
+ {
+ return( getInfo(anID, aPredicate) != NULL );
+ }
+
+
+ inline bool hasInfoByData(const BF & aData) const
+ {
+ return( getInfoByData(aData) != NULL );
+ }
+
+ inline bool hasInfoByData(const std::string & aData,
+ AVM_OPCODE aPredicate = AVM_OPCODE_EQ) const
+ {
+ return( getInfoByData(aData, aPredicate) != NULL );
+ }
+
+
+ /**
+ * REMOVE
+ * mGenericInfos
+ */
+ void removeInfo(const IProcessorUnitRegistration & aRegisterTool);
+ void removeInfo(const AbstractProcessorUnit & aProcessor);
+
+ void removeInfo(const BF & anID);
+ void removeInfo(Element * anID);
+ void removeInfo(const std::string & anID,
+ AVM_OPCODE aPredicate = AVM_OPCODE_EQ);
+
+ void removeInfoByData(const BF & aData);
+ void removeInfoByData(const std::string & aData,
+ AVM_OPCODE aPredicate = AVM_OPCODE_EQ);
+
+
+ /**
+ * GETTER
+ * Data
+ */
+ const BF & getInfoData(
+ const IProcessorUnitRegistration & aRegisterTool) const;
+
+ const BF & getInfoData(const AbstractProcessorUnit & aProcessor) const;
+ const BF & getInfoData(
+ const AbstractProcessorUnit & aProcessor, const BF & anID) const;
+
+ const BF & getInfoData(const BF & anID) const;
+ const BF & getInfoData(Element * anID) const;
+
+
+ /**
+ * Serialization
+ */
+ virtual void toStreamInfo(OutStream & out) const;
+
+ virtual void toFscnInfo(OutStream & out) const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FormulaCoverageFilter Information
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * GETTER - SETTER
+ * mFormulaCoverageFilterInfo
+ */
+ FormulaCoverageFilterInfo * getUniqFormulaCoverageFilterInfo();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // AvmHitOrJumpObjective Information
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * GETTER - SETTER
+ * mHitOrJumpObjectiveInfo
+ */
+ HitOrJumpObjectiveInfo * getUniqHitOrJumpObjectiveInfo();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // OfflineTestProcessor Information
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * GETTER - SETTER
+ */
+ OfflineTestProcessorInfo * getUniqOfflineTestProcessorInfo();
+
+
+ /**
+ * TESTER
+ * has any specific info ?
+ */
+ inline bool hasSpecificInfo() const
+ {
+ return( (mFormulaCoverageFilterInfo != NULL) );
+// (mHitOrJumpObjectiveInfo != NULL) ||
+// (mOfflineTestProcessorInfo != NULL) );
+ }
+
+ /**
+ * Serialization
+ */
+ virtual void toStream(OutStream & out) const;
+
+ virtual void toFscn(OutStream & out) const;
+
+};
+
+
+}
+
+#endif /* EXECUTIONINFORMATION_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/ExecutionLocation.cpp b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionLocation.cpp
new file mode 100644
index 0000000..1a8aced
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionLocation.cpp
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 15 oct. 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ExecutionLocation.h"
+
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// SERIALIZATION
+////////////////////////////////////////////////////////////////////////////////
+
+void ExecutionLocation::toStream(OutStream & os) const
+{
+ os << TAB << "execution#location {" << EOL;
+
+ os << TAB2 << "rid = " << mRID.str() << ";" << EOL_INCR_INDENT;
+
+ if( mCODE.valid() )
+ {
+ os << TAB << "@code{" << EOL_INCR_INDENT;
+ mCODE.toStream(os);
+ os << DECR_INDENT_TAB << "}" << EOL;
+
+ if( itCode != endCode )
+ {
+ os << TAB << "@begin{" << EOL_INCR2_INDENT;
+ (*itCode).toStream(os);
+ os << DECR_INDENT_TAB << "}" << EOL;
+
+ os << TAB << "begin = " << (*itCode).raw_address() << ";" << EOL;
+ os << TAB << "end = " << (*endCode).raw_address() << ";" << EOL;
+ }
+ }
+
+ os << DECR_INDENT_TAB << "}" << EOL_FLUSH;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// SERIALIZATION
+////////////////////////////////////////////////////////////////////////////////
+
+void ExecutionLocationQueue::toStream(OutStream & os) const
+{
+ List< BF >::const_iterator it = mQueue.begin();
+ List< BF >::const_iterator endIt = mQueue.end();
+ for( ; it != endIt ; ++it )
+ {
+ (*it).toStream(os);
+ }
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/ExecutionLocation.h b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionLocation.h
new file mode 100644
index 0000000..06889ab
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionLocation.h
@@ -0,0 +1,272 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 15 oct. 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef EXECUTIONLOCATION_H_
+#define EXECUTIONLOCATION_H_
+
+#include <common/Element.h>
+
+#include <collection/List.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+
+class ExecutionLocation : public Element ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ExecutionLocation )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( ExecutionLocation )
+
+public:
+ /**
+ * ATTRIBUTES
+ */
+ RuntimeID mRID;
+
+ BFCode mCODE;
+
+ AvmCode::const_iterator itCode;
+ AvmCode::const_iterator endCode;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ExecutionLocation()
+ : Element( CLASS_KIND_T( ExecutionLocation ) ),
+ mRID( ),
+ mCODE( ),
+ itCode( ),
+ endCode( )
+ {
+ //!! NOTHING
+ }
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ ExecutionLocation(const ExecutionLocation & anExecLocation)
+ : Element( CLASS_KIND_T( ExecutionLocation ) ),
+ mRID( anExecLocation.mRID ),
+ mCODE( anExecLocation.mCODE ),
+ itCode( anExecLocation.itCode ),
+ endCode( anExecLocation.endCode )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Others
+ */
+ ExecutionLocation(const RuntimeID & aRID, const BFCode & aCode)
+ : Element( CLASS_KIND_T( ExecutionLocation ) ),
+ mRID( aRID ),
+ mCODE( aCode ),
+ itCode( aCode->begin() ),
+ endCode( aCode->end() )
+ {
+ //!! NOTHING
+ }
+
+ ExecutionLocation(const RuntimeID & aRID, const BFCode & aCode,
+ const AvmCode::const_iterator & it)
+ : Element( CLASS_KIND_T( ExecutionLocation ) ),
+ mRID( aRID ),
+ mCODE( aCode ),
+ itCode( it ),
+ endCode( aCode->end() )
+ {
+ //!! NOTHING
+ }
+
+ ExecutionLocation(const RuntimeID & aRID, const BFCode & aCode,
+ const AvmCode::const_iterator & it,
+ const AvmCode::const_iterator & endIt)
+ : Element( CLASS_KIND_T( ExecutionLocation ) ),
+ mRID( aRID ),
+ mCODE( aCode ),
+ itCode( it ),
+ endCode( endIt )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ExecutionLocation()
+ {
+ //!! NOTHING
+ }
+
+
+
+ inline void refreshAll()
+ {
+ itCode = mCODE->begin();
+ endCode = mCODE->end();
+ }
+
+ inline void refreshBegin()
+ {
+ itCode = mCODE->begin();
+ }
+
+ inline void refreshEnd()
+ {
+ endCode = mCODE->end();
+ }
+
+
+ /**
+ * COMPARISON
+ * OPERATOR
+ */
+
+ bool isEQ(const ExecutionLocation * el) const
+ {
+ return( (this == el) ||
+ ((mRID == el->mRID) && (mCODE == el->mCODE) &&
+ (itCode == el->itCode) && (endCode == el->endCode)) );
+ }
+
+ /**
+ * Serialization
+ */
+ virtual void toStream(OutStream & os) const;
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// TYPE DEFINITION for SMART POINTER and CONTAINER
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class ExecutionLocationQueue
+{
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ List< BF > mQueue;
+
+ List< BF > mCache;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ExecutionLocationQueue()
+ : mQueue( ),
+ mCache( )
+ {
+ //!!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ ExecutionLocationQueue(const ExecutionLocationQueue & anELQ)
+ : mQueue( anELQ.mQueue ),
+ mCache( anELQ.mCache )
+ {
+ //!!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ExecutionLocationQueue()
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mQueue
+ */
+
+ bool empty() const
+ {
+ return( mQueue.empty() );
+ }
+
+ bool nonempty() const
+ {
+ return( ! mQueue.empty() );
+ }
+
+
+ void popTo(BF & popElem)
+ {
+ popElem = mQueue.back();
+
+ mQueue.pop_back();
+ }
+
+
+ void push(const RuntimeID & aRID, const BFCode & aCode)
+ {
+ mCache.push_front(
+ BF( new ExecutionLocation(aRID, aCode) ) );
+ }
+
+ void push(const RuntimeID & aRID, const BFCode & aCode,
+ const AvmCode::const_iterator & it,
+ const AvmCode::const_iterator & endIt)
+ {
+ mCache.push_front(
+ BF( new ExecutionLocation(aRID, aCode, it, endIt) ) );
+ }
+
+
+ void pushCache()
+ {
+ mQueue.splice(mCache);
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SERIALIZATION
+ ////////////////////////////////////////////////////////////////////////////
+
+ void toStream(OutStream & os) const;
+
+};
+
+
+
+}
+
+#endif /* EXECUTIONLOCATION_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/ExecutionSynchronizationPoint.cpp b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionSynchronizationPoint.cpp
new file mode 100644
index 0000000..3480bca
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionSynchronizationPoint.cpp
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 3 nov. 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ExecutionSynchronizationPoint.h"
+
+
+#include <fml/executable/RoutingData.h>
+
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+
+/**
+ * Serialization
+ */
+void ExecutionSynchronizationPoint::toStream(OutStream & os) const
+{
+ os << TAB << "esploc {" << EOL;
+
+
+ os << TAB2 << "wpn = ";
+ switch ( mAwaitingPointNature )
+ {
+ case AWAITING_POINT_INPUT_NATURE:
+ {
+ os << "AWAITING_POINT_INPUT_NATURE";
+ break;
+ }
+ case AWAITING_POINT_OUTPUT_NATURE:
+ {
+ os << "AWAITING_POINT_OUTPUT_NATURE";
+ break;
+ }
+
+ case AWAITING_POINT_JOIN_NATURE:
+ {
+ os << "AWAITING_POINT_JOIN_NATURE";
+ break;
+ }
+
+ case AWAITING_POINT_UNDEFINED_NATURE:
+ {
+ os << "AWAITING_POINT_UNDEFINED_NATURE";
+ break;
+ }
+ default :
+ {
+ os << "AWAITING_POINT_UNKNOWN_NATURE";
+ break;
+ }
+ }
+ os << ";" << EOL;
+
+ os << TAB2 << "rid = " << mRID.str() << ";" << EOL_INCR_INDENT;
+
+ if( mRoutingData != NULL )
+ {
+ mRoutingData.toStream(os);
+ }
+
+ if( mMessage.valid() )
+ {
+ mMessage.toStream(os);
+ }
+
+ if( next != NULL )
+ {
+ next->toStream(os);
+ }
+
+ os << DECR_INDENT_TAB << "}" << EOL;
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/ExecutionSynchronizationPoint.h b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionSynchronizationPoint.h
new file mode 100644
index 0000000..c8b9ecc
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/ExecutionSynchronizationPoint.h
@@ -0,0 +1,170 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 3 nov. 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef EXECUTIONSYNCHRONIZATIONPOINT_H_
+#define EXECUTIONSYNCHRONIZATIONPOINT_H_
+
+
+#include <common/AvmObject.h>
+
+#include <fml/executable/RoutingData.h>
+#include <fml/runtime/Message.h>
+
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+
+class RuntimeID;
+
+
+/**
+ * TYPE DECLARATIONS
+ */
+
+enum AWAITING_POINT_NATURE
+{
+ AWAITING_POINT_INPUT_NATURE,
+
+ AWAITING_POINT_OUTPUT_NATURE,
+
+
+ AWAITING_POINT_JOIN_NATURE,
+
+ AWAITING_POINT_UNDEFINED_NATURE
+};
+
+
+
+class ExecutionSynchronizationPoint : public AvmObject ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ExecutionSynchronizationPoint )
+{
+
+// AVM_DECLARE_CLONABLE_CLASS(ExecutionSynchronizationPoint)
+
+public:
+ /**
+ * ATTRIBUTES
+ */
+ AWAITING_POINT_NATURE mAwaitingPointNature;
+
+ RuntimeID mRID;
+
+ RoutingData mRoutingData;
+
+ Message mMessage;
+
+ ExecutionSynchronizationPoint * next;
+
+private:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ExecutionSynchronizationPoint()
+ : mAwaitingPointNature( AWAITING_POINT_UNDEFINED_NATURE ),
+ mRID( ),
+ mRoutingData( ),
+ mMessage( ),
+ next( NULL )
+ {
+ //!! NOTHING
+ }
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ ExecutionSynchronizationPoint(const ExecutionSynchronizationPoint & anESP)
+ : mAwaitingPointNature( anESP.mAwaitingPointNature ),
+ mRID( anESP.mRID ),
+ mRoutingData( anESP.mRoutingData ),
+ mMessage( anESP.mMessage ),
+ next( (anESP.next != NULL) ?
+ new ExecutionSynchronizationPoint(*(anESP.next)) : NULL )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Others
+ */
+ ExecutionSynchronizationPoint(AWAITING_POINT_NATURE aWaitingPointNature,
+ const RuntimeID & aRoutingRID, const RoutingData & aRoutingData,
+ const Message & aMessage,
+ ExecutionSynchronizationPoint * nxt = NULL)
+ : mAwaitingPointNature( aWaitingPointNature ),
+ mRID( aRoutingRID ),
+ mRoutingData( aRoutingData ),
+ mMessage( aMessage ),
+ next( nxt )
+ {
+ //!! NOTHING
+ }
+
+ ExecutionSynchronizationPoint(AWAITING_POINT_NATURE aWaitingPointNature,
+ const RuntimeID & joinRID,
+ ExecutionSynchronizationPoint * nxt = NULL)
+ : mAwaitingPointNature( aWaitingPointNature ),
+ mRID( joinRID ),
+ mRoutingData( ),
+ mMessage( ),
+ next( nxt )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ExecutionSynchronizationPoint()
+ {
+ sep::destroy( next );
+ }
+
+
+ bool isInput()
+ {
+ return( mAwaitingPointNature == AWAITING_POINT_INPUT_NATURE );
+ }
+
+ bool isOutput()
+ {
+ return( mAwaitingPointNature == AWAITING_POINT_OUTPUT_NATURE );
+ }
+
+ bool isJoin()
+ {
+ return( mAwaitingPointNature == AWAITING_POINT_JOIN_NATURE );
+ }
+
+
+ /**
+ * Serialization
+ */
+ virtual void toStream(OutStream & os) const;
+
+};
+
+
+}
+
+#endif /* EXECUTIONSYNCHRONIZATIONPOINT_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/LocalRuntime.cpp b/org.eclipse.efm.symbex/src/fml/runtime/LocalRuntime.cpp
new file mode 100644
index 0000000..1083cca
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/LocalRuntime.cpp
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "LocalRuntime.h"
+#include <fml/expression/BuiltinArray.h>
+
+
+namespace sep
+{
+
+
+/**
+ * Serialization
+ */
+void LocalRuntimeElement::toStream(OutStream & os) const
+{
+ if( os.preferablyFQN() )
+ {
+ os << TAB << mProgram.getFullyQualifiedNameID();
+ return;
+ }
+
+ os << TAB << "runtime" << mProgram.getFullyQualifiedNameID()
+ << " as program {";
+
+ AVM_DEBUG_REF_COUNTER(os);
+ os << EOL_FLUSH;
+
+ if( mDataTable.nonempty() )
+ {
+ os << EOL;
+ os << TAB << "data";
+ mDataTable.AVM_DEBUG_REF_COUNTER(os);
+ os << EOL;
+
+ TableOfData::const_iterator it = mDataTable.begin();
+ TableOfData::const_iterator itEnd = mDataTable.end();
+ for( avm_size_t i = 0 ; it != itEnd ; ++it , ++i )
+ {
+ os << TAB2 << (*it).AVM_DEBUG_REF_COUNTER() << "${ := ";
+
+// os << mRID.getVariables().get(i)->getFullyQualifiedNameID();
+ os << mProgram.getData().rawAt(i)->getNameID()
+ << str_indent( *it ) << " }" << EOL_FLUSH;
+ }
+ }
+
+ os << TAB << "}" << EOL_FLUSH;
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/LocalRuntime.h b/org.eclipse.efm.symbex/src/fml/runtime/LocalRuntime.h
new file mode 100644
index 0000000..7c41c60
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/LocalRuntime.h
@@ -0,0 +1,353 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef LOCALRUNTIME_H_
+#define LOCALRUNTIME_H_
+
+#include <base/SmartPointer.h>
+#include <common/Element.h>
+
+#include <fml/executable/BaseAvmProgram.h>
+
+#include <fml/expression/BuiltinArray.h>
+
+#include <fml/runtime/TableOfData.h>
+
+
+namespace sep
+{
+
+class BF;
+
+class LocalRuntime;
+
+
+class LocalRuntimeElement : public Element ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( LocalRuntimeElement )
+{
+
+ friend LocalRuntime;
+
+ AVM_DECLARE_CLONABLE_CLASS( LocalRuntimeElement )
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ const BaseAvmProgram & mProgram;
+
+ avm_offset_t mOffset;
+
+ TableOfData mDataTable;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ LocalRuntimeElement(const BaseAvmProgram & aProgram)
+ : Element( CLASS_KIND_T( LocalRuntime ) ),
+
+ mProgram( aProgram ),
+ mOffset( 0 ),
+ mDataTable( aProgram.getDataSize() )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ LocalRuntimeElement(const LocalRuntimeElement & anElement)
+ : Element( anElement ),
+
+ mProgram( anElement.mProgram ),
+ mOffset( anElement.mOffset ),
+ mDataTable( anElement.mDataTable )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~LocalRuntimeElement()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * Serialization
+ */
+ virtual void toStream(OutStream & os) const;
+
+};
+
+
+
+
+class LocalRuntime :
+ public SmartPointer< LocalRuntimeElement , DestroyElementPolicy >,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( LocalRuntime )
+{
+
+private:
+ /**
+ * TYPEDEF
+ */
+ typedef SmartPointer< LocalRuntimeElement ,
+ DestroyElementPolicy > base_this_type;
+
+
+public:
+ /*
+ * STATIC ATTRIBUTES
+ */
+ static LocalRuntime _NULL_;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ LocalRuntime()
+ : base_this_type( )
+ {
+ //!! NOTHING
+ }
+
+ LocalRuntime(const BaseAvmProgram & aProgram)
+ : base_this_type( new LocalRuntimeElement(aProgram) )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ LocalRuntime(const LocalRuntime & anElement)
+ : base_this_type( anElement )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~LocalRuntime()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mProgram
+ */
+ inline const BaseAvmProgram * getProgram() const
+ {
+ return( &( base_this_type::mPTR->mProgram ) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mInstance
+ */
+ inline const ExecutableForm * getExecutable() const
+ {
+ return( getProgram()->getExecutable() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mOffset
+ */
+ inline avm_offset_t getOffset() const
+ {
+ return( base_this_type::mPTR->mOffset );
+ }
+
+ inline void setOffset(avm_offset_t anOffset) const
+ {
+ base_this_type::mPTR->mOffset = anOffset;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mDataTable
+ */
+ inline TableOfData & getDataTable()
+ {
+ return( base_this_type::mPTR->mDataTable );
+ }
+
+ inline const TableOfData & getDataTable() const
+ {
+ return( base_this_type::mPTR->mDataTable );
+ }
+
+
+ inline BF & getData(avm_size_t index) const
+ {
+ return( base_this_type::mPTR->mDataTable.at(index) );
+ }
+
+ inline bool hasData() const
+ {
+ return( base_this_type::mPTR->mDataTable.nonempty() );
+ }
+
+ inline void setData(avm_size_t index, const BF & aData) const
+ {
+ base_this_type::mPTR->mDataTable.set(index, aData);
+ }
+
+
+ /**
+ * Serialization
+ */
+ inline void toStream(OutStream & os) const
+ {
+ if( base_this_type::mPTR != NULL )
+ {
+ base_this_type::mPTR->toStream(os);
+ }
+ else
+ {
+ os << "LocalRuntime<null>" << std::flush;
+ }
+ }
+
+};
+
+
+/**
+ * Stack of LocalRuntime
+ */
+class StackOfLocalRuntime : public AvmObject ,
+ public Vector< LocalRuntime > ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( StackOfLocalRuntime )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( StackOfLocalRuntime )
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ StackOfLocalRuntime()
+ : AvmObject( ),
+ Vector< LocalRuntime >()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ StackOfLocalRuntime(const StackOfLocalRuntime & aStack)
+ : AvmObject( aStack ),
+ Vector< LocalRuntime >( aStack )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~StackOfLocalRuntime()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * SETTER
+ * For LocalRuntime
+ */
+
+ inline void setLocalRuntime(
+ avm_size_t offset, const LocalRuntime & aLocalRuntime)
+ {
+ Vector< LocalRuntime >::set(offset, aLocalRuntime);
+ }
+
+
+ /**
+ * PUSH - POP
+ * anAvmProgram
+ * BaseRuntimeForm
+ */
+
+ inline void push(const LocalRuntime & aLocalRuntime)
+ {
+ aLocalRuntime.setOffset( size() );
+ push_back( aLocalRuntime );
+ }
+
+
+ inline void pop()
+ {
+ if( nonempty() )
+ {
+ pop_last();
+ }
+ }
+
+
+ /**
+ * Serialization
+ */
+ void toStream(OutStream & os) const
+ {
+ for( const_iterator it = begin() ; it != end() ; ++it )
+ {
+ os << TAB << (*it).raw_pointer()->AVM_DEBUG_REF_COUNTER()
+ << "${ := " << AVM_NO_INDENT;
+
+ (*it).toStream(os);
+
+ os << END_INDENT << " }" << EOL_FLUSH;
+ }
+ }
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// TYPE DEFINITION for SMART POINTER and CONTAINER
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+AVM_DEFINE_AP_CLASS( StackOfLocalRuntime )
+
+
+
+}
+
+#endif /*LOCALRUNTIME_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/Message.cpp b/org.eclipse.efm.symbex/src/fml/runtime/Message.cpp
new file mode 100644
index 0000000..d0e0f80
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/Message.cpp
@@ -0,0 +1,254 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "Message.h"
+
+#include <fml/executable/AvmProgram.h>
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/InstanceOfMachine.h>
+#include <fml/executable/InstanceOfPort.h>
+
+
+namespace sep
+{
+
+
+/*
+ * STATIC ATTRIBUTES
+ */
+Message Message::_NULL_;
+
+
+/**
+ * Comparison
+ * operator==
+ */
+bool Message::equals(const Message & aMessage) const
+{
+ if( (this == &aMessage)
+ || base_this_type::operator ==( aMessage ) )
+ {
+ return( true );
+ }
+ else if( this->invalid() || aMessage.invalid() )
+ {
+ return( false );
+ }
+ else if( (this->getMID() == aMessage.getMID())
+ && (getPort() == aMessage.getPort())
+ && (getSenderRID() == aMessage.getSenderRID())
+ && (getReceiverRID() == aMessage.getReceiverRID()) )
+ {
+ if( hasParameter() )
+ {
+ Message::const_iterator itOther = aMessage.beginParameters();
+ Message::const_iterator it = beginParameters();
+ Message::const_iterator endIt = endParameters();
+ for( ; it != endIt ; ++it )
+ {
+ // Syntaxic equality between arguments ?
+ if( (*it) != (*itOther) )
+ {
+ return( false );
+ }
+ }
+ }
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+/**
+ * Serialization
+ */
+std::string MessageElement::str() const
+{
+ StringOutStream oss;
+
+ oss << "message< mid:" << mMID << ", ";
+ if( mPort.is< InstanceOfPort >() )
+ {
+ InstanceOfPort * aPort = mPort.to_ptr< InstanceOfPort >();
+ oss << aPort->strComPointNature() << ": "
+ << aPort->getFullyQualifiedNameID();
+ }
+ else
+ {
+ oss << "port: null<port>";
+ }
+
+ if( mSenderRID.valid() )
+ {
+ oss << ", sender: " << mSenderRID.strUniqId();
+ }
+ if( mReceiverRID.valid() )
+ {
+ oss << ", receiver: " << mReceiverRID.strUniqId();
+ }
+ oss << " >[";
+
+ if( mParameters.nonempty() )
+ {
+ oss << AVM_STR_INDENT;
+
+ Message::const_iterator it = mParameters.begin();
+ Message::const_iterator endIt = mParameters.end();
+
+ it->toStream(oss);
+
+ for( ++it ; it != endIt ; ++it )
+ {
+ oss << " , ";
+ it->toStream(oss);
+ }
+ oss << END_INDENT;
+ }
+
+ oss << " ]";
+
+ return( oss.str() );
+}
+
+
+void MessageElement::toStream(OutStream & os) const
+{
+ if( os.preferablySTR() )
+ {
+ os << TAB << str() << EOL_FLUSH;
+ return;
+ }
+
+ os << TAB << "message< mid#" << mMID << " > ";
+ if( mSenderRID.valid() )
+ {
+ os << mSenderRID.strUniqId()<< "->";
+ }
+ os << (mPort.is< InstanceOfPort >()
+ ? mPort.to_ptr< InstanceOfPort >()->getFullyQualifiedNameID()
+ : "null<port>");
+
+ if( mParameters.nonempty() )
+ {
+ os << " {";
+
+ AVM_DEBUG_REF_COUNTER(os);
+ os << EOL;
+
+ if( mReceiverRID.valid() )
+ {
+ os << TAB2 << "receiver = "
+ << mReceiverRID.strUniqId() << ";" << EOL;
+ }
+
+
+AVM_IF_DEBUG_LEVEL_GT_MEDIUM
+ os << TAB << "param" << EOL_INCR_INDENT;
+
+ Message::const_iterator it = mParameters.begin();
+ Message::const_iterator endIt = mParameters.end();
+ for( ; it != endIt ; ++it )
+ {
+ it->toStream(os);
+ }
+ os << DECR_INDENT;
+
+AVM_ELSE
+
+ os << TAB2 << "param = [" << AVM_STR_INDENT;
+
+ Message::const_iterator it = mParameters.begin();
+ Message::const_iterator endIt = mParameters.end();
+ for( ; it != endIt ; ++it )
+ {
+ os << " ,";
+ it->toStream(os);
+ }
+ os << END_INDENT << " ];" << EOL;
+AVM_ENDIF_DEBUG_LEVEL_GT_MEDIUM
+
+ os << TAB << "}" << EOL_FLUSH;
+ }
+ else
+ {
+ os << ";";
+ AVM_DEBUG_REF_COUNTER(os);
+ os << EOL_FLUSH;
+ }
+}
+
+void Message::toFscn(OutStream & os) const
+{
+ RuntimeID aRID = getSenderRID();
+
+ for( ; aRID.hasPRID() ; aRID = aRID.getPRID() )
+ {
+ if( aRID.getExecutable()->hasPort() )
+ {
+ break;
+ }
+ }
+
+ if( hasPort() )
+ {
+ int pointpos = getPort()->getFullyQualifiedNameID().rfind('.',
+ getPort()->getFullyQualifiedNameID().size());
+// os << TAB2 << ":pid#" << rid.getRid() << ":"
+// << getPort()->getFullyQualifiedNameID().substr(
+// rid->getInstance()->getFullyQualifiedNameID().size() + 1);
+ os << TAB2 << ":pid#" << aRID.getRid() << ":"
+ << getPort()->getFullyQualifiedNameID().substr(pointpos + 1);
+ }
+ else
+ {
+ os << TAB2 << ":pid#" << aRID.getRid() << ":_";
+ }
+
+ if( hasParameter() )
+ {
+ os << "(" << AVM_NO_INDENT;
+
+ Message::const_iterator it = beginParameters();
+ Message::const_iterator endIt = endParameters();
+
+ it->toStream(os);
+
+ for( ++it ; it != endIt ; ++it )
+ {
+ os << " , ";
+ it->toStream(os);
+ }
+
+ os << ")";
+
+AVM_IF_DEBUG_ENABLED_AND( base_this_type::mPTR->mReceiverRID.valid() )
+ os << " /* --> " << base_this_type::mPTR->mReceiverRID.strUniqId() << "*/";
+AVM_ENDIF_DEBUG_ENABLED_AND
+
+ os << ";" << END_INDENT_EOL;
+ }
+ else
+ {
+AVM_IF_DEBUG_ENABLED_AND( base_this_type::mPTR->mReceiverRID.valid() )
+ os << " /* --> " << base_this_type::mPTR->mReceiverRID.strUniqId() << "*/";
+AVM_ENDIF_DEBUG_ENABLED_AND
+
+ os << ";" << EOL_FLUSH;
+ }
+}
+
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/Message.h b/org.eclipse.efm.symbex/src/fml/runtime/Message.h
new file mode 100644
index 0000000..dd9035a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/Message.h
@@ -0,0 +1,620 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef MESSAGE_H_
+#define MESSAGE_H_
+
+#include <base/SmartPointer.h>
+#include <common/Element.h>
+
+#include <collection/BFContainer.h>
+#include <collection/List.h>
+#include <collection/Vector.h>
+
+#include <common/BF.h>
+
+#include <fml/executable/InstanceOfPort.h>
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+class Message;
+
+/**
+ * TYPEDEF
+ */
+typedef List< avm_size_t > ListOfSizeT;
+
+
+class MessageElement :
+ public Element,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( MessageElement )
+{
+
+ friend class Message;
+
+ AVM_DECLARE_CLONABLE_CLASS( MessageElement )
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ // The Message Identifier
+ avm_size_t mMID;
+
+ // RID of sender
+ RuntimeID mSenderRID;
+
+ // RID of Receiver
+ RuntimeID mReceiverRID;
+
+ // The port
+ BF mPort;
+
+ // The parameters
+ BFVector mParameters;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ MessageElement(const RuntimeID & aSenderRID, const BF & aPort)
+ : Element( CLASS_KIND_T( Message ) ),
+ mMID( 0 ),
+ mSenderRID( aSenderRID ),
+ mReceiverRID( ),
+ mPort( aPort ),
+ mParameters( )
+ {
+ //!! NOTHING
+ }
+
+ MessageElement(avm_size_t aMID,
+ const RuntimeID & aSenderRID, const BF & aPort)
+ : Element( CLASS_KIND_T( Message ) ),
+ mMID( aMID ),
+ mSenderRID( aSenderRID ),
+ mReceiverRID( ),
+ mPort( aPort ),
+ mParameters( )
+ {
+ //!! NOTHING
+ }
+
+ MessageElement(const RuntimeID & aSenderRID,
+ const RuntimeID & aReceiverRID, const BF & aPort)
+ : Element( CLASS_KIND_T( Message ) ),
+ mMID( 0 ),
+ mSenderRID( aSenderRID ),
+ mReceiverRID( aReceiverRID ),
+ mPort( aPort ),
+ mParameters( )
+ {
+ //!! NOTHING
+ }
+
+ MessageElement(const RuntimeID & aSenderRID,
+ const RuntimeID & aReceiverRID, InstanceOfPort * aPort)
+ : Element( CLASS_KIND_T( Message ) ),
+ mMID( 0 ),
+ mSenderRID( aSenderRID ),
+ mReceiverRID( aReceiverRID ),
+ mPort( INCR_BF( aPort ) ),
+ mParameters( )
+ {
+ //!! NOTHING
+ }
+
+ MessageElement(avm_size_t aMID, const RuntimeID & aSenderRID,
+ const RuntimeID & aReceiverRID, const BF & aPort)
+ : Element( CLASS_KIND_T( Message ) ),
+ mMID( aMID ),
+ mSenderRID( aSenderRID ),
+ mReceiverRID( aReceiverRID ),
+ mPort( aPort ),
+ mParameters( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ MessageElement(const MessageElement & anElement)
+ : Element( anElement ),
+ mMID( anElement.mMID ),
+ mSenderRID( anElement.mSenderRID ),
+ mReceiverRID( anElement.mReceiverRID ),
+ mPort( anElement.mPort ),
+ mParameters( anElement.mParameters )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~MessageElement()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * Serialization
+ */
+ virtual std::string str() const;
+
+ virtual void toStream(OutStream & os) const;
+
+};
+
+class Message :
+ public SmartPointer< MessageElement , DestroyElementPolicy >,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( Message )
+{
+
+private:
+ /**
+ * TYPEDEF
+ */
+ typedef SmartPointer< MessageElement ,
+ DestroyElementPolicy > base_this_type;
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef BFVector::const_iterator const_iterator;
+
+ /*
+ * STATIC ATTRIBUTES
+ */
+ static Message _NULL_;
+
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Message()
+ : base_this_type( )
+ {
+ //!! NOTHING
+ }
+
+ Message(const RuntimeID & aSenderRID, const BF & aPort)
+ : base_this_type( new MessageElement(aSenderRID, aPort) )
+ {
+ //!! NOTHING
+ }
+
+ Message(avm_size_t aMID, const RuntimeID & aSenderRID, const BF & aPort)
+ : base_this_type( new MessageElement(aMID, aSenderRID, aPort) )
+ {
+ //!! NOTHING
+ }
+
+ Message(const RuntimeID & aSenderRID,
+ const RuntimeID & aReceiverRID, const BF & aPort)
+ : base_this_type( new MessageElement(aSenderRID, aReceiverRID, aPort) )
+ {
+ //!! NOTHING
+ }
+
+ Message(const RuntimeID & aSenderRID,
+ const RuntimeID & aReceiverRID, InstanceOfPort * aPort)
+ : base_this_type( new MessageElement(aSenderRID, aReceiverRID, aPort) )
+ {
+ //!! NOTHING
+ }
+
+ Message(avm_size_t aMID, const RuntimeID & aSenderRID,
+ const RuntimeID & aReceiverRID, const BF & aPort)
+ : base_this_type( new MessageElement(aMID, aSenderRID, aReceiverRID, aPort) )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ Message(const Message & anElement)
+ : base_this_type( anElement )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Message()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * operator=
+ */
+ inline Message & operator=(const BF & other)
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( other.is< Message >() )
+ << "Invalid Assignment Cast of an inherit BF Class !!"
+ << SEND_EXIT;
+
+ if( base_this_type::mPTR != other.raw_pointer() )
+ {
+ release_acquire(
+ static_cast< MessageElement * >( other.raw_pointer() ) );
+ }
+ return( *this );
+ }
+
+ /**
+ * Comparison
+ * operator==
+ */
+ bool equals(const Message & aMessage) const;
+
+
+ /**
+ * GETTER - SETTER
+ * mParameters
+ */
+ inline const_iterator beginParameters() const
+ {
+ return( base_this_type::mPTR->mParameters.begin() );
+ }
+
+ inline const_iterator endParameters() const
+ {
+ return( base_this_type::mPTR->mParameters.end() );
+ }
+
+
+ inline void appendParameters(const BFVector & aParameter)
+ {
+ base_this_type::mPTR->mParameters.append( aParameter );
+ }
+
+ inline const BFVector & getParameters() const
+ {
+ return( base_this_type::mPTR->mParameters );
+ }
+
+ inline bool hasParameter() const
+ {
+ return( base_this_type::mPTR->mParameters.nonempty() );
+ }
+
+ inline avm_size_t size() const
+ {
+ return( base_this_type::mPTR->mParameters.size() );
+ }
+
+
+ inline void appendParameter(const BF & aParameter)
+ {
+ base_this_type::mPTR->mParameters.append( aParameter );
+ }
+
+ inline const BF & getParameter(avm_size_t offset) const
+ {
+ return( base_this_type::mPTR->mParameters.get( offset ) );
+ }
+
+
+
+ /**
+ * GETTER - SETTER
+ * mMID
+ */
+ inline avm_size_t getMID() const
+ {
+ return( base_this_type::mPTR->mMID );
+ }
+
+
+ inline bool isMID(avm_size_t mid) const
+ {
+ return( base_this_type::mPTR->mMID == mid );
+ }
+
+ inline bool isMID(const ListOfSizeT & ieMids) const
+ {
+ return( ieMids.contains(base_this_type::mPTR->mMID) );
+ }
+
+ inline void setMID(avm_size_t mid) const
+ {
+ base_this_type::mPTR->mMID = mid;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mSenderRID
+ */
+ inline const RuntimeID & getSenderRID() const
+ {
+ return( base_this_type::mPTR->mSenderRID );
+ }
+
+ inline InstanceOfMachine * getSenderMachine() const
+ {
+ return( base_this_type::mPTR->mSenderRID.getInstance() );
+ }
+
+
+ // The RID of the Machine where the port is declared
+ inline RuntimeID getMainSenderRID() const
+ {
+ return( hasPort()
+ ? base_this_type::mPTR->mSenderRID.getCommunicator( getPort() )
+ : RuntimeID::REF_NULL );
+ }
+
+ // The instance of Machine where the port is declared
+ inline InstanceOfMachine * getMainSenderMachine() const
+ {
+ return( getMainSenderRID().getInstance() );
+ }
+
+
+ inline bool hasSenderRID() const
+ {
+ return( base_this_type::mPTR->mSenderRID.valid() );
+ }
+
+
+ // return TRUE for all ancestor of the concrete sender RID
+ inline bool isSender(const RuntimeID & aRID) const
+ {
+ return( base_this_type::mPTR->mSenderRID.hasAsAncestor(aRID) );
+ // DON'T DO THIS VERIFICATION
+// || aRID.hasAsAncestor(base_this_type::mPTR->mSenderRID) );
+ }
+
+
+ // return TRUE for all ancestor of the concrete sender RID
+ inline bool isSenderMachine(InstanceOfMachine * anInstance) const
+ {
+ return( base_this_type::mPTR->mSenderRID.hasAsAncestor(anInstance) );
+ }
+
+ inline bool needSender(const RuntimeID & aRID)
+ {
+ return( base_this_type::mPTR->mSenderRID.invalid()
+ || isSender(aRID) );
+ }
+
+
+ inline void setSenderRID(const RuntimeID & aRID)
+ {
+ base_this_type::mPTR->mSenderRID = aRID;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mReceiverRID
+ */
+ inline const RuntimeID & getReceiverRID() const
+ {
+ return( base_this_type::mPTR->mReceiverRID );
+ }
+
+ inline InstanceOfMachine * getReceiverMachine() const
+ {
+ return( base_this_type::mPTR->mReceiverRID.getInstance() );
+ }
+
+ inline bool hasReceiverRID() const
+ {
+ return( base_this_type::mPTR->mReceiverRID.valid() );
+ }
+
+
+ // return TRUE for all ancestor of the concrete sender RID
+ inline bool isReceiver(const RuntimeID & aRID) const
+ {
+ return( base_this_type::mPTR->mReceiverRID.invalid()
+ || aRID.invalid()
+ || aRID.hasAsAncestor( base_this_type::mPTR->mReceiverRID ) );
+ // DON'T DO THIS VERIFICATION
+// || base_this_type::mPTR->mReceiverRID.hasAsAncestor( aRID ) );
+ }
+
+
+ // return TRUE for all ancestor of the concrete sender RID
+ inline bool isReceiverMachine(InstanceOfMachine * anInstance) const
+ {
+ return( base_this_type::mPTR->mReceiverRID.hasAsAncestor(anInstance) );
+ }
+
+ inline bool needReceiver(const RuntimeID & aRID)
+ {
+ return( base_this_type::mPTR->mReceiverRID.invalid()
+ || isReceiver(aRID) );
+ }
+
+ inline void setReceiverRID(const RuntimeID & aRID)
+ {
+ base_this_type::mPTR->mReceiverRID = aRID;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mPort
+ */
+ inline const BF & bfPort() const
+ {
+ return( base_this_type::mPTR->mPort );
+ }
+
+ inline InstanceOfPort * getPort() const
+ {
+ return( base_this_type::mPTR->mPort.as_ptr< InstanceOfPort >() );
+ }
+
+ inline bool hasPort() const
+ {
+ return( base_this_type::mPTR->mPort.valid() );
+ }
+
+
+ inline bool isSignal(InstanceOfPort * aSignal) const
+ {
+ return( base_this_type::mPTR->mPort.isTEQ( aSignal ) );
+ }
+
+ inline bool isSignal(const ListOfInstanceOfPort & ieSignals) const
+ {
+ return( ieSignals.contains(
+ base_this_type::mPTR->mPort.as_ptr< InstanceOfPort >() ) );
+ }
+
+
+ inline void setPort(const BF & aPort)
+ {
+ base_this_type::mPTR->mPort = aPort;
+ }
+
+
+ /**
+ * TEST
+ * isCompatible
+ */
+ // case of Receiver only
+ inline bool isCompatible(const RuntimeID & aReceiverRID) const
+ {
+ return( isReceiver(aReceiverRID) );
+ }
+
+ // case of MID
+ inline bool isCompatible(avm_size_t mid) const
+ {
+ return( isMID(mid) );
+ }
+
+ inline bool isCompatible(avm_size_t mid,
+ const RuntimeID & aReceiverRID) const
+ {
+ return( isMID(mid) && isReceiver(aReceiverRID) );
+ }
+
+
+ // case of Signal
+ inline bool isCompatible(InstanceOfPort * aSignal) const
+ {
+ return( isSignal(aSignal));
+ }
+
+ inline bool isCompatible(InstanceOfPort * aSignal,
+ const RuntimeID & aReceiverRID) const
+ {
+ return( isSignal(aSignal) && isReceiver(aReceiverRID) );
+ }
+
+
+ // case of list< MID >
+ inline bool isCompatible(const ListOfSizeT & ieMids) const
+ {
+ return( isMID(ieMids) );
+ }
+
+ inline bool isCompatible(const ListOfSizeT & ieMids,
+ const RuntimeID & aReceiverRID) const
+ {
+ return( isReceiver(aReceiverRID) && isMID(ieMids) );
+ }
+
+
+ // case of list< Signal >
+ inline bool isCompatible(const ListOfInstanceOfPort & ieSignals) const
+ {
+ return( isSignal(ieSignals) );
+ }
+
+ inline bool isCompatible(const ListOfInstanceOfPort & ieSignals,
+ const RuntimeID & aReceiverRID) const
+ {
+ return( isReceiver(aReceiverRID) && isSignal(ieSignals) );
+ }
+
+
+
+ /**
+ * Serialization
+ */
+ inline virtual std::string str() const
+ {
+ return( (base_this_type::mPTR != NULL) ?
+ base_this_type::mPTR->str() : "Message<null>" );
+ }
+
+ inline virtual std::string toString(
+ const AvmIndent & indent = AVM_TAB_INDENT) const
+ {
+ if( base_this_type::mPTR != NULL )
+ {
+ StringOutStream oss(indent);
+
+ base_this_type::mPTR->toStream( oss );
+
+ return( oss.str() );
+ }
+ else
+ {
+ return( indent.TABS + "Message<null>" + indent.EOL);
+ }
+ }
+
+ inline void toStream(OutStream & os) const
+ {
+ if( base_this_type::mPTR != NULL )
+ {
+ base_this_type::mPTR->toStream(os);
+ }
+ else
+ {
+ os << "Message<null>" << std::flush;
+ }
+ }
+
+ void toFscn(OutStream & os) const;
+
+};
+
+
+
+/**
+ * TYPE DEFINITION
+ * TABLE of ROUTER
+ */
+typedef List< Message > ListOfMessage;
+
+typedef Vector< Message > TableOfMessage;
+
+
+} /* namespace sep */
+
+#endif /*MESSAGE_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/README.md b/org.eclipse.efm.symbex/src/fml/runtime/README.md
new file mode 100644
index 0000000..fd39f2f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/README.md
@@ -0,0 +1,34 @@
+# EFM-SYMBEX : Runtime
+
+## Source code structure
+
+### Interfaces
+
+### Classes
+
+#### Processes
+* **PID** as *Process Identifier* of Instance of Machine
+* **Process** as *Instance* at runtime stage in an *Execution Context* snapshot
+* **ProcessTable** as *Process Table*
+
+#### Table
+* **ValueTable** as Value Table of *Process* w.r.t *Variable* Table of Instance Model, aka Machine
+* **BufferInstanceTable** as Buffer Instance Table of *Process* w.r.t Buffer Model Table of Instance Model, aka Machine
+
+#### Message Table
+##### Interfaces
+* **IMessageTable** as *Runtime Buffer* Interface for message storage
+
+##### Classes
+* **FifoMessageTable** as Message Table with FIFO storage handler
+* **LifoMessageTable** as Message Table with LIFO storage handler
+* **BagMessageTable** as Message Table with BAG storage handler
+* **SetMessageTable** as Message Table with SET storage handler
+* **RamMessageTable** as Message Table with RAM storage handler
+
+##### Factories
+* **MessageTable** as Smart Pointer
+
+
+### Factories
+
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/RuntimeDef.cpp b/org.eclipse.efm.symbex/src/fml/runtime/RuntimeDef.cpp
new file mode 100644
index 0000000..39243b0
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/RuntimeDef.cpp
@@ -0,0 +1,219 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 9 févr. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "RuntimeDef.h"
+
+#include <util/avm_string.h>
+
+namespace sep
+{
+
+
+/**
+ * PROCESS EVAL STATE
+ * toString()
+ */
+
+#define PRINT_PROCESS_STATE( OBJ ) \
+ case PROCESS_##OBJ##_STATE : return( QUOTEME( STATE_##OBJ ) )
+
+
+std::string RuntimeDef::strPES(PROCESS_EVAL_STATE aPES)
+{
+ switch ( aPES )
+ {
+ PRINT_PROCESS_STATE( CREATING );
+ PRINT_PROCESS_STATE( CREATED );
+
+ PRINT_PROCESS_STATE( LOADED );
+
+ PRINT_PROCESS_STATE( STARTING );
+ PRINT_PROCESS_STATE( INITING );
+
+ PRINT_PROCESS_STATE( FINALIZING );
+ PRINT_PROCESS_STATE( FINALIZED );
+
+ PRINT_PROCESS_STATE( DESTROYED );
+
+ PRINT_PROCESS_STATE( STOPPING );
+ PRINT_PROCESS_STATE( STOPPED );
+
+ PRINT_PROCESS_STATE( SUSPENDED );
+
+ PRINT_PROCESS_STATE( WAITING );
+ PRINT_PROCESS_STATE( WAITING_JOIN );
+
+ PRINT_PROCESS_STATE( ABORTED );
+ PRINT_PROCESS_STATE( DISABLED );
+
+// PRINT_PROCESS_STATE( ENABLED );
+ PRINT_PROCESS_STATE( IDLE );
+
+ PRINT_PROCESS_STATE( RUNNING );
+
+ PRINT_PROCESS_STATE( UNDEFINED );
+
+ default : return( "PROCESS_UNKNOWN_STATE" );
+ }
+}
+
+
+/**
+ * AVM EXECUTION ENDING STATUS
+ * toString()
+ */
+
+#define PRINT_AEES( OBJ ) case AEES_##OBJ : return( QUOTEME( AEES_##OBJ ) )
+
+
+std::string RuntimeDef::strAEES(AVM_EXEC_ENDING_STATUS anAEES)
+{
+ switch ( anAEES )
+ {
+ PRINT_AEES( OK );
+
+ PRINT_AEES( FAILED );
+
+
+ PRINT_AEES( STMNT_NOTHING );
+
+ PRINT_AEES( STMNT_BREAK );
+
+ PRINT_AEES( STMNT_CONTINUE );
+
+ PRINT_AEES( STMNT_RETURN );
+
+
+ PRINT_AEES( STMNT_FINAL );
+ PRINT_AEES( STMNT_DESTROY );
+
+ PRINT_AEES( STMNT_EXIT );
+ PRINT_AEES( STMNT_EXIT_ALL );
+
+ PRINT_AEES( STMNT_FATAL_ERROR );
+
+ PRINT_AEES( SYMBOLIC_EXECUTION_LIMITATION );
+
+
+ PRINT_AEES( STEP_MARK );
+
+ PRINT_AEES( STEP_RESUME );
+
+ PRINT_AEES( WAITING_INCOM_RDV );
+ PRINT_AEES( WAITING_OUTCOM_RDV );
+
+ PRINT_AEES( WAITING_JOIN_FORK );
+
+ PRINT_AEES( UNKNOWN_SYNC );
+
+ PRINT_AEES( UNDEFINED );
+
+ default : return( "AEES_STMNT_UNKNOWN" );
+ }
+}
+
+
+/**
+ * CONVERSION
+ */
+AVM_EXEC_ENDING_STATUS RuntimeDef::PES_to_AEES(
+ PROCESS_EVAL_STATE aPES, AVM_EXEC_ENDING_STATUS defaultAEES)
+{
+ switch( aPES )
+ {
+ case PROCESS_FINALIZED_STATE:
+ {
+ return AEES_STMNT_FINAL;
+ }
+ case PROCESS_DESTROYED_STATE:
+ {
+ return AEES_STMNT_DESTROY;
+ }
+ default:
+ {
+ return( defaultAEES );
+ }
+ }
+}
+
+
+/**
+ * SYNCHRONIZATION
+ */
+PROCESS_EVAL_STATE RuntimeDef::syncPES(PROCESS_EVAL_STATE refPES,
+ PROCESS_EVAL_STATE frstPES, PROCESS_EVAL_STATE scndPES)
+{
+ if( (refPES == scndPES) || (frstPES == scndPES) )
+ {
+ return( frstPES );
+ }
+ else if( refPES == frstPES )
+ {
+ return( scndPES );
+ }
+ else if( (frstPES == PROCESS_WAITING_JOIN_STATE) ||
+ (scndPES == PROCESS_WAITING_JOIN_STATE) )
+ {
+ return( PROCESS_WAITING_JOIN_STATE );
+ }
+
+ return( PROCESS_UNDEFINED_STATE );
+}
+
+
+AVM_EXEC_ENDING_STATUS RuntimeDef::syncAEES(
+ AVM_EXEC_ENDING_STATUS frstAEES, AVM_EXEC_ENDING_STATUS scndAEES)
+{
+ if( frstAEES == scndAEES )
+ {
+ return( frstAEES );
+ }
+
+ else if( frstAEES == AEES_STMNT_NOTHING )
+ {
+ return( scndAEES );
+ }
+ else if( scndAEES == AEES_STMNT_NOTHING )
+ {
+ return( frstAEES );
+ }
+
+ else if( (frstAEES == AEES_STMNT_EXIT_ALL) ||
+ (scndAEES == AEES_STMNT_EXIT_ALL) )
+ {
+ return( AEES_STMNT_EXIT_ALL );
+ }
+ else if( (frstAEES == AEES_STMNT_EXIT) ||
+ (scndAEES == AEES_STMNT_EXIT) )
+ {
+ return( AEES_STMNT_EXIT );
+ }
+ else if( (frstAEES == AEES_STMNT_FATAL_ERROR) ||
+ (scndAEES == AEES_STMNT_FATAL_ERROR) )
+ {
+ return( AEES_STMNT_FATAL_ERROR );
+ }
+
+ else if( (frstAEES == AEES_SYMBOLIC_EXECUTION_LIMITATION) ||
+ (scndAEES == AEES_SYMBOLIC_EXECUTION_LIMITATION) )
+ {
+ return( AEES_SYMBOLIC_EXECUTION_LIMITATION );
+ }
+
+ return( AEES_UNKNOWN_SYNC );
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/RuntimeDef.h b/org.eclipse.efm.symbex/src/fml/runtime/RuntimeDef.h
new file mode 100644
index 0000000..1f73617
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/RuntimeDef.h
@@ -0,0 +1,152 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 9 févr. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef RUNTIMEDEF_H_
+#define RUNTIMEDEF_H_
+
+#include <string>
+
+
+namespace sep
+{
+
+
+enum PROCESS_EVAL_STATE
+{
+ PROCESS_CREATING_STATE,
+ PROCESS_CREATED_STATE,
+
+ PROCESS_LOADED_STATE,
+
+ PROCESS_STARTING_STATE,
+ PROCESS_INITING_STATE,
+
+ PROCESS_FINALIZING_STATE,
+ PROCESS_FINALIZED_STATE,
+ PROCESS_DESTROYED_STATE,
+
+ PROCESS_STOPPING_STATE,
+ PROCESS_STOPPED_STATE,
+
+// PROCESS_SLEEPING_STATE,
+ PROCESS_SUSPENDED_STATE,
+
+ PROCESS_WAITING_STATE,
+ PROCESS_WAITING_JOIN_STATE,
+
+ PROCESS_ABORTED_STATE,
+ PROCESS_DISABLED_STATE,
+
+// PROCESS_ENABLED_STATE,
+ PROCESS_IDLE_STATE,
+
+ PROCESS_RUNNING_STATE,
+ PROCESS_RTC_STATE,
+
+ PROCESS_UNDEFINED_STATE
+};
+
+
+enum AVM_EXEC_ENDING_STATUS
+{
+ AEES_OK,
+ AEES_FAILED,
+
+ AEES_STMNT_NOTHING,
+
+ AEES_STMNT_BREAK,
+ AEES_STMNT_CONTINUE,
+ AEES_STMNT_RETURN,
+
+ AEES_STMNT_FINAL,
+ AEES_STMNT_DESTROY,
+
+ AEES_STMNT_EXIT,
+ AEES_STMNT_EXIT_ALL,
+
+ AEES_STMNT_FATAL_ERROR,
+
+ AEES_SYMBOLIC_EXECUTION_LIMITATION,
+
+ AEES_STEP_MARK,
+ AEES_STEP_RESUME,
+
+ AEES_WAITING_INCOM_RDV,
+ AEES_WAITING_OUTCOM_RDV,
+
+ AEES_WAITING_JOIN_FORK,
+
+ AEES_UNKNOWN_SYNC,
+
+ AEES_UNDEFINED
+};
+
+
+
+class RuntimeDef
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ RuntimeDef()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~RuntimeDef()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * toString()
+ */
+ static std::string strPES(PROCESS_EVAL_STATE aPES);
+
+ static std::string strAEES(AVM_EXEC_ENDING_STATUS anAEES);
+
+
+ /**
+ * CONVERSION
+ */
+ static AVM_EXEC_ENDING_STATUS PES_to_AEES(
+ PROCESS_EVAL_STATE aPES, AVM_EXEC_ENDING_STATUS defaultAEES);
+
+
+ /**
+ * SYNCHRONIZATION
+ */
+ static PROCESS_EVAL_STATE syncPES(PROCESS_EVAL_STATE refState,
+ PROCESS_EVAL_STATE frstState, PROCESS_EVAL_STATE scndState);
+
+ static AVM_EXEC_ENDING_STATUS syncAEES(
+ AVM_EXEC_ENDING_STATUS frstAEES, AVM_EXEC_ENDING_STATUS scndAEES);
+
+
+
+
+};
+
+
+
+} /* namespace sep */
+#endif /* RUNTIMEDEF_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/RuntimeForm.cpp b/org.eclipse.efm.symbex/src/fml/runtime/RuntimeForm.cpp
new file mode 100644
index 0000000..997e6b7
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/RuntimeForm.cpp
@@ -0,0 +1,777 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "RuntimeForm.h"
+
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/InstanceOfData.h>
+#include <fml/executable/InstanceOfMachine.h>
+
+#include <fml/expression/ExpressionFactory.h>
+
+#include <fml/runtime/ExecutionData.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// RUNTIME FORM
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * GETTER - SETTER
+ * mChildTable
+ */
+const RuntimeID & RuntimeForm::getChild(
+ const std::string & aFullyQualifiedNameID) const
+{
+ if( hasChildTable() )
+ {
+ TableOfRuntimeID::const_iterator it = mChildTable->begin();
+ TableOfRuntimeID::const_iterator itEnd = mChildTable->end();
+ for( ; it != itEnd ; ++it)
+ {
+ // false?:- else only LOCATION
+ if( (*it).getInstance()->fqnEquals(
+ aFullyQualifiedNameID /* false */ ) )
+ {
+ return( *it );
+ }
+ }
+ }
+
+ return( RuntimeID::REF_NULL );
+}
+
+
+
+/**
+ * Serialization
+ */
+void RuntimeForm::toStream(const ExecutionData * anED, OutStream & os) const
+{
+ if( os.preferablyFQN() )
+ {
+// os << TAB << "rid#" << getRID().getRid();
+ os << TAB << getRID().str();
+
+ return;
+ }
+
+ os << TAB << "runtime";
+ if( getInstanciationCount() != 1 )
+ {
+ os << "< count:" << getInstanciationCount() << " >";
+ }
+ os << " ppid#" << ((getRID().getPRid() >= 0)? getRID().getPRid() : 0 )
+ << ".pid#" << getRID().getRid() << " " << getFullyQualifiedNameID()
+ << " as &" << getRID().getInstance()->getFullyQualifiedNameID();
+
+ if( hasChild() || hasOnSchedule() || hasOnDefer() || isInputEnabled() ||
+ (not isEnvironmentEnabledCommunication()) ||
+ hasData() || hasRouter() || hasBuffer() )
+ {
+ os << " {";
+ }
+ else
+ {
+ os << ";";
+ AVM_DEBUG_REF_COUNTER(os);
+ os << EOL_FLUSH;
+
+ return;
+ }
+
+
+ AVM_DEBUG_REF_COUNTER(os);
+ os << EOL_FLUSH;
+
+// os << INCR_INDENT;
+// getRID().toStream(os);
+// os << DECR_INDENT;
+
+AVM_IF_DEBUG_ENABLED_AND( hasChild() )
+
+ os << incr_stream( getChildTable() );
+
+AVM_ENDIF_DEBUG_ENABLED_AND
+
+ if( hasOnSchedule() )
+ {
+ os << TAB2 << "@schedule{" << INCR2_INDENT;
+ getOnSchedule()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+ if( hasOnDefer() )
+ {
+ os << TAB2 << "@defer{" << INCR2_INDENT;
+ getOnDefer()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+ // the Input Enabled Flag
+ // MOC Attribute for Communication
+ if( isInputEnabled() )
+ {
+ os << TAB2 << "input_enabled = true;" << EOL_FLUSH;
+ }
+
+ if( not isEnvironmentEnabledCommunication() )
+ {
+ os << TAB2 << "environment_enabled = false;" << EOL_FLUSH;
+ }
+
+ if( hasData() )
+ {
+ os << EOL_TAB << "data:";
+ getDataTable()->AVM_DEBUG_REF_COUNTER(os);
+ os << EOL;
+
+ avm_offset_t offset = 0;
+ TableOfData::iterator it = getDataTable()->begin();
+ for( ; it != getDataTable()->end() ; ++it , ++offset )
+ {
+// os << TAB2 << getVariables().rawAt(i)->getFullyQualifiedNameID();
+ os << TAB2 << getVariables().rawAt(offset)->getNameID() << std::flush;
+
+//AVM_OS_ASSERT_FATAL_ERROR_EXIT(
+// (offset == getVariables().rawAt(offset)->getOffset()) )
+// << "Invalid variable offset in data table!\n\t"
+// << str_header( getVariables().rawAt(offset) )
+// << SEND_EXIT;
+
+ os << ( ((anED != NULL) &&
+ anED->isAssigned(getRID(), offset))? " :=" : " =" );
+
+ if( (*it).valid() )
+ {
+ os << (*it).AVM_DEBUG_REF_COUNTER();
+
+ getVariables().rawAt(offset)->strValue(os, (*it));
+ }
+ else
+ {
+ os << " null< value >";
+ }
+
+ os << ";" << EOL_FLUSH;
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_GT_MEDIUM
+ if( hasRouter() )
+ {
+ os << EOL_TAB << "router:" << EOL_INCR_INDENT;
+ getRouter().toStream(os);
+ os << DECR_INDENT;
+ }
+AVM_ENDIF_DEBUG_LEVEL_GT_MEDIUM
+
+ if( hasBuffer() )
+ {
+ os << EOL_TAB << "buffer:";
+ getBufferTable().AVM_DEBUG_REF_COUNTER(os);
+
+ os << EOL_INCR_INDENT;
+ getBufferTable().toStream(os);
+ os << DECR_INDENT;
+ }
+
+ os << TAB << "}" << EOL_FLUSH;
+}
+
+
+void RuntimeForm::toStreamData(const ExecutionData * anED, OutStream & os) const
+{
+ if( os.preferablyFQN() )
+ {
+ os << TAB << "rid#" << getRID().getRid();
+ return;
+ }
+
+ os << TAB << "runtime";
+ if( getInstanciationCount() != 1 )
+ {
+ os << "< count:" << getInstanciationCount() << " >";
+ }
+ os << " ppid#" << ((getRID().getPRid() >= 0)? getRID().getPRid() : 0 )
+ << ".pid#" << getRID().getRid()
+ << " \"" << getFullyQualifiedNameID() << "\" as &"
+ << getRID().getInstance()->getFullyQualifiedNameID() << " is";
+
+ AVM_DEBUG_REF_COUNTER(os);
+ os << EOL_FLUSH;
+
+ if( hasOnSchedule() )
+ {
+ os << TAB2 << "@schedule{" << INCR2_INDENT;
+ getOnSchedule()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+ if( hasOnDefer() )
+ {
+ os << TAB2 << "@defer{" << INCR2_INDENT;
+ getOnDefer()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+ if( hasData() )
+ {
+ os << EOL_TAB << "data:";
+ getDataTable()->AVM_DEBUG_REF_COUNTER(os);
+ os << EOL;
+
+ avm_offset_t offset = 0;
+ TableOfData::iterator it = getDataTable()->begin();
+ for( ; it != getDataTable()->end() ; ++it , ++offset )
+ {
+// os << TAB2 << getVariables().rawAt(i)->getFullyQualifiedNameID();
+ os << TAB2 << getVariables().rawAt(offset)->getNameID() << std::flush;
+
+//AVM_OS_ASSERT_FATAL_ERROR_EXIT(
+// (offset == getVariables().rawAt(offset)->getOffset()) )
+// << "Invalid variable offset in data table!\n\t"
+// << str_header( getVariables().rawAt(offset) )
+// << SEND_EXIT;
+
+ os << ( ((anED != NULL) &&
+ anED->isAssigned(getRID(), offset))? " :=" : " =" );
+
+ if( (*it).valid() )
+ {
+ os << (*it).AVM_DEBUG_REF_COUNTER();
+
+ getVariables().rawAt(offset)->strValue(os, (*it));
+ }
+ else
+ {
+ os << " null< value >";
+ }
+
+ os << ";" << EOL_FLUSH;
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_GT_MEDIUM
+ if( hasRouter() )
+ {
+ os << EOL_TAB << "router:" << EOL_INCR_INDENT;
+ getRouter().toStream(os);
+ os << DECR_INDENT;
+ }
+AVM_ENDIF_DEBUG_LEVEL_GT_MEDIUM
+
+ if( hasBuffer() )
+ {
+ os << EOL_TAB << "buffer:";
+ getBufferTable().AVM_DEBUG_REF_COUNTER(os);
+
+ os << EOL_INCR_INDENT;
+ getBufferTable().toStream(os);
+ os << DECR_INDENT;
+ }
+
+ os << TAB << "}" << EOL_FLUSH;
+}
+
+
+void RuntimeForm::toFscnData(OutStream & os,
+ const ExecutionData * anED, const RuntimeForm * aPreviousRF) const
+{
+ TableOfInstanceOfData::
+ const_raw_iterator itData = getExecutable()->getBasicData().begin();
+ TableOfInstanceOfData::
+ const_raw_iterator endData = getExecutable()->getBasicData().end();
+ for( avm_offset_t offset = 0 ; itData != endData ; ++itData , ++offset)
+ {
+ const BF & aValue = (itData)->getModifier().hasNatureReference() ?
+ getData( (itData)->getOffset() ) : getData( (itData) );
+
+ if( (aPreviousRF == NULL)
+ || (aValue != ( (itData)->getModifier().hasNatureReference()
+ ? aPreviousRF->getData((itData)->getOffset())
+ : aPreviousRF->getData((itData)) ))
+ /*|| ((anED != NULL) && anED->isAssigned(getRID(), i))*/ )
+ {
+ os << TAB << ":pid#" << getRID().getRid()<< ":";
+
+//AVM_OS_ASSERT_FATAL_ERROR_EXIT(
+// (offset == (itData)->getOffset()) || (not (itData)->isStandardPointer()) )
+// << "Invalid variable offset< " << offset << " > in data table of "
+// << getRID().getFullyQualifiedNameID() << "!\n\t"
+// << str_header( *itData ) << " = " << aValue.str() << std::endl
+// << SEND_EXIT;
+
+ os << (itData)->getNameID() << " =";
+
+ if( aValue.valid() )
+ {
+ (itData)->strValue(os, aValue);
+ }
+ else
+ {
+ os << " null< value >";
+ }
+
+ os << ";" << EOL_FLUSH;
+ }
+ }
+}
+
+
+void RuntimeForm::toFscnBuffer(OutStream & os,
+ const ExecutionData * anED, const RuntimeForm * aPreviousRF) const
+{
+ if( aPreviousRF != NULL )
+ {
+ TableOfBufferT::
+ const_iterator itPrev = aPreviousRF->getBufferTable().begin();
+ TableOfBufferT::
+ const_iterator itPrevEnd = aPreviousRF->getBufferTable().end();
+ TableOfBufferT::const_iterator it = getBufferTable().begin();
+ TableOfBufferT::const_iterator itEnd = getBufferTable().end();
+ for(; (it != itEnd) && (itPrev != itPrevEnd) ; ++it , ++itPrev )
+ {
+ (*it)->toFscn(os, getRID(), (*itPrev));
+ }
+ }
+ else
+ {
+ TableOfBufferT::const_iterator it = getBufferTable().begin();
+ TableOfBufferT::const_iterator itEnd = getBufferTable().end();
+ for( ; it != itEnd ; ++it )
+ {
+ (*it)->toFscn(os, getRID(), NULL);
+ }
+ }
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// PARAMETERS RUNTIME FORM
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * GETTER - SETTER
+ * mParameters
+ */
+const BF & ParametersRuntimeForm::saveParameter(InstanceOfData * anInstance)
+{
+ avm_size_t offset = mDataTable->size();
+
+ anInstance->setContainer( getExecutable() );
+ anInstance->setOffset( offset );
+ const BF & bfInbstance = mParameters.save(anInstance);
+
+ mDataTable.makeWritable();
+ mDataTable->resize( offset + 1 );
+
+ mDataTable->set(offset, bfInbstance);
+
+ anInstance->setRuntimeContainerRID( mRID );
+
+ return( bfInbstance );
+}
+
+void ParametersRuntimeForm::appendParameter(
+ const BF & anInstance, const BF & rvalue )
+{
+ avm_size_t offset = mDataTable->size();
+
+// anInstance->setContainer( getExecutable() );
+ anInstance.to_ptr< InstanceOfData >()->setOffset( offset );
+ mParameters.append(anInstance);
+
+ mDataTable.makeWritable();
+ mDataTable->resize( offset + 1 );
+
+ mDataTable->set(offset, rvalue);
+
+// anInstance->setRuntimeContainerRID( mRID );
+}
+
+
+void ParametersRuntimeForm::appendParameters(const BFList & paramsList)
+{
+ avm_size_t offset = mDataTable->size();
+ mDataTable.makeWritable();
+ mDataTable->resize( offset + paramsList.size() );
+
+ BFList::const_iterator itParam = paramsList.begin();
+ BFList::const_iterator endParam = paramsList.end();
+ for( InstanceOfData * pParam; itParam != endParam ; ++itParam , ++offset )
+ {
+ pParam = (*itParam).to_ptr< InstanceOfData >();
+
+ pParam->setContainer( getExecutable() );
+ mParameters.append( *itParam );
+
+ pParam->setOffset( offset );
+ mDataTable->set(offset, *itParam);
+
+ pParam->setRuntimeContainerRID( mRID );
+ }
+}
+
+
+void ParametersRuntimeForm::appendParameters(const BFVector & paramsVector)
+{
+ avm_size_t offset = mDataTable->size();
+ mDataTable.makeWritable();
+ mDataTable->resize( offset + paramsVector.size() );
+
+ BFVector::const_raw_iterator< InstanceOfData > itParam = paramsVector.begin();
+ BFVector::const_raw_iterator< InstanceOfData > endParam = paramsVector.end();
+ for( ; itParam != endParam ; ++itParam , ++offset )
+ {
+ (itParam)->setContainer( getExecutable() );
+ mParameters.append( *itParam );
+
+ (itParam)->setOffset( offset );
+ mDataTable->set(offset, *itParam);
+
+ (itParam)->setRuntimeContainerRID( mRID );
+ }
+}
+
+
+/**
+ * RUNTIME UPDATE
+ */
+void ParametersRuntimeForm::update(const BF & paramExpr)
+{
+ BFVector tableOfParams;
+ ExpressionFactory::collectVariable(paramExpr, tableOfParams);
+
+ avm_size_t endThisParam = mParameters.size();
+ avm_size_t endParam = tableOfParams.size();
+ avm_size_t offset = 0;
+ for( InstanceOfData * pParam ; offset < endParam ; ++offset )
+ {
+ pParam = tableOfParams[offset].to_ptr< InstanceOfData >();
+
+ if( pParam->getOffset() >= endThisParam )
+ {
+ mParameters.append( tableOfParams[offset] );
+ }
+ else if( mParameters[pParam->getOffset()] != pParam )
+ {
+ if( mParameters.contains( tableOfParams[offset] ) )
+ {
+AVM_IF_DEBUG_FLAG( COMPUTING )
+
+ AVM_OS_WARNING_ALERT
+ << "Unexpected parameter << "
+ << str_header( tableOfParams[offset] ) << " >> in <<\n"
+ << str_header( mParameters ) << " >> !!!"
+ << SEND_ALERT;
+
+AVM_ENDIF_DEBUG_FLAG( COMPUTING )
+ }
+ else
+ {
+ mParameters.append( tableOfParams[offset] );
+ }
+ }
+ }
+
+ endParam = mParameters.size();
+ if( endThisParam < endParam )
+ {
+ mDataTable.makeWritable();
+ mDataTable->resize( endParam );
+
+ for( offset = endThisParam ; offset < endParam ; ++offset )
+ {
+ mDataTable->set(offset, mParameters[offset]);
+ }
+ }
+}
+
+
+/**
+ * Serialization
+ */
+void ParametersRuntimeForm::toStream(
+ const ExecutionData * anED, OutStream & os) const
+{
+ if( os.preferablyFQN() )
+ {
+ os << TAB << getRID().str();
+ return;
+ }
+
+ os << TAB << "runtime" << " ppid#"
+ << ((getRID().getPRid() >= 0)? getRID().getPRid() : 0 )
+ << ".pid#" << getRID().getRid() << " " << getFullyQualifiedNameID()
+ << " as &" << getRID().getInstance()->getFullyQualifiedNameID() << " {";
+
+ AVM_DEBUG_REF_COUNTER(os);
+ os << EOL_FLUSH;
+
+// os << INCR_INDENT;
+// getRID().toStream(os);
+// os << DECR_INDENT;
+
+AVM_IF_DEBUG_ENABLED_AND( hasChild() )
+
+ os << incr_stream( getChildTable() );
+
+AVM_ENDIF_DEBUG_ENABLED_AND
+
+ if( hasOnSchedule() )
+ {
+ os << TAB2 << "@schedule{" << INCR2_INDENT;
+ getOnSchedule()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}";
+ }
+
+ if( hasOnDefer() )
+ {
+ os << TAB2 << "@defer{" << INCR2_INDENT;
+ getOnDefer()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}";
+ }
+
+ // the Input Enabled Flag
+ // MOC Attribute for Communication
+ if( isInputEnabled() )
+ {
+ os << TAB2 << "input_enabled = true;" << EOL_FLUSH;
+ }
+
+ if( not isEnvironmentEnabledCommunication() )
+ {
+ os << TAB2 << "environment_enabled = false;" << EOL_FLUSH;
+ }
+
+
+AVM_IF_DEBUG_FLAG( DATA )
+ if( hasParameter() )
+ {
+ resetOffset();
+
+ os << TAB << "params:" << EOL_INCR_INDENT;
+
+// getParameters().strHeader(os);
+ getParameters().toStream(os);
+
+ os << DECR_INDENT;
+ }
+
+ if( hasData() )
+ {
+ os << TAB << "data:";
+ getDataTable()->AVM_DEBUG_REF_COUNTER(os);
+ os << EOL;
+
+ TableOfInstanceOfData::const_raw_iterator itParam = getParameters().begin();
+ TableOfData::const_iterator itValue = getDataTable()->begin();
+ TableOfData::const_iterator endValue = getDataTable()->end();
+ avm_offset_t offset = 0;
+ for( ; itValue != endValue ; ++itValue , ++offset , ++itParam )
+ {
+//AVM_OS_ASSERT_FATAL_ERROR_EXIT( offset == (itParam)->getOffset() )
+// << "Invalid parameter offset in parameters data table !\n\t"
+// << str_header( *itParam )
+// << SEND_EXIT;
+
+ //if( (*itValue) != (itParam) )
+ {
+ os << TAB2 << "//*@param<" << offset << ">*/ "
+ << (itParam)->getNameID() << " =";
+
+ if( (*itValue).valid() )
+ {
+ os << (*itValue).AVM_DEBUG_REF_COUNTER();
+ (itParam)->strValue(os, (*itValue));
+ // os << str_indent( *itValue );
+ }
+ else
+ {
+ os << " null< value >";
+ }
+
+ os << EOL_FLUSH;
+ }
+ }
+ }
+AVM_ENDIF_DEBUG_FLAG( DATA )
+
+AVM_IF_DEBUG_LEVEL_GT_MEDIUM
+ if( hasRouter() )
+ {
+ os << EOL_TAB << "router:" << EOL_INCR_INDENT;
+ getRouter().toStream(os);
+ os << DECR_INDENT;
+ }
+AVM_ENDIF_DEBUG_LEVEL_GT_MEDIUM
+
+ if( hasBuffer() )
+ {
+ os << EOL_TAB << "buffer:";
+ getBufferTable().AVM_DEBUG_REF_COUNTER(os);
+
+ os << EOL_INCR_INDENT;
+ getBufferTable().toStream(os);
+ os << DECR_INDENT;
+ }
+
+ os << TAB << "}" << EOL_FLUSH;
+}
+
+
+void ParametersRuntimeForm::toStreamData(
+ const ExecutionData * anED, OutStream & os) const
+{
+ if( os.preferablyFQN() )
+ {
+ os << TAB << "rid#" << getRID().getRid();
+ return;
+ }
+
+ os << TAB << "runtime" << " ppid#"
+ << ((getRID().getPRid() >= 0)? getRID().getPRid() : 0 )
+ << ".pid#" << getRID().getRid() << " \"" << getFullyQualifiedNameID()
+ << "\" as &" << getRID().getInstance()->getFullyQualifiedNameID() << " {";
+
+ AVM_DEBUG_REF_COUNTER(os);
+ os << EOL_FLUSH;
+
+ if( hasOnSchedule() )
+ {
+ os << TAB2 << "@schedule{" << INCR2_INDENT;
+ getOnSchedule()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}";
+ }
+
+ if( hasOnDefer() )
+ {
+ os << TAB2 << "@defer{" << INCR2_INDENT;
+ getOnDefer()->toStreamRoutine( os );
+ os << DECR2_INDENT_TAB2 << "}";
+ }
+
+ if( hasData() )
+ {
+ resetOffset();
+
+ os << TAB << "data:";
+ getDataTable()->AVM_DEBUG_REF_COUNTER(os);
+ os << EOL;
+
+ TableOfInstanceOfData::const_raw_iterator itParam = getParameters().begin();
+ TableOfData::const_iterator itValue = getDataTable()->begin();
+ TableOfData::const_iterator endValue = getDataTable()->end();
+ avm_offset_t offset = 0;
+ for( ; itValue != endValue ; ++itValue , ++offset , ++itParam )
+ {
+//AVM_OS_ASSERT_FATAL_ERROR_EXIT( offset == (itParam)->getOffset() )
+// << "Invalid parameter offset in parameters data table !\n\t"
+// << str_header( *itParam )
+// << SEND_EXIT;
+
+// if( (*itValue) != (itParam) )
+ {
+ os << TAB2 << "//*@param<" << offset << ">*/ "
+ << (itParam)->getNameID() << " =";
+
+ if( (*itValue).valid() )
+ {
+ os << (*itValue).AVM_DEBUG_REF_COUNTER();
+ (itParam)->strValue(os, (*itValue));
+// os << str_indent( *itValue );
+ }
+ else
+ {
+ os << " null< value >";
+ }
+
+ os << EOL_FLUSH;
+ }
+ }
+ }
+
+ if( hasBuffer() )
+ {
+ os << EOL_TAB << "buffer:";
+ getBufferTable().AVM_DEBUG_REF_COUNTER(os);
+
+ os << EOL_INCR_INDENT;
+ getBufferTable().toStream(os);
+ os << DECR_INDENT;
+ }
+
+ os << TAB << "}" << EOL_FLUSH;
+}
+
+
+void ParametersRuntimeForm::toFscnData(OutStream & os,
+ const ExecutionData * anED, const RuntimeForm * aPreviousRF) const
+{
+AVM_IF_DEBUG_FLAG( DATA )
+
+ resetOffset();
+
+ TableOfInstanceOfData::const_raw_iterator itData = getParameters().begin();
+ TableOfInstanceOfData::const_raw_iterator endData = getParameters().end();
+
+// for( ; itData != endData ; ++itData )
+// {
+// os << TAB << str_header( *itData ) << ";" << EOL;
+// }
+// itData = getParameters().begin();
+
+ avm_size_t previousParamsSize = (aPreviousRF == NULL) ? 0 :
+ aPreviousRF->getDataTable()->size();
+ for( avm_offset_t offset = 0 ; itData != endData ; ++itData , ++offset)
+ {
+ const BF & aValue = getData( (itData) );
+
+ if( (aPreviousRF == NULL) || (offset >= previousParamsSize) ||
+ (aValue != aPreviousRF->getData( (itData) )) /*||
+ ((anED != NULL) && anED->isAssigned(getRID(), i))*/ )
+ {
+//AVM_OS_ASSERT_FATAL_ERROR_EXIT( offset == (itData)->getOffset() )
+// << "Invalid parameter offset in parameters data table !\n\t"
+// << str_header( *itData )
+// << SEND_EXIT;
+
+ os << TAB << "//*@param<" << offset << ">*/ ";
+
+// os << ":pid#" << getRID().getRid()<< ":" << (itData)->getNameID();
+ os << (itData)->getFullyQualifiedNameID() << " =";
+
+ if( aValue.valid() )
+ {
+ (itData)->strValue(os, aValue);
+ }
+ else
+ {
+ os << " null< value >";
+ }
+
+ os << ";" << EOL_FLUSH;
+ }
+ }
+
+AVM_ENDIF_DEBUG_FLAG( DATA )
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/RuntimeForm.h b/org.eclipse.efm.symbex/src/fml/runtime/RuntimeForm.h
new file mode 100644
index 0000000..df4e3ef
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/RuntimeForm.h
@@ -0,0 +1,821 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef RUNTIMEFORM_H_
+#define RUNTIMEFORM_H_
+
+#include <base/SmartTable.h>
+
+#include <common/AvmPointer.h>
+#include <common/Element.h>
+#include <common/BF.h>
+
+#include <collection/Typedef.h>
+
+#include <fml/buffer/BaseBufferForm.h>
+
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/Router.h>
+#include <fml/executable/InstanceOfBuffer.h>
+#include <fml/executable/InstanceOfData.h>
+
+#include <fml/runtime/RuntimeID.h>
+#include <fml/runtime/TableOfData.h>
+
+
+namespace sep
+{
+
+
+class ExecutableForm;
+class ExecutionData;
+class InstanceOfData;
+class InstanceOfMachine;
+
+/**
+ * TYPEDEF
+ */
+typedef SmartTable< BaseBufferForm , DestroyElementPolicy > TableOfBufferT;
+
+
+class RuntimeForm : public Element ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( RuntimeForm )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( RuntimeForm )
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ avm_size_t mInstanciationCount;
+
+ RuntimeID mRID;
+
+ APTableOfRuntimeID mChildTable;
+
+ APTableOfData mDataTable;
+
+ TableOfBufferT mBufferTable;
+ Router mRouter;
+
+ BFCode mOnSchedule;
+
+ BFCode mOnDefer;
+
+ // MOC Attribute for Communication
+ bool mEnvironmentEnabledCommunicationFlag;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ RuntimeForm(const RuntimeID & aRID)
+ : Element( CLASS_KIND_T( RuntimeForm ) ),
+
+ mInstanciationCount( aRID.getInstance()->getInstanciationCount() ),
+
+ mRID( aRID ),
+
+ mChildTable( ),
+
+ mDataTable( ),
+
+ mBufferTable( ),
+ mRouter( ),
+
+ mOnSchedule( ),
+ mOnDefer( ),
+
+ mEnvironmentEnabledCommunicationFlag( true )
+ {
+ //!! NOTHING
+ }
+
+
+ RuntimeForm(class_kind_t aClassKind, const RuntimeID & aRID)
+ : Element( aClassKind ),
+
+ mInstanciationCount( aRID.getInstance()->getInstanciationCount() ),
+
+ mRID( aRID ),
+
+ mChildTable( ),
+
+ mDataTable( ),
+
+ mBufferTable( ),
+ mRouter( ),
+
+ mOnSchedule( ),
+ mOnDefer( ),
+
+ mEnvironmentEnabledCommunicationFlag( true )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ RuntimeForm(const RuntimeForm & aRuntime)
+ : Element( aRuntime ),
+
+ mInstanciationCount( aRuntime.mInstanciationCount ),
+
+ mRID( aRuntime.mRID ),
+
+ mChildTable( aRuntime.mChildTable ),
+
+ mDataTable( aRuntime.mDataTable ),
+
+ mBufferTable( aRuntime.mBufferTable ),
+ mRouter( aRuntime.mRouter ),
+
+ mOnSchedule( aRuntime.mOnSchedule ),
+ mOnDefer( aRuntime.mOnDefer ),
+
+ mEnvironmentEnabledCommunicationFlag( true )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~RuntimeForm()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mRID
+ */
+ inline const RuntimeID & getRID() const
+ {
+ return( mRID );
+ }
+
+ inline bool hasParentRID() const
+ {
+ return( mRID.hasPRID() );
+ }
+
+ inline RuntimeID getParentRID() const
+ {
+ return( mRID.getPRID() );
+ }
+
+
+ inline int getRid() const
+ {
+ return( mRID.getRid() );
+ }
+
+
+ inline int getOffset() const
+ {
+ return( mRID.getOffset() );
+ }
+
+
+ inline InstanceOfMachine * getInstance() const
+ {
+ return( mRID.getInstance() );
+ }
+
+ inline ExecutableForm * getExecutable() const
+ {
+ return( mRID.getExecutable() );
+ }
+
+ inline bool hasExecutable() const
+ {
+ return( mRID.hasExecutable() );
+ }
+
+
+ inline std::string getFullyQualifiedNameID() const
+ {
+ return( mRID.getFullyQualifiedNameID() );
+ }
+
+ inline std::string getNameID() const
+ {
+ return( mRID.getNameID() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mInstanciationCount
+ */
+ inline avm_size_t getInstanciationCount() const
+ {
+ return( mInstanciationCount );
+ }
+
+ inline avm_size_t decrInstanciationCount()
+ {
+ return( --mInstanciationCount );
+ }
+
+ inline avm_size_t incrInstanciationCount()
+ {
+ return( ++mInstanciationCount );
+ }
+
+
+ inline bool isInstanciated() const
+ {
+ return( mInstanciationCount > 0 );
+ }
+
+ inline bool isnotInstanciated() const
+ {
+ return( mInstanciationCount == 0 );
+ }
+
+
+ inline void setInstanciationCount(avm_size_t anInstanciationNumber)
+ {
+ mInstanciationCount = anInstanciationNumber;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mChildTable
+ */
+ inline const APTableOfRuntimeID & getChildTable() const
+ {
+ return( mChildTable );
+ }
+
+
+ TableOfRuntimeID::iterator beginChild()
+ {
+ // don't forget the instance THIS at offset 0 !!!
+ return( hasInstanceThis() ?
+ ++(mChildTable->begin()) : mChildTable->begin() );
+ }
+
+ TableOfRuntimeID::const_iterator beginChild() const
+ {
+ // don't forget the instance THIS at offset 0 !!!
+ return( hasInstanceThis() ?
+ ++(mChildTable->begin()) : mChildTable->begin() );
+ }
+
+ TableOfRuntimeID::iterator endChild()
+ {
+ return( mChildTable->end() );
+ }
+
+ TableOfRuntimeID::const_iterator endChild() const
+ {
+ return( mChildTable->end() );
+ }
+
+
+ inline bool hasInstanceThis() const
+ {
+ return( mChildTable->nonempty() && (mChildTable->first() == mRID) );
+ }
+
+ inline bool hasChild() const
+ {
+ return( mChildTable.valid() && (mChildTable->populated() ||
+ (mChildTable->nonempty() && (mChildTable->first() != mRID))) );
+ }
+
+ inline bool hasChildTable() const
+ {
+ return( mChildTable.valid() );
+ }
+
+ inline void makeWritableChildTable()
+ {
+ mChildTable.makeWritable();
+ }
+
+ inline void setChildTable(const APTableOfRuntimeID & aChilTable)
+ {
+ mChildTable = aChilTable;
+ }
+
+
+ inline void appendChild(const RuntimeID & aRID)
+ {
+ if( mChildTable.invalid() )
+ {
+ mChildTable.replacePointer( new TableOfRuntimeID() );
+ }
+
+ mChildTable->append(aRID);
+ }
+
+
+ inline const RuntimeID & getChild(avm_offset_t offset) const
+ {
+ return( mChildTable->get(offset) );
+ }
+
+ const RuntimeID & getChild(const std::string & aFullyQualifiedNameID) const;
+
+
+ /**
+ * GETTER - SETTER
+ * mDataTable
+ */
+ inline APTableOfData & getDataTable()
+ {
+ return( mDataTable );
+ }
+
+ inline const APTableOfData & getDataTable() const
+ {
+ return( mDataTable );
+ }
+
+ inline bool hasData() const
+ {
+ return( mDataTable.valid() && mDataTable->nonempty() );
+ }
+
+ inline bool hasDataTable() const
+ {
+ return( mDataTable.valid() );
+ }
+
+ // Writable mDataTable
+ inline APTableOfData & getWritableDataTable()
+ {
+ mDataTable.makeWritable();
+
+ return( mDataTable );
+ }
+
+ inline void makeWritableDataTable()
+ {
+ mDataTable.makeWritable();
+ }
+
+ //??COMPILE!!
+ inline void setDataTable(TableOfData * aDataTable)
+ {
+ mDataTable = aDataTable;
+ }
+
+ inline void setDataTable(const APTableOfData & aDataTable)
+ {
+ mDataTable = aDataTable;
+ }
+
+
+ inline virtual const TableOfInstanceOfData & getVariables() const
+ {
+ return( mRID.getExecutable()->getData() );
+ }
+
+ inline virtual InstanceOfData * rawVariable(avm_offset_t offset) const
+ {
+ return( mRID.rawVariable(offset) );
+ }
+
+ inline virtual const BF & getVariable(avm_offset_t offset) const
+ {
+ return( mRID.getVariable(offset) );
+ }
+
+
+ inline BF & getData(avm_offset_t offset) const
+ {
+ return( mDataTable->at(offset) );
+ }
+
+ inline BF & getWritableData(avm_offset_t offset) const
+ {
+ return( mDataTable->getWritable(offset) );
+ }
+
+ inline const BF & getData(const InstanceOfData * anInstance) const
+ {
+ return( mDataTable->get(anInstance) );
+ }
+
+
+ inline const BF & getData(const std::string & aFullyQualifiedNameID) const
+ {
+ InstanceOfData * anInstance = getExecutable()->getAllData().
+ rawByFQNameID( aFullyQualifiedNameID );
+ if( anInstance != NULL )
+ {
+ return( mDataTable->get(anInstance) );
+ }
+ return( BF::REF_NULL );
+ }
+
+ inline const BF & getDataByQualifiedNameID(
+ const std::string & aQualifiedNameID, InstanceOfData * & var) const
+ {
+ var = getExecutable()->getAllData().rawByQualifiedNameID(aQualifiedNameID);
+ if( var != NULL )
+ {
+ return( mDataTable->get(var) );
+ }
+ return( BF::REF_NULL );
+ }
+
+ inline const BF & getDataByNameID(const std::string & aNameID) const
+ {
+ InstanceOfData * anInstance =
+ getExecutable()->getAllData().rawByNameID(aNameID);
+ if( anInstance != NULL )
+ {
+ return( mDataTable->get(anInstance) );
+ }
+ return( BF::REF_NULL );
+ }
+
+
+ inline void setData(avm_offset_t offset, const BF & aData) const
+ {
+ mDataTable->set(offset, aData);
+ }
+
+ inline void setData(
+ const InstanceOfData * anInstance, const BF & aData) const
+ {
+ mDataTable->set(anInstance, aData);
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mDataTable
+ */
+ inline const TableOfBufferT & getBufferTable() const
+ {
+ return( mBufferTable );
+ }
+
+ inline bool hasBuffer() const
+ {
+ return( mBufferTable.nonempty() );
+ }
+
+ inline bool hasBufferTable() const
+ {
+ return( mBufferTable.valid() );
+ }
+
+ inline TableOfBufferT & getWritableBufferTable()
+ {
+ mBufferTable.makeWritable();
+
+ return( mBufferTable );
+ }
+
+ inline void makeWritableBufferTable()
+ {
+ mBufferTable.makeWritable();
+ }
+
+ inline void setBufferTable(const TableOfBufferT & aBufferTable)
+ {
+ mBufferTable = aBufferTable;
+ }
+
+
+ inline const BaseBufferForm & getBuffer(
+ const InstanceOfBuffer * aBuffer) const
+ {
+ return( mBufferTable.ref( aBuffer->getOffset() ) );
+ }
+
+ inline BaseBufferForm & getWritableBuffer(const InstanceOfBuffer * aBuffer)
+ {
+ return( mBufferTable.refWritable( aBuffer->getOffset() ) );
+ }
+
+ inline BF bfWritableBuffer(const InstanceOfBuffer * aBuffer)
+ {
+ return( mBufferTable.spWritable< BF >( aBuffer->getOffset() ) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mRouter
+ */
+ inline const Router & getRouter() const
+ {
+ return( mRouter );
+ }
+
+ inline bool hasRouter() const
+ {
+ return( mRouter.valid() );
+ }
+
+ inline void makeWritableRouter()
+ {
+ mRouter.makeWritable();
+ }
+
+ inline void setRouter(const Router & aRouter)
+ {
+ mRouter = aRouter;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mOnSchedule
+ */
+ inline const BFCode & getOnSchedule() const
+ {
+ return( mOnSchedule );
+ }
+
+ inline bool hasOnSchedule() const
+ {
+ return( mOnSchedule.valid() );
+ }
+
+ inline void setOnSchedule(const BFCode & onSchedule)
+ {
+ mOnSchedule = onSchedule;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mOnDefer
+ */
+ inline const BFCode & getOnDefer() const
+ {
+ return( mOnDefer );
+ }
+
+ inline bool hasOnDefer() const
+ {
+ return( mOnDefer.valid() );
+ }
+
+ inline void setOnDefer(const BFCode & onDefer)
+ {
+ mOnDefer = onDefer;
+ }
+
+
+ /**
+ * GETTER
+ * the Input Enabled Flag
+ * MOC Attribute for Communication
+ */
+ inline bool isInputEnabled() const
+ {
+ return( getRID().getInstance()->getSpecifier().hasFeatureInputEnabled()
+ || getRID().getExecutable()->
+ getSpecifier().hasFeatureInputEnabled() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mEnvironmentEnabledCommunicationFlag
+ * MOC Attribute for Communication
+ */
+ inline bool isEnvironmentEnabledCommunication() const
+ {
+ return( mEnvironmentEnabledCommunicationFlag );
+ }
+
+ inline void setEnvironmentEnabledCommunication(
+ bool isEnvironmentEnabled = true)
+ {
+ mEnvironmentEnabledCommunicationFlag = isEnvironmentEnabled;
+ }
+
+
+ /**
+ * Serialization
+ */
+ inline virtual void toStream(OutStream & os) const
+ {
+ toStream(NULL, os);
+ }
+
+ inline virtual std::string str() const
+ {
+ return( getRID().str() );
+ }
+
+ virtual void toStream(const ExecutionData * anED, OutStream & os) const;
+
+ virtual void toStreamData(const ExecutionData * anED, OutStream & os) const;
+
+
+ virtual void toFscnData(OutStream & os,
+ const ExecutionData * anED, const RuntimeForm * aPreviousRF) const;
+
+ void toFscnBuffer(OutStream & os,
+ const ExecutionData * anED, const RuntimeForm * aPreviousRF) const;
+
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// PARAMETERS RUNTIME FORM
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class ParametersRuntimeForm : public RuntimeForm ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ParametersRuntimeForm )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( ParametersRuntimeForm )
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ TableOfInstanceOfData mParameters;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ParametersRuntimeForm(const RuntimeID & aRID)
+ : RuntimeForm( CLASS_KIND_T( ParametersRuntimeForm ) , aRID ),
+ mParameters( )
+ {
+ mDataTable = new TableOfData(0);
+ }
+
+ ParametersRuntimeForm(const RuntimeID & aRID, avm_size_t nbParams)
+ : RuntimeForm( CLASS_KIND_T( ParametersRuntimeForm ) , aRID ),
+ mParameters( nbParams )
+ {
+ mDataTable = new TableOfData(nbParams);
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ ParametersRuntimeForm(const ParametersRuntimeForm & aRuntime)
+ : RuntimeForm( aRuntime ),
+ mParameters( aRuntime.mParameters )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ParametersRuntimeForm()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mParameters
+ */
+ const BF & saveParameter(InstanceOfData * anInstance);
+
+ void appendParameter(const BF & anInstance, const BF & rvalue);
+
+
+ void appendParameters(const BFList & paramsList);
+
+ void appendParameters(const BFVector & paramsVector);
+
+
+ inline const TableOfInstanceOfData & getParameters() const
+ {
+ return( mParameters );
+ }
+
+
+ inline avm_size_t getParametersSize() const
+ {
+ return( mParameters.size() );
+ }
+
+
+ inline const BF & getParameter(avm_offset_t offset) const
+ {
+ return( mParameters.get(offset) );
+ }
+
+ inline InstanceOfData * rawParameter(avm_offset_t offset) const
+ {
+ return( mParameters.rawAt(offset) );
+ }
+
+ inline bool hasParameter() const
+ {
+ return( mParameters.nonempty() );
+ }
+
+
+ inline void setParameter(avm_offset_t offset, const BF & anInstance)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( anInstance )
+ << "InstanceOfData !!!"
+ << SEND_EXIT;
+
+ anInstance.to_ptr< InstanceOfData >()->setContainer( getExecutable() );
+ mParameters.set(offset, anInstance);
+ }
+
+ inline void setParameter(avm_offset_t offset,
+ const BF & anInstance, const BF & rvalue )
+ {
+// anInstance->setContainer( getExecutable() );
+// anInstance->setOffset( offset );
+ mParameters[ offset ] = anInstance;
+
+ mDataTable->set(offset, rvalue);
+
+// anInstance->setRuntimeContainerRID( mRID );
+ }
+
+
+ // Variable
+ inline virtual const TableOfInstanceOfData & getVariables() const
+ {
+ return( mParameters );
+ }
+
+ inline virtual InstanceOfData * rawVariable(avm_offset_t offset) const
+ {
+ return( mParameters.rawAt(offset) );
+ }
+
+ inline void resetOffset() const
+ {
+ TableOfInstanceOfData::const_raw_iterator itParam = mParameters.begin();
+ TableOfInstanceOfData::const_raw_iterator endParam = mParameters.end();
+ avm_offset_t offset = 0;
+ for( ; itParam != endParam ; ++offset , ++itParam )
+ {
+ (itParam)->setOffset( offset );
+ }
+ }
+
+
+ /**
+ * RUNTIME UPDATE
+ */
+ void update(const BF & paramExpr);
+
+
+ /**
+ * Serialization
+ */
+ inline virtual void toStream(OutStream & os) const
+ {
+ toStream(NULL, os);
+ }
+
+ virtual void toStream(const ExecutionData * anED, OutStream & os) const;
+
+ virtual void toStreamData(const ExecutionData * anED, OutStream & os) const;
+
+ virtual void toFscnData(OutStream & os,
+ const ExecutionData * anED, const RuntimeForm * aPreviousRF) const;
+
+};
+
+
+}
+
+#endif /*RUNTIMEFORM_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/RuntimeID.cpp b/org.eclipse.efm.symbex/src/fml/runtime/RuntimeID.cpp
new file mode 100644
index 0000000..cd64bfb
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/RuntimeID.cpp
@@ -0,0 +1,550 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "RuntimeID.h"
+
+#include <common/NamedElement.h>
+
+#include <fml/common/SpecifierElement.h>
+
+#include <fml/executable/BaseCompiledForm.h>
+#include <fml/executable/BaseInstanceForm.h>
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/InstanceOfMachine.h>
+
+
+namespace sep
+{
+
+
+/**
+ * DEFAULT NULL
+ */
+RuntimeID RuntimeID::REF_NULL;
+
+/**
+ * GETTER - SETTER
+ * mFullyQualifiedNameID
+ */
+std::string RuntimeID::getFullyQualifiedNameID() const
+{
+ return( BaseCompiledForm::USE_ONLY_ID
+ ? rid_pointer()->getNameID()
+ : rid_pointer()->getFullyQualifiedNameID() );
+}
+
+void _RuntimeID_::updateFullyQualifiedNameID()
+{
+ if( (mParent != NULL) && (mInstance != NULL) )
+ {
+ mNameID = mInstance->getNameID();
+
+ mFullyQualifiedNameID = ( OSS()
+ << mParent->getFullyQualifiedNameID()
+ << '.' << mNameID );
+
+ mQualifiedNameID = ( OSS() << "run::pid#" << mRid << ':'
+ << NamedElement::location(mFullyQualifiedNameID) );
+ }
+ else if( mInstance != NULL )
+ {
+ mNameID = mInstance->getNameID();
+
+ std::string aQualifiedNameID = NamedElement::location(
+ mInstance->getFullyQualifiedNameID() );
+
+ mFullyQualifiedNameID = "run::" + aQualifiedNameID;
+
+ mQualifiedNameID =
+ ( OSS() << "run::pid#" << mRid << ':' << aQualifiedNameID );
+ }
+ else
+ {
+ mNameID = ( OSS() << "pid#" << mRid );
+
+ mFullyQualifiedNameID =
+ mQualifiedNameID = ( OSS() << "run::pid#" << mRid );
+ }
+}
+
+/**
+ * GETTER
+ * Executable
+ */
+ExecutableForm * _RuntimeID_::getExecutable() const
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mInstance )
+ << " Instance in _RID_ < "
+ << "pid#" << mRid << ":" << getNameID() << " > !!!"
+ << SEND_EXIT;
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( mInstance->hasExecutable() )
+ << "Unexpected RID without Executable !!!"
+ << SEND_EXIT;
+
+ return( mInstance->getExecutable() );
+}
+
+
+/**
+ * initialize
+ * finalize
+ */
+void RuntimeID::initialize()
+{
+ // Attention:> Reference circulaire (a la destruction)!!!!
+ rid_pointer()->onRunning = StatementConstructor::newOptiNopCode(
+ OperatorManager::OPERATOR_RUN, *this, AVM_ARG_MACHINE_RID);
+
+ _RuntimeID_ * tmpRID;
+
+ // the first hierarchical composite (contained concurrency spec) container
+ if( getExecutable()->isCompositeComponent() )
+ {
+ rid_pointer()->mCompositeComponent = this->rid_pointer();
+ }
+ else if( (tmpRID = rid_pointer())->mParent != NULL )
+ {
+ tmpRID = tmpRID->mParent;
+ for( ; (tmpRID != NULL) ; tmpRID = tmpRID->mParent )
+ {
+ if( tmpRID->getExecutable()->isCompositeComponent() )
+ {
+ rid_pointer()->mCompositeComponent = tmpRID;
+ break;
+ }
+ }
+
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT(
+ rid_pointer()->mCompositeComponent )
+ << " as First Composite Parent Component of < "
+ << this->strUniqId() << " > !!!"
+ << SEND_EXIT;
+ }
+
+ // the first composite parent of the first composite container
+ if( rid_pointer()->mCompositeComponent != NULL )
+ {
+ rid_pointer()->mCompositeComponentParent =
+ tmpRID = rid_pointer()->mCompositeComponent;
+
+ if( tmpRID->mParent != NULL )
+ {
+ for( tmpRID = tmpRID->mParent ;
+ (tmpRID != NULL) ; tmpRID = tmpRID->mParent )
+ {
+ if( tmpRID->getExecutable()->isCompositeComponent() )
+ {
+ rid_pointer()->mCompositeComponentParent = tmpRID;
+ break;
+ }
+ }
+ }
+ }
+
+
+ // the first (or this) Communicator container of this
+ if( getExecutable()->isCommunicator() )
+ {
+ rid_pointer()->mCommunicator = this->rid_pointer();
+ }
+ else if( (tmpRID = rid_pointer())->mParent != NULL )
+ {
+ for( tmpRID = tmpRID->mParent ;
+ (tmpRID != NULL) ; tmpRID = tmpRID->mParent )
+ {
+ if( tmpRID->getExecutable()->isCommunicator() )
+ {
+ rid_pointer()->mCommunicator = tmpRID;
+ break;
+ }
+ }
+ }
+
+ // the first (or this) Lifeline container of this
+ if( getExecutable()->isLifeline() )
+ {
+ rid_pointer()->mLifeline = this->rid_pointer();
+ }
+ else if( (tmpRID = rid_pointer())->mParent != NULL )
+ {
+ for( tmpRID = tmpRID->mParent ;
+ (tmpRID != NULL) ; tmpRID = tmpRID->mParent )
+ {
+ if( tmpRID->getExecutable()->isLifeline() )
+ {
+ rid_pointer()->mLifeline = tmpRID;
+ break;
+ }
+ }
+
+ if( rid_pointer()->mLifeline == NULL )
+ {
+ rid_pointer()->mLifeline = rid_pointer()->mCommunicator;
+ }
+ }
+
+
+ // the first hierarchical main Component container
+ if( getExecutable()->isMainComponent() )
+ {
+ rid_pointer()->mComponentSelf = this->rid_pointer();
+ }
+ else if( (tmpRID = rid_pointer())->mParent != NULL )
+ {
+ tmpRID = tmpRID->mParent;
+ for( ; (tmpRID != NULL) ; tmpRID = tmpRID->mParent )
+ {
+ if( tmpRID->getExecutable()->isMainComponent() )
+ {
+ rid_pointer()->mComponentSelf = tmpRID;
+ break;
+ }
+ }
+
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT(
+ rid_pointer()->mCompositeComponent )
+ << " as Component Self of < " << this->strUniqId() << " > !!!"
+ << SEND_EXIT;
+ }
+
+ // the main Component container of mComponentSelf
+ if( (rid_pointer()->mComponentSelf != NULL)
+ && ((tmpRID = rid_pointer()->mComponentSelf)->mParent != NULL) )
+ {
+ for( tmpRID = tmpRID->mParent ;
+ (tmpRID != NULL) ; tmpRID = tmpRID->mParent )
+ {
+ if( tmpRID->getExecutable()->isMainComponent() )
+ {
+ rid_pointer()->mComponentParent = tmpRID;
+ break;
+ }
+ }
+ }
+
+ // the first (or this) main Component Communicator container of this
+ if( getExecutable()->isMainComponent() && getExecutable()->hasPort() )
+ {
+ rid_pointer()->mComponentCommunicator = this->rid_pointer();
+ }
+ else if( (tmpRID = rid_pointer())->mParent != NULL )
+ {
+ for( tmpRID = tmpRID->mParent ;
+ (tmpRID != NULL) ; tmpRID = tmpRID->mParent )
+ {
+ if( tmpRID->getExecutable()->isMainComponent() &&
+ tmpRID->getExecutable()->hasPort() )
+ {
+ rid_pointer()->mComponentCommunicator = tmpRID;
+ break;
+ }
+ }
+ }
+}
+
+
+/**
+ * GETTER API
+ * Specifier
+ */
+const Specifier & RuntimeID::getSpecifier() const
+{
+ return( getExecutable()->getSpecifier() );
+}
+
+
+/**
+ * GETTER - SETTER
+ * mInstance
+ * son Executable
+ * ses variables
+ */
+// Model Machine
+const InstanceOfMachine * RuntimeID::getModelInstance() const
+{
+ return( rid_pointer()->mInstance->getInstanceModel() );
+}
+
+bool RuntimeID::hasModelInstance() const
+{
+ return( (rid_pointer()->mInstance != NULL) &&
+ rid_pointer()->mInstance->hasInstanceModel() );
+}
+
+
+// Executable
+ExecutableForm * RuntimeID::getExecutable() const
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( rid_pointer()->mInstance )
+ << " Instance in RID < " << this->strUniqId() << " > !!!"
+ << SEND_EXIT;
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT(
+ rid_pointer()->mInstance->hasExecutable() )
+ << "Unexpected RID without Executable !!!"
+ << SEND_EXIT;
+
+ return( getInstance()->getExecutable() );
+}
+
+bool RuntimeID::hasExecutable() const
+{
+ return( hasInstance() && getInstance()->hasExecutable() );
+}
+
+
+// Variable
+const BF & RuntimeID::getVariable(avm_offset_t offset) const
+{
+ return( getExecutable()->getData().get(offset) );
+}
+
+InstanceOfData * RuntimeID::rawVariable(avm_offset_t offset) const
+{
+ return( getExecutable()->getData().rawAt(offset) );
+}
+
+
+bool RuntimeID::hasVariable() const
+{
+ return( getExecutable()->hasData() );
+}
+
+
+/**
+ * GETTER - SETTER
+ * Instance->mOnCreate
+ */
+const BFCode & RuntimeID::getOnCreate() const
+{
+ return( getInstance()->getOnCreate() );
+}
+
+bool RuntimeID::hasOnCreate() const
+{
+ return( getInstance()->hasOnCreate() );
+}
+
+/**
+ * GETTER - SETTER
+ * Instance->mOnInit
+ */
+const BFCode & RuntimeID::getOnStart() const
+{
+ return( getInstance()->getOnStart() );
+}
+
+bool RuntimeID::hasOnStart() const
+{
+ return( getInstance()->hasOnStart() );
+}
+
+
+/**
+ * GETTER - SETTER
+ * Ancestor
+ */
+bool RuntimeID::hasAsAncestor(const RuntimeID & aRID) const
+{
+ _RuntimeID_ * aPossibleAncestor = aRID.rid_pointer();
+
+ _RuntimeID_ * tmpRID = rid_pointer();
+ for( ; (tmpRID != NULL) ; tmpRID = tmpRID->mParent )
+ {
+ if( (tmpRID == aPossibleAncestor) )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+bool RuntimeID::hasAsAncestor(const InstanceOfMachine * anInstance) const
+{
+ ExecutableForm * aPossibleExecutableAncestor = anInstance->getExecutable();
+
+ _RuntimeID_ * tmpRID = rid_pointer();
+ for( ; (tmpRID != NULL) ; tmpRID = tmpRID->mParent )
+ {
+ if( (tmpRID->mInstance == anInstance)
+ || (anInstance->getSpecifier().hasDesignModel()
+ && (tmpRID->getExecutable() == aPossibleExecutableAncestor) ) )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+RuntimeID RuntimeID::getAncestorContaining(
+ const BaseInstanceForm * anInstance) const
+{
+ BaseAvmProgram * aPossibleExecutableAncestor = anInstance->getContainer();
+
+ _RuntimeID_ * tmpRID = rid_pointer();
+ for( ; (tmpRID != NULL) ; tmpRID = tmpRID->mParent )
+ {
+ if( tmpRID->getExecutable() == aPossibleExecutableAncestor )
+ {
+ return( smartPointerOf( tmpRID ) );
+ }
+ }
+
+ return( RuntimeID::REF_NULL );
+}
+
+
+/**
+ * GETTER - SETTER
+ * the Lifeline Ancestor container
+ */
+RuntimeID RuntimeID::getLifeline(InstanceOfMachine * aMachine) const
+{
+ _RuntimeID_ * tmpRID = rid_pointer();
+ for( ; (tmpRID != NULL) ; tmpRID = tmpRID->mParent )
+ {
+ if( tmpRID->getExecutable() == aMachine->getContainer() )
+ {
+ return( smartPointerOf( tmpRID->mLifeline ) );
+ }
+ }
+
+ return( RuntimeID::REF_NULL );
+}
+
+
+RuntimeID RuntimeID::getLifeline(InstanceOfPort * aPort) const
+{
+ if( aPort->hasAliasTarget() )
+ {
+ aPort = aPort->getAliasTarget()->as< InstanceOfPort >();
+ }
+
+ _RuntimeID_ * tmpRID = rid_pointer();
+ for( ; (tmpRID != NULL) ; tmpRID = tmpRID->mParent )
+ {
+ if( (tmpRID->getExecutable() == aPort->getContainer())
+ || tmpRID->getExecutable()->getPort().contains(aPort) )
+ {
+ return( smartPointerOf( tmpRID->mLifeline ) );
+ }
+ }
+
+ return( RuntimeID::REF_NULL );
+}
+
+
+/**
+ * GETTER - SETTER
+ * the Communicator Ancestor container
+ */
+RuntimeID RuntimeID::getCommunicator(InstanceOfMachine * aMachine) const
+{
+ _RuntimeID_ * tmpRID = rid_pointer();
+ for( ; (tmpRID != NULL) ; tmpRID = tmpRID->mParent )
+ {
+ if( tmpRID->getExecutable() == aMachine->getContainer() )
+ {
+ return( smartPointerOf( tmpRID->mCommunicator ) );
+ }
+ }
+
+ return( RuntimeID::REF_NULL );
+}
+
+
+RuntimeID RuntimeID::getCommunicator(InstanceOfPort * aPort) const
+{
+ if( aPort->hasAliasTarget() )
+ {
+ aPort = aPort->getAliasTarget()->as< InstanceOfPort >();
+ }
+
+ _RuntimeID_ * tmpRID = rid_pointer();
+ for( ; (tmpRID != NULL) ; tmpRID = tmpRID->mParent )
+ {
+ if( (tmpRID->getExecutable() == aPort->getContainer())
+ || tmpRID->getExecutable()->isCommunicatorWith(aPort) )
+ {
+ return( smartPointerOf( tmpRID->mCommunicator ) );
+ }
+ }
+
+ return( RuntimeID::REF_NULL );
+}
+
+
+
+/**
+ * Serialization
+ */
+void _RuntimeID_::toStream(OutStream & os) const
+{
+ if( os.preferablyFQN() )
+ {
+ os << TAB << mQualifiedNameID;
+
+ return;
+ }
+
+//
+// os << TAB << "rid " << getFullyQualifiedNameID() << " {" << EOL;
+//
+// os << TAB2 << "rid = " << getRid() << ";" << EOL;
+// os << TAB2 << "prid = " << getPRid() << ";" << EOL;
+// os << TAB2 << "offset = " << getOffset() << ";" << EOL;
+// os << TAB2 << "instance = "
+// << getInstance()->getFullyQualifiedNameID() << ";" << EOL;
+//
+// os << TAB << "}" << EOL;
+
+ os << TAB << "rid< offset:" << mOffset
+ << ( mDynamicLoaded ? " , dyna:true" : "" ) << " > "
+// << "@" << avm_address_t( this ) << " "
+ << getFullyQualifiedNameID() << " {" << EOL_TAB2;
+
+ os << "this = " << std::setw(3) << mRid << ";";
+ os << " this#parent = " << std::setw(3) << mRidOf( mParent ) << ";";
+ os << " this#lifeline = " << mRidOf( mLifeline ) << ";";
+ os << " cthis#com = " << mRidOf( mCommunicator ) << ";";
+
+ os << EOL_TAB2;
+
+ os << "self = " << std::setw(3) << mRidOf( mComponentSelf ) << ";";
+ os << " self#parent = " << std::setw(3)
+ << mRidOf( mComponentParent ) << ";";
+ os << " cself#com = " << mRidOf( mComponentCommunicator ) << ";";
+
+ os << EOL_TAB2;
+
+ os << "this#composite = " << mRidOf( mCompositeComponent ) << ";";
+ os << " this#composite#parent = "
+ << mRidOf( mCompositeComponentParent ) << ";";
+
+ os << EOL;
+
+// os << TAB2 << "fqn = " << mFullyQualifiedNameID << ";" << EOL;
+
+ os << TAB2 << "instance = "
+ << mInstance->getFullyQualifiedNameID() << ";" << EOL;
+
+ if( onRunning.valid() )
+ {
+ os << TAB2 << "@running{ " << onRunning.str() << " }" << EOL;
+ }
+
+ os << TAB << "}" << EOL_FLUSH;
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/RuntimeID.h b/org.eclipse.efm.symbex/src/fml/runtime/RuntimeID.h
new file mode 100644
index 0000000..a746f8a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/RuntimeID.h
@@ -0,0 +1,1001 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef RUNTIMEFORMID_H_
+#define RUNTIMEFORMID_H_
+
+#include <common/AvmPointer.h>
+#include <common/NamedElement.h>
+#include <common/BF.h>
+
+#include <collection/Vector.h>
+
+#include <fml/expression/AvmCode.h>
+
+
+namespace sep
+{
+
+class BaseInstanceForm;
+
+class ExecutableForm;
+
+class InstanceOfData;
+class InstanceOfPort;
+class InstanceOfMachine;
+
+class Specifier;
+
+class RuntimeID;
+
+
+class _RuntimeID_ :
+ public NamedElement,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( _RuntimeID_ )
+{
+ friend RuntimeID;
+
+ AVM_DECLARE_CLONABLE_CLASS( _RuntimeID_ )
+
+public:
+ /**
+ * ATTRIBUTES
+ */
+ std::string mQualifiedNameID;
+
+ bool mDynamicLoaded;
+
+ _RuntimeID_ * mModel;
+
+ _RuntimeID_ * mParent;
+
+ _RuntimeID_ * mCompositeComponent;
+ _RuntimeID_ * mCompositeComponentParent;
+
+ _RuntimeID_ * mLifeline;
+ _RuntimeID_ * mCommunicator;
+
+ _RuntimeID_ * mComponentSelf;
+ _RuntimeID_ * mComponentParent;
+ _RuntimeID_ * mComponentCommunicator;
+
+ int mRid;
+
+ avm_offset_t mOffset;
+
+ InstanceOfMachine * mInstance;
+
+ BFCode onRunning;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ _RuntimeID_(_RuntimeID_ * aModel, _RuntimeID_ * aParent,
+ int aPid, avm_offset_t anOffset, InstanceOfMachine * anInstance)
+ : NamedElement( CLASS_KIND_T( RuntimeID ) ),
+ mQualifiedNameID( ),
+
+ mDynamicLoaded( false ),
+
+ mModel( aModel ),
+
+ mParent( aParent ),
+
+ mCompositeComponent( ),
+ mCompositeComponentParent( ),
+
+ mLifeline( ),
+ mCommunicator( ),
+
+ mComponentSelf( ),
+ mComponentParent( ),
+ mComponentCommunicator( ),
+
+ mRid( aPid ),
+ mOffset( anOffset ),
+ mInstance( anInstance ),
+
+ onRunning( )
+ {
+ updateFullyQualifiedNameID();
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ _RuntimeID_(const _RuntimeID_ & aRID)
+ : NamedElement( aRID ),
+ mQualifiedNameID( aRID.mQualifiedNameID ),
+
+ mDynamicLoaded( aRID.mDynamicLoaded ),
+
+ mModel( aRID.mModel ),
+
+ mParent( aRID.mParent ),
+
+ mCompositeComponent( aRID.mCompositeComponent ),
+ mCompositeComponentParent( aRID.mCompositeComponentParent ),
+
+ mLifeline( aRID.mLifeline ),
+ mCommunicator( aRID.mCommunicator ),
+
+ mComponentSelf( aRID.mComponentSelf ),
+ mComponentParent( aRID.mComponentParent ),
+ mComponentCommunicator( aRID.mComponentCommunicator ),
+
+ mRid( aRID.mRid ),
+ mOffset( aRID.mOffset ),
+ mInstance( aRID.mInstance ),
+
+ onRunning( aRID.onRunning )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~_RuntimeID_()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mFullyQualifiedNameID
+ */
+ void updateFullyQualifiedNameID();
+
+ /**
+ * GETTER - SETTER
+ * mFullyQualifiedNameID
+ */
+ inline std::string getQualifiedNameID() const
+ {
+ return( mQualifiedNameID );
+ }
+
+ inline void setQualifiedNameID(const std::string & anUfid)
+ {
+ mQualifiedNameID = anUfid;
+ }
+
+ /**
+ * GETTER - SETTER
+ * mNameID
+ */
+ inline virtual const std::string & getNameID() const
+ {
+ if( mNameID.empty() )
+ {
+ return( NamedElement::UNNAMED_ID );
+ }
+ return( mNameID );
+ }
+
+ /**
+ * GETTER
+ * Executable
+ */
+ ExecutableForm * getExecutable() const;
+
+ /**
+ * mRID of shortcut
+ */
+ inline static int mRidOf(_RuntimeID_ * anElement)
+ {
+ return( ( anElement != NULL ) ? anElement->mRid : -1 );
+ }
+
+ /**
+ * Serialization
+ */
+ inline virtual std::string str() const
+ {
+ return( mQualifiedNameID );
+ }
+
+ inline virtual std::string strHeader() const
+ {
+ return( mQualifiedNameID );
+ }
+
+ inline virtual void strHeader(OutStream & os) const
+ {
+ os << mQualifiedNameID;
+ }
+
+ virtual void toStream(OutStream & os) const;
+
+};
+
+
+class RuntimeID :
+ public BF,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( RuntimeID )
+{
+
+private:
+ /**
+ * TYPEDEF
+ */
+ typedef BF base_this_type;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ RuntimeID()
+ : BF( )
+ {
+ //!! NOTHING
+ }
+
+ RuntimeID(_RuntimeID_ * anElement)
+ : BF( anElement )
+ {
+ //!! NOTHING
+ }
+
+ RuntimeID(const RuntimeID & aModel, const RuntimeID & aParent,
+ int aPid, avm_offset_t anOffset, InstanceOfMachine * anInstance)
+ : BF( new _RuntimeID_(aModel.rid_pointer(),
+ aParent.rid_pointer(), aPid, anOffset, anInstance) )
+ {
+ initialize();
+ }
+
+ RuntimeID(const RuntimeID & aParent, int aPid,
+ avm_offset_t anOffset, InstanceOfMachine * anInstance)
+ : BF( new _RuntimeID_(NULL,
+ aParent.rid_pointer(), aPid, anOffset, anInstance) )
+ {
+ initialize();
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ RuntimeID(const RuntimeID & aRID)
+ : BF( aRID )
+ {
+ //!! NOTHING
+ }
+
+ explicit RuntimeID(const BF & other)
+ : BF( ( other.is< RuntimeID >() ) ? other : RuntimeID::REF_NULL )
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( other.invalid() || other.is< AvmCode >() )
+ << "Invalid Constructor Cast of a BF to a RuntimeID !!!"
+ << SEND_EXIT;
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * other
+ */
+ void create(int aPid, avm_offset_t anOffset, InstanceOfMachine * anInstance)
+ {
+ release( new _RuntimeID_(NULL, NULL, aPid, anOffset, anInstance) );
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~RuntimeID()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * initialize
+ * finalize
+ */
+ void initialize();
+
+ inline void finalize()
+ {
+ // Attention:> Necessaire pour briser des references circulaires !!!!
+ rid_pointer()->onRunning.destroy();
+ }
+
+
+ /**
+ * GETTER API
+ * Specifier
+ */
+ const Specifier & getSpecifier() const;
+
+
+ /**
+ * CAST
+ */
+ inline _RuntimeID_ * rid_pointer() const
+ {
+ return( static_cast< _RuntimeID_ * >( base_this_type::mPTR ) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mNameID
+ */
+ inline bool isDynamicLoaded() const
+ {
+ return( rid_pointer()->mDynamicLoaded );
+ }
+
+ inline void setDynamicLoaded(bool isDynamic = true)
+ {
+ rid_pointer()->mDynamicLoaded = isDynamic;
+ }
+
+ inline bool isStaticLoaded() const
+ {
+ return( not rid_pointer()->mDynamicLoaded );
+ }
+
+ /**
+ * ASSIGNMENT
+ */
+ inline RuntimeID & operator=(const BF & other)
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT(
+ other.invalid() || other.is< RuntimeID >() )
+ << "Invalid Assignment Cast of a BF to a RuntimeID !!!"
+ << SEND_EXIT;
+
+ if( base_this_type::mPTR != other.raw_pointer() )
+ {
+ release_acquire( other.raw_pointer() );
+ }
+ return( *this );
+ }
+
+
+ /**
+ * COMPARISON
+ * OPERATOR
+ */
+ inline int compare(const RuntimeID & other) const
+ {
+ return( (base_this_type::mPTR == other.base_this_type::mPTR ) ? 0 :
+ rid_pointer()->getFullyQualifiedNameID().compare(
+ other.rid_pointer()->getFullyQualifiedNameID()) );
+ }
+
+ inline bool operator==(const RuntimeID & other) const
+ {
+ return( base_this_type::mPTR == other.base_this_type::mPTR );
+ }
+
+ inline bool operator==(const BF & other) const
+ {
+ return( base_this_type::mPTR == other.raw_pointer() );
+ }
+
+
+ inline bool operator!=(const RuntimeID & other) const
+ {
+ return( base_this_type::mPTR != other.base_this_type::mPTR );
+ }
+
+ inline bool operator!=(const BF & other) const
+ {
+ return( base_this_type::mPTR != other.raw_pointer() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mFullyQualifiedNameID
+ */
+ std::string getFullyQualifiedNameID() const;
+
+ /**
+ * GETTER - SETTER
+ * mQualifiedNameID
+ */
+ inline std::string getQualifiedNameID() const
+ {
+ return( rid_pointer()->mQualifiedNameID );
+ }
+
+ inline void setQualifiedNameID(const std::string & anUfid)
+ {
+ rid_pointer()->mQualifiedNameID = anUfid;
+ }
+
+ /**
+ * GETTER - SETTER
+ * mNameID
+ */
+ inline std::string getNameID() const
+ {
+ return( rid_pointer()->getNameID() );
+ }
+
+ inline void setNameID(const std::string & aNameID)
+ {
+ rid_pointer()->setNameID( aNameID );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mPid
+ */
+ inline int getRid() const
+ {
+ return( rid_pointer()->mRid );
+ }
+
+ inline std::string strPid() const
+ {
+ return( OSS() << "pid#" << getRid() );
+ }
+
+ inline std::string strUniqId() const
+ {
+ return( OSS() << "pid#" << getRid() << ":" << getNameID() );
+ }
+
+
+ /**
+ * Util for shortcut
+ */
+ inline static RuntimeID smartPointerOf(_RuntimeID_ * anElement)
+ {
+ if( anElement != NULL )
+ {
+ anElement->incrRefCount();
+ }
+
+ return( RuntimeID( anElement ) );
+ }
+
+ inline static int mRidOf(_RuntimeID_ * anElement)
+ {
+ return( ( anElement != NULL ) ? anElement->mRid : -1 );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mParent
+ */
+ inline RuntimeID getPRID() const
+ {
+ return( smartPointerOf( rid_pointer()->mParent ) );
+ }
+
+ inline bool hasPRID() const
+ {
+ return( rid_pointer()->mParent!= NULL );
+ }
+
+ inline int getPRid() const
+ {
+ return( mRidOf( rid_pointer()->mParent ) );
+ }
+
+ inline int getPOffset() const
+ {
+ return( ( rid_pointer()->mParent != NULL ) ?
+ rid_pointer()->mParent->mOffset : 0 );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mOffset
+ */
+ inline avm_offset_t getOffset() const
+ {
+ return( rid_pointer()->mOffset );
+ }
+
+ inline void setOffset(avm_offset_t anOffset)
+ {
+ rid_pointer()->mOffset = anOffset;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mInstance
+ * son Executable
+ * ses variables
+ */
+
+ inline InstanceOfMachine * getInstance() const
+ {
+ return( rid_pointer()->mInstance );
+ }
+
+ inline bool hasInstance() const
+ {
+ return( rid_pointer()->mInstance != NULL );
+ }
+
+
+ const InstanceOfMachine * getModelInstance() const;
+
+ bool hasModelInstance() const;
+
+
+ ExecutableForm * getExecutable() const;
+
+ bool hasExecutable() const;
+
+
+ const BF & getVariable(avm_offset_t offset) const;
+
+ InstanceOfData * rawVariable(avm_offset_t offset) const;
+
+ bool hasVariable() const;
+
+
+ /**
+ * GETTER - SETTER
+ * Instance->mOnCreate
+ */
+ const BFCode & getOnCreate() const;
+
+ bool hasOnCreate() const;
+
+ /**
+ * GETTER - SETTER
+ * Instance->mOnStart
+ */
+ const BFCode & getOnStart() const;
+
+ bool hasOnStart() const;
+
+
+ /**
+ * GETTER - SETTER
+ * mRunning
+ */
+ inline const BFCode & getOnRunning() const
+ {
+ return( rid_pointer()->onRunning );
+ }
+
+ inline bool hasOnRunning() const
+ {
+ return( rid_pointer()->onRunning.valid() );
+ }
+
+ inline void setOnRunning(const BFCode & aProgram)
+ {
+ rid_pointer()->onRunning = aProgram;
+ }
+
+
+ inline RuntimeID getModel() const
+ {
+ return( smartPointerOf( rid_pointer()->mModel ) );
+ }
+
+ inline int getModelRid() const
+ {
+ return( mRidOf( rid_pointer()->mModel ) );
+ }
+
+ inline bool hasModel() const
+ {
+ return( rid_pointer()->mModel != NULL );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mParent
+ */
+ inline RuntimeID getParent() const
+ {
+ return( smartPointerOf( rid_pointer()->mParent ) );
+ }
+
+ inline int getParentRid() const
+ {
+ return( mRidOf( rid_pointer()->mParent ) );
+ }
+
+ inline bool hasParent() const
+ {
+ return( rid_pointer()->mParent != NULL );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * Ancestor
+ */
+ inline bool isAncestorOf(const RuntimeID & aRID) const
+ {
+ return( aRID.valid() && aRID.hasAsAncestor( *this ) );
+ }
+
+ bool hasAsAncestor(const RuntimeID & aRID) const;
+
+ bool hasAsAncestor(const InstanceOfMachine * anInstance) const;
+
+ RuntimeID getAncestorContaining(const BaseInstanceForm * anInstance) const;
+
+
+ /**
+ * GETTER - SETTER
+ * mCompositeComponent
+ */
+ inline RuntimeID getCompositeComponent() const
+ {
+ if( rid_pointer()->mCompositeComponent != NULL )
+ {
+ rid_pointer()->mCompositeComponent->incrRefCount();
+ }
+
+ return( RuntimeID( rid_pointer()->mCompositeComponent) );
+ }
+
+ inline int getCompositeComponentRid() const
+ {
+ return( ( hasCompositeComponent() ) ?
+ rid_pointer()->mCompositeComponent->mRid : -1 );
+ }
+
+ inline bool hasCompositeComponent() const
+ {
+ return( rid_pointer()->mCompositeComponent != NULL );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mCompositeComponentParent
+ */
+ inline RuntimeID getCompositeComponentParent() const
+ {
+ if( rid_pointer()->mCompositeComponentParent != NULL )
+ {
+ rid_pointer()->mCompositeComponentParent->incrRefCount();
+ }
+
+ return( RuntimeID(
+ rid_pointer()->mCompositeComponentParent ) );
+ }
+
+ inline int getCompositeComponentParentRid() const
+ {
+ return( mRidOf( rid_pointer()->mCompositeComponentParent ) );
+ }
+
+ inline bool hasCompositeComponentParent() const
+ {
+ return( rid_pointer()->mCompositeComponentParent != NULL );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * the Lifeline Ancestor container
+ */
+ RuntimeID getLifeline(InstanceOfMachine * aMachine) const;
+
+ RuntimeID getLifeline(InstanceOfPort * aPort) const;
+
+ inline RuntimeID getLifeline() const
+ {
+ return( smartPointerOf( rid_pointer()->mLifeline ) );
+ }
+
+ inline int getLifelineRid() const
+ {
+ return( mRidOf( rid_pointer()->mLifeline ) );
+ }
+
+ inline bool hasLifeline() const
+ {
+ return( rid_pointer()->mLifeline != NULL );
+ }
+
+
+
+ /**
+ * GETTER - SETTER
+ * the Communicator Ancestor container
+ */
+ RuntimeID getCommunicator(InstanceOfMachine * aMachine) const;
+
+ RuntimeID getCommunicator(InstanceOfPort * aPort) const;
+
+ inline RuntimeID getCommunicator() const
+ {
+ return( smartPointerOf( rid_pointer()->mCommunicator ) );
+ }
+
+ inline int getCommunicatorRid() const
+ {
+ return( mRidOf( rid_pointer()->mCommunicator ) );
+ }
+
+ inline bool hasCommunicator() const
+ {
+ return( rid_pointer()->mCommunicator != NULL );
+ }
+
+
+
+ /**
+ * GETTER - SETTER
+ * the first hierarchical main Component container
+ */
+ inline RuntimeID getComponentSelf() const
+ {
+ return( smartPointerOf( rid_pointer()->mComponentSelf ) );
+ }
+
+ inline int getComponentSelfRid() const
+ {
+ return( mRidOf( rid_pointer()->mComponentSelf ) );
+ }
+
+ inline bool hasComponentSelf() const
+ {
+ return( rid_pointer()->mComponentSelf != NULL );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * the first hierarchical main Component container
+ */
+ inline RuntimeID getComponentParent() const
+ {
+ return( smartPointerOf( rid_pointer()->mComponentParent ) );
+ }
+
+ inline int getComponentParentRid() const
+ {
+ return( mRidOf( rid_pointer()->mComponentParent ) );
+ }
+
+ inline bool hasComponentParent() const
+ {
+ return( rid_pointer()->mComponentParent != NULL );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * the first hierarchical main Component container
+ */
+ inline RuntimeID getComponentCommunicator() const
+ {
+ if( rid_pointer()->mComponentCommunicator != NULL )
+ {
+ rid_pointer()->mComponentCommunicator->incrRefCount();
+ }
+
+ return( RuntimeID( rid_pointer()->mComponentCommunicator) );
+ }
+
+ inline int getComponentCommunicatorRid() const
+ {
+ return( mRidOf( rid_pointer()->mComponentCommunicator ) );
+ }
+
+ inline bool hasComponentCommunicator() const
+ {
+ return( rid_pointer()->mComponentCommunicator != NULL );
+ }
+
+
+ /**
+ * DEFAULT NULL
+ */
+ static RuntimeID REF_NULL;
+
+
+ /**
+ * Serialization
+ */
+ inline virtual std::string toString(
+ const AvmIndent & indent = AVM_TAB_INDENT) const
+ {
+ StringOutStream oss(indent);
+
+ toStream(oss);
+
+ return( oss.str() );
+ }
+
+ inline virtual std::string str() const
+ {
+ return( ( base_this_type::mPTR == NULL ) ?
+ "RuntimeID<null>" : rid_pointer()->str() );
+ }
+
+
+ inline virtual void AVM_DEBUG_REF_COUNTER(OutStream & os) const
+ {
+ if( base_this_type::mPTR != NULL )
+ {
+ base_this_type::mPTR->AVM_DEBUG_REF_COUNTER(os);
+ }
+ else
+ {
+ os << "RuntimeID<null, ref:0>" << std::flush;
+ }
+ }
+
+ inline virtual std::string AVM_DEBUG_REF_COUNTER() const
+ {
+ return( ( base_this_type::mPTR != NULL )
+ ? base_this_type::mPTR->AVM_DEBUG_REF_COUNTER()
+ : "RuntimeID<null, ref:0>" );
+ }
+
+ inline virtual std::string strHeader() const
+ {
+ return( ( base_this_type::mPTR == NULL ) ?
+ "RuntimeID<null>" : rid_pointer()->strHeader() );
+ }
+
+ inline virtual void strHeader(OutStream & os) const
+ {
+ if( base_this_type::mPTR != NULL )
+ {
+ rid_pointer()->strHeader(os);
+ }
+ else
+ {
+ os << "RuntimeID<null>" << std::flush;
+ }
+ }
+
+
+ inline virtual void toStream(OutStream & os) const
+ {
+ if( base_this_type::mPTR != NULL )
+ {
+ rid_pointer()->toStream(os);
+ }
+ else
+ {
+ os << "RuntimeID<null>" << std::flush;
+ }
+ }
+
+ /*
+ * !UNUSED!
+ inline static void toStream(OutStream & os,
+ const Vector< RuntimeID > & aTable,
+ const std::string & aSectionName = "child")
+ {
+ os << TAB << aSectionName;
+
+AVM_IF_DEBUG_LEVEL_GTE_MEDIUM
+
+ os << EOL_INCR_INDENT;
+ Vector< RuntimeID >::const_iterator it = aTable.begin();
+ Vector< RuntimeID >::const_iterator itEnd = aTable.end();
+ for( ; it != itEnd ; ++it )
+ {
+ AVM_IF_DEBUG_LEVEL_GTE_HIGH
+
+ (*it).toStream(os);
+
+ AVM_DEBUG_ELSE
+
+ os << TAB << (*it).getFullyQualifiedNameID() << EOL;
+
+ AVM_ENDIF_DEBUG_LEVEL_GTE_HIGH
+ }
+ os << DECR_INDENT;
+
+AVM_ELSEIF_DEBUG_LEVEL_GTE_LOW
+
+ os << " = [| ";
+ Vector< RuntimeID >::const_iterator it = aTable.begin();
+ Vector< RuntimeID >::const_iterator itEnd = aTable.end();
+ for( ; it != itEnd ; ++it )
+ {
+ os << (*it).getOffset() << " ";
+ }
+ os << "|];" << EOL;
+
+AVM_ENDIF_DEBUG_LEVEL_GTE_LOW
+
+ os << std::flush;
+ }
+ * !UNUSED!
+ */
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// TYPE DEFINITION for SMART POINTER and CONTAINER
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class TableOfRuntimeID : public AvmObject ,
+ public Vector< RuntimeID >,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( TableOfRuntimeID )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( TableOfRuntimeID )
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TableOfRuntimeID()
+ : AvmObject( ),
+ Vector< RuntimeID >()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ TableOfRuntimeID(const TableOfRuntimeID & aTable)
+ : AvmObject( aTable ),
+ Vector< RuntimeID >( aTable )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~TableOfRuntimeID()
+ {
+ //!! NOTHING
+ }
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// TYPE DEFINITION for SMART POINTER and CONTAINER
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+AVM_DEFINE_AP_CLASS( TableOfRuntimeID )
+
+
+
+}
+
+#endif /*RUNTIMEFORMID_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/RuntimeLib.cpp b/org.eclipse.efm.symbex/src/fml/runtime/RuntimeLib.cpp
new file mode 100644
index 0000000..f1f19b7
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/RuntimeLib.cpp
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 13 juil. 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "RuntimeLib.h"
+
+
+#include <fml/executable/ExecutableLib.h>
+
+#include <fml/runtime/RuntimeForm.h>
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+
+/**
+ * PRE DEFINED RUNTIME MACHINE
+ */
+RuntimeID RuntimeLib::RID_NIL;
+
+RuntimeID RuntimeLib::RID_ENVIRONMENT;
+
+
+/**
+ * LOADER
+ */
+void RuntimeLib::load()
+{
+ RID_NIL.create(-1, 0, ExecutableLib::MACHINE_NULL.rawMachine());
+ RID_NIL.setQualifiedNameID("null#machine" /*"null< machine >"*/);
+
+ ExecutableLib::MACHINE_NULL.setRuntimeRID( RID_NIL );
+
+ RID_ENVIRONMENT.create(-2, 0,
+ ExecutableLib::MACHINE_ENVIRONMENT.rawMachine());
+ RID_ENVIRONMENT.setQualifiedNameID("env");
+}
+
+
+/**
+ * DISPOSER
+ */
+void RuntimeLib::dispose()
+{
+ RID_NIL.destroy();
+
+ RID_ENVIRONMENT.destroy();
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/RuntimeLib.h b/org.eclipse.efm.symbex/src/fml/runtime/RuntimeLib.h
new file mode 100644
index 0000000..718cc9c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/RuntimeLib.h
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 13 juil. 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef RUNTIMELIB_H_
+#define RUNTIMELIB_H_
+
+#include <fml/runtime/RuntimeForm.h>
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+
+class RuntimeLib
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ RuntimeLib()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~RuntimeLib()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * LOADER - DISPOSER
+ */
+ static void load();
+ static void dispose();
+
+
+
+ /**
+ * PRE DEFINED RUNTIME MACHINE
+ */
+
+ static RuntimeID RID_NIL;
+
+ static RuntimeID RID_ENVIRONMENT;
+
+};
+
+
+}
+
+#endif /* RUNTIMELIB_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/RuntimeQuery.cpp b/org.eclipse.efm.symbex/src/fml/runtime/RuntimeQuery.cpp
new file mode 100644
index 0000000..c17b956
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/RuntimeQuery.cpp
@@ -0,0 +1,855 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 19 mars 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "RuntimeQuery.h"
+
+#include <fml/executable/ExecutableQuery.h>
+
+#include <fml/workflow/UniFormIdentifier.h>
+#include <fml/workflow/WObject.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// STATIC TOOLS
+// Used during configuration step
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * SEARCH
+ * Symbol
+ * !UNUSED!
+ *
+const BF & RuntimeQuery::searchSymbol(WObject * aWProperty)
+{
+ const std::string & kind = aWProperty->getNameID();
+ const std::string & qnid = aWProperty->toStringValue();
+
+ ExecutableQuery XQuery( mConfiguration );
+
+ if( (kind == "variable") || (kind == "var") )
+ {
+ const BF & aSymbol = XQuery.getDataByQualifiedNameID( qnid );
+ if( aSymbol.valid() )
+ {
+ return( aSymbol );
+ }
+ }
+
+ else if( (kind == "model") || (kind == "form") )
+ {
+ const BF & aSymbol = XQuery.searchMachine(
+ Specifier::DESIGN_MODEL_KIND, qnid);
+ if( aSymbol.valid() )
+ {
+ return( aSymbol );
+ }
+ }
+
+ else if( kind == "instance" )
+ {
+ const BF & aSymbol = XQuery.searchMachine(
+ Specifier::DESIGN_INSTANCE_KIND, qnid );
+ if( aSymbol.valid() )
+ {
+ return( aSymbol );
+ }
+ }
+
+ else if( kind == "executable" )
+ {
+ const BF & anExecutable = XQuery.getExecutableByQualifiedNameID( qnid );
+ if( anExecutable.valid() )
+ {
+ return( anExecutable );
+ }
+ }
+
+ else if( kind == "transition" )
+ {
+ const BF & aSymbol = XQuery.getTransitionByQualifiedNameID( qnid );
+ if( aSymbol.valid() )
+ {
+ return( aSymbol );
+ }
+ }
+ else if( kind == "routine" )
+ {
+ const BF & aSymbol = XQuery.getProgramByQualifiedNameID(
+ qnid, Specifier::SCOPE_ROUTINE_KIND );
+ if( aSymbol.valid() )
+ {
+ return( aSymbol );
+ }
+ }
+ else if( kind == "program" )
+ {
+ const BF & aSymbol = XQuery.getProgramByQualifiedNameID(
+ qnid, Specifier::SCOPE_UNDEFINED_KIND );
+// qnid, Specifier::SCOPE_PROGRAM_KIND );
+ if( aSymbol.valid() )
+ {
+ return( aSymbol );
+ }
+ }
+
+ else
+ {
+ AVM_OS_WARN << "Unexpected attribute << " << aWProperty->str()
+ << " >> as coverage processor parameter";
+ }
+
+ return( BF::REF_NULL );
+}
+
+avm_size_t RuntimeQuery::searchSymbol(
+ WObject * aWProperty, BFList & listofSymbol )
+{
+ avm_size_t count = 0;
+
+ const std::string & kind = aWProperty->getNameID();
+ const std::string & qnid = aWProperty->toStringValue();
+
+ ExecutableQuery XQuery( mConfiguration );
+
+ if( (kind == "variable") || (kind == "var") )
+ {
+ count += XQuery.getDataByQualifiedNameID(qnid, listofSymbol);
+ }
+
+ else if( (kind == "model") || (kind == "form") )
+ {
+ //!!Symbol
+// count += searchMachine(aSystem, Specifier::DESIGN_MODEL_KIND,
+// qnid, listofSymbol );
+ }
+
+ else if( kind == "instance" )
+ {
+ //!!Symbol
+// count += searchMachine(aSystem, Specifier::DESIGN_INSTANCE_KIND,
+// qnid, listofSymbol );
+ }
+
+ else if( kind == "executable" )
+ {
+ count += XQuery.getExecutableByQualifiedNameID(qnid, listofSymbol);
+ }
+
+ else if( kind == "transition" )
+ {
+ count += XQuery.getTransitionByQualifiedNameID(qnid, listofSymbol );
+ }
+
+ else if( kind == "routine" )
+ {
+ count += XQuery.getProgramByQualifiedNameID(qnid,
+ Specifier::SCOPE_ROUTINE_KIND, listofSymbol);
+ }
+
+ else if( kind == "program" )
+ {
+ count += XQuery.getProgramByQualifiedNameID(
+ qnid, Specifier::SCOPE_UNDEFINED_KIND, listofSymbol );
+// qnid, Specifier::SCOPE_PROGRAM_KIND , listofSymbol )
+ }
+
+ else
+ {
+ AVM_OS_WARN << "Unexpected attribute << " << aWProperty->str()
+ << " >> as coverage processor parameter";
+ }
+
+ return( count );
+}
+*
+* !UNUSED!
+*/
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// RUNTIME TOOLS
+// Used during execution< processing / filtering > step
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * SEARCH
+ * Variable
+ */
+BF RuntimeQuery::searchVariable(const ExecutionData & anED,
+ const RuntimeID & ctxRID, const std::string & aFullyQualifiedNameID) const
+{
+ if( anED.hasLocalRuntimeStack() )
+ {
+ StackOfLocalRuntime::
+ reverse_iterator it = anED.getLocalRuntimes()->rbegin();
+ StackOfLocalRuntime::
+ reverse_iterator itEnd = anED.getLocalRuntimes()->rend();
+ for( ; it != itEnd ; ++it )
+ {
+ const BF & anInstance = (*it).getProgram()->getAllData().
+ getByFQNameID( aFullyQualifiedNameID );
+ if( anInstance.valid() )
+ {
+ return( anInstance );
+ }
+ }
+ }
+
+
+ UniFormIdentifier anUFI(aFullyQualifiedNameID);
+
+ std::ostringstream osUFI;
+
+ UniFormIdentifier::iterator it = anUFI.begin();
+ UniFormIdentifier::iterator itEnd = anUFI.end();
+
+ // recherche de la machine PRINCIPALE (ROOT)
+ osUFI << "inst::" << (*it).str();
+
+ const RuntimeID & theSystemRID = anED.getSystemRID();
+ RuntimeID theMachineID = theSystemRID;
+
+ for( ++it ; (it != itEnd) ; ++it )
+ {
+ if( theMachineID.getInstance()->fqnEquals( osUFI.str() ) )
+ {
+ break;
+ }
+ osUFI << "." << (*it).str();
+ }
+
+ if( it != itEnd )
+ {
+ VectorOfInstanceOfMachine aliasPath;
+
+ RuntimeID rid = theMachineID;
+
+ // comme c'est la spec RID
+// aliasPath.append( theMachineID.getInstance() );
+
+ // recherche de la machine FEUILLE
+ for( ; it != itEnd ; ++it)
+ {
+ osUFI << "." << (*it).str();
+ rid = anED.getRuntime(rid).getChild( osUFI.str() );
+ if( rid.valid() )
+ {
+ theMachineID = rid;
+ aliasPath.append( theMachineID.getInstance() );
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ if( (it == itEnd) && (theMachineID == theSystemRID) )
+ {
+ --it;
+ }
+
+ if( it != itEnd )
+ {
+ ExecutableForm * anExecutable = theMachineID.getExecutable();
+ osUFI.str( "" );
+ osUFI << "inst::" // "exec::".size() == 6
+ << anExecutable->getFullyQualifiedNameID().substr( 6 );
+
+
+ for( ; it != itEnd ; ++it)
+ {
+ osUFI << "." << (*it).str();
+ }
+
+
+ // The ORIGINAL INSTANCE
+ InstanceOfData * anInstance =
+ anExecutable->getAllData().rawByFQNameID( osUFI.str() );
+
+ if( anInstance != NULL )
+ {
+ anInstance = anExecutable->getConstData().rawByFQNameID(
+ osUFI.str() );
+ }
+
+ if( anInstance != NULL )
+ {
+ if( aliasPath.nonempty() )
+ {
+ anInstance = new InstanceOfData(
+ theSystemRID.getExecutable(),
+ anInstance, aliasPath );
+
+ anInstance->setCreatorContainerRID( theMachineID );
+ anInstance->setRuntimeContainerRID( theMachineID );
+
+ return( BF( anInstance ) );
+ }
+
+// AVM_OS_TRACE << TAB << "Searching " << anUFI->str() << std::endl;
+// AVM_OS_TRACE << TAB << "Found " << std::endl;
+// anInstance->serialize(AVM_OS_TRACE << TAB);
+// AVM_OS_TRACE << std::flush;
+ }
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+const BF & RuntimeQuery::searchVariable(const ExecutionData & anED,
+ const RuntimeID & ctxRID, const ObjectElement * astElement) const
+{
+ if( anED.hasLocalRuntimeStack() )
+ {
+ StackOfLocalRuntime::
+ reverse_iterator it = anED.getLocalRuntimes()->rbegin();
+ StackOfLocalRuntime::
+ reverse_iterator itEnd = anED.getLocalRuntimes()->rend();
+ for( ; it != itEnd ; ++it )
+ {
+ const BF & anInstance =
+ (*it).getProgram()->getAllData().getByAstElement(astElement);
+ if( anInstance.valid() )
+ {
+ return( anInstance );
+ }
+ }
+ }
+
+ TableOfRuntimeT::const_iterator itRF = anED.getTableOfRuntime().begin();
+ TableOfRuntimeT::const_iterator endRF = anED.getTableOfRuntime().end();
+ for( ; itRF != endRF ; ++itRF)
+ {
+ const BF & anInstance =
+ (*itRF)->getExecutable()->getAllData().getByAstElement(astElement);
+ if( anInstance.valid() )
+ {
+ return( anInstance );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+
+BF RuntimeQuery::searchVariable(const ExecutionData & anED,
+ const RuntimeID & ctxRID, const BF & aSymbolicParameter) const
+{
+ if( aSymbolicParameter.is< InstanceOfData >() )
+ {
+ InstanceOfData * aParamInstance =
+ aSymbolicParameter.to_ptr< InstanceOfData >();
+
+ RuntimeID aRID = aParamInstance->hasCreatorContainerRID() ?
+ aParamInstance->getCreatorContainerRID() : ctxRID;
+
+ const BF & foundVariable = aRID.getExecutable()->getymbolByAstElement(
+ aParamInstance->getAstElement(), TYPE_UNIVERSAL_SPECIFIER);
+
+ if( foundVariable.valid() )
+ {
+ return( foundVariable );
+ }
+ else
+ {
+ const BF & foundVariable = searchVariable(
+ anED, ctxRID, aParamInstance->getAstElement() );
+
+ if( foundVariable.valid() )
+ {
+ return( foundVariable );
+ }
+ else
+ {
+ const BF & foundVariable = searchVariable(anED, ctxRID,
+ aParamInstance->getAstFullyQualifiedNameID() );
+
+ if( foundVariable.valid() )
+ {
+ return( foundVariable );
+ }
+ }
+ }
+ }
+
+ return( searchVariable(anED, ctxRID, aSymbolicParameter.str()) );
+}
+
+
+/**
+ * SEARCH
+ * Symbol
+ * !UNUSED!
+ *
+BF RuntimeQuery::searchSymbol(TableOfSymbol & aliasTable,
+ const ExecutionData & anED, UniFormIdentifier * anUFI)
+{
+ std::ostringstream osUFI;
+
+ std::string aFullyQualifiedNameID = anUFI->str();
+
+ {
+ const BF & foundInstance =
+ aliasTable.getByFQNameID( aFullyQualifiedNameID );
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+
+ if( anED.hasLocalRuntimeStack() )
+ {
+ StackOfLocalRuntime::
+ reverse_iterator it = anED.getLocalRuntimes()->rbegin();
+ StackOfLocalRuntime::
+ reverse_iterator itEnd = anED.getLocalRuntimes()->rend();
+ for( ; it != itEnd ; ++it )
+ {
+ const BF & anInstance = (*it).getProgram()->getAllData().
+ getByFQNameID( aFullyQualifiedNameID );
+ if( anInstance.valid() )
+ {
+ return( anInstance );
+ }
+ }
+ }
+
+
+ UniFormIdentifier::iterator it = anUFI->begin();
+ UniFormIdentifier::iterator itEnd = anUFI->end();
+
+ // recherche de la machine PRINCIPALE (ROOT)
+ osUFI << "inst::" << (*it).str();
+
+ const RuntimeID & theSystemRID = anED.getSystemRID();
+ RuntimeID theMachineID = theSystemRID;
+
+ for( ++it ; (it != itEnd) ; ++it )
+ {
+ if( theMachineID.getInstance()->fqnEquals( osUFI.str() ) )
+ {
+ break;
+ }
+ osUFI << "." << (*it).str();
+ }
+
+ if( it != itEnd )
+ {
+ VectorOfInstanceOfMachine aliasPath;
+
+ RuntimeID aRID = theMachineID;
+
+ // comme c'est la spec RID
+// aliasPath.append( theMachineID.getInstance() );
+
+ // recherche de la machine FEUILLE
+ for( ; it != itEnd ; ++it)
+ {
+ osUFI << "." << (*it).str();
+ aRID = anED.getRuntime(aRID).getChild( osUFI.str() );
+ if( aRID.valid() )
+ {
+ theMachineID = aRID;
+ aliasPath.append( theMachineID.getInstance() );
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ if( (it == itEnd) && (theMachineID == theSystemRID) )
+ {
+ --it;
+ }
+
+ if( it != itEnd )
+ {
+ ExecutableForm * anExecutable = theMachineID.getExecutable();
+ osUFI.str( "inst::" );
+ osUFI << anExecutable->getFullyQualifiedNameID().substr( 6 );
+ // 6 == "exec::".size()
+
+ for( ; it != itEnd ; ++it)
+ {
+ osUFI << "." << (*it).str();
+ }
+
+
+ // The ORIGINAL INSTANCE
+ BF anInstance = anExecutable->getAllData().
+ getByFQNameID( osUFI.str() );
+
+ if( anInstance.invalid() )
+ {
+ anInstance = anExecutable->getConstData().
+ getByFQNameID( osUFI.str() );
+ }
+ if( anInstance.invalid() )
+ {
+ anInstance = anExecutable->getPort().
+ getByFQNameID( osUFI.str() );
+ }
+ if( anInstance.invalid() )
+ {
+ anInstance = anExecutable->getBuffer().
+ getByFQNameID( osUFI.str() );
+ }
+ if( anInstance.invalid() )
+ {
+ anInstance = anExecutable->getConnect().
+ getByFQNameID( osUFI.str() );
+ }
+
+ if( anInstance.valid() )
+ {
+
+// AVM_OS_TRACE << TAB << "Searching " << anUFI->str() << std::endl
+// << TAB << "Found " << std::endl;
+// anInstance.toStream(AVM_OS_TRACE << TAB);
+// AVM_OS_TRACE << std::flush;
+
+ if( aliasPath.nonempty() )
+ {
+ BaseInstanceForm * newInstance = NULL;
+
+ switch ( anInstance.classKind() )
+ {
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ newInstance = new InstanceOfData(
+ theSystemRID.getExecutable(),
+ anInstance.to_ptr< InstanceOfData >(),
+ aliasPath);
+ newInstance->setCreatorContainerRID( theMachineID );
+ newInstance->setRuntimeContainerRID( theMachineID );
+ aliasTable.save( newInstance );
+
+ break;
+ }
+
+ case FORM_INSTANCE_MACHINE_KIND:
+ {
+ newInstance = new InstanceOfMachine(
+ theSystemRID.getExecutable(),
+ anInstance.to_ptr< InstanceOfMachine >(),
+ aliasPath);
+ newInstance->setCreatorContainerRID( theMachineID );
+ newInstance->setRuntimeContainerRID( theMachineID );
+
+ return( aliasTable.save( newInstance ) );
+ }
+
+ case FORM_INSTANCE_PORT_KIND:
+ {
+ newInstance = new InstanceOfPort(
+ theSystemRID.getExecutable(),
+ anInstance.to_ptr< InstanceOfPort >(),
+ aliasPath);
+ newInstance->setCreatorContainerRID( theMachineID );
+ newInstance->setRuntimeContainerRID( theMachineID );
+
+ return( aliasTable.save( newInstance ) );
+ }
+
+ case FORM_INSTANCE_BUFFER_KIND:
+ {
+ newInstance = new InstanceOfBuffer(
+ theSystemRID.getExecutable(),
+ anInstance.to_ptr< InstanceOfBuffer >(),
+ aliasPath);
+ newInstance->setCreatorContainerRID( theMachineID );
+ newInstance->setRuntimeContainerRID( theMachineID );
+
+ return( aliasTable.save( newInstance ) );
+ }
+
+ case FORM_INSTANCE_CONNECTOR_KIND:
+ {
+ newInstance = new InstanceOfConnect(
+ theSystemRID.getExecutable(),
+ anInstance.to_ptr< InstanceOfConnect >(),
+ aliasPath);
+ newInstance->setCreatorContainerRID( theMachineID );
+ newInstance->setRuntimeContainerRID( theMachineID );
+
+ return( aliasTable.save( newInstance ) );
+ }
+
+ default :
+ {
+ return( BF::REF_NULL );
+ }
+ }
+ }
+ }
+
+ return( anInstance );
+ }
+
+ else if( aliasPath.nonempty() )
+ {
+ return( BF( sep::incrReferenceCount(aliasPath.last()) ) );
+ }
+
+ else
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Unfound leaf machine : << " << osUFI.str()
+ << " >> container of << " << aFullyQualifiedNameID << " >>"
+ << SEND_EXIT;
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+const BF & RuntimeQuery::searchSymbol(TableOfSymbol & aliasTable,
+ const ExecutionData & anED, const ObjectElement * astElement)
+{
+ {
+ const BF & foundInstance = aliasTable.getByAstElement(astElement);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+
+ if( anED.hasLocalRuntimeStack() )
+ {
+ StackOfLocalRuntime::
+ reverse_iterator it = anED.getLocalRuntimes()->rbegin();
+ StackOfLocalRuntime::
+ reverse_iterator itEnd = anED.getLocalRuntimes()->rend();
+ for( ; it != itEnd ; ++it )
+ {
+ const BF & anInstance =
+ (*it).getProgram()->getAllData().getByAstElement(astElement);
+ if( anInstance.valid() )
+ {
+ return( anInstance );
+ }
+ }
+ }
+
+ {
+ ExecutableQuery XQuery( mConfiguration );
+
+ const BF & foundInstance = XQuery.getInstanceByAstElement(astElement);
+
+ return( foundInstance );
+ }
+}
+
+
+const BF & RuntimeQuery::searchSymbol(TableOfSymbol & aliasTable,
+ const ExecutionData & anED, const BF & aBaseInstance)
+{
+ if( aliasTable.contains(aBaseInstance) )
+ {
+ return( aBaseInstance );
+ }
+
+ if( anED.hasLocalRuntimeStack() )
+ {
+ StackOfLocalRuntime::
+ reverse_iterator it = anED.getLocalRuntimes()->rbegin();
+ StackOfLocalRuntime::
+ reverse_iterator itEnd = anED.getLocalRuntimes()->rend();
+ for( ; it != itEnd ; ++it )
+ {
+ if( (*it).getProgram()->containsData( aBaseInstance ) )
+ {
+ return( aBaseInstance );
+ }
+ }
+ }
+
+ const RuntimeID & theSystemRID = anED.getSystemRID();
+
+ VectorOfInstanceOfMachine aliasPath;
+
+ TableOfRuntimeT::const_iterator itRF = anED.getTableOfRuntime().begin();
+ TableOfRuntimeT::const_iterator endRF = anED.getTableOfRuntime().end();
+ for( RuntimeID itRID ; itRF != endRF ; ++itRF)
+ {
+ itRID = (*itRF)->getRID();
+
+ switch ( aBaseInstance.classKind() )
+ {
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ if( itRID.getExecutable()->containsData(
+ aBaseInstance.to_ptr< InstanceOfData >()) )
+ {
+ aliasPath.append( itRID.getInstance() );
+
+ InstanceOfData * newInstance = new InstanceOfData(
+ theSystemRID.getExecutable(),
+ aBaseInstance.to_ptr< InstanceOfData >(), aliasPath );
+ newInstance->setCreatorContainerRID( itRID );
+ newInstance->setRuntimeContainerRID( itRID );
+
+ aliasTable.save( newInstance );
+ }
+
+ break;
+ }
+
+ case FORM_INSTANCE_MACHINE_KIND:
+ {
+ if( itRID.getExecutable()->
+ getInstanceStatic().contains(aBaseInstance) )
+ {
+ aliasPath.append( itRID.getInstance() );
+
+ InstanceOfMachine * newInstance = new InstanceOfMachine(
+ theSystemRID.getExecutable(),
+ aBaseInstance.to_ptr< InstanceOfMachine >(),
+ aliasPath );
+ newInstance->setCreatorContainerRID( itRID );
+ newInstance->setRuntimeContainerRID( itRID );
+
+ aliasTable.save( newInstance );
+ }
+ break;
+ }
+
+ case FORM_INSTANCE_PORT_KIND:
+ {
+ if( itRID.getExecutable()->getPort().contains(aBaseInstance) )
+ {
+ aliasPath.append( itRID.getInstance() );
+
+ InstanceOfPort * newInstance = new InstanceOfPort(
+ theSystemRID.getExecutable(),
+ aBaseInstance.to_ptr< InstanceOfPort >(), aliasPath );
+ newInstance->setCreatorContainerRID( itRID );
+ newInstance->setRuntimeContainerRID( itRID );
+
+ aliasTable.save( newInstance );
+ }
+ break;
+ }
+
+ case FORM_INSTANCE_BUFFER_KIND:
+ {
+ InstanceOfBuffer * bufferInstance =
+ aBaseInstance.to_ptr< InstanceOfBuffer >();
+
+ if( itRID.getExecutable()->getBuffer().contains(bufferInstance) )
+ {
+ aliasPath.append( itRID.getInstance() );
+
+ InstanceOfBuffer * newInstance = new InstanceOfBuffer(
+ theSystemRID.getExecutable(),
+ bufferInstance, aliasPath );
+ newInstance->setCreatorContainerRID( itRID );
+ newInstance->setRuntimeContainerRID( itRID );
+
+ aliasTable.save( newInstance );
+ }
+ break;
+ }
+
+ case FORM_INSTANCE_CONNECTOR_KIND:
+ {
+ InstanceOfConnect * connectInstance =
+ aBaseInstance.to_ptr< InstanceOfConnect >();
+
+ if( itRID.getExecutable()->getConnect().contains(connectInstance) )
+ {
+ aliasPath.append( itRID.getInstance() );
+
+ InstanceOfConnect * newInstance = new InstanceOfConnect(
+ theSystemRID.getExecutable(),
+ connectInstance, aliasPath );
+ newInstance->setCreatorContainerRID( itRID );
+ newInstance->setRuntimeContainerRID( itRID );
+
+ aliasTable.save( newInstance );
+ }
+ break;
+ }
+
+ default :
+ {
+ break;
+ }
+ }
+ }
+
+ return( aBaseInstance );
+}
+*
+* !UNUSED!
+*/
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// LIFELINE API
+////////////////////////////////////////////////////////////////////////////////
+
+void RuntimeQuery::getSystemLifelines(Vector< RuntimeID > & lifelines) const
+{
+ const RuntimeForm & systemRF =
+ mConfiguration.getMainExecutionData().getSystemRuntime();
+
+ if( systemRF.hasChild() )
+ {
+ TableOfRuntimeID::const_iterator itRID = systemRF.beginChild();
+ TableOfRuntimeID::const_iterator endRID = systemRF.endChild();
+ for( ; itRID != endRID ; ++itRID)
+ {
+ lifelines.append( *itRID );
+ }
+ }
+}
+
+
+const RuntimeID & RuntimeQuery::getRuntineByQualifiedNameID(
+ const std::string & aQualifiedNameID) const
+{
+ TableOfRuntimeT::const_iterator itRF =
+ mConfiguration.getMainExecutionData().getTableOfRuntime().begin();
+ TableOfRuntimeT::const_iterator endRF =
+ mConfiguration.getMainExecutionData().getTableOfRuntime().end();
+ for( ; itRF != endRF ; ++itRF)
+ {
+ if( NamedElement::fqnEndsWith(
+ (*itRF)->getFullyQualifiedNameID(),aQualifiedNameID) )
+ {
+ return( (*itRF)->getRID() );
+ }
+ }
+
+ return( RuntimeID::REF_NULL );
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/RuntimeQuery.h b/org.eclipse.efm.symbex/src/fml/runtime/RuntimeQuery.h
new file mode 100644
index 0000000..22d4dd1
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/RuntimeQuery.h
@@ -0,0 +1,150 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 19 mars 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef FML_RUNTIME_RUNTIMEQUERY_H_
+#define FML_RUNTIME_RUNTIMEQUERY_H_
+
+#include <fml/symbol/Symbol.h>
+
+#include <sew/Configuration.h>
+
+
+namespace sep
+{
+
+
+class ExecutionData;
+
+class ObjectElement;
+
+//class UniFormIdentifier;
+
+class WObject;
+
+
+class RuntimeQuery
+{
+
+protected :
+ /**
+ * ATTRIBUTES
+ */
+ const Configuration & mConfiguration;
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ RuntimeQuery(const Configuration & aConfiguration)
+ : mConfiguration( aConfiguration )
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // STATIC TOOLS
+ // Used during configuration step
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * SEARCH
+ * Symbol
+ * !UNUSED!
+ *
+ const BF & searchSymbol(WObject * aWProperty);
+
+ avm_size_t searchSymbol(WObject * aWProperty, BFList & listofSymbol);
+ *
+ * !UNUSED!
+ */
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // RUNTIME TOOLS
+ // Used during execution< processing / filtering > step
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * SEARCH
+ * Variable
+ */
+
+ BF searchVariable(const ExecutionData & anED, const RuntimeID & ctxRID,
+ const std::string & aFullyQualifiedNameID) const ;
+
+ inline BF searchVariable(const ExecutionData & anED,
+ const std::string & aFullyQualifiedNameID) const
+ {
+ return( searchVariable(anED, anED.mRID, aFullyQualifiedNameID) );
+ }
+
+
+ const BF & searchVariable(const ExecutionData & anED,
+ const RuntimeID & ctxRID, const ObjectElement * objElement) const;
+
+ inline const BF & searchVariable(
+ const ExecutionData & anED, const ObjectElement * objElement) const
+ {
+ return( searchVariable(anED, anED.mRID, objElement) );
+ }
+
+
+ BF searchVariable(const ExecutionData & anED,
+ const RuntimeID & ctxRID, const BF & aSymbolicParameter) const;
+
+ inline BF searchVariable(
+ const ExecutionData & anED, const BF & aSymbolicParameter) const
+ {
+ return( searchVariable(anED, anED.mRID, aSymbolicParameter) );
+ }
+
+
+ /**
+ * SEARCH
+ * Symbol
+ * !UNUSED!
+ *
+ BF searchSymbol(TableOfSymbol & aliasTable,
+ const ExecutionData & anED, UniFormIdentifier * anUFI);
+
+ const BF & searchSymbol(TableOfSymbol & aliasTable,
+ const ExecutionData & anED, const ObjectElement * objElement);
+
+ const BF & searchSymbol(TableOfSymbol & aliasTable,
+ const ExecutionData & anED, const BF & aBaseInstance);
+ *
+ * !UNUSED!
+ */
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // LIFELINE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ void getSystemLifelines(Vector< RuntimeID > & lifelines) const;
+
+ const RuntimeID & getRuntineByQualifiedNameID(
+ const std::string & aQualifiedNameID) const;
+
+};
+
+} /* namespace sep */
+
+#endif /* FML_RUNTIME_RUNTIMEQUERY_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/TableOfData.cpp b/org.eclipse.efm.symbex/src/fml/runtime/TableOfData.cpp
new file mode 100644
index 0000000..f61ab77
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/TableOfData.cpp
@@ -0,0 +1,343 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "TableOfData.h"
+
+#include <fml/executable/InstanceOfData.h>
+
+#include <fml/expression/BuiltinArray.h>
+#include <fml/expression/BuiltinContainer.h>
+
+#include <fml/symbol/TableOfSymbol.h>
+
+
+namespace sep
+{
+
+
+/**
+ * GETTER - SETTER
+ * mTable
+ */
+const BF & TableOfData::get(const InstanceOfData * anInstance) const
+{
+ switch( anInstance->getPointerNature() )
+ {
+ case IPointerDataNature::POINTER_STANDARD_NATURE:
+ {
+ return( mTable[ anInstance->getOffset() ] );
+ }
+
+ case IPointerDataNature::POINTER_UFI_OFFSET_NATURE:
+ case IPointerDataNature::POINTER_UFI_RUNTIME_NATURE:
+ {
+ BF rvalue = mTable[ anInstance->getOffset() ];
+
+ // NO +1 for << this >> which is the root of the path
+ avm_size_t pathLength = anInstance->getDataPath()->size();
+ avm_size_t * theOffsetPath = anInstance->getOffsetPath();
+ for( avm_size_t k = 1 ; k < pathLength ; ++k )
+ {
+ rvalue.moveAt( theOffsetPath[k] );
+ }
+
+ return( rvalue[ theOffsetPath[pathLength] ] );
+ }
+
+ case IPointerDataNature::POINTER_UFI_MIXED_NATURE:
+ {
+ BF rvalue = mTable[ anInstance->getOffset() ];
+
+ TableOfSymbol::iterator it = anInstance->getDataPath()->begin();
+ TableOfSymbol::iterator itEnd = anInstance->getDataPath()->pred_end();
+ for( ; it != itEnd ; ++it )
+ {
+ switch( (*it).getPointerNature() )
+ {
+ case IPointerDataNature::POINTER_FIELD_CLASS_ATTRIBUTE_NATURE:
+ case IPointerDataNature::POINTER_FIELD_ARRAY_OFFSET_NATURE:
+ {
+ rvalue.moveAt( (*it).getOffset() );
+
+ break;
+ }
+ case IPointerDataNature::POINTER_FIELD_ARRAY_INDEX_NATURE:
+ {
+ if( (*it).getValue().isInteger() )
+ {
+ rvalue.moveAt( (*it).getValue().toInteger() );
+ }
+ else if( (*it).getValue().isFloat() )
+ {
+ rvalue.moveAt( (*it).getValue().toFloat() );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "TableOfData::get:> unexpected "
+ "NON-INTEGER ARRAY INDEX << "
+ << (*it).strValue()
+ << " >> in instance FQN-ID :>\n"
+ << (*it).toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+
+ break;
+ }
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "TableOfData::get:> Unexpected "
+ "POINTER NATURE for the instance of data :>\n"
+ << anInstance->toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+ }
+ }
+
+ switch( (*it).getPointerNature() )
+ {
+ case IPointerDataNature::POINTER_FIELD_CLASS_ATTRIBUTE_NATURE:
+ case IPointerDataNature::POINTER_FIELD_ARRAY_OFFSET_NATURE:
+ {
+ return( rvalue[ (*it).getOffset() ] );
+ }
+ case IPointerDataNature::POINTER_FIELD_ARRAY_INDEX_NATURE:
+ {
+ if( (*it).getValue().isInteger() )
+ {
+ return( rvalue[ (*it).getValue().toInteger() ] );
+ }
+ else if( (*it).getValue().isFloat() )
+ {
+ return( rvalue[ (*it).getValue().toFloat() ] );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "TableOfData::get:> unexpected "
+ "NON-INTEGER ARRAY INDEX << "
+ << (*it).strValue()
+ << " >> in instance FQN-ID :>\n"
+ << (*it).toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+ }
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "TableOfData::get:> Unexpected "
+ "POINTER NATURE for the instance of data :>\n"
+ << anInstance->toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ return( BF::REF_NULL );
+ }
+ }
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "TableOfData::get:> Unexpected "
+ "POINTER NATURE for the instance of data :>\n"
+ << anInstance->toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+ return( BF::REF_NULL );
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+void TableOfData::set(const InstanceOfData * anInstance, const BF & aData) const
+{
+ switch( anInstance->getPointerNature() )
+ {
+ case IPointerDataNature::POINTER_STANDARD_NATURE:
+ {
+ mTable[ anInstance->getOffset() ] = aData;
+
+ break;
+ }
+ case IPointerDataNature::POINTER_UFI_OFFSET_NATURE:
+ case IPointerDataNature::POINTER_UFI_RUNTIME_NATURE:
+ {
+ BF rvalue = mTable[ anInstance->getOffset() ].getWritable();
+
+ // NO +1 for << this >> which is the root of the path
+ avm_size_t pathLength = anInstance->getDataPath()->size();
+ avm_size_t * theOffsetPath = anInstance->getOffsetPath();
+ for( avm_size_t k = 1 ; k < pathLength ; ++k )
+ {
+ rvalue.moveAtWritable( theOffsetPath[k] );
+ }
+
+ rvalue.set( theOffsetPath[pathLength] , aData);
+
+ break;
+ }
+ case IPointerDataNature::POINTER_UFI_MIXED_NATURE:
+ {
+ BF rvalue = mTable[ anInstance->getOffset() ].getWritable();
+
+ TableOfSymbol::iterator it = anInstance->getDataPath()->begin();
+ TableOfSymbol::iterator itEnd = anInstance->getDataPath()->pred_end();
+ for( ; it != itEnd ; ++it )
+ {
+ switch( (*it).getPointerNature() )
+ {
+ case IPointerDataNature::POINTER_FIELD_CLASS_ATTRIBUTE_NATURE:
+ case IPointerDataNature::POINTER_FIELD_ARRAY_OFFSET_NATURE:
+ {
+ rvalue.moveAtWritable( (*it).getOffset() );
+
+ break;
+ }
+ case IPointerDataNature::POINTER_FIELD_ARRAY_INDEX_NATURE:
+ {
+ if( (*it).getValue().isInteger() )
+ {
+ rvalue.moveAtWritable( (*it).getValue().toInteger() );
+ }
+ else if( (*it).getValue().isFloat() )
+ {
+ rvalue.moveAtWritable( (*it).getValue().toFloat() );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "TableOfData::set:> unexpected "
+ "NON-INTEGER ARRAY INDEX << "
+ << (*it).strValue()
+ << " >> in instance FQN-ID :>\n"
+ << (*it).toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ return;
+ }
+
+ break;
+ }
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "TableOfData::set:> Unexpected "
+ "POINTER NATURE for the instance of data :>\n"
+ << anInstance->toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ return;
+ }
+ }
+ }
+
+ switch( (*it).getPointerNature() )
+ {
+ case IPointerDataNature::POINTER_FIELD_CLASS_ATTRIBUTE_NATURE:
+ case IPointerDataNature::POINTER_FIELD_ARRAY_OFFSET_NATURE:
+ {
+ //rvalue[ (*it).getOffset() ].makeWritable();
+ rvalue.set( (*it).getOffset() , aData );
+
+ break;
+ }
+ case IPointerDataNature::POINTER_FIELD_ARRAY_INDEX_NATURE:
+ {
+ if( (*it).getValue().isInteger() )
+ {
+ //rvalue[ (*it).getValue().toInteger() ].makeWritable();
+ rvalue.set( (*it).getValue().toInteger() , aData );
+ }
+ else if( (*it).getValue().isFloat() )
+ {
+ //rvalue[ (*it).getValue().toFloat() ].makeWritable();
+ rvalue.set( (*it).getValue().toFloat() , aData );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "TableOfData::set:> unexpected "
+ "NON-INTEGER ARRAY INDEX << "
+ << (*it).strValue()
+ << " >> in instance FQN-ID :>\n"
+ << (*it).toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ return;
+ }
+
+ break;
+ }
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "TableOfData::set:> Unexpected "
+ "POINTER NATURE for the instance of data :>\n"
+ << anInstance->toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ return;
+ }
+ }
+ break;
+ }
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "TableOfData::set:> Unexpected "
+ "POINTER NATURE for the instance of data :>\n"
+ << anInstance->toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+}
+
+
+/**
+ * Serialization
+ */
+void TableOfData::toStream(OutStream & os) const
+{
+ os << TAB << "$[";
+ for( const_iterator it = begin() ; it != end() ; ++it )
+ {
+ os << TAB2 << (*it).AVM_DEBUG_REF_COUNTER()
+ << " " << (*it).str() << EOL;
+ }
+ os << TAB << "]" << EOL_FLUSH;
+}
+
+void TableOfData::toStream(OutStream & os, const BFVector & vars) const
+{
+ avm_offset_t offset = 0;
+ for( const_iterator it = begin() ; it != end() ; ++it, ++offset )
+ {
+ os << TAB << vars[offset].to_ptr< InstanceOfData >()->getNameID()
+ << " := " << (*it).AVM_DEBUG_REF_COUNTER()
+ << vars[offset].to_ptr< InstanceOfData >()->strValue()
+ << ";" << EOL_FLUSH;
+ }
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/TableOfData.h b/org.eclipse.efm.symbex/src/fml/runtime/TableOfData.h
new file mode 100644
index 0000000..b3db977
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/TableOfData.h
@@ -0,0 +1,171 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef TABLEOFDATA_H_
+#define TABLEOFDATA_H_
+
+#include <common/AvmPointer.h>
+#include <common/AvmObject.h>
+
+#include <collection/BFContainer.h>
+
+
+namespace sep
+{
+
+
+class ArrayBF;
+class BuiltinContainer;
+class InstanceOfData;
+
+
+class TableOfData :
+ public AvmObject,
+ public ArrayOfBF,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( TableOfData )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( TableOfData )
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TableOfData(avm_size_t aSize)
+ : AvmObject( ),
+ ArrayOfBF( aSize )
+ {
+ //!! NOTHING
+ }
+
+ TableOfData(const BFVector & dataTable)
+ : AvmObject( ),
+ ArrayOfBF( dataTable )
+ {
+ //!! NOTHING
+ }
+
+ TableOfData(const TableOfData & aData)
+ : AvmObject( aData ),
+ ArrayOfBF( aData )
+ {
+ //!! NOTHING
+ }
+
+
+ virtual ~TableOfData()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * for container of BF
+ */
+ inline virtual BF & at(avm_size_t offset)
+ {
+ return( mTable[offset] );
+ }
+
+ inline virtual const BF & at(avm_size_t offset) const
+ {
+ return( mTable[offset] );
+ }
+
+
+ inline virtual BF & operator[](avm_size_t offset)
+ {
+ return( mTable[offset] );
+ }
+
+ inline virtual const BF & operator[](avm_size_t offset) const
+ {
+ return( mTable[offset] );
+ }
+
+
+ inline virtual BF & getWritable(avm_size_t offset) const
+ {
+ mTable[offset].makeWritable();
+
+ return( mTable[offset] );
+ }
+
+ inline virtual void makeWritable(avm_size_t offset) const
+ {
+ mTable[offset].makeWritable();
+ }
+
+ inline virtual void set(avm_size_t offset, const BF & bf) const
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( offset , mSize ) << SEND_EXIT;
+
+ mTable[offset] = bf;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mTable
+ */
+ const BF & get(const InstanceOfData * anInstance) const;
+
+ void set(const InstanceOfData * anInstance, const BF & aData) const;
+
+
+ /**
+ * Serialization
+ */
+ inline virtual std::string toString(
+ const AvmIndent & indent = AVM_TAB_INDENT) const
+ {
+ StringOutStream oss(indent);
+
+ toStream(oss);
+
+ return( oss.str() );
+ }
+
+ inline std::string toString(const BFVector & vars,
+ const AvmIndent & indent = AVM_TAB_INDENT) const
+ {
+ StringOutStream oss(indent);
+
+ toStream(oss, vars);
+
+ return( oss.str() );
+ }
+
+
+ virtual void toStream(OutStream & os) const;
+
+ void toStream(OutStream & os, const BFVector & vars) const;
+
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// TYPE DEFINITION for SMART POINTER and CONTAINER
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+AVM_DEFINE_AP_CLASS( TableOfData )
+
+
+
+}
+
+#endif /*TABLEOFDATA_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/TableOfRuntimeFormState.cpp b/org.eclipse.efm.symbex/src/fml/runtime/TableOfRuntimeFormState.cpp
new file mode 100644
index 0000000..04031f1
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/TableOfRuntimeFormState.cpp
@@ -0,0 +1,248 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 13 juil. 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "TableOfRuntimeFormState.h"
+
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeDef.h>
+
+
+namespace sep
+{
+
+
+/**
+ * RESIZE
+ * mEvalState
+ * mTableOfAssignedFlag
+ */
+void TableOfRuntimeFormState::resize(avm_size_t aSize)
+{
+ if( mSize > 0 )
+ {
+ PROCESS_EVAL_STATE * oldEvalState = mEvalState;
+
+ avm_size_t offset = mSize;
+ mSize = aSize;
+
+ if( aSize > offset )
+ {
+ aSize = offset;
+ }
+
+ mEvalState = new PROCESS_EVAL_STATE[ mSize ];
+
+ if( mTableOfAssignedFlag != NULL )
+ {
+ TableOfAssignedFlag oldTableOfAssigned = mTableOfAssignedFlag;
+ mTableOfAssignedFlag = new Bitset *[ mSize ];
+
+ for( offset = 0 ; offset < aSize ; ++offset )
+ {
+ mEvalState[ offset ] = oldEvalState[ offset ];
+
+ mTableOfAssignedFlag[ offset ] = oldTableOfAssigned[ offset ];
+ }
+
+ for( ; offset < mSize ; ++offset )
+ {
+ mEvalState[ offset ] = PROCESS_UNDEFINED_STATE;
+
+ mTableOfAssignedFlag[ offset ] = NULL;
+ }
+
+ delete [] oldTableOfAssigned;
+ }
+ else
+ {
+ for( offset = 0 ; offset < aSize ; ++offset )
+ {
+ mEvalState[ offset ] = oldEvalState[ offset ];
+ }
+ for( ; offset < mSize ; ++offset )
+ {
+ mEvalState[ offset ] = PROCESS_UNDEFINED_STATE;
+ }
+ }
+
+ delete [] oldEvalState;
+ }
+
+ else
+ {
+ mSize = aSize;
+
+ allocTableOfState();
+ }
+}
+
+
+/**
+ * ALLOCATE - GETTER - SETTER
+ * mTableOfAssignedFlag
+ */
+
+void TableOfRuntimeFormState::setAssigned(const ExecutionData & anED,
+ avm_size_t rid, avm_size_t offset, bool flag)
+{
+ if( mTableOfAssignedFlag == NULL )
+ {
+ allocAssignedFlag(rid,
+ anED.getRuntime(rid).getVariables().size(), false);
+ }
+ else if( mTableOfAssignedFlag[rid] == NULL )
+ {
+ mTableOfAssignedFlag[rid] = new Bitset(
+ anED.getRuntime(rid).getVariables().size(), false );
+ }
+
+ ( *(mTableOfAssignedFlag[rid]) )[offset] = flag;
+}
+
+
+void TableOfRuntimeFormState::setAssignedUnion(avm_size_t rid,
+ Bitset * assignedTableA, Bitset * assignedTableB)
+{
+ if( assignedTableA != NULL )
+ {
+ if( mTableOfAssignedFlag == NULL )
+ {
+ reallocAssignedFlag();
+ }
+
+ mTableOfAssignedFlag[rid] = new Bitset( *assignedTableA );
+
+ if( assignedTableB != NULL )
+ {
+ ( *(mTableOfAssignedFlag[rid]) ) |= (*assignedTableB);
+ }
+ }
+ else if( assignedTableB != NULL )
+ {
+ if( mTableOfAssignedFlag == NULL )
+ {
+ reallocAssignedFlag();
+ }
+
+ mTableOfAssignedFlag[rid] = new Bitset( *assignedTableB );
+ }
+}
+
+
+
+
+/**
+ * COMPARISON
+ */
+bool TableOfRuntimeFormState::equalsState(TableOfRuntimeFormState * other) const
+{
+ if( this->mEvalState != other->mEvalState )
+ {
+ if( this->size() == other->size() )
+ {
+ for( avm_size_t i = 0 ; i != this->size() ; ++i )
+ {
+ if( isNEQ(this->stateAt(i), other ->stateAt(i)) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+ else if( this->size() < other->size() )
+ {
+ avm_size_t i = 0;
+
+ for( ; i != this->size() ; ++i )
+ {
+ if( this->stateAt(i) != other ->stateAt(i) )
+ {
+ return( false );
+ }
+ }
+
+ for( ; i != other->size() ; ++i )
+ {
+ if( other->stateAt(i) != PROCESS_DESTROYED_STATE )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+ else if( this->size() > other->size() )
+ {
+ avm_size_t i = 0;
+
+ for( ; i != this->size() ; ++i )
+ {
+ if( this->stateAt(i) != other ->stateAt(i) )
+ {
+ return( false );
+ }
+ }
+
+ for( ; i != this->size() ; ++i )
+ {
+ if( this->stateAt(i) != PROCESS_DESTROYED_STATE )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+}
+
+
+
+/**
+ * Serialization
+ */
+void TableOfRuntimeFormState::toStream(OutStream & os) const
+{
+ for( avm_size_t offset = 0 ; offset != mSize ; ++offset )
+ {
+ os << TAB << "rid#" << offset << " = "
+ << RuntimeDef::strPES( mEvalState[offset] )
+ << ";" << EOL_FLUSH;
+ }
+}
+
+
+void TableOfRuntimeFormState::toStream(
+ const ExecutionData & anED, OutStream & os) const
+{
+ for( avm_size_t offset = 0 ; offset != mSize ; ++offset )
+ {
+//AVM_IF_DEBUG_LEVEL_GT_MEDIUM_OR( mEvalState[i] != PROCESS_IDLE_STATE )
+ os << TAB << "<@rid#" << offset << " = "
+ << RuntimeDef::strPES( mEvalState[offset] ) << ";\t\t// "
+ << anED.getRuntime(offset).getFullyQualifiedNameID()
+ << EOL_FLUSH;
+//AVM_IF_DEBUG_LEVEL_GT_MEDIUM_OR
+ }
+}
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/runtime/TableOfRuntimeFormState.h b/org.eclipse.efm.symbex/src/fml/runtime/TableOfRuntimeFormState.h
new file mode 100644
index 0000000..d46de39
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/runtime/TableOfRuntimeFormState.h
@@ -0,0 +1,658 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 13 juil. 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef TABLEOFRUNTIMEFORMSTATE_H_
+#define TABLEOFRUNTIMEFORMSTATE_H_
+
+#include <common/AvmObject.h>
+
+#include <common/AvmPointer.h>
+
+#include <collection/Bitset.h>
+
+#include <fml/runtime/RuntimeDef.h>
+
+
+namespace sep
+{
+
+
+class ExecutionData;
+
+
+class TableOfRuntimeFormState :
+ public AvmObject,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( TableOfRuntimeFormState )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( TableOfRuntimeFormState )
+
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef Bitset * * TableOfAssignedFlag;
+
+protected :
+ /**
+ * ATTRIBUTES
+ */
+ avm_size_t mSize;
+
+ PROCESS_EVAL_STATE * mEvalState;
+
+ TableOfAssignedFlag mTableOfAssignedFlag;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TableOfRuntimeFormState(avm_size_t aSize)
+ : AvmObject( ),
+ mSize( aSize ),
+ mEvalState( NULL ),
+ mTableOfAssignedFlag( NULL )
+ {
+ allocTableOfState();
+ resetTableOfState();
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ TableOfRuntimeFormState(const TableOfRuntimeFormState & aTable)
+ : AvmObject( aTable ),
+ mSize( aTable.mSize ),
+ mEvalState( NULL ),
+ mTableOfAssignedFlag( NULL )
+ {
+ allocTableOfState( aTable.mEvalState );
+
+ if( aTable.mTableOfAssignedFlag != NULL )
+ {
+ allocAssignedFlag( aTable.mTableOfAssignedFlag );
+ }
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~TableOfRuntimeFormState()
+ {
+ delete [] mEvalState;
+
+ destroyAssignedFlags();
+ }
+
+
+ /**
+ * ALLOCATE
+ * reset
+ */
+ inline void reset(const TableOfRuntimeFormState & aTable,
+ bool assignedResetFlag = true)
+ {
+ if( assignedResetFlag )
+ {
+ destroyAssignedFlags();
+ }
+
+ if( mSize == aTable.mSize )
+ {
+ resetTableOfState( aTable.mEvalState );
+ }
+ else
+ {
+ mSize = aTable.mSize;
+
+ delete [] mEvalState;
+
+ allocTableOfState( aTable.mEvalState );
+ }
+
+ if( assignedResetFlag && (aTable.mTableOfAssignedFlag != NULL) )
+ {
+ allocAssignedFlag( aTable.mTableOfAssignedFlag );
+ }
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mSize
+ */
+ inline avm_size_t size() const
+ {
+ return( mSize );
+ }
+
+ inline bool nonempty() const
+ {
+ return( mSize > 0 );
+ }
+
+
+ void resize(avm_size_t newSize);
+
+
+ /**
+ * ALLOCATE - GETTER - SETTER
+ * mEvalState
+ */
+ inline void allocTableOfState()
+ {
+ mEvalState = ( mSize > 0 ) ?
+ ( new PROCESS_EVAL_STATE[ mSize ] ) : NULL;
+ }
+
+
+ inline void allocTableOfState(PROCESS_EVAL_STATE * tableOfState)
+ {
+ mEvalState = ( mSize > 0 ) ?
+ ( new PROCESS_EVAL_STATE[ mSize ] ) : NULL;
+
+ resetTableOfState(tableOfState);
+ }
+
+
+ inline void resetTableOfState(
+ PROCESS_EVAL_STATE value = PROCESS_UNDEFINED_STATE)
+ {
+ for( avm_size_t i = 0 ; i != mSize ; ++i )
+ {
+ mEvalState[i] = value;
+ }
+ }
+
+ inline void resetTableOfState(PROCESS_EVAL_STATE * tableOfState)
+ {
+ for( avm_size_t i = 0 ; i != mSize ; ++i )
+ {
+ mEvalState[i] = tableOfState[i];
+ }
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mEvalState
+ */
+ inline PROCESS_EVAL_STATE * getEvalState() const
+ {
+ return( mEvalState );
+ }
+
+ inline PROCESS_EVAL_STATE stateAt(avm_size_t rid) const
+ {
+ return( mEvalState[rid] );
+ }
+
+ inline PROCESS_EVAL_STATE stateGet(avm_size_t rid) const
+ {
+ return( mEvalState[rid] );
+ }
+
+ inline void stateSet(avm_size_t rid, PROCESS_EVAL_STATE aEvalState)
+ {
+ mEvalState[rid] = aEvalState;
+ }
+
+
+ /**
+ * TEST
+ * mEvalState
+ */
+ inline bool isCreating(avm_offset_t offset) const
+ {
+ return( mEvalState[offset] == PROCESS_CREATING_STATE );
+ }
+
+ inline bool isCreated(avm_offset_t offset) const
+ {
+ return( mEvalState[offset] == PROCESS_CREATED_STATE );
+ }
+
+ inline bool isLoaded(avm_offset_t offset) const
+ {
+ return( mEvalState[offset] == PROCESS_LOADED_STATE );
+ }
+
+
+ inline bool isStarting(avm_offset_t offset) const
+ {
+ return( mEvalState[offset] == PROCESS_STARTING_STATE );
+ }
+
+ inline bool isIniting(avm_offset_t offset) const
+ {
+ return( mEvalState[offset] == PROCESS_INITING_STATE );
+ }
+
+
+ inline bool isStopping(avm_offset_t offset) const
+ {
+ return( mEvalState[offset] == PROCESS_STOPPING_STATE );
+ }
+
+ inline bool isStopped(avm_offset_t offset) const
+ {
+ return( mEvalState[offset] == PROCESS_STOPPED_STATE );
+ }
+
+
+ inline bool isFinalizing(avm_offset_t offset) const
+ {
+ return( mEvalState[offset] == PROCESS_FINALIZING_STATE );
+ }
+
+ inline bool isFinalized(avm_offset_t offset) const
+ {
+ return( mEvalState[offset] == PROCESS_FINALIZED_STATE );
+ }
+
+ inline bool isDestroyed(avm_offset_t offset) const
+ {
+ return( mEvalState[offset] == PROCESS_DESTROYED_STATE );
+ }
+
+ inline bool isFinalizedOrDestroyed(avm_offset_t offset) const
+ {
+ return( (mEvalState[offset] == PROCESS_FINALIZED_STATE) ||
+// (mEvalState[offset] == PROCESS_CREATED_STATE ) || // TODO !?!
+ (mEvalState[offset] == PROCESS_DESTROYED_STATE) );
+ }
+
+ inline bool isAlive(avm_offset_t offset) const
+ {
+ return( (mEvalState[offset] != PROCESS_FINALIZED_STATE) &&
+ (mEvalState[offset] != PROCESS_DESTROYED_STATE) );
+ }
+
+
+ inline bool isSuspended(avm_offset_t offset) const
+ {
+ return( mEvalState[offset] == PROCESS_SUSPENDED_STATE );
+ }
+
+ inline bool isWaiting(avm_offset_t offset) const
+ {
+ return( mEvalState[offset] == PROCESS_WAITING_STATE );
+ }
+
+ inline bool isWaitingJoin(avm_offset_t offset) const
+ {
+ return( mEvalState[offset] == PROCESS_WAITING_JOIN_STATE );
+ }
+
+
+ inline bool isAborted(avm_offset_t offset) const
+ {
+ return( (mEvalState[offset] == PROCESS_ABORTED_STATE) );
+ }
+
+ inline bool isDisable(avm_offset_t offset) const
+ {
+ return( (mEvalState[offset] == PROCESS_DISABLED_STATE) );
+ }
+
+
+ inline bool isDisableOrAborted(avm_offset_t offset) const
+ {
+ return( (mEvalState[offset] == PROCESS_DISABLED_STATE) ||
+ (mEvalState[offset] == PROCESS_ABORTED_STATE));
+ }
+
+
+ inline bool isIdle(avm_offset_t offset) const
+ {
+ return( (mEvalState[offset] == PROCESS_IDLE_STATE) );
+ }
+
+
+ inline bool isRunning(avm_offset_t offset) const
+ {
+ return( (mEvalState[offset] == PROCESS_RUNNING_STATE) ||
+ (mEvalState[offset] == PROCESS_RTC_STATE) );
+ }
+
+
+ inline bool isIdleOrRunning(PROCESS_EVAL_STATE aState) const
+ {
+ return( (aState == PROCESS_IDLE_STATE) ||
+ (aState == PROCESS_RUNNING_STATE) ||
+ (aState == PROCESS_RTC_STATE) );
+ }
+
+ inline bool isnotIdleOrRunning(PROCESS_EVAL_STATE aState) const
+ {
+ return( (aState != PROCESS_IDLE_STATE) &&
+ (aState != PROCESS_RUNNING_STATE) &&
+ (aState != PROCESS_RTC_STATE) );
+ }
+
+ inline bool isIdleOrRunning(avm_offset_t offset) const
+ {
+ return( isIdleOrRunning(mEvalState[offset]) );
+ }
+
+
+ // DEFINED / UNDEFINED STATE
+ inline bool isDefined(avm_offset_t offset) const
+ {
+ return( mEvalState[offset] != PROCESS_UNDEFINED_STATE );
+ }
+
+ inline bool isUndefined(avm_offset_t offset) const
+ {
+ return( mEvalState[offset] == PROCESS_UNDEFINED_STATE );
+ }
+
+
+ /**
+ * TEST
+ * mEvalState
+ */
+ inline bool isRunnable(avm_offset_t offset) const
+ {
+ switch( mEvalState[offset] )
+ {
+ case PROCESS_IDLE_STATE:
+ case PROCESS_RUNNING_STATE:
+ case PROCESS_RTC_STATE:
+ case PROCESS_DISABLED_STATE:
+ case PROCESS_ABORTED_STATE:
+ case PROCESS_INITING_STATE:
+ case PROCESS_STARTING_STATE:
+ case PROCESS_LOADED_STATE:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+ }
+
+
+ inline bool isunRunnable(avm_offset_t offset) const
+ {
+
+ switch( mEvalState[offset] )
+ {
+ case PROCESS_FINALIZED_STATE:
+ case PROCESS_DESTROYED_STATE:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+ }
+
+
+ // CREATED or RUNNABLE STATE
+ inline bool isCreatedOrRunnable(avm_offset_t offset) const
+ {
+ return( isCreated(offset) || isRunnable(offset) );
+ }
+
+
+ /**
+ * COMPARISON
+ */
+ bool equalsState(TableOfRuntimeFormState * other) const;
+
+
+ inline bool isEQ(PROCESS_EVAL_STATE oneState,
+ PROCESS_EVAL_STATE otherState) const
+ {
+ return( (oneState == otherState)
+ || (isIdleOrRunning(oneState)
+ && isIdleOrRunning(otherState)) );
+ }
+
+ inline bool isNEQ(PROCESS_EVAL_STATE oneState,
+ PROCESS_EVAL_STATE otherState) const
+ {
+ return( (oneState != otherState)
+ && (isnotIdleOrRunning(oneState)
+ || isnotIdleOrRunning(otherState)) );
+ }
+
+
+ /*
+ ***************************************************************************
+ * RESET - ALLOCATION :> mTableOfAssignedFlag
+ ***************************************************************************
+ */
+ inline TableOfAssignedFlag getTableOfAssignedFlag() const
+ {
+ return( mTableOfAssignedFlag );
+ }
+
+ inline void setTableOfAssignedFlag(TableOfAssignedFlag aTableOfAssignedFlag)
+ {
+ mTableOfAssignedFlag = aTableOfAssignedFlag;
+ }
+
+
+ // GLOBAL TABLE
+ inline void destroyAssignedFlags()
+ {
+ if( mTableOfAssignedFlag != NULL )
+ {
+ for( avm_size_t i = 0 ; i < mSize ; ++i )
+ {
+ delete mTableOfAssignedFlag[i];
+ }
+
+ delete[] mTableOfAssignedFlag;
+
+ mTableOfAssignedFlag = NULL;
+ }
+ }
+
+
+ inline void resetAssignedFlags()
+ {
+ if( mTableOfAssignedFlag != NULL )
+ {
+ for( avm_size_t i = 0 ; i < mSize ; ++i )
+ {
+ delete mTableOfAssignedFlag[i];
+
+ mTableOfAssignedFlag[i] = NULL;
+ }
+ }
+ }
+
+
+ inline void resetAssignedFlags(Bitset * * tableOfAssignFlag)
+ {
+ if( mTableOfAssignedFlag != NULL )
+ {
+ for( avm_size_t i = 0 ; i < mSize ; ++i )
+ {
+ delete mTableOfAssignedFlag[i];
+
+ mTableOfAssignedFlag[i] = ( tableOfAssignFlag[i] != NULL ) ?
+ new Bitset( *(tableOfAssignFlag[i]) ) : NULL;
+ }
+ }
+ }
+
+
+ // GLOBAL TABLE
+ inline void allocAssignedFlag(Bitset * * tableOfAssignFlag)
+ {
+ mTableOfAssignedFlag = ( mSize > 0 ) ?
+ ( new Bitset *[ mSize ] ) : NULL;
+
+ for( avm_size_t i = 0 ; i < mSize ; ++i )
+ {
+ mTableOfAssignedFlag[i] = ( tableOfAssignFlag[i] != NULL ) ?
+ ( new Bitset( *(tableOfAssignFlag[i]) ) ) : NULL;
+ }
+ }
+
+ inline void reallocAssignedFlag()
+ {
+ destroyAssignedFlags();
+
+ mTableOfAssignedFlag = ( mSize > 0 ) ?
+ ( new Bitset *[ mSize ] ) : NULL;
+
+ for( avm_size_t i = 0 ; i < mSize ; ++i )
+ {
+ mTableOfAssignedFlag[i] = NULL;
+ }
+ }
+
+
+ // RF TABLE
+ inline void allocAssignedFlag(avm_size_t rid, avm_size_t aSize, bool value)
+ {
+ reallocAssignedFlag();
+
+ mTableOfAssignedFlag[rid] = ( aSize > 0 ) ?
+ ( new Bitset( aSize, value ) ) : NULL;
+ }
+
+
+ // ASSIGNED TEST
+ inline Bitset * getAssigned(avm_size_t rid) const
+ {
+ if( mTableOfAssignedFlag != NULL )
+ {
+ return( mTableOfAssignedFlag[rid] );
+ }
+ return( NULL );
+ }
+
+ inline bool isAssigned(avm_size_t rid, avm_offset_t offset) const
+ {
+ if( mTableOfAssignedFlag != NULL )
+ {
+ if( mTableOfAssignedFlag[rid] != NULL )
+ {
+ return( (*(mTableOfAssignedFlag[rid]))[offset] );
+ }
+ }
+ return( false );
+ }
+
+
+ inline bool hasAssigned() const
+ {
+ return( mTableOfAssignedFlag != NULL );
+ }
+
+ inline bool zeroAssigned() const
+ {
+ return( mTableOfAssignedFlag == NULL );
+ }
+
+
+ inline bool hasAssigned(avm_size_t rid) const
+ {
+ if( mTableOfAssignedFlag != NULL )
+ {
+ return( mTableOfAssignedFlag[rid] != NULL );
+ }
+
+ return( false );
+ }
+
+ inline bool zeroAssigned(avm_size_t rid) const
+ {
+ if( mTableOfAssignedFlag != NULL )
+ {
+ return( mTableOfAssignedFlag[rid] == NULL );
+ }
+
+ return( true );
+ }
+
+
+
+ void setAssigned(const ExecutionData & anED,
+ avm_size_t rid, avm_size_t offset, bool flag);
+
+
+ inline void setAssigned(avm_size_t rid, Bitset * assignedTable)
+ {
+ if( mTableOfAssignedFlag == NULL )
+ {
+ reallocAssignedFlag();
+ }
+ else if( mTableOfAssignedFlag[rid] != NULL )
+ {
+ delete mTableOfAssignedFlag[rid];
+ }
+
+ mTableOfAssignedFlag[rid] = ( assignedTable != NULL ) ?
+ ( new Bitset( *assignedTable ) ) : NULL;
+ }
+
+
+ void setAssignedUnion(avm_size_t rid,
+ Bitset * assignedTableA, Bitset * assignedTableB);
+
+
+
+ /**
+ * Serialization
+ */
+ inline virtual std::string str() const
+ {
+ StringOutStream oss( AVM_STR_INDENT );
+
+ toStream( oss << IGNORE_FIRST_TAB );
+
+ return( oss.str() );
+ }
+
+ virtual void toStream(OutStream & os) const;
+
+ virtual void toStream(const ExecutionData & anED, OutStream & os) const;
+
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// TYPE DEFINITION for SMART POINTER and CONTAINER
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+AVM_DEFINE_AP_CLASS( TableOfRuntimeFormState )
+
+
+
+}
+
+#endif /* TABLEOFRUNTIMEFORMSTATE_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/symbol/README.md b/org.eclipse.efm.symbex/src/fml/symbol/README.md
new file mode 100644
index 0000000..66fb523
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/symbol/README.md
@@ -0,0 +1,16 @@
+# EFM-SYMBEX : Symbol
+
+## Source code structure
+
+### Interfaces
+* **ISymbol**
+
+### Classes
+* **Variable**
+* **Buffer**
+* **Port**
+* **Signal**
+
+### Factories
+* **Symbol** as Smart Pointer
+
diff --git a/org.eclipse.efm.symbex/src/fml/symbol/Symbol.cpp b/org.eclipse.efm.symbex/src/fml/symbol/Symbol.cpp
new file mode 100644
index 0000000..eb5b995
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/symbol/Symbol.cpp
@@ -0,0 +1,597 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 13 juin 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "Symbol.h"
+
+#include <common/BF.h>
+
+#include <fml/executable/InstanceOfBuffer.h>
+#include <fml/executable/InstanceOfConnect.h>
+#include <fml/executable/InstanceOfData.h>
+#include <fml/executable/InstanceOfMachine.h>
+#include <fml/executable/InstanceOfPort.h>
+
+#include <fml/symbol/TableOfSymbol.h>
+
+
+namespace sep
+{
+
+
+/**
+ * DEFAULT NULL
+ */
+Symbol Symbol::REF_NULL;
+
+
+/**
+ * ASSIGNMENT
+ * BF
+ */
+inline Symbol & Symbol::operator=(const BF & aSymbol)
+{
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( aSymbol.is_weakly< BaseInstanceForm >() )
+ << "Invalid Assignment Cast in a Symbol of " << aSymbol.str()
+ << SEND_EXIT;
+
+ if( mPTR != aSymbol.raw_pointer() )
+ {
+ AVM_ASSIGN_STMNT_DEBUG_SYMBOL_PTR( aSymbol.raw_pointer() )
+
+ release_acquire( aSymbol.to_ptr< BaseInstanceForm >() );
+ }
+ return( *this );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// InstanceOfBuffer
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+InstanceOfBuffer & Symbol::buffer()
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "Unexpected a <null> pointer as InstanceOfBuffer reference !!!"
+ << SEND_EXIT;
+
+ return( static_cast< InstanceOfBuffer & >( *mPTR ) );
+}
+
+const InstanceOfBuffer & Symbol::buffer() const
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "Unexpected a <null> pointer as InstanceOfBuffer reference !!!"
+ << SEND_EXIT;
+
+ return( static_cast< const InstanceOfBuffer & >( *mPTR ) );
+}
+
+
+InstanceOfBuffer * Symbol::rawBuffer() const
+{
+ return( static_cast< InstanceOfBuffer * >( mPTR ) );
+}
+
+
+/**
+ * GETTER - SETTER
+ * mPolicySpecifierKind
+ */
+avm_type_specifier_kind_t Symbol::getPolicySpecifierKind() const
+{
+ return( buffer().getPolicySpecifierKind() );
+}
+
+void Symbol::setPolicySpecifierKind(avm_type_specifier_kind_t aSpecifierKind)
+{
+ buffer().setPolicySpecifierKind( aSpecifierKind );
+}
+
+
+/**
+ * GETTER - SETTER
+ * mCapacity
+ */
+avm_size_t Symbol::capacity() const
+{
+ return( buffer().capacity() );
+}
+
+long Symbol::realCapacity() const
+{
+ return( buffer().realCapacity() );
+}
+
+void Symbol::setCapacity(long aCapacity)
+{
+ buffer().setCapacity( aCapacity );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// InstanceOfChannel
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+InstanceOfPort & Symbol::channel()
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "Unexpected a <null> pointer as InstanceOfPort reference !!!"
+ << SEND_EXIT;
+
+ return( static_cast< InstanceOfPort & >( *mPTR ) );
+}
+
+const InstanceOfPort & Symbol::channel() const
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "Unexpected a <null> pointer as InstanceOfPort reference !!!"
+ << SEND_EXIT;
+
+ return( static_cast< const InstanceOfPort & >( *mPTR ) );
+}
+
+
+InstanceOfPort * Symbol::rawChannel() const
+{
+ return( static_cast< InstanceOfPort * >( mPTR ) );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// InstanceOfConnect
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+InstanceOfConnect & Symbol::connector()
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "Unexpected a <null> pointer as InstanceOfConnect reference !!!"
+ << SEND_EXIT;
+
+ return( static_cast< InstanceOfConnect & >( *mPTR ) );
+}
+
+const InstanceOfConnect & Symbol::connector() const
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "Unexpected a <null> pointer as InstanceOfConnect reference !!!"
+ << SEND_EXIT;
+
+ return( static_cast< const InstanceOfConnect & >( *mPTR ) );
+}
+
+
+InstanceOfConnect * Symbol::rawConnect() const
+{
+ return( static_cast< InstanceOfConnect * >( mPTR ) );
+}
+
+
+/**
+ * GETTER - SETTER
+ * mOutputComRouteData
+ * mInputComRouteData
+ */
+const ComRouteData & Symbol::getOutputComRouteData() const
+{
+ return( connector().getOutputComRouteData() );
+}
+
+const ComRouteData & Symbol::getInputComRouteData() const
+{
+ return( connector().getInputComRouteData() );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// InstanceOfData
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+InstanceOfData & Symbol::data()
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "Unexpected a <null> pointer as InstanceOfData reference !!!"
+ << SEND_EXIT;
+
+ return( static_cast< InstanceOfData & >( *mPTR ) );
+}
+
+const InstanceOfData & Symbol::data() const
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "Unexpected a <null> pointer as InstanceOfData reference !!!"
+ << SEND_EXIT;
+
+ return( static_cast< const InstanceOfData & >( *mPTR ) );
+}
+
+
+InstanceOfData * Symbol::rawData() const
+{
+ return( static_cast< InstanceOfData * >( mPTR ) );
+}
+
+
+/**
+ * SETTER
+ * mFullyQualifiedNameID
+ */
+void Symbol::updateFullyQualifiedNameID(
+ const std::string & aFullyQualifiedNameID, const std::string & aNameID)
+{
+ data().updateFullyQualifiedNameID(aFullyQualifiedNameID, aNameID);
+}
+
+
+/**
+ * GETTER - SETTER
+ * mPointerNature
+ */
+IPointerDataNature::POINTER_DATA_NATURE Symbol::getPointerNature() const
+{
+ return( data().getPointerNature() );
+}
+
+
+/**
+ * GETTER - SETTER
+ * mValue
+ */
+BF & Symbol::getValue()
+{
+ return( data().getValue() );
+}
+
+const BF & Symbol::getValue() const
+{
+ return( data().getValue() );
+}
+
+bool Symbol::hasValue() const
+{
+ return( data().hasValue() );
+}
+
+void Symbol::setValue(const BF & aValue)
+{
+ data().setValue( aValue );
+}
+
+
+// ArrayValue
+ArrayBF * Symbol::getArrayValue() const
+{
+ return( data().getArrayValue() );
+}
+
+bool Symbol::hasArrayValue() const
+{
+ return( data().hasArrayValue() );
+}
+
+
+void Symbol::formatStream(OutStream & os, const BF & aValue) const
+{
+ data().formatStream(os, aValue);
+}
+
+void Symbol::strValue(OutStream & os, const BF & aValue) const
+{
+ data().strValue(os, aValue);
+}
+
+std::string Symbol::strValue(const BF & aValue) const
+{
+ return( data().strValue(aValue) );
+}
+
+std::string Symbol::strValue() const
+{
+ return( data().strValue() );
+}
+
+
+/**
+ * GETTER - SETTER
+ * mAttributeTable
+ */
+TableOfSymbol * Symbol::getAttribute() const
+{
+ return( data().getAttribute() );
+}
+
+const Symbol & Symbol::getAttributeByNameID(const std::string & id) const
+{
+ return( data().hasAttribute() ?
+ data().getAttribute()->getByNameID(id) : Symbol::REF_NULL );
+}
+
+bool Symbol::hasAttribute() const
+{
+ return( data().hasAttribute() );
+}
+
+void Symbol::setAttribute(TableOfSymbol * anAttributeTable)
+{
+ data().setAttribute( anAttributeTable );
+}
+
+void Symbol::setAttribute(avm_offset_t offset, const Symbol & aWProperty)
+{
+ data().setAttribute( offset , aWProperty );
+}
+
+
+/**
+ * GETTER - SETTER
+ * mRelativeDataPath
+ * mRelativeOffsetPath
+ */
+TableOfSymbol * Symbol::getDataPath() const
+{
+ return( data().getDataPath() );
+}
+
+bool Symbol::hasDataPath() const
+{
+ return( data().hasDataPath() );
+}
+
+void Symbol::setDataPath(TableOfSymbol & aRelativeDataPath)
+{
+ data().setDataPath( aRelativeDataPath );
+}
+
+
+avm_size_t * Symbol::getOffsetPath() const
+{
+ return( data().getOffsetPath() );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// InstanceOfMachine
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+InstanceOfMachine & Symbol::machine()
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "Unexpected a <null> pointer as InstanceOfMachine reference !!!"
+ << SEND_EXIT;
+
+ return( static_cast< InstanceOfMachine & >( *mPTR ) );
+}
+
+const InstanceOfMachine & Symbol::machine() const
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "Unexpected a <null> pointer as InstanceOfMachine reference !!!"
+ << SEND_EXIT;
+
+ return( static_cast< const InstanceOfMachine & >( *mPTR ) );
+}
+
+
+InstanceOfMachine * Symbol::rawMachine() const
+{
+ return( static_cast< InstanceOfMachine * >( mPTR ) );
+}
+
+/**
+ * GETTER
+ * Specifier
+ */
+const Specifier & Symbol::getSpecifier() const
+{
+ return( machine().getSpecifier() );
+}
+
+/**
+ * GETTER
+ * Compiled ObjectElement as Compiled Machine
+ */
+const Machine * Symbol::getAstMachine() const
+{
+ return( machine().getAstMachine() );
+}
+
+
+/**
+ * GETTER
+ * THIS
+ */
+bool Symbol::isThis() const
+{
+ return( machine().isThis() );
+}
+
+bool Symbol::isnotThis(const ExecutableForm * anExecutable) const
+{
+ return( machine().isnotThis( anExecutable ) );
+}
+
+/**
+ * GETTER - SETTER
+ * mExecutable
+ */
+ExecutableForm * Symbol::getExecutable() const
+{
+ return( machine().getExecutable() );
+}
+
+bool Symbol::hasExecutable() const
+{
+ return( machine().hasExecutable() );
+}
+
+void Symbol::setExecutable(ExecutableForm * anExecutable)
+{
+ machine().setExecutable( anExecutable );
+}
+
+/**
+ * GETTER - SETTER
+ * mInstanceModel
+ */
+InstanceOfMachine * Symbol::getInstanceModel() const
+{
+ return( machine().getInstanceModel() );
+}
+
+bool Symbol::hasInstanceModel() const
+{
+ return( machine().hasInstanceModel() );
+}
+
+bool Symbol::isInstanceModel(InstanceOfMachine * anInstanceModel) const
+{
+ return( machine().isInstanceModel(anInstanceModel) );
+}
+
+
+void Symbol::setInstanceModel(InstanceOfMachine * anInstanceModel)
+{
+ machine().setInstanceModel( anInstanceModel );
+}
+
+
+/**
+ * GETTER - SETTER
+ * mParam
+ * mParamReturnTable
+ * mReturnOffset
+ */
+bool Symbol::hasParam() const
+{
+ return( machine().hasParam() );
+}
+
+/**
+ * GETTER - SETTER
+ * mRuntimeRID
+ */
+const RuntimeID & Symbol::getRuntimeRID() const
+{
+ return( machine().getRuntimeRID() );
+}
+
+bool Symbol::hasRuntimeRID() const
+{
+ return( machine().hasRuntimeRID() );
+}
+
+void Symbol::setRuntimeRID(const RuntimeID & aRID)
+{
+ machine().setRuntimeRID( aRID );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// InstanceOfPort
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+InstanceOfPort & Symbol::port()
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "Unexpected a <null> pointer as InstanceOfPort reference !!!"
+ << SEND_EXIT;
+
+ return( static_cast< InstanceOfPort & >( *mPTR ) );
+}
+
+const InstanceOfPort & Symbol::port() const
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "Unexpected a <null> pointer as InstanceOfPort reference !!!"
+ << SEND_EXIT;
+
+ return( static_cast< const InstanceOfPort & >( *mPTR ) );
+}
+
+
+InstanceOfPort * Symbol::rawPort() const
+{
+ return( static_cast< InstanceOfPort * >( mPTR ) );
+}
+
+
+/**
+ * GETTER - SETTER
+ * mRouteOffset
+ */
+avm_size_t Symbol::getRouteOffset() const
+{
+ return( port().getRouteOffset() );
+}
+
+void Symbol::setRouteOffset(avm_size_t aRouteOffset)
+{
+ port().setRouteOffset( aRouteOffset );
+}
+
+/**
+ * GETTER - SETTER
+ * mInputRoutingData
+ * mOutputRoutingData
+ */
+const RoutingData & Symbol::getInputRoutingData() const
+{
+ return( port().getInputRoutingData() );
+}
+
+inline bool Symbol::hasInputRoutingData() const
+{
+ return( port().hasInputRoutingData() );
+}
+
+void Symbol::setInputRoutingData(const RoutingData & anInputRoutingData)
+{
+ port().setInputRoutingData( anInputRoutingData );
+}
+
+
+const RoutingData & Symbol::getOutputRoutingData() const
+{
+ return( port().getOutputRoutingData() );
+}
+
+bool Symbol::hasOutputRoutingData() const
+{
+ return( port().hasOutputRoutingData() );
+}
+
+void Symbol::setOutputRoutingData(const RoutingData & anOutputRoutingData)
+{
+ port().setOutputRoutingData( anOutputRoutingData );
+}
+
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/symbol/Symbol.h b/org.eclipse.efm.symbex/src/fml/symbol/Symbol.h
new file mode 100644
index 0000000..bb05b00
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/symbol/Symbol.h
@@ -0,0 +1,747 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 13 juin 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef SYMBOL_H_
+#define SYMBOL_H_
+
+#include <fml/common/BasePointer.h>
+#include <fml/type/TypeSpecifier.h>
+
+#include <collection/List.h>
+#include <collection/Vector.h>
+
+#include <fml/executable/BaseInstanceForm.h>
+
+#include <fml/lib/AvmLang.h>
+#include <fml/lib/ITypeSpecifier.h>
+
+
+
+#define AVM_DEBUG_SYMBOL_POINTER true
+#undef AVM_DEBUG_SYMBOL_POINTER
+
+#if defined(AVM_DEBUG_SYMBOL_POINTER)
+
+ #define AVM_DECLARE_DEBUG_SYMBOL_PTR const BaseInstanceForm * debugPTR;
+
+ #define AVM_INIT_DEBUG_SYMBOL_PTR( ptr ) , debugPTR( ptr )
+
+ #define AVM_ASSIGN_STMNT_DEBUG_SYMBOL_PTR( ptr ) debugPTR = ptr;
+
+ #define AVM_ASSIGN_EXPR_DEBUG_SYMBOL_PTR( ptr ) debugPTR = ptr
+
+#else
+
+ #define AVM_DECLARE_DEBUG_SYMBOL_PTR
+
+ #define AVM_INIT_DEBUG_SYMBOL_PTR( ptr )
+
+ #define AVM_ASSIGN_STMNT_DEBUG_SYMBOL_PTR( ptr )
+
+ #define AVM_ASSIGN_EXPR_DEBUG_SYMBOL_PTR( ptr ) ptr
+
+#endif
+
+
+
+
+namespace sep
+{
+
+
+class ArrayBF;
+class BF;
+class Specifier;
+class TableOfSymbol;
+class TypeSpecifier;
+
+class ComRouteData;
+
+class ExecutableForm;
+
+class InstanceOfBuffer;
+class InstanceOfConnect;
+class InstanceOfData;
+class InstanceOfMachine;
+class InstanceOfPort;
+
+class Machine;
+
+class RoutingData;
+
+
+class Symbol :
+ public BasePointer< BaseInstanceForm >,
+ public ITypeSpecifier,
+ public IPointerDataNature,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( Symbol )
+{
+
+private:
+ /**
+ * TYPEDEF
+ */
+ typedef BasePointer< BaseInstanceForm > base_this_type;
+
+
+public:
+ /**
+ * DEFAULT REF_NULL
+ */
+ static Symbol REF_NULL;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Symbol()
+ : base_this_type( )
+ {
+ //!!! NOTHING
+ }
+
+ explicit Symbol(BaseInstanceForm * anInstance)
+ : base_this_type( anInstance )
+ {
+ //!!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ Symbol(const Symbol & aSymbol)
+ : base_this_type( aSymbol )
+ {
+ //!! NOTHING
+ }
+
+ explicit Symbol(const BF & aSymbol)
+ : base_this_type( aSymbol )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Symbol()
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * GETTER
+ * pointer
+ */
+ inline pointer rawSymbol() const
+ {
+ return( static_cast< pointer >( mPTR ) );
+ }
+
+
+public:
+
+ /**
+ * ASSIGNMENT
+ * BF
+ */
+ Symbol & operator=(const BF & aSymbol);
+
+ Symbol & operator=(pointer aPtr)
+ {
+ if( mPTR != aPtr )
+ {
+ AVM_ASSIGN_DEBUG_BF_PTR( aPtr )
+
+ release( aPtr );
+ }
+ return( *this );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // BaseInstanceForm
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * GETTER - SETTER BaseAvmProgram * aContainer
+ * mContainer
+ */
+ inline BaseAvmProgram * getContainer() const
+ {
+ return( rawSymbol()->getContainer() );
+ }
+
+ inline void setContainer(ObjectElement * aContainer)
+ {
+ rawSymbol()->setContainer( aContainer );
+ }
+
+ /**
+ * GETTER - SETTER - TESTER
+ * mTypeSpecifier
+ */
+// inline virtual const TypeSpecifier & thisTypeSpecifier() const
+// {
+// return( rawSymbol()->thisTypeSpecifier() );
+// }
+//
+// inline virtual const TypeSpecifier & getTypeSpecifier() const
+// {
+// return( rawSymbol()->getTypeSpecifier() );
+// }
+
+ inline virtual const BaseTypeSpecifier * thisTypeSpecifier() const
+ {
+ return( rawSymbol()->thisTypeSpecifier() );
+ }
+
+ inline BaseTypeSpecifier * getTypeSpecifier() const
+ {
+ return( rawSymbol()->getTypeSpecifier() );
+ }
+
+ inline BaseTypeSpecifier * referedTypeSpecifier() const
+ {
+ return( rawSymbol()->referedTypeSpecifier() );
+ }
+
+ inline virtual avm_type_specifier_kind_t getTypeSpecifierKind() const
+ {
+ return( rawSymbol()->getTypeSpecifierKind() );
+ }
+
+ inline bool hasTypeSpecifier() const
+ {
+ return( rawSymbol()->hasTypeSpecifier() );
+ }
+
+
+ inline void setTypeSpecifier(BaseTypeSpecifier * aTypeSpecifier)
+ {
+ rawSymbol()->setTypeSpecifier( aTypeSpecifier );
+ }
+
+
+ inline bool isTypeFamily(avm_type_specifier_kind_t typeFamily)
+ {
+ return( rawSymbol()->isTypeFamily( typeFamily ) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mOffset
+ */
+ inline avm_offset_t getOffset() const
+ {
+ return( rawSymbol()->getOffset() );
+ }
+
+ inline void setOffset(avm_offset_t anOffset)
+ {
+ rawSymbol()->setOffset( anOffset );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mCreatorContainerID
+ */
+ inline const RuntimeID & getCreatorContainerRID() const
+ {
+ return( rawSymbol()->getCreatorContainerRID() );
+ }
+
+ inline bool hasCreatorContainerRID() const
+ {
+ return( rawSymbol()->hasCreatorContainerRID() );
+ }
+
+ inline void setCreatorContainerRID(const RuntimeID & aRID)
+ {
+ rawSymbol()->setCreatorContainerRID( aRID );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mRuntimeContainerID
+ */
+ inline const RuntimeID & getRuntimeContainerRID() const
+ {
+ return( rawSymbol()->getRuntimeContainerRID() );
+ }
+
+ inline bool hasRuntimeContainerRID() const
+ {
+ return( rawSymbol()->hasRuntimeContainerRID() );
+ }
+
+ inline void setRuntimeContainerRID(const RuntimeID & aRID)
+ {
+ rawSymbol()->setRuntimeContainerRID( aRID );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mRelativeMachinePath
+ */
+// inline void appendMachinePath(InstanceOfMachine * anInstance)
+// {
+// rawSymbol()->appendMachinePath(anInstance);
+// }
+
+ inline void appendMachinePath(ArrayOfInstanceOfMachine & aliasPath) const
+ {
+ rawSymbol()->appendMachinePath( aliasPath );
+ }
+
+ inline ArrayOfInstanceOfMachine * getMachinePath() const
+ {
+ return( rawSymbol()->getMachinePath() );
+ }
+
+ inline bool hasMachinePath() const
+ {
+ return( rawSymbol()->hasMachinePath() );
+ }
+
+
+ inline bool isAlias() const
+ {
+ return( rawSymbol()->isAlias() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mAliasTarget
+ */
+ inline BaseInstanceForm * getAliasTarget() const
+ {
+ return( rawSymbol()->getAliasTarget() );
+ }
+
+ inline bool hasAliasTarget() const
+ {
+ return( rawSymbol()->hasAliasTarget() );
+ }
+
+ inline void setAliasTarget(BaseInstanceForm * anAliasTarget)
+ {
+ rawSymbol()->setAliasTarget( anAliasTarget );
+ }
+
+ /**
+ * GETTER - SETTER
+ * mInstanciationCount
+ */
+ inline avm_uint32_t instanciationCountIncr() const
+ {
+ return( rawSymbol()->instanciationCountIncr() );
+ }
+
+ inline avm_uint32_t getInstanciationCount() const
+ {
+ return( rawSymbol()->getInstanciationCount() );
+ }
+
+ inline void setInstanciationCount(avm_uint32_t anIndex)
+ {
+ rawSymbol()->setInstanciationCount( anIndex );
+ }
+
+
+ /**
+ * is equals
+ */
+ inline virtual bool equals(BaseInstanceForm * anInstance) const
+ {
+ return( rawSymbol()->equals( anInstance ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // InstanceOfBuffer
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ InstanceOfBuffer & buffer();
+
+ const InstanceOfBuffer & buffer() const;
+
+ InstanceOfBuffer * rawBuffer() const;
+
+
+ /**
+ * GETTER - SETTER
+ * mPolicySpecifierKind
+ */
+ avm_type_specifier_kind_t getPolicySpecifierKind() const;
+
+ void setPolicySpecifierKind(avm_type_specifier_kind_t aSpecifierKind);
+
+ /**
+ * GETTER - SETTER
+ * mCapacity
+ */
+ avm_size_t capacity() const;
+
+ long realCapacity() const;
+
+ void setCapacity(long aCapacity);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // InstanceOfChannel
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ InstanceOfPort & channel();
+
+ const InstanceOfPort & channel() const;
+
+ InstanceOfPort * rawChannel() const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // InstanceOfConnect
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ InstanceOfConnect & connector();
+
+ const InstanceOfConnect & connector() const;
+
+ InstanceOfConnect * rawConnect() const;
+
+
+ /**
+ * GETTER - SETTER
+ * mOutputComRouteData
+ * mInputComRouteData
+ */
+ const ComRouteData & getOutputComRouteData() const;
+
+ const ComRouteData & getInputComRouteData() const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // InstanceOfData
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ InstanceOfData & data();
+
+ const InstanceOfData & data() const;
+
+ InstanceOfData * rawData() const;
+
+
+ /**
+ * SETTER
+ * mFullyQualifiedNameID
+ */
+ void updateFullyQualifiedNameID(
+ const std::string & aFullyQualifiedNameID,
+ const std::string & aNameID);
+
+ /**
+ * GETTER - SETTER
+ * mPointerNature
+ */
+ virtual POINTER_DATA_NATURE getPointerNature() const;
+
+
+ /**
+ * GETTER - SETTER
+ * mValue
+ */
+ BF & getValue();
+
+ const BF & getValue() const;
+
+ bool hasValue() const;
+
+ void setValue(const BF & aValue);
+
+ // ArrayValue
+ ArrayBF * getArrayValue() const;
+
+ bool hasArrayValue() const;
+
+
+ void formatStream(OutStream & os, const BF & aValue) const;
+
+ void strValue(OutStream & os, const BF & aValue) const;
+
+ std::string strValue(const BF & aValue) const;
+
+ std::string strValue() const;
+
+
+ /**
+ * GETTER - SETTER
+ * mAttributeTable
+ */
+ TableOfSymbol * getAttribute() const;
+
+ const Symbol & getAttributeByNameID(const std::string & id) const;
+
+ bool hasAttribute() const;
+
+ void setAttribute(TableOfSymbol * anAttributeTable);
+
+ void setAttribute(avm_offset_t offset, const Symbol & aWProperty);
+
+
+ /**
+ * GETTER - SETTER
+ * mRelativeDataPath
+ * mRelativeOffsetPath
+ */
+ TableOfSymbol * getDataPath() const;
+
+ bool hasDataPath() const;
+
+ void setDataPath(TableOfSymbol & aRelativeDataPath);
+
+ avm_size_t * getOffsetPath() const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // InstanceOfMachine
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ InstanceOfMachine & machine();
+
+ const InstanceOfMachine & machine() const;
+
+ InstanceOfMachine * rawMachine() const;
+
+
+ /**
+ * GETTER
+ * Specifier
+ */
+ const Specifier & getSpecifier() const;
+
+
+ /**
+ * GETTER
+ * Compiled ObjectElement as Compiled Machine
+ */
+ const Machine * getAstMachine() const;
+
+
+ /**
+ * GETTER
+ * THIS
+ */
+ bool isThis() const;
+
+ bool isnotThis(const ExecutableForm * anExecutable) const;
+
+ /**
+ * GETTER - SETTER
+ * mExecutable
+ */
+ ExecutableForm * getExecutable() const;
+
+ bool hasExecutable() const;
+
+ void setExecutable(ExecutableForm * anExecutable);
+
+ /**
+ * GETTER - SETTER
+ * mInstanceModel
+ */
+ InstanceOfMachine * getInstanceModel() const;
+
+ bool hasInstanceModel() const;
+
+ bool isInstanceModel(InstanceOfMachine * anInstanceModel) const;
+
+ void setInstanceModel(InstanceOfMachine * anInstanceModel);
+
+ /**
+ * GETTER - SETTER
+ * mParam
+ * mParamReturnTable
+ * mReturnOffset
+ */
+ bool hasParam() const;
+
+ /**
+ * GETTER - SETTER
+ * mRuntimeRID
+ */
+ const RuntimeID & getRuntimeRID() const;
+
+ bool hasRuntimeRID() const;
+
+ void setRuntimeRID(const RuntimeID & aRID);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // InstanceOfPort
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ InstanceOfPort & port();
+
+ const InstanceOfPort & port() const;
+
+ InstanceOfPort * rawPort() const;
+
+
+ /**
+ * GETTER - SETTER
+ * mRouteOffset
+ */
+ avm_size_t getRouteOffset() const;
+
+ void setRouteOffset(avm_size_t aRouteOffset);
+
+ /**
+ * GETTER - SETTER
+ * mInputRoutingData
+ * mOutputRoutingData
+ */
+ const RoutingData & getInputRoutingData() const;
+
+ bool hasInputRoutingData() const;
+
+ void setInputRoutingData(const RoutingData & anInputRoutingData);
+
+
+ const RoutingData & getOutputRoutingData() const;
+
+ bool hasOutputRoutingData() const;
+
+ void setOutputRoutingData(const RoutingData & anOutputRoutingData);
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Serialization
+ ////////////////////////////////////////////////////////////////////////////
+ inline virtual std::string strHeader() const
+ {
+ return( ( mPTR != NULL ) ?
+ rawSymbol()->strHeader() : "Symbol::header<null>" );
+ }
+
+ inline virtual void strHeader(OutStream & os) const
+ {
+ if( mPTR != NULL )
+ {
+ rawSymbol()->strHeader(os);
+ }
+ else
+ {
+ os << "Symbol::header<null>";
+ }
+ }
+
+ inline virtual void toStream(OutStream & os) const
+ {
+ if( mPTR != NULL )
+ {
+ rawSymbol()->toStream( os );
+ }
+ else
+ {
+ os << TAB << "Symbol::stream<null>" << EOL_FLUSH;
+ }
+ }
+
+ inline virtual void toFscn(OutStream & os) const
+ {
+ if( mPTR != NULL )
+ {
+ rawSymbol()->toFscn( os );
+ }
+ else
+ {
+ os << TAB << "Symbol::fscn<null>" << EOL_FLUSH;
+ }
+ }
+
+ inline virtual std::string toString(
+ const AvmIndent & indent = AVM_TAB_INDENT) const
+ {
+ StringOutStream oss(indent);
+
+ toStream( oss );
+
+ return( oss.str() );
+ }
+
+ inline virtual std::string str() const
+ {
+ return( ( mPTR != NULL ) ? rawSymbol()->str() : "Symbol::str<null>" );
+ }
+
+ inline virtual std::string strNum(
+ uint8_t precision = AVM_MUMERIC_PRECISION) const
+ {
+ return( ( mPTR != NULL ) ?
+ rawSymbol()->strNum(precision) : "Symbol::num<null>" );
+ }
+
+};
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// TYPEDEF FOR COLLECTION < Symbol >
+////////////////////////////////////////////////////////////////////////////////
+
+typedef List < Symbol > ListOfSymbol;
+typedef Vector < Symbol > VectorOfSymbol;
+
+
+/**
+ * operator<<
+ */
+AVM_OS_STREAM( Symbol )
+
+AVM_OS_STREAM_COLLECTION( ListOfSymbol )
+AVM_OS_STREAM_COLLECTION( VectorOfSymbol )
+
+
+
+} /* namespace sep */
+
+#endif /* SYMBOL_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/symbol/TableOfSymbol.cpp b/org.eclipse.efm.symbex/src/fml/symbol/TableOfSymbol.cpp
new file mode 100644
index 0000000..dc64c25
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/symbol/TableOfSymbol.cpp
@@ -0,0 +1,209 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 15 juin 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "TableOfSymbol.h"
+
+namespace sep
+{
+
+
+const Symbol & TableOfSymbol::getByFQNameID(
+ const std::string & aFullyQualifiedNameID) const
+{
+ ContainerOfSymbol::const_iterator it = ContainerOfSymbol::begin();
+ ContainerOfSymbol::const_iterator endIt = ContainerOfSymbol::end();
+ for( ; it != endIt ; ++it )
+ {
+ // STRICT:> compare LOCATOR & LOCATION [true:- retry only only LOCATION]
+ if( (*it).fqnEquals( aFullyQualifiedNameID , true ) )
+ {
+ return( *it );
+ }
+ }
+ return( Symbol::REF_NULL );
+}
+
+
+const Symbol & TableOfSymbol::getByQualifiedNameID(
+ const std::string & aQualifiedNameID) const
+{
+ ContainerOfSymbol::const_iterator it = ContainerOfSymbol::begin();
+ ContainerOfSymbol::const_iterator endIt = ContainerOfSymbol::end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).rawSymbol()->fqnEndsWith(aQualifiedNameID) )
+ {
+ return( *it );
+ }
+ }
+ return( Symbol::REF_NULL );
+}
+
+
+avm_size_t TableOfSymbol::getByQualifiedNameID(
+ const std::string & aQualifiedNameID, ListOfSymbol & listofFound) const
+{
+ avm_size_t count = 0;
+
+ ContainerOfSymbol::const_iterator it = ContainerOfSymbol::begin();
+ ContainerOfSymbol::const_iterator endIt = ContainerOfSymbol::end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).rawSymbol()->fqnEndsWith(aQualifiedNameID) )
+ {
+ listofFound.append( *it );
+
+ ++count;
+ }
+ }
+
+ return( count );
+}
+
+
+const Symbol & TableOfSymbol::getByNameID(const std::string & id) const
+{
+ ContainerOfSymbol::const_iterator it = ContainerOfSymbol::begin();
+ ContainerOfSymbol::const_iterator endIt = ContainerOfSymbol::end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).getNameID() == id )
+ {
+ return( *it );
+ }
+ }
+ return( Symbol::REF_NULL );
+}
+
+
+avm_size_t TableOfSymbol::getByNameID(
+ const std::string & id, ListOfSymbol & listofFound) const
+{
+ avm_size_t count = 0;
+
+ ContainerOfSymbol::const_iterator it = ContainerOfSymbol::begin();
+ ContainerOfSymbol::const_iterator endIt = ContainerOfSymbol::end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).getNameID() == id )
+ {
+ listofFound.append( *it );
+
+ ++count;
+ }
+ }
+
+ return( count );
+}
+
+
+const Symbol & TableOfSymbol::getByAstElement(
+ const ObjectElement * astElement) const
+{
+ ContainerOfSymbol::const_iterator it = ContainerOfSymbol::begin();
+ ContainerOfSymbol::const_iterator endIt = ContainerOfSymbol::end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).isAstElement( astElement ) )
+ {
+ return( *it );
+ }
+ }
+ return( Symbol::REF_NULL );
+}
+
+
+/**
+ * contains a particular element
+ */
+bool TableOfSymbol::contains(ConstPointerBaseT aSymbol) const
+{
+ if( (aSymbol->getOffset() < size())
+ && (get(aSymbol->getOffset()) == aSymbol) )
+ {
+ return( true );
+ }
+ else
+ {
+ ContainerOfSymbol::const_iterator it = BaseVector::begin();
+ ContainerOfSymbol::const_iterator endIt = BaseVector::end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it) == aSymbol )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+ }
+}
+
+
+bool TableOfSymbol::contains(const BF & aSymbol) const
+{
+ ContainerOfSymbol::const_iterator it = BaseVector::begin();
+ ContainerOfSymbol::const_iterator endIt = BaseVector::end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).rawSymbol() == aSymbol.raw_pointer() )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+
+
+/**
+ * Serialization
+ */
+void TableOfSymbol::strHeader(OutStream & os) const
+{
+ ContainerOfSymbol::const_iterator it = ContainerOfSymbol::begin();
+ ContainerOfSymbol::const_iterator endIt = ContainerOfSymbol::end();
+ for( ; it != endIt ; ++it )
+ {
+ (*it).strHeader( os << TAB ); os << EOL;
+ }
+}
+
+void TableOfSymbol::toStream(OutStream & os) const
+{
+ ContainerOfSymbol::const_iterator it = ContainerOfSymbol::begin();
+ ContainerOfSymbol::const_iterator endIt = ContainerOfSymbol::end();
+ for( ; it != endIt ; ++it )
+ {
+ (*it).toStream(os);
+ }
+}
+
+void TableOfSymbol::toFscn(OutStream & os) const
+{
+ ContainerOfSymbol::const_iterator it = ContainerOfSymbol::begin();
+ ContainerOfSymbol::const_iterator endIt = ContainerOfSymbol::end();
+ for( ; it != endIt ; ++it )
+ {
+ os << TAB << AVM_NO_INDENT;
+ (*it).toFscn(os);
+ os << END_INDENT_EOL;
+ }
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/symbol/TableOfSymbol.h b/org.eclipse.efm.symbex/src/fml/symbol/TableOfSymbol.h
new file mode 100644
index 0000000..d473b77
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/symbol/TableOfSymbol.h
@@ -0,0 +1,224 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 15 juin 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef TABLEOFSYMBOL_H_
+#define TABLEOFSYMBOL_H_
+
+#include <common/AvmObject.h>
+
+#include <collection/Vector.h>
+
+#include <fml/symbol/Symbol.h>
+#include <collection/List.h>
+
+
+namespace sep
+{
+
+
+class BF;
+
+class ObjectElement;
+
+
+class TableOfSymbol :
+ public AvmObject,
+ public VectorOfSymbol,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( TableOfSymbol )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( TableOfSymbol )
+
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef BaseInstanceForm * PointerBaseT;
+ typedef const BaseInstanceForm * ConstPointerBaseT;
+
+ typedef VectorOfSymbol ContainerOfSymbol;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TableOfSymbol()
+ : AvmObject( ),
+ ContainerOfSymbol( )
+ {
+ //!! NOTHING
+ }
+
+ TableOfSymbol(avm_size_t aSize)
+ : AvmObject( ),
+ ContainerOfSymbol( aSize )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ TableOfSymbol(const TableOfSymbol & aTable)
+ : AvmObject( aTable ),
+ ContainerOfSymbol( aTable )
+ {
+ //!! NOTHING
+ }
+
+ TableOfSymbol(const TableOfSymbol & aTable, const Symbol & lastSymbol)
+ : AvmObject( aTable ),
+ ContainerOfSymbol( aTable )
+ {
+ ContainerOfSymbol::push_back( lastSymbol );
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~TableOfSymbol()
+ {
+ //!! NOTHING
+ }
+
+
+ /*
+ ***************************************************************************
+ * GETTER
+ * iterator predecessor of end
+ ***************************************************************************
+ */
+ inline ContainerOfSymbol::iterator pred_end()
+ {
+ return( ContainerOfSymbol::empty() ? ContainerOfSymbol::end() :
+ --( ContainerOfSymbol::end() ) );
+ }
+
+ inline ContainerOfSymbol::const_iterator pred_end() const
+ {
+ return( ContainerOfSymbol::empty() ? ContainerOfSymbol::end() :
+ --( ContainerOfSymbol::end() ) );
+ }
+
+
+ /**
+ * GETTER
+ */
+ inline const Symbol & get(avm_size_t offset) const
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_OFFSET_EXIT( offset, ContainerOfSymbol::size() )
+ << "Unbound Symbol offset !!!" << std::endl << str_header( this )
+ << SEND_EXIT;
+
+ return( ContainerOfSymbol::at(offset) );
+ }
+
+
+ const Symbol & getByFQNameID(
+ const std::string & aFullyQualifiedNameID) const;
+
+
+ const Symbol & getByQualifiedNameID(
+ const std::string & aQualifiedNameID) const;
+
+ avm_size_t getByQualifiedNameID(
+ const std::string & aQualifiedNameID,
+ ListOfSymbol & listofFound) const;
+
+
+ const Symbol & getByNameID(const std::string & id) const;
+
+ avm_size_t getByNameID(
+ const std::string & id, ListOfSymbol & listofFound) const;
+
+
+ const Symbol & getByAstElement(const ObjectElement * objElement) const;
+
+
+ /**
+ * SAVE
+ * APPEND
+ */
+ inline const Symbol & save(PointerBaseT aSymbol)
+ {
+ ContainerOfSymbol::push_back( Symbol(aSymbol) );
+
+ return( ContainerOfSymbol::back() );
+ }
+
+ inline void append(const Symbol & aSymbol)
+ {
+ ContainerOfSymbol::append( aSymbol );
+ }
+
+ inline void append(const ListOfSymbol & dataList)
+ {
+ ContainerOfSymbol::append( dataList );
+ }
+
+ inline void append(const VectorOfSymbol & dataList)
+ {
+ ContainerOfSymbol::append( dataList );
+ }
+
+
+ /**
+ * SETTER
+ */
+ inline void set(avm_offset_t offset, const Symbol & aSymbol)
+ {
+ ContainerOfSymbol::set(offset, aSymbol);
+ }
+
+ inline void set(avm_offset_t offset, PointerBaseT aSymbol)
+ {
+ ContainerOfSymbol::set(offset, Symbol(aSymbol));
+ }
+
+
+ /**
+ * contains a particular element
+ */
+ bool contains(ConstPointerBaseT aSymbol) const;
+
+ bool contains(const Symbol & aSymbol) const
+ {
+ return( ContainerOfSymbol::contains(aSymbol) );
+ }
+
+ bool contains(const BF & aSymbol) const;
+
+
+ /**
+ * Serialization
+ */
+ virtual void strHeader(OutStream & os) const;
+
+ virtual void toStream(OutStream & os) const;
+
+ virtual void toFscn(OutStream & os) const;
+
+
+};
+
+
+} /* namespace sep */
+
+#endif /* TABLEOFSYMBOL_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/template/TemplateFactory.cpp b/org.eclipse.efm.symbex/src/fml/template/TemplateFactory.cpp
new file mode 100644
index 0000000..82cd9ca
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/template/TemplateFactory.cpp
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 nov. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "TemplateFactory.h"
+
+#include <fml/template/TimedMachine.h>
+
+#include <fml/infrastructure/Machine.h>
+
+
+namespace sep
+{
+
+
+void TemplateFactory::genProperty(Machine * machine)
+{
+ if( machine->getSpecifier().hasFeatureTimed() )
+ {
+ TimedMachine::genProperty(machine);
+ }
+}
+
+
+void TemplateFactory::genBehavior(Machine * machine)
+{
+ if( machine->getSpecifier().hasFeatureTimed() )
+ {
+ TimedMachine::genBehavior(machine);
+ }
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/template/TemplateFactory.h b/org.eclipse.efm.symbex/src/fml/template/TemplateFactory.h
new file mode 100644
index 0000000..b2a14ab
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/template/TemplateFactory.h
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 nov. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef TEMPLATEFACTORY_H_
+#define TEMPLATEFACTORY_H_
+
+namespace sep
+{
+
+class Machine;
+
+
+class TemplateFactory
+{
+
+public:
+ static void genProperty(Machine * machine);
+
+ static void genBehavior(Machine * machine);
+
+};
+
+} /* namespace sep */
+
+#endif /* TEMPLATEFACTORY_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/template/TimedMachine.cpp b/org.eclipse.efm.symbex/src/fml/template/TimedMachine.cpp
new file mode 100644
index 0000000..c8d218e
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/template/TimedMachine.cpp
@@ -0,0 +1,345 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 nov. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "TimedMachine.h"
+
+#include <parser/model/ParserUtil.h>
+
+#include <fml/expression/ExpressionConstant.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/StatementConstructor.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/type/TypeSpecifier.h>
+
+#include <fml/type/TypeManager.h>
+
+#include <fml/infrastructure/BehavioralPart.h>
+#include <fml/infrastructure/Machine.h>
+#include <fml/infrastructure/Routine.h>
+#include <fml/infrastructure/Variable.h>
+
+#include <fml/infrastructure/BehavioralPart.h>
+#include <fml/infrastructure/CompositePart.h>
+#include <fml/infrastructure/PropertyPart.h>
+
+
+namespace sep
+{
+
+std::string TimedMachine::VAR_ID_GLOBAL_TIME( "$time" );
+std::string TimedMachine::VAR_ID_DELTA_TIME ( "$delta" ); //"$time#delta"
+
+std::string TimedMachine::ROUTINE_ID_TIME_GET ( "time#get" );
+std::string TimedMachine::ROUTINE_ID_DELTA_GET( "delta#get" );
+
+std::string TimedMachine::ROUTINE_ID_TIME_RESET ( "time#reset" );
+
+std::string TimedMachine::ROUTINE_ID_CLOCK_RESET ( "clock#reset" );
+std::string TimedMachine::ROUTINE_ID_CLOCK_UPDATE( "clock#update" );
+
+Variable * TimedMachine::SYSTEM_VAR_GLOBAL_TIME = NULL;
+Variable * TimedMachine::SYSTEM_VAR_DELTA_TIME = NULL;
+
+
+void TimedMachine::genProperty(Machine * machine)
+{
+ PropertyPart & decl = machine->getPropertyPart();
+ Variable * aVar;
+
+ // TypeManager::UINTEGER/*TIME*/
+ TypeSpecifier timeType( TypeManager::newClockTime(
+ TYPE_TIME_SPECIFIER, TypeManager::UINTEGER) );
+
+ TypeSpecifier deltaType( TypeManager::newClockTime(
+ TYPE_TIME_SPECIFIER, TypeManager::POS_INTEGER) );
+
+ TypeSpecifier clockType( TypeManager::newClockTime(
+ TYPE_CLOCK_SPECIFIER, TypeManager::UINTEGER) );
+
+ Modifier mdfrTimed;
+ // GLOBAL_TIME
+ BF globalTimeVar = decl.saveOwnedVariable(
+ aVar = new Variable(machine,
+ mdfrTimed, timeType, VAR_ID_GLOBAL_TIME) );
+
+ if( machine->getSpecifier().isComponentSystem() )
+ {
+ SYSTEM_VAR_GLOBAL_TIME = aVar;
+ }
+
+
+ // DELTA_TIME
+ BF deltaTimeVar = decl.saveOwnedVariable(
+ aVar = new Variable(machine,
+ mdfrTimed.addFeatureKind(Modifier::FEATURE_UNSAFE_KIND),
+ deltaType, VAR_ID_DELTA_TIME) );
+
+ if( machine->getSpecifier().isComponentSystem() )
+ {
+ SYSTEM_VAR_DELTA_TIME = aVar;
+ }
+
+ // time & delta getters ;
+ // clock << reset & update >> routine macro
+ BehavioralPart * moe = machine->getUniqBehaviorPart();
+
+ Modifier mdfrParam(
+ Modifier::NATURE_PARAMETER_KIND,
+ Modifier::FEATURE_TRANSIENT_KIND );
+
+ Variable * param;
+
+ // time getter routine macro
+ Routine * timeGetter = Routine::newDefine(*moe, ROUTINE_ID_TIME_GET);
+ timeGetter->getwModifier().setNatureMacro(true);
+ moe->saveRoutine( timeGetter );
+
+ param = new Variable(timeGetter, mdfrParam, timeType, "_time_");
+ timeGetter->saveReturn(param);
+ timeGetter->setCode( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_RETURN, globalTimeVar ) );
+
+ // time getter routine macro
+ Routine * deltaGetter = Routine::newDefine(*moe, ROUTINE_ID_DELTA_GET);
+ deltaGetter->getwModifier().setNatureMacro(true);
+ moe->saveRoutine( deltaGetter );
+
+ param = new Variable(deltaGetter, mdfrParam, deltaType, "_delta_");
+ deltaGetter->saveReturn(param);
+ deltaGetter->setCode( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_RETURN, deltaTimeVar ) );
+
+
+ // global time << reset >> routine macro
+ Routine * timeReset = Routine::newDefine(*moe, ROUTINE_ID_TIME_RESET);
+ timeReset->getwModifier().setNatureMacro(true);
+ moe->saveRoutine( timeReset );
+
+ timeReset->setCode( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ASSIGN, globalTimeVar,
+ ExpressionConstant::INTEGER_ZERO ) );
+
+
+ // clock << reset >> routine macro
+ Routine * clockReset = Routine::newDefine(*moe, ROUTINE_ID_CLOCK_RESET);
+ clockReset->getwModifier().setNatureMacro(true);
+ moe->saveRoutine( clockReset );
+
+ param = new Variable(clockReset, mdfrParam, clockType, "_clock_");
+ clockReset->saveParameter( param );
+ clockReset->setCode( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ASSIGN, INCR_BF(param),
+ ExpressionConstant::INTEGER_ZERO ) );
+
+
+ // clock << update >> routine macro
+ Routine * clockUpdate = Routine::newDefine(*moe, ROUTINE_ID_CLOCK_UPDATE);
+ clockUpdate->getwModifier().setNatureMacro(true);
+ moe->saveRoutine( clockUpdate );
+
+ param = new Variable(clockUpdate, mdfrParam, clockType, "_clock_");
+ clockUpdate->saveParameter( param );
+ clockUpdate->setCode( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ASSIGN, INCR_BF(param),
+ ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_PLUS,
+ INCR_BF(param), INCR_BF(aVar)) ) );
+}
+
+
+
+void TimedMachine::genBehavior(Machine * machine)
+{
+ TimedMachine::genBehaviorInit(machine);
+
+ TimedMachine::genBehaviorIRun(machine);
+}
+
+
+void TimedMachine::genBehaviorInit(Machine * machine)
+{
+ BFCode initCurrentTime = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ASSIGN,
+ machine->getPropertyPart().
+ getVariables().getByNameID(VAR_ID_GLOBAL_TIME),
+ TypeManager::UINTEGER/*TIME*/.getDefaultValue()/*TIME*/);
+
+ BFCode initDeltaTime = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ASSIGN,
+ machine->getPropertyPart().
+ getVariables().getByNameID(VAR_ID_DELTA_TIME),
+ TypeManager::UINTEGER/*TIME*/.getDefaultValue());
+
+ machine->getUniqBehaviorPart()->setOnInit(
+ StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE,
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+ initCurrentTime, initDeltaTime),
+ machine->getUniqBehaviorPart()->getOnInit()) );
+}
+
+
+void TimedMachine::genBehaviorIRun(Machine * machine)
+{
+ BF varDeltaTime = machine->getPropertyPart().
+ getVariables().getByNameID(VAR_ID_DELTA_TIME);
+
+ BFCode newfreshDeltaTime = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ASSIGN_NEWFRESH, varDeltaTime );
+
+// Problème de scalabilite: passage à l'echelle ? est-ce utile ?
+// BFCode guardDeltaTime = StatementConstructor::newCode(
+// OperatorManager::OPERATOR_TIMED_GUARD,
+// ExpressionConstructor::newCode(
+// OperatorManager::OPERATOR_GT,
+// varDeltaTime, ExpressionConstant::INTEGER_ZERO) );
+
+// Problème de scalabilite: passage à l'echelle ? est-ce utile ?
+// BF varCurrentTime = machine->getPropertyPart().
+// getVariables().getByNameID(VAR_ID_GLOBAL_TIME);
+//
+// BFCode incrCurrentTime = StatementConstructor::newCode(
+// OperatorManager::OPERATOR_ASSIGN, varCurrentTime,
+// ExpressionConstructor::newCode(
+// OperatorManager::OPERATOR_PLUS,
+// varCurrentTime, varDeltaTime) );
+
+
+ BFCode updateTimeClock = StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ATOMIC_SEQUENCE,
+ newfreshDeltaTime/*, guardDeltaTime, incrCurrentTime*/);
+
+ updateClock(machine, machine, varDeltaTime, updateTimeClock);
+
+ machine->getUniqBehaviorPart()->setOnIRun(
+ StatementConstructor::xnewCodeFlat(
+ OperatorManager::OPERATOR_SEQUENCE, updateTimeClock,
+ machine->getUniqBehaviorPart()->getOnIRun()) );
+}
+
+
+void TimedMachine::updateClock(const Machine * modelMachine,
+ Machine * aMachine, const BF & varDeltaTime,
+ const BFCode & seqCode, const std::string & aQualifiedNameID)
+{
+ std::string aRelativeNameID = aQualifiedNameID.empty()
+ ? aMachine->getFullyQualifiedNameID()
+ : (aQualifiedNameID + "." + aMachine->getNameID());
+
+ updateClock(aMachine, modelMachine->getPropertyPart().getVariables(),
+ varDeltaTime, seqCode, aRelativeNameID);
+
+ CompositePart::const_machine_iterator itMachine =
+ modelMachine->getCompositePart()->machine_begin();
+ CompositePart::const_machine_iterator endMachine =
+ modelMachine->getCompositePart()->machine_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ if( (itMachine)->getSpecifier().isDesignPrototypeStatic() )
+ {
+ modelMachine = (itMachine);
+
+ }
+ else if( (itMachine)->getSpecifier().isDesignInstanceStatic() )
+ {
+ modelMachine = (itMachine)->getModelMachine();
+ }
+ else
+ {
+ modelMachine = NULL;
+ }
+
+ if( (modelMachine != NULL)
+ && (not modelMachine->getSpecifier().hasFeatureTimed())
+ && (modelMachine->getPropertyPart().hasVariable()
+ || modelMachine->hasMachine()) )
+ {
+ updateClock(modelMachine, (itMachine),
+ varDeltaTime, seqCode, aRelativeNameID);
+ }
+ }
+}
+
+void TimedMachine::updateClock(Machine * machine,
+ const TableOfVariable & variables, const BF & varDeltaTime,
+ const BFCode & seqCode, const std::string & aQualifiedNameID)
+{
+ BF varInstance;
+
+ TableOfVariable::const_raw_iterator itVar = variables.begin();
+ TableOfVariable::const_raw_iterator endvar = variables.end();
+ for( ; itVar != endvar ; ++itVar )
+ {
+ if( (itVar)->hasTypeSpecifier() &&
+ (itVar)->getTypeSpecifier()->isTypedClock() )
+ {
+ if( not (itVar)->getModifier().hasModifierPublicVolatile() )
+ {
+ (itVar)->getwModifier().setModifierPublicVolatile();
+ }
+
+ if( not (itVar)->hasValue() )
+ {
+ (itVar)->setValue(ExpressionConstant::INTEGER_ZERO);
+ }
+
+ if( (machine == (itVar)->getContainerMachine())
+ && (machine->getFullyQualifiedNameID() == aQualifiedNameID) )
+ {
+ varInstance = (*itVar);
+ }
+ else
+ {
+ varInstance = ExpressionConstructor::newQualifiedIdentifier(
+ aQualifiedNameID + "." + (itVar)->getNameID() );
+ }
+
+ BFCode updateCode(OperatorManager::OPERATOR_IF,
+ StatementConstructor::newCode(
+ OperatorManager::OPERATOR_STATUS_IS,
+ INCR_BF(OperatorManager::OPERATOR_SCHEDULE_INVOKE),
+ ExpressionConstructor::newQualifiedIdentifier(
+ aQualifiedNameID) ) );
+
+
+ Routine * updateClock =
+ machine->rawsemRoutineByNameID(ROUTINE_ID_CLOCK_UPDATE);
+ if( updateClock != NULL )
+ {
+// AVM_OS_COUT << EMPHASIS("ROUTINE_ID_CLOCK_UPDATE", '*', 42);
+ updateClock = Routine::newInvoke(machine, INCR_BF(updateClock));
+ updateClock->appendParameter( varInstance );
+
+ updateCode->append(ParserUtil::invokeRoutineStatement(updateClock));
+ }
+ else
+ {
+ updateCode->append( StatementConstructor::newCode(
+ OperatorManager::OPERATOR_ASSIGN, varInstance,
+ ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_PLUS,
+ varInstance, varDeltaTime) ) );
+ }
+
+ seqCode->append( updateCode );
+ }
+ }
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/template/TimedMachine.h b/org.eclipse.efm.symbex/src/fml/template/TimedMachine.h
new file mode 100644
index 0000000..fdfe6ea
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/template/TimedMachine.h
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 nov. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef TIMEDMACHINE_H_
+#define TIMEDMACHINE_H_
+
+#include <util/avm_string.h>
+
+#include <fml/infrastructure/Variable.h>
+
+
+namespace sep
+{
+
+class BF;
+class BFCode;
+
+class Machine;
+
+
+class TimedMachine
+{
+
+public:
+
+ static std::string VAR_ID_GLOBAL_TIME;
+ static std::string VAR_ID_DELTA_TIME;
+
+ static std::string ROUTINE_ID_TIME_GET;
+ static std::string ROUTINE_ID_DELTA_GET;
+
+ static std::string ROUTINE_ID_TIME_RESET;
+
+ static std::string ROUTINE_ID_CLOCK_RESET;
+ static std::string ROUTINE_ID_CLOCK_UPDATE;
+
+ static Variable * SYSTEM_VAR_GLOBAL_TIME;
+ static Variable * SYSTEM_VAR_DELTA_TIME;
+
+ static void genProperty(Machine * machine);
+
+ static void genBehavior(Machine * machine);
+ static void genBehaviorInit(Machine * machine);
+ static void genBehaviorIRun(Machine * machine);
+
+ static void updateClock(const Machine * modelMachine, Machine * machine,
+ const BF & varDeltaTime, const BFCode & seqCode,
+ const std::string & aQualifiedNameID = "");
+
+
+ static void updateClock(Machine * machine,
+ const TableOfVariable & variables, const BF & varDeltaTime,
+ const BFCode & seqCode, const std::string & aQualifiedNameID = "");
+};
+
+} /* namespace sep */
+
+#endif /* TIMEDMACHINE_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/trace/BasicTraceParser.cpp b/org.eclipse.efm.symbex/src/fml/trace/BasicTraceParser.cpp
new file mode 100644
index 0000000..0b3e7a8
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/trace/BasicTraceParser.cpp
@@ -0,0 +1,583 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 4 févr. 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "BasicTraceParser.h"
+
+#include <fstream>
+
+#include <fml/expression/ExpressionConstructor.h>
+
+#include <fml/executable/ExecutableQuery.h>
+#include <fml/executable/ExecutableSystem.h>
+#include <fml/executable/InstanceOfPort.h>
+
+#include <fml/symbol/Symbol.h>
+
+#include <fml/trace/TracePoint.h>
+#include <fml/trace/TraceSequence.h>
+
+#include <sew/Configuration.h>
+
+
+namespace sep
+{
+
+////////////////////////////////////////////////////////////////////////////////
+// OTHER API
+////////////////////////////////////////////////////////////////////////////////
+
+/*
+ * Exemple de trace basique
+1
+TSI_target?1
+120
+RSD_ENABLED_source!1
+0
+PSD_ENABLED_source!1
+423385
+RSD_CMD_source!1
+0
+PSD_STATE1_target?0
+3025646
+DEP_AUTH1_source!1
+1059822
+TSI1_target?0
+
+BASIC#XLIA:
+ INPUT env_connection_signal( )
+ OUTPUT env_enter_pin_message( )
+ INPUT env_user_pin( 3782 )
+ OUTPUT env_asked_withdrawal_message( )
+ INPUT env_asked_withdrawal( 5001 )
+ OUTPUT env_operation_not_possible( 2 , 5000 )
+*/
+
+bool BasicTraceParser::parseBasicXliaTrace(TraceSequence & aTraceElement,
+ std::ifstream & inFile, const BF & aVarTime)
+{
+ bool isOK = true;
+
+ //for debug purposes
+ bool isOKLine = true;
+ int cptLine = 0;
+
+ bfVarTime = aVarTime;
+
+ std::string inLine;
+
+ while( inFile.good() )
+ {
+ cptLine ++;
+
+ std::getline(inFile, inLine);
+
+ StringTools::ltrim( inLine );
+
+ if( (inLine == "\\n") || inLine.empty() )
+ {
+ // !!NOTHING: SKIP NEWLINE
+ isOKLine = true;
+ }
+ else if((inLine[0]) == '#')
+ {
+ // COMMENT
+ isOKLine = true;
+ }
+ else if( StringTools::startsWith(inLine, "delta") )
+ {
+ isOKLine = parseBasicXliaTraceDuration(aTraceElement, inLine, aVarTime);
+ }
+ else if( REGEX_STARTS(inLine, "(input|output|INPUT|OUTPUT)") )
+ {
+ isOKLine = parseBasicXliaTraceSignal(aTraceElement, inLine);
+ }
+
+ else if((inLine[0]) == '{')
+ {
+ isOKLine = parseBasicTraceStructure(aTraceElement, inLine);
+ }
+
+ isOK = isOKLine && isOK;
+
+ if(not isOKLine)
+ {
+ AVM_OS_WARN << "Error: Error while reading trace file on line "
+ << cptLine << ": " << inLine << std::endl;
+ }
+
+ }
+
+ return( isOK );
+}
+
+bool BasicTraceParser::parseBasicXliaTraceDuration(TraceSequence & aTraceElement,
+ const std::string & inLine, const BF & aVarTime)
+{
+
+ std::string::size_type pos = inLine.find('=');
+ std::string delta = inLine.substr(pos+1);
+ StringTools::ltrim( delta );
+
+ avm_integer_t duration;
+ if( from_string(delta, duration, std::dec) )
+ {
+ bfTP = new TracePoint(
+ ENUM_TRACE_POINT::TRACE_TIME_NATURE,
+ AVM_OPCODE_TIMED_GUARD, NULL,
+ aVarTime.to_ptr< InstanceOfData >(),
+ ExpressionConstructor::newInteger(duration) );
+
+ aTraceElement.points.append( bfTP );
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+bool BasicTraceParser::parseBasicXliaTraceSignal(
+ TraceSequence & aTraceElement, const std::string & inLine)
+{
+ bfTP = aTracePoint = new TracePoint(ENUM_TRACE_POINT::TRACE_COM_NATURE);
+
+ Modifier::DIRECTION_KIND ioDirection;
+
+ //std::string::size_type pos = inLine.find('?');
+ std::string message;
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_LOG << "PARSER : the message trace is >>" << inLine << "<<"
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ if( REGEX_STARTS(inLine, "(input|INPUT)") )
+ {
+ ioDirection = Modifier::DIRECTION_INPUT_KIND;
+ message = inLine.substr(6);
+ }
+ else if( REGEX_STARTS(inLine, "(output|OUTPUT)") )
+ {
+ ioDirection = Modifier::DIRECTION_OUTPUT_KIND;
+ message = inLine.substr(7);
+ }
+
+ message = StringTools::trim(message);
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_LOG << "PARSER : the message is >>" << message << "<<" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ std::string::size_type pos = message.find('(');
+ if( pos != std::string::npos )
+ {
+ ExecutableQuery XQuery( mConfiguration );
+
+ const Symbol & foundSignal =
+ XQuery.getPortByQualifiedNameID(
+ message.substr(0, pos), ioDirection, false );
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_LOG << "PARSER : the port is >>" << message.substr(0, pos) << "<<"
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ if( foundSignal.valid() )
+ {
+ InstanceOfPort* port = foundSignal.rawPort();
+ aTracePoint->object = port;
+
+
+ if( ioDirection == Modifier::DIRECTION_INPUT_KIND )
+ {
+ if( port->hasInputRoutingData() &&
+ port->getInputRoutingData().isProtocolENV() )
+ {
+ aTracePoint->op = AVM_OPCODE_INPUT_ENV;
+ }
+ else
+ {
+ aTracePoint->op = AVM_OPCODE_INPUT;
+ }
+
+ }
+ else if( ioDirection == Modifier::DIRECTION_OUTPUT_KIND )
+ {
+ if( port->hasOutputRoutingData() &&
+ port->getOutputRoutingData().isProtocolENV() )
+ {
+ aTracePoint->op = AVM_OPCODE_OUTPUT_ENV;
+ }
+ else
+ {
+ aTracePoint->op = AVM_OPCODE_OUTPUT;
+ }
+
+ }
+
+ //TODO : check what happens if there is no parameter given ()
+
+ if( parseBasicTraceSignalParameters(aTracePoint, port,
+ message.substr(pos + 1, message.size()-pos-2)) )
+ {
+ aTraceElement.points.append( bfTP );
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_LOG << "PARSER : and its parameters are >>"
+ << message.substr(pos + 1, message.size()-pos-2) << "<<"
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ return( true );
+ }
+ }
+ }
+
+ else
+ {
+ aTracePoint->value = ExpressionConstructor::newString(inLine);
+
+ aTraceElement.points.append( bfTP );
+ }
+
+ return( false );
+}
+
+
+
+bool BasicTraceParser::parseBasicTrace(TraceSequence & aTraceElement,
+ std::ifstream & inFile, const BF & aVarTime)
+{
+ bool isOK = true;
+
+ //for debug purposes
+ bool isOKLine = true;
+ int cptLine = 0;
+
+ bfVarTime = aVarTime;
+
+ std::string inLine;
+
+ while( inFile.good() )
+ {
+ cptLine ++;
+
+ std::getline(inFile, inLine);
+
+ StringTools::ltrim( inLine );
+
+ if( (inLine == "\\n") || inLine.empty() )
+ {
+ // !!NOTHING: SKIP NEWLINE
+ isOKLine = true;
+ }
+ else if((inLine[0]) == '#')
+ {
+ // COMMENT
+ isOKLine = true;
+ }
+ else if( std::isdigit(inLine[0]) )
+ {
+ isOKLine = parseBasicTraceDuration(aTraceElement, inLine, aVarTime);
+ }
+ else if( std::isalpha(inLine[0]) )
+ {
+ isOKLine = parseBasicTraceSignal(aTraceElement, inLine);
+ }
+
+ else if((inLine[0]) == '{')
+ {
+ isOKLine = parseBasicTraceStructure(aTraceElement, inLine);
+ }
+
+ isOK = isOKLine && isOK;
+
+ if(not isOKLine)
+ {
+ AVM_OS_WARN << "Error: Error while reading trace file on line "
+ << cptLine << std::endl;
+ }
+
+ }
+
+ return( isOK );
+}
+
+
+
+bool BasicTraceParser::parseBasicTraceDuration(TraceSequence & aTraceElement,
+ const std::string & inLine, const BF & aVarTime)
+{
+ avm_integer_t duration;
+ if( from_string(inLine, duration, std::dec) )
+ {
+ bfTP = new TracePoint(
+ ENUM_TRACE_POINT::TRACE_TIME_NATURE,
+ AVM_OPCODE_TIMED_GUARD, NULL,
+ aVarTime.to_ptr< InstanceOfData >(),
+ ExpressionConstructor::newInteger(duration) );
+
+ aTraceElement.points.append( bfTP );
+
+ return( true );
+ }
+
+ return( false );
+}
+
+bool BasicTraceParser::parseBasicTraceSignal(
+ TraceSequence & aTraceElement, const std::string & inLine)
+{
+ bfTP = aTracePoint = new TracePoint(ENUM_TRACE_POINT::TRACE_COM_NATURE);
+
+ Modifier::DIRECTION_KIND io_dir;
+
+ std::string::size_type pos = inLine.find('?');
+ if( pos != std::string::npos )
+ {
+ io_dir = Modifier::DIRECTION_INPUT_KIND;
+ aTracePoint->op = AVM_OPCODE_INPUT;
+ }
+ else if( (pos = inLine.find('!')) != std::string::npos )
+ {
+ io_dir = Modifier::DIRECTION_OUTPUT_KIND;
+ aTracePoint->op = AVM_OPCODE_OUTPUT;
+ }
+
+ if( pos != std::string::npos )
+ {
+ ExecutableQuery XQuery( mConfiguration );
+
+ const Symbol & foundSignal =
+ XQuery.getPortByQualifiedNameID(
+ inLine.substr(0, pos), io_dir, false );
+
+ if( foundSignal.valid() )
+ {
+ InstanceOfPort* port = foundSignal.rawPort();
+ aTracePoint->object = port;
+
+ if( parseBasicTraceSignalParameters(
+ aTracePoint, port, inLine.substr(pos + 1)))
+ {
+ aTraceElement.points.append( bfTP );
+
+ return( true );
+ }
+ }
+ }
+
+ else
+ {
+ aTracePoint->value = ExpressionConstructor::newString(inLine);
+
+ aTraceElement.points.append( bfTP );
+ }
+
+ return( false );
+}
+
+/*
+ * This method takes an inputs:
+ * a trace point, a port and a string expression
+ *
+ */
+bool BasicTraceParser::parseBasicTraceSignalParameters(
+ TracePoint * aTracePoint, InstanceOfPort* port,
+ const std::string & anExpr)
+{
+ std::string::size_type pos;
+ avm_size_t nbParams = port->getParameterCount();
+ avm_size_t count = 0;
+ //this variables is used to count the number of parameters given in the trace
+ std::string currentExpr = anExpr;
+
+ //TODO: do the verification on the number of parameters while parsing
+ // e.g. create an array with the parameter values
+ while ((pos = currentExpr.find(',') )!= std::string::npos)
+ {
+ currentExpr = currentExpr.substr(pos+1);
+ count++;
+ }
+
+ StringTools::trim(currentExpr);
+ if( currentExpr.compare("") != 0 )
+ {
+ count++;
+ }
+
+ if( count != port->getParameterCount() )
+ {
+ // if the number of parameters given in the trace does
+ // not match the declaration in the file specification
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ AVM_OS_LOG << "PARSER WARNING : the number of parameters expected "
+ "is " << nbParams << " while the actual number of parameters "
+ "given in the trace is " << count << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PROCESSOR )
+ return false;
+ }
+
+ if (nbParams != 0)
+ {
+ aTracePoint->newArrayValue(nbParams);
+ std::string param;
+ currentExpr = anExpr;
+ int i = 0;
+ bool correct = true;
+ //the correct number of parameters has already been ascertained
+ while (((pos = currentExpr.find(',')) != std::string::npos) && correct)
+ {
+ // retrieving parameter from the string
+ param = currentExpr.substr(0, pos);
+ BF paramBF = parseBasicTraceSignalParameter(
+ (* (port->getParameterType(i))), param);
+
+ if(paramBF == NULL)
+ {
+ return false;
+ }
+ else
+ {
+ aTracePoint->val(i, paramBF);
+ i++;
+ currentExpr = currentExpr.substr(pos+1);
+ }
+ }
+ param = StringTools::trim(currentExpr);
+ BF paramBF = parseBasicTraceSignalParameter(* port->getParameterType(i), param);
+ //BF paramBF = ExpressionConstructor::newExpr(* port->getParameterType(i), param);
+ if(paramBF == NULL)
+ {
+ return false;
+ }
+ else
+ {
+ aTracePoint->val(i, paramBF);
+ }
+ return true;
+ }
+ else
+ {
+ return true;
+ }
+ return true;
+}
+
+/*
+ * anExpr is the string representing the parameter to be parsed
+ * aTypeSpecifier is the type of the parameter
+ * returns a BF representing the parameter
+ */
+BF BasicTraceParser::parseBasicTraceSignalParameter(
+ const ITypeSpecifier & aTypeSpecifier, const std::string & anExpr)
+{
+ std::string param = anExpr;
+ StringTools::trim(param);
+
+ BF paramBF;
+
+//AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+// AVM_OS_LOG << "PARSER: parameter type: ";
+// aTypeSpecifier.toStream(AVM_OS_LOG);
+// AVM_OS_LOG << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+
+ // Removing encompassing quotes in strings before building
+ if( aTypeSpecifier.isTypedString()
+ && (not param.empty()) && (param[0] == '"') )
+ {
+ param = param.substr(1, param.size() - 2);
+
+ paramBF = ExpressionConstructor::newString(param);
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_LOG << "PARSER: reading a string: " << param << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ }
+
+ else if( aTypeSpecifier.isTypedCharacter() && (not param.empty()) )
+ {
+ if( param.size() == 1 )
+ {
+ paramBF = ExpressionConstructor::newChar(param[0]);
+ }
+ else if( param[0] == '\'' )
+ {
+ paramBF = ExpressionConstructor::newChar(param[1]);
+ }
+ else // ERROR !!!
+ {
+ paramBF = ExpressionConstructor::newChar(param[0]);
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_LOG << "PARSER: reading a string: " << param << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ }
+ // machines as parameters contain run and pid information,
+ // we must remove them (no configuration yet)
+ else if( aTypeSpecifier.isTypedMachine() )
+ {
+ if( StringTools::startsWith(param, "run::") )
+ {
+ std::string::size_type parampos = param.find(':', 5);
+ if( parampos != std::string::npos )
+ {
+ param = param.substr(parampos+1);
+ }
+
+ paramBF = ExpressionConstructor::newExprRuntine(mConfiguration, param);
+ }
+ else
+ {
+ paramBF = ExpressionConstructor::newExprMachine(mConfiguration, param);
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_LOG << "PARSER: reading a machine: " << param << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ }
+
+ else
+ {
+ paramBF = ExpressionConstructor::newExpr(
+ mConfiguration, aTypeSpecifier, param);
+ }
+
+ if( paramBF.invalid() )
+ {
+ AVM_OS_WARN << "PARSER: failed to build BF from parameter: "
+ << param << std::endl;
+ }
+ else
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ AVM_OS_LOG << "PARSER: parameter value read: " << paramBF << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PROCESSOR )
+ }
+
+ return paramBF;
+}
+
+
+bool BasicTraceParser::parseBasicTraceStructure(
+ TraceSequence & aTraceElement, const std::string & inLine)
+{
+ return( false );
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/trace/BasicTraceParser.h b/org.eclipse.efm.symbex/src/fml/trace/BasicTraceParser.h
new file mode 100644
index 0000000..fe7e882
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/trace/BasicTraceParser.h
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 4 févr. 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BASICTRACEPARSER_H_
+#define BASICTRACEPARSER_H_
+
+#include <util/avm_string.h>
+#include <common/BF.h>
+
+#include <fstream>
+
+
+namespace sep
+{
+
+
+class Configuration;
+class ITypeSpecifier;
+class InstanceOfPort;
+class TracePoint;
+class TraceSequence;
+
+
+class BasicTraceParser
+{
+
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ const Configuration & mConfiguration;
+
+ BF bfVarTime;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing Variables
+ BF bfTP;
+ TracePoint * aTracePoint;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BasicTraceParser(const Configuration & aConfiguration)
+ : mConfiguration( aConfiguration ),
+ bfVarTime( ),
+ bfTP( ),
+ aTracePoint( NULL )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BasicTraceParser()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // BASIC PARSER API
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool parseBasicTrace(TraceSequence & aTraceElement,
+ std::ifstream & inFile, const BF & aVarTime);
+
+ bool parseBasicTraceDuration(TraceSequence & aTraceElement,
+ const std::string & inLine, const BF & aVarTime);
+
+ bool parseBasicTraceSignal(
+ TraceSequence & aTraceElement, const std::string & inLine);
+
+ bool parseBasicTraceStructure(
+ TraceSequence & aTraceElement, const std::string & inLine);
+
+ bool parseBasicTraceSignalParameters(TracePoint * aTracePoint,
+ InstanceOfPort * port, const std::string & anExpr);
+
+ BF parseBasicTraceSignalParameter(const ITypeSpecifier & aTypeSpecifier,
+ const std::string & anExpr);
+
+// TODO : temporary, the format should be defined properly or fixed
+ bool parseBasicXliaTrace(TraceSequence & aTraceElement,
+ std::ifstream & inFile, const BF & aVarTime);
+
+ bool parseBasicXliaTraceDuration(TraceSequence & aTraceElement,
+ const std::string & inLine, const BF & aVarTime);
+
+ bool parseBasicXliaTraceSignal(
+ TraceSequence & aTraceElement, const std::string & inLine);
+};
+
+
+} /* namespace sep */
+
+#endif /* BASICTRACEPARSER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/trace/TraceChecker.cpp b/org.eclipse.efm.symbex/src/fml/trace/TraceChecker.cpp
new file mode 100644
index 0000000..733b8b0
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/trace/TraceChecker.cpp
@@ -0,0 +1,1285 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 27 nov. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "TraceChecker.h"
+
+#include <computer/EvaluationEnvironment.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/BuiltinArray.h>
+#include <fml/expression/ExpressionConstructorImpl.h>
+
+#include <fml/runtime/ExecutionConfiguration.h>
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/ExecutionData.h>
+#include <fml/trace/TracePoint.h>
+
+#include <solver/api/SolverFactory.h>
+
+
+namespace sep
+{
+
+
+/**
+ * TEST
+ * TracePoint Nature
+ */
+bool TraceChecker::isPointNature(const BF & arg,
+ ENUM_TRACE_POINT::TRACE_NATURE nature) const
+{
+ if( arg.is< TracePoint >() )
+ {
+ return( arg.to_ptr< TracePoint >()->nature == nature );
+ }
+
+ return( false );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// SAT CHECKING API
+////////////////////////////////////////////////////////////////////////////////
+
+bool TraceChecker::isSat(const ExecutionContext & anEC, const BF & arg)
+{
+ if( arg.is< TracePoint >() )
+ {
+ if( isSat(anEC, arg.to_ptr< TracePoint >()) )
+ {
+ return( true );
+ }
+ }
+ else if( arg.is< AvmCode >() )
+ {
+ return( isSat(anEC, arg.to_ref< AvmCode >()) );
+ }
+
+ return( false );
+}
+
+
+bool TraceChecker::isSat(const ExecutionContext & anEC, const AvmCode & aCode)
+{
+ switch( aCode.getAvmOpCode() )
+ {
+ case AVM_OPCODE_AND:
+ case AVM_OPCODE_STRONG_SYNCHRONOUS:
+ case AVM_OPCODE_AND_THEN:
+ case AVM_OPCODE_SCHEDULE_AND_THEN:
+ {
+ AvmCode::const_iterator it = aCode.begin();
+ AvmCode::const_iterator endIt = aCode.end();
+ for( ; it != endIt ; ++it )
+ {
+ if( not isSat(anEC, (*it)) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+
+ case AVM_OPCODE_OR:
+ case AVM_OPCODE_OR_ELSE:
+ case AVM_OPCODE_SCHEDULE_OR_ELSE:
+ case AVM_OPCODE_WEAK_SYNCHRONOUS:
+ {
+ AvmCode::const_iterator it = aCode.begin();
+ AvmCode::const_iterator endIt = aCode.end();
+ for( ; it != endIt ; ++it )
+ {
+ if( isSat(anEC, (*it)) )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+ }
+
+ case AVM_OPCODE_XOR:
+ case AVM_OPCODE_EXCLUSIVE:
+ {
+ avm_size_t passCount = 0;
+
+ AvmCode::const_iterator it = aCode.begin();
+ AvmCode::const_iterator endIt = aCode.end();
+ for( ; it != endIt ; ++it )
+ {
+ if( isSat(anEC, (*it)) )
+ {
+ if( ++passCount > 1 )
+ {
+ return( false );
+ }
+ }
+ }
+
+ return( passCount == 1 );
+ }
+
+
+ case AVM_OPCODE_NOT:
+ {
+ return( not isSat(anEC, aCode.first()) );
+ }
+
+
+ case AVM_OPCODE_NAND:
+ {
+ AvmCode::const_iterator it = aCode.begin();
+ AvmCode::const_iterator endIt = aCode.end();
+ for( ; it != endIt ; ++it )
+ {
+ if( not isSat(anEC, (*it)) )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+ }
+
+ case AVM_OPCODE_NOR:
+ {
+ AvmCode::const_iterator it = aCode.begin();
+ AvmCode::const_iterator endIt = aCode.end();
+ for( ; it != endIt ; ++it )
+ {
+ if( isSat(anEC, (*it)) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+
+ case AVM_OPCODE_XNOR:
+ {
+ avm_size_t passCount = 0;
+
+ AvmCode::const_iterator it = aCode.begin();
+ AvmCode::const_iterator endIt = aCode.end();
+ for( ; it != endIt ; ++it )
+ {
+ if( isSat(anEC, (*it)) )
+ {
+ if( ++passCount > 1 )
+ {
+ return( true );
+ }
+ }
+ }
+
+ return( passCount != 1 );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+bool TraceChecker::isSat(
+ const ExecutionContext & anEC, AVM_OPCODE anOp, const BF & arg)
+{
+ switch( anOp )
+ {
+ case AVM_OPCODE_AND:
+ case AVM_OPCODE_STRONG_SYNCHRONOUS:
+ case AVM_OPCODE_AND_THEN:
+ case AVM_OPCODE_SCHEDULE_AND_THEN:
+ {
+ ArrayBF * argArray = arg.to_ptr< ArrayBF >();
+ avm_size_t endOffset = argArray->size();
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ if( not isSat(anEC, argArray->at(offset)) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+
+ case AVM_OPCODE_OR:
+ case AVM_OPCODE_OR_ELSE:
+ case AVM_OPCODE_SCHEDULE_OR_ELSE:
+ case AVM_OPCODE_WEAK_SYNCHRONOUS:
+ {
+ ArrayBF * argArray = arg.to_ptr< ArrayBF >();
+ avm_size_t endOffset = argArray->size();
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ if( isSat(anEC, argArray->at(offset)) )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+ }
+
+ case AVM_OPCODE_XOR:
+ case AVM_OPCODE_EXCLUSIVE:
+ {
+ ArrayBF * argArray = arg.to_ptr< ArrayBF >();
+ avm_size_t endOffset = argArray->size();
+ avm_size_t passCount = 0;
+
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ if( isSat(anEC, argArray->at(offset)) )
+ {
+ if( ++passCount > 1 )
+ {
+ return( false );
+ }
+ }
+ }
+
+ return( passCount == 1 );
+ }
+
+
+ case AVM_OPCODE_NOT:
+ {
+ return( not isSat(anEC, arg) );
+ }
+
+
+ case AVM_OPCODE_NAND:
+ {
+ ArrayBF * argArray = arg.to_ptr< ArrayBF >();
+ avm_size_t endOffset = argArray->size();
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ if( not isSat(anEC, argArray->at(offset)) )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+ }
+
+ case AVM_OPCODE_NOR:
+ {
+ ArrayBF * argArray = arg.to_ptr< ArrayBF >();
+ avm_size_t endOffset = argArray->size();
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ if( isSat(anEC, argArray->at(offset)) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+
+ case AVM_OPCODE_XNOR:
+ {
+ avm_size_t passCount = 0;
+
+ ArrayBF * argArray = arg.to_ptr< ArrayBF >();
+ avm_size_t endOffset = argArray->size();
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ if( isSat(anEC, argArray->at(offset)) )
+ {
+ if( ++passCount > 1 )
+ {
+ return( true );
+ }
+ }
+ }
+
+ return( passCount != 1 );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+
+bool TraceChecker::isSat(const ExecutionContext & anEC, TracePoint * aTP)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , SOLVING )
+ AVM_OS_TRACE << "isSat ? EC:> " << anEC.str_min() << std::endl
+ << "Fired:> " << anEC.getRunnableElementTrace().str() << std::endl
+ << "Trace:> " << anEC.getIOElementTrace().str() << std::endl;
+ AVM_OS_TRACE << "Point:>" << str_indent( aTP ) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , SOLVING )
+
+
+ switch( aTP->nature )
+ {
+ case ENUM_TRACE_POINT::TRACE_FORMULA_NATURE:
+ case ENUM_TRACE_POINT::TRACE_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_DECISION_NATURE:
+
+ case ENUM_TRACE_POINT::TRACE_PATH_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_PATH_CONDITION_NATURE_LEAF:
+ case ENUM_TRACE_POINT::TRACE_PATH_TIMED_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_PATH_TIMED_CONDITION_NATURE_LEAF:
+
+ case ENUM_TRACE_POINT::TRACE_NODE_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_NODE_CONDITION_NATURE_LEAF:
+ case ENUM_TRACE_POINT::TRACE_NODE_TIMED_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_NODE_TIMED_CONDITION_NATURE_LEAF:
+ {
+ return( isSatFormula(anEC, aTP) );
+ }
+
+ case ENUM_TRACE_POINT::TRACE_TIME_NATURE:
+ {
+ if( aTP->op == AVM_OPCODE_ASSIGN_NEWFRESH )
+ {
+ return( isSatCom(anEC, aTP, anEC.getIOElementTrace()) );
+ }
+ else
+ {
+ return( isSatTime(anEC, aTP) );
+ }
+ }
+ case ENUM_TRACE_POINT::TRACE_VARIABLE_NATURE:
+ {
+ if( aTP->op == AVM_OPCODE_ASSIGN_NEWFRESH )
+ {
+ return( isSatCom(anEC, aTP, anEC.getIOElementTrace()) );
+ }
+ else
+ {
+ return( isSatVariable(anEC, aTP) );
+ }
+ }
+
+ case ENUM_TRACE_POINT::TRACE_COM_NATURE:
+ case ENUM_TRACE_POINT::TRACE_PORT_NATURE:
+ case ENUM_TRACE_POINT::TRACE_SIGNAL_NATURE:
+ case ENUM_TRACE_POINT::TRACE_MESSAGE_NATURE:
+ case ENUM_TRACE_POINT::TRACE_CHANNEL_NATURE:
+ {
+ return( isSatCom(anEC, aTP, anEC.getIOElementTrace()) );
+ }
+
+
+ case ENUM_TRACE_POINT::TRACE_RUNNABLE_NATURE:
+ {
+ return( isSatRunnable(anEC, aTP, anEC.getRunnableElementTrace()) );
+ }
+
+ case ENUM_TRACE_POINT::TRACE_ROUTINE_NATURE:
+ {
+ return( isSatRoutine(anEC, aTP, anEC.getRunnableElementTrace()) );
+ }
+
+ case ENUM_TRACE_POINT::TRACE_TRANSITION_NATURE:
+ {
+ return( isSatTransition(anEC, aTP, anEC.getRunnableElementTrace()) );
+ }
+
+ case ENUM_TRACE_POINT::TRACE_STATE_NATURE:
+ {
+ return( isSatState(anEC, aTP, anEC.getRunnableElementTrace()) );
+ }
+
+ case ENUM_TRACE_POINT::TRACE_STATEMACHINE_NATURE:
+ {
+ return( isSatStatemachine(anEC, aTP, anEC.getRunnableElementTrace()) );
+ }
+
+ case ENUM_TRACE_POINT::TRACE_MACHINE_NATURE:
+ {
+ return( isSatMachine(anEC, aTP, anEC.getRunnableElementTrace()) );
+ }
+
+
+ case ENUM_TRACE_POINT::TRACE_COMPOSITE_NATURE:
+ {
+ return( isSat(anEC, aTP->op, aTP->value) );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+bool TraceChecker::isSatFormula(const ExecutionContext & anEC, TracePoint * aTP)
+{
+ if( ENV.evalFormula(anEC, theLocalExecutableForm, aTP->value) )
+ {
+ ENV.outVAL = ExpressionConstructorNative::andExpr(
+ anEC.refExecutionData().getAllPathCondition(), ENV.outVAL );
+
+ return( SolverFactory::isStrongSatisfiable(theSolverKind, ENV.outVAL) );
+ }
+ else
+ {
+ return( false );
+ }
+}
+
+
+bool TraceChecker::isSatTime(const ExecutionContext & anEC, TracePoint * aTP)
+{
+ return( true );
+}
+
+bool TraceChecker::isSatVariable(const ExecutionContext & anEC, TracePoint * aTP)
+{
+ if( aTP->RID.invalid() )
+ {
+ aTP->updateRID( anEC.refExecutionData() );
+ }
+
+ if( ENV.eval(anEC.getAPExecutionData(),
+ anEC.refExecutionData().getSystemRID(), aTP->value) )
+ {
+ const BF & value = ( aTP->RID.valid() )
+ ? ENV.getRvalue( aTP->RID, aTP->object->to< InstanceOfData >() )
+ : ENV.getRvalue( aTP->object->to< InstanceOfData >() );
+
+ switch( aTP->op )
+ {
+ case AVM_OPCODE_SEQ:
+ {
+ return( ENV.outVAL.strEQ( value ) );
+ }
+
+ case AVM_OPCODE_CHECK_SAT:
+ {
+ if( ENV.outVAL.isEQ( value ) )
+ {
+ return( true );
+ }
+
+ if( aTP->object->to< InstanceOfData >()->isTypedBoolean() )
+ {
+ if( ENV.outVAL.isEqualTrue() )
+ {
+ ENV.outVAL = ExpressionConstructorNative::andExpr(
+ value,
+ anEC.refExecutionData().getAllPathCondition() );
+ }
+ else if( ENV.outVAL.isEqualFalse() )
+ {
+ ENV.outVAL = ExpressionConstructorNative::andExpr(
+ ExpressionConstructorNative::notExpr(value),
+ anEC.refExecutionData().getAllPathCondition() );
+ }
+ else
+ {
+ ENV.outVAL = ExpressionConstructorNative::andExpr(
+ ExpressionConstructorNative::eqExpr(ENV.outVAL, value),
+ anEC.refExecutionData().getAllPathCondition() );
+ }
+ }
+ else
+ {
+ ENV.outVAL = ExpressionConstructorNative::andExpr(
+ ExpressionConstructorNative::eqExpr(ENV.outVAL, value),
+ anEC.refExecutionData().getAllPathCondition() );
+ }
+
+ return( SolverFactory::isStrongSatisfiable(
+ theSolverKind, ENV.outVAL) );
+ }
+
+ case AVM_OPCODE_NOP:
+ case AVM_OPCODE_NULL:
+ {
+ return( true );
+ }
+
+ case AVM_OPCODE_EQ:
+ case AVM_OPCODE_ASSIGN:
+ default:
+ {
+ return( ENV.outVAL.isEQ( value ) );
+ }
+ }
+ }
+
+ return( false );
+}
+
+
+bool TraceChecker::isSatCom(
+ const ExecutionContext & anEC, TracePoint * aTP, const BF & aTrace)
+{
+ if( aTrace.invalid() )
+ {
+ return( false );
+ }
+ else if( aTrace.is< ExecutionConfiguration >() )
+ {
+ ExecutionConfiguration * aConf =
+ aTrace.to_ptr< ExecutionConfiguration >();
+
+ if( aConf->getCode().is< AvmCode >() )
+ {
+ AvmCode * ioCode = aConf->getCode().to_ptr< AvmCode >();
+
+ if( (aTP->object == NULL)
+ || (aTP->object == ioCode->first().raw_pointer()) )
+ {
+ switch( aTP->op )
+ {
+ case AVM_OPCODE_INPUT:
+ case AVM_OPCODE_INPUT_ENV:
+ case AVM_OPCODE_INPUT_FROM:
+ case AVM_OPCODE_INPUT_RDV:
+ case AVM_OPCODE_INPUT_MULTI_RDV:
+ case AVM_OPCODE_INPUT_BUFFER:
+
+ case AVM_OPCODE_OUTPUT:
+ case AVM_OPCODE_OUTPUT_ENV:
+ case AVM_OPCODE_OUTPUT_TO:
+ case AVM_OPCODE_OUTPUT_RDV:
+ case AVM_OPCODE_OUTPUT_MULTI_RDV:
+ case AVM_OPCODE_OUTPUT_BUFFER:
+ {
+// return( ioCode->isOpCode( aTP->op )
+// && ( (aTP->machine == NULL)
+// || (not aConf->hasRuntimeID())
+// || aConf->getRuntimeID().
+// hasAsAncestor(aTP->machine) ) );
+
+ if( ioCode->isOpCode( aTP->op ) )
+ {
+ if( (aTP->machine != NULL)
+ && aConf->hasRuntimeID() )
+ {
+ return( aConf->getRuntimeID().
+ hasAsAncestor(aTP->machine) );
+ }
+ return( true );
+ }
+ return( false );
+ }
+
+ case AVM_OPCODE_ASSIGN_NEWFRESH:
+ {
+ return( ioCode->isOpCode( aTP->op ) );
+ }
+
+ case AVM_OPCODE_NULL:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( aTP->op == ioCode->getOptimizedOpCode() );
+ }
+ }
+ }
+ }
+ }
+ else if( aTrace.is< AvmCode >() )
+ {
+ AvmCode * aCode = aTrace.to_ptr< AvmCode >();
+
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator endCode = aCode->end();
+ for( ; it != endCode ; ++it )
+ {
+ if( isSatCom(anEC, aTP, (*it)) )
+ {
+ return( true );
+ }
+ }
+ }
+
+ return( false );
+}
+
+
+bool TraceChecker::isSatRunnable(
+ const ExecutionContext & anEC, TracePoint * aTP, const BF & aTrace)
+{
+ if( aTrace.invalid() )
+ {
+ return( false );
+ }
+ else if( aTrace.is< ExecutionConfiguration >() )
+ {
+ ExecutionConfiguration * aConf =
+ aTrace.to_ptr< ExecutionConfiguration >();
+
+ if( aTP->object != NULL )
+ {
+ if( aConf->getCode().isnot< AvmProgram >() ||
+ (aConf->getCode().to_ptr< AvmProgram >() != aTP->object) )
+ {
+ return( false );
+ }
+ }
+ else if( aTP->op != AVM_OPCODE_NULL )
+ {
+ if( aConf->getCode().isnot< Operator >() ||
+ aConf->getOperator()->isnotOpCode(aTP->op) )
+ {
+ return( false );
+ }
+ }
+
+ RuntimeID aRID = aConf->getRuntimeID();
+ while( aRID.valid() && (aRID.getInstance() != aTP->machine) )
+ {
+ aRID = aRID.getPRID();
+ }
+
+ return( aRID.valid() );
+ }
+ else if( aTrace.is< AvmCode >() )
+ {
+ AvmCode * aCode = aTrace.to_ptr< AvmCode >();
+
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator endCode = aCode->end();
+ for( ; it != endCode ; ++it )
+ {
+ if( isSatMachine(anEC, aTP, (*it)) )
+ {
+ return( true );
+ }
+ }
+ }
+
+ return( false );
+}
+
+
+bool TraceChecker::isSatRoutine(
+ const ExecutionContext & anEC, TracePoint * aTP, const BF & aTrace)
+{
+ if( aTrace.invalid() )
+ {
+ return( false );
+ }
+ else if( aTrace.is< ExecutionConfiguration >() )
+ {
+ ExecutionConfiguration * aConf =
+ aTrace.to_ptr< ExecutionConfiguration >();
+
+ if( aTP->object != NULL )
+ {
+ if( aConf->getCode().isnot< AvmProgram >() ||
+ (aConf->getCode().to_ptr< AvmProgram >() != aTP->object) )
+ {
+ return( false );
+ }
+ }
+ else if( aTP->op != AVM_OPCODE_NULL )
+ {
+ if( aConf->getCode().isnot< Operator >() ||
+ aConf->getOperator()->isnotOpCode(aTP->op) )
+ {
+ return( false );
+ }
+ }
+
+ RuntimeID aRID = aConf->getRuntimeID();
+ while( aRID.valid() && (aRID.getInstance() != aTP->machine) )
+ {
+ aRID = aRID.getPRID();
+ }
+
+ return( aRID.valid() );
+ }
+ else if( aTrace.is< AvmCode >() )
+ {
+ AvmCode * aCode = aTrace.to_ptr< AvmCode >();
+
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator endCode = aCode->end();
+ for( ; it != endCode ; ++it )
+ {
+ if( isSatMachine(anEC, aTP, (*it)) )
+ {
+ return( true );
+ }
+ }
+ }
+
+ return( false );
+}
+
+
+bool TraceChecker::isSatTransition(
+ const ExecutionContext & anEC, TracePoint * aTP, const BF & aTrace)
+{
+ if( aTrace.invalid() )
+ {
+ return( false );
+ }
+ else if( aTrace.is< ExecutionConfiguration >() )
+ {
+ ExecutionConfiguration * aConf =
+ aTrace.to_ptr< ExecutionConfiguration >();
+
+ if( aConf->getCode().is< AvmTransition >() )
+ {
+ return( aTP->object == aConf->getCode().to_ptr< AvmTransition >() );
+ }
+ }
+ else if( aTrace.is< AvmCode >() )
+ {
+ AvmCode * aCode = aTrace.to_ptr< AvmCode >();
+
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator endCode = aCode->end();
+ for( ; it != endCode ; ++it )
+ {
+ if( isSatTransition(anEC, aTP, (*it)) )
+ {
+ return( true );
+ }
+ }
+ }
+
+ return( false );
+}
+
+
+bool TraceChecker::isSatState(
+ const ExecutionContext & anEC, TracePoint * aTP, const BF & aTrace)
+{
+ if( aTP->RID.invalid() )
+ {
+ aTP->updateRID( anEC.refExecutionData() );
+ }
+
+ if( aTP->RID.valid() )
+ {
+ return( anEC.refExecutionData().isIdleOrRunning(aTP->RID) );
+ }
+
+ return( isSatMachine(anEC, aTP, aTrace) );
+}
+
+
+bool TraceChecker::isSatStatemachine(
+ const ExecutionContext & anEC, TracePoint * aTP, const BF & aTrace)
+{
+ if( aTP->RID.invalid() )
+ {
+ aTP->updateRID( anEC.refExecutionData() );
+ }
+
+ if( aTP->RID.valid() )
+ {
+ return( anEC.refExecutionData().isIdleOrRunning(aTP->RID) );
+ }
+
+ return( isSatMachine(anEC, aTP, aTrace) );
+}
+
+
+bool TraceChecker::isSatMachine(
+ const ExecutionContext & anEC, TracePoint * aTP, const BF & aTrace)
+{
+ if( aTrace.invalid() )
+ {
+ return( false );
+ }
+ else if( aTrace.is< ExecutionConfiguration >() )
+ {
+ ExecutionConfiguration * aConf =
+ aTrace.to_ptr< ExecutionConfiguration >();
+
+ if( aConf->getCode().is< Operator >() )
+ {
+ if( aConf->getCode().to_ptr< Operator >()->
+ isOpCode( AVM_OPCODE_RUN ) )
+ {
+ RuntimeID aRID = aConf->getRuntimeID();
+ while( aRID.valid() && (aRID.getInstance() != aTP->object) )
+ {
+ aRID = aRID.getPRID();
+ }
+ return( aRID.valid() );
+ }
+ }
+ }
+ else if( aTrace.is< AvmCode >() )
+ {
+ AvmCode * aCode = aTrace.to_ptr< AvmCode >();
+
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator endCode = aCode->end();
+ for( ; it != endCode ; ++it )
+ {
+ if( isSatMachine(anEC, aTP, (*it)) )
+ {
+ return( true );
+ }
+ }
+ }
+
+ return( false );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// WILL NEVER SAT CHECKING API
+////////////////////////////////////////////////////////////////////////////////
+
+bool TraceChecker::willNeverSat(const ExecutionContext & anEC, const BF & arg)
+{
+ if( anEC.isRoot() )
+ {
+ return( false );
+ }
+
+ if( arg.is< TracePoint >() )
+ {
+ if( willNeverSat(anEC, arg.to_ptr< TracePoint >()) )
+ {
+ return( true );
+ }
+ }
+ else if( arg.is< AvmCode >() )
+ {
+ return( willNeverSat(anEC, arg.to_ptr< AvmCode >()) );
+ }
+
+ return( false );
+}
+
+
+bool TraceChecker::willNeverSat(const ExecutionContext & anEC, AvmCode * aCode)
+{
+ switch( aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_AND:
+ case AVM_OPCODE_STRONG_SYNCHRONOUS:
+ case AVM_OPCODE_AND_THEN:
+ case AVM_OPCODE_SCHEDULE_AND_THEN:
+ {
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator endIt = aCode->end();
+ for( ; it != endIt ; ++it )
+ {
+ if( not willNeverSat(anEC, (*it)) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+
+ case AVM_OPCODE_OR:
+ case AVM_OPCODE_OR_ELSE:
+ case AVM_OPCODE_SCHEDULE_OR_ELSE:
+ case AVM_OPCODE_WEAK_SYNCHRONOUS:
+ {
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator endIt = aCode->end();
+ for( ; it != endIt ; ++it )
+ {
+ if( willNeverSat(anEC, (*it)) )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+ }
+
+ case AVM_OPCODE_XOR:
+ {
+ avm_size_t passCount = 0;
+
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator endIt = aCode->end();
+ for( ; it != endIt ; ++it )
+ {
+ if( willNeverSat(anEC, (*it)) )
+ {
+ if( ++passCount > 1 )
+ {
+ return( false );
+ }
+ }
+ }
+
+ return( passCount == 1 );
+ }
+
+
+ case AVM_OPCODE_NOT:
+ {
+ return( not willNeverSat(anEC, aCode->first()) );
+ }
+
+
+ case AVM_OPCODE_NAND:
+ {
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator endIt = aCode->end();
+ for( ; it != endIt ; ++it )
+ {
+ if( not willNeverSat(anEC, (*it)) )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+ }
+
+ case AVM_OPCODE_NOR:
+ {
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator endIt = aCode->end();
+ for( ; it != endIt ; ++it )
+ {
+ if( willNeverSat(anEC, (*it)) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+
+ case AVM_OPCODE_XNOR:
+ {
+ avm_size_t passCount = 0;
+
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator endIt = aCode->end();
+ for( ; it != endIt ; ++it )
+ {
+ if( willNeverSat(anEC, (*it)) )
+ {
+ if( ++passCount > 1 )
+ {
+ return( true );
+ }
+ }
+ }
+
+ return( passCount != 1 );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+bool TraceChecker::willNeverSat(
+ const ExecutionContext & anEC, AVM_OPCODE anOp, const BF & arg)
+{
+ switch( anOp )
+ {
+ case AVM_OPCODE_AND:
+ case AVM_OPCODE_STRONG_SYNCHRONOUS:
+ case AVM_OPCODE_AND_THEN:
+ case AVM_OPCODE_SCHEDULE_AND_THEN:
+ {
+ ArrayBF * argArray = arg.to_ptr< ArrayBF >();
+ avm_size_t endOffset = argArray->size();
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ if( not willNeverSat(anEC, argArray->at(offset)) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+
+ case AVM_OPCODE_OR:
+ case AVM_OPCODE_OR_ELSE:
+ case AVM_OPCODE_SCHEDULE_OR_ELSE:
+ case AVM_OPCODE_WEAK_SYNCHRONOUS:
+ {
+ ArrayBF * argArray = arg.to_ptr< ArrayBF >();
+ avm_size_t endOffset = argArray->size();
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ if( willNeverSat(anEC, argArray->at(offset)) )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+ }
+
+ case AVM_OPCODE_XOR:
+ case AVM_OPCODE_EXCLUSIVE:
+ {
+ ArrayBF * argArray = arg.to_ptr< ArrayBF >();
+ avm_size_t endOffset = argArray->size();
+ avm_size_t passCount = 0;
+
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ if( willNeverSat(anEC, argArray->at(offset)) )
+ {
+ if( ++passCount > 1 )
+ {
+ return( false );
+ }
+ }
+ }
+
+ return( passCount == 1 );
+ }
+
+
+ case AVM_OPCODE_NOT:
+ {
+ return( not willNeverSat(anEC, arg) );
+ }
+
+
+ case AVM_OPCODE_NAND:
+ {
+ ArrayBF * argArray = arg.to_ptr< ArrayBF >();
+ avm_size_t endOffset = argArray->size();
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ if( not willNeverSat(anEC, argArray->at(offset)) )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+ }
+
+ case AVM_OPCODE_NOR:
+ {
+ ArrayBF * argArray = arg.to_ptr< ArrayBF >();
+ avm_size_t endOffset = argArray->size();
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ if( willNeverSat(anEC, argArray->at(offset)) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+
+ case AVM_OPCODE_XNOR:
+ {
+ avm_size_t passCount = 0;
+
+ ArrayBF * argArray = arg.to_ptr< ArrayBF >();
+ avm_size_t endOffset = argArray->size();
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ if( willNeverSat(anEC, argArray->at(offset)) )
+ {
+ if( ++passCount > 1 )
+ {
+ return( true );
+ }
+ }
+ }
+
+ return( passCount != 1 );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+bool TraceChecker::willNeverSat(const ExecutionContext & anEC, TracePoint * aTP)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , SOLVING )
+ AVM_OS_TRACE << "willNeverSat ? EC:> " << anEC.str_min() << std::endl
+ << "run#trace:> " << anEC.getRunnableElementTrace().str() << std::endl
+ << "io#race :> " << anEC.getIOElementTrace().str() << std::endl;
+ AVM_OS_TRACE << "Point:>" << str_indent( aTP ) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , SOLVING )
+
+
+ switch( aTP->nature )
+ {
+ case ENUM_TRACE_POINT::TRACE_PATH_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_PATH_CONDITION_NATURE_LEAF:
+ case ENUM_TRACE_POINT::TRACE_PATH_TIMED_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_PATH_TIMED_CONDITION_NATURE_LEAF:
+
+ case ENUM_TRACE_POINT::TRACE_NODE_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_NODE_CONDITION_NATURE_LEAF:
+ case ENUM_TRACE_POINT::TRACE_NODE_TIMED_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_NODE_TIMED_CONDITION_NATURE_LEAF:
+
+ case ENUM_TRACE_POINT::TRACE_FORMULA_NATURE:
+ case ENUM_TRACE_POINT::TRACE_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_DECISION_NATURE:
+
+ case ENUM_TRACE_POINT::TRACE_TIME_NATURE:
+ case ENUM_TRACE_POINT::TRACE_VARIABLE_NATURE:
+ case ENUM_TRACE_POINT::TRACE_COM_NATURE:
+ case ENUM_TRACE_POINT::TRACE_PORT_NATURE:
+ case ENUM_TRACE_POINT::TRACE_SIGNAL_NATURE:
+ case ENUM_TRACE_POINT::TRACE_MESSAGE_NATURE:
+ case ENUM_TRACE_POINT::TRACE_CHANNEL_NATURE:
+ {
+ return( false );
+ }
+
+
+ case ENUM_TRACE_POINT::TRACE_TRANSITION_NATURE:
+ {
+ return( willNeverSatTransition(anEC, aTP) );
+ }
+
+ case ENUM_TRACE_POINT::TRACE_STATE_NATURE:
+ {
+ return( willNeverSatState(anEC, aTP) );
+ }
+
+ case ENUM_TRACE_POINT::TRACE_STATEMACHINE_NATURE:
+ {
+ return( willNeverSatStatemachine(anEC, aTP) );
+ }
+
+ case ENUM_TRACE_POINT::TRACE_MACHINE_NATURE:
+ {
+ return( willNeverSatMachine(anEC, aTP) );
+ }
+
+ case ENUM_TRACE_POINT::TRACE_COMPOSITE_NATURE:
+ {
+ return( willNeverSat(anEC, aTP->op, aTP->value) );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+bool TraceChecker::willNeverSatTransition(
+ const ExecutionContext & anEC, TracePoint * aTP)
+{
+ ExecutableForm * sourceExecutable =
+ aTP->object->as< AvmTransition >()->getExecutableContainer();
+
+ if( not sourceExecutable->hasPossibleDynamicInstanciation() )
+ {
+ return( false );
+ }
+
+ TableOfRuntimeT::const_iterator itRF =
+ anEC.refExecutionData().getTableOfRuntime().begin();
+ TableOfRuntimeT::const_iterator endRF =
+ anEC.refExecutionData().getTableOfRuntime().end();
+ for( RuntimeID itRID ; itRF != endRF ; ++itRF )
+ {
+ itRID = (*itRF)->getRID();
+
+ if( anEC.refExecutionData().isIdleOrRunning(itRID) &&
+ itRID.getExecutable()->hasForwardReachableMachine() )
+ {
+ if( (sourceExecutable == itRID.getExecutable()) ||
+ sourceExecutable->getBackwardReachableMachine().
+ contains(itRID.getInstance()) )
+ {
+ return( false );
+ }
+ }
+ }
+
+ return( true );
+}
+
+bool TraceChecker::willNeverSatState(
+ const ExecutionContext & anEC, TracePoint * aTP)
+{
+ ExecutableForm * sourceExecutable =
+ aTP->object->as< InstanceOfMachine >()->getExecutable();
+
+ if( not sourceExecutable->hasSingleRuntimeInstance() )
+ {
+ return( false );
+ }
+
+ TableOfRuntimeT::const_iterator itRF =
+ anEC.refExecutionData().getTableOfRuntime().begin();
+ TableOfRuntimeT::const_iterator endRF =
+ anEC.refExecutionData().getTableOfRuntime().end();
+ for( RuntimeID itRID ; itRF != endRF ; ++itRF )
+ {
+ itRID = (*itRF)->getRID();
+
+ if( anEC.refExecutionData().isIdleOrRunning(itRID) &&
+ itRID.getExecutable()->hasForwardReachableMachine() )
+ {
+ if( (sourceExecutable == itRID.getExecutable()) ||
+ sourceExecutable->getBackwardReachableMachine().
+ contains(itRID.getInstance()) )
+ {
+ return( false );
+ }
+ }
+ }
+
+ return( false );
+}
+
+
+bool TraceChecker::willNeverSatStatemachine(
+ const ExecutionContext & anEC, TracePoint * aTP)
+{
+ return( willNeverSatState(anEC, aTP) );
+}
+
+
+bool TraceChecker::willNeverSatMachine(
+ const ExecutionContext & anEC, TracePoint * aTP)
+{
+ return( willNeverSatState(anEC, aTP) );
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/trace/TraceChecker.h b/org.eclipse.efm.symbex/src/fml/trace/TraceChecker.h
new file mode 100644
index 0000000..d95c12b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/trace/TraceChecker.h
@@ -0,0 +1,171 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 27 nov. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef TRACECHECKER_H_
+#define TRACECHECKER_H_
+
+#include <fml/operator/OperatorLib.h>
+
+#include <fml/lib/ITracePoint.h>
+
+#include <solver/api/SolverDef.h>
+
+
+namespace sep
+{
+
+class AvmCode;
+class BF;
+class EvaluationEnvironment;
+class ExecutableForm;
+class ExecutionContext;
+class TracePoint;
+
+
+
+class TraceChecker
+{
+
+protected:
+ EvaluationEnvironment & ENV;
+ ExecutableForm * theLocalExecutableForm;
+
+ SolverDef::SOLVER_KIND theSolverKind;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TraceChecker(EvaluationEnvironment & anENV)
+ : ENV( anENV ),
+ theLocalExecutableForm( NULL ),
+ theSolverKind( SolverDef::DEFAULT_SOLVER_KIND )
+ {
+ //!! NOTHING
+ }
+
+ TraceChecker(EvaluationEnvironment & anENV, SolverDef::SOLVER_KIND aSolver)
+ : ENV( anENV ),
+ theLocalExecutableForm( NULL ),
+ theSolverKind( aSolver )
+ {
+ //!! NOTHING
+ }
+
+ TraceChecker(EvaluationEnvironment & anENV, ExecutableForm * anExecutable)
+ : ENV( anENV ),
+ theLocalExecutableForm( anExecutable ),
+ theSolverKind( SolverDef::DEFAULT_SOLVER_KIND )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~TraceChecker()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * SETTER
+ * theSolverKind
+ */
+ void setSolverKind(SolverDef::SOLVER_KIND aSolverKind)
+ {
+ theSolverKind = aSolverKind;
+ }
+
+
+ /**
+ * TEST
+ * TracePoint Nature
+ */
+ bool isPointNature(const BF & arg,
+ ENUM_TRACE_POINT::TRACE_NATURE nature) const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SAT CHECKING API
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool isSat(const ExecutionContext & anEC, const BF & arg);
+ bool isSat(const ExecutionContext & anEC, const AvmCode & aCode);
+ bool isSat(const ExecutionContext & anEC, AVM_OPCODE anOp, const BF & arg);
+
+ bool isSat(const ExecutionContext & anEC, TracePoint * aTP);
+
+ bool isSatFormula(const ExecutionContext & anEC, TracePoint * aTP);
+
+ bool isSatTime(const ExecutionContext & anEC, TracePoint * aTP);
+ bool isSatVariable(const ExecutionContext & anEC, TracePoint * aTP);
+
+
+ bool isSatCom(const ExecutionContext & anEC,
+ TracePoint * aTP, const BF & aTrace);
+
+ bool isSatRunnable(const ExecutionContext & anEC,
+ TracePoint * aTP, const BF & aTrace);
+
+ bool isSatRoutine(const ExecutionContext & anEC,
+ TracePoint * aTP, const BF & aTrace);
+
+ bool isSatTransition(const ExecutionContext & anEC,
+ TracePoint * aTP, const BF & aTrace);
+
+ bool isSatState(const ExecutionContext & anEC,
+ TracePoint * aTP, const BF & aTrace);
+
+ bool isSatStatemachine(const ExecutionContext & anEC,
+ TracePoint * aTP, const BF & aTrace);
+
+ bool isSatMachine(const ExecutionContext & anEC,
+ TracePoint * aTP, const BF & aTrace);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // WILL NEVER SAT CHECKING API
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool willNeverSat(const ExecutionContext & anEC, const BF & arg);
+
+ bool willNeverSat(const ExecutionContext & anEC, AvmCode * aCode);
+
+ bool willNeverSat(
+ const ExecutionContext & anEC, AVM_OPCODE anOp, const BF & arg);
+
+ bool willNeverSat(const ExecutionContext & anEC, TracePoint * aTP);
+
+ bool willNeverSatTransition(
+ const ExecutionContext & anEC, TracePoint * aTP);
+
+ bool willNeverSatState(
+ const ExecutionContext & anEC, TracePoint * aTP);
+
+ bool willNeverSatStatemachine(
+ const ExecutionContext & anEC, TracePoint * aTP);
+
+ bool willNeverSatMachine(
+ const ExecutionContext & anEC, TracePoint * aTP);
+
+
+};
+
+} /* namespace sep */
+
+#endif /* TRACECHECKER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/trace/TraceFactory.cpp b/org.eclipse.efm.symbex/src/fml/trace/TraceFactory.cpp
new file mode 100644
index 0000000..536111a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/trace/TraceFactory.cpp
@@ -0,0 +1,1326 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 11 sept. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "TraceFactory.h"
+
+#include <fstream>
+
+#include <boost/algorithm/string.hpp>
+
+#include <builder/Builder.h>
+
+#include <computer/EvaluationEnvironment.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/BuiltinArray.h>
+
+#include <fml/executable/AvmTransition.h>
+#include <fml/executable/ExecutableQuery.h>
+#include <fml/executable/ExecutableSystem.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/trace/BasicTraceParser.h>
+#include <fml/trace/TracePoint.h>
+#include <fml/trace/TraceSequence.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <sew/Configuration.h>
+
+#include <util/avm_string.h>
+
+
+namespace sep
+{
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+
+/*
+ // Declaration part
+ section POINT
+ @assign = "sens";
+
+ @newfresh = "sens";
+
+ @signal#sens = "sens";
+
+ @port = "env";
+
+ @input = "env";
+ @output = "env";
+
+ @output = "Thermostat->dt";
+ @input = "Thermostat->equip";
+ @output2 = "Equipment->error";
+ endsection POINT
+
+ section TRACE
+ @trace = ${ && "signal#sens" "output2" };
+ @trace = [ "signal#sens" , "output2" ];
+ @point = ( "signal#sens" || "output2" );
+ @composite = ${ xor "signal#sens" "output2" };
+
+
+ @assign = "sens";
+
+ @newfresh = "sens";
+
+ @signal = "sens";
+
+ @port = "env";
+
+ @input = "env";
+ @output = "env";
+
+ @output = "Thermostat->dt";
+ @input = "Thermostat->equip";
+ @output = "Equipment->error";
+
+ @transition = "Thermostat->transition#2#MSGm1#in";
+ @routine = "Thermostat->transition#2#MSGm1#in";
+
+ @machine = "Thermostat";
+
+ @state = "Thermostat->s4";
+
+ @formula = <expression>;
+
+
+ endsection TRACE
+
+*/
+
+static ENUM_TRACE_POINT::TRACE_NATURE to_nature(const std::string & id)
+{
+ if( id.find("composite" ) == 0 ) return ENUM_TRACE_POINT::TRACE_COMPOSITE_NATURE;
+ if( id.find("comp" ) == 0 ) return ENUM_TRACE_POINT::TRACE_COMPOSITE_NATURE;
+ if( id.find("expression") == 0 ) return ENUM_TRACE_POINT::TRACE_COMPOSITE_NATURE;
+ if( id.find("expr" ) == 0 ) return ENUM_TRACE_POINT::TRACE_COMPOSITE_NATURE;
+ if( id.find("trace" ) == 0 ) return ENUM_TRACE_POINT::TRACE_COMPOSITE_NATURE;
+ if( id.find("point" ) == 0 ) return ENUM_TRACE_POINT::TRACE_COMPOSITE_NATURE;
+
+ if( id.find("com" ) == 0 ) return ENUM_TRACE_POINT::TRACE_COM_NATURE;
+ if( id.find("inout" ) == 0 ) return ENUM_TRACE_POINT::TRACE_COM_NATURE;
+
+ if( id.find("channel" ) == 0 ) return ENUM_TRACE_POINT::TRACE_CHANNEL_NATURE;
+
+ if( id.find("message" ) == 0 ) return ENUM_TRACE_POINT::TRACE_MESSAGE_NATURE;
+
+ if( id.find("port" ) == 0 ) return ENUM_TRACE_POINT::TRACE_PORT_NATURE;
+
+ if( id.find("signal" ) == 0 ) return ENUM_TRACE_POINT::TRACE_SIGNAL_NATURE;
+
+ if( id.find("time" ) == 0 ) return ENUM_TRACE_POINT::TRACE_TIME_NATURE;
+
+ if( id.find("var" ) == 0 ) return ENUM_TRACE_POINT::TRACE_VARIABLE_NATURE;
+ if( id.find("variable" ) == 0 ) return ENUM_TRACE_POINT::TRACE_VARIABLE_NATURE;
+// if( id.find("assign" ) == 0 ) return ENUM_TRACE_POINT::TRACE_VARIABLE_NATURE;
+// if( id.find("newfresh" ) == 0 ) return ENUM_TRACE_POINT::TRACE_VARIABLE_NATURE;
+
+ if( id.find("buffer" ) == 0 ) return ENUM_TRACE_POINT::TRACE_BUFFER_NATURE;
+
+ if( id.find("formula" ) == 0 ) return ENUM_TRACE_POINT::TRACE_FORMULA_NATURE;
+ if( id.find("condition" ) == 0 ) return ENUM_TRACE_POINT::TRACE_CONDITION_NATURE;
+ if( id.find("decision" ) == 0 ) return ENUM_TRACE_POINT::TRACE_DECISION_NATURE;
+
+ if( REGEX_MATCH(id, CONS_WID2("path", "condition")) ) {
+ return ENUM_TRACE_POINT::TRACE_PATH_CONDITION_NATURE;
+ }
+ if( REGEX_MATCH(id, CONS_WID2("node", "condition")) ) {
+ return ENUM_TRACE_POINT::TRACE_NODE_CONDITION_NATURE;
+ }
+
+ if( REGEX_MATCH(id, CONS_WID3("path", "condition", "leaf")) ) {
+ return ENUM_TRACE_POINT::TRACE_PATH_CONDITION_NATURE_LEAF;
+ }
+ if( REGEX_MATCH(id, CONS_WID3("node", "condition", "leaf")) ) {
+ return ENUM_TRACE_POINT::TRACE_NODE_CONDITION_NATURE_LEAF;
+ }
+
+ if( REGEX_MATCH(id, CONS_WID3("path", "timed", "condition")) ) {
+ return ENUM_TRACE_POINT::TRACE_PATH_TIMED_CONDITION_NATURE;
+ }
+ if( REGEX_MATCH(id, CONS_WID3("node", "timed", "condition")) ) {
+ return ENUM_TRACE_POINT::TRACE_NODE_TIMED_CONDITION_NATURE;
+ }
+
+ if( REGEX_MATCH(id, CONS_WID4(
+ "path", "timed", "condition", "(leaf|end|last|tail)")) ) {
+ return ENUM_TRACE_POINT::TRACE_PATH_TIMED_CONDITION_NATURE_LEAF;
+ }
+ if( REGEX_MATCH(id, CONS_WID4(
+ "node", "timed", "condition", "(leaf|end|last|tail)")) ) {
+ return ENUM_TRACE_POINT::TRACE_NODE_TIMED_CONDITION_NATURE_LEAF;
+ }
+
+ if( id.find("statemachine") == 0 ) return ENUM_TRACE_POINT::TRACE_STATEMACHINE_NATURE;
+ if( id.find("machine") == 0 ) return ENUM_TRACE_POINT::TRACE_MACHINE_NATURE;
+ if( id.find("state" ) == 0 ) return ENUM_TRACE_POINT::TRACE_STATE_NATURE;
+
+
+ if( id.find("transition") == 0 ) return ENUM_TRACE_POINT::TRACE_TRANSITION_NATURE;
+ if( id.find("routine" ) == 0 ) return ENUM_TRACE_POINT::TRACE_ROUTINE_NATURE;
+
+ if( id.find("runnable" ) == 0 ) return ENUM_TRACE_POINT::TRACE_RUNNABLE_NATURE;
+
+ if( REGEX_MATCH(id, CONS_WID2("step", "header")) ) {
+ return ENUM_TRACE_POINT::TRACE_STEP_HEADER_NATURE;
+ }
+ if( REGEX_MATCH(id, CONS_WID2("step", "begin" )) ) {
+ return ENUM_TRACE_POINT::TRACE_STEP_BEGIN_NATURE;
+ }
+ if( REGEX_MATCH(id, CONS_WID2("step", "end" )) ) {
+ return ENUM_TRACE_POINT::TRACE_STEP_END_NATURE;
+ }
+
+ if( REGEX_MATCH(id, CONS_WID2("init", "header")) ) {
+ return ENUM_TRACE_POINT::TRACE_INIT_HEADER_NATURE;
+ }
+ if( REGEX_MATCH(id, CONS_WID2("init", "begin" )) ) {
+ return ENUM_TRACE_POINT::TRACE_INIT_BEGIN_NATURE;
+ }
+ if( REGEX_MATCH(id, CONS_WID2("init", "end" )) ) {
+ return ENUM_TRACE_POINT::TRACE_INIT_END_NATURE;
+ }
+
+ if( id.find("comment" ) == 0 ) return ENUM_TRACE_POINT::TRACE_COMMENT_NATURE;
+ if( id.find("separator") == 0 ) return ENUM_TRACE_POINT::TRACE_SEPARATOR_NATURE;
+ if( id.find("newline" ) == 0 ) return ENUM_TRACE_POINT::TRACE_NEWLINE_NATURE;
+
+// if( not id.empty() ) return ENUM_TRACE_POINT::TRACE_COMPOSITE_NATURE;
+
+ return ENUM_TRACE_POINT::TRACE_UNDEFINED_NATURE;
+}
+
+
+static AVM_OPCODE to_op(const std::string & id)
+{
+ if( id.find("time" ) == 0 ) return AVM_OPCODE_TIMED_GUARD;
+
+ if( id.find("formula" ) == 0 ) return AVM_OPCODE_GUARD;
+ if( id.find("guard" ) == 0 ) return AVM_OPCODE_GUARD;
+
+ if( REGEX_MATCH(id,"check.sat") ) return AVM_OPCODE_CHECK_SAT;
+
+ if( id.find("assign" ) == 0 ) return AVM_OPCODE_ASSIGN;
+ if( id.find("newfresh" ) == 0 ) return AVM_OPCODE_ASSIGN_NEWFRESH;
+
+ if( REGEX_MATCH(id, CONS_WID2("input", "env")) ) return AVM_OPCODE_INPUT_ENV;
+ if( REGEX_MATCH(id, CONS_WID2("input", "rdv")) ) return AVM_OPCODE_INPUT_RDV;
+
+ if( id.find("input" ) == 0 ) return AVM_OPCODE_INPUT;
+
+ if( REGEX_MATCH(id, CONS_WID2("output", "env")) ) return AVM_OPCODE_OUTPUT_ENV;
+ if( REGEX_MATCH(id, CONS_WID2("output", "rdv")) ) return AVM_OPCODE_OUTPUT_RDV;
+
+ if( id.find("output" ) == 0 ) return AVM_OPCODE_OUTPUT;
+
+ return AVM_OPCODE_NULL;
+}
+
+
+bool TraceFactory::configure(
+ TraceSequence & aTraceElement, const ExecutionData * anED)
+{
+ WObject * thePOINT = Query::getRegexWSequence(
+ mParameterWObject, OR_WID2("point", "POINT"));
+ if( (thePOINT != WObject::_NULL_) && thePOINT->hasOwnedElement() )
+ {
+// if( configure(thePOINT, mDeclaredPoint, anED) )
+// {
+// //!! NOTHING
+// }
+ mED = anED;
+
+ WObject::const_iterator itWfO = thePOINT->owned_begin();
+ WObject::const_iterator endWfO = thePOINT->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty() )
+ {
+ if( configure(mDeclaredPoint, *itWfO) )
+ {
+ mDeclaredPointID.append( (*itWfO)->getNameID() );
+
+ if( mDeclaredPoint.size() != mDeclaredPointID.size() )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "TracePoint Declaration Error !!!"
+ << SEND_EXIT;
+ }
+ }
+ }
+ }
+ }
+
+ WObject * theTRACE = Query::getRegexWSequence(
+ mParameterWObject, OR_WID2("trace", "TRACE"));
+ if( (theTRACE != WObject::_NULL_) && theTRACE->hasOwnedElement() )
+ {
+ if( configure(theTRACE, aTraceElement, anED) )
+ {
+ //!! NOTHING
+ }
+ }
+
+ return( true );
+}
+
+
+bool TraceFactory::configure(
+ AvmCode * aTraceExpression, const ExecutionData * anED)
+{
+ WObject * thePOINT = Query::getRegexWSequence(
+ mParameterWObject, OR_WID2("point", "POINT"));
+ if( (thePOINT != WObject::_NULL_) && thePOINT->hasOwnedElement() )
+ {
+ mED = anED;
+
+ WObject::const_iterator itWfO = thePOINT->owned_begin();
+ WObject::const_iterator endWfO = thePOINT->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty() )
+ {
+ if( configure(mDeclaredPoint, *itWfO) )
+ {
+ mDeclaredPointID.append( (*itWfO)->getNameID() );
+
+ if( mDeclaredPoint.size() != mDeclaredPointID.size() )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "TracePoint Declaration Error !!!"
+ << SEND_EXIT;
+ }
+ }
+ }
+ }
+ }
+
+ WObject * theTRACE = Query::getRegexWSequence(
+ mParameterWObject, OR_WID2("trace", "TRACE"));
+ if( (theTRACE != WObject::_NULL_) && theTRACE->hasOwnedElement() )
+ {
+ if( configure(theTRACE, aTraceExpression, anED) )
+ {
+ //!! NOTHING
+ }
+ }
+
+ return( true );
+}
+
+
+bool TraceFactory::configure(WObject * aTraceSequence,
+ BFCollection & tracePoints, const ExecutionData * anED)
+{
+ if( aTraceSequence == WObject::_NULL_ )
+ {
+ return( false );
+ }
+ else if( aTraceSequence->hasnoOwnedElement() )
+ {
+ return( true );
+ }
+
+ mED = anED;
+
+ WObject::const_iterator itWfO = aTraceSequence->owned_begin();
+ WObject::const_iterator endWfO = aTraceSequence->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty() )
+ {
+ if( configure(tracePoints, *itWfO ) )
+ {
+ //!! NOTHING
+ }
+ }
+ }
+
+ return( true );
+}
+
+
+bool TraceFactory::configure(WObject * aTraceSequence,
+ TraceSequence & aTraceElement, const ExecutionData * anED)
+{
+ if( aTraceSequence == NULL )
+ {
+ return( false );
+ }
+ else if( aTraceSequence->hasnoOwnedElement() )
+ {
+ return( true );
+ }
+
+ mED = anED;
+
+ WObject::const_iterator itWfO = aTraceSequence->owned_begin();
+ WObject::const_iterator endWfO = aTraceSequence->owned_end();
+
+ if( (*itWfO)->isWProperty() )
+ {
+ if( (*itWfO)->getNameID() == "combinator" )
+ {
+ aTraceElement.combinator = OperatorManager::toOperator(
+ (*itWfO)->toStringValue(),
+ OperatorManager::OPERATOR_OR );
+
+ ++itWfO;
+ }
+ }
+
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty() )
+ {
+ if( configure(aTraceElement.points, *itWfO ) )
+ {
+ //!! NOTHING
+ }
+ }
+ }
+
+ return( true );
+}
+
+
+bool TraceFactory::configure(WObject * aTraceSequence,
+ AvmCode * aTraceExpression, const ExecutionData * anED)
+{
+ if( aTraceSequence == NULL )
+ {
+ return( false );
+ }
+ else if( aTraceSequence->hasnoOwnedElement() )
+ {
+ return( true );
+ }
+
+ mED = anED;
+
+ WObject::const_iterator itWfO = aTraceSequence->owned_begin();
+ WObject::const_iterator endWfO = aTraceSequence->owned_end();
+
+ if( (*itWfO)->isWProperty() )
+ {
+ if( (*itWfO)->getNameID() == "combinator" )
+ {
+// aTraceExpression->setOperator( OperatorManager::toOperator(
+// wfProperty->toStringValue(), OperatorManager::OPERATOR_OR) );
+
+ AvmCode * subFTP = new AvmCode( OperatorManager::toOperator(
+ (*itWfO)->toStringValue(),OperatorManager::OPERATOR_OR) );
+ aTraceExpression->append( BF(subFTP) );
+ aTraceExpression = subFTP;
+
+ ++itWfO;
+ }
+ }
+
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty() )
+ {
+ if( (*itWfO)->getNameID() == "combinator" )
+ {
+ AvmCode * subFTP = new AvmCode(OperatorManager::toOperator(
+ (*itWfO)->toStringValue(),
+ OperatorManager::OPERATOR_OR) );
+ aTraceExpression->append( BF(subFTP) );
+ aTraceExpression = subFTP;
+ }
+
+ else if( configure(aTraceExpression->getArgs(), *itWfO) )
+ {
+ //!! NOTHING
+ }
+ }
+ }
+
+ return( true );
+}
+
+
+bool TraceFactory::configure(
+ BFCollection & tracePoints, WObject * wfProperty)
+{
+ ENUM_TRACE_POINT::TRACE_NATURE nature = to_nature( wfProperty->getNameID() );
+
+ AVM_OPCODE opNature = to_op( wfProperty->getNameID() );
+
+
+ if( (nature == ENUM_TRACE_POINT::TRACE_PATH_CONDITION_NATURE)
+ && (nature == ENUM_TRACE_POINT::TRACE_PATH_TIMED_CONDITION_NATURE)
+ && (nature == ENUM_TRACE_POINT::TRACE_NODE_CONDITION_NATURE)
+ && (nature == ENUM_TRACE_POINT::TRACE_NODE_TIMED_CONDITION_NATURE)
+
+ && (nature == ENUM_TRACE_POINT::TRACE_PATH_CONDITION_NATURE_LEAF)
+ && (nature == ENUM_TRACE_POINT::TRACE_PATH_TIMED_CONDITION_NATURE_LEAF)
+ && (nature == ENUM_TRACE_POINT::TRACE_NODE_CONDITION_NATURE_LEAF)
+ && (nature == ENUM_TRACE_POINT::TRACE_NODE_TIMED_CONDITION_NATURE_LEAF) )
+ {
+ bfTP = aTracePoint = new TracePoint(nature, AVM_OPCODE_SELECT);
+
+ if( not configureNodePathCondition(tracePoints, wfProperty->getValue()) )
+ {
+ wfProperty->warningLocation(AVM_OS_WARN)
+ << "Failed to configure <Node Path Condition> with value: "
+ << wfProperty->toStringValue() << std::endl;
+ }
+ }
+
+ else if( wfProperty->hasBuiltinArrayValue() )
+ {
+ if( configureArray(tracePoints, wfProperty,
+ wfProperty->getBuiltinArrayValue(), nature, opNature) )
+ {
+ //!! NOTHING
+ }
+ }
+
+ else if( wfProperty->hasAvmCodeValue() )
+ {
+ if( (nature == ENUM_TRACE_POINT::TRACE_FORMULA_NATURE)
+ || (nature == ENUM_TRACE_POINT::TRACE_CONDITION_NATURE)
+ || (nature == ENUM_TRACE_POINT::TRACE_DECISION_NATURE) )
+ {
+ bfTP = aTracePoint = new TracePoint(nature, AVM_OPCODE_CHECK_SAT);
+
+ if( not configureFormula(tracePoints, wfProperty->getValue()) )
+ {
+ wfProperty->warningLocation(AVM_OS_WARN)
+ << "Failed to configure < Formula > with value: "
+ << wfProperty->toStringValue() << std::endl;
+ }
+ }
+ else if( configureExpression(tracePoints, wfProperty,
+ wfProperty->getAvmCodeValue(), nature, opNature) )
+ {
+ //!! NOTHING
+ }
+ }
+
+ else
+ {
+ if( nature != ENUM_TRACE_POINT::TRACE_UNDEFINED_NATURE )
+ {
+ if( configure(tracePoints, wfProperty,
+ nature, wfProperty->toStringValue()) )
+ {
+ //!! NOTHING
+ }
+ }
+ else if( opNature != AVM_OPCODE_NULL )
+ {
+ if( configure(tracePoints, wfProperty,
+ opNature, wfProperty->toStringValue()) )
+ {
+ //!! NOTHING
+ }
+ }
+ }
+
+ return( true );
+}
+
+
+bool TraceFactory::configure(
+ BFCollection & tracePoints, WObject * wfProperty,
+ ENUM_TRACE_POINT::TRACE_NATURE nature, const std::string & object)
+{
+ switch( nature )
+ {
+ case ENUM_TRACE_POINT::TRACE_COM_NATURE:
+ case ENUM_TRACE_POINT::TRACE_CHANNEL_NATURE:
+ case ENUM_TRACE_POINT::TRACE_MESSAGE_NATURE:
+ case ENUM_TRACE_POINT::TRACE_PORT_NATURE:
+ case ENUM_TRACE_POINT::TRACE_SIGNAL_NATURE:
+ {
+ bfTP = aTracePoint = new TracePoint(nature, AVM_OPCODE_NULL);
+
+ if( not configurePort(tracePoints, object) )
+ {
+ wfProperty->warningLocation(AVM_OS_WARN)
+ << "Failed to configure < Port > with value: "
+ << wfProperty->toStringValue() << std::endl;
+ }
+
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_TIME_NATURE:
+ {
+ bfTP = aTracePoint = new TracePoint(nature, AVM_OPCODE_ASSIGN);
+
+ if( not configureTime(tracePoints, object) )
+ {
+ wfProperty->warningLocation(AVM_OS_WARN)
+ << "Failed to configure < Time > with value: "
+ << wfProperty->toStringValue() << std::endl;
+ }
+
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_VARIABLE_NATURE:
+ {
+ bfTP = aTracePoint = new TracePoint(nature, AVM_OPCODE_ASSIGN);
+
+ if( not configureVariable(tracePoints, object) )
+ {
+ wfProperty->warningLocation(AVM_OS_WARN)
+ << "Failed to configure < Variable > with value: "
+ << wfProperty->toStringValue() << std::endl;
+ }
+
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_BUFFER_NATURE:
+ {
+ bfTP = aTracePoint = new TracePoint(nature, AVM_OPCODE_NULL);
+
+ if( not configureBuffer(tracePoints, object) )
+ {
+ wfProperty->warningLocation(AVM_OS_WARN)
+ << "Failed to configure < Buffer > with value: "
+ << wfProperty->toStringValue() << std::endl;
+ }
+
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_FORMULA_NATURE:
+ case ENUM_TRACE_POINT::TRACE_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_DECISION_NATURE:
+ {
+ bfTP = aTracePoint = new TracePoint(nature, AVM_OPCODE_CHECK_SAT);
+
+ if( not configureFormula(tracePoints, wfProperty->getValue()) )
+ {
+ wfProperty->warningLocation(AVM_OS_WARN)
+ << "Failed to configure < Formula > with value: "
+ << wfProperty->toStringValue() << std::endl;
+ }
+
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_PATH_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_NODE_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_PATH_TIMED_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_NODE_TIMED_CONDITION_NATURE:
+
+ case ENUM_TRACE_POINT::TRACE_PATH_CONDITION_NATURE_LEAF:
+ case ENUM_TRACE_POINT::TRACE_NODE_CONDITION_NATURE_LEAF:
+ case ENUM_TRACE_POINT::TRACE_PATH_TIMED_CONDITION_NATURE_LEAF:
+ case ENUM_TRACE_POINT::TRACE_NODE_TIMED_CONDITION_NATURE_LEAF:
+ {
+ bfTP = aTracePoint = new TracePoint(nature, AVM_OPCODE_SELECT);
+
+ if( not configureNodePathCondition(tracePoints, wfProperty->getValue()) )
+ {
+ wfProperty->warningLocation(AVM_OS_WARN)
+ << "Failed to configure < Node Path Condition > with value: "
+ << wfProperty->toStringValue() << std::endl;
+ }
+
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_MACHINE_NATURE:
+ {
+ bfTP = aTracePoint = new TracePoint(nature, AVM_OPCODE_RUN);
+
+ if( not configureMachine(tracePoints, object) )
+ {
+ wfProperty->warningLocation(AVM_OS_WARN)
+ << "Failed to configure < Machine > with value: "
+ << wfProperty->toStringValue() << std::endl;
+ }
+
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_STATEMACHINE_NATURE:
+ {
+ bfTP = aTracePoint = new TracePoint(nature, AVM_OPCODE_NULL);
+
+ if( not configureStatemachine(tracePoints, object) )
+ {
+ wfProperty->warningLocation(AVM_OS_WARN)
+ << "Failed to configure < Statemachine > with value: "
+ << wfProperty->toStringValue() << std::endl;
+ }
+
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_STATE_NATURE:
+ {
+ bfTP = aTracePoint = new TracePoint(nature,
+ AVM_OPCODE_NULL /*AVM_OPCODE_ENABLE_SET*/);
+
+ if( not configureState(tracePoints, object) )
+ {
+ wfProperty->warningLocation(AVM_OS_WARN)
+ << "Failed to configure < State > with value: "
+ << wfProperty->toStringValue() << std::endl;
+ }
+
+ break;
+ }
+
+
+ case ENUM_TRACE_POINT::TRACE_TRANSITION_NATURE:
+ {
+ bfTP = aTracePoint =
+ new TracePoint(nature, AVM_OPCODE_INVOKE_TRANSITION);
+
+ if( not configureTransition(tracePoints, object) )
+ {
+ wfProperty->warningLocation(AVM_OS_WARN)
+ << "Failed to configure < Transition > with value: "
+ << wfProperty->toStringValue() << std::endl;
+ }
+
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_ROUTINE_NATURE:
+ {
+ bfTP = aTracePoint = new TracePoint(nature);
+// new TracePoint(nature, AVM_OPCODE_INVOKE_ROUTINE);
+
+ if( not configureRoutine(tracePoints, object) )
+ {
+ wfProperty->warningLocation(AVM_OS_WARN)
+ << "Failed to configure < Routine > with value: "
+ << wfProperty->toStringValue() << std::endl;
+ }
+
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_RUNNABLE_NATURE:
+ {
+ bfTP = aTracePoint = new TracePoint(nature);
+
+ if( not configureRunnable(tracePoints, object) )
+ {
+ wfProperty->warningLocation(AVM_OS_WARN)
+ << "Failed to configure < Runnable > with value: "
+ << wfProperty->toStringValue() << std::endl;
+ }
+
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_COMPOSITE_NATURE:
+ {
+ bfTP = aTracePoint = new TracePoint(nature, AVM_OPCODE_NULL);
+
+ if( not configureComposite(tracePoints, object) )
+ {
+ wfProperty->warningLocation(AVM_OS_WARN)
+ << "Failed to configure < Composite > with value: "
+ << wfProperty->toStringValue() << std::endl;
+ }
+
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+
+ if( (mED != NULL) && (aTracePoint != NULL) )
+ {
+ aTracePoint->updateRID( *mED );
+ }
+
+ return( true );
+}
+
+
+bool TraceFactory::configure(
+ BFCollection & tracePoints, WObject * wfProperty,
+ AVM_OPCODE opNature, const std::string & object)
+{
+ switch( opNature )
+ {
+ case AVM_OPCODE_INPUT:
+ case AVM_OPCODE_INPUT_ENV:
+ case AVM_OPCODE_OUTPUT:
+ case AVM_OPCODE_OUTPUT_ENV:
+ {
+ bfTP = aTracePoint = new TracePoint(
+ ENUM_TRACE_POINT::TRACE_COM_NATURE, opNature);
+
+ if( not configurePort(tracePoints, object) )
+ {
+ wfProperty->warningLocation(AVM_OS_WARN)
+ << "Failed to configure < Port > with value: "
+ << wfProperty->toStringValue() << std::endl;
+ }
+
+ break;
+ }
+
+ case AVM_OPCODE_TIMED_GUARD:
+ {
+ break;
+ }
+
+ case AVM_OPCODE_ASSIGN:
+ case AVM_OPCODE_ASSIGN_NEWFRESH:
+ {
+ bfTP = aTracePoint = new TracePoint(
+ ENUM_TRACE_POINT::TRACE_VARIABLE_NATURE, opNature);
+
+ if( not configureVariable(tracePoints, object) )
+ {
+ wfProperty->warningLocation(AVM_OS_WARN)
+ << "Failed to configure < Variable > with value: "
+ << wfProperty->toStringValue() << std::endl;
+ }
+
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+
+ if( (mED != NULL) && (aTracePoint != NULL) )
+ {
+ aTracePoint->updateRID( *mED );
+ }
+
+ return( true );
+}
+
+
+bool TraceFactory::configureArray(BFCollection & tracePoints,
+ WObject * wfProperty, BuiltinArray * anArray,
+ ENUM_TRACE_POINT::TRACE_NATURE nature, AVM_OPCODE opNature)
+{
+ BFVector tpArray;
+
+ for( avm_size_t offset = 0 ; offset < anArray->size() ; ++offset )
+ {
+ if( nature != ENUM_TRACE_POINT::TRACE_UNDEFINED_NATURE )
+ {
+ if( configure(tpArray, wfProperty, nature,
+ wfProperty->toStringValue(anArray, offset)) )
+ {
+ //!! NOTHING
+ }
+ }
+ else if( opNature != AVM_OPCODE_NULL )
+ {
+ if( configure(tpArray, wfProperty, opNature,
+ wfProperty->toStringValue(anArray, offset)) )
+ {
+ //!! NOTHING
+ }
+ }
+ }
+
+ if( tpArray.singleton() )
+ {
+ tracePoints.append( tpArray[0] );
+ }
+ else if( tpArray.populated() )
+ {
+ bfTP = aTracePoint = new TracePoint(
+ ENUM_TRACE_POINT::TRACE_COMPOSITE_NATURE, AVM_OPCODE_AND);
+ aTracePoint->tpid = ++TP_ID;
+ aTracePoint->value = BF( new ArrayBF(tpArray) );
+
+ tracePoints.append( bfTP );
+ }
+
+ return( true );
+}
+
+
+bool TraceFactory::configureExpression(BFCollection & tracePoints,
+ WObject * wfProperty, AvmCode * aCode,
+ ENUM_TRACE_POINT::TRACE_NATURE nature, AVM_OPCODE opNature)
+{
+ BFVector tpArray;
+
+ AvmCode::const_iterator itArg = aCode->begin();
+ AvmCode::const_iterator endArg = aCode->end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ if( (*itArg).is< AvmCode >() )
+ {
+ if( configureExpression(tpArray, wfProperty,
+ (*itArg).to_ptr< AvmCode >(), nature, opNature) )
+ {
+ //!! NOTHING
+ }
+ }
+ else if( nature != ENUM_TRACE_POINT::TRACE_UNDEFINED_NATURE )
+ {
+ if( configure(tpArray, wfProperty,
+ nature, wfProperty->toStringValue(*itArg)) )
+ {
+ //!! NOTHING
+ }
+ }
+ else if( opNature != AVM_OPCODE_NULL )
+ {
+ if( configure(tpArray, wfProperty,
+ opNature, wfProperty->toStringValue(*itArg)) )
+ {
+ //!! NOTHING
+ }
+ }
+ }
+
+ if( tpArray.singleton() )
+ {
+ tracePoints.append( tpArray[0] );
+ }
+ else if( tpArray.populated() )
+ {
+ bfTP = aTracePoint = new TracePoint(
+ ENUM_TRACE_POINT::TRACE_COMPOSITE_NATURE,
+ aCode->getAvmOpCode());
+ aTracePoint->tpid = ++TP_ID;
+ aTracePoint->value = BF( new ArrayBF(tpArray) );
+
+ tracePoints.append( bfTP );
+ }
+
+ return( true );
+}
+
+
+
+bool TraceFactory::configureComposite(
+ BFCollection & tracePoints, const std::string & object)
+{
+ for( avm_size_t offset = 0 ; offset < mDeclaredPoint.size() ; ++offset )
+ {
+ if( mDeclaredPointID[offset] == object )
+ {
+ tracePoints.append( mDeclaredPoint[offset] );
+
+ // if break: append first else: any Point with this ID
+// break;
+ }
+ }
+
+ return( true );
+}
+
+
+
+bool TraceFactory::configurePort(
+ BFCollection & tracePoints, const std::string & object)
+{
+ otherTracePoint.clear();
+
+ if( aTracePoint->configurePort(mConfiguration, object, otherTracePoint) )
+ {
+ aTracePoint->tpid = ++TP_ID;
+
+ listOfPortTracePoint.append( aTracePoint );
+ listOfPortTracePoint.append( otherTracePoint );
+
+ tracePoints.append( bfTP );
+ while( otherTracePoint.nonempty() )
+ {
+ otherTracePoint.front()->tpid = ++TP_ID;
+
+ tracePoints.append( BF(otherTracePoint.front()) );
+ otherTracePoint.pop_front();
+ }
+ }
+ else
+ {
+ return( false );
+ }
+
+ return( true );
+}
+
+
+bool TraceFactory::configureTime(
+ BFCollection & tracePoints, const std::string & object)
+{
+ if( NamedElement::fqnStartsWith(object, "time" ) ||
+ NamedElement::fqnStartsWith(object, "$time") ||
+ NamedElement::fqnStartsWith(object, "#time") )
+ {
+ aTracePoint->tpid = ++TP_ID;
+ aTracePoint->op = AVM_OPCODE_TIMED_GUARD;
+ aTracePoint->object = mVarTime;
+
+ tracePoints.append( bfTP );
+ }
+ else if( aTracePoint->configureVariable(mConfiguration, object) )
+ {
+ aTracePoint->tpid = ++TP_ID;
+ aTracePoint->op = AVM_OPCODE_TIMED_GUARD;
+ mVarTime = aTracePoint->object->to< InstanceOfData >();
+
+ listOfVariableTracePoint.append( aTracePoint );
+
+ tracePoints.append( bfTP );
+ }
+ else
+ {
+ return( false );
+ }
+
+ return( true );
+}
+
+
+bool TraceFactory::configureVariable(
+ BFCollection & tracePoints, const std::string & object)
+{
+ if( NamedElement::fqnStartsWith(object, "time" ) ||
+ NamedElement::fqnStartsWith(object, "$time") ||
+ NamedElement::fqnStartsWith(object, "#time") )
+ {
+ aTracePoint->tpid = ++TP_ID;
+ aTracePoint->nature = ENUM_TRACE_POINT::TRACE_TIME_NATURE;
+ aTracePoint->op = AVM_OPCODE_TIMED_GUARD;
+ aTracePoint->object = mVarTime;
+
+ tracePoints.append( bfTP );
+ }
+ else if( aTracePoint->configureVariable(mConfiguration, object) )
+ {
+ aTracePoint->tpid = ++TP_ID;
+
+ listOfVariableTracePoint.append( aTracePoint );
+
+ tracePoints.append( bfTP );
+ }
+ else
+ {
+ return( false );
+ }
+
+ return( true );
+}
+
+
+bool TraceFactory::configureBuffer(
+ BFCollection & tracePoints, const std::string & object)
+{
+ if( aTracePoint->configureBuffer(mConfiguration, object) )
+ {
+ aTracePoint->tpid = ++TP_ID;
+ tracePoints.append( bfTP );
+ }
+ else
+ {
+ return( false );
+ }
+
+ return( true );
+}
+
+
+bool TraceFactory::configureFormula(
+ BFCollection & tracePoints, const BF & object)
+{
+ aTracePoint->tpid = ++TP_ID;
+
+// aTracePoint->value = ENV.getBuilder().compileExpression(
+// mConfiguration.getExecutableSystem()
+// .getSystemInstance().getExecutable(), object);
+
+ ENV.getBuilder().resetErrorWarning();
+
+ aTracePoint->value = ENV.getBuilder().
+ compileExpression(mLocalExecutableForm, object);
+
+ if( not ENV.getBuilder().hasError() )
+ {
+ tracePoints.append( bfTP );
+ }
+
+ return( true );
+}
+
+
+#define LEAF_NODE_REGEX_PATTERN "\\S?(leaf|end|last|tail)\\S?"
+
+#define LEAF_NODE_DEFAULT_PATTERN ":leaf:"
+
+bool TraceFactory::configureNodePathCondition(
+ BFCollection & tracePoints, const BF & object)
+{
+ if( REGEX_MATCH( object.toBuiltinString() , LEAF_NODE_REGEX_PATTERN ) )
+ {
+ switch( aTracePoint->nature )
+ {
+ case ENUM_TRACE_POINT::TRACE_PATH_CONDITION_NATURE:
+ {
+ aTracePoint->nature =
+ ENUM_TRACE_POINT::TRACE_PATH_CONDITION_NATURE_LEAF;
+ break;
+ }
+ case ENUM_TRACE_POINT::TRACE_NODE_CONDITION_NATURE:
+ {
+ aTracePoint->nature =
+ ENUM_TRACE_POINT::TRACE_NODE_CONDITION_NATURE_LEAF;
+ break;
+ }
+ case ENUM_TRACE_POINT::TRACE_PATH_TIMED_CONDITION_NATURE:
+ {
+ aTracePoint->nature =
+ ENUM_TRACE_POINT::TRACE_PATH_TIMED_CONDITION_NATURE_LEAF;
+ break;
+ }
+ case ENUM_TRACE_POINT::TRACE_NODE_TIMED_CONDITION_NATURE:
+ {
+ aTracePoint->nature =
+ ENUM_TRACE_POINT::TRACE_NODE_TIMED_CONDITION_NATURE_LEAF;
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
+
+ aTracePoint->any_object = true;
+ }
+
+ else if( object.toBuiltinString() == "[*]" )
+ {
+ aTracePoint->any_object = true;
+ }
+ else
+ {
+ aTracePoint->value = object;
+ }
+
+ aTracePoint->tpid = ++TP_ID;
+ tracePoints.append( bfTP );
+
+ return( true );
+}
+
+
+bool TraceFactory::configureMachine(
+ BFCollection & tracePoints, const std::string & object)
+{
+ if( aTracePoint->configureMachine(mConfiguration, object) )
+ {
+ aTracePoint->tpid = ++TP_ID;
+ tracePoints.append( bfTP );
+ }
+ else
+ {
+ return( false );
+ }
+
+ return( true );
+}
+
+
+bool TraceFactory::configureState(
+ BFCollection & tracePoints, const std::string & object)
+{
+ if( aTracePoint->configureMachine(mConfiguration, object) )
+ {
+ aTracePoint->tpid = ++TP_ID;
+ tracePoints.append( bfTP );
+ }
+ else
+ {
+ return( false );
+ }
+
+ return( true );
+}
+
+bool TraceFactory::configureStatemachine(
+ BFCollection & tracePoints, const std::string & object)
+{
+ if( aTracePoint->configureMachine(mConfiguration, object) )
+ {
+ aTracePoint->tpid = ++TP_ID;
+ tracePoints.append( bfTP );
+ }
+ else
+ {
+ return( false );
+ }
+
+ return( true );
+}
+
+
+bool TraceFactory::configureTransition(
+ BFCollection & tracePoints, const std::string & object)
+{
+ if( aTracePoint->configureTransition(mConfiguration, object) )
+ {
+ aTracePoint->tpid = ++TP_ID;
+ tracePoints.append( bfTP );
+ }
+ else
+ {
+ return( false );
+ }
+
+ return( true );
+}
+
+
+bool TraceFactory::configureRoutine(
+ BFCollection & tracePoints, const std::string & object)
+{
+ if( aTracePoint->configureRoutine(mConfiguration, object) )
+ {
+ aTracePoint->tpid = ++TP_ID;
+ tracePoints.append( bfTP );
+ }
+ else
+ {
+ return( false );
+ }
+
+ return( true );
+}
+
+
+bool TraceFactory::configureRunnable(
+ BFCollection & tracePoints, const std::string & object)
+{
+ if( aTracePoint->configureRunnable(mConfiguration, object) )
+ {
+ aTracePoint->tpid = ++TP_ID;
+ tracePoints.append( bfTP );
+ }
+ else
+ {
+ return( false );
+ }
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// BASIC PARSER API
+////////////////////////////////////////////////////////////////////////////////
+
+/*
+ * Exemple de trace basique
+1
+TSI_target?1
+120
+RSD_ENABLED_source!1
+0
+PSD_ENABLED_source!1
+423385
+RSD_CMD_source!1
+0
+PSD_STATE1_target?0
+3025646
+DEP_AUTH1_source!1
+1059822
+TSI1_target?0
+*/
+
+bool TraceFactory::parseBasicTrace(TraceSequence & aTraceElement,
+ std::ifstream & inFile, const BF & aVarTime)
+{
+
+ BasicTraceParser aParser( mConfiguration );
+
+ return( aParser.parseBasicTrace(aTraceElement, inFile, aVarTime) );
+}
+
+bool TraceFactory::parseBasicXliaTrace(TraceSequence & aTraceElement,
+ std::ifstream & inFile, const BF & aVarTime)
+{
+
+ BasicTraceParser aParser( mConfiguration );
+
+ return( aParser.parseBasicXliaTrace(aTraceElement, inFile, aVarTime) );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// OTHER API
+////////////////////////////////////////////////////////////////////////////////
+
+bool TraceFactory::appendTransitionPoint(const Configuration & aConfiguration,
+ TraceSequence & aTraceElement, const std::string & aTransitionUfid)
+{
+ ExecutableQuery XQuery( aConfiguration );
+
+ const BF & foundTransition =
+ XQuery.getTransitionByQualifiedNameID(aTransitionUfid);
+
+ if( foundTransition.valid() )
+ {
+ BF newTransitionPoint( new TracePoint(
+ ENUM_TRACE_POINT::TRACE_TRANSITION_NATURE,
+ AVM_OPCODE_INVOKE_TRANSITION, NULL,
+ foundTransition.to_ptr< AvmTransition>()) );
+
+ aTraceElement.points.append( newTransitionPoint );
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// SERIALIZATION API
+////////////////////////////////////////////////////////////////////////////////
+
+void TraceFactory::toStream(OutStream & os, ListOfTracePoint & listofTracePoint) const
+{
+ ListOfTracePoint::iterator itPoint = listofTracePoint.begin();
+ ListOfTracePoint::iterator endPoint = listofTracePoint.end();
+ for( ; itPoint != endPoint ; ++itPoint )
+ {
+ (*itPoint)->toStream(os);
+ }
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/trace/TraceFactory.h b/org.eclipse.efm.symbex/src/fml/trace/TraceFactory.h
new file mode 100644
index 0000000..889ed41
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/trace/TraceFactory.h
@@ -0,0 +1,248 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 11 sept. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef TRACEFACTORY_H_
+#define TRACEFACTORY_H_
+
+#include <collection/BFContainer.h>
+#include <collection/Typedef.h>
+
+#include <fml/trace/TracePoint.h>
+
+
+namespace sep
+{
+
+
+class AvmCode;
+
+class Configuration;
+
+class EvaluationEnvironment;
+class ExecutionData;
+
+class InstanceOfData;
+class TraceSequence;
+
+class WObject;
+
+
+class TraceFactory
+{
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ const Configuration & mConfiguration;
+
+ EvaluationEnvironment & ENV;
+
+ const ExecutionData * mED;
+
+ WObject * mParameterWObject;
+
+ BFVector mDeclaredPoint;
+ VectorOfString mDeclaredPointID;
+
+ ExecutableForm * mLocalExecutableForm;
+
+ InstanceOfData * mVarTime;
+ BF bfVarTime;
+
+ ListOfTracePoint listOfPortTracePoint;
+ ListOfTracePoint listOfVariableTracePoint;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing Variables
+ BF bfTP;
+ TracePoint * aTracePoint;
+ ListOfTracePoint otherTracePoint;
+
+public:
+ avm_size_t TP_ID;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TraceFactory(const Configuration & aConfiguration,
+ EvaluationEnvironment & anENV, WObject * wfParameterObject,
+ ExecutableForm * aLocalExecutable = NULL,
+ InstanceOfData * aVarTime = NULL)
+ : mConfiguration( aConfiguration ),
+ ENV( anENV ),
+
+ mED( NULL ),
+
+ mParameterWObject( wfParameterObject ),
+
+ mDeclaredPoint( ),
+ mDeclaredPointID( ),
+
+ mLocalExecutableForm( aLocalExecutable ),
+
+ mVarTime( aVarTime ),
+ bfVarTime( ),
+
+ listOfPortTracePoint( ),
+ listOfVariableTracePoint( ),
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing Variables
+ bfTP( ),
+ aTracePoint( NULL ),
+ otherTracePoint( ),
+ TP_ID( 0 )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~TraceFactory()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER
+ * listOfPortTracePoint
+ * listOfVariableTracePoint
+ */
+ ListOfTracePoint & getPortTracePoints()
+ {
+ return( listOfPortTracePoint );
+ }
+
+ ListOfTracePoint & getVariableTracePoints()
+ {
+ return( listOfVariableTracePoint );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool configure(TraceSequence & aTraceElement, const ExecutionData * anED = NULL);
+
+ bool configure(AvmCode * aTraceExpression, const ExecutionData * anED = NULL);
+
+ bool configure(WObject * aTraceSequence,
+ BFCollection & tracePoints, const ExecutionData * anED = NULL);
+
+ bool configure(WObject * aTraceSequence,
+ TraceSequence & aTraceElement, const ExecutionData * anED = NULL);
+
+ bool configure(WObject * aTraceSequence,
+ AvmCode * aTraceExpression, const ExecutionData * anED = NULL);
+
+ bool configure(BFCollection & tracePoints, WObject * wfProperty);
+
+ bool configure(BFCollection & tracePoints, WObject * wfProperty,
+ ENUM_TRACE_POINT::TRACE_NATURE nature, const std::string & object);
+
+ bool configure(BFCollection & tracePoints, WObject * wfProperty,
+ AVM_OPCODE opNature, const std::string & object);
+
+ bool configureArray(BFCollection & tracePoints,
+ WObject * wfProperty, BuiltinArray * anArray,
+ ENUM_TRACE_POINT::TRACE_NATURE nature, AVM_OPCODE opNature);
+
+ bool configureExpression(BFCollection & tracePoints,
+ WObject * wfProperty, AvmCode * aCode,
+ ENUM_TRACE_POINT::TRACE_NATURE nature, AVM_OPCODE opNature);
+
+
+ bool configureComposite(
+ BFCollection & tracePoints, const std::string & object);
+
+
+ bool configurePort(
+ BFCollection & tracePoints, const std::string & object);
+
+ bool configureTime(
+ BFCollection & tracePoints, const std::string & object);
+
+ bool configureVariable(
+ BFCollection & tracePoints, const std::string & object);
+
+ bool configureBuffer(
+ BFCollection & tracePoints, const std::string & object);
+
+ bool configureFormula(
+ BFCollection & tracePoints, const BF & object);
+
+ bool configureNodePathCondition(
+ BFCollection & tracePoints, const BF & object);
+
+ bool configureMachine(
+ BFCollection & tracePoints, const std::string & object);
+
+ bool configureState(
+ BFCollection & tracePoints, const std::string & object);
+ bool configureStatemachine(
+ BFCollection & tracePoints, const std::string & object);
+
+ bool configureTransition(
+ BFCollection & tracePoints, const std::string & object);
+
+ bool configureRoutine(
+ BFCollection & tracePoints, const std::string & object);
+
+ bool configureRunnable(
+ BFCollection & tracePoints, const std::string & object);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // BASIC PARSER API
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool parseBasicTrace(TraceSequence & aTraceElement,
+ std::ifstream & inFile, const BF & aVarTime);
+
+ bool parseBasicXliaTrace(TraceSequence & aTraceElement,
+ std::ifstream & inFile, const BF & aVarTime);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // OTHER API
+ ////////////////////////////////////////////////////////////////////////////
+
+ static bool appendTransitionPoint(
+ const Configuration & aConfiguration,
+ TraceSequence & aTraceElement,
+ const std::string & aTransitionUfid);
+
+ //TODO: removeTracePoint ?
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SERIALIZATION API
+ ////////////////////////////////////////////////////////////////////////////
+
+ void toStream(OutStream & os, ListOfTracePoint & listofTracePoint) const;
+
+};
+
+
+} /* namespace sep */
+
+#endif /* TRACEFACTORY_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/trace/TraceFilter.cpp b/org.eclipse.efm.symbex/src/fml/trace/TraceFilter.cpp
new file mode 100644
index 0000000..28d2b48
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/trace/TraceFilter.cpp
@@ -0,0 +1,1019 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 11 déc. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "TraceFilter.h"
+
+#include <computer/EvaluationEnvironment.h>
+
+#include <fml/executable/ExecutableQuery.h>
+#include <fml/executable/ExecutableSystem.h>
+
+#include <fml/expression/BuiltinArray.h>
+
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/template/TimedMachine.h>
+
+#include <fml/runtime/ExecutionConfiguration.h>
+
+#include <fml/trace/TraceFactory.h>
+#include <fml/trace/TraceSequence.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <sew/Configuration.h>
+
+
+namespace sep
+{
+
+/*
+prototype process::trace_generator as &avm::processor.TRACE_GENERATOR is
+ ...
+ section TRACE
+ // AND --> conjunctive
+ // OR --> disjunctive
+ // XOR --> exclusive
+ // NOT --> negative
+ @combinator = 'OR';
+
+ @time = "$delta";
+ @time = "$time";
+
+ @assign = "sens";
+
+ @newfresh = "sens";
+
+ @signal = "sens";
+
+ @port = "env";
+
+ @input = "env";
+ @output = "env";
+
+ @output = "Thermostat->dt";
+ @input = "Thermostat->equip";
+ @output = "Equipment->error";
+ endsection TRACE
+ ...
+endprototype
+*/
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+
+#define LEAF_NODE_REGEX_PATTERN "\\S?(leaf|end|last|tail)\\S?"
+
+#define LEAF_NODE_DEFAULT_PATTERN ":leaf:"
+
+
+bool TraceFilter::configure(EvaluationEnvironment & ENV,
+ WObject * wfParameterObject, WObject * wfTraceObject)
+{
+
+ if( TimedMachine::SYSTEM_VAR_DELTA_TIME != NULL )
+ {
+ ExecutableQuery XQuery( ENV.getConfiguration() );
+
+ objectDeltaTime = XQuery.getDataByAstElement(
+ TimedMachine::SYSTEM_VAR_DELTA_TIME).to_ptr< InstanceOfData >();
+ }
+
+ // default main combinator
+ mainTracePointFiter.setOperator( OperatorManager::OPERATOR_OR );
+
+ // Configuration of TRACE
+ TraceFactory traceFactory(ENV.getConfiguration(),
+ ENV, wfParameterObject, NULL, objectDeltaTime);
+ if( not traceFactory.configure(wfTraceObject, (& mainTracePointFiter)) )
+ {
+// return( false );
+ }
+
+ listOfVariableTracePoint.append( traceFactory.getVariableTracePoints() );
+
+
+ // Initialize Filter Point Flags
+ mConditionFlag = Query::hasRegexWProperty(wfTraceObject, "condition");
+ mDecisionFlag = mConditionFlag
+ || Query::hasRegexWProperty(wfTraceObject, "decision");
+
+ if( mConditionFlag || mDecisionFlag )
+ {
+ mPathConditionFlag = mPathTimedConditionFlag = true;
+ mNodeConditionFlag = mNodeTimedConditionFlag = true;
+
+ mPathConditionLeafNodeFlag = mPathTimedConditionLeafNodeFlag = true;
+ mNodeConditionLeafNodeFlag = mNodeTimedConditionLeafNodeFlag = true;
+ }
+ else
+ {
+ mPathConditionFlag = not REGEX_MATCH(
+ Query::getRegexWPropertyString(wfTraceObject,
+ CONS_WID2("path", "condition"), LEAF_NODE_DEFAULT_PATTERN),
+ LEAF_NODE_REGEX_PATTERN );
+
+ mPathConditionLeafNodeFlag = mPathConditionFlag
+ || Query::hasRegexWProperty(wfTraceObject,
+ CONS_WID3("path", "condition", "(leaf|end|last|tail)"))
+ || REGEX_MATCH(Query::getRegexWPropertyString(
+ wfTraceObject, CONS_WID2("path", "condition"), ""),
+ LEAF_NODE_REGEX_PATTERN );
+
+
+ mNodeConditionFlag = not REGEX_MATCH(
+ Query::getRegexWPropertyString(wfTraceObject,
+ CONS_WID2("node", "condition"), LEAF_NODE_DEFAULT_PATTERN),
+ LEAF_NODE_REGEX_PATTERN );
+
+ mNodeConditionLeafNodeFlag = mNodeConditionFlag
+ || Query::hasRegexWProperty(wfTraceObject,
+ CONS_WID3("node", "condition", "(leaf|end|last|tail)"))
+ || REGEX_MATCH(Query::getRegexWPropertyString(
+ wfTraceObject, CONS_WID2("node", "condition"), ""),
+ LEAF_NODE_REGEX_PATTERN );
+
+
+ mPathTimedConditionFlag = not REGEX_MATCH(
+ Query::getRegexWPropertyString(wfTraceObject,
+ CONS_WID3("path", "timed", "condition"),
+ LEAF_NODE_DEFAULT_PATTERN),
+ LEAF_NODE_REGEX_PATTERN );
+
+ mPathTimedConditionLeafNodeFlag = mPathTimedConditionFlag
+ || Query::hasRegexWProperty(wfTraceObject, CONS_WID4(
+ "path", "timed", "condition", "(leaf|end|last|tail)") )
+ || REGEX_MATCH(Query::getRegexWPropertyString(wfTraceObject,
+ CONS_WID3("path", "timed", "condition"), ""),
+ LEAF_NODE_REGEX_PATTERN );
+
+
+ mNodeTimedConditionFlag = not REGEX_MATCH(
+ Query::getRegexWPropertyString(wfTraceObject,
+ CONS_WID3("node", "timed", "condition"),
+ LEAF_NODE_DEFAULT_PATTERN),
+ LEAF_NODE_REGEX_PATTERN );
+
+ mNodeTimedConditionLeafNodeFlag = mNodeTimedConditionFlag
+ || Query::hasRegexWProperty(wfTraceObject, CONS_WID4(
+ "node", "timed", "condition", "(leaf|end|last|tail)") )
+ || REGEX_MATCH(Query::getRegexWPropertyString(wfTraceObject,
+ CONS_WID3("node", "timed", "condition"), ""),
+ LEAF_NODE_REGEX_PATTERN );
+ }
+
+ mTimeFilterFlag = Query::hasRegexWProperty(wfTraceObject, "\\S?time");
+
+ mAssignFilterFlag = listOfVariableTracePoint.nonempty()
+ || Query::hasWPropertyString(wfTraceObject, "variable", "var")
+ || Query::hasWPropertyString(wfTraceObject, "assign" );
+
+ mNewfreshFilterFlag = Query::hasWPropertyString(wfTraceObject, "newfresh");
+
+ mComFilterFlag = Query::hasRegexWProperty(wfTraceObject, "com|inout");
+
+ if( mComFilterFlag )
+ {
+ mInputFilterFlag = true;
+ mInputExternalFilterFlag = mInputEnvFilterFlag = true;
+ mInputInternalFilterFlag = mInputRdvFilterFlag = true;
+
+ mOutputFilterFlag = true;
+ mOutputExternalFilterFlag = mOutputEnvFilterFlag = true;
+ mOutputInternalFilterFlag = mOutputRdvFilterFlag = true;
+ }
+ else
+ {
+ mInputEnvFilterFlag =
+ Query::hasRegexWProperty(wfTraceObject,
+ CONS_WID2("((in(p|o)ut)|com)", "env"));
+ mInputRdvFilterFlag =
+ Query::hasRegexWProperty(wfTraceObject,
+ CONS_WID2("((in(p|o)ut)|com)", "rdv"));
+
+ mInputExternalFilterFlag = mInputEnvFilterFlag
+ || Query::hasRegexWProperty(wfTraceObject,
+ CONS_WID2("((in(p|o)ut)|com)", "external"));
+
+ mInputInternalFilterFlag = mInputRdvFilterFlag
+ || Query::hasRegexWProperty(wfTraceObject,
+ CONS_WID2("((in(p|o)ut)|com)", "internal"));
+
+ mInputFilterFlag = mInputExternalFilterFlag
+ || mInputInternalFilterFlag
+ || Query::hasWPropertyString(wfTraceObject, "input");
+
+
+ mOutputEnvFilterFlag = Query::hasRegexWProperty(
+ wfTraceObject, CONS_WID2("output", "env"));
+
+ mOutputRdvFilterFlag = Query::hasRegexWProperty(
+ wfTraceObject, CONS_WID2("output", "rdv"));
+
+ mOutputExternalFilterFlag = mOutputEnvFilterFlag
+ || Query::hasRegexWProperty(wfTraceObject,
+ CONS_WID2("(((outp|ino)ut)|com)", "external"));
+
+ mOutputInternalFilterFlag = mOutputRdvFilterFlag
+ || Query::hasRegexWProperty(wfTraceObject,
+ CONS_WID2("(((outp|ino)ut)|com)", "internal"));
+
+ mOutputFilterFlag =
+ mOutputExternalFilterFlag || mOutputInternalFilterFlag
+ || Query::hasWPropertyString(wfTraceObject, "output");
+
+
+ mComExternalFilterFlag =
+ mInputExternalFilterFlag || mOutputExternalFilterFlag
+ || Query::hasRegexWProperty(
+ wfTraceObject, CONS_WID2("(com|inout)", "external"));
+
+ mComInternalFilterFlag =
+ mInputInternalFilterFlag || mOutputInternalFilterFlag
+ || Query::hasRegexWProperty(wfTraceObject,
+ CONS_WID2("(com|inout)", "internal"));
+
+ mComFilterFlag = mInputFilterFlag || mOutputFilterFlag || containsCom();
+ }
+
+ mMachineFilterFlag =
+ Query::hasWPropertyString(wfTraceObject, "machine");
+ mStateFilterFlag =
+ Query::hasWPropertyString(wfTraceObject, "state");
+ mStatemachineFilterFlag =
+ Query::hasWPropertyString(wfTraceObject, "statemachine");
+
+ mTransitionFilterFlag =
+ Query::hasWPropertyString(wfTraceObject, "transition");
+ mRoutineFilterFlag =
+ Query::hasWPropertyString(wfTraceObject, "routine");
+
+ mIOTraceFilterFlag = mComFilterFlag || mNewfreshFilterFlag;
+
+ mRunnableFilterFlag = mMachineFilterFlag
+ || mStateFilterFlag || mStatemachineFilterFlag
+ || mTransitionFilterFlag || mRoutineFilterFlag;
+
+
+ // Update Filter Point Flags
+ //updateFilterFlags();
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRACE )
+ AVM_OS_TRACE << "TraceFilter:> "; toStream(AVM_OS_TRACE);
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , PROCESSOR , TRACE )
+
+ return( true );
+}
+
+
+bool TraceFilter::configure(EvaluationEnvironment & ENV,
+ WObject * wfParameterObject, const std::string & aWSequenceNameID,
+ const std::string & aWSequenceElseNameID)
+{
+ WObject * theTRACE = Query::getWSequenceOrElse(
+ wfParameterObject, aWSequenceNameID, aWSequenceElseNameID);
+
+// if( (theTRACE == WObject::_NULL_) || theTRACE->hasnoOwnedElement() )
+// {
+// return( true );
+// }
+
+ return( configure(ENV, wfParameterObject, theTRACE) );
+}
+
+/**
+ * Update
+ * Filter Point Flags
+ */
+//void TraceFilter::updateFilterFlags()
+//{
+// mPathConditionFlag = contains(
+// ENUM_TRACE_POINT::TRACE_PATH_CONDITION_NATURE);
+//
+// mPathTimedConditionFlag = contains(
+// ENUM_TRACE_POINT::TRACE_PATH_TIMED_CONDITION_NATURE);
+//
+// mNodeConditionFlag = contains(
+// ENUM_TRACE_POINT::TRACE_NODE_CONDITION_NATURE);
+//
+// mNodeTimedConditionFlag = contains(
+// ENUM_TRACE_POINT::TRACE_NODE_TIMED_CONDITION_NATURE);
+//
+// mTimeFilterFlag = contains(ENUM_TRACE_POINT::TRACE_TIME_NATURE);
+//
+// mTimeFilterFlag = contains(ENUM_TRACE_POINT::TRACE_TIME_NATURE);
+//
+// mAssignFilterFlag = listOfVariableTracePoint.nonempty() ||
+// contains(ENUM_TRACE_POINT::TRACE_VARIABLE_NATURE);
+//
+// mNewfreshFilterFlag = contains(ENUM_TRACE_POINT::TRACE_VARIABLE_NATURE,
+// AVM_OPCODE_ASSIGN_NEWFRESH);
+//
+// mInputEnvFilterFlag = contains(AVM_OPCODE_INPUT_ENV);
+// mInputFilterFlag = contains(AVM_OPCODE_INPUT);
+// mOutputEnvFilterFlag = contains(AVM_OPCODE_OUTPUT_ENV);
+// mOutputFilterFlag = contains(AVM_OPCODE_OUTPUT);
+//
+// mMachineFilterFlag = contains(ENUM_TRACE_POINT::TRACE_MACHINE_NATURE);
+// mStateFilterFlag = contains( ENUM_TRACE_POINT::TRACE_STATE_NATURE);
+// mStatemachineFilterFlag = contains(ENUM_TRACE_POINT::TRACE_STATEMACHINE_NATURE);
+//
+// mTransitionFilterFlag = contains(ENUM_TRACE_POINT::TRACE_TRANSITION_NATURE);
+// mRoutineFilterFlag = contains(ENUM_TRACE_POINT::TRACE_ROUTINE_NATURE);
+//
+//
+// mComFilterFlag = mInputFilterFlag || mOutputFilterFlag || containsCom();
+//
+// mIOTraceFilterFlag = mComFilterFlag || mNewfreshFilterFlag;
+//
+// mRunnableFilterFlag = mMachineFilterFlag
+// || mStateFilterFlag || mStatemachineFilterFlag
+// || mTransitionFilterFlag || mRoutineFilterFlag
+// || contains(ENUM_TRACE_POINT::TRACE_RUNNABLE_NATURE);
+//}
+
+
+/**
+ * Filter Point Flags
+ */
+bool TraceFilter::contains(ENUM_TRACE_POINT::TRACE_NATURE nature,
+ AVM_OPCODE op, AvmCode * aCode) const
+{
+ AvmCode::const_iterator it = aCode->begin();
+ AvmCode::const_iterator endIt = aCode->end();
+ for( ; it != endIt ; ++it )
+ {
+ if( contains(nature, op, (*it)) )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+bool TraceFilter::contains(ENUM_TRACE_POINT::TRACE_NATURE nature,
+ AVM_OPCODE op, const BF & arg) const
+{
+ if( arg.is< TracePoint >() )
+ {
+ return( ((nature == ENUM_TRACE_POINT::TRACE_UNDEFINED_NATURE) ||
+ (arg.to_ptr< TracePoint >()->nature == nature)) &&
+ ((op == AVM_OPCODE_NULL) ||
+ (arg.to_ptr< TracePoint >()->op == op)) );
+ }
+
+ else if( arg.is< AvmCode >() )
+ {
+ return( contains(nature, op, arg.to_ptr< AvmCode >()) );
+ }
+
+ else if( arg.is< TraceSequence >() )
+ {
+ BFList::const_iterator it = arg.to_ptr< TraceSequence >()->points.begin();
+ BFList::const_iterator endIt = arg.to_ptr< TraceSequence >()->points.end();
+ for( ; it != endIt ; ++it )
+ {
+ if( contains(nature, op, (*it)) )
+ {
+ return( true );
+ }
+ }
+ }
+
+ return( false );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// FILTERING API : check if TRACE POINT pass
+////////////////////////////////////////////////////////////////////////////////
+
+bool TraceFilter::pass(TracePoint * filterTP, TracePoint * aTP)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRACE )
+ AVM_OS_TRACE << TAB;
+ filterTP->toStream(AVM_OS_TRACE << AVM_TAB_INDENT);
+ AVM_OS_TRACE << END_INDENT;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRACE )
+
+ if( aTP->isVirtual() )
+ {
+ return( true );
+ }
+ else if( (filterTP->nature != ENUM_TRACE_POINT::TRACE_UNDEFINED_NATURE) )
+ {
+ if( (filterTP->nature != aTP->nature) )
+ {
+ if( aTP->nature == ENUM_TRACE_POINT::TRACE_MACHINE_NATURE )
+ {
+ if( filterTP->nature == ENUM_TRACE_POINT::TRACE_STATE_NATURE )
+ {
+ if( (aTP->object != NULL)
+ && (not aTP->object->to< InstanceOfMachine >()->
+ getSpecifier().isFamilyComponentState()) )
+ {
+ return( false );
+ }
+ }
+ else if( filterTP->nature ==
+ ENUM_TRACE_POINT::TRACE_STATEMACHINE_NATURE )
+ {
+ if( (aTP->object != NULL)
+ && (not aTP->object->to< InstanceOfMachine >()->
+ getSpecifier().isComponentStatemachine()) )
+// && (not aTP->object->to< InstanceOfMachine >()->
+// getSpecifier().isMocStateTransitionStructure()) )
+ {
+ return( false );
+ }
+ }
+ }
+
+ else if( (filterTP->nature != ENUM_TRACE_POINT::TRACE_COM_NATURE)
+ || (not ENUM_TRACE_POINT::is_com(aTP->nature)) )
+ {
+ return( false );
+ }
+ }
+ }
+
+ if( (filterTP->op != AVM_OPCODE_NULL) && (filterTP->op != aTP->op) )
+ {
+ switch( filterTP->op )
+ {
+ case AVM_OPCODE_INPUT:
+ {
+ switch( aTP->op )
+ {
+ case AVM_OPCODE_INPUT:
+ case AVM_OPCODE_INPUT_BROADCAST:
+ case AVM_OPCODE_INPUT_BUFFER:
+ case AVM_OPCODE_INPUT_ENV:
+ case AVM_OPCODE_INPUT_FLOW:
+ case AVM_OPCODE_INPUT_FROM:
+ case AVM_OPCODE_INPUT_MULTI_RDV:
+ case AVM_OPCODE_INPUT_RDV:
+ case AVM_OPCODE_INPUT_DELEGATE:
+ case AVM_OPCODE_INPUT_VAR:
+ {
+ break;
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+ break;
+ }
+
+ case AVM_OPCODE_OUTPUT:
+ {
+ switch( aTP->op )
+ {
+ case AVM_OPCODE_OUTPUT:
+ case AVM_OPCODE_OUTPUT_BROADCAST:
+ case AVM_OPCODE_OUTPUT_BUFFER:
+ case AVM_OPCODE_OUTPUT_ENV:
+ case AVM_OPCODE_OUTPUT_FLOW:
+ case AVM_OPCODE_OUTPUT_MULTI_RDV:
+ case AVM_OPCODE_OUTPUT_RDV:
+ case AVM_OPCODE_OUTPUT_TO:
+ case AVM_OPCODE_OUTPUT_DELEGATE:
+ case AVM_OPCODE_OUTPUT_VAR:
+ {
+ break;
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+ break;
+ }
+
+ case AVM_OPCODE_ENABLE_SET:
+ {
+ switch( aTP->op )
+ {
+ case AVM_OPCODE_RUN:
+ case AVM_OPCODE_IRUN:
+ {
+ break;
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+ break;
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+ }
+
+ if( (filterTP->machine != NULL) && (filterTP->machine != aTP->machine) )
+ {
+ if( aTP->config != NULL )
+ {
+ if( filterTP->machine->getSpecifier().isDesignModel() )
+ {
+ RuntimeID aRID = aTP->config->getRuntimeID();
+
+ while( aRID.valid()
+ && (aRID.getModelInstance() != filterTP->machine) )
+ {
+ aRID = aRID.getPRID();
+ }
+
+ if( aRID.invalid() )
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ RuntimeID aRID = aTP->config->getRuntimeID();
+
+ while( aRID.valid() &&
+ (aRID.getInstance() != filterTP->machine) )
+ {
+ aRID = aRID.getPRID();
+ }
+
+ if( aRID.invalid() )
+ {
+ return( false );
+ }
+ }
+ }
+ }
+
+ if( (filterTP->object != NULL) && (filterTP->object != aTP->object) )
+ {
+ return( false );
+ }
+
+ if( filterTP->value.valid() && filterTP->value.isEQ(aTP->value) )
+ {
+ return( false );
+ }
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// FILTERING API : check if VARIABLE pass
+////////////////////////////////////////////////////////////////////////////////
+
+bool TraceFilter::pass(const RuntimeID & aRID, InstanceOfData * aVariable)
+{
+ if( listOfVariableTracePoint.nonempty() )
+ {
+ ListOfTracePoint::const_iterator it = listOfVariableTracePoint.begin();
+ ListOfTracePoint::const_iterator itEnd = listOfVariableTracePoint.end();
+
+ for( ; it != itEnd ; ++it )
+ {
+ if( pass(*it, aRID, aVariable) )
+ {
+ return( true );
+ }
+ }
+ }
+
+ return( false );
+}
+
+
+bool TraceFilter::pass(TracePoint * filterTP,
+ const RuntimeID & aRID, InstanceOfData * aVariable)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRACE )
+ AVM_OS_TRACE << TAB;
+ filterTP->toStream(AVM_OS_TRACE << AVM_TAB_INDENT);
+ AVM_OS_TRACE << END_INDENT;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRACE )
+
+ if( filterTP->nature == ENUM_TRACE_POINT::TRACE_VARIABLE_NATURE )
+ {
+ if( filterTP->op == AVM_OPCODE_ASSIGN )
+ {
+ //!! IGNORED
+ }
+
+
+ if( (filterTP->machine == NULL)
+ || ( (filterTP->machine == aRID.getInstance())
+ && filterTP->machine->getSpecifier().hasDesignInstance() )
+ || ( (filterTP->machine->getExecutable() == aRID.getExecutable())
+ && filterTP->machine->getSpecifier().hasDesignModel() ) )
+ {
+ return( filterTP->any_object ||
+ (filterTP->object == aVariable) );
+ }
+ }
+
+ return( false );
+}
+
+
+////////////////////////////////////////////////////////////////////////////
+// FILTERING API : check if Execution Trace
+// a.k.a. ExecutionConfiguration pass
+////////////////////////////////////////////////////////////////////////////
+
+bool TraceFilter::pass(TracePoint * filterTP,
+ ExecutionConfiguration * anExecConfTP)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRACE )
+ AVM_OS_TRACE << TAB;
+ filterTP->toStream(AVM_OS_TRACE << AVM_TAB_INDENT);
+ AVM_OS_TRACE << END_INDENT;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRACE )
+
+ if( anExecConfTP->isAvmCode() )
+ {
+ return( pass(filterTP, anExecConfTP->getAvmCode()) );
+ }
+ else if( anExecConfTP->isTransition() )
+ {
+ return( pass(filterTP, anExecConfTP->getRuntimeID(),
+ anExecConfTP->getTransition()) );
+ }
+ else if( anExecConfTP->isOperator() && (filterTP->op != AVM_OPCODE_NULL) )
+ {
+ AVM_OPCODE opcodeTP = anExecConfTP->getOperator()->getOptimizedOpCode();
+
+ if( (filterTP->op != AVM_OPCODE_NULL) && (filterTP->op != opcodeTP ) )
+ {
+ switch( filterTP->op )
+ {
+ case AVM_OPCODE_ENABLE_SET:
+ {
+ switch( opcodeTP )
+ {
+ case AVM_OPCODE_RUN:
+ case AVM_OPCODE_IRUN:
+ {
+ break;
+ }
+ default:
+ {
+ return( false );
+ }
+ }
+ break;
+ }
+ default:
+ {
+ return( false );
+ }
+ }
+ }
+
+ if( (filterTP->machine == NULL)
+ || ( (filterTP->machine ==
+ anExecConfTP->getRuntimeID().getInstance())
+ && filterTP->machine->getSpecifier().hasDesignInstance() )
+ || ( (filterTP->machine->getExecutable() ==
+ anExecConfTP->getRuntimeID().getExecutable())
+ && filterTP->machine->getSpecifier().hasDesignModel() ) )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+
+////////////////////////////////////////////////////////////////////////////
+// FILTERING API : check if a Compiled Element pass
+////////////////////////////////////////////////////////////////////////////
+
+bool TraceFilter::pass(TracePoint * filterTP,
+ const RuntimeID & aRID, BaseCompiledForm * anElement)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRACE )
+ AVM_OS_TRACE << TAB;
+ filterTP->toStream(AVM_OS_TRACE << AVM_TAB_INDENT);
+ AVM_OS_TRACE << END_INDENT;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRACE )
+
+ if( (filterTP->machine == NULL)
+ || ( (filterTP->machine == aRID.getInstance())
+ && filterTP->machine->getSpecifier().hasDesignInstance() )
+ || ( (filterTP->machine->getExecutable() == aRID.getExecutable())
+ && filterTP->machine->getSpecifier().hasDesignModel() ) )
+ {
+ return( filterTP->any_object ||
+ (filterTP->object == anElement) );
+ }
+
+ return( false );
+}
+
+
+////////////////////////////////////////////////////////////////////////////
+// FILTERING API : check if a Runtime Machine ID pass
+////////////////////////////////////////////////////////////////////////////
+
+bool TraceFilter::pass(TracePoint * filterTP, const RuntimeID & aRID)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRACE )
+ AVM_OS_TRACE << TAB;
+ filterTP->toStream(AVM_OS_TRACE << AVM_TAB_INDENT);
+ AVM_OS_TRACE << END_INDENT;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRACE )
+
+ switch( filterTP->nature )
+ {
+ case ENUM_TRACE_POINT::TRACE_RUNNABLE_NATURE:
+ case ENUM_TRACE_POINT::TRACE_MACHINE_NATURE:
+ {
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_STATE_NATURE:
+ {
+ if( not aRID.getSpecifier().isFamilyComponentState() )
+ {
+ return( false );
+ }
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_STATEMACHINE_NATURE:
+ {
+ if( (not aRID.getSpecifier().isComponentStatemachine()) )
+// && (not aRID.getSpecifier().isMocStateTransitionStructure()) )
+ {
+ return( false );
+ }
+ break;
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+
+ if( filterTP->machine == NULL )
+ {
+ return( filterTP->any_object
+ || (filterTP->object == aRID.getInstance()) );
+ }
+ else
+ {
+ return( ( (filterTP->machine == aRID.getInstance())
+ && filterTP->machine->getSpecifier().hasDesignInstance() )
+ || ( (filterTP->machine->getExecutable() == aRID.getExecutable())
+ && filterTP->machine->getSpecifier().hasDesignModel() ) );
+ }
+
+ return( false );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// FILTERING API : check if AVM CODE pass
+////////////////////////////////////////////////////////////////////////////////
+
+bool TraceFilter::pass(TracePoint * filterTP, AvmCode * aCodeTP)
+{
+AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRACE )
+ AVM_OS_TRACE << TAB;
+ filterTP->toStream(AVM_OS_TRACE << AVM_TAB_INDENT);
+ AVM_OS_TRACE << END_INDENT;
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRACE )
+
+ AVM_OPCODE opcodeTP = aCodeTP->getOptimizedOpCode();
+
+ if( (filterTP->op != AVM_OPCODE_NULL) && (filterTP->op != opcodeTP ) )
+ {
+ switch( filterTP->op )
+ {
+ case AVM_OPCODE_INPUT:
+ {
+ switch( opcodeTP )
+ {
+ case AVM_OPCODE_INPUT:
+ case AVM_OPCODE_INPUT_BROADCAST:
+ case AVM_OPCODE_INPUT_BUFFER:
+ case AVM_OPCODE_INPUT_ENV:
+ case AVM_OPCODE_INPUT_FLOW:
+ case AVM_OPCODE_INPUT_FROM:
+ case AVM_OPCODE_INPUT_MULTI_RDV:
+ case AVM_OPCODE_INPUT_RDV:
+ case AVM_OPCODE_INPUT_DELEGATE:
+ case AVM_OPCODE_INPUT_VAR:
+ {
+ break;
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+ break;
+ }
+
+ case AVM_OPCODE_OUTPUT:
+ {
+ switch( opcodeTP )
+ {
+ case AVM_OPCODE_OUTPUT:
+ case AVM_OPCODE_OUTPUT_BROADCAST:
+ case AVM_OPCODE_OUTPUT_BUFFER:
+ case AVM_OPCODE_OUTPUT_ENV:
+ case AVM_OPCODE_OUTPUT_FLOW:
+ case AVM_OPCODE_OUTPUT_MULTI_RDV:
+ case AVM_OPCODE_OUTPUT_RDV:
+ case AVM_OPCODE_OUTPUT_TO:
+ case AVM_OPCODE_OUTPUT_DELEGATE:
+ case AVM_OPCODE_OUTPUT_VAR:
+ {
+ break;
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+ break;
+ }
+
+ case AVM_OPCODE_ENABLE_SET:
+ {
+ switch( opcodeTP )
+ {
+ case AVM_OPCODE_RUN:
+ case AVM_OPCODE_IRUN:
+ {
+ break;
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+ break;
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+ }
+
+ if( aCodeTP->empty() )
+ {
+ return( true );
+ }
+
+ if( (filterTP->machine != NULL)
+ && (aCodeTP->first() == filterTP->machine) )
+ {
+ return( true );
+ }
+
+ if( (filterTP->object != NULL)
+ && (aCodeTP->first() == filterTP->object) )
+ {
+ return( true );
+ }
+
+ if( filterTP->value.valid() && aCodeTP->populated() )
+ {
+ if( filterTP->value.is< ArrayBF >() )
+ {
+ const ArrayBF & arrayValue = filterTP->value.to_ref< ArrayBF >();
+ avm_size_t arraySize = arrayValue.size();
+
+ if( arraySize == aCodeTP->size() )
+ {
+ AvmCode::const_iterator itTP = aCodeTP->begin();
+
+ for( avm_size_t offset = 0 ;
+ (offset < arraySize) ; ++offset , ++itTP )
+ {
+ if( not (*itTP).isEQ( arrayValue[offset] ) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ return( filterTP->value.isEQ( aCodeTP->second() ) );
+ }
+ }
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// SERIALIZATION API
+////////////////////////////////////////////////////////////////////////////////
+
+void TraceFilter::toStream(OutStream & os) const
+{
+ os << TAB << "filter { "
+ << OperatorLib::to_string(mainTracePointFiter.getAvmOpCode())
+ << EOL_INCR_INDENT;
+
+ AvmCode::const_iterator it = mainTracePointFiter.begin();
+ AvmCode::const_iterator endIt = mainTracePointFiter.end();
+ for( ; it != endIt ; ++it )
+ {
+ (*it).toStream(os);
+ }
+
+ os << DECR_INDENT_TAB << "}" << EOL_FLUSH;
+
+ os << TAB << "flag [ " << EOL_INCR_INDENT
+ << TAB << "Condition : [ " << mConditionFlag
+ << " , decision:" << mDecisionFlag
+ << " ]"<< EOL
+
+ << TAB << "Trace_cond : [ path:" << mPathConditionFlag
+ << " , node:" << mNodeConditionFlag
+ << " ]"<< EOL
+
+ << TAB << "Timed_cond : [ path:" << mPathTimedConditionFlag
+ << " , node:" << mNodeTimedConditionFlag
+ << " ]"<< EOL
+
+ << TAB << "Leaf_cond : [ path:" << mPathConditionLeafNodeFlag
+ << " , timed:" << mPathTimedConditionLeafNodeFlag
+ << " ]"<< EOL
+
+ << TAB << "Variable : [ time:" << mTimeFilterFlag
+ << " , assign:" << mAssignFilterFlag
+ << " , newfresh:" << mNewfreshFilterFlag
+ << " ]"<< EOL
+
+ << TAB << "Input : [ " << mInputFilterFlag
+ << " , env:" << mInputEnvFilterFlag
+ << " , rdv:" << mInputRdvFilterFlag << " ]"<< EOL
+
+ << TAB << "Output : [ " << mOutputFilterFlag
+ << " , env:" << mOutputEnvFilterFlag
+ << " , rdv:" << mOutputRdvFilterFlag
+ << " ]"<< EOL
+
+ << TAB << "Machine : [ " << mMachineFilterFlag
+ << " , state:" << mStateFilterFlag
+ << " , statemachine:" << mStatemachineFilterFlag
+ << " ]"<< EOL
+
+ << TAB << "Routine : [ " << mRoutineFilterFlag
+ << " , transition:" << mTransitionFilterFlag
+ << " ]"<< EOL
+
+ << TAB << "Abstract : [ com:" << mComFilterFlag
+ << " , io#trace:" << mIOTraceFilterFlag
+ << " , runnable:" << mRunnableFilterFlag
+ << " ]"<< EOL
+ << DECR_INDENT_TAB << "]" << EOL_FLUSH;
+}
+
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/trace/TraceFilter.h b/org.eclipse.efm.symbex/src/fml/trace/TraceFilter.h
new file mode 100644
index 0000000..11d9dc5
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/trace/TraceFilter.h
@@ -0,0 +1,648 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 11 déc. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef TRACEFILTER_H_
+#define TRACEFILTER_H_
+
+#include <collection/List.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/operator/OperatorLib.h>
+
+#include <fml/trace/TracePoint.h>
+
+
+namespace sep
+{
+
+
+class BF;
+
+class EvaluationEnvironment;
+class ExecutionConfiguration;
+class ExecutableSystem;
+
+
+class InstanceOfData;
+
+class TraceFilter
+{
+
+public:
+ /**
+ * ATTRIBUTE
+ */
+ AvmCode mainTracePointFiter;
+
+ ListOfTracePoint listOfVariableTracePoint;
+
+ InstanceOfData * objectDeltaTime;
+
+protected:
+
+ bool mConditionFlag;
+ bool mDecisionFlag;
+
+ bool mPathConditionFlag;
+ bool mPathTimedConditionFlag;
+
+ bool mPathConditionLeafNodeFlag;
+ bool mPathTimedConditionLeafNodeFlag;
+
+ bool mNodeConditionFlag;
+ bool mNodeTimedConditionFlag;
+
+ bool mNodeConditionLeafNodeFlag;
+ bool mNodeTimedConditionLeafNodeFlag;
+
+ bool mTimeFilterFlag;
+ bool mAssignFilterFlag;
+ bool mNewfreshFilterFlag;
+
+ bool mInputEnvFilterFlag;
+ bool mInputRdvFilterFlag;
+
+ bool mInputExternalFilterFlag;
+ bool mInputInternalFilterFlag;
+ bool mInputFilterFlag;
+
+ bool mOutputEnvFilterFlag;
+ bool mOutputRdvFilterFlag;
+
+ bool mOutputExternalFilterFlag;
+ bool mOutputInternalFilterFlag;
+ bool mOutputFilterFlag;
+
+ bool mMachineFilterFlag;
+ bool mStateFilterFlag;
+ bool mStatemachineFilterFlag;
+ bool mTransitionFilterFlag;
+ bool mRoutineFilterFlag;
+
+ bool mComExternalFilterFlag;
+ bool mComInternalFilterFlag;
+ bool mComFilterFlag;
+
+ bool mIOTraceFilterFlag;
+ bool mRunnableFilterFlag;
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TraceFilter()
+ : mainTracePointFiter( ),
+ listOfVariableTracePoint( ),
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing Variables
+ objectDeltaTime( NULL ),
+
+ mConditionFlag( false ),
+ mDecisionFlag( false ),
+
+ mPathConditionFlag( false ),
+ mPathTimedConditionFlag( false ),
+
+ mPathConditionLeafNodeFlag( false ),
+ mPathTimedConditionLeafNodeFlag( false ),
+
+ mNodeConditionFlag( false ),
+ mNodeTimedConditionFlag( false ),
+
+ mNodeConditionLeafNodeFlag( false ),
+ mNodeTimedConditionLeafNodeFlag( false ),
+
+ mTimeFilterFlag( false ),
+ mAssignFilterFlag( false ),
+ mNewfreshFilterFlag( false ),
+
+ mInputEnvFilterFlag( false ),
+ mInputRdvFilterFlag( false ),
+
+ mInputExternalFilterFlag( false ),
+ mInputInternalFilterFlag( false ),
+ mInputFilterFlag( false ),
+
+ mOutputEnvFilterFlag( false ),
+ mOutputRdvFilterFlag( false ),
+
+ mOutputExternalFilterFlag( false ),
+ mOutputInternalFilterFlag( false ),
+ mOutputFilterFlag( false ),
+
+ mMachineFilterFlag( false ),
+ mStateFilterFlag( false ),
+ mStatemachineFilterFlag( false ),
+ mTransitionFilterFlag( false ),
+ mRoutineFilterFlag( false ),
+
+ mComExternalFilterFlag( false ),
+ mComInternalFilterFlag( false ),
+ mComFilterFlag( false ),
+
+ mIOTraceFilterFlag( false ),
+ mRunnableFilterFlag( false )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~TraceFilter()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool configure(EvaluationEnvironment & ENV,
+ WObject * wfParameterObject, WObject * wfTraceObject);
+
+ bool configure(EvaluationEnvironment & ENV, WObject * wfParameterObject,
+ const std::string & aWSequenceNameID,
+ const std::string & aWSequenceElseNameID);
+
+ inline bool configure(
+ EvaluationEnvironment & ENV, WObject * wfParameterObject)
+ {
+ return( configure(ENV, wfParameterObject, "trace", "TRACE") );
+ }
+
+
+ inline bool contains(ENUM_TRACE_POINT::TRACE_NATURE nature, AVM_OPCODE op)
+ {
+ return( mainTracePointFiter.empty()
+ || ( (op == AVM_OPCODE_NULL)
+ && (nature == ENUM_TRACE_POINT::TRACE_UNDEFINED_NATURE) )
+ || contains(nature, op, & mainTracePointFiter) );
+ }
+
+ inline bool contains(ENUM_TRACE_POINT::TRACE_NATURE nature)
+ {
+ return( mainTracePointFiter.empty() ||
+ (nature == ENUM_TRACE_POINT::TRACE_UNDEFINED_NATURE) ||
+ contains(nature, AVM_OPCODE_NULL, & mainTracePointFiter) );
+ }
+
+ inline bool contains(AVM_OPCODE op)
+ {
+ return( contains(ENUM_TRACE_POINT::TRACE_UNDEFINED_NATURE, op) );
+ }
+
+ inline bool containsOr(AVM_OPCODE op1, AVM_OPCODE op2)
+ {
+ return( contains(ENUM_TRACE_POINT::TRACE_UNDEFINED_NATURE, op1) ||
+ contains(ENUM_TRACE_POINT::TRACE_UNDEFINED_NATURE, op2) );
+ }
+
+ inline bool containsCom()
+ {
+ return( contains(ENUM_TRACE_POINT::TRACE_COM_NATURE ) ||
+ contains(ENUM_TRACE_POINT::TRACE_CHANNEL_NATURE) ||
+ contains(ENUM_TRACE_POINT::TRACE_MESSAGE_NATURE) ||
+ contains(ENUM_TRACE_POINT::TRACE_PORT_NATURE ) ||
+ contains(ENUM_TRACE_POINT::TRACE_SIGNAL_NATURE ) );
+ }
+
+ bool contains(ENUM_TRACE_POINT::TRACE_NATURE nature,
+ AVM_OPCODE op, AvmCode * aCode) const;
+
+ bool contains(ENUM_TRACE_POINT::TRACE_NATURE nature,
+ AVM_OPCODE op, const BF & arg) const;
+
+
+ /**
+ * Update
+ * Filter Point Flags
+ */
+// void updateFilterFlags();
+
+
+ inline bool hasConditionPoint() const
+ {
+ return( mConditionFlag );
+ }
+
+ inline bool hasDecisionPoint() const
+ {
+ return( mDecisionFlag );
+ }
+
+
+ inline bool hasPathConditionPoint() const
+ {
+ return( mPathConditionFlag );
+ }
+
+ inline bool hasPathTimedConditionPoint() const
+ {
+ return( mPathTimedConditionFlag );
+ }
+
+
+ inline bool hasPathConditionLeafNodePoint() const
+ {
+ return( mPathConditionLeafNodeFlag );
+ }
+
+ inline bool hasPathTimedConditionLeafNodePoint() const
+ {
+ return( mPathTimedConditionLeafNodeFlag );
+ }
+
+
+ inline bool hasPathConditionTracePoint() const
+ {
+ return( mPathConditionFlag || mPathConditionLeafNodeFlag );
+ }
+
+ inline bool hasPathTimedConditionTracePoint() const
+ {
+ return( mPathTimedConditionFlag || mPathTimedConditionLeafNodeFlag );
+ }
+
+
+ inline bool hasNodeConditionPoint() const
+ {
+ return( mNodeConditionFlag );
+ }
+
+ inline bool hasNodeTimedConditionPoint() const
+ {
+ return( mNodeTimedConditionFlag );
+ }
+
+
+ inline bool hasTimePoint() const
+ {
+ return( mTimeFilterFlag );
+ }
+
+ inline bool hasAssignPoint() const
+ {
+ return( mAssignFilterFlag );
+ }
+
+ inline bool hasNewfreshPoint() const
+ {
+ return( mNewfreshFilterFlag );
+ }
+
+
+ inline bool hasInputEnvPoint() const
+ {
+ return( mInputEnvFilterFlag );
+ }
+
+ inline bool hasInputRdvPoint() const
+ {
+ return( mInputRdvFilterFlag );
+ }
+
+ inline bool hasInputPoint() const
+ {
+ return( mInputFilterFlag );
+ }
+
+
+ inline bool hasOutputEnvPoint() const
+ {
+ return( mOutputEnvFilterFlag );
+ }
+
+ inline bool hasOutputRdvPoint() const
+ {
+ return( mOutputRdvFilterFlag );
+ }
+
+ inline bool hasOutputPoint() const
+ {
+ return( mOutputFilterFlag );
+ }
+
+
+ inline bool hasMachinePoint() const
+ {
+ return( mMachineFilterFlag );
+ }
+
+ inline bool hasStatePoint() const
+ {
+ return( mStateFilterFlag );
+ }
+
+ inline bool hasStatemachinePoint() const
+ {
+ return( mStatemachineFilterFlag );
+ }
+
+ inline bool hasTransitionPoint() const
+ {
+ return( mTransitionFilterFlag );
+ }
+
+ inline bool hasRoutinePoint() const
+ {
+ return( mRoutineFilterFlag );
+ }
+
+
+ inline bool hasComPoint() const
+ {
+ return( mComFilterFlag );
+ }
+
+ inline bool hasIOTracePoint() const
+ {
+ return( mIOTraceFilterFlag );
+ }
+
+ inline bool hasRunnablePoint() const
+ {
+ return( mRunnableFilterFlag );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FILTERING API: check if a generic pointer Element pass
+ ////////////////////////////////////////////////////////////////////////////
+
+ template< class T > bool pass(T * anElement)
+ {
+ if( anElement == NULL )
+ {
+ return( false );
+ }
+
+
+ AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRACE )
+ AVM_OS_TRACE << std::endl;
+ AVM_OS_TRACE << "candidat :> " << anElement->str() << std::endl;
+ AVM_OS_TRACE << "filterTP :>" << std::endl;
+ AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRACE )
+
+ return( pass(& mainTracePointFiter, anElement) );
+ }
+
+ template< class T > bool pass(const BF & filterArg, T * anElement)
+ {
+ if( filterArg.is< TracePoint >() )
+ {
+ return( pass(filterArg.to_ptr< TracePoint >(), anElement) );
+ }
+
+ else if( filterArg.is< AvmCode >() )
+ {
+ return( pass(filterArg.to_ptr< AvmCode >(), anElement) );
+ }
+ return( false );
+ }
+
+ template< class T > bool pass(AvmCode * filterCode, T * anElement)
+ {
+ switch( filterCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_AND:
+ {
+ AvmCode::const_iterator itFilter = filterCode->begin();
+ AvmCode::const_iterator endIt = filterCode->end();
+ for( ; itFilter != endIt ; ++itFilter )
+ {
+ if( not pass((*itFilter), anElement) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+
+ case AVM_OPCODE_OR:
+ {
+ AvmCode::const_iterator itFilter = filterCode->begin();
+ AvmCode::const_iterator endIt = filterCode->end();
+ for( ; itFilter != endIt ; ++itFilter )
+ {
+ if( pass((*itFilter), anElement) )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+ }
+
+ case AVM_OPCODE_XOR:
+ {
+ avm_size_t passCount = 0;
+
+ AvmCode::const_iterator itFilter = filterCode->begin();
+ AvmCode::const_iterator endIt = filterCode->end();
+ for( ; itFilter != endIt ; ++itFilter )
+ {
+ if( pass((*itFilter), anElement) )
+ {
+ if( ++passCount > 1 )
+ {
+ return( false );
+ }
+ }
+ }
+
+ return( passCount == 1 );
+ }
+
+ case AVM_OPCODE_NOT:
+ {
+ return( not pass(filterCode->first(), anElement) );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FILTERING API: check if a generic reference Element pass
+ ////////////////////////////////////////////////////////////////////////////
+
+ template< class T > bool pass(T & anElement)
+ {
+ if( anElement == NULL )
+ {
+ return( false );
+ }
+
+
+ AVM_IF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRACE )
+ AVM_OS_TRACE << std::endl;
+ AVM_OS_TRACE << "candidat :> " << anElement.str() << std::endl;
+ AVM_OS_TRACE << "filterTP :>" << std::endl;
+ AVM_ENDIF_DEBUG_LEVEL_FLAG2( HIGH , PROCESSOR , TRACE )
+
+ return( pass(& mainTracePointFiter, anElement) );
+ }
+
+ template< class T > bool pass(const BF & filterArg, T & anElement)
+ {
+ if( filterArg.is< TracePoint >() )
+ {
+ return( pass(filterArg.to_ptr< TracePoint >(), anElement) );
+ }
+
+ else if( filterArg.is< AvmCode >() )
+ {
+ return( pass(filterArg.to_ptr< AvmCode >(), anElement) );
+ }
+ return( false );
+ }
+
+ template< class T > bool pass(AvmCode * filterCode, T & anElement)
+ {
+ switch( filterCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_AND:
+ {
+ AvmCode::const_iterator itFilter = filterCode->begin();
+ AvmCode::const_iterator endIt = filterCode->end();
+ for( ; itFilter != endIt ; ++itFilter )
+ {
+ if( not pass((*itFilter), anElement) )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+ }
+
+ case AVM_OPCODE_OR:
+ {
+ AvmCode::const_iterator itFilter = filterCode->begin();
+ AvmCode::const_iterator endIt = filterCode->end();
+ for( ; itFilter != endIt ; ++itFilter )
+ {
+ if( pass((*itFilter), anElement) )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+ }
+
+ case AVM_OPCODE_XOR:
+ {
+ avm_size_t passCount = 0;
+
+ AvmCode::const_iterator itFilter = filterCode->begin();
+ AvmCode::const_iterator endIt = filterCode->end();
+ for( ; itFilter != endIt ; ++itFilter )
+ {
+ if( pass((*itFilter), anElement) )
+ {
+ if( ++passCount > 1 )
+ {
+ return( false );
+ }
+ }
+ }
+
+ return( passCount == 1 );
+ }
+
+ case AVM_OPCODE_NOT:
+ {
+ return( not pass(filterCode->first(), anElement) );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FILTERING API : check if TRACE POINT pass
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool pass(TracePoint * filterTP, TracePoint * aTP);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FILTERING API : check if VARIABLE pass
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool pass(const RuntimeID & aRID, InstanceOfData * aVariable);
+
+ bool pass(TracePoint * filterTP,
+ const RuntimeID & aRID, InstanceOfData * aVariable);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FILTERING API : check if Execution Trace
+ // a.k.a. ExecutionConfiguration pass
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool pass(TracePoint * filterTP, ExecutionConfiguration * anExecConfTP);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FILTERING API : check if a Compiled Element pass
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool pass(TracePoint * filterTP,
+ const RuntimeID & aRID, BaseCompiledForm * anElement);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FILTERING API : check if a Runtime Machine ID pass
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool pass(TracePoint * filterTP, const RuntimeID & aRID);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FILTERING API : check if AVM CODE pass
+ ////////////////////////////////////////////////////////////////////////////
+
+ bool pass(TracePoint * filterTP, AvmCode * aCodeTP);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SERIALIZATION API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual void toStream(OutStream & os) const;
+
+};
+
+
+
+} /* namespace sep */
+
+#endif /* TRACEFILTER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/trace/TracePoint.cpp b/org.eclipse.efm.symbex/src/fml/trace/TracePoint.cpp
new file mode 100644
index 0000000..b1619d7
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/trace/TracePoint.cpp
@@ -0,0 +1,1880 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 11 déc. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "TracePoint.h"
+
+#include <fml/common/ObjectElement.h>
+#include <fml/common/SpecifierElement.h>
+
+#include <fml/expression/BuiltinArray.h>
+#include <fml/expression/ExpressionConstructor.h>
+
+#include <fml/executable/BaseInstanceForm.h>
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/ExecutableQuery.h>
+#include <fml/executable/ExecutableSystem.h>
+#include <fml/executable/InstanceOfData.h>
+#include <fml/executable/InstanceOfMachine.h>
+#include <fml/executable/InstanceOfPort.h>
+
+#include <fml/runtime/ExecutionConfiguration.h>
+#include <fml/runtime/ExecutionContext.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+#include <fml/type/TypeManager.h>
+
+#include <fml/workflow/Query.h>
+
+#include <sew/Configuration.h>
+
+#include <util/avm_string.h>
+
+
+namespace sep
+{
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+TracePoint::TracePoint(ENUM_TRACE_POINT::TRACE_NATURE aNature,
+ AVM_OPCODE anOP, const BF & aValue)
+: Element( CLASS_KIND_T( TracePoint ) ),
+tpid( 0 ),
+
+EC( ExecutionContext::_NULL_ ),
+config( NULL ),
+
+nature( aNature ),
+op( anOP ),
+
+RID( ),
+
+machine( NULL ),
+
+object ( NULL ),
+any_object( false ),
+
+value( aValue )
+{
+ //!! NOTHING
+}
+
+
+TracePoint::TracePoint(ENUM_TRACE_POINT::TRACE_NATURE aNature,
+ AVM_OPCODE anOP, InstanceOfMachine * aMachine,
+ ObjectElement * anObject, const BF & aValue)
+: Element( CLASS_KIND_T( TracePoint ) ),
+tpid( 0 ),
+
+EC( ExecutionContext::_NULL_ ),
+config( NULL ),
+
+nature( aNature ),
+op( anOP ),
+
+RID( ),
+
+machine( aMachine ),
+
+object( anObject ),
+any_object( false ),
+
+value( aValue )
+{
+ //!! NOTHING
+}
+
+
+TracePoint::TracePoint(ENUM_TRACE_POINT::TRACE_NATURE aNature,
+ AVM_OPCODE anOP, const RuntimeID & aRID,
+ ObjectElement * anObject, const BF & aValue)
+: Element( CLASS_KIND_T( TracePoint ) ),
+tpid( 0 ),
+
+EC( ExecutionContext::_NULL_ ),
+config( NULL ),
+
+nature( aNature ),
+op( anOP ),
+
+RID( aRID ),
+
+machine( aRID.getInstance() ),
+
+object( anObject ),
+any_object( false ),
+
+value( aValue )
+{
+ //!! NOTHING
+}
+
+
+/**
+ * CONSTRUCTOR
+ * for Meta point
+ * TRACE_COMMENT_NATURE
+ * TRACE_SEPARATOR_NATURE
+ * TRACE_NEWLINE_NATURE
+ * TRACE_STEP_NATURE
+ */
+TracePoint::TracePoint(ENUM_TRACE_POINT::TRACE_NATURE aNature,
+ const std::string & strSeparator)
+: Element( CLASS_KIND_T( TracePoint ) ),
+tpid( 0 ),
+
+EC( ExecutionContext::_NULL_ ),
+config( NULL ),
+nature( aNature ),
+op( AVM_OPCODE_NULL ),
+
+machine( NULL ),
+
+object ( NULL ),
+any_object( false ),
+
+value( ExpressionConstructor::newString(strSeparator) )
+{
+ //!! NOTHING
+}
+
+TracePoint::TracePoint(const ExecutionContext & anEC,
+ ENUM_TRACE_POINT::TRACE_NATURE aNature,
+ const std::string & strSeparator)
+: Element( CLASS_KIND_T( TracePoint ) ),
+tpid( 0 ),
+
+EC( anEC ),
+config( NULL ),
+nature( aNature ),
+op( AVM_OPCODE_NULL ),
+
+machine( NULL ),
+
+object ( NULL ),
+any_object( false ),
+
+value( ExpressionConstructor::newString(strSeparator) )
+{
+ //!! NOTHING
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+
+void TracePoint::updateRID(const ExecutionData & anED)
+{
+ if( RID.valid() || ((object == NULL) && (machine == NULL)))
+ {
+ return;
+ }
+
+ else if( object != NULL )
+ {
+ if( object->is< InstanceOfMachine >() )
+ {
+ if( object->to< InstanceOfMachine >()->
+ getExecutable()->hasSingleRuntimeInstance() )
+ {
+ RID = anED.getRuntimeID( object->to< InstanceOfMachine >() );
+ }
+ }
+
+ else if( object->is< BaseAvmProgram >() )
+ {
+ if( object->to< BaseAvmProgram >()->
+ getExecutable()->hasSingleRuntimeInstance() )
+ {
+ RID = anED.getRuntimeID(
+ object->to< BaseAvmProgram >()->getExecutable() );
+ }
+ }
+
+ else if( machine != NULL )
+ {
+ if( machine->getExecutable()->hasSingleRuntimeInstance() )
+ {
+ RID = anED.getRuntimeID( machine );
+ }
+ }
+
+ else if( object->is< BaseInstanceForm >() &&
+ object->to< BaseInstanceForm >()->hasRuntimeContainerRID() )
+ {
+ RID = object->to< BaseInstanceForm >()->getRuntimeContainerRID();
+ }
+ }
+
+ else if( machine != NULL )
+ {
+ if( machine->getExecutable()->hasSingleRuntimeInstance() )
+ {
+ RID = anED.getRuntimeID( machine );
+ }
+ }
+
+ else
+ {
+ ExecutableForm * anExecutable = getExecutable();
+
+ if( (anExecutable != NULL) && anExecutable->hasSingleRuntimeInstance() )
+ {
+ RID = anED.getRuntimeID( anExecutable );
+
+ if( RID.valid() )
+ {
+ machine = RID.getInstance();
+ }
+ }
+ }
+}
+
+
+void TracePoint::updateMachine(
+ const Configuration & aConfiguration,
+ const std::string & aQualifiedNameID)
+{
+ ExecutableQuery XQuery( aConfiguration );
+
+ if( aQualifiedNameID.find('.') == std::string::npos )
+ {
+ machine = XQuery.getMachineByNameID(
+ Specifier::DESIGN_INSTANCE_KIND, aQualifiedNameID).rawMachine();
+ if( machine == NULL )
+ {
+ machine = XQuery.getMachineByNameID(
+ Specifier::DESIGN_MODEL_KIND, aQualifiedNameID).rawMachine();
+ }
+ }
+ else
+ {
+ machine = XQuery.getMachineByQualifiedNameID(
+ Specifier::DESIGN_INSTANCE_KIND, aQualifiedNameID).rawMachine();
+ if( machine == NULL )
+ {
+ machine = XQuery.getMachineByQualifiedNameID(
+ Specifier::DESIGN_MODEL_KIND, aQualifiedNameID).rawMachine();
+ }
+ }
+}
+
+
+bool TracePoint::configurePort(
+ const Configuration & aConfiguration,
+ const std::string & aQualifiedNameID,
+ ListOfTracePoint & otherTracePoint)
+{
+ // ENVIRONMENT COMMUNICATION PROTOCOL
+ if( aQualifiedNameID == "env" )
+ {
+ switch( op )
+ {
+ case AVM_OPCODE_INPUT:
+ case AVM_OPCODE_INPUT_ENV:
+ {
+ op = AVM_OPCODE_INPUT_ENV;
+ break;
+ }
+
+ case AVM_OPCODE_OUTPUT:
+ case AVM_OPCODE_OUTPUT_ENV:
+ {
+ op = AVM_OPCODE_OUTPUT_ENV;
+ break;
+ }
+
+ case AVM_OPCODE_NULL:
+ default:
+ {
+ op = AVM_OPCODE_INPUT_ENV;
+
+ TracePoint * newTracePoint = new TracePoint( this );
+ newTracePoint->op = AVM_OPCODE_OUTPUT_ENV;
+
+ otherTracePoint.append( newTracePoint );
+
+ break;
+ }
+ }
+
+ return( true );
+ }
+ else if( REGEX_MATCH(aQualifiedNameID, CONS_WID2("input", "env")) )
+ {
+ op = AVM_OPCODE_INPUT_ENV;
+
+ return( true );
+ }
+ else if( REGEX_MATCH(aQualifiedNameID, CONS_WID2("output", "env")) )
+ {
+ op = AVM_OPCODE_OUTPUT_ENV;
+
+ return( true );
+ }
+
+ // RENDEZ-VOUS COMMUNICATION PROTOCOL
+ if( aQualifiedNameID == "rdv" )
+ {
+ switch( op )
+ {
+ case AVM_OPCODE_INPUT:
+ case AVM_OPCODE_INPUT_RDV:
+ {
+ op = AVM_OPCODE_INPUT_RDV;
+ break;
+ }
+
+ case AVM_OPCODE_OUTPUT:
+ case AVM_OPCODE_OUTPUT_RDV:
+ {
+ op = AVM_OPCODE_OUTPUT_RDV;
+ break;
+ }
+
+ case AVM_OPCODE_NULL:
+ default:
+ {
+ op = AVM_OPCODE_INPUT_RDV;
+
+ TracePoint * newTracePoint = new TracePoint( this );
+ newTracePoint->op = AVM_OPCODE_OUTPUT_RDV;
+
+ otherTracePoint.append( newTracePoint );
+
+ break;
+ }
+ }
+
+ return( true );
+ }
+ else if( REGEX_MATCH(aQualifiedNameID, CONS_WID2("input", "rdv")) )
+ {
+ op = AVM_OPCODE_INPUT_RDV;
+
+ return( true );
+ }
+ else if( REGEX_MATCH(aQualifiedNameID, CONS_WID2("output", "rdv")) )
+ {
+ op = AVM_OPCODE_OUTPUT_RDV;
+
+ return( true );
+ }
+
+ else if( REGEX_MATCH(aQualifiedNameID, CONS_WID2("(inout|com)", "env")) )
+ {
+ op = AVM_OPCODE_INPUT_ENV;
+
+ TracePoint * newTracePoint = new TracePoint( this );
+ newTracePoint->op = AVM_OPCODE_OUTPUT_ENV;
+
+ otherTracePoint.append( newTracePoint );
+
+ return( true );
+ }
+
+ else if( REGEX_MATCH(aQualifiedNameID, CONS_WID2("(inout|com)", "rdv")) )
+ {
+ op = AVM_OPCODE_INPUT_RDV;
+
+ TracePoint * newTracePoint = new TracePoint( this );
+ newTracePoint->op = AVM_OPCODE_OUTPUT_RDV;
+
+ otherTracePoint.append( newTracePoint );
+
+ return( true );
+ }
+
+ else if( aQualifiedNameID == "[*]" )
+ {
+ any_object = true;
+
+ return( true );
+ }
+
+ ExecutableQuery XQuery( aConfiguration );
+
+ ListOfSymbol listofPort;
+
+ std::string::size_type pos = aQualifiedNameID.find("->");
+
+ if( pos != std::string::npos )
+ {
+ std::string mid = aQualifiedNameID.substr(0, pos);
+ std::string obj = aQualifiedNameID.substr(pos + 2);
+
+ updateMachine(aConfiguration, mid);
+
+ if( obj == "[*]" )
+ {
+ any_object = true;
+
+ return( true );
+ }
+
+ if( machine != NULL )
+ {
+ ExecutableForm * containerExecutable = machine->getExecutable();
+
+ while( containerExecutable != NULL )
+ {
+ object = containerExecutable->getPort().getByNameID(obj).rawPort();
+
+ if( object == NULL )
+ {
+ containerExecutable =
+ containerExecutable->getExecutableContainer();
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+ else
+ {
+ switch( op )
+ {
+ case AVM_OPCODE_INPUT:
+ case AVM_OPCODE_INPUT_ENV:
+ case AVM_OPCODE_INPUT_RDV:
+ {
+ if( XQuery.getPortByNameID(obj, listofPort,
+ Modifier::DIRECTION_INPUT_KIND, false) )
+ {
+ object = NULL;
+
+ ListOfSymbol::iterator itPort = listofPort.begin();
+ ListOfSymbol::iterator endPort = listofPort.end();
+ for( ; itPort != endPort ; ++itPort )
+ {
+ if( (*itPort).getModifier().isDirectionInput() )
+ {
+ object = (*itPort).rawPort();
+ break;
+ }
+ else if( (object == NULL)
+ && (*itPort).getModifier().isDirectionInout() )
+ {
+ object = (*itPort).rawPort();
+ }
+ }
+ }
+
+ break;
+ }
+
+ case AVM_OPCODE_OUTPUT:
+ case AVM_OPCODE_OUTPUT_ENV:
+ case AVM_OPCODE_OUTPUT_RDV:
+ {
+ if( XQuery.getPortByNameID(obj, listofPort,
+ Modifier::DIRECTION_OUTPUT_KIND, false) )
+ {
+ object = NULL;
+
+ ListOfSymbol::iterator itPort = listofPort.begin();
+ ListOfSymbol::iterator endPort = listofPort.end();
+ for( ; itPort != endPort ; ++itPort )
+ {
+ if( (*itPort).getModifier().isDirectionOutput() )
+ {
+ object = (*itPort).rawPort();
+ break;
+ }
+ else if( (object == NULL)
+ && (*itPort).getModifier().isDirectionInout() )
+ {
+ object = (*itPort).rawPort();
+ }
+ }
+ }
+
+ break;
+ }
+
+ default:
+ {
+ XQuery.getPortByNameID(obj, listofPort);
+
+ configurePort(op, listofPort, otherTracePoint);
+
+ break;
+ }
+ }
+
+ }
+ }
+
+ else if( aQualifiedNameID.find('.') == std::string::npos )
+ {
+ switch( op )
+ {
+ case AVM_OPCODE_INPUT:
+ case AVM_OPCODE_INPUT_ENV:
+ case AVM_OPCODE_INPUT_RDV:
+ {
+ if( XQuery.getPortByQualifiedNameID(aQualifiedNameID,
+ listofPort, Modifier::DIRECTION_INPUT_KIND, false) )
+ {
+ object = NULL;
+
+ ListOfSymbol::iterator itPort = listofPort.begin();
+ ListOfSymbol::iterator endPort = listofPort.end();
+ for( ; itPort != endPort ; ++itPort )
+ {
+ if( (*itPort).getModifier().isDirectionInput() )
+ {
+ object = (*itPort).rawPort();
+ break;
+ }
+ else if( (object == NULL)
+ && (*itPort).getModifier().isDirectionInout() )
+ {
+ object = (*itPort).rawPort();
+ }
+ }
+ }
+
+ break;
+ }
+
+ case AVM_OPCODE_OUTPUT:
+ case AVM_OPCODE_OUTPUT_ENV:
+ case AVM_OPCODE_OUTPUT_RDV:
+ {
+ if( XQuery.getPortByQualifiedNameID(aQualifiedNameID,
+ listofPort, Modifier::DIRECTION_OUTPUT_KIND, false) )
+ {
+ object = NULL;
+
+ ListOfSymbol::iterator itPort = listofPort.begin();
+ ListOfSymbol::iterator endPort = listofPort.end();
+ for( ; itPort != endPort ; ++itPort )
+ {
+ if( (*itPort).getModifier().isDirectionOutput() )
+ {
+ object = (*itPort).rawPort();
+ break;
+ }
+ else if( (object == NULL)
+ && (*itPort).getModifier().isDirectionInout() )
+ {
+ object = (*itPort).rawPort();
+ }
+ }
+ }
+
+ break;
+ }
+
+ default:
+ {
+ XQuery.getPortByQualifiedNameID(aQualifiedNameID, listofPort);
+
+ configurePort(op, listofPort, otherTracePoint);
+
+ break;
+ }
+ }
+ }
+
+ else
+ {
+ switch( op )
+ {
+ case AVM_OPCODE_INPUT:
+ case AVM_OPCODE_INPUT_ENV:
+ case AVM_OPCODE_INPUT_RDV:
+ {
+ if( XQuery.getPortByNameID(aQualifiedNameID,
+ listofPort,Modifier::DIRECTION_INPUT_KIND, false) )
+ {
+ object = NULL;
+
+ ListOfSymbol::iterator itPort = listofPort.begin();
+ ListOfSymbol::iterator endPort = listofPort.end();
+ for( ; itPort != endPort ; ++itPort )
+ {
+ if( (*itPort).getModifier().isDirectionInput() )
+ {
+ object = (*itPort).rawPort();
+ break;
+ }
+ else if( (object == NULL)
+ && (*itPort).getModifier().isDirectionInout() )
+ {
+ object = (*itPort).rawPort();
+ }
+ }
+ }
+
+ break;
+ }
+
+ case AVM_OPCODE_OUTPUT:
+ case AVM_OPCODE_OUTPUT_ENV:
+ case AVM_OPCODE_OUTPUT_RDV:
+ {
+ if( XQuery.getPortByNameID(
+ aQualifiedNameID, listofPort,
+ Modifier::DIRECTION_OUTPUT_KIND, false) )
+ {
+ object = NULL;
+
+ ListOfSymbol::iterator itPort = listofPort.begin();
+ ListOfSymbol::iterator endPort = listofPort.end();
+ for( ; itPort != endPort ; ++itPort )
+ {
+ if( (*itPort).getModifier().isDirectionOutput() )
+ {
+ object = (*itPort).rawPort();
+ break;
+ }
+ else if( (object == NULL)
+ && (*itPort).getModifier().isDirectionInout() )
+ {
+ object = (*itPort).rawPort();
+ }
+ }
+ }
+
+ break;
+ }
+
+ default:
+ {
+ XQuery.getPortByNameID(aQualifiedNameID, listofPort);
+
+ configurePort(op, listofPort, otherTracePoint);
+
+ break;
+ }
+ }
+ }
+
+ return( object != NULL );
+}
+
+void TracePoint::configurePort(AVM_OPCODE opCom,
+ ListOfSymbol & listofPort, ListOfTracePoint & otherTracePoint)
+{
+ if( listofPort.nonempty() )
+ {
+ op = opCom;
+ object = listofPort.front().rawPort();
+ listofPort.pop_front();
+ }
+
+ while( listofPort.nonempty() )
+ {
+ TracePoint * newTracePoint = new TracePoint( this );
+ newTracePoint->object = listofPort.front().rawPort();
+ listofPort.pop_front();
+
+ otherTracePoint.append( newTracePoint );
+ }
+}
+
+
+bool TracePoint::configureTransition(
+ const Configuration & aConfiguration,
+ const std::string & aQualifiedNameID)
+{
+ ExecutableQuery XQuery( aConfiguration );
+
+ std::string::size_type pos = aQualifiedNameID.find("->");
+
+ if( pos != std::string::npos )
+ {
+ std::string mid = aQualifiedNameID.substr(0, pos);
+ std::string obj = aQualifiedNameID.substr(pos + 2);
+
+ updateMachine(aConfiguration, mid);
+
+ if( obj == "[*]" )
+ {
+ any_object = true;
+
+ return( true );
+ }
+
+ if( machine != NULL )
+ {
+ object = machine->getExecutable()->getTransitionByNameID(
+ obj ).to_ptr< ObjectElement >();
+ }
+ else
+ {
+ object = XQuery.getTransitionByNameID(
+ obj ).to_ptr< ObjectElement >();
+ }
+ }
+
+ else if( aQualifiedNameID == "[*]" )
+ {
+ any_object = true;
+
+ return( true );
+ }
+
+ else if( aQualifiedNameID.find('.') == std::string::npos )
+ {
+ object = XQuery.getTransitionByNameID(
+ aQualifiedNameID ).to_ptr< ObjectElement >();
+ }
+ else
+ {
+ object = XQuery.getTransitionByQualifiedNameID(
+ aQualifiedNameID ).to_ptr< ObjectElement >();
+ }
+
+ return( object != NULL );
+}
+
+
+bool TracePoint::configureRoutine(const Configuration & aConfiguration,
+ const std::string & aQualifiedNameID)
+{
+ std::string::size_type pos = aQualifiedNameID.find("->");
+
+ if( pos != std::string::npos )
+ {
+ std::string mid = aQualifiedNameID.substr(0, pos);
+ std::string obj = aQualifiedNameID.substr(pos + 2);
+
+ updateMachine(aConfiguration, mid);
+
+ if( obj == "[*]" )
+ {
+ any_object = true;
+
+ return( true );
+ }
+
+ if( machine != NULL )
+ {
+ ExecutableForm * anExec = machine->getExecutable();
+
+ if( obj == "init" )
+ {
+ op = AVM_OPCODE_INIT;
+ object = &( anExec->getOnInitRoutine() );
+ }
+ else if( obj == "final" )
+ {
+ op = AVM_OPCODE_FINAL;
+ object = &( anExec->getOnFinalRoutine() );
+ }
+
+ else if( obj == "start" )
+ {
+ op = AVM_OPCODE_START;
+ object = &( anExec->getOnStartRoutine() );
+ }
+ else if( obj == "stop" )
+ {
+ op = AVM_OPCODE_STOP;
+ object = &( anExec->getOnStopRoutine() );
+ }
+
+ else if( obj == "ienable" )
+ {
+ op = AVM_OPCODE_IENABLE_INVOKE;
+ object = &( anExec->getOnIEnableRoutine() );
+ }
+ else if( obj == "enable" )
+ {
+ op = AVM_OPCODE_ENABLE_INVOKE;
+ object = &( anExec->getOnEnableRoutine() );
+ }
+
+ else if( obj == "idisable" )
+ {
+ op = AVM_OPCODE_IDISABLE_INVOKE;
+ object = &( anExec->getOnIDisableRoutine() );
+ }
+ else if( obj == "disable" )
+ {
+ op = AVM_OPCODE_DISABLE_INVOKE;
+ object = &( anExec->getOnDisableRoutine() );
+ }
+ else if( obj == "iabort" )
+ {
+ op = AVM_OPCODE_IABORT_INVOKE;
+ object = &( anExec->getOnIAbortRoutine() );
+ }
+ else if( obj == "abort" )
+ {
+ op = AVM_OPCODE_ABORT_INVOKE;
+ object = &( anExec->getOnAbortRoutine() );
+ }
+
+ else if( obj == "irun" )
+ {
+ op = AVM_OPCODE_IRUN;
+ object = &( anExec->getOnIRunRoutine() );
+ }
+ else if( obj == "run" )
+ {
+ op = AVM_OPCODE_RUN;
+ object = &( anExec->getOnRunRoutine() );
+ }
+ else if( obj == "rtc" )
+ {
+ op = AVM_OPCODE_RTC;
+ object = &( anExec->getOnRtcRoutine() );
+ }
+
+ else if( obj == "schedule" )
+ {
+ op = AVM_OPCODE_SCHEDULE_INVOKE;
+ object = &( anExec->getOnScheduleRoutine() );
+ }
+ else if( obj == "concurrency" )
+ {
+ op = AVM_OPCODE_SCHEDULE_INVOKE;
+ object = &( anExec->getOnConcurrencyRoutine() );
+ }
+ }
+ }
+
+ else if( aQualifiedNameID == "[*]" )
+ {
+ any_object = true;
+
+ return( true );
+ }
+
+ return( object != NULL );
+}
+
+
+bool TracePoint::configureRunnable(const Configuration & aConfiguration,
+ const std::string & aQualifiedNameID)
+{
+ std::string::size_type pos = aQualifiedNameID.find("->");
+
+ if( pos != std::string::npos )
+ {
+ std::string mid = aQualifiedNameID.substr(0, pos);
+ std::string obj = aQualifiedNameID.substr(pos + 2);
+
+ updateMachine(aConfiguration, mid);
+
+ if( obj == "[*]" )
+ {
+ any_object = true;
+
+ return( true );
+ }
+
+ if( machine != NULL )
+ {
+ ExecutableForm * anExec = machine->getExecutable();
+
+ if( obj == "init" )
+ {
+ op = AVM_OPCODE_INIT;
+ object = &( anExec->getOnInitRoutine() );
+ }
+ else if( obj == "final" )
+ {
+ op = AVM_OPCODE_FINAL;
+ object = &( anExec->getOnFinalRoutine() );
+ }
+
+ else if( obj == "start" )
+ {
+ op = AVM_OPCODE_START;
+ object = &( anExec->getOnStartRoutine() );
+ }
+ else if( obj == "stop" )
+ {
+ op = AVM_OPCODE_STOP;
+ object = &( anExec->getOnStopRoutine() );
+ }
+
+ else if( obj == "ienable" )
+ {
+ op = AVM_OPCODE_IENABLE_INVOKE;
+ object = &( anExec->getOnIEnableRoutine() );
+ }
+ else if( obj == "enable" )
+ {
+ op = AVM_OPCODE_ENABLE_INVOKE;
+ object = &( anExec->getOnEnableRoutine() );
+ }
+
+ else if( obj == "idisable" )
+ {
+ op = AVM_OPCODE_IDISABLE_INVOKE;
+ object = &( anExec->getOnIDisableRoutine() );
+ }
+ else if( obj == "disable" )
+ {
+ op = AVM_OPCODE_DISABLE_INVOKE;
+ object = &( anExec->getOnDisableRoutine() );
+ }
+ else if( obj == "iabort" )
+ {
+ op = AVM_OPCODE_IABORT_INVOKE;
+ object = &( anExec->getOnIAbortRoutine() );
+ }
+ else if( obj == "abort" )
+ {
+ op = AVM_OPCODE_ABORT_INVOKE;
+ object = &( anExec->getOnAbortRoutine() );
+ }
+
+ else if( obj == "irun" )
+ {
+ op = AVM_OPCODE_IRUN;
+ object = &( anExec->getOnIRunRoutine() );
+ }
+ else if( obj == "run" )
+ {
+ op = AVM_OPCODE_RUN;
+ object = &( anExec->getOnRunRoutine() );
+ }
+ else if( obj == "rtc" )
+ {
+ op = AVM_OPCODE_RTC;
+ object = &( anExec->getOnRtcRoutine() );
+ }
+
+ else if( obj == "schedule" )
+ {
+ op = AVM_OPCODE_SCHEDULE_INVOKE;
+ object = &( anExec->getOnScheduleRoutine() );
+ }
+ else if( obj == "concurrency" )
+ {
+ op = AVM_OPCODE_SCHEDULE_INVOKE;
+ object = &( anExec->getOnConcurrencyRoutine() );
+ }
+ }
+ }
+
+ else if( aQualifiedNameID == "[*]" )
+ {
+ any_object = true;
+
+ return( true );
+ }
+
+ return( object != NULL );
+}
+
+
+bool TracePoint::configureMachine(
+ const Configuration & aConfiguration,
+ const std::string & aQualifiedNameID)
+{
+ std::string::size_type pos = aQualifiedNameID.find("->");
+
+ if( pos != std::string::npos )
+ {
+ std::string mid = aQualifiedNameID.substr(0, pos);
+ std::string obj = aQualifiedNameID.substr(pos + 2);
+
+ updateMachine(aConfiguration, mid);
+
+ if( obj == "[*]" )
+ {
+ any_object = true;
+
+ return( true );
+ }
+
+ if( machine != NULL )
+ {
+ ExecutableForm * containerExecutable = machine->getExecutable();
+
+ while( containerExecutable != NULL )
+ {
+ object = containerExecutable->getPort().getByNameID(obj).rawPort();
+
+ if( object == NULL )
+ {
+ containerExecutable =
+ containerExecutable->getExecutableContainer();
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+ else
+ {
+ ExecutableQuery XQuery( aConfiguration );
+
+ object = machine = XQuery.getMachineByQualifiedNameID(
+ Specifier::DESIGN_INSTANCE_KIND, mid + "." + obj).rawMachine();
+ }
+ }
+
+ else if( aQualifiedNameID == "[*]" )
+ {
+ any_object = true;
+
+ return( true );
+ }
+
+ else
+ {
+ updateMachine(aConfiguration, aQualifiedNameID);
+
+ object = machine;
+ }
+
+ return( object != NULL );
+}
+
+
+bool TracePoint::configureVariable(
+ const Configuration & aConfiguration,
+ const std::string & aQualifiedNameID)
+{
+ ExecutableQuery XQuery( aConfiguration );
+
+ std::string::size_type pos = aQualifiedNameID.find("->");
+
+ if( pos != std::string::npos )
+ {
+ std::string mid = aQualifiedNameID.substr(0, pos);
+ std::string obj = aQualifiedNameID.substr(pos + 2);
+
+ updateMachine(aConfiguration, mid);
+
+ if( obj == "[*]" )
+ {
+ any_object = true;
+
+ return( true );
+ }
+
+ if( machine != NULL )
+ {
+ object = machine->getExecutable()->getData().rawByNameID( obj );
+ }
+ else
+ {
+ object = XQuery.getDataByNameID( obj ).to_ptr< InstanceOfData >();
+ }
+ }
+
+ else if( aQualifiedNameID == "[*]" )
+ {
+ any_object = true;
+
+ return( true );
+ }
+
+ else if( aQualifiedNameID.find('.') == std::string::npos )
+ {
+ object = XQuery.getDataByNameID(
+ aQualifiedNameID ).to_ptr< InstanceOfData >();
+ }
+ else
+ {
+ object = XQuery.getDataByQualifiedNameID(
+ aQualifiedNameID ).to_ptr< InstanceOfData >();
+ }
+
+ return( object != NULL );
+}
+
+
+bool TracePoint::configureBuffer(
+ const Configuration & aConfiguration,
+ const std::string & aQualifiedNameID)
+{
+ ExecutableQuery XQuery( aConfiguration );
+
+ std::string::size_type pos = aQualifiedNameID.find("->");
+
+ if( pos != std::string::npos )
+ {
+ std::string mid = aQualifiedNameID.substr(0, pos);
+ std::string obj = aQualifiedNameID.substr(pos + 2);
+
+ updateMachine(aConfiguration, mid);
+
+ if( obj == "[*]" )
+ {
+ any_object = true;
+
+ return( true );
+ }
+
+ if( machine != NULL )
+ {
+ object = machine->getExecutable()
+ ->getBuffer().getByNameID(obj).rawBuffer();
+ }
+ else
+ {
+ object = XQuery.getBufferByNameID( obj ).rawBuffer();
+ }
+ }
+
+ else if( aQualifiedNameID == "[*]" )
+ {
+ any_object = true;
+
+ return( true );
+ }
+
+ else if( aQualifiedNameID.find('.') == std::string::npos )
+ {
+ object = XQuery.getBufferByNameID( aQualifiedNameID ).rawBuffer();
+ }
+ else
+ {
+ object = XQuery.getBufferByQualifiedNameID(
+ aQualifiedNameID ).rawBuffer();
+ }
+
+ return( object != NULL );
+}
+
+
+
+/**
+ * GETTER / SETTER
+ * op
+ */
+AVM_OPCODE TracePoint::to_kind(const std::string & id)
+{
+ if( id == "time" ) return AVM_OPCODE_TIMED_GUARD;
+
+ if( id == "formula" ) return AVM_OPCODE_GUARD;
+
+ if( id == "assign" ) return AVM_OPCODE_ASSIGN;
+ if( id == "newfresh" ) return AVM_OPCODE_ASSIGN_NEWFRESH;
+
+ if( id == "input" ) return AVM_OPCODE_INPUT;
+
+ if( REGEX_MATCH(id, CONS_WID2("input", "env")) ) return AVM_OPCODE_INPUT_ENV;
+ if( REGEX_MATCH(id, CONS_WID2("input", "rdv")) ) return AVM_OPCODE_INPUT_RDV;
+
+ if( id == "output" ) return AVM_OPCODE_OUTPUT;
+
+ if( REGEX_MATCH(id, CONS_WID2("output", "env")) ) return AVM_OPCODE_OUTPUT_ENV;
+ if( REGEX_MATCH(id, CONS_WID2("output", "rdv")) ) return AVM_OPCODE_OUTPUT_RDV;
+
+ return AVM_OPCODE_NULL;
+}
+
+
+AVM_OPCODE TracePoint::to_op(AVM_OPCODE op)
+{
+ switch( op )
+ {
+ case AVM_OPCODE_ASSIGN:
+ case AVM_OPCODE_ASSIGN_AFTER:
+ case AVM_OPCODE_ASSIGN_OP_AFTER:
+ case AVM_OPCODE_ASSIGN_REF:
+ case AVM_OPCODE_ASSIGN_MACRO:
+ case AVM_OPCODE_ASSIGN_RESET:
+ {
+ return( AVM_OPCODE_ASSIGN );
+ }
+
+ case AVM_OPCODE_INPUT:
+ case AVM_OPCODE_INPUT_FROM:
+ {
+ return( AVM_OPCODE_INPUT );
+ }
+
+ case AVM_OPCODE_OUTPUT:
+ case AVM_OPCODE_OUTPUT_TO:
+ {
+ return( AVM_OPCODE_OUTPUT );
+ }
+
+
+ case AVM_OPCODE_INPUT_ENV:
+ case AVM_OPCODE_OUTPUT_ENV:
+
+ case AVM_OPCODE_INPUT_RDV:
+ case AVM_OPCODE_OUTPUT_RDV:
+
+ case AVM_OPCODE_ASSIGN_NEWFRESH:
+
+ case AVM_OPCODE_TIMED_GUARD:
+ case AVM_OPCODE_GUARD:
+
+ case AVM_OPCODE_INVOKE_NEW:
+ case AVM_OPCODE_INVOKE_ROUTINE:
+ case AVM_OPCODE_INVOKE_TRANSITION:
+
+ case AVM_OPCODE_INIT:
+ case AVM_OPCODE_FINAL:
+
+ case AVM_OPCODE_START:
+ case AVM_OPCODE_STOP:
+
+ case AVM_OPCODE_IENABLE_INVOKE:
+ case AVM_OPCODE_ENABLE_INVOKE:
+
+ case AVM_OPCODE_IDISABLE_INVOKE:
+ case AVM_OPCODE_DISABLE_INVOKE:
+
+ case AVM_OPCODE_IABORT_INVOKE:
+ case AVM_OPCODE_ABORT_INVOKE:
+
+ case AVM_OPCODE_IRUN:
+ case AVM_OPCODE_RUN:
+ case AVM_OPCODE_RTC:
+
+ case AVM_OPCODE_SCHEDULE_INVOKE:
+
+ case AVM_OPCODE_DEFER_INVOKE:
+ {
+ return( op );
+ }
+
+ default:
+ {
+ return( AVM_OPCODE_NULL );
+ }
+ }
+}
+
+
+std::string TracePoint::to_string(AVM_OPCODE op)
+{
+ switch( op )
+ {
+ case AVM_OPCODE_TIMED_GUARD : return( "time" );
+
+ case AVM_OPCODE_CHECK_SAT : return( "check_sat" );
+ case AVM_OPCODE_GUARD : return( "guard" );
+
+ case AVM_OPCODE_SELECT : return( "select" );
+
+ case AVM_OPCODE_ASSIGN : return( "assign" );
+
+ case AVM_OPCODE_ASSIGN_NEWFRESH : return( "newfresh" );
+
+ case AVM_OPCODE_INPUT : return( "input" );
+ case AVM_OPCODE_INPUT_ENV : return( "input#env" );
+ case AVM_OPCODE_INPUT_FROM : return( "input#from" );
+ case AVM_OPCODE_INPUT_RDV : return( "input#rdv" );
+
+ case AVM_OPCODE_OUTPUT : return( "output" );
+ case AVM_OPCODE_OUTPUT_ENV : return( "output#env" );
+ case AVM_OPCODE_OUTPUT_TO : return( "output#to" );
+ case AVM_OPCODE_OUTPUT_RDV : return( "output#rdv" );
+
+ case AVM_OPCODE_INVOKE_NEW : return( "new" );
+ case AVM_OPCODE_INVOKE_ROUTINE : return( "invoke#routine" );
+ case AVM_OPCODE_INVOKE_TRANSITION : return( "invoke#transition" );
+
+ case AVM_OPCODE_INIT : return( "init" );
+ case AVM_OPCODE_FINAL : return( "final" );
+
+ case AVM_OPCODE_START : return( "start" );
+ case AVM_OPCODE_STOP : return( "stop" );
+
+ case AVM_OPCODE_IENABLE_INVOKE : return( "ienable" );
+ case AVM_OPCODE_ENABLE_INVOKE : return( "enable" );
+ case AVM_OPCODE_ENABLE_SET : return( "enable#set" );
+
+ case AVM_OPCODE_IDISABLE_INVOKE : return( "idisable" );
+ case AVM_OPCODE_DISABLE_INVOKE : return( "disable" );
+
+ case AVM_OPCODE_IABORT_INVOKE : return( "iabort" );
+ case AVM_OPCODE_ABORT_INVOKE : return( "abort" );
+
+ case AVM_OPCODE_IRUN : return( "irun" );
+ case AVM_OPCODE_RUN : return( "run" );
+ case AVM_OPCODE_RTC : return( "rtc" );
+
+ case AVM_OPCODE_SCHEDULE_INVOKE : return( "schedule" );
+
+ case AVM_OPCODE_DEFER_INVOKE : return( "defer" );
+
+ case AVM_OPCODE_EQ : return( "eq" );
+ case AVM_OPCODE_SEQ : return( "seq" );
+
+ case AVM_OPCODE_NOT : return( "not" );
+ case AVM_OPCODE_AND : return( "and" );
+ case AVM_OPCODE_OR : return( "or" );
+ case AVM_OPCODE_XOR : return( "xor" );
+
+ case AVM_OPCODE_PARALLEL : return( ")|,|" );
+ case AVM_OPCODE_STRONG_SYNCHRONOUS: return( "|and|" );
+
+ case AVM_OPCODE_NOP : return( "nop" );
+
+ case AVM_OPCODE_NULL : return( "<?op>" );
+
+ default : return( "trace#op<unknown>" );
+ }
+}
+
+
+
+void TracePoint::updateNatureOpcodeRID()
+{
+ if( (nature == ENUM_TRACE_POINT::TRACE_UNDEFINED_NATURE)
+ && (object != NULL) )
+ {
+ if( object->is< InstanceOfPort >() )
+ {
+ nature = ENUM_TRACE_POINT::to_nature(
+ object->to< InstanceOfPort >()->getComPointNature() );
+ }
+ else if( object->is< InstanceOfData >() )
+ {
+ nature = ENUM_TRACE_POINT::TRACE_VARIABLE_NATURE;
+ }
+ }
+ else if( (nature == ENUM_TRACE_POINT::TRACE_MACHINE_NATURE)
+ && object->is< InstanceOfMachine >() )
+ {
+ InstanceOfMachine * machine = object->to< InstanceOfMachine >();
+
+ if( machine->getSpecifier().isFamilyComponentState() )
+ {
+ nature = ENUM_TRACE_POINT::TRACE_STATE_NATURE;
+ }
+ else if( machine->getSpecifier().isComponentStatemachine() )
+ {
+ nature = ENUM_TRACE_POINT::TRACE_STATEMACHINE_NATURE;
+ }
+ }
+
+
+ if( config != NULL )
+ {
+ if( (op == AVM_OPCODE_NULL) && config->isAvmCode() )
+ {
+ op = to_op( config->getOptimizedOpCode() );
+ }
+
+ if( RID.invalid() )
+ {
+ RID = config->getRuntimeID();
+ }
+ }
+}
+
+
+/**
+ * GETTER
+ * machine
+ * object
+ */
+ExecutableForm * TracePoint::getExecutable() const
+{
+ if( object != NULL )
+ {
+ if( object->is< InstanceOfMachine >() )
+ {
+ return( object->to< InstanceOfMachine >()->getExecutable() );
+ }
+
+ else if( object->is< BaseAvmProgram >() )
+ {
+ return( object->to< BaseAvmProgram >()->getExecutable() );
+ }
+
+ else if( machine != NULL )
+ {
+ return( machine->getExecutable() );
+ }
+ else if( object->is< BaseInstanceForm >() )
+ {
+ return( object->to< BaseInstanceForm >()->
+ getContainer()->getExecutable() );
+ }
+ }
+
+ else if( machine != NULL )
+ {
+ return( machine->getExecutable() );
+ }
+
+ return( NULL );
+}
+
+
+/**
+ * GETTER / SETTER
+ * value
+ * vector of value
+ */
+void TracePoint::newArrayValue(avm_size_t aSize)
+{
+ value = new ArrayBF(TypeManager::UNIVERSAL, aSize);
+}
+
+
+const BF & TracePoint::val(avm_size_t offset) const
+{
+ if( value.invalid() )
+ {
+ return( BF::REF_NULL );
+ }
+ else if( value.is< ArrayBF >() )
+ {
+ if( offset < value.to_ptr< ArrayBF >()->size() )
+ {
+ return( value.to_ptr< ArrayBF >()->at( offset ) );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Out of range ( offset:" << offset
+ << " >= size:" << value.to_ptr< ArrayBF >()->size()
+ << " ) in read-access on array value of TracePoint !!!"
+ << std::endl
+ << to_stream( this )
+ << SEND_EXIT;
+
+ return( value );
+ }
+ }
+ else if(offset == 0)
+ {
+ return( value );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Trying to access value in "
+ "non-existing array TracePoint value !!!"
+ << SEND_EXIT;
+
+ return( value );
+ }
+}
+
+
+void TracePoint::val(avm_size_t offset, const BF & arg)
+{
+ if( value.invalid() )
+ {
+ AVM_OS_FATAL_ERROR_EXIT << "invalid value !!!" << SEND_EXIT;
+ }
+ else if( value.is< ArrayBF >() )
+ {
+ if( offset < value.to_ptr< ArrayBF >()->size() )
+ {
+ value.to_ptr< ArrayBF >()->set( offset, arg );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Out of range ( offset:" << offset
+ << " >= size:" << value.to_ptr< ArrayBF >()->size()
+ << " ) in write-access on array value of TracePoint !!!"
+ << std::endl
+ << to_stream( this )
+ << SEND_EXIT;
+ }
+ }
+ else if( offset == 0 )
+ {
+ value = arg;
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "TracePoint::val:> Unexpected case !!!"
+ << SEND_EXIT;
+ }
+}
+
+
+avm_size_t TracePoint::valCount() const
+{
+ if( value.invalid() )
+ {
+// AVM_OS_FATAL_ERROR_EXIT << "invalid value !!!" << SEND_EXIT;
+ return( 0 );
+ }
+ else if( value.is< ArrayBF >() )
+ {
+ return( value.to_ptr< ArrayBF >()->size() );
+ }
+ else
+ {
+ return( 1 );
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// SERIALIZATION API
+////////////////////////////////////////////////////////////////////////////////
+
+std::string TracePoint::strUID() const
+{
+ if( machine != NULL )
+ {
+ if( object != NULL )
+ {
+ return( OSS() << "tpid#" << tpid << "->"
+ << machine->getQualifiedNameID() << "->"
+ << object->getNameID() );
+ }
+ }
+
+ if( object != NULL )
+ {
+ return( OSS() << "tpid#" << tpid << "->"
+ << object->getQualifiedNameID() );
+ }
+ else
+ {
+ return( OSS() << "tpid#" << tpid );
+ }
+}
+
+
+void TracePoint::formatValueStream(OutStream & os) const
+{
+ if( value.invalid() )
+ {
+// value.toStream( os );
+// os << "TracePoint::value<null>";
+ }
+ else if( object->is< InstanceOfData >() )
+ {
+ object->to< InstanceOfData >()->formatStream(os, value);
+ }
+ else if( object->is< InstanceOfPort >() )
+ {
+ object->to< InstanceOfPort >()->formatStream(os, value);
+ }
+
+ os << std::flush;
+}
+
+
+void TracePoint::toStream(OutStream & os) const
+{
+ os << TAB;
+
+ if( RID.valid() )
+ {
+ os << "(+)";
+ }
+
+ if( tpid > 0 )
+ {
+ os << strID() << " ";
+ }
+
+ os << ENUM_TRACE_POINT::to_string(nature);
+ switch( nature )
+ {
+ case ENUM_TRACE_POINT::TRACE_COMPOSITE_NATURE:
+ case ENUM_TRACE_POINT::TRACE_COM_NATURE:
+ case ENUM_TRACE_POINT::TRACE_CHANNEL_NATURE:
+ case ENUM_TRACE_POINT::TRACE_MESSAGE_NATURE:
+ case ENUM_TRACE_POINT::TRACE_PORT_NATURE:
+ case ENUM_TRACE_POINT::TRACE_SIGNAL_NATURE:
+ case ENUM_TRACE_POINT::TRACE_TIME_NATURE:
+ case ENUM_TRACE_POINT::TRACE_VARIABLE_NATURE:
+ case ENUM_TRACE_POINT::TRACE_BUFFER_NATURE:
+
+ case ENUM_TRACE_POINT::TRACE_FORMULA_NATURE:
+ case ENUM_TRACE_POINT::TRACE_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_DECISION_NATURE:
+
+ case ENUM_TRACE_POINT::TRACE_PATH_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_PATH_CONDITION_NATURE_LEAF:
+ case ENUM_TRACE_POINT::TRACE_PATH_TIMED_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_PATH_TIMED_CONDITION_NATURE_LEAF:
+
+ case ENUM_TRACE_POINT::TRACE_NODE_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_NODE_CONDITION_NATURE_LEAF:
+ case ENUM_TRACE_POINT::TRACE_NODE_TIMED_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_NODE_TIMED_CONDITION_NATURE_LEAF:
+
+ case ENUM_TRACE_POINT::TRACE_STATE_NATURE:
+ case ENUM_TRACE_POINT::TRACE_STATEMACHINE_NATURE:
+ case ENUM_TRACE_POINT::TRACE_MACHINE_NATURE:
+ {
+ os << ":" << to_string(op) << " ";
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_TRANSITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_ROUTINE_NATURE:
+
+ case ENUM_TRACE_POINT::TRACE_RUNNABLE_NATURE:
+
+ case ENUM_TRACE_POINT::TRACE_STEP_HEADER_NATURE:
+ case ENUM_TRACE_POINT::TRACE_STEP_BEGIN_NATURE:
+ case ENUM_TRACE_POINT::TRACE_STEP_END_NATURE:
+
+ case ENUM_TRACE_POINT::TRACE_INIT_HEADER_NATURE:
+ case ENUM_TRACE_POINT::TRACE_INIT_BEGIN_NATURE:
+ case ENUM_TRACE_POINT::TRACE_INIT_END_NATURE:
+
+ case ENUM_TRACE_POINT::TRACE_COMMENT_NATURE:
+ case ENUM_TRACE_POINT::TRACE_SEPARATOR_NATURE:
+ case ENUM_TRACE_POINT::TRACE_NEWLINE_NATURE:
+ case ENUM_TRACE_POINT::TRACE_UNDEFINED_NATURE:
+ default:
+ {
+ os << " ";
+ break;
+ }
+ }
+
+ if( machine != NULL )
+ {
+ if( machine->getSpecifier().isDesignModel() )
+ {
+ os << "<model>" << machine->getFullyQualifiedNameID();
+ }
+ else if(RID.valid() )
+ {
+ os << RID.getFullyQualifiedNameID();
+ }
+ else
+ {
+ os << machine->getFullyQualifiedNameID();
+ }
+
+ if( (object != NULL) && (object != machine) )
+ {
+ os << "->" << object->getNameID();
+ }
+ else if( any_object )
+ {
+ os << "->[*]";
+ }
+ }
+ else if( object != NULL )
+ {
+ os << object->getFullyQualifiedNameID();
+ }
+ else if( any_object )
+ {
+ os << "[*]";
+ }
+
+ if( value.is< ArrayBF >() )
+ {
+ if( nature != ENUM_TRACE_POINT::TRACE_COMPOSITE_NATURE )
+ {
+ os << value.str();
+ }
+ else
+ {
+ os << "{" << EOL_INCR_INDENT;
+
+ ArrayBF * valArray = value.to_ptr< ArrayBF >();
+ avm_size_t endOffset = valArray->size();
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ valArray->at(offset).toStream(os);
+ }
+
+ os << DECR_INDENT_TAB << "}";
+ }
+ }
+ else if( value.valid() )
+ {
+ os << "[ " << value.str() << " ]";
+ }
+
+
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , COMPUTING , EC.isnotNull() )
+ os << EOL_TAB;
+ EC.traceMinimum(os);
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , COMPUTING )
+
+ os << EOL_FLUSH;
+}
+
+
+void TracePoint::traceMinimum(OutStream & os) const
+{
+ os << TAB;
+
+ if( RID.valid() )
+ {
+ os << "(+)";
+ }
+
+ if( tpid > 0 )
+ {
+ os << strID() << " ";
+ }
+
+ switch( nature )
+ {
+ case ENUM_TRACE_POINT::TRACE_COMPOSITE_NATURE:
+ {
+ os << to_string(op) << " ";
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_COM_NATURE:
+ case ENUM_TRACE_POINT::TRACE_CHANNEL_NATURE:
+ case ENUM_TRACE_POINT::TRACE_MESSAGE_NATURE:
+ case ENUM_TRACE_POINT::TRACE_PORT_NATURE:
+ case ENUM_TRACE_POINT::TRACE_SIGNAL_NATURE:
+ case ENUM_TRACE_POINT::TRACE_TIME_NATURE:
+ case ENUM_TRACE_POINT::TRACE_BUFFER_NATURE:
+
+ case ENUM_TRACE_POINT::TRACE_FORMULA_NATURE:
+ case ENUM_TRACE_POINT::TRACE_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_DECISION_NATURE:
+
+ case ENUM_TRACE_POINT::TRACE_PATH_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_PATH_CONDITION_NATURE_LEAF:
+ case ENUM_TRACE_POINT::TRACE_PATH_TIMED_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_PATH_TIMED_CONDITION_NATURE_LEAF:
+
+ case ENUM_TRACE_POINT::TRACE_NODE_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_NODE_CONDITION_NATURE_LEAF:
+ case ENUM_TRACE_POINT::TRACE_NODE_TIMED_CONDITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_NODE_TIMED_CONDITION_NATURE_LEAF:
+
+ case ENUM_TRACE_POINT::TRACE_STATE_NATURE:
+ case ENUM_TRACE_POINT::TRACE_STATEMACHINE_NATURE:
+ case ENUM_TRACE_POINT::TRACE_MACHINE_NATURE:
+ {
+ os << ENUM_TRACE_POINT::to_string(nature)
+ << ":" << to_string(op) << " ";
+ break;
+ }
+
+ case ENUM_TRACE_POINT::TRACE_VARIABLE_NATURE:
+ {
+ os << "var<" << to_string(op) << "> ";
+ break;
+ }
+
+
+ case ENUM_TRACE_POINT::TRACE_TRANSITION_NATURE:
+ case ENUM_TRACE_POINT::TRACE_ROUTINE_NATURE:
+
+ case ENUM_TRACE_POINT::TRACE_RUNNABLE_NATURE:
+
+ case ENUM_TRACE_POINT::TRACE_STEP_HEADER_NATURE:
+ case ENUM_TRACE_POINT::TRACE_STEP_BEGIN_NATURE:
+ case ENUM_TRACE_POINT::TRACE_STEP_END_NATURE:
+
+ case ENUM_TRACE_POINT::TRACE_INIT_HEADER_NATURE:
+ case ENUM_TRACE_POINT::TRACE_INIT_BEGIN_NATURE:
+ case ENUM_TRACE_POINT::TRACE_INIT_END_NATURE:
+
+ case ENUM_TRACE_POINT::TRACE_COMMENT_NATURE:
+ case ENUM_TRACE_POINT::TRACE_SEPARATOR_NATURE:
+ case ENUM_TRACE_POINT::TRACE_NEWLINE_NATURE:
+ case ENUM_TRACE_POINT::TRACE_UNDEFINED_NATURE:
+ default:
+ {
+ break;
+ }
+ }
+
+ if( machine != NULL )
+ {
+ if( machine->getSpecifier().isDesignModel() )
+ {
+ os << "<model>" << machine->getFullyQualifiedNameID();
+ }
+ else if( RID.valid() )
+ {
+ os << RID.getFullyQualifiedNameID();
+ }
+ else
+ {
+ os << machine->getFullyQualifiedNameID();
+ }
+
+ if( (object != NULL) && (object != machine) )
+ {
+ os << "->" << object->getNameID();
+ }
+ else if( any_object )
+ {
+ os << "->[*]";
+ }
+ }
+ else if( object != NULL )
+ {
+ os << object->getFullyQualifiedNameID();
+ }
+ else if( any_object )
+ {
+ os << "[*]";
+ }
+
+
+ if( isCom() && value.is< ArrayBF >() )
+ {
+ os << value.str();
+ }
+ else if( value.is< ArrayBF >() )
+ {
+ os << "{";
+ if( nature == ENUM_TRACE_POINT::TRACE_COMPOSITE_NATURE )
+ {
+ os << AVM_STR_INDENT;
+ }
+
+ ArrayBF * valArray = value.to_ptr< ArrayBF >();
+ avm_size_t endOffset = valArray->size();
+ for( avm_size_t offset = 0 ; offset < endOffset ; ++offset )
+ {
+ if( valArray->at(offset).is< TracePoint >() )
+ {
+ valArray->at(offset).to_ptr< TracePoint >()->traceMinimum(os);
+ }
+ else
+ {
+ os << " " << valArray->at(offset).str();
+ }
+ }
+
+ if( nature == ENUM_TRACE_POINT::TRACE_COMPOSITE_NATURE )
+ {
+ os << END_INDENT;
+ }
+ os << " }";
+ }
+ else if( value.valid() )
+ {
+ os << "[ " << value.str() << " ]";
+ }
+
+
+AVM_IF_DEBUG_LEVEL_FLAG_AND( MEDIUM , COMPUTING , EC.isnotNull() )
+ os << EOL_TAB;
+ EC.traceMinimum(os);
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( MEDIUM , COMPUTING )
+
+ os << EOL_FLUSH;
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/trace/TracePoint.h b/org.eclipse.efm.symbex/src/fml/trace/TracePoint.h
new file mode 100644
index 0000000..d67573c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/trace/TracePoint.h
@@ -0,0 +1,555 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 11 déc. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef TRACEPOINT_H_
+#define TRACEPOINT_H_
+
+
+#include <common/AvmPointer.h>
+#include <common/Element.h>
+#include <common/BF.h>
+
+#include <collection/List.h>
+
+#include <fml/common/SpecifierElement.h>
+
+#include <fml/lib/ITracePoint.h>
+
+#include <fml/operator/OperatorLib.h>
+
+#include <fml/symbol/Symbol.h>
+
+#include <fml/runtime/RuntimeID.h>
+
+
+namespace sep
+{
+
+class Configuration;
+
+class ExecutableForm;
+class ExecutionContext;
+class APExecutionData;
+class ExecutionData;
+class ExecutionConfiguration;
+
+class InstanceOfMachine;
+
+class ObjectElement;
+
+class TraceFormatter;
+class TracePoint;
+
+
+/**
+ * TYPEDEF
+ */
+typedef List< TracePoint * > ListOfTracePoint;
+
+
+class TracePoint :
+ public Element ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( TracePoint )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( TracePoint )
+
+
+public:
+ /**
+ * ATTRIBUTES
+ */
+ avm_size_t tpid;
+
+ const ExecutionContext & EC;
+
+ ExecutionConfiguration * config;
+
+ ENUM_TRACE_POINT::TRACE_NATURE nature;
+
+ AVM_OPCODE op;
+
+
+ RuntimeID RID;
+
+ InstanceOfMachine * machine;
+
+ ObjectElement * object;
+ bool any_object;
+
+ BF value;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TracePoint(ENUM_TRACE_POINT::TRACE_NATURE aNature,
+ AVM_OPCODE anOP = AVM_OPCODE_NULL,
+ const BF & aValue = BF::REF_NULL);
+
+ TracePoint(ENUM_TRACE_POINT::TRACE_NATURE aNature, AVM_OPCODE anOP,
+ InstanceOfMachine * aMachine, ObjectElement * anObject,
+ const BF & aValue = BF::REF_NULL);
+
+
+ TracePoint(const ExecutionContext & anEC,
+ ENUM_TRACE_POINT::TRACE_NATURE aNature,
+ AVM_OPCODE anOP, InstanceOfMachine * aMachine,
+ ObjectElement * anObject, const BF & aValue = BF::REF_NULL)
+ : Element( CLASS_KIND_T( TracePoint ) ),
+ tpid( 0 ),
+
+ EC( anEC ),
+ config( NULL ),
+
+ nature( aNature ),
+ op( anOP ),
+
+ RID( ),
+
+ machine( aMachine ),
+
+ object( anObject ),
+ any_object( false ),
+
+ value( aValue )
+ {
+ //!! NOTHING
+ }
+
+
+ TracePoint(ENUM_TRACE_POINT::TRACE_NATURE aNature, AVM_OPCODE anOP,
+ const RuntimeID & aRID, ObjectElement * anObject,
+ const BF & aValue = BF::REF_NULL);
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ TracePoint(const TracePoint & aTracePoint)
+ : Element( aTracePoint ),
+ tpid( aTracePoint.tpid ),
+
+ EC( aTracePoint.EC ),
+ config( aTracePoint.config ),
+
+ nature( aTracePoint.nature ),
+ op( aTracePoint.op ),
+
+ RID( aTracePoint.RID ),
+
+ machine( aTracePoint.machine ),
+
+ object( aTracePoint.object ),
+ any_object( aTracePoint.any_object ),
+
+ value( aTracePoint.value )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ TracePoint(const ExecutionContext & anEC,
+ ENUM_TRACE_POINT::TRACE_NATURE aNature,
+ AVM_OPCODE anOP = AVM_OPCODE_NULL,
+ const BF & aValue = BF::REF_NULL)
+ : Element( CLASS_KIND_T( TracePoint ) ),
+ tpid( 0 ),
+
+ EC( anEC ),
+ config( NULL ),
+
+ nature( aNature ),
+ op( anOP ),
+
+ RID( ),
+
+ machine( NULL ),
+
+ object ( NULL ),
+ any_object( false ),
+
+ value( aValue )
+ {
+ //!! NOTHING
+ }
+
+
+ TracePoint(const ExecutionContext & anEC, ExecutionConfiguration * aConfig,
+ ENUM_TRACE_POINT::TRACE_NATURE aNature,
+ AVM_OPCODE anOP, const RuntimeID & aRID,
+ ObjectElement * anObject, const BF & aValue = BF::REF_NULL)
+ : Element( CLASS_KIND_T( TracePoint ) ),
+ tpid( 0 ),
+
+ EC( anEC ),
+ config( aConfig ),
+
+ nature( aNature ),
+ op( anOP ),
+
+ RID( aRID ),
+
+ machine( aRID.getInstance() ),
+
+ object( anObject ),
+ any_object( false ),
+
+ value( aValue )
+ {
+ updateNatureOpcodeRID();
+ }
+
+ TracePoint(const ExecutionContext & anEC, ExecutionConfiguration * aConfig,
+ ENUM_TRACE_POINT::TRACE_NATURE aNature,
+ AVM_OPCODE anOP, InstanceOfMachine * aMachine,
+ ObjectElement * anObject, const BF & aValue = BF::REF_NULL)
+ : Element( CLASS_KIND_T( TracePoint ) ),
+ tpid( 0 ),
+
+ EC( anEC ),
+ config( aConfig ),
+
+ nature( aNature ),
+ op( anOP ),
+
+ RID( ),
+
+ machine( aMachine ),
+
+ object( anObject ),
+ any_object( false ),
+
+ value( aValue )
+ {
+ updateNatureOpcodeRID();
+ }
+
+
+ TracePoint(const ExecutionContext & anEC, ExecutionConfiguration * aConfig,
+ const RuntimeID & aRID, ObjectElement * anObject, const BF & aValue)
+ : Element( CLASS_KIND_T( TracePoint ) ),
+ tpid( 0 ),
+
+ EC( anEC ),
+ config( aConfig ),
+
+ nature( ENUM_TRACE_POINT::TRACE_UNDEFINED_NATURE ),
+ op( AVM_OPCODE_NULL ),
+
+ RID( aRID ),
+
+ machine( aRID.getInstance() ),
+
+ object( anObject ),
+ any_object( false ),
+
+ value( aValue )
+ {
+ updateNatureOpcodeRID();
+ }
+
+ TracePoint(TracePoint * aTP)
+ : Element( CLASS_KIND_T( TracePoint ) ),
+ tpid( 0 ),
+
+ EC( aTP->EC ),
+ config( aTP->config ),
+
+ nature( aTP->nature ),
+ op( aTP->op ),
+
+ RID( ),
+
+ machine( aTP->machine ),
+
+ object( aTP->object ),
+ any_object( false ),
+
+ value( aTP->value )
+ {
+ updateNatureOpcodeRID();
+ }
+
+ /**
+ * CONSTRUCTOR
+ * for Meta point
+ * TRACE_COMMENT_NATURE
+ * TRACE_SEPARATOR_NATURE
+ * TRACE_NEWLINE_NATURE
+ * TRACE_STEP_NATURE
+ */
+ TracePoint(ENUM_TRACE_POINT::TRACE_NATURE aNature,
+ const std::string & strSeparator);
+
+ TracePoint(const ExecutionContext & anEC,
+ ENUM_TRACE_POINT::TRACE_NATURE aNature,
+ const std::string & strSeparator);
+
+
+ static TracePoint * newComposite(
+ AVM_OPCODE anOP, const BF & aValue = BF::REF_NULL)
+ {
+ return( new TracePoint(
+ ENUM_TRACE_POINT::TRACE_COMPOSITE_NATURE, anOP, aValue) );
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~TracePoint()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ void updateRID(const ExecutionData & anED);
+
+ void updateMachine(
+ const Configuration & aConfiguration,
+ const std::string & aQualifiedNameID);
+
+ bool configurePort(
+ const Configuration & aConfiguration,
+ const std::string & aQualifiedNameID,
+ ListOfTracePoint & otherTracePoint);
+
+ void configurePort(AVM_OPCODE opCom, ListOfSymbol & listofPort,
+ ListOfTracePoint & otherTracePoint);
+
+ bool configureTransition(
+ const Configuration & aConfiguration,
+ const std::string & aQualifiedNameID);
+
+ bool configureRoutine(
+ const Configuration & aConfiguration,
+ const std::string & aQualifiedNameID);
+
+ bool configureRunnable(
+ const Configuration & aConfiguration,
+ const std::string & aQualifiedNameID);
+
+ bool configureMachine(
+ const Configuration & aConfiguration,
+ const std::string & aQualifiedNameID);
+
+ bool configureVariable(
+ const Configuration & aConfiguration,
+ const std::string & aQualifiedNameID);
+
+ bool configureBuffer(
+ const Configuration & aConfiguration,
+ const std::string & aQualifiedNameID);
+
+
+ /**
+ * GETTER / SETTER / TEST
+ * nature / op
+ */
+ inline bool isVirtual() const
+ {
+ switch( nature )
+ {
+ case ENUM_TRACE_POINT::TRACE_COMMENT_NATURE:
+ case ENUM_TRACE_POINT::TRACE_SEPARATOR_NATURE:
+ case ENUM_TRACE_POINT::TRACE_NEWLINE_NATURE:
+
+ case ENUM_TRACE_POINT::TRACE_STEP_HEADER_NATURE:
+ case ENUM_TRACE_POINT::TRACE_STEP_BEGIN_NATURE:
+ case ENUM_TRACE_POINT::TRACE_STEP_END_NATURE:
+
+ case ENUM_TRACE_POINT::TRACE_INIT_HEADER_NATURE:
+ case ENUM_TRACE_POINT::TRACE_INIT_BEGIN_NATURE:
+ case ENUM_TRACE_POINT::TRACE_INIT_END_NATURE:
+ {
+ return( true );
+ }
+ default:
+ {
+ return( false );
+ }
+ }
+ }
+
+ inline bool isAssign() const
+ {
+ return( (nature == ENUM_TRACE_POINT::TRACE_VARIABLE_NATURE)
+ && (op == AVM_OPCODE_ASSIGN) );
+ }
+
+ inline bool isCom() const
+ {
+ switch( nature )
+ {
+ case ENUM_TRACE_POINT::TRACE_COM_NATURE:
+ case ENUM_TRACE_POINT::TRACE_CHANNEL_NATURE:
+ case ENUM_TRACE_POINT::TRACE_MESSAGE_NATURE:
+ case ENUM_TRACE_POINT::TRACE_PORT_NATURE:
+ case ENUM_TRACE_POINT::TRACE_SIGNAL_NATURE:
+ {
+ return( true );
+ }
+ default:
+ {
+ switch( op )
+ {
+ case AVM_OPCODE_INPUT:
+ case AVM_OPCODE_INPUT_FROM:
+ case AVM_OPCODE_INPUT_ENV:
+ case AVM_OPCODE_INPUT_RDV:
+
+ case AVM_OPCODE_OUTPUT:
+ case AVM_OPCODE_OUTPUT_TO:
+ case AVM_OPCODE_OUTPUT_ENV:
+ case AVM_OPCODE_OUTPUT_RDV:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+ }
+ }
+ }
+
+ inline bool isCom(AVM_OPCODE op, const RuntimeID & rid,
+ ObjectElement * object) const
+ {
+ if( ((this->op == op) || (this->op == AVM_OPCODE_NULL))
+ && ((this->object == object) || this->any_object) )
+ {
+ if( this->RID.valid() )
+ {
+ return( rid.hasAsAncestor(this->machine) );
+ }
+ else if( this->machine != NULL )
+ {
+ return( rid.hasAsAncestor(this->machine) );
+ }
+
+ return( true );
+ }
+
+ return( false );
+ }
+
+
+ inline bool isTime() const
+ {
+ return( (nature == ENUM_TRACE_POINT::TRACE_TIME_NATURE)
+ || (op == AVM_OPCODE_TIMED_GUARD) );
+ }
+
+ static AVM_OPCODE to_kind(const std::string & id);
+
+ static AVM_OPCODE to_op(AVM_OPCODE op);
+
+ static std::string to_string(AVM_OPCODE direction);
+
+ void updateNatureOpcodeRID();
+
+ /**
+ * GETTER
+ * machine
+ * object
+ */
+ ExecutableForm * getExecutable() const;
+
+ /**
+ * GETTER / SETTER
+ * value
+ */
+ void newArrayValue(avm_size_t aSize);
+
+ const BF & val(avm_size_t offset) const;
+
+ void val(avm_size_t offset, const BF & arg);
+
+ avm_size_t valCount() const;
+
+ /**
+ * Comparison
+ */
+ inline bool isEQ(const TracePoint & otherTP, bool withValue = true)
+ {
+ return( (this == (& otherTP))
+ || ( (nature == otherTP.nature )
+ && (op == otherTP.op )
+ && (machine == otherTP.machine)
+ && (object == otherTP.object )
+ && ((not withValue)
+ || value.isEQ(otherTP.value)) ) );
+ }
+
+ inline bool isNEQ(const TracePoint & otherTP)
+ {
+ return( (this != (& otherTP))
+ && ( (nature != otherTP.nature )
+ || (op != otherTP.op )
+ || (machine != otherTP.machine)
+ || (object != otherTP.object )
+ || value.isNEQ( otherTP.value ) ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SERIALIZATION API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline std::string strID() const
+ {
+ return( OSS() << "tpid#" << tpid );
+ }
+
+ std::string strUID() const;
+
+
+ inline virtual std::string str() const
+ {
+ return( strUID() );
+ }
+
+ virtual void formatValueStream(OutStream & os) const;
+
+ virtual void toStream(OutStream & os) const;
+
+ virtual void traceMinimum(OutStream & os) const;
+
+};
+
+
+/**
+ * operator<<
+ */
+AVM_OS_STREAM( TracePoint )
+
+
+
+} /* namespace sep */
+
+#endif /* TRACEPOINT_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/trace/TraceSequence.cpp b/org.eclipse.efm.symbex/src/fml/trace/TraceSequence.cpp
new file mode 100644
index 0000000..3fdd6ec
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/trace/TraceSequence.cpp
@@ -0,0 +1,371 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 13 déc. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "TracePoint.h"
+
+#include <fml/runtime/ExecutionConfiguration.h>
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/RuntimeID.h>
+
+#include <fml/trace/TraceSequence.h>
+
+
+namespace sep
+{
+
+/**
+ * Contains an Object
+ * points
+ */
+bool TraceSequence::containsObject(BaseCompiledForm * anObject) const
+{
+ BFList::const_iterator itPoint = points.begin();
+ BFList::const_iterator endPoint = points.end();
+ for( ; itPoint != endPoint ; ++itPoint )
+ {
+ if( (*itPoint).is< TracePoint >() )
+ {
+ if( (*itPoint).to_ptr< TracePoint >()->object == anObject )
+ {
+ return( true );
+ }
+ }
+ else if( (*itPoint).is< TraceSequence >() )
+ {
+ if( (*itPoint).to_ptr< TraceSequence >()->containsObject(anObject) )
+ {
+ return( true );
+ }
+ }
+ }
+
+ return( false );
+}
+
+
+bool TraceSequence::containsPoint(TracePoint * aPoint, BF & foundPoint) const
+{
+ BFList::const_iterator itPoint = points.begin();
+ BFList::const_iterator endPoint = points.end();
+ for( ; itPoint != endPoint ; ++itPoint )
+ {
+ if( (*itPoint).is< TracePoint >() )
+ {
+ if( (*itPoint).to_ptr< TracePoint >()->isEQ(aPoint) )
+ {
+ foundPoint = (*itPoint);
+
+ return( true );
+ }
+ }
+ else if( (*itPoint).is< TraceSequence >() )
+ {
+ if( (*itPoint).to_ptr< TraceSequence >()->
+ containsPoint(aPoint, foundPoint) )
+ {
+ return( true );
+ }
+ }
+ }
+
+ return( false );
+}
+
+bool TraceSequence::containsPoint(TracePoint * aPoint, bool withValue) const
+{
+ BFList::const_iterator itPoint = points.begin();
+ BFList::const_iterator endPoint = points.end();
+ for( ; itPoint != endPoint ; ++itPoint )
+ {
+ if( (*itPoint).is< TracePoint >() )
+ {
+ if( (*itPoint).to_ptr< TracePoint >()->isEQ(aPoint, withValue) )
+ {
+ return( true );
+ }
+ }
+ else if( (*itPoint).is< TraceSequence >() )
+ {
+ if( (*itPoint).to_ptr< TraceSequence >()->
+ containsPoint(aPoint, withValue) )
+ {
+ return( true );
+ }
+ }
+ }
+
+ return( false );
+}
+
+
+/**
+ * Comparison
+ */
+AVM_OPCODE TraceSequence::compare(const TraceSequence * otherTraceElt) const
+{
+ if( (this != otherTraceElt) && (combinator == otherTraceElt->combinator) )
+ {
+ BFList::const_iterator it = points.begin();
+ BFList::const_iterator endIt = points.end();
+
+ BFList::const_iterator otherIt = otherTraceElt->points.begin();
+ BFList::const_iterator otherEndIt = otherTraceElt->points.end();
+
+ TracePoint * aTP = NULL;
+ TracePoint * otherTP = NULL;
+
+ while( (it != endIt) && (otherIt != otherEndIt) )
+ {
+ if( (*it).is< TracePoint >() )
+ {
+ aTP = (*it).to_ptr< TracePoint >();
+
+ if( aTP->isVirtual() )
+ {
+ ++it;
+
+ continue;
+ }
+ else if( (*otherIt).is< TracePoint >() )
+ {
+ otherTP = (*otherIt).to_ptr< TracePoint >();
+
+ if( otherTP->isVirtual() )
+ {
+ ++otherIt;
+
+ continue;
+ }
+ else if( aTP->isNEQ(otherTP) )
+ {
+ return( AVM_OPCODE_NULL );
+ }
+ }
+ else if( (*otherIt).is< TraceSequence >() )
+ {
+ return( AVM_OPCODE_NULL );
+ }
+ }
+ else if( (*it).is< TraceSequence >() )
+ {
+ if( (*otherIt).is< TracePoint >() )
+ {
+ return( AVM_OPCODE_NULL );
+ }
+ else if( (*otherIt).is< TraceSequence >() )
+ {
+ switch( (*it).to_ptr< TraceSequence >()->compare(
+ (*otherIt).to_ptr< TraceSequence >() ) )
+ {
+ case AVM_OPCODE_EQ:
+ {
+ break;
+ }
+ case AVM_OPCODE_LT:
+ {
+ if( ++it == endIt )
+ {
+ return( AVM_OPCODE_LT );
+ }
+ else
+ {
+ return( AVM_OPCODE_NULL );
+ }
+ }
+ case AVM_OPCODE_GT:
+ {
+ if( ++otherIt == otherEndIt )
+ {
+ return( AVM_OPCODE_GT );
+ }
+ else
+ {
+ return( AVM_OPCODE_NULL );
+ }
+ }
+ default:
+ {
+ return( AVM_OPCODE_NULL );
+ }
+ }
+ }
+ }
+
+ // Incrementing
+ ++it; ++otherIt;
+ }
+
+ if( it == endIt )
+ {
+ if( otherIt == otherEndIt )
+ {
+ return( AVM_OPCODE_EQ );
+ }
+ else
+ {
+ return( AVM_OPCODE_LT );
+ }
+ }
+ else
+ {
+ if( otherIt == otherEndIt )
+ {
+ return( AVM_OPCODE_GT );
+ }
+ else
+ {
+ return( AVM_OPCODE_NULL );
+ }
+ }
+ }
+
+ return( (this == otherTraceElt) ? AVM_OPCODE_EQ : AVM_OPCODE_NULL );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// LIFELINE API
+////////////////////////////////////////////////////////////////////////////////
+
+avm_size_t TraceSequence::toLifeline(
+ TraceSequence & lifelineTrace, const RuntimeID & lifelineRID) const
+{
+ avm_size_t lifelineSize = 0;
+
+ TracePoint * currentTracePoint = NULL;
+ TracePoint * lifelineTimePoint = NULL;
+
+ BF bfTimePoint;
+
+ BFList::const_iterator itPoint = points.begin();
+ BFList::const_iterator endPoint = points.end();
+ for( ; itPoint != endPoint ; ++itPoint )
+ {
+ if( (*itPoint).is< TracePoint >() )
+ {
+ currentTracePoint = (*itPoint).to_ptr< TracePoint >();
+
+ if( lifelineContains(lifelineRID, *currentTracePoint) )
+ {
+ if( lifelineTimePoint != NULL )
+ {
+ lifelineTrace.append( bfTimePoint );
+ }
+
+ lifelineTrace.append( *itPoint );
+ ++lifelineSize;
+
+ lifelineTimePoint = NULL;
+ }
+ else if( currentTracePoint->isTime() )
+ {
+ if( lifelineTimePoint != NULL )
+ {
+ lifelineTimePoint->value = ExpressionConstructor::addExpr(
+ lifelineTimePoint->value, currentTracePoint->value);
+ }
+ else
+ {
+ lifelineTimePoint = new TracePoint( *currentTracePoint );
+ bfTimePoint = lifelineTimePoint;
+ }
+ }
+ }
+ else if( (*itPoint).is< TraceSequence >() )
+ {
+ lifelineSize += (*itPoint).to_ptr< TraceSequence >()
+ ->toLifeline(lifelineTrace, lifelineRID);
+ }
+ }
+
+ return( lifelineSize );
+}
+
+
+bool TraceSequence::lifelineContains(
+ const RuntimeID & lifelineRID, const TracePoint & aPoint) const
+{
+ if( aPoint.RID.valid() && lifelineRID.isAncestorOf( aPoint.RID ) )
+ {
+ return( true );
+ }
+ else if( (aPoint.config != NULL)
+ && lifelineRID.isAncestorOf( aPoint.config->getRuntimeID() ) )
+ {
+ return( true );
+ }
+
+ return( false );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// SERIALIZATION API
+////////////////////////////////////////////////////////////////////////////////
+
+void TraceSequence::toStream(OutStream & os) const
+{
+ os << TAB << "trace#" << tid << "<size:" << points.size();
+ if( mEC != NULL )
+ {
+ os << ", ctx:" << mEC->getIdNumber();
+ }
+ os << "> { " << combinator->strOp() << EOL;
+
+// os << INCR_INDENT;
+// BFList::const_iterator endIt = points.end();
+// for( BFList::const_iterator it = points.begin() ; it != endIt ; ++it )
+// {
+// os << (*it);
+// }
+// os << DECR_INDENT;
+
+ os << INCR_INDENT << points << DECR_INDENT;
+
+ os << TAB << "}" << EOL_FLUSH;
+}
+
+
+void TraceSequence::traceMinimum(OutStream & os) const
+{
+ os << TAB << "trace#" << tid << "<size:" << points.size();
+ if( mEC != NULL )
+ {
+ os << ", ctx:" << mEC->getIdNumber();
+ }
+ os << "> { " << combinator->strOp() << EOL_INCR_INDENT;
+
+ BFList::const_iterator endIt = points.end();
+ for( BFList::const_iterator it = points.begin() ; it != endIt ; ++it )
+ {
+ if( (*it).is< TracePoint >() )
+ {
+ (*it).to_ptr< TracePoint >()->traceMinimum(os);
+ }
+ else if( (*it).is< TraceSequence >() )
+ {
+ (*it).to_ptr< TraceSequence >()->traceMinimum(os);
+ }
+ else
+ {
+ os << (*it);
+ }
+ }
+
+ os << DECR_INDENT_TAB << "}" << EOL_FLUSH;
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/trace/TraceSequence.h b/org.eclipse.efm.symbex/src/fml/trace/TraceSequence.h
new file mode 100644
index 0000000..5336182
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/trace/TraceSequence.h
@@ -0,0 +1,227 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 13 déc. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef TRACESEQUENCE_H_
+#define TRACESEQUENCE_H_
+
+#include <common/AvmPointer.h>
+#include <common/Element.h>
+
+#include <collection/BFContainer.h>
+#include <collection/Vector.h>
+
+#include <fml/operator/Operator.h>
+#include <fml/operator/OperatorManager.h>
+#include <collection/List.h>
+
+
+namespace sep
+{
+
+class ExecutionContext;
+
+class RuntimeID;
+
+class TraceFormatter;
+class TracePoint;
+
+
+class TraceSequence :
+ public Element ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( TraceSequence )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( TraceSequence )
+
+
+public:
+ /**
+ * ATTRIBUTES
+ */
+ Operator * combinator;
+
+ BFList points;
+
+ const ExecutionContext * mEC;
+
+ avm_size_t tid;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TraceSequence(const ExecutionContext * anEC = NULL, avm_size_t aTID = 0)
+ : Element( CLASS_KIND_T( TraceSequence ) ),
+ combinator( OperatorManager::OPERATOR_SEQUENCE ),
+ points( ),
+ mEC( anEC ),
+ tid( aTID )
+ {
+ //!! NOTHING
+ }
+
+
+ TraceSequence(TraceSequence * aContainer, Operator * aCombinator)
+ : Element( CLASS_KIND_T( TraceSequence ) ),
+ combinator( aCombinator ),
+ points( ),
+ mEC( /*aContainer->mEC*/NULL ),
+ tid( aContainer->tid )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ TraceSequence(class_kind_t aClassKind)
+ : Element( aClassKind ),
+ combinator( OperatorManager::OPERATOR_SEQUENCE ),
+ points( ),
+ mEC( NULL ),
+ tid( 0 )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ TraceSequence(const TraceSequence & aTrace)
+ : Element( aTrace ),
+ combinator( aTrace.combinator ),
+ points( aTrace.points ),
+ mEC( aTrace.mEC ),
+ tid( aTrace.tid )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~TraceSequence()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * copy an existing trace
+ */
+ inline void copyTrace(TraceSequence & aTraceElement)
+ {
+ combinator = aTraceElement.combinator;
+
+ points.append( aTraceElement.points );
+
+ mEC = aTraceElement.mEC;
+
+ tid = aTraceElement.tid;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * APPEND -- SAVE
+ * POP_FRONT
+ * SIZE
+ * points
+ */
+ inline void append( const BF & bfTP )
+ {
+ points.append( bfTP );
+ }
+
+ inline void save( Element * aTP )
+ {
+ points.append( BF( aTP) );
+ }
+
+
+ inline void clear()
+ {
+ points.clear();
+ }
+
+
+ inline avm_size_t size() const
+ {
+ return( points.size() );
+ }
+
+
+ /**
+ * Contains an Object
+ * points
+ */
+ bool containsObject(BaseCompiledForm * anObject) const;
+
+ bool containsPoint(TracePoint * aPoint, BF & foundPoint) const;
+
+ bool containsPoint(TracePoint * aPoint, bool withValue = true) const;
+
+
+ /**
+ * Comparison
+ */
+ AVM_OPCODE compare(const TraceSequence * otherTraceElt) const;
+
+ inline bool operator==(const TraceSequence & otherTraceElt) const
+ {
+ return( compare(& otherTraceElt) == AVM_OPCODE_EQ );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // LIFELINE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ avm_size_t toLifeline(TraceSequence & lifelineTrace,
+ const RuntimeID & lifelineRID) const;
+
+ bool lifelineContains(const RuntimeID & lifelineRID,
+ const TracePoint & aTracePoint) const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SERIALIZATION API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline virtual std::string str() const
+ {
+ return( OSS() << "trace#" << tid );
+ }
+
+ virtual void toStream(OutStream & os) const;
+
+ virtual void traceMinimum(OutStream & os) const;
+
+};
+
+
+/**
+ * operator<<
+ */
+AVM_OS_STREAM( TraceSequence )
+
+
+} /* namespace sep */
+
+#endif /* TRACESEQUENCE_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/type/BaseSymbolTypeSpecifier.cpp b/org.eclipse.efm.symbex/src/fml/type/BaseSymbolTypeSpecifier.cpp
new file mode 100644
index 0000000..9167bbf
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/type/BaseSymbolTypeSpecifier.cpp
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 15 juin 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "BaseSymbolTypeSpecifier.h"
+
+
+namespace sep
+{
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/type/BaseSymbolTypeSpecifier.h b/org.eclipse.efm.symbex/src/fml/type/BaseSymbolTypeSpecifier.h
new file mode 100644
index 0000000..b7ce834
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/type/BaseSymbolTypeSpecifier.h
@@ -0,0 +1,181 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 15 juin 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BASESYMBOLTYPESPECIFIER_H_
+#define BASESYMBOLTYPESPECIFIER_H_
+
+#include <fml/type/BaseTypeSpecifier.h>
+
+#include <common/BF.h>
+
+#include <fml/executable/InstanceOfData.h>
+
+#include <fml/symbol/TableOfSymbol.h>
+
+
+namespace sep
+{
+
+class DataType;
+class ObjectElement;
+
+
+class BaseSymbolTypeSpecifier : public BaseTypeSpecifier ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( BaseSymbolTypeSpecifier )
+{
+
+ AVM_DECLARE_UNCLONABLE_CLASS(BaseSymbolTypeSpecifier)
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ TableOfSymbol mSymbolData;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BaseSymbolTypeSpecifier(class_kind_t aClassKind,
+ avm_type_specifier_kind_t aSpecifierKind,
+ DataType * aCompiledType,
+ avm_size_t aSize, avm_size_t aDataSize, avm_size_t aBitSize)
+ : BaseTypeSpecifier(aClassKind, aSpecifierKind, aCompiledType,
+ aSize, aDataSize, aBitSize),
+ mSymbolData()
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BaseSymbolTypeSpecifier()
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mSymbolData
+ */
+ inline void saveSymbolData(InstanceOfData * anInstance)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( anInstance )
+ << "InstanceOfData !!!"
+ << SEND_EXIT;
+
+ mSymbolData.save(anInstance);
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mSymbolData
+ */
+ inline void appendSymbolData(const Symbol & aSymbol)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( aSymbol )
+ << "InstanceOfData !!!"
+ << SEND_EXIT;
+
+ mSymbolData.append(aSymbol);
+ }
+
+ inline TableOfSymbol & getSymbolData()
+ {
+ return( mSymbolData );
+ }
+
+ inline const TableOfSymbol & getSymbolData() const
+ {
+ return( mSymbolData );
+ }
+
+
+ inline const Symbol & getSymbolData(avm_offset_t offset) const
+ {
+ return( mSymbolData.get(offset) );
+ }
+
+ inline const Symbol & getSymbolData(
+ const std::string & aFullyQualifiedNameID) const
+ {
+ return( mSymbolData.getByFQNameID(aFullyQualifiedNameID) );
+ }
+
+ inline const Symbol & getDataByQualifiedNameID(
+ const std::string & aQualifiedNameID) const
+ {
+ return( mSymbolData.getByQualifiedNameID( aQualifiedNameID ) );
+ }
+
+ inline const Symbol & getDataByNameID(const std::string & id) const
+ {
+ return( mSymbolData.getByNameID(id) );
+ }
+
+
+ inline const Symbol & getDataByAstElement(
+ const ObjectElement * astElement) const
+ {
+ return( mSymbolData.getByAstElement(astElement) );
+ }
+
+
+ inline BaseTypeSpecifier * getSymbolType(avm_offset_t offset) const
+ {
+ return( mSymbolData.get(offset).getTypeSpecifier() );
+ }
+
+
+ inline bool hasSymbolData() const
+ {
+ return( mSymbolData.nonempty() );
+ }
+
+
+ /**
+ * SETTER
+ * the Data Size
+ */
+ inline virtual void updateSize()
+ {
+ avm_size_t aDataSize = 0;
+
+ TableOfSymbol::iterator it = getSymbolData().begin();
+ TableOfSymbol::iterator itEnd = getSymbolData().end();
+ for( ; it != itEnd ; ++it )
+ {
+ aDataSize = aDataSize + (*it).getTypeSpecifier()->getDataSize();
+ }
+
+ setDataSize( aDataSize );
+
+ setSize( getSymbolData().size() );
+ }
+
+};
+
+
+
+} /* namespace sep */
+
+#endif /* BASESYMBOLTYPESPECIFIER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/type/BaseTypeSpecifier.cpp b/org.eclipse.efm.symbex/src/fml/type/BaseTypeSpecifier.cpp
new file mode 100644
index 0000000..d73ec7c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/type/BaseTypeSpecifier.cpp
@@ -0,0 +1,381 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 7 août 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "BaseTypeSpecifier.h"
+
+#include <fml/expression/BuiltinArray.h>
+#include <fml/expression/ExpressionConstant.h>
+#include <fml/expression/ExpressionConstructor.h>
+
+#include <fml/type/TypeAliasSpecifier.h>
+
+
+namespace sep
+{
+
+
+std::string BaseTypeSpecifier::TYPE_ANOMYM_ID = "type#anonym";
+
+/**
+ * SETTER
+ * updateFullyQualifiedNameID()
+ */
+void BaseTypeSpecifier::updateFullyQualifiedNameID()
+{
+ if( hasFullyQualifiedNameID() )
+ {
+ if( hasAstElement() )
+ {
+ setNameID( getAstNameID() );
+ }
+ else
+ {
+ setNameID( NamedElement::extractNameID(
+ getFullyQualifiedNameID() ) );
+ }
+ }
+ else if( hasAstElement() )
+ {
+ std::string aFullyQualifiedNameID = getAstFullyQualifiedNameID();
+
+ setAllNameID( "type" + aFullyQualifiedNameID.substr(
+ aFullyQualifiedNameID.find(FQN_ID_ROOT_SEPARATOR)),
+ getAstNameID() );
+ }
+ else
+ {
+ setAllNameID( TYPE_ANOMYM_ID , TYPE_ANOMYM_ID );
+ }
+}
+
+
+/**
+ * CONSTRAINT generation
+ * for a given parameter
+ */
+
+bool BaseTypeSpecifier::couldGenerateConstraint() const
+{
+ switch( mSpecifierKind )
+ {
+ case TYPE_ENUM_SPECIFIER:
+ case TYPE_INTERVAL_SPECIFIER:
+ {
+ return( true );
+ }
+
+ case TYPE_INTEGER_SPECIFIER:
+ case TYPE_RATIONAL_SPECIFIER:
+ case TYPE_FLOAT_SPECIFIER:
+ case TYPE_REAL_SPECIFIER:
+ {
+ return( hasBitSizeConstraint() );
+ }
+
+ case TYPE_POS_INTEGER_SPECIFIER:
+ case TYPE_UINTEGER_SPECIFIER:
+ case TYPE_URATIONAL_SPECIFIER:
+// case TYPE_CONTINUOUS_TIME_SPECIFIER:
+// case TYPE_DISCRETE_TIME_SPECIFIER:
+ case TYPE_UFLOAT_SPECIFIER:
+ case TYPE_UREAL_SPECIFIER:
+ {
+ return( true );
+ }
+
+ default:
+ {
+ return( false );
+ }
+ }
+}
+
+
+
+
+inline static avm_integer_t pow2(avm_size_t n)
+{
+ return( 1 << n );
+
+// avm_integer_t res = 1;
+// for( ; 0 < n; --n )
+// {
+// res *= 2;
+// }
+// return( res );
+}
+
+
+
+avm_integer_t BaseTypeSpecifier::minIntegerValue() const
+{
+ const avm_size_t dim = getBitSize();
+
+ switch( mSpecifierKind )
+ {
+ case TYPE_INTEGER_SPECIFIER:
+ {
+// if( hasBitSizeConstraint() )
+ if( (dim > 0) && (dim <= 64) )
+ {
+ return( - pow2(dim - 1) );
+ }
+ else
+ {
+ return( AVM_NUMERIC_MIN_INTEGER );
+ }
+ }
+
+ case TYPE_POS_INTEGER_SPECIFIER:
+ {
+ return( 1 );
+ }
+
+ case TYPE_UINTEGER_SPECIFIER:
+ case TYPE_DISCRETE_TIME_SPECIFIER:
+ {
+ return( 0 );
+ }
+
+ default:
+ {
+ return( AVM_NUMERIC_MIN_INTEGER );
+ }
+ }
+}
+
+
+avm_uinteger_t BaseTypeSpecifier::maxIntegerValue() const
+{
+ const avm_size_t dim = getBitSize();
+
+ switch( mSpecifierKind )
+ {
+ case TYPE_INTEGER_SPECIFIER:
+ {
+// if( hasBitSizeConstraint() )
+ if( (dim > 0) && (dim <= 64) )
+ {
+ return( pow2(dim - 1) - 1 );
+ }
+ else
+ {
+ return( AVM_NUMERIC_MAX_INTEGER );
+ }
+ }
+
+ case TYPE_POS_INTEGER_SPECIFIER:
+ case TYPE_UINTEGER_SPECIFIER:
+ case TYPE_DISCRETE_TIME_SPECIFIER:
+ {
+// if( hasBitSizeConstraint() )
+ if( (dim > 0) && (dim <= 64) )
+ {
+ return( pow2(dim) );
+ }
+ else
+ {
+ return( AVM_NUMERIC_MAX_UINTEGER );
+ }
+ }
+
+ default:
+ {
+ return( AVM_NUMERIC_MAX_UINTEGER );
+ }
+ }
+}
+
+
+BF BaseTypeSpecifier::genConstraint(const BF & aParam) const
+{
+ if( hasConstraint() )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "TODO << TypeSpecifier::genConstraint( "
+ << aParam << " ) >> with compiled constraint:" << std::endl
+ << getConstraint()
+ << SEND_EXIT;
+ }
+
+ const avm_size_t dim = getBitSize();
+
+ switch( mSpecifierKind )
+ {
+ case TYPE_INTEGER_SPECIFIER:
+ case TYPE_RATIONAL_SPECIFIER:
+ case TYPE_FLOAT_SPECIFIER:
+ case TYPE_REAL_SPECIFIER:
+ {
+// if( hasBitSizeConstraint() )
+ if( (dim > 0) && (dim <= 64) )
+ {
+ return( ExpressionConstructorNative::andExpr(
+ ExpressionConstructorNative::gteExpr(aParam,
+ ExpressionConstructorNative::newInteger(
+ (- pow2(dim - 1)))),
+ ExpressionConstructorNative::lteExpr(aParam,
+ ExpressionConstructorNative::newInteger(
+ pow2(dim - 1) - 1))) );
+ }
+ else
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+ }
+
+ case TYPE_UINTEGER_SPECIFIER:
+ case TYPE_URATIONAL_SPECIFIER:
+ case TYPE_CONTINUOUS_TIME_SPECIFIER:
+ case TYPE_DISCRETE_TIME_SPECIFIER:
+ case TYPE_UFLOAT_SPECIFIER:
+ case TYPE_UREAL_SPECIFIER:
+ {
+// if( hasBitSizeConstraint() )
+ if( (dim > 0) && (dim <= 64) )
+ {
+ return( ExpressionConstructorNative::andExpr(
+ ExpressionConstructorNative::gteExpr(aParam,
+ ExpressionConstant::INTEGER_ZERO),
+ ExpressionConstructorNative::lteExpr(aParam,
+ ExpressionConstructorNative::newInteger(
+ pow2(dim)))) );
+ }
+ else
+ {
+ return( ExpressionConstructorNative::gteExpr(aParam,
+ ExpressionConstant::INTEGER_ZERO) );
+ }
+ }
+
+ case TYPE_POS_INTEGER_SPECIFIER:
+ {
+// if( hasBitSizeConstraint() )
+ if( (dim > 0) && (dim <= 64) )
+ {
+ return( ExpressionConstructorNative::andExpr(
+ ExpressionConstructorNative::gtExpr(aParam,
+ ExpressionConstant::INTEGER_ZERO),
+ ExpressionConstructorNative::lteExpr(aParam,
+ ExpressionConstructorNative::newInteger(
+ pow2(dim)))) );
+ }
+ else
+ {
+ return( ExpressionConstructorNative::gtExpr(aParam,
+ ExpressionConstant::INTEGER_ZERO) );
+ }
+ }
+
+ default:
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+ }
+}
+
+
+/**
+ * GETTER
+ * refered (as typedef) TypeSpecifier
+ */
+BaseTypeSpecifier * BaseTypeSpecifier::referedTypeSpecifier()
+{
+ return( this->isTypedAlias() ?
+ as< TypeAliasSpecifier >()->targetTypeSpecifier() : this );
+}
+
+
+/**
+ * Format a value w.r.t. its type
+ */
+void BaseTypeSpecifier::formatStream(
+ OutStream & out, const BF & bfValue) const
+{
+ if( bfValue.is< ArrayBF >() )
+ {
+ formatStream(out, bfValue.as_ref< ArrayBF >());
+ }
+ else
+ {
+ out << bfValue.str();
+ }
+}
+
+void BaseTypeSpecifier::formatStream(
+ OutStream & out, const ArrayBF & arrayValue) const
+{
+ formatStream(out, arrayValue[0]);
+ for( avm_size_t offset = 1 ; offset < arrayValue.size() ; ++offset )
+ {
+ out << out.VALUE_STRUCT_CSS.SEPARATOR;
+ formatStream(out, arrayValue[offset]);
+ }
+}
+
+
+/**
+ * Serialization
+ */
+void BaseTypeSpecifier::strHeader(OutStream & out) const
+{
+ out << "type< " << strSpecifierKind() << " > " << getFullyQualifiedNameID();
+}
+
+void BaseTypeSpecifier::toStream(OutStream & out) const
+{
+ if( out.preferablyFQN() )
+ {
+ out << TAB << getFullyQualifiedNameID();
+
+ AVM_DEBUG_REF_COUNTER(out);
+
+ return;
+ }
+
+ out << TAB << "type<base> " << getFullyQualifiedNameID()
+ << " as " << strSpecifierKind() << " {" << EOL;
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ if( hasAstElement() )
+ {
+ out << TAB2 << "//compiled = "
+ << getAstFullyQualifiedNameID() << ";" << EOL;
+ }
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+ out << TAB << "property:" << EOL
+
+ << TAB2 << "size = " << size() << ";" << EOL
+ << TAB2 << "data_size = " << getDataSize() << ";" << EOL
+ << TAB2 << "bit_size = " << getBitSize() << ";" << EOL;
+
+ if( hasDefaultValue() )
+ {
+ out << TAB2 << "default = " << getDefaultValue().str() << ";" << EOL;
+ }
+
+ if( hasConstraint() )
+ {
+ out << TAB2 << "constraint {" << INCR2_INDENT;
+ getConstraint().toStream(out);
+ out << DECR2_INDENT_TAB << "}" << EOL;
+ }
+
+ out << TAB << "}" << EOL_FLUSH;
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/type/BaseTypeSpecifier.h b/org.eclipse.efm.symbex/src/fml/type/BaseTypeSpecifier.h
new file mode 100644
index 0000000..c664348
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/type/BaseTypeSpecifier.h
@@ -0,0 +1,468 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 7 août 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef BASETYPESPECIFIER_H_
+#define BASETYPESPECIFIER_H_
+
+#include <common/AvmPointer.h>
+#include <common/BF.h>
+
+#include <fml/common/ObjectElement.h>
+
+#include <fml/executable/BaseCompiledForm.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/infrastructure/DataType.h>
+
+#include <fml/lib/ITypeSpecifier.h>
+
+
+namespace sep
+{
+
+class ArrayBF;
+
+
+class BaseTypeSpecifier :
+ public BaseCompiledForm,
+ public ITypeSpecifier,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( BaseTypeSpecifier )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( BaseTypeSpecifier )
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ avm_type_specifier_kind_t mSpecifierKind;
+
+ avm_size_t mMinimumSize;
+ avm_size_t mMaximumSize;
+
+
+ avm_size_t mDataSize;
+
+ avm_size_t mBitSize;
+
+ BF mDefaultValue;
+
+ BF mConstraint;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ BaseTypeSpecifier(avm_type_specifier_kind_t aSpecifierKind,
+ const std::string & aTypeID, avm_size_t maxSize,
+ avm_size_t aDataSize, avm_size_t aBitSize, const BF & defaultValue)
+ : BaseCompiledForm(CLASS_KIND_T( BaseTypeSpecifier ), aTypeID, aTypeID),
+ mSpecifierKind( aSpecifierKind ),
+ mMinimumSize( 0 ),
+ mMaximumSize( maxSize ),
+ mDataSize( aDataSize ),
+ mBitSize( aBitSize ),
+ mDefaultValue( defaultValue ),
+ mConstraint( )
+ {
+ //!! NOTHING
+ }
+
+ BaseTypeSpecifier(avm_type_specifier_kind_t aSpecifierKind,
+ const std::string & aTypeID, avm_size_t minSize, avm_size_t maxSize,
+ avm_size_t aDataSize, avm_size_t aBitSize, const BF & defaultValue)
+ : BaseCompiledForm(CLASS_KIND_T( BaseTypeSpecifier ), aTypeID, aTypeID),
+ mSpecifierKind( aSpecifierKind ),
+ mMinimumSize( minSize ),
+ mMaximumSize( maxSize ),
+ mDataSize( aDataSize ),
+ mBitSize( aBitSize ),
+ mDefaultValue( defaultValue ),
+ mConstraint( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * copy
+ */
+ BaseTypeSpecifier(const BaseTypeSpecifier & aTypeSpecifier)
+ : BaseCompiledForm( aTypeSpecifier ),
+ mSpecifierKind( aTypeSpecifier.mSpecifierKind ),
+ mMinimumSize( aTypeSpecifier.mMinimumSize ),
+ mMaximumSize( aTypeSpecifier.mMaximumSize ),
+ mDataSize( aTypeSpecifier.mDataSize ),
+ mBitSize( aTypeSpecifier.mBitSize ),
+ mDefaultValue( aTypeSpecifier.mDefaultValue ),
+ mConstraint( aTypeSpecifier.mConstraint )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Others
+ */
+ BaseTypeSpecifier(class_kind_t aClassKind,
+ avm_type_specifier_kind_t aSpecifierKind,
+ const DataType * aCompiledType, BaseTypeSpecifier * aTypeSpecifier)
+ : BaseCompiledForm( aClassKind, NULL, aCompiledType ),
+ mSpecifierKind( aSpecifierKind ),
+ mMinimumSize( aTypeSpecifier->mMinimumSize ),
+ mMaximumSize( aTypeSpecifier->mMaximumSize ),
+ mDataSize( aTypeSpecifier->mDataSize ),
+ mBitSize( aTypeSpecifier->mBitSize ),
+ mDefaultValue( aTypeSpecifier->mDefaultValue ),
+ mConstraint( aTypeSpecifier->mConstraint )
+ {
+ updateFullyQualifiedNameID();
+ }
+
+ BaseTypeSpecifier(avm_type_specifier_kind_t aSpecifierKind,
+ const DataType * aCompiledType, avm_size_t maxSize,
+ avm_size_t aDataSize, avm_size_t aBitSize, const BF & defaultValue)
+ : BaseCompiledForm(CLASS_KIND_T( BaseTypeSpecifier ), NULL, aCompiledType),
+ mSpecifierKind( aSpecifierKind ),
+ mMinimumSize( 0 ),
+ mMaximumSize( maxSize ),
+ mDataSize( aDataSize ),
+ mBitSize( aBitSize ),
+ mDefaultValue( defaultValue ),
+ mConstraint( )
+ {
+ updateFullyQualifiedNameID();
+ }
+
+ BaseTypeSpecifier(class_kind_t aClassKind,
+ avm_type_specifier_kind_t aSpecifierKind,
+ const ObjectElement * aCompiledType, avm_size_t maxSize,
+ avm_size_t aDataSize, avm_size_t aBitSize)
+ : BaseCompiledForm(aClassKind, NULL, aCompiledType),
+ mSpecifierKind( aSpecifierKind ),
+ mMinimumSize( 0 ),
+ mMaximumSize( maxSize ),
+ mDataSize( aDataSize ),
+ mBitSize( aBitSize ),
+ mDefaultValue( ),
+ mConstraint( )
+ {
+ updateFullyQualifiedNameID();
+ }
+
+ BaseTypeSpecifier(class_kind_t aClassKind,
+ avm_type_specifier_kind_t aSpecifierKind,
+ const std::string & aTypeID, avm_size_t maxSize,
+ avm_size_t aDataSize, avm_size_t aBitSize)
+ : BaseCompiledForm(aClassKind, aTypeID, aTypeID),
+ mSpecifierKind( aSpecifierKind ),
+ mMinimumSize( 0 ),
+ mMaximumSize( maxSize ),
+ mDataSize( aDataSize ),
+ mBitSize( aBitSize ),
+ mDefaultValue( ),
+ mConstraint( )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~BaseTypeSpecifier()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER
+ * Compiled ObjectElement as Compiled Machine
+ */
+ inline const DataType * getAstDataType() const
+ {
+ return( getAstElement()->as< DataType >() );
+ }
+
+ /**
+ * GETTER - SETTER
+ * mSpecifierKind
+ */
+ inline virtual const BaseTypeSpecifier * thisTypeSpecifier() const
+ {
+ return( this );
+ }
+
+ inline virtual avm_type_specifier_kind_t getTypeSpecifierKind() const
+ {
+ return( mSpecifierKind );
+ }
+
+ inline virtual bool isTypeSpecifierKind(
+ avm_type_specifier_kind_t aSpecifierKind) const
+ {
+ return( mSpecifierKind == aSpecifierKind );
+ }
+
+ inline virtual bool isTypeSpecifierKind(BaseTypeSpecifier * aType) const
+ {
+ return( mSpecifierKind == aType->mSpecifierKind );
+ }
+
+ inline virtual bool hasTypeSpecifierKind(
+ avm_type_specifier_kind_t aSpecifierKind1,
+ avm_type_specifier_kind_t aSpecifierKind2) const
+ {
+ return( (mSpecifierKind == aSpecifierKind1) ||
+ (mSpecifierKind == aSpecifierKind2) );
+ }
+
+ inline virtual bool hasTypeSpecifierKind(
+ avm_type_specifier_kind_t aSpecifierKind1,
+ avm_type_specifier_kind_t aSpecifierKind2,
+ avm_type_specifier_kind_t aSpecifierKind3) const
+ {
+ return( (mSpecifierKind == aSpecifierKind1) ||
+ (mSpecifierKind == aSpecifierKind2) ||
+ (mSpecifierKind == aSpecifierKind3) );
+ }
+
+ inline void setSpecifierKind(avm_type_specifier_kind_t aSpecifierKind)
+ {
+ mSpecifierKind = aSpecifierKind;
+ }
+
+
+ /**
+ * SETTER
+ * mFullyQualifiedNameID
+ */
+ virtual void updateFullyQualifiedNameID();
+
+
+ /**
+ * GETTER - SETTER
+ * mMinimumSize
+ */
+ inline avm_size_t getMinimumSize() const
+ {
+ return( mMinimumSize );
+ }
+
+ inline void setMinimumSize(avm_size_t minSize)
+ {
+ mMinimumSize = minSize;
+ }
+
+ /**
+ * GETTER - SETTER
+ * mMaximumSize
+ */
+ inline avm_size_t getMaximumSize() const
+ {
+ return( mMaximumSize );
+ }
+
+ inline void setMaximumSize(avm_size_t maxSize)
+ {
+ mMaximumSize = maxSize;
+ }
+
+
+ inline avm_size_t size() const
+ {
+ return( mMaximumSize );
+ }
+
+ inline void setSize(avm_size_t maxSize)
+ {
+ mMaximumSize = maxSize;
+ }
+
+ /**
+ * SETTER
+ * mMinimumSize
+ * mMaximumSize
+ */
+ inline void setSize(avm_size_t minSize, avm_size_t maxSize)
+ {
+ mMinimumSize = minSize;
+ mMaximumSize = maxSize;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mDataSize
+ */
+ inline avm_size_t getDataSize() const
+ {
+ return( mDataSize );
+ }
+
+ inline void setDataSize(avm_size_t aDataSize)
+ {
+ mDataSize = aDataSize;
+ }
+
+ /**
+ * GETTER - SETTER
+ * mBitSize
+ */
+ inline avm_size_t getBitSize() const
+ {
+ return( mBitSize );
+ }
+
+ inline void setBitSize(avm_size_t aBitSize)
+ {
+ mBitSize = aBitSize;
+ }
+
+
+ /**
+ * SETTER
+ * mDataSize
+ */
+ inline virtual void updateSize()
+ {
+ AVM_OS_EXIT( FAILED )
+ << "Unexpected call of pure virtual method !!!"
+ << SEND_EXIT;
+ }
+
+
+ /**
+ * CONSTRAINT generation
+ * for a given parameter
+ */
+ bool couldGenerateConstraint() const;
+
+ inline bool hasBitSizeConstraint() const
+ {
+ const avm_size_t dim = getBitSize();
+
+ return( (dim > 0) && (dim <= 64) );
+ }
+
+ avm_integer_t minIntegerValue() const;
+
+ avm_uinteger_t maxIntegerValue() const;
+
+ virtual BF genConstraint(const BF & aParam) const;
+
+
+ /**
+ * GETTER - SETTER
+ * mDefaultValue
+ */
+ inline const BF & getDefaultValue() const
+ {
+ return( mDefaultValue );
+ }
+
+ inline bool hasDefaultValue() const
+ {
+ return( mDefaultValue.valid() );
+ }
+
+ inline void setDefaultValue(const BF & aDefaultValue)
+ {
+ mDefaultValue = aDefaultValue;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mConstraint
+ */
+ inline const BF & getConstraint() const
+ {
+ return( mConstraint );
+ }
+
+ inline bool hasConstraint() const
+ {
+ return( mConstraint.valid() );
+ }
+
+ inline void saveConstraint(Element * aConstraint)
+ {
+ mConstraint.renew( aConstraint );
+ }
+
+ inline void setConstraint(const BF & aConstraint)
+ {
+ mConstraint = aConstraint;
+ }
+
+
+ /**
+ * GETTER
+ * Refered (as typedef) TypeSpecifier
+ */
+ BaseTypeSpecifier * referedTypeSpecifier();
+
+
+ /**
+ * Format a value w.r.t. its type
+ */
+ virtual void formatStream(OutStream & out, const BF & bfValue) const;
+
+ virtual void formatStream(
+ OutStream & out, const ArrayBF & arrayValue) const;
+
+ /**
+ * Serialization
+ */
+ inline virtual std::string strT() const
+ {
+ if( (mBitSize == 0) || (! isTypedNumeric()) )
+ {
+ return( getNameID() );
+ }
+ return( OSS() << getNameID() << ":" << mBitSize );
+ }
+
+
+ virtual void strHeader(OutStream & out) const;
+
+ virtual void toStream(OutStream & out) const;
+
+ virtual void toFscn(OutStream & out) const
+ {
+ toStream(out);
+ }
+
+
+public:
+ static std::string TYPE_ANOMYM_ID;
+
+ inline virtual bool isAnonymID() const
+ {
+ return( getNameID().empty() || (getNameID() == TYPE_ANOMYM_ID) );
+ }
+
+};
+
+
+}
+
+#endif /* BASETYPESPECIFIER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/type/ChoiceTypeSpecifier.cpp b/org.eclipse.efm.symbex/src/fml/type/ChoiceTypeSpecifier.cpp
new file mode 100644
index 0000000..ee5520c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/type/ChoiceTypeSpecifier.cpp
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 22 juin 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#include "ChoiceTypeSpecifier.h"
+
+
+namespace sep
+{
+
+
+/**
+ * Serialization
+ */
+void ChoiceTypeSpecifier::toStream(OutStream & out) const
+{
+ if( out.preferablyFQN() )
+ {
+ out << TAB << getFullyQualifiedNameID();
+
+ AVM_DEBUG_REF_COUNTER(out);
+
+ return;
+ }
+
+ out << TAB << "type " << getFullyQualifiedNameID() << " choice {" << EOL;
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ if( hasAstElement() )
+ {
+ out << TAB2 << "//compiled = "
+ << getAstFullyQualifiedNameID() << ";" << EOL;
+ }
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+
+ out << TAB << "property:" << EOL
+
+ << TAB2 << "size = " << size() << ";" << EOL
+ << TAB2 << "data_size = " << getDataSize() << ";" << EOL
+ << TAB2 << "bit_size = " << getBitSize() << ";" << EOL
+
+ << TAB << "choice:" << EOL_INCR_INDENT;
+
+ getSymbolData().toStream(out);
+
+ if( hasConstraint() )
+ {
+ out << TAB2 << "@constraint {" << EOL_INCR2_INDENT;
+ getConstraint().toStream(out);
+ out << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+ out << DECR_INDENT_TAB << "}" << EOL_FLUSH;
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/type/ChoiceTypeSpecifier.h b/org.eclipse.efm.symbex/src/fml/type/ChoiceTypeSpecifier.h
new file mode 100644
index 0000000..d93a0c4
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/type/ChoiceTypeSpecifier.h
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 22 juin 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#ifndef FML_TYPE_CHOICETYPESPECIFIER_H_
+#define FML_TYPE_CHOICETYPESPECIFIER_H_
+
+#include <fml/type/BaseSymbolTypeSpecifier.h>
+
+
+namespace sep
+{
+
+class DataType;
+
+
+class ChoiceTypeSpecifier : public BaseSymbolTypeSpecifier ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( UnionTypeSpecifier )
+{
+
+ AVM_DECLARE_UNCLONABLE_CLASS(ChoiceTypeSpecifier)
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ChoiceTypeSpecifier(DataType * aCompiledType)
+ : BaseSymbolTypeSpecifier(CLASS_KIND_T( ChoiceTypeSpecifier ),
+ TYPE_UNION_SPECIFIER, aCompiledType, 1, 1, 0)
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ChoiceTypeSpecifier()
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * Serialization
+ */
+ void toStream(OutStream & out) const;
+
+
+};
+
+} /* namespace sep */
+
+#endif /* FML_TYPE_CHOICETYPESPECIFIER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/type/ClassTypeSpecifier.cpp b/org.eclipse.efm.symbex/src/fml/type/ClassTypeSpecifier.cpp
new file mode 100644
index 0000000..893b411
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/type/ClassTypeSpecifier.cpp
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 7 août 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ClassTypeSpecifier.h"
+
+#include <fml/expression/BuiltinArray.h>
+
+
+namespace sep
+{
+
+
+/**
+ * Format a value w.r.t. its type
+ */
+void ClassTypeSpecifier::formatStream(
+ OutStream & out, const ArrayBF & arrayValue) const
+{
+ out << out.VALUE_STRUCT_CSS.BEGIN;
+
+ avm_size_t offset = 1;
+ TableOfSymbol::const_iterator it = getSymbolData().begin();
+ TableOfSymbol::const_iterator itEnd = getSymbolData().end();
+ if( it != itEnd )
+ {
+ (*it).getTypeSpecifier()->formatStream(out, arrayValue[0]);
+
+ for( ++it ; (offset < arrayValue.size()) && (it != itEnd) ;
+ ++it , ++offset )
+ {
+ out << out.VALUE_STRUCT_CSS.SEPARATOR;
+ (*it).getTypeSpecifier()->formatStream(out, arrayValue[offset]);
+ }
+ }
+
+ for( ; offset < arrayValue.size() ; ++offset )
+ {
+ out << out.VALUE_STRUCT_CSS.SEPARATOR << arrayValue[offset].str();
+ }
+
+ out << out.VALUE_STRUCT_CSS.END ;
+}
+
+
+/**
+ * Serialization
+ */
+void ClassTypeSpecifier::toStream(OutStream & out) const
+{
+ if( out.preferablyFQN() )
+ {
+ out << TAB << getFullyQualifiedNameID();
+
+ AVM_DEBUG_REF_COUNTER(out);
+
+ return;
+ }
+
+ out << TAB << "type " << getFullyQualifiedNameID()
+ << ((isTypedUnion())? " union" : " struct") << " {" << EOL;
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ if( hasAstElement() )
+ {
+ out << TAB2 << "//compiled = "
+ << getAstFullyQualifiedNameID() << ";" << EOL;
+ }
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+AVM_IF_DEBUG_FLAG( DATA )
+ out << TAB << "property:" << EOL
+
+ << TAB2 << "size = " << size() << ";" << " "/*EOL;
+ << TAB2*/ << "data_size = " << getDataSize() << ";" << " "/*EOL;
+ << TAB2*/ << "bit_size = " << getBitSize() << ";" << EOL
+
+ << TAB << "attribute:" << EOL;
+AVM_ENDIF_DEBUG_FLAG( DATA )
+
+ if( hasConstraint() )
+ {
+ out << TAB2 << "@constraint {" << EOL_INCR2_INDENT;
+ getConstraint().toStream(out);
+ out << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+ out << incr_stream( getSymbolData() ) << TAB << "}" << EOL_FLUSH;
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/type/ClassTypeSpecifier.h b/org.eclipse.efm.symbex/src/fml/type/ClassTypeSpecifier.h
new file mode 100644
index 0000000..d6f3bbc
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/type/ClassTypeSpecifier.h
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 7 août 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef CLASSTYPESPECIFIER_H_
+#define CLASSTYPESPECIFIER_H_
+
+#include <fml/type/BaseSymbolTypeSpecifier.h>
+
+
+namespace sep
+{
+
+class ArrayBF;
+
+class DataType;
+
+
+class ClassTypeSpecifier : public BaseSymbolTypeSpecifier ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ClassTypeSpecifier )
+{
+
+ AVM_DECLARE_UNCLONABLE_CLASS(ClassTypeSpecifier)
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ClassTypeSpecifier(DataType * aCompiledType,
+ avm_type_specifier_kind_t aSpecifierKind = TYPE_CLASS_SPECIFIER)
+ : BaseSymbolTypeSpecifier(CLASS_KIND_T( ClassTypeSpecifier ),
+ aSpecifierKind, aCompiledType, 1, 1, 0)
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ClassTypeSpecifier()
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * Format a value w.r.t. its type
+ */
+ virtual void formatStream(
+ OutStream & out, const ArrayBF & arrayValue) const;
+
+
+ /**
+ * Serialization
+ */
+ void toStream(OutStream & out) const;
+
+};
+
+
+}
+
+#endif /* CLASSTYPESPECIFIER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/type/ContainerTypeSpecifier.cpp b/org.eclipse.efm.symbex/src/fml/type/ContainerTypeSpecifier.cpp
new file mode 100644
index 0000000..508a6ce
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/type/ContainerTypeSpecifier.cpp
@@ -0,0 +1,232 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 7 août 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ContainerTypeSpecifier.h"
+
+#include <fml/expression/BuiltinArray.h>
+
+#include <fml/type/TypeManager.h>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRAINT generation
+ * for a given parameter
+ */
+BF ContainerTypeSpecifier::genConstraint(const BF & aParam) const
+{
+ if( hasConstraint() )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "TODO << ContainerTypeSpecifier::genConstraint( "
+ << aParam << " ) >> with compiled constraint:" << std::endl
+ << getConstraint()
+ << SEND_EXIT;
+ }
+
+ switch( mSpecifierKind )
+ {
+ case TYPE_TIME_SPECIFIER:
+ case TYPE_DISCRETE_TIME_SPECIFIER:
+ case TYPE_CONTINUOUS_TIME_SPECIFIER:
+ {
+ if( mContentsTypeSpecifier.valid() )
+ {
+ return( mContentsTypeSpecifier.genConstraint(aParam) );
+ }
+ else
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+ }
+
+ default:
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+ }
+}
+
+
+/**
+ * Format a value w.r.t. its type
+ */
+void ContainerTypeSpecifier::formatStream(
+ OutStream & os, const ArrayBF & arrayValue) const
+{
+ const SymbexValueCSS & VALUE_CSS = ( isTypedArray() ?
+ os.VALUE_ARRAY_CSS : os.VALUE_STRUCT_CSS );
+
+ os << VALUE_CSS.BEGIN;
+
+ mContentsTypeSpecifier.formatStream(os, arrayValue[0]);
+ for( avm_size_t offset = 1 ; offset < arrayValue.size() ; ++offset )
+ {
+ os << VALUE_CSS.SEPARATOR;
+ mContentsTypeSpecifier.formatStream(os, arrayValue[offset]);
+ }
+
+ os << VALUE_CSS.END;
+}
+
+
+/**
+ * Serialization
+ */
+std::string ContainerTypeSpecifier::strSpecifierKing(
+ avm_type_specifier_kind_t aSpecifierKind)
+{
+ switch( aSpecifierKind )
+ {
+ case TYPE_ARRAY_SPECIFIER:
+ {
+ return( "array" );
+ }
+
+ case TYPE_LIST_SPECIFIER:
+ {
+ return( "list" );
+ }
+ case TYPE_VECTOR_SPECIFIER:
+ {
+ return( "vector" );
+ }
+ case TYPE_REVERSE_VECTOR_SPECIFIER:
+ {
+ return( "rvector" );
+ }
+
+ case TYPE_FIFO_SPECIFIER:
+ {
+ return( "fifo" );
+ }
+ case TYPE_LIFO_SPECIFIER:
+ {
+ return( "lifo" );
+ }
+
+ case TYPE_MULTI_FIFO_SPECIFIER:
+ {
+ return( "multififo" );
+ }
+ case TYPE_MULTI_LIFO_SPECIFIER:
+ {
+ return( "multilifo" );
+ }
+
+ case TYPE_SET_SPECIFIER:
+ {
+ return( "set" );
+ }
+
+ case TYPE_MULTISET_SPECIFIER:
+ {
+ return( "multiset" );
+ }
+
+ case TYPE_CLOCK_SPECIFIER:
+ {
+ return( "clock" );
+ }
+ case TYPE_TIME_SPECIFIER:
+ {
+ return( "time" );
+ }
+ case TYPE_CONTINUOUS_TIME_SPECIFIER:
+ {
+ return( "ctime" );
+ }
+ case TYPE_DISCRETE_TIME_SPECIFIER:
+ {
+ return( "dtime" );
+ }
+
+ default:
+ {
+ return( "container<?>" );
+ }
+ }
+}
+
+std::string ContainerTypeSpecifier::strType() const
+{
+ std::ostringstream os;
+
+ if( isTypedArray() )
+ {
+ os << mContentsTypeSpecifier.strT() << "[ " << mMaximumSize << " ]";
+ }
+ else if( isTypedClockTime() && (mMaximumSize == 1) )
+ {
+ os << ContainerTypeSpecifier::strSpecifierKing(mSpecifierKind)
+// << " " << mContentsTypeSpecifier.strT();
+ << "< " << mContentsTypeSpecifier.strT() << " >";
+ }
+ else
+ {
+ os << ContainerTypeSpecifier::strSpecifierKing(mSpecifierKind)
+ << "< " << mContentsTypeSpecifier.strT();
+ if( mMaximumSize >= 0 )
+ {
+ os << " , " << mMaximumSize;
+ }
+ os << " >";
+ }
+ /**
+ * Serialization
+ */
+
+ return( os.str() );
+}
+
+
+void ContainerTypeSpecifier::toStream(OutStream & os) const
+{
+ if( os.preferablyFQN() )
+ {
+ os << TAB << getFullyQualifiedNameID();
+
+ AVM_DEBUG_REF_COUNTER(os);
+
+ return;
+ }
+
+ os << TAB << "type " << getFullyQualifiedNameID() << " " << strType();
+
+ os << " {" << EOL;
+
+ os << TAB << "property:" << EOL;
+
+ //os << TAB2 << "size = " << size() << ";" << EOL;
+
+ os << TAB2 << "data_size = " << getDataSize() << ";" << " "/*EOL;
+
+ os << TAB2*/ << "bit_size = " << getBitSize() << ";" << EOL;
+
+ if( hasConstraint() )
+ {
+ os << TAB2 << "@constraint {" << EOL_INCR2_INDENT;
+ getConstraint().toStream(os);
+ os << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+ os << TAB << "}" << EOL_FLUSH;
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/type/ContainerTypeSpecifier.h b/org.eclipse.efm.symbex/src/fml/type/ContainerTypeSpecifier.h
new file mode 100644
index 0000000..f72e207
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/type/ContainerTypeSpecifier.h
@@ -0,0 +1,150 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 7 août 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef CONTAINERTYPESPECIFIER_H_
+#define CONTAINERTYPESPECIFIER_H_
+
+#include <fml/type/BaseTypeSpecifier.h>
+
+#include <fml/type/TypeSpecifier.h>
+
+
+namespace sep
+{
+
+
+class ArrayBF;
+class DataType;
+
+
+class ContainerTypeSpecifier : public BaseTypeSpecifier ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ContainerTypeSpecifier )
+{
+
+ AVM_DECLARE_UNCLONABLE_CLASS(ContainerTypeSpecifier)
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ // the Type Specifier
+ TypeSpecifier mContentsTypeSpecifier;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ContainerTypeSpecifier(avm_type_specifier_kind_t aSpecifierKind,
+ DataType * aCompiledType,
+ const TypeSpecifier & aTypeSpecifier, avm_size_t aSize)
+ : BaseTypeSpecifier(CLASS_KIND_T( ContainerTypeSpecifier ),
+ aSpecifierKind, aCompiledType, aSize,
+ aSize * (aTypeSpecifier.valid() ?
+ aTypeSpecifier.getDataSize() : 1) + 1, 0),
+ mContentsTypeSpecifier( aTypeSpecifier )
+ {
+ //!!! NOTHING
+ }
+
+ ContainerTypeSpecifier(avm_type_specifier_kind_t aSpecifierKind,
+ const std::string & aTypeID, const TypeSpecifier & aTypeSpecifier,
+ avm_size_t aSize)
+ : BaseTypeSpecifier(CLASS_KIND_T( ContainerTypeSpecifier ),
+ aSpecifierKind, aTypeID, aSize,
+ aSize * (aTypeSpecifier.valid() ?
+ aTypeSpecifier.getDataSize() : 1) + 1, 0),
+ mContentsTypeSpecifier( aTypeSpecifier )
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ContainerTypeSpecifier()
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mContentsTypeSpecifier
+ */
+ inline const TypeSpecifier & getContentsTypeSpecifier() const
+ {
+ return( mContentsTypeSpecifier );
+ }
+
+ inline bool hasContentsTypeSpecifier() const
+ {
+ return( mContentsTypeSpecifier.valid() );
+ }
+
+ inline void setContentsTypeSpecifier(const TypeSpecifier & aTypeSpecifier)
+ {
+ mContentsTypeSpecifier = aTypeSpecifier;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * the Bloc Data Size
+ */
+ inline avm_size_t bsize()
+ {
+ return( mContentsTypeSpecifier.valid() ?
+ mContentsTypeSpecifier.getDataSize() : 1 );
+ }
+
+
+ /**
+ * CONSTRAINT generation
+ * for a given parameter
+ */
+ BF genConstraint(const BF & aParam) const;
+
+
+ /**
+ * Format a value w.r.t. its type
+ */
+ inline virtual void formatStream(
+ OutStream & os, const ArrayBF & arrayValue) const;
+
+
+ /**
+ * Serialization
+ */
+ static std::string strSpecifierKing(avm_type_specifier_kind_t aSpecifierKind);
+
+ std::string strType() const;
+
+ std::string strT() const
+ {
+ return( isAnonymID() ? strType() : getNameID() );
+ }
+
+ void toStream(OutStream & os) const;
+
+};
+
+
+}
+
+#endif /* CONTAINERCONTAINERTYPESPECIFIER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/type/EnumTypeSpecifier.cpp b/org.eclipse.efm.symbex/src/fml/type/EnumTypeSpecifier.cpp
new file mode 100644
index 0000000..7118c09
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/type/EnumTypeSpecifier.cpp
@@ -0,0 +1,300 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 7 août 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "EnumTypeSpecifier.h"
+
+#include <fml/expression/ExpressionConstant.h>
+#include <fml/expression/ExpressionConstructorImpl.h>
+
+
+namespace sep
+{
+
+
+/**
+ * SETTER
+ * mBound
+ */
+void EnumTypeSpecifier::updateBound()
+{
+ avm_integer_t min = 0;
+ avm_integer_t max = 0;
+
+ mIntegerEnumerationFlag = true;
+
+ TableOfSymbol::const_iterator it = getSymbolData().begin();
+ TableOfSymbol::const_iterator endIt = getSymbolData().end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).getValue().isWeakInteger() )
+ {
+ if( (*it).getValue().toInteger() < min )
+ {
+ min = (*it).getValue().toInteger();
+ }
+ if( (*it).getValue().toInteger() > max )
+ {
+ max = (*it).getValue().toInteger();
+ }
+ }
+ else if( mIntegerEnumerationFlag )
+ {
+ mIntegerEnumerationFlag = false;
+ getwModifier().setFeatureUnsafe(true);
+ }
+ }
+
+ mInfimum = ExpressionConstructorNative::newInteger(min);
+ mSupremum = ExpressionConstructorNative::newInteger(max);
+}
+
+
+void EnumTypeSpecifier::updateBound(avm_integer_t min, avm_integer_t max)
+{
+ mInfimum = ExpressionConstructorNative::newInteger(min);
+ mSupremum = ExpressionConstructorNative::newInteger(max);
+
+ mIntegerEnumerationFlag = true;
+}
+
+
+/**
+ * GETTER
+ * newfresh Enum Value
+ */
+BF EnumTypeSpecifier::newfreshSymbolValue()
+{
+ if( getSymbolData().nonempty() )
+ {
+ BF newfreshVal = getSymbolData().last().getValue();
+
+ if( newfreshVal.isWeakInteger() )
+ {
+ newfreshVal.incrExpr();
+ }
+ else
+ {
+ newfreshVal = ExpressionConstructorNative::
+ newUInteger(getSymbolData().size() );
+ }
+
+ while( getSymbolDataByValue( newfreshVal ).valid() )
+ {
+ newfreshVal.incrExpr();
+ }
+
+ return( newfreshVal );
+ }
+
+ return( ExpressionConstructorNative::
+ newUInteger( getSymbolData().size() ) );
+}
+
+
+/**
+ * GETTER - SETTER
+ * mSymbolData
+ */
+bool EnumTypeSpecifier::hasSymbolData(InstanceOfData * aSymbolData) const
+{
+ if( aSymbolData->getTypeSpecifier() == this )
+ {
+ return( true );
+ }
+ else
+ {
+ TableOfSymbol::const_iterator it = getSymbolData().begin();
+ TableOfSymbol::const_iterator endIt = getSymbolData().end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it) == aSymbolData )
+ {
+ return( true );
+ }
+ }
+ }
+
+ return( false );
+}
+
+bool EnumTypeSpecifier::hasSymbolData(const BF & aSymbol) const
+{
+ if( aSymbol.is< InstanceOfData >() )
+ {
+ return( hasSymbolData( aSymbol.to_ptr< InstanceOfData >() ) );
+ }
+
+ TableOfSymbol::const_iterator it = getSymbolData().begin();
+ TableOfSymbol::const_iterator endIt = getSymbolData().end();
+ for( ; it != endIt ; ++it )
+ {
+ if( aSymbol.isEQ( *it ) )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+
+bool EnumTypeSpecifier::hasSymbolDataWithValue(const BF & aValue) const
+{
+ TableOfSymbol::const_iterator it = getSymbolData().begin();
+ TableOfSymbol::const_iterator endIt = getSymbolData().end();
+ for( ; it != endIt ; ++it )
+ {
+ if( aValue.isEQ( (*it).getValue() ) || aValue.isEQ( *it ) )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+}
+
+
+const Symbol & EnumTypeSpecifier::getSymbolDataByValue(const BF & aValue) const
+{
+ TableOfSymbol::const_iterator it = getSymbolData().begin();
+ TableOfSymbol::const_iterator endIt = getSymbolData().end();
+ for( ; it != endIt ; ++it )
+ {
+ if( aValue.isEQ( (*it).getValue() ) || aValue.isEQ( (*it) ) )
+ {
+ return( (*it) );
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+
+avm_size_t EnumTypeSpecifier::getRandomSymbolOffset()
+{
+ return( RANDOM::gen_uint(0, getSymbolData().size() - 1) );
+}
+
+const Symbol & EnumTypeSpecifier::getRandomSymbolData()
+{
+ return( getSymbolData( getRandomSymbolOffset() ) );
+}
+
+const BF & EnumTypeSpecifier::getRandomSymbolValue()
+{
+ return( getRandomSymbolData().getValue() );
+}
+
+
+/**
+ * CONSTRAINT generation
+ * for a given parameter
+ */
+
+BF EnumTypeSpecifier::minConstraint(const BF & aParam) const
+{
+ return( ExpressionConstructorNative::gteExpr(aParam, getInfimum()) );
+}
+
+BF EnumTypeSpecifier::maxConstraint(const BF & aParam) const
+{
+ return( ExpressionConstructorNative::lteExpr(aParam, getSupremum()) );
+}
+
+
+BF EnumTypeSpecifier::genConstraint(const BF & aParam) const
+{
+ if( hasConstraint() )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "TODO << EnumTypeSpecifier::genConstraint( "
+ << aParam << " ) >> with compiled constraint:" << std::endl
+ << getConstraint()
+ << SEND_EXIT;
+ }
+
+ if( mIntegerEnumerationFlag )
+ {
+ return( ExpressionConstructorNative::andExpr(
+ ExpressionConstructorNative::gteExpr(aParam, getInfimum()),
+ ExpressionConstructorNative::lteExpr(aParam, getSupremum())) );
+ }
+ else if( getSymbolData().nonempty() )
+ {
+ TableOfSymbol::const_iterator it = getSymbolData().begin();
+ TableOfSymbol::const_iterator endIt = getSymbolData().end();
+ BF allConstraint = ExpressionConstructorNative::eqExpr(
+ aParam, (*it).getValue());
+ for( ++it ; it != endIt ; ++it )
+ {
+ allConstraint.orExpr( ExpressionConstructorNative::eqExpr(
+ aParam, (*it).getValue()) );
+ }
+
+ return( allConstraint );
+ }
+ else
+ {
+ return( ExpressionConstant::BOOLEAN_TRUE );
+ }
+}
+
+
+/**
+ * Serialization
+ */
+void EnumTypeSpecifier::toStream(OutStream & out) const
+{
+ if( out.preferablyFQN() )
+ {
+ out << TAB << getFullyQualifiedNameID();
+
+ AVM_DEBUG_REF_COUNTER(out);
+
+ return;
+ }
+
+ out << TAB << "type " << getFullyQualifiedNameID() << " enum {" << EOL;
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ if( hasAstElement() )
+ {
+ out << TAB2 << "//compiled = "
+ << getAstFullyQualifiedNameID() << ";" << EOL;
+ }
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+AVM_IF_DEBUG_FLAG( DATA )
+ out << TAB << "property:" << EOL
+
+ << TAB2 << "size = " << size() << ";" << " "/*EOL;
+ << TAB2*/ << "data_size = " << getDataSize() << ";" << " "/*EOL;
+ << TAB2*/ << "bit_size = " << getBitSize() << ";" << EOL
+
+ << TAB << "symbol:" << EOL;
+AVM_ENDIF_DEBUG_FLAG( DATA )
+
+ if( hasConstraint() )
+ {
+ out << TAB2 << "@constraint {" << EOL_INCR2_INDENT;
+ getConstraint().toStream(out);
+ out << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+ out << incr_stream( getSymbolData() ) << TAB << "}" << EOL_FLUSH;
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/type/EnumTypeSpecifier.h b/org.eclipse.efm.symbex/src/fml/type/EnumTypeSpecifier.h
new file mode 100644
index 0000000..9513669
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/type/EnumTypeSpecifier.h
@@ -0,0 +1,215 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 7 août 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef ENUMTYPESPECIFIER_H_
+#define ENUMTYPESPECIFIER_H_
+
+#include <fml/type/BaseSymbolTypeSpecifier.h>
+
+#include <common/BF.h>
+
+
+namespace sep
+{
+
+class DataType;
+
+
+class EnumTypeSpecifier : public BaseSymbolTypeSpecifier ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( EnumTypeSpecifier )
+{
+
+ AVM_DECLARE_UNCLONABLE_CLASS(EnumTypeSpecifier)
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ bool mIntegerEnumerationFlag;
+
+ BF mInfimum;
+ BF mSupremum;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ EnumTypeSpecifier(DataType * aCompiledType)
+ : BaseSymbolTypeSpecifier(CLASS_KIND_T( EnumTypeSpecifier ),
+ TYPE_ENUM_SPECIFIER, aCompiledType, 1, 1, 0),
+ mIntegerEnumerationFlag( false ),
+ mInfimum( ),
+ mSupremum( )
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~EnumTypeSpecifier()
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mInfimum
+ */
+ inline const BF & getInfimum() const
+ {
+ return( mInfimum );
+ }
+
+ inline bool hasInfimum() const
+ {
+ return( mInfimum.valid() );
+ }
+
+ inline void setInfimum(const BF & anInfimum)
+ {
+ mInfimum = anInfimum;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mSupremum
+ */
+ inline const BF & getSupremum()const
+ {
+ return( mSupremum );
+ }
+
+ inline bool hasSupremum() const
+ {
+ return( mSupremum.valid() );
+ }
+
+ inline void setSupremum(const BF & aSupremum)
+ {
+ mSupremum = aSupremum;
+ }
+
+
+ /**
+ * SETTER
+ * mBound
+ */
+ void updateBound();
+
+ void updateBound(avm_integer_t min, avm_integer_t max);
+
+
+ /**
+ * GETTER - SETTER
+ * mSymbolData
+ */
+ bool hasSymbolData(InstanceOfData * aSymbolData) const;
+
+ bool hasSymbolData(const BF & aSymbol) const;
+
+
+ bool hasSymbolDataWithValue(const BF & aValue) const;
+
+ const Symbol & getSymbolDataByValue(const BF & aValue) const;
+
+
+ avm_size_t getRandomSymbolOffset();
+
+ const Symbol & getRandomSymbolData();
+
+ const BF & getRandomSymbolValue();
+
+
+
+ /**
+ * GETTER
+ * newfresh Enum Value
+ */
+ BF newfreshSymbolValue();
+
+
+ /**
+ * SETTER
+ * mBitSize
+ */
+ inline virtual void updateSize()
+ {
+ setBitSize( mSymbolData.size() );
+ }
+
+
+ /**
+ * CONSTRAINT generation
+ * for a given parameter
+ */
+ BF minConstraint(const BF & aParam) const;
+ BF maxConstraint(const BF & aParam) const;
+ BF genConstraint(const BF & aParam) const;
+
+
+ /**
+ * Format a value w.r.t. its type
+ */
+ inline virtual void formatStream(OutStream & out, const BF & bfValue) const
+ {
+ if( bfValue.is< InstanceOfData >() &&
+ (bfValue.to_ptr< InstanceOfData >()->getTypeSpecifier() == this) )
+ {
+AVM_IF_DEBUG_FLAG( DATA )
+
+ out << bfValue.to_ptr< InstanceOfData >()->getFullyQualifiedNameID();
+
+AVM_DEBUG_ELSE
+
+ out << bfValue.to_ptr< InstanceOfData >()->getNameID();
+
+AVM_ENDIF_DEBUG_FLAG( DATA )
+ }
+ else
+ {
+ const Symbol & aSymbol = getSymbolDataByValue(bfValue);
+
+AVM_IF_DEBUG_FLAG( DATA )
+
+ out << ( aSymbol.valid() ?
+ aSymbol.getFullyQualifiedNameID() : bfValue.str() );
+
+AVM_DEBUG_ELSE
+
+ out << ( aSymbol.valid() ? aSymbol.getNameID() : bfValue.str() );
+
+AVM_ENDIF_DEBUG_FLAG( DATA )
+ }
+ }
+
+
+ /**
+ * Serialization
+ */
+ void toStream(OutStream & out) const;
+
+};
+
+
+}
+
+#endif /* ENUMTYPESPECIFIER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/type/IntervalTypeSpecifier.cpp b/org.eclipse.efm.symbex/src/fml/type/IntervalTypeSpecifier.cpp
new file mode 100644
index 0000000..114dd1e
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/type/IntervalTypeSpecifier.cpp
@@ -0,0 +1,162 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 5 juil. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "IntervalTypeSpecifier.h"
+
+#include <fml/expression/ExpressionConstructorImpl.h>
+
+#include <fml/type/TypeManager.h>
+
+namespace sep
+{
+
+
+/**
+ * CONSTRAINT generation
+ * for a given parameter
+ */
+BF IntervalTypeSpecifier::minConstraint(const BF & aParam) const
+{
+ switch( getIntervalKind() )
+ {
+ case IIntervalKind::CLOSED:
+ case IIntervalKind::ROPEN:
+ {
+ return( ExpressionConstructorNative::gteExpr(aParam, getInfimum()) );
+ }
+
+ case IIntervalKind::OPEN:
+ case IIntervalKind::LOPEN:
+ default:
+ {
+ return( ExpressionConstructorNative::gtExpr(aParam, getInfimum()) );
+ }
+ }
+}
+
+
+BF IntervalTypeSpecifier::maxConstraint(const BF & aParam) const
+{
+ switch( getIntervalKind() )
+ {
+ case IIntervalKind::CLOSED:
+ case IIntervalKind::LOPEN:
+ {
+ return( ExpressionConstructorNative::lteExpr(aParam, getSupremum()) );
+ }
+
+ case IIntervalKind::ROPEN:
+ case IIntervalKind::OPEN:
+ default:
+ {
+ return( ExpressionConstructorNative::ltExpr(aParam, getSupremum()) );
+ }
+ }
+}
+
+
+BF IntervalTypeSpecifier::genConstraint(const BF & aParam) const
+{
+ if( hasConstraint() )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "TODO << IntervalTypeSpecifier::genConstraint( "
+ << aParam << " ) >> with compiled constraint:" << std::endl
+ << getConstraint()
+ << SEND_EXIT;
+ }
+
+ switch( getIntervalKind() )
+ {
+ case IIntervalKind::CLOSED:
+ {
+ return( ExpressionConstructorNative::andExpr(
+ ExpressionConstructorNative::gteExpr(aParam, getInfimum()),
+ ExpressionConstructorNative::lteExpr(aParam, getSupremum())) );
+ }
+
+ case IIntervalKind::LOPEN:
+ {
+ return( ExpressionConstructorNative::andExpr(
+ ExpressionConstructorNative::gtExpr(aParam, getInfimum()),
+ ExpressionConstructorNative::lteExpr(aParam, getSupremum())) );
+ }
+
+ case IIntervalKind::ROPEN:
+ {
+ return( ExpressionConstructorNative::andExpr(
+ ExpressionConstructorNative::gteExpr(aParam, getInfimum()),
+ ExpressionConstructorNative::ltExpr(aParam, getSupremum())) );
+ }
+
+ case IIntervalKind::OPEN:
+ default:
+ {
+ return( ExpressionConstructorNative::andExpr(
+ ExpressionConstructorNative::gtExpr(aParam, getInfimum()),
+ ExpressionConstructorNative::ltExpr(aParam, getSupremum())) );
+ }
+ }
+}
+
+
+/**
+ * Serialization
+ */
+std::string IntervalTypeSpecifier::strT() const
+{
+ if( getFullyQualifiedNameID().empty() || getNameID().empty() )
+ {
+ return( strIso() );
+ }
+ else
+ {
+ return( getNameID() );
+ }
+}
+
+
+void IntervalTypeSpecifier::toStream(OutStream & os) const
+{
+ if( os.preferablyFQN() )
+ {
+ os << TAB << getFullyQualifiedNameID();
+
+ AVM_DEBUG_REF_COUNTER(os);
+
+ return;
+ }
+
+ os << TAB << "type " << getFullyQualifiedNameID() << " interval< "
+ << mSupportTypeSpecifier.strT() << strIso() << " >";
+
+ if( hasConstraint() )
+ {
+ os << " {" << EOL_TAB2 << "@constraint {" << EOL_INCR2_INDENT;
+ getConstraint().toStream(os);
+ os << DECR2_INDENT_TAB2 << "}" << EOL_TAB << "}";
+ }
+ else
+ {
+ os << ";";
+ }
+
+ os << EOL_FLUSH;
+}
+
+
+}
+
+
diff --git a/org.eclipse.efm.symbex/src/fml/type/IntervalTypeSpecifier.h b/org.eclipse.efm.symbex/src/fml/type/IntervalTypeSpecifier.h
new file mode 100644
index 0000000..c080580
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/type/IntervalTypeSpecifier.h
@@ -0,0 +1,183 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 5 juil. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef INTERVALTYPESPECIFIER_H_
+#define INTERVALTYPESPECIFIER_H_
+
+#include <fml/type/BaseTypeSpecifier.h>
+
+#include <common/BF.h>
+
+#include <fml/lib/ITypeSpecifier.h>
+
+#include <fml/type/TypeSpecifier.h>
+
+
+namespace sep
+{
+
+class DataType;
+
+
+class IntervalTypeSpecifier :
+ public BaseTypeSpecifier,
+ public IIntervalKind,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( IntervalTypeSpecifier )
+{
+
+ AVM_DECLARE_UNCLONABLE_CLASS(IntervalTypeSpecifier)
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+
+ // the Type Specifier
+ TypeSpecifier mSupportTypeSpecifier;
+
+ IIntervalKind::KIND mIntervalKind;
+
+ BF mInfimum;
+ BF mSupremum;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ IntervalTypeSpecifier(DataType * aCompiledType,
+ const TypeSpecifier & aTypeSpecifier,
+ IIntervalKind::KIND aNature,
+ const BF & anInfimum, const BF & aSupremum)
+ : BaseTypeSpecifier(CLASS_KIND_T( IntervalTypeSpecifier ),
+ TYPE_INTERVAL_SPECIFIER, aCompiledType, 1,
+ aTypeSpecifier.getDataSize(), aTypeSpecifier.getBitSize()),
+ mSupportTypeSpecifier( aTypeSpecifier ),
+ mIntervalKind( aNature ),
+ mInfimum( anInfimum ),
+ mSupremum( aSupremum )
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~IntervalTypeSpecifier()
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mSupportTypeSpecifier
+ */
+ inline const TypeSpecifier & getSupportTypeSpecifier() const
+ {
+ return( mSupportTypeSpecifier );
+ }
+
+ inline bool hasSupportTypeSpecifier() const
+ {
+ return( mSupportTypeSpecifier.valid() );
+ }
+
+ inline void setSupportTypeSpecifier(const TypeSpecifier & aTypeSpecifier)
+ {
+ mSupportTypeSpecifier = aTypeSpecifier;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mIntervalKind
+ */
+ inline virtual IIntervalKind::KIND getIntervalKind() const
+ {
+ return( mIntervalKind );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mInfimum
+ */
+ inline const BF & getInfimum() const
+ {
+ return( mInfimum );
+ }
+
+ inline bool hasInfimum() const
+ {
+ return( mInfimum.valid() );
+ }
+
+ inline void setInfimum(const BF & anInfimum)
+ {
+ mInfimum = anInfimum;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mSupremum
+ */
+ inline const BF & getSupremum()const
+ {
+ return( mSupremum );
+ }
+
+ inline bool hasSupremum() const
+ {
+ return( mSupremum.valid() );
+ }
+
+ inline void setSupremum(const BF & aSupremum)
+ {
+ mSupremum = aSupremum;
+ }
+
+
+ /**
+ * CONSTRAINT generation
+ * for a given parameter
+ */
+ BF minConstraint(const BF & aParam) const;
+ BF maxConstraint(const BF & aParam) const;
+ BF genConstraint(const BF & aParam) const;
+
+
+ /**
+ * Serialization
+ */
+ inline std::string strIso() const
+ {
+ return( IIntervalKind::to_string(mIntervalKind, mInfimum, mSupremum) );
+ }
+
+ std::string strT() const;
+
+ void toStream(OutStream & os) const;
+
+};
+
+
+}
+
+#endif /* INTERVALTYPESPECIFIER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/type/README.md b/org.eclipse.efm.symbex/src/fml/type/README.md
new file mode 100644
index 0000000..a21603d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/type/README.md
@@ -0,0 +1,17 @@
+# EFM-SYMBEX : Type
+
+## Source code structure
+
+### Interfaces
+* **ITypeSpecifier**
+
+### Classes
+* **Primitive Type**
+* **Enumeration Type**
+* **Structure Type**
+* **Union Type**
+* **Choice Type**
+
+### Factories
+* **TypeSpecifier** as Smart Pointer
+
diff --git a/org.eclipse.efm.symbex/src/fml/type/TableOfTypeSpecifier.cpp b/org.eclipse.efm.symbex/src/fml/type/TableOfTypeSpecifier.cpp
new file mode 100644
index 0000000..2e7b9ec
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/type/TableOfTypeSpecifier.cpp
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 15 juin 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "TableOfTypeSpecifier.h"
+
+#include <fml/executable/InstanceOfData.h>
+
+
+namespace sep
+{
+
+
+const Symbol & TableOfTypeSpecifier::getSymbolData(
+ const std::string & aFullyQualifiedNameID) const
+{
+ ContainerOfType::const_iterator it = ContainerOfType::begin();
+ ContainerOfType::const_iterator endIt = ContainerOfType::end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).hasSymbol() )
+ {
+ const Symbol & foundInstance =
+ (*it).getSymbol( aFullyQualifiedNameID );
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+ }
+ return( Symbol::REF_NULL );
+}
+
+
+const Symbol & TableOfTypeSpecifier::getSymbolDataByQualifiedNameID(
+ const std::string & aQualifiedNameID) const
+{
+ ContainerOfType::const_iterator it = ContainerOfType::begin();
+ ContainerOfType::const_iterator endIt = ContainerOfType::end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).hasSymbol() )
+ {
+ const Symbol & foundInstance =
+ (*it).getSymbolByQualifiedNameID(aQualifiedNameID);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+
+const Symbol & TableOfTypeSpecifier::getSymbolDataByNameID(
+ const std::string & aNameID) const
+{
+ ContainerOfType::const_iterator it = ContainerOfType::begin();
+ ContainerOfType::const_iterator endIt = ContainerOfType::end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).hasSymbol() && (*it).isTypedEnum() )
+ {
+ const Symbol & foundInstance = (*it).getSymbolByNameID(aNameID);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+ }
+
+ return( Symbol::REF_NULL );
+}
+
+
+const Symbol & TableOfTypeSpecifier::getSymbolDataByAstElement(
+ const ObjectElement * astElement) const
+{
+ ContainerOfType::const_iterator it = ContainerOfType::begin();
+ ContainerOfType::const_iterator endIt = ContainerOfType::end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).hasSymbol() )
+ {
+ const Symbol & foundInstance =
+ (*it).getSymbolByAstElement(astElement);
+ if( foundInstance.valid() )
+ {
+ return( foundInstance );
+ }
+ }
+ }
+ return( Symbol::REF_NULL );
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/type/TableOfTypeSpecifier.h b/org.eclipse.efm.symbex/src/fml/type/TableOfTypeSpecifier.h
new file mode 100644
index 0000000..d97c9fa
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/type/TableOfTypeSpecifier.h
@@ -0,0 +1,305 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 15 juin 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef TABLEOF
+#define TABLEOF
+
+#include <common/AvmObject.h>
+
+#include <collection/Vector.h>
+
+#include <fml/type/TypeSpecifier.h>
+
+#include <collection/List.h>
+
+
+namespace sep
+{
+
+class ObjectElement;
+
+
+class TableOfTypeSpecifier :
+ public AvmObject,
+ public Vector< TypeSpecifier >,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( TableOfTypeSpecifier )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( TableOfTypeSpecifier )
+
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef BaseTypeSpecifier * PointerBaseT;
+ typedef const BaseTypeSpecifier * ConstPointerBaseT;
+
+ typedef Vector< TypeSpecifier > ContainerOfType;
+
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TableOfTypeSpecifier()
+ : AvmObject( ),
+ ContainerOfType( )
+ {
+ //!! NOTHING
+ }
+
+ TableOfTypeSpecifier(avm_size_t aSize)
+ : AvmObject( ),
+ ContainerOfType( aSize )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ TableOfTypeSpecifier(const TableOfTypeSpecifier & aTable)
+ : AvmObject( aTable ),
+ ContainerOfType( aTable )
+ {
+ //!! NOTHING
+ }
+
+ TableOfTypeSpecifier(const ContainerOfType & aTable)
+ : AvmObject( ),
+ ContainerOfType( aTable )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~TableOfTypeSpecifier()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER
+ */
+ inline const TypeSpecifier & get(avm_size_t offset) const
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_OFFSET_EXIT( offset, ContainerOfType::size() )
+ << "Unbound TypeSpecifier offset !!!"
+ << SEND_EXIT;
+
+ return( ContainerOfType::at(offset) );
+ }
+
+
+ inline const TypeSpecifier & getByQualifiedNameID(
+ std::string aQualifiedNameID, NamedElement::op_comparer_t op) const
+ {
+ ContainerOfType::const_iterator it = ContainerOfType::begin();
+ ContainerOfType::const_iterator endIt = ContainerOfType::end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).rawType()->compareID(aQualifiedNameID, op) )
+ {
+ return( *it );
+ }
+ }
+ return( TypeSpecifier::REF_NULL );
+ }
+
+
+ inline const TypeSpecifier & getByFQNameID(
+ const std::string & aFullyQualifiedNameID) const
+ {
+ ContainerOfType::const_iterator it = ContainerOfType::begin();
+ ContainerOfType::const_iterator endIt = ContainerOfType::end();
+ for( ; it != endIt ; ++it )
+ {
+ // STRICT:> compare LOCATOR & LOCATION [true:- retry only LOCATION]
+ if( (*it).fqnEquals( aFullyQualifiedNameID , true ) )
+ {
+ return( *it );
+ }
+ }
+ return( TypeSpecifier::REF_NULL );
+ }
+
+
+ inline const TypeSpecifier & getByQualifiedNameID(
+ const std::string & aQualifiedNameID) const
+ {
+ ContainerOfType::const_iterator it = ContainerOfType::begin();
+ ContainerOfType::const_iterator endIt = ContainerOfType::end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).rawType()->fqnEndsWith(aQualifiedNameID) )
+ {
+ return( *it );
+ }
+ }
+ return( TypeSpecifier::REF_NULL );
+ }
+
+
+ inline const TypeSpecifier & getByNameID(const std::string & aNameID) const
+ {
+ ContainerOfType::const_iterator it = ContainerOfType::begin();
+ ContainerOfType::const_iterator endIt = ContainerOfType::end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).getNameID() == aNameID )
+ {
+ return( *it );
+ }
+ }
+ return( TypeSpecifier::REF_NULL );
+ }
+
+
+ inline const TypeSpecifier & getByAstElement(
+ const ObjectElement * astElement) const
+ {
+ ContainerOfType::const_iterator it = ContainerOfType::begin();
+ ContainerOfType::const_iterator endIt = ContainerOfType::end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).isAstElement( astElement ) )
+ {
+ return( *it );
+ }
+ }
+ return( TypeSpecifier::REF_NULL );
+ }
+
+
+ /**
+ * SAVE
+ * APPEND
+ */
+ inline const TypeSpecifier & save(PointerBaseT aType)
+ {
+ ContainerOfType::push_back( TypeSpecifier(aType) );
+
+ return( ContainerOfType::back() );
+ }
+
+ inline void append(const TypeSpecifier & aType)
+ {
+ ContainerOfType::append( aType );
+ }
+
+
+ /**
+ * SETTER
+ */
+ inline void set(avm_offset_t offset, const TypeSpecifier & aType)
+ {
+ ContainerOfType::set(offset, aType);
+ }
+
+ inline void set(avm_offset_t offset, PointerBaseT aType)
+ {
+ ContainerOfType::set(offset, TypeSpecifier(aType));
+ }
+
+
+ /**
+ * contains a particular element
+ */
+ inline bool contains(ConstPointerBaseT aType) const
+ {
+// if( (aType->getOffset() < size())
+// && (aType == get(aType->getOffset())) )
+// {
+// return( true );
+// }
+// else
+ {
+ ContainerOfType::const_iterator it = BaseVector::begin();
+ ContainerOfType::const_iterator endIt = BaseVector::end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it) == aType )
+ {
+ return( true );
+ }
+ }
+
+ return( false );
+ }
+ }
+
+
+ inline bool contains(const TypeSpecifier & aType) const
+ {
+ return( ContainerOfType::contains( aType ) );
+ }
+
+
+ /**
+ * Serialization
+ */
+ virtual void toStream(OutStream & os) const
+ {
+ ContainerOfType::const_iterator it = ContainerOfType::begin();
+ ContainerOfType::const_iterator endIt = ContainerOfType::end();
+ for( ; it != endIt ; ++it )
+ {
+ (*it).toStream(os);
+ }
+ }
+
+ virtual void toFscn(OutStream & os) const
+ {
+ ContainerOfType::const_iterator it = ContainerOfType::begin();
+ ContainerOfType::const_iterator endIt = ContainerOfType::end();
+ for( ; it != endIt ; ++it )
+ {
+ os << TAB << AVM_NO_INDENT;
+ (*it).toFscn(os);
+ os << END_INDENT_EOL;
+ }
+ }
+
+
+
+ /**
+ * GETTER
+ * For Symbol in TypeSpecifier
+ */
+ const Symbol & getSymbolData(
+ const std::string & aFullyQualifiedNameID) const;
+
+ const Symbol & getSymbolDataByQualifiedNameID(
+ const std::string & aQualifiedNameID) const;
+
+ const Symbol & getSymbolDataByNameID(const std::string & aNameID) const;
+
+ const Symbol & getSymbolDataByAstElement(
+ const ObjectElement * objElement) const;
+
+};
+
+
+} /* namespace sep */
+
+#endif /* TABLEOF */
diff --git a/org.eclipse.efm.symbex/src/fml/type/TypeAliasSpecifier.cpp b/org.eclipse.efm.symbex/src/fml/type/TypeAliasSpecifier.cpp
new file mode 100644
index 0000000..3e6ba4f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/type/TypeAliasSpecifier.cpp
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 15 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "TypeAliasSpecifier.h"
+
+
+namespace sep
+{
+
+/**
+ * Serialization
+ */
+void TypeAliasSpecifier::toStream(OutStream & os) const
+{
+ if( os.preferablyFQN() )
+ {
+ os << TAB << getFullyQualifiedNameID();
+
+ AVM_DEBUG_REF_COUNTER(os);
+
+ return;
+ }
+
+ os << TAB << "type " << getNameID() << " " << mTargetSpecifierType.strT();
+
+ if( hasConstraint() )
+ {
+ os << " {" << EOL_TAB2 << "@constraint {" << EOL_INCR2_INDENT;
+ getConstraint().toStream(os);
+ os << DECR2_INDENT_TAB2 << "}" << EOL_TAB << "}";
+ }
+ else
+ {
+ os << ";";
+ }
+
+ os << EOL_FLUSH;
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/type/TypeAliasSpecifier.h b/org.eclipse.efm.symbex/src/fml/type/TypeAliasSpecifier.h
new file mode 100644
index 0000000..d413c32
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/type/TypeAliasSpecifier.h
@@ -0,0 +1,145 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 15 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef TYPEALIASSPECIFIER_H_
+#define TYPEALIASSPECIFIER_H_
+
+#include <fml/type/BaseTypeSpecifier.h>
+
+#include <fml/type/TypeSpecifier.h>
+
+
+namespace sep
+{
+
+class ArrayBF;
+class DataType;
+
+
+class TypeAliasSpecifier : public BaseTypeSpecifier ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( TypeAliasSpecifier )
+{
+
+ AVM_DECLARE_UNCLONABLE_CLASS(TypeAliasSpecifier)
+
+
+protected:
+ /*
+ * ATTRIBUTES
+ */
+ // the Type Specifier
+ TypeSpecifier mTargetSpecifierType;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TypeAliasSpecifier(DataType * aCompiledType,
+ const TypeSpecifier & aTypeSpecifier)
+ : BaseTypeSpecifier(CLASS_KIND_T( TypeAliasSpecifier ),
+ TYPE_ALIAS_SPECIFIER, aCompiledType, aTypeSpecifier),
+ mTargetSpecifierType( aTypeSpecifier )
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~TypeAliasSpecifier()
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mTargetSpecifierType
+ */
+ inline const TypeSpecifier & getTargetTypeSpecifier()
+ {
+ return( mTargetSpecifierType );
+ }
+
+ inline BaseTypeSpecifier * targetTypeSpecifier()
+ {
+ return( mTargetSpecifierType.is< TypeAliasSpecifier >() ?
+ mTargetSpecifierType.alias().targetTypeSpecifier()
+ : mTargetSpecifierType );
+ }
+
+ inline bool hasTargetTypeSpecifier() const
+ {
+ return( mTargetSpecifierType.valid() );
+ }
+
+ inline void setTargetTypeSpecifier(const TypeSpecifier & aTypeSpecifier)
+ {
+ mTargetSpecifierType = aTypeSpecifier;
+ }
+
+
+ /**
+ * CONSTRAINT generation
+ * for a given parameter
+ */
+ inline BF genConstraint(const BF & aParam) const
+ {
+ if( hasConstraint() )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "TODO << TypeAliasSpecifier::genConstraint( "
+ << aParam << " ) >> with compiled constraint:" << std::endl
+ << getConstraint()
+ << SEND_EXIT;
+ }
+
+ return( mTargetSpecifierType.genConstraint(aParam) );
+ }
+
+
+ /**
+ * Format a value w.r.t. its type
+ */
+ inline virtual void formatStream(OutStream & os, const BF & bfValue) const
+ {
+ mTargetSpecifierType.formatStream(os, bfValue);
+ }
+
+ inline virtual void formatStream(
+ OutStream & os, const ArrayBF & arrayValue) const
+ {
+ mTargetSpecifierType.formatStream(os, arrayValue);
+ }
+
+ /**
+ * Serialization
+ */
+ virtual std::string strT() const
+ {
+ return( getNameID() );
+ }
+
+ virtual void toStream(OutStream & os) const;
+
+};
+
+
+} /* namespace sep */
+
+#endif /* TYPEALIASSPECIFIER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/type/TypeManager.cpp b/org.eclipse.efm.symbex/src/fml/type/TypeManager.cpp
new file mode 100644
index 0000000..834b6c8
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/type/TypeManager.cpp
@@ -0,0 +1,751 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 août 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+
+
+#include "TypeManager.h"
+
+#include <fml/expression/ExpressionConstant.h>
+
+
+namespace sep
+{
+
+
+/**
+ * TypeManager
+ * singleton
+ */
+const TypeManager & TypeFactory = *( TypeManager::singleton() );
+
+
+/*
+ ***************************************************************************
+ * PRIMITE TYPE NAME IDENTIFIER
+ ***************************************************************************
+ */
+const std::string & TypeManager::TYPE_ARRAY_ID = "array";
+const std::string & TypeManager::TYPE_VECTOR_ID = "vector";
+const std::string & TypeManager::TYPE_REVERSE_VECTOR_ID = "rvector";
+const std::string & TypeManager::TYPE_LIST_ID = "list";
+const std::string & TypeManager::TYPE_SET_ID = "set";
+const std::string & TypeManager::TYPE_MULTISET_ID = "multiset";
+const std::string & TypeManager::TYPE_BAG_ID = "bag";
+
+const std::string & TypeManager::TYPE_FIFO_ID = "fifo";
+const std::string & TypeManager::TYPE_LIFO_ID = "lifo";
+
+const std::string & TypeManager::TYPE_ENUM_ID = "enum";
+const std::string & TypeManager::TYPE_UNION_ID = "union";
+const std::string & TypeManager::TYPE_CHOICE_ID = "choice";
+const std::string & TypeManager::TYPE_STRUCTURE_ID = "struct";
+const std::string & TypeManager::TYPE_CLASS_ID = "class";
+
+const std::string & TypeManager::TYPE_BOOL_ID = "bool";
+const std::string & TypeManager::TYPE_BOOLEAN_ID = "boolean";
+
+const std::string & TypeManager::TYPE_INT8_ID = "int8";
+const std::string & TypeManager::TYPE_INT16_ID = "int16";
+const std::string & TypeManager::TYPE_INT32_ID = "int32";
+const std::string & TypeManager::TYPE_INT64_ID = "int64";
+const std::string & TypeManager::TYPE_INT128_ID = "int128";
+
+const std::string & TypeManager::TYPE_INT_ID = "int";
+const std::string & TypeManager::TYPE_INTEGER_ID = "integer";
+
+const std::string & TypeManager::TYPE_RAT_ID = "rat";
+const std::string & TypeManager::TYPE_RATIONAL_ID = "rational";
+
+const std::string & TypeManager::TYPE_FLOAT_ID = "float";
+const std::string & TypeManager::TYPE_DOUBLE_ID = "double";
+const std::string & TypeManager::TYPE_REAL_ID = "real";
+
+const std::string & TypeManager::TYPE_UINT8_ID = "uint8";
+const std::string & TypeManager::TYPE_UINT16_ID = "uint16";
+const std::string & TypeManager::TYPE_UINT32_ID = "uint32";
+const std::string & TypeManager::TYPE_UINT64_ID = "uint64";
+const std::string & TypeManager::TYPE_UINT128_ID = "uint128";
+
+const std::string & TypeManager::TYPE_UINT_ID = "uint";
+const std::string & TypeManager::TYPE_UINTEGER_ID = "uinteger";
+
+const std::string & TypeManager::TYPE_POS_INTEGER_ID = "pos_integer";
+
+const std::string & TypeManager::TYPE_URAT_ID = "urat";
+const std::string & TypeManager::TYPE_URATIONAL_ID = "urational";
+
+const std::string & TypeManager::TYPE_UFLOAT_ID = "ufloat";
+const std::string & TypeManager::TYPE_UDOUBLE_ID = "udouble";
+const std::string & TypeManager::TYPE_UREAL_ID = "ureal";
+
+const std::string & TypeManager::TYPE_CONTINUOUS_TIME_ID = "ctime";
+const std::string & TypeManager::TYPE_DISCRETE_TIME_ID = "dtime";
+const std::string & TypeManager::TYPE_TIME_ID = "time";
+const std::string & TypeManager::TYPE_CLOCK_ID = "clock";
+
+const std::string & TypeManager::TYPE_CHAR_ID = "char";
+const std::string & TypeManager::TYPE_CHARACTER_ID = "character";
+const std::string & TypeManager::TYPE_STRING_ID = "string";
+
+const std::string & TypeManager::TYPE_INTERVAL_ID = "interval";
+
+
+const std::string & TypeManager::TYPE_ARRAY_BOOLEAN_ID = "array<boolean>";
+const std::string & TypeManager::TYPE_ARRAY_CHARACTER_ID = "array<character>";
+const std::string & TypeManager::TYPE_ARRAY_INTEGER_ID = "array<integer>";
+const std::string & TypeManager::TYPE_ARRAY_RATIONAL_ID = "array<rational>";
+const std::string & TypeManager::TYPE_ARRAY_FLOAT_ID = "array<float>";
+
+const std::string & TypeManager::TYPE_ARRAY_STRING_ID = "array<string>";
+const std::string & TypeManager::TYPE_ARRAY_IDENTIFIER_ID = "array<identifier>";
+const std::string & TypeManager::TYPE_ARRAY_QUALIFIED_IDENTIFIER_ID =
+ "array<qualified_identifier>";
+const std::string & TypeManager::TYPE_ARRAY_ENUM_ID = "array<enum>";
+
+const std::string & TypeManager::TYPE_ARRAY_ANY_ID = "array<any>";
+
+
+const std::string & TypeManager::TYPE_LAMBDA_ID = "lambda";
+
+const std::string & TypeManager::TYPE_OPERATOR_ID = "operator";
+const std::string & TypeManager::TYPE_AVMCODE_ID = "avmcode";
+const std::string & TypeManager::TYPE_EXPRESSION_ID = "expression";
+
+const std::string & TypeManager::TYPE_PORT_ID = "port";
+const std::string & TypeManager::TYPE_MESSAGE_ID = "message";
+const std::string & TypeManager::TYPE_SIGNAL_ID = "signal";
+const std::string & TypeManager::TYPE_BUFFER_ID = "buffer";
+const std::string & TypeManager::TYPE_CONNECTOR_ID = "connector";
+const std::string & TypeManager::TYPE_MACHINE_ID = "machine";
+const std::string & TypeManager::TYPE_RID_ID = "RuntimeID";
+
+const std::string & TypeManager::TYPE_UNIVERSAL_ID = "universal";
+
+const std::string & TypeManager::TYPE_SIMULINK_BUS_ID = "simulinkBus";
+
+
+/*
+ ***************************************************************************
+ * PRIMITE TYPE SPECIFIER
+ ***************************************************************************
+ */
+TypeSpecifier TypeManager::BOOL;
+TypeSpecifier TypeManager::BOOLEAN;
+
+TypeSpecifier TypeManager::INT8;
+TypeSpecifier TypeManager::UINT8;
+
+TypeSpecifier TypeManager::INT16;
+TypeSpecifier TypeManager::UINT16;
+
+TypeSpecifier TypeManager::INT32;
+TypeSpecifier TypeManager::UINT32;
+
+TypeSpecifier TypeManager::INT64;
+TypeSpecifier TypeManager::UINT64;
+
+TypeSpecifier TypeManager::INT128;
+TypeSpecifier TypeManager::UINT128;
+
+TypeSpecifier TypeManager::INT;
+TypeSpecifier TypeManager::UINT;
+
+TypeSpecifier TypeManager::INTEGER;
+TypeSpecifier TypeManager::UINTEGER;
+TypeSpecifier TypeManager::POS_INTEGER;
+
+TypeSpecifier TypeManager::RAT;
+TypeSpecifier TypeManager::URAT;
+
+TypeSpecifier TypeManager::RATIONAL;
+TypeSpecifier TypeManager::URATIONAL;
+
+
+TypeSpecifier TypeManager::FLOAT;
+TypeSpecifier TypeManager::UFLOAT;
+
+TypeSpecifier TypeManager::DOUBLE;
+TypeSpecifier TypeManager::UDOUBLE;
+
+TypeSpecifier TypeManager::REAL;
+TypeSpecifier TypeManager::UREAL;
+
+
+TypeSpecifier TypeManager::CLOCK;
+TypeSpecifier TypeManager::TIME;
+TypeSpecifier TypeManager::CONTINUOUS_TIME;
+TypeSpecifier TypeManager::DISCRETE_TIME;
+
+TypeSpecifier TypeManager::CHAR;
+TypeSpecifier TypeManager::CHARACTER;
+TypeSpecifier TypeManager::STRING;
+
+TypeSpecifier TypeManager::IDENTIFIER;
+TypeSpecifier TypeManager::QUALIFIED_IDENTIFIER;
+
+TypeSpecifier TypeManager::LAMBDA;
+
+TypeSpecifier TypeManager::OPERATOR;
+TypeSpecifier TypeManager::AVMCODE;
+TypeSpecifier TypeManager::EXPRESSION;
+
+TypeSpecifier TypeManager::CHANNEL;
+TypeSpecifier TypeManager::PORT;
+TypeSpecifier TypeManager::MESSAGE;
+TypeSpecifier TypeManager::SIGNAL;
+TypeSpecifier TypeManager::BUFFER;
+TypeSpecifier TypeManager::CONNECTOR;
+TypeSpecifier TypeManager::MACHINE;
+
+TypeSpecifier TypeManager::ARRAY_BOOLEAN;
+TypeSpecifier TypeManager::ARRAY_CHARACTER;
+TypeSpecifier TypeManager::ARRAY_INTEGER;
+TypeSpecifier TypeManager::ARRAY_RATIONAL;
+TypeSpecifier TypeManager::ARRAY_FLOAT;
+
+TypeSpecifier TypeManager::ARRAY_STRING;
+TypeSpecifier TypeManager::ARRAY_IDENTIFIER;
+TypeSpecifier TypeManager::ARRAY_QUALIFIED_IDENTIFIER;
+TypeSpecifier TypeManager::ARRAY_ENUM;
+
+TypeSpecifier TypeManager::ARRAY_ANY;
+
+TypeSpecifier TypeManager::ARRAY;
+TypeSpecifier TypeManager::VECTOR;
+TypeSpecifier TypeManager::LIST;
+TypeSpecifier TypeManager::SET;
+TypeSpecifier TypeManager::MULTISET;
+TypeSpecifier TypeManager::BAG;
+
+TypeSpecifier TypeManager::ENUM;
+TypeSpecifier TypeManager::CLASS;
+TypeSpecifier TypeManager::STRUCTURE;
+TypeSpecifier TypeManager::UNION;
+TypeSpecifier TypeManager::CHOICE;
+TypeSpecifier TypeManager::INTERVAL;
+
+
+TypeSpecifier TypeManager::UNIVERSAL;
+
+
+
+/**
+ * LOADER
+ */
+void TypeManager::load()
+{
+ // TypeManager:> TypeSpecifier, CompiledType, Type Size, Data Size
+ /*
+ ***************************************************************************
+ * PRIMITE TYPE SPECIFIER
+ ***************************************************************************
+ */
+ TypeManager::registerPrimitiveType(
+ BOOL = newNumericTypeSpecifier(
+ TYPE_BOOL_ID, TYPE_BOOLEAN_SPECIFIER,
+ 1, 1, ExpressionConstant::BOOLEAN_FALSE ) );
+
+ TypeManager::registerPrimitiveType(
+ BOOLEAN = newNumericTypeSpecifier(
+ TYPE_BOOLEAN_ID, TYPE_BOOLEAN_SPECIFIER,
+ 1, 1, ExpressionConstant::BOOLEAN_FALSE ) );
+
+
+ TypeManager::registerPrimitiveType(
+ INT8 = newNumericTypeSpecifier(
+ TYPE_INT8_ID, TYPE_INTEGER_SPECIFIER,
+ 1, 8, ExpressionConstant::INTEGER_ZERO ) );
+
+ TypeManager::registerPrimitiveType(
+ UINT8 = newNumericTypeSpecifier(
+ TYPE_UINT8_ID, TYPE_UINTEGER_SPECIFIER,
+ 1, 8, ExpressionConstant::INTEGER_ZERO ) );
+
+ TypeManager::registerPrimitiveType(
+ INT16 = newNumericTypeSpecifier(
+ TYPE_INT16_ID, TYPE_INTEGER_SPECIFIER,
+ 1, 16, ExpressionConstant::INTEGER_ZERO ) );
+
+ TypeManager::registerPrimitiveType(
+ UINT16 = newNumericTypeSpecifier(
+ TYPE_UINT16_ID, TYPE_UINTEGER_SPECIFIER,
+ 1, 16, ExpressionConstant::INTEGER_ZERO ) );
+
+ TypeManager::registerPrimitiveType(
+ INT32 = newNumericTypeSpecifier(
+ TYPE_INT32_ID, TYPE_INTEGER_SPECIFIER,
+ 1, 32, ExpressionConstant::INTEGER_ZERO ) );
+
+ TypeManager::registerPrimitiveType(
+ UINT32 = newNumericTypeSpecifier(
+ TYPE_UINT32_ID, TYPE_UINTEGER_SPECIFIER,
+ 1, 32, ExpressionConstant::INTEGER_ZERO ) );
+
+ TypeManager::registerPrimitiveType(
+ INT64 = newNumericTypeSpecifier(
+ TYPE_INT64_ID, TYPE_INTEGER_SPECIFIER,
+ 1, 64, ExpressionConstant::INTEGER_ZERO ) );
+
+ TypeManager::registerPrimitiveType(
+ UINT64 = newNumericTypeSpecifier(
+ TYPE_UINT64_ID, TYPE_UINTEGER_SPECIFIER,
+ 1, 64, ExpressionConstant::INTEGER_ZERO ) );
+
+ TypeManager::registerPrimitiveType(
+ INT128 = newNumericTypeSpecifier(
+ TYPE_INT128_ID, TYPE_INTEGER_SPECIFIER,
+ 1, 128, ExpressionConstant::INTEGER_ZERO ) );
+
+ TypeManager::registerPrimitiveType(
+ UINT128 = newNumericTypeSpecifier(
+ TYPE_UINT128_ID, TYPE_UINTEGER_SPECIFIER,
+ 1, 128, ExpressionConstant::INTEGER_ZERO ) );
+
+
+ TypeManager::registerPrimitiveType(
+ INT = newNumericTypeSpecifier(
+ TYPE_INT_ID, TYPE_INTEGER_SPECIFIER,
+ 1, 0, ExpressionConstant::INTEGER_ZERO ) );
+
+ TypeManager::registerPrimitiveType(
+ INTEGER = newNumericTypeSpecifier(
+ TYPE_INTEGER_ID, TYPE_INTEGER_SPECIFIER,
+ 1, 0, ExpressionConstant::INTEGER_ZERO ) );
+
+
+ TypeManager::registerPrimitiveType(
+ UINT = newNumericTypeSpecifier(
+ TYPE_UINT_ID, TYPE_UINTEGER_SPECIFIER,
+ 1, 0, ExpressionConstant::INTEGER_ZERO ) );
+
+ TypeManager::registerPrimitiveType(
+ UINTEGER = newNumericTypeSpecifier(
+ TYPE_UINTEGER_ID, TYPE_UINTEGER_SPECIFIER,
+ 1, 0, ExpressionConstant::INTEGER_ZERO ) );
+
+ TypeManager::registerPrimitiveType(
+ POS_INTEGER = newNumericTypeSpecifier(
+ TYPE_POS_INTEGER_ID, TYPE_POS_INTEGER_SPECIFIER,
+ 1, 0, ExpressionConstant::INTEGER_ONE ) );
+
+
+
+ TypeManager::registerPrimitiveType(
+ RAT = newNumericTypeSpecifier(
+ TYPE_RAT_ID, TYPE_RATIONAL_SPECIFIER,
+ 1, 0, ExpressionConstant::INTEGER_ZERO ) );
+
+ TypeManager::registerPrimitiveType(
+ RATIONAL = newNumericTypeSpecifier(
+ TYPE_RATIONAL_ID, TYPE_RATIONAL_SPECIFIER,
+ 1, 0, ExpressionConstant::INTEGER_ZERO ) );
+
+
+ TypeManager::registerPrimitiveType(
+ URAT = newNumericTypeSpecifier(
+ TYPE_URAT_ID, TYPE_URATIONAL_SPECIFIER,
+ 1, 0, ExpressionConstant::INTEGER_ZERO ) );
+
+ TypeManager::registerPrimitiveType(
+ URATIONAL = newNumericTypeSpecifier(
+ TYPE_URATIONAL_ID, TYPE_URATIONAL_SPECIFIER,
+ 1, 0, ExpressionConstant::INTEGER_ZERO ) );
+
+
+ TypeManager::registerPrimitiveType(
+ FLOAT = newNumericTypeSpecifier(
+ TYPE_FLOAT_ID, TYPE_FLOAT_SPECIFIER,
+ 1, 32, ExpressionConstant::INTEGER_ZERO ) );
+
+ TypeManager::registerPrimitiveType(
+ UFLOAT = newNumericTypeSpecifier(
+ TYPE_UFLOAT_ID, TYPE_UFLOAT_SPECIFIER,
+ 1, 32, ExpressionConstant::INTEGER_ZERO ) );
+
+ TypeManager::registerPrimitiveType(
+ DOUBLE = newNumericTypeSpecifier(
+ TYPE_DOUBLE_ID, TYPE_FLOAT_SPECIFIER,
+ 1, 64, ExpressionConstant::INTEGER_ZERO ) );
+
+ TypeManager::registerPrimitiveType(
+ UDOUBLE = newNumericTypeSpecifier(
+ TYPE_UDOUBLE_ID, TYPE_UFLOAT_SPECIFIER,
+ 1, 64, ExpressionConstant::INTEGER_ZERO ) );
+
+ TypeManager::registerPrimitiveType(
+ REAL = newNumericTypeSpecifier(
+ TYPE_REAL_ID, TYPE_REAL_SPECIFIER,
+ 1, 0, ExpressionConstant::INTEGER_ZERO ) );
+
+ TypeManager::registerPrimitiveType(
+ UREAL = newNumericTypeSpecifier(
+ TYPE_UREAL_ID, TYPE_UREAL_SPECIFIER,
+ 1, 0, ExpressionConstant::INTEGER_ZERO ) );
+
+
+ TypeManager::registerPrimitiveType(
+ CLOCK = newTypeSpecifier(
+ TYPE_CLOCK_ID, TYPE_CLOCK_SPECIFIER,
+ 1, 1, 0, ExpressionConstant::INTEGER_ZERO ) );
+
+ TypeManager::registerPrimitiveType(
+ TIME = newTypeSpecifier(
+ TYPE_TIME_ID, TYPE_TIME_SPECIFIER,
+ 1, 1, 0, ExpressionConstant::INTEGER_ZERO ) );
+
+ TypeManager::registerPrimitiveType(
+ CONTINUOUS_TIME = newTypeSpecifier(
+ TYPE_CONTINUOUS_TIME_ID, TYPE_CONTINUOUS_TIME_SPECIFIER,
+ 1, 1, 0, ExpressionConstant::INTEGER_ZERO ) );
+
+ TypeManager::registerPrimitiveType(
+ DISCRETE_TIME = newTypeSpecifier(
+ TYPE_DISCRETE_TIME_ID, TYPE_DISCRETE_TIME_SPECIFIER,
+ 1, 1, 0, ExpressionConstant::INTEGER_ZERO ) );
+
+
+ TypeManager::registerPrimitiveType(
+ CHAR = newCharacter(TYPE_CHAR_ID, 1) );
+
+ TypeManager::registerPrimitiveType(
+ CHARACTER = newCharacter(TYPE_CHARACTER_ID, 1) );
+
+ TypeManager::registerPrimitiveType(
+ STRING = newString( 0 , AVM_NUMERIC_MAX_SIZE_T ) );
+
+ TypeManager::registerPrimitiveType(
+ IDENTIFIER = newTypeSpecifier(
+ TYPE_STRING_ID, TYPE_IDENTIFIER_SPECIFIER,
+ 1, 1, 0, ExpressionConstant::STRING_EMPTY ) );
+
+ TypeManager::registerPrimitiveType(
+ QUALIFIED_IDENTIFIER = newTypeSpecifier(
+ TYPE_STRING_ID, TYPE_QUALIFIED_IDENTIFIER_SPECIFIER,
+ 1, 1, 0, ExpressionConstant::STRING_EMPTY ) );
+
+ TypeManager::registerPrimitiveType(
+ LAMBDA = newTypeSpecifier(
+ TYPE_LAMBDA_ID, TYPE_LAMBDA_SPECIFIER, 1, 1, 0 ) );
+
+
+ TypeManager::registerPrimitiveType(
+ OPERATOR = newTypeSpecifier(
+ TYPE_OPERATOR_ID, TYPE_OPERATOR_SPECIFIER, 1, 1, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ AVMCODE = newTypeSpecifier(
+ TYPE_AVMCODE_ID, TYPE_AVMCODE_SPECIFIER, 1, 1, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ CHANNEL = newTypeSpecifier(
+ TYPE_PORT_ID, TYPE_CHANNEL_SPECIFIER, 1, 1, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ PORT = newTypeSpecifier(
+ TYPE_PORT_ID, TYPE_PORT_SPECIFIER, 1, 1, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ MESSAGE = newTypeSpecifier(
+ TYPE_MESSAGE_ID, TYPE_MESSAGE_SPECIFIER, 1, 1, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ SIGNAL = newTypeSpecifier(
+ TYPE_SIGNAL_ID, TYPE_SIGNAL_SPECIFIER, 1, 1, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ BUFFER = newTypeSpecifier(
+ TYPE_BUFFER_ID, TYPE_BUFFER_SPECIFIER, 1, 1, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ CONNECTOR = newTypeSpecifier(
+ TYPE_CONNECTOR_ID, TYPE_CONNECTOR_SPECIFIER, 1, 1, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ MACHINE = newTypeSpecifier(
+ TYPE_MACHINE_ID, TYPE_MACHINE_SPECIFIER, 1, 1, 0 ) );
+
+
+ TypeManager::registerPrimitiveType(
+ ARRAY_BOOLEAN = newArray(
+ TYPE_ARRAY_BOOLEAN_ID, BOOLEAN, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ ARRAY_CHARACTER = newArray(
+ TYPE_ARRAY_CHARACTER_ID, CHARACTER, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ ARRAY_INTEGER = newArray(
+ TYPE_ARRAY_INTEGER_ID, INTEGER, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ ARRAY_RATIONAL = newArray(
+ TYPE_ARRAY_RATIONAL_ID, RATIONAL, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ ARRAY_FLOAT = newArray(
+ TYPE_ARRAY_FLOAT_ID, FLOAT, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ ARRAY_STRING = newArray(
+ TYPE_ARRAY_STRING_ID, STRING, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ ARRAY_IDENTIFIER = newArray(
+ TYPE_ARRAY_IDENTIFIER_ID, STRING, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ ARRAY_QUALIFIED_IDENTIFIER = newArray(
+ TYPE_ARRAY_QUALIFIED_IDENTIFIER_ID,
+ QUALIFIED_IDENTIFIER, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ ARRAY_ENUM = newArray(
+ TYPE_ARRAY_ENUM_ID, QUALIFIED_IDENTIFIER, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ ARRAY_ANY = newArray(
+ TYPE_ARRAY_ANY_ID, UNIVERSAL, 0 ) );
+
+
+ TypeManager::registerPrimitiveType(
+ ARRAY = newTypeSpecifier(
+ TYPE_ARRAY_ID, TYPE_ARRAY_SPECIFIER, 1, 1, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ VECTOR = newTypeSpecifier(
+ TYPE_VECTOR_ID, TYPE_VECTOR_SPECIFIER, 1, 1, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ LIST = newTypeSpecifier(
+ TYPE_LIST_ID, TYPE_LIST_SPECIFIER, 1, 1, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ SET = newTypeSpecifier(
+ TYPE_SET_ID, TYPE_SET_SPECIFIER, 1, 1, 0 ) );
+
+ static TypeSpecifier MULTISET;
+ TypeManager::registerPrimitiveType(
+ MULTISET = newTypeSpecifier(
+ TYPE_MULTISET_ID, TYPE_MULTISET_SPECIFIER, 1, 1, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ BAG = newTypeSpecifier(
+ TYPE_BAG_ID, TYPE_MULTISET_SPECIFIER, 1, 1, 0 ) );
+
+
+ TypeManager::registerPrimitiveType(
+ ENUM = newTypeSpecifier(
+ TYPE_ENUM_ID, TYPE_ENUM_SPECIFIER, 1, 1, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ CLASS = newTypeSpecifier(
+ TYPE_CLASS_ID, TYPE_CLASS_SPECIFIER, 1, 1, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ STRUCTURE = newTypeSpecifier(
+ TYPE_STRUCTURE_ID, TYPE_CLASS_SPECIFIER, 1, 1, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ UNION = newTypeSpecifier(
+ TYPE_UNION_ID, TYPE_UNION_SPECIFIER, 1, 1, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ CHOICE = newTypeSpecifier(
+ TYPE_CHOICE_ID, TYPE_CHOICE_SPECIFIER, 1, 1, 0 ) );
+
+ TypeManager::registerPrimitiveType(
+ INTERVAL = newTypeSpecifier(
+ TYPE_INTERVAL_ID, TYPE_INTERVAL_SPECIFIER, 1, 1, 0 ) );
+
+
+ TypeManager::registerPrimitiveType(
+ UNIVERSAL = newTypeSpecifier(
+ TYPE_UNIVERSAL_ID, TYPE_UNIVERSAL_SPECIFIER, 1, 1, 0 ) );
+}
+
+
+TypeSpecifier TypeManager::getTypeInteger(int dim)
+{
+ switch( dim )
+ {
+ case 8: return( INT8 );
+ case 16: return( INT16 );
+ case 32: return( INT32 );
+ case 64: return( INT64 );
+ case 128: return( INT128 );
+
+ default:
+ {
+ if( dim > 0 )
+ {
+ TypeSpecifier bfTS( newNumericTypeSpecifier(
+ TYPE_INTEGER_ID, TYPE_INTEGER_SPECIFIER,
+ 1, dim, ExpressionConstant::INTEGER_ZERO) );
+
+ return( bfTS );
+ }
+ return( INTEGER );
+ }
+ }
+}
+
+TypeSpecifier TypeManager::getTypeUInteger(int dim)
+{
+ switch( dim )
+ {
+ case 8: return( UINT8 );
+ case 16: return( UINT16 );
+ case 32: return( UINT32 );
+ case 64: return( UINT64 );
+ case 128: return( UINT128 );
+
+ default:
+ {
+ if( dim > 0 )
+ {
+ TypeSpecifier bfTS( newNumericTypeSpecifier(
+ TYPE_UINTEGER_ID, TYPE_UINTEGER_SPECIFIER,
+ 1, dim, ExpressionConstant::INTEGER_ZERO) );
+
+ return( bfTS );
+ }
+ return( UINTEGER );
+ }
+ }
+}
+
+
+TypeSpecifier TypeManager::getTypePosInteger(int dim)
+{
+ switch( dim )
+ {
+ case 8: return( POS_INTEGER );
+ case 16: return( POS_INTEGER );
+ case 32: return( POS_INTEGER );
+ case 64: return( POS_INTEGER );
+ case 128: return( POS_INTEGER );
+
+ default:
+ {
+ if( dim > 0 )
+ {
+ TypeSpecifier bfTS( newNumericTypeSpecifier(
+ TYPE_POS_INTEGER_ID, TYPE_POS_INTEGER_SPECIFIER,
+ 1, dim, ExpressionConstant::INTEGER_ONE) );
+
+ return( bfTS );
+ }
+ return( POS_INTEGER );
+ }
+ }
+}
+
+
+/**
+ * DISPOSER
+ */
+void TypeManager::dispose()
+{
+ /*
+ ***************************************************************************
+ * PRIMITE TYPE SPECIFIER
+ ***************************************************************************
+ */
+ MapOfTypeSpecifier::iterator itType = getPrimitiveTypeRepository().begin();
+ MapOfTypeSpecifier::iterator endType = getPrimitiveTypeRepository().end();
+ for( ; itType != endType ; ++itType )
+ {
+ itType->second.destroy();
+ }
+
+ getPrimitiveTypeRepository().clear();
+
+
+ BOOLEAN.destroy();
+
+ INT8.destroy();
+ UINT8.destroy();
+
+ INT16.destroy();
+ UINT16.destroy();
+
+ INT32.destroy();
+ UINT32.destroy();
+
+ INT64.destroy();
+ UINT64.destroy();
+
+ INT128.destroy();
+ UINT128.destroy();
+
+ INTEGER.destroy();
+ UINTEGER.destroy();
+ POS_INTEGER.destroy();
+
+ RATIONAL.destroy();
+ URATIONAL.destroy();
+
+
+ FLOAT.destroy();
+ UFLOAT.destroy();
+
+ DOUBLE.destroy();
+ UDOUBLE.destroy();
+
+ REAL.destroy();
+ UREAL.destroy();
+
+ TIME.destroy();
+ CONTINUOUS_TIME.destroy();
+ DISCRETE_TIME.destroy();
+
+ CHARACTER.destroy();
+ STRING.destroy();
+
+ IDENTIFIER.destroy();
+ QUALIFIED_IDENTIFIER.destroy();
+
+ LAMBDA.destroy();
+
+ OPERATOR.destroy();
+ AVMCODE.destroy();
+
+ CHANNEL.destroy();
+ PORT.destroy();
+ MESSAGE.destroy();
+ SIGNAL.destroy();
+ BUFFER.destroy();
+ CONNECTOR.destroy();
+ MACHINE.destroy();
+
+ ARRAY_BOOLEAN.destroy();
+ ARRAY_CHARACTER.destroy();
+ ARRAY_INTEGER.destroy();
+ ARRAY_RATIONAL.destroy();
+ ARRAY_FLOAT.destroy();
+
+ ARRAY_STRING.destroy();
+ ARRAY_IDENTIFIER.destroy();
+ ARRAY_QUALIFIED_IDENTIFIER.destroy();
+ ARRAY_ENUM.destroy();
+
+ ARRAY_ANY.destroy();
+
+ UNIVERSAL.destroy();
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/type/TypeManager.h b/org.eclipse.efm.symbex/src/fml/type/TypeManager.h
new file mode 100644
index 0000000..66ea655
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/type/TypeManager.h
@@ -0,0 +1,483 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 août 2008
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef TYPEMANAGER_H_
+#define TYPEMANAGER_H_
+
+#include <fml/expression/ExpressionConstant.h>
+
+#include <fml/infrastructure/DataType.h>
+
+#include <fml/type/TypeSpecifier.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+#include <fml/type/ChoiceTypeSpecifier.h>
+#include <fml/type/ClassTypeSpecifier.h>
+#include <fml/type/ContainerTypeSpecifier.h>
+#include <fml/type/EnumTypeSpecifier.h>
+#include <fml/type/IntervalTypeSpecifier.h>
+#include <fml/type/TypeAliasSpecifier.h>
+#include <fml/type/UnionTypeSpecifier.h>
+
+#include <map>
+
+
+namespace sep
+{
+
+class TypeManager;
+
+
+/**
+ * TypeManager
+ * singleton
+ */
+extern const TypeManager & TypeFactory;
+
+
+
+class TypeManager
+{
+
+public:
+ /**
+ * SINGLETON
+ */
+ static TypeManager * singleton()
+ {
+ static TypeManager * instance = new TypeManager();
+
+ return( instance );
+ }
+
+private:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TypeManager()
+ {
+ //!! NOPTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ TypeManager(const TypeManager &);
+
+ void operator=(const TypeManager &);
+
+
+public:
+ /**
+ * LOADER - DISPOSER
+ */
+ static void load();
+ static void dispose();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // REGISTRY
+ ////////////////////////////////////////////////////////////////////////////
+
+ typedef std::map< std::string , TypeSpecifier > MapOfTypeSpecifier;
+
+ inline static MapOfTypeSpecifier & getPrimitiveTypeRepository()
+ {
+ static MapOfTypeSpecifier mPrimitiveTypeSpecifierRepository;
+
+ return( mPrimitiveTypeSpecifierRepository );
+ }
+
+
+ inline static void registerPrimitiveType(const TypeSpecifier & aTS)
+ {
+ getPrimitiveTypeRepository()[ aTS.getNameID() ] = aTS;
+ }
+
+ inline static void registerPrimitiveType(
+ const std::string & keyTypeID, const TypeSpecifier & aTS)
+ {
+ getPrimitiveTypeRepository()[ keyTypeID ] = aTS;
+ }
+
+
+ inline static const TypeSpecifier & getPrimitiveType(
+ const std::string & keyTypeID)
+ {
+ return( getPrimitiveTypeRepository()[ keyTypeID ] );
+ }
+
+
+
+ /**
+ * GETTER
+ */
+ static TypeSpecifier getTypeInteger(int dim);
+ static TypeSpecifier getTypeUInteger(int dim);
+ static TypeSpecifier getTypePosInteger(int dim);
+
+
+ /**
+ * CREATOR
+ */
+ inline static ContainerTypeSpecifier * newArray(const std::string & aTypeID,
+ const TypeSpecifier & aTypeSpecifier, avm_size_t aSize)
+ {
+ return( new ContainerTypeSpecifier(TYPE_ARRAY_SPECIFIER,
+ aTypeID, aTypeSpecifier, aSize) );
+ }
+
+ inline static ContainerTypeSpecifier * newArray(const BF & aCompiledType,
+ const TypeSpecifier & aTypeSpecifier, avm_size_t aSize)
+ {
+ return( new ContainerTypeSpecifier(TYPE_ARRAY_SPECIFIER,
+ aCompiledType.to_ptr< DataType >(), aTypeSpecifier, aSize) );
+ }
+
+
+ inline static ClassTypeSpecifier * newClass(DataType * aCompiledType)
+ {
+ return( new ClassTypeSpecifier(aCompiledType) );
+ }
+
+ inline static ChoiceTypeSpecifier * newChoice(DataType * aCompiledType)
+ {
+ return( new ChoiceTypeSpecifier(aCompiledType) );
+ }
+
+ inline static UnionTypeSpecifier * newUnion(DataType * aCompiledType)
+ {
+ return( new UnionTypeSpecifier(aCompiledType) );
+ }
+
+
+ inline static ContainerTypeSpecifier * newCollection(
+ DataType * aCompiledType,
+ avm_type_specifier_kind_t aTypeSpecifierKind,
+ const TypeSpecifier & aTypeSpecifier, avm_size_t aSize)
+ {
+ return( new ContainerTypeSpecifier(aTypeSpecifierKind,
+ aCompiledType, aTypeSpecifier, aSize) );
+ }
+
+
+ inline static EnumTypeSpecifier * newEnum(DataType * aCompiledType)
+ {
+ return( new EnumTypeSpecifier(aCompiledType) );
+ }
+
+ inline static EnumTypeSpecifier * newEnum(const std::string & aNameID)
+ {
+ EnumTypeSpecifier * enumT = new EnumTypeSpecifier(NULL);
+ enumT->setAllNameID(aNameID, aNameID);
+
+ return( enumT );
+ }
+
+
+ inline static BaseTypeSpecifier * newNumericTypeSpecifier(
+ BaseTypeSpecifier * aTypeSpecifier, avm_size_t aBitSize,
+ const BF & defaultValue)
+ {
+ return( new BaseTypeSpecifier(
+ aTypeSpecifier->getTypeSpecifierKind(),
+ aTypeSpecifier->getAstDataType(),
+ 1, 1, aBitSize, defaultValue) );
+ }
+
+ inline static BaseTypeSpecifier * newNumericTypeSpecifier(
+ const std::string & aTypeID,
+ avm_type_specifier_kind_t aTypeSpecifierKind,
+ avm_size_t aDataSize, avm_size_t aBitSize, const BF & defaultValue)
+ {
+ return( new BaseTypeSpecifier(aTypeSpecifierKind, aTypeID,
+ 1, aDataSize, aBitSize, defaultValue) );
+ }
+
+
+ inline static IntervalTypeSpecifier * newInterval(
+ DataType * aCompiledType,
+ const TypeSpecifier & aTypeSpecifier,
+ IIntervalKind::KIND aNature, const BF & aMin, const BF & aMax)
+ {
+ return( new IntervalTypeSpecifier(aCompiledType,
+ aTypeSpecifier, aNature, aMin, aMax) );
+ }
+
+
+ inline static ContainerTypeSpecifier * newClockTime(
+ avm_type_specifier_kind_t aTypeSpecifierKind,
+ const TypeSpecifier & aTimeDomain, avm_size_t aSize = 1)
+ {
+ return( new ContainerTypeSpecifier(aTypeSpecifierKind,
+ NULL, aTimeDomain, aSize) );
+ }
+
+
+ inline static BaseTypeSpecifier * newCharacter(
+ const std::string & aTypeID, avm_size_t aSize)
+ {
+ return( newTypeSpecifier(aTypeID,
+ TYPE_CHARACTER_SPECIFIER, aSize, 1, 0,
+ ExpressionConstant::CHARACTER_NULL) );
+ }
+
+ inline static BaseTypeSpecifier * newString(
+ avm_size_t minSize, avm_size_t maxSize)
+ {
+ return( newTypeSpecifier(TYPE_STRING_ID, TYPE_STRING_SPECIFIER,
+ minSize, maxSize, 1, 0, ExpressionConstant::STRING_EMPTY) );
+ }
+
+
+ inline static TypeAliasSpecifier * newTypeAlias(
+ DataType * aCompiledType, const TypeSpecifier & aTypeSpecifier)
+ {
+ return( new TypeAliasSpecifier(aCompiledType, aTypeSpecifier) );
+ }
+
+
+ inline static BaseTypeSpecifier * newTypeSpecifier(
+ const std::string & aTypeID,
+ avm_type_specifier_kind_t aTypeSpecifierKind,
+ avm_size_t aSize, avm_size_t aDataSize,
+ avm_size_t aBitSize, const BF & defaultValue = BF::REF_NULL)
+ {
+ return( new BaseTypeSpecifier(aTypeSpecifierKind, aTypeID,
+ aSize, aDataSize, aBitSize, defaultValue) );
+ }
+
+ inline static BaseTypeSpecifier * newTypeSpecifier(
+ const std::string & aTypeID,
+ avm_type_specifier_kind_t aTypeSpecifierKind,
+ avm_size_t minSize, avm_size_t maxSize, avm_size_t aDataSize,
+ avm_size_t aBitSize, const BF & defaultValue = BF::REF_NULL)
+ {
+ return( new BaseTypeSpecifier(aTypeSpecifierKind, aTypeID,
+ minSize, maxSize, aDataSize, aBitSize, defaultValue) );
+ }
+
+
+ /*
+ ***************************************************************************
+ * PRIMITE TYPE NAME IDENTIFIER
+ ***************************************************************************
+ */
+ static const std::string & TYPE_ARRAY_ID;
+
+ static const std::string & TYPE_VECTOR_ID;
+ static const std::string & TYPE_REVERSE_VECTOR_ID;
+ static const std::string & TYPE_LIST_ID;
+ static const std::string & TYPE_SET_ID;
+ static const std::string & TYPE_MULTISET_ID;
+ static const std::string & TYPE_BAG_ID;
+
+ static const std::string & TYPE_FIFO_ID;
+ static const std::string & TYPE_LIFO_ID;
+
+ static const std::string & TYPE_ENUM_ID;
+ static const std::string & TYPE_UNION_ID;
+ static const std::string & TYPE_CHOICE_ID;
+ static const std::string & TYPE_STRUCTURE_ID;
+ static const std::string & TYPE_CLASS_ID;
+
+ static const std::string & TYPE_BOOL_ID;
+ static const std::string & TYPE_BOOLEAN_ID;
+
+ static const std::string & TYPE_INT8_ID;
+ static const std::string & TYPE_INT16_ID;
+ static const std::string & TYPE_INT32_ID;
+ static const std::string & TYPE_INT64_ID;
+ static const std::string & TYPE_INT128_ID;
+
+ static const std::string & TYPE_INT_ID;
+ static const std::string & TYPE_INTEGER_ID;
+
+ static const std::string & TYPE_RAT_ID;
+ static const std::string & TYPE_RATIONAL_ID;
+
+ static const std::string & TYPE_FLOAT_ID;
+ static const std::string & TYPE_DOUBLE_ID;
+ static const std::string & TYPE_REAL_ID;
+
+ static const std::string & TYPE_UINT8_ID;
+ static const std::string & TYPE_UINT16_ID;
+ static const std::string & TYPE_UINT32_ID;
+ static const std::string & TYPE_UINT64_ID;
+ static const std::string & TYPE_UINT128_ID;
+
+ static const std::string & TYPE_UINT_ID;
+ static const std::string & TYPE_UINTEGER_ID;
+ static const std::string & TYPE_POS_INTEGER_ID;
+
+ static const std::string & TYPE_URAT_ID;
+ static const std::string & TYPE_URATIONAL_ID;
+
+ static const std::string & TYPE_UFLOAT_ID;
+ static const std::string & TYPE_UDOUBLE_ID;
+ static const std::string & TYPE_UREAL_ID;
+
+ static const std::string & TYPE_CONTINUOUS_TIME_ID;
+ static const std::string & TYPE_DISCRETE_TIME_ID;
+ static const std::string & TYPE_TIME_ID;
+ static const std::string & TYPE_CLOCK_ID;
+
+ static const std::string & TYPE_CHAR_ID;
+ static const std::string & TYPE_CHARACTER_ID;
+ static const std::string & TYPE_STRING_ID;
+
+ static const std::string & TYPE_INTERVAL_ID;
+
+ static const std::string & TYPE_ARRAY_BOOLEAN_ID;
+ static const std::string & TYPE_ARRAY_CHARACTER_ID;
+ static const std::string & TYPE_ARRAY_INTEGER_ID;
+ static const std::string & TYPE_ARRAY_RATIONAL_ID;
+ static const std::string & TYPE_ARRAY_FLOAT_ID;
+
+ static const std::string & TYPE_ARRAY_STRING_ID;
+ static const std::string & TYPE_ARRAY_IDENTIFIER_ID;
+ static const std::string & TYPE_ARRAY_QUALIFIED_IDENTIFIER_ID;
+ static const std::string & TYPE_ARRAY_ENUM_ID;
+
+ static const std::string & TYPE_ARRAY_ANY_ID;
+
+ static const std::string & TYPE_LAMBDA_ID;
+
+ static const std::string & TYPE_OPERATOR_ID;
+ static const std::string & TYPE_AVMCODE_ID;
+ static const std::string & TYPE_EXPRESSION_ID;
+
+ static const std::string & TYPE_PORT_ID;
+ static const std::string & TYPE_MESSAGE_ID;
+ static const std::string & TYPE_SIGNAL_ID;
+ static const std::string & TYPE_BUFFER_ID;
+ static const std::string & TYPE_CONNECTOR_ID;
+ static const std::string & TYPE_MACHINE_ID;
+ static const std::string & TYPE_RID_ID;
+
+ static const std::string & TYPE_UNIVERSAL_ID;
+
+ static const std::string & TYPE_SIMULINK_BUS_ID;
+
+
+ /*
+ ***************************************************************************
+ * PRIMITE TYPE SPECIFIER
+ ***************************************************************************
+ */
+ static TypeSpecifier BOOL;
+ static TypeSpecifier BOOLEAN;
+
+ static TypeSpecifier INT8;
+ static TypeSpecifier UINT8;
+
+ static TypeSpecifier INT16;
+ static TypeSpecifier UINT16;
+
+ static TypeSpecifier INT32;
+ static TypeSpecifier UINT32;
+
+ static TypeSpecifier INT64;
+ static TypeSpecifier UINT64;
+
+ static TypeSpecifier INT128;
+ static TypeSpecifier UINT128;
+
+ static TypeSpecifier INT;
+ static TypeSpecifier UINT;
+
+ static TypeSpecifier INTEGER;
+ static TypeSpecifier UINTEGER;
+ static TypeSpecifier POS_INTEGER;
+
+ static TypeSpecifier RAT;
+ static TypeSpecifier URAT;
+
+ static TypeSpecifier RATIONAL;
+ static TypeSpecifier URATIONAL;
+
+ static TypeSpecifier FLOAT;
+ static TypeSpecifier UFLOAT;
+
+ static TypeSpecifier DOUBLE;
+ static TypeSpecifier UDOUBLE;
+
+ static TypeSpecifier REAL;
+ static TypeSpecifier UREAL;
+
+
+ static TypeSpecifier CLOCK;
+ static TypeSpecifier TIME;
+ static TypeSpecifier CONTINUOUS_TIME;
+ static TypeSpecifier DISCRETE_TIME;
+
+ static TypeSpecifier CHAR;
+ static TypeSpecifier CHARACTER;
+ static TypeSpecifier STRING;
+
+ static TypeSpecifier IDENTIFIER;
+ static TypeSpecifier QUALIFIED_IDENTIFIER;
+
+ static TypeSpecifier LAMBDA;
+
+ static TypeSpecifier OPERATOR;
+ static TypeSpecifier AVMCODE;
+ static TypeSpecifier EXPRESSION;
+
+ static TypeSpecifier CHANNEL;
+ static TypeSpecifier PORT;
+ static TypeSpecifier MESSAGE;
+ static TypeSpecifier SIGNAL;
+ static TypeSpecifier BUFFER;
+ static TypeSpecifier CONNECTOR;
+ static TypeSpecifier MACHINE;
+
+ static TypeSpecifier ARRAY_BOOLEAN;
+ static TypeSpecifier ARRAY_CHARACTER;
+ static TypeSpecifier ARRAY_INTEGER;
+ static TypeSpecifier ARRAY_RATIONAL;
+ static TypeSpecifier ARRAY_FLOAT;
+
+ static TypeSpecifier ARRAY_STRING;
+ static TypeSpecifier ARRAY_IDENTIFIER;
+ static TypeSpecifier ARRAY_QUALIFIED_IDENTIFIER;
+ static TypeSpecifier ARRAY_ENUM;
+
+ static TypeSpecifier ARRAY_ANY;
+
+ static TypeSpecifier ARRAY;
+ static TypeSpecifier VECTOR;
+ static TypeSpecifier LIST;
+ static TypeSpecifier SET;
+ static TypeSpecifier MULTISET;
+ static TypeSpecifier BAG;
+
+ static TypeSpecifier ENUM;
+ static TypeSpecifier CLASS;
+ static TypeSpecifier STRUCTURE;
+ static TypeSpecifier UNION;
+ static TypeSpecifier CHOICE;
+ static TypeSpecifier INTERVAL;
+
+ static TypeSpecifier UNIVERSAL;
+
+};
+
+
+}
+
+#endif /* TYPEMANAGER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/type/TypeSpecifier.cpp b/org.eclipse.efm.symbex/src/fml/type/TypeSpecifier.cpp
new file mode 100644
index 0000000..b874104
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/type/TypeSpecifier.cpp
@@ -0,0 +1,356 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 13 juin 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "TypeSpecifier.h"
+
+#include <common/BF.h>
+
+#include <fml/symbol/Symbol.h>
+
+#include <fml/type/BaseSymbolTypeSpecifier.h>
+#include <fml/type/TypeAliasSpecifier.h>
+#include <fml/type/ClassTypeSpecifier.h>
+#include <fml/type/EnumTypeSpecifier.h>
+#include <fml/type/ContainerTypeSpecifier.h>
+#include <fml/type/IntervalTypeSpecifier.h>
+#include <fml/type/UnionTypeSpecifier.h>
+
+
+namespace sep
+{
+
+
+/**
+ * DEFAULT NULL
+ */
+TypeSpecifier TypeSpecifier::REF_NULL;
+
+
+/**
+ * ASSIGNMENT
+ * BF
+ */
+TypeSpecifier & TypeSpecifier::operator=(const BF & aType)
+{
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( aType.is_weakly< BaseTypeSpecifier >() )
+ << "Invalid Assignment Cast in a Type of " << aType.str()
+ << SEND_EXIT;
+
+ if( mPTR != aType.raw_pointer() )
+ {
+ AVM_ASSIGN_STMNT_DEBUG_TYPE_PTR( aType.raw_pointer() )
+
+ release( static_cast< BaseTypeSpecifier * >( aType.raw_pointer() ) );
+ }
+ return( *this );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// TypeAliasSpecifier
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+TypeAliasSpecifier & TypeSpecifier::alias()
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "Unexpected a <null> pointer as TypeAliasSpecifier reference !!!"
+ << SEND_EXIT;
+
+ return( static_cast< TypeAliasSpecifier & >( *mPTR ) );
+}
+
+const TypeAliasSpecifier & TypeSpecifier::alias() const
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "Unexpected a <null> pointer as TypeAliasSpecifier reference !!!"
+ << SEND_EXIT;
+
+ return( static_cast< const TypeAliasSpecifier & >( *mPTR ) );
+}
+
+
+TypeAliasSpecifier * TypeSpecifier::rawAlias() const
+{
+ return( static_cast< TypeAliasSpecifier * >( mPTR ) );
+}
+
+
+BaseTypeSpecifier * TypeSpecifier::aliasTypeSpecifier() const
+{
+ return( rawAlias()->targetTypeSpecifier() );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// BaseSymbolTypeSpecifier
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+BaseSymbolTypeSpecifier * TypeSpecifier::rawSymbol() const
+{
+ return( static_cast< BaseSymbolTypeSpecifier * >( mPTR ) );
+}
+
+
+/**
+ * GETTER - SETTER
+ * theSymbolData
+ */
+void TypeSpecifier::saveSymbol(InstanceOfData * anInstance)
+{
+ rawSymbol()->saveSymbolData( anInstance );
+}
+
+
+const Symbol & TypeSpecifier::getSymbol(
+ const std::string & aFullyQualifiedNameID) const
+{
+ return( rawSymbol()->getSymbolData( aFullyQualifiedNameID ) );
+}
+
+const Symbol & TypeSpecifier::getSymbolByQualifiedNameID(
+ const std::string & aQualifiedNameID) const
+{
+ return( rawSymbol()->getDataByQualifiedNameID( aQualifiedNameID ) );
+}
+
+const Symbol & TypeSpecifier::getSymbolByNameID(
+ const std::string & aNameID) const
+{
+ return( rawSymbol()->getDataByNameID( aNameID ) );
+}
+
+
+const Symbol & TypeSpecifier::getSymbolByAstElement(
+ const ObjectElement * astElement) const
+{
+ return( rawSymbol()->getDataByAstElement( astElement ) );
+}
+
+
+bool TypeSpecifier::hasSymbol() const
+{
+ return( is< BaseSymbolTypeSpecifier >() &&
+ rawSymbol()->hasSymbolData() );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// ClassTypeSpecifier
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+ClassTypeSpecifier & TypeSpecifier::classT()
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "Unexpected a <null> pointer as ClassTypeSpecifier reference !!!"
+ << SEND_EXIT;
+
+ return( static_cast< ClassTypeSpecifier & >( *mPTR ) );
+}
+
+const ClassTypeSpecifier & TypeSpecifier::classT() const
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "Unexpected a <null> pointer as ClassTypeSpecifier reference !!!"
+ << SEND_EXIT;
+
+ return( static_cast< const ClassTypeSpecifier & >( *mPTR ) );
+}
+
+
+ClassTypeSpecifier * TypeSpecifier::rawClass() const
+{
+ return( static_cast< ClassTypeSpecifier * >( mPTR ) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// EnumTypeSpecifier
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+EnumTypeSpecifier & TypeSpecifier::enumT()
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "Unexpected a <null> pointer as EnumTypeSpecifier reference !!!"
+ << SEND_EXIT;
+
+ return( static_cast< EnumTypeSpecifier & >( *mPTR ) );
+}
+
+const EnumTypeSpecifier & TypeSpecifier::enumT() const
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "Unexpected a <null> pointer as EnumTypeSpecifier reference !!!"
+ << SEND_EXIT;
+
+ return( static_cast< const EnumTypeSpecifier & >( *mPTR ) );
+}
+
+
+EnumTypeSpecifier * TypeSpecifier::rawEnum() const
+{
+ return( static_cast< EnumTypeSpecifier * >( mPTR ) );
+}
+
+
+bool TypeSpecifier::hasSymbolDataWithValue(const BF & aValue) const
+{
+ return( rawEnum()->hasSymbolDataWithValue(aValue) );
+}
+
+const Symbol & TypeSpecifier::getSymbolDataByValue(const BF & aValue) const
+{
+ return( rawEnum()->getSymbolDataByValue(aValue) );
+}
+
+
+avm_size_t TypeSpecifier::getRandomSymbolOffset()
+{
+ return( rawEnum()->getRandomSymbolOffset() );
+}
+
+const Symbol & TypeSpecifier::getRandomSymbolData()
+{
+ return( rawEnum()->getRandomSymbolData() );
+}
+
+const BF & TypeSpecifier::getRandomSymbolValue()
+{
+ return( rawEnum()->getRandomSymbolValue() );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// ContainerTypeSpecifier
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+ContainerTypeSpecifier & TypeSpecifier::container()
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "Unexpected a <null> pointer as ContainerTypeSpecifier reference !!!"
+ << SEND_EXIT;
+
+ return( static_cast< ContainerTypeSpecifier & >( *mPTR ) );
+}
+
+const ContainerTypeSpecifier & TypeSpecifier::container() const
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "Unexpected a <null> pointer as ContainerTypeSpecifier reference !!!"
+ << SEND_EXIT;
+
+ return( static_cast< const ContainerTypeSpecifier & >( *mPTR ) );
+}
+
+
+ContainerTypeSpecifier * TypeSpecifier::rawContainer() const
+{
+ return( static_cast< ContainerTypeSpecifier * >( mPTR ) );
+}
+
+
+/**
+ * theContentsTypeSpecifier
+ */
+const TypeSpecifier & TypeSpecifier::getContentsTypeSpecifier() const
+{
+ return( rawContainer()->getContentsTypeSpecifier() );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// IntervalTypeSpecifier
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+IntervalTypeSpecifier & TypeSpecifier::interval()
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "Unexpected a <null> pointer as IntervalTypeSpecifier reference !!!"
+ << SEND_EXIT;
+
+ return( static_cast< IntervalTypeSpecifier & >( *mPTR ) );
+}
+
+const IntervalTypeSpecifier & TypeSpecifier::interval() const
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "Unexpected a <null> pointer as IntervalTypeSpecifier reference !!!"
+ << SEND_EXIT;
+
+ return( static_cast< const IntervalTypeSpecifier & >( *mPTR ) );
+}
+
+
+IntervalTypeSpecifier * TypeSpecifier::rawInterval() const
+{
+ return( static_cast< IntervalTypeSpecifier * >( mPTR ) );
+}
+
+/**
+ * theIntervalTypeSpecifier
+ */
+const TypeSpecifier & TypeSpecifier::getSupportTypeSpecifier() const
+{
+ return( rawInterval()->getSupportTypeSpecifier() );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// UnionTypeSpecifier
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+UnionTypeSpecifier & TypeSpecifier::unionT()
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "Unexpected a <null> pointer as UnionTypeSpecifier reference !!!"
+ << SEND_EXIT;
+
+ return( static_cast< UnionTypeSpecifier & >( *mPTR ) );
+}
+
+const UnionTypeSpecifier & TypeSpecifier::unionT() const
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mPTR )
+ << "Unexpected a <null> pointer as UnionTypeSpecifier reference !!!"
+ << SEND_EXIT;
+
+ return( static_cast< const UnionTypeSpecifier & >( *mPTR ) );
+}
+
+
+UnionTypeSpecifier * TypeSpecifier::rawUnion() const
+{
+ return( static_cast< UnionTypeSpecifier * >( mPTR ) );
+}
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/type/TypeSpecifier.h b/org.eclipse.efm.symbex/src/fml/type/TypeSpecifier.h
new file mode 100644
index 0000000..098e382
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/type/TypeSpecifier.h
@@ -0,0 +1,568 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 13 juin 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef TYPESPECIFIER_H_
+#define TYPESPECIFIER_H_
+
+#include <fml/common/BasePointer.h>
+
+#include <fml/lib/ITypeSpecifier.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+
+
+
+#define AVM_DEBUG_TYPE_POINTER true
+#undef AVM_DEBUG_TYPE_POINTER
+
+#if defined(AVM_DEBUG_TYPE_POINTER)
+
+ #define AVM_DECLARE_DEBUG_TYPE_PTR const BaseTypeSpecifier * debugPTR;
+
+ #define AVM_INIT_DEBUG_TYPE_PTR( ptr ) , debugPTR( ptr )
+
+ #define AVM_ASSIGN_STMNT_DEBUG_TYPE_PTR( ptr ) debugPTR = ptr;
+
+ #define AVM_ASSIGN_EXPR_DEBUG_TYPE_PTR( ptr ) debugPTR = ptr
+
+#else
+
+ #define AVM_DECLARE_DEBUG_TYPE_PTR
+
+ #define AVM_INIT_DEBUG_TYPE_PTR( ptr )
+
+ #define AVM_ASSIGN_STMNT_DEBUG_TYPE_PTR( ptr )
+
+ #define AVM_ASSIGN_EXPR_DEBUG_TYPE_PTR( ptr ) ptr
+
+#endif
+
+
+
+
+namespace sep
+{
+
+
+class BF;
+
+class TypeAliasSpecifier;
+class ClassTypeSpecifier;
+class EnumTypeSpecifier;
+class ContainerTypeSpecifier;
+class IntervalTypeSpecifier;
+class UnionTypeSpecifier;
+
+class InstanceOfData;
+
+class Symbol;
+class TableOfSymbol;
+
+
+class TypeSpecifier :
+ public BasePointer< BaseTypeSpecifier >,
+ public ITypeSpecifier,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( TypeSpecifier )
+{
+
+private:
+ /**
+ * TYPEDEF
+ */
+ typedef BasePointer< BaseTypeSpecifier > base_this_type;
+
+public:
+ /**
+ * DEFAULT NULL
+ */
+ static TypeSpecifier REF_NULL;
+
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TypeSpecifier()
+ : base_this_type( )
+ {
+ //!!! NOTHING
+ }
+
+ explicit TypeSpecifier(BaseTypeSpecifier * anInstance)
+ : base_this_type( anInstance )
+ {
+ //!!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ TypeSpecifier(const TypeSpecifier & aType)
+ : base_this_type( aType )
+ {
+ //!! NOTHING
+ }
+
+ explicit TypeSpecifier(const BF & aType)
+ : base_this_type( aType )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~TypeSpecifier()
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * GETTER
+ * pointer
+ */
+ inline pointer rawType() const
+ {
+ return( static_cast< pointer >( mPTR ) );
+ }
+
+ operator BaseTypeSpecifier * () const
+ {
+ return( static_cast< pointer >( mPTR ) );
+ }
+
+
+public:
+
+ /**
+ * ASSIGNMENT
+ * BF
+ */
+ TypeSpecifier & operator=(const BF & aType);
+
+ TypeSpecifier & operator=(pointer aPtr)
+ {
+ if( mPTR != aPtr )
+ {
+ AVM_ASSIGN_DEBUG_BF_PTR( aPtr )
+
+ release( aPtr );
+ }
+ return( *this );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // BaseTypeSpecifier
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * GETTER - SETTER
+ * theTypeSpecifier
+ */
+ inline virtual const BaseTypeSpecifier * thisTypeSpecifier() const
+ {
+ return( rawType() );
+ }
+
+ inline BaseTypeSpecifier * getTypeSpecifier() const
+ {
+ return( rawType() );
+ }
+
+
+ inline virtual avm_type_specifier_kind_t getTypeSpecifierKind() const
+ {
+ return( rawType()->getTypeSpecifierKind() );
+ }
+
+ inline void setSpecifierKind(avm_type_specifier_kind_t aSpecifierKind)
+ {
+ rawType()->setSpecifierKind( aSpecifierKind );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * theSize
+ */
+ inline avm_size_t size() const
+ {
+ return( rawType()->size() );
+ }
+
+ inline void setSize(avm_size_t aSize)
+ {
+ rawType()->setSize( aSize );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * theDataSize
+ */
+ inline avm_size_t getDataSize() const
+ {
+ return( rawType()->getDataSize() );
+ }
+
+ inline void setDataSize(avm_size_t aDataSize)
+ {
+ rawType()->setDataSize( aDataSize );
+ }
+
+ /**
+ * GETTER - SETTER
+ * theBitSize
+ */
+ inline avm_size_t getBitSize() const
+ {
+ return( rawType()->getBitSize() );
+ }
+
+ inline void setBitSize(avm_size_t aBitSize)
+ {
+ rawType()->setBitSize( aBitSize );
+ }
+
+
+ /**
+ * SETTER
+ * theDataSize
+ */
+ inline void updateSize()
+ {
+ rawType()->updateSize();
+ }
+
+
+ /**
+ * CONSTRAINT generation
+ * for a given parameter
+ */
+ bool couldGenerateConstraint() const
+ {
+ return( rawType()->couldGenerateConstraint() );
+ }
+
+ BF genConstraint(const BF & aParam) const
+ {
+ return( rawType()->genConstraint( aParam ) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * theDefaultValue
+ */
+ inline const BF & getDefaultValue() const
+ {
+ return( rawType()->getDefaultValue() );
+ }
+
+ inline bool hasDefaultValue() const
+ {
+ return( rawType()->hasDefaultValue() );
+ }
+
+ inline void setDefaultValue(const BF & aDefaultValue)
+ {
+ rawType()->setDefaultValue( aDefaultValue );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * theConstraint
+ */
+ inline const BF & getConstraint() const
+ {
+ return( rawType()->getConstraint() );
+ }
+
+ inline bool hasConstraint() const
+ {
+ return( rawType()->hasConstraint() );
+ }
+
+ inline void saveConstraint(Element * aConstraint)
+ {
+ rawType()->saveConstraint( aConstraint );
+ }
+
+ inline void setConstraint(const BF & aConstraint)
+ {
+ rawType()->setConstraint( aConstraint );
+ }
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // TypeAliasSpecifier
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ TypeAliasSpecifier & alias();
+
+ const TypeAliasSpecifier & alias() const;
+
+ TypeAliasSpecifier * rawAlias() const;
+
+// operator TypeAliasSpecifier * () const;
+
+ BaseTypeSpecifier * aliasTypeSpecifier() const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // BaseSymbolTypeSpecifier
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ BaseSymbolTypeSpecifier * rawSymbol() const;
+
+ /**
+ * GETTER - SETTER
+ * the TableOfSymbol
+ */
+ void saveSymbol(InstanceOfData * anInstance);
+
+ const Symbol & getSymbol(
+ const std::string & aFullyQualifiedNameID) const;
+
+ const Symbol & getSymbolByQualifiedNameID(
+ const std::string & aQualifiedNameID) const;
+
+ const Symbol & getSymbolByNameID(const std::string & aNameID) const;
+
+ const Symbol & getSymbolByAstElement(
+ const ObjectElement * objElement) const;
+
+ bool hasSymbol() const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // ClassTypeSpecifier
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ ClassTypeSpecifier & classT();
+
+ const ClassTypeSpecifier & classT() const;
+
+ ClassTypeSpecifier * rawClass() const;
+
+// operator ClassTypeSpecifier * () const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // EnumTypeSpecifier
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ EnumTypeSpecifier & enumT();
+
+ const EnumTypeSpecifier & enumT() const;
+
+ EnumTypeSpecifier * rawEnum() const;
+
+// operator EnumTypeSpecifier * () const;
+
+
+ bool hasSymbolDataWithValue(const BF & aValue) const;
+
+ const Symbol & getSymbolDataByValue(const BF & aValue) const;
+
+
+ avm_size_t getRandomSymbolOffset();
+
+ const Symbol & getRandomSymbolData();
+
+ const BF & getRandomSymbolValue();
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // ContainerTypeSpecifier
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ ContainerTypeSpecifier & container();
+
+ const ContainerTypeSpecifier & container() const;
+
+ ContainerTypeSpecifier * rawContainer() const;
+
+// operator ContainerTypeSpecifier * () const;
+
+ /**
+ * theContentsTypeSpecifier
+ */
+ const TypeSpecifier & getContentsTypeSpecifier() const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // IntervalTypeSpecifier
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ IntervalTypeSpecifier & interval();
+
+ const IntervalTypeSpecifier & interval() const;
+
+ IntervalTypeSpecifier * rawInterval() const;
+
+// operator IntervalTypeSpecifier * () const;
+
+ /**
+ * theIntervalTypeSpecifier
+ */
+ const TypeSpecifier & getSupportTypeSpecifier() const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // UnionTypeSpecifier
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ UnionTypeSpecifier & unionT();
+
+ const UnionTypeSpecifier & unionT() const;
+
+ UnionTypeSpecifier * rawUnion() const;
+
+ operator UnionTypeSpecifier * () const;
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Serialization
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * Format a value w.r.t. its type
+ */
+ inline void formatStream(OutStream & os, const BF & bfValue) const
+ {
+ if( mPTR != NULL )
+ {
+ rawType()->formatStream( os , bfValue );
+ }
+ else
+ {
+ os << TAB << "Type::formatStream<null>" << EOL_FLUSH;
+ }
+ }
+
+ void formatStream(OutStream & os, const ArrayBF & arrayValue) const
+ {
+ if( mPTR != NULL )
+ {
+ rawType()->formatStream( os , arrayValue );
+ }
+ else
+ {
+ os << TAB << "Type::formatStream<null>" << EOL_FLUSH;
+ }
+ }
+
+
+ inline std::string strT() const
+ {
+ return( ( mPTR != NULL ) ? rawType()->strT() : "Type::strT<null>" );
+ }
+
+ inline void strHeader(OutStream & os) const
+ {
+ if( mPTR != NULL )
+ {
+ rawType()->strHeader(os);
+ }
+ else
+ {
+ os << "null< TypeSpecifier >";
+ }
+ }
+
+
+ virtual void toStream(OutStream & os) const
+ {
+ if( mPTR != NULL )
+ {
+ rawType()->toStream( os );
+ }
+ else
+ {
+ os << TAB << "Type::stream<null>" << EOL_FLUSH;
+ }
+ }
+
+ virtual void toFscn(OutStream & os) const
+ {
+ if( mPTR != NULL )
+ {
+ rawType()->toFscn( os );
+ }
+ else
+ {
+ os << TAB << "Type::fscn<null>" << EOL_FLUSH;
+ }
+ }
+
+ inline virtual std::string toString(
+ const AvmIndent & indent = AVM_TAB_INDENT) const
+ {
+ StringOutStream oss(indent);
+
+ toStream( oss );
+
+ return( oss.str() );
+ }
+
+ inline virtual std::string str() const
+ {
+ return( ( mPTR != NULL ) ? rawType()->str() : "Type::str<null>" );
+ }
+
+ inline virtual std::string strNum(
+ uint8_t precision = AVM_MUMERIC_PRECISION) const
+ {
+ return( ( mPTR != NULL ) ?
+ rawType()->strNum(precision) : "Type::num<null>" );
+ }
+
+};
+
+
+/**
+ * operator<<
+ */
+AVM_OS_STREAM( TypeSpecifier )
+
+
+} /* namespace sep */
+
+#endif /* TYPESPECIFIER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/type/UnionTypeSpecifier.cpp b/org.eclipse.efm.symbex/src/fml/type/UnionTypeSpecifier.cpp
new file mode 100644
index 0000000..9e567a9
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/type/UnionTypeSpecifier.cpp
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 11 janv. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "UnionTypeSpecifier.h"
+
+
+namespace sep
+{
+
+
+/**
+ * Serialization
+ */
+void UnionTypeSpecifier::toStream(OutStream & out) const
+{
+ if( out.preferablyFQN() )
+ {
+ out << TAB << getFullyQualifiedNameID();
+
+ AVM_DEBUG_REF_COUNTER(out);
+
+ return;
+ }
+
+ out << TAB << "type " << getFullyQualifiedNameID() << " union";
+
+ out << " {" << EOL;
+
+AVM_IF_DEBUG_FLAG( COMPILING )
+ if( hasAstElement() )
+ {
+ out << TAB2 << "//compiled = "
+ << getAstFullyQualifiedNameID() << ";" << EOL;
+ }
+AVM_ENDIF_DEBUG_FLAG( COMPILING )
+
+
+ out << TAB << "property:" << EOL
+
+ << TAB2 << "size = " << size() << ";" << EOL
+ << TAB2 << "data_size = " << getDataSize() << ";" << EOL
+ << TAB2 << "bit_size = " << getBitSize() << ";" << EOL
+
+ << TAB << "union:" << EOL_INCR_INDENT;
+
+ getSymbolData().toStream(out);
+
+ if( hasConstraint() )
+ {
+ out << TAB2 << "@constraint {" << EOL_INCR2_INDENT;
+ getConstraint().toStream(out);
+ out << DECR2_INDENT_TAB2 << "}" << EOL;
+ }
+
+ out << DECR_INDENT_TAB << "}" << EOL_FLUSH;
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/type/UnionTypeSpecifier.h b/org.eclipse.efm.symbex/src/fml/type/UnionTypeSpecifier.h
new file mode 100644
index 0000000..4645c51
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/type/UnionTypeSpecifier.h
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 11 janv. 2013
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef UNIONTYPESPECIFIER_H_
+#define UNIONTYPESPECIFIER_H_
+
+#include <fml/type/BaseSymbolTypeSpecifier.h>
+
+
+namespace sep
+{
+
+class DataType;
+
+
+class UnionTypeSpecifier : public BaseSymbolTypeSpecifier ,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( UnionTypeSpecifier )
+{
+
+ AVM_DECLARE_UNCLONABLE_CLASS(UnionTypeSpecifier)
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ UnionTypeSpecifier(DataType * aCompiledType)
+ : BaseSymbolTypeSpecifier(CLASS_KIND_T( UnionTypeSpecifier ),
+ TYPE_UNION_SPECIFIER, aCompiledType, 1, 1, 0)
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~UnionTypeSpecifier()
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * Serialization
+ */
+ void toStream(OutStream & out) const;
+
+};
+
+
+} /* namespace sep */
+#endif /* UNIONTYPESPECIFIER_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/workflow/Query.cpp b/org.eclipse.efm.symbex/src/fml/workflow/Query.cpp
new file mode 100644
index 0000000..4d729e3
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/workflow/Query.cpp
@@ -0,0 +1,835 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "Query.h"
+
+#include <fam/api/ProcessorUnitAutoRegistration.h>
+
+#include <fml/numeric/Float.h>
+#include <fml/numeric/Integer.h>
+
+namespace sep
+{
+
+
+/*
+ ***************************************************************************
+ * FIND WOBJECT BY NameID
+ ***************************************************************************
+ */
+WObject * Query::getWObjectByNameID(const WObject * wfObject,
+ const std::string & aNameID, WObject * theDefaultValue)
+{
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->getNameID() == aNameID )
+ {
+ return( *itWfO );
+ }
+ }
+ }
+
+ return( theDefaultValue );
+}
+
+WObject * Query::getRegexWObjectByNameID(const WObject * wfObject,
+ const std::string & aRegexNameID, WObject * theDefaultValue)
+{
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( REGEX_MATCH((*itWfO)->getNameID(), aRegexNameID) )
+ {
+ return( *itWfO );
+ }
+ }
+ }
+
+ return( theDefaultValue );
+}
+
+
+WObject * Query::getWTypedObjectByFQNameID(
+ const WObject * wfObject, const std::string & fqnID)
+{
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWTypedObject()
+ && ((*itWfO)->fqnEquals( fqnID ) ) )
+ {
+ return( *itWfO );
+ }
+ else if( (*itWfO)->isWSequence() )
+ {
+ WObject * foundWObject =
+ getWTypedObjectByFQNameID(*itWfO, fqnID);
+ if( foundWObject != WObject::_NULL_ )
+ {
+ return( foundWObject );
+ }
+ }
+ }
+ }
+ return( WObject::_NULL_ );
+}
+
+
+/*
+ ***************************************************************************
+ * FIND IN COMPOSITE FORM BY TYPE
+ ***************************************************************************
+ */
+
+WObject * Query::getRegisterWObject(const WObject * wfObject,
+ const IProcessorUnitRegistration & aRegisterTool)
+{
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWTypedObject()
+ && aRegisterTool.isTypeID( *(*itWfO) ) )
+ {
+ return( *itWfO );
+ }
+ }
+ }
+
+ return( WObject::_NULL_ );
+}
+
+
+void Query::getWObjectByTypeNameID(const WObject * wfObject,
+ const std::string & aTypeID, List< WObject * > & aContainer)
+{
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWTypedObject()
+ && (*itWfO)->isWTypedID(aTypeID) )
+ {
+ aContainer.push_back( *itWfO );
+ }
+ }
+ }
+}
+
+
+/**
+ ***************************************************************************
+ * GETTER getWSequence
+ ***************************************************************************
+ */
+WObject * Query::getWSequence(const WObject * wfObject,
+ const std::string & sectionID, WObject * theDefaultValue)
+{
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWSequence()
+ && ((*itWfO)->getNameID() == sectionID) )
+ {
+ return( *itWfO );
+ }
+ }
+ }
+
+ return( theDefaultValue );
+}
+
+WObject * Query::getRegexWSequence(const WObject * wfObject,
+ const std::string & aRegexSectionID, WObject * theDefaultValue)
+{
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWSequence()
+ && REGEX_MATCH((*itWfO)->getNameID(), aRegexSectionID) )
+ {
+ return( *itWfO );
+ }
+ }
+ }
+
+ return( theDefaultValue );
+}
+
+
+// For compatibility when ID has changed !!!
+WObject * Query::getWSequenceOrElse(
+ const WObject * wfObject, const std::string & sectionID,
+ const std::string & elseSequenceID, WObject * theDefaultValue)
+{
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject * elseWSequence = WObject::_NULL_;
+
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWSequence() )
+ {
+ if( ((*itWfO)->getNameID() == sectionID) )
+ {
+ return( (*itWfO) );
+ }
+ else if( (elseWSequence == WObject::_NULL_)
+ && ((*itWfO)->getNameID() == elseSequenceID) )
+ {
+ // Save the first elseSequence !
+ elseWSequence = (*itWfO);
+ }
+ }
+ }
+ return( (elseWSequence != WObject::_NULL_) ?
+ elseWSequence : theDefaultValue );
+ }
+ return( theDefaultValue );
+}
+
+
+/**
+ *******************************************************************************
+ * GETTER for WSequence or WReference
+ *******************************************************************************
+ */
+WObject * Query::getWSequenceOrReference(const WObject * wfObject,
+ const std::string & sectionID, WObject * theDefaultValue)
+{
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWSequenceOrReference()
+ && ((*itWfO)->getNameID() == sectionID) )
+ {
+ return( (*itWfO)->isWSequence() ? (*itWfO)
+ : (*itWfO)->getWReferenceValue() );
+ }
+ }
+ }
+
+ return( theDefaultValue );
+}
+
+WObject * Query::getRegexWSequenceOrReference(const WObject * wfObject,
+ const std::string & aRegexSectionID, WObject * theDefaultValue)
+{
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWSequenceOrReference()
+ && REGEX_MATCH((*itWfO)->getNameID(), aRegexSectionID) )
+ {
+ return( (*itWfO)->isWSequence() ? (*itWfO)
+ : (*itWfO)->getWReferenceValue() );
+ }
+ }
+ }
+
+ return( theDefaultValue );
+}
+
+
+/**
+ *******************************************************************************
+ * GETTER for FORM in a Container
+ *******************************************************************************
+ */
+void Query::getListWObject(
+ const WObject * wfObject, List< WObject * > & aContainer)
+{
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWTypedObject() )
+ {
+ aContainer.push_back( *itWfO );
+ }
+ }
+ }
+}
+
+
+void Query::getRegexWObjectInSequence(const WObject * wfObject,
+ const std::string & aRegexSectionID, List< WObject * > & aContainer)
+{
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWSequence()
+ && REGEX_MATCH((*itWfO)->getNameID(), aRegexSectionID) )
+ {
+ getListWObject( *itWfO , aContainer );
+ }
+ }
+ }
+
+}
+
+
+/**
+ ***************************************************************************
+ * GETTER for FORM ATTRIBUTE of a given NAME
+ ***************************************************************************
+ */
+
+WObject * Query::getWProperty(const WObject * wfObject,
+ const std::string & anID, WObject * theDefaultValue)
+{
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty()
+ && ((*itWfO)->getNameID() == anID) )
+ {
+ return( *itWfO );
+ }
+ }
+ }
+ return( theDefaultValue );
+}
+
+WObject * Query::getRegexWProperty(const WObject * wfObject,
+ const std::string & aRegexID, WObject * theDefaultValue)
+{
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty()
+ && REGEX_MATCH((*itWfO)->getNameID(), aRegexID) )
+ {
+ return( *itWfO );
+ }
+ }
+ }
+ return( theDefaultValue );
+}
+
+WObject * Query::getWPropertyOrElse(
+ const WObject * wfObject, const std::string & anID,
+ const std::string & elseID, WObject * theDefaultValue)
+{
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject * elseWObject = WObject::_NULL_;
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty() )
+ {
+ if( ((*itWfO)->getNameID() == anID) )
+ {
+ return( *itWfO );
+ }
+ else if( (elseWObject == WObject::_NULL_)
+ && ((*itWfO)->getNameID() == elseID) )
+ {
+ // Save the first elseWObject !
+ elseWObject = (*itWfO);
+ }
+ }
+ }
+
+ return( (elseWObject != WObject::_NULL_) ?
+ elseWObject : theDefaultValue );
+ }
+ return( theDefaultValue );
+}
+
+
+/**
+ ***************************************************************************
+ * GETTER for FORM ATTRIBUTE of a given NAME && a given KIND
+ ***************************************************************************
+ */
+
+WObject * Query::getWProperty(const WObject * wfObject,
+ WObject::ENUM_WOBJECT_KIND aKind,
+ const std::string & anID, WObject * theDefaultValue)
+{
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty() )
+ {
+ if( (*itWfO)->isKind( aKind )
+ && ((*itWfO)->getNameID() == anID) )
+ {
+ return( *itWfO );
+ }
+ }
+ }
+ }
+
+ return( theDefaultValue );
+}
+
+WObject * Query::getWProperty(const WObject * wfObject,
+ WObject::ENUM_WOBJECT_KIND aKind, const std::string & anID,
+ const std::string & elseID, WObject * theDefaultValue)
+{
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty() )
+ {
+ if( (*itWfO)->isKind( aKind )
+ && ((*itWfO)->getNameID() == anID)
+ && ((*itWfO)->getNameID() == elseID) )
+ {
+ return( *itWfO );
+ }
+ }
+ }
+ }
+
+ return( theDefaultValue );
+}
+
+
+WObject * Query::getWPropertyOrElse(const WObject * wfObject,
+ WObject::ENUM_WOBJECT_KIND aKind, const std::string & anID,
+ const std::string & elseID, WObject * theDefaultValue)
+{
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject * elseAttribute = WObject::_NULL_;
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty() )
+ {
+ if( (*itWfO)->isKind( aKind ) )
+ {
+ if( (*itWfO)->getNameID() == anID )
+ {
+ return( *itWfO );
+ }
+ else if( (elseAttribute == WObject::_NULL_)
+ && ((*itWfO)->getNameID() == elseID) )
+ {
+ elseAttribute = (*itWfO);
+ }
+ }
+ }
+ }
+
+ return( (elseAttribute != WObject::_NULL_) ?
+ elseAttribute : theDefaultValue );
+ }
+
+ return( theDefaultValue );
+}
+
+
+WObject * Query::getRegexWProperty(
+ const WObject * wfObject, WObject::ENUM_WOBJECT_KIND aKind,
+ const std::string & aRegex, WObject * theDefaultValue)
+{
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty() )
+ {
+ if( (*itWfO)->isKind( aKind )
+ && REGEX_MATCH((*itWfO)->getNameID(), aRegex) )
+ {
+ return( *itWfO );
+ }
+ }
+ }
+ }
+
+ return( theDefaultValue );
+}
+
+
+void Query::getWProperty(
+ const WObject * wfObject, WObject::ENUM_WOBJECT_KIND aKind,
+ const std::string & anID, Collection< BF > & aContainer)
+{
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty() )
+ {
+ if( (*itWfO)->isKind( aKind )
+ && ((*itWfO)->getNameID() == anID) )
+ {
+ aContainer.push_back( (*itWfO)->getValue() );
+ }
+ }
+ }
+ }
+}
+
+
+void Query::getRegexWProperty(
+ const WObject * wfObject, WObject::ENUM_WOBJECT_KIND aKind,
+ const std::string & aRegex, Collection< BF > & aContainer)
+{
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty() )
+ {
+ if( (*itWfO)->isKind( aKind )
+ && REGEX_MATCH((*itWfO)->getNameID(), aRegex) )
+ {
+ aContainer.push_back( (*itWfO)->getValue() );
+ }
+ }
+ }
+ }
+}
+
+
+/**
+ ***************************************************************************
+ * GETTER getAttributeValue
+ ***************************************************************************
+ */
+const BF & Query::getWPropertyValue(const WObject * wfObject,
+ const std::string & anID, const BF & theDefaultValue)
+{
+ WObject * theAttribute = Query::getWProperty(wfObject, anID);
+ if( theAttribute != WObject::_NULL_ )
+ {
+ return( theAttribute->getValue() );
+ }
+ else
+ {
+ return( theDefaultValue );
+ }
+}
+
+const BF & Query::getRegexWPropertyValue(const WObject * wfObject,
+ const std::string & aRegexID, const BF & theDefaultValue)
+{
+ WObject * theAttribute = Query::getRegexWProperty(wfObject, aRegexID);
+ if( theAttribute != WObject::_NULL_ )
+ {
+ return( theAttribute->getValue() );
+ }
+ else
+ {
+ return( theDefaultValue );
+ }
+}
+
+const BF & Query::getWPropertyValueOrElse(const WObject * wfObject,
+ const std::string & anID, const std::string & elseID,
+ const BF & theDefaultValue)
+{
+ WObject * theAttribute = Query::getWPropertyOrElse(wfObject, anID, elseID);
+ if( theAttribute != WObject::_NULL_ )
+ {
+ return( theAttribute->getValue() );
+ }
+ else
+ {
+ return( theDefaultValue );
+ }
+}
+
+
+/**
+ *******************************************************************************
+ * GETTER getWPropertyForm
+ *******************************************************************************
+ */
+WObject * Query::getWPropertyWReference(const WObject * wfObject,
+ const std::string & anID, WObject * theDefaultValue)
+{
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWPropertyWReference() )
+ {
+ return( (*itWfO)->getWReferenceValue() );
+ }
+/*
+ * !UNUSED!
+ * !DELETE!
+ if( (*itWfO)->isWProperty() )
+ {
+ if( (*itWfO)->isValueWObject()
+ && ((*itWfO)->getNameID() == anID) )
+ {
+ return( (*itWfO)->getValueWObject() );
+ }
+ }
+* !UNUSED!
+*/
+ }
+ }
+
+ return( theDefaultValue );
+}
+
+WObject * Query::getWPropertyWReferenceOrElse(const WObject * wfObject,
+ const std::string & anID, const std::string & elseID,
+ WObject * theDefaultValue)
+{
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject * elseAttribute = WObject::_NULL_;
+
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWPropertyWReference() )
+ {
+ if( (*itWfO)->getNameID() == anID )
+ {
+ return( (*itWfO)->getWReferenceValue() );
+ }
+ else if( (elseAttribute != WObject::_NULL_)
+ && ((*itWfO)->getNameID() == elseID) )
+ {
+ elseAttribute = (*itWfO)->getWReferenceValue();
+ }
+ }
+/*
+ * !UNUSED!
+ * !DELETE!
+ if( (*itWfO)->isWProperty() )
+ {
+ if( (*itWfO)->isValueWObject()
+ && ((*itWfO)->getNameID() == anID) )
+ {
+ return( (*itWfO)->getValueWObject() );
+ }
+ else if( (elseAttribute != WObject::_NULL_)
+ && (*itWfO)->isValueWObject()
+ && ((*itWfO)->getNameID() == elseID) )
+ {
+ elseAttribute = (*itWfO)->getValueWObject();
+ }
+ }
+* !UNUSED!
+*/
+ }
+
+ return( ( elseAttribute != WObject::_NULL_ ) ?
+ elseAttribute : theDefaultValue );
+ }
+ return( theDefaultValue );
+}
+
+/**
+ ***************************************************************************
+ * GETTER getAttributeInteger
+ ***************************************************************************
+ */
+avm_size_t Query::getWPropertyPosSizeT(
+ const WObject * wfObject, const std::string & anID,
+ avm_size_t theDefaultValue, avm_size_t theNegativeValue)
+{
+ WObject * theAttribute = Query::getWProperty(wfObject,
+ WObject::WOBJECT_PROPERTY_INTEGER_KIND, anID);
+ if( theAttribute != WObject::_NULL_ )
+ {
+ avm_integer_t value = theAttribute->getIntegerValue();
+
+ return( (value > 0) ? value : theNegativeValue );
+ }
+ else
+ {
+ return( (theDefaultValue > 0) ? theDefaultValue : theNegativeValue );
+ }
+}
+
+avm_size_t Query::getRegexWPropertyPosSizeT(
+ const WObject * wfObject, const std::string & aRegexID,
+ avm_size_t theDefaultValue, avm_size_t theNegativeValue)
+{
+ WObject * theAttribute =
+ Query::getRegexWProperty(wfObject,
+ WObject::WOBJECT_PROPERTY_INTEGER_KIND, aRegexID);
+ if( theAttribute != WObject::_NULL_ )
+ {
+ avm_integer_t value = theAttribute->getIntegerValue();
+
+ return( (value > 0) ? value : theNegativeValue );
+ }
+ else
+ {
+ return( (theDefaultValue > 0) ? theDefaultValue : theNegativeValue );
+ }
+}
+
+
+avm_size_t Query::getWPropertySizeT(
+ const WObject * wfObject, const std::string & anID,
+ avm_size_t theDefaultValue, avm_size_t theNegativeValue)
+{
+ WObject * theAttribute = Query::getWProperty(wfObject,
+ WObject::WOBJECT_PROPERTY_INTEGER_KIND, anID);
+ if( theAttribute != WObject::_NULL_ )
+ {
+ avm_integer_t value = theAttribute->getIntegerValue();
+
+ return( (value >= 0) ? value : theNegativeValue );
+ }
+ else
+ {
+ return( (theDefaultValue >= 0) ? theDefaultValue : theNegativeValue );
+ }
+}
+
+avm_size_t Query::getRegexWPropertySizeT(
+ const WObject * wfObject, const std::string & aRegexID,
+ avm_size_t theDefaultValue, avm_size_t theNegativeValue)
+{
+ WObject * theAttribute = Query::getRegexWProperty(wfObject,
+ WObject::WOBJECT_PROPERTY_INTEGER_KIND, aRegexID);
+ if( theAttribute != WObject::_NULL_ )
+ {
+ avm_integer_t value = theAttribute->getIntegerValue();
+
+ return( (value >= 0) ? value : theNegativeValue );
+ }
+ else
+ {
+ return( (theDefaultValue >= 0) ? theDefaultValue : theNegativeValue );
+ }
+}
+
+
+avm_integer_t Query::getWPropertyInteger(const WObject * wfObject,
+ const std::string & anID, avm_integer_t theDefaultValue)
+{
+ WObject * theAttribute = Query::getWProperty(wfObject,
+ WObject::WOBJECT_PROPERTY_INTEGER_KIND, anID);
+ if( theAttribute != WObject::_NULL_ )
+ {
+ return( theAttribute->getIntegerValue() );
+ }
+ else
+ {
+ return( theDefaultValue );
+ }
+}
+
+
+int Query::getWPropertyInt(const WObject * wfObject,
+ const std::string & anID, int theDefaultValue)
+{
+ WObject * theAttribute = Query::getWProperty(wfObject,
+ WObject::WOBJECT_PROPERTY_INTEGER_KIND, anID);
+ if( theAttribute != WObject::_NULL_ )
+ {
+ return( theAttribute->getInt32Value() );
+ }
+ else
+ {
+ return( theDefaultValue );
+ }
+}
+
+int Query::getRegexWPropertyInt(const WObject * wfObject,
+ const std::string & aRegexID, int theDefaultValue)
+{
+ WObject * theAttribute = Query::getRegexWProperty(wfObject,
+ WObject::WOBJECT_PROPERTY_INTEGER_KIND, aRegexID);
+ if( theAttribute != WObject::_NULL_ )
+ {
+ return( theAttribute->getInt32Value() );
+ }
+ else
+ {
+ return( theDefaultValue );
+ }
+}
+
+
+long Query::getWPropertyLong(const WObject * wfObject,
+ const std::string & anID, long theDefaultValue)
+{
+ WObject * theAttribute = Query::getWProperty(wfObject,
+ WObject::WOBJECT_PROPERTY_INTEGER_KIND, anID);
+ if( theAttribute != WObject::_NULL_ )
+ {
+ return( theAttribute->getInt64Value() );
+ }
+ else
+ {
+ return( theDefaultValue );
+ }
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/workflow/Query.h b/org.eclipse.efm.symbex/src/fml/workflow/Query.h
new file mode 100644
index 0000000..60c0011
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/workflow/Query.h
@@ -0,0 +1,605 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef FACTORY_H_
+#define FACTORY_H_
+
+
+#include <collection/Collection.h>
+#include <collection/List.h>
+
+#include <common/BF.h>
+
+#include <fml/expression/AvmCode.h>
+
+#include <fml/builtin/Boolean.h>
+#include <fml/builtin/Character.h>
+#include <fml/builtin/Identifier.h>
+#include <fml/builtin/String.h>
+
+#include <fml/operator/Operator.h>
+
+#include <fml/workflow/WObject.h>
+
+#include <functional>
+
+namespace sep
+{
+
+
+#define WID_SEPARATOR "[^a-zA-Z\\s]?"
+
+#define CONS_WID2(w1, w2) w1 WID_SEPARATOR w2
+
+#define CONS_WID3(w1, w2, w3) w1 WID_SEPARATOR w2 WID_SEPARATOR w3
+
+#define CONS_WID4(w1, w2, w3, w4) \
+ w1 WID_SEPARATOR w2 WID_SEPARATOR w3 WID_SEPARATOR w4
+
+
+#define PREFIX_WID(w1, w2) "(" w1 WID_SEPARATOR ")?(" w2 ")"
+
+#define SUFFIX_WID(w1, w2) "(" w1 ")(" WID_SEPARATOR w2 ")?"
+
+
+#define OP_OR "|"
+
+#define OR_WID2(w1, w2) w1 OP_OR w2
+
+#define OR_WID3(w1, w2, w3) w1 OP_OR w2 OP_OR w3
+
+#define OR_WID4(w1, w2, w3, w4) w1 OP_OR w2 OP_OR w3 OP_OR w4
+
+
+
+
+class IProcessorUnitRegistration;
+
+
+class Query
+{
+
+public:
+
+ ////////////////////////////////////////////////////////////////////////////
+ // ERROR / WARNING REPORTING
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static void reportErrorAttribute(const WObject * wfObject,
+ const std::string & anID, const std::string & msg)
+ {
+ WObject * wfProperty = Query::getWProperty(wfObject, anID);
+
+ if( wfProperty != WObject::_NULL_ )
+ {
+ wfProperty->errorLocation(AVM_OS_WARN) << msg << std::endl;
+ }
+ else
+ {
+ wfObject->errorLocation(AVM_OS_WARN)
+ << "Unfound <" << anID << "> property : " << msg
+ << " w.r.t. wfobject< " << wfObject->strUniqId() << " > !"
+ << std::endl;
+ }
+ }
+
+
+ /*
+ ***************************************************************************
+ * FIND WOBJECT BY NameID
+ ***************************************************************************
+ */
+ static WObject * getWObjectByNameID(
+ const WObject * wfObject, const std::string & aNameID,
+ WObject * theDefaultValue = WObject::_NULL_);
+
+ static WObject * getRegexWObjectByNameID(
+ const WObject * wfObject, const std::string & aRegexNameID,
+ WObject * theDefaultValue = WObject::_NULL_);
+
+
+ static WObject * getWTypedObjectByFQNameID(
+ const WObject * wfObject, const std::string & fqnID);
+
+
+ /*
+ ***************************************************************************
+ * FIND IN COMPOSITE FORM BY TYPE
+ ***************************************************************************
+ */
+
+ static WObject * getRegisterWObject(const WObject * wfObject,
+ const IProcessorUnitRegistration & aRegisterTool);
+
+ static void getWObjectByTypeNameID(const WObject * wfObject,
+ const std::string & aTypeID, List< WObject * > & aContainer);
+
+
+ /**
+ ***************************************************************************
+ * GETTER for WSequence
+ ***************************************************************************
+ */
+ static WObject * getWSequence(
+ const WObject * wfObject, const std::string & sectionID,
+ WObject * theDefaultValue = WObject::_NULL_);
+
+ static WObject * getRegexWSequence(
+ const WObject * wfObject, const std::string & aRegexSectionID,
+ WObject * theDefaultValue = WObject::_NULL_);
+
+
+ inline static bool hasWSequence(
+ const WObject * wfObject, const std::string & sectionID)
+ {
+ return( (wfObject != WObject::_NULL_)
+ && (getWSequence(wfObject, sectionID) != WObject::_NULL_) );
+ }
+
+
+ // For compatibility when ID has changed !!!
+ static WObject * getWSequenceOrElse(const WObject * wfObject,
+ const std::string & sectionID, const std::string & elseWSequenceID,
+ WObject * theDefaultValue = WObject::_NULL_);
+
+
+ /**
+ ***************************************************************************
+ * GETTER for WSequence or WReference
+ ***************************************************************************
+ */
+ static WObject * getWSequenceOrReference(
+ const WObject * wfObject, const std::string & sectionID,
+ WObject * theDefaultValue = WObject::_NULL_);
+
+ static WObject * getRegexWSequenceOrReference(
+ const WObject * wfObject, const std::string & aRegexSectionID,
+ WObject * theDefaultValue = WObject::_NULL_);
+
+
+ /**
+ ***************************************************************************
+ * GETTER for FORM in a Container
+ ***************************************************************************
+ */
+ static void getListWObject(
+ const WObject * wfObject, List< WObject * > & aContainer);
+
+ static void getRegexWObjectInSequence(
+ const WObject * wfObject, const std::string & aRegexSectionID,
+ List< WObject * > & aContainer);
+
+
+ /**
+ ***************************************************************************
+ * GETTER for FORM ATTRIBUTE of a given NAME
+ ***************************************************************************
+ */
+
+ static WObject * getWProperty(
+ const WObject * wfObject, const std::string & anID,
+ WObject * theDefaultValue = WObject::_NULL_);
+
+ static WObject * getRegexWProperty(
+ const WObject * wfObject, const std::string & anID,
+ WObject * theDefaultValue = WObject::_NULL_);
+
+ static WObject * getWPropertyOrElse(const WObject * wfObject,
+ const std::string & anID, const std::string & elseID,
+ WObject * theDefaultValue = WObject::_NULL_);
+
+
+ inline static bool hasWProperty(
+ const WObject * wfObject, const std::string & anID)
+ {
+ return( (wfObject != WObject::_NULL_)
+ && (getWProperty(wfObject, anID) != WObject::_NULL_) );
+ }
+
+ inline static bool hasRegexWProperty(
+ const WObject * wfObject, const std::string & anID)
+ {
+ return( (wfObject != WObject::_NULL_)
+ && (getRegexWProperty(wfObject, anID) != WObject::_NULL_) );
+ }
+
+
+ /**
+ ***************************************************************************
+ * GETTER for FORM ATTRIBUTE of a given NAME && a given KIND
+ ***************************************************************************
+ */
+
+ static WObject * getWProperty(const WObject * wfObject,
+ WObject::ENUM_WOBJECT_KIND aKind, const std::string & anID,
+ WObject * theDefaultValue = WObject::_NULL_);
+
+ static WObject * getWProperty(
+ const WObject * wfObject, WObject::ENUM_WOBJECT_KIND aKind,
+ const std::string & anID, const std::string & elseID,
+ WObject * theDefaultValue = WObject::_NULL_);
+
+ static WObject * getWPropertyOrElse(
+ const WObject * wfObject, WObject::ENUM_WOBJECT_KIND aKind,
+ const std::string & anID, const std::string & elseID,
+ WObject * theDefaultValue = WObject::_NULL_);
+
+ static WObject * getRegexWProperty(const WObject * wfObject,
+ WObject::ENUM_WOBJECT_KIND aKind, const std::string & aRegex,
+ WObject * theDefaultValue = WObject::_NULL_);
+
+
+ template< class T , class U >
+ static U getBuiltinWProperty(const WObject * wfObject,
+ const std::string & anID, const U theDefaultValue)
+ {
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty() )
+ {
+ if( (*itWfO)->getValue().is< T >()
+ && ((*itWfO)->getNameID() == anID) )
+ {
+ return( (*itWfO)->getValue().to_ptr< T >()->getValue() );
+ }
+ }
+ }
+ }
+
+ return( theDefaultValue );
+ }
+
+
+ template< class T , class U >
+ static U getBuiltinWPropertyOrElse(const WObject * wfObject,
+ const std::string & anID, const std::string & elseID,
+ const U theDefaultValue)
+ {
+ if( wfObject != WObject::_NULL_ )
+ {
+ T * elseAttribute = NULL;
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty() )
+ {
+ if( (*itWfO)->getValue().is< T >()
+ && ((*itWfO)->getNameID() == anID) )
+ {
+ return( (*itWfO)->getValue().to_ptr< T >()->getValue() );
+ }
+ else if( (elseAttribute == NULL)
+ && (*itWfO)->getValue().is< T >()
+ && ((*itWfO)->getNameID() == elseID) )
+ {
+ elseAttribute = (*itWfO)->getValue().to_ptr< T >();
+ }
+ }
+ }
+
+ return( (elseAttribute != NULL) ?
+ elseAttribute->getValue() : theDefaultValue );
+ }
+
+ return( theDefaultValue );
+ }
+
+
+ template< class T , class U >
+ static U getRegexBuiltinWProperty(const WObject * wfObject,
+ const std::string & aRegex, const U theDefaultValue)
+ {
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty() )
+ {
+ if( (*itWfO)->getValue().is< T >()
+ && REGEX_MATCH((*itWfO)->getNameID(), aRegex) )
+ {
+ return( (*itWfO)->getValue().to_ptr< T >()->getValue() );
+ }
+ }
+ }
+ }
+
+ return( theDefaultValue );
+ }
+
+ static void getWProperty(
+ const WObject * wfObject, WObject::ENUM_WOBJECT_KIND aKind,
+ const std::string & anID, Collection< BF > & aContainer);
+
+ static void getRegexWProperty(
+ const WObject * wfObject, WObject::ENUM_WOBJECT_KIND aKind,
+ const std::string & aRegex, Collection< BF > & aContainer);
+
+
+ template< class T , class U >
+ static void getBuiltinWProperty(
+ const WObject * wfObject, const std::string & anID,
+ Collection< U > & aContainer)
+ {
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty() )
+ {
+ if( (*itWfO)->getValue().is< T >()
+ && ((*itWfO)->getNameID() == anID) )
+ {
+ aContainer.push_back(
+ (*itWfO)->getValue().to_ptr< T >()->getValue() );
+ }
+ }
+ }
+ }
+ }
+
+
+ template< class T , class U >
+ static void getBuiltinWProperty(const WObject * wfObject,
+ const std::string & anID, const std::string & elseID,
+ Collection< U > & aContainer)
+ {
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty() )
+ {
+ if( (*itWfO)->getValue().is< T >()
+ && (((*itWfO)->getNameID() == anID)
+ || ((*itWfO)->getNameID() == elseID)) )
+ {
+ aContainer.push_back(
+ (*itWfO)->getValue().to_ptr< T >()->getValue() );
+ }
+ }
+ }
+ }
+ }
+
+
+ template< class T , class U >
+ static void getRegexBuiltinWProperty(const WObject * wfObject,
+ const std::string & aRegex, Collection< U > & aContainer)
+ {
+ if( wfObject != WObject::_NULL_ )
+ {
+ WObject::const_iterator itWfO = wfObject->owned_begin();
+ WObject::const_iterator endWfO = wfObject->owned_end();
+ for( ; itWfO != endWfO ; ++itWfO )
+ {
+ if( (*itWfO)->isWProperty() )
+ {
+ if( (*itWfO)->getValue().is< T >()
+ && REGEX_MATCH((*itWfO)->getNameID(), aRegex) )
+ {
+ aContainer.push_back(
+ (*itWfO)->getValue().to_ptr< T >()->getValue() );
+ }
+ }
+ }
+ }
+ }
+
+
+ static bool hasWPropertyValue(const WObject * wfObject,
+ WObject::ENUM_WOBJECT_KIND aKind, const std::string & anID)
+ {
+ return( (wfObject != WObject::_NULL_) &&
+ (getWProperty(wfObject, aKind, anID, WObject::_NULL_)
+ != WObject::_NULL_) );
+ }
+
+ static bool hasWPropertyValue(
+ const WObject * wfObject, WObject::ENUM_WOBJECT_KIND aKind,
+ const std::string & anID, const std::string & elseID)
+ {
+ return( (wfObject != WObject::_NULL_) &&
+ (getWProperty(wfObject, aKind, anID, elseID, WObject::_NULL_)
+ != WObject::_NULL_) );
+ }
+
+ static bool hasRegexWPropertyValue(const WObject * wfObject,
+ WObject::ENUM_WOBJECT_KIND aKind, const std::string & aRegex)
+ {
+ return( (wfObject != WObject::_NULL_) &&
+ (getRegexWProperty(wfObject, aKind, aRegex, WObject::_NULL_)
+ != WObject::_NULL_) );
+ }
+
+
+ /**
+ ***************************************************************************
+ * GETTER getWPropertyValue
+ ***************************************************************************
+ */
+ static const BF & getWPropertyValue(
+ const WObject * wfObject, const std::string & anID,
+ const BF & theDefaultValue = BF::REF_NULL);
+
+ static const BF & getRegexWPropertyValue(
+ const WObject * wfObject, const std::string & aRegexID,
+ const BF & theDefaultValue = BF::REF_NULL);
+
+ static const BF & getWPropertyValueOrElse(const WObject * wfObject,
+ const std::string & anID, const std::string & elseID,
+ const BF & theDefaultValue = BF::REF_NULL);
+
+
+ inline static const BF & getWPropertyValue(const WObject * wfObject,
+ WObject::ENUM_WOBJECT_KIND aKind, const std::string & anID,
+ const BF & theDefaultValue = BF::REF_NULL)
+ {
+ WObject * theAttribute = getWProperty(wfObject, aKind, anID);
+
+ return( ( theAttribute != WObject::_NULL_ ) ?
+ theAttribute->getValue() : theDefaultValue );
+ }
+
+
+ /**
+ ***************************************************************************
+ * GETTER getWPropertyForm
+ ***************************************************************************
+ */
+ static WObject * getWPropertyWReference(
+ const WObject * wfObject, const std::string & anID,
+ WObject * theDefaultValue = WObject::_NULL_);
+
+ static WObject * getWPropertyWReferenceOrElse(const WObject * wfObject,
+ const std::string & anID, const std::string & elseID,
+ WObject * theDefaultValue = WObject::_NULL_);
+
+
+ /**
+ ***************************************************************************
+ * GETTER getWPropertyBoolean
+ ***************************************************************************
+ */
+ static bool getWPropertyBoolean(const WObject * wfObject,
+ const std::string & anID, bool theDefaultValue)
+ {
+ return( getBuiltinWProperty< Boolean , bool >(
+ wfObject, anID, theDefaultValue) );
+ }
+
+ static bool getRegexWPropertyBoolean(const WObject * wfObject,
+ const std::string & aRegex, bool theDefaultValue)
+ {
+ return( getRegexBuiltinWProperty< Boolean , bool >(
+ wfObject, aRegex, theDefaultValue) );
+ }
+
+
+ /**
+ ***************************************************************************
+ * GETTER getWPropertyInteger
+ ***************************************************************************
+ */
+ static avm_size_t getWPropertyPosSizeT(const WObject * wfObject,
+ const std::string & anID, avm_size_t theDefaultValue,
+ avm_size_t theNegativeValue = AVM_NUMERIC_MAX_SIZE_T);
+
+ static avm_size_t getRegexWPropertyPosSizeT(const WObject * wfObject,
+ const std::string & anID, avm_size_t theDefaultValue,
+ avm_size_t theNegativeValue = AVM_NUMERIC_MAX_SIZE_T);
+
+
+ static avm_size_t getWPropertySizeT(const WObject * wfObject,
+ const std::string & anID, avm_size_t theDefaultValue,
+ avm_size_t theNegativeValue = AVM_NUMERIC_MAX_SIZE_T);
+
+ static avm_size_t getRegexWPropertySizeT(const WObject * wfObject,
+ const std::string & anID, avm_size_t theDefaultValue,
+ avm_size_t theNegativeValue = AVM_NUMERIC_MAX_SIZE_T);
+
+
+ static avm_integer_t getWPropertyInteger(const WObject * wfObject,
+ const std::string & anID, avm_integer_t theDefaultValue);
+
+
+ static int getWPropertyInt(const WObject * wfObject,
+ const std::string & anID, int theDefaultValue);
+
+ static int getRegexWPropertyInt(const WObject * wfObject,
+ const std::string & anID, int theDefaultValue);
+
+
+ static long getWPropertyLong(const WObject * wfObject,
+ const std::string & anID, long theDefaultValue);
+
+
+ /**
+ ***************************************************************************
+ * GETTER getWPropertyString
+ ***************************************************************************
+ */
+ static bool hasWPropertyString(
+ const WObject * wfObject, const std::string & anID)
+ {
+ return( hasWPropertyValue(wfObject,
+ WObject::WOBJECT_PROPERTY_STRING_KIND, anID) );
+ }
+
+ static bool hasWPropertyString(const WObject * wfObject,
+ const std::string & anID, const std::string & elseID)
+ {
+ return( hasWPropertyValue(wfObject,
+ WObject::WOBJECT_PROPERTY_STRING_KIND, anID, elseID) );
+ }
+
+ static bool hasRegexWPropertyString(
+ const WObject * wfObject, const std::string & aRegex)
+ {
+ return( hasRegexWPropertyValue(wfObject,
+ WObject::WOBJECT_PROPERTY_STRING_KIND, aRegex) );
+ }
+
+ static std::string getWPropertyString(const WObject * wfObject,
+ const std::string & anID, std::string theDefaultValue)
+ {
+ return( getBuiltinWProperty< String , std::string >(
+ wfObject, anID, theDefaultValue) );
+ }
+
+ static std::string getWPropertyStringOrElse(const WObject * wfObject,
+ const std::string & anID, const std::string & elseID,
+ std::string theDefaultValue)
+ {
+ return( getBuiltinWPropertyOrElse< String , std::string >(
+ wfObject, anID, elseID, theDefaultValue) );
+ }
+
+ static std::string getRegexWPropertyString(const WObject * wfObject,
+ const std::string & aRegex, std::string theDefaultValue)
+ {
+ return( getRegexBuiltinWProperty< String , std::string >(
+ wfObject, aRegex, theDefaultValue) );
+ }
+
+
+ static void getWPropertyString(const WObject * wfObject,
+ const std::string & anID, Collection< std::string > & aContainer)
+ {
+ getBuiltinWProperty< String , std::string >(wfObject, anID, aContainer);
+ }
+
+ static void getWPropertyString(const WObject * wfObject,
+ const std::string & anID, const std::string & elseID,
+ Collection< std::string > & aContainer)
+ {
+ getBuiltinWProperty< String , std::string >(
+ wfObject, anID, elseID, aContainer);
+ }
+
+};
+
+
+}
+
+#endif /*FACTORY_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/workflow/UniFormIdentifier.cpp b/org.eclipse.efm.symbex/src/fml/workflow/UniFormIdentifier.cpp
new file mode 100644
index 0000000..d1094ca
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/workflow/UniFormIdentifier.cpp
@@ -0,0 +1,636 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "UniFormIdentifier.h"
+
+#include <common/NamedElement.h>
+
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/builtin/Identifier.h>
+
+#include <fml/executable/BaseInstanceForm.h>
+#include <fml/executable/ExecutableForm.h>
+
+#include <fml/runtime/RuntimeID.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+
+
+namespace sep
+{
+
+
+BF UniFormIdentifier::ANONYM_LOCATION( new Identifier("") );
+
+
+std::string UniFormIdentifier::SEPARATOR_ID = ".";
+
+std::string UniFormIdentifier::SEPARATOR_LOCATION = ":";
+
+std::string UniFormIdentifier::SEPARATOR_LOCATOR = FQN_ID_ROOT_SEPARATOR;
+
+
+/**
+ * BUILD FROM QUALIFIED NAME ID
+ */
+void UniFormIdentifier::build(const std::string & aQualifiedNameID)
+{
+ ListOfString strList;
+
+ std::string::size_type sepPos =
+ aQualifiedNameID.find(FQN_ID_ROOT_SEPARATOR);
+ if( sepPos != std::string::npos )
+ {
+ setLocator(aQualifiedNameID.substr(0, sepPos));
+ NamedElement::collectNameID(strList, aQualifiedNameID, sepPos + 2);
+ }
+ else
+ {
+ NamedElement::collectNameID(strList, aQualifiedNameID);
+ }
+
+ ListOfString::iterator endIt = strList.end();
+ for( ListOfString::iterator it = strList.begin() ; it != endIt ; ++it )
+ {
+ appendField( *it );
+ }
+}
+
+
+
+/**
+* LOADER
+*/
+void UniFormIdentifier::load()
+{
+ ANONYM_LOCATION = ExpressionConstructor::newIdentifier("");
+}
+
+
+/**
+* DISPOSER
+*/
+void UniFormIdentifier::dispose()
+{
+ ANONYM_LOCATION.destroy();
+}
+
+
+/**
+ * GETTER - SETTER
+ */
+void UniFormIdentifier::appendField(
+ const std::string & aQualifiedNameID, avm_ufi_scheme_t scheme)
+{
+ ListOfField::append( UfiField(
+ ExpressionConstructor::newIdentifier(aQualifiedNameID), scheme) );
+ mScheme |= scheme;
+
+ updateAllNameID();
+}
+
+void UniFormIdentifier::appendField(const BF & field)
+{
+ avm_ufi_scheme_t scheme = UFI_SCHEME_UNDEFINED;
+ switch( field.classKind() )
+ {
+ case FORM_XFSP_VARIABLE_KIND:
+ {
+ scheme = UFI_SCHEME_VARIABLE;
+ break;
+ }
+
+ case FORM_XFSP_MACHINE_KIND:
+ case FORM_XFSP_SYSTEM_KIND:
+ {
+ scheme = UFI_SCHEME_MACHINE;
+ break;
+ }
+
+// case FORM_XFSP_INSTANCE_KIND:
+// {
+// scheme = UFI_SCHEME_INSTANCE;
+// break;
+// }
+
+ case FORM_XFSP_PORT_KIND:
+ {
+ scheme = UFI_SCHEME_PORT;
+ break;
+ }
+ case FORM_XFSP_BUFFER_KIND:
+ {
+ scheme = UFI_SCHEME_BUFFER;
+ break;
+ }
+// case FORM_XFSP_CONNECTOR_KIND:
+// {
+// scheme = UFI_SCHEME_CONNECTOR;
+// break;
+// }
+ default:
+ {
+ scheme = UFI_SCHEME_FIELD;
+ break;
+ }
+ }
+
+ appendField( field , scheme );
+}
+
+
+void UniFormIdentifier::setLocator(const std::string & aLocationId)
+{
+ mLocator = ExpressionConstructor::newIdentifier(aLocationId);
+}
+
+
+/**
+ * COMPARISON
+ * OPERATOR
+ */
+int UniFormIdentifier::compare(const UniFormIdentifier & other) const
+{
+ if( this == &other )
+ {
+ return( 0 );
+ }
+ else
+ {
+ int cmpResult = 0;
+
+ UniFormIdentifier::const_iterator it = begin();
+ UniFormIdentifier::const_iterator endIt = end();
+
+ UniFormIdentifier::const_iterator itOther = other.begin();
+ UniFormIdentifier::const_iterator endOther = other.end();
+
+ for( ; (it != endIt) && (itOther != endOther) ; ++it , ++itOther )
+ {
+ cmpResult = (*it).compare( *itOther );
+ if( cmpResult != 0 )
+ {
+ return( cmpResult );
+ }
+ }
+
+ return( (it == endIt)
+ ? ( (itOther == endOther) ? 0 : 1)
+ : ( (it == endIt) ? 1 : 0 ) );
+ }
+}
+
+bool UniFormIdentifier::isEQ(const UniFormIdentifier & other) const
+{
+ UniFormIdentifier::const_iterator it = begin();
+ UniFormIdentifier::const_iterator endIt = end();
+
+ UniFormIdentifier::const_iterator itOther = other.begin();
+ UniFormIdentifier::const_iterator endOther = other.end();
+
+ for( ; (it != endIt) && (itOther != endOther) ; ++it , ++itOther )
+ {
+ if( not (*it).isEQ( *itOther ) )
+ {
+ return( false );
+ }
+ }
+
+ return( (it == endIt) && (itOther == endOther) );
+}
+
+
+
+/**
+ * Serialization
+ */
+void UniFormIdentifier::toStream(OutStream & out) const
+{
+ out << TAB << AVM_NO_INDENT;
+
+ if( hasLocator() )
+ {
+ getLocator().toStream(out);
+ out << SEPARATOR_LOCATOR;
+ }
+
+ toStreamLocation(out);
+
+ AVM_DEBUG_REF_COUNTER(out);
+
+ out << END_INDENT << EOL << std::flush;
+}
+
+std::string UniFormIdentifier::str() const
+{
+ StringOutStream oss( AVM_NO_INDENT );
+
+ if( hasLocator() )
+ {
+ oss << getLocator().str();
+
+ oss << SEPARATOR_LOCATOR;
+ }
+
+
+ ListOfField::const_iterator it = ListOfField::begin();
+ ListOfField::const_iterator itEnd = ListOfField::end();
+ if( (it != itEnd) && (*it).valid() )
+ {
+ if( (*it).is< BaseInstanceForm >() )
+ {
+AVM_IF_DEBUG_FLAG( QUALIFIED_NAME_ID )
+ oss << (*it).to_ptr< BaseInstanceForm >()->getFullyQualifiedNameID();
+AVM_ELSE
+ oss << (*it).to_ptr< BaseInstanceForm >()->getNameID();
+AVM_ENDIF_DEBUG_FLAG( QUALIFIED_NAME_ID )
+ }
+
+ else if( (*it).is< RuntimeID >())
+ {
+AVM_IF_DEBUG_FLAG( QUALIFIED_NAME_ID )
+ oss << (*it).bfRID().getFullyQualifiedNameID();
+AVM_ELSE
+ oss << (*it).bfRID().strUniqId();
+AVM_ENDIF_DEBUG_FLAG( QUALIFIED_NAME_ID )
+ }
+
+ else if( (*it).is< ObjectElement >() )
+ {
+ oss << "&"
+ << (*it).to_ptr< ObjectElement >()->getFullyQualifiedNameID();
+ }
+
+ else if( (*it).isIdentifier() )
+ {
+ oss << (*it).str();
+ }
+
+ else if( (*it).is< AvmCode >() )
+ {
+ oss << "${ ufi";
+ for( ; it != itEnd ; ++it )
+ {
+ oss << " ";
+ oss << (*it).str();
+ }
+ oss << " }";
+
+ return( oss.str() );
+ }
+
+ else if( (*it).is< UniFormIdentifier >() )
+ {
+ oss << "${ ufi "
+ << (*it).to_ptr< UniFormIdentifier >()->str() << " }";
+ }
+ else
+ {
+ (*it).toStream( oss );
+ }
+
+
+ for( ++it ; it != itEnd ; ++it )
+ {
+ if( (*it).scheme == UFI_SCHEME_INDEX )
+ {
+ oss << "[";
+
+ if( (*it).is< ObjectElement >() )
+ {
+ oss << "&" << (*it).to_ptr<
+ ObjectElement >()->getFullyQualifiedNameID();
+ }
+ else if( (*it).is< BaseInstanceForm >() )
+ {
+ oss << "&" << (*it).to_ptr<
+ BaseInstanceForm >()->getFullyQualifiedNameID();
+ }
+ else
+ {
+ oss << (*it).str();
+ }
+
+ oss << "]";
+ }
+ else if( (*it).scheme == UFI_SCHEME_PARAMETER )
+ {
+ oss << "(";
+
+ if( (*it).is< ObjectElement >() )
+ {
+ oss << "&" << (*it).to_ptr<
+ ObjectElement >()->getFullyQualifiedNameID();
+ }
+ else if( (*it).is< BaseInstanceForm >() )
+ {
+ oss << "&" << (*it).to_ptr<
+ BaseInstanceForm >()->getFullyQualifiedNameID();
+ }
+ else
+ {
+ oss << (*it).str();
+ }
+
+ oss << ")";
+ }
+
+ else if( (*it).isIdentifier() )
+ {
+ oss << SEPARATOR_ID;
+ oss << (*it).str();
+ }
+
+ else if( (*it).is< ObjectElement >() )
+ {
+ oss << SEPARATOR_LOCATION << "&" << (*it).to_ptr<
+ ObjectElement >()->getFullyQualifiedNameID();
+ }
+
+ else if( (*it).is< BaseInstanceForm >() )
+ {
+ oss << SEPARATOR_LOCATION << "&" << (*it).to_ptr<
+ BaseInstanceForm >()->getFullyQualifiedNameID();
+ }
+
+ else if( (*it).is< RuntimeID >() )
+ {
+ oss << SEPARATOR_LOCATION << "&"
+ << (*it).bfRID().getFullyQualifiedNameID();
+ }
+ }
+ }
+
+ return( oss.str() );
+}
+
+
+void UniFormIdentifier::toStreamLocator(OutStream & out) const
+{
+ if( hasLocator() )
+ {
+ out << AVM_NO_INDENT;
+ getLocator().toStream(out);
+ out << END_INDENT;
+ }
+}
+
+
+void UniFormIdentifier::toStreamLocation(OutStream & out) const
+{
+ toStreamLocation(out, ListOfField::begin(), ListOfField::end());
+}
+
+
+void UniFormIdentifier::toStreamLocation(OutStream & out,
+ ListOfField::const_iterator it, ListOfField::const_iterator itEnd) const
+{
+ if( (it != itEnd) && (*it).valid() )
+ {
+ if( (*it).is< BaseInstanceForm >() )
+ {
+AVM_IF_DEBUG_FLAG( QUALIFIED_NAME_ID )
+ out << (*it).to_ptr< BaseInstanceForm >()->getFullyQualifiedNameID();
+AVM_ELSE
+ out << (*it).to_ptr< BaseInstanceForm >()->getNameID();
+AVM_ENDIF_DEBUG_FLAG( QUALIFIED_NAME_ID )
+ }
+
+ else if( (*it).is< RuntimeID >())
+ {
+AVM_IF_DEBUG_FLAG( QUALIFIED_NAME_ID )
+ out << (*it).bfRID().getFullyQualifiedNameID();
+AVM_ELSE
+ out << (*it).bfRID().strUniqId();
+AVM_ENDIF_DEBUG_FLAG( QUALIFIED_NAME_ID )
+ }
+
+ else if( (*it).is< ObjectElement >() )
+ {
+ out << "&" << (*it).to_ptr<
+ ObjectElement >()->getFullyQualifiedNameID();
+ }
+
+ else if( (*it).isIdentifier() )
+ {
+ (*it).toStream(out);
+ }
+
+ else if( (*it).is< AvmCode >() )
+ {
+ out << "${ ufi";
+ for( ; it != itEnd ; ++it )
+ {
+ out << " ";
+ (*it).toStream(out);
+ }
+ out << " }";
+
+ return;
+ }
+
+ else if( (*it).is< UniFormIdentifier >() )
+ {
+ out << "${ ufi "
+ << (*it).to_ptr< UniFormIdentifier >()->str() << " }";
+ }
+
+ else
+ {
+ out << no_indent( *it );
+ }
+
+
+ for( ++it ; it != itEnd ; ++it )
+ {
+ if( (*it).scheme == UFI_SCHEME_INDEX )
+ {
+ out << "[";
+
+ if( (*it).is< ObjectElement >() )
+ {
+ out << "&" << (*it).to_ptr<
+ ObjectElement >()->getFullyQualifiedNameID();
+ }
+ else if( (*it).is< BaseInstanceForm >() )
+ {
+ out << "&" << (*it).to_ptr<
+ BaseInstanceForm >()->getFullyQualifiedNameID();
+ }
+ else
+ {
+ (*it).toStream(out);
+ }
+
+ out << "]";
+ }
+ else if( (*it).scheme == UFI_SCHEME_PARAMETER )
+ {
+ out << "(";
+
+ if( (*it).is< ObjectElement >() )
+ {
+ out << "&" << (*it).to_ptr<
+ ObjectElement >()->getFullyQualifiedNameID();
+ }
+ else
+ {
+ (*it).toStream(out);
+ }
+
+ out << ")";
+ }
+
+ else if( (*it).isIdentifier() )
+ {
+ out << SEPARATOR_ID;
+ (*it).toStream(out);
+ }
+
+ else if( (*it).is< ObjectElement >() )
+ {
+ out << SEPARATOR_LOCATION << "&" << (*it).to_ptr<
+ ObjectElement >()->getFullyQualifiedNameID();
+ }
+
+ else if( (*it).is< BaseInstanceForm >() )
+ {
+ out << SEPARATOR_LOCATION << "&" << (*it).to_ptr<
+ BaseInstanceForm >()->getFullyQualifiedNameID();
+ }
+
+ else if( (*it).is< RuntimeID >() )
+ {
+ out << SEPARATOR_LOCATION << "&"
+ << (*it).bfRID().getFullyQualifiedNameID();
+ }
+ }
+ }
+}
+
+
+std::string UniFormIdentifier::toStringContainer() const
+{
+ StringOutStream oss(AVM_NO_INDENT);
+
+ if( hasLocator() )
+ {
+ getLocator().toStream(oss);
+
+ oss << SEPARATOR_LOCATOR;
+ }
+
+ if( ListOfField::nonempty() )
+ {
+ ListOfField::const_iterator it = ListOfField::begin();
+ ListOfField::const_iterator itEnd = ListOfField::end();
+ if( it != itEnd ) { --itEnd; }
+
+ toStreamLocation(oss, it, itEnd);
+ }
+
+ return( oss.str() );
+}
+
+
+std::string UniFormIdentifier::toStringId() const
+{
+ if( ListOfField::nonempty() )
+ {
+ if( ListOfField::last().valid() )
+ {
+ if( ListOfField::last().is< BaseInstanceForm >() )
+ {
+ return( ListOfField::last().to_ptr< BaseInstanceForm >()->getNameID() );
+ }
+
+ else if( ListOfField::last().is< RuntimeID >() )
+ {
+ return( ListOfField::last().bfRID().getNameID() );
+ }
+
+ else if( ListOfField::last().is< ObjectElement >() )
+ {
+ return( ListOfField::last().to_ptr<
+ ObjectElement >()->getNameID() );
+ }
+
+ else
+ {
+ return( ListOfField::last().str() );
+ }
+ }
+ else
+ {
+ return( "ID<null>" );
+ }
+ }
+
+ return( "" );
+}
+
+
+void UniFormIdentifier::toStreamAvm(OutStream & out) const
+{
+ out << TAB << AVM_NO_INDENT;
+
+ if( hasLocator() )
+ {
+ getLocator().toStream(out);
+
+ out << SEPARATOR_LOCATOR;
+ }
+
+ out << "${ ufi";
+
+ ListOfField::const_iterator it = ListOfField::begin();
+ ListOfField::const_iterator itEnd = ListOfField::end();
+ for( ; it != itEnd ; ++it )
+ {
+ out << " ";
+
+ // CASE OBJECT ELEMENT
+ if( (*it).is< ObjectElement >() )
+ {
+ out << "&" << (*it).to_ptr< ObjectElement >()->getFullyQualifiedNameID();
+ }
+
+ // CASE INSTANCE ELEMENT
+ else if( (*it).is< BaseInstanceForm >() )
+ {
+ out << "&" << (*it).to_ptr< BaseInstanceForm >()->getFullyQualifiedNameID();
+ }
+
+ // CASE RUNTIME_FORM_ID ELEMENT
+ else if( (*it).is< RuntimeID >() )
+ {
+ out << "&" << (*it).bfRID().getFullyQualifiedNameID();
+ }
+
+ // CASE IDENTIFIER ELEMENT
+ else if( (*it).isIdentifier() )
+ {
+ (*it).toStream(out);
+ }
+
+ else
+ {
+ (*it).toStream(out);
+ }
+ }
+
+ out << END_INDENT << " } " << EOL_FLUSH;
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/fml/workflow/UniFormIdentifier.h b/org.eclipse.efm.symbex/src/fml/workflow/UniFormIdentifier.h
new file mode 100644
index 0000000..52103ed
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/workflow/UniFormIdentifier.h
@@ -0,0 +1,629 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef UFI_H_
+#define UFI_H_
+
+#include <common/NamedElement.h>
+
+#include <fml/common/TraceableElement.h>
+
+#include <common/AvmPointer.h>
+#include <base/ClassKindInfo.h>
+#include <common/BF.h>
+
+#include <fml/builtin/Identifier.h>
+#include <collection/List.h>
+
+
+namespace sep
+{
+
+class Element;
+
+
+typedef avm_uint8_t avm_ufi_scheme_t;
+
+enum {
+ UFI_SCHEME_UNDEFINED = 0x00,
+
+ UFI_SCHEME_MACHINE = 0x01,
+ UFI_SCHEME_INSTANCE = 0x02,
+ UFI_SCHEME_PORT = 0x04,
+ UFI_SCHEME_BUFFER = 0x08,
+ UFI_SCHEME_VARIABLE = 0x10,
+// UFI_SCHEME_CONNECTOR = 0x20,
+
+ UFI_SCHEME_INVOKABLE = 0x20,
+
+ UFI_SCHEME_FIELD = UFI_SCHEME_MACHINE
+ | UFI_SCHEME_INSTANCE
+ | UFI_SCHEME_PORT
+ | UFI_SCHEME_BUFFER
+ | UFI_SCHEME_VARIABLE,
+// | UFI_SCHEME_CONNECTOR,
+// | UFI_SCHEME_INVOKABLE,
+
+
+ UFI_SCHEME_INDEX = 0x40,
+
+ UFI_SCHEME_ARRAY = UFI_SCHEME_INDEX,
+
+
+ UFI_SCHEME_PARAMETER = 0x80,
+
+
+ UFI_SCHEME_ARGUMENT = UFI_SCHEME_ARRAY
+ | UFI_SCHEME_PARAMETER,
+
+
+ UFI_SCHEME_HYBRID = UFI_SCHEME_FIELD
+ | UFI_SCHEME_INDEX
+ | UFI_SCHEME_ARRAY,
+
+ UFI_SCHEME_MASK_ALL = 0xFF
+};
+
+
+
+class UfiField : public BF
+{
+
+public:
+ /**
+ * ATTRIBUTE
+ */
+ avm_ufi_scheme_t scheme;
+
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ UfiField(const BF & bf, avm_ufi_scheme_t aScheme)
+ : BF( bf ),
+ scheme( aScheme )
+ {
+ // NOTHING
+ }
+
+ UfiField(Element * bf, avm_ufi_scheme_t aScheme)
+ : BF( bf ),
+ scheme( aScheme )
+ {
+ // NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ UfiField(const UfiField & atom)
+ : BF( atom ),
+ scheme( atom.scheme )
+ {
+ // NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~UfiField()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * COMPARISON
+ * OPERATOR
+ */
+ inline bool operator==(const UfiField & other) const
+ {
+ return( (scheme == other.scheme) && (*this == other) );
+ }
+
+ inline bool operator!=(const UfiField & other) const
+ {
+ return( (scheme != other.scheme) || (*this != other) );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * for mScheme
+ */
+ inline void addScheme(avm_ufi_scheme_t aScheme)
+ {
+ scheme |= aScheme;
+ }
+
+ inline avm_ufi_scheme_t getScheme() const
+ {
+ return( scheme );
+ }
+
+ inline bool isFieldIndex() const
+ {
+ return( scheme & UFI_SCHEME_INDEX );
+ }
+
+ inline bool isFieldMachine() const
+ {
+ return( scheme & UFI_SCHEME_MACHINE );
+ }
+
+ inline bool isFieldBuffer() const
+ {
+ return( scheme & UFI_SCHEME_BUFFER );
+ }
+
+ inline bool isFieldPort() const
+ {
+ return( scheme & UFI_SCHEME_PORT );
+ }
+
+ inline bool isFieldVariable() const
+ {
+ return( scheme & UFI_SCHEME_VARIABLE );
+ }
+
+ inline bool isFieldInvokable() const
+ {
+ return( scheme & UFI_SCHEME_INVOKABLE );
+ }
+
+ inline bool isFieldParameter() const
+ {
+ return( scheme & UFI_SCHEME_PARAMETER );
+ }
+
+
+ inline void setScheme(avm_ufi_scheme_t aScheme)
+ {
+ scheme = aScheme;
+ }
+
+};
+
+
+class UniFormIdentifier :
+ public NamedElement,
+ public TraceableElement,
+ public List< UfiField >,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( UniFormIdentifier )
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( UniFormIdentifier )
+
+
+public:
+ typedef List< UfiField > ListOfField;
+
+
+ static BF ANONYM_LOCATION;
+
+ static std::string SEPARATOR_ID;
+ static std::string SEPARATOR_LOCATION;
+ static std::string SEPARATOR_LOCATOR;
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ avm_ufi_scheme_t mScheme;
+
+ BF mLocator;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ UniFormIdentifier(bool anonymLocation)
+ : NamedElement( CLASS_KIND_T( UniFormIdentifier ) ),
+ TraceableElement( ),
+ ListOfField( ),
+ mScheme( UFI_SCHEME_UNDEFINED ),
+ mLocator( ( anonymLocation )? ANONYM_LOCATION : BF::REF_NULL )
+ {
+ //!! NOTHING
+ }
+
+ UniFormIdentifier(const BF & aLocator)
+ : NamedElement( CLASS_KIND_T( UniFormIdentifier ) ),
+ TraceableElement( ),
+ ListOfField( ),
+ mScheme( UFI_SCHEME_UNDEFINED ),
+ mLocator( aLocator )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Other
+ */
+ UniFormIdentifier(const std::string & aQualifiedNameID)
+ : NamedElement( CLASS_KIND_T( UniFormIdentifier ), aQualifiedNameID ),
+ TraceableElement( ),
+ ListOfField( ),
+ mScheme( UFI_SCHEME_UNDEFINED ),
+ mLocator( )
+ {
+ build( aQualifiedNameID );
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ UniFormIdentifier(const UniFormIdentifier & anUFI)
+ : NamedElement( anUFI ),
+ TraceableElement( anUFI ),
+ ListOfField( anUFI ),
+ mScheme( anUFI.mScheme ),
+ mLocator( anUFI.mLocator )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~UniFormIdentifier()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * BUILD FROM QUALIFIED NAME ID
+ */
+ void build(const std::string & aQualifiedNameID);
+
+ /**
+ * LOADER - DISPOSER
+ */
+ static void load();
+ static void dispose();
+
+
+ /**
+ * ListOfField
+ */
+ inline avm_size_t size() const
+ {
+ return( ListOfField::size() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * for mScheme
+ */
+ inline void addScheme(avm_ufi_scheme_t aScheme)
+ {
+ mScheme |= aScheme;
+ }
+
+
+ inline avm_ufi_scheme_t getScheme() const
+ {
+ return( mScheme );
+ }
+
+ inline bool hasScheme() const
+ {
+ return( mScheme != UFI_SCHEME_UNDEFINED );
+ }
+
+ inline bool isScheme(avm_ufi_scheme_t aScheme) const
+ {
+ return( (mScheme & aScheme) == aScheme );
+ }
+
+
+ inline bool isFields() const
+ {
+ return( (mScheme & (UFI_SCHEME_ARGUMENT)) == 0 );
+ }
+
+ inline bool isAbsoluteFullFields() const
+ {
+ return( (mLocator.valid()
+ || (nonempty() && first().is< ObjectElement >()))
+ && ((mScheme & UFI_SCHEME_ARGUMENT) == 0) );
+ }
+
+ inline bool isFullOffset() const
+ {
+ return( (mScheme & UFI_SCHEME_PARAMETER) == 0 );
+ }
+
+ inline bool hasArray() const
+ {
+ return( mScheme & UFI_SCHEME_ARRAY );
+ }
+
+ inline bool hasInvokable() const
+ {
+ return( mScheme & UFI_SCHEME_INVOKABLE );
+ }
+
+ inline bool hasParameter() const
+ {
+ return( mScheme & UFI_SCHEME_PARAMETER );
+ }
+
+
+ inline void setScheme(avm_ufi_scheme_t aScheme)
+ {
+ mScheme = aScheme;
+ }
+
+
+
+ /**
+ * GETTER - SETTER
+ * for mLocator
+ */
+ inline BF & getLocator()
+ {
+ return( mLocator );
+ }
+
+ inline const BF & getLocator() const
+ {
+ return( mLocator );
+ }
+
+ inline bool hasLocator() const
+ {
+ return( mLocator.valid() );
+ }
+
+
+ void setLocator(const std::string & aLocationId);
+
+// inline void setLocator(const BF & aLocation)
+// {
+// mLocator = aLocation;
+// }
+
+
+ inline bool isAnonymLocation() const
+ {
+ return( mLocator.isTEQ( ANONYM_LOCATION ) );
+ }
+
+ inline void setAnonymLocation()
+ {
+ mLocator = ANONYM_LOCATION;
+ }
+
+ inline void setAbsolute()
+ {
+ if( not hasLocator() )
+ {
+ setAnonymLocation();
+ }
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * FIELD UNDEFINED
+ */
+ inline void appendUndef(const BF & field)
+ {
+ ListOfField::append( UfiField(field, UFI_SCHEME_UNDEFINED) );
+ }
+
+ /**
+ * GETTER - SETTER
+ * FIELD INDEX
+ */
+ inline void appendIndex(const BF & idx)
+ {
+ ListOfField::append( UfiField(idx, UFI_SCHEME_INDEX) );
+ mScheme |= UFI_SCHEME_ARRAY;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * FIELD
+ */
+ inline void updateAllNameID()
+ {
+ const std::string strID = str();
+
+ setAllNameID( strID , strID , strID );
+ }
+
+
+
+ inline void appendField(Element * field, avm_ufi_scheme_t scheme)
+ {
+ ListOfField::append( UfiField(field, scheme) );
+ mScheme |= scheme;
+
+ updateAllNameID();
+ }
+
+ inline void appendField(const BF & field, avm_ufi_scheme_t scheme)
+ {
+ ListOfField::append( UfiField(field, scheme) );
+ mScheme |= scheme;
+
+ updateAllNameID();
+ }
+
+ void appendField(const std::string & aQualifiedNameID,
+ avm_ufi_scheme_t scheme);
+
+ void appendField(const BF & field);
+
+ inline void appendField(const std::string & aQualifiedNameID)
+ {
+ appendField( aQualifiedNameID , UFI_SCHEME_FIELD );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * FIELD MACHINE
+ */
+ inline void appendFieldMachine(const BF & field)
+ {
+ appendField( field , UFI_SCHEME_MACHINE );
+ }
+
+ inline void appendFieldMachine(const std::string & aQualifiedNameID)
+ {
+ appendField( aQualifiedNameID , UFI_SCHEME_MACHINE );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * FIELD VARIABLE
+ */
+ inline void appendFieldVariable(const BF & field)
+ {
+ appendField( field , UFI_SCHEME_VARIABLE );
+ }
+
+ inline void appendFieldVariable(const std::string & aQualifiedNameID)
+ {
+ appendField( aQualifiedNameID , UFI_SCHEME_VARIABLE );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * FIELD FUNCTION
+ */
+ inline void appendFieldInvokable(const BF & field)
+ {
+ appendField( field , UFI_SCHEME_INVOKABLE );
+ }
+
+ inline void appendFieldInvokable(const std::string & aQualifiedNameID)
+ {
+ appendField( aQualifiedNameID , UFI_SCHEME_INVOKABLE );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * FIELD PARAMETER
+ */
+ inline void appendFieldParameter(const BF & field)
+ {
+ appendField( field , UFI_SCHEME_PARAMETER );
+ }
+
+ inline void appendFieldParameter(const std::string & aQualifiedNameID)
+ {
+ appendField( aQualifiedNameID , UFI_SCHEME_PARAMETER );
+ }
+
+
+ /**
+ * TEST
+ */
+ inline bool isPureIdentifier() const
+ {
+ return( ListOfField::singleton() && mLocator.invalid() &&
+ isScheme(UFI_SCHEME_FIELD) &&
+ ListOfField::back().is< Identifier >() );
+ }
+
+ inline BF popIdentifier()
+ {
+ return( ListOfField::pop_first() );
+ }
+
+ inline const BF & toIdentifier() const
+ {
+ return( ListOfField::back() );
+ }
+
+
+ /**
+ * COMPARISON
+ * OPERATOR
+ */
+ int compare(const UniFormIdentifier & other) const;
+
+ inline bool operator==(const UniFormIdentifier & other) const
+ {
+ return( UniFormIdentifier::isEQ( other ) );
+ }
+
+ bool isEQ(const UniFormIdentifier & other) const;
+
+
+ /**
+ * Serialization
+ */
+ void toStream(OutStream & out) const;
+
+ std::string str() const;
+
+
+ void toStreamLocator(OutStream & out) const;
+
+ inline std::string toStringLocator() const
+ {
+ StringOutStream oss(AVM_NO_INDENT);
+
+ toStreamLocator(oss);
+
+ return( oss.str() );
+ }
+
+
+ void toStreamLocation(OutStream & out) const;
+
+ inline std::string toStringLocation() const
+ {
+ StringOutStream oss(AVM_NO_INDENT);
+
+ toStreamLocation(oss);
+
+ return( oss.str() );
+ }
+
+
+ void toStreamLocation(OutStream & out, ListOfField::const_iterator it,
+ ListOfField::const_iterator itEnd) const;
+
+ std::string toStringContainer() const;
+
+ std::string toStringId() const;
+
+
+ void toStreamAvm(OutStream & out) const;
+
+};
+
+
+}
+
+#endif /*UFI_H_*/
diff --git a/org.eclipse.efm.symbex/src/fml/workflow/WObject.cpp b/org.eclipse.efm.symbex/src/fml/workflow/WObject.cpp
new file mode 100644
index 0000000..5219d31
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/workflow/WObject.cpp
@@ -0,0 +1,840 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 23 mars 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "WObject.h"
+
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/StatementTypeChecker.h>
+#include <fml/operator/Operator.h>
+
+
+namespace sep
+{
+
+/**
+ * STATIC
+ * _NULL_
+ */
+WObject * WObject::_NULL_ = NULL;
+
+const std::string & WObject::FML_FQN_SCHEME = "fml";
+
+const std::string & WObject::FML_FQN_ROOT =
+ WObject::FML_FQN_SCHEME + FQN_ID_SCHEME_PATH_SEPARATOR;
+
+const std::string & WObject::SEW_FQN_SCHEME = "sew";
+
+const std::string & WObject::SEW_FQN_ROOT =
+ WObject::SEW_FQN_SCHEME + FQN_ID_SCHEME_PATH_SEPARATOR;
+
+
+/**
+ * DESTROY
+ */
+void WObject::destroyOwnedElement()
+{
+ if( mOwnedElements.nonempty() )
+ {
+ WObject * wfObject = WObject::_NULL_;
+
+ std::size_t ownedCount = mOwnedElements.size();
+
+//AVM_IF_DEBUG_ENABLED
+// AVM_OS_DEBUG << "@" << this->raw_address() << ": ref< "
+// << this->getRefCount() << " > " << this->strUniqId() << std::endl;
+// for( std::size_t offset = 0 ; offset < ownedCount ; ++offset)
+// {
+// wfObject = mOwnedElements[ offset ];
+//
+// AVM_OS_DEBUG << wfObject->getOffset() << " @" << wfObject->raw_address()
+// << ": ref< " << wfObject->getRefCount() << " > "
+// << wfObject->strUniqId() << std::endl;
+// }
+//AVM_ENDIF_DEBUG_ENABLED
+
+ for( std::size_t offset = ownedCount ; offset > 0 ; --offset)
+ {
+ wfObject = mOwnedElements[ offset - 1 ];
+
+ if( wfObject == WObject::_NULL_ )
+ {
+AVM_IF_DEBUG_ENABLED
+ AVM_OS_WARN << "Unexpected <null> as Owned WObject for destruction !"
+ << std::endl;
+AVM_ENDIF_DEBUG_ENABLED
+ }
+ else if( wfObject->getContainer() == this )
+ {
+ if( wfObject->isUnique() )
+ {
+ // NORMAL SITUATION
+ wfObject = WObject::_NULL_;
+ }
+ else if( wfObject->isMultiple() )
+ {
+AVM_IF_DEBUG_ENABLED
+ AVM_OS_WARN << "Unexpected Owned WObject <"
+ << wfObject->strUniqId() << "> with refcount < "
+ << wfObject->getRefCount()
+ << " > for destruction !" << std::endl;
+AVM_ENDIF_DEBUG_ENABLED
+ }
+
+ else
+ {
+AVM_IF_DEBUG_ENABLED
+ AVM_OS_WARN << "Unexpected Owned WObject <pos " << offset << ": " << std::endl;
+ AVM_OS_WARN << wfObject->strUniqId() << "> with refCount == 0 !!!" << std::endl;
+AVM_ENDIF_DEBUG_ENABLED
+ }
+ }
+
+ else
+ {
+AVM_IF_DEBUG_ENABLED
+ AVM_OS_WARN << "Unexpected non-Owned WObject <"
+ << wfObject->strUniqId() << "> with refcount < "
+ << wfObject->getRefCount()
+ << " > for destruction !" << std::endl;
+AVM_ENDIF_DEBUG_ENABLED
+ }
+ }
+
+ mOwnedElements.clear();
+ }
+}
+
+
+/**
+ * DESTROY
+ */
+void WObjectManager::destroyManagedElement()
+{
+ mTableOfRegisteredWObject.clear();
+
+ if( mTableOfManagedElement.nonempty() )
+ {
+ WObject * wfObject = WObject::_NULL_;
+
+ std::size_t managedCount = mTableOfManagedElement.size();
+
+//AVM_IF_DEBUG_ENABLED
+// for( std::size_t offset = 0 ; offset < managedCount ; ++offset)
+// {
+// wfObject = mTableOfManagedElement[ offset ];
+//
+// AVM_OS_DEBUG << wfObject->getOffset() << " @" << wfObject->raw_address()
+// << ": ref< " << wfObject->getRefCount() << " > "
+// << wfObject->strUniqId() << std::endl;
+// }
+//AVM_ENDIF_DEBUG_ENABLED
+
+ std::size_t destroyedCount = 0;
+ for( std::size_t offset = managedCount ; offset > 0 ; --offset)
+ {
+ wfObject = mTableOfManagedElement[ offset - 1 ];
+
+ if( wfObject == WObject::_NULL_ )
+ {
+AVM_IF_DEBUG_ENABLED
+ AVM_OS_WARN << "Unexpected <null> as Managed WObject for destruction !"
+ << std::endl;
+AVM_ENDIF_DEBUG_ENABLED
+ }
+ else if( wfObject->isUnique() )
+ {
+ ++destroyedCount;
+
+ delete( wfObject );
+
+ wfObject = WObject::_NULL_;
+ }
+
+ else if( wfObject->isMultiple() )
+ {
+AVM_IF_DEBUG_ENABLED
+ AVM_OS_WARN << "Indestructible Managed WObject <pos "
+ << wfObject->getOffset() << ": " << std::flush;
+ AVM_OS_WARN << wfObject->strUniqId() << "> with refcount < "
+ << wfObject->getRefCount() << " > for destruction !" << std::endl;
+AVM_ENDIF_DEBUG_ENABLED
+
+ wfObject->decrRefCount();
+ }
+
+ else
+ {
+AVM_IF_DEBUG_ENABLED
+AVM_OS_WARN << ">>> Unexpected Managed WObject <" << wfObject->strUniqId()
+ << "> with refCount == 0 !!!" << std::endl;
+AVM_ENDIF_DEBUG_ENABLED
+ }
+ }
+
+AVM_IF_DEBUG_ENABLED_AND( destroyedCount < managedCount )
+ AVM_OS_WARN << "Managed WObject destruction count < " << destroyedCount
+ << " / " << managedCount << " > !" << std::endl;
+AVM_ENDIF_DEBUG_ENABLED
+ }
+}
+
+
+/**
+ * FACTORY
+ * container of WObject
+ * !UNUSED!
+WObject * WObject::container() const
+{
+ WObject * wfContainer = WObject::_NULL_;
+
+ ObjectElement * aContainer = this->getContainer();
+ while( aContainer != NULL )
+ {
+ if( aContainer->is< WObject >() )
+ {
+ wfContainer = aContainer->to< WObject >();
+ if( wfContainer->isWTypedObject()
+ || wfContainer->isWSequence() )
+ {
+ return( wfContainer );
+ }
+ }
+
+ aContainer = aContainer->getContainer();
+ }
+
+ return( WObject::_NULL_ );
+}
+
+WObject * WObject::sequenceContainerOf() const
+{
+ WObject * wfContainer = WObject::_NULL_;
+
+ ObjectElement * aContainer = this->getContainer();
+ while( aContainer != NULL )
+ {
+ if( aContainer->is< WObject >() )
+ {
+ wfContainer = aContainer->to< WObject >();
+
+ if( wfContainer->isWSequence() )
+ {
+ return( wfContainer );
+ }
+ else if( wfContainer->isWTypedObject() )
+ {
+ return( WObject::_NULL_ );
+ }
+ }
+
+ aContainer = aContainer->getContainer();
+ }
+
+ return( WObject::_NULL_ );
+}
+* !UNUSED!
+*/
+
+const WObject * WObject::objectContainer() const
+{
+ const WObject * wfContainer = WObject::_NULL_;
+
+ const ObjectElement * aContainer = this->getContainer();
+ while( aContainer != NULL )
+ {
+ wfContainer = aContainer->to< WObject >();
+
+ if( wfContainer->isWTypedObject() )
+ {
+ return( wfContainer );
+ }
+
+ aContainer = aContainer->getContainer();
+ }
+
+ return( WObject::_NULL_ );
+}
+
+
+/**
+ * Serialization
+ */
+
+std::string WObject::strPropertyValue() const
+{
+ switch( mKind )
+ {
+ case WOBJECT_PROPERTY_OPERATOR_KIND:
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mOperatorValue )
+ << "Operator value as alias < " << strUniqId() << " > !"
+ << SEND_EXIT;
+ return( (OSS() << "<op> " << mOperatorValue->str()).str() );
+
+ case WOBJECT_PROPERTY_WREFERENCE_KIND:
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mWOjectReferenceValue )
+ << "WOject reference value as alias < "
+ << strUniqId() << " > !"
+ << SEND_EXIT;
+ return( (OSS() << "<ref> "
+ << mWOjectReferenceValue->strHeader()).str() );
+
+ case WOBJECT_PROPERTY_BOOLEAN_KIND:
+ return( (OSS() << "<bool> " << mValue.str()).str() );
+
+ case WOBJECT_PROPERTY_CHARACTER_KIND:
+ return( (OSS() << "<char> " << mValue.str()).str() );
+
+ case WOBJECT_PROPERTY_INTEGER_KIND:
+ return( (OSS() << "<int> " << mValue.str()).str() );
+
+ case WOBJECT_PROPERTY_RATIONAL_KIND:
+ return( (OSS() << "<rat> " << mValue.str()).str() );
+
+ case WOBJECT_PROPERTY_FLOAT_KIND:
+ return( (OSS() << "<float> " << mValue.str()).str() );
+
+ case WOBJECT_PROPERTY_IDENTIFIER_KIND:
+ return( (OSS() << "<id> " << mValue.str()).str() );
+
+ case WOBJECT_PROPERTY_QUALIFIED_IDENTIFIER_KIND:
+ return( (OSS() << "<qid> " << mValue.str()).str() );
+
+ case WOBJECT_PROPERTY_UNIQ_FORM_IDENTIFIER_KIND:
+ return( (OSS() << "<ufi> " << mValue.str()).str() );
+
+ case WOBJECT_PROPERTY_SINGLE_QUOTE_STRING_KIND:
+ return( (OSS() << "<sqs> " << mValue.str()).str() );
+
+ case WOBJECT_PROPERTY_DOUBLE_QUOTE_STRING_KIND:
+ case WOBJECT_PROPERTY_STRING_KIND:
+ return( (OSS() << "<dqs> " << mValue.str()).str() );
+
+ case WOBJECT_PROPERTY_KIND:
+ default:
+ return( mValue.str() );
+ }
+}
+
+
+
+void WObject::strHeader(OutStream & os) const
+{
+ if( isWProperty() )
+ {
+ os << "property " << getNameID();
+
+ if( hasReallyUnrestrictedName() )
+ {
+ os << " '" << getUnrestrictedName() << "'";
+ }
+
+ os << " = " << strPropertyValue();
+ }
+
+ else if( isWSequence() )
+ {
+ os << "sequence " << getNameID();
+
+ if( hasReallyUnrestrictedName() )
+ {
+ os << " '" << getUnrestrictedName() << "'";
+ }
+ }
+
+ else
+ {
+ os << "object";
+ if( hasQualifiedTypeNameID() )
+ {
+ os << "< " << getQualifiedTypeNameID() << " >";
+ }
+
+ os << " " << ( hasFullyQualifiedNameID() ?
+ getFullyQualifiedNameID() : getNameID() );
+
+ if( hasReallyUnrestrictedName() )
+ {
+ os << " '" << getUnrestrictedName() << "'";
+ }
+ }
+}
+
+
+static std::string strSpecifierOperator(AVM_OPCODE opcode)
+{
+ switch( opcode )
+ {
+ case AVM_OPCODE_EQ : return( "=" );
+
+ case AVM_OPCODE_NEQ : return( "!=" );
+ case AVM_OPCODE_SEQ : return( "===" );
+ case AVM_OPCODE_NSEQ : return( "=/=" );
+
+ case AVM_OPCODE_BAND : return( "&=" );
+ case AVM_OPCODE_BOR : return( "|=" );
+ case AVM_OPCODE_BXOR : return( "^=" );
+ case AVM_OPCODE_BNOT : return( "~=" );
+
+ case AVM_OPCODE_PLUS : return( "+=" );
+ case AVM_OPCODE_MINUS: return( "-=" );
+ case AVM_OPCODE_MOD : return( "%=" );
+ case AVM_OPCODE_MULT : return( "*=" );
+ case AVM_OPCODE_DIV : return( "/=" );
+
+ case AVM_OPCODE_LTE : return( "<=" );
+ case AVM_OPCODE_GTE : return( ">=" );
+
+ case AVM_OPCODE_ASSIGN: return( ":=" );
+
+ case AVM_OPCODE_ASSIGN_MACRO: return( "::=" );
+
+ default: return( "opcode#unknown" );
+ }
+}
+
+
+void WObject::toStreamWProperty(OutStream & os) const
+{
+ os << TAB;// << getNameID();
+
+// TRACE LINE
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PARSING )
+ os << traceLine("", false) << " ";
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PARSING )
+
+ os << getNameID();
+
+ if( hasValue() )
+ {
+ if( getValue().is< AvmCode >() )
+ {
+ AvmCode * aCode = getValue().to_ptr< AvmCode >();
+
+ if( StatementTypeChecker::isSchedule(aCode) )
+ {
+ os << " = $" << IGNORE_FIRST_TAB;
+ aCode->toStream(os);
+ }
+ else
+ {
+ os << " = ${" << EOL_INCR_INDENT;
+ getValue().toStream(os);
+ os << DECR_INDENT_TAB << "}";
+ }
+ }
+ else
+ {
+ os << " " << strSpecifierOperator( mSpecifierOp );
+ if( getValue().is< Operator >() )
+ {
+ getValue().to_ptr< Operator >()->standardSymbol();
+ }
+ else if( isWPropertyWReference() )
+ {
+ os << " &" << getWReferenceValue()->getFullyQualifiedNameID();
+ }
+ else
+ {
+ os << " " << strPropertyValue();
+ }
+ }
+ }
+ else
+ {
+ os << " " << strPropertyValue();
+ }
+
+
+// TRACE LINE
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PARSING )
+// os << traceLine(" ");
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PARSING )
+
+ AVM_DEBUG_REF_COUNTER(os);
+
+ os << EOL_FLUSH;
+}
+
+
+void WObject::toStreamOwnedElement(OutStream & os,
+ const std::string & beginDelimiter,
+ const std::string & endDelimiter) const
+{
+ os << beginDelimiter; AVM_DEBUG_REF_COUNTER(os);
+
+// TRACE LINE
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PARSING )
+ os << traceLine(" ");
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PARSING )
+
+ os << EOL_INCR_INDENT;
+
+ TableOfOwnedElement::const_iterator itElement = mOwnedElements.begin();
+ TableOfOwnedElement::const_iterator endElement = mOwnedElements.end();
+ for( ; itElement != endElement ; ++itElement )
+ {
+ if( (*itElement) != NULL )
+ {
+ if( (*itElement)->getContainer() != this )
+ {
+ os << TAB << "&" << (*itElement)
+ ->getFullyQualifiedNameID()
+// os << TAB << (*itElement)->getNameID()
+ << EOL_FLUSH;
+ }
+ else
+ {
+ (*itElement)->toStream(os);
+ }
+ }
+ else
+ {
+ os << TAB << "NULL" << EOL_FLUSH;
+ }
+ }
+
+ os << DECR_INDENT_TAB << endDelimiter;
+
+ // TRACE LINE
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , PARSING )
+ os << traceLine(" ");
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , PARSING )
+}
+
+
+
+
+/**
+ * return FullyQualifiedNameID + '.' aNameID
+ */
+std::string WObjectManager::makeFQN(
+ WObject * wfObject, const std::string & aNameID) const
+{
+ if( wfObject == WObject::_NULL_ )
+ {
+ return( aNameID );
+ }
+ else if( wfObject == &(ROOT_WOBJECT) )
+ {
+ return( ROOT_WOBJECT.getFullyQualifiedNameID() + aNameID );
+ }
+ else if( wfObject->isWTypedObject() )
+ {
+ return( wfObject->getFullyQualifiedNameID() + "." + aNameID );
+ }
+ else
+ {
+ const ObjectElement * aContainer = wfObject->getContainer();
+ while( aContainer != NULL )
+ {
+ if( aContainer->to< WObject >()->isWTypedObject() )
+ {
+ return( aContainer->getFullyQualifiedNameID()
+ + "." + aNameID );
+ }
+
+ aContainer = aContainer->getContainer();
+ }
+ }
+
+ return( aNameID );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+// PROPERTY CREATION FACTORY
+////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+
+/**
+ * create Workflow-Property
+ */
+WObject * WObjectManager::newWPropertyExpression(WObject * wfContainer,
+ const std::string & aNameID, const BF & value)
+{
+ WObject * wfObject = WObject::_NULL_;
+
+ switch( value.classKind() )
+ {
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ {
+ wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_PROPERTY_BOOLEAN_KIND, aNameID, value );
+
+ break;
+ }
+
+ case FORM_BUILTIN_CHARACTER_KIND:
+ {
+ wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_PROPERTY_CHARACTER_KIND, aNameID, value );
+
+ break;
+ }
+
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_PROPERTY_INTEGER_KIND, aNameID, value );
+
+ break;
+ }
+
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_PROPERTY_RATIONAL_KIND, aNameID, value );
+
+ break;
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_PROPERTY_FLOAT_KIND, aNameID, value );
+
+ break;
+ }
+
+ case FORM_BUILTIN_STRING_KIND:
+ {
+ wfObject = new WObject( (*this), wfContainer,
+ value.to_ptr< String >()->isSingleQuote()
+ ? WObject::WOBJECT_PROPERTY_SINGLE_QUOTE_STRING_KIND
+ : WObject::WOBJECT_PROPERTY_DOUBLE_QUOTE_STRING_KIND,
+ aNameID, value );
+
+ break;
+ }
+
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ {
+ wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_PROPERTY_IDENTIFIER_KIND, aNameID, value );
+
+ break;
+ }
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+ {
+ wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_PROPERTY_QUALIFIED_IDENTIFIER_KIND,
+ aNameID, value );
+
+ break;
+ }
+
+ case FORM_UFI_KIND:
+ {
+ if( value.to_ptr< UniFormIdentifier >()->isPureIdentifier() )
+ {
+ wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_PROPERTY_IDENTIFIER_KIND,
+ aNameID, value );
+ }
+ else
+ {
+ wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_PROPERTY_UNIQ_FORM_IDENTIFIER_KIND,
+ aNameID, value );
+ }
+
+ break;
+ }
+
+ case FORM_WOBJECT_KIND:
+ {
+ value.incrRefCount();
+
+ wfObject = new WObject( (*this), wfContainer,
+ aNameID, value.to_ptr< WObject >() );
+
+ break;
+ }
+
+ case FORM_ARRAY_BOOLEAN_KIND:
+ case FORM_ARRAY_CHARACTER_KIND:
+ case FORM_ARRAY_INTEGER_KIND:
+ case FORM_ARRAY_RATIONAL_KIND:
+ case FORM_ARRAY_FLOAT_KIND:
+ case FORM_ARRAY_STRING_KIND:
+ case FORM_ARRAY_IDENTIFIER_KIND:
+ case FORM_ARRAY_QUALIFIED_IDENTIFIER_KIND:
+ case FORM_ARRAY_BF_KIND:
+ {
+ wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_PROPERTY_ARRAY_KIND, aNameID, value );
+
+ break;
+ }
+
+ case FORM_XFSP_VARIABLE_KIND:
+ case FORM_INSTANCE_DATA_KIND:
+ case FORM_AVMCODE_KIND:
+ default:
+ {
+ wfObject = new WObject( (*this), wfContainer, aNameID, value );
+
+ break;
+ }
+ }
+
+ return( manage( wfObject ) );
+}
+
+WObject * WObjectManager::newWPropertyBoolean(WObject * wfContainer,
+ const std::string & aNameID, bool aBooleanValue)
+{
+ WObject * wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_PROPERTY_BOOLEAN_KIND, aNameID,
+ ExpressionConstructor::newBoolean(aBooleanValue) );
+
+ return( manage( wfObject ) );
+}
+
+WObject * WObjectManager::newWPropertyCharacter(WObject * wfContainer,
+ const std::string & aNameID, char aCharacterValue)
+{
+ WObject * wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_PROPERTY_CHARACTER_KIND, aNameID,
+ ExpressionConstructor::newChar(aCharacterValue) );
+
+ return( manage( wfObject ) );
+}
+
+
+WObject * WObjectManager::newWPropertyInteger(WObject * wfContainer,
+ const std::string & aNameID, avm_integer_t anIntegerValue)
+{
+ WObject * wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_PROPERTY_INTEGER_KIND, aNameID,
+ ExpressionConstructor::newInteger(anIntegerValue) );
+
+ return( manage( wfObject ) );
+}
+
+WObject * WObjectManager::newWPropertyInteger(WObject * wfContainer,
+ const std::string & aNameID, const std::string & anIntegerValue)
+{
+ WObject * wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_PROPERTY_INTEGER_KIND, aNameID,
+ ExpressionConstructor::newInteger(anIntegerValue) );
+
+ return( manage( wfObject ) );
+}
+
+
+WObject * WObjectManager::newWPropertyFloat(WObject * wfContainer,
+ const std::string & aNameID, double aFloatValue)
+{
+ WObject * wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_PROPERTY_FLOAT_KIND, aNameID,
+ ExpressionConstructor::newFloat(aFloatValue) );
+
+ return( manage( wfObject ) );
+}
+
+WObject * WObjectManager::newWPropertyFloat(WObject * wfContainer,
+ const std::string & aNameID, const std::string & aFloatValue)
+{
+ WObject * wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_PROPERTY_FLOAT_KIND, aNameID,
+ ExpressionConstructor::newFloat(aFloatValue) );
+
+ return( manage( wfObject ) );
+}
+
+
+WObject * WObjectManager::newWPropertySingleQuoteString(WObject * wfContainer,
+ const std::string & aNameID, const std::string & aStringValue)
+{
+ WObject * wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_PROPERTY_SINGLE_QUOTE_STRING_KIND, aNameID,
+ ExpressionConstructor::newSingleQuoteString(aStringValue) );
+
+ return( manage( wfObject ) );
+}
+
+WObject * WObjectManager::newWPropertyDoubleQuoteString(WObject * wfContainer,
+ const std::string & aNameID, const std::string & aStringValue)
+{
+ WObject * wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_PROPERTY_DOUBLE_QUOTE_STRING_KIND, aNameID,
+ ExpressionConstructor::newDoubleQuoteString(aStringValue) );
+
+ return( manage( wfObject ) );
+}
+
+WObject * WObjectManager::newWPropertyString(WObject * wfContainer,
+ const std::string & aNameID, const std::string & aStringValue)
+{
+ WObject * wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_PROPERTY_DOUBLE_QUOTE_STRING_KIND, aNameID,
+ ExpressionConstructor::newDoubleQuoteString(aStringValue) );
+
+ return( manage( wfObject ) );
+}
+
+
+WObject * WObjectManager::newWPropertyIdentifier(WObject * wfContainer,
+ const std::string & aNameID, const std::string & aStringValue)
+{
+ WObject * wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_PROPERTY_IDENTIFIER_KIND, aNameID,
+ ExpressionConstructor::newIdentifier(aStringValue) );
+
+ return( manage( wfObject ) );
+}
+
+WObject * WObjectManager::newWPropertyQualifiedIdentifier(WObject * wfContainer,
+ const std::string & aNameID, const std::string & aStringValue)
+{
+ WObject * wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_PROPERTY_QUALIFIED_IDENTIFIER_KIND, aNameID,
+ ExpressionConstructor::newQualifiedIdentifier(aStringValue) );
+
+ return( manage( wfObject ) );
+}
+
+WObject * WObjectManager::newWPropertyUniFormIdentifier(WObject * wfContainer,
+ const std::string & aNameID, UniFormIdentifier * anUFI)
+{
+ WObject * wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_PROPERTY_UNIQ_FORM_IDENTIFIER_KIND,
+ aNameID, BF(anUFI) );
+
+ return( manage( wfObject ) );
+}
+
+
+WObject * WObjectManager::newWPropertyParsedIdentifier(WObject * wfContainer,
+ const std::string & aNameID, const BF & value)
+{
+ WObject * wfObject = getRegisteredWObject( value.str() );
+ if( wfObject != WObject::_NULL_ )
+ {
+ return( newWPropertyReference(wfContainer, aNameID, wfObject) );
+ }
+ else
+ {
+ return( newWPropertyExpression(wfContainer, aNameID, value) );
+ }
+
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/workflow/WObject.h b/org.eclipse.efm.symbex/src/fml/workflow/WObject.h
new file mode 100644
index 0000000..58421a5
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/workflow/WObject.h
@@ -0,0 +1,1033 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 23 mars 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef FML_WORKFLOW_WOBJECT_H_
+#define FML_WORKFLOW_WOBJECT_H_
+
+#include <fml/common/ObjectElement.h>
+#include <fml/workflow/WPropertyImpl.h>
+
+#include <common/AvmPointer.h>
+#include <common/BF.h>
+
+#include <collection/Vector.h>
+
+//#include <fml/builtin/Identifier.h>
+//#include <fml/builtin/QualifiedIdentifier.h>
+//#include <fml/builtin/String.h>
+//
+//#include <fml/numeric/Float.h>
+//#include <fml/numeric/Integer.h>
+//#include <fml/numeric/Rational.h>
+
+#include <fml/operator/OperatorLib.h>
+
+#include <util/avm_string.h>
+
+#include <map>
+
+
+namespace sep
+{
+
+class BuiltinForm;
+
+class Operator;
+
+class PairOutStream;
+
+class Query;
+class WObject;
+class WObjectManager;
+
+class UniFormIdentifier;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// SYSTEM SMART POINTER
+////////////////////////////////////////////////////////////////////////////////
+
+class WObject :
+ public ObjectElement,
+ public WPropertyImpl,
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( WObject )
+{
+
+ friend class Query;
+ friend class WObjectManager;
+
+ AVM_DECLARE_CLONABLE_CLASS( WObject )
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef Vector< WObject * > TableOfOwnedElement;
+
+ typedef TableOfOwnedElement::const_iterator const_iterator;
+
+protected:
+ /**
+ * ENUM
+ */
+ enum ENUM_WOBJECT_KIND
+ {
+ // UNDEFINED
+ WOBJECT_UNDEFINED_KIND = 0x000,
+
+
+ WOBJECT_PROPERTY_BOOLEAN_KIND = 0x001,
+
+ WOBJECT_PROPERTY_CHARACTER_KIND = 0x002,
+
+ WOBJECT_PROPERTY_INTEGER_KIND = 0x003,
+
+ WOBJECT_PROPERTY_RATIONAL_KIND = 0x004,
+
+ WOBJECT_PROPERTY_FLOAT_KIND = 0x005,
+
+
+ WOBJECT_PROPERTY_IDENTIFIER_KIND = 0x006,
+
+ WOBJECT_PROPERTY_QUALIFIED_IDENTIFIER_KIND = 0x007,
+
+ WOBJECT_PROPERTY_UNIQ_FORM_IDENTIFIER_KIND = 0x008,
+
+
+ WOBJECT_PROPERTY_OPERATOR_KIND = 0x009,
+
+ WOBJECT_PROPERTY_ARRAY_KIND = 0x00A,
+
+
+ WOBJECT_PROPERTY_SINGLE_QUOTE_STRING_KIND = 0x010,
+
+ WOBJECT_PROPERTY_DOUBLE_QUOTE_STRING_KIND = 0x020,
+
+ WOBJECT_PROPERTY_STRING_KIND = WOBJECT_PROPERTY_SINGLE_QUOTE_STRING_KIND
+ | WOBJECT_PROPERTY_DOUBLE_QUOTE_STRING_KIND,
+
+
+ WOBJECT_PROPERTY_WREFERENCE_KIND = 0x040,
+
+ WOBJECT_PROPERTY_KIND = 0x0FF,
+
+
+ WOBJECT_SEQUENCE_KIND = 0x100,
+
+ WOBJECT_SEQUENCE_OR_REFERENCE_KIND = WOBJECT_SEQUENCE_KIND
+ | WOBJECT_PROPERTY_WREFERENCE_KIND,
+
+ WOBJECT_TYPED_KIND = 0x200,
+
+ WOBJECT_TYPED_OR_REFERENCE_KIND = WOBJECT_TYPED_KIND
+ | WOBJECT_PROPERTY_WREFERENCE_KIND,
+
+ WOBJECT_TYPED_OR_SEQUENCE_KIND = WOBJECT_TYPED_KIND
+ | WOBJECT_SEQUENCE_KIND,
+
+ };
+
+
+public:
+ /**
+ * STATIC ATTRIBUTE
+ */
+ static WObject * _NULL_;
+
+ static const std::string & FML_FQN_SCHEME;
+
+ static const std::string & FML_FQN_ROOT;
+
+ static const std::string & SEW_FQN_SCHEME;
+
+ static const std::string & SEW_FQN_ROOT;
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ WObjectManager & mWObjectManager;
+
+ ENUM_WOBJECT_KIND mKind;
+
+ std::string mQualifiedTypeNameID;
+
+ TableOfOwnedElement mOwnedElements;
+
+ // WORKFLOW-PROPERTY VALUE
+ AVM_OPCODE mSpecifierOp;
+
+ union
+ {
+ Operator * mOperatorValue;
+
+ WObject * mWOjectReferenceValue;
+ };
+
+ BF mValue;
+
+
+
+
+protected:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ WObject(WObjectManager & aWObjectManager, WObject * wfContainer,
+ ENUM_WOBJECT_KIND aKind, const std::string & aNameID)
+ : ObjectElement( CLASS_KIND_T( WObject ) , wfContainer , aNameID ),
+ mWObjectManager( aWObjectManager ),
+ mKind( aKind ),
+ mQualifiedTypeNameID( ),
+ mOwnedElements( ),
+ mSpecifierOp( AVM_OPCODE_EQ ),
+
+ mValue( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Workflow-Property
+ */
+ WObject(WObjectManager & aWObjectManager, WObject * wfContainer,
+ const std::string & aNameID, const BF & aValue)
+ : ObjectElement( CLASS_KIND_T( WObject ) , wfContainer , aNameID ),
+ mWObjectManager( aWObjectManager ),
+ mKind( WOBJECT_PROPERTY_KIND ),
+ mQualifiedTypeNameID( ),
+ mOwnedElements( ),
+ mSpecifierOp( AVM_OPCODE_EQ ),
+
+ mValue( aValue )
+ {
+ //!! NOTHING
+ }
+
+ WObject(WObjectManager & aWObjectManager, WObject * wfContainer,
+ const std::string & aNameID, AVM_OPCODE anOp, const BF & aValue)
+ : ObjectElement( CLASS_KIND_T( WObject ) , wfContainer , aNameID ),
+ mWObjectManager( aWObjectManager ),
+ mKind( WOBJECT_PROPERTY_KIND ),
+ mQualifiedTypeNameID( ),
+ mOwnedElements( ),
+ mSpecifierOp( anOp ),
+
+ mValue( aValue )
+ {
+ //!! NOTHING
+ }
+
+ WObject(WObjectManager & aWObjectManager, WObject * wfContainer,
+ ENUM_WOBJECT_KIND aKind, const std::string & aNameID,
+ const BF & aValue)
+ : ObjectElement( CLASS_KIND_T( WObject ) , wfContainer , aNameID ),
+ mWObjectManager( aWObjectManager ),
+ mKind( aKind ),
+ mQualifiedTypeNameID( ),
+ mOwnedElements( ),
+ mSpecifierOp( AVM_OPCODE_EQ ),
+
+ mValue( aValue )
+ {
+ //!! NOTHING
+ }
+
+ WObject(WObjectManager & aWObjectManager, WObject * wfContainer,
+ const std::string & aNameID, Operator * anOperator)
+ : ObjectElement( CLASS_KIND_T( WObject ) , wfContainer , aNameID ),
+ mWObjectManager( aWObjectManager ),
+ mKind( WOBJECT_PROPERTY_OPERATOR_KIND ),
+ mQualifiedTypeNameID( ),
+ mOwnedElements( ),
+ mSpecifierOp( AVM_OPCODE_EQ ),
+
+ mOperatorValue( anOperator ),
+ mValue( )
+ {
+ //!! NOTHING
+ }
+
+ WObject(WObjectManager & aWObjectManager, WObject * wfContainer,
+ const std::string & aNameID, WObject * aWOjectReference)
+ : ObjectElement( CLASS_KIND_T( WObject ) , wfContainer , aNameID ),
+ mWObjectManager( aWObjectManager ),
+ mKind( WOBJECT_PROPERTY_WREFERENCE_KIND ),
+ mQualifiedTypeNameID( ),
+ mOwnedElements( ),
+ mSpecifierOp( AVM_OPCODE_EQ ),
+
+ mWOjectReferenceValue( aWOjectReference ),
+ mValue( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Typed WObject
+ */
+ WObject(WObjectManager & aWObjectManager, WObject * wfContainer,
+ const std::string & aNameID, const std::string & aTypeNameID)
+ : ObjectElement( CLASS_KIND_T( WObject ) , wfContainer , aNameID ),
+ mWObjectManager( aWObjectManager ),
+ mKind( WOBJECT_TYPED_KIND ),
+ mQualifiedTypeNameID( aTypeNameID ),
+ mOwnedElements( ),
+ mSpecifierOp( AVM_OPCODE_EQ ),
+
+ mValue( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONSTRUCTOR
+ * Copy
+ */
+ explicit WObject(const WObject & anObject)
+ : ObjectElement( anObject ),
+ mWObjectManager( anObject.mWObjectManager ),
+ mKind( anObject.mKind ),
+ mQualifiedTypeNameID( anObject.mQualifiedTypeNameID ),
+ mOwnedElements( anObject.mOwnedElements ),
+ mSpecifierOp( anObject.mSpecifierOp ),
+
+ mWOjectReferenceValue( anObject.mWOjectReferenceValue ),
+ mValue( anObject.mValue )
+ {
+ //!! NOTHING
+ }
+
+public:
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~WObject()
+ {
+ // See WObjectManager::destroyManagedElement
+// destroyOwnedElement();
+ }
+
+ /**
+ * DESTROY
+ */
+ void destroyOwnedElement();
+
+
+ /**
+ * TEST
+ * mKind
+ */
+ inline bool isKind(ENUM_WOBJECT_KIND aKind) const
+ {
+ return( (mKind == aKind)
+ || ((aKind == WOBJECT_PROPERTY_KIND)
+ && (mKind < aKind))
+ || ((aKind == WOBJECT_PROPERTY_STRING_KIND)
+ && ((mKind & aKind) != 0)) );
+ }
+
+ /**
+ * TEST
+ * mKind for Composite
+ */
+ inline bool isWTypedObject() const
+ {
+ return( mKind == WOBJECT_TYPED_KIND );
+ }
+
+ inline bool isWTypedOrReference() const
+ {
+ return( (mKind & WOBJECT_TYPED_OR_REFERENCE_KIND) != 0 );
+ }
+
+ inline bool isWTypedOrSequence() const
+ {
+ return( (mKind & WOBJECT_TYPED_OR_SEQUENCE_KIND) != 0 );
+ }
+
+
+ inline bool isWSequence() const
+ {
+ return( mKind == WOBJECT_SEQUENCE_KIND );
+ }
+
+ inline bool isWSequenceOrReference() const
+ {
+ return( (mKind & WOBJECT_SEQUENCE_OR_REFERENCE_KIND) != 0 );
+ }
+
+
+ inline bool isRegexWSequence(const std::string & aRegexSequenceID) const
+ {
+ return( (mKind == WOBJECT_SEQUENCE_KIND)
+ && REGEX_MATCH(getNameID(), aRegexSequenceID) );
+ }
+
+ /**
+ * TEST
+ * mKind for Property
+ */
+ inline bool isWProperty() const
+ {
+ return( mKind <= WOBJECT_PROPERTY_KIND );
+ }
+
+ inline bool isWPropertyboolean() const
+ {
+ return( mKind == WOBJECT_PROPERTY_BOOLEAN_KIND );
+ }
+
+ inline bool isWPropertyCharacter() const
+ {
+ return( mKind == WOBJECT_PROPERTY_CHARACTER_KIND );
+ }
+
+ inline bool isWPropertyInteger() const
+ {
+ return( mKind == WOBJECT_PROPERTY_INTEGER_KIND );
+ }
+
+ inline bool isWPropertyRational() const
+ {
+ return( mKind == WOBJECT_PROPERTY_RATIONAL_KIND);
+ }
+
+ inline bool isWPropertyFloat() const
+ {
+ return( mKind == WOBJECT_PROPERTY_FLOAT_KIND );
+ }
+
+ inline bool isWPropertyIdentifier() const
+ {
+ return( mKind == WOBJECT_PROPERTY_IDENTIFIER_KIND );
+ }
+
+ inline bool isWPropertyQualifiedIdentifier() const
+ {
+ return( mKind == WOBJECT_PROPERTY_QUALIFIED_IDENTIFIER_KIND );
+ }
+
+ inline bool isWPropertyUFI() const
+ {
+ return( mKind == WOBJECT_PROPERTY_UNIQ_FORM_IDENTIFIER_KIND );
+ }
+
+ inline bool isWPropertyOperator() const
+ {
+ return( mKind == WOBJECT_PROPERTY_OPERATOR_KIND );
+ }
+
+ inline bool isWPropertyWReference() const
+ {
+ return( mKind == WOBJECT_PROPERTY_WREFERENCE_KIND );
+ }
+
+ inline bool isWPropertyArray() const
+ {
+ return( mKind == WOBJECT_PROPERTY_ARRAY_KIND );
+ }
+
+ inline bool isWPropertySingleQuoteString() const
+ {
+ return( mKind == WOBJECT_PROPERTY_SINGLE_QUOTE_STRING_KIND );
+ }
+
+ inline bool isWPropertyDoubleQuoteString() const
+ {
+ return( mKind == WOBJECT_PROPERTY_DOUBLE_QUOTE_STRING_KIND );
+ }
+
+ inline bool isWPropertyString() const
+ {
+ return( (mKind & WOBJECT_PROPERTY_STRING_KIND) != 0 );
+ }
+
+
+ /**
+ * GETTER
+ * mQualifiedTypeNameID
+ */
+ inline const std::string & getQualifiedTypeNameID() const
+ {
+ return( mQualifiedTypeNameID );
+ }
+
+ inline bool hasQualifiedTypeNameID() const
+ {
+ return( not mQualifiedTypeNameID.empty() );
+ }
+
+ inline bool isWTypedID(const std::string & aQualifiedNameID) const
+ {
+ return( mQualifiedTypeNameID == aQualifiedNameID );
+ }
+
+ inline void setQualifiedTypeNameID(const std::string & aQualifiedNameID)
+ {
+ mQualifiedTypeNameID = aQualifiedNameID;
+ }
+
+ inline std::string strType() const
+ {
+ return( mQualifiedTypeNameID );
+ }
+
+ inline const std::string & strT() const
+ {
+ return( mQualifiedTypeNameID );
+ }
+
+
+ /**
+ * GETTER
+ * mSpecifierOp
+ */
+ inline AVM_OPCODE getSpecifierOp() const
+ {
+ return( mSpecifierOp );
+ }
+
+ inline void setSpecifierOp(AVM_OPCODE aSpecifierOp)
+ {
+ mSpecifierOp = aSpecifierOp;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mOwnedElements
+ */
+ inline const TableOfOwnedElement & getOwnedElement() const
+ {
+ return( mOwnedElements );
+ }
+
+ inline bool hasOwnedElement() const
+ {
+ return( mOwnedElements.nonempty() );
+ }
+
+ inline bool hasnoOwnedElement() const
+ {
+ return( mOwnedElements.empty() );
+ }
+
+ inline avm_size_t ownedSize() const
+ {
+ return( mOwnedElements.size() );
+ }
+
+
+ inline void append(WObject * wfElement)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( wfElement )
+ << "element !!!"
+ << SEND_EXIT;
+
+// Set by the WObjectManager !
+// wfElement->setOffset( mOwnedElements.size() );
+
+ mOwnedElements.append(wfElement);
+
+ if( wfElement->getContainer() == this )
+ {
+ //!! NOTHING
+ }
+ else if( wfElement->getContainer() != NULL )
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected WObject <" << wfElement->strUniqId()
+ << "> with container <" << this->strUniqId()
+ << "> where old container is <"
+ << wfElement->getContainer()->to< WObject >()->strUniqId()
+ << ">"
+ << SEND_EXIT;
+ }
+ }
+
+ /**
+ * GETTER - SETTER
+ * mOwnedElements [const] iterator
+ */
+ inline const_iterator owned_begin() const
+ {
+ return( mOwnedElements.begin() );
+ }
+
+ inline const_iterator owned_end() const
+ {
+ return( mOwnedElements.end() );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // PROPERTY GETTER - SETTER
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * GETTER - SETTER
+ * mWOjectReferenceValue
+ */
+ inline WObject * getWReferenceValue() const
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( isWPropertyWReference() )
+ << "WObject << " << strPropertyValue()
+ << " >> is not a Property WReference !"
+ << SEND_EXIT;
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mWOjectReferenceValue )
+ << "WOject reference value as alias < " << strUniqId() << " > !"
+ << SEND_EXIT;
+
+ return( mWOjectReferenceValue );
+ }
+
+ /**
+ * GETTER - SETTER
+ * mOperatorValue
+ */
+ inline Operator * getOperatorValue() const
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( isWPropertyWReference() )
+ << "WObject << " << strPropertyValue()
+ << " >> is not a Property WReference !"
+ << SEND_EXIT;
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mWOjectReferenceValue )
+ << "WOject reference value as alias < " << strUniqId() << " > !"
+ << SEND_EXIT;
+
+ return( mOperatorValue );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mValue
+ */
+ inline const BF & getValue() const
+ {
+ return( mValue );
+ }
+
+ inline bool hasValue() const
+ {
+ return( mValue.valid() );
+ }
+
+ inline void setValue(const BF & aValue)
+ {
+ mValue = aValue;
+ }
+
+ /**
+ * FACTORY
+ * container of WObject
+ * !UNUSED!*
+ WObject * container() const;
+
+ WObject * sequenceContainerOf() const;
+ * !UNUSED!
+ */
+
+ const WObject * objectContainer() const;
+
+ /**
+ * Serialization
+ */
+ inline std::string strUniqId() const
+ {
+ return( (isWProperty() ? "wpro:" : (isWSequence() ? "wseq:" : ""))
+ + ( hasFullyQualifiedNameID() ? getFullyQualifiedNameID()
+ : ( hasNameID() ? getNameID()
+ : ( hasUnrestrictedName()
+ ? ("'" + getUnrestrictedName() + "'")
+ : ( hasQualifiedTypeNameID()
+ ? (mQualifiedTypeNameID + ".<anonym>")
+ : "<null-wobject-id>" ) ) ) ) );
+ }
+
+ // str Property Value
+ std::string strPropertyValue() const;
+
+ /**
+ * Serialisation
+ */
+ inline virtual std::string str() const
+ {
+ return( strUniqId() );
+ }
+
+
+ inline virtual std::string strHeader() const
+ {
+ StringOutStream oss;
+
+ strHeader( oss );
+
+ return( oss.str() );
+ }
+
+ virtual void strHeader(OutStream & os) const;
+
+ inline virtual void toStream(OutStream & os) const
+ {
+ if( isWProperty() )
+ {
+ toStreamWProperty(os);
+ }
+ else if( isWSequence() )
+ {
+ toStreamWSequence(os);
+ }
+ else
+ {
+ toStreamWObject(os);
+ }
+ }
+
+ void toStreamWProperty(OutStream & os) const;
+
+ inline void toStreamWSequence(OutStream & os) const
+ {
+ os << TAB/* << "sequence "*/ << getNameID();// << ":";
+
+ if( hasReallyUnrestrictedName() )
+ {
+ os << " '" << getUnrestrictedName() << "'";
+ }
+
+ toStreamOwnedElement( os << " " , "[" , "] // " + getNameID() );
+
+ os << EOL_FLUSH;
+ }
+
+ inline void toStreamWObject(OutStream & os) const
+ {
+ os << TAB;
+
+ if( hasQualifiedTypeNameID() )
+ {
+ os << getQualifiedTypeNameID() << " ";
+ }
+
+ os << getFullyQualifiedNameID(); //or getNameID();
+
+ if( hasReallyUnrestrictedName() )
+ {
+ os << " '" << getUnrestrictedName() << "'";
+ }
+
+ toStreamOwnedElement( os << " " , "{" , "} // " + getNameID() );
+
+ os << EOL_FLUSH;
+ }
+
+
+ void toStreamOwnedElement(OutStream & os,
+ const std::string & beginDelimiter = "{",
+ const std::string & endDelimiter = "}" ) const;
+
+};
+
+
+class WObjectManager
+{
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ Vector< WObject * > mTableOfManagedElement;
+
+ std::map< std::string , WObject * > mTableOfRegisteredWObject;
+
+public:
+ WObject ROOT_WOBJECT;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ WObjectManager(const std::string & fqnRoot)
+ : mTableOfManagedElement( ),
+ mTableOfRegisteredWObject( ),
+ ROOT_WOBJECT( *this , NULL, "virtual#root", "virtual#root" )
+ {
+ ROOT_WOBJECT.mFullyQualifiedNameID = fqnRoot;
+ }
+
+ /**
+ * DESTRUCTOR
+ * mOwnedElements
+ */
+ virtual ~WObjectManager()
+ {
+ destroyManagedElement();
+ }
+
+ /**
+ * DESTROY
+ */
+ void destroyManagedElement();
+
+ /**
+ * return FullyQualifiedNameID + '.' aNameID
+ */
+ std::string makeFQN(WObject * wfObject, const std::string & aNameID) const;
+
+
+ /**
+ * Manage WObject
+ */
+ inline WObject * manage(WObject * wfObject)
+ {
+ if( wfObject != WObject::_NULL_ )
+ {
+ wfObject->setOffset( mTableOfManagedElement.size() );
+
+ mTableOfManagedElement.append( wfObject );
+ }
+
+ return( wfObject );
+ }
+
+ /**
+ * Registered WObject
+ */
+ inline WObject * getRegisteredWObject(const std::string & key)
+ {
+ return( mTableOfRegisteredWObject[ key ] );
+ }
+
+ inline BF bfRegisteredWObject(const std::string & key)
+ {
+ return( toBF( mTableOfRegisteredWObject[ key ] ) );
+ }
+
+
+ inline void registerWObject(WObject * wfObject, const std::string & key)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( wfObject ) << "WObject !!!"
+ << SEND_EXIT;
+
+ mTableOfRegisteredWObject[ key ] = wfObject;
+ }
+
+ inline void registerWObject(WObject * wfObject)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( wfObject ) << "WObject !!!"
+ << SEND_EXIT;
+
+ mTableOfRegisteredWObject[
+ wfObject->getFullyQualifiedNameID() ] = wfObject;
+ }
+
+
+ /**
+ * Cast
+ */
+ inline static bool is(const BF & anElement)
+ {
+ return( anElement.is< WObject >() );
+ }
+
+ inline static WObject * from(const BF & anElement)
+ {
+ return( anElement.to_ptr< WObject >() );
+ }
+
+ inline static BF toBF(WObject * wfObject)
+ {
+ if( wfObject != WObject::_NULL_ )
+ {
+ wfObject->ObjectElement::incrRefCount();
+ }
+
+ return( BF( wfObject ) );
+ }
+
+
+ /**
+ * FACTORY
+ * create WObject
+ */
+ inline WObject * newWObject(WObject * wfContainer,
+ const std::string & aNameID)
+ {
+ WObject * wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_TYPED_KIND, aNameID );
+
+ return( manage( wfObject ) );
+ }
+
+
+ inline WObject * newWObject(WObject * wfContainer,
+ const std::string & aNameID, const std::string & aTypeNameID)
+ {
+ WObject * wfObject = new WObject( (*this), wfContainer,
+ aNameID, aTypeNameID );
+
+ return( manage( wfObject ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ // PROPERTY CREATION FACTORY
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline WObject * newWPropertyOperator(WObject * wfContainer,
+ const std::string & aNameID, Operator * anOperator)
+ {
+ WObject * wfObject = new WObject( (*this), wfContainer,
+ aNameID, anOperator );
+
+ return( manage( wfObject ) );
+ }
+
+ inline WObject * newWPropertyReference(WObject * wfContainer,
+ const std::string & aNameID, WObject * aWOjectReference)
+ {
+ WObject * wfObject = new WObject( (*this), wfContainer,
+ aNameID, aWOjectReference );
+
+ return( manage( wfObject ) );
+ }
+
+ inline WObject * newWPropertyArray(WObject * wfContainer,
+ const std::string & aNameID, const BF & value)
+ {
+ WObject * wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_PROPERTY_ARRAY_KIND, aNameID, value );
+
+ return( manage( wfObject ) );
+ }
+
+
+ inline WObject * newWProperty(
+ WObject * wfContainer, const std::string & aNameID)
+ {
+ WObject * wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_PROPERTY_KIND, aNameID );
+
+ return( manage( wfObject ) );
+ }
+
+ inline WObject * newWProperty(
+ WObject * wfContainer, const std::string & aNameID,
+ AVM_OPCODE aSpecifierOp, const BF & value)
+ {
+ WObject * wfObject = new WObject( (*this), wfContainer,
+ aNameID, aSpecifierOp, value );
+
+ return( manage( wfObject ) );
+ }
+
+
+ inline WObject * newWProperty(WObject * wfContainer,
+ const std::string & aNameID, const BF & value)
+ {
+ WObject * wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_PROPERTY_KIND, aNameID, value );
+
+ return( manage( wfObject ) );
+ }
+
+ inline WObject * newWProperty(WObject * wfContainer,
+ WObject::ENUM_WOBJECT_KIND aKind,
+ const std::string & aNameID, const BF & value)
+ {
+ WObject * wfObject = new WObject( (*this), wfContainer,
+ aKind, aNameID, value );
+
+ return( manage( wfObject ) );
+ }
+
+ WObject * newWPropertyExpression(WObject * wfContainer,
+ const std::string & aNameID, const BF & value);
+
+
+ WObject * newWPropertyBoolean(WObject * wfContainer,
+ const std::string & aNameID, bool aBooleanValue);
+
+ WObject * newWPropertyCharacter(WObject * wfContainer,
+ const std::string & aNameID, char aCharacterValue);
+
+ WObject * newWPropertyInteger(WObject * wfContainer,
+ const std::string & aNameID, avm_integer_t anIntegerValue);
+
+ WObject * newWPropertyInteger(WObject * wfContainer,
+ const std::string & aNameID, const std::string & anIntegerValue);
+
+ WObject * newWPropertyFloat(WObject * wfContainer,
+ const std::string & aNameID, double aFloatValue);
+
+ WObject * newWPropertyFloat(WObject * wfContainer,
+ const std::string & aNameID, const std::string & aFloatValue);
+
+ WObject * newWPropertySingleQuoteString(WObject * wfContainer,
+ const std::string & aNameID, const std::string & aStringValue);
+
+ WObject * newWPropertyDoubleQuoteString(WObject * wfContainer,
+ const std::string & aNameID, const std::string & aStringValue);
+
+ WObject * newWPropertyString(WObject * wfContainer,
+ const std::string & aNameID, const std::string & aStringValue);
+
+
+ WObject * newWPropertyIdentifier(WObject * wfContainer,
+ const std::string & aNameID, const std::string & aStringValue);
+
+ WObject * newWPropertyQualifiedIdentifier(WObject * wfContainer,
+ const std::string & aNameID, const std::string & aStringValue);
+
+
+ WObject * newWPropertyUniFormIdentifier(WObject * wfContainer,
+ const std::string & aNameID, UniFormIdentifier * anUFI);
+
+
+ WObject * newWPropertyParsedIdentifier(WObject * wfContainer,
+ const std::string & aNameID, const BF & value);
+
+
+ /**
+ * FACTORY
+ * create Group old Section
+ */
+ inline WObject * newWSequence(WObject * wfContainer,
+ const std::string & aNameID)
+ {
+ WObject * wfObject = new WObject( (*this), wfContainer,
+ WObject::WOBJECT_SEQUENCE_KIND, aNameID );
+
+ return( manage( wfObject ) );
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* FML_WORKFLOW_WOBJECT_H_ */
diff --git a/org.eclipse.efm.symbex/src/fml/workflow/WPropertyImpl.cpp b/org.eclipse.efm.symbex/src/fml/workflow/WPropertyImpl.cpp
new file mode 100644
index 0000000..f3fbd5b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/workflow/WPropertyImpl.cpp
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 24 mars 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "WPropertyImpl.h"
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/BuiltinArray.h>
+
+#include <fml/operator/Operator.h>
+
+#include <fml/workflow/WObject.h>
+
+
+namespace sep
+{
+
+
+/**
+ * GETTER - SETTER
+ * for AvmCode attribue
+ */
+const BFCode & WPropertyImpl::getAvmCodeValue() const
+{
+ return( getValue().bfCode() );
+}
+
+bool WPropertyImpl::hasAvmCodeValue() const
+{
+ return( getValue().is< AvmCode >() );
+}
+
+
+/**
+ * GETTER
+ * for BuiltinArray attribute
+ */
+BuiltinArray * WPropertyImpl::getBuiltinArrayValue() const
+{
+ return( getValue().as_ptr< BuiltinArray >() );
+}
+
+bool WPropertyImpl::hasBuiltinArrayValue() const
+{
+ return( getValue().is< BuiltinArray >() );
+}
+
+
+BF WPropertyImpl::getArrayValue() const
+{
+ if( getValue().is< ArrayBF >() )
+ {
+ return( getValue() );
+ }
+ else if( getValue().is< BuiltinArray >() )
+ {
+ return( BF( getValue().to_ptr< BuiltinArray >()->getArrayBF() ) );
+ }
+
+ return( BF::REF_NULL );
+}
+
+bool WPropertyImpl::hasArrayValue() const
+{
+ return( getValue().is< ArrayBF >() );
+}
+
+
+std::string WPropertyImpl::toStringValue(BuiltinArray * anArray, avm_size_t offset) const
+{
+ if( anArray->is< ArrayString >() )
+ {
+ return( anArray->to< ArrayString >()->get(offset) );
+
+ //!! No because of default quote char like: "string"
+// return( anArray->to< ArrayString >()->str(offset) );
+ }
+
+ else if( anArray->is< ArrayBF >() )
+ {
+ return( toStringValue( anArray->to< ArrayBF >()->at(offset) ) );
+ }
+
+ else if( getValue().is< BuiltinArray >() )
+ {
+ return( anArray->to< BuiltinArray >()->str(offset) );
+ }
+
+ else
+ {
+ return( toStringValue() );
+ }
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/fml/workflow/WPropertyImpl.h b/org.eclipse.efm.symbex/src/fml/workflow/WPropertyImpl.h
new file mode 100644
index 0000000..c9bea72
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/fml/workflow/WPropertyImpl.h
@@ -0,0 +1,229 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 24 mars 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef FML_WORKFLOW_WPROPERTYIMPL_H_
+#define FML_WORKFLOW_WPROPERTYIMPL_H_
+
+#include <common/BF.h>
+
+#include <fml/builtin/String.h>
+
+
+namespace sep
+{
+
+class AvmCode;
+class BFCode;
+
+class Operator;
+
+class WObject;
+
+
+class WPropertyImpl
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ WPropertyImpl()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~WPropertyImpl()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * API
+ * getValue()
+ */
+ virtual const BF & getValue() const = 0;
+
+ /**
+ * GETTER - SETTER
+ * getValue()
+ */
+
+ inline std::string strValue() const
+ {
+ return( getValue().str() );
+ }
+
+
+
+ /**
+ * GETTER - SETTER
+ * any Type Value
+ */
+ template<class T >
+ inline T * getValue() const
+ {
+ return( getValue().as_ptr< T >() );
+ }
+
+ template<class T >
+ inline bool hasValue() const
+ {
+ return( getValue().is< T >() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * for BOOLEAN attribue
+ */
+ inline bool getBooleanValue() const
+ {
+ return( getValue().toBoolean() );
+ }
+
+ /**
+ * GETTER - SETTER
+ * for CHARACTER attribue
+ */
+ char getCharacterValue() const
+ {
+ return( getValue().toCharacter() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * for INTEGER attribue
+ */
+ inline avm_integer_t getIntegerValue() const
+ {
+ return( getValue().toInteger() );
+ }
+
+ inline avm_int32_t getInt32Value() const
+ {
+ return( getValue().toInt32() );
+ }
+
+ inline avm_int64_t getInt64Value() const
+ {
+ return( getValue().toInt64() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * for FLOAT attribue
+ */
+ inline avm_float_t getFloatValue() const
+ {
+ return( getValue().toFloat() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * for STRING attribue
+ */
+ inline std::string getStringValue() const
+ {
+ return( getValue().toBuiltinString() );
+ }
+
+ inline bool hasStringValue() const
+ {
+ return( getValue().is< String >() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * for STRING_ID attribue
+ */
+ inline std::string getIdentifierValue() const
+ {
+ return( getValue().toIdentifier() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * for STRING_UFI attribue
+ */
+ inline std::string getUfiValue() const
+ {
+ return( getValue().toUfi() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * for AvmCode attribue
+ */
+ const BFCode & getAvmCodeValue() const;
+
+ bool hasAvmCodeValue() const;
+
+
+ /**
+ * GETTER
+ * for BuiltinArray attribute
+ */
+ BuiltinArray * getBuiltinArrayValue() const;
+
+ bool hasBuiltinArrayValue() const;
+
+ BF getArrayValue() const;
+
+ bool hasArrayValue() const;
+
+
+ inline std::string toStringValue(avm_size_t offset) const
+ {
+ return( toStringValue(getBuiltinArrayValue(), offset) );
+ }
+
+ std::string toStringValue(BuiltinArray * anArray, avm_size_t offset) const;
+
+
+ /**
+ * Serialization
+ */
+ inline static std::string toStringValue(const BF & aValue)
+ {
+ if( aValue.is< String >() )
+ {
+ return( aValue.to_ptr< String >()->getValue() );
+ }
+
+ return( aValue.str() );
+ }
+
+ inline virtual std::string toStringValue() const
+ {
+ return( toStringValue( getValue() ) );
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* FML_WORKFLOW_WPROPERTYIMPL_H_ */
diff --git a/org.eclipse.efm.symbex/src/main/AvmLauncher.cpp b/org.eclipse.efm.symbex/src/main/AvmLauncher.cpp
new file mode 100644
index 0000000..26f2971
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/main/AvmLauncher.cpp
@@ -0,0 +1,443 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmLauncher.h"
+
+#include <base/ClassKindInfo.h>
+
+#include <builder/Builder.h>
+#include <builder/Loader.h>
+
+#include <main/SignalHandler.h>
+
+#include <computer/EnvironmentFactory.h>
+
+#include <fam/api/ProcessorUnitRepository.h>
+
+#include <fml/executable/ExecutableLib.h>
+
+#include <fml/expression/ExpressionFactory.h>
+
+#include <fml/runtime/RuntimeLib.h>
+
+#include <fml/type/TypeManager.h>
+
+#include <solver/api/SolverDef.h>
+#include <solver/api/SolverFactory.h>
+
+#include <util/avm_string.h>
+#include <util/ExecutionTime.h>
+
+#include <boost/filesystem.hpp>
+
+#ifdef _AVM_BUILT_WITH_CMAKE_
+#include "version.h"
+#include "confs.h"
+#endif /*_AVM_BUILT_WITH_CMAKE_*/
+
+
+namespace sep
+{
+
+#define _SYMBEX_VERSION_ 3
+#define _SYMBEX_VERSION_MAJOR_ 6
+#define _SYMBEX_VERSION_PATCHLEVEL_ 0
+
+
+//const unsigned AvmLauncher::SUBVERSION_REVISION_NUMBER = 4838;
+//const std::string AvmLauncher::SUBVERSION_REVISION_STRING = "4838";
+
+
+#ifdef _GIT_VERSION_
+
+ #define GIT_VERSION _GIT_VERSION_
+
+#else
+
+// #define GIT_VERSION "\"$(shell git describe --always --tags)\""
+ #define GIT_VERSION "\"$(shell git rev-parse HEAD)\""
+
+#endif
+
+
+std::string AvmLauncher::SYMBEX_SCM_VERSION = GIT_VERSION;
+// OSS("") << _SYMBEX_VERSION_ << '.' << _SYMBEX_VERSION_MAJOR_;
+//// << '.' << _SYMBEX_VERSION_PATCHLEVEL_;
+
+std::string AvmLauncher::SYMBEX_BUILD_ID = GIT_VERSION;
+// SUBVERSION_REVISION_STRING;
+
+std::string AvmLauncher::SYMBEX_BUILD_INFO =
+ OSS("") << "Git-Version< " << SYMBEX_SCM_VERSION << " >";
+// OSS("") << "Version " << SYMBEX_SCM_VERSION
+// << " build " << SYMBEX_BUILD_ID;
+
+
+/**
+ * LOADER
+ */
+bool AvmLauncher::load()
+{
+ copyright();
+
+ if( getArgNumber() > 1 )
+ {
+ std::string arg;
+ for( avm_size_t i = 1 ; i < getArgNumber() ; ++i )
+ {
+ arg = getArgument( i );
+
+ if( arg[0] != '-' )
+ {
+ VFS::WorkflowPath = arg;
+ }
+ else if( (arg.find("--favm=") == 0) || (arg.find("--spec=") == 0) )
+ {
+ VFS::WorkflowPath =
+ arg.substr(std::strlen("--favm="), arg.size());
+ }
+ else if( (arg == "--favm") || (arg == "--spec") )
+ {
+ VFS::WorkflowPath = getArgument( ++i );
+ }
+
+ else if( arg == "--standalone" )
+ {
+ AVM_EXEC_MODE_SET( STANDALONE );
+ }
+ else if( (arg == "--server") || (arg == "-server") )
+ {
+ AVM_EXEC_MODE_SET( SERVER );
+ }
+ else if( arg == "--interactive" )
+ {
+ AVM_EXEC_MODE_SET( INTERACTIVE );
+ }
+
+ else if( arg.find("--log=") == 0 )
+ {
+ AVM_LOG_FILE_LOCATION =
+ arg.substr(std::strlen("--log="), arg.size());
+ }
+ else if( arg == "--log" )
+ {
+ AVM_LOG_FILE_LOCATION = getArgument( ++i );
+ }
+
+ else if( arg.find("--trace=") == 0 )
+ {
+ AVM_LOG_FILE_LOCATION =
+ arg.substr(std::strlen("--trace="), arg.size());
+ }
+ else if( arg == "--trace" )
+ {
+ AVM_TRACE_FILE_LOCATION = getArgument( ++i );
+ }
+
+ else if( arg.find("--debug=") == 0 )
+ {
+ avm_setDebugLevel(
+ arg.substr(std::strlen("--debug="), arg.size()) );
+ }
+ else if( arg == "--debug" )
+ {
+ avm_setDebugLevel( getArgument( ++i ) );
+ }
+
+ else if( arg == "--silent" )
+ {
+ AVM_EXEC_VERBOSITY_SET( MINIMUM );
+ }
+
+ else if( arg.find("--verbosity=") == 0 )
+ {
+ avm_setExecVerbosityLevel(
+ arg.substr(std::strlen("--verbosity="), arg.size()) );
+ }
+ else if( arg == "--verbosity" )
+ {
+ avm_setExecVerbosityLevel( getArgument( ++i ) );
+ }
+
+ else if( (arg == "--enabled-processors-list")
+ || (arg == "--enabled-fam-list") )
+ {
+ ProcessorUnitRepository::toStreamAll( AVM_OS_COUT );
+
+ ProcessorUnitRepository::toStreamExported( AVM_OS_COUT );
+ }
+ else if( arg == "--enabled-solvers-list" )
+ {
+ SolverDef::toStreamSolverList( AVM_OS_COUT );
+ }
+
+ else
+ {
+ AVM_OS_WARNING_ALERT
+ << "Unknown AVM launch option << " << arg << " >> !!!"
+ << SEND_ALERT;
+ }
+ }
+ }
+ else
+ {
+ usage();
+
+ ::exit(1);
+ }
+
+ /*
+ * LOAD
+ * Predefined FORM
+ */
+ XLIA_SYNTAX::load();
+
+ ExpressionFactory::load();
+
+ // after loading parameter...
+ // SolverFactory::load();
+
+ TypeManager::load();
+
+
+ EnvironmentFactory::load();
+
+ Builder::load();
+
+ ExecutableLib::load();
+
+ RuntimeLib::load();
+
+
+ mWorkflow.load();
+
+ avm_report(AVM_OS_LOG, "AvmLauncher::load at the end");
+
+ return( true );
+}
+
+
+/**
+ * DISPOSER
+ */
+void AvmLauncher::dispose()
+{
+ EnvironmentFactory::dispose();
+
+ SolverFactory::dispose();
+
+
+ mWorkflow.dispose();
+
+
+ RuntimeLib::dispose();
+
+ ExecutableLib::dispose();
+
+ Builder::dispose();
+
+
+ TypeManager::dispose();
+
+ ExpressionFactory::dispose();
+
+ XLIA_SYNTAX::dispose();
+
+ copyright();
+}
+
+
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+void AvmLauncher::copyright()
+{
+ AVM_OS_COUT << std::endl << AVM_TAB1_INDENT
+ << TAB << "SYMBEX< DIVERSITY > "
+
+#ifndef _AVM_BUILT_WITH_CMAKE_
+
+ << SYMBEX_BUILD_INFO
+#else
+ << sources_commit_id << " built on " << system_name
+
+#endif /*_BUILT_WITH_CMAKE_*/
+
+ << " @ " << __DATE__ << std::endl
+ << TAB << "2010 - 2016 CEA List" << std::endl
+// << TAB << "1998 - 2013 CEA List" << std::endl
+ << TAB << "All Rights Reserved" << std::endl
+ << TAB << "Launch @ " << ExecutionTime::current_time()
+ << std::endl << END_INDENT;
+}
+
+
+/**
+ * AvmLauncher::usage
+ *
+ */
+void AvmLauncher::usage()
+{
+ AVM_OS_LOG << " Usage :> avm.exe parameterfile (in FAVM format)" << std::endl;
+
+ std::cin.get();
+}
+
+
+/**
+ * AvmLauncher::start
+ *
+ */
+void AvmLauncher::start()
+{
+ /*
+ * INITIALIZATION
+ * parameter FORM
+ */
+ if( not mWorkflow.loadConfiguration(VFS::WorkflowPath) )
+ {
+ return;
+ }
+
+ SolverFactory::load();
+
+ /*
+ * RUNNING
+ * parameter FORM
+ */
+ try
+ {
+ SignalHandler::setSIGINT_handler();
+
+ if( mWorkflow.configure() )
+ {
+ mWorkflow.startComputing();
+ }
+ }
+ catch ( const std::exception & e )
+ {
+ AVM_OS_WARN << std::endl << EMPHASIS(
+ "AvmLauncher::start< std::exception >", e.what(), '*', 80);
+ }
+ catch ( ... )
+ {
+ AVM_OS_WARN << std::endl << EMPHASIS(
+ "AvmLauncher::start< unknown::exception > !!!", '*', 80);
+ }
+}
+
+
+int AvmLauncher::run( int argc , char * argv[] )
+{
+ if( argv != NULL )
+ {
+ VFS::ExecutablePath = argv[0];
+ }
+ VFS::LaunchPath = boost::filesystem::current_path().string();
+
+ ClassKindInfoInitializer::load();
+
+ std::string strAction = " The AvmLauncher::main";
+
+ OutStream::load();
+
+ try
+ {
+ sep::AvmLauncher theAvmLauncher(
+ (argc < 0)? 0 : static_cast< avm_size_t >(argc) , argv);
+
+ strAction = " The AvmLauncher::load";
+ if( theAvmLauncher.load() )
+ {
+ switch( _AVM_EXEC_MODE_ )
+ {
+ case AVM_EXEC_STANDALONE_MODE:
+ case AVM_EXEC_SERVER_MODE:
+ case AVM_EXEC_INTERACTIVE_MODE:
+ default:
+ {
+ if( not VFS::WorkflowPath.empty() )
+ {
+ VFS::WorkflowPath = VFS::native_path(
+ VFS::WorkflowPath, VFS::LaunchPath);
+
+ if( VFS::checkReadingFile( VFS::WorkflowPath ) )
+ {
+ strAction = " TheAvmLauncher::start";
+
+ theAvmLauncher.start();
+
+ avm_report(AVM_OS_LOG,
+ "AvmLauncher::run after this.start()");
+ }
+ else
+ {
+ AVM_OS_CERR << _SEW_ << "< error >"
+ " Unreadable or non-existent file !"
+ << std::endl
+ << _SEW_ << "< info > Launch path : "
+ << VFS::LaunchPath << std::endl;
+
+ avm_set_exit_code( AVM_EXIT_CONFIGURE_ERROR_CODE );
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ strAction = " The AvmLauncher::dispose";
+
+ theAvmLauncher.dispose();
+ }
+ catch ( const std::exception & e )
+ {
+ AVM_OS_WARN << std::endl << EMPHASIS(
+ (strAction + "< std::exception > "), e.what(), '*', 80);
+ }
+ catch ( ... )
+ {
+ AVM_OS_WARN << std::endl << EMPHASIS(
+ (strAction + "< unknown::exception > !!!"), '*', 80);
+ }
+
+
+ avm_report(AVM_OS_LOG, "::main at the end");
+
+AVM_IF_DEBUG_FLAG( REFERENCE_COUNTING )
+
+ avm_report(AVM_OS_COUT, "::main at the end");
+
+AVM_ENDIF_DEBUG_FLAG( REFERENCE_COUNTING )
+
+
+ OutStream::dispose();
+
+ ClassKindInfoInitializer::dispose();
+
+ AVM_OS_COUT << exit_msg( _AVM_EXIT_CODE_ );
+
+ return( _AVM_EXIT_CODE_ );
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/main/AvmLauncher.h b/org.eclipse.efm.symbex/src/main/AvmLauncher.h
new file mode 100644
index 0000000..c8d1347
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/main/AvmLauncher.h
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef MAIN_LAUNCHER_H_
+#define MAIN_LAUNCHER_H_
+
+#include <util/avm_util.h>
+
+#include <sew/Workflow.h>
+
+
+namespace sep
+{
+
+
+class AvmLauncher
+{
+
+protected :
+ /**
+ * ATTRIBUTES
+ */
+ avm_size_t mArgNumber;
+ char * * mArgument;
+
+ Workflow mWorkflow;
+
+
+public :
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmLauncher( avm_size_t argc , char * argv[] )
+ : mArgNumber( argc ),
+ mArgument( argv ),
+ mWorkflow( SYMBEX_BUILD_ID )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AvmLauncher()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * LOADER - DISPOSER
+ */
+ bool load();
+ void dispose();
+
+
+ /*METHODS*/
+ static void copyright();
+ static void usage();
+
+ void start();
+
+
+ /*ATTRIBUTES*/
+// static const unsigned SUBVERSION_REVISION_NUMBER;
+// static const std::string SUBVERSION_REVISION_STRING;
+
+ static std::string SYMBEX_SCM_VERSION;
+ static std::string SYMBEX_BUILD_ID;
+
+ static std::string SYMBEX_BUILD_INFO;
+
+ /**
+ * GETTER - SETTER
+ * mArgument
+ */
+ inline avm_size_t getArgNumber()
+ {
+ return( mArgNumber );
+ }
+
+ inline char * getArgument(avm_size_t index)
+ {
+ AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( index , mArgNumber ) << SEND_EXIT;
+
+ return( mArgument[index] );
+ }
+
+ /**
+ * run
+ */
+ static int run( int argc , char * argv[] );
+
+};
+
+
+} /* namespace sep */
+
+#endif /* MAIN_LAUNCHER_H_ */
diff --git a/org.eclipse.efm.symbex/src/main/AvmMain.cpp b/org.eclipse.efm.symbex/src/main/AvmMain.cpp
new file mode 100644
index 0000000..b2018ed
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/main/AvmMain.cpp
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 24 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmMain.h"
+
+#include "AvmLauncher.h"
+
+
+namespace sep
+{
+
+int AvmMain::run( int argc , char * argv[] )
+{
+ return( sep::AvmLauncher::run(argc , argv) );
+}
+
+
+
+}
+
diff --git a/org.eclipse.efm.symbex/src/main/AvmMain.h b/org.eclipse.efm.symbex/src/main/AvmMain.h
new file mode 100644
index 0000000..6e1d43c
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/main/AvmMain.h
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 24 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVMMAIN_H_
+#define AVMMAIN_H_
+
+namespace sep
+{
+
+
+class AvmMain
+{
+
+public:
+ static int run( int argc , char * argv[] );
+
+};
+
+
+} /* namespace sep */
+
+#endif /* AVMMAIN_H_ */
diff --git a/org.eclipse.efm.symbex/src/main/README.md b/org.eclipse.efm.symbex/src/main/README.md
new file mode 100644
index 0000000..bd23a86
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/main/README.md
@@ -0,0 +1,10 @@
+# EFM-SYMBEX : Main CPP
+
+## Source code structure
+
+### Interfaces
+
+### Classes
+
+### Factories
+
diff --git a/org.eclipse.efm.symbex/src/main/SignalHandler.cpp b/org.eclipse.efm.symbex/src/main/SignalHandler.cpp
new file mode 100644
index 0000000..065e2e5
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/main/SignalHandler.cpp
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include <csignal>
+
+#include "SignalHandler.h"
+
+#include <printer/OutStream.h>
+
+
+namespace sep
+{
+
+bool SignalHandler::SIGNAL_INTERRUPT_FLAG = false;
+
+
+/**
+ * SignalHandler::SIGINT_handler
+ *
+ */
+void SignalHandler::SIGINT_handler(int nFlag)
+{
+ setSIGINT();
+
+ AVM_OS_WARN << std::endl << EMPHASIS(
+ "SIGINT::handler< CTRL-C INTERRUPTION >", '*', 80);
+}
+
+/**
+ * SignalHandler::setSIGINT_handler
+ *
+ */
+void SignalHandler::setSIGINT_handler()
+{
+ clearSIGINT();
+
+#ifdef __AVM_UNIX__
+
+ static struct ::sigaction SIGINT_action;
+ ::sigemptyset( & SIGINT_action.sa_mask );
+ SIGINT_action.sa_flags = 0;
+
+ SIGINT_action.sa_handler = SIGINT_handler;
+
+ /* Register the handler for SIGINT. */
+ ::sigaction(SIGINT, &SIGINT_action, 0);
+
+// ::sigaction(SIGCONT, &SIGINT_action, 0);
+
+#endif /* __AVM_UNIX__ */
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/main/SignalHandler.h b/org.eclipse.efm.symbex/src/main/SignalHandler.h
new file mode 100644
index 0000000..804cc77
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/main/SignalHandler.h
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef MAIN_SIGNALHANDLER_H_
+#define MAIN_SIGNALHANDLER_H_
+
+
+namespace sep
+{
+
+class SignalHandler
+{
+
+private :
+ /**
+ * ATTRIBUTES
+ */
+ static bool SIGNAL_INTERRUPT_FLAG;
+
+public :
+ static bool SIGNAL_QUIT_FLAG;
+
+
+ /**
+ * clearSIGINT
+ *
+ */
+ inline static void clearSIGINT()
+ {
+ SIGNAL_INTERRUPT_FLAG = false;
+ }
+
+ /**
+ * isSIGINT
+ *
+ */
+ inline static bool isSIGINT()
+ {
+ return( SIGNAL_INTERRUPT_FLAG );
+ }
+
+ /**
+ * setSIGINT
+ *
+ */
+ inline static void setSIGINT()
+ {
+ SIGNAL_INTERRUPT_FLAG = true;
+ }
+
+ static void SIGINT_handler(int nFlag);
+
+ static void setSIGINT_handler();
+
+};
+
+
+}
+
+#endif /* MAIN_SIGNALHANDLER_H_ */
diff --git a/org.eclipse.efm.symbex/src/main/main.cpp b/org.eclipse.efm.symbex/src/main/main.cpp
new file mode 100644
index 0000000..6df54f4
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/main/main.cpp
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 24 janv. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "AvmMain.h"
+
+
+/**********************************************************************
+ ** **
+ ** main **
+ ** **
+ **********************************************************************/
+
+
+int main( int argc , char * argv[] )
+{
+ return( sep::AvmMain::run(argc , argv) );
+}
+
diff --git a/org.eclipse.efm.symbex/src/main/version.h.in b/org.eclipse.efm.symbex/src/main/version.h.in
new file mode 100644
index 0000000..9f8ea0f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/main/version.h.in
@@ -0,0 +1,31 @@
+/*
+ * version.h
+ *
+ * Created on: 26 mai 2016
+ * Author: ss219326
+ */
+
+/* Warning : this file is needed by CMake to generate version.h
+ * Expression @..@ are variables identifiers replaced by CMake at
+ * configure time by their actual values.
+ *
+ * The resulting version.h can be included anywhere there is a need
+ * to access the commit-id string
+ */
+
+#ifndef MAIN_VERSION_H_IN_
+#define MAIN_VERSION_H_IN_
+
+
+#include <string>
+
+using namespace std;
+
+namespace sep {
+
+const string sources_commit_id("@GIT_COMMIT_ID@");
+
+} /* namespace sep */
+
+
+#endif /* MAIN_VERSION_H_IN_ */
diff --git a/org.eclipse.efm.symbex/src/parser/CMakeLists.txt b/org.eclipse.efm.symbex/src/parser/CMakeLists.txt
new file mode 100644
index 0000000..fca1649
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/parser/CMakeLists.txt
@@ -0,0 +1,25 @@
+# =============================================================================
+# CMake file for the Parser library
+# =============================================================================
+
+
+# Source files to take into account (all files matching patterns, recursively)
+file (GLOB_RECURSE PARSER_CXX_SRC_FILES *.cpp *.h *.c)
+file (GLOB_RECURSE PARSER_C_SRC_FILES *.c)
+
+# Awfull hack to force C++ compilation (this C file actually includes a <algorithm> TL header...)
+# TODO : Fix this in sources
+set_source_files_properties (${PARSER_C_SRC_FILES} PROPERTIES LANGUAGE CXX )
+
+# Target to build
+add_library (parser STATIC ${PARSER_CXX_SRC_FILES})
+
+# Include directories (internal)
+target_include_directories (parser PUBLIC ..) # FIXME : explicit the dependencies lib by lib
+
+# Target include directories (external)
+target_include_directories (parser PUBLIC ${ANTLR_INCLUDE_DIR} ${ANTLR3C_INCLUDE_DIR})
+
+
+add_dependencies(parser rescan_cvc4)
+add_dependencies(parser rescan_antlr2)
diff --git a/org.eclipse.efm.symbex/src/parser/ParserManager.cpp b/org.eclipse.efm.symbex/src/parser/ParserManager.cpp
new file mode 100644
index 0000000..0b4aab9
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/parser/ParserManager.cpp
@@ -0,0 +1,271 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ParserManager.h"
+
+#include <antlr/ANTLRException.hpp>
+
+
+#include <fml/infrastructure/System.h>
+#include <fml/workflow/WObject.h>
+
+#include <parser/workflow/WorkflowLexer.hpp>
+#include <parser/workflow/WorkflowParser.hpp>
+
+#include <parser/model/fmlLexer.h>
+#include <parser/model/fmlParser.h>
+#include <parser/model/ParserUtil.h>
+
+#include <printer/OutStream.h>
+
+#include <util/avm_vfs.h>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+ParserManager::ParserManager(const std::string & fileLocation)
+: mFileLocation( fileLocation ),
+mFilename( VFS::filename( fileLocation ) ),
+
+mErrorCount( 0 ),
+mWarningCount( 0 ),
+mExceptionMessage( )
+{
+ //!! NOTHING
+}
+
+
+/**
+ * ParserManager::start
+ *
+ */
+System * ParserManager::parseFML(WObjectManager & aWObjectManager)
+{
+ System * theParseSpec = NULL;
+
+ mErrorCount = 0;
+
+ if( mFileLocation.empty() )
+ {
+ AVM_OS_WARN << _SEW_
+ << "< error > Unexpected an empty specification file location !"
+ << std::endl;
+
+ return( NULL );
+ }
+
+ std::ifstream anInputStream( mFileLocation.c_str() );
+
+ if( anInputStream.fail() )
+ {
+ AVM_OS_WARN << _SEW_
+ << "< error > Cannot open file '"
+ << mFileLocation << "'." << std::endl;
+
+ avm_set_exit_code( AVM_EXIT_PARSING_ERROR_CODE );
+
+ return( NULL );
+ }
+
+ try
+ {
+ if( (mFileLocation.rfind(".xfml") != std::string::npos) ||
+ (mFileLocation.rfind(".fml" ) != std::string::npos) ||
+ (mFileLocation.rfind(".xlia") != std::string::npos) ||
+ (mFileLocation.rfind(".xfsp") != std::string::npos) ||
+ (mFileLocation.rfind(".lia" ) != std::string::npos) )
+ {
+ theParseSpec = parseFML(aWObjectManager, anInputStream);
+ }
+
+ if( theParseSpec == NULL )
+ {
+ AVM_OS_WARN << _SEW_
+ << "< error > NO PARSING RESULT !" << std::endl;
+
+ avm_set_exit_code( AVM_EXIT_PARSING_ERROR_CODE );
+
+ return( NULL );
+ }
+ }
+ catch( antlr::ANTLRException & e )
+ {
+ AVM_OS_WARN << _SEW_ << e.toString() << std::endl;
+
+ avm_set_exit_code( AVM_EXIT_PARSING_ERROR_CODE );
+
+ return( NULL );
+ }
+
+ return( theParseSpec );
+}
+
+
+/**
+ * ParserManager::parseXLIA
+ *
+ */
+System * ParserManager::parseFML(
+ WObjectManager & aWObjectManager, std::ifstream & anInputStream)
+{
+ ///!!! The Return Variable Value *!*
+ System * theParseSpec = NULL;
+
+ mErrorCount = 0;
+ ParserUtil::XLIA_SYNTAX_ERROR_COUNT = 0;
+
+ pANTLR3_UINT8 path;
+ pANTLR3_INPUT_STREAM input;
+ pfmlLexer lexer;
+
+ pANTLR3_COMMON_TOKEN_STREAM tstream;
+ //
+ pfmlParser parser;
+
+ path = (pANTLR3_UINT8) mFileLocation.c_str();
+ input = antlr3FileStreamNew(path, ANTLR3_ENC_8BIT);
+ //input = antlr3AsciiFileStreamNew(path);
+
+ if( input == NULL)
+ {
+ AVM_OS_WARN << _SEW_
+ << "< error > Failed to open file '"
+ << mFileLocation << "'" << std::endl;
+
+ ++mErrorCount;
+ avm_set_exit_code( AVM_EXIT_FAILED_CODE );
+ }
+
+ // CLexerNew is generated by ANTLR
+ lexer = fmlLexerNew(input);
+ // Need to check for errors ANTLR3_ERR_NOMEM
+ AVM_OS_ASSERT_OUT_OF_MEMORY_EXIT( lexer )
+ << "Unable to create the lexer due to malloc() failure"
+ << SEND_EXIT;
+
+ // CStreamNew is generated by ANTLR3
+ tstream = antlr3CommonTokenStreamSourceNew(
+ ANTLR3_SIZE_HINT, TOKENSOURCE(lexer));
+ // Need to check for errors ANTLR3_ERR_NOMEM
+ AVM_OS_ASSERT_OUT_OF_MEMORY_EXIT( tstream )
+ << "Out of memory trying to allocate token stream"
+ << SEND_EXIT;
+
+ // CParserNew is generated by ANTLR3
+ parser = fmlParserNew(tstream);
+ // Need to check for errors ANTLR3_ERR_NOMEM
+ AVM_OS_ASSERT_OUT_OF_MEMORY_EXIT( parser )
+ << "Out of memory trying to allocate parser\n"
+ << SEND_EXIT;
+
+
+ AVM_OS_VERBOSITY_MINIMUM( AVM_OS_CLOG ) << _SEW_
+ << "Parsing: " << mFilename << " ..." << std::endl;
+
+ theParseSpec = parser->formalML(parser, aWObjectManager);
+
+ mErrorCount = parser->pParser->rec->state->errorCount +
+ ParserUtil::XLIA_SYNTAX_ERROR_COUNT;
+
+ AVM_OS_VERBOSITY_MINIMUM( AVM_OS_CLOG ) << _SEW_
+ << "Done ==> " << mErrorCount << " syntax error"
+ << ((mErrorCount > 1)? "s" : "") << " found."
+ << std::endl;
+
+
+ // We did not return anything from this parser rule, so we can finish.
+ // It only remains to close down our open objects, in the reverse order
+ // we created them
+ //
+ parser->free(parser);
+ parser = NULL;
+
+ tstream ->free(tstream);
+ tstream = NULL;
+ lexer->free(lexer);
+ lexer = NULL;
+
+ input->close(input);
+ input = NULL;
+
+ if( mErrorCount > 0 )
+ {
+ avm_set_exit_code( AVM_EXIT_PARSING_ERROR_CODE );
+ }
+
+ return( theParseSpec );
+}
+
+
+/**
+ * parse Symbolic Execution Workflow
+ *
+ */
+WObject * ParserManager::parseSEW(
+ WObjectManager & aWObjectManager, std::ifstream & anInputStream)
+{
+ WObject * theParseParam = WObject::_NULL_;
+
+ mErrorCount = 0;
+
+ try
+ {
+ WorkflowLexer lexer( anInputStream );
+ WorkflowParser parser( lexer );
+
+ lexer.setFilename( mFilename );
+ parser.setFilename( mFilename );
+
+ lexer.resetErrors();
+ parser.resetErrors();
+
+// AVM_OS_VERBOSITY_MINIMUM( AVM_OS_CLOG ) << _SEW_
+// << "Parsing: " << mFilename << " ..." << std::endl;
+
+ theParseParam = parser.form_grammar( aWObjectManager );
+
+ mErrorCount = lexer.numberOfErrors() + parser.numberOfErrors();
+
+// AVM_OS_VERBOSITY_MINIMUM( AVM_OS_CLOG ) << _SEW_
+// << "Done ==> " << mErrorCount << " syntax error"
+// << ((mErrorCount > 1)? "s" : "") << " found."
+// << std::endl;
+
+ if( mErrorCount > 0 )
+ {
+ avm_set_exit_code( AVM_EXIT_PARSING_ERROR_CODE );
+ }
+ }
+ catch( antlr::ANTLRException & e )
+ {
+ mExceptionMessage = e.toString();
+
+ if( mErrorCount == 0 )
+ {
+ ++mErrorCount;
+ }
+
+ avm_set_exit_code( AVM_EXIT_PARSING_EXCEPTION_CODE );
+ }
+
+ return( theParseParam );
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/parser/ParserManager.h b/org.eclipse.efm.symbex/src/parser/ParserManager.h
new file mode 100644
index 0000000..dae6b4a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/parser/ParserManager.h
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef PARSER_PARSERMANAGER_H_
+#define PARSER_PARSERMANAGER_H_
+
+#include <fstream>
+
+
+namespace sep
+{
+
+
+class System;
+
+class WObject;
+class WObjectManager;
+
+
+class ParserManager
+{
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ std::string mFileLocation;
+ std::string mFilename;
+
+ std::size_t mErrorCount;
+
+ std::size_t mWarningCount;
+
+ std::string mExceptionMessage;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ParserManager(const std::string & fileLocation);
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~ParserManager()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * mErrorCount
+ */
+ inline std::size_t getErrorCount() const
+ {
+ return( mErrorCount );
+ }
+
+ inline bool hasSyntaxError() const
+ {
+ return( mErrorCount > 0 );
+ }
+
+ inline bool hasNoSyntaxError() const
+ {
+ return( mErrorCount == 0 );
+ }
+
+ /**
+ * mWarningCount
+ */
+ inline std::size_t getWarningCount() const
+ {
+ return( mWarningCount );
+ }
+
+ inline bool hasSyntaxWarning() const
+ {
+ return( mWarningCount > 0 );
+ }
+
+
+ /**
+ * mWarningCount
+ */
+ inline const std::string & getExceptionMessage() const
+ {
+ return( mExceptionMessage );
+ }
+
+ inline bool hasExceptionMessage() const
+ {
+ return( not mExceptionMessage.empty() );
+ }
+
+
+ /**
+ * Parse FML, xLIA
+ */
+ System * parseFML(WObjectManager & aWObjectManager);
+
+ System * parseFML(WObjectManager & aWObjectManager,
+ std::ifstream & anInputStream);
+
+ /**
+ * Parse SEW, FAVM
+ */
+ WObject * parseSEW(WObjectManager & aWObjectManager,
+ std::ifstream & anInputStream);
+
+};
+
+
+}
+
+#endif /*PARSER_PARSERMANAGER_H_*/
diff --git a/org.eclipse.efm.symbex/src/parser/README.md b/org.eclipse.efm.symbex/src/parser/README.md
new file mode 100644
index 0000000..7cae89d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/parser/README.md
@@ -0,0 +1,10 @@
+# EFM-SYMBEX : Parser
+
+## Source code structure
+
+### Interfaces
+
+### Classes
+
+### Factories
+
diff --git a/org.eclipse.efm.symbex/src/parser/model/ParserUtil.cpp b/org.eclipse.efm.symbex/src/parser/model/ParserUtil.cpp
new file mode 100644
index 0000000..a7f516f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/parser/model/ParserUtil.cpp
@@ -0,0 +1,2145 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 9 juil. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "ParserUtil.h"
+
+#include <fml/common/LocationElement.h>
+#include <fml/common/ObjectElement.h>
+#include <fml/common/SpecifierElement.h>
+#include <fml/common/TraceableElement.h>
+
+#include <fml/executable/ExecutableLib.h>
+#include <fml/executable/InstanceOfMachine.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/BuiltinArray.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/StatementConstructor.h>
+
+#include <fml/lib/AvmOperationFactory.h>
+#include <fml/lib/IComPoint.h>
+
+#include <fml/operator/Operator.h>
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/type/TypeManager.h>
+
+#include <fml/infrastructure/Buffer.h>
+#include <fml/infrastructure/Channel.h>
+#include <fml/infrastructure/DataType.h>
+#include <fml/infrastructure/InstanceSpecifierPart.h>
+#include <fml/infrastructure/Machine.h>
+#include <fml/infrastructure/Package.h>
+#include <fml/infrastructure/Port.h>
+#include <fml/infrastructure/Routine.h>
+#include <fml/infrastructure/Transition.h>
+#include <fml/infrastructure/Variable.h>
+
+#include <fml/infrastructure/BehavioralPart.h>
+#include <fml/infrastructure/CompositePart.h>
+#include <fml/infrastructure/PropertyPart.h>
+
+#include <sew/Workflow.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+// XLIA MACRO
+////////////////////////////////////////////////////////////////////////////////
+
+#define OP(op) OperatorManager::OPERATOR_##op
+
+#define NEW_ID(id) sep::ExpressionConstructor::newIdentifier(id)
+
+#define NEW_UFID(qnid, nb) ( (nb > 1) ? \
+ ExpressionConstructor::newQualifiedIdentifier(qnid) : \
+ ExpressionConstructor::newIdentifier(qnid) )
+
+#define NEW_INSTANCE_UFID(machine, var) \
+ ExpressionConstructor::newQualifiedIdentifier( \
+ OSS() << machine->getNameID() << '.' << var->getNameID() )
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Current Parse Context :
+// System -> Machine -> Routine
+////////////////////////////////////////////////////////////////////////////////
+
+ParserUtil::AvmParseContext ParserUtil::_CTX_;
+
+std::stack< ParserUtil::AvmParseContext > ParserUtil::_CTX_STACK_;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// XLIA_SYNTAX_ERROR_COUNT
+////////////////////////////////////////////////////////////////////////////////
+
+avm_size_t ParserUtil::XLIA_SYNTAX_ERROR_COUNT = 0;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// SET LOCATION IN TRACEABLE FORM
+////////////////////////////////////////////////////////////////////////////////
+
+void ParserUtil::setLocation(TraceableElement * aTraceableElement,
+ avm_size_t bLine, avm_size_t eLine)
+{
+ if( aTraceableElement != NULL)
+ {
+ ParserUtil::setLocation( *aTraceableElement, bLine, eLine );
+ }
+}
+
+void ParserUtil::setLocation(TraceableElement & aTraceableElement,
+ avm_size_t bLine, avm_size_t eLine)
+{
+ if( not aTraceableElement.hasLocation() )
+ {
+ aTraceableElement.setLocation( new LocationElement() );
+ }
+ aTraceableElement.getLocation()->setLine( bLine , eLine );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// PROLOGUE OPTION
+////////////////////////////////////////////////////////////////////////////////
+
+void ParserUtil::setPrologueOption(const std::string & id, BF value)
+{
+ Workflow::INSTANCE->setPrologueOption(id, value);
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// GET VARIABLE BY [ [ Fully ] Qualified ] Name ID
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+const BF & ParserUtil::getObjectByNameID(const std::string & aNameID)
+{
+ if( _CTX_.routine != NULL )
+ {
+ const BF & var = _CTX_.routine->getParamReturn(aNameID);
+ if( var.valid() )
+ {
+ return( var );
+ }
+ }
+
+ {
+ const BF & form = _CTX_.machine->getsemFormByNameID(aNameID);
+ if( form.valid() )
+ {
+ return( form );
+ }
+ }
+
+ return( BF::REF_NULL );
+// return( NEW_ID(aNameID) );
+}
+
+
+const BF & ParserUtil::getObjectByQualifiedNameID(const std::string & qnid, avm_size_t count)
+{
+ if( count == 1 )
+ {
+ return( getObjectByNameID(qnid) );
+ }
+ else
+ {
+ const BF & form = _CTX_.machine->getPropertyByQualifiedNameID(qnid);
+ if( form.valid() )
+ {
+ return( form );
+ }
+ }
+
+ return( BF::REF_NULL );
+// return( NEW_UFID(qnid, count) );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// GET VARIABLE BY [ [ Fully ] Qualified ] Name ID
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+const BF & ParserUtil::getvar(const std::string & qnid, avm_size_t count)
+{
+ if( count > 1 )
+ {
+ const BF & var = _CTX_.machine->getrecVariable(qnid);
+ if( var.valid() )
+ {
+ return( var );
+ }
+ }
+ else
+ {
+ if( _CTX_.routine != NULL )
+ {
+ const BF & var = _CTX_.routine->getParamReturn(qnid);
+ if( var.valid() )
+ {
+ return( var );
+ }
+ }
+
+ {
+ const BF & var = _CTX_.machine->getsemVariable(qnid);
+ if( var.valid() )
+ {
+ return( var );
+ }
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+BF ParserUtil::getVariable(const std::string & qnid, avm_size_t count)
+{
+ const BF & var = getvar(qnid, count);
+ if( var.valid() )
+ {
+ return( var );
+ }
+ else
+ {
+ AVM_OS_WARN << "Error:> unfound variable< " << qnid
+ << " > in " << str_header( _CTX_.machine ) << " !!!"
+ << std::endl;
+ ++XLIA_SYNTAX_ERROR_COUNT;
+
+ return( BF( new Variable(_CTX_.machine,
+ Modifier::PROPERTY_UNDEFINED_MODIFIER,
+ TypeManager::INTEGER, qnid) ) );
+ }
+
+ return( var );
+}
+
+
+BF ParserUtil::getDataType(const std::string & qnid, avm_size_t count)
+{
+ const BF & var = ( count > 1 )
+ ? _CTX_.machine->getrecDataType(qnid)
+ : _CTX_.machine->getsemDataType(qnid);
+
+ if( var.valid() )
+ {
+ return( var );
+ }
+
+ AVM_OS_WARN << "Error:> unfound typedef " << qnid
+ << " > in " << str_header( _CTX_.machine ) << " !!!"
+ << std::endl;
+ ++XLIA_SYNTAX_ERROR_COUNT;
+
+ return( BF( new Variable(_CTX_.machine,
+ Modifier::PROPERTY_UNDEFINED_MODIFIER,
+ TypeManager::INTEGER, qnid) ) );
+}
+
+BF ParserUtil::getDataTypeQueue(const std::string & qnid, avm_size_t count)
+{
+ if( count > 1 )
+ {
+ const BF & var = _CTX_.machine->getrecDataType(qnid);
+ if( var.is< DataType >()
+ && var.to_ptr< DataType >()->hasTypeQueue() )
+ {
+ return( var );
+ }
+ }
+ else
+ {
+ const BF & var = _CTX_.machine->getsemDataType(qnid);
+ if( var.is< DataType >()
+ && var.to_ptr< DataType >()->hasTypeQueue() )
+ {
+ return( var );
+ }
+ }
+
+ AVM_OS_WARN << "Error:> unexpected a non-queue variable< " << qnid
+ << " > in " << str_header( _CTX_.machine ) << " !!!"
+ << std::endl;
+ ++XLIA_SYNTAX_ERROR_COUNT;
+
+ return( BF( DataType::newContainer(
+ _CTX_.machine, qnid, TYPE_FIFO_SPECIFIER, 1) ) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// GET CONSTANT BY [ [ Fully ] Qualified ] Name ID
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+const BF & ParserUtil::getConstant(
+ const std::string & qnid, avm_size_t count)
+{
+ const BF & var = getvar(qnid, count);
+ if( var.valid() && var.to_ptr< Variable >()->getModifier().hasFeatureFinal() )
+ {
+ return( var );
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+avm_size_t ParserUtil::getIntegerConstant(
+ const std::string & qnid, avm_size_t count)
+{
+ const BF & var = getvar(qnid, count);
+ if( var.valid() )
+ {
+ Variable * pVar = var.to_ptr< Variable >();
+
+ if( pVar->getModifier().hasFeatureFinal() && pVar->hasValue() &&
+ pVar->getValue().isWeakInteger() )
+ {
+ return( pVar->getValue().toInteger() );
+ }
+ }
+
+ avm_syntax_error( "integer_constant (...)" )
+ << "unfound the integer constant Qualified Name ID< " << qnid
+ << " > from the machine< "
+ << _CTX_.machine->getFullyQualifiedNameID() << " >"
+ << SYNTAX_ERROR_EOL;
+
+ return( 0 );
+}
+
+
+avm_float_t ParserUtil::getFloatConstant(
+ const std::string & qnid, avm_size_t count)
+{
+ const BF & var = getvar(qnid, count);
+ if( var.valid() )
+ {
+ Variable * pVar = var.to_ptr< Variable >();
+
+ if( pVar->getModifier().hasFeatureFinal() && pVar->hasValue() &&
+ pVar->getValue().isWeakFloat() )
+ {
+ return( pVar->getValue().toFloat() );
+ }
+ }
+
+ avm_syntax_error( "float_constant(...)" )
+ << "unfound the float constant Qualified Name ID< " << qnid
+ << " > from the machine< "
+ << _CTX_.machine->getFullyQualifiedNameID() << " >"
+ << SYNTAX_ERROR_EOL;
+
+ return( 0.0 );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// GET BUFFER BY [ [ Fully ] Qualified ] Name ID
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+BF ParserUtil::getBuffer(Machine * machine,
+ const std::string & qnid, avm_size_t count)
+{
+ const BF & buf = ( count > 1 )
+ ? machine->getrecBuffer(qnid)
+ : machine->getsemBuffer(qnid);
+
+ if( buf.valid() )
+ {
+ return( buf );
+ }
+
+// AVM_OS_WARN << "Warning:> unfound buffer< " << qnid << " > in machine< "
+// << str_header( machine ) << " >!!!" << std::endl;
+// ++XLIA_SYNTAX_ERROR_COUNT;
+
+ return( NEW_UFID(qnid, count) );
+}
+
+
+BF ParserUtil::getvarBuffer(const std::string & qnid, avm_size_t count)
+{
+ const BF & buffer = ( count > 1 )
+ ? _CTX_.machine->getrecBuffer(qnid)
+ : _CTX_.machine->getsemBuffer(qnid);
+
+ if( buffer.valid() )
+ {
+ return( buffer );
+ }
+
+ BF varBuffer = getvar(qnid, count);
+ if( varBuffer.valid() )
+ {
+ return( varBuffer );
+ }
+ else
+ {
+ return( NEW_UFID(qnid, count) );
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// GET CHANNEL BY [ [ Fully ] Qualified ] Name ID
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+BF ParserUtil::getChannel(const std::string & qnid, avm_size_t count)
+{
+ const BF & chan = ( count > 1 )
+ ? _CTX_.machine->getrecChannel(qnid)
+ : _CTX_.machine->getsemChannel(qnid);
+
+ if( chan.valid() )
+ {
+ return( chan );
+ }
+
+// AVM_OS_WARN << "Warning:> Unfound channel< " << qnid << " > in machine< "
+// << str_header( _CTX_.machine ) << " >!!!" << std::endl;
+// ++XLIA_SYNTAX_ERROR_COUNT;
+
+ return( NEW_UFID(qnid, count) );
+}
+
+
+void ParserUtil::updateSignalRoutingChannel(Modifier::DIRECTION_KIND ioDirection,
+ const BFCode & ioCode, const std::string & qnid, avm_size_t count)
+{
+ const BF & chan = ( count > 1 )
+ ? _CTX_.machine->getrecChannel(qnid)
+ : _CTX_.machine->getsemChannel(qnid);
+
+ if( chan.valid() )
+ {
+// if( ioCode->first().is< Port >() )
+// {
+// ioCode->first().to_ptr< Port >()->setRoutingChannel(chan);
+// }
+
+ BF chanSignal = chan.to_ptr< Channel >()->getSignal(
+ ioDirection, ioCode->first());
+
+ if( chanSignal.valid() )
+ {
+ ioCode->set(0, chanSignal);
+ }
+
+ return;
+ }
+
+ AVM_OS_WARN << "Warning:> unfound channel< " << qnid
+ << " > in " << str_header( _CTX_.machine ) << " !!!"
+ << std::endl;
+ //++XLIA_SYNTAX_ERROR_COUNT;
+
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// GET PORT BY [ [ Fully ] Qualified ] Name ID
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+const BF & ParserUtil::getComPort(Machine * machine,
+ const std::string & qnid, avm_size_t count)
+{
+ if( count > 1 )
+ {
+ if( machine->getSpecifier().isDesignInstanceStatic()
+ && machine->hasType()
+ && machine->getType().is< Machine >() )
+ {
+ machine = machine->getType().to_ptr< Machine >();
+ }
+
+ //return( machine->getrecPort(qnid) );
+ const BF & port = machine->getrecPort(qnid);
+ if( port.valid() )
+ {
+ return( port );
+ }
+ }
+ else
+ {
+ if( machine->getSpecifier().isDesignInstanceStatic()
+ && machine->hasType()
+ && machine->getType().is< Machine >() )
+ {
+ machine = machine->getType().to_ptr< Machine >();
+ }
+
+ //return( machine->getsemPort(qnid) );
+ const BF & port = machine->getsemPort(qnid);
+ if( port.valid() )
+ {
+ return( port );
+ }
+ }
+
+ AVM_OS_WARN << "Error:> unfound port< " << qnid << " > in machine< "
+ << str_header( machine ) << " >!!!" << std::endl;
+ ++XLIA_SYNTAX_ERROR_COUNT;
+
+ return( BF::REF_NULL );
+}
+
+
+BF ParserUtil::getvarPort(const std::string & qnid, avm_size_t count)
+{
+ const BF & port = ( count > 1 )
+ ? _CTX_.machine->getrecPort(qnid)
+ : _CTX_.machine->getsemPort(qnid);
+
+ if( port.valid() )
+ {
+ return( port );
+ }
+ else
+ {
+ BF varPort( getvar(qnid, count) );
+ if( varPort.valid() )
+ {
+ return( varPort );
+ }
+ else
+ {
+ return( NEW_UFID(qnid, count) );
+ }
+ }
+}
+
+void ParserUtil::appendPortParameter(Port * port,
+ const std::string & label, BFVector & labelledParams,
+ BFList & positionalParams, const BF & param)
+{
+ if( label.empty() )
+ {
+ positionalParams.append( param );
+ }
+ else if( port != NULL )
+ {
+ avm_offset_t offset = port->getParameterOffset(label);
+ if( offset != AVM_NO_OFFSET )
+ {
+ labelledParams[ offset ] = param;
+ }
+ else
+ {
+ positionalParams.append( param );
+
+ avm_syntax_error( "ParserUtil::appendPortParameter(...)" )
+ << "Unfound labelled < " << label
+ << " > in port< " << str_header( port ) << " >"
+ << SYNTAX_ERROR_EOL;
+ }
+ }
+ else
+ {
+ positionalParams.append( param );
+
+ avm_syntax_error( "ParserUtil::appendPortParameter(...)" )
+ << "Unfound labelled < " << label
+ << " > in port< UNKNOWN at parsing time >"
+ << SYNTAX_ERROR_EOL;
+ }
+}
+
+
+void ParserUtil::computePortParameter(
+ Port * port, const BFCode & ioStatement,
+ BFVector & labelledParams, BFList & positionalParams)
+{
+ if( labelledParams.empty() )
+ {
+ ioStatement->append( positionalParams );
+ }
+ else if( port != NULL )
+ {
+ TableOfVariable::const_raw_iterator it = port->getParameters().begin();
+ TableOfVariable::const_raw_iterator endIt = port->getParameters().end();
+ for( avm_offset_t offset = 0 ; it != endIt ; ++it , ++offset )
+ {
+ if( labelledParams[offset].valid() )
+ {
+ ioStatement->append( labelledParams[offset] );
+ }
+ else if( (it)->getModifier().hasNatureParameterBind() )
+ {
+ if( (it)->hasValue() )
+ {
+ ioStatement->append( (it)->getValue() );
+ }
+ else
+ {
+ avm_syntax_error( "ParserUtil::computePortParameter(...)" )
+ << "Unexpected $bind parameters:" << std::endl
+ << "#" << offset << " " << str_header( (*it) )
+ << std::endl << "wihtout bind lvalue for port:"
+ << std::endl << str_header( port )
+ << SYNTAX_ERROR_EOL;
+ }
+ }
+ else if( (it)->getModifier().hasNatureParameter() )
+ {
+ if( positionalParams.nonempty() )
+ {
+ ioStatement->append( positionalParams.pop_first() );
+ }
+ else if( (it)->hasValue() )
+ {
+ ioStatement->append( (it)->getValue() );
+ }
+ }
+ else if( positionalParams.nonempty() )
+ {
+ ioStatement->append( positionalParams.pop_first() );
+ }
+ else
+ {
+ avm_syntax_error( "ParserUtil::computePortParameter(...)" )
+ << "Unexpected parameters for port< "
+ << str_header( port ) << " >"
+ << SYNTAX_ERROR_EOL;
+ }
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// GET SIGNAL BY [ [ Fully ] Qualified ] Name ID
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+const BF & ParserUtil::getComSignal(Machine * machine,
+ const std::string & qnid, avm_size_t count)
+{
+ if( count > 1 )
+ {
+ if( machine->getSpecifier().isDesignInstanceStatic()
+ && machine->hasType()
+ && machine->getType().is< Machine >() )
+ {
+ machine = machine->getType().to_ptr< Machine >();
+ }
+
+ //return( machine->getrecSignal(qnid) );
+ const BF & signal = machine->getrecSignal(qnid);
+ if( signal.valid() )
+ {
+ return( signal );
+ }
+ }
+ else
+ {
+ if( machine->getSpecifier().isDesignInstanceStatic()
+ && machine->hasType()
+ && machine->getType().is< Machine >() )
+ {
+ machine = machine->getType().to_ptr< Machine >();
+ }
+
+ //return( machine->getsemSignal(qnid) );
+ const BF & signal = machine->getsemSignal(qnid);
+ if( signal.valid() )
+ {
+ return( signal );
+ }
+ }
+
+ AVM_OS_WARN << "Error:> unfound signal< " << qnid << " > in machine< "
+ << str_header( machine ) << " >!!!" << std::endl;
+ ++XLIA_SYNTAX_ERROR_COUNT;
+
+ return( BF::REF_NULL );
+}
+
+BF ParserUtil::getvarSignal(const std::string & qnid, avm_size_t count)
+{
+ const BF & signal = ( count > 1 )
+ ? _CTX_.machine->getrecSignal(qnid)
+ : _CTX_.machine->getsemSignal(qnid);
+
+ if( signal.valid() )
+ {
+ return( signal );
+ }
+ else
+ {
+ BF varSignal( getvar(qnid, count) );
+ if( varSignal.valid() )
+ {
+ return( varSignal );
+ }
+ else
+ {
+ return( NEW_UFID(qnid, count) );
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// GET PORT or SIGNAL BY [ [ Fully ] Qualified ] Name ID
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+const BF & ParserUtil::getComPortSignal(Machine * machine,
+ const std::string & qnid, avm_size_t count)
+{
+ if( count > 1 )
+ {
+ if( machine->getSpecifier().isDesignInstanceStatic()
+ && machine->hasType()
+ && machine->getType().is< Machine >() )
+ {
+ machine = machine->getType().to_ptr< Machine >();
+ }
+
+ //return( machine->getrecSignal(qnid) );
+ const BF & portSignal = machine->getrecPortSignal(qnid);
+ if( portSignal.valid() )
+ {
+ return( portSignal );
+ }
+ }
+ else
+ {
+ if( machine->getSpecifier().isDesignInstanceStatic()
+ && machine->hasType()
+ && machine->getType().is< Machine >() )
+ {
+ machine = machine->getType().to_ptr< Machine >();
+ }
+
+ //return( machine->getsemSignal(qnid) );
+ const BF & portSignal = machine->getsemPortSignal(qnid);
+ if( portSignal.valid() )
+ {
+ return( portSignal );
+ }
+ }
+
+ AVM_OS_WARN << "Error:> unfound port/signal< " << qnid << " > in machine< "
+ << str_header( machine ) << " >!!!" << std::endl;
+ ++XLIA_SYNTAX_ERROR_COUNT;
+
+ return( BF::REF_NULL );
+}
+
+BF ParserUtil::getvarPortSignal(
+ const std::string & qnid, avm_size_t count)
+{
+ const BF & portSignal = ( count > 1 )
+ ? _CTX_.machine->getrecPortSignal(qnid)
+ : _CTX_.machine->getsemPortSignal(qnid);
+
+ if( portSignal.valid() )
+ {
+ return( portSignal );
+ }
+ else
+ {
+ BF var( getvar(qnid, count) );
+ if( var.valid() )
+ {
+ return( var );
+ }
+ else
+ {
+ return( NEW_UFID(qnid, count) );
+ }
+ }
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// GET ROUTINE BY [ [ Fully ] Qualified ] Name ID
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+Routine * ParserUtil::getRoutine(const std::string & aNameID)
+{
+ Routine * foundRoutine = _CTX_.machine->rawsemRoutineByNameID(aNameID);
+
+ if( foundRoutine == NULL )
+ {
+ AVM_OS_WARN << "Error:> unfound routine< " << aNameID
+ << " > in " << str_header( _CTX_.machine ) << " !!!"
+ << std::endl;
+ ++XLIA_SYNTAX_ERROR_COUNT;
+
+ return( Routine::newDefine(_CTX_.machine, aNameID) );
+ }
+
+ return( foundRoutine );
+}
+
+BF ParserUtil::getvarRoutine(const std::string & aNameID)
+{
+ Routine * foundRoutine = _CTX_.machine->rawsemRoutineByNameID(aNameID);
+
+ if( foundRoutine == NULL )
+ {
+ Operator * op = AvmOperationFactory::get(aNameID);
+ if( op != NULL )
+ {
+ return( INCR_BF(op) );
+ }
+ else
+ {
+ AVM_OS_WARN << "Error:> unfound routine< " << aNameID
+ << " > in machine< " << str_header( _CTX_.machine )
+ << " >!!!"
+ << std::endl;
+ ++XLIA_SYNTAX_ERROR_COUNT;
+ }
+
+ return( NEW_ID(aNameID) );
+ }
+
+ return( INCR_BF(foundRoutine) );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// GET PROCEDURE BY [ [ Fully ] Qualified ] Name ID
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+Machine * ParserUtil::getProcedure(const std::string & aNameID)
+{
+ Machine * foundProcedure = _CTX_.machine->rawsemProcedureByNameID(aNameID);
+
+ if( foundProcedure == NULL )
+ {
+ AVM_OS_WARN << "Error:> unfound procedure< " << aNameID
+ << " > in " << str_header( _CTX_.machine ) << " !!!"
+ << std::endl;
+ ++XLIA_SYNTAX_ERROR_COUNT;
+
+ return( Machine::newProcedure(_CTX_.machine, aNameID,
+ Specifier::COMPONENT_PROCEDURE_SPECIFIER) );
+ }
+
+ return( foundProcedure );
+}
+
+BF ParserUtil::getvarProcedure(const std::string & aNameID)
+{
+ Machine * foundProcedure = _CTX_.machine->rawsemProcedureByNameID(aNameID);
+
+ if( foundProcedure == NULL )
+ {
+ AVM_OS_WARN << "Error:> unfound procedure< " << aNameID
+ << " > in " << str_header( _CTX_.machine ) << " !!!"
+ << std::endl;
+ ++XLIA_SYNTAX_ERROR_COUNT;
+
+ return( NEW_ID(aNameID) );
+ }
+
+ return( INCR_BF(foundProcedure) );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// GET MACHINE BY [ [ Fully ] Qualified ] Name ID
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+Machine * ParserUtil::getMachine(Machine * machine,
+ const std::string & qnid, avm_size_t count)
+{
+ Machine * foundMachine = ( count > 1 )
+ ? machine->getrecMachine(qnid)
+ : machine->getsemMachineByNameID(qnid);
+
+ if( foundMachine == NULL )
+ {
+ AVM_OS_WARN << "Error:> unfound machine< " << qnid
+ << " > in " << str_header( machine ) << " !!!"
+ << std::endl;
+ ++XLIA_SYNTAX_ERROR_COUNT;
+
+ return( new Machine(machine, qnid,
+ Specifier::COMPONENT_EXECUTABLE_SPECIFIER) );
+ }
+
+ return( foundMachine );
+}
+
+BF ParserUtil::getvarMachine(const std::string & qnid, avm_size_t count)
+{
+ Machine * foundMachine = NULL;
+ if( count > 1 )
+ {
+ if( (foundMachine = _CTX_.machine->getsemMachine(qnid)) == NULL )
+ {
+ foundMachine = _CTX_.machine->getrecMachine(qnid);
+ }
+ }
+ else
+ {
+ foundMachine = _CTX_.machine->getsemMachineByNameID(qnid);
+ }
+
+ if( foundMachine != NULL )
+ {
+ return( INCR_BF(foundMachine) );
+ }
+ else
+ {
+ const BF & var = getvar(qnid, count);
+ if( var.valid() )
+ {
+ return( var );
+ }
+ else
+ {
+ return( NEW_UFID(qnid, count) );
+ }
+ }
+}
+
+BF ParserUtil::getExecutableMachine(const std::string & qnid, avm_size_t count)
+{
+ Machine * foundMachine = ( count > 1 )
+ ? _CTX_.machine->getrecExecutableMachine(qnid)
+ : _CTX_.machine->getsemExecutableMachine(qnid);
+
+ if( foundMachine == NULL )
+ {
+ AVM_OS_WARN << "Error:> unfound typedef machine< " << qnid
+ << " > in machine< " << str_header( _CTX_.machine )
+ << " > !!!" << std::endl;
+ ++XLIA_SYNTAX_ERROR_COUNT;
+
+ return( BF(new Machine(_CTX_.machine, qnid,
+ Specifier::COMPONENT_EXECUTABLE_SPECIFIER)) );
+ }
+
+ return( INCR_BF(foundMachine) );
+}
+
+
+
+void ParserUtil::appendInstanceMachineParameter(Machine * machine,
+ const std::string & label, BFVector & labelledParams,
+ BFList & positionalParams, const BF & param)
+{
+ if( label.empty() )
+ {
+ positionalParams.append( param );
+ }
+ else if( labelledParams.nonempty() )
+ {
+ machine = machine->getType().as_ptr< Machine >();
+ avm_offset_t offset = machine->getVariableParameterOffset(label);
+ if( offset != AVM_NO_OFFSET )
+ {
+ labelledParams[ offset ] = param;
+ }
+ else
+ {
+ positionalParams.append( param );
+
+ avm_syntax_error( "ParserUtil::appendInstanceMachineParameter(...)" )
+ << "Unfound labelled parameter < " << label
+ << " > in " << str_header( machine )
+ << SYNTAX_ERROR_EOL;
+ }
+ }
+ else
+ {
+ avm_syntax_error( "ParserUtil::appendInstanceMachineParameter(...)" )
+ << "Unfound the instance machine model < "
+ << str_header( machine ) << " >"
+ << SYNTAX_ERROR_EOL;
+ }
+}
+
+
+void ParserUtil::computeInstanceMachineParameter(Machine * machine,
+ BFVector & labelledParams, BFList & positionalParams)
+{
+ TableOfVariable::const_raw_iterator it = machine->getType().
+ as_ptr< Machine >()->getVariableParameters().begin();
+ TableOfVariable::const_raw_iterator endIt = machine->getType().
+ as_ptr< Machine >()->getVariableParameters().end();
+ for( avm_offset_t offset = 0 ; it != endIt ; ++it , ++offset )
+ {
+ if( labelledParams[offset].valid() )
+ {
+ machine->getPropertyPart().saveOwnedVariable(
+ new Variable(machine,
+ Modifier::PROPERTY_PARAMETER_MODIFIER,
+ (it), labelledParams[offset]) );
+ }
+ else if( (it)->getModifier().hasNatureParameterBind() )
+ {
+ machine->getPropertyPart().dispatchOwnedElement( (*it) );
+ if( not (it)->hasValue() )
+ {
+ avm_syntax_error(
+ "ParserUtil::computeInstanceMachineParameter(...)" )
+ << "Unexpected $bind parameters:" << std::endl
+ << "#" << offset << " " << str_header( (*it) )
+ << std::endl << "wihtout value for machine:"
+ << std::endl << str_header( machine )
+ << SYNTAX_ERROR_EOL;
+ }
+ }
+ else if( (it)->getModifier().hasNatureParameter() )
+ {
+ if( positionalParams.nonempty() )
+ {
+ machine->getPropertyPart().saveOwnedVariable(
+ new Variable( machine,
+ Modifier::PROPERTY_PARAMETER_MODIFIER,
+ (it), positionalParams.pop_first()) );
+ }
+ else //if( (it)->hasValue() )
+ {
+ machine->getPropertyPart().dispatchOwnedElement( (*it) );
+ }
+ }
+ else if( positionalParams.nonempty() )
+ {
+ machine->getPropertyPart().saveOwnedVariable(
+ new Variable( machine,
+ Modifier::PROPERTY_PARAMETER_MODIFIER,
+ (it), positionalParams.pop_first()) );
+ }
+ else
+ {
+ avm_syntax_error( "ParserUtil::computeInstanceMachineParameter(...)" )
+ << "Unexpected parameters for machine< "
+ << str_header( machine ) << " >"
+ << SYNTAX_ERROR_EOL;
+ }
+ }
+}
+
+
+void ParserUtil::appendInstanceMachineReturn(Machine * machine,
+ const std::string & label, BFVector & labelledReturns,
+ BFList & positionalReturns, const BF & param)
+{
+ if( label.empty() )
+ {
+ positionalReturns.append( param );
+ }
+ else if( labelledReturns.nonempty() )
+ {
+ machine = machine->getType().as_ptr< Machine >();
+ avm_offset_t offset = machine->getVariableReturnOffset(label);
+ if( offset != AVM_NO_OFFSET )
+ {
+ labelledReturns[ offset ] = param;
+ }
+ else
+ {
+ positionalReturns.append( param );
+
+ avm_syntax_error( "ParserUtil::appendInstanceMachineReturn(...)" )
+ << "Unfound labelled parameter < " << label
+ << " > in " << str_header( machine )
+ << SYNTAX_ERROR_EOL;
+ }
+ }
+ else
+ {
+ avm_syntax_error( "ParserUtil::appendInstanceMachineReturn(...)" )
+ << "Unfound the instance machine model < "
+ << str_header( machine ) << " >"
+ << SYNTAX_ERROR_EOL;
+ }
+}
+
+
+void ParserUtil::computeInstanceMachineReturn(Machine * machine,
+ BFVector & labelledReturns, BFList & positionalReturns)
+{
+ TableOfVariable::const_raw_iterator it =
+ machine->getType().as_ptr< Machine >()->getVariableReturns().begin();
+ TableOfVariable::const_raw_iterator endIt =
+ machine->getType().as_ptr< Machine >()->getVariableReturns().end();
+ for( avm_offset_t offset = 0 ; it != endIt ; ++it , ++offset )
+ {
+ if( labelledReturns[offset].valid() )
+ {
+ machine->getPropertyPart().saveOwnedVariable(
+ new Variable( machine,
+ Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER,
+ (it), labelledReturns[offset]) );
+ }
+ else if( (it)->getModifier().hasModifierReturnBind() )
+ {
+ machine->dispatchOwnedElement( (*it) );
+ if( not (it)->hasValue() )
+ {
+ avm_syntax_error(
+ "ParserUtil::computeInstanceMachineReturn(...)" )
+ << "Unexpected #bind parameters < #"
+ << offset << " > wihtout value for machine< "
+ << str_header( machine ) << " >"
+ << SYNTAX_ERROR_EOL;
+ }
+ }
+ else
+ {
+ if( positionalReturns.nonempty() )
+ {
+ machine->getPropertyPart().saveOwnedVariable(
+ new Variable( machine,
+ Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER,
+ (it), positionalReturns.pop_first()) );
+ }
+ else //if( (it)->hasValue() )
+ {
+ machine->getPropertyPart().dispatchOwnedElement( (*it) );
+ }
+ }
+ }
+}
+
+
+void ParserUtil::appendInstanceDynamicPositionalParameter(
+ Machine * anInstance, const BF & rvParameter, avm_size_t position)
+{
+ const Machine * aModel = anInstance->getModelMachine();
+
+ BF lvParameter;
+
+ if( aModel != NULL )
+ {
+ if( aModel->hasVariableParameter() )
+ {
+ const PropertyPart & aPropertyPart = aModel->getPropertyPart();
+
+ if( position < aPropertyPart.getVariableParametersCount() )
+ {
+ lvParameter = aPropertyPart.getVariableParameter(position);
+
+ anInstance->getUniqBehaviorPart()->seqOnCreate(
+ StatementConstructor::newCode(
+ OP(ASSIGN), lvParameter, rvParameter ) );
+ }
+ else
+ {
+// avm_syntax_error( "appendInstanceDynamicPositionalParameter(...)" )
+// << "Unexpected an #dynamic instance with an"
+// "executable model without enough parameter's"
+// << SYNTAX_ERROR_EOL;
+ }
+ }
+ else
+ {
+// avm_syntax_error( "appendInstanceDynamicPositionalParameter(...)" )
+// << "Unexpected an #dynamic instance with an"
+// "executable model without parameter's"
+// << SYNTAX_ERROR_EOL;
+ }
+
+ }
+ else
+ {
+// avm_syntax_error( "appendInstanceDynamicPositionalParameter(...)" )
+// << "Unexpected an #dynamic instance with an unknown model "
+// "at parsing stage"
+// << SYNTAX_ERROR_EOL;
+ }
+
+ if( lvParameter.invalid() )
+ {
+ lvParameter = ExpressionConstructor::
+ newQualifiedPositionalIdentifier(anInstance, position);
+
+ anInstance->getUniqBehaviorPart()->seqOnCreate(
+ StatementConstructor::newCode(
+ OP(ASSIGN), lvParameter, rvParameter) );
+ }
+
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// ROUTINE Parameters / Returns arguments
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+void ParserUtil::appendRoutineParameters(Routine * routine,
+ const std::string & label, BFVector & labelledParams,
+ BFList & positionalParams, const BF & param)
+{
+ if( label.empty() )
+ {
+ positionalParams.append( param );
+ }
+ else if( routine != NULL )
+ {
+ avm_offset_t offset = routine->getParameterOffset(label);
+ if( offset != AVM_NO_OFFSET )
+ {
+ labelledParams[ offset ] = param;
+ }
+ else
+ {
+ positionalParams.append( param );
+
+ avm_syntax_error( "ParserUtil::appendRoutineParameters(...)" )
+ << "Unfound labelled parameter < " << label
+ << " > in routine< " << str_header( routine ) << " >"
+ << SYNTAX_ERROR_EOL;
+ }
+ }
+ else
+ {
+ positionalParams.append( param );
+
+ avm_syntax_error( "ParserUtil::appendRoutineParameters(...)" )
+ << "Unexpected an unknown routine activity"
+ << SYNTAX_ERROR_EOL;
+ }
+}
+
+
+void ParserUtil::appendRoutineReturns(Routine * routine,
+ const std::string & label, BFVector & labelledReturns,
+ BFList & positionalReturns, const BF & param)
+{
+ if( label.empty() )
+ {
+ positionalReturns.append( param );
+ }
+ else if( routine != NULL )
+ {
+ avm_offset_t offset = routine->getReturnOffset(label);
+ if( offset != AVM_NO_OFFSET )
+ {
+ labelledReturns[ offset ] = param;
+ }
+ else
+ {
+ positionalReturns.append( param );
+
+ avm_syntax_error( "ParserUtil::appendRoutineReturns(...)" )
+ << "Unfound labelled parameter < " << label
+ << " > in routine< " << str_header( routine ) << " >"
+ << SYNTAX_ERROR_EOL;
+ }
+ }
+ else
+ {
+ positionalReturns.append( param );
+
+ avm_syntax_error( "ParserUtil::appendRoutineReturns(...)" )
+ << "Unexpected an unknown routine activity"
+ << SYNTAX_ERROR_EOL;
+ }
+}
+
+
+void ParserUtil::computeRoutineParamReturn(const BF & ctxMachine,
+ Routine * routine, BFCode & activityStatement,
+ BFVector & labelledParams, BFList & positionalParams,
+ BFVector & labelledReturns, BFList & positionalReturns)
+{
+ Machine * machine = ctxMachine.is< Machine >() ?
+ ctxMachine.to_ptr< Machine >() : NULL;
+
+ if( (routine != NULL) && (machine != NULL) )
+ {
+ BFCode invokeSequende = StatementConstructor::newCode( OP(SEQUENCE) );
+
+ Machine * machine = ctxMachine.is< Machine >() ?
+ ctxMachine.to_ptr< Machine >() : NULL;
+
+ computeActivityRoutineInput(machine, routine,
+ invokeSequende, labelledParams, positionalParams);
+
+ computeActivityRoutineDefaultOutput(machine, routine,
+ invokeSequende, labelledReturns, positionalReturns);
+
+ invokeSequende->append( activityStatement );
+
+ computeActivityRoutineOutput(machine, routine,
+ invokeSequende, labelledReturns, positionalReturns);
+
+ activityStatement = StatementConstructor::newCode(
+ OP(CONTEXT_SWITCHER), ctxMachine, invokeSequende );
+ }
+ else
+ {
+ if( labelledParams.empty() )
+ {
+ activityStatement->append( positionalParams );
+ }
+ else
+ {
+ computeActivityRoutineInput(machine, routine,
+ activityStatement, labelledParams, positionalParams);
+ }
+
+ if( labelledReturns.empty() )
+ {
+ activityStatement->append( positionalReturns );
+ }
+ else
+ {
+ computeActivityRoutineOutput(machine, routine,
+ activityStatement, labelledReturns, positionalReturns);
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// ACTIVITY ROUTINE Parameters / Returns arguments
+////////////////////////////////////////////////////////////////////////////////
+
+void ParserUtil::computeActivityRoutineParamReturn(const BF & ctxMachine,
+ Routine * routine, BFCode & activityStatement,
+ BFVector & labelledParams, BFList & positionalParams,
+ BFVector & labelledReturns, BFList & positionalReturns)
+{
+ Machine * machine = ctxMachine.is< Machine >() ?
+ ctxMachine.to_ptr< Machine >() : NULL;
+
+ if( (routine != NULL) && (machine != NULL) )
+ {
+ BFCode invokeSequende = StatementConstructor::newCode( OP(SEQUENCE) );
+
+ Machine * machine = ctxMachine.is< Machine >() ?
+ ctxMachine.to_ptr< Machine >() : NULL;
+
+ computeActivityRoutineInput(machine, routine,
+ invokeSequende, labelledParams, positionalParams);
+
+ computeActivityRoutineDefaultOutput(machine, routine,
+ invokeSequende, labelledReturns, positionalReturns);
+
+ invokeSequende->append( activityStatement );
+
+ computeActivityRoutineOutput(machine, routine,
+ invokeSequende, labelledReturns, positionalReturns);
+
+ activityStatement = StatementConstructor::newCode(
+ OP(CONTEXT_SWITCHER), ctxMachine, invokeSequende );
+ }
+ else
+ {
+ if( labelledParams.empty() )
+ {
+ activityStatement->append( positionalParams );
+ }
+ else
+ {
+ computeActivityRoutineInput(machine, routine,
+ activityStatement, labelledParams, positionalParams);
+ }
+
+ if( labelledReturns.empty() )
+ {
+ activityStatement->append( positionalReturns );
+ }
+ else
+ {
+ computeActivityRoutineOutput(machine, routine,
+ activityStatement, labelledReturns, positionalReturns);
+ }
+ }
+}
+
+
+static inline void appendParam(BFCode & paramCode, const BF & bfParamVar,
+ Variable * pParamVar, const BF & bfParamValue)
+{
+ paramCode->append( StatementConstructor::newCode(
+ pParamVar->getModifier().hasNatureReference() ?
+ OP(ASSIGN_REF) : OP(ASSIGN),
+ pParamVar->getModifier().hasNatureMacro() ?
+ pParamVar->getBinding() : bfParamVar,
+ bfParamValue ) );
+}
+
+void ParserUtil::computeActivityRoutineInput(Machine * ctxMachine,
+ Routine * routine, BFCode & invokeSequende,
+ BFVector & labelledParams, BFList & positionalParams)
+{
+ BFCode paramCode( OP(ATOMIC_SEQUENCE) );
+
+ Variable * variable = NULL;
+ BFVector::const_iterator it = routine->getParameters().begin();
+ BFVector::const_iterator endIt = routine->getParameters().end();
+ for( avm_offset_t offset = 0 ; it != endIt ; ++it , ++offset )
+ {
+ variable = (*it).to_ptr< Variable >();
+
+ if( labelledParams[offset].valid() )
+ {
+ appendParam(paramCode, (*it), variable, labelledParams[offset]);
+ }
+
+ else if( variable->getModifier().hasNatureParameterBind() )
+ {
+ if( variable->hasValue() )
+ {
+ appendParam(paramCode, (*it), variable, variable->getValue());
+ }
+ else
+ {
+ avm_syntax_error( "ParserUtil::computeActivityRoutineInput(...)" )
+ << "Unexpected $bind parameters:" << std::endl
+ << "#" << offset << " " << str_header( variable )
+ << std::endl << "wihtout value for routine:"
+ << std::endl << str_header( routine )
+ << SYNTAX_ERROR_EOL;
+ }
+ }
+
+// else if( variable->getModifier().hasNatureParameter() )
+// {
+// if( positionalParams.nonempty() )
+// {
+// appendParam(paramCode, (*it),
+// variable, positionalParams.pop_first());
+// }
+// else if( variable->hasValue() )
+// {
+// appendParam(paramCode, (*it), variable, variable->getValue());
+// }
+// }
+
+ else if( positionalParams.nonempty() )
+ {
+ appendParam(paramCode, (*it),
+ variable, positionalParams.pop_first());
+ }
+ else if( variable->hasValue() )
+ {
+ appendParam(paramCode, (*it), variable, variable->getValue());
+ }
+
+ else
+ {
+ avm_syntax_error( "ParserUtil::computeActivityRoutineInput(...)" )
+ << "Unexpected parameters for routine< "
+ << str_header( routine ) << " >"
+ << SYNTAX_ERROR_EOL;
+ }
+ }
+
+ if( paramCode->nonempty() )
+ {
+ invokeSequende->append(
+ paramCode->singleton() ? paramCode->first() : paramCode );
+ }
+}
+
+
+static inline void appendReturn(BFCode & returnCode, const BF & bfReturnVar,
+ Variable * pReturnVar, const BF & bfReturnDest)
+{
+ returnCode->append( StatementConstructor::newCode(
+ pReturnVar->getModifier().hasNatureReference() ?
+ OP(ASSIGN_REF) : OP(ASSIGN),
+ bfReturnDest,
+ pReturnVar->getModifier().hasNatureMacro() ?
+ pReturnVar->getBinding() : bfReturnVar ) );
+}
+
+
+void ParserUtil::computeActivityRoutineDefaultOutput(Machine * ctxMachine,
+ Routine * routine, BFCode & invokeSequende,
+ BFVector & labelledReturns, BFList & positionalReturns)
+{
+ BFCode returnCode( OP(ATOMIC_SEQUENCE) );
+
+ Variable * variable = NULL;
+ BFVector::const_iterator it = routine->getReturns().begin();
+ BFVector::const_iterator endIt = routine->getReturns().end();
+ for( avm_offset_t offset = 0 ; it != endIt ; ++it , ++offset )
+ {
+ variable = (*it).to_ptr< Variable >();
+
+ if( labelledReturns[offset].valid() && variable->hasValue() )
+ {
+ returnCode->append( StatementConstructor::newCode( OP(ASSIGN),
+ (*it), variable->getValue() ) );
+ }
+
+ else if( variable->getModifier().hasModifierReturnBind() )
+ {
+ if( variable->hasValue() )
+ {
+ appendReturn(returnCode, (*it), variable, variable->getValue());
+ }
+ else
+ {
+ avm_syntax_error(
+ "ParserUtil::computeActivityRoutineDefaultOutput(...)" )
+ << "Unexpected $bind parameters:" << std::endl
+ << "#" << offset << " " << str_header( variable )
+ << std::endl << "wihtout value for routine:"
+ << std::endl << str_header( routine )
+ << SYNTAX_ERROR_EOL;
+ }
+ }
+
+// else if( variable->getModifier().isDirectionReturn() )
+// {
+// if( positionalReturns.nonempty() && variable->hasValue() )
+// {
+// returnCode->append( StatementConstructor::newCode( OP(ASSIGN),
+// (*it), variable->getValue() ) );
+// }
+// else if( variable->hasValue() )
+// {
+// }
+// }
+
+ else if( positionalReturns.nonempty() && variable->hasValue() )
+ {
+ returnCode->append( StatementConstructor::newCode( OP(ASSIGN),
+ (*it), variable->getValue() ) );
+ }
+ else
+ {
+ }
+ }
+
+ if( returnCode->nonempty() )
+ {
+ invokeSequende->append(
+ returnCode->singleton() ? returnCode->first() : returnCode );
+ }
+}
+
+
+void ParserUtil::computeActivityRoutineOutput(Machine * ctxMachine,
+ Routine * routine, BFCode & invokeSequende,
+ BFVector & labelledReturns, BFList & positionalReturns)
+{
+ BFCode returnCode( OP(ATOMIC_SEQUENCE) );
+
+ Variable * variable = NULL;
+ BFVector::const_iterator it = routine->getReturns().begin();
+ BFVector::const_iterator endIt = routine->getReturns().end();
+ for( avm_offset_t offset = 0 ; it != endIt ; ++it , ++offset )
+ {
+ variable = (*it).to_ptr< Variable >();
+
+ if( labelledReturns[offset].valid() )
+ {
+ appendReturn(returnCode, (*it), variable, labelledReturns[offset]);
+ }
+ else if( variable->getModifier().hasModifierReturnBind() )
+ {
+ if( variable->hasValue() )
+ {
+ appendReturn(returnCode, (*it), variable, variable->getValue());
+ }
+ else
+ {
+ avm_syntax_error( "ParserUtil::computeActivityRoutineOutput(...)" )
+ << "Unexpected #bind returns < #"
+ << offset << " > wihtout value for routine< "
+ << str_header( routine ) << " >"
+ << SYNTAX_ERROR_EOL;
+ }
+ }
+ else if( variable->getModifier().isDirectionReturn() )
+ {
+ if( positionalReturns.nonempty() )
+ {
+ appendReturn(returnCode, (*it),
+ variable, positionalReturns.pop_first());
+ }
+ else if( variable->hasValue() )
+ {
+ appendReturn(returnCode, (*it),
+ variable, variable->getValue());
+ }
+ }
+ else if( positionalReturns.nonempty() )
+ {
+ appendReturn(returnCode, (*it),
+ variable, positionalReturns.pop_first());
+ }
+ else
+ {
+ avm_syntax_error( "ParserUtil::computeActivityRoutineOutput(...)" )
+ << "Unexpected returns for routine< "
+ << str_header( routine ) << " >"
+ << SYNTAX_ERROR_EOL;
+ }
+ }
+
+ if( returnCode->nonempty() )
+ {
+ invokeSequende->append(
+ returnCode->singleton() ? returnCode->first() : returnCode );
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// GET XLIA INVOKABLE BY ID
+////////////////////////////////////////////////////////////////////////////////
+
+BF ParserUtil::getInvokable(const BF & target, const std::string & aNameID)
+{
+ Operator * op = AvmOperationFactory::get(target, aNameID);
+ if( op != NULL )
+ {
+ return( INCR_BF(op) );
+ }
+
+ return( ExpressionConstructor::newIdentifier(aNameID) );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// DECLARE DEFAULT STATE #final, #terminal, #return if need
+////////////////////////////////////////////////////////////////////////////////
+
+void ParserUtil::declareDefaultEndingStateIfNeed(
+ ListOfMachine & needDefaultStateFinal,
+ ListOfMachine & needDefaultStateTerminal,
+ ListOfMachine & needDefaultStateReturn)
+{
+ Specifier aMocSpecifier;
+
+ aMocSpecifier.setStateMocFINAL();
+ while( needDefaultStateFinal.nonempty() )
+ {
+ needDefaultStateFinal.back()->saveOwnedElement( //saveMachine(
+ Machine::newState(
+ needDefaultStateFinal.back(),
+ "#final", aMocSpecifier) );
+
+ needDefaultStateFinal.pop_back();
+ }
+
+ aMocSpecifier.setPseudostateMocTERMINAL();
+ while( needDefaultStateTerminal.nonempty() )
+ {
+ needDefaultStateTerminal.back()->saveOwnedElement( //saveMachine(
+ Machine::newState(
+ needDefaultStateTerminal.back(),
+ "#terminal", aMocSpecifier) );
+
+ needDefaultStateTerminal.pop_back();
+ }
+
+ aMocSpecifier.setPseudostateMocRETURN();
+ while( needDefaultStateReturn.nonempty() )
+ {
+ needDefaultStateReturn.back()->saveOwnedElement( //saveMachine(
+ Machine::newState(
+ needDefaultStateReturn.back(),
+ "#return", aMocSpecifier) );
+
+ needDefaultStateReturn.pop_back();
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// INLINE XLIA PROCEDURE CALL IN TRANSITION
+////////////////////////////////////////////////////////////////////////////////
+
+void ParserUtil::checkProcedureCompositeMocKind(Machine * aProcedure)
+{
+ if( aProcedure->getSpecifier().hasModelOfComputation() )
+ {
+ return;
+ }
+
+ bool isStateTransitionFlowFlag = false;
+
+ CompositePart::const_procedure_iterator it =
+ aProcedure->getCompositePart()->machine_begin();
+ CompositePart::const_procedure_iterator endIt =
+ aProcedure->getCompositePart()->machine_end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (it)->getSpecifier().isPseudostate() )
+ {
+ if( not isStateTransitionFlowFlag )
+ {
+ isStateTransitionFlowFlag = true;
+ }
+ }
+ else if( (it)->getSpecifier().isState()
+ || (it)->getSpecifier().isComponentStatemachine()
+ || (it)->getSpecifier().isMocStateTransitionSystem() )
+ {
+ aProcedure->getwSpecifier().setMocStateTransitionSystem();
+
+ return;
+ }
+ else if( (it)->getSpecifier().isDesignInstanceStatic()
+ && (it)->hasInstanceSpecifier() )
+ {
+ const BF & model = (it)->getInstanceSpecifier()->getModel();
+
+ if( model.is< Machine >()
+ && model.to_ptr< Machine >()
+ ->getSpecifier().isMocStateTransitionSystem() )
+ {
+ aProcedure->getwSpecifier().setMocStateTransitionSystem();
+
+ return;
+ }
+ }
+ }
+
+ if( isStateTransitionFlowFlag )
+ {
+ aProcedure->getwSpecifier().setMocStateTransitionFlow();
+ }
+
+// aProcedure->getwSpecifier().setMocCompositeStructure();
+}
+
+
+static Transition * insertProcedureStatemachineCall(Transition * transition,
+ const std::string & refId, Machine * instanceProcedure,
+ const BFCode & paramCode, const BFCode &returnCode)
+{
+ Machine * procedureStateCall = Machine::newStatemachine(
+ transition->getSourceContainer(),
+ (OSS() << refId << '#' << instanceProcedure->getNameID()),
+ Specifier::EXECUTABLE_PROCEDURE_COMPOSITE_SPECIFIER);
+// instanceProcedure->getType());
+
+ transition->getSourceContainer()->saveOwnedElement(
+ procedureStateCall );
+
+ procedureStateCall->copyLocation( instanceProcedure->getLocation() );
+
+ procedureStateCall->saveOwnedElement( //saveMachine(
+ sep::incrReferenceCount(instanceProcedure) );
+ instanceProcedure->updateContainer( transition->getSourceContainer() );
+
+ // Parameters initialization
+ if( paramCode.valid() && paramCode->nonempty() )
+ {
+ procedureStateCall->getUniqBehaviorPart()->setOnEnable(
+ StatementConstructor::newCode( OP(CONTEXT_SWITCHER),
+ INCR_BF(instanceProcedure), paramCode->singleton() ?
+ paramCode->first().bfCode() : paramCode) );
+ }
+
+ // Returns finalization
+ if( returnCode.valid() && returnCode->nonempty() )
+ {
+ procedureStateCall->getUniqBehaviorPart()->setOnFinal(
+// procedureStatemachine->getUniqBehaviorPart()->setOnReturn(
+ StatementConstructor::newCode( OP(CONTEXT_SWITCHER),
+ INCR_BF(instanceProcedure), returnCode->singleton() ?
+ returnCode->first().bfCode() : returnCode ) );
+ }
+
+ Transition * returnTransition = new Transition(procedureStateCall,
+ (OSS() << refId << '#' << instanceProcedure->getNameID() << "#end"),
+ Transition::MOC_FINAL_KIND);
+
+ returnTransition->copyLocation( instanceProcedure->getLocation() );
+
+
+ returnTransition->setTarget( transition->getTarget() );
+
+ transition->setTarget( INCR_BF(procedureStateCall) );
+// transition->fullyUpdateAllNameID( OSS( ) << transition->getNameID()
+// << '#' << instanceProcedure->getNameID() );
+
+ procedureStateCall->getUniqBehaviorPart()->
+ saveOutgoingTransition( returnTransition );
+
+ return( returnTransition );
+}
+
+static Transition * insertProcedureMachineCall(Transition * transition,
+ const std::string & refId, Machine * instanceProcedure,
+ const BFCode & paramCode, const BFCode &returnCode)
+{
+ transition->getSourceContainer()->saveOwnedElement( //saveMachine(
+ sep::incrReferenceCount(instanceProcedure) );
+ instanceProcedure->updateContainer( transition->getSourceContainer() );
+
+ instanceProcedure->copyLocation( instanceProcedure->getLocation() );
+
+ if( paramCode.valid() && paramCode->nonempty() )
+ {
+ instanceProcedure->getUniqBehaviorPart()->seqOnStart( //seqOnCreate(
+ paramCode->singleton() ? paramCode->first().bfCode() : paramCode );
+ }
+
+ BFCode callingProcedure;
+
+ if( instanceProcedure->hasParamReturn() )
+ {
+ instanceProcedure->setAutoStart( false );
+
+ BFCode callingSequende = StatementConstructor::newCode( OP(SEQUENCE) );
+
+ callingProcedure = StatementConstructor::newCode( OP(CONTEXT_SWITCHER),
+ INCR_BF(instanceProcedure), callingSequende );
+
+ // Parameters initialization
+// if( paramCode.valid() && paramCode->nonempty() )
+// {
+// callingSequende->append( paramCode->singleton() ?
+// paramCode->first().bfCode() : paramCode );
+// }
+
+ // Calling procedure
+ if( not instanceProcedure->getModelMachine()->
+ getSpecifier().isFamilyComponentStatemachine() )
+ {
+ instanceProcedure->getUniqBehaviorPart()->seqOnStart( OP(RUN) );
+ }
+
+ callingSequende->append( StatementConstructor::newCode(
+ OP(START), INCR_BF(instanceProcedure) ) );
+
+ // Returns finalization
+ if( returnCode.valid() && returnCode->nonempty() )
+ {
+ callingSequende->append( returnCode->singleton() ?
+ returnCode->first().bfCode() : returnCode );
+ }
+ }
+ else
+ {
+ callingProcedure = StatementConstructor::newCode(
+ OP(RUN), INCR_BF(instanceProcedure) );
+ }
+
+ transition->setStatement( StatementConstructor::xnewCodeFlat(
+ OP(SEQUENCE), transition->getStatement(), callingProcedure) );
+
+ return( transition );
+}
+
+
+
+static bool isOneStepRunningMachine(const Machine * aMachine)
+{
+ if( not aMachine->getSpecifier().isMocStateTransitionFlow() )
+ {
+ CompositePart::const_machine_iterator itMachine =
+ aMachine->getCompositePart()->machine_begin();
+ CompositePart::const_machine_iterator endMachine =
+ aMachine->getCompositePart()->machine_end();
+ for( ; itMachine != endMachine ; ++itMachine )
+ {
+ if( (itMachine)->getSpecifier().isDesignInstanceStatic() )
+ {
+ if( (itMachine)->hasModelMachine() &&
+ (not isOneStepRunningMachine(
+ (itMachine)->getModelMachine() )) )
+ {
+ return( false );
+ }
+ }
+ else if( (itMachine)->getSpecifier().isComponentExecutable() )
+ {
+ if( (itMachine)->hasMachine() &&
+ (not isOneStepRunningMachine( (itMachine) )) )
+ {
+ return( false );
+ }
+ }
+ else if( not (itMachine)->getSpecifier().isPseudostate() )
+ {
+ return( false );
+ }
+ }
+ }
+
+ return( true );
+}
+
+
+static Transition * insertProcedureCall(Transition * transition,
+ const std::string & refId, Machine * instanceProcedure)
+{
+ instanceProcedure->fullyUpdateAllNameID( OSS( ) << refId
+ << '#' << instanceProcedure->getNameID() );
+
+ const Machine * modelProcedure = instanceProcedure->getModelMachine();
+
+ BFCode paramCode( OP(ATOMIC_SEQUENCE) );
+ BFCode returnCode( OP(ATOMIC_SEQUENCE) );
+
+ if( instanceProcedure->hasParamReturn() &&
+ instanceProcedure->hasModelMachine() )
+ {
+ // Parameters initialization
+ TableOfVariable::const_raw_iterator itParam =
+ instanceProcedure->getVariableParameters().begin();
+ TableOfVariable::const_raw_iterator endIt =
+ instanceProcedure->getVariableParameters().end();
+ for( avm_size_t offset = 0 ; itParam != endIt ; ++itParam , ++offset )
+ {
+ if( (itParam)->hasValue() )
+ {
+ paramCode->append( StatementConstructor::newCode(
+ (itParam)->getModifier().hasNatureReference()
+ ? OP(ASSIGN_REF) : OP(ASSIGN),
+ modelProcedure->getVariableParameter(offset),
+ (itParam)->getValue() ) );
+ }
+ }
+
+ // Returns finalization
+ itParam = instanceProcedure->getVariableReturns().begin();
+ endIt = instanceProcedure->getVariableReturns().end();
+ for( avm_size_t offset = 0 ; itParam != endIt ; ++itParam , ++offset )
+ {
+ if( (itParam)->hasValue() )
+ {
+// paramCode->append( StatementConstructor::newCode( OP(ASSIGN_REF),
+// modelProcedure->getVariableReturn(offset),
+// (itParam)->getValue() ) );
+
+ returnCode->append( StatementConstructor::newCode(OP(ASSIGN),
+ (itParam)->getValue(),
+ modelProcedure->getVariableReturn(offset) ) );
+ }
+ }
+ }
+
+ Transition * returnTransition = NULL;
+
+ if( isOneStepRunningMachine( modelProcedure ) )
+ {
+ returnTransition = insertProcedureMachineCall(transition,
+ refId, instanceProcedure, paramCode, returnCode);
+ }
+ else
+ {
+ returnTransition = insertProcedureStatemachineCall(transition,
+ refId, instanceProcedure, paramCode, returnCode);
+ }
+
+ return( returnTransition );
+}
+
+void ParserUtil::inlineTransitionProcedureCall(
+ Transition * transition, const std::string & refId)
+{
+ Machine * sourceState = transition->getSource();
+
+ BFCode statement = transition->getStatement();
+
+ transition->setStatement( BFCode::REF_NULL );
+
+ if( statement->isOpCode(AVM_OPCODE_INVOKE_METHOD) &&
+ statement->first().is< Machine >() )
+ {
+ transition = insertProcedureCall(transition,
+ refId, statement->first().to_ptr< Machine >() );
+
+ if( not transition->hasTarget() )
+ {
+ transition->setStatement( StatementConstructor::xnewCodeFlat(
+ OP(SEQUENCE), transition->getStatement(),
+ StatementConstructor::newCode( OP(DISABLE_SELF)),
+ StatementConstructor::newCode( OP(ENABLE_SET),
+ INCR_BF(sourceState) ) ) );
+
+ transition->setStatement( StatementConstructor::xnewCodeFlat(
+ OP(SEQUENCE), transition->getStatement(),
+ StatementConstructor::newCode(
+ OP(ENABLE_SET), INCR_BF(sourceState) ) ));
+ }
+ }
+
+ else if( OperatorManager::isSequence(statement->getOperator()))
+ {
+ BFCode otherStatement( statement->getOperator() );
+
+ AvmCode::iterator itArg = statement->begin();
+ AvmCode::iterator endArg = statement->end();
+ for( ; itArg != endArg ; ++itArg )
+ {
+ if( (*itArg).is< AvmCode >() )
+ {
+ AvmCode * callStatement = (*itArg).to_ptr< AvmCode >();
+
+ if( callStatement->isOpCode(AVM_OPCODE_INVOKE_METHOD) &&
+ callStatement->first().is< Machine >() )
+ {
+ if( otherStatement->nonempty() )
+ {
+ transition->setStatement(
+ StatementConstructor::xnewCodeFlat(OP(SEQUENCE),
+ transition->getStatement(), otherStatement) );
+
+ otherStatement = StatementConstructor::newCode(
+ statement->getOperator() );
+ }
+
+ transition = insertProcedureCall(transition,
+ refId, callStatement->first().to_ptr< Machine >() );
+
+ continue;
+ }
+ }
+
+ otherStatement->append( *itArg );
+ }
+
+ if( otherStatement->nonempty() )
+ {
+ transition->setStatement( StatementConstructor::xnewCodeFlat(
+ OP(SEQUENCE), transition->getStatement(), otherStatement ));
+ }
+ if( not transition->hasTarget() )
+ {
+ transition->setStatement( StatementConstructor::xnewCodeFlat(
+ OP(SEQUENCE), transition->getStatement(),
+ StatementConstructor::newCode( OP(DISABLE_SELF)),
+ StatementConstructor::newCode(
+ OP(ENABLE_SET), INCR_BF(sourceState) ) ) );
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// ROUTINE INVOKATION
+BFCode ParserUtil::invokeRoutine(Routine * aRoutineInstance)
+{
+ if( aRoutineInstance->hasParameters() )
+ {
+ BF bfOP;
+ if( aRoutineInstance->hasModelOperator() )
+ {
+ bfOP = aRoutineInstance->getType();
+ }
+ else
+ {
+ Operator * op = AvmOperationFactory::get(
+ aRoutineInstance->getParameter(0),
+ aRoutineInstance->getType().str() );
+ if( op != NULL )
+ {
+ bfOP = INCR_BF(op);
+ }
+ }
+
+ if( bfOP.valid() )
+ {
+ BFVector::const_iterator it = aRoutineInstance->getParameters().begin();
+ BFVector::const_iterator endIt = aRoutineInstance->getParameters().end();
+
+ BFCode invokeCode( OP(INVOKE_METHOD), (*it), bfOP );
+
+ for( ++it ; it != endIt ; ++it )
+ {
+ invokeCode->append(*it );
+ }
+
+ return( invokeCode );
+ }
+ }
+
+ return( StatementConstructor::newCode(
+ OP(INVOKE_ROUTINE), sep::BF(aRoutineInstance) ) );
+}
+
+
+BFCode ParserUtil::invokeRoutineStatement(Routine * aRoutineInstance)
+{
+ if( aRoutineInstance->hasModel() )
+ {
+// AVM_OS_COUT << str_header(aRoutineInstance) << std::endl;
+// AVM_OS_COUT << str_header(aRoutineInstance->getModel()) << std::endl;
+ if( aRoutineInstance->isInlinableStatement() )
+ {
+ BFCode substCode = aRoutineInstance->inlineStatement();
+ if( substCode.valid() )
+ {
+ return( substCode );
+ }
+ }
+
+ return( StatementConstructor::newCode(
+ OP(INVOKE_ROUTINE), sep::BF(aRoutineInstance) ) );
+ }
+
+ return( invokeRoutine(aRoutineInstance) );
+}
+
+
+BF ParserUtil::invokeRoutineExpression(Routine * aRoutineInstance)
+{
+ if( aRoutineInstance->hasModel() )
+ {
+ if( aRoutineInstance->isInlinableExpression() )
+ {
+ BF substCode = aRoutineInstance->inlineExpression();
+ if( substCode.valid() )
+ {
+ return( substCode );
+ }
+ }
+
+ return( StatementConstructor::newCode(
+ OP(INVOKE_ROUTINE), sep::BF(aRoutineInstance) ) );
+ }
+
+ return( invokeRoutine(aRoutineInstance) );
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/parser/model/ParserUtil.h b/org.eclipse.efm.symbex/src/parser/model/ParserUtil.h
new file mode 100644
index 0000000..e227fda
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/parser/model/ParserUtil.h
@@ -0,0 +1,370 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 9 juil. 2014
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef PARSER_UTIL_H_
+#define PARSER_UTIL_H_
+
+#include <util/avm_string.h>
+#include <common/BF.h>
+
+#include <collection/BFContainer.h>
+#include <collection/Typedef.h>
+
+#include <fml/common/ModifierElement.h>
+
+#include <fml/lib/IComPoint.h>
+
+#include<stack>
+
+
+namespace sep
+{
+
+class BFCode;
+
+class ObjectElement;
+class TraceableElement;
+
+class InstanceOfMachine;
+
+class Machine;
+class Port;
+class Routine;
+class System;
+class Transition;
+
+
+class ParserUtil
+{
+
+public:
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Current Parse Context :
+ // System -> Machine -> Routine
+ struct AvmParseContext
+ {
+ System * system = NULL;
+
+ Machine * machine = NULL;
+
+ Machine * dynamic = NULL;
+
+ Routine * routine = NULL;
+ };
+
+ static AvmParseContext _CTX_;
+
+ static std::stack< AvmParseContext > _CTX_STACK_;
+
+ inline static void pushCTX(Machine * machine)
+ {
+ _CTX_.machine = machine;
+
+ _CTX_STACK_.push( _CTX_ );
+ }
+
+ inline static void pushDynamicCTX(Machine * dynamic)
+ {
+ _CTX_.dynamic = dynamic;
+
+ _CTX_STACK_.push( _CTX_ );
+ }
+
+ inline static void pushCTX(Routine * routine)
+ {
+ _CTX_.routine = routine;
+
+ _CTX_STACK_.push( _CTX_ );
+ }
+
+ inline static void popCTX(Machine * & machine, Routine * & routine)
+ {
+ if( not _CTX_STACK_.empty() )
+ {
+ _CTX_STACK_.pop();
+
+ if( not _CTX_STACK_.empty() )
+ {
+ _CTX_ = _CTX_STACK_.top();
+
+ machine = _CTX_.machine;
+ routine = _CTX_.routine;
+ }
+ }
+ }
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // XLIA_SYNTAX_ERROR_COUNT
+ static avm_size_t XLIA_SYNTAX_ERROR_COUNT;
+
+ /**
+ * OutStream Manipulator
+ * SYNTAX_ERROR_EOL
+ */
+ inline static void SYNTAX_ERROR_EOL(OutStream & os)
+ {
+ os << " !!!" << std::endl;
+ }
+
+
+ inline static WarnOutstreamT & avm_syntax_error(
+ const std::string & rule, avm_size_t line)
+ {
+ ++XLIA_SYNTAX_ERROR_COUNT;
+
+ AVM_OS_WARN << "Error[line:" << line
+ << "] in rule '" << rule << "' :> ";
+
+ return( AVM_OS_WARN );
+ }
+
+ inline static WarnOutstreamT & avm_syntax_error(const std::string & rule)
+ {
+ ++XLIA_SYNTAX_ERROR_COUNT;
+
+ AVM_OS_WARN << "Error in rule '" << rule << "' :> ";
+
+ return( AVM_OS_WARN );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SET LOCATION IN TRACEABLE FORM
+ static void setLocation(TraceableElement * aModelingElement,
+ avm_size_t bLine, avm_size_t eLine);
+
+ static void setLocation(TraceableElement & aModelingElement,
+ avm_size_t bLine, avm_size_t eLine);
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PROLOGUE OPTION
+ static void setPrologueOption(const std::string & id, BF value);
+
+ ////////////////////////////////////////////////////////////////////////////
+ // GET OBJECT BY [Qualified] Name ID
+ static const BF & getObjectByNameID(const std::string & id);
+
+ static const BF & getObjectByQualifiedNameID(
+ const std::string & qnid, avm_size_t count);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // GET VARIABLE BY [ [ Fully ] Qualified ] Name ID
+ static const BF & getvar(const std::string & qnid, avm_size_t count);
+
+ static BF getVariable(const std::string & qnid, avm_size_t count);
+
+ static BF getDataType(const std::string & qnid, avm_size_t count);
+
+ static BF getDataTypeQueue(const std::string & qnid, avm_size_t count);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // GET CONSTANT BY [ [ Fully ] Qualified ] Name ID
+ static const BF & getConstant(
+ const std::string & qnid, avm_size_t count);
+
+ static avm_size_t getIntegerConstant(
+ const std::string & qnid, avm_size_t count);
+
+ static avm_float_t getFloatConstant(
+ const std::string & qnid, avm_size_t count);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // GET BUFFER BY [ [ Fully ] Qualified ] Name ID
+ static BF getBuffer(Machine * machine,
+ const std::string & qnid, avm_size_t count);
+
+ static BF getvarBuffer(const std::string & qnid, avm_size_t count);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // GET CHANNEL BY [ [ Fully ] Qualified ] Name ID
+ static BF getChannel(const std::string & qnid, avm_size_t count);
+
+ static BF getDataTypeChannel(
+ const std::string & qnid, avm_size_t count);
+
+ static void updateSignalRoutingChannel(Modifier::DIRECTION_KIND ioDirection,
+ const BFCode & ioCode, const std::string & qnid, avm_size_t count);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // GET PORT BY [ [ Fully ] Qualified ] Name ID
+ inline static const BF & getComPort(
+ const std::string & qnid, avm_size_t count)
+ {
+ return( getComPort(_CTX_.machine, qnid, count) );
+ }
+
+ static const BF & getComPort(Machine * machine,
+ const std::string & qnid, avm_size_t count);
+
+ static BF getvarPort(const std::string & qnid, avm_size_t count);
+
+ static void appendPortParameter(Port * port,
+ const std::string & label, BFVector & labelledParams,
+ BFList & positionalParams, const BF & param);
+
+ static void computePortParameter(
+ Port * port, const BFCode & ioStatement,
+ BFVector & labelledParams, BFList & positionalParams);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // GET SIGNAL BY [ [ Fully ] Qualified ] Name ID
+ inline static const BF & getComSignal(
+ const std::string & qnid, avm_size_t count)
+ {
+ return( getComSignal(_CTX_.machine, qnid, count) );
+ }
+
+ static const BF & getComSignal(Machine * machine,
+ const std::string & qnid, avm_size_t count);
+
+ static BF getvarSignal(const std::string & qnid, avm_size_t count);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // GET PORT / SIGNAL BY [ [ Fully ] Qualified ] Name ID
+ static const BF & getComPortSignal(
+ const std::string & qnid, avm_size_t count)
+ {
+ return( getComPortSignal(_CTX_.machine, qnid, count) );
+ }
+
+ static const BF & getComPortSignal(Machine * machine,
+ const std::string & qnid, avm_size_t count);
+
+ static BF getvarPortSignal(const std::string & qnid, avm_size_t count);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // GET ROUTINE BY [ [ Fully ] Qualified ] Name ID
+ static Routine * getRoutine(const std::string & id);
+
+ static BF getvarRoutine(const std::string & id);
+
+ ////////////////////////////////////////////////////////////////////////////
+ // GET PROCEDURE BY [ [ Fully ] Qualified ] Name ID
+ static Machine * getProcedure(const std::string & id);
+
+ static BF getvarProcedure(const std::string & id);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // GET MACHINE BY [ [ Fully ] Qualified ] Name ID
+ static Machine * getMachine(Machine * machine,
+ const std::string & qnid, avm_size_t count);
+
+ static BF getvarMachine(const std::string & qnid, avm_size_t count);
+
+ static BF getExecutableMachine(const std::string & qnid, avm_size_t count);
+
+
+ static void appendInstanceMachineParameter(Machine * machine,
+ const std::string & label, BFVector & labelledParams,
+ BFList & positionalParams, const BF & param);
+
+ static void computeInstanceMachineParameter(Machine * machine,
+ BFVector & labelledParams, BFList & positionalParams);
+
+ static void appendInstanceMachineReturn(Machine * machine,
+ const std::string & label, BFVector & labelledReturns,
+ BFList & positionalReturns, const BF & param);
+
+ static void computeInstanceMachineReturn(Machine * machine,
+ BFVector & labelledReturns, BFList & positionalReturns);
+
+
+ static void appendInstanceDynamicPositionalParameter(
+ Machine * anInstance, const BF & rvParameter, avm_size_t position);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // ROUTINE Parameters / Returns arguments
+ static void appendRoutineParameters(Routine * routine,
+ const std::string & label, BFVector & labelledParams,
+ BFList & positionalParams, const BF & param);
+
+ static void appendRoutineReturns(Routine * routine,
+ const std::string & label, BFVector & labelledReturns,
+ BFList & positionalReturns, const BF & param);
+
+ static void computeRoutineParamReturn(const BF & ctxMachine,
+ Routine * routine, BFCode & activityStatement,
+ BFVector & labelledParams, BFList & positionalParams,
+ BFVector & labelledReturns, BFList & positionalReturns);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // ACTIVITY ROUTINE Parameters / Returns arguments
+ static void computeActivityRoutineParamReturn(const BF & ctxMachine,
+ Routine * routine, BFCode & activityStatement,
+ BFVector & labelledParams, BFList & positionalParams,
+ BFVector & labelledReturns, BFList & positionalReturns);
+
+ static void computeActivityRoutineInput(Machine * ctxMachine,
+ Routine * routine, BFCode & invokeSequende,
+ BFVector & labelledParams, BFList & positionalParams);
+
+ static void computeActivityRoutineDefaultOutput(Machine * ctxMachine,
+ Routine * routine, BFCode & invokeSequende,
+ BFVector & labelledReturns, BFList & positionalReturns);
+
+ static void computeActivityRoutineOutput(Machine * ctxMachine,
+ Routine * routine, BFCode & invokeSequende,
+ BFVector & labelledReturns, BFList & positionalReturns);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // GET INVOKABLE BY ID
+ static BF getInvokable(const BF & target, const std::string & id);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DECLARE DEFAULT STATE #final, #terminal, #return if need
+ static void declareDefaultEndingStateIfNeed(
+ ListOfMachine & needDefaultStateFinal,
+ ListOfMachine & needDefaultStateTerminal,
+ ListOfMachine & needDefaultStateReturn);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // INLINE PROCEDURE CALL IN TRANSITION
+ static void checkProcedureCompositeMocKind(Machine * aProcedure);
+
+ static void inlineTransitionProcedureCall(
+ Transition * transition, const std::string & refId);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // ROUTINE INVOKATION
+ static BFCode invokeRoutine(Routine * aRoutineInstance);
+
+ static BFCode invokeRoutineStatement(Routine * aRoutineInstance);
+
+ static BF invokeRoutineExpression(Routine * aRoutineInstance);
+
+};
+
+
+} /* namespace sep */
+
+#endif /* PARSER_UTIL_H_ */
diff --git a/org.eclipse.efm.symbex/src/parser/model/fml.g b/org.eclipse.efm.symbex/src/parser/model/fml.g
new file mode 100644
index 0000000..3ffc5b5
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/parser/model/fml.g
@@ -0,0 +1,6876 @@
+
+grammar fml;
+
+
+options {
+ backtrack=true;
+ memoize=true;
+ k=1;
+ language = C;
+}
+
+@lexer::header {
+
+}
+
+@parser::header {
+
+#include <parser/model/ParserUtil.h>
+
+#include <common/BF.h>
+
+#include <collection/BFContainer.h>
+
+#include <fml/common/BehavioralElement.h>
+#include <fml/common/ModifierElement.h>
+#include <fml/common/SpecifierElement.h>
+
+#include <fml/executable/ExecutableLib.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/BuiltinArray.h>
+#include <fml/expression/ExpressionConstant.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/StatementConstructor.h>
+
+#include <fml/lib/IComPoint.h>
+
+#include <fml/operator/Operator.h>
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/template/TemplateFactory.h>
+
+#include <fml/type/TypeSpecifier.h>
+
+#include <fml/type/TypeManager.h>
+
+#include <fml/infrastructure/Buffer.h>
+#include <fml/infrastructure/Channel.h>
+#include <fml/infrastructure/ComPoint.h>
+#include <fml/infrastructure/ComProtocol.h>
+#include <fml/infrastructure/ComRoute.h>
+#include <fml/infrastructure/Connector.h>
+
+// extern "C" and C++ template incompatibility !!!
+//#include <fml/infrastructure/PropertyPart.h>
+
+#include <fml/infrastructure/DataType.h>
+#include <fml/infrastructure/Machine.h>
+#include <fml/infrastructure/Package.h>
+#include <fml/infrastructure/Port.h>
+#include <fml/infrastructure/Routine.h>
+#include <fml/infrastructure/System.h>
+#include <fml/infrastructure/Transition.h>
+#include <fml/infrastructure/Variable.h>
+
+#include <fml/infrastructure/BehavioralPart.h>
+#include <fml/infrastructure/CompositePart.h>
+#include <fml/infrastructure/InstanceSpecifierPart.h>
+#include <fml/infrastructure/InteractionPart.h>
+#include <fml/infrastructure/ModelOfComputationPart.h>
+
+// extern "C" and C++ template incompatibility !!!
+//#include <fml/infrastructure/PropertyPart.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/UniFormIdentifier.h>
+#include <fml/workflow/WObject.h>
+
+
+//void fmlDisplayRecognitionError(
+// pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_UINT8 * tokenNames);
+
+}
+
+
+@parser::members {
+
+// extern "C" and C++ Template incompatibility !!!
+#include <fml/infrastructure/PropertyPart.h>
+
+
+////////////////////////////////////////////////////////////////////////////////
+// SET LOCATION IN TRACEABLE FORM
+////////////////////////////////////////////////////////////////////////////////
+
+#define SAVE_RULE_BEGIN_LOCATION sep::avm_size_t bLine = LT(1)->getLine(LT(1))
+
+#define SET_RULE_LOCATION(form) \
+ sep::ParserUtil::setLocation(form, bLine, LT(-1)->getLine(LT(-1)))
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// XLIA or XFSP MACRO
+////////////////////////////////////////////////////////////////////////////////
+
+#define OP(op) sep::OperatorManager::OPERATOR_##op
+
+#define NEW_EXPR(e) sep::ExpressionConstructor::newExpr(e)
+
+#define NEW_BOOL(b) sep::ExpressionConstructor::newBoolean((bool) b)
+#define NEW_INTEGER(i) sep::ExpressionConstructor::newInteger(i)
+#define NEW_RATIONAL(q) sep::ExpressionConstructor::newRational(q)
+#define NEW_FLOAT(f) sep::ExpressionConstructor::newFloat(f)
+#define NEW_CHAR(c) sep::ExpressionConstructor::newChar(c)
+#define NEW_STRING(s) sep::ExpressionConstructor::newString(s)
+
+#define NEW_ID(id) sep::ExpressionConstructor::newIdentifier(id)
+#define NEW_QID(id) sep::ExpressionConstructor::newQualifiedIdentifier(id)
+#define NEW_QNID(id, nb) ( (nb > 1)? NEW_QID(id) : NEW_ID(id) )
+
+
+#define NEW_INSTANCE_UFID(machine, var) \
+ sep::ExpressionConstructor::newQualifiedIdentifier( \
+ sep::OSS() << machine->getNameID() << '.' << var->getNameID() )
+
+
+#define NEW_CODE(op) sep::ExpressionConstructor::newCode(op)
+#define NEW_CODE1(op, e) sep::ExpressionConstructor::newCode(op, e)
+#define NEW_CODE2(op, e1, e2) sep::ExpressionConstructor::newCode(op, e1, e2)
+#define NEW_CODE3(op, e1, e2, e3) sep::ExpressionConstructor::newCode(op, e1, e2, e3)
+
+#define NEW_CODE_FLAT(op, e1, e2) sep::ExpressionConstructor::newCodeFlat(op, e1, e2)
+
+#define NEW_STMT(op) sep::StatementConstructor::newCode(op)
+#define NEW_STMT1(op, s) sep::StatementConstructor::newCode(op, s)
+#define NEW_STMT2(op, s1, s2) sep::StatementConstructor::newCode(op, s1, s2)
+#define NEW_STMT3(op, s1, s2, s3) sep::StatementConstructor::newCode(op, s1, s2, s3)
+
+
+#define NEW_STMT_ASSIGN_OP(op, lv, e) \
+ NEW_STMT2(OP(ASSIGN_OP), lv, NEW_CODE1(op, e))
+
+#define NEW_STMT_ASSIGN_OP_AFTER(op, lv, e) \
+ NEW_STMT2(OP(ASSIGN_OP_AFTER), lv, NEW_CODE1(op, e))
+
+
+#define NUM_INT(s) std::atoi((const char*)(s))
+#define NUM_FLOAT(s) std::atof((const char*)(s))
+
+#define CHAR(s) ( *((const char*)(s)) )
+
+#define STR(s) std::string((const char*)(s))
+
+#define STR_ID(s) std::string((const char*)((s->getText(s))->chars))
+
+
+sep::BF new_uminus_expr(sep::BF & arg)
+{
+ if( arg.isNumeric() )
+ {
+ return( sep::ExpressionConstructor::uminusExpr(arg) );
+ }
+ return( NEW_CODE1(OP(UMINUS), arg) );
+}
+
+sep::BF new_not_expr(sep::BF & arg)
+{
+ if( arg.isBoolean() )
+ {
+ return( sep::ExpressionConstructor::notExpr(arg) );
+ }
+ return( NEW_CODE1(OP(NOT), arg) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// PARSER GLOBAL VARIABLE
+////////////////////////////////////////////////////////////////////////////////
+
+// WObject Manager
+sep::WObjectManager * mWObjectManager = NULL;
+
+// Current Diversity prologue specification
+sep::WObject * DIVERITY_PROLOG = sep::WObject::_NULL_;
+
+
+// Current Parse System
+static sep::System * _SYSTEM_ = NULL;
+
+// Current Parse Machine
+static sep::Machine * _CPM_ = NULL;
+
+#define PUSH_CTX_CPM( cpm ) sep::ParserUtil::pushCTX( _CPM_ = cpm )
+
+#define PUSH_CTX_NEW( cpm ) sep::ParserUtil::pushDynamicCTX( _CPM_ = cpm )
+
+
+// Current Parse Routine
+static sep::Routine * _CPR_ = NULL;
+
+#define PUSH_CTX_CPR( cpr ) sep::ParserUtil::pushCTX( _CPR_ = cpr )
+
+// Pop old local parse context & update current machine & routine
+#define POP_CTX sep::ParserUtil::popCTX( _CPM_ , _CPR_ )
+
+#define POP_CTX_IF( cpm ) \
+ if( _CPM_ == cpm ) { sep::ParserUtil::popCTX( _CPM_ , _CPR_ ); }
+
+// Current Parse Routine | Machine | System
+#define _CPRMS_ ( ( _CPR_ != NULL ) \
+ ? static_cast< sep::BehavioralElement * >(_CPR_) \
+ : ( ( _CPM_ != NULL ) \
+ ? static_cast< sep::BehavioralElement * >(_CPM_) \
+ : static_cast< sep::BehavioralElement * >(_SYSTEM_) ) )
+
+
+// Current Parse [ [ Fully ] Qualified ] Name ID
+std::string cpLOCATOR;
+std::vector< std::string > cpQNID;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// DEFAULT STATE #final, #terminal, #return
+////////////////////////////////////////////////////////////////////////////////
+
+static sep::ListOfMachine needDefaultStateFinal;
+
+static sep::ListOfMachine needDefaultStateTerminal;
+
+static sep::ListOfMachine needDefaultStateReturn;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// TRANSITION ID
+////////////////////////////////////////////////////////////////////////////////
+
+static sep::avm_size_t transition_id = 0;
+
+static void resetTransitionID()
+{
+ transition_id = 0;
+}
+
+static std::string newTransitionID(
+ const std::string & id, const std::string & prefix = "t")
+{
+ return( id.empty() ?
+ (sep::OSS() << prefix << '#' << transition_id++).str() : id );
+}
+
+
+static int mInvokeNewInstanceCount = 0;
+
+static std::string newInvokeNewInstanceNameID(
+ sep::Machine * container, const std::string modelNameID)
+{
+ return( sep::OSS() << modelNameID << '#' << mInvokeNewInstanceCount++ );
+}
+
+
+
+static int mProcedureCallCount = 0;
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CONNECT ID
+////////////////////////////////////////////////////////////////////////////////
+
+static sep::avm_size_t buffer_id = 0;
+
+static void resetBufferID()
+{
+ buffer_id = 0;
+}
+
+static std::string newBufferID(const std::string & prefix = sep::Buffer::ANONYM_ID)
+{
+ return( sep::OSS() << prefix << '#' << buffer_id++ );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CONNECT ID
+////////////////////////////////////////////////////////////////////////////////
+
+static sep::avm_size_t connector_id = 0;
+
+static void resetConnectID()
+{
+ connector_id = 0;
+}
+
+static std::string newConnectID(const std::string & id,
+ const std::string & prefix = sep::Connector::ANONYM_ID)
+{
+ return( id.empty() ?
+ (sep::OSS() << prefix << '#' << connector_id++).str() : id );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// PARSER MACRO FOR SEMANTIC PREDICATE FOR KEYWORD DETECTION
+////////////////////////////////////////////////////////////////////////////////
+
+#define IS_KEYWORD(kw) \
+ ( (STR(LT(1)->getText(LT(1))->chars) == kw)? ANTLR3_TRUE : ANTLR3_FALSE )
+
+
+
+void fmlDisplayRecognitionError(
+ pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_UINT8 * tokenNames)
+{
+ pANTLR3_PARSER parser;
+ pANTLR3_TREE_PARSER tparser;
+ pANTLR3_INT_STREAM is;
+ pANTLR3_STRING ttext;
+ pANTLR3_STRING ftext;
+ pANTLR3_EXCEPTION ex;
+ pANTLR3_COMMON_TOKEN theToken;
+ pANTLR3_BASE_TREE theBaseTree;
+ pANTLR3_COMMON_TREE theCommonTree;
+
+ // Retrieve some info for easy reading.
+ //
+ ex = recognizer->state->exception;
+ ttext = NULL;
+
+ // See if there is a 'filename' we can use
+ //
+ if (ex->streamName == NULL)
+ {
+ if (((pANTLR3_COMMON_TOKEN)(ex->token))->type == ANTLR3_TOKEN_EOF)
+ {
+ ANTLR3_FPRINTF(stderr, "-end of input-(");
+ }
+ else
+ {
+ ANTLR3_FPRINTF(stderr, "-unknown source-(");
+ }
+ }
+ else
+ {
+ ftext = ex->streamName->to8(ex->streamName);
+ ANTLR3_FPRINTF(stderr, "\%s(", ftext->chars);
+ }
+
+ // Next comes the line number
+ //
+
+ ANTLR3_FPRINTF(stderr, "\%d) ", recognizer->state->exception->line);
+ ANTLR3_FPRINTF(stderr, " : error \%d : \%s",
+ recognizer->state->exception->type,
+ (pANTLR3_UINT8) (recognizer->state->exception->message));
+
+
+ // How we determine the next piece is dependent on which thing raised the
+ // error.
+ //
+ switch (recognizer->type)
+ {
+ case ANTLR3_TYPE_PARSER:
+
+ // Prepare the knowledge we know we have
+ //
+ parser = (pANTLR3_PARSER) (recognizer->super);
+ tparser = NULL;
+ is = parser->tstream->istream;
+ theToken = (pANTLR3_COMMON_TOKEN)(recognizer->state->exception->token);
+ ttext = theToken->toString(theToken);
+
+ ANTLR3_FPRINTF(stderr, ", at offset \%d", recognizer->state->exception->charPositionInLine);
+ if (theToken != NULL)
+ {
+ if (theToken->type == ANTLR3_TOKEN_EOF)
+ {
+ ANTLR3_FPRINTF(stderr, ", at <EOF>");
+ }
+ else
+ {
+ // Guard against null text in a token
+ //
+ ANTLR3_FPRINTF(stderr, "\n NEAR \%s\n ", ttext == NULL ? (pANTLR3_UINT8)"<no text for the token>" : ttext->chars);
+ }
+ }
+ break;
+
+ case ANTLR3_TYPE_TREE_PARSER:
+
+ tparser = (pANTLR3_TREE_PARSER) (recognizer->super);
+ parser = NULL;
+ is = tparser->ctnstream->tnstream->istream;
+ theBaseTree = (pANTLR3_BASE_TREE)(recognizer->state->exception->token);
+ ttext = theBaseTree->toStringTree(theBaseTree);
+
+ if (theBaseTree != NULL)
+ {
+ theCommonTree = (pANTLR3_COMMON_TREE) theBaseTree->super;
+
+ if (theCommonTree != NULL)
+ {
+ theToken = (pANTLR3_COMMON_TOKEN) theBaseTree->getToken(theBaseTree);
+ }
+ ANTLR3_FPRINTF(stderr, ", at offset \%d", theBaseTree->getCharPositionInLine(theBaseTree));
+ ANTLR3_FPRINTF(stderr, ", near \%s", ttext->chars);
+ }
+ break;
+
+ default:
+
+ ANTLR3_FPRINTF(stderr, "Base recognizer function displayRecognitionError called by unknown parser type - provide override for this function\n");
+ return;
+ break;
+ }
+
+ // Although this function should generally be provided by the implementation, this one
+ // should be as helpful as possible for grammar developers and serve as an example
+ // of what you can do with each exception type. In general, when you make up your
+ // 'real' handler, you should debug the routine with all possible errors you expect
+ // which will then let you be as specific as possible about all circumstances.
+ //
+ // Note that in the general case, errors thrown by tree parsers indicate a problem
+ // with the output of the parser or with the tree grammar itself. The job of the parser
+ // is to produce a perfect (in traversal terms) syntactically correct tree, so errors
+ // at that stage should really be semantic errors that your own code determines and handles
+ // in whatever way is appropriate.
+ //
+ switch (ex->type)
+ {
+ case ANTLR3_UNWANTED_TOKEN_EXCEPTION:
+
+ // Indicates that the recognizer was fed a token which seesm to be
+ // spurious input. We can detect this when the token that follows
+ // this unwanted token would normally be part of the syntactically
+ // correct stream. Then we can see that the token we are looking at
+ // is just something that should not be there and throw this exception.
+ //
+ if (tokenNames == NULL)
+ {
+ ANTLR3_FPRINTF(stderr, " : Extraneous input...");
+ }
+ else
+ {
+ if (ex->expecting == ANTLR3_TOKEN_EOF)
+ {
+ ANTLR3_FPRINTF(stderr, " : Extraneous input - expected <EOF>\n");
+ }
+ else
+ {
+ ANTLR3_FPRINTF(stderr, " : Extraneous input - expected \%s ...\n", tokenNames[ex->expecting]);
+ }
+ }
+ break;
+
+ case ANTLR3_MISSING_TOKEN_EXCEPTION:
+
+ // Indicates that the recognizer detected that the token we just
+ // hit would be valid syntactically if preceeded by a particular
+ // token. Perhaps a missing ';' at line end or a missing ',' in an
+ // expression list, and such like.
+ //
+ if (tokenNames == NULL)
+ {
+ ANTLR3_FPRINTF(stderr, " : Missing token (\%d)...\n", ex->expecting);
+ }
+ else
+ {
+ if (ex->expecting == ANTLR3_TOKEN_EOF)
+ {
+ ANTLR3_FPRINTF(stderr, " : Missing <EOF>\n");
+ }
+ else
+ {
+ ANTLR3_FPRINTF(stderr, " : Missing \%s \n", tokenNames[ex->expecting]);
+ }
+ }
+ break;
+
+ case ANTLR3_RECOGNITION_EXCEPTION:
+
+ // Indicates that the recognizer received a token
+ // in the input that was not predicted. This is the basic exception type
+ // from which all others are derived. So we assume it was a syntax error.
+ // You may get this if there are not more tokens and more are needed
+ // to complete a parse for instance.
+ //
+ ANTLR3_FPRINTF(stderr, " : syntax error...\n");
+ break;
+
+ case ANTLR3_MISMATCHED_TOKEN_EXCEPTION:
+
+ // We were expecting to see one thing and got another. This is the
+ // most common error if we coudl not detect a missing or unwanted token.
+ // Here you can spend your efforts to
+ // derive more useful error messages based on the expected
+ // token set and the last token and so on. The error following
+ // bitmaps do a good job of reducing the set that we were looking
+ // for down to something small. Knowing what you are parsing may be
+ // able to allow you to be even more specific about an error.
+ //
+ if (tokenNames == NULL)
+ {
+ ANTLR3_FPRINTF(stderr, " : syntax error...\n");
+ }
+ else
+ {
+ if (ex->expecting == ANTLR3_TOKEN_EOF)
+ {
+ ANTLR3_FPRINTF(stderr, " : expected <EOF>\n");
+ }
+ else
+ {
+ ANTLR3_FPRINTF(stderr, " : expected \%s ...\n", tokenNames[ex->expecting]);
+ }
+ }
+ break;
+
+ case ANTLR3_NO_VIABLE_ALT_EXCEPTION:
+
+ // We could not pick any alt decision from the input given
+ // so god knows what happened - however when you examine your grammar,
+ // you should. It means that at the point where the current token occurred
+ // that the DFA indicates nowhere to go from here.
+ //
+ ANTLR3_FPRINTF(stderr, " : cannot match to any predicted input...\n");
+
+ break;
+
+ case ANTLR3_MISMATCHED_SET_EXCEPTION:
+
+ {
+ ANTLR3_UINT32 count;
+ ANTLR3_UINT32 bit;
+ ANTLR3_UINT32 size;
+ ANTLR3_UINT32 numbits;
+ pANTLR3_BITSET errBits;
+
+ // This means we were able to deal with one of a set of
+ // possible tokens at this point, but we did not see any
+ // member of that set.
+ //
+ ANTLR3_FPRINTF(stderr, " : unexpected input...\n expected one of : ");
+
+ // What tokens could we have accepted at this point in the
+ // parse?
+ //
+ count = 0;
+ errBits = antlr3BitsetLoad (ex->expectingSet);
+ numbits = errBits->numBits (errBits);
+ size = errBits->size (errBits);
+
+ if (size > 0)
+ {
+ // However many tokens we could have dealt with here, it is usually
+ // not useful to print ALL of the set here. I arbitrarily chose 8
+ // here, but you should do whatever makes sense for you of course.
+ // No token number 0, so look for bit 1 and on.
+ //
+ for (bit = 1; bit < numbits && count < 8 && count < size; bit++)
+ {
+ // TODO: This doesn;t look right - should be asking if the bit is set!!
+ //
+ if (tokenNames[bit])
+ {
+ ANTLR3_FPRINTF(stderr, "\%s\%s", count > 0 ? ", " : "", tokenNames[bit]);
+ count++;
+ }
+ }
+ ANTLR3_FPRINTF(stderr, "\n");
+ }
+ else
+ {
+ ANTLR3_FPRINTF(stderr, "Actually dude, we didn't seem to be expecting anything here, or at least\n");
+ ANTLR3_FPRINTF(stderr, "I could not work out what I was expecting, like so many of us these days!\n");
+ }
+ }
+ break;
+
+ case ANTLR3_EARLY_EXIT_EXCEPTION:
+
+ // We entered a loop requiring a number of token sequences
+ // but found a token that ended that sequence earlier than
+ // we should have done.
+ //
+ ANTLR3_FPRINTF(stderr, " : missing elements...\n");
+ break;
+
+ default:
+
+ // We don't handle any other exceptions here, but you can
+ // if you wish. If we get an exception that hits this point
+ // then we are just going to report what we know about the
+ // token.
+ //
+ ANTLR3_FPRINTF(stderr, " : syntax not recognized...\n");
+ break;
+ }
+
+ // Here you have the token that was in error which if this is
+ // the standard implementation will tell you the line and offset
+ // and also record the address of the start of the line in the
+ // input stream. You could therefore print the source line and so on.
+ // Generally though, I would expect that your lexer/parser will keep
+ // its own map of lines and source pointers or whatever as there
+ // are a lot of specific things you need to know about the input
+ // to do something like that.
+ // Here is where you do it though :-).
+ //
+}
+
+
+}
+
+/*
+@parser::apifuncs
+{
+ // Install custom error message display
+ //
+ RECOGNIZER->displayRecognitionError = fmlDisplayRecognitionError;
+}
+*/
+
+
+// MAIN RULE
+formalML[ sep::WObjectManager & aWObjectManager ]
+returns [ sep::System * spec ]
+@init{
+ mWObjectManager = &( aWObjectManager );
+
+ spec = NULL;
+}
+@after{
+ spec->setWObject(DIVERITY_PROLOG);
+}
+ : prologue_fml
+ ( s=def_system { $spec = $s.sys; }
+// | p=def_package { $spec = $p.pack; }
+ )
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// section PROLOGUE
+////////////////////////////////////////////////////////////////////////////////
+
+prologue_fml
+@init{
+ std::string attrID;
+}
+ : ( '@formalml' { DIVERITY_PROLOG = mWObjectManager->newWSequence(sep::WObject::_NULL_, "formalml" ); }
+ | '@xfml' { DIVERITY_PROLOG = mWObjectManager->newWSequence(sep::WObject::_NULL_, "xfml" ); }
+ | '@fml' { DIVERITY_PROLOG = mWObjectManager->newWSequence(sep::WObject::_NULL_, "fml" ); }
+ | '@diversity' { DIVERITY_PROLOG = mWObjectManager->newWSequence(sep::WObject::_NULL_, "diversity"); }
+ | '@xlia' { DIVERITY_PROLOG = mWObjectManager->newWSequence(sep::WObject::_NULL_, "xlia" ); }
+ | '@xfsp' { DIVERITY_PROLOG = mWObjectManager->newWSequence(sep::WObject::_NULL_, "xfsp" ); }
+ ) ?
+ {
+ if( DIVERITY_PROLOG == sep::WObject::_NULL_ )
+ { DIVERITY_PROLOG = mWObjectManager->newWSequence(sep::WObject::_NULL_, "symbex"); }
+ }
+ LT_
+ ( 'system' { attrID = "system"; }
+ | 'package' { attrID = "package"; }
+ | id=ID { attrID = STR($id.text->chars); }
+ )
+ ( ASSIGN id=ID
+ {
+ DIVERITY_PROLOG->append( mWObjectManager->newWPropertyIdentifier(
+ DIVERITY_PROLOG, attrID, STR($id.text->chars) ) );
+ }
+ )?
+ ( COMMA ( FloatLiteral | ID | StringLiteral ) )*
+ GT
+ COLON
+ ( prologue_attribute )?
+ ( prologue_options )?
+ ;
+
+
+prologue_attribute
+ : '@package' ASSIGN id=ID SEMI
+ {
+ DIVERITY_PROLOG->append( mWObjectManager->newWPropertyIdentifier(
+ DIVERITY_PROLOG, "package", STR($id.text->chars) ) );
+ }
+
+ | '@system' ASSIGN id=ID SEMI
+ {
+ DIVERITY_PROLOG->append( mWObjectManager->newWPropertyIdentifier(
+ DIVERITY_PROLOG, "system", STR($id.text->chars) ) );
+ }
+ ;
+
+
+prologue_options
+ : '@options' LCURLY
+ ( id=ID ASSIGN e=expression SEMI
+ { sep::ParserUtil::setPrologueOption(STR($id.text->chars), $e.bf); }
+ )*
+ RCURLY
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// form MODIFIER
+////////////////////////////////////////////////////////////////////////////////
+
+//modifier_property_specifier
+modifier_declaration
+returns [ sep::Modifier mdfr ]
+ : ( 'final' { mdfr.setFeatureFinal(); }
+// | 'const' { mdfr.setFeatureConst(); }
+
+ | 'static' { mdfr.setFeatureStatic(); }
+
+ | 'volatile' { mdfr.setFeatureVolatile(); }
+ | 'transient' { mdfr.setFeatureTransient(); }
+
+ | 'unsafe' { mdfr.setFeatureUnsafe(); }
+
+ | 'ref' { mdfr.setNatureReference(); }
+// | 'macro' { mdfr.setNatureMacro(); }
+
+ | 'bind' { mdfr.setNatureBind(); }
+
+ | 'public' { mdfr.setVisibilityPublic(); }
+// | 'protected' { mdfr.setVisibilityProtected(); }
+ | 'private' { mdfr.setVisibilityPrivate(); }
+
+ | modifier_set_direction_strict_text[ mdfr ]
+ )+
+ ;
+
+
+//modifier_parameter_specifier
+modifier_direction
+returns [ sep::Modifier mdfr ]
+ : ( '->' | 'in' | 'input' ) { mdfr.setDirectionInput(); }
+ | ( '<-' | 'out' | 'output' ) { mdfr.setDirectionOutput(); }
+ | ( '<->' | 'inout' ) { mdfr.setDirectionInout(); }
+ | ( '<=' | 'return' ) { mdfr.setDirectionReturn(); }
+ ;
+
+modifier_direction_text
+returns [ sep::Modifier mdfr ]
+ : ( 'in' | 'input' ) { mdfr.setDirectionInput(); }
+ | ( 'out' | 'output' ) { mdfr.setDirectionOutput(); }
+ | ( 'inout' ) { mdfr.setDirectionInout(); }
+ | ( 'return' ) { mdfr.setDirectionReturn(); }
+ ;
+
+modifier_set_direction_strict_text
+/*inout*/[ sep::Modifier & mdfr ]
+ : 'input' { mdfr.setDirectionInput(); }
+ | 'output' { mdfr.setDirectionOutput(); }
+ | 'inout' { mdfr.setDirectionInout(); }
+ | 'return' { mdfr.setDirectionReturn(); }
+ ;
+
+modifier_direction_symbol
+returns [ sep::Modifier mdfr ]
+ : '->' { mdfr.setDirectionInput(); }
+ | '<-' { mdfr.setDirectionOutput(); }
+ | '<->' { mdfr.setDirectionInout(); }
+ | '<=' { mdfr.setDirectionReturn(); }
+ ;
+
+
+//modifier_parameter_specifier
+modifier_param
+returns [ sep::Modifier mdfr ]
+ : m=modifier_direction { mdfr = $m.mdfr; }
+
+ | 'final' { mdfr.setFeatureFinal(); }
+ | 'const' { mdfr.setFeatureConst(); }
+
+ | ( '&' | 'ref' ) { mdfr.setNatureReference(); }
+ | 'macro' { mdfr.setNatureMacro(); }
+
+ | 'bind' { mdfr.setNatureBind(); }
+ ;
+
+
+//modifier_procedure_specifier
+procedure_modifier_specifier
+returns [ sep::Modifier mdfr , sep::Specifier spcfr ]
+// : ( 'final' { $mdfr.setFeatureFinal(); }
+
+// | 'volatile' { $mdfr.setFeatureVolatile(); }
+// | 'transient' { $mdfr.setFeatureTransient(); }
+
+// | 'model' { $mdfr.setDesignModel(); }
+// | 'prototype' { $mdfr.setDesignPrototypeStatic(); }
+// | 'instance' { $mdfr.setDesignInstanceStatic(); }
+// | 'dynamic' { $mdfr.setDesignInstanceDynamic(); }
+
+// | 'macro' { $mdfr.setNatureMacro(); }
+
+// | 'public' { $mdfr.setVisibilityPublic(); }
+// | 'protected' { $mdfr.setVisibilityProtected(); }
+// | 'private' { $mdfr.setVisibilityPrivate(); }
+
+
+ : ( 'timed' { $spcfr.setFeatureTimed(); }
+ | 'input_enabled' { $spcfr.setFeatureInputEnabled(); }
+// | 'lifeline' { $spcfr.setFeatureLifeline(); }
+ | 'unsafe' { $mdfr.setFeatureUnsafe(); }
+ )+
+ ;
+
+
+executable_modifier_specifier
+returns [ sep::Modifier mdfr , sep::Specifier spcfr ]
+// : ( 'final' { $mdfr.setFeatureFinal(); }
+
+// | 'volatile' { $mdfr.setFeatureVolatile(); }
+// | 'transient' { $mdfr.setFeatureTransient(); }
+
+ : ( 'model' { $spcfr.setDesignModel(); }
+ | 'prototype' { $spcfr.setDesignPrototypeStatic(); }
+// | 'instance' { $spcfr.setDesignInstanceStatic(); }
+ | 'dynamic' { $spcfr.setDesignInstanceDynamic(); }
+
+// | 'macro' { $mdfr.setNatureMacro(); }
+// | 'bind' { $mdfr.setNatureBind(); }
+
+// | 'public' { $mdfr.setVisibilityPublic(); }
+// | 'protected' { $mdfr.setVisibilityProtected(); }
+// | 'private' { $mdfr.setVisibilityPrivate(); }
+
+ | 'unsafe' { $mdfr.setFeatureUnsafe(); }
+
+ | 'timed' { $spcfr.setFeatureTimed(); }
+ | 'input_enabled' { $spcfr.setFeatureInputEnabled(); }
+ | 'lifeline' { $spcfr.setFeatureLifeline(); }
+ )+
+ ;
+
+instance_modifier_specifier
+returns [ sep::Modifier mdfr , sep::Specifier spcfr ]
+ : ( 'final' { $mdfr.setFeatureFinal(); }
+
+// | 'volatile' { $mdfr.setFeatureVolatile(); }
+// | 'transient' { $mdfr.setFeatureTransient(); }
+
+// | 'model' { $spcfr.setDesignModel(); }
+// | 'prototype' { $spcfr.setDesignPrototypeStatic(); }
+// | 'instance' { $spcfr.setDesignInstanceStatic(); }
+ | 'dynamic' { $spcfr.setDesignInstanceDynamic(); }
+
+// | 'macro' { $mdfr.setNatureMacro(); }
+// | 'bind' { $mdfr.setNatureBind(); }
+
+ | 'public' { $mdfr.setVisibilityPublic(); }
+ | 'protected' { $mdfr.setVisibilityProtected(); }
+ | 'private' { $mdfr.setVisibilityPrivate(); }
+
+ | 'unsafe' { $mdfr.setFeatureUnsafe(); }
+
+ | 'timed' { $spcfr.setFeatureTimed(); }
+ | 'input_enabled' { $spcfr.setFeatureInputEnabled(); }
+ | 'lifeline' { $spcfr.setFeatureLifeline(); }
+ )+
+ ;
+
+
+//modifier_transition_specifier
+modifier_transition
+returns [ sep::Modifier mdfr , sep::Specifier spcfr ]
+// : ( 'final' { $mdfr.setFeatureFinal(); }
+
+// | 'volatile' { $mdfr.setFeatureVolatile(); }
+ : ( 'transient' { $mdfr.setFeatureTransient(); }
+
+// | 'unsafe' { $mdfr.setFeatureUnsafe(); }
+
+ | 'timed' { $spcfr.setFeatureTimed(); }
+ | 'input_enabled' { $spcfr.setFeatureInputEnabled(); }
+ )+
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// section PACKAGE
+////////////////////////////////////////////////////////////////////////////////
+
+def_package
+returns [ sep::Package * pack ]
+@after{
+ POP_CTX;
+
+ sep::ParserUtil::declareDefaultEndingStateIfNeed(needDefaultStateFinal,
+ needDefaultStateTerminal, needDefaultStateReturn);
+}
+ : 'package' id=ID
+ { PUSH_CTX_CPM( $pack = new sep::Package(STR($id.text->chars)) ); }
+
+ ( StringLiteral
+ { $pack->setUnrestrictedName(STR($StringLiteral.text->chars)); }
+ )?
+
+ LCURLY
+ section_header[ pack ] ?
+ section_import[ pack ] ?
+
+ ( section_property[ pack ] )*
+
+ ( section_composite_structure[ pack ] )*
+ RCURLY
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// SYSTEM SPECIFCATION
+////////////////////////////////////////////////////////////////////////////////
+
+def_system
+returns [ sep::System * sys ]
+@init{
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr( sep::Specifier::COMPONENT_SYSTEM_KIND );
+
+ SAVE_RULE_BEGIN_LOCATION;
+}
+@after{
+ POP_CTX;
+
+ sep::ParserUtil::declareDefaultEndingStateIfNeed(needDefaultStateFinal,
+ needDefaultStateTerminal, needDefaultStateReturn);
+
+ SET_RULE_LOCATION(sys);
+}
+ : ( ms=executable_modifier_specifier
+ { mdfr = $ms.mdfr; spcfr.ifnot_define( $ms.spcfr ); }
+ )? 'system'
+
+ ( LT_ ( 'moc:' )? executable_specifier[ spcfr ] GT )?
+ id=ID
+ {
+ PUSH_CTX_CPM( _SYSTEM_ = $sys = new sep::System(STR($id.text->chars)) );
+
+ $sys->getwModifier().override_ifdef( mdfr );
+
+ $sys->getwSpecifier().ifnot_define( spcfr );
+ }
+
+ ( StringLiteral
+ { $sys->setUnrestrictedName(STR($StringLiteral.text->chars)); }
+ )?
+
+ LCURLY
+
+// section_header_import_parameter_property[ sys ]
+
+ section_header[ sys ] ?
+ section_import[ sys ] ?
+
+ ( section_parameter[ sys ] )*
+
+ // Conditional Template Code Generation for @declaration
+ { sep::TemplateFactory::genProperty(sys); }
+
+ ( section_property[ sys ] )*
+
+ ( section_composite_structure[ sys ] )*
+
+ ( section_behavior[ sys ]
+ | section_statemachine[ sys ]
+ )?
+
+ // Conditional Template Code Generation for @moe
+ { sep::TemplateFactory::genBehavior(sys); }
+
+ ( section_model_of_computation[ sys ]
+ | section_model_of_interaction[ sys ]
+ | section_model_of_execution[ sys ]
+ )*
+ RCURLY
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// NEW [ [ FULLY ] QUALIFIED ] NAME ID
+////////////////////////////////////////////////////////////////////////////////
+
+qualifiedNameID
+returns [ std::string s , sep::avm_size_t nb = 1 ]
+@init{
+ cpLOCATOR.clear();
+ cpQNID.clear();
+}
+ : id=ID { $s = STR($id.text->chars); }
+ ( ( DOT { cpQNID.push_back($s); $s = $s + "." ; ++$nb; }
+// | COLON { $s = $s + ":" ; }
+ | COLONx2 { cpLOCATOR = $s; cpQNID.clear(); $s = $s + "::"; }
+ )
+ id=ID { cpQNID.push_back(STR_ID($id)); $s = $s + STR_ID($id); }
+ )*
+ ;
+
+
+integer_constant
+returns [ sep::avm_size_t val ]
+ : n=IntegerLiteral
+ { $val = NUM_INT($n.text->chars); }
+
+ | cid=qualifiedNameID
+ { $val = sep::ParserUtil::getIntegerConstant($cid.s, $cid.nb); }
+ ;
+
+
+float_constant
+returns [ sep::avm_float_t val ]
+ : f=FloatLiteral
+ { $val = NUM_FLOAT($f.text->chars); }
+
+ | cid=qualifiedNameID
+ { $val = sep::ParserUtil::getFloatConstant($cid.s, $cid.nb); }
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// section HEADER
+////////////////////////////////////////////////////////////////////////////////
+
+section_header [ sep::Machine * container ]
+ : '@header:'
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// section IMPORT
+////////////////////////////////////////////////////////////////////////////////
+
+section_import [ sep::Machine * container ]
+ : '@import:' ( include_package )+
+ ;
+
+include_package
+ : '@include'
+ ( StringLiteral SEMI
+ | LCURLY ( StringLiteral )+ RCURLY
+ )
+ ;
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// EXECUTABLE SPECIFCATION
+////////////////////////////////////////////////////////////////////////////////
+/*
+executable_specification
+/* in * [ sep::Machine * container ,
+ sep::Modifier mdfr , sep::Specifier spcfr ]
+returns [ sep::Machine * machine ]
+@init{
+ sep::avm_size_t initialCount = 1;
+ sep::avm_size_t maximalCount = AVM_NUMERIC_MAX_SIZE_T;
+
+ SAVE_RULE_BEGIN_LOCATION;
+}
+@after{
+ POP_CTX;
+
+ SET_RULE_LOCATION(machine);
+}
+ : 'executable'
+ ( LT_
+ ( ( 'moc:' )? executable_specifier[ spcfr ]
+ ( COMMA def_instance_count[ initialCount , maximalCount ] )?
+
+ | def_instance_count[ initialCount , maximalCount ]
+ )?
+ GT )?
+ id=ID
+ {
+ PUSH_CTX_CPM( $machine = sep::Machine::newExecutable(
+ container, STR($id.text->chars), spcfr) );
+
+ $machine->getwModifier().override_ifdef( mdfr );
+
+ container->saveOwnedElement( $machine );
+
+ $machine->getUniqInstanceSpecifier()
+ ->setInstanceCount(initialCount, maximalCount);
+ }
+
+ ( StringLiteral
+ { $machine->setUnrestrictedName(STR($StringLiteral.text->chars)); }
+ )?
+
+ def_machine_parameters[ machine , sep::Modifier::PROPERTY_PARAMETER_MODIFIER ] ?
+
+ def_machine_returns[ machine , sep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER ] ?
+
+ def_body_machine[ machine ]
+ ;
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// FLATTENED SPECIFICATION
+////////////////////////////////////////////////////////////////////////////////
+
+executable_component [ ]
+returns
+ :
+ ;
+*/
+
+////////////////////////////////////////////////////////////////////////////////
+// section PROCEDURE
+////////////////////////////////////////////////////////////////////////////////
+
+section_procedure [ sep::Machine * container ]
+ : '@procedure:'
+ ( p=def_procedure[ container ] )*
+ ;
+
+
+def_procedure [ sep::Machine * container ]
+returns [ sep::Machine * procedure ]
+@init{
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr( sep::Specifier::EXECUTABLE_PROCEDURE_MODEL_SPECIFIER );
+
+ SAVE_RULE_BEGIN_LOCATION;
+}
+@after{
+ POP_CTX;
+
+ sep::ParserUtil::checkProcedureCompositeMocKind(procedure);
+
+ SET_RULE_LOCATION(procedure);
+}
+ : ( ms=procedure_modifier_specifier
+ { mdfr.override_ifdef( $ms.mdfr ); spcfr.override_ifdef( $ms.spcfr ); }
+ )?
+ 'procedure'
+ ( LT_ ( 'moc:' )? executable_specifier[ spcfr ] GT )?
+ id=ID
+ {
+ PUSH_CTX_CPM( $procedure = sep::Machine::newProcedure(
+ container, STR($id.text->chars), spcfr) );
+
+ $procedure->getwModifier().override_ifdef( mdfr );
+
+ container->saveOwnedElement( $procedure );
+ }
+
+ ( StringLiteral
+ { $procedure->setUnrestrictedName(STR($StringLiteral.text->chars)); }
+ )?
+
+ def_machine_parameters[ procedure ] ?
+
+ def_machine_returns[ procedure ,
+ sep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER ] ?
+
+ def_body_procedure[ procedure ]
+ ;
+
+
+def_machine_parameters [ sep::Machine * machine ]
+@init{
+ sep::avm_offset_t offset = 0;
+ sep::Modifier mdfr = sep::Modifier::PROPERTY_PARAMETER_MODIFIER;
+
+ sep::PropertyPart & declProperty = machine->getPropertyPart();
+}
+ : LBRACKET def_machine_variable_parameter_atom[ declProperty , mdfr , offset ]
+ ( COMMA def_machine_variable_parameter_atom[ declProperty , mdfr , ++offset ] )*
+ RBRACKET
+
+ | LPAREN def_machine_variable_parameter_atom[ declProperty , mdfr , offset ]
+ ( COMMA def_machine_variable_parameter_atom[ declProperty , mdfr , ++offset ] )*
+ RPAREN
+ ;
+
+
+def_machine_variable_parameter_atom
+/* in */[ sep::PropertyPart & paramDecl ,
+ sep::Modifier mdfr , sep::avm_offset_t offset ]
+@init{
+ sep::Variable * variable;
+ sep::Machine * machine = paramDecl.getContainer()->as< sep::Machine >();
+ sep::BF paramT = sep::TypeManager::UNIVERSAL;
+ std::string paramID;
+ sep::BF value;
+}
+ : ( m=modifier_param { mdfr.override_ifdef( $m.mdfr ); } )?
+ tv=type_var { paramT = $tv.type; }
+ ( id=ID { paramID = STR($id.text->chars); }
+ ( iv=initial_value { value = $iv.bf; } )?
+ )?
+ {
+ paramDecl.saveOwnedVariable( variable = new sep::Variable(
+ machine, mdfr, paramT, paramID, value ) );
+ }
+
+ | 'bind:'
+ ( ( type_var COLON ) => tv=type_var COLON { paramT = $tv.type; }
+ e=expression { value = $e.bf; }
+ | vid=qualifiedNameID
+ {
+ value = sep::ParserUtil::getVariable($vid.s, $vid.nb);
+ if( value.valid() ) { paramT = value.to_ptr< sep::Variable >()->getType(); }
+ }
+ )
+ {
+ paramID = sep::OSS() << '#' << offset;
+ paramDecl.saveOwnedVariable( variable = new sep::Variable(machine,
+ mdfr.addNatureKind( sep::Modifier::NATURE_BIND_KIND ),
+ paramT, paramID, value ) );
+
+ variable->setOffset( offset );
+ }
+ ;
+
+
+def_machine_returns
+/* in */[ sep::Machine * machine , sep::Modifier mdfr ]
+@init{
+ sep::avm_offset_t offset = 0;
+ mdfr.setDirectionKind( sep::Modifier::DIRECTION_RETURN_KIND );
+ sep::BF value;
+
+ sep::PropertyPart & declProperty = machine->getPropertyPart();
+}
+ : ( '-->' | 'returns:' )
+ ( ( LBRACKET def_machine_variable_return_atom[ declProperty , mdfr , offset]
+ ( COMMA def_machine_variable_return_atom[ declProperty , mdfr , ++offset ] )*
+ RBRACKET
+ )
+
+ | ( LPAREN def_machine_variable_return_atom[ declProperty , mdfr , offset]
+ ( COMMA def_machine_variable_return_atom[ declProperty , mdfr , ++offset ] )*
+ RPAREN
+ )
+
+ | tv=type_var ( iv=initial_value { value = $iv.bf; } )?
+ {
+ sep::Variable * variable =
+ new sep::Variable(machine, mdfr, $tv.type, "#0", value);
+
+ declProperty.saveOwnedVariable( variable );
+ }
+ )
+ ;
+
+
+def_machine_variable_return_atom
+/* in */[ sep::PropertyPart & paramDecl ,
+ sep::Modifier mdfr , sep::avm_offset_t offset ]
+@init{
+ sep::Variable * variable;
+ sep::Machine * machine = paramDecl.getContainer()->as< sep::Machine >();
+ sep::BF paramT = sep::TypeManager::UNIVERSAL;
+ std::string paramID;
+ sep::BF value;
+}
+ : ( m=modifier_param { mdfr.override_ifdef( $m.mdfr ); } )?
+ tv=type_var { paramT = $tv.type; }
+ ( id=ID { paramID = STR($id.text->chars); }
+ ( iv=initial_value { value = $iv.bf; } )?
+ )?
+ {
+ paramDecl.saveOwnedVariable( variable =
+ new sep::Variable(machine, mdfr, paramT, paramID, value) );
+ }
+
+ | 'bind:'
+ ( ( type_var COLON ) => tv=type_var COLON { paramT = $tv.type; }
+ e=expression { value = $e.bf; }
+ | vid=qualifiedNameID
+ {
+ value = sep::ParserUtil::getVariable($vid.s, $vid.nb);
+ if( value.valid() ) { paramT = value.to_ptr< sep::Variable >()->getType(); }
+ }
+ )
+ {
+ paramID = sep::OSS() << '#' << offset;
+
+ variable = new sep::Variable(machine,
+ mdfr.addNatureKind( sep::Modifier::NATURE_BIND_KIND ),
+ paramT, paramID, value);
+
+ paramDecl.saveOwnedVariable( variable );
+
+ variable->setOffset( offset );
+ }
+ ;
+
+
+
+def_body_procedure [ sep::Machine * procedure ]
+ : LCURLY
+ ( ( def_body_machine_using_section_predicat ) =>
+ def_body_procedure_section[ procedure ]
+
+ | def_body_procedure_simplif[ procedure ]
+ )
+ RCURLY
+ ;
+
+def_body_procedure_section [ sep::Machine * procedure ]
+ : section_header[ procedure ] ?
+ section_import[ procedure ] ?
+
+ ( section_parameter[ procedure ] )*
+
+ ( section_property [ procedure ] )*
+
+ ( section_composite_structure[ procedure ] )*
+
+ ( section_behavior[ procedure ]
+ | section_statemachine[ procedure ]
+ )?
+
+ ( section_model_of_computation[ procedure ]
+ | section_model_of_execution[ procedure ]
+ | section_model_of_interaction[ procedure ]
+ )*
+ ;
+
+
+def_body_procedure_simplif [ sep::Machine * procedure ]
+@init{
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr;
+}
+ : ( { mdfr = sep::Modifier::PROPERTY_UNDEFINED_MODIFIER; }
+
+ ( m=modifier_declaration { mdfr = $m.mdfr; } )?
+
+ ( decl_variable[ procedure->getPropertyPart() , mdfr ]
+
+ | ads=any_def_statemachine[ procedure , mdfr , spcfr ]
+
+ | def_state_activity[ procedure ]
+ )
+ )+
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// section COMPOSITE STRUCTURE
+////////////////////////////////////////////////////////////////////////////////
+
+section_composite_structure [ sep::Machine * container ]
+ : section_routine[ container ]
+ | section_procedure[ container ]
+
+ | section_composite_generic[ container ]
+ | section_machine_model[ container ]
+ | section_machine_prototype[ container ]
+ | section_machine_instance[ container ]
+ ;
+
+section_composite_generic [ sep::Machine * container ]
+ : ( '@composite:' | '@executable:' | '@machine:' )
+ ( m=executable_machine[ container ] )*
+ ;
+
+
+section_machine_model [ sep::Machine * container ]
+@init{
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr( sep::Specifier::DESIGN_MODEL_SPECIFIER );
+}
+ : '@model:'
+ ( m=executable_model_definiton[ container , mdfr , spcfr ] )*
+ ;
+
+
+section_machine_prototype [ sep::Machine * container ]
+@init{
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr( sep::Specifier::DESIGN_PROTOTYPE_STATIC_SPECIFIER );
+}
+ : '@prototype:'
+ ( m=executable_model_definiton[ container , mdfr , spcfr ] )*
+ ;
+
+section_machine_instance [ sep::Machine * container ]
+ : '@instance:'
+ ( edi=executable_instance_definiton[ container ] )*
+ ;
+
+
+executable_machine [ sep::Machine * container ]
+returns [ sep::Machine * machine ]
+@init{
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr;
+}
+ : ( ms=executable_modifier_specifier
+ { mdfr = $ms.mdfr; spcfr = $ms.spcfr; }
+ )?
+
+ ( dm=def_machine[ container , mdfr , spcfr ]
+ { $machine = $dm.machine; }
+
+ | ads=any_def_statemachine[ container , mdfr , spcfr ]
+ { $machine = $ads.machine; }
+
+ | emi=decl_instance[ container , mdfr , spcfr ]
+ { $machine = $emi.instance; }
+ )
+ ;
+
+
+executable_model_definiton
+/* in */[ sep::Machine * container ,
+ sep::Modifier mdfr , sep::Specifier spcfr ]
+returns [ sep::Machine * machine ]
+ : ( ms=executable_modifier_specifier
+ { mdfr.override_ifdef( $ms.mdfr ); spcfr.override_ifdef( $ms.spcfr ); }
+ )?
+
+ ( dm=def_machine [ container , mdfr , spcfr ]
+ { $machine = $dm.machine; }
+
+ | ads=def_statemachine[ container , mdfr , spcfr ]
+ { $machine = $ads.machine; }
+ )
+ ;
+
+executable_instance_definiton [ sep::Machine * container ]
+returns [ sep::Machine * instance ]
+@init{
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr( sep::Specifier::DESIGN_INSTANCE_STATIC_SPECIFIER );
+}
+ : ( ms=instance_modifier_specifier
+ { mdfr = $ms.mdfr; spcfr = $ms.spcfr; }
+ )?
+
+ emi=decl_instance[ container , mdfr , spcfr ]
+ { $instance = $emi.instance; }
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// INSTANCE MACHINE
+////////////////////////////////////////////////////////////////////////////////
+
+decl_instance
+/* in */[ sep::Machine * container ,
+ sep::Modifier mdfr , sep::Specifier spcfr ]
+returns [ sep::Machine * instance ]
+@init{
+ sep::BF aModel;
+
+ sep::avm_size_t initialCount = 1;
+ sep::avm_size_t maximalCount = AVM_NUMERIC_MAX_SIZE_T;
+
+ SAVE_RULE_BEGIN_LOCATION;
+}
+@after{
+ if( aModel.is< sep::Machine >() )
+ {
+ POP_CTX;
+ }
+ SET_RULE_LOCATION(instance);
+}
+ : 'instance' ( 'machine' | 'statemachine' )?
+ LT_
+ ( 'model:' )? mm=instance_machine_model { aModel = $mm.model; }
+
+ ( COMMA def_instance_count[ initialCount , maximalCount ] )?
+ GT id=ID
+ {
+ if( aModel.is< sep::Machine >() )
+ {
+ PUSH_CTX_NEW( aModel.to_ptr< sep::Machine >() );
+ }
+
+ $instance = sep::Machine::newInstance(container,
+ STR($id.text->chars), aModel, initialCount, maximalCount);
+
+ $instance->getwModifier().override_ifdef( mdfr );
+
+ $instance->getwSpecifier().override_ifdef(
+ spcfr.isDesignInstanceDynamic() ?
+ spcfr : spcfr.setDesignInstanceStatic() );
+
+ container->saveOwnedElement( $instance );
+ }
+
+ ( StringLiteral
+ { $instance->setUnrestrictedName(STR($StringLiteral.text->chars)); }
+ )?
+/*
+ decl_instance_machine_params [ machine ] ?
+ decl_instance_machine_returns[ machine ] ?
+
+ ( def_body_machine[ machine ] | SEMI )
+*/
+ ( LPAREN
+ ( def_instance_on_new_activity[ $instance ] ) ?
+ RPAREN
+ )?
+
+ ( SEMI
+
+ | LCURLY
+ ( s=statement { instance->getUniqBehaviorPart()->seqOnCreate($s.ac); } )*
+
+ ( def_instance_activity[ $instance ] )*
+ RCURLY
+ )
+ ;
+
+
+def_instance_on_new_activity [ sep::Machine * instance ]
+@init{
+ sep::avm_size_t position = 0;
+}
+ : def_instance_on_new_activity_parameter[ $instance , position++ ]
+ ( COMMA def_instance_on_new_activity_parameter[ $instance , position++ ] )*
+ ;
+
+def_instance_on_new_activity_parameter
+/* in */[ sep::Machine * instance , sep::avm_size_t position ]
+ : ( lvalue op_assign_param ) =>
+ lv=lvalue oap=op_assign_param e=expression
+ { instance->getUniqBehaviorPart()->seqOnCreate( NEW_STMT2($oap.op, $lv.bf, $e.bf) ); }
+
+ | e=expression
+ {
+ sep::ParserUtil::appendInstanceDynamicPositionalParameter(
+ instance, $e.bf, position);
+ }
+ ;
+
+op_assign_param
+returns [ sep::Operator * op ]
+ : ( ASSIGN | COLON ) { $op = OP(ASSIGN); }
+ | ASSIGN_REF { $op = OP(ASSIGN_REF); }
+ | ASSIGN_MACRO { $op = OP(ASSIGN_MACRO); }
+ ;
+
+
+def_instance_activity [ sep::Machine * instance ]
+@init{
+ sep::BehavioralPart * theBehavior = instance->getUniqBehaviorPart();
+}
+ : '@create' bs=block_statement { theBehavior->seqOnCreate($bs.ac); }
+ | '@start' bs=block_statement { theBehavior->seqOnStart($bs.ac); }
+/*
+ | '@init' bs=block_statement { theBehavior->seqOnInit($bs.ac); }
+
+ | '@ienable' bs=block_statement { theBehavior->seqOnIEnable($bs.ac); }
+ | '@enable' bs=block_statement { theBehavior->seqOnEnable ($bs.ac); }
+
+ | '@idisable' bs=block_statement { theBehavior->seqOnIDisable($bs.ac); }
+ | '@disable' bs=block_statement { theBehavior->seqOnDisable ($bs.ac); }
+
+ | '@iabort' bs=block_statement { theBehavior->seqOnIAbort($bs.ac); }
+ | '@abort' bs=block_statement { theBehavior->seqOnAbort($bs.ac); }
+
+ | '@irun' bs=block_statement { theBehavior->seqOnIRun($bs.ac); }
+ | '@run' bs=block_statement { theBehavior->seqOnRun($bs.ac); }
+ | '@rtc' bs=block_statement { theBehavior->seqOnRtc($bs.ac); }
+
+ | '@final' bs=block_statement { theBehavior->seqOnFinal($bs.ac); }
+*/ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// section BEHAVIOR | STATEMACHINE
+////////////////////////////////////////////////////////////////////////////////
+
+section_behavior [ sep::Machine * container ]
+ : '@behavior:'
+ ( m=executable_machine[ container ] )+
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// definition MACHINE
+////////////////////////////////////////////////////////////////////////////////
+
+def_instance_count
+/* in */[ sep::avm_size_t & initial , sep::avm_size_t & maximal ]
+@after{
+ if( $maximal < $initial )
+ {
+ $maximal = $initial;
+ }
+}
+ : ( 'multiplicity:' | 'instance:' )?
+ ( LBRACKET
+ ( n=integer_constant { $initial = $n.val; }
+ COMMA
+ ( n=integer_constant { $maximal = $n.val; }
+ | ( STAR | PLUS ) { $maximal = AVM_NUMERIC_MAX_SIZE_T; }
+ )
+ | STAR { $initial = 0; $maximal = AVM_NUMERIC_MAX_SIZE_T; }
+ | PLUS { $initial = 1; $maximal = AVM_NUMERIC_MAX_SIZE_T; }
+ )
+ RBRACKET
+
+ | LPAREN
+ def_instance_count_atom[ $initial , $maximal ]
+ ( COMMA ? def_instance_count_atom[ $initial , $maximal ] )*
+ RPAREN
+ )
+ ;
+
+def_instance_count_atom
+/* in */[ sep::avm_size_t & initial , sep::avm_size_t & maximal ]
+ : 'init:' n=integer_constant { $initial = $n.val; }
+ | 'max:' n=integer_constant { $maximal = $n.val; }
+ ;
+
+
+def_machine
+/* in */[ sep::Machine * container ,
+ sep::Modifier mdfr , sep::Specifier spcfr ]
+returns [ sep::Machine * machine ]
+@init{
+ sep::avm_size_t initialCount = 1;
+ sep::avm_size_t maximalCount = AVM_NUMERIC_MAX_SIZE_T;
+
+ SAVE_RULE_BEGIN_LOCATION;
+}
+@after{
+ POP_CTX;
+
+ SET_RULE_LOCATION(machine);
+}
+ : 'machine'
+ ( LT_
+ ( ( 'moc:' )? executable_specifier[ spcfr ]
+ ( COMMA def_instance_count[ initialCount , maximalCount ] )?
+
+ | def_instance_count[ initialCount , maximalCount ]
+ )?
+ GT )?
+ id=ID
+ {
+ PUSH_CTX_CPM( $machine = sep::Machine::newExecutable(
+ container, STR($id.text->chars), spcfr) );
+
+ $machine->getwModifier().override_ifdef( mdfr );
+
+ container->saveOwnedElement( $machine );
+
+ $machine->getUniqInstanceSpecifier()->
+ setInstanceCount(initialCount, maximalCount);
+ }
+
+ ( StringLiteral
+ { $machine->setUnrestrictedName(STR($StringLiteral.text->chars)); }
+ )?
+
+ def_machine_parameters[ machine ] ?
+
+ def_machine_returns[ machine , sep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER ] ?
+
+ def_body_machine[ machine ]
+ ;
+
+
+def_body_machine_using_section_header_predicat
+ : '@header:'
+ ;
+
+def_body_machine_using_section_import_predicat
+ : '@import:'
+ ;
+
+def_body_machine_using_section_parameter_predicat
+ : '@parameter:' | '@param:' /* deprecated */
+ | '@input:' | '@inout:' | '@output:'
+ | '@returns:' | '@return:' /* deprecated */
+ ;
+
+def_body_machine_using_section_property_predicat
+ : '@property:' | '@public:' | '@protected:' | '@private:'
+ | '@declaration:' /* deprecated */
+ ;
+
+
+def_body_machine_using_section_predicat
+ : def_body_machine_using_section_header_predicat
+ | def_body_machine_using_section_import_predicat
+ | def_body_machine_using_section_parameter_predicat
+ | def_body_machine_using_section_property_predicat
+
+ | '@macro:' | '@routine' | '@procedure:'
+
+ | '@composite' | '@machine:'
+ | '@region:' | '@statemachine:'
+
+ | '@behavior:' | '@transition:'
+
+ // Model Of { Computation , Execution , Interaction }
+ | '@moc:' | '@moe:' | '@com:' | '@interaction:'
+ ;
+
+
+def_body_machine [ sep::Machine * machine ]
+ : LCURLY
+ //( def_body_machine_using_section_predicat ) =>
+ def_body_machine_section[ machine ]
+
+ //| def_body_machine_simplif[ machine ]
+ RCURLY
+ ;
+
+def_body_machine_section [ sep::Machine * machine ]
+ : section_header[ machine ] ?
+ section_import[ machine ] ?
+
+ ( section_parameter[ machine ] )*
+
+ // Conditional Template Code Generation for @declaration
+ { sep::TemplateFactory::genProperty( machine ); }
+
+ ( section_property [ machine ] )*
+
+ ( section_composite_structure[ machine ] )*
+
+ ( section_behavior[ machine ]
+ | section_statemachine[ machine ]
+ )?
+
+ // Conditional Template Code Generation for @moe
+ { sep::TemplateFactory::genBehavior(machine); }
+
+ ( section_model_of_computation[ machine ]
+ | section_model_of_execution[ machine ]
+ | section_model_of_interaction[ machine ]
+ )*
+ ;
+
+def_body_machine_simplif [ sep::Machine * machine ]
+@init{
+ sep::PropertyPart & declProperty = machine->getPropertyPart();
+}
+ : ( ( property_declaration[ declProperty ,
+ sep::Modifier::PROPERTY_UNDEFINED_MODIFIER ]
+ )*
+
+ | ( def_moe_primitive[ machine ] )+
+ )
+ ;
+
+////////////////////////////////////////////////////////////////////////////////
+// definition STATEMACHINE
+////////////////////////////////////////////////////////////////////////////////
+
+any_def_statemachine
+/* in */[ sep::Machine * container ,
+ sep::Modifier mdfr , sep::Specifier spcfr ]
+returns [ sep::Machine * machine ]
+ : ( ms=executable_modifier_specifier
+ { mdfr.override_ifdef( $ms.mdfr ); spcfr.override_ifdef( $ms.spcfr ); }
+ )?
+
+ ( st=def_state_singleton[ container , mdfr , spcfr ]
+ { $machine = $st.state; }
+
+ | st=def_state[ container , mdfr , spcfr ]
+ { $machine = $st.state; }
+
+ | sm=def_statemachine[ container , mdfr , spcfr ]
+ { $machine = $sm.machine; }
+ )
+ ;
+
+
+def_statemachine
+/* in */[ sep::Machine * container ,
+ sep::Modifier mdfr , sep::Specifier spcfr ]
+returns [ sep::Machine * machine ]
+@init{
+// resetTransitionID();
+ resetConnectID();
+ resetBufferID();
+
+ sep::avm_size_t initialCount = 1;
+ sep::avm_size_t maximalCount = AVM_NUMERIC_MAX_SIZE_T;
+
+ SAVE_RULE_BEGIN_LOCATION;
+}
+@after{
+ POP_CTX;
+
+ SET_RULE_LOCATION(machine);
+}
+ : 'statemachine'
+ ( LT_
+ ( ( 'moc:' )? executable_specifier[ spcfr ]
+ ( COMMA def_instance_count[ initialCount , maximalCount ] )?
+
+ | def_instance_count[ initialCount , maximalCount ]
+ )?
+ GT
+ )?
+
+ ( id=ID
+ {
+ if( spcfr.isUndefined() )
+ {
+ spcfr.setComponentExecutable();
+ }
+ PUSH_CTX_CPM( $machine = sep::Machine::newStatemachine(
+ container, STR($id.text->chars), spcfr) );
+
+ $machine->getwModifier().override_ifdef( mdfr );
+
+ container->saveOwnedElement( $machine );
+
+ $machine->getUniqInstanceSpecifier()->
+ setInstanceCount(initialCount, maximalCount);
+ }
+
+ | ( LBRACKET { spcfr.setGroupSome(); }
+ | LBRACKET_EXCEPT { spcfr.setGroupExcept(); }
+ )
+ {
+ PUSH_CTX_CPM( $machine = sep::Machine::newStatemachine(
+ container, "[]", spcfr/*, type*/) );
+
+ $machine->getwModifier().override_ifdef( mdfr );
+
+ container->saveOwnedElement( $machine );
+
+ $machine->getUniqInstanceSpecifier()->
+ setInstanceCount(initialCount, maximalCount);
+ }
+
+ ( id=ID { $machine->appendGroupId( STR($id.text->chars) ); }
+ ( COMMA id=ID { $machine->appendGroupId( STR($id.text->chars) ); } )*
+
+ | STAR
+ { $machine->getwSpecifier().setGroupEvery(); }
+ )
+ RBRACKET { $machine->setGroupId(); }
+ )
+
+ ( StringLiteral
+ { $machine->setUnrestrictedName(STR($StringLiteral.text->chars)); }
+ )?
+
+ def_machine_parameters[ machine ] ?
+
+ def_machine_returns[ machine , sep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER ] ?
+
+ def_body_statemachine[ machine ]
+ ;
+
+
+//!![MIGRATION]:INSTANCE
+/*
+decl_instance_statemachine [ sep::Machine * container ]
+returns [ sep::Machine * machine ]
+@init{
+// resetTransitionID();
+ resetConnectID();
+ resetBufferID();
+
+ sep::Specifier spcfr;
+
+ sep::BF aModel;
+
+ sep::avm_size_t initialCount = 1;
+ sep::avm_size_t maximalCount = AVM_NUMERIC_MAX_SIZE_T;
+
+ SAVE_RULE_BEGIN_LOCATION;
+}
+@after{
+ POP_CTX;
+
+ SET_RULE_LOCATION(machine);
+}
+ : 'statemachine'
+ LT_
+ ( ( 'moc:' )? executable_specifier[ spcfr ] COMMA )?
+ ( 'model:' )? mm=instance_machine_model { aModel = $mm.model; }
+
+ ( COMMA def_instance_count[ initialCount , maximalCount ] )?
+ GT id=ID
+ {
+ if( spcfr.isUndefined() )
+ {
+ spcfr.setComponentStatemachine();
+ }
+ PUSH_CTX_CPM( $machine = sep::Machine::newStatemachineInstance(
+ container, STR($id.text->chars), spcfr, aModel) );
+
+ $machine->getwSpecifier().setDesignInstanceStatic();
+
+ container->saveOwnedElement( $machine );
+
+ $machine->getUniqInstanceSpecifier()->
+ setInstanceCount(initialCount, maximalCount);
+ }
+
+ ( StringLiteral
+ { $machine->setUnrestrictedName(STR($StringLiteral.text->chars)); }
+ )?
+
+ decl_instance_machine_params [ machine ] ?
+ decl_instance_machine_returns[ machine ] ?
+
+ ( def_body_statemachine[ machine ] | SEMI )
+ ;
+*/
+
+def_body_statemachine [ sep::Machine * machine ]
+ : LCURLY
+ section_header[ machine ] ?
+ section_import[ machine ] ?
+
+ ( section_parameter[ machine ] )*
+
+ // Conditional Template Code Generation for @declaration
+ { sep::TemplateFactory::genProperty( machine ); }
+
+ ( section_property [ machine ] )*
+
+ ( section_composite_structure[ machine ] )*
+
+ section_region[ machine ] ?
+
+ section_transition[ machine ] ?
+
+ // Conditional Template Code Generation for @moe
+ { sep::TemplateFactory::genBehavior(machine); }
+
+ ( section_model_of_computation[ machine ]
+ | section_model_of_execution[ machine ]
+ | section_model_of_interaction[ machine ]
+ )*
+ RCURLY
+ ;
+
+
+section_region [ sep::Machine * container ]
+@init{
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr;
+}
+ : '@region:'
+ { container->getwSpecifier().setMocStateTransitionSystem(); }
+
+ ( m=any_def_statemachine[ container , mdfr , spcfr ] )+
+ ;
+
+section_statemachine [ sep::Machine * container ]
+@init{
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr;
+}
+ : '@statemachine:'
+ { container->getwSpecifier().setMocStateTransitionSystem(); }
+
+ ( m=any_def_statemachine[ container , mdfr , spcfr ] )+
+ ;
+
+
+
+def_state
+/* in */[ sep::Machine * container ,
+ sep::Modifier mdfr , sep::Specifier spcfr ]
+returns [ sep::Machine * state = NULL ]
+@init{
+ std::string sid;
+
+ SAVE_RULE_BEGIN_LOCATION;
+}
+@after{
+ POP_CTX;
+
+ SET_RULE_LOCATION(state);
+}
+ : 'state'
+ ( LT_ ( 'moc:' )? executable_specifier[ spcfr ] GT
+ { sid = "$" + spcfr.strAnyStateMoc(""); }
+ )?
+ ( id=state_id
+ {
+ if( spcfr.couldBeStateMocSIMPLE() )
+ {
+ spcfr.setStateMocSIMPLE();
+ }
+
+ PUSH_CTX_CPM(
+ $state = sep::Machine::newState(container, $id.s, spcfr) );
+
+ $state->getwModifier().override_ifdef( mdfr );
+
+ container->saveOwnedElement( $state );
+ }
+
+ | ( LBRACKET { spcfr.setGroupSome(); }
+ | LBRACKET_EXCEPT { spcfr.setGroupExcept(); }
+ )
+ {
+ PUSH_CTX_CPM(
+ $state = sep::Machine::newState(container, "[]", spcfr) );
+
+ container->saveOwnedElement( $state );
+
+ $state->getwModifier().override_ifdef( mdfr );
+ }
+
+ ( id=state_id { $state->appendGroupId( $id.s ); }
+ ( COMMA id=state_id { $state->appendGroupId( $id.s ); } )*
+
+ | STAR
+ { $state->getwSpecifier().setGroupEvery(); }
+ )
+ RBRACKET { $state->setGroupId(); }
+ )?
+
+ {
+ if( $state == NULL )
+ {
+ PUSH_CTX_CPM(
+ $state = sep::Machine::newState(container, sid, spcfr) );
+
+ $state->getwModifier().override_ifdef( mdfr );
+
+ container->saveOwnedElement( $state );
+ }
+ }
+
+ ( StringLiteral
+ { $state->setUnrestrictedName(STR($StringLiteral.text->chars)); }
+ )?
+
+ ( def_body_state[ state ] | SEMI )
+ ;
+
+
+state_kw_id
+returns [ std::string s ]
+ : '#init' { $s = "#init" ; }
+ | '#initial' { $s = "#initial" ; }
+ | '#start' { $s = "#start" ; }
+
+ | '#dhistory' { $s = "#dhistory"; }
+ | '#shistory' { $s = "#shistory"; }
+
+ | '#final'
+ { $s = "#final" ; needDefaultStateFinal.remove(_CPM_); }
+
+ | '#terminal'
+ { $s = "#terminal"; needDefaultStateTerminal.remove(_CPM_); }
+
+ | '#return'
+ { $s = "#return" ; needDefaultStateReturn.remove(_CPM_); }
+ ;
+
+state_id
+returns [ std::string s ]
+ : kw=state_kw_id { $s = $kw.s; }
+ | id=ID { $s = STR($id.text->chars); }
+ | DOLLAR id=ID { $s = "$" + STR($id.text->chars); }
+ ;
+
+
+
+
+def_state_singleton
+/* in */[ sep::Machine * container ,
+ sep::Modifier mdfr , sep::Specifier spcfr ]
+returns [ sep::Machine * state ]
+@init{
+ SAVE_RULE_BEGIN_LOCATION;
+}
+@after{
+ state->getwModifier().override_ifdef( mdfr );
+
+ POP_CTX;
+
+ SET_RULE_LOCATION(state);
+}
+ : ( '#initial'
+ {
+ PUSH_CTX_CPM( $state = sep::Machine::newState(
+ container, "#initial", spcfr.setPseudostateMocINITIAL()) );
+
+ container->saveOwnedElement( $state );
+ }
+
+ | '#start'
+ {
+ PUSH_CTX_CPM( $state = sep::Machine::newState(
+ container, "#start", spcfr.setStateMocSTART()) );
+
+ container->saveOwnedElement( $state );
+ }
+
+ | '#dhistory'
+ {
+ PUSH_CTX_CPM( $state = sep::Machine::newState(
+ container, "#dhistory",
+ spcfr.setPseudostateMocDEEP_HISTORY()) );
+
+ container->saveOwnedElement( $state );
+ }
+
+ | '#shistory'
+ {
+ PUSH_CTX_CPM( $state = sep::Machine::newState(
+ container, "#shistory",
+ spcfr.setPseudostateMocSHALLOW_HISTORY()) );
+
+ container->saveOwnedElement( $state );
+ }
+ )
+ LCURLY def_body_state_simplif[ state ] RCURLY
+
+ | '#final' bs=block_statement
+ {
+ PUSH_CTX_CPM( $state = sep::Machine::newState(
+ container, "#final", spcfr.setStateMocFINAL()) );
+
+ container->saveOwnedElement( $state );
+
+ $state->getUniqBehaviorPart()->seqOnFinal($bs.ac);
+
+ needDefaultStateFinal.remove(container);
+ }
+
+ | '#terminal' bs=block_statement
+ {
+ PUSH_CTX_CPM( $state = sep::Machine::newState(
+ container, "#terminal", spcfr.setPseudostateMocTERMINAL()) );
+
+ container->saveOwnedElement( $state );
+
+ $state->getUniqBehaviorPart()->seqOnFinal($bs.ac);
+
+ needDefaultStateTerminal.remove(container);
+ }
+
+ | '#return' bs=block_statement
+ {
+ PUSH_CTX_CPM( $state = sep::Machine::newState(
+ container, "#return", spcfr.setPseudostateMocRETURN()) );
+
+ container->saveOwnedElement( $state );
+
+ $state->getUniqBehaviorPart()->seqOnFinal($bs.ac);
+
+ needDefaultStateReturn.remove(container);
+ }
+ ;
+
+
+executable_specifier [ sep::Specifier & spcfr ]
+ : ka=executable_specifier_atom[ spcfr ]
+ ( BAND ka=executable_specifier_atom[ spcfr ] )*
+ ;
+
+
+executable_specifier_atom [ sep::Specifier & spcfr ]
+ : id=ID { spcfr.setMoc( STR($id.text->chars) ); }
+
+// | 'simple' { spcfr.setStateMocSIMPLE(); }
+ | 'start' { spcfr.setStateMocSTART(); }
+ | 'final' { spcfr.setStateMocFINAL(); }
+// | 'sync' { spcfr.setStateMocSYNC(); }
+
+// | 'initial' { spcfr.setPseudostateMocINITIAL(); }
+// | 'terminal' { spcfr.setPseudostateMocTERMINAL(); }
+ | 'return' { spcfr.setPseudostateMocRETURN(); }
+
+// | 'junction' { spcfr.setPseudostateMocJUNCTION(); }
+ | 'choice' { spcfr.setPseudostateMocCHOICE(); }
+
+ | 'fork' { spcfr.setPseudostateMocFORK(); }
+ | 'join' { spcfr.setPseudostateMocJOIN(); }
+
+// | 'dhistory' { spcfr.setPseudostateMocDEEP_HISTORY(); }
+// | 'shistory' { spcfr.setPseudostateMocSHALLOW_HISTORY(); }
+
+ | 'and' { spcfr.setMocCompositeStructure(); }
+ | 'or' { spcfr.setMocStateTransitionSystem(); }
+ | '#sts' { spcfr.setMocStateTransitionSystem(); }
+ | '#stf' { spcfr.setMocStateTransitionFlow(); }
+ | 'flow' { spcfr.setCompositeMocDataFlow(); }
+ ;
+
+
+
+instance_machine_model
+returns [ sep::BF model ]
+ : tid=qualifiedNameID
+ {
+ $model = sep::ParserUtil::getExecutableMachine($tid.s, $tid.nb);
+ if( $model.invalid() )
+ {
+ sep::ParserUtil::avm_syntax_error(
+ "instance_machine_model", LT(0)->getLine(LT(0)) )
+ << "unexpected ID< " << $tid.s << " >"
+ << sep::ParserUtil::SYNTAX_ERROR_EOL;
+ }
+ }
+ ;
+
+
+def_body_state [ sep::Machine * state ]
+ : LCURLY
+ ( ( def_body_machine_using_section_predicat ) =>
+ def_body_state_section[ state ]
+
+ | def_body_state_simplif[ state ]
+ )
+ RCURLY
+ ;
+
+def_body_state_section [ sep::Machine * machine ]
+ : ( section_property[ machine ] )*
+
+ ( section_composite_structure[ machine ] )*
+
+ section_region[ machine ] ?
+
+ section_transition[ machine ] ?
+
+ ( section_model_of_computation[ machine ]
+ | section_model_of_execution[ machine ]
+ | section_model_of_interaction[ machine ]
+ )*
+ ;
+
+def_body_state_simplif [ sep::Machine * state ]
+@init{
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr;
+}
+ : ( { mdfr = sep::Modifier::PROPERTY_UNDEFINED_MODIFIER; }
+
+ ( m=modifier_declaration { mdfr = $m.mdfr; } )?
+
+ ( decl_variable[ state->getPropertyPart() , mdfr ]
+
+ | ads=any_def_statemachine[ state , mdfr , spcfr ]
+
+ | def_transition[ state , mdfr , spcfr ]
+
+ | def_state_activity[ state ]
+ )
+ )*
+ ;
+
+section_transition [ sep::Machine * state ]
+@init{
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr;
+}
+ : '@transition:'
+ ( ( m=modifier_transition { mdfr = $m.mdfr; } )?
+ def_transition[ state , mdfr , spcfr ]
+ )*
+ ;
+
+def_transition
+/* in */[ sep::Machine * state ,
+ sep::Modifier mdfr , sep::Specifier spcfr ]
+@init{
+ sep::Transition * trans = NULL;
+ std::string t_id;
+
+ mProcedureCallCount = 0;
+
+ SAVE_RULE_BEGIN_LOCATION;
+}
+@after{
+ if( (mProcedureCallCount > 0) && (trans != NULL) )
+ {
+ sep::ParserUtil::inlineTransitionProcedureCall(trans, trans->getNameID());
+ }
+
+ SET_RULE_LOCATION(trans);
+}
+ : ( tok='@'
+ | ( tok=AT_ID { t_id = STR($tok.text->chars); } )
+ )
+ {
+ state->getUniqBehaviorPart()->saveOutgoingTransition(
+ trans = new sep::Transition(state, newTransitionID(t_id)) );
+
+ trans->setModifier( mdfr );
+
+ trans->setSpecifier( spcfr );
+ }
+ ( LT_ moc_transition[ trans ] GT )?
+
+ moe_transition[ trans ]
+
+ | 'transition'
+ {
+ state->getUniqBehaviorPart()->saveOutgoingTransition(
+ trans = new sep::Transition(state) );
+
+ trans->setModifier( mdfr );
+
+ trans->setSpecifier( spcfr );
+ }
+ ( LT_ moc_transition[ trans ] GT )?
+
+ ( id=ID { t_id = STR($id.text->chars); } )?
+ { trans->fullyUpdateAllNameID( newTransitionID(t_id) ); }
+
+ ( StringLiteral
+ { trans->setUnrestrictedName(STR($StringLiteral.text->chars)); }
+ )?
+
+ moe_transition[ trans ]
+ ;
+
+kind_transition
+returns [ sep::Transition::MOC_KIND kind ]
+ : id=ID
+ {
+ if( ($kind = sep::Transition::toMocKind(STR($id.text->chars))) ==
+ sep::Transition::MOC_UNDEFINED_KIND )
+ {
+ sep::ParserUtil::avm_syntax_error( "kind_transition", $id.line )
+ << "unexpected ID< " << STR($id.text->chars) << " >"
+ << sep::ParserUtil::SYNTAX_ERROR_EOL;
+ }
+ }
+// | 'simple' { $kind = sep::Transition::MOC_SIMPLE_KIND; }
+ | 'abort' { $kind = sep::Transition::MOC_ABORT_KIND; }
+ | 'final' { $kind = sep::Transition::MOC_FINAL_KIND; }
+ | 'else' { $kind = sep::Transition::MOC_ELSE_KIND; }
+// | 'internal' { $kind = sep::Transition::MOC_INTERNAL_KIND; }
+// | 'auto' { $kind = sep::Transition::MOC_AUTO_KIND; }
+ | 'flow' { $kind = sep::Transition::MOC_FLOW_KIND; }
+ ;
+
+
+moc_transition_attribute
+returns [ sep::Transition::moc_kind_t kind ]
+@init{
+ $kind = sep::Transition::MOC_UNDEFINED_KIND;
+}
+ : kt=kind_transition { $kind = $kt.kind; }
+ ( BAND 'else' { $kind = $kind | sep::Transition::MOC_ELSE_KIND; } )?
+ ;
+
+moc_transition [ sep::Transition * trans ]
+ : moc_transition_atom[ trans ] ( COMMA moc_transition_atom[ trans ] )*
+ ;
+
+moc_transition_atom [ sep::Transition * trans ]
+ : ( 'moc:' )? kt=moc_transition_attribute
+ { trans->setMocKind( $kt.kind ); }
+
+ | ( 'prior:' )? n=integer_constant
+ { trans->setPriority( $n.val ); }
+
+ | ( 'proba:' )? p=float_constant
+ { trans->setProbability( $p.val ); }
+ ;
+
+
+moe_transition [ sep::Transition * trans ]
+ : bs=transition_statement { trans->setStatement($bs.ac); }
+ ( ( '-->' )?
+ tid=target_state_id { trans->setTarget($tid.target); }
+// ( COMMA tid=target_state_id { trans->appendTarget($tid.target); } )*
+ SEMI )?
+
+ | '-->' tid=target_state_id { trans->setTarget($tid.target); }
+// ( COMMA tid=target_state_id { trans->appendTarget($tid.target); } )*
+ ( bs=transition_statement { trans->setStatement($bs.ac); }
+ | SEMI
+ )
+ ;
+
+transition_statement
+returns [ sep::BFCode ac ]
+@init{
+ sep::Operator * op = OP(SEQUENCE);
+ bool implicitSequenceOp = true;
+}
+@after{
+ if( implicitSequenceOp && $ac.valid() && $ac->singleton() &&
+ sep::OperatorManager::isSchedule(op) )
+ {
+ sep::BFCode singleCode = $ac->first().bfCode();
+ $ac = singleCode;
+ }
+}
+ : LCURLY ( o=op_block { op = $o.op; implicitSequenceOp = false; } )?
+ { $ac = NEW_STMT(op); }
+ ( s=statement { $ac->append($s.ac); } )*
+
+ ( transition_trigger[ ac ] )?
+ ( transition_guard[ ac ] )?
+ ( transition_timed_guard[ ac ] )?
+ ( transition_effect[ ac ] )?
+ RCURLY
+ ;
+
+transition_trigger [ sep::BFCode & ac ]
+ : '@trigger:' ( s=statement_com_input { $ac->append( $s.ac ); } )*
+ ;
+
+transition_guard [ sep::BFCode & ac ]
+ : '@guard:'
+ ( s=statement_guard
+ { $ac->append( $s.ac ); }
+
+ | e=expression
+ { $ac->append( NEW_STMT1(OP(GUARD), $e.bf) ); }
+
+ | LBRACKET e=expression RBRACKET
+ { $ac->append( NEW_STMT1(OP(GUARD), $e.bf) ); }
+ )*
+ ;
+
+transition_timed_guard [ sep::BFCode & ac ]
+ : '@tguard:'
+ ( s=statement_timed_guard
+ { $ac->append( $s.ac ); }
+
+ | e=expression
+ { $ac->append( NEW_STMT1(OP(TIMED_GUARD), $e.bf) ); }
+
+ | LCURLY e=expression RCURLY
+ { $ac->append( NEW_STMT1(OP(TIMED_GUARD), $e.bf) ); }
+ )*
+ ;
+
+transition_effect [ sep::BFCode & ac ]
+ : '@effect:' ( s=statement { $ac->append( $s.ac ); } )*
+ ;
+
+
+target_state_id
+returns [ sep::BF target ]
+@init{
+ std::string tid;
+ sep::avm_size_t nb = 1;
+}
+@after{
+ if( (target = sep::ParserUtil::getvarMachine(tid, nb)).invalid() )
+ {
+ target = NEW_QNID(tid, nb);
+ }
+}
+ : kw=target_state_kw_id { tid = $kw.s; }
+
+ | u=qualifiedNameID { tid = $u.s; nb = $u.nb; }
+
+ | DOLLAR id=ID { tid ="$" + STR($id.text->chars); }
+ ;
+
+
+target_state_kw_id
+returns [ std::string s ]
+ : '#init' { $s = "#init" ; }
+ | '#initial' { $s = "#initial" ; }
+ | '#start' { $s = "#start" ; }
+
+ | '#dhistory' { $s = "#dhistory"; }
+ | '#shistory' { $s = "#shistory"; }
+
+ | '#final'
+ { $s = "#final";
+ needDefaultStateFinal.push_back(_CPM_->getContainerMachine()); }
+
+ | '#terminal'
+ { $s = "#terminal";
+ needDefaultStateTerminal.push_back(_CPM_->getContainerMachine()); }
+
+ | '#return'
+ { $s = "#return";
+ needDefaultStateReturn.push_back(_CPM_->getContainerMachine()); }
+ ;
+
+
+def_state_activity [ sep::Machine * state ]
+@init{
+ sep::BehavioralPart * theBehavior = state->getUniqBehaviorPart();
+}
+ : '@create' bs=block_statement { theBehavior->seqOnCreate($bs.ac); }
+ | '@init' bs=block_statement { theBehavior->seqOnInit($bs.ac); }
+
+ | '@ienable' bs=block_statement { theBehavior->seqOnIEnable($bs.ac); }
+ | '@enable' bs=block_statement { theBehavior->seqOnEnable ($bs.ac); }
+
+ | '@idisable' bs=block_statement { theBehavior->seqOnIDisable($bs.ac); }
+ | '@disable' bs=block_statement { theBehavior->seqOnDisable ($bs.ac); }
+
+ | '@iabort' bs=block_statement { theBehavior->seqOnIAbort($bs.ac); }
+ | '@abort' bs=block_statement { theBehavior->seqOnAbort($bs.ac); }
+
+ | '@irun' bs=block_statement { theBehavior->seqOnIRun($bs.ac); }
+ | '@run' bs=block_statement { theBehavior->seqOnRun($bs.ac); }
+ | '@rtc' bs=block_statement { theBehavior->seqOnRtc($bs.ac); }
+
+ | '@final' bs=block_statement { theBehavior->seqOnFinal($bs.ac); }
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// SECTION HEADER IMPORT PARAMETER PROPERTY or DEFAULT DECLARATION
+////////////////////////////////////////////////////////////////////////////////
+
+section_header_import_parameter_property
+/* in */[ sep::Machine * container ]
+ : ( def_body_machine_using_section_header_predicat ) =>
+ section_header[ container ]
+
+ ( section_import[ container ] )?
+
+ ( section_parameter[ container ] )?
+
+ // Conditional Template Code Generation for @declaration
+ { sep::TemplateFactory::genProperty( container ); }
+
+ ( section_property[ container ] )*
+
+ | ( def_body_machine_using_section_import_predicat ) =>
+ section_import[ container ]
+
+ ( section_parameter[ container ] )?
+
+ // Conditional Template Code Generation for @declaration
+ { sep::TemplateFactory::genProperty( container ); }
+
+ ( section_property[ container ] )*
+
+ | ( def_body_machine_using_section_parameter_predicat ) =>
+ section_parameter[ container ]
+
+ // Conditional Template Code Generation for @declaration
+ { sep::TemplateFactory::genProperty( container ); }
+
+ ( section_property[ container ] )*
+
+ | ( def_body_machine_using_section_property_predicat ) =>
+ // Conditional Template Code Generation for @declaration
+ { sep::TemplateFactory::genProperty( container ); }
+
+ ( section_property[ container ] )+
+
+ | { sep::TemplateFactory::genProperty( container ); }
+ section_property_free_declaration[ container ]
+ ;
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// section PARAMETER DECLARATION
+////////////////////////////////////////////////////////////////////////////////
+
+section_parameter [ sep::Machine * container ]
+@init{
+ sep::PropertyPart & declProperty = container->getPropertyPart();
+
+ SAVE_RULE_BEGIN_LOCATION;
+}
+@after{
+ SET_RULE_LOCATION(declProperty);
+}
+ : ( '@parameter:' | '@param:' /* deprecated */ )
+ ( property_declaration[ declProperty ,
+ sep::Modifier::PROPERTY_INPUT_PARAMETER_MODIFIER ]
+ )*
+
+ | '@input:' ( property_declaration[ declProperty ,
+ sep::Modifier::PROPERTY_INPUT_PARAMETER_MODIFIER ]
+ )*
+
+ | '@inout:' ( property_declaration[ declProperty ,
+ sep::Modifier::PROPERTY_INOUT_PARAMETER_MODIFIER ]
+ )*
+
+ | '@output:' ( property_declaration[ declProperty ,
+ sep::Modifier::PROPERTY_OUTPUT_PARAMETER_MODIFIER ]
+ )*
+
+ | ( '@returns:' | '@return:' /* deprecated */ )
+ ( property_declaration[ declProperty ,
+ sep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER ]
+ )*
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// section PROPERTY DECLARATION
+////////////////////////////////////////////////////////////////////////////////
+
+section_property [ sep::Machine * container ]
+@init{
+ sep::PropertyPart & declProperty = container->getPropertyPart();
+
+ SAVE_RULE_BEGIN_LOCATION;
+}
+@after{
+ SET_RULE_LOCATION(declProperty);
+}
+ : ( '@property:' | '@declaration:' /* deprecated */ )
+ ( property_declaration[ declProperty ,
+ sep::Modifier::PROPERTY_UNDEFINED_MODIFIER ]
+ )*
+
+ | '@public:'
+ ( property_declaration[ declProperty ,
+ sep::Modifier::PROPERTY_PUBLIC_MODIFIER ]
+ )*
+
+ | '@protected:'
+ ( property_declaration[ declProperty ,
+ sep::Modifier::PROPERTY_PROTECTED_MODIFIER ]
+ )*
+
+ | '@private:'
+ ( property_declaration[ declProperty ,
+ sep::Modifier::PROPERTY_PRIVATE_MODIFIER ]
+ )*
+ ;
+
+
+section_property_free_declaration [ sep::Machine * container ]
+@init{
+ sep::PropertyPart & declProperty = container->getPropertyPart();
+
+ SAVE_RULE_BEGIN_LOCATION;
+}
+@after{
+ SET_RULE_LOCATION(declProperty);
+}
+ : ( property_declaration[ declProperty ,
+ sep::Modifier::PROPERTY_UNDEFINED_MODIFIER ]
+ )*
+ ;
+
+////////////////////////////////////////////////////////////////////////////////
+// PROPERTY ELEMENT DECLARATION
+////////////////////////////////////////////////////////////////////////////////
+
+property_declaration
+/* in */[ sep::PropertyPart & declProperty , sep::Modifier mdfr ]
+ : ( m=modifier_declaration { mdfr.override_ifdef( $m.mdfr ); } )?
+ decl_property_element[ declProperty , mdfr ]
+ ;
+
+decl_property_element
+/* in */[ sep::PropertyPart & declProperty , sep::Modifier mdfr ]
+ : decl_variable[ declProperty , mdfr ]
+
+ | decl_port [ declProperty , mdfr ]
+ | decl_signal [ declProperty , mdfr ]
+ | decl_buffer [ declProperty , mdfr ]
+ | decl_channel[ declProperty , mdfr ]
+
+ | def_type [ declProperty , mdfr ]
+ | def_enum [ declProperty , mdfr ]
+ | def_union [ declProperty , mdfr ]
+ | def_choice[ declProperty , mdfr ]
+ | def_struct[ declProperty , mdfr ]
+/*
+ | decl_func[ declProperty , mdfr ]
+ | decl_proc[ declProperty , mdfr ]
+
+ | decl_lambda[ declProperty , mdfr ]
+*/
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// declaration MACHINE PRAMETERS
+////////////////////////////////////////////////////////////////////////////////
+
+labelled_argument
+returns [ std::string label, sep::BF arg ]
+ : ( ID COLON ) => id=ID COLON { $label = STR($id.text->chars); }
+ e=expression { $arg = $e.bf; }
+ | e=expression { $arg = $e.bf; }
+ ;
+
+decl_instance_machine_params [ sep::Machine * machine ]
+@init{
+ sep::BFVector labelledParams(
+ ( machine->getType().is< sep::Machine >() ) ? machine->getType().
+ to_ptr< sep::Machine >()->getVariableParametersCount() : 0 );
+
+ sep::BFList positionalParams;
+}
+@after{
+ if( labelledParams.nonempty() )
+ {
+ sep::ParserUtil::computeInstanceMachineParameter(
+ machine, labelledParams, positionalParams);
+ }
+}
+ : LPAREN
+ ( lp=labelled_argument
+ {
+ sep::ParserUtil::appendInstanceMachineParameter(machine, $lp.label,
+ labelledParams, positionalParams, $lp.arg);
+ }
+ ( COMMA
+ lp=labelled_argument
+ {
+ sep::ParserUtil::appendInstanceMachineParameter(machine, $lp.label,
+ labelledParams, positionalParams, $lp.arg);
+ }
+ )*
+ )?
+ RPAREN
+ ;
+
+
+decl_instance_machine_returns [ sep::Machine * machine ]
+@init{
+ sep::BFVector labelledReturns(
+ ( machine->getType().is< sep::Machine >() ) ? machine->getType().
+ to_ptr< sep::Machine >()->getVariableParametersCount() : 0 );
+
+ sep::BFList positionalReturns;
+}
+@after{
+ if( labelledReturns.nonempty() )
+ {
+ sep::ParserUtil::computeInstanceMachineReturn(
+ machine, labelledReturns, positionalReturns);
+ }
+}
+ : ( '-->' | 'returns:' )
+ ( LPAREN
+ lp=labelled_argument
+ {
+ sep::ParserUtil::appendInstanceMachineReturn(machine, $lp.label,
+ labelledReturns, positionalReturns, $lp.arg);
+ }
+ ( COMMA
+ lp=labelled_argument
+ {
+ sep::ParserUtil::appendInstanceMachineReturn(machine, $lp.label,
+ labelledReturns, positionalReturns, $lp.arg);
+ }
+ )*
+ RPAREN
+
+ | lp=labelled_argument
+ {
+ sep::ParserUtil::appendInstanceMachineReturn(machine, $lp.label,
+ labelledReturns, positionalReturns, $lp.arg);
+ }
+ )
+ ;
+
+
+
+activity_machine_param_return
+/* in */[ const sep::BF & argMachine , sep::BFCode & ac ]
+@init{
+ sep::Machine * machine = argMachine.is< sep::Machine >() ?
+ argMachine.to_ptr< sep::Machine >() : NULL;
+
+ sep::Routine * routine = NULL;
+
+ sep::avm_size_t paramCount = 0;
+ sep::avm_size_t returnCount = 0;
+ if( machine == NULL )
+ {
+ routine = NULL;
+ }
+ else if( machine->getSpecifier().isDesignInstanceStatic()
+ && machine->getType().is< sep::Machine >() )
+ {
+ routine = &( machine->getType().to_ptr< sep::Machine >()->
+ getBehavior()->getActivity( ac->getAvmOpCode() ) );
+ }
+ else if( ac->isnotOpCode( sep::AVM_OPCODE_INVOKE_NEW ) )
+// if( machine->isDesignPrototypeStatic() )
+ {
+ routine = &( machine->getBehavior()->
+ getActivity( ac->getAvmOpCode() ) );
+ }
+
+ if( routine != NULL )
+ {
+ paramCount = routine->getParameters().size();
+ returnCount = routine->getReturns().size();
+ }
+
+
+ sep::BFVector labelledParams( paramCount );
+ sep::BFList positionalParams;
+
+ sep::BFVector labelledReturns( returnCount );
+ sep::BFList positionalReturns;
+
+ if( machine != NULL )
+ {
+ PUSH_CTX_CPM( machine );
+ }
+}
+@after{
+ if( BACKTRACKING==0 )
+ {
+ sep::ParserUtil::computeActivityRoutineParamReturn(argMachine, routine, $ac,
+ labelledParams , positionalParams, labelledReturns, positionalReturns);
+ }
+
+ if( machine != NULL )
+ {
+ POP_CTX;
+ }
+}
+ : LPAREN // Parameters
+ ( lp=labelled_argument
+ {
+ sep::ParserUtil::appendRoutineParameters(routine, $lp.label,
+ labelledParams, positionalParams, $lp.arg);
+ }
+ ( COMMA
+ lp=labelled_argument
+ {
+ sep::ParserUtil::appendRoutineParameters(routine, $lp.label,
+ labelledParams, positionalParams, $lp.arg);
+ }
+ )*
+ )?
+ RPAREN
+
+ ( ( '-->' | 'returns:' )
+ ( LPAREN
+ lp=labelled_argument
+ {
+ sep::ParserUtil::appendRoutineReturns(routine, $lp.label,
+ labelledReturns, positionalReturns, $lp.arg);
+ }
+ ( COMMA
+ lp=labelled_argument
+ {
+ sep::ParserUtil::appendRoutineReturns(routine, $lp.label,
+ labelledReturns, positionalReturns, $lp.arg);
+ }
+ )*
+ RPAREN
+
+ | lp=labelled_argument
+ {
+ sep::ParserUtil::appendRoutineReturns(routine, $lp.label,
+ labelledReturns, positionalReturns, $lp.arg);
+ }
+ )
+ )?
+
+// | 'ctx:' LCURLY ( sa=statement_assign { $ac->append($sa.ac); } )+ RCURLY
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// declaration COMMUNCATION POINT : PORT
+////////////////////////////////////////////////////////////////////////////////
+
+decl_port
+/* in */[ sep::PropertyPart & declProperty , sep::Modifier mdfr ]
+@init{
+ sep::IComPoint::ENUM_IO_NATURE nature = sep::IComPoint::IO_UNDEFINED_NATURE;
+}
+ : 'port' { nature = sep::IComPoint::IO_PORT_NATURE; }
+
+ decl_port_impl[ declProperty , mdfr, nature ]
+ ;
+
+decl_port_impl
+/* in */[ sep::PropertyPart & declProperty , sep::Modifier mdfr ,
+ sep::IComPoint::ENUM_IO_NATURE nature ]
+@init{
+ sep::Port * port;
+ sep::BF TPort;
+ bool isaType = true;
+}
+ : ( ID ) => id=ID
+ {
+ declProperty.appendPort( sep::BF(
+ port = new sep::Port(declProperty,
+ STR($id.text->chars), nature,
+ mdfr.setDirectionInoutElse() ) ) );
+ }
+ ( type_param_com[ port ] )? SEMI
+
+ | modifier_set_direction_strict_text[ mdfr ]
+ ( id=ID
+ {
+ declProperty.appendPort( sep::BF(
+ port = new sep::Port(declProperty,
+ STR($id.text->chars), nature, mdfr ) ) );
+ }
+ ( type_param_com[ port ] )? SEMI
+
+ | LCURLY
+ ( id=ID
+ {
+ declProperty.appendPort( sep::BF(
+ port = new sep::Port(declProperty,
+ STR($id.text->chars), nature, mdfr) ) );
+ }
+ ( type_param_com[ port ] )? SEMI
+ )+
+ RCURLY
+ )
+ | LCURLY
+ ( ( ID ) => id=ID
+ {
+ declProperty.appendPort( sep::BF(
+ port = new sep::Port(declProperty,
+ STR($id.text->chars), nature,
+ mdfr.setDirectionInoutElse() ) ) );
+ port->setModifier( mdfr );
+ }
+ ( type_param_com[ port ] )? SEMI
+
+ | modifier_set_direction_strict_text[ mdfr ] id=ID
+ {
+ declProperty.appendPort( sep::BF(
+ port = new sep::Port(declProperty,
+ STR($id.text->chars), nature, mdfr) ) );
+ }
+ ( type_param_com[ port ] )? SEMI
+ )+
+ RCURLY
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// declaration COMMUNCATION POINT : MESSAGE | SIGNAL
+////////////////////////////////////////////////////////////////////////////////
+
+decl_signal
+/* in */[ sep::PropertyPart & declProperty , sep::Modifier mdfr ]
+@init{
+ sep::IComPoint::ENUM_IO_NATURE nature = sep::IComPoint::IO_UNDEFINED_NATURE;
+}
+ : ( 'signal' { nature = sep::IComPoint::IO_SIGNAL_NATURE; }
+ | 'message' { nature = sep::IComPoint::IO_MESSAGE_NATURE; }
+ )
+ decl_signal_impl[ declProperty , mdfr, nature ]
+ ;
+
+decl_signal_impl
+/* in */[ sep::PropertyPart & declProperty , sep::Modifier mdfr ,
+ sep::IComPoint::ENUM_IO_NATURE nature ]
+@init{
+ sep::Port * signal;
+ sep::BF TPort;
+ bool isaType = true;
+}
+ : ( ID ) => id=ID
+ {
+ declProperty.appendSignal( sep::BF(
+ signal = new sep::Signal(declProperty,
+ STR($id.text->chars), nature,
+ mdfr.setDirectionInoutElse() ) ) );
+ }
+ ( type_param_com[ signal ] )? SEMI
+
+ | modifier_set_direction_strict_text[ mdfr ]
+ ( id=ID
+ {
+ declProperty.appendSignal( sep::BF(
+ signal = new sep::Signal(declProperty,
+ STR($id.text->chars), nature, mdfr ) ) );
+ }
+ ( type_param_com[ signal ] )? SEMI
+
+ | LCURLY
+ ( id=ID
+ {
+ declProperty.appendSignal( sep::BF(
+ signal = new sep::Signal(declProperty,
+ STR($id.text->chars), nature, mdfr) ) );
+ }
+ ( type_param_com[ signal ] )? SEMI
+ )+
+ RCURLY
+ )
+ | LCURLY
+ ( ( ID ) => id=ID
+ {
+ declProperty.appendSignal( sep::BF(
+ signal = new sep::Signal(declProperty,
+ STR($id.text->chars), nature,
+ mdfr.setDirectionInoutElse() ) ) );
+ signal->setModifier( mdfr );
+ }
+ ( type_param_com[ signal ] )? SEMI
+
+ | modifier_set_direction_strict_text[ mdfr ] id=ID
+ {
+ declProperty.appendSignal( sep::BF(
+ signal = new sep::Signal(declProperty,
+ STR($id.text->chars), nature, mdfr) ) );
+ }
+ ( type_param_com[ signal ] )? SEMI
+ )+
+ RCURLY
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// declaration COMMUNCATION PARAMETER
+////////////////////////////////////////////////////////////////////////////////
+
+type_param_com [ sep::Port * port ]
+@init{
+ sep::avm_offset_t offset = 0;
+}
+ : LPAREN
+ param_com_atom[ port , offset]
+ ( COMMA param_com_atom[ port , ++offset ] )*
+ RPAREN
+ ;
+
+param_com_atom
+/* in */[ sep::Port * port , sep::avm_offset_t offset ]
+@init{
+ sep::Variable * variable;
+ sep::BF paramT = sep::TypeManager::UNIVERSAL;
+ std::string paramID;
+ sep::BF value;
+}
+ : tv=type_var { paramT = $tv.type; }
+ ( id=ID { paramID = STR($id.text->chars); }
+ ( iv=initial_value { value = $iv.bf; } )?
+ )?
+ {
+ port->saveParameter( variable = new sep::Variable(port,
+ sep::Modifier::PROPERTY_PARAMETER_MODIFIER,
+ paramT, paramID, value) );
+ }
+
+ | 'bind:'
+ ( ( type_var COLON ) => tv=type_var COLON { paramT = $tv.type; }
+ e=expression { value = $e.bf; }
+ | vid=qualifiedNameID
+ {
+ value = sep::ParserUtil::getVariable($vid.s, $vid.nb);
+ if( value.valid() )
+ { paramT = value.to_ptr< sep::Variable >()->getType(); }
+ }
+ )
+ {
+ paramID = sep::OSS() << '#' << offset;
+ port->saveParameter( variable = new sep::Variable(port,
+ sep::Modifier::PROPERTY_PARAMETER_BIND_MODIFIER,
+ paramT, paramID, value) );
+ variable->setOffset( offset );
+ }
+ ;
+
+////////////////////////////////////////////////////////////////////////////////
+// declaration BUFFER
+////////////////////////////////////////////////////////////////////////////////
+
+decl_buffer
+/* in */[ sep::PropertyPart & declProperty , sep::Modifier mdfr ]
+ : 'buffer' decl_buffer_impl[ declProperty , mdfr ]
+ ;
+
+decl_buffer_impl
+/* in */[ sep::PropertyPart & declProperty , sep::Modifier mdfr ]
+@init{
+ sep::Buffer * buffer;
+
+ sep::BF TBuffer;
+ bool isaType = true;
+}
+ : db=def_buffer id=ID
+ {
+ declProperty.appendBuffer( sep::BF(
+ buffer = new sep::Buffer( declProperty,
+ STR($id.text->chars), $db.kind, $db.size)) );
+ buffer->setModifier( mdfr );
+ }
+ ( initial_buffer_contents[ buffer ] )? SEMI
+
+ | LCURLY
+ (
+ db=def_buffer id=ID
+ {
+ declProperty.appendBuffer( sep::BF(
+ buffer = new sep::Buffer(declProperty,
+ STR($id.text->chars), $db.kind, $db.size)) );
+ buffer->setModifier( mdfr );
+ }
+ )+
+ RCURLY
+ ;
+
+
+def_buffer
+returns [ sep::avm_type_specifier_kind_t kind , int size = -1 ]
+ : pb=policy_buffer { $kind = $pb.kind; }
+ ( LT_
+ ( n=integer_constant { $size = $n.val; }
+ | STAR { $size = -1; }
+ )
+ GT )?
+
+ | 'ram' { $kind = sep::TYPE_RAM_SPECIFIER; $size = 1; }
+ ;
+
+
+policy_buffer
+returns [ sep::avm_type_specifier_kind_t kind ]
+ : 'fifo' { $kind = sep::TYPE_FIFO_SPECIFIER; }
+ | 'lifo' { $kind = sep::TYPE_LIFO_SPECIFIER; }
+ | 'multififo' { $kind = sep::TYPE_MULTI_FIFO_SPECIFIER; }
+ | 'multilifo' { $kind = sep::TYPE_MULTI_LIFO_SPECIFIER; }
+ | 'set' { $kind = sep::TYPE_SET_SPECIFIER; }
+ | 'multiset' { $kind = sep::TYPE_MULTISET_SPECIFIER; }
+ | 'vector' { $kind = sep::TYPE_VECTOR_SPECIFIER; }
+ | 'rvector' { $kind = sep::TYPE_REVERSE_VECTOR_SPECIFIER; }
+ ;
+
+ref_buffer[ sep::Machine * machine ]
+returns [ sep::BF buf ]
+ : id=qualifiedNameID
+ { $buf = sep::ParserUtil::getBuffer(machine, $id.s, $id.nb); }
+ ;
+
+
+initial_buffer_contents[ const sep::Buffer * buffer ]
+@init{
+ sep::BF msg;
+}
+ : ASSIGN LBRACKET
+ mid=qualifiedNameID
+ {/* msg = sep::ParserUtil::getMessage($mid.s, $mid.nb);
+ buffer->appendMessage(msg); */}
+ ( COMMA mid=qualifiedNameID
+ )*
+ RBRACKET
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// declaration CHANNEL
+////////////////////////////////////////////////////////////////////////////////
+
+decl_channel
+/* in */[ sep::PropertyPart & declProperty , sep::Modifier mdfr ]
+ : 'channel' decl_channel_port[ declProperty , mdfr ]
+/* ( ID LCURLY => decl_channel_port[ declProperty , mdfr ]
+ | decl_channel_var[ declProperty , mdfr ]
+ )
+*/ ;
+
+
+decl_channel_port
+/* in */[ sep::PropertyPart & declProperty , sep::Modifier mdfr ]
+@init{
+ sep::Channel * aChannel;
+
+ declProperty.appendChannel( sep::BF( aChannel =
+ new sep::Channel( declProperty,
+ "#channel#", mdfr.setDirectionInoutElse() ) ));
+
+}
+ : ( LT_
+ com_protocol[ declProperty.getContainer()->as< sep::Machine >(), aChannel ]
+ ( COMMA com_cast[ aChannel ] )?
+ GT
+ )?
+
+ ( modifier_set_direction_strict_text[ aChannel->getwModifier() ] ) ?
+ id=ID { aChannel->fullyUpdateAllNameID( STR($id.text->chars) ); }
+
+ LCURLY
+ (
+ m=modifier_direction uid=qualifiedNameID SEMI
+ {
+ sep::BF comSignal = sep::ParserUtil::getComSignal($uid.s, $uid.nb);
+ if( comSignal.valid() )
+ {
+ aChannel->appendSignal($m.mdfr, comSignal);
+ }
+ }
+
+ | decl_port[ *(aChannel->getContents()) ,
+ sep::Modifier::PROPERTY_PUBLIC_MODIFIER ]
+
+ | decl_signal[ *(aChannel->getContents()) ,
+ sep::Modifier::PROPERTY_PUBLIC_MODIFIER ]
+ )+
+ RCURLY
+ ;
+
+
+decl_channel_var
+/* in */[ sep::PropertyPart & declProperty , sep::Modifier mdfr ]
+@init{
+ sep::Variable * var;
+}
+ : tv=type_var id=ID
+ {
+ declProperty.saveOwnedVariable( var = new sep::Variable(
+ declProperty, mdfr, $tv.type, STR($id.text->chars)) );
+ }
+ ( iv=initial_value { var->setValue($iv.bf); } )?
+ ( SEMI | on_write_var_routine_def[ var ] )
+
+ | LCURLY (
+ tv=type_var id=ID
+ {
+ declProperty.saveOwnedVariable( var = new sep::Variable(
+ declProperty, mdfr, $tv.type, STR($id.text->chars)) );
+ }
+ ( iv=initial_value { var->setValue($iv.bf); } )?
+ ( SEMI | on_write_var_routine_def[ var ] )
+ )+ RCURLY
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// declaration VAR
+////////////////////////////////////////////////////////////////////////////////
+
+decl_variable
+/* in */[ sep::PropertyPart & declProperty , sep::Modifier mdfr ]
+ : ( 'var' { mdfr.setNatureVariable(); }
+ | 'val' { mdfr.setFeatureConst(); }
+ | ( 'const' { mdfr.setFeatureConst(); }
+ | 'macro' { mdfr.setNatureMacro(); }
+ )+
+ ( 'var' )?
+ )
+ decl_variable_impl[ declProperty , mdfr ]
+
+ | decl_variable_time_clock_impl[ declProperty , mdfr ]
+ ;
+
+
+decl_variable_time_clock_impl
+/* in */[ sep::PropertyPart & declProperty , sep::Modifier mdfr ]
+@init{
+ mdfr.override_ifdef( sep::Modifier::PROPERTY_PUBLIC_VOLATILE_MODIFIER );
+}
+ : ctv=time_clock_type
+ decl_typed_variable_atom_impl[ declProperty , mdfr , $ctv.bts ]
+ ;
+
+
+decl_variable_impl
+/* in */[ sep::PropertyPart & declProperty , sep::Modifier mdfr ]
+ : decl_variable_atom_impl[ declProperty , mdfr ]
+
+ | LCURLY
+ ( decl_variable_atom_impl[ declProperty , mdfr ] )+
+ RCURLY
+ ;
+
+decl_variable_atom_impl
+/* in */[ sep::PropertyPart & declProperty , sep::Modifier mdfr ]
+ : tv=type_var
+ decl_typed_variable_atom_impl[ declProperty , mdfr , $tv.type ]
+ ;
+
+decl_typed_variable_atom_impl
+/* in */[ sep::PropertyPart & declProperty ,
+ sep::Modifier mdfr , const sep::BF & type ]
+@init{
+ sep::Variable * var;
+}
+ : id=ID
+ {
+ declProperty.saveOwnedVariable( var = new sep::Variable(
+ declProperty, mdfr, type, STR($id.text->chars)) );
+ }
+
+ ( StringLiteral
+ { var->setUnrestrictedName(STR($StringLiteral.text->chars)); }
+ )?
+
+ ( iv=initial_value { var->setValue($iv.bf); } )?
+ ( SEMI | on_write_var_routine_def[ var ] )
+ ;
+
+
+initial_value
+returns [ sep::BF bf ]
+ : ASSIGN e=expression { $bf = $e.bf; }
+ | LPAREN e=expression RPAREN { $bf = $e.bf; }
+ ;
+
+
+type_var
+returns [ sep::BF type ]
+ : btv=base_type_var { $type = $btv.type; }
+ ( dta=def_type_array[ type , "" ] { $type = $dta.type; } )?
+
+ | dtc=def_type_container[ "" ] { $type = $dtc.type; }
+
+ | dti=def_type_interval [ "" ] { $type = $dti.type; }
+ ;
+
+
+def_type_array
+/* in */[ sep::BF baseT , const std::string & tid ]
+returns [ sep::BF type ]
+@init{
+ sep::ListOfInt listOfSize;
+}
+ : ( dta=def_type_array_size { listOfSize.push_back($dta.size); } )+
+ {
+ int szT = listOfSize.front();
+ listOfSize.pop_front();
+
+ while( listOfSize.nonempty() )
+ {
+ baseT = sep::BF( sep::DataType::newContainer(_CPM_,
+ sep::DataType::strContainerId(sep::TYPE_ARRAY_SPECIFIER,
+ baseT, listOfSize.back()),
+ sep::TYPE_ARRAY_SPECIFIER, baseT, listOfSize.back()) );
+ listOfSize.pop_back();
+ }
+ type = sep::BF( sep::DataType::newContainer(_CPM_,
+ sep::DataType::strContainerId(
+ tid, sep::TYPE_ARRAY_SPECIFIER, baseT, szT),
+ sep::TYPE_ARRAY_SPECIFIER, baseT, szT) );
+ }
+ ;
+
+def_type_array_size
+returns [ int size ]
+ : LBRACKET
+ ( sz=IntegerLiteral { size = NUM_INT($sz.text->chars); }
+// ( sz=integer_constant { size = $sz.val; }
+
+ | id=qualifiedNameID
+ {
+ const sep::BF & constVar =
+ sep::ParserUtil::getConstant($id.s, $id.nb);
+ if( constVar.valid() &&
+ constVar.to_ptr< sep::Variable >()->hasValue() &&
+ constVar.to_ptr< sep::Variable >()->getValue().isInteger() )
+ {
+ size = constVar.to_ptr< sep::Variable >()->getValue().toInteger();
+ }
+ else
+ {
+ sep::BF aType = sep::ParserUtil::getDataType($id.s, $id.nb);
+
+ if( aType.valid() && aType.is< sep::DataType >() )
+ {
+ if( aType.to_ptr< sep::DataType >()->isTypedInterval() )
+ {
+ size = aType.to_ptr< sep::DataType >()->getIntervalLength();
+
+ if( size < 0 )
+ {
+ sep::ParserUtil::avm_syntax_error(
+ "def_type_array_size(...)" )
+ << "unexpected << interval: " << $id.s
+ << " >> as size (i.e. " << size
+ << ") in an array typedef"
+ << sep::ParserUtil::SYNTAX_ERROR_EOL;
+
+ size = 0;
+ }
+ }
+ else if( aType.to_ptr< sep::DataType >()->isTypedEnum() )
+ {
+ size = aType.to_ptr< sep::DataType >()->getEnumSize();
+
+ if( size == 0 )
+ {
+ sep::ParserUtil::avm_syntax_error(
+ "def_type_array_size(...)" )
+ << "unexpected << enum: " << $id.s
+ << " >> as size in an array typedef"
+ << sep::ParserUtil::SYNTAX_ERROR_EOL;
+ }
+ }
+ else
+ {
+ size = 0;
+
+ sep::ParserUtil::avm_syntax_error(
+ "def_type_array_size(...)" )
+ << "unexpected << [Qualified]NameID: " << $id.s
+ << " >> as size in an array typedef"
+ << sep::ParserUtil::SYNTAX_ERROR_EOL;
+ }
+ }
+ else
+ {
+ size = 0;
+
+ sep::ParserUtil::avm_syntax_error(
+ "def_type_array_size(...)" )
+ << "unexpected << [Qualified]NameID: " << $id.s
+ << " >> as size in an array typedef"
+ << sep::ParserUtil::SYNTAX_ERROR_EOL;
+ }
+ }
+ }
+ )
+ RBRACKET
+ ;
+
+
+def_type_container [ const std::string & tid ]
+returns [ sep::BF type ]
+@init{
+ sep::BF baseT = sep::TypeManager::UNIVERSAL;
+ int szT = -1;
+}
+ : sb=specifier_buffer
+ ( LT_
+ ( ( btv=base_type_var { baseT = $btv.type; }
+ ( COMMA ( 'size:' )?
+ ( sz=integer_constant { szT = $sz.val; }
+ | STAR { szT = -1; }
+ )
+ )?
+ )
+ | ( 'size:' )? sz=integer_constant { szT = $sz.val; }
+ )
+ GT
+ )?
+ {
+ $type = sep::BF( sep::DataType::newContainer(_CPM_,
+ sep::DataType::strContainerId(tid, $sb.kind, baseT, szT),
+ $sb.kind, baseT, szT) );
+ }
+ ;
+
+
+specifier_buffer
+returns [ sep::avm_type_specifier_kind_t kind ]
+ : 'array' { $kind = sep::TYPE_ARRAY_SPECIFIER; }
+ | 'vector' { $kind = sep::TYPE_VECTOR_SPECIFIER; }
+ | 'rvector' { $kind = sep::TYPE_REVERSE_VECTOR_SPECIFIER; }
+ | 'list' { $kind = sep::TYPE_LIST_SPECIFIER; }
+ | 'fifo' { $kind = sep::TYPE_FIFO_SPECIFIER; }
+ | 'lifo' { $kind = sep::TYPE_LIFO_SPECIFIER; }
+ | 'multififo' { $kind = sep::TYPE_MULTI_FIFO_SPECIFIER; }
+ | 'multilifo' { $kind = sep::TYPE_MULTI_LIFO_SPECIFIER; }
+ | 'set' { $kind = sep::TYPE_SET_SPECIFIER; }
+ | 'multiset' { $kind = sep::TYPE_MULTISET_SPECIFIER; }
+ ;
+
+
+def_type_interval [ const std::string & tid ]
+returns [ sep::BF type ]
+@init{
+ sep::BF baseT = sep::TypeManager::INTEGER;
+}
+ : 'interval' { $type = sep::TypeManager::INTEGER; }
+ LT_
+ ( pt=primitive_type { baseT = $pt.bts; } )?
+ (ll=LBRACKET | ll=RBRACKET | ll=LPAREN)
+ min=expression COMMA max=expression
+ (rr=LBRACKET | rr=RBRACKET | rr=RPAREN)
+ GT
+ {
+ $type = sep::BF( sep::DataType::newInterval(_CPM_, tid, baseT,
+ sep::IIntervalKind::computeKind(CHAR($ll), CHAR($rr)),
+ $min.bf, $max.bf) );
+ }
+ ;
+
+
+base_type_var
+returns [ sep::BF type ]
+ : pt=primitive_type
+ { $type = $pt.bts; }
+ | id=qualifiedNameID
+ { $type = sep::ParserUtil::getDataType($id.s, $id.nb); }
+ ;
+
+
+primitive_type
+returns [ sep::TypeSpecifier bts ]
+@init{
+ sep::avm_size_t arity = 1;
+}
+ : ( 'boolean' | 'bool' ) { $bts = sep::TypeManager::BOOLEAN; }
+
+ | ( 'integer' | 'int' ) { $bts = sep::TypeManager::INTEGER; }
+ ( bfs=bit_field_size
+ { $bts = sep::TypeManager::getTypeInteger( $bfs.size ); }
+ )?
+
+ | ( 'uinteger' | 'uint' ) { $bts = sep::TypeManager::UINTEGER; }
+ ( bfs=bit_field_size
+ { $bts = sep::TypeManager::getTypeUInteger( $bfs.size ); }
+ )?
+
+ | ( 'pos_integer' | 'pos_int' ) { $bts = sep::TypeManager::POS_INTEGER; }
+ ( bfs=bit_field_size
+ { $bts = sep::TypeManager::getTypePosInteger( $bfs.size ); }
+ )?
+
+
+ | ( ( 'rational' | 'rat' ) { $bts = sep::TypeManager::RATIONAL; }
+ | ( 'urational' | 'urat' ) { $bts = sep::TypeManager::URATIONAL; }
+
+ | 'float' { $bts = sep::TypeManager::FLOAT; }
+ | 'ufloat' { $bts = sep::TypeManager::UFLOAT; }
+
+ | 'double' { $bts = sep::TypeManager::DOUBLE; }
+ | 'udouble' { $bts = sep::TypeManager::UDOUBLE; }
+
+ | 'real' { $bts = sep::TypeManager::REAL; }
+ | 'ureal' { $bts = sep::TypeManager::UREAL; }
+ )
+ ( bfs=bit_field_size
+ {
+ $bts = sep::TypeManager::newNumericTypeSpecifier(
+ $bts, $bfs.size, sep::ExpressionConstant::INTEGER_ZERO);
+ }
+ )?
+
+
+ | ct=time_clock_type { $bts = $ct.bts; }
+
+ | tt=time_type { $bts = $tt.bts; }
+
+ | 'char' { $bts = sep::TypeManager::CHAR; }
+ ( bfs=bit_field_size
+ { $bts = sep::TypeManager::newCharacter( "char", $bfs.size ); }
+ )?
+
+ | 'character' { $bts = sep::TypeManager::CHARACTER; }
+ ( bfs=bit_field_size
+ { $bts = sep::TypeManager::newCharacter( "character", $bfs.size ); }
+ )?
+
+ | 'string' { $bts = sep::TypeManager::STRING; }
+ ( sfs=string_field_size
+ { $bts = sep::TypeManager::newString( $sfs.min , $sfs.max ); }
+ )?
+
+
+ | 'operator' { $bts = sep::TypeManager::OPERATOR; }
+ | 'avmcode' { $bts = sep::TypeManager::AVMCODE; }
+
+ | 'port' { $bts = sep::TypeManager::PORT; }
+ | 'buffer' { $bts = sep::TypeManager::BUFFER; }
+ | 'message' { $bts = sep::TypeManager::MESSAGE; }
+ | 'signal' { $bts = sep::TypeManager::SIGNAL; }
+ | 'connector' { $bts = sep::TypeManager::CONNECTOR; }
+
+ | 'machine' { $bts = sep::TypeManager::MACHINE; }
+ ( LT_ id=qualifiedNameID GT
+ {
+ sep::BF machineT =
+ sep::ParserUtil::getExecutableMachine($id.s, $id.nb);
+ }
+ )?
+
+ | 'universal' { $bts = sep::TypeManager::UNIVERSAL; }
+ ;
+
+
+bit_field_size
+returns [ int size ]
+ : COLON n=integer_constant { size = $n.val; }
+ | LT_ ( 'size:' )? n=integer_constant GT { size = $n.val; }
+ ;
+
+
+string_field_size
+returns [ int min=0 , int max=-1 ]
+ : COLON rc=range_constant
+ { $min = $rc.min; $max = $rc.max; }
+
+ | LT_ ( 'size:' )? rc=range_constant GT
+ { $min = $rc.min; $max = $rc.max; }
+ ;
+
+range_constant
+returns [ int min=0 , int max=-1 ]
+ : n=integer_constant { $max = $n.val; }
+ ( ( COMMA | DOTDOT )
+ n=integer_constant { $min = $max; $max = $n.val; }
+ )?
+ ;
+
+on_write_var_routine_def [ sep::Variable * var ]
+ : LCURLY ( var_routine_def[ var ] )+ RCURLY
+ ;
+
+
+var_routine_def [ sep::Variable * var ]
+@init{
+ sep::Routine * onWriteRoutine = NULL;
+
+ sep::BehavioralPart * aBehavioralpart = var->getUniqContainerOfRoutines();
+
+ SAVE_RULE_BEGIN_LOCATION;
+}
+@after{
+ SET_RULE_LOCATION( onWriteRoutine );
+}
+ : '@on_write'
+ {
+ onWriteRoutine = new sep::Routine(var, "on_write");
+ var->setOnWriteRoutine(onWriteRoutine);
+ if( aBehavioralpart != NULL )
+ {
+ aBehavioralpart->saveAnonymousInnerRoutine(onWriteRoutine);
+ }
+ }
+ ( routine_single_param[*onWriteRoutine, var->getType()] )?
+ ( bs=block_statement { onWriteRoutine->setCode($bs.ac); }
+ | '|=>' ce=conditionalExpression SEMI
+ { onWriteRoutine->setCode( NEW_STMT1(OP(GUARD), $ce.bf) ); }
+ )
+ ;
+
+routine_single_param
+/* in */[ sep::Routine & routine , const sep::BF & dftType ]
+@init{
+ sep::BF paramT = dftType;
+ sep::BF value;
+}
+ : LPAREN
+ ( ( type_var ID ) => tv=type_var { paramT = $tv.type; } id=ID
+ | id=ID
+ )
+ ( iv=initial_value { value = $iv.bf; } )?
+ {
+ sep::Variable * variable;
+ routine.saveParameter( variable = new sep::Variable( &routine,
+ sep::Modifier::PROPERTY_INPUT_PARAMETER_MODIFIER,
+ paramT, STR($id.text->chars), value) );
+ }
+ RPAREN
+ ;
+
+
+def_enum
+/* in */[ sep::PropertyPart & declProperty , sep::Modifier mdfr ]
+@init{
+ sep::Variable * var = NULL;
+}
+ : 'enum' id=ID
+ def_enum_impl[declProperty, mdfr, STR($id.text->chars)]
+ ;
+
+def_enum_impl
+/* in */[ sep::PropertyPart & declProperty ,
+ sep::Modifier mdfr , const std::string & tid ]
+@init{
+ sep::Variable * var = NULL;
+ sep::DataType * enumT;
+
+ sep::BF td( enumT = sep::DataType::newEnum(declProperty, tid) );
+ enumT->setModifier( mdfr );
+ declProperty.appendDataType( td );
+}
+ : LCURLY
+ id=ID
+ {
+ enumT->saveVariable( var = new sep::Variable( enumT,
+ sep::Modifier::PROPERTY_UNDEFINED_MODIFIER,
+ sep::TypeManager::INTEGER, STR($id.text->chars) ) );
+ }
+ ( ASSIGN e=expression { var->setValue($e.bf); } )?
+
+ ( COMMA id=ID
+ {
+ enumT->saveVariable( var = new sep::Variable( enumT,
+ sep::Modifier::PROPERTY_UNDEFINED_MODIFIER,
+ sep::TypeManager::INTEGER, STR($id.text->chars) ) );
+ }
+ ( ASSIGN e=expression { var->setValue($e.bf); } )?
+ )*
+/*TODO#ADD
+ ( COMMA )?
+*/
+ RCURLY
+ ;
+
+
+def_struct
+/* in */[ sep::PropertyPart & declProperty , sep::Modifier mdfr ]
+ : ( 'struct' | 'class' ) id=ID
+ def_class_structure_impl[declProperty, mdfr, STR($id.text->chars)]
+ ;
+
+def_class_structure_impl
+/* in */[ sep::PropertyPart & declProperty ,
+ sep::Modifier mdfr , const std::string & tid ]
+@init{
+ sep::DataType * structT;
+
+ sep::BF td( structT = sep::DataType::newStructure(declProperty, tid) );
+ structT->setModifier( mdfr );
+ declProperty.appendDataType( td );
+}
+ : LCURLY
+ ( { mdfr = sep::Modifier::PROPERTY_UNDEFINED_MODIFIER; }
+
+ ( m=modifier_declaration { mdfr = $m.mdfr; } )?
+
+ ( decl_variable[ *(structT->getPropertyPart()) , mdfr ]
+ | def_method[ declProperty ]
+ )
+ )+
+ RCURLY
+ ;
+
+
+def_choice
+/* in */[ sep::PropertyPart & declProperty , sep::Modifier mdfr ]
+ : 'choice' id=ID
+ def_choice_impl[declProperty, mdfr, STR($id.text->chars)]
+ ;
+
+def_choice_impl
+/* in */[ sep::PropertyPart & declProperty ,
+ sep::Modifier mdfr , const std::string & tid ]
+@init{
+ sep::DataType * choiceT;
+
+ sep::BF td( choiceT = sep::DataType::newChoice(declProperty, tid) );
+ choiceT->setModifier( mdfr );
+ declProperty.appendDataType( td );
+}
+ : LCURLY
+ ( { mdfr = sep::Modifier::PROPERTY_UNDEFINED_MODIFIER; }
+
+ ( m=modifier_declaration { mdfr = $m.mdfr; } )?
+
+ ( decl_variable[ *(choiceT->getPropertyPart()) , mdfr ]
+ | def_method[ declProperty ]
+ )
+ )+
+ RCURLY
+ ;
+
+
+def_union
+/* in */[ sep::PropertyPart & declProperty , sep::Modifier mdfr ]
+ : 'union' id=ID
+ def_union_impl[declProperty , mdfr, STR($id.text->chars)]
+ ;
+
+
+def_union_impl
+/* in */[ sep::PropertyPart & declProperty ,
+ sep::Modifier mdfr , const std::string & tid ]
+@init{
+ sep::DataType * unionT;
+
+ sep::BF td( unionT = sep::DataType::newUnion(declProperty, tid) );
+ unionT->setModifier( mdfr );
+ declProperty.appendDataType( td );
+}
+ : LCURLY
+ ( { mdfr = sep::Modifier::PROPERTY_UNDEFINED_MODIFIER; }
+
+ ( m=modifier_declaration { mdfr = $m.mdfr; } )?
+
+ decl_variable[ *(unionT->getPropertyPart()) , mdfr ]
+ )+
+ RCURLY
+ ;
+
+
+def_method[ sep::PropertyPart & declProperty ]
+ : 'fun' ID LPAREN decl_parameters ? RPAREN ( type_var )?
+ ;
+
+decl_parameters
+ : type_var ID ( COMMA type_var ID )*
+ ;
+
+
+def_type
+/* in */[ sep::PropertyPart & declProperty , sep::Modifier mdfr ]
+ : 'type' def_type_impl[ declProperty , mdfr ]
+ ;
+
+def_type_impl
+/* in */[ sep::PropertyPart & declProperty , sep::Modifier mdfr ]
+ : def_type_atom_impl[ declProperty , mdfr ]
+
+ | LCURLY
+ ( def_type_atom_impl[ declProperty , mdfr ] )+
+ RCURLY
+ ;
+
+
+def_type_atom_impl
+/* in */[ sep::PropertyPart & declProperty , sep::Modifier mdfr ]
+@init{
+ sep::DataType * aliasT;
+ sep::BF type;
+ bool isTypedArray = false;
+}
+ : id=ID
+ ( btv=base_type_var { type = $btv.type; }
+ ( dta=def_type_array[ type , STR($id.text->chars) ]
+ { type = $dta.type; isTypedArray = true; }
+ )?
+ {
+ if( isTypedArray )
+ {
+ aliasT = type.to_ptr< sep::DataType >();
+ aliasT->setModifier( mdfr );
+ declProperty.appendDataType( type );
+ }
+ else
+ {
+ sep::BF td( aliasT = sep::DataType::newAlias(
+ declProperty, STR($id.text->chars), type) );
+ aliasT->setModifier( mdfr );
+ declProperty.appendDataType( td );
+ }
+ }
+ ( def_typedef_constraint[ aliasT ] | SEMI )?
+
+ | dtc=def_type_container[ STR($id.text->chars) ]
+ {
+ aliasT = $dtc.type.to_ptr< sep::DataType >();
+ aliasT->setModifier( mdfr );
+ declProperty.appendDataType( $dtc.type );
+ }
+ ( def_typedef_constraint[ aliasT ] | SEMI )?
+
+ | dti=def_type_interval[ STR($id.text->chars) ] SEMI
+ {
+ aliasT = $dti.type.to_ptr< sep::DataType >();
+ aliasT->setModifier( mdfr );
+ declProperty.appendDataType( $dti.type );
+ }
+
+ | 'enum'
+ def_enum_impl[declProperty, mdfr, STR($id.text->chars)]
+
+ | 'union'
+ def_union_impl[declProperty, mdfr, STR($id.text->chars)]
+
+ | 'choice'
+ def_choice_impl[declProperty, mdfr, STR($id.text->chars)]
+
+ | ( 'struct' | 'class' )
+ def_class_structure_impl[declProperty, mdfr, STR($id.text->chars)]
+ )
+
+ | def_enum [ declProperty , mdfr ]
+ | def_union [ declProperty , mdfr ]
+ | def_choice[ declProperty , mdfr ]
+ | def_struct[ declProperty , mdfr ]
+ ;
+
+
+def_typedef_constraint[ sep::DataType * aliasT ]
+@init{
+ sep::Routine * onConstraintRoutine = NULL;
+
+ sep::BehavioralPart * aBehavioralpart = aliasT->getUniqBehaviorPart();
+
+ SAVE_RULE_BEGIN_LOCATION;
+}
+@after{
+ SET_RULE_LOCATION( onConstraintRoutine );
+}
+ : LCURLY
+ '@constraint'
+ {
+ onConstraintRoutine = new sep::Routine(aliasT, "constraint");
+ aliasT->setConstraintRoutine(onConstraintRoutine);
+ aBehavioralpart->saveAnonymousInnerRoutine(onConstraintRoutine);
+ }
+ ( routine_single_param[*onConstraintRoutine, aliasT->getTypeSpecifier()] )?
+ ( bs=block_statement { onConstraintRoutine->setCode( $bs.ac ); }
+ | '|=>' ce=conditionalExpression SEMI
+ { onConstraintRoutine->setCode( NEW_STMT1(OP(GUARD), $ce.bf) ); }
+ )
+ RCURLY
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// TYPEDEF TIME
+////////////////////////////////////////////////////////////////////////////////
+
+time_type
+returns [ sep::TypeSpecifier bts ]
+@init{
+ int szT = 1;
+ sep::avm_type_specifier_kind_t tsk = sep::TYPE_TIME_SPECIFIER;
+}
+ : ( 'time' { $bts = sep::TypeManager::TIME; }
+ | 'ctime' { $bts = sep::TypeManager::CONTINUOUS_TIME; }
+ | 'dtime' { $bts = sep::TypeManager::DISCRETE_TIME; }
+ )
+ ( LT_ { tsk = $bts.getTypeSpecifierKind(); }
+ pt=time_type_domain { $bts = $pt.type; }
+ ( COMMA sz=integer_constant { szT = $sz.val; } )?
+ GT
+ { $bts = sep::TypeManager::newClockTime(tsk, $bts, szT); }
+
+ | pt=time_type_domain
+ { $bts = sep::TypeManager::newClockTime(tsk, $pt.type, szT); }
+ )?
+ ;
+
+
+time_clock_type
+returns [ sep::TypeSpecifier bts ]
+@init{
+ int szT = 1;
+}
+ : 'clock' { $bts = sep::TypeManager::CLOCK; }
+ ( LT_
+ ( 'time' { $bts = sep::TypeManager::TIME; }
+ | 'ctime' { $bts = sep::TypeManager::CONTINUOUS_TIME; }
+ | 'dtime' { $bts = sep::TypeManager::DISCRETE_TIME; }
+ | pt=time_type_domain { $bts = $pt.type; }
+ )
+ ( COMMA sz=integer_constant { szT = $sz.val; } )?
+ GT
+ { $bts = sep::TypeManager::newClockTime(sep::TYPE_CLOCK_SPECIFIER, $bts, szT); }
+
+ | ( 'time' { $bts = sep::TypeManager::TIME; }
+ | 'ctime' { $bts = sep::TypeManager::CONTINUOUS_TIME; }
+ | 'dtime' { $bts = sep::TypeManager::DISCRETE_TIME; }
+ | pt=time_type_domain { $bts = $pt.type; }
+ )
+ ( COMMA sz=integer_constant { szT = $sz.val; } )?
+ { $bts = sep::TypeManager::newClockTime(sep::TYPE_CLOCK_SPECIFIER, $bts, szT); }
+ )?
+ ;
+
+
+time_type_domain
+returns [ sep::TypeSpecifier type ]
+ : ( 'integer' | 'int' ) { $type = sep::TypeManager::INTEGER; }
+ ( LT_
+ n=integer_constant
+ { $type = sep::TypeManager::getTypeInteger( $n.val ); }
+ GT )?
+
+ | ( 'uinteger' | 'uint' ) { $type = sep::TypeManager::UINTEGER; }
+ ( LT_
+ n=integer_constant
+ { $type = sep::TypeManager::getTypeUInteger( $n.val); }
+ GT )?
+
+ | ( 'rational' | 'rat' ) { $type = sep::TypeManager::RATIONAL; }
+ | ( 'urational' | 'urat' ) { $type = sep::TypeManager::URATIONAL; }
+
+ | 'float' { $type = sep::TypeManager::FLOAT; }
+ | 'ufloat' { $type = sep::TypeManager::UFLOAT; }
+
+ | 'double' { $type = sep::TypeManager::DOUBLE; }
+ | 'udouble' { $type = sep::TypeManager::UDOUBLE; }
+
+ | 'real' { $type = sep::TypeManager::REAL; }
+ | 'ureal' { $type = sep::TypeManager::UREAL; }
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// declaration FUNCTION , PROCEDURE , LAMBDA
+////////////////////////////////////////////////////////////////////////////////
+/*
+decl_func [ sep::PropertyPart & declProperty , sep::Modifier mdfr ]
+ : 'func' ID func_signature
+ block_statement
+ ;
+
+func_signature
+ : LPAREN decl_call_param ? RPAREN
+ '-->'
+ LPAREN decl_ret_value RPAREN
+
+ | COLON decl_call_param
+ '-->' decl_ret_value
+ ;
+
+decl_proc
+/* in /[ sep::PropertyPart & declProperty , sep::Modifier mdfr ]
+ : 'proc' ID decl_call_param
+ block_statement
+ ;
+
+decl_lambda
+/* in /[ sep::PropertyPart & declProperty , sep::Modifier mdfr ]
+ : 'lambda' ID
+ COLON decl_call_param
+ '-->' decl_ret_value
+ block_statement
+ ;
+
+
+decl_call_param
+ : decl_call_one_param ( COMMA decl_call_one_param )*
+ ;
+
+decl_call_one_param
+ : param_modifier ? type_var ID
+ ;
+
+param_modifier
+ : 'in' | 'ref' | 'out'
+ ;
+
+decl_ret_value
+ : type_var ( ID )? ( COMMA type_var ( ID )? )*
+ ;
+
+
+decl_one_ret_value
+ : type_var ( ID )?
+ ;
+*/
+
+
+////////////////////////////////////////////////////////////////////////////////
+// section MOC
+////////////////////////////////////////////////////////////////////////////////
+
+section_model_of_computation [ sep::Machine * container ]
+ : '@moc:'
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// section ROUTINE & MACRO
+////////////////////////////////////////////////////////////////////////////////
+
+section_routine [ sep::Machine * container ]
+@init{
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr( sep::Specifier::DESIGN_MODEL_KIND );
+}
+ : ( '@routine:'
+ | '@macro:' { mdfr.setNatureMacro(); }
+ )
+ ( def_routine_model[ container , mdfr , spcfr ] )*
+ ;
+
+def_routine_model
+/* in */[ sep::Machine * container ,
+ sep::Modifier mdfr , sep::Specifier spcfr ]
+ : ('routine'
+ | 'macro' { mdfr.setNatureMacro(); }
+ ( 'routine' ) ?
+ )
+ def_routine_model_impl[ container , mdfr , spcfr ]
+ ;
+
+
+def_routine_model_impl
+/* in */[ sep::Machine * container ,
+ sep::Modifier mdfr , sep::Specifier spcfr ]
+@init{
+ SAVE_RULE_BEGIN_LOCATION;
+}
+@after{
+ SET_RULE_LOCATION( _CPR_ );
+
+ POP_CTX;
+}
+ : ID
+ {
+ PUSH_CTX_CPR( sep::Routine::newDefine(
+ container, mdfr, spcfr, STR($ID.text->chars)) );
+
+ container->saveOwnedElement( _CPR_ );
+ }
+
+ ( def_routine_parameters[ *_CPR_ ] )?
+ ( ( '-->' | 'returns:' ) def_routine_returns[ *_CPR_ ] )?
+
+ bs=block_statement { _CPR_->setCode($bs.ac); }
+ ;
+
+
+def_routine_parameters [ sep::Routine & routine ]
+@init{
+ sep::avm_size_t offset = 0;
+}
+ : LPAREN
+ ( def_routine_param_atom[ routine , offset++ ]
+
+ ( COMMA def_routine_param_atom[ routine , offset++ ] )* )?
+ RPAREN
+ ;
+
+def_routine_param_atom
+/* in */[ sep::Routine & routine , sep::avm_size_t offset ]
+@init{
+ sep::BF variable;
+ sep::Variable * param;
+ sep::Machine * machine = routine.getContainerMachine();
+ sep::BF paramT = sep::TypeManager::UNIVERSAL;
+ sep::Modifier mdfr = sep::Modifier::PROPERTY_PARAMETER_MODIFIER;
+ mdfr.addFeatureKind( sep::Modifier::FEATURE_TRANSIENT_KIND );
+}
+ : ( ( modifier_param ? type_var ID ) =>
+ ( m=modifier_param { mdfr.override_ifdef( $m.mdfr ); } )?
+ tv=type_var { paramT = $tv.type; } id=ID
+
+ | id=ID
+ {
+ variable = sep::ParserUtil::getVariable(STR($id.text->chars) , 1);
+ if( variable.invalid() )
+ {
+ sep::ParserUtil::avm_syntax_error(
+ "def_routine_param_atom:> " + routine.str(), $id.line )
+ << "Unfound machine param's variable < "
+ << STR($id.text->chars)
+ << " > in routine header < " << " >"
+ << sep::ParserUtil::SYNTAX_ERROR_EOL;
+ }
+ }
+ )
+ {
+ if( variable.valid() )
+ {
+ routine.saveParameter( param = new sep::Variable( &routine,
+ sep::Modifier::PROPERTY_MACRO_MODIFIER,
+ variable.to_ptr< sep::Variable >()->getType(),
+ STR($id.text->chars)) );
+ param->setOffset( offset );
+ param->setBinding( variable );
+ }
+ else
+ {
+ param = new sep::Variable(&routine,
+ mdfr, $tv.type, STR($id.text->chars));
+ param->setOffset( offset );
+
+ // Only for Routine design as PROTOTYPE a.k.a. primitive routine
+ if( routine.getSpecifier().isDesignPrototypeStatic() )
+ {
+ routine.appendParameter(
+ machine->getPropertyPart().saveOwnedVariable( param ) );
+ }
+ else
+ {
+ routine.saveParameter( param );
+ }
+ }
+ }
+ ( iv=initial_value { param->setValue($iv.bf); } )?
+ ;
+
+
+def_routine_returns [ sep::Routine & routine ]
+@init{
+ sep::BF value;
+ sep::avm_size_t offset = 0;
+}
+ : LPAREN
+ def_routine_returns_atom[ routine , offset++ ]
+
+ ( COMMA def_routine_returns_atom[ routine , offset++ ] )*
+ RPAREN
+
+ | tv=type_var ( iv=initial_value { value = $iv.bf; } )?
+ {
+ sep::Variable * variable;
+ routine.saveReturn( variable = new sep::Variable( &routine,
+ sep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER,
+ $tv.type, "#0", value) );
+ variable->setOffset( offset );
+ }
+ ;
+
+
+def_routine_returns_atom
+/* in */[ sep::Routine & routine , sep::avm_size_t offset ]
+@init{
+ sep::BF variable;
+ sep::Variable * param;
+ sep::Machine * machine = routine.getContainerMachine();
+ sep::BF paramT = sep::TypeManager::UNIVERSAL;
+ sep::Modifier mdfr = sep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER;
+}
+ : ( ( modifier_param ? type_var ID ) =>
+ ( m=modifier_param { mdfr.override_ifdef( $m.mdfr ); } )?
+ tv=type_var { paramT = $tv.type; } id=ID
+
+ | id=ID
+ {
+ variable = sep::ParserUtil::getVariable(STR($id.text->chars) , 1);
+ if( variable.invalid() )
+ {
+ sep::ParserUtil::avm_syntax_error(
+ "def_routine_returns_atom:> " + routine.str(), $id.line )
+ << "Unfound machine return's variable < "
+ << STR($id.text->chars)
+ << " > in routine header < " << " >"
+ << sep::ParserUtil::SYNTAX_ERROR_EOL;
+ }
+ }
+ )
+
+ {
+ if( variable.valid() )
+ {
+ routine.saveReturn( param = new sep::Variable( &routine,
+ sep::Modifier::PROPERTY_MACRO_MODIFIER,
+ variable.to_ptr< sep::Variable >()->getType(),
+ STR($id.text->chars)) );
+
+ param->setOffset( offset );
+ param->setBinding( variable );
+ }
+ else
+ {
+ param = new sep::Variable(&routine,
+ mdfr, $tv.type, STR($id.text->chars));
+ param->setOffset( offset );
+
+ // Only for Routine design as PROTOTYPE a.k.a. primitive routine
+ if( routine.getSpecifier().isDesignPrototypeStatic() )
+ {
+ routine.appendReturn(
+ machine->getPropertyPart().saveOwnedVariable( param ));
+ }
+ else
+ {
+ routine.saveReturn( param );
+ }
+ }
+ }
+
+ ( iv=initial_value { param->setValue($iv.bf); } )?
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// section MOE
+////////////////////////////////////////////////////////////////////////////////
+
+section_model_of_execution [ sep::Machine * container ]
+ : '@moe:' ( def_moe_primitive[ container ] )*
+ ;
+
+def_moe_primitive [ sep::Machine * container ]
+@init{
+ sep::BehavioralPart * theBehavior = container->getUniqBehaviorPart();
+
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr( sep::Specifier::DESIGN_MODEL_KIND );
+}
+ : '@create' def_routine_seq[ theBehavior->getOnCreateRoutine() ]
+ | '@init' def_routine_seq[ theBehavior->getOnInitRoutine() ]
+ | '@final' def_routine_seq[ theBehavior->getOnFinalRoutine() ]
+
+ | '@start' def_routine_seq[ theBehavior->getOnStartRoutine() ]
+ | '@stop' def_routine_seq[ theBehavior->getOnStopRoutine() ]
+
+ | '@ienable' def_routine_seq[ theBehavior->getOnIEnableRoutine() ]
+ | '@enable' def_routine_seq[ theBehavior->getOnEnableRoutine() ]
+
+ | '@idisable' def_routine_seq[ theBehavior->getOnIDisableRoutine() ]
+ | '@disable' def_routine_seq[ theBehavior->getOnDisableRoutine() ]
+
+ | '@iabort' def_routine_seq[ theBehavior->getOnIAbortRoutine() ]
+ | '@abort' def_routine_seq[ theBehavior->getOnAbortRoutine() ]
+
+ | '@irun' def_routine_seq[ theBehavior->getOnIRunRoutine() ]
+ | '@run' def_routine_seq[ theBehavior->getOnRunRoutine() ]
+ | '@rtc' def_routine_seq[ theBehavior->getOnRtcRoutine() ]
+
+ | '@return' def_routine_seq[ theBehavior->getOnFinalRoutine() ]
+
+ | '@concurrency' def_routine_seq[ theBehavior->getOnConcurrencyRoutine() ]
+ | '@schedule' def_routine_seq[ theBehavior->getOnScheduleRoutine() ]
+
+
+ | 'routine'
+ def_routine_model_impl[ container , mdfr , spcfr ]
+ ;
+
+
+def_routine_seq [ sep::Routine & routine ]
+@init{
+ PUSH_CTX_CPR( & routine );
+
+ SAVE_RULE_BEGIN_LOCATION;
+}
+@after{
+ SET_RULE_LOCATION( _CPR_ );
+
+ POP_CTX;;
+}
+ : ( def_routine_parameters[ routine ] )?
+ ( ( '-->' | 'returns:' ) def_routine_returns[ routine ] )?
+
+ bs=block_statement { routine.seqCode($bs.ac); }
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// section COM
+////////////////////////////////////////////////////////////////////////////////
+
+section_model_of_interaction [ sep::Machine * machine ]
+@init{
+ sep::InteractionPart * theInteraction = machine->getUniqInteraction();
+
+ SAVE_RULE_BEGIN_LOCATION;
+}
+@after{
+ SET_RULE_LOCATION(theInteraction);
+}
+
+ : ( '@interaction:' | '@com:' )
+ ( com_connect[ machine, theInteraction ] )*
+ ;
+
+com_protocol
+/* in */[ sep::Machine * machine , sep::ComProtocol * cp ]
+ : 'env' { $cp->setProtocol(sep::ComProtocol::PROTOCOL_ENVIRONMENT_KIND); }
+
+ | 'rdv' { $cp->setProtocolCast(sep::ComProtocol::PROTOCOL_RDV_KIND, sep::ComProtocol::PROTOCOL_UNICAST_KIND); }
+ | 'multirdv' { $cp->setProtocolCast(sep::ComProtocol::PROTOCOL_MULTIRDV_KIND, sep::ComProtocol::PROTOCOL_MULTICAST_KIND); }
+
+ | 'flow' { $cp->setProtocolCast(sep::ComProtocol::PROTOCOL_FLOW_KIND, sep::ComProtocol::PROTOCOL_MULTICAST_KIND); }
+
+
+ | 'anycast' { $cp->setProtocolCast(sep::ComProtocol::PROTOCOL_ANYCAST_KIND, sep::ComProtocol::PROTOCOL_ANYCAST_KIND); }
+
+ | 'unicast' { $cp->setProtocolCast(sep::ComProtocol::PROTOCOL_UNICAST_KIND, sep::ComProtocol::PROTOCOL_UNICAST_KIND); }
+
+ | 'multicast' { $cp->setProtocolCast(sep::ComProtocol::PROTOCOL_MULTICAST_KIND, sep::ComProtocol::PROTOCOL_MULTICAST_KIND); }
+
+ | 'broadcast' { $cp->setProtocolCast(sep::ComProtocol::PROTOCOL_BROADCAST_KIND, sep::ComProtocol::PROTOCOL_BROADCAST_KIND); }
+
+ | bc=buffer_com [ machine ]
+ {
+ $cp->setProtocol(sep::ComProtocol::PROTOCOL_BUFFER_KIND);
+ $cp->setBuffer($bc.buf);
+ }
+ ;
+
+com_cast[ sep::ComProtocol * cp ]
+ : 'anycast' { $cp->setCast(sep::ComProtocol::PROTOCOL_ANYCAST_KIND); }
+ | 'unicast' { $cp->setCast(sep::ComProtocol::PROTOCOL_UNICAST_KIND); }
+ | 'multicast' { $cp->setCast(sep::ComProtocol::PROTOCOL_MULTICAST_KIND); }
+ | 'broadcast' { $cp->setCast(sep::ComProtocol::PROTOCOL_BROADCAST_KIND); }
+ ;
+
+buffer_com [ sep::Machine * machine ]
+returns [ sep::BF buf ]
+ : 'buffer'
+ ( COLON
+ ( rb=ref_buffer[machine] { $buf = $rb.buf; }
+ | db=def_buffer
+ {
+ $buf = sep::BF( new sep::Buffer(machine,
+ newBufferID(), $db.kind, $db.size) );
+ }
+ )
+
+ | LT_
+ ( rb=ref_buffer[machine] { $buf = $rb.buf; }
+ | db=def_buffer
+ {
+ $buf = sep::BF( new sep::Buffer(machine,
+ newBufferID(), $db.kind, $db.size) );
+ }
+ )
+ GT
+ )
+ | db=def_buffer
+ {
+ $buf = sep::BF( new sep::Buffer(machine,
+ newBufferID(), $db.kind, $db.size) );
+ }
+ ;
+
+
+com_connect
+/* in */[ sep::Machine * machine , sep::InteractionPart * anInteraction ]
+@init{
+ sep::Connector * aConnector;
+ anInteraction->saveConnector( aConnector = new sep::Connector(*anInteraction) );
+ aConnector->update(anInteraction);
+ std::string c_id;
+
+ sep::ComRoute * comRoute = NULL;
+
+ SAVE_RULE_BEGIN_LOCATION;
+}
+@after{
+ SET_RULE_LOCATION(aConnector);
+}
+ : ( 'connector' | 'connect' )
+ ( LT_
+ com_protocol[ machine, aConnector ]
+ ( COMMA com_cast[ aConnector ] )?
+ GT
+ )?
+ ( ID { c_id = STR($ID.text->chars); } )?
+ { aConnector->fullyUpdateAllNameID(newConnectID(c_id, "_#connector")); }
+ LCURLY
+ ( com_route[ machine, aConnector ] )+
+ RCURLY
+
+
+ | ( 'route' )
+ {
+ aConnector->setNature( sep::IComPoint::IO_SIGNAL_NATURE );
+ aConnector->fullyUpdateAllNameID(newConnectID("", "_#route"));
+ }
+ ( LT_
+ com_protocol[ machine, aConnector ]
+ ( COMMA com_cast[ aConnector ] )?
+ GT
+ )?
+
+ ( com_route[ machine, aConnector ]
+
+ | LCURLY
+ ( com_route[ machine, aConnector ] )+
+ RCURLY
+
+ | LBRACKET
+ {
+ comRoute = new sep::ComRoute(aConnector,
+ sep::Modifier::PROPERTY_INOUT_DIRECTION);
+ aConnector->appendComRoute(comRoute);
+ }
+ ( com_port[ machine , comRoute ]
+ ( COMMA com_port[ machine , comRoute ] )*
+
+ | STAR
+ {
+ sep::ComPoint * comPoint = new sep::ComPoint();
+ comPoint->setMachineAllSignal(machine);
+ comRoute->setComPoint(comPoint, sep::Modifier::DIRECTION_INOUT_KIND);
+
+ SET_RULE_LOCATION(comPoint);
+ }
+ )
+ RBRACKET
+ SEMI
+ )
+ ;
+
+
+com_route
+/* in */[ sep::Machine * machine , sep::Connector * aConnector ]
+@init{
+ sep::ComRoute * comRoute = new sep::ComRoute(aConnector);
+ aConnector->appendComRoute(comRoute);
+
+ SAVE_RULE_BEGIN_LOCATION;
+}
+@after{
+ SET_RULE_LOCATION(comRoute);
+}
+ : modifier_set_direction_strict_text[ comRoute->getwModifier() ]
+ ( LT_ (
+ bc=buffer_com[ machine ]
+ {
+ comRoute->setProtocol(sep::ComProtocol::PROTOCOL_BUFFER_KIND);
+ comRoute->setBuffer($bc.buf);
+ }
+ | com_cast[ comRoute ]
+ ) GT )?
+
+ ( com_port[ machine , comRoute ] SEMI
+
+ | LCURLY
+ ( com_port[ machine , comRoute ] SEMI )+
+ RCURLY
+
+ | LBRACKET
+ ( com_port[ machine , comRoute ]
+ ( COMMA com_port[ machine , comRoute ] )*
+
+ | STAR
+ {
+ sep::ComPoint * comPoint = new sep::ComPoint();
+ comPoint->setMachineAllSignal(machine);
+ comRoute->setComPoint(comPoint, sep::Modifier::DIRECTION_INOUT_KIND);
+
+ SET_RULE_LOCATION(comPoint);
+ }
+ )
+ RBRACKET
+ SEMI
+ )
+
+ | com_port[ machine , comRoute ] SEMI
+ ;
+
+
+com_port
+/* in */[ sep::Machine * machine , sep::ComRoute * comRoute]
+@init{
+ sep::Machine * comMachine = machine;
+ while( comMachine != NULL )
+ {
+ if( comMachine->hasPortSignal() || (! comMachine->hasContainer()) )
+ {
+ break;
+ }
+ comMachine = comMachine->getContainerMachine();
+ }
+
+ SAVE_RULE_BEGIN_LOCATION;
+}
+ : ( qualifiedNameID '->' ) =>
+ m=qualifiedNameID
+ { comMachine = sep::ParserUtil::getMachine(machine, $m.s, $m.nb); }
+
+ '->'
+
+ ( cp=com_port_id[ machine , comMachine ]
+ { comRoute->appendComPoint($cp.comPoint); }
+
+ | LBRACKET
+ ( cp=com_port_id[ machine , comMachine ]
+ { comRoute->appendComPoint($cp.comPoint); }
+
+ ( COMMA cp=com_port_id[ machine , comMachine ]
+ { comRoute->appendComPoint($cp.comPoint); } )*
+
+ | STAR
+ {
+ sep::ComPoint * comPoint = new sep::ComPoint();
+ comPoint->setMachineAllSignal(comMachine);
+ comRoute->setComPoint(comPoint, sep::Modifier::DIRECTION_INOUT_KIND);
+
+ SET_RULE_LOCATION(comPoint);
+ }
+ )
+ RBRACKET
+ )
+
+
+ | cp=com_port_id[ machine , comMachine ]
+ { comRoute->appendComPoint($cp.comPoint); }
+ ;
+
+
+com_port_id
+/* in */[ sep::Machine * machine , sep::Machine * comMachine ]
+returns [ sep::BF comPoint ]
+@init{
+ SAVE_RULE_BEGIN_LOCATION;
+}
+ : id=qualifiedNameID
+ {
+ sep::ComPoint * aComPoint;
+ $comPoint = sep::BF( aComPoint = new sep::ComPoint() );
+
+ SET_RULE_LOCATION(aComPoint);
+
+ const sep::BF & comPort = sep::ParserUtil::getComPortSignal(
+ comMachine, $id.s, $id.nb);
+ if( comPort.valid() )
+ {
+ aComPoint->setMachinePort(comMachine, comPort.to_ptr< sep::Port >());
+ }
+ else
+ {
+ aComPoint->setMachine(comMachine);
+ aComPoint->setMachinePort(NEW_QNID($id.s, $id.nb));
+ }
+ }
+ ;
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// STATEMENT
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+statement
+returns [ sep::BFCode ac ]
+ : s=statement_assign { $ac = $s.ac; }
+// | s=statement_buffer { $ac = $s.ac; }
+ | s=statement_com { $ac = $s.ac; }
+ | s=statement_constraint { $ac = $s.ac; }
+ | s=statement_jump { $ac = $s.ac; }
+// | s=statement_time { $ac = $s.ac; }
+
+ | s=statement_activity { $ac = $s.ac; }
+ | s=statement_invoke_routine { $ac = $s.ac; }
+
+ | s=statement_moc { $ac = $s.ac; }
+
+ | s=statement_invoke { $ac = $s.ac; }
+ | s=statement_invoke_method { $ac = $s.ac; }
+
+ | s=statement_activity_new { $ac = $s.ac; }
+
+ | s=statement_ite { $ac = $s.ac; }
+ | s=statement_iteration { $ac = $s.ac; }
+
+// | s=statement_lem { $ac = $s.ac; }
+
+ | s=block_statement { $ac = $s.ac; }
+
+ | s=prefix_statement { $ac = $s.ac; }
+
+ | s=statement_prompt { $ac = $s.ac; }
+
+ | s=meta_statement { $ac = $s.ac; }
+
+// | s=quote_statement { $ac = $s.ac; }
+ ;
+
+
+block_statement
+returns [ sep::BFCode ac ]
+@init{
+ sep::Operator * op = OP(SEQUENCE);
+ bool implicitSequenceOp = true;
+}
+@after{
+ if( implicitSequenceOp && $ac.valid() && $ac->singleton() &&
+ sep::OperatorManager::isSchedule(op) )
+ {
+ sep::BFCode singleCode = $ac->first().bfCode();
+ $ac = singleCode;
+ }
+}
+ : LCURLY ( o=op_block { op = $o.op; implicitSequenceOp = false; } )?
+ { $ac = NEW_STMT(op); }
+ ( s=statement { $ac->append($s.ac); } )*
+ RCURLY
+ ;
+
+op_block
+returns [ sep::Operator * op ]
+ : o=op_sequence { $op = $o.op; }
+ | o=op_scheduling { $op = $o.op; }
+ | o=op_concurrency { $op = $o.op; }
+
+ | OP_FORK { $op = OP(FORK); }
+ | OP_JOIN { $op = OP(JOIN); }
+ ;
+
+op_sequence
+returns [ sep::Operator * op ]
+ : OP_SEQUENCE { $op = OP(SEQUENCE); }
+ | OP_SEQUENCE_SIDE { $op = OP(SEQUENCE_SIDE); }
+ | OP_SEQUENCE_WEAK { $op = OP(SEQUENCE_WEAK); }
+
+ | OP_ATOMIC_SEQUENCE { $op = OP(ATOMIC_SEQUENCE); }
+ ;
+
+op_scheduling
+returns [ sep::Operator * op ]
+ : OP_SCHEDULE_GT { $op = OP(PRIOR_GT); }
+ | OP_SCHEDULE_LT { $op = OP(PRIOR_LT); }
+ | OP_SCHEDULE_XOR { $op = OP(EXCLUSIVE); }
+
+ | OP_SCHEDULE_AND_THEN { $op = OP(SCHEDULE_AND_THEN); }
+ | OP_SCHEDULE_OR_ELSE { $op = OP(SCHEDULE_OR_ELSE); }
+
+ | OP_NON_DETERMINISM { $op = OP(NONDETERMINISM); }
+ ;
+
+op_concurrency
+returns [ sep::Operator * op ]
+ : OP_CONCURRENCY_ASYNC { $op = OP(ASYNCHRONOUS); }
+ | OP_CONCURRENCY_AND { $op = OP(STRONG_SYNCHRONOUS); }
+ | OP_CONCURRENCY_OR { $op = OP(WEAK_SYNCHRONOUS); }
+ | OP_CONCURRENCY_INTERLEAVING { $op = OP(INTERLEAVING); }
+ | OP_CONCURRENCY_PARALLEL { $op = OP(PARALLEL); }
+
+ | OP_CONCURRENCY_RDV_ASYNC { $op = OP(RDV_ASYNCHRONOUS); }
+ | OP_CONCURRENCY_RDV_AND { $op = OP(RDV_STRONG_SYNCHRONOUS); }
+ | OP_CONCURRENCY_RDV_OR { $op = OP(RDV_WEAK_SYNCHRONOUS); }
+ | OP_CONCURRENCY_RDV_INTERLEAVING { $op = OP(RDV_INTERLEAVING); }
+ | OP_CONCURRENCY_RDV_PARALLEL { $op = OP(RDV_PARALLEL); }
+ ;
+
+
+
+op_invokable
+returns [ sep::Operator * op ]
+ : PLUS { $op = OP(PLUS); }
+
+ | MINUS { $op = OP(MINUS); }
+
+ | STAR { $op = OP(MULT); }
+ | DIV { $op = OP(DIV); }
+ | MOD { $op = OP(MOD); }
+
+// | POW { $op = OP(POW); }
+
+ | EQUAL { $op = OP(EQ); }
+ | NEQUAL { $op = OP(NEQ); }
+
+ | SEQUAL { $op = OP(SEQ); }
+ | NSEQUAL { $op = OP(NSEQ); }
+
+ | GT { $op = OP(GT); }
+ | GTE { $op = OP(GTE); }
+ | LT_ { $op = OP(LT); }
+ | LTE { $op = OP(LTE); }
+
+ | LNOT { $op = OP(NOT); }
+ | LAND { $op = OP(AND); }
+ | LAND_THEN { $op = OP(AND_THEN); }
+ | LOR { $op = OP(OR); }
+ | LOR_ELSE { $op = OP(OR_ELSE); }
+
+ | BNOT { $op = OP(BNOT); }
+ | BAND { $op = OP(BAND); }
+ | BOR { $op = OP(BOR); }
+ | BXOR { $op = OP(BXOR); }
+
+ | LSHIFT { $op = OP(LSHIFT); }
+ | RSHIFT { $op = OP(RSHIFT); }
+
+ | ASSIGN { $op = OP(ASSIGN); }
+ | ASSIGN_AFTER { $op = OP(ASSIGN_AFTER); }
+ | ASSIGN_REF { $op = OP(ASSIGN_REF); }
+ | ASSIGN_MACRO { $op = OP(ASSIGN_MACRO); }
+
+ | OP_PUSH { $op = OP(PUSH); }
+ | OP_ASSIGN_TOP { $op = OP(ASSIGN_TOP); }
+ | OP_TOP { $op = OP(TOP); }
+ | OP_POP { $op = OP(POP); }
+ ;
+
+////////////////////////////////////////////////////////////////////////////////
+// AVM STATEMENT
+////////////////////////////////////////////////////////////////////////////////
+
+prefix_statement
+returns [ sep::BFCode ac ]
+ : DOLLAR_LCURLY op=avm_operator { $ac = NEW_STMT(op); }
+ ( ps=prefix_statement { $ac->append($ps.ac); }
+ | e=unaryExpression { $ac->append($e.bf); }
+ )*
+ RCURLY
+ ;
+
+prefix_expression
+returns [ sep::BFCode ac ]
+ : DOLLAR_LCURLY op=avm_operator { $ac = NEW_STMT(op); }
+ ( ps=prefix_expression { $ac->append($ps.ac); }
+ | e=unaryExpression { $ac->append($e.bf); }
+ )*
+ RCURLY
+ ;
+
+avm_operator
+returns [ sep::Operator * op ]
+ : o=op_invokable { $op = $o.op; }
+
+ | o=op_activity { $op = $o.op; }
+
+ | { (op = sep::OperatorManager::getOp(STR(LT(1)->getText(LT(1))->chars))) != NULL }? ID
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// AVM STATEMENT INVOKE
+////////////////////////////////////////////////////////////////////////////////
+
+statement_invoke_method
+returns [ sep::BFCode ac ]
+@init{
+ sep::BF modelProcedure;
+ sep::Machine * callProcedure;
+
+ SAVE_RULE_BEGIN_LOCATION;
+}
+@after
+{
+ SET_RULE_LOCATION(callProcedure);
+}
+ : 'call' id=ID
+ {
+ modelProcedure = sep::ParserUtil::getvarProcedure(STR($id.text->chars));
+
+ callProcedure = sep::Machine::newProcedureInstance(_CPM_,
+ sep::OSS() << "call_" << ++mProcedureCallCount
+ << '#' << STR($id.text->chars), modelProcedure);
+
+ callProcedure->getwSpecifier().setDesignInstanceStatic();
+
+ $ac = NEW_STMT1(OP(INVOKE_METHOD), sep::BF(callProcedure));
+ }
+
+ decl_instance_machine_params [ callProcedure ] ?
+ decl_instance_machine_returns[ callProcedure ] ?
+
+ SEMI
+ ;
+
+
+statement_invoke
+returns [ sep::BFCode ac ]
+ : LPAREN_INVOKE
+ ue=unaryExpression { $ac = NEW_STMT1(OP(INVOKE_METHOD), $ue.bf); }
+ ( id=ID { $ac->append(sep::ParserUtil::getInvokable($ue.bf, STR($id.text->chars))); }
+ | 'in' { $ac->append( INCR_BF(OP(IN)) ); }
+ | op=op_invokable { $ac->append( INCR_BF($op.op) ); }
+ )
+ ( e=expression { $ac->append($e.bf); } )*
+ ( 'provided:' e=expression
+ | 'from:' ue=unaryExpression
+ | 'to:' ue=unaryExpression
+ | 'activity:' o=op_activity
+ )?
+ RPAREN
+ SEMI
+ ;
+
+expression_invoke
+returns [ sep::BFCode ac ]
+ : LPAREN_INVOKE
+ e=unaryExpression { $ac = NEW_STMT1(OP(INVOKE_METHOD), $e.bf); }
+ ( id=ID { $ac->append(sep::ParserUtil::getInvokable($e.bf, STR($id.text->chars))); }
+ | 'in' { $ac->append( INCR_BF(OP(IN)) ); }
+ | op=op_invokable { $ac->append( INCR_BF($op.op) ); }
+ )
+ ( e=expression { $ac->append($e.bf); } )*
+ ( 'provided:' e=expression
+ | 'from:' ue=unaryExpression
+ | 'to:' ue=unaryExpression
+ | 'activity:' o=op_activity
+ )?
+ RPAREN
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// STATEMENT NEW
+////////////////////////////////////////////////////////////////////////////////
+
+statement_activity_new
+returns [ sep::BFCode ac ]
+@init{
+ sep::Machine * ptrInstance = NULL;
+ sep::BF aModel;
+
+ sep::Machine * container = _CPM_;
+}
+@after{
+ if( aModel.is< sep::Machine >() )
+ {
+ POP_CTX;
+ }
+}
+ : 'new' { $ac = NEW_STMT(OP(INVOKE_NEW)); }
+ id=qualifiedNameID
+ {
+ aModel = sep::ParserUtil::getvarMachine($id.s, $id.nb);
+
+ if( aModel.is< sep::Machine >() )
+ {
+ PUSH_CTX_NEW( aModel.to_ptr< sep::Machine >() );
+ }
+
+ ptrInstance = sep::Machine::newInstance(container,
+ newInvokeNewInstanceNameID(container, $id.s), aModel, 1, 1);
+
+ ptrInstance->getwSpecifier().override_ifdef(
+ sep::Specifier::DESIGN_INSTANCE_DYNAMIC_SPECIFIER );
+
+ $ac->append( container->saveOwnedElement( ptrInstance ) );
+ }
+
+ //activity_machine_param_return[ aModel , ac ]
+ decl_instance_dynamic_impl[ _CPM_ , ptrInstance ]
+
+ ( ( '-->' | 'returns:' ) e=expression )?
+
+ SEMI
+ ;
+
+
+decl_instance_dynamic_impl
+/* in */[ sep::Machine * container , sep::Machine * ptrInstance ]
+@init{
+ SAVE_RULE_BEGIN_LOCATION;
+}
+@after{
+ SET_RULE_LOCATION(ptrInstance);
+}
+ : ( ( LPAREN ) => LPAREN
+ ( def_instance_on_new_activity[ ptrInstance ] ) ?
+ RPAREN
+ )?
+
+ ( ( LCURLY ) => LCURLY
+ ( s=statement { ptrInstance->getUniqBehaviorPart()->seqOnCreate($s.ac); } )*
+
+ ( def_instance_activity[ ptrInstance ] )*
+ RCURLY
+ )?
+ ;
+
+
+
+expression_activity_new
+returns [ sep::BFCode ac ]
+@init{
+ sep::Machine * ptrInstance = NULL;
+ sep::BF aModel;
+
+ sep::Machine * container = _CPM_;
+}
+@after{
+ if( aModel.is< sep::Machine >() )
+ {
+ POP_CTX;
+ }
+}
+ : 'new' { $ac = NEW_STMT(OP(INVOKE_NEW)); }
+ id=qualifiedNameID
+ {
+ sep::BF aModel = sep::ParserUtil::getvarMachine($id.s, $id.nb);
+
+ if( aModel.is< sep::Machine >() )
+ {
+ PUSH_CTX_NEW( aModel.to_ptr< sep::Machine >() );
+ }
+
+ ptrInstance = sep::Machine::newInstance(container,
+ newInvokeNewInstanceNameID(container, $id.s), aModel, 1, 1);
+
+ ptrInstance->getwSpecifier().override_ifdef(
+ sep::Specifier::DESIGN_INSTANCE_DYNAMIC_SPECIFIER );
+
+ $ac->append( container->saveOwnedElement( ptrInstance ) );
+ }
+
+ activity_machine_param_return[ aModel , ac ]
+// decl_instance_dynamic_expr_impl[ _CPM_ , ptrInstance , ac ]
+
+// { $ac->toStream(sep::AVM_OS_DEBUG); }
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// STATEMENT PROMPT
+////////////////////////////////////////////////////////////////////////////////
+
+statement_prompt
+returns [ sep::BFCode ac ]
+ : STATEMENT_PROMPT spi=statement_prompt_impl { $ac = $spi.ac; }
+ ;
+
+statement_prompt_impl
+returns [ sep::BFCode ac ]
+ : spo=statement_prompt_obs { $ac = $spo.ac; }
+ ;
+
+
+statement_prompt_obs
+returns [ sep::BFCode ac ]
+@init{
+ sep::BF varMachine = INCR_BF(_SYSTEM_);
+}
+ : { IS_KEYWORD( "obs" ) }? ID
+
+ ( 'ctx:' id=qualifiedNameID
+ { varMachine = sep::ParserUtil::getvarMachine($id.s, $id.nb); }
+ )?
+
+ LCURLY
+ bs=statement_prompt_obs_com[ varMachine ]
+ RCURLY
+
+ ( 'provided:' e=expression
+ | LBRACKET e=expression RBRACKET
+ )
+ SEMI
+
+ { $ac = NEW_STMT3(OP(OBS), varMachine, $bs.ac, $e.bf); }
+ ;
+
+
+statement_prompt_obs_com [ const sep::BF & varMachine ]
+returns [ sep::BFCode ac ]
+ : sc=statement_com { $ac = $sc.ac; }
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// META STATEMENT
+////////////////////////////////////////////////////////////////////////////////
+
+meta_statement
+returns [ sep::BFCode ac ]
+ : '$:informal' bs=block_statement { $ac = NEW_STMT1(OP(INFORMAL), $bs.ac); }
+ | '$:trace' bs=block_statement { $ac = NEW_STMT1(OP(TRACE) , $bs.ac); }
+ | '$:debug' bs=block_statement { $ac = NEW_STMT1(OP(DEBUG) , $bs.ac); }
+ | '$:comment' bs=block_statement { $ac = NEW_STMT1(OP(COMMENT) , $bs.ac); }
+/* TODO#ADD
+ // meta_eval
+ | LBRACKET_BAR
+ e=expression { $ac = NEW_STMT1(OP(META_EVAL), $e.bf); }
+ BAR_RBRACKET
+
+ // meta_run
+ | LBRACKET_LCURLY
+ s=statement { $ac = NEW_STMT1(OP(META_RUN), $s.ac); }
+ RCURLY_RBRACKET
+*/
+ ;
+
+/* TODO#ADD
+quote_statement
+returns [ sep::BFCode ac ]
+@init{
+ sep::Operator * op = OP(SEQUENCE);
+}
+ : PERCENT_LCURLY ( o=op_block { op = $o.op; } ) ? { $ac = NEW_STMT(op); }
+ ( s=statement { $ac->append($s.ac); } )+
+ RCURLY_PERCENT
+ { $ac = NEW_STMT1(OP(QUOTE), $ac); }
+ ;
+*/
+
+
+////////////////////////////////////////////////////////////////////////////////
+// STATEMENT ASSIGN
+////////////////////////////////////////////////////////////////////////////////
+
+statement_assign
+returns [ sep::BFCode ac ]
+ // lvalue := expression
+ : lv=lvalue
+ ( ( ASSIGN | ASSIGN_AFTER ) e=expression SEMI
+ { $ac = NEW_STMT2(OP(ASSIGN), $lv.bf, $e.bf); }
+
+ | ASSIGN_REF e=lvalue SEMI
+ { $ac = NEW_STMT2(OP(ASSIGN_REF), $lv.bf, $e.bf); }
+
+ | ASSIGN_MACRO e=expression SEMI
+ { $ac = NEW_STMT2(OP(ASSIGN_MACRO), $lv.bf, $e.bf); }
+
+
+ | ( PLUS_ASSIGN | PLUS_ASSIGN_AFTER ) e=expression SEMI
+ { $ac = NEW_STMT_ASSIGN_OP(OP(PLUS), $lv.bf, $e.bf); }
+
+ | ( MINUS_ASSIGN | MINUS_ASSIGN_AFTER ) e=expression SEMI
+ { $ac = NEW_STMT_ASSIGN_OP(OP(MINUS), $lv.bf, $e.bf); }
+
+ | ( STAR_ASSIGN | STAR_ASSIGN_AFTER ) e=expression SEMI
+ { $ac = NEW_STMT_ASSIGN_OP(OP(MULT), $lv.bf, $e.bf); }
+
+ | ( DIV_ASSIGN | DIV_ASSIGN_AFTER ) e=expression SEMI
+ { $ac = NEW_STMT_ASSIGN_OP(OP(DIV), $lv.bf, $e.bf); }
+
+ | ( MOD_ASSIGN | MOD_ASSIGN_AFTER ) e=expression SEMI
+ { $ac = NEW_STMT_ASSIGN_OP(OP(MOD), $lv.bf, $e.bf); }
+
+
+ | ( LAND_ASSIGN | LAND_ASSIGN_AFTER ) e=expression SEMI
+ { $ac = NEW_STMT_ASSIGN_OP(OP(AND), $lv.bf, $e.bf); }
+
+ | ( LOR_ASSIGN | LOR_ASSIGN_AFTER ) e=expression SEMI
+ { $ac = NEW_STMT_ASSIGN_OP(OP(OR), $lv.bf, $e.bf); }
+
+
+ | ( BAND_ASSIGN | BAND_ASSIGN_AFTER ) e=expression SEMI
+ { $ac = NEW_STMT_ASSIGN_OP(OP(BAND), $lv.bf, $e.bf); }
+
+ | ( BOR_ASSIGN | BOR_ASSIGN_AFTER ) e=expression SEMI
+ { $ac = NEW_STMT_ASSIGN_OP(OP(BOR), $lv.bf, $e.bf); }
+
+ | ( BXOR_ASSIGN | BXOR_ASSIGN_AFTER ) e=expression SEMI
+ { $ac = NEW_STMT_ASSIGN_OP(OP(BXOR), $lv.bf, $e.bf); }
+
+
+ | ( LSHIFT_ASSIGN | LSHIFT_ASSIGN_AFTER ) e=expression SEMI
+ { $ac = NEW_STMT_ASSIGN_OP(OP(LSHIFT), $lv.bf, $e.bf); }
+
+ | ( RSHIFT_ASSIGN | RSHIFT_ASSIGN_AFTER ) e=expression SEMI
+ { $ac = NEW_STMT_ASSIGN_OP(OP(RSHIFT), $lv.bf, $e.bf); }
+
+
+ // queue <=< expression ( <=< expression )*
+ // fifo <=< a <=< b <=< c
+ // soit :> fifo:a:b:c
+ | OP_PUSH e=expression
+ { $ac = NEW_STMT2(OP(PUSH), $lv.bf, $e.bf); }
+ ( OP_PUSH e=expression { $ac->append($e.bf); } )*
+ SEMI
+
+ // queue ^=< expression
+ // fifo:a ^=< b
+ // soit :> fifo:b
+ | OP_ASSIGN_TOP e=expression SEMI
+ { $ac = NEW_STMT2(OP(ASSIGN_TOP), $lv.bf, $e.bf); }
+
+ // queue ^=> lvalue
+ // fifo:a ^=> b
+ // soit :> fifo:a et lvalue = a
+ | OP_TOP v=lvalue SEMI
+ { $ac = NEW_STMT2(OP(TOP), $lv.bf, $v.bf); }
+
+ // queue >=> lvalue ( >=> lvalue )*
+ // fifo::a::b::c >=> lvalue1 >=> lvalue2 >=> lvalue3
+ // soit :> fifo et lvalue1 = c , lvalue2 = b , lvalue3 = a
+ | OP_POP { $ac = NEW_STMT1(OP(POP), $lv.bf); }
+ ( v=lvalue { $ac->append($v.bf); } )*
+ SEMI
+
+ // lvalue ++
+ | INCR SEMI
+ { $ac = NEW_STMT_ASSIGN_OP(OP(PLUS), $lv.bf,
+ sep::ExpressionConstant::INTEGER_ONE); }
+
+ // lvalue --
+ | DECR SEMI
+ { $ac = NEW_STMT_ASSIGN_OP(OP(PLUS), $lv.bf,
+ sep::ExpressionConstant::INTEGER_MINUS_ONE); }
+ )
+
+// | 'pop' lv=lvalue SEMI
+// { $ac = NEW_STMT1(OP(POP), $lv.bf); }
+
+// | 'newfresh' lv=lvalue SEMI
+// { $ac = NEW_STMT1(OP(ASSIGN_NEWFRESH), $lv.bf); }
+
+ // ++ lvalue
+ | INCR lv=lvalue SEMI
+ { $ac = NEW_STMT_ASSIGN_OP(OP(PLUS), $lv.bf,
+ sep::ExpressionConstant::INTEGER_ONE); }
+
+ // -- lvalue
+ | DECR lv=lvalue SEMI
+ { $ac = NEW_STMT_ASSIGN_OP(OP(PLUS), $lv.bf,
+ sep::ExpressionConstant::INTEGER_MINUS_ONE); }
+ ;
+
+
+lvalue
+returns [ sep::BF bf ]
+@init{
+ sep::UniFormIdentifier * ufi;
+ sep::BF bfUfi; // for automatic destruction of << UFI >> if need
+
+ sep::avm_size_t countID = 1;
+ bool isnotEXPR = true;
+
+ SAVE_RULE_BEGIN_LOCATION;
+}
+ : ( COLONx2 { ufi->setAbsolute(); } )?
+ id=ID
+ {
+ ufi = new sep::UniFormIdentifier(false);
+ bfUfi = ufi;
+
+ if( ($bf = sep::ParserUtil::getvar(STR($id.text->chars), 1)).valid() )
+ {
+ ufi->appendFieldVariable($bf);
+ }
+ else if( ($bf = sep::ParserUtil::getvarMachine(
+ STR($id.text->chars), 1)).valid() )
+ {
+ ufi->appendFieldMachine($bf);
+ }
+ else
+ {
+ ufi->appendField(STR($id.text->chars));
+ }
+
+ $bf = bfUfi;
+ }
+
+ ( ( DOT id=ID
+ { ufi->appendField(STR($id.text->chars)); ++countID; } )
+
+ | ( LBRACKET e=expression RBRACKET
+ { ufi->appendIndex($e.bf); isnotEXPR = false; } )
+ )*
+ {
+ if( isnotEXPR )
+ {
+ if( countID == 1 )
+ {
+ $bf = ufi->first();
+ }
+ else if( ($bf = sep::ParserUtil::getvar(
+ ufi->str(), countID)).invalid() )
+ {
+ $bf = bfUfi;
+ SET_RULE_LOCATION(ufi);
+ }
+ }
+ }
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// STATEMENT BUFFER
+////////////////////////////////////////////////////////////////////////////////
+
+//statement_buffer
+//returns [ sep::BFCode ac ]
+// : 'clear' id=qualifiedNameID SEMI
+// { $ac = NEW_STMT1(OP(CLEAR), getvarBuffer($id.s, $id.nb)); }
+//
+// | 'push' id=qualifiedNameID
+// { $ac = NEW_STMT1(OP(PUSH), getvarBuffer($id.s, $id.nb)); }
+// parameters[ ac ] ? SEMI
+//
+// | 'pop' id=qualifiedNameID
+// { $ac = NEW_STMT1(OP(POP), getvarBuffer($id.s, $id.nb)); }
+// parameters[ ac ] ? SEMI
+//
+// | 'top' id=qualifiedNameID
+// { $ac = NEW_STMT1(OP(TOP), getvarBuffer($id.s, $id.nb)); }
+// parameters[ ac ] ? SEMI
+// ;
+
+//expression_buffer
+//returns [ sep::BFCode ac ]
+// : 'empty' e=unaryExpression
+// { $ac = NEW_STMT1(OP(EMPTY), $e.bf); }
+//
+// | 'nonempty' e=unaryExpression
+// { $ac = NEW_STMT1(OP(NONEMPTY), $e.bf); }
+//
+// | 'singleton' e=unaryExpression
+// { $ac = NEW_STMT1(OP(SINGLETON), $e.bf); }
+//
+// | 'populated' e=unaryExpression
+// { $ac = NEW_STMT1(OP(POPULATED), $e.bf); }
+//
+// | 'full' e=unaryExpression
+// { $ac = NEW_STMT1(OP(FULL), $e.bf); }
+//
+// | 'size' e=unaryExpression
+// { $ac = NEW_STMT1(OP(SIZE), $e.bf); }
+//
+// | 'pop' e=unaryExpression
+// { $ac = NEW_STMT1(OP(POP), $e.bf); }
+//
+// | 'top' e=unaryExpression
+// { $ac = NEW_STMT1(OP(TOP), $e.bf); }
+// ;
+
+parameters [ const sep::BFCode & ac ]
+ : LPAREN e=expression { $ac->append($e.bf); }
+ ( COMMA e=expression { $ac->append($e.bf); } )*
+ RPAREN
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// STATEMENT COM
+////////////////////////////////////////////////////////////////////////////////
+
+statement_com
+returns [ sep::BFCode ac ]
+ : s=statement_com_input { $ac = $s.ac; }
+ | s=statement_com_output { $ac = $s.ac; }
+ ;
+
+statement_com_input
+returns [ sep::BFCode ac ]
+@init{
+ sep::BF varPortSignal;
+ sep::Port * port = NULL;
+ sep::Operator * op = NULL;
+}
+ : ( tok='input' { op = OP(INPUT); }
+ | tok='input#save' { op = OP(INPUT_SAVE); }
+ | tok='input#var' { op = OP(INPUT_VAR); }
+ | tok='input#flow' { op = OP(INPUT_FLOW); }
+ | tok='input#env' { op = OP(INPUT_ENV); }
+ | tok='input#buffer' { op = OP(INPUT_BUFFER); }
+ | tok='input#rdv' { op = OP(INPUT_RDV); }
+ ) id=qualifiedNameID
+ {
+ $ac = NEW_STMT1( op,
+ varPortSignal = sep::ParserUtil::getvarPortSignal($id.s, $id.nb) );
+ if( varPortSignal.is< sep::Port >() )
+ { port = varPortSignal.to_ptr< sep::Port >(); }
+ else if( varPortSignal.invalid() )
+ {
+ sep::ParserUtil::avm_syntax_error(
+ "statement_com_input:> ", $tok.line )
+ << "Unfound port/signal or variable < " << $id.s
+ << " > in machine < " << str_header( _CPM_ ) << " >"
+ << sep::ParserUtil::SYNTAX_ERROR_EOL;
+ }
+ }
+ parameters_port[ port , ac ] ?
+ ( '<--'
+ ( 'env' { $ac->setOperator( OP(INPUT_ENV) ); }
+ | me=expression
+ {
+ sep::BFCode inputFrom = NEW_STMT2(OP(INPUT_FROM), $ac->first(), $me.bf);
+
+ inputFrom->insert(inputFrom->end(), ++($ac->begin()), $ac->end());
+ $ac = inputFrom;
+ }
+ )
+ ( '<-' id=qualifiedNameID
+ { $ac->append(sep::ParserUtil::getvarPortSignal($id.s, $id.nb)); }
+ )?
+ )?
+ ( ( '<==' | 'via' ) id=qualifiedNameID
+ { sep::ParserUtil::updateSignalRoutingChannel(
+ sep::Modifier::DIRECTION_INPUT_KIND, $ac, $id.s, $id.nb); }
+ )?
+ SEMI
+ ;
+
+statement_com_output
+returns [ sep::BFCode ac ]
+@init{
+ sep::BF varPortSignal;
+ sep::Port * port = NULL;
+ sep::Operator * op = NULL;
+}
+ : ( tok='output' { op = OP(OUTPUT); }
+ | tok='output#var' { op = OP(OUTPUT_VAR); }
+ | tok='output#flow' { op = OP(OUTPUT_FLOW); }
+ | tok='output#env' { op = OP(OUTPUT_ENV); }
+ | tok='output#buffer' { op = OP(OUTPUT_BUFFER); }
+ | tok='output#rdv' { op = OP(OUTPUT_RDV); }
+ ) id=qualifiedNameID
+ {
+ $ac = NEW_STMT1( op,
+ varPortSignal = sep::ParserUtil::getvarPortSignal($id.s, $id.nb) );
+ if( varPortSignal.is< sep::Port >() )
+ { port = varPortSignal.to_ptr< sep::Port >(); }
+ else if( varPortSignal.invalid() )
+ {
+ sep::ParserUtil::avm_syntax_error(
+ "statement_com_output:>", $tok.line )
+ << "Unfound port/signal or variable < " << $id.s
+ << " > in machine < " << str_header( _CPM_ ) << " >"
+ << sep::ParserUtil::SYNTAX_ERROR_EOL;
+ }
+ }
+ parameters_port[ port , ac ] ?
+ ( '-->'
+ ( 'env' { $ac->setOperator( OP(OUTPUT_ENV) ); }
+ | me=expression
+ {
+ sep::BFCode outputTo = NEW_STMT2(OP(OUTPUT_TO), $ac->first(), $me.bf);
+
+ outputTo->insert(outputTo->end(), ++($ac->begin()), $ac->end());
+ $ac = outputTo;
+ }
+ )
+ ( '->' id=qualifiedNameID
+ { $ac->append(sep::ParserUtil::getvarPortSignal($id.s, $id.nb)); }
+ )?
+ )?
+ ( ( '==>' | 'via' ) id=qualifiedNameID
+ { sep::ParserUtil::updateSignalRoutingChannel(
+ sep::Modifier::DIRECTION_OUTPUT_KIND, $ac, $id.s, $id.nb); }
+ )?
+ SEMI
+ ;
+
+
+parameters_port
+/* in */[ sep::Port * port , const sep::BFCode & ac ]
+@init{
+ sep::BFVector labelledParams(
+ (port != NULL) ? port->getParametersCount() : 0 );
+
+ sep::BFList positionalParams;
+}
+@after{
+ sep::ParserUtil::computePortParameter(
+ port, $ac, labelledParams, positionalParams);
+}
+ : LPAREN
+ lp=labelled_argument
+ {
+ sep::ParserUtil::appendPortParameter(port, $lp.label,
+ labelledParams, positionalParams, $lp.arg);
+ }
+ ( COMMA lp=labelled_argument
+ {
+ sep::ParserUtil::appendPortParameter(port, $lp.label,
+ labelledParams, positionalParams, $lp.arg);
+ }
+ )*
+ RPAREN
+ ;
+
+
+
+expression_com
+returns [ sep::BFCode ac ]
+ : 'present' id=qualifiedNameID
+ { $ac = NEW_STMT1(OP(PRESENT),
+ sep::ParserUtil::getvarPortSignal($id.s, $id.nb)); }
+
+ | 'absent' id=qualifiedNameID
+ { $ac = NEW_STMT1(OP(ABSENT),
+ sep::ParserUtil::getvarPortSignal($id.s, $id.nb)); }
+ ;
+
+////////////////////////////////////////////////////////////////////////////////
+// STATEMENT GUARD
+////////////////////////////////////////////////////////////////////////////////
+
+statement_constraint
+returns [ sep::BFCode ac ]
+ : s=statement_guard { $ac = $s.ac; }
+ | s=statement_timed_guard { $ac = $s.ac; }
+ | s=statement_checksat { $ac = $s.ac; }
+ ;
+
+
+statement_guard
+returns [ sep::BFCode ac ]
+ : 'guard' e=expression SEMI
+ { $ac = NEW_STMT1(OP(GUARD), $e.bf); }
+
+ | 'event' e=expression SEMI
+ { $ac = NEW_STMT1(OP(EVENT), $e.bf); }
+ ;
+
+statement_timed_guard
+returns [ sep::BFCode ac ]
+ : 'tguard' e=expression SEMI
+ { $ac = NEW_STMT1(OP(TIMED_GUARD), $e.bf); }
+ ;
+
+statement_checksat
+returns [ sep::BFCode ac ]
+@init{
+ std::string solverID;
+}
+ : 'checksat'
+ ( LT_ ( id=StringLiteral | id=ID ) GT { solverID = STR($id.text->chars); }
+ | 'solver:' ( id=StringLiteral | id=ID ) { solverID = STR($id.text->chars); }
+ )?
+ e=expression SEMI
+ {
+ if( solverID.empty() )
+ {
+ $ac = NEW_STMT1( OP(CHECK_SAT), $e.bf );
+ }
+ else
+ {
+ $ac = NEW_STMT2( OP(CHECK_SAT), NEW_STRING(solverID), $e.bf );
+ }
+ }
+ ;
+
+
+expression_guard
+returns [ sep::BFCode ac ]
+@init{
+ std::string solverID;
+}
+ : 'checksat'
+ ( LT_ ( id=StringLiteral | id=ID ) GT { solverID = STR($id.text->chars); }
+ | 'solver:' ( id=StringLiteral | id=ID ) { solverID = STR($id.text->chars); }
+ )?
+ e=expression
+ {
+ if( solverID.empty() )
+ {
+ $ac = NEW_STMT1( OP(CHECK_SAT), $e.bf);
+ }
+ else
+ {
+ $ac = NEW_STMT2( OP(CHECK_SAT), NEW_STRING(solverID), $e.bf );
+ }
+ }
+ ;
+
+////////////////////////////////////////////////////////////////////////////////
+// STATEMENT IF THEN [ ELSEIF ] [ ELSE ]
+////////////////////////////////////////////////////////////////////////////////
+
+statement_ite
+returns [ sep::BFCode ac ]
+@init{
+ sep::BFCode elseifCode;
+ sep::BFCode code;
+}
+ : 'if' e=expression bs=block_statement
+ { code = $ac = NEW_STMT2(OP(IF), $e.bf, $bs.ac); }
+ ( ( 'elseif' | 'else' 'if' ) e=expression bs=block_statement
+ {
+ code->setOperator(OP(IFE));
+ code->append(elseifCode = NEW_STMT2(OP(IF), $e.bf, $bs.ac));
+ code = elseifCode;
+ }
+ )*
+ ( 'else' bs=block_statement
+ {
+ if( $bs.ac->nonempty() )
+ {
+ code->setOperator(OP(IFE)); code->append($bs.ac);
+ }
+ }
+ )?
+ ;
+
+expression_ite
+returns [ sep::BFCode ac ]
+@init{
+ sep::BFCode elseifExpr;
+ sep::BFCode expr;
+}
+ : 'if' c=expression LCURLY e=expression RCURLY
+ { expr = $ac = NEW_STMT2(OP(IF), $c.bf, $e.bf); }
+ ( ( 'elseif' | 'else' 'if' ) c=expression LCURLY e=expression RCURLY
+ {
+ expr->setOperator(OP(IFE));
+ expr->append(elseifExpr = NEW_STMT2(OP(IF), $c.bf, $e.bf));
+ expr = elseifExpr;
+ }
+ )*
+ ( 'else' LCURLY e=expression RCURLY
+ { expr->setOperator(OP(IFE)); expr->append($e.bf); }
+ )?
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// STATEMENT WHERE PROVIDED
+////////////////////////////////////////////////////////////////////////////////
+
+//statement_where
+//returns [ sep::BFCode ac ]
+// : 'where' e=expression bs=block_statement
+// { $ac = NEW_STMT2(OP(WHERE), $e.bf, $bs.ac); }
+// ( 'provided' e=expression { $ac->append($e.bf); } )?
+// ( 'else' bs=block_statement { $ac->append($bs.ac); }
+// )?
+// ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// STATEMENT ITERATION
+////////////////////////////////////////////////////////////////////////////////
+
+statement_iteration
+returns [ sep::BFCode ac ]
+ : 'for'
+ ( isa=for_assign_header SEMI e=expression SEMI sai=for_assign_header
+ { $ac = NEW_STMT3(OP(FOR), $isa.ac, $e.bf, $sai.ac); }
+ |
+ LPAREN
+ isa=for_assign_header SEMI e=expression SEMI sai=for_assign_header
+ RPAREN
+ { $ac = NEW_STMT3(OP(FOR), $isa.ac, $e.bf, $sai.ac); }
+ |
+ lv=lvalue COLON e=expression
+ { $ac = NEW_STMT2(OP(FOREACH), $lv.bf, $e.bf); }
+ |
+ LPAREN lv=lvalue COLON e=expression RPAREN
+ { $ac = NEW_STMT2(OP(FOREACH), $lv.bf, $e.bf); }
+ )
+ sa=block_statement { $ac->append($sa.ac); }
+
+ | 'while' e=expression bs=block_statement
+ { $ac = NEW_STMT2(OP(WHILE_DO), $e.bf, $bs.ac); }
+
+ | 'do' bs=block_statement 'while' e=expression SEMI
+ { $ac = NEW_STMT2(OP(DO_WHILE), $bs.ac, $e.bf); }
+ ;
+
+
+for_assign_header
+returns [ sep::BFCode ac ]
+ // lvalue := expression
+ : lv=lvalue
+ ( ASSIGN e=expression
+ { $ac = NEW_STMT2(OP(ASSIGN), $lv.bf, $e.bf); }
+
+ // ++ lvalue
+ // lvalue ++
+ | INCR
+ { $ac = NEW_STMT_ASSIGN_OP(OP(PLUS), $lv.bf,
+ sep::ExpressionConstant::INTEGER_ONE); }
+
+ // lvalue --
+ | DECR
+ { $ac = NEW_STMT_ASSIGN_OP(OP(PLUS), $lv.bf,
+ sep::ExpressionConstant::INTEGER_MINUS_ONE); }
+ )
+
+ | INCR lv=lvalue
+ { $ac = NEW_STMT_ASSIGN_OP(OP(PLUS), $lv.bf,
+ sep::ExpressionConstant::INTEGER_ONE); }
+
+ // -- lvalue
+ | DECR lv=lvalue
+ { $ac = NEW_STMT_ASSIGN_OP(OP(PLUS), $lv.bf,
+ sep::ExpressionConstant::INTEGER_MINUS_ONE); }
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// STATEMENT JUMP
+////////////////////////////////////////////////////////////////////////////////
+
+statement_jump
+returns [ sep::BFCode ac ]
+ : 'break' { $ac = NEW_STMT(OP(BREAK)); }
+ ( e=expression { $ac->append( $e.bf ); } )?
+ SEMI
+
+ | 'continue' { $ac = NEW_STMT(OP(CONTINUE)); }
+ ( e=expression { $ac->append( $e.bf ); } )?
+ SEMI
+
+ | 'return' { $ac = NEW_STMT(OP(RETURN)); }
+ ( e=expression { $ac->append( $e.bf ); }
+ ( COMMA e=expression { $ac->append( $e.bf ); } )*
+ )?
+ SEMI
+
+ | 'exit' { $ac = NEW_STMT(OP(EXIT)); }
+ ( e=expression { $ac->append( $e.bf ); } )?
+ SEMI
+ ;
+
+////////////////////////////////////////////////////////////////////////////////
+// STATEMENT LAMBDA
+////////////////////////////////////////////////////////////////////////////////
+
+expression_lambda
+returns [ sep::BFCode ac ]
+ : 'lambda' { $ac = NEW_CODE( OP(LAMBDA) ); }
+ ( id=ID { $ac->append( NEW_ID(STR($id.text->chars)) ); } )*
+ '->' e=expression { $ac->append( $e.bf ); }
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// STATEMENT STATUS
+////////////////////////////////////////////////////////////////////////////////
+
+expression_status
+returns [ sep::BFCode ac ]
+ : 'status#was' o=op_activity id=qualifiedNameID
+ { $ac = NEW_STMT2(OP(STATUS_WAS), INCR_BF($o.op),
+ sep::ParserUtil::getvarMachine($id.s, $id.nb)); }
+
+ | 'status#is' o=op_activity id=qualifiedNameID
+ { $ac = NEW_STMT2(OP(STATUS_IS), INCR_BF($o.op),
+ sep::ParserUtil::getvarMachine($id.s, $id.nb)); }
+
+ | 'status#being' o=op_activity id=qualifiedNameID
+ { $ac = NEW_STMT2(OP(STATUS_BEING), INCR_BF($o.op),
+ sep::ParserUtil::getvarMachine($id.s, $id.nb)); }
+
+ | 'status#will' o=op_activity id=qualifiedNameID
+ { $ac = NEW_STMT2(OP(STATUS_WILL), INCR_BF($o.op),
+ sep::ParserUtil::getvarMachine($id.s, $id.nb)); }
+
+ | 'changed' lv=lvalue
+ { $ac = NEW_STMT1(OP(CHANGED), $lv.bf); }
+
+ | 'changed#to' lv=lvalue
+ { $ac = NEW_STMT1(OP(CHANGED_TO), $lv.bf); }
+ ;
+
+op_activity
+returns [ sep::Operator * op ]
+ : 'init' { $op = OP(INIT); }
+ | 'final' { $op = OP(FINAL); }
+ | 'destroy' { $op = OP(DESTROY); }
+ | 'start' { $op = OP(START); }
+ | 'restart' { $op = OP(RESTART); }
+ | 'stop' { $op = OP(STOP); }
+ | 'ienable' { $op = OP(IENABLE_INVOKE); }
+ | 'enable' { $op = OP(ENABLE_INVOKE); }
+ | 'idisable' { $op = OP(IDISABLE_INVOKE); }
+ | 'disable' { $op = OP(DISABLE_INVOKE); }
+ | 'iabort' { $op = OP(IABORT_INVOKE); }
+ | 'abort' { $op = OP(ABORT_INVOKE); }
+ | 'run' { $op = OP(RUN); }
+ | 'rtc' { $op = OP(RTC); }
+ | 'schedule' { $op = OP(SCHEDULE_INVOKE); }
+ | 'suspend' { $op = OP(SUSPEND); }
+ | 'resume' { $op = OP(RESUME); }
+ | 'wait' { $op = OP(WAIT); }
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// STATEMENT ACTIVITY
+////////////////////////////////////////////////////////////////////////////////
+
+statement_activity
+returns [ sep::BFCode ac ]
+@init{
+ sep::BF flowTarget;
+ sep::BF machine;
+}
+ : o=op_activity { $ac = NEW_STMT($o.op); }
+ ( id=qualifiedNameID
+ { $ac->append(machine =
+ sep::ParserUtil::getvarMachine($id.s, $id.nb)); }
+ )?
+
+ activity_machine_param_return[ machine , ac ] ?
+ SEMI
+ /*
+ | 'wait' expression SEMI
+ { $ac = NEW_STMT(OP(WAIT)); }
+ */
+
+ | 'goto' id=qualifiedNameID
+ { $ac = NEW_STMT1(OP(GOTO),
+ flowTarget = sep::ParserUtil::getvarMachine($id.s, $id.nb)); }
+ ( fs=statement_init_flow[flowTarget] { $ac->append($fs.ac); }
+ | SEMI
+ )
+
+ | 'join' e=expression SEMI
+ { $ac = NEW_STMT1(OP(JOIN), $e.bf); }
+
+ ;
+
+
+statement_init_flow [ const sep::BF & flowTarget ]
+returns [ sep::BFCode ac ]
+@init{
+ if( flowTarget.is< sep::Machine >() )
+ {
+ PUSH_CTX_CPM( flowTarget.to_ptr< sep::Machine >() );
+ }
+}
+@after{
+ if( flowTarget.is< sep::Machine >() )
+ {
+ POP_CTX;
+ }
+}
+ : 'flow' bs=block_statement { $ac = $bs.ac; }
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// STATEMENT ROUTINE INVOKATION
+////////////////////////////////////////////////////////////////////////////////
+
+statement_invoke_routine
+returns [ sep::BFCode ac ]
+@init{
+ sep::Routine * invokeRoutine = NULL;
+}
+ : id=ID
+ {
+ invokeRoutine = sep::Routine::newInvoke( _CPRMS_, STR($id.text->chars));
+
+ invokeRoutine->setModel(
+ sep::ParserUtil::getvarRoutine(STR($id.text->chars)) );
+ }
+
+ invoke_routine_params[ invokeRoutine ]
+ ( invoke_routine_returns[ invokeRoutine ] )?
+ SEMI
+
+ { $ac = sep::ParserUtil::invokeRoutineStatement(invokeRoutine); }
+ ;
+
+
+invoke_routine_params [ sep::Routine * invokeRoutine ]
+ : LPAREN
+ ( lp=labelled_argument
+ {
+ invokeRoutine->appendParameter($lp.label, $lp.arg);
+ }
+ ( COMMA
+ lp=labelled_argument
+ {
+ invokeRoutine->appendParameter($lp.label, $lp.arg);
+ }
+ )*
+ )?
+ RPAREN
+ ;
+
+
+invoke_routine_returns [ sep::Routine * invokeRoutine ]
+ : ( '-->' | 'returns:' )
+ ( LPAREN
+ lp=labelled_argument
+ {
+ invokeRoutine->appendReturn($lp.label, $lp.arg);
+ }
+ ( COMMA
+ lp=labelled_argument
+ {
+ invokeRoutine->appendReturn($lp.label, $lp.arg);
+ }
+ )*
+ RPAREN
+
+ | lp=labelled_argument
+ {
+ invokeRoutine->appendReturn($lp.label, $lp.arg);
+ }
+ )
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// STATEMENT LEM
+////////////////////////////////////////////////////////////////////////////////
+/*
+statement_lem
+returns [ sep::BFCode ac ]
+ : 'when' { $ac = NEW_STMT(OP(LEM_WHEN)); }
+ ( e=expression { $ac->append($e.bf); } )?
+ bs=block_statement { $ac->append($bs.ac); }
+ ( e=expression { $ac->append($e.bf); } )?
+ SEMI
+
+ | 'in' id=qualifiedNameID
+ { $ac = NEW_STMT1(OP(LEM_INPUT),
+ sep::ParserUtil::getvarPortSignal($id.s, $id.nb)); }
+ ( 'provided' e=expression { $ac->append($e.bf); } )?
+ SEMI
+
+ | id=qualifiedNameID LEM_TRANSFERT id2=qualifiedNameID SEMI
+ { $ac = NEW_STMT2(OP(LEM_OUTPUT),
+ sep::ParserUtil::getvarPortSignal($id.s, $id.nb),
+ sep::ParserUtil::getvarPortSignal($id2.s, $id2.nb)); }
+ ;
+
+expression_lem
+returns [ sep::BFCode ac ]
+ : 'touch' id=qualifiedNameID
+ { $ac = NEW_STMT1(OP(LEM_TOUCH),
+ sep::ParserUtil::getvarPortSignal($id.s, $id.nb)); }
+
+ | 'in' id=qualifiedNameID
+ { $ac = NEW_STMT1(OP(LEM_INPUT),
+ sep::ParserUtil::getvarPortSignal($id.s, $id.nb)); }
+ ( 'provided' e=expression { $ac->append($e.bf); } )?
+ ;
+*/
+
+////////////////////////////////////////////////////////////////////////////////
+// STATEMENT MOC
+////////////////////////////////////////////////////////////////////////////////
+
+statement_moc
+returns [ sep::BFCode ac ]
+ : 'step_mark' StringLiteral SEMI
+ {
+ $ac = NEW_STMT1(OP(STEP_MARK),
+ NEW_STRING(STR($StringLiteral.text->chars)));
+ }
+ ;
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// EXPRESSION
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+expression
+returns [ sep::BF bf ]
+ : e=conditionalExpression { $bf = $e.bf; }
+
+ ( ASSIGN e=expression
+ { $bf = NEW_CODE2(OP(ASSIGN), $bf, $e.bf); }
+
+ | ASSIGN_MACRO e=expression
+ { $bf = NEW_CODE2(OP(ASSIGN_MACRO), $bf, $e.bf); }
+
+ | ASSIGN_AFTER e=expression
+ { $bf = NEW_CODE2(OP(ASSIGN_AFTER), $bf, $e.bf); }
+
+ | PLUS_ASSIGN e=expression
+ { $bf = NEW_STMT_ASSIGN_OP(OP(PLUS), $bf, $e.bf); }
+
+ | PLUS_ASSIGN_AFTER e=expression
+ { $bf = NEW_STMT_ASSIGN_OP_AFTER(OP(PLUS), $bf, $e.bf); }
+
+ | MINUS_ASSIGN e=expression
+ { $bf = NEW_STMT_ASSIGN_OP(OP(MINUS), $bf, $e.bf); }
+
+ | MINUS_ASSIGN_AFTER e=expression
+ { $bf = NEW_STMT_ASSIGN_OP_AFTER(OP(MINUS), $bf, $e.bf); }
+
+ | STAR_ASSIGN e=expression
+ { $bf = NEW_STMT_ASSIGN_OP(OP(MULT), $bf, $e.bf); }
+
+ | STAR_ASSIGN_AFTER e=expression
+ { $bf = NEW_STMT_ASSIGN_OP_AFTER(OP(MULT), $bf, $e.bf); }
+
+ | DIV_ASSIGN e=expression
+ { $bf = NEW_STMT_ASSIGN_OP(OP(DIV), $bf, $e.bf); }
+
+ | DIV_ASSIGN_AFTER e=expression
+ { $bf = NEW_STMT_ASSIGN_OP_AFTER(OP(DIV), $bf, $e.bf); }
+
+ | MOD_ASSIGN e=expression
+ { $bf = NEW_STMT_ASSIGN_OP(OP(MOD), $bf, $e.bf); }
+
+ | MOD_ASSIGN_AFTER e=expression
+ { $bf = NEW_STMT_ASSIGN_OP_AFTER(OP(MOD), $bf, $e.bf); }
+
+ | LAND_ASSIGN e=expression
+ { $bf = NEW_STMT_ASSIGN_OP(OP(AND), $bf, $e.bf); }
+
+ | LAND_ASSIGN_AFTER e=expression
+ { $bf = NEW_STMT_ASSIGN_OP_AFTER(OP(AND), $bf, $e.bf); }
+
+ | LOR_ASSIGN e=expression
+ { $bf = NEW_STMT_ASSIGN_OP(OP(OR), $bf, $e.bf); }
+
+ | LOR_ASSIGN_AFTER e=expression
+ { $bf = NEW_STMT_ASSIGN_OP_AFTER(OP(OR), $bf, $e.bf); }
+
+ | BAND_ASSIGN e=expression
+ { $bf = NEW_STMT_ASSIGN_OP(OP(BAND), $bf, $e.bf); }
+
+ | BAND_ASSIGN_AFTER e=expression
+ { $bf = NEW_STMT_ASSIGN_OP_AFTER(OP(BAND), $bf, $e.bf); }
+
+ | BOR_ASSIGN e=expression
+ { $bf = NEW_STMT_ASSIGN_OP(OP(BOR), $bf, $e.bf); }
+
+ | BOR_ASSIGN_AFTER e=expression
+ { $bf = NEW_STMT_ASSIGN_OP_AFTER(OP(BOR), $bf, $e.bf); }
+
+ | BXOR_ASSIGN e=expression
+ { $bf = NEW_STMT_ASSIGN_OP(OP(BXOR), $bf, $e.bf); }
+
+ | BXOR_ASSIGN_AFTER e=expression
+ { $bf = NEW_STMT_ASSIGN_OP_AFTER(OP(BXOR), $bf, $e.bf); }
+
+ | LSHIFT_ASSIGN e=expression
+ { $bf = NEW_STMT_ASSIGN_OP(OP(LSHIFT), $bf, $e.bf); }
+
+ | LSHIFT_ASSIGN_AFTER e=expression
+ { $bf = NEW_STMT_ASSIGN_OP_AFTER(OP(LSHIFT), $bf, $e.bf); }
+
+ | RSHIFT_ASSIGN e=expression
+ { $bf = NEW_STMT_ASSIGN_OP(OP(RSHIFT), $bf, $e.bf); }
+
+ | RSHIFT_ASSIGN_AFTER e=expression
+ { $bf = NEW_STMT_ASSIGN_OP_AFTER(OP(RSHIFT), $bf, $e.bf); }
+
+ | OP_PUSH e=expression
+ { $bf = NEW_CODE2(OP(PUSH), $bf, $e.bf); }
+
+ | OP_ASSIGN_TOP e=expression
+ { $bf = NEW_CODE2(OP(ASSIGN_TOP), $bf, $e.bf); }
+
+ | OP_POP e=expression
+ { $bf = NEW_CODE2(OP(POP), $bf, $e.bf); }
+
+// | LEM_TRANSFERT e=expression
+// { $bf = NEW_CODE2(OP(LEM_OUTPUT), $bf, $e.bf); }
+ )?
+ ;
+
+
+conditionalExpression
+returns [ sep::BF bf ]
+ : e=scheduleExpression { $bf = $e.bf; }
+ ( QUESTION th=expression COLON el=expression
+ { $bf = NEW_CODE3(OP(IFE), $bf, $th.bf, $el.bf); }
+ )?
+ ;
+
+scheduleExpression
+returns [ sep::BF bf ]
+ : e=conditionalOrExpression { $bf = $e.bf; }
+ ( ( op=op_sequence | op=op_scheduling | op=op_concurrency )
+ e=conditionalOrExpression { $bf = NEW_CODE_FLAT(op, $bf, $e.bf); }
+ )*
+ ;
+
+conditionalOrExpression
+returns [ sep::BF bf ]
+ : e=conditionalAndExpression { $bf = $e.bf; }
+ ( LOR e=conditionalAndExpression
+ { $bf = NEW_CODE_FLAT(OP(OR), $bf, $e.bf); }
+ )*
+ ;
+
+conditionalAndExpression
+returns [ sep::BF bf ]
+ : e=bitwiseOrExpression { $bf = $e.bf; }
+ ( LAND e=bitwiseOrExpression
+ { $bf = NEW_CODE_FLAT(OP(AND), $bf, $e.bf); }
+ )*
+ ;
+
+bitwiseOrExpression
+returns [ sep::BF bf ]
+ : e=bitwiseXorExpression { $bf = $e.bf; }
+ ( BOR e=bitwiseXorExpression
+ { $bf = NEW_CODE_FLAT(OP(BOR), $bf, $e.bf); }
+ )*
+ ;
+
+bitwiseXorExpression
+returns [ sep::BF bf ]
+ : e=bitwiseAndExpression { $bf = $e.bf; }
+ ( BXOR e=bitwiseAndExpression
+ { $bf = NEW_CODE_FLAT(OP(BXOR), $bf, $e.bf); }
+ )*
+ ;
+
+bitwiseAndExpression
+returns [ sep::BF bf ]
+ : e=equalityExpression { $bf = $e.bf; }
+ ( BAND e=equalityExpression
+ { $bf = NEW_CODE_FLAT(OP(BAND), $bf, $e.bf); }
+ )*
+ ;
+
+equalityExpression
+returns [ sep::BF bf ]
+@init{
+ sep::BFCode eqExpr;
+ sep::BF rhs;
+}
+ : e=relationalExpression { $bf = $e.bf; }
+ ( op=equalOp e=relationalExpression
+ { eqExpr = NEW_CODE2(op, $bf, $e.bf); }
+ ( op=equalOp e=relationalExpression
+ {
+ /*if( eqExpr.getOperator() == op )
+ {
+ eqExpr.append( $e.bf );
+ }
+ else*/ if( eqExpr.getOperator() == OP(AND) )
+ {
+ eqExpr.append( NEW_CODE2(op, rhs, $e.bf) );
+ }
+ else
+ {
+ eqExpr = NEW_CODE2(OP(AND), eqExpr, NEW_CODE2(op, rhs, $e.bf));
+ }
+
+ rhs = $e.bf;
+ }
+ )*
+ { $bf = eqExpr; }
+ )?
+ ;
+
+equalOp
+returns [ sep::Operator * op ]
+ : EQUAL { op = OP(EQ); }
+ | NEQUAL { op = OP(NEQ); }
+ | SEQUAL { op = OP(SEQ); }
+ | NSEQUAL { op = OP(NSEQ); }
+ ;
+
+
+relationalExpression
+returns [ sep::BF bf ]
+@init{
+ sep::BFCode relExpr;
+ sep::BF rhs;
+}
+ : e=shiftExpression { $bf = $e.bf; }
+ ( op=relationalOp e=shiftExpression
+ { relExpr = NEW_CODE2(op, $bf, rhs = $e.bf); }
+ ( op=relationalOp e=shiftExpression
+ {
+ /*if( relExpr.getOperator() == op )
+ {
+ relExpr.append( $e.bf );
+ }
+ else*/ if( relExpr.getOperator() == OP(AND) )
+ {
+ relExpr.append( NEW_CODE2(op, rhs, $e.bf) );
+ }
+ else
+ {
+ relExpr = NEW_CODE2(OP(AND), relExpr, NEW_CODE2(op, rhs, $e.bf));
+ }
+
+ rhs = $e.bf;
+ }
+ )*
+ { $bf = relExpr; }
+ )?
+ ;
+
+relationalOp
+returns [ sep::Operator * op ]
+ : LTE { $op = OP(LTE); }
+ | GTE { $op = OP(GTE); }
+ | LT_ { $op = OP(LT); }
+ | GT { $op = OP(GT); }
+
+ | 'in' { $op = OP(IN); }
+// | 'notin' { $op = OP(NOTIN); }
+// | 'contains' { $op = OP(CONTAINS); }
+//
+// | 'subset' { $op = OP(SUBSET); }
+//
+// | 'starts_with' { $op = OP(STARTS_WITH); }
+// | 'ends_with' { $op = OP(ENDS_WITH); }
+ ;
+
+shiftExpression
+returns [ sep::BF bf ]
+ : e=additiveExpression { $bf = $e.bf; }
+ ( op=shiftOp e=additiveExpression
+ { $bf = NEW_CODE2(op, $bf, $e.bf); }
+ )*
+ ;
+
+
+shiftOp
+returns [ sep::Operator * op ]
+ : LSHIFT { $op = OP(LSHIFT); }
+ | RSHIFT { $op = OP(RSHIFT); }
+ ;
+
+
+additiveExpression
+returns [ sep::BF bf ]
+@init{
+ sep::Operator * op = NULL;
+}
+ : e=multiplicativeExpression { $bf = $e.bf; }
+ ( ( PLUS { op = OP(PLUS); }
+ | MINUS { op = OP(MINUS); }
+ )
+ e=multiplicativeExpression
+ { $bf = NEW_CODE_FLAT(op, $bf, $e.bf); }
+ )*
+ ;
+
+multiplicativeExpression
+returns [ sep::BF bf ]
+@init{
+ sep::Operator * op = NULL;
+}
+ : e=unaryExpression { $bf = $e.bf; }
+ ( ( STAR { op = OP(MULT); }
+ | DIV { op = OP(DIV); }
+ | MOD { op = OP(MOD); }
+ )
+ e=unaryExpression
+ { $bf = NEW_CODE_FLAT(op, $bf, $e.bf); }
+ )*
+ ;
+
+/**
+ * NOTE: for '+' and '-', if the next token is int or long interal, then it's not a unary expression.
+ * it's a literal with signed value. INTLTERAL AND LONG LITERAL are added here for this.
+ */
+unaryExpression
+returns [ sep::BF bf ]
+ : PLUS e=unaryExpression
+ { $bf = $e.bf; }
+
+ | MINUS e=unaryExpression
+ { $bf = new_uminus_expr($e.bf); }
+
+ | INCR e=unaryExpression
+ { $bf = NEW_STMT_ASSIGN_OP(OP(PLUS),
+ $e.bf, sep::ExpressionConstant::INTEGER_ONE); }
+ | DECR e=unaryExpression
+ { $bf = NEW_STMT_ASSIGN_OP(OP(PLUS), $e.bf,
+ sep::ExpressionConstant::INTEGER_MINUS_ONE); }
+
+ | LNOT e=unaryExpression
+ { $bf = new_not_expr($e.bf); }
+
+ | BNOT e=unaryExpression
+ { $bf = NEW_CODE1(OP(BNOT), $e.bf); }
+
+ | OP_POP e=unaryExpression
+ { $bf = NEW_CODE1(OP(POP), $e.bf); }
+
+ | OP_TOP e=unaryExpression
+ { $bf = NEW_CODE1(OP(TOP), $e.bf); }
+
+// | 'newfresh' e=unaryExpression
+// { $bf = NEW_CODE1(OP(ASSIGN_NEWFRESH), $e.bf); }
+
+
+ | c=prefix_expression { $bf = $c.ac; }
+
+ | c=expression_invoke { $bf = $c.ac; }
+
+ | c=expression_activity_new { $bf = $c.ac; }
+
+// | c=expression_buffer { $bf = $c.ac; }
+ | c=expression_com { $bf = $c.ac; }
+ | c=expression_guard { $bf = $c.ac; }
+ | c=expression_ite { $bf = $c.ac; }
+ | c=expression_lambda { $bf = $c.ac; }
+// | c=expression_status { $bf = $c.ac; }
+// | c=expression_time { $bf = $c.ac; }
+
+// | c=expression_lem { $bf = $c.ac; }
+
+ | e=ctorExpression { $bf = $e.bf; }
+
+ | e=primary { $bf = $e.bf; }
+ ( INCR
+ { $bf = NEW_STMT_ASSIGN_OP_AFTER(OP(PLUS), $e.bf,
+ sep::ExpressionConstant::INTEGER_ONE); }
+ | DECR
+ { $bf = NEW_STMT_ASSIGN_OP_AFTER(OP(PLUS), $e.bf,
+ sep::ExpressionConstant::INTEGER_MINUS_ONE); }
+ )?
+
+ | l=literal { $bf = $l.bf; }
+
+ | q=quote_expression { $bf = $q.ac; }
+
+ | q=meta_eval_expression { $bf = $q.ac; }
+
+ | LPAREN e=expression RPAREN { $bf = $e.bf; }
+
+ | e=collection_of_expression { $bf = $e.bf; }
+ ;
+
+
+ctorExpression
+returns [ sep::BFCode ctor ]
+ : 'ctor' LT_ tv=type_var GT LPAREN e=expression RPAREN
+ { $ctor = NEW_CODE2(OP(CTOR), $tv.type, $e.bf); }
+ ;
+
+
+/*
+quote_expression
+returns [ sep::BFCode ac ]
+@init{
+ sep::Operator * op = OP(SEQUENCE);
+}
+ : PERCENT_LCURLY ( o=op_block { op = $o.op; } ) ? { $ac = NEW_STMT(op); }
+ ( s=statement { $ac->append($s.ac); } )*
+ ( e=expression { $ac->append($e.bf); } )
+ RCURLY_PERCENT
+ { $ac = NEW_STMT1(OP(QUOTE), $ac); }
+ ;
+*/
+
+
+quote_expression
+returns [ sep::BFCode ac ]
+ : PERCENT_LCURLY e=expression RCURLY_PERCENT
+ { $ac = NEW_STMT1(OP(QUOTE), $e.bf); }
+ ;
+
+meta_eval_expression
+returns [ sep::BFCode ac ]
+ : LBRACKET_BAR e=expression BAR_RBRACKET
+ { $ac = NEW_STMT1(OP(META_EVAL), $e.bf); }
+ ;
+
+
+
+/**
+ * have to use scope here, parameter passing isn't well supported in antlr.
+ *
+primary
+returns [ sep::BF bf ]
+@init{
+ sep::UniFormIdentifier * ufi;
+ sep::BF bfUfi;// for automatic destruction of << UFI >> if need
+
+ sep::avm_size_t countID = 1;
+ bool isnotEXPR = true;
+ bool hasntPARAM = true;
+
+ SAVE_RULE_BEGIN_LOCATION;
+}
+ : //( ( id=ID { ufi->setLocator(STR($id.text->chars)); } )?
+ // COLONx2 { ufi->setAbsolute(); } )?
+ id=ID
+ {
+ ufi = new sep::UniFormIdentifier(false);
+ bfUfi = ufi;
+
+ if( ($bf = sep::ParserUtil::getObjectByNameID(STR($id.text->chars))).valid() )
+ {
+ ufi->appendField($bf);
+ }
+ else
+ {
+ ufi->appendField(STR($id.text->chars));
+ }
+
+ $bf = bfUfi;
+ }
+
+ ( ( DOT id=ID
+ { ufi->appendField(STR($id.text->chars)); ++countID; } )
+
+ | ( LBRACKET e=expression RBRACKET
+ { ufi->appendIndex($e.bf); isnotEXPR = false; }
+ )
+
+ | LPAREN { ufi->last().addScheme(sep::UFI_SCHEME_INVOKABLE); }
+ ( e=expression { ufi->appendFieldParameter($e.bf); hasntPARAM = false; }
+ ( COMMA
+ e=expression { ufi->appendFieldParameter($e.bf); hasntPARAM = false; }
+ )*
+ )?
+ RPAREN
+ )*
+ {
+ if( countID == 1 )
+ {
+ $bf = ufi->first();
+ }
+ else if( isnotEXPR && hasntPARAM )
+ {
+ if( ($bf = sep::ParserUtil::getvar(
+ ufi->str(), countID)).invalid() )
+ {
+ $bf = bfUfi;
+ SET_RULE_LOCATION(ufi);
+ }
+ }
+ else if( ufi->singleton() )
+ {
+ $bf = ufi->first();
+ }
+ }
+ ;
+*/
+
+
+primary
+returns [ sep::BF bf ]
+ : id=ID
+ ( ( LPAREN ) => p=primary_invoke[ STR($id.text->chars) ]
+ { $bf = $p.bf; }
+
+ | ( DOT | LBRACKET ) => p=primary_ufid[ STR($id.text->chars) ]
+ { $bf = $p.bf; }
+ | ( COLONx2 ) => p=primary_ufi[ STR($id.text->chars) ]
+ { $bf = $p.bf; }
+ )?
+ {
+ if( $bf.invalid() )
+ {
+ if( ($bf = sep::ParserUtil::getObjectByNameID(
+ STR($id.text->chars))).invalid() )
+ {
+ $bf = NEW_ID( STR($id.text->chars));
+ }
+ }
+ }
+
+ | p=primary_ufi[ "" ] { $bf = $p.bf; }
+ ;
+
+
+primary_ufid [ const std::string & mainId ]
+returns [ sep::BF bf ]
+@init{
+ sep::UniFormIdentifier * ufi = new sep::UniFormIdentifier(false);
+ sep::BF bfUfi( ufi );// for automatic destruction of << UFI >> if need
+
+ if( ($bf = sep::ParserUtil::getObjectByNameID(mainId)).valid() )
+ {
+ ufi->appendField( $bf );
+ }
+ else
+ {
+ ufi->appendField( mainId );
+ }
+
+ $bf = bfUfi;
+
+ sep::avm_size_t countID = 1;
+ bool isnotEXPR = true;
+
+ SAVE_RULE_BEGIN_LOCATION;
+}
+ : ( ( DOT id=ID
+ { ufi->appendField( STR($id.text->chars) ); ++countID; } )
+
+ | ( LBRACKET e=expression RBRACKET
+ { ufi->appendIndex( $e.bf ); isnotEXPR = false; }
+ )
+ )+
+ {
+ if( isnotEXPR )
+ {
+ if( ($bf = sep::ParserUtil::getvar(ufi->str(), countID)).invalid() )
+ {
+ $bf = bfUfi;
+ SET_RULE_LOCATION( ufi );
+ }
+ }
+ }
+ ;
+
+
+
+primary_ufi [ const std::string & locatorId ]
+returns [ sep::BF bf ]
+@init{
+ sep::UniFormIdentifier * ufi =
+ new sep::UniFormIdentifier(not locatorId.empty());
+ sep::BF bfUfi( ufi );// for automatic destruction of << UFI >> if need
+
+ if( not locatorId.empty() )
+ {
+ ufi->setLocator( locatorId );
+ }
+
+ $bf = bfUfi;
+
+ sep::avm_size_t countID = 1;
+ bool isnotEXPR = true;
+
+ SAVE_RULE_BEGIN_LOCATION;
+}
+ : COLONx2 id=ID
+ {
+ if( ($bf = sep::ParserUtil::getObjectByNameID(STR($id.text->chars))).valid() )
+ {
+ ufi->appendField( $bf );
+ }
+ else
+ {
+ ufi->appendField( STR($id.text->chars) );
+ }
+ }
+
+ ( ( DOT id=ID
+ { ufi->appendField( STR($id.text->chars) ); ++countID; } )
+
+ | ( LBRACKET e=expression RBRACKET
+ { ufi->appendIndex( $e.bf ); isnotEXPR = false; }
+ )
+ )+
+ {
+ if( isnotEXPR )
+ {
+ if( ($bf = sep::ParserUtil::getvar(ufi->str(), countID)).invalid() )
+ {
+ $bf = bfUfi;
+ SET_RULE_LOCATION( ufi );
+ }
+ }
+ }
+ ;
+
+
+primary_invoke [ const std::string & mainId ]
+returns [ sep::BF bf ]
+@init{
+ sep::Routine * invokeRoutine = sep::Routine::newInvoke( _CPRMS_, mainId);
+
+ invokeRoutine->setModel( sep::ParserUtil::getvarRoutine(mainId) );
+
+ SAVE_RULE_BEGIN_LOCATION;
+}
+@after
+{
+ SET_RULE_LOCATION( invokeRoutine );
+}
+ : LPAREN
+ ( lp=labelled_argument
+ {
+ invokeRoutine->appendParameter($lp.label, $lp.arg);
+ }
+ ( COMMA
+ lp=labelled_argument
+ {
+ invokeRoutine->appendParameter($lp.label, $lp.arg);
+ }
+ )*
+ )?
+ RPAREN
+
+ { $bf = sep::ParserUtil::invokeRoutineExpression(invokeRoutine); }
+ ;
+
+
+literal
+returns [ sep::BF bf ]
+ : IntegerLiteral { $bf = NEW_INTEGER(STR($IntegerLiteral.text->chars)); }
+ | RationalLiteral { $bf = NEW_RATIONAL(STR($RationalLiteral.text->chars)); }
+ | FloatLiteral { $bf = NEW_FLOAT(STR($FloatLiteral.text->chars)); }
+
+ | CharLiteral { $bf = NEW_CHAR(STR($CharLiteral.text->chars)); }
+ | StringLiteral { $bf = NEW_STRING(STR($StringLiteral.text->chars)); }
+
+ | 'true' { $bf = NEW_BOOL(true); }
+ | 'false' { $bf = NEW_BOOL(false); }
+
+ | 'self' { $bf = sep::ExecutableLib::MACHINE_SELF; }
+ | 'parent' { $bf = sep::ExecutableLib::MACHINE_PARENT; }
+ | 'env' { $bf = sep::ExecutableLib::MACHINE_ENVIRONMENT; }
+
+ | '$this' { $bf = sep::ExecutableLib::MACHINE_SELF; }
+ | '$self' { $bf = sep::ExecutableLib::MACHINE_SELF; }
+ | '$parent' { $bf = sep::ExecutableLib::MACHINE_PARENT; }
+ | '$super' { $bf = sep::ExecutableLib::MACHINE_PARENT; }
+ | '$env' { $bf = sep::ExecutableLib::MACHINE_ENVIRONMENT; }
+
+ | 'null<'
+ ( 'machine' { $bf = sep::ExecutableLib::MACHINE_NULL; }
+ | 'channel' { $bf = sep::ExecutableLib::CHANNEL_NIL; }
+ | 'port' { $bf = sep::ExecutableLib::PORT_NIL; }
+ | 'signal' { $bf = sep::ExecutableLib::PORT_NIL; }
+ | 'message' { $bf = sep::ExecutableLib::PORT_NIL; }
+ | 'buffer' { $bf = sep::ExecutableLib::BUFFER_NIL; }
+ ) GT
+ | 'null' { $bf = sep::BF::REF_NULL; }
+ ;
+
+
+
+collection_of_expression
+returns [ sep::BF bf ]
+@init{
+ sep::BFVector values;
+}
+ : LCURLY
+ e=expression { values.append($e.bf); }
+ ( COMMA e=expression { values.append($e.bf); } )*
+ RCURLY
+ { $bf = sep::BuiltinArray::create(values); }
+
+ | LBRACKET
+ e=expression { values.append($e.bf); }
+ ( COMMA e=expression { values.append($e.bf); } )*
+ RBRACKET
+ { $bf = sep::BuiltinArray::create(values); }
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// KEYWORD XLIA or XFSP
+////////////////////////////////////////////////////////////////////////////////
+/*
+kw_start : { IS_KEYWORD( "start" ) }? ID;
+
+kw_in : { IS_KEYWORD( "in" ) }? ID;
+
+kw_input : { IS_KEYWORD( "input" ) }? ID;
+kw_output : { IS_KEYWORD( "output" ) }? ID;
+
+kw_wait : { IS_KEYWORD( "wait" ) }? ID;
+*/
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// LEXER
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+OP_ATOMIC_SEQUENCE : '|§|' ;
+
+OP_SEQUENCE : '|;|' ;
+OP_SEQUENCE_SIDE : '|.|' | '|/;|' ;
+OP_SEQUENCE_WEAK : '|;;|' ;
+
+OP_SCHEDULE_GT : '|>|' ;
+OP_SCHEDULE_LT : '|<|' ;
+OP_SCHEDULE_XOR : '|xor|' ;
+
+OP_SCHEDULE_AND_THEN : '|and#then|' ;
+OP_SCHEDULE_OR_ELSE : '|or#else|' ;
+
+
+OP_NON_DETERMINISM : '|/\|' | '|indet|' ;
+
+OP_CONCURRENCY_ASYNC : '|a|' ;
+OP_CONCURRENCY_AND : '|and|' ;
+OP_CONCURRENCY_OR : '|or|' ;
+OP_CONCURRENCY_INTERLEAVING : '|i|' ;
+OP_CONCURRENCY_PARALLEL : '|,|' ;
+
+OP_FORK : '|fork|' ;
+OP_JOIN : '|join|' ;
+
+
+OP_CONCURRENCY_RDV_ASYNC : '||a||' ;
+OP_CONCURRENCY_RDV_AND : '||and||' ;
+OP_CONCURRENCY_RDV_OR : '||or||' ;
+OP_CONCURRENCY_RDV_INTERLEAVING : '||i||' ;
+OP_CONCURRENCY_RDV_PARALLEL : '||,||' ;
+
+//LEM_TRANSFERT : '->' ;
+
+ASSIGN : '=' | ':=' ;
+ASSIGN_AFTER : '=:' ;
+ASSIGN_REF : '<-' ;
+ASSIGN_MACRO : '::=' ;
+
+OP_PUSH : '<=<' ;
+OP_ASSIGN_TOP : '^=<' ;
+OP_TOP : '^=>' ;
+OP_POP : '>=>' ;
+
+LPAREN : '(' ;
+RPAREN : ')' ;
+LCURLY : '{' ;
+RCURLY : '}' ;
+LBRACKET : '[' ;
+RBRACKET : ']' ;
+
+LBRACKET_EXCEPT : '[^' ;
+
+LPAREN_INVOKE : '(:' ;
+LCURLY_INVOKE : '{:' ;
+
+PERCENT_LPAREN_INVOKE : '%(:' ;
+
+PERCENT_LPAREN : '%(' ;
+RPAREN_PERCENT : ')%' ;
+
+
+STATEMENT_PROMPT: ':>' ;
+
+DOLLAR_LCURLY : '${' ;
+RCURLY_DOLLAR : '}$' ;
+
+PERCENT_LCURLY : '%{' ;
+RCURLY_PERCENT : '}%' ;
+
+LBRACKET_BAR : '[|' ;
+BAR_RBRACKET : '|]' ;
+
+LBRACKET_LCURLY : '[{' ;
+RCURLY_RBRACKET : '}]' ;
+
+COLON : ':' ;
+COMMA : ',' ;
+QUESTION : '?' ;
+SEMI : ';' ;
+
+DIESE : '#' ;
+DOLLAR : '$' ;
+
+DOT : '.' ;
+DOTDOT : '..' ;
+COLONx2 : '::' ;
+
+
+LAND : '&&' | 'and' ;
+LAND_THEN : 'and#then' ;
+LAND_ASSIGN : '&&=' | '&&:=';
+LAND_ASSIGN_AFTER : '&&=:';
+
+LNOT : '!' | 'not' ;
+
+LOR : '||' | 'or' ;
+LOR_ELSE : 'or#else' ;
+LOR_ASSIGN : '||=' | '||:=';
+LOR_ASSIGN_AFTER : '||=:';
+LXOR : 'xor' ;
+
+EQUAL : '==' ;
+NEQUAL : '!=' ;
+
+SEQUAL : '===' ;
+NSEQUAL : '=!=' | '=/=' ;
+
+LTE : '<=' ;
+LT_ : '<' ;
+GTE : '>=' ;
+GT : '>' ;
+
+
+PLUS : '+' ;
+PLUS_ASSIGN : '+=' | '+:=' ;
+PLUS_ASSIGN_AFTER : '+=:' ;
+INCR : '++' ;
+
+MINUS : '-' ;
+MINUS_ASSIGN : '-=' | '-:=' ;
+MINUS_ASSIGN_AFTER : '-=:' ;
+DECR : '--' ;
+
+STAR : '*' ;
+STAR_ASSIGN : '*=' | '*:=' ;
+STAR_ASSIGN_AFTER : '*=:' ;
+DIV : '/' ;
+DIV_ASSIGN : '/=' | '/:=' ;
+DIV_ASSIGN_AFTER : '/=:' ;
+MOD : '%' ;
+MOD_ASSIGN : '%=' | '%:=' ;
+MOD_ASSIGN_AFTER : '%=:' ;
+
+//POW : "**" ;
+
+RSHIFT : '>>' ;
+RSHIFT_ASSIGN : '>>=' | '>>:=';
+RSHIFT_ASSIGN_AFTER : '>>=:';
+LSHIFT : '<<' ;
+LSHIFT_ASSIGN : '<<=' | '<<:=';
+LSHIFT_ASSIGN_AFTER : '<<=:';
+
+BAND : '&' ;
+BAND_ASSIGN : '&=' | '&:=' ;
+BAND_ASSIGN_AFTER : '&=:' ;
+BNOT : '~' ;
+BOR : '|' ;
+BOR_ASSIGN : '|=' | '|:=' ;
+BOR_ASSIGN_AFTER : '|=:' ;
+BXOR : '^' ;
+BXOR_ASSIGN : '^=' | '^:=' ;
+BXOR_ASSIGN_AFTER : '^=:' ;
+
+
+
+ID
+ : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_'|'#')*
+ ;
+
+
+AT_ID
+ @init{
+ ANTLR3_MARKER theStart = $start;
+ //sep::AVM_OS_DEBUG << "AT_ID:> start = " << theStart;
+ }
+ : '@'
+ {
+ theStart = GETCHARINDEX();
+ //sep::AVM_OS_DEBUG << " GETCHARINDEX() = " << theStart << std::endl;
+ }
+ ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_'|'#'|'$')*
+ { $start = theStart; EMIT(); }
+ ;
+
+
+StringLiteral
+ @init{
+ ANTLR3_MARKER theStart = $start;
+ }
+ : '"'
+ { theStart = GETCHARINDEX(); }
+ ( ESC_SEQ | ~('\\'|'"') )*
+ { $start = theStart; EMIT(); }
+ '"'
+ ;
+
+CharLiteral
+ @init{
+ ANTLR3_MARKER theStart = $start;
+ }
+ : '\''
+ { theStart = GETCHARINDEX(); }
+ ( ESC_SEQ | ~('\''|'\\') )
+ { $start = theStart; EMIT(); }
+ '\''
+ ;
+
+
+NumberLiteral
+ : ( IntegerLiteral DOTDOT ) => IntegerLiteral { $type=IntegerLiteral; }
+// | ( RationalLiteral ) => RationalLiteral { $type=RationalLiteral; }
+ | ( FloatLiteral ) => FloatLiteral { $type=FloatLiteral; }
+ | IntegerLiteral { $type=IntegerLiteral; }
+ ;
+
+// fragments
+fragment FloatLiteral : Float ImaginarySuffix?;
+
+fragment RationalLiteral : IntegerLiteral DIV Integer;
+
+fragment IntegerLiteral : Integer IntSuffix?;
+
+fragment FloatTypeSuffix : 'f' | 'F' | 'L';
+fragment ImaginarySuffix : 'i';
+fragment IntSuffix : 'L'|'u'|'U'|'Lu'|'LU'|'uL'|'UL' ;
+
+fragment Integer : Decimal | Binary | Octal | Hexadecimal ;
+fragment Decimal : '0' | '1'..'9' (DecimalDigit | '_')* ;
+
+fragment Binary : ('0b' | '0B') ('0' | '1' | '_')+ ;
+fragment Octal : '0' (OctalDigit | '_')+ ;
+fragment Hexadecimal : ('0x' | '0X') (HexDigit | '_')+;
+
+fragment DecimalDigit : '0'..'9' ;
+fragment OctalDigit : '0'..'7' ;
+fragment HexDigit : ('0'..'9'|'a'..'f'|'A'..'F') ;
+
+fragment DecimalExponent : 'e' | 'E' | 'e+' | 'E+' | 'e-' | 'E-' DecimalDigits;
+fragment DecimalDigits : ( '0'..'9' | '_')+ ;
+
+fragment
+Float
+ : d=DecimalDigits
+ ( options {greedy = true; } : FloatTypeSuffix
+ | '.' DecimalDigits DecimalExponent?
+ )
+ | '.' DecimalDigits DecimalExponent?
+ ;
+
+
+
+fragment
+EXPONENT
+ : ('e'|'E') ('+'|'-')? ('0'..'9')+
+ ;
+
+fragment
+HEX_DIGIT
+ : ('0'..'9' | 'a'..'f' | 'A'..'F')
+ ;
+
+fragment
+ESC_SEQ
+ : '\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\')
+ | UNICODE_ESC
+ | OCTAL_ESC
+ ;
+
+fragment
+OCTAL_ESC
+ : '\\' ('0'..'3') ('0'..'7') ('0'..'7')
+ | '\\' ('0'..'7') ('0'..'7')
+ | '\\' ('0'..'7')
+ ;
+
+fragment
+UNICODE_ESC
+ : '\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT
+ ;
+
+
+COMMENT
+ : '//' ~('\n'|'\r')* '\r'? '\n' {$channel=HIDDEN;}
+ | '/*' ( options {greedy=false;} : . )* '*/' {$channel=HIDDEN;}
+ ;
+
+WS
+ : ( ' ' | '\t' | '\r' | '\n' ) {$channel=HIDDEN;}
+ ;
+
+
diff --git a/org.eclipse.efm.symbex/src/parser/model/fml.tokens b/org.eclipse.efm.symbex/src/parser/model/fml.tokens
new file mode 100644
index 0000000..8f28005
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/parser/model/fml.tokens
@@ -0,0 +1,691 @@
+T__144=144
+T__145=145
+T__146=146
+T__147=147
+T__148=148
+T__149=149
+T__150=150
+T__151=151
+T__152=152
+T__153=153
+T__154=154
+T__155=155
+T__156=156
+T__157=157
+T__158=158
+T__159=159
+T__160=160
+T__161=161
+T__162=162
+T__163=163
+T__164=164
+T__165=165
+T__166=166
+T__167=167
+T__168=168
+T__169=169
+T__170=170
+T__171=171
+T__172=172
+T__173=173
+T__174=174
+T__175=175
+T__176=176
+T__177=177
+T__178=178
+T__179=179
+T__180=180
+T__181=181
+T__182=182
+T__183=183
+T__184=184
+T__185=185
+T__186=186
+T__187=187
+T__188=188
+T__189=189
+T__190=190
+T__191=191
+T__192=192
+T__193=193
+T__194=194
+T__195=195
+T__196=196
+T__197=197
+T__198=198
+T__199=199
+T__200=200
+T__201=201
+T__202=202
+T__203=203
+T__204=204
+T__205=205
+T__206=206
+T__207=207
+T__208=208
+T__209=209
+T__210=210
+T__211=211
+T__212=212
+T__213=213
+T__214=214
+T__215=215
+T__216=216
+T__217=217
+T__218=218
+T__219=219
+T__220=220
+T__221=221
+T__222=222
+T__223=223
+T__224=224
+T__225=225
+T__226=226
+T__227=227
+T__228=228
+T__229=229
+T__230=230
+T__231=231
+T__232=232
+T__233=233
+T__234=234
+T__235=235
+T__236=236
+T__237=237
+T__238=238
+T__239=239
+T__240=240
+T__241=241
+T__242=242
+T__243=243
+T__244=244
+T__245=245
+T__246=246
+T__247=247
+T__248=248
+T__249=249
+T__250=250
+T__251=251
+T__252=252
+T__253=253
+T__254=254
+T__255=255
+T__256=256
+T__257=257
+T__258=258
+T__259=259
+T__260=260
+T__261=261
+T__262=262
+T__263=263
+T__264=264
+T__265=265
+T__266=266
+T__267=267
+T__268=268
+T__269=269
+T__270=270
+T__271=271
+T__272=272
+T__273=273
+T__274=274
+T__275=275
+T__276=276
+T__277=277
+T__278=278
+T__279=279
+T__280=280
+T__281=281
+T__282=282
+T__283=283
+T__284=284
+T__285=285
+T__286=286
+T__287=287
+T__288=288
+T__289=289
+T__290=290
+T__291=291
+T__292=292
+T__293=293
+T__294=294
+T__295=295
+T__296=296
+T__297=297
+T__298=298
+T__299=299
+T__300=300
+T__301=301
+T__302=302
+T__303=303
+T__304=304
+T__305=305
+T__306=306
+T__307=307
+T__308=308
+T__309=309
+T__310=310
+T__311=311
+T__312=312
+T__313=313
+T__314=314
+T__315=315
+T__316=316
+T__317=317
+T__318=318
+T__319=319
+T__320=320
+T__321=321
+T__322=322
+T__323=323
+T__324=324
+T__325=325
+T__326=326
+T__327=327
+T__328=328
+T__329=329
+T__330=330
+T__331=331
+T__332=332
+T__333=333
+T__334=334
+T__335=335
+T__336=336
+T__337=337
+T__338=338
+T__339=339
+T__340=340
+T__341=341
+T__342=342
+T__343=343
+T__344=344
+T__345=345
+T__346=346
+T__347=347
+T__348=348
+T__349=349
+T__350=350
+T__351=351
+T__352=352
+T__353=353
+T__354=354
+T__355=355
+T__356=356
+T__357=357
+T__358=358
+T__359=359
+T__360=360
+T__361=361
+T__362=362
+T__363=363
+T__364=364
+T__365=365
+T__366=366
+T__367=367
+T__368=368
+T__369=369
+T__370=370
+T__371=371
+T__372=372
+T__373=373
+T__374=374
+T__375=375
+T__376=376
+T__377=377
+T__378=378
+T__379=379
+T__380=380
+T__381=381
+T__382=382
+T__383=383
+T__384=384
+T__385=385
+T__386=386
+T__387=387
+T__388=388
+T__389=389
+T__390=390
+T__391=391
+T__392=392
+T__393=393
+T__394=394
+T__395=395
+T__396=396
+T__397=397
+T__398=398
+T__399=399
+T__400=400
+T__401=401
+T__402=402
+T__403=403
+T__404=404
+T__405=405
+T__406=406
+T__407=407
+T__408=408
+T__409=409
+T__410=410
+T__411=411
+T__412=412
+T__413=413
+T__414=414
+T__415=415
+T__416=416
+T__417=417
+ASSIGN=4
+ASSIGN_AFTER=5
+ASSIGN_MACRO=6
+ASSIGN_REF=7
+AT_ID=8
+BAND=9
+BAND_ASSIGN=10
+BAND_ASSIGN_AFTER=11
+BAR_RBRACKET=12
+BNOT=13
+BOR=14
+BOR_ASSIGN=15
+BOR_ASSIGN_AFTER=16
+BXOR=17
+BXOR_ASSIGN=18
+BXOR_ASSIGN_AFTER=19
+Binary=20
+COLON=21
+COLONx2=22
+COMMA=23
+COMMENT=24
+CharLiteral=25
+DECR=26
+DIESE=27
+DIV=28
+DIV_ASSIGN=29
+DIV_ASSIGN_AFTER=30
+DOLLAR=31
+DOLLAR_LCURLY=32
+DOT=33
+DOTDOT=34
+Decimal=35
+DecimalDigit=36
+DecimalDigits=37
+DecimalExponent=38
+EQUAL=39
+ESC_SEQ=40
+EXPONENT=41
+Float=42
+FloatLiteral=43
+FloatTypeSuffix=44
+GT=45
+GTE=46
+HEX_DIGIT=47
+HexDigit=48
+Hexadecimal=49
+ID=50
+INCR=51
+ImaginarySuffix=52
+IntSuffix=53
+Integer=54
+IntegerLiteral=55
+LAND=56
+LAND_ASSIGN=57
+LAND_ASSIGN_AFTER=58
+LAND_THEN=59
+LBRACKET=60
+LBRACKET_BAR=61
+LBRACKET_EXCEPT=62
+LBRACKET_LCURLY=63
+LCURLY=64
+LCURLY_INVOKE=65
+LNOT=66
+LOR=67
+LOR_ASSIGN=68
+LOR_ASSIGN_AFTER=69
+LOR_ELSE=70
+LPAREN=71
+LPAREN_INVOKE=72
+LSHIFT=73
+LSHIFT_ASSIGN=74
+LSHIFT_ASSIGN_AFTER=75
+LTE=76
+LT_=77
+LXOR=78
+MINUS=79
+MINUS_ASSIGN=80
+MINUS_ASSIGN_AFTER=81
+MOD=82
+MOD_ASSIGN=83
+MOD_ASSIGN_AFTER=84
+NEQUAL=85
+NSEQUAL=86
+NumberLiteral=87
+OCTAL_ESC=88
+OP_ASSIGN_TOP=89
+OP_ATOMIC_SEQUENCE=90
+OP_CONCURRENCY_AND=91
+OP_CONCURRENCY_ASYNC=92
+OP_CONCURRENCY_INTERLEAVING=93
+OP_CONCURRENCY_OR=94
+OP_CONCURRENCY_PARALLEL=95
+OP_CONCURRENCY_RDV_AND=96
+OP_CONCURRENCY_RDV_ASYNC=97
+OP_CONCURRENCY_RDV_INTERLEAVING=98
+OP_CONCURRENCY_RDV_OR=99
+OP_CONCURRENCY_RDV_PARALLEL=100
+OP_FORK=101
+OP_JOIN=102
+OP_NON_DETERMINISM=103
+OP_POP=104
+OP_PUSH=105
+OP_SCHEDULE_AND_THEN=106
+OP_SCHEDULE_GT=107
+OP_SCHEDULE_LT=108
+OP_SCHEDULE_OR_ELSE=109
+OP_SCHEDULE_XOR=110
+OP_SEQUENCE=111
+OP_SEQUENCE_SIDE=112
+OP_SEQUENCE_WEAK=113
+OP_TOP=114
+Octal=115
+OctalDigit=116
+PERCENT_LCURLY=117
+PERCENT_LPAREN=118
+PERCENT_LPAREN_INVOKE=119
+PLUS=120
+PLUS_ASSIGN=121
+PLUS_ASSIGN_AFTER=122
+QUESTION=123
+RBRACKET=124
+RCURLY=125
+RCURLY_DOLLAR=126
+RCURLY_PERCENT=127
+RCURLY_RBRACKET=128
+RPAREN=129
+RPAREN_PERCENT=130
+RSHIFT=131
+RSHIFT_ASSIGN=132
+RSHIFT_ASSIGN_AFTER=133
+RationalLiteral=134
+SEMI=135
+SEQUAL=136
+STAR=137
+STAR_ASSIGN=138
+STAR_ASSIGN_AFTER=139
+STATEMENT_PROMPT=140
+StringLiteral=141
+UNICODE_ESC=142
+WS=143
+'#dhistory'=144
+'#final'=145
+'#init'=146
+'#initial'=147
+'#return'=148
+'#shistory'=149
+'#start'=150
+'#stf'=151
+'#sts'=152
+'#terminal'=153
+'$:comment'=154
+'$:debug'=155
+'$:informal'=156
+'$:trace'=157
+'$env'=158
+'$parent'=159
+'$self'=160
+'$super'=161
+'$this'=162
+'&'=9
+'-->'=163
+'->'=164
+'<-'=7
+'<--'=165
+'<->'=166
+'<='=76
+'<=='=167
+'==>'=168
+'@'=169
+'@abort'=170
+'@behavior:'=171
+'@com:'=172
+'@composite'=173
+'@composite:'=174
+'@concurrency'=175
+'@constraint'=176
+'@create'=177
+'@declaration:'=178
+'@disable'=179
+'@diversity'=180
+'@effect:'=181
+'@enable'=182
+'@executable:'=183
+'@final'=184
+'@fml'=185
+'@formalml'=186
+'@guard:'=187
+'@header:'=188
+'@iabort'=189
+'@idisable'=190
+'@ienable'=191
+'@import:'=192
+'@include'=193
+'@init'=194
+'@inout:'=195
+'@input:'=196
+'@instance:'=197
+'@interaction:'=198
+'@irun'=199
+'@machine:'=200
+'@macro:'=201
+'@moc:'=202
+'@model:'=203
+'@moe:'=204
+'@on_write'=205
+'@options'=206
+'@output:'=207
+'@package'=208
+'@param:'=209
+'@parameter:'=210
+'@private:'=211
+'@procedure:'=212
+'@property:'=213
+'@protected:'=214
+'@prototype:'=215
+'@public:'=216
+'@region:'=217
+'@return'=218
+'@return:'=219
+'@returns:'=220
+'@routine'=221
+'@routine:'=222
+'@rtc'=223
+'@run'=224
+'@schedule'=225
+'@start'=226
+'@statemachine:'=227
+'@stop'=228
+'@system'=229
+'@tguard:'=230
+'@transition:'=231
+'@trigger:'=232
+'@xfml'=233
+'@xfsp'=234
+'@xlia'=235
+'abort'=236
+'absent'=237
+'activity:'=238
+'and'=239
+'anycast'=240
+'array'=241
+'avmcode'=242
+'bind'=243
+'bind:'=244
+'bool'=245
+'boolean'=246
+'break'=247
+'broadcast'=248
+'buffer'=249
+'call'=250
+'changed#to'=251
+'changed'=252
+'channel'=253
+'char'=254
+'character'=255
+'checksat'=256
+'choice'=257
+'class'=258
+'clock'=259
+'connect'=260
+'connector'=261
+'const'=262
+'continue'=263
+'ctime'=264
+'ctor'=265
+'ctx:'=266
+'destroy'=267
+'disable'=268
+'do'=269
+'double'=270
+'dtime'=271
+'dynamic'=272
+'else'=273
+'elseif'=274
+'enable'=275
+'enum'=276
+'env'=277
+'event'=278
+'exit'=279
+'false'=280
+'fifo'=281
+'final'=282
+'float'=283
+'flow'=284
+'for'=285
+'fork'=286
+'from:'=287
+'fun'=288
+'goto'=289
+'guard'=290
+'iabort'=291
+'idisable'=292
+'ienable'=293
+'if'=294
+'in'=295
+'init'=296
+'init:'=297
+'inout'=298
+'input#buffer'=299
+'input#env'=300
+'input#flow'=301
+'input#rdv'=302
+'input#save'=303
+'input#var'=304
+'input'=305
+'input_enabled'=306
+'instance'=307
+'instance:'=308
+'int'=309
+'integer'=310
+'interval'=311
+'join'=312
+'lambda'=313
+'lifeline'=314
+'lifo'=315
+'list'=316
+'machine'=317
+'macro'=318
+'max:'=319
+'message'=320
+'moc:'=321
+'model'=322
+'model:'=323
+'multicast'=324
+'multififo'=325
+'multilifo'=326
+'multiplicity:'=327
+'multirdv'=328
+'multiset'=329
+'new'=330
+'null'=331
+'null<'=332
+'operator'=333
+'or'=334
+'out'=335
+'output#buffer'=336
+'output#env'=337
+'output#flow'=338
+'output#rdv'=339
+'output#var'=340
+'output'=341
+'package'=342
+'parent'=343
+'port'=344
+'pos_int'=345
+'pos_integer'=346
+'present'=347
+'prior:'=348
+'private'=349
+'proba:'=350
+'procedure'=351
+'protected'=352
+'prototype'=353
+'provided:'=354
+'public'=355
+'ram'=356
+'rat'=357
+'rational'=358
+'rdv'=359
+'real'=360
+'ref'=361
+'restart'=362
+'resume'=363
+'return'=364
+'returns:'=365
+'route'=366
+'routine'=367
+'rtc'=368
+'run'=369
+'rvector'=370
+'schedule'=371
+'self'=372
+'set'=373
+'signal'=374
+'size:'=375
+'solver:'=376
+'start'=377
+'state'=378
+'statemachine'=379
+'static'=380
+'status#being'=381
+'status#is'=382
+'status#was'=383
+'status#will'=384
+'step_mark'=385
+'stop'=386
+'string'=387
+'struct'=388
+'suspend'=389
+'system'=390
+'tguard'=391
+'time'=392
+'timed'=393
+'to:'=394
+'transient'=395
+'transition'=396
+'true'=397
+'type'=398
+'udouble'=399
+'ufloat'=400
+'uint'=401
+'uinteger'=402
+'unicast'=403
+'union'=404
+'universal'=405
+'unsafe'=406
+'urat'=407
+'urational'=408
+'ureal'=409
+'val'=410
+'var'=411
+'vector'=412
+'via'=413
+'volatile'=414
+'wait'=415
+'while'=416
+'|=>'=417
diff --git a/org.eclipse.efm.symbex/src/parser/model/fmlLexer.c b/org.eclipse.efm.symbex/src/parser/model/fmlLexer.c
new file mode 100644
index 0000000..199708d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/parser/model/fmlLexer.c
@@ -0,0 +1,39414 @@
+/** \file
+ * This C source file was generated by $ANTLR version 3.4
+ *
+ * - From the grammar source file : /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g
+ * - On : 2017-05-30 09:21:53
+ * - for the lexer : fmlLexerLexer
+ *
+ * Editing it, at least manually, is not wise.
+ *
+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
+ *
+ *
+*/
+// [The "BSD license"]
+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
+// http://www.temporal-wave.com
+// http://www.linkedin.com/in/jimidle
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. The name of the author may not be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+/* =============================================================================
+ * This is what the grammar programmer asked us to put at the top of every file.
+ */
+
+
+
+/* End of Header action.
+ * =============================================================================
+ */
+
+/* -----------------------------------------
+ * Include the ANTLR3 generated header file.
+ */
+#include "fmlLexer.h"
+/* ----------------------------------------- */
+
+
+/** String literals used by fmlLexer that we must do things like MATCHS() with.
+ * C will normally just lay down 8 bit characters, and you can use L"xxx" to
+ * get wchar_t, but wchar_t is 16 bits on Windows, which is not UTF32 and so
+ * we perform this little trick of defining the literals as arrays of UINT32
+ * and passing in the address of these.
+ */
+static ANTLR3_UCHAR lit_1[] = { 0x23, 0x64, 0x68, 0x69, 0x73, 0x74, 0x6F, 0x72, 0x79, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_2[] = { 0x23, 0x66, 0x69, 0x6E, 0x61, 0x6C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_3[] = { 0x23, 0x69, 0x6E, 0x69, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_4[] = { 0x23, 0x69, 0x6E, 0x69, 0x74, 0x69, 0x61, 0x6C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_5[] = { 0x23, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6E, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_6[] = { 0x23, 0x73, 0x68, 0x69, 0x73, 0x74, 0x6F, 0x72, 0x79, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_7[] = { 0x23, 0x73, 0x74, 0x61, 0x72, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_8[] = { 0x23, 0x73, 0x74, 0x66, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_9[] = { 0x23, 0x73, 0x74, 0x73, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_10[] = { 0x23, 0x74, 0x65, 0x72, 0x6D, 0x69, 0x6E, 0x61, 0x6C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_11[] = { 0x24, 0x3A, 0x63, 0x6F, 0x6D, 0x6D, 0x65, 0x6E, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_12[] = { 0x24, 0x3A, 0x64, 0x65, 0x62, 0x75, 0x67, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_13[] = { 0x24, 0x3A, 0x69, 0x6E, 0x66, 0x6F, 0x72, 0x6D, 0x61, 0x6C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_14[] = { 0x24, 0x3A, 0x74, 0x72, 0x61, 0x63, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_15[] = { 0x24, 0x65, 0x6E, 0x76, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_16[] = { 0x24, 0x70, 0x61, 0x72, 0x65, 0x6E, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_17[] = { 0x24, 0x73, 0x65, 0x6C, 0x66, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_18[] = { 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_19[] = { 0x24, 0x74, 0x68, 0x69, 0x73, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_20[] = { 0x2D, 0x2D, 0x3E, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_21[] = { 0x2D, 0x3E, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_22[] = { 0x3C, 0x2D, 0x2D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_23[] = { 0x3C, 0x2D, 0x3E, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_24[] = { 0x3C, 0x3D, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_25[] = { 0x3D, 0x3D, 0x3E, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_26[] = { 0x40, 0x61, 0x62, 0x6F, 0x72, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_27[] = { 0x40, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6F, 0x72, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_28[] = { 0x40, 0x63, 0x6F, 0x6D, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_29[] = { 0x40, 0x63, 0x6F, 0x6D, 0x70, 0x6F, 0x73, 0x69, 0x74, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_30[] = { 0x40, 0x63, 0x6F, 0x6D, 0x70, 0x6F, 0x73, 0x69, 0x74, 0x65, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_31[] = { 0x40, 0x63, 0x6F, 0x6E, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6E, 0x63, 0x79, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_32[] = { 0x40, 0x63, 0x6F, 0x6E, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6E, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_33[] = { 0x40, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_34[] = { 0x40, 0x64, 0x65, 0x63, 0x6C, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_35[] = { 0x40, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6C, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_36[] = { 0x40, 0x64, 0x69, 0x76, 0x65, 0x72, 0x73, 0x69, 0x74, 0x79, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_37[] = { 0x40, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_38[] = { 0x40, 0x65, 0x6E, 0x61, 0x62, 0x6C, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_39[] = { 0x40, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x61, 0x62, 0x6C, 0x65, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_40[] = { 0x40, 0x66, 0x69, 0x6E, 0x61, 0x6C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_41[] = { 0x40, 0x66, 0x6D, 0x6C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_42[] = { 0x40, 0x66, 0x6F, 0x72, 0x6D, 0x61, 0x6C, 0x6D, 0x6C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_43[] = { 0x40, 0x67, 0x75, 0x61, 0x72, 0x64, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_44[] = { 0x40, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_45[] = { 0x40, 0x69, 0x61, 0x62, 0x6F, 0x72, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_46[] = { 0x40, 0x69, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6C, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_47[] = { 0x40, 0x69, 0x65, 0x6E, 0x61, 0x62, 0x6C, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_48[] = { 0x40, 0x69, 0x6D, 0x70, 0x6F, 0x72, 0x74, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_49[] = { 0x40, 0x69, 0x6E, 0x63, 0x6C, 0x75, 0x64, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_50[] = { 0x40, 0x69, 0x6E, 0x69, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_51[] = { 0x40, 0x69, 0x6E, 0x6F, 0x75, 0x74, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_52[] = { 0x40, 0x69, 0x6E, 0x70, 0x75, 0x74, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_53[] = { 0x40, 0x69, 0x6E, 0x73, 0x74, 0x61, 0x6E, 0x63, 0x65, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_54[] = { 0x40, 0x69, 0x6E, 0x74, 0x65, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_55[] = { 0x40, 0x69, 0x72, 0x75, 0x6E, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_56[] = { 0x40, 0x6D, 0x61, 0x63, 0x68, 0x69, 0x6E, 0x65, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_57[] = { 0x40, 0x6D, 0x61, 0x63, 0x72, 0x6F, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_58[] = { 0x40, 0x6D, 0x6F, 0x63, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_59[] = { 0x40, 0x6D, 0x6F, 0x64, 0x65, 0x6C, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_60[] = { 0x40, 0x6D, 0x6F, 0x65, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_61[] = { 0x40, 0x6F, 0x6E, 0x5F, 0x77, 0x72, 0x69, 0x74, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_62[] = { 0x40, 0x6F, 0x70, 0x74, 0x69, 0x6F, 0x6E, 0x73, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_63[] = { 0x40, 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_64[] = { 0x40, 0x70, 0x61, 0x63, 0x6B, 0x61, 0x67, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_65[] = { 0x40, 0x70, 0x61, 0x72, 0x61, 0x6D, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_66[] = { 0x40, 0x70, 0x61, 0x72, 0x61, 0x6D, 0x65, 0x74, 0x65, 0x72, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_67[] = { 0x40, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_68[] = { 0x40, 0x70, 0x72, 0x6F, 0x63, 0x65, 0x64, 0x75, 0x72, 0x65, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_69[] = { 0x40, 0x70, 0x72, 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_70[] = { 0x40, 0x70, 0x72, 0x6F, 0x74, 0x65, 0x63, 0x74, 0x65, 0x64, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_71[] = { 0x40, 0x70, 0x72, 0x6F, 0x74, 0x6F, 0x74, 0x79, 0x70, 0x65, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_72[] = { 0x40, 0x70, 0x75, 0x62, 0x6C, 0x69, 0x63, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_73[] = { 0x40, 0x72, 0x65, 0x67, 0x69, 0x6F, 0x6E, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_74[] = { 0x40, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6E, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_75[] = { 0x40, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6E, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_76[] = { 0x40, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6E, 0x73, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_77[] = { 0x40, 0x72, 0x6F, 0x75, 0x74, 0x69, 0x6E, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_78[] = { 0x40, 0x72, 0x6F, 0x75, 0x74, 0x69, 0x6E, 0x65, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_79[] = { 0x40, 0x72, 0x74, 0x63, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_80[] = { 0x40, 0x72, 0x75, 0x6E, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_81[] = { 0x40, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6C, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_82[] = { 0x40, 0x73, 0x74, 0x61, 0x72, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_83[] = { 0x40, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6D, 0x61, 0x63, 0x68, 0x69, 0x6E, 0x65, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_84[] = { 0x40, 0x73, 0x74, 0x6F, 0x70, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_85[] = { 0x40, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_86[] = { 0x40, 0x74, 0x67, 0x75, 0x61, 0x72, 0x64, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_87[] = { 0x40, 0x74, 0x72, 0x61, 0x6E, 0x73, 0x69, 0x74, 0x69, 0x6F, 0x6E, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_88[] = { 0x40, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_89[] = { 0x40, 0x78, 0x66, 0x6D, 0x6C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_90[] = { 0x40, 0x78, 0x66, 0x73, 0x70, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_91[] = { 0x40, 0x78, 0x6C, 0x69, 0x61, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_92[] = { 0x61, 0x62, 0x6F, 0x72, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_93[] = { 0x61, 0x62, 0x73, 0x65, 0x6E, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_94[] = { 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_95[] = { 0x61, 0x6E, 0x64, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_96[] = { 0x61, 0x6E, 0x79, 0x63, 0x61, 0x73, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_97[] = { 0x61, 0x72, 0x72, 0x61, 0x79, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_98[] = { 0x61, 0x76, 0x6D, 0x63, 0x6F, 0x64, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_99[] = { 0x62, 0x69, 0x6E, 0x64, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_100[] = { 0x62, 0x69, 0x6E, 0x64, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_101[] = { 0x62, 0x6F, 0x6F, 0x6C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_102[] = { 0x62, 0x6F, 0x6F, 0x6C, 0x65, 0x61, 0x6E, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_103[] = { 0x62, 0x72, 0x65, 0x61, 0x6B, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_104[] = { 0x62, 0x72, 0x6F, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_105[] = { 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_106[] = { 0x63, 0x61, 0x6C, 0x6C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_107[] = { 0x63, 0x68, 0x61, 0x6E, 0x67, 0x65, 0x64, 0x23, 0x74, 0x6F, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_108[] = { 0x63, 0x68, 0x61, 0x6E, 0x67, 0x65, 0x64, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_109[] = { 0x63, 0x68, 0x61, 0x6E, 0x6E, 0x65, 0x6C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_110[] = { 0x63, 0x68, 0x61, 0x72, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_111[] = { 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_112[] = { 0x63, 0x68, 0x65, 0x63, 0x6B, 0x73, 0x61, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_113[] = { 0x63, 0x68, 0x6F, 0x69, 0x63, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_114[] = { 0x63, 0x6C, 0x61, 0x73, 0x73, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_115[] = { 0x63, 0x6C, 0x6F, 0x63, 0x6B, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_116[] = { 0x63, 0x6F, 0x6E, 0x6E, 0x65, 0x63, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_117[] = { 0x63, 0x6F, 0x6E, 0x6E, 0x65, 0x63, 0x74, 0x6F, 0x72, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_118[] = { 0x63, 0x6F, 0x6E, 0x73, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_119[] = { 0x63, 0x6F, 0x6E, 0x74, 0x69, 0x6E, 0x75, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_120[] = { 0x63, 0x74, 0x69, 0x6D, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_121[] = { 0x63, 0x74, 0x6F, 0x72, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_122[] = { 0x63, 0x74, 0x78, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_123[] = { 0x64, 0x65, 0x73, 0x74, 0x72, 0x6F, 0x79, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_124[] = { 0x64, 0x69, 0x73, 0x61, 0x62, 0x6C, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_125[] = { 0x64, 0x6F, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_126[] = { 0x64, 0x6F, 0x75, 0x62, 0x6C, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_127[] = { 0x64, 0x74, 0x69, 0x6D, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_128[] = { 0x64, 0x79, 0x6E, 0x61, 0x6D, 0x69, 0x63, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_129[] = { 0x65, 0x6C, 0x73, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_130[] = { 0x65, 0x6C, 0x73, 0x65, 0x69, 0x66, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_131[] = { 0x65, 0x6E, 0x61, 0x62, 0x6C, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_132[] = { 0x65, 0x6E, 0x75, 0x6D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_133[] = { 0x65, 0x6E, 0x76, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_134[] = { 0x65, 0x76, 0x65, 0x6E, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_135[] = { 0x65, 0x78, 0x69, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_136[] = { 0x66, 0x61, 0x6C, 0x73, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_137[] = { 0x66, 0x69, 0x66, 0x6F, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_138[] = { 0x66, 0x69, 0x6E, 0x61, 0x6C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_139[] = { 0x66, 0x6C, 0x6F, 0x61, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_140[] = { 0x66, 0x6C, 0x6F, 0x77, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_141[] = { 0x66, 0x6F, 0x72, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_142[] = { 0x66, 0x6F, 0x72, 0x6B, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_143[] = { 0x66, 0x72, 0x6F, 0x6D, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_144[] = { 0x66, 0x75, 0x6E, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_145[] = { 0x67, 0x6F, 0x74, 0x6F, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_146[] = { 0x67, 0x75, 0x61, 0x72, 0x64, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_147[] = { 0x69, 0x61, 0x62, 0x6F, 0x72, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_148[] = { 0x69, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6C, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_149[] = { 0x69, 0x65, 0x6E, 0x61, 0x62, 0x6C, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_150[] = { 0x69, 0x66, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_151[] = { 0x69, 0x6E, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_152[] = { 0x69, 0x6E, 0x69, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_153[] = { 0x69, 0x6E, 0x69, 0x74, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_154[] = { 0x69, 0x6E, 0x6F, 0x75, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_155[] = { 0x69, 0x6E, 0x70, 0x75, 0x74, 0x23, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_156[] = { 0x69, 0x6E, 0x70, 0x75, 0x74, 0x23, 0x65, 0x6E, 0x76, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_157[] = { 0x69, 0x6E, 0x70, 0x75, 0x74, 0x23, 0x66, 0x6C, 0x6F, 0x77, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_158[] = { 0x69, 0x6E, 0x70, 0x75, 0x74, 0x23, 0x72, 0x64, 0x76, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_159[] = { 0x69, 0x6E, 0x70, 0x75, 0x74, 0x23, 0x73, 0x61, 0x76, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_160[] = { 0x69, 0x6E, 0x70, 0x75, 0x74, 0x23, 0x76, 0x61, 0x72, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_161[] = { 0x69, 0x6E, 0x70, 0x75, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_162[] = { 0x69, 0x6E, 0x70, 0x75, 0x74, 0x5F, 0x65, 0x6E, 0x61, 0x62, 0x6C, 0x65, 0x64, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_163[] = { 0x69, 0x6E, 0x73, 0x74, 0x61, 0x6E, 0x63, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_164[] = { 0x69, 0x6E, 0x73, 0x74, 0x61, 0x6E, 0x63, 0x65, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_165[] = { 0x69, 0x6E, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_166[] = { 0x69, 0x6E, 0x74, 0x65, 0x67, 0x65, 0x72, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_167[] = { 0x69, 0x6E, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_168[] = { 0x6A, 0x6F, 0x69, 0x6E, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_169[] = { 0x6C, 0x61, 0x6D, 0x62, 0x64, 0x61, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_170[] = { 0x6C, 0x69, 0x66, 0x65, 0x6C, 0x69, 0x6E, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_171[] = { 0x6C, 0x69, 0x66, 0x6F, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_172[] = { 0x6C, 0x69, 0x73, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_173[] = { 0x6D, 0x61, 0x63, 0x68, 0x69, 0x6E, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_174[] = { 0x6D, 0x61, 0x63, 0x72, 0x6F, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_175[] = { 0x6D, 0x61, 0x78, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_176[] = { 0x6D, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_177[] = { 0x6D, 0x6F, 0x63, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_178[] = { 0x6D, 0x6F, 0x64, 0x65, 0x6C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_179[] = { 0x6D, 0x6F, 0x64, 0x65, 0x6C, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_180[] = { 0x6D, 0x75, 0x6C, 0x74, 0x69, 0x63, 0x61, 0x73, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_181[] = { 0x6D, 0x75, 0x6C, 0x74, 0x69, 0x66, 0x69, 0x66, 0x6F, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_182[] = { 0x6D, 0x75, 0x6C, 0x74, 0x69, 0x6C, 0x69, 0x66, 0x6F, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_183[] = { 0x6D, 0x75, 0x6C, 0x74, 0x69, 0x70, 0x6C, 0x69, 0x63, 0x69, 0x74, 0x79, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_184[] = { 0x6D, 0x75, 0x6C, 0x74, 0x69, 0x72, 0x64, 0x76, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_185[] = { 0x6D, 0x75, 0x6C, 0x74, 0x69, 0x73, 0x65, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_186[] = { 0x6E, 0x65, 0x77, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_187[] = { 0x6E, 0x75, 0x6C, 0x6C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_188[] = { 0x6E, 0x75, 0x6C, 0x6C, 0x3C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_189[] = { 0x6F, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6F, 0x72, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_190[] = { 0x6F, 0x72, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_191[] = { 0x6F, 0x75, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_192[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x23, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_193[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x23, 0x65, 0x6E, 0x76, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_194[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x23, 0x66, 0x6C, 0x6F, 0x77, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_195[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x23, 0x72, 0x64, 0x76, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_196[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x23, 0x76, 0x61, 0x72, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_197[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_198[] = { 0x70, 0x61, 0x63, 0x6B, 0x61, 0x67, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_199[] = { 0x70, 0x61, 0x72, 0x65, 0x6E, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_200[] = { 0x70, 0x6F, 0x72, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_201[] = { 0x70, 0x6F, 0x73, 0x5F, 0x69, 0x6E, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_202[] = { 0x70, 0x6F, 0x73, 0x5F, 0x69, 0x6E, 0x74, 0x65, 0x67, 0x65, 0x72, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_203[] = { 0x70, 0x72, 0x65, 0x73, 0x65, 0x6E, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_204[] = { 0x70, 0x72, 0x69, 0x6F, 0x72, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_205[] = { 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_206[] = { 0x70, 0x72, 0x6F, 0x62, 0x61, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_207[] = { 0x70, 0x72, 0x6F, 0x63, 0x65, 0x64, 0x75, 0x72, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_208[] = { 0x70, 0x72, 0x6F, 0x74, 0x65, 0x63, 0x74, 0x65, 0x64, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_209[] = { 0x70, 0x72, 0x6F, 0x74, 0x6F, 0x74, 0x79, 0x70, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_210[] = { 0x70, 0x72, 0x6F, 0x76, 0x69, 0x64, 0x65, 0x64, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_211[] = { 0x70, 0x75, 0x62, 0x6C, 0x69, 0x63, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_212[] = { 0x72, 0x61, 0x6D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_213[] = { 0x72, 0x61, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_214[] = { 0x72, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x61, 0x6C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_215[] = { 0x72, 0x64, 0x76, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_216[] = { 0x72, 0x65, 0x61, 0x6C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_217[] = { 0x72, 0x65, 0x66, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_218[] = { 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_219[] = { 0x72, 0x65, 0x73, 0x75, 0x6D, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_220[] = { 0x72, 0x65, 0x74, 0x75, 0x72, 0x6E, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_221[] = { 0x72, 0x65, 0x74, 0x75, 0x72, 0x6E, 0x73, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_222[] = { 0x72, 0x6F, 0x75, 0x74, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_223[] = { 0x72, 0x6F, 0x75, 0x74, 0x69, 0x6E, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_224[] = { 0x72, 0x74, 0x63, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_225[] = { 0x72, 0x75, 0x6E, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_226[] = { 0x72, 0x76, 0x65, 0x63, 0x74, 0x6F, 0x72, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_227[] = { 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6C, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_228[] = { 0x73, 0x65, 0x6C, 0x66, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_229[] = { 0x73, 0x65, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_230[] = { 0x73, 0x69, 0x67, 0x6E, 0x61, 0x6C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_231[] = { 0x73, 0x69, 0x7A, 0x65, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_232[] = { 0x73, 0x6F, 0x6C, 0x76, 0x65, 0x72, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_233[] = { 0x73, 0x74, 0x61, 0x72, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_234[] = { 0x73, 0x74, 0x61, 0x74, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_235[] = { 0x73, 0x74, 0x61, 0x74, 0x65, 0x6D, 0x61, 0x63, 0x68, 0x69, 0x6E, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_236[] = { 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_237[] = { 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x23, 0x62, 0x65, 0x69, 0x6E, 0x67, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_238[] = { 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x23, 0x69, 0x73, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_239[] = { 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x23, 0x77, 0x61, 0x73, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_240[] = { 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x23, 0x77, 0x69, 0x6C, 0x6C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_241[] = { 0x73, 0x74, 0x65, 0x70, 0x5F, 0x6D, 0x61, 0x72, 0x6B, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_242[] = { 0x73, 0x74, 0x6F, 0x70, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_243[] = { 0x73, 0x74, 0x72, 0x69, 0x6E, 0x67, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_244[] = { 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_245[] = { 0x73, 0x75, 0x73, 0x70, 0x65, 0x6E, 0x64, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_246[] = { 0x73, 0x79, 0x73, 0x74, 0x65, 0x6D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_247[] = { 0x74, 0x67, 0x75, 0x61, 0x72, 0x64, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_248[] = { 0x74, 0x69, 0x6D, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_249[] = { 0x74, 0x69, 0x6D, 0x65, 0x64, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_250[] = { 0x74, 0x6F, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_251[] = { 0x74, 0x72, 0x61, 0x6E, 0x73, 0x69, 0x65, 0x6E, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_252[] = { 0x74, 0x72, 0x61, 0x6E, 0x73, 0x69, 0x74, 0x69, 0x6F, 0x6E, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_253[] = { 0x74, 0x72, 0x75, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_254[] = { 0x74, 0x79, 0x70, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_255[] = { 0x75, 0x64, 0x6F, 0x75, 0x62, 0x6C, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_256[] = { 0x75, 0x66, 0x6C, 0x6F, 0x61, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_257[] = { 0x75, 0x69, 0x6E, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_258[] = { 0x75, 0x69, 0x6E, 0x74, 0x65, 0x67, 0x65, 0x72, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_259[] = { 0x75, 0x6E, 0x69, 0x63, 0x61, 0x73, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_260[] = { 0x75, 0x6E, 0x69, 0x6F, 0x6E, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_261[] = { 0x75, 0x6E, 0x69, 0x76, 0x65, 0x72, 0x73, 0x61, 0x6C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_262[] = { 0x75, 0x6E, 0x73, 0x61, 0x66, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_263[] = { 0x75, 0x72, 0x61, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_264[] = { 0x75, 0x72, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x61, 0x6C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_265[] = { 0x75, 0x72, 0x65, 0x61, 0x6C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_266[] = { 0x76, 0x61, 0x6C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_267[] = { 0x76, 0x61, 0x72, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_268[] = { 0x76, 0x65, 0x63, 0x74, 0x6F, 0x72, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_269[] = { 0x76, 0x69, 0x61, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_270[] = { 0x76, 0x6F, 0x6C, 0x61, 0x74, 0x69, 0x6C, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_271[] = { 0x77, 0x61, 0x69, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_272[] = { 0x77, 0x68, 0x69, 0x6C, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_273[] = { 0x7C, 0x3D, 0x3E, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_274[] = { 0x7C, 0xA7, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_275[] = { 0x7C, 0x3B, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_276[] = { 0x7C, 0x2E, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_277[] = { 0x7C, 0x2F, 0x3B, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_278[] = { 0x7C, 0x3B, 0x3B, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_279[] = { 0x7C, 0x3E, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_280[] = { 0x7C, 0x3C, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_281[] = { 0x7C, 0x78, 0x6F, 0x72, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_282[] = { 0x7C, 0x61, 0x6E, 0x64, 0x23, 0x74, 0x68, 0x65, 0x6E, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_283[] = { 0x7C, 0x6F, 0x72, 0x23, 0x65, 0x6C, 0x73, 0x65, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_284[] = { 0x7C, 0x2F, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_285[] = { 0x7C, 0x69, 0x6E, 0x64, 0x65, 0x74, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_286[] = { 0x7C, 0x61, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_287[] = { 0x7C, 0x61, 0x6E, 0x64, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_288[] = { 0x7C, 0x6F, 0x72, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_289[] = { 0x7C, 0x69, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_290[] = { 0x7C, 0x2C, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_291[] = { 0x7C, 0x66, 0x6F, 0x72, 0x6B, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_292[] = { 0x7C, 0x6A, 0x6F, 0x69, 0x6E, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_293[] = { 0x7C, 0x7C, 0x61, 0x7C, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_294[] = { 0x7C, 0x7C, 0x61, 0x6E, 0x64, 0x7C, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_295[] = { 0x7C, 0x7C, 0x6F, 0x72, 0x7C, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_296[] = { 0x7C, 0x7C, 0x69, 0x7C, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_297[] = { 0x7C, 0x7C, 0x2C, 0x7C, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_298[] = { 0x3A, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_299[] = { 0x3D, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_300[] = { 0x3C, 0x2D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_301[] = { 0x3A, 0x3A, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_302[] = { 0x3C, 0x3D, 0x3C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_303[] = { 0x5E, 0x3D, 0x3C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_304[] = { 0x5E, 0x3D, 0x3E, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_305[] = { 0x3E, 0x3D, 0x3E, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_306[] = { 0x5B, 0x5E, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_307[] = { 0x28, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_308[] = { 0x7B, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_309[] = { 0x25, 0x28, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_310[] = { 0x25, 0x28, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_311[] = { 0x29, 0x25, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_312[] = { 0x3A, 0x3E, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_313[] = { 0x24, 0x7B, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_314[] = { 0x7D, 0x24, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_315[] = { 0x25, 0x7B, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_316[] = { 0x7D, 0x25, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_317[] = { 0x5B, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_318[] = { 0x7C, 0x5D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_319[] = { 0x5B, 0x7B, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_320[] = { 0x7D, 0x5D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_321[] = { 0x2E, 0x2E, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_322[] = { 0x3A, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_323[] = { 0x26, 0x26, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_324[] = { 0x61, 0x6E, 0x64, 0x23, 0x74, 0x68, 0x65, 0x6E, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_325[] = { 0x26, 0x26, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_326[] = { 0x26, 0x26, 0x3A, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_327[] = { 0x26, 0x26, 0x3D, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_328[] = { 0x6E, 0x6F, 0x74, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_329[] = { 0x7C, 0x7C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_330[] = { 0x6F, 0x72, 0x23, 0x65, 0x6C, 0x73, 0x65, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_331[] = { 0x7C, 0x7C, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_332[] = { 0x7C, 0x7C, 0x3A, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_333[] = { 0x7C, 0x7C, 0x3D, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_334[] = { 0x78, 0x6F, 0x72, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_335[] = { 0x3D, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_336[] = { 0x21, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_337[] = { 0x3D, 0x3D, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_338[] = { 0x3D, 0x21, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_339[] = { 0x3D, 0x2F, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_340[] = { 0x3C, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_341[] = { 0x3E, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_342[] = { 0x2B, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_343[] = { 0x2B, 0x3A, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_344[] = { 0x2B, 0x3D, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_345[] = { 0x2B, 0x2B, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_346[] = { 0x2D, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_347[] = { 0x2D, 0x3A, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_348[] = { 0x2D, 0x3D, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_349[] = { 0x2D, 0x2D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_350[] = { 0x2A, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_351[] = { 0x2A, 0x3A, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_352[] = { 0x2A, 0x3D, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_353[] = { 0x2F, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_354[] = { 0x2F, 0x3A, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_355[] = { 0x2F, 0x3D, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_356[] = { 0x25, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_357[] = { 0x25, 0x3A, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_358[] = { 0x25, 0x3D, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_359[] = { 0x3E, 0x3E, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_360[] = { 0x3E, 0x3E, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_361[] = { 0x3E, 0x3E, 0x3A, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_362[] = { 0x3E, 0x3E, 0x3D, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_363[] = { 0x3C, 0x3C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_364[] = { 0x3C, 0x3C, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_365[] = { 0x3C, 0x3C, 0x3A, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_366[] = { 0x3C, 0x3C, 0x3D, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_367[] = { 0x26, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_368[] = { 0x26, 0x3A, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_369[] = { 0x26, 0x3D, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_370[] = { 0x7C, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_371[] = { 0x7C, 0x3A, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_372[] = { 0x7C, 0x3D, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_373[] = { 0x5E, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_374[] = { 0x5E, 0x3A, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_375[] = { 0x5E, 0x3D, 0x3A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_376[] = { 0x4C, 0x75, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_377[] = { 0x4C, 0x55, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_378[] = { 0x75, 0x4C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_379[] = { 0x55, 0x4C, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_380[] = { 0x30, 0x62, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_381[] = { 0x30, 0x42, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_382[] = { 0x30, 0x78, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_383[] = { 0x30, 0x58, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_384[] = { 0x65, 0x2B, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_385[] = { 0x45, 0x2B, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_386[] = { 0x65, 0x2D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_387[] = { 0x45, 0x2D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_388[] = { 0x2F, 0x2F, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_389[] = { 0x2F, 0x2A, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_390[] = { 0x2A, 0x2F, ANTLR3_STRING_TERMINATOR};
+
+
+
+
+
+/* MACROS that hide the C interface implementations from the
+ * generated code, which makes it a little more understandable to the human eye.
+ * I am very much against using C pre-processor macros for function calls and bits
+ * of code as you cannot see what is happening when single stepping in debuggers
+ * and so on. The exception (in my book at least) is for generated code, where you are
+ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
+ * hides some indirect calls, but is always referring to the input stream. This is
+ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
+ * the runtime interfaces without changing the generated code too often, without
+ * confusing the reader of the generated output, who may not wish to know the gory
+ * details of the interface inheritance.
+ */
+
+#define CTX ctx
+
+/* Aids in accessing scopes for grammar programmers
+ */
+#undef SCOPE_TYPE
+#undef SCOPE_STACK
+#undef SCOPE_TOP
+#define SCOPE_TYPE(scope) pfmlLexer_##scope##_SCOPE
+#define SCOPE_STACK(scope) pfmlLexer_##scope##Stack
+#define SCOPE_TOP(scope) ctx->pfmlLexer_##scope##Top
+#define SCOPE_SIZE(scope) ctx->pfmlLexer_##scope##Stack_limit
+#define SCOPE_INSTANCE(scope, i) (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
+
+
+/* Macros for accessing things in a lexer
+ */
+#undef LEXER
+#undef RECOGNIZER
+#undef RULEMEMO
+#undef GETCHARINDEX
+#undef GETLINE
+#undef GETCHARPOSITIONINLINE
+#undef EMIT
+#undef EMITNEW
+#undef MATCHC
+#undef MATCHS
+#undef MATCHRANGE
+#undef LTOKEN
+#undef HASFAILED
+#undef FAILEDFLAG
+#undef INPUT
+#undef STRSTREAM
+#undef LA
+#undef HASEXCEPTION
+#undef EXCEPTION
+#undef CONSTRUCTEX
+#undef CONSUME
+#undef LRECOVER
+#undef MARK
+#undef REWIND
+#undef REWINDLAST
+#undef BACKTRACKING
+#undef MATCHANY
+#undef MEMOIZE
+#undef HAVEPARSEDRULE
+#undef GETTEXT
+#undef INDEX
+#undef SEEK
+#undef PUSHSTREAM
+#undef POPSTREAM
+#undef SETTEXT
+#undef SETTEXT8
+
+#define LEXER ctx->pLexer
+#define RECOGNIZER LEXER->rec
+#define LEXSTATE RECOGNIZER->state
+#define TOKSOURCE LEXSTATE->tokSource
+#define GETCHARINDEX() LEXER->getCharIndex(LEXER)
+#define GETLINE() LEXER->getLine(LEXER)
+#define GETTEXT() LEXER->getText(LEXER)
+#define GETCHARPOSITIONINLINE() LEXER->getCharPositionInLine(LEXER)
+#define EMIT() LEXSTATE->type = _type; LEXER->emit(LEXER)
+#define EMITNEW(t) LEXER->emitNew(LEXER, t)
+#define MATCHC(c) LEXER->matchc(LEXER, c)
+#define MATCHS(s) LEXER->matchs(LEXER, s)
+#define MATCHRANGE(c1,c2) LEXER->matchRange(LEXER, c1, c2)
+#define MATCHANY() LEXER->matchAny(LEXER)
+#define LTOKEN LEXSTATE->token
+#define HASFAILED() (LEXSTATE->failed == ANTLR3_TRUE)
+#define BACKTRACKING LEXSTATE->backtracking
+#define FAILEDFLAG LEXSTATE->failed
+#define INPUT LEXER->input
+#define STRSTREAM INPUT
+#define ISTREAM INPUT->istream
+#define INDEX() ISTREAM->index(ISTREAM)
+#define SEEK(n) ISTREAM->seek(ISTREAM, n)
+#define EOF_TOKEN &(LEXSTATE->tokSource->eofToken)
+#define HASEXCEPTION() (LEXSTATE->error == ANTLR3_TRUE)
+#define EXCEPTION LEXSTATE->exception
+#define CONSTRUCTEX() RECOGNIZER->exConstruct(RECOGNIZER)
+#define LRECOVER() LEXER->recover(LEXER)
+#define MARK() ISTREAM->mark(ISTREAM)
+#define REWIND(m) ISTREAM->rewind(ISTREAM, m)
+#define REWINDLAST() ISTREAM->rewindLast(ISTREAM)
+#define MEMOIZE(ri,si) RECOGNIZER->memoize(RECOGNIZER, ri, si)
+#define HAVEPARSEDRULE(r) RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
+#define PUSHSTREAM(str) LEXER->pushCharStream(LEXER, str)
+#define POPSTREAM() LEXER->popCharStream(LEXER)
+#define SETTEXT(str) LEXSTATE->text = str
+#define SKIP() LEXSTATE->token = &(TOKSOURCE->skipToken)
+#define USER1 LEXSTATE->user1
+#define USER2 LEXSTATE->user2
+#define USER3 LEXSTATE->user3
+#define CUSTOM LEXSTATE->custom
+#define RULEMEMO LEXSTATE->ruleMemo
+#define DBG RECOGNIZER->debugger
+
+/* If we have been told we can rely on the standard 8 bit or UTF16 input
+ * stream, then we can define our macros to use the direct pointers
+ * in the input object, which is much faster than indirect calls. This
+ * is really only significant to lexers with a lot of fragment rules (which
+ * do not place LA(1) in a temporary at the moment) and even then
+ * only if there is a lot of input (order of say 1M or so).
+ */
+#if defined(ANTLR3_INLINE_INPUT_8BIT) || defined(ANTLR3_INLINE_INPUT_UTF16)
+
+# ifdef ANTLR3_INLINE_INPUT_8BIT
+
+/* 8 bit character set */
+
+# define NEXTCHAR ((pANTLR3_UINT8)(INPUT->nextChar))
+# define DATAP ((pANTLR3_UINT8)(INPUT->data))
+
+# else
+
+# define NEXTCHAR ((pANTLR3_UINT16)(INPUT->nextChar))
+# define DATAP ((pANTLR3_UINT16)(INPUT->data))
+
+# endif
+
+# define LA(n) ((NEXTCHAR + n) > (DATAP + INPUT->sizeBuf) ? ANTLR3_CHARSTREAM_EOF : (ANTLR3_UCHAR)(*(NEXTCHAR + n - 1)))
+# define CONSUME() \
+{ \
+ if (NEXTCHAR < (DATAP + INPUT->sizeBuf)) \
+ { \
+ INPUT->charPositionInLine++; \
+ if ((ANTLR3_UCHAR)(*NEXTCHAR) == INPUT->newlineChar) \
+ { \
+ INPUT->line++; \
+ INPUT->charPositionInLine = 0; \
+ INPUT->currentLine = (void *)(NEXTCHAR + 1); \
+ } \
+ INPUT->nextChar = (void *)(NEXTCHAR + 1); \
+ } \
+}
+
+#else
+
+// Pick up the input character by calling the input stream implementation.
+//
+#define CONSUME() INPUT->istream->consume(INPUT->istream)
+#define LA(n) INPUT->istream->_LA(INPUT->istream, n)
+
+#endif
+
+#define TOKTEXT(tok, txt) tok, (pANTLR3_UINT8)txt
+
+/* The 4 tokens defined below may well clash with your own #defines or token types. If so
+ * then for the present you must use different names for your defines as these are hard coded
+ * in the code generator. It would be better not to use such names internally, and maybe
+ * we can change this in a forthcoming release. I deliberately do not #undef these
+ * here as this will at least give you a redefined error somewhere if they clash.
+ */
+#define UP ANTLR3_TOKEN_UP
+#define DOWN ANTLR3_TOKEN_DOWN
+#define EOR ANTLR3_TOKEN_EOR
+#define INVALID ANTLR3_TOKEN_INVALID
+
+
+/* =============================================================================
+ * Functions to create and destroy scopes. First come the rule scopes, followed
+ * by the global declared scopes.
+ */
+
+
+
+/* ============================================================================= */
+
+/* =============================================================================
+ * Start of recognizer
+ */
+
+/* Forward declare the locally static matching functions we have generated and any predicate functions.
+ */
+static ANTLR3_INLINE
+ void
+ mT__144 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__145 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__146 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__147 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__148 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__149 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__150 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__151 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__152 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__153 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__154 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__155 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__156 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__157 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__158 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__159 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__160 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__161 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__162 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__163 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__164 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__165 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__166 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__167 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__168 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__169 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__170 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__171 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__172 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__173 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__174 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__175 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__176 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__177 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__178 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__179 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__180 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__181 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__182 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__183 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__184 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__185 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__186 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__187 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__188 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__189 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__190 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__191 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__192 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__193 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__194 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__195 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__196 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__197 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__198 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__199 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__200 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__201 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__202 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__203 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__204 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__205 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__206 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__207 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__208 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__209 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__210 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__211 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__212 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__213 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__214 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__215 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__216 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__217 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__218 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__219 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__220 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__221 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__222 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__223 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__224 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__225 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__226 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__227 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__228 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__229 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__230 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__231 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__232 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__233 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__234 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__235 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__236 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__237 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__238 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__239 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__240 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__241 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__242 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__243 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__244 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__245 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__246 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__247 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__248 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__249 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__250 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__251 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__252 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__253 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__254 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__255 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__256 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__257 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__258 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__259 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__260 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__261 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__262 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__263 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__264 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__265 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__266 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__267 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__268 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__269 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__270 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__271 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__272 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__273 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__274 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__275 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__276 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__277 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__278 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__279 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__280 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__281 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__282 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__283 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__284 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__285 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__286 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__287 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__288 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__289 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__290 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__291 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__292 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__293 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__294 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__295 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__296 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__297 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__298 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__299 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__300 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__301 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__302 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__303 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__304 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__305 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__306 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__307 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__308 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__309 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__310 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__311 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__312 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__313 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__314 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__315 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__316 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__317 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__318 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__319 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__320 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__321 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__322 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__323 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__324 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__325 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__326 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__327 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__328 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__329 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__330 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__331 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__332 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__333 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__334 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__335 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__336 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__337 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__338 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__339 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__340 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__341 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__342 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__343 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__344 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__345 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__346 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__347 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__348 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__349 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__350 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__351 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__352 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__353 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__354 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__355 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__356 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__357 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__358 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__359 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__360 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__361 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__362 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__363 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__364 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__365 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__366 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__367 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__368 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__369 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__370 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__371 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__372 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__373 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__374 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__375 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__376 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__377 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__378 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__379 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__380 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__381 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__382 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__383 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__384 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__385 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__386 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__387 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__388 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__389 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__390 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__391 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__392 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__393 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__394 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__395 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__396 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__397 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__398 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__399 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__400 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__401 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__402 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__403 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__404 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__405 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__406 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__407 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__408 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__409 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__410 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__411 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__412 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__413 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__414 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__415 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__416 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__417 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_ATOMIC_SEQUENCE (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_SEQUENCE (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_SEQUENCE_SIDE (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_SEQUENCE_WEAK (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_SCHEDULE_GT (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_SCHEDULE_LT (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_SCHEDULE_XOR (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_SCHEDULE_AND_THEN (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_SCHEDULE_OR_ELSE (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_NON_DETERMINISM (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_CONCURRENCY_ASYNC (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_CONCURRENCY_AND (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_CONCURRENCY_OR (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_CONCURRENCY_INTERLEAVING (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_CONCURRENCY_PARALLEL (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_FORK (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_JOIN (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_CONCURRENCY_RDV_ASYNC (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_CONCURRENCY_RDV_AND (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_CONCURRENCY_RDV_OR (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_CONCURRENCY_RDV_INTERLEAVING (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_CONCURRENCY_RDV_PARALLEL (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mASSIGN (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mASSIGN_AFTER (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mASSIGN_REF (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mASSIGN_MACRO (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_PUSH (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_ASSIGN_TOP (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_TOP (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOP_POP (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mLPAREN (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mRPAREN (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mLCURLY (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mRCURLY (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mLBRACKET (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mRBRACKET (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mLBRACKET_EXCEPT (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mLPAREN_INVOKE (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mLCURLY_INVOKE (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mPERCENT_LPAREN_INVOKE (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mPERCENT_LPAREN (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mRPAREN_PERCENT (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mSTATEMENT_PROMPT (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mDOLLAR_LCURLY (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mRCURLY_DOLLAR (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mPERCENT_LCURLY (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mRCURLY_PERCENT (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mLBRACKET_BAR (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mBAR_RBRACKET (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mLBRACKET_LCURLY (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mRCURLY_RBRACKET (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mCOLON (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mCOMMA (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mQUESTION (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mSEMI (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mDIESE (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mDOLLAR (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mDOT (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mDOTDOT (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mCOLONx2 (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mLAND (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mLAND_THEN (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mLAND_ASSIGN (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mLAND_ASSIGN_AFTER (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mLNOT (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mLOR (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mLOR_ELSE (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mLOR_ASSIGN (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mLOR_ASSIGN_AFTER (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mLXOR (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mEQUAL (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mNEQUAL (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mSEQUAL (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mNSEQUAL (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mLTE (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mLT_ (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mGTE (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mGT (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mPLUS (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mPLUS_ASSIGN (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mPLUS_ASSIGN_AFTER (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mINCR (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mMINUS (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mMINUS_ASSIGN (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mMINUS_ASSIGN_AFTER (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mDECR (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mSTAR (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mSTAR_ASSIGN (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mSTAR_ASSIGN_AFTER (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mDIV (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mDIV_ASSIGN (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mDIV_ASSIGN_AFTER (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mMOD (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mMOD_ASSIGN (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mMOD_ASSIGN_AFTER (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mRSHIFT (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mRSHIFT_ASSIGN (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mRSHIFT_ASSIGN_AFTER (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mLSHIFT (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mLSHIFT_ASSIGN (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mLSHIFT_ASSIGN_AFTER (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mBAND (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mBAND_ASSIGN (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mBAND_ASSIGN_AFTER (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mBNOT (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mBOR (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mBOR_ASSIGN (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mBOR_ASSIGN_AFTER (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mBXOR (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mBXOR_ASSIGN (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mBXOR_ASSIGN_AFTER (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mID (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mAT_ID (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mStringLiteral (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mCharLiteral (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mNumberLiteral (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mFloatLiteral (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mRationalLiteral (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mIntegerLiteral (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mFloatTypeSuffix (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mImaginarySuffix (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mIntSuffix (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mInteger (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mDecimal (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mBinary (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOctal (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mHexadecimal (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mDecimalDigit (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOctalDigit (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mHexDigit (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mDecimalExponent (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mDecimalDigits (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mFloat (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mEXPONENT (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mHEX_DIGIT (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mESC_SEQ (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mOCTAL_ESC (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mUNICODE_ESC (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mCOMMENT (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mWS (pfmlLexer ctx);
+static ANTLR3_INLINE
+ void
+ mTokens (pfmlLexer ctx);
+static ANTLR3_INLINE
+ ANTLR3_BOOLEAN
+ synpred1_fml (pfmlLexer ctx);
+static ANTLR3_INLINE
+ ANTLR3_BOOLEAN
+ synpred2_fml (pfmlLexer ctx);
+static void fmlLexerFree(pfmlLexer ctx);
+
+/* =========================================================================
+ * Lexer matching rules end.
+ * =========================================================================
+ */
+
+
+
+static void
+fmlLexerFree (pfmlLexer ctx)
+{
+ LEXER->free(LEXER);
+
+ ANTLR3_FREE(ctx);
+}
+
+static void
+fmlLexerReset (pfmlLexer ctx)
+{
+ RECOGNIZER->reset(RECOGNIZER);
+}
+
+/** \brief Name of the grammar file that generated this code
+ */
+static const char fileName[] = "/home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g";
+
+/** \brief Return the name of the grammar file that generated this code.
+ */
+static const char * getGrammarFileName()
+{
+ return fileName;
+}
+
+/** \brief Create a new lexer called fmlLexer
+ *
+ * \param[in] instream Pointer to an initialized input stream
+ * \return
+ * - Success pfmlLexer initialized for the lex start
+ * - Fail NULL
+ */
+ANTLR3_API pfmlLexer fmlLexerNew
+(
+pANTLR3_INPUT_STREAM
+ instream)
+{
+ // See if we can create a new lexer with the standard constructor
+ //
+ return fmlLexerNewSSD(instream, NULL);
+}
+
+/** \brief Create a new lexer called fmlLexer
+ *
+ * \param[in] instream Pointer to an initialized input stream
+ * \param[state] state Previously created shared recognizer stat
+ * \return
+ * - Success pfmlLexer initialized for the lex start
+ * - Fail NULL
+ */
+ANTLR3_API pfmlLexer fmlLexerNewSSD
+(pANTLR3_INPUT_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
+{
+ pfmlLexer ctx; // Context structure we will build and return
+
+ ctx = (pfmlLexer) ANTLR3_CALLOC(1, sizeof(fmlLexer));
+
+ if (ctx == NULL)
+ {
+ // Failed to allocate memory for lexer context
+ return NULL;
+ }
+
+ /* -------------------------------------------------------------------
+ * Memory for basic structure is allocated, now to fill in
+ * in base ANTLR3 structures. We initialize the function pointers
+ * for the standard ANTLR3 lexer function set, but upon return
+ * from here, the programmer may set the pointers to provide custom
+ * implementations of each function.
+ *
+ * We don't use the macros defined in fmlLexer.h here so you can get a sense
+ * of what goes where.
+ */
+
+ /* Create a base lexer, using the supplied input stream
+ */
+ ctx->pLexer = antlr3LexerNewStream(ANTLR3_SIZE_HINT, instream, state);
+
+ /* Check that we allocated the memory correctly
+ */
+ if (ctx->pLexer == NULL)
+ {
+ ANTLR3_FREE(ctx);
+ return NULL;
+ }
+ /* Install the implementation of our fmlLexer interface
+ */
+ ctx->mT__144 = mT__144;
+ ctx->mT__145 = mT__145;
+ ctx->mT__146 = mT__146;
+ ctx->mT__147 = mT__147;
+ ctx->mT__148 = mT__148;
+ ctx->mT__149 = mT__149;
+ ctx->mT__150 = mT__150;
+ ctx->mT__151 = mT__151;
+ ctx->mT__152 = mT__152;
+ ctx->mT__153 = mT__153;
+ ctx->mT__154 = mT__154;
+ ctx->mT__155 = mT__155;
+ ctx->mT__156 = mT__156;
+ ctx->mT__157 = mT__157;
+ ctx->mT__158 = mT__158;
+ ctx->mT__159 = mT__159;
+ ctx->mT__160 = mT__160;
+ ctx->mT__161 = mT__161;
+ ctx->mT__162 = mT__162;
+ ctx->mT__163 = mT__163;
+ ctx->mT__164 = mT__164;
+ ctx->mT__165 = mT__165;
+ ctx->mT__166 = mT__166;
+ ctx->mT__167 = mT__167;
+ ctx->mT__168 = mT__168;
+ ctx->mT__169 = mT__169;
+ ctx->mT__170 = mT__170;
+ ctx->mT__171 = mT__171;
+ ctx->mT__172 = mT__172;
+ ctx->mT__173 = mT__173;
+ ctx->mT__174 = mT__174;
+ ctx->mT__175 = mT__175;
+ ctx->mT__176 = mT__176;
+ ctx->mT__177 = mT__177;
+ ctx->mT__178 = mT__178;
+ ctx->mT__179 = mT__179;
+ ctx->mT__180 = mT__180;
+ ctx->mT__181 = mT__181;
+ ctx->mT__182 = mT__182;
+ ctx->mT__183 = mT__183;
+ ctx->mT__184 = mT__184;
+ ctx->mT__185 = mT__185;
+ ctx->mT__186 = mT__186;
+ ctx->mT__187 = mT__187;
+ ctx->mT__188 = mT__188;
+ ctx->mT__189 = mT__189;
+ ctx->mT__190 = mT__190;
+ ctx->mT__191 = mT__191;
+ ctx->mT__192 = mT__192;
+ ctx->mT__193 = mT__193;
+ ctx->mT__194 = mT__194;
+ ctx->mT__195 = mT__195;
+ ctx->mT__196 = mT__196;
+ ctx->mT__197 = mT__197;
+ ctx->mT__198 = mT__198;
+ ctx->mT__199 = mT__199;
+ ctx->mT__200 = mT__200;
+ ctx->mT__201 = mT__201;
+ ctx->mT__202 = mT__202;
+ ctx->mT__203 = mT__203;
+ ctx->mT__204 = mT__204;
+ ctx->mT__205 = mT__205;
+ ctx->mT__206 = mT__206;
+ ctx->mT__207 = mT__207;
+ ctx->mT__208 = mT__208;
+ ctx->mT__209 = mT__209;
+ ctx->mT__210 = mT__210;
+ ctx->mT__211 = mT__211;
+ ctx->mT__212 = mT__212;
+ ctx->mT__213 = mT__213;
+ ctx->mT__214 = mT__214;
+ ctx->mT__215 = mT__215;
+ ctx->mT__216 = mT__216;
+ ctx->mT__217 = mT__217;
+ ctx->mT__218 = mT__218;
+ ctx->mT__219 = mT__219;
+ ctx->mT__220 = mT__220;
+ ctx->mT__221 = mT__221;
+ ctx->mT__222 = mT__222;
+ ctx->mT__223 = mT__223;
+ ctx->mT__224 = mT__224;
+ ctx->mT__225 = mT__225;
+ ctx->mT__226 = mT__226;
+ ctx->mT__227 = mT__227;
+ ctx->mT__228 = mT__228;
+ ctx->mT__229 = mT__229;
+ ctx->mT__230 = mT__230;
+ ctx->mT__231 = mT__231;
+ ctx->mT__232 = mT__232;
+ ctx->mT__233 = mT__233;
+ ctx->mT__234 = mT__234;
+ ctx->mT__235 = mT__235;
+ ctx->mT__236 = mT__236;
+ ctx->mT__237 = mT__237;
+ ctx->mT__238 = mT__238;
+ ctx->mT__239 = mT__239;
+ ctx->mT__240 = mT__240;
+ ctx->mT__241 = mT__241;
+ ctx->mT__242 = mT__242;
+ ctx->mT__243 = mT__243;
+ ctx->mT__244 = mT__244;
+ ctx->mT__245 = mT__245;
+ ctx->mT__246 = mT__246;
+ ctx->mT__247 = mT__247;
+ ctx->mT__248 = mT__248;
+ ctx->mT__249 = mT__249;
+ ctx->mT__250 = mT__250;
+ ctx->mT__251 = mT__251;
+ ctx->mT__252 = mT__252;
+ ctx->mT__253 = mT__253;
+ ctx->mT__254 = mT__254;
+ ctx->mT__255 = mT__255;
+ ctx->mT__256 = mT__256;
+ ctx->mT__257 = mT__257;
+ ctx->mT__258 = mT__258;
+ ctx->mT__259 = mT__259;
+ ctx->mT__260 = mT__260;
+ ctx->mT__261 = mT__261;
+ ctx->mT__262 = mT__262;
+ ctx->mT__263 = mT__263;
+ ctx->mT__264 = mT__264;
+ ctx->mT__265 = mT__265;
+ ctx->mT__266 = mT__266;
+ ctx->mT__267 = mT__267;
+ ctx->mT__268 = mT__268;
+ ctx->mT__269 = mT__269;
+ ctx->mT__270 = mT__270;
+ ctx->mT__271 = mT__271;
+ ctx->mT__272 = mT__272;
+ ctx->mT__273 = mT__273;
+ ctx->mT__274 = mT__274;
+ ctx->mT__275 = mT__275;
+ ctx->mT__276 = mT__276;
+ ctx->mT__277 = mT__277;
+ ctx->mT__278 = mT__278;
+ ctx->mT__279 = mT__279;
+ ctx->mT__280 = mT__280;
+ ctx->mT__281 = mT__281;
+ ctx->mT__282 = mT__282;
+ ctx->mT__283 = mT__283;
+ ctx->mT__284 = mT__284;
+ ctx->mT__285 = mT__285;
+ ctx->mT__286 = mT__286;
+ ctx->mT__287 = mT__287;
+ ctx->mT__288 = mT__288;
+ ctx->mT__289 = mT__289;
+ ctx->mT__290 = mT__290;
+ ctx->mT__291 = mT__291;
+ ctx->mT__292 = mT__292;
+ ctx->mT__293 = mT__293;
+ ctx->mT__294 = mT__294;
+ ctx->mT__295 = mT__295;
+ ctx->mT__296 = mT__296;
+ ctx->mT__297 = mT__297;
+ ctx->mT__298 = mT__298;
+ ctx->mT__299 = mT__299;
+ ctx->mT__300 = mT__300;
+ ctx->mT__301 = mT__301;
+ ctx->mT__302 = mT__302;
+ ctx->mT__303 = mT__303;
+ ctx->mT__304 = mT__304;
+ ctx->mT__305 = mT__305;
+ ctx->mT__306 = mT__306;
+ ctx->mT__307 = mT__307;
+ ctx->mT__308 = mT__308;
+ ctx->mT__309 = mT__309;
+ ctx->mT__310 = mT__310;
+ ctx->mT__311 = mT__311;
+ ctx->mT__312 = mT__312;
+ ctx->mT__313 = mT__313;
+ ctx->mT__314 = mT__314;
+ ctx->mT__315 = mT__315;
+ ctx->mT__316 = mT__316;
+ ctx->mT__317 = mT__317;
+ ctx->mT__318 = mT__318;
+ ctx->mT__319 = mT__319;
+ ctx->mT__320 = mT__320;
+ ctx->mT__321 = mT__321;
+ ctx->mT__322 = mT__322;
+ ctx->mT__323 = mT__323;
+ ctx->mT__324 = mT__324;
+ ctx->mT__325 = mT__325;
+ ctx->mT__326 = mT__326;
+ ctx->mT__327 = mT__327;
+ ctx->mT__328 = mT__328;
+ ctx->mT__329 = mT__329;
+ ctx->mT__330 = mT__330;
+ ctx->mT__331 = mT__331;
+ ctx->mT__332 = mT__332;
+ ctx->mT__333 = mT__333;
+ ctx->mT__334 = mT__334;
+ ctx->mT__335 = mT__335;
+ ctx->mT__336 = mT__336;
+ ctx->mT__337 = mT__337;
+ ctx->mT__338 = mT__338;
+ ctx->mT__339 = mT__339;
+ ctx->mT__340 = mT__340;
+ ctx->mT__341 = mT__341;
+ ctx->mT__342 = mT__342;
+ ctx->mT__343 = mT__343;
+ ctx->mT__344 = mT__344;
+ ctx->mT__345 = mT__345;
+ ctx->mT__346 = mT__346;
+ ctx->mT__347 = mT__347;
+ ctx->mT__348 = mT__348;
+ ctx->mT__349 = mT__349;
+ ctx->mT__350 = mT__350;
+ ctx->mT__351 = mT__351;
+ ctx->mT__352 = mT__352;
+ ctx->mT__353 = mT__353;
+ ctx->mT__354 = mT__354;
+ ctx->mT__355 = mT__355;
+ ctx->mT__356 = mT__356;
+ ctx->mT__357 = mT__357;
+ ctx->mT__358 = mT__358;
+ ctx->mT__359 = mT__359;
+ ctx->mT__360 = mT__360;
+ ctx->mT__361 = mT__361;
+ ctx->mT__362 = mT__362;
+ ctx->mT__363 = mT__363;
+ ctx->mT__364 = mT__364;
+ ctx->mT__365 = mT__365;
+ ctx->mT__366 = mT__366;
+ ctx->mT__367 = mT__367;
+ ctx->mT__368 = mT__368;
+ ctx->mT__369 = mT__369;
+ ctx->mT__370 = mT__370;
+ ctx->mT__371 = mT__371;
+ ctx->mT__372 = mT__372;
+ ctx->mT__373 = mT__373;
+ ctx->mT__374 = mT__374;
+ ctx->mT__375 = mT__375;
+ ctx->mT__376 = mT__376;
+ ctx->mT__377 = mT__377;
+ ctx->mT__378 = mT__378;
+ ctx->mT__379 = mT__379;
+ ctx->mT__380 = mT__380;
+ ctx->mT__381 = mT__381;
+ ctx->mT__382 = mT__382;
+ ctx->mT__383 = mT__383;
+ ctx->mT__384 = mT__384;
+ ctx->mT__385 = mT__385;
+ ctx->mT__386 = mT__386;
+ ctx->mT__387 = mT__387;
+ ctx->mT__388 = mT__388;
+ ctx->mT__389 = mT__389;
+ ctx->mT__390 = mT__390;
+ ctx->mT__391 = mT__391;
+ ctx->mT__392 = mT__392;
+ ctx->mT__393 = mT__393;
+ ctx->mT__394 = mT__394;
+ ctx->mT__395 = mT__395;
+ ctx->mT__396 = mT__396;
+ ctx->mT__397 = mT__397;
+ ctx->mT__398 = mT__398;
+ ctx->mT__399 = mT__399;
+ ctx->mT__400 = mT__400;
+ ctx->mT__401 = mT__401;
+ ctx->mT__402 = mT__402;
+ ctx->mT__403 = mT__403;
+ ctx->mT__404 = mT__404;
+ ctx->mT__405 = mT__405;
+ ctx->mT__406 = mT__406;
+ ctx->mT__407 = mT__407;
+ ctx->mT__408 = mT__408;
+ ctx->mT__409 = mT__409;
+ ctx->mT__410 = mT__410;
+ ctx->mT__411 = mT__411;
+ ctx->mT__412 = mT__412;
+ ctx->mT__413 = mT__413;
+ ctx->mT__414 = mT__414;
+ ctx->mT__415 = mT__415;
+ ctx->mT__416 = mT__416;
+ ctx->mT__417 = mT__417;
+ ctx->mOP_ATOMIC_SEQUENCE = mOP_ATOMIC_SEQUENCE;
+ ctx->mOP_SEQUENCE = mOP_SEQUENCE;
+ ctx->mOP_SEQUENCE_SIDE = mOP_SEQUENCE_SIDE;
+ ctx->mOP_SEQUENCE_WEAK = mOP_SEQUENCE_WEAK;
+ ctx->mOP_SCHEDULE_GT = mOP_SCHEDULE_GT;
+ ctx->mOP_SCHEDULE_LT = mOP_SCHEDULE_LT;
+ ctx->mOP_SCHEDULE_XOR = mOP_SCHEDULE_XOR;
+ ctx->mOP_SCHEDULE_AND_THEN = mOP_SCHEDULE_AND_THEN;
+ ctx->mOP_SCHEDULE_OR_ELSE = mOP_SCHEDULE_OR_ELSE;
+ ctx->mOP_NON_DETERMINISM = mOP_NON_DETERMINISM;
+ ctx->mOP_CONCURRENCY_ASYNC = mOP_CONCURRENCY_ASYNC;
+ ctx->mOP_CONCURRENCY_AND = mOP_CONCURRENCY_AND;
+ ctx->mOP_CONCURRENCY_OR = mOP_CONCURRENCY_OR;
+ ctx->mOP_CONCURRENCY_INTERLEAVING = mOP_CONCURRENCY_INTERLEAVING;
+ ctx->mOP_CONCURRENCY_PARALLEL = mOP_CONCURRENCY_PARALLEL;
+ ctx->mOP_FORK = mOP_FORK;
+ ctx->mOP_JOIN = mOP_JOIN;
+ ctx->mOP_CONCURRENCY_RDV_ASYNC = mOP_CONCURRENCY_RDV_ASYNC;
+ ctx->mOP_CONCURRENCY_RDV_AND = mOP_CONCURRENCY_RDV_AND;
+ ctx->mOP_CONCURRENCY_RDV_OR = mOP_CONCURRENCY_RDV_OR;
+ ctx->mOP_CONCURRENCY_RDV_INTERLEAVING = mOP_CONCURRENCY_RDV_INTERLEAVING;
+ ctx->mOP_CONCURRENCY_RDV_PARALLEL = mOP_CONCURRENCY_RDV_PARALLEL;
+ ctx->mASSIGN = mASSIGN;
+ ctx->mASSIGN_AFTER = mASSIGN_AFTER;
+ ctx->mASSIGN_REF = mASSIGN_REF;
+ ctx->mASSIGN_MACRO = mASSIGN_MACRO;
+ ctx->mOP_PUSH = mOP_PUSH;
+ ctx->mOP_ASSIGN_TOP = mOP_ASSIGN_TOP;
+ ctx->mOP_TOP = mOP_TOP;
+ ctx->mOP_POP = mOP_POP;
+ ctx->mLPAREN = mLPAREN;
+ ctx->mRPAREN = mRPAREN;
+ ctx->mLCURLY = mLCURLY;
+ ctx->mRCURLY = mRCURLY;
+ ctx->mLBRACKET = mLBRACKET;
+ ctx->mRBRACKET = mRBRACKET;
+ ctx->mLBRACKET_EXCEPT = mLBRACKET_EXCEPT;
+ ctx->mLPAREN_INVOKE = mLPAREN_INVOKE;
+ ctx->mLCURLY_INVOKE = mLCURLY_INVOKE;
+ ctx->mPERCENT_LPAREN_INVOKE = mPERCENT_LPAREN_INVOKE;
+ ctx->mPERCENT_LPAREN = mPERCENT_LPAREN;
+ ctx->mRPAREN_PERCENT = mRPAREN_PERCENT;
+ ctx->mSTATEMENT_PROMPT = mSTATEMENT_PROMPT;
+ ctx->mDOLLAR_LCURLY = mDOLLAR_LCURLY;
+ ctx->mRCURLY_DOLLAR = mRCURLY_DOLLAR;
+ ctx->mPERCENT_LCURLY = mPERCENT_LCURLY;
+ ctx->mRCURLY_PERCENT = mRCURLY_PERCENT;
+ ctx->mLBRACKET_BAR = mLBRACKET_BAR;
+ ctx->mBAR_RBRACKET = mBAR_RBRACKET;
+ ctx->mLBRACKET_LCURLY = mLBRACKET_LCURLY;
+ ctx->mRCURLY_RBRACKET = mRCURLY_RBRACKET;
+ ctx->mCOLON = mCOLON;
+ ctx->mCOMMA = mCOMMA;
+ ctx->mQUESTION = mQUESTION;
+ ctx->mSEMI = mSEMI;
+ ctx->mDIESE = mDIESE;
+ ctx->mDOLLAR = mDOLLAR;
+ ctx->mDOT = mDOT;
+ ctx->mDOTDOT = mDOTDOT;
+ ctx->mCOLONx2 = mCOLONx2;
+ ctx->mLAND = mLAND;
+ ctx->mLAND_THEN = mLAND_THEN;
+ ctx->mLAND_ASSIGN = mLAND_ASSIGN;
+ ctx->mLAND_ASSIGN_AFTER = mLAND_ASSIGN_AFTER;
+ ctx->mLNOT = mLNOT;
+ ctx->mLOR = mLOR;
+ ctx->mLOR_ELSE = mLOR_ELSE;
+ ctx->mLOR_ASSIGN = mLOR_ASSIGN;
+ ctx->mLOR_ASSIGN_AFTER = mLOR_ASSIGN_AFTER;
+ ctx->mLXOR = mLXOR;
+ ctx->mEQUAL = mEQUAL;
+ ctx->mNEQUAL = mNEQUAL;
+ ctx->mSEQUAL = mSEQUAL;
+ ctx->mNSEQUAL = mNSEQUAL;
+ ctx->mLTE = mLTE;
+ ctx->mLT_ = mLT_;
+ ctx->mGTE = mGTE;
+ ctx->mGT = mGT;
+ ctx->mPLUS = mPLUS;
+ ctx->mPLUS_ASSIGN = mPLUS_ASSIGN;
+ ctx->mPLUS_ASSIGN_AFTER = mPLUS_ASSIGN_AFTER;
+ ctx->mINCR = mINCR;
+ ctx->mMINUS = mMINUS;
+ ctx->mMINUS_ASSIGN = mMINUS_ASSIGN;
+ ctx->mMINUS_ASSIGN_AFTER = mMINUS_ASSIGN_AFTER;
+ ctx->mDECR = mDECR;
+ ctx->mSTAR = mSTAR;
+ ctx->mSTAR_ASSIGN = mSTAR_ASSIGN;
+ ctx->mSTAR_ASSIGN_AFTER = mSTAR_ASSIGN_AFTER;
+ ctx->mDIV = mDIV;
+ ctx->mDIV_ASSIGN = mDIV_ASSIGN;
+ ctx->mDIV_ASSIGN_AFTER = mDIV_ASSIGN_AFTER;
+ ctx->mMOD = mMOD;
+ ctx->mMOD_ASSIGN = mMOD_ASSIGN;
+ ctx->mMOD_ASSIGN_AFTER = mMOD_ASSIGN_AFTER;
+ ctx->mRSHIFT = mRSHIFT;
+ ctx->mRSHIFT_ASSIGN = mRSHIFT_ASSIGN;
+ ctx->mRSHIFT_ASSIGN_AFTER = mRSHIFT_ASSIGN_AFTER;
+ ctx->mLSHIFT = mLSHIFT;
+ ctx->mLSHIFT_ASSIGN = mLSHIFT_ASSIGN;
+ ctx->mLSHIFT_ASSIGN_AFTER = mLSHIFT_ASSIGN_AFTER;
+ ctx->mBAND = mBAND;
+ ctx->mBAND_ASSIGN = mBAND_ASSIGN;
+ ctx->mBAND_ASSIGN_AFTER = mBAND_ASSIGN_AFTER;
+ ctx->mBNOT = mBNOT;
+ ctx->mBOR = mBOR;
+ ctx->mBOR_ASSIGN = mBOR_ASSIGN;
+ ctx->mBOR_ASSIGN_AFTER = mBOR_ASSIGN_AFTER;
+ ctx->mBXOR = mBXOR;
+ ctx->mBXOR_ASSIGN = mBXOR_ASSIGN;
+ ctx->mBXOR_ASSIGN_AFTER = mBXOR_ASSIGN_AFTER;
+ ctx->mID = mID;
+ ctx->mAT_ID = mAT_ID;
+ ctx->mStringLiteral = mStringLiteral;
+ ctx->mCharLiteral = mCharLiteral;
+ ctx->mNumberLiteral = mNumberLiteral;
+ ctx->mFloatLiteral = mFloatLiteral;
+ ctx->mRationalLiteral = mRationalLiteral;
+ ctx->mIntegerLiteral = mIntegerLiteral;
+ ctx->mFloatTypeSuffix = mFloatTypeSuffix;
+ ctx->mImaginarySuffix = mImaginarySuffix;
+ ctx->mIntSuffix = mIntSuffix;
+ ctx->mInteger = mInteger;
+ ctx->mDecimal = mDecimal;
+ ctx->mBinary = mBinary;
+ ctx->mOctal = mOctal;
+ ctx->mHexadecimal = mHexadecimal;
+ ctx->mDecimalDigit = mDecimalDigit;
+ ctx->mOctalDigit = mOctalDigit;
+ ctx->mHexDigit = mHexDigit;
+ ctx->mDecimalExponent = mDecimalExponent;
+ ctx->mDecimalDigits = mDecimalDigits;
+ ctx->mFloat = mFloat;
+ ctx->mEXPONENT = mEXPONENT;
+ ctx->mHEX_DIGIT = mHEX_DIGIT;
+ ctx->mESC_SEQ = mESC_SEQ;
+ ctx->mOCTAL_ESC = mOCTAL_ESC;
+ ctx->mUNICODE_ESC = mUNICODE_ESC;
+ ctx->mCOMMENT = mCOMMENT;
+ ctx->mWS = mWS;
+ ctx->mTokens = mTokens;
+
+
+
+ /** When the nextToken() call is made to this lexer's pANTLR3_TOKEN_SOURCE
+ * it will call mTokens() in this generated code, and will pass it the ctx
+ * pointer of this lexer, not the context of the base lexer, so store that now.
+ */
+ ctx->pLexer->ctx = ctx;
+
+ /**Install the token matching function
+ */
+ ctx->pLexer->mTokens = (void (*) (void *))(mTokens);
+
+ ctx->getGrammarFileName = getGrammarFileName;
+ ctx->free = fmlLexerFree;
+ ctx->reset = fmlLexerReset;
+
+
+ /* Return the newly built lexer to the caller
+ */
+ return ctx;
+}
+
+/* =========================================================================
+ * DFA tables for the lexer
+ */
+/** Static dfa state tables for Cyclic dfa:
+ * 1:1: Tokens : ( T__144 | T__145 | T__146 | T__147 | T__148 | T__149 | T__150 | T__151 | T__152 | T__153 | T__154 | T__155 | T__156 | T__157 | T__158 | T__159 | T__160 | T__161 | T__162 | T__163 | T__164 | T__165 | T__166 | T__167 | T__168 | T__169 | T__170 | T__171 | T__172 | T__173 | T__174 | T__175 | T__176 | T__177 | T__178 | T__179 | T__180 | T__181 | T__182 | T__183 | T__184 | T__185 | T__186 | T__187 | T__188 | T__189 | T__190 | T__191 | T__192 | T__193 | T__194 | T__195 | T__196 | T__197 | T__198 | T__199 | T__200 | T__201 | T__202 | T__203 | T__204 | T__205 | T__206 | T__207 | T__208 | T__209 | T__210 | T__211 | T__212 | T__213 | T__214 | T__215 | T__216 | T__217 | T__218 | T__219 | T__220 | T__221 | T__222 | T__223 | T__224 | T__225 | T__226 | T__227 | T__228 | T__229 | T__230 | T__231 | T__232 | T__233 | T__234 | T__235 | T__236 | T__237 | T__238 | T__239 | T__240 | T__241 | T__242 | T__243 | T__244 | T__245 | T__246 | T__247 | T__248 | T__249 | T__250 | T__251 | T__252 | T__253 | T__254 | T__255 | T__256 | T__257 | T__258 | T__259 | T__260 | T__261 | T__262 | T__263 | T__264 | T__265 | T__266 | T__267 | T__268 | T__269 | T__270 | T__271 | T__272 | T__273 | T__274 | T__275 | T__276 | T__277 | T__278 | T__279 | T__280 | T__281 | T__282 | T__283 | T__284 | T__285 | T__286 | T__287 | T__288 | T__289 | T__290 | T__291 | T__292 | T__293 | T__294 | T__295 | T__296 | T__297 | T__298 | T__299 | T__300 | T__301 | T__302 | T__303 | T__304 | T__305 | T__306 | T__307 | T__308 | T__309 | T__310 | T__311 | T__312 | T__313 | T__314 | T__315 | T__316 | T__317 | T__318 | T__319 | T__320 | T__321 | T__322 | T__323 | T__324 | T__325 | T__326 | T__327 | T__328 | T__329 | T__330 | T__331 | T__332 | T__333 | T__334 | T__335 | T__336 | T__337 | T__338 | T__339 | T__340 | T__341 | T__342 | T__343 | T__344 | T__345 | T__346 | T__347 | T__348 | T__349 | T__350 | T__351 | T__352 | T__353 | T__354 | T__355 | T__356 | T__357 | T__358 | T__359 | T__360 | T__361 | T__362 | T__363 | T__364 | T__365 | T__366 | T__367 | T__368 | T__369 | T__370 | T__371 | T__372 | T__373 | T__374 | T__375 | T__376 | T__377 | T__378 | T__379 | T__380 | T__381 | T__382 | T__383 | T__384 | T__385 | T__386 | T__387 | T__388 | T__389 | T__390 | T__391 | T__392 | T__393 | T__394 | T__395 | T__396 | T__397 | T__398 | T__399 | T__400 | T__401 | T__402 | T__403 | T__404 | T__405 | T__406 | T__407 | T__408 | T__409 | T__410 | T__411 | T__412 | T__413 | T__414 | T__415 | T__416 | T__417 | OP_ATOMIC_SEQUENCE | OP_SEQUENCE | OP_SEQUENCE_SIDE | OP_SEQUENCE_WEAK | OP_SCHEDULE_GT | OP_SCHEDULE_LT | OP_SCHEDULE_XOR | OP_SCHEDULE_AND_THEN | OP_SCHEDULE_OR_ELSE | OP_NON_DETERMINISM | OP_CONCURRENCY_ASYNC | OP_CONCURRENCY_AND | OP_CONCURRENCY_OR | OP_CONCURRENCY_INTERLEAVING | OP_CONCURRENCY_PARALLEL | OP_FORK | OP_JOIN | OP_CONCURRENCY_RDV_ASYNC | OP_CONCURRENCY_RDV_AND | OP_CONCURRENCY_RDV_OR | OP_CONCURRENCY_RDV_INTERLEAVING | OP_CONCURRENCY_RDV_PARALLEL | ASSIGN | ASSIGN_AFTER | ASSIGN_REF | ASSIGN_MACRO | OP_PUSH | OP_ASSIGN_TOP | OP_TOP | OP_POP | LPAREN | RPAREN | LCURLY | RCURLY | LBRACKET | RBRACKET | LBRACKET_EXCEPT | LPAREN_INVOKE | LCURLY_INVOKE | PERCENT_LPAREN_INVOKE | PERCENT_LPAREN | RPAREN_PERCENT | STATEMENT_PROMPT | DOLLAR_LCURLY | RCURLY_DOLLAR | PERCENT_LCURLY | RCURLY_PERCENT | LBRACKET_BAR | BAR_RBRACKET | LBRACKET_LCURLY | RCURLY_RBRACKET | COLON | COMMA | QUESTION | SEMI | DIESE | DOLLAR | DOT | DOTDOT | COLONx2 | LAND | LAND_THEN | LAND_ASSIGN | LAND_ASSIGN_AFTER | LNOT | LOR | LOR_ELSE | LOR_ASSIGN | LOR_ASSIGN_AFTER | LXOR | EQUAL | NEQUAL | SEQUAL | NSEQUAL | LTE | LT_ | GTE | GT | PLUS | PLUS_ASSIGN | PLUS_ASSIGN_AFTER | INCR | MINUS | MINUS_ASSIGN | MINUS_ASSIGN_AFTER | DECR | STAR | STAR_ASSIGN | STAR_ASSIGN_AFTER | DIV | DIV_ASSIGN | DIV_ASSIGN_AFTER | MOD | MOD_ASSIGN | MOD_ASSIGN_AFTER | RSHIFT | RSHIFT_ASSIGN | RSHIFT_ASSIGN_AFTER | LSHIFT | LSHIFT_ASSIGN | LSHIFT_ASSIGN_AFTER | BAND | BAND_ASSIGN | BAND_ASSIGN_AFTER | BNOT | BOR | BOR_ASSIGN | BOR_ASSIGN_AFTER | BXOR | BXOR_ASSIGN | BXOR_ASSIGN_AFTER | ID | AT_ID | StringLiteral | CharLiteral | NumberLiteral | COMMENT | WS );
+ */
+static const ANTLR3_INT32 dfa50_eot[1484] =
+ {
+ -1, 61, 68, 73, 77, 81, 98, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 200, 203, 206, 209, 211, 213, 215,
+ 219, 223, -1, 228, -1, -1, -1, 230, 234, 236, 53, 241, 244, 248, -1, 53,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 261, -1, 72, -1, -1, 265, 268, 271, -1, 274, -1, -1, -1, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, -1, -1, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 339, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 360, 366, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 382, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 199, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 450, -1, -1, -1, 452, -1, -1, 205, -1, -1, 457, 460, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 462, -1, 227, -1,
+ -1, -1, -1, 466, 233, -1, -1, -1, -1, 53, 239, -1, -1, -1, 243, -1, -1,
+ 246, -1, -1, -1, 53, 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 270, -1, -1, -1, -1, -1, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 53, 53, 53,
+ 536, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, -1, 53, 53, 53, 53, 53, 566, 53, 53, 53, 53, 53, 53, 575,
+ 53, 577, 53, 53, 53, 53, 53, -1, 53, 53, 53, 53, 588, -1, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 601, 53, 236, 53, 53, -1, 606, 53, 53, 53, 53,
+ 53, 53, 53, 53, 619, 621, 622, 53, 624, 53, 53, 53, 629, 630, 53, 53, 53,
+ 634, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 660, 661, 53, 663, 53, 53, 53, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 449, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 459, -1, -1, -1, -1, -1, 465, -1, -1, -1, 675, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 691, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 724, 725, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 53, 53, 53, 53, -1, 53, 53, 53, 745, 747, 53, 53, 53, 751,
+ 53, 755, 53, 53, 53, 53, 53, 53, 53, 53, 764, -1, 53, 53, 53, 53, 53, 771,
+ 53, 773, -1, 53, 775, 53, 777, 53, 53, 780, 781, -1, 53, -1, 783, 53, 53,
+ 53, 53, 789, 53, 53, 53, 53, -1, 795, 53, 53, 798, 799, 53, 53, -1, 53,
+ -1, 53, 53, -1, 806, 53, 53, 53, -1, 53, 53, 812, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, -1, 53, -1, -1, 824, -1, 53, 53, 53, 53, -1, -1, 53, 53, 832,
+ -1, 53, 53, 53, 53, 53, 53, 841, 53, 53, 53, 53, 53, 848, 53, 850, 851,
+ 53, 53, 855, 53, 53, 53, 53, 861, 53, -1, -1, 53, -1, 53, 865, 53, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 870, 99, 99, -1, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, -1, 99, 99, 99, 99, 99, 99, 99, 99, 892, 99, 99, 99,
+ 99, 897, 99, 99, -1, 99, -1, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, -1, -1, 99, 99, 99, 918, 99, 99, 99, 99, 923, 924, 925, 926, 53,
+ 53, 53, 53, 931, 53, -1, -1, 53, -1, 934, 53, 53, -1, 53, 53, 53, -1, 53,
+ 53, 942, 943, 53, 945, 53, 947, -1, 53, 53, 53, 951, 53, 53, -1, 53, -1,
+ 955, -1, 956, -1, 957, 958, -1, -1, -1, -1, 959, 53, 53, 53, -1, -1, 963,
+ 966, 53, 53, 53, -1, 53, 53, -1, -1, 53, 973, 53, 976, 53, -1, -1, 53,
+ 53, 53, 53, 53, -1, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, -1, 53,
+ 53, 53, 1002, 53, 53, 53, -1, 53, -1, 53, 1008, 1010, 53, 53, 53, -1, 53,
+ 53, 53, 53, 53, 1019, -1, 53, -1, -1, 53, 53, 53, -1, 53, 1025, 53, 53,
+ 53, -1, 1029, 53, 53, -1, 1032, -1, -1, -1, -1, 1033, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 1045, 99, 99, 99, 99, 99, 99, 99, 99, -1, 99, 99,
+ 99, 99, -1, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 1077, 99, -1, 99, 99, 99, 99, -1, -1, -1, -1, 1083, 53, 53,
+ 53, -1, 53, 53, -1, 53, 1090, 53, 53, 53, 53, 1095, -1, -1, 53, -1, 53,
+ -1, 53, 53, 1100, -1, 53, 1102, 1103, -1, -1, -1, -1, -1, 1104, 53, 53,
+ -1, 53, 53, -1, 53, 53, 53, 1117, 53, 53, -1, 53, -1, -1, 53, 53, 53, 53,
+ 53, 53, 53, 53, 1130, 53, 1132, 53, 53, -1, 53, -1, 53, 53, 53, 53, 1140,
+ 53, 53, 1143, 1145, -1, 53, 53, 53, 1149, 53, -1, 53, -1, 1152, 53, 53,
+ 1155, 1156, 53, 1158, 1159, -1, 53, 53, 1163, 53, 53, -1, 53, 1167, 53,
+ -1, 1169, 53, -1, -1, 99, 99, 99, 99, 1175, 99, 99, 99, 99, 1180, 99, -1,
+ 99, -1, 99, 1184, 99, 99, 99, 99, -1, -1, 99, 99, 99, -1, -1, 99, 99, 99,
+ 99, -1, 99, 99, 99, 99, 99, 99, 99, 99, 1206, 99, 99, -1, 99, 1210, 99,
+ 99, 99, -1, 53, 53, 1216, 1217, 1218, 53, -1, 1221, 1222, 53, 53, -1, 1226,
+ 53, 1228, 1229, -1, 1230, -1, -1, -1, 53, 1232, 53, 53, 53, 53, 53, 53,
+ 53, 53, 1241, 53, -1, 53, 1244, 1245, 53, 53, 53, 53, 53, 53, 53, 1253,
+ 53, -1, 1259, -1, 1261, 1262, 1263, 53, 53, 53, 53, -1, 53, 1269, -1, 53,
+ -1, 1271, 1272, 53, -1, -1, 53, -1, 53, 53, -1, -1, 1279, -1, -1, 53, 53,
+ 1282, -1, 53, 1284, 53, -1, 53, -1, 53, 99, 99, 99, 99, -1, 99, 1293, 99,
+ -1, -1, 99, 99, -1, -1, 99, 1298, -1, 1299, 99, 99, 99, 99, 1304, -1, 1305,
+ 99, 99, 99, 99, 99, 99, -1, -1, -1, 99, -1, 1314, 99, 99, -1, -1, 99, 99,
+ 53, 1320, -1, -1, -1, 53, 53, -1, -1, 53, 1324, 53, -1, 1326, -1, -1, -1,
+ 1327, -1, 53, 53, 53, 53, 53, 53, 53, 1336, -1, 1337, 1338, -1, -1, 53,
+ 53, 53, 53, 1343, 1344, 1345, -1, 53, 53, 53, 53, 53, -1, 53, -1, -1, -1,
+ 53, 53, 53, 53, 1356, -1, -1, -1, -1, 1357, 53, 53, 53, 53, 53, -1, 53,
+ 53, -1, 1366, -1, 53, 53, 1369, 99, 99, 99, 99, 99, -1, 99, 99, 1377, 1378,
+ -1, -1, 99, 99, -1, 1381, -1, -1, 99, -1, 99, 99, 99, 99, -1, -1, -1, 1387,
+ 99, 99, -1, -1, -1, 1390, 53, 1392, -1, 1393, -1, -1, 53, 1395, 53, 1397,
+ 53, 1399, 53, -1, -1, -1, -1, 1401, 1402, 1403, 53, -1, -1, -1, 53, 53,
+ 53, 53, 53, 53, 1411, 1412, 1413, -1, -1, -1, 53, 53, 1416, 53, 53, 1419,
+ 1420, 53, -1, 1422, 1423, -1, -1, 1425, 99, 99, 99, 1429, 99, -1, -1, -1,
+ 99, -1, 99, 99, -1, 99, 99, -1, 99, 99, -1, 1438, -1, -1, 53, -1, 1440,
+ -1, 1441, -1, 53, -1, -1, -1, 53, 53, 1445, 53, 1447, 1448, 53, -1, -1,
+ -1, 53, 53, -1, 1452, 53, -1, -1, 1454, -1, -1, -1, -1, 99, 1456, 99, -1,
+ 99, 99, -1, -1, -1, -1, 99, 99, -1, 53, -1, -1, 53, 53, 53, -1, 1466, -1,
+ -1, 1467, 53, 53, -1, 1470, -1, 1471, -1, 99, -1, 99, 99, -1, 1475, 53,
+ 53, 53, -1, -1, 1479, 1480, -1, -1, -1, -1, 99, -1, 1482, -1, 1483, -1,
+ -1, -1, -1, -1
+ };
+static const ANTLR3_INT32 dfa50_eof[1484] =
+ {
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1
+ };
+static const ANTLR3_INT32 dfa50_min[1484] =
+ {
+ 9, 100, 58, 45, 45, 33, 65, 98, 105, 97, 101, 108, 97, 111, 97, 111, 97,
+ 97, 101, 112, 97, 97, 99, 103, 100, 97, 97, 44, 58, 58, 61, 58, 37, 58,
+ 36, 94, -1, 40, -1, -1, -1, 46, 38, 61, 111, 43, 58, 42, -1, 46, -1, -1,
+ -1, -1, -1, -1, -1, 110, -1, 104, -1, -1, 99, -1, -1, 101, -1, -1, -1,
+ 62, -1, 58, -1, -1, 45, 60, 58, -1, 61, -1, -1, -1, 98, 101, 111, 101,
+ 102, 105, 117, 101, 97, 97, 110, 97, 101, 99, 103, 102, -1, -1, 111, 116,
+ 100, 114, 109, 110, 111, 101, 102, 108, 97, 97, 110, 105, 115, 115, 35,
+ 105, 110, 115, 97, 101, 105, 108, 102, 111, 114, 111, 110, 116, 97, 98,
+ 105, 110, 35, 35, 105, 109, 102, 99, 115, 99, 108, 119, 108, 116, 101,
+ 35, 116, 99, 114, 101, 98, 109, 118, 97, 117, 99, 110, 101, 104, 108, 103,
+ 108, 97, 115, 115, 117, 109, 58, 97, 112, 111, 108, 110, 105, 97, 108,
+ 99, 97, 108, 105, 105, 58, -1, 59, -1, 0, -1, -1, -1, 110, 114, 110, -1,
+ -1, -1, 44, -1, -1, -1, 61, -1, -1, 58, -1, -1, 62, 58, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, -1, 58, -1, -1, -1, -1,
+ 58, 58, -1, -1, -1, -1, 114, 58, -1, -1, -1, 58, -1, -1, 58, -1, -1, -1,
+ 105, 46, 105, -1, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 58, -1, -1, -1, -1, -1, 111, 104, 109, 101, 99, 115, 102, 97, 101,
+ 110, 108, 114, 97, 97, 98, 105, 110, 112, 99, 117, 99, 99, 95, 116, 116,
+ 99, 105, 98, 103, 117, 99, 110, 104, 97, 115, 117, 97, 109, 105, 114, 101,
+ 105, 35, 99, 97, 99, 100, 108, 97, 97, 102, 108, 110, 99, 105, 115, 99,
+ 110, 109, 114, 58, 116, 97, 98, -1, 109, 97, 101, 98, 109, 35, 110, 116,
+ 115, 111, 97, 97, 35, 109, 35, 111, 114, 111, 115, 97, -1, 116, 117, 117,
+ 116, 35, -1, 110, 98, 101, 116, 104, 58, 115, 58, 101, 116, 35, 108, 35,
+ 114, 101, -1, 35, 107, 101, 116, 95, 115, 111, 98, 108, 35, 35, 35, 108,
+ 35, 116, 117, 116, 35, 35, 99, 101, 102, 35, 110, 101, 118, 114, 112, 112,
+ 105, 112, 116, 97, 101, -1, 110, 101, 101, 117, 111, 116, 99, 97, 116,
+ 97, 35, 35, 116, 35, 97, 116, 108, -1, -1, -1, -1, -1, 100, -1, 35, -1,
+ 110, -1, -1, -1, 58, -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, -1, -1, -1,
+ -1, -1, 58, -1, -1, -1, 35, -1, -1, -1, -1, 116, -1, -1, -1, -1, 114, 97,
+ 58, 99, 97, 108, 97, 101, 101, 98, 99, 97, 35, 109, 114, 100, 111, 115,
+ 97, 111, 108, 116, 117, 117, 116, 101, 110, 104, 58, 101, 58, 119, 105,
+ 112, 107, 97, 118, 99, 108, 105, 117, 116, 35, 35, 101, 114, 112, 116,
+ 97, 110, 103, 108, 112, 97, 116, 110, 118, 116, -1, 97, 121, 111, 35, 35,
+ 107, 100, 101, 35, 103, 35, 107, 99, 115, 107, 101, 116, 105, 101, 35,
+ -1, 114, 98, 108, 101, 109, 35, 108, 35, -1, 116, 35, 101, 35, 108, 116,
+ 35, 35, -1, 58, -1, 35, 100, 114, 97, 98, 35, 116, 116, 97, 103, -1, 35,
+ 100, 108, 35, 35, 105, 111, -1, 97, -1, 108, 105, -1, 35, 97, 108, 117,
+ -1, 97, 110, 35, 105, 101, 114, 97, 97, 101, 101, 105, 105, -1, 111, -1,
+ -1, 35, -1, 97, 109, 114, 101, -1, -1, 116, 100, 35, -1, 97, 58, 101, 116,
+ 101, 95, 35, 110, 99, 101, 101, 114, 35, 115, 35, 35, 98, 97, 35, 97, 110,
+ 101, 102, 35, 108, -1, -1, 111, -1, 116, 35, 101, 35, -1, -1, -1, -1, -1,
+ -1, -1, -1, 105, 116, 118, -1, 111, 117, 116, 116, 97, 98, 114, 99, 108,
+ 117, 108, -1, 97, 100, 101, 114, 97, 98, 114, 117, 35, 116, 116, 97, 114,
+ 35, 105, 111, -1, 108, -1, 114, 111, 117, 97, 109, 97, 101, 101, 101, 105,
+ 111, 114, 105, -1, -1, 100, 116, 101, 35, 101, 114, 115, 103, 35, 35, 35,
+ 35, 116, 105, 104, 115, 35, 100, -1, -1, 97, -1, 35, 99, 114, -1, 101,
+ 101, 99, -1, 115, 101, 35, 35, 99, 35, 110, 35, -1, 111, 108, 101, 35,
+ 105, 102, -1, 101, -1, 35, -1, 35, -1, 35, 35, -1, -1, -1, -1, 35, 116,
+ 98, 108, -1, -1, 35, 35, 110, 101, 118, -1, 97, 105, -1, -1, 110, 35, 103,
+ 35, 99, -1, -1, 116, 115, 116, 103, 116, -1, 110, 110, 58, 116, 58, 100,
+ 99, 116, 100, 99, 110, -1, 114, 101, 110, 35, 110, 111, 117, -1, 108, -1,
+ 114, 35, 35, 99, 115, 109, -1, 103, 116, 110, 109, 100, 35, -1, 105, -1,
+ -1, 108, 116, 103, -1, 115, 35, 114, 101, 111, -1, 35, 114, 105, -1, 35,
+ -1, -1, -1, -1, 35, 105, 115, 114, 114, 101, 114, 108, 115, 116, 101, 116,
+ 35, 108, 58, 114, 116, 98, 108, 116, 100, -1, 58, 58, 110, 97, -1, 110,
+ 58, 58, 105, 110, 116, 103, 58, 116, 100, 114, 99, 116, 99, 110, 110, 110,
+ 117, 35, 109, -1, 109, 100, 105, 101, -1, -1, -1, -1, 35, 116, 101, 116,
+ -1, 101, 110, -1, 97, 35, 100, 108, 116, 97, 35, -1, -1, 116, -1, 117,
+ -1, 121, 101, 35, -1, 99, 35, 35, -1, -1, -1, -1, -1, 35, 108, 101, -1,
+ 98, 101, -1, 99, 114, 97, 35, 110, 101, -1, 101, -1, -1, 97, 105, 105,
+ 108, 100, 101, 111, 101, 35, 101, 35, 116, 116, -1, 101, -1, 117, 116,
+ 121, 101, 35, 97, 116, 35, 35, -1, 101, 114, 108, 35, 58, -1, 97, -1, 35,
+ 35, 97, 35, 35, 100, 35, 35, -1, 101, 101, 35, 101, 116, -1, 115, 35, 110,
+ -1, 35, 108, -1, -1, 111, 105, 114, 97, 35, 97, 101, 105, 58, 35, 97, -1,
+ 109, -1, 58, 35, 108, 101, 58, 101, -1, -1, 99, 99, 101, -1, -1, 116, 115,
+ 58, 101, -1, 116, 101, 117, 116, 116, 121, 58, 58, 35, 101, 108, -1, 97,
+ 35, 58, 116, 114, -1, 121, 110, 35, 35, 35, 115, -1, 35, 35, 101, 116,
+ -1, 35, 101, 35, 35, -1, 35, -1, -1, -1, 101, 35, 117, 110, 108, 100, 97,
+ 97, 110, 101, 35, 108, -1, 101, 35, 35, 115, 102, 102, 105, 118, 116, 114,
+ 35, 98, -1, 35, -1, 35, 35, 35, 114, 101, 112, 100, -1, 108, 35, -1, 58,
+ -1, 35, 35, 101, -1, -1, 99, -1, 98, 114, -1, -1, 35, -1, -1, 110, 105,
+ 35, -1, 114, 35, 97, -1, 97, -1, 101, 114, 116, 101, 105, -1, 116, 35,
+ 116, -1, -1, 98, 108, -1, -1, 101, 35, -1, 35, 101, 116, 58, 101, 35, -1,
+ 35, 101, 58, 114, 121, 101, 112, -1, -1, -1, 58, -1, 35, 101, 99, -1, -1,
+ 105, 58, 58, 35, -1, -1, -1, 116, 116, -1, -1, 114, 35, 114, -1, 35, -1,
+ -1, -1, 35, -1, 102, 118, 111, 118, 118, 114, 97, 35, -1, 35, 35, -1, -1,
+ 116, 111, 111, 99, 35, 35, 35, -1, 117, 110, 108, 100, 97, -1, 103, -1,
+ -1, -1, 101, 100, 101, 58, 35, -1, -1, -1, -1, 35, 104, 101, 115, 97, 107,
+ -1, 116, 111, -1, 35, -1, 108, 108, 35, 58, 101, 110, 110, 105, -1, 121,
+ 108, 35, 35, -1, -1, 58, 105, -1, 35, -1, -1, 114, -1, 101, 58, 100, 101,
+ -1, -1, -1, 35, 104, 111, -1, -1, -1, 35, 111, 35, -1, 35, -1, -1, 102,
+ 35, 119, 35, 101, 35, 98, -1, -1, -1, -1, 35, 35, 35, 105, -1, -1, -1,
+ 102, 118, 111, 118, 114, 101, 35, 35, 35, -1, -1, -1, 105, 105, 35, 115,
+ 108, 35, 35, 110, -1, 35, 35, -1, -1, 35, 99, 116, 111, 35, 101, -1, -1,
+ -1, 111, -1, 58, 58, -1, 58, 58, -1, 105, 110, -1, 35, -1, -1, 101, -1,
+ 35, -1, 35, -1, 108, -1, -1, -1, 116, 102, 35, 119, 35, 35, 114, -1, -1,
+ -1, 110, 110, -1, 35, 108, -1, -1, 35, -1, -1, -1, -1, 121, 35, 110, -1,
+ 58, 110, -1, -1, -1, -1, 110, 58, -1, 114, -1, -1, 101, 121, 101, -1, 35,
+ -1, -1, 35, 101, 103, -1, 35, -1, 35, -1, 58, -1, 58, 101, -1, 35, 100,
+ 58, 114, -1, -1, 35, 35, -1, -1, -1, -1, 58, -1, 35, -1, 35, -1, -1, -1,
+ -1, -1
+ };
+static const ANTLR3_INT32 dfa50_max[1484] =
+ {
+ 126, 116, 123, 62, 61, 61, 122, 118, 117, 116, 121, 120, 117, 117, 110,
+ 111, 105, 117, 117, 117, 117, 118, 121, 121, 114, 111, 104, 167, 62, 61,
+ 62, 58, 37, 58, 93, 124, -1, 123, -1, -1, -1, 95, 61, 61, 111, 61, 61,
+ 61, -1, 102, -1, -1, -1, -1, -1, -1, -1, 110, -1, 116, -1, -1, 116, -1,
+ -1, 117, -1, -1, -1, 62, -1, 58, -1, -1, 62, 61, 61, -1, 62, -1, -1, -1,
+ 98, 101, 114, 105, 120, 111, 117, 101, 114, 111, 117, 117, 117, 121, 114,
+ 108, -1, -1, 115, 116, 121, 114, 109, 110, 111, 111, 102, 108, 111, 111,
+ 110, 120, 115, 115, 122, 105, 110, 115, 118, 101, 105, 108, 110, 111, 114,
+ 111, 110, 116, 97, 98, 105, 110, 122, 122, 105, 109, 115, 120, 115, 100,
+ 108, 119, 108, 116, 101, 122, 116, 114, 115, 111, 98, 116, 118, 116, 117,
+ 99, 110, 101, 104, 116, 122, 108, 114, 115, 115, 117, 109, 58, 117, 112,
+ 111, 108, 110, 115, 101, 114, 99, 97, 108, 105, 105, 62, -1, 124, -1, 59,
+ -1, -1, -1, 124, 114, 124, -1, -1, -1, 111, -1, -1, -1, 61, -1, -1, 62,
+ -1, -1, 62, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 58, -1, 58, -1, -1, -1, -1, 61, 58, -1, -1, -1, -1, 114, 58, -1, -1,
+ -1, 58, -1, -1, 58, -1, -1, -1, 105, 102, 105, -1, 115, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, -1, -1, -1, -1, -1, 111,
+ 104, 110, 101, 99, 118, 102, 97, 101, 110, 108, 114, 97, 97, 98, 105, 110,
+ 112, 116, 117, 99, 101, 95, 116, 116, 114, 111, 98, 116, 117, 99, 110,
+ 104, 111, 115, 117, 105, 115, 105, 114, 101, 105, 122, 99, 97, 99, 100,
+ 108, 97, 97, 102, 108, 114, 99, 105, 115, 99, 116, 109, 114, 58, 116, 97,
+ 98, -1, 109, 97, 101, 98, 109, 122, 110, 116, 115, 111, 97, 119, 122, 109,
+ 122, 111, 114, 111, 115, 97, -1, 116, 117, 117, 116, 122, -1, 110, 98,
+ 111, 116, 114, 58, 115, 58, 101, 116, 122, 108, 122, 114, 101, -1, 122,
+ 107, 101, 116, 95, 115, 118, 118, 108, 122, 122, 122, 108, 122, 117, 117,
+ 116, 122, 122, 99, 101, 102, 122, 110, 101, 118, 116, 112, 112, 117, 112,
+ 116, 97, 101, -1, 110, 101, 101, 117, 111, 116, 118, 97, 116, 97, 122,
+ 122, 116, 122, 97, 116, 108, -1, -1, -1, -1, -1, 100, -1, 124, -1, 124,
+ -1, -1, -1, 58, -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, -1, -1, -1, -1,
+ -1, 58, -1, -1, -1, 122, -1, -1, -1, -1, 116, -1, -1, -1, -1, 114, 97,
+ 112, 115, 97, 108, 97, 101, 101, 98, 99, 97, 122, 109, 114, 100, 111, 115,
+ 97, 111, 108, 116, 117, 117, 116, 101, 110, 114, 58, 101, 58, 119, 105,
+ 112, 107, 97, 118, 116, 108, 105, 117, 116, 122, 122, 101, 116, 112, 116,
+ 97, 110, 103, 108, 112, 97, 116, 110, 118, 116, -1, 97, 121, 111, 122,
+ 122, 107, 100, 101, 122, 110, 122, 107, 99, 115, 107, 101, 116, 105, 101,
+ 122, -1, 114, 98, 108, 101, 109, 122, 108, 122, -1, 116, 122, 101, 122,
+ 108, 116, 122, 122, -1, 58, -1, 122, 100, 114, 97, 98, 122, 116, 116, 97,
+ 114, -1, 122, 100, 108, 122, 122, 105, 111, -1, 97, -1, 108, 105, -1, 122,
+ 97, 108, 117, -1, 97, 110, 122, 105, 101, 114, 97, 97, 101, 111, 105, 105,
+ -1, 111, -1, -1, 122, -1, 97, 109, 114, 105, -1, -1, 116, 100, 122, -1,
+ 97, 58, 101, 116, 117, 95, 122, 110, 99, 101, 101, 114, 122, 115, 122,
+ 122, 98, 97, 122, 97, 110, 101, 102, 122, 108, -1, -1, 111, -1, 116, 122,
+ 101, 124, -1, -1, -1, -1, -1, -1, -1, -1, 105, 116, 118, -1, 111, 117,
+ 116, 116, 97, 98, 114, 99, 108, 117, 108, -1, 97, 100, 101, 114, 97, 98,
+ 114, 117, 122, 116, 116, 97, 114, 122, 105, 111, -1, 108, -1, 114, 111,
+ 117, 97, 109, 97, 101, 101, 111, 105, 111, 114, 105, -1, -1, 100, 116,
+ 101, 122, 101, 114, 115, 103, 122, 122, 122, 122, 116, 105, 104, 115, 122,
+ 100, -1, -1, 97, -1, 122, 99, 114, -1, 101, 101, 99, -1, 115, 101, 122,
+ 122, 99, 122, 110, 122, -1, 111, 108, 101, 122, 105, 102, -1, 101, -1,
+ 122, -1, 122, -1, 122, 122, -1, -1, -1, -1, 122, 116, 98, 108, -1, -1,
+ 122, 122, 110, 101, 118, -1, 97, 105, -1, -1, 110, 122, 103, 122, 115,
+ -1, -1, 116, 115, 116, 103, 116, -1, 110, 110, 58, 116, 58, 100, 99, 116,
+ 100, 99, 110, -1, 114, 101, 110, 122, 110, 111, 117, -1, 108, -1, 114,
+ 122, 122, 99, 115, 109, -1, 103, 116, 110, 109, 100, 122, -1, 105, -1,
+ -1, 108, 116, 103, -1, 115, 122, 114, 101, 111, -1, 122, 114, 105, -1,
+ 122, -1, -1, -1, -1, 122, 105, 115, 114, 114, 101, 114, 108, 115, 116,
+ 101, 116, 122, 108, 58, 114, 116, 98, 108, 116, 100, -1, 58, 58, 110, 97,
+ -1, 110, 58, 58, 105, 110, 116, 103, 101, 116, 100, 114, 99, 116, 99, 110,
+ 110, 110, 117, 122, 109, -1, 109, 100, 105, 101, -1, -1, -1, -1, 122, 116,
+ 101, 116, -1, 101, 110, -1, 97, 122, 100, 108, 116, 97, 122, -1, -1, 116,
+ -1, 117, -1, 121, 101, 122, -1, 99, 122, 122, -1, -1, -1, -1, -1, 122,
+ 108, 101, -1, 118, 101, -1, 99, 114, 97, 122, 110, 101, -1, 101, -1, -1,
+ 97, 105, 105, 108, 100, 101, 111, 101, 122, 101, 122, 116, 116, -1, 101,
+ -1, 117, 116, 121, 101, 122, 97, 116, 122, 122, -1, 101, 114, 108, 122,
+ 58, -1, 97, -1, 122, 35, 97, 122, 122, 100, 122, 122, -1, 116, 101, 122,
+ 101, 116, -1, 115, 122, 110, -1, 122, 108, -1, -1, 111, 105, 114, 97, 122,
+ 97, 101, 105, 58, 122, 97, -1, 109, -1, 58, 122, 108, 101, 58, 101, -1,
+ -1, 99, 99, 101, -1, -1, 116, 115, 58, 101, -1, 116, 101, 117, 116, 116,
+ 121, 58, 58, 122, 101, 108, -1, 97, 122, 58, 116, 114, -1, 121, 110, 122,
+ 122, 122, 115, -1, 122, 122, 101, 116, -1, 122, 101, 122, 122, -1, 122,
+ -1, -1, -1, 101, 122, 117, 110, 108, 100, 97, 97, 110, 101, 122, 108, -1,
+ 101, 122, 122, 115, 102, 102, 105, 118, 116, 114, 122, 118, -1, 122, -1,
+ 122, 122, 122, 114, 101, 112, 100, -1, 108, 122, -1, 58, -1, 122, 122,
+ 101, -1, -1, 99, -1, 119, 114, -1, -1, 122, -1, -1, 110, 105, 122, -1,
+ 114, 122, 97, -1, 97, -1, 101, 114, 116, 101, 105, -1, 116, 122, 116, -1,
+ -1, 98, 108, -1, -1, 101, 122, -1, 122, 101, 116, 58, 101, 122, -1, 122,
+ 101, 58, 114, 121, 101, 112, -1, -1, -1, 58, -1, 122, 101, 99, -1, -1,
+ 105, 58, 58, 122, -1, -1, -1, 116, 116, -1, -1, 114, 122, 114, -1, 122,
+ -1, -1, -1, 122, -1, 102, 118, 111, 118, 118, 114, 97, 122, -1, 122, 122,
+ -1, -1, 116, 111, 111, 99, 122, 122, 122, -1, 117, 110, 108, 100, 97, -1,
+ 103, -1, -1, -1, 101, 100, 101, 58, 122, -1, -1, -1, -1, 122, 104, 101,
+ 115, 105, 107, -1, 116, 111, -1, 122, -1, 108, 108, 122, 58, 101, 110,
+ 110, 105, -1, 121, 108, 122, 122, -1, -1, 58, 105, -1, 122, -1, -1, 114,
+ -1, 101, 58, 100, 101, -1, -1, -1, 122, 104, 111, -1, -1, -1, 122, 111,
+ 122, -1, 122, -1, -1, 102, 122, 119, 122, 101, 122, 98, -1, -1, -1, -1,
+ 122, 122, 122, 105, -1, -1, -1, 102, 118, 111, 118, 114, 101, 122, 122,
+ 122, -1, -1, -1, 105, 105, 122, 115, 108, 122, 122, 110, -1, 122, 122,
+ -1, -1, 122, 99, 116, 111, 122, 101, -1, -1, -1, 111, -1, 58, 58, -1, 58,
+ 58, -1, 105, 110, -1, 122, -1, -1, 101, -1, 122, -1, 122, -1, 108, -1,
+ -1, -1, 116, 102, 122, 119, 122, 122, 114, -1, -1, -1, 110, 110, -1, 122,
+ 108, -1, -1, 122, -1, -1, -1, -1, 121, 122, 110, -1, 58, 110, -1, -1, -1,
+ -1, 110, 58, -1, 114, -1, -1, 101, 121, 101, -1, 122, -1, -1, 122, 101,
+ 103, -1, 122, -1, 122, -1, 58, -1, 58, 101, -1, 122, 100, 58, 114, -1,
+ -1, 122, 122, -1, -1, -1, -1, 58, -1, 122, -1, 122, -1, -1, -1, -1, -1
+ };
+static const ANTLR3_INT32 dfa50_accept[1484] =
+ {
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 310, -1, 327, 328, 329, -1, -1, -1, -1, -1, -1, -1, 379, -1, 388, 389,
+ 390, 386, 392, 1, 2, -1, 5, -1, 10, 330, -1, 15, 16, -1, 19, 318, 331,
+ -1, 21, -1, 358, 357, -1, -1, -1, 350, -1, 298, 348, 297, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 26, 387, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 275, -1, 277, -1, 279, 280, 281, -1, -1,
+ -1, 289, 290, 291, -1, 323, 381, 380, -1, 317, 326, -1, 384, 383, -1, -1,
+ 352, 312, 305, 316, 306, 313, 307, 319, 321, 325, 308, 311, 322, 324, 309,
+ -1, 320, -1, 368, 367, 333, 332, -1, -1, 377, 376, 346, 339, -1, -1, 354,
+ 356, 353, -1, 362, 361, -1, 365, 391, 364, -1, -1, -1, 6, -1, 11, 12, 13,
+ 14, 17, 18, 20, 360, 359, 22, 23, 299, 24, 301, 349, -1, 374, 373, 25,
+ 347, 345, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 126, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 151, -1, -1,
+ -1, -1, -1, 152, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 191, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 251, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 274, 382, 276, 278, 284, -1, 285, -1, 288, -1, 294, 295, 296, -1, 342,
+ 340, 300, 334, 302, 303, 385, 304, 351, -1, 371, 370, 314, 315, 369, -1,
+ 337, 335, 378, -1, 355, 363, 366, 386, -1, 7, 8, 9, 375, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 96, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 123, -1, -1, -1, -1, -1, -1, -1, -1, 134, -1, -1, -1, -1, -1,
+ -1, -1, -1, 142, -1, 145, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 166,
+ -1, -1, -1, -1, -1, -1, -1, 176, -1, 178, -1, -1, 187, -1, -1, -1, -1,
+ 192, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 213, -1, 214, 216,
+ -1, 218, -1, -1, -1, -1, 225, 226, -1, -1, -1, 230, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 267, 268, -1, 270, -1, -1, -1, -1, 283, 287, 292, 293, 343, 372,
+ 338, 344, -1, -1, -1, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 42,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, -1,
+ 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 80, 81, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 101, 100,
+ -1, 102, -1, -1, -1, 107, -1, -1, -1, 111, -1, -1, -1, -1, -1, -1, -1,
+ -1, 122, -1, -1, -1, -1, -1, -1, 130, -1, 133, -1, 136, -1, 138, -1, -1,
+ 141, 143, 144, 146, -1, -1, -1, -1, 154, 153, -1, -1, -1, -1, -1, 169,
+ -1, -1, 172, 173, -1, -1, -1, -1, -1, 189, 188, -1, -1, -1, -1, -1, 201,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 217, -1, -1, -1, -1, -1, -1,
+ -1, 229, -1, 232, -1, -1, -1, -1, -1, -1, 243, -1, -1, -1, -1, -1, -1,
+ 249, -1, 254, 255, -1, -1, -1, 258, -1, -1, -1, -1, -1, 264, -1, -1, -1,
+ 272, -1, 282, 286, 4, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, -1, -1, -1, -1, 56, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 85,
+ -1, -1, -1, -1, 90, 91, 92, 93, -1, -1, -1, -1, 98, -1, -1, 104, -1, -1,
+ -1, -1, -1, -1, -1, 115, 116, -1, 119, -1, 121, -1, -1, -1, 128, -1, -1,
+ -1, 135, 137, 139, 140, 147, -1, -1, -1, 155, -1, -1, 162, -1, -1, -1,
+ -1, -1, -1, 175, -1, 180, 179, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 205, -1, 207, -1, -1, -1, -1, -1, -1, -1, -1, -1, 223, -1,
+ -1, -1, -1, -1, 234, -1, 235, -1, -1, -1, -1, -1, -1, -1, -1, 250, -1,
+ -1, -1, -1, -1, 261, -1, -1, -1, 266, -1, -1, 273, 27, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 41, -1, 44, -1, -1, -1, -1, -1, -1, 52, 53,
+ -1, -1, -1, 58, 60, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 83, -1, -1, -1, -1, -1, 94, -1, -1, -1, -1, -1, -1, 106, -1,
+ -1, -1, -1, 114, -1, -1, -1, -1, 127, -1, 131, 132, 148, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 170, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 198, -1, 200, -1, -1, -1, -1, -1, -1, -1, 212, -1, -1, 220,
+ -1, 221, -1, -1, -1, 231, 233, -1, 237, -1, -1, 244, 245, -1, 247, 248,
+ -1, -1, -1, 257, -1, -1, -1, 263, -1, 269, -1, -1, -1, -1, -1, 34, -1,
+ -1, -1, 38, 39, -1, -1, 45, 46, -1, -1, 49, -1, -1, -1, -1, -1, -1, 64,
+ -1, -1, -1, -1, -1, -1, -1, 73, 74, 76, -1, 75, -1, -1, -1, 86, 87, -1,
+ -1, -1, -1, 97, 99, 103, -1, -1, 109, 110, -1, -1, -1, 117, -1, 124, 125,
+ 129, -1, 150, -1, -1, -1, -1, -1, -1, -1, -1, 167, -1, -1, 174, 177, -1,
+ -1, -1, -1, -1, -1, -1, 341, -1, -1, -1, -1, -1, 199, -1, 202, 204, 206,
+ -1, -1, -1, -1, -1, 219, 222, 224, 227, -1, -1, -1, -1, -1, -1, 246, -1,
+ -1, 256, -1, 260, -1, -1, -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, -1, 48,
+ 50, -1, -1, 57, -1, 63, 65, -1, 68, -1, -1, -1, -1, 77, 79, 78, -1, -1,
+ -1, 89, 95, 336, -1, -1, -1, 113, -1, 120, 149, -1, -1, -1, -1, -1, -1,
+ -1, 165, 164, 168, 171, -1, -1, -1, -1, 185, 186, 190, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 211, 215, 228, -1, -1, -1, -1, -1, -1, -1, -1, 259,
+ -1, -1, 271, 28, -1, -1, -1, -1, -1, -1, 43, 47, 54, -1, 62, -1, -1, 70,
+ -1, -1, 82, -1, -1, 105, -1, 112, 118, -1, 157, -1, 159, -1, 161, -1, 181,
+ 182, 183, -1, -1, -1, -1, -1, -1, -1, 208, 209, 210, -1, -1, 239, -1, -1,
+ 242, 252, -1, 262, 265, 31, 30, -1, -1, -1, 37, -1, -1, 67, 69, 71, 72,
+ -1, -1, 108, -1, 158, 160, -1, -1, -1, 194, -1, 196, 197, -1, -1, -1, 240,
+ -1, 253, -1, 33, -1, 40, -1, -1, 88, -1, -1, -1, -1, 195, 203, -1, -1,
+ 241, 32, 35, 55, -1, 156, -1, 184, -1, 236, 238, 84, 163, 193
+ };
+static const ANTLR3_INT32 dfa50_special[1484] =
+ {
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1
+ };
+
+/** Used when there is no transition table entry for a particular state */
+#define dfa50_T_empty NULL
+
+static const ANTLR3_INT32 dfa50_T0[] =
+ {
+ 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T1[] =
+ {
+ 607
+ };
+
+static const ANTLR3_INT32 dfa50_T2[] =
+ {
+ 810
+ };
+
+static const ANTLR3_INT32 dfa50_T3[] =
+ {
+ 986
+ };
+
+static const ANTLR3_INT32 dfa50_T4[] =
+ {
+ 1131
+ };
+
+static const ANTLR3_INT32 dfa50_T5[] =
+ {
+ 608
+ };
+
+static const ANTLR3_INT32 dfa50_T6[] =
+ {
+ 811
+ };
+
+static const ANTLR3_INT32 dfa50_T7[] =
+ {
+ 987
+ };
+
+static const ANTLR3_INT32 dfa50_T8[] =
+ {
+ 609
+ };
+
+static const ANTLR3_INT32 dfa50_T9[] =
+ {
+ 456
+ };
+
+static const ANTLR3_INT32 dfa50_T10[] =
+ {
+ 1351
+ };
+
+static const ANTLR3_INT32 dfa50_T11[] =
+ {
+ 1410
+ };
+
+static const ANTLR3_INT32 dfa50_T12[] =
+ {
+ 1449
+ };
+
+static const ANTLR3_INT32 dfa50_T13[] =
+ {
+ 586
+ };
+
+static const ANTLR3_INT32 dfa50_T14[] =
+ {
+ 792
+ };
+
+static const ANTLR3_INT32 dfa50_T15[] =
+ {
+ 297, -1, 298, -1, -1, -1, -1, 299
+ };
+
+static const ANTLR3_INT32 dfa50_T16[] =
+ {
+ 967
+ };
+
+static const ANTLR3_INT32 dfa50_T17[] =
+ {
+ 611
+ };
+
+static const ANTLR3_INT32 dfa50_T18[] =
+ {
+ 814
+ };
+
+static const ANTLR3_INT32 dfa50_T19[] =
+ {
+ 1114
+ };
+
+static const ANTLR3_INT32 dfa50_T20[] =
+ {
+ 989
+ };
+
+static const ANTLR3_INT32 dfa50_T21[] =
+ {
+ 1134
+ };
+
+static const ANTLR3_INT32 dfa50_T22[] =
+ {
+ 1240
+ };
+
+static const ANTLR3_INT32 dfa50_T23[] =
+ {
+ 231, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 233, -1, -1, 232
+ };
+
+static const ANTLR3_INT32 dfa50_T24[] =
+ {
+ 240, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, -1, -1,
+ 238
+ };
+
+static const ANTLR3_INT32 dfa50_T25[] =
+ {
+ 815
+ };
+
+static const ANTLR3_INT32 dfa50_T26[] =
+ {
+ 990
+ };
+
+static const ANTLR3_INT32 dfa50_T27[] =
+ {
+ 816
+ };
+
+static const ANTLR3_INT32 dfa50_T28[] =
+ {
+ 991
+ };
+
+static const ANTLR3_INT32 dfa50_T29[] =
+ {
+ 1135
+ };
+
+static const ANTLR3_INT32 dfa50_T30[] =
+ {
+ 307, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 308,
+ -1, -1, -1, -1, 309
+ };
+
+static const ANTLR3_INT32 dfa50_T31[] =
+ {
+ 817
+ };
+
+static const ANTLR3_INT32 dfa50_T32[] =
+ {
+ 992
+ };
+
+static const ANTLR3_INT32 dfa50_T33[] =
+ {
+ 818
+ };
+
+static const ANTLR3_INT32 dfa50_T34[] =
+ {
+ 993
+ };
+
+static const ANTLR3_INT32 dfa50_T35[] =
+ {
+ 1136
+ };
+
+static const ANTLR3_INT32 dfa50_T36[] =
+ {
+ 1264
+ };
+
+static const ANTLR3_INT32 dfa50_T37[] =
+ {
+ 1352
+ };
+
+static const ANTLR3_INT32 dfa50_T38[] =
+ {
+ 994
+ };
+
+static const ANTLR3_INT32 dfa50_T39[] =
+ {
+ 1137
+ };
+
+static const ANTLR3_INT32 dfa50_T40[] =
+ {
+ 793, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 794
+ };
+
+static const ANTLR3_INT32 dfa50_T41[] =
+ {
+ 1265
+ };
+
+static const ANTLR3_INT32 dfa50_T42[] =
+ {
+ 1353
+ };
+
+static const ANTLR3_INT32 dfa50_T43[] =
+ {
+ 289, -1, -1, 290, 291, -1, -1, -1, -1, -1, -1, -1, 292, 293, -1, -1, -1,
+ 294
+ };
+
+static const ANTLR3_INT32 dfa50_T44[] =
+ {
+ 995
+ };
+
+static const ANTLR3_INT32 dfa50_T45[] =
+ {
+ 1138
+ };
+
+static const ANTLR3_INT32 dfa50_T46[] =
+ {
+ 1266
+ };
+
+static const ANTLR3_INT32 dfa50_T47[] =
+ {
+ 1354
+ };
+
+static const ANTLR3_INT32 dfa50_T48[] =
+ {
+ 821
+ };
+
+static const ANTLR3_INT32 dfa50_T49[] =
+ {
+ 996
+ };
+
+static const ANTLR3_INT32 dfa50_T50[] =
+ {
+ 1139
+ };
+
+static const ANTLR3_INT32 dfa50_T51[] =
+ {
+ 1267
+ };
+
+static const ANTLR3_INT32 dfa50_T52[] =
+ {
+ 1355
+ };
+
+static const ANTLR3_INT32 dfa50_T53[] =
+ {
+ 391
+ };
+
+static const ANTLR3_INT32 dfa50_T54[] =
+ {
+ 618
+ };
+
+static const ANTLR3_INT32 dfa50_T55[] =
+ {
+ 822
+ };
+
+static const ANTLR3_INT32 dfa50_T56[] =
+ {
+ 997
+ };
+
+static const ANTLR3_INT32 dfa50_T57[] =
+ {
+ 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 53, 53, 53, 53, 1260, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T58[] =
+ {
+ 823
+ };
+
+static const ANTLR3_INT32 dfa50_T59[] =
+ {
+ 998
+ };
+
+static const ANTLR3_INT32 dfa50_T60[] =
+ {
+ 1141
+ };
+
+static const ANTLR3_INT32 dfa50_T61[] =
+ {
+ 1268
+ };
+
+static const ANTLR3_INT32 dfa50_T62[] =
+ {
+ 394
+ };
+
+static const ANTLR3_INT32 dfa50_T63[] =
+ {
+ 623
+ };
+
+static const ANTLR3_INT32 dfa50_T64[] =
+ {
+ 591, -1, -1, -1, -1, -1, -1, -1, -1, -1, 592
+ };
+
+static const ANTLR3_INT32 dfa50_T65[] =
+ {
+ 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 338, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T66[] =
+ {
+ 139, -1, -1, -1, 140, -1, -1, -1, -1, -1, -1, -1, -1, -1, 141, -1, -1,
+ -1, -1, -1, 142
+ };
+
+static const ANTLR3_INT32 dfa50_T67[] =
+ {
+ 825
+ };
+
+static const ANTLR3_INT32 dfa50_T68[] =
+ {
+ 999
+ };
+
+static const ANTLR3_INT32 dfa50_T69[] =
+ {
+ 1142
+ };
+
+static const ANTLR3_INT32 dfa50_T70[] =
+ {
+ 826
+ };
+
+static const ANTLR3_INT32 dfa50_T71[] =
+ {
+ 409, -1, -1, -1, 410, -1, -1, -1, -1, -1, -1, -1, -1, -1, 411, -1, -1,
+ 412
+ };
+
+static const ANTLR3_INT32 dfa50_T72[] =
+ {
+ 1000
+ };
+
+static const ANTLR3_INT32 dfa50_T73[] =
+ {
+ 69, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 72, -1, -1, 71, 70
+ };
+
+static const ANTLR3_INT32 dfa50_T74[] =
+ {
+ 1270
+ };
+
+static const ANTLR3_INT32 dfa50_T75[] =
+ {
+ 594, -1, -1, -1, -1, -1, -1, -1, -1, -1, 595
+ };
+
+static const ANTLR3_INT32 dfa50_T76[] =
+ {
+ 1003
+ };
+
+static const ANTLR3_INT32 dfa50_T77[] =
+ {
+ 1146
+ };
+
+static const ANTLR3_INT32 dfa50_T78[] =
+ {
+ 400
+ };
+
+static const ANTLR3_INT32 dfa50_T79[] =
+ {
+ 722
+ };
+
+static const ANTLR3_INT32 dfa50_T80[] =
+ {
+ 401
+ };
+
+static const ANTLR3_INT32 dfa50_T81[] =
+ {
+ 913
+ };
+
+static const ANTLR3_INT32 dfa50_T82[] =
+ {
+ 119, -1, 120, -1, -1, -1, -1, -1, -1, -1, 121, -1, 122
+ };
+
+static const ANTLR3_INT32 dfa50_T83[] =
+ {
+ 505
+ };
+
+static const ANTLR3_INT32 dfa50_T84[] =
+ {
+ 1074
+ };
+
+static const ANTLR3_INT32 dfa50_T85[] =
+ {
+ 177, -1, -1, -1, 178, -1, -1, -1, 179, -1, -1, -1, -1, -1, 180
+ };
+
+static const ANTLR3_INT32 dfa50_T86[] =
+ {
+ 706, -1, -1, -1, -1, -1, -1, -1, -1, -1, 707
+ };
+
+static const ANTLR3_INT32 dfa50_T87[] =
+ {
+ 402
+ };
+
+static const ANTLR3_INT32 dfa50_T88[] =
+ {
+ 631
+ };
+
+static const ANTLR3_INT32 dfa50_T89[] =
+ {
+ 830
+ };
+
+static const ANTLR3_INT32 dfa50_T90[] =
+ {
+ 1004
+ };
+
+static const ANTLR3_INT32 dfa50_T91[] =
+ {
+ 1147
+ };
+
+static const ANTLR3_INT32 dfa50_T92[] =
+ {
+ 403
+ };
+
+static const ANTLR3_INT32 dfa50_T93[] =
+ {
+ 632
+ };
+
+static const ANTLR3_INT32 dfa50_T94[] =
+ {
+ 831
+ };
+
+static const ANTLR3_INT32 dfa50_T95[] =
+ {
+ 1005
+ };
+
+static const ANTLR3_INT32 dfa50_T96[] =
+ {
+ 469
+ };
+
+static const ANTLR3_INT32 dfa50_T97[] =
+ {
+ 1148
+ };
+
+static const ANTLR3_INT32 dfa50_T98[] =
+ {
+ 1273
+ };
+
+static const ANTLR3_INT32 dfa50_T99[] =
+ {
+ 633
+ };
+
+static const ANTLR3_INT32 dfa50_T100[] =
+ {
+ 181, -1, -1, -1, -1, -1, -1, 182
+ };
+
+static const ANTLR3_INT32 dfa50_T101[] =
+ {
+ 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 53, 53, 53, 53, 53, 53, 53, 53, 770, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T102[] =
+ {
+ 277, -1, -1, 278
+ };
+
+static const ANTLR3_INT32 dfa50_T103[] =
+ {
+ 635
+ };
+
+static const ANTLR3_INT32 dfa50_T104[] =
+ {
+ 833
+ };
+
+static const ANTLR3_INT32 dfa50_T105[] =
+ {
+ 1006
+ };
+
+static const ANTLR3_INT32 dfa50_T106[] =
+ {
+ 636
+ };
+
+static const ANTLR3_INT32 dfa50_T107[] =
+ {
+ 834
+ };
+
+static const ANTLR3_INT32 dfa50_T108[] =
+ {
+ 149, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 150, -1, -1, 151,
+ -1, -1, 152
+ };
+
+static const ANTLR3_INT32 dfa50_T109[] =
+ {
+ 408
+ };
+
+static const ANTLR3_INT32 dfa50_T110[] =
+ {
+ 637
+ };
+
+static const ANTLR3_INT32 dfa50_T111[] =
+ {
+ 599
+ };
+
+static const ANTLR3_INT32 dfa50_T112[] =
+ {
+ 835
+ };
+
+static const ANTLR3_INT32 dfa50_T113[] =
+ {
+ 1007
+ };
+
+static const ANTLR3_INT32 dfa50_T114[] =
+ {
+ 803
+ };
+
+static const ANTLR3_INT32 dfa50_T115[] =
+ {
+ 1150
+ };
+
+static const ANTLR3_INT32 dfa50_T116[] =
+ {
+ 836
+ };
+
+static const ANTLR3_INT32 dfa50_T117[] =
+ {
+ 455, -1, 453, -1, 454
+ };
+
+static const ANTLR3_INT32 dfa50_T118[] =
+ {
+ 1151
+ };
+
+static const ANTLR3_INT32 dfa50_T119[] =
+ {
+ 1274
+ };
+
+static const ANTLR3_INT32 dfa50_T120[] =
+ {
+ 1358
+ };
+
+static const ANTLR3_INT32 dfa50_T121[] =
+ {
+ 1414
+ };
+
+static const ANTLR3_INT32 dfa50_T122[] =
+ {
+ 1450
+ };
+
+static const ANTLR3_INT32 dfa50_T123[] =
+ {
+ 1468
+ };
+
+static const ANTLR3_INT32 dfa50_T124[] =
+ {
+ 1011
+ };
+
+static const ANTLR3_INT32 dfa50_T125[] =
+ {
+ 62, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 64, -1, -1, 65, 66, -1, -1, -1, -1, -1, -1, 67
+ };
+
+static const ANTLR3_INT32 dfa50_T126[] =
+ {
+ 1359
+ };
+
+static const ANTLR3_INT32 dfa50_T127[] =
+ {
+ 1415
+ };
+
+static const ANTLR3_INT32 dfa50_T128[] =
+ {
+ 1451
+ };
+
+static const ANTLR3_INT32 dfa50_T129[] =
+ {
+ 1469
+ };
+
+static const ANTLR3_INT32 dfa50_T130[] =
+ {
+ 1360
+ };
+
+static const ANTLR3_INT32 dfa50_T131[] =
+ {
+ 262
+ };
+
+static const ANTLR3_INT32 dfa50_T132[] =
+ {
+ 317, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 318
+ };
+
+static const ANTLR3_INT32 dfa50_T133[] =
+ {
+ 1417
+ };
+
+static const ANTLR3_INT32 dfa50_T134[] =
+ {
+ 440, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 441
+ };
+
+static const ANTLR3_INT32 dfa50_T135[] =
+ {
+ 1418
+ };
+
+static const ANTLR3_INT32 dfa50_T136[] =
+ {
+ 1453
+ };
+
+static const ANTLR3_INT32 dfa50_T137[] =
+ {
+ 105, -1, -1, -1, -1, -1, 106, -1, -1, 107, -1, -1, 108
+ };
+
+static const ANTLR3_INT32 dfa50_T138[] =
+ {
+ 640
+ };
+
+static const ANTLR3_INT32 dfa50_T139[] =
+ {
+ 840
+ };
+
+static const ANTLR3_INT32 dfa50_T140[] =
+ {
+ 1013
+ };
+
+static const ANTLR3_INT32 dfa50_T141[] =
+ {
+ 1154
+ };
+
+static const ANTLR3_INT32 dfa50_T142[] =
+ {
+ 1278
+ };
+
+static const ANTLR3_INT32 dfa50_T143[] =
+ {
+ 205, -1, -1, 204
+ };
+
+static const ANTLR3_INT32 dfa50_T144[] =
+ {
+ 1363
+ };
+
+static const ANTLR3_INT32 dfa50_T145[] =
+ {
+ 243, -1, -1, 242
+ };
+
+static const ANTLR3_INT32 dfa50_T146[] =
+ {
+ 424, -1, -1, -1, -1, -1, -1, -1, -1, -1, 425
+ };
+
+static const ANTLR3_INT32 dfa50_T147[] =
+ {
+ 436, -1, -1, -1, 435
+ };
+
+static const ANTLR3_INT32 dfa50_T148[] =
+ {
+ 641
+ };
+
+static const ANTLR3_INT32 dfa50_T149[] =
+ {
+ 842
+ };
+
+static const ANTLR3_INT32 dfa50_T150[] =
+ {
+ 1014
+ };
+
+static const ANTLR3_INT32 dfa50_T151[] =
+ {
+ 715
+ };
+
+static const ANTLR3_INT32 dfa50_T152[] =
+ {
+ 843
+ };
+
+static const ANTLR3_INT32 dfa50_T153[] =
+ {
+ 905
+ };
+
+static const ANTLR3_INT32 dfa50_T154[] =
+ {
+ 1015
+ };
+
+static const ANTLR3_INT32 dfa50_T155[] =
+ {
+ 1065, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 1066
+ };
+
+static const ANTLR3_INT32 dfa50_T156[] =
+ {
+ 413
+ };
+
+static const ANTLR3_INT32 dfa50_T157[] =
+ {
+ 644
+ };
+
+static const ANTLR3_INT32 dfa50_T158[] =
+ {
+ 844
+ };
+
+static const ANTLR3_INT32 dfa50_T159[] =
+ {
+ 1016
+ };
+
+static const ANTLR3_INT32 dfa50_T160[] =
+ {
+ 1157
+ };
+
+static const ANTLR3_INT32 dfa50_T161[] =
+ {
+ 414
+ };
+
+static const ANTLR3_INT32 dfa50_T162[] =
+ {
+ 645
+ };
+
+static const ANTLR3_INT32 dfa50_T163[] =
+ {
+ 845
+ };
+
+static const ANTLR3_INT32 dfa50_T164[] =
+ {
+ 1017
+ };
+
+static const ANTLR3_INT32 dfa50_T165[] =
+ {
+ 415
+ };
+
+static const ANTLR3_INT32 dfa50_T166[] =
+ {
+ 646
+ };
+
+static const ANTLR3_INT32 dfa50_T167[] =
+ {
+ 846
+ };
+
+static const ANTLR3_INT32 dfa50_T168[] =
+ {
+ 1018
+ };
+
+static const ANTLR3_INT32 dfa50_T169[] =
+ {
+ 470
+ };
+
+static const ANTLR3_INT32 dfa50_T170[] =
+ {
+ 417
+ };
+
+static const ANTLR3_INT32 dfa50_T171[] =
+ {
+ 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 53, 53, 53, 53, 53, 53, 53, 53, 620, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T172[] =
+ {
+ 523, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 524
+ };
+
+static const ANTLR3_INT32 dfa50_T173[] =
+ {
+ 378
+ };
+
+static const ANTLR3_INT32 dfa50_T174[] =
+ {
+ 602
+ };
+
+static const ANTLR3_INT32 dfa50_T175[] =
+ {
+ 1280
+ };
+
+static const ANTLR3_INT32 dfa50_T176[] =
+ {
+ 1364
+ };
+
+static const ANTLR3_INT32 dfa50_T177[] =
+ {
+ 1281
+ };
+
+static const ANTLR3_INT32 dfa50_T178[] =
+ {
+ 1365
+ };
+
+static const ANTLR3_INT32 dfa50_T179[] =
+ {
+ 1421
+ };
+
+static const ANTLR3_INT32 dfa50_T180[] =
+ {
+ 649
+ };
+
+static const ANTLR3_INT32 dfa50_T181[] =
+ {
+ 420
+ };
+
+static const ANTLR3_INT32 dfa50_T182[] =
+ {
+ 650
+ };
+
+static const ANTLR3_INT32 dfa50_T183[] =
+ {
+ 421
+ };
+
+static const ANTLR3_INT32 dfa50_T184[] =
+ {
+ 651
+ };
+
+static const ANTLR3_INT32 dfa50_T185[] =
+ {
+ 852
+ };
+
+static const ANTLR3_INT32 dfa50_T186[] =
+ {
+ 1021
+ };
+
+static const ANTLR3_INT32 dfa50_T187[] =
+ {
+ 1162
+ };
+
+static const ANTLR3_INT32 dfa50_T188[] =
+ {
+ 422
+ };
+
+static const ANTLR3_INT32 dfa50_T189[] =
+ {
+ 478
+ };
+
+static const ANTLR3_INT32 dfa50_T190[] =
+ {
+ 652
+ };
+
+static const ANTLR3_INT32 dfa50_T191[] =
+ {
+ 677
+ };
+
+static const ANTLR3_INT32 dfa50_T192[] =
+ {
+ 303, -1, -1, -1, -1, -1, -1, -1, -1, -1, 304, -1, -1, -1, -1, 305, 306
+ };
+
+static const ANTLR3_INT32 dfa50_T193[] =
+ {
+ 853
+ };
+
+static const ANTLR3_INT32 dfa50_T194[] =
+ {
+ 871
+ };
+
+static const ANTLR3_INT32 dfa50_T195[] =
+ {
+ 1022
+ };
+
+static const ANTLR3_INT32 dfa50_T196[] =
+ {
+ 479
+ };
+
+static const ANTLR3_INT32 dfa50_T197[] =
+ {
+ 678
+ };
+
+static const ANTLR3_INT32 dfa50_T198[] =
+ {
+ 872
+ };
+
+static const ANTLR3_INT32 dfa50_T199[] =
+ {
+ 1034
+ };
+
+static const ANTLR3_INT32 dfa50_T200[] =
+ {
+ 1171
+ };
+
+static const ANTLR3_INT32 dfa50_T201[] =
+ {
+ 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 574, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T202[] =
+ {
+ 99, 99, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, -1, -1, -1, -1, -1, -1, -1, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, -1, -1, -1, -1, 99, -1, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99
+ };
+
+static const ANTLR3_INT32 dfa50_T203[] =
+ {
+ 1288
+ };
+
+static const ANTLR3_INT32 dfa50_T204[] =
+ {
+ 1370
+ };
+
+static const ANTLR3_INT32 dfa50_T205[] =
+ {
+ 1023
+ };
+
+static const ANTLR3_INT32 dfa50_T206[] =
+ {
+ 1164
+ };
+
+static const ANTLR3_INT32 dfa50_T207[] =
+ {
+ 1283
+ };
+
+static const ANTLR3_INT32 dfa50_T208[] =
+ {
+ 909, -1, -1, -1, -1, -1, -1, -1, -1, -1, 910
+ };
+
+static const ANTLR3_INT32 dfa50_T209[] =
+ {
+ 856
+ };
+
+static const ANTLR3_INT32 dfa50_T210[] =
+ {
+ 1024
+ };
+
+static const ANTLR3_INT32 dfa50_T211[] =
+ {
+ 471
+ };
+
+static const ANTLR3_INT32 dfa50_T212[] =
+ {
+ 1165
+ };
+
+static const ANTLR3_INT32 dfa50_T213[] =
+ {
+ 376
+ };
+
+static const ANTLR3_INT32 dfa50_T214[] =
+ {
+ 857
+ };
+
+static const ANTLR3_INT32 dfa50_T215[] =
+ {
+ 600
+ };
+
+static const ANTLR3_INT32 dfa50_T216[] =
+ {
+ 858
+ };
+
+static const ANTLR3_INT32 dfa50_T217[] =
+ {
+ 472
+ };
+
+static const ANTLR3_INT32 dfa50_T218[] =
+ {
+ 1026
+ };
+
+static const ANTLR3_INT32 dfa50_T219[] =
+ {
+ 1166
+ };
+
+static const ANTLR3_INT32 dfa50_T220[] =
+ {
+ 804
+ };
+
+static const ANTLR3_INT32 dfa50_T221[] =
+ {
+ 1285
+ };
+
+static const ANTLR3_INT32 dfa50_T222[] =
+ {
+ 1367
+ };
+
+static const ANTLR3_INT32 dfa50_T223[] =
+ {
+ 977, -1, -1, 978, -1, -1, -1, -1, -1, 979, -1, -1, -1, 980, -1, 981, 982
+ };
+
+static const ANTLR3_INT32 dfa50_T224[] =
+ {
+ 657
+ };
+
+static const ANTLR3_INT32 dfa50_T225[] =
+ {
+ 859
+ };
+
+static const ANTLR3_INT32 dfa50_T226[] =
+ {
+ 874
+ };
+
+static const ANTLR3_INT32 dfa50_T227[] =
+ {
+ 1027
+ };
+
+static const ANTLR3_INT32 dfa50_T228[] =
+ {
+ 1036
+ };
+
+static const ANTLR3_INT32 dfa50_T229[] =
+ {
+ 1173
+ };
+
+static const ANTLR3_INT32 dfa50_T230[] =
+ {
+ 1290
+ };
+
+static const ANTLR3_INT32 dfa50_T231[] =
+ {
+ 1372
+ };
+
+static const ANTLR3_INT32 dfa50_T232[] =
+ {
+ 1426
+ };
+
+static const ANTLR3_INT32 dfa50_T233[] =
+ {
+ 1455
+ };
+
+static const ANTLR3_INT32 dfa50_T234[] =
+ {
+ 875
+ };
+
+static const ANTLR3_INT32 dfa50_T235[] =
+ {
+ 1037
+ };
+
+static const ANTLR3_INT32 dfa50_T236[] =
+ {
+ 1028
+ };
+
+static const ANTLR3_INT32 dfa50_T237[] =
+ {
+ 1174
+ };
+
+static const ANTLR3_INT32 dfa50_T238[] =
+ {
+ 1168
+ };
+
+static const ANTLR3_INT32 dfa50_T239[] =
+ {
+ 1254, -1, -1, 1255, 1256, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1257,
+ -1, -1, -1, 1258
+ };
+
+static const ANTLR3_INT32 dfa50_T240[] =
+ {
+ 1291
+ };
+
+static const ANTLR3_INT32 dfa50_T241[] =
+ {
+ 1286
+ };
+
+static const ANTLR3_INT32 dfa50_T242[] =
+ {
+ 1373
+ };
+
+static const ANTLR3_INT32 dfa50_T243[] =
+ {
+ 1368
+ };
+
+static const ANTLR3_INT32 dfa50_T244[] =
+ {
+ 1427
+ };
+
+static const ANTLR3_INT32 dfa50_T245[] =
+ {
+ 482
+ };
+
+static const ANTLR3_INT32 dfa50_T246[] =
+ {
+ 659
+ };
+
+static const ANTLR3_INT32 dfa50_T247[] =
+ {
+ 683
+ };
+
+static const ANTLR3_INT32 dfa50_T248[] =
+ {
+ 862
+ };
+
+static const ANTLR3_INT32 dfa50_T249[] =
+ {
+ 876
+ };
+
+static const ANTLR3_INT32 dfa50_T250[] =
+ {
+ 1038
+ };
+
+static const ANTLR3_INT32 dfa50_T251[] =
+ {
+ 369, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 370
+ };
+
+static const ANTLR3_INT32 dfa50_T252[] =
+ {
+ 483
+ };
+
+static const ANTLR3_INT32 dfa50_T253[] =
+ {
+ 684
+ };
+
+static const ANTLR3_INT32 dfa50_T254[] =
+ {
+ 201, -1, -1, 81, 202
+ };
+
+static const ANTLR3_INT32 dfa50_T255[] =
+ {
+ 877
+ };
+
+static const ANTLR3_INT32 dfa50_T256[] =
+ {
+ 1039
+ };
+
+static const ANTLR3_INT32 dfa50_T257[] =
+ {
+ 1176
+ };
+
+static const ANTLR3_INT32 dfa50_T258[] =
+ {
+ 1292
+ };
+
+static const ANTLR3_INT32 dfa50_T259[] =
+ {
+ 1374
+ };
+
+static const ANTLR3_INT32 dfa50_T260[] =
+ {
+ 1428
+ };
+
+static const ANTLR3_INT32 dfa50_T261[] =
+ {
+ 1457
+ };
+
+static const ANTLR3_INT32 dfa50_T262[] =
+ {
+ 430
+ };
+
+static const ANTLR3_INT32 dfa50_T263[] =
+ {
+ 99, 99, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 1204, -1, -1, -1, -1, -1, -1, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, -1, -1, -1, -1, 99, -1, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 1205, 99, 99, 99, 99, 99, 99, 99
+ };
+
+static const ANTLR3_INT32 dfa50_T264[] =
+ {
+ 1472
+ };
+
+static const ANTLR3_INT32 dfa50_T265[] =
+ {
+ 160, -1, 161, -1, -1, -1, 162, -1, -1, -1, -1, -1, 163, -1, -1, -1, -1,
+ 164, 165, -1, -1, -1, 166
+ };
+
+static const ANTLR3_INT32 dfa50_T266[] =
+ {
+ 662
+ };
+
+static const ANTLR3_INT32 dfa50_T267[] =
+ {
+ 863
+ };
+
+static const ANTLR3_INT32 dfa50_T268[] =
+ {
+ 1030
+ };
+
+static const ANTLR3_INT32 dfa50_T269[] =
+ {
+ 74, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, 75
+ };
+
+static const ANTLR3_INT32 dfa50_T270[] =
+ {
+ 685
+ };
+
+static const ANTLR3_INT32 dfa50_T271[] =
+ {
+ 431
+ };
+
+static const ANTLR3_INT32 dfa50_T272[] =
+ {
+ 878
+ };
+
+static const ANTLR3_INT32 dfa50_T273[] =
+ {
+ 1040
+ };
+
+static const ANTLR3_INT32 dfa50_T274[] =
+ {
+ 1177
+ };
+
+static const ANTLR3_INT32 dfa50_T275[] =
+ {
+ 463
+ };
+
+static const ANTLR3_INT32 dfa50_T276[] =
+ {
+ 432
+ };
+
+static const ANTLR3_INT32 dfa50_T277[] =
+ {
+ 474, -1, -1, -1, -1, 475, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 476
+ };
+
+static const ANTLR3_INT32 dfa50_T278[] =
+ {
+ 664
+ };
+
+static const ANTLR3_INT32 dfa50_T279[] =
+ {
+ 1129, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T280[] =
+ {
+ 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 1144, 53, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T281[] =
+ {
+ 864
+ };
+
+static const ANTLR3_INT32 dfa50_T282[] =
+ {
+ 1031
+ };
+
+static const ANTLR3_INT32 dfa50_T283[] =
+ {
+ 686
+ };
+
+static const ANTLR3_INT32 dfa50_T284[] =
+ {
+ 1170
+ };
+
+static const ANTLR3_INT32 dfa50_T285[] =
+ {
+ 879
+ };
+
+static const ANTLR3_INT32 dfa50_T286[] =
+ {
+ 1287
+ };
+
+static const ANTLR3_INT32 dfa50_T287[] =
+ {
+ 1041
+ };
+
+static const ANTLR3_INT32 dfa50_T288[] =
+ {
+ 1178
+ };
+
+static const ANTLR3_INT32 dfa50_T289[] =
+ {
+ 1294
+ };
+
+static const ANTLR3_INT32 dfa50_T290[] =
+ {
+ 1375
+ };
+
+static const ANTLR3_INT32 dfa50_T291[] =
+ {
+ 433
+ };
+
+static const ANTLR3_INT32 dfa50_T292[] =
+ {
+ 665
+ };
+
+static const ANTLR3_INT32 dfa50_T293[] =
+ {
+ 109, -1, -1, -1, -1, -1, -1, 110, -1, -1, -1, 111, -1, -1, 112, -1, -1,
+ -1, -1, 113
+ };
+
+static const ANTLR3_INT32 dfa50_T294[] =
+ {
+ 395, -1, -1, -1, -1, 396, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 397, 398
+ };
+
+static const ANTLR3_INT32 dfa50_T295[] =
+ {
+ 486
+ };
+
+static const ANTLR3_INT32 dfa50_T296[] =
+ {
+ 687
+ };
+
+static const ANTLR3_INT32 dfa50_T297[] =
+ {
+ 434
+ };
+
+static const ANTLR3_INT32 dfa50_T298[] =
+ {
+ 880
+ };
+
+static const ANTLR3_INT32 dfa50_T299[] =
+ {
+ 666
+ };
+
+static const ANTLR3_INT32 dfa50_T300[] =
+ {
+ 1042
+ };
+
+static const ANTLR3_INT32 dfa50_T301[] =
+ {
+ 866
+ };
+
+static const ANTLR3_INT32 dfa50_T302[] =
+ {
+ 1179
+ };
+
+static const ANTLR3_INT32 dfa50_T303[] =
+ {
+ 487
+ };
+
+static const ANTLR3_INT32 dfa50_T304[] =
+ {
+ 688
+ };
+
+static const ANTLR3_INT32 dfa50_T305[] =
+ {
+ 327, -1, -1, -1, 328, -1, -1, -1, -1, -1, -1, -1, -1, -1, 329
+ };
+
+static const ANTLR3_INT32 dfa50_T306[] =
+ {
+ 881
+ };
+
+static const ANTLR3_INT32 dfa50_T307[] =
+ {
+ 1043
+ };
+
+static const ANTLR3_INT32 dfa50_T308[] =
+ {
+ 488
+ };
+
+static const ANTLR3_INT32 dfa50_T309[] =
+ {
+ 689
+ };
+
+static const ANTLR3_INT32 dfa50_T310[] =
+ {
+ 882
+ };
+
+static const ANTLR3_INT32 dfa50_T311[] =
+ {
+ 1044
+ };
+
+static const ANTLR3_INT32 dfa50_T312[] =
+ {
+ 1181
+ };
+
+static const ANTLR3_INT32 dfa50_T313[] =
+ {
+ 1295
+ };
+
+static const ANTLR3_INT32 dfa50_T314[] =
+ {
+ 1376
+ };
+
+static const ANTLR3_INT32 dfa50_T315[] =
+ {
+ 1430
+ };
+
+static const ANTLR3_INT32 dfa50_T316[] =
+ {
+ 1458
+ };
+
+static const ANTLR3_INT32 dfa50_T317[] =
+ {
+ 371, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 372
+ };
+
+static const ANTLR3_INT32 dfa50_T318[] =
+ {
+ 55, -1, 56, -1, -1, 57, -1, -1, -1, -1, -1, -1, -1, -1, 58, 59, 60
+ };
+
+static const ANTLR3_INT32 dfa50_T319[] =
+ {
+ 489
+ };
+
+static const ANTLR3_INT32 dfa50_T320[] =
+ {
+ 679, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 680
+ };
+
+static const ANTLR3_INT32 dfa50_T321[] =
+ {
+ 690
+ };
+
+static const ANTLR3_INT32 dfa50_T322[] =
+ {
+ 883
+ };
+
+static const ANTLR3_INT32 dfa50_T323[] =
+ {
+ 837, -1, -1, -1, 838, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 839
+ };
+
+static const ANTLR3_INT32 dfa50_T324[] =
+ {
+ 490
+ };
+
+static const ANTLR3_INT32 dfa50_T325[] =
+ {
+ 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 296
+ };
+
+static const ANTLR3_INT32 dfa50_T326[] =
+ {
+ 519
+ };
+
+static const ANTLR3_INT32 dfa50_T327[] =
+ {
+ 723
+ };
+
+static const ANTLR3_INT32 dfa50_T328[] =
+ {
+ 384, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 385
+ };
+
+static const ANTLR3_INT32 dfa50_T329[] =
+ {
+ 491
+ };
+
+static const ANTLR3_INT32 dfa50_T330[] =
+ {
+ 914
+ };
+
+static const ANTLR3_INT32 dfa50_T331[] =
+ {
+ 692
+ };
+
+static const ANTLR3_INT32 dfa50_T332[] =
+ {
+ 884
+ };
+
+static const ANTLR3_INT32 dfa50_T333[] =
+ {
+ 1075
+ };
+
+static const ANTLR3_INT32 dfa50_T334[] =
+ {
+ 1046
+ };
+
+static const ANTLR3_INT32 dfa50_T335[] =
+ {
+ 1182
+ };
+
+static const ANTLR3_INT32 dfa50_T336[] =
+ {
+ 1207
+ };
+
+static const ANTLR3_INT32 dfa50_T337[] =
+ {
+ 1296
+ };
+
+static const ANTLR3_INT32 dfa50_T338[] =
+ {
+ 492
+ };
+
+static const ANTLR3_INT32 dfa50_T339[] =
+ {
+ 693
+ };
+
+static const ANTLR3_INT32 dfa50_T340[] =
+ {
+ 885
+ };
+
+static const ANTLR3_INT32 dfa50_T341[] =
+ {
+ 1047
+ };
+
+static const ANTLR3_INT32 dfa50_T342[] =
+ {
+ 459, -1, -1, 458
+ };
+
+static const ANTLR3_INT32 dfa50_T343[] =
+ {
+ 493
+ };
+
+static const ANTLR3_INT32 dfa50_T344[] =
+ {
+ 694
+ };
+
+static const ANTLR3_INT32 dfa50_T345[] =
+ {
+ 886
+ };
+
+static const ANTLR3_INT32 dfa50_T346[] =
+ {
+ 1048
+ };
+
+static const ANTLR3_INT32 dfa50_T347[] =
+ {
+ 673
+ };
+
+static const ANTLR3_INT32 dfa50_T348[] =
+ {
+ 1183
+ };
+
+static const ANTLR3_INT32 dfa50_T349[] =
+ {
+ 194, -1, 186, 187, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 199, 185, 189,
+ 183, 188, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 198, -1, -1, -1,
+ 191, -1, -1, -1, -1, 195, -1, -1, 193, 196, -1, -1, -1, -1, 192, -1, -1,
+ -1, -1, -1, -1, -1, -1, 190, -1, -1, -1, 197, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 184
+ };
+
+static const ANTLR3_INT32 dfa50_T350[] =
+ {
+ 494
+ };
+
+static const ANTLR3_INT32 dfa50_T351[] =
+ {
+ 695
+ };
+
+static const ANTLR3_INT32 dfa50_T352[] =
+ {
+ 887
+ };
+
+static const ANTLR3_INT32 dfa50_T353[] =
+ {
+ 1049
+ };
+
+static const ANTLR3_INT32 dfa50_T354[] =
+ {
+ 495
+ };
+
+static const ANTLR3_INT32 dfa50_T355[] =
+ {
+ 696
+ };
+
+static const ANTLR3_INT32 dfa50_T356[] =
+ {
+ 888
+ };
+
+static const ANTLR3_INT32 dfa50_T357[] =
+ {
+ 1050
+ };
+
+static const ANTLR3_INT32 dfa50_T358[] =
+ {
+ 1185
+ };
+
+static const ANTLR3_INT32 dfa50_T359[] =
+ {
+ 1297
+ };
+
+static const ANTLR3_INT32 dfa50_T360[] =
+ {
+ 610
+ };
+
+static const ANTLR3_INT32 dfa50_T361[] =
+ {
+ 496
+ };
+
+static const ANTLR3_INT32 dfa50_T362[] =
+ {
+ 813
+ };
+
+static const ANTLR3_INT32 dfa50_T363[] =
+ {
+ 697
+ };
+
+static const ANTLR3_INT32 dfa50_T364[] =
+ {
+ 889
+ };
+
+static const ANTLR3_INT32 dfa50_T365[] =
+ {
+ 988
+ };
+
+static const ANTLR3_INT32 dfa50_T366[] =
+ {
+ 1051
+ };
+
+static const ANTLR3_INT32 dfa50_T367[] =
+ {
+ 1133
+ };
+
+static const ANTLR3_INT32 dfa50_T368[] =
+ {
+ 1186
+ };
+
+static const ANTLR3_INT32 dfa50_T369[] =
+ {
+ 497
+ };
+
+static const ANTLR3_INT32 dfa50_T370[] =
+ {
+ 698
+ };
+
+static const ANTLR3_INT32 dfa50_T371[] =
+ {
+ 890
+ };
+
+static const ANTLR3_INT32 dfa50_T372[] =
+ {
+ 1052
+ };
+
+static const ANTLR3_INT32 dfa50_T373[] =
+ {
+ 1187
+ };
+
+static const ANTLR3_INT32 dfa50_T374[] =
+ {
+ 374, 375
+ };
+
+static const ANTLR3_INT32 dfa50_T375[] =
+ {
+ 699
+ };
+
+static const ANTLR3_INT32 dfa50_T376[] =
+ {
+ 891
+ };
+
+static const ANTLR3_INT32 dfa50_T377[] =
+ {
+ 1053
+ };
+
+static const ANTLR3_INT32 dfa50_T378[] =
+ {
+ 438, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 437
+ };
+
+static const ANTLR3_INT32 dfa50_T379[] =
+ {
+ 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 788, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T380[] =
+ {
+ 1188
+ };
+
+static const ANTLR3_INT32 dfa50_T381[] =
+ {
+ 700
+ };
+
+static const ANTLR3_INT32 dfa50_T382[] =
+ {
+ 275
+ };
+
+static const ANTLR3_INT32 dfa50_T383[] =
+ {
+ 314, -1, -1, -1, 315
+ };
+
+static const ANTLR3_INT32 dfa50_T384[] =
+ {
+ 727, -1, 728
+ };
+
+static const ANTLR3_INT32 dfa50_T385[] =
+ {
+ 546, -1, -1, -1, 547
+ };
+
+static const ANTLR3_INT32 dfa50_T386[] =
+ {
+ 701
+ };
+
+static const ANTLR3_INT32 dfa50_T387[] =
+ {
+ 893
+ };
+
+static const ANTLR3_INT32 dfa50_T388[] =
+ {
+ 276
+ };
+
+static const ANTLR3_INT32 dfa50_T389[] =
+ {
+ 1054
+ };
+
+static const ANTLR3_INT32 dfa50_T390[] =
+ {
+ 54, 54, -1, -1, 54, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 54, 43, 50, 1, 2, 37, 42, 51, 31, 32, 46, 45, 38, 3,
+ 41, 47, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 28, 40, 4, 5, 30, 39, 6,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 35, -1, 36, 29, 49, -1, 7, 8, 9, 10, 11,
+ 12, 13, 53, 14, 15, 53, 16, 17, 18, 19, 20, 53, 21, 22, 23, 24, 25, 26,
+ 44, 53, 53, 33, 27, 34, 48
+ };
+
+static const ANTLR3_INT32 dfa50_T391[] =
+ {
+ 702
+ };
+
+static const ANTLR3_INT32 dfa50_T392[] =
+ {
+ 894
+ };
+
+static const ANTLR3_INT32 dfa50_T393[] =
+ {
+ 1055
+ };
+
+static const ANTLR3_INT32 dfa50_T394[] =
+ {
+ 703
+ };
+
+static const ANTLR3_INT32 dfa50_T395[] =
+ {
+ 895
+ };
+
+static const ANTLR3_INT32 dfa50_T396[] =
+ {
+ 1056
+ };
+
+static const ANTLR3_INT32 dfa50_T397[] =
+ {
+ 612, -1, -1, -1, -1, -1, -1, 613
+ };
+
+static const ANTLR3_INT32 dfa50_T398[] =
+ {
+ 1189
+ };
+
+static const ANTLR3_INT32 dfa50_T399[] =
+ {
+ 1300
+ };
+
+static const ANTLR3_INT32 dfa50_T400[] =
+ {
+ 1379
+ };
+
+static const ANTLR3_INT32 dfa50_T401[] =
+ {
+ 477
+ };
+
+static const ANTLR3_INT32 dfa50_T402[] =
+ {
+ 704
+ };
+
+static const ANTLR3_INT32 dfa50_T403[] =
+ {
+ 896
+ };
+
+static const ANTLR3_INT32 dfa50_T404[] =
+ {
+ 1057
+ };
+
+static const ANTLR3_INT32 dfa50_T405[] =
+ {
+ 1190
+ };
+
+static const ANTLR3_INT32 dfa50_T406[] =
+ {
+ 1301
+ };
+
+static const ANTLR3_INT32 dfa50_T407[] =
+ {
+ 1380
+ };
+
+static const ANTLR3_INT32 dfa50_T408[] =
+ {
+ 1431
+ };
+
+static const ANTLR3_INT32 dfa50_T409[] =
+ {
+ 229, -1, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 52
+ };
+
+static const ANTLR3_INT32 dfa50_T410[] =
+ {
+ 1459
+ };
+
+static const ANTLR3_INT32 dfa50_T411[] =
+ {
+ 1473
+ };
+
+static const ANTLR3_INT32 dfa50_T412[] =
+ {
+ 270, -1, -1, 269
+ };
+
+static const ANTLR3_INT32 dfa50_T413[] =
+ {
+ 439, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 186
+ };
+
+static const ANTLR3_INT32 dfa50_T414[] =
+ {
+ 504
+ };
+
+static const ANTLR3_INT32 dfa50_T415[] =
+ {
+ 705
+ };
+
+static const ANTLR3_INT32 dfa50_T416[] =
+ {
+ 898
+ };
+
+static const ANTLR3_INT32 dfa50_T417[] =
+ {
+ 1058
+ };
+
+static const ANTLR3_INT32 dfa50_T418[] =
+ {
+ 1191
+ };
+
+static const ANTLR3_INT32 dfa50_T419[] =
+ {
+ 1302
+ };
+
+static const ANTLR3_INT32 dfa50_T420[] =
+ {
+ 220, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 222, 221
+ };
+
+static const ANTLR3_INT32 dfa50_T421[] =
+ {
+ 899
+ };
+
+static const ANTLR3_INT32 dfa50_T422[] =
+ {
+ 1059
+ };
+
+static const ANTLR3_INT32 dfa50_T423[] =
+ {
+ 310, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 311
+ };
+
+static const ANTLR3_INT32 dfa50_T424[] =
+ {
+ 708
+ };
+
+static const ANTLR3_INT32 dfa50_T425[] =
+ {
+ 480, 481
+ };
+
+static const ANTLR3_INT32 dfa50_T426[] =
+ {
+ 709
+ };
+
+static const ANTLR3_INT32 dfa50_T427[] =
+ {
+ 900
+ };
+
+static const ANTLR3_INT32 dfa50_T428[] =
+ {
+ 1060
+ };
+
+static const ANTLR3_INT32 dfa50_T429[] =
+ {
+ 964, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 965, -1, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T430[] =
+ {
+ 418, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 419
+ };
+
+static const ANTLR3_INT32 dfa50_T431[] =
+ {
+ 216, 217, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 218
+ };
+
+static const ANTLR3_INT32 dfa50_T432[] =
+ {
+ 710
+ };
+
+static const ANTLR3_INT32 dfa50_T433[] =
+ {
+ 509
+ };
+
+static const ANTLR3_INT32 dfa50_T434[] =
+ {
+ 711
+ };
+
+static const ANTLR3_INT32 dfa50_T435[] =
+ {
+ 667
+ };
+
+static const ANTLR3_INT32 dfa50_T436[] =
+ {
+ 901
+ };
+
+static const ANTLR3_INT32 dfa50_T437[] =
+ {
+ 1061
+ };
+
+static const ANTLR3_INT32 dfa50_T438[] =
+ {
+ 819, -1, -1, -1, -1, -1, -1, -1, -1, -1, 820
+ };
+
+static const ANTLR3_INT32 dfa50_T439[] =
+ {
+ 867, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 868
+ };
+
+static const ANTLR3_INT32 dfa50_T440[] =
+ {
+ 1192
+ };
+
+static const ANTLR3_INT32 dfa50_T441[] =
+ {
+ 1303
+ };
+
+static const ANTLR3_INT32 dfa50_T442[] =
+ {
+ 527, -1, -1, -1, -1, -1, -1, -1, 528
+ };
+
+static const ANTLR3_INT32 dfa50_T443[] =
+ {
+ 510
+ };
+
+static const ANTLR3_INT32 dfa50_T444[] =
+ {
+ 712
+ };
+
+static const ANTLR3_INT32 dfa50_T445[] =
+ {
+ 467
+ };
+
+static const ANTLR3_INT32 dfa50_T446[] =
+ {
+ 902
+ };
+
+static const ANTLR3_INT32 dfa50_T447[] =
+ {
+ 1062
+ };
+
+static const ANTLR3_INT32 dfa50_T448[] =
+ {
+ 1193
+ };
+
+static const ANTLR3_INT32 dfa50_T449[] =
+ {
+ 321
+ };
+
+static const ANTLR3_INT32 dfa50_T450[] =
+ {
+ 540
+ };
+
+static const ANTLR3_INT32 dfa50_T451[] =
+ {
+ 442
+ };
+
+static const ANTLR3_INT32 dfa50_T452[] =
+ {
+ 511
+ };
+
+static const ANTLR3_INT32 dfa50_T453[] =
+ {
+ 668, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 669
+ };
+
+static const ANTLR3_INT32 dfa50_T454[] =
+ {
+ 713
+ };
+
+static const ANTLR3_INT32 dfa50_T455[] =
+ {
+ 903
+ };
+
+static const ANTLR3_INT32 dfa50_T456[] =
+ {
+ 1063
+ };
+
+static const ANTLR3_INT32 dfa50_T457[] =
+ {
+ 1194
+ };
+
+static const ANTLR3_INT32 dfa50_T458[] =
+ {
+ 714
+ };
+
+static const ANTLR3_INT32 dfa50_T459[] =
+ {
+ 904
+ };
+
+static const ANTLR3_INT32 dfa50_T460[] =
+ {
+ 1064
+ };
+
+static const ANTLR3_INT32 dfa50_T461[] =
+ {
+ 1195
+ };
+
+static const ANTLR3_INT32 dfa50_T462[] =
+ {
+ 439, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 443
+ };
+
+static const ANTLR3_INT32 dfa50_T463[] =
+ {
+ 322
+ };
+
+static const ANTLR3_INT32 dfa50_T464[] =
+ {
+ 541
+ };
+
+static const ANTLR3_INT32 dfa50_T465[] =
+ {
+ 529, -1, -1, -1, -1, -1, 530
+ };
+
+static const ANTLR3_INT32 dfa50_T466[] =
+ {
+ 123, -1, -1, -1, -1, -1, -1, -1, 124, -1, -1, 125, -1, -1, 126, -1, -1,
+ 127, -1, -1, 128
+ };
+
+static const ANTLR3_INT32 dfa50_T467[] =
+ {
+ 1196
+ };
+
+static const ANTLR3_INT32 dfa50_T468[] =
+ {
+ 1306
+ };
+
+static const ANTLR3_INT32 dfa50_T469[] =
+ {
+ 1382
+ };
+
+static const ANTLR3_INT32 dfa50_T470[] =
+ {
+ 1432
+ };
+
+static const ANTLR3_INT32 dfa50_T471[] =
+ {
+ 752, -1, -1, -1, -1, -1, -1, 753
+ };
+
+static const ANTLR3_INT32 dfa50_T472[] =
+ {
+ 312, -1, -1, -1, -1, -1, 313
+ };
+
+static const ANTLR3_INT32 dfa50_T473[] =
+ {
+ 716
+ };
+
+static const ANTLR3_INT32 dfa50_T474[] =
+ {
+ 906
+ };
+
+static const ANTLR3_INT32 dfa50_T475[] =
+ {
+ 1067
+ };
+
+static const ANTLR3_INT32 dfa50_T476[] =
+ {
+ 1197
+ };
+
+static const ANTLR3_INT32 dfa50_T477[] =
+ {
+ 1307
+ };
+
+static const ANTLR3_INT32 dfa50_T478[] =
+ {
+ 146, -1, 147, -1, -1, 148
+ };
+
+static const ANTLR3_INT32 dfa50_T479[] =
+ {
+ 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 1009, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T480[] =
+ {
+ 323, -1, -1, -1, -1, -1, -1, -1, -1, -1, 324
+ };
+
+static const ANTLR3_INT32 dfa50_T481[] =
+ {
+ 907
+ };
+
+static const ANTLR3_INT32 dfa50_T482[] =
+ {
+ 1068
+ };
+
+static const ANTLR3_INT32 dfa50_T483[] =
+ {
+ 1198
+ };
+
+static const ANTLR3_INT32 dfa50_T484[] =
+ {
+ 1308
+ };
+
+static const ANTLR3_INT32 dfa50_T485[] =
+ {
+ 1383
+ };
+
+static const ANTLR3_INT32 dfa50_T486[] =
+ {
+ 1433
+ };
+
+static const ANTLR3_INT32 dfa50_T487[] =
+ {
+ 287
+ };
+
+static const ANTLR3_INT32 dfa50_T488[] =
+ {
+ 267, 266
+ };
+
+static const ANTLR3_INT32 dfa50_T489[] =
+ {
+ 908
+ };
+
+static const ANTLR3_INT32 dfa50_T490[] =
+ {
+ 1069
+ };
+
+static const ANTLR3_INT32 dfa50_T491[] =
+ {
+ 288
+ };
+
+static const ANTLR3_INT32 dfa50_T492[] =
+ {
+ 1199
+ };
+
+static const ANTLR3_INT32 dfa50_T493[] =
+ {
+ 1309
+ };
+
+static const ANTLR3_INT32 dfa50_T494[] =
+ {
+ 1384
+ };
+
+static const ANTLR3_INT32 dfa50_T495[] =
+ {
+ 1070
+ };
+
+static const ANTLR3_INT32 dfa50_T496[] =
+ {
+ 1200
+ };
+
+static const ANTLR3_INT32 dfa50_T497[] =
+ {
+ 1310
+ };
+
+static const ANTLR3_INT32 dfa50_T498[] =
+ {
+ 1385
+ };
+
+static const ANTLR3_INT32 dfa50_T499[] =
+ {
+ 1434
+ };
+
+static const ANTLR3_INT32 dfa50_T500[] =
+ {
+ 153, -1, -1, 154, 155, -1, -1, -1, -1, -1, -1, -1, -1, -1, 156, -1, -1,
+ -1, -1, 157, 158, 159
+ };
+
+static const ANTLR3_INT32 dfa50_T501[] =
+ {
+ 1071
+ };
+
+static const ANTLR3_INT32 dfa50_T502[] =
+ {
+ 1201
+ };
+
+static const ANTLR3_INT32 dfa50_T503[] =
+ {
+ 1311
+ };
+
+static const ANTLR3_INT32 dfa50_T504[] =
+ {
+ 1386
+ };
+
+static const ANTLR3_INT32 dfa50_T505[] =
+ {
+ 1435
+ };
+
+static const ANTLR3_INT32 dfa50_T506[] =
+ {
+ 514, -1, -1, -1, -1, -1, 515
+ };
+
+static const ANTLR3_INT32 dfa50_T507[] =
+ {
+ 516
+ };
+
+static const ANTLR3_INT32 dfa50_T508[] =
+ {
+ 720
+ };
+
+static const ANTLR3_INT32 dfa50_T509[] =
+ {
+ 532
+ };
+
+static const ANTLR3_INT32 dfa50_T510[] =
+ {
+ 911
+ };
+
+static const ANTLR3_INT32 dfa50_T511[] =
+ {
+ 737
+ };
+
+static const ANTLR3_INT32 dfa50_T512[] =
+ {
+ 1072
+ };
+
+static const ANTLR3_INT32 dfa50_T513[] =
+ {
+ 1202
+ };
+
+static const ANTLR3_INT32 dfa50_T514[] =
+ {
+ 533
+ };
+
+static const ANTLR3_INT32 dfa50_T515[] =
+ {
+ 671, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 670
+ };
+
+static const ANTLR3_INT32 dfa50_T516[] =
+ {
+ 738
+ };
+
+static const ANTLR3_INT32 dfa50_T517[] =
+ {
+ 721
+ };
+
+static const ANTLR3_INT32 dfa50_T518[] =
+ {
+ 927
+ };
+
+static const ANTLR3_INT32 dfa50_T519[] =
+ {
+ 912
+ };
+
+static const ANTLR3_INT32 dfa50_T520[] =
+ {
+ 740
+ };
+
+static const ANTLR3_INT32 dfa50_T521[] =
+ {
+ 1073
+ };
+
+static const ANTLR3_INT32 dfa50_T522[] =
+ {
+ 167, -1, 168, -1, -1, -1, -1, -1, 169, -1, -1, 170, -1, -1, -1, -1, -1,
+ -1, 171
+ };
+
+static const ANTLR3_INT32 dfa50_T523[] =
+ {
+ 929
+ };
+
+static const ANTLR3_INT32 dfa50_T524[] =
+ {
+ 1203
+ };
+
+static const ANTLR3_INT32 dfa50_T525[] =
+ {
+ 1085
+ };
+
+static const ANTLR3_INT32 dfa50_T526[] =
+ {
+ 1215
+ };
+
+static const ANTLR3_INT32 dfa50_T527[] =
+ {
+ 316
+ };
+
+static const ANTLR3_INT32 dfa50_T528[] =
+ {
+ 534
+ };
+
+static const ANTLR3_INT32 dfa50_T529[] =
+ {
+ 739
+ };
+
+static const ANTLR3_INT32 dfa50_T530[] =
+ {
+ 928
+ };
+
+static const ANTLR3_INT32 dfa50_T531[] =
+ {
+ 1084
+ };
+
+static const ANTLR3_INT32 dfa50_T532[] =
+ {
+ 1214
+ };
+
+static const ANTLR3_INT32 dfa50_T533[] =
+ {
+ 1319
+ };
+
+static const ANTLR3_INT32 dfa50_T534[] =
+ {
+ 937
+ };
+
+static const ANTLR3_INT32 dfa50_T535[] =
+ {
+ 1091
+ };
+
+static const ANTLR3_INT32 dfa50_T536[] =
+ {
+ 537
+ };
+
+static const ANTLR3_INT32 dfa50_T537[] =
+ {
+ 625, 626
+ };
+
+static const ANTLR3_INT32 dfa50_T538[] =
+ {
+ 741
+ };
+
+static const ANTLR3_INT32 dfa50_T539[] =
+ {
+ 930
+ };
+
+static const ANTLR3_INT32 dfa50_T540[] =
+ {
+ 1086
+ };
+
+static const ANTLR3_INT32 dfa50_T541[] =
+ {
+ 381, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T542[] =
+ {
+ 379
+ };
+
+static const ANTLR3_INT32 dfa50_T543[] =
+ {
+ 319
+ };
+
+static const ANTLR3_INT32 dfa50_T544[] =
+ {
+ 538
+ };
+
+static const ANTLR3_INT32 dfa50_T545[] =
+ {
+ 742
+ };
+
+static const ANTLR3_INT32 dfa50_T546[] =
+ {
+ 1312
+ };
+
+static const ANTLR3_INT32 dfa50_T547[] =
+ {
+ 320
+ };
+
+static const ANTLR3_INT32 dfa50_T548[] =
+ {
+ 539
+ };
+
+static const ANTLR3_INT32 dfa50_T549[] =
+ {
+ 743
+ };
+
+static const ANTLR3_INT32 dfa50_T550[] =
+ {
+ 932
+ };
+
+static const ANTLR3_INT32 dfa50_T551[] =
+ {
+ 1087
+ };
+
+static const ANTLR3_INT32 dfa50_T552[] =
+ {
+ 604
+ };
+
+static const ANTLR3_INT32 dfa50_T553[] =
+ {
+ 808
+ };
+
+static const ANTLR3_INT32 dfa50_T554[] =
+ {
+ 984
+ };
+
+static const ANTLR3_INT32 dfa50_T555[] =
+ {
+ 1128
+ };
+
+static const ANTLR3_INT32 dfa50_T556[] =
+ {
+ 143, -1, -1, -1, -1, -1, -1, -1, -1, -1, 145, -1, -1, -1, -1, -1, 144
+ };
+
+static const ANTLR3_INT32 dfa50_T557[] =
+ {
+ 627
+ };
+
+static const ANTLR3_INT32 dfa50_T558[] =
+ {
+ 654, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 655, -1, -1, -1, -1, -1,
+ -1, 656
+ };
+
+static const ANTLR3_INT32 dfa50_T559[] =
+ {
+ 827
+ };
+
+static const ANTLR3_INT32 dfa50_T560[] =
+ {
+ 520
+ };
+
+static const ANTLR3_INT32 dfa50_T561[] =
+ {
+ 1001
+ };
+
+static const ANTLR3_INT32 dfa50_T562[] =
+ {
+ 521
+ };
+
+static const ANTLR3_INT32 dfa50_T563[] =
+ {
+ 99, 99, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 1313, -1, -1, -1, -1, -1, -1, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, -1, -1, -1, -1, 99, -1, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99
+ };
+
+static const ANTLR3_INT32 dfa50_T564[] =
+ {
+ 933
+ };
+
+static const ANTLR3_INT32 dfa50_T565[] =
+ {
+ 1088
+ };
+
+static const ANTLR3_INT32 dfa50_T566[] =
+ {
+ 1107, -1, -1, 1108, 1109, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1110,
+ 1111, -1, -1, 1112
+ };
+
+static const ANTLR3_INT32 dfa50_T567[] =
+ {
+ 522
+ };
+
+static const ANTLR3_INT32 dfa50_T568[] =
+ {
+ 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 1335, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T569[] =
+ {
+ 468
+ };
+
+static const ANTLR3_INT32 dfa50_T570[] =
+ {
+ 726
+ };
+
+static const ANTLR3_INT32 dfa50_T571[] =
+ {
+ 915
+ };
+
+static const ANTLR3_INT32 dfa50_T572[] =
+ {
+ 1076
+ };
+
+static const ANTLR3_INT32 dfa50_T573[] =
+ {
+ 1208
+ };
+
+static const ANTLR3_INT32 dfa50_T574[] =
+ {
+ 542
+ };
+
+static const ANTLR3_INT32 dfa50_T575[] =
+ {
+ 1315
+ };
+
+static const ANTLR3_INT32 dfa50_T576[] =
+ {
+ 748
+ };
+
+static const ANTLR3_INT32 dfa50_T577[] =
+ {
+ 543
+ };
+
+static const ANTLR3_INT32 dfa50_T578[] =
+ {
+ 749
+ };
+
+static const ANTLR3_INT32 dfa50_T579[] =
+ {
+ 916
+ };
+
+static const ANTLR3_INT32 dfa50_T580[] =
+ {
+ 935
+ };
+
+static const ANTLR3_INT32 dfa50_T581[] =
+ {
+ 1089
+ };
+
+static const ANTLR3_INT32 dfa50_T582[] =
+ {
+ 1219
+ };
+
+static const ANTLR3_INT32 dfa50_T583[] =
+ {
+ 1321
+ };
+
+static const ANTLR3_INT32 dfa50_T584[] =
+ {
+ 399
+ };
+
+static const ANTLR3_INT32 dfa50_T585[] =
+ {
+ 628
+ };
+
+static const ANTLR3_INT32 dfa50_T586[] =
+ {
+ 917
+ };
+
+static const ANTLR3_INT32 dfa50_T587[] =
+ {
+ 325
+ };
+
+static const ANTLR3_INT32 dfa50_T588[] =
+ {
+ 828, -1, -1, -1, 829
+ };
+
+static const ANTLR3_INT32 dfa50_T589[] =
+ {
+ 1078
+ };
+
+static const ANTLR3_INT32 dfa50_T590[] =
+ {
+ 544
+ };
+
+static const ANTLR3_INT32 dfa50_T591[] =
+ {
+ 1209
+ };
+
+static const ANTLR3_INT32 dfa50_T592[] =
+ {
+ 750
+ };
+
+static const ANTLR3_INT32 dfa50_T593[] =
+ {
+ 1316
+ };
+
+static const ANTLR3_INT32 dfa50_T594[] =
+ {
+ 936
+ };
+
+static const ANTLR3_INT32 dfa50_T595[] =
+ {
+ 1388
+ };
+
+static const ANTLR3_INT32 dfa50_T596[] =
+ {
+ 1436
+ };
+
+static const ANTLR3_INT32 dfa50_T597[] =
+ {
+ 1460
+ };
+
+static const ANTLR3_INT32 dfa50_T598[] =
+ {
+ 1474
+ };
+
+static const ANTLR3_INT32 dfa50_T599[] =
+ {
+ 1481
+ };
+
+static const ANTLR3_INT32 dfa50_T600[] =
+ {
+ 326
+ };
+
+static const ANTLR3_INT32 dfa50_T601[] =
+ {
+ 545
+ };
+
+static const ANTLR3_INT32 dfa50_T602[] =
+ {
+ 729
+ };
+
+static const ANTLR3_INT32 dfa50_T603[] =
+ {
+ 525
+ };
+
+static const ANTLR3_INT32 dfa50_T604[] =
+ {
+ 1322
+ };
+
+static const ANTLR3_INT32 dfa50_T605[] =
+ {
+ 730
+ };
+
+static const ANTLR3_INT32 dfa50_T606[] =
+ {
+ 1391
+ };
+
+static const ANTLR3_INT32 dfa50_T607[] =
+ {
+ 919
+ };
+
+static const ANTLR3_INT32 dfa50_T608[] =
+ {
+ 1079
+ };
+
+static const ANTLR3_INT32 dfa50_T609[] =
+ {
+ 526
+ };
+
+static const ANTLR3_INT32 dfa50_T610[] =
+ {
+ 731
+ };
+
+static const ANTLR3_INT32 dfa50_T611[] =
+ {
+ 920
+ };
+
+static const ANTLR3_INT32 dfa50_T612[] =
+ {
+ 1080
+ };
+
+static const ANTLR3_INT32 dfa50_T613[] =
+ {
+ 1211
+ };
+
+static const ANTLR3_INT32 dfa50_T614[] =
+ {
+ 279, -1, -1, -1, 280
+ };
+
+static const ANTLR3_INT32 dfa50_T615[] =
+ {
+ 938
+ };
+
+static const ANTLR3_INT32 dfa50_T616[] =
+ {
+ 1092
+ };
+
+static const ANTLR3_INT32 dfa50_T617[] =
+ {
+ 732
+ };
+
+static const ANTLR3_INT32 dfa50_T618[] =
+ {
+ 921
+ };
+
+static const ANTLR3_INT32 dfa50_T619[] =
+ {
+ 330, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 331
+ };
+
+static const ANTLR3_INT32 dfa50_T620[] =
+ {
+ 1081
+ };
+
+static const ANTLR3_INT32 dfa50_T621[] =
+ {
+ 1212
+ };
+
+static const ANTLR3_INT32 dfa50_T622[] =
+ {
+ 1317
+ };
+
+static const ANTLR3_INT32 dfa50_T623[] =
+ {
+ 1389
+ };
+
+static const ANTLR3_INT32 dfa50_T624[] =
+ {
+ 1437
+ };
+
+static const ANTLR3_INT32 dfa50_T625[] =
+ {
+ 1461
+ };
+
+static const ANTLR3_INT32 dfa50_T626[] =
+ {
+ 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 605, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T627[] =
+ {
+ 733
+ };
+
+static const ANTLR3_INT32 dfa50_T628[] =
+ {
+ 939
+ };
+
+static const ANTLR3_INT32 dfa50_T629[] =
+ {
+ 273, 272
+ };
+
+static const ANTLR3_INT32 dfa50_T630[] =
+ {
+ 922
+ };
+
+static const ANTLR3_INT32 dfa50_T631[] =
+ {
+ 1093
+ };
+
+static const ANTLR3_INT32 dfa50_T632[] =
+ {
+ 1082
+ };
+
+static const ANTLR3_INT32 dfa50_T633[] =
+ {
+ 1223
+ };
+
+static const ANTLR3_INT32 dfa50_T634[] =
+ {
+ 1213
+ };
+
+static const ANTLR3_INT32 dfa50_T635[] =
+ {
+ 1323
+ };
+
+static const ANTLR3_INT32 dfa50_T636[] =
+ {
+ 1318
+ };
+
+static const ANTLR3_INT32 dfa50_T637[] =
+ {
+ 332
+ };
+
+static const ANTLR3_INT32 dfa50_T638[] =
+ {
+ 552, -1, -1, -1, -1, 553, 554
+ };
+
+static const ANTLR3_INT32 dfa50_T639[] =
+ {
+ 548
+ };
+
+static const ANTLR3_INT32 dfa50_T640[] =
+ {
+ 756
+ };
+
+static const ANTLR3_INT32 dfa50_T641[] =
+ {
+ 734
+ };
+
+static const ANTLR3_INT32 dfa50_T642[] =
+ {
+ 940
+ };
+
+static const ANTLR3_INT32 dfa50_T643[] =
+ {
+ 1094
+ };
+
+static const ANTLR3_INT32 dfa50_T644[] =
+ {
+ 426, -1, -1, -1, 427
+ };
+
+static const ANTLR3_INT32 dfa50_T645[] =
+ {
+ 1224
+ };
+
+static const ANTLR3_INT32 dfa50_T646[] =
+ {
+ 300, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 301,
+ -1, -1, 302
+ };
+
+static const ANTLR3_INT32 dfa50_T647[] =
+ {
+ 735
+ };
+
+static const ANTLR3_INT32 dfa50_T648[] =
+ {
+ 549
+ };
+
+static const ANTLR3_INT32 dfa50_T649[] =
+ {
+ 757
+ };
+
+static const ANTLR3_INT32 dfa50_T650[] =
+ {
+ 941
+ };
+
+static const ANTLR3_INT32 dfa50_T651[] =
+ {
+ 760
+ };
+
+static const ANTLR3_INT32 dfa50_T652[] =
+ {
+ 531
+ };
+
+static const ANTLR3_INT32 dfa50_T653[] =
+ {
+ 944
+ };
+
+static const ANTLR3_INT32 dfa50_T654[] =
+ {
+ 736
+ };
+
+static const ANTLR3_INT32 dfa50_T655[] =
+ {
+ 1096
+ };
+
+static const ANTLR3_INT32 dfa50_T656[] =
+ {
+ 550
+ };
+
+static const ANTLR3_INT32 dfa50_T657[] =
+ {
+ 758
+ };
+
+static const ANTLR3_INT32 dfa50_T658[] =
+ {
+ 404, -1, -1, -1, -1, -1, -1, -1, 405
+ };
+
+static const ANTLR3_INT32 dfa50_T659[] =
+ {
+ 551
+ };
+
+static const ANTLR3_INT32 dfa50_T660[] =
+ {
+ 759
+ };
+
+static const ANTLR3_INT32 dfa50_T661[] =
+ {
+ 465, -1, -1, 464
+ };
+
+static const ANTLR3_INT32 dfa50_T662[] =
+ {
+ 447, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 449, -1, -1, 448,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 444,
+ -1, -1, -1, -1, -1, -1, -1, 446, -1, -1, -1, -1, -1, 445
+ };
+
+static const ANTLR3_INT32 dfa50_T663[] =
+ {
+ 1325
+ };
+
+static const ANTLR3_INT32 dfa50_T664[] =
+ {
+ 406, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 407
+ };
+
+static const ANTLR3_INT32 dfa50_T665[] =
+ {
+ 761
+ };
+
+static const ANTLR3_INT32 dfa50_T666[] =
+ {
+ 137, -1, -1, -1, -1, -1, -1, -1, 138
+ };
+
+static const ANTLR3_INT32 dfa50_T667[] =
+ {
+ 80, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 80, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 79, -1, -1, 78
+ };
+
+static const ANTLR3_INT32 dfa50_T668[] =
+ {
+ 762
+ };
+
+static const ANTLR3_INT32 dfa50_T669[] =
+ {
+ 809
+ };
+
+static const ANTLR3_INT32 dfa50_T670[] =
+ {
+ 946
+ };
+
+static const ANTLR3_INT32 dfa50_T671[] =
+ {
+ 1097
+ };
+
+static const ANTLR3_INT32 dfa50_T672[] =
+ {
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, -1, -1, -1, -1, 99, -1, 82, 83, 84, 85,
+ 86, 87, 88, 89, 90, 99, 99, 99, 91, 99, 92, 93, 99, 94, 95, 96, 99, 99,
+ 99, 97, 99, 99
+ };
+
+static const ANTLR3_INT32 dfa50_T673[] =
+ {
+ 1227
+ };
+
+static const ANTLR3_INT32 dfa50_T674[] =
+ {
+ 985
+ };
+
+static const ANTLR3_INT32 dfa50_T675[] =
+ {
+ 555
+ };
+
+static const ANTLR3_INT32 dfa50_T676[] =
+ {
+ 763
+ };
+
+static const ANTLR3_INT32 dfa50_T677[] =
+ {
+ 281, -1, -1, -1, -1, -1, -1, -1, 282, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 283
+ };
+
+static const ANTLR3_INT32 dfa50_T678[] =
+ {
+ 556
+ };
+
+static const ANTLR3_INT32 dfa50_T679[] =
+ {
+ 557
+ };
+
+static const ANTLR3_INT32 dfa50_T680[] =
+ {
+ 614, 615, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 616, -1, 617
+ };
+
+static const ANTLR3_INT32 dfa50_T681[] =
+ {
+ 336
+ };
+
+static const ANTLR3_INT32 dfa50_T682[] =
+ {
+ 535, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T683[] =
+ {
+ 558
+ };
+
+static const ANTLR3_INT32 dfa50_T684[] =
+ {
+ 765
+ };
+
+static const ANTLR3_INT32 dfa50_T685[] =
+ {
+ 948
+ };
+
+static const ANTLR3_INT32 dfa50_T686[] =
+ {
+ 1098
+ };
+
+static const ANTLR3_INT32 dfa50_T687[] =
+ {
+ 337
+ };
+
+static const ANTLR3_INT32 dfa50_T688[] =
+ {
+ 559
+ };
+
+static const ANTLR3_INT32 dfa50_T689[] =
+ {
+ 766
+ };
+
+static const ANTLR3_INT32 dfa50_T690[] =
+ {
+ 949
+ };
+
+static const ANTLR3_INT32 dfa50_T691[] =
+ {
+ 1099
+ };
+
+static const ANTLR3_INT32 dfa50_T692[] =
+ {
+ 333, -1, -1, -1, -1, -1, 334, -1, -1, -1, -1, -1, -1, -1, -1, 335
+ };
+
+static const ANTLR3_INT32 dfa50_T693[] =
+ {
+ 560
+ };
+
+static const ANTLR3_INT32 dfa50_T694[] =
+ {
+ 52, -1, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 249, -1, -1, -1, -1, -1, 249, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 250, -1, -1,
+ -1, -1, -1, -1, 249
+ };
+
+static const ANTLR3_INT32 dfa50_T695[] =
+ {
+ 767
+ };
+
+static const ANTLR3_INT32 dfa50_T696[] =
+ {
+ 950
+ };
+
+static const ANTLR3_INT32 dfa50_T697[] =
+ {
+ 340
+ };
+
+static const ANTLR3_INT32 dfa50_T698[] =
+ {
+ 561
+ };
+
+static const ANTLR3_INT32 dfa50_T699[] =
+ {
+ 768
+ };
+
+static const ANTLR3_INT32 dfa50_T700[] =
+ {
+ 341
+ };
+
+static const ANTLR3_INT32 dfa50_T701[] =
+ {
+ 562
+ };
+
+static const ANTLR3_INT32 dfa50_T702[] =
+ {
+ 769
+ };
+
+static const ANTLR3_INT32 dfa50_T703[] =
+ {
+ 952
+ };
+
+static const ANTLR3_INT32 dfa50_T704[] =
+ {
+ 1101
+ };
+
+static const ANTLR3_INT32 dfa50_T705[] =
+ {
+ 237
+ };
+
+static const ANTLR3_INT32 dfa50_T706[] =
+ {
+ 953
+ };
+
+static const ANTLR3_INT32 dfa50_T707[] =
+ {
+ 564
+ };
+
+static const ANTLR3_INT32 dfa50_T708[] =
+ {
+ 772
+ };
+
+static const ANTLR3_INT32 dfa50_T709[] =
+ {
+ 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 53, 53, 53, 847, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T710[] =
+ {
+ 954
+ };
+
+static const ANTLR3_INT32 dfa50_T711[] =
+ {
+ 565
+ };
+
+static const ANTLR3_INT32 dfa50_T712[] =
+ {
+ 284, -1, -1, -1, 285, -1, 286
+ };
+
+static const ANTLR3_INT32 dfa50_T713[] =
+ {
+ 346
+ };
+
+static const ANTLR3_INT32 dfa50_T714[] =
+ {
+ 567
+ };
+
+static const ANTLR3_INT32 dfa50_T715[] =
+ {
+ 774
+ };
+
+static const ANTLR3_INT32 dfa50_T716[] =
+ {
+ 498, -1, -1, -1, -1, -1, 499, -1, -1, -1, -1, -1, 500, 501, -1, -1, 502,
+ 503
+ };
+
+static const ANTLR3_INT32 dfa50_T717[] =
+ {
+ 347
+ };
+
+static const ANTLR3_INT32 dfa50_T718[] =
+ {
+ 568
+ };
+
+static const ANTLR3_INT32 dfa50_T719[] =
+ {
+ 348
+ };
+
+static const ANTLR3_INT32 dfa50_T720[] =
+ {
+ 569
+ };
+
+static const ANTLR3_INT32 dfa50_T721[] =
+ {
+ 776
+ };
+
+static const ANTLR3_INT32 dfa50_T722[] =
+ {
+ 570
+ };
+
+static const ANTLR3_INT32 dfa50_T723[] =
+ {
+ 210
+ };
+
+static const ANTLR3_INT32 dfa50_T724[] =
+ {
+ 571
+ };
+
+static const ANTLR3_INT32 dfa50_T725[] =
+ {
+ 778
+ };
+
+static const ANTLR3_INT32 dfa50_T726[] =
+ {
+ 247, -1, -1, -1, -1, 247, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 246,
+ -1, -1, 245
+ };
+
+static const ANTLR3_INT32 dfa50_T727[] =
+ {
+ 779
+ };
+
+static const ANTLR3_INT32 dfa50_T728[] =
+ {
+ 342
+ };
+
+static const ANTLR3_INT32 dfa50_T729[] =
+ {
+ 563
+ };
+
+static const ANTLR3_INT32 dfa50_T730[] =
+ {
+ 214
+ };
+
+static const ANTLR3_INT32 dfa50_T731[] =
+ {
+ 212
+ };
+
+static const ANTLR3_INT32 dfa50_T732[] =
+ {
+ 353
+ };
+
+static const ANTLR3_INT32 dfa50_T733[] =
+ {
+ 576
+ };
+
+static const ANTLR3_INT32 dfa50_T734[] =
+ {
+ 782
+ };
+
+static const ANTLR3_INT32 dfa50_T735[] =
+ {
+ 1361, -1, -1, -1, -1, -1, -1, -1, 1362
+ };
+
+static const ANTLR3_INT32 dfa50_T736[] =
+ {
+ 354
+ };
+
+static const ANTLR3_INT32 dfa50_T737[] =
+ {
+ 355
+ };
+
+static const ANTLR3_INT32 dfa50_T738[] =
+ {
+ 578
+ };
+
+static const ANTLR3_INT32 dfa50_T739[] =
+ {
+ 386, 387
+ };
+
+static const ANTLR3_INT32 dfa50_T740[] =
+ {
+ 356
+ };
+
+static const ANTLR3_INT32 dfa50_T741[] =
+ {
+ 579
+ };
+
+static const ANTLR3_INT32 dfa50_T742[] =
+ {
+ 784
+ };
+
+static const ANTLR3_INT32 dfa50_T743[] =
+ {
+ 100, 101, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 102, -1, -1, -1, 103,
+ -1, -1, -1, 104
+ };
+
+static const ANTLR3_INT32 dfa50_T744[] =
+ {
+ 357
+ };
+
+static const ANTLR3_INT32 dfa50_T745[] =
+ {
+ 869
+ };
+
+static const ANTLR3_INT32 dfa50_T746[] =
+ {
+ 580
+ };
+
+static const ANTLR3_INT32 dfa50_T747[] =
+ {
+ 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 975, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T748[] =
+ {
+ 785
+ };
+
+static const ANTLR3_INT32 dfa50_T749[] =
+ {
+ 960
+ };
+
+static const ANTLR3_INT32 dfa50_T750[] =
+ {
+ 358
+ };
+
+static const ANTLR3_INT32 dfa50_T751[] =
+ {
+ 581
+ };
+
+static const ANTLR3_INT32 dfa50_T752[] =
+ {
+ 786
+ };
+
+static const ANTLR3_INT32 dfa50_T753[] =
+ {
+ 252, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 253
+ };
+
+static const ANTLR3_INT32 dfa50_T754[] =
+ {
+ 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 744, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T755[] =
+ {
+ 961
+ };
+
+static const ANTLR3_INT32 dfa50_T756[] =
+ {
+ 1105
+ };
+
+static const ANTLR3_INT32 dfa50_T757[] =
+ {
+ 1231
+ };
+
+static const ANTLR3_INT32 dfa50_T758[] =
+ {
+ 359
+ };
+
+static const ANTLR3_INT32 dfa50_T759[] =
+ {
+ 582
+ };
+
+static const ANTLR3_INT32 dfa50_T760[] =
+ {
+ 787
+ };
+
+static const ANTLR3_INT32 dfa50_T761[] =
+ {
+ 962
+ };
+
+static const ANTLR3_INT32 dfa50_T762[] =
+ {
+ 1106
+ };
+
+static const ANTLR3_INT32 dfa50_T763[] =
+ {
+ 260
+ };
+
+static const ANTLR3_INT32 dfa50_T764[] =
+ {
+ 172, -1, 173, -1, -1, 174, -1, -1, -1, -1, 175, -1, -1, -1, 176
+ };
+
+static const ANTLR3_INT32 dfa50_T765[] =
+ {
+ 642, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 643
+ };
+
+static const ANTLR3_INT32 dfa50_T766[] =
+ {
+ 584
+ };
+
+static const ANTLR3_INT32 dfa50_T767[] =
+ {
+ 790
+ };
+
+static const ANTLR3_INT32 dfa50_T768[] =
+ {
+ 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 53, 53, 53, 53, 746, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T769[] =
+ {
+ 717, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 718, -1, -1, -1, 719
+ };
+
+static const ANTLR3_INT32 dfa50_T770[] =
+ {
+ 461
+ };
+
+static const ANTLR3_INT32 dfa50_T771[] =
+ {
+ 1233
+ };
+
+static const ANTLR3_INT32 dfa50_T772[] =
+ {
+ 1328
+ };
+
+static const ANTLR3_INT32 dfa50_T773[] =
+ {
+ 1394
+ };
+
+static const ANTLR3_INT32 dfa50_T774[] =
+ {
+ 1439
+ };
+
+static const ANTLR3_INT32 dfa50_T775[] =
+ {
+ 1462
+ };
+
+static const ANTLR3_INT32 dfa50_T776[] =
+ {
+ 349, -1, -1, -1, -1, -1, -1, -1, 350
+ };
+
+static const ANTLR3_INT32 dfa50_T777[] =
+ {
+ 1234
+ };
+
+static const ANTLR3_INT32 dfa50_T778[] =
+ {
+ 1329
+ };
+
+static const ANTLR3_INT32 dfa50_T779[] =
+ {
+ 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 53, 53, 53, 53, 587, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T780[] =
+ {
+ 1235
+ };
+
+static const ANTLR3_INT32 dfa50_T781[] =
+ {
+ 1330
+ };
+
+static const ANTLR3_INT32 dfa50_T782[] =
+ {
+ 1396
+ };
+
+static const ANTLR3_INT32 dfa50_T783[] =
+ {
+ 343, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 344, 345
+ };
+
+static const ANTLR3_INT32 dfa50_T784[] =
+ {
+ 1012
+ };
+
+static const ANTLR3_INT32 dfa50_T785[] =
+ {
+ 351
+ };
+
+static const ANTLR3_INT32 dfa50_T786[] =
+ {
+ 388, -1, -1, -1, 389, -1, -1, -1, -1, -1, 390
+ };
+
+static const ANTLR3_INT32 dfa50_T787[] =
+ {
+ 1153
+ };
+
+static const ANTLR3_INT32 dfa50_T788[] =
+ {
+ 1236
+ };
+
+static const ANTLR3_INT32 dfa50_T789[] =
+ {
+ 1331
+ };
+
+static const ANTLR3_INT32 dfa50_T790[] =
+ {
+ 572, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 573
+ };
+
+static const ANTLR3_INT32 dfa50_T791[] =
+ {
+ 1275, -1, -1, -1, -1, -1, -1, 1276, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 1277
+ };
+
+static const ANTLR3_INT32 dfa50_T792[] =
+ {
+ 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 53, 53, 53, 53, 854, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T793[] =
+ {
+ 1237
+ };
+
+static const ANTLR3_INT32 dfa50_T794[] =
+ {
+ 1332
+ };
+
+static const ANTLR3_INT32 dfa50_T795[] =
+ {
+ 224, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 227, -1, -1, 226, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 225
+ };
+
+static const ANTLR3_INT32 dfa50_T796[] =
+ {
+ 1398
+ };
+
+static const ANTLR3_INT32 dfa50_T797[] =
+ {
+ 1238
+ };
+
+static const ANTLR3_INT32 dfa50_T798[] =
+ {
+ 1333
+ };
+
+static const ANTLR3_INT32 dfa50_T799[] =
+ {
+ 352
+ };
+
+static const ANTLR3_INT32 dfa50_T800[] =
+ {
+ 416
+ };
+
+static const ANTLR3_INT32 dfa50_T801[] =
+ {
+ 647
+ };
+
+static const ANTLR3_INT32 dfa50_T802[] =
+ {
+ 873
+ };
+
+static const ANTLR3_INT32 dfa50_T803[] =
+ {
+ 1035
+ };
+
+static const ANTLR3_INT32 dfa50_T804[] =
+ {
+ 1172
+ };
+
+static const ANTLR3_INT32 dfa50_T805[] =
+ {
+ 1289
+ };
+
+static const ANTLR3_INT32 dfa50_T806[] =
+ {
+ 1113
+ };
+
+static const ANTLR3_INT32 dfa50_T807[] =
+ {
+ 1239
+ };
+
+static const ANTLR3_INT32 dfa50_T808[] =
+ {
+ 1371
+ };
+
+static const ANTLR3_INT32 dfa50_T809[] =
+ {
+ 1334
+ };
+
+static const ANTLR3_INT32 dfa50_T810[] =
+ {
+ 1400
+ };
+
+static const ANTLR3_INT32 dfa50_T811[] =
+ {
+ 1442
+ };
+
+static const ANTLR3_INT32 dfa50_T812[] =
+ {
+ 1463
+ };
+
+static const ANTLR3_INT32 dfa50_T813[] =
+ {
+ 1476
+ };
+
+static const ANTLR3_INT32 dfa50_T814[] =
+ {
+ 251
+ };
+
+static const ANTLR3_INT32 dfa50_T815[] =
+ {
+ 473
+ };
+
+static const ANTLR3_INT32 dfa50_T816[] =
+ {
+ 676
+ };
+
+static const ANTLR3_INT32 dfa50_T817[] =
+ {
+ 99, 99, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 1424, -1, -1, -1, -1, -1, -1, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, -1, -1, -1, -1, 99, -1, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99
+ };
+
+static const ANTLR3_INT32 dfa50_T818[] =
+ {
+ 648
+ };
+
+static const ANTLR3_INT32 dfa50_T819[] =
+ {
+ 849
+ };
+
+static const ANTLR3_INT32 dfa50_T820[] =
+ {
+ 506, 507, 508
+ };
+
+static const ANTLR3_INT32 dfa50_T821[] =
+ {
+ 968
+ };
+
+static const ANTLR3_INT32 dfa50_T822[] =
+ {
+ 1020
+ };
+
+static const ANTLR3_INT32 dfa50_T823[] =
+ {
+ 1115
+ };
+
+static const ANTLR3_INT32 dfa50_T824[] =
+ {
+ 1160, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1161
+ };
+
+static const ANTLR3_INT32 dfa50_T825[] =
+ {
+ 681, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 682
+ };
+
+static const ANTLR3_INT32 dfa50_T826[] =
+ {
+ 969
+ };
+
+static const ANTLR3_INT32 dfa50_T827[] =
+ {
+ 1116
+ };
+
+static const ANTLR3_INT32 dfa50_T828[] =
+ {
+ 254, 255, -1, -1, -1, -1, 256, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 257
+ };
+
+static const ANTLR3_INT32 dfa50_T829[] =
+ {
+ 1242
+ };
+
+static const ANTLR3_INT32 dfa50_T830[] =
+ {
+ 367
+ };
+
+static const ANTLR3_INT32 dfa50_T831[] =
+ {
+ 589
+ };
+
+static const ANTLR3_INT32 dfa50_T832[] =
+ {
+ 638, -1, 639
+ };
+
+static const ANTLR3_INT32 dfa50_T833[] =
+ {
+ 368
+ };
+
+static const ANTLR3_INT32 dfa50_T834[] =
+ {
+ 590
+ };
+
+static const ANTLR3_INT32 dfa50_T835[] =
+ {
+ 796
+ };
+
+static const ANTLR3_INT32 dfa50_T836[] =
+ {
+ 970
+ };
+
+static const ANTLR3_INT32 dfa50_T837[] =
+ {
+ 797
+ };
+
+static const ANTLR3_INT32 dfa50_T838[] =
+ {
+ 1220, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T839[] =
+ {
+ 971
+ };
+
+static const ANTLR3_INT32 dfa50_T840[] =
+ {
+ 263, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 264
+ };
+
+static const ANTLR3_INT32 dfa50_T841[] =
+ {
+ 1118
+ };
+
+static const ANTLR3_INT32 dfa50_T842[] =
+ {
+ 1243
+ };
+
+static const ANTLR3_INT32 dfa50_T843[] =
+ {
+ 451
+ };
+
+static const ANTLR3_INT32 dfa50_T844[] =
+ {
+ 593
+ };
+
+static const ANTLR3_INT32 dfa50_T845[] =
+ {
+ 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 53, 53, 53, 53, 53, 53, 53, 53, 361, 53,
+ 53, 53, 53, 53, 362, 363, 53, 53, 364, 365, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T846[] =
+ {
+ 800
+ };
+
+static const ANTLR3_INT32 dfa50_T847[] =
+ {
+ 972
+ };
+
+static const ANTLR3_INT32 dfa50_T848[] =
+ {
+ 1119
+ };
+
+static const ANTLR3_INT32 dfa50_T849[] =
+ {
+ 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, -1, -1, 805, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T850[] =
+ {
+ 801
+ };
+
+static const ANTLR3_INT32 dfa50_T851[] =
+ {
+ 674
+ };
+
+static const ANTLR3_INT32 dfa50_T852[] =
+ {
+ 596
+ };
+
+static const ANTLR3_INT32 dfa50_T853[] =
+ {
+ 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 53, 53, 53, 53, 53, 53, 53, 53, 860, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T854[] =
+ {
+ 373
+ };
+
+static const ANTLR3_INT32 dfa50_T855[] =
+ {
+ 597
+ };
+
+static const ANTLR3_INT32 dfa50_T856[] =
+ {
+ 802
+ };
+
+static const ANTLR3_INT32 dfa50_T857[] =
+ {
+ 974
+ };
+
+static const ANTLR3_INT32 dfa50_T858[] =
+ {
+ 1120
+ };
+
+static const ANTLR3_INT32 dfa50_T859[] =
+ {
+ 598
+ };
+
+static const ANTLR3_INT32 dfa50_T860[] =
+ {
+ 423
+ };
+
+static const ANTLR3_INT32 dfa50_T861[] =
+ {
+ 517, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 518
+ };
+
+static const ANTLR3_INT32 dfa50_T862[] =
+ {
+ 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 754, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T863[] =
+ {
+ 484, -1, -1, 485
+ };
+
+static const ANTLR3_INT32 dfa50_T864[] =
+ {
+ 583
+ };
+
+static const ANTLR3_INT32 dfa50_T865[] =
+ {
+ 653
+ };
+
+static const ANTLR3_INT32 dfa50_T866[] =
+ {
+ 1121
+ };
+
+static const ANTLR3_INT32 dfa50_T867[] =
+ {
+ 1246
+ };
+
+static const ANTLR3_INT32 dfa50_T868[] =
+ {
+ 1339
+ };
+
+static const ANTLR3_INT32 dfa50_T869[] =
+ {
+ 585
+ };
+
+static const ANTLR3_INT32 dfa50_T870[] =
+ {
+ 1122
+ };
+
+static const ANTLR3_INT32 dfa50_T871[] =
+ {
+ 791
+ };
+
+static const ANTLR3_INT32 dfa50_T872[] =
+ {
+ 1247
+ };
+
+static const ANTLR3_INT32 dfa50_T873[] =
+ {
+ 1340
+ };
+
+static const ANTLR3_INT32 dfa50_T874[] =
+ {
+ 114, -1, -1, -1, 115, -1, -1, -1, -1, -1, 116, -1, -1, -1, -1, 117, -1,
+ -1, -1, -1, 118
+ };
+
+static const ANTLR3_INT32 dfa50_T875[] =
+ {
+ 1123
+ };
+
+static const ANTLR3_INT32 dfa50_T876[] =
+ {
+ 1248
+ };
+
+static const ANTLR3_INT32 dfa50_T877[] =
+ {
+ 1341
+ };
+
+static const ANTLR3_INT32 dfa50_T878[] =
+ {
+ 1124
+ };
+
+static const ANTLR3_INT32 dfa50_T879[] =
+ {
+ 1249
+ };
+
+static const ANTLR3_INT32 dfa50_T880[] =
+ {
+ 1342
+ };
+
+static const ANTLR3_INT32 dfa50_T881[] =
+ {
+ 1404
+ };
+
+static const ANTLR3_INT32 dfa50_T882[] =
+ {
+ 1443
+ };
+
+static const ANTLR3_INT32 dfa50_T883[] =
+ {
+ 1464
+ };
+
+static const ANTLR3_INT32 dfa50_T884[] =
+ {
+ 392, -1, -1, -1, -1, -1, -1, 393
+ };
+
+static const ANTLR3_INT32 dfa50_T885[] =
+ {
+ 1477
+ };
+
+static const ANTLR3_INT32 dfa50_T886[] =
+ {
+ 1125
+ };
+
+static const ANTLR3_INT32 dfa50_T887[] =
+ {
+ 1250
+ };
+
+static const ANTLR3_INT32 dfa50_T888[] =
+ {
+ 1126
+ };
+
+static const ANTLR3_INT32 dfa50_T889[] =
+ {
+ 512, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513
+ };
+
+static const ANTLR3_INT32 dfa50_T890[] =
+ {
+ 1251
+ };
+
+static const ANTLR3_INT32 dfa50_T891[] =
+ {
+ 235
+ };
+
+static const ANTLR3_INT32 dfa50_T892[] =
+ {
+ 377
+ };
+
+static const ANTLR3_INT32 dfa50_T893[] =
+ {
+ 131, -1, -1, 132, 133, 134, -1, -1, -1, -1, -1, -1, -1, 135
+ };
+
+static const ANTLR3_INT32 dfa50_T894[] =
+ {
+ 380
+ };
+
+static const ANTLR3_INT32 dfa50_T895[] =
+ {
+ 603
+ };
+
+static const ANTLR3_INT32 dfa50_T896[] =
+ {
+ 807
+ };
+
+static const ANTLR3_INT32 dfa50_T897[] =
+ {
+ 383
+ };
+
+static const ANTLR3_INT32 dfa50_T898[] =
+ {
+ 983
+ };
+
+static const ANTLR3_INT32 dfa50_T899[] =
+ {
+ 1127
+ };
+
+static const ANTLR3_INT32 dfa50_T900[] =
+ {
+ 1252
+ };
+
+static const ANTLR3_INT32 dfa50_T901[] =
+ {
+ 658
+ };
+
+static const ANTLR3_INT32 dfa50_T902[] =
+ {
+ 1346
+ };
+
+static const ANTLR3_INT32 dfa50_T903[] =
+ {
+ 1405
+ };
+
+static const ANTLR3_INT32 dfa50_T904[] =
+ {
+ 1444
+ };
+
+static const ANTLR3_INT32 dfa50_T905[] =
+ {
+ 129, -1, -1, -1, -1, -1, 130
+ };
+
+static const ANTLR3_INT32 dfa50_T906[] =
+ {
+ 1465
+ };
+
+static const ANTLR3_INT32 dfa50_T907[] =
+ {
+ 1478
+ };
+
+static const ANTLR3_INT32 dfa50_T908[] =
+ {
+ 258, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 259
+ };
+
+static const ANTLR3_INT32 dfa50_T909[] =
+ {
+ 1347
+ };
+
+static const ANTLR3_INT32 dfa50_T910[] =
+ {
+ 1406
+ };
+
+static const ANTLR3_INT32 dfa50_T911[] =
+ {
+ 672
+ };
+
+static const ANTLR3_INT32 dfa50_T912[] =
+ {
+ 136
+ };
+
+static const ANTLR3_INT32 dfa50_T913[] =
+ {
+ 1348
+ };
+
+static const ANTLR3_INT32 dfa50_T914[] =
+ {
+ 1407
+ };
+
+static const ANTLR3_INT32 dfa50_T915[] =
+ {
+ 428, -1, -1, -1, -1, -1, 429
+ };
+
+static const ANTLR3_INT32 dfa50_T916[] =
+ {
+ 1446
+ };
+
+static const ANTLR3_INT32 dfa50_T917[] =
+ {
+ 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, -1, -1, -1, -1, -1, -1, -1, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, -1, -1, -1, -1, 53, -1, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 1225, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
+ };
+
+static const ANTLR3_INT32 dfa50_T918[] =
+ {
+ 1349
+ };
+
+static const ANTLR3_INT32 dfa50_T919[] =
+ {
+ 1408
+ };
+
+static const ANTLR3_INT32 dfa50_T920[] =
+ {
+ 207, 208
+ };
+
+static const ANTLR3_INT32 dfa50_T921[] =
+ {
+ 1350
+ };
+
+static const ANTLR3_INT32 dfa50_T922[] =
+ {
+ 1409
+ };
+
+
+/* Transition tables are a table of sub tables, with some tables
+ * reused for efficiency.
+ */
+static const ANTLR3_INT32 * const dfa50_transitions[] =
+{
+ dfa50_T390, dfa50_T318, dfa50_T125, dfa50_T73, dfa50_T269, dfa50_T667,
+ dfa50_T672, dfa50_T743, dfa50_T137, dfa50_T293, dfa50_T874, dfa50_T82,
+ dfa50_T466, dfa50_T905, dfa50_T893, dfa50_T912, dfa50_T666, dfa50_T66,
+ dfa50_T556, dfa50_T478, dfa50_T108, dfa50_T500, dfa50_T265, dfa50_T522,
+ dfa50_T764, dfa50_T85, dfa50_T100, dfa50_T349, dfa50_T254, dfa50_T143,
+ dfa50_T920, dfa50_T723, dfa50_T731, dfa50_T730, dfa50_T431, dfa50_T420,
+ NULL, dfa50_T795, NULL, NULL, NULL, dfa50_T409, dfa50_T23, dfa50_T891,
+ dfa50_T705, dfa50_T24, dfa50_T145, dfa50_T726, NULL, dfa50_T694, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, dfa50_T814, NULL, dfa50_T753, NULL,
+ NULL, dfa50_T828, NULL, NULL, dfa50_T908, NULL, NULL, NULL, dfa50_T763,
+ NULL, dfa50_T131, NULL, NULL, dfa50_T840, dfa50_T488, dfa50_T412, NULL,
+ dfa50_T629, NULL, NULL, NULL, dfa50_T382, dfa50_T388, dfa50_T102, dfa50_T614,
+ dfa50_T677, dfa50_T712, dfa50_T487, dfa50_T491, dfa50_T43, dfa50_T325,
+ dfa50_T15, dfa50_T646, dfa50_T192, dfa50_T30, dfa50_T423, dfa50_T472,
+ NULL, NULL, dfa50_T383, dfa50_T527, dfa50_T132, dfa50_T543, dfa50_T547,
+ dfa50_T449, dfa50_T463, dfa50_T480, dfa50_T587, dfa50_T600, dfa50_T305,
+ dfa50_T619, dfa50_T637, dfa50_T692, dfa50_T681, dfa50_T687, dfa50_T65,
+ dfa50_T697, dfa50_T700, dfa50_T728, dfa50_T783, dfa50_T713, dfa50_T717,
+ dfa50_T719, dfa50_T776, dfa50_T785, dfa50_T799, dfa50_T732, dfa50_T736,
+ dfa50_T737, dfa50_T740, dfa50_T744, dfa50_T750, dfa50_T758, dfa50_T0,
+ dfa50_T845, dfa50_T830, dfa50_T833, dfa50_T251, dfa50_T317, dfa50_T854,
+ dfa50_T374, dfa50_T213, dfa50_T892, dfa50_T173, dfa50_T542, dfa50_T894,
+ dfa50_T541, dfa50_T897, dfa50_T328, dfa50_T739, dfa50_T786, dfa50_T53,
+ dfa50_T884, dfa50_T62, dfa50_T294, dfa50_T584, dfa50_T78, dfa50_T80,
+ dfa50_T87, dfa50_T92, dfa50_T658, dfa50_T664, dfa50_T109, dfa50_T71,
+ dfa50_T156, dfa50_T161, dfa50_T165, dfa50_T800, dfa50_T170, dfa50_T430,
+ dfa50_T181, dfa50_T183, dfa50_T188, dfa50_T860, dfa50_T146, dfa50_T644,
+ dfa50_T915, dfa50_T262, dfa50_T271, dfa50_T276, dfa50_T291, dfa50_T297,
+ dfa50_T147, NULL, dfa50_T378, NULL, dfa50_T413, NULL, NULL, NULL, dfa50_T134,
+ dfa50_T451, dfa50_T462, NULL, NULL, NULL, dfa50_T662, NULL, NULL, NULL,
+ dfa50_T843, NULL, NULL, dfa50_T117, NULL, NULL, dfa50_T9, dfa50_T342,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, dfa50_T770, NULL, dfa50_T275, NULL, NULL, NULL, NULL,
+ dfa50_T661, dfa50_T445, NULL, NULL, NULL, NULL, dfa50_T569, dfa50_T96,
+ NULL, NULL, NULL, dfa50_T169, NULL, NULL, dfa50_T211, NULL, NULL, NULL,
+ dfa50_T217, dfa50_T694, dfa50_T815, NULL, dfa50_T277, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ dfa50_T401, NULL, NULL, NULL, NULL, NULL, dfa50_T189, dfa50_T196, dfa50_T425,
+ dfa50_T245, dfa50_T252, dfa50_T863, dfa50_T295, dfa50_T303, dfa50_T308,
+ dfa50_T319, dfa50_T324, dfa50_T329, dfa50_T338, dfa50_T343, dfa50_T350,
+ dfa50_T354, dfa50_T361, dfa50_T369, dfa50_T716, dfa50_T414, dfa50_T83,
+ dfa50_T820, dfa50_T433, dfa50_T443, dfa50_T452, dfa50_T889, dfa50_T506,
+ dfa50_T507, dfa50_T861, dfa50_T326, dfa50_T560, dfa50_T562, dfa50_T567,
+ dfa50_T172, dfa50_T603, dfa50_T609, dfa50_T442, dfa50_T465, dfa50_T652,
+ dfa50_T509, dfa50_T514, dfa50_T528, dfa50_T682, dfa50_T536, dfa50_T544,
+ dfa50_T548, dfa50_T450, dfa50_T464, dfa50_T574, dfa50_T577, dfa50_T590,
+ dfa50_T601, dfa50_T385, dfa50_T639, dfa50_T648, dfa50_T656, dfa50_T659,
+ dfa50_T638, dfa50_T675, dfa50_T678, dfa50_T679, dfa50_T683, dfa50_T688,
+ dfa50_T693, NULL, dfa50_T698, dfa50_T701, dfa50_T729, dfa50_T707, dfa50_T711,
+ dfa50_T0, dfa50_T714, dfa50_T718, dfa50_T720, dfa50_T722, dfa50_T724,
+ dfa50_T790, dfa50_T201, dfa50_T733, dfa50_T0, dfa50_T738, dfa50_T741,
+ dfa50_T746, dfa50_T751, dfa50_T759, NULL, dfa50_T864, dfa50_T766, dfa50_T869,
+ dfa50_T13, dfa50_T779, NULL, dfa50_T831, dfa50_T834, dfa50_T64, dfa50_T844,
+ dfa50_T75, dfa50_T852, dfa50_T855, dfa50_T859, dfa50_T111, dfa50_T215,
+ dfa50_T0, dfa50_T174, dfa50_T0, dfa50_T895, dfa50_T552, NULL, dfa50_T626,
+ dfa50_T1, dfa50_T5, dfa50_T8, dfa50_T360, dfa50_T17, dfa50_T397, dfa50_T680,
+ dfa50_T54, dfa50_T0, dfa50_T171, dfa50_T0, dfa50_T63, dfa50_T0, dfa50_T537,
+ dfa50_T557, dfa50_T585, dfa50_T0, dfa50_T0, dfa50_T88, dfa50_T93, dfa50_T99,
+ dfa50_T0, dfa50_T103, dfa50_T106, dfa50_T110, dfa50_T832, dfa50_T138,
+ dfa50_T148, dfa50_T765, dfa50_T157, dfa50_T162, dfa50_T166, dfa50_T801,
+ NULL, dfa50_T818, dfa50_T180, dfa50_T182, dfa50_T184, dfa50_T190, dfa50_T865,
+ dfa50_T558, dfa50_T224, dfa50_T901, dfa50_T246, dfa50_T0, dfa50_T0,
+ dfa50_T266, dfa50_T0, dfa50_T278, dfa50_T292, dfa50_T299, NULL, NULL,
+ NULL, NULL, NULL, dfa50_T435, NULL, dfa50_T453, NULL, dfa50_T515, NULL,
+ NULL, NULL, dfa50_T911, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, dfa50_T347, NULL, NULL, NULL, NULL, NULL, dfa50_T851, NULL, NULL,
+ NULL, dfa50_T0, NULL, NULL, NULL, NULL, dfa50_T816, NULL, NULL, NULL,
+ NULL, dfa50_T191, dfa50_T197, dfa50_T320, dfa50_T825, dfa50_T247, dfa50_T253,
+ dfa50_T270, dfa50_T283, dfa50_T296, dfa50_T304, dfa50_T309, dfa50_T321,
+ dfa50_T202, dfa50_T331, dfa50_T339, dfa50_T344, dfa50_T351, dfa50_T355,
+ dfa50_T363, dfa50_T370, dfa50_T375, dfa50_T381, dfa50_T386, dfa50_T391,
+ dfa50_T394, dfa50_T402, dfa50_T415, dfa50_T86, dfa50_T424, dfa50_T426,
+ dfa50_T432, dfa50_T434, dfa50_T444, dfa50_T454, dfa50_T458, dfa50_T151,
+ dfa50_T473, dfa50_T769, dfa50_T508, dfa50_T517, dfa50_T79, dfa50_T327,
+ dfa50_T202, dfa50_T202, dfa50_T570, dfa50_T384, dfa50_T602, dfa50_T605,
+ dfa50_T610, dfa50_T617, dfa50_T627, dfa50_T641, dfa50_T647, dfa50_T654,
+ dfa50_T511, dfa50_T516, dfa50_T529, dfa50_T520, NULL, dfa50_T538, dfa50_T545,
+ dfa50_T549, dfa50_T754, dfa50_T768, dfa50_T576, dfa50_T578, dfa50_T592,
+ dfa50_T0, dfa50_T471, dfa50_T862, dfa50_T640, dfa50_T649, dfa50_T657,
+ dfa50_T660, dfa50_T651, dfa50_T665, dfa50_T668, dfa50_T676, dfa50_T0,
+ NULL, dfa50_T684, dfa50_T689, dfa50_T695, dfa50_T699, dfa50_T702, dfa50_T101,
+ dfa50_T708, dfa50_T0, NULL, dfa50_T715, dfa50_T0, dfa50_T721, dfa50_T0,
+ dfa50_T725, dfa50_T727, dfa50_T0, dfa50_T0, NULL, dfa50_T734, NULL,
+ dfa50_T0, dfa50_T742, dfa50_T748, dfa50_T752, dfa50_T760, dfa50_T379,
+ dfa50_T767, dfa50_T871, dfa50_T14, dfa50_T40, NULL, dfa50_T0, dfa50_T835,
+ dfa50_T837, dfa50_T0, dfa50_T0, dfa50_T846, dfa50_T850, NULL, dfa50_T856,
+ NULL, dfa50_T114, dfa50_T220, NULL, dfa50_T849, dfa50_T896, dfa50_T553,
+ dfa50_T669, NULL, dfa50_T2, dfa50_T6, dfa50_T0, dfa50_T362, dfa50_T18,
+ dfa50_T25, dfa50_T27, dfa50_T31, dfa50_T33, dfa50_T438, dfa50_T48, dfa50_T55,
+ NULL, dfa50_T58, NULL, NULL, dfa50_T0, NULL, dfa50_T67, dfa50_T70, dfa50_T559,
+ dfa50_T588, NULL, NULL, dfa50_T89, dfa50_T94, dfa50_T0, NULL, dfa50_T104,
+ dfa50_T107, dfa50_T112, dfa50_T116, dfa50_T323, dfa50_T139, dfa50_T0,
+ dfa50_T149, dfa50_T152, dfa50_T158, dfa50_T163, dfa50_T167, dfa50_T709,
+ dfa50_T819, dfa50_T0, dfa50_T0, dfa50_T185, dfa50_T193, dfa50_T792,
+ dfa50_T209, dfa50_T214, dfa50_T216, dfa50_T225, dfa50_T853, dfa50_T248,
+ NULL, NULL, dfa50_T267, NULL, dfa50_T281, dfa50_T0, dfa50_T301, dfa50_T439,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, dfa50_T745, dfa50_T194,
+ dfa50_T198, NULL, dfa50_T802, dfa50_T226, dfa50_T234, dfa50_T249, dfa50_T255,
+ dfa50_T272, dfa50_T285, dfa50_T298, dfa50_T306, dfa50_T310, dfa50_T322,
+ NULL, dfa50_T332, dfa50_T340, dfa50_T345, dfa50_T352, dfa50_T356, dfa50_T364,
+ dfa50_T371, dfa50_T376, dfa50_T202, dfa50_T387, dfa50_T392, dfa50_T395,
+ dfa50_T403, dfa50_T202, dfa50_T416, dfa50_T421, NULL, dfa50_T427, NULL,
+ dfa50_T436, dfa50_T446, dfa50_T455, dfa50_T459, dfa50_T153, dfa50_T474,
+ dfa50_T481, dfa50_T489, dfa50_T208, dfa50_T510, dfa50_T519, dfa50_T81,
+ dfa50_T330, NULL, NULL, dfa50_T571, dfa50_T579, dfa50_T586, dfa50_T202,
+ dfa50_T607, dfa50_T611, dfa50_T618, dfa50_T630, dfa50_T202, dfa50_T202,
+ dfa50_T202, dfa50_T0, dfa50_T518, dfa50_T530, dfa50_T523, dfa50_T539,
+ dfa50_T0, dfa50_T550, NULL, NULL, dfa50_T564, NULL, dfa50_T0, dfa50_T580,
+ dfa50_T594, NULL, dfa50_T534, dfa50_T615, dfa50_T628, NULL, dfa50_T642,
+ dfa50_T650, dfa50_T0, dfa50_T0, dfa50_T653, dfa50_T0, dfa50_T670, dfa50_T0,
+ NULL, dfa50_T685, dfa50_T690, dfa50_T696, dfa50_T0, dfa50_T703, dfa50_T706,
+ NULL, dfa50_T710, NULL, dfa50_T0, NULL, dfa50_T0, NULL, dfa50_T0, dfa50_T0,
+ NULL, NULL, NULL, NULL, dfa50_T0, dfa50_T749, dfa50_T755, dfa50_T761,
+ NULL, NULL, dfa50_T0, dfa50_T429, dfa50_T16, dfa50_T821, dfa50_T826,
+ NULL, dfa50_T836, dfa50_T839, NULL, NULL, dfa50_T847, dfa50_T0, dfa50_T857,
+ dfa50_T747, dfa50_T223, NULL, NULL, dfa50_T898, dfa50_T554, dfa50_T674,
+ dfa50_T3, dfa50_T7, NULL, dfa50_T365, dfa50_T20, dfa50_T26, dfa50_T28,
+ dfa50_T32, dfa50_T34, dfa50_T38, dfa50_T44, dfa50_T49, dfa50_T56, dfa50_T59,
+ NULL, dfa50_T68, dfa50_T72, dfa50_T561, dfa50_T0, dfa50_T76, dfa50_T90,
+ dfa50_T95, NULL, dfa50_T105, NULL, dfa50_T113, dfa50_T0, dfa50_T479,
+ dfa50_T124, dfa50_T784, dfa50_T140, NULL, dfa50_T150, dfa50_T154, dfa50_T159,
+ dfa50_T164, dfa50_T168, dfa50_T0, NULL, dfa50_T822, NULL, NULL, dfa50_T186,
+ dfa50_T195, dfa50_T205, NULL, dfa50_T210, dfa50_T0, dfa50_T218, dfa50_T227,
+ dfa50_T236, NULL, dfa50_T0, dfa50_T268, dfa50_T282, NULL, dfa50_T0,
+ NULL, NULL, NULL, NULL, dfa50_T202, dfa50_T199, dfa50_T803, dfa50_T228,
+ dfa50_T235, dfa50_T250, dfa50_T256, dfa50_T273, dfa50_T287, dfa50_T300,
+ dfa50_T307, dfa50_T311, dfa50_T202, dfa50_T334, dfa50_T341, dfa50_T346,
+ dfa50_T353, dfa50_T357, dfa50_T366, dfa50_T372, dfa50_T377, NULL, dfa50_T389,
+ dfa50_T393, dfa50_T396, dfa50_T404, NULL, dfa50_T417, dfa50_T422, dfa50_T428,
+ dfa50_T437, dfa50_T447, dfa50_T456, dfa50_T460, dfa50_T155, dfa50_T475,
+ dfa50_T482, dfa50_T490, dfa50_T495, dfa50_T501, dfa50_T512, dfa50_T521,
+ dfa50_T84, dfa50_T333, dfa50_T572, dfa50_T202, dfa50_T589, NULL, dfa50_T608,
+ dfa50_T612, dfa50_T620, dfa50_T632, NULL, NULL, NULL, NULL, dfa50_T0,
+ dfa50_T531, dfa50_T525, dfa50_T540, NULL, dfa50_T551, dfa50_T565, NULL,
+ dfa50_T581, dfa50_T0, dfa50_T535, dfa50_T616, dfa50_T631, dfa50_T643,
+ dfa50_T0, NULL, NULL, dfa50_T655, NULL, dfa50_T671, NULL, dfa50_T686,
+ dfa50_T691, dfa50_T0, NULL, dfa50_T704, dfa50_T0, dfa50_T0, NULL, NULL,
+ NULL, NULL, NULL, dfa50_T0, dfa50_T756, dfa50_T762, NULL, dfa50_T566,
+ dfa50_T806, NULL, dfa50_T19, dfa50_T823, dfa50_T827, dfa50_T0, dfa50_T841,
+ dfa50_T848, NULL, dfa50_T858, NULL, NULL, dfa50_T866, dfa50_T870, dfa50_T875,
+ dfa50_T878, dfa50_T886, dfa50_T888, dfa50_T899, dfa50_T555, dfa50_T279,
+ dfa50_T4, dfa50_T0, dfa50_T367, dfa50_T21, NULL, dfa50_T29, NULL, dfa50_T35,
+ dfa50_T39, dfa50_T45, dfa50_T50, dfa50_T0, dfa50_T60, dfa50_T69, dfa50_T0,
+ dfa50_T280, NULL, dfa50_T77, dfa50_T91, dfa50_T97, dfa50_T0, dfa50_T115,
+ NULL, dfa50_T118, NULL, dfa50_T0, dfa50_T787, dfa50_T141, dfa50_T0,
+ dfa50_T0, dfa50_T160, dfa50_T0, dfa50_T0, NULL, dfa50_T824, dfa50_T187,
+ dfa50_T0, dfa50_T206, dfa50_T212, NULL, dfa50_T219, dfa50_T0, dfa50_T238,
+ NULL, dfa50_T0, dfa50_T284, NULL, NULL, dfa50_T200, dfa50_T804, dfa50_T229,
+ dfa50_T237, dfa50_T202, dfa50_T257, dfa50_T274, dfa50_T288, dfa50_T302,
+ dfa50_T202, dfa50_T312, NULL, dfa50_T335, NULL, dfa50_T348, dfa50_T202,
+ dfa50_T358, dfa50_T368, dfa50_T373, dfa50_T380, NULL, NULL, dfa50_T398,
+ dfa50_T405, dfa50_T418, NULL, NULL, dfa50_T440, dfa50_T448, dfa50_T457,
+ dfa50_T461, NULL, dfa50_T467, dfa50_T476, dfa50_T483, dfa50_T492, dfa50_T496,
+ dfa50_T502, dfa50_T513, dfa50_T524, dfa50_T263, dfa50_T336, dfa50_T573,
+ NULL, dfa50_T591, dfa50_T202, dfa50_T613, dfa50_T621, dfa50_T634, NULL,
+ dfa50_T532, dfa50_T526, dfa50_T0, dfa50_T0, dfa50_T0, dfa50_T582, NULL,
+ dfa50_T838, dfa50_T0, dfa50_T633, dfa50_T645, NULL, dfa50_T917, dfa50_T673,
+ dfa50_T0, dfa50_T0, NULL, dfa50_T0, NULL, NULL, NULL, dfa50_T757, dfa50_T0,
+ dfa50_T771, dfa50_T777, dfa50_T780, dfa50_T788, dfa50_T793, dfa50_T797,
+ dfa50_T807, dfa50_T22, dfa50_T0, dfa50_T829, NULL, dfa50_T842, dfa50_T0,
+ dfa50_T0, dfa50_T867, dfa50_T872, dfa50_T876, dfa50_T879, dfa50_T887,
+ dfa50_T890, dfa50_T900, dfa50_T0, dfa50_T239, NULL, dfa50_T0, NULL,
+ dfa50_T57, dfa50_T0, dfa50_T0, dfa50_T36, dfa50_T41, dfa50_T46, dfa50_T51,
+ NULL, dfa50_T61, dfa50_T0, NULL, dfa50_T74, NULL, dfa50_T0, dfa50_T0,
+ dfa50_T98, NULL, NULL, dfa50_T119, NULL, dfa50_T791, dfa50_T142, NULL,
+ NULL, dfa50_T0, NULL, NULL, dfa50_T175, dfa50_T177, dfa50_T0, NULL,
+ dfa50_T207, dfa50_T0, dfa50_T221, NULL, dfa50_T241, NULL, dfa50_T286,
+ dfa50_T203, dfa50_T805, dfa50_T230, dfa50_T240, NULL, dfa50_T258, dfa50_T202,
+ dfa50_T289, NULL, NULL, dfa50_T313, dfa50_T337, NULL, NULL, dfa50_T359,
+ dfa50_T202, NULL, dfa50_T202, dfa50_T399, dfa50_T406, dfa50_T419, dfa50_T441,
+ dfa50_T202, NULL, dfa50_T202, dfa50_T468, dfa50_T477, dfa50_T484, dfa50_T493,
+ dfa50_T497, dfa50_T503, NULL, NULL, NULL, dfa50_T546, NULL, dfa50_T563,
+ dfa50_T575, dfa50_T593, NULL, NULL, dfa50_T622, dfa50_T636, dfa50_T533,
+ dfa50_T0, NULL, NULL, NULL, dfa50_T583, dfa50_T604, NULL, NULL, dfa50_T635,
+ dfa50_T0, dfa50_T663, NULL, dfa50_T0, NULL, NULL, NULL, dfa50_T0, NULL,
+ dfa50_T772, dfa50_T778, dfa50_T781, dfa50_T789, dfa50_T794, dfa50_T798,
+ dfa50_T809, dfa50_T568, NULL, dfa50_T0, dfa50_T0, NULL, NULL, dfa50_T868,
+ dfa50_T873, dfa50_T877, dfa50_T880, dfa50_T0, dfa50_T0, dfa50_T0, NULL,
+ dfa50_T902, dfa50_T909, dfa50_T913, dfa50_T918, dfa50_T921, NULL, dfa50_T10,
+ NULL, NULL, NULL, dfa50_T37, dfa50_T42, dfa50_T47, dfa50_T52, dfa50_T0,
+ NULL, NULL, NULL, NULL, dfa50_T0, dfa50_T120, dfa50_T126, dfa50_T130,
+ dfa50_T735, dfa50_T144, NULL, dfa50_T176, dfa50_T178, NULL, dfa50_T0,
+ NULL, dfa50_T222, dfa50_T243, dfa50_T0, dfa50_T204, dfa50_T808, dfa50_T231,
+ dfa50_T242, dfa50_T259, NULL, dfa50_T290, dfa50_T314, dfa50_T202, dfa50_T202,
+ NULL, NULL, dfa50_T400, dfa50_T407, NULL, dfa50_T202, NULL, NULL, dfa50_T469,
+ NULL, dfa50_T485, dfa50_T494, dfa50_T498, dfa50_T504, NULL, NULL, NULL,
+ dfa50_T202, dfa50_T595, dfa50_T623, NULL, NULL, NULL, dfa50_T0, dfa50_T606,
+ dfa50_T0, NULL, dfa50_T0, NULL, NULL, dfa50_T773, dfa50_T0, dfa50_T782,
+ dfa50_T0, dfa50_T796, dfa50_T0, dfa50_T810, NULL, NULL, NULL, NULL,
+ dfa50_T0, dfa50_T0, dfa50_T0, dfa50_T881, NULL, NULL, NULL, dfa50_T903,
+ dfa50_T910, dfa50_T914, dfa50_T919, dfa50_T922, dfa50_T11, dfa50_T0,
+ dfa50_T0, dfa50_T0, NULL, NULL, NULL, dfa50_T121, dfa50_T127, dfa50_T0,
+ dfa50_T133, dfa50_T135, dfa50_T0, dfa50_T0, dfa50_T179, NULL, dfa50_T0,
+ dfa50_T0, NULL, NULL, dfa50_T817, dfa50_T232, dfa50_T244, dfa50_T260,
+ dfa50_T202, dfa50_T315, NULL, NULL, NULL, dfa50_T408, NULL, dfa50_T470,
+ dfa50_T486, NULL, dfa50_T499, dfa50_T505, NULL, dfa50_T596, dfa50_T624,
+ NULL, dfa50_T0, NULL, NULL, dfa50_T774, NULL, dfa50_T0, NULL, dfa50_T0,
+ NULL, dfa50_T811, NULL, NULL, NULL, dfa50_T882, dfa50_T904, dfa50_T0,
+ dfa50_T916, dfa50_T0, dfa50_T0, dfa50_T12, NULL, NULL, NULL, dfa50_T122,
+ dfa50_T128, NULL, dfa50_T0, dfa50_T136, NULL, NULL, dfa50_T0, NULL,
+ NULL, NULL, NULL, dfa50_T233, dfa50_T202, dfa50_T261, NULL, dfa50_T316,
+ dfa50_T410, NULL, NULL, NULL, NULL, dfa50_T597, dfa50_T625, NULL, dfa50_T775,
+ NULL, NULL, dfa50_T812, dfa50_T883, dfa50_T906, NULL, dfa50_T0, NULL,
+ NULL, dfa50_T0, dfa50_T123, dfa50_T129, NULL, dfa50_T0, NULL, dfa50_T202,
+ NULL, dfa50_T264, NULL, dfa50_T411, dfa50_T598, NULL, dfa50_T0, dfa50_T813,
+ dfa50_T885, dfa50_T907, NULL, NULL, dfa50_T0, dfa50_T0, NULL, NULL,
+ NULL, NULL, dfa50_T599, NULL, dfa50_T0, NULL, dfa50_T0, NULL, NULL,
+ NULL, NULL, NULL
+};
+
+
+/* Declare tracking structure for Cyclic DFA 50
+ */
+static
+ANTLR3_CYCLIC_DFA cdfa50
+ = {
+ 50, /* Decision number of this dfa */
+ /* Which decision this represents: */
+ (const pANTLR3_UCHAR)"1:1: Tokens : ( T__144 | T__145 | T__146 | T__147 | T__148 | T__149 | T__150 | T__151 | T__152 | T__153 | T__154 | T__155 | T__156 | T__157 | T__158 | T__159 | T__160 | T__161 | T__162 | T__163 | T__164 | T__165 | T__166 | T__167 | T__168 | T__169 | T__170 | T__171 | T__172 | T__173 | T__174 | T__175 | T__176 | T__177 | T__178 | T__179 | T__180 | T__181 | T__182 | T__183 | T__184 | T__185 | T__186 | T__187 | T__188 | T__189 | T__190 | T__191 | T__192 | T__193 | T__194 | T__195 | T__196 | T__197 | T__198 | T__199 | T__200 | T__201 | T__202 | T__203 | T__204 | T__205 | T__206 | T__207 | T__208 | T__209 | T__210 | T__211 | T__212 | T__213 | T__214 | T__215 | T__216 | T__217 | T__218 | T__219 | T__220 | T__221 | T__222 | T__223 | T__224 | T__225 | T__226 | T__227 | T__228 | T__229 | T__230 | T__231 | T__232 | T__233 | T__234 | T__235 | T__236 | T__237 | T__238 | T__239 | T__240 | T__241 | T__242 | T__243 | T__244 | T__245 | T__246 | T__247 | T__248 | T__249 | T__250 | T__251 | T__252 | T__253 | T__254 | T__255 | T__256 | T__257 | T__258 | T__259 | T__260 | T__261 | T__262 | T__263 | T__264 | T__265 | T__266 | T__267 | T__268 | T__269 | T__270 | T__271 | T__272 | T__273 | T__274 | T__275 | T__276 | T__277 | T__278 | T__279 | T__280 | T__281 | T__282 | T__283 | T__284 | T__285 | T__286 | T__287 | T__288 | T__289 | T__290 | T__291 | T__292 | T__293 | T__294 | T__295 | T__296 | T__297 | T__298 | T__299 | T__300 | T__301 | T__302 | T__303 | T__304 | T__305 | T__306 | T__307 | T__308 | T__309 | T__310 | T__311 | T__312 | T__313 | T__314 | T__315 | T__316 | T__317 | T__318 | T__319 | T__320 | T__321 | T__322 | T__323 | T__324 | T__325 | T__326 | T__327 | T__328 | T__329 | T__330 | T__331 | T__332 | T__333 | T__334 | T__335 | T__336 | T__337 | T__338 | T__339 | T__340 | T__341 | T__342 | T__343 | T__344 | T__345 | T__346 | T__347 | T__348 | T__349 | T__350 | T__351 | T__352 | T__353 | T__354 | T__355 | T__356 | T__357 | T__358 | T__359 | T__360 | T__361 | T__362 | T__363 | T__364 | T__365 | T__366 | T__367 | T__368 | T__369 | T__370 | T__371 | T__372 | T__373 | T__374 | T__375 | T__376 | T__377 | T__378 | T__379 | T__380 | T__381 | T__382 | T__383 | T__384 | T__385 | T__386 | T__387 | T__388 | T__389 | T__390 | T__391 | T__392 | T__393 | T__394 | T__395 | T__396 | T__397 | T__398 | T__399 | T__400 | T__401 | T__402 | T__403 | T__404 | T__405 | T__406 | T__407 | T__408 | T__409 | T__410 | T__411 | T__412 | T__413 | T__414 | T__415 | T__416 | T__417 | OP_ATOMIC_SEQUENCE | OP_SEQUENCE | OP_SEQUENCE_SIDE | OP_SEQUENCE_WEAK | OP_SCHEDULE_GT | OP_SCHEDULE_LT | OP_SCHEDULE_XOR | OP_SCHEDULE_AND_THEN | OP_SCHEDULE_OR_ELSE | OP_NON_DETERMINISM | OP_CONCURRENCY_ASYNC | OP_CONCURRENCY_AND | OP_CONCURRENCY_OR | OP_CONCURRENCY_INTERLEAVING | OP_CONCURRENCY_PARALLEL | OP_FORK | OP_JOIN | OP_CONCURRENCY_RDV_ASYNC | OP_CONCURRENCY_RDV_AND | OP_CONCURRENCY_RDV_OR | OP_CONCURRENCY_RDV_INTERLEAVING | OP_CONCURRENCY_RDV_PARALLEL | ASSIGN | ASSIGN_AFTER | ASSIGN_REF | ASSIGN_MACRO | OP_PUSH | OP_ASSIGN_TOP | OP_TOP | OP_POP | LPAREN | RPAREN | LCURLY | RCURLY | LBRACKET | RBRACKET | LBRACKET_EXCEPT | LPAREN_INVOKE | LCURLY_INVOKE | PERCENT_LPAREN_INVOKE | PERCENT_LPAREN | RPAREN_PERCENT | STATEMENT_PROMPT | DOLLAR_LCURLY | RCURLY_DOLLAR | PERCENT_LCURLY | RCURLY_PERCENT | LBRACKET_BAR | BAR_RBRACKET | LBRACKET_LCURLY | RCURLY_RBRACKET | COLON | COMMA | QUESTION | SEMI | DIESE | DOLLAR | DOT | DOTDOT | COLONx2 | LAND | LAND_THEN | LAND_ASSIGN | LAND_ASSIGN_AFTER | LNOT | LOR | LOR_ELSE | LOR_ASSIGN | LOR_ASSIGN_AFTER | LXOR | EQUAL | NEQUAL | SEQUAL | NSEQUAL | LTE | LT_ | GTE | GT | PLUS | PLUS_ASSIGN | PLUS_ASSIGN_AFTER | INCR | MINUS | MINUS_ASSIGN | MINUS_ASSIGN_AFTER | DECR | STAR | STAR_ASSIGN | STAR_ASSIGN_AFTER | DIV | DIV_ASSIGN | DIV_ASSIGN_AFTER | MOD | MOD_ASSIGN | MOD_ASSIGN_AFTER | RSHIFT | RSHIFT_ASSIGN | RSHIFT_ASSIGN_AFTER | LSHIFT | LSHIFT_ASSIGN | LSHIFT_ASSIGN_AFTER | BAND | BAND_ASSIGN | BAND_ASSIGN_AFTER | BNOT | BOR | BOR_ASSIGN | BOR_ASSIGN_AFTER | BXOR | BXOR_ASSIGN | BXOR_ASSIGN_AFTER | ID | AT_ID | StringLiteral | CharLiteral | NumberLiteral | COMMENT | WS );",
+ (CDFA_SPECIAL_FUNC) antlr3dfaspecialStateTransition, /* Default special state transition function */
+
+ antlr3dfaspecialTransition, /* DFA specialTransition is currently just a default function in the runtime */
+ antlr3dfapredict, /* DFA simulator function is in the runtime */
+ dfa50_eot, /* EOT table */
+ dfa50_eof, /* EOF table */
+ dfa50_min, /* Minimum tokens for each state */
+ dfa50_max, /* Maximum tokens for each state */
+ dfa50_accept, /* Accept table */
+ dfa50_special, /* Special transition states */
+ dfa50_transitions /* Table of transition tables */
+
+ };
+/* End of Cyclic DFA 50
+ * ---------------------
+ */
+/* =========================================================================
+ * End of DFA tables for the lexer
+ */
+
+/* =========================================================================
+ * Functions to match the lexer grammar defined tokens from the input stream
+ */
+
+// Comes from: 11:8: ( '#dhistory' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__144
+ *
+ * Looks to match the characters the constitute the token T__144
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__144(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__144;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:11:8: ( '#dhistory' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:11:10: '#dhistory'
+ {
+ MATCHS(lit_1);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__144Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__144Ex; /* Prevent compiler warnings */
+ ruleT__144Ex: ;
+
+}
+// $ANTLR end T__144
+
+// Comes from: 12:8: ( '#final' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__145
+ *
+ * Looks to match the characters the constitute the token T__145
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__145(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__145;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:12:8: ( '#final' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:12:10: '#final'
+ {
+ MATCHS(lit_2);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__145Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__145Ex; /* Prevent compiler warnings */
+ ruleT__145Ex: ;
+
+}
+// $ANTLR end T__145
+
+// Comes from: 13:8: ( '#init' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__146
+ *
+ * Looks to match the characters the constitute the token T__146
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__146(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__146;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:13:8: ( '#init' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:13:10: '#init'
+ {
+ MATCHS(lit_3);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__146Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__146Ex; /* Prevent compiler warnings */
+ ruleT__146Ex: ;
+
+}
+// $ANTLR end T__146
+
+// Comes from: 14:8: ( '#initial' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__147
+ *
+ * Looks to match the characters the constitute the token T__147
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__147(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__147;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:14:8: ( '#initial' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:14:10: '#initial'
+ {
+ MATCHS(lit_4);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__147Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__147Ex; /* Prevent compiler warnings */
+ ruleT__147Ex: ;
+
+}
+// $ANTLR end T__147
+
+// Comes from: 15:8: ( '#return' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__148
+ *
+ * Looks to match the characters the constitute the token T__148
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__148(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__148;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:15:8: ( '#return' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:15:10: '#return'
+ {
+ MATCHS(lit_5);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__148Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__148Ex; /* Prevent compiler warnings */
+ ruleT__148Ex: ;
+
+}
+// $ANTLR end T__148
+
+// Comes from: 16:8: ( '#shistory' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__149
+ *
+ * Looks to match the characters the constitute the token T__149
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__149(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__149;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:16:8: ( '#shistory' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:16:10: '#shistory'
+ {
+ MATCHS(lit_6);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__149Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__149Ex; /* Prevent compiler warnings */
+ ruleT__149Ex: ;
+
+}
+// $ANTLR end T__149
+
+// Comes from: 17:8: ( '#start' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__150
+ *
+ * Looks to match the characters the constitute the token T__150
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__150(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__150;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:17:8: ( '#start' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:17:10: '#start'
+ {
+ MATCHS(lit_7);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__150Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__150Ex; /* Prevent compiler warnings */
+ ruleT__150Ex: ;
+
+}
+// $ANTLR end T__150
+
+// Comes from: 18:8: ( '#stf' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__151
+ *
+ * Looks to match the characters the constitute the token T__151
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__151(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__151;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:18:8: ( '#stf' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:18:10: '#stf'
+ {
+ MATCHS(lit_8);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__151Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__151Ex; /* Prevent compiler warnings */
+ ruleT__151Ex: ;
+
+}
+// $ANTLR end T__151
+
+// Comes from: 19:8: ( '#sts' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__152
+ *
+ * Looks to match the characters the constitute the token T__152
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__152(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__152;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:19:8: ( '#sts' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:19:10: '#sts'
+ {
+ MATCHS(lit_9);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__152Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__152Ex; /* Prevent compiler warnings */
+ ruleT__152Ex: ;
+
+}
+// $ANTLR end T__152
+
+// Comes from: 20:8: ( '#terminal' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__153
+ *
+ * Looks to match the characters the constitute the token T__153
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__153(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__153;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:20:8: ( '#terminal' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:20:10: '#terminal'
+ {
+ MATCHS(lit_10);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__153Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__153Ex; /* Prevent compiler warnings */
+ ruleT__153Ex: ;
+
+}
+// $ANTLR end T__153
+
+// Comes from: 21:8: ( '$:comment' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__154
+ *
+ * Looks to match the characters the constitute the token T__154
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__154(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__154;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:21:8: ( '$:comment' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:21:10: '$:comment'
+ {
+ MATCHS(lit_11);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__154Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__154Ex; /* Prevent compiler warnings */
+ ruleT__154Ex: ;
+
+}
+// $ANTLR end T__154
+
+// Comes from: 22:8: ( '$:debug' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__155
+ *
+ * Looks to match the characters the constitute the token T__155
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__155(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__155;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:22:8: ( '$:debug' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:22:10: '$:debug'
+ {
+ MATCHS(lit_12);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__155Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__155Ex; /* Prevent compiler warnings */
+ ruleT__155Ex: ;
+
+}
+// $ANTLR end T__155
+
+// Comes from: 23:8: ( '$:informal' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__156
+ *
+ * Looks to match the characters the constitute the token T__156
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__156(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__156;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:23:8: ( '$:informal' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:23:10: '$:informal'
+ {
+ MATCHS(lit_13);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__156Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__156Ex; /* Prevent compiler warnings */
+ ruleT__156Ex: ;
+
+}
+// $ANTLR end T__156
+
+// Comes from: 24:8: ( '$:trace' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__157
+ *
+ * Looks to match the characters the constitute the token T__157
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__157(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__157;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:24:8: ( '$:trace' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:24:10: '$:trace'
+ {
+ MATCHS(lit_14);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__157Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__157Ex; /* Prevent compiler warnings */
+ ruleT__157Ex: ;
+
+}
+// $ANTLR end T__157
+
+// Comes from: 25:8: ( '$env' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__158
+ *
+ * Looks to match the characters the constitute the token T__158
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__158(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__158;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:25:8: ( '$env' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:25:10: '$env'
+ {
+ MATCHS(lit_15);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__158Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__158Ex; /* Prevent compiler warnings */
+ ruleT__158Ex: ;
+
+}
+// $ANTLR end T__158
+
+// Comes from: 26:8: ( '$parent' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__159
+ *
+ * Looks to match the characters the constitute the token T__159
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__159(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__159;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:26:8: ( '$parent' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:26:10: '$parent'
+ {
+ MATCHS(lit_16);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__159Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__159Ex; /* Prevent compiler warnings */
+ ruleT__159Ex: ;
+
+}
+// $ANTLR end T__159
+
+// Comes from: 27:8: ( '$self' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__160
+ *
+ * Looks to match the characters the constitute the token T__160
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__160(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__160;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:27:8: ( '$self' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:27:10: '$self'
+ {
+ MATCHS(lit_17);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__160Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__160Ex; /* Prevent compiler warnings */
+ ruleT__160Ex: ;
+
+}
+// $ANTLR end T__160
+
+// Comes from: 28:8: ( '$super' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__161
+ *
+ * Looks to match the characters the constitute the token T__161
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__161(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__161;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:28:8: ( '$super' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:28:10: '$super'
+ {
+ MATCHS(lit_18);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__161Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__161Ex; /* Prevent compiler warnings */
+ ruleT__161Ex: ;
+
+}
+// $ANTLR end T__161
+
+// Comes from: 29:8: ( '$this' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__162
+ *
+ * Looks to match the characters the constitute the token T__162
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__162(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__162;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:29:8: ( '$this' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:29:10: '$this'
+ {
+ MATCHS(lit_19);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__162Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__162Ex; /* Prevent compiler warnings */
+ ruleT__162Ex: ;
+
+}
+// $ANTLR end T__162
+
+// Comes from: 30:8: ( '-->' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__163
+ *
+ * Looks to match the characters the constitute the token T__163
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__163(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__163;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:30:8: ( '-->' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:30:10: '-->'
+ {
+ MATCHS(lit_20);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__163Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__163Ex; /* Prevent compiler warnings */
+ ruleT__163Ex: ;
+
+}
+// $ANTLR end T__163
+
+// Comes from: 31:8: ( '->' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__164
+ *
+ * Looks to match the characters the constitute the token T__164
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__164(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__164;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:31:8: ( '->' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:31:10: '->'
+ {
+ MATCHS(lit_21);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__164Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__164Ex; /* Prevent compiler warnings */
+ ruleT__164Ex: ;
+
+}
+// $ANTLR end T__164
+
+// Comes from: 32:8: ( '<--' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__165
+ *
+ * Looks to match the characters the constitute the token T__165
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__165(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__165;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:32:8: ( '<--' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:32:10: '<--'
+ {
+ MATCHS(lit_22);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__165Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__165Ex; /* Prevent compiler warnings */
+ ruleT__165Ex: ;
+
+}
+// $ANTLR end T__165
+
+// Comes from: 33:8: ( '<->' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__166
+ *
+ * Looks to match the characters the constitute the token T__166
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__166(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__166;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:33:8: ( '<->' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:33:10: '<->'
+ {
+ MATCHS(lit_23);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__166Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__166Ex; /* Prevent compiler warnings */
+ ruleT__166Ex: ;
+
+}
+// $ANTLR end T__166
+
+// Comes from: 34:8: ( '<==' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__167
+ *
+ * Looks to match the characters the constitute the token T__167
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__167(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__167;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:34:8: ( '<==' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:34:10: '<=='
+ {
+ MATCHS(lit_24);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__167Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__167Ex; /* Prevent compiler warnings */
+ ruleT__167Ex: ;
+
+}
+// $ANTLR end T__167
+
+// Comes from: 35:8: ( '==>' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__168
+ *
+ * Looks to match the characters the constitute the token T__168
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__168(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__168;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:35:8: ( '==>' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:35:10: '==>'
+ {
+ MATCHS(lit_25);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__168Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__168Ex; /* Prevent compiler warnings */
+ ruleT__168Ex: ;
+
+}
+// $ANTLR end T__168
+
+// Comes from: 36:8: ( '@' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__169
+ *
+ * Looks to match the characters the constitute the token T__169
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__169(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__169;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:36:8: ( '@' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:36:10: '@'
+ {
+ MATCHC('@');
+ if (HASEXCEPTION())
+ {
+ goto ruleT__169Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__169Ex; /* Prevent compiler warnings */
+ ruleT__169Ex: ;
+
+}
+// $ANTLR end T__169
+
+// Comes from: 37:8: ( '@abort' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__170
+ *
+ * Looks to match the characters the constitute the token T__170
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__170(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__170;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:37:8: ( '@abort' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:37:10: '@abort'
+ {
+ MATCHS(lit_26);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__170Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__170Ex; /* Prevent compiler warnings */
+ ruleT__170Ex: ;
+
+}
+// $ANTLR end T__170
+
+// Comes from: 38:8: ( '@behavior:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__171
+ *
+ * Looks to match the characters the constitute the token T__171
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__171(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__171;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:38:8: ( '@behavior:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:38:10: '@behavior:'
+ {
+ MATCHS(lit_27);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__171Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__171Ex; /* Prevent compiler warnings */
+ ruleT__171Ex: ;
+
+}
+// $ANTLR end T__171
+
+// Comes from: 39:8: ( '@com:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__172
+ *
+ * Looks to match the characters the constitute the token T__172
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__172(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__172;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:39:8: ( '@com:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:39:10: '@com:'
+ {
+ MATCHS(lit_28);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__172Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__172Ex; /* Prevent compiler warnings */
+ ruleT__172Ex: ;
+
+}
+// $ANTLR end T__172
+
+// Comes from: 40:8: ( '@composite' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__173
+ *
+ * Looks to match the characters the constitute the token T__173
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__173(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__173;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:40:8: ( '@composite' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:40:10: '@composite'
+ {
+ MATCHS(lit_29);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__173Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__173Ex; /* Prevent compiler warnings */
+ ruleT__173Ex: ;
+
+}
+// $ANTLR end T__173
+
+// Comes from: 41:8: ( '@composite:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__174
+ *
+ * Looks to match the characters the constitute the token T__174
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__174(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__174;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:41:8: ( '@composite:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:41:10: '@composite:'
+ {
+ MATCHS(lit_30);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__174Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__174Ex; /* Prevent compiler warnings */
+ ruleT__174Ex: ;
+
+}
+// $ANTLR end T__174
+
+// Comes from: 42:8: ( '@concurrency' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__175
+ *
+ * Looks to match the characters the constitute the token T__175
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__175(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__175;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:42:8: ( '@concurrency' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:42:10: '@concurrency'
+ {
+ MATCHS(lit_31);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__175Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__175Ex; /* Prevent compiler warnings */
+ ruleT__175Ex: ;
+
+}
+// $ANTLR end T__175
+
+// Comes from: 43:8: ( '@constraint' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__176
+ *
+ * Looks to match the characters the constitute the token T__176
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__176(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__176;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:43:8: ( '@constraint' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:43:10: '@constraint'
+ {
+ MATCHS(lit_32);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__176Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__176Ex; /* Prevent compiler warnings */
+ ruleT__176Ex: ;
+
+}
+// $ANTLR end T__176
+
+// Comes from: 44:8: ( '@create' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__177
+ *
+ * Looks to match the characters the constitute the token T__177
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__177(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__177;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:44:8: ( '@create' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:44:10: '@create'
+ {
+ MATCHS(lit_33);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__177Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__177Ex; /* Prevent compiler warnings */
+ ruleT__177Ex: ;
+
+}
+// $ANTLR end T__177
+
+// Comes from: 45:8: ( '@declaration:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__178
+ *
+ * Looks to match the characters the constitute the token T__178
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__178(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__178;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:45:8: ( '@declaration:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:45:10: '@declaration:'
+ {
+ MATCHS(lit_34);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__178Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__178Ex; /* Prevent compiler warnings */
+ ruleT__178Ex: ;
+
+}
+// $ANTLR end T__178
+
+// Comes from: 46:8: ( '@disable' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__179
+ *
+ * Looks to match the characters the constitute the token T__179
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__179(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__179;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:46:8: ( '@disable' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:46:10: '@disable'
+ {
+ MATCHS(lit_35);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__179Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__179Ex; /* Prevent compiler warnings */
+ ruleT__179Ex: ;
+
+}
+// $ANTLR end T__179
+
+// Comes from: 47:8: ( '@diversity' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__180
+ *
+ * Looks to match the characters the constitute the token T__180
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__180(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__180;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:47:8: ( '@diversity' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:47:10: '@diversity'
+ {
+ MATCHS(lit_36);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__180Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__180Ex; /* Prevent compiler warnings */
+ ruleT__180Ex: ;
+
+}
+// $ANTLR end T__180
+
+// Comes from: 48:8: ( '@effect:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__181
+ *
+ * Looks to match the characters the constitute the token T__181
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__181(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__181;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:48:8: ( '@effect:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:48:10: '@effect:'
+ {
+ MATCHS(lit_37);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__181Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__181Ex; /* Prevent compiler warnings */
+ ruleT__181Ex: ;
+
+}
+// $ANTLR end T__181
+
+// Comes from: 49:8: ( '@enable' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__182
+ *
+ * Looks to match the characters the constitute the token T__182
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__182(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__182;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:49:8: ( '@enable' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:49:10: '@enable'
+ {
+ MATCHS(lit_38);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__182Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__182Ex; /* Prevent compiler warnings */
+ ruleT__182Ex: ;
+
+}
+// $ANTLR end T__182
+
+// Comes from: 50:8: ( '@executable:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__183
+ *
+ * Looks to match the characters the constitute the token T__183
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__183(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__183;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:50:8: ( '@executable:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:50:10: '@executable:'
+ {
+ MATCHS(lit_39);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__183Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__183Ex; /* Prevent compiler warnings */
+ ruleT__183Ex: ;
+
+}
+// $ANTLR end T__183
+
+// Comes from: 51:8: ( '@final' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__184
+ *
+ * Looks to match the characters the constitute the token T__184
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__184(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__184;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:51:8: ( '@final' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:51:10: '@final'
+ {
+ MATCHS(lit_40);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__184Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__184Ex; /* Prevent compiler warnings */
+ ruleT__184Ex: ;
+
+}
+// $ANTLR end T__184
+
+// Comes from: 52:8: ( '@fml' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__185
+ *
+ * Looks to match the characters the constitute the token T__185
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__185(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__185;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:52:8: ( '@fml' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:52:10: '@fml'
+ {
+ MATCHS(lit_41);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__185Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__185Ex; /* Prevent compiler warnings */
+ ruleT__185Ex: ;
+
+}
+// $ANTLR end T__185
+
+// Comes from: 53:8: ( '@formalml' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__186
+ *
+ * Looks to match the characters the constitute the token T__186
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__186(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__186;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:53:8: ( '@formalml' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:53:10: '@formalml'
+ {
+ MATCHS(lit_42);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__186Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__186Ex; /* Prevent compiler warnings */
+ ruleT__186Ex: ;
+
+}
+// $ANTLR end T__186
+
+// Comes from: 54:8: ( '@guard:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__187
+ *
+ * Looks to match the characters the constitute the token T__187
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__187(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__187;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:54:8: ( '@guard:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:54:10: '@guard:'
+ {
+ MATCHS(lit_43);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__187Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__187Ex; /* Prevent compiler warnings */
+ ruleT__187Ex: ;
+
+}
+// $ANTLR end T__187
+
+// Comes from: 55:8: ( '@header:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__188
+ *
+ * Looks to match the characters the constitute the token T__188
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__188(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__188;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:55:8: ( '@header:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:55:10: '@header:'
+ {
+ MATCHS(lit_44);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__188Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__188Ex; /* Prevent compiler warnings */
+ ruleT__188Ex: ;
+
+}
+// $ANTLR end T__188
+
+// Comes from: 56:8: ( '@iabort' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__189
+ *
+ * Looks to match the characters the constitute the token T__189
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__189(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__189;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:56:8: ( '@iabort' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:56:10: '@iabort'
+ {
+ MATCHS(lit_45);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__189Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__189Ex; /* Prevent compiler warnings */
+ ruleT__189Ex: ;
+
+}
+// $ANTLR end T__189
+
+// Comes from: 57:8: ( '@idisable' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__190
+ *
+ * Looks to match the characters the constitute the token T__190
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__190(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__190;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:57:8: ( '@idisable' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:57:10: '@idisable'
+ {
+ MATCHS(lit_46);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__190Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__190Ex; /* Prevent compiler warnings */
+ ruleT__190Ex: ;
+
+}
+// $ANTLR end T__190
+
+// Comes from: 58:8: ( '@ienable' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__191
+ *
+ * Looks to match the characters the constitute the token T__191
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__191(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__191;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:58:8: ( '@ienable' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:58:10: '@ienable'
+ {
+ MATCHS(lit_47);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__191Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__191Ex; /* Prevent compiler warnings */
+ ruleT__191Ex: ;
+
+}
+// $ANTLR end T__191
+
+// Comes from: 59:8: ( '@import:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__192
+ *
+ * Looks to match the characters the constitute the token T__192
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__192(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__192;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:59:8: ( '@import:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:59:10: '@import:'
+ {
+ MATCHS(lit_48);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__192Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__192Ex; /* Prevent compiler warnings */
+ ruleT__192Ex: ;
+
+}
+// $ANTLR end T__192
+
+// Comes from: 60:8: ( '@include' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__193
+ *
+ * Looks to match the characters the constitute the token T__193
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__193(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__193;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:60:8: ( '@include' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:60:10: '@include'
+ {
+ MATCHS(lit_49);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__193Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__193Ex; /* Prevent compiler warnings */
+ ruleT__193Ex: ;
+
+}
+// $ANTLR end T__193
+
+// Comes from: 61:8: ( '@init' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__194
+ *
+ * Looks to match the characters the constitute the token T__194
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__194(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__194;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:61:8: ( '@init' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:61:10: '@init'
+ {
+ MATCHS(lit_50);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__194Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__194Ex; /* Prevent compiler warnings */
+ ruleT__194Ex: ;
+
+}
+// $ANTLR end T__194
+
+// Comes from: 62:8: ( '@inout:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__195
+ *
+ * Looks to match the characters the constitute the token T__195
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__195(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__195;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:62:8: ( '@inout:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:62:10: '@inout:'
+ {
+ MATCHS(lit_51);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__195Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__195Ex; /* Prevent compiler warnings */
+ ruleT__195Ex: ;
+
+}
+// $ANTLR end T__195
+
+// Comes from: 63:8: ( '@input:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__196
+ *
+ * Looks to match the characters the constitute the token T__196
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__196(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__196;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:63:8: ( '@input:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:63:10: '@input:'
+ {
+ MATCHS(lit_52);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__196Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__196Ex; /* Prevent compiler warnings */
+ ruleT__196Ex: ;
+
+}
+// $ANTLR end T__196
+
+// Comes from: 64:8: ( '@instance:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__197
+ *
+ * Looks to match the characters the constitute the token T__197
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__197(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__197;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:64:8: ( '@instance:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:64:10: '@instance:'
+ {
+ MATCHS(lit_53);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__197Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__197Ex; /* Prevent compiler warnings */
+ ruleT__197Ex: ;
+
+}
+// $ANTLR end T__197
+
+// Comes from: 65:8: ( '@interaction:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__198
+ *
+ * Looks to match the characters the constitute the token T__198
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__198(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__198;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:65:8: ( '@interaction:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:65:10: '@interaction:'
+ {
+ MATCHS(lit_54);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__198Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__198Ex; /* Prevent compiler warnings */
+ ruleT__198Ex: ;
+
+}
+// $ANTLR end T__198
+
+// Comes from: 66:8: ( '@irun' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__199
+ *
+ * Looks to match the characters the constitute the token T__199
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__199(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__199;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:66:8: ( '@irun' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:66:10: '@irun'
+ {
+ MATCHS(lit_55);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__199Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__199Ex; /* Prevent compiler warnings */
+ ruleT__199Ex: ;
+
+}
+// $ANTLR end T__199
+
+// Comes from: 67:8: ( '@machine:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__200
+ *
+ * Looks to match the characters the constitute the token T__200
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__200(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__200;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:67:8: ( '@machine:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:67:10: '@machine:'
+ {
+ MATCHS(lit_56);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__200Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__200Ex; /* Prevent compiler warnings */
+ ruleT__200Ex: ;
+
+}
+// $ANTLR end T__200
+
+// Comes from: 68:8: ( '@macro:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__201
+ *
+ * Looks to match the characters the constitute the token T__201
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__201(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__201;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:68:8: ( '@macro:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:68:10: '@macro:'
+ {
+ MATCHS(lit_57);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__201Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__201Ex; /* Prevent compiler warnings */
+ ruleT__201Ex: ;
+
+}
+// $ANTLR end T__201
+
+// Comes from: 69:8: ( '@moc:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__202
+ *
+ * Looks to match the characters the constitute the token T__202
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__202(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__202;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:69:8: ( '@moc:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:69:10: '@moc:'
+ {
+ MATCHS(lit_58);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__202Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__202Ex; /* Prevent compiler warnings */
+ ruleT__202Ex: ;
+
+}
+// $ANTLR end T__202
+
+// Comes from: 70:8: ( '@model:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__203
+ *
+ * Looks to match the characters the constitute the token T__203
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__203(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__203;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:70:8: ( '@model:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:70:10: '@model:'
+ {
+ MATCHS(lit_59);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__203Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__203Ex; /* Prevent compiler warnings */
+ ruleT__203Ex: ;
+
+}
+// $ANTLR end T__203
+
+// Comes from: 71:8: ( '@moe:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__204
+ *
+ * Looks to match the characters the constitute the token T__204
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__204(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__204;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:71:8: ( '@moe:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:71:10: '@moe:'
+ {
+ MATCHS(lit_60);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__204Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__204Ex; /* Prevent compiler warnings */
+ ruleT__204Ex: ;
+
+}
+// $ANTLR end T__204
+
+// Comes from: 72:8: ( '@on_write' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__205
+ *
+ * Looks to match the characters the constitute the token T__205
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__205(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__205;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:72:8: ( '@on_write' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:72:10: '@on_write'
+ {
+ MATCHS(lit_61);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__205Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__205Ex; /* Prevent compiler warnings */
+ ruleT__205Ex: ;
+
+}
+// $ANTLR end T__205
+
+// Comes from: 73:8: ( '@options' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__206
+ *
+ * Looks to match the characters the constitute the token T__206
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__206(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__206;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:73:8: ( '@options' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:73:10: '@options'
+ {
+ MATCHS(lit_62);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__206Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__206Ex; /* Prevent compiler warnings */
+ ruleT__206Ex: ;
+
+}
+// $ANTLR end T__206
+
+// Comes from: 74:8: ( '@output:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__207
+ *
+ * Looks to match the characters the constitute the token T__207
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__207(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__207;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:74:8: ( '@output:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:74:10: '@output:'
+ {
+ MATCHS(lit_63);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__207Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__207Ex; /* Prevent compiler warnings */
+ ruleT__207Ex: ;
+
+}
+// $ANTLR end T__207
+
+// Comes from: 75:8: ( '@package' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__208
+ *
+ * Looks to match the characters the constitute the token T__208
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__208(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__208;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:75:8: ( '@package' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:75:10: '@package'
+ {
+ MATCHS(lit_64);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__208Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__208Ex; /* Prevent compiler warnings */
+ ruleT__208Ex: ;
+
+}
+// $ANTLR end T__208
+
+// Comes from: 76:8: ( '@param:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__209
+ *
+ * Looks to match the characters the constitute the token T__209
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__209(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__209;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:76:8: ( '@param:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:76:10: '@param:'
+ {
+ MATCHS(lit_65);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__209Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__209Ex; /* Prevent compiler warnings */
+ ruleT__209Ex: ;
+
+}
+// $ANTLR end T__209
+
+// Comes from: 77:8: ( '@parameter:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__210
+ *
+ * Looks to match the characters the constitute the token T__210
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__210(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__210;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:77:8: ( '@parameter:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:77:10: '@parameter:'
+ {
+ MATCHS(lit_66);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__210Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__210Ex; /* Prevent compiler warnings */
+ ruleT__210Ex: ;
+
+}
+// $ANTLR end T__210
+
+// Comes from: 78:8: ( '@private:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__211
+ *
+ * Looks to match the characters the constitute the token T__211
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__211(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__211;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:78:8: ( '@private:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:78:10: '@private:'
+ {
+ MATCHS(lit_67);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__211Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__211Ex; /* Prevent compiler warnings */
+ ruleT__211Ex: ;
+
+}
+// $ANTLR end T__211
+
+// Comes from: 79:8: ( '@procedure:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__212
+ *
+ * Looks to match the characters the constitute the token T__212
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__212(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__212;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:79:8: ( '@procedure:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:79:10: '@procedure:'
+ {
+ MATCHS(lit_68);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__212Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__212Ex; /* Prevent compiler warnings */
+ ruleT__212Ex: ;
+
+}
+// $ANTLR end T__212
+
+// Comes from: 80:8: ( '@property:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__213
+ *
+ * Looks to match the characters the constitute the token T__213
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__213(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__213;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:80:8: ( '@property:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:80:10: '@property:'
+ {
+ MATCHS(lit_69);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__213Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__213Ex; /* Prevent compiler warnings */
+ ruleT__213Ex: ;
+
+}
+// $ANTLR end T__213
+
+// Comes from: 81:8: ( '@protected:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__214
+ *
+ * Looks to match the characters the constitute the token T__214
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__214(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__214;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:81:8: ( '@protected:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:81:10: '@protected:'
+ {
+ MATCHS(lit_70);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__214Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__214Ex; /* Prevent compiler warnings */
+ ruleT__214Ex: ;
+
+}
+// $ANTLR end T__214
+
+// Comes from: 82:8: ( '@prototype:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__215
+ *
+ * Looks to match the characters the constitute the token T__215
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__215(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__215;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:82:8: ( '@prototype:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:82:10: '@prototype:'
+ {
+ MATCHS(lit_71);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__215Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__215Ex; /* Prevent compiler warnings */
+ ruleT__215Ex: ;
+
+}
+// $ANTLR end T__215
+
+// Comes from: 83:8: ( '@public:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__216
+ *
+ * Looks to match the characters the constitute the token T__216
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__216(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__216;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:83:8: ( '@public:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:83:10: '@public:'
+ {
+ MATCHS(lit_72);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__216Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__216Ex; /* Prevent compiler warnings */
+ ruleT__216Ex: ;
+
+}
+// $ANTLR end T__216
+
+// Comes from: 84:8: ( '@region:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__217
+ *
+ * Looks to match the characters the constitute the token T__217
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__217(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__217;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:84:8: ( '@region:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:84:10: '@region:'
+ {
+ MATCHS(lit_73);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__217Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__217Ex; /* Prevent compiler warnings */
+ ruleT__217Ex: ;
+
+}
+// $ANTLR end T__217
+
+// Comes from: 85:8: ( '@return' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__218
+ *
+ * Looks to match the characters the constitute the token T__218
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__218(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__218;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:85:8: ( '@return' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:85:10: '@return'
+ {
+ MATCHS(lit_74);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__218Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__218Ex; /* Prevent compiler warnings */
+ ruleT__218Ex: ;
+
+}
+// $ANTLR end T__218
+
+// Comes from: 86:8: ( '@return:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__219
+ *
+ * Looks to match the characters the constitute the token T__219
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__219(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__219;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:86:8: ( '@return:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:86:10: '@return:'
+ {
+ MATCHS(lit_75);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__219Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__219Ex; /* Prevent compiler warnings */
+ ruleT__219Ex: ;
+
+}
+// $ANTLR end T__219
+
+// Comes from: 87:8: ( '@returns:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__220
+ *
+ * Looks to match the characters the constitute the token T__220
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__220(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__220;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:87:8: ( '@returns:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:87:10: '@returns:'
+ {
+ MATCHS(lit_76);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__220Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__220Ex; /* Prevent compiler warnings */
+ ruleT__220Ex: ;
+
+}
+// $ANTLR end T__220
+
+// Comes from: 88:8: ( '@routine' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__221
+ *
+ * Looks to match the characters the constitute the token T__221
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__221(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__221;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:88:8: ( '@routine' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:88:10: '@routine'
+ {
+ MATCHS(lit_77);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__221Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__221Ex; /* Prevent compiler warnings */
+ ruleT__221Ex: ;
+
+}
+// $ANTLR end T__221
+
+// Comes from: 89:8: ( '@routine:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__222
+ *
+ * Looks to match the characters the constitute the token T__222
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__222(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__222;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:89:8: ( '@routine:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:89:10: '@routine:'
+ {
+ MATCHS(lit_78);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__222Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__222Ex; /* Prevent compiler warnings */
+ ruleT__222Ex: ;
+
+}
+// $ANTLR end T__222
+
+// Comes from: 90:8: ( '@rtc' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__223
+ *
+ * Looks to match the characters the constitute the token T__223
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__223(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__223;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:90:8: ( '@rtc' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:90:10: '@rtc'
+ {
+ MATCHS(lit_79);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__223Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__223Ex; /* Prevent compiler warnings */
+ ruleT__223Ex: ;
+
+}
+// $ANTLR end T__223
+
+// Comes from: 91:8: ( '@run' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__224
+ *
+ * Looks to match the characters the constitute the token T__224
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__224(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__224;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:91:8: ( '@run' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:91:10: '@run'
+ {
+ MATCHS(lit_80);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__224Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__224Ex; /* Prevent compiler warnings */
+ ruleT__224Ex: ;
+
+}
+// $ANTLR end T__224
+
+// Comes from: 92:8: ( '@schedule' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__225
+ *
+ * Looks to match the characters the constitute the token T__225
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__225(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__225;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:92:8: ( '@schedule' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:92:10: '@schedule'
+ {
+ MATCHS(lit_81);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__225Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__225Ex; /* Prevent compiler warnings */
+ ruleT__225Ex: ;
+
+}
+// $ANTLR end T__225
+
+// Comes from: 93:8: ( '@start' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__226
+ *
+ * Looks to match the characters the constitute the token T__226
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__226(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__226;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:93:8: ( '@start' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:93:10: '@start'
+ {
+ MATCHS(lit_82);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__226Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__226Ex; /* Prevent compiler warnings */
+ ruleT__226Ex: ;
+
+}
+// $ANTLR end T__226
+
+// Comes from: 94:8: ( '@statemachine:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__227
+ *
+ * Looks to match the characters the constitute the token T__227
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__227(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__227;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:94:8: ( '@statemachine:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:94:10: '@statemachine:'
+ {
+ MATCHS(lit_83);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__227Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__227Ex; /* Prevent compiler warnings */
+ ruleT__227Ex: ;
+
+}
+// $ANTLR end T__227
+
+// Comes from: 95:8: ( '@stop' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__228
+ *
+ * Looks to match the characters the constitute the token T__228
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__228(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__228;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:95:8: ( '@stop' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:95:10: '@stop'
+ {
+ MATCHS(lit_84);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__228Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__228Ex; /* Prevent compiler warnings */
+ ruleT__228Ex: ;
+
+}
+// $ANTLR end T__228
+
+// Comes from: 96:8: ( '@system' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__229
+ *
+ * Looks to match the characters the constitute the token T__229
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__229(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__229;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:96:8: ( '@system' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:96:10: '@system'
+ {
+ MATCHS(lit_85);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__229Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__229Ex; /* Prevent compiler warnings */
+ ruleT__229Ex: ;
+
+}
+// $ANTLR end T__229
+
+// Comes from: 97:8: ( '@tguard:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__230
+ *
+ * Looks to match the characters the constitute the token T__230
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__230(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__230;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:97:8: ( '@tguard:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:97:10: '@tguard:'
+ {
+ MATCHS(lit_86);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__230Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__230Ex; /* Prevent compiler warnings */
+ ruleT__230Ex: ;
+
+}
+// $ANTLR end T__230
+
+// Comes from: 98:8: ( '@transition:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__231
+ *
+ * Looks to match the characters the constitute the token T__231
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__231(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__231;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:98:8: ( '@transition:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:98:10: '@transition:'
+ {
+ MATCHS(lit_87);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__231Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__231Ex; /* Prevent compiler warnings */
+ ruleT__231Ex: ;
+
+}
+// $ANTLR end T__231
+
+// Comes from: 99:8: ( '@trigger:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__232
+ *
+ * Looks to match the characters the constitute the token T__232
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__232(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__232;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:99:8: ( '@trigger:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:99:10: '@trigger:'
+ {
+ MATCHS(lit_88);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__232Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__232Ex; /* Prevent compiler warnings */
+ ruleT__232Ex: ;
+
+}
+// $ANTLR end T__232
+
+// Comes from: 100:8: ( '@xfml' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__233
+ *
+ * Looks to match the characters the constitute the token T__233
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__233(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__233;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:100:8: ( '@xfml' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:100:10: '@xfml'
+ {
+ MATCHS(lit_89);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__233Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__233Ex; /* Prevent compiler warnings */
+ ruleT__233Ex: ;
+
+}
+// $ANTLR end T__233
+
+// Comes from: 101:8: ( '@xfsp' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__234
+ *
+ * Looks to match the characters the constitute the token T__234
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__234(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__234;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:101:8: ( '@xfsp' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:101:10: '@xfsp'
+ {
+ MATCHS(lit_90);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__234Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__234Ex; /* Prevent compiler warnings */
+ ruleT__234Ex: ;
+
+}
+// $ANTLR end T__234
+
+// Comes from: 102:8: ( '@xlia' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__235
+ *
+ * Looks to match the characters the constitute the token T__235
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__235(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__235;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:102:8: ( '@xlia' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:102:10: '@xlia'
+ {
+ MATCHS(lit_91);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__235Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__235Ex; /* Prevent compiler warnings */
+ ruleT__235Ex: ;
+
+}
+// $ANTLR end T__235
+
+// Comes from: 103:8: ( 'abort' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__236
+ *
+ * Looks to match the characters the constitute the token T__236
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__236(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__236;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:103:8: ( 'abort' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:103:10: 'abort'
+ {
+ MATCHS(lit_92);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__236Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__236Ex; /* Prevent compiler warnings */
+ ruleT__236Ex: ;
+
+}
+// $ANTLR end T__236
+
+// Comes from: 104:8: ( 'absent' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__237
+ *
+ * Looks to match the characters the constitute the token T__237
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__237(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__237;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:104:8: ( 'absent' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:104:10: 'absent'
+ {
+ MATCHS(lit_93);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__237Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__237Ex; /* Prevent compiler warnings */
+ ruleT__237Ex: ;
+
+}
+// $ANTLR end T__237
+
+// Comes from: 105:8: ( 'activity:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__238
+ *
+ * Looks to match the characters the constitute the token T__238
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__238(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__238;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:105:8: ( 'activity:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:105:10: 'activity:'
+ {
+ MATCHS(lit_94);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__238Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__238Ex; /* Prevent compiler warnings */
+ ruleT__238Ex: ;
+
+}
+// $ANTLR end T__238
+
+// Comes from: 106:8: ( 'and' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__239
+ *
+ * Looks to match the characters the constitute the token T__239
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__239(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__239;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:106:8: ( 'and' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:106:10: 'and'
+ {
+ MATCHS(lit_95);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__239Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__239Ex; /* Prevent compiler warnings */
+ ruleT__239Ex: ;
+
+}
+// $ANTLR end T__239
+
+// Comes from: 107:8: ( 'anycast' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__240
+ *
+ * Looks to match the characters the constitute the token T__240
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__240(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__240;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:107:8: ( 'anycast' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:107:10: 'anycast'
+ {
+ MATCHS(lit_96);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__240Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__240Ex; /* Prevent compiler warnings */
+ ruleT__240Ex: ;
+
+}
+// $ANTLR end T__240
+
+// Comes from: 108:8: ( 'array' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__241
+ *
+ * Looks to match the characters the constitute the token T__241
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__241(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__241;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:108:8: ( 'array' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:108:10: 'array'
+ {
+ MATCHS(lit_97);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__241Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__241Ex; /* Prevent compiler warnings */
+ ruleT__241Ex: ;
+
+}
+// $ANTLR end T__241
+
+// Comes from: 109:8: ( 'avmcode' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__242
+ *
+ * Looks to match the characters the constitute the token T__242
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__242(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__242;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:109:8: ( 'avmcode' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:109:10: 'avmcode'
+ {
+ MATCHS(lit_98);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__242Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__242Ex; /* Prevent compiler warnings */
+ ruleT__242Ex: ;
+
+}
+// $ANTLR end T__242
+
+// Comes from: 110:8: ( 'bind' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__243
+ *
+ * Looks to match the characters the constitute the token T__243
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__243(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__243;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:110:8: ( 'bind' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:110:10: 'bind'
+ {
+ MATCHS(lit_99);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__243Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__243Ex; /* Prevent compiler warnings */
+ ruleT__243Ex: ;
+
+}
+// $ANTLR end T__243
+
+// Comes from: 111:8: ( 'bind:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__244
+ *
+ * Looks to match the characters the constitute the token T__244
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__244(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__244;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:111:8: ( 'bind:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:111:10: 'bind:'
+ {
+ MATCHS(lit_100);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__244Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__244Ex; /* Prevent compiler warnings */
+ ruleT__244Ex: ;
+
+}
+// $ANTLR end T__244
+
+// Comes from: 112:8: ( 'bool' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__245
+ *
+ * Looks to match the characters the constitute the token T__245
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__245(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__245;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:112:8: ( 'bool' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:112:10: 'bool'
+ {
+ MATCHS(lit_101);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__245Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__245Ex; /* Prevent compiler warnings */
+ ruleT__245Ex: ;
+
+}
+// $ANTLR end T__245
+
+// Comes from: 113:8: ( 'boolean' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__246
+ *
+ * Looks to match the characters the constitute the token T__246
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__246(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__246;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:113:8: ( 'boolean' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:113:10: 'boolean'
+ {
+ MATCHS(lit_102);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__246Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__246Ex; /* Prevent compiler warnings */
+ ruleT__246Ex: ;
+
+}
+// $ANTLR end T__246
+
+// Comes from: 114:8: ( 'break' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__247
+ *
+ * Looks to match the characters the constitute the token T__247
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__247(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__247;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:114:8: ( 'break' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:114:10: 'break'
+ {
+ MATCHS(lit_103);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__247Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__247Ex; /* Prevent compiler warnings */
+ ruleT__247Ex: ;
+
+}
+// $ANTLR end T__247
+
+// Comes from: 115:8: ( 'broadcast' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__248
+ *
+ * Looks to match the characters the constitute the token T__248
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__248(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__248;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:115:8: ( 'broadcast' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:115:10: 'broadcast'
+ {
+ MATCHS(lit_104);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__248Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__248Ex; /* Prevent compiler warnings */
+ ruleT__248Ex: ;
+
+}
+// $ANTLR end T__248
+
+// Comes from: 116:8: ( 'buffer' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__249
+ *
+ * Looks to match the characters the constitute the token T__249
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__249(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__249;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:116:8: ( 'buffer' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:116:10: 'buffer'
+ {
+ MATCHS(lit_105);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__249Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__249Ex; /* Prevent compiler warnings */
+ ruleT__249Ex: ;
+
+}
+// $ANTLR end T__249
+
+// Comes from: 117:8: ( 'call' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__250
+ *
+ * Looks to match the characters the constitute the token T__250
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__250(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__250;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:117:8: ( 'call' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:117:10: 'call'
+ {
+ MATCHS(lit_106);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__250Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__250Ex; /* Prevent compiler warnings */
+ ruleT__250Ex: ;
+
+}
+// $ANTLR end T__250
+
+// Comes from: 118:8: ( 'changed#to' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__251
+ *
+ * Looks to match the characters the constitute the token T__251
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__251(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__251;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:118:8: ( 'changed#to' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:118:10: 'changed#to'
+ {
+ MATCHS(lit_107);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__251Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__251Ex; /* Prevent compiler warnings */
+ ruleT__251Ex: ;
+
+}
+// $ANTLR end T__251
+
+// Comes from: 119:8: ( 'changed' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__252
+ *
+ * Looks to match the characters the constitute the token T__252
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__252(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__252;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:119:8: ( 'changed' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:119:10: 'changed'
+ {
+ MATCHS(lit_108);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__252Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__252Ex; /* Prevent compiler warnings */
+ ruleT__252Ex: ;
+
+}
+// $ANTLR end T__252
+
+// Comes from: 120:8: ( 'channel' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__253
+ *
+ * Looks to match the characters the constitute the token T__253
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__253(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__253;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:120:8: ( 'channel' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:120:10: 'channel'
+ {
+ MATCHS(lit_109);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__253Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__253Ex; /* Prevent compiler warnings */
+ ruleT__253Ex: ;
+
+}
+// $ANTLR end T__253
+
+// Comes from: 121:8: ( 'char' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__254
+ *
+ * Looks to match the characters the constitute the token T__254
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__254(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__254;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:121:8: ( 'char' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:121:10: 'char'
+ {
+ MATCHS(lit_110);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__254Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__254Ex; /* Prevent compiler warnings */
+ ruleT__254Ex: ;
+
+}
+// $ANTLR end T__254
+
+// Comes from: 122:8: ( 'character' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__255
+ *
+ * Looks to match the characters the constitute the token T__255
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__255(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__255;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:122:8: ( 'character' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:122:10: 'character'
+ {
+ MATCHS(lit_111);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__255Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__255Ex; /* Prevent compiler warnings */
+ ruleT__255Ex: ;
+
+}
+// $ANTLR end T__255
+
+// Comes from: 123:8: ( 'checksat' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__256
+ *
+ * Looks to match the characters the constitute the token T__256
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__256(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__256;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:123:8: ( 'checksat' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:123:10: 'checksat'
+ {
+ MATCHS(lit_112);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__256Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__256Ex; /* Prevent compiler warnings */
+ ruleT__256Ex: ;
+
+}
+// $ANTLR end T__256
+
+// Comes from: 124:8: ( 'choice' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__257
+ *
+ * Looks to match the characters the constitute the token T__257
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__257(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__257;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:124:8: ( 'choice' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:124:10: 'choice'
+ {
+ MATCHS(lit_113);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__257Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__257Ex; /* Prevent compiler warnings */
+ ruleT__257Ex: ;
+
+}
+// $ANTLR end T__257
+
+// Comes from: 125:8: ( 'class' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__258
+ *
+ * Looks to match the characters the constitute the token T__258
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__258(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__258;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:125:8: ( 'class' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:125:10: 'class'
+ {
+ MATCHS(lit_114);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__258Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__258Ex; /* Prevent compiler warnings */
+ ruleT__258Ex: ;
+
+}
+// $ANTLR end T__258
+
+// Comes from: 126:8: ( 'clock' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__259
+ *
+ * Looks to match the characters the constitute the token T__259
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__259(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__259;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:126:8: ( 'clock' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:126:10: 'clock'
+ {
+ MATCHS(lit_115);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__259Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__259Ex; /* Prevent compiler warnings */
+ ruleT__259Ex: ;
+
+}
+// $ANTLR end T__259
+
+// Comes from: 127:8: ( 'connect' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__260
+ *
+ * Looks to match the characters the constitute the token T__260
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__260(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__260;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:127:8: ( 'connect' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:127:10: 'connect'
+ {
+ MATCHS(lit_116);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__260Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__260Ex; /* Prevent compiler warnings */
+ ruleT__260Ex: ;
+
+}
+// $ANTLR end T__260
+
+// Comes from: 128:8: ( 'connector' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__261
+ *
+ * Looks to match the characters the constitute the token T__261
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__261(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__261;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:128:8: ( 'connector' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:128:10: 'connector'
+ {
+ MATCHS(lit_117);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__261Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__261Ex; /* Prevent compiler warnings */
+ ruleT__261Ex: ;
+
+}
+// $ANTLR end T__261
+
+// Comes from: 129:8: ( 'const' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__262
+ *
+ * Looks to match the characters the constitute the token T__262
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__262(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__262;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:129:8: ( 'const' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:129:10: 'const'
+ {
+ MATCHS(lit_118);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__262Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__262Ex; /* Prevent compiler warnings */
+ ruleT__262Ex: ;
+
+}
+// $ANTLR end T__262
+
+// Comes from: 130:8: ( 'continue' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__263
+ *
+ * Looks to match the characters the constitute the token T__263
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__263(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__263;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:130:8: ( 'continue' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:130:10: 'continue'
+ {
+ MATCHS(lit_119);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__263Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__263Ex; /* Prevent compiler warnings */
+ ruleT__263Ex: ;
+
+}
+// $ANTLR end T__263
+
+// Comes from: 131:8: ( 'ctime' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__264
+ *
+ * Looks to match the characters the constitute the token T__264
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__264(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__264;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:131:8: ( 'ctime' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:131:10: 'ctime'
+ {
+ MATCHS(lit_120);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__264Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__264Ex; /* Prevent compiler warnings */
+ ruleT__264Ex: ;
+
+}
+// $ANTLR end T__264
+
+// Comes from: 132:8: ( 'ctor' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__265
+ *
+ * Looks to match the characters the constitute the token T__265
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__265(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__265;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:132:8: ( 'ctor' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:132:10: 'ctor'
+ {
+ MATCHS(lit_121);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__265Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__265Ex; /* Prevent compiler warnings */
+ ruleT__265Ex: ;
+
+}
+// $ANTLR end T__265
+
+// Comes from: 133:8: ( 'ctx:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__266
+ *
+ * Looks to match the characters the constitute the token T__266
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__266(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__266;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:133:8: ( 'ctx:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:133:10: 'ctx:'
+ {
+ MATCHS(lit_122);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__266Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__266Ex; /* Prevent compiler warnings */
+ ruleT__266Ex: ;
+
+}
+// $ANTLR end T__266
+
+// Comes from: 134:8: ( 'destroy' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__267
+ *
+ * Looks to match the characters the constitute the token T__267
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__267(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__267;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:134:8: ( 'destroy' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:134:10: 'destroy'
+ {
+ MATCHS(lit_123);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__267Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__267Ex; /* Prevent compiler warnings */
+ ruleT__267Ex: ;
+
+}
+// $ANTLR end T__267
+
+// Comes from: 135:8: ( 'disable' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__268
+ *
+ * Looks to match the characters the constitute the token T__268
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__268(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__268;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:135:8: ( 'disable' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:135:10: 'disable'
+ {
+ MATCHS(lit_124);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__268Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__268Ex; /* Prevent compiler warnings */
+ ruleT__268Ex: ;
+
+}
+// $ANTLR end T__268
+
+// Comes from: 136:8: ( 'do' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__269
+ *
+ * Looks to match the characters the constitute the token T__269
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__269(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__269;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:136:8: ( 'do' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:136:10: 'do'
+ {
+ MATCHS(lit_125);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__269Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__269Ex; /* Prevent compiler warnings */
+ ruleT__269Ex: ;
+
+}
+// $ANTLR end T__269
+
+// Comes from: 137:8: ( 'double' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__270
+ *
+ * Looks to match the characters the constitute the token T__270
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__270(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__270;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:137:8: ( 'double' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:137:10: 'double'
+ {
+ MATCHS(lit_126);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__270Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__270Ex; /* Prevent compiler warnings */
+ ruleT__270Ex: ;
+
+}
+// $ANTLR end T__270
+
+// Comes from: 138:8: ( 'dtime' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__271
+ *
+ * Looks to match the characters the constitute the token T__271
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__271(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__271;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:138:8: ( 'dtime' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:138:10: 'dtime'
+ {
+ MATCHS(lit_127);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__271Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__271Ex; /* Prevent compiler warnings */
+ ruleT__271Ex: ;
+
+}
+// $ANTLR end T__271
+
+// Comes from: 139:8: ( 'dynamic' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__272
+ *
+ * Looks to match the characters the constitute the token T__272
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__272(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__272;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:139:8: ( 'dynamic' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:139:10: 'dynamic'
+ {
+ MATCHS(lit_128);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__272Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__272Ex; /* Prevent compiler warnings */
+ ruleT__272Ex: ;
+
+}
+// $ANTLR end T__272
+
+// Comes from: 140:8: ( 'else' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__273
+ *
+ * Looks to match the characters the constitute the token T__273
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__273(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__273;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:140:8: ( 'else' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:140:10: 'else'
+ {
+ MATCHS(lit_129);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__273Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__273Ex; /* Prevent compiler warnings */
+ ruleT__273Ex: ;
+
+}
+// $ANTLR end T__273
+
+// Comes from: 141:8: ( 'elseif' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__274
+ *
+ * Looks to match the characters the constitute the token T__274
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__274(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__274;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:141:8: ( 'elseif' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:141:10: 'elseif'
+ {
+ MATCHS(lit_130);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__274Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__274Ex; /* Prevent compiler warnings */
+ ruleT__274Ex: ;
+
+}
+// $ANTLR end T__274
+
+// Comes from: 142:8: ( 'enable' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__275
+ *
+ * Looks to match the characters the constitute the token T__275
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__275(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__275;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:142:8: ( 'enable' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:142:10: 'enable'
+ {
+ MATCHS(lit_131);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__275Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__275Ex; /* Prevent compiler warnings */
+ ruleT__275Ex: ;
+
+}
+// $ANTLR end T__275
+
+// Comes from: 143:8: ( 'enum' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__276
+ *
+ * Looks to match the characters the constitute the token T__276
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__276(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__276;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:143:8: ( 'enum' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:143:10: 'enum'
+ {
+ MATCHS(lit_132);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__276Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__276Ex; /* Prevent compiler warnings */
+ ruleT__276Ex: ;
+
+}
+// $ANTLR end T__276
+
+// Comes from: 144:8: ( 'env' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__277
+ *
+ * Looks to match the characters the constitute the token T__277
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__277(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__277;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:144:8: ( 'env' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:144:10: 'env'
+ {
+ MATCHS(lit_133);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__277Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__277Ex; /* Prevent compiler warnings */
+ ruleT__277Ex: ;
+
+}
+// $ANTLR end T__277
+
+// Comes from: 145:8: ( 'event' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__278
+ *
+ * Looks to match the characters the constitute the token T__278
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__278(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__278;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:145:8: ( 'event' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:145:10: 'event'
+ {
+ MATCHS(lit_134);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__278Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__278Ex; /* Prevent compiler warnings */
+ ruleT__278Ex: ;
+
+}
+// $ANTLR end T__278
+
+// Comes from: 146:8: ( 'exit' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__279
+ *
+ * Looks to match the characters the constitute the token T__279
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__279(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__279;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:146:8: ( 'exit' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:146:10: 'exit'
+ {
+ MATCHS(lit_135);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__279Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__279Ex; /* Prevent compiler warnings */
+ ruleT__279Ex: ;
+
+}
+// $ANTLR end T__279
+
+// Comes from: 147:8: ( 'false' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__280
+ *
+ * Looks to match the characters the constitute the token T__280
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__280(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__280;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:147:8: ( 'false' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:147:10: 'false'
+ {
+ MATCHS(lit_136);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__280Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__280Ex; /* Prevent compiler warnings */
+ ruleT__280Ex: ;
+
+}
+// $ANTLR end T__280
+
+// Comes from: 148:8: ( 'fifo' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__281
+ *
+ * Looks to match the characters the constitute the token T__281
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__281(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__281;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:148:8: ( 'fifo' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:148:10: 'fifo'
+ {
+ MATCHS(lit_137);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__281Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__281Ex; /* Prevent compiler warnings */
+ ruleT__281Ex: ;
+
+}
+// $ANTLR end T__281
+
+// Comes from: 149:8: ( 'final' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__282
+ *
+ * Looks to match the characters the constitute the token T__282
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__282(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__282;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:149:8: ( 'final' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:149:10: 'final'
+ {
+ MATCHS(lit_138);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__282Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__282Ex; /* Prevent compiler warnings */
+ ruleT__282Ex: ;
+
+}
+// $ANTLR end T__282
+
+// Comes from: 150:8: ( 'float' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__283
+ *
+ * Looks to match the characters the constitute the token T__283
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__283(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__283;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:150:8: ( 'float' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:150:10: 'float'
+ {
+ MATCHS(lit_139);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__283Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__283Ex; /* Prevent compiler warnings */
+ ruleT__283Ex: ;
+
+}
+// $ANTLR end T__283
+
+// Comes from: 151:8: ( 'flow' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__284
+ *
+ * Looks to match the characters the constitute the token T__284
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__284(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__284;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:151:8: ( 'flow' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:151:10: 'flow'
+ {
+ MATCHS(lit_140);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__284Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__284Ex; /* Prevent compiler warnings */
+ ruleT__284Ex: ;
+
+}
+// $ANTLR end T__284
+
+// Comes from: 152:8: ( 'for' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__285
+ *
+ * Looks to match the characters the constitute the token T__285
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__285(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__285;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:152:8: ( 'for' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:152:10: 'for'
+ {
+ MATCHS(lit_141);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__285Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__285Ex; /* Prevent compiler warnings */
+ ruleT__285Ex: ;
+
+}
+// $ANTLR end T__285
+
+// Comes from: 153:8: ( 'fork' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__286
+ *
+ * Looks to match the characters the constitute the token T__286
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__286(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__286;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:153:8: ( 'fork' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:153:10: 'fork'
+ {
+ MATCHS(lit_142);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__286Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__286Ex; /* Prevent compiler warnings */
+ ruleT__286Ex: ;
+
+}
+// $ANTLR end T__286
+
+// Comes from: 154:8: ( 'from:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__287
+ *
+ * Looks to match the characters the constitute the token T__287
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__287(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__287;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:154:8: ( 'from:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:154:10: 'from:'
+ {
+ MATCHS(lit_143);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__287Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__287Ex; /* Prevent compiler warnings */
+ ruleT__287Ex: ;
+
+}
+// $ANTLR end T__287
+
+// Comes from: 155:8: ( 'fun' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__288
+ *
+ * Looks to match the characters the constitute the token T__288
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__288(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__288;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:155:8: ( 'fun' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:155:10: 'fun'
+ {
+ MATCHS(lit_144);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__288Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__288Ex; /* Prevent compiler warnings */
+ ruleT__288Ex: ;
+
+}
+// $ANTLR end T__288
+
+// Comes from: 156:8: ( 'goto' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__289
+ *
+ * Looks to match the characters the constitute the token T__289
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__289(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__289;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:156:8: ( 'goto' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:156:10: 'goto'
+ {
+ MATCHS(lit_145);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__289Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__289Ex; /* Prevent compiler warnings */
+ ruleT__289Ex: ;
+
+}
+// $ANTLR end T__289
+
+// Comes from: 157:8: ( 'guard' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__290
+ *
+ * Looks to match the characters the constitute the token T__290
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__290(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__290;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:157:8: ( 'guard' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:157:10: 'guard'
+ {
+ MATCHS(lit_146);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__290Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__290Ex; /* Prevent compiler warnings */
+ ruleT__290Ex: ;
+
+}
+// $ANTLR end T__290
+
+// Comes from: 158:8: ( 'iabort' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__291
+ *
+ * Looks to match the characters the constitute the token T__291
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__291(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__291;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:158:8: ( 'iabort' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:158:10: 'iabort'
+ {
+ MATCHS(lit_147);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__291Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__291Ex; /* Prevent compiler warnings */
+ ruleT__291Ex: ;
+
+}
+// $ANTLR end T__291
+
+// Comes from: 159:8: ( 'idisable' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__292
+ *
+ * Looks to match the characters the constitute the token T__292
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__292(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__292;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:159:8: ( 'idisable' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:159:10: 'idisable'
+ {
+ MATCHS(lit_148);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__292Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__292Ex; /* Prevent compiler warnings */
+ ruleT__292Ex: ;
+
+}
+// $ANTLR end T__292
+
+// Comes from: 160:8: ( 'ienable' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__293
+ *
+ * Looks to match the characters the constitute the token T__293
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__293(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__293;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:160:8: ( 'ienable' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:160:10: 'ienable'
+ {
+ MATCHS(lit_149);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__293Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__293Ex; /* Prevent compiler warnings */
+ ruleT__293Ex: ;
+
+}
+// $ANTLR end T__293
+
+// Comes from: 161:8: ( 'if' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__294
+ *
+ * Looks to match the characters the constitute the token T__294
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__294(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__294;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:161:8: ( 'if' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:161:10: 'if'
+ {
+ MATCHS(lit_150);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__294Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__294Ex; /* Prevent compiler warnings */
+ ruleT__294Ex: ;
+
+}
+// $ANTLR end T__294
+
+// Comes from: 162:8: ( 'in' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__295
+ *
+ * Looks to match the characters the constitute the token T__295
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__295(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__295;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:162:8: ( 'in' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:162:10: 'in'
+ {
+ MATCHS(lit_151);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__295Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__295Ex; /* Prevent compiler warnings */
+ ruleT__295Ex: ;
+
+}
+// $ANTLR end T__295
+
+// Comes from: 163:8: ( 'init' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__296
+ *
+ * Looks to match the characters the constitute the token T__296
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__296(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__296;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:163:8: ( 'init' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:163:10: 'init'
+ {
+ MATCHS(lit_152);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__296Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__296Ex; /* Prevent compiler warnings */
+ ruleT__296Ex: ;
+
+}
+// $ANTLR end T__296
+
+// Comes from: 164:8: ( 'init:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__297
+ *
+ * Looks to match the characters the constitute the token T__297
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__297(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__297;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:164:8: ( 'init:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:164:10: 'init:'
+ {
+ MATCHS(lit_153);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__297Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__297Ex; /* Prevent compiler warnings */
+ ruleT__297Ex: ;
+
+}
+// $ANTLR end T__297
+
+// Comes from: 165:8: ( 'inout' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__298
+ *
+ * Looks to match the characters the constitute the token T__298
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__298(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__298;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:165:8: ( 'inout' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:165:10: 'inout'
+ {
+ MATCHS(lit_154);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__298Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__298Ex; /* Prevent compiler warnings */
+ ruleT__298Ex: ;
+
+}
+// $ANTLR end T__298
+
+// Comes from: 166:8: ( 'input#buffer' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__299
+ *
+ * Looks to match the characters the constitute the token T__299
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__299(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__299;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:166:8: ( 'input#buffer' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:166:10: 'input#buffer'
+ {
+ MATCHS(lit_155);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__299Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__299Ex; /* Prevent compiler warnings */
+ ruleT__299Ex: ;
+
+}
+// $ANTLR end T__299
+
+// Comes from: 167:8: ( 'input#env' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__300
+ *
+ * Looks to match the characters the constitute the token T__300
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__300(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__300;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:167:8: ( 'input#env' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:167:10: 'input#env'
+ {
+ MATCHS(lit_156);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__300Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__300Ex; /* Prevent compiler warnings */
+ ruleT__300Ex: ;
+
+}
+// $ANTLR end T__300
+
+// Comes from: 168:8: ( 'input#flow' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__301
+ *
+ * Looks to match the characters the constitute the token T__301
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__301(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__301;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:168:8: ( 'input#flow' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:168:10: 'input#flow'
+ {
+ MATCHS(lit_157);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__301Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__301Ex; /* Prevent compiler warnings */
+ ruleT__301Ex: ;
+
+}
+// $ANTLR end T__301
+
+// Comes from: 169:8: ( 'input#rdv' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__302
+ *
+ * Looks to match the characters the constitute the token T__302
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__302(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__302;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:169:8: ( 'input#rdv' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:169:10: 'input#rdv'
+ {
+ MATCHS(lit_158);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__302Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__302Ex; /* Prevent compiler warnings */
+ ruleT__302Ex: ;
+
+}
+// $ANTLR end T__302
+
+// Comes from: 170:8: ( 'input#save' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__303
+ *
+ * Looks to match the characters the constitute the token T__303
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__303(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__303;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:170:8: ( 'input#save' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:170:10: 'input#save'
+ {
+ MATCHS(lit_159);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__303Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__303Ex; /* Prevent compiler warnings */
+ ruleT__303Ex: ;
+
+}
+// $ANTLR end T__303
+
+// Comes from: 171:8: ( 'input#var' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__304
+ *
+ * Looks to match the characters the constitute the token T__304
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__304(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__304;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:171:8: ( 'input#var' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:171:10: 'input#var'
+ {
+ MATCHS(lit_160);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__304Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__304Ex; /* Prevent compiler warnings */
+ ruleT__304Ex: ;
+
+}
+// $ANTLR end T__304
+
+// Comes from: 172:8: ( 'input' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__305
+ *
+ * Looks to match the characters the constitute the token T__305
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__305(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__305;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:172:8: ( 'input' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:172:10: 'input'
+ {
+ MATCHS(lit_161);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__305Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__305Ex; /* Prevent compiler warnings */
+ ruleT__305Ex: ;
+
+}
+// $ANTLR end T__305
+
+// Comes from: 173:8: ( 'input_enabled' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__306
+ *
+ * Looks to match the characters the constitute the token T__306
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__306(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__306;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:173:8: ( 'input_enabled' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:173:10: 'input_enabled'
+ {
+ MATCHS(lit_162);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__306Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__306Ex; /* Prevent compiler warnings */
+ ruleT__306Ex: ;
+
+}
+// $ANTLR end T__306
+
+// Comes from: 174:8: ( 'instance' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__307
+ *
+ * Looks to match the characters the constitute the token T__307
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__307(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__307;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:174:8: ( 'instance' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:174:10: 'instance'
+ {
+ MATCHS(lit_163);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__307Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__307Ex; /* Prevent compiler warnings */
+ ruleT__307Ex: ;
+
+}
+// $ANTLR end T__307
+
+// Comes from: 175:8: ( 'instance:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__308
+ *
+ * Looks to match the characters the constitute the token T__308
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__308(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__308;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:175:8: ( 'instance:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:175:10: 'instance:'
+ {
+ MATCHS(lit_164);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__308Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__308Ex; /* Prevent compiler warnings */
+ ruleT__308Ex: ;
+
+}
+// $ANTLR end T__308
+
+// Comes from: 176:8: ( 'int' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__309
+ *
+ * Looks to match the characters the constitute the token T__309
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__309(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__309;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:176:8: ( 'int' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:176:10: 'int'
+ {
+ MATCHS(lit_165);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__309Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__309Ex; /* Prevent compiler warnings */
+ ruleT__309Ex: ;
+
+}
+// $ANTLR end T__309
+
+// Comes from: 177:8: ( 'integer' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__310
+ *
+ * Looks to match the characters the constitute the token T__310
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__310(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__310;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:177:8: ( 'integer' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:177:10: 'integer'
+ {
+ MATCHS(lit_166);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__310Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__310Ex; /* Prevent compiler warnings */
+ ruleT__310Ex: ;
+
+}
+// $ANTLR end T__310
+
+// Comes from: 178:8: ( 'interval' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__311
+ *
+ * Looks to match the characters the constitute the token T__311
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__311(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__311;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:178:8: ( 'interval' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:178:10: 'interval'
+ {
+ MATCHS(lit_167);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__311Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__311Ex; /* Prevent compiler warnings */
+ ruleT__311Ex: ;
+
+}
+// $ANTLR end T__311
+
+// Comes from: 179:8: ( 'join' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__312
+ *
+ * Looks to match the characters the constitute the token T__312
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__312(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__312;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:179:8: ( 'join' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:179:10: 'join'
+ {
+ MATCHS(lit_168);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__312Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__312Ex; /* Prevent compiler warnings */
+ ruleT__312Ex: ;
+
+}
+// $ANTLR end T__312
+
+// Comes from: 180:8: ( 'lambda' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__313
+ *
+ * Looks to match the characters the constitute the token T__313
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__313(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__313;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:180:8: ( 'lambda' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:180:10: 'lambda'
+ {
+ MATCHS(lit_169);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__313Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__313Ex; /* Prevent compiler warnings */
+ ruleT__313Ex: ;
+
+}
+// $ANTLR end T__313
+
+// Comes from: 181:8: ( 'lifeline' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__314
+ *
+ * Looks to match the characters the constitute the token T__314
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__314(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__314;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:181:8: ( 'lifeline' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:181:10: 'lifeline'
+ {
+ MATCHS(lit_170);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__314Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__314Ex; /* Prevent compiler warnings */
+ ruleT__314Ex: ;
+
+}
+// $ANTLR end T__314
+
+// Comes from: 182:8: ( 'lifo' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__315
+ *
+ * Looks to match the characters the constitute the token T__315
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__315(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__315;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:182:8: ( 'lifo' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:182:10: 'lifo'
+ {
+ MATCHS(lit_171);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__315Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__315Ex; /* Prevent compiler warnings */
+ ruleT__315Ex: ;
+
+}
+// $ANTLR end T__315
+
+// Comes from: 183:8: ( 'list' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__316
+ *
+ * Looks to match the characters the constitute the token T__316
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__316(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__316;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:183:8: ( 'list' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:183:10: 'list'
+ {
+ MATCHS(lit_172);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__316Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__316Ex; /* Prevent compiler warnings */
+ ruleT__316Ex: ;
+
+}
+// $ANTLR end T__316
+
+// Comes from: 184:8: ( 'machine' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__317
+ *
+ * Looks to match the characters the constitute the token T__317
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__317(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__317;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:184:8: ( 'machine' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:184:10: 'machine'
+ {
+ MATCHS(lit_173);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__317Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__317Ex; /* Prevent compiler warnings */
+ ruleT__317Ex: ;
+
+}
+// $ANTLR end T__317
+
+// Comes from: 185:8: ( 'macro' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__318
+ *
+ * Looks to match the characters the constitute the token T__318
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__318(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__318;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:185:8: ( 'macro' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:185:10: 'macro'
+ {
+ MATCHS(lit_174);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__318Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__318Ex; /* Prevent compiler warnings */
+ ruleT__318Ex: ;
+
+}
+// $ANTLR end T__318
+
+// Comes from: 186:8: ( 'max:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__319
+ *
+ * Looks to match the characters the constitute the token T__319
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__319(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__319;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:186:8: ( 'max:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:186:10: 'max:'
+ {
+ MATCHS(lit_175);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__319Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__319Ex; /* Prevent compiler warnings */
+ ruleT__319Ex: ;
+
+}
+// $ANTLR end T__319
+
+// Comes from: 187:8: ( 'message' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__320
+ *
+ * Looks to match the characters the constitute the token T__320
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__320(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__320;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:187:8: ( 'message' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:187:10: 'message'
+ {
+ MATCHS(lit_176);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__320Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__320Ex; /* Prevent compiler warnings */
+ ruleT__320Ex: ;
+
+}
+// $ANTLR end T__320
+
+// Comes from: 188:8: ( 'moc:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__321
+ *
+ * Looks to match the characters the constitute the token T__321
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__321(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__321;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:188:8: ( 'moc:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:188:10: 'moc:'
+ {
+ MATCHS(lit_177);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__321Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__321Ex; /* Prevent compiler warnings */
+ ruleT__321Ex: ;
+
+}
+// $ANTLR end T__321
+
+// Comes from: 189:8: ( 'model' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__322
+ *
+ * Looks to match the characters the constitute the token T__322
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__322(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__322;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:189:8: ( 'model' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:189:10: 'model'
+ {
+ MATCHS(lit_178);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__322Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__322Ex; /* Prevent compiler warnings */
+ ruleT__322Ex: ;
+
+}
+// $ANTLR end T__322
+
+// Comes from: 190:8: ( 'model:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__323
+ *
+ * Looks to match the characters the constitute the token T__323
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__323(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__323;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:190:8: ( 'model:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:190:10: 'model:'
+ {
+ MATCHS(lit_179);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__323Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__323Ex; /* Prevent compiler warnings */
+ ruleT__323Ex: ;
+
+}
+// $ANTLR end T__323
+
+// Comes from: 191:8: ( 'multicast' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__324
+ *
+ * Looks to match the characters the constitute the token T__324
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__324(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__324;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:191:8: ( 'multicast' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:191:10: 'multicast'
+ {
+ MATCHS(lit_180);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__324Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__324Ex; /* Prevent compiler warnings */
+ ruleT__324Ex: ;
+
+}
+// $ANTLR end T__324
+
+// Comes from: 192:8: ( 'multififo' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__325
+ *
+ * Looks to match the characters the constitute the token T__325
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__325(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__325;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:192:8: ( 'multififo' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:192:10: 'multififo'
+ {
+ MATCHS(lit_181);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__325Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__325Ex; /* Prevent compiler warnings */
+ ruleT__325Ex: ;
+
+}
+// $ANTLR end T__325
+
+// Comes from: 193:8: ( 'multilifo' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__326
+ *
+ * Looks to match the characters the constitute the token T__326
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__326(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__326;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:193:8: ( 'multilifo' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:193:10: 'multilifo'
+ {
+ MATCHS(lit_182);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__326Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__326Ex; /* Prevent compiler warnings */
+ ruleT__326Ex: ;
+
+}
+// $ANTLR end T__326
+
+// Comes from: 194:8: ( 'multiplicity:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__327
+ *
+ * Looks to match the characters the constitute the token T__327
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__327(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__327;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:194:8: ( 'multiplicity:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:194:10: 'multiplicity:'
+ {
+ MATCHS(lit_183);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__327Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__327Ex; /* Prevent compiler warnings */
+ ruleT__327Ex: ;
+
+}
+// $ANTLR end T__327
+
+// Comes from: 195:8: ( 'multirdv' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__328
+ *
+ * Looks to match the characters the constitute the token T__328
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__328(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__328;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:195:8: ( 'multirdv' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:195:10: 'multirdv'
+ {
+ MATCHS(lit_184);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__328Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__328Ex; /* Prevent compiler warnings */
+ ruleT__328Ex: ;
+
+}
+// $ANTLR end T__328
+
+// Comes from: 196:8: ( 'multiset' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__329
+ *
+ * Looks to match the characters the constitute the token T__329
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__329(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__329;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:196:8: ( 'multiset' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:196:10: 'multiset'
+ {
+ MATCHS(lit_185);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__329Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__329Ex; /* Prevent compiler warnings */
+ ruleT__329Ex: ;
+
+}
+// $ANTLR end T__329
+
+// Comes from: 197:8: ( 'new' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__330
+ *
+ * Looks to match the characters the constitute the token T__330
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__330(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__330;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:197:8: ( 'new' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:197:10: 'new'
+ {
+ MATCHS(lit_186);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__330Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__330Ex; /* Prevent compiler warnings */
+ ruleT__330Ex: ;
+
+}
+// $ANTLR end T__330
+
+// Comes from: 198:8: ( 'null' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__331
+ *
+ * Looks to match the characters the constitute the token T__331
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__331(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__331;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:198:8: ( 'null' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:198:10: 'null'
+ {
+ MATCHS(lit_187);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__331Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__331Ex; /* Prevent compiler warnings */
+ ruleT__331Ex: ;
+
+}
+// $ANTLR end T__331
+
+// Comes from: 199:8: ( 'null<' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__332
+ *
+ * Looks to match the characters the constitute the token T__332
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__332(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__332;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:199:8: ( 'null<' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:199:10: 'null<'
+ {
+ MATCHS(lit_188);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__332Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__332Ex; /* Prevent compiler warnings */
+ ruleT__332Ex: ;
+
+}
+// $ANTLR end T__332
+
+// Comes from: 200:8: ( 'operator' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__333
+ *
+ * Looks to match the characters the constitute the token T__333
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__333(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__333;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:200:8: ( 'operator' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:200:10: 'operator'
+ {
+ MATCHS(lit_189);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__333Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__333Ex; /* Prevent compiler warnings */
+ ruleT__333Ex: ;
+
+}
+// $ANTLR end T__333
+
+// Comes from: 201:8: ( 'or' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__334
+ *
+ * Looks to match the characters the constitute the token T__334
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__334(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__334;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:201:8: ( 'or' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:201:10: 'or'
+ {
+ MATCHS(lit_190);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__334Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__334Ex; /* Prevent compiler warnings */
+ ruleT__334Ex: ;
+
+}
+// $ANTLR end T__334
+
+// Comes from: 202:8: ( 'out' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__335
+ *
+ * Looks to match the characters the constitute the token T__335
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__335(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__335;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:202:8: ( 'out' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:202:10: 'out'
+ {
+ MATCHS(lit_191);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__335Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__335Ex; /* Prevent compiler warnings */
+ ruleT__335Ex: ;
+
+}
+// $ANTLR end T__335
+
+// Comes from: 203:8: ( 'output#buffer' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__336
+ *
+ * Looks to match the characters the constitute the token T__336
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__336(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__336;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:203:8: ( 'output#buffer' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:203:10: 'output#buffer'
+ {
+ MATCHS(lit_192);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__336Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__336Ex; /* Prevent compiler warnings */
+ ruleT__336Ex: ;
+
+}
+// $ANTLR end T__336
+
+// Comes from: 204:8: ( 'output#env' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__337
+ *
+ * Looks to match the characters the constitute the token T__337
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__337(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__337;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:204:8: ( 'output#env' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:204:10: 'output#env'
+ {
+ MATCHS(lit_193);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__337Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__337Ex; /* Prevent compiler warnings */
+ ruleT__337Ex: ;
+
+}
+// $ANTLR end T__337
+
+// Comes from: 205:8: ( 'output#flow' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__338
+ *
+ * Looks to match the characters the constitute the token T__338
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__338(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__338;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:205:8: ( 'output#flow' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:205:10: 'output#flow'
+ {
+ MATCHS(lit_194);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__338Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__338Ex; /* Prevent compiler warnings */
+ ruleT__338Ex: ;
+
+}
+// $ANTLR end T__338
+
+// Comes from: 206:8: ( 'output#rdv' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__339
+ *
+ * Looks to match the characters the constitute the token T__339
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__339(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__339;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:206:8: ( 'output#rdv' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:206:10: 'output#rdv'
+ {
+ MATCHS(lit_195);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__339Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__339Ex; /* Prevent compiler warnings */
+ ruleT__339Ex: ;
+
+}
+// $ANTLR end T__339
+
+// Comes from: 207:8: ( 'output#var' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__340
+ *
+ * Looks to match the characters the constitute the token T__340
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__340(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__340;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:207:8: ( 'output#var' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:207:10: 'output#var'
+ {
+ MATCHS(lit_196);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__340Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__340Ex; /* Prevent compiler warnings */
+ ruleT__340Ex: ;
+
+}
+// $ANTLR end T__340
+
+// Comes from: 208:8: ( 'output' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__341
+ *
+ * Looks to match the characters the constitute the token T__341
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__341(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__341;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:208:8: ( 'output' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:208:10: 'output'
+ {
+ MATCHS(lit_197);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__341Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__341Ex; /* Prevent compiler warnings */
+ ruleT__341Ex: ;
+
+}
+// $ANTLR end T__341
+
+// Comes from: 209:8: ( 'package' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__342
+ *
+ * Looks to match the characters the constitute the token T__342
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__342(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__342;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:209:8: ( 'package' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:209:10: 'package'
+ {
+ MATCHS(lit_198);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__342Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__342Ex; /* Prevent compiler warnings */
+ ruleT__342Ex: ;
+
+}
+// $ANTLR end T__342
+
+// Comes from: 210:8: ( 'parent' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__343
+ *
+ * Looks to match the characters the constitute the token T__343
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__343(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__343;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:210:8: ( 'parent' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:210:10: 'parent'
+ {
+ MATCHS(lit_199);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__343Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__343Ex; /* Prevent compiler warnings */
+ ruleT__343Ex: ;
+
+}
+// $ANTLR end T__343
+
+// Comes from: 211:8: ( 'port' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__344
+ *
+ * Looks to match the characters the constitute the token T__344
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__344(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__344;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:211:8: ( 'port' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:211:10: 'port'
+ {
+ MATCHS(lit_200);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__344Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__344Ex; /* Prevent compiler warnings */
+ ruleT__344Ex: ;
+
+}
+// $ANTLR end T__344
+
+// Comes from: 212:8: ( 'pos_int' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__345
+ *
+ * Looks to match the characters the constitute the token T__345
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__345(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__345;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:212:8: ( 'pos_int' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:212:10: 'pos_int'
+ {
+ MATCHS(lit_201);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__345Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__345Ex; /* Prevent compiler warnings */
+ ruleT__345Ex: ;
+
+}
+// $ANTLR end T__345
+
+// Comes from: 213:8: ( 'pos_integer' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__346
+ *
+ * Looks to match the characters the constitute the token T__346
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__346(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__346;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:213:8: ( 'pos_integer' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:213:10: 'pos_integer'
+ {
+ MATCHS(lit_202);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__346Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__346Ex; /* Prevent compiler warnings */
+ ruleT__346Ex: ;
+
+}
+// $ANTLR end T__346
+
+// Comes from: 214:8: ( 'present' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__347
+ *
+ * Looks to match the characters the constitute the token T__347
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__347(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__347;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:214:8: ( 'present' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:214:10: 'present'
+ {
+ MATCHS(lit_203);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__347Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__347Ex; /* Prevent compiler warnings */
+ ruleT__347Ex: ;
+
+}
+// $ANTLR end T__347
+
+// Comes from: 215:8: ( 'prior:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__348
+ *
+ * Looks to match the characters the constitute the token T__348
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__348(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__348;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:215:8: ( 'prior:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:215:10: 'prior:'
+ {
+ MATCHS(lit_204);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__348Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__348Ex; /* Prevent compiler warnings */
+ ruleT__348Ex: ;
+
+}
+// $ANTLR end T__348
+
+// Comes from: 216:8: ( 'private' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__349
+ *
+ * Looks to match the characters the constitute the token T__349
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__349(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__349;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:216:8: ( 'private' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:216:10: 'private'
+ {
+ MATCHS(lit_205);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__349Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__349Ex; /* Prevent compiler warnings */
+ ruleT__349Ex: ;
+
+}
+// $ANTLR end T__349
+
+// Comes from: 217:8: ( 'proba:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__350
+ *
+ * Looks to match the characters the constitute the token T__350
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__350(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__350;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:217:8: ( 'proba:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:217:10: 'proba:'
+ {
+ MATCHS(lit_206);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__350Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__350Ex; /* Prevent compiler warnings */
+ ruleT__350Ex: ;
+
+}
+// $ANTLR end T__350
+
+// Comes from: 218:8: ( 'procedure' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__351
+ *
+ * Looks to match the characters the constitute the token T__351
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__351(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__351;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:218:8: ( 'procedure' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:218:10: 'procedure'
+ {
+ MATCHS(lit_207);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__351Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__351Ex; /* Prevent compiler warnings */
+ ruleT__351Ex: ;
+
+}
+// $ANTLR end T__351
+
+// Comes from: 219:8: ( 'protected' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__352
+ *
+ * Looks to match the characters the constitute the token T__352
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__352(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__352;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:219:8: ( 'protected' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:219:10: 'protected'
+ {
+ MATCHS(lit_208);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__352Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__352Ex; /* Prevent compiler warnings */
+ ruleT__352Ex: ;
+
+}
+// $ANTLR end T__352
+
+// Comes from: 220:8: ( 'prototype' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__353
+ *
+ * Looks to match the characters the constitute the token T__353
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__353(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__353;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:220:8: ( 'prototype' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:220:10: 'prototype'
+ {
+ MATCHS(lit_209);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__353Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__353Ex; /* Prevent compiler warnings */
+ ruleT__353Ex: ;
+
+}
+// $ANTLR end T__353
+
+// Comes from: 221:8: ( 'provided:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__354
+ *
+ * Looks to match the characters the constitute the token T__354
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__354(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__354;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:221:8: ( 'provided:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:221:10: 'provided:'
+ {
+ MATCHS(lit_210);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__354Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__354Ex; /* Prevent compiler warnings */
+ ruleT__354Ex: ;
+
+}
+// $ANTLR end T__354
+
+// Comes from: 222:8: ( 'public' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__355
+ *
+ * Looks to match the characters the constitute the token T__355
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__355(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__355;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:222:8: ( 'public' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:222:10: 'public'
+ {
+ MATCHS(lit_211);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__355Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__355Ex; /* Prevent compiler warnings */
+ ruleT__355Ex: ;
+
+}
+// $ANTLR end T__355
+
+// Comes from: 223:8: ( 'ram' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__356
+ *
+ * Looks to match the characters the constitute the token T__356
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__356(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__356;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:223:8: ( 'ram' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:223:10: 'ram'
+ {
+ MATCHS(lit_212);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__356Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__356Ex; /* Prevent compiler warnings */
+ ruleT__356Ex: ;
+
+}
+// $ANTLR end T__356
+
+// Comes from: 224:8: ( 'rat' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__357
+ *
+ * Looks to match the characters the constitute the token T__357
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__357(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__357;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:224:8: ( 'rat' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:224:10: 'rat'
+ {
+ MATCHS(lit_213);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__357Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__357Ex; /* Prevent compiler warnings */
+ ruleT__357Ex: ;
+
+}
+// $ANTLR end T__357
+
+// Comes from: 225:8: ( 'rational' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__358
+ *
+ * Looks to match the characters the constitute the token T__358
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__358(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__358;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:225:8: ( 'rational' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:225:10: 'rational'
+ {
+ MATCHS(lit_214);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__358Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__358Ex; /* Prevent compiler warnings */
+ ruleT__358Ex: ;
+
+}
+// $ANTLR end T__358
+
+// Comes from: 226:8: ( 'rdv' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__359
+ *
+ * Looks to match the characters the constitute the token T__359
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__359(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__359;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:226:8: ( 'rdv' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:226:10: 'rdv'
+ {
+ MATCHS(lit_215);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__359Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__359Ex; /* Prevent compiler warnings */
+ ruleT__359Ex: ;
+
+}
+// $ANTLR end T__359
+
+// Comes from: 227:8: ( 'real' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__360
+ *
+ * Looks to match the characters the constitute the token T__360
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__360(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__360;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:227:8: ( 'real' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:227:10: 'real'
+ {
+ MATCHS(lit_216);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__360Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__360Ex; /* Prevent compiler warnings */
+ ruleT__360Ex: ;
+
+}
+// $ANTLR end T__360
+
+// Comes from: 228:8: ( 'ref' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__361
+ *
+ * Looks to match the characters the constitute the token T__361
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__361(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__361;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:228:8: ( 'ref' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:228:10: 'ref'
+ {
+ MATCHS(lit_217);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__361Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__361Ex; /* Prevent compiler warnings */
+ ruleT__361Ex: ;
+
+}
+// $ANTLR end T__361
+
+// Comes from: 229:8: ( 'restart' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__362
+ *
+ * Looks to match the characters the constitute the token T__362
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__362(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__362;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:229:8: ( 'restart' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:229:10: 'restart'
+ {
+ MATCHS(lit_218);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__362Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__362Ex; /* Prevent compiler warnings */
+ ruleT__362Ex: ;
+
+}
+// $ANTLR end T__362
+
+// Comes from: 230:8: ( 'resume' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__363
+ *
+ * Looks to match the characters the constitute the token T__363
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__363(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__363;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:230:8: ( 'resume' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:230:10: 'resume'
+ {
+ MATCHS(lit_219);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__363Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__363Ex; /* Prevent compiler warnings */
+ ruleT__363Ex: ;
+
+}
+// $ANTLR end T__363
+
+// Comes from: 231:8: ( 'return' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__364
+ *
+ * Looks to match the characters the constitute the token T__364
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__364(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__364;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:231:8: ( 'return' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:231:10: 'return'
+ {
+ MATCHS(lit_220);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__364Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__364Ex; /* Prevent compiler warnings */
+ ruleT__364Ex: ;
+
+}
+// $ANTLR end T__364
+
+// Comes from: 232:8: ( 'returns:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__365
+ *
+ * Looks to match the characters the constitute the token T__365
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__365(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__365;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:232:8: ( 'returns:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:232:10: 'returns:'
+ {
+ MATCHS(lit_221);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__365Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__365Ex; /* Prevent compiler warnings */
+ ruleT__365Ex: ;
+
+}
+// $ANTLR end T__365
+
+// Comes from: 233:8: ( 'route' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__366
+ *
+ * Looks to match the characters the constitute the token T__366
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__366(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__366;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:233:8: ( 'route' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:233:10: 'route'
+ {
+ MATCHS(lit_222);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__366Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__366Ex; /* Prevent compiler warnings */
+ ruleT__366Ex: ;
+
+}
+// $ANTLR end T__366
+
+// Comes from: 234:8: ( 'routine' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__367
+ *
+ * Looks to match the characters the constitute the token T__367
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__367(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__367;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:234:8: ( 'routine' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:234:10: 'routine'
+ {
+ MATCHS(lit_223);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__367Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__367Ex; /* Prevent compiler warnings */
+ ruleT__367Ex: ;
+
+}
+// $ANTLR end T__367
+
+// Comes from: 235:8: ( 'rtc' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__368
+ *
+ * Looks to match the characters the constitute the token T__368
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__368(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__368;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:235:8: ( 'rtc' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:235:10: 'rtc'
+ {
+ MATCHS(lit_224);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__368Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__368Ex; /* Prevent compiler warnings */
+ ruleT__368Ex: ;
+
+}
+// $ANTLR end T__368
+
+// Comes from: 236:8: ( 'run' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__369
+ *
+ * Looks to match the characters the constitute the token T__369
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__369(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__369;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:236:8: ( 'run' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:236:10: 'run'
+ {
+ MATCHS(lit_225);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__369Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__369Ex; /* Prevent compiler warnings */
+ ruleT__369Ex: ;
+
+}
+// $ANTLR end T__369
+
+// Comes from: 237:8: ( 'rvector' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__370
+ *
+ * Looks to match the characters the constitute the token T__370
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__370(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__370;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:237:8: ( 'rvector' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:237:10: 'rvector'
+ {
+ MATCHS(lit_226);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__370Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__370Ex; /* Prevent compiler warnings */
+ ruleT__370Ex: ;
+
+}
+// $ANTLR end T__370
+
+// Comes from: 238:8: ( 'schedule' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__371
+ *
+ * Looks to match the characters the constitute the token T__371
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__371(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__371;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:238:8: ( 'schedule' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:238:10: 'schedule'
+ {
+ MATCHS(lit_227);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__371Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__371Ex; /* Prevent compiler warnings */
+ ruleT__371Ex: ;
+
+}
+// $ANTLR end T__371
+
+// Comes from: 239:8: ( 'self' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__372
+ *
+ * Looks to match the characters the constitute the token T__372
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__372(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__372;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:239:8: ( 'self' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:239:10: 'self'
+ {
+ MATCHS(lit_228);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__372Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__372Ex; /* Prevent compiler warnings */
+ ruleT__372Ex: ;
+
+}
+// $ANTLR end T__372
+
+// Comes from: 240:8: ( 'set' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__373
+ *
+ * Looks to match the characters the constitute the token T__373
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__373(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__373;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:240:8: ( 'set' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:240:10: 'set'
+ {
+ MATCHS(lit_229);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__373Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__373Ex; /* Prevent compiler warnings */
+ ruleT__373Ex: ;
+
+}
+// $ANTLR end T__373
+
+// Comes from: 241:8: ( 'signal' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__374
+ *
+ * Looks to match the characters the constitute the token T__374
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__374(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__374;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:241:8: ( 'signal' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:241:10: 'signal'
+ {
+ MATCHS(lit_230);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__374Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__374Ex; /* Prevent compiler warnings */
+ ruleT__374Ex: ;
+
+}
+// $ANTLR end T__374
+
+// Comes from: 242:8: ( 'size:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__375
+ *
+ * Looks to match the characters the constitute the token T__375
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__375(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__375;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:242:8: ( 'size:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:242:10: 'size:'
+ {
+ MATCHS(lit_231);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__375Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__375Ex; /* Prevent compiler warnings */
+ ruleT__375Ex: ;
+
+}
+// $ANTLR end T__375
+
+// Comes from: 243:8: ( 'solver:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__376
+ *
+ * Looks to match the characters the constitute the token T__376
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__376(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__376;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:243:8: ( 'solver:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:243:10: 'solver:'
+ {
+ MATCHS(lit_232);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__376Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__376Ex; /* Prevent compiler warnings */
+ ruleT__376Ex: ;
+
+}
+// $ANTLR end T__376
+
+// Comes from: 244:8: ( 'start' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__377
+ *
+ * Looks to match the characters the constitute the token T__377
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__377(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__377;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:244:8: ( 'start' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:244:10: 'start'
+ {
+ MATCHS(lit_233);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__377Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__377Ex; /* Prevent compiler warnings */
+ ruleT__377Ex: ;
+
+}
+// $ANTLR end T__377
+
+// Comes from: 245:8: ( 'state' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__378
+ *
+ * Looks to match the characters the constitute the token T__378
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__378(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__378;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:245:8: ( 'state' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:245:10: 'state'
+ {
+ MATCHS(lit_234);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__378Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__378Ex; /* Prevent compiler warnings */
+ ruleT__378Ex: ;
+
+}
+// $ANTLR end T__378
+
+// Comes from: 246:8: ( 'statemachine' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__379
+ *
+ * Looks to match the characters the constitute the token T__379
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__379(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__379;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:246:8: ( 'statemachine' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:246:10: 'statemachine'
+ {
+ MATCHS(lit_235);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__379Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__379Ex; /* Prevent compiler warnings */
+ ruleT__379Ex: ;
+
+}
+// $ANTLR end T__379
+
+// Comes from: 247:8: ( 'static' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__380
+ *
+ * Looks to match the characters the constitute the token T__380
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__380(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__380;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:247:8: ( 'static' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:247:10: 'static'
+ {
+ MATCHS(lit_236);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__380Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__380Ex; /* Prevent compiler warnings */
+ ruleT__380Ex: ;
+
+}
+// $ANTLR end T__380
+
+// Comes from: 248:8: ( 'status#being' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__381
+ *
+ * Looks to match the characters the constitute the token T__381
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__381(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__381;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:248:8: ( 'status#being' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:248:10: 'status#being'
+ {
+ MATCHS(lit_237);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__381Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__381Ex; /* Prevent compiler warnings */
+ ruleT__381Ex: ;
+
+}
+// $ANTLR end T__381
+
+// Comes from: 249:8: ( 'status#is' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__382
+ *
+ * Looks to match the characters the constitute the token T__382
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__382(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__382;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:249:8: ( 'status#is' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:249:10: 'status#is'
+ {
+ MATCHS(lit_238);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__382Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__382Ex; /* Prevent compiler warnings */
+ ruleT__382Ex: ;
+
+}
+// $ANTLR end T__382
+
+// Comes from: 250:8: ( 'status#was' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__383
+ *
+ * Looks to match the characters the constitute the token T__383
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__383(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__383;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:250:8: ( 'status#was' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:250:10: 'status#was'
+ {
+ MATCHS(lit_239);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__383Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__383Ex; /* Prevent compiler warnings */
+ ruleT__383Ex: ;
+
+}
+// $ANTLR end T__383
+
+// Comes from: 251:8: ( 'status#will' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__384
+ *
+ * Looks to match the characters the constitute the token T__384
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__384(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__384;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:251:8: ( 'status#will' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:251:10: 'status#will'
+ {
+ MATCHS(lit_240);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__384Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__384Ex; /* Prevent compiler warnings */
+ ruleT__384Ex: ;
+
+}
+// $ANTLR end T__384
+
+// Comes from: 252:8: ( 'step_mark' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__385
+ *
+ * Looks to match the characters the constitute the token T__385
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__385(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__385;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:252:8: ( 'step_mark' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:252:10: 'step_mark'
+ {
+ MATCHS(lit_241);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__385Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__385Ex; /* Prevent compiler warnings */
+ ruleT__385Ex: ;
+
+}
+// $ANTLR end T__385
+
+// Comes from: 253:8: ( 'stop' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__386
+ *
+ * Looks to match the characters the constitute the token T__386
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__386(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__386;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:253:8: ( 'stop' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:253:10: 'stop'
+ {
+ MATCHS(lit_242);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__386Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__386Ex; /* Prevent compiler warnings */
+ ruleT__386Ex: ;
+
+}
+// $ANTLR end T__386
+
+// Comes from: 254:8: ( 'string' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__387
+ *
+ * Looks to match the characters the constitute the token T__387
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__387(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__387;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:254:8: ( 'string' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:254:10: 'string'
+ {
+ MATCHS(lit_243);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__387Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__387Ex; /* Prevent compiler warnings */
+ ruleT__387Ex: ;
+
+}
+// $ANTLR end T__387
+
+// Comes from: 255:8: ( 'struct' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__388
+ *
+ * Looks to match the characters the constitute the token T__388
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__388(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__388;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:255:8: ( 'struct' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:255:10: 'struct'
+ {
+ MATCHS(lit_244);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__388Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__388Ex; /* Prevent compiler warnings */
+ ruleT__388Ex: ;
+
+}
+// $ANTLR end T__388
+
+// Comes from: 256:8: ( 'suspend' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__389
+ *
+ * Looks to match the characters the constitute the token T__389
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__389(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__389;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:256:8: ( 'suspend' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:256:10: 'suspend'
+ {
+ MATCHS(lit_245);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__389Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__389Ex; /* Prevent compiler warnings */
+ ruleT__389Ex: ;
+
+}
+// $ANTLR end T__389
+
+// Comes from: 257:8: ( 'system' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__390
+ *
+ * Looks to match the characters the constitute the token T__390
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__390(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__390;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:257:8: ( 'system' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:257:10: 'system'
+ {
+ MATCHS(lit_246);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__390Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__390Ex; /* Prevent compiler warnings */
+ ruleT__390Ex: ;
+
+}
+// $ANTLR end T__390
+
+// Comes from: 258:8: ( 'tguard' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__391
+ *
+ * Looks to match the characters the constitute the token T__391
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__391(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__391;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:258:8: ( 'tguard' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:258:10: 'tguard'
+ {
+ MATCHS(lit_247);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__391Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__391Ex; /* Prevent compiler warnings */
+ ruleT__391Ex: ;
+
+}
+// $ANTLR end T__391
+
+// Comes from: 259:8: ( 'time' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__392
+ *
+ * Looks to match the characters the constitute the token T__392
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__392(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__392;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:259:8: ( 'time' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:259:10: 'time'
+ {
+ MATCHS(lit_248);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__392Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__392Ex; /* Prevent compiler warnings */
+ ruleT__392Ex: ;
+
+}
+// $ANTLR end T__392
+
+// Comes from: 260:8: ( 'timed' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__393
+ *
+ * Looks to match the characters the constitute the token T__393
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__393(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__393;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:260:8: ( 'timed' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:260:10: 'timed'
+ {
+ MATCHS(lit_249);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__393Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__393Ex; /* Prevent compiler warnings */
+ ruleT__393Ex: ;
+
+}
+// $ANTLR end T__393
+
+// Comes from: 261:8: ( 'to:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__394
+ *
+ * Looks to match the characters the constitute the token T__394
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__394(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__394;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:261:8: ( 'to:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:261:10: 'to:'
+ {
+ MATCHS(lit_250);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__394Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__394Ex; /* Prevent compiler warnings */
+ ruleT__394Ex: ;
+
+}
+// $ANTLR end T__394
+
+// Comes from: 262:8: ( 'transient' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__395
+ *
+ * Looks to match the characters the constitute the token T__395
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__395(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__395;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:262:8: ( 'transient' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:262:10: 'transient'
+ {
+ MATCHS(lit_251);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__395Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__395Ex; /* Prevent compiler warnings */
+ ruleT__395Ex: ;
+
+}
+// $ANTLR end T__395
+
+// Comes from: 263:8: ( 'transition' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__396
+ *
+ * Looks to match the characters the constitute the token T__396
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__396(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__396;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:263:8: ( 'transition' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:263:10: 'transition'
+ {
+ MATCHS(lit_252);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__396Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__396Ex; /* Prevent compiler warnings */
+ ruleT__396Ex: ;
+
+}
+// $ANTLR end T__396
+
+// Comes from: 264:8: ( 'true' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__397
+ *
+ * Looks to match the characters the constitute the token T__397
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__397(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__397;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:264:8: ( 'true' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:264:10: 'true'
+ {
+ MATCHS(lit_253);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__397Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__397Ex; /* Prevent compiler warnings */
+ ruleT__397Ex: ;
+
+}
+// $ANTLR end T__397
+
+// Comes from: 265:8: ( 'type' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__398
+ *
+ * Looks to match the characters the constitute the token T__398
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__398(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__398;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:265:8: ( 'type' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:265:10: 'type'
+ {
+ MATCHS(lit_254);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__398Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__398Ex; /* Prevent compiler warnings */
+ ruleT__398Ex: ;
+
+}
+// $ANTLR end T__398
+
+// Comes from: 266:8: ( 'udouble' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__399
+ *
+ * Looks to match the characters the constitute the token T__399
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__399(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__399;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:266:8: ( 'udouble' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:266:10: 'udouble'
+ {
+ MATCHS(lit_255);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__399Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__399Ex; /* Prevent compiler warnings */
+ ruleT__399Ex: ;
+
+}
+// $ANTLR end T__399
+
+// Comes from: 267:8: ( 'ufloat' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__400
+ *
+ * Looks to match the characters the constitute the token T__400
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__400(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__400;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:267:8: ( 'ufloat' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:267:10: 'ufloat'
+ {
+ MATCHS(lit_256);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__400Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__400Ex; /* Prevent compiler warnings */
+ ruleT__400Ex: ;
+
+}
+// $ANTLR end T__400
+
+// Comes from: 268:8: ( 'uint' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__401
+ *
+ * Looks to match the characters the constitute the token T__401
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__401(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__401;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:268:8: ( 'uint' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:268:10: 'uint'
+ {
+ MATCHS(lit_257);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__401Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__401Ex; /* Prevent compiler warnings */
+ ruleT__401Ex: ;
+
+}
+// $ANTLR end T__401
+
+// Comes from: 269:8: ( 'uinteger' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__402
+ *
+ * Looks to match the characters the constitute the token T__402
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__402(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__402;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:269:8: ( 'uinteger' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:269:10: 'uinteger'
+ {
+ MATCHS(lit_258);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__402Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__402Ex; /* Prevent compiler warnings */
+ ruleT__402Ex: ;
+
+}
+// $ANTLR end T__402
+
+// Comes from: 270:8: ( 'unicast' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__403
+ *
+ * Looks to match the characters the constitute the token T__403
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__403(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__403;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:270:8: ( 'unicast' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:270:10: 'unicast'
+ {
+ MATCHS(lit_259);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__403Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__403Ex; /* Prevent compiler warnings */
+ ruleT__403Ex: ;
+
+}
+// $ANTLR end T__403
+
+// Comes from: 271:8: ( 'union' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__404
+ *
+ * Looks to match the characters the constitute the token T__404
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__404(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__404;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:271:8: ( 'union' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:271:10: 'union'
+ {
+ MATCHS(lit_260);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__404Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__404Ex; /* Prevent compiler warnings */
+ ruleT__404Ex: ;
+
+}
+// $ANTLR end T__404
+
+// Comes from: 272:8: ( 'universal' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__405
+ *
+ * Looks to match the characters the constitute the token T__405
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__405(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__405;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:272:8: ( 'universal' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:272:10: 'universal'
+ {
+ MATCHS(lit_261);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__405Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__405Ex; /* Prevent compiler warnings */
+ ruleT__405Ex: ;
+
+}
+// $ANTLR end T__405
+
+// Comes from: 273:8: ( 'unsafe' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__406
+ *
+ * Looks to match the characters the constitute the token T__406
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__406(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__406;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:273:8: ( 'unsafe' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:273:10: 'unsafe'
+ {
+ MATCHS(lit_262);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__406Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__406Ex; /* Prevent compiler warnings */
+ ruleT__406Ex: ;
+
+}
+// $ANTLR end T__406
+
+// Comes from: 274:8: ( 'urat' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__407
+ *
+ * Looks to match the characters the constitute the token T__407
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__407(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__407;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:274:8: ( 'urat' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:274:10: 'urat'
+ {
+ MATCHS(lit_263);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__407Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__407Ex; /* Prevent compiler warnings */
+ ruleT__407Ex: ;
+
+}
+// $ANTLR end T__407
+
+// Comes from: 275:8: ( 'urational' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__408
+ *
+ * Looks to match the characters the constitute the token T__408
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__408(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__408;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:275:8: ( 'urational' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:275:10: 'urational'
+ {
+ MATCHS(lit_264);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__408Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__408Ex; /* Prevent compiler warnings */
+ ruleT__408Ex: ;
+
+}
+// $ANTLR end T__408
+
+// Comes from: 276:8: ( 'ureal' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__409
+ *
+ * Looks to match the characters the constitute the token T__409
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__409(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__409;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:276:8: ( 'ureal' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:276:10: 'ureal'
+ {
+ MATCHS(lit_265);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__409Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__409Ex; /* Prevent compiler warnings */
+ ruleT__409Ex: ;
+
+}
+// $ANTLR end T__409
+
+// Comes from: 277:8: ( 'val' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__410
+ *
+ * Looks to match the characters the constitute the token T__410
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__410(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__410;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:277:8: ( 'val' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:277:10: 'val'
+ {
+ MATCHS(lit_266);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__410Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__410Ex; /* Prevent compiler warnings */
+ ruleT__410Ex: ;
+
+}
+// $ANTLR end T__410
+
+// Comes from: 278:8: ( 'var' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__411
+ *
+ * Looks to match the characters the constitute the token T__411
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__411(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__411;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:278:8: ( 'var' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:278:10: 'var'
+ {
+ MATCHS(lit_267);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__411Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__411Ex; /* Prevent compiler warnings */
+ ruleT__411Ex: ;
+
+}
+// $ANTLR end T__411
+
+// Comes from: 279:8: ( 'vector' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__412
+ *
+ * Looks to match the characters the constitute the token T__412
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__412(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__412;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:279:8: ( 'vector' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:279:10: 'vector'
+ {
+ MATCHS(lit_268);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__412Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__412Ex; /* Prevent compiler warnings */
+ ruleT__412Ex: ;
+
+}
+// $ANTLR end T__412
+
+// Comes from: 280:8: ( 'via' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__413
+ *
+ * Looks to match the characters the constitute the token T__413
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__413(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__413;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:280:8: ( 'via' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:280:10: 'via'
+ {
+ MATCHS(lit_269);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__413Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__413Ex; /* Prevent compiler warnings */
+ ruleT__413Ex: ;
+
+}
+// $ANTLR end T__413
+
+// Comes from: 281:8: ( 'volatile' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__414
+ *
+ * Looks to match the characters the constitute the token T__414
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__414(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__414;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:281:8: ( 'volatile' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:281:10: 'volatile'
+ {
+ MATCHS(lit_270);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__414Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__414Ex; /* Prevent compiler warnings */
+ ruleT__414Ex: ;
+
+}
+// $ANTLR end T__414
+
+// Comes from: 282:8: ( 'wait' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__415
+ *
+ * Looks to match the characters the constitute the token T__415
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__415(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__415;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:282:8: ( 'wait' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:282:10: 'wait'
+ {
+ MATCHS(lit_271);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__415Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__415Ex; /* Prevent compiler warnings */
+ ruleT__415Ex: ;
+
+}
+// $ANTLR end T__415
+
+// Comes from: 283:8: ( 'while' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__416
+ *
+ * Looks to match the characters the constitute the token T__416
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__416(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__416;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:283:8: ( 'while' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:283:10: 'while'
+ {
+ MATCHS(lit_272);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__416Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__416Ex; /* Prevent compiler warnings */
+ ruleT__416Ex: ;
+
+}
+// $ANTLR end T__416
+
+// Comes from: 284:8: ( '|=>' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__417
+ *
+ * Looks to match the characters the constitute the token T__417
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__417(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__417;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:284:8: ( '|=>' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:284:10: '|=>'
+ {
+ MATCHS(lit_273);
+ if (HASEXCEPTION())
+ {
+ goto ruleT__417Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__417Ex; /* Prevent compiler warnings */
+ ruleT__417Ex: ;
+
+}
+// $ANTLR end T__417
+
+// Comes from: 6595:20: ( '|§|' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_ATOMIC_SEQUENCE
+ *
+ * Looks to match the characters the constitute the token OP_ATOMIC_SEQUENCE
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_ATOMIC_SEQUENCE(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_ATOMIC_SEQUENCE;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6595:20: ( '|§|' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6595:22: '|§|'
+ {
+ MATCHS(lit_274);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_ATOMIC_SEQUENCEEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_ATOMIC_SEQUENCEEx; /* Prevent compiler warnings */
+ ruleOP_ATOMIC_SEQUENCEEx: ;
+
+}
+// $ANTLR end OP_ATOMIC_SEQUENCE
+
+// Comes from: 6597:20: ( '|;|' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_SEQUENCE
+ *
+ * Looks to match the characters the constitute the token OP_SEQUENCE
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_SEQUENCE(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_SEQUENCE;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6597:20: ( '|;|' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6597:22: '|;|'
+ {
+ MATCHS(lit_275);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_SEQUENCEEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_SEQUENCEEx; /* Prevent compiler warnings */
+ ruleOP_SEQUENCEEx: ;
+
+}
+// $ANTLR end OP_SEQUENCE
+
+// Comes from: 6598:20: ( '|.|' | '|/;|' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_SEQUENCE_SIDE
+ *
+ * Looks to match the characters the constitute the token OP_SEQUENCE_SIDE
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_SEQUENCE_SIDE(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_SEQUENCE_SIDE;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6598:20: ( '|.|' | '|/;|' )
+
+ ANTLR3_UINT32 alt1;
+
+ alt1=2;
+
+ switch ( LA(1) )
+ {
+ case '|':
+ {
+ switch ( LA(2) )
+ {
+ case '.':
+ {
+ alt1=1;
+ }
+ break;
+ case '/':
+ {
+ alt1=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 1;
+ EXCEPTION->state = 1;
+
+
+ goto ruleOP_SEQUENCE_SIDEEx;
+
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 1;
+ EXCEPTION->state = 0;
+
+
+ goto ruleOP_SEQUENCE_SIDEEx;
+
+ }
+
+ switch (alt1)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6598:22: '|.|'
+ {
+ MATCHS(lit_276);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_SEQUENCE_SIDEEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6598:31: '|/;|'
+ {
+ MATCHS(lit_277);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_SEQUENCE_SIDEEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+
+ }
+ }
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_SEQUENCE_SIDEEx; /* Prevent compiler warnings */
+ ruleOP_SEQUENCE_SIDEEx: ;
+
+}
+// $ANTLR end OP_SEQUENCE_SIDE
+
+// Comes from: 6599:20: ( '|;;|' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_SEQUENCE_WEAK
+ *
+ * Looks to match the characters the constitute the token OP_SEQUENCE_WEAK
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_SEQUENCE_WEAK(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_SEQUENCE_WEAK;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6599:20: ( '|;;|' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6599:22: '|;;|'
+ {
+ MATCHS(lit_278);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_SEQUENCE_WEAKEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_SEQUENCE_WEAKEx; /* Prevent compiler warnings */
+ ruleOP_SEQUENCE_WEAKEx: ;
+
+}
+// $ANTLR end OP_SEQUENCE_WEAK
+
+// Comes from: 6601:20: ( '|>|' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_SCHEDULE_GT
+ *
+ * Looks to match the characters the constitute the token OP_SCHEDULE_GT
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_SCHEDULE_GT(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_SCHEDULE_GT;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6601:20: ( '|>|' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6601:22: '|>|'
+ {
+ MATCHS(lit_279);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_SCHEDULE_GTEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_SCHEDULE_GTEx; /* Prevent compiler warnings */
+ ruleOP_SCHEDULE_GTEx: ;
+
+}
+// $ANTLR end OP_SCHEDULE_GT
+
+// Comes from: 6602:20: ( '|<|' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_SCHEDULE_LT
+ *
+ * Looks to match the characters the constitute the token OP_SCHEDULE_LT
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_SCHEDULE_LT(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_SCHEDULE_LT;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6602:20: ( '|<|' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6602:22: '|<|'
+ {
+ MATCHS(lit_280);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_SCHEDULE_LTEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_SCHEDULE_LTEx; /* Prevent compiler warnings */
+ ruleOP_SCHEDULE_LTEx: ;
+
+}
+// $ANTLR end OP_SCHEDULE_LT
+
+// Comes from: 6603:20: ( '|xor|' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_SCHEDULE_XOR
+ *
+ * Looks to match the characters the constitute the token OP_SCHEDULE_XOR
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_SCHEDULE_XOR(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_SCHEDULE_XOR;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6603:20: ( '|xor|' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6603:22: '|xor|'
+ {
+ MATCHS(lit_281);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_SCHEDULE_XOREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_SCHEDULE_XOREx; /* Prevent compiler warnings */
+ ruleOP_SCHEDULE_XOREx: ;
+
+}
+// $ANTLR end OP_SCHEDULE_XOR
+
+// Comes from: 6605:22: ( '|and#then|' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_SCHEDULE_AND_THEN
+ *
+ * Looks to match the characters the constitute the token OP_SCHEDULE_AND_THEN
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_SCHEDULE_AND_THEN(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_SCHEDULE_AND_THEN;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6605:22: ( '|and#then|' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6605:24: '|and#then|'
+ {
+ MATCHS(lit_282);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_SCHEDULE_AND_THENEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_SCHEDULE_AND_THENEx; /* Prevent compiler warnings */
+ ruleOP_SCHEDULE_AND_THENEx: ;
+
+}
+// $ANTLR end OP_SCHEDULE_AND_THEN
+
+// Comes from: 6606:22: ( '|or#else|' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_SCHEDULE_OR_ELSE
+ *
+ * Looks to match the characters the constitute the token OP_SCHEDULE_OR_ELSE
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_SCHEDULE_OR_ELSE(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_SCHEDULE_OR_ELSE;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6606:22: ( '|or#else|' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6606:24: '|or#else|'
+ {
+ MATCHS(lit_283);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_SCHEDULE_OR_ELSEEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_SCHEDULE_OR_ELSEEx; /* Prevent compiler warnings */
+ ruleOP_SCHEDULE_OR_ELSEEx: ;
+
+}
+// $ANTLR end OP_SCHEDULE_OR_ELSE
+
+// Comes from: 6609:20: ( '|/\\|' | '|indet|' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_NON_DETERMINISM
+ *
+ * Looks to match the characters the constitute the token OP_NON_DETERMINISM
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_NON_DETERMINISM(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_NON_DETERMINISM;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6609:20: ( '|/\\|' | '|indet|' )
+
+ ANTLR3_UINT32 alt2;
+
+ alt2=2;
+
+ switch ( LA(1) )
+ {
+ case '|':
+ {
+ switch ( LA(2) )
+ {
+ case '/':
+ {
+ alt2=1;
+ }
+ break;
+ case 'i':
+ {
+ alt2=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 2;
+ EXCEPTION->state = 1;
+
+
+ goto ruleOP_NON_DETERMINISMEx;
+
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 2;
+ EXCEPTION->state = 0;
+
+
+ goto ruleOP_NON_DETERMINISMEx;
+
+ }
+
+ switch (alt2)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6609:22: '|/\\|'
+ {
+ MATCHS(lit_284);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_NON_DETERMINISMEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6609:31: '|indet|'
+ {
+ MATCHS(lit_285);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_NON_DETERMINISMEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+
+ }
+ }
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_NON_DETERMINISMEx; /* Prevent compiler warnings */
+ ruleOP_NON_DETERMINISMEx: ;
+
+}
+// $ANTLR end OP_NON_DETERMINISM
+
+// Comes from: 6611:29: ( '|a|' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_CONCURRENCY_ASYNC
+ *
+ * Looks to match the characters the constitute the token OP_CONCURRENCY_ASYNC
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_CONCURRENCY_ASYNC(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_CONCURRENCY_ASYNC;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6611:29: ( '|a|' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6611:31: '|a|'
+ {
+ MATCHS(lit_286);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_CONCURRENCY_ASYNCEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_CONCURRENCY_ASYNCEx; /* Prevent compiler warnings */
+ ruleOP_CONCURRENCY_ASYNCEx: ;
+
+}
+// $ANTLR end OP_CONCURRENCY_ASYNC
+
+// Comes from: 6612:29: ( '|and|' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_CONCURRENCY_AND
+ *
+ * Looks to match the characters the constitute the token OP_CONCURRENCY_AND
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_CONCURRENCY_AND(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_CONCURRENCY_AND;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6612:29: ( '|and|' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6612:31: '|and|'
+ {
+ MATCHS(lit_287);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_CONCURRENCY_ANDEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_CONCURRENCY_ANDEx; /* Prevent compiler warnings */
+ ruleOP_CONCURRENCY_ANDEx: ;
+
+}
+// $ANTLR end OP_CONCURRENCY_AND
+
+// Comes from: 6613:29: ( '|or|' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_CONCURRENCY_OR
+ *
+ * Looks to match the characters the constitute the token OP_CONCURRENCY_OR
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_CONCURRENCY_OR(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_CONCURRENCY_OR;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6613:29: ( '|or|' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6613:31: '|or|'
+ {
+ MATCHS(lit_288);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_CONCURRENCY_OREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_CONCURRENCY_OREx; /* Prevent compiler warnings */
+ ruleOP_CONCURRENCY_OREx: ;
+
+}
+// $ANTLR end OP_CONCURRENCY_OR
+
+// Comes from: 6614:29: ( '|i|' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_CONCURRENCY_INTERLEAVING
+ *
+ * Looks to match the characters the constitute the token OP_CONCURRENCY_INTERLEAVING
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_CONCURRENCY_INTERLEAVING(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_CONCURRENCY_INTERLEAVING;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6614:29: ( '|i|' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6614:31: '|i|'
+ {
+ MATCHS(lit_289);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_CONCURRENCY_INTERLEAVINGEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_CONCURRENCY_INTERLEAVINGEx; /* Prevent compiler warnings */
+ ruleOP_CONCURRENCY_INTERLEAVINGEx: ;
+
+}
+// $ANTLR end OP_CONCURRENCY_INTERLEAVING
+
+// Comes from: 6615:29: ( '|,|' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_CONCURRENCY_PARALLEL
+ *
+ * Looks to match the characters the constitute the token OP_CONCURRENCY_PARALLEL
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_CONCURRENCY_PARALLEL(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_CONCURRENCY_PARALLEL;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6615:29: ( '|,|' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6615:31: '|,|'
+ {
+ MATCHS(lit_290);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_CONCURRENCY_PARALLELEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_CONCURRENCY_PARALLELEx; /* Prevent compiler warnings */
+ ruleOP_CONCURRENCY_PARALLELEx: ;
+
+}
+// $ANTLR end OP_CONCURRENCY_PARALLEL
+
+// Comes from: 6617:21: ( '|fork|' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_FORK
+ *
+ * Looks to match the characters the constitute the token OP_FORK
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_FORK(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_FORK;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6617:21: ( '|fork|' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6617:23: '|fork|'
+ {
+ MATCHS(lit_291);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_FORKEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_FORKEx; /* Prevent compiler warnings */
+ ruleOP_FORKEx: ;
+
+}
+// $ANTLR end OP_FORK
+
+// Comes from: 6618:21: ( '|join|' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_JOIN
+ *
+ * Looks to match the characters the constitute the token OP_JOIN
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_JOIN(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_JOIN;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6618:21: ( '|join|' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6618:23: '|join|'
+ {
+ MATCHS(lit_292);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_JOINEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_JOINEx; /* Prevent compiler warnings */
+ ruleOP_JOINEx: ;
+
+}
+// $ANTLR end OP_JOIN
+
+// Comes from: 6621:33: ( '||a||' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_CONCURRENCY_RDV_ASYNC
+ *
+ * Looks to match the characters the constitute the token OP_CONCURRENCY_RDV_ASYNC
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_CONCURRENCY_RDV_ASYNC(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_CONCURRENCY_RDV_ASYNC;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6621:33: ( '||a||' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6621:35: '||a||'
+ {
+ MATCHS(lit_293);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_CONCURRENCY_RDV_ASYNCEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_CONCURRENCY_RDV_ASYNCEx; /* Prevent compiler warnings */
+ ruleOP_CONCURRENCY_RDV_ASYNCEx: ;
+
+}
+// $ANTLR end OP_CONCURRENCY_RDV_ASYNC
+
+// Comes from: 6622:33: ( '||and||' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_CONCURRENCY_RDV_AND
+ *
+ * Looks to match the characters the constitute the token OP_CONCURRENCY_RDV_AND
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_CONCURRENCY_RDV_AND(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_CONCURRENCY_RDV_AND;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6622:33: ( '||and||' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6622:35: '||and||'
+ {
+ MATCHS(lit_294);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_CONCURRENCY_RDV_ANDEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_CONCURRENCY_RDV_ANDEx; /* Prevent compiler warnings */
+ ruleOP_CONCURRENCY_RDV_ANDEx: ;
+
+}
+// $ANTLR end OP_CONCURRENCY_RDV_AND
+
+// Comes from: 6623:33: ( '||or||' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_CONCURRENCY_RDV_OR
+ *
+ * Looks to match the characters the constitute the token OP_CONCURRENCY_RDV_OR
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_CONCURRENCY_RDV_OR(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_CONCURRENCY_RDV_OR;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6623:33: ( '||or||' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6623:35: '||or||'
+ {
+ MATCHS(lit_295);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_CONCURRENCY_RDV_OREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_CONCURRENCY_RDV_OREx; /* Prevent compiler warnings */
+ ruleOP_CONCURRENCY_RDV_OREx: ;
+
+}
+// $ANTLR end OP_CONCURRENCY_RDV_OR
+
+// Comes from: 6624:33: ( '||i||' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_CONCURRENCY_RDV_INTERLEAVING
+ *
+ * Looks to match the characters the constitute the token OP_CONCURRENCY_RDV_INTERLEAVING
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_CONCURRENCY_RDV_INTERLEAVING(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_CONCURRENCY_RDV_INTERLEAVING;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6624:33: ( '||i||' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6624:35: '||i||'
+ {
+ MATCHS(lit_296);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_CONCURRENCY_RDV_INTERLEAVINGEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_CONCURRENCY_RDV_INTERLEAVINGEx; /* Prevent compiler warnings */
+ ruleOP_CONCURRENCY_RDV_INTERLEAVINGEx: ;
+
+}
+// $ANTLR end OP_CONCURRENCY_RDV_INTERLEAVING
+
+// Comes from: 6625:33: ( '||,||' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_CONCURRENCY_RDV_PARALLEL
+ *
+ * Looks to match the characters the constitute the token OP_CONCURRENCY_RDV_PARALLEL
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_CONCURRENCY_RDV_PARALLEL(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_CONCURRENCY_RDV_PARALLEL;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6625:33: ( '||,||' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6625:35: '||,||'
+ {
+ MATCHS(lit_297);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_CONCURRENCY_RDV_PARALLELEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_CONCURRENCY_RDV_PARALLELEx; /* Prevent compiler warnings */
+ ruleOP_CONCURRENCY_RDV_PARALLELEx: ;
+
+}
+// $ANTLR end OP_CONCURRENCY_RDV_PARALLEL
+
+// Comes from: 6629:17: ( '=' | ':=' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start ASSIGN
+ *
+ * Looks to match the characters the constitute the token ASSIGN
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mASSIGN(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = ASSIGN;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6629:17: ( '=' | ':=' )
+
+ ANTLR3_UINT32 alt3;
+
+ alt3=2;
+
+ switch ( LA(1) )
+ {
+ case '=':
+ {
+ alt3=1;
+ }
+ break;
+ case ':':
+ {
+ alt3=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 3;
+ EXCEPTION->state = 0;
+
+
+ goto ruleASSIGNEx;
+
+ }
+
+ switch (alt3)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6629:19: '='
+ {
+ MATCHC('=');
+ if (HASEXCEPTION())
+ {
+ goto ruleASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6629:27: ':='
+ {
+ MATCHS(lit_298);
+ if (HASEXCEPTION())
+ {
+ goto ruleASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+
+ }
+ }
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleASSIGNEx; /* Prevent compiler warnings */
+ ruleASSIGNEx: ;
+
+}
+// $ANTLR end ASSIGN
+
+// Comes from: 6630:17: ( '=:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start ASSIGN_AFTER
+ *
+ * Looks to match the characters the constitute the token ASSIGN_AFTER
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mASSIGN_AFTER(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = ASSIGN_AFTER;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6630:17: ( '=:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6630:19: '=:'
+ {
+ MATCHS(lit_299);
+ if (HASEXCEPTION())
+ {
+ goto ruleASSIGN_AFTEREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleASSIGN_AFTEREx; /* Prevent compiler warnings */
+ ruleASSIGN_AFTEREx: ;
+
+}
+// $ANTLR end ASSIGN_AFTER
+
+// Comes from: 6631:17: ( '<-' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start ASSIGN_REF
+ *
+ * Looks to match the characters the constitute the token ASSIGN_REF
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mASSIGN_REF(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = ASSIGN_REF;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6631:17: ( '<-' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6631:19: '<-'
+ {
+ MATCHS(lit_300);
+ if (HASEXCEPTION())
+ {
+ goto ruleASSIGN_REFEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleASSIGN_REFEx; /* Prevent compiler warnings */
+ ruleASSIGN_REFEx: ;
+
+}
+// $ANTLR end ASSIGN_REF
+
+// Comes from: 6632:17: ( '::=' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start ASSIGN_MACRO
+ *
+ * Looks to match the characters the constitute the token ASSIGN_MACRO
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mASSIGN_MACRO(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = ASSIGN_MACRO;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6632:17: ( '::=' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6632:19: '::='
+ {
+ MATCHS(lit_301);
+ if (HASEXCEPTION())
+ {
+ goto ruleASSIGN_MACROEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleASSIGN_MACROEx; /* Prevent compiler warnings */
+ ruleASSIGN_MACROEx: ;
+
+}
+// $ANTLR end ASSIGN_MACRO
+
+// Comes from: 6634:17: ( '<=<' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_PUSH
+ *
+ * Looks to match the characters the constitute the token OP_PUSH
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_PUSH(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_PUSH;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6634:17: ( '<=<' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6634:19: '<=<'
+ {
+ MATCHS(lit_302);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_PUSHEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_PUSHEx; /* Prevent compiler warnings */
+ ruleOP_PUSHEx: ;
+
+}
+// $ANTLR end OP_PUSH
+
+// Comes from: 6635:17: ( '^=<' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_ASSIGN_TOP
+ *
+ * Looks to match the characters the constitute the token OP_ASSIGN_TOP
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_ASSIGN_TOP(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_ASSIGN_TOP;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6635:17: ( '^=<' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6635:19: '^=<'
+ {
+ MATCHS(lit_303);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_ASSIGN_TOPEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_ASSIGN_TOPEx; /* Prevent compiler warnings */
+ ruleOP_ASSIGN_TOPEx: ;
+
+}
+// $ANTLR end OP_ASSIGN_TOP
+
+// Comes from: 6636:17: ( '^=>' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_TOP
+ *
+ * Looks to match the characters the constitute the token OP_TOP
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_TOP(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_TOP;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6636:17: ( '^=>' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6636:19: '^=>'
+ {
+ MATCHS(lit_304);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_TOPEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_TOPEx; /* Prevent compiler warnings */
+ ruleOP_TOPEx: ;
+
+}
+// $ANTLR end OP_TOP
+
+// Comes from: 6637:17: ( '>=>' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OP_POP
+ *
+ * Looks to match the characters the constitute the token OP_POP
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOP_POP(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = OP_POP;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6637:17: ( '>=>' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6637:19: '>=>'
+ {
+ MATCHS(lit_305);
+ if (HASEXCEPTION())
+ {
+ goto ruleOP_POPEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleOP_POPEx; /* Prevent compiler warnings */
+ ruleOP_POPEx: ;
+
+}
+// $ANTLR end OP_POP
+
+// Comes from: 6639:17: ( '(' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start LPAREN
+ *
+ * Looks to match the characters the constitute the token LPAREN
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mLPAREN(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = LPAREN;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6639:17: ( '(' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6639:19: '('
+ {
+ MATCHC('(');
+ if (HASEXCEPTION())
+ {
+ goto ruleLPARENEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleLPARENEx; /* Prevent compiler warnings */
+ ruleLPARENEx: ;
+
+}
+// $ANTLR end LPAREN
+
+// Comes from: 6640:17: ( ')' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start RPAREN
+ *
+ * Looks to match the characters the constitute the token RPAREN
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mRPAREN(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = RPAREN;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6640:17: ( ')' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6640:19: ')'
+ {
+ MATCHC(')');
+ if (HASEXCEPTION())
+ {
+ goto ruleRPARENEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleRPARENEx; /* Prevent compiler warnings */
+ ruleRPARENEx: ;
+
+}
+// $ANTLR end RPAREN
+
+// Comes from: 6641:17: ( '{' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start LCURLY
+ *
+ * Looks to match the characters the constitute the token LCURLY
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mLCURLY(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = LCURLY;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6641:17: ( '{' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6641:19: '{'
+ {
+ MATCHC('{');
+ if (HASEXCEPTION())
+ {
+ goto ruleLCURLYEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleLCURLYEx; /* Prevent compiler warnings */
+ ruleLCURLYEx: ;
+
+}
+// $ANTLR end LCURLY
+
+// Comes from: 6642:17: ( '}' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start RCURLY
+ *
+ * Looks to match the characters the constitute the token RCURLY
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mRCURLY(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = RCURLY;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6642:17: ( '}' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6642:19: '}'
+ {
+ MATCHC('}');
+ if (HASEXCEPTION())
+ {
+ goto ruleRCURLYEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleRCURLYEx; /* Prevent compiler warnings */
+ ruleRCURLYEx: ;
+
+}
+// $ANTLR end RCURLY
+
+// Comes from: 6643:17: ( '[' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start LBRACKET
+ *
+ * Looks to match the characters the constitute the token LBRACKET
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mLBRACKET(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = LBRACKET;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6643:17: ( '[' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6643:19: '['
+ {
+ MATCHC('[');
+ if (HASEXCEPTION())
+ {
+ goto ruleLBRACKETEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleLBRACKETEx; /* Prevent compiler warnings */
+ ruleLBRACKETEx: ;
+
+}
+// $ANTLR end LBRACKET
+
+// Comes from: 6644:17: ( ']' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start RBRACKET
+ *
+ * Looks to match the characters the constitute the token RBRACKET
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mRBRACKET(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = RBRACKET;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6644:17: ( ']' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6644:19: ']'
+ {
+ MATCHC(']');
+ if (HASEXCEPTION())
+ {
+ goto ruleRBRACKETEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleRBRACKETEx; /* Prevent compiler warnings */
+ ruleRBRACKETEx: ;
+
+}
+// $ANTLR end RBRACKET
+
+// Comes from: 6646:17: ( '[^' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start LBRACKET_EXCEPT
+ *
+ * Looks to match the characters the constitute the token LBRACKET_EXCEPT
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mLBRACKET_EXCEPT(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = LBRACKET_EXCEPT;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6646:17: ( '[^' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6646:19: '[^'
+ {
+ MATCHS(lit_306);
+ if (HASEXCEPTION())
+ {
+ goto ruleLBRACKET_EXCEPTEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleLBRACKET_EXCEPTEx; /* Prevent compiler warnings */
+ ruleLBRACKET_EXCEPTEx: ;
+
+}
+// $ANTLR end LBRACKET_EXCEPT
+
+// Comes from: 6648:17: ( '(:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start LPAREN_INVOKE
+ *
+ * Looks to match the characters the constitute the token LPAREN_INVOKE
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mLPAREN_INVOKE(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = LPAREN_INVOKE;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6648:17: ( '(:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6648:19: '(:'
+ {
+ MATCHS(lit_307);
+ if (HASEXCEPTION())
+ {
+ goto ruleLPAREN_INVOKEEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleLPAREN_INVOKEEx; /* Prevent compiler warnings */
+ ruleLPAREN_INVOKEEx: ;
+
+}
+// $ANTLR end LPAREN_INVOKE
+
+// Comes from: 6649:17: ( '{:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start LCURLY_INVOKE
+ *
+ * Looks to match the characters the constitute the token LCURLY_INVOKE
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mLCURLY_INVOKE(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = LCURLY_INVOKE;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6649:17: ( '{:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6649:19: '{:'
+ {
+ MATCHS(lit_308);
+ if (HASEXCEPTION())
+ {
+ goto ruleLCURLY_INVOKEEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleLCURLY_INVOKEEx; /* Prevent compiler warnings */
+ ruleLCURLY_INVOKEEx: ;
+
+}
+// $ANTLR end LCURLY_INVOKE
+
+// Comes from: 6651:23: ( '%(:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start PERCENT_LPAREN_INVOKE
+ *
+ * Looks to match the characters the constitute the token PERCENT_LPAREN_INVOKE
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mPERCENT_LPAREN_INVOKE(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = PERCENT_LPAREN_INVOKE;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6651:23: ( '%(:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6651:25: '%(:'
+ {
+ MATCHS(lit_309);
+ if (HASEXCEPTION())
+ {
+ goto rulePERCENT_LPAREN_INVOKEEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto rulePERCENT_LPAREN_INVOKEEx; /* Prevent compiler warnings */
+ rulePERCENT_LPAREN_INVOKEEx: ;
+
+}
+// $ANTLR end PERCENT_LPAREN_INVOKE
+
+// Comes from: 6653:17: ( '%(' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start PERCENT_LPAREN
+ *
+ * Looks to match the characters the constitute the token PERCENT_LPAREN
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mPERCENT_LPAREN(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = PERCENT_LPAREN;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6653:17: ( '%(' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6653:19: '%('
+ {
+ MATCHS(lit_310);
+ if (HASEXCEPTION())
+ {
+ goto rulePERCENT_LPARENEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto rulePERCENT_LPARENEx; /* Prevent compiler warnings */
+ rulePERCENT_LPARENEx: ;
+
+}
+// $ANTLR end PERCENT_LPAREN
+
+// Comes from: 6654:17: ( ')%' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start RPAREN_PERCENT
+ *
+ * Looks to match the characters the constitute the token RPAREN_PERCENT
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mRPAREN_PERCENT(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = RPAREN_PERCENT;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6654:17: ( ')%' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6654:19: ')%'
+ {
+ MATCHS(lit_311);
+ if (HASEXCEPTION())
+ {
+ goto ruleRPAREN_PERCENTEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleRPAREN_PERCENTEx; /* Prevent compiler warnings */
+ ruleRPAREN_PERCENTEx: ;
+
+}
+// $ANTLR end RPAREN_PERCENT
+
+// Comes from: 6657:17: ( ':>' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start STATEMENT_PROMPT
+ *
+ * Looks to match the characters the constitute the token STATEMENT_PROMPT
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mSTATEMENT_PROMPT(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = STATEMENT_PROMPT;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6657:17: ( ':>' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6657:19: ':>'
+ {
+ MATCHS(lit_312);
+ if (HASEXCEPTION())
+ {
+ goto ruleSTATEMENT_PROMPTEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleSTATEMENT_PROMPTEx; /* Prevent compiler warnings */
+ ruleSTATEMENT_PROMPTEx: ;
+
+}
+// $ANTLR end STATEMENT_PROMPT
+
+// Comes from: 6659:17: ( '${' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start DOLLAR_LCURLY
+ *
+ * Looks to match the characters the constitute the token DOLLAR_LCURLY
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mDOLLAR_LCURLY(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = DOLLAR_LCURLY;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6659:17: ( '${' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6659:19: '${'
+ {
+ MATCHS(lit_313);
+ if (HASEXCEPTION())
+ {
+ goto ruleDOLLAR_LCURLYEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleDOLLAR_LCURLYEx; /* Prevent compiler warnings */
+ ruleDOLLAR_LCURLYEx: ;
+
+}
+// $ANTLR end DOLLAR_LCURLY
+
+// Comes from: 6660:17: ( '}$' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start RCURLY_DOLLAR
+ *
+ * Looks to match the characters the constitute the token RCURLY_DOLLAR
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mRCURLY_DOLLAR(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = RCURLY_DOLLAR;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6660:17: ( '}$' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6660:19: '}$'
+ {
+ MATCHS(lit_314);
+ if (HASEXCEPTION())
+ {
+ goto ruleRCURLY_DOLLAREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleRCURLY_DOLLAREx; /* Prevent compiler warnings */
+ ruleRCURLY_DOLLAREx: ;
+
+}
+// $ANTLR end RCURLY_DOLLAR
+
+// Comes from: 6662:17: ( '%{' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start PERCENT_LCURLY
+ *
+ * Looks to match the characters the constitute the token PERCENT_LCURLY
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mPERCENT_LCURLY(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = PERCENT_LCURLY;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6662:17: ( '%{' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6662:19: '%{'
+ {
+ MATCHS(lit_315);
+ if (HASEXCEPTION())
+ {
+ goto rulePERCENT_LCURLYEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto rulePERCENT_LCURLYEx; /* Prevent compiler warnings */
+ rulePERCENT_LCURLYEx: ;
+
+}
+// $ANTLR end PERCENT_LCURLY
+
+// Comes from: 6663:17: ( '}%' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start RCURLY_PERCENT
+ *
+ * Looks to match the characters the constitute the token RCURLY_PERCENT
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mRCURLY_PERCENT(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = RCURLY_PERCENT;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6663:17: ( '}%' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6663:19: '}%'
+ {
+ MATCHS(lit_316);
+ if (HASEXCEPTION())
+ {
+ goto ruleRCURLY_PERCENTEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleRCURLY_PERCENTEx; /* Prevent compiler warnings */
+ ruleRCURLY_PERCENTEx: ;
+
+}
+// $ANTLR end RCURLY_PERCENT
+
+// Comes from: 6665:17: ( '[|' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start LBRACKET_BAR
+ *
+ * Looks to match the characters the constitute the token LBRACKET_BAR
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mLBRACKET_BAR(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = LBRACKET_BAR;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6665:17: ( '[|' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6665:19: '[|'
+ {
+ MATCHS(lit_317);
+ if (HASEXCEPTION())
+ {
+ goto ruleLBRACKET_BAREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleLBRACKET_BAREx; /* Prevent compiler warnings */
+ ruleLBRACKET_BAREx: ;
+
+}
+// $ANTLR end LBRACKET_BAR
+
+// Comes from: 6666:17: ( '|]' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start BAR_RBRACKET
+ *
+ * Looks to match the characters the constitute the token BAR_RBRACKET
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mBAR_RBRACKET(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = BAR_RBRACKET;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6666:17: ( '|]' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6666:19: '|]'
+ {
+ MATCHS(lit_318);
+ if (HASEXCEPTION())
+ {
+ goto ruleBAR_RBRACKETEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleBAR_RBRACKETEx; /* Prevent compiler warnings */
+ ruleBAR_RBRACKETEx: ;
+
+}
+// $ANTLR end BAR_RBRACKET
+
+// Comes from: 6668:17: ( '[{' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start LBRACKET_LCURLY
+ *
+ * Looks to match the characters the constitute the token LBRACKET_LCURLY
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mLBRACKET_LCURLY(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = LBRACKET_LCURLY;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6668:17: ( '[{' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6668:19: '[{'
+ {
+ MATCHS(lit_319);
+ if (HASEXCEPTION())
+ {
+ goto ruleLBRACKET_LCURLYEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleLBRACKET_LCURLYEx; /* Prevent compiler warnings */
+ ruleLBRACKET_LCURLYEx: ;
+
+}
+// $ANTLR end LBRACKET_LCURLY
+
+// Comes from: 6669:17: ( '}]' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start RCURLY_RBRACKET
+ *
+ * Looks to match the characters the constitute the token RCURLY_RBRACKET
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mRCURLY_RBRACKET(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = RCURLY_RBRACKET;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6669:17: ( '}]' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6669:19: '}]'
+ {
+ MATCHS(lit_320);
+ if (HASEXCEPTION())
+ {
+ goto ruleRCURLY_RBRACKETEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleRCURLY_RBRACKETEx; /* Prevent compiler warnings */
+ ruleRCURLY_RBRACKETEx: ;
+
+}
+// $ANTLR end RCURLY_RBRACKET
+
+// Comes from: 6671:17: ( ':' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start COLON
+ *
+ * Looks to match the characters the constitute the token COLON
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mCOLON(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = COLON;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6671:17: ( ':' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6671:19: ':'
+ {
+ MATCHC(':');
+ if (HASEXCEPTION())
+ {
+ goto ruleCOLONEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleCOLONEx; /* Prevent compiler warnings */
+ ruleCOLONEx: ;
+
+}
+// $ANTLR end COLON
+
+// Comes from: 6672:17: ( ',' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start COMMA
+ *
+ * Looks to match the characters the constitute the token COMMA
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mCOMMA(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = COMMA;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6672:17: ( ',' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6672:19: ','
+ {
+ MATCHC(',');
+ if (HASEXCEPTION())
+ {
+ goto ruleCOMMAEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleCOMMAEx; /* Prevent compiler warnings */
+ ruleCOMMAEx: ;
+
+}
+// $ANTLR end COMMA
+
+// Comes from: 6673:17: ( '?' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start QUESTION
+ *
+ * Looks to match the characters the constitute the token QUESTION
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mQUESTION(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = QUESTION;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6673:17: ( '?' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6673:19: '?'
+ {
+ MATCHC('?');
+ if (HASEXCEPTION())
+ {
+ goto ruleQUESTIONEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleQUESTIONEx; /* Prevent compiler warnings */
+ ruleQUESTIONEx: ;
+
+}
+// $ANTLR end QUESTION
+
+// Comes from: 6674:17: ( ';' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start SEMI
+ *
+ * Looks to match the characters the constitute the token SEMI
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mSEMI(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = SEMI;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6674:17: ( ';' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6674:19: ';'
+ {
+ MATCHC(';');
+ if (HASEXCEPTION())
+ {
+ goto ruleSEMIEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleSEMIEx; /* Prevent compiler warnings */
+ ruleSEMIEx: ;
+
+}
+// $ANTLR end SEMI
+
+// Comes from: 6676:17: ( '#' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start DIESE
+ *
+ * Looks to match the characters the constitute the token DIESE
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mDIESE(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = DIESE;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6676:17: ( '#' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6676:19: '#'
+ {
+ MATCHC('#');
+ if (HASEXCEPTION())
+ {
+ goto ruleDIESEEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleDIESEEx; /* Prevent compiler warnings */
+ ruleDIESEEx: ;
+
+}
+// $ANTLR end DIESE
+
+// Comes from: 6677:17: ( '$' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start DOLLAR
+ *
+ * Looks to match the characters the constitute the token DOLLAR
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mDOLLAR(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = DOLLAR;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6677:17: ( '$' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6677:19: '$'
+ {
+ MATCHC('$');
+ if (HASEXCEPTION())
+ {
+ goto ruleDOLLAREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleDOLLAREx; /* Prevent compiler warnings */
+ ruleDOLLAREx: ;
+
+}
+// $ANTLR end DOLLAR
+
+// Comes from: 6679:17: ( '.' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start DOT
+ *
+ * Looks to match the characters the constitute the token DOT
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mDOT(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = DOT;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6679:17: ( '.' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6679:19: '.'
+ {
+ MATCHC('.');
+ if (HASEXCEPTION())
+ {
+ goto ruleDOTEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleDOTEx; /* Prevent compiler warnings */
+ ruleDOTEx: ;
+
+}
+// $ANTLR end DOT
+
+// Comes from: 6680:17: ( '..' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start DOTDOT
+ *
+ * Looks to match the characters the constitute the token DOTDOT
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mDOTDOT(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = DOTDOT;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6680:17: ( '..' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6680:19: '..'
+ {
+ MATCHS(lit_321);
+ if (HASEXCEPTION())
+ {
+ goto ruleDOTDOTEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleDOTDOTEx; /* Prevent compiler warnings */
+ ruleDOTDOTEx: ;
+
+}
+// $ANTLR end DOTDOT
+
+// Comes from: 6681:17: ( '::' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start COLONx2
+ *
+ * Looks to match the characters the constitute the token COLONx2
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mCOLONx2(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = COLONx2;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6681:17: ( '::' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6681:19: '::'
+ {
+ MATCHS(lit_322);
+ if (HASEXCEPTION())
+ {
+ goto ruleCOLONx2Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleCOLONx2Ex; /* Prevent compiler warnings */
+ ruleCOLONx2Ex: ;
+
+}
+// $ANTLR end COLONx2
+
+// Comes from: 6684:21: ( '&&' | 'and' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start LAND
+ *
+ * Looks to match the characters the constitute the token LAND
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mLAND(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = LAND;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6684:21: ( '&&' | 'and' )
+
+ ANTLR3_UINT32 alt4;
+
+ alt4=2;
+
+ switch ( LA(1) )
+ {
+ case '&':
+ {
+ alt4=1;
+ }
+ break;
+ case 'a':
+ {
+ alt4=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 4;
+ EXCEPTION->state = 0;
+
+
+ goto ruleLANDEx;
+
+ }
+
+ switch (alt4)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6684:23: '&&'
+ {
+ MATCHS(lit_323);
+ if (HASEXCEPTION())
+ {
+ goto ruleLANDEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6684:31: 'and'
+ {
+ MATCHS(lit_95);
+ if (HASEXCEPTION())
+ {
+ goto ruleLANDEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+
+ }
+ }
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleLANDEx; /* Prevent compiler warnings */
+ ruleLANDEx: ;
+
+}
+// $ANTLR end LAND
+
+// Comes from: 6685:21: ( 'and#then' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start LAND_THEN
+ *
+ * Looks to match the characters the constitute the token LAND_THEN
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mLAND_THEN(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = LAND_THEN;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6685:21: ( 'and#then' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6685:23: 'and#then'
+ {
+ MATCHS(lit_324);
+ if (HASEXCEPTION())
+ {
+ goto ruleLAND_THENEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleLAND_THENEx; /* Prevent compiler warnings */
+ ruleLAND_THENEx: ;
+
+}
+// $ANTLR end LAND_THEN
+
+// Comes from: 6686:21: ( '&&=' | '&&:=' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start LAND_ASSIGN
+ *
+ * Looks to match the characters the constitute the token LAND_ASSIGN
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mLAND_ASSIGN(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = LAND_ASSIGN;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6686:21: ( '&&=' | '&&:=' )
+
+ ANTLR3_UINT32 alt5;
+
+ alt5=2;
+
+ switch ( LA(1) )
+ {
+ case '&':
+ {
+ switch ( LA(2) )
+ {
+ case '&':
+ {
+ switch ( LA(3) )
+ {
+ case '=':
+ {
+ alt5=1;
+ }
+ break;
+ case ':':
+ {
+ alt5=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 5;
+ EXCEPTION->state = 2;
+
+
+ goto ruleLAND_ASSIGNEx;
+
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 5;
+ EXCEPTION->state = 1;
+
+
+ goto ruleLAND_ASSIGNEx;
+
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 5;
+ EXCEPTION->state = 0;
+
+
+ goto ruleLAND_ASSIGNEx;
+
+ }
+
+ switch (alt5)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6686:23: '&&='
+ {
+ MATCHS(lit_325);
+ if (HASEXCEPTION())
+ {
+ goto ruleLAND_ASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6686:31: '&&:='
+ {
+ MATCHS(lit_326);
+ if (HASEXCEPTION())
+ {
+ goto ruleLAND_ASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+
+ }
+ }
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleLAND_ASSIGNEx; /* Prevent compiler warnings */
+ ruleLAND_ASSIGNEx: ;
+
+}
+// $ANTLR end LAND_ASSIGN
+
+// Comes from: 6687:21: ( '&&=:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start LAND_ASSIGN_AFTER
+ *
+ * Looks to match the characters the constitute the token LAND_ASSIGN_AFTER
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mLAND_ASSIGN_AFTER(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = LAND_ASSIGN_AFTER;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6687:21: ( '&&=:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6687:23: '&&=:'
+ {
+ MATCHS(lit_327);
+ if (HASEXCEPTION())
+ {
+ goto ruleLAND_ASSIGN_AFTEREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleLAND_ASSIGN_AFTEREx; /* Prevent compiler warnings */
+ ruleLAND_ASSIGN_AFTEREx: ;
+
+}
+// $ANTLR end LAND_ASSIGN_AFTER
+
+// Comes from: 6689:21: ( '!' | 'not' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start LNOT
+ *
+ * Looks to match the characters the constitute the token LNOT
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mLNOT(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = LNOT;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6689:21: ( '!' | 'not' )
+
+ ANTLR3_UINT32 alt6;
+
+ alt6=2;
+
+ switch ( LA(1) )
+ {
+ case '!':
+ {
+ alt6=1;
+ }
+ break;
+ case 'n':
+ {
+ alt6=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 6;
+ EXCEPTION->state = 0;
+
+
+ goto ruleLNOTEx;
+
+ }
+
+ switch (alt6)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6689:23: '!'
+ {
+ MATCHC('!');
+ if (HASEXCEPTION())
+ {
+ goto ruleLNOTEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6689:31: 'not'
+ {
+ MATCHS(lit_328);
+ if (HASEXCEPTION())
+ {
+ goto ruleLNOTEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+
+ }
+ }
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleLNOTEx; /* Prevent compiler warnings */
+ ruleLNOTEx: ;
+
+}
+// $ANTLR end LNOT
+
+// Comes from: 6691:21: ( '||' | 'or' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start LOR
+ *
+ * Looks to match the characters the constitute the token LOR
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mLOR(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = LOR;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6691:21: ( '||' | 'or' )
+
+ ANTLR3_UINT32 alt7;
+
+ alt7=2;
+
+ switch ( LA(1) )
+ {
+ case '|':
+ {
+ alt7=1;
+ }
+ break;
+ case 'o':
+ {
+ alt7=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 7;
+ EXCEPTION->state = 0;
+
+
+ goto ruleLOREx;
+
+ }
+
+ switch (alt7)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6691:23: '||'
+ {
+ MATCHS(lit_329);
+ if (HASEXCEPTION())
+ {
+ goto ruleLOREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6691:31: 'or'
+ {
+ MATCHS(lit_190);
+ if (HASEXCEPTION())
+ {
+ goto ruleLOREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+
+ }
+ }
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleLOREx; /* Prevent compiler warnings */
+ ruleLOREx: ;
+
+}
+// $ANTLR end LOR
+
+// Comes from: 6692:21: ( 'or#else' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start LOR_ELSE
+ *
+ * Looks to match the characters the constitute the token LOR_ELSE
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mLOR_ELSE(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = LOR_ELSE;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6692:21: ( 'or#else' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6692:23: 'or#else'
+ {
+ MATCHS(lit_330);
+ if (HASEXCEPTION())
+ {
+ goto ruleLOR_ELSEEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleLOR_ELSEEx; /* Prevent compiler warnings */
+ ruleLOR_ELSEEx: ;
+
+}
+// $ANTLR end LOR_ELSE
+
+// Comes from: 6693:21: ( '||=' | '||:=' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start LOR_ASSIGN
+ *
+ * Looks to match the characters the constitute the token LOR_ASSIGN
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mLOR_ASSIGN(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = LOR_ASSIGN;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6693:21: ( '||=' | '||:=' )
+
+ ANTLR3_UINT32 alt8;
+
+ alt8=2;
+
+ switch ( LA(1) )
+ {
+ case '|':
+ {
+ switch ( LA(2) )
+ {
+ case '|':
+ {
+ switch ( LA(3) )
+ {
+ case '=':
+ {
+ alt8=1;
+ }
+ break;
+ case ':':
+ {
+ alt8=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 8;
+ EXCEPTION->state = 2;
+
+
+ goto ruleLOR_ASSIGNEx;
+
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 8;
+ EXCEPTION->state = 1;
+
+
+ goto ruleLOR_ASSIGNEx;
+
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 8;
+ EXCEPTION->state = 0;
+
+
+ goto ruleLOR_ASSIGNEx;
+
+ }
+
+ switch (alt8)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6693:23: '||='
+ {
+ MATCHS(lit_331);
+ if (HASEXCEPTION())
+ {
+ goto ruleLOR_ASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6693:31: '||:='
+ {
+ MATCHS(lit_332);
+ if (HASEXCEPTION())
+ {
+ goto ruleLOR_ASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+
+ }
+ }
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleLOR_ASSIGNEx; /* Prevent compiler warnings */
+ ruleLOR_ASSIGNEx: ;
+
+}
+// $ANTLR end LOR_ASSIGN
+
+// Comes from: 6694:21: ( '||=:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start LOR_ASSIGN_AFTER
+ *
+ * Looks to match the characters the constitute the token LOR_ASSIGN_AFTER
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mLOR_ASSIGN_AFTER(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = LOR_ASSIGN_AFTER;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6694:21: ( '||=:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6694:23: '||=:'
+ {
+ MATCHS(lit_333);
+ if (HASEXCEPTION())
+ {
+ goto ruleLOR_ASSIGN_AFTEREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleLOR_ASSIGN_AFTEREx; /* Prevent compiler warnings */
+ ruleLOR_ASSIGN_AFTEREx: ;
+
+}
+// $ANTLR end LOR_ASSIGN_AFTER
+
+// Comes from: 6695:21: ( 'xor' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start LXOR
+ *
+ * Looks to match the characters the constitute the token LXOR
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mLXOR(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = LXOR;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6695:21: ( 'xor' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6695:23: 'xor'
+ {
+ MATCHS(lit_334);
+ if (HASEXCEPTION())
+ {
+ goto ruleLXOREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleLXOREx; /* Prevent compiler warnings */
+ ruleLXOREx: ;
+
+}
+// $ANTLR end LXOR
+
+// Comes from: 6697:21: ( '==' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start EQUAL
+ *
+ * Looks to match the characters the constitute the token EQUAL
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mEQUAL(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = EQUAL;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6697:21: ( '==' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6697:23: '=='
+ {
+ MATCHS(lit_335);
+ if (HASEXCEPTION())
+ {
+ goto ruleEQUALEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleEQUALEx; /* Prevent compiler warnings */
+ ruleEQUALEx: ;
+
+}
+// $ANTLR end EQUAL
+
+// Comes from: 6698:21: ( '!=' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start NEQUAL
+ *
+ * Looks to match the characters the constitute the token NEQUAL
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mNEQUAL(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = NEQUAL;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6698:21: ( '!=' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6698:23: '!='
+ {
+ MATCHS(lit_336);
+ if (HASEXCEPTION())
+ {
+ goto ruleNEQUALEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleNEQUALEx; /* Prevent compiler warnings */
+ ruleNEQUALEx: ;
+
+}
+// $ANTLR end NEQUAL
+
+// Comes from: 6700:21: ( '===' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start SEQUAL
+ *
+ * Looks to match the characters the constitute the token SEQUAL
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mSEQUAL(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = SEQUAL;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6700:21: ( '===' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6700:23: '==='
+ {
+ MATCHS(lit_337);
+ if (HASEXCEPTION())
+ {
+ goto ruleSEQUALEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleSEQUALEx; /* Prevent compiler warnings */
+ ruleSEQUALEx: ;
+
+}
+// $ANTLR end SEQUAL
+
+// Comes from: 6701:21: ( '=!=' | '=/=' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start NSEQUAL
+ *
+ * Looks to match the characters the constitute the token NSEQUAL
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mNSEQUAL(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = NSEQUAL;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6701:21: ( '=!=' | '=/=' )
+
+ ANTLR3_UINT32 alt9;
+
+ alt9=2;
+
+ switch ( LA(1) )
+ {
+ case '=':
+ {
+ switch ( LA(2) )
+ {
+ case '!':
+ {
+ alt9=1;
+ }
+ break;
+ case '/':
+ {
+ alt9=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 9;
+ EXCEPTION->state = 1;
+
+
+ goto ruleNSEQUALEx;
+
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 9;
+ EXCEPTION->state = 0;
+
+
+ goto ruleNSEQUALEx;
+
+ }
+
+ switch (alt9)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6701:23: '=!='
+ {
+ MATCHS(lit_338);
+ if (HASEXCEPTION())
+ {
+ goto ruleNSEQUALEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6701:31: '=/='
+ {
+ MATCHS(lit_339);
+ if (HASEXCEPTION())
+ {
+ goto ruleNSEQUALEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+
+ }
+ }
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleNSEQUALEx; /* Prevent compiler warnings */
+ ruleNSEQUALEx: ;
+
+}
+// $ANTLR end NSEQUAL
+
+// Comes from: 6703:21: ( '<=' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start LTE
+ *
+ * Looks to match the characters the constitute the token LTE
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mLTE(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = LTE;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6703:21: ( '<=' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6703:23: '<='
+ {
+ MATCHS(lit_340);
+ if (HASEXCEPTION())
+ {
+ goto ruleLTEEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleLTEEx; /* Prevent compiler warnings */
+ ruleLTEEx: ;
+
+}
+// $ANTLR end LTE
+
+// Comes from: 6704:21: ( '<' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start LT_
+ *
+ * Looks to match the characters the constitute the token LT_
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mLT_(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = LT_;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6704:21: ( '<' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6704:23: '<'
+ {
+ MATCHC('<');
+ if (HASEXCEPTION())
+ {
+ goto ruleLT_Ex;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleLT_Ex; /* Prevent compiler warnings */
+ ruleLT_Ex: ;
+
+}
+// $ANTLR end LT_
+
+// Comes from: 6705:21: ( '>=' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start GTE
+ *
+ * Looks to match the characters the constitute the token GTE
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mGTE(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = GTE;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6705:21: ( '>=' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6705:23: '>='
+ {
+ MATCHS(lit_341);
+ if (HASEXCEPTION())
+ {
+ goto ruleGTEEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleGTEEx; /* Prevent compiler warnings */
+ ruleGTEEx: ;
+
+}
+// $ANTLR end GTE
+
+// Comes from: 6706:21: ( '>' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start GT
+ *
+ * Looks to match the characters the constitute the token GT
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mGT(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = GT;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6706:21: ( '>' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6706:23: '>'
+ {
+ MATCHC('>');
+ if (HASEXCEPTION())
+ {
+ goto ruleGTEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleGTEx; /* Prevent compiler warnings */
+ ruleGTEx: ;
+
+}
+// $ANTLR end GT
+
+// Comes from: 6709:21: ( '+' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start PLUS
+ *
+ * Looks to match the characters the constitute the token PLUS
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mPLUS(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = PLUS;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6709:21: ( '+' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6709:23: '+'
+ {
+ MATCHC('+');
+ if (HASEXCEPTION())
+ {
+ goto rulePLUSEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto rulePLUSEx; /* Prevent compiler warnings */
+ rulePLUSEx: ;
+
+}
+// $ANTLR end PLUS
+
+// Comes from: 6710:21: ( '+=' | '+:=' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start PLUS_ASSIGN
+ *
+ * Looks to match the characters the constitute the token PLUS_ASSIGN
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mPLUS_ASSIGN(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = PLUS_ASSIGN;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6710:21: ( '+=' | '+:=' )
+
+ ANTLR3_UINT32 alt10;
+
+ alt10=2;
+
+ switch ( LA(1) )
+ {
+ case '+':
+ {
+ switch ( LA(2) )
+ {
+ case '=':
+ {
+ alt10=1;
+ }
+ break;
+ case ':':
+ {
+ alt10=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 10;
+ EXCEPTION->state = 1;
+
+
+ goto rulePLUS_ASSIGNEx;
+
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 10;
+ EXCEPTION->state = 0;
+
+
+ goto rulePLUS_ASSIGNEx;
+
+ }
+
+ switch (alt10)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6710:23: '+='
+ {
+ MATCHS(lit_342);
+ if (HASEXCEPTION())
+ {
+ goto rulePLUS_ASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6710:31: '+:='
+ {
+ MATCHS(lit_343);
+ if (HASEXCEPTION())
+ {
+ goto rulePLUS_ASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+
+ }
+ }
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto rulePLUS_ASSIGNEx; /* Prevent compiler warnings */
+ rulePLUS_ASSIGNEx: ;
+
+}
+// $ANTLR end PLUS_ASSIGN
+
+// Comes from: 6711:21: ( '+=:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start PLUS_ASSIGN_AFTER
+ *
+ * Looks to match the characters the constitute the token PLUS_ASSIGN_AFTER
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mPLUS_ASSIGN_AFTER(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = PLUS_ASSIGN_AFTER;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6711:21: ( '+=:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6711:23: '+=:'
+ {
+ MATCHS(lit_344);
+ if (HASEXCEPTION())
+ {
+ goto rulePLUS_ASSIGN_AFTEREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto rulePLUS_ASSIGN_AFTEREx; /* Prevent compiler warnings */
+ rulePLUS_ASSIGN_AFTEREx: ;
+
+}
+// $ANTLR end PLUS_ASSIGN_AFTER
+
+// Comes from: 6712:21: ( '++' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start INCR
+ *
+ * Looks to match the characters the constitute the token INCR
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mINCR(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = INCR;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6712:21: ( '++' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6712:23: '++'
+ {
+ MATCHS(lit_345);
+ if (HASEXCEPTION())
+ {
+ goto ruleINCREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleINCREx; /* Prevent compiler warnings */
+ ruleINCREx: ;
+
+}
+// $ANTLR end INCR
+
+// Comes from: 6714:21: ( '-' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start MINUS
+ *
+ * Looks to match the characters the constitute the token MINUS
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mMINUS(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = MINUS;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6714:21: ( '-' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6714:23: '-'
+ {
+ MATCHC('-');
+ if (HASEXCEPTION())
+ {
+ goto ruleMINUSEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleMINUSEx; /* Prevent compiler warnings */
+ ruleMINUSEx: ;
+
+}
+// $ANTLR end MINUS
+
+// Comes from: 6715:21: ( '-=' | '-:=' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start MINUS_ASSIGN
+ *
+ * Looks to match the characters the constitute the token MINUS_ASSIGN
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mMINUS_ASSIGN(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = MINUS_ASSIGN;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6715:21: ( '-=' | '-:=' )
+
+ ANTLR3_UINT32 alt11;
+
+ alt11=2;
+
+ switch ( LA(1) )
+ {
+ case '-':
+ {
+ switch ( LA(2) )
+ {
+ case '=':
+ {
+ alt11=1;
+ }
+ break;
+ case ':':
+ {
+ alt11=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 11;
+ EXCEPTION->state = 1;
+
+
+ goto ruleMINUS_ASSIGNEx;
+
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 11;
+ EXCEPTION->state = 0;
+
+
+ goto ruleMINUS_ASSIGNEx;
+
+ }
+
+ switch (alt11)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6715:23: '-='
+ {
+ MATCHS(lit_346);
+ if (HASEXCEPTION())
+ {
+ goto ruleMINUS_ASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6715:31: '-:='
+ {
+ MATCHS(lit_347);
+ if (HASEXCEPTION())
+ {
+ goto ruleMINUS_ASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+
+ }
+ }
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleMINUS_ASSIGNEx; /* Prevent compiler warnings */
+ ruleMINUS_ASSIGNEx: ;
+
+}
+// $ANTLR end MINUS_ASSIGN
+
+// Comes from: 6716:21: ( '-=:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start MINUS_ASSIGN_AFTER
+ *
+ * Looks to match the characters the constitute the token MINUS_ASSIGN_AFTER
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mMINUS_ASSIGN_AFTER(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = MINUS_ASSIGN_AFTER;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6716:21: ( '-=:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6716:23: '-=:'
+ {
+ MATCHS(lit_348);
+ if (HASEXCEPTION())
+ {
+ goto ruleMINUS_ASSIGN_AFTEREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleMINUS_ASSIGN_AFTEREx; /* Prevent compiler warnings */
+ ruleMINUS_ASSIGN_AFTEREx: ;
+
+}
+// $ANTLR end MINUS_ASSIGN_AFTER
+
+// Comes from: 6717:21: ( '--' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start DECR
+ *
+ * Looks to match the characters the constitute the token DECR
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mDECR(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = DECR;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6717:21: ( '--' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6717:23: '--'
+ {
+ MATCHS(lit_349);
+ if (HASEXCEPTION())
+ {
+ goto ruleDECREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleDECREx; /* Prevent compiler warnings */
+ ruleDECREx: ;
+
+}
+// $ANTLR end DECR
+
+// Comes from: 6719:21: ( '*' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start STAR
+ *
+ * Looks to match the characters the constitute the token STAR
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mSTAR(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = STAR;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6719:21: ( '*' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6719:23: '*'
+ {
+ MATCHC('*');
+ if (HASEXCEPTION())
+ {
+ goto ruleSTAREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleSTAREx; /* Prevent compiler warnings */
+ ruleSTAREx: ;
+
+}
+// $ANTLR end STAR
+
+// Comes from: 6720:21: ( '*=' | '*:=' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start STAR_ASSIGN
+ *
+ * Looks to match the characters the constitute the token STAR_ASSIGN
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mSTAR_ASSIGN(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = STAR_ASSIGN;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6720:21: ( '*=' | '*:=' )
+
+ ANTLR3_UINT32 alt12;
+
+ alt12=2;
+
+ switch ( LA(1) )
+ {
+ case '*':
+ {
+ switch ( LA(2) )
+ {
+ case '=':
+ {
+ alt12=1;
+ }
+ break;
+ case ':':
+ {
+ alt12=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 12;
+ EXCEPTION->state = 1;
+
+
+ goto ruleSTAR_ASSIGNEx;
+
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 12;
+ EXCEPTION->state = 0;
+
+
+ goto ruleSTAR_ASSIGNEx;
+
+ }
+
+ switch (alt12)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6720:23: '*='
+ {
+ MATCHS(lit_350);
+ if (HASEXCEPTION())
+ {
+ goto ruleSTAR_ASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6720:31: '*:='
+ {
+ MATCHS(lit_351);
+ if (HASEXCEPTION())
+ {
+ goto ruleSTAR_ASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+
+ }
+ }
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleSTAR_ASSIGNEx; /* Prevent compiler warnings */
+ ruleSTAR_ASSIGNEx: ;
+
+}
+// $ANTLR end STAR_ASSIGN
+
+// Comes from: 6721:21: ( '*=:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start STAR_ASSIGN_AFTER
+ *
+ * Looks to match the characters the constitute the token STAR_ASSIGN_AFTER
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mSTAR_ASSIGN_AFTER(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = STAR_ASSIGN_AFTER;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6721:21: ( '*=:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6721:23: '*=:'
+ {
+ MATCHS(lit_352);
+ if (HASEXCEPTION())
+ {
+ goto ruleSTAR_ASSIGN_AFTEREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleSTAR_ASSIGN_AFTEREx; /* Prevent compiler warnings */
+ ruleSTAR_ASSIGN_AFTEREx: ;
+
+}
+// $ANTLR end STAR_ASSIGN_AFTER
+
+// Comes from: 6722:21: ( '/' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start DIV
+ *
+ * Looks to match the characters the constitute the token DIV
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mDIV(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = DIV;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6722:21: ( '/' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6722:23: '/'
+ {
+ MATCHC('/');
+ if (HASEXCEPTION())
+ {
+ goto ruleDIVEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleDIVEx; /* Prevent compiler warnings */
+ ruleDIVEx: ;
+
+}
+// $ANTLR end DIV
+
+// Comes from: 6723:21: ( '/=' | '/:=' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start DIV_ASSIGN
+ *
+ * Looks to match the characters the constitute the token DIV_ASSIGN
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mDIV_ASSIGN(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = DIV_ASSIGN;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6723:21: ( '/=' | '/:=' )
+
+ ANTLR3_UINT32 alt13;
+
+ alt13=2;
+
+ switch ( LA(1) )
+ {
+ case '/':
+ {
+ switch ( LA(2) )
+ {
+ case '=':
+ {
+ alt13=1;
+ }
+ break;
+ case ':':
+ {
+ alt13=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 13;
+ EXCEPTION->state = 1;
+
+
+ goto ruleDIV_ASSIGNEx;
+
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 13;
+ EXCEPTION->state = 0;
+
+
+ goto ruleDIV_ASSIGNEx;
+
+ }
+
+ switch (alt13)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6723:23: '/='
+ {
+ MATCHS(lit_353);
+ if (HASEXCEPTION())
+ {
+ goto ruleDIV_ASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6723:31: '/:='
+ {
+ MATCHS(lit_354);
+ if (HASEXCEPTION())
+ {
+ goto ruleDIV_ASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+
+ }
+ }
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleDIV_ASSIGNEx; /* Prevent compiler warnings */
+ ruleDIV_ASSIGNEx: ;
+
+}
+// $ANTLR end DIV_ASSIGN
+
+// Comes from: 6724:21: ( '/=:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start DIV_ASSIGN_AFTER
+ *
+ * Looks to match the characters the constitute the token DIV_ASSIGN_AFTER
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mDIV_ASSIGN_AFTER(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = DIV_ASSIGN_AFTER;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6724:21: ( '/=:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6724:23: '/=:'
+ {
+ MATCHS(lit_355);
+ if (HASEXCEPTION())
+ {
+ goto ruleDIV_ASSIGN_AFTEREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleDIV_ASSIGN_AFTEREx; /* Prevent compiler warnings */
+ ruleDIV_ASSIGN_AFTEREx: ;
+
+}
+// $ANTLR end DIV_ASSIGN_AFTER
+
+// Comes from: 6725:21: ( '%' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start MOD
+ *
+ * Looks to match the characters the constitute the token MOD
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mMOD(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = MOD;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6725:21: ( '%' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6725:23: '%'
+ {
+ MATCHC('%');
+ if (HASEXCEPTION())
+ {
+ goto ruleMODEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleMODEx; /* Prevent compiler warnings */
+ ruleMODEx: ;
+
+}
+// $ANTLR end MOD
+
+// Comes from: 6726:21: ( '%=' | '%:=' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start MOD_ASSIGN
+ *
+ * Looks to match the characters the constitute the token MOD_ASSIGN
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mMOD_ASSIGN(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = MOD_ASSIGN;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6726:21: ( '%=' | '%:=' )
+
+ ANTLR3_UINT32 alt14;
+
+ alt14=2;
+
+ switch ( LA(1) )
+ {
+ case '%':
+ {
+ switch ( LA(2) )
+ {
+ case '=':
+ {
+ alt14=1;
+ }
+ break;
+ case ':':
+ {
+ alt14=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 14;
+ EXCEPTION->state = 1;
+
+
+ goto ruleMOD_ASSIGNEx;
+
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 14;
+ EXCEPTION->state = 0;
+
+
+ goto ruleMOD_ASSIGNEx;
+
+ }
+
+ switch (alt14)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6726:23: '%='
+ {
+ MATCHS(lit_356);
+ if (HASEXCEPTION())
+ {
+ goto ruleMOD_ASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6726:31: '%:='
+ {
+ MATCHS(lit_357);
+ if (HASEXCEPTION())
+ {
+ goto ruleMOD_ASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+
+ }
+ }
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleMOD_ASSIGNEx; /* Prevent compiler warnings */
+ ruleMOD_ASSIGNEx: ;
+
+}
+// $ANTLR end MOD_ASSIGN
+
+// Comes from: 6727:21: ( '%=:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start MOD_ASSIGN_AFTER
+ *
+ * Looks to match the characters the constitute the token MOD_ASSIGN_AFTER
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mMOD_ASSIGN_AFTER(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = MOD_ASSIGN_AFTER;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6727:21: ( '%=:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6727:23: '%=:'
+ {
+ MATCHS(lit_358);
+ if (HASEXCEPTION())
+ {
+ goto ruleMOD_ASSIGN_AFTEREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleMOD_ASSIGN_AFTEREx; /* Prevent compiler warnings */
+ ruleMOD_ASSIGN_AFTEREx: ;
+
+}
+// $ANTLR end MOD_ASSIGN_AFTER
+
+// Comes from: 6731:21: ( '>>' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start RSHIFT
+ *
+ * Looks to match the characters the constitute the token RSHIFT
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mRSHIFT(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = RSHIFT;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6731:21: ( '>>' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6731:23: '>>'
+ {
+ MATCHS(lit_359);
+ if (HASEXCEPTION())
+ {
+ goto ruleRSHIFTEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleRSHIFTEx; /* Prevent compiler warnings */
+ ruleRSHIFTEx: ;
+
+}
+// $ANTLR end RSHIFT
+
+// Comes from: 6732:21: ( '>>=' | '>>:=' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start RSHIFT_ASSIGN
+ *
+ * Looks to match the characters the constitute the token RSHIFT_ASSIGN
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mRSHIFT_ASSIGN(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = RSHIFT_ASSIGN;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6732:21: ( '>>=' | '>>:=' )
+
+ ANTLR3_UINT32 alt15;
+
+ alt15=2;
+
+ switch ( LA(1) )
+ {
+ case '>':
+ {
+ switch ( LA(2) )
+ {
+ case '>':
+ {
+ switch ( LA(3) )
+ {
+ case '=':
+ {
+ alt15=1;
+ }
+ break;
+ case ':':
+ {
+ alt15=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 15;
+ EXCEPTION->state = 2;
+
+
+ goto ruleRSHIFT_ASSIGNEx;
+
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 15;
+ EXCEPTION->state = 1;
+
+
+ goto ruleRSHIFT_ASSIGNEx;
+
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 15;
+ EXCEPTION->state = 0;
+
+
+ goto ruleRSHIFT_ASSIGNEx;
+
+ }
+
+ switch (alt15)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6732:23: '>>='
+ {
+ MATCHS(lit_360);
+ if (HASEXCEPTION())
+ {
+ goto ruleRSHIFT_ASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6732:31: '>>:='
+ {
+ MATCHS(lit_361);
+ if (HASEXCEPTION())
+ {
+ goto ruleRSHIFT_ASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+
+ }
+ }
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleRSHIFT_ASSIGNEx; /* Prevent compiler warnings */
+ ruleRSHIFT_ASSIGNEx: ;
+
+}
+// $ANTLR end RSHIFT_ASSIGN
+
+// Comes from: 6733:21: ( '>>=:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start RSHIFT_ASSIGN_AFTER
+ *
+ * Looks to match the characters the constitute the token RSHIFT_ASSIGN_AFTER
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mRSHIFT_ASSIGN_AFTER(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = RSHIFT_ASSIGN_AFTER;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6733:21: ( '>>=:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6733:23: '>>=:'
+ {
+ MATCHS(lit_362);
+ if (HASEXCEPTION())
+ {
+ goto ruleRSHIFT_ASSIGN_AFTEREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleRSHIFT_ASSIGN_AFTEREx; /* Prevent compiler warnings */
+ ruleRSHIFT_ASSIGN_AFTEREx: ;
+
+}
+// $ANTLR end RSHIFT_ASSIGN_AFTER
+
+// Comes from: 6734:21: ( '<<' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start LSHIFT
+ *
+ * Looks to match the characters the constitute the token LSHIFT
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mLSHIFT(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = LSHIFT;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6734:21: ( '<<' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6734:23: '<<'
+ {
+ MATCHS(lit_363);
+ if (HASEXCEPTION())
+ {
+ goto ruleLSHIFTEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleLSHIFTEx; /* Prevent compiler warnings */
+ ruleLSHIFTEx: ;
+
+}
+// $ANTLR end LSHIFT
+
+// Comes from: 6735:21: ( '<<=' | '<<:=' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start LSHIFT_ASSIGN
+ *
+ * Looks to match the characters the constitute the token LSHIFT_ASSIGN
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mLSHIFT_ASSIGN(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = LSHIFT_ASSIGN;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6735:21: ( '<<=' | '<<:=' )
+
+ ANTLR3_UINT32 alt16;
+
+ alt16=2;
+
+ switch ( LA(1) )
+ {
+ case '<':
+ {
+ switch ( LA(2) )
+ {
+ case '<':
+ {
+ switch ( LA(3) )
+ {
+ case '=':
+ {
+ alt16=1;
+ }
+ break;
+ case ':':
+ {
+ alt16=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 16;
+ EXCEPTION->state = 2;
+
+
+ goto ruleLSHIFT_ASSIGNEx;
+
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 16;
+ EXCEPTION->state = 1;
+
+
+ goto ruleLSHIFT_ASSIGNEx;
+
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 16;
+ EXCEPTION->state = 0;
+
+
+ goto ruleLSHIFT_ASSIGNEx;
+
+ }
+
+ switch (alt16)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6735:23: '<<='
+ {
+ MATCHS(lit_364);
+ if (HASEXCEPTION())
+ {
+ goto ruleLSHIFT_ASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6735:31: '<<:='
+ {
+ MATCHS(lit_365);
+ if (HASEXCEPTION())
+ {
+ goto ruleLSHIFT_ASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+
+ }
+ }
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleLSHIFT_ASSIGNEx; /* Prevent compiler warnings */
+ ruleLSHIFT_ASSIGNEx: ;
+
+}
+// $ANTLR end LSHIFT_ASSIGN
+
+// Comes from: 6736:21: ( '<<=:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start LSHIFT_ASSIGN_AFTER
+ *
+ * Looks to match the characters the constitute the token LSHIFT_ASSIGN_AFTER
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mLSHIFT_ASSIGN_AFTER(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = LSHIFT_ASSIGN_AFTER;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6736:21: ( '<<=:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6736:23: '<<=:'
+ {
+ MATCHS(lit_366);
+ if (HASEXCEPTION())
+ {
+ goto ruleLSHIFT_ASSIGN_AFTEREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleLSHIFT_ASSIGN_AFTEREx; /* Prevent compiler warnings */
+ ruleLSHIFT_ASSIGN_AFTEREx: ;
+
+}
+// $ANTLR end LSHIFT_ASSIGN_AFTER
+
+// Comes from: 6738:21: ( '&' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start BAND
+ *
+ * Looks to match the characters the constitute the token BAND
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mBAND(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = BAND;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6738:21: ( '&' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6738:23: '&'
+ {
+ MATCHC('&');
+ if (HASEXCEPTION())
+ {
+ goto ruleBANDEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleBANDEx; /* Prevent compiler warnings */
+ ruleBANDEx: ;
+
+}
+// $ANTLR end BAND
+
+// Comes from: 6739:21: ( '&=' | '&:=' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start BAND_ASSIGN
+ *
+ * Looks to match the characters the constitute the token BAND_ASSIGN
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mBAND_ASSIGN(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = BAND_ASSIGN;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6739:21: ( '&=' | '&:=' )
+
+ ANTLR3_UINT32 alt17;
+
+ alt17=2;
+
+ switch ( LA(1) )
+ {
+ case '&':
+ {
+ switch ( LA(2) )
+ {
+ case '=':
+ {
+ alt17=1;
+ }
+ break;
+ case ':':
+ {
+ alt17=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 17;
+ EXCEPTION->state = 1;
+
+
+ goto ruleBAND_ASSIGNEx;
+
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 17;
+ EXCEPTION->state = 0;
+
+
+ goto ruleBAND_ASSIGNEx;
+
+ }
+
+ switch (alt17)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6739:23: '&='
+ {
+ MATCHS(lit_367);
+ if (HASEXCEPTION())
+ {
+ goto ruleBAND_ASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6739:31: '&:='
+ {
+ MATCHS(lit_368);
+ if (HASEXCEPTION())
+ {
+ goto ruleBAND_ASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+
+ }
+ }
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleBAND_ASSIGNEx; /* Prevent compiler warnings */
+ ruleBAND_ASSIGNEx: ;
+
+}
+// $ANTLR end BAND_ASSIGN
+
+// Comes from: 6740:21: ( '&=:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start BAND_ASSIGN_AFTER
+ *
+ * Looks to match the characters the constitute the token BAND_ASSIGN_AFTER
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mBAND_ASSIGN_AFTER(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = BAND_ASSIGN_AFTER;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6740:21: ( '&=:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6740:23: '&=:'
+ {
+ MATCHS(lit_369);
+ if (HASEXCEPTION())
+ {
+ goto ruleBAND_ASSIGN_AFTEREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleBAND_ASSIGN_AFTEREx; /* Prevent compiler warnings */
+ ruleBAND_ASSIGN_AFTEREx: ;
+
+}
+// $ANTLR end BAND_ASSIGN_AFTER
+
+// Comes from: 6741:21: ( '~' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start BNOT
+ *
+ * Looks to match the characters the constitute the token BNOT
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mBNOT(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = BNOT;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6741:21: ( '~' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6741:23: '~'
+ {
+ MATCHC('~');
+ if (HASEXCEPTION())
+ {
+ goto ruleBNOTEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleBNOTEx; /* Prevent compiler warnings */
+ ruleBNOTEx: ;
+
+}
+// $ANTLR end BNOT
+
+// Comes from: 6742:21: ( '|' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start BOR
+ *
+ * Looks to match the characters the constitute the token BOR
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mBOR(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = BOR;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6742:21: ( '|' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6742:23: '|'
+ {
+ MATCHC('|');
+ if (HASEXCEPTION())
+ {
+ goto ruleBOREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleBOREx; /* Prevent compiler warnings */
+ ruleBOREx: ;
+
+}
+// $ANTLR end BOR
+
+// Comes from: 6743:21: ( '|=' | '|:=' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start BOR_ASSIGN
+ *
+ * Looks to match the characters the constitute the token BOR_ASSIGN
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mBOR_ASSIGN(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = BOR_ASSIGN;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6743:21: ( '|=' | '|:=' )
+
+ ANTLR3_UINT32 alt18;
+
+ alt18=2;
+
+ switch ( LA(1) )
+ {
+ case '|':
+ {
+ switch ( LA(2) )
+ {
+ case '=':
+ {
+ alt18=1;
+ }
+ break;
+ case ':':
+ {
+ alt18=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 18;
+ EXCEPTION->state = 1;
+
+
+ goto ruleBOR_ASSIGNEx;
+
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 18;
+ EXCEPTION->state = 0;
+
+
+ goto ruleBOR_ASSIGNEx;
+
+ }
+
+ switch (alt18)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6743:23: '|='
+ {
+ MATCHS(lit_370);
+ if (HASEXCEPTION())
+ {
+ goto ruleBOR_ASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6743:31: '|:='
+ {
+ MATCHS(lit_371);
+ if (HASEXCEPTION())
+ {
+ goto ruleBOR_ASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+
+ }
+ }
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleBOR_ASSIGNEx; /* Prevent compiler warnings */
+ ruleBOR_ASSIGNEx: ;
+
+}
+// $ANTLR end BOR_ASSIGN
+
+// Comes from: 6744:21: ( '|=:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start BOR_ASSIGN_AFTER
+ *
+ * Looks to match the characters the constitute the token BOR_ASSIGN_AFTER
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mBOR_ASSIGN_AFTER(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = BOR_ASSIGN_AFTER;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6744:21: ( '|=:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6744:23: '|=:'
+ {
+ MATCHS(lit_372);
+ if (HASEXCEPTION())
+ {
+ goto ruleBOR_ASSIGN_AFTEREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleBOR_ASSIGN_AFTEREx; /* Prevent compiler warnings */
+ ruleBOR_ASSIGN_AFTEREx: ;
+
+}
+// $ANTLR end BOR_ASSIGN_AFTER
+
+// Comes from: 6745:21: ( '^' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start BXOR
+ *
+ * Looks to match the characters the constitute the token BXOR
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mBXOR(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = BXOR;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6745:21: ( '^' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6745:23: '^'
+ {
+ MATCHC('^');
+ if (HASEXCEPTION())
+ {
+ goto ruleBXOREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleBXOREx; /* Prevent compiler warnings */
+ ruleBXOREx: ;
+
+}
+// $ANTLR end BXOR
+
+// Comes from: 6746:21: ( '^=' | '^:=' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start BXOR_ASSIGN
+ *
+ * Looks to match the characters the constitute the token BXOR_ASSIGN
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mBXOR_ASSIGN(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = BXOR_ASSIGN;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6746:21: ( '^=' | '^:=' )
+
+ ANTLR3_UINT32 alt19;
+
+ alt19=2;
+
+ switch ( LA(1) )
+ {
+ case '^':
+ {
+ switch ( LA(2) )
+ {
+ case '=':
+ {
+ alt19=1;
+ }
+ break;
+ case ':':
+ {
+ alt19=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 19;
+ EXCEPTION->state = 1;
+
+
+ goto ruleBXOR_ASSIGNEx;
+
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 19;
+ EXCEPTION->state = 0;
+
+
+ goto ruleBXOR_ASSIGNEx;
+
+ }
+
+ switch (alt19)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6746:23: '^='
+ {
+ MATCHS(lit_373);
+ if (HASEXCEPTION())
+ {
+ goto ruleBXOR_ASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6746:31: '^:='
+ {
+ MATCHS(lit_374);
+ if (HASEXCEPTION())
+ {
+ goto ruleBXOR_ASSIGNEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+
+ }
+ }
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleBXOR_ASSIGNEx; /* Prevent compiler warnings */
+ ruleBXOR_ASSIGNEx: ;
+
+}
+// $ANTLR end BXOR_ASSIGN
+
+// Comes from: 6747:21: ( '^=:' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start BXOR_ASSIGN_AFTER
+ *
+ * Looks to match the characters the constitute the token BXOR_ASSIGN_AFTER
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mBXOR_ASSIGN_AFTER(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = BXOR_ASSIGN_AFTER;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6747:21: ( '^=:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6747:23: '^=:'
+ {
+ MATCHS(lit_375);
+ if (HASEXCEPTION())
+ {
+ goto ruleBXOR_ASSIGN_AFTEREx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleBXOR_ASSIGN_AFTEREx; /* Prevent compiler warnings */
+ ruleBXOR_ASSIGN_AFTEREx: ;
+
+}
+// $ANTLR end BXOR_ASSIGN_AFTER
+
+// Comes from: 6752:2: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' | '#' )* )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start ID
+ *
+ * Looks to match the characters the constitute the token ID
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mID(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = ID;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6752:2: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' | '#' )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6752:4: ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' | '#' )*
+ {
+ if ( ((LA(1) >= 'A') && (LA(1) <= 'Z')) || LA(1) == '_' || ((LA(1) >= 'a') && (LA(1) <= 'z')) )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleIDEx;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6752:28: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' | '#' )*
+
+ for (;;)
+ {
+ int alt20=2;
+ switch ( LA(1) )
+ {
+ case '#':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z':
+ {
+ alt20=1;
+ }
+ break;
+
+ }
+
+ switch (alt20)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:
+ {
+ if ( LA(1) == '#' || ((LA(1) >= '0') && (LA(1) <= '9')) || ((LA(1) >= 'A') && (LA(1) <= 'Z')) || LA(1) == '_' || ((LA(1) >= 'a') && (LA(1) <= 'z')) )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleIDEx;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop20; /* break out of the loop */
+ break;
+ }
+ }
+ loop20: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleIDEx; /* Prevent compiler warnings */
+ ruleIDEx: ;
+
+}
+// $ANTLR end ID
+
+// Comes from: 6761:2: ( '@' ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' | '#' | '$' )* )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start AT_ID
+ *
+ * Looks to match the characters the constitute the token AT_ID
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mAT_ID(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = AT_ID;
+
+
+ ANTLR3_MARKER theStart = LEXSTATE->tokenStartCharIndex;
+ //sep::AVM_OS_DEBUG << "AT_ID:> start = " << theStart;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6761:2: ( '@' ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' | '#' | '$' )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6761:4: '@' ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' | '#' | '$' )*
+ {
+ MATCHC('@');
+ if (HASEXCEPTION())
+ {
+ goto ruleAT_IDEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ theStart = GETCHARINDEX();
+ //sep::AVM_OS_DEBUG << " GETCHARINDEX() = " << theStart << std::endl;
+
+ }
+
+
+ if ( ((LA(1) >= 'A') && (LA(1) <= 'Z')) || LA(1) == '_' || ((LA(1) >= 'a') && (LA(1) <= 'z')) )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleAT_IDEx;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6766:28: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' | '#' | '$' )*
+
+ for (;;)
+ {
+ int alt21=2;
+ switch ( LA(1) )
+ {
+ case '#':
+ case '$':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z':
+ {
+ alt21=1;
+ }
+ break;
+
+ }
+
+ switch (alt21)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:
+ {
+ if ( ((LA(1) >= '#') && (LA(1) <= '$')) || ((LA(1) >= '0') && (LA(1) <= '9')) || ((LA(1) >= 'A') && (LA(1) <= 'Z')) || LA(1) == '_' || ((LA(1) >= 'a') && (LA(1) <= 'z')) )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleAT_IDEx;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop21; /* break out of the loop */
+ break;
+ }
+ }
+ loop21: ; /* Jump out to here if this rule does not match */
+
+
+ if ( BACKTRACKING==0 )
+ {
+ LEXSTATE->tokenStartCharIndex = theStart; EMIT();
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleAT_IDEx; /* Prevent compiler warnings */
+ ruleAT_IDEx: ;
+
+}
+// $ANTLR end AT_ID
+
+// Comes from: 6775:2: ( '\"' ( ESC_SEQ |~ ( '\\\\' | '\"' ) )* '\"' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start StringLiteral
+ *
+ * Looks to match the characters the constitute the token StringLiteral
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mStringLiteral(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = StringLiteral;
+
+
+ ANTLR3_MARKER theStart = LEXSTATE->tokenStartCharIndex;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6775:2: ( '\"' ( ESC_SEQ |~ ( '\\\\' | '\"' ) )* '\"' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6775:4: '\"' ( ESC_SEQ |~ ( '\\\\' | '\"' ) )* '\"'
+ {
+ MATCHC('"');
+ if (HASEXCEPTION())
+ {
+ goto ruleStringLiteralEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ theStart = GETCHARINDEX();
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6777:4: ( ESC_SEQ |~ ( '\\\\' | '\"' ) )*
+
+ for (;;)
+ {
+ int alt22=3;
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA22_0 = LA(1);
+ if ( (LA22_0 == '\\'))
+ {
+ alt22=1;
+ }
+ else if ( (((LA22_0 >= 0x0000) && (LA22_0 <= '!')) || ((LA22_0 >= '#') && (LA22_0 <= '[')) || ((LA22_0 >= ']') && (LA22_0 <= 0xFFFF))))
+ {
+ alt22=2;
+ }
+
+ }
+ switch (alt22)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6777:6: ESC_SEQ
+ {
+ /* 6777:6: ESC_SEQ */
+ mESC_SEQ(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleStringLiteralEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6777:16: ~ ( '\\\\' | '\"' )
+ {
+ if ( ((LA(1) >= 0x0000) && (LA(1) <= '!')) || ((LA(1) >= '#') && (LA(1) <= '[')) || ((LA(1) >= ']') && (LA(1) <= 0xFFFF)) )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleStringLiteralEx;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop22; /* break out of the loop */
+ break;
+ }
+ }
+ loop22: ; /* Jump out to here if this rule does not match */
+
+
+ if ( BACKTRACKING==0 )
+ {
+ LEXSTATE->tokenStartCharIndex = theStart; EMIT();
+ }
+
+
+ MATCHC('"');
+ if (HASEXCEPTION())
+ {
+ goto ruleStringLiteralEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleStringLiteralEx; /* Prevent compiler warnings */
+ ruleStringLiteralEx: ;
+
+}
+// $ANTLR end StringLiteral
+
+// Comes from: 6786:2: ( '\\'' ( ESC_SEQ |~ ( '\\'' | '\\\\' ) ) '\\'' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start CharLiteral
+ *
+ * Looks to match the characters the constitute the token CharLiteral
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mCharLiteral(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = CharLiteral;
+
+
+ ANTLR3_MARKER theStart = LEXSTATE->tokenStartCharIndex;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6786:2: ( '\\'' ( ESC_SEQ |~ ( '\\'' | '\\\\' ) ) '\\'' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6786:4: '\\'' ( ESC_SEQ |~ ( '\\'' | '\\\\' ) ) '\\''
+ {
+ MATCHC('\'');
+ if (HASEXCEPTION())
+ {
+ goto ruleCharLiteralEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ theStart = GETCHARINDEX();
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6788:4: ( ESC_SEQ |~ ( '\\'' | '\\\\' ) )
+ {
+ int alt23=2;
+ {
+ int LA23_0 = LA(1);
+ if ( (LA23_0 == '\\'))
+ {
+ alt23=1;
+ }
+ else if ( (((LA23_0 >= 0x0000) && (LA23_0 <= '&')) || ((LA23_0 >= '(') && (LA23_0 <= '[')) || ((LA23_0 >= ']') && (LA23_0 <= 0xFFFF))))
+ {
+ alt23=2;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 23;
+ EXCEPTION->state = 0;
+
+
+ goto ruleCharLiteralEx;
+
+ }
+ }
+ switch (alt23)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6788:6: ESC_SEQ
+ {
+ /* 6788:6: ESC_SEQ */
+ mESC_SEQ(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleCharLiteralEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6788:16: ~ ( '\\'' | '\\\\' )
+ {
+ if ( ((LA(1) >= 0x0000) && (LA(1) <= '&')) || ((LA(1) >= '(') && (LA(1) <= '[')) || ((LA(1) >= ']') && (LA(1) <= 0xFFFF)) )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleCharLiteralEx;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+ LEXSTATE->tokenStartCharIndex = theStart; EMIT();
+ }
+
+
+ MATCHC('\'');
+ if (HASEXCEPTION())
+ {
+ goto ruleCharLiteralEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleCharLiteralEx; /* Prevent compiler warnings */
+ ruleCharLiteralEx: ;
+
+}
+// $ANTLR end CharLiteral
+
+// Comes from: 6795:2: ( ( IntegerLiteral DOTDOT )=> IntegerLiteral | ( FloatLiteral )=> FloatLiteral | IntegerLiteral )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start NumberLiteral
+ *
+ * Looks to match the characters the constitute the token NumberLiteral
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mNumberLiteral(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = NumberLiteral;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6795:2: ( ( IntegerLiteral DOTDOT )=> IntegerLiteral | ( FloatLiteral )=> FloatLiteral | IntegerLiteral )
+
+ ANTLR3_UINT32 alt24;
+
+ alt24=3;
+
+ {
+ int LA24_0 = LA(1);
+ if ( (LA24_0 == '0'))
+ {
+ {
+ int LA24_1 = LA(2);
+ if ( (synpred2_fml(ctx)) && (LA24_1 == 'F' || LA24_1 == 'L' || LA24_1 == 'f'))
+ {
+ alt24=2;
+ }
+ else if ( (synpred2_fml(ctx)) && (((LA24_1 >= '0') && (LA24_1 <= '9')) || LA24_1 == '_'))
+ {
+ alt24=2;
+ }
+ else if ( (synpred2_fml(ctx)) && (LA24_1 == '.'))
+ {
+ alt24=2;
+ }
+ else if ( (synpred1_fml(ctx)))
+ {
+ alt24=1;
+ }
+ else if ( (ANTLR3_TRUE))
+ {
+ alt24=3;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 24;
+ EXCEPTION->state = 1;
+
+
+ goto ruleNumberLiteralEx;
+
+ }
+ }
+ }
+ else if ( (((LA24_0 >= '1') && (LA24_0 <= '9'))))
+ {
+ {
+ int LA24_2 = LA(2);
+ if ( (synpred2_fml(ctx)) && (((LA24_2 >= '0') && (LA24_2 <= '9')) || LA24_2 == '_'))
+ {
+ alt24=2;
+ }
+ else if ( (synpred2_fml(ctx)) && (LA24_2 == 'F' || LA24_2 == 'L' || LA24_2 == 'f'))
+ {
+ alt24=2;
+ }
+ else if ( (synpred2_fml(ctx)) && (LA24_2 == '.'))
+ {
+ alt24=2;
+ }
+ else if ( (synpred1_fml(ctx)))
+ {
+ alt24=1;
+ }
+ else if ( (ANTLR3_TRUE))
+ {
+ alt24=3;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 24;
+ EXCEPTION->state = 2;
+
+
+ goto ruleNumberLiteralEx;
+
+ }
+ }
+ }
+ else if ( (synpred2_fml(ctx)) && (LA24_0 == '_'))
+ {
+ alt24=2;
+ }
+ else if ( (synpred2_fml(ctx)) && (LA24_0 == '.'))
+ {
+ alt24=2;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 24;
+ EXCEPTION->state = 0;
+
+
+ goto ruleNumberLiteralEx;
+
+ }
+ }
+ switch (alt24)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6795:4: ( IntegerLiteral DOTDOT )=> IntegerLiteral
+ {
+ /* 6795:4: ( IntegerLiteral DOTDOT )=> IntegerLiteral */
+ mIntegerLiteral(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleNumberLiteralEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ if ( BACKTRACKING==0 )
+ {
+ _type=IntegerLiteral;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6797:4: ( FloatLiteral )=> FloatLiteral
+ {
+ /* 6797:4: ( FloatLiteral )=> FloatLiteral */
+ mFloatLiteral(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleNumberLiteralEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ if ( BACKTRACKING==0 )
+ {
+ _type=FloatLiteral;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6798:4: IntegerLiteral
+ {
+ /* 6798:4: IntegerLiteral */
+ mIntegerLiteral(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleNumberLiteralEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ if ( BACKTRACKING==0 )
+ {
+ _type=IntegerLiteral;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleNumberLiteralEx; /* Prevent compiler warnings */
+ ruleNumberLiteralEx: ;
+
+}
+// $ANTLR end NumberLiteral
+
+// Comes from: 6802:26: ( Float ( ImaginarySuffix )? )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start FloatLiteral
+ *
+ * Looks to match the characters the constitute the token FloatLiteral
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mFloatLiteral(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6802:26: ( Float ( ImaginarySuffix )? )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6802:28: Float ( ImaginarySuffix )?
+ {
+ /* 6802:28: Float ( ImaginarySuffix )? */
+ mFloat(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleFloatLiteralEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6802:34: ( ImaginarySuffix )?
+ {
+ int alt25=2;
+ switch ( LA(1) )
+ {
+ case 'i':
+ {
+ alt25=1;
+ }
+ break;
+ }
+
+ switch (alt25)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:
+ {
+ if ( LA(1) == 'i' )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleFloatLiteralEx;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+
+ // This is where rules clean up and exit
+ //
+ goto ruleFloatLiteralEx; /* Prevent compiler warnings */
+ ruleFloatLiteralEx: ;
+
+}
+// $ANTLR end FloatLiteral
+
+// Comes from: 6804:26: ( IntegerLiteral DIV Integer )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start RationalLiteral
+ *
+ * Looks to match the characters the constitute the token RationalLiteral
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mRationalLiteral(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6804:26: ( IntegerLiteral DIV Integer )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6804:28: IntegerLiteral DIV Integer
+ {
+ /* 6804:28: IntegerLiteral DIV Integer */
+ mIntegerLiteral(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleRationalLiteralEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ /* 6804:28: IntegerLiteral DIV Integer */
+ mDIV(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleRationalLiteralEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ /* 6804:28: IntegerLiteral DIV Integer */
+ mInteger(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleRationalLiteralEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+
+
+ // This is where rules clean up and exit
+ //
+ goto ruleRationalLiteralEx; /* Prevent compiler warnings */
+ ruleRationalLiteralEx: ;
+
+}
+// $ANTLR end RationalLiteral
+
+// Comes from: 6806:26: ( Integer ( IntSuffix )? )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start IntegerLiteral
+ *
+ * Looks to match the characters the constitute the token IntegerLiteral
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mIntegerLiteral(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6806:26: ( Integer ( IntSuffix )? )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6806:28: Integer ( IntSuffix )?
+ {
+ /* 6806:28: Integer ( IntSuffix )? */
+ mInteger(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleIntegerLiteralEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6806:36: ( IntSuffix )?
+ {
+ int alt26=2;
+ switch ( LA(1) )
+ {
+ case 'L':
+ case 'U':
+ case 'u':
+ {
+ alt26=1;
+ }
+ break;
+ }
+
+ switch (alt26)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6806:36: IntSuffix
+ {
+ /* 6806:36: IntSuffix */
+ mIntSuffix(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleIntegerLiteralEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+
+ // This is where rules clean up and exit
+ //
+ goto ruleIntegerLiteralEx; /* Prevent compiler warnings */
+ ruleIntegerLiteralEx: ;
+
+}
+// $ANTLR end IntegerLiteral
+
+// Comes from: 6808:26: ( 'f' | 'F' | 'L' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start FloatTypeSuffix
+ *
+ * Looks to match the characters the constitute the token FloatTypeSuffix
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mFloatTypeSuffix(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6808:26: ( 'f' | 'F' | 'L' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:
+ {
+ if ( LA(1) == 'F' || LA(1) == 'L' || LA(1) == 'f' )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleFloatTypeSuffixEx;
+ }
+
+
+ }
+
+
+ // This is where rules clean up and exit
+ //
+ goto ruleFloatTypeSuffixEx; /* Prevent compiler warnings */
+ ruleFloatTypeSuffixEx: ;
+
+}
+// $ANTLR end FloatTypeSuffix
+
+// Comes from: 6809:26: ( 'i' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start ImaginarySuffix
+ *
+ * Looks to match the characters the constitute the token ImaginarySuffix
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mImaginarySuffix(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6809:26: ( 'i' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6809:28: 'i'
+ {
+ MATCHC('i');
+ if (HASEXCEPTION())
+ {
+ goto ruleImaginarySuffixEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+
+ // This is where rules clean up and exit
+ //
+ goto ruleImaginarySuffixEx; /* Prevent compiler warnings */
+ ruleImaginarySuffixEx: ;
+
+}
+// $ANTLR end ImaginarySuffix
+
+// Comes from: 6810:26: ( 'L' | 'u' | 'U' | 'Lu' | 'LU' | 'uL' | 'UL' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start IntSuffix
+ *
+ * Looks to match the characters the constitute the token IntSuffix
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mIntSuffix(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6810:26: ( 'L' | 'u' | 'U' | 'Lu' | 'LU' | 'uL' | 'UL' )
+
+ ANTLR3_UINT32 alt27;
+
+ alt27=7;
+
+ switch ( LA(1) )
+ {
+ case 'L':
+ {
+ switch ( LA(2) )
+ {
+ case 'u':
+ {
+ alt27=4;
+ }
+ break;
+ case 'U':
+ {
+ alt27=5;
+ }
+ break;
+
+ default:
+ alt27=1;
+ }
+
+ }
+ break;
+ case 'u':
+ {
+ switch ( LA(2) )
+ {
+ case 'L':
+ {
+ alt27=6;
+ }
+ break;
+
+ default:
+ alt27=2;
+ }
+
+ }
+ break;
+ case 'U':
+ {
+ switch ( LA(2) )
+ {
+ case 'L':
+ {
+ alt27=7;
+ }
+ break;
+
+ default:
+ alt27=3;
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 27;
+ EXCEPTION->state = 0;
+
+
+ goto ruleIntSuffixEx;
+
+ }
+
+ switch (alt27)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6810:28: 'L'
+ {
+ MATCHC('L');
+ if (HASEXCEPTION())
+ {
+ goto ruleIntSuffixEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6810:32: 'u'
+ {
+ MATCHC('u');
+ if (HASEXCEPTION())
+ {
+ goto ruleIntSuffixEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6810:36: 'U'
+ {
+ MATCHC('U');
+ if (HASEXCEPTION())
+ {
+ goto ruleIntSuffixEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6810:40: 'Lu'
+ {
+ MATCHS(lit_376);
+ if (HASEXCEPTION())
+ {
+ goto ruleIntSuffixEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6810:45: 'LU'
+ {
+ MATCHS(lit_377);
+ if (HASEXCEPTION())
+ {
+ goto ruleIntSuffixEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6810:50: 'uL'
+ {
+ MATCHS(lit_378);
+ if (HASEXCEPTION())
+ {
+ goto ruleIntSuffixEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6810:55: 'UL'
+ {
+ MATCHS(lit_379);
+ if (HASEXCEPTION())
+ {
+ goto ruleIntSuffixEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleIntSuffixEx; /* Prevent compiler warnings */
+ ruleIntSuffixEx: ;
+
+}
+// $ANTLR end IntSuffix
+
+// Comes from: 6812:26: ( Decimal | Binary | Octal | Hexadecimal )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start Integer
+ *
+ * Looks to match the characters the constitute the token Integer
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mInteger(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6812:26: ( Decimal | Binary | Octal | Hexadecimal )
+
+ ANTLR3_UINT32 alt28;
+
+ alt28=4;
+
+ switch ( LA(1) )
+ {
+ case '0':
+ {
+ switch ( LA(2) )
+ {
+ case 'B':
+ case 'b':
+ {
+ alt28=2;
+ }
+ break;
+ case 'X':
+ case 'x':
+ {
+ alt28=4;
+ }
+ break;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '_':
+ {
+ alt28=3;
+ }
+ break;
+
+ default:
+ alt28=1;
+ }
+
+ }
+ break;
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ {
+ alt28=1;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 28;
+ EXCEPTION->state = 0;
+
+
+ goto ruleIntegerEx;
+
+ }
+
+ switch (alt28)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6812:28: Decimal
+ {
+ /* 6812:28: Decimal */
+ mDecimal(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleIntegerEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6812:38: Binary
+ {
+ /* 6812:38: Binary */
+ mBinary(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleIntegerEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6812:47: Octal
+ {
+ /* 6812:47: Octal */
+ mOctal(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleIntegerEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6812:55: Hexadecimal
+ {
+ /* 6812:55: Hexadecimal */
+ mHexadecimal(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleIntegerEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleIntegerEx; /* Prevent compiler warnings */
+ ruleIntegerEx: ;
+
+}
+// $ANTLR end Integer
+
+// Comes from: 6813:26: ( '0' | '1' .. '9' ( DecimalDigit | '_' )* )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start Decimal
+ *
+ * Looks to match the characters the constitute the token Decimal
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mDecimal(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6813:26: ( '0' | '1' .. '9' ( DecimalDigit | '_' )* )
+
+ ANTLR3_UINT32 alt30;
+
+ alt30=2;
+
+ switch ( LA(1) )
+ {
+ case '0':
+ {
+ alt30=1;
+ }
+ break;
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ {
+ alt30=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 30;
+ EXCEPTION->state = 0;
+
+
+ goto ruleDecimalEx;
+
+ }
+
+ switch (alt30)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6813:28: '0'
+ {
+ MATCHC('0');
+ if (HASEXCEPTION())
+ {
+ goto ruleDecimalEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6813:34: '1' .. '9' ( DecimalDigit | '_' )*
+ {
+ MATCHRANGE('1', '9');
+ if (HASEXCEPTION())
+ {
+ goto ruleDecimalEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6813:43: ( DecimalDigit | '_' )*
+
+ for (;;)
+ {
+ int alt29=2;
+ switch ( LA(1) )
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '_':
+ {
+ alt29=1;
+ }
+ break;
+
+ }
+
+ switch (alt29)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:
+ {
+ if ( ((LA(1) >= '0') && (LA(1) <= '9')) || LA(1) == '_' )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleDecimalEx;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop29; /* break out of the loop */
+ break;
+ }
+ }
+ loop29: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleDecimalEx; /* Prevent compiler warnings */
+ ruleDecimalEx: ;
+
+}
+// $ANTLR end Decimal
+
+// Comes from: 6815:26: ( ( '0b' | '0B' ) ( '0' | '1' | '_' )+ )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start Binary
+ *
+ * Looks to match the characters the constitute the token Binary
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mBinary(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6815:26: ( ( '0b' | '0B' ) ( '0' | '1' | '_' )+ )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6815:28: ( '0b' | '0B' ) ( '0' | '1' | '_' )+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6815:28: ( '0b' | '0B' )
+ {
+ int alt31=2;
+ switch ( LA(1) )
+ {
+ case '0':
+ {
+ switch ( LA(2) )
+ {
+ case 'b':
+ {
+ alt31=1;
+ }
+ break;
+ case 'B':
+ {
+ alt31=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 31;
+ EXCEPTION->state = 1;
+
+
+ goto ruleBinaryEx;
+
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 31;
+ EXCEPTION->state = 0;
+
+
+ goto ruleBinaryEx;
+
+ }
+
+ switch (alt31)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6815:29: '0b'
+ {
+ MATCHS(lit_380);
+ if (HASEXCEPTION())
+ {
+ goto ruleBinaryEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6815:36: '0B'
+ {
+ MATCHS(lit_381);
+ if (HASEXCEPTION())
+ {
+ goto ruleBinaryEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6815:42: ( '0' | '1' | '_' )+
+ {
+ int cnt32=0;
+
+ for (;;)
+ {
+ int alt32=2;
+ switch ( LA(1) )
+ {
+ case '0':
+ case '1':
+ case '_':
+ {
+ alt32=1;
+ }
+ break;
+
+ }
+
+ switch (alt32)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:
+ {
+ if ( ((LA(1) >= '0') && (LA(1) <= '1')) || LA(1) == '_' )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleBinaryEx;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt32 >= 1 )
+ {
+ goto loop32;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruleBinaryEx;
+ }
+ cnt32++;
+ }
+ loop32: ; /* Jump to here if this rule does not match */
+ }
+
+ }
+
+
+ // This is where rules clean up and exit
+ //
+ goto ruleBinaryEx; /* Prevent compiler warnings */
+ ruleBinaryEx: ;
+
+}
+// $ANTLR end Binary
+
+// Comes from: 6816:26: ( '0' ( OctalDigit | '_' )+ )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start Octal
+ *
+ * Looks to match the characters the constitute the token Octal
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOctal(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6816:26: ( '0' ( OctalDigit | '_' )+ )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6816:28: '0' ( OctalDigit | '_' )+
+ {
+ MATCHC('0');
+ if (HASEXCEPTION())
+ {
+ goto ruleOctalEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6816:32: ( OctalDigit | '_' )+
+ {
+ int cnt33=0;
+
+ for (;;)
+ {
+ int alt33=2;
+ switch ( LA(1) )
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '_':
+ {
+ alt33=1;
+ }
+ break;
+
+ }
+
+ switch (alt33)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:
+ {
+ if ( ((LA(1) >= '0') && (LA(1) <= '7')) || LA(1) == '_' )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleOctalEx;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt33 >= 1 )
+ {
+ goto loop33;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruleOctalEx;
+ }
+ cnt33++;
+ }
+ loop33: ; /* Jump to here if this rule does not match */
+ }
+
+ }
+
+
+ // This is where rules clean up and exit
+ //
+ goto ruleOctalEx; /* Prevent compiler warnings */
+ ruleOctalEx: ;
+
+}
+// $ANTLR end Octal
+
+// Comes from: 6817:26: ( ( '0x' | '0X' ) ( HexDigit | '_' )+ )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start Hexadecimal
+ *
+ * Looks to match the characters the constitute the token Hexadecimal
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mHexadecimal(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6817:26: ( ( '0x' | '0X' ) ( HexDigit | '_' )+ )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6817:28: ( '0x' | '0X' ) ( HexDigit | '_' )+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6817:28: ( '0x' | '0X' )
+ {
+ int alt34=2;
+ switch ( LA(1) )
+ {
+ case '0':
+ {
+ switch ( LA(2) )
+ {
+ case 'x':
+ {
+ alt34=1;
+ }
+ break;
+ case 'X':
+ {
+ alt34=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 34;
+ EXCEPTION->state = 1;
+
+
+ goto ruleHexadecimalEx;
+
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 34;
+ EXCEPTION->state = 0;
+
+
+ goto ruleHexadecimalEx;
+
+ }
+
+ switch (alt34)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6817:29: '0x'
+ {
+ MATCHS(lit_382);
+ if (HASEXCEPTION())
+ {
+ goto ruleHexadecimalEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6817:36: '0X'
+ {
+ MATCHS(lit_383);
+ if (HASEXCEPTION())
+ {
+ goto ruleHexadecimalEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6817:42: ( HexDigit | '_' )+
+ {
+ int cnt35=0;
+
+ for (;;)
+ {
+ int alt35=2;
+ switch ( LA(1) )
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ {
+ alt35=1;
+ }
+ break;
+
+ }
+
+ switch (alt35)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:
+ {
+ if ( ((LA(1) >= '0') && (LA(1) <= '9')) || ((LA(1) >= 'A') && (LA(1) <= 'F')) || LA(1) == '_' || ((LA(1) >= 'a') && (LA(1) <= 'f')) )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleHexadecimalEx;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt35 >= 1 )
+ {
+ goto loop35;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruleHexadecimalEx;
+ }
+ cnt35++;
+ }
+ loop35: ; /* Jump to here if this rule does not match */
+ }
+
+ }
+
+
+ // This is where rules clean up and exit
+ //
+ goto ruleHexadecimalEx; /* Prevent compiler warnings */
+ ruleHexadecimalEx: ;
+
+}
+// $ANTLR end Hexadecimal
+
+// Comes from: 6819:26: ( '0' .. '9' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start DecimalDigit
+ *
+ * Looks to match the characters the constitute the token DecimalDigit
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mDecimalDigit(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6819:26: ( '0' .. '9' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:
+ {
+ if ( ((LA(1) >= '0') && (LA(1) <= '9')) )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleDecimalDigitEx;
+ }
+
+
+ }
+
+
+ // This is where rules clean up and exit
+ //
+ goto ruleDecimalDigitEx; /* Prevent compiler warnings */
+ ruleDecimalDigitEx: ;
+
+}
+// $ANTLR end DecimalDigit
+
+// Comes from: 6820:26: ( '0' .. '7' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OctalDigit
+ *
+ * Looks to match the characters the constitute the token OctalDigit
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOctalDigit(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6820:26: ( '0' .. '7' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:
+ {
+ if ( ((LA(1) >= '0') && (LA(1) <= '7')) )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleOctalDigitEx;
+ }
+
+
+ }
+
+
+ // This is where rules clean up and exit
+ //
+ goto ruleOctalDigitEx; /* Prevent compiler warnings */
+ ruleOctalDigitEx: ;
+
+}
+// $ANTLR end OctalDigit
+
+// Comes from: 6821:26: ( ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start HexDigit
+ *
+ * Looks to match the characters the constitute the token HexDigit
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mHexDigit(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6821:26: ( ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:
+ {
+ if ( ((LA(1) >= '0') && (LA(1) <= '9')) || ((LA(1) >= 'A') && (LA(1) <= 'F')) || ((LA(1) >= 'a') && (LA(1) <= 'f')) )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleHexDigitEx;
+ }
+
+
+ }
+
+
+ // This is where rules clean up and exit
+ //
+ goto ruleHexDigitEx; /* Prevent compiler warnings */
+ ruleHexDigitEx: ;
+
+}
+// $ANTLR end HexDigit
+
+// Comes from: 6823:26: ( 'e' | 'E' | 'e+' | 'E+' | 'e-' | 'E-' DecimalDigits )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start DecimalExponent
+ *
+ * Looks to match the characters the constitute the token DecimalExponent
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mDecimalExponent(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6823:26: ( 'e' | 'E' | 'e+' | 'E+' | 'e-' | 'E-' DecimalDigits )
+
+ ANTLR3_UINT32 alt36;
+
+ alt36=6;
+
+ switch ( LA(1) )
+ {
+ case 'e':
+ {
+ switch ( LA(2) )
+ {
+ case '+':
+ {
+ alt36=3;
+ }
+ break;
+ case '-':
+ {
+ alt36=5;
+ }
+ break;
+
+ default:
+ alt36=1;
+ }
+
+ }
+ break;
+ case 'E':
+ {
+ switch ( LA(2) )
+ {
+ case '+':
+ {
+ alt36=4;
+ }
+ break;
+ case '-':
+ {
+ alt36=6;
+ }
+ break;
+
+ default:
+ alt36=2;
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 36;
+ EXCEPTION->state = 0;
+
+
+ goto ruleDecimalExponentEx;
+
+ }
+
+ switch (alt36)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6823:28: 'e'
+ {
+ MATCHC('e');
+ if (HASEXCEPTION())
+ {
+ goto ruleDecimalExponentEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6823:34: 'E'
+ {
+ MATCHC('E');
+ if (HASEXCEPTION())
+ {
+ goto ruleDecimalExponentEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6823:40: 'e+'
+ {
+ MATCHS(lit_384);
+ if (HASEXCEPTION())
+ {
+ goto ruleDecimalExponentEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6823:47: 'E+'
+ {
+ MATCHS(lit_385);
+ if (HASEXCEPTION())
+ {
+ goto ruleDecimalExponentEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6823:54: 'e-'
+ {
+ MATCHS(lit_386);
+ if (HASEXCEPTION())
+ {
+ goto ruleDecimalExponentEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6823:61: 'E-' DecimalDigits
+ {
+ MATCHS(lit_387);
+ if (HASEXCEPTION())
+ {
+ goto ruleDecimalExponentEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ /* 6823:61: 'E-' DecimalDigits */
+ mDecimalDigits(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleDecimalExponentEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleDecimalExponentEx; /* Prevent compiler warnings */
+ ruleDecimalExponentEx: ;
+
+}
+// $ANTLR end DecimalExponent
+
+// Comes from: 6824:26: ( ( '0' .. '9' | '_' )+ )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start DecimalDigits
+ *
+ * Looks to match the characters the constitute the token DecimalDigits
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mDecimalDigits(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6824:26: ( ( '0' .. '9' | '_' )+ )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6824:28: ( '0' .. '9' | '_' )+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6824:28: ( '0' .. '9' | '_' )+
+ {
+ int cnt37=0;
+
+ for (;;)
+ {
+ int alt37=2;
+ switch ( LA(1) )
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '_':
+ {
+ alt37=1;
+ }
+ break;
+
+ }
+
+ switch (alt37)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:
+ {
+ if ( ((LA(1) >= '0') && (LA(1) <= '9')) || LA(1) == '_' )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleDecimalDigitsEx;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt37 >= 1 )
+ {
+ goto loop37;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruleDecimalDigitsEx;
+ }
+ cnt37++;
+ }
+ loop37: ; /* Jump to here if this rule does not match */
+ }
+
+ }
+
+
+ // This is where rules clean up and exit
+ //
+ goto ruleDecimalDigitsEx; /* Prevent compiler warnings */
+ ruleDecimalDigitsEx: ;
+
+}
+// $ANTLR end DecimalDigits
+
+// Comes from: 6829:2: (d= DecimalDigits ( options {greedy=true; } : FloatTypeSuffix | '.' DecimalDigits ( DecimalExponent )? ) | '.' DecimalDigits ( DecimalExponent )? )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start Float
+ *
+ * Looks to match the characters the constitute the token Float
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mFloat(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+ pANTLR3_COMMON_TOKEN d;
+
+
+ d = NULL;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6829:2: (d= DecimalDigits ( options {greedy=true; } : FloatTypeSuffix | '.' DecimalDigits ( DecimalExponent )? ) | '.' DecimalDigits ( DecimalExponent )? )
+
+ ANTLR3_UINT32 alt41;
+
+ alt41=2;
+
+ switch ( LA(1) )
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '_':
+ {
+ alt41=1;
+ }
+ break;
+ case '.':
+ {
+ alt41=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 41;
+ EXCEPTION->state = 0;
+
+
+ goto ruleFloatEx;
+
+ }
+
+ switch (alt41)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6829:4: d= DecimalDigits ( options {greedy=true; } : FloatTypeSuffix | '.' DecimalDigits ( DecimalExponent )? )
+ {
+ /* 6829:4: d= DecimalDigits ( options {greedy=true; } : FloatTypeSuffix | '.' DecimalDigits ( DecimalExponent )? ) */
+ {
+ ANTLR3_MARKER dStart4769 = GETCHARINDEX();
+ mDecimalDigits(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleFloatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+ d = LEXSTATE->tokFactory->newToken(LEXSTATE->tokFactory);
+ d->setType(d, ANTLR3_TOKEN_INVALID);
+ d->setStartIndex(d, dStart4769);
+ d->setStopIndex(d, GETCHARINDEX()-1);
+ d->input = INPUT;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6830:4: ( options {greedy=true; } : FloatTypeSuffix | '.' DecimalDigits ( DecimalExponent )? )
+ {
+ int alt39=2;
+ switch ( LA(1) )
+ {
+ case 'F':
+ case 'L':
+ case 'f':
+ {
+ alt39=1;
+ }
+ break;
+ case '.':
+ {
+ alt39=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 39;
+ EXCEPTION->state = 0;
+
+
+ goto ruleFloatEx;
+
+ }
+
+ switch (alt39)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6830:34: FloatTypeSuffix
+ {
+ /* 6830:34: FloatTypeSuffix */
+ mFloatTypeSuffix(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleFloatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6831:6: '.' DecimalDigits ( DecimalExponent )?
+ {
+ MATCHC('.');
+ if (HASEXCEPTION())
+ {
+ goto ruleFloatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ /* 6831:6: '.' DecimalDigits ( DecimalExponent )? */
+ mDecimalDigits(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleFloatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6831:24: ( DecimalExponent )?
+ {
+ int alt38=2;
+ switch ( LA(1) )
+ {
+ case 'E':
+ case 'e':
+ {
+ alt38=1;
+ }
+ break;
+ }
+
+ switch (alt38)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6831:24: DecimalExponent
+ {
+ /* 6831:24: DecimalExponent */
+ mDecimalExponent(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleFloatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6833:5: '.' DecimalDigits ( DecimalExponent )?
+ {
+ MATCHC('.');
+ if (HASEXCEPTION())
+ {
+ goto ruleFloatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ /* 6833:5: '.' DecimalDigits ( DecimalExponent )? */
+ mDecimalDigits(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleFloatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6833:23: ( DecimalExponent )?
+ {
+ int alt40=2;
+ switch ( LA(1) )
+ {
+ case 'E':
+ case 'e':
+ {
+ alt40=1;
+ }
+ break;
+ }
+
+ switch (alt40)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6833:23: DecimalExponent
+ {
+ /* 6833:23: DecimalExponent */
+ mDecimalExponent(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleFloatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleFloatEx; /* Prevent compiler warnings */
+ ruleFloatEx: ;
+
+ d = NULL;
+
+}
+// $ANTLR end Float
+
+// Comes from: 6840:2: ( ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+ )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start EXPONENT
+ *
+ * Looks to match the characters the constitute the token EXPONENT
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mEXPONENT(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6840:2: ( ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+ )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6840:4: ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+
+ {
+ if ( LA(1) == 'E' || LA(1) == 'e' )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleEXPONENTEx;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6840:15: ( '+' | '-' )?
+ {
+ int alt42=2;
+ switch ( LA(1) )
+ {
+ case '+':
+ case '-':
+ {
+ alt42=1;
+ }
+ break;
+ }
+
+ switch (alt42)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:
+ {
+ if ( LA(1) == '+' || LA(1) == '-' )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleEXPONENTEx;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6840:27: ( '0' .. '9' )+
+ {
+ int cnt43=0;
+
+ for (;;)
+ {
+ int alt43=2;
+ switch ( LA(1) )
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ {
+ alt43=1;
+ }
+ break;
+
+ }
+
+ switch (alt43)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:
+ {
+ if ( ((LA(1) >= '0') && (LA(1) <= '9')) )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleEXPONENTEx;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt43 >= 1 )
+ {
+ goto loop43;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruleEXPONENTEx;
+ }
+ cnt43++;
+ }
+ loop43: ; /* Jump to here if this rule does not match */
+ }
+
+ }
+
+
+ // This is where rules clean up and exit
+ //
+ goto ruleEXPONENTEx; /* Prevent compiler warnings */
+ ruleEXPONENTEx: ;
+
+}
+// $ANTLR end EXPONENT
+
+// Comes from: 6845:2: ( ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start HEX_DIGIT
+ *
+ * Looks to match the characters the constitute the token HEX_DIGIT
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mHEX_DIGIT(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6845:2: ( ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:
+ {
+ if ( ((LA(1) >= '0') && (LA(1) <= '9')) || ((LA(1) >= 'A') && (LA(1) <= 'F')) || ((LA(1) >= 'a') && (LA(1) <= 'f')) )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleHEX_DIGITEx;
+ }
+
+
+ }
+
+
+ // This is where rules clean up and exit
+ //
+ goto ruleHEX_DIGITEx; /* Prevent compiler warnings */
+ ruleHEX_DIGITEx: ;
+
+}
+// $ANTLR end HEX_DIGIT
+
+// Comes from: 6850:2: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | UNICODE_ESC | OCTAL_ESC )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start ESC_SEQ
+ *
+ * Looks to match the characters the constitute the token ESC_SEQ
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mESC_SEQ(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6850:2: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | UNICODE_ESC | OCTAL_ESC )
+
+ ANTLR3_UINT32 alt44;
+
+ alt44=3;
+
+ switch ( LA(1) )
+ {
+ case '\\':
+ {
+ switch ( LA(2) )
+ {
+ case '"':
+ case '\'':
+ case '\\':
+ case 'b':
+ case 'f':
+ case 'n':
+ case 'r':
+ case 't':
+ {
+ alt44=1;
+ }
+ break;
+ case 'u':
+ {
+ alt44=2;
+ }
+ break;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ {
+ alt44=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 44;
+ EXCEPTION->state = 1;
+
+
+ goto ruleESC_SEQEx;
+
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 44;
+ EXCEPTION->state = 0;
+
+
+ goto ruleESC_SEQEx;
+
+ }
+
+ switch (alt44)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6850:4: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' )
+ {
+ MATCHC('\\');
+ if (HASEXCEPTION())
+ {
+ goto ruleESC_SEQEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( LA(1) == '"' || LA(1) == '\'' || LA(1) == '\\' || LA(1) == 'b' || LA(1) == 'f' || LA(1) == 'n' || LA(1) == 'r' || LA(1) == 't' )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleESC_SEQEx;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6851:4: UNICODE_ESC
+ {
+ /* 6851:4: UNICODE_ESC */
+ mUNICODE_ESC(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleESC_SEQEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6852:4: OCTAL_ESC
+ {
+ /* 6852:4: OCTAL_ESC */
+ mOCTAL_ESC(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleESC_SEQEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleESC_SEQEx; /* Prevent compiler warnings */
+ ruleESC_SEQEx: ;
+
+}
+// $ANTLR end ESC_SEQ
+
+// Comes from: 6857:2: ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start OCTAL_ESC
+ *
+ * Looks to match the characters the constitute the token OCTAL_ESC
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mOCTAL_ESC(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6857:2: ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) )
+
+ ANTLR3_UINT32 alt45;
+
+ alt45=3;
+
+ switch ( LA(1) )
+ {
+ case '\\':
+ {
+ switch ( LA(2) )
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ {
+ switch ( LA(3) )
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ {
+ switch ( LA(4) )
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ {
+ alt45=1;
+ }
+ break;
+
+ default:
+ alt45=2;
+ }
+
+ }
+ break;
+
+ default:
+ alt45=3;
+ }
+
+ }
+ break;
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ {
+ switch ( LA(3) )
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ {
+ alt45=2;
+ }
+ break;
+
+ default:
+ alt45=3;
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 45;
+ EXCEPTION->state = 1;
+
+
+ goto ruleOCTAL_ESCEx;
+
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 45;
+ EXCEPTION->state = 0;
+
+
+ goto ruleOCTAL_ESCEx;
+
+ }
+
+ switch (alt45)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6857:4: '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' )
+ {
+ MATCHC('\\');
+ if (HASEXCEPTION())
+ {
+ goto ruleOCTAL_ESCEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( ((LA(1) >= '0') && (LA(1) <= '3')) )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleOCTAL_ESCEx;
+ }
+
+
+ if ( ((LA(1) >= '0') && (LA(1) <= '7')) )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleOCTAL_ESCEx;
+ }
+
+
+ if ( ((LA(1) >= '0') && (LA(1) <= '7')) )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleOCTAL_ESCEx;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6858:4: '\\\\' ( '0' .. '7' ) ( '0' .. '7' )
+ {
+ MATCHC('\\');
+ if (HASEXCEPTION())
+ {
+ goto ruleOCTAL_ESCEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( ((LA(1) >= '0') && (LA(1) <= '7')) )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleOCTAL_ESCEx;
+ }
+
+
+ if ( ((LA(1) >= '0') && (LA(1) <= '7')) )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleOCTAL_ESCEx;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6859:4: '\\\\' ( '0' .. '7' )
+ {
+ MATCHC('\\');
+ if (HASEXCEPTION())
+ {
+ goto ruleOCTAL_ESCEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( ((LA(1) >= '0') && (LA(1) <= '7')) )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleOCTAL_ESCEx;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleOCTAL_ESCEx; /* Prevent compiler warnings */
+ ruleOCTAL_ESCEx: ;
+
+}
+// $ANTLR end OCTAL_ESC
+
+// Comes from: 6864:2: ( '\\\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start UNICODE_ESC
+ *
+ * Looks to match the characters the constitute the token UNICODE_ESC
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mUNICODE_ESC(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6864:2: ( '\\\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6864:4: '\\\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT
+ {
+ MATCHC('\\');
+ if (HASEXCEPTION())
+ {
+ goto ruleUNICODE_ESCEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHC('u');
+ if (HASEXCEPTION())
+ {
+ goto ruleUNICODE_ESCEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ /* 6864:4: '\\\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT */
+ mHEX_DIGIT(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleUNICODE_ESCEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ /* 6864:4: '\\\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT */
+ mHEX_DIGIT(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleUNICODE_ESCEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ /* 6864:4: '\\\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT */
+ mHEX_DIGIT(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleUNICODE_ESCEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ /* 6864:4: '\\\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT */
+ mHEX_DIGIT(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleUNICODE_ESCEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+
+
+ // This is where rules clean up and exit
+ //
+ goto ruleUNICODE_ESCEx; /* Prevent compiler warnings */
+ ruleUNICODE_ESCEx: ;
+
+}
+// $ANTLR end UNICODE_ESC
+
+// Comes from: 6868:2: ( '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' | '/*' ( options {greedy=false; } : . )* '*/' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start COMMENT
+ *
+ * Looks to match the characters the constitute the token COMMENT
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mCOMMENT(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = COMMENT;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6868:2: ( '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' | '/*' ( options {greedy=false; } : . )* '*/' )
+
+ ANTLR3_UINT32 alt49;
+
+ alt49=2;
+
+ switch ( LA(1) )
+ {
+ case '/':
+ {
+ switch ( LA(2) )
+ {
+ case '/':
+ {
+ alt49=1;
+ }
+ break;
+ case '*':
+ {
+ alt49=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 49;
+ EXCEPTION->state = 1;
+
+
+ goto ruleCOMMENTEx;
+
+ }
+
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 49;
+ EXCEPTION->state = 0;
+
+
+ goto ruleCOMMENTEx;
+
+ }
+
+ switch (alt49)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6868:4: '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n'
+ {
+ MATCHS(lit_388);
+ if (HASEXCEPTION())
+ {
+ goto ruleCOMMENTEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6868:9: (~ ( '\\n' | '\\r' ) )*
+
+ for (;;)
+ {
+ int alt46=2;
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA46_0 = LA(1);
+ if ( (((LA46_0 >= 0x0000) && (LA46_0 <= '\t')) || ((LA46_0 >= 0x000B) && (LA46_0 <= '\f')) || ((LA46_0 >= 0x000E) && (LA46_0 <= 0xFFFF))))
+ {
+ alt46=1;
+ }
+
+ }
+ switch (alt46)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:
+ {
+ if ( ((LA(1) >= 0x0000) && (LA(1) <= '\t')) || ((LA(1) >= 0x000B) && (LA(1) <= '\f')) || ((LA(1) >= 0x000E) && (LA(1) <= 0xFFFF)) )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleCOMMENTEx;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop46; /* break out of the loop */
+ break;
+ }
+ }
+ loop46: ; /* Jump out to here if this rule does not match */
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6868:23: ( '\\r' )?
+ {
+ int alt47=2;
+ switch ( LA(1) )
+ {
+ case '\r':
+ {
+ alt47=1;
+ }
+ break;
+ }
+
+ switch (alt47)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6868:23: '\\r'
+ {
+ MATCHC('\r');
+ if (HASEXCEPTION())
+ {
+ goto ruleCOMMENTEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHC('\n');
+ if (HASEXCEPTION())
+ {
+ goto ruleCOMMENTEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ LEXSTATE->channel=HIDDEN;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6869:4: '/*' ( options {greedy=false; } : . )* '*/'
+ {
+ MATCHS(lit_389);
+ if (HASEXCEPTION())
+ {
+ goto ruleCOMMENTEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6869:9: ( options {greedy=false; } : . )*
+
+ for (;;)
+ {
+ int alt48=2;
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA48_0 = LA(1);
+ if ( (LA48_0 == '*'))
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA48_1 = LA(2);
+ if ( (LA48_1 == '/'))
+ {
+ alt48=2;
+ }
+ else if ( (((LA48_1 >= 0x0000) && (LA48_1 <= '.')) || ((LA48_1 >= '0') && (LA48_1 <= 0xFFFF))))
+ {
+ alt48=1;
+ }
+
+ }
+ }
+ else if ( (((LA48_0 >= 0x0000) && (LA48_0 <= ')')) || ((LA48_0 >= '+') && (LA48_0 <= 0xFFFF))))
+ {
+ alt48=1;
+ }
+
+ }
+ switch (alt48)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6869:37: .
+ {
+ MATCHANY();
+ if (HASEXCEPTION())
+ {
+ goto ruleCOMMENTEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop48; /* break out of the loop */
+ break;
+ }
+ }
+ loop48: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHS(lit_390);
+ if (HASEXCEPTION())
+ {
+ goto ruleCOMMENTEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+
+ if ( BACKTRACKING==0 )
+ {
+ LEXSTATE->channel=HIDDEN;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleCOMMENTEx; /* Prevent compiler warnings */
+ ruleCOMMENTEx: ;
+
+}
+// $ANTLR end COMMENT
+
+// Comes from: 6873:2: ( ( ' ' | '\\t' | '\\r' | '\\n' ) )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start WS
+ *
+ * Looks to match the characters the constitute the token WS
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mWS(pfmlLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = WS;
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6873:2: ( ( ' ' | '\\t' | '\\r' | '\\n' ) )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6873:4: ( ' ' | '\\t' | '\\r' | '\\n' )
+ {
+ if ( ((LA(1) >= '\t') && (LA(1) <= '\n')) || LA(1) == '\r' || LA(1) == ' ' )
+ {
+ CONSUME();
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleWSEx;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ LEXSTATE->channel=HIDDEN;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleWSEx; /* Prevent compiler warnings */
+ ruleWSEx: ;
+
+}
+// $ANTLR end WS
+
+/** This is the entry point in to the lexer from an object that
+ * wants to generate the next token, such as a pCOMMON_TOKEN_STREAM
+ */
+static void
+mTokens(pfmlLexer ctx)
+{
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:8: ( T__144 | T__145 | T__146 | T__147 | T__148 | T__149 | T__150 | T__151 | T__152 | T__153 | T__154 | T__155 | T__156 | T__157 | T__158 | T__159 | T__160 | T__161 | T__162 | T__163 | T__164 | T__165 | T__166 | T__167 | T__168 | T__169 | T__170 | T__171 | T__172 | T__173 | T__174 | T__175 | T__176 | T__177 | T__178 | T__179 | T__180 | T__181 | T__182 | T__183 | T__184 | T__185 | T__186 | T__187 | T__188 | T__189 | T__190 | T__191 | T__192 | T__193 | T__194 | T__195 | T__196 | T__197 | T__198 | T__199 | T__200 | T__201 | T__202 | T__203 | T__204 | T__205 | T__206 | T__207 | T__208 | T__209 | T__210 | T__211 | T__212 | T__213 | T__214 | T__215 | T__216 | T__217 | T__218 | T__219 | T__220 | T__221 | T__222 | T__223 | T__224 | T__225 | T__226 | T__227 | T__228 | T__229 | T__230 | T__231 | T__232 | T__233 | T__234 | T__235 | T__236 | T__237 | T__238 | T__239 | T__240 | T__241 | T__242 | T__243 | T__244 | T__245 | T__246 | T__247 | T__248 | T__249 | T__250 | T__251 | T__252 | T__253 | T__254 | T__255 | T__256 | T__257 | T__258 | T__259 | T__260 | T__261 | T__262 | T__263 | T__264 | T__265 | T__266 | T__267 | T__268 | T__269 | T__270 | T__271 | T__272 | T__273 | T__274 | T__275 | T__276 | T__277 | T__278 | T__279 | T__280 | T__281 | T__282 | T__283 | T__284 | T__285 | T__286 | T__287 | T__288 | T__289 | T__290 | T__291 | T__292 | T__293 | T__294 | T__295 | T__296 | T__297 | T__298 | T__299 | T__300 | T__301 | T__302 | T__303 | T__304 | T__305 | T__306 | T__307 | T__308 | T__309 | T__310 | T__311 | T__312 | T__313 | T__314 | T__315 | T__316 | T__317 | T__318 | T__319 | T__320 | T__321 | T__322 | T__323 | T__324 | T__325 | T__326 | T__327 | T__328 | T__329 | T__330 | T__331 | T__332 | T__333 | T__334 | T__335 | T__336 | T__337 | T__338 | T__339 | T__340 | T__341 | T__342 | T__343 | T__344 | T__345 | T__346 | T__347 | T__348 | T__349 | T__350 | T__351 | T__352 | T__353 | T__354 | T__355 | T__356 | T__357 | T__358 | T__359 | T__360 | T__361 | T__362 | T__363 | T__364 | T__365 | T__366 | T__367 | T__368 | T__369 | T__370 | T__371 | T__372 | T__373 | T__374 | T__375 | T__376 | T__377 | T__378 | T__379 | T__380 | T__381 | T__382 | T__383 | T__384 | T__385 | T__386 | T__387 | T__388 | T__389 | T__390 | T__391 | T__392 | T__393 | T__394 | T__395 | T__396 | T__397 | T__398 | T__399 | T__400 | T__401 | T__402 | T__403 | T__404 | T__405 | T__406 | T__407 | T__408 | T__409 | T__410 | T__411 | T__412 | T__413 | T__414 | T__415 | T__416 | T__417 | OP_ATOMIC_SEQUENCE | OP_SEQUENCE | OP_SEQUENCE_SIDE | OP_SEQUENCE_WEAK | OP_SCHEDULE_GT | OP_SCHEDULE_LT | OP_SCHEDULE_XOR | OP_SCHEDULE_AND_THEN | OP_SCHEDULE_OR_ELSE | OP_NON_DETERMINISM | OP_CONCURRENCY_ASYNC | OP_CONCURRENCY_AND | OP_CONCURRENCY_OR | OP_CONCURRENCY_INTERLEAVING | OP_CONCURRENCY_PARALLEL | OP_FORK | OP_JOIN | OP_CONCURRENCY_RDV_ASYNC | OP_CONCURRENCY_RDV_AND | OP_CONCURRENCY_RDV_OR | OP_CONCURRENCY_RDV_INTERLEAVING | OP_CONCURRENCY_RDV_PARALLEL | ASSIGN | ASSIGN_AFTER | ASSIGN_REF | ASSIGN_MACRO | OP_PUSH | OP_ASSIGN_TOP | OP_TOP | OP_POP | LPAREN | RPAREN | LCURLY | RCURLY | LBRACKET | RBRACKET | LBRACKET_EXCEPT | LPAREN_INVOKE | LCURLY_INVOKE | PERCENT_LPAREN_INVOKE | PERCENT_LPAREN | RPAREN_PERCENT | STATEMENT_PROMPT | DOLLAR_LCURLY | RCURLY_DOLLAR | PERCENT_LCURLY | RCURLY_PERCENT | LBRACKET_BAR | BAR_RBRACKET | LBRACKET_LCURLY | RCURLY_RBRACKET | COLON | COMMA | QUESTION | SEMI | DIESE | DOLLAR | DOT | DOTDOT | COLONx2 | LAND | LAND_THEN | LAND_ASSIGN | LAND_ASSIGN_AFTER | LNOT | LOR | LOR_ELSE | LOR_ASSIGN | LOR_ASSIGN_AFTER | LXOR | EQUAL | NEQUAL | SEQUAL | NSEQUAL | LTE | LT_ | GTE | GT | PLUS | PLUS_ASSIGN | PLUS_ASSIGN_AFTER | INCR | MINUS | MINUS_ASSIGN | MINUS_ASSIGN_AFTER | DECR | STAR | STAR_ASSIGN | STAR_ASSIGN_AFTER | DIV | DIV_ASSIGN | DIV_ASSIGN_AFTER | MOD | MOD_ASSIGN | MOD_ASSIGN_AFTER | RSHIFT | RSHIFT_ASSIGN | RSHIFT_ASSIGN_AFTER | LSHIFT | LSHIFT_ASSIGN | LSHIFT_ASSIGN_AFTER | BAND | BAND_ASSIGN | BAND_ASSIGN_AFTER | BNOT | BOR | BOR_ASSIGN | BOR_ASSIGN_AFTER | BXOR | BXOR_ASSIGN | BXOR_ASSIGN_AFTER | ID | AT_ID | StringLiteral | CharLiteral | NumberLiteral | COMMENT | WS )
+
+ ANTLR3_UINT32 alt50;
+
+ alt50=392;
+
+ alt50 = cdfa50.predict(ctx, RECOGNIZER, ISTREAM, &cdfa50);
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+ switch (alt50)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:10: T__144
+ {
+ /* 1:10: T__144 */
+ mT__144(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:17: T__145
+ {
+ /* 1:17: T__145 */
+ mT__145(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:24: T__146
+ {
+ /* 1:24: T__146 */
+ mT__146(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:31: T__147
+ {
+ /* 1:31: T__147 */
+ mT__147(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:38: T__148
+ {
+ /* 1:38: T__148 */
+ mT__148(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:45: T__149
+ {
+ /* 1:45: T__149 */
+ mT__149(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:52: T__150
+ {
+ /* 1:52: T__150 */
+ mT__150(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 8:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:59: T__151
+ {
+ /* 1:59: T__151 */
+ mT__151(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 9:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:66: T__152
+ {
+ /* 1:66: T__152 */
+ mT__152(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 10:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:73: T__153
+ {
+ /* 1:73: T__153 */
+ mT__153(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 11:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:80: T__154
+ {
+ /* 1:80: T__154 */
+ mT__154(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 12:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:87: T__155
+ {
+ /* 1:87: T__155 */
+ mT__155(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 13:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:94: T__156
+ {
+ /* 1:94: T__156 */
+ mT__156(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 14:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:101: T__157
+ {
+ /* 1:101: T__157 */
+ mT__157(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 15:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:108: T__158
+ {
+ /* 1:108: T__158 */
+ mT__158(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 16:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:115: T__159
+ {
+ /* 1:115: T__159 */
+ mT__159(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 17:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:122: T__160
+ {
+ /* 1:122: T__160 */
+ mT__160(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 18:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:129: T__161
+ {
+ /* 1:129: T__161 */
+ mT__161(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 19:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:136: T__162
+ {
+ /* 1:136: T__162 */
+ mT__162(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 20:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:143: T__163
+ {
+ /* 1:143: T__163 */
+ mT__163(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 21:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:150: T__164
+ {
+ /* 1:150: T__164 */
+ mT__164(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 22:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:157: T__165
+ {
+ /* 1:157: T__165 */
+ mT__165(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 23:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:164: T__166
+ {
+ /* 1:164: T__166 */
+ mT__166(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 24:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:171: T__167
+ {
+ /* 1:171: T__167 */
+ mT__167(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 25:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:178: T__168
+ {
+ /* 1:178: T__168 */
+ mT__168(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 26:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:185: T__169
+ {
+ /* 1:185: T__169 */
+ mT__169(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 27:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:192: T__170
+ {
+ /* 1:192: T__170 */
+ mT__170(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 28:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:199: T__171
+ {
+ /* 1:199: T__171 */
+ mT__171(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 29:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:206: T__172
+ {
+ /* 1:206: T__172 */
+ mT__172(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 30:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:213: T__173
+ {
+ /* 1:213: T__173 */
+ mT__173(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 31:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:220: T__174
+ {
+ /* 1:220: T__174 */
+ mT__174(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 32:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:227: T__175
+ {
+ /* 1:227: T__175 */
+ mT__175(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 33:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:234: T__176
+ {
+ /* 1:234: T__176 */
+ mT__176(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 34:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:241: T__177
+ {
+ /* 1:241: T__177 */
+ mT__177(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 35:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:248: T__178
+ {
+ /* 1:248: T__178 */
+ mT__178(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 36:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:255: T__179
+ {
+ /* 1:255: T__179 */
+ mT__179(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 37:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:262: T__180
+ {
+ /* 1:262: T__180 */
+ mT__180(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 38:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:269: T__181
+ {
+ /* 1:269: T__181 */
+ mT__181(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 39:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:276: T__182
+ {
+ /* 1:276: T__182 */
+ mT__182(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 40:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:283: T__183
+ {
+ /* 1:283: T__183 */
+ mT__183(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 41:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:290: T__184
+ {
+ /* 1:290: T__184 */
+ mT__184(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 42:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:297: T__185
+ {
+ /* 1:297: T__185 */
+ mT__185(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 43:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:304: T__186
+ {
+ /* 1:304: T__186 */
+ mT__186(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 44:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:311: T__187
+ {
+ /* 1:311: T__187 */
+ mT__187(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 45:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:318: T__188
+ {
+ /* 1:318: T__188 */
+ mT__188(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 46:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:325: T__189
+ {
+ /* 1:325: T__189 */
+ mT__189(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 47:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:332: T__190
+ {
+ /* 1:332: T__190 */
+ mT__190(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 48:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:339: T__191
+ {
+ /* 1:339: T__191 */
+ mT__191(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 49:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:346: T__192
+ {
+ /* 1:346: T__192 */
+ mT__192(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 50:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:353: T__193
+ {
+ /* 1:353: T__193 */
+ mT__193(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 51:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:360: T__194
+ {
+ /* 1:360: T__194 */
+ mT__194(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 52:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:367: T__195
+ {
+ /* 1:367: T__195 */
+ mT__195(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 53:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:374: T__196
+ {
+ /* 1:374: T__196 */
+ mT__196(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 54:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:381: T__197
+ {
+ /* 1:381: T__197 */
+ mT__197(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 55:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:388: T__198
+ {
+ /* 1:388: T__198 */
+ mT__198(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 56:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:395: T__199
+ {
+ /* 1:395: T__199 */
+ mT__199(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 57:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:402: T__200
+ {
+ /* 1:402: T__200 */
+ mT__200(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 58:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:409: T__201
+ {
+ /* 1:409: T__201 */
+ mT__201(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 59:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:416: T__202
+ {
+ /* 1:416: T__202 */
+ mT__202(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 60:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:423: T__203
+ {
+ /* 1:423: T__203 */
+ mT__203(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 61:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:430: T__204
+ {
+ /* 1:430: T__204 */
+ mT__204(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 62:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:437: T__205
+ {
+ /* 1:437: T__205 */
+ mT__205(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 63:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:444: T__206
+ {
+ /* 1:444: T__206 */
+ mT__206(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 64:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:451: T__207
+ {
+ /* 1:451: T__207 */
+ mT__207(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 65:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:458: T__208
+ {
+ /* 1:458: T__208 */
+ mT__208(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 66:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:465: T__209
+ {
+ /* 1:465: T__209 */
+ mT__209(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 67:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:472: T__210
+ {
+ /* 1:472: T__210 */
+ mT__210(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 68:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:479: T__211
+ {
+ /* 1:479: T__211 */
+ mT__211(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 69:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:486: T__212
+ {
+ /* 1:486: T__212 */
+ mT__212(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 70:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:493: T__213
+ {
+ /* 1:493: T__213 */
+ mT__213(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 71:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:500: T__214
+ {
+ /* 1:500: T__214 */
+ mT__214(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 72:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:507: T__215
+ {
+ /* 1:507: T__215 */
+ mT__215(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 73:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:514: T__216
+ {
+ /* 1:514: T__216 */
+ mT__216(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 74:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:521: T__217
+ {
+ /* 1:521: T__217 */
+ mT__217(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 75:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:528: T__218
+ {
+ /* 1:528: T__218 */
+ mT__218(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 76:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:535: T__219
+ {
+ /* 1:535: T__219 */
+ mT__219(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 77:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:542: T__220
+ {
+ /* 1:542: T__220 */
+ mT__220(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 78:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:549: T__221
+ {
+ /* 1:549: T__221 */
+ mT__221(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 79:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:556: T__222
+ {
+ /* 1:556: T__222 */
+ mT__222(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 80:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:563: T__223
+ {
+ /* 1:563: T__223 */
+ mT__223(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 81:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:570: T__224
+ {
+ /* 1:570: T__224 */
+ mT__224(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 82:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:577: T__225
+ {
+ /* 1:577: T__225 */
+ mT__225(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 83:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:584: T__226
+ {
+ /* 1:584: T__226 */
+ mT__226(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 84:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:591: T__227
+ {
+ /* 1:591: T__227 */
+ mT__227(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 85:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:598: T__228
+ {
+ /* 1:598: T__228 */
+ mT__228(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 86:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:605: T__229
+ {
+ /* 1:605: T__229 */
+ mT__229(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 87:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:612: T__230
+ {
+ /* 1:612: T__230 */
+ mT__230(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 88:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:619: T__231
+ {
+ /* 1:619: T__231 */
+ mT__231(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 89:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:626: T__232
+ {
+ /* 1:626: T__232 */
+ mT__232(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 90:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:633: T__233
+ {
+ /* 1:633: T__233 */
+ mT__233(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 91:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:640: T__234
+ {
+ /* 1:640: T__234 */
+ mT__234(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 92:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:647: T__235
+ {
+ /* 1:647: T__235 */
+ mT__235(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 93:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:654: T__236
+ {
+ /* 1:654: T__236 */
+ mT__236(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 94:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:661: T__237
+ {
+ /* 1:661: T__237 */
+ mT__237(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 95:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:668: T__238
+ {
+ /* 1:668: T__238 */
+ mT__238(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 96:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:675: T__239
+ {
+ /* 1:675: T__239 */
+ mT__239(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 97:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:682: T__240
+ {
+ /* 1:682: T__240 */
+ mT__240(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 98:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:689: T__241
+ {
+ /* 1:689: T__241 */
+ mT__241(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 99:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:696: T__242
+ {
+ /* 1:696: T__242 */
+ mT__242(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 100:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:703: T__243
+ {
+ /* 1:703: T__243 */
+ mT__243(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 101:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:710: T__244
+ {
+ /* 1:710: T__244 */
+ mT__244(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 102:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:717: T__245
+ {
+ /* 1:717: T__245 */
+ mT__245(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 103:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:724: T__246
+ {
+ /* 1:724: T__246 */
+ mT__246(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 104:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:731: T__247
+ {
+ /* 1:731: T__247 */
+ mT__247(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 105:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:738: T__248
+ {
+ /* 1:738: T__248 */
+ mT__248(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 106:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:745: T__249
+ {
+ /* 1:745: T__249 */
+ mT__249(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 107:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:752: T__250
+ {
+ /* 1:752: T__250 */
+ mT__250(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 108:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:759: T__251
+ {
+ /* 1:759: T__251 */
+ mT__251(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 109:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:766: T__252
+ {
+ /* 1:766: T__252 */
+ mT__252(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 110:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:773: T__253
+ {
+ /* 1:773: T__253 */
+ mT__253(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 111:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:780: T__254
+ {
+ /* 1:780: T__254 */
+ mT__254(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 112:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:787: T__255
+ {
+ /* 1:787: T__255 */
+ mT__255(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 113:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:794: T__256
+ {
+ /* 1:794: T__256 */
+ mT__256(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 114:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:801: T__257
+ {
+ /* 1:801: T__257 */
+ mT__257(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 115:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:808: T__258
+ {
+ /* 1:808: T__258 */
+ mT__258(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 116:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:815: T__259
+ {
+ /* 1:815: T__259 */
+ mT__259(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 117:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:822: T__260
+ {
+ /* 1:822: T__260 */
+ mT__260(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 118:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:829: T__261
+ {
+ /* 1:829: T__261 */
+ mT__261(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 119:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:836: T__262
+ {
+ /* 1:836: T__262 */
+ mT__262(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 120:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:843: T__263
+ {
+ /* 1:843: T__263 */
+ mT__263(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 121:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:850: T__264
+ {
+ /* 1:850: T__264 */
+ mT__264(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 122:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:857: T__265
+ {
+ /* 1:857: T__265 */
+ mT__265(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 123:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:864: T__266
+ {
+ /* 1:864: T__266 */
+ mT__266(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 124:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:871: T__267
+ {
+ /* 1:871: T__267 */
+ mT__267(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 125:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:878: T__268
+ {
+ /* 1:878: T__268 */
+ mT__268(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 126:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:885: T__269
+ {
+ /* 1:885: T__269 */
+ mT__269(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 127:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:892: T__270
+ {
+ /* 1:892: T__270 */
+ mT__270(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 128:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:899: T__271
+ {
+ /* 1:899: T__271 */
+ mT__271(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 129:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:906: T__272
+ {
+ /* 1:906: T__272 */
+ mT__272(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 130:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:913: T__273
+ {
+ /* 1:913: T__273 */
+ mT__273(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 131:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:920: T__274
+ {
+ /* 1:920: T__274 */
+ mT__274(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 132:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:927: T__275
+ {
+ /* 1:927: T__275 */
+ mT__275(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 133:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:934: T__276
+ {
+ /* 1:934: T__276 */
+ mT__276(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 134:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:941: T__277
+ {
+ /* 1:941: T__277 */
+ mT__277(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 135:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:948: T__278
+ {
+ /* 1:948: T__278 */
+ mT__278(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 136:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:955: T__279
+ {
+ /* 1:955: T__279 */
+ mT__279(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 137:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:962: T__280
+ {
+ /* 1:962: T__280 */
+ mT__280(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 138:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:969: T__281
+ {
+ /* 1:969: T__281 */
+ mT__281(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 139:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:976: T__282
+ {
+ /* 1:976: T__282 */
+ mT__282(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 140:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:983: T__283
+ {
+ /* 1:983: T__283 */
+ mT__283(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 141:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:990: T__284
+ {
+ /* 1:990: T__284 */
+ mT__284(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 142:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:997: T__285
+ {
+ /* 1:997: T__285 */
+ mT__285(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 143:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1004: T__286
+ {
+ /* 1:1004: T__286 */
+ mT__286(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 144:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1011: T__287
+ {
+ /* 1:1011: T__287 */
+ mT__287(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 145:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1018: T__288
+ {
+ /* 1:1018: T__288 */
+ mT__288(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 146:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1025: T__289
+ {
+ /* 1:1025: T__289 */
+ mT__289(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 147:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1032: T__290
+ {
+ /* 1:1032: T__290 */
+ mT__290(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 148:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1039: T__291
+ {
+ /* 1:1039: T__291 */
+ mT__291(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 149:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1046: T__292
+ {
+ /* 1:1046: T__292 */
+ mT__292(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 150:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1053: T__293
+ {
+ /* 1:1053: T__293 */
+ mT__293(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 151:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1060: T__294
+ {
+ /* 1:1060: T__294 */
+ mT__294(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 152:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1067: T__295
+ {
+ /* 1:1067: T__295 */
+ mT__295(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 153:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1074: T__296
+ {
+ /* 1:1074: T__296 */
+ mT__296(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 154:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1081: T__297
+ {
+ /* 1:1081: T__297 */
+ mT__297(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 155:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1088: T__298
+ {
+ /* 1:1088: T__298 */
+ mT__298(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 156:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1095: T__299
+ {
+ /* 1:1095: T__299 */
+ mT__299(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 157:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1102: T__300
+ {
+ /* 1:1102: T__300 */
+ mT__300(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 158:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1109: T__301
+ {
+ /* 1:1109: T__301 */
+ mT__301(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 159:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1116: T__302
+ {
+ /* 1:1116: T__302 */
+ mT__302(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 160:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1123: T__303
+ {
+ /* 1:1123: T__303 */
+ mT__303(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 161:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1130: T__304
+ {
+ /* 1:1130: T__304 */
+ mT__304(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 162:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1137: T__305
+ {
+ /* 1:1137: T__305 */
+ mT__305(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 163:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1144: T__306
+ {
+ /* 1:1144: T__306 */
+ mT__306(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 164:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1151: T__307
+ {
+ /* 1:1151: T__307 */
+ mT__307(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 165:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1158: T__308
+ {
+ /* 1:1158: T__308 */
+ mT__308(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 166:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1165: T__309
+ {
+ /* 1:1165: T__309 */
+ mT__309(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 167:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1172: T__310
+ {
+ /* 1:1172: T__310 */
+ mT__310(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 168:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1179: T__311
+ {
+ /* 1:1179: T__311 */
+ mT__311(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 169:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1186: T__312
+ {
+ /* 1:1186: T__312 */
+ mT__312(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 170:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1193: T__313
+ {
+ /* 1:1193: T__313 */
+ mT__313(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 171:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1200: T__314
+ {
+ /* 1:1200: T__314 */
+ mT__314(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 172:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1207: T__315
+ {
+ /* 1:1207: T__315 */
+ mT__315(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 173:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1214: T__316
+ {
+ /* 1:1214: T__316 */
+ mT__316(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 174:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1221: T__317
+ {
+ /* 1:1221: T__317 */
+ mT__317(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 175:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1228: T__318
+ {
+ /* 1:1228: T__318 */
+ mT__318(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 176:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1235: T__319
+ {
+ /* 1:1235: T__319 */
+ mT__319(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 177:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1242: T__320
+ {
+ /* 1:1242: T__320 */
+ mT__320(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 178:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1249: T__321
+ {
+ /* 1:1249: T__321 */
+ mT__321(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 179:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1256: T__322
+ {
+ /* 1:1256: T__322 */
+ mT__322(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 180:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1263: T__323
+ {
+ /* 1:1263: T__323 */
+ mT__323(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 181:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1270: T__324
+ {
+ /* 1:1270: T__324 */
+ mT__324(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 182:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1277: T__325
+ {
+ /* 1:1277: T__325 */
+ mT__325(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 183:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1284: T__326
+ {
+ /* 1:1284: T__326 */
+ mT__326(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 184:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1291: T__327
+ {
+ /* 1:1291: T__327 */
+ mT__327(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 185:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1298: T__328
+ {
+ /* 1:1298: T__328 */
+ mT__328(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 186:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1305: T__329
+ {
+ /* 1:1305: T__329 */
+ mT__329(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 187:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1312: T__330
+ {
+ /* 1:1312: T__330 */
+ mT__330(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 188:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1319: T__331
+ {
+ /* 1:1319: T__331 */
+ mT__331(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 189:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1326: T__332
+ {
+ /* 1:1326: T__332 */
+ mT__332(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 190:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1333: T__333
+ {
+ /* 1:1333: T__333 */
+ mT__333(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 191:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1340: T__334
+ {
+ /* 1:1340: T__334 */
+ mT__334(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 192:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1347: T__335
+ {
+ /* 1:1347: T__335 */
+ mT__335(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 193:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1354: T__336
+ {
+ /* 1:1354: T__336 */
+ mT__336(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 194:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1361: T__337
+ {
+ /* 1:1361: T__337 */
+ mT__337(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 195:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1368: T__338
+ {
+ /* 1:1368: T__338 */
+ mT__338(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 196:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1375: T__339
+ {
+ /* 1:1375: T__339 */
+ mT__339(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 197:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1382: T__340
+ {
+ /* 1:1382: T__340 */
+ mT__340(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 198:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1389: T__341
+ {
+ /* 1:1389: T__341 */
+ mT__341(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 199:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1396: T__342
+ {
+ /* 1:1396: T__342 */
+ mT__342(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 200:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1403: T__343
+ {
+ /* 1:1403: T__343 */
+ mT__343(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 201:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1410: T__344
+ {
+ /* 1:1410: T__344 */
+ mT__344(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 202:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1417: T__345
+ {
+ /* 1:1417: T__345 */
+ mT__345(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 203:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1424: T__346
+ {
+ /* 1:1424: T__346 */
+ mT__346(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 204:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1431: T__347
+ {
+ /* 1:1431: T__347 */
+ mT__347(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 205:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1438: T__348
+ {
+ /* 1:1438: T__348 */
+ mT__348(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 206:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1445: T__349
+ {
+ /* 1:1445: T__349 */
+ mT__349(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 207:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1452: T__350
+ {
+ /* 1:1452: T__350 */
+ mT__350(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 208:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1459: T__351
+ {
+ /* 1:1459: T__351 */
+ mT__351(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 209:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1466: T__352
+ {
+ /* 1:1466: T__352 */
+ mT__352(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 210:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1473: T__353
+ {
+ /* 1:1473: T__353 */
+ mT__353(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 211:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1480: T__354
+ {
+ /* 1:1480: T__354 */
+ mT__354(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 212:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1487: T__355
+ {
+ /* 1:1487: T__355 */
+ mT__355(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 213:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1494: T__356
+ {
+ /* 1:1494: T__356 */
+ mT__356(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 214:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1501: T__357
+ {
+ /* 1:1501: T__357 */
+ mT__357(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 215:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1508: T__358
+ {
+ /* 1:1508: T__358 */
+ mT__358(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 216:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1515: T__359
+ {
+ /* 1:1515: T__359 */
+ mT__359(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 217:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1522: T__360
+ {
+ /* 1:1522: T__360 */
+ mT__360(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 218:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1529: T__361
+ {
+ /* 1:1529: T__361 */
+ mT__361(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 219:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1536: T__362
+ {
+ /* 1:1536: T__362 */
+ mT__362(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 220:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1543: T__363
+ {
+ /* 1:1543: T__363 */
+ mT__363(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 221:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1550: T__364
+ {
+ /* 1:1550: T__364 */
+ mT__364(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 222:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1557: T__365
+ {
+ /* 1:1557: T__365 */
+ mT__365(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 223:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1564: T__366
+ {
+ /* 1:1564: T__366 */
+ mT__366(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 224:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1571: T__367
+ {
+ /* 1:1571: T__367 */
+ mT__367(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 225:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1578: T__368
+ {
+ /* 1:1578: T__368 */
+ mT__368(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 226:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1585: T__369
+ {
+ /* 1:1585: T__369 */
+ mT__369(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 227:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1592: T__370
+ {
+ /* 1:1592: T__370 */
+ mT__370(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 228:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1599: T__371
+ {
+ /* 1:1599: T__371 */
+ mT__371(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 229:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1606: T__372
+ {
+ /* 1:1606: T__372 */
+ mT__372(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 230:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1613: T__373
+ {
+ /* 1:1613: T__373 */
+ mT__373(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 231:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1620: T__374
+ {
+ /* 1:1620: T__374 */
+ mT__374(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 232:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1627: T__375
+ {
+ /* 1:1627: T__375 */
+ mT__375(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 233:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1634: T__376
+ {
+ /* 1:1634: T__376 */
+ mT__376(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 234:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1641: T__377
+ {
+ /* 1:1641: T__377 */
+ mT__377(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 235:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1648: T__378
+ {
+ /* 1:1648: T__378 */
+ mT__378(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 236:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1655: T__379
+ {
+ /* 1:1655: T__379 */
+ mT__379(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 237:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1662: T__380
+ {
+ /* 1:1662: T__380 */
+ mT__380(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 238:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1669: T__381
+ {
+ /* 1:1669: T__381 */
+ mT__381(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 239:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1676: T__382
+ {
+ /* 1:1676: T__382 */
+ mT__382(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 240:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1683: T__383
+ {
+ /* 1:1683: T__383 */
+ mT__383(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 241:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1690: T__384
+ {
+ /* 1:1690: T__384 */
+ mT__384(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 242:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1697: T__385
+ {
+ /* 1:1697: T__385 */
+ mT__385(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 243:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1704: T__386
+ {
+ /* 1:1704: T__386 */
+ mT__386(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 244:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1711: T__387
+ {
+ /* 1:1711: T__387 */
+ mT__387(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 245:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1718: T__388
+ {
+ /* 1:1718: T__388 */
+ mT__388(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 246:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1725: T__389
+ {
+ /* 1:1725: T__389 */
+ mT__389(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 247:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1732: T__390
+ {
+ /* 1:1732: T__390 */
+ mT__390(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 248:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1739: T__391
+ {
+ /* 1:1739: T__391 */
+ mT__391(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 249:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1746: T__392
+ {
+ /* 1:1746: T__392 */
+ mT__392(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 250:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1753: T__393
+ {
+ /* 1:1753: T__393 */
+ mT__393(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 251:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1760: T__394
+ {
+ /* 1:1760: T__394 */
+ mT__394(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 252:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1767: T__395
+ {
+ /* 1:1767: T__395 */
+ mT__395(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 253:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1774: T__396
+ {
+ /* 1:1774: T__396 */
+ mT__396(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 254:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1781: T__397
+ {
+ /* 1:1781: T__397 */
+ mT__397(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 255:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1788: T__398
+ {
+ /* 1:1788: T__398 */
+ mT__398(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 256:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1795: T__399
+ {
+ /* 1:1795: T__399 */
+ mT__399(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 257:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1802: T__400
+ {
+ /* 1:1802: T__400 */
+ mT__400(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 258:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1809: T__401
+ {
+ /* 1:1809: T__401 */
+ mT__401(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 259:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1816: T__402
+ {
+ /* 1:1816: T__402 */
+ mT__402(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 260:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1823: T__403
+ {
+ /* 1:1823: T__403 */
+ mT__403(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 261:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1830: T__404
+ {
+ /* 1:1830: T__404 */
+ mT__404(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 262:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1837: T__405
+ {
+ /* 1:1837: T__405 */
+ mT__405(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 263:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1844: T__406
+ {
+ /* 1:1844: T__406 */
+ mT__406(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 264:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1851: T__407
+ {
+ /* 1:1851: T__407 */
+ mT__407(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 265:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1858: T__408
+ {
+ /* 1:1858: T__408 */
+ mT__408(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 266:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1865: T__409
+ {
+ /* 1:1865: T__409 */
+ mT__409(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 267:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1872: T__410
+ {
+ /* 1:1872: T__410 */
+ mT__410(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 268:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1879: T__411
+ {
+ /* 1:1879: T__411 */
+ mT__411(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 269:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1886: T__412
+ {
+ /* 1:1886: T__412 */
+ mT__412(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 270:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1893: T__413
+ {
+ /* 1:1893: T__413 */
+ mT__413(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 271:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1900: T__414
+ {
+ /* 1:1900: T__414 */
+ mT__414(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 272:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1907: T__415
+ {
+ /* 1:1907: T__415 */
+ mT__415(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 273:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1914: T__416
+ {
+ /* 1:1914: T__416 */
+ mT__416(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 274:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1921: T__417
+ {
+ /* 1:1921: T__417 */
+ mT__417(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 275:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1928: OP_ATOMIC_SEQUENCE
+ {
+ /* 1:1928: OP_ATOMIC_SEQUENCE */
+ mOP_ATOMIC_SEQUENCE(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 276:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1947: OP_SEQUENCE
+ {
+ /* 1:1947: OP_SEQUENCE */
+ mOP_SEQUENCE(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 277:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1959: OP_SEQUENCE_SIDE
+ {
+ /* 1:1959: OP_SEQUENCE_SIDE */
+ mOP_SEQUENCE_SIDE(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 278:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1976: OP_SEQUENCE_WEAK
+ {
+ /* 1:1976: OP_SEQUENCE_WEAK */
+ mOP_SEQUENCE_WEAK(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 279:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:1993: OP_SCHEDULE_GT
+ {
+ /* 1:1993: OP_SCHEDULE_GT */
+ mOP_SCHEDULE_GT(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 280:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2008: OP_SCHEDULE_LT
+ {
+ /* 1:2008: OP_SCHEDULE_LT */
+ mOP_SCHEDULE_LT(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 281:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2023: OP_SCHEDULE_XOR
+ {
+ /* 1:2023: OP_SCHEDULE_XOR */
+ mOP_SCHEDULE_XOR(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 282:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2039: OP_SCHEDULE_AND_THEN
+ {
+ /* 1:2039: OP_SCHEDULE_AND_THEN */
+ mOP_SCHEDULE_AND_THEN(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 283:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2060: OP_SCHEDULE_OR_ELSE
+ {
+ /* 1:2060: OP_SCHEDULE_OR_ELSE */
+ mOP_SCHEDULE_OR_ELSE(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 284:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2080: OP_NON_DETERMINISM
+ {
+ /* 1:2080: OP_NON_DETERMINISM */
+ mOP_NON_DETERMINISM(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 285:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2099: OP_CONCURRENCY_ASYNC
+ {
+ /* 1:2099: OP_CONCURRENCY_ASYNC */
+ mOP_CONCURRENCY_ASYNC(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 286:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2120: OP_CONCURRENCY_AND
+ {
+ /* 1:2120: OP_CONCURRENCY_AND */
+ mOP_CONCURRENCY_AND(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 287:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2139: OP_CONCURRENCY_OR
+ {
+ /* 1:2139: OP_CONCURRENCY_OR */
+ mOP_CONCURRENCY_OR(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 288:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2157: OP_CONCURRENCY_INTERLEAVING
+ {
+ /* 1:2157: OP_CONCURRENCY_INTERLEAVING */
+ mOP_CONCURRENCY_INTERLEAVING(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 289:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2185: OP_CONCURRENCY_PARALLEL
+ {
+ /* 1:2185: OP_CONCURRENCY_PARALLEL */
+ mOP_CONCURRENCY_PARALLEL(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 290:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2209: OP_FORK
+ {
+ /* 1:2209: OP_FORK */
+ mOP_FORK(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 291:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2217: OP_JOIN
+ {
+ /* 1:2217: OP_JOIN */
+ mOP_JOIN(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 292:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2225: OP_CONCURRENCY_RDV_ASYNC
+ {
+ /* 1:2225: OP_CONCURRENCY_RDV_ASYNC */
+ mOP_CONCURRENCY_RDV_ASYNC(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 293:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2250: OP_CONCURRENCY_RDV_AND
+ {
+ /* 1:2250: OP_CONCURRENCY_RDV_AND */
+ mOP_CONCURRENCY_RDV_AND(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 294:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2273: OP_CONCURRENCY_RDV_OR
+ {
+ /* 1:2273: OP_CONCURRENCY_RDV_OR */
+ mOP_CONCURRENCY_RDV_OR(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 295:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2295: OP_CONCURRENCY_RDV_INTERLEAVING
+ {
+ /* 1:2295: OP_CONCURRENCY_RDV_INTERLEAVING */
+ mOP_CONCURRENCY_RDV_INTERLEAVING(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 296:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2327: OP_CONCURRENCY_RDV_PARALLEL
+ {
+ /* 1:2327: OP_CONCURRENCY_RDV_PARALLEL */
+ mOP_CONCURRENCY_RDV_PARALLEL(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 297:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2355: ASSIGN
+ {
+ /* 1:2355: ASSIGN */
+ mASSIGN(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 298:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2362: ASSIGN_AFTER
+ {
+ /* 1:2362: ASSIGN_AFTER */
+ mASSIGN_AFTER(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 299:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2375: ASSIGN_REF
+ {
+ /* 1:2375: ASSIGN_REF */
+ mASSIGN_REF(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 300:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2386: ASSIGN_MACRO
+ {
+ /* 1:2386: ASSIGN_MACRO */
+ mASSIGN_MACRO(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 301:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2399: OP_PUSH
+ {
+ /* 1:2399: OP_PUSH */
+ mOP_PUSH(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 302:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2407: OP_ASSIGN_TOP
+ {
+ /* 1:2407: OP_ASSIGN_TOP */
+ mOP_ASSIGN_TOP(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 303:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2421: OP_TOP
+ {
+ /* 1:2421: OP_TOP */
+ mOP_TOP(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 304:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2428: OP_POP
+ {
+ /* 1:2428: OP_POP */
+ mOP_POP(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 305:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2435: LPAREN
+ {
+ /* 1:2435: LPAREN */
+ mLPAREN(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 306:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2442: RPAREN
+ {
+ /* 1:2442: RPAREN */
+ mRPAREN(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 307:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2449: LCURLY
+ {
+ /* 1:2449: LCURLY */
+ mLCURLY(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 308:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2456: RCURLY
+ {
+ /* 1:2456: RCURLY */
+ mRCURLY(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 309:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2463: LBRACKET
+ {
+ /* 1:2463: LBRACKET */
+ mLBRACKET(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 310:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2472: RBRACKET
+ {
+ /* 1:2472: RBRACKET */
+ mRBRACKET(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 311:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2481: LBRACKET_EXCEPT
+ {
+ /* 1:2481: LBRACKET_EXCEPT */
+ mLBRACKET_EXCEPT(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 312:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2497: LPAREN_INVOKE
+ {
+ /* 1:2497: LPAREN_INVOKE */
+ mLPAREN_INVOKE(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 313:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2511: LCURLY_INVOKE
+ {
+ /* 1:2511: LCURLY_INVOKE */
+ mLCURLY_INVOKE(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 314:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2525: PERCENT_LPAREN_INVOKE
+ {
+ /* 1:2525: PERCENT_LPAREN_INVOKE */
+ mPERCENT_LPAREN_INVOKE(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 315:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2547: PERCENT_LPAREN
+ {
+ /* 1:2547: PERCENT_LPAREN */
+ mPERCENT_LPAREN(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 316:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2562: RPAREN_PERCENT
+ {
+ /* 1:2562: RPAREN_PERCENT */
+ mRPAREN_PERCENT(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 317:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2577: STATEMENT_PROMPT
+ {
+ /* 1:2577: STATEMENT_PROMPT */
+ mSTATEMENT_PROMPT(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 318:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2594: DOLLAR_LCURLY
+ {
+ /* 1:2594: DOLLAR_LCURLY */
+ mDOLLAR_LCURLY(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 319:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2608: RCURLY_DOLLAR
+ {
+ /* 1:2608: RCURLY_DOLLAR */
+ mRCURLY_DOLLAR(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 320:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2622: PERCENT_LCURLY
+ {
+ /* 1:2622: PERCENT_LCURLY */
+ mPERCENT_LCURLY(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 321:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2637: RCURLY_PERCENT
+ {
+ /* 1:2637: RCURLY_PERCENT */
+ mRCURLY_PERCENT(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 322:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2652: LBRACKET_BAR
+ {
+ /* 1:2652: LBRACKET_BAR */
+ mLBRACKET_BAR(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 323:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2665: BAR_RBRACKET
+ {
+ /* 1:2665: BAR_RBRACKET */
+ mBAR_RBRACKET(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 324:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2678: LBRACKET_LCURLY
+ {
+ /* 1:2678: LBRACKET_LCURLY */
+ mLBRACKET_LCURLY(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 325:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2694: RCURLY_RBRACKET
+ {
+ /* 1:2694: RCURLY_RBRACKET */
+ mRCURLY_RBRACKET(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 326:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2710: COLON
+ {
+ /* 1:2710: COLON */
+ mCOLON(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 327:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2716: COMMA
+ {
+ /* 1:2716: COMMA */
+ mCOMMA(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 328:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2722: QUESTION
+ {
+ /* 1:2722: QUESTION */
+ mQUESTION(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 329:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2731: SEMI
+ {
+ /* 1:2731: SEMI */
+ mSEMI(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 330:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2736: DIESE
+ {
+ /* 1:2736: DIESE */
+ mDIESE(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 331:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2742: DOLLAR
+ {
+ /* 1:2742: DOLLAR */
+ mDOLLAR(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 332:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2749: DOT
+ {
+ /* 1:2749: DOT */
+ mDOT(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 333:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2753: DOTDOT
+ {
+ /* 1:2753: DOTDOT */
+ mDOTDOT(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 334:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2760: COLONx2
+ {
+ /* 1:2760: COLONx2 */
+ mCOLONx2(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 335:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2768: LAND
+ {
+ /* 1:2768: LAND */
+ mLAND(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 336:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2773: LAND_THEN
+ {
+ /* 1:2773: LAND_THEN */
+ mLAND_THEN(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 337:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2783: LAND_ASSIGN
+ {
+ /* 1:2783: LAND_ASSIGN */
+ mLAND_ASSIGN(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 338:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2795: LAND_ASSIGN_AFTER
+ {
+ /* 1:2795: LAND_ASSIGN_AFTER */
+ mLAND_ASSIGN_AFTER(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 339:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2813: LNOT
+ {
+ /* 1:2813: LNOT */
+ mLNOT(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 340:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2818: LOR
+ {
+ /* 1:2818: LOR */
+ mLOR(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 341:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2822: LOR_ELSE
+ {
+ /* 1:2822: LOR_ELSE */
+ mLOR_ELSE(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 342:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2831: LOR_ASSIGN
+ {
+ /* 1:2831: LOR_ASSIGN */
+ mLOR_ASSIGN(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 343:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2842: LOR_ASSIGN_AFTER
+ {
+ /* 1:2842: LOR_ASSIGN_AFTER */
+ mLOR_ASSIGN_AFTER(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 344:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2859: LXOR
+ {
+ /* 1:2859: LXOR */
+ mLXOR(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 345:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2864: EQUAL
+ {
+ /* 1:2864: EQUAL */
+ mEQUAL(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 346:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2870: NEQUAL
+ {
+ /* 1:2870: NEQUAL */
+ mNEQUAL(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 347:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2877: SEQUAL
+ {
+ /* 1:2877: SEQUAL */
+ mSEQUAL(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 348:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2884: NSEQUAL
+ {
+ /* 1:2884: NSEQUAL */
+ mNSEQUAL(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 349:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2892: LTE
+ {
+ /* 1:2892: LTE */
+ mLTE(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 350:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2896: LT_
+ {
+ /* 1:2896: LT_ */
+ mLT_(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 351:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2900: GTE
+ {
+ /* 1:2900: GTE */
+ mGTE(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 352:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2904: GT
+ {
+ /* 1:2904: GT */
+ mGT(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 353:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2907: PLUS
+ {
+ /* 1:2907: PLUS */
+ mPLUS(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 354:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2912: PLUS_ASSIGN
+ {
+ /* 1:2912: PLUS_ASSIGN */
+ mPLUS_ASSIGN(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 355:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2924: PLUS_ASSIGN_AFTER
+ {
+ /* 1:2924: PLUS_ASSIGN_AFTER */
+ mPLUS_ASSIGN_AFTER(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 356:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2942: INCR
+ {
+ /* 1:2942: INCR */
+ mINCR(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 357:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2947: MINUS
+ {
+ /* 1:2947: MINUS */
+ mMINUS(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 358:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2953: MINUS_ASSIGN
+ {
+ /* 1:2953: MINUS_ASSIGN */
+ mMINUS_ASSIGN(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 359:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2966: MINUS_ASSIGN_AFTER
+ {
+ /* 1:2966: MINUS_ASSIGN_AFTER */
+ mMINUS_ASSIGN_AFTER(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 360:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2985: DECR
+ {
+ /* 1:2985: DECR */
+ mDECR(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 361:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2990: STAR
+ {
+ /* 1:2990: STAR */
+ mSTAR(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 362:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:2995: STAR_ASSIGN
+ {
+ /* 1:2995: STAR_ASSIGN */
+ mSTAR_ASSIGN(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 363:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3007: STAR_ASSIGN_AFTER
+ {
+ /* 1:3007: STAR_ASSIGN_AFTER */
+ mSTAR_ASSIGN_AFTER(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 364:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3025: DIV
+ {
+ /* 1:3025: DIV */
+ mDIV(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 365:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3029: DIV_ASSIGN
+ {
+ /* 1:3029: DIV_ASSIGN */
+ mDIV_ASSIGN(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 366:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3040: DIV_ASSIGN_AFTER
+ {
+ /* 1:3040: DIV_ASSIGN_AFTER */
+ mDIV_ASSIGN_AFTER(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 367:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3057: MOD
+ {
+ /* 1:3057: MOD */
+ mMOD(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 368:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3061: MOD_ASSIGN
+ {
+ /* 1:3061: MOD_ASSIGN */
+ mMOD_ASSIGN(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 369:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3072: MOD_ASSIGN_AFTER
+ {
+ /* 1:3072: MOD_ASSIGN_AFTER */
+ mMOD_ASSIGN_AFTER(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 370:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3089: RSHIFT
+ {
+ /* 1:3089: RSHIFT */
+ mRSHIFT(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 371:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3096: RSHIFT_ASSIGN
+ {
+ /* 1:3096: RSHIFT_ASSIGN */
+ mRSHIFT_ASSIGN(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 372:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3110: RSHIFT_ASSIGN_AFTER
+ {
+ /* 1:3110: RSHIFT_ASSIGN_AFTER */
+ mRSHIFT_ASSIGN_AFTER(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 373:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3130: LSHIFT
+ {
+ /* 1:3130: LSHIFT */
+ mLSHIFT(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 374:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3137: LSHIFT_ASSIGN
+ {
+ /* 1:3137: LSHIFT_ASSIGN */
+ mLSHIFT_ASSIGN(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 375:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3151: LSHIFT_ASSIGN_AFTER
+ {
+ /* 1:3151: LSHIFT_ASSIGN_AFTER */
+ mLSHIFT_ASSIGN_AFTER(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 376:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3171: BAND
+ {
+ /* 1:3171: BAND */
+ mBAND(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 377:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3176: BAND_ASSIGN
+ {
+ /* 1:3176: BAND_ASSIGN */
+ mBAND_ASSIGN(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 378:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3188: BAND_ASSIGN_AFTER
+ {
+ /* 1:3188: BAND_ASSIGN_AFTER */
+ mBAND_ASSIGN_AFTER(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 379:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3206: BNOT
+ {
+ /* 1:3206: BNOT */
+ mBNOT(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 380:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3211: BOR
+ {
+ /* 1:3211: BOR */
+ mBOR(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 381:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3215: BOR_ASSIGN
+ {
+ /* 1:3215: BOR_ASSIGN */
+ mBOR_ASSIGN(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 382:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3226: BOR_ASSIGN_AFTER
+ {
+ /* 1:3226: BOR_ASSIGN_AFTER */
+ mBOR_ASSIGN_AFTER(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 383:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3243: BXOR
+ {
+ /* 1:3243: BXOR */
+ mBXOR(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 384:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3248: BXOR_ASSIGN
+ {
+ /* 1:3248: BXOR_ASSIGN */
+ mBXOR_ASSIGN(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 385:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3260: BXOR_ASSIGN_AFTER
+ {
+ /* 1:3260: BXOR_ASSIGN_AFTER */
+ mBXOR_ASSIGN_AFTER(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 386:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3278: ID
+ {
+ /* 1:3278: ID */
+ mID(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 387:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3281: AT_ID
+ {
+ /* 1:3281: AT_ID */
+ mAT_ID(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 388:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3287: StringLiteral
+ {
+ /* 1:3287: StringLiteral */
+ mStringLiteral(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 389:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3301: CharLiteral
+ {
+ /* 1:3301: CharLiteral */
+ mCharLiteral(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 390:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3313: NumberLiteral
+ {
+ /* 1:3313: NumberLiteral */
+ mNumberLiteral(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 391:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3327: COMMENT
+ {
+ /* 1:3327: COMMENT */
+ mCOMMENT(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+ case 392:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1:3335: WS
+ {
+ /* 1:3335: WS */
+ mWS(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+ break;
+
+ }
+ }
+
+
+ goto ruleTokensEx; /* Prevent compiler warnings */
+ruleTokensEx: ;
+}
+
+// $ANTLR start synpred1_fml
+static void synpred1_fml_fragment(pfmlLexer ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6795:4: ( IntegerLiteral DOTDOT )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6795:6: IntegerLiteral DOTDOT
+ {
+ /* 6795:6: IntegerLiteral DOTDOT */
+ mIntegerLiteral(ctx );
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred1_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ /* 6795:6: IntegerLiteral DOTDOT */
+ mDOTDOT(ctx );
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred1_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred1_fmlEx; /* Prevent compiler warnings */
+rulesynpred1_fmlEx: ;
+
+}
+// $ANTLR end synpred1_fml
+
+// $ANTLR start synpred2_fml
+static void synpred2_fml_fragment(pfmlLexer ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6797:4: ( FloatLiteral )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6797:6: FloatLiteral
+ {
+ /* 6797:6: FloatLiteral */
+ mFloatLiteral(ctx );
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred2_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred2_fmlEx; /* Prevent compiler warnings */
+rulesynpred2_fmlEx: ;
+
+}
+// $ANTLR end synpred2_fml
+
+/* =========================================================================
+ * Lexer matching rules end.
+ * =========================================================================
+ */
+
+/* =========================================================================
+ * Lexer syntactic predicates
+ */
+static ANTLR3_BOOLEAN synpred1_fml(pfmlLexer ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred1_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred2_fml(pfmlLexer ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred2_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+
+/* =========================================================================
+ * Lexer syntactic predicates end.
+ * =========================================================================
+ */
+
+/* End of Lexer code
+ * ================================================
+ * ================================================
+ */
+
+
+/* End of code
+ * =============================================================================
+ */
diff --git a/org.eclipse.efm.symbex/src/parser/model/fmlLexer.h b/org.eclipse.efm.symbex/src/parser/model/fmlLexer.h
new file mode 100644
index 0000000..3a99dd9
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/parser/model/fmlLexer.h
@@ -0,0 +1,3091 @@
+/** \file
+ * This C header file was generated by $ANTLR version 3.4
+ *
+ * - From the grammar source file : /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g
+ * - On : 2017-05-30 09:21:53
+ * - for the lexer : fmlLexerLexer
+ *
+ * Editing it, at least manually, is not wise.
+ *
+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
+ *
+ *
+ * The lexer
+fmlLexer
+
+has the callable functions (rules) shown below,
+ * which will invoke the code for the associated rule in the source grammar
+ * assuming that the input stream is pointing to a token/text stream that could begin
+ * this rule.
+ *
+ * For instance if you call the first (topmost) rule in a parser grammar, you will
+ * get the results of a full parse, but calling a rule half way through the grammar will
+ * allow you to pass part of a full token stream to the parser, such as for syntax checking
+ * in editors and so on.
+ *
+ * The parser entry points are called indirectly (by function pointer to function) via
+ * a parser context typedef pfmlLexer, which is returned from a call to fmlLexerNew().
+ *
+ * As this is a generated lexer, it is unlikely you will call it 'manually'. However
+ * the methods are provided anyway.
+ *
+ * The methods in pfmlLexer are as follows:
+ *
+ * -
+ void
+ pfmlLexer->T__144(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__145(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__146(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__147(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__148(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__149(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__150(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__151(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__152(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__153(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__154(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__155(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__156(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__157(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__158(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__159(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__160(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__161(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__162(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__163(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__164(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__165(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__166(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__167(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__168(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__169(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__170(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__171(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__172(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__173(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__174(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__175(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__176(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__177(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__178(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__179(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__180(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__181(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__182(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__183(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__184(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__185(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__186(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__187(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__188(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__189(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__190(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__191(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__192(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__193(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__194(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__195(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__196(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__197(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__198(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__199(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__200(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__201(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__202(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__203(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__204(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__205(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__206(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__207(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__208(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__209(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__210(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__211(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__212(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__213(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__214(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__215(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__216(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__217(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__218(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__219(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__220(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__221(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__222(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__223(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__224(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__225(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__226(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__227(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__228(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__229(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__230(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__231(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__232(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__233(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__234(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__235(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__236(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__237(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__238(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__239(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__240(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__241(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__242(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__243(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__244(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__245(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__246(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__247(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__248(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__249(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__250(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__251(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__252(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__253(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__254(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__255(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__256(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__257(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__258(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__259(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__260(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__261(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__262(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__263(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__264(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__265(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__266(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__267(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__268(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__269(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__270(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__271(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__272(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__273(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__274(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__275(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__276(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__277(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__278(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__279(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__280(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__281(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__282(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__283(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__284(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__285(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__286(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__287(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__288(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__289(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__290(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__291(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__292(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__293(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__294(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__295(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__296(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__297(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__298(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__299(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__300(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__301(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__302(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__303(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__304(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__305(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__306(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__307(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__308(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__309(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__310(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__311(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__312(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__313(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__314(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__315(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__316(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__317(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__318(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__319(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__320(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__321(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__322(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__323(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__324(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__325(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__326(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__327(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__328(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__329(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__330(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__331(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__332(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__333(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__334(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__335(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__336(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__337(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__338(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__339(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__340(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__341(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__342(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__343(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__344(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__345(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__346(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__347(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__348(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__349(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__350(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__351(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__352(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__353(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__354(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__355(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__356(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__357(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__358(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__359(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__360(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__361(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__362(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__363(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__364(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__365(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__366(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__367(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__368(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__369(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__370(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__371(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__372(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__373(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__374(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__375(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__376(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__377(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__378(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__379(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__380(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__381(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__382(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__383(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__384(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__385(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__386(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__387(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__388(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__389(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__390(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__391(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__392(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__393(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__394(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__395(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__396(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__397(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__398(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__399(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__400(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__401(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__402(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__403(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__404(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__405(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__406(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__407(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__408(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__409(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__410(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__411(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__412(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__413(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__414(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__415(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__416(pfmlLexer)
+ * -
+ void
+ pfmlLexer->T__417(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_ATOMIC_SEQUENCE(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_SEQUENCE(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_SEQUENCE_SIDE(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_SEQUENCE_WEAK(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_SCHEDULE_GT(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_SCHEDULE_LT(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_SCHEDULE_XOR(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_SCHEDULE_AND_THEN(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_SCHEDULE_OR_ELSE(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_NON_DETERMINISM(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_CONCURRENCY_ASYNC(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_CONCURRENCY_AND(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_CONCURRENCY_OR(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_CONCURRENCY_INTERLEAVING(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_CONCURRENCY_PARALLEL(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_FORK(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_JOIN(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_CONCURRENCY_RDV_ASYNC(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_CONCURRENCY_RDV_AND(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_CONCURRENCY_RDV_OR(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_CONCURRENCY_RDV_INTERLEAVING(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_CONCURRENCY_RDV_PARALLEL(pfmlLexer)
+ * -
+ void
+ pfmlLexer->ASSIGN(pfmlLexer)
+ * -
+ void
+ pfmlLexer->ASSIGN_AFTER(pfmlLexer)
+ * -
+ void
+ pfmlLexer->ASSIGN_REF(pfmlLexer)
+ * -
+ void
+ pfmlLexer->ASSIGN_MACRO(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_PUSH(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_ASSIGN_TOP(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_TOP(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OP_POP(pfmlLexer)
+ * -
+ void
+ pfmlLexer->LPAREN(pfmlLexer)
+ * -
+ void
+ pfmlLexer->RPAREN(pfmlLexer)
+ * -
+ void
+ pfmlLexer->LCURLY(pfmlLexer)
+ * -
+ void
+ pfmlLexer->RCURLY(pfmlLexer)
+ * -
+ void
+ pfmlLexer->LBRACKET(pfmlLexer)
+ * -
+ void
+ pfmlLexer->RBRACKET(pfmlLexer)
+ * -
+ void
+ pfmlLexer->LBRACKET_EXCEPT(pfmlLexer)
+ * -
+ void
+ pfmlLexer->LPAREN_INVOKE(pfmlLexer)
+ * -
+ void
+ pfmlLexer->LCURLY_INVOKE(pfmlLexer)
+ * -
+ void
+ pfmlLexer->PERCENT_LPAREN_INVOKE(pfmlLexer)
+ * -
+ void
+ pfmlLexer->PERCENT_LPAREN(pfmlLexer)
+ * -
+ void
+ pfmlLexer->RPAREN_PERCENT(pfmlLexer)
+ * -
+ void
+ pfmlLexer->STATEMENT_PROMPT(pfmlLexer)
+ * -
+ void
+ pfmlLexer->DOLLAR_LCURLY(pfmlLexer)
+ * -
+ void
+ pfmlLexer->RCURLY_DOLLAR(pfmlLexer)
+ * -
+ void
+ pfmlLexer->PERCENT_LCURLY(pfmlLexer)
+ * -
+ void
+ pfmlLexer->RCURLY_PERCENT(pfmlLexer)
+ * -
+ void
+ pfmlLexer->LBRACKET_BAR(pfmlLexer)
+ * -
+ void
+ pfmlLexer->BAR_RBRACKET(pfmlLexer)
+ * -
+ void
+ pfmlLexer->LBRACKET_LCURLY(pfmlLexer)
+ * -
+ void
+ pfmlLexer->RCURLY_RBRACKET(pfmlLexer)
+ * -
+ void
+ pfmlLexer->COLON(pfmlLexer)
+ * -
+ void
+ pfmlLexer->COMMA(pfmlLexer)
+ * -
+ void
+ pfmlLexer->QUESTION(pfmlLexer)
+ * -
+ void
+ pfmlLexer->SEMI(pfmlLexer)
+ * -
+ void
+ pfmlLexer->DIESE(pfmlLexer)
+ * -
+ void
+ pfmlLexer->DOLLAR(pfmlLexer)
+ * -
+ void
+ pfmlLexer->DOT(pfmlLexer)
+ * -
+ void
+ pfmlLexer->DOTDOT(pfmlLexer)
+ * -
+ void
+ pfmlLexer->COLONx2(pfmlLexer)
+ * -
+ void
+ pfmlLexer->LAND(pfmlLexer)
+ * -
+ void
+ pfmlLexer->LAND_THEN(pfmlLexer)
+ * -
+ void
+ pfmlLexer->LAND_ASSIGN(pfmlLexer)
+ * -
+ void
+ pfmlLexer->LAND_ASSIGN_AFTER(pfmlLexer)
+ * -
+ void
+ pfmlLexer->LNOT(pfmlLexer)
+ * -
+ void
+ pfmlLexer->LOR(pfmlLexer)
+ * -
+ void
+ pfmlLexer->LOR_ELSE(pfmlLexer)
+ * -
+ void
+ pfmlLexer->LOR_ASSIGN(pfmlLexer)
+ * -
+ void
+ pfmlLexer->LOR_ASSIGN_AFTER(pfmlLexer)
+ * -
+ void
+ pfmlLexer->LXOR(pfmlLexer)
+ * -
+ void
+ pfmlLexer->EQUAL(pfmlLexer)
+ * -
+ void
+ pfmlLexer->NEQUAL(pfmlLexer)
+ * -
+ void
+ pfmlLexer->SEQUAL(pfmlLexer)
+ * -
+ void
+ pfmlLexer->NSEQUAL(pfmlLexer)
+ * -
+ void
+ pfmlLexer->LTE(pfmlLexer)
+ * -
+ void
+ pfmlLexer->LT_(pfmlLexer)
+ * -
+ void
+ pfmlLexer->GTE(pfmlLexer)
+ * -
+ void
+ pfmlLexer->GT(pfmlLexer)
+ * -
+ void
+ pfmlLexer->PLUS(pfmlLexer)
+ * -
+ void
+ pfmlLexer->PLUS_ASSIGN(pfmlLexer)
+ * -
+ void
+ pfmlLexer->PLUS_ASSIGN_AFTER(pfmlLexer)
+ * -
+ void
+ pfmlLexer->INCR(pfmlLexer)
+ * -
+ void
+ pfmlLexer->MINUS(pfmlLexer)
+ * -
+ void
+ pfmlLexer->MINUS_ASSIGN(pfmlLexer)
+ * -
+ void
+ pfmlLexer->MINUS_ASSIGN_AFTER(pfmlLexer)
+ * -
+ void
+ pfmlLexer->DECR(pfmlLexer)
+ * -
+ void
+ pfmlLexer->STAR(pfmlLexer)
+ * -
+ void
+ pfmlLexer->STAR_ASSIGN(pfmlLexer)
+ * -
+ void
+ pfmlLexer->STAR_ASSIGN_AFTER(pfmlLexer)
+ * -
+ void
+ pfmlLexer->DIV(pfmlLexer)
+ * -
+ void
+ pfmlLexer->DIV_ASSIGN(pfmlLexer)
+ * -
+ void
+ pfmlLexer->DIV_ASSIGN_AFTER(pfmlLexer)
+ * -
+ void
+ pfmlLexer->MOD(pfmlLexer)
+ * -
+ void
+ pfmlLexer->MOD_ASSIGN(pfmlLexer)
+ * -
+ void
+ pfmlLexer->MOD_ASSIGN_AFTER(pfmlLexer)
+ * -
+ void
+ pfmlLexer->RSHIFT(pfmlLexer)
+ * -
+ void
+ pfmlLexer->RSHIFT_ASSIGN(pfmlLexer)
+ * -
+ void
+ pfmlLexer->RSHIFT_ASSIGN_AFTER(pfmlLexer)
+ * -
+ void
+ pfmlLexer->LSHIFT(pfmlLexer)
+ * -
+ void
+ pfmlLexer->LSHIFT_ASSIGN(pfmlLexer)
+ * -
+ void
+ pfmlLexer->LSHIFT_ASSIGN_AFTER(pfmlLexer)
+ * -
+ void
+ pfmlLexer->BAND(pfmlLexer)
+ * -
+ void
+ pfmlLexer->BAND_ASSIGN(pfmlLexer)
+ * -
+ void
+ pfmlLexer->BAND_ASSIGN_AFTER(pfmlLexer)
+ * -
+ void
+ pfmlLexer->BNOT(pfmlLexer)
+ * -
+ void
+ pfmlLexer->BOR(pfmlLexer)
+ * -
+ void
+ pfmlLexer->BOR_ASSIGN(pfmlLexer)
+ * -
+ void
+ pfmlLexer->BOR_ASSIGN_AFTER(pfmlLexer)
+ * -
+ void
+ pfmlLexer->BXOR(pfmlLexer)
+ * -
+ void
+ pfmlLexer->BXOR_ASSIGN(pfmlLexer)
+ * -
+ void
+ pfmlLexer->BXOR_ASSIGN_AFTER(pfmlLexer)
+ * -
+ void
+ pfmlLexer->ID(pfmlLexer)
+ * -
+ void
+ pfmlLexer->AT_ID(pfmlLexer)
+ * -
+ void
+ pfmlLexer->StringLiteral(pfmlLexer)
+ * -
+ void
+ pfmlLexer->CharLiteral(pfmlLexer)
+ * -
+ void
+ pfmlLexer->NumberLiteral(pfmlLexer)
+ * -
+ void
+ pfmlLexer->FloatLiteral(pfmlLexer)
+ * -
+ void
+ pfmlLexer->RationalLiteral(pfmlLexer)
+ * -
+ void
+ pfmlLexer->IntegerLiteral(pfmlLexer)
+ * -
+ void
+ pfmlLexer->FloatTypeSuffix(pfmlLexer)
+ * -
+ void
+ pfmlLexer->ImaginarySuffix(pfmlLexer)
+ * -
+ void
+ pfmlLexer->IntSuffix(pfmlLexer)
+ * -
+ void
+ pfmlLexer->Integer(pfmlLexer)
+ * -
+ void
+ pfmlLexer->Decimal(pfmlLexer)
+ * -
+ void
+ pfmlLexer->Binary(pfmlLexer)
+ * -
+ void
+ pfmlLexer->Octal(pfmlLexer)
+ * -
+ void
+ pfmlLexer->Hexadecimal(pfmlLexer)
+ * -
+ void
+ pfmlLexer->DecimalDigit(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OctalDigit(pfmlLexer)
+ * -
+ void
+ pfmlLexer->HexDigit(pfmlLexer)
+ * -
+ void
+ pfmlLexer->DecimalExponent(pfmlLexer)
+ * -
+ void
+ pfmlLexer->DecimalDigits(pfmlLexer)
+ * -
+ void
+ pfmlLexer->Float(pfmlLexer)
+ * -
+ void
+ pfmlLexer->EXPONENT(pfmlLexer)
+ * -
+ void
+ pfmlLexer->HEX_DIGIT(pfmlLexer)
+ * -
+ void
+ pfmlLexer->ESC_SEQ(pfmlLexer)
+ * -
+ void
+ pfmlLexer->OCTAL_ESC(pfmlLexer)
+ * -
+ void
+ pfmlLexer->UNICODE_ESC(pfmlLexer)
+ * -
+ void
+ pfmlLexer->COMMENT(pfmlLexer)
+ * -
+ void
+ pfmlLexer->WS(pfmlLexer)
+ * -
+ void
+ pfmlLexer->Tokens(pfmlLexer)
+ *
+ *
+ *
+ * The return type for any particular rule is of course determined by the source
+ * grammar file.
+ */
+// [The "BSD license"]
+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
+// http://www.temporal-wave.com
+// http://www.linkedin.com/in/jimidle
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. The name of the author may not be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef _fmlLexer_H
+#define _fmlLexer_H
+/* =============================================================================
+ * Standard antlr3 C runtime definitions
+ */
+#include <antlr3.h>
+
+/* End of standard antlr 3 runtime definitions
+ * =============================================================================
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Forward declare the context typedef so that we can use it before it is
+// properly defined. Delegators and delegates (from import statements) are
+// interdependent and their context structures contain pointers to each other
+// C only allows such things to be declared if you pre-declare the typedef.
+//
+typedef struct fmlLexer_Ctx_struct fmlLexer, * pfmlLexer;
+
+
+
+
+
+
+#ifdef ANTLR3_WINDOWS
+// Disable: Unreferenced parameter, - Rules with parameters that are not used
+// constant conditional, - ANTLR realizes that a prediction is always true (synpred usually)
+// initialized but unused variable - tree rewrite variables declared but not needed
+// Unreferenced local variable - lexer rule declares but does not always use _type
+// potentially unitialized variable used - retval always returned from a rule
+// unreferenced local function has been removed - susually getTokenNames or freeScope, they can go without warnigns
+//
+// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
+// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
+// usually generated when a parser rule is given a parameter that it does not use. Mostly though
+// this is a matter of orthogonality hence I disable that one.
+//
+#pragma warning( disable : 4100 )
+#pragma warning( disable : 4101 )
+#pragma warning( disable : 4127 )
+#pragma warning( disable : 4189 )
+#pragma warning( disable : 4505 )
+#pragma warning( disable : 4701 )
+#endif
+
+/* ========================
+ * BACKTRACKING IS ENABLED
+ * ========================
+ */
+
+
+/** Context tracking structure for
+fmlLexer
+
+ */
+struct fmlLexer_Ctx_struct
+{
+ /** Built in ANTLR3 context tracker contains all the generic elements
+ * required for context tracking.
+ */
+ pANTLR3_LEXER pLexer;
+
+ void
+ (*mT__144) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__145) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__146) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__147) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__148) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__149) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__150) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__151) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__152) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__153) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__154) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__155) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__156) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__157) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__158) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__159) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__160) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__161) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__162) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__163) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__164) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__165) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__166) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__167) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__168) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__169) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__170) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__171) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__172) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__173) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__174) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__175) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__176) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__177) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__178) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__179) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__180) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__181) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__182) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__183) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__184) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__185) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__186) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__187) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__188) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__189) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__190) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__191) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__192) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__193) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__194) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__195) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__196) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__197) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__198) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__199) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__200) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__201) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__202) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__203) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__204) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__205) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__206) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__207) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__208) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__209) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__210) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__211) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__212) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__213) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__214) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__215) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__216) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__217) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__218) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__219) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__220) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__221) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__222) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__223) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__224) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__225) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__226) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__227) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__228) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__229) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__230) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__231) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__232) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__233) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__234) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__235) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__236) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__237) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__238) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__239) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__240) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__241) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__242) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__243) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__244) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__245) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__246) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__247) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__248) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__249) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__250) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__251) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__252) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__253) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__254) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__255) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__256) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__257) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__258) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__259) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__260) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__261) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__262) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__263) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__264) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__265) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__266) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__267) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__268) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__269) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__270) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__271) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__272) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__273) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__274) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__275) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__276) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__277) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__278) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__279) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__280) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__281) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__282) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__283) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__284) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__285) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__286) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__287) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__288) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__289) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__290) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__291) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__292) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__293) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__294) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__295) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__296) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__297) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__298) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__299) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__300) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__301) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__302) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__303) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__304) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__305) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__306) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__307) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__308) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__309) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__310) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__311) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__312) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__313) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__314) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__315) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__316) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__317) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__318) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__319) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__320) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__321) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__322) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__323) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__324) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__325) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__326) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__327) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__328) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__329) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__330) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__331) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__332) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__333) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__334) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__335) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__336) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__337) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__338) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__339) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__340) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__341) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__342) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__343) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__344) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__345) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__346) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__347) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__348) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__349) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__350) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__351) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__352) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__353) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__354) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__355) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__356) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__357) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__358) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__359) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__360) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__361) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__362) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__363) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__364) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__365) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__366) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__367) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__368) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__369) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__370) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__371) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__372) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__373) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__374) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__375) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__376) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__377) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__378) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__379) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__380) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__381) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__382) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__383) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__384) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__385) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__386) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__387) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__388) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__389) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__390) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__391) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__392) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__393) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__394) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__395) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__396) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__397) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__398) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__399) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__400) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__401) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__402) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__403) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__404) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__405) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__406) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__407) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__408) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__409) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__410) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__411) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__412) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__413) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__414) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__415) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__416) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__417) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_ATOMIC_SEQUENCE) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_SEQUENCE) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_SEQUENCE_SIDE) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_SEQUENCE_WEAK) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_SCHEDULE_GT) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_SCHEDULE_LT) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_SCHEDULE_XOR) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_SCHEDULE_AND_THEN) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_SCHEDULE_OR_ELSE) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_NON_DETERMINISM) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_CONCURRENCY_ASYNC) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_CONCURRENCY_AND) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_CONCURRENCY_OR) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_CONCURRENCY_INTERLEAVING) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_CONCURRENCY_PARALLEL) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_FORK) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_JOIN) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_CONCURRENCY_RDV_ASYNC) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_CONCURRENCY_RDV_AND) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_CONCURRENCY_RDV_OR) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_CONCURRENCY_RDV_INTERLEAVING) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_CONCURRENCY_RDV_PARALLEL) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mASSIGN) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mASSIGN_AFTER) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mASSIGN_REF) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mASSIGN_MACRO) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_PUSH) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_ASSIGN_TOP) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_TOP) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOP_POP) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mLPAREN) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mRPAREN) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mLCURLY) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mRCURLY) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mLBRACKET) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mRBRACKET) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mLBRACKET_EXCEPT) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mLPAREN_INVOKE) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mLCURLY_INVOKE) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mPERCENT_LPAREN_INVOKE) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mPERCENT_LPAREN) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mRPAREN_PERCENT) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mSTATEMENT_PROMPT) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mDOLLAR_LCURLY) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mRCURLY_DOLLAR) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mPERCENT_LCURLY) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mRCURLY_PERCENT) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mLBRACKET_BAR) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mBAR_RBRACKET) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mLBRACKET_LCURLY) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mRCURLY_RBRACKET) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mCOLON) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mCOMMA) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mQUESTION) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mSEMI) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mDIESE) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mDOLLAR) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mDOT) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mDOTDOT) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mCOLONx2) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mLAND) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mLAND_THEN) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mLAND_ASSIGN) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mLAND_ASSIGN_AFTER) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mLNOT) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mLOR) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mLOR_ELSE) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mLOR_ASSIGN) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mLOR_ASSIGN_AFTER) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mLXOR) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mEQUAL) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mNEQUAL) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mSEQUAL) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mNSEQUAL) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mLTE) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mLT_) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mGTE) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mGT) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mPLUS) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mPLUS_ASSIGN) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mPLUS_ASSIGN_AFTER) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mINCR) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mMINUS) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mMINUS_ASSIGN) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mMINUS_ASSIGN_AFTER) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mDECR) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mSTAR) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mSTAR_ASSIGN) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mSTAR_ASSIGN_AFTER) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mDIV) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mDIV_ASSIGN) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mDIV_ASSIGN_AFTER) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mMOD) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mMOD_ASSIGN) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mMOD_ASSIGN_AFTER) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mRSHIFT) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mRSHIFT_ASSIGN) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mRSHIFT_ASSIGN_AFTER) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mLSHIFT) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mLSHIFT_ASSIGN) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mLSHIFT_ASSIGN_AFTER) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mBAND) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mBAND_ASSIGN) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mBAND_ASSIGN_AFTER) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mBNOT) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mBOR) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mBOR_ASSIGN) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mBOR_ASSIGN_AFTER) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mBXOR) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mBXOR_ASSIGN) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mBXOR_ASSIGN_AFTER) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mID) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mAT_ID) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mStringLiteral) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mCharLiteral) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mNumberLiteral) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mFloatLiteral) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mRationalLiteral) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mIntegerLiteral) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mFloatTypeSuffix) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mImaginarySuffix) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mIntSuffix) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mInteger) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mDecimal) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mBinary) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOctal) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mHexadecimal) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mDecimalDigit) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOctalDigit) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mHexDigit) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mDecimalExponent) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mDecimalDigits) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mFloat) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mEXPONENT) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mHEX_DIGIT) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mESC_SEQ) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mOCTAL_ESC) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mUNICODE_ESC) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mCOMMENT) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mWS) (struct fmlLexer_Ctx_struct * ctx);
+
+ void
+ (*mTokens) (struct fmlLexer_Ctx_struct * ctx);
+
+
+ const char * (*getGrammarFileName)();
+ void (*reset) (struct fmlLexer_Ctx_struct * ctx);
+ void (*free) (struct fmlLexer_Ctx_struct * ctx);
+};
+
+// Function protoypes for the constructor functions that external translation units
+// such as delegators and delegates may wish to call.
+//
+ANTLR3_API pfmlLexer fmlLexerNew (
+pANTLR3_INPUT_STREAM
+ instream);
+ANTLR3_API pfmlLexer fmlLexerNewSSD (
+pANTLR3_INPUT_STREAM
+ instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
+
+/** Symbolic definitions of all the tokens that the
+lexer
+ will work with.
+ * \{
+ *
+ * Antlr will define EOF, but we can't use that as it it is too common in
+ * in C header files and that would be confusing. There is no way to filter this out at the moment
+ * so we just undef it here for now. That isn't the value we get back from C recognizers
+ * anyway. We are looking for ANTLR3_TOKEN_EOF.
+ */
+#ifdef EOF
+#undef EOF
+#endif
+#ifdef Tokens
+#undef Tokens
+#endif
+#define EOF -1
+#define T__144 144
+#define T__145 145
+#define T__146 146
+#define T__147 147
+#define T__148 148
+#define T__149 149
+#define T__150 150
+#define T__151 151
+#define T__152 152
+#define T__153 153
+#define T__154 154
+#define T__155 155
+#define T__156 156
+#define T__157 157
+#define T__158 158
+#define T__159 159
+#define T__160 160
+#define T__161 161
+#define T__162 162
+#define T__163 163
+#define T__164 164
+#define T__165 165
+#define T__166 166
+#define T__167 167
+#define T__168 168
+#define T__169 169
+#define T__170 170
+#define T__171 171
+#define T__172 172
+#define T__173 173
+#define T__174 174
+#define T__175 175
+#define T__176 176
+#define T__177 177
+#define T__178 178
+#define T__179 179
+#define T__180 180
+#define T__181 181
+#define T__182 182
+#define T__183 183
+#define T__184 184
+#define T__185 185
+#define T__186 186
+#define T__187 187
+#define T__188 188
+#define T__189 189
+#define T__190 190
+#define T__191 191
+#define T__192 192
+#define T__193 193
+#define T__194 194
+#define T__195 195
+#define T__196 196
+#define T__197 197
+#define T__198 198
+#define T__199 199
+#define T__200 200
+#define T__201 201
+#define T__202 202
+#define T__203 203
+#define T__204 204
+#define T__205 205
+#define T__206 206
+#define T__207 207
+#define T__208 208
+#define T__209 209
+#define T__210 210
+#define T__211 211
+#define T__212 212
+#define T__213 213
+#define T__214 214
+#define T__215 215
+#define T__216 216
+#define T__217 217
+#define T__218 218
+#define T__219 219
+#define T__220 220
+#define T__221 221
+#define T__222 222
+#define T__223 223
+#define T__224 224
+#define T__225 225
+#define T__226 226
+#define T__227 227
+#define T__228 228
+#define T__229 229
+#define T__230 230
+#define T__231 231
+#define T__232 232
+#define T__233 233
+#define T__234 234
+#define T__235 235
+#define T__236 236
+#define T__237 237
+#define T__238 238
+#define T__239 239
+#define T__240 240
+#define T__241 241
+#define T__242 242
+#define T__243 243
+#define T__244 244
+#define T__245 245
+#define T__246 246
+#define T__247 247
+#define T__248 248
+#define T__249 249
+#define T__250 250
+#define T__251 251
+#define T__252 252
+#define T__253 253
+#define T__254 254
+#define T__255 255
+#define T__256 256
+#define T__257 257
+#define T__258 258
+#define T__259 259
+#define T__260 260
+#define T__261 261
+#define T__262 262
+#define T__263 263
+#define T__264 264
+#define T__265 265
+#define T__266 266
+#define T__267 267
+#define T__268 268
+#define T__269 269
+#define T__270 270
+#define T__271 271
+#define T__272 272
+#define T__273 273
+#define T__274 274
+#define T__275 275
+#define T__276 276
+#define T__277 277
+#define T__278 278
+#define T__279 279
+#define T__280 280
+#define T__281 281
+#define T__282 282
+#define T__283 283
+#define T__284 284
+#define T__285 285
+#define T__286 286
+#define T__287 287
+#define T__288 288
+#define T__289 289
+#define T__290 290
+#define T__291 291
+#define T__292 292
+#define T__293 293
+#define T__294 294
+#define T__295 295
+#define T__296 296
+#define T__297 297
+#define T__298 298
+#define T__299 299
+#define T__300 300
+#define T__301 301
+#define T__302 302
+#define T__303 303
+#define T__304 304
+#define T__305 305
+#define T__306 306
+#define T__307 307
+#define T__308 308
+#define T__309 309
+#define T__310 310
+#define T__311 311
+#define T__312 312
+#define T__313 313
+#define T__314 314
+#define T__315 315
+#define T__316 316
+#define T__317 317
+#define T__318 318
+#define T__319 319
+#define T__320 320
+#define T__321 321
+#define T__322 322
+#define T__323 323
+#define T__324 324
+#define T__325 325
+#define T__326 326
+#define T__327 327
+#define T__328 328
+#define T__329 329
+#define T__330 330
+#define T__331 331
+#define T__332 332
+#define T__333 333
+#define T__334 334
+#define T__335 335
+#define T__336 336
+#define T__337 337
+#define T__338 338
+#define T__339 339
+#define T__340 340
+#define T__341 341
+#define T__342 342
+#define T__343 343
+#define T__344 344
+#define T__345 345
+#define T__346 346
+#define T__347 347
+#define T__348 348
+#define T__349 349
+#define T__350 350
+#define T__351 351
+#define T__352 352
+#define T__353 353
+#define T__354 354
+#define T__355 355
+#define T__356 356
+#define T__357 357
+#define T__358 358
+#define T__359 359
+#define T__360 360
+#define T__361 361
+#define T__362 362
+#define T__363 363
+#define T__364 364
+#define T__365 365
+#define T__366 366
+#define T__367 367
+#define T__368 368
+#define T__369 369
+#define T__370 370
+#define T__371 371
+#define T__372 372
+#define T__373 373
+#define T__374 374
+#define T__375 375
+#define T__376 376
+#define T__377 377
+#define T__378 378
+#define T__379 379
+#define T__380 380
+#define T__381 381
+#define T__382 382
+#define T__383 383
+#define T__384 384
+#define T__385 385
+#define T__386 386
+#define T__387 387
+#define T__388 388
+#define T__389 389
+#define T__390 390
+#define T__391 391
+#define T__392 392
+#define T__393 393
+#define T__394 394
+#define T__395 395
+#define T__396 396
+#define T__397 397
+#define T__398 398
+#define T__399 399
+#define T__400 400
+#define T__401 401
+#define T__402 402
+#define T__403 403
+#define T__404 404
+#define T__405 405
+#define T__406 406
+#define T__407 407
+#define T__408 408
+#define T__409 409
+#define T__410 410
+#define T__411 411
+#define T__412 412
+#define T__413 413
+#define T__414 414
+#define T__415 415
+#define T__416 416
+#define T__417 417
+#define ASSIGN 4
+#define ASSIGN_AFTER 5
+#define ASSIGN_MACRO 6
+#define ASSIGN_REF 7
+#define AT_ID 8
+#define BAND 9
+#define BAND_ASSIGN 10
+#define BAND_ASSIGN_AFTER 11
+#define BAR_RBRACKET 12
+#define BNOT 13
+#define BOR 14
+#define BOR_ASSIGN 15
+#define BOR_ASSIGN_AFTER 16
+#define BXOR 17
+#define BXOR_ASSIGN 18
+#define BXOR_ASSIGN_AFTER 19
+#define Binary 20
+#define COLON 21
+#define COLONx2 22
+#define COMMA 23
+#define COMMENT 24
+#define CharLiteral 25
+#define DECR 26
+#define DIESE 27
+#define DIV 28
+#define DIV_ASSIGN 29
+#define DIV_ASSIGN_AFTER 30
+#define DOLLAR 31
+#define DOLLAR_LCURLY 32
+#define DOT 33
+#define DOTDOT 34
+#define Decimal 35
+#define DecimalDigit 36
+#define DecimalDigits 37
+#define DecimalExponent 38
+#define EQUAL 39
+#define ESC_SEQ 40
+#define EXPONENT 41
+#define Float 42
+#define FloatLiteral 43
+#define FloatTypeSuffix 44
+#define GT 45
+#define GTE 46
+#define HEX_DIGIT 47
+#define HexDigit 48
+#define Hexadecimal 49
+#define ID 50
+#define INCR 51
+#define ImaginarySuffix 52
+#define IntSuffix 53
+#define Integer 54
+#define IntegerLiteral 55
+#define LAND 56
+#define LAND_ASSIGN 57
+#define LAND_ASSIGN_AFTER 58
+#define LAND_THEN 59
+#define LBRACKET 60
+#define LBRACKET_BAR 61
+#define LBRACKET_EXCEPT 62
+#define LBRACKET_LCURLY 63
+#define LCURLY 64
+#define LCURLY_INVOKE 65
+#define LNOT 66
+#define LOR 67
+#define LOR_ASSIGN 68
+#define LOR_ASSIGN_AFTER 69
+#define LOR_ELSE 70
+#define LPAREN 71
+#define LPAREN_INVOKE 72
+#define LSHIFT 73
+#define LSHIFT_ASSIGN 74
+#define LSHIFT_ASSIGN_AFTER 75
+#define LTE 76
+#define LT_ 77
+#define LXOR 78
+#define MINUS 79
+#define MINUS_ASSIGN 80
+#define MINUS_ASSIGN_AFTER 81
+#define MOD 82
+#define MOD_ASSIGN 83
+#define MOD_ASSIGN_AFTER 84
+#define NEQUAL 85
+#define NSEQUAL 86
+#define NumberLiteral 87
+#define OCTAL_ESC 88
+#define OP_ASSIGN_TOP 89
+#define OP_ATOMIC_SEQUENCE 90
+#define OP_CONCURRENCY_AND 91
+#define OP_CONCURRENCY_ASYNC 92
+#define OP_CONCURRENCY_INTERLEAVING 93
+#define OP_CONCURRENCY_OR 94
+#define OP_CONCURRENCY_PARALLEL 95
+#define OP_CONCURRENCY_RDV_AND 96
+#define OP_CONCURRENCY_RDV_ASYNC 97
+#define OP_CONCURRENCY_RDV_INTERLEAVING 98
+#define OP_CONCURRENCY_RDV_OR 99
+#define OP_CONCURRENCY_RDV_PARALLEL 100
+#define OP_FORK 101
+#define OP_JOIN 102
+#define OP_NON_DETERMINISM 103
+#define OP_POP 104
+#define OP_PUSH 105
+#define OP_SCHEDULE_AND_THEN 106
+#define OP_SCHEDULE_GT 107
+#define OP_SCHEDULE_LT 108
+#define OP_SCHEDULE_OR_ELSE 109
+#define OP_SCHEDULE_XOR 110
+#define OP_SEQUENCE 111
+#define OP_SEQUENCE_SIDE 112
+#define OP_SEQUENCE_WEAK 113
+#define OP_TOP 114
+#define Octal 115
+#define OctalDigit 116
+#define PERCENT_LCURLY 117
+#define PERCENT_LPAREN 118
+#define PERCENT_LPAREN_INVOKE 119
+#define PLUS 120
+#define PLUS_ASSIGN 121
+#define PLUS_ASSIGN_AFTER 122
+#define QUESTION 123
+#define RBRACKET 124
+#define RCURLY 125
+#define RCURLY_DOLLAR 126
+#define RCURLY_PERCENT 127
+#define RCURLY_RBRACKET 128
+#define RPAREN 129
+#define RPAREN_PERCENT 130
+#define RSHIFT 131
+#define RSHIFT_ASSIGN 132
+#define RSHIFT_ASSIGN_AFTER 133
+#define RationalLiteral 134
+#define SEMI 135
+#define SEQUAL 136
+#define STAR 137
+#define STAR_ASSIGN 138
+#define STAR_ASSIGN_AFTER 139
+#define STATEMENT_PROMPT 140
+#define StringLiteral 141
+#define UNICODE_ESC 142
+#define WS 143
+#ifdef EOF
+#undef EOF
+#define EOF ANTLR3_TOKEN_EOF
+#endif
+
+#ifndef TOKENSOURCE
+#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
+#endif
+
+/* End of token definitions for fmlLexer
+ * =============================================================================
+ */
+/** } */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+/* END - Note:Keep extra line feed to satisfy UNIX systems */
diff --git a/org.eclipse.efm.symbex/src/parser/model/fmlParser.c b/org.eclipse.efm.symbex/src/parser/model/fmlParser.c
new file mode 100644
index 0000000..43e0c40
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/parser/model/fmlParser.c
@@ -0,0 +1,91320 @@
+/** \file
+ * This C source file was generated by $ANTLR version 3.4
+ *
+ * - From the grammar source file : /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g
+ * - On : 2017-05-30 09:21:52
+ * - for the parser : fmlParserParser
+ *
+ * Editing it, at least manually, is not wise.
+ *
+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
+ *
+ *
+*/
+// [The "BSD license"]
+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
+// http://www.temporal-wave.com
+// http://www.linkedin.com/in/jimidle
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. The name of the author may not be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+/* =============================================================================
+ * This is what the grammar programmer asked us to put at the top of every file.
+ */
+
+
+#include <parser/model/ParserUtil.h>
+
+#include <common/BF.h>
+
+#include <collection/BFContainer.h>
+
+#include <fml/common/BehavioralElement.h>
+#include <fml/common/ModifierElement.h>
+#include <fml/common/SpecifierElement.h>
+
+#include <fml/executable/ExecutableLib.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/BuiltinArray.h>
+#include <fml/expression/ExpressionConstant.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/StatementConstructor.h>
+
+#include <fml/lib/IComPoint.h>
+
+#include <fml/operator/Operator.h>
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/template/TemplateFactory.h>
+
+#include <fml/type/TypeSpecifier.h>
+
+#include <fml/type/TypeManager.h>
+
+#include <fml/infrastructure/Buffer.h>
+#include <fml/infrastructure/Channel.h>
+#include <fml/infrastructure/ComPoint.h>
+#include <fml/infrastructure/ComProtocol.h>
+#include <fml/infrastructure/ComRoute.h>
+#include <fml/infrastructure/Connector.h>
+
+// extern "C" and C++ template incompatibility !!!
+//#include <fml/infrastructure/PropertyPart.h>
+
+#include <fml/infrastructure/DataType.h>
+#include <fml/infrastructure/Machine.h>
+#include <fml/infrastructure/Package.h>
+#include <fml/infrastructure/Port.h>
+#include <fml/infrastructure/Routine.h>
+#include <fml/infrastructure/System.h>
+#include <fml/infrastructure/Transition.h>
+#include <fml/infrastructure/Variable.h>
+
+#include <fml/infrastructure/BehavioralPart.h>
+#include <fml/infrastructure/CompositePart.h>
+#include <fml/infrastructure/InstanceSpecifierPart.h>
+#include <fml/infrastructure/InteractionPart.h>
+#include <fml/infrastructure/ModelOfComputationPart.h>
+
+// extern "C" and C++ template incompatibility !!!
+//#include <fml/infrastructure/PropertyPart.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/UniFormIdentifier.h>
+#include <fml/workflow/WObject.h>
+
+
+//void fmlDisplayRecognitionError(
+// pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_UINT8 * tokenNames);
+
+
+/* End of Header action.
+ * =============================================================================
+ */
+
+/* -----------------------------------------
+ * Include the ANTLR3 generated header file.
+ */
+#include "fmlParser.h"
+/* ----------------------------------------- */
+
+
+
+
+
+/* MACROS that hide the C interface implementations from the
+ * generated code, which makes it a little more understandable to the human eye.
+ * I am very much against using C pre-processor macros for function calls and bits
+ * of code as you cannot see what is happening when single stepping in debuggers
+ * and so on. The exception (in my book at least) is for generated code, where you are
+ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
+ * hides some indirect calls, but is always referring to the input stream. This is
+ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
+ * the runtime interfaces without changing the generated code too often, without
+ * confusing the reader of the generated output, who may not wish to know the gory
+ * details of the interface inheritance.
+ */
+
+#define CTX ctx
+
+/* Aids in accessing scopes for grammar programmers
+ */
+#undef SCOPE_TYPE
+#undef SCOPE_STACK
+#undef SCOPE_TOP
+#define SCOPE_TYPE(scope) pfmlParser_##scope##_SCOPE
+#define SCOPE_STACK(scope) pfmlParser_##scope##Stack
+#define SCOPE_TOP(scope) ctx->pfmlParser_##scope##Top
+#define SCOPE_SIZE(scope) ctx->pfmlParser_##scope##Stack_limit
+#define SCOPE_INSTANCE(scope, i) (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
+
+/* Macros for accessing things in the parser
+ */
+
+#undef PARSER
+#undef RECOGNIZER
+#undef HAVEPARSEDRULE
+#undef MEMOIZE
+#undef INPUT
+#undef STRSTREAM
+#undef HASEXCEPTION
+#undef EXCEPTION
+#undef MATCHT
+#undef MATCHANYT
+#undef FOLLOWSTACK
+#undef FOLLOWPUSH
+#undef FOLLOWPOP
+#undef PRECOVER
+#undef PREPORTERROR
+#undef LA
+#undef LT
+#undef CONSTRUCTEX
+#undef CONSUME
+#undef MARK
+#undef REWIND
+#undef REWINDLAST
+#undef PERRORRECOVERY
+#undef HASFAILED
+#undef FAILEDFLAG
+#undef RECOVERFROMMISMATCHEDSET
+#undef RECOVERFROMMISMATCHEDELEMENT
+#undef INDEX
+#undef ADAPTOR
+#undef SEEK
+#undef RULEMEMO
+#undef DBG
+
+#define PARSER ctx->pParser
+#define RECOGNIZER PARSER->rec
+#define PSRSTATE RECOGNIZER->state
+#define HAVEPARSEDRULE(r) RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
+#define MEMOIZE(ri,si) RECOGNIZER->memoize(RECOGNIZER, ri, si)
+#define INPUT PARSER->tstream
+#define STRSTREAM INPUT
+#define ISTREAM INPUT->istream
+#define INDEX() ISTREAM->index(INPUT->istream)
+#define HASEXCEPTION() (PSRSTATE->error == ANTLR3_TRUE)
+#define EXCEPTION PSRSTATE->exception
+#define MATCHT(t, fs) RECOGNIZER->match(RECOGNIZER, t, fs)
+#define MATCHANYT() RECOGNIZER->matchAny(RECOGNIZER)
+#define FOLLOWSTACK PSRSTATE->following
+#ifdef SKIP_FOLLOW_SETS
+#define FOLLOWPUSH(x)
+#define FOLLOWPOP()
+#else
+#define FOLLOWPUSH(x) FOLLOWSTACK->push(FOLLOWSTACK, ((void *)(&(x))), NULL)
+#define FOLLOWPOP() FOLLOWSTACK->pop(FOLLOWSTACK)
+#endif
+#define PRECOVER() RECOGNIZER->recover(RECOGNIZER)
+#define PREPORTERROR() RECOGNIZER->reportError(RECOGNIZER)
+#define LA(n) INPUT->istream->_LA(ISTREAM, n)
+#define LT(n) INPUT->_LT(INPUT, n)
+#define CONSTRUCTEX() RECOGNIZER->exConstruct(RECOGNIZER)
+#define CONSUME() ISTREAM->consume(ISTREAM)
+#define MARK() ISTREAM->mark(ISTREAM)
+#define REWIND(m) ISTREAM->rewind(ISTREAM, m)
+#define REWINDLAST() ISTREAM->rewindLast(ISTREAM)
+#define SEEK(n) ISTREAM->seek(ISTREAM, n)
+#define PERRORRECOVERY PSRSTATE->errorRecovery
+#define FAILEDFLAG PSRSTATE->failed
+#define HASFAILED() (FAILEDFLAG == ANTLR3_TRUE)
+#define BACKTRACKING PSRSTATE->backtracking
+#define RECOVERFROMMISMATCHEDSET(s) RECOGNIZER->recoverFromMismatchedSet(RECOGNIZER, s)
+#define RECOVERFROMMISMATCHEDELEMENT(e) RECOGNIZER->recoverFromMismatchedElement(RECOGNIZER, s)
+#define ADAPTOR ctx->adaptor
+#define RULEMEMO PSRSTATE->ruleMemo
+#define DBG RECOGNIZER->debugger
+
+
+#define TOKTEXT(tok, txt) tok, (pANTLR3_UINT8)txt
+
+/* The 4 tokens defined below may well clash with your own #defines or token types. If so
+ * then for the present you must use different names for your defines as these are hard coded
+ * in the code generator. It would be better not to use such names internally, and maybe
+ * we can change this in a forthcoming release. I deliberately do not #undef these
+ * here as this will at least give you a redefined error somewhere if they clash.
+ */
+#define UP ANTLR3_TOKEN_UP
+#define DOWN ANTLR3_TOKEN_DOWN
+#define EOR ANTLR3_TOKEN_EOR
+#define INVALID ANTLR3_TOKEN_INVALID
+
+
+/* =============================================================================
+ * Functions to create and destroy scopes. First come the rule scopes, followed
+ * by the global declared scopes.
+ */
+
+
+
+/* ============================================================================= */
+
+/* =============================================================================
+ * Start of recognizer
+ */
+
+
+/** \brief Table of all token names in symbolic order, mainly used for
+ * error reporting.
+ */
+pANTLR3_UINT8 fmlParserTokenNames[414+4]
+ = {
+ (pANTLR3_UINT8) "<invalid>", /* String to print to indicate an invalid token */
+ (pANTLR3_UINT8) "<EOR>",
+ (pANTLR3_UINT8) "<DOWN>",
+ (pANTLR3_UINT8) "<UP>",
+ (pANTLR3_UINT8) "ASSIGN",
+ (pANTLR3_UINT8) "ASSIGN_AFTER",
+ (pANTLR3_UINT8) "ASSIGN_MACRO",
+ (pANTLR3_UINT8) "ASSIGN_REF",
+ (pANTLR3_UINT8) "AT_ID",
+ (pANTLR3_UINT8) "BAND",
+ (pANTLR3_UINT8) "BAND_ASSIGN",
+ (pANTLR3_UINT8) "BAND_ASSIGN_AFTER",
+ (pANTLR3_UINT8) "BAR_RBRACKET",
+ (pANTLR3_UINT8) "BNOT",
+ (pANTLR3_UINT8) "BOR",
+ (pANTLR3_UINT8) "BOR_ASSIGN",
+ (pANTLR3_UINT8) "BOR_ASSIGN_AFTER",
+ (pANTLR3_UINT8) "BXOR",
+ (pANTLR3_UINT8) "BXOR_ASSIGN",
+ (pANTLR3_UINT8) "BXOR_ASSIGN_AFTER",
+ (pANTLR3_UINT8) "Binary",
+ (pANTLR3_UINT8) "COLON",
+ (pANTLR3_UINT8) "COLONx2",
+ (pANTLR3_UINT8) "COMMA",
+ (pANTLR3_UINT8) "COMMENT",
+ (pANTLR3_UINT8) "CharLiteral",
+ (pANTLR3_UINT8) "DECR",
+ (pANTLR3_UINT8) "DIESE",
+ (pANTLR3_UINT8) "DIV",
+ (pANTLR3_UINT8) "DIV_ASSIGN",
+ (pANTLR3_UINT8) "DIV_ASSIGN_AFTER",
+ (pANTLR3_UINT8) "DOLLAR",
+ (pANTLR3_UINT8) "DOLLAR_LCURLY",
+ (pANTLR3_UINT8) "DOT",
+ (pANTLR3_UINT8) "DOTDOT",
+ (pANTLR3_UINT8) "Decimal",
+ (pANTLR3_UINT8) "DecimalDigit",
+ (pANTLR3_UINT8) "DecimalDigits",
+ (pANTLR3_UINT8) "DecimalExponent",
+ (pANTLR3_UINT8) "EQUAL",
+ (pANTLR3_UINT8) "ESC_SEQ",
+ (pANTLR3_UINT8) "EXPONENT",
+ (pANTLR3_UINT8) "Float",
+ (pANTLR3_UINT8) "FloatLiteral",
+ (pANTLR3_UINT8) "FloatTypeSuffix",
+ (pANTLR3_UINT8) "GT",
+ (pANTLR3_UINT8) "GTE",
+ (pANTLR3_UINT8) "HEX_DIGIT",
+ (pANTLR3_UINT8) "HexDigit",
+ (pANTLR3_UINT8) "Hexadecimal",
+ (pANTLR3_UINT8) "ID",
+ (pANTLR3_UINT8) "INCR",
+ (pANTLR3_UINT8) "ImaginarySuffix",
+ (pANTLR3_UINT8) "IntSuffix",
+ (pANTLR3_UINT8) "Integer",
+ (pANTLR3_UINT8) "IntegerLiteral",
+ (pANTLR3_UINT8) "LAND",
+ (pANTLR3_UINT8) "LAND_ASSIGN",
+ (pANTLR3_UINT8) "LAND_ASSIGN_AFTER",
+ (pANTLR3_UINT8) "LAND_THEN",
+ (pANTLR3_UINT8) "LBRACKET",
+ (pANTLR3_UINT8) "LBRACKET_BAR",
+ (pANTLR3_UINT8) "LBRACKET_EXCEPT",
+ (pANTLR3_UINT8) "LBRACKET_LCURLY",
+ (pANTLR3_UINT8) "LCURLY",
+ (pANTLR3_UINT8) "LCURLY_INVOKE",
+ (pANTLR3_UINT8) "LNOT",
+ (pANTLR3_UINT8) "LOR",
+ (pANTLR3_UINT8) "LOR_ASSIGN",
+ (pANTLR3_UINT8) "LOR_ASSIGN_AFTER",
+ (pANTLR3_UINT8) "LOR_ELSE",
+ (pANTLR3_UINT8) "LPAREN",
+ (pANTLR3_UINT8) "LPAREN_INVOKE",
+ (pANTLR3_UINT8) "LSHIFT",
+ (pANTLR3_UINT8) "LSHIFT_ASSIGN",
+ (pANTLR3_UINT8) "LSHIFT_ASSIGN_AFTER",
+ (pANTLR3_UINT8) "LTE",
+ (pANTLR3_UINT8) "LT_",
+ (pANTLR3_UINT8) "LXOR",
+ (pANTLR3_UINT8) "MINUS",
+ (pANTLR3_UINT8) "MINUS_ASSIGN",
+ (pANTLR3_UINT8) "MINUS_ASSIGN_AFTER",
+ (pANTLR3_UINT8) "MOD",
+ (pANTLR3_UINT8) "MOD_ASSIGN",
+ (pANTLR3_UINT8) "MOD_ASSIGN_AFTER",
+ (pANTLR3_UINT8) "NEQUAL",
+ (pANTLR3_UINT8) "NSEQUAL",
+ (pANTLR3_UINT8) "NumberLiteral",
+ (pANTLR3_UINT8) "OCTAL_ESC",
+ (pANTLR3_UINT8) "OP_ASSIGN_TOP",
+ (pANTLR3_UINT8) "OP_ATOMIC_SEQUENCE",
+ (pANTLR3_UINT8) "OP_CONCURRENCY_AND",
+ (pANTLR3_UINT8) "OP_CONCURRENCY_ASYNC",
+ (pANTLR3_UINT8) "OP_CONCURRENCY_INTERLEAVING",
+ (pANTLR3_UINT8) "OP_CONCURRENCY_OR",
+ (pANTLR3_UINT8) "OP_CONCURRENCY_PARALLEL",
+ (pANTLR3_UINT8) "OP_CONCURRENCY_RDV_AND",
+ (pANTLR3_UINT8) "OP_CONCURRENCY_RDV_ASYNC",
+ (pANTLR3_UINT8) "OP_CONCURRENCY_RDV_INTERLEAVING",
+ (pANTLR3_UINT8) "OP_CONCURRENCY_RDV_OR",
+ (pANTLR3_UINT8) "OP_CONCURRENCY_RDV_PARALLEL",
+ (pANTLR3_UINT8) "OP_FORK",
+ (pANTLR3_UINT8) "OP_JOIN",
+ (pANTLR3_UINT8) "OP_NON_DETERMINISM",
+ (pANTLR3_UINT8) "OP_POP",
+ (pANTLR3_UINT8) "OP_PUSH",
+ (pANTLR3_UINT8) "OP_SCHEDULE_AND_THEN",
+ (pANTLR3_UINT8) "OP_SCHEDULE_GT",
+ (pANTLR3_UINT8) "OP_SCHEDULE_LT",
+ (pANTLR3_UINT8) "OP_SCHEDULE_OR_ELSE",
+ (pANTLR3_UINT8) "OP_SCHEDULE_XOR",
+ (pANTLR3_UINT8) "OP_SEQUENCE",
+ (pANTLR3_UINT8) "OP_SEQUENCE_SIDE",
+ (pANTLR3_UINT8) "OP_SEQUENCE_WEAK",
+ (pANTLR3_UINT8) "OP_TOP",
+ (pANTLR3_UINT8) "Octal",
+ (pANTLR3_UINT8) "OctalDigit",
+ (pANTLR3_UINT8) "PERCENT_LCURLY",
+ (pANTLR3_UINT8) "PERCENT_LPAREN",
+ (pANTLR3_UINT8) "PERCENT_LPAREN_INVOKE",
+ (pANTLR3_UINT8) "PLUS",
+ (pANTLR3_UINT8) "PLUS_ASSIGN",
+ (pANTLR3_UINT8) "PLUS_ASSIGN_AFTER",
+ (pANTLR3_UINT8) "QUESTION",
+ (pANTLR3_UINT8) "RBRACKET",
+ (pANTLR3_UINT8) "RCURLY",
+ (pANTLR3_UINT8) "RCURLY_DOLLAR",
+ (pANTLR3_UINT8) "RCURLY_PERCENT",
+ (pANTLR3_UINT8) "RCURLY_RBRACKET",
+ (pANTLR3_UINT8) "RPAREN",
+ (pANTLR3_UINT8) "RPAREN_PERCENT",
+ (pANTLR3_UINT8) "RSHIFT",
+ (pANTLR3_UINT8) "RSHIFT_ASSIGN",
+ (pANTLR3_UINT8) "RSHIFT_ASSIGN_AFTER",
+ (pANTLR3_UINT8) "RationalLiteral",
+ (pANTLR3_UINT8) "SEMI",
+ (pANTLR3_UINT8) "SEQUAL",
+ (pANTLR3_UINT8) "STAR",
+ (pANTLR3_UINT8) "STAR_ASSIGN",
+ (pANTLR3_UINT8) "STAR_ASSIGN_AFTER",
+ (pANTLR3_UINT8) "STATEMENT_PROMPT",
+ (pANTLR3_UINT8) "StringLiteral",
+ (pANTLR3_UINT8) "UNICODE_ESC",
+ (pANTLR3_UINT8) "WS",
+ (pANTLR3_UINT8) "'#dhistory'",
+ (pANTLR3_UINT8) "'#final'",
+ (pANTLR3_UINT8) "'#init'",
+ (pANTLR3_UINT8) "'#initial'",
+ (pANTLR3_UINT8) "'#return'",
+ (pANTLR3_UINT8) "'#shistory'",
+ (pANTLR3_UINT8) "'#start'",
+ (pANTLR3_UINT8) "'#stf'",
+ (pANTLR3_UINT8) "'#sts'",
+ (pANTLR3_UINT8) "'#terminal'",
+ (pANTLR3_UINT8) "'$:comment'",
+ (pANTLR3_UINT8) "'$:debug'",
+ (pANTLR3_UINT8) "'$:informal'",
+ (pANTLR3_UINT8) "'$:trace'",
+ (pANTLR3_UINT8) "'$env'",
+ (pANTLR3_UINT8) "'$parent'",
+ (pANTLR3_UINT8) "'$self'",
+ (pANTLR3_UINT8) "'$super'",
+ (pANTLR3_UINT8) "'$this'",
+ (pANTLR3_UINT8) "'-->'",
+ (pANTLR3_UINT8) "'->'",
+ (pANTLR3_UINT8) "'<--'",
+ (pANTLR3_UINT8) "'<->'",
+ (pANTLR3_UINT8) "'<=='",
+ (pANTLR3_UINT8) "'==>'",
+ (pANTLR3_UINT8) "'@'",
+ (pANTLR3_UINT8) "'@abort'",
+ (pANTLR3_UINT8) "'@behavior:'",
+ (pANTLR3_UINT8) "'@com:'",
+ (pANTLR3_UINT8) "'@composite'",
+ (pANTLR3_UINT8) "'@composite:'",
+ (pANTLR3_UINT8) "'@concurrency'",
+ (pANTLR3_UINT8) "'@constraint'",
+ (pANTLR3_UINT8) "'@create'",
+ (pANTLR3_UINT8) "'@declaration:'",
+ (pANTLR3_UINT8) "'@disable'",
+ (pANTLR3_UINT8) "'@diversity'",
+ (pANTLR3_UINT8) "'@effect:'",
+ (pANTLR3_UINT8) "'@enable'",
+ (pANTLR3_UINT8) "'@executable:'",
+ (pANTLR3_UINT8) "'@final'",
+ (pANTLR3_UINT8) "'@fml'",
+ (pANTLR3_UINT8) "'@formalml'",
+ (pANTLR3_UINT8) "'@guard:'",
+ (pANTLR3_UINT8) "'@header:'",
+ (pANTLR3_UINT8) "'@iabort'",
+ (pANTLR3_UINT8) "'@idisable'",
+ (pANTLR3_UINT8) "'@ienable'",
+ (pANTLR3_UINT8) "'@import:'",
+ (pANTLR3_UINT8) "'@include'",
+ (pANTLR3_UINT8) "'@init'",
+ (pANTLR3_UINT8) "'@inout:'",
+ (pANTLR3_UINT8) "'@input:'",
+ (pANTLR3_UINT8) "'@instance:'",
+ (pANTLR3_UINT8) "'@interaction:'",
+ (pANTLR3_UINT8) "'@irun'",
+ (pANTLR3_UINT8) "'@machine:'",
+ (pANTLR3_UINT8) "'@macro:'",
+ (pANTLR3_UINT8) "'@moc:'",
+ (pANTLR3_UINT8) "'@model:'",
+ (pANTLR3_UINT8) "'@moe:'",
+ (pANTLR3_UINT8) "'@on_write'",
+ (pANTLR3_UINT8) "'@options'",
+ (pANTLR3_UINT8) "'@output:'",
+ (pANTLR3_UINT8) "'@package'",
+ (pANTLR3_UINT8) "'@param:'",
+ (pANTLR3_UINT8) "'@parameter:'",
+ (pANTLR3_UINT8) "'@private:'",
+ (pANTLR3_UINT8) "'@procedure:'",
+ (pANTLR3_UINT8) "'@property:'",
+ (pANTLR3_UINT8) "'@protected:'",
+ (pANTLR3_UINT8) "'@prototype:'",
+ (pANTLR3_UINT8) "'@public:'",
+ (pANTLR3_UINT8) "'@region:'",
+ (pANTLR3_UINT8) "'@return'",
+ (pANTLR3_UINT8) "'@return:'",
+ (pANTLR3_UINT8) "'@returns:'",
+ (pANTLR3_UINT8) "'@routine'",
+ (pANTLR3_UINT8) "'@routine:'",
+ (pANTLR3_UINT8) "'@rtc'",
+ (pANTLR3_UINT8) "'@run'",
+ (pANTLR3_UINT8) "'@schedule'",
+ (pANTLR3_UINT8) "'@start'",
+ (pANTLR3_UINT8) "'@statemachine:'",
+ (pANTLR3_UINT8) "'@stop'",
+ (pANTLR3_UINT8) "'@system'",
+ (pANTLR3_UINT8) "'@tguard:'",
+ (pANTLR3_UINT8) "'@transition:'",
+ (pANTLR3_UINT8) "'@trigger:'",
+ (pANTLR3_UINT8) "'@xfml'",
+ (pANTLR3_UINT8) "'@xfsp'",
+ (pANTLR3_UINT8) "'@xlia'",
+ (pANTLR3_UINT8) "'abort'",
+ (pANTLR3_UINT8) "'absent'",
+ (pANTLR3_UINT8) "'activity:'",
+ (pANTLR3_UINT8) "'and'",
+ (pANTLR3_UINT8) "'anycast'",
+ (pANTLR3_UINT8) "'array'",
+ (pANTLR3_UINT8) "'avmcode'",
+ (pANTLR3_UINT8) "'bind'",
+ (pANTLR3_UINT8) "'bind:'",
+ (pANTLR3_UINT8) "'bool'",
+ (pANTLR3_UINT8) "'boolean'",
+ (pANTLR3_UINT8) "'break'",
+ (pANTLR3_UINT8) "'broadcast'",
+ (pANTLR3_UINT8) "'buffer'",
+ (pANTLR3_UINT8) "'call'",
+ (pANTLR3_UINT8) "'changed#to'",
+ (pANTLR3_UINT8) "'changed'",
+ (pANTLR3_UINT8) "'channel'",
+ (pANTLR3_UINT8) "'char'",
+ (pANTLR3_UINT8) "'character'",
+ (pANTLR3_UINT8) "'checksat'",
+ (pANTLR3_UINT8) "'choice'",
+ (pANTLR3_UINT8) "'class'",
+ (pANTLR3_UINT8) "'clock'",
+ (pANTLR3_UINT8) "'connect'",
+ (pANTLR3_UINT8) "'connector'",
+ (pANTLR3_UINT8) "'const'",
+ (pANTLR3_UINT8) "'continue'",
+ (pANTLR3_UINT8) "'ctime'",
+ (pANTLR3_UINT8) "'ctor'",
+ (pANTLR3_UINT8) "'ctx:'",
+ (pANTLR3_UINT8) "'destroy'",
+ (pANTLR3_UINT8) "'disable'",
+ (pANTLR3_UINT8) "'do'",
+ (pANTLR3_UINT8) "'double'",
+ (pANTLR3_UINT8) "'dtime'",
+ (pANTLR3_UINT8) "'dynamic'",
+ (pANTLR3_UINT8) "'else'",
+ (pANTLR3_UINT8) "'elseif'",
+ (pANTLR3_UINT8) "'enable'",
+ (pANTLR3_UINT8) "'enum'",
+ (pANTLR3_UINT8) "'env'",
+ (pANTLR3_UINT8) "'event'",
+ (pANTLR3_UINT8) "'exit'",
+ (pANTLR3_UINT8) "'false'",
+ (pANTLR3_UINT8) "'fifo'",
+ (pANTLR3_UINT8) "'final'",
+ (pANTLR3_UINT8) "'float'",
+ (pANTLR3_UINT8) "'flow'",
+ (pANTLR3_UINT8) "'for'",
+ (pANTLR3_UINT8) "'fork'",
+ (pANTLR3_UINT8) "'from:'",
+ (pANTLR3_UINT8) "'fun'",
+ (pANTLR3_UINT8) "'goto'",
+ (pANTLR3_UINT8) "'guard'",
+ (pANTLR3_UINT8) "'iabort'",
+ (pANTLR3_UINT8) "'idisable'",
+ (pANTLR3_UINT8) "'ienable'",
+ (pANTLR3_UINT8) "'if'",
+ (pANTLR3_UINT8) "'in'",
+ (pANTLR3_UINT8) "'init'",
+ (pANTLR3_UINT8) "'init:'",
+ (pANTLR3_UINT8) "'inout'",
+ (pANTLR3_UINT8) "'input#buffer'",
+ (pANTLR3_UINT8) "'input#env'",
+ (pANTLR3_UINT8) "'input#flow'",
+ (pANTLR3_UINT8) "'input#rdv'",
+ (pANTLR3_UINT8) "'input#save'",
+ (pANTLR3_UINT8) "'input#var'",
+ (pANTLR3_UINT8) "'input'",
+ (pANTLR3_UINT8) "'input_enabled'",
+ (pANTLR3_UINT8) "'instance'",
+ (pANTLR3_UINT8) "'instance:'",
+ (pANTLR3_UINT8) "'int'",
+ (pANTLR3_UINT8) "'integer'",
+ (pANTLR3_UINT8) "'interval'",
+ (pANTLR3_UINT8) "'join'",
+ (pANTLR3_UINT8) "'lambda'",
+ (pANTLR3_UINT8) "'lifeline'",
+ (pANTLR3_UINT8) "'lifo'",
+ (pANTLR3_UINT8) "'list'",
+ (pANTLR3_UINT8) "'machine'",
+ (pANTLR3_UINT8) "'macro'",
+ (pANTLR3_UINT8) "'max:'",
+ (pANTLR3_UINT8) "'message'",
+ (pANTLR3_UINT8) "'moc:'",
+ (pANTLR3_UINT8) "'model'",
+ (pANTLR3_UINT8) "'model:'",
+ (pANTLR3_UINT8) "'multicast'",
+ (pANTLR3_UINT8) "'multififo'",
+ (pANTLR3_UINT8) "'multilifo'",
+ (pANTLR3_UINT8) "'multiplicity:'",
+ (pANTLR3_UINT8) "'multirdv'",
+ (pANTLR3_UINT8) "'multiset'",
+ (pANTLR3_UINT8) "'new'",
+ (pANTLR3_UINT8) "'null'",
+ (pANTLR3_UINT8) "'null<'",
+ (pANTLR3_UINT8) "'operator'",
+ (pANTLR3_UINT8) "'or'",
+ (pANTLR3_UINT8) "'out'",
+ (pANTLR3_UINT8) "'output#buffer'",
+ (pANTLR3_UINT8) "'output#env'",
+ (pANTLR3_UINT8) "'output#flow'",
+ (pANTLR3_UINT8) "'output#rdv'",
+ (pANTLR3_UINT8) "'output#var'",
+ (pANTLR3_UINT8) "'output'",
+ (pANTLR3_UINT8) "'package'",
+ (pANTLR3_UINT8) "'parent'",
+ (pANTLR3_UINT8) "'port'",
+ (pANTLR3_UINT8) "'pos_int'",
+ (pANTLR3_UINT8) "'pos_integer'",
+ (pANTLR3_UINT8) "'present'",
+ (pANTLR3_UINT8) "'prior:'",
+ (pANTLR3_UINT8) "'private'",
+ (pANTLR3_UINT8) "'proba:'",
+ (pANTLR3_UINT8) "'procedure'",
+ (pANTLR3_UINT8) "'protected'",
+ (pANTLR3_UINT8) "'prototype'",
+ (pANTLR3_UINT8) "'provided:'",
+ (pANTLR3_UINT8) "'public'",
+ (pANTLR3_UINT8) "'ram'",
+ (pANTLR3_UINT8) "'rat'",
+ (pANTLR3_UINT8) "'rational'",
+ (pANTLR3_UINT8) "'rdv'",
+ (pANTLR3_UINT8) "'real'",
+ (pANTLR3_UINT8) "'ref'",
+ (pANTLR3_UINT8) "'restart'",
+ (pANTLR3_UINT8) "'resume'",
+ (pANTLR3_UINT8) "'return'",
+ (pANTLR3_UINT8) "'returns:'",
+ (pANTLR3_UINT8) "'route'",
+ (pANTLR3_UINT8) "'routine'",
+ (pANTLR3_UINT8) "'rtc'",
+ (pANTLR3_UINT8) "'run'",
+ (pANTLR3_UINT8) "'rvector'",
+ (pANTLR3_UINT8) "'schedule'",
+ (pANTLR3_UINT8) "'self'",
+ (pANTLR3_UINT8) "'set'",
+ (pANTLR3_UINT8) "'signal'",
+ (pANTLR3_UINT8) "'size:'",
+ (pANTLR3_UINT8) "'solver:'",
+ (pANTLR3_UINT8) "'start'",
+ (pANTLR3_UINT8) "'state'",
+ (pANTLR3_UINT8) "'statemachine'",
+ (pANTLR3_UINT8) "'static'",
+ (pANTLR3_UINT8) "'status#being'",
+ (pANTLR3_UINT8) "'status#is'",
+ (pANTLR3_UINT8) "'status#was'",
+ (pANTLR3_UINT8) "'status#will'",
+ (pANTLR3_UINT8) "'step_mark'",
+ (pANTLR3_UINT8) "'stop'",
+ (pANTLR3_UINT8) "'string'",
+ (pANTLR3_UINT8) "'struct'",
+ (pANTLR3_UINT8) "'suspend'",
+ (pANTLR3_UINT8) "'system'",
+ (pANTLR3_UINT8) "'tguard'",
+ (pANTLR3_UINT8) "'time'",
+ (pANTLR3_UINT8) "'timed'",
+ (pANTLR3_UINT8) "'to:'",
+ (pANTLR3_UINT8) "'transient'",
+ (pANTLR3_UINT8) "'transition'",
+ (pANTLR3_UINT8) "'true'",
+ (pANTLR3_UINT8) "'type'",
+ (pANTLR3_UINT8) "'udouble'",
+ (pANTLR3_UINT8) "'ufloat'",
+ (pANTLR3_UINT8) "'uint'",
+ (pANTLR3_UINT8) "'uinteger'",
+ (pANTLR3_UINT8) "'unicast'",
+ (pANTLR3_UINT8) "'union'",
+ (pANTLR3_UINT8) "'universal'",
+ (pANTLR3_UINT8) "'unsafe'",
+ (pANTLR3_UINT8) "'urat'",
+ (pANTLR3_UINT8) "'urational'",
+ (pANTLR3_UINT8) "'ureal'",
+ (pANTLR3_UINT8) "'val'",
+ (pANTLR3_UINT8) "'var'",
+ (pANTLR3_UINT8) "'vector'",
+ (pANTLR3_UINT8) "'via'",
+ (pANTLR3_UINT8) "'volatile'",
+ (pANTLR3_UINT8) "'wait'",
+ (pANTLR3_UINT8) "'while'",
+ (pANTLR3_UINT8) "'|=>'"
+ };
+
+
+
+// Forward declare the locally static matching functions we have generated.
+//
+static
+ sep::System *
+ formalML (pfmlParser ctx, sep::WObjectManager & aWObjectManager);
+static
+ void
+ prologue_fml (pfmlParser ctx);
+static
+ void
+ prologue_attribute (pfmlParser ctx);
+static
+ void
+ prologue_options (pfmlParser ctx);
+static
+ sep::Modifier
+ modifier_declaration (pfmlParser ctx);
+static
+ sep::Modifier
+ modifier_direction (pfmlParser ctx);
+static
+ sep::Modifier
+ modifier_direction_text (pfmlParser ctx);
+static
+ void
+ modifier_set_direction_strict_text (pfmlParser ctx, sep::Modifier & mdfr);
+static
+ sep::Modifier
+ modifier_direction_symbol (pfmlParser ctx);
+static
+ sep::Modifier
+ modifier_param (pfmlParser ctx);
+static
+ fmlParser_procedure_modifier_specifier_return
+ procedure_modifier_specifier (pfmlParser ctx);
+static
+ fmlParser_executable_modifier_specifier_return
+ executable_modifier_specifier (pfmlParser ctx);
+static
+ fmlParser_instance_modifier_specifier_return
+ instance_modifier_specifier (pfmlParser ctx);
+static
+ fmlParser_modifier_transition_return
+ modifier_transition (pfmlParser ctx);
+static
+ sep::Package *
+ def_package (pfmlParser ctx);
+static
+ sep::System *
+ def_system (pfmlParser ctx);
+static
+ fmlParser_qualifiedNameID_return
+ qualifiedNameID (pfmlParser ctx);
+static
+ sep::avm_size_t
+ integer_constant (pfmlParser ctx);
+static
+ sep::avm_float_t
+ float_constant (pfmlParser ctx);
+static
+ void
+ section_header (pfmlParser ctx, sep::Machine * container);
+static
+ void
+ section_import (pfmlParser ctx, sep::Machine * container);
+static
+ void
+ include_package (pfmlParser ctx);
+static
+ void
+ section_procedure (pfmlParser ctx, sep::Machine * container);
+static
+ sep::Machine *
+ def_procedure (pfmlParser ctx, sep::Machine * container);
+static
+ void
+ def_machine_parameters (pfmlParser ctx, sep::Machine * machine);
+static
+ void
+ def_machine_variable_parameter_atom (pfmlParser ctx, sep::PropertyPart & paramDecl, sep::Modifier mdfr, sep::avm_offset_t offset);
+static
+ void
+ def_machine_returns (pfmlParser ctx, sep::Machine * machine, sep::Modifier mdfr);
+static
+ void
+ def_machine_variable_return_atom (pfmlParser ctx, sep::PropertyPart & paramDecl, sep::Modifier mdfr, sep::avm_offset_t offset);
+static
+ void
+ def_body_procedure (pfmlParser ctx, sep::Machine * procedure);
+static
+ void
+ def_body_procedure_section (pfmlParser ctx, sep::Machine * procedure);
+static
+ void
+ def_body_procedure_simplif (pfmlParser ctx, sep::Machine * procedure);
+static
+ void
+ section_composite_structure (pfmlParser ctx, sep::Machine * container);
+static
+ void
+ section_composite_generic (pfmlParser ctx, sep::Machine * container);
+static
+ void
+ section_machine_model (pfmlParser ctx, sep::Machine * container);
+static
+ void
+ section_machine_prototype (pfmlParser ctx, sep::Machine * container);
+static
+ void
+ section_machine_instance (pfmlParser ctx, sep::Machine * container);
+static
+ sep::Machine *
+ executable_machine (pfmlParser ctx, sep::Machine * container);
+static
+ sep::Machine *
+ executable_model_definiton (pfmlParser ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr);
+static
+ sep::Machine *
+ executable_instance_definiton (pfmlParser ctx, sep::Machine * container);
+static
+ sep::Machine *
+ decl_instance (pfmlParser ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr);
+static
+ void
+ def_instance_on_new_activity (pfmlParser ctx, sep::Machine * instance);
+static
+ void
+ def_instance_on_new_activity_parameter (pfmlParser ctx, sep::Machine * instance, sep::avm_size_t position);
+static
+ sep::Operator *
+ op_assign_param (pfmlParser ctx);
+static
+ void
+ def_instance_activity (pfmlParser ctx, sep::Machine * instance);
+static
+ void
+ section_behavior (pfmlParser ctx, sep::Machine * container);
+static
+ void
+ def_instance_count (pfmlParser ctx, sep::avm_size_t & initial, sep::avm_size_t & maximal);
+static
+ void
+ def_instance_count_atom (pfmlParser ctx, sep::avm_size_t & initial, sep::avm_size_t & maximal);
+static
+ sep::Machine *
+ def_machine (pfmlParser ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr);
+static
+ void
+ def_body_machine_using_section_header_predicat (pfmlParser ctx);
+static
+ void
+ def_body_machine_using_section_import_predicat (pfmlParser ctx);
+static
+ void
+ def_body_machine_using_section_parameter_predicat (pfmlParser ctx);
+static
+ void
+ def_body_machine_using_section_property_predicat (pfmlParser ctx);
+static
+ void
+ def_body_machine_using_section_predicat (pfmlParser ctx);
+static
+ void
+ def_body_machine (pfmlParser ctx, sep::Machine * machine);
+static
+ void
+ def_body_machine_section (pfmlParser ctx, sep::Machine * machine);
+static
+ void
+ def_body_machine_simplif (pfmlParser ctx, sep::Machine * machine);
+static
+ sep::Machine *
+ any_def_statemachine (pfmlParser ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr);
+static
+ sep::Machine *
+ def_statemachine (pfmlParser ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr);
+static
+ void
+ def_body_statemachine (pfmlParser ctx, sep::Machine * machine);
+static
+ void
+ section_region (pfmlParser ctx, sep::Machine * container);
+static
+ void
+ section_statemachine (pfmlParser ctx, sep::Machine * container);
+static
+ sep::Machine *
+ def_state (pfmlParser ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr);
+static
+ std::string
+ state_kw_id (pfmlParser ctx);
+static
+ std::string
+ state_id (pfmlParser ctx);
+static
+ sep::Machine *
+ def_state_singleton (pfmlParser ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr);
+static
+ void
+ executable_specifier (pfmlParser ctx, sep::Specifier & spcfr);
+static
+ void
+ executable_specifier_atom (pfmlParser ctx, sep::Specifier & spcfr);
+static
+ sep::BF
+ instance_machine_model (pfmlParser ctx);
+static
+ void
+ def_body_state (pfmlParser ctx, sep::Machine * state);
+static
+ void
+ def_body_state_section (pfmlParser ctx, sep::Machine * machine);
+static
+ void
+ def_body_state_simplif (pfmlParser ctx, sep::Machine * state);
+static
+ void
+ section_transition (pfmlParser ctx, sep::Machine * state);
+static
+ void
+ def_transition (pfmlParser ctx, sep::Machine * state, sep::Modifier mdfr, sep::Specifier spcfr);
+static
+ sep::Transition::MOC_KIND
+ kind_transition (pfmlParser ctx);
+static
+ sep::Transition::moc_kind_t
+ moc_transition_attribute (pfmlParser ctx);
+static
+ void
+ moc_transition (pfmlParser ctx, sep::Transition * trans);
+static
+ void
+ moc_transition_atom (pfmlParser ctx, sep::Transition * trans);
+static
+ void
+ moe_transition (pfmlParser ctx, sep::Transition * trans);
+static
+ sep::BFCode
+ transition_statement (pfmlParser ctx);
+static
+ void
+ transition_trigger (pfmlParser ctx, sep::BFCode & ac);
+static
+ void
+ transition_guard (pfmlParser ctx, sep::BFCode & ac);
+static
+ void
+ transition_timed_guard (pfmlParser ctx, sep::BFCode & ac);
+static
+ void
+ transition_effect (pfmlParser ctx, sep::BFCode & ac);
+static
+ sep::BF
+ target_state_id (pfmlParser ctx);
+static
+ std::string
+ target_state_kw_id (pfmlParser ctx);
+static
+ void
+ def_state_activity (pfmlParser ctx, sep::Machine * state);
+static
+ void
+ section_header_import_parameter_property (pfmlParser ctx, sep::Machine * container);
+static
+ void
+ section_parameter (pfmlParser ctx, sep::Machine * container);
+static
+ void
+ section_property (pfmlParser ctx, sep::Machine * container);
+static
+ void
+ section_property_free_declaration (pfmlParser ctx, sep::Machine * container);
+static
+ void
+ property_declaration (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+static
+ void
+ decl_property_element (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+static
+ fmlParser_labelled_argument_return
+ labelled_argument (pfmlParser ctx);
+static
+ void
+ decl_instance_machine_params (pfmlParser ctx, sep::Machine * machine);
+static
+ void
+ decl_instance_machine_returns (pfmlParser ctx, sep::Machine * machine);
+static
+ void
+ activity_machine_param_return (pfmlParser ctx, const sep::BF & argMachine, sep::BFCode & ac);
+static
+ void
+ decl_port (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+static
+ void
+ decl_port_impl (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr, sep::IComPoint::ENUM_IO_NATURE nature);
+static
+ void
+ decl_signal (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+static
+ void
+ decl_signal_impl (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr, sep::IComPoint::ENUM_IO_NATURE nature);
+static
+ void
+ type_param_com (pfmlParser ctx, sep::Port * port);
+static
+ void
+ param_com_atom (pfmlParser ctx, sep::Port * port, sep::avm_offset_t offset);
+static
+ void
+ decl_buffer (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+static
+ void
+ decl_buffer_impl (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+static
+ fmlParser_def_buffer_return
+ def_buffer (pfmlParser ctx);
+static
+ sep::avm_type_specifier_kind_t
+ policy_buffer (pfmlParser ctx);
+static
+ sep::BF
+ ref_buffer (pfmlParser ctx, sep::Machine * machine);
+static
+ void
+ initial_buffer_contents (pfmlParser ctx, const sep::Buffer * buffer);
+static
+ void
+ decl_channel (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+static
+ void
+ decl_channel_port (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+static
+ void
+ decl_channel_var (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+static
+ void
+ decl_variable (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+static
+ void
+ decl_variable_time_clock_impl (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+static
+ void
+ decl_variable_impl (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+static
+ void
+ decl_variable_atom_impl (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+static
+ void
+ decl_typed_variable_atom_impl (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr, const sep::BF & type);
+static
+ sep::BF
+ initial_value (pfmlParser ctx);
+static
+ sep::BF
+ type_var (pfmlParser ctx);
+static
+ sep::BF
+ def_type_array (pfmlParser ctx, sep::BF baseT, const std::string & tid);
+static
+ int
+ def_type_array_size (pfmlParser ctx);
+static
+ sep::BF
+ def_type_container (pfmlParser ctx, const std::string & tid);
+static
+ sep::avm_type_specifier_kind_t
+ specifier_buffer (pfmlParser ctx);
+static
+ sep::BF
+ def_type_interval (pfmlParser ctx, const std::string & tid);
+static
+ sep::BF
+ base_type_var (pfmlParser ctx);
+static
+ sep::TypeSpecifier
+ primitive_type (pfmlParser ctx);
+static
+ int
+ bit_field_size (pfmlParser ctx);
+static
+ fmlParser_string_field_size_return
+ string_field_size (pfmlParser ctx);
+static
+ fmlParser_range_constant_return
+ range_constant (pfmlParser ctx);
+static
+ void
+ on_write_var_routine_def (pfmlParser ctx, sep::Variable * var);
+static
+ void
+ var_routine_def (pfmlParser ctx, sep::Variable * var);
+static
+ void
+ routine_single_param (pfmlParser ctx, sep::Routine & routine, const sep::BF & dftType);
+static
+ void
+ def_enum (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+static
+ void
+ def_enum_impl (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr, const std::string & tid);
+static
+ void
+ def_struct (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+static
+ void
+ def_class_structure_impl (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr, const std::string & tid);
+static
+ void
+ def_choice (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+static
+ void
+ def_choice_impl (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr, const std::string & tid);
+static
+ void
+ def_union (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+static
+ void
+ def_union_impl (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr, const std::string & tid);
+static
+ void
+ def_method (pfmlParser ctx, sep::PropertyPart & declProperty);
+static
+ void
+ decl_parameters (pfmlParser ctx);
+static
+ void
+ def_type (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+static
+ void
+ def_type_impl (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+static
+ void
+ def_type_atom_impl (pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+static
+ void
+ def_typedef_constraint (pfmlParser ctx, sep::DataType * aliasT);
+static
+ sep::TypeSpecifier
+ time_type (pfmlParser ctx);
+static
+ sep::TypeSpecifier
+ time_clock_type (pfmlParser ctx);
+static
+ sep::TypeSpecifier
+ time_type_domain (pfmlParser ctx);
+static
+ void
+ section_model_of_computation (pfmlParser ctx, sep::Machine * container);
+static
+ void
+ section_routine (pfmlParser ctx, sep::Machine * container);
+static
+ void
+ def_routine_model (pfmlParser ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr);
+static
+ void
+ def_routine_model_impl (pfmlParser ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr);
+static
+ void
+ def_routine_parameters (pfmlParser ctx, sep::Routine & routine);
+static
+ void
+ def_routine_param_atom (pfmlParser ctx, sep::Routine & routine, sep::avm_size_t offset);
+static
+ void
+ def_routine_returns (pfmlParser ctx, sep::Routine & routine);
+static
+ void
+ def_routine_returns_atom (pfmlParser ctx, sep::Routine & routine, sep::avm_size_t offset);
+static
+ void
+ section_model_of_execution (pfmlParser ctx, sep::Machine * container);
+static
+ void
+ def_moe_primitive (pfmlParser ctx, sep::Machine * container);
+static
+ void
+ def_routine_seq (pfmlParser ctx, sep::Routine & routine);
+static
+ void
+ section_model_of_interaction (pfmlParser ctx, sep::Machine * machine);
+static
+ void
+ com_protocol (pfmlParser ctx, sep::Machine * machine, sep::ComProtocol * cp);
+static
+ void
+ com_cast (pfmlParser ctx, sep::ComProtocol * cp);
+static
+ sep::BF
+ buffer_com (pfmlParser ctx, sep::Machine * machine);
+static
+ void
+ com_connect (pfmlParser ctx, sep::Machine * machine, sep::InteractionPart * anInteraction);
+static
+ void
+ com_route (pfmlParser ctx, sep::Machine * machine, sep::Connector * aConnector);
+static
+ void
+ com_port (pfmlParser ctx, sep::Machine * machine, sep::ComRoute * comRoute);
+static
+ sep::BF
+ com_port_id (pfmlParser ctx, sep::Machine * machine, sep::Machine * comMachine);
+static
+ sep::BFCode
+ statement (pfmlParser ctx);
+static
+ sep::BFCode
+ block_statement (pfmlParser ctx);
+static
+ sep::Operator *
+ op_block (pfmlParser ctx);
+static
+ sep::Operator *
+ op_sequence (pfmlParser ctx);
+static
+ sep::Operator *
+ op_scheduling (pfmlParser ctx);
+static
+ sep::Operator *
+ op_concurrency (pfmlParser ctx);
+static
+ sep::Operator *
+ op_invokable (pfmlParser ctx);
+static
+ sep::BFCode
+ prefix_statement (pfmlParser ctx);
+static
+ sep::BFCode
+ prefix_expression (pfmlParser ctx);
+static
+ sep::Operator *
+ avm_operator (pfmlParser ctx);
+static
+ sep::BFCode
+ statement_invoke_method (pfmlParser ctx);
+static
+ sep::BFCode
+ statement_invoke (pfmlParser ctx);
+static
+ sep::BFCode
+ expression_invoke (pfmlParser ctx);
+static
+ sep::BFCode
+ statement_activity_new (pfmlParser ctx);
+static
+ void
+ decl_instance_dynamic_impl (pfmlParser ctx, sep::Machine * container, sep::Machine * ptrInstance);
+static
+ sep::BFCode
+ expression_activity_new (pfmlParser ctx);
+static
+ sep::BFCode
+ statement_prompt (pfmlParser ctx);
+static
+ sep::BFCode
+ statement_prompt_impl (pfmlParser ctx);
+static
+ sep::BFCode
+ statement_prompt_obs (pfmlParser ctx);
+static
+ sep::BFCode
+ statement_prompt_obs_com (pfmlParser ctx, const sep::BF & varMachine);
+static
+ sep::BFCode
+ meta_statement (pfmlParser ctx);
+static
+ sep::BFCode
+ statement_assign (pfmlParser ctx);
+static
+ sep::BF
+ lvalue (pfmlParser ctx);
+static
+ void
+ parameters (pfmlParser ctx, const sep::BFCode & ac);
+static
+ sep::BFCode
+ statement_com (pfmlParser ctx);
+static
+ sep::BFCode
+ statement_com_input (pfmlParser ctx);
+static
+ sep::BFCode
+ statement_com_output (pfmlParser ctx);
+static
+ void
+ parameters_port (pfmlParser ctx, sep::Port * port, const sep::BFCode & ac);
+static
+ sep::BFCode
+ expression_com (pfmlParser ctx);
+static
+ sep::BFCode
+ statement_constraint (pfmlParser ctx);
+static
+ sep::BFCode
+ statement_guard (pfmlParser ctx);
+static
+ sep::BFCode
+ statement_timed_guard (pfmlParser ctx);
+static
+ sep::BFCode
+ statement_checksat (pfmlParser ctx);
+static
+ sep::BFCode
+ expression_guard (pfmlParser ctx);
+static
+ sep::BFCode
+ statement_ite (pfmlParser ctx);
+static
+ sep::BFCode
+ expression_ite (pfmlParser ctx);
+static
+ sep::BFCode
+ statement_iteration (pfmlParser ctx);
+static
+ sep::BFCode
+ for_assign_header (pfmlParser ctx);
+static
+ sep::BFCode
+ statement_jump (pfmlParser ctx);
+static
+ sep::BFCode
+ expression_lambda (pfmlParser ctx);
+static
+ sep::BFCode
+ expression_status (pfmlParser ctx);
+static
+ sep::Operator *
+ op_activity (pfmlParser ctx);
+static
+ sep::BFCode
+ statement_activity (pfmlParser ctx);
+static
+ sep::BFCode
+ statement_init_flow (pfmlParser ctx, const sep::BF & flowTarget);
+static
+ sep::BFCode
+ statement_invoke_routine (pfmlParser ctx);
+static
+ void
+ invoke_routine_params (pfmlParser ctx, sep::Routine * invokeRoutine);
+static
+ void
+ invoke_routine_returns (pfmlParser ctx, sep::Routine * invokeRoutine);
+static
+ sep::BFCode
+ statement_moc (pfmlParser ctx);
+static
+ sep::BF
+ expression (pfmlParser ctx);
+static
+ sep::BF
+ conditionalExpression (pfmlParser ctx);
+static
+ sep::BF
+ scheduleExpression (pfmlParser ctx);
+static
+ sep::BF
+ conditionalOrExpression (pfmlParser ctx);
+static
+ sep::BF
+ conditionalAndExpression (pfmlParser ctx);
+static
+ sep::BF
+ bitwiseOrExpression (pfmlParser ctx);
+static
+ sep::BF
+ bitwiseXorExpression (pfmlParser ctx);
+static
+ sep::BF
+ bitwiseAndExpression (pfmlParser ctx);
+static
+ sep::BF
+ equalityExpression (pfmlParser ctx);
+static
+ sep::Operator *
+ equalOp (pfmlParser ctx);
+static
+ sep::BF
+ relationalExpression (pfmlParser ctx);
+static
+ sep::Operator *
+ relationalOp (pfmlParser ctx);
+static
+ sep::BF
+ shiftExpression (pfmlParser ctx);
+static
+ sep::Operator *
+ shiftOp (pfmlParser ctx);
+static
+ sep::BF
+ additiveExpression (pfmlParser ctx);
+static
+ sep::BF
+ multiplicativeExpression (pfmlParser ctx);
+static
+ sep::BF
+ unaryExpression (pfmlParser ctx);
+static
+ sep::BFCode
+ ctorExpression (pfmlParser ctx);
+static
+ sep::BFCode
+ quote_expression (pfmlParser ctx);
+static
+ sep::BFCode
+ meta_eval_expression (pfmlParser ctx);
+static
+ sep::BF
+ primary (pfmlParser ctx);
+static
+ sep::BF
+ primary_ufid (pfmlParser ctx, const std::string & mainId);
+static
+ sep::BF
+ primary_ufi (pfmlParser ctx, const std::string & locatorId);
+static
+ sep::BF
+ primary_invoke (pfmlParser ctx, const std::string & mainId);
+static
+ sep::BF
+ literal (pfmlParser ctx);
+static
+ sep::BF
+ collection_of_expression (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred21_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred56_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred57_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred58_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred59_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred60_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred61_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred62_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred95_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred115_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred126_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred127_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred138_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred153_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred170_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred296_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred304_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred324_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred326_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred329_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred340_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred341_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred343_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred344_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred366_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred370_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred373_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred375_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred407_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred412_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred417_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred419_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred426_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred431_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred438_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred446_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred493_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred514_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred517_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred520_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred531_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred535_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred537_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred539_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred555_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred559_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred574_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred609_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred636_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred643_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred705_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred709_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred714_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred778_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred779_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred780_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred781_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred802_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred804_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred861_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred872_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred891_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred894_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred896_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred897_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred898_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred946_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred947_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred948_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred949_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred950_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred951_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred952_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred953_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred954_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred955_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred956_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred957_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred958_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred959_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred960_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred961_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred962_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred963_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred964_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred965_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred966_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred967_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred968_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred969_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred970_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred971_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred972_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred973_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred974_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred975_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred976_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred977_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred980_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred981_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred982_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred983_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred984_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred985_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred986_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred987_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred991_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred992_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred997_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred1000_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred1003_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred1020_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred1021_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred1027_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred1029_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred1030_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred1033_fml (pfmlParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred1035_fml (pfmlParser ctx);
+static void fmlParserFree(pfmlParser ctx);
+static void fmlParserReset (pfmlParser ctx);
+
+/* For use in tree output where we are accumulating rule labels via label += ruleRef
+ * we need a function that knows how to free a return scope when the list is destroyed.
+ * We cannot just use ANTLR3_FREE because in debug tracking mode, this is a macro.
+ */
+static void ANTLR3_CDECL freeScope(void * scope)
+{
+ ANTLR3_FREE(scope);
+}
+
+/** \brief Name of the grammar file that generated this code
+ */
+static const char fileName[] = "/home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g";
+
+/** \brief Return the name of the grammar file that generated this code.
+ */
+static const char * getGrammarFileName()
+{
+ return fileName;
+}
+/** \brief Create a new fmlParser parser and return a context for it.
+ *
+ * \param[in] instream Pointer to an input stream interface.
+ *
+ * \return Pointer to new parser context upon success.
+ */
+ANTLR3_API pfmlParser
+fmlParserNew (pANTLR3_COMMON_TOKEN_STREAM instream)
+{
+ // See if we can create a new parser with the standard constructor
+ //
+ return fmlParserNewSSD(instream, NULL);
+}
+
+/** \brief Create a new fmlParser parser and return a context for it.
+ *
+ * \param[in] instream Pointer to an input stream interface.
+ *
+ * \return Pointer to new parser context upon success.
+ */
+ANTLR3_API pfmlParser
+fmlParserNewSSD (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
+{
+ pfmlParser ctx; /* Context structure we will build and return */
+
+ ctx = (pfmlParser) ANTLR3_CALLOC(1, sizeof(fmlParser));
+
+ if (ctx == NULL)
+ {
+ // Failed to allocate memory for parser context
+ //
+ return NULL;
+ }
+
+ /* -------------------------------------------------------------------
+ * Memory for basic structure is allocated, now to fill in
+ * the base ANTLR3 structures. We initialize the function pointers
+ * for the standard ANTLR3 parser function set, but upon return
+ * from here, the programmer may set the pointers to provide custom
+ * implementations of each function.
+ *
+ * We don't use the macros defined in fmlParser.h here, in order that you can get a sense
+ * of what goes where.
+ */
+
+ /* Create a base parser/recognizer, using the supplied token stream
+ */
+ ctx->pParser = antlr3ParserNewStream(ANTLR3_SIZE_HINT, instream->tstream, state);
+ /* Install the implementation of our fmlParser interface
+ */
+ ctx->formalML = formalML;
+ ctx->prologue_fml = prologue_fml;
+ ctx->prologue_attribute = prologue_attribute;
+ ctx->prologue_options = prologue_options;
+ ctx->modifier_declaration = modifier_declaration;
+ ctx->modifier_direction = modifier_direction;
+ ctx->modifier_direction_text = modifier_direction_text;
+ ctx->modifier_set_direction_strict_text = modifier_set_direction_strict_text;
+ ctx->modifier_direction_symbol = modifier_direction_symbol;
+ ctx->modifier_param = modifier_param;
+ ctx->procedure_modifier_specifier = procedure_modifier_specifier;
+ ctx->executable_modifier_specifier = executable_modifier_specifier;
+ ctx->instance_modifier_specifier = instance_modifier_specifier;
+ ctx->modifier_transition = modifier_transition;
+ ctx->def_package = def_package;
+ ctx->def_system = def_system;
+ ctx->qualifiedNameID = qualifiedNameID;
+ ctx->integer_constant = integer_constant;
+ ctx->float_constant = float_constant;
+ ctx->section_header = section_header;
+ ctx->section_import = section_import;
+ ctx->include_package = include_package;
+ ctx->section_procedure = section_procedure;
+ ctx->def_procedure = def_procedure;
+ ctx->def_machine_parameters = def_machine_parameters;
+ ctx->def_machine_variable_parameter_atom = def_machine_variable_parameter_atom;
+ ctx->def_machine_returns = def_machine_returns;
+ ctx->def_machine_variable_return_atom = def_machine_variable_return_atom;
+ ctx->def_body_procedure = def_body_procedure;
+ ctx->def_body_procedure_section = def_body_procedure_section;
+ ctx->def_body_procedure_simplif = def_body_procedure_simplif;
+ ctx->section_composite_structure = section_composite_structure;
+ ctx->section_composite_generic = section_composite_generic;
+ ctx->section_machine_model = section_machine_model;
+ ctx->section_machine_prototype = section_machine_prototype;
+ ctx->section_machine_instance = section_machine_instance;
+ ctx->executable_machine = executable_machine;
+ ctx->executable_model_definiton = executable_model_definiton;
+ ctx->executable_instance_definiton = executable_instance_definiton;
+ ctx->decl_instance = decl_instance;
+ ctx->def_instance_on_new_activity = def_instance_on_new_activity;
+ ctx->def_instance_on_new_activity_parameter = def_instance_on_new_activity_parameter;
+ ctx->op_assign_param = op_assign_param;
+ ctx->def_instance_activity = def_instance_activity;
+ ctx->section_behavior = section_behavior;
+ ctx->def_instance_count = def_instance_count;
+ ctx->def_instance_count_atom = def_instance_count_atom;
+ ctx->def_machine = def_machine;
+ ctx->def_body_machine_using_section_header_predicat = def_body_machine_using_section_header_predicat;
+ ctx->def_body_machine_using_section_import_predicat = def_body_machine_using_section_import_predicat;
+ ctx->def_body_machine_using_section_parameter_predicat = def_body_machine_using_section_parameter_predicat;
+ ctx->def_body_machine_using_section_property_predicat = def_body_machine_using_section_property_predicat;
+ ctx->def_body_machine_using_section_predicat = def_body_machine_using_section_predicat;
+ ctx->def_body_machine = def_body_machine;
+ ctx->def_body_machine_section = def_body_machine_section;
+ ctx->def_body_machine_simplif = def_body_machine_simplif;
+ ctx->any_def_statemachine = any_def_statemachine;
+ ctx->def_statemachine = def_statemachine;
+ ctx->def_body_statemachine = def_body_statemachine;
+ ctx->section_region = section_region;
+ ctx->section_statemachine = section_statemachine;
+ ctx->def_state = def_state;
+ ctx->state_kw_id = state_kw_id;
+ ctx->state_id = state_id;
+ ctx->def_state_singleton = def_state_singleton;
+ ctx->executable_specifier = executable_specifier;
+ ctx->executable_specifier_atom = executable_specifier_atom;
+ ctx->instance_machine_model = instance_machine_model;
+ ctx->def_body_state = def_body_state;
+ ctx->def_body_state_section = def_body_state_section;
+ ctx->def_body_state_simplif = def_body_state_simplif;
+ ctx->section_transition = section_transition;
+ ctx->def_transition = def_transition;
+ ctx->kind_transition = kind_transition;
+ ctx->moc_transition_attribute = moc_transition_attribute;
+ ctx->moc_transition = moc_transition;
+ ctx->moc_transition_atom = moc_transition_atom;
+ ctx->moe_transition = moe_transition;
+ ctx->transition_statement = transition_statement;
+ ctx->transition_trigger = transition_trigger;
+ ctx->transition_guard = transition_guard;
+ ctx->transition_timed_guard = transition_timed_guard;
+ ctx->transition_effect = transition_effect;
+ ctx->target_state_id = target_state_id;
+ ctx->target_state_kw_id = target_state_kw_id;
+ ctx->def_state_activity = def_state_activity;
+ ctx->section_header_import_parameter_property = section_header_import_parameter_property;
+ ctx->section_parameter = section_parameter;
+ ctx->section_property = section_property;
+ ctx->section_property_free_declaration = section_property_free_declaration;
+ ctx->property_declaration = property_declaration;
+ ctx->decl_property_element = decl_property_element;
+ ctx->labelled_argument = labelled_argument;
+ ctx->decl_instance_machine_params = decl_instance_machine_params;
+ ctx->decl_instance_machine_returns = decl_instance_machine_returns;
+ ctx->activity_machine_param_return = activity_machine_param_return;
+ ctx->decl_port = decl_port;
+ ctx->decl_port_impl = decl_port_impl;
+ ctx->decl_signal = decl_signal;
+ ctx->decl_signal_impl = decl_signal_impl;
+ ctx->type_param_com = type_param_com;
+ ctx->param_com_atom = param_com_atom;
+ ctx->decl_buffer = decl_buffer;
+ ctx->decl_buffer_impl = decl_buffer_impl;
+ ctx->def_buffer = def_buffer;
+ ctx->policy_buffer = policy_buffer;
+ ctx->ref_buffer = ref_buffer;
+ ctx->initial_buffer_contents = initial_buffer_contents;
+ ctx->decl_channel = decl_channel;
+ ctx->decl_channel_port = decl_channel_port;
+ ctx->decl_channel_var = decl_channel_var;
+ ctx->decl_variable = decl_variable;
+ ctx->decl_variable_time_clock_impl = decl_variable_time_clock_impl;
+ ctx->decl_variable_impl = decl_variable_impl;
+ ctx->decl_variable_atom_impl = decl_variable_atom_impl;
+ ctx->decl_typed_variable_atom_impl = decl_typed_variable_atom_impl;
+ ctx->initial_value = initial_value;
+ ctx->type_var = type_var;
+ ctx->def_type_array = def_type_array;
+ ctx->def_type_array_size = def_type_array_size;
+ ctx->def_type_container = def_type_container;
+ ctx->specifier_buffer = specifier_buffer;
+ ctx->def_type_interval = def_type_interval;
+ ctx->base_type_var = base_type_var;
+ ctx->primitive_type = primitive_type;
+ ctx->bit_field_size = bit_field_size;
+ ctx->string_field_size = string_field_size;
+ ctx->range_constant = range_constant;
+ ctx->on_write_var_routine_def = on_write_var_routine_def;
+ ctx->var_routine_def = var_routine_def;
+ ctx->routine_single_param = routine_single_param;
+ ctx->def_enum = def_enum;
+ ctx->def_enum_impl = def_enum_impl;
+ ctx->def_struct = def_struct;
+ ctx->def_class_structure_impl = def_class_structure_impl;
+ ctx->def_choice = def_choice;
+ ctx->def_choice_impl = def_choice_impl;
+ ctx->def_union = def_union;
+ ctx->def_union_impl = def_union_impl;
+ ctx->def_method = def_method;
+ ctx->decl_parameters = decl_parameters;
+ ctx->def_type = def_type;
+ ctx->def_type_impl = def_type_impl;
+ ctx->def_type_atom_impl = def_type_atom_impl;
+ ctx->def_typedef_constraint = def_typedef_constraint;
+ ctx->time_type = time_type;
+ ctx->time_clock_type = time_clock_type;
+ ctx->time_type_domain = time_type_domain;
+ ctx->section_model_of_computation = section_model_of_computation;
+ ctx->section_routine = section_routine;
+ ctx->def_routine_model = def_routine_model;
+ ctx->def_routine_model_impl = def_routine_model_impl;
+ ctx->def_routine_parameters = def_routine_parameters;
+ ctx->def_routine_param_atom = def_routine_param_atom;
+ ctx->def_routine_returns = def_routine_returns;
+ ctx->def_routine_returns_atom = def_routine_returns_atom;
+ ctx->section_model_of_execution = section_model_of_execution;
+ ctx->def_moe_primitive = def_moe_primitive;
+ ctx->def_routine_seq = def_routine_seq;
+ ctx->section_model_of_interaction = section_model_of_interaction;
+ ctx->com_protocol = com_protocol;
+ ctx->com_cast = com_cast;
+ ctx->buffer_com = buffer_com;
+ ctx->com_connect = com_connect;
+ ctx->com_route = com_route;
+ ctx->com_port = com_port;
+ ctx->com_port_id = com_port_id;
+ ctx->statement = statement;
+ ctx->block_statement = block_statement;
+ ctx->op_block = op_block;
+ ctx->op_sequence = op_sequence;
+ ctx->op_scheduling = op_scheduling;
+ ctx->op_concurrency = op_concurrency;
+ ctx->op_invokable = op_invokable;
+ ctx->prefix_statement = prefix_statement;
+ ctx->prefix_expression = prefix_expression;
+ ctx->avm_operator = avm_operator;
+ ctx->statement_invoke_method = statement_invoke_method;
+ ctx->statement_invoke = statement_invoke;
+ ctx->expression_invoke = expression_invoke;
+ ctx->statement_activity_new = statement_activity_new;
+ ctx->decl_instance_dynamic_impl = decl_instance_dynamic_impl;
+ ctx->expression_activity_new = expression_activity_new;
+ ctx->statement_prompt = statement_prompt;
+ ctx->statement_prompt_impl = statement_prompt_impl;
+ ctx->statement_prompt_obs = statement_prompt_obs;
+ ctx->statement_prompt_obs_com = statement_prompt_obs_com;
+ ctx->meta_statement = meta_statement;
+ ctx->statement_assign = statement_assign;
+ ctx->lvalue = lvalue;
+ ctx->parameters = parameters;
+ ctx->statement_com = statement_com;
+ ctx->statement_com_input = statement_com_input;
+ ctx->statement_com_output = statement_com_output;
+ ctx->parameters_port = parameters_port;
+ ctx->expression_com = expression_com;
+ ctx->statement_constraint = statement_constraint;
+ ctx->statement_guard = statement_guard;
+ ctx->statement_timed_guard = statement_timed_guard;
+ ctx->statement_checksat = statement_checksat;
+ ctx->expression_guard = expression_guard;
+ ctx->statement_ite = statement_ite;
+ ctx->expression_ite = expression_ite;
+ ctx->statement_iteration = statement_iteration;
+ ctx->for_assign_header = for_assign_header;
+ ctx->statement_jump = statement_jump;
+ ctx->expression_lambda = expression_lambda;
+ ctx->expression_status = expression_status;
+ ctx->op_activity = op_activity;
+ ctx->statement_activity = statement_activity;
+ ctx->statement_init_flow = statement_init_flow;
+ ctx->statement_invoke_routine = statement_invoke_routine;
+ ctx->invoke_routine_params = invoke_routine_params;
+ ctx->invoke_routine_returns = invoke_routine_returns;
+ ctx->statement_moc = statement_moc;
+ ctx->expression = expression;
+ ctx->conditionalExpression = conditionalExpression;
+ ctx->scheduleExpression = scheduleExpression;
+ ctx->conditionalOrExpression = conditionalOrExpression;
+ ctx->conditionalAndExpression = conditionalAndExpression;
+ ctx->bitwiseOrExpression = bitwiseOrExpression;
+ ctx->bitwiseXorExpression = bitwiseXorExpression;
+ ctx->bitwiseAndExpression = bitwiseAndExpression;
+ ctx->equalityExpression = equalityExpression;
+ ctx->equalOp = equalOp;
+ ctx->relationalExpression = relationalExpression;
+ ctx->relationalOp = relationalOp;
+ ctx->shiftExpression = shiftExpression;
+ ctx->shiftOp = shiftOp;
+ ctx->additiveExpression = additiveExpression;
+ ctx->multiplicativeExpression = multiplicativeExpression;
+ ctx->unaryExpression = unaryExpression;
+ ctx->ctorExpression = ctorExpression;
+ ctx->quote_expression = quote_expression;
+ ctx->meta_eval_expression = meta_eval_expression;
+ ctx->primary = primary;
+ ctx->primary_ufid = primary_ufid;
+ ctx->primary_ufi = primary_ufi;
+ ctx->primary_invoke = primary_invoke;
+ ctx->literal = literal;
+ ctx->collection_of_expression = collection_of_expression;
+ ctx->synpred21_fml = synpred21_fml;
+ ctx->synpred56_fml = synpred56_fml;
+ ctx->synpred57_fml = synpred57_fml;
+ ctx->synpred58_fml = synpred58_fml;
+ ctx->synpred59_fml = synpred59_fml;
+ ctx->synpred60_fml = synpred60_fml;
+ ctx->synpred61_fml = synpred61_fml;
+ ctx->synpred62_fml = synpred62_fml;
+ ctx->synpred95_fml = synpred95_fml;
+ ctx->synpred115_fml = synpred115_fml;
+ ctx->synpred126_fml = synpred126_fml;
+ ctx->synpred127_fml = synpred127_fml;
+ ctx->synpred138_fml = synpred138_fml;
+ ctx->synpred153_fml = synpred153_fml;
+ ctx->synpred170_fml = synpred170_fml;
+ ctx->synpred296_fml = synpred296_fml;
+ ctx->synpred304_fml = synpred304_fml;
+ ctx->synpred324_fml = synpred324_fml;
+ ctx->synpred326_fml = synpred326_fml;
+ ctx->synpred329_fml = synpred329_fml;
+ ctx->synpred340_fml = synpred340_fml;
+ ctx->synpred341_fml = synpred341_fml;
+ ctx->synpred343_fml = synpred343_fml;
+ ctx->synpred344_fml = synpred344_fml;
+ ctx->synpred366_fml = synpred366_fml;
+ ctx->synpred370_fml = synpred370_fml;
+ ctx->synpred373_fml = synpred373_fml;
+ ctx->synpred375_fml = synpred375_fml;
+ ctx->synpred407_fml = synpred407_fml;
+ ctx->synpred412_fml = synpred412_fml;
+ ctx->synpred417_fml = synpred417_fml;
+ ctx->synpred419_fml = synpred419_fml;
+ ctx->synpred426_fml = synpred426_fml;
+ ctx->synpred431_fml = synpred431_fml;
+ ctx->synpred438_fml = synpred438_fml;
+ ctx->synpred446_fml = synpred446_fml;
+ ctx->synpred493_fml = synpred493_fml;
+ ctx->synpred514_fml = synpred514_fml;
+ ctx->synpred517_fml = synpred517_fml;
+ ctx->synpred520_fml = synpred520_fml;
+ ctx->synpred531_fml = synpred531_fml;
+ ctx->synpred535_fml = synpred535_fml;
+ ctx->synpred537_fml = synpred537_fml;
+ ctx->synpred539_fml = synpred539_fml;
+ ctx->synpred555_fml = synpred555_fml;
+ ctx->synpred559_fml = synpred559_fml;
+ ctx->synpred574_fml = synpred574_fml;
+ ctx->synpred609_fml = synpred609_fml;
+ ctx->synpred636_fml = synpred636_fml;
+ ctx->synpred643_fml = synpred643_fml;
+ ctx->synpred705_fml = synpred705_fml;
+ ctx->synpred709_fml = synpred709_fml;
+ ctx->synpred714_fml = synpred714_fml;
+ ctx->synpred778_fml = synpred778_fml;
+ ctx->synpred779_fml = synpred779_fml;
+ ctx->synpred780_fml = synpred780_fml;
+ ctx->synpred781_fml = synpred781_fml;
+ ctx->synpred802_fml = synpred802_fml;
+ ctx->synpred804_fml = synpred804_fml;
+ ctx->synpred861_fml = synpred861_fml;
+ ctx->synpred872_fml = synpred872_fml;
+ ctx->synpred891_fml = synpred891_fml;
+ ctx->synpred894_fml = synpred894_fml;
+ ctx->synpred896_fml = synpred896_fml;
+ ctx->synpred897_fml = synpred897_fml;
+ ctx->synpred898_fml = synpred898_fml;
+ ctx->synpred946_fml = synpred946_fml;
+ ctx->synpred947_fml = synpred947_fml;
+ ctx->synpred948_fml = synpred948_fml;
+ ctx->synpred949_fml = synpred949_fml;
+ ctx->synpred950_fml = synpred950_fml;
+ ctx->synpred951_fml = synpred951_fml;
+ ctx->synpred952_fml = synpred952_fml;
+ ctx->synpred953_fml = synpred953_fml;
+ ctx->synpred954_fml = synpred954_fml;
+ ctx->synpred955_fml = synpred955_fml;
+ ctx->synpred956_fml = synpred956_fml;
+ ctx->synpred957_fml = synpred957_fml;
+ ctx->synpred958_fml = synpred958_fml;
+ ctx->synpred959_fml = synpred959_fml;
+ ctx->synpred960_fml = synpred960_fml;
+ ctx->synpred961_fml = synpred961_fml;
+ ctx->synpred962_fml = synpred962_fml;
+ ctx->synpred963_fml = synpred963_fml;
+ ctx->synpred964_fml = synpred964_fml;
+ ctx->synpred965_fml = synpred965_fml;
+ ctx->synpred966_fml = synpred966_fml;
+ ctx->synpred967_fml = synpred967_fml;
+ ctx->synpred968_fml = synpred968_fml;
+ ctx->synpred969_fml = synpred969_fml;
+ ctx->synpred970_fml = synpred970_fml;
+ ctx->synpred971_fml = synpred971_fml;
+ ctx->synpred972_fml = synpred972_fml;
+ ctx->synpred973_fml = synpred973_fml;
+ ctx->synpred974_fml = synpred974_fml;
+ ctx->synpred975_fml = synpred975_fml;
+ ctx->synpred976_fml = synpred976_fml;
+ ctx->synpred977_fml = synpred977_fml;
+ ctx->synpred980_fml = synpred980_fml;
+ ctx->synpred981_fml = synpred981_fml;
+ ctx->synpred982_fml = synpred982_fml;
+ ctx->synpred983_fml = synpred983_fml;
+ ctx->synpred984_fml = synpred984_fml;
+ ctx->synpred985_fml = synpred985_fml;
+ ctx->synpred986_fml = synpred986_fml;
+ ctx->synpred987_fml = synpred987_fml;
+ ctx->synpred991_fml = synpred991_fml;
+ ctx->synpred992_fml = synpred992_fml;
+ ctx->synpred997_fml = synpred997_fml;
+ ctx->synpred1000_fml = synpred1000_fml;
+ ctx->synpred1003_fml = synpred1003_fml;
+ ctx->synpred1020_fml = synpred1020_fml;
+ ctx->synpred1021_fml = synpred1021_fml;
+ ctx->synpred1027_fml = synpred1027_fml;
+ ctx->synpred1029_fml = synpred1029_fml;
+ ctx->synpred1030_fml = synpred1030_fml;
+ ctx->synpred1033_fml = synpred1033_fml;
+ ctx->synpred1035_fml = synpred1035_fml;
+ ctx->free = fmlParserFree;
+ ctx->reset = fmlParserReset;
+ ctx->getGrammarFileName = getGrammarFileName;
+
+ /* Install the scope pushing methods.
+ */
+
+ /* Create a LIST for recording rule memos.
+ */
+ RULEMEMO = antlr3IntTrieNew(15); /* 16 bit depth is enough for 32768 rules! */
+
+ /* Install the token table
+ */
+ PSRSTATE->tokenNames = fmlParserTokenNames;
+
+
+ /* Return the newly built parser to the caller
+ */
+ return ctx;
+}
+
+static void
+fmlParserReset (pfmlParser ctx)
+{
+ RECOGNIZER->reset(RECOGNIZER);
+}
+
+/** Free the parser resources
+ */
+ static void
+ fmlParserFree(pfmlParser ctx)
+ {
+ /* Free any scope memory
+ */
+
+ if (RULEMEMO != NULL)
+ {
+ RULEMEMO->free(RULEMEMO);
+ RULEMEMO = NULL;
+ }
+ // Free this parser
+ //
+ ctx->pParser->free(ctx->pParser);
+
+
+ ANTLR3_FREE(ctx);
+
+ /* Everything is released, so we can return
+ */
+ return;
+ }
+
+/** Return token names used by this
+parser
+
+ *
+ * The returned pointer is used as an index into the token names table (using the token
+ * number as the index).
+ *
+ * \return Pointer to first char * in the table.
+ */
+static pANTLR3_UINT8 *getTokenNames()
+{
+ return fmlParserTokenNames;
+}
+
+
+
+ // extern "C" and C++ Template incompatibility !!!
+ #include <fml/infrastructure/PropertyPart.h>
+
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // SET LOCATION IN TRACEABLE FORM
+ ////////////////////////////////////////////////////////////////////////////////
+
+ #define SAVE_RULE_BEGIN_LOCATION sep::avm_size_t bLine = LT(1)->getLine(LT(1))
+
+ #define SET_RULE_LOCATION(form) \
+ sep::ParserUtil::setLocation(form, bLine, LT(-1)->getLine(LT(-1)))
+
+
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // XLIA or XFSP MACRO
+ ////////////////////////////////////////////////////////////////////////////////
+
+ #define OP(op) sep::OperatorManager::OPERATOR_##op
+
+ #define NEW_EXPR(e) sep::ExpressionConstructor::newExpr(e)
+
+ #define NEW_BOOL(b) sep::ExpressionConstructor::newBoolean((bool) b)
+ #define NEW_INTEGER(i) sep::ExpressionConstructor::newInteger(i)
+ #define NEW_RATIONAL(q) sep::ExpressionConstructor::newRational(q)
+ #define NEW_FLOAT(f) sep::ExpressionConstructor::newFloat(f)
+ #define NEW_CHAR(c) sep::ExpressionConstructor::newChar(c)
+ #define NEW_STRING(s) sep::ExpressionConstructor::newString(s)
+
+ #define NEW_ID(id) sep::ExpressionConstructor::newIdentifier(id)
+ #define NEW_QID(id) sep::ExpressionConstructor::newQualifiedIdentifier(id)
+ #define NEW_QNID(id, nb) ( (nb > 1)? NEW_QID(id) : NEW_ID(id) )
+
+
+ #define NEW_INSTANCE_UFID(machine, var) \
+ sep::ExpressionConstructor::newQualifiedIdentifier( \
+ sep::OSS() << machine->getNameID() << '.' << var->getNameID() )
+
+
+ #define NEW_CODE(op) sep::ExpressionConstructor::newCode(op)
+ #define NEW_CODE1(op, e) sep::ExpressionConstructor::newCode(op, e)
+ #define NEW_CODE2(op, e1, e2) sep::ExpressionConstructor::newCode(op, e1, e2)
+ #define NEW_CODE3(op, e1, e2, e3) sep::ExpressionConstructor::newCode(op, e1, e2, e3)
+
+ #define NEW_CODE_FLAT(op, e1, e2) sep::ExpressionConstructor::newCodeFlat(op, e1, e2)
+
+ #define NEW_STMT(op) sep::StatementConstructor::newCode(op)
+ #define NEW_STMT1(op, s) sep::StatementConstructor::newCode(op, s)
+ #define NEW_STMT2(op, s1, s2) sep::StatementConstructor::newCode(op, s1, s2)
+ #define NEW_STMT3(op, s1, s2, s3) sep::StatementConstructor::newCode(op, s1, s2, s3)
+
+
+ #define NEW_STMT_ASSIGN_OP(op, lv, e) \
+ NEW_STMT2(OP(ASSIGN_OP), lv, NEW_CODE1(op, e))
+
+ #define NEW_STMT_ASSIGN_OP_AFTER(op, lv, e) \
+ NEW_STMT2(OP(ASSIGN_OP_AFTER), lv, NEW_CODE1(op, e))
+
+
+ #define NUM_INT(s) std::atoi((const char*)(s))
+ #define NUM_FLOAT(s) std::atof((const char*)(s))
+
+ #define CHAR(s) ( *((const char*)(s)) )
+
+ #define STR(s) std::string((const char*)(s))
+
+ #define STR_ID(s) std::string((const char*)((s->getText(s))->chars))
+
+
+ sep::BF new_uminus_expr(sep::BF & arg)
+ {
+ if( arg.isNumeric() )
+ {
+ return( sep::ExpressionConstructor::uminusExpr(arg) );
+ }
+ return( NEW_CODE1(OP(UMINUS), arg) );
+ }
+
+ sep::BF new_not_expr(sep::BF & arg)
+ {
+ if( arg.isBoolean() )
+ {
+ return( sep::ExpressionConstructor::notExpr(arg) );
+ }
+ return( NEW_CODE1(OP(NOT), arg) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // PARSER GLOBAL VARIABLE
+ ////////////////////////////////////////////////////////////////////////////////
+
+ // WObject Manager
+ sep::WObjectManager * mWObjectManager = NULL;
+
+ // Current Diversity prologue specification
+ sep::WObject * DIVERITY_PROLOG = sep::WObject::_NULL_;
+
+
+ // Current Parse System
+ static sep::System * _SYSTEM_ = NULL;
+
+ // Current Parse Machine
+ static sep::Machine * _CPM_ = NULL;
+
+ #define PUSH_CTX_CPM( cpm ) sep::ParserUtil::pushCTX( _CPM_ = cpm )
+
+ #define PUSH_CTX_NEW( cpm ) sep::ParserUtil::pushDynamicCTX( _CPM_ = cpm )
+
+
+ // Current Parse Routine
+ static sep::Routine * _CPR_ = NULL;
+
+ #define PUSH_CTX_CPR( cpr ) sep::ParserUtil::pushCTX( _CPR_ = cpr )
+
+ // Pop old local parse context & update current machine & routine
+ #define POP_CTX sep::ParserUtil::popCTX( _CPM_ , _CPR_ )
+
+ #define POP_CTX_IF( cpm ) \
+ if( _CPM_ == cpm ) { sep::ParserUtil::popCTX( _CPM_ , _CPR_ ); }
+
+ // Current Parse Routine | Machine | System
+ #define _CPRMS_ ( ( _CPR_ != NULL ) \
+ ? static_cast< sep::BehavioralElement * >(_CPR_) \
+ : ( ( _CPM_ != NULL ) \
+ ? static_cast< sep::BehavioralElement * >(_CPM_) \
+ : static_cast< sep::BehavioralElement * >(_SYSTEM_) ) )
+
+
+ // Current Parse [ [ Fully ] Qualified ] Name ID
+ std::string cpLOCATOR;
+ std::vector< std::string > cpQNID;
+
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // DEFAULT STATE #final, #terminal, #return
+ ////////////////////////////////////////////////////////////////////////////////
+
+ static sep::ListOfMachine needDefaultStateFinal;
+
+ static sep::ListOfMachine needDefaultStateTerminal;
+
+ static sep::ListOfMachine needDefaultStateReturn;
+
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // TRANSITION ID
+ ////////////////////////////////////////////////////////////////////////////////
+
+ static sep::avm_size_t transition_id = 0;
+
+ static void resetTransitionID()
+ {
+ transition_id = 0;
+ }
+
+ static std::string newTransitionID(
+ const std::string & id, const std::string & prefix = "t")
+ {
+ return( id.empty() ?
+ (sep::OSS() << prefix << '#' << transition_id++).str() : id );
+ }
+
+
+ static int mInvokeNewInstanceCount = 0;
+
+ static std::string newInvokeNewInstanceNameID(
+ sep::Machine * container, const std::string modelNameID)
+ {
+ return( sep::OSS() << modelNameID << '#' << mInvokeNewInstanceCount++ );
+ }
+
+
+
+ static int mProcedureCallCount = 0;
+
+
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // CONNECT ID
+ ////////////////////////////////////////////////////////////////////////////////
+
+ static sep::avm_size_t buffer_id = 0;
+
+ static void resetBufferID()
+ {
+ buffer_id = 0;
+ }
+
+ static std::string newBufferID(const std::string & prefix = sep::Buffer::ANONYM_ID)
+ {
+ return( sep::OSS() << prefix << '#' << buffer_id++ );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // CONNECT ID
+ ////////////////////////////////////////////////////////////////////////////////
+
+ static sep::avm_size_t connector_id = 0;
+
+ static void resetConnectID()
+ {
+ connector_id = 0;
+ }
+
+ static std::string newConnectID(const std::string & id,
+ const std::string & prefix = sep::Connector::ANONYM_ID)
+ {
+ return( id.empty() ?
+ (sep::OSS() << prefix << '#' << connector_id++).str() : id );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // PARSER MACRO FOR SEMANTIC PREDICATE FOR KEYWORD DETECTION
+ ////////////////////////////////////////////////////////////////////////////////
+
+ #define IS_KEYWORD(kw) \
+ ( (STR(LT(1)->getText(LT(1))->chars) == kw)? ANTLR3_TRUE : ANTLR3_FALSE )
+
+
+
+ void fmlDisplayRecognitionError(
+ pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_UINT8 * tokenNames)
+ {
+ pANTLR3_PARSER parser;
+ pANTLR3_TREE_PARSER tparser;
+ pANTLR3_INT_STREAM is;
+ pANTLR3_STRING ttext;
+ pANTLR3_STRING ftext;
+ pANTLR3_EXCEPTION ex;
+ pANTLR3_COMMON_TOKEN theToken;
+ pANTLR3_BASE_TREE theBaseTree;
+ pANTLR3_COMMON_TREE theCommonTree;
+
+ // Retrieve some info for easy reading.
+ //
+ ex = recognizer->state->exception;
+ ttext = NULL;
+
+ // See if there is a 'filename' we can use
+ //
+ if (ex->streamName == NULL)
+ {
+ if (((pANTLR3_COMMON_TOKEN)(ex->token))->type == ANTLR3_TOKEN_EOF)
+ {
+ ANTLR3_FPRINTF(stderr, "-end of input-(");
+ }
+ else
+ {
+ ANTLR3_FPRINTF(stderr, "-unknown source-(");
+ }
+ }
+ else
+ {
+ ftext = ex->streamName->to8(ex->streamName);
+ ANTLR3_FPRINTF(stderr, "%s(", ftext->chars);
+ }
+
+ // Next comes the line number
+ //
+
+ ANTLR3_FPRINTF(stderr, "%d) ", recognizer->state->exception->line);
+ ANTLR3_FPRINTF(stderr, " : error %d : %s",
+ recognizer->state->exception->type,
+ (pANTLR3_UINT8) (recognizer->state->exception->message));
+
+
+ // How we determine the next piece is dependent on which thing raised the
+ // error.
+ //
+ switch (recognizer->type)
+ {
+ case ANTLR3_TYPE_PARSER:
+
+ // Prepare the knowledge we know we have
+ //
+ parser = (pANTLR3_PARSER) (recognizer->super);
+ tparser = NULL;
+ is = parser->tstream->istream;
+ theToken = (pANTLR3_COMMON_TOKEN)(recognizer->state->exception->token);
+ ttext = theToken->toString(theToken);
+
+ ANTLR3_FPRINTF(stderr, ", at offset %d", recognizer->state->exception->charPositionInLine);
+ if (theToken != NULL)
+ {
+ if (theToken->type == ANTLR3_TOKEN_EOF)
+ {
+ ANTLR3_FPRINTF(stderr, ", at <EOF>");
+ }
+ else
+ {
+ // Guard against null text in a token
+ //
+ ANTLR3_FPRINTF(stderr, "\n NEAR %s\n ", ttext == NULL ? (pANTLR3_UINT8)"<no text for the token>" : ttext->chars);
+ }
+ }
+ break;
+
+ case ANTLR3_TYPE_TREE_PARSER:
+
+ tparser = (pANTLR3_TREE_PARSER) (recognizer->super);
+ parser = NULL;
+ is = tparser->ctnstream->tnstream->istream;
+ theBaseTree = (pANTLR3_BASE_TREE)(recognizer->state->exception->token);
+ ttext = theBaseTree->toStringTree(theBaseTree);
+
+ if (theBaseTree != NULL)
+ {
+ theCommonTree = (pANTLR3_COMMON_TREE) theBaseTree->super;
+
+ if (theCommonTree != NULL)
+ {
+ theToken = (pANTLR3_COMMON_TOKEN) theBaseTree->getToken(theBaseTree);
+ }
+ ANTLR3_FPRINTF(stderr, ", at offset %d", theBaseTree->getCharPositionInLine(theBaseTree));
+ ANTLR3_FPRINTF(stderr, ", near %s", ttext->chars);
+ }
+ break;
+
+ default:
+
+ ANTLR3_FPRINTF(stderr, "Base recognizer function displayRecognitionError called by unknown parser type - provide override for this function\n");
+ return;
+ break;
+ }
+
+ // Although this function should generally be provided by the implementation, this one
+ // should be as helpful as possible for grammar developers and serve as an example
+ // of what you can do with each exception type. In general, when you make up your
+ // 'real' handler, you should debug the routine with all possible errors you expect
+ // which will then let you be as specific as possible about all circumstances.
+ //
+ // Note that in the general case, errors thrown by tree parsers indicate a problem
+ // with the output of the parser or with the tree grammar itself. The job of the parser
+ // is to produce a perfect (in traversal terms) syntactically correct tree, so errors
+ // at that stage should really be semantic errors that your own code determines and handles
+ // in whatever way is appropriate.
+ //
+ switch (ex->type)
+ {
+ case ANTLR3_UNWANTED_TOKEN_EXCEPTION:
+
+ // Indicates that the recognizer was fed a token which seesm to be
+ // spurious input. We can detect this when the token that follows
+ // this unwanted token would normally be part of the syntactically
+ // correct stream. Then we can see that the token we are looking at
+ // is just something that should not be there and throw this exception.
+ //
+ if (tokenNames == NULL)
+ {
+ ANTLR3_FPRINTF(stderr, " : Extraneous input...");
+ }
+ else
+ {
+ if (ex->expecting == ANTLR3_TOKEN_EOF)
+ {
+ ANTLR3_FPRINTF(stderr, " : Extraneous input - expected <EOF>\n");
+ }
+ else
+ {
+ ANTLR3_FPRINTF(stderr, " : Extraneous input - expected %s ...\n", tokenNames[ex->expecting]);
+ }
+ }
+ break;
+
+ case ANTLR3_MISSING_TOKEN_EXCEPTION:
+
+ // Indicates that the recognizer detected that the token we just
+ // hit would be valid syntactically if preceeded by a particular
+ // token. Perhaps a missing ';' at line end or a missing ',' in an
+ // expression list, and such like.
+ //
+ if (tokenNames == NULL)
+ {
+ ANTLR3_FPRINTF(stderr, " : Missing token (%d)...\n", ex->expecting);
+ }
+ else
+ {
+ if (ex->expecting == ANTLR3_TOKEN_EOF)
+ {
+ ANTLR3_FPRINTF(stderr, " : Missing <EOF>\n");
+ }
+ else
+ {
+ ANTLR3_FPRINTF(stderr, " : Missing %s \n", tokenNames[ex->expecting]);
+ }
+ }
+ break;
+
+ case ANTLR3_RECOGNITION_EXCEPTION:
+
+ // Indicates that the recognizer received a token
+ // in the input that was not predicted. This is the basic exception type
+ // from which all others are derived. So we assume it was a syntax error.
+ // You may get this if there are not more tokens and more are needed
+ // to complete a parse for instance.
+ //
+ ANTLR3_FPRINTF(stderr, " : syntax error...\n");
+ break;
+
+ case ANTLR3_MISMATCHED_TOKEN_EXCEPTION:
+
+ // We were expecting to see one thing and got another. This is the
+ // most common error if we coudl not detect a missing or unwanted token.
+ // Here you can spend your efforts to
+ // derive more useful error messages based on the expected
+ // token set and the last token and so on. The error following
+ // bitmaps do a good job of reducing the set that we were looking
+ // for down to something small. Knowing what you are parsing may be
+ // able to allow you to be even more specific about an error.
+ //
+ if (tokenNames == NULL)
+ {
+ ANTLR3_FPRINTF(stderr, " : syntax error...\n");
+ }
+ else
+ {
+ if (ex->expecting == ANTLR3_TOKEN_EOF)
+ {
+ ANTLR3_FPRINTF(stderr, " : expected <EOF>\n");
+ }
+ else
+ {
+ ANTLR3_FPRINTF(stderr, " : expected %s ...\n", tokenNames[ex->expecting]);
+ }
+ }
+ break;
+
+ case ANTLR3_NO_VIABLE_ALT_EXCEPTION:
+
+ // We could not pick any alt decision from the input given
+ // so god knows what happened - however when you examine your grammar,
+ // you should. It means that at the point where the current token occurred
+ // that the DFA indicates nowhere to go from here.
+ //
+ ANTLR3_FPRINTF(stderr, " : cannot match to any predicted input...\n");
+
+ break;
+
+ case ANTLR3_MISMATCHED_SET_EXCEPTION:
+
+ {
+ ANTLR3_UINT32 count;
+ ANTLR3_UINT32 bit;
+ ANTLR3_UINT32 size;
+ ANTLR3_UINT32 numbits;
+ pANTLR3_BITSET errBits;
+
+ // This means we were able to deal with one of a set of
+ // possible tokens at this point, but we did not see any
+ // member of that set.
+ //
+ ANTLR3_FPRINTF(stderr, " : unexpected input...\n expected one of : ");
+
+ // What tokens could we have accepted at this point in the
+ // parse?
+ //
+ count = 0;
+ errBits = antlr3BitsetLoad (ex->expectingSet);
+ numbits = errBits->numBits (errBits);
+ size = errBits->size (errBits);
+
+ if (size > 0)
+ {
+ // However many tokens we could have dealt with here, it is usually
+ // not useful to print ALL of the set here. I arbitrarily chose 8
+ // here, but you should do whatever makes sense for you of course.
+ // No token number 0, so look for bit 1 and on.
+ //
+ for (bit = 1; bit < numbits && count < 8 && count < size; bit++)
+ {
+ // TODO: This doesn;t look right - should be asking if the bit is set!!
+ //
+ if (tokenNames[bit])
+ {
+ ANTLR3_FPRINTF(stderr, "%s%s", count > 0 ? ", " : "", tokenNames[bit]);
+ count++;
+ }
+ }
+ ANTLR3_FPRINTF(stderr, "\n");
+ }
+ else
+ {
+ ANTLR3_FPRINTF(stderr, "Actually dude, we didn't seem to be expecting anything here, or at least\n");
+ ANTLR3_FPRINTF(stderr, "I could not work out what I was expecting, like so many of us these days!\n");
+ }
+ }
+ break;
+
+ case ANTLR3_EARLY_EXIT_EXCEPTION:
+
+ // We entered a loop requiring a number of token sequences
+ // but found a token that ended that sequence earlier than
+ // we should have done.
+ //
+ ANTLR3_FPRINTF(stderr, " : missing elements...\n");
+ break;
+
+ default:
+
+ // We don't handle any other exceptions here, but you can
+ // if you wish. If we get an exception that hits this point
+ // then we are just going to report what we know about the
+ // token.
+ //
+ ANTLR3_FPRINTF(stderr, " : syntax not recognized...\n");
+ break;
+ }
+
+ // Here you have the token that was in error which if this is
+ // the standard implementation will tell you the line and offset
+ // and also record the address of the start of the line in the
+ // input stream. You could therefore print the source line and so on.
+ // Generally though, I would expect that your lexer/parser will keep
+ // its own map of lines and source pointers or whatever as there
+ // are a lot of specific things you need to know about the input
+ // to do something like that.
+ // Here is where you do it though :-).
+ //
+ }
+
+
+
+
+/* Declare the bitsets
+ */
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_prologue_fml_in_formalML90 */
+static ANTLR3_BITWORD FOLLOW_prologue_fml_in_formalML90_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0404000000010000), ANTLR3_UINT64_LIT(0x0000000200000004), ANTLR3_UINT64_LIT(0x0000000000400240) };
+static ANTLR3_BITSET_LIST FOLLOW_prologue_fml_in_formalML90 = { FOLLOW_prologue_fml_in_formalML90_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_system_in_formalML99 */
+static ANTLR3_BITWORD FOLLOW_def_system_in_formalML99_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_system_in_formalML99 = { FOLLOW_def_system_in_formalML99_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_186_in_prologue_fml131 */
+static ANTLR3_BITWORD FOLLOW_186_in_prologue_fml131_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_186_in_prologue_fml131 = { FOLLOW_186_in_prologue_fml131_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_233_in_prologue_fml141 */
+static ANTLR3_BITWORD FOLLOW_233_in_prologue_fml141_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_233_in_prologue_fml141 = { FOLLOW_233_in_prologue_fml141_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_185_in_prologue_fml155 */
+static ANTLR3_BITWORD FOLLOW_185_in_prologue_fml155_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_185_in_prologue_fml155 = { FOLLOW_185_in_prologue_fml155_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_180_in_prologue_fml170 */
+static ANTLR3_BITWORD FOLLOW_180_in_prologue_fml170_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_180_in_prologue_fml170 = { FOLLOW_180_in_prologue_fml170_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_235_in_prologue_fml179 */
+static ANTLR3_BITWORD FOLLOW_235_in_prologue_fml179_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_235_in_prologue_fml179 = { FOLLOW_235_in_prologue_fml179_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_234_in_prologue_fml193 */
+static ANTLR3_BITWORD FOLLOW_234_in_prologue_fml193_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_234_in_prologue_fml193 = { FOLLOW_234_in_prologue_fml193_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_prologue_fml217 */
+static ANTLR3_BITWORD FOLLOW_LT__in_prologue_fml217_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000400000), ANTLR3_UINT64_LIT(0x0000000000000040) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_prologue_fml217 = { FOLLOW_LT__in_prologue_fml217_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_390_in_prologue_fml226 */
+static ANTLR3_BITWORD FOLLOW_390_in_prologue_fml226_bits[] = { ANTLR3_UINT64_LIT(0x0000200000800010) };
+static ANTLR3_BITSET_LIST FOLLOW_390_in_prologue_fml226 = { FOLLOW_390_in_prologue_fml226_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_342_in_prologue_fml239 */
+static ANTLR3_BITWORD FOLLOW_342_in_prologue_fml239_bits[] = { ANTLR3_UINT64_LIT(0x0000200000800010) };
+static ANTLR3_BITSET_LIST FOLLOW_342_in_prologue_fml239 = { FOLLOW_342_in_prologue_fml239_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_prologue_fml253 */
+static ANTLR3_BITWORD FOLLOW_ID_in_prologue_fml253_bits[] = { ANTLR3_UINT64_LIT(0x0000200000800010) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_prologue_fml253 = { FOLLOW_ID_in_prologue_fml253_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSIGN_in_prologue_fml276 */
+static ANTLR3_BITWORD FOLLOW_ASSIGN_in_prologue_fml276_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_ASSIGN_in_prologue_fml276 = { FOLLOW_ASSIGN_in_prologue_fml276_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_prologue_fml280 */
+static ANTLR3_BITWORD FOLLOW_ID_in_prologue_fml280_bits[] = { ANTLR3_UINT64_LIT(0x0000200000800000) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_prologue_fml280 = { FOLLOW_ID_in_prologue_fml280_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_prologue_fml299 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_prologue_fml299_bits[] = { ANTLR3_UINT64_LIT(0x0004080000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_prologue_fml299 = { FOLLOW_COMMA_in_prologue_fml299_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_prologue_fml301 */
+static ANTLR3_BITWORD FOLLOW_set_in_prologue_fml301_bits[] = { ANTLR3_UINT64_LIT(0x0000200000800000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_prologue_fml301 = { FOLLOW_set_in_prologue_fml301_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_prologue_fml321 */
+static ANTLR3_BITWORD FOLLOW_GT_in_prologue_fml321_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_prologue_fml321 = { FOLLOW_GT_in_prologue_fml321_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COLON_in_prologue_fml326 */
+static ANTLR3_BITWORD FOLLOW_COLON_in_prologue_fml326_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000002000014000) };
+static ANTLR3_BITSET_LIST FOLLOW_COLON_in_prologue_fml326 = { FOLLOW_COLON_in_prologue_fml326_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_prologue_attribute_in_prologue_fml333 */
+static ANTLR3_BITWORD FOLLOW_prologue_attribute_in_prologue_fml333_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000004000) };
+static ANTLR3_BITSET_LIST FOLLOW_prologue_attribute_in_prologue_fml333 = { FOLLOW_prologue_attribute_in_prologue_fml333_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_prologue_options_in_prologue_fml343 */
+static ANTLR3_BITWORD FOLLOW_prologue_options_in_prologue_fml343_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_prologue_options_in_prologue_fml343 = { FOLLOW_prologue_options_in_prologue_fml343_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_208_in_prologue_attribute358 */
+static ANTLR3_BITWORD FOLLOW_208_in_prologue_attribute358_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000010) };
+static ANTLR3_BITSET_LIST FOLLOW_208_in_prologue_attribute358 = { FOLLOW_208_in_prologue_attribute358_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSIGN_in_prologue_attribute361 */
+static ANTLR3_BITWORD FOLLOW_ASSIGN_in_prologue_attribute361_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_ASSIGN_in_prologue_attribute361 = { FOLLOW_ASSIGN_in_prologue_attribute361_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_prologue_attribute366 */
+static ANTLR3_BITWORD FOLLOW_ID_in_prologue_attribute366_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_prologue_attribute366 = { FOLLOW_ID_in_prologue_attribute366_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_prologue_attribute369 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_prologue_attribute369_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_prologue_attribute369 = { FOLLOW_SEMI_in_prologue_attribute369_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_229_in_prologue_attribute378 */
+static ANTLR3_BITWORD FOLLOW_229_in_prologue_attribute378_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000010) };
+static ANTLR3_BITSET_LIST FOLLOW_229_in_prologue_attribute378 = { FOLLOW_229_in_prologue_attribute378_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSIGN_in_prologue_attribute381 */
+static ANTLR3_BITWORD FOLLOW_ASSIGN_in_prologue_attribute381_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_ASSIGN_in_prologue_attribute381 = { FOLLOW_ASSIGN_in_prologue_attribute381_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_prologue_attribute386 */
+static ANTLR3_BITWORD FOLLOW_ID_in_prologue_attribute386_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_prologue_attribute386 = { FOLLOW_ID_in_prologue_attribute386_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_prologue_attribute389 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_prologue_attribute389_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_prologue_attribute389 = { FOLLOW_SEMI_in_prologue_attribute389_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_206_in_prologue_options404 */
+static ANTLR3_BITWORD FOLLOW_206_in_prologue_options404_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_206_in_prologue_options404 = { FOLLOW_206_in_prologue_options404_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_prologue_options407 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_prologue_options407_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_prologue_options407 = { FOLLOW_LCURLY_in_prologue_options407_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_prologue_options417 */
+static ANTLR3_BITWORD FOLLOW_ID_in_prologue_options417_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000010) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_prologue_options417 = { FOLLOW_ID_in_prologue_options417_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSIGN_in_prologue_options419 */
+static ANTLR3_BITWORD FOLLOW_ASSIGN_in_prologue_options419_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_ASSIGN_in_prologue_options419 = { FOLLOW_ASSIGN_in_prologue_options419_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_prologue_options423 */
+static ANTLR3_BITWORD FOLLOW_expression_in_prologue_options423_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_prologue_options423 = { FOLLOW_expression_in_prologue_options423_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_prologue_options425 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_prologue_options425_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_prologue_options425 = { FOLLOW_SEMI_in_prologue_options425_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_prologue_options444 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_prologue_options444_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_prologue_options444 = { FOLLOW_RCURLY_in_prologue_options444_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_282_in_modifier_declaration467 */
+static ANTLR3_BITWORD FOLLOW_282_in_modifier_declaration467_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0008000000000000), ANTLR3_UINT64_LIT(0x0002040004000000), ANTLR3_UINT64_LIT(0x1000120820200000), ANTLR3_UINT64_LIT(0x0000000040400800) };
+static ANTLR3_BITSET_LIST FOLLOW_282_in_modifier_declaration467 = { FOLLOW_282_in_modifier_declaration467_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_380_in_modifier_declaration486 */
+static ANTLR3_BITWORD FOLLOW_380_in_modifier_declaration486_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0008000000000000), ANTLR3_UINT64_LIT(0x0002040004000000), ANTLR3_UINT64_LIT(0x1000120820200000), ANTLR3_UINT64_LIT(0x0000000040400800) };
+static ANTLR3_BITSET_LIST FOLLOW_380_in_modifier_declaration486 = { FOLLOW_380_in_modifier_declaration486_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_414_in_modifier_declaration503 */
+static ANTLR3_BITWORD FOLLOW_414_in_modifier_declaration503_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0008000000000000), ANTLR3_UINT64_LIT(0x0002040004000000), ANTLR3_UINT64_LIT(0x1000120820200000), ANTLR3_UINT64_LIT(0x0000000040400800) };
+static ANTLR3_BITSET_LIST FOLLOW_414_in_modifier_declaration503 = { FOLLOW_414_in_modifier_declaration503_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_395_in_modifier_declaration517 */
+static ANTLR3_BITWORD FOLLOW_395_in_modifier_declaration517_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0008000000000000), ANTLR3_UINT64_LIT(0x0002040004000000), ANTLR3_UINT64_LIT(0x1000120820200000), ANTLR3_UINT64_LIT(0x0000000040400800) };
+static ANTLR3_BITSET_LIST FOLLOW_395_in_modifier_declaration517 = { FOLLOW_395_in_modifier_declaration517_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_406_in_modifier_declaration531 */
+static ANTLR3_BITWORD FOLLOW_406_in_modifier_declaration531_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0008000000000000), ANTLR3_UINT64_LIT(0x0002040004000000), ANTLR3_UINT64_LIT(0x1000120820200000), ANTLR3_UINT64_LIT(0x0000000040400800) };
+static ANTLR3_BITSET_LIST FOLLOW_406_in_modifier_declaration531 = { FOLLOW_406_in_modifier_declaration531_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_361_in_modifier_declaration548 */
+static ANTLR3_BITWORD FOLLOW_361_in_modifier_declaration548_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0008000000000000), ANTLR3_UINT64_LIT(0x0002040004000000), ANTLR3_UINT64_LIT(0x1000120820200000), ANTLR3_UINT64_LIT(0x0000000040400800) };
+static ANTLR3_BITSET_LIST FOLLOW_361_in_modifier_declaration548 = { FOLLOW_361_in_modifier_declaration548_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_243_in_modifier_declaration569 */
+static ANTLR3_BITWORD FOLLOW_243_in_modifier_declaration569_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0008000000000000), ANTLR3_UINT64_LIT(0x0002040004000000), ANTLR3_UINT64_LIT(0x1000120820200000), ANTLR3_UINT64_LIT(0x0000000040400800) };
+static ANTLR3_BITSET_LIST FOLLOW_243_in_modifier_declaration569 = { FOLLOW_243_in_modifier_declaration569_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_355_in_modifier_declaration588 */
+static ANTLR3_BITWORD FOLLOW_355_in_modifier_declaration588_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0008000000000000), ANTLR3_UINT64_LIT(0x0002040004000000), ANTLR3_UINT64_LIT(0x1000120820200000), ANTLR3_UINT64_LIT(0x0000000040400800) };
+static ANTLR3_BITSET_LIST FOLLOW_355_in_modifier_declaration588 = { FOLLOW_355_in_modifier_declaration588_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_349_in_modifier_declaration605 */
+static ANTLR3_BITWORD FOLLOW_349_in_modifier_declaration605_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0008000000000000), ANTLR3_UINT64_LIT(0x0002040004000000), ANTLR3_UINT64_LIT(0x1000120820200000), ANTLR3_UINT64_LIT(0x0000000040400800) };
+static ANTLR3_BITSET_LIST FOLLOW_349_in_modifier_declaration605 = { FOLLOW_349_in_modifier_declaration605_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_modifier_set_direction_strict_text_in_modifier_declaration621 */
+static ANTLR3_BITWORD FOLLOW_modifier_set_direction_strict_text_in_modifier_declaration621_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0008000000000000), ANTLR3_UINT64_LIT(0x0002040004000000), ANTLR3_UINT64_LIT(0x1000120820200000), ANTLR3_UINT64_LIT(0x0000000040400800) };
+static ANTLR3_BITSET_LIST FOLLOW_modifier_set_direction_strict_text_in_modifier_declaration621 = { FOLLOW_modifier_set_direction_strict_text_in_modifier_declaration621_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_modifier_direction645 */
+static ANTLR3_BITWORD FOLLOW_set_in_modifier_direction645_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_modifier_direction645 = { FOLLOW_set_in_modifier_direction645_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_modifier_direction668 */
+static ANTLR3_BITWORD FOLLOW_set_in_modifier_direction668_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_modifier_direction668 = { FOLLOW_set_in_modifier_direction668_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_modifier_direction689 */
+static ANTLR3_BITWORD FOLLOW_set_in_modifier_direction689_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_modifier_direction689 = { FOLLOW_set_in_modifier_direction689_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_modifier_direction714 */
+static ANTLR3_BITWORD FOLLOW_set_in_modifier_direction714_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_modifier_direction714 = { FOLLOW_set_in_modifier_direction714_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_modifier_direction_text749 */
+static ANTLR3_BITWORD FOLLOW_set_in_modifier_direction_text749_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_modifier_direction_text749 = { FOLLOW_set_in_modifier_direction_text749_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_modifier_direction_text767 */
+static ANTLR3_BITWORD FOLLOW_set_in_modifier_direction_text767_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_modifier_direction_text767 = { FOLLOW_set_in_modifier_direction_text767_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_298_in_modifier_direction_text785 */
+static ANTLR3_BITWORD FOLLOW_298_in_modifier_direction_text785_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_298_in_modifier_direction_text785 = { FOLLOW_298_in_modifier_direction_text785_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_364_in_modifier_direction_text806 */
+static ANTLR3_BITWORD FOLLOW_364_in_modifier_direction_text806_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_364_in_modifier_direction_text806 = { FOLLOW_364_in_modifier_direction_text806_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_305_in_modifier_set_direction_strict_text833 */
+static ANTLR3_BITWORD FOLLOW_305_in_modifier_set_direction_strict_text833_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_305_in_modifier_set_direction_strict_text833 = { FOLLOW_305_in_modifier_set_direction_strict_text833_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_341_in_modifier_set_direction_strict_text843 */
+static ANTLR3_BITWORD FOLLOW_341_in_modifier_set_direction_strict_text843_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_341_in_modifier_set_direction_strict_text843 = { FOLLOW_341_in_modifier_set_direction_strict_text843_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_298_in_modifier_set_direction_strict_text852 */
+static ANTLR3_BITWORD FOLLOW_298_in_modifier_set_direction_strict_text852_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_298_in_modifier_set_direction_strict_text852 = { FOLLOW_298_in_modifier_set_direction_strict_text852_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_364_in_modifier_set_direction_strict_text862 */
+static ANTLR3_BITWORD FOLLOW_364_in_modifier_set_direction_strict_text862_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_364_in_modifier_set_direction_strict_text862 = { FOLLOW_364_in_modifier_set_direction_strict_text862_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_164_in_modifier_direction_symbol881 */
+static ANTLR3_BITWORD FOLLOW_164_in_modifier_direction_symbol881_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_164_in_modifier_direction_symbol881 = { FOLLOW_164_in_modifier_direction_symbol881_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSIGN_REF_in_modifier_direction_symbol891 */
+static ANTLR3_BITWORD FOLLOW_ASSIGN_REF_in_modifier_direction_symbol891_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ASSIGN_REF_in_modifier_direction_symbol891 = { FOLLOW_ASSIGN_REF_in_modifier_direction_symbol891_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_166_in_modifier_direction_symbol901 */
+static ANTLR3_BITWORD FOLLOW_166_in_modifier_direction_symbol901_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_166_in_modifier_direction_symbol901 = { FOLLOW_166_in_modifier_direction_symbol901_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LTE_in_modifier_direction_symbol910 */
+static ANTLR3_BITWORD FOLLOW_LTE_in_modifier_direction_symbol910_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_LTE_in_modifier_direction_symbol910 = { FOLLOW_LTE_in_modifier_direction_symbol910_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_modifier_direction_in_modifier_param934 */
+static ANTLR3_BITWORD FOLLOW_modifier_direction_in_modifier_param934_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_modifier_direction_in_modifier_param934 = { FOLLOW_modifier_direction_in_modifier_param934_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_282_in_modifier_param943 */
+static ANTLR3_BITWORD FOLLOW_282_in_modifier_param943_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_282_in_modifier_param943 = { FOLLOW_282_in_modifier_param943_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_262_in_modifier_param960 */
+static ANTLR3_BITWORD FOLLOW_262_in_modifier_param960_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_262_in_modifier_param960 = { FOLLOW_262_in_modifier_param960_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_modifier_param978 */
+static ANTLR3_BITWORD FOLLOW_set_in_modifier_param978_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_modifier_param978 = { FOLLOW_set_in_modifier_param978_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_318_in_modifier_param995 */
+static ANTLR3_BITWORD FOLLOW_318_in_modifier_param995_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_318_in_modifier_param995 = { FOLLOW_318_in_modifier_param995_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_243_in_modifier_param1013 */
+static ANTLR3_BITWORD FOLLOW_243_in_modifier_param1013_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_243_in_modifier_param1013 = { FOLLOW_243_in_modifier_param1013_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_393_in_procedure_modifier_specifier1062 */
+static ANTLR3_BITWORD FOLLOW_393_in_procedure_modifier_specifier1062_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_393_in_procedure_modifier_specifier1062 = { FOLLOW_393_in_procedure_modifier_specifier1062_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_306_in_procedure_modifier_specifier1079 */
+static ANTLR3_BITWORD FOLLOW_306_in_procedure_modifier_specifier1079_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_306_in_procedure_modifier_specifier1079 = { FOLLOW_306_in_procedure_modifier_specifier1079_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_406_in_procedure_modifier_specifier1089 */
+static ANTLR3_BITWORD FOLLOW_406_in_procedure_modifier_specifier1089_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_406_in_procedure_modifier_specifier1089 = { FOLLOW_406_in_procedure_modifier_specifier1089_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_322_in_executable_modifier_specifier1127 */
+static ANTLR3_BITWORD FOLLOW_322_in_executable_modifier_specifier1127_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0404000000010000), ANTLR3_UINT64_LIT(0x0000000200000004), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_322_in_executable_modifier_specifier1127 = { FOLLOW_322_in_executable_modifier_specifier1127_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_353_in_executable_modifier_specifier1144 */
+static ANTLR3_BITWORD FOLLOW_353_in_executable_modifier_specifier1144_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0404000000010000), ANTLR3_UINT64_LIT(0x0000000200000004), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_353_in_executable_modifier_specifier1144 = { FOLLOW_353_in_executable_modifier_specifier1144_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_272_in_executable_modifier_specifier1158 */
+static ANTLR3_BITWORD FOLLOW_272_in_executable_modifier_specifier1158_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0404000000010000), ANTLR3_UINT64_LIT(0x0000000200000004), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_272_in_executable_modifier_specifier1158 = { FOLLOW_272_in_executable_modifier_specifier1158_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_406_in_executable_modifier_specifier1181 */
+static ANTLR3_BITWORD FOLLOW_406_in_executable_modifier_specifier1181_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0404000000010000), ANTLR3_UINT64_LIT(0x0000000200000004), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_406_in_executable_modifier_specifier1181 = { FOLLOW_406_in_executable_modifier_specifier1181_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_393_in_executable_modifier_specifier1198 */
+static ANTLR3_BITWORD FOLLOW_393_in_executable_modifier_specifier1198_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0404000000010000), ANTLR3_UINT64_LIT(0x0000000200000004), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_393_in_executable_modifier_specifier1198 = { FOLLOW_393_in_executable_modifier_specifier1198_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_306_in_executable_modifier_specifier1215 */
+static ANTLR3_BITWORD FOLLOW_306_in_executable_modifier_specifier1215_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0404000000010000), ANTLR3_UINT64_LIT(0x0000000200000004), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_306_in_executable_modifier_specifier1215 = { FOLLOW_306_in_executable_modifier_specifier1215_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_314_in_executable_modifier_specifier1224 */
+static ANTLR3_BITWORD FOLLOW_314_in_executable_modifier_specifier1224_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0404000000010000), ANTLR3_UINT64_LIT(0x0000000200000004), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_314_in_executable_modifier_specifier1224 = { FOLLOW_314_in_executable_modifier_specifier1224_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_282_in_instance_modifier_specifier1254 */
+static ANTLR3_BITWORD FOLLOW_282_in_instance_modifier_specifier1254_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0404000004010000), ANTLR3_UINT64_LIT(0x0000000920000000), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_282_in_instance_modifier_specifier1254 = { FOLLOW_282_in_instance_modifier_specifier1254_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_272_in_instance_modifier_specifier1278 */
+static ANTLR3_BITWORD FOLLOW_272_in_instance_modifier_specifier1278_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0404000004010000), ANTLR3_UINT64_LIT(0x0000000920000000), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_272_in_instance_modifier_specifier1278 = { FOLLOW_272_in_instance_modifier_specifier1278_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_355_in_instance_modifier_specifier1297 */
+static ANTLR3_BITWORD FOLLOW_355_in_instance_modifier_specifier1297_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0404000004010000), ANTLR3_UINT64_LIT(0x0000000920000000), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_355_in_instance_modifier_specifier1297 = { FOLLOW_355_in_instance_modifier_specifier1297_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_352_in_instance_modifier_specifier1313 */
+static ANTLR3_BITWORD FOLLOW_352_in_instance_modifier_specifier1313_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0404000004010000), ANTLR3_UINT64_LIT(0x0000000920000000), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_352_in_instance_modifier_specifier1313 = { FOLLOW_352_in_instance_modifier_specifier1313_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_349_in_instance_modifier_specifier1326 */
+static ANTLR3_BITWORD FOLLOW_349_in_instance_modifier_specifier1326_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0404000004010000), ANTLR3_UINT64_LIT(0x0000000920000000), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_349_in_instance_modifier_specifier1326 = { FOLLOW_349_in_instance_modifier_specifier1326_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_406_in_instance_modifier_specifier1342 */
+static ANTLR3_BITWORD FOLLOW_406_in_instance_modifier_specifier1342_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0404000004010000), ANTLR3_UINT64_LIT(0x0000000920000000), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_406_in_instance_modifier_specifier1342 = { FOLLOW_406_in_instance_modifier_specifier1342_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_393_in_instance_modifier_specifier1359 */
+static ANTLR3_BITWORD FOLLOW_393_in_instance_modifier_specifier1359_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0404000004010000), ANTLR3_UINT64_LIT(0x0000000920000000), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_393_in_instance_modifier_specifier1359 = { FOLLOW_393_in_instance_modifier_specifier1359_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_306_in_instance_modifier_specifier1376 */
+static ANTLR3_BITWORD FOLLOW_306_in_instance_modifier_specifier1376_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0404000004010000), ANTLR3_UINT64_LIT(0x0000000920000000), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_306_in_instance_modifier_specifier1376 = { FOLLOW_306_in_instance_modifier_specifier1376_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_314_in_instance_modifier_specifier1385 */
+static ANTLR3_BITWORD FOLLOW_314_in_instance_modifier_specifier1385_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0404000004010000), ANTLR3_UINT64_LIT(0x0000000920000000), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_314_in_instance_modifier_specifier1385 = { FOLLOW_314_in_instance_modifier_specifier1385_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_395_in_modifier_transition1420 */
+static ANTLR3_BITWORD FOLLOW_395_in_modifier_transition1420_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000A00) };
+static ANTLR3_BITSET_LIST FOLLOW_395_in_modifier_transition1420 = { FOLLOW_395_in_modifier_transition1420_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_393_in_modifier_transition1436 */
+static ANTLR3_BITWORD FOLLOW_393_in_modifier_transition1436_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000A00) };
+static ANTLR3_BITSET_LIST FOLLOW_393_in_modifier_transition1436 = { FOLLOW_393_in_modifier_transition1436_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_306_in_modifier_transition1453 */
+static ANTLR3_BITWORD FOLLOW_306_in_modifier_transition1453_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000A00) };
+static ANTLR3_BITSET_LIST FOLLOW_306_in_modifier_transition1453 = { FOLLOW_306_in_modifier_transition1453_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_342_in_def_package1485 */
+static ANTLR3_BITWORD FOLLOW_342_in_def_package1485_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_342_in_def_package1485 = { FOLLOW_342_in_def_package1485_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_def_package1489 */
+static ANTLR3_BITWORD FOLLOW_ID_in_def_package1489_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_def_package1489 = { FOLLOW_ID_in_def_package1489_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_StringLiteral_in_def_package1506 */
+static ANTLR3_BITWORD FOLLOW_StringLiteral_in_def_package1506_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_StringLiteral_in_def_package1506 = { FOLLOW_StringLiteral_in_def_package1506_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_def_package1527 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_def_package1527_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x1084400000000000), ANTLR3_UINT64_LIT(0x0000000041F80B21) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_def_package1527 = { FOLLOW_LCURLY_in_def_package1527_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_header_in_def_package1532 */
+static ANTLR3_BITWORD FOLLOW_section_header_in_def_package1532_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0084400000000000), ANTLR3_UINT64_LIT(0x0000000041F80B21) };
+static ANTLR3_BITSET_LIST FOLLOW_section_header_in_def_package1532 = { FOLLOW_section_header_in_def_package1532_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_import_in_def_package1540 */
+static ANTLR3_BITWORD FOLLOW_section_import_in_def_package1540_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0084400000000000), ANTLR3_UINT64_LIT(0x0000000041F80B20) };
+static ANTLR3_BITSET_LIST FOLLOW_section_import_in_def_package1540 = { FOLLOW_section_import_in_def_package1540_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_property_in_def_package1551 */
+static ANTLR3_BITWORD FOLLOW_section_property_in_def_package1551_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0084400000000000), ANTLR3_UINT64_LIT(0x0000000041F80B20) };
+static ANTLR3_BITSET_LIST FOLLOW_section_property_in_def_package1551 = { FOLLOW_section_property_in_def_package1551_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_composite_structure_in_def_package1563 */
+static ANTLR3_BITWORD FOLLOW_section_composite_structure_in_def_package1563_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0080400000000000), ANTLR3_UINT64_LIT(0x0000000040900B20) };
+static ANTLR3_BITSET_LIST FOLLOW_section_composite_structure_in_def_package1563 = { FOLLOW_section_composite_structure_in_def_package1563_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_def_package1572 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_def_package1572_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_def_package1572 = { FOLLOW_RCURLY_in_def_package1572_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_executable_modifier_specifier_in_def_system1604 */
+static ANTLR3_BITWORD FOLLOW_executable_modifier_specifier_in_def_system1604_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000040) };
+static ANTLR3_BITSET_LIST FOLLOW_executable_modifier_specifier_in_def_system1604 = { FOLLOW_executable_modifier_specifier_in_def_system1604_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_390_in_def_system1618 */
+static ANTLR3_BITWORD FOLLOW_390_in_def_system1618_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_390_in_def_system1618 = { FOLLOW_390_in_def_system1618_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_def_system1626 */
+static ANTLR3_BITWORD FOLLOW_LT__in_def_system1626_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000001800000), ANTLR3_UINT64_LIT(0x0000800000000000), ANTLR3_UINT64_LIT(0x0100000054000002), ANTLR3_UINT64_LIT(0x0200100000004002) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_def_system1626 = { FOLLOW_LT__in_def_system1626_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_321_in_def_system1630 */
+static ANTLR3_BITWORD FOLLOW_321_in_def_system1630_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000001800000), ANTLR3_UINT64_LIT(0x0000800000000000), ANTLR3_UINT64_LIT(0x0100000054000002), ANTLR3_UINT64_LIT(0x0200100000004000) };
+static ANTLR3_BITSET_LIST FOLLOW_321_in_def_system1630 = { FOLLOW_321_in_def_system1630_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_executable_specifier_in_def_system1636 */
+static ANTLR3_BITWORD FOLLOW_executable_specifier_in_def_system1636_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_executable_specifier_in_def_system1636 = { FOLLOW_executable_specifier_in_def_system1636_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_def_system1639 */
+static ANTLR3_BITWORD FOLLOW_GT_in_def_system1639_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_def_system1639 = { FOLLOW_GT_in_def_system1639_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_def_system1649 */
+static ANTLR3_BITWORD FOLLOW_ID_in_def_system1649_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_def_system1649 = { FOLLOW_ID_in_def_system1649_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_StringLiteral_in_def_system1662 */
+static ANTLR3_BITWORD FOLLOW_StringLiteral_in_def_system1662_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_StringLiteral_in_def_system1662 = { FOLLOW_StringLiteral_in_def_system1662_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_def_system1679 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_def_system1679_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x1084580000000000), ANTLR3_UINT64_LIT(0x0000000859FE9F79) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_def_system1679 = { FOLLOW_LCURLY_in_def_system1679_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_header_in_def_system1687 */
+static ANTLR3_BITWORD FOLLOW_section_header_in_def_system1687_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0084580000000000), ANTLR3_UINT64_LIT(0x0000000859FE9F79) };
+static ANTLR3_BITSET_LIST FOLLOW_section_header_in_def_system1687 = { FOLLOW_section_header_in_def_system1687_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_import_in_def_system1695 */
+static ANTLR3_BITWORD FOLLOW_section_import_in_def_system1695_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0084580000000000), ANTLR3_UINT64_LIT(0x0000000859FE9F78) };
+static ANTLR3_BITSET_LIST FOLLOW_section_import_in_def_system1695 = { FOLLOW_section_import_in_def_system1695_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_parameter_in_def_system1706 */
+static ANTLR3_BITWORD FOLLOW_section_parameter_in_def_system1706_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0084580000000000), ANTLR3_UINT64_LIT(0x0000000859FE9F78) };
+static ANTLR3_BITSET_LIST FOLLOW_section_parameter_in_def_system1706 = { FOLLOW_section_parameter_in_def_system1706_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_property_in_def_system1728 */
+static ANTLR3_BITWORD FOLLOW_section_property_in_def_system1728_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0084580000000000), ANTLR3_UINT64_LIT(0x0000000841F81F60) };
+static ANTLR3_BITSET_LIST FOLLOW_section_property_in_def_system1728 = { FOLLOW_section_property_in_def_system1728_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_composite_structure_in_def_system1740 */
+static ANTLR3_BITWORD FOLLOW_section_composite_structure_in_def_system1740_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0080580000000000), ANTLR3_UINT64_LIT(0x0000000840901F60) };
+static ANTLR3_BITSET_LIST FOLLOW_section_composite_structure_in_def_system1740 = { FOLLOW_section_composite_structure_in_def_system1740_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_behavior_in_def_system1752 */
+static ANTLR3_BITWORD FOLLOW_section_behavior_in_def_system1752_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000000001440) };
+static ANTLR3_BITSET_LIST FOLLOW_section_behavior_in_def_system1752 = { FOLLOW_section_behavior_in_def_system1752_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_statemachine_in_def_system1760 */
+static ANTLR3_BITWORD FOLLOW_section_statemachine_in_def_system1760_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000000001440) };
+static ANTLR3_BITSET_LIST FOLLOW_section_statemachine_in_def_system1760 = { FOLLOW_section_statemachine_in_def_system1760_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_model_of_computation_in_def_system1788 */
+static ANTLR3_BITWORD FOLLOW_section_model_of_computation_in_def_system1788_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000000001440) };
+static ANTLR3_BITSET_LIST FOLLOW_section_model_of_computation_in_def_system1788 = { FOLLOW_section_model_of_computation_in_def_system1788_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_model_of_interaction_in_def_system1796 */
+static ANTLR3_BITWORD FOLLOW_section_model_of_interaction_in_def_system1796_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000000001440) };
+static ANTLR3_BITSET_LIST FOLLOW_section_model_of_interaction_in_def_system1796 = { FOLLOW_section_model_of_interaction_in_def_system1796_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_model_of_execution_in_def_system1804 */
+static ANTLR3_BITWORD FOLLOW_section_model_of_execution_in_def_system1804_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000000001440) };
+static ANTLR3_BITSET_LIST FOLLOW_section_model_of_execution_in_def_system1804 = { FOLLOW_section_model_of_execution_in_def_system1804_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_def_system1816 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_def_system1816_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_def_system1816 = { FOLLOW_RCURLY_in_def_system1816_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_qualifiedNameID1842 */
+static ANTLR3_BITWORD FOLLOW_ID_in_qualifiedNameID1842_bits[] = { ANTLR3_UINT64_LIT(0x0000000200400002) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_qualifiedNameID1842 = { FOLLOW_ID_in_qualifiedNameID1842_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DOT_in_qualifiedNameID1859 */
+static ANTLR3_BITWORD FOLLOW_DOT_in_qualifiedNameID1859_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_DOT_in_qualifiedNameID1859 = { FOLLOW_DOT_in_qualifiedNameID1859_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COLONx2_in_qualifiedNameID1875 */
+static ANTLR3_BITWORD FOLLOW_COLONx2_in_qualifiedNameID1875_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_COLONx2_in_qualifiedNameID1875 = { FOLLOW_COLONx2_in_qualifiedNameID1875_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_qualifiedNameID1893 */
+static ANTLR3_BITWORD FOLLOW_ID_in_qualifiedNameID1893_bits[] = { ANTLR3_UINT64_LIT(0x0000000200400002) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_qualifiedNameID1893 = { FOLLOW_ID_in_qualifiedNameID1893_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_IntegerLiteral_in_integer_constant1923 */
+static ANTLR3_BITWORD FOLLOW_IntegerLiteral_in_integer_constant1923_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_IntegerLiteral_in_integer_constant1923 = { FOLLOW_IntegerLiteral_in_integer_constant1923_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_integer_constant1934 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_integer_constant1934_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_integer_constant1934 = { FOLLOW_qualifiedNameID_in_integer_constant1934_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_FloatLiteral_in_float_constant1955 */
+static ANTLR3_BITWORD FOLLOW_FloatLiteral_in_float_constant1955_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_FloatLiteral_in_float_constant1955 = { FOLLOW_FloatLiteral_in_float_constant1955_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_float_constant1966 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_float_constant1966_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_float_constant1966 = { FOLLOW_qualifiedNameID_in_float_constant1966_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_188_in_section_header1987 */
+static ANTLR3_BITWORD FOLLOW_188_in_section_header1987_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_188_in_section_header1987 = { FOLLOW_188_in_section_header1987_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_192_in_section_import2005 */
+static ANTLR3_BITWORD FOLLOW_192_in_section_import2005_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_192_in_section_import2005 = { FOLLOW_192_in_section_import2005_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_include_package_in_section_import2009 */
+static ANTLR3_BITWORD FOLLOW_include_package_in_section_import2009_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_include_package_in_section_import2009 = { FOLLOW_include_package_in_section_import2009_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_193_in_include_package2023 */
+static ANTLR3_BITWORD FOLLOW_193_in_include_package2023_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_193_in_include_package2023 = { FOLLOW_193_in_include_package2023_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_StringLiteral_in_include_package2030 */
+static ANTLR3_BITWORD FOLLOW_StringLiteral_in_include_package2030_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_StringLiteral_in_include_package2030 = { FOLLOW_StringLiteral_in_include_package2030_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_include_package2033 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_include_package2033_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_include_package2033 = { FOLLOW_SEMI_in_include_package2033_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_include_package2040 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_include_package2040_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_include_package2040 = { FOLLOW_LCURLY_in_include_package2040_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_StringLiteral_in_include_package2045 */
+static ANTLR3_BITWORD FOLLOW_StringLiteral_in_include_package2045_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_StringLiteral_in_include_package2045 = { FOLLOW_StringLiteral_in_include_package2045_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_include_package2051 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_include_package2051_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_include_package2051 = { FOLLOW_RCURLY_in_include_package2051_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_212_in_section_procedure2081 */
+static ANTLR3_BITWORD FOLLOW_212_in_section_procedure2081_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000080000000), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_212_in_section_procedure2081 = { FOLLOW_212_in_section_procedure2081_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_procedure_in_section_procedure2090 */
+static ANTLR3_BITWORD FOLLOW_def_procedure_in_section_procedure2090_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000080000000), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_def_procedure_in_section_procedure2090 = { FOLLOW_def_procedure_in_section_procedure2090_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_procedure_modifier_specifier_in_def_procedure2124 */
+static ANTLR3_BITWORD FOLLOW_procedure_modifier_specifier_in_def_procedure2124_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000080000000) };
+static ANTLR3_BITSET_LIST FOLLOW_procedure_modifier_specifier_in_def_procedure2124 = { FOLLOW_procedure_modifier_specifier_in_def_procedure2124_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_351_in_def_procedure2140 */
+static ANTLR3_BITWORD FOLLOW_351_in_def_procedure2140_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_351_in_def_procedure2140 = { FOLLOW_351_in_def_procedure2140_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_def_procedure2147 */
+static ANTLR3_BITWORD FOLLOW_LT__in_def_procedure2147_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000001800000), ANTLR3_UINT64_LIT(0x0000800000000000), ANTLR3_UINT64_LIT(0x0100000054000002), ANTLR3_UINT64_LIT(0x0200100000004002) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_def_procedure2147 = { FOLLOW_LT__in_def_procedure2147_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_321_in_def_procedure2151 */
+static ANTLR3_BITWORD FOLLOW_321_in_def_procedure2151_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000001800000), ANTLR3_UINT64_LIT(0x0000800000000000), ANTLR3_UINT64_LIT(0x0100000054000002), ANTLR3_UINT64_LIT(0x0200100000004000) };
+static ANTLR3_BITSET_LIST FOLLOW_321_in_def_procedure2151 = { FOLLOW_321_in_def_procedure2151_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_executable_specifier_in_def_procedure2157 */
+static ANTLR3_BITWORD FOLLOW_executable_specifier_in_def_procedure2157_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_executable_specifier_in_def_procedure2157 = { FOLLOW_executable_specifier_in_def_procedure2157_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_def_procedure2161 */
+static ANTLR3_BITWORD FOLLOW_GT_in_def_procedure2161_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_def_procedure2161 = { FOLLOW_GT_in_def_procedure2161_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_def_procedure2171 */
+static ANTLR3_BITWORD FOLLOW_ID_in_def_procedure2171_bits[] = { ANTLR3_UINT64_LIT(0x1000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800002000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_def_procedure2171 = { FOLLOW_ID_in_def_procedure2171_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_StringLiteral_in_def_procedure2184 */
+static ANTLR3_BITWORD FOLLOW_StringLiteral_in_def_procedure2184_bits[] = { ANTLR3_UINT64_LIT(0x1000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_StringLiteral_in_def_procedure2184 = { FOLLOW_StringLiteral_in_def_procedure2184_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_machine_parameters_in_def_procedure2201 */
+static ANTLR3_BITWORD FOLLOW_def_machine_parameters_in_def_procedure2201_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_machine_parameters_in_def_procedure2201 = { FOLLOW_def_machine_parameters_in_def_procedure2201_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_machine_returns_in_def_procedure2210 */
+static ANTLR3_BITWORD FOLLOW_def_machine_returns_in_def_procedure2210_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_def_machine_returns_in_def_procedure2210 = { FOLLOW_def_machine_returns_in_def_procedure2210_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_body_procedure_in_def_procedure2219 */
+static ANTLR3_BITWORD FOLLOW_def_body_procedure_in_def_procedure2219_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_body_procedure_in_def_procedure2219 = { FOLLOW_def_body_procedure_in_def_procedure2219_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LBRACKET_in_def_machine_parameters2238 */
+static ANTLR3_BITWORD FOLLOW_LBRACKET_in_def_machine_parameters2238_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000280), ANTLR3_UINT64_LIT(0x0000000000001000), ANTLR3_UINT64_LIT(0x0000005000000000), ANTLR3_UINT64_LIT(0xC27E000000000000), ANTLR3_UINT64_LIT(0x78E204800E00C168), ANTLR3_UINT64_LIT(0x006413600720A261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_LBRACKET_in_def_machine_parameters2238 = { FOLLOW_LBRACKET_in_def_machine_parameters2238_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_machine_variable_parameter_atom_in_def_machine_parameters2241 */
+static ANTLR3_BITWORD FOLLOW_def_machine_variable_parameter_atom_in_def_machine_parameters2241_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_machine_variable_parameter_atom_in_def_machine_parameters2241 = { FOLLOW_def_machine_variable_parameter_atom_in_def_machine_parameters2241_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_def_machine_parameters2249 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_def_machine_parameters2249_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000280), ANTLR3_UINT64_LIT(0x0000000000001000), ANTLR3_UINT64_LIT(0x0000005000000000), ANTLR3_UINT64_LIT(0xC27E000000000000), ANTLR3_UINT64_LIT(0x78E204800E00C168), ANTLR3_UINT64_LIT(0x006413600720A261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_def_machine_parameters2249 = { FOLLOW_COMMA_in_def_machine_parameters2249_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_machine_variable_parameter_atom_in_def_machine_parameters2253 */
+static ANTLR3_BITWORD FOLLOW_def_machine_variable_parameter_atom_in_def_machine_parameters2253_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_machine_variable_parameter_atom_in_def_machine_parameters2253 = { FOLLOW_def_machine_variable_parameter_atom_in_def_machine_parameters2253_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RBRACKET_in_def_machine_parameters2262 */
+static ANTLR3_BITWORD FOLLOW_RBRACKET_in_def_machine_parameters2262_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RBRACKET_in_def_machine_parameters2262 = { FOLLOW_RBRACKET_in_def_machine_parameters2262_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_def_machine_parameters2268 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_def_machine_parameters2268_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000280), ANTLR3_UINT64_LIT(0x0000000000001000), ANTLR3_UINT64_LIT(0x0000005000000000), ANTLR3_UINT64_LIT(0xC27E000000000000), ANTLR3_UINT64_LIT(0x78E204800E00C168), ANTLR3_UINT64_LIT(0x006413600720A261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_def_machine_parameters2268 = { FOLLOW_LPAREN_in_def_machine_parameters2268_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_machine_variable_parameter_atom_in_def_machine_parameters2272 */
+static ANTLR3_BITWORD FOLLOW_def_machine_variable_parameter_atom_in_def_machine_parameters2272_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_machine_variable_parameter_atom_in_def_machine_parameters2272 = { FOLLOW_def_machine_variable_parameter_atom_in_def_machine_parameters2272_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_def_machine_parameters2280 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_def_machine_parameters2280_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000280), ANTLR3_UINT64_LIT(0x0000000000001000), ANTLR3_UINT64_LIT(0x0000005000000000), ANTLR3_UINT64_LIT(0xC27E000000000000), ANTLR3_UINT64_LIT(0x78E204800E00C168), ANTLR3_UINT64_LIT(0x006413600720A261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_def_machine_parameters2280 = { FOLLOW_COMMA_in_def_machine_parameters2280_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_machine_variable_parameter_atom_in_def_machine_parameters2283 */
+static ANTLR3_BITWORD FOLLOW_def_machine_variable_parameter_atom_in_def_machine_parameters2283_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_machine_variable_parameter_atom_in_def_machine_parameters2283 = { FOLLOW_def_machine_variable_parameter_atom_in_def_machine_parameters2283_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_def_machine_parameters2292 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_def_machine_parameters2292_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_def_machine_parameters2292 = { FOLLOW_RPAREN_in_def_machine_parameters2292_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_modifier_param_in_def_machine_variable_parameter_atom2315 */
+static ANTLR3_BITWORD FOLLOW_modifier_param_in_def_machine_variable_parameter_atom2315_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_modifier_param_in_def_machine_variable_parameter_atom2315 = { FOLLOW_modifier_param_in_def_machine_variable_parameter_atom2315_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_var_in_def_machine_variable_parameter_atom2327 */
+static ANTLR3_BITWORD FOLLOW_type_var_in_def_machine_variable_parameter_atom2327_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_type_var_in_def_machine_variable_parameter_atom2327 = { FOLLOW_type_var_in_def_machine_variable_parameter_atom2327_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_def_machine_variable_parameter_atom2338 */
+static ANTLR3_BITWORD FOLLOW_ID_in_def_machine_variable_parameter_atom2338_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000012), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_def_machine_variable_parameter_atom2338 = { FOLLOW_ID_in_def_machine_variable_parameter_atom2338_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_initial_value_in_def_machine_variable_parameter_atom2355 */
+static ANTLR3_BITWORD FOLLOW_initial_value_in_def_machine_variable_parameter_atom2355_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_initial_value_in_def_machine_variable_parameter_atom2355 = { FOLLOW_initial_value_in_def_machine_variable_parameter_atom2355_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_244_in_def_machine_variable_parameter_atom2378 */
+static ANTLR3_BITWORD FOLLOW_244_in_def_machine_variable_parameter_atom2378_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_244_in_def_machine_variable_parameter_atom2378 = { FOLLOW_244_in_def_machine_variable_parameter_atom2378_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_var_in_def_machine_variable_parameter_atom2399 */
+static ANTLR3_BITWORD FOLLOW_type_var_in_def_machine_variable_parameter_atom2399_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_type_var_in_def_machine_variable_parameter_atom2399 = { FOLLOW_type_var_in_def_machine_variable_parameter_atom2399_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COLON_in_def_machine_variable_parameter_atom2401 */
+static ANTLR3_BITWORD FOLLOW_COLON_in_def_machine_variable_parameter_atom2401_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COLON_in_def_machine_variable_parameter_atom2401 = { FOLLOW_COLON_in_def_machine_variable_parameter_atom2401_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_def_machine_variable_parameter_atom2412 */
+static ANTLR3_BITWORD FOLLOW_expression_in_def_machine_variable_parameter_atom2412_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_def_machine_variable_parameter_atom2412 = { FOLLOW_expression_in_def_machine_variable_parameter_atom2412_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_def_machine_variable_parameter_atom2423 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_def_machine_variable_parameter_atom2423_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_def_machine_variable_parameter_atom2423 = { FOLLOW_qualifiedNameID_in_def_machine_variable_parameter_atom2423_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_def_machine_returns2457 */
+static ANTLR3_BITWORD FOLLOW_set_in_def_machine_returns2457_bits[] = { ANTLR3_UINT64_LIT(0x1004000000000000), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_def_machine_returns2457 = { FOLLOW_set_in_def_machine_returns2457_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LBRACKET_in_def_machine_returns2474 */
+static ANTLR3_BITWORD FOLLOW_LBRACKET_in_def_machine_returns2474_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000280), ANTLR3_UINT64_LIT(0x0000000000001000), ANTLR3_UINT64_LIT(0x0000005000000000), ANTLR3_UINT64_LIT(0xC27E000000000000), ANTLR3_UINT64_LIT(0x78E204800E00C168), ANTLR3_UINT64_LIT(0x006413600720A261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_LBRACKET_in_def_machine_returns2474 = { FOLLOW_LBRACKET_in_def_machine_returns2474_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_machine_variable_return_atom_in_def_machine_returns2477 */
+static ANTLR3_BITWORD FOLLOW_def_machine_variable_return_atom_in_def_machine_returns2477_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_machine_variable_return_atom_in_def_machine_returns2477 = { FOLLOW_def_machine_variable_return_atom_in_def_machine_returns2477_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_def_machine_returns2489 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_def_machine_returns2489_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000280), ANTLR3_UINT64_LIT(0x0000000000001000), ANTLR3_UINT64_LIT(0x0000005000000000), ANTLR3_UINT64_LIT(0xC27E000000000000), ANTLR3_UINT64_LIT(0x78E204800E00C168), ANTLR3_UINT64_LIT(0x006413600720A261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_def_machine_returns2489 = { FOLLOW_COMMA_in_def_machine_returns2489_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_machine_variable_return_atom_in_def_machine_returns2493 */
+static ANTLR3_BITWORD FOLLOW_def_machine_variable_return_atom_in_def_machine_returns2493_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_machine_variable_return_atom_in_def_machine_returns2493 = { FOLLOW_def_machine_variable_return_atom_in_def_machine_returns2493_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RBRACKET_in_def_machine_returns2506 */
+static ANTLR3_BITWORD FOLLOW_RBRACKET_in_def_machine_returns2506_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RBRACKET_in_def_machine_returns2506 = { FOLLOW_RBRACKET_in_def_machine_returns2506_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_def_machine_returns2523 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_def_machine_returns2523_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000280), ANTLR3_UINT64_LIT(0x0000000000001000), ANTLR3_UINT64_LIT(0x0000005000000000), ANTLR3_UINT64_LIT(0xC27E000000000000), ANTLR3_UINT64_LIT(0x78E204800E00C168), ANTLR3_UINT64_LIT(0x006413600720A261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_def_machine_returns2523 = { FOLLOW_LPAREN_in_def_machine_returns2523_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_machine_variable_return_atom_in_def_machine_returns2527 */
+static ANTLR3_BITWORD FOLLOW_def_machine_variable_return_atom_in_def_machine_returns2527_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_machine_variable_return_atom_in_def_machine_returns2527 = { FOLLOW_def_machine_variable_return_atom_in_def_machine_returns2527_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_def_machine_returns2539 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_def_machine_returns2539_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000280), ANTLR3_UINT64_LIT(0x0000000000001000), ANTLR3_UINT64_LIT(0x0000005000000000), ANTLR3_UINT64_LIT(0xC27E000000000000), ANTLR3_UINT64_LIT(0x78E204800E00C168), ANTLR3_UINT64_LIT(0x006413600720A261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_def_machine_returns2539 = { FOLLOW_COMMA_in_def_machine_returns2539_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_machine_variable_return_atom_in_def_machine_returns2542 */
+static ANTLR3_BITWORD FOLLOW_def_machine_variable_return_atom_in_def_machine_returns2542_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_machine_variable_return_atom_in_def_machine_returns2542 = { FOLLOW_def_machine_variable_return_atom_in_def_machine_returns2542_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_def_machine_returns2555 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_def_machine_returns2555_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_def_machine_returns2555 = { FOLLOW_RPAREN_in_def_machine_returns2555_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_var_in_def_machine_returns2572 */
+static ANTLR3_BITWORD FOLLOW_type_var_in_def_machine_returns2572_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000012), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_type_var_in_def_machine_returns2572 = { FOLLOW_type_var_in_def_machine_returns2572_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_initial_value_in_def_machine_returns2578 */
+static ANTLR3_BITWORD FOLLOW_initial_value_in_def_machine_returns2578_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_initial_value_in_def_machine_returns2578 = { FOLLOW_initial_value_in_def_machine_returns2578_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_modifier_param_in_def_machine_variable_return_atom2617 */
+static ANTLR3_BITWORD FOLLOW_modifier_param_in_def_machine_variable_return_atom2617_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_modifier_param_in_def_machine_variable_return_atom2617 = { FOLLOW_modifier_param_in_def_machine_variable_return_atom2617_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_var_in_def_machine_variable_return_atom2629 */
+static ANTLR3_BITWORD FOLLOW_type_var_in_def_machine_variable_return_atom2629_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_type_var_in_def_machine_variable_return_atom2629 = { FOLLOW_type_var_in_def_machine_variable_return_atom2629_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_def_machine_variable_return_atom2640 */
+static ANTLR3_BITWORD FOLLOW_ID_in_def_machine_variable_return_atom2640_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000012), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_def_machine_variable_return_atom2640 = { FOLLOW_ID_in_def_machine_variable_return_atom2640_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_initial_value_in_def_machine_variable_return_atom2657 */
+static ANTLR3_BITWORD FOLLOW_initial_value_in_def_machine_variable_return_atom2657_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_initial_value_in_def_machine_variable_return_atom2657 = { FOLLOW_initial_value_in_def_machine_variable_return_atom2657_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_244_in_def_machine_variable_return_atom2680 */
+static ANTLR3_BITWORD FOLLOW_244_in_def_machine_variable_return_atom2680_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_244_in_def_machine_variable_return_atom2680 = { FOLLOW_244_in_def_machine_variable_return_atom2680_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_var_in_def_machine_variable_return_atom2701 */
+static ANTLR3_BITWORD FOLLOW_type_var_in_def_machine_variable_return_atom2701_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_type_var_in_def_machine_variable_return_atom2701 = { FOLLOW_type_var_in_def_machine_variable_return_atom2701_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COLON_in_def_machine_variable_return_atom2703 */
+static ANTLR3_BITWORD FOLLOW_COLON_in_def_machine_variable_return_atom2703_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COLON_in_def_machine_variable_return_atom2703 = { FOLLOW_COLON_in_def_machine_variable_return_atom2703_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_def_machine_variable_return_atom2714 */
+static ANTLR3_BITWORD FOLLOW_expression_in_def_machine_variable_return_atom2714_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_def_machine_variable_return_atom2714 = { FOLLOW_expression_in_def_machine_variable_return_atom2714_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_def_machine_variable_return_atom2725 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_def_machine_variable_return_atom2725_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_def_machine_variable_return_atom2725 = { FOLLOW_qualifiedNameID_in_def_machine_variable_return_atom2725_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_def_body_procedure2755 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_def_body_procedure2755_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0xF1CE5C00027B0000), ANTLR3_UINT64_LIT(0x00080009D9FE9FFD), ANTLR3_UINT64_LIT(0x4406040004010048), ANTLR3_UINT64_LIT(0x1C00120A20200004), ANTLR3_UINT64_LIT(0x000000004C400A00) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_def_body_procedure2755 = { FOLLOW_LCURLY_in_def_body_procedure2755_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_body_procedure_section_in_def_body_procedure2775 */
+static ANTLR3_BITWORD FOLLOW_def_body_procedure_section_in_def_body_procedure2775_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_body_procedure_section_in_def_body_procedure2775 = { FOLLOW_def_body_procedure_section_in_def_body_procedure2775_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_body_procedure_simplif_in_def_body_procedure2784 */
+static ANTLR3_BITWORD FOLLOW_def_body_procedure_simplif_in_def_body_procedure2784_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_body_procedure_simplif_in_def_body_procedure2784 = { FOLLOW_def_body_procedure_simplif_in_def_body_procedure2784_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_def_body_procedure2795 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_def_body_procedure2795_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_def_body_procedure2795 = { FOLLOW_RCURLY_in_def_body_procedure2795_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_header_in_def_body_procedure_section2808 */
+static ANTLR3_BITWORD FOLLOW_section_header_in_def_body_procedure_section2808_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0084580000000000), ANTLR3_UINT64_LIT(0x0000000859FE9F79) };
+static ANTLR3_BITSET_LIST FOLLOW_section_header_in_def_body_procedure_section2808 = { FOLLOW_section_header_in_def_body_procedure_section2808_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_import_in_def_body_procedure_section2816 */
+static ANTLR3_BITWORD FOLLOW_section_import_in_def_body_procedure_section2816_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0084580000000000), ANTLR3_UINT64_LIT(0x0000000859FE9F78) };
+static ANTLR3_BITSET_LIST FOLLOW_section_import_in_def_body_procedure_section2816 = { FOLLOW_section_import_in_def_body_procedure_section2816_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_parameter_in_def_body_procedure_section2827 */
+static ANTLR3_BITWORD FOLLOW_section_parameter_in_def_body_procedure_section2827_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0084580000000000), ANTLR3_UINT64_LIT(0x0000000859FE9F78) };
+static ANTLR3_BITSET_LIST FOLLOW_section_parameter_in_def_body_procedure_section2827 = { FOLLOW_section_parameter_in_def_body_procedure_section2827_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_property_in_def_body_procedure_section2839 */
+static ANTLR3_BITWORD FOLLOW_section_property_in_def_body_procedure_section2839_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0084580000000000), ANTLR3_UINT64_LIT(0x0000000841F81F60) };
+static ANTLR3_BITSET_LIST FOLLOW_section_property_in_def_body_procedure_section2839 = { FOLLOW_section_property_in_def_body_procedure_section2839_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_composite_structure_in_def_body_procedure_section2852 */
+static ANTLR3_BITWORD FOLLOW_section_composite_structure_in_def_body_procedure_section2852_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0080580000000000), ANTLR3_UINT64_LIT(0x0000000840901F60) };
+static ANTLR3_BITSET_LIST FOLLOW_section_composite_structure_in_def_body_procedure_section2852 = { FOLLOW_section_composite_structure_in_def_body_procedure_section2852_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_behavior_in_def_body_procedure_section2864 */
+static ANTLR3_BITWORD FOLLOW_section_behavior_in_def_body_procedure_section2864_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000000001440) };
+static ANTLR3_BITSET_LIST FOLLOW_section_behavior_in_def_body_procedure_section2864 = { FOLLOW_section_behavior_in_def_body_procedure_section2864_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_statemachine_in_def_body_procedure_section2872 */
+static ANTLR3_BITWORD FOLLOW_section_statemachine_in_def_body_procedure_section2872_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000000001440) };
+static ANTLR3_BITSET_LIST FOLLOW_section_statemachine_in_def_body_procedure_section2872 = { FOLLOW_section_statemachine_in_def_body_procedure_section2872_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_model_of_computation_in_def_body_procedure_section2887 */
+static ANTLR3_BITWORD FOLLOW_section_model_of_computation_in_def_body_procedure_section2887_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000000001440) };
+static ANTLR3_BITSET_LIST FOLLOW_section_model_of_computation_in_def_body_procedure_section2887 = { FOLLOW_section_model_of_computation_in_def_body_procedure_section2887_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_model_of_execution_in_def_body_procedure_section2895 */
+static ANTLR3_BITWORD FOLLOW_section_model_of_execution_in_def_body_procedure_section2895_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000000001440) };
+static ANTLR3_BITSET_LIST FOLLOW_section_model_of_execution_in_def_body_procedure_section2895 = { FOLLOW_section_model_of_execution_in_def_body_procedure_section2895_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_model_of_interaction_in_def_body_procedure_section2903 */
+static ANTLR3_BITWORD FOLLOW_section_model_of_interaction_in_def_body_procedure_section2903_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000000001440) };
+static ANTLR3_BITSET_LIST FOLLOW_section_model_of_interaction_in_def_body_procedure_section2903 = { FOLLOW_section_model_of_interaction_in_def_body_procedure_section2903_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_modifier_declaration_in_def_body_procedure_simplif2939 */
+static ANTLR3_BITWORD FOLLOW_modifier_declaration_in_def_body_procedure_simplif2939_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xE14A0400027B0000), ANTLR3_UINT64_LIT(0x0000000180000084), ANTLR3_UINT64_LIT(0x4404000000010048), ANTLR3_UINT64_LIT(0x0C00000200000004), ANTLR3_UINT64_LIT(0x000000000C400200) };
+static ANTLR3_BITSET_LIST FOLLOW_modifier_declaration_in_def_body_procedure_simplif2939 = { FOLLOW_modifier_declaration_in_def_body_procedure_simplif2939_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_variable_in_def_body_procedure_simplif2955 */
+static ANTLR3_BITWORD FOLLOW_decl_variable_in_def_body_procedure_simplif2955_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xE14A0400027B0000), ANTLR3_UINT64_LIT(0x0008000180000084), ANTLR3_UINT64_LIT(0x4406040004010048), ANTLR3_UINT64_LIT(0x1C00120A20200004), ANTLR3_UINT64_LIT(0x000000004C400A00) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_variable_in_def_body_procedure_simplif2955 = { FOLLOW_decl_variable_in_def_body_procedure_simplif2955_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_any_def_statemachine_in_def_body_procedure_simplif2968 */
+static ANTLR3_BITWORD FOLLOW_any_def_statemachine_in_def_body_procedure_simplif2968_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xE14A0400027B0000), ANTLR3_UINT64_LIT(0x0008000180000084), ANTLR3_UINT64_LIT(0x4406040004010048), ANTLR3_UINT64_LIT(0x1C00120A20200004), ANTLR3_UINT64_LIT(0x000000004C400A00) };
+static ANTLR3_BITSET_LIST FOLLOW_any_def_statemachine_in_def_body_procedure_simplif2968 = { FOLLOW_any_def_statemachine_in_def_body_procedure_simplif2968_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_state_activity_in_def_body_procedure_simplif2979 */
+static ANTLR3_BITWORD FOLLOW_def_state_activity_in_def_body_procedure_simplif2979_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xE14A0400027B0000), ANTLR3_UINT64_LIT(0x0008000180000084), ANTLR3_UINT64_LIT(0x4406040004010048), ANTLR3_UINT64_LIT(0x1C00120A20200004), ANTLR3_UINT64_LIT(0x000000004C400A00) };
+static ANTLR3_BITSET_LIST FOLLOW_def_state_activity_in_def_body_procedure_simplif2979 = { FOLLOW_def_state_activity_in_def_body_procedure_simplif2979_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_routine_in_section_composite_structure3011 */
+static ANTLR3_BITWORD FOLLOW_section_routine_in_section_composite_structure3011_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_section_routine_in_section_composite_structure3011 = { FOLLOW_section_routine_in_section_composite_structure3011_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_procedure_in_section_composite_structure3017 */
+static ANTLR3_BITWORD FOLLOW_section_procedure_in_section_composite_structure3017_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_section_procedure_in_section_composite_structure3017 = { FOLLOW_section_procedure_in_section_composite_structure3017_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_composite_generic_in_section_composite_structure3024 */
+static ANTLR3_BITWORD FOLLOW_section_composite_generic_in_section_composite_structure3024_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_section_composite_generic_in_section_composite_structure3024 = { FOLLOW_section_composite_generic_in_section_composite_structure3024_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_machine_model_in_section_composite_structure3030 */
+static ANTLR3_BITWORD FOLLOW_section_machine_model_in_section_composite_structure3030_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_section_machine_model_in_section_composite_structure3030 = { FOLLOW_section_machine_model_in_section_composite_structure3030_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_machine_prototype_in_section_composite_structure3036 */
+static ANTLR3_BITWORD FOLLOW_section_machine_prototype_in_section_composite_structure3036_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_section_machine_prototype_in_section_composite_structure3036 = { FOLLOW_section_machine_prototype_in_section_composite_structure3036_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_machine_instance_in_section_composite_structure3042 */
+static ANTLR3_BITWORD FOLLOW_section_machine_instance_in_section_composite_structure3042_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_section_machine_instance_in_section_composite_structure3042 = { FOLLOW_section_machine_instance_in_section_composite_structure3042_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_section_composite_generic3056 */
+static ANTLR3_BITWORD FOLLOW_set_in_section_composite_generic3056_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x00000000027B0000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x240C000000010000), ANTLR3_UINT64_LIT(0x0C00000200000004), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_section_composite_generic3056 = { FOLLOW_set_in_section_composite_generic3056_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_executable_machine_in_section_composite_generic3081 */
+static ANTLR3_BITWORD FOLLOW_executable_machine_in_section_composite_generic3081_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x00000000027B0000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x240C000000010000), ANTLR3_UINT64_LIT(0x0C00000200000004), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_executable_machine_in_section_composite_generic3081 = { FOLLOW_executable_machine_in_section_composite_generic3081_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_203_in_section_machine_model3103 */
+static ANTLR3_BITWORD FOLLOW_203_in_section_machine_model3103_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2404000000010000), ANTLR3_UINT64_LIT(0x0800000200000004), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_203_in_section_machine_model3103 = { FOLLOW_203_in_section_machine_model3103_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_executable_model_definiton_in_section_machine_model3112 */
+static ANTLR3_BITWORD FOLLOW_executable_model_definiton_in_section_machine_model3112_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2404000000010000), ANTLR3_UINT64_LIT(0x0800000200000004), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_executable_model_definiton_in_section_machine_model3112 = { FOLLOW_executable_model_definiton_in_section_machine_model3112_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_215_in_section_machine_prototype3134 */
+static ANTLR3_BITWORD FOLLOW_215_in_section_machine_prototype3134_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2404000000010000), ANTLR3_UINT64_LIT(0x0800000200000004), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_215_in_section_machine_prototype3134 = { FOLLOW_215_in_section_machine_prototype3134_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_executable_model_definiton_in_section_machine_prototype3143 */
+static ANTLR3_BITWORD FOLLOW_executable_model_definiton_in_section_machine_prototype3143_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2404000000010000), ANTLR3_UINT64_LIT(0x0800000200000004), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_executable_model_definiton_in_section_machine_prototype3143 = { FOLLOW_executable_model_definiton_in_section_machine_prototype3143_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_197_in_section_machine_instance3160 */
+static ANTLR3_BITWORD FOLLOW_197_in_section_machine_instance3160_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x040C000004010000), ANTLR3_UINT64_LIT(0x0000000920000000), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_197_in_section_machine_instance3160 = { FOLLOW_197_in_section_machine_instance3160_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_executable_instance_definiton_in_section_machine_instance3169 */
+static ANTLR3_BITWORD FOLLOW_executable_instance_definiton_in_section_machine_instance3169_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x040C000004010000), ANTLR3_UINT64_LIT(0x0000000920000000), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_executable_instance_definiton_in_section_machine_instance3169 = { FOLLOW_executable_instance_definiton_in_section_machine_instance3169_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_executable_modifier_specifier_in_executable_machine3199 */
+static ANTLR3_BITWORD FOLLOW_executable_modifier_specifier_in_executable_machine3199_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x00000000027B0000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x240C000000010000), ANTLR3_UINT64_LIT(0x0C00000200000004), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_executable_modifier_specifier_in_executable_machine3199 = { FOLLOW_executable_modifier_specifier_in_executable_machine3199_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_machine_in_executable_machine3220 */
+static ANTLR3_BITWORD FOLLOW_def_machine_in_executable_machine3220_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_machine_in_executable_machine3220 = { FOLLOW_def_machine_in_executable_machine3220_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_any_def_statemachine_in_executable_machine3236 */
+static ANTLR3_BITWORD FOLLOW_any_def_statemachine_in_executable_machine3236_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_any_def_statemachine_in_executable_machine3236 = { FOLLOW_any_def_statemachine_in_executable_machine3236_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_instance_in_executable_machine3252 */
+static ANTLR3_BITWORD FOLLOW_decl_instance_in_executable_machine3252_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_instance_in_executable_machine3252 = { FOLLOW_decl_instance_in_executable_machine3252_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_executable_modifier_specifier_in_executable_model_definiton3286 */
+static ANTLR3_BITWORD FOLLOW_executable_modifier_specifier_in_executable_model_definiton3286_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0800000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_executable_modifier_specifier_in_executable_model_definiton3286 = { FOLLOW_executable_modifier_specifier_in_executable_model_definiton3286_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_machine_in_executable_model_definiton3307 */
+static ANTLR3_BITWORD FOLLOW_def_machine_in_executable_model_definiton3307_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_machine_in_executable_model_definiton3307 = { FOLLOW_def_machine_in_executable_model_definiton3307_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_statemachine_in_executable_model_definiton3329 */
+static ANTLR3_BITWORD FOLLOW_def_statemachine_in_executable_model_definiton3329_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_statemachine_in_executable_model_definiton3329 = { FOLLOW_def_statemachine_in_executable_model_definiton3329_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_instance_modifier_specifier_in_executable_instance_definiton3365 */
+static ANTLR3_BITWORD FOLLOW_instance_modifier_specifier_in_executable_instance_definiton3365_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0008000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_instance_modifier_specifier_in_executable_instance_definiton3365 = { FOLLOW_instance_modifier_specifier_in_executable_instance_definiton3365_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_instance_in_executable_instance_definiton3384 */
+static ANTLR3_BITWORD FOLLOW_decl_instance_in_executable_instance_definiton3384_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_instance_in_executable_instance_definiton3384 = { FOLLOW_decl_instance_in_executable_instance_definiton3384_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_307_in_decl_instance3421 */
+static ANTLR3_BITWORD FOLLOW_307_in_decl_instance3421_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000002000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0800000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_307_in_decl_instance3421 = { FOLLOW_307_in_decl_instance3421_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_decl_instance3438 */
+static ANTLR3_BITWORD FOLLOW_LT__in_decl_instance3438_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000008) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_decl_instance3438 = { FOLLOW_LT__in_decl_instance3438_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_323_in_decl_instance3446 */
+static ANTLR3_BITWORD FOLLOW_323_in_decl_instance3446_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_323_in_decl_instance3446 = { FOLLOW_323_in_decl_instance3446_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_instance_machine_model_in_decl_instance3453 */
+static ANTLR3_BITWORD FOLLOW_instance_machine_model_in_decl_instance3453_bits[] = { ANTLR3_UINT64_LIT(0x0000200000800000) };
+static ANTLR3_BITSET_LIST FOLLOW_instance_machine_model_in_decl_instance3453 = { FOLLOW_instance_machine_model_in_decl_instance3453_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_decl_instance3465 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_decl_instance3465_bits[] = { ANTLR3_UINT64_LIT(0x1000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0010000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_decl_instance3465 = { FOLLOW_COMMA_in_decl_instance3465_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_instance_count_in_decl_instance3468 */
+static ANTLR3_BITWORD FOLLOW_def_instance_count_in_decl_instance3468_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_instance_count_in_decl_instance3468 = { FOLLOW_def_instance_count_in_decl_instance3468_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_decl_instance3477 */
+static ANTLR3_BITWORD FOLLOW_GT_in_decl_instance3477_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_decl_instance3477 = { FOLLOW_GT_in_decl_instance3477_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_decl_instance3482 */
+static ANTLR3_BITWORD FOLLOW_ID_in_decl_instance3482_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000000002080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_decl_instance3482 = { FOLLOW_ID_in_decl_instance3482_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_StringLiteral_in_decl_instance3495 */
+static ANTLR3_BITWORD FOLLOW_StringLiteral_in_decl_instance3495_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_StringLiteral_in_decl_instance3495 = { FOLLOW_StringLiteral_in_decl_instance3495_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_decl_instance3515 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_decl_instance3515_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002042), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_decl_instance3515 = { FOLLOW_LPAREN_in_decl_instance3515_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_instance_on_new_activity_in_decl_instance3524 */
+static ANTLR3_BITWORD FOLLOW_def_instance_on_new_activity_in_decl_instance3524_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_instance_on_new_activity_in_decl_instance3524 = { FOLLOW_def_instance_on_new_activity_in_decl_instance3524_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_decl_instance3536 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_decl_instance3536_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_decl_instance3536 = { FOLLOW_RPAREN_in_decl_instance3536_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_decl_instance3550 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_decl_instance3550_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_decl_instance3550 = { FOLLOW_SEMI_in_decl_instance3550_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_decl_instance3558 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_decl_instance3558_bits[] = { ANTLR3_UINT64_LIT(0x000C000104400000), ANTLR3_UINT64_LIT(0x2000000000000101), ANTLR3_UINT64_LIT(0x000200003C001000), ANTLR3_UINT64_LIT(0x0480100400000000), ANTLR3_UINT64_LIT(0x0103F97E24C83881), ANTLR3_UINT64_LIT(0x020B1C00003F0400), ANTLR3_UINT64_LIT(0x00000001800000A6) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_decl_instance3558 = { FOLLOW_LCURLY_in_decl_instance3558_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_in_decl_instance3566 */
+static ANTLR3_BITWORD FOLLOW_statement_in_decl_instance3566_bits[] = { ANTLR3_UINT64_LIT(0x000C000104400000), ANTLR3_UINT64_LIT(0x2000000000000101), ANTLR3_UINT64_LIT(0x000200003C001000), ANTLR3_UINT64_LIT(0x0480100400000000), ANTLR3_UINT64_LIT(0x0103F97E24C83881), ANTLR3_UINT64_LIT(0x020B1C00003F0400), ANTLR3_UINT64_LIT(0x00000001800000A6) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_in_decl_instance3566 = { FOLLOW_statement_in_decl_instance3566_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_instance_activity_in_decl_instance3578 */
+static ANTLR3_BITWORD FOLLOW_def_instance_activity_in_decl_instance3578_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0002000000000000), ANTLR3_UINT64_LIT(0x0000000400000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_instance_activity_in_decl_instance3578 = { FOLLOW_def_instance_activity_in_decl_instance3578_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_decl_instance3589 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_decl_instance3589_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_decl_instance3589 = { FOLLOW_RCURLY_in_decl_instance3589_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_instance_on_new_activity_parameter_in_def_instance_on_new_activity3612 */
+static ANTLR3_BITWORD FOLLOW_def_instance_on_new_activity_parameter_in_def_instance_on_new_activity3612_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_instance_on_new_activity_parameter_in_def_instance_on_new_activity3612 = { FOLLOW_def_instance_on_new_activity_parameter_in_def_instance_on_new_activity3612_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_def_instance_on_new_activity3623 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_def_instance_on_new_activity3623_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_def_instance_on_new_activity3623 = { FOLLOW_COMMA_in_def_instance_on_new_activity3623_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_instance_on_new_activity_parameter_in_def_instance_on_new_activity3625 */
+static ANTLR3_BITWORD FOLLOW_def_instance_on_new_activity_parameter_in_def_instance_on_new_activity3625_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_instance_on_new_activity_parameter_in_def_instance_on_new_activity3625 = { FOLLOW_def_instance_on_new_activity_parameter_in_def_instance_on_new_activity3625_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_lvalue_in_def_instance_on_new_activity_parameter3659 */
+static ANTLR3_BITWORD FOLLOW_lvalue_in_def_instance_on_new_activity_parameter3659_bits[] = { ANTLR3_UINT64_LIT(0x00000000002000D0) };
+static ANTLR3_BITSET_LIST FOLLOW_lvalue_in_def_instance_on_new_activity_parameter3659 = { FOLLOW_lvalue_in_def_instance_on_new_activity_parameter3659_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_op_assign_param_in_def_instance_on_new_activity_parameter3664 */
+static ANTLR3_BITWORD FOLLOW_op_assign_param_in_def_instance_on_new_activity_parameter3664_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_op_assign_param_in_def_instance_on_new_activity_parameter3664 = { FOLLOW_op_assign_param_in_def_instance_on_new_activity_parameter3664_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_def_instance_on_new_activity_parameter3669 */
+static ANTLR3_BITWORD FOLLOW_expression_in_def_instance_on_new_activity_parameter3669_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_def_instance_on_new_activity_parameter3669 = { FOLLOW_expression_in_def_instance_on_new_activity_parameter3669_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_def_instance_on_new_activity_parameter3682 */
+static ANTLR3_BITWORD FOLLOW_expression_in_def_instance_on_new_activity_parameter3682_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_def_instance_on_new_activity_parameter3682 = { FOLLOW_expression_in_def_instance_on_new_activity_parameter3682_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_op_assign_param3702 */
+static ANTLR3_BITWORD FOLLOW_set_in_op_assign_param3702_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_op_assign_param3702 = { FOLLOW_set_in_op_assign_param3702_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSIGN_REF_in_op_assign_param3718 */
+static ANTLR3_BITWORD FOLLOW_ASSIGN_REF_in_op_assign_param3718_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ASSIGN_REF_in_op_assign_param3718 = { FOLLOW_ASSIGN_REF_in_op_assign_param3718_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSIGN_MACRO_in_op_assign_param3734 */
+static ANTLR3_BITWORD FOLLOW_ASSIGN_MACRO_in_op_assign_param3734_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ASSIGN_MACRO_in_op_assign_param3734 = { FOLLOW_ASSIGN_MACRO_in_op_assign_param3734_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_177_in_def_instance_activity3761 */
+static ANTLR3_BITWORD FOLLOW_177_in_def_instance_activity3761_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_177_in_def_instance_activity3761 = { FOLLOW_177_in_def_instance_activity3761_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_def_instance_activity3767 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_def_instance_activity3767_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_def_instance_activity3767 = { FOLLOW_block_statement_in_def_instance_activity3767_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_226_in_def_instance_activity3775 */
+static ANTLR3_BITWORD FOLLOW_226_in_def_instance_activity3775_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_226_in_def_instance_activity3775 = { FOLLOW_226_in_def_instance_activity3775_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_def_instance_activity3783 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_def_instance_activity3783_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_def_instance_activity3783 = { FOLLOW_block_statement_in_def_instance_activity3783_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_171_in_section_behavior3805 */
+static ANTLR3_BITWORD FOLLOW_171_in_section_behavior3805_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x00000000027B0000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x240C000000010000), ANTLR3_UINT64_LIT(0x0C00000200000004), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_171_in_section_behavior3805 = { FOLLOW_171_in_section_behavior3805_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_executable_machine_in_section_behavior3814 */
+static ANTLR3_BITWORD FOLLOW_executable_machine_in_section_behavior3814_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x00000000027B0000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x240C000000010000), ANTLR3_UINT64_LIT(0x0C00000200000004), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_executable_machine_in_section_behavior3814 = { FOLLOW_executable_machine_in_section_behavior3814_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LBRACKET_in_def_instance_count3857 */
+static ANTLR3_BITWORD FOLLOW_LBRACKET_in_def_instance_count3857_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000), ANTLR3_UINT64_LIT(0x0100000000000000), ANTLR3_UINT64_LIT(0x0000000000000200) };
+static ANTLR3_BITSET_LIST FOLLOW_LBRACKET_in_def_instance_count3857 = { FOLLOW_LBRACKET_in_def_instance_count3857_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_integer_constant_in_def_instance_count3868 */
+static ANTLR3_BITWORD FOLLOW_integer_constant_in_def_instance_count3868_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000) };
+static ANTLR3_BITSET_LIST FOLLOW_integer_constant_in_def_instance_count3868 = { FOLLOW_integer_constant_in_def_instance_count3868_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_def_instance_count3880 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_def_instance_count3880_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000), ANTLR3_UINT64_LIT(0x0100000000000000), ANTLR3_UINT64_LIT(0x0000000000000200) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_def_instance_count3880 = { FOLLOW_COMMA_in_def_instance_count3880_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_integer_constant_in_def_instance_count3893 */
+static ANTLR3_BITWORD FOLLOW_integer_constant_in_def_instance_count3893_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_integer_constant_in_def_instance_count3893 = { FOLLOW_integer_constant_in_def_instance_count3893_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_def_instance_count3907 */
+static ANTLR3_BITWORD FOLLOW_set_in_def_instance_count3907_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_def_instance_count3907 = { FOLLOW_set_in_def_instance_count3907_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STAR_in_def_instance_count3939 */
+static ANTLR3_BITWORD FOLLOW_STAR_in_def_instance_count3939_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_STAR_in_def_instance_count3939 = { FOLLOW_STAR_in_def_instance_count3939_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_PLUS_in_def_instance_count3951 */
+static ANTLR3_BITWORD FOLLOW_PLUS_in_def_instance_count3951_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_PLUS_in_def_instance_count3951 = { FOLLOW_PLUS_in_def_instance_count3951_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RBRACKET_in_def_instance_count3968 */
+static ANTLR3_BITWORD FOLLOW_RBRACKET_in_def_instance_count3968_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RBRACKET_in_def_instance_count3968 = { FOLLOW_RBRACKET_in_def_instance_count3968_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_def_instance_count3976 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_def_instance_count3976_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x8000020000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_def_instance_count3976 = { FOLLOW_LPAREN_in_def_instance_count3976_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_instance_count_atom_in_def_instance_count3983 */
+static ANTLR3_BITWORD FOLLOW_def_instance_count_atom_in_def_instance_count3983_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x8000020000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_instance_count_atom_in_def_instance_count3983 = { FOLLOW_def_instance_count_atom_in_def_instance_count3983_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_def_instance_count3993 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_def_instance_count3993_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x8000020000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_def_instance_count3993 = { FOLLOW_COMMA_in_def_instance_count3993_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_instance_count_atom_in_def_instance_count3998 */
+static ANTLR3_BITWORD FOLLOW_def_instance_count_atom_in_def_instance_count3998_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x8000020000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_instance_count_atom_in_def_instance_count3998 = { FOLLOW_def_instance_count_atom_in_def_instance_count3998_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_def_instance_count4009 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_def_instance_count4009_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_def_instance_count4009 = { FOLLOW_RPAREN_in_def_instance_count4009_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_297_in_def_instance_count_atom4028 */
+static ANTLR3_BITWORD FOLLOW_297_in_def_instance_count_atom4028_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_297_in_def_instance_count_atom4028 = { FOLLOW_297_in_def_instance_count_atom4028_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_integer_constant_in_def_instance_count_atom4032 */
+static ANTLR3_BITWORD FOLLOW_integer_constant_in_def_instance_count_atom4032_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_integer_constant_in_def_instance_count_atom4032 = { FOLLOW_integer_constant_in_def_instance_count_atom4032_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_319_in_def_instance_count_atom4040 */
+static ANTLR3_BITWORD FOLLOW_319_in_def_instance_count_atom4040_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_319_in_def_instance_count_atom4040 = { FOLLOW_319_in_def_instance_count_atom4040_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_integer_constant_in_def_instance_count_atom4045 */
+static ANTLR3_BITWORD FOLLOW_integer_constant_in_def_instance_count_atom4045_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_integer_constant_in_def_instance_count_atom4045 = { FOLLOW_integer_constant_in_def_instance_count_atom4045_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_317_in_def_machine4075 */
+static ANTLR3_BITWORD FOLLOW_317_in_def_machine4075_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_317_in_def_machine4075 = { FOLLOW_317_in_def_machine4075_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_def_machine4082 */
+static ANTLR3_BITWORD FOLLOW_LT__in_def_machine4082_bits[] = { ANTLR3_UINT64_LIT(0x1004200000000000), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000001800000), ANTLR3_UINT64_LIT(0x0000800000000000), ANTLR3_UINT64_LIT(0x0110000054000002), ANTLR3_UINT64_LIT(0x0200100000004082) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_def_machine4082 = { FOLLOW_LT__in_def_machine4082_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_321_in_def_machine4092 */
+static ANTLR3_BITWORD FOLLOW_321_in_def_machine4092_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000001800000), ANTLR3_UINT64_LIT(0x0000800000000000), ANTLR3_UINT64_LIT(0x0100000054000002), ANTLR3_UINT64_LIT(0x0200100000004000) };
+static ANTLR3_BITSET_LIST FOLLOW_321_in_def_machine4092 = { FOLLOW_321_in_def_machine4092_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_executable_specifier_in_def_machine4098 */
+static ANTLR3_BITWORD FOLLOW_executable_specifier_in_def_machine4098_bits[] = { ANTLR3_UINT64_LIT(0x0000200000800000) };
+static ANTLR3_BITSET_LIST FOLLOW_executable_specifier_in_def_machine4098 = { FOLLOW_executable_specifier_in_def_machine4098_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_def_machine4108 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_def_machine4108_bits[] = { ANTLR3_UINT64_LIT(0x1000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0010000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_def_machine4108 = { FOLLOW_COMMA_in_def_machine4108_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_instance_count_in_def_machine4111 */
+static ANTLR3_BITWORD FOLLOW_def_instance_count_in_def_machine4111_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_instance_count_in_def_machine4111 = { FOLLOW_def_instance_count_in_def_machine4111_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_instance_count_in_def_machine4124 */
+static ANTLR3_BITWORD FOLLOW_def_instance_count_in_def_machine4124_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_instance_count_in_def_machine4124 = { FOLLOW_def_instance_count_in_def_machine4124_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_def_machine4137 */
+static ANTLR3_BITWORD FOLLOW_GT_in_def_machine4137_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_def_machine4137 = { FOLLOW_GT_in_def_machine4137_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_def_machine4147 */
+static ANTLR3_BITWORD FOLLOW_ID_in_def_machine4147_bits[] = { ANTLR3_UINT64_LIT(0x1000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800002000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_def_machine4147 = { FOLLOW_ID_in_def_machine4147_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_StringLiteral_in_def_machine4160 */
+static ANTLR3_BITWORD FOLLOW_StringLiteral_in_def_machine4160_bits[] = { ANTLR3_UINT64_LIT(0x1000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_StringLiteral_in_def_machine4160 = { FOLLOW_StringLiteral_in_def_machine4160_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_machine_parameters_in_def_machine4177 */
+static ANTLR3_BITWORD FOLLOW_def_machine_parameters_in_def_machine4177_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_machine_parameters_in_def_machine4177 = { FOLLOW_def_machine_parameters_in_def_machine4177_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_machine_returns_in_def_machine4186 */
+static ANTLR3_BITWORD FOLLOW_def_machine_returns_in_def_machine4186_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_def_machine_returns_in_def_machine4186 = { FOLLOW_def_machine_returns_in_def_machine4186_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_body_machine_in_def_machine4195 */
+static ANTLR3_BITWORD FOLLOW_def_body_machine_in_def_machine4195_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_body_machine_in_def_machine4195 = { FOLLOW_def_body_machine_in_def_machine4195_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_188_in_def_body_machine_using_section_header_predicat4208 */
+static ANTLR3_BITWORD FOLLOW_188_in_def_body_machine_using_section_header_predicat4208_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_188_in_def_body_machine_using_section_header_predicat4208 = { FOLLOW_188_in_def_body_machine_using_section_header_predicat4208_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_192_in_def_body_machine_using_section_import_predicat4219 */
+static ANTLR3_BITWORD FOLLOW_192_in_def_body_machine_using_section_import_predicat4219_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_192_in_def_body_machine_using_section_import_predicat4219 = { FOLLOW_192_in_def_body_machine_using_section_import_predicat4219_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_body_machine_using_section_header_predicat_in_def_body_machine_using_section_predicat4313 */
+static ANTLR3_BITWORD FOLLOW_def_body_machine_using_section_header_predicat_in_def_body_machine_using_section_predicat4313_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_body_machine_using_section_header_predicat_in_def_body_machine_using_section_predicat4313 = { FOLLOW_def_body_machine_using_section_header_predicat_in_def_body_machine_using_section_predicat4313_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_body_machine_using_section_import_predicat_in_def_body_machine_using_section_predicat4318 */
+static ANTLR3_BITWORD FOLLOW_def_body_machine_using_section_import_predicat_in_def_body_machine_using_section_predicat4318_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_body_machine_using_section_import_predicat_in_def_body_machine_using_section_predicat4318 = { FOLLOW_def_body_machine_using_section_import_predicat_in_def_body_machine_using_section_predicat4318_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_body_machine_using_section_parameter_predicat_in_def_body_machine_using_section_predicat4323 */
+static ANTLR3_BITWORD FOLLOW_def_body_machine_using_section_parameter_predicat_in_def_body_machine_using_section_predicat4323_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_body_machine_using_section_parameter_predicat_in_def_body_machine_using_section_predicat4323 = { FOLLOW_def_body_machine_using_section_parameter_predicat_in_def_body_machine_using_section_predicat4323_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_body_machine_using_section_property_predicat_in_def_body_machine_using_section_predicat4328 */
+static ANTLR3_BITWORD FOLLOW_def_body_machine_using_section_property_predicat_in_def_body_machine_using_section_predicat4328_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_body_machine_using_section_property_predicat_in_def_body_machine_using_section_predicat4328 = { FOLLOW_def_body_machine_using_section_property_predicat_in_def_body_machine_using_section_predicat4328_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_201_in_def_body_machine_using_section_predicat4334 */
+static ANTLR3_BITWORD FOLLOW_201_in_def_body_machine_using_section_predicat4334_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_201_in_def_body_machine_using_section_predicat4334 = { FOLLOW_201_in_def_body_machine_using_section_predicat4334_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_221_in_def_body_machine_using_section_predicat4338 */
+static ANTLR3_BITWORD FOLLOW_221_in_def_body_machine_using_section_predicat4338_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_221_in_def_body_machine_using_section_predicat4338 = { FOLLOW_221_in_def_body_machine_using_section_predicat4338_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_212_in_def_body_machine_using_section_predicat4342 */
+static ANTLR3_BITWORD FOLLOW_212_in_def_body_machine_using_section_predicat4342_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_212_in_def_body_machine_using_section_predicat4342 = { FOLLOW_212_in_def_body_machine_using_section_predicat4342_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_173_in_def_body_machine_using_section_predicat4348 */
+static ANTLR3_BITWORD FOLLOW_173_in_def_body_machine_using_section_predicat4348_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_173_in_def_body_machine_using_section_predicat4348 = { FOLLOW_173_in_def_body_machine_using_section_predicat4348_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_200_in_def_body_machine_using_section_predicat4352 */
+static ANTLR3_BITWORD FOLLOW_200_in_def_body_machine_using_section_predicat4352_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_200_in_def_body_machine_using_section_predicat4352 = { FOLLOW_200_in_def_body_machine_using_section_predicat4352_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_217_in_def_body_machine_using_section_predicat4357 */
+static ANTLR3_BITWORD FOLLOW_217_in_def_body_machine_using_section_predicat4357_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_217_in_def_body_machine_using_section_predicat4357 = { FOLLOW_217_in_def_body_machine_using_section_predicat4357_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_227_in_def_body_machine_using_section_predicat4363 */
+static ANTLR3_BITWORD FOLLOW_227_in_def_body_machine_using_section_predicat4363_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_227_in_def_body_machine_using_section_predicat4363 = { FOLLOW_227_in_def_body_machine_using_section_predicat4363_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_171_in_def_body_machine_using_section_predicat4369 */
+static ANTLR3_BITWORD FOLLOW_171_in_def_body_machine_using_section_predicat4369_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_171_in_def_body_machine_using_section_predicat4369 = { FOLLOW_171_in_def_body_machine_using_section_predicat4369_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_231_in_def_body_machine_using_section_predicat4373 */
+static ANTLR3_BITWORD FOLLOW_231_in_def_body_machine_using_section_predicat4373_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_231_in_def_body_machine_using_section_predicat4373 = { FOLLOW_231_in_def_body_machine_using_section_predicat4373_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_202_in_def_body_machine_using_section_predicat4381 */
+static ANTLR3_BITWORD FOLLOW_202_in_def_body_machine_using_section_predicat4381_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_202_in_def_body_machine_using_section_predicat4381 = { FOLLOW_202_in_def_body_machine_using_section_predicat4381_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_204_in_def_body_machine_using_section_predicat4385 */
+static ANTLR3_BITWORD FOLLOW_204_in_def_body_machine_using_section_predicat4385_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_204_in_def_body_machine_using_section_predicat4385 = { FOLLOW_204_in_def_body_machine_using_section_predicat4385_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_172_in_def_body_machine_using_section_predicat4389 */
+static ANTLR3_BITWORD FOLLOW_172_in_def_body_machine_using_section_predicat4389_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_172_in_def_body_machine_using_section_predicat4389 = { FOLLOW_172_in_def_body_machine_using_section_predicat4389_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_198_in_def_body_machine_using_section_predicat4393 */
+static ANTLR3_BITWORD FOLLOW_198_in_def_body_machine_using_section_predicat4393_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_198_in_def_body_machine_using_section_predicat4393 = { FOLLOW_198_in_def_body_machine_using_section_predicat4393_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_def_body_machine4407 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_def_body_machine4407_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x1084580000000000), ANTLR3_UINT64_LIT(0x0000000859FE9F79) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_def_body_machine4407 = { FOLLOW_LCURLY_in_def_body_machine4407_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_body_machine_section_in_def_body_machine4424 */
+static ANTLR3_BITWORD FOLLOW_def_body_machine_section_in_def_body_machine4424_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_body_machine_section_in_def_body_machine4424 = { FOLLOW_def_body_machine_section_in_def_body_machine4424_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_def_body_machine4437 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_def_body_machine4437_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_def_body_machine4437 = { FOLLOW_RCURLY_in_def_body_machine4437_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_header_in_def_body_machine_section4450 */
+static ANTLR3_BITWORD FOLLOW_section_header_in_def_body_machine_section4450_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0084580000000000), ANTLR3_UINT64_LIT(0x0000000859FE9F79) };
+static ANTLR3_BITSET_LIST FOLLOW_section_header_in_def_body_machine_section4450 = { FOLLOW_section_header_in_def_body_machine_section4450_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_import_in_def_body_machine_section4458 */
+static ANTLR3_BITWORD FOLLOW_section_import_in_def_body_machine_section4458_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0084580000000000), ANTLR3_UINT64_LIT(0x0000000859FE9F78) };
+static ANTLR3_BITSET_LIST FOLLOW_section_import_in_def_body_machine_section4458 = { FOLLOW_section_import_in_def_body_machine_section4458_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_parameter_in_def_body_machine_section4469 */
+static ANTLR3_BITWORD FOLLOW_section_parameter_in_def_body_machine_section4469_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0084580000000000), ANTLR3_UINT64_LIT(0x0000000859FE9F78) };
+static ANTLR3_BITSET_LIST FOLLOW_section_parameter_in_def_body_machine_section4469 = { FOLLOW_section_parameter_in_def_body_machine_section4469_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_property_in_def_body_machine_section4491 */
+static ANTLR3_BITWORD FOLLOW_section_property_in_def_body_machine_section4491_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0084580000000000), ANTLR3_UINT64_LIT(0x0000000841F81F60) };
+static ANTLR3_BITSET_LIST FOLLOW_section_property_in_def_body_machine_section4491 = { FOLLOW_section_property_in_def_body_machine_section4491_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_composite_structure_in_def_body_machine_section4504 */
+static ANTLR3_BITWORD FOLLOW_section_composite_structure_in_def_body_machine_section4504_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0080580000000000), ANTLR3_UINT64_LIT(0x0000000840901F60) };
+static ANTLR3_BITSET_LIST FOLLOW_section_composite_structure_in_def_body_machine_section4504 = { FOLLOW_section_composite_structure_in_def_body_machine_section4504_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_behavior_in_def_body_machine_section4516 */
+static ANTLR3_BITWORD FOLLOW_section_behavior_in_def_body_machine_section4516_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000000001440) };
+static ANTLR3_BITSET_LIST FOLLOW_section_behavior_in_def_body_machine_section4516 = { FOLLOW_section_behavior_in_def_body_machine_section4516_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_statemachine_in_def_body_machine_section4524 */
+static ANTLR3_BITWORD FOLLOW_section_statemachine_in_def_body_machine_section4524_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000000001440) };
+static ANTLR3_BITSET_LIST FOLLOW_section_statemachine_in_def_body_machine_section4524 = { FOLLOW_section_statemachine_in_def_body_machine_section4524_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_model_of_computation_in_def_body_machine_section4549 */
+static ANTLR3_BITWORD FOLLOW_section_model_of_computation_in_def_body_machine_section4549_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000000001440) };
+static ANTLR3_BITSET_LIST FOLLOW_section_model_of_computation_in_def_body_machine_section4549 = { FOLLOW_section_model_of_computation_in_def_body_machine_section4549_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_model_of_execution_in_def_body_machine_section4557 */
+static ANTLR3_BITWORD FOLLOW_section_model_of_execution_in_def_body_machine_section4557_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000000001440) };
+static ANTLR3_BITSET_LIST FOLLOW_section_model_of_execution_in_def_body_machine_section4557 = { FOLLOW_section_model_of_execution_in_def_body_machine_section4557_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_model_of_interaction_in_def_body_machine_section4565 */
+static ANTLR3_BITWORD FOLLOW_section_model_of_interaction_in_def_body_machine_section4565_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000000001440) };
+static ANTLR3_BITSET_LIST FOLLOW_section_model_of_interaction_in_def_body_machine_section4565 = { FOLLOW_section_model_of_interaction_in_def_body_machine_section4565_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_property_declaration_in_def_body_machine_simplif4593 */
+static ANTLR3_BITWORD FOLLOW_property_declaration_in_def_body_machine_simplif4593_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2208000000000000), ANTLR3_UINT64_LIT(0x400204000410004E), ANTLR3_UINT64_LIT(0x1040120821200001), ANTLR3_UINT64_LIT(0x000000004C504810) };
+static ANTLR3_BITSET_LIST FOLLOW_property_declaration_in_def_body_machine_simplif4593 = { FOLLOW_property_declaration_in_def_body_machine_simplif4593_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_moe_primitive_in_def_body_machine_simplif4609 */
+static ANTLR3_BITWORD FOLLOW_def_moe_primitive_in_def_body_machine_simplif4609_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xE14A840000000000), ANTLR3_UINT64_LIT(0x0000001784000084), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000800000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_moe_primitive_in_def_body_machine_simplif4609 = { FOLLOW_def_moe_primitive_in_def_body_machine_simplif4609_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_executable_modifier_specifier_in_any_def_statemachine4644 */
+static ANTLR3_BITWORD FOLLOW_executable_modifier_specifier_in_any_def_statemachine4644_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x00000000027B0000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0C00000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_executable_modifier_specifier_in_any_def_statemachine4644 = { FOLLOW_executable_modifier_specifier_in_any_def_statemachine4644_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_state_singleton_in_any_def_statemachine4666 */
+static ANTLR3_BITWORD FOLLOW_def_state_singleton_in_any_def_statemachine4666_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_state_singleton_in_any_def_statemachine4666 = { FOLLOW_def_state_singleton_in_any_def_statemachine4666_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_state_in_any_def_statemachine4682 */
+static ANTLR3_BITWORD FOLLOW_def_state_in_any_def_statemachine4682_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_state_in_any_def_statemachine4682 = { FOLLOW_def_state_in_any_def_statemachine4682_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_statemachine_in_any_def_statemachine4698 */
+static ANTLR3_BITWORD FOLLOW_def_statemachine_in_any_def_statemachine4698_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_statemachine_in_any_def_statemachine4698 = { FOLLOW_def_statemachine_in_any_def_statemachine4698_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_379_in_def_statemachine4736 */
+static ANTLR3_BITWORD FOLLOW_379_in_def_statemachine4736_bits[] = { ANTLR3_UINT64_LIT(0x5004000000000000), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_379_in_def_statemachine4736 = { FOLLOW_379_in_def_statemachine4736_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_def_statemachine4743 */
+static ANTLR3_BITWORD FOLLOW_LT__in_def_statemachine4743_bits[] = { ANTLR3_UINT64_LIT(0x1004200000000000), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000001800000), ANTLR3_UINT64_LIT(0x0000800000000000), ANTLR3_UINT64_LIT(0x0110000054000002), ANTLR3_UINT64_LIT(0x0200100000004082) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_def_statemachine4743 = { FOLLOW_LT__in_def_statemachine4743_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_321_in_def_statemachine4753 */
+static ANTLR3_BITWORD FOLLOW_321_in_def_statemachine4753_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000001800000), ANTLR3_UINT64_LIT(0x0000800000000000), ANTLR3_UINT64_LIT(0x0100000054000002), ANTLR3_UINT64_LIT(0x0200100000004000) };
+static ANTLR3_BITSET_LIST FOLLOW_321_in_def_statemachine4753 = { FOLLOW_321_in_def_statemachine4753_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_executable_specifier_in_def_statemachine4759 */
+static ANTLR3_BITWORD FOLLOW_executable_specifier_in_def_statemachine4759_bits[] = { ANTLR3_UINT64_LIT(0x0000200000800000) };
+static ANTLR3_BITSET_LIST FOLLOW_executable_specifier_in_def_statemachine4759 = { FOLLOW_executable_specifier_in_def_statemachine4759_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_def_statemachine4769 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_def_statemachine4769_bits[] = { ANTLR3_UINT64_LIT(0x1000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0010000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_def_statemachine4769 = { FOLLOW_COMMA_in_def_statemachine4769_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_instance_count_in_def_statemachine4772 */
+static ANTLR3_BITWORD FOLLOW_def_instance_count_in_def_statemachine4772_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_instance_count_in_def_statemachine4772 = { FOLLOW_def_instance_count_in_def_statemachine4772_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_instance_count_in_def_statemachine4785 */
+static ANTLR3_BITWORD FOLLOW_def_instance_count_in_def_statemachine4785_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_instance_count_in_def_statemachine4785 = { FOLLOW_def_instance_count_in_def_statemachine4785_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_def_statemachine4798 */
+static ANTLR3_BITWORD FOLLOW_GT_in_def_statemachine4798_bits[] = { ANTLR3_UINT64_LIT(0x5004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_def_statemachine4798 = { FOLLOW_GT_in_def_statemachine4798_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_def_statemachine4814 */
+static ANTLR3_BITWORD FOLLOW_ID_in_def_statemachine4814_bits[] = { ANTLR3_UINT64_LIT(0x1000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800002000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_def_statemachine4814 = { FOLLOW_ID_in_def_statemachine4814_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LBRACKET_in_def_statemachine4828 */
+static ANTLR3_BITWORD FOLLOW_LBRACKET_in_def_statemachine4828_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000200) };
+static ANTLR3_BITSET_LIST FOLLOW_LBRACKET_in_def_statemachine4828 = { FOLLOW_LBRACKET_in_def_statemachine4828_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LBRACKET_EXCEPT_in_def_statemachine4847 */
+static ANTLR3_BITWORD FOLLOW_LBRACKET_EXCEPT_in_def_statemachine4847_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000200) };
+static ANTLR3_BITSET_LIST FOLLOW_LBRACKET_EXCEPT_in_def_statemachine4847 = { FOLLOW_LBRACKET_EXCEPT_in_def_statemachine4847_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_def_statemachine4873 */
+static ANTLR3_BITWORD FOLLOW_ID_in_def_statemachine4873_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_def_statemachine4873 = { FOLLOW_ID_in_def_statemachine4873_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_def_statemachine4895 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_def_statemachine4895_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_def_statemachine4895 = { FOLLOW_COMMA_in_def_statemachine4895_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_def_statemachine4899 */
+static ANTLR3_BITWORD FOLLOW_ID_in_def_statemachine4899_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_def_statemachine4899 = { FOLLOW_ID_in_def_statemachine4899_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STAR_in_def_statemachine4915 */
+static ANTLR3_BITWORD FOLLOW_STAR_in_def_statemachine4915_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_STAR_in_def_statemachine4915 = { FOLLOW_STAR_in_def_statemachine4915_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RBRACKET_in_def_statemachine4936 */
+static ANTLR3_BITWORD FOLLOW_RBRACKET_in_def_statemachine4936_bits[] = { ANTLR3_UINT64_LIT(0x1000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800002000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_RBRACKET_in_def_statemachine4936 = { FOLLOW_RBRACKET_in_def_statemachine4936_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_StringLiteral_in_def_statemachine4953 */
+static ANTLR3_BITWORD FOLLOW_StringLiteral_in_def_statemachine4953_bits[] = { ANTLR3_UINT64_LIT(0x1000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_StringLiteral_in_def_statemachine4953 = { FOLLOW_StringLiteral_in_def_statemachine4953_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_machine_parameters_in_def_statemachine4970 */
+static ANTLR3_BITWORD FOLLOW_def_machine_parameters_in_def_statemachine4970_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_machine_parameters_in_def_statemachine4970 = { FOLLOW_def_machine_parameters_in_def_statemachine4970_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_machine_returns_in_def_statemachine4979 */
+static ANTLR3_BITWORD FOLLOW_def_machine_returns_in_def_statemachine4979_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_def_machine_returns_in_def_statemachine4979 = { FOLLOW_def_machine_returns_in_def_statemachine4979_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_body_statemachine_in_def_statemachine4988 */
+static ANTLR3_BITWORD FOLLOW_def_body_statemachine_in_def_statemachine4988_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_body_statemachine_in_def_statemachine4988 = { FOLLOW_def_body_statemachine_in_def_statemachine4988_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_def_body_statemachine5007 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_def_body_statemachine5007_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x1084500000000000), ANTLR3_UINT64_LIT(0x000000805BFE9F79) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_def_body_statemachine5007 = { FOLLOW_LCURLY_in_def_body_statemachine5007_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_header_in_def_body_statemachine5012 */
+static ANTLR3_BITWORD FOLLOW_section_header_in_def_body_statemachine5012_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0084500000000000), ANTLR3_UINT64_LIT(0x000000805BFE9F79) };
+static ANTLR3_BITSET_LIST FOLLOW_section_header_in_def_body_statemachine5012 = { FOLLOW_section_header_in_def_body_statemachine5012_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_import_in_def_body_statemachine5020 */
+static ANTLR3_BITWORD FOLLOW_section_import_in_def_body_statemachine5020_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0084500000000000), ANTLR3_UINT64_LIT(0x000000805BFE9F78) };
+static ANTLR3_BITSET_LIST FOLLOW_section_import_in_def_body_statemachine5020 = { FOLLOW_section_import_in_def_body_statemachine5020_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_parameter_in_def_body_statemachine5031 */
+static ANTLR3_BITWORD FOLLOW_section_parameter_in_def_body_statemachine5031_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0084500000000000), ANTLR3_UINT64_LIT(0x000000805BFE9F78) };
+static ANTLR3_BITSET_LIST FOLLOW_section_parameter_in_def_body_statemachine5031 = { FOLLOW_section_parameter_in_def_body_statemachine5031_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_property_in_def_body_statemachine5053 */
+static ANTLR3_BITWORD FOLLOW_section_property_in_def_body_statemachine5053_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0084500000000000), ANTLR3_UINT64_LIT(0x0000008043F81F60) };
+static ANTLR3_BITSET_LIST FOLLOW_section_property_in_def_body_statemachine5053 = { FOLLOW_section_property_in_def_body_statemachine5053_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_composite_structure_in_def_body_statemachine5066 */
+static ANTLR3_BITWORD FOLLOW_section_composite_structure_in_def_body_statemachine5066_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0080500000000000), ANTLR3_UINT64_LIT(0x0000008042901F60) };
+static ANTLR3_BITSET_LIST FOLLOW_section_composite_structure_in_def_body_statemachine5066 = { FOLLOW_section_composite_structure_in_def_body_statemachine5066_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_region_in_def_body_statemachine5076 */
+static ANTLR3_BITWORD FOLLOW_section_region_in_def_body_statemachine5076_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000008000001440) };
+static ANTLR3_BITSET_LIST FOLLOW_section_region_in_def_body_statemachine5076 = { FOLLOW_section_region_in_def_body_statemachine5076_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_transition_in_def_body_statemachine5085 */
+static ANTLR3_BITWORD FOLLOW_section_transition_in_def_body_statemachine5085_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000000001440) };
+static ANTLR3_BITSET_LIST FOLLOW_section_transition_in_def_body_statemachine5085 = { FOLLOW_section_transition_in_def_body_statemachine5085_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_model_of_computation_in_def_body_statemachine5106 */
+static ANTLR3_BITWORD FOLLOW_section_model_of_computation_in_def_body_statemachine5106_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000000001440) };
+static ANTLR3_BITSET_LIST FOLLOW_section_model_of_computation_in_def_body_statemachine5106 = { FOLLOW_section_model_of_computation_in_def_body_statemachine5106_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_model_of_execution_in_def_body_statemachine5114 */
+static ANTLR3_BITWORD FOLLOW_section_model_of_execution_in_def_body_statemachine5114_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000000001440) };
+static ANTLR3_BITSET_LIST FOLLOW_section_model_of_execution_in_def_body_statemachine5114 = { FOLLOW_section_model_of_execution_in_def_body_statemachine5114_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_model_of_interaction_in_def_body_statemachine5122 */
+static ANTLR3_BITWORD FOLLOW_section_model_of_interaction_in_def_body_statemachine5122_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000000001440) };
+static ANTLR3_BITSET_LIST FOLLOW_section_model_of_interaction_in_def_body_statemachine5122 = { FOLLOW_section_model_of_interaction_in_def_body_statemachine5122_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_def_body_statemachine5134 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_def_body_statemachine5134_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_def_body_statemachine5134 = { FOLLOW_RCURLY_in_def_body_statemachine5134_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_217_in_section_region5152 */
+static ANTLR3_BITWORD FOLLOW_217_in_section_region5152_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x00000000027B0000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0404000000010000), ANTLR3_UINT64_LIT(0x0C00000200000004), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_217_in_section_region5152 = { FOLLOW_217_in_section_region5152_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_any_def_statemachine_in_section_region5167 */
+static ANTLR3_BITWORD FOLLOW_any_def_statemachine_in_section_region5167_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x00000000027B0000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0404000000010000), ANTLR3_UINT64_LIT(0x0C00000200000004), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_any_def_statemachine_in_section_region5167 = { FOLLOW_any_def_statemachine_in_section_region5167_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_227_in_section_statemachine5188 */
+static ANTLR3_BITWORD FOLLOW_227_in_section_statemachine5188_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x00000000027B0000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0404000000010000), ANTLR3_UINT64_LIT(0x0C00000200000004), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_227_in_section_statemachine5188 = { FOLLOW_227_in_section_statemachine5188_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_any_def_statemachine_in_section_statemachine5203 */
+static ANTLR3_BITWORD FOLLOW_any_def_statemachine_in_section_statemachine5203_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x00000000027B0000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0404000000010000), ANTLR3_UINT64_LIT(0x0C00000200000004), ANTLR3_UINT64_LIT(0x0000000000400200) };
+static ANTLR3_BITSET_LIST FOLLOW_any_def_statemachine_in_section_statemachine5203 = { FOLLOW_any_def_statemachine_in_section_statemachine5203_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_378_in_def_state5235 */
+static ANTLR3_BITWORD FOLLOW_378_in_def_state5235_bits[] = { ANTLR3_UINT64_LIT(0x5004000080000000), ANTLR3_UINT64_LIT(0x0000000000002001), ANTLR3_UINT64_LIT(0x00000000027F2080) };
+static ANTLR3_BITSET_LIST FOLLOW_378_in_def_state5235 = { FOLLOW_378_in_def_state5235_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_def_state5242 */
+static ANTLR3_BITWORD FOLLOW_LT__in_def_state5242_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000001800000), ANTLR3_UINT64_LIT(0x0000800000000000), ANTLR3_UINT64_LIT(0x0100000054000002), ANTLR3_UINT64_LIT(0x0200100000004002) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_def_state5242 = { FOLLOW_LT__in_def_state5242_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_321_in_def_state5246 */
+static ANTLR3_BITWORD FOLLOW_321_in_def_state5246_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000001800000), ANTLR3_UINT64_LIT(0x0000800000000000), ANTLR3_UINT64_LIT(0x0100000054000002), ANTLR3_UINT64_LIT(0x0200100000004000) };
+static ANTLR3_BITSET_LIST FOLLOW_321_in_def_state5246 = { FOLLOW_321_in_def_state5246_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_executable_specifier_in_def_state5252 */
+static ANTLR3_BITWORD FOLLOW_executable_specifier_in_def_state5252_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_executable_specifier_in_def_state5252 = { FOLLOW_executable_specifier_in_def_state5252_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_def_state5256 */
+static ANTLR3_BITWORD FOLLOW_GT_in_def_state5256_bits[] = { ANTLR3_UINT64_LIT(0x5004000080000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x00000000027F2080) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_def_state5256 = { FOLLOW_GT_in_def_state5256_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_state_id_in_def_state5278 */
+static ANTLR3_BITWORD FOLLOW_state_id_in_def_state5278_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000002080) };
+static ANTLR3_BITSET_LIST FOLLOW_state_id_in_def_state5278 = { FOLLOW_state_id_in_def_state5278_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LBRACKET_in_def_state5295 */
+static ANTLR3_BITWORD FOLLOW_LBRACKET_in_def_state5295_bits[] = { ANTLR3_UINT64_LIT(0x0004000080000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x00000000027F0200) };
+static ANTLR3_BITSET_LIST FOLLOW_LBRACKET_in_def_state5295 = { FOLLOW_LBRACKET_in_def_state5295_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LBRACKET_EXCEPT_in_def_state5314 */
+static ANTLR3_BITWORD FOLLOW_LBRACKET_EXCEPT_in_def_state5314_bits[] = { ANTLR3_UINT64_LIT(0x0004000080000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x00000000027F0200) };
+static ANTLR3_BITSET_LIST FOLLOW_LBRACKET_EXCEPT_in_def_state5314 = { FOLLOW_LBRACKET_EXCEPT_in_def_state5314_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_state_id_in_def_state5340 */
+static ANTLR3_BITWORD FOLLOW_state_id_in_def_state5340_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_state_id_in_def_state5340 = { FOLLOW_state_id_in_def_state5340_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_def_state5362 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_def_state5362_bits[] = { ANTLR3_UINT64_LIT(0x0004000080000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x00000000027F0000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_def_state5362 = { FOLLOW_COMMA_in_def_state5362_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_state_id_in_def_state5366 */
+static ANTLR3_BITWORD FOLLOW_state_id_in_def_state5366_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_state_id_in_def_state5366 = { FOLLOW_state_id_in_def_state5366_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STAR_in_def_state5382 */
+static ANTLR3_BITWORD FOLLOW_STAR_in_def_state5382_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_STAR_in_def_state5382 = { FOLLOW_STAR_in_def_state5382_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RBRACKET_in_def_state5403 */
+static ANTLR3_BITWORD FOLLOW_RBRACKET_in_def_state5403_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000002080) };
+static ANTLR3_BITSET_LIST FOLLOW_RBRACKET_in_def_state5403 = { FOLLOW_RBRACKET_in_def_state5403_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_StringLiteral_in_def_state5427 */
+static ANTLR3_BITWORD FOLLOW_StringLiteral_in_def_state5427_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_StringLiteral_in_def_state5427 = { FOLLOW_StringLiteral_in_def_state5427_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_body_state_in_def_state5446 */
+static ANTLR3_BITWORD FOLLOW_def_body_state_in_def_state5446_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_body_state_in_def_state5446 = { FOLLOW_def_body_state_in_def_state5446_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_def_state5451 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_def_state5451_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_def_state5451 = { FOLLOW_SEMI_in_def_state5451_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_146_in_state_kw_id5469 */
+static ANTLR3_BITWORD FOLLOW_146_in_state_kw_id5469_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_146_in_state_kw_id5469 = { FOLLOW_146_in_state_kw_id5469_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_147_in_state_kw_id5481 */
+static ANTLR3_BITWORD FOLLOW_147_in_state_kw_id5481_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_147_in_state_kw_id5481 = { FOLLOW_147_in_state_kw_id5481_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_150_in_state_kw_id5490 */
+static ANTLR3_BITWORD FOLLOW_150_in_state_kw_id5490_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_150_in_state_kw_id5490 = { FOLLOW_150_in_state_kw_id5490_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_144_in_state_kw_id5502 */
+static ANTLR3_BITWORD FOLLOW_144_in_state_kw_id5502_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_144_in_state_kw_id5502 = { FOLLOW_144_in_state_kw_id5502_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_149_in_state_kw_id5510 */
+static ANTLR3_BITWORD FOLLOW_149_in_state_kw_id5510_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_149_in_state_kw_id5510 = { FOLLOW_149_in_state_kw_id5510_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_145_in_state_kw_id5519 */
+static ANTLR3_BITWORD FOLLOW_145_in_state_kw_id5519_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_145_in_state_kw_id5519 = { FOLLOW_145_in_state_kw_id5519_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_153_in_state_kw_id5528 */
+static ANTLR3_BITWORD FOLLOW_153_in_state_kw_id5528_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_153_in_state_kw_id5528 = { FOLLOW_153_in_state_kw_id5528_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_148_in_state_kw_id5537 */
+static ANTLR3_BITWORD FOLLOW_148_in_state_kw_id5537_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_148_in_state_kw_id5537 = { FOLLOW_148_in_state_kw_id5537_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_state_kw_id_in_state_id5557 */
+static ANTLR3_BITWORD FOLLOW_state_kw_id_in_state_id5557_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_state_kw_id_in_state_id5557 = { FOLLOW_state_kw_id_in_state_id5557_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_state_id5567 */
+static ANTLR3_BITWORD FOLLOW_ID_in_state_id5567_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_state_id5567 = { FOLLOW_ID_in_state_id5567_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DOLLAR_in_state_id5584 */
+static ANTLR3_BITWORD FOLLOW_DOLLAR_in_state_id5584_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_DOLLAR_in_state_id5584 = { FOLLOW_DOLLAR_in_state_id5584_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_state_id5588 */
+static ANTLR3_BITWORD FOLLOW_ID_in_state_id5588_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_state_id5588 = { FOLLOW_ID_in_state_id5588_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_147_in_def_state_singleton5624 */
+static ANTLR3_BITWORD FOLLOW_147_in_def_state_singleton5624_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_147_in_def_state_singleton5624 = { FOLLOW_147_in_def_state_singleton5624_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_150_in_def_state_singleton5637 */
+static ANTLR3_BITWORD FOLLOW_150_in_def_state_singleton5637_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_150_in_def_state_singleton5637 = { FOLLOW_150_in_def_state_singleton5637_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_144_in_def_state_singleton5650 */
+static ANTLR3_BITWORD FOLLOW_144_in_def_state_singleton5650_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_144_in_def_state_singleton5650 = { FOLLOW_144_in_def_state_singleton5650_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_149_in_def_state_singleton5663 */
+static ANTLR3_BITWORD FOLLOW_149_in_def_state_singleton5663_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_149_in_def_state_singleton5663 = { FOLLOW_149_in_def_state_singleton5663_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_def_state_singleton5678 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_def_state_singleton5678_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000100), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0xE14A0600027B0000), ANTLR3_UINT64_LIT(0x0008000180000084), ANTLR3_UINT64_LIT(0x4406040004010048), ANTLR3_UINT64_LIT(0x1C00120A20200004), ANTLR3_UINT64_LIT(0x000000004C401A00) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_def_state_singleton5678 = { FOLLOW_LCURLY_in_def_state_singleton5678_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_body_state_simplif_in_def_state_singleton5681 */
+static ANTLR3_BITWORD FOLLOW_def_body_state_simplif_in_def_state_singleton5681_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_body_state_simplif_in_def_state_singleton5681 = { FOLLOW_def_body_state_simplif_in_def_state_singleton5681_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_def_state_singleton5685 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_def_state_singleton5685_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_def_state_singleton5685 = { FOLLOW_RCURLY_in_def_state_singleton5685_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_145_in_def_state_singleton5691 */
+static ANTLR3_BITWORD FOLLOW_145_in_def_state_singleton5691_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_145_in_def_state_singleton5691 = { FOLLOW_145_in_def_state_singleton5691_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_def_state_singleton5695 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_def_state_singleton5695_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_def_state_singleton5695 = { FOLLOW_block_statement_in_def_state_singleton5695_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_153_in_def_state_singleton5704 */
+static ANTLR3_BITWORD FOLLOW_153_in_def_state_singleton5704_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_153_in_def_state_singleton5704 = { FOLLOW_153_in_def_state_singleton5704_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_def_state_singleton5708 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_def_state_singleton5708_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_def_state_singleton5708 = { FOLLOW_block_statement_in_def_state_singleton5708_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_148_in_def_state_singleton5717 */
+static ANTLR3_BITWORD FOLLOW_148_in_def_state_singleton5717_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_148_in_def_state_singleton5717 = { FOLLOW_148_in_def_state_singleton5717_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_def_state_singleton5721 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_def_state_singleton5721_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_def_state_singleton5721 = { FOLLOW_block_statement_in_def_state_singleton5721_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_executable_specifier_atom_in_executable_specifier5740 */
+static ANTLR3_BITWORD FOLLOW_executable_specifier_atom_in_executable_specifier5740_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000202) };
+static ANTLR3_BITSET_LIST FOLLOW_executable_specifier_atom_in_executable_specifier5740 = { FOLLOW_executable_specifier_atom_in_executable_specifier5740_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BAND_in_executable_specifier5748 */
+static ANTLR3_BITWORD FOLLOW_BAND_in_executable_specifier5748_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000001800000), ANTLR3_UINT64_LIT(0x0000800000000000), ANTLR3_UINT64_LIT(0x0100000054000002), ANTLR3_UINT64_LIT(0x0200100000004000) };
+static ANTLR3_BITSET_LIST FOLLOW_BAND_in_executable_specifier5748 = { FOLLOW_BAND_in_executable_specifier5748_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_executable_specifier_atom_in_executable_specifier5752 */
+static ANTLR3_BITWORD FOLLOW_executable_specifier_atom_in_executable_specifier5752_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000202) };
+static ANTLR3_BITSET_LIST FOLLOW_executable_specifier_atom_in_executable_specifier5752 = { FOLLOW_executable_specifier_atom_in_executable_specifier5752_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_executable_specifier_atom5772 */
+static ANTLR3_BITWORD FOLLOW_ID_in_executable_specifier_atom5772_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_executable_specifier_atom5772 = { FOLLOW_ID_in_executable_specifier_atom5772_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_377_in_executable_specifier_atom5782 */
+static ANTLR3_BITWORD FOLLOW_377_in_executable_specifier_atom5782_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_377_in_executable_specifier_atom5782 = { FOLLOW_377_in_executable_specifier_atom5782_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_282_in_executable_specifier_atom5794 */
+static ANTLR3_BITWORD FOLLOW_282_in_executable_specifier_atom5794_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_282_in_executable_specifier_atom5794 = { FOLLOW_282_in_executable_specifier_atom5794_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_364_in_executable_specifier_atom5810 */
+static ANTLR3_BITWORD FOLLOW_364_in_executable_specifier_atom5810_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_364_in_executable_specifier_atom5810 = { FOLLOW_364_in_executable_specifier_atom5810_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_257_in_executable_specifier_atom5823 */
+static ANTLR3_BITWORD FOLLOW_257_in_executable_specifier_atom5823_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_257_in_executable_specifier_atom5823 = { FOLLOW_257_in_executable_specifier_atom5823_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_286_in_executable_specifier_atom5835 */
+static ANTLR3_BITWORD FOLLOW_286_in_executable_specifier_atom5835_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_286_in_executable_specifier_atom5835 = { FOLLOW_286_in_executable_specifier_atom5835_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_312_in_executable_specifier_atom5848 */
+static ANTLR3_BITWORD FOLLOW_312_in_executable_specifier_atom5848_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_312_in_executable_specifier_atom5848 = { FOLLOW_312_in_executable_specifier_atom5848_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_239_in_executable_specifier_atom5865 */
+static ANTLR3_BITWORD FOLLOW_239_in_executable_specifier_atom5865_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_239_in_executable_specifier_atom5865 = { FOLLOW_239_in_executable_specifier_atom5865_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_334_in_executable_specifier_atom5879 */
+static ANTLR3_BITWORD FOLLOW_334_in_executable_specifier_atom5879_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_334_in_executable_specifier_atom5879 = { FOLLOW_334_in_executable_specifier_atom5879_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_152_in_executable_specifier_atom5894 */
+static ANTLR3_BITWORD FOLLOW_152_in_executable_specifier_atom5894_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_152_in_executable_specifier_atom5894 = { FOLLOW_152_in_executable_specifier_atom5894_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_151_in_executable_specifier_atom5907 */
+static ANTLR3_BITWORD FOLLOW_151_in_executable_specifier_atom5907_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_151_in_executable_specifier_atom5907 = { FOLLOW_151_in_executable_specifier_atom5907_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_284_in_executable_specifier_atom5920 */
+static ANTLR3_BITWORD FOLLOW_284_in_executable_specifier_atom5920_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_284_in_executable_specifier_atom5920 = { FOLLOW_284_in_executable_specifier_atom5920_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_instance_machine_model5947 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_instance_machine_model5947_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_instance_machine_model5947 = { FOLLOW_qualifiedNameID_in_instance_machine_model5947_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_def_body_state5964 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_def_body_state5964_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000100), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0xE1CE5600027B0000), ANTLR3_UINT64_LIT(0x00080081C3F81FE4), ANTLR3_UINT64_LIT(0x4406040004010048), ANTLR3_UINT64_LIT(0x1C00120A20200004), ANTLR3_UINT64_LIT(0x000000004C401A00) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_def_body_state5964 = { FOLLOW_LCURLY_in_def_body_state5964_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_body_state_section_in_def_body_state5984 */
+static ANTLR3_BITWORD FOLLOW_def_body_state_section_in_def_body_state5984_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_body_state_section_in_def_body_state5984 = { FOLLOW_def_body_state_section_in_def_body_state5984_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_body_state_simplif_in_def_body_state5993 */
+static ANTLR3_BITWORD FOLLOW_def_body_state_simplif_in_def_body_state5993_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_body_state_simplif_in_def_body_state5993 = { FOLLOW_def_body_state_simplif_in_def_body_state5993_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_def_body_state6004 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_def_body_state6004_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_def_body_state6004 = { FOLLOW_RCURLY_in_def_body_state6004_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_property_in_def_body_state_section6019 */
+static ANTLR3_BITWORD FOLLOW_section_property_in_def_body_state_section6019_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0084500000000000), ANTLR3_UINT64_LIT(0x0000008043F81F60) };
+static ANTLR3_BITSET_LIST FOLLOW_section_property_in_def_body_state_section6019 = { FOLLOW_section_property_in_def_body_state_section6019_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_composite_structure_in_def_body_state_section6031 */
+static ANTLR3_BITWORD FOLLOW_section_composite_structure_in_def_body_state_section6031_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0080500000000000), ANTLR3_UINT64_LIT(0x0000008042901F60) };
+static ANTLR3_BITSET_LIST FOLLOW_section_composite_structure_in_def_body_state_section6031 = { FOLLOW_section_composite_structure_in_def_body_state_section6031_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_region_in_def_body_state_section6041 */
+static ANTLR3_BITWORD FOLLOW_section_region_in_def_body_state_section6041_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000008000001440) };
+static ANTLR3_BITSET_LIST FOLLOW_section_region_in_def_body_state_section6041 = { FOLLOW_section_region_in_def_body_state_section6041_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_transition_in_def_body_state_section6050 */
+static ANTLR3_BITWORD FOLLOW_section_transition_in_def_body_state_section6050_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000000001440) };
+static ANTLR3_BITSET_LIST FOLLOW_section_transition_in_def_body_state_section6050 = { FOLLOW_section_transition_in_def_body_state_section6050_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_model_of_computation_in_def_body_state_section6061 */
+static ANTLR3_BITWORD FOLLOW_section_model_of_computation_in_def_body_state_section6061_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000000001440) };
+static ANTLR3_BITSET_LIST FOLLOW_section_model_of_computation_in_def_body_state_section6061 = { FOLLOW_section_model_of_computation_in_def_body_state_section6061_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_model_of_execution_in_def_body_state_section6069 */
+static ANTLR3_BITWORD FOLLOW_section_model_of_execution_in_def_body_state_section6069_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000000001440) };
+static ANTLR3_BITSET_LIST FOLLOW_section_model_of_execution_in_def_body_state_section6069 = { FOLLOW_section_model_of_execution_in_def_body_state_section6069_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_model_of_interaction_in_def_body_state_section6077 */
+static ANTLR3_BITWORD FOLLOW_section_model_of_interaction_in_def_body_state_section6077_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000000001440) };
+static ANTLR3_BITSET_LIST FOLLOW_section_model_of_interaction_in_def_body_state_section6077 = { FOLLOW_section_model_of_interaction_in_def_body_state_section6077_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_modifier_declaration_in_def_body_state_simplif6112 */
+static ANTLR3_BITWORD FOLLOW_modifier_declaration_in_def_body_state_simplif6112_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000100), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xE14A0600027B0000), ANTLR3_UINT64_LIT(0x0000000180000084), ANTLR3_UINT64_LIT(0x4404000000010048), ANTLR3_UINT64_LIT(0x0C00000200000004), ANTLR3_UINT64_LIT(0x000000000C401200) };
+static ANTLR3_BITSET_LIST FOLLOW_modifier_declaration_in_def_body_state_simplif6112 = { FOLLOW_modifier_declaration_in_def_body_state_simplif6112_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_variable_in_def_body_state_simplif6128 */
+static ANTLR3_BITWORD FOLLOW_decl_variable_in_def_body_state_simplif6128_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000102), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xE14A0600027B0000), ANTLR3_UINT64_LIT(0x0008000180000084), ANTLR3_UINT64_LIT(0x4406040004010048), ANTLR3_UINT64_LIT(0x1C00120A20200004), ANTLR3_UINT64_LIT(0x000000004C401A00) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_variable_in_def_body_state_simplif6128 = { FOLLOW_decl_variable_in_def_body_state_simplif6128_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_any_def_statemachine_in_def_body_state_simplif6141 */
+static ANTLR3_BITWORD FOLLOW_any_def_statemachine_in_def_body_state_simplif6141_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000102), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xE14A0600027B0000), ANTLR3_UINT64_LIT(0x0008000180000084), ANTLR3_UINT64_LIT(0x4406040004010048), ANTLR3_UINT64_LIT(0x1C00120A20200004), ANTLR3_UINT64_LIT(0x000000004C401A00) };
+static ANTLR3_BITSET_LIST FOLLOW_any_def_statemachine_in_def_body_state_simplif6141 = { FOLLOW_any_def_statemachine_in_def_body_state_simplif6141_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_transition_in_def_body_state_simplif6152 */
+static ANTLR3_BITWORD FOLLOW_def_transition_in_def_body_state_simplif6152_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000102), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xE14A0600027B0000), ANTLR3_UINT64_LIT(0x0008000180000084), ANTLR3_UINT64_LIT(0x4406040004010048), ANTLR3_UINT64_LIT(0x1C00120A20200004), ANTLR3_UINT64_LIT(0x000000004C401A00) };
+static ANTLR3_BITSET_LIST FOLLOW_def_transition_in_def_body_state_simplif6152 = { FOLLOW_def_transition_in_def_body_state_simplif6152_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_state_activity_in_def_body_state_simplif6163 */
+static ANTLR3_BITWORD FOLLOW_def_state_activity_in_def_body_state_simplif6163_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000102), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xE14A0600027B0000), ANTLR3_UINT64_LIT(0x0008000180000084), ANTLR3_UINT64_LIT(0x4406040004010048), ANTLR3_UINT64_LIT(0x1C00120A20200004), ANTLR3_UINT64_LIT(0x000000004C401A00) };
+static ANTLR3_BITSET_LIST FOLLOW_def_state_activity_in_def_body_state_simplif6163 = { FOLLOW_def_state_activity_in_def_body_state_simplif6163_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_231_in_section_transition6194 */
+static ANTLR3_BITWORD FOLLOW_231_in_section_transition6194_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000102), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000020000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000001A00) };
+static ANTLR3_BITSET_LIST FOLLOW_231_in_section_transition6194 = { FOLLOW_231_in_section_transition6194_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_modifier_transition_in_section_transition6205 */
+static ANTLR3_BITWORD FOLLOW_modifier_transition_in_section_transition6205_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000100), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000020000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000001000) };
+static ANTLR3_BITSET_LIST FOLLOW_modifier_transition_in_section_transition6205 = { FOLLOW_modifier_transition_in_section_transition6205_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_transition_in_section_transition6218 */
+static ANTLR3_BITWORD FOLLOW_def_transition_in_section_transition6218_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000102), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000020000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000001A00) };
+static ANTLR3_BITSET_LIST FOLLOW_def_transition_in_section_transition6218 = { FOLLOW_def_transition_in_section_transition6218_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_169_in_def_transition6251 */
+static ANTLR3_BITWORD FOLLOW_169_in_def_transition6251_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000002001), ANTLR3_UINT64_LIT(0x0000000800000000) };
+static ANTLR3_BITSET_LIST FOLLOW_169_in_def_transition6251 = { FOLLOW_169_in_def_transition6251_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_AT_ID_in_def_transition6262 */
+static ANTLR3_BITWORD FOLLOW_AT_ID_in_def_transition6262_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000002001), ANTLR3_UINT64_LIT(0x0000000800000000) };
+static ANTLR3_BITSET_LIST FOLLOW_AT_ID_in_def_transition6262 = { FOLLOW_AT_ID_in_def_transition6262_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_def_transition6284 */
+static ANTLR3_BITWORD FOLLOW_LT__in_def_transition6284_bits[] = { ANTLR3_UINT64_LIT(0x0084080000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000014020000), ANTLR3_UINT64_LIT(0x0000000050000002) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_def_transition6284 = { FOLLOW_LT__in_def_transition6284_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_moc_transition_in_def_transition6287 */
+static ANTLR3_BITWORD FOLLOW_moc_transition_in_def_transition6287_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_moc_transition_in_def_transition6287 = { FOLLOW_moc_transition_in_def_transition6287_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_def_transition6291 */
+static ANTLR3_BITWORD FOLLOW_GT_in_def_transition6291_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000800000000) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_def_transition6291 = { FOLLOW_GT_in_def_transition6291_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_moe_transition_in_def_transition6300 */
+static ANTLR3_BITWORD FOLLOW_moe_transition_in_def_transition6300_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_moe_transition_in_def_transition6300 = { FOLLOW_moe_transition_in_def_transition6300_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_396_in_def_transition6307 */
+static ANTLR3_BITWORD FOLLOW_396_in_def_transition6307_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000002001), ANTLR3_UINT64_LIT(0x0000000800002000) };
+static ANTLR3_BITSET_LIST FOLLOW_396_in_def_transition6307 = { FOLLOW_396_in_def_transition6307_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_def_transition6319 */
+static ANTLR3_BITWORD FOLLOW_LT__in_def_transition6319_bits[] = { ANTLR3_UINT64_LIT(0x0084080000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000014020000), ANTLR3_UINT64_LIT(0x0000000050000002) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_def_transition6319 = { FOLLOW_LT__in_def_transition6319_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_moc_transition_in_def_transition6321 */
+static ANTLR3_BITWORD FOLLOW_moc_transition_in_def_transition6321_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_moc_transition_in_def_transition6321 = { FOLLOW_moc_transition_in_def_transition6321_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_def_transition6324 */
+static ANTLR3_BITWORD FOLLOW_GT_in_def_transition6324_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000800002000) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_def_transition6324 = { FOLLOW_GT_in_def_transition6324_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_def_transition6337 */
+static ANTLR3_BITWORD FOLLOW_ID_in_def_transition6337_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000800002000) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_def_transition6337 = { FOLLOW_ID_in_def_transition6337_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_StringLiteral_in_def_transition6355 */
+static ANTLR3_BITWORD FOLLOW_StringLiteral_in_def_transition6355_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000800000000) };
+static ANTLR3_BITSET_LIST FOLLOW_StringLiteral_in_def_transition6355 = { FOLLOW_StringLiteral_in_def_transition6355_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_moe_transition_in_def_transition6372 */
+static ANTLR3_BITWORD FOLLOW_moe_transition_in_def_transition6372_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_moe_transition_in_def_transition6372 = { FOLLOW_moe_transition_in_def_transition6372_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_kind_transition6390 */
+static ANTLR3_BITWORD FOLLOW_ID_in_kind_transition6390_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_kind_transition6390 = { FOLLOW_ID_in_kind_transition6390_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_236_in_kind_transition6399 */
+static ANTLR3_BITWORD FOLLOW_236_in_kind_transition6399_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_236_in_kind_transition6399 = { FOLLOW_236_in_kind_transition6399_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_282_in_kind_transition6409 */
+static ANTLR3_BITWORD FOLLOW_282_in_kind_transition6409_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_282_in_kind_transition6409 = { FOLLOW_282_in_kind_transition6409_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_273_in_kind_transition6419 */
+static ANTLR3_BITWORD FOLLOW_273_in_kind_transition6419_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_273_in_kind_transition6419 = { FOLLOW_273_in_kind_transition6419_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_284_in_kind_transition6432 */
+static ANTLR3_BITWORD FOLLOW_284_in_kind_transition6432_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_284_in_kind_transition6432 = { FOLLOW_284_in_kind_transition6432_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_kind_transition_in_moc_transition_attribute6460 */
+static ANTLR3_BITWORD FOLLOW_kind_transition_in_moc_transition_attribute6460_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000202) };
+static ANTLR3_BITSET_LIST FOLLOW_kind_transition_in_moc_transition_attribute6460 = { FOLLOW_kind_transition_in_moc_transition_attribute6460_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BAND_in_moc_transition_attribute6467 */
+static ANTLR3_BITWORD FOLLOW_BAND_in_moc_transition_attribute6467_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000020000) };
+static ANTLR3_BITSET_LIST FOLLOW_BAND_in_moc_transition_attribute6467 = { FOLLOW_BAND_in_moc_transition_attribute6467_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_273_in_moc_transition_attribute6469 */
+static ANTLR3_BITWORD FOLLOW_273_in_moc_transition_attribute6469_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_273_in_moc_transition_attribute6469 = { FOLLOW_273_in_moc_transition_attribute6469_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_moc_transition_atom_in_moc_transition6494 */
+static ANTLR3_BITWORD FOLLOW_moc_transition_atom_in_moc_transition6494_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800002) };
+static ANTLR3_BITSET_LIST FOLLOW_moc_transition_atom_in_moc_transition6494 = { FOLLOW_moc_transition_atom_in_moc_transition6494_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_moc_transition6499 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_moc_transition6499_bits[] = { ANTLR3_UINT64_LIT(0x0084080000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000014020000), ANTLR3_UINT64_LIT(0x0000000050000002) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_moc_transition6499 = { FOLLOW_COMMA_in_moc_transition6499_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_moc_transition_atom_in_moc_transition6501 */
+static ANTLR3_BITWORD FOLLOW_moc_transition_atom_in_moc_transition6501_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800002) };
+static ANTLR3_BITSET_LIST FOLLOW_moc_transition_atom_in_moc_transition6501 = { FOLLOW_moc_transition_atom_in_moc_transition6501_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_321_in_moc_transition_atom6520 */
+static ANTLR3_BITWORD FOLLOW_321_in_moc_transition_atom6520_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000014020000) };
+static ANTLR3_BITSET_LIST FOLLOW_321_in_moc_transition_atom6520 = { FOLLOW_321_in_moc_transition_atom6520_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_moc_transition_attribute_in_moc_transition_atom6527 */
+static ANTLR3_BITWORD FOLLOW_moc_transition_attribute_in_moc_transition_atom6527_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_moc_transition_attribute_in_moc_transition_atom6527 = { FOLLOW_moc_transition_attribute_in_moc_transition_atom6527_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_348_in_moc_transition_atom6538 */
+static ANTLR3_BITWORD FOLLOW_348_in_moc_transition_atom6538_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_348_in_moc_transition_atom6538 = { FOLLOW_348_in_moc_transition_atom6538_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_integer_constant_in_moc_transition_atom6545 */
+static ANTLR3_BITWORD FOLLOW_integer_constant_in_moc_transition_atom6545_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_integer_constant_in_moc_transition_atom6545 = { FOLLOW_integer_constant_in_moc_transition_atom6545_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_350_in_moc_transition_atom6556 */
+static ANTLR3_BITWORD FOLLOW_350_in_moc_transition_atom6556_bits[] = { ANTLR3_UINT64_LIT(0x0004080000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_350_in_moc_transition_atom6556 = { FOLLOW_350_in_moc_transition_atom6556_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_float_constant_in_moc_transition_atom6563 */
+static ANTLR3_BITWORD FOLLOW_float_constant_in_moc_transition_atom6563_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_float_constant_in_moc_transition_atom6563 = { FOLLOW_float_constant_in_moc_transition_atom6563_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_transition_statement_in_moe_transition6582 */
+static ANTLR3_BITWORD FOLLOW_transition_statement_in_moe_transition6582_bits[] = { ANTLR3_UINT64_LIT(0x0004000080000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x00000008027F0000) };
+static ANTLR3_BITSET_LIST FOLLOW_transition_statement_in_moe_transition6582 = { FOLLOW_transition_statement_in_moe_transition6582_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_163_in_moe_transition6600 */
+static ANTLR3_BITWORD FOLLOW_163_in_moe_transition6600_bits[] = { ANTLR3_UINT64_LIT(0x0004000080000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x00000000027F0000) };
+static ANTLR3_BITSET_LIST FOLLOW_163_in_moe_transition6600 = { FOLLOW_163_in_moe_transition6600_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_target_state_id_in_moe_transition6612 */
+static ANTLR3_BITWORD FOLLOW_target_state_id_in_moe_transition6612_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_target_state_id_in_moe_transition6612 = { FOLLOW_target_state_id_in_moe_transition6612_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_moe_transition6629 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_moe_transition6629_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_moe_transition6629 = { FOLLOW_SEMI_in_moe_transition6629_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_163_in_moe_transition6638 */
+static ANTLR3_BITWORD FOLLOW_163_in_moe_transition6638_bits[] = { ANTLR3_UINT64_LIT(0x0004000080000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x00000000027F0000) };
+static ANTLR3_BITSET_LIST FOLLOW_163_in_moe_transition6638 = { FOLLOW_163_in_moe_transition6638_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_target_state_id_in_moe_transition6642 */
+static ANTLR3_BITWORD FOLLOW_target_state_id_in_moe_transition6642_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_target_state_id_in_moe_transition6642 = { FOLLOW_target_state_id_in_moe_transition6642_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_transition_statement_in_moe_transition6659 */
+static ANTLR3_BITWORD FOLLOW_transition_statement_in_moe_transition6659_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_transition_statement_in_moe_transition6659 = { FOLLOW_transition_statement_in_moe_transition6659_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_moe_transition6673 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_moe_transition6673_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_moe_transition6673 = { FOLLOW_SEMI_in_moe_transition6673_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_transition_statement6701 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_transition_statement6701_bits[] = { ANTLR3_UINT64_LIT(0x000C000104400000), ANTLR3_UINT64_LIT(0x2003FCFFFC000101), ANTLR3_UINT64_LIT(0x082000003C001000), ANTLR3_UINT64_LIT(0x0480114000000000), ANTLR3_UINT64_LIT(0x0103F97E24C83881), ANTLR3_UINT64_LIT(0x020B1C00003F0400), ANTLR3_UINT64_LIT(0x00000001800000A6) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_transition_statement6701 = { FOLLOW_LCURLY_in_transition_statement6701_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_op_block_in_transition_statement6708 */
+static ANTLR3_BITWORD FOLLOW_op_block_in_transition_statement6708_bits[] = { ANTLR3_UINT64_LIT(0x000C000104400000), ANTLR3_UINT64_LIT(0x2000000000000101), ANTLR3_UINT64_LIT(0x082000003C001000), ANTLR3_UINT64_LIT(0x0480114000000000), ANTLR3_UINT64_LIT(0x0103F97E24C83881), ANTLR3_UINT64_LIT(0x020B1C00003F0400), ANTLR3_UINT64_LIT(0x00000001800000A6) };
+static ANTLR3_BITSET_LIST FOLLOW_op_block_in_transition_statement6708 = { FOLLOW_op_block_in_transition_statement6708_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_in_transition_statement6728 */
+static ANTLR3_BITWORD FOLLOW_statement_in_transition_statement6728_bits[] = { ANTLR3_UINT64_LIT(0x000C000104400000), ANTLR3_UINT64_LIT(0x2000000000000101), ANTLR3_UINT64_LIT(0x082000003C001000), ANTLR3_UINT64_LIT(0x0480114000000000), ANTLR3_UINT64_LIT(0x0103F97E24C83881), ANTLR3_UINT64_LIT(0x020B1C00003F0400), ANTLR3_UINT64_LIT(0x00000001800000A6) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_in_transition_statement6728 = { FOLLOW_statement_in_transition_statement6728_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_transition_trigger_in_transition_statement6741 */
+static ANTLR3_BITWORD FOLLOW_transition_trigger_in_transition_statement6741_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0820000000000000), ANTLR3_UINT64_LIT(0x0000004000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_transition_trigger_in_transition_statement6741 = { FOLLOW_transition_trigger_in_transition_statement6741_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_transition_guard_in_transition_statement6751 */
+static ANTLR3_BITWORD FOLLOW_transition_guard_in_transition_statement6751_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0020000000000000), ANTLR3_UINT64_LIT(0x0000004000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_transition_guard_in_transition_statement6751 = { FOLLOW_transition_guard_in_transition_statement6751_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_transition_timed_guard_in_transition_statement6761 */
+static ANTLR3_BITWORD FOLLOW_transition_timed_guard_in_transition_statement6761_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0020000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_transition_timed_guard_in_transition_statement6761 = { FOLLOW_transition_timed_guard_in_transition_statement6761_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_transition_effect_in_transition_statement6771 */
+static ANTLR3_BITWORD FOLLOW_transition_effect_in_transition_statement6771_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_transition_effect_in_transition_statement6771 = { FOLLOW_transition_effect_in_transition_statement6771_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_transition_statement6780 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_transition_statement6780_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_transition_statement6780 = { FOLLOW_RCURLY_in_transition_statement6780_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_232_in_transition_trigger6793 */
+static ANTLR3_BITWORD FOLLOW_232_in_transition_trigger6793_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0003F80000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_232_in_transition_trigger6793 = { FOLLOW_232_in_transition_trigger6793_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_com_input_in_transition_trigger6799 */
+static ANTLR3_BITWORD FOLLOW_statement_com_input_in_transition_trigger6799_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0003F80000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_com_input_in_transition_trigger6799 = { FOLLOW_statement_com_input_in_transition_trigger6799_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_187_in_transition_guard6819 */
+static ANTLR3_BITWORD FOLLOW_187_in_transition_guard6819_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402002), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004401600201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_187_in_transition_guard6819 = { FOLLOW_187_in_transition_guard6819_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_guard_in_transition_guard6827 */
+static ANTLR3_BITWORD FOLLOW_statement_guard_in_transition_guard6827_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402002), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004401600201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_guard_in_transition_guard6827 = { FOLLOW_statement_guard_in_transition_guard6827_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_transition_guard6840 */
+static ANTLR3_BITWORD FOLLOW_expression_in_transition_guard6840_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402002), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004401600201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_transition_guard6840 = { FOLLOW_expression_in_transition_guard6840_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LBRACKET_in_transition_guard6851 */
+static ANTLR3_BITWORD FOLLOW_LBRACKET_in_transition_guard6851_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LBRACKET_in_transition_guard6851 = { FOLLOW_LBRACKET_in_transition_guard6851_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_transition_guard6855 */
+static ANTLR3_BITWORD FOLLOW_expression_in_transition_guard6855_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_transition_guard6855 = { FOLLOW_expression_in_transition_guard6855_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RBRACKET_in_transition_guard6857 */
+static ANTLR3_BITWORD FOLLOW_RBRACKET_in_transition_guard6857_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402002), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004401600201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_RBRACKET_in_transition_guard6857 = { FOLLOW_RBRACKET_in_transition_guard6857_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_230_in_transition_timed_guard6879 */
+static ANTLR3_BITWORD FOLLOW_230_in_transition_timed_guard6879_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402002), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002080) };
+static ANTLR3_BITSET_LIST FOLLOW_230_in_transition_timed_guard6879 = { FOLLOW_230_in_transition_timed_guard6879_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_timed_guard_in_transition_timed_guard6887 */
+static ANTLR3_BITWORD FOLLOW_statement_timed_guard_in_transition_timed_guard6887_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402002), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002080) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_timed_guard_in_transition_timed_guard6887 = { FOLLOW_statement_timed_guard_in_transition_timed_guard6887_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_transition_timed_guard6900 */
+static ANTLR3_BITWORD FOLLOW_expression_in_transition_timed_guard6900_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402002), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_transition_timed_guard6900 = { FOLLOW_expression_in_transition_timed_guard6900_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_transition_timed_guard6911 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_transition_timed_guard6911_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_transition_timed_guard6911 = { FOLLOW_LCURLY_in_transition_timed_guard6911_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_transition_timed_guard6915 */
+static ANTLR3_BITWORD FOLLOW_expression_in_transition_timed_guard6915_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_transition_timed_guard6915 = { FOLLOW_expression_in_transition_timed_guard6915_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_transition_timed_guard6917 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_transition_timed_guard6917_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402002), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002080) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_transition_timed_guard6917 = { FOLLOW_RCURLY_in_transition_timed_guard6917_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_181_in_transition_effect6939 */
+static ANTLR3_BITWORD FOLLOW_181_in_transition_effect6939_bits[] = { ANTLR3_UINT64_LIT(0x000C000104400002), ANTLR3_UINT64_LIT(0x0000000000000101), ANTLR3_UINT64_LIT(0x000000003C001000), ANTLR3_UINT64_LIT(0x0480100000000000), ANTLR3_UINT64_LIT(0x0103F97E24C83881), ANTLR3_UINT64_LIT(0x020B1C00003F0400), ANTLR3_UINT64_LIT(0x00000001800000A6) };
+static ANTLR3_BITSET_LIST FOLLOW_181_in_transition_effect6939 = { FOLLOW_181_in_transition_effect6939_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_in_transition_effect6945 */
+static ANTLR3_BITWORD FOLLOW_statement_in_transition_effect6945_bits[] = { ANTLR3_UINT64_LIT(0x000C000104400002), ANTLR3_UINT64_LIT(0x0000000000000101), ANTLR3_UINT64_LIT(0x000000003C001000), ANTLR3_UINT64_LIT(0x0480100000000000), ANTLR3_UINT64_LIT(0x0103F97E24C83881), ANTLR3_UINT64_LIT(0x020B1C00003F0400), ANTLR3_UINT64_LIT(0x00000001800000A6) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_in_transition_effect6945 = { FOLLOW_statement_in_transition_effect6945_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_target_state_kw_id_in_target_state_id6977 */
+static ANTLR3_BITWORD FOLLOW_target_state_kw_id_in_target_state_id6977_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_target_state_kw_id_in_target_state_id6977 = { FOLLOW_target_state_kw_id_in_target_state_id6977_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_target_state_id6988 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_target_state_id6988_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_target_state_id6988 = { FOLLOW_qualifiedNameID_in_target_state_id6988_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DOLLAR_in_target_state_id7005 */
+static ANTLR3_BITWORD FOLLOW_DOLLAR_in_target_state_id7005_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_DOLLAR_in_target_state_id7005 = { FOLLOW_DOLLAR_in_target_state_id7005_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_target_state_id7009 */
+static ANTLR3_BITWORD FOLLOW_ID_in_target_state_id7009_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_target_state_id7009 = { FOLLOW_ID_in_target_state_id7009_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_146_in_target_state_kw_id7030 */
+static ANTLR3_BITWORD FOLLOW_146_in_target_state_kw_id7030_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_146_in_target_state_kw_id7030 = { FOLLOW_146_in_target_state_kw_id7030_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_147_in_target_state_kw_id7042 */
+static ANTLR3_BITWORD FOLLOW_147_in_target_state_kw_id7042_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_147_in_target_state_kw_id7042 = { FOLLOW_147_in_target_state_kw_id7042_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_150_in_target_state_kw_id7051 */
+static ANTLR3_BITWORD FOLLOW_150_in_target_state_kw_id7051_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_150_in_target_state_kw_id7051 = { FOLLOW_150_in_target_state_kw_id7051_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_144_in_target_state_kw_id7063 */
+static ANTLR3_BITWORD FOLLOW_144_in_target_state_kw_id7063_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_144_in_target_state_kw_id7063 = { FOLLOW_144_in_target_state_kw_id7063_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_149_in_target_state_kw_id7071 */
+static ANTLR3_BITWORD FOLLOW_149_in_target_state_kw_id7071_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_149_in_target_state_kw_id7071 = { FOLLOW_149_in_target_state_kw_id7071_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_145_in_target_state_kw_id7080 */
+static ANTLR3_BITWORD FOLLOW_145_in_target_state_kw_id7080_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_145_in_target_state_kw_id7080 = { FOLLOW_145_in_target_state_kw_id7080_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_153_in_target_state_kw_id7089 */
+static ANTLR3_BITWORD FOLLOW_153_in_target_state_kw_id7089_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_153_in_target_state_kw_id7089 = { FOLLOW_153_in_target_state_kw_id7089_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_148_in_target_state_kw_id7098 */
+static ANTLR3_BITWORD FOLLOW_148_in_target_state_kw_id7098_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_148_in_target_state_kw_id7098 = { FOLLOW_148_in_target_state_kw_id7098_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_177_in_def_state_activity7119 */
+static ANTLR3_BITWORD FOLLOW_177_in_def_state_activity7119_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_177_in_def_state_activity7119 = { FOLLOW_177_in_def_state_activity7119_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_def_state_activity7125 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_def_state_activity7125_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_def_state_activity7125 = { FOLLOW_block_statement_in_def_state_activity7125_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_194_in_def_state_activity7133 */
+static ANTLR3_BITWORD FOLLOW_194_in_def_state_activity7133_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_194_in_def_state_activity7133 = { FOLLOW_194_in_def_state_activity7133_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_def_state_activity7141 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_def_state_activity7141_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_def_state_activity7141 = { FOLLOW_block_statement_in_def_state_activity7141_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_191_in_def_state_activity7150 */
+static ANTLR3_BITWORD FOLLOW_191_in_def_state_activity7150_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_191_in_def_state_activity7150 = { FOLLOW_191_in_def_state_activity7150_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_def_state_activity7155 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_def_state_activity7155_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_def_state_activity7155 = { FOLLOW_block_statement_in_def_state_activity7155_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_182_in_def_state_activity7163 */
+static ANTLR3_BITWORD FOLLOW_182_in_def_state_activity7163_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_182_in_def_state_activity7163 = { FOLLOW_182_in_def_state_activity7163_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_def_state_activity7169 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_def_state_activity7169_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_def_state_activity7169 = { FOLLOW_block_statement_in_def_state_activity7169_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_190_in_def_state_activity7178 */
+static ANTLR3_BITWORD FOLLOW_190_in_def_state_activity7178_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_190_in_def_state_activity7178 = { FOLLOW_190_in_def_state_activity7178_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_def_state_activity7182 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_def_state_activity7182_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_def_state_activity7182 = { FOLLOW_block_statement_in_def_state_activity7182_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_179_in_def_state_activity7190 */
+static ANTLR3_BITWORD FOLLOW_179_in_def_state_activity7190_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_179_in_def_state_activity7190 = { FOLLOW_179_in_def_state_activity7190_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_def_state_activity7195 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_def_state_activity7195_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_def_state_activity7195 = { FOLLOW_block_statement_in_def_state_activity7195_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_189_in_def_state_activity7204 */
+static ANTLR3_BITWORD FOLLOW_189_in_def_state_activity7204_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_189_in_def_state_activity7204 = { FOLLOW_189_in_def_state_activity7204_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_def_state_activity7210 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_def_state_activity7210_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_def_state_activity7210 = { FOLLOW_block_statement_in_def_state_activity7210_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_170_in_def_state_activity7218 */
+static ANTLR3_BITWORD FOLLOW_170_in_def_state_activity7218_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_170_in_def_state_activity7218 = { FOLLOW_170_in_def_state_activity7218_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_def_state_activity7225 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_def_state_activity7225_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_def_state_activity7225 = { FOLLOW_block_statement_in_def_state_activity7225_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_199_in_def_state_activity7234 */
+static ANTLR3_BITWORD FOLLOW_199_in_def_state_activity7234_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_199_in_def_state_activity7234 = { FOLLOW_199_in_def_state_activity7234_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_def_state_activity7242 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_def_state_activity7242_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_def_state_activity7242 = { FOLLOW_block_statement_in_def_state_activity7242_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_224_in_def_state_activity7250 */
+static ANTLR3_BITWORD FOLLOW_224_in_def_state_activity7250_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_224_in_def_state_activity7250 = { FOLLOW_224_in_def_state_activity7250_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_def_state_activity7259 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_def_state_activity7259_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_def_state_activity7259 = { FOLLOW_block_statement_in_def_state_activity7259_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_223_in_def_state_activity7267 */
+static ANTLR3_BITWORD FOLLOW_223_in_def_state_activity7267_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_223_in_def_state_activity7267 = { FOLLOW_223_in_def_state_activity7267_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_def_state_activity7276 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_def_state_activity7276_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_def_state_activity7276 = { FOLLOW_block_statement_in_def_state_activity7276_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_184_in_def_state_activity7285 */
+static ANTLR3_BITWORD FOLLOW_184_in_def_state_activity7285_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_184_in_def_state_activity7285 = { FOLLOW_184_in_def_state_activity7285_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_def_state_activity7292 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_def_state_activity7292_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_def_state_activity7292 = { FOLLOW_block_statement_in_def_state_activity7292_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_header_in_section_header_import_parameter_property7325 */
+static ANTLR3_BITWORD FOLLOW_section_header_in_section_header_import_parameter_property7325_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x00000000196E8019) };
+static ANTLR3_BITSET_LIST FOLLOW_section_header_in_section_header_import_parameter_property7325 = { FOLLOW_section_header_in_section_header_import_parameter_property7325_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_import_in_section_header_import_parameter_property7334 */
+static ANTLR3_BITWORD FOLLOW_section_import_in_section_header_import_parameter_property7334_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x00000000196E8018) };
+static ANTLR3_BITSET_LIST FOLLOW_section_import_in_section_header_import_parameter_property7334 = { FOLLOW_section_import_in_section_header_import_parameter_property7334_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_parameter_in_section_header_import_parameter_property7346 */
+static ANTLR3_BITWORD FOLLOW_section_parameter_in_section_header_import_parameter_property7346_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000001680000) };
+static ANTLR3_BITSET_LIST FOLLOW_section_parameter_in_section_header_import_parameter_property7346 = { FOLLOW_section_parameter_in_section_header_import_parameter_property7346_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_property_in_section_header_import_parameter_property7368 */
+static ANTLR3_BITWORD FOLLOW_section_property_in_section_header_import_parameter_property7368_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000001680000) };
+static ANTLR3_BITSET_LIST FOLLOW_section_property_in_section_header_import_parameter_property7368 = { FOLLOW_section_property_in_section_header_import_parameter_property7368_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_import_in_section_header_import_parameter_property7389 */
+static ANTLR3_BITWORD FOLLOW_section_import_in_section_header_import_parameter_property7389_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x00000000196E8018) };
+static ANTLR3_BITSET_LIST FOLLOW_section_import_in_section_header_import_parameter_property7389 = { FOLLOW_section_import_in_section_header_import_parameter_property7389_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_parameter_in_section_header_import_parameter_property7398 */
+static ANTLR3_BITWORD FOLLOW_section_parameter_in_section_header_import_parameter_property7398_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000001680000) };
+static ANTLR3_BITSET_LIST FOLLOW_section_parameter_in_section_header_import_parameter_property7398 = { FOLLOW_section_parameter_in_section_header_import_parameter_property7398_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_property_in_section_header_import_parameter_property7420 */
+static ANTLR3_BITWORD FOLLOW_section_property_in_section_header_import_parameter_property7420_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000001680000) };
+static ANTLR3_BITSET_LIST FOLLOW_section_property_in_section_header_import_parameter_property7420 = { FOLLOW_section_property_in_section_header_import_parameter_property7420_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_parameter_in_section_header_import_parameter_property7441 */
+static ANTLR3_BITWORD FOLLOW_section_parameter_in_section_header_import_parameter_property7441_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000001680000) };
+static ANTLR3_BITSET_LIST FOLLOW_section_parameter_in_section_header_import_parameter_property7441 = { FOLLOW_section_parameter_in_section_header_import_parameter_property7441_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_property_in_section_header_import_parameter_property7460 */
+static ANTLR3_BITWORD FOLLOW_section_property_in_section_header_import_parameter_property7460_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000001680000) };
+static ANTLR3_BITSET_LIST FOLLOW_section_property_in_section_header_import_parameter_property7460 = { FOLLOW_section_property_in_section_header_import_parameter_property7460_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_property_in_section_header_import_parameter_property7493 */
+static ANTLR3_BITWORD FOLLOW_section_property_in_section_header_import_parameter_property7493_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000001680000) };
+static ANTLR3_BITSET_LIST FOLLOW_section_property_in_section_header_import_parameter_property7493 = { FOLLOW_section_property_in_section_header_import_parameter_property7493_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_section_property_free_declaration_in_section_header_import_parameter_property7508 */
+static ANTLR3_BITWORD FOLLOW_section_property_free_declaration_in_section_header_import_parameter_property7508_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_section_property_free_declaration_in_section_header_import_parameter_property7508 = { FOLLOW_section_property_free_declaration_in_section_header_import_parameter_property7508_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_section_parameter7536 */
+static ANTLR3_BITWORD FOLLOW_set_in_section_parameter7536_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2208000000000000), ANTLR3_UINT64_LIT(0x400204000410004E), ANTLR3_UINT64_LIT(0x1040120821200001), ANTLR3_UINT64_LIT(0x000000004C504810) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_section_parameter7536 = { FOLLOW_set_in_section_parameter7536_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_property_declaration_in_section_parameter7553 */
+static ANTLR3_BITWORD FOLLOW_property_declaration_in_section_parameter7553_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2208000000000000), ANTLR3_UINT64_LIT(0x400204000410004E), ANTLR3_UINT64_LIT(0x1040120821200001), ANTLR3_UINT64_LIT(0x000000004C504810) };
+static ANTLR3_BITSET_LIST FOLLOW_property_declaration_in_section_parameter7553 = { FOLLOW_property_declaration_in_section_parameter7553_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_196_in_section_parameter7566 */
+static ANTLR3_BITWORD FOLLOW_196_in_section_parameter7566_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2208000000000000), ANTLR3_UINT64_LIT(0x400204000410004E), ANTLR3_UINT64_LIT(0x1040120821200001), ANTLR3_UINT64_LIT(0x000000004C504810) };
+static ANTLR3_BITSET_LIST FOLLOW_196_in_section_parameter7566 = { FOLLOW_196_in_section_parameter7566_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_property_declaration_in_section_parameter7571 */
+static ANTLR3_BITWORD FOLLOW_property_declaration_in_section_parameter7571_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2208000000000000), ANTLR3_UINT64_LIT(0x400204000410004E), ANTLR3_UINT64_LIT(0x1040120821200001), ANTLR3_UINT64_LIT(0x000000004C504810) };
+static ANTLR3_BITSET_LIST FOLLOW_property_declaration_in_section_parameter7571 = { FOLLOW_property_declaration_in_section_parameter7571_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_195_in_section_parameter7584 */
+static ANTLR3_BITWORD FOLLOW_195_in_section_parameter7584_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2208000000000000), ANTLR3_UINT64_LIT(0x400204000410004E), ANTLR3_UINT64_LIT(0x1040120821200001), ANTLR3_UINT64_LIT(0x000000004C504810) };
+static ANTLR3_BITSET_LIST FOLLOW_195_in_section_parameter7584 = { FOLLOW_195_in_section_parameter7584_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_property_declaration_in_section_parameter7589 */
+static ANTLR3_BITWORD FOLLOW_property_declaration_in_section_parameter7589_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2208000000000000), ANTLR3_UINT64_LIT(0x400204000410004E), ANTLR3_UINT64_LIT(0x1040120821200001), ANTLR3_UINT64_LIT(0x000000004C504810) };
+static ANTLR3_BITSET_LIST FOLLOW_property_declaration_in_section_parameter7589 = { FOLLOW_property_declaration_in_section_parameter7589_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_207_in_section_parameter7602 */
+static ANTLR3_BITWORD FOLLOW_207_in_section_parameter7602_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2208000000000000), ANTLR3_UINT64_LIT(0x400204000410004E), ANTLR3_UINT64_LIT(0x1040120821200001), ANTLR3_UINT64_LIT(0x000000004C504810) };
+static ANTLR3_BITSET_LIST FOLLOW_207_in_section_parameter7602 = { FOLLOW_207_in_section_parameter7602_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_property_declaration_in_section_parameter7606 */
+static ANTLR3_BITWORD FOLLOW_property_declaration_in_section_parameter7606_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2208000000000000), ANTLR3_UINT64_LIT(0x400204000410004E), ANTLR3_UINT64_LIT(0x1040120821200001), ANTLR3_UINT64_LIT(0x000000004C504810) };
+static ANTLR3_BITSET_LIST FOLLOW_property_declaration_in_section_parameter7606 = { FOLLOW_property_declaration_in_section_parameter7606_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_section_parameter7619 */
+static ANTLR3_BITWORD FOLLOW_set_in_section_parameter7619_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2208000000000000), ANTLR3_UINT64_LIT(0x400204000410004E), ANTLR3_UINT64_LIT(0x1040120821200001), ANTLR3_UINT64_LIT(0x000000004C504810) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_section_parameter7619 = { FOLLOW_set_in_section_parameter7619_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_property_declaration_in_section_parameter7636 */
+static ANTLR3_BITWORD FOLLOW_property_declaration_in_section_parameter7636_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2208000000000000), ANTLR3_UINT64_LIT(0x400204000410004E), ANTLR3_UINT64_LIT(0x1040120821200001), ANTLR3_UINT64_LIT(0x000000004C504810) };
+static ANTLR3_BITSET_LIST FOLLOW_property_declaration_in_section_parameter7636 = { FOLLOW_property_declaration_in_section_parameter7636_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_section_property7669 */
+static ANTLR3_BITWORD FOLLOW_set_in_section_property7669_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2208000000000000), ANTLR3_UINT64_LIT(0x400204000410004E), ANTLR3_UINT64_LIT(0x1040120821200001), ANTLR3_UINT64_LIT(0x000000004C504810) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_section_property7669 = { FOLLOW_set_in_section_property7669_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_property_declaration_in_section_property7686 */
+static ANTLR3_BITWORD FOLLOW_property_declaration_in_section_property7686_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2208000000000000), ANTLR3_UINT64_LIT(0x400204000410004E), ANTLR3_UINT64_LIT(0x1040120821200001), ANTLR3_UINT64_LIT(0x000000004C504810) };
+static ANTLR3_BITSET_LIST FOLLOW_property_declaration_in_section_property7686 = { FOLLOW_property_declaration_in_section_property7686_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_216_in_section_property7699 */
+static ANTLR3_BITWORD FOLLOW_216_in_section_property7699_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2208000000000000), ANTLR3_UINT64_LIT(0x400204000410004E), ANTLR3_UINT64_LIT(0x1040120821200001), ANTLR3_UINT64_LIT(0x000000004C504810) };
+static ANTLR3_BITSET_LIST FOLLOW_216_in_section_property7699 = { FOLLOW_216_in_section_property7699_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_property_declaration_in_section_property7706 */
+static ANTLR3_BITWORD FOLLOW_property_declaration_in_section_property7706_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2208000000000000), ANTLR3_UINT64_LIT(0x400204000410004E), ANTLR3_UINT64_LIT(0x1040120821200001), ANTLR3_UINT64_LIT(0x000000004C504810) };
+static ANTLR3_BITSET_LIST FOLLOW_property_declaration_in_section_property7706 = { FOLLOW_property_declaration_in_section_property7706_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_214_in_section_property7719 */
+static ANTLR3_BITWORD FOLLOW_214_in_section_property7719_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2208000000000000), ANTLR3_UINT64_LIT(0x400204000410004E), ANTLR3_UINT64_LIT(0x1040120821200001), ANTLR3_UINT64_LIT(0x000000004C504810) };
+static ANTLR3_BITSET_LIST FOLLOW_214_in_section_property7719 = { FOLLOW_214_in_section_property7719_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_property_declaration_in_section_property7726 */
+static ANTLR3_BITWORD FOLLOW_property_declaration_in_section_property7726_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2208000000000000), ANTLR3_UINT64_LIT(0x400204000410004E), ANTLR3_UINT64_LIT(0x1040120821200001), ANTLR3_UINT64_LIT(0x000000004C504810) };
+static ANTLR3_BITSET_LIST FOLLOW_property_declaration_in_section_property7726 = { FOLLOW_property_declaration_in_section_property7726_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_211_in_section_property7739 */
+static ANTLR3_BITWORD FOLLOW_211_in_section_property7739_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2208000000000000), ANTLR3_UINT64_LIT(0x400204000410004E), ANTLR3_UINT64_LIT(0x1040120821200001), ANTLR3_UINT64_LIT(0x000000004C504810) };
+static ANTLR3_BITSET_LIST FOLLOW_211_in_section_property7739 = { FOLLOW_211_in_section_property7739_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_property_declaration_in_section_property7746 */
+static ANTLR3_BITWORD FOLLOW_property_declaration_in_section_property7746_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2208000000000000), ANTLR3_UINT64_LIT(0x400204000410004E), ANTLR3_UINT64_LIT(0x1040120821200001), ANTLR3_UINT64_LIT(0x000000004C504810) };
+static ANTLR3_BITSET_LIST FOLLOW_property_declaration_in_section_property7746 = { FOLLOW_property_declaration_in_section_property7746_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_property_declaration_in_section_property_free_declaration7777 */
+static ANTLR3_BITWORD FOLLOW_property_declaration_in_section_property_free_declaration7777_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2208000000000000), ANTLR3_UINT64_LIT(0x400204000410004E), ANTLR3_UINT64_LIT(0x1040120821200001), ANTLR3_UINT64_LIT(0x000000004C504810) };
+static ANTLR3_BITSET_LIST FOLLOW_property_declaration_in_section_property_free_declaration7777 = { FOLLOW_property_declaration_in_section_property_free_declaration7777_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_modifier_declaration_in_property_declaration7806 */
+static ANTLR3_BITWORD FOLLOW_modifier_declaration_in_property_declaration7806_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2200000000000000), ANTLR3_UINT64_LIT(0x400000000010004E), ANTLR3_UINT64_LIT(0x0040000001000001), ANTLR3_UINT64_LIT(0x000000000C104010) };
+static ANTLR3_BITSET_LIST FOLLOW_modifier_declaration_in_property_declaration7806 = { FOLLOW_modifier_declaration_in_property_declaration7806_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_property_element_in_property_declaration7816 */
+static ANTLR3_BITWORD FOLLOW_decl_property_element_in_property_declaration7816_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_property_element_in_property_declaration7816 = { FOLLOW_decl_property_element_in_property_declaration7816_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_variable_in_decl_property_element7831 */
+static ANTLR3_BITWORD FOLLOW_decl_variable_in_decl_property_element7831_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_variable_in_decl_property_element7831 = { FOLLOW_decl_variable_in_decl_property_element7831_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_port_in_decl_property_element7838 */
+static ANTLR3_BITWORD FOLLOW_decl_port_in_decl_property_element7838_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_port_in_decl_property_element7838 = { FOLLOW_decl_port_in_decl_property_element7838_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_signal_in_decl_property_element7847 */
+static ANTLR3_BITWORD FOLLOW_decl_signal_in_decl_property_element7847_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_signal_in_decl_property_element7847 = { FOLLOW_decl_signal_in_decl_property_element7847_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_buffer_in_decl_property_element7854 */
+static ANTLR3_BITWORD FOLLOW_decl_buffer_in_decl_property_element7854_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_buffer_in_decl_property_element7854 = { FOLLOW_decl_buffer_in_decl_property_element7854_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_channel_in_decl_property_element7861 */
+static ANTLR3_BITWORD FOLLOW_decl_channel_in_decl_property_element7861_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_channel_in_decl_property_element7861 = { FOLLOW_decl_channel_in_decl_property_element7861_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_type_in_decl_property_element7868 */
+static ANTLR3_BITWORD FOLLOW_def_type_in_decl_property_element7868_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_type_in_decl_property_element7868 = { FOLLOW_def_type_in_decl_property_element7868_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_enum_in_decl_property_element7876 */
+static ANTLR3_BITWORD FOLLOW_def_enum_in_decl_property_element7876_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_enum_in_decl_property_element7876 = { FOLLOW_def_enum_in_decl_property_element7876_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_union_in_decl_property_element7884 */
+static ANTLR3_BITWORD FOLLOW_def_union_in_decl_property_element7884_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_union_in_decl_property_element7884 = { FOLLOW_def_union_in_decl_property_element7884_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_choice_in_decl_property_element7891 */
+static ANTLR3_BITWORD FOLLOW_def_choice_in_decl_property_element7891_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_choice_in_decl_property_element7891 = { FOLLOW_def_choice_in_decl_property_element7891_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_struct_in_decl_property_element7897 */
+static ANTLR3_BITWORD FOLLOW_def_struct_in_decl_property_element7897_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_struct_in_decl_property_element7897 = { FOLLOW_def_struct_in_decl_property_element7897_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_labelled_argument7933 */
+static ANTLR3_BITWORD FOLLOW_ID_in_labelled_argument7933_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_labelled_argument7933 = { FOLLOW_ID_in_labelled_argument7933_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COLON_in_labelled_argument7935 */
+static ANTLR3_BITWORD FOLLOW_COLON_in_labelled_argument7935_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COLON_in_labelled_argument7935 = { FOLLOW_COLON_in_labelled_argument7935_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_labelled_argument7945 */
+static ANTLR3_BITWORD FOLLOW_expression_in_labelled_argument7945_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_labelled_argument7945 = { FOLLOW_expression_in_labelled_argument7945_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_labelled_argument7955 */
+static ANTLR3_BITWORD FOLLOW_expression_in_labelled_argument7955_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_labelled_argument7955 = { FOLLOW_expression_in_labelled_argument7955_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_decl_instance_machine_params7979 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_decl_instance_machine_params7979_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002042), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_decl_instance_machine_params7979 = { FOLLOW_LPAREN_in_decl_instance_machine_params7979_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_labelled_argument_in_decl_instance_machine_params7988 */
+static ANTLR3_BITWORD FOLLOW_labelled_argument_in_decl_instance_machine_params7988_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_labelled_argument_in_decl_instance_machine_params7988 = { FOLLOW_labelled_argument_in_decl_instance_machine_params7988_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_decl_instance_machine_params8004 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_decl_instance_machine_params8004_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_decl_instance_machine_params8004 = { FOLLOW_COMMA_in_decl_instance_machine_params8004_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_labelled_argument_in_decl_instance_machine_params8013 */
+static ANTLR3_BITWORD FOLLOW_labelled_argument_in_decl_instance_machine_params8013_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_labelled_argument_in_decl_instance_machine_params8013 = { FOLLOW_labelled_argument_in_decl_instance_machine_params8013_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_decl_instance_machine_params8039 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_decl_instance_machine_params8039_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_decl_instance_machine_params8039 = { FOLLOW_RPAREN_in_decl_instance_machine_params8039_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_decl_instance_machine_returns8061 */
+static ANTLR3_BITWORD FOLLOW_set_in_decl_instance_machine_returns8061_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_decl_instance_machine_returns8061 = { FOLLOW_set_in_decl_instance_machine_returns8061_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_decl_instance_machine_returns8076 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_decl_instance_machine_returns8076_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_decl_instance_machine_returns8076 = { FOLLOW_LPAREN_in_decl_instance_machine_returns8076_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_labelled_argument_in_decl_instance_machine_returns8085 */
+static ANTLR3_BITWORD FOLLOW_labelled_argument_in_decl_instance_machine_returns8085_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_labelled_argument_in_decl_instance_machine_returns8085 = { FOLLOW_labelled_argument_in_decl_instance_machine_returns8085_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_decl_instance_machine_returns8101 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_decl_instance_machine_returns8101_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_decl_instance_machine_returns8101 = { FOLLOW_COMMA_in_decl_instance_machine_returns8101_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_labelled_argument_in_decl_instance_machine_returns8112 */
+static ANTLR3_BITWORD FOLLOW_labelled_argument_in_decl_instance_machine_returns8112_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_labelled_argument_in_decl_instance_machine_returns8112 = { FOLLOW_labelled_argument_in_decl_instance_machine_returns8112_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_decl_instance_machine_returns8136 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_decl_instance_machine_returns8136_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_decl_instance_machine_returns8136 = { FOLLOW_RPAREN_in_decl_instance_machine_returns8136_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_labelled_argument_in_decl_instance_machine_returns8146 */
+static ANTLR3_BITWORD FOLLOW_labelled_argument_in_decl_instance_machine_returns8146_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_labelled_argument_in_decl_instance_machine_returns8146 = { FOLLOW_labelled_argument_in_decl_instance_machine_returns8146_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_activity_machine_param_return8182 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_activity_machine_param_return8182_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002042), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_activity_machine_param_return8182 = { FOLLOW_LPAREN_in_activity_machine_param_return8182_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_labelled_argument_in_activity_machine_param_return8193 */
+static ANTLR3_BITWORD FOLLOW_labelled_argument_in_activity_machine_param_return8193_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_labelled_argument_in_activity_machine_param_return8193 = { FOLLOW_labelled_argument_in_activity_machine_param_return8193_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_activity_machine_param_return8209 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_activity_machine_param_return8209_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_activity_machine_param_return8209 = { FOLLOW_COMMA_in_activity_machine_param_return8209_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_labelled_argument_in_activity_machine_param_return8218 */
+static ANTLR3_BITWORD FOLLOW_labelled_argument_in_activity_machine_param_return8218_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_labelled_argument_in_activity_machine_param_return8218 = { FOLLOW_labelled_argument_in_activity_machine_param_return8218_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_activity_machine_param_return8244 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_activity_machine_param_return8244_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_activity_machine_param_return8244 = { FOLLOW_RPAREN_in_activity_machine_param_return8244_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_activity_machine_param_return8250 */
+static ANTLR3_BITWORD FOLLOW_set_in_activity_machine_param_return8250_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_activity_machine_param_return8250 = { FOLLOW_set_in_activity_machine_param_return8250_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_activity_machine_param_return8265 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_activity_machine_param_return8265_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_activity_machine_param_return8265 = { FOLLOW_LPAREN_in_activity_machine_param_return8265_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_labelled_argument_in_activity_machine_param_return8274 */
+static ANTLR3_BITWORD FOLLOW_labelled_argument_in_activity_machine_param_return8274_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_labelled_argument_in_activity_machine_param_return8274 = { FOLLOW_labelled_argument_in_activity_machine_param_return8274_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_activity_machine_param_return8290 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_activity_machine_param_return8290_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_activity_machine_param_return8290 = { FOLLOW_COMMA_in_activity_machine_param_return8290_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_labelled_argument_in_activity_machine_param_return8301 */
+static ANTLR3_BITWORD FOLLOW_labelled_argument_in_activity_machine_param_return8301_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_labelled_argument_in_activity_machine_param_return8301 = { FOLLOW_labelled_argument_in_activity_machine_param_return8301_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_activity_machine_param_return8325 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_activity_machine_param_return8325_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_activity_machine_param_return8325 = { FOLLOW_RPAREN_in_activity_machine_param_return8325_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_labelled_argument_in_activity_machine_param_return8335 */
+static ANTLR3_BITWORD FOLLOW_labelled_argument_in_activity_machine_param_return8335_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_labelled_argument_in_activity_machine_param_return8335 = { FOLLOW_labelled_argument_in_activity_machine_param_return8335_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_344_in_decl_port8376 */
+static ANTLR3_BITWORD FOLLOW_344_in_decl_port8376_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0002040000000000), ANTLR3_UINT64_LIT(0x0000100000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_344_in_decl_port8376 = { FOLLOW_344_in_decl_port8376_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_port_impl_in_decl_port8386 */
+static ANTLR3_BITWORD FOLLOW_decl_port_impl_in_decl_port8386_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_port_impl_in_decl_port8386 = { FOLLOW_decl_port_impl_in_decl_port8386_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_decl_port_impl8416 */
+static ANTLR3_BITWORD FOLLOW_ID_in_decl_port_impl8416_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_decl_port_impl8416 = { FOLLOW_ID_in_decl_port_impl8416_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_param_com_in_decl_port_impl8428 */
+static ANTLR3_BITWORD FOLLOW_type_param_com_in_decl_port_impl8428_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_type_param_com_in_decl_port_impl8428 = { FOLLOW_type_param_com_in_decl_port_impl8428_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_decl_port_impl8435 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_decl_port_impl8435_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_decl_port_impl8435 = { FOLLOW_SEMI_in_decl_port_impl8435_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_modifier_set_direction_strict_text_in_decl_port_impl8441 */
+static ANTLR3_BITWORD FOLLOW_modifier_set_direction_strict_text_in_decl_port_impl8441_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_modifier_set_direction_strict_text_in_decl_port_impl8441 = { FOLLOW_modifier_set_direction_strict_text_in_decl_port_impl8441_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_decl_port_impl8451 */
+static ANTLR3_BITWORD FOLLOW_ID_in_decl_port_impl8451_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_decl_port_impl8451 = { FOLLOW_ID_in_decl_port_impl8451_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_param_com_in_decl_port_impl8461 */
+static ANTLR3_BITWORD FOLLOW_type_param_com_in_decl_port_impl8461_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_type_param_com_in_decl_port_impl8461 = { FOLLOW_type_param_com_in_decl_port_impl8461_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_decl_port_impl8468 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_decl_port_impl8468_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_decl_port_impl8468 = { FOLLOW_SEMI_in_decl_port_impl8468_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_decl_port_impl8476 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_decl_port_impl8476_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_decl_port_impl8476 = { FOLLOW_LCURLY_in_decl_port_impl8476_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_decl_port_impl8486 */
+static ANTLR3_BITWORD FOLLOW_ID_in_decl_port_impl8486_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_decl_port_impl8486 = { FOLLOW_ID_in_decl_port_impl8486_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_param_com_in_decl_port_impl8506 */
+static ANTLR3_BITWORD FOLLOW_type_param_com_in_decl_port_impl8506_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_type_param_com_in_decl_port_impl8506 = { FOLLOW_type_param_com_in_decl_port_impl8506_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_decl_port_impl8513 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_decl_port_impl8513_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_decl_port_impl8513 = { FOLLOW_SEMI_in_decl_port_impl8513_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_decl_port_impl8523 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_decl_port_impl8523_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_decl_port_impl8523 = { FOLLOW_RCURLY_in_decl_port_impl8523_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_decl_port_impl8533 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_decl_port_impl8533_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0002040000000000), ANTLR3_UINT64_LIT(0x0000100000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_decl_port_impl8533 = { FOLLOW_LCURLY_in_decl_port_impl8533_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_decl_port_impl8551 */
+static ANTLR3_BITWORD FOLLOW_ID_in_decl_port_impl8551_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_decl_port_impl8551 = { FOLLOW_ID_in_decl_port_impl8551_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_param_com_in_decl_port_impl8567 */
+static ANTLR3_BITWORD FOLLOW_type_param_com_in_decl_port_impl8567_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_type_param_com_in_decl_port_impl8567 = { FOLLOW_type_param_com_in_decl_port_impl8567_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_decl_port_impl8574 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_decl_port_impl8574_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0002040000000000), ANTLR3_UINT64_LIT(0x0000100000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_decl_port_impl8574 = { FOLLOW_SEMI_in_decl_port_impl8574_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_modifier_set_direction_strict_text_in_decl_port_impl8582 */
+static ANTLR3_BITWORD FOLLOW_modifier_set_direction_strict_text_in_decl_port_impl8582_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_modifier_set_direction_strict_text_in_decl_port_impl8582 = { FOLLOW_modifier_set_direction_strict_text_in_decl_port_impl8582_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_decl_port_impl8587 */
+static ANTLR3_BITWORD FOLLOW_ID_in_decl_port_impl8587_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_decl_port_impl8587 = { FOLLOW_ID_in_decl_port_impl8587_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_param_com_in_decl_port_impl8603 */
+static ANTLR3_BITWORD FOLLOW_type_param_com_in_decl_port_impl8603_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_type_param_com_in_decl_port_impl8603 = { FOLLOW_type_param_com_in_decl_port_impl8603_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_decl_port_impl8610 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_decl_port_impl8610_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0002040000000000), ANTLR3_UINT64_LIT(0x0000100000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_decl_port_impl8610 = { FOLLOW_SEMI_in_decl_port_impl8610_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_decl_port_impl8621 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_decl_port_impl8621_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_decl_port_impl8621 = { FOLLOW_RCURLY_in_decl_port_impl8621_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_374_in_decl_signal8646 */
+static ANTLR3_BITWORD FOLLOW_374_in_decl_signal8646_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0002040000000000), ANTLR3_UINT64_LIT(0x0000100000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_374_in_decl_signal8646 = { FOLLOW_374_in_decl_signal8646_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_320_in_decl_signal8656 */
+static ANTLR3_BITWORD FOLLOW_320_in_decl_signal8656_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0002040000000000), ANTLR3_UINT64_LIT(0x0000100000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_320_in_decl_signal8656 = { FOLLOW_320_in_decl_signal8656_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_signal_impl_in_decl_signal8668 */
+static ANTLR3_BITWORD FOLLOW_decl_signal_impl_in_decl_signal8668_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_signal_impl_in_decl_signal8668 = { FOLLOW_decl_signal_impl_in_decl_signal8668_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_decl_signal_impl8698 */
+static ANTLR3_BITWORD FOLLOW_ID_in_decl_signal_impl8698_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_decl_signal_impl8698 = { FOLLOW_ID_in_decl_signal_impl8698_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_param_com_in_decl_signal_impl8710 */
+static ANTLR3_BITWORD FOLLOW_type_param_com_in_decl_signal_impl8710_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_type_param_com_in_decl_signal_impl8710 = { FOLLOW_type_param_com_in_decl_signal_impl8710_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_decl_signal_impl8717 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_decl_signal_impl8717_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_decl_signal_impl8717 = { FOLLOW_SEMI_in_decl_signal_impl8717_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_modifier_set_direction_strict_text_in_decl_signal_impl8723 */
+static ANTLR3_BITWORD FOLLOW_modifier_set_direction_strict_text_in_decl_signal_impl8723_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_modifier_set_direction_strict_text_in_decl_signal_impl8723 = { FOLLOW_modifier_set_direction_strict_text_in_decl_signal_impl8723_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_decl_signal_impl8733 */
+static ANTLR3_BITWORD FOLLOW_ID_in_decl_signal_impl8733_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_decl_signal_impl8733 = { FOLLOW_ID_in_decl_signal_impl8733_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_param_com_in_decl_signal_impl8743 */
+static ANTLR3_BITWORD FOLLOW_type_param_com_in_decl_signal_impl8743_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_type_param_com_in_decl_signal_impl8743 = { FOLLOW_type_param_com_in_decl_signal_impl8743_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_decl_signal_impl8750 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_decl_signal_impl8750_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_decl_signal_impl8750 = { FOLLOW_SEMI_in_decl_signal_impl8750_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_decl_signal_impl8758 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_decl_signal_impl8758_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_decl_signal_impl8758 = { FOLLOW_LCURLY_in_decl_signal_impl8758_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_decl_signal_impl8768 */
+static ANTLR3_BITWORD FOLLOW_ID_in_decl_signal_impl8768_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_decl_signal_impl8768 = { FOLLOW_ID_in_decl_signal_impl8768_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_param_com_in_decl_signal_impl8788 */
+static ANTLR3_BITWORD FOLLOW_type_param_com_in_decl_signal_impl8788_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_type_param_com_in_decl_signal_impl8788 = { FOLLOW_type_param_com_in_decl_signal_impl8788_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_decl_signal_impl8795 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_decl_signal_impl8795_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_decl_signal_impl8795 = { FOLLOW_SEMI_in_decl_signal_impl8795_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_decl_signal_impl8805 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_decl_signal_impl8805_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_decl_signal_impl8805 = { FOLLOW_RCURLY_in_decl_signal_impl8805_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_decl_signal_impl8815 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_decl_signal_impl8815_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0002040000000000), ANTLR3_UINT64_LIT(0x0000100000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_decl_signal_impl8815 = { FOLLOW_LCURLY_in_decl_signal_impl8815_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_decl_signal_impl8833 */
+static ANTLR3_BITWORD FOLLOW_ID_in_decl_signal_impl8833_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_decl_signal_impl8833 = { FOLLOW_ID_in_decl_signal_impl8833_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_param_com_in_decl_signal_impl8849 */
+static ANTLR3_BITWORD FOLLOW_type_param_com_in_decl_signal_impl8849_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_type_param_com_in_decl_signal_impl8849 = { FOLLOW_type_param_com_in_decl_signal_impl8849_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_decl_signal_impl8856 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_decl_signal_impl8856_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0002040000000000), ANTLR3_UINT64_LIT(0x0000100000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_decl_signal_impl8856 = { FOLLOW_SEMI_in_decl_signal_impl8856_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_modifier_set_direction_strict_text_in_decl_signal_impl8864 */
+static ANTLR3_BITWORD FOLLOW_modifier_set_direction_strict_text_in_decl_signal_impl8864_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_modifier_set_direction_strict_text_in_decl_signal_impl8864 = { FOLLOW_modifier_set_direction_strict_text_in_decl_signal_impl8864_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_decl_signal_impl8869 */
+static ANTLR3_BITWORD FOLLOW_ID_in_decl_signal_impl8869_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_decl_signal_impl8869 = { FOLLOW_ID_in_decl_signal_impl8869_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_param_com_in_decl_signal_impl8885 */
+static ANTLR3_BITWORD FOLLOW_type_param_com_in_decl_signal_impl8885_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_type_param_com_in_decl_signal_impl8885 = { FOLLOW_type_param_com_in_decl_signal_impl8885_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_decl_signal_impl8892 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_decl_signal_impl8892_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0002040000000000), ANTLR3_UINT64_LIT(0x0000100000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_decl_signal_impl8892 = { FOLLOW_SEMI_in_decl_signal_impl8892_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_decl_signal_impl8903 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_decl_signal_impl8903_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_decl_signal_impl8903 = { FOLLOW_RCURLY_in_decl_signal_impl8903_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_type_param_com8925 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_type_param_com8925_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC276000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_type_param_com8925 = { FOLLOW_LPAREN_in_type_param_com8925_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_param_com_atom_in_type_param_com8932 */
+static ANTLR3_BITWORD FOLLOW_param_com_atom_in_type_param_com8932_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_param_com_atom_in_type_param_com8932 = { FOLLOW_param_com_atom_in_type_param_com8932_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_type_param_com8942 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_type_param_com8942_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC276000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_type_param_com8942 = { FOLLOW_COMMA_in_type_param_com8942_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_param_com_atom_in_type_param_com8944 */
+static ANTLR3_BITWORD FOLLOW_param_com_atom_in_type_param_com8944_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_param_com_atom_in_type_param_com8944 = { FOLLOW_param_com_atom_in_type_param_com8944_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_type_param_com8953 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_type_param_com8953_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_type_param_com8953 = { FOLLOW_RPAREN_in_type_param_com8953_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_var_in_param_com_atom8973 */
+static ANTLR3_BITWORD FOLLOW_type_var_in_param_com_atom8973_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_type_var_in_param_com_atom8973 = { FOLLOW_type_var_in_param_com_atom8973_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_param_com_atom8984 */
+static ANTLR3_BITWORD FOLLOW_ID_in_param_com_atom8984_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000012), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_param_com_atom8984 = { FOLLOW_ID_in_param_com_atom8984_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_initial_value_in_param_com_atom9001 */
+static ANTLR3_BITWORD FOLLOW_initial_value_in_param_com_atom9001_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_initial_value_in_param_com_atom9001 = { FOLLOW_initial_value_in_param_com_atom9001_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_244_in_param_com_atom9022 */
+static ANTLR3_BITWORD FOLLOW_244_in_param_com_atom9022_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_244_in_param_com_atom9022 = { FOLLOW_244_in_param_com_atom9022_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_var_in_param_com_atom9042 */
+static ANTLR3_BITWORD FOLLOW_type_var_in_param_com_atom9042_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_type_var_in_param_com_atom9042 = { FOLLOW_type_var_in_param_com_atom9042_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COLON_in_param_com_atom9044 */
+static ANTLR3_BITWORD FOLLOW_COLON_in_param_com_atom9044_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COLON_in_param_com_atom9044 = { FOLLOW_COLON_in_param_com_atom9044_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_param_com_atom9056 */
+static ANTLR3_BITWORD FOLLOW_expression_in_param_com_atom9056_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_param_com_atom9056 = { FOLLOW_expression_in_param_com_atom9056_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_param_com_atom9067 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_param_com_atom9067_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_param_com_atom9067 = { FOLLOW_qualifiedNameID_in_param_com_atom9067_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_249_in_decl_buffer9098 */
+static ANTLR3_BITWORD FOLLOW_249_in_decl_buffer9098_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0800000002000000), ANTLR3_UINT64_LIT(0x0024001000000260), ANTLR3_UINT64_LIT(0x0000000010000000) };
+static ANTLR3_BITSET_LIST FOLLOW_249_in_decl_buffer9098 = { FOLLOW_249_in_decl_buffer9098_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_buffer_impl_in_decl_buffer9101 */
+static ANTLR3_BITWORD FOLLOW_decl_buffer_impl_in_decl_buffer9101_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_buffer_impl_in_decl_buffer9101 = { FOLLOW_decl_buffer_impl_in_decl_buffer9101_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_buffer_in_decl_buffer_impl9122 */
+static ANTLR3_BITWORD FOLLOW_def_buffer_in_decl_buffer_impl9122_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_buffer_in_decl_buffer_impl9122 = { FOLLOW_def_buffer_in_decl_buffer_impl9122_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_decl_buffer_impl9127 */
+static ANTLR3_BITWORD FOLLOW_ID_in_decl_buffer_impl9127_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000010), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_decl_buffer_impl9127 = { FOLLOW_ID_in_decl_buffer_impl9127_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_initial_buffer_contents_in_decl_buffer_impl9137 */
+static ANTLR3_BITWORD FOLLOW_initial_buffer_contents_in_decl_buffer_impl9137_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_initial_buffer_contents_in_decl_buffer_impl9137 = { FOLLOW_initial_buffer_contents_in_decl_buffer_impl9137_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_decl_buffer_impl9144 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_decl_buffer_impl9144_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_decl_buffer_impl9144 = { FOLLOW_SEMI_in_decl_buffer_impl9144_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_decl_buffer_impl9150 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_decl_buffer_impl9150_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0800000002000000), ANTLR3_UINT64_LIT(0x0024001000000260), ANTLR3_UINT64_LIT(0x0000000010000000) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_decl_buffer_impl9150 = { FOLLOW_LCURLY_in_decl_buffer_impl9150_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_buffer_in_decl_buffer_impl9164 */
+static ANTLR3_BITWORD FOLLOW_def_buffer_in_decl_buffer_impl9164_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_buffer_in_decl_buffer_impl9164 = { FOLLOW_def_buffer_in_decl_buffer_impl9164_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_decl_buffer_impl9169 */
+static ANTLR3_BITWORD FOLLOW_ID_in_decl_buffer_impl9169_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0800000002000000), ANTLR3_UINT64_LIT(0x0024001000000260), ANTLR3_UINT64_LIT(0x0000000010000000) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_decl_buffer_impl9169 = { FOLLOW_ID_in_decl_buffer_impl9169_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_decl_buffer_impl9187 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_decl_buffer_impl9187_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_decl_buffer_impl9187 = { FOLLOW_RCURLY_in_decl_buffer_impl9187_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_policy_buffer_in_def_buffer9205 */
+static ANTLR3_BITWORD FOLLOW_policy_buffer_in_def_buffer9205_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_policy_buffer_in_def_buffer9205 = { FOLLOW_policy_buffer_in_def_buffer9205_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_def_buffer9215 */
+static ANTLR3_BITWORD FOLLOW_LT__in_def_buffer9215_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000200) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_def_buffer9215 = { FOLLOW_LT__in_def_buffer9215_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_integer_constant_in_def_buffer9226 */
+static ANTLR3_BITWORD FOLLOW_integer_constant_in_def_buffer9226_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_integer_constant_in_def_buffer9226 = { FOLLOW_integer_constant_in_def_buffer9226_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STAR_in_def_buffer9238 */
+static ANTLR3_BITWORD FOLLOW_STAR_in_def_buffer9238_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_STAR_in_def_buffer9238 = { FOLLOW_STAR_in_def_buffer9238_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_def_buffer9267 */
+static ANTLR3_BITWORD FOLLOW_GT_in_def_buffer9267_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_def_buffer9267 = { FOLLOW_GT_in_def_buffer9267_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_356_in_def_buffer9276 */
+static ANTLR3_BITWORD FOLLOW_356_in_def_buffer9276_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_356_in_def_buffer9276 = { FOLLOW_356_in_def_buffer9276_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_281_in_policy_buffer9295 */
+static ANTLR3_BITWORD FOLLOW_281_in_policy_buffer9295_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_281_in_policy_buffer9295 = { FOLLOW_281_in_policy_buffer9295_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_315_in_policy_buffer9307 */
+static ANTLR3_BITWORD FOLLOW_315_in_policy_buffer9307_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_315_in_policy_buffer9307 = { FOLLOW_315_in_policy_buffer9307_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_325_in_policy_buffer9319 */
+static ANTLR3_BITWORD FOLLOW_325_in_policy_buffer9319_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_325_in_policy_buffer9319 = { FOLLOW_325_in_policy_buffer9319_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_326_in_policy_buffer9326 */
+static ANTLR3_BITWORD FOLLOW_326_in_policy_buffer9326_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_326_in_policy_buffer9326 = { FOLLOW_326_in_policy_buffer9326_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_373_in_policy_buffer9333 */
+static ANTLR3_BITWORD FOLLOW_373_in_policy_buffer9333_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_373_in_policy_buffer9333 = { FOLLOW_373_in_policy_buffer9333_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_329_in_policy_buffer9346 */
+static ANTLR3_BITWORD FOLLOW_329_in_policy_buffer9346_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_329_in_policy_buffer9346 = { FOLLOW_329_in_policy_buffer9346_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_412_in_policy_buffer9354 */
+static ANTLR3_BITWORD FOLLOW_412_in_policy_buffer9354_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_412_in_policy_buffer9354 = { FOLLOW_412_in_policy_buffer9354_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_370_in_policy_buffer9364 */
+static ANTLR3_BITWORD FOLLOW_370_in_policy_buffer9364_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_370_in_policy_buffer9364 = { FOLLOW_370_in_policy_buffer9364_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_ref_buffer9386 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_ref_buffer9386_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_ref_buffer9386 = { FOLLOW_qualifiedNameID_in_ref_buffer9386_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSIGN_in_initial_buffer_contents9406 */
+static ANTLR3_BITWORD FOLLOW_ASSIGN_in_initial_buffer_contents9406_bits[] = { ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_ASSIGN_in_initial_buffer_contents9406 = { FOLLOW_ASSIGN_in_initial_buffer_contents9406_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LBRACKET_in_initial_buffer_contents9408 */
+static ANTLR3_BITWORD FOLLOW_LBRACKET_in_initial_buffer_contents9408_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_LBRACKET_in_initial_buffer_contents9408 = { FOLLOW_LBRACKET_in_initial_buffer_contents9408_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_initial_buffer_contents9417 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_initial_buffer_contents9417_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_initial_buffer_contents9417 = { FOLLOW_qualifiedNameID_in_initial_buffer_contents9417_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_initial_buffer_contents9431 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_initial_buffer_contents9431_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_initial_buffer_contents9431 = { FOLLOW_COMMA_in_initial_buffer_contents9431_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_initial_buffer_contents9435 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_initial_buffer_contents9435_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_initial_buffer_contents9435 = { FOLLOW_qualifiedNameID_in_initial_buffer_contents9435_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RBRACKET_in_initial_buffer_contents9446 */
+static ANTLR3_BITWORD FOLLOW_RBRACKET_in_initial_buffer_contents9446_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RBRACKET_in_initial_buffer_contents9446 = { FOLLOW_RBRACKET_in_initial_buffer_contents9446_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_253_in_decl_channel9465 */
+static ANTLR3_BITWORD FOLLOW_253_in_decl_channel9465_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000002000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0002040000000000), ANTLR3_UINT64_LIT(0x0000100000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_253_in_decl_channel9465 = { FOLLOW_253_in_decl_channel9465_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_channel_port_in_decl_channel9468 */
+static ANTLR3_BITWORD FOLLOW_decl_channel_port_in_decl_channel9468_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_channel_port_in_decl_channel9468 = { FOLLOW_decl_channel_port_in_decl_channel9468_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_decl_channel_port9491 */
+static ANTLR3_BITWORD FOLLOW_LT__in_decl_channel_port9491_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0301000000000000), ANTLR3_UINT64_LIT(0x0800000012200000), ANTLR3_UINT64_LIT(0x0024009000000370), ANTLR3_UINT64_LIT(0x0000000010080000) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_decl_channel_port9491 = { FOLLOW_LT__in_decl_channel_port9491_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_com_protocol_in_decl_channel_port9498 */
+static ANTLR3_BITWORD FOLLOW_com_protocol_in_decl_channel_port9498_bits[] = { ANTLR3_UINT64_LIT(0x0000200000800000) };
+static ANTLR3_BITSET_LIST FOLLOW_com_protocol_in_decl_channel_port9498 = { FOLLOW_com_protocol_in_decl_channel_port9498_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_decl_channel_port9508 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_decl_channel_port9508_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0101000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000010), ANTLR3_UINT64_LIT(0x0000000000080000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_decl_channel_port9508 = { FOLLOW_COMMA_in_decl_channel_port9508_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_com_cast_in_decl_channel_port9510 */
+static ANTLR3_BITWORD FOLLOW_com_cast_in_decl_channel_port9510_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_com_cast_in_decl_channel_port9510 = { FOLLOW_com_cast_in_decl_channel_port9510_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_decl_channel_port9521 */
+static ANTLR3_BITWORD FOLLOW_GT_in_decl_channel_port9521_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0002040000000000), ANTLR3_UINT64_LIT(0x0000100000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_decl_channel_port9521 = { FOLLOW_GT_in_decl_channel_port9521_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_modifier_set_direction_strict_text_in_decl_channel_port9535 */
+static ANTLR3_BITWORD FOLLOW_modifier_set_direction_strict_text_in_decl_channel_port9535_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_modifier_set_direction_strict_text_in_decl_channel_port9535 = { FOLLOW_modifier_set_direction_strict_text_in_decl_channel_port9535_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_decl_channel_port9547 */
+static ANTLR3_BITWORD FOLLOW_ID_in_decl_channel_port9547_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_decl_channel_port9547 = { FOLLOW_ID_in_decl_channel_port9547_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_decl_channel_port9556 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_decl_channel_port9556_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000000001000), ANTLR3_UINT64_LIT(0x0000005000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0002048000000000), ANTLR3_UINT64_LIT(0x0040100001208001) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_decl_channel_port9556 = { FOLLOW_LCURLY_in_decl_channel_port9556_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_modifier_direction_in_decl_channel_port9570 */
+static ANTLR3_BITWORD FOLLOW_modifier_direction_in_decl_channel_port9570_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_modifier_direction_in_decl_channel_port9570 = { FOLLOW_modifier_direction_in_decl_channel_port9570_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_decl_channel_port9575 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_decl_channel_port9575_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_decl_channel_port9575 = { FOLLOW_qualifiedNameID_in_decl_channel_port9575_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_decl_channel_port9577 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_decl_channel_port9577_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x2000000000001000), ANTLR3_UINT64_LIT(0x0000005000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0002048000000000), ANTLR3_UINT64_LIT(0x0040100001208001) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_decl_channel_port9577 = { FOLLOW_SEMI_in_decl_channel_port9577_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_port_in_decl_channel_port9592 */
+static ANTLR3_BITWORD FOLLOW_decl_port_in_decl_channel_port9592_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x2000000000001000), ANTLR3_UINT64_LIT(0x0000005000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0002048000000000), ANTLR3_UINT64_LIT(0x0040100001208001) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_port_in_decl_channel_port9592 = { FOLLOW_decl_port_in_decl_channel_port9592_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_signal_in_decl_channel_port9609 */
+static ANTLR3_BITWORD FOLLOW_decl_signal_in_decl_channel_port9609_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x2000000000001000), ANTLR3_UINT64_LIT(0x0000005000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0002048000000000), ANTLR3_UINT64_LIT(0x0040100001208001) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_signal_in_decl_channel_port9609 = { FOLLOW_decl_signal_in_decl_channel_port9609_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_decl_channel_port9621 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_decl_channel_port9621_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_decl_channel_port9621 = { FOLLOW_RCURLY_in_decl_channel_port9621_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_var_in_decl_channel_var9642 */
+static ANTLR3_BITWORD FOLLOW_type_var_in_decl_channel_var9642_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_type_var_in_decl_channel_var9642 = { FOLLOW_type_var_in_decl_channel_var9642_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_decl_channel_var9647 */
+static ANTLR3_BITWORD FOLLOW_ID_in_decl_channel_var9647_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000010), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_decl_channel_var9647 = { FOLLOW_ID_in_decl_channel_var9647_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_initial_value_in_decl_channel_var9661 */
+static ANTLR3_BITWORD FOLLOW_initial_value_in_decl_channel_var9661_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_initial_value_in_decl_channel_var9661 = { FOLLOW_initial_value_in_decl_channel_var9661_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_decl_channel_var9674 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_decl_channel_var9674_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_decl_channel_var9674 = { FOLLOW_SEMI_in_decl_channel_var9674_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_on_write_var_routine_def_in_decl_channel_var9680 */
+static ANTLR3_BITWORD FOLLOW_on_write_var_routine_def_in_decl_channel_var9680_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_on_write_var_routine_def_in_decl_channel_var9680 = { FOLLOW_on_write_var_routine_def_in_decl_channel_var9680_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_decl_channel_var9689 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_decl_channel_var9689_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_decl_channel_var9689 = { FOLLOW_LCURLY_in_decl_channel_var9689_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_var_in_decl_channel_var9698 */
+static ANTLR3_BITWORD FOLLOW_type_var_in_decl_channel_var9698_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_type_var_in_decl_channel_var9698 = { FOLLOW_type_var_in_decl_channel_var9698_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_decl_channel_var9703 */
+static ANTLR3_BITWORD FOLLOW_ID_in_decl_channel_var9703_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000010), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_decl_channel_var9703 = { FOLLOW_ID_in_decl_channel_var9703_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_initial_value_in_decl_channel_var9717 */
+static ANTLR3_BITWORD FOLLOW_initial_value_in_decl_channel_var9717_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_initial_value_in_decl_channel_var9717 = { FOLLOW_initial_value_in_decl_channel_var9717_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_decl_channel_var9730 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_decl_channel_var9730_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_decl_channel_var9730 = { FOLLOW_SEMI_in_decl_channel_var9730_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_on_write_var_routine_def_in_decl_channel_var9736 */
+static ANTLR3_BITWORD FOLLOW_on_write_var_routine_def_in_decl_channel_var9736_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_on_write_var_routine_def_in_decl_channel_var9736 = { FOLLOW_on_write_var_routine_def_in_decl_channel_var9736_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_decl_channel_var9748 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_decl_channel_var9748_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_decl_channel_var9748 = { FOLLOW_RCURLY_in_decl_channel_var9748_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_411_in_decl_variable9769 */
+static ANTLR3_BITWORD FOLLOW_411_in_decl_variable9769_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_411_in_decl_variable9769 = { FOLLOW_411_in_decl_variable9769_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_410_in_decl_variable9783 */
+static ANTLR3_BITWORD FOLLOW_410_in_decl_variable9783_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_410_in_decl_variable9783 = { FOLLOW_410_in_decl_variable9783_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_262_in_decl_variable9799 */
+static ANTLR3_BITWORD FOLLOW_262_in_decl_variable9799_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x78E000000A00C168), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x000000001BA78108) };
+static ANTLR3_BITSET_LIST FOLLOW_262_in_decl_variable9799 = { FOLLOW_262_in_decl_variable9799_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_318_in_decl_variable9811 */
+static ANTLR3_BITWORD FOLLOW_318_in_decl_variable9811_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x78E000000A00C168), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x000000001BA78108) };
+static ANTLR3_BITSET_LIST FOLLOW_318_in_decl_variable9811 = { FOLLOW_318_in_decl_variable9811_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_411_in_decl_variable9831 */
+static ANTLR3_BITWORD FOLLOW_411_in_decl_variable9831_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_411_in_decl_variable9831 = { FOLLOW_411_in_decl_variable9831_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_variable_impl_in_decl_variable9844 */
+static ANTLR3_BITWORD FOLLOW_decl_variable_impl_in_decl_variable9844_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_variable_impl_in_decl_variable9844 = { FOLLOW_decl_variable_impl_in_decl_variable9844_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_variable_time_clock_impl_in_decl_variable9851 */
+static ANTLR3_BITWORD FOLLOW_decl_variable_time_clock_impl_in_decl_variable9851_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_variable_time_clock_impl_in_decl_variable9851 = { FOLLOW_decl_variable_time_clock_impl_in_decl_variable9851_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_time_clock_type_in_decl_variable_time_clock_impl9873 */
+static ANTLR3_BITWORD FOLLOW_time_clock_type_in_decl_variable_time_clock_impl9873_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_time_clock_type_in_decl_variable_time_clock_impl9873 = { FOLLOW_time_clock_type_in_decl_variable_time_clock_impl9873_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_typed_variable_atom_impl_in_decl_variable_time_clock_impl9878 */
+static ANTLR3_BITWORD FOLLOW_decl_typed_variable_atom_impl_in_decl_variable_time_clock_impl9878_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_typed_variable_atom_impl_in_decl_variable_time_clock_impl9878 = { FOLLOW_decl_typed_variable_atom_impl_in_decl_variable_time_clock_impl9878_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_variable_atom_impl_in_decl_variable_impl9894 */
+static ANTLR3_BITWORD FOLLOW_decl_variable_atom_impl_in_decl_variable_impl9894_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_variable_atom_impl_in_decl_variable_impl9894 = { FOLLOW_decl_variable_atom_impl_in_decl_variable_impl9894_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_decl_variable_impl9901 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_decl_variable_impl9901_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_decl_variable_impl9901 = { FOLLOW_LCURLY_in_decl_variable_impl9901_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_variable_atom_impl_in_decl_variable_impl9908 */
+static ANTLR3_BITWORD FOLLOW_decl_variable_atom_impl_in_decl_variable_impl9908_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_variable_atom_impl_in_decl_variable_impl9908 = { FOLLOW_decl_variable_atom_impl_in_decl_variable_impl9908_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_decl_variable_impl9917 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_decl_variable_impl9917_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_decl_variable_impl9917 = { FOLLOW_RCURLY_in_decl_variable_impl9917_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_var_in_decl_variable_atom_impl9933 */
+static ANTLR3_BITWORD FOLLOW_type_var_in_decl_variable_atom_impl9933_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_type_var_in_decl_variable_atom_impl9933 = { FOLLOW_type_var_in_decl_variable_atom_impl9933_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_typed_variable_atom_impl_in_decl_variable_atom_impl9938 */
+static ANTLR3_BITWORD FOLLOW_decl_typed_variable_atom_impl_in_decl_variable_atom_impl9938_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_typed_variable_atom_impl_in_decl_variable_atom_impl9938 = { FOLLOW_decl_typed_variable_atom_impl_in_decl_variable_atom_impl9938_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_decl_typed_variable_atom_impl9959 */
+static ANTLR3_BITWORD FOLLOW_ID_in_decl_typed_variable_atom_impl9959_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000010), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000000002080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_decl_typed_variable_atom_impl9959 = { FOLLOW_ID_in_decl_typed_variable_atom_impl9959_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_StringLiteral_in_decl_typed_variable_atom_impl9972 */
+static ANTLR3_BITWORD FOLLOW_StringLiteral_in_decl_typed_variable_atom_impl9972_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000010), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_StringLiteral_in_decl_typed_variable_atom_impl9972 = { FOLLOW_StringLiteral_in_decl_typed_variable_atom_impl9972_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_initial_value_in_decl_typed_variable_atom_impl9993 */
+static ANTLR3_BITWORD FOLLOW_initial_value_in_decl_typed_variable_atom_impl9993_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_initial_value_in_decl_typed_variable_atom_impl9993 = { FOLLOW_initial_value_in_decl_typed_variable_atom_impl9993_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_decl_typed_variable_atom_impl10006 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_decl_typed_variable_atom_impl10006_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_decl_typed_variable_atom_impl10006 = { FOLLOW_SEMI_in_decl_typed_variable_atom_impl10006_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_on_write_var_routine_def_in_decl_typed_variable_atom_impl10012 */
+static ANTLR3_BITWORD FOLLOW_on_write_var_routine_def_in_decl_typed_variable_atom_impl10012_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_on_write_var_routine_def_in_decl_typed_variable_atom_impl10012 = { FOLLOW_on_write_var_routine_def_in_decl_typed_variable_atom_impl10012_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSIGN_in_initial_value10031 */
+static ANTLR3_BITWORD FOLLOW_ASSIGN_in_initial_value10031_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_ASSIGN_in_initial_value10031 = { FOLLOW_ASSIGN_in_initial_value10031_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_initial_value10036 */
+static ANTLR3_BITWORD FOLLOW_expression_in_initial_value10036_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_initial_value10036 = { FOLLOW_expression_in_initial_value10036_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_initial_value10052 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_initial_value10052_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_initial_value10052 = { FOLLOW_LPAREN_in_initial_value10052_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_initial_value10057 */
+static ANTLR3_BITWORD FOLLOW_expression_in_initial_value10057_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_initial_value10057 = { FOLLOW_expression_in_initial_value10057_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_initial_value10060 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_initial_value10060_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_initial_value10060 = { FOLLOW_RPAREN_in_initial_value10060_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_base_type_var_in_type_var10081 */
+static ANTLR3_BITWORD FOLLOW_base_type_var_in_type_var10081_bits[] = { ANTLR3_UINT64_LIT(0x1000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_base_type_var_in_type_var10081 = { FOLLOW_base_type_var_in_type_var10081_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_type_array_in_type_var10109 */
+static ANTLR3_BITWORD FOLLOW_def_type_array_in_type_var10109_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_type_array_in_type_var10109 = { FOLLOW_def_type_array_in_type_var10109_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_type_container_in_type_var10124 */
+static ANTLR3_BITWORD FOLLOW_def_type_container_in_type_var10124_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_type_container_in_type_var10124 = { FOLLOW_def_type_container_in_type_var10124_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_type_interval_in_type_var10141 */
+static ANTLR3_BITWORD FOLLOW_def_type_interval_in_type_var10141_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_type_interval_in_type_var10141 = { FOLLOW_def_type_interval_in_type_var10141_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_type_array_size_in_def_type_array10178 */
+static ANTLR3_BITWORD FOLLOW_def_type_array_size_in_def_type_array10178_bits[] = { ANTLR3_UINT64_LIT(0x1000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_type_array_size_in_def_type_array10178 = { FOLLOW_def_type_array_size_in_def_type_array10178_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LBRACKET_in_def_type_array_size10202 */
+static ANTLR3_BITWORD FOLLOW_LBRACKET_in_def_type_array_size10202_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_LBRACKET_in_def_type_array_size10202 = { FOLLOW_LBRACKET_in_def_type_array_size10202_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_IntegerLiteral_in_def_type_array_size10213 */
+static ANTLR3_BITWORD FOLLOW_IntegerLiteral_in_def_type_array_size10213_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_IntegerLiteral_in_def_type_array_size10213 = { FOLLOW_IntegerLiteral_in_def_type_array_size10213_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_def_type_array_size10228 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_def_type_array_size10228_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_def_type_array_size10228 = { FOLLOW_qualifiedNameID_in_def_type_array_size10228_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RBRACKET_in_def_type_array_size10241 */
+static ANTLR3_BITWORD FOLLOW_RBRACKET_in_def_type_array_size10241_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RBRACKET_in_def_type_array_size10241 = { FOLLOW_RBRACKET_in_def_type_array_size10241_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_specifier_buffer_in_def_type_container10266 */
+static ANTLR3_BITWORD FOLLOW_specifier_buffer_in_def_type_container10266_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_specifier_buffer_in_def_type_container10266 = { FOLLOW_specifier_buffer_in_def_type_container10266_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_def_type_container10274 */
+static ANTLR3_BITWORD FOLLOW_LT__in_def_type_container10274_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC264000000000000), ANTLR3_UINT64_LIT(0x206000000800C128), ANTLR3_UINT64_LIT(0x00C0016007002001), ANTLR3_UINT64_LIT(0x0000000003A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_def_type_container10274 = { FOLLOW_LT__in_def_type_container10274_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_base_type_var_in_def_type_container10287 */
+static ANTLR3_BITWORD FOLLOW_base_type_var_in_def_type_container10287_bits[] = { ANTLR3_UINT64_LIT(0x0000200000800000) };
+static ANTLR3_BITSET_LIST FOLLOW_base_type_var_in_def_type_container10287 = { FOLLOW_base_type_var_in_def_type_container10287_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_def_type_container10303 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_def_type_container10303_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000200), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0080000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_def_type_container10303 = { FOLLOW_COMMA_in_def_type_container10303_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_375_in_def_type_container10308 */
+static ANTLR3_BITWORD FOLLOW_375_in_def_type_container10308_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000200) };
+static ANTLR3_BITSET_LIST FOLLOW_375_in_def_type_container10308 = { FOLLOW_375_in_def_type_container10308_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_integer_constant_in_def_type_container10328 */
+static ANTLR3_BITWORD FOLLOW_integer_constant_in_def_type_container10328_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_integer_constant_in_def_type_container10328 = { FOLLOW_integer_constant_in_def_type_container10328_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STAR_in_def_type_container10345 */
+static ANTLR3_BITWORD FOLLOW_STAR_in_def_type_container10345_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_STAR_in_def_type_container10345 = { FOLLOW_STAR_in_def_type_container10345_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_375_in_def_type_container10407 */
+static ANTLR3_BITWORD FOLLOW_375_in_def_type_container10407_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_375_in_def_type_container10407 = { FOLLOW_375_in_def_type_container10407_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_integer_constant_in_def_type_container10414 */
+static ANTLR3_BITWORD FOLLOW_integer_constant_in_def_type_container10414_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_integer_constant_in_def_type_container10414 = { FOLLOW_integer_constant_in_def_type_container10414_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_def_type_container10431 */
+static ANTLR3_BITWORD FOLLOW_GT_in_def_type_container10431_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_def_type_container10431 = { FOLLOW_GT_in_def_type_container10431_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_241_in_specifier_buffer10456 */
+static ANTLR3_BITWORD FOLLOW_241_in_specifier_buffer10456_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_241_in_specifier_buffer10456 = { FOLLOW_241_in_specifier_buffer10456_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_412_in_specifier_buffer10467 */
+static ANTLR3_BITWORD FOLLOW_412_in_specifier_buffer10467_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_412_in_specifier_buffer10467 = { FOLLOW_412_in_specifier_buffer10467_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_370_in_specifier_buffer10477 */
+static ANTLR3_BITWORD FOLLOW_370_in_specifier_buffer10477_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_370_in_specifier_buffer10477 = { FOLLOW_370_in_specifier_buffer10477_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_316_in_specifier_buffer10486 */
+static ANTLR3_BITWORD FOLLOW_316_in_specifier_buffer10486_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_316_in_specifier_buffer10486 = { FOLLOW_316_in_specifier_buffer10486_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_281_in_specifier_buffer10498 */
+static ANTLR3_BITWORD FOLLOW_281_in_specifier_buffer10498_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_281_in_specifier_buffer10498 = { FOLLOW_281_in_specifier_buffer10498_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_315_in_specifier_buffer10510 */
+static ANTLR3_BITWORD FOLLOW_315_in_specifier_buffer10510_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_315_in_specifier_buffer10510 = { FOLLOW_315_in_specifier_buffer10510_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_325_in_specifier_buffer10522 */
+static ANTLR3_BITWORD FOLLOW_325_in_specifier_buffer10522_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_325_in_specifier_buffer10522 = { FOLLOW_325_in_specifier_buffer10522_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_326_in_specifier_buffer10529 */
+static ANTLR3_BITWORD FOLLOW_326_in_specifier_buffer10529_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_326_in_specifier_buffer10529 = { FOLLOW_326_in_specifier_buffer10529_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_373_in_specifier_buffer10536 */
+static ANTLR3_BITWORD FOLLOW_373_in_specifier_buffer10536_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_373_in_specifier_buffer10536 = { FOLLOW_373_in_specifier_buffer10536_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_329_in_specifier_buffer10549 */
+static ANTLR3_BITWORD FOLLOW_329_in_specifier_buffer10549_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_329_in_specifier_buffer10549 = { FOLLOW_329_in_specifier_buffer10549_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_311_in_def_type_interval10574 */
+static ANTLR3_BITWORD FOLLOW_311_in_def_type_interval10574_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_311_in_def_type_interval10574 = { FOLLOW_311_in_def_type_interval10574_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_def_type_interval10582 */
+static ANTLR3_BITWORD FOLLOW_LT__in_def_type_interval10582_bits[] = { ANTLR3_UINT64_LIT(0x1000000000000000), ANTLR3_UINT64_LIT(0x1000000000000080), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC264000000000000), ANTLR3_UINT64_LIT(0x206000000800C128), ANTLR3_UINT64_LIT(0x0040016007002001), ANTLR3_UINT64_LIT(0x0000000003A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_def_type_interval10582 = { FOLLOW_LT__in_def_type_interval10582_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_primitive_type_in_def_type_interval10593 */
+static ANTLR3_BITWORD FOLLOW_primitive_type_in_def_type_interval10593_bits[] = { ANTLR3_UINT64_LIT(0x1000000000000000), ANTLR3_UINT64_LIT(0x1000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_primitive_type_in_def_type_interval10593 = { FOLLOW_primitive_type_in_def_type_interval10593_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LBRACKET_in_def_type_interval10608 */
+static ANTLR3_BITWORD FOLLOW_LBRACKET_in_def_type_interval10608_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LBRACKET_in_def_type_interval10608 = { FOLLOW_LBRACKET_in_def_type_interval10608_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RBRACKET_in_def_type_interval10614 */
+static ANTLR3_BITWORD FOLLOW_RBRACKET_in_def_type_interval10614_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_RBRACKET_in_def_type_interval10614 = { FOLLOW_RBRACKET_in_def_type_interval10614_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_def_type_interval10620 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_def_type_interval10620_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_def_type_interval10620 = { FOLLOW_LPAREN_in_def_type_interval10620_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_def_type_interval10630 */
+static ANTLR3_BITWORD FOLLOW_expression_in_def_type_interval10630_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_def_type_interval10630 = { FOLLOW_expression_in_def_type_interval10630_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_def_type_interval10632 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_def_type_interval10632_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_def_type_interval10632 = { FOLLOW_COMMA_in_def_type_interval10632_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_def_type_interval10637 */
+static ANTLR3_BITWORD FOLLOW_expression_in_def_type_interval10637_bits[] = { ANTLR3_UINT64_LIT(0x1000000000000000), ANTLR3_UINT64_LIT(0x1000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_def_type_interval10637 = { FOLLOW_expression_in_def_type_interval10637_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LBRACKET_in_def_type_interval10647 */
+static ANTLR3_BITWORD FOLLOW_LBRACKET_in_def_type_interval10647_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_LBRACKET_in_def_type_interval10647 = { FOLLOW_LBRACKET_in_def_type_interval10647_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RBRACKET_in_def_type_interval10653 */
+static ANTLR3_BITWORD FOLLOW_RBRACKET_in_def_type_interval10653_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_RBRACKET_in_def_type_interval10653 = { FOLLOW_RBRACKET_in_def_type_interval10653_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_def_type_interval10659 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_def_type_interval10659_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_def_type_interval10659 = { FOLLOW_RPAREN_in_def_type_interval10659_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_def_type_interval10665 */
+static ANTLR3_BITWORD FOLLOW_GT_in_def_type_interval10665_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_def_type_interval10665 = { FOLLOW_GT_in_def_type_interval10665_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_primitive_type_in_base_type_var10686 */
+static ANTLR3_BITWORD FOLLOW_primitive_type_in_base_type_var10686_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_primitive_type_in_base_type_var10686 = { FOLLOW_primitive_type_in_base_type_var10686_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_base_type_var10696 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_base_type_var10696_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_base_type_var10696 = { FOLLOW_qualifiedNameID_in_base_type_var10696_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_primitive_type10719 */
+static ANTLR3_BITWORD FOLLOW_set_in_primitive_type10719_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_primitive_type10719 = { FOLLOW_set_in_primitive_type10719_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_primitive_type10735 */
+static ANTLR3_BITWORD FOLLOW_set_in_primitive_type10735_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200002), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_primitive_type10735 = { FOLLOW_set_in_primitive_type10735_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_bit_field_size_in_primitive_type10755 */
+static ANTLR3_BITWORD FOLLOW_bit_field_size_in_primitive_type10755_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_bit_field_size_in_primitive_type10755 = { FOLLOW_bit_field_size_in_primitive_type10755_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_primitive_type10774 */
+static ANTLR3_BITWORD FOLLOW_set_in_primitive_type10774_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200002), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_primitive_type10774 = { FOLLOW_set_in_primitive_type10774_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_bit_field_size_in_primitive_type10794 */
+static ANTLR3_BITWORD FOLLOW_bit_field_size_in_primitive_type10794_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_bit_field_size_in_primitive_type10794 = { FOLLOW_bit_field_size_in_primitive_type10794_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_primitive_type10811 */
+static ANTLR3_BITWORD FOLLOW_set_in_primitive_type10811_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200002), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_primitive_type10811 = { FOLLOW_set_in_primitive_type10811_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_bit_field_size_in_primitive_type10831 */
+static ANTLR3_BITWORD FOLLOW_bit_field_size_in_primitive_type10831_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_bit_field_size_in_primitive_type10831 = { FOLLOW_bit_field_size_in_primitive_type10831_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_primitive_type10851 */
+static ANTLR3_BITWORD FOLLOW_set_in_primitive_type10851_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200002), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_primitive_type10851 = { FOLLOW_set_in_primitive_type10851_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_primitive_type10871 */
+static ANTLR3_BITWORD FOLLOW_set_in_primitive_type10871_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200002), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_primitive_type10871 = { FOLLOW_set_in_primitive_type10871_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_283_in_primitive_type10890 */
+static ANTLR3_BITWORD FOLLOW_283_in_primitive_type10890_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200002), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_283_in_primitive_type10890 = { FOLLOW_283_in_primitive_type10890_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_400_in_primitive_type10902 */
+static ANTLR3_BITWORD FOLLOW_400_in_primitive_type10902_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200002), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_400_in_primitive_type10902 = { FOLLOW_400_in_primitive_type10902_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_270_in_primitive_type10914 */
+static ANTLR3_BITWORD FOLLOW_270_in_primitive_type10914_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200002), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_270_in_primitive_type10914 = { FOLLOW_270_in_primitive_type10914_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_399_in_primitive_type10925 */
+static ANTLR3_BITWORD FOLLOW_399_in_primitive_type10925_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200002), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_399_in_primitive_type10925 = { FOLLOW_399_in_primitive_type10925_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_360_in_primitive_type10936 */
+static ANTLR3_BITWORD FOLLOW_360_in_primitive_type10936_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200002), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_360_in_primitive_type10936 = { FOLLOW_360_in_primitive_type10936_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_409_in_primitive_type10949 */
+static ANTLR3_BITWORD FOLLOW_409_in_primitive_type10949_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200002), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_409_in_primitive_type10949 = { FOLLOW_409_in_primitive_type10949_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_bit_field_size_in_primitive_type10968 */
+static ANTLR3_BITWORD FOLLOW_bit_field_size_in_primitive_type10968_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_bit_field_size_in_primitive_type10968 = { FOLLOW_bit_field_size_in_primitive_type10968_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_time_clock_type_in_primitive_type10988 */
+static ANTLR3_BITWORD FOLLOW_time_clock_type_in_primitive_type10988_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_time_clock_type_in_primitive_type10988 = { FOLLOW_time_clock_type_in_primitive_type10988_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_time_type_in_primitive_type10998 */
+static ANTLR3_BITWORD FOLLOW_time_type_in_primitive_type10998_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_time_type_in_primitive_type10998 = { FOLLOW_time_type_in_primitive_type10998_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_254_in_primitive_type11006 */
+static ANTLR3_BITWORD FOLLOW_254_in_primitive_type11006_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200002), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_254_in_primitive_type11006 = { FOLLOW_254_in_primitive_type11006_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_bit_field_size_in_primitive_type11020 */
+static ANTLR3_BITWORD FOLLOW_bit_field_size_in_primitive_type11020_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_bit_field_size_in_primitive_type11020 = { FOLLOW_bit_field_size_in_primitive_type11020_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_255_in_primitive_type11037 */
+static ANTLR3_BITWORD FOLLOW_255_in_primitive_type11037_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200002), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_255_in_primitive_type11037 = { FOLLOW_255_in_primitive_type11037_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_bit_field_size_in_primitive_type11051 */
+static ANTLR3_BITWORD FOLLOW_bit_field_size_in_primitive_type11051_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_bit_field_size_in_primitive_type11051 = { FOLLOW_bit_field_size_in_primitive_type11051_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_387_in_primitive_type11068 */
+static ANTLR3_BITWORD FOLLOW_387_in_primitive_type11068_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200002), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_387_in_primitive_type11068 = { FOLLOW_387_in_primitive_type11068_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_string_field_size_in_primitive_type11080 */
+static ANTLR3_BITWORD FOLLOW_string_field_size_in_primitive_type11080_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_string_field_size_in_primitive_type11080 = { FOLLOW_string_field_size_in_primitive_type11080_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_333_in_primitive_type11098 */
+static ANTLR3_BITWORD FOLLOW_333_in_primitive_type11098_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_333_in_primitive_type11098 = { FOLLOW_333_in_primitive_type11098_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_242_in_primitive_type11107 */
+static ANTLR3_BITWORD FOLLOW_242_in_primitive_type11107_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_242_in_primitive_type11107 = { FOLLOW_242_in_primitive_type11107_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_344_in_primitive_type11118 */
+static ANTLR3_BITWORD FOLLOW_344_in_primitive_type11118_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_344_in_primitive_type11118 = { FOLLOW_344_in_primitive_type11118_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_249_in_primitive_type11131 */
+static ANTLR3_BITWORD FOLLOW_249_in_primitive_type11131_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_249_in_primitive_type11131 = { FOLLOW_249_in_primitive_type11131_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_320_in_primitive_type11142 */
+static ANTLR3_BITWORD FOLLOW_320_in_primitive_type11142_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_320_in_primitive_type11142 = { FOLLOW_320_in_primitive_type11142_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_374_in_primitive_type11152 */
+static ANTLR3_BITWORD FOLLOW_374_in_primitive_type11152_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_374_in_primitive_type11152 = { FOLLOW_374_in_primitive_type11152_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_261_in_primitive_type11163 */
+static ANTLR3_BITWORD FOLLOW_261_in_primitive_type11163_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_261_in_primitive_type11163 = { FOLLOW_261_in_primitive_type11163_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_317_in_primitive_type11172 */
+static ANTLR3_BITWORD FOLLOW_317_in_primitive_type11172_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_317_in_primitive_type11172 = { FOLLOW_317_in_primitive_type11172_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_primitive_type11184 */
+static ANTLR3_BITWORD FOLLOW_LT__in_primitive_type11184_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_primitive_type11184 = { FOLLOW_LT__in_primitive_type11184_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_primitive_type11189 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_primitive_type11189_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_primitive_type11189 = { FOLLOW_qualifiedNameID_in_primitive_type11189_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_primitive_type11192 */
+static ANTLR3_BITWORD FOLLOW_GT_in_primitive_type11192_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_primitive_type11192 = { FOLLOW_GT_in_primitive_type11192_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_405_in_primitive_type11209 */
+static ANTLR3_BITWORD FOLLOW_405_in_primitive_type11209_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_405_in_primitive_type11209 = { FOLLOW_405_in_primitive_type11209_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COLON_in_bit_field_size11228 */
+static ANTLR3_BITWORD FOLLOW_COLON_in_bit_field_size11228_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_COLON_in_bit_field_size11228 = { FOLLOW_COLON_in_bit_field_size11228_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_integer_constant_in_bit_field_size11233 */
+static ANTLR3_BITWORD FOLLOW_integer_constant_in_bit_field_size11233_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_integer_constant_in_bit_field_size11233 = { FOLLOW_integer_constant_in_bit_field_size11233_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_bit_field_size11257 */
+static ANTLR3_BITWORD FOLLOW_LT__in_bit_field_size11257_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0080000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_bit_field_size11257 = { FOLLOW_LT__in_bit_field_size11257_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_375_in_bit_field_size11262 */
+static ANTLR3_BITWORD FOLLOW_375_in_bit_field_size11262_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_375_in_bit_field_size11262 = { FOLLOW_375_in_bit_field_size11262_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_integer_constant_in_bit_field_size11270 */
+static ANTLR3_BITWORD FOLLOW_integer_constant_in_bit_field_size11270_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_integer_constant_in_bit_field_size11270 = { FOLLOW_integer_constant_in_bit_field_size11270_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_bit_field_size11273 */
+static ANTLR3_BITWORD FOLLOW_GT_in_bit_field_size11273_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_bit_field_size11273 = { FOLLOW_GT_in_bit_field_size11273_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COLON_in_string_field_size11292 */
+static ANTLR3_BITWORD FOLLOW_COLON_in_string_field_size11292_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_COLON_in_string_field_size11292 = { FOLLOW_COLON_in_string_field_size11292_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_range_constant_in_string_field_size11296 */
+static ANTLR3_BITWORD FOLLOW_range_constant_in_string_field_size11296_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_range_constant_in_string_field_size11296 = { FOLLOW_range_constant_in_string_field_size11296_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_string_field_size11307 */
+static ANTLR3_BITWORD FOLLOW_LT__in_string_field_size11307_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0080000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_string_field_size11307 = { FOLLOW_LT__in_string_field_size11307_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_375_in_string_field_size11312 */
+static ANTLR3_BITWORD FOLLOW_375_in_string_field_size11312_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_375_in_string_field_size11312 = { FOLLOW_375_in_string_field_size11312_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_range_constant_in_string_field_size11320 */
+static ANTLR3_BITWORD FOLLOW_range_constant_in_string_field_size11320_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_range_constant_in_string_field_size11320 = { FOLLOW_range_constant_in_string_field_size11320_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_string_field_size11323 */
+static ANTLR3_BITWORD FOLLOW_GT_in_string_field_size11323_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_string_field_size11323 = { FOLLOW_GT_in_string_field_size11323_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_integer_constant_in_range_constant11345 */
+static ANTLR3_BITWORD FOLLOW_integer_constant_in_range_constant11345_bits[] = { ANTLR3_UINT64_LIT(0x0000000400800002) };
+static ANTLR3_BITSET_LIST FOLLOW_integer_constant_in_range_constant11345 = { FOLLOW_integer_constant_in_range_constant11345_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_range_constant11357 */
+static ANTLR3_BITWORD FOLLOW_set_in_range_constant11357_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_range_constant11357 = { FOLLOW_set_in_range_constant11357_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_integer_constant_in_range_constant11374 */
+static ANTLR3_BITWORD FOLLOW_integer_constant_in_range_constant11374_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_integer_constant_in_range_constant11374 = { FOLLOW_integer_constant_in_range_constant11374_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_on_write_var_routine_def11396 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_on_write_var_routine_def11396_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_on_write_var_routine_def11396 = { FOLLOW_LCURLY_in_on_write_var_routine_def11396_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_var_routine_def_in_on_write_var_routine_def11401 */
+static ANTLR3_BITWORD FOLLOW_var_routine_def_in_on_write_var_routine_def11401_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_var_routine_def_in_on_write_var_routine_def11401 = { FOLLOW_var_routine_def_in_on_write_var_routine_def11401_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_on_write_var_routine_def11407 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_on_write_var_routine_def11407_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_on_write_var_routine_def11407 = { FOLLOW_RCURLY_in_on_write_var_routine_def11407_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_205_in_var_routine_def11429 */
+static ANTLR3_BITWORD FOLLOW_205_in_var_routine_def11429_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000200000000) };
+static ANTLR3_BITSET_LIST FOLLOW_205_in_var_routine_def11429 = { FOLLOW_205_in_var_routine_def11429_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_routine_single_param_in_var_routine_def11441 */
+static ANTLR3_BITWORD FOLLOW_routine_single_param_in_var_routine_def11441_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000200000000) };
+static ANTLR3_BITSET_LIST FOLLOW_routine_single_param_in_var_routine_def11441 = { FOLLOW_routine_single_param_in_var_routine_def11441_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_var_routine_def11454 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_var_routine_def11454_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_var_routine_def11454 = { FOLLOW_block_statement_in_var_routine_def11454_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_417_in_var_routine_def11464 */
+static ANTLR3_BITWORD FOLLOW_417_in_var_routine_def11464_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_417_in_var_routine_def11464 = { FOLLOW_417_in_var_routine_def11464_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_conditionalExpression_in_var_routine_def11468 */
+static ANTLR3_BITWORD FOLLOW_conditionalExpression_in_var_routine_def11468_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_conditionalExpression_in_var_routine_def11468 = { FOLLOW_conditionalExpression_in_var_routine_def11468_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_var_routine_def11470 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_var_routine_def11470_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_var_routine_def11470 = { FOLLOW_SEMI_in_var_routine_def11470_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_routine_single_param11498 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_routine_single_param11498_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_routine_single_param11498 = { FOLLOW_LPAREN_in_routine_single_param11498_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_var_in_routine_single_param11517 */
+static ANTLR3_BITWORD FOLLOW_type_var_in_routine_single_param11517_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_type_var_in_routine_single_param11517 = { FOLLOW_type_var_in_routine_single_param11517_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_routine_single_param11524 */
+static ANTLR3_BITWORD FOLLOW_ID_in_routine_single_param11524_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000010), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_routine_single_param11524 = { FOLLOW_ID_in_routine_single_param11524_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_routine_single_param11533 */
+static ANTLR3_BITWORD FOLLOW_ID_in_routine_single_param11533_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000010), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_routine_single_param11533 = { FOLLOW_ID_in_routine_single_param11533_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_initial_value_in_routine_single_param11547 */
+static ANTLR3_BITWORD FOLLOW_initial_value_in_routine_single_param11547_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_initial_value_in_routine_single_param11547 = { FOLLOW_initial_value_in_routine_single_param11547_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_routine_single_param11563 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_routine_single_param11563_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_routine_single_param11563 = { FOLLOW_RPAREN_in_routine_single_param11563_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_276_in_def_enum11582 */
+static ANTLR3_BITWORD FOLLOW_276_in_def_enum11582_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_276_in_def_enum11582 = { FOLLOW_276_in_def_enum11582_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_def_enum11587 */
+static ANTLR3_BITWORD FOLLOW_ID_in_def_enum11587_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_def_enum11587 = { FOLLOW_ID_in_def_enum11587_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_enum_impl_in_def_enum11592 */
+static ANTLR3_BITWORD FOLLOW_def_enum_impl_in_def_enum11592_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_enum_impl_in_def_enum11592 = { FOLLOW_def_enum_impl_in_def_enum11592_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_def_enum_impl11611 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_def_enum_impl11611_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_def_enum_impl11611 = { FOLLOW_LCURLY_in_def_enum_impl11611_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_def_enum_impl11620 */
+static ANTLR3_BITWORD FOLLOW_ID_in_def_enum_impl11620_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800010), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_def_enum_impl11620 = { FOLLOW_ID_in_def_enum_impl11620_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSIGN_in_def_enum_impl11639 */
+static ANTLR3_BITWORD FOLLOW_ASSIGN_in_def_enum_impl11639_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_ASSIGN_in_def_enum_impl11639 = { FOLLOW_ASSIGN_in_def_enum_impl11639_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_def_enum_impl11643 */
+static ANTLR3_BITWORD FOLLOW_expression_in_def_enum_impl11643_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_def_enum_impl11643 = { FOLLOW_expression_in_def_enum_impl11643_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_def_enum_impl11659 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_def_enum_impl11659_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_def_enum_impl11659 = { FOLLOW_COMMA_in_def_enum_impl11659_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_def_enum_impl11663 */
+static ANTLR3_BITWORD FOLLOW_ID_in_def_enum_impl11663_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800010), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_def_enum_impl11663 = { FOLLOW_ID_in_def_enum_impl11663_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSIGN_in_def_enum_impl11682 */
+static ANTLR3_BITWORD FOLLOW_ASSIGN_in_def_enum_impl11682_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_ASSIGN_in_def_enum_impl11682 = { FOLLOW_ASSIGN_in_def_enum_impl11682_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_def_enum_impl11686 */
+static ANTLR3_BITWORD FOLLOW_expression_in_def_enum_impl11686_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_def_enum_impl11686 = { FOLLOW_expression_in_def_enum_impl11686_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_def_enum_impl11707 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_def_enum_impl11707_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_def_enum_impl11707 = { FOLLOW_RCURLY_in_def_enum_impl11707_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_def_struct11722 */
+static ANTLR3_BITWORD FOLLOW_set_in_def_struct11722_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_def_struct11722 = { FOLLOW_set_in_def_struct11722_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_def_struct11735 */
+static ANTLR3_BITWORD FOLLOW_ID_in_def_struct11735_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_def_struct11735 = { FOLLOW_ID_in_def_struct11735_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_class_structure_impl_in_def_struct11740 */
+static ANTLR3_BITWORD FOLLOW_def_class_structure_impl_in_def_struct11740_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_class_structure_impl_in_def_struct11740 = { FOLLOW_def_class_structure_impl_in_def_struct11740_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_def_class_structure_impl11759 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_def_class_structure_impl11759_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0008000000000000), ANTLR3_UINT64_LIT(0x4002040104000048), ANTLR3_UINT64_LIT(0x1000120820200000), ANTLR3_UINT64_LIT(0x000000004C400800) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_def_class_structure_impl11759 = { FOLLOW_LCURLY_in_def_class_structure_impl11759_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_modifier_declaration_in_def_class_structure_impl11775 */
+static ANTLR3_BITWORD FOLLOW_modifier_declaration_in_def_class_structure_impl11775_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x4000000100000048), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x000000000C000000) };
+static ANTLR3_BITSET_LIST FOLLOW_modifier_declaration_in_def_class_structure_impl11775 = { FOLLOW_modifier_declaration_in_def_class_structure_impl11775_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_variable_in_def_class_structure_impl11792 */
+static ANTLR3_BITWORD FOLLOW_decl_variable_in_def_class_structure_impl11792_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0008000000000000), ANTLR3_UINT64_LIT(0x4002040104000048), ANTLR3_UINT64_LIT(0x1000120820200000), ANTLR3_UINT64_LIT(0x000000004C400800) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_variable_in_def_class_structure_impl11792 = { FOLLOW_decl_variable_in_def_class_structure_impl11792_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_method_in_def_class_structure_impl11803 */
+static ANTLR3_BITWORD FOLLOW_def_method_in_def_class_structure_impl11803_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0008000000000000), ANTLR3_UINT64_LIT(0x4002040104000048), ANTLR3_UINT64_LIT(0x1000120820200000), ANTLR3_UINT64_LIT(0x000000004C400800) };
+static ANTLR3_BITSET_LIST FOLLOW_def_method_in_def_class_structure_impl11803 = { FOLLOW_def_method_in_def_class_structure_impl11803_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_def_class_structure_impl11825 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_def_class_structure_impl11825_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_def_class_structure_impl11825 = { FOLLOW_RCURLY_in_def_class_structure_impl11825_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_257_in_def_choice11840 */
+static ANTLR3_BITWORD FOLLOW_257_in_def_choice11840_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_257_in_def_choice11840 = { FOLLOW_257_in_def_choice11840_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_def_choice11845 */
+static ANTLR3_BITWORD FOLLOW_ID_in_def_choice11845_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_def_choice11845 = { FOLLOW_ID_in_def_choice11845_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_choice_impl_in_def_choice11850 */
+static ANTLR3_BITWORD FOLLOW_def_choice_impl_in_def_choice11850_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_choice_impl_in_def_choice11850 = { FOLLOW_def_choice_impl_in_def_choice11850_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_def_choice_impl11869 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_def_choice_impl11869_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0008000000000000), ANTLR3_UINT64_LIT(0x4002040104000048), ANTLR3_UINT64_LIT(0x1000120820200000), ANTLR3_UINT64_LIT(0x000000004C400800) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_def_choice_impl11869 = { FOLLOW_LCURLY_in_def_choice_impl11869_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_modifier_declaration_in_def_choice_impl11885 */
+static ANTLR3_BITWORD FOLLOW_modifier_declaration_in_def_choice_impl11885_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x4000000100000048), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x000000000C000000) };
+static ANTLR3_BITSET_LIST FOLLOW_modifier_declaration_in_def_choice_impl11885 = { FOLLOW_modifier_declaration_in_def_choice_impl11885_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_variable_in_def_choice_impl11902 */
+static ANTLR3_BITWORD FOLLOW_decl_variable_in_def_choice_impl11902_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0008000000000000), ANTLR3_UINT64_LIT(0x4002040104000048), ANTLR3_UINT64_LIT(0x1000120820200000), ANTLR3_UINT64_LIT(0x000000004C400800) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_variable_in_def_choice_impl11902 = { FOLLOW_decl_variable_in_def_choice_impl11902_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_method_in_def_choice_impl11913 */
+static ANTLR3_BITWORD FOLLOW_def_method_in_def_choice_impl11913_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0008000000000000), ANTLR3_UINT64_LIT(0x4002040104000048), ANTLR3_UINT64_LIT(0x1000120820200000), ANTLR3_UINT64_LIT(0x000000004C400800) };
+static ANTLR3_BITSET_LIST FOLLOW_def_method_in_def_choice_impl11913 = { FOLLOW_def_method_in_def_choice_impl11913_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_def_choice_impl11935 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_def_choice_impl11935_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_def_choice_impl11935 = { FOLLOW_RCURLY_in_def_choice_impl11935_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_404_in_def_union11950 */
+static ANTLR3_BITWORD FOLLOW_404_in_def_union11950_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_404_in_def_union11950 = { FOLLOW_404_in_def_union11950_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_def_union11955 */
+static ANTLR3_BITWORD FOLLOW_ID_in_def_union11955_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_def_union11955 = { FOLLOW_ID_in_def_union11955_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_union_impl_in_def_union11960 */
+static ANTLR3_BITWORD FOLLOW_def_union_impl_in_def_union11960_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_union_impl_in_def_union11960 = { FOLLOW_def_union_impl_in_def_union11960_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_def_union_impl11980 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_def_union_impl11980_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0008000000000000), ANTLR3_UINT64_LIT(0x4002040004000048), ANTLR3_UINT64_LIT(0x1000120820200000), ANTLR3_UINT64_LIT(0x000000004C400800) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_def_union_impl11980 = { FOLLOW_LCURLY_in_def_union_impl11980_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_modifier_declaration_in_def_union_impl11996 */
+static ANTLR3_BITWORD FOLLOW_modifier_declaration_in_def_union_impl11996_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x4000000000000048), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x000000000C000000) };
+static ANTLR3_BITSET_LIST FOLLOW_modifier_declaration_in_def_union_impl11996 = { FOLLOW_modifier_declaration_in_def_union_impl11996_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_variable_in_def_union_impl12011 */
+static ANTLR3_BITWORD FOLLOW_decl_variable_in_def_union_impl12011_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0008000000000000), ANTLR3_UINT64_LIT(0x4002040004000048), ANTLR3_UINT64_LIT(0x1000120820200000), ANTLR3_UINT64_LIT(0x000000004C400800) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_variable_in_def_union_impl12011 = { FOLLOW_decl_variable_in_def_union_impl12011_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_def_union_impl12025 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_def_union_impl12025_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_def_union_impl12025 = { FOLLOW_RCURLY_in_def_union_impl12025_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_288_in_def_method12038 */
+static ANTLR3_BITWORD FOLLOW_288_in_def_method12038_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_288_in_def_method12038 = { FOLLOW_288_in_def_method12038_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_def_method12041 */
+static ANTLR3_BITWORD FOLLOW_ID_in_def_method12041_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_def_method12041 = { FOLLOW_ID_in_def_method12041_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_def_method12044 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_def_method12044_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_def_method12044 = { FOLLOW_LPAREN_in_def_method12044_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_parameters_in_def_method12047 */
+static ANTLR3_BITWORD FOLLOW_decl_parameters_in_def_method12047_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_parameters_in_def_method12047 = { FOLLOW_decl_parameters_in_def_method12047_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_def_method12052 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_def_method12052_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_def_method12052 = { FOLLOW_RPAREN_in_def_method12052_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_var_in_def_method12057 */
+static ANTLR3_BITWORD FOLLOW_type_var_in_def_method12057_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_type_var_in_def_method12057 = { FOLLOW_type_var_in_def_method12057_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_var_in_decl_parameters12071 */
+static ANTLR3_BITWORD FOLLOW_type_var_in_decl_parameters12071_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_type_var_in_decl_parameters12071 = { FOLLOW_type_var_in_decl_parameters12071_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_decl_parameters12073 */
+static ANTLR3_BITWORD FOLLOW_ID_in_decl_parameters12073_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800002) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_decl_parameters12073 = { FOLLOW_ID_in_decl_parameters12073_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_decl_parameters12077 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_decl_parameters12077_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_decl_parameters12077 = { FOLLOW_COMMA_in_decl_parameters12077_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_var_in_decl_parameters12079 */
+static ANTLR3_BITWORD FOLLOW_type_var_in_decl_parameters12079_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_type_var_in_decl_parameters12079 = { FOLLOW_type_var_in_decl_parameters12079_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_decl_parameters12081 */
+static ANTLR3_BITWORD FOLLOW_ID_in_decl_parameters12081_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800002) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_decl_parameters12081 = { FOLLOW_ID_in_decl_parameters12081_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_398_in_def_type12099 */
+static ANTLR3_BITWORD FOLLOW_398_in_def_type12099_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000100006), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000100010) };
+static ANTLR3_BITSET_LIST FOLLOW_398_in_def_type12099 = { FOLLOW_398_in_def_type12099_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_type_impl_in_def_type12102 */
+static ANTLR3_BITWORD FOLLOW_def_type_impl_in_def_type12102_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_type_impl_in_def_type12102 = { FOLLOW_def_type_impl_in_def_type12102_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_type_atom_impl_in_def_type_impl12117 */
+static ANTLR3_BITWORD FOLLOW_def_type_atom_impl_in_def_type_impl12117_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_type_atom_impl_in_def_type_impl12117 = { FOLLOW_def_type_atom_impl_in_def_type_impl12117_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_def_type_impl12124 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_def_type_impl12124_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000100006), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000100010) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_def_type_impl12124 = { FOLLOW_LCURLY_in_def_type_impl12124_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_type_atom_impl_in_def_type_impl12131 */
+static ANTLR3_BITWORD FOLLOW_def_type_atom_impl_in_def_type_impl12131_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000100006), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000100010) };
+static ANTLR3_BITSET_LIST FOLLOW_def_type_atom_impl_in_def_type_impl12131 = { FOLLOW_def_type_atom_impl_in_def_type_impl12131_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_def_type_impl12140 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_def_type_impl12140_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_def_type_impl12140 = { FOLLOW_RCURLY_in_def_type_impl12140_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_def_type_atom_impl12161 */
+static ANTLR3_BITWORD FOLLOW_ID_in_def_type_atom_impl12161_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A10C12E), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013B78118) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_def_type_atom_impl12161 = { FOLLOW_ID_in_def_type_atom_impl12161_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_base_type_var_in_def_type_atom_impl12170 */
+static ANTLR3_BITWORD FOLLOW_base_type_var_in_def_type_atom_impl12170_bits[] = { ANTLR3_UINT64_LIT(0x1000000000000002), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_base_type_var_in_def_type_atom_impl12170 = { FOLLOW_base_type_var_in_def_type_atom_impl12170_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_type_array_in_def_type_atom_impl12185 */
+static ANTLR3_BITWORD FOLLOW_def_type_array_in_def_type_atom_impl12185_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_def_type_array_in_def_type_atom_impl12185 = { FOLLOW_def_type_array_in_def_type_atom_impl12185_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_typedef_constraint_in_def_type_atom_impl12222 */
+static ANTLR3_BITWORD FOLLOW_def_typedef_constraint_in_def_type_atom_impl12222_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_typedef_constraint_in_def_type_atom_impl12222 = { FOLLOW_def_typedef_constraint_in_def_type_atom_impl12222_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_def_type_atom_impl12227 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_def_type_atom_impl12227_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_def_type_atom_impl12227 = { FOLLOW_SEMI_in_def_type_atom_impl12227_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_type_container_in_def_type_atom_impl12240 */
+static ANTLR3_BITWORD FOLLOW_def_type_container_in_def_type_atom_impl12240_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_def_type_container_in_def_type_atom_impl12240 = { FOLLOW_def_type_container_in_def_type_atom_impl12240_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_typedef_constraint_in_def_type_atom_impl12253 */
+static ANTLR3_BITWORD FOLLOW_def_typedef_constraint_in_def_type_atom_impl12253_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_typedef_constraint_in_def_type_atom_impl12253 = { FOLLOW_def_typedef_constraint_in_def_type_atom_impl12253_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_def_type_atom_impl12258 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_def_type_atom_impl12258_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_def_type_atom_impl12258 = { FOLLOW_SEMI_in_def_type_atom_impl12258_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_type_interval_in_def_type_atom_impl12271 */
+static ANTLR3_BITWORD FOLLOW_def_type_interval_in_def_type_atom_impl12271_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_def_type_interval_in_def_type_atom_impl12271 = { FOLLOW_def_type_interval_in_def_type_atom_impl12271_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_def_type_atom_impl12274 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_def_type_atom_impl12274_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_def_type_atom_impl12274 = { FOLLOW_SEMI_in_def_type_atom_impl12274_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_276_in_def_type_atom_impl12287 */
+static ANTLR3_BITWORD FOLLOW_276_in_def_type_atom_impl12287_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_276_in_def_type_atom_impl12287 = { FOLLOW_276_in_def_type_atom_impl12287_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_enum_impl_in_def_type_atom_impl12294 */
+static ANTLR3_BITWORD FOLLOW_def_enum_impl_in_def_type_atom_impl12294_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_enum_impl_in_def_type_atom_impl12294 = { FOLLOW_def_enum_impl_in_def_type_atom_impl12294_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_404_in_def_type_atom_impl12303 */
+static ANTLR3_BITWORD FOLLOW_404_in_def_type_atom_impl12303_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_404_in_def_type_atom_impl12303 = { FOLLOW_404_in_def_type_atom_impl12303_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_union_impl_in_def_type_atom_impl12310 */
+static ANTLR3_BITWORD FOLLOW_def_union_impl_in_def_type_atom_impl12310_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_union_impl_in_def_type_atom_impl12310 = { FOLLOW_def_union_impl_in_def_type_atom_impl12310_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_257_in_def_type_atom_impl12319 */
+static ANTLR3_BITWORD FOLLOW_257_in_def_type_atom_impl12319_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_257_in_def_type_atom_impl12319 = { FOLLOW_257_in_def_type_atom_impl12319_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_choice_impl_in_def_type_atom_impl12326 */
+static ANTLR3_BITWORD FOLLOW_def_choice_impl_in_def_type_atom_impl12326_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_choice_impl_in_def_type_atom_impl12326 = { FOLLOW_def_choice_impl_in_def_type_atom_impl12326_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_def_type_atom_impl12335 */
+static ANTLR3_BITWORD FOLLOW_set_in_def_type_atom_impl12335_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_def_type_atom_impl12335 = { FOLLOW_set_in_def_type_atom_impl12335_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_class_structure_impl_in_def_type_atom_impl12350 */
+static ANTLR3_BITWORD FOLLOW_def_class_structure_impl_in_def_type_atom_impl12350_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_class_structure_impl_in_def_type_atom_impl12350 = { FOLLOW_def_class_structure_impl_in_def_type_atom_impl12350_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_enum_in_def_type_atom_impl12362 */
+static ANTLR3_BITWORD FOLLOW_def_enum_in_def_type_atom_impl12362_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_enum_in_def_type_atom_impl12362 = { FOLLOW_def_enum_in_def_type_atom_impl12362_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_union_in_def_type_atom_impl12370 */
+static ANTLR3_BITWORD FOLLOW_def_union_in_def_type_atom_impl12370_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_union_in_def_type_atom_impl12370 = { FOLLOW_def_union_in_def_type_atom_impl12370_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_choice_in_def_type_atom_impl12377 */
+static ANTLR3_BITWORD FOLLOW_def_choice_in_def_type_atom_impl12377_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_choice_in_def_type_atom_impl12377 = { FOLLOW_def_choice_in_def_type_atom_impl12377_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_struct_in_def_type_atom_impl12383 */
+static ANTLR3_BITWORD FOLLOW_def_struct_in_def_type_atom_impl12383_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_struct_in_def_type_atom_impl12383 = { FOLLOW_def_struct_in_def_type_atom_impl12383_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_def_typedef_constraint12405 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_def_typedef_constraint12405_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0001000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_def_typedef_constraint12405 = { FOLLOW_LCURLY_in_def_typedef_constraint12405_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_176_in_def_typedef_constraint12409 */
+static ANTLR3_BITWORD FOLLOW_176_in_def_typedef_constraint12409_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000200000000) };
+static ANTLR3_BITSET_LIST FOLLOW_176_in_def_typedef_constraint12409 = { FOLLOW_176_in_def_typedef_constraint12409_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_routine_single_param_in_def_typedef_constraint12425 */
+static ANTLR3_BITWORD FOLLOW_routine_single_param_in_def_typedef_constraint12425_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000200000000) };
+static ANTLR3_BITSET_LIST FOLLOW_routine_single_param_in_def_typedef_constraint12425 = { FOLLOW_routine_single_param_in_def_typedef_constraint12425_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_def_typedef_constraint12440 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_def_typedef_constraint12440_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_def_typedef_constraint12440 = { FOLLOW_block_statement_in_def_typedef_constraint12440_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_417_in_def_typedef_constraint12452 */
+static ANTLR3_BITWORD FOLLOW_417_in_def_typedef_constraint12452_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_417_in_def_typedef_constraint12452 = { FOLLOW_417_in_def_typedef_constraint12452_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_conditionalExpression_in_def_typedef_constraint12456 */
+static ANTLR3_BITWORD FOLLOW_conditionalExpression_in_def_typedef_constraint12456_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_conditionalExpression_in_def_typedef_constraint12456 = { FOLLOW_conditionalExpression_in_def_typedef_constraint12456_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_def_typedef_constraint12458 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_def_typedef_constraint12458_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_def_typedef_constraint12458 = { FOLLOW_SEMI_in_def_typedef_constraint12458_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_def_typedef_constraint12479 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_def_typedef_constraint12479_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_def_typedef_constraint12479 = { FOLLOW_RCURLY_in_def_typedef_constraint12479_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_392_in_time_type12505 */
+static ANTLR3_BITWORD FOLLOW_392_in_time_type12505_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000002000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0060000008004000), ANTLR3_UINT64_LIT(0x0000016000000000), ANTLR3_UINT64_LIT(0x0000000003878000) };
+static ANTLR3_BITSET_LIST FOLLOW_392_in_time_type12505 = { FOLLOW_392_in_time_type12505_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_264_in_time_type12516 */
+static ANTLR3_BITWORD FOLLOW_264_in_time_type12516_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000002000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0060000008004000), ANTLR3_UINT64_LIT(0x0000016000000000), ANTLR3_UINT64_LIT(0x0000000003878000) };
+static ANTLR3_BITSET_LIST FOLLOW_264_in_time_type12516 = { FOLLOW_264_in_time_type12516_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_271_in_time_type12526 */
+static ANTLR3_BITWORD FOLLOW_271_in_time_type12526_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000002000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0060000008004000), ANTLR3_UINT64_LIT(0x0000016000000000), ANTLR3_UINT64_LIT(0x0000000003878000) };
+static ANTLR3_BITSET_LIST FOLLOW_271_in_time_type12526 = { FOLLOW_271_in_time_type12526_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_time_type12541 */
+static ANTLR3_BITWORD FOLLOW_LT__in_time_type12541_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0060000008004000), ANTLR3_UINT64_LIT(0x0000016000000000), ANTLR3_UINT64_LIT(0x0000000003878000) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_time_type12541 = { FOLLOW_LT__in_time_type12541_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_time_type_domain_in_time_type12557 */
+static ANTLR3_BITWORD FOLLOW_time_type_domain_in_time_type12557_bits[] = { ANTLR3_UINT64_LIT(0x0000200000800000) };
+static ANTLR3_BITSET_LIST FOLLOW_time_type_domain_in_time_type12557 = { FOLLOW_time_type_domain_in_time_type12557_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_time_type12578 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_time_type12578_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_time_type12578 = { FOLLOW_COMMA_in_time_type12578_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_integer_constant_in_time_type12583 */
+static ANTLR3_BITWORD FOLLOW_integer_constant_in_time_type12583_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_integer_constant_in_time_type12583 = { FOLLOW_integer_constant_in_time_type12583_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_time_type12595 */
+static ANTLR3_BITWORD FOLLOW_GT_in_time_type12595_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_time_type12595 = { FOLLOW_GT_in_time_type12595_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_time_type_domain_in_time_type12611 */
+static ANTLR3_BITWORD FOLLOW_time_type_domain_in_time_type12611_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_time_type_domain_in_time_type12611 = { FOLLOW_time_type_domain_in_time_type12611_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_259_in_time_clock_type12642 */
+static ANTLR3_BITWORD FOLLOW_259_in_time_clock_type12642_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000002000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x006000000800C100), ANTLR3_UINT64_LIT(0x0000016000000000), ANTLR3_UINT64_LIT(0x0000000003878100) };
+static ANTLR3_BITSET_LIST FOLLOW_259_in_time_clock_type12642 = { FOLLOW_259_in_time_clock_type12642_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_time_clock_type12652 */
+static ANTLR3_BITWORD FOLLOW_LT__in_time_clock_type12652_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x006000000800C100), ANTLR3_UINT64_LIT(0x0000016000000000), ANTLR3_UINT64_LIT(0x0000000003878100) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_time_clock_type12652 = { FOLLOW_LT__in_time_clock_type12652_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_392_in_time_clock_type12658 */
+static ANTLR3_BITWORD FOLLOW_392_in_time_clock_type12658_bits[] = { ANTLR3_UINT64_LIT(0x0000200000800000) };
+static ANTLR3_BITSET_LIST FOLLOW_392_in_time_clock_type12658 = { FOLLOW_392_in_time_clock_type12658_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_264_in_time_clock_type12668 */
+static ANTLR3_BITWORD FOLLOW_264_in_time_clock_type12668_bits[] = { ANTLR3_UINT64_LIT(0x0000200000800000) };
+static ANTLR3_BITSET_LIST FOLLOW_264_in_time_clock_type12668 = { FOLLOW_264_in_time_clock_type12668_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_271_in_time_clock_type12677 */
+static ANTLR3_BITWORD FOLLOW_271_in_time_clock_type12677_bits[] = { ANTLR3_UINT64_LIT(0x0000200000800000) };
+static ANTLR3_BITSET_LIST FOLLOW_271_in_time_clock_type12677 = { FOLLOW_271_in_time_clock_type12677_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_time_type_domain_in_time_clock_type12688 */
+static ANTLR3_BITWORD FOLLOW_time_type_domain_in_time_clock_type12688_bits[] = { ANTLR3_UINT64_LIT(0x0000200000800000) };
+static ANTLR3_BITSET_LIST FOLLOW_time_type_domain_in_time_clock_type12688 = { FOLLOW_time_type_domain_in_time_clock_type12688_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_time_clock_type12700 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_time_clock_type12700_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_time_clock_type12700 = { FOLLOW_COMMA_in_time_clock_type12700_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_integer_constant_in_time_clock_type12705 */
+static ANTLR3_BITWORD FOLLOW_integer_constant_in_time_clock_type12705_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_integer_constant_in_time_clock_type12705 = { FOLLOW_integer_constant_in_time_clock_type12705_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_time_clock_type12717 */
+static ANTLR3_BITWORD FOLLOW_GT_in_time_clock_type12717_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_time_clock_type12717 = { FOLLOW_GT_in_time_clock_type12717_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_392_in_time_clock_type12733 */
+static ANTLR3_BITWORD FOLLOW_392_in_time_clock_type12733_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800002) };
+static ANTLR3_BITSET_LIST FOLLOW_392_in_time_clock_type12733 = { FOLLOW_392_in_time_clock_type12733_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_264_in_time_clock_type12743 */
+static ANTLR3_BITWORD FOLLOW_264_in_time_clock_type12743_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800002) };
+static ANTLR3_BITSET_LIST FOLLOW_264_in_time_clock_type12743 = { FOLLOW_264_in_time_clock_type12743_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_271_in_time_clock_type12752 */
+static ANTLR3_BITWORD FOLLOW_271_in_time_clock_type12752_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800002) };
+static ANTLR3_BITSET_LIST FOLLOW_271_in_time_clock_type12752 = { FOLLOW_271_in_time_clock_type12752_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_time_type_domain_in_time_clock_type12763 */
+static ANTLR3_BITWORD FOLLOW_time_type_domain_in_time_clock_type12763_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800002) };
+static ANTLR3_BITSET_LIST FOLLOW_time_type_domain_in_time_clock_type12763 = { FOLLOW_time_type_domain_in_time_clock_type12763_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_time_clock_type12775 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_time_clock_type12775_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_time_clock_type12775 = { FOLLOW_COMMA_in_time_clock_type12775_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_integer_constant_in_time_clock_type12780 */
+static ANTLR3_BITWORD FOLLOW_integer_constant_in_time_clock_type12780_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_integer_constant_in_time_clock_type12780 = { FOLLOW_integer_constant_in_time_clock_type12780_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_time_type_domain12814 */
+static ANTLR3_BITWORD FOLLOW_set_in_time_type_domain12814_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_time_type_domain12814 = { FOLLOW_set_in_time_type_domain12814_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_time_type_domain12834 */
+static ANTLR3_BITWORD FOLLOW_LT__in_time_type_domain12834_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_time_type_domain12834 = { FOLLOW_LT__in_time_type_domain12834_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_integer_constant_in_time_type_domain12843 */
+static ANTLR3_BITWORD FOLLOW_integer_constant_in_time_type_domain12843_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_integer_constant_in_time_type_domain12843 = { FOLLOW_integer_constant_in_time_type_domain12843_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_time_type_domain12856 */
+static ANTLR3_BITWORD FOLLOW_GT_in_time_type_domain12856_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_time_type_domain12856 = { FOLLOW_GT_in_time_type_domain12856_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_time_type_domain12865 */
+static ANTLR3_BITWORD FOLLOW_set_in_time_type_domain12865_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_time_type_domain12865 = { FOLLOW_set_in_time_type_domain12865_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_time_type_domain12885 */
+static ANTLR3_BITWORD FOLLOW_LT__in_time_type_domain12885_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_time_type_domain12885 = { FOLLOW_LT__in_time_type_domain12885_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_integer_constant_in_time_type_domain12894 */
+static ANTLR3_BITWORD FOLLOW_integer_constant_in_time_type_domain12894_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_integer_constant_in_time_type_domain12894 = { FOLLOW_integer_constant_in_time_type_domain12894_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_time_type_domain12907 */
+static ANTLR3_BITWORD FOLLOW_GT_in_time_type_domain12907_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_time_type_domain12907 = { FOLLOW_GT_in_time_type_domain12907_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_time_type_domain12916 */
+static ANTLR3_BITWORD FOLLOW_set_in_time_type_domain12916_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_time_type_domain12916 = { FOLLOW_set_in_time_type_domain12916_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_time_type_domain12934 */
+static ANTLR3_BITWORD FOLLOW_set_in_time_type_domain12934_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_time_type_domain12934 = { FOLLOW_set_in_time_type_domain12934_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_283_in_time_type_domain12951 */
+static ANTLR3_BITWORD FOLLOW_283_in_time_type_domain12951_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_283_in_time_type_domain12951 = { FOLLOW_283_in_time_type_domain12951_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_400_in_time_type_domain12963 */
+static ANTLR3_BITWORD FOLLOW_400_in_time_type_domain12963_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_400_in_time_type_domain12963 = { FOLLOW_400_in_time_type_domain12963_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_270_in_time_type_domain12975 */
+static ANTLR3_BITWORD FOLLOW_270_in_time_type_domain12975_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_270_in_time_type_domain12975 = { FOLLOW_270_in_time_type_domain12975_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_399_in_time_type_domain12986 */
+static ANTLR3_BITWORD FOLLOW_399_in_time_type_domain12986_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_399_in_time_type_domain12986 = { FOLLOW_399_in_time_type_domain12986_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_360_in_time_type_domain12997 */
+static ANTLR3_BITWORD FOLLOW_360_in_time_type_domain12997_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_360_in_time_type_domain12997 = { FOLLOW_360_in_time_type_domain12997_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_409_in_time_type_domain13010 */
+static ANTLR3_BITWORD FOLLOW_409_in_time_type_domain13010_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_409_in_time_type_domain13010 = { FOLLOW_409_in_time_type_domain13010_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_202_in_section_model_of_computation13042 */
+static ANTLR3_BITWORD FOLLOW_202_in_section_model_of_computation13042_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_202_in_section_model_of_computation13042 = { FOLLOW_202_in_section_model_of_computation13042_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_222_in_section_routine13066 */
+static ANTLR3_BITWORD FOLLOW_222_in_section_routine13066_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x4000000000000000), ANTLR3_UINT64_LIT(0x0000800000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_222_in_section_routine13066 = { FOLLOW_222_in_section_routine13066_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_201_in_section_routine13073 */
+static ANTLR3_BITWORD FOLLOW_201_in_section_routine13073_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x4000000000000000), ANTLR3_UINT64_LIT(0x0000800000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_201_in_section_routine13073 = { FOLLOW_201_in_section_routine13073_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_model_in_section_routine13088 */
+static ANTLR3_BITWORD FOLLOW_def_routine_model_in_section_routine13088_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x4000000000000000), ANTLR3_UINT64_LIT(0x0000800000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_model_in_section_routine13088 = { FOLLOW_def_routine_model_in_section_routine13088_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_367_in_def_routine_model13107 */
+static ANTLR3_BITWORD FOLLOW_367_in_def_routine_model13107_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_367_in_def_routine_model13107 = { FOLLOW_367_in_def_routine_model13107_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_318_in_def_routine_model13114 */
+static ANTLR3_BITWORD FOLLOW_318_in_def_routine_model13114_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000800000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_318_in_def_routine_model13114 = { FOLLOW_318_in_def_routine_model13114_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_367_in_def_routine_model13127 */
+static ANTLR3_BITWORD FOLLOW_367_in_def_routine_model13127_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_367_in_def_routine_model13127 = { FOLLOW_367_in_def_routine_model13127_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_model_impl_in_def_routine_model13141 */
+static ANTLR3_BITWORD FOLLOW_def_routine_model_impl_in_def_routine_model13141_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_model_impl_in_def_routine_model13141 = { FOLLOW_def_routine_model_impl_in_def_routine_model13141_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_def_routine_model_impl13165 */
+static ANTLR3_BITWORD FOLLOW_ID_in_def_routine_model_impl13165_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_def_routine_model_impl13165 = { FOLLOW_ID_in_def_routine_model_impl13165_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_parameters_in_def_routine_model_impl13178 */
+static ANTLR3_BITWORD FOLLOW_def_routine_parameters_in_def_routine_model_impl13178_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_parameters_in_def_routine_model_impl13178 = { FOLLOW_def_routine_parameters_in_def_routine_model_impl13178_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_def_routine_model_impl13189 */
+static ANTLR3_BITWORD FOLLOW_set_in_def_routine_model_impl13189_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_def_routine_model_impl13189 = { FOLLOW_set_in_def_routine_model_impl13189_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_returns_in_def_routine_model_impl13200 */
+static ANTLR3_BITWORD FOLLOW_def_routine_returns_in_def_routine_model_impl13200_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_returns_in_def_routine_model_impl13200 = { FOLLOW_def_routine_returns_in_def_routine_model_impl13200_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_def_routine_model_impl13212 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_def_routine_model_impl13212_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_def_routine_model_impl13212 = { FOLLOW_block_statement_in_def_routine_model_impl13212_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_def_routine_parameters13233 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_def_routine_parameters13233_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000280), ANTLR3_UINT64_LIT(0x0000000000001000), ANTLR3_UINT64_LIT(0x0000005000000002), ANTLR3_UINT64_LIT(0xC26E000000000000), ANTLR3_UINT64_LIT(0x78E204800E00C168), ANTLR3_UINT64_LIT(0x006413600720A261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_def_routine_parameters13233 = { FOLLOW_LPAREN_in_def_routine_parameters13233_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_param_atom_in_def_routine_parameters13243 */
+static ANTLR3_BITWORD FOLLOW_def_routine_param_atom_in_def_routine_parameters13243_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_param_atom_in_def_routine_parameters13243 = { FOLLOW_def_routine_param_atom_in_def_routine_parameters13243_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_def_routine_parameters13255 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_def_routine_parameters13255_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000280), ANTLR3_UINT64_LIT(0x0000000000001000), ANTLR3_UINT64_LIT(0x0000005000000000), ANTLR3_UINT64_LIT(0xC26E000000000000), ANTLR3_UINT64_LIT(0x78E204800E00C168), ANTLR3_UINT64_LIT(0x006413600720A261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_def_routine_parameters13255 = { FOLLOW_COMMA_in_def_routine_parameters13255_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_param_atom_in_def_routine_parameters13257 */
+static ANTLR3_BITWORD FOLLOW_def_routine_param_atom_in_def_routine_parameters13257_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_param_atom_in_def_routine_parameters13257 = { FOLLOW_def_routine_param_atom_in_def_routine_parameters13257_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_def_routine_parameters13269 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_def_routine_parameters13269_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_def_routine_parameters13269 = { FOLLOW_RPAREN_in_def_routine_parameters13269_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_modifier_param_in_def_routine_param_atom13312 */
+static ANTLR3_BITWORD FOLLOW_modifier_param_in_def_routine_param_atom13312_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_modifier_param_in_def_routine_param_atom13312 = { FOLLOW_modifier_param_in_def_routine_param_atom13312_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_var_in_def_routine_param_atom13326 */
+static ANTLR3_BITWORD FOLLOW_type_var_in_def_routine_param_atom13326_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_type_var_in_def_routine_param_atom13326 = { FOLLOW_type_var_in_def_routine_param_atom13326_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_def_routine_param_atom13333 */
+static ANTLR3_BITWORD FOLLOW_ID_in_def_routine_param_atom13333_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000012), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_def_routine_param_atom13333 = { FOLLOW_ID_in_def_routine_param_atom13333_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_def_routine_param_atom13343 */
+static ANTLR3_BITWORD FOLLOW_ID_in_def_routine_param_atom13343_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000012), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_def_routine_param_atom13343 = { FOLLOW_ID_in_def_routine_param_atom13343_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_initial_value_in_def_routine_param_atom13369 */
+static ANTLR3_BITWORD FOLLOW_initial_value_in_def_routine_param_atom13369_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_initial_value_in_def_routine_param_atom13369 = { FOLLOW_initial_value_in_def_routine_param_atom13369_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_def_routine_returns13393 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_def_routine_returns13393_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000280), ANTLR3_UINT64_LIT(0x0000000000001000), ANTLR3_UINT64_LIT(0x0000005000000000), ANTLR3_UINT64_LIT(0xC26E000000000000), ANTLR3_UINT64_LIT(0x78E204800E00C168), ANTLR3_UINT64_LIT(0x006413600720A261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_def_routine_returns13393 = { FOLLOW_LPAREN_in_def_routine_returns13393_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_returns_atom_in_def_routine_returns13401 */
+static ANTLR3_BITWORD FOLLOW_def_routine_returns_atom_in_def_routine_returns13401_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_returns_atom_in_def_routine_returns13401 = { FOLLOW_def_routine_returns_atom_in_def_routine_returns13401_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_def_routine_returns13413 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_def_routine_returns13413_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000280), ANTLR3_UINT64_LIT(0x0000000000001000), ANTLR3_UINT64_LIT(0x0000005000000000), ANTLR3_UINT64_LIT(0xC26E000000000000), ANTLR3_UINT64_LIT(0x78E204800E00C168), ANTLR3_UINT64_LIT(0x006413600720A261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_def_routine_returns13413 = { FOLLOW_COMMA_in_def_routine_returns13413_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_returns_atom_in_def_routine_returns13415 */
+static ANTLR3_BITWORD FOLLOW_def_routine_returns_atom_in_def_routine_returns13415_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_returns_atom_in_def_routine_returns13415 = { FOLLOW_def_routine_returns_atom_in_def_routine_returns13415_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_def_routine_returns13424 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_def_routine_returns13424_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_def_routine_returns13424 = { FOLLOW_RPAREN_in_def_routine_returns13424_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_var_in_def_routine_returns13432 */
+static ANTLR3_BITWORD FOLLOW_type_var_in_def_routine_returns13432_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000012), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_type_var_in_def_routine_returns13432 = { FOLLOW_type_var_in_def_routine_returns13432_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_initial_value_in_def_routine_returns13438 */
+static ANTLR3_BITWORD FOLLOW_initial_value_in_def_routine_returns13438_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_initial_value_in_def_routine_returns13438 = { FOLLOW_initial_value_in_def_routine_returns13438_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_modifier_param_in_def_routine_returns_atom13491 */
+static ANTLR3_BITWORD FOLLOW_modifier_param_in_def_routine_returns_atom13491_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_modifier_param_in_def_routine_returns_atom13491 = { FOLLOW_modifier_param_in_def_routine_returns_atom13491_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_var_in_def_routine_returns_atom13505 */
+static ANTLR3_BITWORD FOLLOW_type_var_in_def_routine_returns_atom13505_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_type_var_in_def_routine_returns_atom13505 = { FOLLOW_type_var_in_def_routine_returns_atom13505_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_def_routine_returns_atom13512 */
+static ANTLR3_BITWORD FOLLOW_ID_in_def_routine_returns_atom13512_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000012), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_def_routine_returns_atom13512 = { FOLLOW_ID_in_def_routine_returns_atom13512_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_def_routine_returns_atom13522 */
+static ANTLR3_BITWORD FOLLOW_ID_in_def_routine_returns_atom13522_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000012), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_def_routine_returns_atom13522 = { FOLLOW_ID_in_def_routine_returns_atom13522_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_initial_value_in_def_routine_returns_atom13550 */
+static ANTLR3_BITWORD FOLLOW_initial_value_in_def_routine_returns_atom13550_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_initial_value_in_def_routine_returns_atom13550 = { FOLLOW_initial_value_in_def_routine_returns_atom13550_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_204_in_section_model_of_execution13574 */
+static ANTLR3_BITWORD FOLLOW_204_in_section_model_of_execution13574_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xE14A840000000000), ANTLR3_UINT64_LIT(0x0000001784000084), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000800000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_204_in_section_model_of_execution13574 = { FOLLOW_204_in_section_model_of_execution13574_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_moe_primitive_in_section_model_of_execution13579 */
+static ANTLR3_BITWORD FOLLOW_def_moe_primitive_in_section_model_of_execution13579_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xE14A840000000000), ANTLR3_UINT64_LIT(0x0000001784000084), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000800000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_moe_primitive_in_section_model_of_execution13579 = { FOLLOW_def_moe_primitive_in_section_model_of_execution13579_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_177_in_def_moe_primitive13600 */
+static ANTLR3_BITWORD FOLLOW_177_in_def_moe_primitive13600_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_177_in_def_moe_primitive13600 = { FOLLOW_177_in_def_moe_primitive13600_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_seq_in_def_moe_primitive13608 */
+static ANTLR3_BITWORD FOLLOW_def_routine_seq_in_def_moe_primitive13608_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_seq_in_def_moe_primitive13608 = { FOLLOW_def_routine_seq_in_def_moe_primitive13608_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_194_in_def_moe_primitive13614 */
+static ANTLR3_BITWORD FOLLOW_194_in_def_moe_primitive13614_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_194_in_def_moe_primitive13614 = { FOLLOW_194_in_def_moe_primitive13614_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_seq_in_def_moe_primitive13624 */
+static ANTLR3_BITWORD FOLLOW_def_routine_seq_in_def_moe_primitive13624_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_seq_in_def_moe_primitive13624 = { FOLLOW_def_routine_seq_in_def_moe_primitive13624_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_184_in_def_moe_primitive13630 */
+static ANTLR3_BITWORD FOLLOW_184_in_def_moe_primitive13630_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_184_in_def_moe_primitive13630 = { FOLLOW_184_in_def_moe_primitive13630_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_seq_in_def_moe_primitive13639 */
+static ANTLR3_BITWORD FOLLOW_def_routine_seq_in_def_moe_primitive13639_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_seq_in_def_moe_primitive13639 = { FOLLOW_def_routine_seq_in_def_moe_primitive13639_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_226_in_def_moe_primitive13646 */
+static ANTLR3_BITWORD FOLLOW_226_in_def_moe_primitive13646_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_226_in_def_moe_primitive13646 = { FOLLOW_226_in_def_moe_primitive13646_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_seq_in_def_moe_primitive13655 */
+static ANTLR3_BITWORD FOLLOW_def_routine_seq_in_def_moe_primitive13655_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_seq_in_def_moe_primitive13655 = { FOLLOW_def_routine_seq_in_def_moe_primitive13655_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_228_in_def_moe_primitive13661 */
+static ANTLR3_BITWORD FOLLOW_228_in_def_moe_primitive13661_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_228_in_def_moe_primitive13661 = { FOLLOW_228_in_def_moe_primitive13661_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_seq_in_def_moe_primitive13671 */
+static ANTLR3_BITWORD FOLLOW_def_routine_seq_in_def_moe_primitive13671_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_seq_in_def_moe_primitive13671 = { FOLLOW_def_routine_seq_in_def_moe_primitive13671_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_191_in_def_moe_primitive13678 */
+static ANTLR3_BITWORD FOLLOW_191_in_def_moe_primitive13678_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_191_in_def_moe_primitive13678 = { FOLLOW_191_in_def_moe_primitive13678_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_seq_in_def_moe_primitive13685 */
+static ANTLR3_BITWORD FOLLOW_def_routine_seq_in_def_moe_primitive13685_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_seq_in_def_moe_primitive13685 = { FOLLOW_def_routine_seq_in_def_moe_primitive13685_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_182_in_def_moe_primitive13691 */
+static ANTLR3_BITWORD FOLLOW_182_in_def_moe_primitive13691_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_182_in_def_moe_primitive13691 = { FOLLOW_182_in_def_moe_primitive13691_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_seq_in_def_moe_primitive13699 */
+static ANTLR3_BITWORD FOLLOW_def_routine_seq_in_def_moe_primitive13699_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_seq_in_def_moe_primitive13699 = { FOLLOW_def_routine_seq_in_def_moe_primitive13699_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_190_in_def_moe_primitive13706 */
+static ANTLR3_BITWORD FOLLOW_190_in_def_moe_primitive13706_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_190_in_def_moe_primitive13706 = { FOLLOW_190_in_def_moe_primitive13706_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_seq_in_def_moe_primitive13712 */
+static ANTLR3_BITWORD FOLLOW_def_routine_seq_in_def_moe_primitive13712_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_seq_in_def_moe_primitive13712 = { FOLLOW_def_routine_seq_in_def_moe_primitive13712_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_179_in_def_moe_primitive13718 */
+static ANTLR3_BITWORD FOLLOW_179_in_def_moe_primitive13718_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_179_in_def_moe_primitive13718 = { FOLLOW_179_in_def_moe_primitive13718_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_seq_in_def_moe_primitive13725 */
+static ANTLR3_BITWORD FOLLOW_def_routine_seq_in_def_moe_primitive13725_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_seq_in_def_moe_primitive13725 = { FOLLOW_def_routine_seq_in_def_moe_primitive13725_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_189_in_def_moe_primitive13732 */
+static ANTLR3_BITWORD FOLLOW_189_in_def_moe_primitive13732_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_189_in_def_moe_primitive13732 = { FOLLOW_189_in_def_moe_primitive13732_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_seq_in_def_moe_primitive13740 */
+static ANTLR3_BITWORD FOLLOW_def_routine_seq_in_def_moe_primitive13740_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_seq_in_def_moe_primitive13740 = { FOLLOW_def_routine_seq_in_def_moe_primitive13740_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_170_in_def_moe_primitive13746 */
+static ANTLR3_BITWORD FOLLOW_170_in_def_moe_primitive13746_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_170_in_def_moe_primitive13746 = { FOLLOW_170_in_def_moe_primitive13746_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_seq_in_def_moe_primitive13755 */
+static ANTLR3_BITWORD FOLLOW_def_routine_seq_in_def_moe_primitive13755_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_seq_in_def_moe_primitive13755 = { FOLLOW_def_routine_seq_in_def_moe_primitive13755_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_199_in_def_moe_primitive13762 */
+static ANTLR3_BITWORD FOLLOW_199_in_def_moe_primitive13762_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_199_in_def_moe_primitive13762 = { FOLLOW_199_in_def_moe_primitive13762_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_seq_in_def_moe_primitive13772 */
+static ANTLR3_BITWORD FOLLOW_def_routine_seq_in_def_moe_primitive13772_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_seq_in_def_moe_primitive13772 = { FOLLOW_def_routine_seq_in_def_moe_primitive13772_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_224_in_def_moe_primitive13778 */
+static ANTLR3_BITWORD FOLLOW_224_in_def_moe_primitive13778_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_224_in_def_moe_primitive13778 = { FOLLOW_224_in_def_moe_primitive13778_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_seq_in_def_moe_primitive13789 */
+static ANTLR3_BITWORD FOLLOW_def_routine_seq_in_def_moe_primitive13789_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_seq_in_def_moe_primitive13789 = { FOLLOW_def_routine_seq_in_def_moe_primitive13789_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_223_in_def_moe_primitive13795 */
+static ANTLR3_BITWORD FOLLOW_223_in_def_moe_primitive13795_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_223_in_def_moe_primitive13795 = { FOLLOW_223_in_def_moe_primitive13795_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_seq_in_def_moe_primitive13806 */
+static ANTLR3_BITWORD FOLLOW_def_routine_seq_in_def_moe_primitive13806_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_seq_in_def_moe_primitive13806 = { FOLLOW_def_routine_seq_in_def_moe_primitive13806_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_218_in_def_moe_primitive13813 */
+static ANTLR3_BITWORD FOLLOW_218_in_def_moe_primitive13813_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_218_in_def_moe_primitive13813 = { FOLLOW_218_in_def_moe_primitive13813_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_seq_in_def_moe_primitive13821 */
+static ANTLR3_BITWORD FOLLOW_def_routine_seq_in_def_moe_primitive13821_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_seq_in_def_moe_primitive13821 = { FOLLOW_def_routine_seq_in_def_moe_primitive13821_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_175_in_def_moe_primitive13828 */
+static ANTLR3_BITWORD FOLLOW_175_in_def_moe_primitive13828_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_175_in_def_moe_primitive13828 = { FOLLOW_175_in_def_moe_primitive13828_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_seq_in_def_moe_primitive13831 */
+static ANTLR3_BITWORD FOLLOW_def_routine_seq_in_def_moe_primitive13831_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_seq_in_def_moe_primitive13831 = { FOLLOW_def_routine_seq_in_def_moe_primitive13831_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_225_in_def_moe_primitive13837 */
+static ANTLR3_BITWORD FOLLOW_225_in_def_moe_primitive13837_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_225_in_def_moe_primitive13837 = { FOLLOW_225_in_def_moe_primitive13837_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_seq_in_def_moe_primitive13843 */
+static ANTLR3_BITWORD FOLLOW_def_routine_seq_in_def_moe_primitive13843_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_seq_in_def_moe_primitive13843 = { FOLLOW_def_routine_seq_in_def_moe_primitive13843_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_367_in_def_moe_primitive13851 */
+static ANTLR3_BITWORD FOLLOW_367_in_def_moe_primitive13851_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_367_in_def_moe_primitive13851 = { FOLLOW_367_in_def_moe_primitive13851_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_model_impl_in_def_moe_primitive13856 */
+static ANTLR3_BITWORD FOLLOW_def_routine_model_impl_in_def_moe_primitive13856_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_model_impl_in_def_moe_primitive13856 = { FOLLOW_def_routine_model_impl_in_def_moe_primitive13856_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_parameters_in_def_routine_seq13881 */
+static ANTLR3_BITWORD FOLLOW_def_routine_parameters_in_def_routine_seq13881_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_parameters_in_def_routine_seq13881 = { FOLLOW_def_routine_parameters_in_def_routine_seq13881_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_def_routine_seq13892 */
+static ANTLR3_BITWORD FOLLOW_set_in_def_routine_seq13892_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_def_routine_seq13892 = { FOLLOW_set_in_def_routine_seq13892_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_routine_returns_in_def_routine_seq13903 */
+static ANTLR3_BITWORD FOLLOW_def_routine_returns_in_def_routine_seq13903_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_def_routine_returns_in_def_routine_seq13903 = { FOLLOW_def_routine_returns_in_def_routine_seq13903_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_def_routine_seq13915 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_def_routine_seq13915_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_def_routine_seq13915 = { FOLLOW_block_statement_in_def_routine_seq13915_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_section_model_of_interaction13945 */
+static ANTLR3_BITWORD FOLLOW_set_in_section_model_of_interaction13945_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000030), ANTLR3_UINT64_LIT(0x0000400000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_section_model_of_interaction13945 = { FOLLOW_set_in_section_model_of_interaction13945_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_com_connect_in_section_model_of_interaction13960 */
+static ANTLR3_BITWORD FOLLOW_com_connect_in_section_model_of_interaction13960_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000030), ANTLR3_UINT64_LIT(0x0000400000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_com_connect_in_section_model_of_interaction13960 = { FOLLOW_com_connect_in_section_model_of_interaction13960_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_277_in_com_protocol13978 */
+static ANTLR3_BITWORD FOLLOW_277_in_com_protocol13978_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_277_in_com_protocol13978 = { FOLLOW_277_in_com_protocol13978_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_359_in_com_protocol13992 */
+static ANTLR3_BITWORD FOLLOW_359_in_com_protocol13992_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_359_in_com_protocol13992 = { FOLLOW_359_in_com_protocol13992_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_328_in_com_protocol14005 */
+static ANTLR3_BITWORD FOLLOW_328_in_com_protocol14005_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_328_in_com_protocol14005 = { FOLLOW_328_in_com_protocol14005_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_284_in_com_protocol14014 */
+static ANTLR3_BITWORD FOLLOW_284_in_com_protocol14014_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_284_in_com_protocol14014 = { FOLLOW_284_in_com_protocol14014_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_240_in_com_protocol14028 */
+static ANTLR3_BITWORD FOLLOW_240_in_com_protocol14028_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_240_in_com_protocol14028 = { FOLLOW_240_in_com_protocol14028_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_403_in_com_protocol14038 */
+static ANTLR3_BITWORD FOLLOW_403_in_com_protocol14038_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_403_in_com_protocol14038 = { FOLLOW_403_in_com_protocol14038_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_324_in_com_protocol14048 */
+static ANTLR3_BITWORD FOLLOW_324_in_com_protocol14048_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_324_in_com_protocol14048 = { FOLLOW_324_in_com_protocol14048_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_248_in_com_protocol14056 */
+static ANTLR3_BITWORD FOLLOW_248_in_com_protocol14056_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_248_in_com_protocol14056 = { FOLLOW_248_in_com_protocol14056_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_buffer_com_in_com_protocol14066 */
+static ANTLR3_BITWORD FOLLOW_buffer_com_in_com_protocol14066_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_buffer_com_in_com_protocol14066 = { FOLLOW_buffer_com_in_com_protocol14066_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_240_in_com_cast14083 */
+static ANTLR3_BITWORD FOLLOW_240_in_com_cast14083_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_240_in_com_cast14083 = { FOLLOW_240_in_com_cast14083_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_403_in_com_cast14093 */
+static ANTLR3_BITWORD FOLLOW_403_in_com_cast14093_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_403_in_com_cast14093 = { FOLLOW_403_in_com_cast14093_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_324_in_com_cast14103 */
+static ANTLR3_BITWORD FOLLOW_324_in_com_cast14103_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_324_in_com_cast14103 = { FOLLOW_324_in_com_cast14103_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_248_in_com_cast14111 */
+static ANTLR3_BITWORD FOLLOW_248_in_com_cast14111_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_248_in_com_cast14111 = { FOLLOW_248_in_com_cast14111_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_249_in_buffer_com14132 */
+static ANTLR3_BITWORD FOLLOW_249_in_buffer_com14132_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200000), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_249_in_buffer_com14132 = { FOLLOW_249_in_buffer_com14132_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COLON_in_buffer_com14139 */
+static ANTLR3_BITWORD FOLLOW_COLON_in_buffer_com14139_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0800000002000000), ANTLR3_UINT64_LIT(0x0024001000000260), ANTLR3_UINT64_LIT(0x0000000010000000) };
+static ANTLR3_BITSET_LIST FOLLOW_COLON_in_buffer_com14139 = { FOLLOW_COLON_in_buffer_com14139_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ref_buffer_in_buffer_com14150 */
+static ANTLR3_BITWORD FOLLOW_ref_buffer_in_buffer_com14150_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ref_buffer_in_buffer_com14150 = { FOLLOW_ref_buffer_in_buffer_com14150_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_buffer_in_buffer_com14165 */
+static ANTLR3_BITWORD FOLLOW_def_buffer_in_buffer_com14165_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_buffer_in_buffer_com14165 = { FOLLOW_def_buffer_in_buffer_com14165_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_buffer_com14187 */
+static ANTLR3_BITWORD FOLLOW_LT__in_buffer_com14187_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0800000002000000), ANTLR3_UINT64_LIT(0x0024001000000260), ANTLR3_UINT64_LIT(0x0000000010000000) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_buffer_com14187 = { FOLLOW_LT__in_buffer_com14187_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ref_buffer_in_buffer_com14200 */
+static ANTLR3_BITWORD FOLLOW_ref_buffer_in_buffer_com14200_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_ref_buffer_in_buffer_com14200 = { FOLLOW_ref_buffer_in_buffer_com14200_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_buffer_in_buffer_com14217 */
+static ANTLR3_BITWORD FOLLOW_def_buffer_in_buffer_com14217_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_buffer_in_buffer_com14217 = { FOLLOW_def_buffer_in_buffer_com14217_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_buffer_com14238 */
+static ANTLR3_BITWORD FOLLOW_GT_in_buffer_com14238_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_buffer_com14238 = { FOLLOW_GT_in_buffer_com14238_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_buffer_in_buffer_com14250 */
+static ANTLR3_BITWORD FOLLOW_def_buffer_in_buffer_com14250_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_buffer_in_buffer_com14250 = { FOLLOW_def_buffer_in_buffer_com14250_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_com_connect14276 */
+static ANTLR3_BITWORD FOLLOW_set_in_com_connect14276_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000002001) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_com_connect14276 = { FOLLOW_set_in_com_connect14276_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_com_connect14291 */
+static ANTLR3_BITWORD FOLLOW_LT__in_com_connect14291_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0301000000000000), ANTLR3_UINT64_LIT(0x0800000012200000), ANTLR3_UINT64_LIT(0x0024009000000370), ANTLR3_UINT64_LIT(0x0000000010080000) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_com_connect14291 = { FOLLOW_LT__in_com_connect14291_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_com_protocol_in_com_connect14298 */
+static ANTLR3_BITWORD FOLLOW_com_protocol_in_com_connect14298_bits[] = { ANTLR3_UINT64_LIT(0x0000200000800000) };
+static ANTLR3_BITSET_LIST FOLLOW_com_protocol_in_com_connect14298 = { FOLLOW_com_protocol_in_com_connect14298_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_com_connect14308 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_com_connect14308_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0101000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000010), ANTLR3_UINT64_LIT(0x0000000000080000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_com_connect14308 = { FOLLOW_COMMA_in_com_connect14308_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_com_cast_in_com_connect14310 */
+static ANTLR3_BITWORD FOLLOW_com_cast_in_com_connect14310_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_com_cast_in_com_connect14310 = { FOLLOW_com_cast_in_com_connect14310_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_com_connect14321 */
+static ANTLR3_BITWORD FOLLOW_GT_in_com_connect14321_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_com_connect14321 = { FOLLOW_GT_in_com_connect14321_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_com_connect14334 */
+static ANTLR3_BITWORD FOLLOW_ID_in_com_connect14334_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_com_connect14334 = { FOLLOW_ID_in_com_connect14334_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_com_connect14349 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_com_connect14349_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0002040000000000), ANTLR3_UINT64_LIT(0x0000100000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_com_connect14349 = { FOLLOW_LCURLY_in_com_connect14349_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_com_route_in_com_connect14356 */
+static ANTLR3_BITWORD FOLLOW_com_route_in_com_connect14356_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0002040000000000), ANTLR3_UINT64_LIT(0x0000100000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_com_route_in_com_connect14356 = { FOLLOW_com_route_in_com_connect14356_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_com_connect14365 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_com_connect14365_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_com_connect14365 = { FOLLOW_RCURLY_in_com_connect14365_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_366_in_com_connect14374 */
+static ANTLR3_BITWORD FOLLOW_366_in_com_connect14374_bits[] = { ANTLR3_UINT64_LIT(0x1004000000000000), ANTLR3_UINT64_LIT(0x0000000000002001), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0002040000000000), ANTLR3_UINT64_LIT(0x0000100000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_366_in_com_connect14374 = { FOLLOW_366_in_com_connect14374_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_com_connect14388 */
+static ANTLR3_BITWORD FOLLOW_LT__in_com_connect14388_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0301000000000000), ANTLR3_UINT64_LIT(0x0800000012200000), ANTLR3_UINT64_LIT(0x0024009000000370), ANTLR3_UINT64_LIT(0x0000000010080000) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_com_connect14388 = { FOLLOW_LT__in_com_connect14388_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_com_protocol_in_com_connect14395 */
+static ANTLR3_BITWORD FOLLOW_com_protocol_in_com_connect14395_bits[] = { ANTLR3_UINT64_LIT(0x0000200000800000) };
+static ANTLR3_BITSET_LIST FOLLOW_com_protocol_in_com_connect14395 = { FOLLOW_com_protocol_in_com_connect14395_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_com_connect14405 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_com_connect14405_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0101000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000010), ANTLR3_UINT64_LIT(0x0000000000080000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_com_connect14405 = { FOLLOW_COMMA_in_com_connect14405_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_com_cast_in_com_connect14407 */
+static ANTLR3_BITWORD FOLLOW_com_cast_in_com_connect14407_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_com_cast_in_com_connect14407 = { FOLLOW_com_cast_in_com_connect14407_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_com_connect14418 */
+static ANTLR3_BITWORD FOLLOW_GT_in_com_connect14418_bits[] = { ANTLR3_UINT64_LIT(0x1004000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0002040000000000), ANTLR3_UINT64_LIT(0x0000100000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_com_connect14418 = { FOLLOW_GT_in_com_connect14418_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_com_route_in_com_connect14432 */
+static ANTLR3_BITWORD FOLLOW_com_route_in_com_connect14432_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_com_route_in_com_connect14432 = { FOLLOW_com_route_in_com_connect14432_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_com_connect14441 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_com_connect14441_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0002040000000000), ANTLR3_UINT64_LIT(0x0000100000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_com_connect14441 = { FOLLOW_LCURLY_in_com_connect14441_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_com_route_in_com_connect14450 */
+static ANTLR3_BITWORD FOLLOW_com_route_in_com_connect14450_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0002040000000000), ANTLR3_UINT64_LIT(0x0000100000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_com_route_in_com_connect14450 = { FOLLOW_com_route_in_com_connect14450_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_com_connect14461 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_com_connect14461_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_com_connect14461 = { FOLLOW_RCURLY_in_com_connect14461_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LBRACKET_in_com_connect14469 */
+static ANTLR3_BITWORD FOLLOW_LBRACKET_in_com_connect14469_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000200) };
+static ANTLR3_BITSET_LIST FOLLOW_LBRACKET_in_com_connect14469 = { FOLLOW_LBRACKET_in_com_connect14469_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_com_port_in_com_connect14485 */
+static ANTLR3_BITWORD FOLLOW_com_port_in_com_connect14485_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_com_port_in_com_connect14485 = { FOLLOW_com_port_in_com_connect14485_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_com_connect14497 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_com_connect14497_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_com_connect14497 = { FOLLOW_COMMA_in_com_connect14497_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_com_port_in_com_connect14500 */
+static ANTLR3_BITWORD FOLLOW_com_port_in_com_connect14500_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_com_port_in_com_connect14500 = { FOLLOW_com_port_in_com_connect14500_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STAR_in_com_connect14514 */
+static ANTLR3_BITWORD FOLLOW_STAR_in_com_connect14514_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_STAR_in_com_connect14514 = { FOLLOW_STAR_in_com_connect14514_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RBRACKET_in_com_connect14535 */
+static ANTLR3_BITWORD FOLLOW_RBRACKET_in_com_connect14535_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_RBRACKET_in_com_connect14535 = { FOLLOW_RBRACKET_in_com_connect14535_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_com_connect14542 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_com_connect14542_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_com_connect14542 = { FOLLOW_SEMI_in_com_connect14542_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_modifier_set_direction_strict_text_in_com_route14570 */
+static ANTLR3_BITWORD FOLLOW_modifier_set_direction_strict_text_in_com_route14570_bits[] = { ANTLR3_UINT64_LIT(0x1004000000000000), ANTLR3_UINT64_LIT(0x0000000000002001) };
+static ANTLR3_BITSET_LIST FOLLOW_modifier_set_direction_strict_text_in_com_route14570 = { FOLLOW_modifier_set_direction_strict_text_in_com_route14570_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_com_route14578 */
+static ANTLR3_BITWORD FOLLOW_LT__in_com_route14578_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0301000000000000), ANTLR3_UINT64_LIT(0x0800000002000000), ANTLR3_UINT64_LIT(0x0024001000000270), ANTLR3_UINT64_LIT(0x0000000010080000) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_com_route14578 = { FOLLOW_LT__in_com_route14578_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_buffer_com_in_com_route14589 */
+static ANTLR3_BITWORD FOLLOW_buffer_com_in_com_route14589_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_buffer_com_in_com_route14589 = { FOLLOW_buffer_com_in_com_route14589_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_com_cast_in_com_route14606 */
+static ANTLR3_BITWORD FOLLOW_com_cast_in_com_route14606_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_com_cast_in_com_route14606 = { FOLLOW_com_cast_in_com_route14606_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_com_route14614 */
+static ANTLR3_BITWORD FOLLOW_GT_in_com_route14614_bits[] = { ANTLR3_UINT64_LIT(0x1004000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_com_route14614 = { FOLLOW_GT_in_com_route14614_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_com_port_in_com_route14625 */
+static ANTLR3_BITWORD FOLLOW_com_port_in_com_route14625_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_com_port_in_com_route14625 = { FOLLOW_com_port_in_com_route14625_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_com_route14629 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_com_route14629_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_com_route14629 = { FOLLOW_SEMI_in_com_route14629_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_com_route14637 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_com_route14637_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_com_route14637 = { FOLLOW_LCURLY_in_com_route14637_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_com_port_in_com_route14646 */
+static ANTLR3_BITWORD FOLLOW_com_port_in_com_route14646_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_com_port_in_com_route14646 = { FOLLOW_com_port_in_com_route14646_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_com_route14650 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_com_route14650_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_com_route14650 = { FOLLOW_SEMI_in_com_route14650_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_com_route14660 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_com_route14660_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_com_route14660 = { FOLLOW_RCURLY_in_com_route14660_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LBRACKET_in_com_route14668 */
+static ANTLR3_BITWORD FOLLOW_LBRACKET_in_com_route14668_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000200) };
+static ANTLR3_BITSET_LIST FOLLOW_LBRACKET_in_com_route14668 = { FOLLOW_LBRACKET_in_com_route14668_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_com_port_in_com_route14677 */
+static ANTLR3_BITWORD FOLLOW_com_port_in_com_route14677_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_com_port_in_com_route14677 = { FOLLOW_com_port_in_com_route14677_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_com_route14689 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_com_route14689_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_com_route14689 = { FOLLOW_COMMA_in_com_route14689_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_com_port_in_com_route14692 */
+static ANTLR3_BITWORD FOLLOW_com_port_in_com_route14692_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_com_port_in_com_route14692 = { FOLLOW_com_port_in_com_route14692_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STAR_in_com_route14706 */
+static ANTLR3_BITWORD FOLLOW_STAR_in_com_route14706_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_STAR_in_com_route14706 = { FOLLOW_STAR_in_com_route14706_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RBRACKET_in_com_route14727 */
+static ANTLR3_BITWORD FOLLOW_RBRACKET_in_com_route14727_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_RBRACKET_in_com_route14727 = { FOLLOW_RBRACKET_in_com_route14727_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_com_route14734 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_com_route14734_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_com_route14734 = { FOLLOW_SEMI_in_com_route14734_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_com_port_in_com_route14748 */
+static ANTLR3_BITWORD FOLLOW_com_port_in_com_route14748_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_com_port_in_com_route14748 = { FOLLOW_com_port_in_com_route14748_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_com_route14752 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_com_route14752_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_com_route14752 = { FOLLOW_SEMI_in_com_route14752_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_com_port14786 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_com_port14786_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000001000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_com_port14786 = { FOLLOW_qualifiedNameID_in_com_port14786_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_164_in_com_port14800 */
+static ANTLR3_BITWORD FOLLOW_164_in_com_port14800_bits[] = { ANTLR3_UINT64_LIT(0x1004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_164_in_com_port14800 = { FOLLOW_164_in_com_port14800_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_com_port_id_in_com_port14810 */
+static ANTLR3_BITWORD FOLLOW_com_port_id_in_com_port14810_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_com_port_id_in_com_port14810 = { FOLLOW_com_port_id_in_com_port14810_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LBRACKET_in_com_port14826 */
+static ANTLR3_BITWORD FOLLOW_LBRACKET_in_com_port14826_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000200) };
+static ANTLR3_BITSET_LIST FOLLOW_LBRACKET_in_com_port14826 = { FOLLOW_LBRACKET_in_com_port14826_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_com_port_id_in_com_port14837 */
+static ANTLR3_BITWORD FOLLOW_com_port_id_in_com_port14837_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_com_port_id_in_com_port14837 = { FOLLOW_com_port_id_in_com_port14837_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_com_port14859 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_com_port14859_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_com_port14859 = { FOLLOW_COMMA_in_com_port14859_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_com_port_id_in_com_port14864 */
+static ANTLR3_BITWORD FOLLOW_com_port_id_in_com_port14864_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_com_port_id_in_com_port14864 = { FOLLOW_com_port_id_in_com_port14864_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STAR_in_com_port14887 */
+static ANTLR3_BITWORD FOLLOW_STAR_in_com_port14887_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_STAR_in_com_port14887 = { FOLLOW_STAR_in_com_port14887_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RBRACKET_in_com_port14908 */
+static ANTLR3_BITWORD FOLLOW_RBRACKET_in_com_port14908_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RBRACKET_in_com_port14908 = { FOLLOW_RBRACKET_in_com_port14908_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_com_port_id_in_com_port14922 */
+static ANTLR3_BITWORD FOLLOW_com_port_id_in_com_port14922_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_com_port_id_in_com_port14922 = { FOLLOW_com_port_id_in_com_port14922_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_com_port_id14951 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_com_port_id14951_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_com_port_id14951 = { FOLLOW_qualifiedNameID_in_com_port_id14951_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_assign_in_statement14981 */
+static ANTLR3_BITWORD FOLLOW_statement_assign_in_statement14981_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_assign_in_statement14981 = { FOLLOW_statement_assign_in_statement14981_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_com_in_statement15002 */
+static ANTLR3_BITWORD FOLLOW_statement_com_in_statement15002_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_com_in_statement15002 = { FOLLOW_statement_com_in_statement15002_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_constraint_in_statement15025 */
+static ANTLR3_BITWORD FOLLOW_statement_constraint_in_statement15025_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_constraint_in_statement15025 = { FOLLOW_statement_constraint_in_statement15025_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_jump_in_statement15041 */
+static ANTLR3_BITWORD FOLLOW_statement_jump_in_statement15041_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_jump_in_statement15041 = { FOLLOW_statement_jump_in_statement15041_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_activity_in_statement15065 */
+static ANTLR3_BITWORD FOLLOW_statement_activity_in_statement15065_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_activity_in_statement15065 = { FOLLOW_statement_activity_in_statement15065_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_invoke_routine_in_statement15083 */
+static ANTLR3_BITWORD FOLLOW_statement_invoke_routine_in_statement15083_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_invoke_routine_in_statement15083 = { FOLLOW_statement_invoke_routine_in_statement15083_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_moc_in_statement15096 */
+static ANTLR3_BITWORD FOLLOW_statement_moc_in_statement15096_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_moc_in_statement15096 = { FOLLOW_statement_moc_in_statement15096_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_invoke_in_statement15120 */
+static ANTLR3_BITWORD FOLLOW_statement_invoke_in_statement15120_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_invoke_in_statement15120 = { FOLLOW_statement_invoke_in_statement15120_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_invoke_method_in_statement15140 */
+static ANTLR3_BITWORD FOLLOW_statement_invoke_method_in_statement15140_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_invoke_method_in_statement15140 = { FOLLOW_statement_invoke_method_in_statement15140_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_activity_new_in_statement15154 */
+static ANTLR3_BITWORD FOLLOW_statement_activity_new_in_statement15154_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_activity_new_in_statement15154 = { FOLLOW_statement_activity_new_in_statement15154_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_ite_in_statement15169 */
+static ANTLR3_BITWORD FOLLOW_statement_ite_in_statement15169_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_ite_in_statement15169 = { FOLLOW_statement_ite_in_statement15169_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_iteration_in_statement15192 */
+static ANTLR3_BITWORD FOLLOW_statement_iteration_in_statement15192_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_iteration_in_statement15192 = { FOLLOW_statement_iteration_in_statement15192_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_statement15212 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_statement15212_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_statement15212 = { FOLLOW_block_statement_in_statement15212_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_prefix_statement_in_statement15234 */
+static ANTLR3_BITWORD FOLLOW_prefix_statement_in_statement15234_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_prefix_statement_in_statement15234 = { FOLLOW_prefix_statement_in_statement15234_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_prompt_in_statement15255 */
+static ANTLR3_BITWORD FOLLOW_statement_prompt_in_statement15255_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_prompt_in_statement15255 = { FOLLOW_statement_prompt_in_statement15255_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_meta_statement_in_statement15276 */
+static ANTLR3_BITWORD FOLLOW_meta_statement_in_statement15276_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_meta_statement_in_statement15276 = { FOLLOW_meta_statement_in_statement15276_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_block_statement15317 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_block_statement15317_bits[] = { ANTLR3_UINT64_LIT(0x000C000104400000), ANTLR3_UINT64_LIT(0x2003FCFFFC000101), ANTLR3_UINT64_LIT(0x000000003C001000), ANTLR3_UINT64_LIT(0x0480100000000000), ANTLR3_UINT64_LIT(0x0103F97E24C83881), ANTLR3_UINT64_LIT(0x020B1C00003F0400), ANTLR3_UINT64_LIT(0x00000001800000A6) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_block_statement15317 = { FOLLOW_LCURLY_in_block_statement15317_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_op_block_in_block_statement15324 */
+static ANTLR3_BITWORD FOLLOW_op_block_in_block_statement15324_bits[] = { ANTLR3_UINT64_LIT(0x000C000104400000), ANTLR3_UINT64_LIT(0x2000000000000101), ANTLR3_UINT64_LIT(0x000000003C001000), ANTLR3_UINT64_LIT(0x0480100000000000), ANTLR3_UINT64_LIT(0x0103F97E24C83881), ANTLR3_UINT64_LIT(0x020B1C00003F0400), ANTLR3_UINT64_LIT(0x00000001800000A6) };
+static ANTLR3_BITSET_LIST FOLLOW_op_block_in_block_statement15324 = { FOLLOW_op_block_in_block_statement15324_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_in_block_statement15348 */
+static ANTLR3_BITWORD FOLLOW_statement_in_block_statement15348_bits[] = { ANTLR3_UINT64_LIT(0x000C000104400000), ANTLR3_UINT64_LIT(0x2000000000000101), ANTLR3_UINT64_LIT(0x000000003C001000), ANTLR3_UINT64_LIT(0x0480100000000000), ANTLR3_UINT64_LIT(0x0103F97E24C83881), ANTLR3_UINT64_LIT(0x020B1C00003F0400), ANTLR3_UINT64_LIT(0x00000001800000A6) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_in_block_statement15348 = { FOLLOW_statement_in_block_statement15348_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_block_statement15360 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_block_statement15360_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_block_statement15360 = { FOLLOW_RCURLY_in_block_statement15360_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_op_sequence_in_op_block15377 */
+static ANTLR3_BITWORD FOLLOW_op_sequence_in_op_block15377_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_op_sequence_in_op_block15377 = { FOLLOW_op_sequence_in_op_block15377_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_op_scheduling_in_op_block15389 */
+static ANTLR3_BITWORD FOLLOW_op_scheduling_in_op_block15389_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_op_scheduling_in_op_block15389 = { FOLLOW_op_scheduling_in_op_block15389_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_op_concurrency_in_op_block15399 */
+static ANTLR3_BITWORD FOLLOW_op_concurrency_in_op_block15399_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_op_concurrency_in_op_block15399 = { FOLLOW_op_concurrency_in_op_block15399_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_FORK_in_op_block15407 */
+static ANTLR3_BITWORD FOLLOW_OP_FORK_in_op_block15407_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_FORK_in_op_block15407 = { FOLLOW_OP_FORK_in_op_block15407_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_JOIN_in_op_block15423 */
+static ANTLR3_BITWORD FOLLOW_OP_JOIN_in_op_block15423_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_JOIN_in_op_block15423 = { FOLLOW_OP_JOIN_in_op_block15423_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_SEQUENCE_in_op_sequence15449 */
+static ANTLR3_BITWORD FOLLOW_OP_SEQUENCE_in_op_sequence15449_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_SEQUENCE_in_op_sequence15449 = { FOLLOW_OP_SEQUENCE_in_op_sequence15449_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_SEQUENCE_SIDE_in_op_sequence15464 */
+static ANTLR3_BITWORD FOLLOW_OP_SEQUENCE_SIDE_in_op_sequence15464_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_SEQUENCE_SIDE_in_op_sequence15464 = { FOLLOW_OP_SEQUENCE_SIDE_in_op_sequence15464_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_SEQUENCE_WEAK_in_op_sequence15474 */
+static ANTLR3_BITWORD FOLLOW_OP_SEQUENCE_WEAK_in_op_sequence15474_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_SEQUENCE_WEAK_in_op_sequence15474 = { FOLLOW_OP_SEQUENCE_WEAK_in_op_sequence15474_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_ATOMIC_SEQUENCE_in_op_sequence15485 */
+static ANTLR3_BITWORD FOLLOW_OP_ATOMIC_SEQUENCE_in_op_sequence15485_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_ATOMIC_SEQUENCE_in_op_sequence15485 = { FOLLOW_OP_ATOMIC_SEQUENCE_in_op_sequence15485_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_SCHEDULE_GT_in_op_scheduling15503 */
+static ANTLR3_BITWORD FOLLOW_OP_SCHEDULE_GT_in_op_scheduling15503_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_SCHEDULE_GT_in_op_scheduling15503 = { FOLLOW_OP_SCHEDULE_GT_in_op_scheduling15503_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_SCHEDULE_LT_in_op_scheduling15517 */
+static ANTLR3_BITWORD FOLLOW_OP_SCHEDULE_LT_in_op_scheduling15517_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_SCHEDULE_LT_in_op_scheduling15517 = { FOLLOW_OP_SCHEDULE_LT_in_op_scheduling15517_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_SCHEDULE_XOR_in_op_scheduling15531 */
+static ANTLR3_BITWORD FOLLOW_OP_SCHEDULE_XOR_in_op_scheduling15531_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_SCHEDULE_XOR_in_op_scheduling15531 = { FOLLOW_OP_SCHEDULE_XOR_in_op_scheduling15531_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_SCHEDULE_AND_THEN_in_op_scheduling15545 */
+static ANTLR3_BITWORD FOLLOW_OP_SCHEDULE_AND_THEN_in_op_scheduling15545_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_SCHEDULE_AND_THEN_in_op_scheduling15545 = { FOLLOW_OP_SCHEDULE_AND_THEN_in_op_scheduling15545_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_SCHEDULE_OR_ELSE_in_op_scheduling15553 */
+static ANTLR3_BITWORD FOLLOW_OP_SCHEDULE_OR_ELSE_in_op_scheduling15553_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_SCHEDULE_OR_ELSE_in_op_scheduling15553 = { FOLLOW_OP_SCHEDULE_OR_ELSE_in_op_scheduling15553_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_NON_DETERMINISM_in_op_scheduling15563 */
+static ANTLR3_BITWORD FOLLOW_OP_NON_DETERMINISM_in_op_scheduling15563_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_NON_DETERMINISM_in_op_scheduling15563 = { FOLLOW_OP_NON_DETERMINISM_in_op_scheduling15563_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_CONCURRENCY_ASYNC_in_op_concurrency15583 */
+static ANTLR3_BITWORD FOLLOW_OP_CONCURRENCY_ASYNC_in_op_concurrency15583_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_CONCURRENCY_ASYNC_in_op_concurrency15583 = { FOLLOW_OP_CONCURRENCY_ASYNC_in_op_concurrency15583_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_CONCURRENCY_AND_in_op_concurrency15601 */
+static ANTLR3_BITWORD FOLLOW_OP_CONCURRENCY_AND_in_op_concurrency15601_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_CONCURRENCY_AND_in_op_concurrency15601 = { FOLLOW_OP_CONCURRENCY_AND_in_op_concurrency15601_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_CONCURRENCY_OR_in_op_concurrency15621 */
+static ANTLR3_BITWORD FOLLOW_OP_CONCURRENCY_OR_in_op_concurrency15621_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_CONCURRENCY_OR_in_op_concurrency15621 = { FOLLOW_OP_CONCURRENCY_OR_in_op_concurrency15621_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_CONCURRENCY_INTERLEAVING_in_op_concurrency15642 */
+static ANTLR3_BITWORD FOLLOW_OP_CONCURRENCY_INTERLEAVING_in_op_concurrency15642_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_CONCURRENCY_INTERLEAVING_in_op_concurrency15642 = { FOLLOW_OP_CONCURRENCY_INTERLEAVING_in_op_concurrency15642_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_CONCURRENCY_PARALLEL_in_op_concurrency15653 */
+static ANTLR3_BITWORD FOLLOW_OP_CONCURRENCY_PARALLEL_in_op_concurrency15653_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_CONCURRENCY_PARALLEL_in_op_concurrency15653 = { FOLLOW_OP_CONCURRENCY_PARALLEL_in_op_concurrency15653_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_CONCURRENCY_RDV_ASYNC_in_op_concurrency15669 */
+static ANTLR3_BITWORD FOLLOW_OP_CONCURRENCY_RDV_ASYNC_in_op_concurrency15669_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_CONCURRENCY_RDV_ASYNC_in_op_concurrency15669 = { FOLLOW_OP_CONCURRENCY_RDV_ASYNC_in_op_concurrency15669_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_CONCURRENCY_RDV_AND_in_op_concurrency15683 */
+static ANTLR3_BITWORD FOLLOW_OP_CONCURRENCY_RDV_AND_in_op_concurrency15683_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_CONCURRENCY_RDV_AND_in_op_concurrency15683 = { FOLLOW_OP_CONCURRENCY_RDV_AND_in_op_concurrency15683_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_CONCURRENCY_RDV_OR_in_op_concurrency15699 */
+static ANTLR3_BITWORD FOLLOW_OP_CONCURRENCY_RDV_OR_in_op_concurrency15699_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_CONCURRENCY_RDV_OR_in_op_concurrency15699 = { FOLLOW_OP_CONCURRENCY_RDV_OR_in_op_concurrency15699_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_CONCURRENCY_RDV_INTERLEAVING_in_op_concurrency15716 */
+static ANTLR3_BITWORD FOLLOW_OP_CONCURRENCY_RDV_INTERLEAVING_in_op_concurrency15716_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_CONCURRENCY_RDV_INTERLEAVING_in_op_concurrency15716 = { FOLLOW_OP_CONCURRENCY_RDV_INTERLEAVING_in_op_concurrency15716_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_CONCURRENCY_RDV_PARALLEL_in_op_concurrency15723 */
+static ANTLR3_BITWORD FOLLOW_OP_CONCURRENCY_RDV_PARALLEL_in_op_concurrency15723_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_CONCURRENCY_RDV_PARALLEL_in_op_concurrency15723 = { FOLLOW_OP_CONCURRENCY_RDV_PARALLEL_in_op_concurrency15723_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_PLUS_in_op_invokable15746 */
+static ANTLR3_BITWORD FOLLOW_PLUS_in_op_invokable15746_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_PLUS_in_op_invokable15746 = { FOLLOW_PLUS_in_op_invokable15746_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_MINUS_in_op_invokable15766 */
+static ANTLR3_BITWORD FOLLOW_MINUS_in_op_invokable15766_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_MINUS_in_op_invokable15766 = { FOLLOW_MINUS_in_op_invokable15766_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STAR_in_op_invokable15785 */
+static ANTLR3_BITWORD FOLLOW_STAR_in_op_invokable15785_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_STAR_in_op_invokable15785 = { FOLLOW_STAR_in_op_invokable15785_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DIV_in_op_invokable15804 */
+static ANTLR3_BITWORD FOLLOW_DIV_in_op_invokable15804_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_DIV_in_op_invokable15804 = { FOLLOW_DIV_in_op_invokable15804_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_MOD_in_op_invokable15824 */
+static ANTLR3_BITWORD FOLLOW_MOD_in_op_invokable15824_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_MOD_in_op_invokable15824 = { FOLLOW_MOD_in_op_invokable15824_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_EQUAL_in_op_invokable15847 */
+static ANTLR3_BITWORD FOLLOW_EQUAL_in_op_invokable15847_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_EQUAL_in_op_invokable15847 = { FOLLOW_EQUAL_in_op_invokable15847_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_NEQUAL_in_op_invokable15865 */
+static ANTLR3_BITWORD FOLLOW_NEQUAL_in_op_invokable15865_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_NEQUAL_in_op_invokable15865 = { FOLLOW_NEQUAL_in_op_invokable15865_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEQUAL_in_op_invokable15883 */
+static ANTLR3_BITWORD FOLLOW_SEQUAL_in_op_invokable15883_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEQUAL_in_op_invokable15883 = { FOLLOW_SEQUAL_in_op_invokable15883_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_NSEQUAL_in_op_invokable15900 */
+static ANTLR3_BITWORD FOLLOW_NSEQUAL_in_op_invokable15900_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_NSEQUAL_in_op_invokable15900 = { FOLLOW_NSEQUAL_in_op_invokable15900_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_op_invokable15917 */
+static ANTLR3_BITWORD FOLLOW_GT_in_op_invokable15917_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_op_invokable15917 = { FOLLOW_GT_in_op_invokable15917_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GTE_in_op_invokable15938 */
+static ANTLR3_BITWORD FOLLOW_GTE_in_op_invokable15938_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_GTE_in_op_invokable15938 = { FOLLOW_GTE_in_op_invokable15938_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_op_invokable15958 */
+static ANTLR3_BITWORD FOLLOW_LT__in_op_invokable15958_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_op_invokable15958 = { FOLLOW_LT__in_op_invokable15958_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LTE_in_op_invokable15978 */
+static ANTLR3_BITWORD FOLLOW_LTE_in_op_invokable15978_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_LTE_in_op_invokable15978 = { FOLLOW_LTE_in_op_invokable15978_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LNOT_in_op_invokable15999 */
+static ANTLR3_BITWORD FOLLOW_LNOT_in_op_invokable15999_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_LNOT_in_op_invokable15999 = { FOLLOW_LNOT_in_op_invokable15999_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LAND_in_op_invokable16018 */
+static ANTLR3_BITWORD FOLLOW_LAND_in_op_invokable16018_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_LAND_in_op_invokable16018 = { FOLLOW_LAND_in_op_invokable16018_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LAND_THEN_in_op_invokable16037 */
+static ANTLR3_BITWORD FOLLOW_LAND_THEN_in_op_invokable16037_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_LAND_THEN_in_op_invokable16037 = { FOLLOW_LAND_THEN_in_op_invokable16037_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LOR_in_op_invokable16051 */
+static ANTLR3_BITWORD FOLLOW_LOR_in_op_invokable16051_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_LOR_in_op_invokable16051 = { FOLLOW_LOR_in_op_invokable16051_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LOR_ELSE_in_op_invokable16071 */
+static ANTLR3_BITWORD FOLLOW_LOR_ELSE_in_op_invokable16071_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_LOR_ELSE_in_op_invokable16071 = { FOLLOW_LOR_ELSE_in_op_invokable16071_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BNOT_in_op_invokable16087 */
+static ANTLR3_BITWORD FOLLOW_BNOT_in_op_invokable16087_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_BNOT_in_op_invokable16087 = { FOLLOW_BNOT_in_op_invokable16087_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BAND_in_op_invokable16106 */
+static ANTLR3_BITWORD FOLLOW_BAND_in_op_invokable16106_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_BAND_in_op_invokable16106 = { FOLLOW_BAND_in_op_invokable16106_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BOR_in_op_invokable16125 */
+static ANTLR3_BITWORD FOLLOW_BOR_in_op_invokable16125_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_BOR_in_op_invokable16125 = { FOLLOW_BOR_in_op_invokable16125_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BXOR_in_op_invokable16145 */
+static ANTLR3_BITWORD FOLLOW_BXOR_in_op_invokable16145_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_BXOR_in_op_invokable16145 = { FOLLOW_BXOR_in_op_invokable16145_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LSHIFT_in_op_invokable16165 */
+static ANTLR3_BITWORD FOLLOW_LSHIFT_in_op_invokable16165_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_LSHIFT_in_op_invokable16165 = { FOLLOW_LSHIFT_in_op_invokable16165_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RSHIFT_in_op_invokable16182 */
+static ANTLR3_BITWORD FOLLOW_RSHIFT_in_op_invokable16182_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RSHIFT_in_op_invokable16182 = { FOLLOW_RSHIFT_in_op_invokable16182_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSIGN_in_op_invokable16200 */
+static ANTLR3_BITWORD FOLLOW_ASSIGN_in_op_invokable16200_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ASSIGN_in_op_invokable16200 = { FOLLOW_ASSIGN_in_op_invokable16200_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSIGN_AFTER_in_op_invokable16217 */
+static ANTLR3_BITWORD FOLLOW_ASSIGN_AFTER_in_op_invokable16217_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ASSIGN_AFTER_in_op_invokable16217 = { FOLLOW_ASSIGN_AFTER_in_op_invokable16217_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSIGN_REF_in_op_invokable16228 */
+static ANTLR3_BITWORD FOLLOW_ASSIGN_REF_in_op_invokable16228_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ASSIGN_REF_in_op_invokable16228 = { FOLLOW_ASSIGN_REF_in_op_invokable16228_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSIGN_MACRO_in_op_invokable16241 */
+static ANTLR3_BITWORD FOLLOW_ASSIGN_MACRO_in_op_invokable16241_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ASSIGN_MACRO_in_op_invokable16241 = { FOLLOW_ASSIGN_MACRO_in_op_invokable16241_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_PUSH_in_op_invokable16253 */
+static ANTLR3_BITWORD FOLLOW_OP_PUSH_in_op_invokable16253_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_PUSH_in_op_invokable16253 = { FOLLOW_OP_PUSH_in_op_invokable16253_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_ASSIGN_TOP_in_op_invokable16269 */
+static ANTLR3_BITWORD FOLLOW_OP_ASSIGN_TOP_in_op_invokable16269_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_ASSIGN_TOP_in_op_invokable16269 = { FOLLOW_OP_ASSIGN_TOP_in_op_invokable16269_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_TOP_in_op_invokable16279 */
+static ANTLR3_BITWORD FOLLOW_OP_TOP_in_op_invokable16279_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_TOP_in_op_invokable16279 = { FOLLOW_OP_TOP_in_op_invokable16279_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_POP_in_op_invokable16296 */
+static ANTLR3_BITWORD FOLLOW_OP_POP_in_op_invokable16296_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_POP_in_op_invokable16296 = { FOLLOW_OP_POP_in_op_invokable16296_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DOLLAR_LCURLY_in_prefix_statement16327 */
+static ANTLR3_BITWORD FOLLOW_DOLLAR_LCURLY_in_prefix_statement16327_bits[] = { ANTLR3_UINT64_LIT(0x09046080100262F0), ANTLR3_UINT64_LIT(0x010403000264B24C), ANTLR3_UINT64_LIT(0x0000000000000308), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000013804081800), ANTLR3_UINT64_LIT(0x020B0C0000000000), ANTLR3_UINT64_LIT(0x0000000080000024) };
+static ANTLR3_BITSET_LIST FOLLOW_DOLLAR_LCURLY_in_prefix_statement16327 = { FOLLOW_DOLLAR_LCURLY_in_prefix_statement16327_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_avm_operator_in_prefix_statement16332 */
+static ANTLR3_BITWORD FOLLOW_avm_operator_in_prefix_statement16332_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x2124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_avm_operator_in_prefix_statement16332 = { FOLLOW_avm_operator_in_prefix_statement16332_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_prefix_statement_in_prefix_statement16346 */
+static ANTLR3_BITWORD FOLLOW_prefix_statement_in_prefix_statement16346_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x2124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_prefix_statement_in_prefix_statement16346 = { FOLLOW_prefix_statement_in_prefix_statement16346_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_unaryExpression_in_prefix_statement16367 */
+static ANTLR3_BITWORD FOLLOW_unaryExpression_in_prefix_statement16367_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x2124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_unaryExpression_in_prefix_statement16367 = { FOLLOW_unaryExpression_in_prefix_statement16367_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_prefix_statement16392 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_prefix_statement16392_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_prefix_statement16392 = { FOLLOW_RCURLY_in_prefix_statement16392_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DOLLAR_LCURLY_in_prefix_expression16407 */
+static ANTLR3_BITWORD FOLLOW_DOLLAR_LCURLY_in_prefix_expression16407_bits[] = { ANTLR3_UINT64_LIT(0x09046080100262F0), ANTLR3_UINT64_LIT(0x010403000264B24C), ANTLR3_UINT64_LIT(0x0000000000000308), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000013804081800), ANTLR3_UINT64_LIT(0x020B0C0000000000), ANTLR3_UINT64_LIT(0x0000000080000024) };
+static ANTLR3_BITSET_LIST FOLLOW_DOLLAR_LCURLY_in_prefix_expression16407 = { FOLLOW_DOLLAR_LCURLY_in_prefix_expression16407_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_avm_operator_in_prefix_expression16412 */
+static ANTLR3_BITWORD FOLLOW_avm_operator_in_prefix_expression16412_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x2124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_avm_operator_in_prefix_expression16412 = { FOLLOW_avm_operator_in_prefix_expression16412_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_prefix_expression_in_prefix_expression16426 */
+static ANTLR3_BITWORD FOLLOW_prefix_expression_in_prefix_expression16426_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x2124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_prefix_expression_in_prefix_expression16426 = { FOLLOW_prefix_expression_in_prefix_expression16426_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_unaryExpression_in_prefix_expression16446 */
+static ANTLR3_BITWORD FOLLOW_unaryExpression_in_prefix_expression16446_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x2124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_unaryExpression_in_prefix_expression16446 = { FOLLOW_unaryExpression_in_prefix_expression16446_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_prefix_expression16471 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_prefix_expression16471_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_prefix_expression16471 = { FOLLOW_RCURLY_in_prefix_expression16471_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_op_invokable_in_avm_operator16488 */
+static ANTLR3_BITWORD FOLLOW_op_invokable_in_avm_operator16488_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_op_invokable_in_avm_operator16488 = { FOLLOW_op_invokable_in_avm_operator16488_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_op_activity_in_avm_operator16500 */
+static ANTLR3_BITWORD FOLLOW_op_activity_in_avm_operator16500_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_op_activity_in_avm_operator16500 = { FOLLOW_op_activity_in_avm_operator16500_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_avm_operator16512 */
+static ANTLR3_BITWORD FOLLOW_ID_in_avm_operator16512_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_avm_operator16512 = { FOLLOW_ID_in_avm_operator16512_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_250_in_statement_invoke_method16541 */
+static ANTLR3_BITWORD FOLLOW_250_in_statement_invoke_method16541_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_250_in_statement_invoke_method16541 = { FOLLOW_250_in_statement_invoke_method16541_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_statement_invoke_method16545 */
+static ANTLR3_BITWORD FOLLOW_ID_in_statement_invoke_method16545_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000800000080), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_statement_invoke_method16545 = { FOLLOW_ID_in_statement_invoke_method16545_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_instance_machine_params_in_statement_invoke_method16556 */
+static ANTLR3_BITWORD FOLLOW_decl_instance_machine_params_in_statement_invoke_method16556_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000800000080), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_instance_machine_params_in_statement_invoke_method16556 = { FOLLOW_decl_instance_machine_params_in_statement_invoke_method16556_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_instance_machine_returns_in_statement_invoke_method16565 */
+static ANTLR3_BITWORD FOLLOW_decl_instance_machine_returns_in_statement_invoke_method16565_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_instance_machine_returns_in_statement_invoke_method16565 = { FOLLOW_decl_instance_machine_returns_in_statement_invoke_method16565_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_invoke_method16574 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_invoke_method16574_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_invoke_method16574 = { FOLLOW_SEMI_in_statement_invoke_method16574_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_INVOKE_in_statement_invoke16590 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_INVOKE_in_statement_invoke16590_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_INVOKE_in_statement_invoke16590 = { FOLLOW_LPAREN_INVOKE_in_statement_invoke16590_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_unaryExpression_in_statement_invoke16599 */
+static ANTLR3_BITWORD FOLLOW_unaryExpression_in_statement_invoke16599_bits[] = { ANTLR3_UINT64_LIT(0x09046080100262F0), ANTLR3_UINT64_LIT(0x010403000264B24C), ANTLR3_UINT64_LIT(0x0000000000000308), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000008000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_unaryExpression_in_statement_invoke16599 = { FOLLOW_unaryExpression_in_statement_invoke16599_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_statement_invoke16612 */
+static ANTLR3_BITWORD FOLLOW_ID_in_statement_invoke16612_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002042), ANTLR3_UINT64_LIT(0x0000600000000000), ANTLR3_UINT64_LIT(0x0200004081200201), ANTLR3_UINT64_LIT(0x0010000408801C00), ANTLR3_UINT64_LIT(0x0000000000002400) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_statement_invoke16612 = { FOLLOW_ID_in_statement_invoke16612_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_295_in_statement_invoke16634 */
+static ANTLR3_BITWORD FOLLOW_295_in_statement_invoke16634_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002042), ANTLR3_UINT64_LIT(0x0000600000000000), ANTLR3_UINT64_LIT(0x0200004081200201), ANTLR3_UINT64_LIT(0x0010000408801C00), ANTLR3_UINT64_LIT(0x0000000000002400) };
+static ANTLR3_BITSET_LIST FOLLOW_295_in_statement_invoke16634 = { FOLLOW_295_in_statement_invoke16634_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_op_invokable_in_statement_invoke16659 */
+static ANTLR3_BITWORD FOLLOW_op_invokable_in_statement_invoke16659_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002042), ANTLR3_UINT64_LIT(0x0000600000000000), ANTLR3_UINT64_LIT(0x0200004081200201), ANTLR3_UINT64_LIT(0x0010000408801C00), ANTLR3_UINT64_LIT(0x0000000000002400) };
+static ANTLR3_BITSET_LIST FOLLOW_op_invokable_in_statement_invoke16659 = { FOLLOW_op_invokable_in_statement_invoke16659_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_invoke16680 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_invoke16680_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002042), ANTLR3_UINT64_LIT(0x0000600000000000), ANTLR3_UINT64_LIT(0x0200004081200201), ANTLR3_UINT64_LIT(0x0010000408801C00), ANTLR3_UINT64_LIT(0x0000000000002400) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_invoke16680 = { FOLLOW_expression_in_statement_invoke16680_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_354_in_statement_invoke16698 */
+static ANTLR3_BITWORD FOLLOW_354_in_statement_invoke16698_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_354_in_statement_invoke16698 = { FOLLOW_354_in_statement_invoke16698_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_invoke16704 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_invoke16704_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_invoke16704 = { FOLLOW_expression_in_statement_invoke16704_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_287_in_statement_invoke16713 */
+static ANTLR3_BITWORD FOLLOW_287_in_statement_invoke16713_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_287_in_statement_invoke16713 = { FOLLOW_287_in_statement_invoke16713_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_unaryExpression_in_statement_invoke16723 */
+static ANTLR3_BITWORD FOLLOW_unaryExpression_in_statement_invoke16723_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_unaryExpression_in_statement_invoke16723 = { FOLLOW_unaryExpression_in_statement_invoke16723_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_394_in_statement_invoke16732 */
+static ANTLR3_BITWORD FOLLOW_394_in_statement_invoke16732_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_394_in_statement_invoke16732 = { FOLLOW_394_in_statement_invoke16732_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_unaryExpression_in_statement_invoke16744 */
+static ANTLR3_BITWORD FOLLOW_unaryExpression_in_statement_invoke16744_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_unaryExpression_in_statement_invoke16744 = { FOLLOW_unaryExpression_in_statement_invoke16744_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_238_in_statement_invoke16753 */
+static ANTLR3_BITWORD FOLLOW_238_in_statement_invoke16753_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000013804081800), ANTLR3_UINT64_LIT(0x020B0C0000000000), ANTLR3_UINT64_LIT(0x0000000080000024) };
+static ANTLR3_BITSET_LIST FOLLOW_238_in_statement_invoke16753 = { FOLLOW_238_in_statement_invoke16753_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_op_activity_in_statement_invoke16759 */
+static ANTLR3_BITWORD FOLLOW_op_activity_in_statement_invoke16759_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_op_activity_in_statement_invoke16759 = { FOLLOW_op_activity_in_statement_invoke16759_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_statement_invoke16772 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_statement_invoke16772_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_statement_invoke16772 = { FOLLOW_RPAREN_in_statement_invoke16772_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_invoke16777 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_invoke16777_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_invoke16777 = { FOLLOW_SEMI_in_statement_invoke16777_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_INVOKE_in_expression_invoke16792 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_INVOKE_in_expression_invoke16792_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_INVOKE_in_expression_invoke16792 = { FOLLOW_LPAREN_INVOKE_in_expression_invoke16792_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_unaryExpression_in_expression_invoke16801 */
+static ANTLR3_BITWORD FOLLOW_unaryExpression_in_expression_invoke16801_bits[] = { ANTLR3_UINT64_LIT(0x09046080100262F0), ANTLR3_UINT64_LIT(0x010403000264B24C), ANTLR3_UINT64_LIT(0x0000000000000308), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000008000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_unaryExpression_in_expression_invoke16801 = { FOLLOW_unaryExpression_in_expression_invoke16801_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_expression_invoke16815 */
+static ANTLR3_BITWORD FOLLOW_ID_in_expression_invoke16815_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002042), ANTLR3_UINT64_LIT(0x0000600000000000), ANTLR3_UINT64_LIT(0x0200004081200201), ANTLR3_UINT64_LIT(0x0010000408801C00), ANTLR3_UINT64_LIT(0x0000000000002400) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_expression_invoke16815 = { FOLLOW_ID_in_expression_invoke16815_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_295_in_expression_invoke16837 */
+static ANTLR3_BITWORD FOLLOW_295_in_expression_invoke16837_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002042), ANTLR3_UINT64_LIT(0x0000600000000000), ANTLR3_UINT64_LIT(0x0200004081200201), ANTLR3_UINT64_LIT(0x0010000408801C00), ANTLR3_UINT64_LIT(0x0000000000002400) };
+static ANTLR3_BITSET_LIST FOLLOW_295_in_expression_invoke16837 = { FOLLOW_295_in_expression_invoke16837_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_op_invokable_in_expression_invoke16862 */
+static ANTLR3_BITWORD FOLLOW_op_invokable_in_expression_invoke16862_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002042), ANTLR3_UINT64_LIT(0x0000600000000000), ANTLR3_UINT64_LIT(0x0200004081200201), ANTLR3_UINT64_LIT(0x0010000408801C00), ANTLR3_UINT64_LIT(0x0000000000002400) };
+static ANTLR3_BITSET_LIST FOLLOW_op_invokable_in_expression_invoke16862 = { FOLLOW_op_invokable_in_expression_invoke16862_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression_invoke16883 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression_invoke16883_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002042), ANTLR3_UINT64_LIT(0x0000600000000000), ANTLR3_UINT64_LIT(0x0200004081200201), ANTLR3_UINT64_LIT(0x0010000408801C00), ANTLR3_UINT64_LIT(0x0000000000002400) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression_invoke16883 = { FOLLOW_expression_in_expression_invoke16883_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_354_in_expression_invoke16901 */
+static ANTLR3_BITWORD FOLLOW_354_in_expression_invoke16901_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_354_in_expression_invoke16901 = { FOLLOW_354_in_expression_invoke16901_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression_invoke16907 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression_invoke16907_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression_invoke16907 = { FOLLOW_expression_in_expression_invoke16907_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_287_in_expression_invoke16916 */
+static ANTLR3_BITWORD FOLLOW_287_in_expression_invoke16916_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_287_in_expression_invoke16916 = { FOLLOW_287_in_expression_invoke16916_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_unaryExpression_in_expression_invoke16925 */
+static ANTLR3_BITWORD FOLLOW_unaryExpression_in_expression_invoke16925_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_unaryExpression_in_expression_invoke16925 = { FOLLOW_unaryExpression_in_expression_invoke16925_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_394_in_expression_invoke16934 */
+static ANTLR3_BITWORD FOLLOW_394_in_expression_invoke16934_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_394_in_expression_invoke16934 = { FOLLOW_394_in_expression_invoke16934_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_unaryExpression_in_expression_invoke16945 */
+static ANTLR3_BITWORD FOLLOW_unaryExpression_in_expression_invoke16945_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_unaryExpression_in_expression_invoke16945 = { FOLLOW_unaryExpression_in_expression_invoke16945_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_238_in_expression_invoke16954 */
+static ANTLR3_BITWORD FOLLOW_238_in_expression_invoke16954_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000013804081800), ANTLR3_UINT64_LIT(0x020B0C0000000000), ANTLR3_UINT64_LIT(0x0000000080000024) };
+static ANTLR3_BITSET_LIST FOLLOW_238_in_expression_invoke16954 = { FOLLOW_238_in_expression_invoke16954_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_op_activity_in_expression_invoke16960 */
+static ANTLR3_BITWORD FOLLOW_op_activity_in_expression_invoke16960_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_op_activity_in_expression_invoke16960 = { FOLLOW_op_activity_in_expression_invoke16960_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_expression_invoke16973 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_expression_invoke16973_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_expression_invoke16973 = { FOLLOW_RPAREN_in_expression_invoke16973_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_330_in_statement_activity_new17001 */
+static ANTLR3_BITWORD FOLLOW_330_in_statement_activity_new17001_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_330_in_statement_activity_new17001 = { FOLLOW_330_in_statement_activity_new17001_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_statement_activity_new17012 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_statement_activity_new17012_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000081), ANTLR3_UINT64_LIT(0x0000000800000080), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_statement_activity_new17012 = { FOLLOW_qualifiedNameID_in_statement_activity_new17012_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_decl_instance_dynamic_impl_in_statement_activity_new17027 */
+static ANTLR3_BITWORD FOLLOW_decl_instance_dynamic_impl_in_statement_activity_new17027_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000800000080), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_decl_instance_dynamic_impl_in_statement_activity_new17027 = { FOLLOW_decl_instance_dynamic_impl_in_statement_activity_new17027_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_statement_activity_new17036 */
+static ANTLR3_BITWORD FOLLOW_set_in_statement_activity_new17036_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_statement_activity_new17036 = { FOLLOW_set_in_statement_activity_new17036_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_activity_new17048 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_activity_new17048_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_activity_new17048 = { FOLLOW_expression_in_statement_activity_new17048_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_activity_new17060 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_activity_new17060_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_activity_new17060 = { FOLLOW_SEMI_in_statement_activity_new17060_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_decl_instance_dynamic_impl17093 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_decl_instance_dynamic_impl17093_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002042), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_decl_instance_dynamic_impl17093 = { FOLLOW_LPAREN_in_decl_instance_dynamic_impl17093_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_instance_on_new_activity_in_decl_instance_dynamic_impl17102 */
+static ANTLR3_BITWORD FOLLOW_def_instance_on_new_activity_in_decl_instance_dynamic_impl17102_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_instance_on_new_activity_in_decl_instance_dynamic_impl17102 = { FOLLOW_def_instance_on_new_activity_in_decl_instance_dynamic_impl17102_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_decl_instance_dynamic_impl17114 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_decl_instance_dynamic_impl17114_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_decl_instance_dynamic_impl17114 = { FOLLOW_RPAREN_in_decl_instance_dynamic_impl17114_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_decl_instance_dynamic_impl17136 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_decl_instance_dynamic_impl17136_bits[] = { ANTLR3_UINT64_LIT(0x000C000104400000), ANTLR3_UINT64_LIT(0x2000000000000101), ANTLR3_UINT64_LIT(0x000200003C001000), ANTLR3_UINT64_LIT(0x0480100400000000), ANTLR3_UINT64_LIT(0x0103F97E24C83881), ANTLR3_UINT64_LIT(0x020B1C00003F0400), ANTLR3_UINT64_LIT(0x00000001800000A6) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_decl_instance_dynamic_impl17136 = { FOLLOW_LCURLY_in_decl_instance_dynamic_impl17136_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_in_decl_instance_dynamic_impl17147 */
+static ANTLR3_BITWORD FOLLOW_statement_in_decl_instance_dynamic_impl17147_bits[] = { ANTLR3_UINT64_LIT(0x000C000104400000), ANTLR3_UINT64_LIT(0x2000000000000101), ANTLR3_UINT64_LIT(0x000200003C001000), ANTLR3_UINT64_LIT(0x0480100400000000), ANTLR3_UINT64_LIT(0x0103F97E24C83881), ANTLR3_UINT64_LIT(0x020B1C00003F0400), ANTLR3_UINT64_LIT(0x00000001800000A6) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_in_decl_instance_dynamic_impl17147 = { FOLLOW_statement_in_decl_instance_dynamic_impl17147_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_instance_activity_in_decl_instance_dynamic_impl17162 */
+static ANTLR3_BITWORD FOLLOW_def_instance_activity_in_decl_instance_dynamic_impl17162_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0002000000000000), ANTLR3_UINT64_LIT(0x0000000400000000) };
+static ANTLR3_BITSET_LIST FOLLOW_def_instance_activity_in_decl_instance_dynamic_impl17162 = { FOLLOW_def_instance_activity_in_decl_instance_dynamic_impl17162_bits, 4 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_decl_instance_dynamic_impl17173 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_decl_instance_dynamic_impl17173_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_decl_instance_dynamic_impl17173 = { FOLLOW_RCURLY_in_decl_instance_dynamic_impl17173_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_330_in_expression_activity_new17204 */
+static ANTLR3_BITWORD FOLLOW_330_in_expression_activity_new17204_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_330_in_expression_activity_new17204 = { FOLLOW_330_in_expression_activity_new17204_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_expression_activity_new17216 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_expression_activity_new17216_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_expression_activity_new17216 = { FOLLOW_qualifiedNameID_in_expression_activity_new17216_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_activity_machine_param_return_in_expression_activity_new17227 */
+static ANTLR3_BITWORD FOLLOW_activity_machine_param_return_in_expression_activity_new17227_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_activity_machine_param_return_in_expression_activity_new17227 = { FOLLOW_activity_machine_param_return_in_expression_activity_new17227_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STATEMENT_PROMPT_in_statement_prompt17251 */
+static ANTLR3_BITWORD FOLLOW_STATEMENT_PROMPT_in_statement_prompt17251_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_STATEMENT_PROMPT_in_statement_prompt17251 = { FOLLOW_STATEMENT_PROMPT_in_statement_prompt17251_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_prompt_impl_in_statement_prompt17256 */
+static ANTLR3_BITWORD FOLLOW_statement_prompt_impl_in_statement_prompt17256_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_prompt_impl_in_statement_prompt17256 = { FOLLOW_statement_prompt_impl_in_statement_prompt17256_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_prompt_obs_in_statement_prompt_impl17275 */
+static ANTLR3_BITWORD FOLLOW_statement_prompt_obs_in_statement_prompt_impl17275_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_prompt_obs_in_statement_prompt_impl17275 = { FOLLOW_statement_prompt_obs_in_statement_prompt_impl17275_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_statement_prompt_obs17300 */
+static ANTLR3_BITWORD FOLLOW_ID_in_statement_prompt_obs17300_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000400) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_statement_prompt_obs17300 = { FOLLOW_ID_in_statement_prompt_obs17300_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_266_in_statement_prompt_obs17308 */
+static ANTLR3_BITWORD FOLLOW_266_in_statement_prompt_obs17308_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_266_in_statement_prompt_obs17308 = { FOLLOW_266_in_statement_prompt_obs17308_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_statement_prompt_obs17312 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_statement_prompt_obs17312_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_statement_prompt_obs17312 = { FOLLOW_qualifiedNameID_in_statement_prompt_obs17312_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_statement_prompt_obs17329 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_statement_prompt_obs17329_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0003F80000000000), ANTLR3_UINT64_LIT(0x00000000003F0000) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_statement_prompt_obs17329 = { FOLLOW_LCURLY_in_statement_prompt_obs17329_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_prompt_obs_com_in_statement_prompt_obs17338 */
+static ANTLR3_BITWORD FOLLOW_statement_prompt_obs_com_in_statement_prompt_obs17338_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_prompt_obs_com_in_statement_prompt_obs17338 = { FOLLOW_statement_prompt_obs_com_in_statement_prompt_obs17338_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_statement_prompt_obs17344 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_statement_prompt_obs17344_bits[] = { ANTLR3_UINT64_LIT(0x1000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000400000000) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_statement_prompt_obs17344 = { FOLLOW_RCURLY_in_statement_prompt_obs17344_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_354_in_statement_prompt_obs17352 */
+static ANTLR3_BITWORD FOLLOW_354_in_statement_prompt_obs17352_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_354_in_statement_prompt_obs17352 = { FOLLOW_354_in_statement_prompt_obs17352_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_prompt_obs17356 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_prompt_obs17356_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_prompt_obs17356 = { FOLLOW_expression_in_statement_prompt_obs17356_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LBRACKET_in_statement_prompt_obs17363 */
+static ANTLR3_BITWORD FOLLOW_LBRACKET_in_statement_prompt_obs17363_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LBRACKET_in_statement_prompt_obs17363 = { FOLLOW_LBRACKET_in_statement_prompt_obs17363_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_prompt_obs17367 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_prompt_obs17367_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_prompt_obs17367 = { FOLLOW_expression_in_statement_prompt_obs17367_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RBRACKET_in_statement_prompt_obs17369 */
+static ANTLR3_BITWORD FOLLOW_RBRACKET_in_statement_prompt_obs17369_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_RBRACKET_in_statement_prompt_obs17369 = { FOLLOW_RBRACKET_in_statement_prompt_obs17369_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_prompt_obs17379 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_prompt_obs17379_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_prompt_obs17379 = { FOLLOW_SEMI_in_statement_prompt_obs17379_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_com_in_statement_prompt_obs_com17404 */
+static ANTLR3_BITWORD FOLLOW_statement_com_in_statement_prompt_obs_com17404_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_com_in_statement_prompt_obs_com17404 = { FOLLOW_statement_com_in_statement_prompt_obs_com17404_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_156_in_meta_statement17427 */
+static ANTLR3_BITWORD FOLLOW_156_in_meta_statement17427_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_156_in_meta_statement17427 = { FOLLOW_156_in_meta_statement17427_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_meta_statement17432 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_meta_statement17432_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_meta_statement17432 = { FOLLOW_block_statement_in_meta_statement17432_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_157_in_meta_statement17440 */
+static ANTLR3_BITWORD FOLLOW_157_in_meta_statement17440_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_157_in_meta_statement17440 = { FOLLOW_157_in_meta_statement17440_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_meta_statement17448 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_meta_statement17448_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_meta_statement17448 = { FOLLOW_block_statement_in_meta_statement17448_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_155_in_meta_statement17456 */
+static ANTLR3_BITWORD FOLLOW_155_in_meta_statement17456_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_155_in_meta_statement17456 = { FOLLOW_155_in_meta_statement17456_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_meta_statement17464 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_meta_statement17464_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_meta_statement17464 = { FOLLOW_block_statement_in_meta_statement17464_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_154_in_meta_statement17472 */
+static ANTLR3_BITWORD FOLLOW_154_in_meta_statement17472_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_154_in_meta_statement17472 = { FOLLOW_154_in_meta_statement17472_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_meta_statement17478 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_meta_statement17478_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_meta_statement17478 = { FOLLOW_block_statement_in_meta_statement17478_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_lvalue_in_statement_assign17510 */
+static ANTLR3_BITWORD FOLLOW_lvalue_in_statement_assign17510_bits[] = { ANTLR3_UINT64_LIT(0x06080000640D8CF0), ANTLR3_UINT64_LIT(0x06040300021B0C30), ANTLR3_UINT64_LIT(0x0000000000000C30) };
+static ANTLR3_BITSET_LIST FOLLOW_lvalue_in_statement_assign17510 = { FOLLOW_lvalue_in_statement_assign17510_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_statement_assign17515 */
+static ANTLR3_BITWORD FOLLOW_set_in_statement_assign17515_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_statement_assign17515 = { FOLLOW_set_in_statement_assign17515_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_assign17528 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_assign17528_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_assign17528 = { FOLLOW_expression_in_statement_assign17528_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_assign17531 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_assign17531_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_assign17531 = { FOLLOW_SEMI_in_statement_assign17531_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSIGN_REF_in_statement_assign17542 */
+static ANTLR3_BITWORD FOLLOW_ASSIGN_REF_in_statement_assign17542_bits[] = { ANTLR3_UINT64_LIT(0x0004000000400000) };
+static ANTLR3_BITSET_LIST FOLLOW_ASSIGN_REF_in_statement_assign17542 = { FOLLOW_ASSIGN_REF_in_statement_assign17542_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_lvalue_in_statement_assign17547 */
+static ANTLR3_BITWORD FOLLOW_lvalue_in_statement_assign17547_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_lvalue_in_statement_assign17547 = { FOLLOW_lvalue_in_statement_assign17547_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_assign17550 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_assign17550_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_assign17550 = { FOLLOW_SEMI_in_statement_assign17550_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSIGN_MACRO_in_statement_assign17559 */
+static ANTLR3_BITWORD FOLLOW_ASSIGN_MACRO_in_statement_assign17559_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_ASSIGN_MACRO_in_statement_assign17559 = { FOLLOW_ASSIGN_MACRO_in_statement_assign17559_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_assign17564 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_assign17564_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_assign17564 = { FOLLOW_expression_in_statement_assign17564_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_assign17567 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_assign17567_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_assign17567 = { FOLLOW_SEMI_in_statement_assign17567_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_statement_assign17577 */
+static ANTLR3_BITWORD FOLLOW_set_in_statement_assign17577_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_statement_assign17577 = { FOLLOW_set_in_statement_assign17577_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_assign17590 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_assign17590_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_assign17590 = { FOLLOW_expression_in_statement_assign17590_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_assign17593 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_assign17593_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_assign17593 = { FOLLOW_SEMI_in_statement_assign17593_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_statement_assign17602 */
+static ANTLR3_BITWORD FOLLOW_set_in_statement_assign17602_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_statement_assign17602 = { FOLLOW_set_in_statement_assign17602_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_assign17615 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_assign17615_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_assign17615 = { FOLLOW_expression_in_statement_assign17615_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_assign17618 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_assign17618_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_assign17618 = { FOLLOW_SEMI_in_statement_assign17618_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_statement_assign17627 */
+static ANTLR3_BITWORD FOLLOW_set_in_statement_assign17627_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_statement_assign17627 = { FOLLOW_set_in_statement_assign17627_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_assign17640 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_assign17640_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_assign17640 = { FOLLOW_expression_in_statement_assign17640_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_assign17643 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_assign17643_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_assign17643 = { FOLLOW_SEMI_in_statement_assign17643_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_statement_assign17652 */
+static ANTLR3_BITWORD FOLLOW_set_in_statement_assign17652_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_statement_assign17652 = { FOLLOW_set_in_statement_assign17652_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_assign17665 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_assign17665_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_assign17665 = { FOLLOW_expression_in_statement_assign17665_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_assign17668 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_assign17668_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_assign17668 = { FOLLOW_SEMI_in_statement_assign17668_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_statement_assign17677 */
+static ANTLR3_BITWORD FOLLOW_set_in_statement_assign17677_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_statement_assign17677 = { FOLLOW_set_in_statement_assign17677_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_assign17690 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_assign17690_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_assign17690 = { FOLLOW_expression_in_statement_assign17690_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_assign17693 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_assign17693_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_assign17693 = { FOLLOW_SEMI_in_statement_assign17693_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_statement_assign17703 */
+static ANTLR3_BITWORD FOLLOW_set_in_statement_assign17703_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_statement_assign17703 = { FOLLOW_set_in_statement_assign17703_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_assign17716 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_assign17716_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_assign17716 = { FOLLOW_expression_in_statement_assign17716_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_assign17719 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_assign17719_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_assign17719 = { FOLLOW_SEMI_in_statement_assign17719_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_statement_assign17728 */
+static ANTLR3_BITWORD FOLLOW_set_in_statement_assign17728_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_statement_assign17728 = { FOLLOW_set_in_statement_assign17728_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_assign17741 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_assign17741_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_assign17741 = { FOLLOW_expression_in_statement_assign17741_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_assign17744 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_assign17744_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_assign17744 = { FOLLOW_SEMI_in_statement_assign17744_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_statement_assign17754 */
+static ANTLR3_BITWORD FOLLOW_set_in_statement_assign17754_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_statement_assign17754 = { FOLLOW_set_in_statement_assign17754_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_assign17767 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_assign17767_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_assign17767 = { FOLLOW_expression_in_statement_assign17767_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_assign17770 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_assign17770_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_assign17770 = { FOLLOW_SEMI_in_statement_assign17770_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_statement_assign17779 */
+static ANTLR3_BITWORD FOLLOW_set_in_statement_assign17779_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_statement_assign17779 = { FOLLOW_set_in_statement_assign17779_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_assign17792 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_assign17792_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_assign17792 = { FOLLOW_expression_in_statement_assign17792_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_assign17795 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_assign17795_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_assign17795 = { FOLLOW_SEMI_in_statement_assign17795_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_statement_assign17804 */
+static ANTLR3_BITWORD FOLLOW_set_in_statement_assign17804_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_statement_assign17804 = { FOLLOW_set_in_statement_assign17804_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_assign17817 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_assign17817_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_assign17817 = { FOLLOW_expression_in_statement_assign17817_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_assign17820 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_assign17820_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_assign17820 = { FOLLOW_SEMI_in_statement_assign17820_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_statement_assign17830 */
+static ANTLR3_BITWORD FOLLOW_set_in_statement_assign17830_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_statement_assign17830 = { FOLLOW_set_in_statement_assign17830_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_assign17843 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_assign17843_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_assign17843 = { FOLLOW_expression_in_statement_assign17843_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_assign17846 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_assign17846_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_assign17846 = { FOLLOW_SEMI_in_statement_assign17846_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_statement_assign17855 */
+static ANTLR3_BITWORD FOLLOW_set_in_statement_assign17855_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_statement_assign17855 = { FOLLOW_set_in_statement_assign17855_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_assign17868 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_assign17868_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_assign17868 = { FOLLOW_expression_in_statement_assign17868_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_assign17871 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_assign17871_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_assign17871 = { FOLLOW_SEMI_in_statement_assign17871_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_PUSH_in_statement_assign17887 */
+static ANTLR3_BITWORD FOLLOW_OP_PUSH_in_statement_assign17887_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_PUSH_in_statement_assign17887 = { FOLLOW_OP_PUSH_in_statement_assign17887_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_assign17892 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_assign17892_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000020000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_assign17892 = { FOLLOW_expression_in_statement_assign17892_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_PUSH_in_statement_assign17902 */
+static ANTLR3_BITWORD FOLLOW_OP_PUSH_in_statement_assign17902_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_PUSH_in_statement_assign17902 = { FOLLOW_OP_PUSH_in_statement_assign17902_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_assign17907 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_assign17907_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000020000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_assign17907 = { FOLLOW_expression_in_statement_assign17907_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_assign17918 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_assign17918_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_assign17918 = { FOLLOW_SEMI_in_statement_assign17918_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_ASSIGN_TOP_in_statement_assign17930 */
+static ANTLR3_BITWORD FOLLOW_OP_ASSIGN_TOP_in_statement_assign17930_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_ASSIGN_TOP_in_statement_assign17930 = { FOLLOW_OP_ASSIGN_TOP_in_statement_assign17930_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_assign17935 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_assign17935_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_assign17935 = { FOLLOW_expression_in_statement_assign17935_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_assign17938 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_assign17938_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_assign17938 = { FOLLOW_SEMI_in_statement_assign17938_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_TOP_in_statement_assign17953 */
+static ANTLR3_BITWORD FOLLOW_OP_TOP_in_statement_assign17953_bits[] = { ANTLR3_UINT64_LIT(0x0004000000400000) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_TOP_in_statement_assign17953 = { FOLLOW_OP_TOP_in_statement_assign17953_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_lvalue_in_statement_assign17958 */
+static ANTLR3_BITWORD FOLLOW_lvalue_in_statement_assign17958_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_lvalue_in_statement_assign17958 = { FOLLOW_lvalue_in_statement_assign17958_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_assign17961 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_assign17961_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_assign17961 = { FOLLOW_SEMI_in_statement_assign17961_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_POP_in_statement_assign17976 */
+static ANTLR3_BITWORD FOLLOW_OP_POP_in_statement_assign17976_bits[] = { ANTLR3_UINT64_LIT(0x0004000000400000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_POP_in_statement_assign17976 = { FOLLOW_OP_POP_in_statement_assign17976_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_lvalue_in_statement_assign17992 */
+static ANTLR3_BITWORD FOLLOW_lvalue_in_statement_assign17992_bits[] = { ANTLR3_UINT64_LIT(0x0004000000400000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_lvalue_in_statement_assign17992 = { FOLLOW_lvalue_in_statement_assign17992_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_assign18003 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_assign18003_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_assign18003 = { FOLLOW_SEMI_in_statement_assign18003_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INCR_in_statement_assign18011 */
+static ANTLR3_BITWORD FOLLOW_INCR_in_statement_assign18011_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_INCR_in_statement_assign18011 = { FOLLOW_INCR_in_statement_assign18011_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_assign18014 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_assign18014_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_assign18014 = { FOLLOW_SEMI_in_statement_assign18014_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DECR_in_statement_assign18025 */
+static ANTLR3_BITWORD FOLLOW_DECR_in_statement_assign18025_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_DECR_in_statement_assign18025 = { FOLLOW_DECR_in_statement_assign18025_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_assign18028 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_assign18028_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_assign18028 = { FOLLOW_SEMI_in_statement_assign18028_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INCR_in_statement_assign18048 */
+static ANTLR3_BITWORD FOLLOW_INCR_in_statement_assign18048_bits[] = { ANTLR3_UINT64_LIT(0x0004000000400000) };
+static ANTLR3_BITSET_LIST FOLLOW_INCR_in_statement_assign18048 = { FOLLOW_INCR_in_statement_assign18048_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_lvalue_in_statement_assign18053 */
+static ANTLR3_BITWORD FOLLOW_lvalue_in_statement_assign18053_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_lvalue_in_statement_assign18053 = { FOLLOW_lvalue_in_statement_assign18053_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_assign18056 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_assign18056_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_assign18056 = { FOLLOW_SEMI_in_statement_assign18056_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DECR_in_statement_assign18067 */
+static ANTLR3_BITWORD FOLLOW_DECR_in_statement_assign18067_bits[] = { ANTLR3_UINT64_LIT(0x0004000000400000) };
+static ANTLR3_BITSET_LIST FOLLOW_DECR_in_statement_assign18067 = { FOLLOW_DECR_in_statement_assign18067_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_lvalue_in_statement_assign18072 */
+static ANTLR3_BITWORD FOLLOW_lvalue_in_statement_assign18072_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_lvalue_in_statement_assign18072 = { FOLLOW_lvalue_in_statement_assign18072_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_assign18075 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_assign18075_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_assign18075 = { FOLLOW_SEMI_in_statement_assign18075_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COLONx2_in_lvalue18100 */
+static ANTLR3_BITWORD FOLLOW_COLONx2_in_lvalue18100_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_COLONx2_in_lvalue18100 = { FOLLOW_COLONx2_in_lvalue18100_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_lvalue18112 */
+static ANTLR3_BITWORD FOLLOW_ID_in_lvalue18112_bits[] = { ANTLR3_UINT64_LIT(0x1000000200000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_lvalue18112 = { FOLLOW_ID_in_lvalue18112_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DOT_in_lvalue18127 */
+static ANTLR3_BITWORD FOLLOW_DOT_in_lvalue18127_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_DOT_in_lvalue18127 = { FOLLOW_DOT_in_lvalue18127_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_lvalue18131 */
+static ANTLR3_BITWORD FOLLOW_ID_in_lvalue18131_bits[] = { ANTLR3_UINT64_LIT(0x1000000200000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_lvalue18131 = { FOLLOW_ID_in_lvalue18131_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LBRACKET_in_lvalue18150 */
+static ANTLR3_BITWORD FOLLOW_LBRACKET_in_lvalue18150_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LBRACKET_in_lvalue18150 = { FOLLOW_LBRACKET_in_lvalue18150_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_lvalue18155 */
+static ANTLR3_BITWORD FOLLOW_expression_in_lvalue18155_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_lvalue18155 = { FOLLOW_expression_in_lvalue18155_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RBRACKET_in_lvalue18158 */
+static ANTLR3_BITWORD FOLLOW_RBRACKET_in_lvalue18158_bits[] = { ANTLR3_UINT64_LIT(0x1000000200000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RBRACKET_in_lvalue18158 = { FOLLOW_RBRACKET_in_lvalue18158_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_parameters18239 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_parameters18239_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_parameters18239 = { FOLLOW_LPAREN_in_parameters18239_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_parameters18244 */
+static ANTLR3_BITWORD FOLLOW_expression_in_parameters18244_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_parameters18244 = { FOLLOW_expression_in_parameters18244_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_parameters18254 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_parameters18254_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_parameters18254 = { FOLLOW_COMMA_in_parameters18254_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_parameters18258 */
+static ANTLR3_BITWORD FOLLOW_expression_in_parameters18258_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_parameters18258 = { FOLLOW_expression_in_parameters18258_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_parameters18270 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_parameters18270_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_parameters18270 = { FOLLOW_RPAREN_in_parameters18270_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_com_input_in_statement_com18292 */
+static ANTLR3_BITWORD FOLLOW_statement_com_input_in_statement_com18292_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_com_input_in_statement_com18292 = { FOLLOW_statement_com_input_in_statement_com18292_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_com_output_in_statement_com18303 */
+static ANTLR3_BITWORD FOLLOW_statement_com_output_in_statement_com18303_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_com_output_in_statement_com18303 = { FOLLOW_statement_com_output_in_statement_com18303_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_305_in_statement_com_input18329 */
+static ANTLR3_BITWORD FOLLOW_305_in_statement_com_input18329_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_305_in_statement_com_input18329 = { FOLLOW_305_in_statement_com_input18329_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_303_in_statement_com_input18347 */
+static ANTLR3_BITWORD FOLLOW_303_in_statement_com_input18347_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_303_in_statement_com_input18347 = { FOLLOW_303_in_statement_com_input18347_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_304_in_statement_com_input18360 */
+static ANTLR3_BITWORD FOLLOW_304_in_statement_com_input18360_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_304_in_statement_com_input18360 = { FOLLOW_304_in_statement_com_input18360_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_301_in_statement_com_input18374 */
+static ANTLR3_BITWORD FOLLOW_301_in_statement_com_input18374_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_301_in_statement_com_input18374 = { FOLLOW_301_in_statement_com_input18374_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_300_in_statement_com_input18387 */
+static ANTLR3_BITWORD FOLLOW_300_in_statement_com_input18387_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_300_in_statement_com_input18387 = { FOLLOW_300_in_statement_com_input18387_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_299_in_statement_com_input18401 */
+static ANTLR3_BITWORD FOLLOW_299_in_statement_com_input18401_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_299_in_statement_com_input18401 = { FOLLOW_299_in_statement_com_input18401_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_302_in_statement_com_input18412 */
+static ANTLR3_BITWORD FOLLOW_302_in_statement_com_input18412_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_302_in_statement_com_input18412 = { FOLLOW_302_in_statement_com_input18412_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_statement_com_input18426 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_statement_com_input18426_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x000000A000000080), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000020000000) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_statement_com_input18426 = { FOLLOW_qualifiedNameID_in_statement_com_input18426_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_parameters_port_in_statement_com_input18436 */
+static ANTLR3_BITWORD FOLLOW_parameters_port_in_statement_com_input18436_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x000000A000000080), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000020000000) };
+static ANTLR3_BITSET_LIST FOLLOW_parameters_port_in_statement_com_input18436 = { FOLLOW_parameters_port_in_statement_com_input18436_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_165_in_statement_com_input18446 */
+static ANTLR3_BITWORD FOLLOW_165_in_statement_com_input18446_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_165_in_statement_com_input18446 = { FOLLOW_165_in_statement_com_input18446_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_277_in_statement_com_input18455 */
+static ANTLR3_BITWORD FOLLOW_277_in_statement_com_input18455_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000008000000080), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000020000000) };
+static ANTLR3_BITSET_LIST FOLLOW_277_in_statement_com_input18455 = { FOLLOW_277_in_statement_com_input18455_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_com_input18469 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_com_input18469_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000008000000080), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000020000000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_com_input18469 = { FOLLOW_expression_in_statement_com_input18469_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSIGN_REF_in_statement_com_input18489 */
+static ANTLR3_BITWORD FOLLOW_ASSIGN_REF_in_statement_com_input18489_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_ASSIGN_REF_in_statement_com_input18489 = { FOLLOW_ASSIGN_REF_in_statement_com_input18489_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_statement_com_input18493 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_statement_com_input18493_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000008000000080), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000020000000) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_statement_com_input18493 = { FOLLOW_qualifiedNameID_in_statement_com_input18493_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_statement_com_input18521 */
+static ANTLR3_BITWORD FOLLOW_set_in_statement_com_input18521_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_statement_com_input18521 = { FOLLOW_set_in_statement_com_input18521_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_statement_com_input18533 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_statement_com_input18533_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_statement_com_input18533 = { FOLLOW_qualifiedNameID_in_statement_com_input18533_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_com_input18549 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_com_input18549_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_com_input18549 = { FOLLOW_SEMI_in_statement_com_input18549_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_341_in_statement_com_output18572 */
+static ANTLR3_BITWORD FOLLOW_341_in_statement_com_output18572_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_341_in_statement_com_output18572 = { FOLLOW_341_in_statement_com_output18572_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_340_in_statement_com_output18590 */
+static ANTLR3_BITWORD FOLLOW_340_in_statement_com_output18590_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_340_in_statement_com_output18590 = { FOLLOW_340_in_statement_com_output18590_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_338_in_statement_com_output18604 */
+static ANTLR3_BITWORD FOLLOW_338_in_statement_com_output18604_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_338_in_statement_com_output18604 = { FOLLOW_338_in_statement_com_output18604_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_337_in_statement_com_output18617 */
+static ANTLR3_BITWORD FOLLOW_337_in_statement_com_output18617_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_337_in_statement_com_output18617 = { FOLLOW_337_in_statement_com_output18617_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_336_in_statement_com_output18631 */
+static ANTLR3_BITWORD FOLLOW_336_in_statement_com_output18631_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_336_in_statement_com_output18631 = { FOLLOW_336_in_statement_com_output18631_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_339_in_statement_com_output18642 */
+static ANTLR3_BITWORD FOLLOW_339_in_statement_com_output18642_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_339_in_statement_com_output18642 = { FOLLOW_339_in_statement_com_output18642_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_statement_com_output18656 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_statement_com_output18656_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000010800000080), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000020000000) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_statement_com_output18656 = { FOLLOW_qualifiedNameID_in_statement_com_output18656_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_parameters_port_in_statement_com_output18666 */
+static ANTLR3_BITWORD FOLLOW_parameters_port_in_statement_com_output18666_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000010800000080), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000020000000) };
+static ANTLR3_BITSET_LIST FOLLOW_parameters_port_in_statement_com_output18666 = { FOLLOW_parameters_port_in_statement_com_output18666_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_163_in_statement_com_output18676 */
+static ANTLR3_BITWORD FOLLOW_163_in_statement_com_output18676_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_163_in_statement_com_output18676 = { FOLLOW_163_in_statement_com_output18676_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_277_in_statement_com_output18685 */
+static ANTLR3_BITWORD FOLLOW_277_in_statement_com_output18685_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000011000000080), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000020000000) };
+static ANTLR3_BITSET_LIST FOLLOW_277_in_statement_com_output18685 = { FOLLOW_277_in_statement_com_output18685_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_com_output18699 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_com_output18699_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000011000000080), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000020000000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_com_output18699 = { FOLLOW_expression_in_statement_com_output18699_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_164_in_statement_com_output18721 */
+static ANTLR3_BITWORD FOLLOW_164_in_statement_com_output18721_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_164_in_statement_com_output18721 = { FOLLOW_164_in_statement_com_output18721_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_statement_com_output18725 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_statement_com_output18725_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000010000000080), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000020000000) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_statement_com_output18725 = { FOLLOW_qualifiedNameID_in_statement_com_output18725_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_statement_com_output18753 */
+static ANTLR3_BITWORD FOLLOW_set_in_statement_com_output18753_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_statement_com_output18753 = { FOLLOW_set_in_statement_com_output18753_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_statement_com_output18765 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_statement_com_output18765_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_statement_com_output18765 = { FOLLOW_qualifiedNameID_in_statement_com_output18765_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_com_output18781 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_com_output18781_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_com_output18781 = { FOLLOW_SEMI_in_statement_com_output18781_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_parameters_port18804 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_parameters_port18804_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_parameters_port18804 = { FOLLOW_LPAREN_in_parameters_port18804_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_labelled_argument_in_parameters_port18813 */
+static ANTLR3_BITWORD FOLLOW_labelled_argument_in_parameters_port18813_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_labelled_argument_in_parameters_port18813 = { FOLLOW_labelled_argument_in_parameters_port18813_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_parameters_port18827 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_parameters_port18827_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_parameters_port18827 = { FOLLOW_COMMA_in_parameters_port18827_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_labelled_argument_in_parameters_port18832 */
+static ANTLR3_BITWORD FOLLOW_labelled_argument_in_parameters_port18832_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_labelled_argument_in_parameters_port18832 = { FOLLOW_labelled_argument_in_parameters_port18832_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_parameters_port18852 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_parameters_port18852_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_parameters_port18852 = { FOLLOW_RPAREN_in_parameters_port18852_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_347_in_expression_com18869 */
+static ANTLR3_BITWORD FOLLOW_347_in_expression_com18869_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_347_in_expression_com18869 = { FOLLOW_347_in_expression_com18869_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_expression_com18874 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_expression_com18874_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_expression_com18874 = { FOLLOW_qualifiedNameID_in_expression_com18874_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_237_in_expression_com18883 */
+static ANTLR3_BITWORD FOLLOW_237_in_expression_com18883_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_237_in_expression_com18883 = { FOLLOW_237_in_expression_com18883_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_expression_com18888 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_expression_com18888_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_expression_com18888 = { FOLLOW_qualifiedNameID_in_expression_com18888_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_guard_in_statement_constraint18912 */
+static ANTLR3_BITWORD FOLLOW_statement_guard_in_statement_constraint18912_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_guard_in_statement_constraint18912 = { FOLLOW_statement_guard_in_statement_constraint18912_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_timed_guard_in_statement_constraint18928 */
+static ANTLR3_BITWORD FOLLOW_statement_timed_guard_in_statement_constraint18928_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_timed_guard_in_statement_constraint18928 = { FOLLOW_statement_timed_guard_in_statement_constraint18928_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_checksat_in_statement_constraint18938 */
+static ANTLR3_BITWORD FOLLOW_statement_checksat_in_statement_constraint18938_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_checksat_in_statement_constraint18938 = { FOLLOW_statement_checksat_in_statement_constraint18938_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_290_in_statement_guard18960 */
+static ANTLR3_BITWORD FOLLOW_290_in_statement_guard18960_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_290_in_statement_guard18960 = { FOLLOW_290_in_statement_guard18960_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_guard18965 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_guard18965_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_guard18965 = { FOLLOW_expression_in_statement_guard18965_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_guard18968 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_guard18968_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_guard18968 = { FOLLOW_SEMI_in_statement_guard18968_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_278_in_statement_guard18977 */
+static ANTLR3_BITWORD FOLLOW_278_in_statement_guard18977_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_278_in_statement_guard18977 = { FOLLOW_278_in_statement_guard18977_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_guard18982 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_guard18982_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_guard18982 = { FOLLOW_expression_in_statement_guard18982_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_guard18985 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_guard18985_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_guard18985 = { FOLLOW_SEMI_in_statement_guard18985_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_391_in_statement_timed_guard19003 */
+static ANTLR3_BITWORD FOLLOW_391_in_statement_timed_guard19003_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_391_in_statement_timed_guard19003 = { FOLLOW_391_in_statement_timed_guard19003_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_timed_guard19008 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_timed_guard19008_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_timed_guard19008 = { FOLLOW_expression_in_statement_timed_guard19008_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_timed_guard19011 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_timed_guard19011_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_timed_guard19011 = { FOLLOW_SEMI_in_statement_timed_guard19011_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_256_in_statement_checksat19033 */
+static ANTLR3_BITWORD FOLLOW_256_in_statement_checksat19033_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x012401000000A185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0110000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_256_in_statement_checksat19033 = { FOLLOW_256_in_statement_checksat19033_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_statement_checksat19040 */
+static ANTLR3_BITWORD FOLLOW_LT__in_statement_checksat19040_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_statement_checksat19040 = { FOLLOW_LT__in_statement_checksat19040_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_StringLiteral_in_statement_checksat19047 */
+static ANTLR3_BITWORD FOLLOW_StringLiteral_in_statement_checksat19047_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_StringLiteral_in_statement_checksat19047 = { FOLLOW_StringLiteral_in_statement_checksat19047_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_statement_checksat19053 */
+static ANTLR3_BITWORD FOLLOW_ID_in_statement_checksat19053_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_statement_checksat19053 = { FOLLOW_ID_in_statement_checksat19053_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_statement_checksat19058 */
+static ANTLR3_BITWORD FOLLOW_GT_in_statement_checksat19058_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_statement_checksat19058 = { FOLLOW_GT_in_statement_checksat19058_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_376_in_statement_checksat19070 */
+static ANTLR3_BITWORD FOLLOW_376_in_statement_checksat19070_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_376_in_statement_checksat19070 = { FOLLOW_376_in_statement_checksat19070_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_StringLiteral_in_statement_checksat19077 */
+static ANTLR3_BITWORD FOLLOW_StringLiteral_in_statement_checksat19077_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_StringLiteral_in_statement_checksat19077 = { FOLLOW_StringLiteral_in_statement_checksat19077_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_statement_checksat19083 */
+static ANTLR3_BITWORD FOLLOW_ID_in_statement_checksat19083_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_statement_checksat19083 = { FOLLOW_ID_in_statement_checksat19083_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_checksat19101 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_checksat19101_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_checksat19101 = { FOLLOW_expression_in_statement_checksat19101_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_checksat19104 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_checksat19104_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_checksat19104 = { FOLLOW_SEMI_in_statement_checksat19104_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_256_in_expression_guard19127 */
+static ANTLR3_BITWORD FOLLOW_256_in_expression_guard19127_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x012401000000A185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0110000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_256_in_expression_guard19127 = { FOLLOW_256_in_expression_guard19127_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_expression_guard19134 */
+static ANTLR3_BITWORD FOLLOW_LT__in_expression_guard19134_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_expression_guard19134 = { FOLLOW_LT__in_expression_guard19134_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_StringLiteral_in_expression_guard19141 */
+static ANTLR3_BITWORD FOLLOW_StringLiteral_in_expression_guard19141_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_StringLiteral_in_expression_guard19141 = { FOLLOW_StringLiteral_in_expression_guard19141_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_expression_guard19147 */
+static ANTLR3_BITWORD FOLLOW_ID_in_expression_guard19147_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_expression_guard19147 = { FOLLOW_ID_in_expression_guard19147_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_expression_guard19152 */
+static ANTLR3_BITWORD FOLLOW_GT_in_expression_guard19152_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_expression_guard19152 = { FOLLOW_GT_in_expression_guard19152_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_376_in_expression_guard19164 */
+static ANTLR3_BITWORD FOLLOW_376_in_expression_guard19164_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_376_in_expression_guard19164 = { FOLLOW_376_in_expression_guard19164_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_StringLiteral_in_expression_guard19171 */
+static ANTLR3_BITWORD FOLLOW_StringLiteral_in_expression_guard19171_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_StringLiteral_in_expression_guard19171 = { FOLLOW_StringLiteral_in_expression_guard19171_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_expression_guard19177 */
+static ANTLR3_BITWORD FOLLOW_ID_in_expression_guard19177_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_expression_guard19177 = { FOLLOW_ID_in_expression_guard19177_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression_guard19195 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression_guard19195_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression_guard19195 = { FOLLOW_expression_in_expression_guard19195_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_294_in_statement_ite19221 */
+static ANTLR3_BITWORD FOLLOW_294_in_statement_ite19221_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_294_in_statement_ite19221 = { FOLLOW_294_in_statement_ite19221_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_ite19226 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_ite19226_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_ite19226 = { FOLLOW_expression_in_statement_ite19226_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_statement_ite19231 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_statement_ite19231_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000060000) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_statement_ite19231 = { FOLLOW_block_statement_in_statement_ite19231_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_274_in_statement_ite19245 */
+static ANTLR3_BITWORD FOLLOW_274_in_statement_ite19245_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_274_in_statement_ite19245 = { FOLLOW_274_in_statement_ite19245_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_273_in_statement_ite19249 */
+static ANTLR3_BITWORD FOLLOW_273_in_statement_ite19249_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000004000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_273_in_statement_ite19249 = { FOLLOW_273_in_statement_ite19249_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_294_in_statement_ite19251 */
+static ANTLR3_BITWORD FOLLOW_294_in_statement_ite19251_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_294_in_statement_ite19251 = { FOLLOW_294_in_statement_ite19251_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_ite19258 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_ite19258_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_ite19258 = { FOLLOW_expression_in_statement_ite19258_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_statement_ite19263 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_statement_ite19263_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000060000) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_statement_ite19263 = { FOLLOW_block_statement_in_statement_ite19263_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_273_in_statement_ite19283 */
+static ANTLR3_BITWORD FOLLOW_273_in_statement_ite19283_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_273_in_statement_ite19283 = { FOLLOW_273_in_statement_ite19283_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_statement_ite19288 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_statement_ite19288_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_statement_ite19288 = { FOLLOW_block_statement_in_statement_ite19288_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_294_in_expression_ite19320 */
+static ANTLR3_BITWORD FOLLOW_294_in_expression_ite19320_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_294_in_expression_ite19320 = { FOLLOW_294_in_expression_ite19320_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression_ite19325 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression_ite19325_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression_ite19325 = { FOLLOW_expression_in_expression_ite19325_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_expression_ite19328 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_expression_ite19328_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_expression_ite19328 = { FOLLOW_LCURLY_in_expression_ite19328_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression_ite19333 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression_ite19333_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression_ite19333 = { FOLLOW_expression_in_expression_ite19333_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_expression_ite19336 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_expression_ite19336_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000060000) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_expression_ite19336 = { FOLLOW_RCURLY_in_expression_ite19336_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_274_in_expression_ite19350 */
+static ANTLR3_BITWORD FOLLOW_274_in_expression_ite19350_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_274_in_expression_ite19350 = { FOLLOW_274_in_expression_ite19350_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_273_in_expression_ite19354 */
+static ANTLR3_BITWORD FOLLOW_273_in_expression_ite19354_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000004000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_273_in_expression_ite19354 = { FOLLOW_273_in_expression_ite19354_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_294_in_expression_ite19356 */
+static ANTLR3_BITWORD FOLLOW_294_in_expression_ite19356_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_294_in_expression_ite19356 = { FOLLOW_294_in_expression_ite19356_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression_ite19362 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression_ite19362_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression_ite19362 = { FOLLOW_expression_in_expression_ite19362_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_expression_ite19365 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_expression_ite19365_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_expression_ite19365 = { FOLLOW_LCURLY_in_expression_ite19365_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression_ite19370 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression_ite19370_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression_ite19370 = { FOLLOW_expression_in_expression_ite19370_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_expression_ite19373 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_expression_ite19373_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000060000) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_expression_ite19373 = { FOLLOW_RCURLY_in_expression_ite19373_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_273_in_expression_ite19393 */
+static ANTLR3_BITWORD FOLLOW_273_in_expression_ite19393_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_273_in_expression_ite19393 = { FOLLOW_273_in_expression_ite19393_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_expression_ite19396 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_expression_ite19396_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_expression_ite19396 = { FOLLOW_LCURLY_in_expression_ite19396_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression_ite19401 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression_ite19401_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression_ite19401 = { FOLLOW_expression_in_expression_ite19401_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_expression_ite19404 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_expression_ite19404_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_expression_ite19404 = { FOLLOW_RCURLY_in_expression_ite19404_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_285_in_statement_iteration19451 */
+static ANTLR3_BITWORD FOLLOW_285_in_statement_iteration19451_bits[] = { ANTLR3_UINT64_LIT(0x000C000004400000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_285_in_statement_iteration19451 = { FOLLOW_285_in_statement_iteration19451_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_for_assign_header_in_statement_iteration19460 */
+static ANTLR3_BITWORD FOLLOW_for_assign_header_in_statement_iteration19460_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_for_assign_header_in_statement_iteration19460 = { FOLLOW_for_assign_header_in_statement_iteration19460_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_iteration19463 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_iteration19463_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_iteration19463 = { FOLLOW_SEMI_in_statement_iteration19463_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_iteration19468 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_iteration19468_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_iteration19468 = { FOLLOW_expression_in_statement_iteration19468_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_iteration19471 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_iteration19471_bits[] = { ANTLR3_UINT64_LIT(0x000C000004400000) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_iteration19471 = { FOLLOW_SEMI_in_statement_iteration19471_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_for_assign_header_in_statement_iteration19476 */
+static ANTLR3_BITWORD FOLLOW_for_assign_header_in_statement_iteration19476_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_for_assign_header_in_statement_iteration19476 = { FOLLOW_for_assign_header_in_statement_iteration19476_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_statement_iteration19495 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_statement_iteration19495_bits[] = { ANTLR3_UINT64_LIT(0x000C000004400000) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_statement_iteration19495 = { FOLLOW_LPAREN_in_statement_iteration19495_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_for_assign_header_in_statement_iteration19506 */
+static ANTLR3_BITWORD FOLLOW_for_assign_header_in_statement_iteration19506_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_for_assign_header_in_statement_iteration19506 = { FOLLOW_for_assign_header_in_statement_iteration19506_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_iteration19509 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_iteration19509_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_iteration19509 = { FOLLOW_SEMI_in_statement_iteration19509_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_iteration19514 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_iteration19514_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_iteration19514 = { FOLLOW_expression_in_statement_iteration19514_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_iteration19517 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_iteration19517_bits[] = { ANTLR3_UINT64_LIT(0x000C000004400000) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_iteration19517 = { FOLLOW_SEMI_in_statement_iteration19517_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_for_assign_header_in_statement_iteration19522 */
+static ANTLR3_BITWORD FOLLOW_for_assign_header_in_statement_iteration19522_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_for_assign_header_in_statement_iteration19522 = { FOLLOW_for_assign_header_in_statement_iteration19522_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_statement_iteration19529 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_statement_iteration19529_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_statement_iteration19529 = { FOLLOW_RPAREN_in_statement_iteration19529_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_lvalue_in_statement_iteration19550 */
+static ANTLR3_BITWORD FOLLOW_lvalue_in_statement_iteration19550_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_lvalue_in_statement_iteration19550 = { FOLLOW_lvalue_in_statement_iteration19550_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COLON_in_statement_iteration19553 */
+static ANTLR3_BITWORD FOLLOW_COLON_in_statement_iteration19553_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COLON_in_statement_iteration19553 = { FOLLOW_COLON_in_statement_iteration19553_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_iteration19558 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_iteration19558_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_iteration19558 = { FOLLOW_expression_in_statement_iteration19558_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_statement_iteration19577 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_statement_iteration19577_bits[] = { ANTLR3_UINT64_LIT(0x0004000000400000) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_statement_iteration19577 = { FOLLOW_LPAREN_in_statement_iteration19577_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_lvalue_in_statement_iteration19582 */
+static ANTLR3_BITWORD FOLLOW_lvalue_in_statement_iteration19582_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_lvalue_in_statement_iteration19582 = { FOLLOW_lvalue_in_statement_iteration19582_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COLON_in_statement_iteration19585 */
+static ANTLR3_BITWORD FOLLOW_COLON_in_statement_iteration19585_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COLON_in_statement_iteration19585 = { FOLLOW_COLON_in_statement_iteration19585_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_iteration19590 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_iteration19590_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_iteration19590 = { FOLLOW_expression_in_statement_iteration19590_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_statement_iteration19593 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_statement_iteration19593_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_statement_iteration19593 = { FOLLOW_RPAREN_in_statement_iteration19593_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_statement_iteration19612 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_statement_iteration19612_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_statement_iteration19612 = { FOLLOW_block_statement_in_statement_iteration19612_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_416_in_statement_iteration19621 */
+static ANTLR3_BITWORD FOLLOW_416_in_statement_iteration19621_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_416_in_statement_iteration19621 = { FOLLOW_416_in_statement_iteration19621_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_iteration19626 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_iteration19626_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_iteration19626 = { FOLLOW_expression_in_statement_iteration19626_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_statement_iteration19631 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_statement_iteration19631_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_statement_iteration19631 = { FOLLOW_block_statement_in_statement_iteration19631_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_269_in_statement_iteration19640 */
+static ANTLR3_BITWORD FOLLOW_269_in_statement_iteration19640_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_269_in_statement_iteration19640 = { FOLLOW_269_in_statement_iteration19640_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_statement_iteration19645 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_statement_iteration19645_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000100000000) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_statement_iteration19645 = { FOLLOW_block_statement_in_statement_iteration19645_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_416_in_statement_iteration19648 */
+static ANTLR3_BITWORD FOLLOW_416_in_statement_iteration19648_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_416_in_statement_iteration19648 = { FOLLOW_416_in_statement_iteration19648_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_iteration19653 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_iteration19653_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_iteration19653 = { FOLLOW_expression_in_statement_iteration19653_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_iteration19656 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_iteration19656_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_iteration19656 = { FOLLOW_SEMI_in_statement_iteration19656_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_lvalue_in_for_assign_header19679 */
+static ANTLR3_BITWORD FOLLOW_lvalue_in_for_assign_header19679_bits[] = { ANTLR3_UINT64_LIT(0x0008000004000010) };
+static ANTLR3_BITSET_LIST FOLLOW_lvalue_in_for_assign_header19679 = { FOLLOW_lvalue_in_for_assign_header19679_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSIGN_in_for_assign_header19684 */
+static ANTLR3_BITWORD FOLLOW_ASSIGN_in_for_assign_header19684_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_ASSIGN_in_for_assign_header19684 = { FOLLOW_ASSIGN_in_for_assign_header19684_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_for_assign_header19689 */
+static ANTLR3_BITWORD FOLLOW_expression_in_for_assign_header19689_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_for_assign_header19689 = { FOLLOW_expression_in_for_assign_header19689_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INCR_in_for_assign_header19702 */
+static ANTLR3_BITWORD FOLLOW_INCR_in_for_assign_header19702_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_INCR_in_for_assign_header19702 = { FOLLOW_INCR_in_for_assign_header19702_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DECR_in_for_assign_header19713 */
+static ANTLR3_BITWORD FOLLOW_DECR_in_for_assign_header19713_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_DECR_in_for_assign_header19713 = { FOLLOW_DECR_in_for_assign_header19713_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INCR_in_for_assign_header19725 */
+static ANTLR3_BITWORD FOLLOW_INCR_in_for_assign_header19725_bits[] = { ANTLR3_UINT64_LIT(0x0004000000400000) };
+static ANTLR3_BITSET_LIST FOLLOW_INCR_in_for_assign_header19725 = { FOLLOW_INCR_in_for_assign_header19725_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_lvalue_in_for_assign_header19730 */
+static ANTLR3_BITWORD FOLLOW_lvalue_in_for_assign_header19730_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_lvalue_in_for_assign_header19730 = { FOLLOW_lvalue_in_for_assign_header19730_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DECR_in_for_assign_header19741 */
+static ANTLR3_BITWORD FOLLOW_DECR_in_for_assign_header19741_bits[] = { ANTLR3_UINT64_LIT(0x0004000000400000) };
+static ANTLR3_BITSET_LIST FOLLOW_DECR_in_for_assign_header19741 = { FOLLOW_DECR_in_for_assign_header19741_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_lvalue_in_for_assign_header19746 */
+static ANTLR3_BITWORD FOLLOW_lvalue_in_for_assign_header19746_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_lvalue_in_for_assign_header19746 = { FOLLOW_lvalue_in_for_assign_header19746_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_247_in_statement_jump19769 */
+static ANTLR3_BITWORD FOLLOW_247_in_statement_jump19769_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C00020C0), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_247_in_statement_jump19769 = { FOLLOW_247_in_statement_jump19769_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_jump19788 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_jump19788_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_jump19788 = { FOLLOW_expression_in_statement_jump19788_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_jump19799 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_jump19799_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_jump19799 = { FOLLOW_SEMI_in_statement_jump19799_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_263_in_statement_jump19805 */
+static ANTLR3_BITWORD FOLLOW_263_in_statement_jump19805_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C00020C0), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_263_in_statement_jump19805 = { FOLLOW_263_in_statement_jump19805_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_jump19821 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_jump19821_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_jump19821 = { FOLLOW_expression_in_statement_jump19821_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_jump19832 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_jump19832_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_jump19832 = { FOLLOW_SEMI_in_statement_jump19832_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_364_in_statement_jump19838 */
+static ANTLR3_BITWORD FOLLOW_364_in_statement_jump19838_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C00020C0), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_364_in_statement_jump19838 = { FOLLOW_364_in_statement_jump19838_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_jump19856 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_jump19856_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_jump19856 = { FOLLOW_expression_in_statement_jump19856_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_statement_jump19868 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_statement_jump19868_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_statement_jump19868 = { FOLLOW_COMMA_in_statement_jump19868_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_jump19872 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_jump19872_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_jump19872 = { FOLLOW_expression_in_statement_jump19872_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_jump19889 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_jump19889_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_jump19889 = { FOLLOW_SEMI_in_statement_jump19889_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_279_in_statement_jump19895 */
+static ANTLR3_BITWORD FOLLOW_279_in_statement_jump19895_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C00020C0), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_279_in_statement_jump19895 = { FOLLOW_279_in_statement_jump19895_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_jump19915 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_jump19915_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_jump19915 = { FOLLOW_expression_in_statement_jump19915_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_jump19926 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_jump19926_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_jump19926 = { FOLLOW_SEMI_in_statement_jump19926_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_313_in_expression_lambda19945 */
+static ANTLR3_BITWORD FOLLOW_313_in_expression_lambda19945_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000001000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_313_in_expression_lambda19945 = { FOLLOW_313_in_expression_lambda19945_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_expression_lambda19957 */
+static ANTLR3_BITWORD FOLLOW_ID_in_expression_lambda19957_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000001000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_expression_lambda19957 = { FOLLOW_ID_in_expression_lambda19957_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_164_in_expression_lambda19969 */
+static ANTLR3_BITWORD FOLLOW_164_in_expression_lambda19969_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_164_in_expression_lambda19969 = { FOLLOW_164_in_expression_lambda19969_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression_lambda19973 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression_lambda19973_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression_lambda19973 = { FOLLOW_expression_in_expression_lambda19973_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_383_in_expression_status19996 */
+static ANTLR3_BITWORD FOLLOW_383_in_expression_status19996_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000013804081800), ANTLR3_UINT64_LIT(0x020B0C0000000000), ANTLR3_UINT64_LIT(0x0000000080000024) };
+static ANTLR3_BITSET_LIST FOLLOW_383_in_expression_status19996 = { FOLLOW_383_in_expression_status19996_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_op_activity_in_expression_status20003 */
+static ANTLR3_BITWORD FOLLOW_op_activity_in_expression_status20003_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_op_activity_in_expression_status20003 = { FOLLOW_op_activity_in_expression_status20003_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_expression_status20008 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_expression_status20008_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_expression_status20008 = { FOLLOW_qualifiedNameID_in_expression_status20008_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_382_in_expression_status20017 */
+static ANTLR3_BITWORD FOLLOW_382_in_expression_status20017_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000013804081800), ANTLR3_UINT64_LIT(0x020B0C0000000000), ANTLR3_UINT64_LIT(0x0000000080000024) };
+static ANTLR3_BITSET_LIST FOLLOW_382_in_expression_status20017 = { FOLLOW_382_in_expression_status20017_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_op_activity_in_expression_status20025 */
+static ANTLR3_BITWORD FOLLOW_op_activity_in_expression_status20025_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_op_activity_in_expression_status20025 = { FOLLOW_op_activity_in_expression_status20025_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_expression_status20030 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_expression_status20030_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_expression_status20030 = { FOLLOW_qualifiedNameID_in_expression_status20030_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_381_in_expression_status20039 */
+static ANTLR3_BITWORD FOLLOW_381_in_expression_status20039_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000013804081800), ANTLR3_UINT64_LIT(0x020B0C0000000000), ANTLR3_UINT64_LIT(0x0000000080000024) };
+static ANTLR3_BITSET_LIST FOLLOW_381_in_expression_status20039 = { FOLLOW_381_in_expression_status20039_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_op_activity_in_expression_status20044 */
+static ANTLR3_BITWORD FOLLOW_op_activity_in_expression_status20044_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_op_activity_in_expression_status20044 = { FOLLOW_op_activity_in_expression_status20044_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_expression_status20049 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_expression_status20049_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_expression_status20049 = { FOLLOW_qualifiedNameID_in_expression_status20049_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_384_in_expression_status20058 */
+static ANTLR3_BITWORD FOLLOW_384_in_expression_status20058_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000013804081800), ANTLR3_UINT64_LIT(0x020B0C0000000000), ANTLR3_UINT64_LIT(0x0000000080000024) };
+static ANTLR3_BITSET_LIST FOLLOW_384_in_expression_status20058 = { FOLLOW_384_in_expression_status20058_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_op_activity_in_expression_status20064 */
+static ANTLR3_BITWORD FOLLOW_op_activity_in_expression_status20064_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_op_activity_in_expression_status20064 = { FOLLOW_op_activity_in_expression_status20064_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_expression_status20069 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_expression_status20069_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_expression_status20069 = { FOLLOW_qualifiedNameID_in_expression_status20069_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_252_in_expression_status20078 */
+static ANTLR3_BITWORD FOLLOW_252_in_expression_status20078_bits[] = { ANTLR3_UINT64_LIT(0x0004000000400000) };
+static ANTLR3_BITSET_LIST FOLLOW_252_in_expression_status20078 = { FOLLOW_252_in_expression_status20078_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_lvalue_in_expression_status20086 */
+static ANTLR3_BITWORD FOLLOW_lvalue_in_expression_status20086_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_lvalue_in_expression_status20086 = { FOLLOW_lvalue_in_expression_status20086_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_251_in_expression_status20095 */
+static ANTLR3_BITWORD FOLLOW_251_in_expression_status20095_bits[] = { ANTLR3_UINT64_LIT(0x0004000000400000) };
+static ANTLR3_BITSET_LIST FOLLOW_251_in_expression_status20095 = { FOLLOW_251_in_expression_status20095_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_lvalue_in_expression_status20100 */
+static ANTLR3_BITWORD FOLLOW_lvalue_in_expression_status20100_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_lvalue_in_expression_status20100 = { FOLLOW_lvalue_in_expression_status20100_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_296_in_op_activity20118 */
+static ANTLR3_BITWORD FOLLOW_296_in_op_activity20118_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_296_in_op_activity20118 = { FOLLOW_296_in_op_activity20118_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_282_in_op_activity20129 */
+static ANTLR3_BITWORD FOLLOW_282_in_op_activity20129_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_282_in_op_activity20129 = { FOLLOW_282_in_op_activity20129_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_267_in_op_activity20139 */
+static ANTLR3_BITWORD FOLLOW_267_in_op_activity20139_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_267_in_op_activity20139 = { FOLLOW_267_in_op_activity20139_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_377_in_op_activity20147 */
+static ANTLR3_BITWORD FOLLOW_377_in_op_activity20147_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_377_in_op_activity20147 = { FOLLOW_377_in_op_activity20147_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_362_in_op_activity20157 */
+static ANTLR3_BITWORD FOLLOW_362_in_op_activity20157_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_362_in_op_activity20157 = { FOLLOW_362_in_op_activity20157_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_386_in_op_activity20165 */
+static ANTLR3_BITWORD FOLLOW_386_in_op_activity20165_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_386_in_op_activity20165 = { FOLLOW_386_in_op_activity20165_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_293_in_op_activity20176 */
+static ANTLR3_BITWORD FOLLOW_293_in_op_activity20176_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_293_in_op_activity20176 = { FOLLOW_293_in_op_activity20176_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_275_in_op_activity20184 */
+static ANTLR3_BITWORD FOLLOW_275_in_op_activity20184_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_275_in_op_activity20184 = { FOLLOW_275_in_op_activity20184_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_292_in_op_activity20193 */
+static ANTLR3_BITWORD FOLLOW_292_in_op_activity20193_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_292_in_op_activity20193 = { FOLLOW_292_in_op_activity20193_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_268_in_op_activity20200 */
+static ANTLR3_BITWORD FOLLOW_268_in_op_activity20200_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_268_in_op_activity20200 = { FOLLOW_268_in_op_activity20200_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_291_in_op_activity20208 */
+static ANTLR3_BITWORD FOLLOW_291_in_op_activity20208_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_291_in_op_activity20208 = { FOLLOW_291_in_op_activity20208_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_236_in_op_activity20217 */
+static ANTLR3_BITWORD FOLLOW_236_in_op_activity20217_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_236_in_op_activity20217 = { FOLLOW_236_in_op_activity20217_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_369_in_op_activity20227 */
+static ANTLR3_BITWORD FOLLOW_369_in_op_activity20227_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_369_in_op_activity20227 = { FOLLOW_369_in_op_activity20227_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_368_in_op_activity20239 */
+static ANTLR3_BITWORD FOLLOW_368_in_op_activity20239_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_368_in_op_activity20239 = { FOLLOW_368_in_op_activity20239_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_371_in_op_activity20251 */
+static ANTLR3_BITWORD FOLLOW_371_in_op_activity20251_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_371_in_op_activity20251 = { FOLLOW_371_in_op_activity20251_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_389_in_op_activity20258 */
+static ANTLR3_BITWORD FOLLOW_389_in_op_activity20258_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_389_in_op_activity20258 = { FOLLOW_389_in_op_activity20258_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_363_in_op_activity20266 */
+static ANTLR3_BITWORD FOLLOW_363_in_op_activity20266_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_363_in_op_activity20266 = { FOLLOW_363_in_op_activity20266_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_415_in_op_activity20275 */
+static ANTLR3_BITWORD FOLLOW_415_in_op_activity20275_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_415_in_op_activity20275 = { FOLLOW_415_in_op_activity20275_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_op_activity_in_statement_activity20307 */
+static ANTLR3_BITWORD FOLLOW_op_activity_in_statement_activity20307_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_op_activity_in_statement_activity20307 = { FOLLOW_op_activity_in_statement_activity20307_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_statement_activity20319 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_statement_activity20319_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_statement_activity20319 = { FOLLOW_qualifiedNameID_in_statement_activity20319_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_activity_machine_param_return_in_statement_activity20338 */
+static ANTLR3_BITWORD FOLLOW_activity_machine_param_return_in_statement_activity20338_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_activity_machine_param_return_in_statement_activity20338 = { FOLLOW_activity_machine_param_return_in_statement_activity20338_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_activity20346 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_activity20346_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_activity20346 = { FOLLOW_SEMI_in_statement_activity20346_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_289_in_statement_activity20355 */
+static ANTLR3_BITWORD FOLLOW_289_in_statement_activity20355_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_289_in_statement_activity20355 = { FOLLOW_289_in_statement_activity20355_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_statement_activity20360 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_statement_activity20360_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000010000000) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_statement_activity20360 = { FOLLOW_qualifiedNameID_in_statement_activity20360_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_init_flow_in_statement_activity20374 */
+static ANTLR3_BITWORD FOLLOW_statement_init_flow_in_statement_activity20374_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_init_flow_in_statement_activity20374 = { FOLLOW_statement_init_flow_in_statement_activity20374_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_activity20385 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_activity20385_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_activity20385 = { FOLLOW_SEMI_in_statement_activity20385_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_312_in_statement_activity20396 */
+static ANTLR3_BITWORD FOLLOW_312_in_statement_activity20396_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_312_in_statement_activity20396 = { FOLLOW_312_in_statement_activity20396_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_statement_activity20401 */
+static ANTLR3_BITWORD FOLLOW_expression_in_statement_activity20401_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_statement_activity20401 = { FOLLOW_expression_in_statement_activity20401_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_activity20404 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_activity20404_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_activity20404 = { FOLLOW_SEMI_in_statement_activity20404_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_284_in_statement_init_flow20434 */
+static ANTLR3_BITWORD FOLLOW_284_in_statement_init_flow20434_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_284_in_statement_init_flow20434 = { FOLLOW_284_in_statement_init_flow20434_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_statement_init_flow20438 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_statement_init_flow20438_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_statement_init_flow20438 = { FOLLOW_block_statement_in_statement_init_flow20438_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_statement_invoke_routine20468 */
+static ANTLR3_BITWORD FOLLOW_ID_in_statement_invoke_routine20468_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_statement_invoke_routine20468 = { FOLLOW_ID_in_statement_invoke_routine20468_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_invoke_routine_params_in_statement_invoke_routine20479 */
+static ANTLR3_BITWORD FOLLOW_invoke_routine_params_in_statement_invoke_routine20479_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000800000080), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_invoke_routine_params_in_statement_invoke_routine20479 = { FOLLOW_invoke_routine_params_in_statement_invoke_routine20479_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_invoke_routine_returns_in_statement_invoke_routine20490 */
+static ANTLR3_BITWORD FOLLOW_invoke_routine_returns_in_statement_invoke_routine20490_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_invoke_routine_returns_in_statement_invoke_routine20490 = { FOLLOW_invoke_routine_returns_in_statement_invoke_routine20490_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_invoke_routine20502 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_invoke_routine20502_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_invoke_routine20502 = { FOLLOW_SEMI_in_statement_invoke_routine20502_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_invoke_routine_params20525 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_invoke_routine_params20525_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002042), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_invoke_routine_params20525 = { FOLLOW_LPAREN_in_invoke_routine_params20525_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_labelled_argument_in_invoke_routine_params20534 */
+static ANTLR3_BITWORD FOLLOW_labelled_argument_in_invoke_routine_params20534_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_labelled_argument_in_invoke_routine_params20534 = { FOLLOW_labelled_argument_in_invoke_routine_params20534_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_invoke_routine_params20550 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_invoke_routine_params20550_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_invoke_routine_params20550 = { FOLLOW_COMMA_in_invoke_routine_params20550_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_labelled_argument_in_invoke_routine_params20559 */
+static ANTLR3_BITWORD FOLLOW_labelled_argument_in_invoke_routine_params20559_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_labelled_argument_in_invoke_routine_params20559 = { FOLLOW_labelled_argument_in_invoke_routine_params20559_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_invoke_routine_params20585 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_invoke_routine_params20585_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_invoke_routine_params20585 = { FOLLOW_RPAREN_in_invoke_routine_params20585_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_invoke_routine_returns20599 */
+static ANTLR3_BITWORD FOLLOW_set_in_invoke_routine_returns20599_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_invoke_routine_returns20599 = { FOLLOW_set_in_invoke_routine_returns20599_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_invoke_routine_returns20614 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_invoke_routine_returns20614_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_invoke_routine_returns20614 = { FOLLOW_LPAREN_in_invoke_routine_returns20614_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_labelled_argument_in_invoke_routine_returns20623 */
+static ANTLR3_BITWORD FOLLOW_labelled_argument_in_invoke_routine_returns20623_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_labelled_argument_in_invoke_routine_returns20623 = { FOLLOW_labelled_argument_in_invoke_routine_returns20623_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_invoke_routine_returns20639 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_invoke_routine_returns20639_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_invoke_routine_returns20639 = { FOLLOW_COMMA_in_invoke_routine_returns20639_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_labelled_argument_in_invoke_routine_returns20650 */
+static ANTLR3_BITWORD FOLLOW_labelled_argument_in_invoke_routine_returns20650_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_labelled_argument_in_invoke_routine_returns20650 = { FOLLOW_labelled_argument_in_invoke_routine_returns20650_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_invoke_routine_returns20674 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_invoke_routine_returns20674_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_invoke_routine_returns20674 = { FOLLOW_RPAREN_in_invoke_routine_returns20674_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_labelled_argument_in_invoke_routine_returns20684 */
+static ANTLR3_BITWORD FOLLOW_labelled_argument_in_invoke_routine_returns20684_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_labelled_argument_in_invoke_routine_returns20684 = { FOLLOW_labelled_argument_in_invoke_routine_returns20684_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_385_in_statement_moc20722 */
+static ANTLR3_BITWORD FOLLOW_385_in_statement_moc20722_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_385_in_statement_moc20722 = { FOLLOW_385_in_statement_moc20722_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_StringLiteral_in_statement_moc20725 */
+static ANTLR3_BITWORD FOLLOW_StringLiteral_in_statement_moc20725_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_StringLiteral_in_statement_moc20725 = { FOLLOW_StringLiteral_in_statement_moc20725_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_statement_moc20728 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_statement_moc20728_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_statement_moc20728 = { FOLLOW_SEMI_in_statement_moc20728_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_conditionalExpression_in_expression20757 */
+static ANTLR3_BITWORD FOLLOW_conditionalExpression_in_expression20757_bits[] = { ANTLR3_UINT64_LIT(0x06000000600D8C72), ANTLR3_UINT64_LIT(0x06000300021B0C30), ANTLR3_UINT64_LIT(0x0000000000000C30) };
+static ANTLR3_BITSET_LIST FOLLOW_conditionalExpression_in_expression20757 = { FOLLOW_conditionalExpression_in_expression20757_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSIGN_in_expression20766 */
+static ANTLR3_BITWORD FOLLOW_ASSIGN_in_expression20766_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_ASSIGN_in_expression20766 = { FOLLOW_ASSIGN_in_expression20766_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression20771 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression20771_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression20771 = { FOLLOW_expression_in_expression20771_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSIGN_MACRO_in_expression20780 */
+static ANTLR3_BITWORD FOLLOW_ASSIGN_MACRO_in_expression20780_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_ASSIGN_MACRO_in_expression20780 = { FOLLOW_ASSIGN_MACRO_in_expression20780_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression20785 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression20785_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression20785 = { FOLLOW_expression_in_expression20785_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSIGN_AFTER_in_expression20794 */
+static ANTLR3_BITWORD FOLLOW_ASSIGN_AFTER_in_expression20794_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_ASSIGN_AFTER_in_expression20794 = { FOLLOW_ASSIGN_AFTER_in_expression20794_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression20799 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression20799_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression20799 = { FOLLOW_expression_in_expression20799_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_PLUS_ASSIGN_in_expression20808 */
+static ANTLR3_BITWORD FOLLOW_PLUS_ASSIGN_in_expression20808_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_PLUS_ASSIGN_in_expression20808 = { FOLLOW_PLUS_ASSIGN_in_expression20808_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression20813 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression20813_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression20813 = { FOLLOW_expression_in_expression20813_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_PLUS_ASSIGN_AFTER_in_expression20822 */
+static ANTLR3_BITWORD FOLLOW_PLUS_ASSIGN_AFTER_in_expression20822_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_PLUS_ASSIGN_AFTER_in_expression20822 = { FOLLOW_PLUS_ASSIGN_AFTER_in_expression20822_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression20827 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression20827_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression20827 = { FOLLOW_expression_in_expression20827_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_MINUS_ASSIGN_in_expression20836 */
+static ANTLR3_BITWORD FOLLOW_MINUS_ASSIGN_in_expression20836_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_MINUS_ASSIGN_in_expression20836 = { FOLLOW_MINUS_ASSIGN_in_expression20836_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression20841 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression20841_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression20841 = { FOLLOW_expression_in_expression20841_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_MINUS_ASSIGN_AFTER_in_expression20850 */
+static ANTLR3_BITWORD FOLLOW_MINUS_ASSIGN_AFTER_in_expression20850_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_MINUS_ASSIGN_AFTER_in_expression20850 = { FOLLOW_MINUS_ASSIGN_AFTER_in_expression20850_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression20855 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression20855_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression20855 = { FOLLOW_expression_in_expression20855_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STAR_ASSIGN_in_expression20864 */
+static ANTLR3_BITWORD FOLLOW_STAR_ASSIGN_in_expression20864_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_STAR_ASSIGN_in_expression20864 = { FOLLOW_STAR_ASSIGN_in_expression20864_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression20869 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression20869_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression20869 = { FOLLOW_expression_in_expression20869_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STAR_ASSIGN_AFTER_in_expression20878 */
+static ANTLR3_BITWORD FOLLOW_STAR_ASSIGN_AFTER_in_expression20878_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_STAR_ASSIGN_AFTER_in_expression20878 = { FOLLOW_STAR_ASSIGN_AFTER_in_expression20878_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression20883 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression20883_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression20883 = { FOLLOW_expression_in_expression20883_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DIV_ASSIGN_in_expression20892 */
+static ANTLR3_BITWORD FOLLOW_DIV_ASSIGN_in_expression20892_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_DIV_ASSIGN_in_expression20892 = { FOLLOW_DIV_ASSIGN_in_expression20892_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression20897 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression20897_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression20897 = { FOLLOW_expression_in_expression20897_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DIV_ASSIGN_AFTER_in_expression20906 */
+static ANTLR3_BITWORD FOLLOW_DIV_ASSIGN_AFTER_in_expression20906_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_DIV_ASSIGN_AFTER_in_expression20906 = { FOLLOW_DIV_ASSIGN_AFTER_in_expression20906_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression20911 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression20911_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression20911 = { FOLLOW_expression_in_expression20911_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_MOD_ASSIGN_in_expression20920 */
+static ANTLR3_BITWORD FOLLOW_MOD_ASSIGN_in_expression20920_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_MOD_ASSIGN_in_expression20920 = { FOLLOW_MOD_ASSIGN_in_expression20920_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression20925 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression20925_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression20925 = { FOLLOW_expression_in_expression20925_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_MOD_ASSIGN_AFTER_in_expression20934 */
+static ANTLR3_BITWORD FOLLOW_MOD_ASSIGN_AFTER_in_expression20934_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_MOD_ASSIGN_AFTER_in_expression20934 = { FOLLOW_MOD_ASSIGN_AFTER_in_expression20934_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression20939 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression20939_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression20939 = { FOLLOW_expression_in_expression20939_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LAND_ASSIGN_in_expression20948 */
+static ANTLR3_BITWORD FOLLOW_LAND_ASSIGN_in_expression20948_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LAND_ASSIGN_in_expression20948 = { FOLLOW_LAND_ASSIGN_in_expression20948_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression20953 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression20953_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression20953 = { FOLLOW_expression_in_expression20953_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LAND_ASSIGN_AFTER_in_expression20962 */
+static ANTLR3_BITWORD FOLLOW_LAND_ASSIGN_AFTER_in_expression20962_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LAND_ASSIGN_AFTER_in_expression20962 = { FOLLOW_LAND_ASSIGN_AFTER_in_expression20962_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression20967 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression20967_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression20967 = { FOLLOW_expression_in_expression20967_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LOR_ASSIGN_in_expression20976 */
+static ANTLR3_BITWORD FOLLOW_LOR_ASSIGN_in_expression20976_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LOR_ASSIGN_in_expression20976 = { FOLLOW_LOR_ASSIGN_in_expression20976_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression20981 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression20981_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression20981 = { FOLLOW_expression_in_expression20981_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LOR_ASSIGN_AFTER_in_expression20990 */
+static ANTLR3_BITWORD FOLLOW_LOR_ASSIGN_AFTER_in_expression20990_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LOR_ASSIGN_AFTER_in_expression20990 = { FOLLOW_LOR_ASSIGN_AFTER_in_expression20990_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression20995 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression20995_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression20995 = { FOLLOW_expression_in_expression20995_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BAND_ASSIGN_in_expression21004 */
+static ANTLR3_BITWORD FOLLOW_BAND_ASSIGN_in_expression21004_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_BAND_ASSIGN_in_expression21004 = { FOLLOW_BAND_ASSIGN_in_expression21004_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression21009 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression21009_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression21009 = { FOLLOW_expression_in_expression21009_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BAND_ASSIGN_AFTER_in_expression21018 */
+static ANTLR3_BITWORD FOLLOW_BAND_ASSIGN_AFTER_in_expression21018_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_BAND_ASSIGN_AFTER_in_expression21018 = { FOLLOW_BAND_ASSIGN_AFTER_in_expression21018_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression21023 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression21023_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression21023 = { FOLLOW_expression_in_expression21023_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BOR_ASSIGN_in_expression21032 */
+static ANTLR3_BITWORD FOLLOW_BOR_ASSIGN_in_expression21032_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_BOR_ASSIGN_in_expression21032 = { FOLLOW_BOR_ASSIGN_in_expression21032_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression21037 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression21037_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression21037 = { FOLLOW_expression_in_expression21037_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BOR_ASSIGN_AFTER_in_expression21046 */
+static ANTLR3_BITWORD FOLLOW_BOR_ASSIGN_AFTER_in_expression21046_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_BOR_ASSIGN_AFTER_in_expression21046 = { FOLLOW_BOR_ASSIGN_AFTER_in_expression21046_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression21051 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression21051_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression21051 = { FOLLOW_expression_in_expression21051_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BXOR_ASSIGN_in_expression21060 */
+static ANTLR3_BITWORD FOLLOW_BXOR_ASSIGN_in_expression21060_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_BXOR_ASSIGN_in_expression21060 = { FOLLOW_BXOR_ASSIGN_in_expression21060_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression21065 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression21065_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression21065 = { FOLLOW_expression_in_expression21065_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BXOR_ASSIGN_AFTER_in_expression21074 */
+static ANTLR3_BITWORD FOLLOW_BXOR_ASSIGN_AFTER_in_expression21074_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_BXOR_ASSIGN_AFTER_in_expression21074 = { FOLLOW_BXOR_ASSIGN_AFTER_in_expression21074_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression21079 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression21079_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression21079 = { FOLLOW_expression_in_expression21079_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LSHIFT_ASSIGN_in_expression21088 */
+static ANTLR3_BITWORD FOLLOW_LSHIFT_ASSIGN_in_expression21088_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LSHIFT_ASSIGN_in_expression21088 = { FOLLOW_LSHIFT_ASSIGN_in_expression21088_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression21093 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression21093_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression21093 = { FOLLOW_expression_in_expression21093_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LSHIFT_ASSIGN_AFTER_in_expression21102 */
+static ANTLR3_BITWORD FOLLOW_LSHIFT_ASSIGN_AFTER_in_expression21102_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LSHIFT_ASSIGN_AFTER_in_expression21102 = { FOLLOW_LSHIFT_ASSIGN_AFTER_in_expression21102_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression21107 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression21107_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression21107 = { FOLLOW_expression_in_expression21107_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RSHIFT_ASSIGN_in_expression21116 */
+static ANTLR3_BITWORD FOLLOW_RSHIFT_ASSIGN_in_expression21116_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_RSHIFT_ASSIGN_in_expression21116 = { FOLLOW_RSHIFT_ASSIGN_in_expression21116_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression21121 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression21121_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression21121 = { FOLLOW_expression_in_expression21121_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RSHIFT_ASSIGN_AFTER_in_expression21130 */
+static ANTLR3_BITWORD FOLLOW_RSHIFT_ASSIGN_AFTER_in_expression21130_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_RSHIFT_ASSIGN_AFTER_in_expression21130 = { FOLLOW_RSHIFT_ASSIGN_AFTER_in_expression21130_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression21135 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression21135_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression21135 = { FOLLOW_expression_in_expression21135_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_PUSH_in_expression21144 */
+static ANTLR3_BITWORD FOLLOW_OP_PUSH_in_expression21144_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_PUSH_in_expression21144 = { FOLLOW_OP_PUSH_in_expression21144_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression21149 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression21149_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression21149 = { FOLLOW_expression_in_expression21149_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_ASSIGN_TOP_in_expression21158 */
+static ANTLR3_BITWORD FOLLOW_OP_ASSIGN_TOP_in_expression21158_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_ASSIGN_TOP_in_expression21158 = { FOLLOW_OP_ASSIGN_TOP_in_expression21158_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression21163 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression21163_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression21163 = { FOLLOW_expression_in_expression21163_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_POP_in_expression21172 */
+static ANTLR3_BITWORD FOLLOW_OP_POP_in_expression21172_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_POP_in_expression21172 = { FOLLOW_OP_POP_in_expression21172_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression21177 */
+static ANTLR3_BITWORD FOLLOW_expression_in_expression21177_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression21177 = { FOLLOW_expression_in_expression21177_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_scheduleExpression_in_conditionalExpression21205 */
+static ANTLR3_BITWORD FOLLOW_scheduleExpression_in_conditionalExpression21205_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0800000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_scheduleExpression_in_conditionalExpression21205 = { FOLLOW_scheduleExpression_in_conditionalExpression21205_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_QUESTION_in_conditionalExpression21215 */
+static ANTLR3_BITWORD FOLLOW_QUESTION_in_conditionalExpression21215_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_QUESTION_in_conditionalExpression21215 = { FOLLOW_QUESTION_in_conditionalExpression21215_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_conditionalExpression21220 */
+static ANTLR3_BITWORD FOLLOW_expression_in_conditionalExpression21220_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_conditionalExpression21220 = { FOLLOW_expression_in_conditionalExpression21220_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COLON_in_conditionalExpression21223 */
+static ANTLR3_BITWORD FOLLOW_COLON_in_conditionalExpression21223_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COLON_in_conditionalExpression21223 = { FOLLOW_COLON_in_conditionalExpression21223_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_conditionalExpression21228 */
+static ANTLR3_BITWORD FOLLOW_expression_in_conditionalExpression21228_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_conditionalExpression21228 = { FOLLOW_expression_in_conditionalExpression21228_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_conditionalOrExpression_in_scheduleExpression21256 */
+static ANTLR3_BITWORD FOLLOW_conditionalOrExpression_in_scheduleExpression21256_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0003FC9FFC000000) };
+static ANTLR3_BITSET_LIST FOLLOW_conditionalOrExpression_in_scheduleExpression21256 = { FOLLOW_conditionalOrExpression_in_scheduleExpression21256_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_op_sequence_in_scheduleExpression21270 */
+static ANTLR3_BITWORD FOLLOW_op_sequence_in_scheduleExpression21270_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_op_sequence_in_scheduleExpression21270 = { FOLLOW_op_sequence_in_scheduleExpression21270_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_op_scheduling_in_scheduleExpression21278 */
+static ANTLR3_BITWORD FOLLOW_op_scheduling_in_scheduleExpression21278_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_op_scheduling_in_scheduleExpression21278 = { FOLLOW_op_scheduling_in_scheduleExpression21278_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_op_concurrency_in_scheduleExpression21286 */
+static ANTLR3_BITWORD FOLLOW_op_concurrency_in_scheduleExpression21286_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_op_concurrency_in_scheduleExpression21286 = { FOLLOW_op_concurrency_in_scheduleExpression21286_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_conditionalOrExpression_in_scheduleExpression21297 */
+static ANTLR3_BITWORD FOLLOW_conditionalOrExpression_in_scheduleExpression21297_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0003FC9FFC000000) };
+static ANTLR3_BITSET_LIST FOLLOW_conditionalOrExpression_in_scheduleExpression21297 = { FOLLOW_conditionalOrExpression_in_scheduleExpression21297_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_conditionalAndExpression_in_conditionalOrExpression21323 */
+static ANTLR3_BITWORD FOLLOW_conditionalAndExpression_in_conditionalOrExpression21323_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000008) };
+static ANTLR3_BITSET_LIST FOLLOW_conditionalAndExpression_in_conditionalOrExpression21323 = { FOLLOW_conditionalAndExpression_in_conditionalOrExpression21323_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LOR_in_conditionalOrExpression21333 */
+static ANTLR3_BITWORD FOLLOW_LOR_in_conditionalOrExpression21333_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LOR_in_conditionalOrExpression21333 = { FOLLOW_LOR_in_conditionalOrExpression21333_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_conditionalAndExpression_in_conditionalOrExpression21337 */
+static ANTLR3_BITWORD FOLLOW_conditionalAndExpression_in_conditionalOrExpression21337_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000008) };
+static ANTLR3_BITSET_LIST FOLLOW_conditionalAndExpression_in_conditionalOrExpression21337 = { FOLLOW_conditionalAndExpression_in_conditionalOrExpression21337_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_bitwiseOrExpression_in_conditionalAndExpression21365 */
+static ANTLR3_BITWORD FOLLOW_bitwiseOrExpression_in_conditionalAndExpression21365_bits[] = { ANTLR3_UINT64_LIT(0x0100000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_bitwiseOrExpression_in_conditionalAndExpression21365 = { FOLLOW_bitwiseOrExpression_in_conditionalAndExpression21365_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LAND_in_conditionalAndExpression21375 */
+static ANTLR3_BITWORD FOLLOW_LAND_in_conditionalAndExpression21375_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LAND_in_conditionalAndExpression21375 = { FOLLOW_LAND_in_conditionalAndExpression21375_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_bitwiseOrExpression_in_conditionalAndExpression21379 */
+static ANTLR3_BITWORD FOLLOW_bitwiseOrExpression_in_conditionalAndExpression21379_bits[] = { ANTLR3_UINT64_LIT(0x0100000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_bitwiseOrExpression_in_conditionalAndExpression21379 = { FOLLOW_bitwiseOrExpression_in_conditionalAndExpression21379_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_bitwiseXorExpression_in_bitwiseOrExpression21407 */
+static ANTLR3_BITWORD FOLLOW_bitwiseXorExpression_in_bitwiseOrExpression21407_bits[] = { ANTLR3_UINT64_LIT(0x0000000000004002) };
+static ANTLR3_BITSET_LIST FOLLOW_bitwiseXorExpression_in_bitwiseOrExpression21407 = { FOLLOW_bitwiseXorExpression_in_bitwiseOrExpression21407_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BOR_in_bitwiseOrExpression21417 */
+static ANTLR3_BITWORD FOLLOW_BOR_in_bitwiseOrExpression21417_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_BOR_in_bitwiseOrExpression21417 = { FOLLOW_BOR_in_bitwiseOrExpression21417_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_bitwiseXorExpression_in_bitwiseOrExpression21421 */
+static ANTLR3_BITWORD FOLLOW_bitwiseXorExpression_in_bitwiseOrExpression21421_bits[] = { ANTLR3_UINT64_LIT(0x0000000000004002) };
+static ANTLR3_BITSET_LIST FOLLOW_bitwiseXorExpression_in_bitwiseOrExpression21421 = { FOLLOW_bitwiseXorExpression_in_bitwiseOrExpression21421_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_bitwiseAndExpression_in_bitwiseXorExpression21449 */
+static ANTLR3_BITWORD FOLLOW_bitwiseAndExpression_in_bitwiseXorExpression21449_bits[] = { ANTLR3_UINT64_LIT(0x0000000000020002) };
+static ANTLR3_BITSET_LIST FOLLOW_bitwiseAndExpression_in_bitwiseXorExpression21449 = { FOLLOW_bitwiseAndExpression_in_bitwiseXorExpression21449_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BXOR_in_bitwiseXorExpression21459 */
+static ANTLR3_BITWORD FOLLOW_BXOR_in_bitwiseXorExpression21459_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_BXOR_in_bitwiseXorExpression21459 = { FOLLOW_BXOR_in_bitwiseXorExpression21459_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_bitwiseAndExpression_in_bitwiseXorExpression21463 */
+static ANTLR3_BITWORD FOLLOW_bitwiseAndExpression_in_bitwiseXorExpression21463_bits[] = { ANTLR3_UINT64_LIT(0x0000000000020002) };
+static ANTLR3_BITSET_LIST FOLLOW_bitwiseAndExpression_in_bitwiseXorExpression21463 = { FOLLOW_bitwiseAndExpression_in_bitwiseXorExpression21463_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_equalityExpression_in_bitwiseAndExpression21491 */
+static ANTLR3_BITWORD FOLLOW_equalityExpression_in_bitwiseAndExpression21491_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000202) };
+static ANTLR3_BITSET_LIST FOLLOW_equalityExpression_in_bitwiseAndExpression21491 = { FOLLOW_equalityExpression_in_bitwiseAndExpression21491_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BAND_in_bitwiseAndExpression21501 */
+static ANTLR3_BITWORD FOLLOW_BAND_in_bitwiseAndExpression21501_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_BAND_in_bitwiseAndExpression21501 = { FOLLOW_BAND_in_bitwiseAndExpression21501_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_equalityExpression_in_bitwiseAndExpression21505 */
+static ANTLR3_BITWORD FOLLOW_equalityExpression_in_bitwiseAndExpression21505_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000202) };
+static ANTLR3_BITSET_LIST FOLLOW_equalityExpression_in_bitwiseAndExpression21505 = { FOLLOW_equalityExpression_in_bitwiseAndExpression21505_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_relationalExpression_in_equalityExpression21537 */
+static ANTLR3_BITWORD FOLLOW_relationalExpression_in_equalityExpression21537_bits[] = { ANTLR3_UINT64_LIT(0x0000008000000002), ANTLR3_UINT64_LIT(0x0000000000600000), ANTLR3_UINT64_LIT(0x0000000000000100) };
+static ANTLR3_BITSET_LIST FOLLOW_relationalExpression_in_equalityExpression21537 = { FOLLOW_relationalExpression_in_equalityExpression21537_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_equalOp_in_equalityExpression21549 */
+static ANTLR3_BITWORD FOLLOW_equalOp_in_equalityExpression21549_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_equalOp_in_equalityExpression21549 = { FOLLOW_equalOp_in_equalityExpression21549_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_relationalExpression_in_equalityExpression21553 */
+static ANTLR3_BITWORD FOLLOW_relationalExpression_in_equalityExpression21553_bits[] = { ANTLR3_UINT64_LIT(0x0000008000000002), ANTLR3_UINT64_LIT(0x0000000000600000), ANTLR3_UINT64_LIT(0x0000000000000100) };
+static ANTLR3_BITSET_LIST FOLLOW_relationalExpression_in_equalityExpression21553 = { FOLLOW_relationalExpression_in_equalityExpression21553_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_equalOp_in_equalityExpression21569 */
+static ANTLR3_BITWORD FOLLOW_equalOp_in_equalityExpression21569_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_equalOp_in_equalityExpression21569 = { FOLLOW_equalOp_in_equalityExpression21569_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_relationalExpression_in_equalityExpression21573 */
+static ANTLR3_BITWORD FOLLOW_relationalExpression_in_equalityExpression21573_bits[] = { ANTLR3_UINT64_LIT(0x0000008000000002), ANTLR3_UINT64_LIT(0x0000000000600000), ANTLR3_UINT64_LIT(0x0000000000000100) };
+static ANTLR3_BITSET_LIST FOLLOW_relationalExpression_in_equalityExpression21573 = { FOLLOW_relationalExpression_in_equalityExpression21573_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_EQUAL_in_equalOp21614 */
+static ANTLR3_BITWORD FOLLOW_EQUAL_in_equalOp21614_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_EQUAL_in_equalOp21614 = { FOLLOW_EQUAL_in_equalOp21614_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_NEQUAL_in_equalOp21623 */
+static ANTLR3_BITWORD FOLLOW_NEQUAL_in_equalOp21623_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_NEQUAL_in_equalOp21623 = { FOLLOW_NEQUAL_in_equalOp21623_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEQUAL_in_equalOp21631 */
+static ANTLR3_BITWORD FOLLOW_SEQUAL_in_equalOp21631_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEQUAL_in_equalOp21631 = { FOLLOW_SEQUAL_in_equalOp21631_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_NSEQUAL_in_equalOp21639 */
+static ANTLR3_BITWORD FOLLOW_NSEQUAL_in_equalOp21639_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_NSEQUAL_in_equalOp21639 = { FOLLOW_NSEQUAL_in_equalOp21639_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_shiftExpression_in_relationalExpression21663 */
+static ANTLR3_BITWORD FOLLOW_shiftExpression_in_relationalExpression21663_bits[] = { ANTLR3_UINT64_LIT(0x0000600000000002), ANTLR3_UINT64_LIT(0x0000000000003000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000008000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_shiftExpression_in_relationalExpression21663 = { FOLLOW_shiftExpression_in_relationalExpression21663_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_relationalOp_in_relationalExpression21675 */
+static ANTLR3_BITWORD FOLLOW_relationalOp_in_relationalExpression21675_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_relationalOp_in_relationalExpression21675 = { FOLLOW_relationalOp_in_relationalExpression21675_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_shiftExpression_in_relationalExpression21679 */
+static ANTLR3_BITWORD FOLLOW_shiftExpression_in_relationalExpression21679_bits[] = { ANTLR3_UINT64_LIT(0x0000600000000002), ANTLR3_UINT64_LIT(0x0000000000003000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000008000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_shiftExpression_in_relationalExpression21679 = { FOLLOW_shiftExpression_in_relationalExpression21679_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_relationalOp_in_relationalExpression21695 */
+static ANTLR3_BITWORD FOLLOW_relationalOp_in_relationalExpression21695_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_relationalOp_in_relationalExpression21695 = { FOLLOW_relationalOp_in_relationalExpression21695_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_shiftExpression_in_relationalExpression21699 */
+static ANTLR3_BITWORD FOLLOW_shiftExpression_in_relationalExpression21699_bits[] = { ANTLR3_UINT64_LIT(0x0000600000000002), ANTLR3_UINT64_LIT(0x0000000000003000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000008000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_shiftExpression_in_relationalExpression21699 = { FOLLOW_shiftExpression_in_relationalExpression21699_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LTE_in_relationalOp21740 */
+static ANTLR3_BITWORD FOLLOW_LTE_in_relationalOp21740_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_LTE_in_relationalOp21740 = { FOLLOW_LTE_in_relationalOp21740_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GTE_in_relationalOp21748 */
+static ANTLR3_BITWORD FOLLOW_GTE_in_relationalOp21748_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_GTE_in_relationalOp21748 = { FOLLOW_GTE_in_relationalOp21748_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_relationalOp21756 */
+static ANTLR3_BITWORD FOLLOW_LT__in_relationalOp21756_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_relationalOp21756 = { FOLLOW_LT__in_relationalOp21756_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_relationalOp21764 */
+static ANTLR3_BITWORD FOLLOW_GT_in_relationalOp21764_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_relationalOp21764 = { FOLLOW_GT_in_relationalOp21764_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_295_in_relationalOp21774 */
+static ANTLR3_BITWORD FOLLOW_295_in_relationalOp21774_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_295_in_relationalOp21774 = { FOLLOW_295_in_relationalOp21774_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_additiveExpression_in_shiftExpression21806 */
+static ANTLR3_BITWORD FOLLOW_additiveExpression_in_shiftExpression21806_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000200), ANTLR3_UINT64_LIT(0x0000000000000008) };
+static ANTLR3_BITSET_LIST FOLLOW_additiveExpression_in_shiftExpression21806 = { FOLLOW_additiveExpression_in_shiftExpression21806_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_shiftOp_in_shiftExpression21818 */
+static ANTLR3_BITWORD FOLLOW_shiftOp_in_shiftExpression21818_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_shiftOp_in_shiftExpression21818 = { FOLLOW_shiftOp_in_shiftExpression21818_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_additiveExpression_in_shiftExpression21822 */
+static ANTLR3_BITWORD FOLLOW_additiveExpression_in_shiftExpression21822_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000000200), ANTLR3_UINT64_LIT(0x0000000000000008) };
+static ANTLR3_BITSET_LIST FOLLOW_additiveExpression_in_shiftExpression21822 = { FOLLOW_additiveExpression_in_shiftExpression21822_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LSHIFT_in_shiftOp21849 */
+static ANTLR3_BITWORD FOLLOW_LSHIFT_in_shiftOp21849_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_LSHIFT_in_shiftOp21849 = { FOLLOW_LSHIFT_in_shiftOp21849_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RSHIFT_in_shiftOp21857 */
+static ANTLR3_BITWORD FOLLOW_RSHIFT_in_shiftOp21857_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RSHIFT_in_shiftOp21857 = { FOLLOW_RSHIFT_in_shiftOp21857_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_multiplicativeExpression_in_additiveExpression21882 */
+static ANTLR3_BITWORD FOLLOW_multiplicativeExpression_in_additiveExpression21882_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0100000000008000) };
+static ANTLR3_BITSET_LIST FOLLOW_multiplicativeExpression_in_additiveExpression21882 = { FOLLOW_multiplicativeExpression_in_additiveExpression21882_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_PLUS_in_additiveExpression21894 */
+static ANTLR3_BITWORD FOLLOW_PLUS_in_additiveExpression21894_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_PLUS_in_additiveExpression21894 = { FOLLOW_PLUS_in_additiveExpression21894_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_MINUS_in_additiveExpression21906 */
+static ANTLR3_BITWORD FOLLOW_MINUS_in_additiveExpression21906_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_MINUS_in_additiveExpression21906 = { FOLLOW_MINUS_in_additiveExpression21906_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_multiplicativeExpression_in_additiveExpression21924 */
+static ANTLR3_BITWORD FOLLOW_multiplicativeExpression_in_additiveExpression21924_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0100000000008000) };
+static ANTLR3_BITSET_LIST FOLLOW_multiplicativeExpression_in_additiveExpression21924 = { FOLLOW_multiplicativeExpression_in_additiveExpression21924_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_unaryExpression_in_multiplicativeExpression21958 */
+static ANTLR3_BITWORD FOLLOW_unaryExpression_in_multiplicativeExpression21958_bits[] = { ANTLR3_UINT64_LIT(0x0000000010000002), ANTLR3_UINT64_LIT(0x0000000000040000), ANTLR3_UINT64_LIT(0x0000000000000200) };
+static ANTLR3_BITSET_LIST FOLLOW_unaryExpression_in_multiplicativeExpression21958 = { FOLLOW_unaryExpression_in_multiplicativeExpression21958_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STAR_in_multiplicativeExpression21970 */
+static ANTLR3_BITWORD FOLLOW_STAR_in_multiplicativeExpression21970_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_STAR_in_multiplicativeExpression21970 = { FOLLOW_STAR_in_multiplicativeExpression21970_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DIV_in_multiplicativeExpression21981 */
+static ANTLR3_BITWORD FOLLOW_DIV_in_multiplicativeExpression21981_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_DIV_in_multiplicativeExpression21981 = { FOLLOW_DIV_in_multiplicativeExpression21981_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_MOD_in_multiplicativeExpression21993 */
+static ANTLR3_BITWORD FOLLOW_MOD_in_multiplicativeExpression21993_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_MOD_in_multiplicativeExpression21993 = { FOLLOW_MOD_in_multiplicativeExpression21993_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_unaryExpression_in_multiplicativeExpression22012 */
+static ANTLR3_BITWORD FOLLOW_unaryExpression_in_multiplicativeExpression22012_bits[] = { ANTLR3_UINT64_LIT(0x0000000010000002), ANTLR3_UINT64_LIT(0x0000000000040000), ANTLR3_UINT64_LIT(0x0000000000000200) };
+static ANTLR3_BITSET_LIST FOLLOW_unaryExpression_in_multiplicativeExpression22012 = { FOLLOW_unaryExpression_in_multiplicativeExpression22012_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_PLUS_in_unaryExpression22042 */
+static ANTLR3_BITWORD FOLLOW_PLUS_in_unaryExpression22042_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_PLUS_in_unaryExpression22042 = { FOLLOW_PLUS_in_unaryExpression22042_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_unaryExpression_in_unaryExpression22047 */
+static ANTLR3_BITWORD FOLLOW_unaryExpression_in_unaryExpression22047_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_unaryExpression_in_unaryExpression22047 = { FOLLOW_unaryExpression_in_unaryExpression22047_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_MINUS_in_unaryExpression22056 */
+static ANTLR3_BITWORD FOLLOW_MINUS_in_unaryExpression22056_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_MINUS_in_unaryExpression22056 = { FOLLOW_MINUS_in_unaryExpression22056_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_unaryExpression_in_unaryExpression22060 */
+static ANTLR3_BITWORD FOLLOW_unaryExpression_in_unaryExpression22060_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_unaryExpression_in_unaryExpression22060 = { FOLLOW_unaryExpression_in_unaryExpression22060_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INCR_in_unaryExpression22069 */
+static ANTLR3_BITWORD FOLLOW_INCR_in_unaryExpression22069_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_INCR_in_unaryExpression22069 = { FOLLOW_INCR_in_unaryExpression22069_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_unaryExpression_in_unaryExpression22074 */
+static ANTLR3_BITWORD FOLLOW_unaryExpression_in_unaryExpression22074_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_unaryExpression_in_unaryExpression22074 = { FOLLOW_unaryExpression_in_unaryExpression22074_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DECR_in_unaryExpression22082 */
+static ANTLR3_BITWORD FOLLOW_DECR_in_unaryExpression22082_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_DECR_in_unaryExpression22082 = { FOLLOW_DECR_in_unaryExpression22082_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_unaryExpression_in_unaryExpression22087 */
+static ANTLR3_BITWORD FOLLOW_unaryExpression_in_unaryExpression22087_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_unaryExpression_in_unaryExpression22087 = { FOLLOW_unaryExpression_in_unaryExpression22087_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LNOT_in_unaryExpression22096 */
+static ANTLR3_BITWORD FOLLOW_LNOT_in_unaryExpression22096_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LNOT_in_unaryExpression22096 = { FOLLOW_LNOT_in_unaryExpression22096_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_unaryExpression_in_unaryExpression22100 */
+static ANTLR3_BITWORD FOLLOW_unaryExpression_in_unaryExpression22100_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_unaryExpression_in_unaryExpression22100 = { FOLLOW_unaryExpression_in_unaryExpression22100_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BNOT_in_unaryExpression22109 */
+static ANTLR3_BITWORD FOLLOW_BNOT_in_unaryExpression22109_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_BNOT_in_unaryExpression22109 = { FOLLOW_BNOT_in_unaryExpression22109_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_unaryExpression_in_unaryExpression22113 */
+static ANTLR3_BITWORD FOLLOW_unaryExpression_in_unaryExpression22113_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_unaryExpression_in_unaryExpression22113 = { FOLLOW_unaryExpression_in_unaryExpression22113_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_POP_in_unaryExpression22122 */
+static ANTLR3_BITWORD FOLLOW_OP_POP_in_unaryExpression22122_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_POP_in_unaryExpression22122 = { FOLLOW_OP_POP_in_unaryExpression22122_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_unaryExpression_in_unaryExpression22128 */
+static ANTLR3_BITWORD FOLLOW_unaryExpression_in_unaryExpression22128_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_unaryExpression_in_unaryExpression22128 = { FOLLOW_unaryExpression_in_unaryExpression22128_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_TOP_in_unaryExpression22137 */
+static ANTLR3_BITWORD FOLLOW_OP_TOP_in_unaryExpression22137_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_TOP_in_unaryExpression22137 = { FOLLOW_OP_TOP_in_unaryExpression22137_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_unaryExpression_in_unaryExpression22143 */
+static ANTLR3_BITWORD FOLLOW_unaryExpression_in_unaryExpression22143_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_unaryExpression_in_unaryExpression22143 = { FOLLOW_unaryExpression_in_unaryExpression22143_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_prefix_expression_in_unaryExpression22158 */
+static ANTLR3_BITWORD FOLLOW_prefix_expression_in_unaryExpression22158_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_prefix_expression_in_unaryExpression22158 = { FOLLOW_prefix_expression_in_unaryExpression22158_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_invoke_in_unaryExpression22178 */
+static ANTLR3_BITWORD FOLLOW_expression_invoke_in_unaryExpression22178_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_invoke_in_unaryExpression22178 = { FOLLOW_expression_invoke_in_unaryExpression22178_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_activity_new_in_unaryExpression22198 */
+static ANTLR3_BITWORD FOLLOW_expression_activity_new_in_unaryExpression22198_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_activity_new_in_unaryExpression22198 = { FOLLOW_expression_activity_new_in_unaryExpression22198_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_com_in_unaryExpression22213 */
+static ANTLR3_BITWORD FOLLOW_expression_com_in_unaryExpression22213_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_com_in_unaryExpression22213 = { FOLLOW_expression_com_in_unaryExpression22213_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_guard_in_unaryExpression22235 */
+static ANTLR3_BITWORD FOLLOW_expression_guard_in_unaryExpression22235_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_guard_in_unaryExpression22235 = { FOLLOW_expression_guard_in_unaryExpression22235_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_ite_in_unaryExpression22255 */
+static ANTLR3_BITWORD FOLLOW_expression_ite_in_unaryExpression22255_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_ite_in_unaryExpression22255 = { FOLLOW_expression_ite_in_unaryExpression22255_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_lambda_in_unaryExpression22277 */
+static ANTLR3_BITWORD FOLLOW_expression_lambda_in_unaryExpression22277_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_lambda_in_unaryExpression22277 = { FOLLOW_expression_lambda_in_unaryExpression22277_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ctorExpression_in_unaryExpression22301 */
+static ANTLR3_BITWORD FOLLOW_ctorExpression_in_unaryExpression22301_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ctorExpression_in_unaryExpression22301 = { FOLLOW_ctorExpression_in_unaryExpression22301_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_primary_in_unaryExpression22324 */
+static ANTLR3_BITWORD FOLLOW_primary_in_unaryExpression22324_bits[] = { ANTLR3_UINT64_LIT(0x0008000004000002) };
+static ANTLR3_BITSET_LIST FOLLOW_primary_in_unaryExpression22324 = { FOLLOW_primary_in_unaryExpression22324_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INCR_in_unaryExpression22353 */
+static ANTLR3_BITWORD FOLLOW_INCR_in_unaryExpression22353_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_INCR_in_unaryExpression22353 = { FOLLOW_INCR_in_unaryExpression22353_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DECR_in_unaryExpression22364 */
+static ANTLR3_BITWORD FOLLOW_DECR_in_unaryExpression22364_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_DECR_in_unaryExpression22364 = { FOLLOW_DECR_in_unaryExpression22364_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_literal_in_unaryExpression22382 */
+static ANTLR3_BITWORD FOLLOW_literal_in_unaryExpression22382_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_literal_in_unaryExpression22382 = { FOLLOW_literal_in_unaryExpression22382_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_quote_expression_in_unaryExpression22412 */
+static ANTLR3_BITWORD FOLLOW_quote_expression_in_unaryExpression22412_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_quote_expression_in_unaryExpression22412 = { FOLLOW_quote_expression_in_unaryExpression22412_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_meta_eval_expression_in_unaryExpression22433 */
+static ANTLR3_BITWORD FOLLOW_meta_eval_expression_in_unaryExpression22433_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_meta_eval_expression_in_unaryExpression22433 = { FOLLOW_meta_eval_expression_in_unaryExpression22433_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_unaryExpression22448 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_unaryExpression22448_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_unaryExpression22448 = { FOLLOW_LPAREN_in_unaryExpression22448_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_unaryExpression22453 */
+static ANTLR3_BITWORD FOLLOW_expression_in_unaryExpression22453_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_unaryExpression22453 = { FOLLOW_expression_in_unaryExpression22453_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_unaryExpression22456 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_unaryExpression22456_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_unaryExpression22456 = { FOLLOW_RPAREN_in_unaryExpression22456_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_collection_of_expression_in_unaryExpression22467 */
+static ANTLR3_BITWORD FOLLOW_collection_of_expression_in_unaryExpression22467_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_collection_of_expression_in_unaryExpression22467 = { FOLLOW_collection_of_expression_in_unaryExpression22467_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_265_in_ctorExpression22488 */
+static ANTLR3_BITWORD FOLLOW_265_in_ctorExpression22488_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_265_in_ctorExpression22488 = { FOLLOW_265_in_ctorExpression22488_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LT__in_ctorExpression22490 */
+static ANTLR3_BITWORD FOLLOW_LT__in_ctorExpression22490_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_LT__in_ctorExpression22490 = { FOLLOW_LT__in_ctorExpression22490_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_var_in_ctorExpression22495 */
+static ANTLR3_BITWORD FOLLOW_type_var_in_ctorExpression22495_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_type_var_in_ctorExpression22495 = { FOLLOW_type_var_in_ctorExpression22495_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_ctorExpression22498 */
+static ANTLR3_BITWORD FOLLOW_GT_in_ctorExpression22498_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_ctorExpression22498 = { FOLLOW_GT_in_ctorExpression22498_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_ctorExpression22501 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_ctorExpression22501_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_ctorExpression22501 = { FOLLOW_LPAREN_in_ctorExpression22501_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_ctorExpression22506 */
+static ANTLR3_BITWORD FOLLOW_expression_in_ctorExpression22506_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_ctorExpression22506 = { FOLLOW_expression_in_ctorExpression22506_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_ctorExpression22509 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_ctorExpression22509_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_ctorExpression22509 = { FOLLOW_RPAREN_in_ctorExpression22509_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_PERCENT_LCURLY_in_quote_expression22532 */
+static ANTLR3_BITWORD FOLLOW_PERCENT_LCURLY_in_quote_expression22532_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_PERCENT_LCURLY_in_quote_expression22532 = { FOLLOW_PERCENT_LCURLY_in_quote_expression22532_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_quote_expression22537 */
+static ANTLR3_BITWORD FOLLOW_expression_in_quote_expression22537_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x8000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_quote_expression22537 = { FOLLOW_expression_in_quote_expression22537_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_PERCENT_in_quote_expression22540 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_PERCENT_in_quote_expression22540_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_PERCENT_in_quote_expression22540 = { FOLLOW_RCURLY_PERCENT_in_quote_expression22540_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LBRACKET_BAR_in_meta_eval_expression22559 */
+static ANTLR3_BITWORD FOLLOW_LBRACKET_BAR_in_meta_eval_expression22559_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LBRACKET_BAR_in_meta_eval_expression22559 = { FOLLOW_LBRACKET_BAR_in_meta_eval_expression22559_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_meta_eval_expression22564 */
+static ANTLR3_BITWORD FOLLOW_expression_in_meta_eval_expression22564_bits[] = { ANTLR3_UINT64_LIT(0x0000000000001000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_meta_eval_expression22564 = { FOLLOW_expression_in_meta_eval_expression22564_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BAR_RBRACKET_in_meta_eval_expression22567 */
+static ANTLR3_BITWORD FOLLOW_BAR_RBRACKET_in_meta_eval_expression22567_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_BAR_RBRACKET_in_meta_eval_expression22567 = { FOLLOW_BAR_RBRACKET_in_meta_eval_expression22567_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_primary22594 */
+static ANTLR3_BITWORD FOLLOW_ID_in_primary22594_bits[] = { ANTLR3_UINT64_LIT(0x1000000200400002), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_primary22594 = { FOLLOW_ID_in_primary22594_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_primary_invoke_in_primary22619 */
+static ANTLR3_BITWORD FOLLOW_primary_invoke_in_primary22619_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_primary_invoke_in_primary22619 = { FOLLOW_primary_invoke_in_primary22619_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_primary_ufid_in_primary22649 */
+static ANTLR3_BITWORD FOLLOW_primary_ufid_in_primary22649_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_primary_ufid_in_primary22649 = { FOLLOW_primary_ufid_in_primary22649_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_primary_ufi_in_primary22681 */
+static ANTLR3_BITWORD FOLLOW_primary_ufi_in_primary22681_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_primary_ufi_in_primary22681 = { FOLLOW_primary_ufi_in_primary22681_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_primary_ufi_in_primary22708 */
+static ANTLR3_BITWORD FOLLOW_primary_ufi_in_primary22708_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_primary_ufi_in_primary22708 = { FOLLOW_primary_ufi_in_primary22708_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DOT_in_primary_ufid22738 */
+static ANTLR3_BITWORD FOLLOW_DOT_in_primary_ufid22738_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_DOT_in_primary_ufid22738 = { FOLLOW_DOT_in_primary_ufid22738_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_primary_ufid22742 */
+static ANTLR3_BITWORD FOLLOW_ID_in_primary_ufid22742_bits[] = { ANTLR3_UINT64_LIT(0x1000000200000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_primary_ufid22742 = { FOLLOW_ID_in_primary_ufid22742_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LBRACKET_in_primary_ufid22761 */
+static ANTLR3_BITWORD FOLLOW_LBRACKET_in_primary_ufid22761_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LBRACKET_in_primary_ufid22761 = { FOLLOW_LBRACKET_in_primary_ufid22761_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_primary_ufid22766 */
+static ANTLR3_BITWORD FOLLOW_expression_in_primary_ufid22766_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_primary_ufid22766 = { FOLLOW_expression_in_primary_ufid22766_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RBRACKET_in_primary_ufid22769 */
+static ANTLR3_BITWORD FOLLOW_RBRACKET_in_primary_ufid22769_bits[] = { ANTLR3_UINT64_LIT(0x1000000200000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RBRACKET_in_primary_ufid22769 = { FOLLOW_RBRACKET_in_primary_ufid22769_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COLONx2_in_primary_ufi22815 */
+static ANTLR3_BITWORD FOLLOW_COLONx2_in_primary_ufi22815_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_COLONx2_in_primary_ufi22815 = { FOLLOW_COLONx2_in_primary_ufi22815_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_primary_ufi22819 */
+static ANTLR3_BITWORD FOLLOW_ID_in_primary_ufi22819_bits[] = { ANTLR3_UINT64_LIT(0x1000000200000000) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_primary_ufi22819 = { FOLLOW_ID_in_primary_ufi22819_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DOT_in_primary_ufi22834 */
+static ANTLR3_BITWORD FOLLOW_DOT_in_primary_ufi22834_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_DOT_in_primary_ufi22834 = { FOLLOW_DOT_in_primary_ufi22834_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_primary_ufi22838 */
+static ANTLR3_BITWORD FOLLOW_ID_in_primary_ufi22838_bits[] = { ANTLR3_UINT64_LIT(0x1000000200000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_primary_ufi22838 = { FOLLOW_ID_in_primary_ufi22838_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LBRACKET_in_primary_ufi22857 */
+static ANTLR3_BITWORD FOLLOW_LBRACKET_in_primary_ufi22857_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LBRACKET_in_primary_ufi22857 = { FOLLOW_LBRACKET_in_primary_ufi22857_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_primary_ufi22862 */
+static ANTLR3_BITWORD FOLLOW_expression_in_primary_ufi22862_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_primary_ufi22862 = { FOLLOW_expression_in_primary_ufi22862_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RBRACKET_in_primary_ufi22865 */
+static ANTLR3_BITWORD FOLLOW_RBRACKET_in_primary_ufi22865_bits[] = { ANTLR3_UINT64_LIT(0x1000000200000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RBRACKET_in_primary_ufi22865 = { FOLLOW_RBRACKET_in_primary_ufi22865_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_primary_invoke22915 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_primary_invoke22915_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002042), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_primary_invoke22915 = { FOLLOW_LPAREN_in_primary_invoke22915_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_labelled_argument_in_primary_invoke22924 */
+static ANTLR3_BITWORD FOLLOW_labelled_argument_in_primary_invoke22924_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_labelled_argument_in_primary_invoke22924 = { FOLLOW_labelled_argument_in_primary_invoke22924_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_primary_invoke22940 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_primary_invoke22940_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_primary_invoke22940 = { FOLLOW_COMMA_in_primary_invoke22940_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_labelled_argument_in_primary_invoke22949 */
+static ANTLR3_BITWORD FOLLOW_labelled_argument_in_primary_invoke22949_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_labelled_argument_in_primary_invoke22949 = { FOLLOW_labelled_argument_in_primary_invoke22949_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_primary_invoke22975 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_primary_invoke22975_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_primary_invoke22975 = { FOLLOW_RPAREN_in_primary_invoke22975_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_IntegerLiteral_in_literal22997 */
+static ANTLR3_BITWORD FOLLOW_IntegerLiteral_in_literal22997_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_IntegerLiteral_in_literal22997 = { FOLLOW_IntegerLiteral_in_literal22997_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RationalLiteral_in_literal23005 */
+static ANTLR3_BITWORD FOLLOW_RationalLiteral_in_literal23005_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RationalLiteral_in_literal23005 = { FOLLOW_RationalLiteral_in_literal23005_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_FloatLiteral_in_literal23012 */
+static ANTLR3_BITWORD FOLLOW_FloatLiteral_in_literal23012_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_FloatLiteral_in_literal23012 = { FOLLOW_FloatLiteral_in_literal23012_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_CharLiteral_in_literal23023 */
+static ANTLR3_BITWORD FOLLOW_CharLiteral_in_literal23023_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_CharLiteral_in_literal23023 = { FOLLOW_CharLiteral_in_literal23023_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_StringLiteral_in_literal23034 */
+static ANTLR3_BITWORD FOLLOW_StringLiteral_in_literal23034_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_StringLiteral_in_literal23034 = { FOLLOW_StringLiteral_in_literal23034_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_397_in_literal23044 */
+static ANTLR3_BITWORD FOLLOW_397_in_literal23044_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_397_in_literal23044 = { FOLLOW_397_in_literal23044_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_280_in_literal23053 */
+static ANTLR3_BITWORD FOLLOW_280_in_literal23053_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_280_in_literal23053 = { FOLLOW_280_in_literal23053_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_372_in_literal23062 */
+static ANTLR3_BITWORD FOLLOW_372_in_literal23062_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_372_in_literal23062 = { FOLLOW_372_in_literal23062_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_343_in_literal23071 */
+static ANTLR3_BITWORD FOLLOW_343_in_literal23071_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_343_in_literal23071 = { FOLLOW_343_in_literal23071_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_277_in_literal23078 */
+static ANTLR3_BITWORD FOLLOW_277_in_literal23078_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_277_in_literal23078 = { FOLLOW_277_in_literal23078_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_162_in_literal23089 */
+static ANTLR3_BITWORD FOLLOW_162_in_literal23089_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_162_in_literal23089 = { FOLLOW_162_in_literal23089_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_160_in_literal23098 */
+static ANTLR3_BITWORD FOLLOW_160_in_literal23098_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_160_in_literal23098 = { FOLLOW_160_in_literal23098_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_159_in_literal23107 */
+static ANTLR3_BITWORD FOLLOW_159_in_literal23107_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_159_in_literal23107 = { FOLLOW_159_in_literal23107_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_161_in_literal23114 */
+static ANTLR3_BITWORD FOLLOW_161_in_literal23114_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_161_in_literal23114 = { FOLLOW_161_in_literal23114_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_158_in_literal23122 */
+static ANTLR3_BITWORD FOLLOW_158_in_literal23122_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_158_in_literal23122 = { FOLLOW_158_in_literal23122_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_332_in_literal23133 */
+static ANTLR3_BITWORD FOLLOW_332_in_literal23133_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2200000000000000), ANTLR3_UINT64_LIT(0x2000000000000000), ANTLR3_UINT64_LIT(0x0040000001000001) };
+static ANTLR3_BITSET_LIST FOLLOW_332_in_literal23133 = { FOLLOW_332_in_literal23133_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_317_in_literal23141 */
+static ANTLR3_BITWORD FOLLOW_317_in_literal23141_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_317_in_literal23141 = { FOLLOW_317_in_literal23141_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_253_in_literal23152 */
+static ANTLR3_BITWORD FOLLOW_253_in_literal23152_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_253_in_literal23152 = { FOLLOW_253_in_literal23152_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_344_in_literal23163 */
+static ANTLR3_BITWORD FOLLOW_344_in_literal23163_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_344_in_literal23163 = { FOLLOW_344_in_literal23163_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_374_in_literal23177 */
+static ANTLR3_BITWORD FOLLOW_374_in_literal23177_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_374_in_literal23177 = { FOLLOW_374_in_literal23177_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_320_in_literal23189 */
+static ANTLR3_BITWORD FOLLOW_320_in_literal23189_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_320_in_literal23189 = { FOLLOW_320_in_literal23189_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_249_in_literal23200 */
+static ANTLR3_BITWORD FOLLOW_249_in_literal23200_bits[] = { ANTLR3_UINT64_LIT(0x0000200000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_249_in_literal23200 = { FOLLOW_249_in_literal23200_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GT_in_literal23212 */
+static ANTLR3_BITWORD FOLLOW_GT_in_literal23212_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_GT_in_literal23212 = { FOLLOW_GT_in_literal23212_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_331_in_literal23217 */
+static ANTLR3_BITWORD FOLLOW_331_in_literal23217_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_331_in_literal23217 = { FOLLOW_331_in_literal23217_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_collection_of_expression23246 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_collection_of_expression23246_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_collection_of_expression23246 = { FOLLOW_LCURLY_in_collection_of_expression23246_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_collection_of_expression23255 */
+static ANTLR3_BITWORD FOLLOW_expression_in_collection_of_expression23255_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_collection_of_expression23255 = { FOLLOW_expression_in_collection_of_expression23255_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_collection_of_expression23275 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_collection_of_expression23275_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_collection_of_expression23275 = { FOLLOW_COMMA_in_collection_of_expression23275_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_collection_of_expression23279 */
+static ANTLR3_BITWORD FOLLOW_expression_in_collection_of_expression23279_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_collection_of_expression23279 = { FOLLOW_expression_in_collection_of_expression23279_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_collection_of_expression23290 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_collection_of_expression23290_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_collection_of_expression23290 = { FOLLOW_RCURLY_in_collection_of_expression23290_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LBRACKET_in_collection_of_expression23301 */
+static ANTLR3_BITWORD FOLLOW_LBRACKET_in_collection_of_expression23301_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LBRACKET_in_collection_of_expression23301 = { FOLLOW_LBRACKET_in_collection_of_expression23301_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_collection_of_expression23310 */
+static ANTLR3_BITWORD FOLLOW_expression_in_collection_of_expression23310_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_collection_of_expression23310 = { FOLLOW_expression_in_collection_of_expression23310_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_collection_of_expression23330 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_collection_of_expression23330_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_collection_of_expression23330 = { FOLLOW_COMMA_in_collection_of_expression23330_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_collection_of_expression23334 */
+static ANTLR3_BITWORD FOLLOW_expression_in_collection_of_expression23334_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_collection_of_expression23334 = { FOLLOW_expression_in_collection_of_expression23334_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RBRACKET_in_collection_of_expression23345 */
+static ANTLR3_BITWORD FOLLOW_RBRACKET_in_collection_of_expression23345_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RBRACKET_in_collection_of_expression23345 = { FOLLOW_RBRACKET_in_collection_of_expression23345_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_406_in_synpred21_fml531 */
+static ANTLR3_BITWORD FOLLOW_406_in_synpred21_fml531_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_406_in_synpred21_fml531 = { FOLLOW_406_in_synpred21_fml531_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_322_in_synpred56_fml1127 */
+static ANTLR3_BITWORD FOLLOW_322_in_synpred56_fml1127_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_322_in_synpred56_fml1127 = { FOLLOW_322_in_synpred56_fml1127_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_353_in_synpred57_fml1144 */
+static ANTLR3_BITWORD FOLLOW_353_in_synpred57_fml1144_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_353_in_synpred57_fml1144 = { FOLLOW_353_in_synpred57_fml1144_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_272_in_synpred58_fml1158 */
+static ANTLR3_BITWORD FOLLOW_272_in_synpred58_fml1158_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_272_in_synpred58_fml1158 = { FOLLOW_272_in_synpred58_fml1158_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_406_in_synpred59_fml1181 */
+static ANTLR3_BITWORD FOLLOW_406_in_synpred59_fml1181_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_406_in_synpred59_fml1181 = { FOLLOW_406_in_synpred59_fml1181_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_393_in_synpred60_fml1198 */
+static ANTLR3_BITWORD FOLLOW_393_in_synpred60_fml1198_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_393_in_synpred60_fml1198 = { FOLLOW_393_in_synpred60_fml1198_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_306_in_synpred61_fml1215 */
+static ANTLR3_BITWORD FOLLOW_306_in_synpred61_fml1215_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_306_in_synpred61_fml1215 = { FOLLOW_306_in_synpred61_fml1215_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_314_in_synpred62_fml1224 */
+static ANTLR3_BITWORD FOLLOW_314_in_synpred62_fml1224_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_314_in_synpred62_fml1224 = { FOLLOW_314_in_synpred62_fml1224_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_synpred95_fml1857 */
+static ANTLR3_BITWORD FOLLOW_set_in_synpred95_fml1857_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_synpred95_fml1857 = { FOLLOW_set_in_synpred95_fml1857_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_synpred95_fml1893 */
+static ANTLR3_BITWORD FOLLOW_ID_in_synpred95_fml1893_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_synpred95_fml1893 = { FOLLOW_ID_in_synpred95_fml1893_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_var_in_synpred115_fml2387 */
+static ANTLR3_BITWORD FOLLOW_type_var_in_synpred115_fml2387_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_type_var_in_synpred115_fml2387 = { FOLLOW_type_var_in_synpred115_fml2387_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COLON_in_synpred115_fml2389 */
+static ANTLR3_BITWORD FOLLOW_COLON_in_synpred115_fml2389_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_COLON_in_synpred115_fml2389 = { FOLLOW_COLON_in_synpred115_fml2389_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_var_in_synpred126_fml2689 */
+static ANTLR3_BITWORD FOLLOW_type_var_in_synpred126_fml2689_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_type_var_in_synpred126_fml2689 = { FOLLOW_type_var_in_synpred126_fml2689_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COLON_in_synpred126_fml2691 */
+static ANTLR3_BITWORD FOLLOW_COLON_in_synpred126_fml2691_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_COLON_in_synpred126_fml2691 = { FOLLOW_COLON_in_synpred126_fml2691_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_body_machine_using_section_predicat_in_synpred127_fml2764 */
+static ANTLR3_BITWORD FOLLOW_def_body_machine_using_section_predicat_in_synpred127_fml2764_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_body_machine_using_section_predicat_in_synpred127_fml2764 = { FOLLOW_def_body_machine_using_section_predicat_in_synpred127_fml2764_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_modifier_declaration_in_synpred138_fml2939 */
+static ANTLR3_BITWORD FOLLOW_modifier_declaration_in_synpred138_fml2939_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_modifier_declaration_in_synpred138_fml2939 = { FOLLOW_modifier_declaration_in_synpred138_fml2939_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_executable_modifier_specifier_in_synpred153_fml3199 */
+static ANTLR3_BITWORD FOLLOW_executable_modifier_specifier_in_synpred153_fml3199_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_executable_modifier_specifier_in_synpred153_fml3199 = { FOLLOW_executable_modifier_specifier_in_synpred153_fml3199_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_lvalue_in_synpred170_fml3645 */
+static ANTLR3_BITWORD FOLLOW_lvalue_in_synpred170_fml3645_bits[] = { ANTLR3_UINT64_LIT(0x00000000002000D0) };
+static ANTLR3_BITSET_LIST FOLLOW_lvalue_in_synpred170_fml3645 = { FOLLOW_lvalue_in_synpred170_fml3645_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_op_assign_param_in_synpred170_fml3648 */
+static ANTLR3_BITWORD FOLLOW_op_assign_param_in_synpred170_fml3648_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_op_assign_param_in_synpred170_fml3648 = { FOLLOW_op_assign_param_in_synpred170_fml3648_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_body_machine_using_section_predicat_in_synpred296_fml5973 */
+static ANTLR3_BITWORD FOLLOW_def_body_machine_using_section_predicat_in_synpred296_fml5973_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_body_machine_using_section_predicat_in_synpred296_fml5973 = { FOLLOW_def_body_machine_using_section_predicat_in_synpred296_fml5973_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_modifier_declaration_in_synpred304_fml6112 */
+static ANTLR3_BITWORD FOLLOW_modifier_declaration_in_synpred304_fml6112_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_modifier_declaration_in_synpred304_fml6112 = { FOLLOW_modifier_declaration_in_synpred304_fml6112_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_321_in_synpred324_fml6520 */
+static ANTLR3_BITWORD FOLLOW_321_in_synpred324_fml6520_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000100000000000), ANTLR3_UINT64_LIT(0x0000000014020000) };
+static ANTLR3_BITSET_LIST FOLLOW_321_in_synpred324_fml6520 = { FOLLOW_321_in_synpred324_fml6520_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_moc_transition_attribute_in_synpred324_fml6527 */
+static ANTLR3_BITWORD FOLLOW_moc_transition_attribute_in_synpred324_fml6527_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_moc_transition_attribute_in_synpred324_fml6527 = { FOLLOW_moc_transition_attribute_in_synpred324_fml6527_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_348_in_synpred326_fml6538 */
+static ANTLR3_BITWORD FOLLOW_348_in_synpred326_fml6538_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_348_in_synpred326_fml6538 = { FOLLOW_348_in_synpred326_fml6538_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_integer_constant_in_synpred326_fml6545 */
+static ANTLR3_BITWORD FOLLOW_integer_constant_in_synpred326_fml6545_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_integer_constant_in_synpred326_fml6545 = { FOLLOW_integer_constant_in_synpred326_fml6545_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_163_in_synpred329_fml6600 */
+static ANTLR3_BITWORD FOLLOW_163_in_synpred329_fml6600_bits[] = { ANTLR3_UINT64_LIT(0x0004000080000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x00000000027F0000) };
+static ANTLR3_BITSET_LIST FOLLOW_163_in_synpred329_fml6600 = { FOLLOW_163_in_synpred329_fml6600_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_target_state_id_in_synpred329_fml6612 */
+static ANTLR3_BITWORD FOLLOW_target_state_id_in_synpred329_fml6612_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_target_state_id_in_synpred329_fml6612 = { FOLLOW_target_state_id_in_synpred329_fml6612_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_synpred329_fml6629 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_synpred329_fml6629_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_synpred329_fml6629 = { FOLLOW_SEMI_in_synpred329_fml6629_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred340_fml6840 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred340_fml6840_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred340_fml6840 = { FOLLOW_expression_in_synpred340_fml6840_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LBRACKET_in_synpred341_fml6851 */
+static ANTLR3_BITWORD FOLLOW_LBRACKET_in_synpred341_fml6851_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LBRACKET_in_synpred341_fml6851 = { FOLLOW_LBRACKET_in_synpred341_fml6851_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred341_fml6855 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred341_fml6855_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred341_fml6855 = { FOLLOW_expression_in_synpred341_fml6855_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RBRACKET_in_synpred341_fml6857 */
+static ANTLR3_BITWORD FOLLOW_RBRACKET_in_synpred341_fml6857_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RBRACKET_in_synpred341_fml6857 = { FOLLOW_RBRACKET_in_synpred341_fml6857_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred343_fml6900 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred343_fml6900_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred343_fml6900 = { FOLLOW_expression_in_synpred343_fml6900_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_synpred344_fml6911 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_synpred344_fml6911_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_synpred344_fml6911 = { FOLLOW_LCURLY_in_synpred344_fml6911_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred344_fml6915 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred344_fml6915_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred344_fml6915 = { FOLLOW_expression_in_synpred344_fml6915_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_synpred344_fml6917 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_synpred344_fml6917_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_synpred344_fml6917 = { FOLLOW_RCURLY_in_synpred344_fml6917_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_body_machine_using_section_header_predicat_in_synpred366_fml7316 */
+static ANTLR3_BITWORD FOLLOW_def_body_machine_using_section_header_predicat_in_synpred366_fml7316_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_body_machine_using_section_header_predicat_in_synpred366_fml7316 = { FOLLOW_def_body_machine_using_section_header_predicat_in_synpred366_fml7316_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_body_machine_using_section_import_predicat_in_synpred370_fml7380 */
+static ANTLR3_BITWORD FOLLOW_def_body_machine_using_section_import_predicat_in_synpred370_fml7380_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_body_machine_using_section_import_predicat_in_synpred370_fml7380 = { FOLLOW_def_body_machine_using_section_import_predicat_in_synpred370_fml7380_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_body_machine_using_section_parameter_predicat_in_synpred373_fml7432 */
+static ANTLR3_BITWORD FOLLOW_def_body_machine_using_section_parameter_predicat_in_synpred373_fml7432_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_body_machine_using_section_parameter_predicat_in_synpred373_fml7432 = { FOLLOW_def_body_machine_using_section_parameter_predicat_in_synpred373_fml7432_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_def_body_machine_using_section_property_predicat_in_synpred375_fml7472 */
+static ANTLR3_BITWORD FOLLOW_def_body_machine_using_section_property_predicat_in_synpred375_fml7472_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_def_body_machine_using_section_property_predicat_in_synpred375_fml7472 = { FOLLOW_def_body_machine_using_section_property_predicat_in_synpred375_fml7472_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_synpred407_fml7922 */
+static ANTLR3_BITWORD FOLLOW_ID_in_synpred407_fml7922_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_synpred407_fml7922 = { FOLLOW_ID_in_synpred407_fml7922_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COLON_in_synpred407_fml7924 */
+static ANTLR3_BITWORD FOLLOW_COLON_in_synpred407_fml7924_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_COLON_in_synpred407_fml7924 = { FOLLOW_COLON_in_synpred407_fml7924_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_synpred412_fml8076 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_synpred412_fml8076_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_synpred412_fml8076 = { FOLLOW_LPAREN_in_synpred412_fml8076_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_labelled_argument_in_synpred412_fml8085 */
+static ANTLR3_BITWORD FOLLOW_labelled_argument_in_synpred412_fml8085_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_labelled_argument_in_synpred412_fml8085 = { FOLLOW_labelled_argument_in_synpred412_fml8085_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_synpred412_fml8101 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_synpred412_fml8101_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_synpred412_fml8101 = { FOLLOW_COMMA_in_synpred412_fml8101_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_labelled_argument_in_synpred412_fml8112 */
+static ANTLR3_BITWORD FOLLOW_labelled_argument_in_synpred412_fml8112_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_labelled_argument_in_synpred412_fml8112 = { FOLLOW_labelled_argument_in_synpred412_fml8112_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_synpred412_fml8136 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_synpred412_fml8136_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_synpred412_fml8136 = { FOLLOW_RPAREN_in_synpred412_fml8136_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_synpred417_fml8265 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_synpred417_fml8265_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_synpred417_fml8265 = { FOLLOW_LPAREN_in_synpred417_fml8265_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_labelled_argument_in_synpred417_fml8274 */
+static ANTLR3_BITWORD FOLLOW_labelled_argument_in_synpred417_fml8274_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_labelled_argument_in_synpred417_fml8274 = { FOLLOW_labelled_argument_in_synpred417_fml8274_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_synpred417_fml8290 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_synpred417_fml8290_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_synpred417_fml8290 = { FOLLOW_COMMA_in_synpred417_fml8290_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_labelled_argument_in_synpred417_fml8301 */
+static ANTLR3_BITWORD FOLLOW_labelled_argument_in_synpred417_fml8301_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_labelled_argument_in_synpred417_fml8301 = { FOLLOW_labelled_argument_in_synpred417_fml8301_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_synpred417_fml8325 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_synpred417_fml8325_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_synpred417_fml8325 = { FOLLOW_RPAREN_in_synpred417_fml8325_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_synpred419_fml8407 */
+static ANTLR3_BITWORD FOLLOW_ID_in_synpred419_fml8407_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_synpred419_fml8407 = { FOLLOW_ID_in_synpred419_fml8407_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_synpred426_fml8542 */
+static ANTLR3_BITWORD FOLLOW_ID_in_synpred426_fml8542_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_synpred426_fml8542 = { FOLLOW_ID_in_synpred426_fml8542_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_synpred431_fml8689 */
+static ANTLR3_BITWORD FOLLOW_ID_in_synpred431_fml8689_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_synpred431_fml8689 = { FOLLOW_ID_in_synpred431_fml8689_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_synpred438_fml8824 */
+static ANTLR3_BITWORD FOLLOW_ID_in_synpred438_fml8824_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_synpred438_fml8824 = { FOLLOW_ID_in_synpred438_fml8824_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_var_in_synpred446_fml9031 */
+static ANTLR3_BITWORD FOLLOW_type_var_in_synpred446_fml9031_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_type_var_in_synpred446_fml9031 = { FOLLOW_type_var_in_synpred446_fml9031_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COLON_in_synpred446_fml9033 */
+static ANTLR3_BITWORD FOLLOW_COLON_in_synpred446_fml9033_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_COLON_in_synpred446_fml9033 = { FOLLOW_COLON_in_synpred446_fml9033_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_base_type_var_in_synpred493_fml10287 */
+static ANTLR3_BITWORD FOLLOW_base_type_var_in_synpred493_fml10287_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800002) };
+static ANTLR3_BITSET_LIST FOLLOW_base_type_var_in_synpred493_fml10287 = { FOLLOW_base_type_var_in_synpred493_fml10287_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_synpred493_fml10303 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_synpred493_fml10303_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000200), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0080000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_synpred493_fml10303 = { FOLLOW_COMMA_in_synpred493_fml10303_bits, 6 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_375_in_synpred493_fml10308 */
+static ANTLR3_BITWORD FOLLOW_375_in_synpred493_fml10308_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000200) };
+static ANTLR3_BITSET_LIST FOLLOW_375_in_synpred493_fml10308 = { FOLLOW_375_in_synpred493_fml10308_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_integer_constant_in_synpred493_fml10328 */
+static ANTLR3_BITWORD FOLLOW_integer_constant_in_synpred493_fml10328_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_integer_constant_in_synpred493_fml10328 = { FOLLOW_integer_constant_in_synpred493_fml10328_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STAR_in_synpred493_fml10345 */
+static ANTLR3_BITWORD FOLLOW_STAR_in_synpred493_fml10345_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_STAR_in_synpred493_fml10345 = { FOLLOW_STAR_in_synpred493_fml10345_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_bit_field_size_in_synpred514_fml10755 */
+static ANTLR3_BITWORD FOLLOW_bit_field_size_in_synpred514_fml10755_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_bit_field_size_in_synpred514_fml10755 = { FOLLOW_bit_field_size_in_synpred514_fml10755_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_bit_field_size_in_synpred517_fml10794 */
+static ANTLR3_BITWORD FOLLOW_bit_field_size_in_synpred517_fml10794_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_bit_field_size_in_synpred517_fml10794 = { FOLLOW_bit_field_size_in_synpred517_fml10794_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_bit_field_size_in_synpred520_fml10831 */
+static ANTLR3_BITWORD FOLLOW_bit_field_size_in_synpred520_fml10831_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_bit_field_size_in_synpred520_fml10831 = { FOLLOW_bit_field_size_in_synpred520_fml10831_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_bit_field_size_in_synpred531_fml10968 */
+static ANTLR3_BITWORD FOLLOW_bit_field_size_in_synpred531_fml10968_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_bit_field_size_in_synpred531_fml10968 = { FOLLOW_bit_field_size_in_synpred531_fml10968_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_bit_field_size_in_synpred535_fml11020 */
+static ANTLR3_BITWORD FOLLOW_bit_field_size_in_synpred535_fml11020_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_bit_field_size_in_synpred535_fml11020 = { FOLLOW_bit_field_size_in_synpred535_fml11020_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_bit_field_size_in_synpred537_fml11051 */
+static ANTLR3_BITWORD FOLLOW_bit_field_size_in_synpred537_fml11051_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_bit_field_size_in_synpred537_fml11051 = { FOLLOW_bit_field_size_in_synpred537_fml11051_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_string_field_size_in_synpred539_fml11080 */
+static ANTLR3_BITWORD FOLLOW_string_field_size_in_synpred539_fml11080_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_string_field_size_in_synpred539_fml11080 = { FOLLOW_string_field_size_in_synpred539_fml11080_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_synpred555_fml11357 */
+static ANTLR3_BITWORD FOLLOW_set_in_synpred555_fml11357_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_synpred555_fml11357 = { FOLLOW_set_in_synpred555_fml11357_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_integer_constant_in_synpred555_fml11374 */
+static ANTLR3_BITWORD FOLLOW_integer_constant_in_synpred555_fml11374_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_integer_constant_in_synpred555_fml11374 = { FOLLOW_integer_constant_in_synpred555_fml11374_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_var_in_synpred559_fml11507 */
+static ANTLR3_BITWORD FOLLOW_type_var_in_synpred559_fml11507_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_type_var_in_synpred559_fml11507 = { FOLLOW_type_var_in_synpred559_fml11507_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_synpred559_fml11509 */
+static ANTLR3_BITWORD FOLLOW_ID_in_synpred559_fml11509_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_synpred559_fml11509 = { FOLLOW_ID_in_synpred559_fml11509_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_var_in_synpred574_fml12057 */
+static ANTLR3_BITWORD FOLLOW_type_var_in_synpred574_fml12057_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_type_var_in_synpred574_fml12057 = { FOLLOW_type_var_in_synpred574_fml12057_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_synpred609_fml12775 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_synpred609_fml12775_bits[] = { ANTLR3_UINT64_LIT(0x0084000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_synpred609_fml12775 = { FOLLOW_COMMA_in_synpred609_fml12775_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_integer_constant_in_synpred609_fml12780 */
+static ANTLR3_BITWORD FOLLOW_integer_constant_in_synpred609_fml12780_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_integer_constant_in_synpred609_fml12780 = { FOLLOW_integer_constant_in_synpred609_fml12780_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_modifier_param_in_synpred636_fml13291 */
+static ANTLR3_BITWORD FOLLOW_modifier_param_in_synpred636_fml13291_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_modifier_param_in_synpred636_fml13291 = { FOLLOW_modifier_param_in_synpred636_fml13291_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_var_in_synpred636_fml13295 */
+static ANTLR3_BITWORD FOLLOW_type_var_in_synpred636_fml13295_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_type_var_in_synpred636_fml13295 = { FOLLOW_type_var_in_synpred636_fml13295_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_synpred636_fml13297 */
+static ANTLR3_BITWORD FOLLOW_ID_in_synpred636_fml13297_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_synpred636_fml13297 = { FOLLOW_ID_in_synpred636_fml13297_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_modifier_param_in_synpred643_fml13470 */
+static ANTLR3_BITWORD FOLLOW_modifier_param_in_synpred643_fml13470_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0xC266000000000000), ANTLR3_UINT64_LIT(0x38E000000A00C128), ANTLR3_UINT64_LIT(0x0064016007002261), ANTLR3_UINT64_LIT(0x0000000013A78108) };
+static ANTLR3_BITSET_LIST FOLLOW_modifier_param_in_synpred643_fml13470 = { FOLLOW_modifier_param_in_synpred643_fml13470_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_type_var_in_synpred643_fml13474 */
+static ANTLR3_BITWORD FOLLOW_type_var_in_synpred643_fml13474_bits[] = { ANTLR3_UINT64_LIT(0x0004000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_type_var_in_synpred643_fml13474 = { FOLLOW_type_var_in_synpred643_fml13474_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_synpred643_fml13476 */
+static ANTLR3_BITWORD FOLLOW_ID_in_synpred643_fml13476_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_ID_in_synpred643_fml13476 = { FOLLOW_ID_in_synpred643_fml13476_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualifiedNameID_in_synpred705_fml14773 */
+static ANTLR3_BITWORD FOLLOW_qualifiedNameID_in_synpred705_fml14773_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000001000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_qualifiedNameID_in_synpred705_fml14773 = { FOLLOW_qualifiedNameID_in_synpred705_fml14773_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_164_in_synpred705_fml14775 */
+static ANTLR3_BITWORD FOLLOW_164_in_synpred705_fml14775_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_164_in_synpred705_fml14775 = { FOLLOW_164_in_synpred705_fml14775_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_assign_in_synpred709_fml14981 */
+static ANTLR3_BITWORD FOLLOW_statement_assign_in_synpred709_fml14981_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_assign_in_synpred709_fml14981 = { FOLLOW_statement_assign_in_synpred709_fml14981_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_statement_invoke_routine_in_synpred714_fml15083 */
+static ANTLR3_BITWORD FOLLOW_statement_invoke_routine_in_synpred714_fml15083_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_statement_invoke_routine_in_synpred714_fml15083 = { FOLLOW_statement_invoke_routine_in_synpred714_fml15083_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_prefix_statement_in_synpred778_fml16346 */
+static ANTLR3_BITWORD FOLLOW_prefix_statement_in_synpred778_fml16346_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_prefix_statement_in_synpred778_fml16346 = { FOLLOW_prefix_statement_in_synpred778_fml16346_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_unaryExpression_in_synpred779_fml16367 */
+static ANTLR3_BITWORD FOLLOW_unaryExpression_in_synpred779_fml16367_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_unaryExpression_in_synpred779_fml16367 = { FOLLOW_unaryExpression_in_synpred779_fml16367_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_prefix_expression_in_synpred780_fml16426 */
+static ANTLR3_BITWORD FOLLOW_prefix_expression_in_synpred780_fml16426_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_prefix_expression_in_synpred780_fml16426 = { FOLLOW_prefix_expression_in_synpred780_fml16426_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_unaryExpression_in_synpred781_fml16446 */
+static ANTLR3_BITWORD FOLLOW_unaryExpression_in_synpred781_fml16446_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_unaryExpression_in_synpred781_fml16446 = { FOLLOW_unaryExpression_in_synpred781_fml16446_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_synpred802_fml17087 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_synpred802_fml17087_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_synpred802_fml17087 = { FOLLOW_LPAREN_in_synpred802_fml17087_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_synpred804_fml17130 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_synpred804_fml17130_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_synpred804_fml17130 = { FOLLOW_LCURLY_in_synpred804_fml17130_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_277_in_synpred861_fml18455 */
+static ANTLR3_BITWORD FOLLOW_277_in_synpred861_fml18455_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_277_in_synpred861_fml18455 = { FOLLOW_277_in_synpred861_fml18455_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_277_in_synpred872_fml18685 */
+static ANTLR3_BITWORD FOLLOW_277_in_synpred872_fml18685_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_277_in_synpred872_fml18685 = { FOLLOW_277_in_synpred872_fml18685_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_274_in_synpred891_fml19245 */
+static ANTLR3_BITWORD FOLLOW_274_in_synpred891_fml19245_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_274_in_synpred891_fml19245 = { FOLLOW_274_in_synpred891_fml19245_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_273_in_synpred891_fml19249 */
+static ANTLR3_BITWORD FOLLOW_273_in_synpred891_fml19249_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000004000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_273_in_synpred891_fml19249 = { FOLLOW_273_in_synpred891_fml19249_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_294_in_synpred891_fml19251 */
+static ANTLR3_BITWORD FOLLOW_294_in_synpred891_fml19251_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_294_in_synpred891_fml19251 = { FOLLOW_294_in_synpred891_fml19251_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred891_fml19258 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred891_fml19258_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred891_fml19258 = { FOLLOW_expression_in_synpred891_fml19258_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_statement_in_synpred891_fml19263 */
+static ANTLR3_BITWORD FOLLOW_block_statement_in_synpred891_fml19263_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_block_statement_in_synpred891_fml19263 = { FOLLOW_block_statement_in_synpred891_fml19263_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_274_in_synpred894_fml19350 */
+static ANTLR3_BITWORD FOLLOW_274_in_synpred894_fml19350_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_274_in_synpred894_fml19350 = { FOLLOW_274_in_synpred894_fml19350_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_273_in_synpred894_fml19354 */
+static ANTLR3_BITWORD FOLLOW_273_in_synpred894_fml19354_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000004000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_273_in_synpred894_fml19354 = { FOLLOW_273_in_synpred894_fml19354_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_294_in_synpred894_fml19356 */
+static ANTLR3_BITWORD FOLLOW_294_in_synpred894_fml19356_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_294_in_synpred894_fml19356 = { FOLLOW_294_in_synpred894_fml19356_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred894_fml19362 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred894_fml19362_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000001) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred894_fml19362 = { FOLLOW_expression_in_synpred894_fml19362_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LCURLY_in_synpred894_fml19365 */
+static ANTLR3_BITWORD FOLLOW_LCURLY_in_synpred894_fml19365_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LCURLY_in_synpred894_fml19365 = { FOLLOW_LCURLY_in_synpred894_fml19365_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred894_fml19370 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred894_fml19370_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x2000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred894_fml19370 = { FOLLOW_expression_in_synpred894_fml19370_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RCURLY_in_synpred894_fml19373 */
+static ANTLR3_BITWORD FOLLOW_RCURLY_in_synpred894_fml19373_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RCURLY_in_synpred894_fml19373 = { FOLLOW_RCURLY_in_synpred894_fml19373_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_for_assign_header_in_synpred896_fml19460 */
+static ANTLR3_BITWORD FOLLOW_for_assign_header_in_synpred896_fml19460_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_for_assign_header_in_synpred896_fml19460 = { FOLLOW_for_assign_header_in_synpred896_fml19460_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_synpred896_fml19463 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_synpred896_fml19463_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_synpred896_fml19463 = { FOLLOW_SEMI_in_synpred896_fml19463_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred896_fml19468 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred896_fml19468_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred896_fml19468 = { FOLLOW_expression_in_synpred896_fml19468_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_synpred896_fml19471 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_synpred896_fml19471_bits[] = { ANTLR3_UINT64_LIT(0x000C000004400000) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_synpred896_fml19471 = { FOLLOW_SEMI_in_synpred896_fml19471_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_for_assign_header_in_synpred896_fml19476 */
+static ANTLR3_BITWORD FOLLOW_for_assign_header_in_synpred896_fml19476_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_for_assign_header_in_synpred896_fml19476 = { FOLLOW_for_assign_header_in_synpred896_fml19476_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_synpred897_fml19495 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_synpred897_fml19495_bits[] = { ANTLR3_UINT64_LIT(0x000C000004400000) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_synpred897_fml19495 = { FOLLOW_LPAREN_in_synpred897_fml19495_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_for_assign_header_in_synpred897_fml19506 */
+static ANTLR3_BITWORD FOLLOW_for_assign_header_in_synpred897_fml19506_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_for_assign_header_in_synpred897_fml19506 = { FOLLOW_for_assign_header_in_synpred897_fml19506_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_synpred897_fml19509 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_synpred897_fml19509_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_synpred897_fml19509 = { FOLLOW_SEMI_in_synpred897_fml19509_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred897_fml19514 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred897_fml19514_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred897_fml19514 = { FOLLOW_expression_in_synpred897_fml19514_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMI_in_synpred897_fml19517 */
+static ANTLR3_BITWORD FOLLOW_SEMI_in_synpred897_fml19517_bits[] = { ANTLR3_UINT64_LIT(0x000C000004400000) };
+static ANTLR3_BITSET_LIST FOLLOW_SEMI_in_synpred897_fml19517 = { FOLLOW_SEMI_in_synpred897_fml19517_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_for_assign_header_in_synpred897_fml19522 */
+static ANTLR3_BITWORD FOLLOW_for_assign_header_in_synpred897_fml19522_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_for_assign_header_in_synpred897_fml19522 = { FOLLOW_for_assign_header_in_synpred897_fml19522_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_synpred897_fml19529 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_synpred897_fml19529_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_synpred897_fml19529 = { FOLLOW_RPAREN_in_synpred897_fml19529_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_lvalue_in_synpred898_fml19550 */
+static ANTLR3_BITWORD FOLLOW_lvalue_in_synpred898_fml19550_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_lvalue_in_synpred898_fml19550 = { FOLLOW_lvalue_in_synpred898_fml19550_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COLON_in_synpred898_fml19553 */
+static ANTLR3_BITWORD FOLLOW_COLON_in_synpred898_fml19553_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COLON_in_synpred898_fml19553 = { FOLLOW_COLON_in_synpred898_fml19553_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred898_fml19558 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred898_fml19558_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred898_fml19558 = { FOLLOW_expression_in_synpred898_fml19558_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_synpred946_fml20614 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_synpred946_fml20614_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_synpred946_fml20614 = { FOLLOW_LPAREN_in_synpred946_fml20614_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_labelled_argument_in_synpred946_fml20623 */
+static ANTLR3_BITWORD FOLLOW_labelled_argument_in_synpred946_fml20623_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_labelled_argument_in_synpred946_fml20623 = { FOLLOW_labelled_argument_in_synpred946_fml20623_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_synpred946_fml20639 */
+static ANTLR3_BITWORD FOLLOW_COMMA_in_synpred946_fml20639_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COMMA_in_synpred946_fml20639 = { FOLLOW_COMMA_in_synpred946_fml20639_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_labelled_argument_in_synpred946_fml20650 */
+static ANTLR3_BITWORD FOLLOW_labelled_argument_in_synpred946_fml20650_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_labelled_argument_in_synpred946_fml20650 = { FOLLOW_labelled_argument_in_synpred946_fml20650_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_in_synpred946_fml20674 */
+static ANTLR3_BITWORD FOLLOW_RPAREN_in_synpred946_fml20674_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RPAREN_in_synpred946_fml20674 = { FOLLOW_RPAREN_in_synpred946_fml20674_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSIGN_in_synpred947_fml20766 */
+static ANTLR3_BITWORD FOLLOW_ASSIGN_in_synpred947_fml20766_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_ASSIGN_in_synpred947_fml20766 = { FOLLOW_ASSIGN_in_synpred947_fml20766_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred947_fml20771 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred947_fml20771_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred947_fml20771 = { FOLLOW_expression_in_synpred947_fml20771_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSIGN_MACRO_in_synpred948_fml20780 */
+static ANTLR3_BITWORD FOLLOW_ASSIGN_MACRO_in_synpred948_fml20780_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_ASSIGN_MACRO_in_synpred948_fml20780 = { FOLLOW_ASSIGN_MACRO_in_synpred948_fml20780_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred948_fml20785 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred948_fml20785_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred948_fml20785 = { FOLLOW_expression_in_synpred948_fml20785_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSIGN_AFTER_in_synpred949_fml20794 */
+static ANTLR3_BITWORD FOLLOW_ASSIGN_AFTER_in_synpred949_fml20794_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_ASSIGN_AFTER_in_synpred949_fml20794 = { FOLLOW_ASSIGN_AFTER_in_synpred949_fml20794_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred949_fml20799 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred949_fml20799_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred949_fml20799 = { FOLLOW_expression_in_synpred949_fml20799_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_PLUS_ASSIGN_in_synpred950_fml20808 */
+static ANTLR3_BITWORD FOLLOW_PLUS_ASSIGN_in_synpred950_fml20808_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_PLUS_ASSIGN_in_synpred950_fml20808 = { FOLLOW_PLUS_ASSIGN_in_synpred950_fml20808_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred950_fml20813 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred950_fml20813_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred950_fml20813 = { FOLLOW_expression_in_synpred950_fml20813_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_PLUS_ASSIGN_AFTER_in_synpred951_fml20822 */
+static ANTLR3_BITWORD FOLLOW_PLUS_ASSIGN_AFTER_in_synpred951_fml20822_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_PLUS_ASSIGN_AFTER_in_synpred951_fml20822 = { FOLLOW_PLUS_ASSIGN_AFTER_in_synpred951_fml20822_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred951_fml20827 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred951_fml20827_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred951_fml20827 = { FOLLOW_expression_in_synpred951_fml20827_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_MINUS_ASSIGN_in_synpred952_fml20836 */
+static ANTLR3_BITWORD FOLLOW_MINUS_ASSIGN_in_synpred952_fml20836_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_MINUS_ASSIGN_in_synpred952_fml20836 = { FOLLOW_MINUS_ASSIGN_in_synpred952_fml20836_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred952_fml20841 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred952_fml20841_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred952_fml20841 = { FOLLOW_expression_in_synpred952_fml20841_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_MINUS_ASSIGN_AFTER_in_synpred953_fml20850 */
+static ANTLR3_BITWORD FOLLOW_MINUS_ASSIGN_AFTER_in_synpred953_fml20850_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_MINUS_ASSIGN_AFTER_in_synpred953_fml20850 = { FOLLOW_MINUS_ASSIGN_AFTER_in_synpred953_fml20850_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred953_fml20855 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred953_fml20855_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred953_fml20855 = { FOLLOW_expression_in_synpred953_fml20855_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STAR_ASSIGN_in_synpred954_fml20864 */
+static ANTLR3_BITWORD FOLLOW_STAR_ASSIGN_in_synpred954_fml20864_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_STAR_ASSIGN_in_synpred954_fml20864 = { FOLLOW_STAR_ASSIGN_in_synpred954_fml20864_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred954_fml20869 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred954_fml20869_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred954_fml20869 = { FOLLOW_expression_in_synpred954_fml20869_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STAR_ASSIGN_AFTER_in_synpred955_fml20878 */
+static ANTLR3_BITWORD FOLLOW_STAR_ASSIGN_AFTER_in_synpred955_fml20878_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_STAR_ASSIGN_AFTER_in_synpred955_fml20878 = { FOLLOW_STAR_ASSIGN_AFTER_in_synpred955_fml20878_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred955_fml20883 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred955_fml20883_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred955_fml20883 = { FOLLOW_expression_in_synpred955_fml20883_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DIV_ASSIGN_in_synpred956_fml20892 */
+static ANTLR3_BITWORD FOLLOW_DIV_ASSIGN_in_synpred956_fml20892_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_DIV_ASSIGN_in_synpred956_fml20892 = { FOLLOW_DIV_ASSIGN_in_synpred956_fml20892_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred956_fml20897 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred956_fml20897_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred956_fml20897 = { FOLLOW_expression_in_synpred956_fml20897_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DIV_ASSIGN_AFTER_in_synpred957_fml20906 */
+static ANTLR3_BITWORD FOLLOW_DIV_ASSIGN_AFTER_in_synpred957_fml20906_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_DIV_ASSIGN_AFTER_in_synpred957_fml20906 = { FOLLOW_DIV_ASSIGN_AFTER_in_synpred957_fml20906_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred957_fml20911 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred957_fml20911_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred957_fml20911 = { FOLLOW_expression_in_synpred957_fml20911_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_MOD_ASSIGN_in_synpred958_fml20920 */
+static ANTLR3_BITWORD FOLLOW_MOD_ASSIGN_in_synpred958_fml20920_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_MOD_ASSIGN_in_synpred958_fml20920 = { FOLLOW_MOD_ASSIGN_in_synpred958_fml20920_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred958_fml20925 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred958_fml20925_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred958_fml20925 = { FOLLOW_expression_in_synpred958_fml20925_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_MOD_ASSIGN_AFTER_in_synpred959_fml20934 */
+static ANTLR3_BITWORD FOLLOW_MOD_ASSIGN_AFTER_in_synpred959_fml20934_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_MOD_ASSIGN_AFTER_in_synpred959_fml20934 = { FOLLOW_MOD_ASSIGN_AFTER_in_synpred959_fml20934_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred959_fml20939 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred959_fml20939_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred959_fml20939 = { FOLLOW_expression_in_synpred959_fml20939_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LAND_ASSIGN_in_synpred960_fml20948 */
+static ANTLR3_BITWORD FOLLOW_LAND_ASSIGN_in_synpred960_fml20948_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LAND_ASSIGN_in_synpred960_fml20948 = { FOLLOW_LAND_ASSIGN_in_synpred960_fml20948_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred960_fml20953 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred960_fml20953_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred960_fml20953 = { FOLLOW_expression_in_synpred960_fml20953_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LAND_ASSIGN_AFTER_in_synpred961_fml20962 */
+static ANTLR3_BITWORD FOLLOW_LAND_ASSIGN_AFTER_in_synpred961_fml20962_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LAND_ASSIGN_AFTER_in_synpred961_fml20962 = { FOLLOW_LAND_ASSIGN_AFTER_in_synpred961_fml20962_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred961_fml20967 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred961_fml20967_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred961_fml20967 = { FOLLOW_expression_in_synpred961_fml20967_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LOR_ASSIGN_in_synpred962_fml20976 */
+static ANTLR3_BITWORD FOLLOW_LOR_ASSIGN_in_synpred962_fml20976_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LOR_ASSIGN_in_synpred962_fml20976 = { FOLLOW_LOR_ASSIGN_in_synpred962_fml20976_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred962_fml20981 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred962_fml20981_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred962_fml20981 = { FOLLOW_expression_in_synpred962_fml20981_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LOR_ASSIGN_AFTER_in_synpred963_fml20990 */
+static ANTLR3_BITWORD FOLLOW_LOR_ASSIGN_AFTER_in_synpred963_fml20990_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LOR_ASSIGN_AFTER_in_synpred963_fml20990 = { FOLLOW_LOR_ASSIGN_AFTER_in_synpred963_fml20990_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred963_fml20995 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred963_fml20995_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred963_fml20995 = { FOLLOW_expression_in_synpred963_fml20995_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BAND_ASSIGN_in_synpred964_fml21004 */
+static ANTLR3_BITWORD FOLLOW_BAND_ASSIGN_in_synpred964_fml21004_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_BAND_ASSIGN_in_synpred964_fml21004 = { FOLLOW_BAND_ASSIGN_in_synpred964_fml21004_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred964_fml21009 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred964_fml21009_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred964_fml21009 = { FOLLOW_expression_in_synpred964_fml21009_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BAND_ASSIGN_AFTER_in_synpred965_fml21018 */
+static ANTLR3_BITWORD FOLLOW_BAND_ASSIGN_AFTER_in_synpred965_fml21018_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_BAND_ASSIGN_AFTER_in_synpred965_fml21018 = { FOLLOW_BAND_ASSIGN_AFTER_in_synpred965_fml21018_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred965_fml21023 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred965_fml21023_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred965_fml21023 = { FOLLOW_expression_in_synpred965_fml21023_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BOR_ASSIGN_in_synpred966_fml21032 */
+static ANTLR3_BITWORD FOLLOW_BOR_ASSIGN_in_synpred966_fml21032_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_BOR_ASSIGN_in_synpred966_fml21032 = { FOLLOW_BOR_ASSIGN_in_synpred966_fml21032_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred966_fml21037 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred966_fml21037_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred966_fml21037 = { FOLLOW_expression_in_synpred966_fml21037_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BOR_ASSIGN_AFTER_in_synpred967_fml21046 */
+static ANTLR3_BITWORD FOLLOW_BOR_ASSIGN_AFTER_in_synpred967_fml21046_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_BOR_ASSIGN_AFTER_in_synpred967_fml21046 = { FOLLOW_BOR_ASSIGN_AFTER_in_synpred967_fml21046_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred967_fml21051 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred967_fml21051_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred967_fml21051 = { FOLLOW_expression_in_synpred967_fml21051_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BXOR_ASSIGN_in_synpred968_fml21060 */
+static ANTLR3_BITWORD FOLLOW_BXOR_ASSIGN_in_synpred968_fml21060_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_BXOR_ASSIGN_in_synpred968_fml21060 = { FOLLOW_BXOR_ASSIGN_in_synpred968_fml21060_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred968_fml21065 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred968_fml21065_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred968_fml21065 = { FOLLOW_expression_in_synpred968_fml21065_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BXOR_ASSIGN_AFTER_in_synpred969_fml21074 */
+static ANTLR3_BITWORD FOLLOW_BXOR_ASSIGN_AFTER_in_synpred969_fml21074_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_BXOR_ASSIGN_AFTER_in_synpred969_fml21074 = { FOLLOW_BXOR_ASSIGN_AFTER_in_synpred969_fml21074_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred969_fml21079 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred969_fml21079_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred969_fml21079 = { FOLLOW_expression_in_synpred969_fml21079_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LSHIFT_ASSIGN_in_synpred970_fml21088 */
+static ANTLR3_BITWORD FOLLOW_LSHIFT_ASSIGN_in_synpred970_fml21088_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LSHIFT_ASSIGN_in_synpred970_fml21088 = { FOLLOW_LSHIFT_ASSIGN_in_synpred970_fml21088_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred970_fml21093 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred970_fml21093_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred970_fml21093 = { FOLLOW_expression_in_synpred970_fml21093_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LSHIFT_ASSIGN_AFTER_in_synpred971_fml21102 */
+static ANTLR3_BITWORD FOLLOW_LSHIFT_ASSIGN_AFTER_in_synpred971_fml21102_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LSHIFT_ASSIGN_AFTER_in_synpred971_fml21102 = { FOLLOW_LSHIFT_ASSIGN_AFTER_in_synpred971_fml21102_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred971_fml21107 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred971_fml21107_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred971_fml21107 = { FOLLOW_expression_in_synpred971_fml21107_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RSHIFT_ASSIGN_in_synpred972_fml21116 */
+static ANTLR3_BITWORD FOLLOW_RSHIFT_ASSIGN_in_synpred972_fml21116_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_RSHIFT_ASSIGN_in_synpred972_fml21116 = { FOLLOW_RSHIFT_ASSIGN_in_synpred972_fml21116_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred972_fml21121 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred972_fml21121_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred972_fml21121 = { FOLLOW_expression_in_synpred972_fml21121_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RSHIFT_ASSIGN_AFTER_in_synpred973_fml21130 */
+static ANTLR3_BITWORD FOLLOW_RSHIFT_ASSIGN_AFTER_in_synpred973_fml21130_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_RSHIFT_ASSIGN_AFTER_in_synpred973_fml21130 = { FOLLOW_RSHIFT_ASSIGN_AFTER_in_synpred973_fml21130_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred973_fml21135 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred973_fml21135_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred973_fml21135 = { FOLLOW_expression_in_synpred973_fml21135_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_PUSH_in_synpred974_fml21144 */
+static ANTLR3_BITWORD FOLLOW_OP_PUSH_in_synpred974_fml21144_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_PUSH_in_synpred974_fml21144 = { FOLLOW_OP_PUSH_in_synpred974_fml21144_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred974_fml21149 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred974_fml21149_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred974_fml21149 = { FOLLOW_expression_in_synpred974_fml21149_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_ASSIGN_TOP_in_synpred975_fml21158 */
+static ANTLR3_BITWORD FOLLOW_OP_ASSIGN_TOP_in_synpred975_fml21158_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_ASSIGN_TOP_in_synpred975_fml21158 = { FOLLOW_OP_ASSIGN_TOP_in_synpred975_fml21158_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred975_fml21163 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred975_fml21163_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred975_fml21163 = { FOLLOW_expression_in_synpred975_fml21163_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OP_POP_in_synpred976_fml21172 */
+static ANTLR3_BITWORD FOLLOW_OP_POP_in_synpred976_fml21172_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_OP_POP_in_synpred976_fml21172 = { FOLLOW_OP_POP_in_synpred976_fml21172_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred976_fml21177 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred976_fml21177_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred976_fml21177 = { FOLLOW_expression_in_synpred976_fml21177_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_QUESTION_in_synpred977_fml21215 */
+static ANTLR3_BITWORD FOLLOW_QUESTION_in_synpred977_fml21215_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_QUESTION_in_synpred977_fml21215 = { FOLLOW_QUESTION_in_synpred977_fml21215_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred977_fml21220 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred977_fml21220_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred977_fml21220 = { FOLLOW_expression_in_synpred977_fml21220_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COLON_in_synpred977_fml21223 */
+static ANTLR3_BITWORD FOLLOW_COLON_in_synpred977_fml21223_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_COLON_in_synpred977_fml21223 = { FOLLOW_COLON_in_synpred977_fml21223_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred977_fml21228 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred977_fml21228_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred977_fml21228 = { FOLLOW_expression_in_synpred977_fml21228_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_op_sequence_in_synpred980_fml21270 */
+static ANTLR3_BITWORD FOLLOW_op_sequence_in_synpred980_fml21270_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_op_sequence_in_synpred980_fml21270 = { FOLLOW_op_sequence_in_synpred980_fml21270_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_op_scheduling_in_synpred980_fml21278 */
+static ANTLR3_BITWORD FOLLOW_op_scheduling_in_synpred980_fml21278_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_op_scheduling_in_synpred980_fml21278 = { FOLLOW_op_scheduling_in_synpred980_fml21278_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_op_concurrency_in_synpred980_fml21286 */
+static ANTLR3_BITWORD FOLLOW_op_concurrency_in_synpred980_fml21286_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_op_concurrency_in_synpred980_fml21286 = { FOLLOW_op_concurrency_in_synpred980_fml21286_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_conditionalOrExpression_in_synpred980_fml21297 */
+static ANTLR3_BITWORD FOLLOW_conditionalOrExpression_in_synpred980_fml21297_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_conditionalOrExpression_in_synpred980_fml21297 = { FOLLOW_conditionalOrExpression_in_synpred980_fml21297_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LOR_in_synpred981_fml21333 */
+static ANTLR3_BITWORD FOLLOW_LOR_in_synpred981_fml21333_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LOR_in_synpred981_fml21333 = { FOLLOW_LOR_in_synpred981_fml21333_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_conditionalAndExpression_in_synpred981_fml21337 */
+static ANTLR3_BITWORD FOLLOW_conditionalAndExpression_in_synpred981_fml21337_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_conditionalAndExpression_in_synpred981_fml21337 = { FOLLOW_conditionalAndExpression_in_synpred981_fml21337_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LAND_in_synpred982_fml21375 */
+static ANTLR3_BITWORD FOLLOW_LAND_in_synpred982_fml21375_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LAND_in_synpred982_fml21375 = { FOLLOW_LAND_in_synpred982_fml21375_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_bitwiseOrExpression_in_synpred982_fml21379 */
+static ANTLR3_BITWORD FOLLOW_bitwiseOrExpression_in_synpred982_fml21379_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_bitwiseOrExpression_in_synpred982_fml21379 = { FOLLOW_bitwiseOrExpression_in_synpred982_fml21379_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BOR_in_synpred983_fml21417 */
+static ANTLR3_BITWORD FOLLOW_BOR_in_synpred983_fml21417_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_BOR_in_synpred983_fml21417 = { FOLLOW_BOR_in_synpred983_fml21417_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_bitwiseXorExpression_in_synpred983_fml21421 */
+static ANTLR3_BITWORD FOLLOW_bitwiseXorExpression_in_synpred983_fml21421_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_bitwiseXorExpression_in_synpred983_fml21421 = { FOLLOW_bitwiseXorExpression_in_synpred983_fml21421_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BXOR_in_synpred984_fml21459 */
+static ANTLR3_BITWORD FOLLOW_BXOR_in_synpred984_fml21459_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_BXOR_in_synpred984_fml21459 = { FOLLOW_BXOR_in_synpred984_fml21459_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_bitwiseAndExpression_in_synpred984_fml21463 */
+static ANTLR3_BITWORD FOLLOW_bitwiseAndExpression_in_synpred984_fml21463_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_bitwiseAndExpression_in_synpred984_fml21463 = { FOLLOW_bitwiseAndExpression_in_synpred984_fml21463_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BAND_in_synpred985_fml21501 */
+static ANTLR3_BITWORD FOLLOW_BAND_in_synpred985_fml21501_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_BAND_in_synpred985_fml21501 = { FOLLOW_BAND_in_synpred985_fml21501_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_equalityExpression_in_synpred985_fml21505 */
+static ANTLR3_BITWORD FOLLOW_equalityExpression_in_synpred985_fml21505_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_equalityExpression_in_synpred985_fml21505 = { FOLLOW_equalityExpression_in_synpred985_fml21505_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_equalOp_in_synpred986_fml21569 */
+static ANTLR3_BITWORD FOLLOW_equalOp_in_synpred986_fml21569_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_equalOp_in_synpred986_fml21569 = { FOLLOW_equalOp_in_synpred986_fml21569_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_relationalExpression_in_synpred986_fml21573 */
+static ANTLR3_BITWORD FOLLOW_relationalExpression_in_synpred986_fml21573_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_relationalExpression_in_synpred986_fml21573 = { FOLLOW_relationalExpression_in_synpred986_fml21573_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_equalOp_in_synpred987_fml21549 */
+static ANTLR3_BITWORD FOLLOW_equalOp_in_synpred987_fml21549_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_equalOp_in_synpred987_fml21549 = { FOLLOW_equalOp_in_synpred987_fml21549_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_relationalExpression_in_synpred987_fml21553 */
+static ANTLR3_BITWORD FOLLOW_relationalExpression_in_synpred987_fml21553_bits[] = { ANTLR3_UINT64_LIT(0x0000008000000002), ANTLR3_UINT64_LIT(0x0000000000600000), ANTLR3_UINT64_LIT(0x0000000000000100) };
+static ANTLR3_BITSET_LIST FOLLOW_relationalExpression_in_synpred987_fml21553 = { FOLLOW_relationalExpression_in_synpred987_fml21553_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_equalOp_in_synpred987_fml21569 */
+static ANTLR3_BITWORD FOLLOW_equalOp_in_synpred987_fml21569_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_equalOp_in_synpred987_fml21569 = { FOLLOW_equalOp_in_synpred987_fml21569_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_relationalExpression_in_synpred987_fml21573 */
+static ANTLR3_BITWORD FOLLOW_relationalExpression_in_synpred987_fml21573_bits[] = { ANTLR3_UINT64_LIT(0x0000008000000002), ANTLR3_UINT64_LIT(0x0000000000600000), ANTLR3_UINT64_LIT(0x0000000000000100) };
+static ANTLR3_BITSET_LIST FOLLOW_relationalExpression_in_synpred987_fml21573 = { FOLLOW_relationalExpression_in_synpred987_fml21573_bits, 3 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_relationalOp_in_synpred991_fml21695 */
+static ANTLR3_BITWORD FOLLOW_relationalOp_in_synpred991_fml21695_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_relationalOp_in_synpred991_fml21695 = { FOLLOW_relationalOp_in_synpred991_fml21695_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_shiftExpression_in_synpred991_fml21699 */
+static ANTLR3_BITWORD FOLLOW_shiftExpression_in_synpred991_fml21699_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_shiftExpression_in_synpred991_fml21699 = { FOLLOW_shiftExpression_in_synpred991_fml21699_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_relationalOp_in_synpred992_fml21675 */
+static ANTLR3_BITWORD FOLLOW_relationalOp_in_synpred992_fml21675_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_relationalOp_in_synpred992_fml21675 = { FOLLOW_relationalOp_in_synpred992_fml21675_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_shiftExpression_in_synpred992_fml21679 */
+static ANTLR3_BITWORD FOLLOW_shiftExpression_in_synpred992_fml21679_bits[] = { ANTLR3_UINT64_LIT(0x0000600000000002), ANTLR3_UINT64_LIT(0x0000000000003000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000008000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_shiftExpression_in_synpred992_fml21679 = { FOLLOW_shiftExpression_in_synpred992_fml21679_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_relationalOp_in_synpred992_fml21695 */
+static ANTLR3_BITWORD FOLLOW_relationalOp_in_synpred992_fml21695_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_relationalOp_in_synpred992_fml21695 = { FOLLOW_relationalOp_in_synpred992_fml21695_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_shiftExpression_in_synpred992_fml21699 */
+static ANTLR3_BITWORD FOLLOW_shiftExpression_in_synpred992_fml21699_bits[] = { ANTLR3_UINT64_LIT(0x0000600000000002), ANTLR3_UINT64_LIT(0x0000000000003000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000008000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_shiftExpression_in_synpred992_fml21699 = { FOLLOW_shiftExpression_in_synpred992_fml21699_bits, 5 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_shiftOp_in_synpred997_fml21818 */
+static ANTLR3_BITWORD FOLLOW_shiftOp_in_synpred997_fml21818_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_shiftOp_in_synpred997_fml21818 = { FOLLOW_shiftOp_in_synpred997_fml21818_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_additiveExpression_in_synpred997_fml21822 */
+static ANTLR3_BITWORD FOLLOW_additiveExpression_in_synpred997_fml21822_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_additiveExpression_in_synpred997_fml21822 = { FOLLOW_additiveExpression_in_synpred997_fml21822_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_synpred1000_fml21892 */
+static ANTLR3_BITWORD FOLLOW_set_in_synpred1000_fml21892_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_synpred1000_fml21892 = { FOLLOW_set_in_synpred1000_fml21892_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_multiplicativeExpression_in_synpred1000_fml21924 */
+static ANTLR3_BITWORD FOLLOW_multiplicativeExpression_in_synpred1000_fml21924_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_multiplicativeExpression_in_synpred1000_fml21924 = { FOLLOW_multiplicativeExpression_in_synpred1000_fml21924_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_synpred1003_fml21968 */
+static ANTLR3_BITWORD FOLLOW_set_in_synpred1003_fml21968_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_synpred1003_fml21968 = { FOLLOW_set_in_synpred1003_fml21968_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_unaryExpression_in_synpred1003_fml22012 */
+static ANTLR3_BITWORD FOLLOW_unaryExpression_in_synpred1003_fml22012_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_unaryExpression_in_synpred1003_fml22012 = { FOLLOW_unaryExpression_in_synpred1003_fml22012_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INCR_in_synpred1020_fml22353 */
+static ANTLR3_BITWORD FOLLOW_INCR_in_synpred1020_fml22353_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_INCR_in_synpred1020_fml22353 = { FOLLOW_INCR_in_synpred1020_fml22353_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DECR_in_synpred1021_fml22364 */
+static ANTLR3_BITWORD FOLLOW_DECR_in_synpred1021_fml22364_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_DECR_in_synpred1021_fml22364 = { FOLLOW_DECR_in_synpred1021_fml22364_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_in_synpred1027_fml22603 */
+static ANTLR3_BITWORD FOLLOW_LPAREN_in_synpred1027_fml22603_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_LPAREN_in_synpred1027_fml22603 = { FOLLOW_LPAREN_in_synpred1027_fml22603_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_COLONx2_in_synpred1030_fml22666 */
+static ANTLR3_BITWORD FOLLOW_COLONx2_in_synpred1030_fml22666_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_COLONx2_in_synpred1030_fml22666 = { FOLLOW_COLONx2_in_synpred1030_fml22666_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LBRACKET_in_synpred1033_fml22761 */
+static ANTLR3_BITWORD FOLLOW_LBRACKET_in_synpred1033_fml22761_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LBRACKET_in_synpred1033_fml22761 = { FOLLOW_LBRACKET_in_synpred1033_fml22761_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred1033_fml22766 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred1033_fml22766_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred1033_fml22766 = { FOLLOW_expression_in_synpred1033_fml22766_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RBRACKET_in_synpred1033_fml22769 */
+static ANTLR3_BITWORD FOLLOW_RBRACKET_in_synpred1033_fml22769_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RBRACKET_in_synpred1033_fml22769 = { FOLLOW_RBRACKET_in_synpred1033_fml22769_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LBRACKET_in_synpred1035_fml22857 */
+static ANTLR3_BITWORD FOLLOW_LBRACKET_in_synpred1035_fml22857_bits[] = { ANTLR3_UINT64_LIT(0x308C080106402000), ANTLR3_UINT64_LIT(0x0124010000008185), ANTLR3_UINT64_LIT(0x00000007C0002040), ANTLR3_UINT64_LIT(0x0000200000000000), ANTLR3_UINT64_LIT(0x0200004001200201), ANTLR3_UINT64_LIT(0x0010000008801C00), ANTLR3_UINT64_LIT(0x0000000000002000) };
+static ANTLR3_BITSET_LIST FOLLOW_LBRACKET_in_synpred1035_fml22857 = { FOLLOW_LBRACKET_in_synpred1035_fml22857_bits, 7 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_synpred1035_fml22862 */
+static ANTLR3_BITWORD FOLLOW_expression_in_synpred1035_fml22862_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x1000000000000000) };
+static ANTLR3_BITSET_LIST FOLLOW_expression_in_synpred1035_fml22862 = { FOLLOW_expression_in_synpred1035_fml22862_bits, 2 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RBRACKET_in_synpred1035_fml22865 */
+static ANTLR3_BITWORD FOLLOW_RBRACKET_in_synpred1035_fml22865_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_RBRACKET_in_synpred1035_fml22865 = { FOLLOW_RBRACKET_in_synpred1035_fml22865_bits, 1 };
+
+
+/* ==============================================
+ * Parsing rules
+ */
+/**
+ * $ANTLR start formalML
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:626:1: formalML[ sep::WObjectManager & aWObjectManager ] returns [ sep::System * spec ] : prologue_fml (s= def_system ) ;
+ */
+static sep::System *
+formalML(pfmlParser ctx, sep::WObjectManager & aWObjectManager)
+{
+ sep::System * spec;
+
+ ANTLR3_UINT32 formalML_StartIndex;
+
+ sep::System * s;
+ #undef RETURN_TYPE_s
+ #define RETURN_TYPE_s sep::System *
+
+ /* Initialize rule variables
+ */
+ formalML_StartIndex = INDEX();
+
+
+
+ mWObjectManager = &( aWObjectManager );
+
+ spec = NULL;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(1)) )
+ {
+ {
+
+ spec->setWObject(DIVERITY_PROLOG);
+
+ }
+ {
+ }
+
+
+
+ return spec;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:636:2: ( prologue_fml (s= def_system ) )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:636:4: prologue_fml (s= def_system )
+ {
+ FOLLOWPUSH(FOLLOW_prologue_fml_in_formalML90);
+ prologue_fml(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleformalMLEx;
+ }
+ if (HASFAILED())
+ {
+ return spec;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:637:4: (s= def_system )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:637:6: s= def_system
+ {
+ FOLLOWPUSH(FOLLOW_def_system_in_formalML99);
+ s=def_system(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleformalMLEx;
+ }
+ if (HASFAILED())
+ {
+ return spec;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ spec=
+ s
+ ;
+
+ }
+
+
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleformalMLEx; /* Prevent compiler warnings */
+ ruleformalMLEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ spec->setWObject(DIVERITY_PROLOG);
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(1, formalML_StartIndex); }
+
+ return spec;
+}
+/* $ANTLR end formalML */
+
+/**
+ * $ANTLR start prologue_fml
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:647:1: prologue_fml : ( '@formalml' | '@xfml' | '@fml' | '@diversity' | '@xlia' | '@xfsp' )? LT_ ( 'system' | 'package' |id= ID ) ( ASSIGN id= ID )? ( COMMA ( FloatLiteral | ID | StringLiteral ) )* GT COLON ( prologue_attribute )? ( prologue_options )? ;
+ */
+static void
+prologue_fml(pfmlParser ctx)
+{
+ ANTLR3_UINT32 prologue_fml_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+
+ /* Initialize rule variables
+ */
+ prologue_fml_StartIndex = INDEX();
+
+
+
+ std::string attrID;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(2)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ id = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:651:2: ( ( '@formalml' | '@xfml' | '@fml' | '@diversity' | '@xlia' | '@xfsp' )? LT_ ( 'system' | 'package' |id= ID ) ( ASSIGN id= ID )? ( COMMA ( FloatLiteral | ID | StringLiteral ) )* GT COLON ( prologue_attribute )? ( prologue_options )? )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:651:4: ( '@formalml' | '@xfml' | '@fml' | '@diversity' | '@xlia' | '@xfsp' )? LT_ ( 'system' | 'package' |id= ID ) ( ASSIGN id= ID )? ( COMMA ( FloatLiteral | ID | StringLiteral ) )* GT COLON ( prologue_attribute )? ( prologue_options )?
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:651:4: ( '@formalml' | '@xfml' | '@fml' | '@diversity' | '@xlia' | '@xfsp' )?
+ {
+ int alt1=7;
+ switch ( LA(1) )
+ {
+ case 186:
+ {
+ alt1=1;
+ }
+ break;
+ case 233:
+ {
+ alt1=2;
+ }
+ break;
+ case 185:
+ {
+ alt1=3;
+ }
+ break;
+ case 180:
+ {
+ alt1=4;
+ }
+ break;
+ case 235:
+ {
+ alt1=5;
+ }
+ break;
+ case 234:
+ {
+ alt1=6;
+ }
+ break;
+ }
+
+ switch (alt1)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:651:6: '@formalml'
+ {
+ MATCHT(186, &FOLLOW_186_in_prologue_fml131);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ DIVERITY_PROLOG = mWObjectManager->newWSequence(sep::WObject::_NULL_, "formalml" );
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:652:6: '@xfml'
+ {
+ MATCHT(233, &FOLLOW_233_in_prologue_fml141);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ DIVERITY_PROLOG = mWObjectManager->newWSequence(sep::WObject::_NULL_, "xfml" );
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:653:6: '@fml'
+ {
+ MATCHT(185, &FOLLOW_185_in_prologue_fml155);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ DIVERITY_PROLOG = mWObjectManager->newWSequence(sep::WObject::_NULL_, "fml" );
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:654:6: '@diversity'
+ {
+ MATCHT(180, &FOLLOW_180_in_prologue_fml170);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ DIVERITY_PROLOG = mWObjectManager->newWSequence(sep::WObject::_NULL_, "diversity");
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:655:6: '@xlia'
+ {
+ MATCHT(235, &FOLLOW_235_in_prologue_fml179);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ DIVERITY_PROLOG = mWObjectManager->newWSequence(sep::WObject::_NULL_, "xlia" );
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:656:6: '@xfsp'
+ {
+ MATCHT(234, &FOLLOW_234_in_prologue_fml193);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ DIVERITY_PROLOG = mWObjectManager->newWSequence(sep::WObject::_NULL_, "xfsp" );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+
+ if( DIVERITY_PROLOG == sep::WObject::_NULL_ )
+ { DIVERITY_PROLOG = mWObjectManager->newWSequence(sep::WObject::_NULL_, "symbex"); }
+
+ }
+
+
+ MATCHT(LT_, &FOLLOW_LT__in_prologue_fml217);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:663:6: ( 'system' | 'package' |id= ID )
+ {
+ int alt2=3;
+ switch ( LA(1) )
+ {
+ case 390:
+ {
+ alt2=1;
+ }
+ break;
+ case 342:
+ {
+ alt2=2;
+ }
+ break;
+ case ID:
+ {
+ alt2=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 2;
+ EXCEPTION->state = 0;
+
+
+ goto ruleprologue_fmlEx;
+
+ }
+
+ switch (alt2)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:663:8: 'system'
+ {
+ MATCHT(390, &FOLLOW_390_in_prologue_fml226);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ attrID = "system";
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:664:8: 'package'
+ {
+ MATCHT(342, &FOLLOW_342_in_prologue_fml239);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ attrID = "package";
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:665:8: id= ID
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_prologue_fml253);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ attrID = STR((id->getText(id))->chars);
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:667:6: ( ASSIGN id= ID )?
+ {
+ int alt3=2;
+ switch ( LA(1) )
+ {
+ case ASSIGN:
+ {
+ alt3=1;
+ }
+ break;
+ }
+
+ switch (alt3)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:667:8: ASSIGN id= ID
+ {
+ MATCHT(ASSIGN, &FOLLOW_ASSIGN_in_prologue_fml276);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_prologue_fml280);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ DIVERITY_PROLOG->append( mWObjectManager->newWPropertyIdentifier(
+ DIVERITY_PROLOG, attrID, STR((id->getText(id))->chars) ) );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:673:4: ( COMMA ( FloatLiteral | ID | StringLiteral ) )*
+
+ for (;;)
+ {
+ int alt4=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt4=1;
+ }
+ break;
+
+ }
+
+ switch (alt4)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:673:6: COMMA ( FloatLiteral | ID | StringLiteral )
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_prologue_fml299);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( LA(1) == FloatLiteral || LA(1) == ID || LA(1) == StringLiteral )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruleprologue_fmlEx;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop4; /* break out of the loop */
+ break;
+ }
+ }
+ loop4: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(GT, &FOLLOW_GT_in_prologue_fml321);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(COLON, &FOLLOW_COLON_in_prologue_fml326);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:676:4: ( prologue_attribute )?
+ {
+ int alt5=2;
+ switch ( LA(1) )
+ {
+ case 208:
+ case 229:
+ {
+ alt5=1;
+ }
+ break;
+ }
+
+ switch (alt5)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:676:6: prologue_attribute
+ {
+ FOLLOWPUSH(FOLLOW_prologue_attribute_in_prologue_fml333);
+ prologue_attribute(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:677:4: ( prologue_options )?
+ {
+ int alt6=2;
+ switch ( LA(1) )
+ {
+ case 206:
+ {
+ alt6=1;
+ }
+ break;
+ }
+
+ switch (alt6)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:677:6: prologue_options
+ {
+ FOLLOWPUSH(FOLLOW_prologue_options_in_prologue_fml343);
+ prologue_options(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleprologue_fmlEx; /* Prevent compiler warnings */
+ ruleprologue_fmlEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(2, prologue_fml_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end prologue_fml */
+
+/**
+ * $ANTLR start prologue_attribute
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:681:1: prologue_attribute : ( '@package' ASSIGN id= ID SEMI | '@system' ASSIGN id= ID SEMI );
+ */
+static void
+prologue_attribute(pfmlParser ctx)
+{
+ ANTLR3_UINT32 prologue_attribute_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+
+ /* Initialize rule variables
+ */
+ prologue_attribute_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(3)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ id = NULL;
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:682:2: ( '@package' ASSIGN id= ID SEMI | '@system' ASSIGN id= ID SEMI )
+
+ ANTLR3_UINT32 alt7;
+
+ alt7=2;
+
+ switch ( LA(1) )
+ {
+ case 208:
+ {
+ alt7=1;
+ }
+ break;
+ case 229:
+ {
+ alt7=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 7;
+ EXCEPTION->state = 0;
+
+
+ goto ruleprologue_attributeEx;
+
+ }
+
+ switch (alt7)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:682:4: '@package' ASSIGN id= ID SEMI
+ {
+ MATCHT(208, &FOLLOW_208_in_prologue_attribute358);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_attributeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(ASSIGN, &FOLLOW_ASSIGN_in_prologue_attribute361);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_attributeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_prologue_attribute366);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_attributeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_prologue_attribute369);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_attributeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ DIVERITY_PROLOG->append( mWObjectManager->newWPropertyIdentifier(
+ DIVERITY_PROLOG, "package", STR((id->getText(id))->chars) ) );
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:688:4: '@system' ASSIGN id= ID SEMI
+ {
+ MATCHT(229, &FOLLOW_229_in_prologue_attribute378);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_attributeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(ASSIGN, &FOLLOW_ASSIGN_in_prologue_attribute381);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_attributeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_prologue_attribute386);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_attributeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_prologue_attribute389);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_attributeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ DIVERITY_PROLOG->append( mWObjectManager->newWPropertyIdentifier(
+ DIVERITY_PROLOG, "system", STR((id->getText(id))->chars) ) );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleprologue_attributeEx; /* Prevent compiler warnings */
+ ruleprologue_attributeEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(3, prologue_attribute_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end prologue_attribute */
+
+/**
+ * $ANTLR start prologue_options
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:696:1: prologue_options : '@options' LCURLY (id= ID ASSIGN e= expression SEMI )* RCURLY ;
+ */
+static void
+prologue_options(pfmlParser ctx)
+{
+ ANTLR3_UINT32 prologue_options_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ prologue_options_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(4)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ id = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:697:2: ( '@options' LCURLY (id= ID ASSIGN e= expression SEMI )* RCURLY )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:697:4: '@options' LCURLY (id= ID ASSIGN e= expression SEMI )* RCURLY
+ {
+ MATCHT(206, &FOLLOW_206_in_prologue_options404);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_optionsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_prologue_options407);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_optionsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:698:5: (id= ID ASSIGN e= expression SEMI )*
+
+ for (;;)
+ {
+ int alt8=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt8=1;
+ }
+ break;
+
+ }
+
+ switch (alt8)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:698:7: id= ID ASSIGN e= expression SEMI
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_prologue_options417);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_optionsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(ASSIGN, &FOLLOW_ASSIGN_in_prologue_options419);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_optionsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_prologue_options423);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_optionsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_prologue_options425);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_optionsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ sep::ParserUtil::setPrologueOption(STR((id->getText(id))->chars),
+ e
+ );
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop8; /* break out of the loop */
+ break;
+ }
+ }
+ loop8: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_prologue_options444);
+ if (HASEXCEPTION())
+ {
+ goto ruleprologue_optionsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleprologue_optionsEx; /* Prevent compiler warnings */
+ ruleprologue_optionsEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(4, prologue_options_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end prologue_options */
+
+/**
+ * $ANTLR start modifier_declaration
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:710:1: modifier_declaration returns [ sep::Modifier mdfr ] : ( 'final' | 'static' | 'volatile' | 'transient' | 'unsafe' | 'ref' | 'bind' | 'public' | 'private' | modifier_set_direction_strict_text[ mdfr ] )+ ;
+ */
+static sep::Modifier
+modifier_declaration(pfmlParser ctx)
+{
+ sep::Modifier mdfr;
+
+ ANTLR3_UINT32 modifier_declaration_StartIndex;
+
+ /* Initialize rule variables
+ */
+ modifier_declaration_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(5)) )
+ {
+ {
+ }
+
+
+
+ return mdfr;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:712:2: ( ( 'final' | 'static' | 'volatile' | 'transient' | 'unsafe' | 'ref' | 'bind' | 'public' | 'private' | modifier_set_direction_strict_text[ mdfr ] )+ )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:712:4: ( 'final' | 'static' | 'volatile' | 'transient' | 'unsafe' | 'ref' | 'bind' | 'public' | 'private' | modifier_set_direction_strict_text[ mdfr ] )+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:712:4: ( 'final' | 'static' | 'volatile' | 'transient' | 'unsafe' | 'ref' | 'bind' | 'public' | 'private' | modifier_set_direction_strict_text[ mdfr ] )+
+ {
+ int cnt9=0;
+
+ for (;;)
+ {
+ int alt9=11;
+ switch ( LA(1) )
+ {
+ case 282:
+ {
+ alt9=1;
+ }
+ break;
+ case 380:
+ {
+ alt9=2;
+ }
+ break;
+ case 414:
+ {
+ alt9=3;
+ }
+ break;
+ case 395:
+ {
+ alt9=4;
+ }
+ break;
+ case 406:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA9_5 = LA(2);
+ if ( (synpred21_fml(ctx)))
+ {
+ alt9=5;
+ }
+
+ }
+ }
+ break;
+ case 361:
+ {
+ alt9=6;
+ }
+ break;
+ case 243:
+ {
+ alt9=7;
+ }
+ break;
+ case 355:
+ {
+ alt9=8;
+ }
+ break;
+ case 349:
+ {
+ alt9=9;
+ }
+ break;
+ case 298:
+ case 305:
+ case 341:
+ case 364:
+ {
+ alt9=10;
+ }
+ break;
+
+ }
+
+ switch (alt9)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:712:6: 'final'
+ {
+ MATCHT(282, &FOLLOW_282_in_modifier_declaration467);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_declarationEx;
+ }
+ if (HASFAILED())
+ {
+ return mdfr;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setFeatureFinal();
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:715:6: 'static'
+ {
+ MATCHT(380, &FOLLOW_380_in_modifier_declaration486);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_declarationEx;
+ }
+ if (HASFAILED())
+ {
+ return mdfr;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setFeatureStatic();
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:717:6: 'volatile'
+ {
+ MATCHT(414, &FOLLOW_414_in_modifier_declaration503);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_declarationEx;
+ }
+ if (HASFAILED())
+ {
+ return mdfr;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setFeatureVolatile();
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:718:6: 'transient'
+ {
+ MATCHT(395, &FOLLOW_395_in_modifier_declaration517);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_declarationEx;
+ }
+ if (HASFAILED())
+ {
+ return mdfr;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setFeatureTransient();
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:720:6: 'unsafe'
+ {
+ MATCHT(406, &FOLLOW_406_in_modifier_declaration531);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_declarationEx;
+ }
+ if (HASFAILED())
+ {
+ return mdfr;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setFeatureUnsafe();
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:722:6: 'ref'
+ {
+ MATCHT(361, &FOLLOW_361_in_modifier_declaration548);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_declarationEx;
+ }
+ if (HASFAILED())
+ {
+ return mdfr;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setNatureReference();
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:725:6: 'bind'
+ {
+ MATCHT(243, &FOLLOW_243_in_modifier_declaration569);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_declarationEx;
+ }
+ if (HASFAILED())
+ {
+ return mdfr;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setNatureBind();
+ }
+
+
+ }
+ break;
+ case 8:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:727:6: 'public'
+ {
+ MATCHT(355, &FOLLOW_355_in_modifier_declaration588);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_declarationEx;
+ }
+ if (HASFAILED())
+ {
+ return mdfr;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setVisibilityPublic();
+ }
+
+
+ }
+ break;
+ case 9:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:729:6: 'private'
+ {
+ MATCHT(349, &FOLLOW_349_in_modifier_declaration605);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_declarationEx;
+ }
+ if (HASFAILED())
+ {
+ return mdfr;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setVisibilityPrivate();
+ }
+
+
+ }
+ break;
+ case 10:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:731:6: modifier_set_direction_strict_text[ mdfr ]
+ {
+ FOLLOWPUSH(FOLLOW_modifier_set_direction_strict_text_in_modifier_declaration621);
+ modifier_set_direction_strict_text(ctx, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_declarationEx;
+ }
+ if (HASFAILED())
+ {
+ return mdfr;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt9 >= 1 )
+ {
+ goto loop9;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return mdfr;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto rulemodifier_declarationEx;
+ }
+ cnt9++;
+ }
+ loop9: ; /* Jump to here if this rule does not match */
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulemodifier_declarationEx; /* Prevent compiler warnings */
+ rulemodifier_declarationEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(5, modifier_declaration_StartIndex); }
+
+ return mdfr;
+}
+/* $ANTLR end modifier_declaration */
+
+/**
+ * $ANTLR start modifier_direction
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:737:1: modifier_direction returns [ sep::Modifier mdfr ] : ( ( '->' | 'in' | 'input' ) | ( '<-' | 'out' | 'output' ) | ( '<->' | 'inout' ) | ( '<=' | 'return' ) );
+ */
+static sep::Modifier
+modifier_direction(pfmlParser ctx)
+{
+ sep::Modifier mdfr;
+
+ ANTLR3_UINT32 modifier_direction_StartIndex;
+
+ /* Initialize rule variables
+ */
+ modifier_direction_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(6)) )
+ {
+ {
+ }
+
+
+
+ return mdfr;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:739:2: ( ( '->' | 'in' | 'input' ) | ( '<-' | 'out' | 'output' ) | ( '<->' | 'inout' ) | ( '<=' | 'return' ) )
+
+ ANTLR3_UINT32 alt10;
+
+ alt10=4;
+
+ switch ( LA(1) )
+ {
+ case 164:
+ case 295:
+ case 305:
+ {
+ alt10=1;
+ }
+ break;
+ case ASSIGN_REF:
+ case 335:
+ case 341:
+ {
+ alt10=2;
+ }
+ break;
+ case 166:
+ case 298:
+ {
+ alt10=3;
+ }
+ break;
+ case LTE:
+ case 364:
+ {
+ alt10=4;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return mdfr;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 10;
+ EXCEPTION->state = 0;
+
+
+ goto rulemodifier_directionEx;
+
+ }
+
+ switch (alt10)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:739:4: ( '->' | 'in' | 'input' )
+ {
+ if ( LA(1) == 164 || LA(1) == 295 || LA(1) == 305 )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return mdfr;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulemodifier_directionEx;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setDirectionInput();
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:740:4: ( '<-' | 'out' | 'output' )
+ {
+ if ( LA(1) == ASSIGN_REF || LA(1) == 335 || LA(1) == 341 )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return mdfr;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulemodifier_directionEx;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setDirectionOutput();
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:741:4: ( '<->' | 'inout' )
+ {
+ if ( LA(1) == 166 || LA(1) == 298 )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return mdfr;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulemodifier_directionEx;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setDirectionInout();
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:742:4: ( '<=' | 'return' )
+ {
+ if ( LA(1) == LTE || LA(1) == 364 )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return mdfr;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulemodifier_directionEx;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setDirectionReturn();
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulemodifier_directionEx; /* Prevent compiler warnings */
+ rulemodifier_directionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(6, modifier_direction_StartIndex); }
+
+ return mdfr;
+}
+/* $ANTLR end modifier_direction */
+
+/**
+ * $ANTLR start modifier_direction_text
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:745:1: modifier_direction_text returns [ sep::Modifier mdfr ] : ( ( 'in' | 'input' ) | ( 'out' | 'output' ) | ( 'inout' ) | ( 'return' ) );
+ */
+static sep::Modifier
+modifier_direction_text(pfmlParser ctx)
+{
+ sep::Modifier mdfr;
+
+ ANTLR3_UINT32 modifier_direction_text_StartIndex;
+
+ /* Initialize rule variables
+ */
+ modifier_direction_text_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(7)) )
+ {
+ {
+ }
+
+
+
+ return mdfr;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:747:2: ( ( 'in' | 'input' ) | ( 'out' | 'output' ) | ( 'inout' ) | ( 'return' ) )
+
+ ANTLR3_UINT32 alt11;
+
+ alt11=4;
+
+ switch ( LA(1) )
+ {
+ case 295:
+ case 305:
+ {
+ alt11=1;
+ }
+ break;
+ case 335:
+ case 341:
+ {
+ alt11=2;
+ }
+ break;
+ case 298:
+ {
+ alt11=3;
+ }
+ break;
+ case 364:
+ {
+ alt11=4;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return mdfr;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 11;
+ EXCEPTION->state = 0;
+
+
+ goto rulemodifier_direction_textEx;
+
+ }
+
+ switch (alt11)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:747:4: ( 'in' | 'input' )
+ {
+ if ( LA(1) == 295 || LA(1) == 305 )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return mdfr;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulemodifier_direction_textEx;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setDirectionInput();
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:748:4: ( 'out' | 'output' )
+ {
+ if ( LA(1) == 335 || LA(1) == 341 )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return mdfr;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulemodifier_direction_textEx;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setDirectionOutput();
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:749:4: ( 'inout' )
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:749:4: ( 'inout' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:749:6: 'inout'
+ {
+ MATCHT(298, &FOLLOW_298_in_modifier_direction_text785);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_direction_textEx;
+ }
+ if (HASFAILED())
+ {
+ return mdfr;
+ }
+
+
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setDirectionInout();
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:750:4: ( 'return' )
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:750:4: ( 'return' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:750:6: 'return'
+ {
+ MATCHT(364, &FOLLOW_364_in_modifier_direction_text806);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_direction_textEx;
+ }
+ if (HASFAILED())
+ {
+ return mdfr;
+ }
+
+
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setDirectionReturn();
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulemodifier_direction_textEx; /* Prevent compiler warnings */
+ rulemodifier_direction_textEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(7, modifier_direction_text_StartIndex); }
+
+ return mdfr;
+}
+/* $ANTLR end modifier_direction_text */
+
+/**
+ * $ANTLR start modifier_set_direction_strict_text
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:753:1: modifier_set_direction_strict_text[ sep::Modifier & mdfr ] : ( 'input' | 'output' | 'inout' | 'return' );
+ */
+static void
+modifier_set_direction_strict_text(pfmlParser ctx, sep::Modifier & mdfr)
+{
+ ANTLR3_UINT32 modifier_set_direction_strict_text_StartIndex;
+
+ /* Initialize rule variables
+ */
+ modifier_set_direction_strict_text_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(8)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:755:2: ( 'input' | 'output' | 'inout' | 'return' )
+
+ ANTLR3_UINT32 alt12;
+
+ alt12=4;
+
+ switch ( LA(1) )
+ {
+ case 305:
+ {
+ alt12=1;
+ }
+ break;
+ case 341:
+ {
+ alt12=2;
+ }
+ break;
+ case 298:
+ {
+ alt12=3;
+ }
+ break;
+ case 364:
+ {
+ alt12=4;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 12;
+ EXCEPTION->state = 0;
+
+
+ goto rulemodifier_set_direction_strict_textEx;
+
+ }
+
+ switch (alt12)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:755:4: 'input'
+ {
+ MATCHT(305, &FOLLOW_305_in_modifier_set_direction_strict_text833);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_set_direction_strict_textEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setDirectionInput();
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:756:4: 'output'
+ {
+ MATCHT(341, &FOLLOW_341_in_modifier_set_direction_strict_text843);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_set_direction_strict_textEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setDirectionOutput();
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:757:4: 'inout'
+ {
+ MATCHT(298, &FOLLOW_298_in_modifier_set_direction_strict_text852);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_set_direction_strict_textEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setDirectionInout();
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:758:4: 'return'
+ {
+ MATCHT(364, &FOLLOW_364_in_modifier_set_direction_strict_text862);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_set_direction_strict_textEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setDirectionReturn();
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulemodifier_set_direction_strict_textEx; /* Prevent compiler warnings */
+ rulemodifier_set_direction_strict_textEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(8, modifier_set_direction_strict_text_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end modifier_set_direction_strict_text */
+
+/**
+ * $ANTLR start modifier_direction_symbol
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:761:1: modifier_direction_symbol returns [ sep::Modifier mdfr ] : ( '->' | '<-' | '<->' | '<=' );
+ */
+static sep::Modifier
+modifier_direction_symbol(pfmlParser ctx)
+{
+ sep::Modifier mdfr;
+
+ ANTLR3_UINT32 modifier_direction_symbol_StartIndex;
+
+ /* Initialize rule variables
+ */
+ modifier_direction_symbol_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(9)) )
+ {
+ {
+ }
+
+
+
+ return mdfr;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:763:2: ( '->' | '<-' | '<->' | '<=' )
+
+ ANTLR3_UINT32 alt13;
+
+ alt13=4;
+
+ switch ( LA(1) )
+ {
+ case 164:
+ {
+ alt13=1;
+ }
+ break;
+ case ASSIGN_REF:
+ {
+ alt13=2;
+ }
+ break;
+ case 166:
+ {
+ alt13=3;
+ }
+ break;
+ case LTE:
+ {
+ alt13=4;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return mdfr;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 13;
+ EXCEPTION->state = 0;
+
+
+ goto rulemodifier_direction_symbolEx;
+
+ }
+
+ switch (alt13)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:763:4: '->'
+ {
+ MATCHT(164, &FOLLOW_164_in_modifier_direction_symbol881);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_direction_symbolEx;
+ }
+ if (HASFAILED())
+ {
+ return mdfr;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setDirectionInput();
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:764:4: '<-'
+ {
+ MATCHT(ASSIGN_REF, &FOLLOW_ASSIGN_REF_in_modifier_direction_symbol891);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_direction_symbolEx;
+ }
+ if (HASFAILED())
+ {
+ return mdfr;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setDirectionOutput();
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:765:4: '<->'
+ {
+ MATCHT(166, &FOLLOW_166_in_modifier_direction_symbol901);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_direction_symbolEx;
+ }
+ if (HASFAILED())
+ {
+ return mdfr;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setDirectionInout();
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:766:4: '<='
+ {
+ MATCHT(LTE, &FOLLOW_LTE_in_modifier_direction_symbol910);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_direction_symbolEx;
+ }
+ if (HASFAILED())
+ {
+ return mdfr;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setDirectionReturn();
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulemodifier_direction_symbolEx; /* Prevent compiler warnings */
+ rulemodifier_direction_symbolEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(9, modifier_direction_symbol_StartIndex); }
+
+ return mdfr;
+}
+/* $ANTLR end modifier_direction_symbol */
+
+/**
+ * $ANTLR start modifier_param
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:771:1: modifier_param returns [ sep::Modifier mdfr ] : (m= modifier_direction | 'final' | 'const' | ( '&' | 'ref' ) | 'macro' | 'bind' );
+ */
+static sep::Modifier
+modifier_param(pfmlParser ctx)
+{
+ sep::Modifier mdfr;
+
+ ANTLR3_UINT32 modifier_param_StartIndex;
+
+ sep::Modifier m;
+ #undef RETURN_TYPE_m
+ #define RETURN_TYPE_m sep::Modifier
+
+ /* Initialize rule variables
+ */
+ modifier_param_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(10)) )
+ {
+ {
+ }
+
+
+
+ return mdfr;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:773:2: (m= modifier_direction | 'final' | 'const' | ( '&' | 'ref' ) | 'macro' | 'bind' )
+
+ ANTLR3_UINT32 alt14;
+
+ alt14=6;
+
+ switch ( LA(1) )
+ {
+ case ASSIGN_REF:
+ case LTE:
+ case 164:
+ case 166:
+ case 295:
+ case 298:
+ case 305:
+ case 335:
+ case 341:
+ case 364:
+ {
+ alt14=1;
+ }
+ break;
+ case 282:
+ {
+ alt14=2;
+ }
+ break;
+ case 262:
+ {
+ alt14=3;
+ }
+ break;
+ case BAND:
+ case 361:
+ {
+ alt14=4;
+ }
+ break;
+ case 318:
+ {
+ alt14=5;
+ }
+ break;
+ case 243:
+ {
+ alt14=6;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return mdfr;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 14;
+ EXCEPTION->state = 0;
+
+
+ goto rulemodifier_paramEx;
+
+ }
+
+ switch (alt14)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:773:4: m= modifier_direction
+ {
+ FOLLOWPUSH(FOLLOW_modifier_direction_in_modifier_param934);
+ m=modifier_direction(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_paramEx;
+ }
+ if (HASFAILED())
+ {
+ return mdfr;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr = m
+ ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:775:4: 'final'
+ {
+ MATCHT(282, &FOLLOW_282_in_modifier_param943);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_paramEx;
+ }
+ if (HASFAILED())
+ {
+ return mdfr;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setFeatureFinal();
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:776:4: 'const'
+ {
+ MATCHT(262, &FOLLOW_262_in_modifier_param960);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_paramEx;
+ }
+ if (HASFAILED())
+ {
+ return mdfr;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setFeatureConst();
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:778:4: ( '&' | 'ref' )
+ {
+ if ( LA(1) == BAND || LA(1) == 361 )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return mdfr;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulemodifier_paramEx;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setNatureReference();
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:779:4: 'macro'
+ {
+ MATCHT(318, &FOLLOW_318_in_modifier_param995);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_paramEx;
+ }
+ if (HASFAILED())
+ {
+ return mdfr;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setNatureMacro();
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:781:4: 'bind'
+ {
+ MATCHT(243, &FOLLOW_243_in_modifier_param1013);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_paramEx;
+ }
+ if (HASFAILED())
+ {
+ return mdfr;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setNatureBind();
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulemodifier_paramEx; /* Prevent compiler warnings */
+ rulemodifier_paramEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(10, modifier_param_StartIndex); }
+
+ return mdfr;
+}
+/* $ANTLR end modifier_param */
+
+/**
+ * $ANTLR start procedure_modifier_specifier
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:786:1: procedure_modifier_specifier returns [ sep::Modifier mdfr , sep::Specifier spcfr ] : ( 'timed' | 'input_enabled' | 'unsafe' )+ ;
+ */
+static fmlParser_procedure_modifier_specifier_return
+procedure_modifier_specifier(pfmlParser ctx)
+{
+ fmlParser_procedure_modifier_specifier_return retval;
+
+ ANTLR3_UINT32 procedure_modifier_specifier_StartIndex;
+
+ /* Initialize rule variables
+ */
+ procedure_modifier_specifier_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(11)) )
+ {
+ retval.start = 0;
+
+ {
+ }
+
+
+
+ return retval;
+ }
+
+ retval.start = LT(1); retval.stop = retval.start;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:805:2: ( ( 'timed' | 'input_enabled' | 'unsafe' )+ )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:805:4: ( 'timed' | 'input_enabled' | 'unsafe' )+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:805:4: ( 'timed' | 'input_enabled' | 'unsafe' )+
+ {
+ int cnt15=0;
+
+ for (;;)
+ {
+ int alt15=4;
+ switch ( LA(1) )
+ {
+ case 393:
+ {
+ alt15=1;
+ }
+ break;
+ case 306:
+ {
+ alt15=2;
+ }
+ break;
+ case 406:
+ {
+ alt15=3;
+ }
+ break;
+
+ }
+
+ switch (alt15)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:805:6: 'timed'
+ {
+ MATCHT(393, &FOLLOW_393_in_procedure_modifier_specifier1062);
+ if (HASEXCEPTION())
+ {
+ goto ruleprocedure_modifier_specifierEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.spcfr
+ .setFeatureTimed();
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:806:6: 'input_enabled'
+ {
+ MATCHT(306, &FOLLOW_306_in_procedure_modifier_specifier1079);
+ if (HASEXCEPTION())
+ {
+ goto ruleprocedure_modifier_specifierEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.spcfr
+ .setFeatureInputEnabled();
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:808:6: 'unsafe'
+ {
+ MATCHT(406, &FOLLOW_406_in_procedure_modifier_specifier1089);
+ if (HASEXCEPTION())
+ {
+ goto ruleprocedure_modifier_specifierEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.mdfr
+ .setFeatureUnsafe();
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt15 >= 1 )
+ {
+ goto loop15;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return retval;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruleprocedure_modifier_specifierEx;
+ }
+ cnt15++;
+ }
+ loop15: ; /* Jump to here if this rule does not match */
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleprocedure_modifier_specifierEx; /* Prevent compiler warnings */
+ ruleprocedure_modifier_specifierEx: ;
+ retval.stop = LT(-1);
+
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(11, procedure_modifier_specifier_StartIndex); }
+
+ return retval;
+}
+/* $ANTLR end procedure_modifier_specifier */
+
+/**
+ * $ANTLR start executable_modifier_specifier
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:813:1: executable_modifier_specifier returns [ sep::Modifier mdfr , sep::Specifier spcfr ] : ( 'model' | 'prototype' | 'dynamic' | 'unsafe' | 'timed' | 'input_enabled' | 'lifeline' )+ ;
+ */
+static fmlParser_executable_modifier_specifier_return
+executable_modifier_specifier(pfmlParser ctx)
+{
+ fmlParser_executable_modifier_specifier_return retval;
+
+ ANTLR3_UINT32 executable_modifier_specifier_StartIndex;
+
+ /* Initialize rule variables
+ */
+ executable_modifier_specifier_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(12)) )
+ {
+ retval.start = 0;
+
+ {
+ }
+
+
+
+ return retval;
+ }
+
+ retval.start = LT(1); retval.stop = retval.start;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:820:2: ( ( 'model' | 'prototype' | 'dynamic' | 'unsafe' | 'timed' | 'input_enabled' | 'lifeline' )+ )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:820:4: ( 'model' | 'prototype' | 'dynamic' | 'unsafe' | 'timed' | 'input_enabled' | 'lifeline' )+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:820:4: ( 'model' | 'prototype' | 'dynamic' | 'unsafe' | 'timed' | 'input_enabled' | 'lifeline' )+
+ {
+ int cnt16=0;
+
+ for (;;)
+ {
+ int alt16=8;
+ switch ( LA(1) )
+ {
+ case 322:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA16_1 = LA(2);
+ if ( (synpred56_fml(ctx)))
+ {
+ alt16=1;
+ }
+
+ }
+ }
+ break;
+ case 353:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA16_4 = LA(2);
+ if ( (synpred57_fml(ctx)))
+ {
+ alt16=2;
+ }
+
+ }
+ }
+ break;
+ case 272:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA16_6 = LA(2);
+ if ( (synpred58_fml(ctx)))
+ {
+ alt16=3;
+ }
+
+ }
+ }
+ break;
+ case 406:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA16_8 = LA(2);
+ if ( (synpred59_fml(ctx)))
+ {
+ alt16=4;
+ }
+
+ }
+ }
+ break;
+ case 393:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA16_10 = LA(2);
+ if ( (synpred60_fml(ctx)))
+ {
+ alt16=5;
+ }
+
+ }
+ }
+ break;
+ case 306:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA16_12 = LA(2);
+ if ( (synpred61_fml(ctx)))
+ {
+ alt16=6;
+ }
+
+ }
+ }
+ break;
+ case 314:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA16_14 = LA(2);
+ if ( (synpred62_fml(ctx)))
+ {
+ alt16=7;
+ }
+
+ }
+ }
+ break;
+
+ }
+
+ switch (alt16)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:820:6: 'model'
+ {
+ MATCHT(322, &FOLLOW_322_in_executable_modifier_specifier1127);
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_modifier_specifierEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.spcfr
+ .setDesignModel();
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:821:6: 'prototype'
+ {
+ MATCHT(353, &FOLLOW_353_in_executable_modifier_specifier1144);
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_modifier_specifierEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.spcfr
+ .setDesignPrototypeStatic();
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:823:6: 'dynamic'
+ {
+ MATCHT(272, &FOLLOW_272_in_executable_modifier_specifier1158);
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_modifier_specifierEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.spcfr
+ .setDesignInstanceDynamic();
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:832:6: 'unsafe'
+ {
+ MATCHT(406, &FOLLOW_406_in_executable_modifier_specifier1181);
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_modifier_specifierEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.mdfr
+ .setFeatureUnsafe();
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:834:6: 'timed'
+ {
+ MATCHT(393, &FOLLOW_393_in_executable_modifier_specifier1198);
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_modifier_specifierEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.spcfr
+ .setFeatureTimed();
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:835:6: 'input_enabled'
+ {
+ MATCHT(306, &FOLLOW_306_in_executable_modifier_specifier1215);
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_modifier_specifierEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.spcfr
+ .setFeatureInputEnabled();
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:836:6: 'lifeline'
+ {
+ MATCHT(314, &FOLLOW_314_in_executable_modifier_specifier1224);
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_modifier_specifierEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.spcfr
+ .setFeatureLifeline();
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt16 >= 1 )
+ {
+ goto loop16;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return retval;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruleexecutable_modifier_specifierEx;
+ }
+ cnt16++;
+ }
+ loop16: ; /* Jump to here if this rule does not match */
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleexecutable_modifier_specifierEx; /* Prevent compiler warnings */
+ ruleexecutable_modifier_specifierEx: ;
+ retval.stop = LT(-1);
+
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(12, executable_modifier_specifier_StartIndex); }
+
+ return retval;
+}
+/* $ANTLR end executable_modifier_specifier */
+
+/**
+ * $ANTLR start instance_modifier_specifier
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:840:1: instance_modifier_specifier returns [ sep::Modifier mdfr , sep::Specifier spcfr ] : ( 'final' | 'dynamic' | 'public' | 'protected' | 'private' | 'unsafe' | 'timed' | 'input_enabled' | 'lifeline' )+ ;
+ */
+static fmlParser_instance_modifier_specifier_return
+instance_modifier_specifier(pfmlParser ctx)
+{
+ fmlParser_instance_modifier_specifier_return retval;
+
+ ANTLR3_UINT32 instance_modifier_specifier_StartIndex;
+
+ /* Initialize rule variables
+ */
+ instance_modifier_specifier_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(13)) )
+ {
+ retval.start = 0;
+
+ {
+ }
+
+
+
+ return retval;
+ }
+
+ retval.start = LT(1); retval.stop = retval.start;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:842:2: ( ( 'final' | 'dynamic' | 'public' | 'protected' | 'private' | 'unsafe' | 'timed' | 'input_enabled' | 'lifeline' )+ )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:842:4: ( 'final' | 'dynamic' | 'public' | 'protected' | 'private' | 'unsafe' | 'timed' | 'input_enabled' | 'lifeline' )+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:842:4: ( 'final' | 'dynamic' | 'public' | 'protected' | 'private' | 'unsafe' | 'timed' | 'input_enabled' | 'lifeline' )+
+ {
+ int cnt17=0;
+
+ for (;;)
+ {
+ int alt17=10;
+ switch ( LA(1) )
+ {
+ case 282:
+ {
+ alt17=1;
+ }
+ break;
+ case 272:
+ {
+ alt17=2;
+ }
+ break;
+ case 355:
+ {
+ alt17=3;
+ }
+ break;
+ case 352:
+ {
+ alt17=4;
+ }
+ break;
+ case 349:
+ {
+ alt17=5;
+ }
+ break;
+ case 406:
+ {
+ alt17=6;
+ }
+ break;
+ case 393:
+ {
+ alt17=7;
+ }
+ break;
+ case 306:
+ {
+ alt17=8;
+ }
+ break;
+ case 314:
+ {
+ alt17=9;
+ }
+ break;
+
+ }
+
+ switch (alt17)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:842:6: 'final'
+ {
+ MATCHT(282, &FOLLOW_282_in_instance_modifier_specifier1254);
+ if (HASEXCEPTION())
+ {
+ goto ruleinstance_modifier_specifierEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.mdfr
+ .setFeatureFinal();
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:850:6: 'dynamic'
+ {
+ MATCHT(272, &FOLLOW_272_in_instance_modifier_specifier1278);
+ if (HASEXCEPTION())
+ {
+ goto ruleinstance_modifier_specifierEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.spcfr
+ .setDesignInstanceDynamic();
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:855:6: 'public'
+ {
+ MATCHT(355, &FOLLOW_355_in_instance_modifier_specifier1297);
+ if (HASEXCEPTION())
+ {
+ goto ruleinstance_modifier_specifierEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.mdfr
+ .setVisibilityPublic();
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:856:6: 'protected'
+ {
+ MATCHT(352, &FOLLOW_352_in_instance_modifier_specifier1313);
+ if (HASEXCEPTION())
+ {
+ goto ruleinstance_modifier_specifierEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.mdfr
+ .setVisibilityProtected();
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:857:6: 'private'
+ {
+ MATCHT(349, &FOLLOW_349_in_instance_modifier_specifier1326);
+ if (HASEXCEPTION())
+ {
+ goto ruleinstance_modifier_specifierEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.mdfr
+ .setVisibilityPrivate();
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:859:6: 'unsafe'
+ {
+ MATCHT(406, &FOLLOW_406_in_instance_modifier_specifier1342);
+ if (HASEXCEPTION())
+ {
+ goto ruleinstance_modifier_specifierEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.mdfr
+ .setFeatureUnsafe();
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:861:6: 'timed'
+ {
+ MATCHT(393, &FOLLOW_393_in_instance_modifier_specifier1359);
+ if (HASEXCEPTION())
+ {
+ goto ruleinstance_modifier_specifierEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.spcfr
+ .setFeatureTimed();
+ }
+
+
+ }
+ break;
+ case 8:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:862:6: 'input_enabled'
+ {
+ MATCHT(306, &FOLLOW_306_in_instance_modifier_specifier1376);
+ if (HASEXCEPTION())
+ {
+ goto ruleinstance_modifier_specifierEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.spcfr
+ .setFeatureInputEnabled();
+ }
+
+
+ }
+ break;
+ case 9:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:863:6: 'lifeline'
+ {
+ MATCHT(314, &FOLLOW_314_in_instance_modifier_specifier1385);
+ if (HASEXCEPTION())
+ {
+ goto ruleinstance_modifier_specifierEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.spcfr
+ .setFeatureLifeline();
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt17 >= 1 )
+ {
+ goto loop17;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return retval;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruleinstance_modifier_specifierEx;
+ }
+ cnt17++;
+ }
+ loop17: ; /* Jump to here if this rule does not match */
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleinstance_modifier_specifierEx; /* Prevent compiler warnings */
+ ruleinstance_modifier_specifierEx: ;
+ retval.stop = LT(-1);
+
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(13, instance_modifier_specifier_StartIndex); }
+
+ return retval;
+}
+/* $ANTLR end instance_modifier_specifier */
+
+/**
+ * $ANTLR start modifier_transition
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:869:1: modifier_transition returns [ sep::Modifier mdfr , sep::Specifier spcfr ] : ( 'transient' | 'timed' | 'input_enabled' )+ ;
+ */
+static fmlParser_modifier_transition_return
+modifier_transition(pfmlParser ctx)
+{
+ fmlParser_modifier_transition_return retval;
+
+ ANTLR3_UINT32 modifier_transition_StartIndex;
+
+ /* Initialize rule variables
+ */
+ modifier_transition_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(14)) )
+ {
+ retval.start = 0;
+
+ {
+ }
+
+
+
+ return retval;
+ }
+
+ retval.start = LT(1); retval.stop = retval.start;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:874:2: ( ( 'transient' | 'timed' | 'input_enabled' )+ )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:874:4: ( 'transient' | 'timed' | 'input_enabled' )+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:874:4: ( 'transient' | 'timed' | 'input_enabled' )+
+ {
+ int cnt18=0;
+
+ for (;;)
+ {
+ int alt18=4;
+ switch ( LA(1) )
+ {
+ case 395:
+ {
+ alt18=1;
+ }
+ break;
+ case 393:
+ {
+ alt18=2;
+ }
+ break;
+ case 306:
+ {
+ alt18=3;
+ }
+ break;
+
+ }
+
+ switch (alt18)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:874:6: 'transient'
+ {
+ MATCHT(395, &FOLLOW_395_in_modifier_transition1420);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.mdfr
+ .setFeatureTransient();
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:878:6: 'timed'
+ {
+ MATCHT(393, &FOLLOW_393_in_modifier_transition1436);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.spcfr
+ .setFeatureTimed();
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:879:6: 'input_enabled'
+ {
+ MATCHT(306, &FOLLOW_306_in_modifier_transition1453);
+ if (HASEXCEPTION())
+ {
+ goto rulemodifier_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.spcfr
+ .setFeatureInputEnabled();
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt18 >= 1 )
+ {
+ goto loop18;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return retval;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto rulemodifier_transitionEx;
+ }
+ cnt18++;
+ }
+ loop18: ; /* Jump to here if this rule does not match */
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulemodifier_transitionEx; /* Prevent compiler warnings */
+ rulemodifier_transitionEx: ;
+ retval.stop = LT(-1);
+
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(14, modifier_transition_StartIndex); }
+
+ return retval;
+}
+/* $ANTLR end modifier_transition */
+
+/**
+ * $ANTLR start def_package
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:888:1: def_package returns [ sep::Package * pack ] : 'package' id= ID ( StringLiteral )? LCURLY ( section_header[ pack ] )? ( section_import[ pack ] )? ( section_property[ pack ] )* ( section_composite_structure[ pack ] )* RCURLY ;
+ */
+static sep::Package *
+def_package(pfmlParser ctx)
+{
+ sep::Package * pack;
+
+ ANTLR3_UINT32 def_package_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ pANTLR3_COMMON_TOKEN StringLiteral1;
+
+ /* Initialize rule variables
+ */
+ def_package_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(15)) )
+ {
+ {
+
+ POP_CTX;
+
+ sep::ParserUtil::declareDefaultEndingStateIfNeed(needDefaultStateFinal,
+ needDefaultStateTerminal, needDefaultStateReturn);
+
+ }
+ {
+ }
+
+
+
+ return pack;
+ }
+
+ id = NULL;
+ StringLiteral1 = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:896:2: ( 'package' id= ID ( StringLiteral )? LCURLY ( section_header[ pack ] )? ( section_import[ pack ] )? ( section_property[ pack ] )* ( section_composite_structure[ pack ] )* RCURLY )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:896:4: 'package' id= ID ( StringLiteral )? LCURLY ( section_header[ pack ] )? ( section_import[ pack ] )? ( section_property[ pack ] )* ( section_composite_structure[ pack ] )* RCURLY
+ {
+ MATCHT(342, &FOLLOW_342_in_def_package1485);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_packageEx;
+ }
+ if (HASFAILED())
+ {
+ return pack;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_def_package1489);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_packageEx;
+ }
+ if (HASFAILED())
+ {
+ return pack;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ PUSH_CTX_CPM( pack= new sep::Package(STR((id->getText(id))->chars)) );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:899:6: ( StringLiteral )?
+ {
+ int alt19=2;
+ switch ( LA(1) )
+ {
+ case StringLiteral:
+ {
+ alt19=1;
+ }
+ break;
+ }
+
+ switch (alt19)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:899:8: StringLiteral
+ {
+ StringLiteral1 = (pANTLR3_COMMON_TOKEN) MATCHT(StringLiteral, &FOLLOW_StringLiteral_in_def_package1506);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_packageEx;
+ }
+ if (HASFAILED())
+ {
+ return pack;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ pack
+ ->setUnrestrictedName(STR((StringLiteral1->getText(StringLiteral1))->chars));
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_def_package1527);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_packageEx;
+ }
+ if (HASFAILED())
+ {
+ return pack;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:904:4: ( section_header[ pack ] )?
+ {
+ int alt20=2;
+ switch ( LA(1) )
+ {
+ case 188:
+ {
+ alt20=1;
+ }
+ break;
+ }
+
+ switch (alt20)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:904:4: section_header[ pack ]
+ {
+ FOLLOWPUSH(FOLLOW_section_header_in_def_package1532);
+ section_header(ctx, pack);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_packageEx;
+ }
+ if (HASFAILED())
+ {
+ return pack;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:905:4: ( section_import[ pack ] )?
+ {
+ int alt21=2;
+ switch ( LA(1) )
+ {
+ case 192:
+ {
+ alt21=1;
+ }
+ break;
+ }
+
+ switch (alt21)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:905:4: section_import[ pack ]
+ {
+ FOLLOWPUSH(FOLLOW_section_import_in_def_package1540);
+ section_import(ctx, pack);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_packageEx;
+ }
+ if (HASFAILED())
+ {
+ return pack;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:907:4: ( section_property[ pack ] )*
+
+ for (;;)
+ {
+ int alt22=2;
+ switch ( LA(1) )
+ {
+ case 178:
+ case 211:
+ case 213:
+ case 214:
+ case 216:
+ {
+ alt22=1;
+ }
+ break;
+
+ }
+
+ switch (alt22)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:907:6: section_property[ pack ]
+ {
+ FOLLOWPUSH(FOLLOW_section_property_in_def_package1551);
+ section_property(ctx, pack);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_packageEx;
+ }
+ if (HASFAILED())
+ {
+ return pack;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop22; /* break out of the loop */
+ break;
+ }
+ }
+ loop22: ; /* Jump out to here if this rule does not match */
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:909:4: ( section_composite_structure[ pack ] )*
+
+ for (;;)
+ {
+ int alt23=2;
+ switch ( LA(1) )
+ {
+ case 174:
+ case 183:
+ case 197:
+ case 200:
+ case 201:
+ case 203:
+ case 212:
+ case 215:
+ case 222:
+ {
+ alt23=1;
+ }
+ break;
+
+ }
+
+ switch (alt23)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:909:6: section_composite_structure[ pack ]
+ {
+ FOLLOWPUSH(FOLLOW_section_composite_structure_in_def_package1563);
+ section_composite_structure(ctx, pack);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_packageEx;
+ }
+ if (HASFAILED())
+ {
+ return pack;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop23; /* break out of the loop */
+ break;
+ }
+ }
+ loop23: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_def_package1572);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_packageEx;
+ }
+ if (HASFAILED())
+ {
+ return pack;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_packageEx; /* Prevent compiler warnings */
+ ruledef_packageEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ POP_CTX;
+
+ sep::ParserUtil::declareDefaultEndingStateIfNeed(needDefaultStateFinal,
+ needDefaultStateTerminal, needDefaultStateReturn);
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(15, def_package_StartIndex); }
+
+ return pack;
+}
+/* $ANTLR end def_package */
+
+/**
+ * $ANTLR start def_system
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:918:1: def_system returns [ sep::System * sys ] : (ms= executable_modifier_specifier )? 'system' ( LT_ ( 'moc:' )? executable_specifier[ spcfr ] GT )? id= ID ( StringLiteral )? LCURLY ( section_header[ sys ] )? ( section_import[ sys ] )? ( section_parameter[ sys ] )* ( section_property[ sys ] )* ( section_composite_structure[ sys ] )* ( section_behavior[ sys ] | section_statemachine[ sys ] )? ( section_model_of_computation[ sys ] | section_model_of_interaction[ sys ] | section_model_of_execution[ sys ] )* RCURLY ;
+ */
+static sep::System *
+def_system(pfmlParser ctx)
+{
+ sep::System * sys;
+
+ ANTLR3_UINT32 def_system_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ pANTLR3_COMMON_TOKEN StringLiteral2;
+ fmlParser_executable_modifier_specifier_return ms;
+ #undef RETURN_TYPE_ms
+ #define RETURN_TYPE_ms fmlParser_executable_modifier_specifier_return
+
+ /* Initialize rule variables
+ */
+ def_system_StartIndex = INDEX();
+
+
+
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr( sep::Specifier::COMPONENT_SYSTEM_KIND );
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(16)) )
+ {
+ {
+
+ POP_CTX;
+
+ sep::ParserUtil::declareDefaultEndingStateIfNeed(needDefaultStateFinal,
+ needDefaultStateTerminal, needDefaultStateReturn);
+
+ SET_RULE_LOCATION(sys);
+
+ }
+ {
+ }
+
+
+
+ return sys;
+ }
+
+ id = NULL;
+ StringLiteral2 = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:935:2: ( (ms= executable_modifier_specifier )? 'system' ( LT_ ( 'moc:' )? executable_specifier[ spcfr ] GT )? id= ID ( StringLiteral )? LCURLY ( section_header[ sys ] )? ( section_import[ sys ] )? ( section_parameter[ sys ] )* ( section_property[ sys ] )* ( section_composite_structure[ sys ] )* ( section_behavior[ sys ] | section_statemachine[ sys ] )? ( section_model_of_computation[ sys ] | section_model_of_interaction[ sys ] | section_model_of_execution[ sys ] )* RCURLY )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:935:4: (ms= executable_modifier_specifier )? 'system' ( LT_ ( 'moc:' )? executable_specifier[ spcfr ] GT )? id= ID ( StringLiteral )? LCURLY ( section_header[ sys ] )? ( section_import[ sys ] )? ( section_parameter[ sys ] )* ( section_property[ sys ] )* ( section_composite_structure[ sys ] )* ( section_behavior[ sys ] | section_statemachine[ sys ] )? ( section_model_of_computation[ sys ] | section_model_of_interaction[ sys ] | section_model_of_execution[ sys ] )* RCURLY
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:935:4: (ms= executable_modifier_specifier )?
+ {
+ int alt24=2;
+ switch ( LA(1) )
+ {
+ case 272:
+ case 306:
+ case 314:
+ case 322:
+ case 353:
+ case 393:
+ case 406:
+ {
+ alt24=1;
+ }
+ break;
+ }
+
+ switch (alt24)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:935:6: ms= executable_modifier_specifier
+ {
+ FOLLOWPUSH(FOLLOW_executable_modifier_specifier_in_def_system1604);
+ ms=executable_modifier_specifier(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_systemEx;
+ }
+ if (HASFAILED())
+ {
+ return sys;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr = ms.mdfr
+ ; spcfr.ifnot_define( ms.spcfr
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(390, &FOLLOW_390_in_def_system1618);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_systemEx;
+ }
+ if (HASFAILED())
+ {
+ return sys;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:939:4: ( LT_ ( 'moc:' )? executable_specifier[ spcfr ] GT )?
+ {
+ int alt26=2;
+ switch ( LA(1) )
+ {
+ case LT_:
+ {
+ alt26=1;
+ }
+ break;
+ }
+
+ switch (alt26)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:939:6: LT_ ( 'moc:' )? executable_specifier[ spcfr ] GT
+ {
+ MATCHT(LT_, &FOLLOW_LT__in_def_system1626);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_systemEx;
+ }
+ if (HASFAILED())
+ {
+ return sys;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:939:10: ( 'moc:' )?
+ {
+ int alt25=2;
+ switch ( LA(1) )
+ {
+ case 321:
+ {
+ alt25=1;
+ }
+ break;
+ }
+
+ switch (alt25)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:939:12: 'moc:'
+ {
+ MATCHT(321, &FOLLOW_321_in_def_system1630);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_systemEx;
+ }
+ if (HASFAILED())
+ {
+ return sys;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_executable_specifier_in_def_system1636);
+ executable_specifier(ctx, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_systemEx;
+ }
+ if (HASFAILED())
+ {
+ return sys;
+ }
+
+
+ MATCHT(GT, &FOLLOW_GT_in_def_system1639);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_systemEx;
+ }
+ if (HASFAILED())
+ {
+ return sys;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_def_system1649);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_systemEx;
+ }
+ if (HASFAILED())
+ {
+ return sys;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ PUSH_CTX_CPM( _SYSTEM_ = sys= new sep::System(STR((id->getText(id))->chars)) );
+
+
+ sys
+ ->getwModifier().override_ifdef( mdfr );
+
+ sys
+ ->getwSpecifier().ifnot_define( spcfr );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:949:4: ( StringLiteral )?
+ {
+ int alt27=2;
+ switch ( LA(1) )
+ {
+ case StringLiteral:
+ {
+ alt27=1;
+ }
+ break;
+ }
+
+ switch (alt27)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:949:6: StringLiteral
+ {
+ StringLiteral2 = (pANTLR3_COMMON_TOKEN) MATCHT(StringLiteral, &FOLLOW_StringLiteral_in_def_system1662);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_systemEx;
+ }
+ if (HASFAILED())
+ {
+ return sys;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ sys
+ ->setUnrestrictedName(STR((StringLiteral2->getText(StringLiteral2))->chars));
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_def_system1679);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_systemEx;
+ }
+ if (HASFAILED())
+ {
+ return sys;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:957:4: ( section_header[ sys ] )?
+ {
+ int alt28=2;
+ switch ( LA(1) )
+ {
+ case 188:
+ {
+ alt28=1;
+ }
+ break;
+ }
+
+ switch (alt28)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:957:4: section_header[ sys ]
+ {
+ FOLLOWPUSH(FOLLOW_section_header_in_def_system1687);
+ section_header(ctx, sys);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_systemEx;
+ }
+ if (HASFAILED())
+ {
+ return sys;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:958:4: ( section_import[ sys ] )?
+ {
+ int alt29=2;
+ switch ( LA(1) )
+ {
+ case 192:
+ {
+ alt29=1;
+ }
+ break;
+ }
+
+ switch (alt29)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:958:4: section_import[ sys ]
+ {
+ FOLLOWPUSH(FOLLOW_section_import_in_def_system1695);
+ section_import(ctx, sys);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_systemEx;
+ }
+ if (HASFAILED())
+ {
+ return sys;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:960:4: ( section_parameter[ sys ] )*
+
+ for (;;)
+ {
+ int alt30=2;
+ switch ( LA(1) )
+ {
+ case 195:
+ case 196:
+ case 207:
+ case 209:
+ case 210:
+ case 219:
+ case 220:
+ {
+ alt30=1;
+ }
+ break;
+
+ }
+
+ switch (alt30)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:960:6: section_parameter[ sys ]
+ {
+ FOLLOWPUSH(FOLLOW_section_parameter_in_def_system1706);
+ section_parameter(ctx, sys);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_systemEx;
+ }
+ if (HASFAILED())
+ {
+ return sys;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop30; /* break out of the loop */
+ break;
+ }
+ }
+ loop30: ; /* Jump out to here if this rule does not match */
+
+
+ if ( BACKTRACKING==0 )
+ {
+ sep::TemplateFactory::genProperty(sys);
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:965:4: ( section_property[ sys ] )*
+
+ for (;;)
+ {
+ int alt31=2;
+ switch ( LA(1) )
+ {
+ case 178:
+ case 211:
+ case 213:
+ case 214:
+ case 216:
+ {
+ alt31=1;
+ }
+ break;
+
+ }
+
+ switch (alt31)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:965:6: section_property[ sys ]
+ {
+ FOLLOWPUSH(FOLLOW_section_property_in_def_system1728);
+ section_property(ctx, sys);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_systemEx;
+ }
+ if (HASFAILED())
+ {
+ return sys;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop31; /* break out of the loop */
+ break;
+ }
+ }
+ loop31: ; /* Jump out to here if this rule does not match */
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:967:4: ( section_composite_structure[ sys ] )*
+
+ for (;;)
+ {
+ int alt32=2;
+ switch ( LA(1) )
+ {
+ case 174:
+ case 183:
+ case 197:
+ case 200:
+ case 201:
+ case 203:
+ case 212:
+ case 215:
+ case 222:
+ {
+ alt32=1;
+ }
+ break;
+
+ }
+
+ switch (alt32)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:967:6: section_composite_structure[ sys ]
+ {
+ FOLLOWPUSH(FOLLOW_section_composite_structure_in_def_system1740);
+ section_composite_structure(ctx, sys);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_systemEx;
+ }
+ if (HASFAILED())
+ {
+ return sys;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop32; /* break out of the loop */
+ break;
+ }
+ }
+ loop32: ; /* Jump out to here if this rule does not match */
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:969:4: ( section_behavior[ sys ] | section_statemachine[ sys ] )?
+ {
+ int alt33=3;
+ switch ( LA(1) )
+ {
+ case 171:
+ {
+ alt33=1;
+ }
+ break;
+ case 227:
+ {
+ alt33=2;
+ }
+ break;
+ }
+
+ switch (alt33)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:969:6: section_behavior[ sys ]
+ {
+ FOLLOWPUSH(FOLLOW_section_behavior_in_def_system1752);
+ section_behavior(ctx, sys);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_systemEx;
+ }
+ if (HASFAILED())
+ {
+ return sys;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:970:6: section_statemachine[ sys ]
+ {
+ FOLLOWPUSH(FOLLOW_section_statemachine_in_def_system1760);
+ section_statemachine(ctx, sys);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_systemEx;
+ }
+ if (HASFAILED())
+ {
+ return sys;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+ sep::TemplateFactory::genBehavior(sys);
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:976:4: ( section_model_of_computation[ sys ] | section_model_of_interaction[ sys ] | section_model_of_execution[ sys ] )*
+
+ for (;;)
+ {
+ int alt34=4;
+ switch ( LA(1) )
+ {
+ case 202:
+ {
+ alt34=1;
+ }
+ break;
+ case 172:
+ case 198:
+ {
+ alt34=2;
+ }
+ break;
+ case 204:
+ {
+ alt34=3;
+ }
+ break;
+
+ }
+
+ switch (alt34)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:976:6: section_model_of_computation[ sys ]
+ {
+ FOLLOWPUSH(FOLLOW_section_model_of_computation_in_def_system1788);
+ section_model_of_computation(ctx, sys);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_systemEx;
+ }
+ if (HASFAILED())
+ {
+ return sys;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:977:6: section_model_of_interaction[ sys ]
+ {
+ FOLLOWPUSH(FOLLOW_section_model_of_interaction_in_def_system1796);
+ section_model_of_interaction(ctx, sys);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_systemEx;
+ }
+ if (HASFAILED())
+ {
+ return sys;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:978:6: section_model_of_execution[ sys ]
+ {
+ FOLLOWPUSH(FOLLOW_section_model_of_execution_in_def_system1804);
+ section_model_of_execution(ctx, sys);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_systemEx;
+ }
+ if (HASFAILED())
+ {
+ return sys;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop34; /* break out of the loop */
+ break;
+ }
+ }
+ loop34: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_def_system1816);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_systemEx;
+ }
+ if (HASFAILED())
+ {
+ return sys;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_systemEx; /* Prevent compiler warnings */
+ ruledef_systemEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ POP_CTX;
+
+ sep::ParserUtil::declareDefaultEndingStateIfNeed(needDefaultStateFinal,
+ needDefaultStateTerminal, needDefaultStateReturn);
+
+ SET_RULE_LOCATION(sys);
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(16, def_system_StartIndex); }
+
+ return sys;
+}
+/* $ANTLR end def_system */
+
+/**
+ * $ANTLR start qualifiedNameID
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:988:1: qualifiedNameID returns [ std::string s , sep::avm_size_t nb = 1 ] : id= ID ( ( DOT | COLONx2 ) id= ID )* ;
+ */
+static fmlParser_qualifiedNameID_return
+qualifiedNameID(pfmlParser ctx)
+{
+ fmlParser_qualifiedNameID_return retval;
+
+ ANTLR3_UINT32 qualifiedNameID_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+
+ /* Initialize rule variables
+ */
+ retval.nb = 1;
+
+ qualifiedNameID_StartIndex = INDEX();
+
+
+
+ cpLOCATOR.clear();
+ cpQNID.clear();
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(17)) )
+ {
+ retval.start = 0;
+
+ {
+ }
+
+
+
+ return retval;
+ }
+
+ id = NULL;
+ retval.start = LT(1); retval.stop = retval.start;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:994:2: (id= ID ( ( DOT | COLONx2 ) id= ID )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:994:4: id= ID ( ( DOT | COLONx2 ) id= ID )*
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_qualifiedNameID1842);
+ if (HASEXCEPTION())
+ {
+ goto rulequalifiedNameIDEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.s= STR((id->getText(id))->chars);
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:995:4: ( ( DOT | COLONx2 ) id= ID )*
+
+ for (;;)
+ {
+ int alt36=2;
+ switch ( LA(1) )
+ {
+ case COLONx2:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA36_1 = LA(2);
+ if ( (synpred95_fml(ctx)))
+ {
+ alt36=1;
+ }
+
+ }
+ }
+ break;
+ case DOT:
+ {
+ alt36=1;
+ }
+ break;
+
+ }
+
+ switch (alt36)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:995:6: ( DOT | COLONx2 ) id= ID
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:995:6: ( DOT | COLONx2 )
+ {
+ int alt35=2;
+ switch ( LA(1) )
+ {
+ case DOT:
+ {
+ alt35=1;
+ }
+ break;
+ case COLONx2:
+ {
+ alt35=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return retval;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 35;
+ EXCEPTION->state = 0;
+
+
+ goto rulequalifiedNameIDEx;
+
+ }
+
+ switch (alt35)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:995:8: DOT
+ {
+ MATCHT(DOT, &FOLLOW_DOT_in_qualifiedNameID1859);
+ if (HASEXCEPTION())
+ {
+ goto rulequalifiedNameIDEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ cpQNID.push_back(retval.s
+ ); retval.s=
+ retval.s
+ + "." ;
+ ++retval.nb
+ ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:997:8: COLONx2
+ {
+ MATCHT(COLONx2, &FOLLOW_COLONx2_in_qualifiedNameID1875);
+ if (HASEXCEPTION())
+ {
+ goto rulequalifiedNameIDEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ cpLOCATOR = retval.s
+ ; cpQNID.clear(); retval.s=
+ retval.s
+ + "::";
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_qualifiedNameID1893);
+ if (HASEXCEPTION())
+ {
+ goto rulequalifiedNameIDEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ cpQNID.push_back(STR_ID(id));
+ retval.s=
+ retval.s
+ + STR_ID(id);
+
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop36; /* break out of the loop */
+ break;
+ }
+ }
+ loop36: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulequalifiedNameIDEx; /* Prevent compiler warnings */
+ rulequalifiedNameIDEx: ;
+ retval.stop = LT(-1);
+
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(17, qualifiedNameID_StartIndex); }
+
+ return retval;
+}
+/* $ANTLR end qualifiedNameID */
+
+/**
+ * $ANTLR start integer_constant
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1004:1: integer_constant returns [ sep::avm_size_t val ] : (n= IntegerLiteral |cid= qualifiedNameID );
+ */
+static sep::avm_size_t
+integer_constant(pfmlParser ctx)
+{
+ sep::avm_size_t val;
+
+ ANTLR3_UINT32 integer_constant_StartIndex;
+
+ pANTLR3_COMMON_TOKEN n;
+ fmlParser_qualifiedNameID_return cid;
+ #undef RETURN_TYPE_cid
+ #define RETURN_TYPE_cid fmlParser_qualifiedNameID_return
+
+ /* Initialize rule variables
+ */
+ integer_constant_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(18)) )
+ {
+ {
+ }
+
+
+
+ return val;
+ }
+
+ n = NULL;
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1006:2: (n= IntegerLiteral |cid= qualifiedNameID )
+
+ ANTLR3_UINT32 alt37;
+
+ alt37=2;
+
+ switch ( LA(1) )
+ {
+ case IntegerLiteral:
+ {
+ alt37=1;
+ }
+ break;
+ case ID:
+ {
+ alt37=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return val;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 37;
+ EXCEPTION->state = 0;
+
+
+ goto ruleinteger_constantEx;
+
+ }
+
+ switch (alt37)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1006:4: n= IntegerLiteral
+ {
+ n = (pANTLR3_COMMON_TOKEN) MATCHT(IntegerLiteral, &FOLLOW_IntegerLiteral_in_integer_constant1923);
+ if (HASEXCEPTION())
+ {
+ goto ruleinteger_constantEx;
+ }
+ if (HASFAILED())
+ {
+ return val;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ val= NUM_INT((n->getText(n))->chars);
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1009:4: cid= qualifiedNameID
+ {
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_integer_constant1934);
+ cid=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleinteger_constantEx;
+ }
+ if (HASFAILED())
+ {
+ return val;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ val= sep::ParserUtil::getIntegerConstant(
+ cid.s
+ , cid.nb
+ );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleinteger_constantEx; /* Prevent compiler warnings */
+ ruleinteger_constantEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(18, integer_constant_StartIndex); }
+
+ return val;
+}
+/* $ANTLR end integer_constant */
+
+/**
+ * $ANTLR start float_constant
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1014:1: float_constant returns [ sep::avm_float_t val ] : (f= FloatLiteral |cid= qualifiedNameID );
+ */
+static sep::avm_float_t
+float_constant(pfmlParser ctx)
+{
+ sep::avm_float_t val;
+
+ ANTLR3_UINT32 float_constant_StartIndex;
+
+ pANTLR3_COMMON_TOKEN f;
+ fmlParser_qualifiedNameID_return cid;
+ #undef RETURN_TYPE_cid
+ #define RETURN_TYPE_cid fmlParser_qualifiedNameID_return
+
+ /* Initialize rule variables
+ */
+ float_constant_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(19)) )
+ {
+ {
+ }
+
+
+
+ return val;
+ }
+
+ f = NULL;
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1016:2: (f= FloatLiteral |cid= qualifiedNameID )
+
+ ANTLR3_UINT32 alt38;
+
+ alt38=2;
+
+ switch ( LA(1) )
+ {
+ case FloatLiteral:
+ {
+ alt38=1;
+ }
+ break;
+ case ID:
+ {
+ alt38=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return val;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 38;
+ EXCEPTION->state = 0;
+
+
+ goto rulefloat_constantEx;
+
+ }
+
+ switch (alt38)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1016:4: f= FloatLiteral
+ {
+ f = (pANTLR3_COMMON_TOKEN) MATCHT(FloatLiteral, &FOLLOW_FloatLiteral_in_float_constant1955);
+ if (HASEXCEPTION())
+ {
+ goto rulefloat_constantEx;
+ }
+ if (HASFAILED())
+ {
+ return val;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ val= NUM_FLOAT((f->getText(f))->chars);
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1019:4: cid= qualifiedNameID
+ {
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_float_constant1966);
+ cid=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulefloat_constantEx;
+ }
+ if (HASFAILED())
+ {
+ return val;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ val= sep::ParserUtil::getFloatConstant(
+ cid.s
+ , cid.nb
+ );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulefloat_constantEx; /* Prevent compiler warnings */
+ rulefloat_constantEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(19, float_constant_StartIndex); }
+
+ return val;
+}
+/* $ANTLR end float_constant */
+
+/**
+ * $ANTLR start section_header
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1028:1: section_header[ sep::Machine * container ] : '@header:' ;
+ */
+static void
+section_header(pfmlParser ctx, sep::Machine * container)
+{
+ ANTLR3_UINT32 section_header_StartIndex;
+
+ /* Initialize rule variables
+ */
+ section_header_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(20)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1029:2: ( '@header:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1029:4: '@header:'
+ {
+ MATCHT(188, &FOLLOW_188_in_section_header1987);
+ if (HASEXCEPTION())
+ {
+ goto rulesection_headerEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulesection_headerEx; /* Prevent compiler warnings */
+ rulesection_headerEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(20, section_header_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end section_header */
+
+/**
+ * $ANTLR start section_import
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1037:1: section_import[ sep::Machine * container ] : '@import:' ( include_package )+ ;
+ */
+static void
+section_import(pfmlParser ctx, sep::Machine * container)
+{
+ ANTLR3_UINT32 section_import_StartIndex;
+
+ /* Initialize rule variables
+ */
+ section_import_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(21)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1038:2: ( '@import:' ( include_package )+ )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1038:4: '@import:' ( include_package )+
+ {
+ MATCHT(192, &FOLLOW_192_in_section_import2005);
+ if (HASEXCEPTION())
+ {
+ goto rulesection_importEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1038:15: ( include_package )+
+ {
+ int cnt39=0;
+
+ for (;;)
+ {
+ int alt39=2;
+ switch ( LA(1) )
+ {
+ case 193:
+ {
+ alt39=1;
+ }
+ break;
+
+ }
+
+ switch (alt39)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1038:17: include_package
+ {
+ FOLLOWPUSH(FOLLOW_include_package_in_section_import2009);
+ include_package(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_importEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt39 >= 1 )
+ {
+ goto loop39;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto rulesection_importEx;
+ }
+ cnt39++;
+ }
+ loop39: ; /* Jump to here if this rule does not match */
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulesection_importEx; /* Prevent compiler warnings */
+ rulesection_importEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(21, section_import_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end section_import */
+
+/**
+ * $ANTLR start include_package
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1041:1: include_package : '@include' ( StringLiteral SEMI | LCURLY ( StringLiteral )+ RCURLY ) ;
+ */
+static void
+include_package(pfmlParser ctx)
+{
+ ANTLR3_UINT32 include_package_StartIndex;
+
+ /* Initialize rule variables
+ */
+ include_package_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(22)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1042:2: ( '@include' ( StringLiteral SEMI | LCURLY ( StringLiteral )+ RCURLY ) )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1042:4: '@include' ( StringLiteral SEMI | LCURLY ( StringLiteral )+ RCURLY )
+ {
+ MATCHT(193, &FOLLOW_193_in_include_package2023);
+ if (HASEXCEPTION())
+ {
+ goto ruleinclude_packageEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1043:4: ( StringLiteral SEMI | LCURLY ( StringLiteral )+ RCURLY )
+ {
+ int alt41=2;
+ switch ( LA(1) )
+ {
+ case StringLiteral:
+ {
+ alt41=1;
+ }
+ break;
+ case LCURLY:
+ {
+ alt41=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 41;
+ EXCEPTION->state = 0;
+
+
+ goto ruleinclude_packageEx;
+
+ }
+
+ switch (alt41)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1043:6: StringLiteral SEMI
+ {
+ MATCHT(StringLiteral, &FOLLOW_StringLiteral_in_include_package2030);
+ if (HASEXCEPTION())
+ {
+ goto ruleinclude_packageEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_include_package2033);
+ if (HASEXCEPTION())
+ {
+ goto ruleinclude_packageEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1044:6: LCURLY ( StringLiteral )+ RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_include_package2040);
+ if (HASEXCEPTION())
+ {
+ goto ruleinclude_packageEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1044:14: ( StringLiteral )+
+ {
+ int cnt40=0;
+
+ for (;;)
+ {
+ int alt40=2;
+ switch ( LA(1) )
+ {
+ case StringLiteral:
+ {
+ alt40=1;
+ }
+ break;
+
+ }
+
+ switch (alt40)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1044:16: StringLiteral
+ {
+ MATCHT(StringLiteral, &FOLLOW_StringLiteral_in_include_package2045);
+ if (HASEXCEPTION())
+ {
+ goto ruleinclude_packageEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt40 >= 1 )
+ {
+ goto loop40;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruleinclude_packageEx;
+ }
+ cnt40++;
+ }
+ loop40: ; /* Jump to here if this rule does not match */
+ }
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_include_package2051);
+ if (HASEXCEPTION())
+ {
+ goto ruleinclude_packageEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleinclude_packageEx; /* Prevent compiler warnings */
+ ruleinclude_packageEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(22, include_package_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end include_package */
+
+/**
+ * $ANTLR start section_procedure
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1117:1: section_procedure[ sep::Machine * container ] : '@procedure:' (p= def_procedure[ container ] )* ;
+ */
+static void
+section_procedure(pfmlParser ctx, sep::Machine * container)
+{
+ ANTLR3_UINT32 section_procedure_StartIndex;
+
+ sep::Machine * p;
+ #undef RETURN_TYPE_p
+ #define RETURN_TYPE_p sep::Machine *
+
+ /* Initialize rule variables
+ */
+ section_procedure_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(23)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1118:2: ( '@procedure:' (p= def_procedure[ container ] )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1118:4: '@procedure:' (p= def_procedure[ container ] )*
+ {
+ MATCHT(212, &FOLLOW_212_in_section_procedure2081);
+ if (HASEXCEPTION())
+ {
+ goto rulesection_procedureEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1119:4: (p= def_procedure[ container ] )*
+
+ for (;;)
+ {
+ int alt42=2;
+ switch ( LA(1) )
+ {
+ case 306:
+ case 351:
+ case 393:
+ case 406:
+ {
+ alt42=1;
+ }
+ break;
+
+ }
+
+ switch (alt42)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1119:6: p= def_procedure[ container ]
+ {
+ FOLLOWPUSH(FOLLOW_def_procedure_in_section_procedure2090);
+ p=def_procedure(ctx, container);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_procedureEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop42; /* break out of the loop */
+ break;
+ }
+ }
+ loop42: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulesection_procedureEx; /* Prevent compiler warnings */
+ rulesection_procedureEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(23, section_procedure_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end section_procedure */
+
+/**
+ * $ANTLR start def_procedure
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1123:1: def_procedure[ sep::Machine * container ] returns [ sep::Machine * procedure ] : (ms= procedure_modifier_specifier )? 'procedure' ( LT_ ( 'moc:' )? executable_specifier[ spcfr ] GT )? id= ID ( StringLiteral )? ( def_machine_parameters[ procedure ] )? ( def_machine_returns[ procedure ,\n\t \t\tsep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER ] )? def_body_procedure[ procedure ] ;
+ */
+static sep::Machine *
+def_procedure(pfmlParser ctx, sep::Machine * container)
+{
+ sep::Machine * procedure;
+
+ ANTLR3_UINT32 def_procedure_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ pANTLR3_COMMON_TOKEN StringLiteral3;
+ fmlParser_procedure_modifier_specifier_return ms;
+ #undef RETURN_TYPE_ms
+ #define RETURN_TYPE_ms fmlParser_procedure_modifier_specifier_return
+
+ /* Initialize rule variables
+ */
+ def_procedure_StartIndex = INDEX();
+
+
+
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr( sep::Specifier::EXECUTABLE_PROCEDURE_MODEL_SPECIFIER );
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(24)) )
+ {
+ {
+
+ POP_CTX;
+
+ sep::ParserUtil::checkProcedureCompositeMocKind(procedure);
+
+ SET_RULE_LOCATION(procedure);
+
+ }
+ {
+ }
+
+
+
+ return procedure;
+ }
+
+ id = NULL;
+ StringLiteral3 = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1139:2: ( (ms= procedure_modifier_specifier )? 'procedure' ( LT_ ( 'moc:' )? executable_specifier[ spcfr ] GT )? id= ID ( StringLiteral )? ( def_machine_parameters[ procedure ] )? ( def_machine_returns[ procedure ,\n\t \t\tsep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER ] )? def_body_procedure[ procedure ] )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1139:4: (ms= procedure_modifier_specifier )? 'procedure' ( LT_ ( 'moc:' )? executable_specifier[ spcfr ] GT )? id= ID ( StringLiteral )? ( def_machine_parameters[ procedure ] )? ( def_machine_returns[ procedure ,\n\t \t\tsep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER ] )? def_body_procedure[ procedure ]
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1139:4: (ms= procedure_modifier_specifier )?
+ {
+ int alt43=2;
+ switch ( LA(1) )
+ {
+ case 306:
+ case 393:
+ case 406:
+ {
+ alt43=1;
+ }
+ break;
+ }
+
+ switch (alt43)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1139:6: ms= procedure_modifier_specifier
+ {
+ FOLLOWPUSH(FOLLOW_procedure_modifier_specifier_in_def_procedure2124);
+ ms=procedure_modifier_specifier(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_procedureEx;
+ }
+ if (HASFAILED())
+ {
+ return procedure;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.override_ifdef( ms.mdfr
+ ); spcfr.override_ifdef( ms.spcfr
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(351, &FOLLOW_351_in_def_procedure2140);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_procedureEx;
+ }
+ if (HASFAILED())
+ {
+ return procedure;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1143:4: ( LT_ ( 'moc:' )? executable_specifier[ spcfr ] GT )?
+ {
+ int alt45=2;
+ switch ( LA(1) )
+ {
+ case LT_:
+ {
+ alt45=1;
+ }
+ break;
+ }
+
+ switch (alt45)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1143:6: LT_ ( 'moc:' )? executable_specifier[ spcfr ] GT
+ {
+ MATCHT(LT_, &FOLLOW_LT__in_def_procedure2147);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_procedureEx;
+ }
+ if (HASFAILED())
+ {
+ return procedure;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1143:10: ( 'moc:' )?
+ {
+ int alt44=2;
+ switch ( LA(1) )
+ {
+ case 321:
+ {
+ alt44=1;
+ }
+ break;
+ }
+
+ switch (alt44)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1143:12: 'moc:'
+ {
+ MATCHT(321, &FOLLOW_321_in_def_procedure2151);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_procedureEx;
+ }
+ if (HASFAILED())
+ {
+ return procedure;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_executable_specifier_in_def_procedure2157);
+ executable_specifier(ctx, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_procedureEx;
+ }
+ if (HASFAILED())
+ {
+ return procedure;
+ }
+
+
+ MATCHT(GT, &FOLLOW_GT_in_def_procedure2161);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_procedureEx;
+ }
+ if (HASFAILED())
+ {
+ return procedure;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_def_procedure2171);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_procedureEx;
+ }
+ if (HASFAILED())
+ {
+ return procedure;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ PUSH_CTX_CPM( procedure= sep::Machine::newProcedure(
+ container, STR((id->getText(id))->chars), spcfr) );
+
+
+ procedure
+ ->getwModifier().override_ifdef( mdfr );
+
+ container->saveOwnedElement( procedure
+ );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1154:4: ( StringLiteral )?
+ {
+ int alt46=2;
+ switch ( LA(1) )
+ {
+ case StringLiteral:
+ {
+ alt46=1;
+ }
+ break;
+ }
+
+ switch (alt46)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1154:6: StringLiteral
+ {
+ StringLiteral3 = (pANTLR3_COMMON_TOKEN) MATCHT(StringLiteral, &FOLLOW_StringLiteral_in_def_procedure2184);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_procedureEx;
+ }
+ if (HASFAILED())
+ {
+ return procedure;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ procedure
+ ->setUnrestrictedName(STR((StringLiteral3->getText(StringLiteral3))->chars));
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1158:4: ( def_machine_parameters[ procedure ] )?
+ {
+ int alt47=2;
+ switch ( LA(1) )
+ {
+ case LBRACKET:
+ case LPAREN:
+ {
+ alt47=1;
+ }
+ break;
+ }
+
+ switch (alt47)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1158:4: def_machine_parameters[ procedure ]
+ {
+ FOLLOWPUSH(FOLLOW_def_machine_parameters_in_def_procedure2201);
+ def_machine_parameters(ctx, procedure);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_procedureEx;
+ }
+ if (HASFAILED())
+ {
+ return procedure;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1160:4: ( def_machine_returns[ procedure ,\n\t \t\tsep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER ] )?
+ {
+ int alt48=2;
+ switch ( LA(1) )
+ {
+ case 163:
+ case 365:
+ {
+ alt48=1;
+ }
+ break;
+ }
+
+ switch (alt48)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1160:4: def_machine_returns[ procedure ,\n\t \t\tsep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER ]
+ {
+ FOLLOWPUSH(FOLLOW_def_machine_returns_in_def_procedure2210);
+ def_machine_returns(ctx, procedure, sep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_procedureEx;
+ }
+ if (HASFAILED())
+ {
+ return procedure;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_def_body_procedure_in_def_procedure2219);
+ def_body_procedure(ctx, procedure);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_procedureEx;
+ }
+ if (HASFAILED())
+ {
+ return procedure;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_procedureEx; /* Prevent compiler warnings */
+ ruledef_procedureEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ POP_CTX;
+
+ sep::ParserUtil::checkProcedureCompositeMocKind(procedure);
+
+ SET_RULE_LOCATION(procedure);
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(24, def_procedure_StartIndex); }
+
+ return procedure;
+}
+/* $ANTLR end def_procedure */
+
+/**
+ * $ANTLR start def_machine_parameters
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1167:1: def_machine_parameters[ sep::Machine * machine ] : ( LBRACKET def_machine_variable_parameter_atom[ declProperty , mdfr , offset ] ( COMMA def_machine_variable_parameter_atom[ declProperty , mdfr , ++offset ] )* RBRACKET | LPAREN def_machine_variable_parameter_atom[ declProperty , mdfr , offset ] ( COMMA def_machine_variable_parameter_atom[ declProperty , mdfr , ++offset ] )* RPAREN );
+ */
+static void
+def_machine_parameters(pfmlParser ctx, sep::Machine * machine)
+{
+ ANTLR3_UINT32 def_machine_parameters_StartIndex;
+
+ /* Initialize rule variables
+ */
+ def_machine_parameters_StartIndex = INDEX();
+
+
+
+ sep::avm_offset_t offset = 0;
+ sep::Modifier mdfr = sep::Modifier::PROPERTY_PARAMETER_MODIFIER;
+
+ sep::PropertyPart & declProperty = machine->getPropertyPart();
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(25)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1174:2: ( LBRACKET def_machine_variable_parameter_atom[ declProperty , mdfr , offset ] ( COMMA def_machine_variable_parameter_atom[ declProperty , mdfr , ++offset ] )* RBRACKET | LPAREN def_machine_variable_parameter_atom[ declProperty , mdfr , offset ] ( COMMA def_machine_variable_parameter_atom[ declProperty , mdfr , ++offset ] )* RPAREN )
+
+ ANTLR3_UINT32 alt51;
+
+ alt51=2;
+
+ switch ( LA(1) )
+ {
+ case LBRACKET:
+ {
+ alt51=1;
+ }
+ break;
+ case LPAREN:
+ {
+ alt51=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 51;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_machine_parametersEx;
+
+ }
+
+ switch (alt51)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1174:4: LBRACKET def_machine_variable_parameter_atom[ declProperty , mdfr , offset ] ( COMMA def_machine_variable_parameter_atom[ declProperty , mdfr , ++offset ] )* RBRACKET
+ {
+ MATCHT(LBRACKET, &FOLLOW_LBRACKET_in_def_machine_parameters2238);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_parametersEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_machine_variable_parameter_atom_in_def_machine_parameters2241);
+ def_machine_variable_parameter_atom(ctx, declProperty, mdfr, offset);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_parametersEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1175:4: ( COMMA def_machine_variable_parameter_atom[ declProperty , mdfr , ++offset ] )*
+
+ for (;;)
+ {
+ int alt49=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt49=1;
+ }
+ break;
+
+ }
+
+ switch (alt49)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1175:6: COMMA def_machine_variable_parameter_atom[ declProperty , mdfr , ++offset ]
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_def_machine_parameters2249);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_parametersEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_machine_variable_parameter_atom_in_def_machine_parameters2253);
+ def_machine_variable_parameter_atom(ctx, declProperty, mdfr, ++offset);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_parametersEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop49; /* break out of the loop */
+ break;
+ }
+ }
+ loop49: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RBRACKET, &FOLLOW_RBRACKET_in_def_machine_parameters2262);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_parametersEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1178:4: LPAREN def_machine_variable_parameter_atom[ declProperty , mdfr , offset ] ( COMMA def_machine_variable_parameter_atom[ declProperty , mdfr , ++offset ] )* RPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_def_machine_parameters2268);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_parametersEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_machine_variable_parameter_atom_in_def_machine_parameters2272);
+ def_machine_variable_parameter_atom(ctx, declProperty, mdfr, offset);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_parametersEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1179:4: ( COMMA def_machine_variable_parameter_atom[ declProperty , mdfr , ++offset ] )*
+
+ for (;;)
+ {
+ int alt50=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt50=1;
+ }
+ break;
+
+ }
+
+ switch (alt50)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1179:6: COMMA def_machine_variable_parameter_atom[ declProperty , mdfr , ++offset ]
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_def_machine_parameters2280);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_parametersEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_machine_variable_parameter_atom_in_def_machine_parameters2283);
+ def_machine_variable_parameter_atom(ctx, declProperty, mdfr, ++offset);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_parametersEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop50; /* break out of the loop */
+ break;
+ }
+ }
+ loop50: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_def_machine_parameters2292);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_parametersEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_machine_parametersEx; /* Prevent compiler warnings */
+ ruledef_machine_parametersEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(25, def_machine_parameters_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_machine_parameters */
+
+/**
+ * $ANTLR start def_machine_variable_parameter_atom
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1184:1: def_machine_variable_parameter_atom[ sep::PropertyPart & paramDecl ,\n\t\tsep::Modifier mdfr , sep::avm_offset_t offset ] : ( (m= modifier_param )? tv= type_var (id= ID (iv= initial_value )? )? | 'bind:' ( ( type_var COLON )=>tv= type_var COLON e= expression |vid= qualifiedNameID ) );
+ */
+static void
+def_machine_variable_parameter_atom(pfmlParser ctx, sep::PropertyPart & paramDecl, sep::Modifier mdfr, sep::avm_offset_t offset)
+{
+ ANTLR3_UINT32 def_machine_variable_parameter_atom_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ sep::Modifier m;
+ #undef RETURN_TYPE_m
+ #define RETURN_TYPE_m sep::Modifier
+
+ sep::BF tv;
+ #undef RETURN_TYPE_tv
+ #define RETURN_TYPE_tv sep::BF
+
+ sep::BF iv;
+ #undef RETURN_TYPE_iv
+ #define RETURN_TYPE_iv sep::BF
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ fmlParser_qualifiedNameID_return vid;
+ #undef RETURN_TYPE_vid
+ #define RETURN_TYPE_vid fmlParser_qualifiedNameID_return
+
+ /* Initialize rule variables
+ */
+ def_machine_variable_parameter_atom_StartIndex = INDEX();
+
+
+
+ sep::Variable * variable;
+ sep::Machine * machine = paramDecl.getContainer()->as< sep::Machine >();
+ sep::BF paramT = sep::TypeManager::UNIVERSAL;
+ std::string paramID;
+ sep::BF value;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(26)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ id = NULL;
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1194:2: ( (m= modifier_param )? tv= type_var (id= ID (iv= initial_value )? )? | 'bind:' ( ( type_var COLON )=>tv= type_var COLON e= expression |vid= qualifiedNameID ) )
+
+ ANTLR3_UINT32 alt56;
+
+ alt56=2;
+
+ switch ( LA(1) )
+ {
+ case ASSIGN_REF:
+ case BAND:
+ case ID:
+ case LTE:
+ case 164:
+ case 166:
+ case 241:
+ case 242:
+ case 243:
+ case 245:
+ case 246:
+ case 249:
+ case 254:
+ case 255:
+ case 259:
+ case 261:
+ case 262:
+ case 264:
+ case 270:
+ case 271:
+ case 281:
+ case 282:
+ case 283:
+ case 295:
+ case 298:
+ case 305:
+ case 309:
+ case 310:
+ case 311:
+ case 315:
+ case 316:
+ case 317:
+ case 318:
+ case 320:
+ case 325:
+ case 326:
+ case 329:
+ case 333:
+ case 335:
+ case 341:
+ case 344:
+ case 345:
+ case 346:
+ case 357:
+ case 358:
+ case 360:
+ case 361:
+ case 364:
+ case 370:
+ case 373:
+ case 374:
+ case 387:
+ case 392:
+ case 399:
+ case 400:
+ case 401:
+ case 402:
+ case 405:
+ case 407:
+ case 408:
+ case 409:
+ case 412:
+ {
+ alt56=1;
+ }
+ break;
+ case 244:
+ {
+ alt56=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 56;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_machine_variable_parameter_atomEx;
+
+ }
+
+ switch (alt56)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1194:4: (m= modifier_param )? tv= type_var (id= ID (iv= initial_value )? )?
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1194:4: (m= modifier_param )?
+ {
+ int alt52=2;
+ switch ( LA(1) )
+ {
+ case ASSIGN_REF:
+ case BAND:
+ case LTE:
+ case 164:
+ case 166:
+ case 243:
+ case 262:
+ case 282:
+ case 295:
+ case 298:
+ case 305:
+ case 318:
+ case 335:
+ case 341:
+ case 361:
+ case 364:
+ {
+ alt52=1;
+ }
+ break;
+ }
+
+ switch (alt52)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1194:6: m= modifier_param
+ {
+ FOLLOWPUSH(FOLLOW_modifier_param_in_def_machine_variable_parameter_atom2315);
+ m=modifier_param(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_variable_parameter_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.override_ifdef( m
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_type_var_in_def_machine_variable_parameter_atom2327);
+ tv=type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_variable_parameter_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ paramT = tv
+ ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1196:4: (id= ID (iv= initial_value )? )?
+ {
+ int alt54=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt54=1;
+ }
+ break;
+ }
+
+ switch (alt54)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1196:6: id= ID (iv= initial_value )?
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_def_machine_variable_parameter_atom2338);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_variable_parameter_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ paramID = STR((id->getText(id))->chars);
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1197:6: (iv= initial_value )?
+ {
+ int alt53=2;
+ switch ( LA(1) )
+ {
+ case ASSIGN:
+ case LPAREN:
+ {
+ alt53=1;
+ }
+ break;
+ }
+
+ switch (alt53)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1197:8: iv= initial_value
+ {
+ FOLLOWPUSH(FOLLOW_initial_value_in_def_machine_variable_parameter_atom2355);
+ iv=initial_value(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_variable_parameter_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ value = iv
+ ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+
+ paramDecl.saveOwnedVariable( variable = new sep::Variable(
+ machine, mdfr, paramT, paramID, value ) );
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1204:4: 'bind:' ( ( type_var COLON )=>tv= type_var COLON e= expression |vid= qualifiedNameID )
+ {
+ MATCHT(244, &FOLLOW_244_in_def_machine_variable_parameter_atom2378);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_variable_parameter_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1205:4: ( ( type_var COLON )=>tv= type_var COLON e= expression |vid= qualifiedNameID )
+ {
+ int alt55=2;
+ {
+ int LA55_0 = LA(1);
+ if ( (synpred115_fml(ctx)) && (((LA55_0 >= 245) && (LA55_0 <= 246))))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (((LA55_0 >= 309) && (LA55_0 <= 310))))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (((LA55_0 >= 401) && (LA55_0 <= 402))))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (((LA55_0 >= 345) && (LA55_0 <= 346))))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (((LA55_0 >= 357) && (LA55_0 <= 358))))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (((LA55_0 >= 407) && (LA55_0 <= 408))))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 283))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 400))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 270))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 399))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 360))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 409))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 259))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 392))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 264))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 271))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 254))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 255))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 387))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 333))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 242))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 344))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 249))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 320))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 374))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 261))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 317))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 405))
+ {
+ alt55=1;
+ }
+ else if ( (LA55_0 == ID))
+ {
+ {
+ int LA55_29 = LA(2);
+ if ( (synpred115_fml(ctx)))
+ {
+ alt55=1;
+ }
+ else if ( (ANTLR3_TRUE))
+ {
+ alt55=2;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 55;
+ EXCEPTION->state = 29;
+
+
+ goto ruledef_machine_variable_parameter_atomEx;
+
+ }
+ }
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 241))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 412))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 370))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 316))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 281))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 315))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 325))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 326))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 373))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 329))
+ {
+ alt55=1;
+ }
+ else if ( (synpred115_fml(ctx)) && (LA55_0 == 311))
+ {
+ alt55=1;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 55;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_machine_variable_parameter_atomEx;
+
+ }
+ }
+ switch (alt55)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1205:6: ( type_var COLON )=>tv= type_var COLON e= expression
+ {
+ FOLLOWPUSH(FOLLOW_type_var_in_def_machine_variable_parameter_atom2399);
+ tv=type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_variable_parameter_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(COLON, &FOLLOW_COLON_in_def_machine_variable_parameter_atom2401);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_variable_parameter_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ paramT = tv
+ ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_def_machine_variable_parameter_atom2412);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_variable_parameter_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ value = e
+ ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1207:6: vid= qualifiedNameID
+ {
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_def_machine_variable_parameter_atom2423);
+ vid=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_variable_parameter_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ value = sep::ParserUtil::getVariable(vid.s
+ , vid.nb
+ );
+ if( value.valid() ) { paramT = value.to_ptr< sep::Variable >()->getType(); }
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+
+ paramID = sep::OSS() << '#' << offset;
+ paramDecl.saveOwnedVariable( variable = new sep::Variable(machine,
+ mdfr.addNatureKind( sep::Modifier::NATURE_BIND_KIND ),
+ paramT, paramID, value ) );
+
+ variable->setOffset( offset );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_machine_variable_parameter_atomEx; /* Prevent compiler warnings */
+ ruledef_machine_variable_parameter_atomEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(26, def_machine_variable_parameter_atom_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_machine_variable_parameter_atom */
+
+/**
+ * $ANTLR start def_machine_returns
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1224:1: def_machine_returns[ sep::Machine * machine , sep::Modifier mdfr ] : ( '-->' | 'returns:' ) ( ( LBRACKET def_machine_variable_return_atom[ declProperty , mdfr , offset] ( COMMA def_machine_variable_return_atom[ declProperty , mdfr , ++offset ] )* RBRACKET ) | ( LPAREN def_machine_variable_return_atom[ declProperty , mdfr , offset] ( COMMA def_machine_variable_return_atom[ declProperty , mdfr , ++offset ] )* RPAREN ) |tv= type_var (iv= initial_value )? ) ;
+ */
+static void
+def_machine_returns(pfmlParser ctx, sep::Machine * machine, sep::Modifier mdfr)
+{
+ ANTLR3_UINT32 def_machine_returns_StartIndex;
+
+ sep::BF tv;
+ #undef RETURN_TYPE_tv
+ #define RETURN_TYPE_tv sep::BF
+
+ sep::BF iv;
+ #undef RETURN_TYPE_iv
+ #define RETURN_TYPE_iv sep::BF
+
+ /* Initialize rule variables
+ */
+ def_machine_returns_StartIndex = INDEX();
+
+
+
+ sep::avm_offset_t offset = 0;
+ mdfr.setDirectionKind( sep::Modifier::DIRECTION_RETURN_KIND );
+ sep::BF value;
+
+ sep::PropertyPart & declProperty = machine->getPropertyPart();
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(27)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1233:2: ( ( '-->' | 'returns:' ) ( ( LBRACKET def_machine_variable_return_atom[ declProperty , mdfr , offset] ( COMMA def_machine_variable_return_atom[ declProperty , mdfr , ++offset ] )* RBRACKET ) | ( LPAREN def_machine_variable_return_atom[ declProperty , mdfr , offset] ( COMMA def_machine_variable_return_atom[ declProperty , mdfr , ++offset ] )* RPAREN ) |tv= type_var (iv= initial_value )? ) )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1233:4: ( '-->' | 'returns:' ) ( ( LBRACKET def_machine_variable_return_atom[ declProperty , mdfr , offset] ( COMMA def_machine_variable_return_atom[ declProperty , mdfr , ++offset ] )* RBRACKET ) | ( LPAREN def_machine_variable_return_atom[ declProperty , mdfr , offset] ( COMMA def_machine_variable_return_atom[ declProperty , mdfr , ++offset ] )* RPAREN ) |tv= type_var (iv= initial_value )? )
+ {
+ if ( LA(1) == 163 || LA(1) == 365 )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruledef_machine_returnsEx;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1234:4: ( ( LBRACKET def_machine_variable_return_atom[ declProperty , mdfr , offset] ( COMMA def_machine_variable_return_atom[ declProperty , mdfr , ++offset ] )* RBRACKET ) | ( LPAREN def_machine_variable_return_atom[ declProperty , mdfr , offset] ( COMMA def_machine_variable_return_atom[ declProperty , mdfr , ++offset ] )* RPAREN ) |tv= type_var (iv= initial_value )? )
+ {
+ int alt60=3;
+ switch ( LA(1) )
+ {
+ case LBRACKET:
+ {
+ alt60=1;
+ }
+ break;
+ case LPAREN:
+ {
+ alt60=2;
+ }
+ break;
+ case ID:
+ case 241:
+ case 242:
+ case 245:
+ case 246:
+ case 249:
+ case 254:
+ case 255:
+ case 259:
+ case 261:
+ case 264:
+ case 270:
+ case 271:
+ case 281:
+ case 283:
+ case 309:
+ case 310:
+ case 311:
+ case 315:
+ case 316:
+ case 317:
+ case 320:
+ case 325:
+ case 326:
+ case 329:
+ case 333:
+ case 344:
+ case 345:
+ case 346:
+ case 357:
+ case 358:
+ case 360:
+ case 370:
+ case 373:
+ case 374:
+ case 387:
+ case 392:
+ case 399:
+ case 400:
+ case 401:
+ case 402:
+ case 405:
+ case 407:
+ case 408:
+ case 409:
+ case 412:
+ {
+ alt60=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 60;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_machine_returnsEx;
+
+ }
+
+ switch (alt60)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1234:6: ( LBRACKET def_machine_variable_return_atom[ declProperty , mdfr , offset] ( COMMA def_machine_variable_return_atom[ declProperty , mdfr , ++offset ] )* RBRACKET )
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1234:6: ( LBRACKET def_machine_variable_return_atom[ declProperty , mdfr , offset] ( COMMA def_machine_variable_return_atom[ declProperty , mdfr , ++offset ] )* RBRACKET )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1234:8: LBRACKET def_machine_variable_return_atom[ declProperty , mdfr , offset] ( COMMA def_machine_variable_return_atom[ declProperty , mdfr , ++offset ] )* RBRACKET
+ {
+ MATCHT(LBRACKET, &FOLLOW_LBRACKET_in_def_machine_returns2474);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_machine_variable_return_atom_in_def_machine_returns2477);
+ def_machine_variable_return_atom(ctx, declProperty, mdfr, offset);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1235:8: ( COMMA def_machine_variable_return_atom[ declProperty , mdfr , ++offset ] )*
+
+ for (;;)
+ {
+ int alt57=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt57=1;
+ }
+ break;
+
+ }
+
+ switch (alt57)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1235:10: COMMA def_machine_variable_return_atom[ declProperty , mdfr , ++offset ]
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_def_machine_returns2489);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_machine_variable_return_atom_in_def_machine_returns2493);
+ def_machine_variable_return_atom(ctx, declProperty, mdfr, ++offset);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop57; /* break out of the loop */
+ break;
+ }
+ }
+ loop57: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RBRACKET, &FOLLOW_RBRACKET_in_def_machine_returns2506);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1239:6: ( LPAREN def_machine_variable_return_atom[ declProperty , mdfr , offset] ( COMMA def_machine_variable_return_atom[ declProperty , mdfr , ++offset ] )* RPAREN )
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1239:6: ( LPAREN def_machine_variable_return_atom[ declProperty , mdfr , offset] ( COMMA def_machine_variable_return_atom[ declProperty , mdfr , ++offset ] )* RPAREN )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1239:8: LPAREN def_machine_variable_return_atom[ declProperty , mdfr , offset] ( COMMA def_machine_variable_return_atom[ declProperty , mdfr , ++offset ] )* RPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_def_machine_returns2523);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_machine_variable_return_atom_in_def_machine_returns2527);
+ def_machine_variable_return_atom(ctx, declProperty, mdfr, offset);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1240:8: ( COMMA def_machine_variable_return_atom[ declProperty , mdfr , ++offset ] )*
+
+ for (;;)
+ {
+ int alt58=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt58=1;
+ }
+ break;
+
+ }
+
+ switch (alt58)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1240:10: COMMA def_machine_variable_return_atom[ declProperty , mdfr , ++offset ]
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_def_machine_returns2539);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_machine_variable_return_atom_in_def_machine_returns2542);
+ def_machine_variable_return_atom(ctx, declProperty, mdfr, ++offset);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop58; /* break out of the loop */
+ break;
+ }
+ }
+ loop58: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_def_machine_returns2555);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1244:6: tv= type_var (iv= initial_value )?
+ {
+ FOLLOWPUSH(FOLLOW_type_var_in_def_machine_returns2572);
+ tv=type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1244:18: (iv= initial_value )?
+ {
+ int alt59=2;
+ switch ( LA(1) )
+ {
+ case ASSIGN:
+ case LPAREN:
+ {
+ alt59=1;
+ }
+ break;
+ }
+
+ switch (alt59)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1244:20: iv= initial_value
+ {
+ FOLLOWPUSH(FOLLOW_initial_value_in_def_machine_returns2578);
+ iv=initial_value(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ value = iv
+ ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+
+ sep::Variable * variable =
+ new sep::Variable(machine, mdfr, tv
+ , "#0", value);
+
+ declProperty.saveOwnedVariable( variable );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_machine_returnsEx; /* Prevent compiler warnings */
+ ruledef_machine_returnsEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(27, def_machine_returns_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_machine_returns */
+
+/**
+ * $ANTLR start def_machine_variable_return_atom
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1255:1: def_machine_variable_return_atom[ sep::PropertyPart & paramDecl ,\n\t\tsep::Modifier mdfr , sep::avm_offset_t offset ] : ( (m= modifier_param )? tv= type_var (id= ID (iv= initial_value )? )? | 'bind:' ( ( type_var COLON )=>tv= type_var COLON e= expression |vid= qualifiedNameID ) );
+ */
+static void
+def_machine_variable_return_atom(pfmlParser ctx, sep::PropertyPart & paramDecl, sep::Modifier mdfr, sep::avm_offset_t offset)
+{
+ ANTLR3_UINT32 def_machine_variable_return_atom_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ sep::Modifier m;
+ #undef RETURN_TYPE_m
+ #define RETURN_TYPE_m sep::Modifier
+
+ sep::BF tv;
+ #undef RETURN_TYPE_tv
+ #define RETURN_TYPE_tv sep::BF
+
+ sep::BF iv;
+ #undef RETURN_TYPE_iv
+ #define RETURN_TYPE_iv sep::BF
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ fmlParser_qualifiedNameID_return vid;
+ #undef RETURN_TYPE_vid
+ #define RETURN_TYPE_vid fmlParser_qualifiedNameID_return
+
+ /* Initialize rule variables
+ */
+ def_machine_variable_return_atom_StartIndex = INDEX();
+
+
+
+ sep::Variable * variable;
+ sep::Machine * machine = paramDecl.getContainer()->as< sep::Machine >();
+ sep::BF paramT = sep::TypeManager::UNIVERSAL;
+ std::string paramID;
+ sep::BF value;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(28)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ id = NULL;
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1265:2: ( (m= modifier_param )? tv= type_var (id= ID (iv= initial_value )? )? | 'bind:' ( ( type_var COLON )=>tv= type_var COLON e= expression |vid= qualifiedNameID ) )
+
+ ANTLR3_UINT32 alt65;
+
+ alt65=2;
+
+ switch ( LA(1) )
+ {
+ case ASSIGN_REF:
+ case BAND:
+ case ID:
+ case LTE:
+ case 164:
+ case 166:
+ case 241:
+ case 242:
+ case 243:
+ case 245:
+ case 246:
+ case 249:
+ case 254:
+ case 255:
+ case 259:
+ case 261:
+ case 262:
+ case 264:
+ case 270:
+ case 271:
+ case 281:
+ case 282:
+ case 283:
+ case 295:
+ case 298:
+ case 305:
+ case 309:
+ case 310:
+ case 311:
+ case 315:
+ case 316:
+ case 317:
+ case 318:
+ case 320:
+ case 325:
+ case 326:
+ case 329:
+ case 333:
+ case 335:
+ case 341:
+ case 344:
+ case 345:
+ case 346:
+ case 357:
+ case 358:
+ case 360:
+ case 361:
+ case 364:
+ case 370:
+ case 373:
+ case 374:
+ case 387:
+ case 392:
+ case 399:
+ case 400:
+ case 401:
+ case 402:
+ case 405:
+ case 407:
+ case 408:
+ case 409:
+ case 412:
+ {
+ alt65=1;
+ }
+ break;
+ case 244:
+ {
+ alt65=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 65;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_machine_variable_return_atomEx;
+
+ }
+
+ switch (alt65)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1265:4: (m= modifier_param )? tv= type_var (id= ID (iv= initial_value )? )?
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1265:4: (m= modifier_param )?
+ {
+ int alt61=2;
+ switch ( LA(1) )
+ {
+ case ASSIGN_REF:
+ case BAND:
+ case LTE:
+ case 164:
+ case 166:
+ case 243:
+ case 262:
+ case 282:
+ case 295:
+ case 298:
+ case 305:
+ case 318:
+ case 335:
+ case 341:
+ case 361:
+ case 364:
+ {
+ alt61=1;
+ }
+ break;
+ }
+
+ switch (alt61)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1265:6: m= modifier_param
+ {
+ FOLLOWPUSH(FOLLOW_modifier_param_in_def_machine_variable_return_atom2617);
+ m=modifier_param(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_variable_return_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.override_ifdef( m
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_type_var_in_def_machine_variable_return_atom2629);
+ tv=type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_variable_return_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ paramT = tv
+ ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1267:4: (id= ID (iv= initial_value )? )?
+ {
+ int alt63=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt63=1;
+ }
+ break;
+ }
+
+ switch (alt63)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1267:6: id= ID (iv= initial_value )?
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_def_machine_variable_return_atom2640);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_variable_return_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ paramID = STR((id->getText(id))->chars);
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1268:6: (iv= initial_value )?
+ {
+ int alt62=2;
+ switch ( LA(1) )
+ {
+ case ASSIGN:
+ case LPAREN:
+ {
+ alt62=1;
+ }
+ break;
+ }
+
+ switch (alt62)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1268:8: iv= initial_value
+ {
+ FOLLOWPUSH(FOLLOW_initial_value_in_def_machine_variable_return_atom2657);
+ iv=initial_value(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_variable_return_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ value = iv
+ ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+
+ paramDecl.saveOwnedVariable( variable =
+ new sep::Variable(machine, mdfr, paramT, paramID, value) );
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1275:4: 'bind:' ( ( type_var COLON )=>tv= type_var COLON e= expression |vid= qualifiedNameID )
+ {
+ MATCHT(244, &FOLLOW_244_in_def_machine_variable_return_atom2680);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_variable_return_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1276:4: ( ( type_var COLON )=>tv= type_var COLON e= expression |vid= qualifiedNameID )
+ {
+ int alt64=2;
+ {
+ int LA64_0 = LA(1);
+ if ( (synpred126_fml(ctx)) && (((LA64_0 >= 245) && (LA64_0 <= 246))))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (((LA64_0 >= 309) && (LA64_0 <= 310))))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (((LA64_0 >= 401) && (LA64_0 <= 402))))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (((LA64_0 >= 345) && (LA64_0 <= 346))))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (((LA64_0 >= 357) && (LA64_0 <= 358))))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (((LA64_0 >= 407) && (LA64_0 <= 408))))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 283))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 400))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 270))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 399))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 360))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 409))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 259))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 392))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 264))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 271))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 254))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 255))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 387))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 333))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 242))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 344))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 249))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 320))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 374))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 261))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 317))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 405))
+ {
+ alt64=1;
+ }
+ else if ( (LA64_0 == ID))
+ {
+ {
+ int LA64_29 = LA(2);
+ if ( (synpred126_fml(ctx)))
+ {
+ alt64=1;
+ }
+ else if ( (ANTLR3_TRUE))
+ {
+ alt64=2;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 64;
+ EXCEPTION->state = 29;
+
+
+ goto ruledef_machine_variable_return_atomEx;
+
+ }
+ }
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 241))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 412))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 370))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 316))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 281))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 315))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 325))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 326))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 373))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 329))
+ {
+ alt64=1;
+ }
+ else if ( (synpred126_fml(ctx)) && (LA64_0 == 311))
+ {
+ alt64=1;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 64;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_machine_variable_return_atomEx;
+
+ }
+ }
+ switch (alt64)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1276:6: ( type_var COLON )=>tv= type_var COLON e= expression
+ {
+ FOLLOWPUSH(FOLLOW_type_var_in_def_machine_variable_return_atom2701);
+ tv=type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_variable_return_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(COLON, &FOLLOW_COLON_in_def_machine_variable_return_atom2703);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_variable_return_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ paramT = tv
+ ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_def_machine_variable_return_atom2714);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_variable_return_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ value = e
+ ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1278:6: vid= qualifiedNameID
+ {
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_def_machine_variable_return_atom2725);
+ vid=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machine_variable_return_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ value = sep::ParserUtil::getVariable(vid.s
+ , vid.nb
+ );
+ if( value.valid() ) { paramT = value.to_ptr< sep::Variable >()->getType(); }
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+
+ paramID = sep::OSS() << '#' << offset;
+
+ variable = new sep::Variable(machine,
+ mdfr.addNatureKind( sep::Modifier::NATURE_BIND_KIND ),
+ paramT, paramID, value);
+
+ paramDecl.saveOwnedVariable( variable );
+
+ variable->setOffset( offset );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_machine_variable_return_atomEx; /* Prevent compiler warnings */
+ ruledef_machine_variable_return_atomEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(28, def_machine_variable_return_atom_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_machine_variable_return_atom */
+
+/**
+ * $ANTLR start def_body_procedure
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1299:1: def_body_procedure[ sep::Machine * procedure ] : LCURLY ( ( def_body_machine_using_section_predicat )=> def_body_procedure_section[ procedure ] | def_body_procedure_simplif[ procedure ] ) RCURLY ;
+ */
+static void
+def_body_procedure(pfmlParser ctx, sep::Machine * procedure)
+{
+ ANTLR3_UINT32 def_body_procedure_StartIndex;
+
+ /* Initialize rule variables
+ */
+ def_body_procedure_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(29)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1300:2: ( LCURLY ( ( def_body_machine_using_section_predicat )=> def_body_procedure_section[ procedure ] | def_body_procedure_simplif[ procedure ] ) RCURLY )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1300:4: LCURLY ( ( def_body_machine_using_section_predicat )=> def_body_procedure_section[ procedure ] | def_body_procedure_simplif[ procedure ] ) RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_def_body_procedure2755);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_procedureEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1301:4: ( ( def_body_machine_using_section_predicat )=> def_body_procedure_section[ procedure ] | def_body_procedure_simplif[ procedure ] )
+ {
+ int alt66=2;
+ {
+ int LA66_0 = LA(1);
+ if ( (synpred127_fml(ctx)) && (LA66_0 == 188))
+ {
+ alt66=1;
+ }
+ else if ( (synpred127_fml(ctx)) && (LA66_0 == 192))
+ {
+ alt66=1;
+ }
+ else if ( (synpred127_fml(ctx)) && (((LA66_0 >= 209) && (LA66_0 <= 210))))
+ {
+ alt66=1;
+ }
+ else if ( (synpred127_fml(ctx)) && (LA66_0 == 196))
+ {
+ alt66=1;
+ }
+ else if ( (synpred127_fml(ctx)) && (LA66_0 == 195))
+ {
+ alt66=1;
+ }
+ else if ( (synpred127_fml(ctx)) && (LA66_0 == 207))
+ {
+ alt66=1;
+ }
+ else if ( (synpred127_fml(ctx)) && (((LA66_0 >= 219) && (LA66_0 <= 220))))
+ {
+ alt66=1;
+ }
+ else if ( (synpred127_fml(ctx)) && (LA66_0 == 178 || LA66_0 == 213))
+ {
+ alt66=1;
+ }
+ else if ( (synpred127_fml(ctx)) && (LA66_0 == 216))
+ {
+ alt66=1;
+ }
+ else if ( (synpred127_fml(ctx)) && (LA66_0 == 214))
+ {
+ alt66=1;
+ }
+ else if ( (synpred127_fml(ctx)) && (LA66_0 == 211))
+ {
+ alt66=1;
+ }
+ else if ( (synpred127_fml(ctx)) && (LA66_0 == 222))
+ {
+ alt66=1;
+ }
+ else if ( (synpred127_fml(ctx)) && (LA66_0 == 201))
+ {
+ alt66=1;
+ }
+ else if ( (synpred127_fml(ctx)) && (LA66_0 == 212))
+ {
+ alt66=1;
+ }
+ else if ( (synpred127_fml(ctx)) && (LA66_0 == 174 || LA66_0 == 183 || LA66_0 == 200))
+ {
+ alt66=1;
+ }
+ else if ( (synpred127_fml(ctx)) && (LA66_0 == 203))
+ {
+ alt66=1;
+ }
+ else if ( (synpred127_fml(ctx)) && (LA66_0 == 215))
+ {
+ alt66=1;
+ }
+ else if ( (synpred127_fml(ctx)) && (LA66_0 == 197))
+ {
+ alt66=1;
+ }
+ else if ( (synpred127_fml(ctx)) && (LA66_0 == 171))
+ {
+ alt66=1;
+ }
+ else if ( (synpred127_fml(ctx)) && (LA66_0 == 227))
+ {
+ alt66=1;
+ }
+ else if ( (synpred127_fml(ctx)) && (LA66_0 == 202))
+ {
+ alt66=1;
+ }
+ else if ( (synpred127_fml(ctx)) && (LA66_0 == 204))
+ {
+ alt66=1;
+ }
+ else if ( (synpred127_fml(ctx)) && (LA66_0 == 172 || LA66_0 == 198))
+ {
+ alt66=1;
+ }
+ else if ( (synpred127_fml(ctx)) && (LA66_0 == RCURLY))
+ {
+ alt66=1;
+ }
+ else if ( (((LA66_0 >= 144) && (LA66_0 <= 145)) || ((LA66_0 >= 147) && (LA66_0 <= 150)) || LA66_0 == 153 || LA66_0 == 170 || LA66_0 == 177 || LA66_0 == 179 || LA66_0 == 182 || LA66_0 == 184 || ((LA66_0 >= 189) && (LA66_0 <= 191)) || LA66_0 == 194 || LA66_0 == 199 || ((LA66_0 >= 223) && (LA66_0 <= 224)) || LA66_0 == 243 || LA66_0 == 259 || LA66_0 == 262 || LA66_0 == 272 || LA66_0 == 282 || LA66_0 == 298 || ((LA66_0 >= 305) && (LA66_0 <= 306)) || LA66_0 == 314 || LA66_0 == 318 || LA66_0 == 322 || LA66_0 == 341 || LA66_0 == 349 || LA66_0 == 353 || LA66_0 == 355 || LA66_0 == 361 || LA66_0 == 364 || ((LA66_0 >= 378) && (LA66_0 <= 380)) || LA66_0 == 393 || LA66_0 == 395 || LA66_0 == 406 || ((LA66_0 >= 410) && (LA66_0 <= 411)) || LA66_0 == 414))
+ {
+ alt66=2;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 66;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_body_procedureEx;
+
+ }
+ }
+ switch (alt66)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1301:6: ( def_body_machine_using_section_predicat )=> def_body_procedure_section[ procedure ]
+ {
+ FOLLOWPUSH(FOLLOW_def_body_procedure_section_in_def_body_procedure2775);
+ def_body_procedure_section(ctx, procedure);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_procedureEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1304:6: def_body_procedure_simplif[ procedure ]
+ {
+ FOLLOWPUSH(FOLLOW_def_body_procedure_simplif_in_def_body_procedure2784);
+ def_body_procedure_simplif(ctx, procedure);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_procedureEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_def_body_procedure2795);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_procedureEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_body_procedureEx; /* Prevent compiler warnings */
+ ruledef_body_procedureEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(29, def_body_procedure_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_body_procedure */
+
+/**
+ * $ANTLR start def_body_procedure_section
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1309:1: def_body_procedure_section[ sep::Machine * procedure ] : ( section_header[ procedure ] )? ( section_import[ procedure ] )? ( section_parameter[ procedure ] )* ( section_property[ procedure ] )* ( section_composite_structure[ procedure ] )* ( section_behavior[ procedure ] | section_statemachine[ procedure ] )? ( section_model_of_computation[ procedure ] | section_model_of_execution[ procedure ] | section_model_of_interaction[ procedure ] )* ;
+ */
+static void
+def_body_procedure_section(pfmlParser ctx, sep::Machine * procedure)
+{
+ ANTLR3_UINT32 def_body_procedure_section_StartIndex;
+
+ /* Initialize rule variables
+ */
+ def_body_procedure_section_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(30)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1310:2: ( ( section_header[ procedure ] )? ( section_import[ procedure ] )? ( section_parameter[ procedure ] )* ( section_property[ procedure ] )* ( section_composite_structure[ procedure ] )* ( section_behavior[ procedure ] | section_statemachine[ procedure ] )? ( section_model_of_computation[ procedure ] | section_model_of_execution[ procedure ] | section_model_of_interaction[ procedure ] )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1310:4: ( section_header[ procedure ] )? ( section_import[ procedure ] )? ( section_parameter[ procedure ] )* ( section_property[ procedure ] )* ( section_composite_structure[ procedure ] )* ( section_behavior[ procedure ] | section_statemachine[ procedure ] )? ( section_model_of_computation[ procedure ] | section_model_of_execution[ procedure ] | section_model_of_interaction[ procedure ] )*
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1310:4: ( section_header[ procedure ] )?
+ {
+ int alt67=2;
+ switch ( LA(1) )
+ {
+ case 188:
+ {
+ alt67=1;
+ }
+ break;
+ }
+
+ switch (alt67)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1310:4: section_header[ procedure ]
+ {
+ FOLLOWPUSH(FOLLOW_section_header_in_def_body_procedure_section2808);
+ section_header(ctx, procedure);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_procedure_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1311:4: ( section_import[ procedure ] )?
+ {
+ int alt68=2;
+ switch ( LA(1) )
+ {
+ case 192:
+ {
+ alt68=1;
+ }
+ break;
+ }
+
+ switch (alt68)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1311:4: section_import[ procedure ]
+ {
+ FOLLOWPUSH(FOLLOW_section_import_in_def_body_procedure_section2816);
+ section_import(ctx, procedure);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_procedure_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1313:4: ( section_parameter[ procedure ] )*
+
+ for (;;)
+ {
+ int alt69=2;
+ switch ( LA(1) )
+ {
+ case 195:
+ case 196:
+ case 207:
+ case 209:
+ case 210:
+ case 219:
+ case 220:
+ {
+ alt69=1;
+ }
+ break;
+
+ }
+
+ switch (alt69)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1313:6: section_parameter[ procedure ]
+ {
+ FOLLOWPUSH(FOLLOW_section_parameter_in_def_body_procedure_section2827);
+ section_parameter(ctx, procedure);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_procedure_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop69; /* break out of the loop */
+ break;
+ }
+ }
+ loop69: ; /* Jump out to here if this rule does not match */
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1315:4: ( section_property[ procedure ] )*
+
+ for (;;)
+ {
+ int alt70=2;
+ switch ( LA(1) )
+ {
+ case 178:
+ case 211:
+ case 213:
+ case 214:
+ case 216:
+ {
+ alt70=1;
+ }
+ break;
+
+ }
+
+ switch (alt70)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1315:6: section_property[ procedure ]
+ {
+ FOLLOWPUSH(FOLLOW_section_property_in_def_body_procedure_section2839);
+ section_property(ctx, procedure);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_procedure_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop70; /* break out of the loop */
+ break;
+ }
+ }
+ loop70: ; /* Jump out to here if this rule does not match */
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1317:4: ( section_composite_structure[ procedure ] )*
+
+ for (;;)
+ {
+ int alt71=2;
+ switch ( LA(1) )
+ {
+ case 174:
+ case 183:
+ case 197:
+ case 200:
+ case 201:
+ case 203:
+ case 212:
+ case 215:
+ case 222:
+ {
+ alt71=1;
+ }
+ break;
+
+ }
+
+ switch (alt71)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1317:6: section_composite_structure[ procedure ]
+ {
+ FOLLOWPUSH(FOLLOW_section_composite_structure_in_def_body_procedure_section2852);
+ section_composite_structure(ctx, procedure);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_procedure_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop71; /* break out of the loop */
+ break;
+ }
+ }
+ loop71: ; /* Jump out to here if this rule does not match */
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1319:4: ( section_behavior[ procedure ] | section_statemachine[ procedure ] )?
+ {
+ int alt72=3;
+ switch ( LA(1) )
+ {
+ case 171:
+ {
+ alt72=1;
+ }
+ break;
+ case 227:
+ {
+ alt72=2;
+ }
+ break;
+ }
+
+ switch (alt72)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1319:6: section_behavior[ procedure ]
+ {
+ FOLLOWPUSH(FOLLOW_section_behavior_in_def_body_procedure_section2864);
+ section_behavior(ctx, procedure);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_procedure_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1320:6: section_statemachine[ procedure ]
+ {
+ FOLLOWPUSH(FOLLOW_section_statemachine_in_def_body_procedure_section2872);
+ section_statemachine(ctx, procedure);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_procedure_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1323:4: ( section_model_of_computation[ procedure ] | section_model_of_execution[ procedure ] | section_model_of_interaction[ procedure ] )*
+
+ for (;;)
+ {
+ int alt73=4;
+ switch ( LA(1) )
+ {
+ case 202:
+ {
+ alt73=1;
+ }
+ break;
+ case 204:
+ {
+ alt73=2;
+ }
+ break;
+ case 172:
+ case 198:
+ {
+ alt73=3;
+ }
+ break;
+
+ }
+
+ switch (alt73)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1323:6: section_model_of_computation[ procedure ]
+ {
+ FOLLOWPUSH(FOLLOW_section_model_of_computation_in_def_body_procedure_section2887);
+ section_model_of_computation(ctx, procedure);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_procedure_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1324:6: section_model_of_execution[ procedure ]
+ {
+ FOLLOWPUSH(FOLLOW_section_model_of_execution_in_def_body_procedure_section2895);
+ section_model_of_execution(ctx, procedure);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_procedure_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1325:6: section_model_of_interaction[ procedure ]
+ {
+ FOLLOWPUSH(FOLLOW_section_model_of_interaction_in_def_body_procedure_section2903);
+ section_model_of_interaction(ctx, procedure);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_procedure_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop73; /* break out of the loop */
+ break;
+ }
+ }
+ loop73: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_body_procedure_sectionEx; /* Prevent compiler warnings */
+ ruledef_body_procedure_sectionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(30, def_body_procedure_section_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_body_procedure_section */
+
+/**
+ * $ANTLR start def_body_procedure_simplif
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1330:1: def_body_procedure_simplif[ sep::Machine * procedure ] : ( (m= modifier_declaration )? ( decl_variable[ procedure->getPropertyPart() , mdfr ] |ads= any_def_statemachine[ procedure , mdfr , spcfr ] | def_state_activity[ procedure ] ) )+ ;
+ */
+static void
+def_body_procedure_simplif(pfmlParser ctx, sep::Machine * procedure)
+{
+ ANTLR3_UINT32 def_body_procedure_simplif_StartIndex;
+
+ sep::Modifier m;
+ #undef RETURN_TYPE_m
+ #define RETURN_TYPE_m sep::Modifier
+
+ sep::Machine * ads;
+ #undef RETURN_TYPE_ads
+ #define RETURN_TYPE_ads sep::Machine *
+
+ /* Initialize rule variables
+ */
+ def_body_procedure_simplif_StartIndex = INDEX();
+
+
+
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(31)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1336:2: ( ( (m= modifier_declaration )? ( decl_variable[ procedure->getPropertyPart() , mdfr ] |ads= any_def_statemachine[ procedure , mdfr , spcfr ] | def_state_activity[ procedure ] ) )+ )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1336:4: ( (m= modifier_declaration )? ( decl_variable[ procedure->getPropertyPart() , mdfr ] |ads= any_def_statemachine[ procedure , mdfr , spcfr ] | def_state_activity[ procedure ] ) )+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1336:4: ( (m= modifier_declaration )? ( decl_variable[ procedure->getPropertyPart() , mdfr ] |ads= any_def_statemachine[ procedure , mdfr , spcfr ] | def_state_activity[ procedure ] ) )+
+ {
+ int cnt76=0;
+
+ for (;;)
+ {
+ int alt76=2;
+ switch ( LA(1) )
+ {
+ case 144:
+ case 145:
+ case 147:
+ case 148:
+ case 149:
+ case 150:
+ case 153:
+ case 170:
+ case 177:
+ case 179:
+ case 182:
+ case 184:
+ case 189:
+ case 190:
+ case 191:
+ case 194:
+ case 199:
+ case 223:
+ case 224:
+ case 243:
+ case 259:
+ case 262:
+ case 272:
+ case 282:
+ case 298:
+ case 305:
+ case 306:
+ case 314:
+ case 318:
+ case 322:
+ case 341:
+ case 349:
+ case 353:
+ case 355:
+ case 361:
+ case 364:
+ case 378:
+ case 379:
+ case 380:
+ case 393:
+ case 395:
+ case 406:
+ case 410:
+ case 411:
+ case 414:
+ {
+ alt76=1;
+ }
+ break;
+
+ }
+
+ switch (alt76)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1336:6: (m= modifier_declaration )? ( decl_variable[ procedure->getPropertyPart() , mdfr ] |ads= any_def_statemachine[ procedure , mdfr , spcfr ] | def_state_activity[ procedure ] )
+ {
+ if ( BACKTRACKING==0 )
+ {
+ mdfr = sep::Modifier::PROPERTY_UNDEFINED_MODIFIER;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1338:3: (m= modifier_declaration )?
+ {
+ int alt74=2;
+ switch ( LA(1) )
+ {
+ case 406:
+ {
+ {
+ int LA74_1 = LA(2);
+ if ( (synpred138_fml(ctx)))
+ {
+ alt74=1;
+ }
+ }
+ }
+ break;
+ case 243:
+ case 282:
+ case 298:
+ case 305:
+ case 341:
+ case 349:
+ case 355:
+ case 361:
+ case 364:
+ case 380:
+ case 395:
+ case 414:
+ {
+ alt74=1;
+ }
+ break;
+ }
+
+ switch (alt74)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1338:5: m= modifier_declaration
+ {
+ FOLLOWPUSH(FOLLOW_modifier_declaration_in_def_body_procedure_simplif2939);
+ m=modifier_declaration(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_procedure_simplifEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr = m
+ ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1340:6: ( decl_variable[ procedure->getPropertyPart() , mdfr ] |ads= any_def_statemachine[ procedure , mdfr , spcfr ] | def_state_activity[ procedure ] )
+ {
+ int alt75=3;
+ switch ( LA(1) )
+ {
+ case 259:
+ case 262:
+ case 318:
+ case 410:
+ case 411:
+ {
+ alt75=1;
+ }
+ break;
+ case 144:
+ case 145:
+ case 147:
+ case 148:
+ case 149:
+ case 150:
+ case 153:
+ case 272:
+ case 306:
+ case 314:
+ case 322:
+ case 353:
+ case 378:
+ case 379:
+ case 393:
+ case 406:
+ {
+ alt75=2;
+ }
+ break;
+ case 170:
+ case 177:
+ case 179:
+ case 182:
+ case 184:
+ case 189:
+ case 190:
+ case 191:
+ case 194:
+ case 199:
+ case 223:
+ case 224:
+ {
+ alt75=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 75;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_body_procedure_simplifEx;
+
+ }
+
+ switch (alt75)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1340:8: decl_variable[ procedure->getPropertyPart() , mdfr ]
+ {
+ FOLLOWPUSH(FOLLOW_decl_variable_in_def_body_procedure_simplif2955);
+ decl_variable(ctx, procedure->getPropertyPart(), mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_procedure_simplifEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1342:8: ads= any_def_statemachine[ procedure , mdfr , spcfr ]
+ {
+ FOLLOWPUSH(FOLLOW_any_def_statemachine_in_def_body_procedure_simplif2968);
+ ads=any_def_statemachine(ctx, procedure, mdfr, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_procedure_simplifEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1344:8: def_state_activity[ procedure ]
+ {
+ FOLLOWPUSH(FOLLOW_def_state_activity_in_def_body_procedure_simplif2979);
+ def_state_activity(ctx, procedure);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_procedure_simplifEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+
+ default:
+
+ if ( cnt76 >= 1 )
+ {
+ goto loop76;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruledef_body_procedure_simplifEx;
+ }
+ cnt76++;
+ }
+ loop76: ; /* Jump to here if this rule does not match */
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_body_procedure_simplifEx; /* Prevent compiler warnings */
+ ruledef_body_procedure_simplifEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(31, def_body_procedure_simplif_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_body_procedure_simplif */
+
+/**
+ * $ANTLR start section_composite_structure
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1354:1: section_composite_structure[ sep::Machine * container ] : ( section_routine[ container ] | section_procedure[ container ] | section_composite_generic[ container ] | section_machine_model[ container ] | section_machine_prototype[ container ] | section_machine_instance[ container ] );
+ */
+static void
+section_composite_structure(pfmlParser ctx, sep::Machine * container)
+{
+ ANTLR3_UINT32 section_composite_structure_StartIndex;
+
+ /* Initialize rule variables
+ */
+ section_composite_structure_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(32)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1355:2: ( section_routine[ container ] | section_procedure[ container ] | section_composite_generic[ container ] | section_machine_model[ container ] | section_machine_prototype[ container ] | section_machine_instance[ container ] )
+
+ ANTLR3_UINT32 alt77;
+
+ alt77=6;
+
+ switch ( LA(1) )
+ {
+ case 201:
+ case 222:
+ {
+ alt77=1;
+ }
+ break;
+ case 212:
+ {
+ alt77=2;
+ }
+ break;
+ case 174:
+ case 183:
+ case 200:
+ {
+ alt77=3;
+ }
+ break;
+ case 203:
+ {
+ alt77=4;
+ }
+ break;
+ case 215:
+ {
+ alt77=5;
+ }
+ break;
+ case 197:
+ {
+ alt77=6;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 77;
+ EXCEPTION->state = 0;
+
+
+ goto rulesection_composite_structureEx;
+
+ }
+
+ switch (alt77)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1355:4: section_routine[ container ]
+ {
+ FOLLOWPUSH(FOLLOW_section_routine_in_section_composite_structure3011);
+ section_routine(ctx, container);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_composite_structureEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1356:4: section_procedure[ container ]
+ {
+ FOLLOWPUSH(FOLLOW_section_procedure_in_section_composite_structure3017);
+ section_procedure(ctx, container);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_composite_structureEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1358:4: section_composite_generic[ container ]
+ {
+ FOLLOWPUSH(FOLLOW_section_composite_generic_in_section_composite_structure3024);
+ section_composite_generic(ctx, container);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_composite_structureEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1359:4: section_machine_model[ container ]
+ {
+ FOLLOWPUSH(FOLLOW_section_machine_model_in_section_composite_structure3030);
+ section_machine_model(ctx, container);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_composite_structureEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1360:4: section_machine_prototype[ container ]
+ {
+ FOLLOWPUSH(FOLLOW_section_machine_prototype_in_section_composite_structure3036);
+ section_machine_prototype(ctx, container);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_composite_structureEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1361:4: section_machine_instance[ container ]
+ {
+ FOLLOWPUSH(FOLLOW_section_machine_instance_in_section_composite_structure3042);
+ section_machine_instance(ctx, container);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_composite_structureEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulesection_composite_structureEx; /* Prevent compiler warnings */
+ rulesection_composite_structureEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(32, section_composite_structure_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end section_composite_structure */
+
+/**
+ * $ANTLR start section_composite_generic
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1364:1: section_composite_generic[ sep::Machine * container ] : ( '@composite:' | '@executable:' | '@machine:' ) (m= executable_machine[ container ] )* ;
+ */
+static void
+section_composite_generic(pfmlParser ctx, sep::Machine * container)
+{
+ ANTLR3_UINT32 section_composite_generic_StartIndex;
+
+ sep::Machine * m;
+ #undef RETURN_TYPE_m
+ #define RETURN_TYPE_m sep::Machine *
+
+ /* Initialize rule variables
+ */
+ section_composite_generic_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(33)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1365:2: ( ( '@composite:' | '@executable:' | '@machine:' ) (m= executable_machine[ container ] )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1365:4: ( '@composite:' | '@executable:' | '@machine:' ) (m= executable_machine[ container ] )*
+ {
+ if ( LA(1) == 174 || LA(1) == 183 || LA(1) == 200 )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulesection_composite_genericEx;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1366:4: (m= executable_machine[ container ] )*
+
+ for (;;)
+ {
+ int alt78=2;
+ switch ( LA(1) )
+ {
+ case 144:
+ case 145:
+ case 147:
+ case 148:
+ case 149:
+ case 150:
+ case 153:
+ case 272:
+ case 306:
+ case 307:
+ case 314:
+ case 317:
+ case 322:
+ case 353:
+ case 378:
+ case 379:
+ case 393:
+ case 406:
+ {
+ alt78=1;
+ }
+ break;
+
+ }
+
+ switch (alt78)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1366:6: m= executable_machine[ container ]
+ {
+ FOLLOWPUSH(FOLLOW_executable_machine_in_section_composite_generic3081);
+ m=executable_machine(ctx, container);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_composite_genericEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop78; /* break out of the loop */
+ break;
+ }
+ }
+ loop78: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulesection_composite_genericEx; /* Prevent compiler warnings */
+ rulesection_composite_genericEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(33, section_composite_generic_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end section_composite_generic */
+
+/**
+ * $ANTLR start section_machine_model
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1370:1: section_machine_model[ sep::Machine * container ] : '@model:' (m= executable_model_definiton[ container , mdfr , spcfr ] )* ;
+ */
+static void
+section_machine_model(pfmlParser ctx, sep::Machine * container)
+{
+ ANTLR3_UINT32 section_machine_model_StartIndex;
+
+ sep::Machine * m;
+ #undef RETURN_TYPE_m
+ #define RETURN_TYPE_m sep::Machine *
+
+ /* Initialize rule variables
+ */
+ section_machine_model_StartIndex = INDEX();
+
+
+
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr( sep::Specifier::DESIGN_MODEL_SPECIFIER );
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(34)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1376:2: ( '@model:' (m= executable_model_definiton[ container , mdfr , spcfr ] )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1376:4: '@model:' (m= executable_model_definiton[ container , mdfr , spcfr ] )*
+ {
+ MATCHT(203, &FOLLOW_203_in_section_machine_model3103);
+ if (HASEXCEPTION())
+ {
+ goto rulesection_machine_modelEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1377:4: (m= executable_model_definiton[ container , mdfr , spcfr ] )*
+
+ for (;;)
+ {
+ int alt79=2;
+ switch ( LA(1) )
+ {
+ case 272:
+ case 306:
+ case 314:
+ case 317:
+ case 322:
+ case 353:
+ case 379:
+ case 393:
+ case 406:
+ {
+ alt79=1;
+ }
+ break;
+
+ }
+
+ switch (alt79)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1377:6: m= executable_model_definiton[ container , mdfr , spcfr ]
+ {
+ FOLLOWPUSH(FOLLOW_executable_model_definiton_in_section_machine_model3112);
+ m=executable_model_definiton(ctx, container, mdfr, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_machine_modelEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop79; /* break out of the loop */
+ break;
+ }
+ }
+ loop79: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulesection_machine_modelEx; /* Prevent compiler warnings */
+ rulesection_machine_modelEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(34, section_machine_model_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end section_machine_model */
+
+/**
+ * $ANTLR start section_machine_prototype
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1381:1: section_machine_prototype[ sep::Machine * container ] : '@prototype:' (m= executable_model_definiton[ container , mdfr , spcfr ] )* ;
+ */
+static void
+section_machine_prototype(pfmlParser ctx, sep::Machine * container)
+{
+ ANTLR3_UINT32 section_machine_prototype_StartIndex;
+
+ sep::Machine * m;
+ #undef RETURN_TYPE_m
+ #define RETURN_TYPE_m sep::Machine *
+
+ /* Initialize rule variables
+ */
+ section_machine_prototype_StartIndex = INDEX();
+
+
+
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr( sep::Specifier::DESIGN_PROTOTYPE_STATIC_SPECIFIER );
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(35)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1387:2: ( '@prototype:' (m= executable_model_definiton[ container , mdfr , spcfr ] )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1387:4: '@prototype:' (m= executable_model_definiton[ container , mdfr , spcfr ] )*
+ {
+ MATCHT(215, &FOLLOW_215_in_section_machine_prototype3134);
+ if (HASEXCEPTION())
+ {
+ goto rulesection_machine_prototypeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1388:4: (m= executable_model_definiton[ container , mdfr , spcfr ] )*
+
+ for (;;)
+ {
+ int alt80=2;
+ switch ( LA(1) )
+ {
+ case 272:
+ case 306:
+ case 314:
+ case 317:
+ case 322:
+ case 353:
+ case 379:
+ case 393:
+ case 406:
+ {
+ alt80=1;
+ }
+ break;
+
+ }
+
+ switch (alt80)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1388:6: m= executable_model_definiton[ container , mdfr , spcfr ]
+ {
+ FOLLOWPUSH(FOLLOW_executable_model_definiton_in_section_machine_prototype3143);
+ m=executable_model_definiton(ctx, container, mdfr, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_machine_prototypeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop80; /* break out of the loop */
+ break;
+ }
+ }
+ loop80: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulesection_machine_prototypeEx; /* Prevent compiler warnings */
+ rulesection_machine_prototypeEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(35, section_machine_prototype_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end section_machine_prototype */
+
+/**
+ * $ANTLR start section_machine_instance
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1391:1: section_machine_instance[ sep::Machine * container ] : '@instance:' (edi= executable_instance_definiton[ container ] )* ;
+ */
+static void
+section_machine_instance(pfmlParser ctx, sep::Machine * container)
+{
+ ANTLR3_UINT32 section_machine_instance_StartIndex;
+
+ sep::Machine * edi;
+ #undef RETURN_TYPE_edi
+ #define RETURN_TYPE_edi sep::Machine *
+
+ /* Initialize rule variables
+ */
+ section_machine_instance_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(36)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1392:2: ( '@instance:' (edi= executable_instance_definiton[ container ] )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1392:4: '@instance:' (edi= executable_instance_definiton[ container ] )*
+ {
+ MATCHT(197, &FOLLOW_197_in_section_machine_instance3160);
+ if (HASEXCEPTION())
+ {
+ goto rulesection_machine_instanceEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1393:4: (edi= executable_instance_definiton[ container ] )*
+
+ for (;;)
+ {
+ int alt81=2;
+ switch ( LA(1) )
+ {
+ case 272:
+ case 282:
+ case 306:
+ case 307:
+ case 314:
+ case 349:
+ case 352:
+ case 355:
+ case 393:
+ case 406:
+ {
+ alt81=1;
+ }
+ break;
+
+ }
+
+ switch (alt81)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1393:6: edi= executable_instance_definiton[ container ]
+ {
+ FOLLOWPUSH(FOLLOW_executable_instance_definiton_in_section_machine_instance3169);
+ edi=executable_instance_definiton(ctx, container);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_machine_instanceEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop81; /* break out of the loop */
+ break;
+ }
+ }
+ loop81: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulesection_machine_instanceEx; /* Prevent compiler warnings */
+ rulesection_machine_instanceEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(36, section_machine_instance_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end section_machine_instance */
+
+/**
+ * $ANTLR start executable_machine
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1397:1: executable_machine[ sep::Machine * container ] returns [ sep::Machine * machine ] : (ms= executable_modifier_specifier )? (dm= def_machine[ container , mdfr , spcfr ] |ads= any_def_statemachine[ container , mdfr , spcfr ] |emi= decl_instance[ container , mdfr , spcfr ] ) ;
+ */
+static sep::Machine *
+executable_machine(pfmlParser ctx, sep::Machine * container)
+{
+ sep::Machine * machine;
+
+ ANTLR3_UINT32 executable_machine_StartIndex;
+
+ fmlParser_executable_modifier_specifier_return ms;
+ #undef RETURN_TYPE_ms
+ #define RETURN_TYPE_ms fmlParser_executable_modifier_specifier_return
+
+ sep::Machine * dm;
+ #undef RETURN_TYPE_dm
+ #define RETURN_TYPE_dm sep::Machine *
+
+ sep::Machine * ads;
+ #undef RETURN_TYPE_ads
+ #define RETURN_TYPE_ads sep::Machine *
+
+ sep::Machine * emi;
+ #undef RETURN_TYPE_emi
+ #define RETURN_TYPE_emi sep::Machine *
+
+ /* Initialize rule variables
+ */
+ executable_machine_StartIndex = INDEX();
+
+
+
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(37)) )
+ {
+ {
+ }
+
+
+
+ return machine;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1404:2: ( (ms= executable_modifier_specifier )? (dm= def_machine[ container , mdfr , spcfr ] |ads= any_def_statemachine[ container , mdfr , spcfr ] |emi= decl_instance[ container , mdfr , spcfr ] ) )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1404:4: (ms= executable_modifier_specifier )? (dm= def_machine[ container , mdfr , spcfr ] |ads= any_def_statemachine[ container , mdfr , spcfr ] |emi= decl_instance[ container , mdfr , spcfr ] )
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1404:4: (ms= executable_modifier_specifier )?
+ {
+ int alt82=2;
+ switch ( LA(1) )
+ {
+ case 272:
+ case 306:
+ case 314:
+ case 322:
+ case 353:
+ case 393:
+ case 406:
+ {
+ {
+ int LA82_1 = LA(2);
+ if ( (synpred153_fml(ctx)))
+ {
+ alt82=1;
+ }
+ }
+ }
+ break;
+ }
+
+ switch (alt82)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1404:6: ms= executable_modifier_specifier
+ {
+ FOLLOWPUSH(FOLLOW_executable_modifier_specifier_in_executable_machine3199);
+ ms=executable_modifier_specifier(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_machineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr = ms.mdfr
+ ; spcfr = ms.spcfr
+ ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1408:4: (dm= def_machine[ container , mdfr , spcfr ] |ads= any_def_statemachine[ container , mdfr , spcfr ] |emi= decl_instance[ container , mdfr , spcfr ] )
+ {
+ int alt83=3;
+ switch ( LA(1) )
+ {
+ case 317:
+ {
+ alt83=1;
+ }
+ break;
+ case 144:
+ case 145:
+ case 147:
+ case 148:
+ case 149:
+ case 150:
+ case 153:
+ case 272:
+ case 306:
+ case 314:
+ case 322:
+ case 353:
+ case 378:
+ case 379:
+ case 393:
+ case 406:
+ {
+ alt83=2;
+ }
+ break;
+ case 307:
+ {
+ alt83=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return machine;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 83;
+ EXCEPTION->state = 0;
+
+
+ goto ruleexecutable_machineEx;
+
+ }
+
+ switch (alt83)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1408:6: dm= def_machine[ container , mdfr , spcfr ]
+ {
+ FOLLOWPUSH(FOLLOW_def_machine_in_executable_machine3220);
+ dm=def_machine(ctx, container, mdfr, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_machineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ machine=
+ dm
+ ;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1411:6: ads= any_def_statemachine[ container , mdfr , spcfr ]
+ {
+ FOLLOWPUSH(FOLLOW_any_def_statemachine_in_executable_machine3236);
+ ads=any_def_statemachine(ctx, container, mdfr, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_machineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ machine=
+ ads
+ ;
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1414:6: emi= decl_instance[ container , mdfr , spcfr ]
+ {
+ FOLLOWPUSH(FOLLOW_decl_instance_in_executable_machine3252);
+ emi=decl_instance(ctx, container, mdfr, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_machineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ machine=
+ emi
+ ;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleexecutable_machineEx; /* Prevent compiler warnings */
+ ruleexecutable_machineEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(37, executable_machine_StartIndex); }
+
+ return machine;
+}
+/* $ANTLR end executable_machine */
+
+/**
+ * $ANTLR start executable_model_definiton
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1420:1: executable_model_definiton[ sep::Machine * container ,\n\t\tsep::Modifier mdfr , sep::Specifier spcfr ] returns [ sep::Machine * machine ] : (ms= executable_modifier_specifier )? (dm= def_machine[ container , mdfr , spcfr ] |ads= def_statemachine[ container , mdfr , spcfr ] ) ;
+ */
+static sep::Machine *
+executable_model_definiton(pfmlParser ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr)
+{
+ sep::Machine * machine;
+
+ ANTLR3_UINT32 executable_model_definiton_StartIndex;
+
+ fmlParser_executable_modifier_specifier_return ms;
+ #undef RETURN_TYPE_ms
+ #define RETURN_TYPE_ms fmlParser_executable_modifier_specifier_return
+
+ sep::Machine * dm;
+ #undef RETURN_TYPE_dm
+ #define RETURN_TYPE_dm sep::Machine *
+
+ sep::Machine * ads;
+ #undef RETURN_TYPE_ads
+ #define RETURN_TYPE_ads sep::Machine *
+
+ /* Initialize rule variables
+ */
+ executable_model_definiton_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(38)) )
+ {
+ {
+ }
+
+
+
+ return machine;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1424:2: ( (ms= executable_modifier_specifier )? (dm= def_machine[ container , mdfr , spcfr ] |ads= def_statemachine[ container , mdfr , spcfr ] ) )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1424:4: (ms= executable_modifier_specifier )? (dm= def_machine[ container , mdfr , spcfr ] |ads= def_statemachine[ container , mdfr , spcfr ] )
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1424:4: (ms= executable_modifier_specifier )?
+ {
+ int alt84=2;
+ switch ( LA(1) )
+ {
+ case 272:
+ case 306:
+ case 314:
+ case 322:
+ case 353:
+ case 393:
+ case 406:
+ {
+ alt84=1;
+ }
+ break;
+ }
+
+ switch (alt84)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1424:6: ms= executable_modifier_specifier
+ {
+ FOLLOWPUSH(FOLLOW_executable_modifier_specifier_in_executable_model_definiton3286);
+ ms=executable_modifier_specifier(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_model_definitonEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.override_ifdef( ms.mdfr
+ ); spcfr.override_ifdef( ms.spcfr
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1428:4: (dm= def_machine[ container , mdfr , spcfr ] |ads= def_statemachine[ container , mdfr , spcfr ] )
+ {
+ int alt85=2;
+ switch ( LA(1) )
+ {
+ case 317:
+ {
+ alt85=1;
+ }
+ break;
+ case 379:
+ {
+ alt85=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return machine;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 85;
+ EXCEPTION->state = 0;
+
+
+ goto ruleexecutable_model_definitonEx;
+
+ }
+
+ switch (alt85)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1428:6: dm= def_machine[ container , mdfr , spcfr ]
+ {
+ FOLLOWPUSH(FOLLOW_def_machine_in_executable_model_definiton3307);
+ dm=def_machine(ctx, container, mdfr, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_model_definitonEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ machine=
+ dm
+ ;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1431:6: ads= def_statemachine[ container , mdfr , spcfr ]
+ {
+ FOLLOWPUSH(FOLLOW_def_statemachine_in_executable_model_definiton3329);
+ ads=def_statemachine(ctx, container, mdfr, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_model_definitonEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ machine=
+ ads
+ ;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleexecutable_model_definitonEx; /* Prevent compiler warnings */
+ ruleexecutable_model_definitonEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(38, executable_model_definiton_StartIndex); }
+
+ return machine;
+}
+/* $ANTLR end executable_model_definiton */
+
+/**
+ * $ANTLR start executable_instance_definiton
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1436:1: executable_instance_definiton[ sep::Machine * container ] returns [ sep::Machine * instance ] : (ms= instance_modifier_specifier )? emi= decl_instance[ container , mdfr , spcfr ] ;
+ */
+static sep::Machine *
+executable_instance_definiton(pfmlParser ctx, sep::Machine * container)
+{
+ sep::Machine * instance;
+
+ ANTLR3_UINT32 executable_instance_definiton_StartIndex;
+
+ fmlParser_instance_modifier_specifier_return ms;
+ #undef RETURN_TYPE_ms
+ #define RETURN_TYPE_ms fmlParser_instance_modifier_specifier_return
+
+ sep::Machine * emi;
+ #undef RETURN_TYPE_emi
+ #define RETURN_TYPE_emi sep::Machine *
+
+ /* Initialize rule variables
+ */
+ executable_instance_definiton_StartIndex = INDEX();
+
+
+
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr( sep::Specifier::DESIGN_INSTANCE_STATIC_SPECIFIER );
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(39)) )
+ {
+ {
+ }
+
+
+
+ return instance;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1443:2: ( (ms= instance_modifier_specifier )? emi= decl_instance[ container , mdfr , spcfr ] )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1443:4: (ms= instance_modifier_specifier )? emi= decl_instance[ container , mdfr , spcfr ]
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1443:4: (ms= instance_modifier_specifier )?
+ {
+ int alt86=2;
+ switch ( LA(1) )
+ {
+ case 272:
+ case 282:
+ case 306:
+ case 314:
+ case 349:
+ case 352:
+ case 355:
+ case 393:
+ case 406:
+ {
+ alt86=1;
+ }
+ break;
+ }
+
+ switch (alt86)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1443:6: ms= instance_modifier_specifier
+ {
+ FOLLOWPUSH(FOLLOW_instance_modifier_specifier_in_executable_instance_definiton3365);
+ ms=instance_modifier_specifier(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_instance_definitonEx;
+ }
+ if (HASFAILED())
+ {
+ return instance;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr = ms.mdfr
+ ; spcfr = ms.spcfr
+ ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_decl_instance_in_executable_instance_definiton3384);
+ emi=decl_instance(ctx, container, mdfr, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_instance_definitonEx;
+ }
+ if (HASFAILED())
+ {
+ return instance;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ instance=
+ emi
+ ;
+
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleexecutable_instance_definitonEx; /* Prevent compiler warnings */
+ ruleexecutable_instance_definitonEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(39, executable_instance_definiton_StartIndex); }
+
+ return instance;
+}
+/* $ANTLR end executable_instance_definiton */
+
+/**
+ * $ANTLR start decl_instance
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1456:1: decl_instance[ sep::Machine * container ,\n\t\tsep::Modifier mdfr , sep::Specifier spcfr ] returns [ sep::Machine * instance ] : 'instance' ( 'machine' | 'statemachine' )? LT_ ( 'model:' )? mm= instance_machine_model ( COMMA def_instance_count[ initialCount , maximalCount ] )? GT id= ID ( StringLiteral )? ( LPAREN ( def_instance_on_new_activity[ $instance ] )? RPAREN )? ( SEMI | LCURLY (s= statement )* ( def_instance_activity[ $instance ] )* RCURLY ) ;
+ */
+static sep::Machine *
+decl_instance(pfmlParser ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr)
+{
+ sep::Machine * instance;
+
+ ANTLR3_UINT32 decl_instance_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ pANTLR3_COMMON_TOKEN StringLiteral4;
+ sep::BF mm;
+ #undef RETURN_TYPE_mm
+ #define RETURN_TYPE_mm sep::BF
+
+ sep::BFCode s;
+ #undef RETURN_TYPE_s
+ #define RETURN_TYPE_s sep::BFCode
+
+ /* Initialize rule variables
+ */
+ decl_instance_StartIndex = INDEX();
+
+
+
+ sep::BF aModel;
+
+ sep::avm_size_t initialCount = 1;
+ sep::avm_size_t maximalCount = AVM_NUMERIC_MAX_SIZE_T;
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(40)) )
+ {
+ {
+
+ if( aModel.is< sep::Machine >() )
+ {
+ POP_CTX;
+ }
+ SET_RULE_LOCATION(instance);
+
+ }
+ {
+ }
+
+
+
+ return instance;
+ }
+
+ id = NULL;
+ StringLiteral4 = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1475:2: ( 'instance' ( 'machine' | 'statemachine' )? LT_ ( 'model:' )? mm= instance_machine_model ( COMMA def_instance_count[ initialCount , maximalCount ] )? GT id= ID ( StringLiteral )? ( LPAREN ( def_instance_on_new_activity[ $instance ] )? RPAREN )? ( SEMI | LCURLY (s= statement )* ( def_instance_activity[ $instance ] )* RCURLY ) )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1475:4: 'instance' ( 'machine' | 'statemachine' )? LT_ ( 'model:' )? mm= instance_machine_model ( COMMA def_instance_count[ initialCount , maximalCount ] )? GT id= ID ( StringLiteral )? ( LPAREN ( def_instance_on_new_activity[ $instance ] )? RPAREN )? ( SEMI | LCURLY (s= statement )* ( def_instance_activity[ $instance ] )* RCURLY )
+ {
+ MATCHT(307, &FOLLOW_307_in_decl_instance3421);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instanceEx;
+ }
+ if (HASFAILED())
+ {
+ return instance;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1475:16: ( 'machine' | 'statemachine' )?
+ {
+ int alt87=2;
+ switch ( LA(1) )
+ {
+ case 317:
+ case 379:
+ {
+ alt87=1;
+ }
+ break;
+ }
+
+ switch (alt87)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:
+ {
+ if ( LA(1) == 317 || LA(1) == 379 )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return instance;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruledecl_instanceEx;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(LT_, &FOLLOW_LT__in_decl_instance3438);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instanceEx;
+ }
+ if (HASFAILED())
+ {
+ return instance;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1477:5: ( 'model:' )?
+ {
+ int alt88=2;
+ switch ( LA(1) )
+ {
+ case 323:
+ {
+ alt88=1;
+ }
+ break;
+ }
+
+ switch (alt88)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1477:7: 'model:'
+ {
+ MATCHT(323, &FOLLOW_323_in_decl_instance3446);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instanceEx;
+ }
+ if (HASFAILED())
+ {
+ return instance;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_instance_machine_model_in_decl_instance3453);
+ mm=instance_machine_model(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instanceEx;
+ }
+ if (HASFAILED())
+ {
+ return instance;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ aModel = mm
+ ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1479:5: ( COMMA def_instance_count[ initialCount , maximalCount ] )?
+ {
+ int alt89=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt89=1;
+ }
+ break;
+ }
+
+ switch (alt89)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1479:7: COMMA def_instance_count[ initialCount , maximalCount ]
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_decl_instance3465);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instanceEx;
+ }
+ if (HASFAILED())
+ {
+ return instance;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_instance_count_in_decl_instance3468);
+ def_instance_count(ctx, initialCount, maximalCount);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instanceEx;
+ }
+ if (HASFAILED())
+ {
+ return instance;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(GT, &FOLLOW_GT_in_decl_instance3477);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instanceEx;
+ }
+ if (HASFAILED())
+ {
+ return instance;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_decl_instance3482);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instanceEx;
+ }
+ if (HASFAILED())
+ {
+ return instance;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ if( aModel.is< sep::Machine >() )
+ {
+ PUSH_CTX_NEW( aModel.to_ptr< sep::Machine >() );
+ }
+
+ instance= sep::Machine::newInstance(container,
+ STR((id->getText(id))->chars), aModel, initialCount, maximalCount);
+
+
+ instance
+ ->getwModifier().override_ifdef( mdfr );
+
+ instance
+ ->getwSpecifier().override_ifdef(
+ spcfr.isDesignInstanceDynamic() ?
+ spcfr : spcfr.setDesignInstanceStatic() );
+
+ container->saveOwnedElement( instance
+ );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1499:4: ( StringLiteral )?
+ {
+ int alt90=2;
+ switch ( LA(1) )
+ {
+ case StringLiteral:
+ {
+ alt90=1;
+ }
+ break;
+ }
+
+ switch (alt90)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1499:6: StringLiteral
+ {
+ StringLiteral4 = (pANTLR3_COMMON_TOKEN) MATCHT(StringLiteral, &FOLLOW_StringLiteral_in_decl_instance3495);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instanceEx;
+ }
+ if (HASFAILED())
+ {
+ return instance;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ instance
+ ->setUnrestrictedName(STR((StringLiteral4->getText(StringLiteral4))->chars));
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1508:4: ( LPAREN ( def_instance_on_new_activity[ $instance ] )? RPAREN )?
+ {
+ int alt92=2;
+ switch ( LA(1) )
+ {
+ case LPAREN:
+ {
+ alt92=1;
+ }
+ break;
+ }
+
+ switch (alt92)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1508:6: LPAREN ( def_instance_on_new_activity[ $instance ] )? RPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_decl_instance3515);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instanceEx;
+ }
+ if (HASFAILED())
+ {
+ return instance;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1509:6: ( def_instance_on_new_activity[ $instance ] )?
+ {
+ int alt91=2;
+ switch ( LA(1) )
+ {
+ case BNOT:
+ case COLONx2:
+ case CharLiteral:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case FloatLiteral:
+ case ID:
+ case INCR:
+ case IntegerLiteral:
+ case LBRACKET:
+ case LBRACKET_BAR:
+ case LCURLY:
+ case LNOT:
+ case LPAREN:
+ case LPAREN_INVOKE:
+ case MINUS:
+ case OP_POP:
+ case OP_TOP:
+ case PERCENT_LCURLY:
+ case PLUS:
+ case RationalLiteral:
+ case StringLiteral:
+ case 158:
+ case 159:
+ case 160:
+ case 161:
+ case 162:
+ case 237:
+ case 256:
+ case 265:
+ case 277:
+ case 280:
+ case 294:
+ case 313:
+ case 330:
+ case 331:
+ case 332:
+ case 343:
+ case 347:
+ case 372:
+ case 397:
+ {
+ alt91=1;
+ }
+ break;
+ }
+
+ switch (alt91)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1509:8: def_instance_on_new_activity[ $instance ]
+ {
+ FOLLOWPUSH(FOLLOW_def_instance_on_new_activity_in_decl_instance3524);
+ def_instance_on_new_activity(ctx,
+ instance
+ );
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instanceEx;
+ }
+ if (HASFAILED())
+ {
+ return instance;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_decl_instance3536);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instanceEx;
+ }
+ if (HASFAILED())
+ {
+ return instance;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1513:4: ( SEMI | LCURLY (s= statement )* ( def_instance_activity[ $instance ] )* RCURLY )
+ {
+ int alt95=2;
+ switch ( LA(1) )
+ {
+ case SEMI:
+ {
+ alt95=1;
+ }
+ break;
+ case LCURLY:
+ {
+ alt95=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return instance;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 95;
+ EXCEPTION->state = 0;
+
+
+ goto ruledecl_instanceEx;
+
+ }
+
+ switch (alt95)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1513:6: SEMI
+ {
+ MATCHT(SEMI, &FOLLOW_SEMI_in_decl_instance3550);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instanceEx;
+ }
+ if (HASFAILED())
+ {
+ return instance;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1515:6: LCURLY (s= statement )* ( def_instance_activity[ $instance ] )* RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_decl_instance3558);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instanceEx;
+ }
+ if (HASFAILED())
+ {
+ return instance;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1516:3: (s= statement )*
+
+ for (;;)
+ {
+ int alt93=2;
+ switch ( LA(1) )
+ {
+ case COLONx2:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case ID:
+ case INCR:
+ case LCURLY:
+ case LPAREN_INVOKE:
+ case STATEMENT_PROMPT:
+ case 154:
+ case 155:
+ case 156:
+ case 157:
+ case 236:
+ case 247:
+ case 250:
+ case 256:
+ case 263:
+ case 267:
+ case 268:
+ case 269:
+ case 275:
+ case 278:
+ case 279:
+ case 282:
+ case 285:
+ case 289:
+ case 290:
+ case 291:
+ case 292:
+ case 293:
+ case 294:
+ case 296:
+ case 299:
+ case 300:
+ case 301:
+ case 302:
+ case 303:
+ case 304:
+ case 305:
+ case 312:
+ case 330:
+ case 336:
+ case 337:
+ case 338:
+ case 339:
+ case 340:
+ case 341:
+ case 362:
+ case 363:
+ case 364:
+ case 368:
+ case 369:
+ case 371:
+ case 377:
+ case 385:
+ case 386:
+ case 389:
+ case 391:
+ case 415:
+ case 416:
+ {
+ alt93=1;
+ }
+ break;
+
+ }
+
+ switch (alt93)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1516:5: s= statement
+ {
+ FOLLOWPUSH(FOLLOW_statement_in_decl_instance3566);
+ s=statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instanceEx;
+ }
+ if (HASFAILED())
+ {
+ return instance;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ instance->getUniqBehaviorPart()->seqOnCreate(s
+ );
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop93; /* break out of the loop */
+ break;
+ }
+ }
+ loop93: ; /* Jump out to here if this rule does not match */
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1518:3: ( def_instance_activity[ $instance ] )*
+
+ for (;;)
+ {
+ int alt94=2;
+ switch ( LA(1) )
+ {
+ case 177:
+ case 226:
+ {
+ alt94=1;
+ }
+ break;
+
+ }
+
+ switch (alt94)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1518:5: def_instance_activity[ $instance ]
+ {
+ FOLLOWPUSH(FOLLOW_def_instance_activity_in_decl_instance3578);
+ def_instance_activity(ctx,
+ instance
+ );
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instanceEx;
+ }
+ if (HASFAILED())
+ {
+ return instance;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop94; /* break out of the loop */
+ break;
+ }
+ }
+ loop94: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_decl_instance3589);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instanceEx;
+ }
+ if (HASFAILED())
+ {
+ return instance;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledecl_instanceEx; /* Prevent compiler warnings */
+ ruledecl_instanceEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ if( aModel.is< sep::Machine >() )
+ {
+ POP_CTX;
+ }
+ SET_RULE_LOCATION(instance);
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(40, decl_instance_StartIndex); }
+
+ return instance;
+}
+/* $ANTLR end decl_instance */
+
+/**
+ * $ANTLR start def_instance_on_new_activity
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1524:1: def_instance_on_new_activity[ sep::Machine * instance ] : def_instance_on_new_activity_parameter[ $instance , position++ ] ( COMMA def_instance_on_new_activity_parameter[ $instance , position++ ] )* ;
+ */
+static void
+def_instance_on_new_activity(pfmlParser ctx, sep::Machine * instance)
+{
+ ANTLR3_UINT32 def_instance_on_new_activity_StartIndex;
+
+ /* Initialize rule variables
+ */
+ def_instance_on_new_activity_StartIndex = INDEX();
+
+
+
+ sep::avm_size_t position = 0;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(41)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1528:2: ( def_instance_on_new_activity_parameter[ $instance , position++ ] ( COMMA def_instance_on_new_activity_parameter[ $instance , position++ ] )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1528:4: def_instance_on_new_activity_parameter[ $instance , position++ ] ( COMMA def_instance_on_new_activity_parameter[ $instance , position++ ] )*
+ {
+ FOLLOWPUSH(FOLLOW_def_instance_on_new_activity_parameter_in_def_instance_on_new_activity3612);
+ def_instance_on_new_activity_parameter(ctx, instance, position++);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_on_new_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1529:7: ( COMMA def_instance_on_new_activity_parameter[ $instance , position++ ] )*
+
+ for (;;)
+ {
+ int alt96=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt96=1;
+ }
+ break;
+
+ }
+
+ switch (alt96)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1529:9: COMMA def_instance_on_new_activity_parameter[ $instance , position++ ]
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_def_instance_on_new_activity3623);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_on_new_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_instance_on_new_activity_parameter_in_def_instance_on_new_activity3625);
+ def_instance_on_new_activity_parameter(ctx, instance, position++);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_on_new_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop96; /* break out of the loop */
+ break;
+ }
+ }
+ loop96: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_instance_on_new_activityEx; /* Prevent compiler warnings */
+ ruledef_instance_on_new_activityEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(41, def_instance_on_new_activity_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_instance_on_new_activity */
+
+/**
+ * $ANTLR start def_instance_on_new_activity_parameter
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1532:1: def_instance_on_new_activity_parameter[ sep::Machine * instance , sep::avm_size_t position ] : ( ( lvalue op_assign_param )=>lv= lvalue oap= op_assign_param e= expression |e= expression );
+ */
+static void
+def_instance_on_new_activity_parameter(pfmlParser ctx, sep::Machine * instance, sep::avm_size_t position)
+{
+ ANTLR3_UINT32 def_instance_on_new_activity_parameter_StartIndex;
+
+ sep::BF lv;
+ #undef RETURN_TYPE_lv
+ #define RETURN_TYPE_lv sep::BF
+
+ sep::Operator * oap;
+ #undef RETURN_TYPE_oap
+ #define RETURN_TYPE_oap sep::Operator *
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ def_instance_on_new_activity_parameter_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(42)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1534:2: ( ( lvalue op_assign_param )=>lv= lvalue oap= op_assign_param e= expression |e= expression )
+
+ ANTLR3_UINT32 alt97;
+
+ alt97=2;
+
+ switch ( LA(1) )
+ {
+ case COLONx2:
+ {
+ {
+ int LA97_1 = LA(2);
+ if ( (synpred170_fml(ctx)))
+ {
+ alt97=1;
+ }
+ else if ( (ANTLR3_TRUE))
+ {
+ alt97=2;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 97;
+ EXCEPTION->state = 1;
+
+
+ goto ruledef_instance_on_new_activity_parameterEx;
+
+ }
+ }
+ }
+ break;
+ case ID:
+ {
+ {
+ int LA97_2 = LA(2);
+ if ( (synpred170_fml(ctx)))
+ {
+ alt97=1;
+ }
+ else if ( (ANTLR3_TRUE))
+ {
+ alt97=2;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 97;
+ EXCEPTION->state = 2;
+
+
+ goto ruledef_instance_on_new_activity_parameterEx;
+
+ }
+ }
+ }
+ break;
+ case BNOT:
+ case CharLiteral:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case FloatLiteral:
+ case INCR:
+ case IntegerLiteral:
+ case LBRACKET:
+ case LBRACKET_BAR:
+ case LCURLY:
+ case LNOT:
+ case LPAREN:
+ case LPAREN_INVOKE:
+ case MINUS:
+ case OP_POP:
+ case OP_TOP:
+ case PERCENT_LCURLY:
+ case PLUS:
+ case RationalLiteral:
+ case StringLiteral:
+ case 158:
+ case 159:
+ case 160:
+ case 161:
+ case 162:
+ case 237:
+ case 256:
+ case 265:
+ case 277:
+ case 280:
+ case 294:
+ case 313:
+ case 330:
+ case 331:
+ case 332:
+ case 343:
+ case 347:
+ case 372:
+ case 397:
+ {
+ alt97=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 97;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_instance_on_new_activity_parameterEx;
+
+ }
+
+ switch (alt97)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1534:4: ( lvalue op_assign_param )=>lv= lvalue oap= op_assign_param e= expression
+ {
+ FOLLOWPUSH(FOLLOW_lvalue_in_def_instance_on_new_activity_parameter3659);
+ lv=lvalue(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_on_new_activity_parameterEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_op_assign_param_in_def_instance_on_new_activity_parameter3664);
+ oap=op_assign_param(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_on_new_activity_parameterEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_def_instance_on_new_activity_parameter3669);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_on_new_activity_parameterEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ instance->getUniqBehaviorPart()->seqOnCreate( NEW_STMT2(oap
+ , lv
+ , e
+ ) );
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1538:4: e= expression
+ {
+ FOLLOWPUSH(FOLLOW_expression_in_def_instance_on_new_activity_parameter3682);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_on_new_activity_parameterEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ sep::ParserUtil::appendInstanceDynamicPositionalParameter(
+ instance, e
+ , position);
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_instance_on_new_activity_parameterEx; /* Prevent compiler warnings */
+ ruledef_instance_on_new_activity_parameterEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(42, def_instance_on_new_activity_parameter_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_instance_on_new_activity_parameter */
+
+/**
+ * $ANTLR start op_assign_param
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1545:1: op_assign_param returns [ sep::Operator * op ] : ( ( ASSIGN | COLON ) | ASSIGN_REF | ASSIGN_MACRO );
+ */
+static sep::Operator *
+op_assign_param(pfmlParser ctx)
+{
+ sep::Operator * op;
+
+ ANTLR3_UINT32 op_assign_param_StartIndex;
+
+ /* Initialize rule variables
+ */
+ op_assign_param_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(43)) )
+ {
+ {
+ }
+
+
+
+ return op;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1547:2: ( ( ASSIGN | COLON ) | ASSIGN_REF | ASSIGN_MACRO )
+
+ ANTLR3_UINT32 alt98;
+
+ alt98=3;
+
+ switch ( LA(1) )
+ {
+ case ASSIGN:
+ case COLON:
+ {
+ alt98=1;
+ }
+ break;
+ case ASSIGN_REF:
+ {
+ alt98=2;
+ }
+ break;
+ case ASSIGN_MACRO:
+ {
+ alt98=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return op;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 98;
+ EXCEPTION->state = 0;
+
+
+ goto ruleop_assign_paramEx;
+
+ }
+
+ switch (alt98)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1547:4: ( ASSIGN | COLON )
+ {
+ if ( LA(1) == ASSIGN || LA(1) == COLON )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return op;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruleop_assign_paramEx;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(ASSIGN);
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1548:4: ASSIGN_REF
+ {
+ MATCHT(ASSIGN_REF, &FOLLOW_ASSIGN_REF_in_op_assign_param3718);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_assign_paramEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(ASSIGN_REF);
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1549:4: ASSIGN_MACRO
+ {
+ MATCHT(ASSIGN_MACRO, &FOLLOW_ASSIGN_MACRO_in_op_assign_param3734);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_assign_paramEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(ASSIGN_MACRO);
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleop_assign_paramEx; /* Prevent compiler warnings */
+ ruleop_assign_paramEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(43, op_assign_param_StartIndex); }
+
+ return op;
+}
+/* $ANTLR end op_assign_param */
+
+/**
+ * $ANTLR start def_instance_activity
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1553:1: def_instance_activity[ sep::Machine * instance ] : ( '@create' bs= block_statement | '@start' bs= block_statement );
+ */
+static void
+def_instance_activity(pfmlParser ctx, sep::Machine * instance)
+{
+ ANTLR3_UINT32 def_instance_activity_StartIndex;
+
+ sep::BFCode bs;
+ #undef RETURN_TYPE_bs
+ #define RETURN_TYPE_bs sep::BFCode
+
+ /* Initialize rule variables
+ */
+ def_instance_activity_StartIndex = INDEX();
+
+
+
+ sep::BehavioralPart * theBehavior = instance->getUniqBehaviorPart();
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(44)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1557:2: ( '@create' bs= block_statement | '@start' bs= block_statement )
+
+ ANTLR3_UINT32 alt99;
+
+ alt99=2;
+
+ switch ( LA(1) )
+ {
+ case 177:
+ {
+ alt99=1;
+ }
+ break;
+ case 226:
+ {
+ alt99=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 99;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_instance_activityEx;
+
+ }
+
+ switch (alt99)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1557:4: '@create' bs= block_statement
+ {
+ MATCHT(177, &FOLLOW_177_in_def_instance_activity3761);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_def_instance_activity3767);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ theBehavior->seqOnCreate(bs
+ );
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1558:4: '@start' bs= block_statement
+ {
+ MATCHT(226, &FOLLOW_226_in_def_instance_activity3775);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_def_instance_activity3783);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ theBehavior->seqOnStart(bs
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_instance_activityEx; /* Prevent compiler warnings */
+ ruledef_instance_activityEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(44, def_instance_activity_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_instance_activity */
+
+/**
+ * $ANTLR start section_behavior
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1583:1: section_behavior[ sep::Machine * container ] : '@behavior:' (m= executable_machine[ container ] )+ ;
+ */
+static void
+section_behavior(pfmlParser ctx, sep::Machine * container)
+{
+ ANTLR3_UINT32 section_behavior_StartIndex;
+
+ sep::Machine * m;
+ #undef RETURN_TYPE_m
+ #define RETURN_TYPE_m sep::Machine *
+
+ /* Initialize rule variables
+ */
+ section_behavior_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(45)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1584:2: ( '@behavior:' (m= executable_machine[ container ] )+ )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1584:4: '@behavior:' (m= executable_machine[ container ] )+
+ {
+ MATCHT(171, &FOLLOW_171_in_section_behavior3805);
+ if (HASEXCEPTION())
+ {
+ goto rulesection_behaviorEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1585:4: (m= executable_machine[ container ] )+
+ {
+ int cnt100=0;
+
+ for (;;)
+ {
+ int alt100=2;
+ switch ( LA(1) )
+ {
+ case 144:
+ case 145:
+ case 147:
+ case 148:
+ case 149:
+ case 150:
+ case 153:
+ case 272:
+ case 306:
+ case 307:
+ case 314:
+ case 317:
+ case 322:
+ case 353:
+ case 378:
+ case 379:
+ case 393:
+ case 406:
+ {
+ alt100=1;
+ }
+ break;
+
+ }
+
+ switch (alt100)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1585:6: m= executable_machine[ container ]
+ {
+ FOLLOWPUSH(FOLLOW_executable_machine_in_section_behavior3814);
+ m=executable_machine(ctx, container);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_behaviorEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt100 >= 1 )
+ {
+ goto loop100;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto rulesection_behaviorEx;
+ }
+ cnt100++;
+ }
+ loop100: ; /* Jump to here if this rule does not match */
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulesection_behaviorEx; /* Prevent compiler warnings */
+ rulesection_behaviorEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(45, section_behavior_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end section_behavior */
+
+/**
+ * $ANTLR start def_instance_count
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1593:1: def_instance_count[ sep::avm_size_t & initial , sep::avm_size_t & maximal ] : ( 'multiplicity:' | 'instance:' )? ( LBRACKET (n= integer_constant COMMA (n= integer_constant | ( STAR | PLUS ) ) | STAR | PLUS ) RBRACKET | LPAREN def_instance_count_atom[ $initial , $maximal ] ( ( COMMA )? def_instance_count_atom[ $initial , $maximal ] )* RPAREN ) ;
+ */
+static void
+def_instance_count(pfmlParser ctx, sep::avm_size_t & initial, sep::avm_size_t & maximal)
+{
+ ANTLR3_UINT32 def_instance_count_StartIndex;
+
+ sep::avm_size_t n;
+ #undef RETURN_TYPE_n
+ #define RETURN_TYPE_n sep::avm_size_t
+
+ /* Initialize rule variables
+ */
+ def_instance_count_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(46)) )
+ {
+ {
+
+ if( maximal < initial )
+ {
+ maximal= initial;
+ }
+
+ }
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1601:2: ( ( 'multiplicity:' | 'instance:' )? ( LBRACKET (n= integer_constant COMMA (n= integer_constant | ( STAR | PLUS ) ) | STAR | PLUS ) RBRACKET | LPAREN def_instance_count_atom[ $initial , $maximal ] ( ( COMMA )? def_instance_count_atom[ $initial , $maximal ] )* RPAREN ) )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1601:4: ( 'multiplicity:' | 'instance:' )? ( LBRACKET (n= integer_constant COMMA (n= integer_constant | ( STAR | PLUS ) ) | STAR | PLUS ) RBRACKET | LPAREN def_instance_count_atom[ $initial , $maximal ] ( ( COMMA )? def_instance_count_atom[ $initial , $maximal ] )* RPAREN )
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1601:4: ( 'multiplicity:' | 'instance:' )?
+ {
+ int alt101=2;
+ switch ( LA(1) )
+ {
+ case 308:
+ case 327:
+ {
+ alt101=1;
+ }
+ break;
+ }
+
+ switch (alt101)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:
+ {
+ if ( LA(1) == 308 || LA(1) == 327 )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruledef_instance_countEx;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1602:4: ( LBRACKET (n= integer_constant COMMA (n= integer_constant | ( STAR | PLUS ) ) | STAR | PLUS ) RBRACKET | LPAREN def_instance_count_atom[ $initial , $maximal ] ( ( COMMA )? def_instance_count_atom[ $initial , $maximal ] )* RPAREN )
+ {
+ int alt106=2;
+ switch ( LA(1) )
+ {
+ case LBRACKET:
+ {
+ alt106=1;
+ }
+ break;
+ case LPAREN:
+ {
+ alt106=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 106;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_instance_countEx;
+
+ }
+
+ switch (alt106)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1602:6: LBRACKET (n= integer_constant COMMA (n= integer_constant | ( STAR | PLUS ) ) | STAR | PLUS ) RBRACKET
+ {
+ MATCHT(LBRACKET, &FOLLOW_LBRACKET_in_def_instance_count3857);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_countEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1603:6: (n= integer_constant COMMA (n= integer_constant | ( STAR | PLUS ) ) | STAR | PLUS )
+ {
+ int alt103=3;
+ switch ( LA(1) )
+ {
+ case ID:
+ case IntegerLiteral:
+ {
+ alt103=1;
+ }
+ break;
+ case STAR:
+ {
+ alt103=2;
+ }
+ break;
+ case PLUS:
+ {
+ alt103=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 103;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_instance_countEx;
+
+ }
+
+ switch (alt103)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1603:8: n= integer_constant COMMA (n= integer_constant | ( STAR | PLUS ) )
+ {
+ FOLLOWPUSH(FOLLOW_integer_constant_in_def_instance_count3868);
+ n=integer_constant(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_countEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ initial=
+ n
+ ;
+ }
+
+
+ MATCHT(COMMA, &FOLLOW_COMMA_in_def_instance_count3880);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_countEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1605:8: (n= integer_constant | ( STAR | PLUS ) )
+ {
+ int alt102=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ case IntegerLiteral:
+ {
+ alt102=1;
+ }
+ break;
+ case PLUS:
+ case STAR:
+ {
+ alt102=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 102;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_instance_countEx;
+
+ }
+
+ switch (alt102)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1605:10: n= integer_constant
+ {
+ FOLLOWPUSH(FOLLOW_integer_constant_in_def_instance_count3893);
+ n=integer_constant(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_countEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ maximal=
+ n
+ ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1606:10: ( STAR | PLUS )
+ {
+ if ( LA(1) == PLUS || LA(1) == STAR )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruledef_instance_countEx;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ maximal= AVM_NUMERIC_MAX_SIZE_T;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1608:8: STAR
+ {
+ MATCHT(STAR, &FOLLOW_STAR_in_def_instance_count3939);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_countEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ initial= 0; maximal= AVM_NUMERIC_MAX_SIZE_T;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1609:8: PLUS
+ {
+ MATCHT(PLUS, &FOLLOW_PLUS_in_def_instance_count3951);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_countEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ initial= 1; maximal= AVM_NUMERIC_MAX_SIZE_T;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(RBRACKET, &FOLLOW_RBRACKET_in_def_instance_count3968);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_countEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1613:6: LPAREN def_instance_count_atom[ $initial , $maximal ] ( ( COMMA )? def_instance_count_atom[ $initial , $maximal ] )* RPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_def_instance_count3976);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_countEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_instance_count_atom_in_def_instance_count3983);
+ def_instance_count_atom(ctx, initial, maximal);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_countEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1615:6: ( ( COMMA )? def_instance_count_atom[ $initial , $maximal ] )*
+
+ for (;;)
+ {
+ int alt105=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ case 297:
+ case 319:
+ {
+ alt105=1;
+ }
+ break;
+
+ }
+
+ switch (alt105)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1615:8: ( COMMA )? def_instance_count_atom[ $initial , $maximal ]
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1615:8: ( COMMA )?
+ {
+ int alt104=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt104=1;
+ }
+ break;
+ }
+
+ switch (alt104)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1615:8: COMMA
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_def_instance_count3993);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_countEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_def_instance_count_atom_in_def_instance_count3998);
+ def_instance_count_atom(ctx, initial, maximal);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_countEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop105; /* break out of the loop */
+ break;
+ }
+ }
+ loop105: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_def_instance_count4009);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_countEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_instance_countEx; /* Prevent compiler warnings */
+ ruledef_instance_countEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ if( maximal < initial )
+ {
+ maximal= initial;
+ }
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(46, def_instance_count_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_instance_count */
+
+/**
+ * $ANTLR start def_instance_count_atom
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1620:1: def_instance_count_atom[ sep::avm_size_t & initial , sep::avm_size_t & maximal ] : ( 'init:' n= integer_constant | 'max:' n= integer_constant );
+ */
+static void
+def_instance_count_atom(pfmlParser ctx, sep::avm_size_t & initial, sep::avm_size_t & maximal)
+{
+ ANTLR3_UINT32 def_instance_count_atom_StartIndex;
+
+ sep::avm_size_t n;
+ #undef RETURN_TYPE_n
+ #define RETURN_TYPE_n sep::avm_size_t
+
+ /* Initialize rule variables
+ */
+ def_instance_count_atom_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(47)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1622:2: ( 'init:' n= integer_constant | 'max:' n= integer_constant )
+
+ ANTLR3_UINT32 alt107;
+
+ alt107=2;
+
+ switch ( LA(1) )
+ {
+ case 297:
+ {
+ alt107=1;
+ }
+ break;
+ case 319:
+ {
+ alt107=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 107;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_instance_count_atomEx;
+
+ }
+
+ switch (alt107)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1622:4: 'init:' n= integer_constant
+ {
+ MATCHT(297, &FOLLOW_297_in_def_instance_count_atom4028);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_count_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_integer_constant_in_def_instance_count_atom4032);
+ n=integer_constant(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_count_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ initial=
+ n
+ ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1623:4: 'max:' n= integer_constant
+ {
+ MATCHT(319, &FOLLOW_319_in_def_instance_count_atom4040);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_count_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_integer_constant_in_def_instance_count_atom4045);
+ n=integer_constant(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_instance_count_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ maximal=
+ n
+ ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_instance_count_atomEx; /* Prevent compiler warnings */
+ ruledef_instance_count_atomEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(47, def_instance_count_atom_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_instance_count_atom */
+
+/**
+ * $ANTLR start def_machine
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1627:1: def_machine[ sep::Machine * container ,\n\t\tsep::Modifier mdfr , sep::Specifier spcfr ] returns [ sep::Machine * machine ] : 'machine' ( LT_ ( ( 'moc:' )? executable_specifier[ spcfr ] ( COMMA def_instance_count[ initialCount , maximalCount ] )? | def_instance_count[ initialCount , maximalCount ] )? GT )? id= ID ( StringLiteral )? ( def_machine_parameters[ machine ] )? ( def_machine_returns[ machine , sep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER ] )? def_body_machine[ machine ] ;
+ */
+static sep::Machine *
+def_machine(pfmlParser ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr)
+{
+ sep::Machine * machine;
+
+ ANTLR3_UINT32 def_machine_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ pANTLR3_COMMON_TOKEN StringLiteral5;
+
+ /* Initialize rule variables
+ */
+ def_machine_StartIndex = INDEX();
+
+
+
+ sep::avm_size_t initialCount = 1;
+ sep::avm_size_t maximalCount = AVM_NUMERIC_MAX_SIZE_T;
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(48)) )
+ {
+ {
+
+ POP_CTX;
+
+ SET_RULE_LOCATION(machine);
+
+ }
+ {
+ }
+
+
+
+ return machine;
+ }
+
+ id = NULL;
+ StringLiteral5 = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1642:2: ( 'machine' ( LT_ ( ( 'moc:' )? executable_specifier[ spcfr ] ( COMMA def_instance_count[ initialCount , maximalCount ] )? | def_instance_count[ initialCount , maximalCount ] )? GT )? id= ID ( StringLiteral )? ( def_machine_parameters[ machine ] )? ( def_machine_returns[ machine , sep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER ] )? def_body_machine[ machine ] )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1642:4: 'machine' ( LT_ ( ( 'moc:' )? executable_specifier[ spcfr ] ( COMMA def_instance_count[ initialCount , maximalCount ] )? | def_instance_count[ initialCount , maximalCount ] )? GT )? id= ID ( StringLiteral )? ( def_machine_parameters[ machine ] )? ( def_machine_returns[ machine , sep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER ] )? def_body_machine[ machine ]
+ {
+ MATCHT(317, &FOLLOW_317_in_def_machine4075);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1643:4: ( LT_ ( ( 'moc:' )? executable_specifier[ spcfr ] ( COMMA def_instance_count[ initialCount , maximalCount ] )? | def_instance_count[ initialCount , maximalCount ] )? GT )?
+ {
+ int alt111=2;
+ switch ( LA(1) )
+ {
+ case LT_:
+ {
+ alt111=1;
+ }
+ break;
+ }
+
+ switch (alt111)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1643:6: LT_ ( ( 'moc:' )? executable_specifier[ spcfr ] ( COMMA def_instance_count[ initialCount , maximalCount ] )? | def_instance_count[ initialCount , maximalCount ] )? GT
+ {
+ MATCHT(LT_, &FOLLOW_LT__in_def_machine4082);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1644:5: ( ( 'moc:' )? executable_specifier[ spcfr ] ( COMMA def_instance_count[ initialCount , maximalCount ] )? | def_instance_count[ initialCount , maximalCount ] )?
+ {
+ int alt110=3;
+ switch ( LA(1) )
+ {
+ case ID:
+ case 151:
+ case 152:
+ case 239:
+ case 257:
+ case 282:
+ case 284:
+ case 286:
+ case 312:
+ case 321:
+ case 334:
+ case 364:
+ case 377:
+ {
+ alt110=1;
+ }
+ break;
+ case LBRACKET:
+ case LPAREN:
+ case 308:
+ case 327:
+ {
+ alt110=2;
+ }
+ break;
+ }
+
+ switch (alt110)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1644:7: ( 'moc:' )? executable_specifier[ spcfr ] ( COMMA def_instance_count[ initialCount , maximalCount ] )?
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1644:7: ( 'moc:' )?
+ {
+ int alt108=2;
+ switch ( LA(1) )
+ {
+ case 321:
+ {
+ alt108=1;
+ }
+ break;
+ }
+
+ switch (alt108)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1644:9: 'moc:'
+ {
+ MATCHT(321, &FOLLOW_321_in_def_machine4092);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_executable_specifier_in_def_machine4098);
+ executable_specifier(ctx, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1645:6: ( COMMA def_instance_count[ initialCount , maximalCount ] )?
+ {
+ int alt109=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt109=1;
+ }
+ break;
+ }
+
+ switch (alt109)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1645:8: COMMA def_instance_count[ initialCount , maximalCount ]
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_def_machine4108);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_instance_count_in_def_machine4111);
+ def_instance_count(ctx, initialCount, maximalCount);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1647:7: def_instance_count[ initialCount , maximalCount ]
+ {
+ FOLLOWPUSH(FOLLOW_def_instance_count_in_def_machine4124);
+ def_instance_count(ctx, initialCount, maximalCount);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(GT, &FOLLOW_GT_in_def_machine4137);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_def_machine4147);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ PUSH_CTX_CPM( machine= sep::Machine::newExecutable(
+ container, STR((id->getText(id))->chars), spcfr) );
+
+
+ machine
+ ->getwModifier().override_ifdef( mdfr );
+
+ container->saveOwnedElement( machine
+ );
+
+ machine
+ ->getUniqInstanceSpecifier()->
+ setInstanceCount(initialCount, maximalCount);
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1663:4: ( StringLiteral )?
+ {
+ int alt112=2;
+ switch ( LA(1) )
+ {
+ case StringLiteral:
+ {
+ alt112=1;
+ }
+ break;
+ }
+
+ switch (alt112)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1663:6: StringLiteral
+ {
+ StringLiteral5 = (pANTLR3_COMMON_TOKEN) MATCHT(StringLiteral, &FOLLOW_StringLiteral_in_def_machine4160);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ machine
+ ->setUnrestrictedName(STR((StringLiteral5->getText(StringLiteral5))->chars));
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1667:4: ( def_machine_parameters[ machine ] )?
+ {
+ int alt113=2;
+ switch ( LA(1) )
+ {
+ case LBRACKET:
+ case LPAREN:
+ {
+ alt113=1;
+ }
+ break;
+ }
+
+ switch (alt113)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1667:4: def_machine_parameters[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_def_machine_parameters_in_def_machine4177);
+ def_machine_parameters(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1669:4: ( def_machine_returns[ machine , sep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER ] )?
+ {
+ int alt114=2;
+ switch ( LA(1) )
+ {
+ case 163:
+ case 365:
+ {
+ alt114=1;
+ }
+ break;
+ }
+
+ switch (alt114)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1669:4: def_machine_returns[ machine , sep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER ]
+ {
+ FOLLOWPUSH(FOLLOW_def_machine_returns_in_def_machine4186);
+ def_machine_returns(ctx, machine, sep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_def_body_machine_in_def_machine4195);
+ def_body_machine(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_machineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_machineEx; /* Prevent compiler warnings */
+ ruledef_machineEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ POP_CTX;
+
+ SET_RULE_LOCATION(machine);
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(48, def_machine_StartIndex); }
+
+ return machine;
+}
+/* $ANTLR end def_machine */
+
+/**
+ * $ANTLR start def_body_machine_using_section_header_predicat
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1675:1: def_body_machine_using_section_header_predicat : '@header:' ;
+ */
+static void
+def_body_machine_using_section_header_predicat(pfmlParser ctx)
+{
+ ANTLR3_UINT32 def_body_machine_using_section_header_predicat_StartIndex;
+
+ /* Initialize rule variables
+ */
+ def_body_machine_using_section_header_predicat_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(49)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1676:2: ( '@header:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1676:4: '@header:'
+ {
+ MATCHT(188, &FOLLOW_188_in_def_body_machine_using_section_header_predicat4208);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_using_section_header_predicatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_body_machine_using_section_header_predicatEx; /* Prevent compiler warnings */
+ ruledef_body_machine_using_section_header_predicatEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(49, def_body_machine_using_section_header_predicat_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_body_machine_using_section_header_predicat */
+
+/**
+ * $ANTLR start def_body_machine_using_section_import_predicat
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1679:1: def_body_machine_using_section_import_predicat : '@import:' ;
+ */
+static void
+def_body_machine_using_section_import_predicat(pfmlParser ctx)
+{
+ ANTLR3_UINT32 def_body_machine_using_section_import_predicat_StartIndex;
+
+ /* Initialize rule variables
+ */
+ def_body_machine_using_section_import_predicat_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(50)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1680:2: ( '@import:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1680:4: '@import:'
+ {
+ MATCHT(192, &FOLLOW_192_in_def_body_machine_using_section_import_predicat4219);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_using_section_import_predicatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_body_machine_using_section_import_predicatEx; /* Prevent compiler warnings */
+ ruledef_body_machine_using_section_import_predicatEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(50, def_body_machine_using_section_import_predicat_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_body_machine_using_section_import_predicat */
+
+/**
+ * $ANTLR start def_body_machine_using_section_parameter_predicat
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1683:1: def_body_machine_using_section_parameter_predicat : ( '@parameter:' | '@param:' | '@input:' | '@inout:' | '@output:' | '@returns:' | '@return:' );
+ */
+static void
+def_body_machine_using_section_parameter_predicat(pfmlParser ctx)
+{
+ ANTLR3_UINT32 def_body_machine_using_section_parameter_predicat_StartIndex;
+
+ /* Initialize rule variables
+ */
+ def_body_machine_using_section_parameter_predicat_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(51)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1684:2: ( '@parameter:' | '@param:' | '@input:' | '@inout:' | '@output:' | '@returns:' | '@return:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:
+ {
+ if ( ((LA(1) >= 195) && (LA(1) <= 196)) || LA(1) == 207 || ((LA(1) >= 209) && (LA(1) <= 210)) || ((LA(1) >= 219) && (LA(1) <= 220)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruledef_body_machine_using_section_parameter_predicatEx;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_body_machine_using_section_parameter_predicatEx; /* Prevent compiler warnings */
+ ruledef_body_machine_using_section_parameter_predicatEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(51, def_body_machine_using_section_parameter_predicat_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_body_machine_using_section_parameter_predicat */
+
+/**
+ * $ANTLR start def_body_machine_using_section_property_predicat
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1689:1: def_body_machine_using_section_property_predicat : ( '@property:' | '@public:' | '@protected:' | '@private:' | '@declaration:' );
+ */
+static void
+def_body_machine_using_section_property_predicat(pfmlParser ctx)
+{
+ ANTLR3_UINT32 def_body_machine_using_section_property_predicat_StartIndex;
+
+ /* Initialize rule variables
+ */
+ def_body_machine_using_section_property_predicat_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(52)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1690:2: ( '@property:' | '@public:' | '@protected:' | '@private:' | '@declaration:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:
+ {
+ if ( LA(1) == 178 || LA(1) == 211 || ((LA(1) >= 213) && (LA(1) <= 214)) || LA(1) == 216 )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruledef_body_machine_using_section_property_predicatEx;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_body_machine_using_section_property_predicatEx; /* Prevent compiler warnings */
+ ruledef_body_machine_using_section_property_predicatEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(52, def_body_machine_using_section_property_predicat_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_body_machine_using_section_property_predicat */
+
+/**
+ * $ANTLR start def_body_machine_using_section_predicat
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1695:1: def_body_machine_using_section_predicat : ( def_body_machine_using_section_header_predicat | def_body_machine_using_section_import_predicat | def_body_machine_using_section_parameter_predicat | def_body_machine_using_section_property_predicat | '@macro:' | '@routine' | '@procedure:' | '@composite' | '@machine:' | '@region:' | '@statemachine:' | '@behavior:' | '@transition:' | '@moc:' | '@moe:' | '@com:' | '@interaction:' );
+ */
+static void
+def_body_machine_using_section_predicat(pfmlParser ctx)
+{
+ ANTLR3_UINT32 def_body_machine_using_section_predicat_StartIndex;
+
+ /* Initialize rule variables
+ */
+ def_body_machine_using_section_predicat_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(53)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1696:2: ( def_body_machine_using_section_header_predicat | def_body_machine_using_section_import_predicat | def_body_machine_using_section_parameter_predicat | def_body_machine_using_section_property_predicat | '@macro:' | '@routine' | '@procedure:' | '@composite' | '@machine:' | '@region:' | '@statemachine:' | '@behavior:' | '@transition:' | '@moc:' | '@moe:' | '@com:' | '@interaction:' )
+
+ ANTLR3_UINT32 alt115;
+
+ alt115=17;
+
+ switch ( LA(1) )
+ {
+ case 188:
+ {
+ alt115=1;
+ }
+ break;
+ case 192:
+ {
+ alt115=2;
+ }
+ break;
+ case 195:
+ case 196:
+ case 207:
+ case 209:
+ case 210:
+ case 219:
+ case 220:
+ {
+ alt115=3;
+ }
+ break;
+ case 178:
+ case 211:
+ case 213:
+ case 214:
+ case 216:
+ {
+ alt115=4;
+ }
+ break;
+ case 201:
+ {
+ alt115=5;
+ }
+ break;
+ case 221:
+ {
+ alt115=6;
+ }
+ break;
+ case 212:
+ {
+ alt115=7;
+ }
+ break;
+ case 173:
+ {
+ alt115=8;
+ }
+ break;
+ case 200:
+ {
+ alt115=9;
+ }
+ break;
+ case 217:
+ {
+ alt115=10;
+ }
+ break;
+ case 227:
+ {
+ alt115=11;
+ }
+ break;
+ case 171:
+ {
+ alt115=12;
+ }
+ break;
+ case 231:
+ {
+ alt115=13;
+ }
+ break;
+ case 202:
+ {
+ alt115=14;
+ }
+ break;
+ case 204:
+ {
+ alt115=15;
+ }
+ break;
+ case 172:
+ {
+ alt115=16;
+ }
+ break;
+ case 198:
+ {
+ alt115=17;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 115;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_body_machine_using_section_predicatEx;
+
+ }
+
+ switch (alt115)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1696:4: def_body_machine_using_section_header_predicat
+ {
+ FOLLOWPUSH(FOLLOW_def_body_machine_using_section_header_predicat_in_def_body_machine_using_section_predicat4313);
+ def_body_machine_using_section_header_predicat(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_using_section_predicatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1697:4: def_body_machine_using_section_import_predicat
+ {
+ FOLLOWPUSH(FOLLOW_def_body_machine_using_section_import_predicat_in_def_body_machine_using_section_predicat4318);
+ def_body_machine_using_section_import_predicat(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_using_section_predicatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1698:4: def_body_machine_using_section_parameter_predicat
+ {
+ FOLLOWPUSH(FOLLOW_def_body_machine_using_section_parameter_predicat_in_def_body_machine_using_section_predicat4323);
+ def_body_machine_using_section_parameter_predicat(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_using_section_predicatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1699:4: def_body_machine_using_section_property_predicat
+ {
+ FOLLOWPUSH(FOLLOW_def_body_machine_using_section_property_predicat_in_def_body_machine_using_section_predicat4328);
+ def_body_machine_using_section_property_predicat(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_using_section_predicatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1701:4: '@macro:'
+ {
+ MATCHT(201, &FOLLOW_201_in_def_body_machine_using_section_predicat4334);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_using_section_predicatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1701:16: '@routine'
+ {
+ MATCHT(221, &FOLLOW_221_in_def_body_machine_using_section_predicat4338);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_using_section_predicatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1701:29: '@procedure:'
+ {
+ MATCHT(212, &FOLLOW_212_in_def_body_machine_using_section_predicat4342);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_using_section_predicatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 8:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1703:4: '@composite'
+ {
+ MATCHT(173, &FOLLOW_173_in_def_body_machine_using_section_predicat4348);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_using_section_predicatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 9:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1703:19: '@machine:'
+ {
+ MATCHT(200, &FOLLOW_200_in_def_body_machine_using_section_predicat4352);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_using_section_predicatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 10:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1704:4: '@region:'
+ {
+ MATCHT(217, &FOLLOW_217_in_def_body_machine_using_section_predicat4357);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_using_section_predicatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 11:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1704:19: '@statemachine:'
+ {
+ MATCHT(227, &FOLLOW_227_in_def_body_machine_using_section_predicat4363);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_using_section_predicatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 12:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1706:4: '@behavior:'
+ {
+ MATCHT(171, &FOLLOW_171_in_def_body_machine_using_section_predicat4369);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_using_section_predicatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 13:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1706:19: '@transition:'
+ {
+ MATCHT(231, &FOLLOW_231_in_def_body_machine_using_section_predicat4373);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_using_section_predicatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 14:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1709:4: '@moc:'
+ {
+ MATCHT(202, &FOLLOW_202_in_def_body_machine_using_section_predicat4381);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_using_section_predicatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 15:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1709:14: '@moe:'
+ {
+ MATCHT(204, &FOLLOW_204_in_def_body_machine_using_section_predicat4385);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_using_section_predicatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 16:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1709:24: '@com:'
+ {
+ MATCHT(172, &FOLLOW_172_in_def_body_machine_using_section_predicat4389);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_using_section_predicatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 17:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1709:34: '@interaction:'
+ {
+ MATCHT(198, &FOLLOW_198_in_def_body_machine_using_section_predicat4393);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_using_section_predicatEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_body_machine_using_section_predicatEx; /* Prevent compiler warnings */
+ ruledef_body_machine_using_section_predicatEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(53, def_body_machine_using_section_predicat_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_body_machine_using_section_predicat */
+
+/**
+ * $ANTLR start def_body_machine
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1713:1: def_body_machine[ sep::Machine * machine ] : LCURLY def_body_machine_section[ machine ] RCURLY ;
+ */
+static void
+def_body_machine(pfmlParser ctx, sep::Machine * machine)
+{
+ ANTLR3_UINT32 def_body_machine_StartIndex;
+
+ /* Initialize rule variables
+ */
+ def_body_machine_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(54)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1714:2: ( LCURLY def_body_machine_section[ machine ] RCURLY )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1714:4: LCURLY def_body_machine_section[ machine ] RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_def_body_machine4407);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machineEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_body_machine_section_in_def_body_machine4424);
+ def_body_machine_section(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machineEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_def_body_machine4437);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machineEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_body_machineEx; /* Prevent compiler warnings */
+ ruledef_body_machineEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(54, def_body_machine_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_body_machine */
+
+/**
+ * $ANTLR start def_body_machine_section
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1722:1: def_body_machine_section[ sep::Machine * machine ] : ( section_header[ machine ] )? ( section_import[ machine ] )? ( section_parameter[ machine ] )* ( section_property[ machine ] )* ( section_composite_structure[ machine ] )* ( section_behavior[ machine ] | section_statemachine[ machine ] )? ( section_model_of_computation[ machine ] | section_model_of_execution[ machine ] | section_model_of_interaction[ machine ] )* ;
+ */
+static void
+def_body_machine_section(pfmlParser ctx, sep::Machine * machine)
+{
+ ANTLR3_UINT32 def_body_machine_section_StartIndex;
+
+ /* Initialize rule variables
+ */
+ def_body_machine_section_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(55)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1723:2: ( ( section_header[ machine ] )? ( section_import[ machine ] )? ( section_parameter[ machine ] )* ( section_property[ machine ] )* ( section_composite_structure[ machine ] )* ( section_behavior[ machine ] | section_statemachine[ machine ] )? ( section_model_of_computation[ machine ] | section_model_of_execution[ machine ] | section_model_of_interaction[ machine ] )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1723:4: ( section_header[ machine ] )? ( section_import[ machine ] )? ( section_parameter[ machine ] )* ( section_property[ machine ] )* ( section_composite_structure[ machine ] )* ( section_behavior[ machine ] | section_statemachine[ machine ] )? ( section_model_of_computation[ machine ] | section_model_of_execution[ machine ] | section_model_of_interaction[ machine ] )*
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1723:4: ( section_header[ machine ] )?
+ {
+ int alt116=2;
+ switch ( LA(1) )
+ {
+ case 188:
+ {
+ alt116=1;
+ }
+ break;
+ }
+
+ switch (alt116)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1723:4: section_header[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_header_in_def_body_machine_section4450);
+ section_header(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1724:4: ( section_import[ machine ] )?
+ {
+ int alt117=2;
+ switch ( LA(1) )
+ {
+ case 192:
+ {
+ alt117=1;
+ }
+ break;
+ }
+
+ switch (alt117)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1724:4: section_import[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_import_in_def_body_machine_section4458);
+ section_import(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1726:4: ( section_parameter[ machine ] )*
+
+ for (;;)
+ {
+ int alt118=2;
+ switch ( LA(1) )
+ {
+ case 195:
+ case 196:
+ case 207:
+ case 209:
+ case 210:
+ case 219:
+ case 220:
+ {
+ alt118=1;
+ }
+ break;
+
+ }
+
+ switch (alt118)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1726:6: section_parameter[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_parameter_in_def_body_machine_section4469);
+ section_parameter(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop118; /* break out of the loop */
+ break;
+ }
+ }
+ loop118: ; /* Jump out to here if this rule does not match */
+
+
+ if ( BACKTRACKING==0 )
+ {
+ sep::TemplateFactory::genProperty( machine );
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1731:4: ( section_property[ machine ] )*
+
+ for (;;)
+ {
+ int alt119=2;
+ switch ( LA(1) )
+ {
+ case 178:
+ case 211:
+ case 213:
+ case 214:
+ case 216:
+ {
+ alt119=1;
+ }
+ break;
+
+ }
+
+ switch (alt119)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1731:6: section_property[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_property_in_def_body_machine_section4491);
+ section_property(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop119; /* break out of the loop */
+ break;
+ }
+ }
+ loop119: ; /* Jump out to here if this rule does not match */
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1733:4: ( section_composite_structure[ machine ] )*
+
+ for (;;)
+ {
+ int alt120=2;
+ switch ( LA(1) )
+ {
+ case 174:
+ case 183:
+ case 197:
+ case 200:
+ case 201:
+ case 203:
+ case 212:
+ case 215:
+ case 222:
+ {
+ alt120=1;
+ }
+ break;
+
+ }
+
+ switch (alt120)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1733:6: section_composite_structure[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_composite_structure_in_def_body_machine_section4504);
+ section_composite_structure(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop120; /* break out of the loop */
+ break;
+ }
+ }
+ loop120: ; /* Jump out to here if this rule does not match */
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1735:4: ( section_behavior[ machine ] | section_statemachine[ machine ] )?
+ {
+ int alt121=3;
+ switch ( LA(1) )
+ {
+ case 171:
+ {
+ alt121=1;
+ }
+ break;
+ case 227:
+ {
+ alt121=2;
+ }
+ break;
+ }
+
+ switch (alt121)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1735:6: section_behavior[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_behavior_in_def_body_machine_section4516);
+ section_behavior(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1736:6: section_statemachine[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_statemachine_in_def_body_machine_section4524);
+ section_statemachine(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+ sep::TemplateFactory::genBehavior(machine);
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1742:4: ( section_model_of_computation[ machine ] | section_model_of_execution[ machine ] | section_model_of_interaction[ machine ] )*
+
+ for (;;)
+ {
+ int alt122=4;
+ switch ( LA(1) )
+ {
+ case 202:
+ {
+ alt122=1;
+ }
+ break;
+ case 204:
+ {
+ alt122=2;
+ }
+ break;
+ case 172:
+ case 198:
+ {
+ alt122=3;
+ }
+ break;
+
+ }
+
+ switch (alt122)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1742:6: section_model_of_computation[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_model_of_computation_in_def_body_machine_section4549);
+ section_model_of_computation(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1743:6: section_model_of_execution[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_model_of_execution_in_def_body_machine_section4557);
+ section_model_of_execution(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1744:6: section_model_of_interaction[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_model_of_interaction_in_def_body_machine_section4565);
+ section_model_of_interaction(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop122; /* break out of the loop */
+ break;
+ }
+ }
+ loop122: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_body_machine_sectionEx; /* Prevent compiler warnings */
+ ruledef_body_machine_sectionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(55, def_body_machine_section_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_body_machine_section */
+
+/**
+ * $ANTLR start def_body_machine_simplif
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1748:1: def_body_machine_simplif[ sep::Machine * machine ] : ( ( property_declaration[ declProperty ,\n\t\t\t\tsep::Modifier::PROPERTY_UNDEFINED_MODIFIER ] )* | ( def_moe_primitive[ machine ] )+ ) ;
+ */
+static void
+def_body_machine_simplif(pfmlParser ctx, sep::Machine * machine)
+{
+ ANTLR3_UINT32 def_body_machine_simplif_StartIndex;
+
+ /* Initialize rule variables
+ */
+ def_body_machine_simplif_StartIndex = INDEX();
+
+
+
+ sep::PropertyPart & declProperty = machine->getPropertyPart();
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(56)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1752:2: ( ( ( property_declaration[ declProperty ,\n\t\t\t\tsep::Modifier::PROPERTY_UNDEFINED_MODIFIER ] )* | ( def_moe_primitive[ machine ] )+ ) )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1752:4: ( ( property_declaration[ declProperty ,\n\t\t\t\tsep::Modifier::PROPERTY_UNDEFINED_MODIFIER ] )* | ( def_moe_primitive[ machine ] )+ )
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1752:4: ( ( property_declaration[ declProperty ,\n\t\t\t\tsep::Modifier::PROPERTY_UNDEFINED_MODIFIER ] )* | ( def_moe_primitive[ machine ] )+ )
+ {
+ int alt125=2;
+ switch ( LA(1) )
+ {
+ case EOF:
+ case 243:
+ case 249:
+ case 253:
+ case 257:
+ case 258:
+ case 259:
+ case 262:
+ case 276:
+ case 282:
+ case 298:
+ case 305:
+ case 318:
+ case 320:
+ case 341:
+ case 344:
+ case 349:
+ case 355:
+ case 361:
+ case 364:
+ case 374:
+ case 380:
+ case 388:
+ case 395:
+ case 398:
+ case 404:
+ case 406:
+ case 410:
+ case 411:
+ case 414:
+ {
+ alt125=1;
+ }
+ break;
+ case 170:
+ case 175:
+ case 177:
+ case 179:
+ case 182:
+ case 184:
+ case 189:
+ case 190:
+ case 191:
+ case 194:
+ case 199:
+ case 218:
+ case 223:
+ case 224:
+ case 225:
+ case 226:
+ case 228:
+ case 367:
+ {
+ alt125=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 125;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_body_machine_simplifEx;
+
+ }
+
+ switch (alt125)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1752:6: ( property_declaration[ declProperty ,\n\t\t\t\tsep::Modifier::PROPERTY_UNDEFINED_MODIFIER ] )*
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1752:6: ( property_declaration[ declProperty ,\n\t\t\t\tsep::Modifier::PROPERTY_UNDEFINED_MODIFIER ] )*
+
+ for (;;)
+ {
+ int alt123=2;
+ switch ( LA(1) )
+ {
+ case 243:
+ case 249:
+ case 253:
+ case 257:
+ case 258:
+ case 259:
+ case 262:
+ case 276:
+ case 282:
+ case 298:
+ case 305:
+ case 318:
+ case 320:
+ case 341:
+ case 344:
+ case 349:
+ case 355:
+ case 361:
+ case 364:
+ case 374:
+ case 380:
+ case 388:
+ case 395:
+ case 398:
+ case 404:
+ case 406:
+ case 410:
+ case 411:
+ case 414:
+ {
+ alt123=1;
+ }
+ break;
+
+ }
+
+ switch (alt123)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1752:8: property_declaration[ declProperty ,\n\t\t\t\tsep::Modifier::PROPERTY_UNDEFINED_MODIFIER ]
+ {
+ FOLLOWPUSH(FOLLOW_property_declaration_in_def_body_machine_simplif4593);
+ property_declaration(ctx, declProperty, sep::Modifier::PROPERTY_UNDEFINED_MODIFIER);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_simplifEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop123; /* break out of the loop */
+ break;
+ }
+ }
+ loop123: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1756:6: ( def_moe_primitive[ machine ] )+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1756:6: ( def_moe_primitive[ machine ] )+
+ {
+ int cnt124=0;
+
+ for (;;)
+ {
+ int alt124=2;
+ switch ( LA(1) )
+ {
+ case 170:
+ case 175:
+ case 177:
+ case 179:
+ case 182:
+ case 184:
+ case 189:
+ case 190:
+ case 191:
+ case 194:
+ case 199:
+ case 218:
+ case 223:
+ case 224:
+ case 225:
+ case 226:
+ case 228:
+ case 367:
+ {
+ alt124=1;
+ }
+ break;
+
+ }
+
+ switch (alt124)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1756:8: def_moe_primitive[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_def_moe_primitive_in_def_body_machine_simplif4609);
+ def_moe_primitive(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_machine_simplifEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt124 >= 1 )
+ {
+ goto loop124;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruledef_body_machine_simplifEx;
+ }
+ cnt124++;
+ }
+ loop124: ; /* Jump to here if this rule does not match */
+ }
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_body_machine_simplifEx; /* Prevent compiler warnings */
+ ruledef_body_machine_simplifEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(56, def_body_machine_simplif_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_body_machine_simplif */
+
+/**
+ * $ANTLR start any_def_statemachine
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1764:1: any_def_statemachine[ sep::Machine * container ,\n\t\tsep::Modifier mdfr , sep::Specifier spcfr ] returns [ sep::Machine * machine ] : (ms= executable_modifier_specifier )? (st= def_state_singleton[ container , mdfr , spcfr ] |st= def_state[ container , mdfr , spcfr ] |sm= def_statemachine[ container , mdfr , spcfr ] ) ;
+ */
+static sep::Machine *
+any_def_statemachine(pfmlParser ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr)
+{
+ sep::Machine * machine;
+
+ ANTLR3_UINT32 any_def_statemachine_StartIndex;
+
+ fmlParser_executable_modifier_specifier_return ms;
+ #undef RETURN_TYPE_ms
+ #define RETURN_TYPE_ms fmlParser_executable_modifier_specifier_return
+
+ sep::Machine * st;
+ #undef RETURN_TYPE_st
+ #define RETURN_TYPE_st sep::Machine *
+
+ sep::Machine * sm;
+ #undef RETURN_TYPE_sm
+ #define RETURN_TYPE_sm sep::Machine *
+
+ /* Initialize rule variables
+ */
+ any_def_statemachine_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(57)) )
+ {
+ {
+ }
+
+
+
+ return machine;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1768:2: ( (ms= executable_modifier_specifier )? (st= def_state_singleton[ container , mdfr , spcfr ] |st= def_state[ container , mdfr , spcfr ] |sm= def_statemachine[ container , mdfr , spcfr ] ) )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1768:4: (ms= executable_modifier_specifier )? (st= def_state_singleton[ container , mdfr , spcfr ] |st= def_state[ container , mdfr , spcfr ] |sm= def_statemachine[ container , mdfr , spcfr ] )
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1768:4: (ms= executable_modifier_specifier )?
+ {
+ int alt126=2;
+ switch ( LA(1) )
+ {
+ case 272:
+ case 306:
+ case 314:
+ case 322:
+ case 353:
+ case 393:
+ case 406:
+ {
+ alt126=1;
+ }
+ break;
+ }
+
+ switch (alt126)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1768:6: ms= executable_modifier_specifier
+ {
+ FOLLOWPUSH(FOLLOW_executable_modifier_specifier_in_any_def_statemachine4644);
+ ms=executable_modifier_specifier(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleany_def_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.override_ifdef( ms.mdfr
+ ); spcfr.override_ifdef( ms.spcfr
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1772:4: (st= def_state_singleton[ container , mdfr , spcfr ] |st= def_state[ container , mdfr , spcfr ] |sm= def_statemachine[ container , mdfr , spcfr ] )
+ {
+ int alt127=3;
+ switch ( LA(1) )
+ {
+ case 144:
+ case 145:
+ case 147:
+ case 148:
+ case 149:
+ case 150:
+ case 153:
+ {
+ alt127=1;
+ }
+ break;
+ case 378:
+ {
+ alt127=2;
+ }
+ break;
+ case 379:
+ {
+ alt127=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return machine;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 127;
+ EXCEPTION->state = 0;
+
+
+ goto ruleany_def_statemachineEx;
+
+ }
+
+ switch (alt127)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1772:7: st= def_state_singleton[ container , mdfr , spcfr ]
+ {
+ FOLLOWPUSH(FOLLOW_def_state_singleton_in_any_def_statemachine4666);
+ st=def_state_singleton(ctx, container, mdfr, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleany_def_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ machine=
+ st
+ ;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1775:6: st= def_state[ container , mdfr , spcfr ]
+ {
+ FOLLOWPUSH(FOLLOW_def_state_in_any_def_statemachine4682);
+ st=def_state(ctx, container, mdfr, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleany_def_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ machine=
+ st
+ ;
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1778:6: sm= def_statemachine[ container , mdfr , spcfr ]
+ {
+ FOLLOWPUSH(FOLLOW_def_statemachine_in_any_def_statemachine4698);
+ sm=def_statemachine(ctx, container, mdfr, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleany_def_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ machine=
+ sm
+ ;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleany_def_statemachineEx; /* Prevent compiler warnings */
+ ruleany_def_statemachineEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(57, any_def_statemachine_StartIndex); }
+
+ return machine;
+}
+/* $ANTLR end any_def_statemachine */
+
+/**
+ * $ANTLR start def_statemachine
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1784:1: def_statemachine[ sep::Machine * container ,\n\t\tsep::Modifier mdfr , sep::Specifier spcfr ] returns [ sep::Machine * machine ] : 'statemachine' ( LT_ ( ( 'moc:' )? executable_specifier[ spcfr ] ( COMMA def_instance_count[ initialCount , maximalCount ] )? | def_instance_count[ initialCount , maximalCount ] )? GT )? (id= ID | ( LBRACKET | LBRACKET_EXCEPT ) (id= ID ( COMMA id= ID )* | STAR ) RBRACKET ) ( StringLiteral )? ( def_machine_parameters[ machine ] )? ( def_machine_returns[ machine , sep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER ] )? def_body_statemachine[ machine ] ;
+ */
+static sep::Machine *
+def_statemachine(pfmlParser ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr)
+{
+ sep::Machine * machine;
+
+ ANTLR3_UINT32 def_statemachine_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ pANTLR3_COMMON_TOKEN StringLiteral6;
+
+ /* Initialize rule variables
+ */
+ def_statemachine_StartIndex = INDEX();
+
+
+
+ // resetTransitionID();
+ resetConnectID();
+ resetBufferID();
+
+ sep::avm_size_t initialCount = 1;
+ sep::avm_size_t maximalCount = AVM_NUMERIC_MAX_SIZE_T;
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(58)) )
+ {
+ {
+
+ POP_CTX;
+
+ SET_RULE_LOCATION(machine);
+
+ }
+ {
+ }
+
+
+
+ return machine;
+ }
+
+ id = NULL;
+ StringLiteral6 = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1803:2: ( 'statemachine' ( LT_ ( ( 'moc:' )? executable_specifier[ spcfr ] ( COMMA def_instance_count[ initialCount , maximalCount ] )? | def_instance_count[ initialCount , maximalCount ] )? GT )? (id= ID | ( LBRACKET | LBRACKET_EXCEPT ) (id= ID ( COMMA id= ID )* | STAR ) RBRACKET ) ( StringLiteral )? ( def_machine_parameters[ machine ] )? ( def_machine_returns[ machine , sep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER ] )? def_body_statemachine[ machine ] )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1803:4: 'statemachine' ( LT_ ( ( 'moc:' )? executable_specifier[ spcfr ] ( COMMA def_instance_count[ initialCount , maximalCount ] )? | def_instance_count[ initialCount , maximalCount ] )? GT )? (id= ID | ( LBRACKET | LBRACKET_EXCEPT ) (id= ID ( COMMA id= ID )* | STAR ) RBRACKET ) ( StringLiteral )? ( def_machine_parameters[ machine ] )? ( def_machine_returns[ machine , sep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER ] )? def_body_statemachine[ machine ]
+ {
+ MATCHT(379, &FOLLOW_379_in_def_statemachine4736);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1804:4: ( LT_ ( ( 'moc:' )? executable_specifier[ spcfr ] ( COMMA def_instance_count[ initialCount , maximalCount ] )? | def_instance_count[ initialCount , maximalCount ] )? GT )?
+ {
+ int alt131=2;
+ switch ( LA(1) )
+ {
+ case LT_:
+ {
+ alt131=1;
+ }
+ break;
+ }
+
+ switch (alt131)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1804:6: LT_ ( ( 'moc:' )? executable_specifier[ spcfr ] ( COMMA def_instance_count[ initialCount , maximalCount ] )? | def_instance_count[ initialCount , maximalCount ] )? GT
+ {
+ MATCHT(LT_, &FOLLOW_LT__in_def_statemachine4743);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1805:5: ( ( 'moc:' )? executable_specifier[ spcfr ] ( COMMA def_instance_count[ initialCount , maximalCount ] )? | def_instance_count[ initialCount , maximalCount ] )?
+ {
+ int alt130=3;
+ switch ( LA(1) )
+ {
+ case ID:
+ case 151:
+ case 152:
+ case 239:
+ case 257:
+ case 282:
+ case 284:
+ case 286:
+ case 312:
+ case 321:
+ case 334:
+ case 364:
+ case 377:
+ {
+ alt130=1;
+ }
+ break;
+ case LBRACKET:
+ case LPAREN:
+ case 308:
+ case 327:
+ {
+ alt130=2;
+ }
+ break;
+ }
+
+ switch (alt130)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1805:7: ( 'moc:' )? executable_specifier[ spcfr ] ( COMMA def_instance_count[ initialCount , maximalCount ] )?
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1805:7: ( 'moc:' )?
+ {
+ int alt128=2;
+ switch ( LA(1) )
+ {
+ case 321:
+ {
+ alt128=1;
+ }
+ break;
+ }
+
+ switch (alt128)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1805:9: 'moc:'
+ {
+ MATCHT(321, &FOLLOW_321_in_def_statemachine4753);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_executable_specifier_in_def_statemachine4759);
+ executable_specifier(ctx, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1806:6: ( COMMA def_instance_count[ initialCount , maximalCount ] )?
+ {
+ int alt129=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt129=1;
+ }
+ break;
+ }
+
+ switch (alt129)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1806:8: COMMA def_instance_count[ initialCount , maximalCount ]
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_def_statemachine4769);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_instance_count_in_def_statemachine4772);
+ def_instance_count(ctx, initialCount, maximalCount);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1808:7: def_instance_count[ initialCount , maximalCount ]
+ {
+ FOLLOWPUSH(FOLLOW_def_instance_count_in_def_statemachine4785);
+ def_instance_count(ctx, initialCount, maximalCount);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(GT, &FOLLOW_GT_in_def_statemachine4798);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1813:4: (id= ID | ( LBRACKET | LBRACKET_EXCEPT ) (id= ID ( COMMA id= ID )* | STAR ) RBRACKET )
+ {
+ int alt135=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt135=1;
+ }
+ break;
+ case LBRACKET:
+ case LBRACKET_EXCEPT:
+ {
+ alt135=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return machine;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 135;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_statemachineEx;
+
+ }
+
+ switch (alt135)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1813:6: id= ID
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_def_statemachine4814);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ if( spcfr.isUndefined() )
+ {
+ spcfr.setComponentExecutable();
+ }
+ PUSH_CTX_CPM( machine= sep::Machine::newStatemachine(
+ container, STR((id->getText(id))->chars), spcfr) );
+
+
+ machine
+ ->getwModifier().override_ifdef( mdfr );
+
+ container->saveOwnedElement( machine
+ );
+
+ machine
+ ->getUniqInstanceSpecifier()->
+ setInstanceCount(initialCount, maximalCount);
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1830:6: ( LBRACKET | LBRACKET_EXCEPT ) (id= ID ( COMMA id= ID )* | STAR ) RBRACKET
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1830:6: ( LBRACKET | LBRACKET_EXCEPT )
+ {
+ int alt132=2;
+ switch ( LA(1) )
+ {
+ case LBRACKET:
+ {
+ alt132=1;
+ }
+ break;
+ case LBRACKET_EXCEPT:
+ {
+ alt132=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return machine;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 132;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_statemachineEx;
+
+ }
+
+ switch (alt132)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1830:8: LBRACKET
+ {
+ MATCHT(LBRACKET, &FOLLOW_LBRACKET_in_def_statemachine4828);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ spcfr.setGroupSome();
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1831:8: LBRACKET_EXCEPT
+ {
+ MATCHT(LBRACKET_EXCEPT, &FOLLOW_LBRACKET_EXCEPT_in_def_statemachine4847);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ spcfr.setGroupExcept();
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+
+ PUSH_CTX_CPM( machine= sep::Machine::newStatemachine(
+ container, "[]", spcfr/*, type*/) );
+
+
+ machine
+ ->getwModifier().override_ifdef( mdfr );
+
+ container->saveOwnedElement( machine
+ );
+
+ machine
+ ->getUniqInstanceSpecifier()->
+ setInstanceCount(initialCount, maximalCount);
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1845:6: (id= ID ( COMMA id= ID )* | STAR )
+ {
+ int alt134=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt134=1;
+ }
+ break;
+ case STAR:
+ {
+ alt134=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return machine;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 134;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_statemachineEx;
+
+ }
+
+ switch (alt134)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1845:8: id= ID ( COMMA id= ID )*
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_def_statemachine4873);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ machine
+ ->appendGroupId( STR((id->getText(id))->chars) );
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1846:8: ( COMMA id= ID )*
+
+ for (;;)
+ {
+ int alt133=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt133=1;
+ }
+ break;
+
+ }
+
+ switch (alt133)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1846:10: COMMA id= ID
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_def_statemachine4895);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_def_statemachine4899);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ machine
+ ->appendGroupId( STR((id->getText(id))->chars) );
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop133; /* break out of the loop */
+ break;
+ }
+ }
+ loop133: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1848:8: STAR
+ {
+ MATCHT(STAR, &FOLLOW_STAR_in_def_statemachine4915);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ machine
+ ->getwSpecifier().setGroupEvery();
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(RBRACKET, &FOLLOW_RBRACKET_in_def_statemachine4936);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ machine
+ ->setGroupId();
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1854:4: ( StringLiteral )?
+ {
+ int alt136=2;
+ switch ( LA(1) )
+ {
+ case StringLiteral:
+ {
+ alt136=1;
+ }
+ break;
+ }
+
+ switch (alt136)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1854:6: StringLiteral
+ {
+ StringLiteral6 = (pANTLR3_COMMON_TOKEN) MATCHT(StringLiteral, &FOLLOW_StringLiteral_in_def_statemachine4953);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ machine
+ ->setUnrestrictedName(STR((StringLiteral6->getText(StringLiteral6))->chars));
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1858:4: ( def_machine_parameters[ machine ] )?
+ {
+ int alt137=2;
+ switch ( LA(1) )
+ {
+ case LBRACKET:
+ case LPAREN:
+ {
+ alt137=1;
+ }
+ break;
+ }
+
+ switch (alt137)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1858:4: def_machine_parameters[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_def_machine_parameters_in_def_statemachine4970);
+ def_machine_parameters(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1860:4: ( def_machine_returns[ machine , sep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER ] )?
+ {
+ int alt138=2;
+ switch ( LA(1) )
+ {
+ case 163:
+ case 365:
+ {
+ alt138=1;
+ }
+ break;
+ }
+
+ switch (alt138)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1860:4: def_machine_returns[ machine , sep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER ]
+ {
+ FOLLOWPUSH(FOLLOW_def_machine_returns_in_def_statemachine4979);
+ def_machine_returns(ctx, machine, sep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_def_body_statemachine_in_def_statemachine4988);
+ def_body_statemachine(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return machine;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_statemachineEx; /* Prevent compiler warnings */
+ ruledef_statemachineEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ POP_CTX;
+
+ SET_RULE_LOCATION(machine);
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(58, def_statemachine_StartIndex); }
+
+ return machine;
+}
+/* $ANTLR end def_statemachine */
+
+/**
+ * $ANTLR start def_body_statemachine
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1923:1: def_body_statemachine[ sep::Machine * machine ] : LCURLY ( section_header[ machine ] )? ( section_import[ machine ] )? ( section_parameter[ machine ] )* ( section_property[ machine ] )* ( section_composite_structure[ machine ] )* ( section_region[ machine ] )? ( section_transition[ machine ] )? ( section_model_of_computation[ machine ] | section_model_of_execution[ machine ] | section_model_of_interaction[ machine ] )* RCURLY ;
+ */
+static void
+def_body_statemachine(pfmlParser ctx, sep::Machine * machine)
+{
+ ANTLR3_UINT32 def_body_statemachine_StartIndex;
+
+ /* Initialize rule variables
+ */
+ def_body_statemachine_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(59)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1924:2: ( LCURLY ( section_header[ machine ] )? ( section_import[ machine ] )? ( section_parameter[ machine ] )* ( section_property[ machine ] )* ( section_composite_structure[ machine ] )* ( section_region[ machine ] )? ( section_transition[ machine ] )? ( section_model_of_computation[ machine ] | section_model_of_execution[ machine ] | section_model_of_interaction[ machine ] )* RCURLY )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1924:4: LCURLY ( section_header[ machine ] )? ( section_import[ machine ] )? ( section_parameter[ machine ] )* ( section_property[ machine ] )* ( section_composite_structure[ machine ] )* ( section_region[ machine ] )? ( section_transition[ machine ] )? ( section_model_of_computation[ machine ] | section_model_of_execution[ machine ] | section_model_of_interaction[ machine ] )* RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_def_body_statemachine5007);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1925:4: ( section_header[ machine ] )?
+ {
+ int alt139=2;
+ switch ( LA(1) )
+ {
+ case 188:
+ {
+ alt139=1;
+ }
+ break;
+ }
+
+ switch (alt139)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1925:4: section_header[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_header_in_def_body_statemachine5012);
+ section_header(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1926:4: ( section_import[ machine ] )?
+ {
+ int alt140=2;
+ switch ( LA(1) )
+ {
+ case 192:
+ {
+ alt140=1;
+ }
+ break;
+ }
+
+ switch (alt140)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1926:4: section_import[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_import_in_def_body_statemachine5020);
+ section_import(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1928:4: ( section_parameter[ machine ] )*
+
+ for (;;)
+ {
+ int alt141=2;
+ switch ( LA(1) )
+ {
+ case 195:
+ case 196:
+ case 207:
+ case 209:
+ case 210:
+ case 219:
+ case 220:
+ {
+ alt141=1;
+ }
+ break;
+
+ }
+
+ switch (alt141)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1928:6: section_parameter[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_parameter_in_def_body_statemachine5031);
+ section_parameter(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop141; /* break out of the loop */
+ break;
+ }
+ }
+ loop141: ; /* Jump out to here if this rule does not match */
+
+
+ if ( BACKTRACKING==0 )
+ {
+ sep::TemplateFactory::genProperty( machine );
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1933:4: ( section_property[ machine ] )*
+
+ for (;;)
+ {
+ int alt142=2;
+ switch ( LA(1) )
+ {
+ case 178:
+ case 211:
+ case 213:
+ case 214:
+ case 216:
+ {
+ alt142=1;
+ }
+ break;
+
+ }
+
+ switch (alt142)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1933:6: section_property[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_property_in_def_body_statemachine5053);
+ section_property(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop142; /* break out of the loop */
+ break;
+ }
+ }
+ loop142: ; /* Jump out to here if this rule does not match */
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1935:4: ( section_composite_structure[ machine ] )*
+
+ for (;;)
+ {
+ int alt143=2;
+ switch ( LA(1) )
+ {
+ case 174:
+ case 183:
+ case 197:
+ case 200:
+ case 201:
+ case 203:
+ case 212:
+ case 215:
+ case 222:
+ {
+ alt143=1;
+ }
+ break;
+
+ }
+
+ switch (alt143)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1935:6: section_composite_structure[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_composite_structure_in_def_body_statemachine5066);
+ section_composite_structure(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop143; /* break out of the loop */
+ break;
+ }
+ }
+ loop143: ; /* Jump out to here if this rule does not match */
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1937:4: ( section_region[ machine ] )?
+ {
+ int alt144=2;
+ switch ( LA(1) )
+ {
+ case 217:
+ {
+ alt144=1;
+ }
+ break;
+ }
+
+ switch (alt144)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1937:4: section_region[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_region_in_def_body_statemachine5076);
+ section_region(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1939:4: ( section_transition[ machine ] )?
+ {
+ int alt145=2;
+ switch ( LA(1) )
+ {
+ case 231:
+ {
+ alt145=1;
+ }
+ break;
+ }
+
+ switch (alt145)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1939:4: section_transition[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_transition_in_def_body_statemachine5085);
+ section_transition(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+ sep::TemplateFactory::genBehavior(machine);
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1944:4: ( section_model_of_computation[ machine ] | section_model_of_execution[ machine ] | section_model_of_interaction[ machine ] )*
+
+ for (;;)
+ {
+ int alt146=4;
+ switch ( LA(1) )
+ {
+ case 202:
+ {
+ alt146=1;
+ }
+ break;
+ case 204:
+ {
+ alt146=2;
+ }
+ break;
+ case 172:
+ case 198:
+ {
+ alt146=3;
+ }
+ break;
+
+ }
+
+ switch (alt146)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1944:6: section_model_of_computation[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_model_of_computation_in_def_body_statemachine5106);
+ section_model_of_computation(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1945:6: section_model_of_execution[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_model_of_execution_in_def_body_statemachine5114);
+ section_model_of_execution(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1946:6: section_model_of_interaction[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_model_of_interaction_in_def_body_statemachine5122);
+ section_model_of_interaction(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop146; /* break out of the loop */
+ break;
+ }
+ }
+ loop146: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_def_body_statemachine5134);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_body_statemachineEx; /* Prevent compiler warnings */
+ ruledef_body_statemachineEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(59, def_body_statemachine_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_body_statemachine */
+
+/**
+ * $ANTLR start section_region
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1952:1: section_region[ sep::Machine * container ] : '@region:' (m= any_def_statemachine[ container , mdfr , spcfr ] )+ ;
+ */
+static void
+section_region(pfmlParser ctx, sep::Machine * container)
+{
+ ANTLR3_UINT32 section_region_StartIndex;
+
+ sep::Machine * m;
+ #undef RETURN_TYPE_m
+ #define RETURN_TYPE_m sep::Machine *
+
+ /* Initialize rule variables
+ */
+ section_region_StartIndex = INDEX();
+
+
+
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(60)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1958:2: ( '@region:' (m= any_def_statemachine[ container , mdfr , spcfr ] )+ )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1958:4: '@region:' (m= any_def_statemachine[ container , mdfr , spcfr ] )+
+ {
+ MATCHT(217, &FOLLOW_217_in_section_region5152);
+ if (HASEXCEPTION())
+ {
+ goto rulesection_regionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ container->getwSpecifier().setMocStateTransitionSystem();
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1961:4: (m= any_def_statemachine[ container , mdfr , spcfr ] )+
+ {
+ int cnt147=0;
+
+ for (;;)
+ {
+ int alt147=2;
+ switch ( LA(1) )
+ {
+ case 144:
+ case 145:
+ case 147:
+ case 148:
+ case 149:
+ case 150:
+ case 153:
+ case 272:
+ case 306:
+ case 314:
+ case 322:
+ case 353:
+ case 378:
+ case 379:
+ case 393:
+ case 406:
+ {
+ alt147=1;
+ }
+ break;
+
+ }
+
+ switch (alt147)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1961:6: m= any_def_statemachine[ container , mdfr , spcfr ]
+ {
+ FOLLOWPUSH(FOLLOW_any_def_statemachine_in_section_region5167);
+ m=any_def_statemachine(ctx, container, mdfr, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_regionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt147 >= 1 )
+ {
+ goto loop147;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto rulesection_regionEx;
+ }
+ cnt147++;
+ }
+ loop147: ; /* Jump to here if this rule does not match */
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulesection_regionEx; /* Prevent compiler warnings */
+ rulesection_regionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(60, section_region_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end section_region */
+
+/**
+ * $ANTLR start section_statemachine
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1964:1: section_statemachine[ sep::Machine * container ] : '@statemachine:' (m= any_def_statemachine[ container , mdfr , spcfr ] )+ ;
+ */
+static void
+section_statemachine(pfmlParser ctx, sep::Machine * container)
+{
+ ANTLR3_UINT32 section_statemachine_StartIndex;
+
+ sep::Machine * m;
+ #undef RETURN_TYPE_m
+ #define RETURN_TYPE_m sep::Machine *
+
+ /* Initialize rule variables
+ */
+ section_statemachine_StartIndex = INDEX();
+
+
+
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(61)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1970:2: ( '@statemachine:' (m= any_def_statemachine[ container , mdfr , spcfr ] )+ )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1970:4: '@statemachine:' (m= any_def_statemachine[ container , mdfr , spcfr ] )+
+ {
+ MATCHT(227, &FOLLOW_227_in_section_statemachine5188);
+ if (HASEXCEPTION())
+ {
+ goto rulesection_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ container->getwSpecifier().setMocStateTransitionSystem();
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1973:4: (m= any_def_statemachine[ container , mdfr , spcfr ] )+
+ {
+ int cnt148=0;
+
+ for (;;)
+ {
+ int alt148=2;
+ switch ( LA(1) )
+ {
+ case 144:
+ case 145:
+ case 147:
+ case 148:
+ case 149:
+ case 150:
+ case 153:
+ case 272:
+ case 306:
+ case 314:
+ case 322:
+ case 353:
+ case 378:
+ case 379:
+ case 393:
+ case 406:
+ {
+ alt148=1;
+ }
+ break;
+
+ }
+
+ switch (alt148)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1973:6: m= any_def_statemachine[ container , mdfr , spcfr ]
+ {
+ FOLLOWPUSH(FOLLOW_any_def_statemachine_in_section_statemachine5203);
+ m=any_def_statemachine(ctx, container, mdfr, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_statemachineEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt148 >= 1 )
+ {
+ goto loop148;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto rulesection_statemachineEx;
+ }
+ cnt148++;
+ }
+ loop148: ; /* Jump to here if this rule does not match */
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulesection_statemachineEx; /* Prevent compiler warnings */
+ rulesection_statemachineEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(61, section_statemachine_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end section_statemachine */
+
+/**
+ * $ANTLR start def_state
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1978:1: def_state[ sep::Machine * container ,\n\t\tsep::Modifier mdfr , sep::Specifier spcfr ] returns [ sep::Machine * state = NULL ] : 'state' ( LT_ ( 'moc:' )? executable_specifier[ spcfr ] GT )? (id= state_id | ( LBRACKET | LBRACKET_EXCEPT ) (id= state_id ( COMMA id= state_id )* | STAR ) RBRACKET )? ( StringLiteral )? ( def_body_state[ state ] | SEMI ) ;
+ */
+static sep::Machine *
+def_state(pfmlParser ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr)
+{
+ sep::Machine * state;
+
+ ANTLR3_UINT32 def_state_StartIndex;
+
+ pANTLR3_COMMON_TOKEN StringLiteral7;
+ std::string id;
+ #undef RETURN_TYPE_id
+ #define RETURN_TYPE_id std::string
+
+ /* Initialize rule variables
+ */
+ state = NULL;
+
+ def_state_StartIndex = INDEX();
+
+
+
+ std::string sid;
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(62)) )
+ {
+ {
+
+ POP_CTX;
+
+ SET_RULE_LOCATION(state);
+
+ }
+ {
+ }
+
+
+
+ return state;
+ }
+
+ StringLiteral7 = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1992:2: ( 'state' ( LT_ ( 'moc:' )? executable_specifier[ spcfr ] GT )? (id= state_id | ( LBRACKET | LBRACKET_EXCEPT ) (id= state_id ( COMMA id= state_id )* | STAR ) RBRACKET )? ( StringLiteral )? ( def_body_state[ state ] | SEMI ) )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1992:4: 'state' ( LT_ ( 'moc:' )? executable_specifier[ spcfr ] GT )? (id= state_id | ( LBRACKET | LBRACKET_EXCEPT ) (id= state_id ( COMMA id= state_id )* | STAR ) RBRACKET )? ( StringLiteral )? ( def_body_state[ state ] | SEMI )
+ {
+ MATCHT(378, &FOLLOW_378_in_def_state5235);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_stateEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1993:4: ( LT_ ( 'moc:' )? executable_specifier[ spcfr ] GT )?
+ {
+ int alt150=2;
+ switch ( LA(1) )
+ {
+ case LT_:
+ {
+ alt150=1;
+ }
+ break;
+ }
+
+ switch (alt150)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1993:6: LT_ ( 'moc:' )? executable_specifier[ spcfr ] GT
+ {
+ MATCHT(LT_, &FOLLOW_LT__in_def_state5242);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_stateEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1993:10: ( 'moc:' )?
+ {
+ int alt149=2;
+ switch ( LA(1) )
+ {
+ case 321:
+ {
+ alt149=1;
+ }
+ break;
+ }
+
+ switch (alt149)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1993:12: 'moc:'
+ {
+ MATCHT(321, &FOLLOW_321_in_def_state5246);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_stateEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_executable_specifier_in_def_state5252);
+ executable_specifier(ctx, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_stateEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ MATCHT(GT, &FOLLOW_GT_in_def_state5256);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_stateEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ sid = "$" + spcfr.strAnyStateMoc("");
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1996:4: (id= state_id | ( LBRACKET | LBRACKET_EXCEPT ) (id= state_id ( COMMA id= state_id )* | STAR ) RBRACKET )?
+ {
+ int alt154=3;
+ switch ( LA(1) )
+ {
+ case DOLLAR:
+ case ID:
+ case 144:
+ case 145:
+ case 146:
+ case 147:
+ case 148:
+ case 149:
+ case 150:
+ case 153:
+ {
+ alt154=1;
+ }
+ break;
+ case LBRACKET:
+ case LBRACKET_EXCEPT:
+ {
+ alt154=2;
+ }
+ break;
+ }
+
+ switch (alt154)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1996:6: id= state_id
+ {
+ FOLLOWPUSH(FOLLOW_state_id_in_def_state5278);
+ id=state_id(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_stateEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ if( spcfr.couldBeStateMocSIMPLE() )
+ {
+ spcfr.setStateMocSIMPLE();
+ }
+
+ PUSH_CTX_CPM(
+ state= sep::Machine::newState(container,
+ id
+ , spcfr) );
+
+
+ state
+ ->getwModifier().override_ifdef( mdfr );
+
+ container->saveOwnedElement( state
+ );
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2011:6: ( LBRACKET | LBRACKET_EXCEPT ) (id= state_id ( COMMA id= state_id )* | STAR ) RBRACKET
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2011:6: ( LBRACKET | LBRACKET_EXCEPT )
+ {
+ int alt151=2;
+ switch ( LA(1) )
+ {
+ case LBRACKET:
+ {
+ alt151=1;
+ }
+ break;
+ case LBRACKET_EXCEPT:
+ {
+ alt151=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return state;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 151;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_stateEx;
+
+ }
+
+ switch (alt151)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2011:8: LBRACKET
+ {
+ MATCHT(LBRACKET, &FOLLOW_LBRACKET_in_def_state5295);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_stateEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ spcfr.setGroupSome();
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2012:8: LBRACKET_EXCEPT
+ {
+ MATCHT(LBRACKET_EXCEPT, &FOLLOW_LBRACKET_EXCEPT_in_def_state5314);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_stateEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ spcfr.setGroupExcept();
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+
+ PUSH_CTX_CPM(
+ state= sep::Machine::newState(container, "[]", spcfr) );
+
+
+ container->saveOwnedElement( state
+ );
+
+ state
+ ->getwModifier().override_ifdef( mdfr );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2023:6: (id= state_id ( COMMA id= state_id )* | STAR )
+ {
+ int alt153=2;
+ switch ( LA(1) )
+ {
+ case DOLLAR:
+ case ID:
+ case 144:
+ case 145:
+ case 146:
+ case 147:
+ case 148:
+ case 149:
+ case 150:
+ case 153:
+ {
+ alt153=1;
+ }
+ break;
+ case STAR:
+ {
+ alt153=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return state;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 153;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_stateEx;
+
+ }
+
+ switch (alt153)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2023:8: id= state_id ( COMMA id= state_id )*
+ {
+ FOLLOWPUSH(FOLLOW_state_id_in_def_state5340);
+ id=state_id(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_stateEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ state
+ ->appendGroupId( id
+ );
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2024:8: ( COMMA id= state_id )*
+
+ for (;;)
+ {
+ int alt152=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt152=1;
+ }
+ break;
+
+ }
+
+ switch (alt152)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2024:10: COMMA id= state_id
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_def_state5362);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_stateEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_state_id_in_def_state5366);
+ id=state_id(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_stateEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ state
+ ->appendGroupId( id
+ );
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop152; /* break out of the loop */
+ break;
+ }
+ }
+ loop152: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2026:8: STAR
+ {
+ MATCHT(STAR, &FOLLOW_STAR_in_def_state5382);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_stateEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ state
+ ->getwSpecifier().setGroupEvery();
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(RBRACKET, &FOLLOW_RBRACKET_in_def_state5403);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_stateEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ state
+ ->setGroupId();
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+
+ if( state
+ == NULL )
+ {
+ PUSH_CTX_CPM(
+ state= sep::Machine::newState(container, sid, spcfr) );
+
+
+ state
+ ->getwModifier().override_ifdef( mdfr );
+
+ container->saveOwnedElement( state
+ );
+ }
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2044:4: ( StringLiteral )?
+ {
+ int alt155=2;
+ switch ( LA(1) )
+ {
+ case StringLiteral:
+ {
+ alt155=1;
+ }
+ break;
+ }
+
+ switch (alt155)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2044:6: StringLiteral
+ {
+ StringLiteral7 = (pANTLR3_COMMON_TOKEN) MATCHT(StringLiteral, &FOLLOW_StringLiteral_in_def_state5427);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_stateEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ state
+ ->setUnrestrictedName(STR((StringLiteral7->getText(StringLiteral7))->chars));
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2048:4: ( def_body_state[ state ] | SEMI )
+ {
+ int alt156=2;
+ switch ( LA(1) )
+ {
+ case LCURLY:
+ {
+ alt156=1;
+ }
+ break;
+ case SEMI:
+ {
+ alt156=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return state;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 156;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_stateEx;
+
+ }
+
+ switch (alt156)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2048:6: def_body_state[ state ]
+ {
+ FOLLOWPUSH(FOLLOW_def_body_state_in_def_state5446);
+ def_body_state(ctx, state);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_stateEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2048:32: SEMI
+ {
+ MATCHT(SEMI, &FOLLOW_SEMI_in_def_state5451);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_stateEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_stateEx; /* Prevent compiler warnings */
+ ruledef_stateEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ POP_CTX;
+
+ SET_RULE_LOCATION(state);
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(62, def_state_StartIndex); }
+
+ return state;
+}
+/* $ANTLR end def_state */
+
+/**
+ * $ANTLR start state_kw_id
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2052:1: state_kw_id returns [ std::string s ] : ( '#init' | '#initial' | '#start' | '#dhistory' | '#shistory' | '#final' | '#terminal' | '#return' );
+ */
+static std::string
+state_kw_id(pfmlParser ctx)
+{
+ std::string s;
+
+ ANTLR3_UINT32 state_kw_id_StartIndex;
+
+ /* Initialize rule variables
+ */
+ state_kw_id_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(63)) )
+ {
+ {
+ }
+
+
+
+ return s;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2054:2: ( '#init' | '#initial' | '#start' | '#dhistory' | '#shistory' | '#final' | '#terminal' | '#return' )
+
+ ANTLR3_UINT32 alt157;
+
+ alt157=8;
+
+ switch ( LA(1) )
+ {
+ case 146:
+ {
+ alt157=1;
+ }
+ break;
+ case 147:
+ {
+ alt157=2;
+ }
+ break;
+ case 150:
+ {
+ alt157=3;
+ }
+ break;
+ case 144:
+ {
+ alt157=4;
+ }
+ break;
+ case 149:
+ {
+ alt157=5;
+ }
+ break;
+ case 145:
+ {
+ alt157=6;
+ }
+ break;
+ case 153:
+ {
+ alt157=7;
+ }
+ break;
+ case 148:
+ {
+ alt157=8;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return s;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 157;
+ EXCEPTION->state = 0;
+
+
+ goto rulestate_kw_idEx;
+
+ }
+
+ switch (alt157)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2054:4: '#init'
+ {
+ MATCHT(146, &FOLLOW_146_in_state_kw_id5469);
+ if (HASEXCEPTION())
+ {
+ goto rulestate_kw_idEx;
+ }
+ if (HASFAILED())
+ {
+ return s;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ s= "#init" ;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2055:4: '#initial'
+ {
+ MATCHT(147, &FOLLOW_147_in_state_kw_id5481);
+ if (HASEXCEPTION())
+ {
+ goto rulestate_kw_idEx;
+ }
+ if (HASFAILED())
+ {
+ return s;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ s= "#initial" ;
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2056:4: '#start'
+ {
+ MATCHT(150, &FOLLOW_150_in_state_kw_id5490);
+ if (HASEXCEPTION())
+ {
+ goto rulestate_kw_idEx;
+ }
+ if (HASFAILED())
+ {
+ return s;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ s= "#start" ;
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2058:4: '#dhistory'
+ {
+ MATCHT(144, &FOLLOW_144_in_state_kw_id5502);
+ if (HASEXCEPTION())
+ {
+ goto rulestate_kw_idEx;
+ }
+ if (HASFAILED())
+ {
+ return s;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ s= "#dhistory";
+
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2059:4: '#shistory'
+ {
+ MATCHT(149, &FOLLOW_149_in_state_kw_id5510);
+ if (HASEXCEPTION())
+ {
+ goto rulestate_kw_idEx;
+ }
+ if (HASFAILED())
+ {
+ return s;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ s= "#shistory";
+
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2061:4: '#final'
+ {
+ MATCHT(145, &FOLLOW_145_in_state_kw_id5519);
+ if (HASEXCEPTION())
+ {
+ goto rulestate_kw_idEx;
+ }
+ if (HASFAILED())
+ {
+ return s;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ s= "#final" ;
+ needDefaultStateFinal.remove(_CPM_);
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2064:4: '#terminal'
+ {
+ MATCHT(153, &FOLLOW_153_in_state_kw_id5528);
+ if (HASEXCEPTION())
+ {
+ goto rulestate_kw_idEx;
+ }
+ if (HASFAILED())
+ {
+ return s;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ s= "#terminal";
+ needDefaultStateTerminal.remove(_CPM_);
+ }
+
+
+ }
+ break;
+ case 8:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2067:4: '#return'
+ {
+ MATCHT(148, &FOLLOW_148_in_state_kw_id5537);
+ if (HASEXCEPTION())
+ {
+ goto rulestate_kw_idEx;
+ }
+ if (HASFAILED())
+ {
+ return s;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ s= "#return" ;
+ needDefaultStateReturn.remove(_CPM_);
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestate_kw_idEx; /* Prevent compiler warnings */
+ rulestate_kw_idEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(63, state_kw_id_StartIndex); }
+
+ return s;
+}
+/* $ANTLR end state_kw_id */
+
+/**
+ * $ANTLR start state_id
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2071:1: state_id returns [ std::string s ] : (kw= state_kw_id |id= ID | DOLLAR id= ID );
+ */
+static std::string
+state_id(pfmlParser ctx)
+{
+ std::string s;
+
+ ANTLR3_UINT32 state_id_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ std::string kw;
+ #undef RETURN_TYPE_kw
+ #define RETURN_TYPE_kw std::string
+
+ /* Initialize rule variables
+ */
+ state_id_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(64)) )
+ {
+ {
+ }
+
+
+
+ return s;
+ }
+
+ id = NULL;
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2073:2: (kw= state_kw_id |id= ID | DOLLAR id= ID )
+
+ ANTLR3_UINT32 alt158;
+
+ alt158=3;
+
+ switch ( LA(1) )
+ {
+ case 144:
+ case 145:
+ case 146:
+ case 147:
+ case 148:
+ case 149:
+ case 150:
+ case 153:
+ {
+ alt158=1;
+ }
+ break;
+ case ID:
+ {
+ alt158=2;
+ }
+ break;
+ case DOLLAR:
+ {
+ alt158=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return s;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 158;
+ EXCEPTION->state = 0;
+
+
+ goto rulestate_idEx;
+
+ }
+
+ switch (alt158)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2073:4: kw= state_kw_id
+ {
+ FOLLOWPUSH(FOLLOW_state_kw_id_in_state_id5557);
+ kw=state_kw_id(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestate_idEx;
+ }
+ if (HASFAILED())
+ {
+ return s;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ s=
+ kw
+ ;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2074:4: id= ID
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_state_id5567);
+ if (HASEXCEPTION())
+ {
+ goto rulestate_idEx;
+ }
+ if (HASFAILED())
+ {
+ return s;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ s= STR((id->getText(id))->chars);
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2075:4: DOLLAR id= ID
+ {
+ MATCHT(DOLLAR, &FOLLOW_DOLLAR_in_state_id5584);
+ if (HASEXCEPTION())
+ {
+ goto rulestate_idEx;
+ }
+ if (HASFAILED())
+ {
+ return s;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_state_id5588);
+ if (HASEXCEPTION())
+ {
+ goto rulestate_idEx;
+ }
+ if (HASFAILED())
+ {
+ return s;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ s= "$" + STR((id->getText(id))->chars);
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestate_idEx; /* Prevent compiler warnings */
+ rulestate_idEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(64, state_id_StartIndex); }
+
+ return s;
+}
+/* $ANTLR end state_id */
+
+/**
+ * $ANTLR start def_state_singleton
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2081:1: def_state_singleton[ sep::Machine * container ,\n\t\tsep::Modifier mdfr , sep::Specifier spcfr ] returns [ sep::Machine * state ] : ( ( '#initial' | '#start' | '#dhistory' | '#shistory' ) LCURLY def_body_state_simplif[ state ] RCURLY | '#final' bs= block_statement | '#terminal' bs= block_statement | '#return' bs= block_statement );
+ */
+static sep::Machine *
+def_state_singleton(pfmlParser ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr)
+{
+ sep::Machine * state;
+
+ ANTLR3_UINT32 def_state_singleton_StartIndex;
+
+ sep::BFCode bs;
+ #undef RETURN_TYPE_bs
+ #define RETURN_TYPE_bs sep::BFCode
+
+ /* Initialize rule variables
+ */
+ def_state_singleton_StartIndex = INDEX();
+
+
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(65)) )
+ {
+ {
+
+ state->getwModifier().override_ifdef( mdfr );
+
+ POP_CTX;
+
+ SET_RULE_LOCATION(state);
+
+ }
+ {
+ }
+
+
+
+ return state;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2095:2: ( ( '#initial' | '#start' | '#dhistory' | '#shistory' ) LCURLY def_body_state_simplif[ state ] RCURLY | '#final' bs= block_statement | '#terminal' bs= block_statement | '#return' bs= block_statement )
+
+ ANTLR3_UINT32 alt160;
+
+ alt160=4;
+
+ switch ( LA(1) )
+ {
+ case 144:
+ case 147:
+ case 149:
+ case 150:
+ {
+ alt160=1;
+ }
+ break;
+ case 145:
+ {
+ alt160=2;
+ }
+ break;
+ case 153:
+ {
+ alt160=3;
+ }
+ break;
+ case 148:
+ {
+ alt160=4;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return state;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 160;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_state_singletonEx;
+
+ }
+
+ switch (alt160)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2095:4: ( '#initial' | '#start' | '#dhistory' | '#shistory' ) LCURLY def_body_state_simplif[ state ] RCURLY
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2095:4: ( '#initial' | '#start' | '#dhistory' | '#shistory' )
+ {
+ int alt159=4;
+ switch ( LA(1) )
+ {
+ case 147:
+ {
+ alt159=1;
+ }
+ break;
+ case 150:
+ {
+ alt159=2;
+ }
+ break;
+ case 144:
+ {
+ alt159=3;
+ }
+ break;
+ case 149:
+ {
+ alt159=4;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return state;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 159;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_state_singletonEx;
+
+ }
+
+ switch (alt159)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2095:6: '#initial'
+ {
+ MATCHT(147, &FOLLOW_147_in_def_state_singleton5624);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_singletonEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ PUSH_CTX_CPM( state= sep::Machine::newState(
+ container, "#initial", spcfr.setPseudostateMocINITIAL()) );
+
+
+ container->saveOwnedElement( state
+ );
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2103:6: '#start'
+ {
+ MATCHT(150, &FOLLOW_150_in_def_state_singleton5637);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_singletonEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ PUSH_CTX_CPM( state= sep::Machine::newState(
+ container, "#start", spcfr.setStateMocSTART()) );
+
+
+ container->saveOwnedElement( state
+ );
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2111:6: '#dhistory'
+ {
+ MATCHT(144, &FOLLOW_144_in_def_state_singleton5650);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_singletonEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ PUSH_CTX_CPM( state= sep::Machine::newState(
+ container, "#dhistory",
+ spcfr.setPseudostateMocDEEP_HISTORY()) );
+
+
+ container->saveOwnedElement( state
+ );
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2120:6: '#shistory'
+ {
+ MATCHT(149, &FOLLOW_149_in_def_state_singleton5663);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_singletonEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ PUSH_CTX_CPM( state= sep::Machine::newState(
+ container, "#shistory",
+ spcfr.setPseudostateMocSHALLOW_HISTORY()) );
+
+
+ container->saveOwnedElement( state
+ );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_def_state_singleton5678);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_singletonEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_body_state_simplif_in_def_state_singleton5681);
+ def_body_state_simplif(ctx, state);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_singletonEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_def_state_singleton5685);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_singletonEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2131:4: '#final' bs= block_statement
+ {
+ MATCHT(145, &FOLLOW_145_in_def_state_singleton5691);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_singletonEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_def_state_singleton5695);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_singletonEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ PUSH_CTX_CPM( state= sep::Machine::newState(
+ container, "#final", spcfr.setStateMocFINAL()) );
+
+
+ container->saveOwnedElement( state
+ );
+
+ state
+ ->getUniqBehaviorPart()->seqOnFinal(bs
+ );
+
+ needDefaultStateFinal.remove(container);
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2143:4: '#terminal' bs= block_statement
+ {
+ MATCHT(153, &FOLLOW_153_in_def_state_singleton5704);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_singletonEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_def_state_singleton5708);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_singletonEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ PUSH_CTX_CPM( state= sep::Machine::newState(
+ container, "#terminal", spcfr.setPseudostateMocTERMINAL()) );
+
+
+ container->saveOwnedElement( state
+ );
+
+ state
+ ->getUniqBehaviorPart()->seqOnFinal(bs
+ );
+
+ needDefaultStateTerminal.remove(container);
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2155:4: '#return' bs= block_statement
+ {
+ MATCHT(148, &FOLLOW_148_in_def_state_singleton5717);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_singletonEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_def_state_singleton5721);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_singletonEx;
+ }
+ if (HASFAILED())
+ {
+ return state;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ PUSH_CTX_CPM( state= sep::Machine::newState(
+ container, "#return", spcfr.setPseudostateMocRETURN()) );
+
+
+ container->saveOwnedElement( state
+ );
+
+ state
+ ->getUniqBehaviorPart()->seqOnFinal(bs
+ );
+
+ needDefaultStateReturn.remove(container);
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_state_singletonEx; /* Prevent compiler warnings */
+ ruledef_state_singletonEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ state->getwModifier().override_ifdef( mdfr );
+
+ POP_CTX;
+
+ SET_RULE_LOCATION(state);
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(65, def_state_singleton_StartIndex); }
+
+ return state;
+}
+/* $ANTLR end def_state_singleton */
+
+/**
+ * $ANTLR start executable_specifier
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2169:1: executable_specifier[ sep::Specifier & spcfr ] : ka= executable_specifier_atom[ spcfr ] ( BAND ka= executable_specifier_atom[ spcfr ] )* ;
+ */
+static void
+executable_specifier(pfmlParser ctx, sep::Specifier & spcfr)
+{
+ ANTLR3_UINT32 executable_specifier_StartIndex;
+
+ /* Initialize rule variables
+ */
+ executable_specifier_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(66)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2170:2: (ka= executable_specifier_atom[ spcfr ] ( BAND ka= executable_specifier_atom[ spcfr ] )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2170:4: ka= executable_specifier_atom[ spcfr ] ( BAND ka= executable_specifier_atom[ spcfr ] )*
+ {
+ FOLLOWPUSH(FOLLOW_executable_specifier_atom_in_executable_specifier5740);
+ executable_specifier_atom(ctx, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_specifierEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2171:4: ( BAND ka= executable_specifier_atom[ spcfr ] )*
+
+ for (;;)
+ {
+ int alt161=2;
+ switch ( LA(1) )
+ {
+ case BAND:
+ {
+ alt161=1;
+ }
+ break;
+
+ }
+
+ switch (alt161)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2171:6: BAND ka= executable_specifier_atom[ spcfr ]
+ {
+ MATCHT(BAND, &FOLLOW_BAND_in_executable_specifier5748);
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_specifierEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_executable_specifier_atom_in_executable_specifier5752);
+ executable_specifier_atom(ctx, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_specifierEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop161; /* break out of the loop */
+ break;
+ }
+ }
+ loop161: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleexecutable_specifierEx; /* Prevent compiler warnings */
+ ruleexecutable_specifierEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(66, executable_specifier_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end executable_specifier */
+
+/**
+ * $ANTLR start executable_specifier_atom
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2175:1: executable_specifier_atom[ sep::Specifier & spcfr ] : (id= ID | 'start' | 'final' | 'return' | 'choice' | 'fork' | 'join' | 'and' | 'or' | '#sts' | '#stf' | 'flow' );
+ */
+static void
+executable_specifier_atom(pfmlParser ctx, sep::Specifier & spcfr)
+{
+ ANTLR3_UINT32 executable_specifier_atom_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+
+ /* Initialize rule variables
+ */
+ executable_specifier_atom_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(67)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ id = NULL;
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2176:2: (id= ID | 'start' | 'final' | 'return' | 'choice' | 'fork' | 'join' | 'and' | 'or' | '#sts' | '#stf' | 'flow' )
+
+ ANTLR3_UINT32 alt162;
+
+ alt162=12;
+
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt162=1;
+ }
+ break;
+ case 377:
+ {
+ alt162=2;
+ }
+ break;
+ case 282:
+ {
+ alt162=3;
+ }
+ break;
+ case 364:
+ {
+ alt162=4;
+ }
+ break;
+ case 257:
+ {
+ alt162=5;
+ }
+ break;
+ case 286:
+ {
+ alt162=6;
+ }
+ break;
+ case 312:
+ {
+ alt162=7;
+ }
+ break;
+ case 239:
+ {
+ alt162=8;
+ }
+ break;
+ case 334:
+ {
+ alt162=9;
+ }
+ break;
+ case 152:
+ {
+ alt162=10;
+ }
+ break;
+ case 151:
+ {
+ alt162=11;
+ }
+ break;
+ case 284:
+ {
+ alt162=12;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 162;
+ EXCEPTION->state = 0;
+
+
+ goto ruleexecutable_specifier_atomEx;
+
+ }
+
+ switch (alt162)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2176:4: id= ID
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_executable_specifier_atom5772);
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_specifier_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ spcfr.setMoc( STR((id->getText(id))->chars) );
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2179:4: 'start'
+ {
+ MATCHT(377, &FOLLOW_377_in_executable_specifier_atom5782);
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_specifier_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ spcfr.setStateMocSTART();
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2180:4: 'final'
+ {
+ MATCHT(282, &FOLLOW_282_in_executable_specifier_atom5794);
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_specifier_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ spcfr.setStateMocFINAL();
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2185:4: 'return'
+ {
+ MATCHT(364, &FOLLOW_364_in_executable_specifier_atom5810);
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_specifier_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ spcfr.setPseudostateMocRETURN();
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2188:4: 'choice'
+ {
+ MATCHT(257, &FOLLOW_257_in_executable_specifier_atom5823);
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_specifier_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ spcfr.setPseudostateMocCHOICE();
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2190:4: 'fork'
+ {
+ MATCHT(286, &FOLLOW_286_in_executable_specifier_atom5835);
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_specifier_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ spcfr.setPseudostateMocFORK();
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2191:4: 'join'
+ {
+ MATCHT(312, &FOLLOW_312_in_executable_specifier_atom5848);
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_specifier_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ spcfr.setPseudostateMocJOIN();
+ }
+
+
+ }
+ break;
+ case 8:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2196:4: 'and'
+ {
+ MATCHT(239, &FOLLOW_239_in_executable_specifier_atom5865);
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_specifier_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ spcfr.setMocCompositeStructure();
+ }
+
+
+ }
+ break;
+ case 9:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2197:4: 'or'
+ {
+ MATCHT(334, &FOLLOW_334_in_executable_specifier_atom5879);
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_specifier_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ spcfr.setMocStateTransitionSystem();
+ }
+
+
+ }
+ break;
+ case 10:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2198:4: '#sts'
+ {
+ MATCHT(152, &FOLLOW_152_in_executable_specifier_atom5894);
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_specifier_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ spcfr.setMocStateTransitionSystem();
+ }
+
+
+ }
+ break;
+ case 11:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2199:4: '#stf'
+ {
+ MATCHT(151, &FOLLOW_151_in_executable_specifier_atom5907);
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_specifier_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ spcfr.setMocStateTransitionFlow();
+ }
+
+
+ }
+ break;
+ case 12:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2200:4: 'flow'
+ {
+ MATCHT(284, &FOLLOW_284_in_executable_specifier_atom5920);
+ if (HASEXCEPTION())
+ {
+ goto ruleexecutable_specifier_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ spcfr.setCompositeMocDataFlow();
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleexecutable_specifier_atomEx; /* Prevent compiler warnings */
+ ruleexecutable_specifier_atomEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(67, executable_specifier_atom_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end executable_specifier_atom */
+
+/**
+ * $ANTLR start instance_machine_model
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2205:1: instance_machine_model returns [ sep::BF model ] : tid= qualifiedNameID ;
+ */
+static sep::BF
+instance_machine_model(pfmlParser ctx)
+{
+ sep::BF model;
+
+ ANTLR3_UINT32 instance_machine_model_StartIndex;
+
+ fmlParser_qualifiedNameID_return tid;
+ #undef RETURN_TYPE_tid
+ #define RETURN_TYPE_tid fmlParser_qualifiedNameID_return
+
+ /* Initialize rule variables
+ */
+ instance_machine_model_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(68)) )
+ {
+ {
+ }
+
+
+
+ return model;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2207:2: (tid= qualifiedNameID )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2207:4: tid= qualifiedNameID
+ {
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_instance_machine_model5947);
+ tid=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleinstance_machine_modelEx;
+ }
+ if (HASFAILED())
+ {
+ return model;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ model= sep::ParserUtil::getExecutableMachine(
+ tid.s
+ , tid.nb
+ );
+
+ if( model
+ .invalid() )
+ {
+ sep::ParserUtil::avm_syntax_error(
+ "instance_machine_model", LT(0)->getLine(LT(0)) )
+ << "unexpected ID< " << tid.s
+ << " >"
+ << sep::ParserUtil::SYNTAX_ERROR_EOL;
+ }
+
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleinstance_machine_modelEx; /* Prevent compiler warnings */
+ ruleinstance_machine_modelEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(68, instance_machine_model_StartIndex); }
+
+ return model;
+}
+/* $ANTLR end instance_machine_model */
+
+/**
+ * $ANTLR start def_body_state
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2221:1: def_body_state[ sep::Machine * state ] : LCURLY ( ( def_body_machine_using_section_predicat )=> def_body_state_section[ state ] | def_body_state_simplif[ state ] ) RCURLY ;
+ */
+static void
+def_body_state(pfmlParser ctx, sep::Machine * state)
+{
+ ANTLR3_UINT32 def_body_state_StartIndex;
+
+ /* Initialize rule variables
+ */
+ def_body_state_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(69)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2222:2: ( LCURLY ( ( def_body_machine_using_section_predicat )=> def_body_state_section[ state ] | def_body_state_simplif[ state ] ) RCURLY )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2222:4: LCURLY ( ( def_body_machine_using_section_predicat )=> def_body_state_section[ state ] | def_body_state_simplif[ state ] ) RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_def_body_state5964);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_stateEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2223:4: ( ( def_body_machine_using_section_predicat )=> def_body_state_section[ state ] | def_body_state_simplif[ state ] )
+ {
+ int alt163=2;
+ {
+ int LA163_0 = LA(1);
+ if ( (synpred296_fml(ctx)) && (LA163_0 == 178 || LA163_0 == 213))
+ {
+ alt163=1;
+ }
+ else if ( (synpred296_fml(ctx)) && (LA163_0 == 216))
+ {
+ alt163=1;
+ }
+ else if ( (synpred296_fml(ctx)) && (LA163_0 == 214))
+ {
+ alt163=1;
+ }
+ else if ( (synpred296_fml(ctx)) && (LA163_0 == 211))
+ {
+ alt163=1;
+ }
+ else if ( (synpred296_fml(ctx)) && (LA163_0 == 222))
+ {
+ alt163=1;
+ }
+ else if ( (synpred296_fml(ctx)) && (LA163_0 == 201))
+ {
+ alt163=1;
+ }
+ else if ( (synpred296_fml(ctx)) && (LA163_0 == 212))
+ {
+ alt163=1;
+ }
+ else if ( (synpred296_fml(ctx)) && (LA163_0 == 174 || LA163_0 == 183 || LA163_0 == 200))
+ {
+ alt163=1;
+ }
+ else if ( (synpred296_fml(ctx)) && (LA163_0 == 203))
+ {
+ alt163=1;
+ }
+ else if ( (synpred296_fml(ctx)) && (LA163_0 == 215))
+ {
+ alt163=1;
+ }
+ else if ( (synpred296_fml(ctx)) && (LA163_0 == 197))
+ {
+ alt163=1;
+ }
+ else if ( (synpred296_fml(ctx)) && (LA163_0 == 217))
+ {
+ alt163=1;
+ }
+ else if ( (synpred296_fml(ctx)) && (LA163_0 == 231))
+ {
+ alt163=1;
+ }
+ else if ( (synpred296_fml(ctx)) && (LA163_0 == 202))
+ {
+ alt163=1;
+ }
+ else if ( (synpred296_fml(ctx)) && (LA163_0 == 204))
+ {
+ alt163=1;
+ }
+ else if ( (synpred296_fml(ctx)) && (LA163_0 == 172 || LA163_0 == 198))
+ {
+ alt163=1;
+ }
+ else if ( (LA163_0 == RCURLY))
+ {
+ {
+ int LA163_17 = LA(2);
+ if ( (synpred296_fml(ctx)))
+ {
+ alt163=1;
+ }
+ else if ( (ANTLR3_TRUE))
+ {
+ alt163=2;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 163;
+ EXCEPTION->state = 17;
+
+
+ goto ruledef_body_stateEx;
+
+ }
+ }
+ }
+ else if ( (LA163_0 == AT_ID || ((LA163_0 >= 144) && (LA163_0 <= 145)) || ((LA163_0 >= 147) && (LA163_0 <= 150)) || LA163_0 == 153 || ((LA163_0 >= 169) && (LA163_0 <= 170)) || LA163_0 == 177 || LA163_0 == 179 || LA163_0 == 182 || LA163_0 == 184 || ((LA163_0 >= 189) && (LA163_0 <= 191)) || LA163_0 == 194 || LA163_0 == 199 || ((LA163_0 >= 223) && (LA163_0 <= 224)) || LA163_0 == 243 || LA163_0 == 259 || LA163_0 == 262 || LA163_0 == 272 || LA163_0 == 282 || LA163_0 == 298 || ((LA163_0 >= 305) && (LA163_0 <= 306)) || LA163_0 == 314 || LA163_0 == 318 || LA163_0 == 322 || LA163_0 == 341 || LA163_0 == 349 || LA163_0 == 353 || LA163_0 == 355 || LA163_0 == 361 || LA163_0 == 364 || ((LA163_0 >= 378) && (LA163_0 <= 380)) || LA163_0 == 393 || ((LA163_0 >= 395) && (LA163_0 <= 396)) || LA163_0 == 406 || ((LA163_0 >= 410) && (LA163_0 <= 411)) || LA163_0 == 414))
+ {
+ alt163=2;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 163;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_body_stateEx;
+
+ }
+ }
+ switch (alt163)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2223:6: ( def_body_machine_using_section_predicat )=> def_body_state_section[ state ]
+ {
+ FOLLOWPUSH(FOLLOW_def_body_state_section_in_def_body_state5984);
+ def_body_state_section(ctx, state);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_stateEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2226:6: def_body_state_simplif[ state ]
+ {
+ FOLLOWPUSH(FOLLOW_def_body_state_simplif_in_def_body_state5993);
+ def_body_state_simplif(ctx, state);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_stateEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_def_body_state6004);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_stateEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_body_stateEx; /* Prevent compiler warnings */
+ ruledef_body_stateEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(69, def_body_state_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_body_state */
+
+/**
+ * $ANTLR start def_body_state_section
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2231:1: def_body_state_section[ sep::Machine * machine ] : ( section_property[ machine ] )* ( section_composite_structure[ machine ] )* ( section_region[ machine ] )? ( section_transition[ machine ] )? ( section_model_of_computation[ machine ] | section_model_of_execution[ machine ] | section_model_of_interaction[ machine ] )* ;
+ */
+static void
+def_body_state_section(pfmlParser ctx, sep::Machine * machine)
+{
+ ANTLR3_UINT32 def_body_state_section_StartIndex;
+
+ /* Initialize rule variables
+ */
+ def_body_state_section_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(70)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2232:2: ( ( section_property[ machine ] )* ( section_composite_structure[ machine ] )* ( section_region[ machine ] )? ( section_transition[ machine ] )? ( section_model_of_computation[ machine ] | section_model_of_execution[ machine ] | section_model_of_interaction[ machine ] )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2232:4: ( section_property[ machine ] )* ( section_composite_structure[ machine ] )* ( section_region[ machine ] )? ( section_transition[ machine ] )? ( section_model_of_computation[ machine ] | section_model_of_execution[ machine ] | section_model_of_interaction[ machine ] )*
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2232:4: ( section_property[ machine ] )*
+
+ for (;;)
+ {
+ int alt164=2;
+ switch ( LA(1) )
+ {
+ case 178:
+ case 211:
+ case 213:
+ case 214:
+ case 216:
+ {
+ alt164=1;
+ }
+ break;
+
+ }
+
+ switch (alt164)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2232:6: section_property[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_property_in_def_body_state_section6019);
+ section_property(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_state_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop164; /* break out of the loop */
+ break;
+ }
+ }
+ loop164: ; /* Jump out to here if this rule does not match */
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2234:4: ( section_composite_structure[ machine ] )*
+
+ for (;;)
+ {
+ int alt165=2;
+ switch ( LA(1) )
+ {
+ case 174:
+ case 183:
+ case 197:
+ case 200:
+ case 201:
+ case 203:
+ case 212:
+ case 215:
+ case 222:
+ {
+ alt165=1;
+ }
+ break;
+
+ }
+
+ switch (alt165)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2234:6: section_composite_structure[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_composite_structure_in_def_body_state_section6031);
+ section_composite_structure(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_state_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop165; /* break out of the loop */
+ break;
+ }
+ }
+ loop165: ; /* Jump out to here if this rule does not match */
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2236:4: ( section_region[ machine ] )?
+ {
+ int alt166=2;
+ switch ( LA(1) )
+ {
+ case 217:
+ {
+ alt166=1;
+ }
+ break;
+ }
+
+ switch (alt166)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2236:4: section_region[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_region_in_def_body_state_section6041);
+ section_region(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_state_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2238:4: ( section_transition[ machine ] )?
+ {
+ int alt167=2;
+ switch ( LA(1) )
+ {
+ case 231:
+ {
+ alt167=1;
+ }
+ break;
+ }
+
+ switch (alt167)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2238:4: section_transition[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_transition_in_def_body_state_section6050);
+ section_transition(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_state_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2240:4: ( section_model_of_computation[ machine ] | section_model_of_execution[ machine ] | section_model_of_interaction[ machine ] )*
+
+ for (;;)
+ {
+ int alt168=4;
+ switch ( LA(1) )
+ {
+ case 202:
+ {
+ alt168=1;
+ }
+ break;
+ case 204:
+ {
+ alt168=2;
+ }
+ break;
+ case 172:
+ case 198:
+ {
+ alt168=3;
+ }
+ break;
+
+ }
+
+ switch (alt168)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2240:6: section_model_of_computation[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_model_of_computation_in_def_body_state_section6061);
+ section_model_of_computation(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_state_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2241:6: section_model_of_execution[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_model_of_execution_in_def_body_state_section6069);
+ section_model_of_execution(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_state_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2242:6: section_model_of_interaction[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_section_model_of_interaction_in_def_body_state_section6077);
+ section_model_of_interaction(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_state_sectionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop168; /* break out of the loop */
+ break;
+ }
+ }
+ loop168: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_body_state_sectionEx; /* Prevent compiler warnings */
+ ruledef_body_state_sectionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(70, def_body_state_section_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_body_state_section */
+
+/**
+ * $ANTLR start def_body_state_simplif
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2246:1: def_body_state_simplif[ sep::Machine * state ] : ( (m= modifier_declaration )? ( decl_variable[ state->getPropertyPart() , mdfr ] |ads= any_def_statemachine[ state , mdfr , spcfr ] | def_transition[ state , mdfr , spcfr ] | def_state_activity[ state ] ) )* ;
+ */
+static void
+def_body_state_simplif(pfmlParser ctx, sep::Machine * state)
+{
+ ANTLR3_UINT32 def_body_state_simplif_StartIndex;
+
+ sep::Modifier m;
+ #undef RETURN_TYPE_m
+ #define RETURN_TYPE_m sep::Modifier
+
+ sep::Machine * ads;
+ #undef RETURN_TYPE_ads
+ #define RETURN_TYPE_ads sep::Machine *
+
+ /* Initialize rule variables
+ */
+ def_body_state_simplif_StartIndex = INDEX();
+
+
+
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(71)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2252:2: ( ( (m= modifier_declaration )? ( decl_variable[ state->getPropertyPart() , mdfr ] |ads= any_def_statemachine[ state , mdfr , spcfr ] | def_transition[ state , mdfr , spcfr ] | def_state_activity[ state ] ) )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2252:4: ( (m= modifier_declaration )? ( decl_variable[ state->getPropertyPart() , mdfr ] |ads= any_def_statemachine[ state , mdfr , spcfr ] | def_transition[ state , mdfr , spcfr ] | def_state_activity[ state ] ) )*
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2252:4: ( (m= modifier_declaration )? ( decl_variable[ state->getPropertyPart() , mdfr ] |ads= any_def_statemachine[ state , mdfr , spcfr ] | def_transition[ state , mdfr , spcfr ] | def_state_activity[ state ] ) )*
+
+ for (;;)
+ {
+ int alt171=2;
+ switch ( LA(1) )
+ {
+ case AT_ID:
+ case 144:
+ case 145:
+ case 147:
+ case 148:
+ case 149:
+ case 150:
+ case 153:
+ case 169:
+ case 170:
+ case 177:
+ case 179:
+ case 182:
+ case 184:
+ case 189:
+ case 190:
+ case 191:
+ case 194:
+ case 199:
+ case 223:
+ case 224:
+ case 243:
+ case 259:
+ case 262:
+ case 272:
+ case 282:
+ case 298:
+ case 305:
+ case 306:
+ case 314:
+ case 318:
+ case 322:
+ case 341:
+ case 349:
+ case 353:
+ case 355:
+ case 361:
+ case 364:
+ case 378:
+ case 379:
+ case 380:
+ case 393:
+ case 395:
+ case 396:
+ case 406:
+ case 410:
+ case 411:
+ case 414:
+ {
+ alt171=1;
+ }
+ break;
+
+ }
+
+ switch (alt171)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2252:6: (m= modifier_declaration )? ( decl_variable[ state->getPropertyPart() , mdfr ] |ads= any_def_statemachine[ state , mdfr , spcfr ] | def_transition[ state , mdfr , spcfr ] | def_state_activity[ state ] )
+ {
+ if ( BACKTRACKING==0 )
+ {
+ mdfr = sep::Modifier::PROPERTY_UNDEFINED_MODIFIER;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2254:3: (m= modifier_declaration )?
+ {
+ int alt169=2;
+ switch ( LA(1) )
+ {
+ case 406:
+ {
+ {
+ int LA169_1 = LA(2);
+ if ( (synpred304_fml(ctx)))
+ {
+ alt169=1;
+ }
+ }
+ }
+ break;
+ case 243:
+ case 282:
+ case 298:
+ case 305:
+ case 341:
+ case 349:
+ case 355:
+ case 361:
+ case 364:
+ case 380:
+ case 395:
+ case 414:
+ {
+ alt169=1;
+ }
+ break;
+ }
+
+ switch (alt169)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2254:5: m= modifier_declaration
+ {
+ FOLLOWPUSH(FOLLOW_modifier_declaration_in_def_body_state_simplif6112);
+ m=modifier_declaration(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_state_simplifEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr = m
+ ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2256:6: ( decl_variable[ state->getPropertyPart() , mdfr ] |ads= any_def_statemachine[ state , mdfr , spcfr ] | def_transition[ state , mdfr , spcfr ] | def_state_activity[ state ] )
+ {
+ int alt170=4;
+ switch ( LA(1) )
+ {
+ case 259:
+ case 262:
+ case 318:
+ case 410:
+ case 411:
+ {
+ alt170=1;
+ }
+ break;
+ case 144:
+ case 145:
+ case 147:
+ case 148:
+ case 149:
+ case 150:
+ case 153:
+ case 272:
+ case 306:
+ case 314:
+ case 322:
+ case 353:
+ case 378:
+ case 379:
+ case 393:
+ case 406:
+ {
+ alt170=2;
+ }
+ break;
+ case AT_ID:
+ case 169:
+ case 396:
+ {
+ alt170=3;
+ }
+ break;
+ case 170:
+ case 177:
+ case 179:
+ case 182:
+ case 184:
+ case 189:
+ case 190:
+ case 191:
+ case 194:
+ case 199:
+ case 223:
+ case 224:
+ {
+ alt170=4;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 170;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_body_state_simplifEx;
+
+ }
+
+ switch (alt170)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2256:8: decl_variable[ state->getPropertyPart() , mdfr ]
+ {
+ FOLLOWPUSH(FOLLOW_decl_variable_in_def_body_state_simplif6128);
+ decl_variable(ctx, state->getPropertyPart(), mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_state_simplifEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2258:8: ads= any_def_statemachine[ state , mdfr , spcfr ]
+ {
+ FOLLOWPUSH(FOLLOW_any_def_statemachine_in_def_body_state_simplif6141);
+ ads=any_def_statemachine(ctx, state, mdfr, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_state_simplifEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2260:8: def_transition[ state , mdfr , spcfr ]
+ {
+ FOLLOWPUSH(FOLLOW_def_transition_in_def_body_state_simplif6152);
+ def_transition(ctx, state, mdfr, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_state_simplifEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2262:8: def_state_activity[ state ]
+ {
+ FOLLOWPUSH(FOLLOW_def_state_activity_in_def_body_state_simplif6163);
+ def_state_activity(ctx, state);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_body_state_simplifEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+
+ default:
+ goto loop171; /* break out of the loop */
+ break;
+ }
+ }
+ loop171: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_body_state_simplifEx; /* Prevent compiler warnings */
+ ruledef_body_state_simplifEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(71, def_body_state_simplif_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_body_state_simplif */
+
+/**
+ * $ANTLR start section_transition
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2267:1: section_transition[ sep::Machine * state ] : '@transition:' ( (m= modifier_transition )? def_transition[ state , mdfr , spcfr ] )* ;
+ */
+static void
+section_transition(pfmlParser ctx, sep::Machine * state)
+{
+ ANTLR3_UINT32 section_transition_StartIndex;
+
+ fmlParser_modifier_transition_return m;
+ #undef RETURN_TYPE_m
+ #define RETURN_TYPE_m fmlParser_modifier_transition_return
+
+ /* Initialize rule variables
+ */
+ section_transition_StartIndex = INDEX();
+
+
+
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(72)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2273:2: ( '@transition:' ( (m= modifier_transition )? def_transition[ state , mdfr , spcfr ] )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2273:4: '@transition:' ( (m= modifier_transition )? def_transition[ state , mdfr , spcfr ] )*
+ {
+ MATCHT(231, &FOLLOW_231_in_section_transition6194);
+ if (HASEXCEPTION())
+ {
+ goto rulesection_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2274:4: ( (m= modifier_transition )? def_transition[ state , mdfr , spcfr ] )*
+
+ for (;;)
+ {
+ int alt173=2;
+ switch ( LA(1) )
+ {
+ case AT_ID:
+ case 169:
+ case 306:
+ case 393:
+ case 395:
+ case 396:
+ {
+ alt173=1;
+ }
+ break;
+
+ }
+
+ switch (alt173)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2274:6: (m= modifier_transition )? def_transition[ state , mdfr , spcfr ]
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2274:6: (m= modifier_transition )?
+ {
+ int alt172=2;
+ switch ( LA(1) )
+ {
+ case 306:
+ case 393:
+ case 395:
+ {
+ alt172=1;
+ }
+ break;
+ }
+
+ switch (alt172)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2274:8: m= modifier_transition
+ {
+ FOLLOWPUSH(FOLLOW_modifier_transition_in_section_transition6205);
+ m=modifier_transition(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr = m.mdfr
+ ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_def_transition_in_section_transition6218);
+ def_transition(ctx, state, mdfr, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop173; /* break out of the loop */
+ break;
+ }
+ }
+ loop173: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulesection_transitionEx; /* Prevent compiler warnings */
+ rulesection_transitionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(72, section_transition_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end section_transition */
+
+/**
+ * $ANTLR start def_transition
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2279:1: def_transition[ sep::Machine * state ,\n\t\tsep::Modifier mdfr , sep::Specifier spcfr ] : ( (tok= '@' | (tok= AT_ID ) ) ( LT_ moc_transition[ trans ] GT )? moe_transition[ trans ] | 'transition' ( LT_ moc_transition[ trans ] GT )? (id= ID )? ( StringLiteral )? moe_transition[ trans ] );
+ */
+static void
+def_transition(pfmlParser ctx, sep::Machine * state, sep::Modifier mdfr, sep::Specifier spcfr)
+{
+ ANTLR3_UINT32 def_transition_StartIndex;
+
+ pANTLR3_COMMON_TOKEN tok;
+ pANTLR3_COMMON_TOKEN id;
+ pANTLR3_COMMON_TOKEN StringLiteral8;
+
+ /* Initialize rule variables
+ */
+ def_transition_StartIndex = INDEX();
+
+
+
+ sep::Transition * trans = NULL;
+ std::string t_id;
+
+ mProcedureCallCount = 0;
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(73)) )
+ {
+ {
+
+ if( (mProcedureCallCount > 0) && (trans != NULL) )
+ {
+ sep::ParserUtil::inlineTransitionProcedureCall(trans, trans->getNameID());
+ }
+
+ SET_RULE_LOCATION(trans);
+
+ }
+ {
+ }
+
+
+
+ return ;
+ }
+
+ tok = NULL;
+ id = NULL;
+ StringLiteral8 = NULL;
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2298:2: ( (tok= '@' | (tok= AT_ID ) ) ( LT_ moc_transition[ trans ] GT )? moe_transition[ trans ] | 'transition' ( LT_ moc_transition[ trans ] GT )? (id= ID )? ( StringLiteral )? moe_transition[ trans ] )
+
+ ANTLR3_UINT32 alt179;
+
+ alt179=2;
+
+ switch ( LA(1) )
+ {
+ case AT_ID:
+ case 169:
+ {
+ alt179=1;
+ }
+ break;
+ case 396:
+ {
+ alt179=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 179;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_transitionEx;
+
+ }
+
+ switch (alt179)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2298:4: (tok= '@' | (tok= AT_ID ) ) ( LT_ moc_transition[ trans ] GT )? moe_transition[ trans ]
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2298:4: (tok= '@' | (tok= AT_ID ) )
+ {
+ int alt174=2;
+ switch ( LA(1) )
+ {
+ case 169:
+ {
+ alt174=1;
+ }
+ break;
+ case AT_ID:
+ {
+ alt174=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 174;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_transitionEx;
+
+ }
+
+ switch (alt174)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2298:6: tok= '@'
+ {
+ tok = (pANTLR3_COMMON_TOKEN) MATCHT(169, &FOLLOW_169_in_def_transition6251);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2299:6: (tok= AT_ID )
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2299:6: (tok= AT_ID )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2299:8: tok= AT_ID
+ {
+ tok = (pANTLR3_COMMON_TOKEN) MATCHT(AT_ID, &FOLLOW_AT_ID_in_def_transition6262);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ t_id = STR((tok->getText(tok))->chars);
+ }
+
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+
+ state->getUniqBehaviorPart()->saveOutgoingTransition(
+ trans = new sep::Transition(state, newTransitionID(t_id)) );
+
+ trans->setModifier( mdfr );
+
+ trans->setSpecifier( spcfr );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2309:4: ( LT_ moc_transition[ trans ] GT )?
+ {
+ int alt175=2;
+ switch ( LA(1) )
+ {
+ case LT_:
+ {
+ alt175=1;
+ }
+ break;
+ }
+
+ switch (alt175)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2309:6: LT_ moc_transition[ trans ] GT
+ {
+ MATCHT(LT_, &FOLLOW_LT__in_def_transition6284);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_moc_transition_in_def_transition6287);
+ moc_transition(ctx, trans);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(GT, &FOLLOW_GT_in_def_transition6291);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_moe_transition_in_def_transition6300);
+ moe_transition(ctx, trans);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2313:4: 'transition' ( LT_ moc_transition[ trans ] GT )? (id= ID )? ( StringLiteral )? moe_transition[ trans ]
+ {
+ MATCHT(396, &FOLLOW_396_in_def_transition6307);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ state->getUniqBehaviorPart()->saveOutgoingTransition(
+ trans = new sep::Transition(state) );
+
+ trans->setModifier( mdfr );
+
+ trans->setSpecifier( spcfr );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2322:4: ( LT_ moc_transition[ trans ] GT )?
+ {
+ int alt176=2;
+ switch ( LA(1) )
+ {
+ case LT_:
+ {
+ alt176=1;
+ }
+ break;
+ }
+
+ switch (alt176)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2322:6: LT_ moc_transition[ trans ] GT
+ {
+ MATCHT(LT_, &FOLLOW_LT__in_def_transition6319);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_moc_transition_in_def_transition6321);
+ moc_transition(ctx, trans);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(GT, &FOLLOW_GT_in_def_transition6324);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2324:4: (id= ID )?
+ {
+ int alt177=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt177=1;
+ }
+ break;
+ }
+
+ switch (alt177)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2324:6: id= ID
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_def_transition6337);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ t_id = STR((id->getText(id))->chars);
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+ trans->fullyUpdateAllNameID( newTransitionID(t_id) );
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2327:4: ( StringLiteral )?
+ {
+ int alt178=2;
+ switch ( LA(1) )
+ {
+ case StringLiteral:
+ {
+ alt178=1;
+ }
+ break;
+ }
+
+ switch (alt178)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2327:6: StringLiteral
+ {
+ StringLiteral8 = (pANTLR3_COMMON_TOKEN) MATCHT(StringLiteral, &FOLLOW_StringLiteral_in_def_transition6355);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ trans->setUnrestrictedName(STR((StringLiteral8->getText(StringLiteral8))->chars));
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_moe_transition_in_def_transition6372);
+ moe_transition(ctx, trans);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_transitionEx; /* Prevent compiler warnings */
+ ruledef_transitionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ if( (mProcedureCallCount > 0) && (trans != NULL) )
+ {
+ sep::ParserUtil::inlineTransitionProcedureCall(trans, trans->getNameID());
+ }
+
+ SET_RULE_LOCATION(trans);
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(73, def_transition_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_transition */
+
+/**
+ * $ANTLR start kind_transition
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2334:1: kind_transition returns [ sep::Transition::MOC_KIND kind ] : (id= ID | 'abort' | 'final' | 'else' | 'flow' );
+ */
+static sep::Transition::MOC_KIND
+kind_transition(pfmlParser ctx)
+{
+ sep::Transition::MOC_KIND kind;
+
+ ANTLR3_UINT32 kind_transition_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+
+ /* Initialize rule variables
+ */
+ kind_transition_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(74)) )
+ {
+ {
+ }
+
+
+
+ return kind;
+ }
+
+ id = NULL;
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2336:2: (id= ID | 'abort' | 'final' | 'else' | 'flow' )
+
+ ANTLR3_UINT32 alt180;
+
+ alt180=5;
+
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt180=1;
+ }
+ break;
+ case 236:
+ {
+ alt180=2;
+ }
+ break;
+ case 282:
+ {
+ alt180=3;
+ }
+ break;
+ case 273:
+ {
+ alt180=4;
+ }
+ break;
+ case 284:
+ {
+ alt180=5;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return kind;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 180;
+ EXCEPTION->state = 0;
+
+
+ goto rulekind_transitionEx;
+
+ }
+
+ switch (alt180)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2336:4: id= ID
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_kind_transition6390);
+ if (HASEXCEPTION())
+ {
+ goto rulekind_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ if( (kind= sep::Transition::toMocKind(STR((id->getText(id))->chars))) ==
+ sep::Transition::MOC_UNDEFINED_KIND )
+ {
+ sep::ParserUtil::avm_syntax_error( "kind_transition", (id->getLine(id)) )
+ << "unexpected ID< " << STR((id->getText(id))->chars) << " >"
+ << sep::ParserUtil::SYNTAX_ERROR_EOL;
+
+ }
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2347:4: 'abort'
+ {
+ MATCHT(236, &FOLLOW_236_in_kind_transition6399);
+ if (HASEXCEPTION())
+ {
+ goto rulekind_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ kind= sep::Transition::MOC_ABORT_KIND;
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2348:4: 'final'
+ {
+ MATCHT(282, &FOLLOW_282_in_kind_transition6409);
+ if (HASEXCEPTION())
+ {
+ goto rulekind_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ kind= sep::Transition::MOC_FINAL_KIND;
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2349:4: 'else'
+ {
+ MATCHT(273, &FOLLOW_273_in_kind_transition6419);
+ if (HASEXCEPTION())
+ {
+ goto rulekind_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ kind= sep::Transition::MOC_ELSE_KIND;
+
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2352:4: 'flow'
+ {
+ MATCHT(284, &FOLLOW_284_in_kind_transition6432);
+ if (HASEXCEPTION())
+ {
+ goto rulekind_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ kind= sep::Transition::MOC_FLOW_KIND;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulekind_transitionEx; /* Prevent compiler warnings */
+ rulekind_transitionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(74, kind_transition_StartIndex); }
+
+ return kind;
+}
+/* $ANTLR end kind_transition */
+
+/**
+ * $ANTLR start moc_transition_attribute
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2356:1: moc_transition_attribute returns [ sep::Transition::moc_kind_t kind ] : kt= kind_transition ( BAND 'else' )? ;
+ */
+static sep::Transition::moc_kind_t
+moc_transition_attribute(pfmlParser ctx)
+{
+ sep::Transition::moc_kind_t kind;
+
+ ANTLR3_UINT32 moc_transition_attribute_StartIndex;
+
+ sep::Transition::MOC_KIND kt;
+ #undef RETURN_TYPE_kt
+ #define RETURN_TYPE_kt sep::Transition::MOC_KIND
+
+ /* Initialize rule variables
+ */
+ moc_transition_attribute_StartIndex = INDEX();
+
+
+
+ kind= sep::Transition::MOC_UNDEFINED_KIND;
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(75)) )
+ {
+ {
+ }
+
+
+
+ return kind;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2361:2: (kt= kind_transition ( BAND 'else' )? )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2361:4: kt= kind_transition ( BAND 'else' )?
+ {
+ FOLLOWPUSH(FOLLOW_kind_transition_in_moc_transition_attribute6460);
+ kt=kind_transition(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulemoc_transition_attributeEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ kind=
+ kt
+ ;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2362:2: ( BAND 'else' )?
+ {
+ int alt181=2;
+ switch ( LA(1) )
+ {
+ case BAND:
+ {
+ alt181=1;
+ }
+ break;
+ }
+
+ switch (alt181)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2362:4: BAND 'else'
+ {
+ MATCHT(BAND, &FOLLOW_BAND_in_moc_transition_attribute6467);
+ if (HASEXCEPTION())
+ {
+ goto rulemoc_transition_attributeEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ MATCHT(273, &FOLLOW_273_in_moc_transition_attribute6469);
+ if (HASEXCEPTION())
+ {
+ goto rulemoc_transition_attributeEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ kind=
+ kind
+ | sep::Transition::MOC_ELSE_KIND;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulemoc_transition_attributeEx; /* Prevent compiler warnings */
+ rulemoc_transition_attributeEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(75, moc_transition_attribute_StartIndex); }
+
+ return kind;
+}
+/* $ANTLR end moc_transition_attribute */
+
+/**
+ * $ANTLR start moc_transition
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2365:1: moc_transition[ sep::Transition * trans ] : moc_transition_atom[ trans ] ( COMMA moc_transition_atom[ trans ] )* ;
+ */
+static void
+moc_transition(pfmlParser ctx, sep::Transition * trans)
+{
+ ANTLR3_UINT32 moc_transition_StartIndex;
+
+ /* Initialize rule variables
+ */
+ moc_transition_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(76)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2366:2: ( moc_transition_atom[ trans ] ( COMMA moc_transition_atom[ trans ] )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2366:4: moc_transition_atom[ trans ] ( COMMA moc_transition_atom[ trans ] )*
+ {
+ FOLLOWPUSH(FOLLOW_moc_transition_atom_in_moc_transition6494);
+ moc_transition_atom(ctx, trans);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulemoc_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2366:33: ( COMMA moc_transition_atom[ trans ] )*
+
+ for (;;)
+ {
+ int alt182=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt182=1;
+ }
+ break;
+
+ }
+
+ switch (alt182)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2366:35: COMMA moc_transition_atom[ trans ]
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_moc_transition6499);
+ if (HASEXCEPTION())
+ {
+ goto rulemoc_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_moc_transition_atom_in_moc_transition6501);
+ moc_transition_atom(ctx, trans);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulemoc_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop182; /* break out of the loop */
+ break;
+ }
+ }
+ loop182: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulemoc_transitionEx; /* Prevent compiler warnings */
+ rulemoc_transitionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(76, moc_transition_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end moc_transition */
+
+/**
+ * $ANTLR start moc_transition_atom
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2369:1: moc_transition_atom[ sep::Transition * trans ] : ( ( 'moc:' )? kt= moc_transition_attribute | ( 'prior:' )? n= integer_constant | ( 'proba:' )? p= float_constant );
+ */
+static void
+moc_transition_atom(pfmlParser ctx, sep::Transition * trans)
+{
+ ANTLR3_UINT32 moc_transition_atom_StartIndex;
+
+ sep::Transition::moc_kind_t kt;
+ #undef RETURN_TYPE_kt
+ #define RETURN_TYPE_kt sep::Transition::moc_kind_t
+
+ sep::avm_size_t n;
+ #undef RETURN_TYPE_n
+ #define RETURN_TYPE_n sep::avm_size_t
+
+ sep::avm_float_t p;
+ #undef RETURN_TYPE_p
+ #define RETURN_TYPE_p sep::avm_float_t
+
+ /* Initialize rule variables
+ */
+ moc_transition_atom_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(77)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2370:2: ( ( 'moc:' )? kt= moc_transition_attribute | ( 'prior:' )? n= integer_constant | ( 'proba:' )? p= float_constant )
+
+ ANTLR3_UINT32 alt186;
+
+ alt186=3;
+
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ {
+ int LA186_1 = LA(2);
+ if ( (synpred324_fml(ctx)))
+ {
+ alt186=1;
+ }
+ else if ( (synpred326_fml(ctx)))
+ {
+ alt186=2;
+ }
+ else if ( (ANTLR3_TRUE))
+ {
+ alt186=3;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 186;
+ EXCEPTION->state = 1;
+
+
+ goto rulemoc_transition_atomEx;
+
+ }
+ }
+ }
+ break;
+ case 236:
+ case 273:
+ case 282:
+ case 284:
+ case 321:
+ {
+ alt186=1;
+ }
+ break;
+ case IntegerLiteral:
+ case 348:
+ {
+ alt186=2;
+ }
+ break;
+ case FloatLiteral:
+ case 350:
+ {
+ alt186=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 186;
+ EXCEPTION->state = 0;
+
+
+ goto rulemoc_transition_atomEx;
+
+ }
+
+ switch (alt186)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2370:4: ( 'moc:' )? kt= moc_transition_attribute
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2370:4: ( 'moc:' )?
+ {
+ int alt183=2;
+ switch ( LA(1) )
+ {
+ case 321:
+ {
+ alt183=1;
+ }
+ break;
+ }
+
+ switch (alt183)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2370:6: 'moc:'
+ {
+ MATCHT(321, &FOLLOW_321_in_moc_transition_atom6520);
+ if (HASEXCEPTION())
+ {
+ goto rulemoc_transition_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_moc_transition_attribute_in_moc_transition_atom6527);
+ kt=moc_transition_attribute(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulemoc_transition_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ trans->setMocKind( kt
+ );
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2373:4: ( 'prior:' )? n= integer_constant
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2373:4: ( 'prior:' )?
+ {
+ int alt184=2;
+ switch ( LA(1) )
+ {
+ case 348:
+ {
+ alt184=1;
+ }
+ break;
+ }
+
+ switch (alt184)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2373:6: 'prior:'
+ {
+ MATCHT(348, &FOLLOW_348_in_moc_transition_atom6538);
+ if (HASEXCEPTION())
+ {
+ goto rulemoc_transition_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_integer_constant_in_moc_transition_atom6545);
+ n=integer_constant(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulemoc_transition_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ trans->setPriority( n
+ );
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2376:4: ( 'proba:' )? p= float_constant
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2376:4: ( 'proba:' )?
+ {
+ int alt185=2;
+ switch ( LA(1) )
+ {
+ case 350:
+ {
+ alt185=1;
+ }
+ break;
+ }
+
+ switch (alt185)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2376:6: 'proba:'
+ {
+ MATCHT(350, &FOLLOW_350_in_moc_transition_atom6556);
+ if (HASEXCEPTION())
+ {
+ goto rulemoc_transition_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_float_constant_in_moc_transition_atom6563);
+ p=float_constant(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulemoc_transition_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ trans->setProbability( p
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulemoc_transition_atomEx; /* Prevent compiler warnings */
+ rulemoc_transition_atomEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(77, moc_transition_atom_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end moc_transition_atom */
+
+/**
+ * $ANTLR start moe_transition
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2381:1: moe_transition[ sep::Transition * trans ] : (bs= transition_statement ( ( '-->' )? tid= target_state_id SEMI )? | '-->' tid= target_state_id (bs= transition_statement | SEMI ) );
+ */
+static void
+moe_transition(pfmlParser ctx, sep::Transition * trans)
+{
+ ANTLR3_UINT32 moe_transition_StartIndex;
+
+ sep::BFCode bs;
+ #undef RETURN_TYPE_bs
+ #define RETURN_TYPE_bs sep::BFCode
+
+ sep::BF tid;
+ #undef RETURN_TYPE_tid
+ #define RETURN_TYPE_tid sep::BF
+
+ /* Initialize rule variables
+ */
+ moe_transition_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(78)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2382:2: (bs= transition_statement ( ( '-->' )? tid= target_state_id SEMI )? | '-->' tid= target_state_id (bs= transition_statement | SEMI ) )
+
+ ANTLR3_UINT32 alt190;
+
+ alt190=2;
+
+ switch ( LA(1) )
+ {
+ case LCURLY:
+ {
+ alt190=1;
+ }
+ break;
+ case 163:
+ {
+ alt190=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 190;
+ EXCEPTION->state = 0;
+
+
+ goto rulemoe_transitionEx;
+
+ }
+
+ switch (alt190)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2382:4: bs= transition_statement ( ( '-->' )? tid= target_state_id SEMI )?
+ {
+ FOLLOWPUSH(FOLLOW_transition_statement_in_moe_transition6582);
+ bs=transition_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulemoe_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ trans->setStatement(bs
+ );
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2383:4: ( ( '-->' )? tid= target_state_id SEMI )?
+ {
+ int alt188=2;
+ switch ( LA(1) )
+ {
+ case 144:
+ case 145:
+ case 147:
+ case 148:
+ case 149:
+ case 150:
+ case 153:
+ {
+ {
+ int LA188_1 = LA(2);
+ if ( (synpred329_fml(ctx)))
+ {
+ alt188=1;
+ }
+ }
+ }
+ break;
+ case DOLLAR:
+ case ID:
+ case 146:
+ case 163:
+ {
+ alt188=1;
+ }
+ break;
+ }
+
+ switch (alt188)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2383:6: ( '-->' )? tid= target_state_id SEMI
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2383:6: ( '-->' )?
+ {
+ int alt187=2;
+ switch ( LA(1) )
+ {
+ case 163:
+ {
+ alt187=1;
+ }
+ break;
+ }
+
+ switch (alt187)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2383:8: '-->'
+ {
+ MATCHT(163, &FOLLOW_163_in_moe_transition6600);
+ if (HASEXCEPTION())
+ {
+ goto rulemoe_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_target_state_id_in_moe_transition6612);
+ tid=target_state_id(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulemoe_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ trans->setTarget(tid
+ );
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_moe_transition6629);
+ if (HASEXCEPTION())
+ {
+ goto rulemoe_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2388:4: '-->' tid= target_state_id (bs= transition_statement | SEMI )
+ {
+ MATCHT(163, &FOLLOW_163_in_moe_transition6638);
+ if (HASEXCEPTION())
+ {
+ goto rulemoe_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_target_state_id_in_moe_transition6642);
+ tid=target_state_id(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulemoe_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ trans->setTarget(tid
+ );
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2390:4: (bs= transition_statement | SEMI )
+ {
+ int alt189=2;
+ switch ( LA(1) )
+ {
+ case LCURLY:
+ {
+ alt189=1;
+ }
+ break;
+ case SEMI:
+ {
+ alt189=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 189;
+ EXCEPTION->state = 0;
+
+
+ goto rulemoe_transitionEx;
+
+ }
+
+ switch (alt189)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2390:6: bs= transition_statement
+ {
+ FOLLOWPUSH(FOLLOW_transition_statement_in_moe_transition6659);
+ bs=transition_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulemoe_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ trans->setStatement(bs
+ );
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2391:6: SEMI
+ {
+ MATCHT(SEMI, &FOLLOW_SEMI_in_moe_transition6673);
+ if (HASEXCEPTION())
+ {
+ goto rulemoe_transitionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulemoe_transitionEx; /* Prevent compiler warnings */
+ rulemoe_transitionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(78, moe_transition_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end moe_transition */
+
+/**
+ * $ANTLR start transition_statement
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2395:1: transition_statement returns [ sep::BFCode ac ] : LCURLY (o= op_block )? (s= statement )* ( transition_trigger[ ac ] )? ( transition_guard[ ac ] )? ( transition_timed_guard[ ac ] )? ( transition_effect[ ac ] )? RCURLY ;
+ */
+static sep::BFCode
+transition_statement(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 transition_statement_StartIndex;
+
+ sep::Operator * o;
+ #undef RETURN_TYPE_o
+ #define RETURN_TYPE_o sep::Operator *
+
+ sep::BFCode s;
+ #undef RETURN_TYPE_s
+ #define RETURN_TYPE_s sep::BFCode
+
+ /* Initialize rule variables
+ */
+ transition_statement_StartIndex = INDEX();
+
+
+
+ sep::Operator * op = OP(SEQUENCE);
+ bool implicitSequenceOp = true;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(79)) )
+ {
+ {
+
+ if( implicitSequenceOp && ac
+ .valid() && ac
+ ->singleton() &&
+ sep::OperatorManager::isSchedule(op) )
+ {
+ sep::BFCode singleCode = ac
+ ->first().bfCode();
+ ac= singleCode;
+
+ }
+
+ }
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2409:2: ( LCURLY (o= op_block )? (s= statement )* ( transition_trigger[ ac ] )? ( transition_guard[ ac ] )? ( transition_timed_guard[ ac ] )? ( transition_effect[ ac ] )? RCURLY )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2409:4: LCURLY (o= op_block )? (s= statement )* ( transition_trigger[ ac ] )? ( transition_guard[ ac ] )? ( transition_timed_guard[ ac ] )? ( transition_effect[ ac ] )? RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_transition_statement6701);
+ if (HASEXCEPTION())
+ {
+ goto ruletransition_statementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2409:12: (o= op_block )?
+ {
+ int alt191=2;
+ switch ( LA(1) )
+ {
+ case OP_ATOMIC_SEQUENCE:
+ case OP_CONCURRENCY_AND:
+ case OP_CONCURRENCY_ASYNC:
+ case OP_CONCURRENCY_INTERLEAVING:
+ case OP_CONCURRENCY_OR:
+ case OP_CONCURRENCY_PARALLEL:
+ case OP_CONCURRENCY_RDV_AND:
+ case OP_CONCURRENCY_RDV_ASYNC:
+ case OP_CONCURRENCY_RDV_INTERLEAVING:
+ case OP_CONCURRENCY_RDV_OR:
+ case OP_CONCURRENCY_RDV_PARALLEL:
+ case OP_FORK:
+ case OP_JOIN:
+ case OP_NON_DETERMINISM:
+ case OP_SCHEDULE_AND_THEN:
+ case OP_SCHEDULE_GT:
+ case OP_SCHEDULE_LT:
+ case OP_SCHEDULE_OR_ELSE:
+ case OP_SCHEDULE_XOR:
+ case OP_SEQUENCE:
+ case OP_SEQUENCE_SIDE:
+ case OP_SEQUENCE_WEAK:
+ {
+ alt191=1;
+ }
+ break;
+ }
+
+ switch (alt191)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2409:14: o= op_block
+ {
+ FOLLOWPUSH(FOLLOW_op_block_in_transition_statement6708);
+ o=op_block(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletransition_statementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op = o
+ ; implicitSequenceOp = false;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT(op);
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2411:3: (s= statement )*
+
+ for (;;)
+ {
+ int alt192=2;
+ switch ( LA(1) )
+ {
+ case COLONx2:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case ID:
+ case INCR:
+ case LCURLY:
+ case LPAREN_INVOKE:
+ case STATEMENT_PROMPT:
+ case 154:
+ case 155:
+ case 156:
+ case 157:
+ case 236:
+ case 247:
+ case 250:
+ case 256:
+ case 263:
+ case 267:
+ case 268:
+ case 269:
+ case 275:
+ case 278:
+ case 279:
+ case 282:
+ case 285:
+ case 289:
+ case 290:
+ case 291:
+ case 292:
+ case 293:
+ case 294:
+ case 296:
+ case 299:
+ case 300:
+ case 301:
+ case 302:
+ case 303:
+ case 304:
+ case 305:
+ case 312:
+ case 330:
+ case 336:
+ case 337:
+ case 338:
+ case 339:
+ case 340:
+ case 341:
+ case 362:
+ case 363:
+ case 364:
+ case 368:
+ case 369:
+ case 371:
+ case 377:
+ case 385:
+ case 386:
+ case 389:
+ case 391:
+ case 415:
+ case 416:
+ {
+ alt192=1;
+ }
+ break;
+
+ }
+
+ switch (alt192)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2411:5: s= statement
+ {
+ FOLLOWPUSH(FOLLOW_statement_in_transition_statement6728);
+ s=statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletransition_statementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append(s
+ );
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop192; /* break out of the loop */
+ break;
+ }
+ }
+ loop192: ; /* Jump out to here if this rule does not match */
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2413:3: ( transition_trigger[ ac ] )?
+ {
+ int alt193=2;
+ switch ( LA(1) )
+ {
+ case 232:
+ {
+ alt193=1;
+ }
+ break;
+ }
+
+ switch (alt193)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2413:5: transition_trigger[ ac ]
+ {
+ FOLLOWPUSH(FOLLOW_transition_trigger_in_transition_statement6741);
+ transition_trigger(ctx, ac);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletransition_statementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2414:3: ( transition_guard[ ac ] )?
+ {
+ int alt194=2;
+ switch ( LA(1) )
+ {
+ case 187:
+ {
+ alt194=1;
+ }
+ break;
+ }
+
+ switch (alt194)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2414:5: transition_guard[ ac ]
+ {
+ FOLLOWPUSH(FOLLOW_transition_guard_in_transition_statement6751);
+ transition_guard(ctx, ac);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletransition_statementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2415:3: ( transition_timed_guard[ ac ] )?
+ {
+ int alt195=2;
+ switch ( LA(1) )
+ {
+ case 230:
+ {
+ alt195=1;
+ }
+ break;
+ }
+
+ switch (alt195)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2415:5: transition_timed_guard[ ac ]
+ {
+ FOLLOWPUSH(FOLLOW_transition_timed_guard_in_transition_statement6761);
+ transition_timed_guard(ctx, ac);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletransition_statementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2416:3: ( transition_effect[ ac ] )?
+ {
+ int alt196=2;
+ switch ( LA(1) )
+ {
+ case 181:
+ {
+ alt196=1;
+ }
+ break;
+ }
+
+ switch (alt196)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2416:5: transition_effect[ ac ]
+ {
+ FOLLOWPUSH(FOLLOW_transition_effect_in_transition_statement6771);
+ transition_effect(ctx, ac);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletransition_statementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_transition_statement6780);
+ if (HASEXCEPTION())
+ {
+ goto ruletransition_statementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruletransition_statementEx; /* Prevent compiler warnings */
+ ruletransition_statementEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ if( implicitSequenceOp && ac
+ .valid() && ac
+ ->singleton() &&
+ sep::OperatorManager::isSchedule(op) )
+ {
+ sep::BFCode singleCode = ac
+ ->first().bfCode();
+ ac= singleCode;
+
+ }
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(79, transition_statement_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end transition_statement */
+
+/**
+ * $ANTLR start transition_trigger
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2420:1: transition_trigger[ sep::BFCode & ac ] : '@trigger:' (s= statement_com_input )* ;
+ */
+static void
+transition_trigger(pfmlParser ctx, sep::BFCode & ac)
+{
+ ANTLR3_UINT32 transition_trigger_StartIndex;
+
+ sep::BFCode s;
+ #undef RETURN_TYPE_s
+ #define RETURN_TYPE_s sep::BFCode
+
+ /* Initialize rule variables
+ */
+ transition_trigger_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(80)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2421:2: ( '@trigger:' (s= statement_com_input )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2421:4: '@trigger:' (s= statement_com_input )*
+ {
+ MATCHT(232, &FOLLOW_232_in_transition_trigger6793);
+ if (HASEXCEPTION())
+ {
+ goto ruletransition_triggerEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2421:16: (s= statement_com_input )*
+
+ for (;;)
+ {
+ int alt197=2;
+ switch ( LA(1) )
+ {
+ case 299:
+ case 300:
+ case 301:
+ case 302:
+ case 303:
+ case 304:
+ case 305:
+ {
+ alt197=1;
+ }
+ break;
+
+ }
+
+ switch (alt197)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2421:18: s= statement_com_input
+ {
+ FOLLOWPUSH(FOLLOW_statement_com_input_in_transition_trigger6799);
+ s=statement_com_input(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletransition_triggerEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac->append(
+ s
+ );
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop197; /* break out of the loop */
+ break;
+ }
+ }
+ loop197: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruletransition_triggerEx; /* Prevent compiler warnings */
+ ruletransition_triggerEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(80, transition_trigger_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end transition_trigger */
+
+/**
+ * $ANTLR start transition_guard
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2424:1: transition_guard[ sep::BFCode & ac ] : '@guard:' (s= statement_guard |e= expression | LBRACKET e= expression RBRACKET )* ;
+ */
+static void
+transition_guard(pfmlParser ctx, sep::BFCode & ac)
+{
+ ANTLR3_UINT32 transition_guard_StartIndex;
+
+ sep::BFCode s;
+ #undef RETURN_TYPE_s
+ #define RETURN_TYPE_s sep::BFCode
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ transition_guard_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(81)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2425:2: ( '@guard:' (s= statement_guard |e= expression | LBRACKET e= expression RBRACKET )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2425:4: '@guard:' (s= statement_guard |e= expression | LBRACKET e= expression RBRACKET )*
+ {
+ MATCHT(187, &FOLLOW_187_in_transition_guard6819);
+ if (HASEXCEPTION())
+ {
+ goto ruletransition_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2426:3: (s= statement_guard |e= expression | LBRACKET e= expression RBRACKET )*
+
+ for (;;)
+ {
+ int alt198=4;
+ switch ( LA(1) )
+ {
+ case 278:
+ case 290:
+ {
+ alt198=1;
+ }
+ break;
+ case LBRACKET:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA198_2 = LA(2);
+ if ( (synpred340_fml(ctx)))
+ {
+ alt198=2;
+ }
+ else if ( (synpred341_fml(ctx)))
+ {
+ alt198=3;
+ }
+
+ }
+ }
+ break;
+ case BNOT:
+ case COLONx2:
+ case CharLiteral:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case FloatLiteral:
+ case ID:
+ case INCR:
+ case IntegerLiteral:
+ case LBRACKET_BAR:
+ case LCURLY:
+ case LNOT:
+ case LPAREN:
+ case LPAREN_INVOKE:
+ case MINUS:
+ case OP_POP:
+ case OP_TOP:
+ case PERCENT_LCURLY:
+ case PLUS:
+ case RationalLiteral:
+ case StringLiteral:
+ case 158:
+ case 159:
+ case 160:
+ case 161:
+ case 162:
+ case 237:
+ case 256:
+ case 265:
+ case 277:
+ case 280:
+ case 294:
+ case 313:
+ case 330:
+ case 331:
+ case 332:
+ case 343:
+ case 347:
+ case 372:
+ case 397:
+ {
+ alt198=2;
+ }
+ break;
+
+ }
+
+ switch (alt198)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2426:5: s= statement_guard
+ {
+ FOLLOWPUSH(FOLLOW_statement_guard_in_transition_guard6827);
+ s=statement_guard(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletransition_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac->append(
+ s
+ );
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2429:5: e= expression
+ {
+ FOLLOWPUSH(FOLLOW_expression_in_transition_guard6840);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletransition_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac->append( NEW_STMT1(OP(GUARD),
+ e
+ ) );
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2432:5: LBRACKET e= expression RBRACKET
+ {
+ MATCHT(LBRACKET, &FOLLOW_LBRACKET_in_transition_guard6851);
+ if (HASEXCEPTION())
+ {
+ goto ruletransition_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_transition_guard6855);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletransition_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(RBRACKET, &FOLLOW_RBRACKET_in_transition_guard6857);
+ if (HASEXCEPTION())
+ {
+ goto ruletransition_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac->append( NEW_STMT1(OP(GUARD),
+ e
+ ) );
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop198; /* break out of the loop */
+ break;
+ }
+ }
+ loop198: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruletransition_guardEx; /* Prevent compiler warnings */
+ ruletransition_guardEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(81, transition_guard_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end transition_guard */
+
+/**
+ * $ANTLR start transition_timed_guard
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2437:1: transition_timed_guard[ sep::BFCode & ac ] : '@tguard:' (s= statement_timed_guard |e= expression | LCURLY e= expression RCURLY )* ;
+ */
+static void
+transition_timed_guard(pfmlParser ctx, sep::BFCode & ac)
+{
+ ANTLR3_UINT32 transition_timed_guard_StartIndex;
+
+ sep::BFCode s;
+ #undef RETURN_TYPE_s
+ #define RETURN_TYPE_s sep::BFCode
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ transition_timed_guard_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(82)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2438:2: ( '@tguard:' (s= statement_timed_guard |e= expression | LCURLY e= expression RCURLY )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2438:4: '@tguard:' (s= statement_timed_guard |e= expression | LCURLY e= expression RCURLY )*
+ {
+ MATCHT(230, &FOLLOW_230_in_transition_timed_guard6879);
+ if (HASEXCEPTION())
+ {
+ goto ruletransition_timed_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2439:3: (s= statement_timed_guard |e= expression | LCURLY e= expression RCURLY )*
+
+ for (;;)
+ {
+ int alt199=4;
+ switch ( LA(1) )
+ {
+ case 391:
+ {
+ alt199=1;
+ }
+ break;
+ case LCURLY:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA199_2 = LA(2);
+ if ( (synpred343_fml(ctx)))
+ {
+ alt199=2;
+ }
+ else if ( (synpred344_fml(ctx)))
+ {
+ alt199=3;
+ }
+
+ }
+ }
+ break;
+ case BNOT:
+ case COLONx2:
+ case CharLiteral:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case FloatLiteral:
+ case ID:
+ case INCR:
+ case IntegerLiteral:
+ case LBRACKET:
+ case LBRACKET_BAR:
+ case LNOT:
+ case LPAREN:
+ case LPAREN_INVOKE:
+ case MINUS:
+ case OP_POP:
+ case OP_TOP:
+ case PERCENT_LCURLY:
+ case PLUS:
+ case RationalLiteral:
+ case StringLiteral:
+ case 158:
+ case 159:
+ case 160:
+ case 161:
+ case 162:
+ case 237:
+ case 256:
+ case 265:
+ case 277:
+ case 280:
+ case 294:
+ case 313:
+ case 330:
+ case 331:
+ case 332:
+ case 343:
+ case 347:
+ case 372:
+ case 397:
+ {
+ alt199=2;
+ }
+ break;
+
+ }
+
+ switch (alt199)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2439:5: s= statement_timed_guard
+ {
+ FOLLOWPUSH(FOLLOW_statement_timed_guard_in_transition_timed_guard6887);
+ s=statement_timed_guard(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletransition_timed_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac->append(
+ s
+ );
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2442:5: e= expression
+ {
+ FOLLOWPUSH(FOLLOW_expression_in_transition_timed_guard6900);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletransition_timed_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac->append( NEW_STMT1(OP(TIMED_GUARD),
+ e
+ ) );
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2445:5: LCURLY e= expression RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_transition_timed_guard6911);
+ if (HASEXCEPTION())
+ {
+ goto ruletransition_timed_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_transition_timed_guard6915);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletransition_timed_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_transition_timed_guard6917);
+ if (HASEXCEPTION())
+ {
+ goto ruletransition_timed_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac->append( NEW_STMT1(OP(TIMED_GUARD),
+ e
+ ) );
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop199; /* break out of the loop */
+ break;
+ }
+ }
+ loop199: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruletransition_timed_guardEx; /* Prevent compiler warnings */
+ ruletransition_timed_guardEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(82, transition_timed_guard_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end transition_timed_guard */
+
+/**
+ * $ANTLR start transition_effect
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2450:1: transition_effect[ sep::BFCode & ac ] : '@effect:' (s= statement )* ;
+ */
+static void
+transition_effect(pfmlParser ctx, sep::BFCode & ac)
+{
+ ANTLR3_UINT32 transition_effect_StartIndex;
+
+ sep::BFCode s;
+ #undef RETURN_TYPE_s
+ #define RETURN_TYPE_s sep::BFCode
+
+ /* Initialize rule variables
+ */
+ transition_effect_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(83)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2451:2: ( '@effect:' (s= statement )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2451:4: '@effect:' (s= statement )*
+ {
+ MATCHT(181, &FOLLOW_181_in_transition_effect6939);
+ if (HASEXCEPTION())
+ {
+ goto ruletransition_effectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2451:15: (s= statement )*
+
+ for (;;)
+ {
+ int alt200=2;
+ switch ( LA(1) )
+ {
+ case COLONx2:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case ID:
+ case INCR:
+ case LCURLY:
+ case LPAREN_INVOKE:
+ case STATEMENT_PROMPT:
+ case 154:
+ case 155:
+ case 156:
+ case 157:
+ case 236:
+ case 247:
+ case 250:
+ case 256:
+ case 263:
+ case 267:
+ case 268:
+ case 269:
+ case 275:
+ case 278:
+ case 279:
+ case 282:
+ case 285:
+ case 289:
+ case 290:
+ case 291:
+ case 292:
+ case 293:
+ case 294:
+ case 296:
+ case 299:
+ case 300:
+ case 301:
+ case 302:
+ case 303:
+ case 304:
+ case 305:
+ case 312:
+ case 330:
+ case 336:
+ case 337:
+ case 338:
+ case 339:
+ case 340:
+ case 341:
+ case 362:
+ case 363:
+ case 364:
+ case 368:
+ case 369:
+ case 371:
+ case 377:
+ case 385:
+ case 386:
+ case 389:
+ case 391:
+ case 415:
+ case 416:
+ {
+ alt200=1;
+ }
+ break;
+
+ }
+
+ switch (alt200)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2451:17: s= statement
+ {
+ FOLLOWPUSH(FOLLOW_statement_in_transition_effect6945);
+ s=statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletransition_effectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac->append(
+ s
+ );
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop200; /* break out of the loop */
+ break;
+ }
+ }
+ loop200: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruletransition_effectEx; /* Prevent compiler warnings */
+ ruletransition_effectEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(83, transition_effect_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end transition_effect */
+
+/**
+ * $ANTLR start target_state_id
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2455:1: target_state_id returns [ sep::BF target ] : (kw= target_state_kw_id |u= qualifiedNameID | DOLLAR id= ID );
+ */
+static sep::BF
+target_state_id(pfmlParser ctx)
+{
+ sep::BF target;
+
+ ANTLR3_UINT32 target_state_id_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ std::string kw;
+ #undef RETURN_TYPE_kw
+ #define RETURN_TYPE_kw std::string
+
+ fmlParser_qualifiedNameID_return u;
+ #undef RETURN_TYPE_u
+ #define RETURN_TYPE_u fmlParser_qualifiedNameID_return
+
+ /* Initialize rule variables
+ */
+ target_state_id_StartIndex = INDEX();
+
+
+
+ std::string tid;
+ sep::avm_size_t nb = 1;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(84)) )
+ {
+ {
+
+ if( (target = sep::ParserUtil::getvarMachine(tid, nb)).invalid() )
+ {
+ target = NEW_QNID(tid, nb);
+ }
+
+ }
+ {
+ }
+
+
+
+ return target;
+ }
+
+ id = NULL;
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2467:2: (kw= target_state_kw_id |u= qualifiedNameID | DOLLAR id= ID )
+
+ ANTLR3_UINT32 alt201;
+
+ alt201=3;
+
+ switch ( LA(1) )
+ {
+ case 144:
+ case 145:
+ case 146:
+ case 147:
+ case 148:
+ case 149:
+ case 150:
+ case 153:
+ {
+ alt201=1;
+ }
+ break;
+ case ID:
+ {
+ alt201=2;
+ }
+ break;
+ case DOLLAR:
+ {
+ alt201=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return target;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 201;
+ EXCEPTION->state = 0;
+
+
+ goto ruletarget_state_idEx;
+
+ }
+
+ switch (alt201)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2467:4: kw= target_state_kw_id
+ {
+ FOLLOWPUSH(FOLLOW_target_state_kw_id_in_target_state_id6977);
+ kw=target_state_kw_id(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletarget_state_idEx;
+ }
+ if (HASFAILED())
+ {
+ return target;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ tid = kw
+ ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2469:4: u= qualifiedNameID
+ {
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_target_state_id6988);
+ u=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletarget_state_idEx;
+ }
+ if (HASFAILED())
+ {
+ return target;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ tid = u.s
+ ; nb = u.nb
+ ;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2471:4: DOLLAR id= ID
+ {
+ MATCHT(DOLLAR, &FOLLOW_DOLLAR_in_target_state_id7005);
+ if (HASEXCEPTION())
+ {
+ goto ruletarget_state_idEx;
+ }
+ if (HASFAILED())
+ {
+ return target;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_target_state_id7009);
+ if (HASEXCEPTION())
+ {
+ goto ruletarget_state_idEx;
+ }
+ if (HASFAILED())
+ {
+ return target;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ tid ="$" + STR((id->getText(id))->chars);
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruletarget_state_idEx; /* Prevent compiler warnings */
+ ruletarget_state_idEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ if( (target = sep::ParserUtil::getvarMachine(tid, nb)).invalid() )
+ {
+ target = NEW_QNID(tid, nb);
+ }
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(84, target_state_id_StartIndex); }
+
+ return target;
+}
+/* $ANTLR end target_state_id */
+
+/**
+ * $ANTLR start target_state_kw_id
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2475:1: target_state_kw_id returns [ std::string s ] : ( '#init' | '#initial' | '#start' | '#dhistory' | '#shistory' | '#final' | '#terminal' | '#return' );
+ */
+static std::string
+target_state_kw_id(pfmlParser ctx)
+{
+ std::string s;
+
+ ANTLR3_UINT32 target_state_kw_id_StartIndex;
+
+ /* Initialize rule variables
+ */
+ target_state_kw_id_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(85)) )
+ {
+ {
+ }
+
+
+
+ return s;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2477:2: ( '#init' | '#initial' | '#start' | '#dhistory' | '#shistory' | '#final' | '#terminal' | '#return' )
+
+ ANTLR3_UINT32 alt202;
+
+ alt202=8;
+
+ switch ( LA(1) )
+ {
+ case 146:
+ {
+ alt202=1;
+ }
+ break;
+ case 147:
+ {
+ alt202=2;
+ }
+ break;
+ case 150:
+ {
+ alt202=3;
+ }
+ break;
+ case 144:
+ {
+ alt202=4;
+ }
+ break;
+ case 149:
+ {
+ alt202=5;
+ }
+ break;
+ case 145:
+ {
+ alt202=6;
+ }
+ break;
+ case 153:
+ {
+ alt202=7;
+ }
+ break;
+ case 148:
+ {
+ alt202=8;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return s;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 202;
+ EXCEPTION->state = 0;
+
+
+ goto ruletarget_state_kw_idEx;
+
+ }
+
+ switch (alt202)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2477:4: '#init'
+ {
+ MATCHT(146, &FOLLOW_146_in_target_state_kw_id7030);
+ if (HASEXCEPTION())
+ {
+ goto ruletarget_state_kw_idEx;
+ }
+ if (HASFAILED())
+ {
+ return s;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ s= "#init" ;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2478:4: '#initial'
+ {
+ MATCHT(147, &FOLLOW_147_in_target_state_kw_id7042);
+ if (HASEXCEPTION())
+ {
+ goto ruletarget_state_kw_idEx;
+ }
+ if (HASFAILED())
+ {
+ return s;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ s= "#initial" ;
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2479:4: '#start'
+ {
+ MATCHT(150, &FOLLOW_150_in_target_state_kw_id7051);
+ if (HASEXCEPTION())
+ {
+ goto ruletarget_state_kw_idEx;
+ }
+ if (HASFAILED())
+ {
+ return s;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ s= "#start" ;
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2481:4: '#dhistory'
+ {
+ MATCHT(144, &FOLLOW_144_in_target_state_kw_id7063);
+ if (HASEXCEPTION())
+ {
+ goto ruletarget_state_kw_idEx;
+ }
+ if (HASFAILED())
+ {
+ return s;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ s= "#dhistory";
+
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2482:4: '#shistory'
+ {
+ MATCHT(149, &FOLLOW_149_in_target_state_kw_id7071);
+ if (HASEXCEPTION())
+ {
+ goto ruletarget_state_kw_idEx;
+ }
+ if (HASFAILED())
+ {
+ return s;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ s= "#shistory";
+
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2484:4: '#final'
+ {
+ MATCHT(145, &FOLLOW_145_in_target_state_kw_id7080);
+ if (HASEXCEPTION())
+ {
+ goto ruletarget_state_kw_idEx;
+ }
+ if (HASFAILED())
+ {
+ return s;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ s= "#final";
+
+ needDefaultStateFinal.push_back(_CPM_->getContainerMachine());
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2488:4: '#terminal'
+ {
+ MATCHT(153, &FOLLOW_153_in_target_state_kw_id7089);
+ if (HASEXCEPTION())
+ {
+ goto ruletarget_state_kw_idEx;
+ }
+ if (HASFAILED())
+ {
+ return s;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ s= "#terminal";
+
+ needDefaultStateTerminal.push_back(_CPM_->getContainerMachine());
+ }
+
+
+ }
+ break;
+ case 8:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2492:4: '#return'
+ {
+ MATCHT(148, &FOLLOW_148_in_target_state_kw_id7098);
+ if (HASEXCEPTION())
+ {
+ goto ruletarget_state_kw_idEx;
+ }
+ if (HASFAILED())
+ {
+ return s;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ s= "#return";
+
+ needDefaultStateReturn.push_back(_CPM_->getContainerMachine());
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruletarget_state_kw_idEx; /* Prevent compiler warnings */
+ ruletarget_state_kw_idEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(85, target_state_kw_id_StartIndex); }
+
+ return s;
+}
+/* $ANTLR end target_state_kw_id */
+
+/**
+ * $ANTLR start def_state_activity
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2498:1: def_state_activity[ sep::Machine * state ] : ( '@create' bs= block_statement | '@init' bs= block_statement | '@ienable' bs= block_statement | '@enable' bs= block_statement | '@idisable' bs= block_statement | '@disable' bs= block_statement | '@iabort' bs= block_statement | '@abort' bs= block_statement | '@irun' bs= block_statement | '@run' bs= block_statement | '@rtc' bs= block_statement | '@final' bs= block_statement );
+ */
+static void
+def_state_activity(pfmlParser ctx, sep::Machine * state)
+{
+ ANTLR3_UINT32 def_state_activity_StartIndex;
+
+ sep::BFCode bs;
+ #undef RETURN_TYPE_bs
+ #define RETURN_TYPE_bs sep::BFCode
+
+ /* Initialize rule variables
+ */
+ def_state_activity_StartIndex = INDEX();
+
+
+
+ sep::BehavioralPart * theBehavior = state->getUniqBehaviorPart();
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(86)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2502:2: ( '@create' bs= block_statement | '@init' bs= block_statement | '@ienable' bs= block_statement | '@enable' bs= block_statement | '@idisable' bs= block_statement | '@disable' bs= block_statement | '@iabort' bs= block_statement | '@abort' bs= block_statement | '@irun' bs= block_statement | '@run' bs= block_statement | '@rtc' bs= block_statement | '@final' bs= block_statement )
+
+ ANTLR3_UINT32 alt203;
+
+ alt203=12;
+
+ switch ( LA(1) )
+ {
+ case 177:
+ {
+ alt203=1;
+ }
+ break;
+ case 194:
+ {
+ alt203=2;
+ }
+ break;
+ case 191:
+ {
+ alt203=3;
+ }
+ break;
+ case 182:
+ {
+ alt203=4;
+ }
+ break;
+ case 190:
+ {
+ alt203=5;
+ }
+ break;
+ case 179:
+ {
+ alt203=6;
+ }
+ break;
+ case 189:
+ {
+ alt203=7;
+ }
+ break;
+ case 170:
+ {
+ alt203=8;
+ }
+ break;
+ case 199:
+ {
+ alt203=9;
+ }
+ break;
+ case 224:
+ {
+ alt203=10;
+ }
+ break;
+ case 223:
+ {
+ alt203=11;
+ }
+ break;
+ case 184:
+ {
+ alt203=12;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 203;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_state_activityEx;
+
+ }
+
+ switch (alt203)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2502:4: '@create' bs= block_statement
+ {
+ MATCHT(177, &FOLLOW_177_in_def_state_activity7119);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_def_state_activity7125);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ theBehavior->seqOnCreate(bs
+ );
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2503:4: '@init' bs= block_statement
+ {
+ MATCHT(194, &FOLLOW_194_in_def_state_activity7133);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_def_state_activity7141);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ theBehavior->seqOnInit(bs
+ );
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2505:4: '@ienable' bs= block_statement
+ {
+ MATCHT(191, &FOLLOW_191_in_def_state_activity7150);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_def_state_activity7155);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ theBehavior->seqOnIEnable(bs
+ );
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2506:4: '@enable' bs= block_statement
+ {
+ MATCHT(182, &FOLLOW_182_in_def_state_activity7163);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_def_state_activity7169);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ theBehavior->seqOnEnable (bs
+ );
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2508:4: '@idisable' bs= block_statement
+ {
+ MATCHT(190, &FOLLOW_190_in_def_state_activity7178);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_def_state_activity7182);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ theBehavior->seqOnIDisable(bs
+ );
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2509:4: '@disable' bs= block_statement
+ {
+ MATCHT(179, &FOLLOW_179_in_def_state_activity7190);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_def_state_activity7195);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ theBehavior->seqOnDisable (bs
+ );
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2511:4: '@iabort' bs= block_statement
+ {
+ MATCHT(189, &FOLLOW_189_in_def_state_activity7204);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_def_state_activity7210);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ theBehavior->seqOnIAbort(bs
+ );
+ }
+
+
+ }
+ break;
+ case 8:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2512:4: '@abort' bs= block_statement
+ {
+ MATCHT(170, &FOLLOW_170_in_def_state_activity7218);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_def_state_activity7225);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ theBehavior->seqOnAbort(bs
+ );
+ }
+
+
+ }
+ break;
+ case 9:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2514:4: '@irun' bs= block_statement
+ {
+ MATCHT(199, &FOLLOW_199_in_def_state_activity7234);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_def_state_activity7242);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ theBehavior->seqOnIRun(bs
+ );
+ }
+
+
+ }
+ break;
+ case 10:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2515:4: '@run' bs= block_statement
+ {
+ MATCHT(224, &FOLLOW_224_in_def_state_activity7250);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_def_state_activity7259);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ theBehavior->seqOnRun(bs
+ );
+ }
+
+
+ }
+ break;
+ case 11:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2516:4: '@rtc' bs= block_statement
+ {
+ MATCHT(223, &FOLLOW_223_in_def_state_activity7267);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_def_state_activity7276);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ theBehavior->seqOnRtc(bs
+ );
+ }
+
+
+ }
+ break;
+ case 12:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2518:4: '@final' bs= block_statement
+ {
+ MATCHT(184, &FOLLOW_184_in_def_state_activity7285);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_def_state_activity7292);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_state_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ theBehavior->seqOnFinal(bs
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_state_activityEx; /* Prevent compiler warnings */
+ ruledef_state_activityEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(86, def_state_activity_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_state_activity */
+
+/**
+ * $ANTLR start section_header_import_parameter_property
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2526:1: section_header_import_parameter_property[ sep::Machine * container ] : ( ( def_body_machine_using_section_header_predicat )=> section_header[ container ] ( section_import[ container ] )? ( section_parameter[ container ] )? ( section_property[ container ] )* | ( def_body_machine_using_section_import_predicat )=> section_import[ container ] ( section_parameter[ container ] )? ( section_property[ container ] )* | ( def_body_machine_using_section_parameter_predicat )=> section_parameter[ container ] ( section_property[ container ] )* | ( def_body_machine_using_section_property_predicat )=> ( section_property[ container ] )+ | section_property_free_declaration[ container ] );
+ */
+static void
+section_header_import_parameter_property(pfmlParser ctx, sep::Machine * container)
+{
+ ANTLR3_UINT32 section_header_import_parameter_property_StartIndex;
+
+ /* Initialize rule variables
+ */
+ section_header_import_parameter_property_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(87)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2528:2: ( ( def_body_machine_using_section_header_predicat )=> section_header[ container ] ( section_import[ container ] )? ( section_parameter[ container ] )? ( section_property[ container ] )* | ( def_body_machine_using_section_import_predicat )=> section_import[ container ] ( section_parameter[ container ] )? ( section_property[ container ] )* | ( def_body_machine_using_section_parameter_predicat )=> section_parameter[ container ] ( section_property[ container ] )* | ( def_body_machine_using_section_property_predicat )=> ( section_property[ container ] )+ | section_property_free_declaration[ container ] )
+
+ ANTLR3_UINT32 alt211;
+
+ alt211=5;
+
+ {
+ int LA211_0 = LA(1);
+ if ( (synpred366_fml(ctx)) && (LA211_0 == 188))
+ {
+ alt211=1;
+ }
+ else if ( (synpred370_fml(ctx)) && (LA211_0 == 192))
+ {
+ alt211=2;
+ }
+ else if ( (synpred373_fml(ctx)) && (((LA211_0 >= 209) && (LA211_0 <= 210))))
+ {
+ alt211=3;
+ }
+ else if ( (synpred373_fml(ctx)) && (LA211_0 == 196))
+ {
+ alt211=3;
+ }
+ else if ( (synpred373_fml(ctx)) && (LA211_0 == 195))
+ {
+ alt211=3;
+ }
+ else if ( (synpred373_fml(ctx)) && (LA211_0 == 207))
+ {
+ alt211=3;
+ }
+ else if ( (synpred373_fml(ctx)) && (((LA211_0 >= 219) && (LA211_0 <= 220))))
+ {
+ alt211=3;
+ }
+ else if ( (synpred375_fml(ctx)) && (LA211_0 == 178 || LA211_0 == 213))
+ {
+ alt211=4;
+ }
+ else if ( (synpred375_fml(ctx)) && (LA211_0 == 216))
+ {
+ alt211=4;
+ }
+ else if ( (synpred375_fml(ctx)) && (LA211_0 == 214))
+ {
+ alt211=4;
+ }
+ else if ( (synpred375_fml(ctx)) && (LA211_0 == 211))
+ {
+ alt211=4;
+ }
+ else if ( (LA211_0 == EOF || LA211_0 == 243 || LA211_0 == 249 || LA211_0 == 253 || ((LA211_0 >= 257) && (LA211_0 <= 259)) || LA211_0 == 262 || LA211_0 == 276 || LA211_0 == 282 || LA211_0 == 298 || LA211_0 == 305 || LA211_0 == 318 || LA211_0 == 320 || LA211_0 == 341 || LA211_0 == 344 || LA211_0 == 349 || LA211_0 == 355 || LA211_0 == 361 || LA211_0 == 364 || LA211_0 == 374 || LA211_0 == 380 || LA211_0 == 388 || LA211_0 == 395 || LA211_0 == 398 || LA211_0 == 404 || LA211_0 == 406 || ((LA211_0 >= 410) && (LA211_0 <= 411)) || LA211_0 == 414))
+ {
+ alt211=5;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 211;
+ EXCEPTION->state = 0;
+
+
+ goto rulesection_header_import_parameter_propertyEx;
+
+ }
+ }
+ switch (alt211)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2528:4: ( def_body_machine_using_section_header_predicat )=> section_header[ container ] ( section_import[ container ] )? ( section_parameter[ container ] )? ( section_property[ container ] )*
+ {
+ FOLLOWPUSH(FOLLOW_section_header_in_section_header_import_parameter_property7325);
+ section_header(ctx, container);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_header_import_parameter_propertyEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2531:4: ( section_import[ container ] )?
+ {
+ int alt204=2;
+ switch ( LA(1) )
+ {
+ case 192:
+ {
+ alt204=1;
+ }
+ break;
+ }
+
+ switch (alt204)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2531:6: section_import[ container ]
+ {
+ FOLLOWPUSH(FOLLOW_section_import_in_section_header_import_parameter_property7334);
+ section_import(ctx, container);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_header_import_parameter_propertyEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2533:4: ( section_parameter[ container ] )?
+ {
+ int alt205=2;
+ switch ( LA(1) )
+ {
+ case 195:
+ case 196:
+ case 207:
+ case 209:
+ case 210:
+ case 219:
+ case 220:
+ {
+ alt205=1;
+ }
+ break;
+ }
+
+ switch (alt205)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2533:6: section_parameter[ container ]
+ {
+ FOLLOWPUSH(FOLLOW_section_parameter_in_section_header_import_parameter_property7346);
+ section_parameter(ctx, container);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_header_import_parameter_propertyEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+ sep::TemplateFactory::genProperty( container );
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2538:4: ( section_property[ container ] )*
+
+ for (;;)
+ {
+ int alt206=2;
+ switch ( LA(1) )
+ {
+ case 178:
+ case 211:
+ case 213:
+ case 214:
+ case 216:
+ {
+ alt206=1;
+ }
+ break;
+
+ }
+
+ switch (alt206)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2538:6: section_property[ container ]
+ {
+ FOLLOWPUSH(FOLLOW_section_property_in_section_header_import_parameter_property7368);
+ section_property(ctx, container);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_header_import_parameter_propertyEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop206; /* break out of the loop */
+ break;
+ }
+ }
+ loop206: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2540:4: ( def_body_machine_using_section_import_predicat )=> section_import[ container ] ( section_parameter[ container ] )? ( section_property[ container ] )*
+ {
+ FOLLOWPUSH(FOLLOW_section_import_in_section_header_import_parameter_property7389);
+ section_import(ctx, container);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_header_import_parameter_propertyEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2543:4: ( section_parameter[ container ] )?
+ {
+ int alt207=2;
+ switch ( LA(1) )
+ {
+ case 195:
+ case 196:
+ case 207:
+ case 209:
+ case 210:
+ case 219:
+ case 220:
+ {
+ alt207=1;
+ }
+ break;
+ }
+
+ switch (alt207)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2543:6: section_parameter[ container ]
+ {
+ FOLLOWPUSH(FOLLOW_section_parameter_in_section_header_import_parameter_property7398);
+ section_parameter(ctx, container);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_header_import_parameter_propertyEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+ sep::TemplateFactory::genProperty( container );
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2548:4: ( section_property[ container ] )*
+
+ for (;;)
+ {
+ int alt208=2;
+ switch ( LA(1) )
+ {
+ case 178:
+ case 211:
+ case 213:
+ case 214:
+ case 216:
+ {
+ alt208=1;
+ }
+ break;
+
+ }
+
+ switch (alt208)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2548:6: section_property[ container ]
+ {
+ FOLLOWPUSH(FOLLOW_section_property_in_section_header_import_parameter_property7420);
+ section_property(ctx, container);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_header_import_parameter_propertyEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop208; /* break out of the loop */
+ break;
+ }
+ }
+ loop208: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2550:4: ( def_body_machine_using_section_parameter_predicat )=> section_parameter[ container ] ( section_property[ container ] )*
+ {
+ FOLLOWPUSH(FOLLOW_section_parameter_in_section_header_import_parameter_property7441);
+ section_parameter(ctx, container);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_header_import_parameter_propertyEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ sep::TemplateFactory::genProperty( container );
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2556:4: ( section_property[ container ] )*
+
+ for (;;)
+ {
+ int alt209=2;
+ switch ( LA(1) )
+ {
+ case 178:
+ case 211:
+ case 213:
+ case 214:
+ case 216:
+ {
+ alt209=1;
+ }
+ break;
+
+ }
+
+ switch (alt209)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2556:6: section_property[ container ]
+ {
+ FOLLOWPUSH(FOLLOW_section_property_in_section_header_import_parameter_property7460);
+ section_property(ctx, container);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_header_import_parameter_propertyEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop209; /* break out of the loop */
+ break;
+ }
+ }
+ loop209: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2558:4: ( def_body_machine_using_section_property_predicat )=> ( section_property[ container ] )+
+ {
+ if ( BACKTRACKING==0 )
+ {
+ sep::TemplateFactory::genProperty( container );
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2562:4: ( section_property[ container ] )+
+ {
+ int cnt210=0;
+
+ for (;;)
+ {
+ int alt210=2;
+ switch ( LA(1) )
+ {
+ case 178:
+ case 211:
+ case 213:
+ case 214:
+ case 216:
+ {
+ alt210=1;
+ }
+ break;
+
+ }
+
+ switch (alt210)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2562:6: section_property[ container ]
+ {
+ FOLLOWPUSH(FOLLOW_section_property_in_section_header_import_parameter_property7493);
+ section_property(ctx, container);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_header_import_parameter_propertyEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt210 >= 1 )
+ {
+ goto loop210;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto rulesection_header_import_parameter_propertyEx;
+ }
+ cnt210++;
+ }
+ loop210: ; /* Jump to here if this rule does not match */
+ }
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2564:4: section_property_free_declaration[ container ]
+ {
+ if ( BACKTRACKING==0 )
+ {
+ sep::TemplateFactory::genProperty( container );
+ }
+
+
+ FOLLOWPUSH(FOLLOW_section_property_free_declaration_in_section_header_import_parameter_property7508);
+ section_property_free_declaration(ctx, container);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_header_import_parameter_propertyEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulesection_header_import_parameter_propertyEx; /* Prevent compiler warnings */
+ rulesection_header_import_parameter_propertyEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(87, section_header_import_parameter_property_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end section_header_import_parameter_property */
+
+/**
+ * $ANTLR start section_parameter
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2574:1: section_parameter[ sep::Machine * container ] : ( ( '@parameter:' | '@param:' ) ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_INPUT_PARAMETER_MODIFIER ] )* | '@input:' ( property_declaration[ declProperty ,\n\t\t\t\tsep::Modifier::PROPERTY_INPUT_PARAMETER_MODIFIER ] )* | '@inout:' ( property_declaration[ declProperty ,\n\t\t\t\tsep::Modifier::PROPERTY_INOUT_PARAMETER_MODIFIER ] )* | '@output:' ( property_declaration[ declProperty ,\n\t\t\t\tsep::Modifier::PROPERTY_OUTPUT_PARAMETER_MODIFIER ] )* | ( '@returns:' | '@return:' ) ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER ] )* );
+ */
+static void
+section_parameter(pfmlParser ctx, sep::Machine * container)
+{
+ ANTLR3_UINT32 section_parameter_StartIndex;
+
+ /* Initialize rule variables
+ */
+ section_parameter_StartIndex = INDEX();
+
+
+
+ sep::PropertyPart & declProperty = container->getPropertyPart();
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(88)) )
+ {
+ {
+
+ SET_RULE_LOCATION(declProperty);
+
+ }
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2583:2: ( ( '@parameter:' | '@param:' ) ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_INPUT_PARAMETER_MODIFIER ] )* | '@input:' ( property_declaration[ declProperty ,\n\t\t\t\tsep::Modifier::PROPERTY_INPUT_PARAMETER_MODIFIER ] )* | '@inout:' ( property_declaration[ declProperty ,\n\t\t\t\tsep::Modifier::PROPERTY_INOUT_PARAMETER_MODIFIER ] )* | '@output:' ( property_declaration[ declProperty ,\n\t\t\t\tsep::Modifier::PROPERTY_OUTPUT_PARAMETER_MODIFIER ] )* | ( '@returns:' | '@return:' ) ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER ] )* )
+
+ ANTLR3_UINT32 alt217;
+
+ alt217=5;
+
+ switch ( LA(1) )
+ {
+ case 209:
+ case 210:
+ {
+ alt217=1;
+ }
+ break;
+ case 196:
+ {
+ alt217=2;
+ }
+ break;
+ case 195:
+ {
+ alt217=3;
+ }
+ break;
+ case 207:
+ {
+ alt217=4;
+ }
+ break;
+ case 219:
+ case 220:
+ {
+ alt217=5;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 217;
+ EXCEPTION->state = 0;
+
+
+ goto rulesection_parameterEx;
+
+ }
+
+ switch (alt217)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2583:4: ( '@parameter:' | '@param:' ) ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_INPUT_PARAMETER_MODIFIER ] )*
+ {
+ if ( ((LA(1) >= 209) && (LA(1) <= 210)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulesection_parameterEx;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2584:4: ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_INPUT_PARAMETER_MODIFIER ] )*
+
+ for (;;)
+ {
+ int alt212=2;
+ switch ( LA(1) )
+ {
+ case 243:
+ case 249:
+ case 253:
+ case 257:
+ case 258:
+ case 259:
+ case 262:
+ case 276:
+ case 282:
+ case 298:
+ case 305:
+ case 318:
+ case 320:
+ case 341:
+ case 344:
+ case 349:
+ case 355:
+ case 361:
+ case 364:
+ case 374:
+ case 380:
+ case 388:
+ case 395:
+ case 398:
+ case 404:
+ case 406:
+ case 410:
+ case 411:
+ case 414:
+ {
+ alt212=1;
+ }
+ break;
+
+ }
+
+ switch (alt212)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2584:6: property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_INPUT_PARAMETER_MODIFIER ]
+ {
+ FOLLOWPUSH(FOLLOW_property_declaration_in_section_parameter7553);
+ property_declaration(ctx, declProperty, sep::Modifier::PROPERTY_INPUT_PARAMETER_MODIFIER);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_parameterEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop212; /* break out of the loop */
+ break;
+ }
+ }
+ loop212: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2588:4: '@input:' ( property_declaration[ declProperty ,\n\t\t\t\tsep::Modifier::PROPERTY_INPUT_PARAMETER_MODIFIER ] )*
+ {
+ MATCHT(196, &FOLLOW_196_in_section_parameter7566);
+ if (HASEXCEPTION())
+ {
+ goto rulesection_parameterEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2588:15: ( property_declaration[ declProperty ,\n\t\t\t\tsep::Modifier::PROPERTY_INPUT_PARAMETER_MODIFIER ] )*
+
+ for (;;)
+ {
+ int alt213=2;
+ switch ( LA(1) )
+ {
+ case 243:
+ case 249:
+ case 253:
+ case 257:
+ case 258:
+ case 259:
+ case 262:
+ case 276:
+ case 282:
+ case 298:
+ case 305:
+ case 318:
+ case 320:
+ case 341:
+ case 344:
+ case 349:
+ case 355:
+ case 361:
+ case 364:
+ case 374:
+ case 380:
+ case 388:
+ case 395:
+ case 398:
+ case 404:
+ case 406:
+ case 410:
+ case 411:
+ case 414:
+ {
+ alt213=1;
+ }
+ break;
+
+ }
+
+ switch (alt213)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2588:17: property_declaration[ declProperty ,\n\t\t\t\tsep::Modifier::PROPERTY_INPUT_PARAMETER_MODIFIER ]
+ {
+ FOLLOWPUSH(FOLLOW_property_declaration_in_section_parameter7571);
+ property_declaration(ctx, declProperty, sep::Modifier::PROPERTY_INPUT_PARAMETER_MODIFIER);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_parameterEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop213; /* break out of the loop */
+ break;
+ }
+ }
+ loop213: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2592:4: '@inout:' ( property_declaration[ declProperty ,\n\t\t\t\tsep::Modifier::PROPERTY_INOUT_PARAMETER_MODIFIER ] )*
+ {
+ MATCHT(195, &FOLLOW_195_in_section_parameter7584);
+ if (HASEXCEPTION())
+ {
+ goto rulesection_parameterEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2592:15: ( property_declaration[ declProperty ,\n\t\t\t\tsep::Modifier::PROPERTY_INOUT_PARAMETER_MODIFIER ] )*
+
+ for (;;)
+ {
+ int alt214=2;
+ switch ( LA(1) )
+ {
+ case 243:
+ case 249:
+ case 253:
+ case 257:
+ case 258:
+ case 259:
+ case 262:
+ case 276:
+ case 282:
+ case 298:
+ case 305:
+ case 318:
+ case 320:
+ case 341:
+ case 344:
+ case 349:
+ case 355:
+ case 361:
+ case 364:
+ case 374:
+ case 380:
+ case 388:
+ case 395:
+ case 398:
+ case 404:
+ case 406:
+ case 410:
+ case 411:
+ case 414:
+ {
+ alt214=1;
+ }
+ break;
+
+ }
+
+ switch (alt214)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2592:17: property_declaration[ declProperty ,\n\t\t\t\tsep::Modifier::PROPERTY_INOUT_PARAMETER_MODIFIER ]
+ {
+ FOLLOWPUSH(FOLLOW_property_declaration_in_section_parameter7589);
+ property_declaration(ctx, declProperty, sep::Modifier::PROPERTY_INOUT_PARAMETER_MODIFIER);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_parameterEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop214; /* break out of the loop */
+ break;
+ }
+ }
+ loop214: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2596:4: '@output:' ( property_declaration[ declProperty ,\n\t\t\t\tsep::Modifier::PROPERTY_OUTPUT_PARAMETER_MODIFIER ] )*
+ {
+ MATCHT(207, &FOLLOW_207_in_section_parameter7602);
+ if (HASEXCEPTION())
+ {
+ goto rulesection_parameterEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2596:15: ( property_declaration[ declProperty ,\n\t\t\t\tsep::Modifier::PROPERTY_OUTPUT_PARAMETER_MODIFIER ] )*
+
+ for (;;)
+ {
+ int alt215=2;
+ switch ( LA(1) )
+ {
+ case 243:
+ case 249:
+ case 253:
+ case 257:
+ case 258:
+ case 259:
+ case 262:
+ case 276:
+ case 282:
+ case 298:
+ case 305:
+ case 318:
+ case 320:
+ case 341:
+ case 344:
+ case 349:
+ case 355:
+ case 361:
+ case 364:
+ case 374:
+ case 380:
+ case 388:
+ case 395:
+ case 398:
+ case 404:
+ case 406:
+ case 410:
+ case 411:
+ case 414:
+ {
+ alt215=1;
+ }
+ break;
+
+ }
+
+ switch (alt215)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2596:17: property_declaration[ declProperty ,\n\t\t\t\tsep::Modifier::PROPERTY_OUTPUT_PARAMETER_MODIFIER ]
+ {
+ FOLLOWPUSH(FOLLOW_property_declaration_in_section_parameter7606);
+ property_declaration(ctx, declProperty, sep::Modifier::PROPERTY_OUTPUT_PARAMETER_MODIFIER);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_parameterEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop215; /* break out of the loop */
+ break;
+ }
+ }
+ loop215: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2600:4: ( '@returns:' | '@return:' ) ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER ] )*
+ {
+ if ( ((LA(1) >= 219) && (LA(1) <= 220)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulesection_parameterEx;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2601:4: ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER ] )*
+
+ for (;;)
+ {
+ int alt216=2;
+ switch ( LA(1) )
+ {
+ case 243:
+ case 249:
+ case 253:
+ case 257:
+ case 258:
+ case 259:
+ case 262:
+ case 276:
+ case 282:
+ case 298:
+ case 305:
+ case 318:
+ case 320:
+ case 341:
+ case 344:
+ case 349:
+ case 355:
+ case 361:
+ case 364:
+ case 374:
+ case 380:
+ case 388:
+ case 395:
+ case 398:
+ case 404:
+ case 406:
+ case 410:
+ case 411:
+ case 414:
+ {
+ alt216=1;
+ }
+ break;
+
+ }
+
+ switch (alt216)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2601:6: property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER ]
+ {
+ FOLLOWPUSH(FOLLOW_property_declaration_in_section_parameter7636);
+ property_declaration(ctx, declProperty, sep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_parameterEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop216; /* break out of the loop */
+ break;
+ }
+ }
+ loop216: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulesection_parameterEx; /* Prevent compiler warnings */
+ rulesection_parameterEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ SET_RULE_LOCATION(declProperty);
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(88, section_parameter_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end section_parameter */
+
+/**
+ * $ANTLR start section_property
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2611:1: section_property[ sep::Machine * container ] : ( ( '@property:' | '@declaration:' ) ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_UNDEFINED_MODIFIER ] )* | '@public:' ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_PUBLIC_MODIFIER ] )* | '@protected:' ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_PROTECTED_MODIFIER ] )* | '@private:' ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_PRIVATE_MODIFIER ] )* );
+ */
+static void
+section_property(pfmlParser ctx, sep::Machine * container)
+{
+ ANTLR3_UINT32 section_property_StartIndex;
+
+ /* Initialize rule variables
+ */
+ section_property_StartIndex = INDEX();
+
+
+
+ sep::PropertyPart & declProperty = container->getPropertyPart();
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(89)) )
+ {
+ {
+
+ SET_RULE_LOCATION(declProperty);
+
+ }
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2620:2: ( ( '@property:' | '@declaration:' ) ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_UNDEFINED_MODIFIER ] )* | '@public:' ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_PUBLIC_MODIFIER ] )* | '@protected:' ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_PROTECTED_MODIFIER ] )* | '@private:' ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_PRIVATE_MODIFIER ] )* )
+
+ ANTLR3_UINT32 alt222;
+
+ alt222=4;
+
+ switch ( LA(1) )
+ {
+ case 178:
+ case 213:
+ {
+ alt222=1;
+ }
+ break;
+ case 216:
+ {
+ alt222=2;
+ }
+ break;
+ case 214:
+ {
+ alt222=3;
+ }
+ break;
+ case 211:
+ {
+ alt222=4;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 222;
+ EXCEPTION->state = 0;
+
+
+ goto rulesection_propertyEx;
+
+ }
+
+ switch (alt222)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2620:4: ( '@property:' | '@declaration:' ) ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_UNDEFINED_MODIFIER ] )*
+ {
+ if ( LA(1) == 178 || LA(1) == 213 )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulesection_propertyEx;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2621:4: ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_UNDEFINED_MODIFIER ] )*
+
+ for (;;)
+ {
+ int alt218=2;
+ switch ( LA(1) )
+ {
+ case 243:
+ case 249:
+ case 253:
+ case 257:
+ case 258:
+ case 259:
+ case 262:
+ case 276:
+ case 282:
+ case 298:
+ case 305:
+ case 318:
+ case 320:
+ case 341:
+ case 344:
+ case 349:
+ case 355:
+ case 361:
+ case 364:
+ case 374:
+ case 380:
+ case 388:
+ case 395:
+ case 398:
+ case 404:
+ case 406:
+ case 410:
+ case 411:
+ case 414:
+ {
+ alt218=1;
+ }
+ break;
+
+ }
+
+ switch (alt218)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2621:6: property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_UNDEFINED_MODIFIER ]
+ {
+ FOLLOWPUSH(FOLLOW_property_declaration_in_section_property7686);
+ property_declaration(ctx, declProperty, sep::Modifier::PROPERTY_UNDEFINED_MODIFIER);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_propertyEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop218; /* break out of the loop */
+ break;
+ }
+ }
+ loop218: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2625:4: '@public:' ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_PUBLIC_MODIFIER ] )*
+ {
+ MATCHT(216, &FOLLOW_216_in_section_property7699);
+ if (HASEXCEPTION())
+ {
+ goto rulesection_propertyEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2626:4: ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_PUBLIC_MODIFIER ] )*
+
+ for (;;)
+ {
+ int alt219=2;
+ switch ( LA(1) )
+ {
+ case 243:
+ case 249:
+ case 253:
+ case 257:
+ case 258:
+ case 259:
+ case 262:
+ case 276:
+ case 282:
+ case 298:
+ case 305:
+ case 318:
+ case 320:
+ case 341:
+ case 344:
+ case 349:
+ case 355:
+ case 361:
+ case 364:
+ case 374:
+ case 380:
+ case 388:
+ case 395:
+ case 398:
+ case 404:
+ case 406:
+ case 410:
+ case 411:
+ case 414:
+ {
+ alt219=1;
+ }
+ break;
+
+ }
+
+ switch (alt219)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2626:6: property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_PUBLIC_MODIFIER ]
+ {
+ FOLLOWPUSH(FOLLOW_property_declaration_in_section_property7706);
+ property_declaration(ctx, declProperty, sep::Modifier::PROPERTY_PUBLIC_MODIFIER);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_propertyEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop219; /* break out of the loop */
+ break;
+ }
+ }
+ loop219: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2630:4: '@protected:' ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_PROTECTED_MODIFIER ] )*
+ {
+ MATCHT(214, &FOLLOW_214_in_section_property7719);
+ if (HASEXCEPTION())
+ {
+ goto rulesection_propertyEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2631:4: ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_PROTECTED_MODIFIER ] )*
+
+ for (;;)
+ {
+ int alt220=2;
+ switch ( LA(1) )
+ {
+ case 243:
+ case 249:
+ case 253:
+ case 257:
+ case 258:
+ case 259:
+ case 262:
+ case 276:
+ case 282:
+ case 298:
+ case 305:
+ case 318:
+ case 320:
+ case 341:
+ case 344:
+ case 349:
+ case 355:
+ case 361:
+ case 364:
+ case 374:
+ case 380:
+ case 388:
+ case 395:
+ case 398:
+ case 404:
+ case 406:
+ case 410:
+ case 411:
+ case 414:
+ {
+ alt220=1;
+ }
+ break;
+
+ }
+
+ switch (alt220)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2631:6: property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_PROTECTED_MODIFIER ]
+ {
+ FOLLOWPUSH(FOLLOW_property_declaration_in_section_property7726);
+ property_declaration(ctx, declProperty, sep::Modifier::PROPERTY_PROTECTED_MODIFIER);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_propertyEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop220; /* break out of the loop */
+ break;
+ }
+ }
+ loop220: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2635:4: '@private:' ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_PRIVATE_MODIFIER ] )*
+ {
+ MATCHT(211, &FOLLOW_211_in_section_property7739);
+ if (HASEXCEPTION())
+ {
+ goto rulesection_propertyEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2636:4: ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_PRIVATE_MODIFIER ] )*
+
+ for (;;)
+ {
+ int alt221=2;
+ switch ( LA(1) )
+ {
+ case 243:
+ case 249:
+ case 253:
+ case 257:
+ case 258:
+ case 259:
+ case 262:
+ case 276:
+ case 282:
+ case 298:
+ case 305:
+ case 318:
+ case 320:
+ case 341:
+ case 344:
+ case 349:
+ case 355:
+ case 361:
+ case 364:
+ case 374:
+ case 380:
+ case 388:
+ case 395:
+ case 398:
+ case 404:
+ case 406:
+ case 410:
+ case 411:
+ case 414:
+ {
+ alt221=1;
+ }
+ break;
+
+ }
+
+ switch (alt221)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2636:6: property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_PRIVATE_MODIFIER ]
+ {
+ FOLLOWPUSH(FOLLOW_property_declaration_in_section_property7746);
+ property_declaration(ctx, declProperty, sep::Modifier::PROPERTY_PRIVATE_MODIFIER);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_propertyEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop221; /* break out of the loop */
+ break;
+ }
+ }
+ loop221: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulesection_propertyEx; /* Prevent compiler warnings */
+ rulesection_propertyEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ SET_RULE_LOCATION(declProperty);
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(89, section_property_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end section_property */
+
+/**
+ * $ANTLR start section_property_free_declaration
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2642:1: section_property_free_declaration[ sep::Machine * container ] : ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_UNDEFINED_MODIFIER ] )* ;
+ */
+static void
+section_property_free_declaration(pfmlParser ctx, sep::Machine * container)
+{
+ ANTLR3_UINT32 section_property_free_declaration_StartIndex;
+
+ /* Initialize rule variables
+ */
+ section_property_free_declaration_StartIndex = INDEX();
+
+
+
+ sep::PropertyPart & declProperty = container->getPropertyPart();
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(90)) )
+ {
+ {
+
+ SET_RULE_LOCATION(declProperty);
+
+ }
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2651:2: ( ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_UNDEFINED_MODIFIER ] )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2651:4: ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_UNDEFINED_MODIFIER ] )*
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2651:4: ( property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_UNDEFINED_MODIFIER ] )*
+
+ for (;;)
+ {
+ int alt223=2;
+ switch ( LA(1) )
+ {
+ case 243:
+ case 249:
+ case 253:
+ case 257:
+ case 258:
+ case 259:
+ case 262:
+ case 276:
+ case 282:
+ case 298:
+ case 305:
+ case 318:
+ case 320:
+ case 341:
+ case 344:
+ case 349:
+ case 355:
+ case 361:
+ case 364:
+ case 374:
+ case 380:
+ case 388:
+ case 395:
+ case 398:
+ case 404:
+ case 406:
+ case 410:
+ case 411:
+ case 414:
+ {
+ alt223=1;
+ }
+ break;
+
+ }
+
+ switch (alt223)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2651:6: property_declaration[ declProperty ,\n\t \t\t\tsep::Modifier::PROPERTY_UNDEFINED_MODIFIER ]
+ {
+ FOLLOWPUSH(FOLLOW_property_declaration_in_section_property_free_declaration7777);
+ property_declaration(ctx, declProperty, sep::Modifier::PROPERTY_UNDEFINED_MODIFIER);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_property_free_declarationEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop223; /* break out of the loop */
+ break;
+ }
+ }
+ loop223: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulesection_property_free_declarationEx; /* Prevent compiler warnings */
+ rulesection_property_free_declarationEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ SET_RULE_LOCATION(declProperty);
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(90, section_property_free_declaration_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end section_property_free_declaration */
+
+/**
+ * $ANTLR start property_declaration
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2660:1: property_declaration[ sep::PropertyPart & declProperty , sep::Modifier mdfr ] : (m= modifier_declaration )? decl_property_element[ declProperty , mdfr ] ;
+ */
+static void
+property_declaration(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr)
+{
+ ANTLR3_UINT32 property_declaration_StartIndex;
+
+ sep::Modifier m;
+ #undef RETURN_TYPE_m
+ #define RETURN_TYPE_m sep::Modifier
+
+ /* Initialize rule variables
+ */
+ property_declaration_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(91)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2662:2: ( (m= modifier_declaration )? decl_property_element[ declProperty , mdfr ] )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2662:4: (m= modifier_declaration )? decl_property_element[ declProperty , mdfr ]
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2662:4: (m= modifier_declaration )?
+ {
+ int alt224=2;
+ switch ( LA(1) )
+ {
+ case 243:
+ case 282:
+ case 298:
+ case 305:
+ case 341:
+ case 349:
+ case 355:
+ case 361:
+ case 364:
+ case 380:
+ case 395:
+ case 406:
+ case 414:
+ {
+ alt224=1;
+ }
+ break;
+ }
+
+ switch (alt224)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2662:6: m= modifier_declaration
+ {
+ FOLLOWPUSH(FOLLOW_modifier_declaration_in_property_declaration7806);
+ m=modifier_declaration(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleproperty_declarationEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.override_ifdef( m
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_decl_property_element_in_property_declaration7816);
+ decl_property_element(ctx, declProperty, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleproperty_declarationEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleproperty_declarationEx; /* Prevent compiler warnings */
+ ruleproperty_declarationEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(91, property_declaration_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end property_declaration */
+
+/**
+ * $ANTLR start decl_property_element
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2666:1: decl_property_element[ sep::PropertyPart & declProperty , sep::Modifier mdfr ] : ( decl_variable[ declProperty , mdfr ] | decl_port[ declProperty , mdfr ] | decl_signal[ declProperty , mdfr ] | decl_buffer[ declProperty , mdfr ] | decl_channel[ declProperty , mdfr ] | def_type[ declProperty , mdfr ] | def_enum[ declProperty , mdfr ] | def_union[ declProperty , mdfr ] | def_choice[ declProperty , mdfr ] | def_struct[ declProperty , mdfr ] );
+ */
+static void
+decl_property_element(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr)
+{
+ ANTLR3_UINT32 decl_property_element_StartIndex;
+
+ /* Initialize rule variables
+ */
+ decl_property_element_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(92)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2668:2: ( decl_variable[ declProperty , mdfr ] | decl_port[ declProperty , mdfr ] | decl_signal[ declProperty , mdfr ] | decl_buffer[ declProperty , mdfr ] | decl_channel[ declProperty , mdfr ] | def_type[ declProperty , mdfr ] | def_enum[ declProperty , mdfr ] | def_union[ declProperty , mdfr ] | def_choice[ declProperty , mdfr ] | def_struct[ declProperty , mdfr ] )
+
+ ANTLR3_UINT32 alt225;
+
+ alt225=10;
+
+ switch ( LA(1) )
+ {
+ case 259:
+ case 262:
+ case 318:
+ case 410:
+ case 411:
+ {
+ alt225=1;
+ }
+ break;
+ case 344:
+ {
+ alt225=2;
+ }
+ break;
+ case 320:
+ case 374:
+ {
+ alt225=3;
+ }
+ break;
+ case 249:
+ {
+ alt225=4;
+ }
+ break;
+ case 253:
+ {
+ alt225=5;
+ }
+ break;
+ case 398:
+ {
+ alt225=6;
+ }
+ break;
+ case 276:
+ {
+ alt225=7;
+ }
+ break;
+ case 404:
+ {
+ alt225=8;
+ }
+ break;
+ case 257:
+ {
+ alt225=9;
+ }
+ break;
+ case 258:
+ case 388:
+ {
+ alt225=10;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 225;
+ EXCEPTION->state = 0;
+
+
+ goto ruledecl_property_elementEx;
+
+ }
+
+ switch (alt225)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2668:4: decl_variable[ declProperty , mdfr ]
+ {
+ FOLLOWPUSH(FOLLOW_decl_variable_in_decl_property_element7831);
+ decl_variable(ctx, declProperty, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_property_elementEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2670:4: decl_port[ declProperty , mdfr ]
+ {
+ FOLLOWPUSH(FOLLOW_decl_port_in_decl_property_element7838);
+ decl_port(ctx, declProperty, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_property_elementEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2671:4: decl_signal[ declProperty , mdfr ]
+ {
+ FOLLOWPUSH(FOLLOW_decl_signal_in_decl_property_element7847);
+ decl_signal(ctx, declProperty, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_property_elementEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2672:4: decl_buffer[ declProperty , mdfr ]
+ {
+ FOLLOWPUSH(FOLLOW_decl_buffer_in_decl_property_element7854);
+ decl_buffer(ctx, declProperty, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_property_elementEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2673:4: decl_channel[ declProperty , mdfr ]
+ {
+ FOLLOWPUSH(FOLLOW_decl_channel_in_decl_property_element7861);
+ decl_channel(ctx, declProperty, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_property_elementEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2675:4: def_type[ declProperty , mdfr ]
+ {
+ FOLLOWPUSH(FOLLOW_def_type_in_decl_property_element7868);
+ def_type(ctx, declProperty, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_property_elementEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2676:4: def_enum[ declProperty , mdfr ]
+ {
+ FOLLOWPUSH(FOLLOW_def_enum_in_decl_property_element7876);
+ def_enum(ctx, declProperty, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_property_elementEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 8:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2677:4: def_union[ declProperty , mdfr ]
+ {
+ FOLLOWPUSH(FOLLOW_def_union_in_decl_property_element7884);
+ def_union(ctx, declProperty, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_property_elementEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 9:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2678:4: def_choice[ declProperty , mdfr ]
+ {
+ FOLLOWPUSH(FOLLOW_def_choice_in_decl_property_element7891);
+ def_choice(ctx, declProperty, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_property_elementEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 10:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2679:4: def_struct[ declProperty , mdfr ]
+ {
+ FOLLOWPUSH(FOLLOW_def_struct_in_decl_property_element7897);
+ def_struct(ctx, declProperty, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_property_elementEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledecl_property_elementEx; /* Prevent compiler warnings */
+ ruledecl_property_elementEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(92, decl_property_element_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end decl_property_element */
+
+/**
+ * $ANTLR start labelled_argument
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2693:1: labelled_argument returns [ std::string label, sep::BF arg ] : ( ( ID COLON )=>id= ID COLON e= expression |e= expression );
+ */
+static fmlParser_labelled_argument_return
+labelled_argument(pfmlParser ctx)
+{
+ fmlParser_labelled_argument_return retval;
+
+ ANTLR3_UINT32 labelled_argument_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ labelled_argument_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(93)) )
+ {
+ retval.start = 0;
+
+ {
+ }
+
+
+
+ return retval;
+ }
+
+ id = NULL;
+ retval.start = LT(1); retval.stop = retval.start;
+
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2695:2: ( ( ID COLON )=>id= ID COLON e= expression |e= expression )
+
+ ANTLR3_UINT32 alt226;
+
+ alt226=2;
+
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ {
+ int LA226_1 = LA(2);
+ if ( (synpred407_fml(ctx)))
+ {
+ alt226=1;
+ }
+ else if ( (ANTLR3_TRUE))
+ {
+ alt226=2;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return retval;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 226;
+ EXCEPTION->state = 1;
+
+
+ goto rulelabelled_argumentEx;
+
+ }
+ }
+ }
+ break;
+ case BNOT:
+ case COLONx2:
+ case CharLiteral:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case FloatLiteral:
+ case INCR:
+ case IntegerLiteral:
+ case LBRACKET:
+ case LBRACKET_BAR:
+ case LCURLY:
+ case LNOT:
+ case LPAREN:
+ case LPAREN_INVOKE:
+ case MINUS:
+ case OP_POP:
+ case OP_TOP:
+ case PERCENT_LCURLY:
+ case PLUS:
+ case RationalLiteral:
+ case StringLiteral:
+ case 158:
+ case 159:
+ case 160:
+ case 161:
+ case 162:
+ case 237:
+ case 256:
+ case 265:
+ case 277:
+ case 280:
+ case 294:
+ case 313:
+ case 330:
+ case 331:
+ case 332:
+ case 343:
+ case 347:
+ case 372:
+ case 397:
+ {
+ alt226=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return retval;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 226;
+ EXCEPTION->state = 0;
+
+
+ goto rulelabelled_argumentEx;
+
+ }
+
+ switch (alt226)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2695:4: ( ID COLON )=>id= ID COLON e= expression
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_labelled_argument7933);
+ if (HASEXCEPTION())
+ {
+ goto rulelabelled_argumentEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ MATCHT(COLON, &FOLLOW_COLON_in_labelled_argument7935);
+ if (HASEXCEPTION())
+ {
+ goto rulelabelled_argumentEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.label= STR((id->getText(id))->chars);
+
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_labelled_argument7945);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulelabelled_argumentEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.arg=
+ e
+ ;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2697:4: e= expression
+ {
+ FOLLOWPUSH(FOLLOW_expression_in_labelled_argument7955);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulelabelled_argumentEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.arg=
+ e
+ ;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulelabelled_argumentEx; /* Prevent compiler warnings */
+ rulelabelled_argumentEx: ;
+ retval.stop = LT(-1);
+
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(93, labelled_argument_StartIndex); }
+
+ return retval;
+}
+/* $ANTLR end labelled_argument */
+
+/**
+ * $ANTLR start decl_instance_machine_params
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2700:1: decl_instance_machine_params[ sep::Machine * machine ] : LPAREN (lp= labelled_argument ( COMMA lp= labelled_argument )* )? RPAREN ;
+ */
+static void
+decl_instance_machine_params(pfmlParser ctx, sep::Machine * machine)
+{
+ ANTLR3_UINT32 decl_instance_machine_params_StartIndex;
+
+ fmlParser_labelled_argument_return lp;
+ #undef RETURN_TYPE_lp
+ #define RETURN_TYPE_lp fmlParser_labelled_argument_return
+
+ /* Initialize rule variables
+ */
+ decl_instance_machine_params_StartIndex = INDEX();
+
+
+
+ sep::BFVector labelledParams(
+ ( machine->getType().is< sep::Machine >() ) ? machine->getType().
+ to_ptr< sep::Machine >()->getVariableParametersCount() : 0 );
+
+ sep::BFList positionalParams;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(94)) )
+ {
+ {
+
+ if( labelledParams.nonempty() )
+ {
+ sep::ParserUtil::computeInstanceMachineParameter(
+ machine, labelledParams, positionalParams);
+ }
+
+ }
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2715:2: ( LPAREN (lp= labelled_argument ( COMMA lp= labelled_argument )* )? RPAREN )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2715:4: LPAREN (lp= labelled_argument ( COMMA lp= labelled_argument )* )? RPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_decl_instance_machine_params7979);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instance_machine_paramsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2716:4: (lp= labelled_argument ( COMMA lp= labelled_argument )* )?
+ {
+ int alt228=2;
+ switch ( LA(1) )
+ {
+ case BNOT:
+ case COLONx2:
+ case CharLiteral:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case FloatLiteral:
+ case ID:
+ case INCR:
+ case IntegerLiteral:
+ case LBRACKET:
+ case LBRACKET_BAR:
+ case LCURLY:
+ case LNOT:
+ case LPAREN:
+ case LPAREN_INVOKE:
+ case MINUS:
+ case OP_POP:
+ case OP_TOP:
+ case PERCENT_LCURLY:
+ case PLUS:
+ case RationalLiteral:
+ case StringLiteral:
+ case 158:
+ case 159:
+ case 160:
+ case 161:
+ case 162:
+ case 237:
+ case 256:
+ case 265:
+ case 277:
+ case 280:
+ case 294:
+ case 313:
+ case 330:
+ case 331:
+ case 332:
+ case 343:
+ case 347:
+ case 372:
+ case 397:
+ {
+ alt228=1;
+ }
+ break;
+ }
+
+ switch (alt228)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2716:6: lp= labelled_argument ( COMMA lp= labelled_argument )*
+ {
+ FOLLOWPUSH(FOLLOW_labelled_argument_in_decl_instance_machine_params7988);
+ lp=labelled_argument(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instance_machine_paramsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ sep::ParserUtil::appendInstanceMachineParameter(machine, lp.label
+ ,
+ labelledParams, positionalParams, lp.arg
+ );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2721:6: ( COMMA lp= labelled_argument )*
+
+ for (;;)
+ {
+ int alt227=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt227=1;
+ }
+ break;
+
+ }
+
+ switch (alt227)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2721:8: COMMA lp= labelled_argument
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_decl_instance_machine_params8004);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instance_machine_paramsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_labelled_argument_in_decl_instance_machine_params8013);
+ lp=labelled_argument(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instance_machine_paramsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ sep::ParserUtil::appendInstanceMachineParameter(machine, lp.label
+ ,
+ labelledParams, positionalParams, lp.arg
+ );
+
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop227; /* break out of the loop */
+ break;
+ }
+ }
+ loop227: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_decl_instance_machine_params8039);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instance_machine_paramsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledecl_instance_machine_paramsEx; /* Prevent compiler warnings */
+ ruledecl_instance_machine_paramsEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ if( labelledParams.nonempty() )
+ {
+ sep::ParserUtil::computeInstanceMachineParameter(
+ machine, labelledParams, positionalParams);
+ }
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(94, decl_instance_machine_params_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end decl_instance_machine_params */
+
+/**
+ * $ANTLR start decl_instance_machine_returns
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2733:1: decl_instance_machine_returns[ sep::Machine * machine ] : ( '-->' | 'returns:' ) ( LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN |lp= labelled_argument ) ;
+ */
+static void
+decl_instance_machine_returns(pfmlParser ctx, sep::Machine * machine)
+{
+ ANTLR3_UINT32 decl_instance_machine_returns_StartIndex;
+
+ fmlParser_labelled_argument_return lp;
+ #undef RETURN_TYPE_lp
+ #define RETURN_TYPE_lp fmlParser_labelled_argument_return
+
+ /* Initialize rule variables
+ */
+ decl_instance_machine_returns_StartIndex = INDEX();
+
+
+
+ sep::BFVector labelledReturns(
+ ( machine->getType().is< sep::Machine >() ) ? machine->getType().
+ to_ptr< sep::Machine >()->getVariableParametersCount() : 0 );
+
+ sep::BFList positionalReturns;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(95)) )
+ {
+ {
+
+ if( labelledReturns.nonempty() )
+ {
+ sep::ParserUtil::computeInstanceMachineReturn(
+ machine, labelledReturns, positionalReturns);
+ }
+
+ }
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2748:2: ( ( '-->' | 'returns:' ) ( LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN |lp= labelled_argument ) )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2748:4: ( '-->' | 'returns:' ) ( LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN |lp= labelled_argument )
+ {
+ if ( LA(1) == 163 || LA(1) == 365 )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruledecl_instance_machine_returnsEx;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2749:4: ( LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN |lp= labelled_argument )
+ {
+ int alt230=2;
+ switch ( LA(1) )
+ {
+ case LPAREN:
+ {
+ {
+ int LA230_1 = LA(2);
+ if ( (synpred412_fml(ctx)))
+ {
+ alt230=1;
+ }
+ else if ( (ANTLR3_TRUE))
+ {
+ alt230=2;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 230;
+ EXCEPTION->state = 1;
+
+
+ goto ruledecl_instance_machine_returnsEx;
+
+ }
+ }
+ }
+ break;
+ case BNOT:
+ case COLONx2:
+ case CharLiteral:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case FloatLiteral:
+ case ID:
+ case INCR:
+ case IntegerLiteral:
+ case LBRACKET:
+ case LBRACKET_BAR:
+ case LCURLY:
+ case LNOT:
+ case LPAREN_INVOKE:
+ case MINUS:
+ case OP_POP:
+ case OP_TOP:
+ case PERCENT_LCURLY:
+ case PLUS:
+ case RationalLiteral:
+ case StringLiteral:
+ case 158:
+ case 159:
+ case 160:
+ case 161:
+ case 162:
+ case 237:
+ case 256:
+ case 265:
+ case 277:
+ case 280:
+ case 294:
+ case 313:
+ case 330:
+ case 331:
+ case 332:
+ case 343:
+ case 347:
+ case 372:
+ case 397:
+ {
+ alt230=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 230;
+ EXCEPTION->state = 0;
+
+
+ goto ruledecl_instance_machine_returnsEx;
+
+ }
+
+ switch (alt230)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2749:6: LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_decl_instance_machine_returns8076);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instance_machine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_labelled_argument_in_decl_instance_machine_returns8085);
+ lp=labelled_argument(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instance_machine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ sep::ParserUtil::appendInstanceMachineReturn(machine, lp.label
+ ,
+ labelledReturns, positionalReturns, lp.arg
+ );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2755:6: ( COMMA lp= labelled_argument )*
+
+ for (;;)
+ {
+ int alt229=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt229=1;
+ }
+ break;
+
+ }
+
+ switch (alt229)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2755:8: COMMA lp= labelled_argument
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_decl_instance_machine_returns8101);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instance_machine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_labelled_argument_in_decl_instance_machine_returns8112);
+ lp=labelled_argument(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instance_machine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ sep::ParserUtil::appendInstanceMachineReturn(machine, lp.label
+ ,
+ labelledReturns, positionalReturns, lp.arg
+ );
+
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop229; /* break out of the loop */
+ break;
+ }
+ }
+ loop229: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_decl_instance_machine_returns8136);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instance_machine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2764:6: lp= labelled_argument
+ {
+ FOLLOWPUSH(FOLLOW_labelled_argument_in_decl_instance_machine_returns8146);
+ lp=labelled_argument(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instance_machine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ sep::ParserUtil::appendInstanceMachineReturn(machine, lp.label
+ ,
+ labelledReturns, positionalReturns, lp.arg
+ );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledecl_instance_machine_returnsEx; /* Prevent compiler warnings */
+ ruledecl_instance_machine_returnsEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ if( labelledReturns.nonempty() )
+ {
+ sep::ParserUtil::computeInstanceMachineReturn(
+ machine, labelledReturns, positionalReturns);
+ }
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(95, decl_instance_machine_returns_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end decl_instance_machine_returns */
+
+/**
+ * $ANTLR start activity_machine_param_return
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2774:1: activity_machine_param_return[ const sep::BF & argMachine , sep::BFCode & ac ] : LPAREN (lp= labelled_argument ( COMMA lp= labelled_argument )* )? RPAREN ( ( '-->' | 'returns:' ) ( LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN |lp= labelled_argument ) )? ;
+ */
+static void
+activity_machine_param_return(pfmlParser ctx, const sep::BF & argMachine, sep::BFCode & ac)
+{
+ ANTLR3_UINT32 activity_machine_param_return_StartIndex;
+
+ fmlParser_labelled_argument_return lp;
+ #undef RETURN_TYPE_lp
+ #define RETURN_TYPE_lp fmlParser_labelled_argument_return
+
+ /* Initialize rule variables
+ */
+ activity_machine_param_return_StartIndex = INDEX();
+
+
+
+ sep::Machine * machine = argMachine.is< sep::Machine >() ?
+ argMachine.to_ptr< sep::Machine >() : NULL;
+
+ sep::Routine * routine = NULL;
+
+ sep::avm_size_t paramCount = 0;
+ sep::avm_size_t returnCount = 0;
+ if( machine == NULL )
+ {
+ routine = NULL;
+ }
+ else if( machine->getSpecifier().isDesignInstanceStatic()
+ && machine->getType().is< sep::Machine >() )
+ {
+ routine = &( machine->getType().to_ptr< sep::Machine >()->
+ getBehavior()->getActivity( ac->getAvmOpCode() ) );
+ }
+ else if( ac->isnotOpCode( sep::AVM_OPCODE_INVOKE_NEW ) )
+ // if( machine->isDesignPrototypeStatic() )
+ {
+ routine = &( machine->getBehavior()->
+ getActivity( ac->getAvmOpCode() ) );
+ }
+
+ if( routine != NULL )
+ {
+ paramCount = routine->getParameters().size();
+ returnCount = routine->getReturns().size();
+ }
+
+
+ sep::BFVector labelledParams( paramCount );
+ sep::BFList positionalParams;
+
+ sep::BFVector labelledReturns( returnCount );
+ sep::BFList positionalReturns;
+
+ if( machine != NULL )
+ {
+ PUSH_CTX_CPM( machine );
+ }
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(96)) )
+ {
+ {
+
+ if( BACKTRACKING==0 )
+ {
+ sep::ParserUtil::computeActivityRoutineParamReturn(argMachine, routine, ac,
+ labelledParams , positionalParams, labelledReturns, positionalReturns);
+ }
+
+ if( machine != NULL )
+ {
+ POP_CTX;
+ }
+
+ }
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2831:2: ( LPAREN (lp= labelled_argument ( COMMA lp= labelled_argument )* )? RPAREN ( ( '-->' | 'returns:' ) ( LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN |lp= labelled_argument ) )? )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2831:4: LPAREN (lp= labelled_argument ( COMMA lp= labelled_argument )* )? RPAREN ( ( '-->' | 'returns:' ) ( LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN |lp= labelled_argument ) )?
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_activity_machine_param_return8182);
+ if (HASEXCEPTION())
+ {
+ goto ruleactivity_machine_param_returnEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2832:4: (lp= labelled_argument ( COMMA lp= labelled_argument )* )?
+ {
+ int alt232=2;
+ switch ( LA(1) )
+ {
+ case BNOT:
+ case COLONx2:
+ case CharLiteral:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case FloatLiteral:
+ case ID:
+ case INCR:
+ case IntegerLiteral:
+ case LBRACKET:
+ case LBRACKET_BAR:
+ case LCURLY:
+ case LNOT:
+ case LPAREN:
+ case LPAREN_INVOKE:
+ case MINUS:
+ case OP_POP:
+ case OP_TOP:
+ case PERCENT_LCURLY:
+ case PLUS:
+ case RationalLiteral:
+ case StringLiteral:
+ case 158:
+ case 159:
+ case 160:
+ case 161:
+ case 162:
+ case 237:
+ case 256:
+ case 265:
+ case 277:
+ case 280:
+ case 294:
+ case 313:
+ case 330:
+ case 331:
+ case 332:
+ case 343:
+ case 347:
+ case 372:
+ case 397:
+ {
+ alt232=1;
+ }
+ break;
+ }
+
+ switch (alt232)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2832:6: lp= labelled_argument ( COMMA lp= labelled_argument )*
+ {
+ FOLLOWPUSH(FOLLOW_labelled_argument_in_activity_machine_param_return8193);
+ lp=labelled_argument(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleactivity_machine_param_returnEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ sep::ParserUtil::appendRoutineParameters(routine, lp.label
+ ,
+ labelledParams, positionalParams, lp.arg
+ );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2837:6: ( COMMA lp= labelled_argument )*
+
+ for (;;)
+ {
+ int alt231=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt231=1;
+ }
+ break;
+
+ }
+
+ switch (alt231)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2837:8: COMMA lp= labelled_argument
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_activity_machine_param_return8209);
+ if (HASEXCEPTION())
+ {
+ goto ruleactivity_machine_param_returnEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_labelled_argument_in_activity_machine_param_return8218);
+ lp=labelled_argument(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleactivity_machine_param_returnEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ sep::ParserUtil::appendRoutineParameters(routine, lp.label
+ ,
+ labelledParams, positionalParams, lp.arg
+ );
+
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop231; /* break out of the loop */
+ break;
+ }
+ }
+ loop231: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_activity_machine_param_return8244);
+ if (HASEXCEPTION())
+ {
+ goto ruleactivity_machine_param_returnEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2847:2: ( ( '-->' | 'returns:' ) ( LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN |lp= labelled_argument ) )?
+ {
+ int alt235=2;
+ switch ( LA(1) )
+ {
+ case 163:
+ case 365:
+ {
+ alt235=1;
+ }
+ break;
+ }
+
+ switch (alt235)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2847:4: ( '-->' | 'returns:' ) ( LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN |lp= labelled_argument )
+ {
+ if ( LA(1) == 163 || LA(1) == 365 )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruleactivity_machine_param_returnEx;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2848:4: ( LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN |lp= labelled_argument )
+ {
+ int alt234=2;
+ switch ( LA(1) )
+ {
+ case LPAREN:
+ {
+ {
+ int LA234_1 = LA(2);
+ if ( (synpred417_fml(ctx)))
+ {
+ alt234=1;
+ }
+ else if ( (ANTLR3_TRUE))
+ {
+ alt234=2;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 234;
+ EXCEPTION->state = 1;
+
+
+ goto ruleactivity_machine_param_returnEx;
+
+ }
+ }
+ }
+ break;
+ case BNOT:
+ case COLONx2:
+ case CharLiteral:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case FloatLiteral:
+ case ID:
+ case INCR:
+ case IntegerLiteral:
+ case LBRACKET:
+ case LBRACKET_BAR:
+ case LCURLY:
+ case LNOT:
+ case LPAREN_INVOKE:
+ case MINUS:
+ case OP_POP:
+ case OP_TOP:
+ case PERCENT_LCURLY:
+ case PLUS:
+ case RationalLiteral:
+ case StringLiteral:
+ case 158:
+ case 159:
+ case 160:
+ case 161:
+ case 162:
+ case 237:
+ case 256:
+ case 265:
+ case 277:
+ case 280:
+ case 294:
+ case 313:
+ case 330:
+ case 331:
+ case 332:
+ case 343:
+ case 347:
+ case 372:
+ case 397:
+ {
+ alt234=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 234;
+ EXCEPTION->state = 0;
+
+
+ goto ruleactivity_machine_param_returnEx;
+
+ }
+
+ switch (alt234)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2848:6: LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_activity_machine_param_return8265);
+ if (HASEXCEPTION())
+ {
+ goto ruleactivity_machine_param_returnEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_labelled_argument_in_activity_machine_param_return8274);
+ lp=labelled_argument(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleactivity_machine_param_returnEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ sep::ParserUtil::appendRoutineReturns(routine, lp.label
+ ,
+ labelledReturns, positionalReturns, lp.arg
+ );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2854:6: ( COMMA lp= labelled_argument )*
+
+ for (;;)
+ {
+ int alt233=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt233=1;
+ }
+ break;
+
+ }
+
+ switch (alt233)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2854:8: COMMA lp= labelled_argument
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_activity_machine_param_return8290);
+ if (HASEXCEPTION())
+ {
+ goto ruleactivity_machine_param_returnEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_labelled_argument_in_activity_machine_param_return8301);
+ lp=labelled_argument(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleactivity_machine_param_returnEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ sep::ParserUtil::appendRoutineReturns(routine, lp.label
+ ,
+ labelledReturns, positionalReturns, lp.arg
+ );
+
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop233; /* break out of the loop */
+ break;
+ }
+ }
+ loop233: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_activity_machine_param_return8325);
+ if (HASEXCEPTION())
+ {
+ goto ruleactivity_machine_param_returnEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2863:6: lp= labelled_argument
+ {
+ FOLLOWPUSH(FOLLOW_labelled_argument_in_activity_machine_param_return8335);
+ lp=labelled_argument(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleactivity_machine_param_returnEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ sep::ParserUtil::appendRoutineReturns(routine, lp.label
+ ,
+ labelledReturns, positionalReturns, lp.arg
+ );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleactivity_machine_param_returnEx; /* Prevent compiler warnings */
+ ruleactivity_machine_param_returnEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ if( BACKTRACKING==0 )
+ {
+ sep::ParserUtil::computeActivityRoutineParamReturn(argMachine, routine, ac,
+ labelledParams , positionalParams, labelledReturns, positionalReturns);
+ }
+
+ if( machine != NULL )
+ {
+ POP_CTX;
+ }
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(96, activity_machine_param_return_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end activity_machine_param_return */
+
+/**
+ * $ANTLR start decl_port
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2879:1: decl_port[ sep::PropertyPart & declProperty , sep::Modifier mdfr ] : 'port' decl_port_impl[ declProperty , mdfr, nature ] ;
+ */
+static void
+decl_port(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr)
+{
+ ANTLR3_UINT32 decl_port_StartIndex;
+
+ /* Initialize rule variables
+ */
+ decl_port_StartIndex = INDEX();
+
+
+
+ sep::IComPoint::ENUM_IO_NATURE nature = sep::IComPoint::IO_UNDEFINED_NATURE;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(97)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2884:2: ( 'port' decl_port_impl[ declProperty , mdfr, nature ] )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2884:4: 'port' decl_port_impl[ declProperty , mdfr, nature ]
+ {
+ MATCHT(344, &FOLLOW_344_in_decl_port8376);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ nature = sep::IComPoint::IO_PORT_NATURE;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_decl_port_impl_in_decl_port8386);
+ decl_port_impl(ctx, declProperty, mdfr, nature);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledecl_portEx; /* Prevent compiler warnings */
+ ruledecl_portEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(97, decl_port_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end decl_port */
+
+/**
+ * $ANTLR start decl_port_impl
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2889:1: decl_port_impl[ sep::PropertyPart & declProperty , sep::Modifier mdfr ,\n\t\tsep::IComPoint::ENUM_IO_NATURE nature ] : ( ( ID )=>id= ID ( type_param_com[ port ] )? SEMI | modifier_set_direction_strict_text[ mdfr ] (id= ID ( type_param_com[ port ] )? SEMI | LCURLY (id= ID ( type_param_com[ port ] )? SEMI )+ RCURLY ) | LCURLY ( ( ID )=>id= ID ( type_param_com[ port ] )? SEMI | modifier_set_direction_strict_text[ mdfr ] id= ID ( type_param_com[ port ] )? SEMI )+ RCURLY );
+ */
+static void
+decl_port_impl(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr, sep::IComPoint::ENUM_IO_NATURE nature)
+{
+ ANTLR3_UINT32 decl_port_impl_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+
+ /* Initialize rule variables
+ */
+ decl_port_impl_StartIndex = INDEX();
+
+
+
+ sep::Port * port;
+ sep::BF TPort;
+ bool isaType = true;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(98)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ id = NULL;
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2897:2: ( ( ID )=>id= ID ( type_param_com[ port ] )? SEMI | modifier_set_direction_strict_text[ mdfr ] (id= ID ( type_param_com[ port ] )? SEMI | LCURLY (id= ID ( type_param_com[ port ] )? SEMI )+ RCURLY ) | LCURLY ( ( ID )=>id= ID ( type_param_com[ port ] )? SEMI | modifier_set_direction_strict_text[ mdfr ] id= ID ( type_param_com[ port ] )? SEMI )+ RCURLY )
+
+ ANTLR3_UINT32 alt244;
+
+ alt244=3;
+
+ {
+ int LA244_0 = LA(1);
+ if ( (synpred419_fml(ctx)) && (LA244_0 == ID))
+ {
+ alt244=1;
+ }
+ else if ( (LA244_0 == 298 || LA244_0 == 305 || LA244_0 == 341 || LA244_0 == 364))
+ {
+ alt244=2;
+ }
+ else if ( (LA244_0 == LCURLY))
+ {
+ alt244=3;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 244;
+ EXCEPTION->state = 0;
+
+
+ goto ruledecl_port_implEx;
+
+ }
+ }
+ switch (alt244)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2897:4: ( ID )=>id= ID ( type_param_com[ port ] )? SEMI
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_decl_port_impl8416);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_port_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ declProperty.appendPort( sep::BF(
+ port = new sep::Port(declProperty,
+ STR((id->getText(id))->chars), nature,
+ mdfr.setDirectionInoutElse() ) ) );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2904:4: ( type_param_com[ port ] )?
+ {
+ int alt236=2;
+ switch ( LA(1) )
+ {
+ case LPAREN:
+ {
+ alt236=1;
+ }
+ break;
+ }
+
+ switch (alt236)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2904:6: type_param_com[ port ]
+ {
+ FOLLOWPUSH(FOLLOW_type_param_com_in_decl_port_impl8428);
+ type_param_com(ctx, port);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_port_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_decl_port_impl8435);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_port_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2906:4: modifier_set_direction_strict_text[ mdfr ] (id= ID ( type_param_com[ port ] )? SEMI | LCURLY (id= ID ( type_param_com[ port ] )? SEMI )+ RCURLY )
+ {
+ FOLLOWPUSH(FOLLOW_modifier_set_direction_strict_text_in_decl_port_impl8441);
+ modifier_set_direction_strict_text(ctx, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_port_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2907:4: (id= ID ( type_param_com[ port ] )? SEMI | LCURLY (id= ID ( type_param_com[ port ] )? SEMI )+ RCURLY )
+ {
+ int alt240=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt240=1;
+ }
+ break;
+ case LCURLY:
+ {
+ alt240=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 240;
+ EXCEPTION->state = 0;
+
+
+ goto ruledecl_port_implEx;
+
+ }
+
+ switch (alt240)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2907:6: id= ID ( type_param_com[ port ] )? SEMI
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_decl_port_impl8451);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_port_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ declProperty.appendPort( sep::BF(
+ port = new sep::Port(declProperty,
+ STR((id->getText(id))->chars), nature, mdfr ) ) );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2913:3: ( type_param_com[ port ] )?
+ {
+ int alt237=2;
+ switch ( LA(1) )
+ {
+ case LPAREN:
+ {
+ alt237=1;
+ }
+ break;
+ }
+
+ switch (alt237)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2913:5: type_param_com[ port ]
+ {
+ FOLLOWPUSH(FOLLOW_type_param_com_in_decl_port_impl8461);
+ type_param_com(ctx, port);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_port_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_decl_port_impl8468);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_port_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2915:6: LCURLY (id= ID ( type_param_com[ port ] )? SEMI )+ RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_decl_port_impl8476);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_port_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2916:5: (id= ID ( type_param_com[ port ] )? SEMI )+
+ {
+ int cnt239=0;
+
+ for (;;)
+ {
+ int alt239=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt239=1;
+ }
+ break;
+
+ }
+
+ switch (alt239)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2916:7: id= ID ( type_param_com[ port ] )? SEMI
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_decl_port_impl8486);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_port_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ declProperty.appendPort( sep::BF(
+ port = new sep::Port(declProperty,
+ STR((id->getText(id))->chars), nature, mdfr) ) );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2922:8: ( type_param_com[ port ] )?
+ {
+ int alt238=2;
+ switch ( LA(1) )
+ {
+ case LPAREN:
+ {
+ alt238=1;
+ }
+ break;
+ }
+
+ switch (alt238)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2922:10: type_param_com[ port ]
+ {
+ FOLLOWPUSH(FOLLOW_type_param_com_in_decl_port_impl8506);
+ type_param_com(ctx, port);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_port_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_decl_port_impl8513);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_port_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt239 >= 1 )
+ {
+ goto loop239;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruledecl_port_implEx;
+ }
+ cnt239++;
+ }
+ loop239: ; /* Jump to here if this rule does not match */
+ }
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_decl_port_impl8523);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_port_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2926:4: LCURLY ( ( ID )=>id= ID ( type_param_com[ port ] )? SEMI | modifier_set_direction_strict_text[ mdfr ] id= ID ( type_param_com[ port ] )? SEMI )+ RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_decl_port_impl8533);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_port_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2927:4: ( ( ID )=>id= ID ( type_param_com[ port ] )? SEMI | modifier_set_direction_strict_text[ mdfr ] id= ID ( type_param_com[ port ] )? SEMI )+
+ {
+ int cnt243=0;
+
+ for (;;)
+ {
+ int alt243=3;
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA243_0 = LA(1);
+ if ( (synpred426_fml(ctx)) && (LA243_0 == ID))
+ {
+ alt243=1;
+ }
+ else if ( (LA243_0 == 298 || LA243_0 == 305 || LA243_0 == 341 || LA243_0 == 364))
+ {
+ alt243=2;
+ }
+
+ }
+ switch (alt243)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2927:6: ( ID )=>id= ID ( type_param_com[ port ] )? SEMI
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_decl_port_impl8551);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_port_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ declProperty.appendPort( sep::BF(
+ port = new sep::Port(declProperty,
+ STR((id->getText(id))->chars), nature,
+ mdfr.setDirectionInoutElse() ) ) );
+ port->setModifier( mdfr );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2935:6: ( type_param_com[ port ] )?
+ {
+ int alt241=2;
+ switch ( LA(1) )
+ {
+ case LPAREN:
+ {
+ alt241=1;
+ }
+ break;
+ }
+
+ switch (alt241)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2935:8: type_param_com[ port ]
+ {
+ FOLLOWPUSH(FOLLOW_type_param_com_in_decl_port_impl8567);
+ type_param_com(ctx, port);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_port_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_decl_port_impl8574);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_port_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2937:6: modifier_set_direction_strict_text[ mdfr ] id= ID ( type_param_com[ port ] )? SEMI
+ {
+ FOLLOWPUSH(FOLLOW_modifier_set_direction_strict_text_in_decl_port_impl8582);
+ modifier_set_direction_strict_text(ctx, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_port_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_decl_port_impl8587);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_port_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ declProperty.appendPort( sep::BF(
+ port = new sep::Port(declProperty,
+ STR((id->getText(id))->chars), nature, mdfr) ) );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2943:6: ( type_param_com[ port ] )?
+ {
+ int alt242=2;
+ switch ( LA(1) )
+ {
+ case LPAREN:
+ {
+ alt242=1;
+ }
+ break;
+ }
+
+ switch (alt242)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2943:8: type_param_com[ port ]
+ {
+ FOLLOWPUSH(FOLLOW_type_param_com_in_decl_port_impl8603);
+ type_param_com(ctx, port);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_port_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_decl_port_impl8610);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_port_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt243 >= 1 )
+ {
+ goto loop243;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruledecl_port_implEx;
+ }
+ cnt243++;
+ }
+ loop243: ; /* Jump to here if this rule does not match */
+ }
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_decl_port_impl8621);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_port_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledecl_port_implEx; /* Prevent compiler warnings */
+ ruledecl_port_implEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(98, decl_port_impl_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end decl_port_impl */
+
+/**
+ * $ANTLR start decl_signal
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2953:1: decl_signal[ sep::PropertyPart & declProperty , sep::Modifier mdfr ] : ( 'signal' | 'message' ) decl_signal_impl[ declProperty , mdfr, nature ] ;
+ */
+static void
+decl_signal(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr)
+{
+ ANTLR3_UINT32 decl_signal_StartIndex;
+
+ /* Initialize rule variables
+ */
+ decl_signal_StartIndex = INDEX();
+
+
+
+ sep::IComPoint::ENUM_IO_NATURE nature = sep::IComPoint::IO_UNDEFINED_NATURE;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(99)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2958:2: ( ( 'signal' | 'message' ) decl_signal_impl[ declProperty , mdfr, nature ] )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2958:4: ( 'signal' | 'message' ) decl_signal_impl[ declProperty , mdfr, nature ]
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2958:4: ( 'signal' | 'message' )
+ {
+ int alt245=2;
+ switch ( LA(1) )
+ {
+ case 374:
+ {
+ alt245=1;
+ }
+ break;
+ case 320:
+ {
+ alt245=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 245;
+ EXCEPTION->state = 0;
+
+
+ goto ruledecl_signalEx;
+
+ }
+
+ switch (alt245)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2958:6: 'signal'
+ {
+ MATCHT(374, &FOLLOW_374_in_decl_signal8646);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_signalEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ nature = sep::IComPoint::IO_SIGNAL_NATURE;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2959:6: 'message'
+ {
+ MATCHT(320, &FOLLOW_320_in_decl_signal8656);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_signalEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ nature = sep::IComPoint::IO_MESSAGE_NATURE;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_decl_signal_impl_in_decl_signal8668);
+ decl_signal_impl(ctx, declProperty, mdfr, nature);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_signalEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledecl_signalEx; /* Prevent compiler warnings */
+ ruledecl_signalEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(99, decl_signal_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end decl_signal */
+
+/**
+ * $ANTLR start decl_signal_impl
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2964:1: decl_signal_impl[ sep::PropertyPart & declProperty , sep::Modifier mdfr ,\n\t\tsep::IComPoint::ENUM_IO_NATURE nature ] : ( ( ID )=>id= ID ( type_param_com[ signal ] )? SEMI | modifier_set_direction_strict_text[ mdfr ] (id= ID ( type_param_com[ signal ] )? SEMI | LCURLY (id= ID ( type_param_com[ signal ] )? SEMI )+ RCURLY ) | LCURLY ( ( ID )=>id= ID ( type_param_com[ signal ] )? SEMI | modifier_set_direction_strict_text[ mdfr ] id= ID ( type_param_com[ signal ] )? SEMI )+ RCURLY );
+ */
+static void
+decl_signal_impl(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr, sep::IComPoint::ENUM_IO_NATURE nature)
+{
+ ANTLR3_UINT32 decl_signal_impl_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+
+ /* Initialize rule variables
+ */
+ decl_signal_impl_StartIndex = INDEX();
+
+
+
+ sep::Port * signal;
+ sep::BF TPort;
+ bool isaType = true;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(100)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ id = NULL;
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2972:2: ( ( ID )=>id= ID ( type_param_com[ signal ] )? SEMI | modifier_set_direction_strict_text[ mdfr ] (id= ID ( type_param_com[ signal ] )? SEMI | LCURLY (id= ID ( type_param_com[ signal ] )? SEMI )+ RCURLY ) | LCURLY ( ( ID )=>id= ID ( type_param_com[ signal ] )? SEMI | modifier_set_direction_strict_text[ mdfr ] id= ID ( type_param_com[ signal ] )? SEMI )+ RCURLY )
+
+ ANTLR3_UINT32 alt254;
+
+ alt254=3;
+
+ {
+ int LA254_0 = LA(1);
+ if ( (synpred431_fml(ctx)) && (LA254_0 == ID))
+ {
+ alt254=1;
+ }
+ else if ( (LA254_0 == 298 || LA254_0 == 305 || LA254_0 == 341 || LA254_0 == 364))
+ {
+ alt254=2;
+ }
+ else if ( (LA254_0 == LCURLY))
+ {
+ alt254=3;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 254;
+ EXCEPTION->state = 0;
+
+
+ goto ruledecl_signal_implEx;
+
+ }
+ }
+ switch (alt254)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2972:4: ( ID )=>id= ID ( type_param_com[ signal ] )? SEMI
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_decl_signal_impl8698);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_signal_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ declProperty.appendSignal( sep::BF(
+ signal = new sep::Signal(declProperty,
+ STR((id->getText(id))->chars), nature,
+ mdfr.setDirectionInoutElse() ) ) );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2979:4: ( type_param_com[ signal ] )?
+ {
+ int alt246=2;
+ switch ( LA(1) )
+ {
+ case LPAREN:
+ {
+ alt246=1;
+ }
+ break;
+ }
+
+ switch (alt246)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2979:6: type_param_com[ signal ]
+ {
+ FOLLOWPUSH(FOLLOW_type_param_com_in_decl_signal_impl8710);
+ type_param_com(ctx, signal);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_signal_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_decl_signal_impl8717);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_signal_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2981:4: modifier_set_direction_strict_text[ mdfr ] (id= ID ( type_param_com[ signal ] )? SEMI | LCURLY (id= ID ( type_param_com[ signal ] )? SEMI )+ RCURLY )
+ {
+ FOLLOWPUSH(FOLLOW_modifier_set_direction_strict_text_in_decl_signal_impl8723);
+ modifier_set_direction_strict_text(ctx, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_signal_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2982:4: (id= ID ( type_param_com[ signal ] )? SEMI | LCURLY (id= ID ( type_param_com[ signal ] )? SEMI )+ RCURLY )
+ {
+ int alt250=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt250=1;
+ }
+ break;
+ case LCURLY:
+ {
+ alt250=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 250;
+ EXCEPTION->state = 0;
+
+
+ goto ruledecl_signal_implEx;
+
+ }
+
+ switch (alt250)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2982:6: id= ID ( type_param_com[ signal ] )? SEMI
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_decl_signal_impl8733);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_signal_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ declProperty.appendSignal( sep::BF(
+ signal = new sep::Signal(declProperty,
+ STR((id->getText(id))->chars), nature, mdfr ) ) );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2988:3: ( type_param_com[ signal ] )?
+ {
+ int alt247=2;
+ switch ( LA(1) )
+ {
+ case LPAREN:
+ {
+ alt247=1;
+ }
+ break;
+ }
+
+ switch (alt247)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2988:5: type_param_com[ signal ]
+ {
+ FOLLOWPUSH(FOLLOW_type_param_com_in_decl_signal_impl8743);
+ type_param_com(ctx, signal);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_signal_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_decl_signal_impl8750);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_signal_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2990:6: LCURLY (id= ID ( type_param_com[ signal ] )? SEMI )+ RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_decl_signal_impl8758);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_signal_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2991:5: (id= ID ( type_param_com[ signal ] )? SEMI )+
+ {
+ int cnt249=0;
+
+ for (;;)
+ {
+ int alt249=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt249=1;
+ }
+ break;
+
+ }
+
+ switch (alt249)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2991:7: id= ID ( type_param_com[ signal ] )? SEMI
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_decl_signal_impl8768);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_signal_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ declProperty.appendSignal( sep::BF(
+ signal = new sep::Signal(declProperty,
+ STR((id->getText(id))->chars), nature, mdfr) ) );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2997:8: ( type_param_com[ signal ] )?
+ {
+ int alt248=2;
+ switch ( LA(1) )
+ {
+ case LPAREN:
+ {
+ alt248=1;
+ }
+ break;
+ }
+
+ switch (alt248)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2997:10: type_param_com[ signal ]
+ {
+ FOLLOWPUSH(FOLLOW_type_param_com_in_decl_signal_impl8788);
+ type_param_com(ctx, signal);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_signal_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_decl_signal_impl8795);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_signal_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt249 >= 1 )
+ {
+ goto loop249;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruledecl_signal_implEx;
+ }
+ cnt249++;
+ }
+ loop249: ; /* Jump to here if this rule does not match */
+ }
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_decl_signal_impl8805);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_signal_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3001:4: LCURLY ( ( ID )=>id= ID ( type_param_com[ signal ] )? SEMI | modifier_set_direction_strict_text[ mdfr ] id= ID ( type_param_com[ signal ] )? SEMI )+ RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_decl_signal_impl8815);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_signal_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3002:4: ( ( ID )=>id= ID ( type_param_com[ signal ] )? SEMI | modifier_set_direction_strict_text[ mdfr ] id= ID ( type_param_com[ signal ] )? SEMI )+
+ {
+ int cnt253=0;
+
+ for (;;)
+ {
+ int alt253=3;
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA253_0 = LA(1);
+ if ( (synpred438_fml(ctx)) && (LA253_0 == ID))
+ {
+ alt253=1;
+ }
+ else if ( (LA253_0 == 298 || LA253_0 == 305 || LA253_0 == 341 || LA253_0 == 364))
+ {
+ alt253=2;
+ }
+
+ }
+ switch (alt253)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3002:6: ( ID )=>id= ID ( type_param_com[ signal ] )? SEMI
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_decl_signal_impl8833);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_signal_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ declProperty.appendSignal( sep::BF(
+ signal = new sep::Signal(declProperty,
+ STR((id->getText(id))->chars), nature,
+ mdfr.setDirectionInoutElse() ) ) );
+ signal->setModifier( mdfr );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3010:6: ( type_param_com[ signal ] )?
+ {
+ int alt251=2;
+ switch ( LA(1) )
+ {
+ case LPAREN:
+ {
+ alt251=1;
+ }
+ break;
+ }
+
+ switch (alt251)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3010:8: type_param_com[ signal ]
+ {
+ FOLLOWPUSH(FOLLOW_type_param_com_in_decl_signal_impl8849);
+ type_param_com(ctx, signal);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_signal_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_decl_signal_impl8856);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_signal_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3012:6: modifier_set_direction_strict_text[ mdfr ] id= ID ( type_param_com[ signal ] )? SEMI
+ {
+ FOLLOWPUSH(FOLLOW_modifier_set_direction_strict_text_in_decl_signal_impl8864);
+ modifier_set_direction_strict_text(ctx, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_signal_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_decl_signal_impl8869);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_signal_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ declProperty.appendSignal( sep::BF(
+ signal = new sep::Signal(declProperty,
+ STR((id->getText(id))->chars), nature, mdfr) ) );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3018:6: ( type_param_com[ signal ] )?
+ {
+ int alt252=2;
+ switch ( LA(1) )
+ {
+ case LPAREN:
+ {
+ alt252=1;
+ }
+ break;
+ }
+
+ switch (alt252)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3018:8: type_param_com[ signal ]
+ {
+ FOLLOWPUSH(FOLLOW_type_param_com_in_decl_signal_impl8885);
+ type_param_com(ctx, signal);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_signal_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_decl_signal_impl8892);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_signal_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt253 >= 1 )
+ {
+ goto loop253;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruledecl_signal_implEx;
+ }
+ cnt253++;
+ }
+ loop253: ; /* Jump to here if this rule does not match */
+ }
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_decl_signal_impl8903);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_signal_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledecl_signal_implEx; /* Prevent compiler warnings */
+ ruledecl_signal_implEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(100, decl_signal_impl_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end decl_signal_impl */
+
+/**
+ * $ANTLR start type_param_com
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3028:1: type_param_com[ sep::Port * port ] : LPAREN param_com_atom[ port , offset] ( COMMA param_com_atom[ port , ++offset ] )* RPAREN ;
+ */
+static void
+type_param_com(pfmlParser ctx, sep::Port * port)
+{
+ ANTLR3_UINT32 type_param_com_StartIndex;
+
+ /* Initialize rule variables
+ */
+ type_param_com_StartIndex = INDEX();
+
+
+
+ sep::avm_offset_t offset = 0;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(101)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3032:2: ( LPAREN param_com_atom[ port , offset] ( COMMA param_com_atom[ port , ++offset ] )* RPAREN )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3032:4: LPAREN param_com_atom[ port , offset] ( COMMA param_com_atom[ port , ++offset ] )* RPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_type_param_com8925);
+ if (HASEXCEPTION())
+ {
+ goto ruletype_param_comEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_param_com_atom_in_type_param_com8932);
+ param_com_atom(ctx, port, offset);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletype_param_comEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3034:6: ( COMMA param_com_atom[ port , ++offset ] )*
+
+ for (;;)
+ {
+ int alt255=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt255=1;
+ }
+ break;
+
+ }
+
+ switch (alt255)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3034:8: COMMA param_com_atom[ port , ++offset ]
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_type_param_com8942);
+ if (HASEXCEPTION())
+ {
+ goto ruletype_param_comEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_param_com_atom_in_type_param_com8944);
+ param_com_atom(ctx, port, ++offset);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletype_param_comEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop255; /* break out of the loop */
+ break;
+ }
+ }
+ loop255: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_type_param_com8953);
+ if (HASEXCEPTION())
+ {
+ goto ruletype_param_comEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruletype_param_comEx; /* Prevent compiler warnings */
+ ruletype_param_comEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(101, type_param_com_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end type_param_com */
+
+/**
+ * $ANTLR start param_com_atom
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3038:1: param_com_atom[ sep::Port * port , sep::avm_offset_t offset ] : (tv= type_var (id= ID (iv= initial_value )? )? | 'bind:' ( ( type_var COLON )=>tv= type_var COLON e= expression |vid= qualifiedNameID ) );
+ */
+static void
+param_com_atom(pfmlParser ctx, sep::Port * port, sep::avm_offset_t offset)
+{
+ ANTLR3_UINT32 param_com_atom_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ sep::BF tv;
+ #undef RETURN_TYPE_tv
+ #define RETURN_TYPE_tv sep::BF
+
+ sep::BF iv;
+ #undef RETURN_TYPE_iv
+ #define RETURN_TYPE_iv sep::BF
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ fmlParser_qualifiedNameID_return vid;
+ #undef RETURN_TYPE_vid
+ #define RETURN_TYPE_vid fmlParser_qualifiedNameID_return
+
+ /* Initialize rule variables
+ */
+ param_com_atom_StartIndex = INDEX();
+
+
+
+ sep::Variable * variable;
+ sep::BF paramT = sep::TypeManager::UNIVERSAL;
+ std::string paramID;
+ sep::BF value;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(102)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ id = NULL;
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3046:2: (tv= type_var (id= ID (iv= initial_value )? )? | 'bind:' ( ( type_var COLON )=>tv= type_var COLON e= expression |vid= qualifiedNameID ) )
+
+ ANTLR3_UINT32 alt259;
+
+ alt259=2;
+
+ switch ( LA(1) )
+ {
+ case ID:
+ case 241:
+ case 242:
+ case 245:
+ case 246:
+ case 249:
+ case 254:
+ case 255:
+ case 259:
+ case 261:
+ case 264:
+ case 270:
+ case 271:
+ case 281:
+ case 283:
+ case 309:
+ case 310:
+ case 311:
+ case 315:
+ case 316:
+ case 317:
+ case 320:
+ case 325:
+ case 326:
+ case 329:
+ case 333:
+ case 344:
+ case 345:
+ case 346:
+ case 357:
+ case 358:
+ case 360:
+ case 370:
+ case 373:
+ case 374:
+ case 387:
+ case 392:
+ case 399:
+ case 400:
+ case 401:
+ case 402:
+ case 405:
+ case 407:
+ case 408:
+ case 409:
+ case 412:
+ {
+ alt259=1;
+ }
+ break;
+ case 244:
+ {
+ alt259=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 259;
+ EXCEPTION->state = 0;
+
+
+ goto ruleparam_com_atomEx;
+
+ }
+
+ switch (alt259)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3046:4: tv= type_var (id= ID (iv= initial_value )? )?
+ {
+ FOLLOWPUSH(FOLLOW_type_var_in_param_com_atom8973);
+ tv=type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleparam_com_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ paramT = tv
+ ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3047:4: (id= ID (iv= initial_value )? )?
+ {
+ int alt257=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt257=1;
+ }
+ break;
+ }
+
+ switch (alt257)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3047:6: id= ID (iv= initial_value )?
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_param_com_atom8984);
+ if (HASEXCEPTION())
+ {
+ goto ruleparam_com_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ paramID = STR((id->getText(id))->chars);
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3048:6: (iv= initial_value )?
+ {
+ int alt256=2;
+ switch ( LA(1) )
+ {
+ case ASSIGN:
+ case LPAREN:
+ {
+ alt256=1;
+ }
+ break;
+ }
+
+ switch (alt256)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3048:8: iv= initial_value
+ {
+ FOLLOWPUSH(FOLLOW_initial_value_in_param_com_atom9001);
+ iv=initial_value(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleparam_com_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ value = iv
+ ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+
+ port->saveParameter( variable = new sep::Variable(port,
+ sep::Modifier::PROPERTY_PARAMETER_MODIFIER,
+ paramT, paramID, value) );
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3056:4: 'bind:' ( ( type_var COLON )=>tv= type_var COLON e= expression |vid= qualifiedNameID )
+ {
+ MATCHT(244, &FOLLOW_244_in_param_com_atom9022);
+ if (HASEXCEPTION())
+ {
+ goto ruleparam_com_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3057:4: ( ( type_var COLON )=>tv= type_var COLON e= expression |vid= qualifiedNameID )
+ {
+ int alt258=2;
+ {
+ int LA258_0 = LA(1);
+ if ( (synpred446_fml(ctx)) && (((LA258_0 >= 245) && (LA258_0 <= 246))))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (((LA258_0 >= 309) && (LA258_0 <= 310))))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (((LA258_0 >= 401) && (LA258_0 <= 402))))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (((LA258_0 >= 345) && (LA258_0 <= 346))))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (((LA258_0 >= 357) && (LA258_0 <= 358))))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (((LA258_0 >= 407) && (LA258_0 <= 408))))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 283))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 400))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 270))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 399))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 360))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 409))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 259))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 392))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 264))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 271))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 254))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 255))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 387))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 333))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 242))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 344))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 249))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 320))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 374))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 261))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 317))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 405))
+ {
+ alt258=1;
+ }
+ else if ( (LA258_0 == ID))
+ {
+ {
+ int LA258_29 = LA(2);
+ if ( (synpred446_fml(ctx)))
+ {
+ alt258=1;
+ }
+ else if ( (ANTLR3_TRUE))
+ {
+ alt258=2;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 258;
+ EXCEPTION->state = 29;
+
+
+ goto ruleparam_com_atomEx;
+
+ }
+ }
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 241))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 412))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 370))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 316))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 281))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 315))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 325))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 326))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 373))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 329))
+ {
+ alt258=1;
+ }
+ else if ( (synpred446_fml(ctx)) && (LA258_0 == 311))
+ {
+ alt258=1;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 258;
+ EXCEPTION->state = 0;
+
+
+ goto ruleparam_com_atomEx;
+
+ }
+ }
+ switch (alt258)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3057:6: ( type_var COLON )=>tv= type_var COLON e= expression
+ {
+ FOLLOWPUSH(FOLLOW_type_var_in_param_com_atom9042);
+ tv=type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleparam_com_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(COLON, &FOLLOW_COLON_in_param_com_atom9044);
+ if (HASEXCEPTION())
+ {
+ goto ruleparam_com_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ paramT = tv
+ ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_param_com_atom9056);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleparam_com_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ value = e
+ ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3059:6: vid= qualifiedNameID
+ {
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_param_com_atom9067);
+ vid=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleparam_com_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ value = sep::ParserUtil::getVariable(vid.s
+ , vid.nb
+ );
+ if( value.valid() )
+ { paramT = value.to_ptr< sep::Variable >()->getType(); }
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+
+ paramID = sep::OSS() << '#' << offset;
+ port->saveParameter( variable = new sep::Variable(port,
+ sep::Modifier::PROPERTY_PARAMETER_BIND_MODIFIER,
+ paramT, paramID, value) );
+ variable->setOffset( offset );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleparam_com_atomEx; /* Prevent compiler warnings */
+ ruleparam_com_atomEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(102, param_com_atom_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end param_com_atom */
+
+/**
+ * $ANTLR start decl_buffer
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3079:1: decl_buffer[ sep::PropertyPart & declProperty , sep::Modifier mdfr ] : 'buffer' decl_buffer_impl[ declProperty , mdfr ] ;
+ */
+static void
+decl_buffer(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr)
+{
+ ANTLR3_UINT32 decl_buffer_StartIndex;
+
+ /* Initialize rule variables
+ */
+ decl_buffer_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(103)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3081:2: ( 'buffer' decl_buffer_impl[ declProperty , mdfr ] )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3081:4: 'buffer' decl_buffer_impl[ declProperty , mdfr ]
+ {
+ MATCHT(249, &FOLLOW_249_in_decl_buffer9098);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_decl_buffer_impl_in_decl_buffer9101);
+ decl_buffer_impl(ctx, declProperty, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledecl_bufferEx; /* Prevent compiler warnings */
+ ruledecl_bufferEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(103, decl_buffer_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end decl_buffer */
+
+/**
+ * $ANTLR start decl_buffer_impl
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3084:1: decl_buffer_impl[ sep::PropertyPart & declProperty , sep::Modifier mdfr ] : (db= def_buffer id= ID ( initial_buffer_contents[ buffer ] )? SEMI | LCURLY (db= def_buffer id= ID )+ RCURLY );
+ */
+static void
+decl_buffer_impl(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr)
+{
+ ANTLR3_UINT32 decl_buffer_impl_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ fmlParser_def_buffer_return db;
+ #undef RETURN_TYPE_db
+ #define RETURN_TYPE_db fmlParser_def_buffer_return
+
+ /* Initialize rule variables
+ */
+ decl_buffer_impl_StartIndex = INDEX();
+
+
+
+ sep::Buffer * buffer;
+
+ sep::BF TBuffer;
+ bool isaType = true;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(104)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ id = NULL;
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3092:2: (db= def_buffer id= ID ( initial_buffer_contents[ buffer ] )? SEMI | LCURLY (db= def_buffer id= ID )+ RCURLY )
+
+ ANTLR3_UINT32 alt262;
+
+ alt262=2;
+
+ switch ( LA(1) )
+ {
+ case 281:
+ case 315:
+ case 325:
+ case 326:
+ case 329:
+ case 356:
+ case 370:
+ case 373:
+ case 412:
+ {
+ alt262=1;
+ }
+ break;
+ case LCURLY:
+ {
+ alt262=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 262;
+ EXCEPTION->state = 0;
+
+
+ goto ruledecl_buffer_implEx;
+
+ }
+
+ switch (alt262)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3092:4: db= def_buffer id= ID ( initial_buffer_contents[ buffer ] )? SEMI
+ {
+ FOLLOWPUSH(FOLLOW_def_buffer_in_decl_buffer_impl9122);
+ db=def_buffer(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_buffer_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_decl_buffer_impl9127);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_buffer_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ declProperty.appendBuffer( sep::BF(
+ buffer = new sep::Buffer( declProperty,
+ STR((id->getText(id))->chars),
+ db.kind
+ , db.size
+ )) );
+ buffer->setModifier( mdfr );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3099:4: ( initial_buffer_contents[ buffer ] )?
+ {
+ int alt260=2;
+ switch ( LA(1) )
+ {
+ case ASSIGN:
+ {
+ alt260=1;
+ }
+ break;
+ }
+
+ switch (alt260)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3099:6: initial_buffer_contents[ buffer ]
+ {
+ FOLLOWPUSH(FOLLOW_initial_buffer_contents_in_decl_buffer_impl9137);
+ initial_buffer_contents(ctx, buffer);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_buffer_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_decl_buffer_impl9144);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_buffer_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3101:4: LCURLY (db= def_buffer id= ID )+ RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_decl_buffer_impl9150);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_buffer_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3102:4: (db= def_buffer id= ID )+
+ {
+ int cnt261=0;
+
+ for (;;)
+ {
+ int alt261=2;
+ switch ( LA(1) )
+ {
+ case 281:
+ case 315:
+ case 325:
+ case 326:
+ case 329:
+ case 356:
+ case 370:
+ case 373:
+ case 412:
+ {
+ alt261=1;
+ }
+ break;
+
+ }
+
+ switch (alt261)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3103:6: db= def_buffer id= ID
+ {
+ FOLLOWPUSH(FOLLOW_def_buffer_in_decl_buffer_impl9164);
+ db=def_buffer(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_buffer_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_decl_buffer_impl9169);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_buffer_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ declProperty.appendBuffer( sep::BF(
+ buffer = new sep::Buffer(declProperty,
+ STR((id->getText(id))->chars),
+ db.kind
+ , db.size
+ )) );
+ buffer->setModifier( mdfr );
+
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt261 >= 1 )
+ {
+ goto loop261;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruledecl_buffer_implEx;
+ }
+ cnt261++;
+ }
+ loop261: ; /* Jump to here if this rule does not match */
+ }
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_decl_buffer_impl9187);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_buffer_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledecl_buffer_implEx; /* Prevent compiler warnings */
+ ruledecl_buffer_implEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(104, decl_buffer_impl_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end decl_buffer_impl */
+
+/**
+ * $ANTLR start def_buffer
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3115:1: def_buffer returns [ sep::avm_type_specifier_kind_t kind , int size = -1 ] : (pb= policy_buffer ( LT_ (n= integer_constant | STAR ) GT )? | 'ram' );
+ */
+static fmlParser_def_buffer_return
+def_buffer(pfmlParser ctx)
+{
+ fmlParser_def_buffer_return retval;
+
+ ANTLR3_UINT32 def_buffer_StartIndex;
+
+ sep::avm_type_specifier_kind_t pb;
+ #undef RETURN_TYPE_pb
+ #define RETURN_TYPE_pb sep::avm_type_specifier_kind_t
+
+ sep::avm_size_t n;
+ #undef RETURN_TYPE_n
+ #define RETURN_TYPE_n sep::avm_size_t
+
+ /* Initialize rule variables
+ */
+ retval.size = -1;
+
+ def_buffer_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(105)) )
+ {
+ retval.start = 0;
+
+ {
+ }
+
+
+
+ return retval;
+ }
+
+ retval.start = LT(1); retval.stop = retval.start;
+
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3117:2: (pb= policy_buffer ( LT_ (n= integer_constant | STAR ) GT )? | 'ram' )
+
+ ANTLR3_UINT32 alt265;
+
+ alt265=2;
+
+ switch ( LA(1) )
+ {
+ case 281:
+ case 315:
+ case 325:
+ case 326:
+ case 329:
+ case 370:
+ case 373:
+ case 412:
+ {
+ alt265=1;
+ }
+ break;
+ case 356:
+ {
+ alt265=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return retval;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 265;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_bufferEx;
+
+ }
+
+ switch (alt265)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3117:4: pb= policy_buffer ( LT_ (n= integer_constant | STAR ) GT )?
+ {
+ FOLLOWPUSH(FOLLOW_policy_buffer_in_def_buffer9205);
+ pb=policy_buffer(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.kind=
+ pb
+ ;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3118:4: ( LT_ (n= integer_constant | STAR ) GT )?
+ {
+ int alt264=2;
+ switch ( LA(1) )
+ {
+ case LT_:
+ {
+ alt264=1;
+ }
+ break;
+ }
+
+ switch (alt264)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3118:6: LT_ (n= integer_constant | STAR ) GT
+ {
+ MATCHT(LT_, &FOLLOW_LT__in_def_buffer9215);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3119:6: (n= integer_constant | STAR )
+ {
+ int alt263=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ case IntegerLiteral:
+ {
+ alt263=1;
+ }
+ break;
+ case STAR:
+ {
+ alt263=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return retval;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 263;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_bufferEx;
+
+ }
+
+ switch (alt263)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3119:8: n= integer_constant
+ {
+ FOLLOWPUSH(FOLLOW_integer_constant_in_def_buffer9226);
+ n=integer_constant(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.size=
+ n
+ ;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3120:8: STAR
+ {
+ MATCHT(STAR, &FOLLOW_STAR_in_def_buffer9238);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.size= -1;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(GT, &FOLLOW_GT_in_def_buffer9267);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3124:4: 'ram'
+ {
+ MATCHT(356, &FOLLOW_356_in_def_buffer9276);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.kind= sep::TYPE_RAM_SPECIFIER;
+ retval.size= 1;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_bufferEx; /* Prevent compiler warnings */
+ ruledef_bufferEx: ;
+ retval.stop = LT(-1);
+
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(105, def_buffer_StartIndex); }
+
+ return retval;
+}
+/* $ANTLR end def_buffer */
+
+/**
+ * $ANTLR start policy_buffer
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3128:1: policy_buffer returns [ sep::avm_type_specifier_kind_t kind ] : ( 'fifo' | 'lifo' | 'multififo' | 'multilifo' | 'set' | 'multiset' | 'vector' | 'rvector' );
+ */
+static sep::avm_type_specifier_kind_t
+policy_buffer(pfmlParser ctx)
+{
+ sep::avm_type_specifier_kind_t kind;
+
+ ANTLR3_UINT32 policy_buffer_StartIndex;
+
+ /* Initialize rule variables
+ */
+ policy_buffer_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(106)) )
+ {
+ {
+ }
+
+
+
+ return kind;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3130:2: ( 'fifo' | 'lifo' | 'multififo' | 'multilifo' | 'set' | 'multiset' | 'vector' | 'rvector' )
+
+ ANTLR3_UINT32 alt266;
+
+ alt266=8;
+
+ switch ( LA(1) )
+ {
+ case 281:
+ {
+ alt266=1;
+ }
+ break;
+ case 315:
+ {
+ alt266=2;
+ }
+ break;
+ case 325:
+ {
+ alt266=3;
+ }
+ break;
+ case 326:
+ {
+ alt266=4;
+ }
+ break;
+ case 373:
+ {
+ alt266=5;
+ }
+ break;
+ case 329:
+ {
+ alt266=6;
+ }
+ break;
+ case 412:
+ {
+ alt266=7;
+ }
+ break;
+ case 370:
+ {
+ alt266=8;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return kind;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 266;
+ EXCEPTION->state = 0;
+
+
+ goto rulepolicy_bufferEx;
+
+ }
+
+ switch (alt266)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3130:4: 'fifo'
+ {
+ MATCHT(281, &FOLLOW_281_in_policy_buffer9295);
+ if (HASEXCEPTION())
+ {
+ goto rulepolicy_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ kind= sep::TYPE_FIFO_SPECIFIER;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3131:4: 'lifo'
+ {
+ MATCHT(315, &FOLLOW_315_in_policy_buffer9307);
+ if (HASEXCEPTION())
+ {
+ goto rulepolicy_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ kind= sep::TYPE_LIFO_SPECIFIER;
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3132:4: 'multififo'
+ {
+ MATCHT(325, &FOLLOW_325_in_policy_buffer9319);
+ if (HASEXCEPTION())
+ {
+ goto rulepolicy_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ kind= sep::TYPE_MULTI_FIFO_SPECIFIER;
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3133:4: 'multilifo'
+ {
+ MATCHT(326, &FOLLOW_326_in_policy_buffer9326);
+ if (HASEXCEPTION())
+ {
+ goto rulepolicy_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ kind= sep::TYPE_MULTI_LIFO_SPECIFIER;
+
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3134:4: 'set'
+ {
+ MATCHT(373, &FOLLOW_373_in_policy_buffer9333);
+ if (HASEXCEPTION())
+ {
+ goto rulepolicy_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ kind= sep::TYPE_SET_SPECIFIER;
+
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3135:4: 'multiset'
+ {
+ MATCHT(329, &FOLLOW_329_in_policy_buffer9346);
+ if (HASEXCEPTION())
+ {
+ goto rulepolicy_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ kind= sep::TYPE_MULTISET_SPECIFIER;
+
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3136:4: 'vector'
+ {
+ MATCHT(412, &FOLLOW_412_in_policy_buffer9354);
+ if (HASEXCEPTION())
+ {
+ goto rulepolicy_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ kind= sep::TYPE_VECTOR_SPECIFIER;
+
+ }
+
+
+ }
+ break;
+ case 8:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3137:4: 'rvector'
+ {
+ MATCHT(370, &FOLLOW_370_in_policy_buffer9364);
+ if (HASEXCEPTION())
+ {
+ goto rulepolicy_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ kind= sep::TYPE_REVERSE_VECTOR_SPECIFIER;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulepolicy_bufferEx; /* Prevent compiler warnings */
+ rulepolicy_bufferEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(106, policy_buffer_StartIndex); }
+
+ return kind;
+}
+/* $ANTLR end policy_buffer */
+
+/**
+ * $ANTLR start ref_buffer
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3140:1: ref_buffer[ sep::Machine * machine ] returns [ sep::BF buf ] : id= qualifiedNameID ;
+ */
+static sep::BF
+ref_buffer(pfmlParser ctx, sep::Machine * machine)
+{
+ sep::BF buf;
+
+ ANTLR3_UINT32 ref_buffer_StartIndex;
+
+ fmlParser_qualifiedNameID_return id;
+ #undef RETURN_TYPE_id
+ #define RETURN_TYPE_id fmlParser_qualifiedNameID_return
+
+ /* Initialize rule variables
+ */
+ ref_buffer_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(107)) )
+ {
+ {
+ }
+
+
+
+ return buf;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3142:2: (id= qualifiedNameID )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3142:4: id= qualifiedNameID
+ {
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_ref_buffer9386);
+ id=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleref_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return buf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ buf= sep::ParserUtil::getBuffer(machine,
+ id.s
+ , id.nb
+ );
+
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleref_bufferEx; /* Prevent compiler warnings */
+ ruleref_bufferEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(107, ref_buffer_StartIndex); }
+
+ return buf;
+}
+/* $ANTLR end ref_buffer */
+
+/**
+ * $ANTLR start initial_buffer_contents
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3147:1: initial_buffer_contents[ const sep::Buffer * buffer ] : ASSIGN LBRACKET mid= qualifiedNameID ( COMMA mid= qualifiedNameID )* RBRACKET ;
+ */
+static void
+initial_buffer_contents(pfmlParser ctx, const sep::Buffer * buffer)
+{
+ ANTLR3_UINT32 initial_buffer_contents_StartIndex;
+
+ fmlParser_qualifiedNameID_return mid;
+ #undef RETURN_TYPE_mid
+ #define RETURN_TYPE_mid fmlParser_qualifiedNameID_return
+
+ /* Initialize rule variables
+ */
+ initial_buffer_contents_StartIndex = INDEX();
+
+
+
+ sep::BF msg;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(108)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3151:2: ( ASSIGN LBRACKET mid= qualifiedNameID ( COMMA mid= qualifiedNameID )* RBRACKET )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3151:4: ASSIGN LBRACKET mid= qualifiedNameID ( COMMA mid= qualifiedNameID )* RBRACKET
+ {
+ MATCHT(ASSIGN, &FOLLOW_ASSIGN_in_initial_buffer_contents9406);
+ if (HASEXCEPTION())
+ {
+ goto ruleinitial_buffer_contentsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(LBRACKET, &FOLLOW_LBRACKET_in_initial_buffer_contents9408);
+ if (HASEXCEPTION())
+ {
+ goto ruleinitial_buffer_contentsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_initial_buffer_contents9417);
+ mid=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleinitial_buffer_contentsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ /* msg = sep::ParserUtil::getMessage(mid.s
+ , mid.nb
+ );
+ buffer->appendMessage(msg); */
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3155:4: ( COMMA mid= qualifiedNameID )*
+
+ for (;;)
+ {
+ int alt267=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt267=1;
+ }
+ break;
+
+ }
+
+ switch (alt267)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3155:6: COMMA mid= qualifiedNameID
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_initial_buffer_contents9431);
+ if (HASEXCEPTION())
+ {
+ goto ruleinitial_buffer_contentsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_initial_buffer_contents9435);
+ mid=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleinitial_buffer_contentsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop267; /* break out of the loop */
+ break;
+ }
+ }
+ loop267: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RBRACKET, &FOLLOW_RBRACKET_in_initial_buffer_contents9446);
+ if (HASEXCEPTION())
+ {
+ goto ruleinitial_buffer_contentsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleinitial_buffer_contentsEx; /* Prevent compiler warnings */
+ ruleinitial_buffer_contentsEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(108, initial_buffer_contents_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end initial_buffer_contents */
+
+/**
+ * $ANTLR start decl_channel
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3165:1: decl_channel[ sep::PropertyPart & declProperty , sep::Modifier mdfr ] : 'channel' decl_channel_port[ declProperty , mdfr ] ;
+ */
+static void
+decl_channel(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr)
+{
+ ANTLR3_UINT32 decl_channel_StartIndex;
+
+ /* Initialize rule variables
+ */
+ decl_channel_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(109)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3167:2: ( 'channel' decl_channel_port[ declProperty , mdfr ] )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3167:4: 'channel' decl_channel_port[ declProperty , mdfr ]
+ {
+ MATCHT(253, &FOLLOW_253_in_decl_channel9465);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channelEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_decl_channel_port_in_decl_channel9468);
+ decl_channel_port(ctx, declProperty, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channelEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledecl_channelEx; /* Prevent compiler warnings */
+ ruledecl_channelEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(109, decl_channel_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end decl_channel */
+
+/**
+ * $ANTLR start decl_channel_port
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3174:1: decl_channel_port[ sep::PropertyPart & declProperty , sep::Modifier mdfr ] : ( LT_ com_protocol[ declProperty.getContainer()->as< sep::Machine >(), aChannel ] ( COMMA com_cast[ aChannel ] )? GT )? ( modifier_set_direction_strict_text[ aChannel->getwModifier() ] )? id= ID LCURLY (m= modifier_direction uid= qualifiedNameID SEMI | decl_port[ *(aChannel->getContents()) ,\n\t \t\t\t\t\tsep::Modifier::PROPERTY_PUBLIC_MODIFIER ] | decl_signal[ *(aChannel->getContents()) ,\n\t \t\t\t\t\tsep::Modifier::PROPERTY_PUBLIC_MODIFIER ] )+ RCURLY ;
+ */
+static void
+decl_channel_port(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr)
+{
+ ANTLR3_UINT32 decl_channel_port_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ sep::Modifier m;
+ #undef RETURN_TYPE_m
+ #define RETURN_TYPE_m sep::Modifier
+
+ fmlParser_qualifiedNameID_return uid;
+ #undef RETURN_TYPE_uid
+ #define RETURN_TYPE_uid fmlParser_qualifiedNameID_return
+
+ /* Initialize rule variables
+ */
+ decl_channel_port_StartIndex = INDEX();
+
+
+
+ sep::Channel * aChannel;
+
+ declProperty.appendChannel( sep::BF( aChannel =
+ new sep::Channel( declProperty,
+ "#channel#", mdfr.setDirectionInoutElse() ) ));
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(110)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ id = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3184:2: ( ( LT_ com_protocol[ declProperty.getContainer()->as< sep::Machine >(), aChannel ] ( COMMA com_cast[ aChannel ] )? GT )? ( modifier_set_direction_strict_text[ aChannel->getwModifier() ] )? id= ID LCURLY (m= modifier_direction uid= qualifiedNameID SEMI | decl_port[ *(aChannel->getContents()) ,\n\t \t\t\t\t\tsep::Modifier::PROPERTY_PUBLIC_MODIFIER ] | decl_signal[ *(aChannel->getContents()) ,\n\t \t\t\t\t\tsep::Modifier::PROPERTY_PUBLIC_MODIFIER ] )+ RCURLY )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3184:4: ( LT_ com_protocol[ declProperty.getContainer()->as< sep::Machine >(), aChannel ] ( COMMA com_cast[ aChannel ] )? GT )? ( modifier_set_direction_strict_text[ aChannel->getwModifier() ] )? id= ID LCURLY (m= modifier_direction uid= qualifiedNameID SEMI | decl_port[ *(aChannel->getContents()) ,\n\t \t\t\t\t\tsep::Modifier::PROPERTY_PUBLIC_MODIFIER ] | decl_signal[ *(aChannel->getContents()) ,\n\t \t\t\t\t\tsep::Modifier::PROPERTY_PUBLIC_MODIFIER ] )+ RCURLY
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3184:4: ( LT_ com_protocol[ declProperty.getContainer()->as< sep::Machine >(), aChannel ] ( COMMA com_cast[ aChannel ] )? GT )?
+ {
+ int alt269=2;
+ switch ( LA(1) )
+ {
+ case LT_:
+ {
+ alt269=1;
+ }
+ break;
+ }
+
+ switch (alt269)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3184:6: LT_ com_protocol[ declProperty.getContainer()->as< sep::Machine >(), aChannel ] ( COMMA com_cast[ aChannel ] )? GT
+ {
+ MATCHT(LT_, &FOLLOW_LT__in_decl_channel_port9491);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_com_protocol_in_decl_channel_port9498);
+ com_protocol(ctx, declProperty.getContainer()->as< sep::Machine >(), aChannel);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3186:6: ( COMMA com_cast[ aChannel ] )?
+ {
+ int alt268=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt268=1;
+ }
+ break;
+ }
+
+ switch (alt268)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3186:8: COMMA com_cast[ aChannel ]
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_decl_channel_port9508);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_com_cast_in_decl_channel_port9510);
+ com_cast(ctx, aChannel);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(GT, &FOLLOW_GT_in_decl_channel_port9521);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3190:4: ( modifier_set_direction_strict_text[ aChannel->getwModifier() ] )?
+ {
+ int alt270=2;
+ switch ( LA(1) )
+ {
+ case 298:
+ case 305:
+ case 341:
+ case 364:
+ {
+ alt270=1;
+ }
+ break;
+ }
+
+ switch (alt270)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3190:6: modifier_set_direction_strict_text[ aChannel->getwModifier() ]
+ {
+ FOLLOWPUSH(FOLLOW_modifier_set_direction_strict_text_in_decl_channel_port9535);
+ modifier_set_direction_strict_text(ctx, aChannel->getwModifier());
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_decl_channel_port9547);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ aChannel->fullyUpdateAllNameID( STR((id->getText(id))->chars) );
+ }
+
+
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_decl_channel_port9556);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3194:4: (m= modifier_direction uid= qualifiedNameID SEMI | decl_port[ *(aChannel->getContents()) ,\n\t \t\t\t\t\tsep::Modifier::PROPERTY_PUBLIC_MODIFIER ] | decl_signal[ *(aChannel->getContents()) ,\n\t \t\t\t\t\tsep::Modifier::PROPERTY_PUBLIC_MODIFIER ] )+
+ {
+ int cnt271=0;
+
+ for (;;)
+ {
+ int alt271=4;
+ switch ( LA(1) )
+ {
+ case ASSIGN_REF:
+ case LTE:
+ case 164:
+ case 166:
+ case 295:
+ case 298:
+ case 305:
+ case 335:
+ case 341:
+ case 364:
+ {
+ alt271=1;
+ }
+ break;
+ case 344:
+ {
+ alt271=2;
+ }
+ break;
+ case 320:
+ case 374:
+ {
+ alt271=3;
+ }
+ break;
+
+ }
+
+ switch (alt271)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3195:6: m= modifier_direction uid= qualifiedNameID SEMI
+ {
+ FOLLOWPUSH(FOLLOW_modifier_direction_in_decl_channel_port9570);
+ m=modifier_direction(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_decl_channel_port9575);
+ uid=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_decl_channel_port9577);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ sep::BF comSignal = sep::ParserUtil::getComSignal(uid.s
+ , uid.nb
+ );
+ if( comSignal.valid() )
+ {
+ aChannel->appendSignal(m
+ , comSignal);
+ }
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3204:6: decl_port[ *(aChannel->getContents()) ,\n\t \t\t\t\t\tsep::Modifier::PROPERTY_PUBLIC_MODIFIER ]
+ {
+ FOLLOWPUSH(FOLLOW_decl_port_in_decl_channel_port9592);
+ decl_port(ctx, *(aChannel->getContents()), sep::Modifier::PROPERTY_PUBLIC_MODIFIER);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3207:6: decl_signal[ *(aChannel->getContents()) ,\n\t \t\t\t\t\tsep::Modifier::PROPERTY_PUBLIC_MODIFIER ]
+ {
+ FOLLOWPUSH(FOLLOW_decl_signal_in_decl_channel_port9609);
+ decl_signal(ctx, *(aChannel->getContents()), sep::Modifier::PROPERTY_PUBLIC_MODIFIER);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt271 >= 1 )
+ {
+ goto loop271;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruledecl_channel_portEx;
+ }
+ cnt271++;
+ }
+ loop271: ; /* Jump to here if this rule does not match */
+ }
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_decl_channel_port9621);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledecl_channel_portEx; /* Prevent compiler warnings */
+ ruledecl_channel_portEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(110, decl_channel_port_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end decl_channel_port */
+
+/**
+ * $ANTLR start decl_channel_var
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3214:1: decl_channel_var[ sep::PropertyPart & declProperty , sep::Modifier mdfr ] : (tv= type_var id= ID (iv= initial_value )? ( SEMI | on_write_var_routine_def[ var ] ) | LCURLY (tv= type_var id= ID (iv= initial_value )? ( SEMI | on_write_var_routine_def[ var ] ) )+ RCURLY );
+ */
+static void
+decl_channel_var(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr)
+{
+ ANTLR3_UINT32 decl_channel_var_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ sep::BF tv;
+ #undef RETURN_TYPE_tv
+ #define RETURN_TYPE_tv sep::BF
+
+ sep::BF iv;
+ #undef RETURN_TYPE_iv
+ #define RETURN_TYPE_iv sep::BF
+
+ /* Initialize rule variables
+ */
+ decl_channel_var_StartIndex = INDEX();
+
+
+
+ sep::Variable * var;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(111)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ id = NULL;
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3219:2: (tv= type_var id= ID (iv= initial_value )? ( SEMI | on_write_var_routine_def[ var ] ) | LCURLY (tv= type_var id= ID (iv= initial_value )? ( SEMI | on_write_var_routine_def[ var ] ) )+ RCURLY )
+
+ ANTLR3_UINT32 alt277;
+
+ alt277=2;
+
+ switch ( LA(1) )
+ {
+ case ID:
+ case 241:
+ case 242:
+ case 245:
+ case 246:
+ case 249:
+ case 254:
+ case 255:
+ case 259:
+ case 261:
+ case 264:
+ case 270:
+ case 271:
+ case 281:
+ case 283:
+ case 309:
+ case 310:
+ case 311:
+ case 315:
+ case 316:
+ case 317:
+ case 320:
+ case 325:
+ case 326:
+ case 329:
+ case 333:
+ case 344:
+ case 345:
+ case 346:
+ case 357:
+ case 358:
+ case 360:
+ case 370:
+ case 373:
+ case 374:
+ case 387:
+ case 392:
+ case 399:
+ case 400:
+ case 401:
+ case 402:
+ case 405:
+ case 407:
+ case 408:
+ case 409:
+ case 412:
+ {
+ alt277=1;
+ }
+ break;
+ case LCURLY:
+ {
+ alt277=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 277;
+ EXCEPTION->state = 0;
+
+
+ goto ruledecl_channel_varEx;
+
+ }
+
+ switch (alt277)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3219:4: tv= type_var id= ID (iv= initial_value )? ( SEMI | on_write_var_routine_def[ var ] )
+ {
+ FOLLOWPUSH(FOLLOW_type_var_in_decl_channel_var9642);
+ tv=type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_varEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_decl_channel_var9647);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_varEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ declProperty.saveOwnedVariable( var = new sep::Variable(
+ declProperty, mdfr, tv
+ , STR((id->getText(id))->chars)) );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3224:4: (iv= initial_value )?
+ {
+ int alt272=2;
+ switch ( LA(1) )
+ {
+ case ASSIGN:
+ case LPAREN:
+ {
+ alt272=1;
+ }
+ break;
+ }
+
+ switch (alt272)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3224:6: iv= initial_value
+ {
+ FOLLOWPUSH(FOLLOW_initial_value_in_decl_channel_var9661);
+ iv=initial_value(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_varEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ var->setValue(iv
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3225:4: ( SEMI | on_write_var_routine_def[ var ] )
+ {
+ int alt273=2;
+ switch ( LA(1) )
+ {
+ case SEMI:
+ {
+ alt273=1;
+ }
+ break;
+ case LCURLY:
+ {
+ alt273=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 273;
+ EXCEPTION->state = 0;
+
+
+ goto ruledecl_channel_varEx;
+
+ }
+
+ switch (alt273)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3225:6: SEMI
+ {
+ MATCHT(SEMI, &FOLLOW_SEMI_in_decl_channel_var9674);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_varEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3225:15: on_write_var_routine_def[ var ]
+ {
+ FOLLOWPUSH(FOLLOW_on_write_var_routine_def_in_decl_channel_var9680);
+ on_write_var_routine_def(ctx, var);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_varEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3227:4: LCURLY (tv= type_var id= ID (iv= initial_value )? ( SEMI | on_write_var_routine_def[ var ] ) )+ RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_decl_channel_var9689);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_varEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3227:11: (tv= type_var id= ID (iv= initial_value )? ( SEMI | on_write_var_routine_def[ var ] ) )+
+ {
+ int cnt276=0;
+
+ for (;;)
+ {
+ int alt276=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ case 241:
+ case 242:
+ case 245:
+ case 246:
+ case 249:
+ case 254:
+ case 255:
+ case 259:
+ case 261:
+ case 264:
+ case 270:
+ case 271:
+ case 281:
+ case 283:
+ case 309:
+ case 310:
+ case 311:
+ case 315:
+ case 316:
+ case 317:
+ case 320:
+ case 325:
+ case 326:
+ case 329:
+ case 333:
+ case 344:
+ case 345:
+ case 346:
+ case 357:
+ case 358:
+ case 360:
+ case 370:
+ case 373:
+ case 374:
+ case 387:
+ case 392:
+ case 399:
+ case 400:
+ case 401:
+ case 402:
+ case 405:
+ case 407:
+ case 408:
+ case 409:
+ case 412:
+ {
+ alt276=1;
+ }
+ break;
+
+ }
+
+ switch (alt276)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3228:4: tv= type_var id= ID (iv= initial_value )? ( SEMI | on_write_var_routine_def[ var ] )
+ {
+ FOLLOWPUSH(FOLLOW_type_var_in_decl_channel_var9698);
+ tv=type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_varEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_decl_channel_var9703);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_varEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ declProperty.saveOwnedVariable( var = new sep::Variable(
+ declProperty, mdfr, tv
+ , STR((id->getText(id))->chars)) );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3233:4: (iv= initial_value )?
+ {
+ int alt274=2;
+ switch ( LA(1) )
+ {
+ case ASSIGN:
+ case LPAREN:
+ {
+ alt274=1;
+ }
+ break;
+ }
+
+ switch (alt274)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3233:6: iv= initial_value
+ {
+ FOLLOWPUSH(FOLLOW_initial_value_in_decl_channel_var9717);
+ iv=initial_value(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_varEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ var->setValue(iv
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3234:4: ( SEMI | on_write_var_routine_def[ var ] )
+ {
+ int alt275=2;
+ switch ( LA(1) )
+ {
+ case SEMI:
+ {
+ alt275=1;
+ }
+ break;
+ case LCURLY:
+ {
+ alt275=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 275;
+ EXCEPTION->state = 0;
+
+
+ goto ruledecl_channel_varEx;
+
+ }
+
+ switch (alt275)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3234:6: SEMI
+ {
+ MATCHT(SEMI, &FOLLOW_SEMI_in_decl_channel_var9730);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_varEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3234:15: on_write_var_routine_def[ var ]
+ {
+ FOLLOWPUSH(FOLLOW_on_write_var_routine_def_in_decl_channel_var9736);
+ on_write_var_routine_def(ctx, var);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_varEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+
+ default:
+
+ if ( cnt276 >= 1 )
+ {
+ goto loop276;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruledecl_channel_varEx;
+ }
+ cnt276++;
+ }
+ loop276: ; /* Jump to here if this rule does not match */
+ }
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_decl_channel_var9748);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_channel_varEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledecl_channel_varEx; /* Prevent compiler warnings */
+ ruledecl_channel_varEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(111, decl_channel_var_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end decl_channel_var */
+
+/**
+ * $ANTLR start decl_variable
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3243:1: decl_variable[ sep::PropertyPart & declProperty , sep::Modifier mdfr ] : ( ( 'var' | 'val' | ( 'const' | 'macro' )+ ( 'var' )? ) decl_variable_impl[ declProperty , mdfr ] | decl_variable_time_clock_impl[ declProperty , mdfr ] );
+ */
+static void
+decl_variable(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr)
+{
+ ANTLR3_UINT32 decl_variable_StartIndex;
+
+ /* Initialize rule variables
+ */
+ decl_variable_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(112)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3245:2: ( ( 'var' | 'val' | ( 'const' | 'macro' )+ ( 'var' )? ) decl_variable_impl[ declProperty , mdfr ] | decl_variable_time_clock_impl[ declProperty , mdfr ] )
+
+ ANTLR3_UINT32 alt281;
+
+ alt281=2;
+
+ switch ( LA(1) )
+ {
+ case 262:
+ case 318:
+ case 410:
+ case 411:
+ {
+ alt281=1;
+ }
+ break;
+ case 259:
+ {
+ alt281=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 281;
+ EXCEPTION->state = 0;
+
+
+ goto ruledecl_variableEx;
+
+ }
+
+ switch (alt281)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3245:4: ( 'var' | 'val' | ( 'const' | 'macro' )+ ( 'var' )? ) decl_variable_impl[ declProperty , mdfr ]
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3245:4: ( 'var' | 'val' | ( 'const' | 'macro' )+ ( 'var' )? )
+ {
+ int alt280=3;
+ switch ( LA(1) )
+ {
+ case 411:
+ {
+ alt280=1;
+ }
+ break;
+ case 410:
+ {
+ alt280=2;
+ }
+ break;
+ case 262:
+ case 318:
+ {
+ alt280=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 280;
+ EXCEPTION->state = 0;
+
+
+ goto ruledecl_variableEx;
+
+ }
+
+ switch (alt280)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3245:6: 'var'
+ {
+ MATCHT(411, &FOLLOW_411_in_decl_variable9769);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_variableEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setNatureVariable();
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3246:6: 'val'
+ {
+ MATCHT(410, &FOLLOW_410_in_decl_variable9783);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_variableEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setFeatureConst();
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3247:6: ( 'const' | 'macro' )+ ( 'var' )?
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3247:6: ( 'const' | 'macro' )+
+ {
+ int cnt278=0;
+
+ for (;;)
+ {
+ int alt278=3;
+ switch ( LA(1) )
+ {
+ case 262:
+ {
+ alt278=1;
+ }
+ break;
+ case 318:
+ {
+ alt278=2;
+ }
+ break;
+
+ }
+
+ switch (alt278)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3247:8: 'const'
+ {
+ MATCHT(262, &FOLLOW_262_in_decl_variable9799);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_variableEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setFeatureConst();
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3248:8: 'macro'
+ {
+ MATCHT(318, &FOLLOW_318_in_decl_variable9811);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_variableEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setNatureMacro();
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt278 >= 1 )
+ {
+ goto loop278;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruledecl_variableEx;
+ }
+ cnt278++;
+ }
+ loop278: ; /* Jump to here if this rule does not match */
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3250:6: ( 'var' )?
+ {
+ int alt279=2;
+ switch ( LA(1) )
+ {
+ case 411:
+ {
+ alt279=1;
+ }
+ break;
+ }
+
+ switch (alt279)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3250:8: 'var'
+ {
+ MATCHT(411, &FOLLOW_411_in_decl_variable9831);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_variableEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_decl_variable_impl_in_decl_variable9844);
+ decl_variable_impl(ctx, declProperty, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_variableEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3254:4: decl_variable_time_clock_impl[ declProperty , mdfr ]
+ {
+ FOLLOWPUSH(FOLLOW_decl_variable_time_clock_impl_in_decl_variable9851);
+ decl_variable_time_clock_impl(ctx, declProperty, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_variableEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledecl_variableEx; /* Prevent compiler warnings */
+ ruledecl_variableEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(112, decl_variable_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end decl_variable */
+
+/**
+ * $ANTLR start decl_variable_time_clock_impl
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3258:1: decl_variable_time_clock_impl[ sep::PropertyPart & declProperty , sep::Modifier mdfr ] : ctv= time_clock_type decl_typed_variable_atom_impl[ declProperty , mdfr , $ctv.bts ] ;
+ */
+static void
+decl_variable_time_clock_impl(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr)
+{
+ ANTLR3_UINT32 decl_variable_time_clock_impl_StartIndex;
+
+ sep::TypeSpecifier ctv;
+ #undef RETURN_TYPE_ctv
+ #define RETURN_TYPE_ctv sep::TypeSpecifier
+
+ /* Initialize rule variables
+ */
+ decl_variable_time_clock_impl_StartIndex = INDEX();
+
+
+
+ mdfr.override_ifdef( sep::Modifier::PROPERTY_PUBLIC_VOLATILE_MODIFIER );
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(113)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3263:2: (ctv= time_clock_type decl_typed_variable_atom_impl[ declProperty , mdfr , $ctv.bts ] )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3263:4: ctv= time_clock_type decl_typed_variable_atom_impl[ declProperty , mdfr , $ctv.bts ]
+ {
+ FOLLOWPUSH(FOLLOW_time_clock_type_in_decl_variable_time_clock_impl9873);
+ ctv=time_clock_type(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_variable_time_clock_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_decl_typed_variable_atom_impl_in_decl_variable_time_clock_impl9878);
+ decl_typed_variable_atom_impl(ctx, declProperty, mdfr,
+ ctv
+ );
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_variable_time_clock_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledecl_variable_time_clock_implEx; /* Prevent compiler warnings */
+ ruledecl_variable_time_clock_implEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(113, decl_variable_time_clock_impl_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end decl_variable_time_clock_impl */
+
+/**
+ * $ANTLR start decl_variable_impl
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3268:1: decl_variable_impl[ sep::PropertyPart & declProperty , sep::Modifier mdfr ] : ( decl_variable_atom_impl[ declProperty , mdfr ] | LCURLY ( decl_variable_atom_impl[ declProperty , mdfr ] )+ RCURLY );
+ */
+static void
+decl_variable_impl(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr)
+{
+ ANTLR3_UINT32 decl_variable_impl_StartIndex;
+
+ /* Initialize rule variables
+ */
+ decl_variable_impl_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(114)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3270:2: ( decl_variable_atom_impl[ declProperty , mdfr ] | LCURLY ( decl_variable_atom_impl[ declProperty , mdfr ] )+ RCURLY )
+
+ ANTLR3_UINT32 alt283;
+
+ alt283=2;
+
+ switch ( LA(1) )
+ {
+ case ID:
+ case 241:
+ case 242:
+ case 245:
+ case 246:
+ case 249:
+ case 254:
+ case 255:
+ case 259:
+ case 261:
+ case 264:
+ case 270:
+ case 271:
+ case 281:
+ case 283:
+ case 309:
+ case 310:
+ case 311:
+ case 315:
+ case 316:
+ case 317:
+ case 320:
+ case 325:
+ case 326:
+ case 329:
+ case 333:
+ case 344:
+ case 345:
+ case 346:
+ case 357:
+ case 358:
+ case 360:
+ case 370:
+ case 373:
+ case 374:
+ case 387:
+ case 392:
+ case 399:
+ case 400:
+ case 401:
+ case 402:
+ case 405:
+ case 407:
+ case 408:
+ case 409:
+ case 412:
+ {
+ alt283=1;
+ }
+ break;
+ case LCURLY:
+ {
+ alt283=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 283;
+ EXCEPTION->state = 0;
+
+
+ goto ruledecl_variable_implEx;
+
+ }
+
+ switch (alt283)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3270:4: decl_variable_atom_impl[ declProperty , mdfr ]
+ {
+ FOLLOWPUSH(FOLLOW_decl_variable_atom_impl_in_decl_variable_impl9894);
+ decl_variable_atom_impl(ctx, declProperty, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_variable_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3272:4: LCURLY ( decl_variable_atom_impl[ declProperty , mdfr ] )+ RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_decl_variable_impl9901);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_variable_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3273:4: ( decl_variable_atom_impl[ declProperty , mdfr ] )+
+ {
+ int cnt282=0;
+
+ for (;;)
+ {
+ int alt282=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ case 241:
+ case 242:
+ case 245:
+ case 246:
+ case 249:
+ case 254:
+ case 255:
+ case 259:
+ case 261:
+ case 264:
+ case 270:
+ case 271:
+ case 281:
+ case 283:
+ case 309:
+ case 310:
+ case 311:
+ case 315:
+ case 316:
+ case 317:
+ case 320:
+ case 325:
+ case 326:
+ case 329:
+ case 333:
+ case 344:
+ case 345:
+ case 346:
+ case 357:
+ case 358:
+ case 360:
+ case 370:
+ case 373:
+ case 374:
+ case 387:
+ case 392:
+ case 399:
+ case 400:
+ case 401:
+ case 402:
+ case 405:
+ case 407:
+ case 408:
+ case 409:
+ case 412:
+ {
+ alt282=1;
+ }
+ break;
+
+ }
+
+ switch (alt282)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3273:6: decl_variable_atom_impl[ declProperty , mdfr ]
+ {
+ FOLLOWPUSH(FOLLOW_decl_variable_atom_impl_in_decl_variable_impl9908);
+ decl_variable_atom_impl(ctx, declProperty, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_variable_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt282 >= 1 )
+ {
+ goto loop282;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruledecl_variable_implEx;
+ }
+ cnt282++;
+ }
+ loop282: ; /* Jump to here if this rule does not match */
+ }
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_decl_variable_impl9917);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_variable_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledecl_variable_implEx; /* Prevent compiler warnings */
+ ruledecl_variable_implEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(114, decl_variable_impl_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end decl_variable_impl */
+
+/**
+ * $ANTLR start decl_variable_atom_impl
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3277:1: decl_variable_atom_impl[ sep::PropertyPart & declProperty , sep::Modifier mdfr ] : tv= type_var decl_typed_variable_atom_impl[ declProperty , mdfr , $tv.type ] ;
+ */
+static void
+decl_variable_atom_impl(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr)
+{
+ ANTLR3_UINT32 decl_variable_atom_impl_StartIndex;
+
+ sep::BF tv;
+ #undef RETURN_TYPE_tv
+ #define RETURN_TYPE_tv sep::BF
+
+ /* Initialize rule variables
+ */
+ decl_variable_atom_impl_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(115)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3279:2: (tv= type_var decl_typed_variable_atom_impl[ declProperty , mdfr , $tv.type ] )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3279:4: tv= type_var decl_typed_variable_atom_impl[ declProperty , mdfr , $tv.type ]
+ {
+ FOLLOWPUSH(FOLLOW_type_var_in_decl_variable_atom_impl9933);
+ tv=type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_variable_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_decl_typed_variable_atom_impl_in_decl_variable_atom_impl9938);
+ decl_typed_variable_atom_impl(ctx, declProperty, mdfr,
+ tv
+ );
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_variable_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledecl_variable_atom_implEx; /* Prevent compiler warnings */
+ ruledecl_variable_atom_implEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(115, decl_variable_atom_impl_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end decl_variable_atom_impl */
+
+/**
+ * $ANTLR start decl_typed_variable_atom_impl
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3283:1: decl_typed_variable_atom_impl[ sep::PropertyPart & declProperty ,\n\t\tsep::Modifier mdfr , const sep::BF & type ] : id= ID ( StringLiteral )? (iv= initial_value )? ( SEMI | on_write_var_routine_def[ var ] ) ;
+ */
+static void
+decl_typed_variable_atom_impl(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr, const sep::BF & type)
+{
+ ANTLR3_UINT32 decl_typed_variable_atom_impl_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ pANTLR3_COMMON_TOKEN StringLiteral9;
+ sep::BF iv;
+ #undef RETURN_TYPE_iv
+ #define RETURN_TYPE_iv sep::BF
+
+ /* Initialize rule variables
+ */
+ decl_typed_variable_atom_impl_StartIndex = INDEX();
+
+
+
+ sep::Variable * var;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(116)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ id = NULL;
+ StringLiteral9 = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3289:2: (id= ID ( StringLiteral )? (iv= initial_value )? ( SEMI | on_write_var_routine_def[ var ] ) )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3289:4: id= ID ( StringLiteral )? (iv= initial_value )? ( SEMI | on_write_var_routine_def[ var ] )
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_decl_typed_variable_atom_impl9959);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_typed_variable_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ declProperty.saveOwnedVariable( var = new sep::Variable(
+ declProperty, mdfr, type, STR((id->getText(id))->chars)) );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3295:4: ( StringLiteral )?
+ {
+ int alt284=2;
+ switch ( LA(1) )
+ {
+ case StringLiteral:
+ {
+ alt284=1;
+ }
+ break;
+ }
+
+ switch (alt284)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3295:6: StringLiteral
+ {
+ StringLiteral9 = (pANTLR3_COMMON_TOKEN) MATCHT(StringLiteral, &FOLLOW_StringLiteral_in_decl_typed_variable_atom_impl9972);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_typed_variable_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ var->setUnrestrictedName(STR((StringLiteral9->getText(StringLiteral9))->chars));
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3299:4: (iv= initial_value )?
+ {
+ int alt285=2;
+ switch ( LA(1) )
+ {
+ case ASSIGN:
+ case LPAREN:
+ {
+ alt285=1;
+ }
+ break;
+ }
+
+ switch (alt285)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3299:6: iv= initial_value
+ {
+ FOLLOWPUSH(FOLLOW_initial_value_in_decl_typed_variable_atom_impl9993);
+ iv=initial_value(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_typed_variable_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ var->setValue(iv
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3300:4: ( SEMI | on_write_var_routine_def[ var ] )
+ {
+ int alt286=2;
+ switch ( LA(1) )
+ {
+ case SEMI:
+ {
+ alt286=1;
+ }
+ break;
+ case LCURLY:
+ {
+ alt286=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 286;
+ EXCEPTION->state = 0;
+
+
+ goto ruledecl_typed_variable_atom_implEx;
+
+ }
+
+ switch (alt286)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3300:6: SEMI
+ {
+ MATCHT(SEMI, &FOLLOW_SEMI_in_decl_typed_variable_atom_impl10006);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_typed_variable_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3300:15: on_write_var_routine_def[ var ]
+ {
+ FOLLOWPUSH(FOLLOW_on_write_var_routine_def_in_decl_typed_variable_atom_impl10012);
+ on_write_var_routine_def(ctx, var);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_typed_variable_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledecl_typed_variable_atom_implEx; /* Prevent compiler warnings */
+ ruledecl_typed_variable_atom_implEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(116, decl_typed_variable_atom_impl_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end decl_typed_variable_atom_impl */
+
+/**
+ * $ANTLR start initial_value
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3304:1: initial_value returns [ sep::BF bf ] : ( ASSIGN e= expression | LPAREN e= expression RPAREN );
+ */
+static sep::BF
+initial_value(pfmlParser ctx)
+{
+ sep::BF bf;
+
+ ANTLR3_UINT32 initial_value_StartIndex;
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ initial_value_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(117)) )
+ {
+ {
+ }
+
+
+
+ return bf;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3306:2: ( ASSIGN e= expression | LPAREN e= expression RPAREN )
+
+ ANTLR3_UINT32 alt287;
+
+ alt287=2;
+
+ switch ( LA(1) )
+ {
+ case ASSIGN:
+ {
+ alt287=1;
+ }
+ break;
+ case LPAREN:
+ {
+ alt287=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return bf;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 287;
+ EXCEPTION->state = 0;
+
+
+ goto ruleinitial_valueEx;
+
+ }
+
+ switch (alt287)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3306:4: ASSIGN e= expression
+ {
+ MATCHT(ASSIGN, &FOLLOW_ASSIGN_in_initial_value10031);
+ if (HASEXCEPTION())
+ {
+ goto ruleinitial_valueEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_initial_value10036);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleinitial_valueEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ e
+ ;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3307:4: LPAREN e= expression RPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_initial_value10052);
+ if (HASEXCEPTION())
+ {
+ goto ruleinitial_valueEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_initial_value10057);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleinitial_valueEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_initial_value10060);
+ if (HASEXCEPTION())
+ {
+ goto ruleinitial_valueEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ e
+ ;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleinitial_valueEx; /* Prevent compiler warnings */
+ ruleinitial_valueEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(117, initial_value_StartIndex); }
+
+ return bf;
+}
+/* $ANTLR end initial_value */
+
+/**
+ * $ANTLR start type_var
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3311:1: type_var returns [ sep::BF type ] : (btv= base_type_var (dta= def_type_array[ type , \"\" ] )? |dtc= def_type_container[ \"\" ] |dti= def_type_interval[ \"\" ] );
+ */
+static sep::BF
+type_var(pfmlParser ctx)
+{
+ sep::BF type;
+
+ ANTLR3_UINT32 type_var_StartIndex;
+
+ sep::BF btv;
+ #undef RETURN_TYPE_btv
+ #define RETURN_TYPE_btv sep::BF
+
+ sep::BF dta;
+ #undef RETURN_TYPE_dta
+ #define RETURN_TYPE_dta sep::BF
+
+ sep::BF dtc;
+ #undef RETURN_TYPE_dtc
+ #define RETURN_TYPE_dtc sep::BF
+
+ sep::BF dti;
+ #undef RETURN_TYPE_dti
+ #define RETURN_TYPE_dti sep::BF
+
+ /* Initialize rule variables
+ */
+ type_var_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(118)) )
+ {
+ {
+ }
+
+
+
+ return type;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3313:2: (btv= base_type_var (dta= def_type_array[ type , \"\" ] )? |dtc= def_type_container[ \"\" ] |dti= def_type_interval[ \"\" ] )
+
+ ANTLR3_UINT32 alt289;
+
+ alt289=3;
+
+ switch ( LA(1) )
+ {
+ case ID:
+ case 242:
+ case 245:
+ case 246:
+ case 249:
+ case 254:
+ case 255:
+ case 259:
+ case 261:
+ case 264:
+ case 270:
+ case 271:
+ case 283:
+ case 309:
+ case 310:
+ case 317:
+ case 320:
+ case 333:
+ case 344:
+ case 345:
+ case 346:
+ case 357:
+ case 358:
+ case 360:
+ case 374:
+ case 387:
+ case 392:
+ case 399:
+ case 400:
+ case 401:
+ case 402:
+ case 405:
+ case 407:
+ case 408:
+ case 409:
+ {
+ alt289=1;
+ }
+ break;
+ case 241:
+ case 281:
+ case 315:
+ case 316:
+ case 325:
+ case 326:
+ case 329:
+ case 370:
+ case 373:
+ case 412:
+ {
+ alt289=2;
+ }
+ break;
+ case 311:
+ {
+ alt289=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return type;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 289;
+ EXCEPTION->state = 0;
+
+
+ goto ruletype_varEx;
+
+ }
+
+ switch (alt289)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3313:4: btv= base_type_var (dta= def_type_array[ type , \"\" ] )?
+ {
+ FOLLOWPUSH(FOLLOW_base_type_var_in_type_var10081);
+ btv=base_type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletype_varEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ type=
+ btv
+ ;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3314:4: (dta= def_type_array[ type , \"\" ] )?
+ {
+ int alt288=2;
+ switch ( LA(1) )
+ {
+ case LBRACKET:
+ {
+ alt288=1;
+ }
+ break;
+ }
+
+ switch (alt288)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3314:6: dta= def_type_array[ type , \"\" ]
+ {
+ FOLLOWPUSH(FOLLOW_def_type_array_in_type_var10109);
+ dta=def_type_array(ctx, type, "");
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletype_varEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ type=
+ dta
+ ;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3316:4: dtc= def_type_container[ \"\" ]
+ {
+ FOLLOWPUSH(FOLLOW_def_type_container_in_type_var10124);
+ dtc=def_type_container(ctx, "");
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletype_varEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ type=
+ dtc
+ ;
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3318:4: dti= def_type_interval[ \"\" ]
+ {
+ FOLLOWPUSH(FOLLOW_def_type_interval_in_type_var10141);
+ dti=def_type_interval(ctx, "");
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletype_varEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ type=
+ dti
+ ;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruletype_varEx; /* Prevent compiler warnings */
+ ruletype_varEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(118, type_var_StartIndex); }
+
+ return type;
+}
+/* $ANTLR end type_var */
+
+/**
+ * $ANTLR start def_type_array
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3322:1: def_type_array[ sep::BF baseT , const std::string & tid ] returns [ sep::BF type ] : (dta= def_type_array_size )+ ;
+ */
+static sep::BF
+def_type_array(pfmlParser ctx, sep::BF baseT, const std::string & tid)
+{
+ sep::BF type;
+
+ ANTLR3_UINT32 def_type_array_StartIndex;
+
+ int dta;
+ #undef RETURN_TYPE_dta
+ #define RETURN_TYPE_dta int
+
+ /* Initialize rule variables
+ */
+ def_type_array_StartIndex = INDEX();
+
+
+
+ sep::ListOfInt listOfSize;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(119)) )
+ {
+ {
+ }
+
+
+
+ return type;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3328:2: ( (dta= def_type_array_size )+ )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3328:4: (dta= def_type_array_size )+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3328:4: (dta= def_type_array_size )+
+ {
+ int cnt290=0;
+
+ for (;;)
+ {
+ int alt290=2;
+ switch ( LA(1) )
+ {
+ case LBRACKET:
+ {
+ alt290=1;
+ }
+ break;
+
+ }
+
+ switch (alt290)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3328:6: dta= def_type_array_size
+ {
+ FOLLOWPUSH(FOLLOW_def_type_array_size_in_def_type_array10178);
+ dta=def_type_array_size(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_arrayEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ listOfSize.push_back(dta
+ );
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt290 >= 1 )
+ {
+ goto loop290;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return type;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruledef_type_arrayEx;
+ }
+ cnt290++;
+ }
+ loop290: ; /* Jump to here if this rule does not match */
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+
+ int szT = listOfSize.front();
+ listOfSize.pop_front();
+
+ while( listOfSize.nonempty() )
+ {
+ baseT = sep::BF( sep::DataType::newContainer(_CPM_,
+ sep::DataType::strContainerId(sep::TYPE_ARRAY_SPECIFIER,
+ baseT, listOfSize.back()),
+ sep::TYPE_ARRAY_SPECIFIER, baseT, listOfSize.back()) );
+ listOfSize.pop_back();
+ }
+ type = sep::BF( sep::DataType::newContainer(_CPM_,
+ sep::DataType::strContainerId(
+ tid, sep::TYPE_ARRAY_SPECIFIER, baseT, szT),
+ sep::TYPE_ARRAY_SPECIFIER, baseT, szT) );
+
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_type_arrayEx; /* Prevent compiler warnings */
+ ruledef_type_arrayEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(119, def_type_array_StartIndex); }
+
+ return type;
+}
+/* $ANTLR end def_type_array */
+
+/**
+ * $ANTLR start def_type_array_size
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3348:1: def_type_array_size returns [ int size ] : LBRACKET (sz= IntegerLiteral |id= qualifiedNameID ) RBRACKET ;
+ */
+static int
+def_type_array_size(pfmlParser ctx)
+{
+ int size;
+
+ ANTLR3_UINT32 def_type_array_size_StartIndex;
+
+ pANTLR3_COMMON_TOKEN sz;
+ fmlParser_qualifiedNameID_return id;
+ #undef RETURN_TYPE_id
+ #define RETURN_TYPE_id fmlParser_qualifiedNameID_return
+
+ /* Initialize rule variables
+ */
+ def_type_array_size_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(120)) )
+ {
+ {
+ }
+
+
+
+ return size;
+ }
+
+ sz = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3350:2: ( LBRACKET (sz= IntegerLiteral |id= qualifiedNameID ) RBRACKET )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3350:4: LBRACKET (sz= IntegerLiteral |id= qualifiedNameID ) RBRACKET
+ {
+ MATCHT(LBRACKET, &FOLLOW_LBRACKET_in_def_type_array_size10202);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_array_sizeEx;
+ }
+ if (HASFAILED())
+ {
+ return size;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3351:6: (sz= IntegerLiteral |id= qualifiedNameID )
+ {
+ int alt291=2;
+ switch ( LA(1) )
+ {
+ case IntegerLiteral:
+ {
+ alt291=1;
+ }
+ break;
+ case ID:
+ {
+ alt291=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return size;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 291;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_type_array_sizeEx;
+
+ }
+
+ switch (alt291)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3351:8: sz= IntegerLiteral
+ {
+ sz = (pANTLR3_COMMON_TOKEN) MATCHT(IntegerLiteral, &FOLLOW_IntegerLiteral_in_def_type_array_size10213);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_array_sizeEx;
+ }
+ if (HASFAILED())
+ {
+ return size;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ size = NUM_INT((sz->getText(sz))->chars);
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3354:5: id= qualifiedNameID
+ {
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_def_type_array_size10228);
+ id=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_array_sizeEx;
+ }
+ if (HASFAILED())
+ {
+ return size;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ const sep::BF & constVar =
+ sep::ParserUtil::getConstant(id.s
+ , id.nb
+ );
+ if( constVar.valid() &&
+ constVar.to_ptr< sep::Variable >()->hasValue() &&
+ constVar.to_ptr< sep::Variable >()->getValue().isInteger() )
+ {
+ size = constVar.to_ptr< sep::Variable >()->getValue().toInteger();
+ }
+ else
+ {
+ sep::BF aType = sep::ParserUtil::getDataType(id.s
+ , id.nb
+ );
+
+ if( aType.valid() && aType.is< sep::DataType >() )
+ {
+ if( aType.to_ptr< sep::DataType >()->isTypedInterval() )
+ {
+ size = aType.to_ptr< sep::DataType >()->getIntervalLength();
+
+ if( size < 0 )
+ {
+ sep::ParserUtil::avm_syntax_error(
+ "def_type_array_size(...)" )
+ << "unexpected << interval: " << id.s
+
+ << " >> as size (i.e. " << size
+ << ") in an array typedef"
+ << sep::ParserUtil::SYNTAX_ERROR_EOL;
+
+ size = 0;
+ }
+ }
+ else if( aType.to_ptr< sep::DataType >()->isTypedEnum() )
+ {
+ size = aType.to_ptr< sep::DataType >()->getEnumSize();
+
+ if( size == 0 )
+ {
+ sep::ParserUtil::avm_syntax_error(
+ "def_type_array_size(...)" )
+ << "unexpected << enum: " << id.s
+
+ << " >> as size in an array typedef"
+ << sep::ParserUtil::SYNTAX_ERROR_EOL;
+ }
+ }
+ else
+ {
+ size = 0;
+
+ sep::ParserUtil::avm_syntax_error(
+ "def_type_array_size(...)" )
+ << "unexpected << [Qualified]NameID: " << id.s
+
+ << " >> as size in an array typedef"
+ << sep::ParserUtil::SYNTAX_ERROR_EOL;
+ }
+ }
+ else
+ {
+ size = 0;
+
+ sep::ParserUtil::avm_syntax_error(
+ "def_type_array_size(...)" )
+ << "unexpected << [Qualified]NameID: " << id.s
+
+ << " >> as size in an array typedef"
+ << sep::ParserUtil::SYNTAX_ERROR_EOL;
+ }
+ }
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(RBRACKET, &FOLLOW_RBRACKET_in_def_type_array_size10241);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_array_sizeEx;
+ }
+ if (HASFAILED())
+ {
+ return size;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_type_array_sizeEx; /* Prevent compiler warnings */
+ ruledef_type_array_sizeEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(120, def_type_array_size_StartIndex); }
+
+ return size;
+}
+/* $ANTLR end def_type_array_size */
+
+/**
+ * $ANTLR start def_type_container
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3427:1: def_type_container[ const std::string & tid ] returns [ sep::BF type ] : sb= specifier_buffer ( LT_ ( (btv= base_type_var ( COMMA ( 'size:' )? (sz= integer_constant | STAR ) )? ) | ( 'size:' )? sz= integer_constant ) GT )? ;
+ */
+static sep::BF
+def_type_container(pfmlParser ctx, const std::string & tid)
+{
+ sep::BF type;
+
+ ANTLR3_UINT32 def_type_container_StartIndex;
+
+ sep::avm_type_specifier_kind_t sb;
+ #undef RETURN_TYPE_sb
+ #define RETURN_TYPE_sb sep::avm_type_specifier_kind_t
+
+ sep::BF btv;
+ #undef RETURN_TYPE_btv
+ #define RETURN_TYPE_btv sep::BF
+
+ sep::avm_size_t sz;
+ #undef RETURN_TYPE_sz
+ #define RETURN_TYPE_sz sep::avm_size_t
+
+ /* Initialize rule variables
+ */
+ def_type_container_StartIndex = INDEX();
+
+
+
+ sep::BF baseT = sep::TypeManager::UNIVERSAL;
+ int szT = -1;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(121)) )
+ {
+ {
+ }
+
+
+
+ return type;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3433:3: (sb= specifier_buffer ( LT_ ( (btv= base_type_var ( COMMA ( 'size:' )? (sz= integer_constant | STAR ) )? ) | ( 'size:' )? sz= integer_constant ) GT )? )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3433:5: sb= specifier_buffer ( LT_ ( (btv= base_type_var ( COMMA ( 'size:' )? (sz= integer_constant | STAR ) )? ) | ( 'size:' )? sz= integer_constant ) GT )?
+ {
+ FOLLOWPUSH(FOLLOW_specifier_buffer_in_def_type_container10266);
+ sb=specifier_buffer(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_containerEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3434:5: ( LT_ ( (btv= base_type_var ( COMMA ( 'size:' )? (sz= integer_constant | STAR ) )? ) | ( 'size:' )? sz= integer_constant ) GT )?
+ {
+ int alt297=2;
+ switch ( LA(1) )
+ {
+ case LT_:
+ {
+ alt297=1;
+ }
+ break;
+ }
+
+ switch (alt297)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3434:7: LT_ ( (btv= base_type_var ( COMMA ( 'size:' )? (sz= integer_constant | STAR ) )? ) | ( 'size:' )? sz= integer_constant ) GT
+ {
+ MATCHT(LT_, &FOLLOW_LT__in_def_type_container10274);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_containerEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3435:6: ( (btv= base_type_var ( COMMA ( 'size:' )? (sz= integer_constant | STAR ) )? ) | ( 'size:' )? sz= integer_constant )
+ {
+ int alt296=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ {
+ int LA296_1 = LA(2);
+ if ( (synpred493_fml(ctx)))
+ {
+ alt296=1;
+ }
+ else if ( (ANTLR3_TRUE))
+ {
+ alt296=2;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return type;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 296;
+ EXCEPTION->state = 1;
+
+
+ goto ruledef_type_containerEx;
+
+ }
+ }
+ }
+ break;
+ case 242:
+ case 245:
+ case 246:
+ case 249:
+ case 254:
+ case 255:
+ case 259:
+ case 261:
+ case 264:
+ case 270:
+ case 271:
+ case 283:
+ case 309:
+ case 310:
+ case 317:
+ case 320:
+ case 333:
+ case 344:
+ case 345:
+ case 346:
+ case 357:
+ case 358:
+ case 360:
+ case 374:
+ case 387:
+ case 392:
+ case 399:
+ case 400:
+ case 401:
+ case 402:
+ case 405:
+ case 407:
+ case 408:
+ case 409:
+ {
+ alt296=1;
+ }
+ break;
+ case IntegerLiteral:
+ case 375:
+ {
+ alt296=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return type;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 296;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_type_containerEx;
+
+ }
+
+ switch (alt296)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3435:8: (btv= base_type_var ( COMMA ( 'size:' )? (sz= integer_constant | STAR ) )? )
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3435:8: (btv= base_type_var ( COMMA ( 'size:' )? (sz= integer_constant | STAR ) )? )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3435:10: btv= base_type_var ( COMMA ( 'size:' )? (sz= integer_constant | STAR ) )?
+ {
+ FOLLOWPUSH(FOLLOW_base_type_var_in_def_type_container10287);
+ btv=base_type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_containerEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ baseT = btv
+ ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3436:10: ( COMMA ( 'size:' )? (sz= integer_constant | STAR ) )?
+ {
+ int alt294=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt294=1;
+ }
+ break;
+ }
+
+ switch (alt294)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3436:12: COMMA ( 'size:' )? (sz= integer_constant | STAR )
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_def_type_container10303);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_containerEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3436:19: ( 'size:' )?
+ {
+ int alt292=2;
+ switch ( LA(1) )
+ {
+ case 375:
+ {
+ alt292=1;
+ }
+ break;
+ }
+
+ switch (alt292)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3436:21: 'size:'
+ {
+ MATCHT(375, &FOLLOW_375_in_def_type_container10308);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_containerEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3437:12: (sz= integer_constant | STAR )
+ {
+ int alt293=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ case IntegerLiteral:
+ {
+ alt293=1;
+ }
+ break;
+ case STAR:
+ {
+ alt293=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return type;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 293;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_type_containerEx;
+
+ }
+
+ switch (alt293)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3437:14: sz= integer_constant
+ {
+ FOLLOWPUSH(FOLLOW_integer_constant_in_def_type_container10328);
+ sz=integer_constant(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_containerEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ szT = sz
+ ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3438:14: STAR
+ {
+ MATCHT(STAR, &FOLLOW_STAR_in_def_type_container10345);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_containerEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ szT = -1;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3442:8: ( 'size:' )? sz= integer_constant
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3442:8: ( 'size:' )?
+ {
+ int alt295=2;
+ switch ( LA(1) )
+ {
+ case 375:
+ {
+ alt295=1;
+ }
+ break;
+ }
+
+ switch (alt295)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3442:10: 'size:'
+ {
+ MATCHT(375, &FOLLOW_375_in_def_type_container10407);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_containerEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_integer_constant_in_def_type_container10414);
+ sz=integer_constant(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_containerEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ szT = sz
+ ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(GT, &FOLLOW_GT_in_def_type_container10431);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_containerEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+
+ type= sep::BF( sep::DataType::newContainer(_CPM_,
+ sep::DataType::strContainerId(tid,
+ sb
+ , baseT, szT),
+ sb
+ , baseT, szT) );
+
+
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_type_containerEx; /* Prevent compiler warnings */
+ ruledef_type_containerEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(121, def_type_container_StartIndex); }
+
+ return type;
+}
+/* $ANTLR end def_type_container */
+
+/**
+ * $ANTLR start specifier_buffer
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3454:1: specifier_buffer returns [ sep::avm_type_specifier_kind_t kind ] : ( 'array' | 'vector' | 'rvector' | 'list' | 'fifo' | 'lifo' | 'multififo' | 'multilifo' | 'set' | 'multiset' );
+ */
+static sep::avm_type_specifier_kind_t
+specifier_buffer(pfmlParser ctx)
+{
+ sep::avm_type_specifier_kind_t kind;
+
+ ANTLR3_UINT32 specifier_buffer_StartIndex;
+
+ /* Initialize rule variables
+ */
+ specifier_buffer_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(122)) )
+ {
+ {
+ }
+
+
+
+ return kind;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3456:2: ( 'array' | 'vector' | 'rvector' | 'list' | 'fifo' | 'lifo' | 'multififo' | 'multilifo' | 'set' | 'multiset' )
+
+ ANTLR3_UINT32 alt298;
+
+ alt298=10;
+
+ switch ( LA(1) )
+ {
+ case 241:
+ {
+ alt298=1;
+ }
+ break;
+ case 412:
+ {
+ alt298=2;
+ }
+ break;
+ case 370:
+ {
+ alt298=3;
+ }
+ break;
+ case 316:
+ {
+ alt298=4;
+ }
+ break;
+ case 281:
+ {
+ alt298=5;
+ }
+ break;
+ case 315:
+ {
+ alt298=6;
+ }
+ break;
+ case 325:
+ {
+ alt298=7;
+ }
+ break;
+ case 326:
+ {
+ alt298=8;
+ }
+ break;
+ case 373:
+ {
+ alt298=9;
+ }
+ break;
+ case 329:
+ {
+ alt298=10;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return kind;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 298;
+ EXCEPTION->state = 0;
+
+
+ goto rulespecifier_bufferEx;
+
+ }
+
+ switch (alt298)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3456:4: 'array'
+ {
+ MATCHT(241, &FOLLOW_241_in_specifier_buffer10456);
+ if (HASEXCEPTION())
+ {
+ goto rulespecifier_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ kind= sep::TYPE_ARRAY_SPECIFIER;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3457:4: 'vector'
+ {
+ MATCHT(412, &FOLLOW_412_in_specifier_buffer10467);
+ if (HASEXCEPTION())
+ {
+ goto rulespecifier_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ kind= sep::TYPE_VECTOR_SPECIFIER;
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3458:4: 'rvector'
+ {
+ MATCHT(370, &FOLLOW_370_in_specifier_buffer10477);
+ if (HASEXCEPTION())
+ {
+ goto rulespecifier_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ kind= sep::TYPE_REVERSE_VECTOR_SPECIFIER;
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3459:4: 'list'
+ {
+ MATCHT(316, &FOLLOW_316_in_specifier_buffer10486);
+ if (HASEXCEPTION())
+ {
+ goto rulespecifier_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ kind= sep::TYPE_LIST_SPECIFIER;
+
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3460:4: 'fifo'
+ {
+ MATCHT(281, &FOLLOW_281_in_specifier_buffer10498);
+ if (HASEXCEPTION())
+ {
+ goto rulespecifier_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ kind= sep::TYPE_FIFO_SPECIFIER;
+
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3461:4: 'lifo'
+ {
+ MATCHT(315, &FOLLOW_315_in_specifier_buffer10510);
+ if (HASEXCEPTION())
+ {
+ goto rulespecifier_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ kind= sep::TYPE_LIFO_SPECIFIER;
+
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3462:4: 'multififo'
+ {
+ MATCHT(325, &FOLLOW_325_in_specifier_buffer10522);
+ if (HASEXCEPTION())
+ {
+ goto rulespecifier_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ kind= sep::TYPE_MULTI_FIFO_SPECIFIER;
+
+ }
+
+
+ }
+ break;
+ case 8:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3463:4: 'multilifo'
+ {
+ MATCHT(326, &FOLLOW_326_in_specifier_buffer10529);
+ if (HASEXCEPTION())
+ {
+ goto rulespecifier_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ kind= sep::TYPE_MULTI_LIFO_SPECIFIER;
+
+ }
+
+
+ }
+ break;
+ case 9:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3464:4: 'set'
+ {
+ MATCHT(373, &FOLLOW_373_in_specifier_buffer10536);
+ if (HASEXCEPTION())
+ {
+ goto rulespecifier_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ kind= sep::TYPE_SET_SPECIFIER;
+
+ }
+
+
+ }
+ break;
+ case 10:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3465:4: 'multiset'
+ {
+ MATCHT(329, &FOLLOW_329_in_specifier_buffer10549);
+ if (HASEXCEPTION())
+ {
+ goto rulespecifier_bufferEx;
+ }
+ if (HASFAILED())
+ {
+ return kind;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ kind= sep::TYPE_MULTISET_SPECIFIER;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulespecifier_bufferEx; /* Prevent compiler warnings */
+ rulespecifier_bufferEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(122, specifier_buffer_StartIndex); }
+
+ return kind;
+}
+/* $ANTLR end specifier_buffer */
+
+/**
+ * $ANTLR start def_type_interval
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3469:1: def_type_interval[ const std::string & tid ] returns [ sep::BF type ] : 'interval' LT_ (pt= primitive_type )? (ll= LBRACKET |ll= RBRACKET |ll= LPAREN ) min= expression COMMA max= expression (rr= LBRACKET |rr= RBRACKET |rr= RPAREN ) GT ;
+ */
+static sep::BF
+def_type_interval(pfmlParser ctx, const std::string & tid)
+{
+ sep::BF type;
+
+ ANTLR3_UINT32 def_type_interval_StartIndex;
+
+ pANTLR3_COMMON_TOKEN ll;
+ pANTLR3_COMMON_TOKEN rr;
+ sep::TypeSpecifier pt;
+ #undef RETURN_TYPE_pt
+ #define RETURN_TYPE_pt sep::TypeSpecifier
+
+ sep::BF min;
+ #undef RETURN_TYPE_min
+ #define RETURN_TYPE_min sep::BF
+
+ sep::BF max;
+ #undef RETURN_TYPE_max
+ #define RETURN_TYPE_max sep::BF
+
+ /* Initialize rule variables
+ */
+ def_type_interval_StartIndex = INDEX();
+
+
+
+ sep::BF baseT = sep::TypeManager::INTEGER;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(123)) )
+ {
+ {
+ }
+
+
+
+ return type;
+ }
+
+ ll = NULL;
+ rr = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3474:2: ( 'interval' LT_ (pt= primitive_type )? (ll= LBRACKET |ll= RBRACKET |ll= LPAREN ) min= expression COMMA max= expression (rr= LBRACKET |rr= RBRACKET |rr= RPAREN ) GT )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3474:4: 'interval' LT_ (pt= primitive_type )? (ll= LBRACKET |ll= RBRACKET |ll= LPAREN ) min= expression COMMA max= expression (rr= LBRACKET |rr= RBRACKET |rr= RPAREN ) GT
+ {
+ MATCHT(311, &FOLLOW_311_in_def_type_interval10574);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_intervalEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ type= sep::TypeManager::INTEGER;
+
+ }
+
+
+ MATCHT(LT_, &FOLLOW_LT__in_def_type_interval10582);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_intervalEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3476:6: (pt= primitive_type )?
+ {
+ int alt299=2;
+ switch ( LA(1) )
+ {
+ case 242:
+ case 245:
+ case 246:
+ case 249:
+ case 254:
+ case 255:
+ case 259:
+ case 261:
+ case 264:
+ case 270:
+ case 271:
+ case 283:
+ case 309:
+ case 310:
+ case 317:
+ case 320:
+ case 333:
+ case 344:
+ case 345:
+ case 346:
+ case 357:
+ case 358:
+ case 360:
+ case 374:
+ case 387:
+ case 392:
+ case 399:
+ case 400:
+ case 401:
+ case 402:
+ case 405:
+ case 407:
+ case 408:
+ case 409:
+ {
+ alt299=1;
+ }
+ break;
+ }
+
+ switch (alt299)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3476:8: pt= primitive_type
+ {
+ FOLLOWPUSH(FOLLOW_primitive_type_in_def_type_interval10593);
+ pt=primitive_type(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_intervalEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ baseT = pt
+ ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3477:6: (ll= LBRACKET |ll= RBRACKET |ll= LPAREN )
+ {
+ int alt300=3;
+ switch ( LA(1) )
+ {
+ case LBRACKET:
+ {
+ alt300=1;
+ }
+ break;
+ case RBRACKET:
+ {
+ alt300=2;
+ }
+ break;
+ case LPAREN:
+ {
+ alt300=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return type;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 300;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_type_intervalEx;
+
+ }
+
+ switch (alt300)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3477:7: ll= LBRACKET
+ {
+ ll = (pANTLR3_COMMON_TOKEN) MATCHT(LBRACKET, &FOLLOW_LBRACKET_in_def_type_interval10608);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_intervalEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3477:21: ll= RBRACKET
+ {
+ ll = (pANTLR3_COMMON_TOKEN) MATCHT(RBRACKET, &FOLLOW_RBRACKET_in_def_type_interval10614);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_intervalEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3477:35: ll= LPAREN
+ {
+ ll = (pANTLR3_COMMON_TOKEN) MATCHT(LPAREN, &FOLLOW_LPAREN_in_def_type_interval10620);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_intervalEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_expression_in_def_type_interval10630);
+ min=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_intervalEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ MATCHT(COMMA, &FOLLOW_COMMA_in_def_type_interval10632);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_intervalEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_def_type_interval10637);
+ max=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_intervalEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3479:6: (rr= LBRACKET |rr= RBRACKET |rr= RPAREN )
+ {
+ int alt301=3;
+ switch ( LA(1) )
+ {
+ case LBRACKET:
+ {
+ alt301=1;
+ }
+ break;
+ case RBRACKET:
+ {
+ alt301=2;
+ }
+ break;
+ case RPAREN:
+ {
+ alt301=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return type;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 301;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_type_intervalEx;
+
+ }
+
+ switch (alt301)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3479:7: rr= LBRACKET
+ {
+ rr = (pANTLR3_COMMON_TOKEN) MATCHT(LBRACKET, &FOLLOW_LBRACKET_in_def_type_interval10647);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_intervalEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3479:21: rr= RBRACKET
+ {
+ rr = (pANTLR3_COMMON_TOKEN) MATCHT(RBRACKET, &FOLLOW_RBRACKET_in_def_type_interval10653);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_intervalEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3479:35: rr= RPAREN
+ {
+ rr = (pANTLR3_COMMON_TOKEN) MATCHT(RPAREN, &FOLLOW_RPAREN_in_def_type_interval10659);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_intervalEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(GT, &FOLLOW_GT_in_def_type_interval10665);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_intervalEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ type= sep::BF( sep::DataType::newInterval(_CPM_, tid, baseT,
+ sep::IIntervalKind::computeKind(CHAR(ll), CHAR(rr)),
+
+ min
+ , max
+ ) );
+
+
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_type_intervalEx; /* Prevent compiler warnings */
+ ruledef_type_intervalEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(123, def_type_interval_StartIndex); }
+
+ return type;
+}
+/* $ANTLR end def_type_interval */
+
+/**
+ * $ANTLR start base_type_var
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3489:1: base_type_var returns [ sep::BF type ] : (pt= primitive_type |id= qualifiedNameID );
+ */
+static sep::BF
+base_type_var(pfmlParser ctx)
+{
+ sep::BF type;
+
+ ANTLR3_UINT32 base_type_var_StartIndex;
+
+ sep::TypeSpecifier pt;
+ #undef RETURN_TYPE_pt
+ #define RETURN_TYPE_pt sep::TypeSpecifier
+
+ fmlParser_qualifiedNameID_return id;
+ #undef RETURN_TYPE_id
+ #define RETURN_TYPE_id fmlParser_qualifiedNameID_return
+
+ /* Initialize rule variables
+ */
+ base_type_var_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(124)) )
+ {
+ {
+ }
+
+
+
+ return type;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3491:2: (pt= primitive_type |id= qualifiedNameID )
+
+ ANTLR3_UINT32 alt302;
+
+ alt302=2;
+
+ switch ( LA(1) )
+ {
+ case 242:
+ case 245:
+ case 246:
+ case 249:
+ case 254:
+ case 255:
+ case 259:
+ case 261:
+ case 264:
+ case 270:
+ case 271:
+ case 283:
+ case 309:
+ case 310:
+ case 317:
+ case 320:
+ case 333:
+ case 344:
+ case 345:
+ case 346:
+ case 357:
+ case 358:
+ case 360:
+ case 374:
+ case 387:
+ case 392:
+ case 399:
+ case 400:
+ case 401:
+ case 402:
+ case 405:
+ case 407:
+ case 408:
+ case 409:
+ {
+ alt302=1;
+ }
+ break;
+ case ID:
+ {
+ alt302=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return type;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 302;
+ EXCEPTION->state = 0;
+
+
+ goto rulebase_type_varEx;
+
+ }
+
+ switch (alt302)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3491:4: pt= primitive_type
+ {
+ FOLLOWPUSH(FOLLOW_primitive_type_in_base_type_var10686);
+ pt=primitive_type(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulebase_type_varEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ type=
+ pt
+ ;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3493:4: id= qualifiedNameID
+ {
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_base_type_var10696);
+ id=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulebase_type_varEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ type= sep::ParserUtil::getDataType(
+ id.s
+ , id.nb
+ );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulebase_type_varEx; /* Prevent compiler warnings */
+ rulebase_type_varEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(124, base_type_var_StartIndex); }
+
+ return type;
+}
+/* $ANTLR end base_type_var */
+
+/**
+ * $ANTLR start primitive_type
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3498:1: primitive_type returns [ sep::TypeSpecifier bts ] : ( ( 'boolean' | 'bool' ) | ( 'integer' | 'int' ) (bfs= bit_field_size )? | ( 'uinteger' | 'uint' ) (bfs= bit_field_size )? | ( 'pos_integer' | 'pos_int' ) (bfs= bit_field_size )? | ( ( 'rational' | 'rat' ) | ( 'urational' | 'urat' ) | 'float' | 'ufloat' | 'double' | 'udouble' | 'real' | 'ureal' ) (bfs= bit_field_size )? |ct= time_clock_type |tt= time_type | 'char' (bfs= bit_field_size )? | 'character' (bfs= bit_field_size )? | 'string' (sfs= string_field_size )? | 'operator' | 'avmcode' | 'port' | 'buffer' | 'message' | 'signal' | 'connector' | 'machine' ( LT_ id= qualifiedNameID GT )? | 'universal' );
+ */
+static sep::TypeSpecifier
+primitive_type(pfmlParser ctx)
+{
+ sep::TypeSpecifier bts;
+
+ ANTLR3_UINT32 primitive_type_StartIndex;
+
+ int bfs;
+ #undef RETURN_TYPE_bfs
+ #define RETURN_TYPE_bfs int
+
+ sep::TypeSpecifier ct;
+ #undef RETURN_TYPE_ct
+ #define RETURN_TYPE_ct sep::TypeSpecifier
+
+ sep::TypeSpecifier tt;
+ #undef RETURN_TYPE_tt
+ #define RETURN_TYPE_tt sep::TypeSpecifier
+
+ fmlParser_string_field_size_return sfs;
+ #undef RETURN_TYPE_sfs
+ #define RETURN_TYPE_sfs fmlParser_string_field_size_return
+
+ fmlParser_qualifiedNameID_return id;
+ #undef RETURN_TYPE_id
+ #define RETURN_TYPE_id fmlParser_qualifiedNameID_return
+
+ /* Initialize rule variables
+ */
+ primitive_type_StartIndex = INDEX();
+
+
+
+ sep::avm_size_t arity = 1;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(125)) )
+ {
+ {
+ }
+
+
+
+ return bts;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3503:2: ( ( 'boolean' | 'bool' ) | ( 'integer' | 'int' ) (bfs= bit_field_size )? | ( 'uinteger' | 'uint' ) (bfs= bit_field_size )? | ( 'pos_integer' | 'pos_int' ) (bfs= bit_field_size )? | ( ( 'rational' | 'rat' ) | ( 'urational' | 'urat' ) | 'float' | 'ufloat' | 'double' | 'udouble' | 'real' | 'ureal' ) (bfs= bit_field_size )? |ct= time_clock_type |tt= time_type | 'char' (bfs= bit_field_size )? | 'character' (bfs= bit_field_size )? | 'string' (sfs= string_field_size )? | 'operator' | 'avmcode' | 'port' | 'buffer' | 'message' | 'signal' | 'connector' | 'machine' ( LT_ id= qualifiedNameID GT )? | 'universal' )
+
+ ANTLR3_UINT32 alt312;
+
+ alt312=19;
+
+ switch ( LA(1) )
+ {
+ case 245:
+ case 246:
+ {
+ alt312=1;
+ }
+ break;
+ case 309:
+ case 310:
+ {
+ alt312=2;
+ }
+ break;
+ case 401:
+ case 402:
+ {
+ alt312=3;
+ }
+ break;
+ case 345:
+ case 346:
+ {
+ alt312=4;
+ }
+ break;
+ case 270:
+ case 283:
+ case 357:
+ case 358:
+ case 360:
+ case 399:
+ case 400:
+ case 407:
+ case 408:
+ case 409:
+ {
+ alt312=5;
+ }
+ break;
+ case 259:
+ {
+ alt312=6;
+ }
+ break;
+ case 264:
+ case 271:
+ case 392:
+ {
+ alt312=7;
+ }
+ break;
+ case 254:
+ {
+ alt312=8;
+ }
+ break;
+ case 255:
+ {
+ alt312=9;
+ }
+ break;
+ case 387:
+ {
+ alt312=10;
+ }
+ break;
+ case 333:
+ {
+ alt312=11;
+ }
+ break;
+ case 242:
+ {
+ alt312=12;
+ }
+ break;
+ case 344:
+ {
+ alt312=13;
+ }
+ break;
+ case 249:
+ {
+ alt312=14;
+ }
+ break;
+ case 320:
+ {
+ alt312=15;
+ }
+ break;
+ case 374:
+ {
+ alt312=16;
+ }
+ break;
+ case 261:
+ {
+ alt312=17;
+ }
+ break;
+ case 317:
+ {
+ alt312=18;
+ }
+ break;
+ case 405:
+ {
+ alt312=19;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return bts;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 312;
+ EXCEPTION->state = 0;
+
+
+ goto ruleprimitive_typeEx;
+
+ }
+
+ switch (alt312)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3503:4: ( 'boolean' | 'bool' )
+ {
+ if ( ((LA(1) >= 245) && (LA(1) <= 246)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return bts;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruleprimitive_typeEx;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::BOOLEAN;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3505:4: ( 'integer' | 'int' ) (bfs= bit_field_size )?
+ {
+ if ( ((LA(1) >= 309) && (LA(1) <= 310)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return bts;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruleprimitive_typeEx;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::INTEGER;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3506:4: (bfs= bit_field_size )?
+ {
+ int alt303=2;
+ switch ( LA(1) )
+ {
+ case COLON:
+ {
+ {
+ int LA303_1 = LA(2);
+ if ( (synpred514_fml(ctx)))
+ {
+ alt303=1;
+ }
+ }
+ }
+ break;
+ case LT_:
+ {
+ alt303=1;
+ }
+ break;
+ }
+
+ switch (alt303)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3506:6: bfs= bit_field_size
+ {
+ FOLLOWPUSH(FOLLOW_bit_field_size_in_primitive_type10755);
+ bfs=bit_field_size(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::getTypeInteger(
+ bfs
+ );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3510:4: ( 'uinteger' | 'uint' ) (bfs= bit_field_size )?
+ {
+ if ( ((LA(1) >= 401) && (LA(1) <= 402)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return bts;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruleprimitive_typeEx;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::UINTEGER;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3511:4: (bfs= bit_field_size )?
+ {
+ int alt304=2;
+ switch ( LA(1) )
+ {
+ case COLON:
+ {
+ {
+ int LA304_1 = LA(2);
+ if ( (synpred517_fml(ctx)))
+ {
+ alt304=1;
+ }
+ }
+ }
+ break;
+ case LT_:
+ {
+ alt304=1;
+ }
+ break;
+ }
+
+ switch (alt304)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3511:6: bfs= bit_field_size
+ {
+ FOLLOWPUSH(FOLLOW_bit_field_size_in_primitive_type10794);
+ bfs=bit_field_size(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::getTypeUInteger(
+ bfs
+ );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3515:4: ( 'pos_integer' | 'pos_int' ) (bfs= bit_field_size )?
+ {
+ if ( ((LA(1) >= 345) && (LA(1) <= 346)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return bts;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruleprimitive_typeEx;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::POS_INTEGER;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3516:4: (bfs= bit_field_size )?
+ {
+ int alt305=2;
+ switch ( LA(1) )
+ {
+ case COLON:
+ {
+ {
+ int LA305_1 = LA(2);
+ if ( (synpred520_fml(ctx)))
+ {
+ alt305=1;
+ }
+ }
+ }
+ break;
+ case LT_:
+ {
+ alt305=1;
+ }
+ break;
+ }
+
+ switch (alt305)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3516:6: bfs= bit_field_size
+ {
+ FOLLOWPUSH(FOLLOW_bit_field_size_in_primitive_type10831);
+ bfs=bit_field_size(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::getTypePosInteger(
+ bfs
+ );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3521:4: ( ( 'rational' | 'rat' ) | ( 'urational' | 'urat' ) | 'float' | 'ufloat' | 'double' | 'udouble' | 'real' | 'ureal' ) (bfs= bit_field_size )?
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3521:4: ( ( 'rational' | 'rat' ) | ( 'urational' | 'urat' ) | 'float' | 'ufloat' | 'double' | 'udouble' | 'real' | 'ureal' )
+ {
+ int alt306=8;
+ switch ( LA(1) )
+ {
+ case 357:
+ case 358:
+ {
+ alt306=1;
+ }
+ break;
+ case 407:
+ case 408:
+ {
+ alt306=2;
+ }
+ break;
+ case 283:
+ {
+ alt306=3;
+ }
+ break;
+ case 400:
+ {
+ alt306=4;
+ }
+ break;
+ case 270:
+ {
+ alt306=5;
+ }
+ break;
+ case 399:
+ {
+ alt306=6;
+ }
+ break;
+ case 360:
+ {
+ alt306=7;
+ }
+ break;
+ case 409:
+ {
+ alt306=8;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return bts;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 306;
+ EXCEPTION->state = 0;
+
+
+ goto ruleprimitive_typeEx;
+
+ }
+
+ switch (alt306)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3521:6: ( 'rational' | 'rat' )
+ {
+ if ( ((LA(1) >= 357) && (LA(1) <= 358)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return bts;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruleprimitive_typeEx;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::RATIONAL;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3522:6: ( 'urational' | 'urat' )
+ {
+ if ( ((LA(1) >= 407) && (LA(1) <= 408)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return bts;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruleprimitive_typeEx;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::URATIONAL;
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3524:6: 'float'
+ {
+ MATCHT(283, &FOLLOW_283_in_primitive_type10890);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::FLOAT;
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3525:6: 'ufloat'
+ {
+ MATCHT(400, &FOLLOW_400_in_primitive_type10902);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::UFLOAT;
+
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3527:6: 'double'
+ {
+ MATCHT(270, &FOLLOW_270_in_primitive_type10914);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::DOUBLE;
+
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3528:6: 'udouble'
+ {
+ MATCHT(399, &FOLLOW_399_in_primitive_type10925);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::UDOUBLE;
+
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3530:6: 'real'
+ {
+ MATCHT(360, &FOLLOW_360_in_primitive_type10936);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::REAL;
+
+ }
+
+
+ }
+ break;
+ case 8:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3531:6: 'ureal'
+ {
+ MATCHT(409, &FOLLOW_409_in_primitive_type10949);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::UREAL;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3533:4: (bfs= bit_field_size )?
+ {
+ int alt307=2;
+ switch ( LA(1) )
+ {
+ case COLON:
+ {
+ {
+ int LA307_1 = LA(2);
+ if ( (synpred531_fml(ctx)))
+ {
+ alt307=1;
+ }
+ }
+ }
+ break;
+ case LT_:
+ {
+ alt307=1;
+ }
+ break;
+ }
+
+ switch (alt307)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3533:6: bfs= bit_field_size
+ {
+ FOLLOWPUSH(FOLLOW_bit_field_size_in_primitive_type10968);
+ bfs=bit_field_size(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ bts= sep::TypeManager::newNumericTypeSpecifier(
+
+ bts
+ , bfs
+ , sep::ExpressionConstant::INTEGER_ZERO);
+
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3541:4: ct= time_clock_type
+ {
+ FOLLOWPUSH(FOLLOW_time_clock_type_in_primitive_type10988);
+ ct=time_clock_type(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts=
+ ct
+ ;
+
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3543:4: tt= time_type
+ {
+ FOLLOWPUSH(FOLLOW_time_type_in_primitive_type10998);
+ tt=time_type(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts=
+ tt
+ ;
+
+ }
+
+
+ }
+ break;
+ case 8:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3545:4: 'char' (bfs= bit_field_size )?
+ {
+ MATCHT(254, &FOLLOW_254_in_primitive_type11006);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::CHAR;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3546:4: (bfs= bit_field_size )?
+ {
+ int alt308=2;
+ switch ( LA(1) )
+ {
+ case COLON:
+ {
+ {
+ int LA308_1 = LA(2);
+ if ( (synpred535_fml(ctx)))
+ {
+ alt308=1;
+ }
+ }
+ }
+ break;
+ case LT_:
+ {
+ alt308=1;
+ }
+ break;
+ }
+
+ switch (alt308)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3546:6: bfs= bit_field_size
+ {
+ FOLLOWPUSH(FOLLOW_bit_field_size_in_primitive_type11020);
+ bfs=bit_field_size(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::newCharacter( "char",
+ bfs
+ );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 9:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3550:4: 'character' (bfs= bit_field_size )?
+ {
+ MATCHT(255, &FOLLOW_255_in_primitive_type11037);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::CHARACTER;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3551:4: (bfs= bit_field_size )?
+ {
+ int alt309=2;
+ switch ( LA(1) )
+ {
+ case COLON:
+ {
+ {
+ int LA309_1 = LA(2);
+ if ( (synpred537_fml(ctx)))
+ {
+ alt309=1;
+ }
+ }
+ }
+ break;
+ case LT_:
+ {
+ alt309=1;
+ }
+ break;
+ }
+
+ switch (alt309)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3551:6: bfs= bit_field_size
+ {
+ FOLLOWPUSH(FOLLOW_bit_field_size_in_primitive_type11051);
+ bfs=bit_field_size(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::newCharacter( "character",
+ bfs
+ );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 10:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3555:4: 'string' (sfs= string_field_size )?
+ {
+ MATCHT(387, &FOLLOW_387_in_primitive_type11068);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::STRING;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3556:4: (sfs= string_field_size )?
+ {
+ int alt310=2;
+ switch ( LA(1) )
+ {
+ case COLON:
+ {
+ {
+ int LA310_1 = LA(2);
+ if ( (synpred539_fml(ctx)))
+ {
+ alt310=1;
+ }
+ }
+ }
+ break;
+ case LT_:
+ {
+ alt310=1;
+ }
+ break;
+ }
+
+ switch (alt310)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3556:6: sfs= string_field_size
+ {
+ FOLLOWPUSH(FOLLOW_string_field_size_in_primitive_type11080);
+ sfs=string_field_size(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::newString(
+ sfs.min
+ , sfs.max
+ );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 11:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3561:4: 'operator'
+ {
+ MATCHT(333, &FOLLOW_333_in_primitive_type11098);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::OPERATOR;
+
+ }
+
+
+ }
+ break;
+ case 12:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3562:4: 'avmcode'
+ {
+ MATCHT(242, &FOLLOW_242_in_primitive_type11107);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::AVMCODE;
+
+ }
+
+
+ }
+ break;
+ case 13:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3564:4: 'port'
+ {
+ MATCHT(344, &FOLLOW_344_in_primitive_type11118);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::PORT;
+
+ }
+
+
+ }
+ break;
+ case 14:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3565:4: 'buffer'
+ {
+ MATCHT(249, &FOLLOW_249_in_primitive_type11131);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::BUFFER;
+
+ }
+
+
+ }
+ break;
+ case 15:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3566:4: 'message'
+ {
+ MATCHT(320, &FOLLOW_320_in_primitive_type11142);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::MESSAGE;
+
+ }
+
+
+ }
+ break;
+ case 16:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3567:4: 'signal'
+ {
+ MATCHT(374, &FOLLOW_374_in_primitive_type11152);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::SIGNAL;
+
+ }
+
+
+ }
+ break;
+ case 17:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3568:4: 'connector'
+ {
+ MATCHT(261, &FOLLOW_261_in_primitive_type11163);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::CONNECTOR;
+
+ }
+
+
+ }
+ break;
+ case 18:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3570:4: 'machine' ( LT_ id= qualifiedNameID GT )?
+ {
+ MATCHT(317, &FOLLOW_317_in_primitive_type11172);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::MACHINE;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3571:4: ( LT_ id= qualifiedNameID GT )?
+ {
+ int alt311=2;
+ switch ( LA(1) )
+ {
+ case LT_:
+ {
+ alt311=1;
+ }
+ break;
+ }
+
+ switch (alt311)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3571:6: LT_ id= qualifiedNameID GT
+ {
+ MATCHT(LT_, &FOLLOW_LT__in_primitive_type11184);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_primitive_type11189);
+ id=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ MATCHT(GT, &FOLLOW_GT_in_primitive_type11192);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ sep::BF machineT =
+ sep::ParserUtil::getExecutableMachine(id.s
+ , id.nb
+ );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 19:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3578:4: 'universal'
+ {
+ MATCHT(405, &FOLLOW_405_in_primitive_type11209);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimitive_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::UNIVERSAL;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleprimitive_typeEx; /* Prevent compiler warnings */
+ ruleprimitive_typeEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(125, primitive_type_StartIndex); }
+
+ return bts;
+}
+/* $ANTLR end primitive_type */
+
+/**
+ * $ANTLR start bit_field_size
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3582:1: bit_field_size returns [ int size ] : ( COLON n= integer_constant | LT_ ( 'size:' )? n= integer_constant GT );
+ */
+static int
+bit_field_size(pfmlParser ctx)
+{
+ int size;
+
+ ANTLR3_UINT32 bit_field_size_StartIndex;
+
+ sep::avm_size_t n;
+ #undef RETURN_TYPE_n
+ #define RETURN_TYPE_n sep::avm_size_t
+
+ /* Initialize rule variables
+ */
+ bit_field_size_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(126)) )
+ {
+ {
+ }
+
+
+
+ return size;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3584:2: ( COLON n= integer_constant | LT_ ( 'size:' )? n= integer_constant GT )
+
+ ANTLR3_UINT32 alt314;
+
+ alt314=2;
+
+ switch ( LA(1) )
+ {
+ case COLON:
+ {
+ alt314=1;
+ }
+ break;
+ case LT_:
+ {
+ alt314=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return size;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 314;
+ EXCEPTION->state = 0;
+
+
+ goto rulebit_field_sizeEx;
+
+ }
+
+ switch (alt314)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3584:4: COLON n= integer_constant
+ {
+ MATCHT(COLON, &FOLLOW_COLON_in_bit_field_size11228);
+ if (HASEXCEPTION())
+ {
+ goto rulebit_field_sizeEx;
+ }
+ if (HASFAILED())
+ {
+ return size;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_integer_constant_in_bit_field_size11233);
+ n=integer_constant(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulebit_field_sizeEx;
+ }
+ if (HASFAILED())
+ {
+ return size;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ size = n
+ ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3585:4: LT_ ( 'size:' )? n= integer_constant GT
+ {
+ MATCHT(LT_, &FOLLOW_LT__in_bit_field_size11257);
+ if (HASEXCEPTION())
+ {
+ goto rulebit_field_sizeEx;
+ }
+ if (HASFAILED())
+ {
+ return size;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3585:9: ( 'size:' )?
+ {
+ int alt313=2;
+ switch ( LA(1) )
+ {
+ case 375:
+ {
+ alt313=1;
+ }
+ break;
+ }
+
+ switch (alt313)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3585:11: 'size:'
+ {
+ MATCHT(375, &FOLLOW_375_in_bit_field_size11262);
+ if (HASEXCEPTION())
+ {
+ goto rulebit_field_sizeEx;
+ }
+ if (HASFAILED())
+ {
+ return size;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_integer_constant_in_bit_field_size11270);
+ n=integer_constant(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulebit_field_sizeEx;
+ }
+ if (HASFAILED())
+ {
+ return size;
+ }
+
+
+ MATCHT(GT, &FOLLOW_GT_in_bit_field_size11273);
+ if (HASEXCEPTION())
+ {
+ goto rulebit_field_sizeEx;
+ }
+ if (HASFAILED())
+ {
+ return size;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ size = n
+ ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulebit_field_sizeEx; /* Prevent compiler warnings */
+ rulebit_field_sizeEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(126, bit_field_size_StartIndex); }
+
+ return size;
+}
+/* $ANTLR end bit_field_size */
+
+/**
+ * $ANTLR start string_field_size
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3589:1: string_field_size returns [ int min=0 , int max=-1 ] : ( COLON rc= range_constant | LT_ ( 'size:' )? rc= range_constant GT );
+ */
+static fmlParser_string_field_size_return
+string_field_size(pfmlParser ctx)
+{
+ fmlParser_string_field_size_return retval;
+
+ ANTLR3_UINT32 string_field_size_StartIndex;
+
+ fmlParser_range_constant_return rc;
+ #undef RETURN_TYPE_rc
+ #define RETURN_TYPE_rc fmlParser_range_constant_return
+
+ /* Initialize rule variables
+ */
+ retval.min = 0;
+ retval.max = -1;
+
+ string_field_size_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(127)) )
+ {
+ retval.start = 0;
+
+ {
+ }
+
+
+
+ return retval;
+ }
+
+ retval.start = LT(1); retval.stop = retval.start;
+
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3591:2: ( COLON rc= range_constant | LT_ ( 'size:' )? rc= range_constant GT )
+
+ ANTLR3_UINT32 alt316;
+
+ alt316=2;
+
+ switch ( LA(1) )
+ {
+ case COLON:
+ {
+ alt316=1;
+ }
+ break;
+ case LT_:
+ {
+ alt316=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return retval;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 316;
+ EXCEPTION->state = 0;
+
+
+ goto rulestring_field_sizeEx;
+
+ }
+
+ switch (alt316)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3591:4: COLON rc= range_constant
+ {
+ MATCHT(COLON, &FOLLOW_COLON_in_string_field_size11292);
+ if (HASEXCEPTION())
+ {
+ goto rulestring_field_sizeEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_range_constant_in_string_field_size11296);
+ rc=range_constant(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestring_field_sizeEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.min=
+ rc.min
+ ;
+ retval.max=
+ rc.max
+ ;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3594:4: LT_ ( 'size:' )? rc= range_constant GT
+ {
+ MATCHT(LT_, &FOLLOW_LT__in_string_field_size11307);
+ if (HASEXCEPTION())
+ {
+ goto rulestring_field_sizeEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3594:9: ( 'size:' )?
+ {
+ int alt315=2;
+ switch ( LA(1) )
+ {
+ case 375:
+ {
+ alt315=1;
+ }
+ break;
+ }
+
+ switch (alt315)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3594:11: 'size:'
+ {
+ MATCHT(375, &FOLLOW_375_in_string_field_size11312);
+ if (HASEXCEPTION())
+ {
+ goto rulestring_field_sizeEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_range_constant_in_string_field_size11320);
+ rc=range_constant(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestring_field_sizeEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ MATCHT(GT, &FOLLOW_GT_in_string_field_size11323);
+ if (HASEXCEPTION())
+ {
+ goto rulestring_field_sizeEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.min=
+ rc.min
+ ;
+ retval.max=
+ rc.max
+ ;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestring_field_sizeEx; /* Prevent compiler warnings */
+ rulestring_field_sizeEx: ;
+ retval.stop = LT(-1);
+
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(127, string_field_size_StartIndex); }
+
+ return retval;
+}
+/* $ANTLR end string_field_size */
+
+/**
+ * $ANTLR start range_constant
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3598:1: range_constant returns [ int min=0 , int max=-1 ] : n= integer_constant ( ( COMMA | DOTDOT ) n= integer_constant )? ;
+ */
+static fmlParser_range_constant_return
+range_constant(pfmlParser ctx)
+{
+ fmlParser_range_constant_return retval;
+
+ ANTLR3_UINT32 range_constant_StartIndex;
+
+ sep::avm_size_t n;
+ #undef RETURN_TYPE_n
+ #define RETURN_TYPE_n sep::avm_size_t
+
+ /* Initialize rule variables
+ */
+ retval.min = 0;
+ retval.max = -1;
+
+ range_constant_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(128)) )
+ {
+ retval.start = 0;
+
+ {
+ }
+
+
+
+ return retval;
+ }
+
+ retval.start = LT(1); retval.stop = retval.start;
+
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3600:2: (n= integer_constant ( ( COMMA | DOTDOT ) n= integer_constant )? )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3600:4: n= integer_constant ( ( COMMA | DOTDOT ) n= integer_constant )?
+ {
+ FOLLOWPUSH(FOLLOW_integer_constant_in_range_constant11345);
+ n=integer_constant(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulerange_constantEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.max=
+ n
+ ;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3601:4: ( ( COMMA | DOTDOT ) n= integer_constant )?
+ {
+ int alt317=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ {
+ int LA317_1 = LA(2);
+ if ( (synpred555_fml(ctx)))
+ {
+ alt317=1;
+ }
+ }
+ }
+ break;
+ case DOTDOT:
+ {
+ alt317=1;
+ }
+ break;
+ }
+
+ switch (alt317)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3601:6: ( COMMA | DOTDOT ) n= integer_constant
+ {
+ if ( LA(1) == COMMA || LA(1) == DOTDOT )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return retval;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulerange_constantEx;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_integer_constant_in_range_constant11374);
+ n=integer_constant(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulerange_constantEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ retval.min=
+ retval.max
+ ;
+ retval.max=
+ n
+ ;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulerange_constantEx; /* Prevent compiler warnings */
+ rulerange_constantEx: ;
+ retval.stop = LT(-1);
+
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(128, range_constant_StartIndex); }
+
+ return retval;
+}
+/* $ANTLR end range_constant */
+
+/**
+ * $ANTLR start on_write_var_routine_def
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3606:1: on_write_var_routine_def[ sep::Variable * var ] : LCURLY ( var_routine_def[ var ] )+ RCURLY ;
+ */
+static void
+on_write_var_routine_def(pfmlParser ctx, sep::Variable * var)
+{
+ ANTLR3_UINT32 on_write_var_routine_def_StartIndex;
+
+ /* Initialize rule variables
+ */
+ on_write_var_routine_def_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(129)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3607:2: ( LCURLY ( var_routine_def[ var ] )+ RCURLY )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3607:4: LCURLY ( var_routine_def[ var ] )+ RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_on_write_var_routine_def11396);
+ if (HASEXCEPTION())
+ {
+ goto ruleon_write_var_routine_defEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3607:12: ( var_routine_def[ var ] )+
+ {
+ int cnt318=0;
+
+ for (;;)
+ {
+ int alt318=2;
+ switch ( LA(1) )
+ {
+ case 205:
+ {
+ alt318=1;
+ }
+ break;
+
+ }
+
+ switch (alt318)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3607:14: var_routine_def[ var ]
+ {
+ FOLLOWPUSH(FOLLOW_var_routine_def_in_on_write_var_routine_def11401);
+ var_routine_def(ctx, var);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleon_write_var_routine_defEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt318 >= 1 )
+ {
+ goto loop318;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruleon_write_var_routine_defEx;
+ }
+ cnt318++;
+ }
+ loop318: ; /* Jump to here if this rule does not match */
+ }
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_on_write_var_routine_def11407);
+ if (HASEXCEPTION())
+ {
+ goto ruleon_write_var_routine_defEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleon_write_var_routine_defEx; /* Prevent compiler warnings */
+ ruleon_write_var_routine_defEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(129, on_write_var_routine_def_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end on_write_var_routine_def */
+
+/**
+ * $ANTLR start var_routine_def
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3611:1: var_routine_def[ sep::Variable * var ] : '@on_write' ( routine_single_param[*onWriteRoutine, var->getType()] )? (bs= block_statement | '|=>' ce= conditionalExpression SEMI ) ;
+ */
+static void
+var_routine_def(pfmlParser ctx, sep::Variable * var)
+{
+ ANTLR3_UINT32 var_routine_def_StartIndex;
+
+ sep::BFCode bs;
+ #undef RETURN_TYPE_bs
+ #define RETURN_TYPE_bs sep::BFCode
+
+ sep::BF ce;
+ #undef RETURN_TYPE_ce
+ #define RETURN_TYPE_ce sep::BF
+
+ /* Initialize rule variables
+ */
+ var_routine_def_StartIndex = INDEX();
+
+
+
+ sep::Routine * onWriteRoutine = NULL;
+
+ sep::BehavioralPart * aBehavioralpart = var->getUniqContainerOfRoutines();
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(130)) )
+ {
+ {
+
+ SET_RULE_LOCATION( onWriteRoutine );
+
+ }
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3622:2: ( '@on_write' ( routine_single_param[*onWriteRoutine, var->getType()] )? (bs= block_statement | '|=>' ce= conditionalExpression SEMI ) )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3622:4: '@on_write' ( routine_single_param[*onWriteRoutine, var->getType()] )? (bs= block_statement | '|=>' ce= conditionalExpression SEMI )
+ {
+ MATCHT(205, &FOLLOW_205_in_var_routine_def11429);
+ if (HASEXCEPTION())
+ {
+ goto rulevar_routine_defEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ onWriteRoutine = new sep::Routine(var, "on_write");
+ var->setOnWriteRoutine(onWriteRoutine);
+ if( aBehavioralpart != NULL )
+ {
+ aBehavioralpart->saveAnonymousInnerRoutine(onWriteRoutine);
+ }
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3631:4: ( routine_single_param[*onWriteRoutine, var->getType()] )?
+ {
+ int alt319=2;
+ switch ( LA(1) )
+ {
+ case LPAREN:
+ {
+ alt319=1;
+ }
+ break;
+ }
+
+ switch (alt319)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3631:6: routine_single_param[*onWriteRoutine, var->getType()]
+ {
+ FOLLOWPUSH(FOLLOW_routine_single_param_in_var_routine_def11441);
+ routine_single_param(ctx, *onWriteRoutine, var->getType());
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulevar_routine_defEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3632:4: (bs= block_statement | '|=>' ce= conditionalExpression SEMI )
+ {
+ int alt320=2;
+ switch ( LA(1) )
+ {
+ case LCURLY:
+ {
+ alt320=1;
+ }
+ break;
+ case 417:
+ {
+ alt320=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 320;
+ EXCEPTION->state = 0;
+
+
+ goto rulevar_routine_defEx;
+
+ }
+
+ switch (alt320)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3632:6: bs= block_statement
+ {
+ FOLLOWPUSH(FOLLOW_block_statement_in_var_routine_def11454);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulevar_routine_defEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ onWriteRoutine->setCode(bs
+ );
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3633:6: '|=>' ce= conditionalExpression SEMI
+ {
+ MATCHT(417, &FOLLOW_417_in_var_routine_def11464);
+ if (HASEXCEPTION())
+ {
+ goto rulevar_routine_defEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_conditionalExpression_in_var_routine_def11468);
+ ce=conditionalExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulevar_routine_defEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_var_routine_def11470);
+ if (HASEXCEPTION())
+ {
+ goto rulevar_routine_defEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ onWriteRoutine->setCode( NEW_STMT1(OP(GUARD), ce
+ ) );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulevar_routine_defEx; /* Prevent compiler warnings */
+ rulevar_routine_defEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ SET_RULE_LOCATION( onWriteRoutine );
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(130, var_routine_def_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end var_routine_def */
+
+/**
+ * $ANTLR start routine_single_param
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3638:1: routine_single_param[ sep::Routine & routine , const sep::BF & dftType ] : LPAREN ( ( type_var ID )=>tv= type_var id= ID |id= ID ) (iv= initial_value )? RPAREN ;
+ */
+static void
+routine_single_param(pfmlParser ctx, sep::Routine & routine, const sep::BF & dftType)
+{
+ ANTLR3_UINT32 routine_single_param_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ sep::BF tv;
+ #undef RETURN_TYPE_tv
+ #define RETURN_TYPE_tv sep::BF
+
+ sep::BF iv;
+ #undef RETURN_TYPE_iv
+ #define RETURN_TYPE_iv sep::BF
+
+ /* Initialize rule variables
+ */
+ routine_single_param_StartIndex = INDEX();
+
+
+
+ sep::BF paramT = dftType;
+ sep::BF value;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(131)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ id = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3644:2: ( LPAREN ( ( type_var ID )=>tv= type_var id= ID |id= ID ) (iv= initial_value )? RPAREN )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3644:4: LPAREN ( ( type_var ID )=>tv= type_var id= ID |id= ID ) (iv= initial_value )? RPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_routine_single_param11498);
+ if (HASEXCEPTION())
+ {
+ goto ruleroutine_single_paramEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3645:4: ( ( type_var ID )=>tv= type_var id= ID |id= ID )
+ {
+ int alt321=2;
+ {
+ int LA321_0 = LA(1);
+ if ( (synpred559_fml(ctx)) && (((LA321_0 >= 245) && (LA321_0 <= 246))))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (((LA321_0 >= 309) && (LA321_0 <= 310))))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (((LA321_0 >= 401) && (LA321_0 <= 402))))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (((LA321_0 >= 345) && (LA321_0 <= 346))))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (((LA321_0 >= 357) && (LA321_0 <= 358))))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (((LA321_0 >= 407) && (LA321_0 <= 408))))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 283))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 400))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 270))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 399))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 360))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 409))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 259))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 392))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 264))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 271))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 254))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 255))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 387))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 333))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 242))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 344))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 249))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 320))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 374))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 261))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 317))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 405))
+ {
+ alt321=1;
+ }
+ else if ( (LA321_0 == ID))
+ {
+ {
+ int LA321_29 = LA(2);
+ if ( (synpred559_fml(ctx)))
+ {
+ alt321=1;
+ }
+ else if ( (ANTLR3_TRUE))
+ {
+ alt321=2;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 321;
+ EXCEPTION->state = 29;
+
+
+ goto ruleroutine_single_paramEx;
+
+ }
+ }
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 241))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 412))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 370))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 316))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 281))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 315))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 325))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 326))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 373))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 329))
+ {
+ alt321=1;
+ }
+ else if ( (synpred559_fml(ctx)) && (LA321_0 == 311))
+ {
+ alt321=1;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 321;
+ EXCEPTION->state = 0;
+
+
+ goto ruleroutine_single_paramEx;
+
+ }
+ }
+ switch (alt321)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3645:6: ( type_var ID )=>tv= type_var id= ID
+ {
+ FOLLOWPUSH(FOLLOW_type_var_in_routine_single_param11517);
+ tv=type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleroutine_single_paramEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ paramT = tv
+ ;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_routine_single_param11524);
+ if (HASEXCEPTION())
+ {
+ goto ruleroutine_single_paramEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3646:6: id= ID
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_routine_single_param11533);
+ if (HASEXCEPTION())
+ {
+ goto ruleroutine_single_paramEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3648:4: (iv= initial_value )?
+ {
+ int alt322=2;
+ switch ( LA(1) )
+ {
+ case ASSIGN:
+ case LPAREN:
+ {
+ alt322=1;
+ }
+ break;
+ }
+
+ switch (alt322)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3648:6: iv= initial_value
+ {
+ FOLLOWPUSH(FOLLOW_initial_value_in_routine_single_param11547);
+ iv=initial_value(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleroutine_single_paramEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ value = iv
+ ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+
+ sep::Variable * variable;
+ routine.saveParameter( variable = new sep::Variable( &routine,
+ sep::Modifier::PROPERTY_INPUT_PARAMETER_MODIFIER,
+ paramT, STR((id->getText(id))->chars), value) );
+
+ }
+
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_routine_single_param11563);
+ if (HASEXCEPTION())
+ {
+ goto ruleroutine_single_paramEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleroutine_single_paramEx; /* Prevent compiler warnings */
+ ruleroutine_single_paramEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(131, routine_single_param_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end routine_single_param */
+
+/**
+ * $ANTLR start def_enum
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3659:1: def_enum[ sep::PropertyPart & declProperty , sep::Modifier mdfr ] : 'enum' id= ID def_enum_impl[declProperty, mdfr, STR($id.text->chars)] ;
+ */
+static void
+def_enum(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr)
+{
+ ANTLR3_UINT32 def_enum_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+
+ /* Initialize rule variables
+ */
+ def_enum_StartIndex = INDEX();
+
+
+
+ sep::Variable * var = NULL;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(132)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ id = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3664:2: ( 'enum' id= ID def_enum_impl[declProperty, mdfr, STR($id.text->chars)] )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3664:4: 'enum' id= ID def_enum_impl[declProperty, mdfr, STR($id.text->chars)]
+ {
+ MATCHT(276, &FOLLOW_276_in_def_enum11582);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_enumEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_def_enum11587);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_enumEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_enum_impl_in_def_enum11592);
+ def_enum_impl(ctx, declProperty, mdfr, STR((id->getText(id))->chars));
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_enumEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_enumEx; /* Prevent compiler warnings */
+ ruledef_enumEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(132, def_enum_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_enum */
+
+/**
+ * $ANTLR start def_enum_impl
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3668:1: def_enum_impl[ sep::PropertyPart & declProperty ,\n\t\tsep::Modifier mdfr , const std::string & tid ] : LCURLY id= ID ( ASSIGN e= expression )? ( COMMA id= ID ( ASSIGN e= expression )? )* RCURLY ;
+ */
+static void
+def_enum_impl(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr, const std::string & tid)
+{
+ ANTLR3_UINT32 def_enum_impl_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ def_enum_impl_StartIndex = INDEX();
+
+
+
+ sep::Variable * var = NULL;
+ sep::DataType * enumT;
+
+ sep::BF td( enumT = sep::DataType::newEnum(declProperty, tid) );
+ enumT->setModifier( mdfr );
+ declProperty.appendDataType( td );
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(133)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ id = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3679:2: ( LCURLY id= ID ( ASSIGN e= expression )? ( COMMA id= ID ( ASSIGN e= expression )? )* RCURLY )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3679:4: LCURLY id= ID ( ASSIGN e= expression )? ( COMMA id= ID ( ASSIGN e= expression )? )* RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_def_enum_impl11611);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_enum_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_def_enum_impl11620);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_enum_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ enumT->saveVariable( var = new sep::Variable( enumT,
+ sep::Modifier::PROPERTY_UNDEFINED_MODIFIER,
+ sep::TypeManager::INTEGER, STR((id->getText(id))->chars) ) );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3686:9: ( ASSIGN e= expression )?
+ {
+ int alt323=2;
+ switch ( LA(1) )
+ {
+ case ASSIGN:
+ {
+ alt323=1;
+ }
+ break;
+ }
+
+ switch (alt323)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3686:11: ASSIGN e= expression
+ {
+ MATCHT(ASSIGN, &FOLLOW_ASSIGN_in_def_enum_impl11639);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_enum_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_def_enum_impl11643);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_enum_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ var->setValue(e
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3688:6: ( COMMA id= ID ( ASSIGN e= expression )? )*
+
+ for (;;)
+ {
+ int alt325=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt325=1;
+ }
+ break;
+
+ }
+
+ switch (alt325)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3688:8: COMMA id= ID ( ASSIGN e= expression )?
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_def_enum_impl11659);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_enum_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_def_enum_impl11663);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_enum_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ enumT->saveVariable( var = new sep::Variable( enumT,
+ sep::Modifier::PROPERTY_UNDEFINED_MODIFIER,
+ sep::TypeManager::INTEGER, STR((id->getText(id))->chars) ) );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3694:9: ( ASSIGN e= expression )?
+ {
+ int alt324=2;
+ switch ( LA(1) )
+ {
+ case ASSIGN:
+ {
+ alt324=1;
+ }
+ break;
+ }
+
+ switch (alt324)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3694:11: ASSIGN e= expression
+ {
+ MATCHT(ASSIGN, &FOLLOW_ASSIGN_in_def_enum_impl11682);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_enum_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_def_enum_impl11686);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_enum_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ var->setValue(e
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+
+ default:
+ goto loop325; /* break out of the loop */
+ break;
+ }
+ }
+ loop325: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_def_enum_impl11707);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_enum_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_enum_implEx; /* Prevent compiler warnings */
+ ruledef_enum_implEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(133, def_enum_impl_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_enum_impl */
+
+/**
+ * $ANTLR start def_struct
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3703:1: def_struct[ sep::PropertyPart & declProperty , sep::Modifier mdfr ] : ( 'struct' | 'class' ) id= ID def_class_structure_impl[declProperty, mdfr, STR($id.text->chars)] ;
+ */
+static void
+def_struct(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr)
+{
+ ANTLR3_UINT32 def_struct_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+
+ /* Initialize rule variables
+ */
+ def_struct_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(134)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ id = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3705:2: ( ( 'struct' | 'class' ) id= ID def_class_structure_impl[declProperty, mdfr, STR($id.text->chars)] )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3705:4: ( 'struct' | 'class' ) id= ID def_class_structure_impl[declProperty, mdfr, STR($id.text->chars)]
+ {
+ if ( LA(1) == 258 || LA(1) == 388 )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruledef_structEx;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_def_struct11735);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_structEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_class_structure_impl_in_def_struct11740);
+ def_class_structure_impl(ctx, declProperty, mdfr, STR((id->getText(id))->chars));
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_structEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_structEx; /* Prevent compiler warnings */
+ ruledef_structEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(134, def_struct_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_struct */
+
+/**
+ * $ANTLR start def_class_structure_impl
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3709:1: def_class_structure_impl[ sep::PropertyPart & declProperty ,\n\t\tsep::Modifier mdfr , const std::string & tid ] : LCURLY ( (m= modifier_declaration )? ( decl_variable[ *(structT->getPropertyPart()) , mdfr ] | def_method[ declProperty ] ) )+ RCURLY ;
+ */
+static void
+def_class_structure_impl(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr, const std::string & tid)
+{
+ ANTLR3_UINT32 def_class_structure_impl_StartIndex;
+
+ sep::Modifier m;
+ #undef RETURN_TYPE_m
+ #define RETURN_TYPE_m sep::Modifier
+
+ /* Initialize rule variables
+ */
+ def_class_structure_impl_StartIndex = INDEX();
+
+
+
+ sep::DataType * structT;
+
+ sep::BF td( structT = sep::DataType::newStructure(declProperty, tid) );
+ structT->setModifier( mdfr );
+ declProperty.appendDataType( td );
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(135)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3719:2: ( LCURLY ( (m= modifier_declaration )? ( decl_variable[ *(structT->getPropertyPart()) , mdfr ] | def_method[ declProperty ] ) )+ RCURLY )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3719:4: LCURLY ( (m= modifier_declaration )? ( decl_variable[ *(structT->getPropertyPart()) , mdfr ] | def_method[ declProperty ] ) )+ RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_def_class_structure_impl11759);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_class_structure_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3720:3: ( (m= modifier_declaration )? ( decl_variable[ *(structT->getPropertyPart()) , mdfr ] | def_method[ declProperty ] ) )+
+ {
+ int cnt328=0;
+
+ for (;;)
+ {
+ int alt328=2;
+ switch ( LA(1) )
+ {
+ case 243:
+ case 259:
+ case 262:
+ case 282:
+ case 288:
+ case 298:
+ case 305:
+ case 318:
+ case 341:
+ case 349:
+ case 355:
+ case 361:
+ case 364:
+ case 380:
+ case 395:
+ case 406:
+ case 410:
+ case 411:
+ case 414:
+ {
+ alt328=1;
+ }
+ break;
+
+ }
+
+ switch (alt328)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3720:5: (m= modifier_declaration )? ( decl_variable[ *(structT->getPropertyPart()) , mdfr ] | def_method[ declProperty ] )
+ {
+ if ( BACKTRACKING==0 )
+ {
+ mdfr = sep::Modifier::PROPERTY_UNDEFINED_MODIFIER;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3722:4: (m= modifier_declaration )?
+ {
+ int alt326=2;
+ switch ( LA(1) )
+ {
+ case 243:
+ case 282:
+ case 298:
+ case 305:
+ case 341:
+ case 349:
+ case 355:
+ case 361:
+ case 364:
+ case 380:
+ case 395:
+ case 406:
+ case 414:
+ {
+ alt326=1;
+ }
+ break;
+ }
+
+ switch (alt326)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3722:6: m= modifier_declaration
+ {
+ FOLLOWPUSH(FOLLOW_modifier_declaration_in_def_class_structure_impl11775);
+ m=modifier_declaration(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_class_structure_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr = m
+ ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3724:7: ( decl_variable[ *(structT->getPropertyPart()) , mdfr ] | def_method[ declProperty ] )
+ {
+ int alt327=2;
+ switch ( LA(1) )
+ {
+ case 259:
+ case 262:
+ case 318:
+ case 410:
+ case 411:
+ {
+ alt327=1;
+ }
+ break;
+ case 288:
+ {
+ alt327=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 327;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_class_structure_implEx;
+
+ }
+
+ switch (alt327)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3724:9: decl_variable[ *(structT->getPropertyPart()) , mdfr ]
+ {
+ FOLLOWPUSH(FOLLOW_decl_variable_in_def_class_structure_impl11792);
+ decl_variable(ctx, *(structT->getPropertyPart()), mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_class_structure_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3725:9: def_method[ declProperty ]
+ {
+ FOLLOWPUSH(FOLLOW_def_method_in_def_class_structure_impl11803);
+ def_method(ctx, declProperty);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_class_structure_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+
+ default:
+
+ if ( cnt328 >= 1 )
+ {
+ goto loop328;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruledef_class_structure_implEx;
+ }
+ cnt328++;
+ }
+ loop328: ; /* Jump to here if this rule does not match */
+ }
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_def_class_structure_impl11825);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_class_structure_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_class_structure_implEx; /* Prevent compiler warnings */
+ ruledef_class_structure_implEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(135, def_class_structure_impl_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_class_structure_impl */
+
+/**
+ * $ANTLR start def_choice
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3732:1: def_choice[ sep::PropertyPart & declProperty , sep::Modifier mdfr ] : 'choice' id= ID def_choice_impl[declProperty, mdfr, STR($id.text->chars)] ;
+ */
+static void
+def_choice(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr)
+{
+ ANTLR3_UINT32 def_choice_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+
+ /* Initialize rule variables
+ */
+ def_choice_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(136)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ id = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3734:2: ( 'choice' id= ID def_choice_impl[declProperty, mdfr, STR($id.text->chars)] )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3734:4: 'choice' id= ID def_choice_impl[declProperty, mdfr, STR($id.text->chars)]
+ {
+ MATCHT(257, &FOLLOW_257_in_def_choice11840);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_choiceEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_def_choice11845);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_choiceEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_choice_impl_in_def_choice11850);
+ def_choice_impl(ctx, declProperty, mdfr, STR((id->getText(id))->chars));
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_choiceEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_choiceEx; /* Prevent compiler warnings */
+ ruledef_choiceEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(136, def_choice_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_choice */
+
+/**
+ * $ANTLR start def_choice_impl
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3738:1: def_choice_impl[ sep::PropertyPart & declProperty ,\n\t\tsep::Modifier mdfr , const std::string & tid ] : LCURLY ( (m= modifier_declaration )? ( decl_variable[ *(choiceT->getPropertyPart()) , mdfr ] | def_method[ declProperty ] ) )+ RCURLY ;
+ */
+static void
+def_choice_impl(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr, const std::string & tid)
+{
+ ANTLR3_UINT32 def_choice_impl_StartIndex;
+
+ sep::Modifier m;
+ #undef RETURN_TYPE_m
+ #define RETURN_TYPE_m sep::Modifier
+
+ /* Initialize rule variables
+ */
+ def_choice_impl_StartIndex = INDEX();
+
+
+
+ sep::DataType * choiceT;
+
+ sep::BF td( choiceT = sep::DataType::newChoice(declProperty, tid) );
+ choiceT->setModifier( mdfr );
+ declProperty.appendDataType( td );
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(137)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3748:2: ( LCURLY ( (m= modifier_declaration )? ( decl_variable[ *(choiceT->getPropertyPart()) , mdfr ] | def_method[ declProperty ] ) )+ RCURLY )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3748:4: LCURLY ( (m= modifier_declaration )? ( decl_variable[ *(choiceT->getPropertyPart()) , mdfr ] | def_method[ declProperty ] ) )+ RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_def_choice_impl11869);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_choice_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3749:3: ( (m= modifier_declaration )? ( decl_variable[ *(choiceT->getPropertyPart()) , mdfr ] | def_method[ declProperty ] ) )+
+ {
+ int cnt331=0;
+
+ for (;;)
+ {
+ int alt331=2;
+ switch ( LA(1) )
+ {
+ case 243:
+ case 259:
+ case 262:
+ case 282:
+ case 288:
+ case 298:
+ case 305:
+ case 318:
+ case 341:
+ case 349:
+ case 355:
+ case 361:
+ case 364:
+ case 380:
+ case 395:
+ case 406:
+ case 410:
+ case 411:
+ case 414:
+ {
+ alt331=1;
+ }
+ break;
+
+ }
+
+ switch (alt331)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3749:5: (m= modifier_declaration )? ( decl_variable[ *(choiceT->getPropertyPart()) , mdfr ] | def_method[ declProperty ] )
+ {
+ if ( BACKTRACKING==0 )
+ {
+ mdfr = sep::Modifier::PROPERTY_UNDEFINED_MODIFIER;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3751:4: (m= modifier_declaration )?
+ {
+ int alt329=2;
+ switch ( LA(1) )
+ {
+ case 243:
+ case 282:
+ case 298:
+ case 305:
+ case 341:
+ case 349:
+ case 355:
+ case 361:
+ case 364:
+ case 380:
+ case 395:
+ case 406:
+ case 414:
+ {
+ alt329=1;
+ }
+ break;
+ }
+
+ switch (alt329)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3751:6: m= modifier_declaration
+ {
+ FOLLOWPUSH(FOLLOW_modifier_declaration_in_def_choice_impl11885);
+ m=modifier_declaration(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_choice_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr = m
+ ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3753:7: ( decl_variable[ *(choiceT->getPropertyPart()) , mdfr ] | def_method[ declProperty ] )
+ {
+ int alt330=2;
+ switch ( LA(1) )
+ {
+ case 259:
+ case 262:
+ case 318:
+ case 410:
+ case 411:
+ {
+ alt330=1;
+ }
+ break;
+ case 288:
+ {
+ alt330=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 330;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_choice_implEx;
+
+ }
+
+ switch (alt330)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3753:9: decl_variable[ *(choiceT->getPropertyPart()) , mdfr ]
+ {
+ FOLLOWPUSH(FOLLOW_decl_variable_in_def_choice_impl11902);
+ decl_variable(ctx, *(choiceT->getPropertyPart()), mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_choice_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3754:9: def_method[ declProperty ]
+ {
+ FOLLOWPUSH(FOLLOW_def_method_in_def_choice_impl11913);
+ def_method(ctx, declProperty);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_choice_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+
+ default:
+
+ if ( cnt331 >= 1 )
+ {
+ goto loop331;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruledef_choice_implEx;
+ }
+ cnt331++;
+ }
+ loop331: ; /* Jump to here if this rule does not match */
+ }
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_def_choice_impl11935);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_choice_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_choice_implEx; /* Prevent compiler warnings */
+ ruledef_choice_implEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(137, def_choice_impl_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_choice_impl */
+
+/**
+ * $ANTLR start def_union
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3761:1: def_union[ sep::PropertyPart & declProperty , sep::Modifier mdfr ] : 'union' id= ID def_union_impl[declProperty , mdfr, STR($id.text->chars)] ;
+ */
+static void
+def_union(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr)
+{
+ ANTLR3_UINT32 def_union_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+
+ /* Initialize rule variables
+ */
+ def_union_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(138)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ id = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3763:2: ( 'union' id= ID def_union_impl[declProperty , mdfr, STR($id.text->chars)] )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3763:4: 'union' id= ID def_union_impl[declProperty , mdfr, STR($id.text->chars)]
+ {
+ MATCHT(404, &FOLLOW_404_in_def_union11950);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_unionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_def_union11955);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_unionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_union_impl_in_def_union11960);
+ def_union_impl(ctx, declProperty, mdfr, STR((id->getText(id))->chars));
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_unionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_unionEx; /* Prevent compiler warnings */
+ ruledef_unionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(138, def_union_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_union */
+
+/**
+ * $ANTLR start def_union_impl
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3768:1: def_union_impl[ sep::PropertyPart & declProperty ,\n\t\tsep::Modifier mdfr , const std::string & tid ] : LCURLY ( (m= modifier_declaration )? decl_variable[ *(unionT->getPropertyPart()) , mdfr ] )+ RCURLY ;
+ */
+static void
+def_union_impl(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr, const std::string & tid)
+{
+ ANTLR3_UINT32 def_union_impl_StartIndex;
+
+ sep::Modifier m;
+ #undef RETURN_TYPE_m
+ #define RETURN_TYPE_m sep::Modifier
+
+ /* Initialize rule variables
+ */
+ def_union_impl_StartIndex = INDEX();
+
+
+
+ sep::DataType * unionT;
+
+ sep::BF td( unionT = sep::DataType::newUnion(declProperty, tid) );
+ unionT->setModifier( mdfr );
+ declProperty.appendDataType( td );
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(139)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3778:2: ( LCURLY ( (m= modifier_declaration )? decl_variable[ *(unionT->getPropertyPart()) , mdfr ] )+ RCURLY )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3778:4: LCURLY ( (m= modifier_declaration )? decl_variable[ *(unionT->getPropertyPart()) , mdfr ] )+ RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_def_union_impl11980);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_union_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3779:3: ( (m= modifier_declaration )? decl_variable[ *(unionT->getPropertyPart()) , mdfr ] )+
+ {
+ int cnt333=0;
+
+ for (;;)
+ {
+ int alt333=2;
+ switch ( LA(1) )
+ {
+ case 243:
+ case 259:
+ case 262:
+ case 282:
+ case 298:
+ case 305:
+ case 318:
+ case 341:
+ case 349:
+ case 355:
+ case 361:
+ case 364:
+ case 380:
+ case 395:
+ case 406:
+ case 410:
+ case 411:
+ case 414:
+ {
+ alt333=1;
+ }
+ break;
+
+ }
+
+ switch (alt333)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3779:5: (m= modifier_declaration )? decl_variable[ *(unionT->getPropertyPart()) , mdfr ]
+ {
+ if ( BACKTRACKING==0 )
+ {
+ mdfr = sep::Modifier::PROPERTY_UNDEFINED_MODIFIER;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3781:4: (m= modifier_declaration )?
+ {
+ int alt332=2;
+ switch ( LA(1) )
+ {
+ case 243:
+ case 282:
+ case 298:
+ case 305:
+ case 341:
+ case 349:
+ case 355:
+ case 361:
+ case 364:
+ case 380:
+ case 395:
+ case 406:
+ case 414:
+ {
+ alt332=1;
+ }
+ break;
+ }
+
+ switch (alt332)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3781:6: m= modifier_declaration
+ {
+ FOLLOWPUSH(FOLLOW_modifier_declaration_in_def_union_impl11996);
+ m=modifier_declaration(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_union_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr = m
+ ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_decl_variable_in_def_union_impl12011);
+ decl_variable(ctx, *(unionT->getPropertyPart()), mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_union_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt333 >= 1 )
+ {
+ goto loop333;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruledef_union_implEx;
+ }
+ cnt333++;
+ }
+ loop333: ; /* Jump to here if this rule does not match */
+ }
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_def_union_impl12025);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_union_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_union_implEx; /* Prevent compiler warnings */
+ ruledef_union_implEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(139, def_union_impl_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_union_impl */
+
+/**
+ * $ANTLR start def_method
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3789:1: def_method[ sep::PropertyPart & declProperty ] : 'fun' ID LPAREN ( decl_parameters )? RPAREN ( type_var )? ;
+ */
+static void
+def_method(pfmlParser ctx, sep::PropertyPart & declProperty)
+{
+ ANTLR3_UINT32 def_method_StartIndex;
+
+ /* Initialize rule variables
+ */
+ def_method_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(140)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3790:2: ( 'fun' ID LPAREN ( decl_parameters )? RPAREN ( type_var )? )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3790:4: 'fun' ID LPAREN ( decl_parameters )? RPAREN ( type_var )?
+ {
+ MATCHT(288, &FOLLOW_288_in_def_method12038);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_methodEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(ID, &FOLLOW_ID_in_def_method12041);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_methodEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_def_method12044);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_methodEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3790:23: ( decl_parameters )?
+ {
+ int alt334=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ case 241:
+ case 242:
+ case 245:
+ case 246:
+ case 249:
+ case 254:
+ case 255:
+ case 259:
+ case 261:
+ case 264:
+ case 270:
+ case 271:
+ case 281:
+ case 283:
+ case 309:
+ case 310:
+ case 311:
+ case 315:
+ case 316:
+ case 317:
+ case 320:
+ case 325:
+ case 326:
+ case 329:
+ case 333:
+ case 344:
+ case 345:
+ case 346:
+ case 357:
+ case 358:
+ case 360:
+ case 370:
+ case 373:
+ case 374:
+ case 387:
+ case 392:
+ case 399:
+ case 400:
+ case 401:
+ case 402:
+ case 405:
+ case 407:
+ case 408:
+ case 409:
+ case 412:
+ {
+ alt334=1;
+ }
+ break;
+ }
+
+ switch (alt334)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3790:23: decl_parameters
+ {
+ FOLLOWPUSH(FOLLOW_decl_parameters_in_def_method12047);
+ decl_parameters(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_methodEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_def_method12052);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_methodEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3790:50: ( type_var )?
+ {
+ int alt335=2;
+ switch ( LA(1) )
+ {
+ case 259:
+ {
+ {
+ int LA335_1 = LA(2);
+ if ( (synpred574_fml(ctx)))
+ {
+ alt335=1;
+ }
+ }
+ }
+ break;
+ case ID:
+ case 241:
+ case 242:
+ case 245:
+ case 246:
+ case 249:
+ case 254:
+ case 255:
+ case 261:
+ case 264:
+ case 270:
+ case 271:
+ case 281:
+ case 283:
+ case 309:
+ case 310:
+ case 311:
+ case 315:
+ case 316:
+ case 317:
+ case 320:
+ case 325:
+ case 326:
+ case 329:
+ case 333:
+ case 344:
+ case 345:
+ case 346:
+ case 357:
+ case 358:
+ case 360:
+ case 370:
+ case 373:
+ case 374:
+ case 387:
+ case 392:
+ case 399:
+ case 400:
+ case 401:
+ case 402:
+ case 405:
+ case 407:
+ case 408:
+ case 409:
+ case 412:
+ {
+ alt335=1;
+ }
+ break;
+ }
+
+ switch (alt335)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3790:52: type_var
+ {
+ FOLLOWPUSH(FOLLOW_type_var_in_def_method12057);
+ type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_methodEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_methodEx; /* Prevent compiler warnings */
+ ruledef_methodEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(140, def_method_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_method */
+
+/**
+ * $ANTLR start decl_parameters
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3793:1: decl_parameters : type_var ID ( COMMA type_var ID )* ;
+ */
+static void
+decl_parameters(pfmlParser ctx)
+{
+ ANTLR3_UINT32 decl_parameters_StartIndex;
+
+ /* Initialize rule variables
+ */
+ decl_parameters_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(141)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3794:2: ( type_var ID ( COMMA type_var ID )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3794:4: type_var ID ( COMMA type_var ID )*
+ {
+ FOLLOWPUSH(FOLLOW_type_var_in_decl_parameters12071);
+ type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_parametersEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(ID, &FOLLOW_ID_in_decl_parameters12073);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_parametersEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3794:16: ( COMMA type_var ID )*
+
+ for (;;)
+ {
+ int alt336=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt336=1;
+ }
+ break;
+
+ }
+
+ switch (alt336)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3794:18: COMMA type_var ID
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_decl_parameters12077);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_parametersEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_type_var_in_decl_parameters12079);
+ type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_parametersEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(ID, &FOLLOW_ID_in_decl_parameters12081);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_parametersEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop336; /* break out of the loop */
+ break;
+ }
+ }
+ loop336: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledecl_parametersEx; /* Prevent compiler warnings */
+ ruledecl_parametersEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(141, decl_parameters_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end decl_parameters */
+
+/**
+ * $ANTLR start def_type
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3798:1: def_type[ sep::PropertyPart & declProperty , sep::Modifier mdfr ] : 'type' def_type_impl[ declProperty , mdfr ] ;
+ */
+static void
+def_type(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr)
+{
+ ANTLR3_UINT32 def_type_StartIndex;
+
+ /* Initialize rule variables
+ */
+ def_type_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(142)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3800:2: ( 'type' def_type_impl[ declProperty , mdfr ] )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3800:4: 'type' def_type_impl[ declProperty , mdfr ]
+ {
+ MATCHT(398, &FOLLOW_398_in_def_type12099);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_type_impl_in_def_type12102);
+ def_type_impl(ctx, declProperty, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_typeEx; /* Prevent compiler warnings */
+ ruledef_typeEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(142, def_type_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_type */
+
+/**
+ * $ANTLR start def_type_impl
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3803:1: def_type_impl[ sep::PropertyPart & declProperty , sep::Modifier mdfr ] : ( def_type_atom_impl[ declProperty , mdfr ] | LCURLY ( def_type_atom_impl[ declProperty , mdfr ] )+ RCURLY );
+ */
+static void
+def_type_impl(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr)
+{
+ ANTLR3_UINT32 def_type_impl_StartIndex;
+
+ /* Initialize rule variables
+ */
+ def_type_impl_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(143)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3805:2: ( def_type_atom_impl[ declProperty , mdfr ] | LCURLY ( def_type_atom_impl[ declProperty , mdfr ] )+ RCURLY )
+
+ ANTLR3_UINT32 alt338;
+
+ alt338=2;
+
+ switch ( LA(1) )
+ {
+ case ID:
+ case 257:
+ case 258:
+ case 276:
+ case 388:
+ case 404:
+ {
+ alt338=1;
+ }
+ break;
+ case LCURLY:
+ {
+ alt338=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 338;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_type_implEx;
+
+ }
+
+ switch (alt338)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3805:4: def_type_atom_impl[ declProperty , mdfr ]
+ {
+ FOLLOWPUSH(FOLLOW_def_type_atom_impl_in_def_type_impl12117);
+ def_type_atom_impl(ctx, declProperty, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3807:4: LCURLY ( def_type_atom_impl[ declProperty , mdfr ] )+ RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_def_type_impl12124);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3808:4: ( def_type_atom_impl[ declProperty , mdfr ] )+
+ {
+ int cnt337=0;
+
+ for (;;)
+ {
+ int alt337=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ case 257:
+ case 258:
+ case 276:
+ case 388:
+ case 404:
+ {
+ alt337=1;
+ }
+ break;
+
+ }
+
+ switch (alt337)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3808:6: def_type_atom_impl[ declProperty , mdfr ]
+ {
+ FOLLOWPUSH(FOLLOW_def_type_atom_impl_in_def_type_impl12131);
+ def_type_atom_impl(ctx, declProperty, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt337 >= 1 )
+ {
+ goto loop337;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruledef_type_implEx;
+ }
+ cnt337++;
+ }
+ loop337: ; /* Jump to here if this rule does not match */
+ }
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_def_type_impl12140);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_type_implEx; /* Prevent compiler warnings */
+ ruledef_type_implEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(143, def_type_impl_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_type_impl */
+
+/**
+ * $ANTLR start def_type_atom_impl
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3813:1: def_type_atom_impl[ sep::PropertyPart & declProperty , sep::Modifier mdfr ] : (id= ID (btv= base_type_var (dta= def_type_array[ type , STR($id.text->chars) ] )? ( def_typedef_constraint[ aliasT ] | SEMI )? |dtc= def_type_container[ STR($id.text->chars) ] ( def_typedef_constraint[ aliasT ] | SEMI )? |dti= def_type_interval[ STR($id.text->chars) ] SEMI | 'enum' def_enum_impl[declProperty, mdfr, STR($id.text->chars)] | 'union' def_union_impl[declProperty, mdfr, STR($id.text->chars)] | 'choice' def_choice_impl[declProperty, mdfr, STR($id.text->chars)] | ( 'struct' | 'class' ) def_class_structure_impl[declProperty, mdfr, STR($id.text->chars)] ) | def_enum[ declProperty , mdfr ] | def_union[ declProperty , mdfr ] | def_choice[ declProperty , mdfr ] | def_struct[ declProperty , mdfr ] );
+ */
+static void
+def_type_atom_impl(pfmlParser ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr)
+{
+ ANTLR3_UINT32 def_type_atom_impl_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ sep::BF btv;
+ #undef RETURN_TYPE_btv
+ #define RETURN_TYPE_btv sep::BF
+
+ sep::BF dta;
+ #undef RETURN_TYPE_dta
+ #define RETURN_TYPE_dta sep::BF
+
+ sep::BF dtc;
+ #undef RETURN_TYPE_dtc
+ #define RETURN_TYPE_dtc sep::BF
+
+ sep::BF dti;
+ #undef RETURN_TYPE_dti
+ #define RETURN_TYPE_dti sep::BF
+
+ /* Initialize rule variables
+ */
+ def_type_atom_impl_StartIndex = INDEX();
+
+
+
+ sep::DataType * aliasT;
+ sep::BF type;
+ bool isTypedArray = false;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(144)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ id = NULL;
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3820:2: (id= ID (btv= base_type_var (dta= def_type_array[ type , STR($id.text->chars) ] )? ( def_typedef_constraint[ aliasT ] | SEMI )? |dtc= def_type_container[ STR($id.text->chars) ] ( def_typedef_constraint[ aliasT ] | SEMI )? |dti= def_type_interval[ STR($id.text->chars) ] SEMI | 'enum' def_enum_impl[declProperty, mdfr, STR($id.text->chars)] | 'union' def_union_impl[declProperty, mdfr, STR($id.text->chars)] | 'choice' def_choice_impl[declProperty, mdfr, STR($id.text->chars)] | ( 'struct' | 'class' ) def_class_structure_impl[declProperty, mdfr, STR($id.text->chars)] ) | def_enum[ declProperty , mdfr ] | def_union[ declProperty , mdfr ] | def_choice[ declProperty , mdfr ] | def_struct[ declProperty , mdfr ] )
+
+ ANTLR3_UINT32 alt343;
+
+ alt343=5;
+
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt343=1;
+ }
+ break;
+ case 276:
+ {
+ alt343=2;
+ }
+ break;
+ case 404:
+ {
+ alt343=3;
+ }
+ break;
+ case 257:
+ {
+ alt343=4;
+ }
+ break;
+ case 258:
+ case 388:
+ {
+ alt343=5;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 343;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_type_atom_implEx;
+
+ }
+
+ switch (alt343)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3820:4: id= ID (btv= base_type_var (dta= def_type_array[ type , STR($id.text->chars) ] )? ( def_typedef_constraint[ aliasT ] | SEMI )? |dtc= def_type_container[ STR($id.text->chars) ] ( def_typedef_constraint[ aliasT ] | SEMI )? |dti= def_type_interval[ STR($id.text->chars) ] SEMI | 'enum' def_enum_impl[declProperty, mdfr, STR($id.text->chars)] | 'union' def_union_impl[declProperty, mdfr, STR($id.text->chars)] | 'choice' def_choice_impl[declProperty, mdfr, STR($id.text->chars)] | ( 'struct' | 'class' ) def_class_structure_impl[declProperty, mdfr, STR($id.text->chars)] )
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_def_type_atom_impl12161);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3821:4: (btv= base_type_var (dta= def_type_array[ type , STR($id.text->chars) ] )? ( def_typedef_constraint[ aliasT ] | SEMI )? |dtc= def_type_container[ STR($id.text->chars) ] ( def_typedef_constraint[ aliasT ] | SEMI )? |dti= def_type_interval[ STR($id.text->chars) ] SEMI | 'enum' def_enum_impl[declProperty, mdfr, STR($id.text->chars)] | 'union' def_union_impl[declProperty, mdfr, STR($id.text->chars)] | 'choice' def_choice_impl[declProperty, mdfr, STR($id.text->chars)] | ( 'struct' | 'class' ) def_class_structure_impl[declProperty, mdfr, STR($id.text->chars)] )
+ {
+ int alt342=7;
+ switch ( LA(1) )
+ {
+ case ID:
+ case 242:
+ case 245:
+ case 246:
+ case 249:
+ case 254:
+ case 255:
+ case 259:
+ case 261:
+ case 264:
+ case 270:
+ case 271:
+ case 283:
+ case 309:
+ case 310:
+ case 317:
+ case 320:
+ case 333:
+ case 344:
+ case 345:
+ case 346:
+ case 357:
+ case 358:
+ case 360:
+ case 374:
+ case 387:
+ case 392:
+ case 399:
+ case 400:
+ case 401:
+ case 402:
+ case 405:
+ case 407:
+ case 408:
+ case 409:
+ {
+ alt342=1;
+ }
+ break;
+ case 241:
+ case 281:
+ case 315:
+ case 316:
+ case 325:
+ case 326:
+ case 329:
+ case 370:
+ case 373:
+ case 412:
+ {
+ alt342=2;
+ }
+ break;
+ case 311:
+ {
+ alt342=3;
+ }
+ break;
+ case 276:
+ {
+ alt342=4;
+ }
+ break;
+ case 404:
+ {
+ alt342=5;
+ }
+ break;
+ case 257:
+ {
+ alt342=6;
+ }
+ break;
+ case 258:
+ case 388:
+ {
+ alt342=7;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 342;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_type_atom_implEx;
+
+ }
+
+ switch (alt342)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3821:6: btv= base_type_var (dta= def_type_array[ type , STR($id.text->chars) ] )? ( def_typedef_constraint[ aliasT ] | SEMI )?
+ {
+ FOLLOWPUSH(FOLLOW_base_type_var_in_def_type_atom_impl12170);
+ btv=base_type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ type = btv
+ ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3822:6: (dta= def_type_array[ type , STR($id.text->chars) ] )?
+ {
+ int alt339=2;
+ switch ( LA(1) )
+ {
+ case LBRACKET:
+ {
+ alt339=1;
+ }
+ break;
+ }
+
+ switch (alt339)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3822:8: dta= def_type_array[ type , STR($id.text->chars) ]
+ {
+ FOLLOWPUSH(FOLLOW_def_type_array_in_def_type_atom_impl12185);
+ dta=def_type_array(ctx, type, STR((id->getText(id))->chars));
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ type = dta
+ ; isTypedArray = true;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+
+ if( isTypedArray )
+ {
+ aliasT = type.to_ptr< sep::DataType >();
+ aliasT->setModifier( mdfr );
+ declProperty.appendDataType( type );
+ }
+ else
+ {
+ sep::BF td( aliasT = sep::DataType::newAlias(
+ declProperty, STR((id->getText(id))->chars), type) );
+ aliasT->setModifier( mdfr );
+ declProperty.appendDataType( td );
+ }
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3840:9: ( def_typedef_constraint[ aliasT ] | SEMI )?
+ {
+ int alt340=3;
+ switch ( LA(1) )
+ {
+ case LCURLY:
+ {
+ alt340=1;
+ }
+ break;
+ case SEMI:
+ {
+ alt340=2;
+ }
+ break;
+ }
+
+ switch (alt340)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3840:11: def_typedef_constraint[ aliasT ]
+ {
+ FOLLOWPUSH(FOLLOW_def_typedef_constraint_in_def_type_atom_impl12222);
+ def_typedef_constraint(ctx, aliasT);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3840:46: SEMI
+ {
+ MATCHT(SEMI, &FOLLOW_SEMI_in_def_type_atom_impl12227);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3842:6: dtc= def_type_container[ STR($id.text->chars) ] ( def_typedef_constraint[ aliasT ] | SEMI )?
+ {
+ FOLLOWPUSH(FOLLOW_def_type_container_in_def_type_atom_impl12240);
+ dtc=def_type_container(ctx, STR((id->getText(id))->chars));
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ aliasT = dtc
+ .to_ptr< sep::DataType >();
+ aliasT->setModifier( mdfr );
+ declProperty.appendDataType( dtc
+ );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3848:4: ( def_typedef_constraint[ aliasT ] | SEMI )?
+ {
+ int alt341=3;
+ switch ( LA(1) )
+ {
+ case LCURLY:
+ {
+ alt341=1;
+ }
+ break;
+ case SEMI:
+ {
+ alt341=2;
+ }
+ break;
+ }
+
+ switch (alt341)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3848:6: def_typedef_constraint[ aliasT ]
+ {
+ FOLLOWPUSH(FOLLOW_def_typedef_constraint_in_def_type_atom_impl12253);
+ def_typedef_constraint(ctx, aliasT);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3848:41: SEMI
+ {
+ MATCHT(SEMI, &FOLLOW_SEMI_in_def_type_atom_impl12258);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3850:6: dti= def_type_interval[ STR($id.text->chars) ] SEMI
+ {
+ FOLLOWPUSH(FOLLOW_def_type_interval_in_def_type_atom_impl12271);
+ dti=def_type_interval(ctx, STR((id->getText(id))->chars));
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_def_type_atom_impl12274);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ aliasT = dti
+ .to_ptr< sep::DataType >();
+ aliasT->setModifier( mdfr );
+ declProperty.appendDataType( dti
+ );
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3857:6: 'enum' def_enum_impl[declProperty, mdfr, STR($id.text->chars)]
+ {
+ MATCHT(276, &FOLLOW_276_in_def_type_atom_impl12287);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_enum_impl_in_def_type_atom_impl12294);
+ def_enum_impl(ctx, declProperty, mdfr, STR((id->getText(id))->chars));
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3860:6: 'union' def_union_impl[declProperty, mdfr, STR($id.text->chars)]
+ {
+ MATCHT(404, &FOLLOW_404_in_def_type_atom_impl12303);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_union_impl_in_def_type_atom_impl12310);
+ def_union_impl(ctx, declProperty, mdfr, STR((id->getText(id))->chars));
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3863:6: 'choice' def_choice_impl[declProperty, mdfr, STR($id.text->chars)]
+ {
+ MATCHT(257, &FOLLOW_257_in_def_type_atom_impl12319);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_choice_impl_in_def_type_atom_impl12326);
+ def_choice_impl(ctx, declProperty, mdfr, STR((id->getText(id))->chars));
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3866:6: ( 'struct' | 'class' ) def_class_structure_impl[declProperty, mdfr, STR($id.text->chars)]
+ {
+ if ( LA(1) == 258 || LA(1) == 388 )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruledef_type_atom_implEx;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_class_structure_impl_in_def_type_atom_impl12350);
+ def_class_structure_impl(ctx, declProperty, mdfr, STR((id->getText(id))->chars));
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3870:4: def_enum[ declProperty , mdfr ]
+ {
+ FOLLOWPUSH(FOLLOW_def_enum_in_def_type_atom_impl12362);
+ def_enum(ctx, declProperty, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3871:4: def_union[ declProperty , mdfr ]
+ {
+ FOLLOWPUSH(FOLLOW_def_union_in_def_type_atom_impl12370);
+ def_union(ctx, declProperty, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3872:4: def_choice[ declProperty , mdfr ]
+ {
+ FOLLOWPUSH(FOLLOW_def_choice_in_def_type_atom_impl12377);
+ def_choice(ctx, declProperty, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3873:4: def_struct[ declProperty , mdfr ]
+ {
+ FOLLOWPUSH(FOLLOW_def_struct_in_def_type_atom_impl12383);
+ def_struct(ctx, declProperty, mdfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_type_atom_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_type_atom_implEx; /* Prevent compiler warnings */
+ ruledef_type_atom_implEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(144, def_type_atom_impl_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_type_atom_impl */
+
+/**
+ * $ANTLR start def_typedef_constraint
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3877:1: def_typedef_constraint[ sep::DataType * aliasT ] : LCURLY '@constraint' ( routine_single_param[*onConstraintRoutine, aliasT->getTypeSpecifier()] )? (bs= block_statement | '|=>' ce= conditionalExpression SEMI ) RCURLY ;
+ */
+static void
+def_typedef_constraint(pfmlParser ctx, sep::DataType * aliasT)
+{
+ ANTLR3_UINT32 def_typedef_constraint_StartIndex;
+
+ sep::BFCode bs;
+ #undef RETURN_TYPE_bs
+ #define RETURN_TYPE_bs sep::BFCode
+
+ sep::BF ce;
+ #undef RETURN_TYPE_ce
+ #define RETURN_TYPE_ce sep::BF
+
+ /* Initialize rule variables
+ */
+ def_typedef_constraint_StartIndex = INDEX();
+
+
+
+ sep::Routine * onConstraintRoutine = NULL;
+
+ sep::BehavioralPart * aBehavioralpart = aliasT->getUniqBehaviorPart();
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(145)) )
+ {
+ {
+
+ SET_RULE_LOCATION( onConstraintRoutine );
+
+ }
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3888:2: ( LCURLY '@constraint' ( routine_single_param[*onConstraintRoutine, aliasT->getTypeSpecifier()] )? (bs= block_statement | '|=>' ce= conditionalExpression SEMI ) RCURLY )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3888:4: LCURLY '@constraint' ( routine_single_param[*onConstraintRoutine, aliasT->getTypeSpecifier()] )? (bs= block_statement | '|=>' ce= conditionalExpression SEMI ) RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_def_typedef_constraint12405);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_typedef_constraintEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(176, &FOLLOW_176_in_def_typedef_constraint12409);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_typedef_constraintEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ onConstraintRoutine = new sep::Routine(aliasT, "constraint");
+ aliasT->setConstraintRoutine(onConstraintRoutine);
+ aBehavioralpart->saveAnonymousInnerRoutine(onConstraintRoutine);
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3895:6: ( routine_single_param[*onConstraintRoutine, aliasT->getTypeSpecifier()] )?
+ {
+ int alt344=2;
+ switch ( LA(1) )
+ {
+ case LPAREN:
+ {
+ alt344=1;
+ }
+ break;
+ }
+
+ switch (alt344)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3895:8: routine_single_param[*onConstraintRoutine, aliasT->getTypeSpecifier()]
+ {
+ FOLLOWPUSH(FOLLOW_routine_single_param_in_def_typedef_constraint12425);
+ routine_single_param(ctx, *onConstraintRoutine, aliasT->getTypeSpecifier());
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_typedef_constraintEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3896:6: (bs= block_statement | '|=>' ce= conditionalExpression SEMI )
+ {
+ int alt345=2;
+ switch ( LA(1) )
+ {
+ case LCURLY:
+ {
+ alt345=1;
+ }
+ break;
+ case 417:
+ {
+ alt345=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 345;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_typedef_constraintEx;
+
+ }
+
+ switch (alt345)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3896:8: bs= block_statement
+ {
+ FOLLOWPUSH(FOLLOW_block_statement_in_def_typedef_constraint12440);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_typedef_constraintEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ onConstraintRoutine->setCode( bs
+ );
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3897:8: '|=>' ce= conditionalExpression SEMI
+ {
+ MATCHT(417, &FOLLOW_417_in_def_typedef_constraint12452);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_typedef_constraintEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_conditionalExpression_in_def_typedef_constraint12456);
+ ce=conditionalExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_typedef_constraintEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_def_typedef_constraint12458);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_typedef_constraintEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ onConstraintRoutine->setCode( NEW_STMT1(OP(GUARD), ce
+ ) );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_def_typedef_constraint12479);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_typedef_constraintEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_typedef_constraintEx; /* Prevent compiler warnings */
+ ruledef_typedef_constraintEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ SET_RULE_LOCATION( onConstraintRoutine );
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(145, def_typedef_constraint_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_typedef_constraint */
+
+/**
+ * $ANTLR start time_type
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3908:1: time_type returns [ sep::TypeSpecifier bts ] : ( 'time' | 'ctime' | 'dtime' ) ( LT_ pt= time_type_domain ( COMMA sz= integer_constant )? GT |pt= time_type_domain )? ;
+ */
+static sep::TypeSpecifier
+time_type(pfmlParser ctx)
+{
+ sep::TypeSpecifier bts;
+
+ ANTLR3_UINT32 time_type_StartIndex;
+
+ sep::TypeSpecifier pt;
+ #undef RETURN_TYPE_pt
+ #define RETURN_TYPE_pt sep::TypeSpecifier
+
+ sep::avm_size_t sz;
+ #undef RETURN_TYPE_sz
+ #define RETURN_TYPE_sz sep::avm_size_t
+
+ /* Initialize rule variables
+ */
+ time_type_StartIndex = INDEX();
+
+
+
+ int szT = 1;
+ sep::avm_type_specifier_kind_t tsk = sep::TYPE_TIME_SPECIFIER;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(146)) )
+ {
+ {
+ }
+
+
+
+ return bts;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3914:2: ( ( 'time' | 'ctime' | 'dtime' ) ( LT_ pt= time_type_domain ( COMMA sz= integer_constant )? GT |pt= time_type_domain )? )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3914:4: ( 'time' | 'ctime' | 'dtime' ) ( LT_ pt= time_type_domain ( COMMA sz= integer_constant )? GT |pt= time_type_domain )?
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3914:4: ( 'time' | 'ctime' | 'dtime' )
+ {
+ int alt346=3;
+ switch ( LA(1) )
+ {
+ case 392:
+ {
+ alt346=1;
+ }
+ break;
+ case 264:
+ {
+ alt346=2;
+ }
+ break;
+ case 271:
+ {
+ alt346=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return bts;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 346;
+ EXCEPTION->state = 0;
+
+
+ goto ruletime_typeEx;
+
+ }
+
+ switch (alt346)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3914:6: 'time'
+ {
+ MATCHT(392, &FOLLOW_392_in_time_type12505);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::TIME;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3915:6: 'ctime'
+ {
+ MATCHT(264, &FOLLOW_264_in_time_type12516);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::CONTINUOUS_TIME;
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3916:6: 'dtime'
+ {
+ MATCHT(271, &FOLLOW_271_in_time_type12526);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::DISCRETE_TIME;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3918:4: ( LT_ pt= time_type_domain ( COMMA sz= integer_constant )? GT |pt= time_type_domain )?
+ {
+ int alt348=3;
+ switch ( LA(1) )
+ {
+ case LT_:
+ {
+ alt348=1;
+ }
+ break;
+ case 270:
+ case 283:
+ case 309:
+ case 310:
+ case 357:
+ case 358:
+ case 360:
+ case 399:
+ case 400:
+ case 401:
+ case 402:
+ case 407:
+ case 408:
+ case 409:
+ {
+ alt348=2;
+ }
+ break;
+ }
+
+ switch (alt348)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3918:6: LT_ pt= time_type_domain ( COMMA sz= integer_constant )? GT
+ {
+ MATCHT(LT_, &FOLLOW_LT__in_time_type12541);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ tsk = bts
+ .getTypeSpecifierKind();
+ }
+
+
+ FOLLOWPUSH(FOLLOW_time_type_domain_in_time_type12557);
+ pt=time_type_domain(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletime_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts=
+ pt
+ ;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3920:6: ( COMMA sz= integer_constant )?
+ {
+ int alt347=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt347=1;
+ }
+ break;
+ }
+
+ switch (alt347)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3920:8: COMMA sz= integer_constant
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_time_type12578);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_integer_constant_in_time_type12583);
+ sz=integer_constant(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletime_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ szT = sz
+ ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(GT, &FOLLOW_GT_in_time_type12595);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::newClockTime(tsk,
+ bts
+ , szT);
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3924:6: pt= time_type_domain
+ {
+ FOLLOWPUSH(FOLLOW_time_type_domain_in_time_type12611);
+ pt=time_type_domain(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletime_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::newClockTime(tsk,
+ pt
+ , szT);
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruletime_typeEx; /* Prevent compiler warnings */
+ ruletime_typeEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(146, time_type_StartIndex); }
+
+ return bts;
+}
+/* $ANTLR end time_type */
+
+/**
+ * $ANTLR start time_clock_type
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3930:1: time_clock_type returns [ sep::TypeSpecifier bts ] : 'clock' ( LT_ ( 'time' | 'ctime' | 'dtime' |pt= time_type_domain ) ( COMMA sz= integer_constant )? GT | ( 'time' | 'ctime' | 'dtime' |pt= time_type_domain ) ( COMMA sz= integer_constant )? )? ;
+ */
+static sep::TypeSpecifier
+time_clock_type(pfmlParser ctx)
+{
+ sep::TypeSpecifier bts;
+
+ ANTLR3_UINT32 time_clock_type_StartIndex;
+
+ sep::TypeSpecifier pt;
+ #undef RETURN_TYPE_pt
+ #define RETURN_TYPE_pt sep::TypeSpecifier
+
+ sep::avm_size_t sz;
+ #undef RETURN_TYPE_sz
+ #define RETURN_TYPE_sz sep::avm_size_t
+
+ /* Initialize rule variables
+ */
+ time_clock_type_StartIndex = INDEX();
+
+
+
+ int szT = 1;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(147)) )
+ {
+ {
+ }
+
+
+
+ return bts;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3935:2: ( 'clock' ( LT_ ( 'time' | 'ctime' | 'dtime' |pt= time_type_domain ) ( COMMA sz= integer_constant )? GT | ( 'time' | 'ctime' | 'dtime' |pt= time_type_domain ) ( COMMA sz= integer_constant )? )? )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3935:4: 'clock' ( LT_ ( 'time' | 'ctime' | 'dtime' |pt= time_type_domain ) ( COMMA sz= integer_constant )? GT | ( 'time' | 'ctime' | 'dtime' |pt= time_type_domain ) ( COMMA sz= integer_constant )? )?
+ {
+ MATCHT(259, &FOLLOW_259_in_time_clock_type12642);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_clock_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::CLOCK;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3936:4: ( LT_ ( 'time' | 'ctime' | 'dtime' |pt= time_type_domain ) ( COMMA sz= integer_constant )? GT | ( 'time' | 'ctime' | 'dtime' |pt= time_type_domain ) ( COMMA sz= integer_constant )? )?
+ {
+ int alt353=3;
+ switch ( LA(1) )
+ {
+ case LT_:
+ {
+ alt353=1;
+ }
+ break;
+ case 264:
+ case 270:
+ case 271:
+ case 283:
+ case 309:
+ case 310:
+ case 357:
+ case 358:
+ case 360:
+ case 392:
+ case 399:
+ case 400:
+ case 401:
+ case 402:
+ case 407:
+ case 408:
+ case 409:
+ {
+ alt353=2;
+ }
+ break;
+ }
+
+ switch (alt353)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3936:6: LT_ ( 'time' | 'ctime' | 'dtime' |pt= time_type_domain ) ( COMMA sz= integer_constant )? GT
+ {
+ MATCHT(LT_, &FOLLOW_LT__in_time_clock_type12652);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_clock_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3937:3: ( 'time' | 'ctime' | 'dtime' |pt= time_type_domain )
+ {
+ int alt349=4;
+ switch ( LA(1) )
+ {
+ case 392:
+ {
+ alt349=1;
+ }
+ break;
+ case 264:
+ {
+ alt349=2;
+ }
+ break;
+ case 271:
+ {
+ alt349=3;
+ }
+ break;
+ case 270:
+ case 283:
+ case 309:
+ case 310:
+ case 357:
+ case 358:
+ case 360:
+ case 399:
+ case 400:
+ case 401:
+ case 402:
+ case 407:
+ case 408:
+ case 409:
+ {
+ alt349=4;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return bts;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 349;
+ EXCEPTION->state = 0;
+
+
+ goto ruletime_clock_typeEx;
+
+ }
+
+ switch (alt349)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3937:5: 'time'
+ {
+ MATCHT(392, &FOLLOW_392_in_time_clock_type12658);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_clock_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::TIME;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3938:5: 'ctime'
+ {
+ MATCHT(264, &FOLLOW_264_in_time_clock_type12668);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_clock_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::CONTINUOUS_TIME;
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3939:5: 'dtime'
+ {
+ MATCHT(271, &FOLLOW_271_in_time_clock_type12677);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_clock_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::DISCRETE_TIME;
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3940:5: pt= time_type_domain
+ {
+ FOLLOWPUSH(FOLLOW_time_type_domain_in_time_clock_type12688);
+ pt=time_type_domain(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletime_clock_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts=
+ pt
+ ;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3942:3: ( COMMA sz= integer_constant )?
+ {
+ int alt350=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt350=1;
+ }
+ break;
+ }
+
+ switch (alt350)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3942:5: COMMA sz= integer_constant
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_time_clock_type12700);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_clock_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_integer_constant_in_time_clock_type12705);
+ sz=integer_constant(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletime_clock_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ szT = sz
+ ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(GT, &FOLLOW_GT_in_time_clock_type12717);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_clock_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::newClockTime(sep::TYPE_CLOCK_SPECIFIER,
+ bts
+ , szT);
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3946:6: ( 'time' | 'ctime' | 'dtime' |pt= time_type_domain ) ( COMMA sz= integer_constant )?
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3946:6: ( 'time' | 'ctime' | 'dtime' |pt= time_type_domain )
+ {
+ int alt351=4;
+ switch ( LA(1) )
+ {
+ case 392:
+ {
+ alt351=1;
+ }
+ break;
+ case 264:
+ {
+ alt351=2;
+ }
+ break;
+ case 271:
+ {
+ alt351=3;
+ }
+ break;
+ case 270:
+ case 283:
+ case 309:
+ case 310:
+ case 357:
+ case 358:
+ case 360:
+ case 399:
+ case 400:
+ case 401:
+ case 402:
+ case 407:
+ case 408:
+ case 409:
+ {
+ alt351=4;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return bts;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 351;
+ EXCEPTION->state = 0;
+
+
+ goto ruletime_clock_typeEx;
+
+ }
+
+ switch (alt351)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3946:8: 'time'
+ {
+ MATCHT(392, &FOLLOW_392_in_time_clock_type12733);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_clock_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::TIME;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3947:5: 'ctime'
+ {
+ MATCHT(264, &FOLLOW_264_in_time_clock_type12743);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_clock_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::CONTINUOUS_TIME;
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3948:5: 'dtime'
+ {
+ MATCHT(271, &FOLLOW_271_in_time_clock_type12752);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_clock_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::DISCRETE_TIME;
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3949:5: pt= time_type_domain
+ {
+ FOLLOWPUSH(FOLLOW_time_type_domain_in_time_clock_type12763);
+ pt=time_type_domain(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletime_clock_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bts=
+ pt
+ ;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3951:3: ( COMMA sz= integer_constant )?
+ {
+ int alt352=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ {
+ int LA352_1 = LA(2);
+ if ( (synpred609_fml(ctx)))
+ {
+ alt352=1;
+ }
+ }
+ }
+ break;
+ }
+
+ switch (alt352)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3951:5: COMMA sz= integer_constant
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_time_clock_type12775);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_clock_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_integer_constant_in_time_clock_type12780);
+ sz=integer_constant(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletime_clock_typeEx;
+ }
+ if (HASFAILED())
+ {
+ return bts;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ szT = sz
+ ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+ bts= sep::TypeManager::newClockTime(sep::TYPE_CLOCK_SPECIFIER,
+ bts
+ , szT);
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruletime_clock_typeEx; /* Prevent compiler warnings */
+ ruletime_clock_typeEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(147, time_clock_type_StartIndex); }
+
+ return bts;
+}
+/* $ANTLR end time_clock_type */
+
+/**
+ * $ANTLR start time_type_domain
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3957:1: time_type_domain returns [ sep::TypeSpecifier type ] : ( ( 'integer' | 'int' ) ( LT_ n= integer_constant GT )? | ( 'uinteger' | 'uint' ) ( LT_ n= integer_constant GT )? | ( 'rational' | 'rat' ) | ( 'urational' | 'urat' ) | 'float' | 'ufloat' | 'double' | 'udouble' | 'real' | 'ureal' );
+ */
+static sep::TypeSpecifier
+time_type_domain(pfmlParser ctx)
+{
+ sep::TypeSpecifier type;
+
+ ANTLR3_UINT32 time_type_domain_StartIndex;
+
+ sep::avm_size_t n;
+ #undef RETURN_TYPE_n
+ #define RETURN_TYPE_n sep::avm_size_t
+
+ /* Initialize rule variables
+ */
+ time_type_domain_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(148)) )
+ {
+ {
+ }
+
+
+
+ return type;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3959:2: ( ( 'integer' | 'int' ) ( LT_ n= integer_constant GT )? | ( 'uinteger' | 'uint' ) ( LT_ n= integer_constant GT )? | ( 'rational' | 'rat' ) | ( 'urational' | 'urat' ) | 'float' | 'ufloat' | 'double' | 'udouble' | 'real' | 'ureal' )
+
+ ANTLR3_UINT32 alt356;
+
+ alt356=10;
+
+ switch ( LA(1) )
+ {
+ case 309:
+ case 310:
+ {
+ alt356=1;
+ }
+ break;
+ case 401:
+ case 402:
+ {
+ alt356=2;
+ }
+ break;
+ case 357:
+ case 358:
+ {
+ alt356=3;
+ }
+ break;
+ case 407:
+ case 408:
+ {
+ alt356=4;
+ }
+ break;
+ case 283:
+ {
+ alt356=5;
+ }
+ break;
+ case 400:
+ {
+ alt356=6;
+ }
+ break;
+ case 270:
+ {
+ alt356=7;
+ }
+ break;
+ case 399:
+ {
+ alt356=8;
+ }
+ break;
+ case 360:
+ {
+ alt356=9;
+ }
+ break;
+ case 409:
+ {
+ alt356=10;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return type;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 356;
+ EXCEPTION->state = 0;
+
+
+ goto ruletime_type_domainEx;
+
+ }
+
+ switch (alt356)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3959:4: ( 'integer' | 'int' ) ( LT_ n= integer_constant GT )?
+ {
+ if ( ((LA(1) >= 309) && (LA(1) <= 310)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return type;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruletime_type_domainEx;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ type= sep::TypeManager::INTEGER;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3960:4: ( LT_ n= integer_constant GT )?
+ {
+ int alt354=2;
+ switch ( LA(1) )
+ {
+ case LT_:
+ {
+ alt354=1;
+ }
+ break;
+ }
+
+ switch (alt354)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3960:6: LT_ n= integer_constant GT
+ {
+ MATCHT(LT_, &FOLLOW_LT__in_time_type_domain12834);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_type_domainEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_integer_constant_in_time_type_domain12843);
+ n=integer_constant(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletime_type_domainEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ type= sep::TypeManager::getTypeInteger(
+ n
+ );
+
+ }
+
+
+ MATCHT(GT, &FOLLOW_GT_in_time_type_domain12856);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_type_domainEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3965:4: ( 'uinteger' | 'uint' ) ( LT_ n= integer_constant GT )?
+ {
+ if ( ((LA(1) >= 401) && (LA(1) <= 402)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return type;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruletime_type_domainEx;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ type= sep::TypeManager::UINTEGER;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3966:4: ( LT_ n= integer_constant GT )?
+ {
+ int alt355=2;
+ switch ( LA(1) )
+ {
+ case LT_:
+ {
+ alt355=1;
+ }
+ break;
+ }
+
+ switch (alt355)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3966:6: LT_ n= integer_constant GT
+ {
+ MATCHT(LT_, &FOLLOW_LT__in_time_type_domain12885);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_type_domainEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_integer_constant_in_time_type_domain12894);
+ n=integer_constant(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletime_type_domainEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ type= sep::TypeManager::getTypeUInteger(
+ n
+ );
+
+ }
+
+
+ MATCHT(GT, &FOLLOW_GT_in_time_type_domain12907);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_type_domainEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3971:4: ( 'rational' | 'rat' )
+ {
+ if ( ((LA(1) >= 357) && (LA(1) <= 358)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return type;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruletime_type_domainEx;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ type= sep::TypeManager::RATIONAL;
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3972:4: ( 'urational' | 'urat' )
+ {
+ if ( ((LA(1) >= 407) && (LA(1) <= 408)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return type;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruletime_type_domainEx;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ type= sep::TypeManager::URATIONAL;
+
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3974:4: 'float'
+ {
+ MATCHT(283, &FOLLOW_283_in_time_type_domain12951);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_type_domainEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ type= sep::TypeManager::FLOAT;
+
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3975:4: 'ufloat'
+ {
+ MATCHT(400, &FOLLOW_400_in_time_type_domain12963);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_type_domainEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ type= sep::TypeManager::UFLOAT;
+
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3977:4: 'double'
+ {
+ MATCHT(270, &FOLLOW_270_in_time_type_domain12975);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_type_domainEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ type= sep::TypeManager::DOUBLE;
+
+ }
+
+
+ }
+ break;
+ case 8:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3978:4: 'udouble'
+ {
+ MATCHT(399, &FOLLOW_399_in_time_type_domain12986);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_type_domainEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ type= sep::TypeManager::UDOUBLE;
+
+ }
+
+
+ }
+ break;
+ case 9:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3980:4: 'real'
+ {
+ MATCHT(360, &FOLLOW_360_in_time_type_domain12997);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_type_domainEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ type= sep::TypeManager::REAL;
+
+ }
+
+
+ }
+ break;
+ case 10:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3981:4: 'ureal'
+ {
+ MATCHT(409, &FOLLOW_409_in_time_type_domain13010);
+ if (HASEXCEPTION())
+ {
+ goto ruletime_type_domainEx;
+ }
+ if (HASFAILED())
+ {
+ return type;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ type= sep::TypeManager::UREAL;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruletime_type_domainEx; /* Prevent compiler warnings */
+ ruletime_type_domainEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(148, time_type_domain_StartIndex); }
+
+ return type;
+}
+/* $ANTLR end time_type_domain */
+
+/**
+ * $ANTLR start section_model_of_computation
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4045:1: section_model_of_computation[ sep::Machine * container ] : '@moc:' ;
+ */
+static void
+section_model_of_computation(pfmlParser ctx, sep::Machine * container)
+{
+ ANTLR3_UINT32 section_model_of_computation_StartIndex;
+
+ /* Initialize rule variables
+ */
+ section_model_of_computation_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(149)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4046:2: ( '@moc:' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4046:4: '@moc:'
+ {
+ MATCHT(202, &FOLLOW_202_in_section_model_of_computation13042);
+ if (HASEXCEPTION())
+ {
+ goto rulesection_model_of_computationEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulesection_model_of_computationEx; /* Prevent compiler warnings */
+ rulesection_model_of_computationEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(149, section_model_of_computation_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end section_model_of_computation */
+
+/**
+ * $ANTLR start section_routine
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4054:1: section_routine[ sep::Machine * container ] : ( '@routine:' | '@macro:' ) ( def_routine_model[ container , mdfr , spcfr ] )* ;
+ */
+static void
+section_routine(pfmlParser ctx, sep::Machine * container)
+{
+ ANTLR3_UINT32 section_routine_StartIndex;
+
+ /* Initialize rule variables
+ */
+ section_routine_StartIndex = INDEX();
+
+
+
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr( sep::Specifier::DESIGN_MODEL_KIND );
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(150)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4060:2: ( ( '@routine:' | '@macro:' ) ( def_routine_model[ container , mdfr , spcfr ] )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4060:4: ( '@routine:' | '@macro:' ) ( def_routine_model[ container , mdfr , spcfr ] )*
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4060:4: ( '@routine:' | '@macro:' )
+ {
+ int alt357=2;
+ switch ( LA(1) )
+ {
+ case 222:
+ {
+ alt357=1;
+ }
+ break;
+ case 201:
+ {
+ alt357=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 357;
+ EXCEPTION->state = 0;
+
+
+ goto rulesection_routineEx;
+
+ }
+
+ switch (alt357)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4060:6: '@routine:'
+ {
+ MATCHT(222, &FOLLOW_222_in_section_routine13066);
+ if (HASEXCEPTION())
+ {
+ goto rulesection_routineEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4061:6: '@macro:'
+ {
+ MATCHT(201, &FOLLOW_201_in_section_routine13073);
+ if (HASEXCEPTION())
+ {
+ goto rulesection_routineEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setNatureMacro();
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4063:4: ( def_routine_model[ container , mdfr , spcfr ] )*
+
+ for (;;)
+ {
+ int alt358=2;
+ switch ( LA(1) )
+ {
+ case 318:
+ case 367:
+ {
+ alt358=1;
+ }
+ break;
+
+ }
+
+ switch (alt358)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4063:6: def_routine_model[ container , mdfr , spcfr ]
+ {
+ FOLLOWPUSH(FOLLOW_def_routine_model_in_section_routine13088);
+ def_routine_model(ctx, container, mdfr, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_routineEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop358; /* break out of the loop */
+ break;
+ }
+ }
+ loop358: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulesection_routineEx; /* Prevent compiler warnings */
+ rulesection_routineEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(150, section_routine_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end section_routine */
+
+/**
+ * $ANTLR start def_routine_model
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4066:1: def_routine_model[ sep::Machine * container ,\n\t\tsep::Modifier mdfr , sep::Specifier spcfr ] : ( 'routine' | 'macro' ( 'routine' )? ) def_routine_model_impl[ container , mdfr , spcfr ] ;
+ */
+static void
+def_routine_model(pfmlParser ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr)
+{
+ ANTLR3_UINT32 def_routine_model_StartIndex;
+
+ /* Initialize rule variables
+ */
+ def_routine_model_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(151)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4069:2: ( ( 'routine' | 'macro' ( 'routine' )? ) def_routine_model_impl[ container , mdfr , spcfr ] )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4069:4: ( 'routine' | 'macro' ( 'routine' )? ) def_routine_model_impl[ container , mdfr , spcfr ]
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4069:4: ( 'routine' | 'macro' ( 'routine' )? )
+ {
+ int alt360=2;
+ switch ( LA(1) )
+ {
+ case 367:
+ {
+ alt360=1;
+ }
+ break;
+ case 318:
+ {
+ alt360=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 360;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_routine_modelEx;
+
+ }
+
+ switch (alt360)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4069:5: 'routine'
+ {
+ MATCHT(367, &FOLLOW_367_in_def_routine_model13107);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_modelEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4070:6: 'macro' ( 'routine' )?
+ {
+ MATCHT(318, &FOLLOW_318_in_def_routine_model13114);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_modelEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.setNatureMacro();
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4071:6: ( 'routine' )?
+ {
+ int alt359=2;
+ switch ( LA(1) )
+ {
+ case 367:
+ {
+ alt359=1;
+ }
+ break;
+ }
+
+ switch (alt359)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4071:8: 'routine'
+ {
+ MATCHT(367, &FOLLOW_367_in_def_routine_model13127);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_modelEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_def_routine_model_impl_in_def_routine_model13141);
+ def_routine_model_impl(ctx, container, mdfr, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_modelEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_routine_modelEx; /* Prevent compiler warnings */
+ ruledef_routine_modelEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(151, def_routine_model_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_routine_model */
+
+/**
+ * $ANTLR start def_routine_model_impl
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4077:1: def_routine_model_impl[ sep::Machine * container ,\n\t\tsep::Modifier mdfr , sep::Specifier spcfr ] : ID ( def_routine_parameters[ *_CPR_ ] )? ( ( '-->' | 'returns:' ) def_routine_returns[ *_CPR_ ] )? bs= block_statement ;
+ */
+static void
+def_routine_model_impl(pfmlParser ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr)
+{
+ ANTLR3_UINT32 def_routine_model_impl_StartIndex;
+
+ pANTLR3_COMMON_TOKEN ID10;
+ sep::BFCode bs;
+ #undef RETURN_TYPE_bs
+ #define RETURN_TYPE_bs sep::BFCode
+
+ /* Initialize rule variables
+ */
+ def_routine_model_impl_StartIndex = INDEX();
+
+
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(152)) )
+ {
+ {
+
+ SET_RULE_LOCATION( _CPR_ );
+
+ POP_CTX;
+
+ }
+ {
+ }
+
+
+
+ return ;
+ }
+
+ ID10 = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4088:2: ( ID ( def_routine_parameters[ *_CPR_ ] )? ( ( '-->' | 'returns:' ) def_routine_returns[ *_CPR_ ] )? bs= block_statement )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4088:4: ID ( def_routine_parameters[ *_CPR_ ] )? ( ( '-->' | 'returns:' ) def_routine_returns[ *_CPR_ ] )? bs= block_statement
+ {
+ ID10 = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_def_routine_model_impl13165);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_model_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ PUSH_CTX_CPR( sep::Routine::newDefine(
+ container, mdfr, spcfr, STR((ID10->getText(ID10))->chars)) );
+
+ container->saveOwnedElement( _CPR_ );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4096:4: ( def_routine_parameters[ *_CPR_ ] )?
+ {
+ int alt361=2;
+ switch ( LA(1) )
+ {
+ case LPAREN:
+ {
+ alt361=1;
+ }
+ break;
+ }
+
+ switch (alt361)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4096:6: def_routine_parameters[ *_CPR_ ]
+ {
+ FOLLOWPUSH(FOLLOW_def_routine_parameters_in_def_routine_model_impl13178);
+ def_routine_parameters(ctx, *_CPR_);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_model_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4097:4: ( ( '-->' | 'returns:' ) def_routine_returns[ *_CPR_ ] )?
+ {
+ int alt362=2;
+ switch ( LA(1) )
+ {
+ case 163:
+ case 365:
+ {
+ alt362=1;
+ }
+ break;
+ }
+
+ switch (alt362)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4097:6: ( '-->' | 'returns:' ) def_routine_returns[ *_CPR_ ]
+ {
+ if ( LA(1) == 163 || LA(1) == 365 )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruledef_routine_model_implEx;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_routine_returns_in_def_routine_model_impl13200);
+ def_routine_returns(ctx, *_CPR_);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_model_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_def_routine_model_impl13212);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_model_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ _CPR_->setCode(bs
+ );
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_routine_model_implEx; /* Prevent compiler warnings */
+ ruledef_routine_model_implEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ SET_RULE_LOCATION( _CPR_ );
+
+ POP_CTX;
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(152, def_routine_model_impl_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_routine_model_impl */
+
+/**
+ * $ANTLR start def_routine_parameters
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4103:1: def_routine_parameters[ sep::Routine & routine ] : LPAREN ( def_routine_param_atom[ routine , offset++ ] ( COMMA def_routine_param_atom[ routine , offset++ ] )* )? RPAREN ;
+ */
+static void
+def_routine_parameters(pfmlParser ctx, sep::Routine & routine)
+{
+ ANTLR3_UINT32 def_routine_parameters_StartIndex;
+
+ /* Initialize rule variables
+ */
+ def_routine_parameters_StartIndex = INDEX();
+
+
+
+ sep::avm_size_t offset = 0;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(153)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4107:2: ( LPAREN ( def_routine_param_atom[ routine , offset++ ] ( COMMA def_routine_param_atom[ routine , offset++ ] )* )? RPAREN )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4107:4: LPAREN ( def_routine_param_atom[ routine , offset++ ] ( COMMA def_routine_param_atom[ routine , offset++ ] )* )? RPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_def_routine_parameters13233);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_parametersEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4108:7: ( def_routine_param_atom[ routine , offset++ ] ( COMMA def_routine_param_atom[ routine , offset++ ] )* )?
+ {
+ int alt364=2;
+ switch ( LA(1) )
+ {
+ case ASSIGN_REF:
+ case BAND:
+ case ID:
+ case LTE:
+ case 164:
+ case 166:
+ case 241:
+ case 242:
+ case 243:
+ case 245:
+ case 246:
+ case 249:
+ case 254:
+ case 255:
+ case 259:
+ case 261:
+ case 262:
+ case 264:
+ case 270:
+ case 271:
+ case 281:
+ case 282:
+ case 283:
+ case 295:
+ case 298:
+ case 305:
+ case 309:
+ case 310:
+ case 311:
+ case 315:
+ case 316:
+ case 317:
+ case 318:
+ case 320:
+ case 325:
+ case 326:
+ case 329:
+ case 333:
+ case 335:
+ case 341:
+ case 344:
+ case 345:
+ case 346:
+ case 357:
+ case 358:
+ case 360:
+ case 361:
+ case 364:
+ case 370:
+ case 373:
+ case 374:
+ case 387:
+ case 392:
+ case 399:
+ case 400:
+ case 401:
+ case 402:
+ case 405:
+ case 407:
+ case 408:
+ case 409:
+ case 412:
+ {
+ alt364=1;
+ }
+ break;
+ }
+
+ switch (alt364)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4108:9: def_routine_param_atom[ routine , offset++ ] ( COMMA def_routine_param_atom[ routine , offset++ ] )*
+ {
+ FOLLOWPUSH(FOLLOW_def_routine_param_atom_in_def_routine_parameters13243);
+ def_routine_param_atom(ctx, routine, offset++);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_parametersEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4110:7: ( COMMA def_routine_param_atom[ routine , offset++ ] )*
+
+ for (;;)
+ {
+ int alt363=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt363=1;
+ }
+ break;
+
+ }
+
+ switch (alt363)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4110:9: COMMA def_routine_param_atom[ routine , offset++ ]
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_def_routine_parameters13255);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_parametersEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_routine_param_atom_in_def_routine_parameters13257);
+ def_routine_param_atom(ctx, routine, offset++);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_parametersEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop363; /* break out of the loop */
+ break;
+ }
+ }
+ loop363: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_def_routine_parameters13269);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_parametersEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_routine_parametersEx; /* Prevent compiler warnings */
+ ruledef_routine_parametersEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(153, def_routine_parameters_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_routine_parameters */
+
+/**
+ * $ANTLR start def_routine_param_atom
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4114:1: def_routine_param_atom[ sep::Routine & routine , sep::avm_size_t offset ] : ( ( ( modifier_param )? type_var ID )=> (m= modifier_param )? tv= type_var id= ID |id= ID ) (iv= initial_value )? ;
+ */
+static void
+def_routine_param_atom(pfmlParser ctx, sep::Routine & routine, sep::avm_size_t offset)
+{
+ ANTLR3_UINT32 def_routine_param_atom_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ sep::Modifier m;
+ #undef RETURN_TYPE_m
+ #define RETURN_TYPE_m sep::Modifier
+
+ sep::BF tv;
+ #undef RETURN_TYPE_tv
+ #define RETURN_TYPE_tv sep::BF
+
+ sep::BF iv;
+ #undef RETURN_TYPE_iv
+ #define RETURN_TYPE_iv sep::BF
+
+ /* Initialize rule variables
+ */
+ def_routine_param_atom_StartIndex = INDEX();
+
+
+
+ sep::BF variable;
+ sep::Variable * param;
+ sep::Machine * machine = routine.getContainerMachine();
+ sep::BF paramT = sep::TypeManager::UNIVERSAL;
+ sep::Modifier mdfr = sep::Modifier::PROPERTY_PARAMETER_MODIFIER;
+ mdfr.addFeatureKind( sep::Modifier::FEATURE_TRANSIENT_KIND );
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(154)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ id = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4124:2: ( ( ( ( modifier_param )? type_var ID )=> (m= modifier_param )? tv= type_var id= ID |id= ID ) (iv= initial_value )? )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4124:4: ( ( ( modifier_param )? type_var ID )=> (m= modifier_param )? tv= type_var id= ID |id= ID ) (iv= initial_value )?
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4124:4: ( ( ( modifier_param )? type_var ID )=> (m= modifier_param )? tv= type_var id= ID |id= ID )
+ {
+ int alt366=2;
+ {
+ int LA366_0 = LA(1);
+ if ( (synpred636_fml(ctx)) && (LA366_0 == 164 || LA366_0 == 295 || LA366_0 == 305))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == ASSIGN_REF || LA366_0 == 335 || LA366_0 == 341))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 166 || LA366_0 == 298))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == LTE || LA366_0 == 364))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 282))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 262))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == BAND || LA366_0 == 361))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 318))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 243))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (((LA366_0 >= 245) && (LA366_0 <= 246))))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (((LA366_0 >= 309) && (LA366_0 <= 310))))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (((LA366_0 >= 401) && (LA366_0 <= 402))))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (((LA366_0 >= 345) && (LA366_0 <= 346))))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (((LA366_0 >= 357) && (LA366_0 <= 358))))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (((LA366_0 >= 407) && (LA366_0 <= 408))))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 283))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 400))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 270))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 399))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 360))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 409))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 259))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 392))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 264))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 271))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 254))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 255))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 387))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 333))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 242))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 344))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 249))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 320))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 374))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 261))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 317))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 405))
+ {
+ alt366=1;
+ }
+ else if ( (LA366_0 == ID))
+ {
+ {
+ int LA366_38 = LA(2);
+ if ( (synpred636_fml(ctx)))
+ {
+ alt366=1;
+ }
+ else if ( (ANTLR3_TRUE))
+ {
+ alt366=2;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 366;
+ EXCEPTION->state = 38;
+
+
+ goto ruledef_routine_param_atomEx;
+
+ }
+ }
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 241))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 412))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 370))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 316))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 281))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 315))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 325))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 326))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 373))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 329))
+ {
+ alt366=1;
+ }
+ else if ( (synpred636_fml(ctx)) && (LA366_0 == 311))
+ {
+ alt366=1;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 366;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_routine_param_atomEx;
+
+ }
+ }
+ switch (alt366)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4124:6: ( ( modifier_param )? type_var ID )=> (m= modifier_param )? tv= type_var id= ID
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4125:6: (m= modifier_param )?
+ {
+ int alt365=2;
+ switch ( LA(1) )
+ {
+ case ASSIGN_REF:
+ case BAND:
+ case LTE:
+ case 164:
+ case 166:
+ case 243:
+ case 262:
+ case 282:
+ case 295:
+ case 298:
+ case 305:
+ case 318:
+ case 335:
+ case 341:
+ case 361:
+ case 364:
+ {
+ alt365=1;
+ }
+ break;
+ }
+
+ switch (alt365)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4125:8: m= modifier_param
+ {
+ FOLLOWPUSH(FOLLOW_modifier_param_in_def_routine_param_atom13312);
+ m=modifier_param(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_param_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.override_ifdef( m
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_type_var_in_def_routine_param_atom13326);
+ tv=type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_param_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ paramT = tv
+ ;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_def_routine_param_atom13333);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_param_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4128:6: id= ID
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_def_routine_param_atom13343);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_param_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ variable = sep::ParserUtil::getVariable(STR((id->getText(id))->chars) , 1);
+ if( variable.invalid() )
+ {
+ sep::ParserUtil::avm_syntax_error(
+ "def_routine_param_atom:> " + routine.str(), (id->getLine(id)) )
+ << "Unfound machine param's variable < "
+ << STR((id->getText(id))->chars)
+ << " > in routine header < " << " >"
+ << sep::ParserUtil::SYNTAX_ERROR_EOL;
+ }
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+
+ if( variable.valid() )
+ {
+ routine.saveParameter( param = new sep::Variable( &routine,
+ sep::Modifier::PROPERTY_MACRO_MODIFIER,
+ variable.to_ptr< sep::Variable >()->getType(),
+ STR((id->getText(id))->chars)) );
+ param->setOffset( offset );
+ param->setBinding( variable );
+ }
+ else
+ {
+ param = new sep::Variable(&routine,
+ mdfr,
+ tv
+ , STR((id->getText(id))->chars));
+ param->setOffset( offset );
+
+ // Only for Routine design as PROTOTYPE a.k.a. primitive routine
+ if( routine.getSpecifier().isDesignPrototypeStatic() )
+ {
+ routine.appendParameter(
+ machine->getPropertyPart().saveOwnedVariable( param ) );
+ }
+ else
+ {
+ routine.saveParameter( param );
+ }
+ }
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4170:4: (iv= initial_value )?
+ {
+ int alt367=2;
+ switch ( LA(1) )
+ {
+ case ASSIGN:
+ case LPAREN:
+ {
+ alt367=1;
+ }
+ break;
+ }
+
+ switch (alt367)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4170:6: iv= initial_value
+ {
+ FOLLOWPUSH(FOLLOW_initial_value_in_def_routine_param_atom13369);
+ iv=initial_value(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_param_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ param->setValue(iv
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_routine_param_atomEx; /* Prevent compiler warnings */
+ ruledef_routine_param_atomEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(154, def_routine_param_atom_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_routine_param_atom */
+
+/**
+ * $ANTLR start def_routine_returns
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4174:1: def_routine_returns[ sep::Routine & routine ] : ( LPAREN def_routine_returns_atom[ routine , offset++ ] ( COMMA def_routine_returns_atom[ routine , offset++ ] )* RPAREN |tv= type_var (iv= initial_value )? );
+ */
+static void
+def_routine_returns(pfmlParser ctx, sep::Routine & routine)
+{
+ ANTLR3_UINT32 def_routine_returns_StartIndex;
+
+ sep::BF tv;
+ #undef RETURN_TYPE_tv
+ #define RETURN_TYPE_tv sep::BF
+
+ sep::BF iv;
+ #undef RETURN_TYPE_iv
+ #define RETURN_TYPE_iv sep::BF
+
+ /* Initialize rule variables
+ */
+ def_routine_returns_StartIndex = INDEX();
+
+
+
+ sep::BF value;
+ sep::avm_size_t offset = 0;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(155)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4179:2: ( LPAREN def_routine_returns_atom[ routine , offset++ ] ( COMMA def_routine_returns_atom[ routine , offset++ ] )* RPAREN |tv= type_var (iv= initial_value )? )
+
+ ANTLR3_UINT32 alt370;
+
+ alt370=2;
+
+ switch ( LA(1) )
+ {
+ case LPAREN:
+ {
+ alt370=1;
+ }
+ break;
+ case ID:
+ case 241:
+ case 242:
+ case 245:
+ case 246:
+ case 249:
+ case 254:
+ case 255:
+ case 259:
+ case 261:
+ case 264:
+ case 270:
+ case 271:
+ case 281:
+ case 283:
+ case 309:
+ case 310:
+ case 311:
+ case 315:
+ case 316:
+ case 317:
+ case 320:
+ case 325:
+ case 326:
+ case 329:
+ case 333:
+ case 344:
+ case 345:
+ case 346:
+ case 357:
+ case 358:
+ case 360:
+ case 370:
+ case 373:
+ case 374:
+ case 387:
+ case 392:
+ case 399:
+ case 400:
+ case 401:
+ case 402:
+ case 405:
+ case 407:
+ case 408:
+ case 409:
+ case 412:
+ {
+ alt370=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 370;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_routine_returnsEx;
+
+ }
+
+ switch (alt370)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4179:4: LPAREN def_routine_returns_atom[ routine , offset++ ] ( COMMA def_routine_returns_atom[ routine , offset++ ] )* RPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_def_routine_returns13393);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_routine_returns_atom_in_def_routine_returns13401);
+ def_routine_returns_atom(ctx, routine, offset++);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4182:7: ( COMMA def_routine_returns_atom[ routine , offset++ ] )*
+
+ for (;;)
+ {
+ int alt368=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt368=1;
+ }
+ break;
+
+ }
+
+ switch (alt368)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4182:9: COMMA def_routine_returns_atom[ routine , offset++ ]
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_def_routine_returns13413);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_routine_returns_atom_in_def_routine_returns13415);
+ def_routine_returns_atom(ctx, routine, offset++);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop368; /* break out of the loop */
+ break;
+ }
+ }
+ loop368: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_def_routine_returns13424);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4185:4: tv= type_var (iv= initial_value )?
+ {
+ FOLLOWPUSH(FOLLOW_type_var_in_def_routine_returns13432);
+ tv=type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4185:16: (iv= initial_value )?
+ {
+ int alt369=2;
+ switch ( LA(1) )
+ {
+ case ASSIGN:
+ case LPAREN:
+ {
+ alt369=1;
+ }
+ break;
+ }
+
+ switch (alt369)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4185:18: iv= initial_value
+ {
+ FOLLOWPUSH(FOLLOW_initial_value_in_def_routine_returns13438);
+ iv=initial_value(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ value = iv
+ ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+
+ sep::Variable * variable;
+ routine.saveReturn( variable = new sep::Variable( &routine,
+ sep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER,
+ tv
+ , "#0", value) );
+ variable->setOffset( offset );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_routine_returnsEx; /* Prevent compiler warnings */
+ ruledef_routine_returnsEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(155, def_routine_returns_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_routine_returns */
+
+/**
+ * $ANTLR start def_routine_returns_atom
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4196:1: def_routine_returns_atom[ sep::Routine & routine , sep::avm_size_t offset ] : ( ( ( modifier_param )? type_var ID )=> (m= modifier_param )? tv= type_var id= ID |id= ID ) (iv= initial_value )? ;
+ */
+static void
+def_routine_returns_atom(pfmlParser ctx, sep::Routine & routine, sep::avm_size_t offset)
+{
+ ANTLR3_UINT32 def_routine_returns_atom_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ sep::Modifier m;
+ #undef RETURN_TYPE_m
+ #define RETURN_TYPE_m sep::Modifier
+
+ sep::BF tv;
+ #undef RETURN_TYPE_tv
+ #define RETURN_TYPE_tv sep::BF
+
+ sep::BF iv;
+ #undef RETURN_TYPE_iv
+ #define RETURN_TYPE_iv sep::BF
+
+ /* Initialize rule variables
+ */
+ def_routine_returns_atom_StartIndex = INDEX();
+
+
+
+ sep::BF variable;
+ sep::Variable * param;
+ sep::Machine * machine = routine.getContainerMachine();
+ sep::BF paramT = sep::TypeManager::UNIVERSAL;
+ sep::Modifier mdfr = sep::Modifier::PROPERTY_RETURN_PARAMETER_MODIFIER;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(156)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ id = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4205:2: ( ( ( ( modifier_param )? type_var ID )=> (m= modifier_param )? tv= type_var id= ID |id= ID ) (iv= initial_value )? )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4205:4: ( ( ( modifier_param )? type_var ID )=> (m= modifier_param )? tv= type_var id= ID |id= ID ) (iv= initial_value )?
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4205:4: ( ( ( modifier_param )? type_var ID )=> (m= modifier_param )? tv= type_var id= ID |id= ID )
+ {
+ int alt372=2;
+ {
+ int LA372_0 = LA(1);
+ if ( (synpred643_fml(ctx)) && (LA372_0 == 164 || LA372_0 == 295 || LA372_0 == 305))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == ASSIGN_REF || LA372_0 == 335 || LA372_0 == 341))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 166 || LA372_0 == 298))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == LTE || LA372_0 == 364))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 282))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 262))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == BAND || LA372_0 == 361))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 318))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 243))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (((LA372_0 >= 245) && (LA372_0 <= 246))))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (((LA372_0 >= 309) && (LA372_0 <= 310))))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (((LA372_0 >= 401) && (LA372_0 <= 402))))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (((LA372_0 >= 345) && (LA372_0 <= 346))))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (((LA372_0 >= 357) && (LA372_0 <= 358))))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (((LA372_0 >= 407) && (LA372_0 <= 408))))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 283))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 400))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 270))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 399))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 360))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 409))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 259))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 392))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 264))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 271))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 254))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 255))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 387))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 333))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 242))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 344))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 249))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 320))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 374))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 261))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 317))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 405))
+ {
+ alt372=1;
+ }
+ else if ( (LA372_0 == ID))
+ {
+ {
+ int LA372_38 = LA(2);
+ if ( (synpred643_fml(ctx)))
+ {
+ alt372=1;
+ }
+ else if ( (ANTLR3_TRUE))
+ {
+ alt372=2;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 372;
+ EXCEPTION->state = 38;
+
+
+ goto ruledef_routine_returns_atomEx;
+
+ }
+ }
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 241))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 412))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 370))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 316))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 281))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 315))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 325))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 326))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 373))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 329))
+ {
+ alt372=1;
+ }
+ else if ( (synpred643_fml(ctx)) && (LA372_0 == 311))
+ {
+ alt372=1;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 372;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_routine_returns_atomEx;
+
+ }
+ }
+ switch (alt372)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4205:6: ( ( modifier_param )? type_var ID )=> (m= modifier_param )? tv= type_var id= ID
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4206:6: (m= modifier_param )?
+ {
+ int alt371=2;
+ switch ( LA(1) )
+ {
+ case ASSIGN_REF:
+ case BAND:
+ case LTE:
+ case 164:
+ case 166:
+ case 243:
+ case 262:
+ case 282:
+ case 295:
+ case 298:
+ case 305:
+ case 318:
+ case 335:
+ case 341:
+ case 361:
+ case 364:
+ {
+ alt371=1;
+ }
+ break;
+ }
+
+ switch (alt371)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4206:8: m= modifier_param
+ {
+ FOLLOWPUSH(FOLLOW_modifier_param_in_def_routine_returns_atom13491);
+ m=modifier_param(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_returns_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ mdfr.override_ifdef( m
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_type_var_in_def_routine_returns_atom13505);
+ tv=type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_returns_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ paramT = tv
+ ;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_def_routine_returns_atom13512);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_returns_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4209:6: id= ID
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_def_routine_returns_atom13522);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_returns_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ variable = sep::ParserUtil::getVariable(STR((id->getText(id))->chars) , 1);
+ if( variable.invalid() )
+ {
+ sep::ParserUtil::avm_syntax_error(
+ "def_routine_returns_atom:> " + routine.str(), (id->getLine(id)) )
+ << "Unfound machine return's variable < "
+ << STR((id->getText(id))->chars)
+ << " > in routine header < " << " >"
+ << sep::ParserUtil::SYNTAX_ERROR_EOL;
+ }
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+
+ if( variable.valid() )
+ {
+ routine.saveReturn( param = new sep::Variable( &routine,
+ sep::Modifier::PROPERTY_MACRO_MODIFIER,
+ variable.to_ptr< sep::Variable >()->getType(),
+ STR((id->getText(id))->chars)) );
+
+ param->setOffset( offset );
+ param->setBinding( variable );
+ }
+ else
+ {
+ param = new sep::Variable(&routine,
+ mdfr,
+ tv
+ , STR((id->getText(id))->chars));
+ param->setOffset( offset );
+
+ // Only for Routine design as PROTOTYPE a.k.a. primitive routine
+ if( routine.getSpecifier().isDesignPrototypeStatic() )
+ {
+ routine.appendReturn(
+ machine->getPropertyPart().saveOwnedVariable( param ));
+ }
+ else
+ {
+ routine.saveReturn( param );
+ }
+ }
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4254:4: (iv= initial_value )?
+ {
+ int alt373=2;
+ switch ( LA(1) )
+ {
+ case ASSIGN:
+ case LPAREN:
+ {
+ alt373=1;
+ }
+ break;
+ }
+
+ switch (alt373)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4254:6: iv= initial_value
+ {
+ FOLLOWPUSH(FOLLOW_initial_value_in_def_routine_returns_atom13550);
+ iv=initial_value(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_returns_atomEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ param->setValue(iv
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_routine_returns_atomEx; /* Prevent compiler warnings */
+ ruledef_routine_returns_atomEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(156, def_routine_returns_atom_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_routine_returns_atom */
+
+/**
+ * $ANTLR start section_model_of_execution
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4262:1: section_model_of_execution[ sep::Machine * container ] : '@moe:' ( def_moe_primitive[ container ] )* ;
+ */
+static void
+section_model_of_execution(pfmlParser ctx, sep::Machine * container)
+{
+ ANTLR3_UINT32 section_model_of_execution_StartIndex;
+
+ /* Initialize rule variables
+ */
+ section_model_of_execution_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(157)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4263:2: ( '@moe:' ( def_moe_primitive[ container ] )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4263:4: '@moe:' ( def_moe_primitive[ container ] )*
+ {
+ MATCHT(204, &FOLLOW_204_in_section_model_of_execution13574);
+ if (HASEXCEPTION())
+ {
+ goto rulesection_model_of_executionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4263:13: ( def_moe_primitive[ container ] )*
+
+ for (;;)
+ {
+ int alt374=2;
+ switch ( LA(1) )
+ {
+ case 170:
+ case 175:
+ case 177:
+ case 179:
+ case 182:
+ case 184:
+ case 189:
+ case 190:
+ case 191:
+ case 194:
+ case 199:
+ case 218:
+ case 223:
+ case 224:
+ case 225:
+ case 226:
+ case 228:
+ case 367:
+ {
+ alt374=1;
+ }
+ break;
+
+ }
+
+ switch (alt374)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4263:15: def_moe_primitive[ container ]
+ {
+ FOLLOWPUSH(FOLLOW_def_moe_primitive_in_section_model_of_execution13579);
+ def_moe_primitive(ctx, container);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_model_of_executionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop374; /* break out of the loop */
+ break;
+ }
+ }
+ loop374: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulesection_model_of_executionEx; /* Prevent compiler warnings */
+ rulesection_model_of_executionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(157, section_model_of_execution_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end section_model_of_execution */
+
+/**
+ * $ANTLR start def_moe_primitive
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4266:1: def_moe_primitive[ sep::Machine * container ] : ( '@create' def_routine_seq[ theBehavior->getOnCreateRoutine() ] | '@init' def_routine_seq[ theBehavior->getOnInitRoutine() ] | '@final' def_routine_seq[ theBehavior->getOnFinalRoutine() ] | '@start' def_routine_seq[ theBehavior->getOnStartRoutine() ] | '@stop' def_routine_seq[ theBehavior->getOnStopRoutine() ] | '@ienable' def_routine_seq[ theBehavior->getOnIEnableRoutine() ] | '@enable' def_routine_seq[ theBehavior->getOnEnableRoutine() ] | '@idisable' def_routine_seq[ theBehavior->getOnIDisableRoutine() ] | '@disable' def_routine_seq[ theBehavior->getOnDisableRoutine() ] | '@iabort' def_routine_seq[ theBehavior->getOnIAbortRoutine() ] | '@abort' def_routine_seq[ theBehavior->getOnAbortRoutine() ] | '@irun' def_routine_seq[ theBehavior->getOnIRunRoutine() ] | '@run' def_routine_seq[ theBehavior->getOnRunRoutine() ] | '@rtc' def_routine_seq[ theBehavior->getOnRtcRoutine() ] | '@return' def_routine_seq[ theBehavior->getOnFinalRoutine() ] | '@concurrency' def_routine_seq[ theBehavior->getOnConcurrencyRoutine() ] | '@schedule' def_routine_seq[ theBehavior->getOnScheduleRoutine() ] | 'routine' def_routine_model_impl[ container , mdfr , spcfr ] );
+ */
+static void
+def_moe_primitive(pfmlParser ctx, sep::Machine * container)
+{
+ ANTLR3_UINT32 def_moe_primitive_StartIndex;
+
+ /* Initialize rule variables
+ */
+ def_moe_primitive_StartIndex = INDEX();
+
+
+
+ sep::BehavioralPart * theBehavior = container->getUniqBehaviorPart();
+
+ sep::Modifier mdfr;
+
+ sep::Specifier spcfr( sep::Specifier::DESIGN_MODEL_KIND );
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(158)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4274:2: ( '@create' def_routine_seq[ theBehavior->getOnCreateRoutine() ] | '@init' def_routine_seq[ theBehavior->getOnInitRoutine() ] | '@final' def_routine_seq[ theBehavior->getOnFinalRoutine() ] | '@start' def_routine_seq[ theBehavior->getOnStartRoutine() ] | '@stop' def_routine_seq[ theBehavior->getOnStopRoutine() ] | '@ienable' def_routine_seq[ theBehavior->getOnIEnableRoutine() ] | '@enable' def_routine_seq[ theBehavior->getOnEnableRoutine() ] | '@idisable' def_routine_seq[ theBehavior->getOnIDisableRoutine() ] | '@disable' def_routine_seq[ theBehavior->getOnDisableRoutine() ] | '@iabort' def_routine_seq[ theBehavior->getOnIAbortRoutine() ] | '@abort' def_routine_seq[ theBehavior->getOnAbortRoutine() ] | '@irun' def_routine_seq[ theBehavior->getOnIRunRoutine() ] | '@run' def_routine_seq[ theBehavior->getOnRunRoutine() ] | '@rtc' def_routine_seq[ theBehavior->getOnRtcRoutine() ] | '@return' def_routine_seq[ theBehavior->getOnFinalRoutine() ] | '@concurrency' def_routine_seq[ theBehavior->getOnConcurrencyRoutine() ] | '@schedule' def_routine_seq[ theBehavior->getOnScheduleRoutine() ] | 'routine' def_routine_model_impl[ container , mdfr , spcfr ] )
+
+ ANTLR3_UINT32 alt375;
+
+ alt375=18;
+
+ switch ( LA(1) )
+ {
+ case 177:
+ {
+ alt375=1;
+ }
+ break;
+ case 194:
+ {
+ alt375=2;
+ }
+ break;
+ case 184:
+ {
+ alt375=3;
+ }
+ break;
+ case 226:
+ {
+ alt375=4;
+ }
+ break;
+ case 228:
+ {
+ alt375=5;
+ }
+ break;
+ case 191:
+ {
+ alt375=6;
+ }
+ break;
+ case 182:
+ {
+ alt375=7;
+ }
+ break;
+ case 190:
+ {
+ alt375=8;
+ }
+ break;
+ case 179:
+ {
+ alt375=9;
+ }
+ break;
+ case 189:
+ {
+ alt375=10;
+ }
+ break;
+ case 170:
+ {
+ alt375=11;
+ }
+ break;
+ case 199:
+ {
+ alt375=12;
+ }
+ break;
+ case 224:
+ {
+ alt375=13;
+ }
+ break;
+ case 223:
+ {
+ alt375=14;
+ }
+ break;
+ case 218:
+ {
+ alt375=15;
+ }
+ break;
+ case 175:
+ {
+ alt375=16;
+ }
+ break;
+ case 225:
+ {
+ alt375=17;
+ }
+ break;
+ case 367:
+ {
+ alt375=18;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 375;
+ EXCEPTION->state = 0;
+
+
+ goto ruledef_moe_primitiveEx;
+
+ }
+
+ switch (alt375)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4274:4: '@create' def_routine_seq[ theBehavior->getOnCreateRoutine() ]
+ {
+ MATCHT(177, &FOLLOW_177_in_def_moe_primitive13600);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_routine_seq_in_def_moe_primitive13608);
+ def_routine_seq(ctx, theBehavior->getOnCreateRoutine());
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4275:4: '@init' def_routine_seq[ theBehavior->getOnInitRoutine() ]
+ {
+ MATCHT(194, &FOLLOW_194_in_def_moe_primitive13614);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_routine_seq_in_def_moe_primitive13624);
+ def_routine_seq(ctx, theBehavior->getOnInitRoutine());
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4276:4: '@final' def_routine_seq[ theBehavior->getOnFinalRoutine() ]
+ {
+ MATCHT(184, &FOLLOW_184_in_def_moe_primitive13630);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_routine_seq_in_def_moe_primitive13639);
+ def_routine_seq(ctx, theBehavior->getOnFinalRoutine());
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4278:4: '@start' def_routine_seq[ theBehavior->getOnStartRoutine() ]
+ {
+ MATCHT(226, &FOLLOW_226_in_def_moe_primitive13646);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_routine_seq_in_def_moe_primitive13655);
+ def_routine_seq(ctx, theBehavior->getOnStartRoutine());
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4279:4: '@stop' def_routine_seq[ theBehavior->getOnStopRoutine() ]
+ {
+ MATCHT(228, &FOLLOW_228_in_def_moe_primitive13661);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_routine_seq_in_def_moe_primitive13671);
+ def_routine_seq(ctx, theBehavior->getOnStopRoutine());
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4281:4: '@ienable' def_routine_seq[ theBehavior->getOnIEnableRoutine() ]
+ {
+ MATCHT(191, &FOLLOW_191_in_def_moe_primitive13678);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_routine_seq_in_def_moe_primitive13685);
+ def_routine_seq(ctx, theBehavior->getOnIEnableRoutine());
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4282:4: '@enable' def_routine_seq[ theBehavior->getOnEnableRoutine() ]
+ {
+ MATCHT(182, &FOLLOW_182_in_def_moe_primitive13691);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_routine_seq_in_def_moe_primitive13699);
+ def_routine_seq(ctx, theBehavior->getOnEnableRoutine());
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 8:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4284:4: '@idisable' def_routine_seq[ theBehavior->getOnIDisableRoutine() ]
+ {
+ MATCHT(190, &FOLLOW_190_in_def_moe_primitive13706);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_routine_seq_in_def_moe_primitive13712);
+ def_routine_seq(ctx, theBehavior->getOnIDisableRoutine());
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 9:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4285:4: '@disable' def_routine_seq[ theBehavior->getOnDisableRoutine() ]
+ {
+ MATCHT(179, &FOLLOW_179_in_def_moe_primitive13718);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_routine_seq_in_def_moe_primitive13725);
+ def_routine_seq(ctx, theBehavior->getOnDisableRoutine());
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 10:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4287:4: '@iabort' def_routine_seq[ theBehavior->getOnIAbortRoutine() ]
+ {
+ MATCHT(189, &FOLLOW_189_in_def_moe_primitive13732);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_routine_seq_in_def_moe_primitive13740);
+ def_routine_seq(ctx, theBehavior->getOnIAbortRoutine());
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 11:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4288:4: '@abort' def_routine_seq[ theBehavior->getOnAbortRoutine() ]
+ {
+ MATCHT(170, &FOLLOW_170_in_def_moe_primitive13746);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_routine_seq_in_def_moe_primitive13755);
+ def_routine_seq(ctx, theBehavior->getOnAbortRoutine());
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 12:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4290:4: '@irun' def_routine_seq[ theBehavior->getOnIRunRoutine() ]
+ {
+ MATCHT(199, &FOLLOW_199_in_def_moe_primitive13762);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_routine_seq_in_def_moe_primitive13772);
+ def_routine_seq(ctx, theBehavior->getOnIRunRoutine());
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 13:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4291:4: '@run' def_routine_seq[ theBehavior->getOnRunRoutine() ]
+ {
+ MATCHT(224, &FOLLOW_224_in_def_moe_primitive13778);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_routine_seq_in_def_moe_primitive13789);
+ def_routine_seq(ctx, theBehavior->getOnRunRoutine());
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 14:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4292:4: '@rtc' def_routine_seq[ theBehavior->getOnRtcRoutine() ]
+ {
+ MATCHT(223, &FOLLOW_223_in_def_moe_primitive13795);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_routine_seq_in_def_moe_primitive13806);
+ def_routine_seq(ctx, theBehavior->getOnRtcRoutine());
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 15:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4294:4: '@return' def_routine_seq[ theBehavior->getOnFinalRoutine() ]
+ {
+ MATCHT(218, &FOLLOW_218_in_def_moe_primitive13813);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_routine_seq_in_def_moe_primitive13821);
+ def_routine_seq(ctx, theBehavior->getOnFinalRoutine());
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 16:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4296:4: '@concurrency' def_routine_seq[ theBehavior->getOnConcurrencyRoutine() ]
+ {
+ MATCHT(175, &FOLLOW_175_in_def_moe_primitive13828);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_routine_seq_in_def_moe_primitive13831);
+ def_routine_seq(ctx, theBehavior->getOnConcurrencyRoutine());
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 17:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4297:4: '@schedule' def_routine_seq[ theBehavior->getOnScheduleRoutine() ]
+ {
+ MATCHT(225, &FOLLOW_225_in_def_moe_primitive13837);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_routine_seq_in_def_moe_primitive13843);
+ def_routine_seq(ctx, theBehavior->getOnScheduleRoutine());
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 18:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4300:4: 'routine' def_routine_model_impl[ container , mdfr , spcfr ]
+ {
+ MATCHT(367, &FOLLOW_367_in_def_moe_primitive13851);
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_routine_model_impl_in_def_moe_primitive13856);
+ def_routine_model_impl(ctx, container, mdfr, spcfr);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_moe_primitiveEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_moe_primitiveEx; /* Prevent compiler warnings */
+ ruledef_moe_primitiveEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(158, def_moe_primitive_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_moe_primitive */
+
+/**
+ * $ANTLR start def_routine_seq
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4305:1: def_routine_seq[ sep::Routine & routine ] : ( def_routine_parameters[ routine ] )? ( ( '-->' | 'returns:' ) def_routine_returns[ routine ] )? bs= block_statement ;
+ */
+static void
+def_routine_seq(pfmlParser ctx, sep::Routine & routine)
+{
+ ANTLR3_UINT32 def_routine_seq_StartIndex;
+
+ sep::BFCode bs;
+ #undef RETURN_TYPE_bs
+ #define RETURN_TYPE_bs sep::BFCode
+
+ /* Initialize rule variables
+ */
+ def_routine_seq_StartIndex = INDEX();
+
+
+
+ PUSH_CTX_CPR( & routine );
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(159)) )
+ {
+ {
+
+ SET_RULE_LOCATION( _CPR_ );
+
+ POP_CTX;;
+
+ }
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4316:2: ( ( def_routine_parameters[ routine ] )? ( ( '-->' | 'returns:' ) def_routine_returns[ routine ] )? bs= block_statement )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4316:4: ( def_routine_parameters[ routine ] )? ( ( '-->' | 'returns:' ) def_routine_returns[ routine ] )? bs= block_statement
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4316:4: ( def_routine_parameters[ routine ] )?
+ {
+ int alt376=2;
+ switch ( LA(1) )
+ {
+ case LPAREN:
+ {
+ alt376=1;
+ }
+ break;
+ }
+
+ switch (alt376)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4316:6: def_routine_parameters[ routine ]
+ {
+ FOLLOWPUSH(FOLLOW_def_routine_parameters_in_def_routine_seq13881);
+ def_routine_parameters(ctx, routine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_seqEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4317:4: ( ( '-->' | 'returns:' ) def_routine_returns[ routine ] )?
+ {
+ int alt377=2;
+ switch ( LA(1) )
+ {
+ case 163:
+ case 365:
+ {
+ alt377=1;
+ }
+ break;
+ }
+
+ switch (alt377)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4317:6: ( '-->' | 'returns:' ) def_routine_returns[ routine ]
+ {
+ if ( LA(1) == 163 || LA(1) == 365 )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruledef_routine_seqEx;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_def_routine_returns_in_def_routine_seq13903);
+ def_routine_returns(ctx, routine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_seqEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_def_routine_seq13915);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledef_routine_seqEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ routine.seqCode(bs
+ );
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledef_routine_seqEx; /* Prevent compiler warnings */
+ ruledef_routine_seqEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ SET_RULE_LOCATION( _CPR_ );
+
+ POP_CTX;;
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(159, def_routine_seq_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end def_routine_seq */
+
+/**
+ * $ANTLR start section_model_of_interaction
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4327:1: section_model_of_interaction[ sep::Machine * machine ] : ( '@interaction:' | '@com:' ) ( com_connect[ machine, theInteraction ] )* ;
+ */
+static void
+section_model_of_interaction(pfmlParser ctx, sep::Machine * machine)
+{
+ ANTLR3_UINT32 section_model_of_interaction_StartIndex;
+
+ /* Initialize rule variables
+ */
+ section_model_of_interaction_StartIndex = INDEX();
+
+
+
+ sep::InteractionPart * theInteraction = machine->getUniqInteraction();
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(160)) )
+ {
+ {
+
+ SET_RULE_LOCATION(theInteraction);
+
+ }
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4337:2: ( ( '@interaction:' | '@com:' ) ( com_connect[ machine, theInteraction ] )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4337:4: ( '@interaction:' | '@com:' ) ( com_connect[ machine, theInteraction ] )*
+ {
+ if ( LA(1) == 172 || LA(1) == 198 )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulesection_model_of_interactionEx;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4338:4: ( com_connect[ machine, theInteraction ] )*
+
+ for (;;)
+ {
+ int alt378=2;
+ switch ( LA(1) )
+ {
+ case 260:
+ case 261:
+ case 366:
+ {
+ alt378=1;
+ }
+ break;
+
+ }
+
+ switch (alt378)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4338:6: com_connect[ machine, theInteraction ]
+ {
+ FOLLOWPUSH(FOLLOW_com_connect_in_section_model_of_interaction13960);
+ com_connect(ctx, machine, theInteraction);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesection_model_of_interactionEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop378; /* break out of the loop */
+ break;
+ }
+ }
+ loop378: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulesection_model_of_interactionEx; /* Prevent compiler warnings */
+ rulesection_model_of_interactionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ SET_RULE_LOCATION(theInteraction);
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(160, section_model_of_interaction_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end section_model_of_interaction */
+
+/**
+ * $ANTLR start com_protocol
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4341:1: com_protocol[ sep::Machine * machine , sep::ComProtocol * cp ] : ( 'env' | 'rdv' | 'multirdv' | 'flow' | 'anycast' | 'unicast' | 'multicast' | 'broadcast' |bc= buffer_com[ machine ] );
+ */
+static void
+com_protocol(pfmlParser ctx, sep::Machine * machine, sep::ComProtocol * cp)
+{
+ ANTLR3_UINT32 com_protocol_StartIndex;
+
+ sep::BF bc;
+ #undef RETURN_TYPE_bc
+ #define RETURN_TYPE_bc sep::BF
+
+ /* Initialize rule variables
+ */
+ com_protocol_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(161)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4343:2: ( 'env' | 'rdv' | 'multirdv' | 'flow' | 'anycast' | 'unicast' | 'multicast' | 'broadcast' |bc= buffer_com[ machine ] )
+
+ ANTLR3_UINT32 alt379;
+
+ alt379=9;
+
+ switch ( LA(1) )
+ {
+ case 277:
+ {
+ alt379=1;
+ }
+ break;
+ case 359:
+ {
+ alt379=2;
+ }
+ break;
+ case 328:
+ {
+ alt379=3;
+ }
+ break;
+ case 284:
+ {
+ alt379=4;
+ }
+ break;
+ case 240:
+ {
+ alt379=5;
+ }
+ break;
+ case 403:
+ {
+ alt379=6;
+ }
+ break;
+ case 324:
+ {
+ alt379=7;
+ }
+ break;
+ case 248:
+ {
+ alt379=8;
+ }
+ break;
+ case 249:
+ case 281:
+ case 315:
+ case 325:
+ case 326:
+ case 329:
+ case 356:
+ case 370:
+ case 373:
+ case 412:
+ {
+ alt379=9;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 379;
+ EXCEPTION->state = 0;
+
+
+ goto rulecom_protocolEx;
+
+ }
+
+ switch (alt379)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4343:4: 'env'
+ {
+ MATCHT(277, &FOLLOW_277_in_com_protocol13978);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_protocolEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ cp->setProtocol(sep::ComProtocol::PROTOCOL_ENVIRONMENT_KIND);
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4345:4: 'rdv'
+ {
+ MATCHT(359, &FOLLOW_359_in_com_protocol13992);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_protocolEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ cp->setProtocolCast(sep::ComProtocol::PROTOCOL_RDV_KIND, sep::ComProtocol::PROTOCOL_UNICAST_KIND);
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4346:4: 'multirdv'
+ {
+ MATCHT(328, &FOLLOW_328_in_com_protocol14005);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_protocolEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ cp->setProtocolCast(sep::ComProtocol::PROTOCOL_MULTIRDV_KIND, sep::ComProtocol::PROTOCOL_MULTICAST_KIND);
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4348:4: 'flow'
+ {
+ MATCHT(284, &FOLLOW_284_in_com_protocol14014);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_protocolEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ cp->setProtocolCast(sep::ComProtocol::PROTOCOL_FLOW_KIND, sep::ComProtocol::PROTOCOL_MULTICAST_KIND);
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4351:4: 'anycast'
+ {
+ MATCHT(240, &FOLLOW_240_in_com_protocol14028);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_protocolEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ cp->setProtocolCast(sep::ComProtocol::PROTOCOL_ANYCAST_KIND, sep::ComProtocol::PROTOCOL_ANYCAST_KIND);
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4353:4: 'unicast'
+ {
+ MATCHT(403, &FOLLOW_403_in_com_protocol14038);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_protocolEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ cp->setProtocolCast(sep::ComProtocol::PROTOCOL_UNICAST_KIND, sep::ComProtocol::PROTOCOL_UNICAST_KIND);
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4355:4: 'multicast'
+ {
+ MATCHT(324, &FOLLOW_324_in_com_protocol14048);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_protocolEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ cp->setProtocolCast(sep::ComProtocol::PROTOCOL_MULTICAST_KIND, sep::ComProtocol::PROTOCOL_MULTICAST_KIND);
+ }
+
+
+ }
+ break;
+ case 8:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4357:4: 'broadcast'
+ {
+ MATCHT(248, &FOLLOW_248_in_com_protocol14056);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_protocolEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ cp->setProtocolCast(sep::ComProtocol::PROTOCOL_BROADCAST_KIND, sep::ComProtocol::PROTOCOL_BROADCAST_KIND);
+ }
+
+
+ }
+ break;
+ case 9:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4359:4: bc= buffer_com[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_buffer_com_in_com_protocol14066);
+ bc=buffer_com(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecom_protocolEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ cp->setProtocol(sep::ComProtocol::PROTOCOL_BUFFER_KIND);
+ cp->setBuffer(
+ bc
+ );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulecom_protocolEx; /* Prevent compiler warnings */
+ rulecom_protocolEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(161, com_protocol_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end com_protocol */
+
+/**
+ * $ANTLR start com_cast
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4366:1: com_cast[ sep::ComProtocol * cp ] : ( 'anycast' | 'unicast' | 'multicast' | 'broadcast' );
+ */
+static void
+com_cast(pfmlParser ctx, sep::ComProtocol * cp)
+{
+ ANTLR3_UINT32 com_cast_StartIndex;
+
+ /* Initialize rule variables
+ */
+ com_cast_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(162)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4367:2: ( 'anycast' | 'unicast' | 'multicast' | 'broadcast' )
+
+ ANTLR3_UINT32 alt380;
+
+ alt380=4;
+
+ switch ( LA(1) )
+ {
+ case 240:
+ {
+ alt380=1;
+ }
+ break;
+ case 403:
+ {
+ alt380=2;
+ }
+ break;
+ case 324:
+ {
+ alt380=3;
+ }
+ break;
+ case 248:
+ {
+ alt380=4;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 380;
+ EXCEPTION->state = 0;
+
+
+ goto rulecom_castEx;
+
+ }
+
+ switch (alt380)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4367:4: 'anycast'
+ {
+ MATCHT(240, &FOLLOW_240_in_com_cast14083);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_castEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ cp->setCast(sep::ComProtocol::PROTOCOL_ANYCAST_KIND);
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4368:4: 'unicast'
+ {
+ MATCHT(403, &FOLLOW_403_in_com_cast14093);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_castEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ cp->setCast(sep::ComProtocol::PROTOCOL_UNICAST_KIND);
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4369:4: 'multicast'
+ {
+ MATCHT(324, &FOLLOW_324_in_com_cast14103);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_castEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ cp->setCast(sep::ComProtocol::PROTOCOL_MULTICAST_KIND);
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4370:4: 'broadcast'
+ {
+ MATCHT(248, &FOLLOW_248_in_com_cast14111);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_castEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ cp->setCast(sep::ComProtocol::PROTOCOL_BROADCAST_KIND);
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulecom_castEx; /* Prevent compiler warnings */
+ rulecom_castEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(162, com_cast_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end com_cast */
+
+/**
+ * $ANTLR start buffer_com
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4373:1: buffer_com[ sep::Machine * machine ] returns [ sep::BF buf ] : ( 'buffer' ( COLON (rb= ref_buffer[machine] |db= def_buffer ) | LT_ (rb= ref_buffer[machine] |db= def_buffer ) GT ) |db= def_buffer );
+ */
+static sep::BF
+buffer_com(pfmlParser ctx, sep::Machine * machine)
+{
+ sep::BF buf;
+
+ ANTLR3_UINT32 buffer_com_StartIndex;
+
+ sep::BF rb;
+ #undef RETURN_TYPE_rb
+ #define RETURN_TYPE_rb sep::BF
+
+ fmlParser_def_buffer_return db;
+ #undef RETURN_TYPE_db
+ #define RETURN_TYPE_db fmlParser_def_buffer_return
+
+ /* Initialize rule variables
+ */
+ buffer_com_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(163)) )
+ {
+ {
+ }
+
+
+
+ return buf;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4375:2: ( 'buffer' ( COLON (rb= ref_buffer[machine] |db= def_buffer ) | LT_ (rb= ref_buffer[machine] |db= def_buffer ) GT ) |db= def_buffer )
+
+ ANTLR3_UINT32 alt384;
+
+ alt384=2;
+
+ switch ( LA(1) )
+ {
+ case 249:
+ {
+ alt384=1;
+ }
+ break;
+ case 281:
+ case 315:
+ case 325:
+ case 326:
+ case 329:
+ case 356:
+ case 370:
+ case 373:
+ case 412:
+ {
+ alt384=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return buf;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 384;
+ EXCEPTION->state = 0;
+
+
+ goto rulebuffer_comEx;
+
+ }
+
+ switch (alt384)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4375:4: 'buffer' ( COLON (rb= ref_buffer[machine] |db= def_buffer ) | LT_ (rb= ref_buffer[machine] |db= def_buffer ) GT )
+ {
+ MATCHT(249, &FOLLOW_249_in_buffer_com14132);
+ if (HASEXCEPTION())
+ {
+ goto rulebuffer_comEx;
+ }
+ if (HASFAILED())
+ {
+ return buf;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4376:4: ( COLON (rb= ref_buffer[machine] |db= def_buffer ) | LT_ (rb= ref_buffer[machine] |db= def_buffer ) GT )
+ {
+ int alt383=2;
+ switch ( LA(1) )
+ {
+ case COLON:
+ {
+ alt383=1;
+ }
+ break;
+ case LT_:
+ {
+ alt383=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return buf;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 383;
+ EXCEPTION->state = 0;
+
+
+ goto rulebuffer_comEx;
+
+ }
+
+ switch (alt383)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4376:6: COLON (rb= ref_buffer[machine] |db= def_buffer )
+ {
+ MATCHT(COLON, &FOLLOW_COLON_in_buffer_com14139);
+ if (HASEXCEPTION())
+ {
+ goto rulebuffer_comEx;
+ }
+ if (HASFAILED())
+ {
+ return buf;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4377:6: (rb= ref_buffer[machine] |db= def_buffer )
+ {
+ int alt381=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt381=1;
+ }
+ break;
+ case 281:
+ case 315:
+ case 325:
+ case 326:
+ case 329:
+ case 356:
+ case 370:
+ case 373:
+ case 412:
+ {
+ alt381=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return buf;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 381;
+ EXCEPTION->state = 0;
+
+
+ goto rulebuffer_comEx;
+
+ }
+
+ switch (alt381)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4377:8: rb= ref_buffer[machine]
+ {
+ FOLLOWPUSH(FOLLOW_ref_buffer_in_buffer_com14150);
+ rb=ref_buffer(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulebuffer_comEx;
+ }
+ if (HASFAILED())
+ {
+ return buf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ buf=
+ rb
+ ;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4378:8: db= def_buffer
+ {
+ FOLLOWPUSH(FOLLOW_def_buffer_in_buffer_com14165);
+ db=def_buffer(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulebuffer_comEx;
+ }
+ if (HASFAILED())
+ {
+ return buf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ buf= sep::BF( new sep::Buffer(machine,
+ newBufferID(),
+ db.kind
+ , db.size
+ ) );
+
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4385:6: LT_ (rb= ref_buffer[machine] |db= def_buffer ) GT
+ {
+ MATCHT(LT_, &FOLLOW_LT__in_buffer_com14187);
+ if (HASEXCEPTION())
+ {
+ goto rulebuffer_comEx;
+ }
+ if (HASFAILED())
+ {
+ return buf;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4386:8: (rb= ref_buffer[machine] |db= def_buffer )
+ {
+ int alt382=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt382=1;
+ }
+ break;
+ case 281:
+ case 315:
+ case 325:
+ case 326:
+ case 329:
+ case 356:
+ case 370:
+ case 373:
+ case 412:
+ {
+ alt382=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return buf;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 382;
+ EXCEPTION->state = 0;
+
+
+ goto rulebuffer_comEx;
+
+ }
+
+ switch (alt382)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4386:10: rb= ref_buffer[machine]
+ {
+ FOLLOWPUSH(FOLLOW_ref_buffer_in_buffer_com14200);
+ rb=ref_buffer(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulebuffer_comEx;
+ }
+ if (HASFAILED())
+ {
+ return buf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ buf=
+ rb
+ ;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4387:10: db= def_buffer
+ {
+ FOLLOWPUSH(FOLLOW_def_buffer_in_buffer_com14217);
+ db=def_buffer(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulebuffer_comEx;
+ }
+ if (HASFAILED())
+ {
+ return buf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ buf= sep::BF( new sep::Buffer(machine,
+ newBufferID(),
+ db.kind
+ , db.size
+ ) );
+
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(GT, &FOLLOW_GT_in_buffer_com14238);
+ if (HASEXCEPTION())
+ {
+ goto rulebuffer_comEx;
+ }
+ if (HASFAILED())
+ {
+ return buf;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4395:4: db= def_buffer
+ {
+ FOLLOWPUSH(FOLLOW_def_buffer_in_buffer_com14250);
+ db=def_buffer(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulebuffer_comEx;
+ }
+ if (HASFAILED())
+ {
+ return buf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ buf= sep::BF( new sep::Buffer(machine,
+ newBufferID(),
+ db.kind
+ , db.size
+ ) );
+
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulebuffer_comEx; /* Prevent compiler warnings */
+ rulebuffer_comEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(163, buffer_com_StartIndex); }
+
+ return buf;
+}
+/* $ANTLR end buffer_com */
+
+/**
+ * $ANTLR start com_connect
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4403:1: com_connect[ sep::Machine * machine , sep::InteractionPart * anInteraction ] : ( ( 'connector' | 'connect' ) ( LT_ com_protocol[ machine, aConnector ] ( COMMA com_cast[ aConnector ] )? GT )? ( ID )? LCURLY ( com_route[ machine, aConnector ] )+ RCURLY | ( 'route' ) ( LT_ com_protocol[ machine, aConnector ] ( COMMA com_cast[ aConnector ] )? GT )? ( com_route[ machine, aConnector ] | LCURLY ( com_route[ machine, aConnector ] )+ RCURLY | LBRACKET ( com_port[ machine , comRoute ] ( COMMA com_port[ machine , comRoute ] )* | STAR ) RBRACKET SEMI ) );
+ */
+static void
+com_connect(pfmlParser ctx, sep::Machine * machine, sep::InteractionPart * anInteraction)
+{
+ ANTLR3_UINT32 com_connect_StartIndex;
+
+ pANTLR3_COMMON_TOKEN ID11;
+
+ /* Initialize rule variables
+ */
+ com_connect_StartIndex = INDEX();
+
+
+
+ sep::Connector * aConnector;
+ anInteraction->saveConnector( aConnector = new sep::Connector(*anInteraction) );
+ aConnector->update(anInteraction);
+ std::string c_id;
+
+ sep::ComRoute * comRoute = NULL;
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(164)) )
+ {
+ {
+
+ SET_RULE_LOCATION(aConnector);
+
+ }
+ {
+ }
+
+
+
+ return ;
+ }
+
+ ID11 = NULL;
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4418:2: ( ( 'connector' | 'connect' ) ( LT_ com_protocol[ machine, aConnector ] ( COMMA com_cast[ aConnector ] )? GT )? ( ID )? LCURLY ( com_route[ machine, aConnector ] )+ RCURLY | ( 'route' ) ( LT_ com_protocol[ machine, aConnector ] ( COMMA com_cast[ aConnector ] )? GT )? ( com_route[ machine, aConnector ] | LCURLY ( com_route[ machine, aConnector ] )+ RCURLY | LBRACKET ( com_port[ machine , comRoute ] ( COMMA com_port[ machine , comRoute ] )* | STAR ) RBRACKET SEMI ) )
+
+ ANTLR3_UINT32 alt395;
+
+ alt395=2;
+
+ switch ( LA(1) )
+ {
+ case 260:
+ case 261:
+ {
+ alt395=1;
+ }
+ break;
+ case 366:
+ {
+ alt395=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 395;
+ EXCEPTION->state = 0;
+
+
+ goto rulecom_connectEx;
+
+ }
+
+ switch (alt395)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4418:4: ( 'connector' | 'connect' ) ( LT_ com_protocol[ machine, aConnector ] ( COMMA com_cast[ aConnector ] )? GT )? ( ID )? LCURLY ( com_route[ machine, aConnector ] )+ RCURLY
+ {
+ if ( ((LA(1) >= 260) && (LA(1) <= 261)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulecom_connectEx;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4419:4: ( LT_ com_protocol[ machine, aConnector ] ( COMMA com_cast[ aConnector ] )? GT )?
+ {
+ int alt386=2;
+ switch ( LA(1) )
+ {
+ case LT_:
+ {
+ alt386=1;
+ }
+ break;
+ }
+
+ switch (alt386)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4419:6: LT_ com_protocol[ machine, aConnector ] ( COMMA com_cast[ aConnector ] )? GT
+ {
+ MATCHT(LT_, &FOLLOW_LT__in_com_connect14291);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_com_protocol_in_com_connect14298);
+ com_protocol(ctx, machine, aConnector);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4421:6: ( COMMA com_cast[ aConnector ] )?
+ {
+ int alt385=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt385=1;
+ }
+ break;
+ }
+
+ switch (alt385)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4421:8: COMMA com_cast[ aConnector ]
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_com_connect14308);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_com_cast_in_com_connect14310);
+ com_cast(ctx, aConnector);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(GT, &FOLLOW_GT_in_com_connect14321);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4424:4: ( ID )?
+ {
+ int alt387=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt387=1;
+ }
+ break;
+ }
+
+ switch (alt387)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4424:6: ID
+ {
+ ID11 = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_com_connect14334);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ c_id = STR((ID11->getText(ID11))->chars);
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+ aConnector->fullyUpdateAllNameID(newConnectID(c_id, "_#connector"));
+ }
+
+
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_com_connect14349);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4427:4: ( com_route[ machine, aConnector ] )+
+ {
+ int cnt388=0;
+
+ for (;;)
+ {
+ int alt388=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ case 298:
+ case 305:
+ case 341:
+ case 364:
+ {
+ alt388=1;
+ }
+ break;
+
+ }
+
+ switch (alt388)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4427:6: com_route[ machine, aConnector ]
+ {
+ FOLLOWPUSH(FOLLOW_com_route_in_com_connect14356);
+ com_route(ctx, machine, aConnector);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt388 >= 1 )
+ {
+ goto loop388;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto rulecom_connectEx;
+ }
+ cnt388++;
+ }
+ loop388: ; /* Jump to here if this rule does not match */
+ }
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_com_connect14365);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4431:4: ( 'route' ) ( LT_ com_protocol[ machine, aConnector ] ( COMMA com_cast[ aConnector ] )? GT )? ( com_route[ machine, aConnector ] | LCURLY ( com_route[ machine, aConnector ] )+ RCURLY | LBRACKET ( com_port[ machine , comRoute ] ( COMMA com_port[ machine , comRoute ] )* | STAR ) RBRACKET SEMI )
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4431:4: ( 'route' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4431:6: 'route'
+ {
+ MATCHT(366, &FOLLOW_366_in_com_connect14374);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ aConnector->setNature( sep::IComPoint::IO_SIGNAL_NATURE );
+ aConnector->fullyUpdateAllNameID(newConnectID("", "_#route"));
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4436:4: ( LT_ com_protocol[ machine, aConnector ] ( COMMA com_cast[ aConnector ] )? GT )?
+ {
+ int alt390=2;
+ switch ( LA(1) )
+ {
+ case LT_:
+ {
+ alt390=1;
+ }
+ break;
+ }
+
+ switch (alt390)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4436:6: LT_ com_protocol[ machine, aConnector ] ( COMMA com_cast[ aConnector ] )? GT
+ {
+ MATCHT(LT_, &FOLLOW_LT__in_com_connect14388);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_com_protocol_in_com_connect14395);
+ com_protocol(ctx, machine, aConnector);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4438:6: ( COMMA com_cast[ aConnector ] )?
+ {
+ int alt389=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt389=1;
+ }
+ break;
+ }
+
+ switch (alt389)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4438:8: COMMA com_cast[ aConnector ]
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_com_connect14405);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_com_cast_in_com_connect14407);
+ com_cast(ctx, aConnector);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(GT, &FOLLOW_GT_in_com_connect14418);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4442:4: ( com_route[ machine, aConnector ] | LCURLY ( com_route[ machine, aConnector ] )+ RCURLY | LBRACKET ( com_port[ machine , comRoute ] ( COMMA com_port[ machine , comRoute ] )* | STAR ) RBRACKET SEMI )
+ {
+ int alt394=3;
+ switch ( LA(1) )
+ {
+ case ID:
+ case 298:
+ case 305:
+ case 341:
+ case 364:
+ {
+ alt394=1;
+ }
+ break;
+ case LCURLY:
+ {
+ alt394=2;
+ }
+ break;
+ case LBRACKET:
+ {
+ alt394=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 394;
+ EXCEPTION->state = 0;
+
+
+ goto rulecom_connectEx;
+
+ }
+
+ switch (alt394)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4442:6: com_route[ machine, aConnector ]
+ {
+ FOLLOWPUSH(FOLLOW_com_route_in_com_connect14432);
+ com_route(ctx, machine, aConnector);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4444:6: LCURLY ( com_route[ machine, aConnector ] )+ RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_com_connect14441);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4445:6: ( com_route[ machine, aConnector ] )+
+ {
+ int cnt391=0;
+
+ for (;;)
+ {
+ int alt391=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ case 298:
+ case 305:
+ case 341:
+ case 364:
+ {
+ alt391=1;
+ }
+ break;
+
+ }
+
+ switch (alt391)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4445:8: com_route[ machine, aConnector ]
+ {
+ FOLLOWPUSH(FOLLOW_com_route_in_com_connect14450);
+ com_route(ctx, machine, aConnector);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt391 >= 1 )
+ {
+ goto loop391;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto rulecom_connectEx;
+ }
+ cnt391++;
+ }
+ loop391: ; /* Jump to here if this rule does not match */
+ }
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_com_connect14461);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4448:6: LBRACKET ( com_port[ machine , comRoute ] ( COMMA com_port[ machine , comRoute ] )* | STAR ) RBRACKET SEMI
+ {
+ MATCHT(LBRACKET, &FOLLOW_LBRACKET_in_com_connect14469);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ comRoute = new sep::ComRoute(aConnector,
+ sep::Modifier::PROPERTY_INOUT_DIRECTION);
+ aConnector->appendComRoute(comRoute);
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4454:6: ( com_port[ machine , comRoute ] ( COMMA com_port[ machine , comRoute ] )* | STAR )
+ {
+ int alt393=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt393=1;
+ }
+ break;
+ case STAR:
+ {
+ alt393=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 393;
+ EXCEPTION->state = 0;
+
+
+ goto rulecom_connectEx;
+
+ }
+
+ switch (alt393)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4454:8: com_port[ machine , comRoute ] ( COMMA com_port[ machine , comRoute ] )*
+ {
+ FOLLOWPUSH(FOLLOW_com_port_in_com_connect14485);
+ com_port(ctx, machine, comRoute);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4455:8: ( COMMA com_port[ machine , comRoute ] )*
+
+ for (;;)
+ {
+ int alt392=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt392=1;
+ }
+ break;
+
+ }
+
+ switch (alt392)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4455:10: COMMA com_port[ machine , comRoute ]
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_com_connect14497);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_com_port_in_com_connect14500);
+ com_port(ctx, machine, comRoute);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop392; /* break out of the loop */
+ break;
+ }
+ }
+ loop392: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4457:8: STAR
+ {
+ MATCHT(STAR, &FOLLOW_STAR_in_com_connect14514);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ sep::ComPoint * comPoint = new sep::ComPoint();
+ comPoint->setMachineAllSignal(machine);
+ comRoute->setComPoint(comPoint, sep::Modifier::DIRECTION_INOUT_KIND);
+
+ SET_RULE_LOCATION(comPoint);
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(RBRACKET, &FOLLOW_RBRACKET_in_com_connect14535);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_com_connect14542);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_connectEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulecom_connectEx; /* Prevent compiler warnings */
+ rulecom_connectEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ SET_RULE_LOCATION(aConnector);
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(164, com_connect_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end com_connect */
+
+/**
+ * $ANTLR start com_route
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4472:1: com_route[ sep::Machine * machine , sep::Connector * aConnector ] : ( modifier_set_direction_strict_text[ comRoute->getwModifier() ] ( LT_ (bc= buffer_com[ machine ] | com_cast[ comRoute ] ) GT )? ( com_port[ machine , comRoute ] SEMI | LCURLY ( com_port[ machine , comRoute ] SEMI )+ RCURLY | LBRACKET ( com_port[ machine , comRoute ] ( COMMA com_port[ machine , comRoute ] )* | STAR ) RBRACKET SEMI ) | com_port[ machine , comRoute ] SEMI );
+ */
+static void
+com_route(pfmlParser ctx, sep::Machine * machine, sep::Connector * aConnector)
+{
+ ANTLR3_UINT32 com_route_StartIndex;
+
+ sep::BF bc;
+ #undef RETURN_TYPE_bc
+ #define RETURN_TYPE_bc sep::BF
+
+ /* Initialize rule variables
+ */
+ com_route_StartIndex = INDEX();
+
+
+
+ sep::ComRoute * comRoute = new sep::ComRoute(aConnector);
+ aConnector->appendComRoute(comRoute);
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(165)) )
+ {
+ {
+
+ SET_RULE_LOCATION(comRoute);
+
+ }
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4483:2: ( modifier_set_direction_strict_text[ comRoute->getwModifier() ] ( LT_ (bc= buffer_com[ machine ] | com_cast[ comRoute ] ) GT )? ( com_port[ machine , comRoute ] SEMI | LCURLY ( com_port[ machine , comRoute ] SEMI )+ RCURLY | LBRACKET ( com_port[ machine , comRoute ] ( COMMA com_port[ machine , comRoute ] )* | STAR ) RBRACKET SEMI ) | com_port[ machine , comRoute ] SEMI )
+
+ ANTLR3_UINT32 alt402;
+
+ alt402=2;
+
+ switch ( LA(1) )
+ {
+ case 298:
+ case 305:
+ case 341:
+ case 364:
+ {
+ alt402=1;
+ }
+ break;
+ case ID:
+ {
+ alt402=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 402;
+ EXCEPTION->state = 0;
+
+
+ goto rulecom_routeEx;
+
+ }
+
+ switch (alt402)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4483:4: modifier_set_direction_strict_text[ comRoute->getwModifier() ] ( LT_ (bc= buffer_com[ machine ] | com_cast[ comRoute ] ) GT )? ( com_port[ machine , comRoute ] SEMI | LCURLY ( com_port[ machine , comRoute ] SEMI )+ RCURLY | LBRACKET ( com_port[ machine , comRoute ] ( COMMA com_port[ machine , comRoute ] )* | STAR ) RBRACKET SEMI )
+ {
+ FOLLOWPUSH(FOLLOW_modifier_set_direction_strict_text_in_com_route14570);
+ modifier_set_direction_strict_text(ctx, comRoute->getwModifier());
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecom_routeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4484:4: ( LT_ (bc= buffer_com[ machine ] | com_cast[ comRoute ] ) GT )?
+ {
+ int alt397=2;
+ switch ( LA(1) )
+ {
+ case LT_:
+ {
+ alt397=1;
+ }
+ break;
+ }
+
+ switch (alt397)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4484:6: LT_ (bc= buffer_com[ machine ] | com_cast[ comRoute ] ) GT
+ {
+ MATCHT(LT_, &FOLLOW_LT__in_com_route14578);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_routeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4484:10: (bc= buffer_com[ machine ] | com_cast[ comRoute ] )
+ {
+ int alt396=2;
+ switch ( LA(1) )
+ {
+ case 249:
+ case 281:
+ case 315:
+ case 325:
+ case 326:
+ case 329:
+ case 356:
+ case 370:
+ case 373:
+ case 412:
+ {
+ alt396=1;
+ }
+ break;
+ case 240:
+ case 248:
+ case 324:
+ case 403:
+ {
+ alt396=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 396;
+ EXCEPTION->state = 0;
+
+
+ goto rulecom_routeEx;
+
+ }
+
+ switch (alt396)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4485:6: bc= buffer_com[ machine ]
+ {
+ FOLLOWPUSH(FOLLOW_buffer_com_in_com_route14589);
+ bc=buffer_com(ctx, machine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecom_routeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ comRoute->setProtocol(sep::ComProtocol::PROTOCOL_BUFFER_KIND);
+ comRoute->setBuffer(bc
+ );
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4490:8: com_cast[ comRoute ]
+ {
+ FOLLOWPUSH(FOLLOW_com_cast_in_com_route14606);
+ com_cast(ctx, comRoute);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecom_routeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(GT, &FOLLOW_GT_in_com_route14614);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_routeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4493:4: ( com_port[ machine , comRoute ] SEMI | LCURLY ( com_port[ machine , comRoute ] SEMI )+ RCURLY | LBRACKET ( com_port[ machine , comRoute ] ( COMMA com_port[ machine , comRoute ] )* | STAR ) RBRACKET SEMI )
+ {
+ int alt401=3;
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt401=1;
+ }
+ break;
+ case LCURLY:
+ {
+ alt401=2;
+ }
+ break;
+ case LBRACKET:
+ {
+ alt401=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 401;
+ EXCEPTION->state = 0;
+
+
+ goto rulecom_routeEx;
+
+ }
+
+ switch (alt401)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4493:6: com_port[ machine , comRoute ] SEMI
+ {
+ FOLLOWPUSH(FOLLOW_com_port_in_com_route14625);
+ com_port(ctx, machine, comRoute);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecom_routeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_com_route14629);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_routeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4495:6: LCURLY ( com_port[ machine , comRoute ] SEMI )+ RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_com_route14637);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_routeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4496:6: ( com_port[ machine , comRoute ] SEMI )+
+ {
+ int cnt398=0;
+
+ for (;;)
+ {
+ int alt398=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt398=1;
+ }
+ break;
+
+ }
+
+ switch (alt398)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4496:8: com_port[ machine , comRoute ] SEMI
+ {
+ FOLLOWPUSH(FOLLOW_com_port_in_com_route14646);
+ com_port(ctx, machine, comRoute);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecom_routeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_com_route14650);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_routeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt398 >= 1 )
+ {
+ goto loop398;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto rulecom_routeEx;
+ }
+ cnt398++;
+ }
+ loop398: ; /* Jump to here if this rule does not match */
+ }
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_com_route14660);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_routeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4499:6: LBRACKET ( com_port[ machine , comRoute ] ( COMMA com_port[ machine , comRoute ] )* | STAR ) RBRACKET SEMI
+ {
+ MATCHT(LBRACKET, &FOLLOW_LBRACKET_in_com_route14668);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_routeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4500:6: ( com_port[ machine , comRoute ] ( COMMA com_port[ machine , comRoute ] )* | STAR )
+ {
+ int alt400=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt400=1;
+ }
+ break;
+ case STAR:
+ {
+ alt400=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 400;
+ EXCEPTION->state = 0;
+
+
+ goto rulecom_routeEx;
+
+ }
+
+ switch (alt400)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4500:8: com_port[ machine , comRoute ] ( COMMA com_port[ machine , comRoute ] )*
+ {
+ FOLLOWPUSH(FOLLOW_com_port_in_com_route14677);
+ com_port(ctx, machine, comRoute);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecom_routeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4501:8: ( COMMA com_port[ machine , comRoute ] )*
+
+ for (;;)
+ {
+ int alt399=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt399=1;
+ }
+ break;
+
+ }
+
+ switch (alt399)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4501:10: COMMA com_port[ machine , comRoute ]
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_com_route14689);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_routeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_com_port_in_com_route14692);
+ com_port(ctx, machine, comRoute);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecom_routeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop399; /* break out of the loop */
+ break;
+ }
+ }
+ loop399: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4503:8: STAR
+ {
+ MATCHT(STAR, &FOLLOW_STAR_in_com_route14706);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_routeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ sep::ComPoint * comPoint = new sep::ComPoint();
+ comPoint->setMachineAllSignal(machine);
+ comRoute->setComPoint(comPoint, sep::Modifier::DIRECTION_INOUT_KIND);
+
+ SET_RULE_LOCATION(comPoint);
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(RBRACKET, &FOLLOW_RBRACKET_in_com_route14727);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_routeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_com_route14734);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_routeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4516:7: com_port[ machine , comRoute ] SEMI
+ {
+ FOLLOWPUSH(FOLLOW_com_port_in_com_route14748);
+ com_port(ctx, machine, comRoute);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecom_routeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_com_route14752);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_routeEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulecom_routeEx; /* Prevent compiler warnings */
+ rulecom_routeEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ SET_RULE_LOCATION(comRoute);
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(165, com_route_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end com_route */
+
+/**
+ * $ANTLR start com_port
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4520:1: com_port[ sep::Machine * machine , sep::ComRoute * comRoute] : ( ( qualifiedNameID '->' )=>m= qualifiedNameID '->' (cp= com_port_id[ machine , comMachine ] | LBRACKET (cp= com_port_id[ machine , comMachine ] ( COMMA cp= com_port_id[ machine , comMachine ] )* | STAR ) RBRACKET ) |cp= com_port_id[ machine , comMachine ] );
+ */
+static void
+com_port(pfmlParser ctx, sep::Machine * machine, sep::ComRoute * comRoute)
+{
+ ANTLR3_UINT32 com_port_StartIndex;
+
+ fmlParser_qualifiedNameID_return m;
+ #undef RETURN_TYPE_m
+ #define RETURN_TYPE_m fmlParser_qualifiedNameID_return
+
+ sep::BF cp;
+ #undef RETURN_TYPE_cp
+ #define RETURN_TYPE_cp sep::BF
+
+ /* Initialize rule variables
+ */
+ com_port_StartIndex = INDEX();
+
+
+
+ sep::Machine * comMachine = machine;
+ while( comMachine != NULL )
+ {
+ if( comMachine->hasPortSignal() || (! comMachine->hasContainer()) )
+ {
+ break;
+ }
+ comMachine = comMachine->getContainerMachine();
+ }
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(166)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4535:2: ( ( qualifiedNameID '->' )=>m= qualifiedNameID '->' (cp= com_port_id[ machine , comMachine ] | LBRACKET (cp= com_port_id[ machine , comMachine ] ( COMMA cp= com_port_id[ machine , comMachine ] )* | STAR ) RBRACKET ) |cp= com_port_id[ machine , comMachine ] )
+
+ ANTLR3_UINT32 alt406;
+
+ alt406=2;
+
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ {
+ int LA406_1 = LA(2);
+ if ( (synpred705_fml(ctx)))
+ {
+ alt406=1;
+ }
+ else if ( (ANTLR3_TRUE))
+ {
+ alt406=2;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 406;
+ EXCEPTION->state = 1;
+
+
+ goto rulecom_portEx;
+
+ }
+ }
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 406;
+ EXCEPTION->state = 0;
+
+
+ goto rulecom_portEx;
+
+ }
+
+ switch (alt406)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4535:4: ( qualifiedNameID '->' )=>m= qualifiedNameID '->' (cp= com_port_id[ machine , comMachine ] | LBRACKET (cp= com_port_id[ machine , comMachine ] ( COMMA cp= com_port_id[ machine , comMachine ] )* | STAR ) RBRACKET )
+ {
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_com_port14786);
+ m=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecom_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ comMachine = sep::ParserUtil::getMachine(machine, m.s
+ , m.nb
+ );
+ }
+
+
+ MATCHT(164, &FOLLOW_164_in_com_port14800);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4541:4: (cp= com_port_id[ machine , comMachine ] | LBRACKET (cp= com_port_id[ machine , comMachine ] ( COMMA cp= com_port_id[ machine , comMachine ] )* | STAR ) RBRACKET )
+ {
+ int alt405=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt405=1;
+ }
+ break;
+ case LBRACKET:
+ {
+ alt405=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 405;
+ EXCEPTION->state = 0;
+
+
+ goto rulecom_portEx;
+
+ }
+
+ switch (alt405)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4541:6: cp= com_port_id[ machine , comMachine ]
+ {
+ FOLLOWPUSH(FOLLOW_com_port_id_in_com_port14810);
+ cp=com_port_id(ctx, machine, comMachine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecom_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ comRoute->appendComPoint(cp
+ );
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4544:6: LBRACKET (cp= com_port_id[ machine , comMachine ] ( COMMA cp= com_port_id[ machine , comMachine ] )* | STAR ) RBRACKET
+ {
+ MATCHT(LBRACKET, &FOLLOW_LBRACKET_in_com_port14826);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4545:6: (cp= com_port_id[ machine , comMachine ] ( COMMA cp= com_port_id[ machine , comMachine ] )* | STAR )
+ {
+ int alt404=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt404=1;
+ }
+ break;
+ case STAR:
+ {
+ alt404=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 404;
+ EXCEPTION->state = 0;
+
+
+ goto rulecom_portEx;
+
+ }
+
+ switch (alt404)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4545:8: cp= com_port_id[ machine , comMachine ] ( COMMA cp= com_port_id[ machine , comMachine ] )*
+ {
+ FOLLOWPUSH(FOLLOW_com_port_id_in_com_port14837);
+ cp=com_port_id(ctx, machine, comMachine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecom_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ comRoute->appendComPoint(cp
+ );
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4548:8: ( COMMA cp= com_port_id[ machine , comMachine ] )*
+
+ for (;;)
+ {
+ int alt403=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt403=1;
+ }
+ break;
+
+ }
+
+ switch (alt403)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4548:10: COMMA cp= com_port_id[ machine , comMachine ]
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_com_port14859);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_com_port_id_in_com_port14864);
+ cp=com_port_id(ctx, machine, comMachine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecom_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ comRoute->appendComPoint(cp
+ );
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop403; /* break out of the loop */
+ break;
+ }
+ }
+ loop403: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4551:8: STAR
+ {
+ MATCHT(STAR, &FOLLOW_STAR_in_com_port14887);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ sep::ComPoint * comPoint = new sep::ComPoint();
+ comPoint->setMachineAllSignal(comMachine);
+ comRoute->setComPoint(comPoint, sep::Modifier::DIRECTION_INOUT_KIND);
+
+ SET_RULE_LOCATION(comPoint);
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(RBRACKET, &FOLLOW_RBRACKET_in_com_port14908);
+ if (HASEXCEPTION())
+ {
+ goto rulecom_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4564:4: cp= com_port_id[ machine , comMachine ]
+ {
+ FOLLOWPUSH(FOLLOW_com_port_id_in_com_port14922);
+ cp=com_port_id(ctx, machine, comMachine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecom_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ comRoute->appendComPoint(cp
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulecom_portEx; /* Prevent compiler warnings */
+ rulecom_portEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(166, com_port_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end com_port */
+
+/**
+ * $ANTLR start com_port_id
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4569:1: com_port_id[ sep::Machine * machine , sep::Machine * comMachine ] returns [ sep::BF comPoint ] : id= qualifiedNameID ;
+ */
+static sep::BF
+com_port_id(pfmlParser ctx, sep::Machine * machine, sep::Machine * comMachine)
+{
+ sep::BF comPoint;
+
+ ANTLR3_UINT32 com_port_id_StartIndex;
+
+ fmlParser_qualifiedNameID_return id;
+ #undef RETURN_TYPE_id
+ #define RETURN_TYPE_id fmlParser_qualifiedNameID_return
+
+ /* Initialize rule variables
+ */
+ com_port_id_StartIndex = INDEX();
+
+
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(167)) )
+ {
+ {
+ }
+
+
+
+ return comPoint;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4575:2: (id= qualifiedNameID )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4575:4: id= qualifiedNameID
+ {
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_com_port_id14951);
+ id=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecom_port_idEx;
+ }
+ if (HASFAILED())
+ {
+ return comPoint;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ sep::ComPoint * aComPoint;
+ comPoint= sep::BF( aComPoint = new sep::ComPoint() );
+
+
+ SET_RULE_LOCATION(aComPoint);
+
+ const sep::BF & comPort = sep::ParserUtil::getComPortSignal(
+ comMachine, id.s
+ , id.nb
+ );
+ if( comPort.valid() )
+ {
+ aComPoint->setMachinePort(comMachine, comPort.to_ptr< sep::Port >());
+ }
+ else
+ {
+ aComPoint->setMachine(comMachine);
+ aComPoint->setMachinePort(NEW_QNID(id.s
+ , id.nb
+ ));
+ }
+
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulecom_port_idEx; /* Prevent compiler warnings */
+ rulecom_port_idEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(167, com_port_id_StartIndex); }
+
+ return comPoint;
+}
+/* $ANTLR end com_port_id */
+
+/**
+ * $ANTLR start statement
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4604:1: statement returns [ sep::BFCode ac ] : (s= statement_assign |s= statement_com |s= statement_constraint |s= statement_jump |s= statement_activity |s= statement_invoke_routine |s= statement_moc |s= statement_invoke |s= statement_invoke_method |s= statement_activity_new |s= statement_ite |s= statement_iteration |s= block_statement |s= prefix_statement |s= statement_prompt |s= meta_statement );
+ */
+static sep::BFCode
+statement(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 statement_StartIndex;
+
+ sep::BFCode s;
+ #undef RETURN_TYPE_s
+ #define RETURN_TYPE_s sep::BFCode
+
+ /* Initialize rule variables
+ */
+ statement_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(168)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4606:2: (s= statement_assign |s= statement_com |s= statement_constraint |s= statement_jump |s= statement_activity |s= statement_invoke_routine |s= statement_moc |s= statement_invoke |s= statement_invoke_method |s= statement_activity_new |s= statement_ite |s= statement_iteration |s= block_statement |s= prefix_statement |s= statement_prompt |s= meta_statement )
+
+ ANTLR3_UINT32 alt407;
+
+ alt407=16;
+
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ {
+ int LA407_1 = LA(2);
+ if ( (synpred709_fml(ctx)))
+ {
+ alt407=1;
+ }
+ else if ( (synpred714_fml(ctx)))
+ {
+ alt407=6;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 407;
+ EXCEPTION->state = 1;
+
+
+ goto rulestatementEx;
+
+ }
+ }
+ }
+ break;
+ case 299:
+ case 300:
+ case 301:
+ case 302:
+ case 303:
+ case 304:
+ case 305:
+ case 336:
+ case 337:
+ case 338:
+ case 339:
+ case 340:
+ case 341:
+ {
+ alt407=2;
+ }
+ break;
+ case 256:
+ case 278:
+ case 290:
+ case 391:
+ {
+ alt407=3;
+ }
+ break;
+ case 247:
+ case 263:
+ case 279:
+ case 364:
+ {
+ alt407=4;
+ }
+ break;
+ case 236:
+ case 267:
+ case 268:
+ case 275:
+ case 282:
+ case 289:
+ case 291:
+ case 292:
+ case 293:
+ case 296:
+ case 312:
+ case 362:
+ case 363:
+ case 368:
+ case 369:
+ case 371:
+ case 377:
+ case 386:
+ case 389:
+ case 415:
+ {
+ alt407=5;
+ }
+ break;
+ case COLONx2:
+ case DECR:
+ case INCR:
+ {
+ alt407=1;
+ }
+ break;
+ case 385:
+ {
+ alt407=7;
+ }
+ break;
+ case LPAREN_INVOKE:
+ {
+ alt407=8;
+ }
+ break;
+ case 250:
+ {
+ alt407=9;
+ }
+ break;
+ case 330:
+ {
+ alt407=10;
+ }
+ break;
+ case 294:
+ {
+ alt407=11;
+ }
+ break;
+ case 269:
+ case 285:
+ case 416:
+ {
+ alt407=12;
+ }
+ break;
+ case LCURLY:
+ {
+ alt407=13;
+ }
+ break;
+ case DOLLAR_LCURLY:
+ {
+ alt407=14;
+ }
+ break;
+ case STATEMENT_PROMPT:
+ {
+ alt407=15;
+ }
+ break;
+ case 154:
+ case 155:
+ case 156:
+ case 157:
+ {
+ alt407=16;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 407;
+ EXCEPTION->state = 0;
+
+
+ goto rulestatementEx;
+
+ }
+
+ switch (alt407)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4606:4: s= statement_assign
+ {
+ FOLLOWPUSH(FOLLOW_statement_assign_in_statement14981);
+ s=statement_assign(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac=
+ s
+ ;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4608:4: s= statement_com
+ {
+ FOLLOWPUSH(FOLLOW_statement_com_in_statement15002);
+ s=statement_com(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac=
+ s
+ ;
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4609:4: s= statement_constraint
+ {
+ FOLLOWPUSH(FOLLOW_statement_constraint_in_statement15025);
+ s=statement_constraint(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac=
+ s
+ ;
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4610:4: s= statement_jump
+ {
+ FOLLOWPUSH(FOLLOW_statement_jump_in_statement15041);
+ s=statement_jump(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac=
+ s
+ ;
+
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4613:4: s= statement_activity
+ {
+ FOLLOWPUSH(FOLLOW_statement_activity_in_statement15065);
+ s=statement_activity(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac=
+ s
+ ;
+
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4614:4: s= statement_invoke_routine
+ {
+ FOLLOWPUSH(FOLLOW_statement_invoke_routine_in_statement15083);
+ s=statement_invoke_routine(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac=
+ s
+ ;
+
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4616:4: s= statement_moc
+ {
+ FOLLOWPUSH(FOLLOW_statement_moc_in_statement15096);
+ s=statement_moc(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac=
+ s
+ ;
+
+ }
+
+
+ }
+ break;
+ case 8:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4618:4: s= statement_invoke
+ {
+ FOLLOWPUSH(FOLLOW_statement_invoke_in_statement15120);
+ s=statement_invoke(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac=
+ s
+ ;
+
+ }
+
+
+ }
+ break;
+ case 9:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4619:4: s= statement_invoke_method
+ {
+ FOLLOWPUSH(FOLLOW_statement_invoke_method_in_statement15140);
+ s=statement_invoke_method(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac=
+ s
+ ;
+
+ }
+
+
+ }
+ break;
+ case 10:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4621:4: s= statement_activity_new
+ {
+ FOLLOWPUSH(FOLLOW_statement_activity_new_in_statement15154);
+ s=statement_activity_new(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac=
+ s
+ ;
+
+ }
+
+
+ }
+ break;
+ case 11:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4623:4: s= statement_ite
+ {
+ FOLLOWPUSH(FOLLOW_statement_ite_in_statement15169);
+ s=statement_ite(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac=
+ s
+ ;
+
+ }
+
+
+ }
+ break;
+ case 12:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4624:4: s= statement_iteration
+ {
+ FOLLOWPUSH(FOLLOW_statement_iteration_in_statement15192);
+ s=statement_iteration(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac=
+ s
+ ;
+
+ }
+
+
+ }
+ break;
+ case 13:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4628:4: s= block_statement
+ {
+ FOLLOWPUSH(FOLLOW_block_statement_in_statement15212);
+ s=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac=
+ s
+ ;
+
+ }
+
+
+ }
+ break;
+ case 14:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4630:4: s= prefix_statement
+ {
+ FOLLOWPUSH(FOLLOW_prefix_statement_in_statement15234);
+ s=prefix_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac=
+ s
+ ;
+
+ }
+
+
+ }
+ break;
+ case 15:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4632:4: s= statement_prompt
+ {
+ FOLLOWPUSH(FOLLOW_statement_prompt_in_statement15255);
+ s=statement_prompt(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac=
+ s
+ ;
+
+ }
+
+
+ }
+ break;
+ case 16:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4634:4: s= meta_statement
+ {
+ FOLLOWPUSH(FOLLOW_meta_statement_in_statement15276);
+ s=meta_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac=
+ s
+ ;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestatementEx; /* Prevent compiler warnings */
+ rulestatementEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(168, statement_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end statement */
+
+/**
+ * $ANTLR start block_statement
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4640:1: block_statement returns [ sep::BFCode ac ] : LCURLY (o= op_block )? (s= statement )* RCURLY ;
+ */
+static sep::BFCode
+block_statement(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 block_statement_StartIndex;
+
+ sep::Operator * o;
+ #undef RETURN_TYPE_o
+ #define RETURN_TYPE_o sep::Operator *
+
+ sep::BFCode s;
+ #undef RETURN_TYPE_s
+ #define RETURN_TYPE_s sep::BFCode
+
+ /* Initialize rule variables
+ */
+ block_statement_StartIndex = INDEX();
+
+
+
+ sep::Operator * op = OP(SEQUENCE);
+ bool implicitSequenceOp = true;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(169)) )
+ {
+ {
+
+ if( implicitSequenceOp && ac
+ .valid() && ac
+ ->singleton() &&
+ sep::OperatorManager::isSchedule(op) )
+ {
+ sep::BFCode singleCode = ac
+ ->first().bfCode();
+ ac= singleCode;
+
+ }
+
+ }
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4654:2: ( LCURLY (o= op_block )? (s= statement )* RCURLY )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4654:4: LCURLY (o= op_block )? (s= statement )* RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_block_statement15317);
+ if (HASEXCEPTION())
+ {
+ goto ruleblock_statementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4654:12: (o= op_block )?
+ {
+ int alt408=2;
+ switch ( LA(1) )
+ {
+ case OP_ATOMIC_SEQUENCE:
+ case OP_CONCURRENCY_AND:
+ case OP_CONCURRENCY_ASYNC:
+ case OP_CONCURRENCY_INTERLEAVING:
+ case OP_CONCURRENCY_OR:
+ case OP_CONCURRENCY_PARALLEL:
+ case OP_CONCURRENCY_RDV_AND:
+ case OP_CONCURRENCY_RDV_ASYNC:
+ case OP_CONCURRENCY_RDV_INTERLEAVING:
+ case OP_CONCURRENCY_RDV_OR:
+ case OP_CONCURRENCY_RDV_PARALLEL:
+ case OP_FORK:
+ case OP_JOIN:
+ case OP_NON_DETERMINISM:
+ case OP_SCHEDULE_AND_THEN:
+ case OP_SCHEDULE_GT:
+ case OP_SCHEDULE_LT:
+ case OP_SCHEDULE_OR_ELSE:
+ case OP_SCHEDULE_XOR:
+ case OP_SEQUENCE:
+ case OP_SEQUENCE_SIDE:
+ case OP_SEQUENCE_WEAK:
+ {
+ alt408=1;
+ }
+ break;
+ }
+
+ switch (alt408)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4654:14: o= op_block
+ {
+ FOLLOWPUSH(FOLLOW_op_block_in_block_statement15324);
+ o=op_block(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleblock_statementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op = o
+ ; implicitSequenceOp = false;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT(op);
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4656:6: (s= statement )*
+
+ for (;;)
+ {
+ int alt409=2;
+ switch ( LA(1) )
+ {
+ case COLONx2:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case ID:
+ case INCR:
+ case LCURLY:
+ case LPAREN_INVOKE:
+ case STATEMENT_PROMPT:
+ case 154:
+ case 155:
+ case 156:
+ case 157:
+ case 236:
+ case 247:
+ case 250:
+ case 256:
+ case 263:
+ case 267:
+ case 268:
+ case 269:
+ case 275:
+ case 278:
+ case 279:
+ case 282:
+ case 285:
+ case 289:
+ case 290:
+ case 291:
+ case 292:
+ case 293:
+ case 294:
+ case 296:
+ case 299:
+ case 300:
+ case 301:
+ case 302:
+ case 303:
+ case 304:
+ case 305:
+ case 312:
+ case 330:
+ case 336:
+ case 337:
+ case 338:
+ case 339:
+ case 340:
+ case 341:
+ case 362:
+ case 363:
+ case 364:
+ case 368:
+ case 369:
+ case 371:
+ case 377:
+ case 385:
+ case 386:
+ case 389:
+ case 391:
+ case 415:
+ case 416:
+ {
+ alt409=1;
+ }
+ break;
+
+ }
+
+ switch (alt409)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4656:9: s= statement
+ {
+ FOLLOWPUSH(FOLLOW_statement_in_block_statement15348);
+ s=statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleblock_statementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append(s
+ );
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop409; /* break out of the loop */
+ break;
+ }
+ }
+ loop409: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_block_statement15360);
+ if (HASEXCEPTION())
+ {
+ goto ruleblock_statementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleblock_statementEx; /* Prevent compiler warnings */
+ ruleblock_statementEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ if( implicitSequenceOp && ac
+ .valid() && ac
+ ->singleton() &&
+ sep::OperatorManager::isSchedule(op) )
+ {
+ sep::BFCode singleCode = ac
+ ->first().bfCode();
+ ac= singleCode;
+
+ }
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(169, block_statement_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end block_statement */
+
+/**
+ * $ANTLR start op_block
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4660:1: op_block returns [ sep::Operator * op ] : (o= op_sequence |o= op_scheduling |o= op_concurrency | OP_FORK | OP_JOIN );
+ */
+static sep::Operator *
+op_block(pfmlParser ctx)
+{
+ sep::Operator * op;
+
+ ANTLR3_UINT32 op_block_StartIndex;
+
+ sep::Operator * o;
+ #undef RETURN_TYPE_o
+ #define RETURN_TYPE_o sep::Operator *
+
+ /* Initialize rule variables
+ */
+ op_block_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(170)) )
+ {
+ {
+ }
+
+
+
+ return op;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4662:2: (o= op_sequence |o= op_scheduling |o= op_concurrency | OP_FORK | OP_JOIN )
+
+ ANTLR3_UINT32 alt410;
+
+ alt410=5;
+
+ switch ( LA(1) )
+ {
+ case OP_ATOMIC_SEQUENCE:
+ case OP_SEQUENCE:
+ case OP_SEQUENCE_SIDE:
+ case OP_SEQUENCE_WEAK:
+ {
+ alt410=1;
+ }
+ break;
+ case OP_NON_DETERMINISM:
+ case OP_SCHEDULE_AND_THEN:
+ case OP_SCHEDULE_GT:
+ case OP_SCHEDULE_LT:
+ case OP_SCHEDULE_OR_ELSE:
+ case OP_SCHEDULE_XOR:
+ {
+ alt410=2;
+ }
+ break;
+ case OP_CONCURRENCY_AND:
+ case OP_CONCURRENCY_ASYNC:
+ case OP_CONCURRENCY_INTERLEAVING:
+ case OP_CONCURRENCY_OR:
+ case OP_CONCURRENCY_PARALLEL:
+ case OP_CONCURRENCY_RDV_AND:
+ case OP_CONCURRENCY_RDV_ASYNC:
+ case OP_CONCURRENCY_RDV_INTERLEAVING:
+ case OP_CONCURRENCY_RDV_OR:
+ case OP_CONCURRENCY_RDV_PARALLEL:
+ {
+ alt410=3;
+ }
+ break;
+ case OP_FORK:
+ {
+ alt410=4;
+ }
+ break;
+ case OP_JOIN:
+ {
+ alt410=5;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return op;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 410;
+ EXCEPTION->state = 0;
+
+
+ goto ruleop_blockEx;
+
+ }
+
+ switch (alt410)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4662:4: o= op_sequence
+ {
+ FOLLOWPUSH(FOLLOW_op_sequence_in_op_block15377);
+ o=op_sequence(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleop_blockEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op=
+ o
+ ;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4663:4: o= op_scheduling
+ {
+ FOLLOWPUSH(FOLLOW_op_scheduling_in_op_block15389);
+ o=op_scheduling(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleop_blockEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op=
+ o
+ ;
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4664:4: o= op_concurrency
+ {
+ FOLLOWPUSH(FOLLOW_op_concurrency_in_op_block15399);
+ o=op_concurrency(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleop_blockEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op=
+ o
+ ;
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4666:4: OP_FORK
+ {
+ MATCHT(OP_FORK, &FOLLOW_OP_FORK_in_op_block15407);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_blockEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(FORK);
+
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4667:4: OP_JOIN
+ {
+ MATCHT(OP_JOIN, &FOLLOW_OP_JOIN_in_op_block15423);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_blockEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(JOIN);
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleop_blockEx; /* Prevent compiler warnings */
+ ruleop_blockEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(170, op_block_StartIndex); }
+
+ return op;
+}
+/* $ANTLR end op_block */
+
+/**
+ * $ANTLR start op_sequence
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4670:1: op_sequence returns [ sep::Operator * op ] : ( OP_SEQUENCE | OP_SEQUENCE_SIDE | OP_SEQUENCE_WEAK | OP_ATOMIC_SEQUENCE );
+ */
+static sep::Operator *
+op_sequence(pfmlParser ctx)
+{
+ sep::Operator * op;
+
+ ANTLR3_UINT32 op_sequence_StartIndex;
+
+ /* Initialize rule variables
+ */
+ op_sequence_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(171)) )
+ {
+ {
+ }
+
+
+
+ return op;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4672:2: ( OP_SEQUENCE | OP_SEQUENCE_SIDE | OP_SEQUENCE_WEAK | OP_ATOMIC_SEQUENCE )
+
+ ANTLR3_UINT32 alt411;
+
+ alt411=4;
+
+ switch ( LA(1) )
+ {
+ case OP_SEQUENCE:
+ {
+ alt411=1;
+ }
+ break;
+ case OP_SEQUENCE_SIDE:
+ {
+ alt411=2;
+ }
+ break;
+ case OP_SEQUENCE_WEAK:
+ {
+ alt411=3;
+ }
+ break;
+ case OP_ATOMIC_SEQUENCE:
+ {
+ alt411=4;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return op;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 411;
+ EXCEPTION->state = 0;
+
+
+ goto ruleop_sequenceEx;
+
+ }
+
+ switch (alt411)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4672:4: OP_SEQUENCE
+ {
+ MATCHT(OP_SEQUENCE, &FOLLOW_OP_SEQUENCE_in_op_sequence15449);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_sequenceEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(SEQUENCE);
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4673:4: OP_SEQUENCE_SIDE
+ {
+ MATCHT(OP_SEQUENCE_SIDE, &FOLLOW_OP_SEQUENCE_SIDE_in_op_sequence15464);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_sequenceEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(SEQUENCE_SIDE);
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4674:4: OP_SEQUENCE_WEAK
+ {
+ MATCHT(OP_SEQUENCE_WEAK, &FOLLOW_OP_SEQUENCE_WEAK_in_op_sequence15474);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_sequenceEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(SEQUENCE_WEAK);
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4676:4: OP_ATOMIC_SEQUENCE
+ {
+ MATCHT(OP_ATOMIC_SEQUENCE, &FOLLOW_OP_ATOMIC_SEQUENCE_in_op_sequence15485);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_sequenceEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(ATOMIC_SEQUENCE);
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleop_sequenceEx; /* Prevent compiler warnings */
+ ruleop_sequenceEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(171, op_sequence_StartIndex); }
+
+ return op;
+}
+/* $ANTLR end op_sequence */
+
+/**
+ * $ANTLR start op_scheduling
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4679:1: op_scheduling returns [ sep::Operator * op ] : ( OP_SCHEDULE_GT | OP_SCHEDULE_LT | OP_SCHEDULE_XOR | OP_SCHEDULE_AND_THEN | OP_SCHEDULE_OR_ELSE | OP_NON_DETERMINISM );
+ */
+static sep::Operator *
+op_scheduling(pfmlParser ctx)
+{
+ sep::Operator * op;
+
+ ANTLR3_UINT32 op_scheduling_StartIndex;
+
+ /* Initialize rule variables
+ */
+ op_scheduling_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(172)) )
+ {
+ {
+ }
+
+
+
+ return op;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4681:2: ( OP_SCHEDULE_GT | OP_SCHEDULE_LT | OP_SCHEDULE_XOR | OP_SCHEDULE_AND_THEN | OP_SCHEDULE_OR_ELSE | OP_NON_DETERMINISM )
+
+ ANTLR3_UINT32 alt412;
+
+ alt412=6;
+
+ switch ( LA(1) )
+ {
+ case OP_SCHEDULE_GT:
+ {
+ alt412=1;
+ }
+ break;
+ case OP_SCHEDULE_LT:
+ {
+ alt412=2;
+ }
+ break;
+ case OP_SCHEDULE_XOR:
+ {
+ alt412=3;
+ }
+ break;
+ case OP_SCHEDULE_AND_THEN:
+ {
+ alt412=4;
+ }
+ break;
+ case OP_SCHEDULE_OR_ELSE:
+ {
+ alt412=5;
+ }
+ break;
+ case OP_NON_DETERMINISM:
+ {
+ alt412=6;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return op;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 412;
+ EXCEPTION->state = 0;
+
+
+ goto ruleop_schedulingEx;
+
+ }
+
+ switch (alt412)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4681:4: OP_SCHEDULE_GT
+ {
+ MATCHT(OP_SCHEDULE_GT, &FOLLOW_OP_SCHEDULE_GT_in_op_scheduling15503);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_schedulingEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(PRIOR_GT);
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4682:4: OP_SCHEDULE_LT
+ {
+ MATCHT(OP_SCHEDULE_LT, &FOLLOW_OP_SCHEDULE_LT_in_op_scheduling15517);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_schedulingEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(PRIOR_LT);
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4683:4: OP_SCHEDULE_XOR
+ {
+ MATCHT(OP_SCHEDULE_XOR, &FOLLOW_OP_SCHEDULE_XOR_in_op_scheduling15531);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_schedulingEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(EXCLUSIVE);
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4685:4: OP_SCHEDULE_AND_THEN
+ {
+ MATCHT(OP_SCHEDULE_AND_THEN, &FOLLOW_OP_SCHEDULE_AND_THEN_in_op_scheduling15545);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_schedulingEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(SCHEDULE_AND_THEN);
+
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4686:4: OP_SCHEDULE_OR_ELSE
+ {
+ MATCHT(OP_SCHEDULE_OR_ELSE, &FOLLOW_OP_SCHEDULE_OR_ELSE_in_op_scheduling15553);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_schedulingEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(SCHEDULE_OR_ELSE);
+
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4688:4: OP_NON_DETERMINISM
+ {
+ MATCHT(OP_NON_DETERMINISM, &FOLLOW_OP_NON_DETERMINISM_in_op_scheduling15563);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_schedulingEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(NONDETERMINISM);
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleop_schedulingEx; /* Prevent compiler warnings */
+ ruleop_schedulingEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(172, op_scheduling_StartIndex); }
+
+ return op;
+}
+/* $ANTLR end op_scheduling */
+
+/**
+ * $ANTLR start op_concurrency
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4691:1: op_concurrency returns [ sep::Operator * op ] : ( OP_CONCURRENCY_ASYNC | OP_CONCURRENCY_AND | OP_CONCURRENCY_OR | OP_CONCURRENCY_INTERLEAVING | OP_CONCURRENCY_PARALLEL | OP_CONCURRENCY_RDV_ASYNC | OP_CONCURRENCY_RDV_AND | OP_CONCURRENCY_RDV_OR | OP_CONCURRENCY_RDV_INTERLEAVING | OP_CONCURRENCY_RDV_PARALLEL );
+ */
+static sep::Operator *
+op_concurrency(pfmlParser ctx)
+{
+ sep::Operator * op;
+
+ ANTLR3_UINT32 op_concurrency_StartIndex;
+
+ /* Initialize rule variables
+ */
+ op_concurrency_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(173)) )
+ {
+ {
+ }
+
+
+
+ return op;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4693:2: ( OP_CONCURRENCY_ASYNC | OP_CONCURRENCY_AND | OP_CONCURRENCY_OR | OP_CONCURRENCY_INTERLEAVING | OP_CONCURRENCY_PARALLEL | OP_CONCURRENCY_RDV_ASYNC | OP_CONCURRENCY_RDV_AND | OP_CONCURRENCY_RDV_OR | OP_CONCURRENCY_RDV_INTERLEAVING | OP_CONCURRENCY_RDV_PARALLEL )
+
+ ANTLR3_UINT32 alt413;
+
+ alt413=10;
+
+ switch ( LA(1) )
+ {
+ case OP_CONCURRENCY_ASYNC:
+ {
+ alt413=1;
+ }
+ break;
+ case OP_CONCURRENCY_AND:
+ {
+ alt413=2;
+ }
+ break;
+ case OP_CONCURRENCY_OR:
+ {
+ alt413=3;
+ }
+ break;
+ case OP_CONCURRENCY_INTERLEAVING:
+ {
+ alt413=4;
+ }
+ break;
+ case OP_CONCURRENCY_PARALLEL:
+ {
+ alt413=5;
+ }
+ break;
+ case OP_CONCURRENCY_RDV_ASYNC:
+ {
+ alt413=6;
+ }
+ break;
+ case OP_CONCURRENCY_RDV_AND:
+ {
+ alt413=7;
+ }
+ break;
+ case OP_CONCURRENCY_RDV_OR:
+ {
+ alt413=8;
+ }
+ break;
+ case OP_CONCURRENCY_RDV_INTERLEAVING:
+ {
+ alt413=9;
+ }
+ break;
+ case OP_CONCURRENCY_RDV_PARALLEL:
+ {
+ alt413=10;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return op;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 413;
+ EXCEPTION->state = 0;
+
+
+ goto ruleop_concurrencyEx;
+
+ }
+
+ switch (alt413)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4693:4: OP_CONCURRENCY_ASYNC
+ {
+ MATCHT(OP_CONCURRENCY_ASYNC, &FOLLOW_OP_CONCURRENCY_ASYNC_in_op_concurrency15583);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_concurrencyEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(ASYNCHRONOUS);
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4694:4: OP_CONCURRENCY_AND
+ {
+ MATCHT(OP_CONCURRENCY_AND, &FOLLOW_OP_CONCURRENCY_AND_in_op_concurrency15601);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_concurrencyEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(STRONG_SYNCHRONOUS);
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4695:4: OP_CONCURRENCY_OR
+ {
+ MATCHT(OP_CONCURRENCY_OR, &FOLLOW_OP_CONCURRENCY_OR_in_op_concurrency15621);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_concurrencyEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(WEAK_SYNCHRONOUS);
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4696:4: OP_CONCURRENCY_INTERLEAVING
+ {
+ MATCHT(OP_CONCURRENCY_INTERLEAVING, &FOLLOW_OP_CONCURRENCY_INTERLEAVING_in_op_concurrency15642);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_concurrencyEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(INTERLEAVING);
+
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4697:4: OP_CONCURRENCY_PARALLEL
+ {
+ MATCHT(OP_CONCURRENCY_PARALLEL, &FOLLOW_OP_CONCURRENCY_PARALLEL_in_op_concurrency15653);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_concurrencyEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(PARALLEL);
+
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4699:4: OP_CONCURRENCY_RDV_ASYNC
+ {
+ MATCHT(OP_CONCURRENCY_RDV_ASYNC, &FOLLOW_OP_CONCURRENCY_RDV_ASYNC_in_op_concurrency15669);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_concurrencyEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(RDV_ASYNCHRONOUS);
+
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4700:4: OP_CONCURRENCY_RDV_AND
+ {
+ MATCHT(OP_CONCURRENCY_RDV_AND, &FOLLOW_OP_CONCURRENCY_RDV_AND_in_op_concurrency15683);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_concurrencyEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(RDV_STRONG_SYNCHRONOUS);
+
+ }
+
+
+ }
+ break;
+ case 8:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4701:4: OP_CONCURRENCY_RDV_OR
+ {
+ MATCHT(OP_CONCURRENCY_RDV_OR, &FOLLOW_OP_CONCURRENCY_RDV_OR_in_op_concurrency15699);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_concurrencyEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(RDV_WEAK_SYNCHRONOUS);
+
+ }
+
+
+ }
+ break;
+ case 9:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4702:4: OP_CONCURRENCY_RDV_INTERLEAVING
+ {
+ MATCHT(OP_CONCURRENCY_RDV_INTERLEAVING, &FOLLOW_OP_CONCURRENCY_RDV_INTERLEAVING_in_op_concurrency15716);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_concurrencyEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(RDV_INTERLEAVING);
+
+ }
+
+
+ }
+ break;
+ case 10:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4703:4: OP_CONCURRENCY_RDV_PARALLEL
+ {
+ MATCHT(OP_CONCURRENCY_RDV_PARALLEL, &FOLLOW_OP_CONCURRENCY_RDV_PARALLEL_in_op_concurrency15723);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_concurrencyEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(RDV_PARALLEL);
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleop_concurrencyEx; /* Prevent compiler warnings */
+ ruleop_concurrencyEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(173, op_concurrency_StartIndex); }
+
+ return op;
+}
+/* $ANTLR end op_concurrency */
+
+/**
+ * $ANTLR start op_invokable
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4708:1: op_invokable returns [ sep::Operator * op ] : ( PLUS | MINUS | STAR | DIV | MOD | EQUAL | NEQUAL | SEQUAL | NSEQUAL | GT | GTE | LT_ | LTE | LNOT | LAND | LAND_THEN | LOR | LOR_ELSE | BNOT | BAND | BOR | BXOR | LSHIFT | RSHIFT | ASSIGN | ASSIGN_AFTER | ASSIGN_REF | ASSIGN_MACRO | OP_PUSH | OP_ASSIGN_TOP | OP_TOP | OP_POP );
+ */
+static sep::Operator *
+op_invokable(pfmlParser ctx)
+{
+ sep::Operator * op;
+
+ ANTLR3_UINT32 op_invokable_StartIndex;
+
+ /* Initialize rule variables
+ */
+ op_invokable_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(174)) )
+ {
+ {
+ }
+
+
+
+ return op;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4710:2: ( PLUS | MINUS | STAR | DIV | MOD | EQUAL | NEQUAL | SEQUAL | NSEQUAL | GT | GTE | LT_ | LTE | LNOT | LAND | LAND_THEN | LOR | LOR_ELSE | BNOT | BAND | BOR | BXOR | LSHIFT | RSHIFT | ASSIGN | ASSIGN_AFTER | ASSIGN_REF | ASSIGN_MACRO | OP_PUSH | OP_ASSIGN_TOP | OP_TOP | OP_POP )
+
+ ANTLR3_UINT32 alt414;
+
+ alt414=32;
+
+ switch ( LA(1) )
+ {
+ case PLUS:
+ {
+ alt414=1;
+ }
+ break;
+ case MINUS:
+ {
+ alt414=2;
+ }
+ break;
+ case STAR:
+ {
+ alt414=3;
+ }
+ break;
+ case DIV:
+ {
+ alt414=4;
+ }
+ break;
+ case MOD:
+ {
+ alt414=5;
+ }
+ break;
+ case EQUAL:
+ {
+ alt414=6;
+ }
+ break;
+ case NEQUAL:
+ {
+ alt414=7;
+ }
+ break;
+ case SEQUAL:
+ {
+ alt414=8;
+ }
+ break;
+ case NSEQUAL:
+ {
+ alt414=9;
+ }
+ break;
+ case GT:
+ {
+ alt414=10;
+ }
+ break;
+ case GTE:
+ {
+ alt414=11;
+ }
+ break;
+ case LT_:
+ {
+ alt414=12;
+ }
+ break;
+ case LTE:
+ {
+ alt414=13;
+ }
+ break;
+ case LNOT:
+ {
+ alt414=14;
+ }
+ break;
+ case LAND:
+ {
+ alt414=15;
+ }
+ break;
+ case LAND_THEN:
+ {
+ alt414=16;
+ }
+ break;
+ case LOR:
+ {
+ alt414=17;
+ }
+ break;
+ case LOR_ELSE:
+ {
+ alt414=18;
+ }
+ break;
+ case BNOT:
+ {
+ alt414=19;
+ }
+ break;
+ case BAND:
+ {
+ alt414=20;
+ }
+ break;
+ case BOR:
+ {
+ alt414=21;
+ }
+ break;
+ case BXOR:
+ {
+ alt414=22;
+ }
+ break;
+ case LSHIFT:
+ {
+ alt414=23;
+ }
+ break;
+ case RSHIFT:
+ {
+ alt414=24;
+ }
+ break;
+ case ASSIGN:
+ {
+ alt414=25;
+ }
+ break;
+ case ASSIGN_AFTER:
+ {
+ alt414=26;
+ }
+ break;
+ case ASSIGN_REF:
+ {
+ alt414=27;
+ }
+ break;
+ case ASSIGN_MACRO:
+ {
+ alt414=28;
+ }
+ break;
+ case OP_PUSH:
+ {
+ alt414=29;
+ }
+ break;
+ case OP_ASSIGN_TOP:
+ {
+ alt414=30;
+ }
+ break;
+ case OP_TOP:
+ {
+ alt414=31;
+ }
+ break;
+ case OP_POP:
+ {
+ alt414=32;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return op;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 414;
+ EXCEPTION->state = 0;
+
+
+ goto ruleop_invokableEx;
+
+ }
+
+ switch (alt414)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4710:4: PLUS
+ {
+ MATCHT(PLUS, &FOLLOW_PLUS_in_op_invokable15746);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(PLUS);
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4712:4: MINUS
+ {
+ MATCHT(MINUS, &FOLLOW_MINUS_in_op_invokable15766);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(MINUS);
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4714:4: STAR
+ {
+ MATCHT(STAR, &FOLLOW_STAR_in_op_invokable15785);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(MULT);
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4715:4: DIV
+ {
+ MATCHT(DIV, &FOLLOW_DIV_in_op_invokable15804);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(DIV);
+
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4716:4: MOD
+ {
+ MATCHT(MOD, &FOLLOW_MOD_in_op_invokable15824);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(MOD);
+
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4720:4: EQUAL
+ {
+ MATCHT(EQUAL, &FOLLOW_EQUAL_in_op_invokable15847);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(EQ);
+
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4721:4: NEQUAL
+ {
+ MATCHT(NEQUAL, &FOLLOW_NEQUAL_in_op_invokable15865);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(NEQ);
+
+ }
+
+
+ }
+ break;
+ case 8:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4723:4: SEQUAL
+ {
+ MATCHT(SEQUAL, &FOLLOW_SEQUAL_in_op_invokable15883);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(SEQ);
+
+ }
+
+
+ }
+ break;
+ case 9:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4724:4: NSEQUAL
+ {
+ MATCHT(NSEQUAL, &FOLLOW_NSEQUAL_in_op_invokable15900);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(NSEQ);
+
+ }
+
+
+ }
+ break;
+ case 10:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4726:4: GT
+ {
+ MATCHT(GT, &FOLLOW_GT_in_op_invokable15917);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(GT);
+
+ }
+
+
+ }
+ break;
+ case 11:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4727:4: GTE
+ {
+ MATCHT(GTE, &FOLLOW_GTE_in_op_invokable15938);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(GTE);
+
+ }
+
+
+ }
+ break;
+ case 12:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4728:4: LT_
+ {
+ MATCHT(LT_, &FOLLOW_LT__in_op_invokable15958);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(LT);
+
+ }
+
+
+ }
+ break;
+ case 13:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4729:4: LTE
+ {
+ MATCHT(LTE, &FOLLOW_LTE_in_op_invokable15978);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(LTE);
+
+ }
+
+
+ }
+ break;
+ case 14:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4731:4: LNOT
+ {
+ MATCHT(LNOT, &FOLLOW_LNOT_in_op_invokable15999);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(NOT);
+
+ }
+
+
+ }
+ break;
+ case 15:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4732:4: LAND
+ {
+ MATCHT(LAND, &FOLLOW_LAND_in_op_invokable16018);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(AND);
+
+ }
+
+
+ }
+ break;
+ case 16:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4733:4: LAND_THEN
+ {
+ MATCHT(LAND_THEN, &FOLLOW_LAND_THEN_in_op_invokable16037);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(AND_THEN);
+
+ }
+
+
+ }
+ break;
+ case 17:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4734:4: LOR
+ {
+ MATCHT(LOR, &FOLLOW_LOR_in_op_invokable16051);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(OR);
+
+ }
+
+
+ }
+ break;
+ case 18:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4735:4: LOR_ELSE
+ {
+ MATCHT(LOR_ELSE, &FOLLOW_LOR_ELSE_in_op_invokable16071);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(OR_ELSE);
+
+ }
+
+
+ }
+ break;
+ case 19:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4737:4: BNOT
+ {
+ MATCHT(BNOT, &FOLLOW_BNOT_in_op_invokable16087);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(BNOT);
+
+ }
+
+
+ }
+ break;
+ case 20:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4738:4: BAND
+ {
+ MATCHT(BAND, &FOLLOW_BAND_in_op_invokable16106);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(BAND);
+
+ }
+
+
+ }
+ break;
+ case 21:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4739:4: BOR
+ {
+ MATCHT(BOR, &FOLLOW_BOR_in_op_invokable16125);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(BOR);
+
+ }
+
+
+ }
+ break;
+ case 22:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4740:4: BXOR
+ {
+ MATCHT(BXOR, &FOLLOW_BXOR_in_op_invokable16145);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(BXOR);
+
+ }
+
+
+ }
+ break;
+ case 23:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4742:4: LSHIFT
+ {
+ MATCHT(LSHIFT, &FOLLOW_LSHIFT_in_op_invokable16165);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(LSHIFT);
+
+ }
+
+
+ }
+ break;
+ case 24:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4743:4: RSHIFT
+ {
+ MATCHT(RSHIFT, &FOLLOW_RSHIFT_in_op_invokable16182);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(RSHIFT);
+
+ }
+
+
+ }
+ break;
+ case 25:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4745:4: ASSIGN
+ {
+ MATCHT(ASSIGN, &FOLLOW_ASSIGN_in_op_invokable16200);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(ASSIGN);
+
+ }
+
+
+ }
+ break;
+ case 26:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4746:4: ASSIGN_AFTER
+ {
+ MATCHT(ASSIGN_AFTER, &FOLLOW_ASSIGN_AFTER_in_op_invokable16217);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(ASSIGN_AFTER);
+
+ }
+
+
+ }
+ break;
+ case 27:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4747:4: ASSIGN_REF
+ {
+ MATCHT(ASSIGN_REF, &FOLLOW_ASSIGN_REF_in_op_invokable16228);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(ASSIGN_REF);
+
+ }
+
+
+ }
+ break;
+ case 28:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4748:4: ASSIGN_MACRO
+ {
+ MATCHT(ASSIGN_MACRO, &FOLLOW_ASSIGN_MACRO_in_op_invokable16241);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(ASSIGN_MACRO);
+
+ }
+
+
+ }
+ break;
+ case 29:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4750:4: OP_PUSH
+ {
+ MATCHT(OP_PUSH, &FOLLOW_OP_PUSH_in_op_invokable16253);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(PUSH);
+
+ }
+
+
+ }
+ break;
+ case 30:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4751:4: OP_ASSIGN_TOP
+ {
+ MATCHT(OP_ASSIGN_TOP, &FOLLOW_OP_ASSIGN_TOP_in_op_invokable16269);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(ASSIGN_TOP);
+
+ }
+
+
+ }
+ break;
+ case 31:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4752:4: OP_TOP
+ {
+ MATCHT(OP_TOP, &FOLLOW_OP_TOP_in_op_invokable16279);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(TOP);
+
+ }
+
+
+ }
+ break;
+ case 32:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4753:4: OP_POP
+ {
+ MATCHT(OP_POP, &FOLLOW_OP_POP_in_op_invokable16296);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_invokableEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(POP);
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleop_invokableEx; /* Prevent compiler warnings */
+ ruleop_invokableEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(174, op_invokable_StartIndex); }
+
+ return op;
+}
+/* $ANTLR end op_invokable */
+
+/**
+ * $ANTLR start prefix_statement
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4760:1: prefix_statement returns [ sep::BFCode ac ] : DOLLAR_LCURLY op= avm_operator (ps= prefix_statement |e= unaryExpression )* RCURLY ;
+ */
+static sep::BFCode
+prefix_statement(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 prefix_statement_StartIndex;
+
+ sep::Operator * op;
+ #undef RETURN_TYPE_op
+ #define RETURN_TYPE_op sep::Operator *
+
+ sep::BFCode ps;
+ #undef RETURN_TYPE_ps
+ #define RETURN_TYPE_ps sep::BFCode
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ prefix_statement_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(175)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4762:2: ( DOLLAR_LCURLY op= avm_operator (ps= prefix_statement |e= unaryExpression )* RCURLY )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4762:4: DOLLAR_LCURLY op= avm_operator (ps= prefix_statement |e= unaryExpression )* RCURLY
+ {
+ MATCHT(DOLLAR_LCURLY, &FOLLOW_DOLLAR_LCURLY_in_prefix_statement16327);
+ if (HASEXCEPTION())
+ {
+ goto ruleprefix_statementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_avm_operator_in_prefix_statement16332);
+ op=avm_operator(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprefix_statementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT(op);
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4763:6: (ps= prefix_statement |e= unaryExpression )*
+
+ for (;;)
+ {
+ int alt415=3;
+ switch ( LA(1) )
+ {
+ case DOLLAR_LCURLY:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA415_1 = LA(2);
+ if ( (synpred778_fml(ctx)))
+ {
+ alt415=1;
+ }
+ else if ( (synpred779_fml(ctx)))
+ {
+ alt415=2;
+ }
+
+ }
+ }
+ break;
+ case BNOT:
+ case COLONx2:
+ case CharLiteral:
+ case DECR:
+ case FloatLiteral:
+ case ID:
+ case INCR:
+ case IntegerLiteral:
+ case LBRACKET:
+ case LBRACKET_BAR:
+ case LCURLY:
+ case LNOT:
+ case LPAREN:
+ case LPAREN_INVOKE:
+ case MINUS:
+ case OP_POP:
+ case OP_TOP:
+ case PERCENT_LCURLY:
+ case PLUS:
+ case RationalLiteral:
+ case StringLiteral:
+ case 158:
+ case 159:
+ case 160:
+ case 161:
+ case 162:
+ case 237:
+ case 256:
+ case 265:
+ case 277:
+ case 280:
+ case 294:
+ case 313:
+ case 330:
+ case 331:
+ case 332:
+ case 343:
+ case 347:
+ case 372:
+ case 397:
+ {
+ alt415=2;
+ }
+ break;
+
+ }
+
+ switch (alt415)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4763:8: ps= prefix_statement
+ {
+ FOLLOWPUSH(FOLLOW_prefix_statement_in_prefix_statement16346);
+ ps=prefix_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprefix_statementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append(ps
+ );
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4764:8: e= unaryExpression
+ {
+ FOLLOWPUSH(FOLLOW_unaryExpression_in_prefix_statement16367);
+ e=unaryExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprefix_statementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append(e
+ );
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop415; /* break out of the loop */
+ break;
+ }
+ }
+ loop415: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_prefix_statement16392);
+ if (HASEXCEPTION())
+ {
+ goto ruleprefix_statementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleprefix_statementEx; /* Prevent compiler warnings */
+ ruleprefix_statementEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(175, prefix_statement_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end prefix_statement */
+
+/**
+ * $ANTLR start prefix_expression
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4769:1: prefix_expression returns [ sep::BFCode ac ] : DOLLAR_LCURLY op= avm_operator (ps= prefix_expression |e= unaryExpression )* RCURLY ;
+ */
+static sep::BFCode
+prefix_expression(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 prefix_expression_StartIndex;
+
+ sep::Operator * op;
+ #undef RETURN_TYPE_op
+ #define RETURN_TYPE_op sep::Operator *
+
+ sep::BFCode ps;
+ #undef RETURN_TYPE_ps
+ #define RETURN_TYPE_ps sep::BFCode
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ prefix_expression_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(176)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4771:2: ( DOLLAR_LCURLY op= avm_operator (ps= prefix_expression |e= unaryExpression )* RCURLY )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4771:4: DOLLAR_LCURLY op= avm_operator (ps= prefix_expression |e= unaryExpression )* RCURLY
+ {
+ MATCHT(DOLLAR_LCURLY, &FOLLOW_DOLLAR_LCURLY_in_prefix_expression16407);
+ if (HASEXCEPTION())
+ {
+ goto ruleprefix_expressionEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_avm_operator_in_prefix_expression16412);
+ op=avm_operator(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprefix_expressionEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT(op);
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4772:6: (ps= prefix_expression |e= unaryExpression )*
+
+ for (;;)
+ {
+ int alt416=3;
+ switch ( LA(1) )
+ {
+ case DOLLAR_LCURLY:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA416_1 = LA(2);
+ if ( (synpred780_fml(ctx)))
+ {
+ alt416=1;
+ }
+ else if ( (synpred781_fml(ctx)))
+ {
+ alt416=2;
+ }
+
+ }
+ }
+ break;
+ case BNOT:
+ case COLONx2:
+ case CharLiteral:
+ case DECR:
+ case FloatLiteral:
+ case ID:
+ case INCR:
+ case IntegerLiteral:
+ case LBRACKET:
+ case LBRACKET_BAR:
+ case LCURLY:
+ case LNOT:
+ case LPAREN:
+ case LPAREN_INVOKE:
+ case MINUS:
+ case OP_POP:
+ case OP_TOP:
+ case PERCENT_LCURLY:
+ case PLUS:
+ case RationalLiteral:
+ case StringLiteral:
+ case 158:
+ case 159:
+ case 160:
+ case 161:
+ case 162:
+ case 237:
+ case 256:
+ case 265:
+ case 277:
+ case 280:
+ case 294:
+ case 313:
+ case 330:
+ case 331:
+ case 332:
+ case 343:
+ case 347:
+ case 372:
+ case 397:
+ {
+ alt416=2;
+ }
+ break;
+
+ }
+
+ switch (alt416)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4772:8: ps= prefix_expression
+ {
+ FOLLOWPUSH(FOLLOW_prefix_expression_in_prefix_expression16426);
+ ps=prefix_expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprefix_expressionEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append(ps
+ );
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4773:8: e= unaryExpression
+ {
+ FOLLOWPUSH(FOLLOW_unaryExpression_in_prefix_expression16446);
+ e=unaryExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprefix_expressionEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append(e
+ );
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop416; /* break out of the loop */
+ break;
+ }
+ }
+ loop416: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_prefix_expression16471);
+ if (HASEXCEPTION())
+ {
+ goto ruleprefix_expressionEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleprefix_expressionEx; /* Prevent compiler warnings */
+ ruleprefix_expressionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(176, prefix_expression_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end prefix_expression */
+
+/**
+ * $ANTLR start avm_operator
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4778:1: avm_operator returns [ sep::Operator * op ] : (o= op_invokable |o= op_activity |{...}? ID );
+ */
+static sep::Operator *
+avm_operator(pfmlParser ctx)
+{
+ sep::Operator * op;
+
+ ANTLR3_UINT32 avm_operator_StartIndex;
+
+ sep::Operator * o;
+ #undef RETURN_TYPE_o
+ #define RETURN_TYPE_o sep::Operator *
+
+ /* Initialize rule variables
+ */
+ avm_operator_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(177)) )
+ {
+ {
+ }
+
+
+
+ return op;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4780:2: (o= op_invokable |o= op_activity |{...}? ID )
+
+ ANTLR3_UINT32 alt417;
+
+ alt417=3;
+
+ switch ( LA(1) )
+ {
+ case ASSIGN:
+ case ASSIGN_AFTER:
+ case ASSIGN_MACRO:
+ case ASSIGN_REF:
+ case BAND:
+ case BNOT:
+ case BOR:
+ case BXOR:
+ case DIV:
+ case EQUAL:
+ case GT:
+ case GTE:
+ case LAND:
+ case LAND_THEN:
+ case LNOT:
+ case LOR:
+ case LOR_ELSE:
+ case LSHIFT:
+ case LTE:
+ case LT_:
+ case MINUS:
+ case MOD:
+ case NEQUAL:
+ case NSEQUAL:
+ case OP_ASSIGN_TOP:
+ case OP_POP:
+ case OP_PUSH:
+ case OP_TOP:
+ case PLUS:
+ case RSHIFT:
+ case SEQUAL:
+ case STAR:
+ {
+ alt417=1;
+ }
+ break;
+ case 236:
+ case 267:
+ case 268:
+ case 275:
+ case 282:
+ case 291:
+ case 292:
+ case 293:
+ case 296:
+ case 362:
+ case 363:
+ case 368:
+ case 369:
+ case 371:
+ case 377:
+ case 386:
+ case 389:
+ case 415:
+ {
+ alt417=2;
+ }
+ break;
+ case ID:
+ {
+ alt417=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return op;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 417;
+ EXCEPTION->state = 0;
+
+
+ goto ruleavm_operatorEx;
+
+ }
+
+ switch (alt417)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4780:4: o= op_invokable
+ {
+ FOLLOWPUSH(FOLLOW_op_invokable_in_avm_operator16488);
+ o=op_invokable(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleavm_operatorEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op=
+ o
+ ;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4782:4: o= op_activity
+ {
+ FOLLOWPUSH(FOLLOW_op_activity_in_avm_operator16500);
+ o=op_activity(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleavm_operatorEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op=
+ o
+ ;
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4784:4: {...}? ID
+ {
+ if ( !(( (op = sep::OperatorManager::getOp(STR(LT(1)->getText(LT(1))->chars))) != NULL )) )
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return op;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_FAILED_PREDICATE_EXCEPTION;
+ EXCEPTION->message = (void *)" (op = sep::OperatorManager::getOp(STR(LT(1)->getText(LT(1))->chars))) != NULL ";
+ EXCEPTION->ruleName = (void *)"avm_operator";
+
+
+ }
+
+ MATCHT(ID, &FOLLOW_ID_in_avm_operator16512);
+ if (HASEXCEPTION())
+ {
+ goto ruleavm_operatorEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleavm_operatorEx; /* Prevent compiler warnings */
+ ruleavm_operatorEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(177, avm_operator_StartIndex); }
+
+ return op;
+}
+/* $ANTLR end avm_operator */
+
+/**
+ * $ANTLR start statement_invoke_method
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4792:1: statement_invoke_method returns [ sep::BFCode ac ] : 'call' id= ID ( decl_instance_machine_params[ callProcedure ] )? ( decl_instance_machine_returns[ callProcedure ] )? SEMI ;
+ */
+static sep::BFCode
+statement_invoke_method(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 statement_invoke_method_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+
+ /* Initialize rule variables
+ */
+ statement_invoke_method_StartIndex = INDEX();
+
+
+
+ sep::BF modelProcedure;
+ sep::Machine * callProcedure;
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(178)) )
+ {
+ {
+
+ SET_RULE_LOCATION(callProcedure);
+
+ }
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ id = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4804:2: ( 'call' id= ID ( decl_instance_machine_params[ callProcedure ] )? ( decl_instance_machine_returns[ callProcedure ] )? SEMI )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4804:4: 'call' id= ID ( decl_instance_machine_params[ callProcedure ] )? ( decl_instance_machine_returns[ callProcedure ] )? SEMI
+ {
+ MATCHT(250, &FOLLOW_250_in_statement_invoke_method16541);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_invoke_methodEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_statement_invoke_method16545);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_invoke_methodEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ modelProcedure = sep::ParserUtil::getvarProcedure(STR((id->getText(id))->chars));
+
+ callProcedure = sep::Machine::newProcedureInstance(_CPM_,
+ sep::OSS() << "call_" << ++mProcedureCallCount
+ << '#' << STR((id->getText(id))->chars), modelProcedure);
+
+ callProcedure->getwSpecifier().setDesignInstanceStatic();
+
+
+ ac= NEW_STMT1(OP(INVOKE_METHOD), sep::BF(callProcedure));
+
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4817:4: ( decl_instance_machine_params[ callProcedure ] )?
+ {
+ int alt418=2;
+ switch ( LA(1) )
+ {
+ case LPAREN:
+ {
+ alt418=1;
+ }
+ break;
+ }
+
+ switch (alt418)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4817:4: decl_instance_machine_params[ callProcedure ]
+ {
+ FOLLOWPUSH(FOLLOW_decl_instance_machine_params_in_statement_invoke_method16556);
+ decl_instance_machine_params(ctx, callProcedure);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_invoke_methodEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4818:4: ( decl_instance_machine_returns[ callProcedure ] )?
+ {
+ int alt419=2;
+ switch ( LA(1) )
+ {
+ case 163:
+ case 365:
+ {
+ alt419=1;
+ }
+ break;
+ }
+
+ switch (alt419)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4818:4: decl_instance_machine_returns[ callProcedure ]
+ {
+ FOLLOWPUSH(FOLLOW_decl_instance_machine_returns_in_statement_invoke_method16565);
+ decl_instance_machine_returns(ctx, callProcedure);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_invoke_methodEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_invoke_method16574);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_invoke_methodEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestatement_invoke_methodEx; /* Prevent compiler warnings */
+ rulestatement_invoke_methodEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ SET_RULE_LOCATION(callProcedure);
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(178, statement_invoke_method_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end statement_invoke_method */
+
+/**
+ * $ANTLR start statement_invoke
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4824:1: statement_invoke returns [ sep::BFCode ac ] : LPAREN_INVOKE ue= unaryExpression (id= ID | 'in' |op= op_invokable ) (e= expression )* ( 'provided:' e= expression | 'from:' ue= unaryExpression | 'to:' ue= unaryExpression | 'activity:' o= op_activity )? RPAREN SEMI ;
+ */
+static sep::BFCode
+statement_invoke(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 statement_invoke_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ sep::BF ue;
+ #undef RETURN_TYPE_ue
+ #define RETURN_TYPE_ue sep::BF
+
+ sep::Operator * op;
+ #undef RETURN_TYPE_op
+ #define RETURN_TYPE_op sep::Operator *
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ sep::Operator * o;
+ #undef RETURN_TYPE_o
+ #define RETURN_TYPE_o sep::Operator *
+
+ /* Initialize rule variables
+ */
+ statement_invoke_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(179)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ id = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4826:2: ( LPAREN_INVOKE ue= unaryExpression (id= ID | 'in' |op= op_invokable ) (e= expression )* ( 'provided:' e= expression | 'from:' ue= unaryExpression | 'to:' ue= unaryExpression | 'activity:' o= op_activity )? RPAREN SEMI )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4826:4: LPAREN_INVOKE ue= unaryExpression (id= ID | 'in' |op= op_invokable ) (e= expression )* ( 'provided:' e= expression | 'from:' ue= unaryExpression | 'to:' ue= unaryExpression | 'activity:' o= op_activity )? RPAREN SEMI
+ {
+ MATCHT(LPAREN_INVOKE, &FOLLOW_LPAREN_INVOKE_in_statement_invoke16590);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_unaryExpression_in_statement_invoke16599);
+ ue=unaryExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT1(OP(INVOKE_METHOD),
+ ue
+ );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4828:6: (id= ID | 'in' |op= op_invokable )
+ {
+ int alt420=3;
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt420=1;
+ }
+ break;
+ case 295:
+ {
+ alt420=2;
+ }
+ break;
+ case ASSIGN:
+ case ASSIGN_AFTER:
+ case ASSIGN_MACRO:
+ case ASSIGN_REF:
+ case BAND:
+ case BNOT:
+ case BOR:
+ case BXOR:
+ case DIV:
+ case EQUAL:
+ case GT:
+ case GTE:
+ case LAND:
+ case LAND_THEN:
+ case LNOT:
+ case LOR:
+ case LOR_ELSE:
+ case LSHIFT:
+ case LTE:
+ case LT_:
+ case MINUS:
+ case MOD:
+ case NEQUAL:
+ case NSEQUAL:
+ case OP_ASSIGN_TOP:
+ case OP_POP:
+ case OP_PUSH:
+ case OP_TOP:
+ case PLUS:
+ case RSHIFT:
+ case SEQUAL:
+ case STAR:
+ {
+ alt420=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 420;
+ EXCEPTION->state = 0;
+
+
+ goto rulestatement_invokeEx;
+
+ }
+
+ switch (alt420)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4828:8: id= ID
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_statement_invoke16612);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append(sep::ParserUtil::getInvokable(ue
+ , STR((id->getText(id))->chars)));
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4829:8: 'in'
+ {
+ MATCHT(295, &FOLLOW_295_in_statement_invoke16634);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append( INCR_BF(OP(IN)) );
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4830:8: op= op_invokable
+ {
+ FOLLOWPUSH(FOLLOW_op_invokable_in_statement_invoke16659);
+ op=op_invokable(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append( INCR_BF(op
+ ) );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4832:6: (e= expression )*
+
+ for (;;)
+ {
+ int alt421=2;
+ switch ( LA(1) )
+ {
+ case BNOT:
+ case COLONx2:
+ case CharLiteral:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case FloatLiteral:
+ case ID:
+ case INCR:
+ case IntegerLiteral:
+ case LBRACKET:
+ case LBRACKET_BAR:
+ case LCURLY:
+ case LNOT:
+ case LPAREN:
+ case LPAREN_INVOKE:
+ case MINUS:
+ case OP_POP:
+ case OP_TOP:
+ case PERCENT_LCURLY:
+ case PLUS:
+ case RationalLiteral:
+ case StringLiteral:
+ case 158:
+ case 159:
+ case 160:
+ case 161:
+ case 162:
+ case 237:
+ case 256:
+ case 265:
+ case 277:
+ case 280:
+ case 294:
+ case 313:
+ case 330:
+ case 331:
+ case 332:
+ case 343:
+ case 347:
+ case 372:
+ case 397:
+ {
+ alt421=1;
+ }
+ break;
+
+ }
+
+ switch (alt421)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4832:8: e= expression
+ {
+ FOLLOWPUSH(FOLLOW_expression_in_statement_invoke16680);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append(e
+ );
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop421; /* break out of the loop */
+ break;
+ }
+ }
+ loop421: ; /* Jump out to here if this rule does not match */
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4833:6: ( 'provided:' e= expression | 'from:' ue= unaryExpression | 'to:' ue= unaryExpression | 'activity:' o= op_activity )?
+ {
+ int alt422=5;
+ switch ( LA(1) )
+ {
+ case 354:
+ {
+ alt422=1;
+ }
+ break;
+ case 287:
+ {
+ alt422=2;
+ }
+ break;
+ case 394:
+ {
+ alt422=3;
+ }
+ break;
+ case 238:
+ {
+ alt422=4;
+ }
+ break;
+ }
+
+ switch (alt422)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4833:8: 'provided:' e= expression
+ {
+ MATCHT(354, &FOLLOW_354_in_statement_invoke16698);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_invoke16704);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4834:8: 'from:' ue= unaryExpression
+ {
+ MATCHT(287, &FOLLOW_287_in_statement_invoke16713);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_unaryExpression_in_statement_invoke16723);
+ ue=unaryExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4835:8: 'to:' ue= unaryExpression
+ {
+ MATCHT(394, &FOLLOW_394_in_statement_invoke16732);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_unaryExpression_in_statement_invoke16744);
+ ue=unaryExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4836:8: 'activity:' o= op_activity
+ {
+ MATCHT(238, &FOLLOW_238_in_statement_invoke16753);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_op_activity_in_statement_invoke16759);
+ o=op_activity(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_statement_invoke16772);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_invoke16777);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestatement_invokeEx; /* Prevent compiler warnings */
+ rulestatement_invokeEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(179, statement_invoke_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end statement_invoke */
+
+/**
+ * $ANTLR start expression_invoke
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4842:1: expression_invoke returns [ sep::BFCode ac ] : LPAREN_INVOKE e= unaryExpression (id= ID | 'in' |op= op_invokable ) (e= expression )* ( 'provided:' e= expression | 'from:' ue= unaryExpression | 'to:' ue= unaryExpression | 'activity:' o= op_activity )? RPAREN ;
+ */
+static sep::BFCode
+expression_invoke(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 expression_invoke_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ sep::Operator * op;
+ #undef RETURN_TYPE_op
+ #define RETURN_TYPE_op sep::Operator *
+
+ sep::BF ue;
+ #undef RETURN_TYPE_ue
+ #define RETURN_TYPE_ue sep::BF
+
+ sep::Operator * o;
+ #undef RETURN_TYPE_o
+ #define RETURN_TYPE_o sep::Operator *
+
+ /* Initialize rule variables
+ */
+ expression_invoke_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(180)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ id = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4844:2: ( LPAREN_INVOKE e= unaryExpression (id= ID | 'in' |op= op_invokable ) (e= expression )* ( 'provided:' e= expression | 'from:' ue= unaryExpression | 'to:' ue= unaryExpression | 'activity:' o= op_activity )? RPAREN )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4844:4: LPAREN_INVOKE e= unaryExpression (id= ID | 'in' |op= op_invokable ) (e= expression )* ( 'provided:' e= expression | 'from:' ue= unaryExpression | 'to:' ue= unaryExpression | 'activity:' o= op_activity )? RPAREN
+ {
+ MATCHT(LPAREN_INVOKE, &FOLLOW_LPAREN_INVOKE_in_expression_invoke16792);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_unaryExpression_in_expression_invoke16801);
+ e=unaryExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT1(OP(INVOKE_METHOD),
+ e
+ );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4846:6: (id= ID | 'in' |op= op_invokable )
+ {
+ int alt423=3;
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt423=1;
+ }
+ break;
+ case 295:
+ {
+ alt423=2;
+ }
+ break;
+ case ASSIGN:
+ case ASSIGN_AFTER:
+ case ASSIGN_MACRO:
+ case ASSIGN_REF:
+ case BAND:
+ case BNOT:
+ case BOR:
+ case BXOR:
+ case DIV:
+ case EQUAL:
+ case GT:
+ case GTE:
+ case LAND:
+ case LAND_THEN:
+ case LNOT:
+ case LOR:
+ case LOR_ELSE:
+ case LSHIFT:
+ case LTE:
+ case LT_:
+ case MINUS:
+ case MOD:
+ case NEQUAL:
+ case NSEQUAL:
+ case OP_ASSIGN_TOP:
+ case OP_POP:
+ case OP_PUSH:
+ case OP_TOP:
+ case PLUS:
+ case RSHIFT:
+ case SEQUAL:
+ case STAR:
+ {
+ alt423=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 423;
+ EXCEPTION->state = 0;
+
+
+ goto ruleexpression_invokeEx;
+
+ }
+
+ switch (alt423)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4846:8: id= ID
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_expression_invoke16815);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append(sep::ParserUtil::getInvokable(e
+ , STR((id->getText(id))->chars)));
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4847:8: 'in'
+ {
+ MATCHT(295, &FOLLOW_295_in_expression_invoke16837);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append( INCR_BF(OP(IN)) );
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4848:8: op= op_invokable
+ {
+ FOLLOWPUSH(FOLLOW_op_invokable_in_expression_invoke16862);
+ op=op_invokable(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append( INCR_BF(op
+ ) );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4850:6: (e= expression )*
+
+ for (;;)
+ {
+ int alt424=2;
+ switch ( LA(1) )
+ {
+ case BNOT:
+ case COLONx2:
+ case CharLiteral:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case FloatLiteral:
+ case ID:
+ case INCR:
+ case IntegerLiteral:
+ case LBRACKET:
+ case LBRACKET_BAR:
+ case LCURLY:
+ case LNOT:
+ case LPAREN:
+ case LPAREN_INVOKE:
+ case MINUS:
+ case OP_POP:
+ case OP_TOP:
+ case PERCENT_LCURLY:
+ case PLUS:
+ case RationalLiteral:
+ case StringLiteral:
+ case 158:
+ case 159:
+ case 160:
+ case 161:
+ case 162:
+ case 237:
+ case 256:
+ case 265:
+ case 277:
+ case 280:
+ case 294:
+ case 313:
+ case 330:
+ case 331:
+ case 332:
+ case 343:
+ case 347:
+ case 372:
+ case 397:
+ {
+ alt424=1;
+ }
+ break;
+
+ }
+
+ switch (alt424)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4850:8: e= expression
+ {
+ FOLLOWPUSH(FOLLOW_expression_in_expression_invoke16883);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append(e
+ );
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop424; /* break out of the loop */
+ break;
+ }
+ }
+ loop424: ; /* Jump out to here if this rule does not match */
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4851:6: ( 'provided:' e= expression | 'from:' ue= unaryExpression | 'to:' ue= unaryExpression | 'activity:' o= op_activity )?
+ {
+ int alt425=5;
+ switch ( LA(1) )
+ {
+ case 354:
+ {
+ alt425=1;
+ }
+ break;
+ case 287:
+ {
+ alt425=2;
+ }
+ break;
+ case 394:
+ {
+ alt425=3;
+ }
+ break;
+ case 238:
+ {
+ alt425=4;
+ }
+ break;
+ }
+
+ switch (alt425)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4851:8: 'provided:' e= expression
+ {
+ MATCHT(354, &FOLLOW_354_in_expression_invoke16901);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression_invoke16907);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4852:8: 'from:' ue= unaryExpression
+ {
+ MATCHT(287, &FOLLOW_287_in_expression_invoke16916);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_unaryExpression_in_expression_invoke16925);
+ ue=unaryExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4853:8: 'to:' ue= unaryExpression
+ {
+ MATCHT(394, &FOLLOW_394_in_expression_invoke16934);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_unaryExpression_in_expression_invoke16945);
+ ue=unaryExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4854:8: 'activity:' o= op_activity
+ {
+ MATCHT(238, &FOLLOW_238_in_expression_invoke16954);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_op_activity_in_expression_invoke16960);
+ o=op_activity(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_expression_invoke16973);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleexpression_invokeEx; /* Prevent compiler warnings */
+ ruleexpression_invokeEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(180, expression_invoke_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end expression_invoke */
+
+/**
+ * $ANTLR start statement_activity_new
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4864:1: statement_activity_new returns [ sep::BFCode ac ] : 'new' id= qualifiedNameID decl_instance_dynamic_impl[ _CPM_ , ptrInstance ] ( ( '-->' | 'returns:' ) e= expression )? SEMI ;
+ */
+static sep::BFCode
+statement_activity_new(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 statement_activity_new_StartIndex;
+
+ fmlParser_qualifiedNameID_return id;
+ #undef RETURN_TYPE_id
+ #define RETURN_TYPE_id fmlParser_qualifiedNameID_return
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ statement_activity_new_StartIndex = INDEX();
+
+
+
+ sep::Machine * ptrInstance = NULL;
+ sep::BF aModel;
+
+ sep::Machine * container = _CPM_;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(181)) )
+ {
+ {
+
+ if( aModel.is< sep::Machine >() )
+ {
+ POP_CTX;
+ }
+
+ }
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4878:2: ( 'new' id= qualifiedNameID decl_instance_dynamic_impl[ _CPM_ , ptrInstance ] ( ( '-->' | 'returns:' ) e= expression )? SEMI )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4878:4: 'new' id= qualifiedNameID decl_instance_dynamic_impl[ _CPM_ , ptrInstance ] ( ( '-->' | 'returns:' ) e= expression )? SEMI
+ {
+ MATCHT(330, &FOLLOW_330_in_statement_activity_new17001);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_activity_newEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT(OP(INVOKE_NEW));
+
+ }
+
+
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_statement_activity_new17012);
+ id=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_activity_newEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ aModel = sep::ParserUtil::getvarMachine(id.s
+ , id.nb
+ );
+
+ if( aModel.is< sep::Machine >() )
+ {
+ PUSH_CTX_NEW( aModel.to_ptr< sep::Machine >() );
+ }
+
+ ptrInstance = sep::Machine::newInstance(container,
+ newInvokeNewInstanceNameID(container, id.s
+ ), aModel, 1, 1);
+
+ ptrInstance->getwSpecifier().override_ifdef(
+ sep::Specifier::DESIGN_INSTANCE_DYNAMIC_SPECIFIER );
+
+ ac
+ ->append( container->saveOwnedElement( ptrInstance ) );
+
+ }
+
+
+ FOLLOWPUSH(FOLLOW_decl_instance_dynamic_impl_in_statement_activity_new17027);
+ decl_instance_dynamic_impl(ctx, _CPM_, ptrInstance);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_activity_newEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4900:4: ( ( '-->' | 'returns:' ) e= expression )?
+ {
+ int alt426=2;
+ switch ( LA(1) )
+ {
+ case 163:
+ case 365:
+ {
+ alt426=1;
+ }
+ break;
+ }
+
+ switch (alt426)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4900:6: ( '-->' | 'returns:' ) e= expression
+ {
+ if ( LA(1) == 163 || LA(1) == 365 )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulestatement_activity_newEx;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_activity_new17048);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_activity_newEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_activity_new17060);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_activity_newEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestatement_activity_newEx; /* Prevent compiler warnings */
+ rulestatement_activity_newEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ if( aModel.is< sep::Machine >() )
+ {
+ POP_CTX;
+ }
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(181, statement_activity_new_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end statement_activity_new */
+
+/**
+ * $ANTLR start decl_instance_dynamic_impl
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4906:1: decl_instance_dynamic_impl[ sep::Machine * container , sep::Machine * ptrInstance ] : ( ( LPAREN )=> LPAREN ( def_instance_on_new_activity[ ptrInstance ] )? RPAREN )? ( ( LCURLY )=> LCURLY (s= statement )* ( def_instance_activity[ ptrInstance ] )* RCURLY )? ;
+ */
+static void
+decl_instance_dynamic_impl(pfmlParser ctx, sep::Machine * container, sep::Machine * ptrInstance)
+{
+ ANTLR3_UINT32 decl_instance_dynamic_impl_StartIndex;
+
+ sep::BFCode s;
+ #undef RETURN_TYPE_s
+ #define RETURN_TYPE_s sep::BFCode
+
+ /* Initialize rule variables
+ */
+ decl_instance_dynamic_impl_StartIndex = INDEX();
+
+
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(182)) )
+ {
+ {
+
+ SET_RULE_LOCATION(ptrInstance);
+
+ }
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4914:2: ( ( ( LPAREN )=> LPAREN ( def_instance_on_new_activity[ ptrInstance ] )? RPAREN )? ( ( LCURLY )=> LCURLY (s= statement )* ( def_instance_activity[ ptrInstance ] )* RCURLY )? )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4914:4: ( ( LPAREN )=> LPAREN ( def_instance_on_new_activity[ ptrInstance ] )? RPAREN )? ( ( LCURLY )=> LCURLY (s= statement )* ( def_instance_activity[ ptrInstance ] )* RCURLY )?
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4914:4: ( ( LPAREN )=> LPAREN ( def_instance_on_new_activity[ ptrInstance ] )? RPAREN )?
+ {
+ int alt428=2;
+ {
+ int LA428_0 = LA(1);
+ if ( (synpred802_fml(ctx)) && (LA428_0 == LPAREN))
+ {
+ alt428=1;
+ }
+ }
+ switch (alt428)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4914:6: ( LPAREN )=> LPAREN ( def_instance_on_new_activity[ ptrInstance ] )? RPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_decl_instance_dynamic_impl17093);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instance_dynamic_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4915:6: ( def_instance_on_new_activity[ ptrInstance ] )?
+ {
+ int alt427=2;
+ switch ( LA(1) )
+ {
+ case BNOT:
+ case COLONx2:
+ case CharLiteral:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case FloatLiteral:
+ case ID:
+ case INCR:
+ case IntegerLiteral:
+ case LBRACKET:
+ case LBRACKET_BAR:
+ case LCURLY:
+ case LNOT:
+ case LPAREN:
+ case LPAREN_INVOKE:
+ case MINUS:
+ case OP_POP:
+ case OP_TOP:
+ case PERCENT_LCURLY:
+ case PLUS:
+ case RationalLiteral:
+ case StringLiteral:
+ case 158:
+ case 159:
+ case 160:
+ case 161:
+ case 162:
+ case 237:
+ case 256:
+ case 265:
+ case 277:
+ case 280:
+ case 294:
+ case 313:
+ case 330:
+ case 331:
+ case 332:
+ case 343:
+ case 347:
+ case 372:
+ case 397:
+ {
+ alt427=1;
+ }
+ break;
+ }
+
+ switch (alt427)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4915:8: def_instance_on_new_activity[ ptrInstance ]
+ {
+ FOLLOWPUSH(FOLLOW_def_instance_on_new_activity_in_decl_instance_dynamic_impl17102);
+ def_instance_on_new_activity(ctx, ptrInstance);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instance_dynamic_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_decl_instance_dynamic_impl17114);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instance_dynamic_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4919:4: ( ( LCURLY )=> LCURLY (s= statement )* ( def_instance_activity[ ptrInstance ] )* RCURLY )?
+ {
+ int alt431=2;
+ {
+ int LA431_0 = LA(1);
+ if ( (synpred804_fml(ctx)) && (LA431_0 == LCURLY))
+ {
+ alt431=1;
+ }
+ }
+ switch (alt431)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4919:6: ( LCURLY )=> LCURLY (s= statement )* ( def_instance_activity[ ptrInstance ] )* RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_decl_instance_dynamic_impl17136);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instance_dynamic_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4920:6: (s= statement )*
+
+ for (;;)
+ {
+ int alt429=2;
+ switch ( LA(1) )
+ {
+ case COLONx2:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case ID:
+ case INCR:
+ case LCURLY:
+ case LPAREN_INVOKE:
+ case STATEMENT_PROMPT:
+ case 154:
+ case 155:
+ case 156:
+ case 157:
+ case 236:
+ case 247:
+ case 250:
+ case 256:
+ case 263:
+ case 267:
+ case 268:
+ case 269:
+ case 275:
+ case 278:
+ case 279:
+ case 282:
+ case 285:
+ case 289:
+ case 290:
+ case 291:
+ case 292:
+ case 293:
+ case 294:
+ case 296:
+ case 299:
+ case 300:
+ case 301:
+ case 302:
+ case 303:
+ case 304:
+ case 305:
+ case 312:
+ case 330:
+ case 336:
+ case 337:
+ case 338:
+ case 339:
+ case 340:
+ case 341:
+ case 362:
+ case 363:
+ case 364:
+ case 368:
+ case 369:
+ case 371:
+ case 377:
+ case 385:
+ case 386:
+ case 389:
+ case 391:
+ case 415:
+ case 416:
+ {
+ alt429=1;
+ }
+ break;
+
+ }
+
+ switch (alt429)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4920:8: s= statement
+ {
+ FOLLOWPUSH(FOLLOW_statement_in_decl_instance_dynamic_impl17147);
+ s=statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instance_dynamic_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ptrInstance->getUniqBehaviorPart()->seqOnCreate(s
+ );
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop429; /* break out of the loop */
+ break;
+ }
+ }
+ loop429: ; /* Jump out to here if this rule does not match */
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4922:6: ( def_instance_activity[ ptrInstance ] )*
+
+ for (;;)
+ {
+ int alt430=2;
+ switch ( LA(1) )
+ {
+ case 177:
+ case 226:
+ {
+ alt430=1;
+ }
+ break;
+
+ }
+
+ switch (alt430)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4922:8: def_instance_activity[ ptrInstance ]
+ {
+ FOLLOWPUSH(FOLLOW_def_instance_activity_in_decl_instance_dynamic_impl17162);
+ def_instance_activity(ctx, ptrInstance);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instance_dynamic_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop430; /* break out of the loop */
+ break;
+ }
+ }
+ loop430: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_decl_instance_dynamic_impl17173);
+ if (HASEXCEPTION())
+ {
+ goto ruledecl_instance_dynamic_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruledecl_instance_dynamic_implEx; /* Prevent compiler warnings */
+ ruledecl_instance_dynamic_implEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ SET_RULE_LOCATION(ptrInstance);
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(182, decl_instance_dynamic_impl_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end decl_instance_dynamic_impl */
+
+/**
+ * $ANTLR start expression_activity_new
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4929:1: expression_activity_new returns [ sep::BFCode ac ] : 'new' id= qualifiedNameID activity_machine_param_return[ aModel , ac ] ;
+ */
+static sep::BFCode
+expression_activity_new(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 expression_activity_new_StartIndex;
+
+ fmlParser_qualifiedNameID_return id;
+ #undef RETURN_TYPE_id
+ #define RETURN_TYPE_id fmlParser_qualifiedNameID_return
+
+ /* Initialize rule variables
+ */
+ expression_activity_new_StartIndex = INDEX();
+
+
+
+ sep::Machine * ptrInstance = NULL;
+ sep::BF aModel;
+
+ sep::Machine * container = _CPM_;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(183)) )
+ {
+ {
+
+ if( aModel.is< sep::Machine >() )
+ {
+ POP_CTX;
+ }
+
+ }
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4943:2: ( 'new' id= qualifiedNameID activity_machine_param_return[ aModel , ac ] )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4943:4: 'new' id= qualifiedNameID activity_machine_param_return[ aModel , ac ]
+ {
+ MATCHT(330, &FOLLOW_330_in_expression_activity_new17204);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_activity_newEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT(OP(INVOKE_NEW));
+
+ }
+
+
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_expression_activity_new17216);
+ id=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_activity_newEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ sep::BF aModel = sep::ParserUtil::getvarMachine(id.s
+ , id.nb
+ );
+
+ if( aModel.is< sep::Machine >() )
+ {
+ PUSH_CTX_NEW( aModel.to_ptr< sep::Machine >() );
+ }
+
+ ptrInstance = sep::Machine::newInstance(container,
+ newInvokeNewInstanceNameID(container, id.s
+ ), aModel, 1, 1);
+
+ ptrInstance->getwSpecifier().override_ifdef(
+ sep::Specifier::DESIGN_INSTANCE_DYNAMIC_SPECIFIER );
+
+ ac
+ ->append( container->saveOwnedElement( ptrInstance ) );
+
+ }
+
+
+ FOLLOWPUSH(FOLLOW_activity_machine_param_return_in_expression_activity_new17227);
+ activity_machine_param_return(ctx, aModel, ac);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_activity_newEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleexpression_activity_newEx; /* Prevent compiler warnings */
+ ruleexpression_activity_newEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ if( aModel.is< sep::Machine >() )
+ {
+ POP_CTX;
+ }
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(183, expression_activity_new_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end expression_activity_new */
+
+/**
+ * $ANTLR start statement_prompt
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4973:1: statement_prompt returns [ sep::BFCode ac ] : STATEMENT_PROMPT spi= statement_prompt_impl ;
+ */
+static sep::BFCode
+statement_prompt(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 statement_prompt_StartIndex;
+
+ sep::BFCode spi;
+ #undef RETURN_TYPE_spi
+ #define RETURN_TYPE_spi sep::BFCode
+
+ /* Initialize rule variables
+ */
+ statement_prompt_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(184)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4975:2: ( STATEMENT_PROMPT spi= statement_prompt_impl )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4975:4: STATEMENT_PROMPT spi= statement_prompt_impl
+ {
+ MATCHT(STATEMENT_PROMPT, &FOLLOW_STATEMENT_PROMPT_in_statement_prompt17251);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_promptEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_statement_prompt_impl_in_statement_prompt17256);
+ spi=statement_prompt_impl(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_promptEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac=
+ spi
+ ;
+
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestatement_promptEx; /* Prevent compiler warnings */
+ rulestatement_promptEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(184, statement_prompt_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end statement_prompt */
+
+/**
+ * $ANTLR start statement_prompt_impl
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4978:1: statement_prompt_impl returns [ sep::BFCode ac ] : spo= statement_prompt_obs ;
+ */
+static sep::BFCode
+statement_prompt_impl(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 statement_prompt_impl_StartIndex;
+
+ sep::BFCode spo;
+ #undef RETURN_TYPE_spo
+ #define RETURN_TYPE_spo sep::BFCode
+
+ /* Initialize rule variables
+ */
+ statement_prompt_impl_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(185)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4980:2: (spo= statement_prompt_obs )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4980:4: spo= statement_prompt_obs
+ {
+ FOLLOWPUSH(FOLLOW_statement_prompt_obs_in_statement_prompt_impl17275);
+ spo=statement_prompt_obs(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_prompt_implEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac=
+ spo
+ ;
+
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestatement_prompt_implEx; /* Prevent compiler warnings */
+ rulestatement_prompt_implEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(185, statement_prompt_impl_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end statement_prompt_impl */
+
+/**
+ * $ANTLR start statement_prompt_obs
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4984:1: statement_prompt_obs returns [ sep::BFCode ac ] :{...}? ID ( 'ctx:' id= qualifiedNameID )? LCURLY bs= statement_prompt_obs_com[ varMachine ] RCURLY ( 'provided:' e= expression | LBRACKET e= expression RBRACKET ) SEMI ;
+ */
+static sep::BFCode
+statement_prompt_obs(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 statement_prompt_obs_StartIndex;
+
+ fmlParser_qualifiedNameID_return id;
+ #undef RETURN_TYPE_id
+ #define RETURN_TYPE_id fmlParser_qualifiedNameID_return
+
+ sep::BFCode bs;
+ #undef RETURN_TYPE_bs
+ #define RETURN_TYPE_bs sep::BFCode
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ statement_prompt_obs_StartIndex = INDEX();
+
+
+
+ sep::BF varMachine = INCR_BF(_SYSTEM_);
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(186)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4989:2: ({...}? ID ( 'ctx:' id= qualifiedNameID )? LCURLY bs= statement_prompt_obs_com[ varMachine ] RCURLY ( 'provided:' e= expression | LBRACKET e= expression RBRACKET ) SEMI )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4989:4: {...}? ID ( 'ctx:' id= qualifiedNameID )? LCURLY bs= statement_prompt_obs_com[ varMachine ] RCURLY ( 'provided:' e= expression | LBRACKET e= expression RBRACKET ) SEMI
+ {
+ if ( !(( IS_KEYWORD( "obs" ) )) )
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_FAILED_PREDICATE_EXCEPTION;
+ EXCEPTION->message = (void *)" IS_KEYWORD( \"obs\" ) ";
+ EXCEPTION->ruleName = (void *)"statement_prompt_obs";
+
+
+ }
+
+ MATCHT(ID, &FOLLOW_ID_in_statement_prompt_obs17300);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_prompt_obsEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4991:4: ( 'ctx:' id= qualifiedNameID )?
+ {
+ int alt432=2;
+ switch ( LA(1) )
+ {
+ case 266:
+ {
+ alt432=1;
+ }
+ break;
+ }
+
+ switch (alt432)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4991:6: 'ctx:' id= qualifiedNameID
+ {
+ MATCHT(266, &FOLLOW_266_in_statement_prompt_obs17308);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_prompt_obsEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_statement_prompt_obs17312);
+ id=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_prompt_obsEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ varMachine = sep::ParserUtil::getvarMachine(id.s
+ , id.nb
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_statement_prompt_obs17329);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_prompt_obsEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_statement_prompt_obs_com_in_statement_prompt_obs17338);
+ bs=statement_prompt_obs_com(ctx, varMachine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_prompt_obsEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_statement_prompt_obs17344);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_prompt_obsEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4999:4: ( 'provided:' e= expression | LBRACKET e= expression RBRACKET )
+ {
+ int alt433=2;
+ switch ( LA(1) )
+ {
+ case 354:
+ {
+ alt433=1;
+ }
+ break;
+ case LBRACKET:
+ {
+ alt433=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 433;
+ EXCEPTION->state = 0;
+
+
+ goto rulestatement_prompt_obsEx;
+
+ }
+
+ switch (alt433)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4999:6: 'provided:' e= expression
+ {
+ MATCHT(354, &FOLLOW_354_in_statement_prompt_obs17352);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_prompt_obsEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_prompt_obs17356);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_prompt_obsEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5000:6: LBRACKET e= expression RBRACKET
+ {
+ MATCHT(LBRACKET, &FOLLOW_LBRACKET_in_statement_prompt_obs17363);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_prompt_obsEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_prompt_obs17367);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_prompt_obsEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(RBRACKET, &FOLLOW_RBRACKET_in_statement_prompt_obs17369);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_prompt_obsEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_prompt_obs17379);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_prompt_obsEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT3(OP(OBS), varMachine,
+ bs
+ , e
+ );
+
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestatement_prompt_obsEx; /* Prevent compiler warnings */
+ rulestatement_prompt_obsEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(186, statement_prompt_obs_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end statement_prompt_obs */
+
+/**
+ * $ANTLR start statement_prompt_obs_com
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5008:1: statement_prompt_obs_com[ const sep::BF & varMachine ] returns [ sep::BFCode ac ] : sc= statement_com ;
+ */
+static sep::BFCode
+statement_prompt_obs_com(pfmlParser ctx, const sep::BF & varMachine)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 statement_prompt_obs_com_StartIndex;
+
+ sep::BFCode sc;
+ #undef RETURN_TYPE_sc
+ #define RETURN_TYPE_sc sep::BFCode
+
+ /* Initialize rule variables
+ */
+ statement_prompt_obs_com_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(187)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5010:2: (sc= statement_com )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5010:4: sc= statement_com
+ {
+ FOLLOWPUSH(FOLLOW_statement_com_in_statement_prompt_obs_com17404);
+ sc=statement_com(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_prompt_obs_comEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac=
+ sc
+ ;
+
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestatement_prompt_obs_comEx; /* Prevent compiler warnings */
+ rulestatement_prompt_obs_comEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(187, statement_prompt_obs_com_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end statement_prompt_obs_com */
+
+/**
+ * $ANTLR start meta_statement
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5018:1: meta_statement returns [ sep::BFCode ac ] : ( '$:informal' bs= block_statement | '$:trace' bs= block_statement | '$:debug' bs= block_statement | '$:comment' bs= block_statement );
+ */
+static sep::BFCode
+meta_statement(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 meta_statement_StartIndex;
+
+ sep::BFCode bs;
+ #undef RETURN_TYPE_bs
+ #define RETURN_TYPE_bs sep::BFCode
+
+ /* Initialize rule variables
+ */
+ meta_statement_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(188)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5020:2: ( '$:informal' bs= block_statement | '$:trace' bs= block_statement | '$:debug' bs= block_statement | '$:comment' bs= block_statement )
+
+ ANTLR3_UINT32 alt434;
+
+ alt434=4;
+
+ switch ( LA(1) )
+ {
+ case 156:
+ {
+ alt434=1;
+ }
+ break;
+ case 157:
+ {
+ alt434=2;
+ }
+ break;
+ case 155:
+ {
+ alt434=3;
+ }
+ break;
+ case 154:
+ {
+ alt434=4;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 434;
+ EXCEPTION->state = 0;
+
+
+ goto rulemeta_statementEx;
+
+ }
+
+ switch (alt434)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5020:4: '$:informal' bs= block_statement
+ {
+ MATCHT(156, &FOLLOW_156_in_meta_statement17427);
+ if (HASEXCEPTION())
+ {
+ goto rulemeta_statementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_meta_statement17432);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulemeta_statementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT1(OP(INFORMAL),
+ bs
+ );
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5021:4: '$:trace' bs= block_statement
+ {
+ MATCHT(157, &FOLLOW_157_in_meta_statement17440);
+ if (HASEXCEPTION())
+ {
+ goto rulemeta_statementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_meta_statement17448);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulemeta_statementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT1(OP(TRACE) ,
+ bs
+ );
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5022:4: '$:debug' bs= block_statement
+ {
+ MATCHT(155, &FOLLOW_155_in_meta_statement17456);
+ if (HASEXCEPTION())
+ {
+ goto rulemeta_statementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_meta_statement17464);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulemeta_statementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT1(OP(DEBUG) ,
+ bs
+ );
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5023:4: '$:comment' bs= block_statement
+ {
+ MATCHT(154, &FOLLOW_154_in_meta_statement17472);
+ if (HASEXCEPTION())
+ {
+ goto rulemeta_statementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_meta_statement17478);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulemeta_statementEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT1(OP(COMMENT) ,
+ bs
+ );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulemeta_statementEx; /* Prevent compiler warnings */
+ rulemeta_statementEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(188, meta_statement_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end meta_statement */
+
+/**
+ * $ANTLR start statement_assign
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5055:1: statement_assign returns [ sep::BFCode ac ] : (lv= lvalue ( ( ASSIGN | ASSIGN_AFTER ) e= expression SEMI | ASSIGN_REF e= lvalue SEMI | ASSIGN_MACRO e= expression SEMI | ( PLUS_ASSIGN | PLUS_ASSIGN_AFTER ) e= expression SEMI | ( MINUS_ASSIGN | MINUS_ASSIGN_AFTER ) e= expression SEMI | ( STAR_ASSIGN | STAR_ASSIGN_AFTER ) e= expression SEMI | ( DIV_ASSIGN | DIV_ASSIGN_AFTER ) e= expression SEMI | ( MOD_ASSIGN | MOD_ASSIGN_AFTER ) e= expression SEMI | ( LAND_ASSIGN | LAND_ASSIGN_AFTER ) e= expression SEMI | ( LOR_ASSIGN | LOR_ASSIGN_AFTER ) e= expression SEMI | ( BAND_ASSIGN | BAND_ASSIGN_AFTER ) e= expression SEMI | ( BOR_ASSIGN | BOR_ASSIGN_AFTER ) e= expression SEMI | ( BXOR_ASSIGN | BXOR_ASSIGN_AFTER ) e= expression SEMI | ( LSHIFT_ASSIGN | LSHIFT_ASSIGN_AFTER ) e= expression SEMI | ( RSHIFT_ASSIGN | RSHIFT_ASSIGN_AFTER ) e= expression SEMI | OP_PUSH e= expression ( OP_PUSH e= expression )* SEMI | OP_ASSIGN_TOP e= expression SEMI | OP_TOP v= lvalue SEMI | OP_POP (v= lvalue )* SEMI | INCR SEMI | DECR SEMI ) | INCR lv= lvalue SEMI | DECR lv= lvalue SEMI );
+ */
+static sep::BFCode
+statement_assign(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 statement_assign_StartIndex;
+
+ sep::BF lv;
+ #undef RETURN_TYPE_lv
+ #define RETURN_TYPE_lv sep::BF
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ sep::BF v;
+ #undef RETURN_TYPE_v
+ #define RETURN_TYPE_v sep::BF
+
+ /* Initialize rule variables
+ */
+ statement_assign_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(189)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5058:2: (lv= lvalue ( ( ASSIGN | ASSIGN_AFTER ) e= expression SEMI | ASSIGN_REF e= lvalue SEMI | ASSIGN_MACRO e= expression SEMI | ( PLUS_ASSIGN | PLUS_ASSIGN_AFTER ) e= expression SEMI | ( MINUS_ASSIGN | MINUS_ASSIGN_AFTER ) e= expression SEMI | ( STAR_ASSIGN | STAR_ASSIGN_AFTER ) e= expression SEMI | ( DIV_ASSIGN | DIV_ASSIGN_AFTER ) e= expression SEMI | ( MOD_ASSIGN | MOD_ASSIGN_AFTER ) e= expression SEMI | ( LAND_ASSIGN | LAND_ASSIGN_AFTER ) e= expression SEMI | ( LOR_ASSIGN | LOR_ASSIGN_AFTER ) e= expression SEMI | ( BAND_ASSIGN | BAND_ASSIGN_AFTER ) e= expression SEMI | ( BOR_ASSIGN | BOR_ASSIGN_AFTER ) e= expression SEMI | ( BXOR_ASSIGN | BXOR_ASSIGN_AFTER ) e= expression SEMI | ( LSHIFT_ASSIGN | LSHIFT_ASSIGN_AFTER ) e= expression SEMI | ( RSHIFT_ASSIGN | RSHIFT_ASSIGN_AFTER ) e= expression SEMI | OP_PUSH e= expression ( OP_PUSH e= expression )* SEMI | OP_ASSIGN_TOP e= expression SEMI | OP_TOP v= lvalue SEMI | OP_POP (v= lvalue )* SEMI | INCR SEMI | DECR SEMI ) | INCR lv= lvalue SEMI | DECR lv= lvalue SEMI )
+
+ ANTLR3_UINT32 alt438;
+
+ alt438=3;
+
+ switch ( LA(1) )
+ {
+ case COLONx2:
+ case ID:
+ {
+ alt438=1;
+ }
+ break;
+ case INCR:
+ {
+ alt438=2;
+ }
+ break;
+ case DECR:
+ {
+ alt438=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 438;
+ EXCEPTION->state = 0;
+
+
+ goto rulestatement_assignEx;
+
+ }
+
+ switch (alt438)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5058:4: lv= lvalue ( ( ASSIGN | ASSIGN_AFTER ) e= expression SEMI | ASSIGN_REF e= lvalue SEMI | ASSIGN_MACRO e= expression SEMI | ( PLUS_ASSIGN | PLUS_ASSIGN_AFTER ) e= expression SEMI | ( MINUS_ASSIGN | MINUS_ASSIGN_AFTER ) e= expression SEMI | ( STAR_ASSIGN | STAR_ASSIGN_AFTER ) e= expression SEMI | ( DIV_ASSIGN | DIV_ASSIGN_AFTER ) e= expression SEMI | ( MOD_ASSIGN | MOD_ASSIGN_AFTER ) e= expression SEMI | ( LAND_ASSIGN | LAND_ASSIGN_AFTER ) e= expression SEMI | ( LOR_ASSIGN | LOR_ASSIGN_AFTER ) e= expression SEMI | ( BAND_ASSIGN | BAND_ASSIGN_AFTER ) e= expression SEMI | ( BOR_ASSIGN | BOR_ASSIGN_AFTER ) e= expression SEMI | ( BXOR_ASSIGN | BXOR_ASSIGN_AFTER ) e= expression SEMI | ( LSHIFT_ASSIGN | LSHIFT_ASSIGN_AFTER ) e= expression SEMI | ( RSHIFT_ASSIGN | RSHIFT_ASSIGN_AFTER ) e= expression SEMI | OP_PUSH e= expression ( OP_PUSH e= expression )* SEMI | OP_ASSIGN_TOP e= expression SEMI | OP_TOP v= lvalue SEMI | OP_POP (v= lvalue )* SEMI | INCR SEMI | DECR SEMI )
+ {
+ FOLLOWPUSH(FOLLOW_lvalue_in_statement_assign17510);
+ lv=lvalue(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5059:2: ( ( ASSIGN | ASSIGN_AFTER ) e= expression SEMI | ASSIGN_REF e= lvalue SEMI | ASSIGN_MACRO e= expression SEMI | ( PLUS_ASSIGN | PLUS_ASSIGN_AFTER ) e= expression SEMI | ( MINUS_ASSIGN | MINUS_ASSIGN_AFTER ) e= expression SEMI | ( STAR_ASSIGN | STAR_ASSIGN_AFTER ) e= expression SEMI | ( DIV_ASSIGN | DIV_ASSIGN_AFTER ) e= expression SEMI | ( MOD_ASSIGN | MOD_ASSIGN_AFTER ) e= expression SEMI | ( LAND_ASSIGN | LAND_ASSIGN_AFTER ) e= expression SEMI | ( LOR_ASSIGN | LOR_ASSIGN_AFTER ) e= expression SEMI | ( BAND_ASSIGN | BAND_ASSIGN_AFTER ) e= expression SEMI | ( BOR_ASSIGN | BOR_ASSIGN_AFTER ) e= expression SEMI | ( BXOR_ASSIGN | BXOR_ASSIGN_AFTER ) e= expression SEMI | ( LSHIFT_ASSIGN | LSHIFT_ASSIGN_AFTER ) e= expression SEMI | ( RSHIFT_ASSIGN | RSHIFT_ASSIGN_AFTER ) e= expression SEMI | OP_PUSH e= expression ( OP_PUSH e= expression )* SEMI | OP_ASSIGN_TOP e= expression SEMI | OP_TOP v= lvalue SEMI | OP_POP (v= lvalue )* SEMI | INCR SEMI | DECR SEMI )
+ {
+ int alt437=21;
+ switch ( LA(1) )
+ {
+ case ASSIGN:
+ case ASSIGN_AFTER:
+ {
+ alt437=1;
+ }
+ break;
+ case ASSIGN_REF:
+ {
+ alt437=2;
+ }
+ break;
+ case ASSIGN_MACRO:
+ {
+ alt437=3;
+ }
+ break;
+ case PLUS_ASSIGN:
+ case PLUS_ASSIGN_AFTER:
+ {
+ alt437=4;
+ }
+ break;
+ case MINUS_ASSIGN:
+ case MINUS_ASSIGN_AFTER:
+ {
+ alt437=5;
+ }
+ break;
+ case STAR_ASSIGN:
+ case STAR_ASSIGN_AFTER:
+ {
+ alt437=6;
+ }
+ break;
+ case DIV_ASSIGN:
+ case DIV_ASSIGN_AFTER:
+ {
+ alt437=7;
+ }
+ break;
+ case MOD_ASSIGN:
+ case MOD_ASSIGN_AFTER:
+ {
+ alt437=8;
+ }
+ break;
+ case LAND_ASSIGN:
+ case LAND_ASSIGN_AFTER:
+ {
+ alt437=9;
+ }
+ break;
+ case LOR_ASSIGN:
+ case LOR_ASSIGN_AFTER:
+ {
+ alt437=10;
+ }
+ break;
+ case BAND_ASSIGN:
+ case BAND_ASSIGN_AFTER:
+ {
+ alt437=11;
+ }
+ break;
+ case BOR_ASSIGN:
+ case BOR_ASSIGN_AFTER:
+ {
+ alt437=12;
+ }
+ break;
+ case BXOR_ASSIGN:
+ case BXOR_ASSIGN_AFTER:
+ {
+ alt437=13;
+ }
+ break;
+ case LSHIFT_ASSIGN:
+ case LSHIFT_ASSIGN_AFTER:
+ {
+ alt437=14;
+ }
+ break;
+ case RSHIFT_ASSIGN:
+ case RSHIFT_ASSIGN_AFTER:
+ {
+ alt437=15;
+ }
+ break;
+ case OP_PUSH:
+ {
+ alt437=16;
+ }
+ break;
+ case OP_ASSIGN_TOP:
+ {
+ alt437=17;
+ }
+ break;
+ case OP_TOP:
+ {
+ alt437=18;
+ }
+ break;
+ case OP_POP:
+ {
+ alt437=19;
+ }
+ break;
+ case INCR:
+ {
+ alt437=20;
+ }
+ break;
+ case DECR:
+ {
+ alt437=21;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 437;
+ EXCEPTION->state = 0;
+
+
+ goto rulestatement_assignEx;
+
+ }
+
+ switch (alt437)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5059:4: ( ASSIGN | ASSIGN_AFTER ) e= expression SEMI
+ {
+ if ( ((LA(1) >= ASSIGN) && (LA(1) <= ASSIGN_AFTER)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulestatement_assignEx;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_assign17528);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_assign17531);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT2(OP(ASSIGN),
+ lv
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5062:4: ASSIGN_REF e= lvalue SEMI
+ {
+ MATCHT(ASSIGN_REF, &FOLLOW_ASSIGN_REF_in_statement_assign17542);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_lvalue_in_statement_assign17547);
+ e=lvalue(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_assign17550);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT2(OP(ASSIGN_REF),
+ lv
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5065:4: ASSIGN_MACRO e= expression SEMI
+ {
+ MATCHT(ASSIGN_MACRO, &FOLLOW_ASSIGN_MACRO_in_statement_assign17559);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_assign17564);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_assign17567);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT2(OP(ASSIGN_MACRO),
+ lv
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5069:4: ( PLUS_ASSIGN | PLUS_ASSIGN_AFTER ) e= expression SEMI
+ {
+ if ( ((LA(1) >= PLUS_ASSIGN) && (LA(1) <= PLUS_ASSIGN_AFTER)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulestatement_assignEx;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_assign17590);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_assign17593);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT_ASSIGN_OP(OP(PLUS),
+ lv
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5072:4: ( MINUS_ASSIGN | MINUS_ASSIGN_AFTER ) e= expression SEMI
+ {
+ if ( ((LA(1) >= MINUS_ASSIGN) && (LA(1) <= MINUS_ASSIGN_AFTER)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulestatement_assignEx;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_assign17615);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_assign17618);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT_ASSIGN_OP(OP(MINUS),
+ lv
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5075:4: ( STAR_ASSIGN | STAR_ASSIGN_AFTER ) e= expression SEMI
+ {
+ if ( ((LA(1) >= STAR_ASSIGN) && (LA(1) <= STAR_ASSIGN_AFTER)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulestatement_assignEx;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_assign17640);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_assign17643);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT_ASSIGN_OP(OP(MULT),
+ lv
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5078:4: ( DIV_ASSIGN | DIV_ASSIGN_AFTER ) e= expression SEMI
+ {
+ if ( ((LA(1) >= DIV_ASSIGN) && (LA(1) <= DIV_ASSIGN_AFTER)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulestatement_assignEx;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_assign17665);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_assign17668);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT_ASSIGN_OP(OP(DIV),
+ lv
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 8:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5081:4: ( MOD_ASSIGN | MOD_ASSIGN_AFTER ) e= expression SEMI
+ {
+ if ( ((LA(1) >= MOD_ASSIGN) && (LA(1) <= MOD_ASSIGN_AFTER)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulestatement_assignEx;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_assign17690);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_assign17693);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT_ASSIGN_OP(OP(MOD),
+ lv
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 9:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5085:4: ( LAND_ASSIGN | LAND_ASSIGN_AFTER ) e= expression SEMI
+ {
+ if ( ((LA(1) >= LAND_ASSIGN) && (LA(1) <= LAND_ASSIGN_AFTER)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulestatement_assignEx;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_assign17716);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_assign17719);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT_ASSIGN_OP(OP(AND),
+ lv
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 10:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5088:4: ( LOR_ASSIGN | LOR_ASSIGN_AFTER ) e= expression SEMI
+ {
+ if ( ((LA(1) >= LOR_ASSIGN) && (LA(1) <= LOR_ASSIGN_AFTER)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulestatement_assignEx;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_assign17741);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_assign17744);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT_ASSIGN_OP(OP(OR),
+ lv
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 11:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5092:4: ( BAND_ASSIGN | BAND_ASSIGN_AFTER ) e= expression SEMI
+ {
+ if ( ((LA(1) >= BAND_ASSIGN) && (LA(1) <= BAND_ASSIGN_AFTER)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulestatement_assignEx;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_assign17767);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_assign17770);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT_ASSIGN_OP(OP(BAND),
+ lv
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 12:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5095:4: ( BOR_ASSIGN | BOR_ASSIGN_AFTER ) e= expression SEMI
+ {
+ if ( ((LA(1) >= BOR_ASSIGN) && (LA(1) <= BOR_ASSIGN_AFTER)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulestatement_assignEx;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_assign17792);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_assign17795);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT_ASSIGN_OP(OP(BOR),
+ lv
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 13:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5098:4: ( BXOR_ASSIGN | BXOR_ASSIGN_AFTER ) e= expression SEMI
+ {
+ if ( ((LA(1) >= BXOR_ASSIGN) && (LA(1) <= BXOR_ASSIGN_AFTER)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulestatement_assignEx;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_assign17817);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_assign17820);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT_ASSIGN_OP(OP(BXOR),
+ lv
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 14:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5102:4: ( LSHIFT_ASSIGN | LSHIFT_ASSIGN_AFTER ) e= expression SEMI
+ {
+ if ( ((LA(1) >= LSHIFT_ASSIGN) && (LA(1) <= LSHIFT_ASSIGN_AFTER)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulestatement_assignEx;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_assign17843);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_assign17846);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT_ASSIGN_OP(OP(LSHIFT),
+ lv
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 15:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5105:4: ( RSHIFT_ASSIGN | RSHIFT_ASSIGN_AFTER ) e= expression SEMI
+ {
+ if ( ((LA(1) >= RSHIFT_ASSIGN) && (LA(1) <= RSHIFT_ASSIGN_AFTER)) )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulestatement_assignEx;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_assign17868);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_assign17871);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT_ASSIGN_OP(OP(RSHIFT),
+ lv
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 16:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5112:4: OP_PUSH e= expression ( OP_PUSH e= expression )* SEMI
+ {
+ MATCHT(OP_PUSH, &FOLLOW_OP_PUSH_in_statement_assign17887);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_assign17892);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT2(OP(PUSH),
+ lv
+ , e
+ );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5114:4: ( OP_PUSH e= expression )*
+
+ for (;;)
+ {
+ int alt435=2;
+ switch ( LA(1) )
+ {
+ case OP_PUSH:
+ {
+ alt435=1;
+ }
+ break;
+
+ }
+
+ switch (alt435)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5114:6: OP_PUSH e= expression
+ {
+ MATCHT(OP_PUSH, &FOLLOW_OP_PUSH_in_statement_assign17902);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_assign17907);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append(e
+ );
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop435; /* break out of the loop */
+ break;
+ }
+ }
+ loop435: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_assign17918);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+ case 17:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5120:4: OP_ASSIGN_TOP e= expression SEMI
+ {
+ MATCHT(OP_ASSIGN_TOP, &FOLLOW_OP_ASSIGN_TOP_in_statement_assign17930);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_assign17935);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_assign17938);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT2(OP(ASSIGN_TOP),
+ lv
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 18:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5126:4: OP_TOP v= lvalue SEMI
+ {
+ MATCHT(OP_TOP, &FOLLOW_OP_TOP_in_statement_assign17953);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_lvalue_in_statement_assign17958);
+ v=lvalue(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_assign17961);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT2(OP(TOP),
+ lv
+ , v
+ );
+
+ }
+
+
+ }
+ break;
+ case 19:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5132:4: OP_POP (v= lvalue )* SEMI
+ {
+ MATCHT(OP_POP, &FOLLOW_OP_POP_in_statement_assign17976);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT1(OP(POP),
+ lv
+ );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5133:4: (v= lvalue )*
+
+ for (;;)
+ {
+ int alt436=2;
+ switch ( LA(1) )
+ {
+ case COLONx2:
+ case ID:
+ {
+ alt436=1;
+ }
+ break;
+
+ }
+
+ switch (alt436)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5133:6: v= lvalue
+ {
+ FOLLOWPUSH(FOLLOW_lvalue_in_statement_assign17992);
+ v=lvalue(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append(v
+ );
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop436; /* break out of the loop */
+ break;
+ }
+ }
+ loop436: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_assign18003);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+ case 20:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5137:4: INCR SEMI
+ {
+ MATCHT(INCR, &FOLLOW_INCR_in_statement_assign18011);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_assign18014);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT_ASSIGN_OP(OP(PLUS),
+ lv
+ ,
+ sep::ExpressionConstant::INTEGER_ONE);
+
+ }
+
+
+ }
+ break;
+ case 21:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5142:4: DECR SEMI
+ {
+ MATCHT(DECR, &FOLLOW_DECR_in_statement_assign18025);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_assign18028);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT_ASSIGN_OP(OP(PLUS),
+ lv
+ ,
+ sep::ExpressionConstant::INTEGER_MINUS_ONE);
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5154:4: INCR lv= lvalue SEMI
+ {
+ MATCHT(INCR, &FOLLOW_INCR_in_statement_assign18048);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_lvalue_in_statement_assign18053);
+ lv=lvalue(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_assign18056);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT_ASSIGN_OP(OP(PLUS),
+ lv
+ ,
+ sep::ExpressionConstant::INTEGER_ONE);
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5159:4: DECR lv= lvalue SEMI
+ {
+ MATCHT(DECR, &FOLLOW_DECR_in_statement_assign18067);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_lvalue_in_statement_assign18072);
+ lv=lvalue(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_assign18075);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_assignEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT_ASSIGN_OP(OP(PLUS),
+ lv
+ ,
+ sep::ExpressionConstant::INTEGER_MINUS_ONE);
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestatement_assignEx; /* Prevent compiler warnings */
+ rulestatement_assignEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(189, statement_assign_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end statement_assign */
+
+/**
+ * $ANTLR start lvalue
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5165:1: lvalue returns [ sep::BF bf ] : ( COLONx2 )? id= ID ( ( DOT id= ID ) | ( LBRACKET e= expression RBRACKET ) )* ;
+ */
+static sep::BF
+lvalue(pfmlParser ctx)
+{
+ sep::BF bf;
+
+ ANTLR3_UINT32 lvalue_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ lvalue_StartIndex = INDEX();
+
+
+
+ sep::UniFormIdentifier * ufi;
+ sep::BF bfUfi; // for automatic destruction of << UFI >> if need
+
+ sep::avm_size_t countID = 1;
+ bool isnotEXPR = true;
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(190)) )
+ {
+ {
+ }
+
+
+
+ return bf;
+ }
+
+ id = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5176:2: ( ( COLONx2 )? id= ID ( ( DOT id= ID ) | ( LBRACKET e= expression RBRACKET ) )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5176:4: ( COLONx2 )? id= ID ( ( DOT id= ID ) | ( LBRACKET e= expression RBRACKET ) )*
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5176:4: ( COLONx2 )?
+ {
+ int alt439=2;
+ switch ( LA(1) )
+ {
+ case COLONx2:
+ {
+ alt439=1;
+ }
+ break;
+ }
+
+ switch (alt439)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5176:6: COLONx2
+ {
+ MATCHT(COLONx2, &FOLLOW_COLONx2_in_lvalue18100);
+ if (HASEXCEPTION())
+ {
+ goto rulelvalueEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ufi->setAbsolute();
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_lvalue18112);
+ if (HASEXCEPTION())
+ {
+ goto rulelvalueEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ ufi = new sep::UniFormIdentifier(false);
+ bfUfi = ufi;
+
+ if( (bf= sep::ParserUtil::getvar(STR((id->getText(id))->chars), 1)).valid() )
+ {
+ ufi->appendFieldVariable(
+ bf
+ );
+
+ }
+ else if( (bf= sep::ParserUtil::getvarMachine(
+ STR((id->getText(id))->chars), 1)).valid() )
+ {
+ ufi->appendFieldMachine(
+ bf
+ );
+
+ }
+ else
+ {
+ ufi->appendField(STR((id->getText(id))->chars));
+ }
+
+
+ bf= bfUfi;
+
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5199:4: ( ( DOT id= ID ) | ( LBRACKET e= expression RBRACKET ) )*
+
+ for (;;)
+ {
+ int alt440=3;
+ switch ( LA(1) )
+ {
+ case DOT:
+ {
+ alt440=1;
+ }
+ break;
+ case LBRACKET:
+ {
+ alt440=2;
+ }
+ break;
+
+ }
+
+ switch (alt440)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5199:6: ( DOT id= ID )
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5199:6: ( DOT id= ID )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5199:8: DOT id= ID
+ {
+ MATCHT(DOT, &FOLLOW_DOT_in_lvalue18127);
+ if (HASEXCEPTION())
+ {
+ goto rulelvalueEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_lvalue18131);
+ if (HASEXCEPTION())
+ {
+ goto rulelvalueEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ufi->appendField(STR((id->getText(id))->chars)); ++countID;
+ }
+
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5202:6: ( LBRACKET e= expression RBRACKET )
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5202:6: ( LBRACKET e= expression RBRACKET )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5202:8: LBRACKET e= expression RBRACKET
+ {
+ MATCHT(LBRACKET, &FOLLOW_LBRACKET_in_lvalue18150);
+ if (HASEXCEPTION())
+ {
+ goto rulelvalueEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_lvalue18155);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulelvalueEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ MATCHT(RBRACKET, &FOLLOW_RBRACKET_in_lvalue18158);
+ if (HASEXCEPTION())
+ {
+ goto rulelvalueEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ufi->appendIndex(e
+ ); isnotEXPR = false;
+ }
+
+
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop440; /* break out of the loop */
+ break;
+ }
+ }
+ loop440: ; /* Jump out to here if this rule does not match */
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ if( isnotEXPR )
+ {
+ if( countID == 1 )
+ {
+ bf= ufi->first();
+
+ }
+ else if( (bf= sep::ParserUtil::getvar(
+ ufi->str(), countID)).invalid() )
+ {
+
+ bf
+ = bfUfi;
+
+ SET_RULE_LOCATION(ufi);
+ }
+ }
+
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulelvalueEx; /* Prevent compiler warnings */
+ rulelvalueEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(190, lvalue_StartIndex); }
+
+ return bf;
+}
+/* $ANTLR end lvalue */
+
+/**
+ * $ANTLR start parameters
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5272:1: parameters[ const sep::BFCode & ac ] : LPAREN e= expression ( COMMA e= expression )* RPAREN ;
+ */
+static void
+parameters(pfmlParser ctx, const sep::BFCode & ac)
+{
+ ANTLR3_UINT32 parameters_StartIndex;
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ parameters_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(191)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5273:2: ( LPAREN e= expression ( COMMA e= expression )* RPAREN )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5273:4: LPAREN e= expression ( COMMA e= expression )* RPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_parameters18239);
+ if (HASEXCEPTION())
+ {
+ goto ruleparametersEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_parameters18244);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleparametersEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac->append(
+ e
+ );
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5274:4: ( COMMA e= expression )*
+
+ for (;;)
+ {
+ int alt441=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt441=1;
+ }
+ break;
+
+ }
+
+ switch (alt441)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5274:6: COMMA e= expression
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_parameters18254);
+ if (HASEXCEPTION())
+ {
+ goto ruleparametersEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_parameters18258);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleparametersEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac->append(
+ e
+ );
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop441; /* break out of the loop */
+ break;
+ }
+ }
+ loop441: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_parameters18270);
+ if (HASEXCEPTION())
+ {
+ goto ruleparametersEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleparametersEx; /* Prevent compiler warnings */
+ ruleparametersEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(191, parameters_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end parameters */
+
+/**
+ * $ANTLR start statement_com
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5283:1: statement_com returns [ sep::BFCode ac ] : (s= statement_com_input |s= statement_com_output );
+ */
+static sep::BFCode
+statement_com(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 statement_com_StartIndex;
+
+ sep::BFCode s;
+ #undef RETURN_TYPE_s
+ #define RETURN_TYPE_s sep::BFCode
+
+ /* Initialize rule variables
+ */
+ statement_com_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(192)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5285:2: (s= statement_com_input |s= statement_com_output )
+
+ ANTLR3_UINT32 alt442;
+
+ alt442=2;
+
+ switch ( LA(1) )
+ {
+ case 299:
+ case 300:
+ case 301:
+ case 302:
+ case 303:
+ case 304:
+ case 305:
+ {
+ alt442=1;
+ }
+ break;
+ case 336:
+ case 337:
+ case 338:
+ case 339:
+ case 340:
+ case 341:
+ {
+ alt442=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 442;
+ EXCEPTION->state = 0;
+
+
+ goto rulestatement_comEx;
+
+ }
+
+ switch (alt442)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5285:4: s= statement_com_input
+ {
+ FOLLOWPUSH(FOLLOW_statement_com_input_in_statement_com18292);
+ s=statement_com_input(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_comEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac=
+ s
+ ;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5286:4: s= statement_com_output
+ {
+ FOLLOWPUSH(FOLLOW_statement_com_output_in_statement_com18303);
+ s=statement_com_output(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_comEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac=
+ s
+ ;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestatement_comEx; /* Prevent compiler warnings */
+ rulestatement_comEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(192, statement_com_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end statement_com */
+
+/**
+ * $ANTLR start statement_com_input
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5289:1: statement_com_input returns [ sep::BFCode ac ] : (tok= 'input' |tok= 'input#save' |tok= 'input#var' |tok= 'input#flow' |tok= 'input#env' |tok= 'input#buffer' |tok= 'input#rdv' ) id= qualifiedNameID ( parameters_port[ port , ac ] )? ( '<--' ( 'env' |me= expression ) ( '<-' id= qualifiedNameID )? )? ( ( '<==' | 'via' ) id= qualifiedNameID )? SEMI ;
+ */
+static sep::BFCode
+statement_com_input(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 statement_com_input_StartIndex;
+
+ pANTLR3_COMMON_TOKEN tok;
+ fmlParser_qualifiedNameID_return id;
+ #undef RETURN_TYPE_id
+ #define RETURN_TYPE_id fmlParser_qualifiedNameID_return
+
+ sep::BF me;
+ #undef RETURN_TYPE_me
+ #define RETURN_TYPE_me sep::BF
+
+ /* Initialize rule variables
+ */
+ statement_com_input_StartIndex = INDEX();
+
+
+
+ sep::BF varPortSignal;
+ sep::Port * port = NULL;
+ sep::Operator * op = NULL;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(193)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ tok = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5296:2: ( (tok= 'input' |tok= 'input#save' |tok= 'input#var' |tok= 'input#flow' |tok= 'input#env' |tok= 'input#buffer' |tok= 'input#rdv' ) id= qualifiedNameID ( parameters_port[ port , ac ] )? ( '<--' ( 'env' |me= expression ) ( '<-' id= qualifiedNameID )? )? ( ( '<==' | 'via' ) id= qualifiedNameID )? SEMI )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5296:4: (tok= 'input' |tok= 'input#save' |tok= 'input#var' |tok= 'input#flow' |tok= 'input#env' |tok= 'input#buffer' |tok= 'input#rdv' ) id= qualifiedNameID ( parameters_port[ port , ac ] )? ( '<--' ( 'env' |me= expression ) ( '<-' id= qualifiedNameID )? )? ( ( '<==' | 'via' ) id= qualifiedNameID )? SEMI
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5296:4: (tok= 'input' |tok= 'input#save' |tok= 'input#var' |tok= 'input#flow' |tok= 'input#env' |tok= 'input#buffer' |tok= 'input#rdv' )
+ {
+ int alt443=7;
+ switch ( LA(1) )
+ {
+ case 305:
+ {
+ alt443=1;
+ }
+ break;
+ case 303:
+ {
+ alt443=2;
+ }
+ break;
+ case 304:
+ {
+ alt443=3;
+ }
+ break;
+ case 301:
+ {
+ alt443=4;
+ }
+ break;
+ case 300:
+ {
+ alt443=5;
+ }
+ break;
+ case 299:
+ {
+ alt443=6;
+ }
+ break;
+ case 302:
+ {
+ alt443=7;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 443;
+ EXCEPTION->state = 0;
+
+
+ goto rulestatement_com_inputEx;
+
+ }
+
+ switch (alt443)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5296:6: tok= 'input'
+ {
+ tok = (pANTLR3_COMMON_TOKEN) MATCHT(305, &FOLLOW_305_in_statement_com_input18329);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_inputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op = OP(INPUT);
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5297:6: tok= 'input#save'
+ {
+ tok = (pANTLR3_COMMON_TOKEN) MATCHT(303, &FOLLOW_303_in_statement_com_input18347);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_inputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op = OP(INPUT_SAVE);
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5298:6: tok= 'input#var'
+ {
+ tok = (pANTLR3_COMMON_TOKEN) MATCHT(304, &FOLLOW_304_in_statement_com_input18360);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_inputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op = OP(INPUT_VAR);
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5299:6: tok= 'input#flow'
+ {
+ tok = (pANTLR3_COMMON_TOKEN) MATCHT(301, &FOLLOW_301_in_statement_com_input18374);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_inputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op = OP(INPUT_FLOW);
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5300:6: tok= 'input#env'
+ {
+ tok = (pANTLR3_COMMON_TOKEN) MATCHT(300, &FOLLOW_300_in_statement_com_input18387);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_inputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op = OP(INPUT_ENV);
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5301:6: tok= 'input#buffer'
+ {
+ tok = (pANTLR3_COMMON_TOKEN) MATCHT(299, &FOLLOW_299_in_statement_com_input18401);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_inputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op = OP(INPUT_BUFFER);
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5302:6: tok= 'input#rdv'
+ {
+ tok = (pANTLR3_COMMON_TOKEN) MATCHT(302, &FOLLOW_302_in_statement_com_input18412);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_inputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op = OP(INPUT_RDV);
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_statement_com_input18426);
+ id=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_inputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ ac= NEW_STMT1( op,
+ varPortSignal = sep::ParserUtil::getvarPortSignal(
+ id.s
+ , id.nb
+ ) );
+
+ if( varPortSignal.is< sep::Port >() )
+ { port = varPortSignal.to_ptr< sep::Port >(); }
+ else if( varPortSignal.invalid() )
+ {
+ sep::ParserUtil::avm_syntax_error(
+ "statement_com_input:> ", (tok->getLine(tok)) )
+ << "Unfound port/signal or variable < " <<
+ id.s
+
+ << " > in machine < " << str_header( _CPM_ ) << " >"
+ << sep::ParserUtil::SYNTAX_ERROR_EOL;
+ }
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5318:4: ( parameters_port[ port , ac ] )?
+ {
+ int alt444=2;
+ switch ( LA(1) )
+ {
+ case LPAREN:
+ {
+ alt444=1;
+ }
+ break;
+ }
+
+ switch (alt444)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5318:4: parameters_port[ port , ac ]
+ {
+ FOLLOWPUSH(FOLLOW_parameters_port_in_statement_com_input18436);
+ parameters_port(ctx, port, ac);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_inputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5319:4: ( '<--' ( 'env' |me= expression ) ( '<-' id= qualifiedNameID )? )?
+ {
+ int alt447=2;
+ switch ( LA(1) )
+ {
+ case 165:
+ {
+ alt447=1;
+ }
+ break;
+ }
+
+ switch (alt447)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5319:6: '<--' ( 'env' |me= expression ) ( '<-' id= qualifiedNameID )?
+ {
+ MATCHT(165, &FOLLOW_165_in_statement_com_input18446);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_inputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5320:6: ( 'env' |me= expression )
+ {
+ int alt445=2;
+ switch ( LA(1) )
+ {
+ case 277:
+ {
+ {
+ int LA445_1 = LA(2);
+ if ( (synpred861_fml(ctx)))
+ {
+ alt445=1;
+ }
+ else if ( (ANTLR3_TRUE))
+ {
+ alt445=2;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 445;
+ EXCEPTION->state = 1;
+
+
+ goto rulestatement_com_inputEx;
+
+ }
+ }
+ }
+ break;
+ case BNOT:
+ case COLONx2:
+ case CharLiteral:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case FloatLiteral:
+ case ID:
+ case INCR:
+ case IntegerLiteral:
+ case LBRACKET:
+ case LBRACKET_BAR:
+ case LCURLY:
+ case LNOT:
+ case LPAREN:
+ case LPAREN_INVOKE:
+ case MINUS:
+ case OP_POP:
+ case OP_TOP:
+ case PERCENT_LCURLY:
+ case PLUS:
+ case RationalLiteral:
+ case StringLiteral:
+ case 158:
+ case 159:
+ case 160:
+ case 161:
+ case 162:
+ case 237:
+ case 256:
+ case 265:
+ case 280:
+ case 294:
+ case 313:
+ case 330:
+ case 331:
+ case 332:
+ case 343:
+ case 347:
+ case 372:
+ case 397:
+ {
+ alt445=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 445;
+ EXCEPTION->state = 0;
+
+
+ goto rulestatement_com_inputEx;
+
+ }
+
+ switch (alt445)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5320:8: 'env'
+ {
+ MATCHT(277, &FOLLOW_277_in_statement_com_input18455);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_inputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->setOperator( OP(INPUT_ENV) );
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5321:8: me= expression
+ {
+ FOLLOWPUSH(FOLLOW_expression_in_statement_com_input18469);
+ me=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_inputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ sep::BFCode inputFrom = NEW_STMT2(OP(INPUT_FROM), ac
+ ->first(), me
+ );
+
+ inputFrom->insert(inputFrom->end(), ++(ac
+ ->begin()), ac
+ ->end());
+ ac= inputFrom;
+
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5329:6: ( '<-' id= qualifiedNameID )?
+ {
+ int alt446=2;
+ switch ( LA(1) )
+ {
+ case ASSIGN_REF:
+ {
+ alt446=1;
+ }
+ break;
+ }
+
+ switch (alt446)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5329:8: '<-' id= qualifiedNameID
+ {
+ MATCHT(ASSIGN_REF, &FOLLOW_ASSIGN_REF_in_statement_com_input18489);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_inputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_statement_com_input18493);
+ id=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_inputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append(sep::ParserUtil::getvarPortSignal(id.s
+ , id.nb
+ ));
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5333:4: ( ( '<==' | 'via' ) id= qualifiedNameID )?
+ {
+ int alt448=2;
+ switch ( LA(1) )
+ {
+ case 167:
+ case 413:
+ {
+ alt448=1;
+ }
+ break;
+ }
+
+ switch (alt448)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5333:6: ( '<==' | 'via' ) id= qualifiedNameID
+ {
+ if ( LA(1) == 167 || LA(1) == 413 )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulestatement_com_inputEx;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_statement_com_input18533);
+ id=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_inputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ sep::ParserUtil::updateSignalRoutingChannel(
+ sep::Modifier::DIRECTION_INPUT_KIND, ac
+ , id.s
+ , id.nb
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_com_input18549);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_inputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestatement_com_inputEx; /* Prevent compiler warnings */
+ rulestatement_com_inputEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(193, statement_com_input_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end statement_com_input */
+
+/**
+ * $ANTLR start statement_com_output
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5340:1: statement_com_output returns [ sep::BFCode ac ] : (tok= 'output' |tok= 'output#var' |tok= 'output#flow' |tok= 'output#env' |tok= 'output#buffer' |tok= 'output#rdv' ) id= qualifiedNameID ( parameters_port[ port , ac ] )? ( '-->' ( 'env' |me= expression ) ( '->' id= qualifiedNameID )? )? ( ( '==>' | 'via' ) id= qualifiedNameID )? SEMI ;
+ */
+static sep::BFCode
+statement_com_output(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 statement_com_output_StartIndex;
+
+ pANTLR3_COMMON_TOKEN tok;
+ fmlParser_qualifiedNameID_return id;
+ #undef RETURN_TYPE_id
+ #define RETURN_TYPE_id fmlParser_qualifiedNameID_return
+
+ sep::BF me;
+ #undef RETURN_TYPE_me
+ #define RETURN_TYPE_me sep::BF
+
+ /* Initialize rule variables
+ */
+ statement_com_output_StartIndex = INDEX();
+
+
+
+ sep::BF varPortSignal;
+ sep::Port * port = NULL;
+ sep::Operator * op = NULL;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(194)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ tok = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5347:2: ( (tok= 'output' |tok= 'output#var' |tok= 'output#flow' |tok= 'output#env' |tok= 'output#buffer' |tok= 'output#rdv' ) id= qualifiedNameID ( parameters_port[ port , ac ] )? ( '-->' ( 'env' |me= expression ) ( '->' id= qualifiedNameID )? )? ( ( '==>' | 'via' ) id= qualifiedNameID )? SEMI )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5347:4: (tok= 'output' |tok= 'output#var' |tok= 'output#flow' |tok= 'output#env' |tok= 'output#buffer' |tok= 'output#rdv' ) id= qualifiedNameID ( parameters_port[ port , ac ] )? ( '-->' ( 'env' |me= expression ) ( '->' id= qualifiedNameID )? )? ( ( '==>' | 'via' ) id= qualifiedNameID )? SEMI
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5347:4: (tok= 'output' |tok= 'output#var' |tok= 'output#flow' |tok= 'output#env' |tok= 'output#buffer' |tok= 'output#rdv' )
+ {
+ int alt449=6;
+ switch ( LA(1) )
+ {
+ case 341:
+ {
+ alt449=1;
+ }
+ break;
+ case 340:
+ {
+ alt449=2;
+ }
+ break;
+ case 338:
+ {
+ alt449=3;
+ }
+ break;
+ case 337:
+ {
+ alt449=4;
+ }
+ break;
+ case 336:
+ {
+ alt449=5;
+ }
+ break;
+ case 339:
+ {
+ alt449=6;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 449;
+ EXCEPTION->state = 0;
+
+
+ goto rulestatement_com_outputEx;
+
+ }
+
+ switch (alt449)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5347:6: tok= 'output'
+ {
+ tok = (pANTLR3_COMMON_TOKEN) MATCHT(341, &FOLLOW_341_in_statement_com_output18572);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_outputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op = OP(OUTPUT);
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5348:6: tok= 'output#var'
+ {
+ tok = (pANTLR3_COMMON_TOKEN) MATCHT(340, &FOLLOW_340_in_statement_com_output18590);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_outputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op = OP(OUTPUT_VAR);
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5349:6: tok= 'output#flow'
+ {
+ tok = (pANTLR3_COMMON_TOKEN) MATCHT(338, &FOLLOW_338_in_statement_com_output18604);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_outputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op = OP(OUTPUT_FLOW);
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5350:6: tok= 'output#env'
+ {
+ tok = (pANTLR3_COMMON_TOKEN) MATCHT(337, &FOLLOW_337_in_statement_com_output18617);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_outputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op = OP(OUTPUT_ENV);
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5351:6: tok= 'output#buffer'
+ {
+ tok = (pANTLR3_COMMON_TOKEN) MATCHT(336, &FOLLOW_336_in_statement_com_output18631);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_outputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op = OP(OUTPUT_BUFFER);
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5352:6: tok= 'output#rdv'
+ {
+ tok = (pANTLR3_COMMON_TOKEN) MATCHT(339, &FOLLOW_339_in_statement_com_output18642);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_outputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op = OP(OUTPUT_RDV);
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_statement_com_output18656);
+ id=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_outputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ ac= NEW_STMT1( op,
+ varPortSignal = sep::ParserUtil::getvarPortSignal(
+ id.s
+ , id.nb
+ ) );
+
+ if( varPortSignal.is< sep::Port >() )
+ { port = varPortSignal.to_ptr< sep::Port >(); }
+ else if( varPortSignal.invalid() )
+ {
+ sep::ParserUtil::avm_syntax_error(
+ "statement_com_output:>", (tok->getLine(tok)) )
+ << "Unfound port/signal or variable < " <<
+ id.s
+
+ << " > in machine < " << str_header( _CPM_ ) << " >"
+ << sep::ParserUtil::SYNTAX_ERROR_EOL;
+ }
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5368:4: ( parameters_port[ port , ac ] )?
+ {
+ int alt450=2;
+ switch ( LA(1) )
+ {
+ case LPAREN:
+ {
+ alt450=1;
+ }
+ break;
+ }
+
+ switch (alt450)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5368:4: parameters_port[ port , ac ]
+ {
+ FOLLOWPUSH(FOLLOW_parameters_port_in_statement_com_output18666);
+ parameters_port(ctx, port, ac);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_outputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5369:4: ( '-->' ( 'env' |me= expression ) ( '->' id= qualifiedNameID )? )?
+ {
+ int alt453=2;
+ switch ( LA(1) )
+ {
+ case 163:
+ {
+ alt453=1;
+ }
+ break;
+ }
+
+ switch (alt453)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5369:6: '-->' ( 'env' |me= expression ) ( '->' id= qualifiedNameID )?
+ {
+ MATCHT(163, &FOLLOW_163_in_statement_com_output18676);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_outputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5370:6: ( 'env' |me= expression )
+ {
+ int alt451=2;
+ switch ( LA(1) )
+ {
+ case 277:
+ {
+ {
+ int LA451_1 = LA(2);
+ if ( (synpred872_fml(ctx)))
+ {
+ alt451=1;
+ }
+ else if ( (ANTLR3_TRUE))
+ {
+ alt451=2;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 451;
+ EXCEPTION->state = 1;
+
+
+ goto rulestatement_com_outputEx;
+
+ }
+ }
+ }
+ break;
+ case BNOT:
+ case COLONx2:
+ case CharLiteral:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case FloatLiteral:
+ case ID:
+ case INCR:
+ case IntegerLiteral:
+ case LBRACKET:
+ case LBRACKET_BAR:
+ case LCURLY:
+ case LNOT:
+ case LPAREN:
+ case LPAREN_INVOKE:
+ case MINUS:
+ case OP_POP:
+ case OP_TOP:
+ case PERCENT_LCURLY:
+ case PLUS:
+ case RationalLiteral:
+ case StringLiteral:
+ case 158:
+ case 159:
+ case 160:
+ case 161:
+ case 162:
+ case 237:
+ case 256:
+ case 265:
+ case 280:
+ case 294:
+ case 313:
+ case 330:
+ case 331:
+ case 332:
+ case 343:
+ case 347:
+ case 372:
+ case 397:
+ {
+ alt451=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 451;
+ EXCEPTION->state = 0;
+
+
+ goto rulestatement_com_outputEx;
+
+ }
+
+ switch (alt451)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5370:8: 'env'
+ {
+ MATCHT(277, &FOLLOW_277_in_statement_com_output18685);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_outputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->setOperator( OP(OUTPUT_ENV) );
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5371:8: me= expression
+ {
+ FOLLOWPUSH(FOLLOW_expression_in_statement_com_output18699);
+ me=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_outputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ sep::BFCode outputTo = NEW_STMT2(OP(OUTPUT_TO), ac
+ ->first(), me
+ );
+
+ outputTo->insert(outputTo->end(), ++(ac
+ ->begin()), ac
+ ->end());
+ ac= outputTo;
+
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5379:6: ( '->' id= qualifiedNameID )?
+ {
+ int alt452=2;
+ switch ( LA(1) )
+ {
+ case 164:
+ {
+ alt452=1;
+ }
+ break;
+ }
+
+ switch (alt452)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5379:8: '->' id= qualifiedNameID
+ {
+ MATCHT(164, &FOLLOW_164_in_statement_com_output18721);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_outputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_statement_com_output18725);
+ id=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_outputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append(sep::ParserUtil::getvarPortSignal(id.s
+ , id.nb
+ ));
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5383:4: ( ( '==>' | 'via' ) id= qualifiedNameID )?
+ {
+ int alt454=2;
+ switch ( LA(1) )
+ {
+ case 168:
+ case 413:
+ {
+ alt454=1;
+ }
+ break;
+ }
+
+ switch (alt454)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5383:6: ( '==>' | 'via' ) id= qualifiedNameID
+ {
+ if ( LA(1) == 168 || LA(1) == 413 )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulestatement_com_outputEx;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_statement_com_output18765);
+ id=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_outputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ sep::ParserUtil::updateSignalRoutingChannel(
+ sep::Modifier::DIRECTION_OUTPUT_KIND, ac
+ , id.s
+ , id.nb
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_com_output18781);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_com_outputEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestatement_com_outputEx; /* Prevent compiler warnings */
+ rulestatement_com_outputEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(194, statement_com_output_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end statement_com_output */
+
+/**
+ * $ANTLR start parameters_port
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5391:1: parameters_port[ sep::Port * port , const sep::BFCode & ac ] : LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN ;
+ */
+static void
+parameters_port(pfmlParser ctx, sep::Port * port, const sep::BFCode & ac)
+{
+ ANTLR3_UINT32 parameters_port_StartIndex;
+
+ fmlParser_labelled_argument_return lp;
+ #undef RETURN_TYPE_lp
+ #define RETURN_TYPE_lp fmlParser_labelled_argument_return
+
+ /* Initialize rule variables
+ */
+ parameters_port_StartIndex = INDEX();
+
+
+
+ sep::BFVector labelledParams(
+ (port != NULL) ? port->getParametersCount() : 0 );
+
+ sep::BFList positionalParams;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(195)) )
+ {
+ {
+
+ sep::ParserUtil::computePortParameter(
+ port, ac, labelledParams, positionalParams);
+
+ }
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5403:2: ( LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5403:4: LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_parameters_port18804);
+ if (HASEXCEPTION())
+ {
+ goto ruleparameters_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_labelled_argument_in_parameters_port18813);
+ lp=labelled_argument(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleparameters_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ sep::ParserUtil::appendPortParameter(port, lp.label
+ ,
+ labelledParams, positionalParams, lp.arg
+ );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5409:4: ( COMMA lp= labelled_argument )*
+
+ for (;;)
+ {
+ int alt455=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt455=1;
+ }
+ break;
+
+ }
+
+ switch (alt455)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5409:6: COMMA lp= labelled_argument
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_parameters_port18827);
+ if (HASEXCEPTION())
+ {
+ goto ruleparameters_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_labelled_argument_in_parameters_port18832);
+ lp=labelled_argument(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleparameters_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ sep::ParserUtil::appendPortParameter(port, lp.label
+ ,
+ labelledParams, positionalParams, lp.arg
+ );
+
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop455; /* break out of the loop */
+ break;
+ }
+ }
+ loop455: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_parameters_port18852);
+ if (HASEXCEPTION())
+ {
+ goto ruleparameters_portEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleparameters_portEx; /* Prevent compiler warnings */
+ ruleparameters_portEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ sep::ParserUtil::computePortParameter(
+ port, ac, labelledParams, positionalParams);
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(195, parameters_port_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end parameters_port */
+
+/**
+ * $ANTLR start expression_com
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5420:1: expression_com returns [ sep::BFCode ac ] : ( 'present' id= qualifiedNameID | 'absent' id= qualifiedNameID );
+ */
+static sep::BFCode
+expression_com(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 expression_com_StartIndex;
+
+ fmlParser_qualifiedNameID_return id;
+ #undef RETURN_TYPE_id
+ #define RETURN_TYPE_id fmlParser_qualifiedNameID_return
+
+ /* Initialize rule variables
+ */
+ expression_com_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(196)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5422:2: ( 'present' id= qualifiedNameID | 'absent' id= qualifiedNameID )
+
+ ANTLR3_UINT32 alt456;
+
+ alt456=2;
+
+ switch ( LA(1) )
+ {
+ case 347:
+ {
+ alt456=1;
+ }
+ break;
+ case 237:
+ {
+ alt456=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 456;
+ EXCEPTION->state = 0;
+
+
+ goto ruleexpression_comEx;
+
+ }
+
+ switch (alt456)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5422:4: 'present' id= qualifiedNameID
+ {
+ MATCHT(347, &FOLLOW_347_in_expression_com18869);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_comEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_expression_com18874);
+ id=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_comEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT1(OP(PRESENT),
+ sep::ParserUtil::getvarPortSignal(
+ id.s
+ , id.nb
+ ));
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5426:4: 'absent' id= qualifiedNameID
+ {
+ MATCHT(237, &FOLLOW_237_in_expression_com18883);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_comEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_expression_com18888);
+ id=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_comEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT1(OP(ABSENT),
+ sep::ParserUtil::getvarPortSignal(
+ id.s
+ , id.nb
+ ));
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleexpression_comEx; /* Prevent compiler warnings */
+ ruleexpression_comEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(196, expression_com_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end expression_com */
+
+/**
+ * $ANTLR start statement_constraint
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5435:1: statement_constraint returns [ sep::BFCode ac ] : (s= statement_guard |s= statement_timed_guard |s= statement_checksat );
+ */
+static sep::BFCode
+statement_constraint(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 statement_constraint_StartIndex;
+
+ sep::BFCode s;
+ #undef RETURN_TYPE_s
+ #define RETURN_TYPE_s sep::BFCode
+
+ /* Initialize rule variables
+ */
+ statement_constraint_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(197)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5437:2: (s= statement_guard |s= statement_timed_guard |s= statement_checksat )
+
+ ANTLR3_UINT32 alt457;
+
+ alt457=3;
+
+ switch ( LA(1) )
+ {
+ case 278:
+ case 290:
+ {
+ alt457=1;
+ }
+ break;
+ case 391:
+ {
+ alt457=2;
+ }
+ break;
+ case 256:
+ {
+ alt457=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 457;
+ EXCEPTION->state = 0;
+
+
+ goto rulestatement_constraintEx;
+
+ }
+
+ switch (alt457)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5437:4: s= statement_guard
+ {
+ FOLLOWPUSH(FOLLOW_statement_guard_in_statement_constraint18912);
+ s=statement_guard(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_constraintEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac=
+ s
+ ;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5438:4: s= statement_timed_guard
+ {
+ FOLLOWPUSH(FOLLOW_statement_timed_guard_in_statement_constraint18928);
+ s=statement_timed_guard(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_constraintEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac=
+ s
+ ;
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5439:4: s= statement_checksat
+ {
+ FOLLOWPUSH(FOLLOW_statement_checksat_in_statement_constraint18938);
+ s=statement_checksat(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_constraintEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac=
+ s
+ ;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestatement_constraintEx; /* Prevent compiler warnings */
+ rulestatement_constraintEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(197, statement_constraint_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end statement_constraint */
+
+/**
+ * $ANTLR start statement_guard
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5443:1: statement_guard returns [ sep::BFCode ac ] : ( 'guard' e= expression SEMI | 'event' e= expression SEMI );
+ */
+static sep::BFCode
+statement_guard(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 statement_guard_StartIndex;
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ statement_guard_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(198)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5445:2: ( 'guard' e= expression SEMI | 'event' e= expression SEMI )
+
+ ANTLR3_UINT32 alt458;
+
+ alt458=2;
+
+ switch ( LA(1) )
+ {
+ case 290:
+ {
+ alt458=1;
+ }
+ break;
+ case 278:
+ {
+ alt458=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 458;
+ EXCEPTION->state = 0;
+
+
+ goto rulestatement_guardEx;
+
+ }
+
+ switch (alt458)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5445:4: 'guard' e= expression SEMI
+ {
+ MATCHT(290, &FOLLOW_290_in_statement_guard18960);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_guard18965);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_guard18968);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT1(OP(GUARD),
+ e
+ );
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5448:4: 'event' e= expression SEMI
+ {
+ MATCHT(278, &FOLLOW_278_in_statement_guard18977);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_guard18982);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_guard18985);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT1(OP(EVENT),
+ e
+ );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestatement_guardEx; /* Prevent compiler warnings */
+ rulestatement_guardEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(198, statement_guard_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end statement_guard */
+
+/**
+ * $ANTLR start statement_timed_guard
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5452:1: statement_timed_guard returns [ sep::BFCode ac ] : 'tguard' e= expression SEMI ;
+ */
+static sep::BFCode
+statement_timed_guard(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 statement_timed_guard_StartIndex;
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ statement_timed_guard_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(199)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5454:2: ( 'tguard' e= expression SEMI )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5454:4: 'tguard' e= expression SEMI
+ {
+ MATCHT(391, &FOLLOW_391_in_statement_timed_guard19003);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_timed_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_timed_guard19008);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_timed_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_timed_guard19011);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_timed_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT1(OP(TIMED_GUARD),
+ e
+ );
+
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestatement_timed_guardEx; /* Prevent compiler warnings */
+ rulestatement_timed_guardEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(199, statement_timed_guard_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end statement_timed_guard */
+
+/**
+ * $ANTLR start statement_checksat
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5458:1: statement_checksat returns [ sep::BFCode ac ] : 'checksat' ( LT_ (id= StringLiteral |id= ID ) GT | 'solver:' (id= StringLiteral |id= ID ) )? e= expression SEMI ;
+ */
+static sep::BFCode
+statement_checksat(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 statement_checksat_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ statement_checksat_StartIndex = INDEX();
+
+
+
+ std::string solverID;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(200)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ id = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5463:2: ( 'checksat' ( LT_ (id= StringLiteral |id= ID ) GT | 'solver:' (id= StringLiteral |id= ID ) )? e= expression SEMI )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5463:4: 'checksat' ( LT_ (id= StringLiteral |id= ID ) GT | 'solver:' (id= StringLiteral |id= ID ) )? e= expression SEMI
+ {
+ MATCHT(256, &FOLLOW_256_in_statement_checksat19033);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_checksatEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5464:4: ( LT_ (id= StringLiteral |id= ID ) GT | 'solver:' (id= StringLiteral |id= ID ) )?
+ {
+ int alt461=3;
+ switch ( LA(1) )
+ {
+ case LT_:
+ {
+ alt461=1;
+ }
+ break;
+ case 376:
+ {
+ alt461=2;
+ }
+ break;
+ }
+
+ switch (alt461)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5464:6: LT_ (id= StringLiteral |id= ID ) GT
+ {
+ MATCHT(LT_, &FOLLOW_LT__in_statement_checksat19040);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_checksatEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5464:11: (id= StringLiteral |id= ID )
+ {
+ int alt459=2;
+ switch ( LA(1) )
+ {
+ case StringLiteral:
+ {
+ alt459=1;
+ }
+ break;
+ case ID:
+ {
+ alt459=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 459;
+ EXCEPTION->state = 0;
+
+
+ goto rulestatement_checksatEx;
+
+ }
+
+ switch (alt459)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5464:13: id= StringLiteral
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(StringLiteral, &FOLLOW_StringLiteral_in_statement_checksat19047);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_checksatEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5464:32: id= ID
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_statement_checksat19053);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_checksatEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(GT, &FOLLOW_GT_in_statement_checksat19058);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_checksatEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ solverID = STR((id->getText(id))->chars);
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5465:6: 'solver:' (id= StringLiteral |id= ID )
+ {
+ MATCHT(376, &FOLLOW_376_in_statement_checksat19070);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_checksatEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5465:17: (id= StringLiteral |id= ID )
+ {
+ int alt460=2;
+ switch ( LA(1) )
+ {
+ case StringLiteral:
+ {
+ alt460=1;
+ }
+ break;
+ case ID:
+ {
+ alt460=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 460;
+ EXCEPTION->state = 0;
+
+
+ goto rulestatement_checksatEx;
+
+ }
+
+ switch (alt460)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5465:19: id= StringLiteral
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(StringLiteral, &FOLLOW_StringLiteral_in_statement_checksat19077);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_checksatEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5465:38: id= ID
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_statement_checksat19083);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_checksatEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+ solverID = STR((id->getText(id))->chars);
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_checksat19101);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_checksatEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_checksat19104);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_checksatEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ if( solverID.empty() )
+ {
+ ac= NEW_STMT1( OP(CHECK_SAT),
+ e
+ );
+
+ }
+ else
+ {
+ ac= NEW_STMT2( OP(CHECK_SAT), NEW_STRING(solverID),
+ e
+ );
+
+ }
+
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestatement_checksatEx; /* Prevent compiler warnings */
+ rulestatement_checksatEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(200, statement_checksat_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end statement_checksat */
+
+/**
+ * $ANTLR start expression_guard
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5481:1: expression_guard returns [ sep::BFCode ac ] : 'checksat' ( LT_ (id= StringLiteral |id= ID ) GT | 'solver:' (id= StringLiteral |id= ID ) )? e= expression ;
+ */
+static sep::BFCode
+expression_guard(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 expression_guard_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ expression_guard_StartIndex = INDEX();
+
+
+
+ std::string solverID;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(201)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ id = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5486:2: ( 'checksat' ( LT_ (id= StringLiteral |id= ID ) GT | 'solver:' (id= StringLiteral |id= ID ) )? e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5486:4: 'checksat' ( LT_ (id= StringLiteral |id= ID ) GT | 'solver:' (id= StringLiteral |id= ID ) )? e= expression
+ {
+ MATCHT(256, &FOLLOW_256_in_expression_guard19127);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5487:4: ( LT_ (id= StringLiteral |id= ID ) GT | 'solver:' (id= StringLiteral |id= ID ) )?
+ {
+ int alt464=3;
+ switch ( LA(1) )
+ {
+ case LT_:
+ {
+ alt464=1;
+ }
+ break;
+ case 376:
+ {
+ alt464=2;
+ }
+ break;
+ }
+
+ switch (alt464)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5487:6: LT_ (id= StringLiteral |id= ID ) GT
+ {
+ MATCHT(LT_, &FOLLOW_LT__in_expression_guard19134);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5487:11: (id= StringLiteral |id= ID )
+ {
+ int alt462=2;
+ switch ( LA(1) )
+ {
+ case StringLiteral:
+ {
+ alt462=1;
+ }
+ break;
+ case ID:
+ {
+ alt462=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 462;
+ EXCEPTION->state = 0;
+
+
+ goto ruleexpression_guardEx;
+
+ }
+
+ switch (alt462)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5487:13: id= StringLiteral
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(StringLiteral, &FOLLOW_StringLiteral_in_expression_guard19141);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5487:32: id= ID
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_expression_guard19147);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(GT, &FOLLOW_GT_in_expression_guard19152);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ solverID = STR((id->getText(id))->chars);
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5488:6: 'solver:' (id= StringLiteral |id= ID )
+ {
+ MATCHT(376, &FOLLOW_376_in_expression_guard19164);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5488:17: (id= StringLiteral |id= ID )
+ {
+ int alt463=2;
+ switch ( LA(1) )
+ {
+ case StringLiteral:
+ {
+ alt463=1;
+ }
+ break;
+ case ID:
+ {
+ alt463=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 463;
+ EXCEPTION->state = 0;
+
+
+ goto ruleexpression_guardEx;
+
+ }
+
+ switch (alt463)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5488:19: id= StringLiteral
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(StringLiteral, &FOLLOW_StringLiteral_in_expression_guard19171);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5488:38: id= ID
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_expression_guard19177);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+ solverID = STR((id->getText(id))->chars);
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression_guard19195);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_guardEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ if( solverID.empty() )
+ {
+ ac= NEW_STMT1( OP(CHECK_SAT),
+ e
+ );
+
+ }
+ else
+ {
+ ac= NEW_STMT2( OP(CHECK_SAT), NEW_STRING(solverID),
+ e
+ );
+
+ }
+
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleexpression_guardEx; /* Prevent compiler warnings */
+ ruleexpression_guardEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(201, expression_guard_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end expression_guard */
+
+/**
+ * $ANTLR start statement_ite
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5507:1: statement_ite returns [ sep::BFCode ac ] : 'if' e= expression bs= block_statement ( ( 'elseif' | 'else' 'if' ) e= expression bs= block_statement )* ( 'else' bs= block_statement )? ;
+ */
+static sep::BFCode
+statement_ite(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 statement_ite_StartIndex;
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ sep::BFCode bs;
+ #undef RETURN_TYPE_bs
+ #define RETURN_TYPE_bs sep::BFCode
+
+ /* Initialize rule variables
+ */
+ statement_ite_StartIndex = INDEX();
+
+
+
+ sep::BFCode elseifCode;
+ sep::BFCode code;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(202)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5513:2: ( 'if' e= expression bs= block_statement ( ( 'elseif' | 'else' 'if' ) e= expression bs= block_statement )* ( 'else' bs= block_statement )? )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5513:4: 'if' e= expression bs= block_statement ( ( 'elseif' | 'else' 'if' ) e= expression bs= block_statement )* ( 'else' bs= block_statement )?
+ {
+ MATCHT(294, &FOLLOW_294_in_statement_ite19221);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_ite19226);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_statement_ite19231);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ code = ac= NEW_STMT2(OP(IF),
+ e
+ , bs
+ );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5515:4: ( ( 'elseif' | 'else' 'if' ) e= expression bs= block_statement )*
+
+ for (;;)
+ {
+ int alt466=2;
+ switch ( LA(1) )
+ {
+ case 273:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA466_1 = LA(2);
+ if ( (synpred891_fml(ctx)))
+ {
+ alt466=1;
+ }
+
+ }
+ }
+ break;
+ case 274:
+ {
+ alt466=1;
+ }
+ break;
+
+ }
+
+ switch (alt466)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5515:6: ( 'elseif' | 'else' 'if' ) e= expression bs= block_statement
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5515:6: ( 'elseif' | 'else' 'if' )
+ {
+ int alt465=2;
+ switch ( LA(1) )
+ {
+ case 274:
+ {
+ alt465=1;
+ }
+ break;
+ case 273:
+ {
+ alt465=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 465;
+ EXCEPTION->state = 0;
+
+
+ goto rulestatement_iteEx;
+
+ }
+
+ switch (alt465)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5515:8: 'elseif'
+ {
+ MATCHT(274, &FOLLOW_274_in_statement_ite19245);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5515:19: 'else' 'if'
+ {
+ MATCHT(273, &FOLLOW_273_in_statement_ite19249);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(294, &FOLLOW_294_in_statement_ite19251);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_ite19258);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_statement_ite19263);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ code->setOperator(OP(IFE));
+ code->append(elseifCode = NEW_STMT2(OP(IF), e
+ , bs
+ ));
+ code = elseifCode;
+
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop466; /* break out of the loop */
+ break;
+ }
+ }
+ loop466: ; /* Jump out to here if this rule does not match */
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5522:4: ( 'else' bs= block_statement )?
+ {
+ int alt467=2;
+ switch ( LA(1) )
+ {
+ case 273:
+ {
+ alt467=1;
+ }
+ break;
+ }
+
+ switch (alt467)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5522:6: 'else' bs= block_statement
+ {
+ MATCHT(273, &FOLLOW_273_in_statement_ite19283);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_statement_ite19288);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ if( bs
+ ->nonempty() )
+ {
+ code->setOperator(OP(IFE)); code->append(bs
+ );
+ }
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestatement_iteEx; /* Prevent compiler warnings */
+ rulestatement_iteEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(202, statement_ite_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end statement_ite */
+
+/**
+ * $ANTLR start expression_ite
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5532:1: expression_ite returns [ sep::BFCode ac ] : 'if' c= expression LCURLY e= expression RCURLY ( ( 'elseif' | 'else' 'if' ) c= expression LCURLY e= expression RCURLY )* ( 'else' LCURLY e= expression RCURLY )? ;
+ */
+static sep::BFCode
+expression_ite(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 expression_ite_StartIndex;
+
+ sep::BF c;
+ #undef RETURN_TYPE_c
+ #define RETURN_TYPE_c sep::BF
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ expression_ite_StartIndex = INDEX();
+
+
+
+ sep::BFCode elseifExpr;
+ sep::BFCode expr;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(203)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5538:2: ( 'if' c= expression LCURLY e= expression RCURLY ( ( 'elseif' | 'else' 'if' ) c= expression LCURLY e= expression RCURLY )* ( 'else' LCURLY e= expression RCURLY )? )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5538:4: 'if' c= expression LCURLY e= expression RCURLY ( ( 'elseif' | 'else' 'if' ) c= expression LCURLY e= expression RCURLY )* ( 'else' LCURLY e= expression RCURLY )?
+ {
+ MATCHT(294, &FOLLOW_294_in_expression_ite19320);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression_ite19325);
+ c=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_expression_ite19328);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression_ite19333);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_expression_ite19336);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ expr = ac= NEW_STMT2(OP(IF),
+ c
+ , e
+ );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5540:4: ( ( 'elseif' | 'else' 'if' ) c= expression LCURLY e= expression RCURLY )*
+
+ for (;;)
+ {
+ int alt469=2;
+ switch ( LA(1) )
+ {
+ case 273:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA469_1 = LA(2);
+ if ( (synpred894_fml(ctx)))
+ {
+ alt469=1;
+ }
+
+ }
+ }
+ break;
+ case 274:
+ {
+ alt469=1;
+ }
+ break;
+
+ }
+
+ switch (alt469)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5540:6: ( 'elseif' | 'else' 'if' ) c= expression LCURLY e= expression RCURLY
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5540:6: ( 'elseif' | 'else' 'if' )
+ {
+ int alt468=2;
+ switch ( LA(1) )
+ {
+ case 274:
+ {
+ alt468=1;
+ }
+ break;
+ case 273:
+ {
+ alt468=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 468;
+ EXCEPTION->state = 0;
+
+
+ goto ruleexpression_iteEx;
+
+ }
+
+ switch (alt468)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5540:8: 'elseif'
+ {
+ MATCHT(274, &FOLLOW_274_in_expression_ite19350);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5540:19: 'else' 'if'
+ {
+ MATCHT(273, &FOLLOW_273_in_expression_ite19354);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(294, &FOLLOW_294_in_expression_ite19356);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression_ite19362);
+ c=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_expression_ite19365);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression_ite19370);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_expression_ite19373);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ expr->setOperator(OP(IFE));
+ expr->append(elseifExpr = NEW_STMT2(OP(IF), c
+ , e
+ ));
+ expr = elseifExpr;
+
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop469; /* break out of the loop */
+ break;
+ }
+ }
+ loop469: ; /* Jump out to here if this rule does not match */
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5547:4: ( 'else' LCURLY e= expression RCURLY )?
+ {
+ int alt470=2;
+ switch ( LA(1) )
+ {
+ case 273:
+ {
+ alt470=1;
+ }
+ break;
+ }
+
+ switch (alt470)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5547:6: 'else' LCURLY e= expression RCURLY
+ {
+ MATCHT(273, &FOLLOW_273_in_expression_ite19393);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_expression_ite19396);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression_ite19401);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_expression_ite19404);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_iteEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ expr->setOperator(OP(IFE)); expr->append(e
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleexpression_iteEx; /* Prevent compiler warnings */
+ ruleexpression_iteEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(203, expression_ite_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end expression_ite */
+
+/**
+ * $ANTLR start statement_iteration
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5571:1: statement_iteration returns [ sep::BFCode ac ] : ( 'for' (isa= for_assign_header SEMI e= expression SEMI sai= for_assign_header | LPAREN isa= for_assign_header SEMI e= expression SEMI sai= for_assign_header RPAREN |lv= lvalue COLON e= expression | LPAREN lv= lvalue COLON e= expression RPAREN ) sa= block_statement | 'while' e= expression bs= block_statement | 'do' bs= block_statement 'while' e= expression SEMI );
+ */
+static sep::BFCode
+statement_iteration(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 statement_iteration_StartIndex;
+
+ sep::BFCode isa;
+ #undef RETURN_TYPE_isa
+ #define RETURN_TYPE_isa sep::BFCode
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ sep::BFCode sai;
+ #undef RETURN_TYPE_sai
+ #define RETURN_TYPE_sai sep::BFCode
+
+ sep::BF lv;
+ #undef RETURN_TYPE_lv
+ #define RETURN_TYPE_lv sep::BF
+
+ sep::BFCode sa;
+ #undef RETURN_TYPE_sa
+ #define RETURN_TYPE_sa sep::BFCode
+
+ sep::BFCode bs;
+ #undef RETURN_TYPE_bs
+ #define RETURN_TYPE_bs sep::BFCode
+
+ /* Initialize rule variables
+ */
+ statement_iteration_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(204)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5573:2: ( 'for' (isa= for_assign_header SEMI e= expression SEMI sai= for_assign_header | LPAREN isa= for_assign_header SEMI e= expression SEMI sai= for_assign_header RPAREN |lv= lvalue COLON e= expression | LPAREN lv= lvalue COLON e= expression RPAREN ) sa= block_statement | 'while' e= expression bs= block_statement | 'do' bs= block_statement 'while' e= expression SEMI )
+
+ ANTLR3_UINT32 alt472;
+
+ alt472=3;
+
+ switch ( LA(1) )
+ {
+ case 285:
+ {
+ alt472=1;
+ }
+ break;
+ case 416:
+ {
+ alt472=2;
+ }
+ break;
+ case 269:
+ {
+ alt472=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 472;
+ EXCEPTION->state = 0;
+
+
+ goto rulestatement_iterationEx;
+
+ }
+
+ switch (alt472)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5573:4: 'for' (isa= for_assign_header SEMI e= expression SEMI sai= for_assign_header | LPAREN isa= for_assign_header SEMI e= expression SEMI sai= for_assign_header RPAREN |lv= lvalue COLON e= expression | LPAREN lv= lvalue COLON e= expression RPAREN ) sa= block_statement
+ {
+ MATCHT(285, &FOLLOW_285_in_statement_iteration19451);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5574:4: (isa= for_assign_header SEMI e= expression SEMI sai= for_assign_header | LPAREN isa= for_assign_header SEMI e= expression SEMI sai= for_assign_header RPAREN |lv= lvalue COLON e= expression | LPAREN lv= lvalue COLON e= expression RPAREN )
+ {
+ int alt471=4;
+ switch ( LA(1) )
+ {
+ case COLONx2:
+ case ID:
+ {
+ {
+ int LA471_1 = LA(2);
+ if ( (synpred896_fml(ctx)))
+ {
+ alt471=1;
+ }
+ else if ( (synpred898_fml(ctx)))
+ {
+ alt471=3;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 471;
+ EXCEPTION->state = 1;
+
+
+ goto rulestatement_iterationEx;
+
+ }
+ }
+ }
+ break;
+ case LPAREN:
+ {
+ {
+ int LA471_4 = LA(2);
+ if ( (synpred897_fml(ctx)))
+ {
+ alt471=2;
+ }
+ else if ( (ANTLR3_TRUE))
+ {
+ alt471=4;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 471;
+ EXCEPTION->state = 4;
+
+
+ goto rulestatement_iterationEx;
+
+ }
+ }
+ }
+ break;
+ case DECR:
+ case INCR:
+ {
+ alt471=1;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 471;
+ EXCEPTION->state = 0;
+
+
+ goto rulestatement_iterationEx;
+
+ }
+
+ switch (alt471)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5574:6: isa= for_assign_header SEMI e= expression SEMI sai= for_assign_header
+ {
+ FOLLOWPUSH(FOLLOW_for_assign_header_in_statement_iteration19460);
+ isa=for_assign_header(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_iteration19463);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_iteration19468);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_iteration19471);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_for_assign_header_in_statement_iteration19476);
+ sai=for_assign_header(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT3(OP(FOR),
+ isa
+ , e
+ , sai
+ );
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5577:6: LPAREN isa= for_assign_header SEMI e= expression SEMI sai= for_assign_header RPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_statement_iteration19495);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_for_assign_header_in_statement_iteration19506);
+ isa=for_assign_header(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_iteration19509);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_iteration19514);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_iteration19517);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_for_assign_header_in_statement_iteration19522);
+ sai=for_assign_header(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_statement_iteration19529);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT3(OP(FOR),
+ isa
+ , e
+ , sai
+ );
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5582:6: lv= lvalue COLON e= expression
+ {
+ FOLLOWPUSH(FOLLOW_lvalue_in_statement_iteration19550);
+ lv=lvalue(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(COLON, &FOLLOW_COLON_in_statement_iteration19553);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_iteration19558);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT2(OP(FOREACH),
+ lv
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5585:6: LPAREN lv= lvalue COLON e= expression RPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_statement_iteration19577);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_lvalue_in_statement_iteration19582);
+ lv=lvalue(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(COLON, &FOLLOW_COLON_in_statement_iteration19585);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_iteration19590);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_statement_iteration19593);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT2(OP(FOREACH),
+ lv
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_statement_iteration19612);
+ sa=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append(sa
+ );
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5590:4: 'while' e= expression bs= block_statement
+ {
+ MATCHT(416, &FOLLOW_416_in_statement_iteration19621);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_iteration19626);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_statement_iteration19631);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT2(OP(WHILE_DO),
+ e
+ , bs
+ );
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5593:4: 'do' bs= block_statement 'while' e= expression SEMI
+ {
+ MATCHT(269, &FOLLOW_269_in_statement_iteration19640);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_statement_iteration19645);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(416, &FOLLOW_416_in_statement_iteration19648);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_iteration19653);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_iteration19656);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_iterationEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT2(OP(DO_WHILE),
+ bs
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestatement_iterationEx; /* Prevent compiler warnings */
+ rulestatement_iterationEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(204, statement_iteration_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end statement_iteration */
+
+/**
+ * $ANTLR start for_assign_header
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5598:1: for_assign_header returns [ sep::BFCode ac ] : (lv= lvalue ( ASSIGN e= expression | INCR | DECR ) | INCR lv= lvalue | DECR lv= lvalue );
+ */
+static sep::BFCode
+for_assign_header(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 for_assign_header_StartIndex;
+
+ sep::BF lv;
+ #undef RETURN_TYPE_lv
+ #define RETURN_TYPE_lv sep::BF
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ for_assign_header_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(205)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5601:2: (lv= lvalue ( ASSIGN e= expression | INCR | DECR ) | INCR lv= lvalue | DECR lv= lvalue )
+
+ ANTLR3_UINT32 alt474;
+
+ alt474=3;
+
+ switch ( LA(1) )
+ {
+ case COLONx2:
+ case ID:
+ {
+ alt474=1;
+ }
+ break;
+ case INCR:
+ {
+ alt474=2;
+ }
+ break;
+ case DECR:
+ {
+ alt474=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 474;
+ EXCEPTION->state = 0;
+
+
+ goto rulefor_assign_headerEx;
+
+ }
+
+ switch (alt474)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5601:4: lv= lvalue ( ASSIGN e= expression | INCR | DECR )
+ {
+ FOLLOWPUSH(FOLLOW_lvalue_in_for_assign_header19679);
+ lv=lvalue(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulefor_assign_headerEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5602:2: ( ASSIGN e= expression | INCR | DECR )
+ {
+ int alt473=3;
+ switch ( LA(1) )
+ {
+ case ASSIGN:
+ {
+ alt473=1;
+ }
+ break;
+ case INCR:
+ {
+ alt473=2;
+ }
+ break;
+ case DECR:
+ {
+ alt473=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 473;
+ EXCEPTION->state = 0;
+
+
+ goto rulefor_assign_headerEx;
+
+ }
+
+ switch (alt473)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5602:4: ASSIGN e= expression
+ {
+ MATCHT(ASSIGN, &FOLLOW_ASSIGN_in_for_assign_header19684);
+ if (HASEXCEPTION())
+ {
+ goto rulefor_assign_headerEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_for_assign_header19689);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulefor_assign_headerEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT2(OP(ASSIGN),
+ lv
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5607:4: INCR
+ {
+ MATCHT(INCR, &FOLLOW_INCR_in_for_assign_header19702);
+ if (HASEXCEPTION())
+ {
+ goto rulefor_assign_headerEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT_ASSIGN_OP(OP(PLUS),
+ lv
+ ,
+ sep::ExpressionConstant::INTEGER_ONE);
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5612:4: DECR
+ {
+ MATCHT(DECR, &FOLLOW_DECR_in_for_assign_header19713);
+ if (HASEXCEPTION())
+ {
+ goto rulefor_assign_headerEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT_ASSIGN_OP(OP(PLUS),
+ lv
+ ,
+ sep::ExpressionConstant::INTEGER_MINUS_ONE);
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5617:4: INCR lv= lvalue
+ {
+ MATCHT(INCR, &FOLLOW_INCR_in_for_assign_header19725);
+ if (HASEXCEPTION())
+ {
+ goto rulefor_assign_headerEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_lvalue_in_for_assign_header19730);
+ lv=lvalue(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulefor_assign_headerEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT_ASSIGN_OP(OP(PLUS),
+ lv
+ ,
+ sep::ExpressionConstant::INTEGER_ONE);
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5622:4: DECR lv= lvalue
+ {
+ MATCHT(DECR, &FOLLOW_DECR_in_for_assign_header19741);
+ if (HASEXCEPTION())
+ {
+ goto rulefor_assign_headerEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_lvalue_in_for_assign_header19746);
+ lv=lvalue(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulefor_assign_headerEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT_ASSIGN_OP(OP(PLUS),
+ lv
+ ,
+ sep::ExpressionConstant::INTEGER_MINUS_ONE);
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulefor_assign_headerEx; /* Prevent compiler warnings */
+ rulefor_assign_headerEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(205, for_assign_header_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end for_assign_header */
+
+/**
+ * $ANTLR start statement_jump
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5632:1: statement_jump returns [ sep::BFCode ac ] : ( 'break' (e= expression )? SEMI | 'continue' (e= expression )? SEMI | 'return' (e= expression ( COMMA e= expression )* )? SEMI | 'exit' (e= expression )? SEMI );
+ */
+static sep::BFCode
+statement_jump(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 statement_jump_StartIndex;
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ statement_jump_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(206)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5634:2: ( 'break' (e= expression )? SEMI | 'continue' (e= expression )? SEMI | 'return' (e= expression ( COMMA e= expression )* )? SEMI | 'exit' (e= expression )? SEMI )
+
+ ANTLR3_UINT32 alt480;
+
+ alt480=4;
+
+ switch ( LA(1) )
+ {
+ case 247:
+ {
+ alt480=1;
+ }
+ break;
+ case 263:
+ {
+ alt480=2;
+ }
+ break;
+ case 364:
+ {
+ alt480=3;
+ }
+ break;
+ case 279:
+ {
+ alt480=4;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 480;
+ EXCEPTION->state = 0;
+
+
+ goto rulestatement_jumpEx;
+
+ }
+
+ switch (alt480)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5634:4: 'break' (e= expression )? SEMI
+ {
+ MATCHT(247, &FOLLOW_247_in_statement_jump19769);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_jumpEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT(OP(BREAK));
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5635:4: (e= expression )?
+ {
+ int alt475=2;
+ switch ( LA(1) )
+ {
+ case BNOT:
+ case COLONx2:
+ case CharLiteral:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case FloatLiteral:
+ case ID:
+ case INCR:
+ case IntegerLiteral:
+ case LBRACKET:
+ case LBRACKET_BAR:
+ case LCURLY:
+ case LNOT:
+ case LPAREN:
+ case LPAREN_INVOKE:
+ case MINUS:
+ case OP_POP:
+ case OP_TOP:
+ case PERCENT_LCURLY:
+ case PLUS:
+ case RationalLiteral:
+ case StringLiteral:
+ case 158:
+ case 159:
+ case 160:
+ case 161:
+ case 162:
+ case 237:
+ case 256:
+ case 265:
+ case 277:
+ case 280:
+ case 294:
+ case 313:
+ case 330:
+ case 331:
+ case 332:
+ case 343:
+ case 347:
+ case 372:
+ case 397:
+ {
+ alt475=1;
+ }
+ break;
+ }
+
+ switch (alt475)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5635:6: e= expression
+ {
+ FOLLOWPUSH(FOLLOW_expression_in_statement_jump19788);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_jumpEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append( e
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_jump19799);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_jumpEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5638:4: 'continue' (e= expression )? SEMI
+ {
+ MATCHT(263, &FOLLOW_263_in_statement_jump19805);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_jumpEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT(OP(CONTINUE));
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5639:4: (e= expression )?
+ {
+ int alt476=2;
+ switch ( LA(1) )
+ {
+ case BNOT:
+ case COLONx2:
+ case CharLiteral:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case FloatLiteral:
+ case ID:
+ case INCR:
+ case IntegerLiteral:
+ case LBRACKET:
+ case LBRACKET_BAR:
+ case LCURLY:
+ case LNOT:
+ case LPAREN:
+ case LPAREN_INVOKE:
+ case MINUS:
+ case OP_POP:
+ case OP_TOP:
+ case PERCENT_LCURLY:
+ case PLUS:
+ case RationalLiteral:
+ case StringLiteral:
+ case 158:
+ case 159:
+ case 160:
+ case 161:
+ case 162:
+ case 237:
+ case 256:
+ case 265:
+ case 277:
+ case 280:
+ case 294:
+ case 313:
+ case 330:
+ case 331:
+ case 332:
+ case 343:
+ case 347:
+ case 372:
+ case 397:
+ {
+ alt476=1;
+ }
+ break;
+ }
+
+ switch (alt476)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5639:6: e= expression
+ {
+ FOLLOWPUSH(FOLLOW_expression_in_statement_jump19821);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_jumpEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append( e
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_jump19832);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_jumpEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5642:4: 'return' (e= expression ( COMMA e= expression )* )? SEMI
+ {
+ MATCHT(364, &FOLLOW_364_in_statement_jump19838);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_jumpEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT(OP(RETURN));
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5643:4: (e= expression ( COMMA e= expression )* )?
+ {
+ int alt478=2;
+ switch ( LA(1) )
+ {
+ case BNOT:
+ case COLONx2:
+ case CharLiteral:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case FloatLiteral:
+ case ID:
+ case INCR:
+ case IntegerLiteral:
+ case LBRACKET:
+ case LBRACKET_BAR:
+ case LCURLY:
+ case LNOT:
+ case LPAREN:
+ case LPAREN_INVOKE:
+ case MINUS:
+ case OP_POP:
+ case OP_TOP:
+ case PERCENT_LCURLY:
+ case PLUS:
+ case RationalLiteral:
+ case StringLiteral:
+ case 158:
+ case 159:
+ case 160:
+ case 161:
+ case 162:
+ case 237:
+ case 256:
+ case 265:
+ case 277:
+ case 280:
+ case 294:
+ case 313:
+ case 330:
+ case 331:
+ case 332:
+ case 343:
+ case 347:
+ case 372:
+ case 397:
+ {
+ alt478=1;
+ }
+ break;
+ }
+
+ switch (alt478)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5643:6: e= expression ( COMMA e= expression )*
+ {
+ FOLLOWPUSH(FOLLOW_expression_in_statement_jump19856);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_jumpEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append( e
+ );
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5644:6: ( COMMA e= expression )*
+
+ for (;;)
+ {
+ int alt477=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt477=1;
+ }
+ break;
+
+ }
+
+ switch (alt477)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5644:8: COMMA e= expression
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_statement_jump19868);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_jumpEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_jump19872);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_jumpEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append( e
+ );
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop477; /* break out of the loop */
+ break;
+ }
+ }
+ loop477: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_jump19889);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_jumpEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5648:4: 'exit' (e= expression )? SEMI
+ {
+ MATCHT(279, &FOLLOW_279_in_statement_jump19895);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_jumpEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT(OP(EXIT));
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5649:4: (e= expression )?
+ {
+ int alt479=2;
+ switch ( LA(1) )
+ {
+ case BNOT:
+ case COLONx2:
+ case CharLiteral:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case FloatLiteral:
+ case ID:
+ case INCR:
+ case IntegerLiteral:
+ case LBRACKET:
+ case LBRACKET_BAR:
+ case LCURLY:
+ case LNOT:
+ case LPAREN:
+ case LPAREN_INVOKE:
+ case MINUS:
+ case OP_POP:
+ case OP_TOP:
+ case PERCENT_LCURLY:
+ case PLUS:
+ case RationalLiteral:
+ case StringLiteral:
+ case 158:
+ case 159:
+ case 160:
+ case 161:
+ case 162:
+ case 237:
+ case 256:
+ case 265:
+ case 277:
+ case 280:
+ case 294:
+ case 313:
+ case 330:
+ case 331:
+ case 332:
+ case 343:
+ case 347:
+ case 372:
+ case 397:
+ {
+ alt479=1;
+ }
+ break;
+ }
+
+ switch (alt479)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5649:6: e= expression
+ {
+ FOLLOWPUSH(FOLLOW_expression_in_statement_jump19915);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_jumpEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append( e
+ );
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_jump19926);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_jumpEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestatement_jumpEx; /* Prevent compiler warnings */
+ rulestatement_jumpEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(206, statement_jump_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end statement_jump */
+
+/**
+ * $ANTLR start expression_lambda
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5657:1: expression_lambda returns [ sep::BFCode ac ] : 'lambda' (id= ID )* '->' e= expression ;
+ */
+static sep::BFCode
+expression_lambda(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 expression_lambda_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ expression_lambda_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(207)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ id = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5659:2: ( 'lambda' (id= ID )* '->' e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5659:4: 'lambda' (id= ID )* '->' e= expression
+ {
+ MATCHT(313, &FOLLOW_313_in_expression_lambda19945);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_lambdaEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_CODE( OP(LAMBDA) );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5660:4: (id= ID )*
+
+ for (;;)
+ {
+ int alt481=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt481=1;
+ }
+ break;
+
+ }
+
+ switch (alt481)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5660:6: id= ID
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_expression_lambda19957);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_lambdaEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append( NEW_ID(STR((id->getText(id))->chars)) );
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop481; /* break out of the loop */
+ break;
+ }
+ }
+ loop481: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(164, &FOLLOW_164_in_expression_lambda19969);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_lambdaEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression_lambda19973);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_lambdaEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append( e
+ );
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleexpression_lambdaEx; /* Prevent compiler warnings */
+ ruleexpression_lambdaEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(207, expression_lambda_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end expression_lambda */
+
+/**
+ * $ANTLR start expression_status
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5669:1: expression_status returns [ sep::BFCode ac ] : ( 'status#was' o= op_activity id= qualifiedNameID | 'status#is' o= op_activity id= qualifiedNameID | 'status#being' o= op_activity id= qualifiedNameID | 'status#will' o= op_activity id= qualifiedNameID | 'changed' lv= lvalue | 'changed#to' lv= lvalue );
+ */
+static sep::BFCode
+expression_status(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 expression_status_StartIndex;
+
+ sep::Operator * o;
+ #undef RETURN_TYPE_o
+ #define RETURN_TYPE_o sep::Operator *
+
+ fmlParser_qualifiedNameID_return id;
+ #undef RETURN_TYPE_id
+ #define RETURN_TYPE_id fmlParser_qualifiedNameID_return
+
+ sep::BF lv;
+ #undef RETURN_TYPE_lv
+ #define RETURN_TYPE_lv sep::BF
+
+ /* Initialize rule variables
+ */
+ expression_status_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(208)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5671:2: ( 'status#was' o= op_activity id= qualifiedNameID | 'status#is' o= op_activity id= qualifiedNameID | 'status#being' o= op_activity id= qualifiedNameID | 'status#will' o= op_activity id= qualifiedNameID | 'changed' lv= lvalue | 'changed#to' lv= lvalue )
+
+ ANTLR3_UINT32 alt482;
+
+ alt482=6;
+
+ switch ( LA(1) )
+ {
+ case 383:
+ {
+ alt482=1;
+ }
+ break;
+ case 382:
+ {
+ alt482=2;
+ }
+ break;
+ case 381:
+ {
+ alt482=3;
+ }
+ break;
+ case 384:
+ {
+ alt482=4;
+ }
+ break;
+ case 252:
+ {
+ alt482=5;
+ }
+ break;
+ case 251:
+ {
+ alt482=6;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 482;
+ EXCEPTION->state = 0;
+
+
+ goto ruleexpression_statusEx;
+
+ }
+
+ switch (alt482)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5671:4: 'status#was' o= op_activity id= qualifiedNameID
+ {
+ MATCHT(383, &FOLLOW_383_in_expression_status19996);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_statusEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_op_activity_in_expression_status20003);
+ o=op_activity(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_statusEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_expression_status20008);
+ id=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_statusEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT2(OP(STATUS_WAS), INCR_BF(
+ o
+ ),
+ sep::ParserUtil::getvarMachine(id.s
+ , id.nb
+ ));
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5675:4: 'status#is' o= op_activity id= qualifiedNameID
+ {
+ MATCHT(382, &FOLLOW_382_in_expression_status20017);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_statusEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_op_activity_in_expression_status20025);
+ o=op_activity(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_statusEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_expression_status20030);
+ id=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_statusEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT2(OP(STATUS_IS), INCR_BF(
+ o
+ ),
+ sep::ParserUtil::getvarMachine(id.s
+ , id.nb
+ ));
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5679:4: 'status#being' o= op_activity id= qualifiedNameID
+ {
+ MATCHT(381, &FOLLOW_381_in_expression_status20039);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_statusEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_op_activity_in_expression_status20044);
+ o=op_activity(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_statusEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_expression_status20049);
+ id=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_statusEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT2(OP(STATUS_BEING), INCR_BF(
+ o
+ ),
+ sep::ParserUtil::getvarMachine(id.s
+ , id.nb
+ ));
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5683:4: 'status#will' o= op_activity id= qualifiedNameID
+ {
+ MATCHT(384, &FOLLOW_384_in_expression_status20058);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_statusEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_op_activity_in_expression_status20064);
+ o=op_activity(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_statusEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_expression_status20069);
+ id=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_statusEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT2(OP(STATUS_WILL), INCR_BF(
+ o
+ ),
+ sep::ParserUtil::getvarMachine(id.s
+ , id.nb
+ ));
+
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5687:4: 'changed' lv= lvalue
+ {
+ MATCHT(252, &FOLLOW_252_in_expression_status20078);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_statusEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_lvalue_in_expression_status20086);
+ lv=lvalue(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_statusEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT1(OP(CHANGED),
+ lv
+ );
+
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5690:4: 'changed#to' lv= lvalue
+ {
+ MATCHT(251, &FOLLOW_251_in_expression_status20095);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_statusEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_lvalue_in_expression_status20100);
+ lv=lvalue(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpression_statusEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT1(OP(CHANGED_TO),
+ lv
+ );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleexpression_statusEx; /* Prevent compiler warnings */
+ ruleexpression_statusEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(208, expression_status_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end expression_status */
+
+/**
+ * $ANTLR start op_activity
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5694:1: op_activity returns [ sep::Operator * op ] : ( 'init' | 'final' | 'destroy' | 'start' | 'restart' | 'stop' | 'ienable' | 'enable' | 'idisable' | 'disable' | 'iabort' | 'abort' | 'run' | 'rtc' | 'schedule' | 'suspend' | 'resume' | 'wait' );
+ */
+static sep::Operator *
+op_activity(pfmlParser ctx)
+{
+ sep::Operator * op;
+
+ ANTLR3_UINT32 op_activity_StartIndex;
+
+ /* Initialize rule variables
+ */
+ op_activity_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(209)) )
+ {
+ {
+ }
+
+
+
+ return op;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5696:2: ( 'init' | 'final' | 'destroy' | 'start' | 'restart' | 'stop' | 'ienable' | 'enable' | 'idisable' | 'disable' | 'iabort' | 'abort' | 'run' | 'rtc' | 'schedule' | 'suspend' | 'resume' | 'wait' )
+
+ ANTLR3_UINT32 alt483;
+
+ alt483=18;
+
+ switch ( LA(1) )
+ {
+ case 296:
+ {
+ alt483=1;
+ }
+ break;
+ case 282:
+ {
+ alt483=2;
+ }
+ break;
+ case 267:
+ {
+ alt483=3;
+ }
+ break;
+ case 377:
+ {
+ alt483=4;
+ }
+ break;
+ case 362:
+ {
+ alt483=5;
+ }
+ break;
+ case 386:
+ {
+ alt483=6;
+ }
+ break;
+ case 293:
+ {
+ alt483=7;
+ }
+ break;
+ case 275:
+ {
+ alt483=8;
+ }
+ break;
+ case 292:
+ {
+ alt483=9;
+ }
+ break;
+ case 268:
+ {
+ alt483=10;
+ }
+ break;
+ case 291:
+ {
+ alt483=11;
+ }
+ break;
+ case 236:
+ {
+ alt483=12;
+ }
+ break;
+ case 369:
+ {
+ alt483=13;
+ }
+ break;
+ case 368:
+ {
+ alt483=14;
+ }
+ break;
+ case 371:
+ {
+ alt483=15;
+ }
+ break;
+ case 389:
+ {
+ alt483=16;
+ }
+ break;
+ case 363:
+ {
+ alt483=17;
+ }
+ break;
+ case 415:
+ {
+ alt483=18;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return op;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 483;
+ EXCEPTION->state = 0;
+
+
+ goto ruleop_activityEx;
+
+ }
+
+ switch (alt483)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5696:4: 'init'
+ {
+ MATCHT(296, &FOLLOW_296_in_op_activity20118);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(INIT);
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5697:4: 'final'
+ {
+ MATCHT(282, &FOLLOW_282_in_op_activity20129);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(FINAL);
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5698:4: 'destroy'
+ {
+ MATCHT(267, &FOLLOW_267_in_op_activity20139);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(DESTROY);
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5699:4: 'start'
+ {
+ MATCHT(377, &FOLLOW_377_in_op_activity20147);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(START);
+
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5700:4: 'restart'
+ {
+ MATCHT(362, &FOLLOW_362_in_op_activity20157);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(RESTART);
+
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5701:4: 'stop'
+ {
+ MATCHT(386, &FOLLOW_386_in_op_activity20165);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(STOP);
+
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5702:4: 'ienable'
+ {
+ MATCHT(293, &FOLLOW_293_in_op_activity20176);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(IENABLE_INVOKE);
+
+ }
+
+
+ }
+ break;
+ case 8:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5703:4: 'enable'
+ {
+ MATCHT(275, &FOLLOW_275_in_op_activity20184);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(ENABLE_INVOKE);
+
+ }
+
+
+ }
+ break;
+ case 9:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5704:4: 'idisable'
+ {
+ MATCHT(292, &FOLLOW_292_in_op_activity20193);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(IDISABLE_INVOKE);
+
+ }
+
+
+ }
+ break;
+ case 10:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5705:4: 'disable'
+ {
+ MATCHT(268, &FOLLOW_268_in_op_activity20200);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(DISABLE_INVOKE);
+
+ }
+
+
+ }
+ break;
+ case 11:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5706:4: 'iabort'
+ {
+ MATCHT(291, &FOLLOW_291_in_op_activity20208);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(IABORT_INVOKE);
+
+ }
+
+
+ }
+ break;
+ case 12:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5707:4: 'abort'
+ {
+ MATCHT(236, &FOLLOW_236_in_op_activity20217);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(ABORT_INVOKE);
+
+ }
+
+
+ }
+ break;
+ case 13:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5708:4: 'run'
+ {
+ MATCHT(369, &FOLLOW_369_in_op_activity20227);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(RUN);
+
+ }
+
+
+ }
+ break;
+ case 14:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5709:4: 'rtc'
+ {
+ MATCHT(368, &FOLLOW_368_in_op_activity20239);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(RTC);
+
+ }
+
+
+ }
+ break;
+ case 15:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5710:4: 'schedule'
+ {
+ MATCHT(371, &FOLLOW_371_in_op_activity20251);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(SCHEDULE_INVOKE);
+
+ }
+
+
+ }
+ break;
+ case 16:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5711:4: 'suspend'
+ {
+ MATCHT(389, &FOLLOW_389_in_op_activity20258);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(SUSPEND);
+
+ }
+
+
+ }
+ break;
+ case 17:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5712:4: 'resume'
+ {
+ MATCHT(363, &FOLLOW_363_in_op_activity20266);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(RESUME);
+
+ }
+
+
+ }
+ break;
+ case 18:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5713:4: 'wait'
+ {
+ MATCHT(415, &FOLLOW_415_in_op_activity20275);
+ if (HASEXCEPTION())
+ {
+ goto ruleop_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(WAIT);
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleop_activityEx; /* Prevent compiler warnings */
+ ruleop_activityEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(209, op_activity_StartIndex); }
+
+ return op;
+}
+/* $ANTLR end op_activity */
+
+/**
+ * $ANTLR start statement_activity
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5721:1: statement_activity returns [ sep::BFCode ac ] : (o= op_activity (id= qualifiedNameID )? ( activity_machine_param_return[ machine , ac ] )? SEMI | 'goto' id= qualifiedNameID (fs= statement_init_flow[flowTarget] | SEMI ) | 'join' e= expression SEMI );
+ */
+static sep::BFCode
+statement_activity(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 statement_activity_StartIndex;
+
+ sep::Operator * o;
+ #undef RETURN_TYPE_o
+ #define RETURN_TYPE_o sep::Operator *
+
+ fmlParser_qualifiedNameID_return id;
+ #undef RETURN_TYPE_id
+ #define RETURN_TYPE_id fmlParser_qualifiedNameID_return
+
+ sep::BFCode fs;
+ #undef RETURN_TYPE_fs
+ #define RETURN_TYPE_fs sep::BFCode
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ statement_activity_StartIndex = INDEX();
+
+
+
+ sep::BF flowTarget;
+ sep::BF machine;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(210)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5727:2: (o= op_activity (id= qualifiedNameID )? ( activity_machine_param_return[ machine , ac ] )? SEMI | 'goto' id= qualifiedNameID (fs= statement_init_flow[flowTarget] | SEMI ) | 'join' e= expression SEMI )
+
+ ANTLR3_UINT32 alt487;
+
+ alt487=3;
+
+ switch ( LA(1) )
+ {
+ case 236:
+ case 267:
+ case 268:
+ case 275:
+ case 282:
+ case 291:
+ case 292:
+ case 293:
+ case 296:
+ case 362:
+ case 363:
+ case 368:
+ case 369:
+ case 371:
+ case 377:
+ case 386:
+ case 389:
+ case 415:
+ {
+ alt487=1;
+ }
+ break;
+ case 289:
+ {
+ alt487=2;
+ }
+ break;
+ case 312:
+ {
+ alt487=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 487;
+ EXCEPTION->state = 0;
+
+
+ goto rulestatement_activityEx;
+
+ }
+
+ switch (alt487)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5727:4: o= op_activity (id= qualifiedNameID )? ( activity_machine_param_return[ machine , ac ] )? SEMI
+ {
+ FOLLOWPUSH(FOLLOW_op_activity_in_statement_activity20307);
+ o=op_activity(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT(
+ o
+ );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5728:4: (id= qualifiedNameID )?
+ {
+ int alt484=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt484=1;
+ }
+ break;
+ }
+
+ switch (alt484)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5728:6: id= qualifiedNameID
+ {
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_statement_activity20319);
+ id=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append(machine =
+ sep::ParserUtil::getvarMachine(id.s
+ , id.nb
+ ));
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5733:4: ( activity_machine_param_return[ machine , ac ] )?
+ {
+ int alt485=2;
+ switch ( LA(1) )
+ {
+ case LPAREN:
+ {
+ alt485=1;
+ }
+ break;
+ }
+
+ switch (alt485)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5733:4: activity_machine_param_return[ machine , ac ]
+ {
+ FOLLOWPUSH(FOLLOW_activity_machine_param_return_in_statement_activity20338);
+ activity_machine_param_return(ctx, machine, ac);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_activity20346);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5740:4: 'goto' id= qualifiedNameID (fs= statement_init_flow[flowTarget] | SEMI )
+ {
+ MATCHT(289, &FOLLOW_289_in_statement_activity20355);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_statement_activity20360);
+ id=qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT1(OP(GOTO),
+ flowTarget = sep::ParserUtil::getvarMachine(
+ id.s
+ , id.nb
+ ));
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5743:4: (fs= statement_init_flow[flowTarget] | SEMI )
+ {
+ int alt486=2;
+ switch ( LA(1) )
+ {
+ case 284:
+ {
+ alt486=1;
+ }
+ break;
+ case SEMI:
+ {
+ alt486=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ac;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 486;
+ EXCEPTION->state = 0;
+
+
+ goto rulestatement_activityEx;
+
+ }
+
+ switch (alt486)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5743:6: fs= statement_init_flow[flowTarget]
+ {
+ FOLLOWPUSH(FOLLOW_statement_init_flow_in_statement_activity20374);
+ fs=statement_init_flow(ctx, flowTarget);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac
+ ->append(fs
+ );
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5744:6: SEMI
+ {
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_activity20385);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5747:4: 'join' e= expression SEMI
+ {
+ MATCHT(312, &FOLLOW_312_in_statement_activity20396);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_statement_activity20401);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_activity20404);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_activityEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT1(OP(JOIN),
+ e
+ );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestatement_activityEx; /* Prevent compiler warnings */
+ rulestatement_activityEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(210, statement_activity_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end statement_activity */
+
+/**
+ * $ANTLR start statement_init_flow
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5753:1: statement_init_flow[ const sep::BF & flowTarget ] returns [ sep::BFCode ac ] : 'flow' bs= block_statement ;
+ */
+static sep::BFCode
+statement_init_flow(pfmlParser ctx, const sep::BF & flowTarget)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 statement_init_flow_StartIndex;
+
+ sep::BFCode bs;
+ #undef RETURN_TYPE_bs
+ #define RETURN_TYPE_bs sep::BFCode
+
+ /* Initialize rule variables
+ */
+ statement_init_flow_StartIndex = INDEX();
+
+
+
+ if( flowTarget.is< sep::Machine >() )
+ {
+ PUSH_CTX_CPM( flowTarget.to_ptr< sep::Machine >() );
+ }
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(211)) )
+ {
+ {
+
+ if( flowTarget.is< sep::Machine >() )
+ {
+ POP_CTX;
+ }
+
+ }
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5767:2: ( 'flow' bs= block_statement )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5767:4: 'flow' bs= block_statement
+ {
+ MATCHT(284, &FOLLOW_284_in_statement_init_flow20434);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_init_flowEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_statement_init_flow20438);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_init_flowEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac=
+ bs
+ ;
+
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestatement_init_flowEx; /* Prevent compiler warnings */
+ rulestatement_init_flowEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ if( flowTarget.is< sep::Machine >() )
+ {
+ POP_CTX;
+ }
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(211, statement_init_flow_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end statement_init_flow */
+
+/**
+ * $ANTLR start statement_invoke_routine
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5775:1: statement_invoke_routine returns [ sep::BFCode ac ] : id= ID invoke_routine_params[ invokeRoutine ] ( invoke_routine_returns[ invokeRoutine ] )? SEMI ;
+ */
+static sep::BFCode
+statement_invoke_routine(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 statement_invoke_routine_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+
+ /* Initialize rule variables
+ */
+ statement_invoke_routine_StartIndex = INDEX();
+
+
+
+ sep::Routine * invokeRoutine = NULL;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(212)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ id = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5780:2: (id= ID invoke_routine_params[ invokeRoutine ] ( invoke_routine_returns[ invokeRoutine ] )? SEMI )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5780:4: id= ID invoke_routine_params[ invokeRoutine ] ( invoke_routine_returns[ invokeRoutine ] )? SEMI
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_statement_invoke_routine20468);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_invoke_routineEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ invokeRoutine = sep::Routine::newInvoke( _CPRMS_, STR((id->getText(id))->chars));
+
+ invokeRoutine->setModel(
+ sep::ParserUtil::getvarRoutine(STR((id->getText(id))->chars)) );
+
+ }
+
+
+ FOLLOWPUSH(FOLLOW_invoke_routine_params_in_statement_invoke_routine20479);
+ invoke_routine_params(ctx, invokeRoutine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_invoke_routineEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5789:7: ( invoke_routine_returns[ invokeRoutine ] )?
+ {
+ int alt488=2;
+ switch ( LA(1) )
+ {
+ case 163:
+ case 365:
+ {
+ alt488=1;
+ }
+ break;
+ }
+
+ switch (alt488)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5789:9: invoke_routine_returns[ invokeRoutine ]
+ {
+ FOLLOWPUSH(FOLLOW_invoke_routine_returns_in_statement_invoke_routine20490);
+ invoke_routine_returns(ctx, invokeRoutine);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_invoke_routineEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_invoke_routine20502);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_invoke_routineEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= sep::ParserUtil::invokeRoutineStatement(invokeRoutine);
+
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestatement_invoke_routineEx; /* Prevent compiler warnings */
+ rulestatement_invoke_routineEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(212, statement_invoke_routine_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end statement_invoke_routine */
+
+/**
+ * $ANTLR start invoke_routine_params
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5796:1: invoke_routine_params[ sep::Routine * invokeRoutine ] : LPAREN (lp= labelled_argument ( COMMA lp= labelled_argument )* )? RPAREN ;
+ */
+static void
+invoke_routine_params(pfmlParser ctx, sep::Routine * invokeRoutine)
+{
+ ANTLR3_UINT32 invoke_routine_params_StartIndex;
+
+ fmlParser_labelled_argument_return lp;
+ #undef RETURN_TYPE_lp
+ #define RETURN_TYPE_lp fmlParser_labelled_argument_return
+
+ /* Initialize rule variables
+ */
+ invoke_routine_params_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(213)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5797:2: ( LPAREN (lp= labelled_argument ( COMMA lp= labelled_argument )* )? RPAREN )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5797:4: LPAREN (lp= labelled_argument ( COMMA lp= labelled_argument )* )? RPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_invoke_routine_params20525);
+ if (HASEXCEPTION())
+ {
+ goto ruleinvoke_routine_paramsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5798:4: (lp= labelled_argument ( COMMA lp= labelled_argument )* )?
+ {
+ int alt490=2;
+ switch ( LA(1) )
+ {
+ case BNOT:
+ case COLONx2:
+ case CharLiteral:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case FloatLiteral:
+ case ID:
+ case INCR:
+ case IntegerLiteral:
+ case LBRACKET:
+ case LBRACKET_BAR:
+ case LCURLY:
+ case LNOT:
+ case LPAREN:
+ case LPAREN_INVOKE:
+ case MINUS:
+ case OP_POP:
+ case OP_TOP:
+ case PERCENT_LCURLY:
+ case PLUS:
+ case RationalLiteral:
+ case StringLiteral:
+ case 158:
+ case 159:
+ case 160:
+ case 161:
+ case 162:
+ case 237:
+ case 256:
+ case 265:
+ case 277:
+ case 280:
+ case 294:
+ case 313:
+ case 330:
+ case 331:
+ case 332:
+ case 343:
+ case 347:
+ case 372:
+ case 397:
+ {
+ alt490=1;
+ }
+ break;
+ }
+
+ switch (alt490)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5798:6: lp= labelled_argument ( COMMA lp= labelled_argument )*
+ {
+ FOLLOWPUSH(FOLLOW_labelled_argument_in_invoke_routine_params20534);
+ lp=labelled_argument(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleinvoke_routine_paramsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ invokeRoutine->appendParameter(lp.label
+ , lp.arg
+ );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5802:6: ( COMMA lp= labelled_argument )*
+
+ for (;;)
+ {
+ int alt489=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt489=1;
+ }
+ break;
+
+ }
+
+ switch (alt489)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5802:8: COMMA lp= labelled_argument
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_invoke_routine_params20550);
+ if (HASEXCEPTION())
+ {
+ goto ruleinvoke_routine_paramsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_labelled_argument_in_invoke_routine_params20559);
+ lp=labelled_argument(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleinvoke_routine_paramsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ invokeRoutine->appendParameter(lp.label
+ , lp.arg
+ );
+
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop489; /* break out of the loop */
+ break;
+ }
+ }
+ loop489: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_invoke_routine_params20585);
+ if (HASEXCEPTION())
+ {
+ goto ruleinvoke_routine_paramsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleinvoke_routine_paramsEx; /* Prevent compiler warnings */
+ ruleinvoke_routine_paramsEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(213, invoke_routine_params_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end invoke_routine_params */
+
+/**
+ * $ANTLR start invoke_routine_returns
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5813:1: invoke_routine_returns[ sep::Routine * invokeRoutine ] : ( '-->' | 'returns:' ) ( LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN |lp= labelled_argument ) ;
+ */
+static void
+invoke_routine_returns(pfmlParser ctx, sep::Routine * invokeRoutine)
+{
+ ANTLR3_UINT32 invoke_routine_returns_StartIndex;
+
+ fmlParser_labelled_argument_return lp;
+ #undef RETURN_TYPE_lp
+ #define RETURN_TYPE_lp fmlParser_labelled_argument_return
+
+ /* Initialize rule variables
+ */
+ invoke_routine_returns_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(214)) )
+ {
+ {
+ }
+
+
+
+ return ;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5814:2: ( ( '-->' | 'returns:' ) ( LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN |lp= labelled_argument ) )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5814:4: ( '-->' | 'returns:' ) ( LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN |lp= labelled_argument )
+ {
+ if ( LA(1) == 163 || LA(1) == 365 )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruleinvoke_routine_returnsEx;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5815:4: ( LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN |lp= labelled_argument )
+ {
+ int alt492=2;
+ switch ( LA(1) )
+ {
+ case LPAREN:
+ {
+ {
+ int LA492_1 = LA(2);
+ if ( (synpred946_fml(ctx)))
+ {
+ alt492=1;
+ }
+ else if ( (ANTLR3_TRUE))
+ {
+ alt492=2;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 492;
+ EXCEPTION->state = 1;
+
+
+ goto ruleinvoke_routine_returnsEx;
+
+ }
+ }
+ }
+ break;
+ case BNOT:
+ case COLONx2:
+ case CharLiteral:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case FloatLiteral:
+ case ID:
+ case INCR:
+ case IntegerLiteral:
+ case LBRACKET:
+ case LBRACKET_BAR:
+ case LCURLY:
+ case LNOT:
+ case LPAREN_INVOKE:
+ case MINUS:
+ case OP_POP:
+ case OP_TOP:
+ case PERCENT_LCURLY:
+ case PLUS:
+ case RationalLiteral:
+ case StringLiteral:
+ case 158:
+ case 159:
+ case 160:
+ case 161:
+ case 162:
+ case 237:
+ case 256:
+ case 265:
+ case 277:
+ case 280:
+ case 294:
+ case 313:
+ case 330:
+ case 331:
+ case 332:
+ case 343:
+ case 347:
+ case 372:
+ case 397:
+ {
+ alt492=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 492;
+ EXCEPTION->state = 0;
+
+
+ goto ruleinvoke_routine_returnsEx;
+
+ }
+
+ switch (alt492)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5815:6: LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_invoke_routine_returns20614);
+ if (HASEXCEPTION())
+ {
+ goto ruleinvoke_routine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_labelled_argument_in_invoke_routine_returns20623);
+ lp=labelled_argument(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleinvoke_routine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ invokeRoutine->appendReturn(lp.label
+ , lp.arg
+ );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5820:6: ( COMMA lp= labelled_argument )*
+
+ for (;;)
+ {
+ int alt491=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt491=1;
+ }
+ break;
+
+ }
+
+ switch (alt491)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5820:8: COMMA lp= labelled_argument
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_invoke_routine_returns20639);
+ if (HASEXCEPTION())
+ {
+ goto ruleinvoke_routine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_labelled_argument_in_invoke_routine_returns20650);
+ lp=labelled_argument(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleinvoke_routine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ invokeRoutine->appendReturn(lp.label
+ , lp.arg
+ );
+
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop491; /* break out of the loop */
+ break;
+ }
+ }
+ loop491: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_invoke_routine_returns20674);
+ if (HASEXCEPTION())
+ {
+ goto ruleinvoke_routine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5828:6: lp= labelled_argument
+ {
+ FOLLOWPUSH(FOLLOW_labelled_argument_in_invoke_routine_returns20684);
+ lp=labelled_argument(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleinvoke_routine_returnsEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ invokeRoutine->appendReturn(lp.label
+ , lp.arg
+ );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleinvoke_routine_returnsEx; /* Prevent compiler warnings */
+ ruleinvoke_routine_returnsEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(214, invoke_routine_returns_StartIndex); }
+
+ return ;
+}
+/* $ANTLR end invoke_routine_returns */
+
+/**
+ * $ANTLR start statement_moc
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5877:1: statement_moc returns [ sep::BFCode ac ] : 'step_mark' StringLiteral SEMI ;
+ */
+static sep::BFCode
+statement_moc(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 statement_moc_StartIndex;
+
+ pANTLR3_COMMON_TOKEN StringLiteral12;
+
+ /* Initialize rule variables
+ */
+ statement_moc_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(215)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ StringLiteral12 = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5879:2: ( 'step_mark' StringLiteral SEMI )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5879:4: 'step_mark' StringLiteral SEMI
+ {
+ MATCHT(385, &FOLLOW_385_in_statement_moc20722);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_mocEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ StringLiteral12 = (pANTLR3_COMMON_TOKEN) MATCHT(StringLiteral, &FOLLOW_StringLiteral_in_statement_moc20725);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_mocEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_statement_moc20728);
+ if (HASEXCEPTION())
+ {
+ goto rulestatement_mocEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ ac= NEW_STMT1(OP(STEP_MARK),
+ NEW_STRING(STR((StringLiteral12->getText(StringLiteral12))->chars)));
+
+
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulestatement_mocEx; /* Prevent compiler warnings */
+ rulestatement_mocEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(215, statement_moc_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end statement_moc */
+
+/**
+ * $ANTLR start expression
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5895:1: expression returns [ sep::BF bf ] : e= conditionalExpression ( ASSIGN e= expression | ASSIGN_MACRO e= expression | ASSIGN_AFTER e= expression | PLUS_ASSIGN e= expression | PLUS_ASSIGN_AFTER e= expression | MINUS_ASSIGN e= expression | MINUS_ASSIGN_AFTER e= expression | STAR_ASSIGN e= expression | STAR_ASSIGN_AFTER e= expression | DIV_ASSIGN e= expression | DIV_ASSIGN_AFTER e= expression | MOD_ASSIGN e= expression | MOD_ASSIGN_AFTER e= expression | LAND_ASSIGN e= expression | LAND_ASSIGN_AFTER e= expression | LOR_ASSIGN e= expression | LOR_ASSIGN_AFTER e= expression | BAND_ASSIGN e= expression | BAND_ASSIGN_AFTER e= expression | BOR_ASSIGN e= expression | BOR_ASSIGN_AFTER e= expression | BXOR_ASSIGN e= expression | BXOR_ASSIGN_AFTER e= expression | LSHIFT_ASSIGN e= expression | LSHIFT_ASSIGN_AFTER e= expression | RSHIFT_ASSIGN e= expression | RSHIFT_ASSIGN_AFTER e= expression | OP_PUSH e= expression | OP_ASSIGN_TOP e= expression | OP_POP e= expression )? ;
+ */
+static sep::BF
+expression(pfmlParser ctx)
+{
+ sep::BF bf;
+
+ ANTLR3_UINT32 expression_StartIndex;
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ expression_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(216)) )
+ {
+ {
+ }
+
+
+
+ return bf;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5897:2: (e= conditionalExpression ( ASSIGN e= expression | ASSIGN_MACRO e= expression | ASSIGN_AFTER e= expression | PLUS_ASSIGN e= expression | PLUS_ASSIGN_AFTER e= expression | MINUS_ASSIGN e= expression | MINUS_ASSIGN_AFTER e= expression | STAR_ASSIGN e= expression | STAR_ASSIGN_AFTER e= expression | DIV_ASSIGN e= expression | DIV_ASSIGN_AFTER e= expression | MOD_ASSIGN e= expression | MOD_ASSIGN_AFTER e= expression | LAND_ASSIGN e= expression | LAND_ASSIGN_AFTER e= expression | LOR_ASSIGN e= expression | LOR_ASSIGN_AFTER e= expression | BAND_ASSIGN e= expression | BAND_ASSIGN_AFTER e= expression | BOR_ASSIGN e= expression | BOR_ASSIGN_AFTER e= expression | BXOR_ASSIGN e= expression | BXOR_ASSIGN_AFTER e= expression | LSHIFT_ASSIGN e= expression | LSHIFT_ASSIGN_AFTER e= expression | RSHIFT_ASSIGN e= expression | RSHIFT_ASSIGN_AFTER e= expression | OP_PUSH e= expression | OP_ASSIGN_TOP e= expression | OP_POP e= expression )? )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5897:4: e= conditionalExpression ( ASSIGN e= expression | ASSIGN_MACRO e= expression | ASSIGN_AFTER e= expression | PLUS_ASSIGN e= expression | PLUS_ASSIGN_AFTER e= expression | MINUS_ASSIGN e= expression | MINUS_ASSIGN_AFTER e= expression | STAR_ASSIGN e= expression | STAR_ASSIGN_AFTER e= expression | DIV_ASSIGN e= expression | DIV_ASSIGN_AFTER e= expression | MOD_ASSIGN e= expression | MOD_ASSIGN_AFTER e= expression | LAND_ASSIGN e= expression | LAND_ASSIGN_AFTER e= expression | LOR_ASSIGN e= expression | LOR_ASSIGN_AFTER e= expression | BAND_ASSIGN e= expression | BAND_ASSIGN_AFTER e= expression | BOR_ASSIGN e= expression | BOR_ASSIGN_AFTER e= expression | BXOR_ASSIGN e= expression | BXOR_ASSIGN_AFTER e= expression | LSHIFT_ASSIGN e= expression | LSHIFT_ASSIGN_AFTER e= expression | RSHIFT_ASSIGN e= expression | RSHIFT_ASSIGN_AFTER e= expression | OP_PUSH e= expression | OP_ASSIGN_TOP e= expression | OP_POP e= expression )?
+ {
+ FOLLOWPUSH(FOLLOW_conditionalExpression_in_expression20757);
+ e=conditionalExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ e
+ ;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5899:2: ( ASSIGN e= expression | ASSIGN_MACRO e= expression | ASSIGN_AFTER e= expression | PLUS_ASSIGN e= expression | PLUS_ASSIGN_AFTER e= expression | MINUS_ASSIGN e= expression | MINUS_ASSIGN_AFTER e= expression | STAR_ASSIGN e= expression | STAR_ASSIGN_AFTER e= expression | DIV_ASSIGN e= expression | DIV_ASSIGN_AFTER e= expression | MOD_ASSIGN e= expression | MOD_ASSIGN_AFTER e= expression | LAND_ASSIGN e= expression | LAND_ASSIGN_AFTER e= expression | LOR_ASSIGN e= expression | LOR_ASSIGN_AFTER e= expression | BAND_ASSIGN e= expression | BAND_ASSIGN_AFTER e= expression | BOR_ASSIGN e= expression | BOR_ASSIGN_AFTER e= expression | BXOR_ASSIGN e= expression | BXOR_ASSIGN_AFTER e= expression | LSHIFT_ASSIGN e= expression | LSHIFT_ASSIGN_AFTER e= expression | RSHIFT_ASSIGN e= expression | RSHIFT_ASSIGN_AFTER e= expression | OP_PUSH e= expression | OP_ASSIGN_TOP e= expression | OP_POP e= expression )?
+ {
+ int alt493=31;
+ switch ( LA(1) )
+ {
+ case ASSIGN:
+ {
+ {
+ int LA493_1 = LA(2);
+ if ( (synpred947_fml(ctx)))
+ {
+ alt493=1;
+ }
+ }
+ }
+ break;
+ case ASSIGN_MACRO:
+ {
+ {
+ int LA493_4 = LA(2);
+ if ( (synpred948_fml(ctx)))
+ {
+ alt493=2;
+ }
+ }
+ }
+ break;
+ case ASSIGN_AFTER:
+ {
+ {
+ int LA493_6 = LA(2);
+ if ( (synpred949_fml(ctx)))
+ {
+ alt493=3;
+ }
+ }
+ }
+ break;
+ case PLUS_ASSIGN:
+ {
+ {
+ int LA493_8 = LA(2);
+ if ( (synpred950_fml(ctx)))
+ {
+ alt493=4;
+ }
+ }
+ }
+ break;
+ case PLUS_ASSIGN_AFTER:
+ {
+ {
+ int LA493_10 = LA(2);
+ if ( (synpred951_fml(ctx)))
+ {
+ alt493=5;
+ }
+ }
+ }
+ break;
+ case MINUS_ASSIGN:
+ {
+ {
+ int LA493_12 = LA(2);
+ if ( (synpred952_fml(ctx)))
+ {
+ alt493=6;
+ }
+ }
+ }
+ break;
+ case MINUS_ASSIGN_AFTER:
+ {
+ {
+ int LA493_14 = LA(2);
+ if ( (synpred953_fml(ctx)))
+ {
+ alt493=7;
+ }
+ }
+ }
+ break;
+ case STAR_ASSIGN:
+ {
+ {
+ int LA493_16 = LA(2);
+ if ( (synpred954_fml(ctx)))
+ {
+ alt493=8;
+ }
+ }
+ }
+ break;
+ case STAR_ASSIGN_AFTER:
+ {
+ {
+ int LA493_18 = LA(2);
+ if ( (synpred955_fml(ctx)))
+ {
+ alt493=9;
+ }
+ }
+ }
+ break;
+ case DIV_ASSIGN:
+ {
+ {
+ int LA493_20 = LA(2);
+ if ( (synpred956_fml(ctx)))
+ {
+ alt493=10;
+ }
+ }
+ }
+ break;
+ case DIV_ASSIGN_AFTER:
+ {
+ {
+ int LA493_22 = LA(2);
+ if ( (synpred957_fml(ctx)))
+ {
+ alt493=11;
+ }
+ }
+ }
+ break;
+ case MOD_ASSIGN:
+ {
+ {
+ int LA493_24 = LA(2);
+ if ( (synpred958_fml(ctx)))
+ {
+ alt493=12;
+ }
+ }
+ }
+ break;
+ case MOD_ASSIGN_AFTER:
+ {
+ {
+ int LA493_26 = LA(2);
+ if ( (synpred959_fml(ctx)))
+ {
+ alt493=13;
+ }
+ }
+ }
+ break;
+ case LAND_ASSIGN:
+ {
+ {
+ int LA493_28 = LA(2);
+ if ( (synpred960_fml(ctx)))
+ {
+ alt493=14;
+ }
+ }
+ }
+ break;
+ case LAND_ASSIGN_AFTER:
+ {
+ {
+ int LA493_30 = LA(2);
+ if ( (synpred961_fml(ctx)))
+ {
+ alt493=15;
+ }
+ }
+ }
+ break;
+ case LOR_ASSIGN:
+ {
+ {
+ int LA493_32 = LA(2);
+ if ( (synpred962_fml(ctx)))
+ {
+ alt493=16;
+ }
+ }
+ }
+ break;
+ case LOR_ASSIGN_AFTER:
+ {
+ {
+ int LA493_34 = LA(2);
+ if ( (synpred963_fml(ctx)))
+ {
+ alt493=17;
+ }
+ }
+ }
+ break;
+ case BAND_ASSIGN:
+ {
+ {
+ int LA493_36 = LA(2);
+ if ( (synpred964_fml(ctx)))
+ {
+ alt493=18;
+ }
+ }
+ }
+ break;
+ case BAND_ASSIGN_AFTER:
+ {
+ {
+ int LA493_38 = LA(2);
+ if ( (synpred965_fml(ctx)))
+ {
+ alt493=19;
+ }
+ }
+ }
+ break;
+ case BOR_ASSIGN:
+ {
+ {
+ int LA493_40 = LA(2);
+ if ( (synpred966_fml(ctx)))
+ {
+ alt493=20;
+ }
+ }
+ }
+ break;
+ case BOR_ASSIGN_AFTER:
+ {
+ {
+ int LA493_42 = LA(2);
+ if ( (synpred967_fml(ctx)))
+ {
+ alt493=21;
+ }
+ }
+ }
+ break;
+ case BXOR_ASSIGN:
+ {
+ {
+ int LA493_44 = LA(2);
+ if ( (synpred968_fml(ctx)))
+ {
+ alt493=22;
+ }
+ }
+ }
+ break;
+ case BXOR_ASSIGN_AFTER:
+ {
+ {
+ int LA493_46 = LA(2);
+ if ( (synpred969_fml(ctx)))
+ {
+ alt493=23;
+ }
+ }
+ }
+ break;
+ case LSHIFT_ASSIGN:
+ {
+ {
+ int LA493_48 = LA(2);
+ if ( (synpred970_fml(ctx)))
+ {
+ alt493=24;
+ }
+ }
+ }
+ break;
+ case LSHIFT_ASSIGN_AFTER:
+ {
+ {
+ int LA493_50 = LA(2);
+ if ( (synpred971_fml(ctx)))
+ {
+ alt493=25;
+ }
+ }
+ }
+ break;
+ case RSHIFT_ASSIGN:
+ {
+ {
+ int LA493_52 = LA(2);
+ if ( (synpred972_fml(ctx)))
+ {
+ alt493=26;
+ }
+ }
+ }
+ break;
+ case RSHIFT_ASSIGN_AFTER:
+ {
+ {
+ int LA493_54 = LA(2);
+ if ( (synpred973_fml(ctx)))
+ {
+ alt493=27;
+ }
+ }
+ }
+ break;
+ case OP_PUSH:
+ {
+ {
+ int LA493_56 = LA(2);
+ if ( (synpred974_fml(ctx)))
+ {
+ alt493=28;
+ }
+ }
+ }
+ break;
+ case OP_ASSIGN_TOP:
+ {
+ {
+ int LA493_58 = LA(2);
+ if ( (synpred975_fml(ctx)))
+ {
+ alt493=29;
+ }
+ }
+ }
+ break;
+ case OP_POP:
+ {
+ {
+ int LA493_60 = LA(2);
+ if ( (synpred976_fml(ctx)))
+ {
+ alt493=30;
+ }
+ }
+ }
+ break;
+ }
+
+ switch (alt493)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5899:4: ASSIGN e= expression
+ {
+ MATCHT(ASSIGN, &FOLLOW_ASSIGN_in_expression20766);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression20771);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_CODE2(OP(ASSIGN),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5902:4: ASSIGN_MACRO e= expression
+ {
+ MATCHT(ASSIGN_MACRO, &FOLLOW_ASSIGN_MACRO_in_expression20780);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression20785);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_CODE2(OP(ASSIGN_MACRO),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5905:4: ASSIGN_AFTER e= expression
+ {
+ MATCHT(ASSIGN_AFTER, &FOLLOW_ASSIGN_AFTER_in_expression20794);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression20799);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_CODE2(OP(ASSIGN_AFTER),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5908:4: PLUS_ASSIGN e= expression
+ {
+ MATCHT(PLUS_ASSIGN, &FOLLOW_PLUS_ASSIGN_in_expression20808);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression20813);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP(OP(PLUS),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5911:4: PLUS_ASSIGN_AFTER e= expression
+ {
+ MATCHT(PLUS_ASSIGN_AFTER, &FOLLOW_PLUS_ASSIGN_AFTER_in_expression20822);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression20827);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP_AFTER(OP(PLUS),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5914:4: MINUS_ASSIGN e= expression
+ {
+ MATCHT(MINUS_ASSIGN, &FOLLOW_MINUS_ASSIGN_in_expression20836);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression20841);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP(OP(MINUS),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5917:4: MINUS_ASSIGN_AFTER e= expression
+ {
+ MATCHT(MINUS_ASSIGN_AFTER, &FOLLOW_MINUS_ASSIGN_AFTER_in_expression20850);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression20855);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP_AFTER(OP(MINUS),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 8:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5920:4: STAR_ASSIGN e= expression
+ {
+ MATCHT(STAR_ASSIGN, &FOLLOW_STAR_ASSIGN_in_expression20864);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression20869);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP(OP(MULT),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 9:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5923:4: STAR_ASSIGN_AFTER e= expression
+ {
+ MATCHT(STAR_ASSIGN_AFTER, &FOLLOW_STAR_ASSIGN_AFTER_in_expression20878);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression20883);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP_AFTER(OP(MULT),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 10:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5926:4: DIV_ASSIGN e= expression
+ {
+ MATCHT(DIV_ASSIGN, &FOLLOW_DIV_ASSIGN_in_expression20892);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression20897);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP(OP(DIV),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 11:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5929:4: DIV_ASSIGN_AFTER e= expression
+ {
+ MATCHT(DIV_ASSIGN_AFTER, &FOLLOW_DIV_ASSIGN_AFTER_in_expression20906);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression20911);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP_AFTER(OP(DIV),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 12:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5932:4: MOD_ASSIGN e= expression
+ {
+ MATCHT(MOD_ASSIGN, &FOLLOW_MOD_ASSIGN_in_expression20920);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression20925);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP(OP(MOD),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 13:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5935:4: MOD_ASSIGN_AFTER e= expression
+ {
+ MATCHT(MOD_ASSIGN_AFTER, &FOLLOW_MOD_ASSIGN_AFTER_in_expression20934);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression20939);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP_AFTER(OP(MOD),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 14:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5938:4: LAND_ASSIGN e= expression
+ {
+ MATCHT(LAND_ASSIGN, &FOLLOW_LAND_ASSIGN_in_expression20948);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression20953);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP(OP(AND),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 15:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5941:4: LAND_ASSIGN_AFTER e= expression
+ {
+ MATCHT(LAND_ASSIGN_AFTER, &FOLLOW_LAND_ASSIGN_AFTER_in_expression20962);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression20967);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP_AFTER(OP(AND),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 16:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5944:4: LOR_ASSIGN e= expression
+ {
+ MATCHT(LOR_ASSIGN, &FOLLOW_LOR_ASSIGN_in_expression20976);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression20981);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP(OP(OR),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 17:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5947:4: LOR_ASSIGN_AFTER e= expression
+ {
+ MATCHT(LOR_ASSIGN_AFTER, &FOLLOW_LOR_ASSIGN_AFTER_in_expression20990);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression20995);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP_AFTER(OP(OR),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 18:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5950:4: BAND_ASSIGN e= expression
+ {
+ MATCHT(BAND_ASSIGN, &FOLLOW_BAND_ASSIGN_in_expression21004);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression21009);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP(OP(BAND),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 19:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5953:4: BAND_ASSIGN_AFTER e= expression
+ {
+ MATCHT(BAND_ASSIGN_AFTER, &FOLLOW_BAND_ASSIGN_AFTER_in_expression21018);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression21023);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP_AFTER(OP(BAND),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 20:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5956:4: BOR_ASSIGN e= expression
+ {
+ MATCHT(BOR_ASSIGN, &FOLLOW_BOR_ASSIGN_in_expression21032);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression21037);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP(OP(BOR),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 21:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5959:4: BOR_ASSIGN_AFTER e= expression
+ {
+ MATCHT(BOR_ASSIGN_AFTER, &FOLLOW_BOR_ASSIGN_AFTER_in_expression21046);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression21051);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP_AFTER(OP(BOR),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 22:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5962:4: BXOR_ASSIGN e= expression
+ {
+ MATCHT(BXOR_ASSIGN, &FOLLOW_BXOR_ASSIGN_in_expression21060);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression21065);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP(OP(BXOR),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 23:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5965:4: BXOR_ASSIGN_AFTER e= expression
+ {
+ MATCHT(BXOR_ASSIGN_AFTER, &FOLLOW_BXOR_ASSIGN_AFTER_in_expression21074);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression21079);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP_AFTER(OP(BXOR),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 24:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5968:4: LSHIFT_ASSIGN e= expression
+ {
+ MATCHT(LSHIFT_ASSIGN, &FOLLOW_LSHIFT_ASSIGN_in_expression21088);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression21093);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP(OP(LSHIFT),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 25:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5971:4: LSHIFT_ASSIGN_AFTER e= expression
+ {
+ MATCHT(LSHIFT_ASSIGN_AFTER, &FOLLOW_LSHIFT_ASSIGN_AFTER_in_expression21102);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression21107);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP_AFTER(OP(LSHIFT),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 26:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5974:4: RSHIFT_ASSIGN e= expression
+ {
+ MATCHT(RSHIFT_ASSIGN, &FOLLOW_RSHIFT_ASSIGN_in_expression21116);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression21121);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP(OP(RSHIFT),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 27:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5977:4: RSHIFT_ASSIGN_AFTER e= expression
+ {
+ MATCHT(RSHIFT_ASSIGN_AFTER, &FOLLOW_RSHIFT_ASSIGN_AFTER_in_expression21130);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression21135);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP_AFTER(OP(RSHIFT),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 28:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5980:4: OP_PUSH e= expression
+ {
+ MATCHT(OP_PUSH, &FOLLOW_OP_PUSH_in_expression21144);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression21149);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_CODE2(OP(PUSH),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 29:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5983:4: OP_ASSIGN_TOP e= expression
+ {
+ MATCHT(OP_ASSIGN_TOP, &FOLLOW_OP_ASSIGN_TOP_in_expression21158);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression21163);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_CODE2(OP(ASSIGN_TOP),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+ case 30:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5986:4: OP_POP e= expression
+ {
+ MATCHT(OP_POP, &FOLLOW_OP_POP_in_expression21172);
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_expression21177);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_CODE2(OP(POP),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleexpressionEx; /* Prevent compiler warnings */
+ ruleexpressionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(216, expression_StartIndex); }
+
+ return bf;
+}
+/* $ANTLR end expression */
+
+/**
+ * $ANTLR start conditionalExpression
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5995:1: conditionalExpression returns [ sep::BF bf ] : e= scheduleExpression ( QUESTION th= expression COLON el= expression )? ;
+ */
+static sep::BF
+conditionalExpression(pfmlParser ctx)
+{
+ sep::BF bf;
+
+ ANTLR3_UINT32 conditionalExpression_StartIndex;
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ sep::BF th;
+ #undef RETURN_TYPE_th
+ #define RETURN_TYPE_th sep::BF
+
+ sep::BF el;
+ #undef RETURN_TYPE_el
+ #define RETURN_TYPE_el sep::BF
+
+ /* Initialize rule variables
+ */
+ conditionalExpression_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(217)) )
+ {
+ {
+ }
+
+
+
+ return bf;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5997:2: (e= scheduleExpression ( QUESTION th= expression COLON el= expression )? )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5997:4: e= scheduleExpression ( QUESTION th= expression COLON el= expression )?
+ {
+ FOLLOWPUSH(FOLLOW_scheduleExpression_in_conditionalExpression21205);
+ e=scheduleExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleconditionalExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ e
+ ;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5998:4: ( QUESTION th= expression COLON el= expression )?
+ {
+ int alt494=2;
+ switch ( LA(1) )
+ {
+ case QUESTION:
+ {
+ {
+ int LA494_1 = LA(2);
+ if ( (synpred977_fml(ctx)))
+ {
+ alt494=1;
+ }
+ }
+ }
+ break;
+ }
+
+ switch (alt494)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5998:6: QUESTION th= expression COLON el= expression
+ {
+ MATCHT(QUESTION, &FOLLOW_QUESTION_in_conditionalExpression21215);
+ if (HASEXCEPTION())
+ {
+ goto ruleconditionalExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_conditionalExpression21220);
+ th=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleconditionalExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ MATCHT(COLON, &FOLLOW_COLON_in_conditionalExpression21223);
+ if (HASEXCEPTION())
+ {
+ goto ruleconditionalExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_conditionalExpression21228);
+ el=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleconditionalExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_CODE3(OP(IFE),
+ bf
+ , th
+ , el
+ );
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleconditionalExpressionEx; /* Prevent compiler warnings */
+ ruleconditionalExpressionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(217, conditionalExpression_StartIndex); }
+
+ return bf;
+}
+/* $ANTLR end conditionalExpression */
+
+/**
+ * $ANTLR start scheduleExpression
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6003:1: scheduleExpression returns [ sep::BF bf ] : e= conditionalOrExpression ( (op= op_sequence |op= op_scheduling |op= op_concurrency ) e= conditionalOrExpression )* ;
+ */
+static sep::BF
+scheduleExpression(pfmlParser ctx)
+{
+ sep::BF bf;
+
+ ANTLR3_UINT32 scheduleExpression_StartIndex;
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ sep::Operator * op;
+ #undef RETURN_TYPE_op
+ #define RETURN_TYPE_op sep::Operator *
+
+ /* Initialize rule variables
+ */
+ scheduleExpression_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(218)) )
+ {
+ {
+ }
+
+
+
+ return bf;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6005:2: (e= conditionalOrExpression ( (op= op_sequence |op= op_scheduling |op= op_concurrency ) e= conditionalOrExpression )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6005:4: e= conditionalOrExpression ( (op= op_sequence |op= op_scheduling |op= op_concurrency ) e= conditionalOrExpression )*
+ {
+ FOLLOWPUSH(FOLLOW_conditionalOrExpression_in_scheduleExpression21256);
+ e=conditionalOrExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulescheduleExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ e
+ ;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6006:4: ( (op= op_sequence |op= op_scheduling |op= op_concurrency ) e= conditionalOrExpression )*
+
+ for (;;)
+ {
+ int alt496=2;
+ switch ( LA(1) )
+ {
+ case OP_ATOMIC_SEQUENCE:
+ case OP_CONCURRENCY_AND:
+ case OP_CONCURRENCY_ASYNC:
+ case OP_CONCURRENCY_INTERLEAVING:
+ case OP_CONCURRENCY_OR:
+ case OP_CONCURRENCY_PARALLEL:
+ case OP_CONCURRENCY_RDV_AND:
+ case OP_CONCURRENCY_RDV_ASYNC:
+ case OP_CONCURRENCY_RDV_INTERLEAVING:
+ case OP_CONCURRENCY_RDV_OR:
+ case OP_CONCURRENCY_RDV_PARALLEL:
+ case OP_NON_DETERMINISM:
+ case OP_SCHEDULE_AND_THEN:
+ case OP_SCHEDULE_GT:
+ case OP_SCHEDULE_LT:
+ case OP_SCHEDULE_OR_ELSE:
+ case OP_SCHEDULE_XOR:
+ case OP_SEQUENCE:
+ case OP_SEQUENCE_SIDE:
+ case OP_SEQUENCE_WEAK:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA496_1 = LA(2);
+ if ( (synpred980_fml(ctx)))
+ {
+ alt496=1;
+ }
+
+ }
+ }
+ break;
+
+ }
+
+ switch (alt496)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6006:6: (op= op_sequence |op= op_scheduling |op= op_concurrency ) e= conditionalOrExpression
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6006:6: (op= op_sequence |op= op_scheduling |op= op_concurrency )
+ {
+ int alt495=3;
+ switch ( LA(1) )
+ {
+ case OP_ATOMIC_SEQUENCE:
+ case OP_SEQUENCE:
+ case OP_SEQUENCE_SIDE:
+ case OP_SEQUENCE_WEAK:
+ {
+ alt495=1;
+ }
+ break;
+ case OP_NON_DETERMINISM:
+ case OP_SCHEDULE_AND_THEN:
+ case OP_SCHEDULE_GT:
+ case OP_SCHEDULE_LT:
+ case OP_SCHEDULE_OR_ELSE:
+ case OP_SCHEDULE_XOR:
+ {
+ alt495=2;
+ }
+ break;
+ case OP_CONCURRENCY_AND:
+ case OP_CONCURRENCY_ASYNC:
+ case OP_CONCURRENCY_INTERLEAVING:
+ case OP_CONCURRENCY_OR:
+ case OP_CONCURRENCY_PARALLEL:
+ case OP_CONCURRENCY_RDV_AND:
+ case OP_CONCURRENCY_RDV_ASYNC:
+ case OP_CONCURRENCY_RDV_INTERLEAVING:
+ case OP_CONCURRENCY_RDV_OR:
+ case OP_CONCURRENCY_RDV_PARALLEL:
+ {
+ alt495=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return bf;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 495;
+ EXCEPTION->state = 0;
+
+
+ goto rulescheduleExpressionEx;
+
+ }
+
+ switch (alt495)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6006:8: op= op_sequence
+ {
+ FOLLOWPUSH(FOLLOW_op_sequence_in_scheduleExpression21270);
+ op=op_sequence(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulescheduleExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6006:27: op= op_scheduling
+ {
+ FOLLOWPUSH(FOLLOW_op_scheduling_in_scheduleExpression21278);
+ op=op_scheduling(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulescheduleExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6006:48: op= op_concurrency
+ {
+ FOLLOWPUSH(FOLLOW_op_concurrency_in_scheduleExpression21286);
+ op=op_concurrency(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulescheduleExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_conditionalOrExpression_in_scheduleExpression21297);
+ e=conditionalOrExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulescheduleExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_CODE_FLAT(op,
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop496; /* break out of the loop */
+ break;
+ }
+ }
+ loop496: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulescheduleExpressionEx; /* Prevent compiler warnings */
+ rulescheduleExpressionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(218, scheduleExpression_StartIndex); }
+
+ return bf;
+}
+/* $ANTLR end scheduleExpression */
+
+/**
+ * $ANTLR start conditionalOrExpression
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6011:1: conditionalOrExpression returns [ sep::BF bf ] : e= conditionalAndExpression ( LOR e= conditionalAndExpression )* ;
+ */
+static sep::BF
+conditionalOrExpression(pfmlParser ctx)
+{
+ sep::BF bf;
+
+ ANTLR3_UINT32 conditionalOrExpression_StartIndex;
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ conditionalOrExpression_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(219)) )
+ {
+ {
+ }
+
+
+
+ return bf;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6013:2: (e= conditionalAndExpression ( LOR e= conditionalAndExpression )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6013:4: e= conditionalAndExpression ( LOR e= conditionalAndExpression )*
+ {
+ FOLLOWPUSH(FOLLOW_conditionalAndExpression_in_conditionalOrExpression21323);
+ e=conditionalAndExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleconditionalOrExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ e
+ ;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6014:4: ( LOR e= conditionalAndExpression )*
+
+ for (;;)
+ {
+ int alt497=2;
+ switch ( LA(1) )
+ {
+ case LOR:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA497_1 = LA(2);
+ if ( (synpred981_fml(ctx)))
+ {
+ alt497=1;
+ }
+
+ }
+ }
+ break;
+
+ }
+
+ switch (alt497)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6014:6: LOR e= conditionalAndExpression
+ {
+ MATCHT(LOR, &FOLLOW_LOR_in_conditionalOrExpression21333);
+ if (HASEXCEPTION())
+ {
+ goto ruleconditionalOrExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_conditionalAndExpression_in_conditionalOrExpression21337);
+ e=conditionalAndExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleconditionalOrExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_CODE_FLAT(OP(OR),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop497; /* break out of the loop */
+ break;
+ }
+ }
+ loop497: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleconditionalOrExpressionEx; /* Prevent compiler warnings */
+ ruleconditionalOrExpressionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(219, conditionalOrExpression_StartIndex); }
+
+ return bf;
+}
+/* $ANTLR end conditionalOrExpression */
+
+/**
+ * $ANTLR start conditionalAndExpression
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6019:1: conditionalAndExpression returns [ sep::BF bf ] : e= bitwiseOrExpression ( LAND e= bitwiseOrExpression )* ;
+ */
+static sep::BF
+conditionalAndExpression(pfmlParser ctx)
+{
+ sep::BF bf;
+
+ ANTLR3_UINT32 conditionalAndExpression_StartIndex;
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ conditionalAndExpression_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(220)) )
+ {
+ {
+ }
+
+
+
+ return bf;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6021:2: (e= bitwiseOrExpression ( LAND e= bitwiseOrExpression )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6021:4: e= bitwiseOrExpression ( LAND e= bitwiseOrExpression )*
+ {
+ FOLLOWPUSH(FOLLOW_bitwiseOrExpression_in_conditionalAndExpression21365);
+ e=bitwiseOrExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleconditionalAndExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ e
+ ;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6022:4: ( LAND e= bitwiseOrExpression )*
+
+ for (;;)
+ {
+ int alt498=2;
+ switch ( LA(1) )
+ {
+ case LAND:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA498_1 = LA(2);
+ if ( (synpred982_fml(ctx)))
+ {
+ alt498=1;
+ }
+
+ }
+ }
+ break;
+
+ }
+
+ switch (alt498)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6022:6: LAND e= bitwiseOrExpression
+ {
+ MATCHT(LAND, &FOLLOW_LAND_in_conditionalAndExpression21375);
+ if (HASEXCEPTION())
+ {
+ goto ruleconditionalAndExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_bitwiseOrExpression_in_conditionalAndExpression21379);
+ e=bitwiseOrExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleconditionalAndExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_CODE_FLAT(OP(AND),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop498; /* break out of the loop */
+ break;
+ }
+ }
+ loop498: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleconditionalAndExpressionEx; /* Prevent compiler warnings */
+ ruleconditionalAndExpressionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(220, conditionalAndExpression_StartIndex); }
+
+ return bf;
+}
+/* $ANTLR end conditionalAndExpression */
+
+/**
+ * $ANTLR start bitwiseOrExpression
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6027:1: bitwiseOrExpression returns [ sep::BF bf ] : e= bitwiseXorExpression ( BOR e= bitwiseXorExpression )* ;
+ */
+static sep::BF
+bitwiseOrExpression(pfmlParser ctx)
+{
+ sep::BF bf;
+
+ ANTLR3_UINT32 bitwiseOrExpression_StartIndex;
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ bitwiseOrExpression_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(221)) )
+ {
+ {
+ }
+
+
+
+ return bf;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6029:2: (e= bitwiseXorExpression ( BOR e= bitwiseXorExpression )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6029:4: e= bitwiseXorExpression ( BOR e= bitwiseXorExpression )*
+ {
+ FOLLOWPUSH(FOLLOW_bitwiseXorExpression_in_bitwiseOrExpression21407);
+ e=bitwiseXorExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulebitwiseOrExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ e
+ ;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6030:4: ( BOR e= bitwiseXorExpression )*
+
+ for (;;)
+ {
+ int alt499=2;
+ switch ( LA(1) )
+ {
+ case BOR:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA499_1 = LA(2);
+ if ( (synpred983_fml(ctx)))
+ {
+ alt499=1;
+ }
+
+ }
+ }
+ break;
+
+ }
+
+ switch (alt499)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6030:6: BOR e= bitwiseXorExpression
+ {
+ MATCHT(BOR, &FOLLOW_BOR_in_bitwiseOrExpression21417);
+ if (HASEXCEPTION())
+ {
+ goto rulebitwiseOrExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_bitwiseXorExpression_in_bitwiseOrExpression21421);
+ e=bitwiseXorExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulebitwiseOrExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_CODE_FLAT(OP(BOR),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop499; /* break out of the loop */
+ break;
+ }
+ }
+ loop499: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulebitwiseOrExpressionEx; /* Prevent compiler warnings */
+ rulebitwiseOrExpressionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(221, bitwiseOrExpression_StartIndex); }
+
+ return bf;
+}
+/* $ANTLR end bitwiseOrExpression */
+
+/**
+ * $ANTLR start bitwiseXorExpression
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6035:1: bitwiseXorExpression returns [ sep::BF bf ] : e= bitwiseAndExpression ( BXOR e= bitwiseAndExpression )* ;
+ */
+static sep::BF
+bitwiseXorExpression(pfmlParser ctx)
+{
+ sep::BF bf;
+
+ ANTLR3_UINT32 bitwiseXorExpression_StartIndex;
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ bitwiseXorExpression_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(222)) )
+ {
+ {
+ }
+
+
+
+ return bf;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6037:2: (e= bitwiseAndExpression ( BXOR e= bitwiseAndExpression )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6037:4: e= bitwiseAndExpression ( BXOR e= bitwiseAndExpression )*
+ {
+ FOLLOWPUSH(FOLLOW_bitwiseAndExpression_in_bitwiseXorExpression21449);
+ e=bitwiseAndExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulebitwiseXorExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ e
+ ;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6038:4: ( BXOR e= bitwiseAndExpression )*
+
+ for (;;)
+ {
+ int alt500=2;
+ switch ( LA(1) )
+ {
+ case BXOR:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA500_1 = LA(2);
+ if ( (synpred984_fml(ctx)))
+ {
+ alt500=1;
+ }
+
+ }
+ }
+ break;
+
+ }
+
+ switch (alt500)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6038:6: BXOR e= bitwiseAndExpression
+ {
+ MATCHT(BXOR, &FOLLOW_BXOR_in_bitwiseXorExpression21459);
+ if (HASEXCEPTION())
+ {
+ goto rulebitwiseXorExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_bitwiseAndExpression_in_bitwiseXorExpression21463);
+ e=bitwiseAndExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulebitwiseXorExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_CODE_FLAT(OP(BXOR),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop500; /* break out of the loop */
+ break;
+ }
+ }
+ loop500: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulebitwiseXorExpressionEx; /* Prevent compiler warnings */
+ rulebitwiseXorExpressionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(222, bitwiseXorExpression_StartIndex); }
+
+ return bf;
+}
+/* $ANTLR end bitwiseXorExpression */
+
+/**
+ * $ANTLR start bitwiseAndExpression
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6043:1: bitwiseAndExpression returns [ sep::BF bf ] : e= equalityExpression ( BAND e= equalityExpression )* ;
+ */
+static sep::BF
+bitwiseAndExpression(pfmlParser ctx)
+{
+ sep::BF bf;
+
+ ANTLR3_UINT32 bitwiseAndExpression_StartIndex;
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ bitwiseAndExpression_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(223)) )
+ {
+ {
+ }
+
+
+
+ return bf;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6045:2: (e= equalityExpression ( BAND e= equalityExpression )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6045:4: e= equalityExpression ( BAND e= equalityExpression )*
+ {
+ FOLLOWPUSH(FOLLOW_equalityExpression_in_bitwiseAndExpression21491);
+ e=equalityExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulebitwiseAndExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ e
+ ;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6046:4: ( BAND e= equalityExpression )*
+
+ for (;;)
+ {
+ int alt501=2;
+ switch ( LA(1) )
+ {
+ case BAND:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA501_1 = LA(2);
+ if ( (synpred985_fml(ctx)))
+ {
+ alt501=1;
+ }
+
+ }
+ }
+ break;
+
+ }
+
+ switch (alt501)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6046:6: BAND e= equalityExpression
+ {
+ MATCHT(BAND, &FOLLOW_BAND_in_bitwiseAndExpression21501);
+ if (HASEXCEPTION())
+ {
+ goto rulebitwiseAndExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_equalityExpression_in_bitwiseAndExpression21505);
+ e=equalityExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulebitwiseAndExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_CODE_FLAT(OP(BAND),
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop501; /* break out of the loop */
+ break;
+ }
+ }
+ loop501: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulebitwiseAndExpressionEx; /* Prevent compiler warnings */
+ rulebitwiseAndExpressionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(223, bitwiseAndExpression_StartIndex); }
+
+ return bf;
+}
+/* $ANTLR end bitwiseAndExpression */
+
+/**
+ * $ANTLR start equalityExpression
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6051:1: equalityExpression returns [ sep::BF bf ] : e= relationalExpression (op= equalOp e= relationalExpression (op= equalOp e= relationalExpression )* )? ;
+ */
+static sep::BF
+equalityExpression(pfmlParser ctx)
+{
+ sep::BF bf;
+
+ ANTLR3_UINT32 equalityExpression_StartIndex;
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ sep::Operator * op;
+ #undef RETURN_TYPE_op
+ #define RETURN_TYPE_op sep::Operator *
+
+ /* Initialize rule variables
+ */
+ equalityExpression_StartIndex = INDEX();
+
+
+
+ sep::BFCode eqExpr;
+ sep::BF rhs;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(224)) )
+ {
+ {
+ }
+
+
+
+ return bf;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6057:2: (e= relationalExpression (op= equalOp e= relationalExpression (op= equalOp e= relationalExpression )* )? )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6057:4: e= relationalExpression (op= equalOp e= relationalExpression (op= equalOp e= relationalExpression )* )?
+ {
+ FOLLOWPUSH(FOLLOW_relationalExpression_in_equalityExpression21537);
+ e=relationalExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleequalityExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ e
+ ;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6058:4: (op= equalOp e= relationalExpression (op= equalOp e= relationalExpression )* )?
+ {
+ int alt503=2;
+ switch ( LA(1) )
+ {
+ case EQUAL:
+ case NEQUAL:
+ case NSEQUAL:
+ case SEQUAL:
+ {
+ {
+ int LA503_1 = LA(2);
+ if ( (synpred987_fml(ctx)))
+ {
+ alt503=1;
+ }
+ }
+ }
+ break;
+ }
+
+ switch (alt503)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6058:6: op= equalOp e= relationalExpression (op= equalOp e= relationalExpression )*
+ {
+ FOLLOWPUSH(FOLLOW_equalOp_in_equalityExpression21549);
+ op=equalOp(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleequalityExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_relationalExpression_in_equalityExpression21553);
+ e=relationalExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleequalityExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ eqExpr = NEW_CODE2(op, bf
+ , e
+ );
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6060:6: (op= equalOp e= relationalExpression )*
+
+ for (;;)
+ {
+ int alt502=2;
+ switch ( LA(1) )
+ {
+ case EQUAL:
+ case NEQUAL:
+ case NSEQUAL:
+ case SEQUAL:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA502_1 = LA(2);
+ if ( (synpred986_fml(ctx)))
+ {
+ alt502=1;
+ }
+
+ }
+ }
+ break;
+
+ }
+
+ switch (alt502)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6060:8: op= equalOp e= relationalExpression
+ {
+ FOLLOWPUSH(FOLLOW_equalOp_in_equalityExpression21569);
+ op=equalOp(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleequalityExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_relationalExpression_in_equalityExpression21573);
+ e=relationalExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleequalityExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ /*if( eqExpr.getOperator() == op )
+ {
+ eqExpr.append( e
+ );
+ }
+ else*/ if( eqExpr.getOperator() == OP(AND) )
+ {
+ eqExpr.append( NEW_CODE2(op, rhs, e
+ ) );
+ }
+ else
+ {
+ eqExpr = NEW_CODE2(OP(AND), eqExpr, NEW_CODE2(op, rhs, e
+ ));
+ }
+
+ rhs = e
+ ;
+
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop502; /* break out of the loop */
+ break;
+ }
+ }
+ loop502: ; /* Jump out to here if this rule does not match */
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= eqExpr;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleequalityExpressionEx; /* Prevent compiler warnings */
+ ruleequalityExpressionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(224, equalityExpression_StartIndex); }
+
+ return bf;
+}
+/* $ANTLR end equalityExpression */
+
+/**
+ * $ANTLR start equalOp
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6082:1: equalOp returns [ sep::Operator * op ] : ( EQUAL | NEQUAL | SEQUAL | NSEQUAL );
+ */
+static sep::Operator *
+equalOp(pfmlParser ctx)
+{
+ sep::Operator * op;
+
+ ANTLR3_UINT32 equalOp_StartIndex;
+
+ /* Initialize rule variables
+ */
+ equalOp_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(225)) )
+ {
+ {
+ }
+
+
+
+ return op;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6084:2: ( EQUAL | NEQUAL | SEQUAL | NSEQUAL )
+
+ ANTLR3_UINT32 alt504;
+
+ alt504=4;
+
+ switch ( LA(1) )
+ {
+ case EQUAL:
+ {
+ alt504=1;
+ }
+ break;
+ case NEQUAL:
+ {
+ alt504=2;
+ }
+ break;
+ case SEQUAL:
+ {
+ alt504=3;
+ }
+ break;
+ case NSEQUAL:
+ {
+ alt504=4;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return op;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 504;
+ EXCEPTION->state = 0;
+
+
+ goto ruleequalOpEx;
+
+ }
+
+ switch (alt504)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6084:4: EQUAL
+ {
+ MATCHT(EQUAL, &FOLLOW_EQUAL_in_equalOp21614);
+ if (HASEXCEPTION())
+ {
+ goto ruleequalOpEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op = OP(EQ);
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6085:4: NEQUAL
+ {
+ MATCHT(NEQUAL, &FOLLOW_NEQUAL_in_equalOp21623);
+ if (HASEXCEPTION())
+ {
+ goto ruleequalOpEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op = OP(NEQ);
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6086:4: SEQUAL
+ {
+ MATCHT(SEQUAL, &FOLLOW_SEQUAL_in_equalOp21631);
+ if (HASEXCEPTION())
+ {
+ goto ruleequalOpEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op = OP(SEQ);
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6087:4: NSEQUAL
+ {
+ MATCHT(NSEQUAL, &FOLLOW_NSEQUAL_in_equalOp21639);
+ if (HASEXCEPTION())
+ {
+ goto ruleequalOpEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op = OP(NSEQ);
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleequalOpEx; /* Prevent compiler warnings */
+ ruleequalOpEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(225, equalOp_StartIndex); }
+
+ return op;
+}
+/* $ANTLR end equalOp */
+
+/**
+ * $ANTLR start relationalExpression
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6091:1: relationalExpression returns [ sep::BF bf ] : e= shiftExpression (op= relationalOp e= shiftExpression (op= relationalOp e= shiftExpression )* )? ;
+ */
+static sep::BF
+relationalExpression(pfmlParser ctx)
+{
+ sep::BF bf;
+
+ ANTLR3_UINT32 relationalExpression_StartIndex;
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ sep::Operator * op;
+ #undef RETURN_TYPE_op
+ #define RETURN_TYPE_op sep::Operator *
+
+ /* Initialize rule variables
+ */
+ relationalExpression_StartIndex = INDEX();
+
+
+
+ sep::BFCode relExpr;
+ sep::BF rhs;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(226)) )
+ {
+ {
+ }
+
+
+
+ return bf;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6097:2: (e= shiftExpression (op= relationalOp e= shiftExpression (op= relationalOp e= shiftExpression )* )? )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6097:4: e= shiftExpression (op= relationalOp e= shiftExpression (op= relationalOp e= shiftExpression )* )?
+ {
+ FOLLOWPUSH(FOLLOW_shiftExpression_in_relationalExpression21663);
+ e=shiftExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulerelationalExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ e
+ ;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6098:4: (op= relationalOp e= shiftExpression (op= relationalOp e= shiftExpression )* )?
+ {
+ int alt506=2;
+ switch ( LA(1) )
+ {
+ case GT:
+ case GTE:
+ case LTE:
+ case LT_:
+ case 295:
+ {
+ {
+ int LA506_1 = LA(2);
+ if ( (synpred992_fml(ctx)))
+ {
+ alt506=1;
+ }
+ }
+ }
+ break;
+ }
+
+ switch (alt506)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6098:6: op= relationalOp e= shiftExpression (op= relationalOp e= shiftExpression )*
+ {
+ FOLLOWPUSH(FOLLOW_relationalOp_in_relationalExpression21675);
+ op=relationalOp(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulerelationalExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_shiftExpression_in_relationalExpression21679);
+ e=shiftExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulerelationalExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ relExpr = NEW_CODE2(op, bf
+ , rhs = e
+ );
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6100:6: (op= relationalOp e= shiftExpression )*
+
+ for (;;)
+ {
+ int alt505=2;
+ switch ( LA(1) )
+ {
+ case GT:
+ case GTE:
+ case LTE:
+ case LT_:
+ case 295:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA505_1 = LA(2);
+ if ( (synpred991_fml(ctx)))
+ {
+ alt505=1;
+ }
+
+ }
+ }
+ break;
+
+ }
+
+ switch (alt505)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6100:8: op= relationalOp e= shiftExpression
+ {
+ FOLLOWPUSH(FOLLOW_relationalOp_in_relationalExpression21695);
+ op=relationalOp(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulerelationalExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_shiftExpression_in_relationalExpression21699);
+ e=shiftExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulerelationalExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ /*if( relExpr.getOperator() == op )
+ {
+ relExpr.append( e
+ );
+ }
+ else*/ if( relExpr.getOperator() == OP(AND) )
+ {
+ relExpr.append( NEW_CODE2(op, rhs, e
+ ) );
+ }
+ else
+ {
+ relExpr = NEW_CODE2(OP(AND), relExpr, NEW_CODE2(op, rhs, e
+ ));
+ }
+
+ rhs = e
+ ;
+
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop505; /* break out of the loop */
+ break;
+ }
+ }
+ loop505: ; /* Jump out to here if this rule does not match */
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= relExpr;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulerelationalExpressionEx; /* Prevent compiler warnings */
+ rulerelationalExpressionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(226, relationalExpression_StartIndex); }
+
+ return bf;
+}
+/* $ANTLR end relationalExpression */
+
+/**
+ * $ANTLR start relationalOp
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6122:1: relationalOp returns [ sep::Operator * op ] : ( LTE | GTE | LT_ | GT | 'in' );
+ */
+static sep::Operator *
+relationalOp(pfmlParser ctx)
+{
+ sep::Operator * op;
+
+ ANTLR3_UINT32 relationalOp_StartIndex;
+
+ /* Initialize rule variables
+ */
+ relationalOp_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(227)) )
+ {
+ {
+ }
+
+
+
+ return op;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6124:2: ( LTE | GTE | LT_ | GT | 'in' )
+
+ ANTLR3_UINT32 alt507;
+
+ alt507=5;
+
+ switch ( LA(1) )
+ {
+ case LTE:
+ {
+ alt507=1;
+ }
+ break;
+ case GTE:
+ {
+ alt507=2;
+ }
+ break;
+ case LT_:
+ {
+ alt507=3;
+ }
+ break;
+ case GT:
+ {
+ alt507=4;
+ }
+ break;
+ case 295:
+ {
+ alt507=5;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return op;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 507;
+ EXCEPTION->state = 0;
+
+
+ goto rulerelationalOpEx;
+
+ }
+
+ switch (alt507)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6124:4: LTE
+ {
+ MATCHT(LTE, &FOLLOW_LTE_in_relationalOp21740);
+ if (HASEXCEPTION())
+ {
+ goto rulerelationalOpEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(LTE);
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6125:4: GTE
+ {
+ MATCHT(GTE, &FOLLOW_GTE_in_relationalOp21748);
+ if (HASEXCEPTION())
+ {
+ goto rulerelationalOpEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(GTE);
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6126:4: LT_
+ {
+ MATCHT(LT_, &FOLLOW_LT__in_relationalOp21756);
+ if (HASEXCEPTION())
+ {
+ goto rulerelationalOpEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(LT);
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6127:4: GT
+ {
+ MATCHT(GT, &FOLLOW_GT_in_relationalOp21764);
+ if (HASEXCEPTION())
+ {
+ goto rulerelationalOpEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(GT);
+
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6129:4: 'in'
+ {
+ MATCHT(295, &FOLLOW_295_in_relationalOp21774);
+ if (HASEXCEPTION())
+ {
+ goto rulerelationalOpEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(IN);
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulerelationalOpEx; /* Prevent compiler warnings */
+ rulerelationalOpEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(227, relationalOp_StartIndex); }
+
+ return op;
+}
+/* $ANTLR end relationalOp */
+
+/**
+ * $ANTLR start shiftExpression
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6139:1: shiftExpression returns [ sep::BF bf ] : e= additiveExpression (op= shiftOp e= additiveExpression )* ;
+ */
+static sep::BF
+shiftExpression(pfmlParser ctx)
+{
+ sep::BF bf;
+
+ ANTLR3_UINT32 shiftExpression_StartIndex;
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ sep::Operator * op;
+ #undef RETURN_TYPE_op
+ #define RETURN_TYPE_op sep::Operator *
+
+ /* Initialize rule variables
+ */
+ shiftExpression_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(228)) )
+ {
+ {
+ }
+
+
+
+ return bf;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6141:2: (e= additiveExpression (op= shiftOp e= additiveExpression )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6141:4: e= additiveExpression (op= shiftOp e= additiveExpression )*
+ {
+ FOLLOWPUSH(FOLLOW_additiveExpression_in_shiftExpression21806);
+ e=additiveExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleshiftExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ e
+ ;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6142:4: (op= shiftOp e= additiveExpression )*
+
+ for (;;)
+ {
+ int alt508=2;
+ switch ( LA(1) )
+ {
+ case LSHIFT:
+ case RSHIFT:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA508_1 = LA(2);
+ if ( (synpred997_fml(ctx)))
+ {
+ alt508=1;
+ }
+
+ }
+ }
+ break;
+
+ }
+
+ switch (alt508)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6142:6: op= shiftOp e= additiveExpression
+ {
+ FOLLOWPUSH(FOLLOW_shiftOp_in_shiftExpression21818);
+ op=shiftOp(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleshiftExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_additiveExpression_in_shiftExpression21822);
+ e=additiveExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleshiftExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_CODE2(op,
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop508; /* break out of the loop */
+ break;
+ }
+ }
+ loop508: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleshiftExpressionEx; /* Prevent compiler warnings */
+ ruleshiftExpressionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(228, shiftExpression_StartIndex); }
+
+ return bf;
+}
+/* $ANTLR end shiftExpression */
+
+/**
+ * $ANTLR start shiftOp
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6148:1: shiftOp returns [ sep::Operator * op ] : ( LSHIFT | RSHIFT );
+ */
+static sep::Operator *
+shiftOp(pfmlParser ctx)
+{
+ sep::Operator * op;
+
+ ANTLR3_UINT32 shiftOp_StartIndex;
+
+ /* Initialize rule variables
+ */
+ shiftOp_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(229)) )
+ {
+ {
+ }
+
+
+
+ return op;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6150:2: ( LSHIFT | RSHIFT )
+
+ ANTLR3_UINT32 alt509;
+
+ alt509=2;
+
+ switch ( LA(1) )
+ {
+ case LSHIFT:
+ {
+ alt509=1;
+ }
+ break;
+ case RSHIFT:
+ {
+ alt509=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return op;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 509;
+ EXCEPTION->state = 0;
+
+
+ goto ruleshiftOpEx;
+
+ }
+
+ switch (alt509)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6150:4: LSHIFT
+ {
+ MATCHT(LSHIFT, &FOLLOW_LSHIFT_in_shiftOp21849);
+ if (HASEXCEPTION())
+ {
+ goto ruleshiftOpEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(LSHIFT);
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6151:4: RSHIFT
+ {
+ MATCHT(RSHIFT, &FOLLOW_RSHIFT_in_shiftOp21857);
+ if (HASEXCEPTION())
+ {
+ goto ruleshiftOpEx;
+ }
+ if (HASFAILED())
+ {
+ return op;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op= OP(RSHIFT);
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleshiftOpEx; /* Prevent compiler warnings */
+ ruleshiftOpEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(229, shiftOp_StartIndex); }
+
+ return op;
+}
+/* $ANTLR end shiftOp */
+
+/**
+ * $ANTLR start additiveExpression
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6155:1: additiveExpression returns [ sep::BF bf ] : e= multiplicativeExpression ( ( PLUS | MINUS ) e= multiplicativeExpression )* ;
+ */
+static sep::BF
+additiveExpression(pfmlParser ctx)
+{
+ sep::BF bf;
+
+ ANTLR3_UINT32 additiveExpression_StartIndex;
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ additiveExpression_StartIndex = INDEX();
+
+
+
+ sep::Operator * op = NULL;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(230)) )
+ {
+ {
+ }
+
+
+
+ return bf;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6160:2: (e= multiplicativeExpression ( ( PLUS | MINUS ) e= multiplicativeExpression )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6160:4: e= multiplicativeExpression ( ( PLUS | MINUS ) e= multiplicativeExpression )*
+ {
+ FOLLOWPUSH(FOLLOW_multiplicativeExpression_in_additiveExpression21882);
+ e=multiplicativeExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleadditiveExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ e
+ ;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6161:4: ( ( PLUS | MINUS ) e= multiplicativeExpression )*
+
+ for (;;)
+ {
+ int alt511=2;
+ switch ( LA(1) )
+ {
+ case MINUS:
+ case PLUS:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA511_1 = LA(2);
+ if ( (synpred1000_fml(ctx)))
+ {
+ alt511=1;
+ }
+
+ }
+ }
+ break;
+
+ }
+
+ switch (alt511)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6161:6: ( PLUS | MINUS ) e= multiplicativeExpression
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6161:6: ( PLUS | MINUS )
+ {
+ int alt510=2;
+ switch ( LA(1) )
+ {
+ case PLUS:
+ {
+ alt510=1;
+ }
+ break;
+ case MINUS:
+ {
+ alt510=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return bf;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 510;
+ EXCEPTION->state = 0;
+
+
+ goto ruleadditiveExpressionEx;
+
+ }
+
+ switch (alt510)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6161:8: PLUS
+ {
+ MATCHT(PLUS, &FOLLOW_PLUS_in_additiveExpression21894);
+ if (HASEXCEPTION())
+ {
+ goto ruleadditiveExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op = OP(PLUS);
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6162:8: MINUS
+ {
+ MATCHT(MINUS, &FOLLOW_MINUS_in_additiveExpression21906);
+ if (HASEXCEPTION())
+ {
+ goto ruleadditiveExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op = OP(MINUS);
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_multiplicativeExpression_in_additiveExpression21924);
+ e=multiplicativeExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleadditiveExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_CODE_FLAT(op,
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop511; /* break out of the loop */
+ break;
+ }
+ }
+ loop511: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleadditiveExpressionEx; /* Prevent compiler warnings */
+ ruleadditiveExpressionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(230, additiveExpression_StartIndex); }
+
+ return bf;
+}
+/* $ANTLR end additiveExpression */
+
+/**
+ * $ANTLR start multiplicativeExpression
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6169:1: multiplicativeExpression returns [ sep::BF bf ] : e= unaryExpression ( ( STAR | DIV | MOD ) e= unaryExpression )* ;
+ */
+static sep::BF
+multiplicativeExpression(pfmlParser ctx)
+{
+ sep::BF bf;
+
+ ANTLR3_UINT32 multiplicativeExpression_StartIndex;
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ multiplicativeExpression_StartIndex = INDEX();
+
+
+
+ sep::Operator * op = NULL;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(231)) )
+ {
+ {
+ }
+
+
+
+ return bf;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6174:2: (e= unaryExpression ( ( STAR | DIV | MOD ) e= unaryExpression )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6174:4: e= unaryExpression ( ( STAR | DIV | MOD ) e= unaryExpression )*
+ {
+ FOLLOWPUSH(FOLLOW_unaryExpression_in_multiplicativeExpression21958);
+ e=unaryExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulemultiplicativeExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ e
+ ;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6175:4: ( ( STAR | DIV | MOD ) e= unaryExpression )*
+
+ for (;;)
+ {
+ int alt513=2;
+ switch ( LA(1) )
+ {
+ case DIV:
+ case MOD:
+ case STAR:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA513_1 = LA(2);
+ if ( (synpred1003_fml(ctx)))
+ {
+ alt513=1;
+ }
+
+ }
+ }
+ break;
+
+ }
+
+ switch (alt513)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6175:6: ( STAR | DIV | MOD ) e= unaryExpression
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6175:6: ( STAR | DIV | MOD )
+ {
+ int alt512=3;
+ switch ( LA(1) )
+ {
+ case STAR:
+ {
+ alt512=1;
+ }
+ break;
+ case DIV:
+ {
+ alt512=2;
+ }
+ break;
+ case MOD:
+ {
+ alt512=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return bf;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 512;
+ EXCEPTION->state = 0;
+
+
+ goto rulemultiplicativeExpressionEx;
+
+ }
+
+ switch (alt512)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6175:8: STAR
+ {
+ MATCHT(STAR, &FOLLOW_STAR_in_multiplicativeExpression21970);
+ if (HASEXCEPTION())
+ {
+ goto rulemultiplicativeExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op = OP(MULT);
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6176:8: DIV
+ {
+ MATCHT(DIV, &FOLLOW_DIV_in_multiplicativeExpression21981);
+ if (HASEXCEPTION())
+ {
+ goto rulemultiplicativeExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op = OP(DIV);
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6177:8: MOD
+ {
+ MATCHT(MOD, &FOLLOW_MOD_in_multiplicativeExpression21993);
+ if (HASEXCEPTION())
+ {
+ goto rulemultiplicativeExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ op = OP(MOD);
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_unaryExpression_in_multiplicativeExpression22012);
+ e=unaryExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulemultiplicativeExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_CODE_FLAT(op,
+ bf
+ , e
+ );
+
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop513; /* break out of the loop */
+ break;
+ }
+ }
+ loop513: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulemultiplicativeExpressionEx; /* Prevent compiler warnings */
+ rulemultiplicativeExpressionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(231, multiplicativeExpression_StartIndex); }
+
+ return bf;
+}
+/* $ANTLR end multiplicativeExpression */
+
+/**
+ * $ANTLR start unaryExpression
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6188:1: unaryExpression returns [ sep::BF bf ] : ( PLUS e= unaryExpression | MINUS e= unaryExpression | INCR e= unaryExpression | DECR e= unaryExpression | LNOT e= unaryExpression | BNOT e= unaryExpression | OP_POP e= unaryExpression | OP_TOP e= unaryExpression |c= prefix_expression |c= expression_invoke |c= expression_activity_new |c= expression_com |c= expression_guard |c= expression_ite |c= expression_lambda |e= ctorExpression |e= primary ( INCR | DECR )? |l= literal |q= quote_expression |q= meta_eval_expression | LPAREN e= expression RPAREN |e= collection_of_expression );
+ */
+static sep::BF
+unaryExpression(pfmlParser ctx)
+{
+ sep::BF bf;
+
+ ANTLR3_UINT32 unaryExpression_StartIndex;
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ sep::BFCode c;
+ #undef RETURN_TYPE_c
+ #define RETURN_TYPE_c sep::BFCode
+
+ sep::BF l;
+ #undef RETURN_TYPE_l
+ #define RETURN_TYPE_l sep::BF
+
+ sep::BFCode q;
+ #undef RETURN_TYPE_q
+ #define RETURN_TYPE_q sep::BFCode
+
+ /* Initialize rule variables
+ */
+ unaryExpression_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(232)) )
+ {
+ {
+ }
+
+
+
+ return bf;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6190:2: ( PLUS e= unaryExpression | MINUS e= unaryExpression | INCR e= unaryExpression | DECR e= unaryExpression | LNOT e= unaryExpression | BNOT e= unaryExpression | OP_POP e= unaryExpression | OP_TOP e= unaryExpression |c= prefix_expression |c= expression_invoke |c= expression_activity_new |c= expression_com |c= expression_guard |c= expression_ite |c= expression_lambda |e= ctorExpression |e= primary ( INCR | DECR )? |l= literal |q= quote_expression |q= meta_eval_expression | LPAREN e= expression RPAREN |e= collection_of_expression )
+
+ ANTLR3_UINT32 alt515;
+
+ alt515=22;
+
+ switch ( LA(1) )
+ {
+ case PLUS:
+ {
+ alt515=1;
+ }
+ break;
+ case MINUS:
+ {
+ alt515=2;
+ }
+ break;
+ case INCR:
+ {
+ alt515=3;
+ }
+ break;
+ case DECR:
+ {
+ alt515=4;
+ }
+ break;
+ case LNOT:
+ {
+ alt515=5;
+ }
+ break;
+ case BNOT:
+ {
+ alt515=6;
+ }
+ break;
+ case OP_POP:
+ {
+ alt515=7;
+ }
+ break;
+ case OP_TOP:
+ {
+ alt515=8;
+ }
+ break;
+ case DOLLAR_LCURLY:
+ {
+ alt515=9;
+ }
+ break;
+ case LPAREN_INVOKE:
+ {
+ alt515=10;
+ }
+ break;
+ case 330:
+ {
+ alt515=11;
+ }
+ break;
+ case 237:
+ case 347:
+ {
+ alt515=12;
+ }
+ break;
+ case 256:
+ {
+ alt515=13;
+ }
+ break;
+ case 294:
+ {
+ alt515=14;
+ }
+ break;
+ case 313:
+ {
+ alt515=15;
+ }
+ break;
+ case 265:
+ {
+ alt515=16;
+ }
+ break;
+ case COLONx2:
+ case ID:
+ {
+ alt515=17;
+ }
+ break;
+ case CharLiteral:
+ case FloatLiteral:
+ case IntegerLiteral:
+ case RationalLiteral:
+ case StringLiteral:
+ case 158:
+ case 159:
+ case 160:
+ case 161:
+ case 162:
+ case 277:
+ case 280:
+ case 331:
+ case 332:
+ case 343:
+ case 372:
+ case 397:
+ {
+ alt515=18;
+ }
+ break;
+ case PERCENT_LCURLY:
+ {
+ alt515=19;
+ }
+ break;
+ case LBRACKET_BAR:
+ {
+ alt515=20;
+ }
+ break;
+ case LPAREN:
+ {
+ alt515=21;
+ }
+ break;
+ case LBRACKET:
+ case LCURLY:
+ {
+ alt515=22;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return bf;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 515;
+ EXCEPTION->state = 0;
+
+
+ goto ruleunaryExpressionEx;
+
+ }
+
+ switch (alt515)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6190:4: PLUS e= unaryExpression
+ {
+ MATCHT(PLUS, &FOLLOW_PLUS_in_unaryExpression22042);
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_unaryExpression_in_unaryExpression22047);
+ e=unaryExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ e
+ ;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6193:4: MINUS e= unaryExpression
+ {
+ MATCHT(MINUS, &FOLLOW_MINUS_in_unaryExpression22056);
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_unaryExpression_in_unaryExpression22060);
+ e=unaryExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= new_uminus_expr(
+ e
+ );
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6196:4: INCR e= unaryExpression
+ {
+ MATCHT(INCR, &FOLLOW_INCR_in_unaryExpression22069);
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_unaryExpression_in_unaryExpression22074);
+ e=unaryExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP(OP(PLUS),
+
+ e
+ , sep::ExpressionConstant::INTEGER_ONE);
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6199:4: DECR e= unaryExpression
+ {
+ MATCHT(DECR, &FOLLOW_DECR_in_unaryExpression22082);
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_unaryExpression_in_unaryExpression22087);
+ e=unaryExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP(OP(PLUS),
+ e
+ ,
+ sep::ExpressionConstant::INTEGER_MINUS_ONE);
+
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6203:4: LNOT e= unaryExpression
+ {
+ MATCHT(LNOT, &FOLLOW_LNOT_in_unaryExpression22096);
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_unaryExpression_in_unaryExpression22100);
+ e=unaryExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= new_not_expr(
+ e
+ );
+
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6206:4: BNOT e= unaryExpression
+ {
+ MATCHT(BNOT, &FOLLOW_BNOT_in_unaryExpression22109);
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_unaryExpression_in_unaryExpression22113);
+ e=unaryExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_CODE1(OP(BNOT),
+ e
+ );
+
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6209:4: OP_POP e= unaryExpression
+ {
+ MATCHT(OP_POP, &FOLLOW_OP_POP_in_unaryExpression22122);
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_unaryExpression_in_unaryExpression22128);
+ e=unaryExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_CODE1(OP(POP),
+ e
+ );
+
+ }
+
+
+ }
+ break;
+ case 8:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6212:4: OP_TOP e= unaryExpression
+ {
+ MATCHT(OP_TOP, &FOLLOW_OP_TOP_in_unaryExpression22137);
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_unaryExpression_in_unaryExpression22143);
+ e=unaryExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_CODE1(OP(TOP),
+ e
+ );
+
+ }
+
+
+ }
+ break;
+ case 9:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6219:4: c= prefix_expression
+ {
+ FOLLOWPUSH(FOLLOW_prefix_expression_in_unaryExpression22158);
+ c=prefix_expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ c
+ ;
+
+ }
+
+
+ }
+ break;
+ case 10:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6221:4: c= expression_invoke
+ {
+ FOLLOWPUSH(FOLLOW_expression_invoke_in_unaryExpression22178);
+ c=expression_invoke(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ c
+ ;
+
+ }
+
+
+ }
+ break;
+ case 11:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6223:4: c= expression_activity_new
+ {
+ FOLLOWPUSH(FOLLOW_expression_activity_new_in_unaryExpression22198);
+ c=expression_activity_new(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ c
+ ;
+
+ }
+
+
+ }
+ break;
+ case 12:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6226:4: c= expression_com
+ {
+ FOLLOWPUSH(FOLLOW_expression_com_in_unaryExpression22213);
+ c=expression_com(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ c
+ ;
+
+ }
+
+
+ }
+ break;
+ case 13:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6227:4: c= expression_guard
+ {
+ FOLLOWPUSH(FOLLOW_expression_guard_in_unaryExpression22235);
+ c=expression_guard(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ c
+ ;
+
+ }
+
+
+ }
+ break;
+ case 14:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6228:4: c= expression_ite
+ {
+ FOLLOWPUSH(FOLLOW_expression_ite_in_unaryExpression22255);
+ c=expression_ite(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ c
+ ;
+
+ }
+
+
+ }
+ break;
+ case 15:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6229:4: c= expression_lambda
+ {
+ FOLLOWPUSH(FOLLOW_expression_lambda_in_unaryExpression22277);
+ c=expression_lambda(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ c
+ ;
+
+ }
+
+
+ }
+ break;
+ case 16:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6235:4: e= ctorExpression
+ {
+ FOLLOWPUSH(FOLLOW_ctorExpression_in_unaryExpression22301);
+ e=ctorExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ e
+ ;
+
+ }
+
+
+ }
+ break;
+ case 17:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6237:4: e= primary ( INCR | DECR )?
+ {
+ FOLLOWPUSH(FOLLOW_primary_in_unaryExpression22324);
+ e=primary(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ e
+ ;
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6238:4: ( INCR | DECR )?
+ {
+ int alt514=3;
+ switch ( LA(1) )
+ {
+ case INCR:
+ {
+ {
+ int LA514_1 = LA(2);
+ if ( (synpred1020_fml(ctx)))
+ {
+ alt514=1;
+ }
+ }
+ }
+ break;
+ case DECR:
+ {
+ {
+ int LA514_4 = LA(2);
+ if ( (synpred1021_fml(ctx)))
+ {
+ alt514=2;
+ }
+ }
+ }
+ break;
+ }
+
+ switch (alt514)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6238:6: INCR
+ {
+ MATCHT(INCR, &FOLLOW_INCR_in_unaryExpression22353);
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP_AFTER(OP(PLUS),
+ e
+ ,
+ sep::ExpressionConstant::INTEGER_ONE);
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6241:6: DECR
+ {
+ MATCHT(DECR, &FOLLOW_DECR_in_unaryExpression22364);
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STMT_ASSIGN_OP_AFTER(OP(PLUS),
+ e
+ ,
+ sep::ExpressionConstant::INTEGER_MINUS_ONE);
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+ case 18:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6246:4: l= literal
+ {
+ FOLLOWPUSH(FOLLOW_literal_in_unaryExpression22382);
+ l=literal(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ l
+ ;
+
+ }
+
+
+ }
+ break;
+ case 19:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6248:4: q= quote_expression
+ {
+ FOLLOWPUSH(FOLLOW_quote_expression_in_unaryExpression22412);
+ q=quote_expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ q
+ ;
+
+ }
+
+
+ }
+ break;
+ case 20:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6250:4: q= meta_eval_expression
+ {
+ FOLLOWPUSH(FOLLOW_meta_eval_expression_in_unaryExpression22433);
+ q=meta_eval_expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ q
+ ;
+
+ }
+
+
+ }
+ break;
+ case 21:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6252:4: LPAREN e= expression RPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_unaryExpression22448);
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_unaryExpression22453);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_unaryExpression22456);
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ e
+ ;
+
+ }
+
+
+ }
+ break;
+ case 22:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6254:4: e= collection_of_expression
+ {
+ FOLLOWPUSH(FOLLOW_collection_of_expression_in_unaryExpression22467);
+ e=collection_of_expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleunaryExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ e
+ ;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleunaryExpressionEx; /* Prevent compiler warnings */
+ ruleunaryExpressionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(232, unaryExpression_StartIndex); }
+
+ return bf;
+}
+/* $ANTLR end unaryExpression */
+
+/**
+ * $ANTLR start ctorExpression
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6258:1: ctorExpression returns [ sep::BFCode ctor ] : 'ctor' LT_ tv= type_var GT LPAREN e= expression RPAREN ;
+ */
+static sep::BFCode
+ctorExpression(pfmlParser ctx)
+{
+ sep::BFCode ctor;
+
+ ANTLR3_UINT32 ctorExpression_StartIndex;
+
+ sep::BF tv;
+ #undef RETURN_TYPE_tv
+ #define RETURN_TYPE_tv sep::BF
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ ctorExpression_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(233)) )
+ {
+ {
+ }
+
+
+
+ return ctor;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6260:2: ( 'ctor' LT_ tv= type_var GT LPAREN e= expression RPAREN )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6260:4: 'ctor' LT_ tv= type_var GT LPAREN e= expression RPAREN
+ {
+ MATCHT(265, &FOLLOW_265_in_ctorExpression22488);
+ if (HASEXCEPTION())
+ {
+ goto rulectorExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return ctor;
+ }
+
+
+ MATCHT(LT_, &FOLLOW_LT__in_ctorExpression22490);
+ if (HASEXCEPTION())
+ {
+ goto rulectorExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return ctor;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_type_var_in_ctorExpression22495);
+ tv=type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulectorExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return ctor;
+ }
+
+
+ MATCHT(GT, &FOLLOW_GT_in_ctorExpression22498);
+ if (HASEXCEPTION())
+ {
+ goto rulectorExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return ctor;
+ }
+
+
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_ctorExpression22501);
+ if (HASEXCEPTION())
+ {
+ goto rulectorExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return ctor;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_ctorExpression22506);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulectorExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return ctor;
+ }
+
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_ctorExpression22509);
+ if (HASEXCEPTION())
+ {
+ goto rulectorExpressionEx;
+ }
+ if (HASFAILED())
+ {
+ return ctor;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ctor= NEW_CODE2(OP(CTOR),
+ tv
+ , e
+ );
+
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulectorExpressionEx; /* Prevent compiler warnings */
+ rulectorExpressionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(233, ctorExpression_StartIndex); }
+
+ return ctor;
+}
+/* $ANTLR end ctorExpression */
+
+/**
+ * $ANTLR start quote_expression
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6280:1: quote_expression returns [ sep::BFCode ac ] : PERCENT_LCURLY e= expression RCURLY_PERCENT ;
+ */
+static sep::BFCode
+quote_expression(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 quote_expression_StartIndex;
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ quote_expression_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(234)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6282:2: ( PERCENT_LCURLY e= expression RCURLY_PERCENT )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6282:4: PERCENT_LCURLY e= expression RCURLY_PERCENT
+ {
+ MATCHT(PERCENT_LCURLY, &FOLLOW_PERCENT_LCURLY_in_quote_expression22532);
+ if (HASEXCEPTION())
+ {
+ goto rulequote_expressionEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_quote_expression22537);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulequote_expressionEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(RCURLY_PERCENT, &FOLLOW_RCURLY_PERCENT_in_quote_expression22540);
+ if (HASEXCEPTION())
+ {
+ goto rulequote_expressionEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT1(OP(QUOTE),
+ e
+ );
+
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulequote_expressionEx; /* Prevent compiler warnings */
+ rulequote_expressionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(234, quote_expression_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end quote_expression */
+
+/**
+ * $ANTLR start meta_eval_expression
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6286:1: meta_eval_expression returns [ sep::BFCode ac ] : LBRACKET_BAR e= expression BAR_RBRACKET ;
+ */
+static sep::BFCode
+meta_eval_expression(pfmlParser ctx)
+{
+ sep::BFCode ac;
+
+ ANTLR3_UINT32 meta_eval_expression_StartIndex;
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ meta_eval_expression_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(235)) )
+ {
+ {
+ }
+
+
+
+ return ac;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6288:2: ( LBRACKET_BAR e= expression BAR_RBRACKET )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6288:4: LBRACKET_BAR e= expression BAR_RBRACKET
+ {
+ MATCHT(LBRACKET_BAR, &FOLLOW_LBRACKET_BAR_in_meta_eval_expression22559);
+ if (HASEXCEPTION())
+ {
+ goto rulemeta_eval_expressionEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_meta_eval_expression22564);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulemeta_eval_expressionEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ MATCHT(BAR_RBRACKET, &FOLLOW_BAR_RBRACKET_in_meta_eval_expression22567);
+ if (HASEXCEPTION())
+ {
+ goto rulemeta_eval_expressionEx;
+ }
+ if (HASFAILED())
+ {
+ return ac;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ac= NEW_STMT1(OP(META_EVAL),
+ e
+ );
+
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulemeta_eval_expressionEx; /* Prevent compiler warnings */
+ rulemeta_eval_expressionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(235, meta_eval_expression_StartIndex); }
+
+ return ac;
+}
+/* $ANTLR end meta_eval_expression */
+
+/**
+ * $ANTLR start primary
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6366:1: primary returns [ sep::BF bf ] : (id= ID ( ( LPAREN )=>p= primary_invoke[ STR($id.text->chars) ] | ( DOT | LBRACKET )=>p= primary_ufid[ STR($id.text->chars) ] | ( COLONx2 )=>p= primary_ufi[ STR($id.text->chars) ] )? |p= primary_ufi[ \"\" ] );
+ */
+static sep::BF
+primary(pfmlParser ctx)
+{
+ sep::BF bf;
+
+ ANTLR3_UINT32 primary_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ sep::BF p;
+ #undef RETURN_TYPE_p
+ #define RETURN_TYPE_p sep::BF
+
+ /* Initialize rule variables
+ */
+ primary_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(236)) )
+ {
+ {
+ }
+
+
+
+ return bf;
+ }
+
+ id = NULL;
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6368:2: (id= ID ( ( LPAREN )=>p= primary_invoke[ STR($id.text->chars) ] | ( DOT | LBRACKET )=>p= primary_ufid[ STR($id.text->chars) ] | ( COLONx2 )=>p= primary_ufi[ STR($id.text->chars) ] )? |p= primary_ufi[ \"\" ] )
+
+ ANTLR3_UINT32 alt517;
+
+ alt517=2;
+
+ switch ( LA(1) )
+ {
+ case ID:
+ {
+ alt517=1;
+ }
+ break;
+ case COLONx2:
+ {
+ alt517=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return bf;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 517;
+ EXCEPTION->state = 0;
+
+
+ goto ruleprimaryEx;
+
+ }
+
+ switch (alt517)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6368:4: id= ID ( ( LPAREN )=>p= primary_invoke[ STR($id.text->chars) ] | ( DOT | LBRACKET )=>p= primary_ufid[ STR($id.text->chars) ] | ( COLONx2 )=>p= primary_ufi[ STR($id.text->chars) ] )?
+ {
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_primary22594);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimaryEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6369:4: ( ( LPAREN )=>p= primary_invoke[ STR($id.text->chars) ] | ( DOT | LBRACKET )=>p= primary_ufid[ STR($id.text->chars) ] | ( COLONx2 )=>p= primary_ufi[ STR($id.text->chars) ] )?
+ {
+ int alt516=4;
+ {
+ int LA516_0 = LA(1);
+ if ( (LA516_0 == LPAREN))
+ {
+ {
+ int LA516_1 = LA(2);
+ if ( (synpred1027_fml(ctx)))
+ {
+ alt516=1;
+ }
+ }
+ }
+ else if ( (synpred1029_fml(ctx)) && (LA516_0 == DOT))
+ {
+ alt516=2;
+ }
+ else if ( (LA516_0 == LBRACKET))
+ {
+ {
+ int LA516_3 = LA(2);
+ if ( (synpred1029_fml(ctx)))
+ {
+ alt516=2;
+ }
+ }
+ }
+ else if ( (LA516_0 == COLONx2))
+ {
+ {
+ int LA516_4 = LA(2);
+ if ( (synpred1030_fml(ctx)))
+ {
+ alt516=3;
+ }
+ }
+ }
+ }
+ switch (alt516)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6369:6: ( LPAREN )=>p= primary_invoke[ STR($id.text->chars) ]
+ {
+ FOLLOWPUSH(FOLLOW_primary_invoke_in_primary22619);
+ p=primary_invoke(ctx, STR((id->getText(id))->chars));
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprimaryEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ p
+ ;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6372:6: ( DOT | LBRACKET )=>p= primary_ufid[ STR($id.text->chars) ]
+ {
+ FOLLOWPUSH(FOLLOW_primary_ufid_in_primary22649);
+ p=primary_ufid(ctx, STR((id->getText(id))->chars));
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprimaryEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ p
+ ;
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6374:6: ( COLONx2 )=>p= primary_ufi[ STR($id.text->chars) ]
+ {
+ FOLLOWPUSH(FOLLOW_primary_ufi_in_primary22681);
+ p=primary_ufi(ctx, STR((id->getText(id))->chars));
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprimaryEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ p
+ ;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+
+ if( bf
+ .invalid() )
+ {
+ if( (bf= sep::ParserUtil::getObjectByNameID(
+ STR((id->getText(id))->chars))).invalid() )
+ {
+
+ bf
+ = NEW_ID( STR((id->getText(id))->chars));
+
+ }
+ }
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6388:4: p= primary_ufi[ \"\" ]
+ {
+ FOLLOWPUSH(FOLLOW_primary_ufi_in_primary22708);
+ p=primary_ufi(ctx, "");
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprimaryEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf=
+ p
+ ;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleprimaryEx; /* Prevent compiler warnings */
+ ruleprimaryEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(236, primary_StartIndex); }
+
+ return bf;
+}
+/* $ANTLR end primary */
+
+/**
+ * $ANTLR start primary_ufid
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6392:1: primary_ufid[ const std::string & mainId ] returns [ sep::BF bf ] : ( ( DOT id= ID ) | ( LBRACKET e= expression RBRACKET ) )+ ;
+ */
+static sep::BF
+primary_ufid(pfmlParser ctx, const std::string & mainId)
+{
+ sep::BF bf;
+
+ ANTLR3_UINT32 primary_ufid_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ primary_ufid_StartIndex = INDEX();
+
+
+
+ sep::UniFormIdentifier * ufi = new sep::UniFormIdentifier(false);
+ sep::BF bfUfi( ufi );// for automatic destruction of << UFI >> if need
+
+ if( (bf= sep::ParserUtil::getObjectByNameID(mainId)).valid() )
+ {
+ ufi->appendField(
+ bf
+ );
+
+ }
+ else
+ {
+ ufi->appendField( mainId );
+ }
+
+ bf= bfUfi;
+
+
+ sep::avm_size_t countID = 1;
+ bool isnotEXPR = true;
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(237)) )
+ {
+ {
+ }
+
+
+
+ return bf;
+ }
+
+ id = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6414:2: ( ( ( DOT id= ID ) | ( LBRACKET e= expression RBRACKET ) )+ )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6414:4: ( ( DOT id= ID ) | ( LBRACKET e= expression RBRACKET ) )+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6414:4: ( ( DOT id= ID ) | ( LBRACKET e= expression RBRACKET ) )+
+ {
+ int cnt518=0;
+
+ for (;;)
+ {
+ int alt518=3;
+ switch ( LA(1) )
+ {
+ case DOT:
+ {
+ alt518=1;
+ }
+ break;
+ case LBRACKET:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA518_2 = LA(2);
+ if ( (synpred1033_fml(ctx)))
+ {
+ alt518=2;
+ }
+
+ }
+ }
+ break;
+
+ }
+
+ switch (alt518)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6414:6: ( DOT id= ID )
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6414:6: ( DOT id= ID )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6414:8: DOT id= ID
+ {
+ MATCHT(DOT, &FOLLOW_DOT_in_primary_ufid22738);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimary_ufidEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_primary_ufid22742);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimary_ufidEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ufi->appendField( STR((id->getText(id))->chars) ); ++countID;
+ }
+
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6417:6: ( LBRACKET e= expression RBRACKET )
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6417:6: ( LBRACKET e= expression RBRACKET )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6417:8: LBRACKET e= expression RBRACKET
+ {
+ MATCHT(LBRACKET, &FOLLOW_LBRACKET_in_primary_ufid22761);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimary_ufidEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_primary_ufid22766);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprimary_ufidEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ MATCHT(RBRACKET, &FOLLOW_RBRACKET_in_primary_ufid22769);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimary_ufidEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ufi->appendIndex( e
+ ); isnotEXPR = false;
+ }
+
+
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt518 >= 1 )
+ {
+ goto loop518;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return bf;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruleprimary_ufidEx;
+ }
+ cnt518++;
+ }
+ loop518: ; /* Jump to here if this rule does not match */
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+
+ if( isnotEXPR )
+ {
+ if( (bf= sep::ParserUtil::getvar(ufi->str(), countID)).invalid() )
+ {
+
+ bf
+ = bfUfi;
+
+ SET_RULE_LOCATION( ufi );
+ }
+ }
+
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleprimary_ufidEx; /* Prevent compiler warnings */
+ ruleprimary_ufidEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(237, primary_ufid_StartIndex); }
+
+ return bf;
+}
+/* $ANTLR end primary_ufid */
+
+/**
+ * $ANTLR start primary_ufi
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6435:1: primary_ufi[ const std::string & locatorId ] returns [ sep::BF bf ] : COLONx2 id= ID ( ( DOT id= ID ) | ( LBRACKET e= expression RBRACKET ) )+ ;
+ */
+static sep::BF
+primary_ufi(pfmlParser ctx, const std::string & locatorId)
+{
+ sep::BF bf;
+
+ ANTLR3_UINT32 primary_ufi_StartIndex;
+
+ pANTLR3_COMMON_TOKEN id;
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ primary_ufi_StartIndex = INDEX();
+
+
+
+ sep::UniFormIdentifier * ufi =
+ new sep::UniFormIdentifier(not locatorId.empty());
+ sep::BF bfUfi( ufi );// for automatic destruction of << UFI >> if need
+
+ if( not locatorId.empty() )
+ {
+ ufi->setLocator( locatorId );
+ }
+
+ bf= bfUfi;
+
+
+ sep::avm_size_t countID = 1;
+ bool isnotEXPR = true;
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(238)) )
+ {
+ {
+ }
+
+
+
+ return bf;
+ }
+
+ id = NULL;
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6454:2: ( COLONx2 id= ID ( ( DOT id= ID ) | ( LBRACKET e= expression RBRACKET ) )+ )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6454:4: COLONx2 id= ID ( ( DOT id= ID ) | ( LBRACKET e= expression RBRACKET ) )+
+ {
+ MATCHT(COLONx2, &FOLLOW_COLONx2_in_primary_ufi22815);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimary_ufiEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_primary_ufi22819);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimary_ufiEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ if( (bf= sep::ParserUtil::getObjectByNameID(STR((id->getText(id))->chars))).valid() )
+ {
+ ufi->appendField(
+ bf
+ );
+
+ }
+ else
+ {
+ ufi->appendField( STR((id->getText(id))->chars) );
+ }
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6466:4: ( ( DOT id= ID ) | ( LBRACKET e= expression RBRACKET ) )+
+ {
+ int cnt519=0;
+
+ for (;;)
+ {
+ int alt519=3;
+ switch ( LA(1) )
+ {
+ case DOT:
+ {
+ alt519=1;
+ }
+ break;
+ case LBRACKET:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA519_2 = LA(2);
+ if ( (synpred1035_fml(ctx)))
+ {
+ alt519=2;
+ }
+
+ }
+ }
+ break;
+
+ }
+
+ switch (alt519)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6466:6: ( DOT id= ID )
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6466:6: ( DOT id= ID )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6466:8: DOT id= ID
+ {
+ MATCHT(DOT, &FOLLOW_DOT_in_primary_ufi22834);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimary_ufiEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_primary_ufi22838);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimary_ufiEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ufi->appendField( STR((id->getText(id))->chars) ); ++countID;
+ }
+
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6469:6: ( LBRACKET e= expression RBRACKET )
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6469:6: ( LBRACKET e= expression RBRACKET )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6469:8: LBRACKET e= expression RBRACKET
+ {
+ MATCHT(LBRACKET, &FOLLOW_LBRACKET_in_primary_ufi22857);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimary_ufiEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_primary_ufi22862);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprimary_ufiEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ MATCHT(RBRACKET, &FOLLOW_RBRACKET_in_primary_ufi22865);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimary_ufiEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ ufi->appendIndex( e
+ ); isnotEXPR = false;
+ }
+
+
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt519 >= 1 )
+ {
+ goto loop519;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return bf;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruleprimary_ufiEx;
+ }
+ cnt519++;
+ }
+ loop519: ; /* Jump to here if this rule does not match */
+ }
+
+ if ( BACKTRACKING==0 )
+ {
+
+ if( isnotEXPR )
+ {
+ if( (bf= sep::ParserUtil::getvar(ufi->str(), countID)).invalid() )
+ {
+
+ bf
+ = bfUfi;
+
+ SET_RULE_LOCATION( ufi );
+ }
+ }
+
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleprimary_ufiEx; /* Prevent compiler warnings */
+ ruleprimary_ufiEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(238, primary_ufi_StartIndex); }
+
+ return bf;
+}
+/* $ANTLR end primary_ufi */
+
+/**
+ * $ANTLR start primary_invoke
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6486:1: primary_invoke[ const std::string & mainId ] returns [ sep::BF bf ] : LPAREN (lp= labelled_argument ( COMMA lp= labelled_argument )* )? RPAREN ;
+ */
+static sep::BF
+primary_invoke(pfmlParser ctx, const std::string & mainId)
+{
+ sep::BF bf;
+
+ ANTLR3_UINT32 primary_invoke_StartIndex;
+
+ fmlParser_labelled_argument_return lp;
+ #undef RETURN_TYPE_lp
+ #define RETURN_TYPE_lp fmlParser_labelled_argument_return
+
+ /* Initialize rule variables
+ */
+ primary_invoke_StartIndex = INDEX();
+
+
+
+ sep::Routine * invokeRoutine = sep::Routine::newInvoke( _CPRMS_, mainId);
+
+ invokeRoutine->setModel( sep::ParserUtil::getvarRoutine(mainId) );
+
+ SAVE_RULE_BEGIN_LOCATION;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(239)) )
+ {
+ {
+
+ SET_RULE_LOCATION( invokeRoutine );
+
+ }
+ {
+ }
+
+
+
+ return bf;
+ }
+
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6499:2: ( LPAREN (lp= labelled_argument ( COMMA lp= labelled_argument )* )? RPAREN )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6499:4: LPAREN (lp= labelled_argument ( COMMA lp= labelled_argument )* )? RPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_primary_invoke22915);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimary_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6500:4: (lp= labelled_argument ( COMMA lp= labelled_argument )* )?
+ {
+ int alt521=2;
+ switch ( LA(1) )
+ {
+ case BNOT:
+ case COLONx2:
+ case CharLiteral:
+ case DECR:
+ case DOLLAR_LCURLY:
+ case FloatLiteral:
+ case ID:
+ case INCR:
+ case IntegerLiteral:
+ case LBRACKET:
+ case LBRACKET_BAR:
+ case LCURLY:
+ case LNOT:
+ case LPAREN:
+ case LPAREN_INVOKE:
+ case MINUS:
+ case OP_POP:
+ case OP_TOP:
+ case PERCENT_LCURLY:
+ case PLUS:
+ case RationalLiteral:
+ case StringLiteral:
+ case 158:
+ case 159:
+ case 160:
+ case 161:
+ case 162:
+ case 237:
+ case 256:
+ case 265:
+ case 277:
+ case 280:
+ case 294:
+ case 313:
+ case 330:
+ case 331:
+ case 332:
+ case 343:
+ case 347:
+ case 372:
+ case 397:
+ {
+ alt521=1;
+ }
+ break;
+ }
+
+ switch (alt521)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6500:6: lp= labelled_argument ( COMMA lp= labelled_argument )*
+ {
+ FOLLOWPUSH(FOLLOW_labelled_argument_in_primary_invoke22924);
+ lp=labelled_argument(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprimary_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ invokeRoutine->appendParameter(lp.label
+ , lp.arg
+ );
+
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6504:6: ( COMMA lp= labelled_argument )*
+
+ for (;;)
+ {
+ int alt520=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt520=1;
+ }
+ break;
+
+ }
+
+ switch (alt520)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6504:8: COMMA lp= labelled_argument
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_primary_invoke22940);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimary_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_labelled_argument_in_primary_invoke22949);
+ lp=labelled_argument(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleprimary_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ invokeRoutine->appendParameter(lp.label
+ , lp.arg
+ );
+
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop520; /* break out of the loop */
+ break;
+ }
+ }
+ loop520: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_primary_invoke22975);
+ if (HASEXCEPTION())
+ {
+ goto ruleprimary_invokeEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= sep::ParserUtil::invokeRoutineExpression(invokeRoutine);
+
+ }
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleprimary_invokeEx; /* Prevent compiler warnings */
+ ruleprimary_invokeEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ else
+ {
+ {
+
+ SET_RULE_LOCATION( invokeRoutine );
+
+ }
+ }
+
+
+ if ( BACKTRACKING>0 ) { MEMOIZE(239, primary_invoke_StartIndex); }
+
+ return bf;
+}
+/* $ANTLR end primary_invoke */
+
+/**
+ * $ANTLR start literal
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6517:1: literal returns [ sep::BF bf ] : ( IntegerLiteral | RationalLiteral | FloatLiteral | CharLiteral | StringLiteral | 'true' | 'false' | 'self' | 'parent' | 'env' | '$this' | '$self' | '$parent' | '$super' | '$env' | 'null<' ( 'machine' | 'channel' | 'port' | 'signal' | 'message' | 'buffer' ) GT | 'null' );
+ */
+static sep::BF
+literal(pfmlParser ctx)
+{
+ sep::BF bf;
+
+ ANTLR3_UINT32 literal_StartIndex;
+
+ pANTLR3_COMMON_TOKEN IntegerLiteral13;
+ pANTLR3_COMMON_TOKEN RationalLiteral14;
+ pANTLR3_COMMON_TOKEN FloatLiteral15;
+ pANTLR3_COMMON_TOKEN CharLiteral16;
+ pANTLR3_COMMON_TOKEN StringLiteral17;
+
+ /* Initialize rule variables
+ */
+ literal_StartIndex = INDEX();
+
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(240)) )
+ {
+ {
+ }
+
+
+
+ return bf;
+ }
+
+ IntegerLiteral13 = NULL;
+ RationalLiteral14 = NULL;
+ FloatLiteral15 = NULL;
+ CharLiteral16 = NULL;
+ StringLiteral17 = NULL;
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6519:2: ( IntegerLiteral | RationalLiteral | FloatLiteral | CharLiteral | StringLiteral | 'true' | 'false' | 'self' | 'parent' | 'env' | '$this' | '$self' | '$parent' | '$super' | '$env' | 'null<' ( 'machine' | 'channel' | 'port' | 'signal' | 'message' | 'buffer' ) GT | 'null' )
+
+ ANTLR3_UINT32 alt523;
+
+ alt523=17;
+
+ switch ( LA(1) )
+ {
+ case IntegerLiteral:
+ {
+ alt523=1;
+ }
+ break;
+ case RationalLiteral:
+ {
+ alt523=2;
+ }
+ break;
+ case FloatLiteral:
+ {
+ alt523=3;
+ }
+ break;
+ case CharLiteral:
+ {
+ alt523=4;
+ }
+ break;
+ case StringLiteral:
+ {
+ alt523=5;
+ }
+ break;
+ case 397:
+ {
+ alt523=6;
+ }
+ break;
+ case 280:
+ {
+ alt523=7;
+ }
+ break;
+ case 372:
+ {
+ alt523=8;
+ }
+ break;
+ case 343:
+ {
+ alt523=9;
+ }
+ break;
+ case 277:
+ {
+ alt523=10;
+ }
+ break;
+ case 162:
+ {
+ alt523=11;
+ }
+ break;
+ case 160:
+ {
+ alt523=12;
+ }
+ break;
+ case 159:
+ {
+ alt523=13;
+ }
+ break;
+ case 161:
+ {
+ alt523=14;
+ }
+ break;
+ case 158:
+ {
+ alt523=15;
+ }
+ break;
+ case 332:
+ {
+ alt523=16;
+ }
+ break;
+ case 331:
+ {
+ alt523=17;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return bf;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 523;
+ EXCEPTION->state = 0;
+
+
+ goto ruleliteralEx;
+
+ }
+
+ switch (alt523)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6519:4: IntegerLiteral
+ {
+ IntegerLiteral13 = (pANTLR3_COMMON_TOKEN) MATCHT(IntegerLiteral, &FOLLOW_IntegerLiteral_in_literal22997);
+ if (HASEXCEPTION())
+ {
+ goto ruleliteralEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_INTEGER(STR((IntegerLiteral13->getText(IntegerLiteral13))->chars));
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6520:4: RationalLiteral
+ {
+ RationalLiteral14 = (pANTLR3_COMMON_TOKEN) MATCHT(RationalLiteral, &FOLLOW_RationalLiteral_in_literal23005);
+ if (HASEXCEPTION())
+ {
+ goto ruleliteralEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_RATIONAL(STR((RationalLiteral14->getText(RationalLiteral14))->chars));
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6521:4: FloatLiteral
+ {
+ FloatLiteral15 = (pANTLR3_COMMON_TOKEN) MATCHT(FloatLiteral, &FOLLOW_FloatLiteral_in_literal23012);
+ if (HASEXCEPTION())
+ {
+ goto ruleliteralEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_FLOAT(STR((FloatLiteral15->getText(FloatLiteral15))->chars));
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6523:4: CharLiteral
+ {
+ CharLiteral16 = (pANTLR3_COMMON_TOKEN) MATCHT(CharLiteral, &FOLLOW_CharLiteral_in_literal23023);
+ if (HASEXCEPTION())
+ {
+ goto ruleliteralEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_CHAR(STR((CharLiteral16->getText(CharLiteral16))->chars));
+
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6524:4: StringLiteral
+ {
+ StringLiteral17 = (pANTLR3_COMMON_TOKEN) MATCHT(StringLiteral, &FOLLOW_StringLiteral_in_literal23034);
+ if (HASEXCEPTION())
+ {
+ goto ruleliteralEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_STRING(STR((StringLiteral17->getText(StringLiteral17))->chars));
+
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6526:4: 'true'
+ {
+ MATCHT(397, &FOLLOW_397_in_literal23044);
+ if (HASEXCEPTION())
+ {
+ goto ruleliteralEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_BOOL(true);
+
+ }
+
+
+ }
+ break;
+ case 7:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6527:4: 'false'
+ {
+ MATCHT(280, &FOLLOW_280_in_literal23053);
+ if (HASEXCEPTION())
+ {
+ goto ruleliteralEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= NEW_BOOL(false);
+
+ }
+
+
+ }
+ break;
+ case 8:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6529:4: 'self'
+ {
+ MATCHT(372, &FOLLOW_372_in_literal23062);
+ if (HASEXCEPTION())
+ {
+ goto ruleliteralEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= sep::ExecutableLib::MACHINE_SELF;
+
+ }
+
+
+ }
+ break;
+ case 9:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6530:4: 'parent'
+ {
+ MATCHT(343, &FOLLOW_343_in_literal23071);
+ if (HASEXCEPTION())
+ {
+ goto ruleliteralEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= sep::ExecutableLib::MACHINE_PARENT;
+
+ }
+
+
+ }
+ break;
+ case 10:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6531:4: 'env'
+ {
+ MATCHT(277, &FOLLOW_277_in_literal23078);
+ if (HASEXCEPTION())
+ {
+ goto ruleliteralEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= sep::ExecutableLib::MACHINE_ENVIRONMENT;
+
+ }
+
+
+ }
+ break;
+ case 11:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6533:4: '$this'
+ {
+ MATCHT(162, &FOLLOW_162_in_literal23089);
+ if (HASEXCEPTION())
+ {
+ goto ruleliteralEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= sep::ExecutableLib::MACHINE_SELF;
+
+ }
+
+
+ }
+ break;
+ case 12:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6534:4: '$self'
+ {
+ MATCHT(160, &FOLLOW_160_in_literal23098);
+ if (HASEXCEPTION())
+ {
+ goto ruleliteralEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= sep::ExecutableLib::MACHINE_SELF;
+
+ }
+
+
+ }
+ break;
+ case 13:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6535:4: '$parent'
+ {
+ MATCHT(159, &FOLLOW_159_in_literal23107);
+ if (HASEXCEPTION())
+ {
+ goto ruleliteralEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= sep::ExecutableLib::MACHINE_PARENT;
+
+ }
+
+
+ }
+ break;
+ case 14:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6536:4: '$super'
+ {
+ MATCHT(161, &FOLLOW_161_in_literal23114);
+ if (HASEXCEPTION())
+ {
+ goto ruleliteralEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= sep::ExecutableLib::MACHINE_PARENT;
+
+ }
+
+
+ }
+ break;
+ case 15:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6537:4: '$env'
+ {
+ MATCHT(158, &FOLLOW_158_in_literal23122);
+ if (HASEXCEPTION())
+ {
+ goto ruleliteralEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= sep::ExecutableLib::MACHINE_ENVIRONMENT;
+
+ }
+
+
+ }
+ break;
+ case 16:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6539:4: 'null<' ( 'machine' | 'channel' | 'port' | 'signal' | 'message' | 'buffer' ) GT
+ {
+ MATCHT(332, &FOLLOW_332_in_literal23133);
+ if (HASEXCEPTION())
+ {
+ goto ruleliteralEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6540:5: ( 'machine' | 'channel' | 'port' | 'signal' | 'message' | 'buffer' )
+ {
+ int alt522=6;
+ switch ( LA(1) )
+ {
+ case 317:
+ {
+ alt522=1;
+ }
+ break;
+ case 253:
+ {
+ alt522=2;
+ }
+ break;
+ case 344:
+ {
+ alt522=3;
+ }
+ break;
+ case 374:
+ {
+ alt522=4;
+ }
+ break;
+ case 320:
+ {
+ alt522=5;
+ }
+ break;
+ case 249:
+ {
+ alt522=6;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return bf;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 522;
+ EXCEPTION->state = 0;
+
+
+ goto ruleliteralEx;
+
+ }
+
+ switch (alt522)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6540:7: 'machine'
+ {
+ MATCHT(317, &FOLLOW_317_in_literal23141);
+ if (HASEXCEPTION())
+ {
+ goto ruleliteralEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= sep::ExecutableLib::MACHINE_NULL;
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6541:7: 'channel'
+ {
+ MATCHT(253, &FOLLOW_253_in_literal23152);
+ if (HASEXCEPTION())
+ {
+ goto ruleliteralEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= sep::ExecutableLib::CHANNEL_NIL;
+
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6542:7: 'port'
+ {
+ MATCHT(344, &FOLLOW_344_in_literal23163);
+ if (HASEXCEPTION())
+ {
+ goto ruleliteralEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= sep::ExecutableLib::PORT_NIL;
+
+ }
+
+
+ }
+ break;
+ case 4:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6543:7: 'signal'
+ {
+ MATCHT(374, &FOLLOW_374_in_literal23177);
+ if (HASEXCEPTION())
+ {
+ goto ruleliteralEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= sep::ExecutableLib::PORT_NIL;
+
+ }
+
+
+ }
+ break;
+ case 5:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6544:7: 'message'
+ {
+ MATCHT(320, &FOLLOW_320_in_literal23189);
+ if (HASEXCEPTION())
+ {
+ goto ruleliteralEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= sep::ExecutableLib::PORT_NIL;
+
+ }
+
+
+ }
+ break;
+ case 6:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6545:7: 'buffer'
+ {
+ MATCHT(249, &FOLLOW_249_in_literal23200);
+ if (HASEXCEPTION())
+ {
+ goto ruleliteralEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= sep::ExecutableLib::BUFFER_NIL;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ MATCHT(GT, &FOLLOW_GT_in_literal23212);
+ if (HASEXCEPTION())
+ {
+ goto ruleliteralEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ }
+ break;
+ case 17:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6547:4: 'null'
+ {
+ MATCHT(331, &FOLLOW_331_in_literal23217);
+ if (HASEXCEPTION())
+ {
+ goto ruleliteralEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= sep::BF::REF_NULL;
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleliteralEx; /* Prevent compiler warnings */
+ ruleliteralEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(240, literal_StartIndex); }
+
+ return bf;
+}
+/* $ANTLR end literal */
+
+/**
+ * $ANTLR start collection_of_expression
+ * /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6552:1: collection_of_expression returns [ sep::BF bf ] : ( LCURLY e= expression ( COMMA e= expression )* RCURLY | LBRACKET e= expression ( COMMA e= expression )* RBRACKET );
+ */
+static sep::BF
+collection_of_expression(pfmlParser ctx)
+{
+ sep::BF bf;
+
+ ANTLR3_UINT32 collection_of_expression_StartIndex;
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ /* Initialize rule variables
+ */
+ collection_of_expression_StartIndex = INDEX();
+
+
+
+ sep::BFVector values;
+
+ if ( (BACKTRACKING>0) && (HAVEPARSEDRULE(241)) )
+ {
+ {
+ }
+
+
+
+ return bf;
+ }
+
+ {
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6557:2: ( LCURLY e= expression ( COMMA e= expression )* RCURLY | LBRACKET e= expression ( COMMA e= expression )* RBRACKET )
+
+ ANTLR3_UINT32 alt526;
+
+ alt526=2;
+
+ switch ( LA(1) )
+ {
+ case LCURLY:
+ {
+ alt526=1;
+ }
+ break;
+ case LBRACKET:
+ {
+ alt526=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return bf;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 526;
+ EXCEPTION->state = 0;
+
+
+ goto rulecollection_of_expressionEx;
+
+ }
+
+ switch (alt526)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6557:4: LCURLY e= expression ( COMMA e= expression )* RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_collection_of_expression23246);
+ if (HASEXCEPTION())
+ {
+ goto rulecollection_of_expressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_collection_of_expression23255);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecollection_of_expressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ values.append(e
+ );
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6559:6: ( COMMA e= expression )*
+
+ for (;;)
+ {
+ int alt524=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt524=1;
+ }
+ break;
+
+ }
+
+ switch (alt524)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6559:8: COMMA e= expression
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_collection_of_expression23275);
+ if (HASEXCEPTION())
+ {
+ goto rulecollection_of_expressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_collection_of_expression23279);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecollection_of_expressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ values.append(e
+ );
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop524; /* break out of the loop */
+ break;
+ }
+ }
+ loop524: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_collection_of_expression23290);
+ if (HASEXCEPTION())
+ {
+ goto rulecollection_of_expressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= sep::BuiltinArray::create(values);
+
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6563:4: LBRACKET e= expression ( COMMA e= expression )* RBRACKET
+ {
+ MATCHT(LBRACKET, &FOLLOW_LBRACKET_in_collection_of_expression23301);
+ if (HASEXCEPTION())
+ {
+ goto rulecollection_of_expressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_collection_of_expression23310);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecollection_of_expressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ values.append(e
+ );
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6565:6: ( COMMA e= expression )*
+
+ for (;;)
+ {
+ int alt525=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt525=1;
+ }
+ break;
+
+ }
+
+ switch (alt525)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6565:8: COMMA e= expression
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_collection_of_expression23330);
+ if (HASEXCEPTION())
+ {
+ goto rulecollection_of_expressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_collection_of_expression23334);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulecollection_of_expressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ values.append(e
+ );
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop525; /* break out of the loop */
+ break;
+ }
+ }
+ loop525: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RBRACKET, &FOLLOW_RBRACKET_in_collection_of_expression23345);
+ if (HASEXCEPTION())
+ {
+ goto rulecollection_of_expressionEx;
+ }
+ if (HASFAILED())
+ {
+ return bf;
+ }
+
+
+ if ( BACKTRACKING==0 )
+ {
+ bf= sep::BuiltinArray::create(values);
+
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulecollection_of_expressionEx; /* Prevent compiler warnings */
+ rulecollection_of_expressionEx: ;
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ }
+ if ( BACKTRACKING>0 ) { MEMOIZE(241, collection_of_expression_StartIndex); }
+
+ return bf;
+}
+/* $ANTLR end collection_of_expression */
+
+// $ANTLR start synpred21_fml
+static void synpred21_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:720:6: ( 'unsafe' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:720:6: 'unsafe'
+ {
+ MATCHT(406, &FOLLOW_406_in_synpred21_fml531);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred21_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred21_fmlEx; /* Prevent compiler warnings */
+rulesynpred21_fmlEx: ;
+
+}
+// $ANTLR end synpred21_fml
+
+// $ANTLR start synpred56_fml
+static void synpred56_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:820:6: ( 'model' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:820:6: 'model'
+ {
+ MATCHT(322, &FOLLOW_322_in_synpred56_fml1127);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred56_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred56_fmlEx; /* Prevent compiler warnings */
+rulesynpred56_fmlEx: ;
+
+}
+// $ANTLR end synpred56_fml
+
+// $ANTLR start synpred57_fml
+static void synpred57_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:821:6: ( 'prototype' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:821:6: 'prototype'
+ {
+ MATCHT(353, &FOLLOW_353_in_synpred57_fml1144);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred57_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred57_fmlEx; /* Prevent compiler warnings */
+rulesynpred57_fmlEx: ;
+
+}
+// $ANTLR end synpred57_fml
+
+// $ANTLR start synpred58_fml
+static void synpred58_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:823:6: ( 'dynamic' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:823:6: 'dynamic'
+ {
+ MATCHT(272, &FOLLOW_272_in_synpred58_fml1158);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred58_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred58_fmlEx; /* Prevent compiler warnings */
+rulesynpred58_fmlEx: ;
+
+}
+// $ANTLR end synpred58_fml
+
+// $ANTLR start synpred59_fml
+static void synpred59_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:832:6: ( 'unsafe' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:832:6: 'unsafe'
+ {
+ MATCHT(406, &FOLLOW_406_in_synpred59_fml1181);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred59_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred59_fmlEx; /* Prevent compiler warnings */
+rulesynpred59_fmlEx: ;
+
+}
+// $ANTLR end synpred59_fml
+
+// $ANTLR start synpred60_fml
+static void synpred60_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:834:6: ( 'timed' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:834:6: 'timed'
+ {
+ MATCHT(393, &FOLLOW_393_in_synpred60_fml1198);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred60_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred60_fmlEx; /* Prevent compiler warnings */
+rulesynpred60_fmlEx: ;
+
+}
+// $ANTLR end synpred60_fml
+
+// $ANTLR start synpred61_fml
+static void synpred61_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:835:6: ( 'input_enabled' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:835:6: 'input_enabled'
+ {
+ MATCHT(306, &FOLLOW_306_in_synpred61_fml1215);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred61_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred61_fmlEx; /* Prevent compiler warnings */
+rulesynpred61_fmlEx: ;
+
+}
+// $ANTLR end synpred61_fml
+
+// $ANTLR start synpred62_fml
+static void synpred62_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:836:6: ( 'lifeline' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:836:6: 'lifeline'
+ {
+ MATCHT(314, &FOLLOW_314_in_synpred62_fml1224);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred62_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred62_fmlEx; /* Prevent compiler warnings */
+rulesynpred62_fmlEx: ;
+
+}
+// $ANTLR end synpred62_fml
+
+// $ANTLR start synpred95_fml
+static void synpred95_fml_fragment(pfmlParser ctx )
+{
+ pANTLR3_COMMON_TOKEN id;
+
+ id = NULL;
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:995:6: ( ( DOT | COLONx2 ) id= ID )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:995:6: ( DOT | COLONx2 ) id= ID
+ {
+ if ( LA(1) == COLONx2 || LA(1) == DOT )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulesynpred95_fmlEx;
+ }
+
+
+ id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_synpred95_fml1893);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred95_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred95_fmlEx; /* Prevent compiler warnings */
+rulesynpred95_fmlEx: ;
+
+}
+// $ANTLR end synpred95_fml
+
+// $ANTLR start synpred115_fml
+static void synpred115_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1205:6: ( type_var COLON )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1205:8: type_var COLON
+ {
+ FOLLOWPUSH(FOLLOW_type_var_in_synpred115_fml2387);
+ type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred115_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(COLON, &FOLLOW_COLON_in_synpred115_fml2389);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred115_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred115_fmlEx; /* Prevent compiler warnings */
+rulesynpred115_fmlEx: ;
+
+}
+// $ANTLR end synpred115_fml
+
+// $ANTLR start synpred126_fml
+static void synpred126_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1276:6: ( type_var COLON )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1276:8: type_var COLON
+ {
+ FOLLOWPUSH(FOLLOW_type_var_in_synpred126_fml2689);
+ type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred126_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(COLON, &FOLLOW_COLON_in_synpred126_fml2691);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred126_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred126_fmlEx; /* Prevent compiler warnings */
+rulesynpred126_fmlEx: ;
+
+}
+// $ANTLR end synpred126_fml
+
+// $ANTLR start synpred127_fml
+static void synpred127_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1301:6: ( def_body_machine_using_section_predicat )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1301:8: def_body_machine_using_section_predicat
+ {
+ FOLLOWPUSH(FOLLOW_def_body_machine_using_section_predicat_in_synpred127_fml2764);
+ def_body_machine_using_section_predicat(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred127_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred127_fmlEx; /* Prevent compiler warnings */
+rulesynpred127_fmlEx: ;
+
+}
+// $ANTLR end synpred127_fml
+
+// $ANTLR start synpred138_fml
+static void synpred138_fml_fragment(pfmlParser ctx )
+{
+ sep::Modifier m;
+ #undef RETURN_TYPE_m
+ #define RETURN_TYPE_m sep::Modifier
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1338:5: (m= modifier_declaration )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1338:5: m= modifier_declaration
+ {
+ FOLLOWPUSH(FOLLOW_modifier_declaration_in_synpred138_fml2939);
+ m=modifier_declaration(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred138_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred138_fmlEx; /* Prevent compiler warnings */
+rulesynpred138_fmlEx: ;
+
+}
+// $ANTLR end synpred138_fml
+
+// $ANTLR start synpred153_fml
+static void synpred153_fml_fragment(pfmlParser ctx )
+{
+ fmlParser_executable_modifier_specifier_return ms;
+ #undef RETURN_TYPE_ms
+ #define RETURN_TYPE_ms fmlParser_executable_modifier_specifier_return
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1404:6: (ms= executable_modifier_specifier )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1404:6: ms= executable_modifier_specifier
+ {
+ FOLLOWPUSH(FOLLOW_executable_modifier_specifier_in_synpred153_fml3199);
+ ms=executable_modifier_specifier(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred153_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred153_fmlEx; /* Prevent compiler warnings */
+rulesynpred153_fmlEx: ;
+
+}
+// $ANTLR end synpred153_fml
+
+// $ANTLR start synpred170_fml
+static void synpred170_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1534:4: ( lvalue op_assign_param )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:1534:6: lvalue op_assign_param
+ {
+ FOLLOWPUSH(FOLLOW_lvalue_in_synpred170_fml3645);
+ lvalue(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred170_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_op_assign_param_in_synpred170_fml3648);
+ op_assign_param(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred170_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred170_fmlEx; /* Prevent compiler warnings */
+rulesynpred170_fmlEx: ;
+
+}
+// $ANTLR end synpred170_fml
+
+// $ANTLR start synpred296_fml
+static void synpred296_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2223:6: ( def_body_machine_using_section_predicat )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2223:8: def_body_machine_using_section_predicat
+ {
+ FOLLOWPUSH(FOLLOW_def_body_machine_using_section_predicat_in_synpred296_fml5973);
+ def_body_machine_using_section_predicat(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred296_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred296_fmlEx; /* Prevent compiler warnings */
+rulesynpred296_fmlEx: ;
+
+}
+// $ANTLR end synpred296_fml
+
+// $ANTLR start synpred304_fml
+static void synpred304_fml_fragment(pfmlParser ctx )
+{
+ sep::Modifier m;
+ #undef RETURN_TYPE_m
+ #define RETURN_TYPE_m sep::Modifier
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2254:5: (m= modifier_declaration )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2254:5: m= modifier_declaration
+ {
+ FOLLOWPUSH(FOLLOW_modifier_declaration_in_synpred304_fml6112);
+ m=modifier_declaration(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred304_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred304_fmlEx; /* Prevent compiler warnings */
+rulesynpred304_fmlEx: ;
+
+}
+// $ANTLR end synpred304_fml
+
+// $ANTLR start synpred324_fml
+static void synpred324_fml_fragment(pfmlParser ctx )
+{
+ sep::Transition::moc_kind_t kt;
+ #undef RETURN_TYPE_kt
+ #define RETURN_TYPE_kt sep::Transition::moc_kind_t
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2370:4: ( ( 'moc:' )? kt= moc_transition_attribute )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2370:4: ( 'moc:' )? kt= moc_transition_attribute
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2370:4: ( 'moc:' )?
+ {
+ int alt568=2;
+ switch ( LA(1) )
+ {
+ case 321:
+ {
+ alt568=1;
+ }
+ break;
+ }
+
+ switch (alt568)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2370:6: 'moc:'
+ {
+ MATCHT(321, &FOLLOW_321_in_synpred324_fml6520);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred324_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_moc_transition_attribute_in_synpred324_fml6527);
+ kt=moc_transition_attribute(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred324_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred324_fmlEx; /* Prevent compiler warnings */
+rulesynpred324_fmlEx: ;
+
+}
+// $ANTLR end synpred324_fml
+
+// $ANTLR start synpred326_fml
+static void synpred326_fml_fragment(pfmlParser ctx )
+{
+ sep::avm_size_t n;
+ #undef RETURN_TYPE_n
+ #define RETURN_TYPE_n sep::avm_size_t
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2373:4: ( ( 'prior:' )? n= integer_constant )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2373:4: ( 'prior:' )? n= integer_constant
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2373:4: ( 'prior:' )?
+ {
+ int alt569=2;
+ switch ( LA(1) )
+ {
+ case 348:
+ {
+ alt569=1;
+ }
+ break;
+ }
+
+ switch (alt569)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2373:6: 'prior:'
+ {
+ MATCHT(348, &FOLLOW_348_in_synpred326_fml6538);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred326_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_integer_constant_in_synpred326_fml6545);
+ n=integer_constant(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred326_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred326_fmlEx; /* Prevent compiler warnings */
+rulesynpred326_fmlEx: ;
+
+}
+// $ANTLR end synpred326_fml
+
+// $ANTLR start synpred329_fml
+static void synpred329_fml_fragment(pfmlParser ctx )
+{
+ sep::BF tid;
+ #undef RETURN_TYPE_tid
+ #define RETURN_TYPE_tid sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2383:6: ( ( '-->' )? tid= target_state_id SEMI )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2383:6: ( '-->' )? tid= target_state_id SEMI
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2383:6: ( '-->' )?
+ {
+ int alt570=2;
+ switch ( LA(1) )
+ {
+ case 163:
+ {
+ alt570=1;
+ }
+ break;
+ }
+
+ switch (alt570)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2383:8: '-->'
+ {
+ MATCHT(163, &FOLLOW_163_in_synpred329_fml6600);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred329_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_target_state_id_in_synpred329_fml6612);
+ tid=target_state_id(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred329_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_synpred329_fml6629);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred329_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred329_fmlEx; /* Prevent compiler warnings */
+rulesynpred329_fmlEx: ;
+
+}
+// $ANTLR end synpred329_fml
+
+// $ANTLR start synpred340_fml
+static void synpred340_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2429:5: (e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2429:5: e= expression
+ {
+ FOLLOWPUSH(FOLLOW_expression_in_synpred340_fml6840);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred340_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred340_fmlEx; /* Prevent compiler warnings */
+rulesynpred340_fmlEx: ;
+
+}
+// $ANTLR end synpred340_fml
+
+// $ANTLR start synpred341_fml
+static void synpred341_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2432:5: ( LBRACKET e= expression RBRACKET )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2432:5: LBRACKET e= expression RBRACKET
+ {
+ MATCHT(LBRACKET, &FOLLOW_LBRACKET_in_synpred341_fml6851);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred341_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred341_fml6855);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred341_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(RBRACKET, &FOLLOW_RBRACKET_in_synpred341_fml6857);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred341_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred341_fmlEx; /* Prevent compiler warnings */
+rulesynpred341_fmlEx: ;
+
+}
+// $ANTLR end synpred341_fml
+
+// $ANTLR start synpred343_fml
+static void synpred343_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2442:5: (e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2442:5: e= expression
+ {
+ FOLLOWPUSH(FOLLOW_expression_in_synpred343_fml6900);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred343_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred343_fmlEx; /* Prevent compiler warnings */
+rulesynpred343_fmlEx: ;
+
+}
+// $ANTLR end synpred343_fml
+
+// $ANTLR start synpred344_fml
+static void synpred344_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2445:5: ( LCURLY e= expression RCURLY )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2445:5: LCURLY e= expression RCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_synpred344_fml6911);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred344_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred344_fml6915);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred344_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_synpred344_fml6917);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred344_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred344_fmlEx; /* Prevent compiler warnings */
+rulesynpred344_fmlEx: ;
+
+}
+// $ANTLR end synpred344_fml
+
+// $ANTLR start synpred366_fml
+static void synpred366_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2528:4: ( def_body_machine_using_section_header_predicat )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2528:6: def_body_machine_using_section_header_predicat
+ {
+ FOLLOWPUSH(FOLLOW_def_body_machine_using_section_header_predicat_in_synpred366_fml7316);
+ def_body_machine_using_section_header_predicat(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred366_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred366_fmlEx; /* Prevent compiler warnings */
+rulesynpred366_fmlEx: ;
+
+}
+// $ANTLR end synpred366_fml
+
+// $ANTLR start synpred370_fml
+static void synpred370_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2540:4: ( def_body_machine_using_section_import_predicat )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2540:6: def_body_machine_using_section_import_predicat
+ {
+ FOLLOWPUSH(FOLLOW_def_body_machine_using_section_import_predicat_in_synpred370_fml7380);
+ def_body_machine_using_section_import_predicat(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred370_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred370_fmlEx; /* Prevent compiler warnings */
+rulesynpred370_fmlEx: ;
+
+}
+// $ANTLR end synpred370_fml
+
+// $ANTLR start synpred373_fml
+static void synpred373_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2550:4: ( def_body_machine_using_section_parameter_predicat )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2550:6: def_body_machine_using_section_parameter_predicat
+ {
+ FOLLOWPUSH(FOLLOW_def_body_machine_using_section_parameter_predicat_in_synpred373_fml7432);
+ def_body_machine_using_section_parameter_predicat(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred373_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred373_fmlEx; /* Prevent compiler warnings */
+rulesynpred373_fmlEx: ;
+
+}
+// $ANTLR end synpred373_fml
+
+// $ANTLR start synpred375_fml
+static void synpred375_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2558:4: ( def_body_machine_using_section_property_predicat )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2558:6: def_body_machine_using_section_property_predicat
+ {
+ FOLLOWPUSH(FOLLOW_def_body_machine_using_section_property_predicat_in_synpred375_fml7472);
+ def_body_machine_using_section_property_predicat(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred375_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred375_fmlEx; /* Prevent compiler warnings */
+rulesynpred375_fmlEx: ;
+
+}
+// $ANTLR end synpred375_fml
+
+// $ANTLR start synpred407_fml
+static void synpred407_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2695:4: ( ID COLON )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2695:6: ID COLON
+ {
+ MATCHT(ID, &FOLLOW_ID_in_synpred407_fml7922);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred407_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(COLON, &FOLLOW_COLON_in_synpred407_fml7924);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred407_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred407_fmlEx; /* Prevent compiler warnings */
+rulesynpred407_fmlEx: ;
+
+}
+// $ANTLR end synpred407_fml
+
+// $ANTLR start synpred412_fml
+static void synpred412_fml_fragment(pfmlParser ctx )
+{
+ fmlParser_labelled_argument_return lp;
+ #undef RETURN_TYPE_lp
+ #define RETURN_TYPE_lp fmlParser_labelled_argument_return
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2749:6: ( LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2749:6: LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_synpred412_fml8076);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred412_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_labelled_argument_in_synpred412_fml8085);
+ lp=labelled_argument(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred412_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2755:6: ( COMMA lp= labelled_argument )*
+
+ for (;;)
+ {
+ int alt581=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt581=1;
+ }
+ break;
+
+ }
+
+ switch (alt581)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2755:8: COMMA lp= labelled_argument
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_synpred412_fml8101);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred412_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_labelled_argument_in_synpred412_fml8112);
+ lp=labelled_argument(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred412_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop581; /* break out of the loop */
+ break;
+ }
+ }
+ loop581: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_synpred412_fml8136);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred412_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred412_fmlEx; /* Prevent compiler warnings */
+rulesynpred412_fmlEx: ;
+
+}
+// $ANTLR end synpred412_fml
+
+// $ANTLR start synpred417_fml
+static void synpred417_fml_fragment(pfmlParser ctx )
+{
+ fmlParser_labelled_argument_return lp;
+ #undef RETURN_TYPE_lp
+ #define RETURN_TYPE_lp fmlParser_labelled_argument_return
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2848:6: ( LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2848:6: LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_synpred417_fml8265);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred417_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_labelled_argument_in_synpred417_fml8274);
+ lp=labelled_argument(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred417_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2854:6: ( COMMA lp= labelled_argument )*
+
+ for (;;)
+ {
+ int alt583=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt583=1;
+ }
+ break;
+
+ }
+
+ switch (alt583)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2854:8: COMMA lp= labelled_argument
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_synpred417_fml8290);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred417_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_labelled_argument_in_synpred417_fml8301);
+ lp=labelled_argument(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred417_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop583; /* break out of the loop */
+ break;
+ }
+ }
+ loop583: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_synpred417_fml8325);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred417_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred417_fmlEx; /* Prevent compiler warnings */
+rulesynpred417_fmlEx: ;
+
+}
+// $ANTLR end synpred417_fml
+
+// $ANTLR start synpred419_fml
+static void synpred419_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2897:4: ( ID )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2897:6: ID
+ {
+ MATCHT(ID, &FOLLOW_ID_in_synpred419_fml8407);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred419_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred419_fmlEx; /* Prevent compiler warnings */
+rulesynpred419_fmlEx: ;
+
+}
+// $ANTLR end synpred419_fml
+
+// $ANTLR start synpred426_fml
+static void synpred426_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2927:6: ( ID )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2927:8: ID
+ {
+ MATCHT(ID, &FOLLOW_ID_in_synpred426_fml8542);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred426_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred426_fmlEx; /* Prevent compiler warnings */
+rulesynpred426_fmlEx: ;
+
+}
+// $ANTLR end synpred426_fml
+
+// $ANTLR start synpred431_fml
+static void synpred431_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2972:4: ( ID )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:2972:6: ID
+ {
+ MATCHT(ID, &FOLLOW_ID_in_synpred431_fml8689);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred431_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred431_fmlEx; /* Prevent compiler warnings */
+rulesynpred431_fmlEx: ;
+
+}
+// $ANTLR end synpred431_fml
+
+// $ANTLR start synpred438_fml
+static void synpred438_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3002:6: ( ID )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3002:8: ID
+ {
+ MATCHT(ID, &FOLLOW_ID_in_synpred438_fml8824);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred438_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred438_fmlEx; /* Prevent compiler warnings */
+rulesynpred438_fmlEx: ;
+
+}
+// $ANTLR end synpred438_fml
+
+// $ANTLR start synpred446_fml
+static void synpred446_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3057:6: ( type_var COLON )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3057:8: type_var COLON
+ {
+ FOLLOWPUSH(FOLLOW_type_var_in_synpred446_fml9031);
+ type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred446_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(COLON, &FOLLOW_COLON_in_synpred446_fml9033);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred446_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred446_fmlEx; /* Prevent compiler warnings */
+rulesynpred446_fmlEx: ;
+
+}
+// $ANTLR end synpred446_fml
+
+// $ANTLR start synpred493_fml
+static void synpred493_fml_fragment(pfmlParser ctx )
+{
+ sep::BF btv;
+ #undef RETURN_TYPE_btv
+ #define RETURN_TYPE_btv sep::BF
+
+ sep::avm_size_t sz;
+ #undef RETURN_TYPE_sz
+ #define RETURN_TYPE_sz sep::avm_size_t
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3435:8: ( (btv= base_type_var ( COMMA ( 'size:' )? (sz= integer_constant | STAR ) )? ) )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3435:8: (btv= base_type_var ( COMMA ( 'size:' )? (sz= integer_constant | STAR ) )? )
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3435:8: (btv= base_type_var ( COMMA ( 'size:' )? (sz= integer_constant | STAR ) )? )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3435:10: btv= base_type_var ( COMMA ( 'size:' )? (sz= integer_constant | STAR ) )?
+ {
+ FOLLOWPUSH(FOLLOW_base_type_var_in_synpred493_fml10287);
+ btv=base_type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred493_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3436:10: ( COMMA ( 'size:' )? (sz= integer_constant | STAR ) )?
+ {
+ int alt620=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt620=1;
+ }
+ break;
+ }
+
+ switch (alt620)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3436:12: COMMA ( 'size:' )? (sz= integer_constant | STAR )
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_synpred493_fml10303);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred493_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3436:19: ( 'size:' )?
+ {
+ int alt618=2;
+ switch ( LA(1) )
+ {
+ case 375:
+ {
+ alt618=1;
+ }
+ break;
+ }
+
+ switch (alt618)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3436:21: 'size:'
+ {
+ MATCHT(375, &FOLLOW_375_in_synpred493_fml10308);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred493_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3437:12: (sz= integer_constant | STAR )
+ {
+ int alt619=2;
+ switch ( LA(1) )
+ {
+ case ID:
+ case IntegerLiteral:
+ {
+ alt619=1;
+ }
+ break;
+ case STAR:
+ {
+ alt619=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 619;
+ EXCEPTION->state = 0;
+
+
+ goto rulesynpred493_fmlEx;
+
+ }
+
+ switch (alt619)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3437:14: sz= integer_constant
+ {
+ FOLLOWPUSH(FOLLOW_integer_constant_in_synpred493_fml10328);
+ sz=integer_constant(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred493_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3438:14: STAR
+ {
+ MATCHT(STAR, &FOLLOW_STAR_in_synpred493_fml10345);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred493_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ }
+ break;
+
+ }
+ }
+
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred493_fmlEx; /* Prevent compiler warnings */
+rulesynpred493_fmlEx: ;
+
+}
+// $ANTLR end synpred493_fml
+
+// $ANTLR start synpred514_fml
+static void synpred514_fml_fragment(pfmlParser ctx )
+{
+ int bfs;
+ #undef RETURN_TYPE_bfs
+ #define RETURN_TYPE_bfs int
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3506:6: (bfs= bit_field_size )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3506:6: bfs= bit_field_size
+ {
+ FOLLOWPUSH(FOLLOW_bit_field_size_in_synpred514_fml10755);
+ bfs=bit_field_size(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred514_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred514_fmlEx; /* Prevent compiler warnings */
+rulesynpred514_fmlEx: ;
+
+}
+// $ANTLR end synpred514_fml
+
+// $ANTLR start synpred517_fml
+static void synpred517_fml_fragment(pfmlParser ctx )
+{
+ int bfs;
+ #undef RETURN_TYPE_bfs
+ #define RETURN_TYPE_bfs int
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3511:6: (bfs= bit_field_size )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3511:6: bfs= bit_field_size
+ {
+ FOLLOWPUSH(FOLLOW_bit_field_size_in_synpred517_fml10794);
+ bfs=bit_field_size(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred517_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred517_fmlEx; /* Prevent compiler warnings */
+rulesynpred517_fmlEx: ;
+
+}
+// $ANTLR end synpred517_fml
+
+// $ANTLR start synpred520_fml
+static void synpred520_fml_fragment(pfmlParser ctx )
+{
+ int bfs;
+ #undef RETURN_TYPE_bfs
+ #define RETURN_TYPE_bfs int
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3516:6: (bfs= bit_field_size )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3516:6: bfs= bit_field_size
+ {
+ FOLLOWPUSH(FOLLOW_bit_field_size_in_synpred520_fml10831);
+ bfs=bit_field_size(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred520_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred520_fmlEx; /* Prevent compiler warnings */
+rulesynpred520_fmlEx: ;
+
+}
+// $ANTLR end synpred520_fml
+
+// $ANTLR start synpred531_fml
+static void synpred531_fml_fragment(pfmlParser ctx )
+{
+ int bfs;
+ #undef RETURN_TYPE_bfs
+ #define RETURN_TYPE_bfs int
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3533:6: (bfs= bit_field_size )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3533:6: bfs= bit_field_size
+ {
+ FOLLOWPUSH(FOLLOW_bit_field_size_in_synpred531_fml10968);
+ bfs=bit_field_size(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred531_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred531_fmlEx; /* Prevent compiler warnings */
+rulesynpred531_fmlEx: ;
+
+}
+// $ANTLR end synpred531_fml
+
+// $ANTLR start synpred535_fml
+static void synpred535_fml_fragment(pfmlParser ctx )
+{
+ int bfs;
+ #undef RETURN_TYPE_bfs
+ #define RETURN_TYPE_bfs int
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3546:6: (bfs= bit_field_size )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3546:6: bfs= bit_field_size
+ {
+ FOLLOWPUSH(FOLLOW_bit_field_size_in_synpred535_fml11020);
+ bfs=bit_field_size(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred535_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred535_fmlEx; /* Prevent compiler warnings */
+rulesynpred535_fmlEx: ;
+
+}
+// $ANTLR end synpred535_fml
+
+// $ANTLR start synpred537_fml
+static void synpred537_fml_fragment(pfmlParser ctx )
+{
+ int bfs;
+ #undef RETURN_TYPE_bfs
+ #define RETURN_TYPE_bfs int
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3551:6: (bfs= bit_field_size )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3551:6: bfs= bit_field_size
+ {
+ FOLLOWPUSH(FOLLOW_bit_field_size_in_synpred537_fml11051);
+ bfs=bit_field_size(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred537_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred537_fmlEx; /* Prevent compiler warnings */
+rulesynpred537_fmlEx: ;
+
+}
+// $ANTLR end synpred537_fml
+
+// $ANTLR start synpred539_fml
+static void synpred539_fml_fragment(pfmlParser ctx )
+{
+ fmlParser_string_field_size_return sfs;
+ #undef RETURN_TYPE_sfs
+ #define RETURN_TYPE_sfs fmlParser_string_field_size_return
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3556:6: (sfs= string_field_size )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3556:6: sfs= string_field_size
+ {
+ FOLLOWPUSH(FOLLOW_string_field_size_in_synpred539_fml11080);
+ sfs=string_field_size(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred539_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred539_fmlEx; /* Prevent compiler warnings */
+rulesynpred539_fmlEx: ;
+
+}
+// $ANTLR end synpred539_fml
+
+// $ANTLR start synpred555_fml
+static void synpred555_fml_fragment(pfmlParser ctx )
+{
+ sep::avm_size_t n;
+ #undef RETURN_TYPE_n
+ #define RETURN_TYPE_n sep::avm_size_t
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3601:6: ( ( COMMA | DOTDOT ) n= integer_constant )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3601:6: ( COMMA | DOTDOT ) n= integer_constant
+ {
+ if ( LA(1) == COMMA || LA(1) == DOTDOT )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulesynpred555_fmlEx;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_integer_constant_in_synpred555_fml11374);
+ n=integer_constant(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred555_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred555_fmlEx; /* Prevent compiler warnings */
+rulesynpred555_fmlEx: ;
+
+}
+// $ANTLR end synpred555_fml
+
+// $ANTLR start synpred559_fml
+static void synpred559_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3645:6: ( type_var ID )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3645:8: type_var ID
+ {
+ FOLLOWPUSH(FOLLOW_type_var_in_synpred559_fml11507);
+ type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred559_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(ID, &FOLLOW_ID_in_synpred559_fml11509);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred559_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred559_fmlEx; /* Prevent compiler warnings */
+rulesynpred559_fmlEx: ;
+
+}
+// $ANTLR end synpred559_fml
+
+// $ANTLR start synpred574_fml
+static void synpred574_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3790:52: ( type_var )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3790:52: type_var
+ {
+ FOLLOWPUSH(FOLLOW_type_var_in_synpred574_fml12057);
+ type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred574_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred574_fmlEx; /* Prevent compiler warnings */
+rulesynpred574_fmlEx: ;
+
+}
+// $ANTLR end synpred574_fml
+
+// $ANTLR start synpred609_fml
+static void synpred609_fml_fragment(pfmlParser ctx )
+{
+ sep::avm_size_t sz;
+ #undef RETURN_TYPE_sz
+ #define RETURN_TYPE_sz sep::avm_size_t
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3951:5: ( COMMA sz= integer_constant )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:3951:5: COMMA sz= integer_constant
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_synpred609_fml12775);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred609_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_integer_constant_in_synpred609_fml12780);
+ sz=integer_constant(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred609_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred609_fmlEx; /* Prevent compiler warnings */
+rulesynpred609_fmlEx: ;
+
+}
+// $ANTLR end synpred609_fml
+
+// $ANTLR start synpred636_fml
+static void synpred636_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4124:6: ( ( modifier_param )? type_var ID )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4124:8: ( modifier_param )? type_var ID
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4124:8: ( modifier_param )?
+ {
+ int alt655=2;
+ switch ( LA(1) )
+ {
+ case ASSIGN_REF:
+ case BAND:
+ case LTE:
+ case 164:
+ case 166:
+ case 243:
+ case 262:
+ case 282:
+ case 295:
+ case 298:
+ case 305:
+ case 318:
+ case 335:
+ case 341:
+ case 361:
+ case 364:
+ {
+ alt655=1;
+ }
+ break;
+ }
+
+ switch (alt655)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4124:8: modifier_param
+ {
+ FOLLOWPUSH(FOLLOW_modifier_param_in_synpred636_fml13291);
+ modifier_param(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred636_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_type_var_in_synpred636_fml13295);
+ type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred636_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(ID, &FOLLOW_ID_in_synpred636_fml13297);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred636_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred636_fmlEx; /* Prevent compiler warnings */
+rulesynpred636_fmlEx: ;
+
+}
+// $ANTLR end synpred636_fml
+
+// $ANTLR start synpred643_fml
+static void synpred643_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4205:6: ( ( modifier_param )? type_var ID )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4205:8: ( modifier_param )? type_var ID
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4205:8: ( modifier_param )?
+ {
+ int alt657=2;
+ switch ( LA(1) )
+ {
+ case ASSIGN_REF:
+ case BAND:
+ case LTE:
+ case 164:
+ case 166:
+ case 243:
+ case 262:
+ case 282:
+ case 295:
+ case 298:
+ case 305:
+ case 318:
+ case 335:
+ case 341:
+ case 361:
+ case 364:
+ {
+ alt657=1;
+ }
+ break;
+ }
+
+ switch (alt657)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4205:8: modifier_param
+ {
+ FOLLOWPUSH(FOLLOW_modifier_param_in_synpred643_fml13470);
+ modifier_param(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred643_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_type_var_in_synpred643_fml13474);
+ type_var(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred643_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(ID, &FOLLOW_ID_in_synpred643_fml13476);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred643_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred643_fmlEx; /* Prevent compiler warnings */
+rulesynpred643_fmlEx: ;
+
+}
+// $ANTLR end synpred643_fml
+
+// $ANTLR start synpred705_fml
+static void synpred705_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4535:4: ( qualifiedNameID '->' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4535:6: qualifiedNameID '->'
+ {
+ FOLLOWPUSH(FOLLOW_qualifiedNameID_in_synpred705_fml14773);
+ qualifiedNameID(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred705_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(164, &FOLLOW_164_in_synpred705_fml14775);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred705_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred705_fmlEx; /* Prevent compiler warnings */
+rulesynpred705_fmlEx: ;
+
+}
+// $ANTLR end synpred705_fml
+
+// $ANTLR start synpred709_fml
+static void synpred709_fml_fragment(pfmlParser ctx )
+{
+ sep::BFCode s;
+ #undef RETURN_TYPE_s
+ #define RETURN_TYPE_s sep::BFCode
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4606:4: (s= statement_assign )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4606:4: s= statement_assign
+ {
+ FOLLOWPUSH(FOLLOW_statement_assign_in_synpred709_fml14981);
+ s=statement_assign(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred709_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred709_fmlEx; /* Prevent compiler warnings */
+rulesynpred709_fmlEx: ;
+
+}
+// $ANTLR end synpred709_fml
+
+// $ANTLR start synpred714_fml
+static void synpred714_fml_fragment(pfmlParser ctx )
+{
+ sep::BFCode s;
+ #undef RETURN_TYPE_s
+ #define RETURN_TYPE_s sep::BFCode
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4614:4: (s= statement_invoke_routine )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4614:4: s= statement_invoke_routine
+ {
+ FOLLOWPUSH(FOLLOW_statement_invoke_routine_in_synpred714_fml15083);
+ s=statement_invoke_routine(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred714_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred714_fmlEx; /* Prevent compiler warnings */
+rulesynpred714_fmlEx: ;
+
+}
+// $ANTLR end synpred714_fml
+
+// $ANTLR start synpred778_fml
+static void synpred778_fml_fragment(pfmlParser ctx )
+{
+ sep::BFCode ps;
+ #undef RETURN_TYPE_ps
+ #define RETURN_TYPE_ps sep::BFCode
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4763:8: (ps= prefix_statement )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4763:8: ps= prefix_statement
+ {
+ FOLLOWPUSH(FOLLOW_prefix_statement_in_synpred778_fml16346);
+ ps=prefix_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred778_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred778_fmlEx; /* Prevent compiler warnings */
+rulesynpred778_fmlEx: ;
+
+}
+// $ANTLR end synpred778_fml
+
+// $ANTLR start synpred779_fml
+static void synpred779_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4764:8: (e= unaryExpression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4764:8: e= unaryExpression
+ {
+ FOLLOWPUSH(FOLLOW_unaryExpression_in_synpred779_fml16367);
+ e=unaryExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred779_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred779_fmlEx; /* Prevent compiler warnings */
+rulesynpred779_fmlEx: ;
+
+}
+// $ANTLR end synpred779_fml
+
+// $ANTLR start synpred780_fml
+static void synpred780_fml_fragment(pfmlParser ctx )
+{
+ sep::BFCode ps;
+ #undef RETURN_TYPE_ps
+ #define RETURN_TYPE_ps sep::BFCode
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4772:8: (ps= prefix_expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4772:8: ps= prefix_expression
+ {
+ FOLLOWPUSH(FOLLOW_prefix_expression_in_synpred780_fml16426);
+ ps=prefix_expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred780_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred780_fmlEx; /* Prevent compiler warnings */
+rulesynpred780_fmlEx: ;
+
+}
+// $ANTLR end synpred780_fml
+
+// $ANTLR start synpred781_fml
+static void synpred781_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4773:8: (e= unaryExpression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4773:8: e= unaryExpression
+ {
+ FOLLOWPUSH(FOLLOW_unaryExpression_in_synpred781_fml16446);
+ e=unaryExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred781_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred781_fmlEx; /* Prevent compiler warnings */
+rulesynpred781_fmlEx: ;
+
+}
+// $ANTLR end synpred781_fml
+
+// $ANTLR start synpred802_fml
+static void synpred802_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4914:6: ( LPAREN )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4914:8: LPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_synpred802_fml17087);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred802_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred802_fmlEx; /* Prevent compiler warnings */
+rulesynpred802_fmlEx: ;
+
+}
+// $ANTLR end synpred802_fml
+
+// $ANTLR start synpred804_fml
+static void synpred804_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4919:6: ( LCURLY )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:4919:8: LCURLY
+ {
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_synpred804_fml17130);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred804_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred804_fmlEx; /* Prevent compiler warnings */
+rulesynpred804_fmlEx: ;
+
+}
+// $ANTLR end synpred804_fml
+
+// $ANTLR start synpred861_fml
+static void synpred861_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5320:8: ( 'env' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5320:8: 'env'
+ {
+ MATCHT(277, &FOLLOW_277_in_synpred861_fml18455);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred861_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred861_fmlEx; /* Prevent compiler warnings */
+rulesynpred861_fmlEx: ;
+
+}
+// $ANTLR end synpred861_fml
+
+// $ANTLR start synpred872_fml
+static void synpred872_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5370:8: ( 'env' )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5370:8: 'env'
+ {
+ MATCHT(277, &FOLLOW_277_in_synpred872_fml18685);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred872_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred872_fmlEx; /* Prevent compiler warnings */
+rulesynpred872_fmlEx: ;
+
+}
+// $ANTLR end synpred872_fml
+
+// $ANTLR start synpred891_fml
+static void synpred891_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ sep::BFCode bs;
+ #undef RETURN_TYPE_bs
+ #define RETURN_TYPE_bs sep::BFCode
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5515:6: ( ( 'elseif' | 'else' 'if' ) e= expression bs= block_statement )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5515:6: ( 'elseif' | 'else' 'if' ) e= expression bs= block_statement
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5515:6: ( 'elseif' | 'else' 'if' )
+ {
+ int alt693=2;
+ switch ( LA(1) )
+ {
+ case 274:
+ {
+ alt693=1;
+ }
+ break;
+ case 273:
+ {
+ alt693=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 693;
+ EXCEPTION->state = 0;
+
+
+ goto rulesynpred891_fmlEx;
+
+ }
+
+ switch (alt693)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5515:8: 'elseif'
+ {
+ MATCHT(274, &FOLLOW_274_in_synpred891_fml19245);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred891_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5515:19: 'else' 'if'
+ {
+ MATCHT(273, &FOLLOW_273_in_synpred891_fml19249);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred891_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(294, &FOLLOW_294_in_synpred891_fml19251);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred891_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred891_fml19258);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred891_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_block_statement_in_synpred891_fml19263);
+ bs=block_statement(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred891_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred891_fmlEx; /* Prevent compiler warnings */
+rulesynpred891_fmlEx: ;
+
+}
+// $ANTLR end synpred891_fml
+
+// $ANTLR start synpred894_fml
+static void synpred894_fml_fragment(pfmlParser ctx )
+{
+ sep::BF c;
+ #undef RETURN_TYPE_c
+ #define RETURN_TYPE_c sep::BF
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5540:6: ( ( 'elseif' | 'else' 'if' ) c= expression LCURLY e= expression RCURLY )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5540:6: ( 'elseif' | 'else' 'if' ) c= expression LCURLY e= expression RCURLY
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5540:6: ( 'elseif' | 'else' 'if' )
+ {
+ int alt694=2;
+ switch ( LA(1) )
+ {
+ case 274:
+ {
+ alt694=1;
+ }
+ break;
+ case 273:
+ {
+ alt694=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 694;
+ EXCEPTION->state = 0;
+
+
+ goto rulesynpred894_fmlEx;
+
+ }
+
+ switch (alt694)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5540:8: 'elseif'
+ {
+ MATCHT(274, &FOLLOW_274_in_synpred894_fml19350);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred894_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5540:19: 'else' 'if'
+ {
+ MATCHT(273, &FOLLOW_273_in_synpred894_fml19354);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred894_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(294, &FOLLOW_294_in_synpred894_fml19356);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred894_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred894_fml19362);
+ c=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred894_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(LCURLY, &FOLLOW_LCURLY_in_synpred894_fml19365);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred894_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred894_fml19370);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred894_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(RCURLY, &FOLLOW_RCURLY_in_synpred894_fml19373);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred894_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred894_fmlEx; /* Prevent compiler warnings */
+rulesynpred894_fmlEx: ;
+
+}
+// $ANTLR end synpred894_fml
+
+// $ANTLR start synpred896_fml
+static void synpred896_fml_fragment(pfmlParser ctx )
+{
+ sep::BFCode isa;
+ #undef RETURN_TYPE_isa
+ #define RETURN_TYPE_isa sep::BFCode
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ sep::BFCode sai;
+ #undef RETURN_TYPE_sai
+ #define RETURN_TYPE_sai sep::BFCode
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5574:6: (isa= for_assign_header SEMI e= expression SEMI sai= for_assign_header )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5574:6: isa= for_assign_header SEMI e= expression SEMI sai= for_assign_header
+ {
+ FOLLOWPUSH(FOLLOW_for_assign_header_in_synpred896_fml19460);
+ isa=for_assign_header(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred896_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_synpred896_fml19463);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred896_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred896_fml19468);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred896_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_synpred896_fml19471);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred896_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_for_assign_header_in_synpred896_fml19476);
+ sai=for_assign_header(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred896_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred896_fmlEx; /* Prevent compiler warnings */
+rulesynpred896_fmlEx: ;
+
+}
+// $ANTLR end synpred896_fml
+
+// $ANTLR start synpred897_fml
+static void synpred897_fml_fragment(pfmlParser ctx )
+{
+ sep::BFCode isa;
+ #undef RETURN_TYPE_isa
+ #define RETURN_TYPE_isa sep::BFCode
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ sep::BFCode sai;
+ #undef RETURN_TYPE_sai
+ #define RETURN_TYPE_sai sep::BFCode
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5577:6: ( LPAREN isa= for_assign_header SEMI e= expression SEMI sai= for_assign_header RPAREN )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5577:6: LPAREN isa= for_assign_header SEMI e= expression SEMI sai= for_assign_header RPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_synpred897_fml19495);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred897_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_for_assign_header_in_synpred897_fml19506);
+ isa=for_assign_header(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred897_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_synpred897_fml19509);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred897_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred897_fml19514);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred897_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(SEMI, &FOLLOW_SEMI_in_synpred897_fml19517);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred897_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_for_assign_header_in_synpred897_fml19522);
+ sai=for_assign_header(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred897_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_synpred897_fml19529);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred897_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred897_fmlEx; /* Prevent compiler warnings */
+rulesynpred897_fmlEx: ;
+
+}
+// $ANTLR end synpred897_fml
+
+// $ANTLR start synpred898_fml
+static void synpred898_fml_fragment(pfmlParser ctx )
+{
+ sep::BF lv;
+ #undef RETURN_TYPE_lv
+ #define RETURN_TYPE_lv sep::BF
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5582:6: (lv= lvalue COLON e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5582:6: lv= lvalue COLON e= expression
+ {
+ FOLLOWPUSH(FOLLOW_lvalue_in_synpred898_fml19550);
+ lv=lvalue(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred898_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(COLON, &FOLLOW_COLON_in_synpred898_fml19553);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred898_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred898_fml19558);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred898_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred898_fmlEx; /* Prevent compiler warnings */
+rulesynpred898_fmlEx: ;
+
+}
+// $ANTLR end synpred898_fml
+
+// $ANTLR start synpred946_fml
+static void synpred946_fml_fragment(pfmlParser ctx )
+{
+ fmlParser_labelled_argument_return lp;
+ #undef RETURN_TYPE_lp
+ #define RETURN_TYPE_lp fmlParser_labelled_argument_return
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5815:6: ( LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5815:6: LPAREN lp= labelled_argument ( COMMA lp= labelled_argument )* RPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_synpred946_fml20614);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred946_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_labelled_argument_in_synpred946_fml20623);
+ lp=labelled_argument(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred946_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5820:6: ( COMMA lp= labelled_argument )*
+
+ for (;;)
+ {
+ int alt706=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ alt706=1;
+ }
+ break;
+
+ }
+
+ switch (alt706)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5820:8: COMMA lp= labelled_argument
+ {
+ MATCHT(COMMA, &FOLLOW_COMMA_in_synpred946_fml20639);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred946_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_labelled_argument_in_synpred946_fml20650);
+ lp=labelled_argument(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred946_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop706; /* break out of the loop */
+ break;
+ }
+ }
+ loop706: ; /* Jump out to here if this rule does not match */
+
+
+ MATCHT(RPAREN, &FOLLOW_RPAREN_in_synpred946_fml20674);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred946_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred946_fmlEx; /* Prevent compiler warnings */
+rulesynpred946_fmlEx: ;
+
+}
+// $ANTLR end synpred946_fml
+
+// $ANTLR start synpred947_fml
+static void synpred947_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5899:4: ( ASSIGN e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5899:4: ASSIGN e= expression
+ {
+ MATCHT(ASSIGN, &FOLLOW_ASSIGN_in_synpred947_fml20766);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred947_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred947_fml20771);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred947_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred947_fmlEx; /* Prevent compiler warnings */
+rulesynpred947_fmlEx: ;
+
+}
+// $ANTLR end synpred947_fml
+
+// $ANTLR start synpred948_fml
+static void synpred948_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5902:4: ( ASSIGN_MACRO e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5902:4: ASSIGN_MACRO e= expression
+ {
+ MATCHT(ASSIGN_MACRO, &FOLLOW_ASSIGN_MACRO_in_synpred948_fml20780);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred948_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred948_fml20785);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred948_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred948_fmlEx; /* Prevent compiler warnings */
+rulesynpred948_fmlEx: ;
+
+}
+// $ANTLR end synpred948_fml
+
+// $ANTLR start synpred949_fml
+static void synpred949_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5905:4: ( ASSIGN_AFTER e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5905:4: ASSIGN_AFTER e= expression
+ {
+ MATCHT(ASSIGN_AFTER, &FOLLOW_ASSIGN_AFTER_in_synpred949_fml20794);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred949_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred949_fml20799);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred949_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred949_fmlEx; /* Prevent compiler warnings */
+rulesynpred949_fmlEx: ;
+
+}
+// $ANTLR end synpred949_fml
+
+// $ANTLR start synpred950_fml
+static void synpred950_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5908:4: ( PLUS_ASSIGN e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5908:4: PLUS_ASSIGN e= expression
+ {
+ MATCHT(PLUS_ASSIGN, &FOLLOW_PLUS_ASSIGN_in_synpred950_fml20808);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred950_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred950_fml20813);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred950_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred950_fmlEx; /* Prevent compiler warnings */
+rulesynpred950_fmlEx: ;
+
+}
+// $ANTLR end synpred950_fml
+
+// $ANTLR start synpred951_fml
+static void synpred951_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5911:4: ( PLUS_ASSIGN_AFTER e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5911:4: PLUS_ASSIGN_AFTER e= expression
+ {
+ MATCHT(PLUS_ASSIGN_AFTER, &FOLLOW_PLUS_ASSIGN_AFTER_in_synpred951_fml20822);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred951_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred951_fml20827);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred951_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred951_fmlEx; /* Prevent compiler warnings */
+rulesynpred951_fmlEx: ;
+
+}
+// $ANTLR end synpred951_fml
+
+// $ANTLR start synpred952_fml
+static void synpred952_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5914:4: ( MINUS_ASSIGN e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5914:4: MINUS_ASSIGN e= expression
+ {
+ MATCHT(MINUS_ASSIGN, &FOLLOW_MINUS_ASSIGN_in_synpred952_fml20836);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred952_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred952_fml20841);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred952_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred952_fmlEx; /* Prevent compiler warnings */
+rulesynpred952_fmlEx: ;
+
+}
+// $ANTLR end synpred952_fml
+
+// $ANTLR start synpred953_fml
+static void synpred953_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5917:4: ( MINUS_ASSIGN_AFTER e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5917:4: MINUS_ASSIGN_AFTER e= expression
+ {
+ MATCHT(MINUS_ASSIGN_AFTER, &FOLLOW_MINUS_ASSIGN_AFTER_in_synpred953_fml20850);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred953_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred953_fml20855);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred953_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred953_fmlEx; /* Prevent compiler warnings */
+rulesynpred953_fmlEx: ;
+
+}
+// $ANTLR end synpred953_fml
+
+// $ANTLR start synpred954_fml
+static void synpred954_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5920:4: ( STAR_ASSIGN e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5920:4: STAR_ASSIGN e= expression
+ {
+ MATCHT(STAR_ASSIGN, &FOLLOW_STAR_ASSIGN_in_synpred954_fml20864);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred954_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred954_fml20869);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred954_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred954_fmlEx; /* Prevent compiler warnings */
+rulesynpred954_fmlEx: ;
+
+}
+// $ANTLR end synpred954_fml
+
+// $ANTLR start synpred955_fml
+static void synpred955_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5923:4: ( STAR_ASSIGN_AFTER e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5923:4: STAR_ASSIGN_AFTER e= expression
+ {
+ MATCHT(STAR_ASSIGN_AFTER, &FOLLOW_STAR_ASSIGN_AFTER_in_synpred955_fml20878);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred955_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred955_fml20883);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred955_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred955_fmlEx; /* Prevent compiler warnings */
+rulesynpred955_fmlEx: ;
+
+}
+// $ANTLR end synpred955_fml
+
+// $ANTLR start synpred956_fml
+static void synpred956_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5926:4: ( DIV_ASSIGN e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5926:4: DIV_ASSIGN e= expression
+ {
+ MATCHT(DIV_ASSIGN, &FOLLOW_DIV_ASSIGN_in_synpred956_fml20892);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred956_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred956_fml20897);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred956_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred956_fmlEx; /* Prevent compiler warnings */
+rulesynpred956_fmlEx: ;
+
+}
+// $ANTLR end synpred956_fml
+
+// $ANTLR start synpred957_fml
+static void synpred957_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5929:4: ( DIV_ASSIGN_AFTER e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5929:4: DIV_ASSIGN_AFTER e= expression
+ {
+ MATCHT(DIV_ASSIGN_AFTER, &FOLLOW_DIV_ASSIGN_AFTER_in_synpred957_fml20906);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred957_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred957_fml20911);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred957_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred957_fmlEx; /* Prevent compiler warnings */
+rulesynpred957_fmlEx: ;
+
+}
+// $ANTLR end synpred957_fml
+
+// $ANTLR start synpred958_fml
+static void synpred958_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5932:4: ( MOD_ASSIGN e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5932:4: MOD_ASSIGN e= expression
+ {
+ MATCHT(MOD_ASSIGN, &FOLLOW_MOD_ASSIGN_in_synpred958_fml20920);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred958_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred958_fml20925);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred958_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred958_fmlEx; /* Prevent compiler warnings */
+rulesynpred958_fmlEx: ;
+
+}
+// $ANTLR end synpred958_fml
+
+// $ANTLR start synpred959_fml
+static void synpred959_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5935:4: ( MOD_ASSIGN_AFTER e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5935:4: MOD_ASSIGN_AFTER e= expression
+ {
+ MATCHT(MOD_ASSIGN_AFTER, &FOLLOW_MOD_ASSIGN_AFTER_in_synpred959_fml20934);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred959_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred959_fml20939);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred959_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred959_fmlEx; /* Prevent compiler warnings */
+rulesynpred959_fmlEx: ;
+
+}
+// $ANTLR end synpred959_fml
+
+// $ANTLR start synpred960_fml
+static void synpred960_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5938:4: ( LAND_ASSIGN e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5938:4: LAND_ASSIGN e= expression
+ {
+ MATCHT(LAND_ASSIGN, &FOLLOW_LAND_ASSIGN_in_synpred960_fml20948);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred960_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred960_fml20953);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred960_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred960_fmlEx; /* Prevent compiler warnings */
+rulesynpred960_fmlEx: ;
+
+}
+// $ANTLR end synpred960_fml
+
+// $ANTLR start synpred961_fml
+static void synpred961_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5941:4: ( LAND_ASSIGN_AFTER e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5941:4: LAND_ASSIGN_AFTER e= expression
+ {
+ MATCHT(LAND_ASSIGN_AFTER, &FOLLOW_LAND_ASSIGN_AFTER_in_synpred961_fml20962);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred961_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred961_fml20967);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred961_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred961_fmlEx; /* Prevent compiler warnings */
+rulesynpred961_fmlEx: ;
+
+}
+// $ANTLR end synpred961_fml
+
+// $ANTLR start synpred962_fml
+static void synpred962_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5944:4: ( LOR_ASSIGN e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5944:4: LOR_ASSIGN e= expression
+ {
+ MATCHT(LOR_ASSIGN, &FOLLOW_LOR_ASSIGN_in_synpred962_fml20976);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred962_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred962_fml20981);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred962_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred962_fmlEx; /* Prevent compiler warnings */
+rulesynpred962_fmlEx: ;
+
+}
+// $ANTLR end synpred962_fml
+
+// $ANTLR start synpred963_fml
+static void synpred963_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5947:4: ( LOR_ASSIGN_AFTER e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5947:4: LOR_ASSIGN_AFTER e= expression
+ {
+ MATCHT(LOR_ASSIGN_AFTER, &FOLLOW_LOR_ASSIGN_AFTER_in_synpred963_fml20990);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred963_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred963_fml20995);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred963_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred963_fmlEx; /* Prevent compiler warnings */
+rulesynpred963_fmlEx: ;
+
+}
+// $ANTLR end synpred963_fml
+
+// $ANTLR start synpred964_fml
+static void synpred964_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5950:4: ( BAND_ASSIGN e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5950:4: BAND_ASSIGN e= expression
+ {
+ MATCHT(BAND_ASSIGN, &FOLLOW_BAND_ASSIGN_in_synpred964_fml21004);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred964_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred964_fml21009);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred964_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred964_fmlEx; /* Prevent compiler warnings */
+rulesynpred964_fmlEx: ;
+
+}
+// $ANTLR end synpred964_fml
+
+// $ANTLR start synpred965_fml
+static void synpred965_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5953:4: ( BAND_ASSIGN_AFTER e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5953:4: BAND_ASSIGN_AFTER e= expression
+ {
+ MATCHT(BAND_ASSIGN_AFTER, &FOLLOW_BAND_ASSIGN_AFTER_in_synpred965_fml21018);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred965_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred965_fml21023);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred965_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred965_fmlEx; /* Prevent compiler warnings */
+rulesynpred965_fmlEx: ;
+
+}
+// $ANTLR end synpred965_fml
+
+// $ANTLR start synpred966_fml
+static void synpred966_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5956:4: ( BOR_ASSIGN e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5956:4: BOR_ASSIGN e= expression
+ {
+ MATCHT(BOR_ASSIGN, &FOLLOW_BOR_ASSIGN_in_synpred966_fml21032);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred966_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred966_fml21037);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred966_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred966_fmlEx; /* Prevent compiler warnings */
+rulesynpred966_fmlEx: ;
+
+}
+// $ANTLR end synpred966_fml
+
+// $ANTLR start synpred967_fml
+static void synpred967_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5959:4: ( BOR_ASSIGN_AFTER e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5959:4: BOR_ASSIGN_AFTER e= expression
+ {
+ MATCHT(BOR_ASSIGN_AFTER, &FOLLOW_BOR_ASSIGN_AFTER_in_synpred967_fml21046);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred967_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred967_fml21051);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred967_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred967_fmlEx; /* Prevent compiler warnings */
+rulesynpred967_fmlEx: ;
+
+}
+// $ANTLR end synpred967_fml
+
+// $ANTLR start synpred968_fml
+static void synpred968_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5962:4: ( BXOR_ASSIGN e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5962:4: BXOR_ASSIGN e= expression
+ {
+ MATCHT(BXOR_ASSIGN, &FOLLOW_BXOR_ASSIGN_in_synpred968_fml21060);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred968_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred968_fml21065);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred968_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred968_fmlEx; /* Prevent compiler warnings */
+rulesynpred968_fmlEx: ;
+
+}
+// $ANTLR end synpred968_fml
+
+// $ANTLR start synpred969_fml
+static void synpred969_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5965:4: ( BXOR_ASSIGN_AFTER e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5965:4: BXOR_ASSIGN_AFTER e= expression
+ {
+ MATCHT(BXOR_ASSIGN_AFTER, &FOLLOW_BXOR_ASSIGN_AFTER_in_synpred969_fml21074);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred969_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred969_fml21079);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred969_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred969_fmlEx; /* Prevent compiler warnings */
+rulesynpred969_fmlEx: ;
+
+}
+// $ANTLR end synpred969_fml
+
+// $ANTLR start synpred970_fml
+static void synpred970_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5968:4: ( LSHIFT_ASSIGN e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5968:4: LSHIFT_ASSIGN e= expression
+ {
+ MATCHT(LSHIFT_ASSIGN, &FOLLOW_LSHIFT_ASSIGN_in_synpred970_fml21088);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred970_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred970_fml21093);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred970_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred970_fmlEx; /* Prevent compiler warnings */
+rulesynpred970_fmlEx: ;
+
+}
+// $ANTLR end synpred970_fml
+
+// $ANTLR start synpred971_fml
+static void synpred971_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5971:4: ( LSHIFT_ASSIGN_AFTER e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5971:4: LSHIFT_ASSIGN_AFTER e= expression
+ {
+ MATCHT(LSHIFT_ASSIGN_AFTER, &FOLLOW_LSHIFT_ASSIGN_AFTER_in_synpred971_fml21102);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred971_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred971_fml21107);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred971_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred971_fmlEx; /* Prevent compiler warnings */
+rulesynpred971_fmlEx: ;
+
+}
+// $ANTLR end synpred971_fml
+
+// $ANTLR start synpred972_fml
+static void synpred972_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5974:4: ( RSHIFT_ASSIGN e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5974:4: RSHIFT_ASSIGN e= expression
+ {
+ MATCHT(RSHIFT_ASSIGN, &FOLLOW_RSHIFT_ASSIGN_in_synpred972_fml21116);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred972_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred972_fml21121);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred972_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred972_fmlEx; /* Prevent compiler warnings */
+rulesynpred972_fmlEx: ;
+
+}
+// $ANTLR end synpred972_fml
+
+// $ANTLR start synpred973_fml
+static void synpred973_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5977:4: ( RSHIFT_ASSIGN_AFTER e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5977:4: RSHIFT_ASSIGN_AFTER e= expression
+ {
+ MATCHT(RSHIFT_ASSIGN_AFTER, &FOLLOW_RSHIFT_ASSIGN_AFTER_in_synpred973_fml21130);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred973_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred973_fml21135);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred973_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred973_fmlEx; /* Prevent compiler warnings */
+rulesynpred973_fmlEx: ;
+
+}
+// $ANTLR end synpred973_fml
+
+// $ANTLR start synpred974_fml
+static void synpred974_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5980:4: ( OP_PUSH e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5980:4: OP_PUSH e= expression
+ {
+ MATCHT(OP_PUSH, &FOLLOW_OP_PUSH_in_synpred974_fml21144);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred974_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred974_fml21149);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred974_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred974_fmlEx; /* Prevent compiler warnings */
+rulesynpred974_fmlEx: ;
+
+}
+// $ANTLR end synpred974_fml
+
+// $ANTLR start synpred975_fml
+static void synpred975_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5983:4: ( OP_ASSIGN_TOP e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5983:4: OP_ASSIGN_TOP e= expression
+ {
+ MATCHT(OP_ASSIGN_TOP, &FOLLOW_OP_ASSIGN_TOP_in_synpred975_fml21158);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred975_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred975_fml21163);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred975_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred975_fmlEx; /* Prevent compiler warnings */
+rulesynpred975_fmlEx: ;
+
+}
+// $ANTLR end synpred975_fml
+
+// $ANTLR start synpred976_fml
+static void synpred976_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5986:4: ( OP_POP e= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5986:4: OP_POP e= expression
+ {
+ MATCHT(OP_POP, &FOLLOW_OP_POP_in_synpred976_fml21172);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred976_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred976_fml21177);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred976_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred976_fmlEx; /* Prevent compiler warnings */
+rulesynpred976_fmlEx: ;
+
+}
+// $ANTLR end synpred976_fml
+
+// $ANTLR start synpred977_fml
+static void synpred977_fml_fragment(pfmlParser ctx )
+{
+ sep::BF th;
+ #undef RETURN_TYPE_th
+ #define RETURN_TYPE_th sep::BF
+
+ sep::BF el;
+ #undef RETURN_TYPE_el
+ #define RETURN_TYPE_el sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5998:6: ( QUESTION th= expression COLON el= expression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:5998:6: QUESTION th= expression COLON el= expression
+ {
+ MATCHT(QUESTION, &FOLLOW_QUESTION_in_synpred977_fml21215);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred977_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred977_fml21220);
+ th=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred977_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(COLON, &FOLLOW_COLON_in_synpred977_fml21223);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred977_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred977_fml21228);
+ el=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred977_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred977_fmlEx; /* Prevent compiler warnings */
+rulesynpred977_fmlEx: ;
+
+}
+// $ANTLR end synpred977_fml
+
+// $ANTLR start synpred980_fml
+static void synpred980_fml_fragment(pfmlParser ctx )
+{
+ sep::Operator * op;
+ #undef RETURN_TYPE_op
+ #define RETURN_TYPE_op sep::Operator *
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6006:6: ( (op= op_sequence |op= op_scheduling |op= op_concurrency ) e= conditionalOrExpression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6006:6: (op= op_sequence |op= op_scheduling |op= op_concurrency ) e= conditionalOrExpression
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6006:6: (op= op_sequence |op= op_scheduling |op= op_concurrency )
+ {
+ int alt707=3;
+ switch ( LA(1) )
+ {
+ case OP_ATOMIC_SEQUENCE:
+ case OP_SEQUENCE:
+ case OP_SEQUENCE_SIDE:
+ case OP_SEQUENCE_WEAK:
+ {
+ alt707=1;
+ }
+ break;
+ case OP_NON_DETERMINISM:
+ case OP_SCHEDULE_AND_THEN:
+ case OP_SCHEDULE_GT:
+ case OP_SCHEDULE_LT:
+ case OP_SCHEDULE_OR_ELSE:
+ case OP_SCHEDULE_XOR:
+ {
+ alt707=2;
+ }
+ break;
+ case OP_CONCURRENCY_AND:
+ case OP_CONCURRENCY_ASYNC:
+ case OP_CONCURRENCY_INTERLEAVING:
+ case OP_CONCURRENCY_OR:
+ case OP_CONCURRENCY_PARALLEL:
+ case OP_CONCURRENCY_RDV_AND:
+ case OP_CONCURRENCY_RDV_ASYNC:
+ case OP_CONCURRENCY_RDV_INTERLEAVING:
+ case OP_CONCURRENCY_RDV_OR:
+ case OP_CONCURRENCY_RDV_PARALLEL:
+ {
+ alt707=3;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 707;
+ EXCEPTION->state = 0;
+
+
+ goto rulesynpred980_fmlEx;
+
+ }
+
+ switch (alt707)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6006:8: op= op_sequence
+ {
+ FOLLOWPUSH(FOLLOW_op_sequence_in_synpred980_fml21270);
+ op=op_sequence(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred980_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 2:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6006:27: op= op_scheduling
+ {
+ FOLLOWPUSH(FOLLOW_op_scheduling_in_synpred980_fml21278);
+ op=op_scheduling(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred980_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+ case 3:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6006:48: op= op_concurrency
+ {
+ FOLLOWPUSH(FOLLOW_op_concurrency_in_synpred980_fml21286);
+ op=op_concurrency(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred980_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+
+ FOLLOWPUSH(FOLLOW_conditionalOrExpression_in_synpred980_fml21297);
+ e=conditionalOrExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred980_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred980_fmlEx; /* Prevent compiler warnings */
+rulesynpred980_fmlEx: ;
+
+}
+// $ANTLR end synpred980_fml
+
+// $ANTLR start synpred981_fml
+static void synpred981_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6014:6: ( LOR e= conditionalAndExpression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6014:6: LOR e= conditionalAndExpression
+ {
+ MATCHT(LOR, &FOLLOW_LOR_in_synpred981_fml21333);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred981_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_conditionalAndExpression_in_synpred981_fml21337);
+ e=conditionalAndExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred981_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred981_fmlEx; /* Prevent compiler warnings */
+rulesynpred981_fmlEx: ;
+
+}
+// $ANTLR end synpred981_fml
+
+// $ANTLR start synpred982_fml
+static void synpred982_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6022:6: ( LAND e= bitwiseOrExpression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6022:6: LAND e= bitwiseOrExpression
+ {
+ MATCHT(LAND, &FOLLOW_LAND_in_synpred982_fml21375);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred982_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_bitwiseOrExpression_in_synpred982_fml21379);
+ e=bitwiseOrExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred982_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred982_fmlEx; /* Prevent compiler warnings */
+rulesynpred982_fmlEx: ;
+
+}
+// $ANTLR end synpred982_fml
+
+// $ANTLR start synpred983_fml
+static void synpred983_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6030:6: ( BOR e= bitwiseXorExpression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6030:6: BOR e= bitwiseXorExpression
+ {
+ MATCHT(BOR, &FOLLOW_BOR_in_synpred983_fml21417);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred983_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_bitwiseXorExpression_in_synpred983_fml21421);
+ e=bitwiseXorExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred983_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred983_fmlEx; /* Prevent compiler warnings */
+rulesynpred983_fmlEx: ;
+
+}
+// $ANTLR end synpred983_fml
+
+// $ANTLR start synpred984_fml
+static void synpred984_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6038:6: ( BXOR e= bitwiseAndExpression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6038:6: BXOR e= bitwiseAndExpression
+ {
+ MATCHT(BXOR, &FOLLOW_BXOR_in_synpred984_fml21459);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred984_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_bitwiseAndExpression_in_synpred984_fml21463);
+ e=bitwiseAndExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred984_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred984_fmlEx; /* Prevent compiler warnings */
+rulesynpred984_fmlEx: ;
+
+}
+// $ANTLR end synpred984_fml
+
+// $ANTLR start synpred985_fml
+static void synpred985_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6046:6: ( BAND e= equalityExpression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6046:6: BAND e= equalityExpression
+ {
+ MATCHT(BAND, &FOLLOW_BAND_in_synpred985_fml21501);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred985_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_equalityExpression_in_synpred985_fml21505);
+ e=equalityExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred985_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred985_fmlEx; /* Prevent compiler warnings */
+rulesynpred985_fmlEx: ;
+
+}
+// $ANTLR end synpred985_fml
+
+// $ANTLR start synpred986_fml
+static void synpred986_fml_fragment(pfmlParser ctx )
+{
+ sep::Operator * op;
+ #undef RETURN_TYPE_op
+ #define RETURN_TYPE_op sep::Operator *
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6060:8: (op= equalOp e= relationalExpression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6060:8: op= equalOp e= relationalExpression
+ {
+ FOLLOWPUSH(FOLLOW_equalOp_in_synpred986_fml21569);
+ op=equalOp(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred986_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_relationalExpression_in_synpred986_fml21573);
+ e=relationalExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred986_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred986_fmlEx; /* Prevent compiler warnings */
+rulesynpred986_fmlEx: ;
+
+}
+// $ANTLR end synpred986_fml
+
+// $ANTLR start synpred987_fml
+static void synpred987_fml_fragment(pfmlParser ctx )
+{
+ sep::Operator * op;
+ #undef RETURN_TYPE_op
+ #define RETURN_TYPE_op sep::Operator *
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6058:6: (op= equalOp e= relationalExpression (op= equalOp e= relationalExpression )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6058:6: op= equalOp e= relationalExpression (op= equalOp e= relationalExpression )*
+ {
+ FOLLOWPUSH(FOLLOW_equalOp_in_synpred987_fml21549);
+ op=equalOp(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred987_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_relationalExpression_in_synpred987_fml21553);
+ e=relationalExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred987_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6060:6: (op= equalOp e= relationalExpression )*
+
+ for (;;)
+ {
+ int alt708=2;
+ switch ( LA(1) )
+ {
+ case EQUAL:
+ case NEQUAL:
+ case NSEQUAL:
+ case SEQUAL:
+ {
+ alt708=1;
+ }
+ break;
+
+ }
+
+ switch (alt708)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6060:8: op= equalOp e= relationalExpression
+ {
+ FOLLOWPUSH(FOLLOW_equalOp_in_synpred987_fml21569);
+ op=equalOp(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred987_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_relationalExpression_in_synpred987_fml21573);
+ e=relationalExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred987_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop708; /* break out of the loop */
+ break;
+ }
+ }
+ loop708: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred987_fmlEx; /* Prevent compiler warnings */
+rulesynpred987_fmlEx: ;
+
+}
+// $ANTLR end synpred987_fml
+
+// $ANTLR start synpred991_fml
+static void synpred991_fml_fragment(pfmlParser ctx )
+{
+ sep::Operator * op;
+ #undef RETURN_TYPE_op
+ #define RETURN_TYPE_op sep::Operator *
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6100:8: (op= relationalOp e= shiftExpression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6100:8: op= relationalOp e= shiftExpression
+ {
+ FOLLOWPUSH(FOLLOW_relationalOp_in_synpred991_fml21695);
+ op=relationalOp(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred991_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_shiftExpression_in_synpred991_fml21699);
+ e=shiftExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred991_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred991_fmlEx; /* Prevent compiler warnings */
+rulesynpred991_fmlEx: ;
+
+}
+// $ANTLR end synpred991_fml
+
+// $ANTLR start synpred992_fml
+static void synpred992_fml_fragment(pfmlParser ctx )
+{
+ sep::Operator * op;
+ #undef RETURN_TYPE_op
+ #define RETURN_TYPE_op sep::Operator *
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6098:6: (op= relationalOp e= shiftExpression (op= relationalOp e= shiftExpression )* )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6098:6: op= relationalOp e= shiftExpression (op= relationalOp e= shiftExpression )*
+ {
+ FOLLOWPUSH(FOLLOW_relationalOp_in_synpred992_fml21675);
+ op=relationalOp(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred992_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_shiftExpression_in_synpred992_fml21679);
+ e=shiftExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred992_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6100:6: (op= relationalOp e= shiftExpression )*
+
+ for (;;)
+ {
+ int alt709=2;
+ switch ( LA(1) )
+ {
+ case GT:
+ case GTE:
+ case LTE:
+ case LT_:
+ case 295:
+ {
+ alt709=1;
+ }
+ break;
+
+ }
+
+ switch (alt709)
+ {
+ case 1:
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6100:8: op= relationalOp e= shiftExpression
+ {
+ FOLLOWPUSH(FOLLOW_relationalOp_in_synpred992_fml21695);
+ op=relationalOp(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred992_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_shiftExpression_in_synpred992_fml21699);
+ e=shiftExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred992_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop709; /* break out of the loop */
+ break;
+ }
+ }
+ loop709: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred992_fmlEx; /* Prevent compiler warnings */
+rulesynpred992_fmlEx: ;
+
+}
+// $ANTLR end synpred992_fml
+
+// $ANTLR start synpred997_fml
+static void synpred997_fml_fragment(pfmlParser ctx )
+{
+ sep::Operator * op;
+ #undef RETURN_TYPE_op
+ #define RETURN_TYPE_op sep::Operator *
+
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6142:6: (op= shiftOp e= additiveExpression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6142:6: op= shiftOp e= additiveExpression
+ {
+ FOLLOWPUSH(FOLLOW_shiftOp_in_synpred997_fml21818);
+ op=shiftOp(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred997_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_additiveExpression_in_synpred997_fml21822);
+ e=additiveExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred997_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred997_fmlEx; /* Prevent compiler warnings */
+rulesynpred997_fmlEx: ;
+
+}
+// $ANTLR end synpred997_fml
+
+// $ANTLR start synpred1000_fml
+static void synpred1000_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6161:6: ( ( PLUS | MINUS ) e= multiplicativeExpression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6161:6: ( PLUS | MINUS ) e= multiplicativeExpression
+ {
+ if ( LA(1) == MINUS || LA(1) == PLUS )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulesynpred1000_fmlEx;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_multiplicativeExpression_in_synpred1000_fml21924);
+ e=multiplicativeExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred1000_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred1000_fmlEx; /* Prevent compiler warnings */
+rulesynpred1000_fmlEx: ;
+
+}
+// $ANTLR end synpred1000_fml
+
+// $ANTLR start synpred1003_fml
+static void synpred1003_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6175:6: ( ( STAR | DIV | MOD ) e= unaryExpression )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6175:6: ( STAR | DIV | MOD ) e= unaryExpression
+ {
+ if ( LA(1) == DIV || LA(1) == MOD || LA(1) == STAR )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulesynpred1003_fmlEx;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_unaryExpression_in_synpred1003_fml22012);
+ e=unaryExpression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred1003_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred1003_fmlEx; /* Prevent compiler warnings */
+rulesynpred1003_fmlEx: ;
+
+}
+// $ANTLR end synpred1003_fml
+
+// $ANTLR start synpred1020_fml
+static void synpred1020_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6238:6: ( INCR )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6238:6: INCR
+ {
+ MATCHT(INCR, &FOLLOW_INCR_in_synpred1020_fml22353);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred1020_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred1020_fmlEx; /* Prevent compiler warnings */
+rulesynpred1020_fmlEx: ;
+
+}
+// $ANTLR end synpred1020_fml
+
+// $ANTLR start synpred1021_fml
+static void synpred1021_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6241:6: ( DECR )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6241:6: DECR
+ {
+ MATCHT(DECR, &FOLLOW_DECR_in_synpred1021_fml22364);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred1021_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred1021_fmlEx; /* Prevent compiler warnings */
+rulesynpred1021_fmlEx: ;
+
+}
+// $ANTLR end synpred1021_fml
+
+// $ANTLR start synpred1027_fml
+static void synpred1027_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6369:6: ( LPAREN )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6369:8: LPAREN
+ {
+ MATCHT(LPAREN, &FOLLOW_LPAREN_in_synpred1027_fml22603);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred1027_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred1027_fmlEx; /* Prevent compiler warnings */
+rulesynpred1027_fmlEx: ;
+
+}
+// $ANTLR end synpred1027_fml
+
+// $ANTLR start synpred1029_fml
+static void synpred1029_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6372:6: ( DOT | LBRACKET )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:
+ {
+ if ( LA(1) == DOT || LA(1) == LBRACKET )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulesynpred1029_fmlEx;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred1029_fmlEx; /* Prevent compiler warnings */
+rulesynpred1029_fmlEx: ;
+
+}
+// $ANTLR end synpred1029_fml
+
+// $ANTLR start synpred1030_fml
+static void synpred1030_fml_fragment(pfmlParser ctx )
+{
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6374:6: ( COLONx2 )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6374:8: COLONx2
+ {
+ MATCHT(COLONx2, &FOLLOW_COLONx2_in_synpred1030_fml22666);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred1030_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred1030_fmlEx; /* Prevent compiler warnings */
+rulesynpred1030_fmlEx: ;
+
+}
+// $ANTLR end synpred1030_fml
+
+// $ANTLR start synpred1033_fml
+static void synpred1033_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6417:6: ( ( LBRACKET e= expression RBRACKET ) )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6417:6: ( LBRACKET e= expression RBRACKET )
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6417:6: ( LBRACKET e= expression RBRACKET )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6417:8: LBRACKET e= expression RBRACKET
+ {
+ MATCHT(LBRACKET, &FOLLOW_LBRACKET_in_synpred1033_fml22761);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred1033_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred1033_fml22766);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred1033_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(RBRACKET, &FOLLOW_RBRACKET_in_synpred1033_fml22769);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred1033_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred1033_fmlEx; /* Prevent compiler warnings */
+rulesynpred1033_fmlEx: ;
+
+}
+// $ANTLR end synpred1033_fml
+
+// $ANTLR start synpred1035_fml
+static void synpred1035_fml_fragment(pfmlParser ctx )
+{
+ sep::BF e;
+ #undef RETURN_TYPE_e
+ #define RETURN_TYPE_e sep::BF
+
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6469:6: ( ( LBRACKET e= expression RBRACKET ) )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6469:6: ( LBRACKET e= expression RBRACKET )
+ {
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6469:6: ( LBRACKET e= expression RBRACKET )
+ // /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g:6469:8: LBRACKET e= expression RBRACKET
+ {
+ MATCHT(LBRACKET, &FOLLOW_LBRACKET_in_synpred1035_fml22857);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred1035_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expression_in_synpred1035_fml22862);
+ e=expression(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred1035_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(RBRACKET, &FOLLOW_RBRACKET_in_synpred1035_fml22865);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred1035_fmlEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred1035_fmlEx; /* Prevent compiler warnings */
+rulesynpred1035_fmlEx: ;
+
+}
+// $ANTLR end synpred1035_fml
+/* End of parsing rules
+ * ==============================================
+ */
+
+/* ==============================================
+ * Syntactic predicates
+ */
+static ANTLR3_BOOLEAN synpred962_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred962_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred997_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred997_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred21_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred21_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred970_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred970_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred407_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred407_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred539_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred539_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred326_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred326_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred431_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred431_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred1003_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred1003_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred344_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred344_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred636_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred636_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred954_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred954_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred891_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred891_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred804_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred804_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred537_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred537_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred987_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred987_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred520_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred520_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred555_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred555_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred56_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred56_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred62_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred62_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred1021_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred1021_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred956_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred956_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred324_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred324_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred417_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred417_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred960_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred960_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred705_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred705_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred340_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred340_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred969_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred969_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred370_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred370_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred115_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred115_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred446_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred446_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred985_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred985_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred972_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred972_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred514_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred514_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred802_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred802_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred58_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred58_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred778_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred778_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred517_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred517_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred984_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred984_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred991_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred991_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred967_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred967_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred974_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred974_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred61_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred61_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred126_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred126_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred419_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred419_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred957_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred957_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred897_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred897_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred948_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred948_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred965_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred965_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred329_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred329_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred982_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred982_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred952_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred952_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred980_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred980_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred950_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred950_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred963_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred963_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred976_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred976_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred709_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred709_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred1030_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred1030_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred412_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred412_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred946_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred946_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred959_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred959_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred1000_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred1000_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred438_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred438_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred1029_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred1029_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred971_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred971_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred57_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred57_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred872_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred872_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred1020_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred1020_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred1027_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred1027_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred961_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred961_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred643_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred643_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred953_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred953_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred609_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred609_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred343_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred343_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred986_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred986_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred574_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred574_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred973_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred973_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred59_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred59_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred1035_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred1035_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred493_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred493_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred779_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred779_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred781_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred781_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred366_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred366_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred341_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred341_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred531_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred531_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred955_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred955_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred968_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred968_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred975_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred975_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred60_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred60_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred127_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred127_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred958_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred958_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred861_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred861_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred949_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred949_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred1033_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred1033_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred559_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred559_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred153_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred153_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred894_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred894_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred304_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred304_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred983_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred983_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred373_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred373_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred966_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred966_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred170_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred170_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred992_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred992_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred95_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred95_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred780_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred780_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred981_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred981_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred375_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred375_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred138_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred138_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred898_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred898_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred426_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred426_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred714_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred714_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred535_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred535_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred896_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred896_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred296_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred296_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred947_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred947_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred977_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred977_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred964_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred964_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred951_fml(pfmlParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred951_fml_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+
+/* End of syntactic predicates
+ * ==============================================
+ */
+
+
+
+
+
+
+/* End of code
+ * =============================================================================
+ */
diff --git a/org.eclipse.efm.symbex/src/parser/model/fmlParser.h b/org.eclipse.efm.symbex/src/parser/model/fmlParser.h
new file mode 100644
index 0000000..6285a6e
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/parser/model/fmlParser.h
@@ -0,0 +1,2697 @@
+/** \file
+ * This C header file was generated by $ANTLR version 3.4
+ *
+ * - From the grammar source file : /home/lapitre_is148245/git/org.eclipse.efm-symbex/org.eclipse.efm.symbex/src/parser/model/fml.g
+ * - On : 2017-05-30 09:21:52
+ * - for the parser : fmlParserParser
+ *
+ * Editing it, at least manually, is not wise.
+ *
+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
+ *
+ *
+ * The parser
+fmlParser
+
+has the callable functions (rules) shown below,
+ * which will invoke the code for the associated rule in the source grammar
+ * assuming that the input stream is pointing to a token/text stream that could begin
+ * this rule.
+ *
+ * For instance if you call the first (topmost) rule in a parser grammar, you will
+ * get the results of a full parse, but calling a rule half way through the grammar will
+ * allow you to pass part of a full token stream to the parser, such as for syntax checking
+ * in editors and so on.
+ *
+ * The parser entry points are called indirectly (by function pointer to function) via
+ * a parser context typedef pfmlParser, which is returned from a call to fmlParserNew().
+ *
+ * The methods in pfmlParser are as follows:
+ *
+ * -
+ sep::System *
+ pfmlParser->formalML(pfmlParser)
+ * -
+ void
+ pfmlParser->prologue_fml(pfmlParser)
+ * -
+ void
+ pfmlParser->prologue_attribute(pfmlParser)
+ * -
+ void
+ pfmlParser->prologue_options(pfmlParser)
+ * -
+ sep::Modifier
+ pfmlParser->modifier_declaration(pfmlParser)
+ * -
+ sep::Modifier
+ pfmlParser->modifier_direction(pfmlParser)
+ * -
+ sep::Modifier
+ pfmlParser->modifier_direction_text(pfmlParser)
+ * -
+ void
+ pfmlParser->modifier_set_direction_strict_text(pfmlParser)
+ * -
+ sep::Modifier
+ pfmlParser->modifier_direction_symbol(pfmlParser)
+ * -
+ sep::Modifier
+ pfmlParser->modifier_param(pfmlParser)
+ * -
+ fmlParser_procedure_modifier_specifier_return
+ pfmlParser->procedure_modifier_specifier(pfmlParser)
+ * -
+ fmlParser_executable_modifier_specifier_return
+ pfmlParser->executable_modifier_specifier(pfmlParser)
+ * -
+ fmlParser_instance_modifier_specifier_return
+ pfmlParser->instance_modifier_specifier(pfmlParser)
+ * -
+ fmlParser_modifier_transition_return
+ pfmlParser->modifier_transition(pfmlParser)
+ * -
+ sep::Package *
+ pfmlParser->def_package(pfmlParser)
+ * -
+ sep::System *
+ pfmlParser->def_system(pfmlParser)
+ * -
+ fmlParser_qualifiedNameID_return
+ pfmlParser->qualifiedNameID(pfmlParser)
+ * -
+ sep::avm_size_t
+ pfmlParser->integer_constant(pfmlParser)
+ * -
+ sep::avm_float_t
+ pfmlParser->float_constant(pfmlParser)
+ * -
+ void
+ pfmlParser->section_header(pfmlParser)
+ * -
+ void
+ pfmlParser->section_import(pfmlParser)
+ * -
+ void
+ pfmlParser->include_package(pfmlParser)
+ * -
+ void
+ pfmlParser->section_procedure(pfmlParser)
+ * -
+ sep::Machine *
+ pfmlParser->def_procedure(pfmlParser)
+ * -
+ void
+ pfmlParser->def_machine_parameters(pfmlParser)
+ * -
+ void
+ pfmlParser->def_machine_variable_parameter_atom(pfmlParser)
+ * -
+ void
+ pfmlParser->def_machine_returns(pfmlParser)
+ * -
+ void
+ pfmlParser->def_machine_variable_return_atom(pfmlParser)
+ * -
+ void
+ pfmlParser->def_body_procedure(pfmlParser)
+ * -
+ void
+ pfmlParser->def_body_procedure_section(pfmlParser)
+ * -
+ void
+ pfmlParser->def_body_procedure_simplif(pfmlParser)
+ * -
+ void
+ pfmlParser->section_composite_structure(pfmlParser)
+ * -
+ void
+ pfmlParser->section_composite_generic(pfmlParser)
+ * -
+ void
+ pfmlParser->section_machine_model(pfmlParser)
+ * -
+ void
+ pfmlParser->section_machine_prototype(pfmlParser)
+ * -
+ void
+ pfmlParser->section_machine_instance(pfmlParser)
+ * -
+ sep::Machine *
+ pfmlParser->executable_machine(pfmlParser)
+ * -
+ sep::Machine *
+ pfmlParser->executable_model_definiton(pfmlParser)
+ * -
+ sep::Machine *
+ pfmlParser->executable_instance_definiton(pfmlParser)
+ * -
+ sep::Machine *
+ pfmlParser->decl_instance(pfmlParser)
+ * -
+ void
+ pfmlParser->def_instance_on_new_activity(pfmlParser)
+ * -
+ void
+ pfmlParser->def_instance_on_new_activity_parameter(pfmlParser)
+ * -
+ sep::Operator *
+ pfmlParser->op_assign_param(pfmlParser)
+ * -
+ void
+ pfmlParser->def_instance_activity(pfmlParser)
+ * -
+ void
+ pfmlParser->section_behavior(pfmlParser)
+ * -
+ void
+ pfmlParser->def_instance_count(pfmlParser)
+ * -
+ void
+ pfmlParser->def_instance_count_atom(pfmlParser)
+ * -
+ sep::Machine *
+ pfmlParser->def_machine(pfmlParser)
+ * -
+ void
+ pfmlParser->def_body_machine_using_section_header_predicat(pfmlParser)
+ * -
+ void
+ pfmlParser->def_body_machine_using_section_import_predicat(pfmlParser)
+ * -
+ void
+ pfmlParser->def_body_machine_using_section_parameter_predicat(pfmlParser)
+ * -
+ void
+ pfmlParser->def_body_machine_using_section_property_predicat(pfmlParser)
+ * -
+ void
+ pfmlParser->def_body_machine_using_section_predicat(pfmlParser)
+ * -
+ void
+ pfmlParser->def_body_machine(pfmlParser)
+ * -
+ void
+ pfmlParser->def_body_machine_section(pfmlParser)
+ * -
+ void
+ pfmlParser->def_body_machine_simplif(pfmlParser)
+ * -
+ sep::Machine *
+ pfmlParser->any_def_statemachine(pfmlParser)
+ * -
+ sep::Machine *
+ pfmlParser->def_statemachine(pfmlParser)
+ * -
+ void
+ pfmlParser->def_body_statemachine(pfmlParser)
+ * -
+ void
+ pfmlParser->section_region(pfmlParser)
+ * -
+ void
+ pfmlParser->section_statemachine(pfmlParser)
+ * -
+ sep::Machine *
+ pfmlParser->def_state(pfmlParser)
+ * -
+ std::string
+ pfmlParser->state_kw_id(pfmlParser)
+ * -
+ std::string
+ pfmlParser->state_id(pfmlParser)
+ * -
+ sep::Machine *
+ pfmlParser->def_state_singleton(pfmlParser)
+ * -
+ void
+ pfmlParser->executable_specifier(pfmlParser)
+ * -
+ void
+ pfmlParser->executable_specifier_atom(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->instance_machine_model(pfmlParser)
+ * -
+ void
+ pfmlParser->def_body_state(pfmlParser)
+ * -
+ void
+ pfmlParser->def_body_state_section(pfmlParser)
+ * -
+ void
+ pfmlParser->def_body_state_simplif(pfmlParser)
+ * -
+ void
+ pfmlParser->section_transition(pfmlParser)
+ * -
+ void
+ pfmlParser->def_transition(pfmlParser)
+ * -
+ sep::Transition::MOC_KIND
+ pfmlParser->kind_transition(pfmlParser)
+ * -
+ sep::Transition::moc_kind_t
+ pfmlParser->moc_transition_attribute(pfmlParser)
+ * -
+ void
+ pfmlParser->moc_transition(pfmlParser)
+ * -
+ void
+ pfmlParser->moc_transition_atom(pfmlParser)
+ * -
+ void
+ pfmlParser->moe_transition(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->transition_statement(pfmlParser)
+ * -
+ void
+ pfmlParser->transition_trigger(pfmlParser)
+ * -
+ void
+ pfmlParser->transition_guard(pfmlParser)
+ * -
+ void
+ pfmlParser->transition_timed_guard(pfmlParser)
+ * -
+ void
+ pfmlParser->transition_effect(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->target_state_id(pfmlParser)
+ * -
+ std::string
+ pfmlParser->target_state_kw_id(pfmlParser)
+ * -
+ void
+ pfmlParser->def_state_activity(pfmlParser)
+ * -
+ void
+ pfmlParser->section_header_import_parameter_property(pfmlParser)
+ * -
+ void
+ pfmlParser->section_parameter(pfmlParser)
+ * -
+ void
+ pfmlParser->section_property(pfmlParser)
+ * -
+ void
+ pfmlParser->section_property_free_declaration(pfmlParser)
+ * -
+ void
+ pfmlParser->property_declaration(pfmlParser)
+ * -
+ void
+ pfmlParser->decl_property_element(pfmlParser)
+ * -
+ fmlParser_labelled_argument_return
+ pfmlParser->labelled_argument(pfmlParser)
+ * -
+ void
+ pfmlParser->decl_instance_machine_params(pfmlParser)
+ * -
+ void
+ pfmlParser->decl_instance_machine_returns(pfmlParser)
+ * -
+ void
+ pfmlParser->activity_machine_param_return(pfmlParser)
+ * -
+ void
+ pfmlParser->decl_port(pfmlParser)
+ * -
+ void
+ pfmlParser->decl_port_impl(pfmlParser)
+ * -
+ void
+ pfmlParser->decl_signal(pfmlParser)
+ * -
+ void
+ pfmlParser->decl_signal_impl(pfmlParser)
+ * -
+ void
+ pfmlParser->type_param_com(pfmlParser)
+ * -
+ void
+ pfmlParser->param_com_atom(pfmlParser)
+ * -
+ void
+ pfmlParser->decl_buffer(pfmlParser)
+ * -
+ void
+ pfmlParser->decl_buffer_impl(pfmlParser)
+ * -
+ fmlParser_def_buffer_return
+ pfmlParser->def_buffer(pfmlParser)
+ * -
+ sep::avm_type_specifier_kind_t
+ pfmlParser->policy_buffer(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->ref_buffer(pfmlParser)
+ * -
+ void
+ pfmlParser->initial_buffer_contents(pfmlParser)
+ * -
+ void
+ pfmlParser->decl_channel(pfmlParser)
+ * -
+ void
+ pfmlParser->decl_channel_port(pfmlParser)
+ * -
+ void
+ pfmlParser->decl_channel_var(pfmlParser)
+ * -
+ void
+ pfmlParser->decl_variable(pfmlParser)
+ * -
+ void
+ pfmlParser->decl_variable_time_clock_impl(pfmlParser)
+ * -
+ void
+ pfmlParser->decl_variable_impl(pfmlParser)
+ * -
+ void
+ pfmlParser->decl_variable_atom_impl(pfmlParser)
+ * -
+ void
+ pfmlParser->decl_typed_variable_atom_impl(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->initial_value(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->type_var(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->def_type_array(pfmlParser)
+ * -
+ int
+ pfmlParser->def_type_array_size(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->def_type_container(pfmlParser)
+ * -
+ sep::avm_type_specifier_kind_t
+ pfmlParser->specifier_buffer(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->def_type_interval(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->base_type_var(pfmlParser)
+ * -
+ sep::TypeSpecifier
+ pfmlParser->primitive_type(pfmlParser)
+ * -
+ int
+ pfmlParser->bit_field_size(pfmlParser)
+ * -
+ fmlParser_string_field_size_return
+ pfmlParser->string_field_size(pfmlParser)
+ * -
+ fmlParser_range_constant_return
+ pfmlParser->range_constant(pfmlParser)
+ * -
+ void
+ pfmlParser->on_write_var_routine_def(pfmlParser)
+ * -
+ void
+ pfmlParser->var_routine_def(pfmlParser)
+ * -
+ void
+ pfmlParser->routine_single_param(pfmlParser)
+ * -
+ void
+ pfmlParser->def_enum(pfmlParser)
+ * -
+ void
+ pfmlParser->def_enum_impl(pfmlParser)
+ * -
+ void
+ pfmlParser->def_struct(pfmlParser)
+ * -
+ void
+ pfmlParser->def_class_structure_impl(pfmlParser)
+ * -
+ void
+ pfmlParser->def_choice(pfmlParser)
+ * -
+ void
+ pfmlParser->def_choice_impl(pfmlParser)
+ * -
+ void
+ pfmlParser->def_union(pfmlParser)
+ * -
+ void
+ pfmlParser->def_union_impl(pfmlParser)
+ * -
+ void
+ pfmlParser->def_method(pfmlParser)
+ * -
+ void
+ pfmlParser->decl_parameters(pfmlParser)
+ * -
+ void
+ pfmlParser->def_type(pfmlParser)
+ * -
+ void
+ pfmlParser->def_type_impl(pfmlParser)
+ * -
+ void
+ pfmlParser->def_type_atom_impl(pfmlParser)
+ * -
+ void
+ pfmlParser->def_typedef_constraint(pfmlParser)
+ * -
+ sep::TypeSpecifier
+ pfmlParser->time_type(pfmlParser)
+ * -
+ sep::TypeSpecifier
+ pfmlParser->time_clock_type(pfmlParser)
+ * -
+ sep::TypeSpecifier
+ pfmlParser->time_type_domain(pfmlParser)
+ * -
+ void
+ pfmlParser->section_model_of_computation(pfmlParser)
+ * -
+ void
+ pfmlParser->section_routine(pfmlParser)
+ * -
+ void
+ pfmlParser->def_routine_model(pfmlParser)
+ * -
+ void
+ pfmlParser->def_routine_model_impl(pfmlParser)
+ * -
+ void
+ pfmlParser->def_routine_parameters(pfmlParser)
+ * -
+ void
+ pfmlParser->def_routine_param_atom(pfmlParser)
+ * -
+ void
+ pfmlParser->def_routine_returns(pfmlParser)
+ * -
+ void
+ pfmlParser->def_routine_returns_atom(pfmlParser)
+ * -
+ void
+ pfmlParser->section_model_of_execution(pfmlParser)
+ * -
+ void
+ pfmlParser->def_moe_primitive(pfmlParser)
+ * -
+ void
+ pfmlParser->def_routine_seq(pfmlParser)
+ * -
+ void
+ pfmlParser->section_model_of_interaction(pfmlParser)
+ * -
+ void
+ pfmlParser->com_protocol(pfmlParser)
+ * -
+ void
+ pfmlParser->com_cast(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->buffer_com(pfmlParser)
+ * -
+ void
+ pfmlParser->com_connect(pfmlParser)
+ * -
+ void
+ pfmlParser->com_route(pfmlParser)
+ * -
+ void
+ pfmlParser->com_port(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->com_port_id(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->statement(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->block_statement(pfmlParser)
+ * -
+ sep::Operator *
+ pfmlParser->op_block(pfmlParser)
+ * -
+ sep::Operator *
+ pfmlParser->op_sequence(pfmlParser)
+ * -
+ sep::Operator *
+ pfmlParser->op_scheduling(pfmlParser)
+ * -
+ sep::Operator *
+ pfmlParser->op_concurrency(pfmlParser)
+ * -
+ sep::Operator *
+ pfmlParser->op_invokable(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->prefix_statement(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->prefix_expression(pfmlParser)
+ * -
+ sep::Operator *
+ pfmlParser->avm_operator(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->statement_invoke_method(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->statement_invoke(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->expression_invoke(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->statement_activity_new(pfmlParser)
+ * -
+ void
+ pfmlParser->decl_instance_dynamic_impl(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->expression_activity_new(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->statement_prompt(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->statement_prompt_impl(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->statement_prompt_obs(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->statement_prompt_obs_com(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->meta_statement(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->statement_assign(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->lvalue(pfmlParser)
+ * -
+ void
+ pfmlParser->parameters(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->statement_com(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->statement_com_input(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->statement_com_output(pfmlParser)
+ * -
+ void
+ pfmlParser->parameters_port(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->expression_com(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->statement_constraint(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->statement_guard(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->statement_timed_guard(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->statement_checksat(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->expression_guard(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->statement_ite(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->expression_ite(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->statement_iteration(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->for_assign_header(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->statement_jump(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->expression_lambda(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->expression_status(pfmlParser)
+ * -
+ sep::Operator *
+ pfmlParser->op_activity(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->statement_activity(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->statement_init_flow(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->statement_invoke_routine(pfmlParser)
+ * -
+ void
+ pfmlParser->invoke_routine_params(pfmlParser)
+ * -
+ void
+ pfmlParser->invoke_routine_returns(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->statement_moc(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->expression(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->conditionalExpression(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->scheduleExpression(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->conditionalOrExpression(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->conditionalAndExpression(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->bitwiseOrExpression(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->bitwiseXorExpression(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->bitwiseAndExpression(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->equalityExpression(pfmlParser)
+ * -
+ sep::Operator *
+ pfmlParser->equalOp(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->relationalExpression(pfmlParser)
+ * -
+ sep::Operator *
+ pfmlParser->relationalOp(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->shiftExpression(pfmlParser)
+ * -
+ sep::Operator *
+ pfmlParser->shiftOp(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->additiveExpression(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->multiplicativeExpression(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->unaryExpression(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->ctorExpression(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->quote_expression(pfmlParser)
+ * -
+ sep::BFCode
+ pfmlParser->meta_eval_expression(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->primary(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->primary_ufid(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->primary_ufi(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->primary_invoke(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->literal(pfmlParser)
+ * -
+ sep::BF
+ pfmlParser->collection_of_expression(pfmlParser)
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * The return type for any particular rule is of course determined by the source
+ * grammar file.
+ */
+// [The "BSD license"]
+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
+// http://www.temporal-wave.com
+// http://www.linkedin.com/in/jimidle
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. The name of the author may not be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef _fmlParser_H
+#define _fmlParser_H
+/* =============================================================================
+ * Standard antlr3 C runtime definitions
+ */
+#include <antlr3.h>
+
+/* End of standard antlr 3 runtime definitions
+ * =============================================================================
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Forward declare the context typedef so that we can use it before it is
+// properly defined. Delegators and delegates (from import statements) are
+// interdependent and their context structures contain pointers to each other
+// C only allows such things to be declared if you pre-declare the typedef.
+//
+typedef struct fmlParser_Ctx_struct fmlParser, * pfmlParser;
+
+
+
+
+#include <parser/model/ParserUtil.h>
+
+#include <common/BF.h>
+
+#include <collection/BFContainer.h>
+
+#include <fml/common/BehavioralElement.h>
+#include <fml/common/ModifierElement.h>
+#include <fml/common/SpecifierElement.h>
+
+#include <fml/executable/ExecutableLib.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/BuiltinArray.h>
+#include <fml/expression/ExpressionConstant.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/StatementConstructor.h>
+
+#include <fml/lib/IComPoint.h>
+
+#include <fml/operator/Operator.h>
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/template/TemplateFactory.h>
+
+#include <fml/type/TypeSpecifier.h>
+
+#include <fml/type/TypeManager.h>
+
+#include <fml/infrastructure/Buffer.h>
+#include <fml/infrastructure/Channel.h>
+#include <fml/infrastructure/ComPoint.h>
+#include <fml/infrastructure/ComProtocol.h>
+#include <fml/infrastructure/ComRoute.h>
+#include <fml/infrastructure/Connector.h>
+
+// extern "C" and C++ template incompatibility !!!
+//#include <fml/infrastructure/PropertyPart.h>
+
+#include <fml/infrastructure/DataType.h>
+#include <fml/infrastructure/Machine.h>
+#include <fml/infrastructure/Package.h>
+#include <fml/infrastructure/Port.h>
+#include <fml/infrastructure/Routine.h>
+#include <fml/infrastructure/System.h>
+#include <fml/infrastructure/Transition.h>
+#include <fml/infrastructure/Variable.h>
+
+#include <fml/infrastructure/BehavioralPart.h>
+#include <fml/infrastructure/CompositePart.h>
+#include <fml/infrastructure/InstanceSpecifierPart.h>
+#include <fml/infrastructure/InteractionPart.h>
+#include <fml/infrastructure/ModelOfComputationPart.h>
+
+// extern "C" and C++ template incompatibility !!!
+//#include <fml/infrastructure/PropertyPart.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/UniFormIdentifier.h>
+#include <fml/workflow/WObject.h>
+
+
+//void fmlDisplayRecognitionError(
+// pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_UINT8 * tokenNames);
+
+
+
+#ifdef ANTLR3_WINDOWS
+// Disable: Unreferenced parameter, - Rules with parameters that are not used
+// constant conditional, - ANTLR realizes that a prediction is always true (synpred usually)
+// initialized but unused variable - tree rewrite variables declared but not needed
+// Unreferenced local variable - lexer rule declares but does not always use _type
+// potentially unitialized variable used - retval always returned from a rule
+// unreferenced local function has been removed - susually getTokenNames or freeScope, they can go without warnigns
+//
+// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
+// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
+// usually generated when a parser rule is given a parameter that it does not use. Mostly though
+// this is a matter of orthogonality hence I disable that one.
+//
+#pragma warning( disable : 4100 )
+#pragma warning( disable : 4101 )
+#pragma warning( disable : 4127 )
+#pragma warning( disable : 4189 )
+#pragma warning( disable : 4505 )
+#pragma warning( disable : 4701 )
+#endif
+
+/* ========================
+ * BACKTRACKING IS ENABLED
+ * ========================
+ */
+
+typedef struct fmlParser_procedure_modifier_specifier_return_struct
+{
+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
+ */
+ pANTLR3_COMMON_TOKEN start;
+ pANTLR3_COMMON_TOKEN stop;
+ sep::Modifier mdfr;
+ sep::Specifier spcfr;
+}
+ fmlParser_procedure_modifier_specifier_return;
+
+
+
+typedef struct fmlParser_executable_modifier_specifier_return_struct
+{
+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
+ */
+ pANTLR3_COMMON_TOKEN start;
+ pANTLR3_COMMON_TOKEN stop;
+ sep::Modifier mdfr;
+ sep::Specifier spcfr;
+}
+ fmlParser_executable_modifier_specifier_return;
+
+
+
+typedef struct fmlParser_instance_modifier_specifier_return_struct
+{
+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
+ */
+ pANTLR3_COMMON_TOKEN start;
+ pANTLR3_COMMON_TOKEN stop;
+ sep::Modifier mdfr;
+ sep::Specifier spcfr;
+}
+ fmlParser_instance_modifier_specifier_return;
+
+
+
+typedef struct fmlParser_modifier_transition_return_struct
+{
+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
+ */
+ pANTLR3_COMMON_TOKEN start;
+ pANTLR3_COMMON_TOKEN stop;
+ sep::Modifier mdfr;
+ sep::Specifier spcfr;
+}
+ fmlParser_modifier_transition_return;
+
+
+
+typedef struct fmlParser_qualifiedNameID_return_struct
+{
+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
+ */
+ pANTLR3_COMMON_TOKEN start;
+ pANTLR3_COMMON_TOKEN stop;
+ std::string s;
+ sep::avm_size_t nb;
+}
+ fmlParser_qualifiedNameID_return;
+
+
+
+typedef struct fmlParser_labelled_argument_return_struct
+{
+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
+ */
+ pANTLR3_COMMON_TOKEN start;
+ pANTLR3_COMMON_TOKEN stop;
+ std::string label;
+ sep::BF arg;
+}
+ fmlParser_labelled_argument_return;
+
+
+
+typedef struct fmlParser_def_buffer_return_struct
+{
+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
+ */
+ pANTLR3_COMMON_TOKEN start;
+ pANTLR3_COMMON_TOKEN stop;
+ sep::avm_type_specifier_kind_t kind;
+ int size;
+}
+ fmlParser_def_buffer_return;
+
+
+
+typedef struct fmlParser_string_field_size_return_struct
+{
+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
+ */
+ pANTLR3_COMMON_TOKEN start;
+ pANTLR3_COMMON_TOKEN stop;
+ int min;
+ int max;
+}
+ fmlParser_string_field_size_return;
+
+
+
+typedef struct fmlParser_range_constant_return_struct
+{
+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
+ */
+ pANTLR3_COMMON_TOKEN start;
+ pANTLR3_COMMON_TOKEN stop;
+ int min;
+ int max;
+}
+ fmlParser_range_constant_return;
+
+
+
+
+
+/** Context tracking structure for
+fmlParser
+
+ */
+struct fmlParser_Ctx_struct
+{
+ /** Built in ANTLR3 context tracker contains all the generic elements
+ * required for context tracking.
+ */
+ pANTLR3_PARSER pParser;
+
+ sep::System *
+ (*formalML) (struct fmlParser_Ctx_struct * ctx, sep::WObjectManager & aWObjectManager);
+
+ void
+ (*prologue_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ void
+ (*prologue_attribute) (struct fmlParser_Ctx_struct * ctx);
+
+ void
+ (*prologue_options) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::Modifier
+ (*modifier_declaration) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::Modifier
+ (*modifier_direction) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::Modifier
+ (*modifier_direction_text) (struct fmlParser_Ctx_struct * ctx);
+
+ void
+ (*modifier_set_direction_strict_text) (struct fmlParser_Ctx_struct * ctx, sep::Modifier & mdfr);
+
+ sep::Modifier
+ (*modifier_direction_symbol) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::Modifier
+ (*modifier_param) (struct fmlParser_Ctx_struct * ctx);
+
+ fmlParser_procedure_modifier_specifier_return
+ (*procedure_modifier_specifier) (struct fmlParser_Ctx_struct * ctx);
+
+ fmlParser_executable_modifier_specifier_return
+ (*executable_modifier_specifier) (struct fmlParser_Ctx_struct * ctx);
+
+ fmlParser_instance_modifier_specifier_return
+ (*instance_modifier_specifier) (struct fmlParser_Ctx_struct * ctx);
+
+ fmlParser_modifier_transition_return
+ (*modifier_transition) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::Package *
+ (*def_package) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::System *
+ (*def_system) (struct fmlParser_Ctx_struct * ctx);
+
+ fmlParser_qualifiedNameID_return
+ (*qualifiedNameID) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::avm_size_t
+ (*integer_constant) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::avm_float_t
+ (*float_constant) (struct fmlParser_Ctx_struct * ctx);
+
+ void
+ (*section_header) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container);
+
+ void
+ (*section_import) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container);
+
+ void
+ (*include_package) (struct fmlParser_Ctx_struct * ctx);
+
+ void
+ (*section_procedure) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container);
+
+ sep::Machine *
+ (*def_procedure) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container);
+
+ void
+ (*def_machine_parameters) (struct fmlParser_Ctx_struct * ctx, sep::Machine * machine);
+
+ void
+ (*def_machine_variable_parameter_atom) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & paramDecl, sep::Modifier mdfr, sep::avm_offset_t offset);
+
+ void
+ (*def_machine_returns) (struct fmlParser_Ctx_struct * ctx, sep::Machine * machine, sep::Modifier mdfr);
+
+ void
+ (*def_machine_variable_return_atom) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & paramDecl, sep::Modifier mdfr, sep::avm_offset_t offset);
+
+ void
+ (*def_body_procedure) (struct fmlParser_Ctx_struct * ctx, sep::Machine * procedure);
+
+ void
+ (*def_body_procedure_section) (struct fmlParser_Ctx_struct * ctx, sep::Machine * procedure);
+
+ void
+ (*def_body_procedure_simplif) (struct fmlParser_Ctx_struct * ctx, sep::Machine * procedure);
+
+ void
+ (*section_composite_structure) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container);
+
+ void
+ (*section_composite_generic) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container);
+
+ void
+ (*section_machine_model) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container);
+
+ void
+ (*section_machine_prototype) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container);
+
+ void
+ (*section_machine_instance) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container);
+
+ sep::Machine *
+ (*executable_machine) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container);
+
+ sep::Machine *
+ (*executable_model_definiton) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr);
+
+ sep::Machine *
+ (*executable_instance_definiton) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container);
+
+ sep::Machine *
+ (*decl_instance) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr);
+
+ void
+ (*def_instance_on_new_activity) (struct fmlParser_Ctx_struct * ctx, sep::Machine * instance);
+
+ void
+ (*def_instance_on_new_activity_parameter) (struct fmlParser_Ctx_struct * ctx, sep::Machine * instance, sep::avm_size_t position);
+
+ sep::Operator *
+ (*op_assign_param) (struct fmlParser_Ctx_struct * ctx);
+
+ void
+ (*def_instance_activity) (struct fmlParser_Ctx_struct * ctx, sep::Machine * instance);
+
+ void
+ (*section_behavior) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container);
+
+ void
+ (*def_instance_count) (struct fmlParser_Ctx_struct * ctx, sep::avm_size_t & initial, sep::avm_size_t & maximal);
+
+ void
+ (*def_instance_count_atom) (struct fmlParser_Ctx_struct * ctx, sep::avm_size_t & initial, sep::avm_size_t & maximal);
+
+ sep::Machine *
+ (*def_machine) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr);
+
+ void
+ (*def_body_machine_using_section_header_predicat) (struct fmlParser_Ctx_struct * ctx);
+
+ void
+ (*def_body_machine_using_section_import_predicat) (struct fmlParser_Ctx_struct * ctx);
+
+ void
+ (*def_body_machine_using_section_parameter_predicat) (struct fmlParser_Ctx_struct * ctx);
+
+ void
+ (*def_body_machine_using_section_property_predicat) (struct fmlParser_Ctx_struct * ctx);
+
+ void
+ (*def_body_machine_using_section_predicat) (struct fmlParser_Ctx_struct * ctx);
+
+ void
+ (*def_body_machine) (struct fmlParser_Ctx_struct * ctx, sep::Machine * machine);
+
+ void
+ (*def_body_machine_section) (struct fmlParser_Ctx_struct * ctx, sep::Machine * machine);
+
+ void
+ (*def_body_machine_simplif) (struct fmlParser_Ctx_struct * ctx, sep::Machine * machine);
+
+ sep::Machine *
+ (*any_def_statemachine) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr);
+
+ sep::Machine *
+ (*def_statemachine) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr);
+
+ void
+ (*def_body_statemachine) (struct fmlParser_Ctx_struct * ctx, sep::Machine * machine);
+
+ void
+ (*section_region) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container);
+
+ void
+ (*section_statemachine) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container);
+
+ sep::Machine *
+ (*def_state) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr);
+
+ std::string
+ (*state_kw_id) (struct fmlParser_Ctx_struct * ctx);
+
+ std::string
+ (*state_id) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::Machine *
+ (*def_state_singleton) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr);
+
+ void
+ (*executable_specifier) (struct fmlParser_Ctx_struct * ctx, sep::Specifier & spcfr);
+
+ void
+ (*executable_specifier_atom) (struct fmlParser_Ctx_struct * ctx, sep::Specifier & spcfr);
+
+ sep::BF
+ (*instance_machine_model) (struct fmlParser_Ctx_struct * ctx);
+
+ void
+ (*def_body_state) (struct fmlParser_Ctx_struct * ctx, sep::Machine * state);
+
+ void
+ (*def_body_state_section) (struct fmlParser_Ctx_struct * ctx, sep::Machine * machine);
+
+ void
+ (*def_body_state_simplif) (struct fmlParser_Ctx_struct * ctx, sep::Machine * state);
+
+ void
+ (*section_transition) (struct fmlParser_Ctx_struct * ctx, sep::Machine * state);
+
+ void
+ (*def_transition) (struct fmlParser_Ctx_struct * ctx, sep::Machine * state, sep::Modifier mdfr, sep::Specifier spcfr);
+
+ sep::Transition::MOC_KIND
+ (*kind_transition) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::Transition::moc_kind_t
+ (*moc_transition_attribute) (struct fmlParser_Ctx_struct * ctx);
+
+ void
+ (*moc_transition) (struct fmlParser_Ctx_struct * ctx, sep::Transition * trans);
+
+ void
+ (*moc_transition_atom) (struct fmlParser_Ctx_struct * ctx, sep::Transition * trans);
+
+ void
+ (*moe_transition) (struct fmlParser_Ctx_struct * ctx, sep::Transition * trans);
+
+ sep::BFCode
+ (*transition_statement) (struct fmlParser_Ctx_struct * ctx);
+
+ void
+ (*transition_trigger) (struct fmlParser_Ctx_struct * ctx, sep::BFCode & ac);
+
+ void
+ (*transition_guard) (struct fmlParser_Ctx_struct * ctx, sep::BFCode & ac);
+
+ void
+ (*transition_timed_guard) (struct fmlParser_Ctx_struct * ctx, sep::BFCode & ac);
+
+ void
+ (*transition_effect) (struct fmlParser_Ctx_struct * ctx, sep::BFCode & ac);
+
+ sep::BF
+ (*target_state_id) (struct fmlParser_Ctx_struct * ctx);
+
+ std::string
+ (*target_state_kw_id) (struct fmlParser_Ctx_struct * ctx);
+
+ void
+ (*def_state_activity) (struct fmlParser_Ctx_struct * ctx, sep::Machine * state);
+
+ void
+ (*section_header_import_parameter_property) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container);
+
+ void
+ (*section_parameter) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container);
+
+ void
+ (*section_property) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container);
+
+ void
+ (*section_property_free_declaration) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container);
+
+ void
+ (*property_declaration) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+
+ void
+ (*decl_property_element) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+
+ fmlParser_labelled_argument_return
+ (*labelled_argument) (struct fmlParser_Ctx_struct * ctx);
+
+ void
+ (*decl_instance_machine_params) (struct fmlParser_Ctx_struct * ctx, sep::Machine * machine);
+
+ void
+ (*decl_instance_machine_returns) (struct fmlParser_Ctx_struct * ctx, sep::Machine * machine);
+
+ void
+ (*activity_machine_param_return) (struct fmlParser_Ctx_struct * ctx, const sep::BF & argMachine, sep::BFCode & ac);
+
+ void
+ (*decl_port) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+
+ void
+ (*decl_port_impl) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr, sep::IComPoint::ENUM_IO_NATURE nature);
+
+ void
+ (*decl_signal) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+
+ void
+ (*decl_signal_impl) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr, sep::IComPoint::ENUM_IO_NATURE nature);
+
+ void
+ (*type_param_com) (struct fmlParser_Ctx_struct * ctx, sep::Port * port);
+
+ void
+ (*param_com_atom) (struct fmlParser_Ctx_struct * ctx, sep::Port * port, sep::avm_offset_t offset);
+
+ void
+ (*decl_buffer) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+
+ void
+ (*decl_buffer_impl) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+
+ fmlParser_def_buffer_return
+ (*def_buffer) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::avm_type_specifier_kind_t
+ (*policy_buffer) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BF
+ (*ref_buffer) (struct fmlParser_Ctx_struct * ctx, sep::Machine * machine);
+
+ void
+ (*initial_buffer_contents) (struct fmlParser_Ctx_struct * ctx, const sep::Buffer * buffer);
+
+ void
+ (*decl_channel) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+
+ void
+ (*decl_channel_port) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+
+ void
+ (*decl_channel_var) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+
+ void
+ (*decl_variable) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+
+ void
+ (*decl_variable_time_clock_impl) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+
+ void
+ (*decl_variable_impl) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+
+ void
+ (*decl_variable_atom_impl) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+
+ void
+ (*decl_typed_variable_atom_impl) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr, const sep::BF & type);
+
+ sep::BF
+ (*initial_value) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BF
+ (*type_var) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BF
+ (*def_type_array) (struct fmlParser_Ctx_struct * ctx, sep::BF baseT, const std::string & tid);
+
+ int
+ (*def_type_array_size) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BF
+ (*def_type_container) (struct fmlParser_Ctx_struct * ctx, const std::string & tid);
+
+ sep::avm_type_specifier_kind_t
+ (*specifier_buffer) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BF
+ (*def_type_interval) (struct fmlParser_Ctx_struct * ctx, const std::string & tid);
+
+ sep::BF
+ (*base_type_var) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::TypeSpecifier
+ (*primitive_type) (struct fmlParser_Ctx_struct * ctx);
+
+ int
+ (*bit_field_size) (struct fmlParser_Ctx_struct * ctx);
+
+ fmlParser_string_field_size_return
+ (*string_field_size) (struct fmlParser_Ctx_struct * ctx);
+
+ fmlParser_range_constant_return
+ (*range_constant) (struct fmlParser_Ctx_struct * ctx);
+
+ void
+ (*on_write_var_routine_def) (struct fmlParser_Ctx_struct * ctx, sep::Variable * var);
+
+ void
+ (*var_routine_def) (struct fmlParser_Ctx_struct * ctx, sep::Variable * var);
+
+ void
+ (*routine_single_param) (struct fmlParser_Ctx_struct * ctx, sep::Routine & routine, const sep::BF & dftType);
+
+ void
+ (*def_enum) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+
+ void
+ (*def_enum_impl) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr, const std::string & tid);
+
+ void
+ (*def_struct) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+
+ void
+ (*def_class_structure_impl) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr, const std::string & tid);
+
+ void
+ (*def_choice) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+
+ void
+ (*def_choice_impl) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr, const std::string & tid);
+
+ void
+ (*def_union) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+
+ void
+ (*def_union_impl) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr, const std::string & tid);
+
+ void
+ (*def_method) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty);
+
+ void
+ (*decl_parameters) (struct fmlParser_Ctx_struct * ctx);
+
+ void
+ (*def_type) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+
+ void
+ (*def_type_impl) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+
+ void
+ (*def_type_atom_impl) (struct fmlParser_Ctx_struct * ctx, sep::PropertyPart & declProperty, sep::Modifier mdfr);
+
+ void
+ (*def_typedef_constraint) (struct fmlParser_Ctx_struct * ctx, sep::DataType * aliasT);
+
+ sep::TypeSpecifier
+ (*time_type) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::TypeSpecifier
+ (*time_clock_type) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::TypeSpecifier
+ (*time_type_domain) (struct fmlParser_Ctx_struct * ctx);
+
+ void
+ (*section_model_of_computation) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container);
+
+ void
+ (*section_routine) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container);
+
+ void
+ (*def_routine_model) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr);
+
+ void
+ (*def_routine_model_impl) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container, sep::Modifier mdfr, sep::Specifier spcfr);
+
+ void
+ (*def_routine_parameters) (struct fmlParser_Ctx_struct * ctx, sep::Routine & routine);
+
+ void
+ (*def_routine_param_atom) (struct fmlParser_Ctx_struct * ctx, sep::Routine & routine, sep::avm_size_t offset);
+
+ void
+ (*def_routine_returns) (struct fmlParser_Ctx_struct * ctx, sep::Routine & routine);
+
+ void
+ (*def_routine_returns_atom) (struct fmlParser_Ctx_struct * ctx, sep::Routine & routine, sep::avm_size_t offset);
+
+ void
+ (*section_model_of_execution) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container);
+
+ void
+ (*def_moe_primitive) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container);
+
+ void
+ (*def_routine_seq) (struct fmlParser_Ctx_struct * ctx, sep::Routine & routine);
+
+ void
+ (*section_model_of_interaction) (struct fmlParser_Ctx_struct * ctx, sep::Machine * machine);
+
+ void
+ (*com_protocol) (struct fmlParser_Ctx_struct * ctx, sep::Machine * machine, sep::ComProtocol * cp);
+
+ void
+ (*com_cast) (struct fmlParser_Ctx_struct * ctx, sep::ComProtocol * cp);
+
+ sep::BF
+ (*buffer_com) (struct fmlParser_Ctx_struct * ctx, sep::Machine * machine);
+
+ void
+ (*com_connect) (struct fmlParser_Ctx_struct * ctx, sep::Machine * machine, sep::InteractionPart * anInteraction);
+
+ void
+ (*com_route) (struct fmlParser_Ctx_struct * ctx, sep::Machine * machine, sep::Connector * aConnector);
+
+ void
+ (*com_port) (struct fmlParser_Ctx_struct * ctx, sep::Machine * machine, sep::ComRoute * comRoute);
+
+ sep::BF
+ (*com_port_id) (struct fmlParser_Ctx_struct * ctx, sep::Machine * machine, sep::Machine * comMachine);
+
+ sep::BFCode
+ (*statement) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*block_statement) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::Operator *
+ (*op_block) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::Operator *
+ (*op_sequence) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::Operator *
+ (*op_scheduling) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::Operator *
+ (*op_concurrency) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::Operator *
+ (*op_invokable) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*prefix_statement) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*prefix_expression) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::Operator *
+ (*avm_operator) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*statement_invoke_method) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*statement_invoke) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*expression_invoke) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*statement_activity_new) (struct fmlParser_Ctx_struct * ctx);
+
+ void
+ (*decl_instance_dynamic_impl) (struct fmlParser_Ctx_struct * ctx, sep::Machine * container, sep::Machine * ptrInstance);
+
+ sep::BFCode
+ (*expression_activity_new) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*statement_prompt) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*statement_prompt_impl) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*statement_prompt_obs) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*statement_prompt_obs_com) (struct fmlParser_Ctx_struct * ctx, const sep::BF & varMachine);
+
+ sep::BFCode
+ (*meta_statement) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*statement_assign) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BF
+ (*lvalue) (struct fmlParser_Ctx_struct * ctx);
+
+ void
+ (*parameters) (struct fmlParser_Ctx_struct * ctx, const sep::BFCode & ac);
+
+ sep::BFCode
+ (*statement_com) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*statement_com_input) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*statement_com_output) (struct fmlParser_Ctx_struct * ctx);
+
+ void
+ (*parameters_port) (struct fmlParser_Ctx_struct * ctx, sep::Port * port, const sep::BFCode & ac);
+
+ sep::BFCode
+ (*expression_com) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*statement_constraint) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*statement_guard) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*statement_timed_guard) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*statement_checksat) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*expression_guard) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*statement_ite) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*expression_ite) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*statement_iteration) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*for_assign_header) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*statement_jump) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*expression_lambda) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*expression_status) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::Operator *
+ (*op_activity) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*statement_activity) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*statement_init_flow) (struct fmlParser_Ctx_struct * ctx, const sep::BF & flowTarget);
+
+ sep::BFCode
+ (*statement_invoke_routine) (struct fmlParser_Ctx_struct * ctx);
+
+ void
+ (*invoke_routine_params) (struct fmlParser_Ctx_struct * ctx, sep::Routine * invokeRoutine);
+
+ void
+ (*invoke_routine_returns) (struct fmlParser_Ctx_struct * ctx, sep::Routine * invokeRoutine);
+
+ sep::BFCode
+ (*statement_moc) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BF
+ (*expression) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BF
+ (*conditionalExpression) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BF
+ (*scheduleExpression) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BF
+ (*conditionalOrExpression) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BF
+ (*conditionalAndExpression) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BF
+ (*bitwiseOrExpression) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BF
+ (*bitwiseXorExpression) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BF
+ (*bitwiseAndExpression) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BF
+ (*equalityExpression) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::Operator *
+ (*equalOp) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BF
+ (*relationalExpression) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::Operator *
+ (*relationalOp) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BF
+ (*shiftExpression) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::Operator *
+ (*shiftOp) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BF
+ (*additiveExpression) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BF
+ (*multiplicativeExpression) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BF
+ (*unaryExpression) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*ctorExpression) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*quote_expression) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BFCode
+ (*meta_eval_expression) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BF
+ (*primary) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BF
+ (*primary_ufid) (struct fmlParser_Ctx_struct * ctx, const std::string & mainId);
+
+ sep::BF
+ (*primary_ufi) (struct fmlParser_Ctx_struct * ctx, const std::string & locatorId);
+
+ sep::BF
+ (*primary_invoke) (struct fmlParser_Ctx_struct * ctx, const std::string & mainId);
+
+ sep::BF
+ (*literal) (struct fmlParser_Ctx_struct * ctx);
+
+ sep::BF
+ (*collection_of_expression) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred21_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred56_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred57_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred58_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred59_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred60_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred61_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred62_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred95_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred115_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred126_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred127_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred138_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred153_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred170_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred296_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred304_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred324_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred326_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred329_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred340_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred341_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred343_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred344_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred366_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred370_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred373_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred375_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred407_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred412_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred417_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred419_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred426_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred431_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred438_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred446_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred493_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred514_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred517_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred520_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred531_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred535_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred537_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred539_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred555_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred559_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred574_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred609_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred636_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred643_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred705_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred709_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred714_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred778_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred779_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred780_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred781_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred802_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred804_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred861_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred872_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred891_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred894_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred896_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred897_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred898_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred946_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred947_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred948_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred949_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred950_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred951_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred952_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred953_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred954_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred955_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred956_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred957_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred958_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred959_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred960_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred961_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred962_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred963_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred964_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred965_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred966_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred967_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred968_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred969_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred970_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred971_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred972_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred973_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred974_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred975_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred976_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred977_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred980_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred981_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred982_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred983_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred984_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred985_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred986_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred987_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred991_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred992_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred997_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred1000_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred1003_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred1020_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred1021_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred1027_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred1029_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred1030_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred1033_fml) (struct fmlParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred1035_fml) (struct fmlParser_Ctx_struct * ctx);
+ // Delegated rules
+
+ const char * (*getGrammarFileName)();
+ void (*reset) (struct fmlParser_Ctx_struct * ctx);
+ void (*free) (struct fmlParser_Ctx_struct * ctx);
+};
+
+// Function protoypes for the constructor functions that external translation units
+// such as delegators and delegates may wish to call.
+//
+ANTLR3_API pfmlParser fmlParserNew (
+pANTLR3_COMMON_TOKEN_STREAM
+ instream);
+ANTLR3_API pfmlParser fmlParserNewSSD (
+pANTLR3_COMMON_TOKEN_STREAM
+ instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
+
+/** Symbolic definitions of all the tokens that the
+parser
+ will work with.
+ * \{
+ *
+ * Antlr will define EOF, but we can't use that as it it is too common in
+ * in C header files and that would be confusing. There is no way to filter this out at the moment
+ * so we just undef it here for now. That isn't the value we get back from C recognizers
+ * anyway. We are looking for ANTLR3_TOKEN_EOF.
+ */
+#ifdef EOF
+#undef EOF
+#endif
+#ifdef Tokens
+#undef Tokens
+#endif
+#define EOF -1
+#define T__144 144
+#define T__145 145
+#define T__146 146
+#define T__147 147
+#define T__148 148
+#define T__149 149
+#define T__150 150
+#define T__151 151
+#define T__152 152
+#define T__153 153
+#define T__154 154
+#define T__155 155
+#define T__156 156
+#define T__157 157
+#define T__158 158
+#define T__159 159
+#define T__160 160
+#define T__161 161
+#define T__162 162
+#define T__163 163
+#define T__164 164
+#define T__165 165
+#define T__166 166
+#define T__167 167
+#define T__168 168
+#define T__169 169
+#define T__170 170
+#define T__171 171
+#define T__172 172
+#define T__173 173
+#define T__174 174
+#define T__175 175
+#define T__176 176
+#define T__177 177
+#define T__178 178
+#define T__179 179
+#define T__180 180
+#define T__181 181
+#define T__182 182
+#define T__183 183
+#define T__184 184
+#define T__185 185
+#define T__186 186
+#define T__187 187
+#define T__188 188
+#define T__189 189
+#define T__190 190
+#define T__191 191
+#define T__192 192
+#define T__193 193
+#define T__194 194
+#define T__195 195
+#define T__196 196
+#define T__197 197
+#define T__198 198
+#define T__199 199
+#define T__200 200
+#define T__201 201
+#define T__202 202
+#define T__203 203
+#define T__204 204
+#define T__205 205
+#define T__206 206
+#define T__207 207
+#define T__208 208
+#define T__209 209
+#define T__210 210
+#define T__211 211
+#define T__212 212
+#define T__213 213
+#define T__214 214
+#define T__215 215
+#define T__216 216
+#define T__217 217
+#define T__218 218
+#define T__219 219
+#define T__220 220
+#define T__221 221
+#define T__222 222
+#define T__223 223
+#define T__224 224
+#define T__225 225
+#define T__226 226
+#define T__227 227
+#define T__228 228
+#define T__229 229
+#define T__230 230
+#define T__231 231
+#define T__232 232
+#define T__233 233
+#define T__234 234
+#define T__235 235
+#define T__236 236
+#define T__237 237
+#define T__238 238
+#define T__239 239
+#define T__240 240
+#define T__241 241
+#define T__242 242
+#define T__243 243
+#define T__244 244
+#define T__245 245
+#define T__246 246
+#define T__247 247
+#define T__248 248
+#define T__249 249
+#define T__250 250
+#define T__251 251
+#define T__252 252
+#define T__253 253
+#define T__254 254
+#define T__255 255
+#define T__256 256
+#define T__257 257
+#define T__258 258
+#define T__259 259
+#define T__260 260
+#define T__261 261
+#define T__262 262
+#define T__263 263
+#define T__264 264
+#define T__265 265
+#define T__266 266
+#define T__267 267
+#define T__268 268
+#define T__269 269
+#define T__270 270
+#define T__271 271
+#define T__272 272
+#define T__273 273
+#define T__274 274
+#define T__275 275
+#define T__276 276
+#define T__277 277
+#define T__278 278
+#define T__279 279
+#define T__280 280
+#define T__281 281
+#define T__282 282
+#define T__283 283
+#define T__284 284
+#define T__285 285
+#define T__286 286
+#define T__287 287
+#define T__288 288
+#define T__289 289
+#define T__290 290
+#define T__291 291
+#define T__292 292
+#define T__293 293
+#define T__294 294
+#define T__295 295
+#define T__296 296
+#define T__297 297
+#define T__298 298
+#define T__299 299
+#define T__300 300
+#define T__301 301
+#define T__302 302
+#define T__303 303
+#define T__304 304
+#define T__305 305
+#define T__306 306
+#define T__307 307
+#define T__308 308
+#define T__309 309
+#define T__310 310
+#define T__311 311
+#define T__312 312
+#define T__313 313
+#define T__314 314
+#define T__315 315
+#define T__316 316
+#define T__317 317
+#define T__318 318
+#define T__319 319
+#define T__320 320
+#define T__321 321
+#define T__322 322
+#define T__323 323
+#define T__324 324
+#define T__325 325
+#define T__326 326
+#define T__327 327
+#define T__328 328
+#define T__329 329
+#define T__330 330
+#define T__331 331
+#define T__332 332
+#define T__333 333
+#define T__334 334
+#define T__335 335
+#define T__336 336
+#define T__337 337
+#define T__338 338
+#define T__339 339
+#define T__340 340
+#define T__341 341
+#define T__342 342
+#define T__343 343
+#define T__344 344
+#define T__345 345
+#define T__346 346
+#define T__347 347
+#define T__348 348
+#define T__349 349
+#define T__350 350
+#define T__351 351
+#define T__352 352
+#define T__353 353
+#define T__354 354
+#define T__355 355
+#define T__356 356
+#define T__357 357
+#define T__358 358
+#define T__359 359
+#define T__360 360
+#define T__361 361
+#define T__362 362
+#define T__363 363
+#define T__364 364
+#define T__365 365
+#define T__366 366
+#define T__367 367
+#define T__368 368
+#define T__369 369
+#define T__370 370
+#define T__371 371
+#define T__372 372
+#define T__373 373
+#define T__374 374
+#define T__375 375
+#define T__376 376
+#define T__377 377
+#define T__378 378
+#define T__379 379
+#define T__380 380
+#define T__381 381
+#define T__382 382
+#define T__383 383
+#define T__384 384
+#define T__385 385
+#define T__386 386
+#define T__387 387
+#define T__388 388
+#define T__389 389
+#define T__390 390
+#define T__391 391
+#define T__392 392
+#define T__393 393
+#define T__394 394
+#define T__395 395
+#define T__396 396
+#define T__397 397
+#define T__398 398
+#define T__399 399
+#define T__400 400
+#define T__401 401
+#define T__402 402
+#define T__403 403
+#define T__404 404
+#define T__405 405
+#define T__406 406
+#define T__407 407
+#define T__408 408
+#define T__409 409
+#define T__410 410
+#define T__411 411
+#define T__412 412
+#define T__413 413
+#define T__414 414
+#define T__415 415
+#define T__416 416
+#define T__417 417
+#define ASSIGN 4
+#define ASSIGN_AFTER 5
+#define ASSIGN_MACRO 6
+#define ASSIGN_REF 7
+#define AT_ID 8
+#define BAND 9
+#define BAND_ASSIGN 10
+#define BAND_ASSIGN_AFTER 11
+#define BAR_RBRACKET 12
+#define BNOT 13
+#define BOR 14
+#define BOR_ASSIGN 15
+#define BOR_ASSIGN_AFTER 16
+#define BXOR 17
+#define BXOR_ASSIGN 18
+#define BXOR_ASSIGN_AFTER 19
+#define Binary 20
+#define COLON 21
+#define COLONx2 22
+#define COMMA 23
+#define COMMENT 24
+#define CharLiteral 25
+#define DECR 26
+#define DIESE 27
+#define DIV 28
+#define DIV_ASSIGN 29
+#define DIV_ASSIGN_AFTER 30
+#define DOLLAR 31
+#define DOLLAR_LCURLY 32
+#define DOT 33
+#define DOTDOT 34
+#define Decimal 35
+#define DecimalDigit 36
+#define DecimalDigits 37
+#define DecimalExponent 38
+#define EQUAL 39
+#define ESC_SEQ 40
+#define EXPONENT 41
+#define Float 42
+#define FloatLiteral 43
+#define FloatTypeSuffix 44
+#define GT 45
+#define GTE 46
+#define HEX_DIGIT 47
+#define HexDigit 48
+#define Hexadecimal 49
+#define ID 50
+#define INCR 51
+#define ImaginarySuffix 52
+#define IntSuffix 53
+#define Integer 54
+#define IntegerLiteral 55
+#define LAND 56
+#define LAND_ASSIGN 57
+#define LAND_ASSIGN_AFTER 58
+#define LAND_THEN 59
+#define LBRACKET 60
+#define LBRACKET_BAR 61
+#define LBRACKET_EXCEPT 62
+#define LBRACKET_LCURLY 63
+#define LCURLY 64
+#define LCURLY_INVOKE 65
+#define LNOT 66
+#define LOR 67
+#define LOR_ASSIGN 68
+#define LOR_ASSIGN_AFTER 69
+#define LOR_ELSE 70
+#define LPAREN 71
+#define LPAREN_INVOKE 72
+#define LSHIFT 73
+#define LSHIFT_ASSIGN 74
+#define LSHIFT_ASSIGN_AFTER 75
+#define LTE 76
+#define LT_ 77
+#define LXOR 78
+#define MINUS 79
+#define MINUS_ASSIGN 80
+#define MINUS_ASSIGN_AFTER 81
+#define MOD 82
+#define MOD_ASSIGN 83
+#define MOD_ASSIGN_AFTER 84
+#define NEQUAL 85
+#define NSEQUAL 86
+#define NumberLiteral 87
+#define OCTAL_ESC 88
+#define OP_ASSIGN_TOP 89
+#define OP_ATOMIC_SEQUENCE 90
+#define OP_CONCURRENCY_AND 91
+#define OP_CONCURRENCY_ASYNC 92
+#define OP_CONCURRENCY_INTERLEAVING 93
+#define OP_CONCURRENCY_OR 94
+#define OP_CONCURRENCY_PARALLEL 95
+#define OP_CONCURRENCY_RDV_AND 96
+#define OP_CONCURRENCY_RDV_ASYNC 97
+#define OP_CONCURRENCY_RDV_INTERLEAVING 98
+#define OP_CONCURRENCY_RDV_OR 99
+#define OP_CONCURRENCY_RDV_PARALLEL 100
+#define OP_FORK 101
+#define OP_JOIN 102
+#define OP_NON_DETERMINISM 103
+#define OP_POP 104
+#define OP_PUSH 105
+#define OP_SCHEDULE_AND_THEN 106
+#define OP_SCHEDULE_GT 107
+#define OP_SCHEDULE_LT 108
+#define OP_SCHEDULE_OR_ELSE 109
+#define OP_SCHEDULE_XOR 110
+#define OP_SEQUENCE 111
+#define OP_SEQUENCE_SIDE 112
+#define OP_SEQUENCE_WEAK 113
+#define OP_TOP 114
+#define Octal 115
+#define OctalDigit 116
+#define PERCENT_LCURLY 117
+#define PERCENT_LPAREN 118
+#define PERCENT_LPAREN_INVOKE 119
+#define PLUS 120
+#define PLUS_ASSIGN 121
+#define PLUS_ASSIGN_AFTER 122
+#define QUESTION 123
+#define RBRACKET 124
+#define RCURLY 125
+#define RCURLY_DOLLAR 126
+#define RCURLY_PERCENT 127
+#define RCURLY_RBRACKET 128
+#define RPAREN 129
+#define RPAREN_PERCENT 130
+#define RSHIFT 131
+#define RSHIFT_ASSIGN 132
+#define RSHIFT_ASSIGN_AFTER 133
+#define RationalLiteral 134
+#define SEMI 135
+#define SEQUAL 136
+#define STAR 137
+#define STAR_ASSIGN 138
+#define STAR_ASSIGN_AFTER 139
+#define STATEMENT_PROMPT 140
+#define StringLiteral 141
+#define UNICODE_ESC 142
+#define WS 143
+#ifdef EOF
+#undef EOF
+#define EOF ANTLR3_TOKEN_EOF
+#endif
+
+#ifndef TOKENSOURCE
+#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
+#endif
+
+/* End of token definitions for fmlParser
+ * =============================================================================
+ */
+/** } */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+/* END - Note:Keep extra line feed to satisfy UNIX systems */
diff --git a/org.eclipse.efm.symbex/src/parser/workflow/.gitignore b/org.eclipse.efm.symbex/src/parser/workflow/.gitignore
new file mode 100644
index 0000000..4b198e7
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/parser/workflow/.gitignore
@@ -0,0 +1,6 @@
+/WorkflowLexer.cpp
+/WorkflowLexer.hpp
+/WorkflowParser.cpp
+/WorkflowParser.hpp
+/WorkflowParserTokenTypes.hpp
+/WorkflowParserTokenTypes.txt
diff --git a/org.eclipse.efm.symbex/src/parser/workflow/Workflow.g b/org.eclipse.efm.symbex/src/parser/workflow/Workflow.g
new file mode 100644
index 0000000..f15d451
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/parser/workflow/Workflow.g
@@ -0,0 +1,1797 @@
+
+/* CPP */
+header "pre_include_hpp"
+{
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ *******************************************************************************/
+
+#include <string>
+
+#include <common/Element.h>
+#include <common/NamedElement.h>
+#include <common/BF.h>
+
+#include <parser/model/ParserUtil.h>
+
+#include <fml/common/LocationElement.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/BuiltinArray.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/StatementConstructor.h>
+
+#include <fml/operator/Operator.h>
+#include <fml/operator/OperatorManager.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/UniFormIdentifier.h>
+
+#include <fml/workflow/WObject.h>
+
+}
+
+
+options
+{
+ language = "Cpp";
+ namespace = "sep";
+ namespaceStd = "std";
+ namespaceAntlr = "antlr";
+ genHashLines = false; // too many compiler warnings when generating #line statements
+}
+/* end CPP */
+
+
+class WorkflowParser extends Parser;
+
+options
+{
+ defaultErrorHandler = true;
+ codeGenMakeSwitchThreshold = 10;
+
+// backtrack = true;
+ k = 4;
+}
+
+
+{
+
+
+private:
+ avm_size_t noOfErrors;
+
+ WObjectManager * mWObjectManager;
+
+
+public:
+
+avm_size_t hasError() const
+{
+ return( noOfErrors > 0 );
+}
+
+avm_size_t numberOfErrors() const
+{
+ return noOfErrors;
+}
+
+void resetErrors()
+{
+ noOfErrors = 0;
+}
+
+static const std::string versionInfo()
+{
+ static std::string info = "$Id: LiaParser.g, v 0.1 2005/08/23 Lapitre $";
+
+ return info;
+}
+
+
+protected:
+
+void reportError( const std::string & errorMessage )
+{
+ reportMessage( errorMessage );
+ ++noOfErrors;
+}
+
+void reportError( const antlr::RecognitionException & ex )
+{
+ AVM_OS_CERR << std::endl << ex.toString().c_str();
+ ++noOfErrors;
+}
+
+void reportMessage( const std::string & message )
+{
+ if( getFilename().length() > 0 )
+ {
+ AVM_OS_CERR << getFilename() << ":";
+ }
+
+ AVM_OS_CERR << LT( 1 ) -> getLine() << ":" << LT( 1 )->getColumn()
+ << " [error] " << message << std::endl;
+}
+
+
+
+void setLocation(WObject * wfObject, int bLine, int eLine,
+ int bOffset, int eOffset)
+{
+ wfObject->setLocation(getFilename(), bLine, eLine);
+}
+
+void setLocation(TraceableElement & aTraceableElement, int bLine, int eLine,
+ int bOffset, int eOffset)
+{
+ aTraceableElement.setLocation(getFilename(), bLine, eLine);
+}
+
+void setLocation(TraceableElement * aTraceableElement, int bLine, int eLine,
+ int bOffset, int eOffset)
+{
+ aTraceableElement->setLocation(getFilename(), bLine, eLine);
+}
+
+
+void setLocation(TraceableElement * aTraceableElement, int bLine, int eLine)
+{
+ aTraceableElement->setLocation(getFilename(), bLine, eLine);
+}
+
+
+int getNextTokenLine()
+{
+ return( LT(1)->getLine() );
+}
+
+int getNextTokenStartIndex()
+{
+ return 1;//( LT(1).getLine() );
+}
+
+int getNextTokenStopIndex()
+{
+ return 1;//( LT(1).getLine() );
+}
+
+
+void addElement(WObject * wfContainer, WObject * wfObject)
+{
+ if( (wfContainer != WObject::_NULL_) && (wfObject != WObject::_NULL_) )
+ {
+ wfContainer->append( wfObject );
+ }
+}
+
+
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// UNIQ FORM IDENTIFIER
+////////////////////////////////////////////////////////////////////////////////
+
+qualifiedNameID returns [ std::string qNameID ]
+ : ( "form"
+ ( COLON_SLASH { qNameID = std::string("form") + FQN_ID_SCHEME_PATH_SEPARATOR; }
+ | COLON2 { qNameID = std::string("form") + FQN_ID_ROOT_SEPARATOR; }
+ )
+ | "meta"
+ ( COLON_SLASH { qNameID = std::string("meta") + FQN_ID_SCHEME_PATH_SEPARATOR; }
+ | COLON2 { qNameID = std::string("meta") + FQN_ID_ROOT_SEPARATOR; }
+ )
+
+ | id:Identifier
+ ( COLON_SLASH { qNameID = id->getText() + FQN_ID_SCHEME_PATH_SEPARATOR; }
+ | COLON2 { qNameID = id->getText() + FQN_ID_ROOT_SEPARATOR; }
+ )
+
+ | COLON_SLASH { qNameID = FQN_ID_SCHEME_PATH_SEPARATOR; }
+ | COLON2 { qNameID = FQN_ID_ROOT_SEPARATOR; }
+ )?
+
+ id2:Identifier { qNameID = qNameID + id2->getText(); }
+
+ ( DOT
+ ( id3:Identifier
+ | kw_public | kw_static
+ | kw_final | kw_volatile
+ | kw_reference | kw_buffered
+ )
+ { qNameID = qNameID + "." + id3->getText(); }
+ )*
+ ;
+
+
+ufiString returns [ BF bfUFI ]
+{
+ std::string s;
+
+ UniFormIdentifier * UFI = new UniFormIdentifier(false);
+ bfUFI = UFI; // for automatic destruction of << UFI >> if need
+
+ BF ap;
+
+ int bLine = getNextTokenLine();
+ int bOffset = getNextTokenStartIndex();
+}
+ : ( ( "form" COLON2 { UFI->setLocator( "form" ); UFI->setAbsolute(); } )
+ | ( "meta" COLON2 { UFI->setLocator( "meta" ); UFI->setAbsolute(); } )
+
+ | ( id:Identifier COLON2
+ { UFI->setLocator( id->getText() ); UFI->setAbsolute(); } )
+
+ | COLON2 { UFI->setAbsolute(); }
+ )?
+
+ id2:Identifier { UFI->appendField( id2->getText() ); }
+
+ ( DOT
+ ( id3:Identifier { UFI->appendField( id3->getText() ); }
+ | kw_public { UFI->appendField( "public" ); }
+ | kw_static { UFI->appendField( "static" ); }
+ | kw_final { UFI->appendField( "final" ); }
+ | kw_volatile { UFI->appendField( "volatile" ); }
+ | kw_reference { UFI->appendField( "reference" ); }
+ | kw_buffered { UFI->appendField( "buffered" ); }
+ )
+
+ | ( LBRACK avmProgram[WObject::_NULL_] RBRACK )
+ => LBRACK ap=avmProgram[WObject::_NULL_] RBRACK { UFI->appendIndex( ap ); }
+ )*
+
+ {
+ if( UFI->isPureIdentifier() )
+ {
+ bfUFI = UFI->popIdentifier();
+ }
+ else
+ {
+ setLocation(UFI, bLine, bLine, bOffset, getNextTokenStopIndex());
+ }
+ }
+ ;
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// KEYWORD XLIA
+////////////////////////////////////////////////////////////////////////////////
+
+
+kw_public
+// : { LT(1)->getText() == "public" }? Identifier
+ : "public"
+ ;
+
+kw_static
+// : { LT(1)->getText() == "static" }? Identifier
+ : "static"
+ ;
+
+kw_final
+// : { LT(1)->getText() == "final" }? Identifier
+ : "final"
+ ;
+
+kw_reference
+// : { LT(1)->getText() == "reference" }? Identifier
+ : "reference"
+ ;
+
+kw_buffered
+// : { LT(1)->getText() == "buffered" }? Identifier
+ : "buffered"
+ ;
+
+kw_volatile
+// : { LT(1)->getText() == "volatile" }? Identifier
+ : "volatile"
+ ;
+
+
+kw_form
+// : { LT(1)->getText() == "form" }? Identifier
+ : "form"
+ ;
+
+kw_endform
+// : { LT(1)->getText() == "endform" }? Identifier
+ : "endform"
+ ;
+
+kw_prototype
+// : { LT(1)->getText() == "prototype" }? Identifier
+ : "prototype"
+ ;
+
+kw_endprototype
+// : { LT(1)->getText() == "endprototype" }? Identifier
+ : "endprototype"
+ ;
+
+
+kw_as
+// : { LT(1)->getText() == "as" }? Identifier
+ : "as"
+ ;
+
+kw_is
+// : { LT(1)->getText() == "is" }? Identifier
+ : "is"
+ ;
+
+////////////////////////////////////////////////////////////////////////////////
+///// GRAMMAR FILE DEFINITION
+////////////////////////////////////////////////////////////////////////////////
+
+favmProlog
+ : ( Attr_DIVERSITY | Attr_SEW | Attr_FAVM )
+ LT_
+ Identifier //( "workflow" | "configuration" )
+ ( COMMA ( FloatingPointNumber | UFI | EString ) )*
+ GT_COLON
+ ;
+
+
+form_grammar[ WObjectManager & aWObjectManager ]
+returns [ WObject * wfObject = WObject::_NULL_ ]
+{
+ mWObjectManager = &( aWObjectManager );
+}
+ : ( favmProlog )?
+ ( wfObject=aNormalForm[ &( mWObjectManager->ROOT_WOBJECT ) ]
+ | wfObject=aWorkflow [ &( mWObjectManager->ROOT_WOBJECT ) ]
+ )
+ {
+ wfObject->setContainer(WObject::_NULL_);
+
+ if( hasError() )
+ {
+ AVM_OS_CERR << std::endl;
+ }
+ }
+ ;
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// WORKFLOW CONFIGURATION DEFINITION
+////////////////////////////////////////////////////////////////////////////////
+
+aWorkflow [ WObject * wfContainer ]
+returns [ WObject * wfObject = WObject::_NULL_ ]
+{
+ wfObject = mWObjectManager->newWObject(wfContainer, "", "");
+
+ int bLine = getNextTokenLine();
+ int bOffset = getNextTokenStartIndex();
+}
+ : aWorkflowObject[wfContainer, wfObject, bLine, bOffset]
+ ;
+
+
+aWorkflowObject[ WObject * wfContainer , WObject * wfObject , int bLine , int bOffset ]
+{
+ WObject * wobject = WObject::_NULL_;
+
+ std::string qnid = "workflow";
+}
+ : qnid=qualifiedNameID { wfObject->setQualifiedTypeNameID( qnid ); }
+
+ ( qnid=qualifiedNameID )?
+ {
+ if( NamedElement::isRelative(qnid) )
+ {
+ mWObjectManager->registerWObject(wfObject, qnid);
+
+ qnid = mWObjectManager->makeFQN( wfContainer, qnid );
+ }
+ wfObject->setFullyQualifiedNameID(qnid);
+
+ mWObjectManager->registerWObject( wfObject );
+ }
+
+ ( dqs:DoubleQuotedString { wfObject->setUnrestrictedName( dqs->getText() ); }
+ | sqs:SingleQuotedString { wfObject->setUnrestrictedName( sqs->getText() ); }
+ )?
+
+ LCURLY
+
+ ( wobject=aComponent[wfObject] { addElement(wfObject, wobject); } )*
+
+ { setLocation(wfObject, bLine, getNextTokenLine(), bOffset, getNextTokenStopIndex()); }
+ RCURLY
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// NORMAL FORM DEFINITION
+////////////////////////////////////////////////////////////////////////////////
+
+formHEADER [ WObject * wfContainer, WObject * wfObject ]
+{
+ std::string qnid = "";
+}
+ : qnid=qualifiedNameID
+ {
+ if( NamedElement::isRelative(qnid) ) {
+ mWObjectManager->registerWObject(wfObject, qnid);
+
+ qnid = mWObjectManager->makeFQN( wfContainer, qnid );
+ }
+ wfObject->setFullyQualifiedNameID(qnid);
+
+ mWObjectManager->registerWObject( wfObject );
+ }
+
+ ( dqs:DoubleQuotedString { wfObject->setUnrestrictedName( dqs->getText() ); }
+ | sqs:SingleQuotedString { wfObject->setUnrestrictedName( sqs->getText() ); }
+ )?
+
+ kw_as ( BAND )? qnid=qualifiedNameID
+ { wfObject->setQualifiedTypeNameID( qnid ); }
+ ;
+
+
+formBODY[ WObject * wfContainer , WObject * wfObject]
+{
+ WObject * wobject = WObject::_NULL_;
+}
+ : kw_is ( wobject=aComponent[wfObject] { addElement(wfObject, wobject); } )*
+ ;
+
+
+
+formDECL [ WObject * wfContainer , WObject * wfObject]
+ : formHEADER[wfContainer, wfObject]
+
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PARSING )
+ AVM_OS_TRACE << INCR_INDENT_TAB << "parsing wfObject :> "
+ << str_header( wfObject ) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PARSING )
+ }
+
+ ( formBODY[wfContainer, wfObject] )?
+
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PARSING )
+ AVM_OS_TRACE << TAB_DECR_INDENT << "end" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PARSING )
+ }
+ ;
+
+
+aNormalForm[ WObject * wfContainer ]
+returns [ WObject * wfObject = WObject::_NULL_ ]
+{
+ wfObject = mWObjectManager->newWObject(wfContainer, "", "");
+
+ int bLine = getNextTokenLine();
+ int bOffset = getNextTokenStartIndex();
+}
+ : aForm[wfContainer, wfObject, bLine, bOffset]
+
+ | aPrototype[wfContainer, wfObject, bLine, bOffset]
+
+ | aWObject[wfContainer, wfObject, bLine, bOffset]
+ ;
+
+
+aWObject[ WObject * wfContainer , WObject * wfObject , int bLine , int bOffset ]
+{
+ WObject * wobject = WObject::_NULL_;
+
+ std::string qnid = "";
+}
+ : qnid=qualifiedNameID { wfObject->setQualifiedTypeNameID( qnid ); }
+
+ ( qnid=qualifiedNameID )?
+ {
+ if( NamedElement::isRelative(qnid) ) {
+ mWObjectManager->registerWObject(wfObject, qnid);
+
+ qnid = mWObjectManager->makeFQN( wfContainer, qnid );
+ }
+ wfObject->setFullyQualifiedNameID(qnid);
+
+ mWObjectManager->registerWObject( wfObject );
+ }
+
+ ( dqs:DoubleQuotedString { wfObject->setUnrestrictedName( dqs->getText() ); }
+ | sqs:SingleQuotedString { wfObject->setUnrestrictedName( sqs->getText() ); }
+ )?
+
+ LCURLY
+
+ ( wobject=aComponent[wfObject] { addElement(wfObject, wobject); } )*
+
+ { setLocation(wfObject, bLine, getNextTokenLine(), bOffset, getNextTokenStopIndex()); }
+ RCURLY
+ ;
+
+
+aForm[ WObject * wfContainer , WObject * wfObject , int bLine , int bOffset ]
+ : kw_form
+
+ formDECL[wfContainer, wfObject]
+
+ { setLocation(wfObject, bLine, getNextTokenLine(), bOffset, getNextTokenStopIndex()); }
+ kw_endform
+ ;
+
+
+aPrototype[ WObject * wfContainer , WObject * wfObject , int bLine , int bOffset ]
+ : kw_prototype
+
+ formDECL[wfContainer, wfObject]
+
+ { setLocation(wfObject, bLine, getNextTokenLine(), bOffset, getNextTokenStopIndex()); }
+ kw_endprototype
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// COMPONENT DEFINITION
+////////////////////////////////////////////////////////////////////////////////
+
+aComponent [ WObject * wfContainer ]
+returns [ WObject * wfObject = WObject::_NULL_ ]
+ : wfObject=aWProperty[wfContainer]
+
+ | wfObject=aWSequence[wfContainer]
+
+ | wfObject=aNormalForm[wfContainer]
+
+ | wfObject=tagProgram[wfContainer]
+ ;
+
+
+//////////////////////////////////////////////////////////////////////////////
+///// section <% ID %>
+////////////////////////////////////////////////////////////////////////////////
+
+aSequenceComponent [ WObject * wfContainer ]
+returns [ WObject * wfObject = WObject::_NULL_ ]
+ : wfObject=aWProperty[wfContainer]
+
+ | wfObject=aNormalForm[wfContainer]
+
+ | wfObject=tagProgram[wfContainer]
+ ;
+
+
+aWSequence [ WObject * wfContainer ] returns [ WObject * section = WObject::_NULL_ ]
+{
+ WObject * wobject = WObject::_NULL_;
+
+ int bLine = getNextTokenLine();
+ int bOffset = getNextTokenStartIndex();
+}
+ : // lvi:LeftValueIdentifier
+ lvi:Identifier
+ {
+ section = mWObjectManager->newWSequence(wfContainer, lvi->getText());
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PARSING )
+ AVM_OS_TRACE << TAB << "=>@section :> " << section->getNameID() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PARSING )
+ }
+
+ ( dqs:DoubleQuotedString { section->setUnrestrictedName( dqs->getText() ); }
+ | sqs:SingleQuotedString { section->setUnrestrictedName( sqs->getText() ); }
+ )?
+ LBRACK
+
+ ( wobject=aSequenceComponent[section] { addElement(section, wobject); } )*
+
+ { setLocation(section, bLine, getNextTokenLine(), bOffset, getNextTokenStopIndex()); }
+ RBRACK
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DEPRECATED SYNTAX
+
+ | lvic:Identifier COLON
+ {
+ section = mWObjectManager->newWSequence(wfContainer, lvic->getText());
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PARSING )
+ AVM_OS_TRACE << TAB << "=>@section :> " << section->getNameID() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PARSING )
+ }
+
+ ( wobject=aSequenceComponent[section] { addElement(section, wobject); } )*
+
+ { setLocation(section, bLine, getNextTokenLine(), bOffset, getNextTokenStopIndex()); }
+
+ | at_lv:AtLeftValueIdentifier COLON
+ {
+ section = mWObjectManager->newWSequence(wfContainer, at_lv->getText());
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PARSING )
+ AVM_OS_TRACE << TAB << "=>@section :> " << section->getNameID() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PARSING )
+ }
+
+ ( wobject=aSequenceComponent[section] { addElement(section, wobject); } )*
+
+ { setLocation(section, bLine, getNextTokenLine(), bOffset, getNextTokenStopIndex()); }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DEPRECATED SYNTAX
+
+ | "section" id:Identifier
+ {
+ section = mWObjectManager->newWSequence(wfContainer, id->getText());
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , PARSING )
+ AVM_OS_TRACE << TAB << "=>section :> " << section->getNameID() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , PARSING )
+ }
+
+ ( wobject=aComponent[section] { addElement(section, wobject); } )*
+
+ { setLocation(section, bLine, getNextTokenLine(), bOffset, getNextTokenStopIndex()); }
+ "endsection" { LT(1)->getText() == id->getText() }? eId:Identifier
+ //{ setLocation(section, bLine, eId.getLine(), bOffset, ((Token) (eId)).getStopIndex()); }
+ ;
+
+
+
+
+//////////////////////////////////////////////////////////////////////////////
+///// ATTRIBUT
+////////////////////////////////////////////////////////////////////////////////
+
+aWProperty [ WObject * wfContainer ]
+returns [ WObject * wfProperty = WObject::_NULL_ ]
+{
+ AVM_OPCODE op;
+
+ int bLine = getNextTokenLine();
+ int bOffset = getNextTokenStartIndex();
+}
+///// PREDEFINED ATTRIBUT
+ : ( Attr_UFI EQ wfProperty=aWPropertyValue[wfContainer, "ufi"]
+
+ | Attr_NAME EQ wfProperty=aWPropertyValue[wfContainer, "name"]
+
+ | Attr_TYPE EQ wfProperty=aWPropertyValue[wfContainer, "type"]
+
+ | Attr_DESIGN EQ wfProperty=aWPropertyValue[wfContainer, "design"]
+
+
+ | Attr_PUBLIC EQ wfProperty=aWPropertyValue[wfContainer, "public"]
+
+ | Attr_STATIC EQ wfProperty=aWPropertyValue[wfContainer, "static"]
+
+ | Attr_FINAL EQ wfProperty=aWPropertyValue[wfContainer, "final"]
+
+
+ | Attr_VOLATILE EQ wfProperty=aWPropertyValue[wfContainer, "volatile"]
+
+ | Attr_REFERENCE EQ wfProperty=aWPropertyValue[wfContainer, "reference"]
+
+
+ | "form" op=anAssignOp wfProperty=aWPropertyValue[wfContainer, "form"]
+ { wfProperty->setSpecifierOp( op ); }
+
+ | "meta" op=anAssignOp wfProperty=aWPropertyValue[wfContainer, "meta"]
+ { wfProperty->setSpecifierOp( op ); }
+
+
+ | at_lv:AtLeftValueIdentifier op=anAssignOp
+ wfProperty=aWPropertyValue[wfContainer, at_lv->getText()]
+ { wfProperty->setSpecifierOp( op ); }
+
+
+ | lv:Identifier op=anAssignOp
+ wfProperty=aWPropertyValue[wfContainer, lv->getText()]
+ { wfProperty->setSpecifierOp( op ); }
+ )
+
+ { setLocation(wfProperty, bLine, getNextTokenLine(), bOffset, getNextTokenStopIndex()); }
+ ( SEMI )?
+ ;
+
+
+anAssignOp returns [ AVM_OPCODE op ]
+ : ASSIGN { op = AVM_OPCODE_ASSIGN; }
+
+ | EQ { op = AVM_OPCODE_EQ; }
+ | EQEQ { op = AVM_OPCODE_EQ; }
+ | NEQ { op = AVM_OPCODE_NEQ; }
+
+ | SEQ { op = AVM_OPCODE_SEQ; }
+ | NSEQ { op = AVM_OPCODE_NSEQ; }
+
+ | BANDEQ { op = AVM_OPCODE_BAND; }
+ | BOREQ { op = AVM_OPCODE_BOR; }
+ | BXOREQ { op = AVM_OPCODE_BXOR; }
+ | BNOTEQ { op = AVM_OPCODE_BNOT; }
+
+ | PLUSEQ { op = AVM_OPCODE_PLUS; }
+ | MINUSEQ { op = AVM_OPCODE_MINUS; }
+ | MULTEQ { op = AVM_OPCODE_MULT; }
+ | DIVEQ { op = AVM_OPCODE_DIV; }
+ | MODEQ { op = AVM_OPCODE_MOD; }
+
+ | GT { op = AVM_OPCODE_GT; }
+ | GTE { op = AVM_OPCODE_GTE; }
+ | LT_ { op = AVM_OPCODE_LT; }
+ | LTE { op = AVM_OPCODE_LTE; }
+ ;
+
+
+aWPropertyValue [ WObject * wfContainer , const std::string & aNameID ]
+returns [ WObject * wfProperty = WObject::_NULL_ ]
+{
+ BF value;
+
+ BFCode prog;
+ Operator * op = NULL;
+ BF ap;
+}
+// : value=avmProgram[wfContainer]
+// { wfProperty = mWObjectManager->newWProperty(wfContainer, aNameID, value); }
+// ;
+
+ : LPROG op=anOperator { value = prog = StatementConstructor::newCode(op); }
+
+ ( ap=avmProgram[wfContainer] { prog->append(ap); } )*
+
+ //{ setLocation(prog, bLine, getNextTokenLine(), bOffset, getNextTokenStopIndex()); }
+ RCURLY
+ {
+ if( prog.invalid() || (op == NULL) )
+ {
+ //!! PARSE ERROR !!
+ }
+ else if( op->isOpCode( AVM_OPCODE_MINUS ) && (prog->size() == 1) )
+ {
+ prog->setOperator( OperatorManager::OPERATOR_UMINUS );
+ }
+ else if( op->isOpCode( AVM_OPCODE_IF ) && (prog->size() == 3) )
+ {
+ prog->setOperator( OperatorManager::OPERATOR_IFE );
+ }
+ else if( op->isOpCode( AVM_OPCODE_IFE ) && (prog->size() == 2) )
+ {
+ prog->setOperator( OperatorManager::OPERATOR_IF );
+ }
+
+ wfProperty = mWObjectManager
+ ->newWPropertyExpression(wfContainer, aNameID, value);
+ }
+
+ | LPAREN value=expression RPAREN
+ { wfProperty = mWObjectManager
+ ->newWPropertyExpression(wfContainer, aNameID, value); }
+
+ | value=expression_invoke
+ { wfProperty = mWObjectManager
+ ->newWPropertyExpression(wfContainer, aNameID, value); }
+
+ | "true"
+ { wfProperty = mWObjectManager
+ ->newWPropertyBoolean(wfContainer, aNameID, true); }
+
+ | "false"
+ { wfProperty = mWObjectManager->newWPropertyBoolean(
+ wfContainer, aNameID, false); }
+
+ | MINUS mn:IntegerNumber
+ { wfProperty = mWObjectManager
+ ->newWPropertyInteger(wfContainer, aNameID, "-" + mn->getText()); }
+
+ | PLUS pn:IntegerNumber
+ { wfProperty = mWObjectManager
+ ->newWPropertyInteger(wfContainer, aNameID, pn->getText()); }
+
+ | n:IntegerNumber
+ { wfProperty = mWObjectManager
+ ->newWPropertyInteger(wfContainer, aNameID, n->getText()); }
+
+ | MINUS mf:FloatingPointNumber
+ { wfProperty = mWObjectManager
+ ->newWPropertyFloat(wfContainer, aNameID, "-" + mf->getText()); }
+
+ | PLUS pf:FloatingPointNumber
+ { wfProperty = mWObjectManager
+ ->newWPropertyFloat(wfContainer, aNameID, pf->getText()); }
+
+ | f:FloatingPointNumber
+ { wfProperty = mWObjectManager
+ ->newWPropertyFloat(wfContainer, aNameID, f->getText()); }
+
+ | cl:CharacterLiteral
+ { wfProperty = mWObjectManager->newWPropertyCharacter(
+ wfContainer, aNameID, cl->getText().c_str()[0]); }
+
+ | dqs:DoubleQuotedString
+ { wfProperty = mWObjectManager->newWPropertyDoubleQuoteString(
+ wfContainer, aNameID, dqs->getText()); }
+
+ | sqs:SingleQuotedString
+ { wfProperty = mWObjectManager->newWPropertySingleQuoteString(
+ wfContainer, aNameID, sqs->getText()); }
+
+ | value=ufiString
+ { wfProperty = mWObjectManager
+ ->newWPropertyParsedIdentifier(wfContainer, aNameID, value); }
+
+ | BAND value=ufiString
+ { wfProperty = mWObjectManager
+ ->newWPropertyParsedIdentifier(wfContainer, aNameID, value); }
+
+ | op=aSymbolOperator
+ { wfProperty = mWObjectManager
+ ->newWPropertyOperator(wfContainer, aNameID, op); }
+
+ | value=anArrayForm[WObject::_NULL_]
+ { wfProperty = mWObjectManager
+ ->newWPropertyArray(wfContainer, aNameID, value); }
+ ;
+
+////////////////////////////////////////////////////////////////////////////////
+///// GENERIC DEFINITION
+////////////////////////////////////////////////////////////////////////////////
+
+aReference returns [ BF form ]
+{
+ BF bfUFI;
+}
+ : BAND bfUFI=ufiString
+ {
+ form = mWObjectManager->bfRegisteredWObject( bfUFI.str() );
+ if( form.invalid() )
+ {
+ form = bfUFI;
+ }
+ }
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// TAG PROGRAM DEFINITION
+////////////////////////////////////////////////////////////////////////////////
+
+tagProgram [ WObject * wfContainer ] returns [ WObject * attr = WObject::_NULL_ ]
+{
+ BF ap;
+
+ int bLine = getNextTokenLine();
+ int bOffset = getNextTokenStartIndex();
+}
+ : at_lv:AtLeftValueIdentifier LCURLY ap=avmProgram[wfContainer]
+ { attr = mWObjectManager->newWProperty(wfContainer, at_lv->getText(), ap); }
+
+ { setLocation(attr, bLine, getNextTokenLine(), bOffset, getNextTokenStopIndex()); }
+ RCURLY
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// PROGRAM DEFINITION
+////////////////////////////////////////////////////////////////////////////////
+
+avmProgram [ WObject * wfContainer ]returns [ BF form ]
+{
+ BFCode prog;
+ Operator * op = NULL;
+ BF ap;
+
+// int bLine = getNextTokenLine();
+// int bOffset = getNextTokenStartIndex();
+}
+ : LPROG op=anOperator { form = prog = StatementConstructor::newCode(op); }
+
+ ( ap=avmProgram[wfContainer] { prog->append(ap); } )*
+
+ //{ setLocation(prog, bLine, getNextTokenLine(), bOffset, getNextTokenStopIndex()); }
+ RCURLY
+ {
+ if( prog.invalid() || (op == NULL) )
+ {
+ //!! PARSE ERROR !!
+ }
+ else if( op->isOpCode( AVM_OPCODE_MINUS ) && (prog->size() == 1) )
+ {
+ prog->setOperator( OperatorManager::OPERATOR_UMINUS );
+ }
+ else if( op->isOpCode( AVM_OPCODE_IF ) && (prog->size() == 3) )
+ {
+ prog->setOperator( OperatorManager::OPERATOR_IFE );
+ }
+ else if( op->isOpCode( AVM_OPCODE_IFE ) && (prog->size() == 2) )
+ {
+ prog->setOperator( OperatorManager::OPERATOR_IF );
+ }
+ }
+
+ | LPAREN form=expression RPAREN
+
+ | form=expression_invoke
+
+ | form=anAtom
+ ;
+
+
+anOperator returns [ Operator * op ]
+ : op=aSymbolOperator
+
+ | { (op = OperatorManager::getOp(LT(1)->getText())) != NULL }? Identifier
+ ;
+
+
+aSymbolOperator returns [ Operator * op ]
+ : PLUS { op = OperatorManager::OPERATOR_PLUS; }
+ | MINUS { op = OperatorManager::OPERATOR_MINUS; }
+ | MULT { op = OperatorManager::OPERATOR_MULT; }
+ | DIV { op = OperatorManager::OPERATOR_DIV; }
+ | MOD { op = OperatorManager::OPERATOR_MOD; }
+
+ | POW { op = OperatorManager::OPERATOR_POW; }
+
+ | EQ { op = OperatorManager::OPERATOR_EQ; }
+ | EQEQ { op = OperatorManager::OPERATOR_EQ; }
+ | NEQ { op = OperatorManager::OPERATOR_NEQ; }
+
+ | SEQ { op = OperatorManager::OPERATOR_SEQ; }
+ | NSEQ { op = OperatorManager::OPERATOR_NSEQ; }
+
+ | GT { op = OperatorManager::OPERATOR_GT; }
+ | GTE { op = OperatorManager::OPERATOR_GTE; }
+ | LT_ { op = OperatorManager::OPERATOR_LT; }
+ | LTE { op = OperatorManager::OPERATOR_LTE; }
+
+ | BNOT { op = OperatorManager::OPERATOR_BNOT; }
+ | BAND { op = OperatorManager::OPERATOR_BAND; }
+ | BOR { op = OperatorManager::OPERATOR_BOR; }
+ | BXOR { op = OperatorManager::OPERATOR_BXOR; }
+
+ | LSHIFT { op = OperatorManager::OPERATOR_LSHIFT; }
+ | RSHIFT { op = OperatorManager::OPERATOR_RSHIFT; }
+
+ | LNOT { op = OperatorManager::OPERATOR_NOT; }
+ | LAND { op = OperatorManager::OPERATOR_AND; }
+ | LOR { op = OperatorManager::OPERATOR_OR; }
+
+ | ASSIGN { op = OperatorManager::OPERATOR_ASSIGN; }
+
+ | PUSH { op = OperatorManager::OPERATOR_PUSH; }
+ | POP { op = OperatorManager::OPERATOR_POP; }
+ | TOP { op = OperatorManager::OPERATOR_TOP; }
+ | ASSIGN_TOP { op = OperatorManager::OPERATOR_ASSIGN_TOP; }
+
+ | SEQUENCE { op = OperatorManager::OPERATOR_SEQUENCE; }
+ | SEQUENCE_SIDE { op = OperatorManager::OPERATOR_SEQUENCE_SIDE; }
+ | SEQUENCE_WEAK { op = OperatorManager::OPERATOR_SEQUENCE_WEAK; }
+
+ | INTERLEAVING { op = OperatorManager::OPERATOR_INTERLEAVING; }
+
+ | EXCLUSIVE { op = OperatorManager::OPERATOR_EXCLUSIVE; }
+ | NONDETERMINISM { op = OperatorManager::OPERATOR_NONDETERMINISM; }
+
+ | PRIOR_GT { op = OperatorManager::OPERATOR_PRIOR_GT; }
+ | PRIOR_LT { op = OperatorManager::OPERATOR_PRIOR_LT; }
+
+ | PARALLEL { op = OperatorManager::OPERATOR_PARALLEL; }
+ | PRODUCT { op = OperatorManager::OPERATOR_PRODUCT; }
+
+ | ASYNC { op = OperatorManager::OPERATOR_ASYNCHRONOUS; }
+ | STRONG_SYNC { op = OperatorManager::OPERATOR_STRONG_SYNCHRONOUS; }
+ | WEAK_SYNC { op = OperatorManager::OPERATOR_WEAK_SYNCHRONOUS; }
+ ;
+
+
+anAtom returns [ BF form ]
+{
+ Operator * op = NULL;
+}
+ : "true" { form = ExpressionConstructor::newBoolean(true); }
+ | "false" { form = ExpressionConstructor::newBoolean(false); }
+
+ | MINUS mn:IntegerNumber { form = ExpressionConstructor::newInteger( "-" + mn->getText() ); }
+ | PLUS pn:IntegerNumber { form = ExpressionConstructor::newInteger( pn->getText() ); }
+ | n:IntegerNumber { form = ExpressionConstructor::newInteger( n->getText() ); }
+
+ | MINUS mf:FloatingPointNumber { form = ExpressionConstructor::newFloat( "-" + mf->getText() ); }
+ | PLUS pf:FloatingPointNumber { form = ExpressionConstructor::newFloat( pf->getText() ); }
+ | f:FloatingPointNumber { form = ExpressionConstructor::newFloat( f->getText() ); }
+
+ | cl:CharacterLiteral { form = ExpressionConstructor::newChar( cl->getText().c_str()[0] ); }
+
+ | dqs:DoubleQuotedString { form = ExpressionConstructor::newString(
+ dqs->getText() , String::DOUBLE_QUOTE_DELIMITER ); }
+
+ | sqs:SingleQuotedString { form = ExpressionConstructor::newString(
+ sqs->getText() , String::SINGLE_QUOTE_DELIMITER ); }
+
+ | form=ufiString
+
+ | form=aReference
+
+ | op=aSymbolOperator { form = CONST_BF_OP( op ); }
+
+ | form=anArrayForm[WObject::_NULL_]
+ ;
+
+
+anArrayForm [WObject * wfContainer] returns [ BF form ]
+{
+ BFVector array;
+
+ BF ap;
+}
+ : LBRACK
+ ( ap=avmProgram[wfContainer] { array.append(ap); }
+ ( COMMA
+ ap=avmProgram[wfContainer] { array.append(ap); }
+ )*
+ )?
+ RBRACK
+ {
+ form = BuiltinArray::create(array);
+ }
+ ;
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// EXPRESSION DEFINITION
+////////////////////////////////////////////////////////////////////////////////
+
+expression_invoke returns [ BFCode ac ]
+{
+ BF e;
+ Operator * op = NULL;
+}
+ : LPAREN_INVOKE
+ e=unaryExpression
+ { ac = ExpressionConstructor::newCode(OperatorManager::OPERATOR_INVOKE_METHOD, e); }
+ ( id:Identifier { ac->append(ParserUtil::getInvokable(e, id->getText())); }
+ | op=aSymbolOperator { ac->append( INCR_BF(op) ); }
+ )
+ ( e=expression { ac->append(e); } )*
+ ( "provided:" e=expression { ac->append(e); }
+ | "from:" e=unaryExpression { ac->append(e); }
+ | "to:" e=unaryExpression { ac->append(e); }
+ | "activity:" op=anOperator { ac->append( INCR_BF(op) ); }
+ )?
+ RPAREN
+ ;
+
+
+expression returns [ BF expr ]
+ : expr=conditionalExpression
+ ;
+
+conditionalExpression returns [ BF expr ]
+{
+ BF arg1;
+ BF arg2;
+}
+ : expr=conditionalOrExpression
+ ( QUESTION arg1=expression COLON arg2=expression
+ { expr = ExpressionConstructor::newCode(
+ OperatorManager::OPERATOR_IFE, expr, arg1, arg2); }
+ )?
+ ;
+
+conditionalOrExpression returns [ BF expr ]
+{
+ BF arg;
+}
+ : expr=conditionalAndExpression
+ ( LOR arg=conditionalAndExpression
+ { expr = ExpressionConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_OR, expr, arg); }
+ )*
+ ;
+
+conditionalAndExpression returns [ BF expr ]
+{
+ BF arg;
+}
+ : expr=bitwiseOrExpression
+ ( LAND arg=bitwiseOrExpression
+ { expr = ExpressionConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_AND, expr, arg); }
+ )*
+ ;
+
+bitwiseOrExpression returns [ BF expr ]
+{
+ BF arg;
+}
+ : expr=bitwiseXorExpression
+ ( BOR arg=bitwiseXorExpression
+ { expr = ExpressionConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_BOR, expr, arg); }
+ )*
+ ;
+
+bitwiseXorExpression returns [ BF expr ]
+{
+ BF arg;
+}
+ : expr=bitwiseAndExpression
+ ( BXOR arg=bitwiseAndExpression
+ { expr = ExpressionConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_BXOR, expr, arg); }
+ )*
+ ;
+
+bitwiseAndExpression returns [ BF expr ]
+{
+ BF arg;
+}
+ : expr=equalityExpression
+ ( BAND arg=equalityExpression
+ { expr = ExpressionConstructor::newCodeFlat(
+ OperatorManager::OPERATOR_BAND, expr, arg); }
+ )*
+ ;
+
+
+equalityExpression returns [ BF expr ]
+{
+ Operator * op = NULL;
+ BF arg;
+}
+ : expr=relationalExpression
+ ( op=equalOp arg=relationalExpression
+ { expr = ExpressionConstructor::newCode(op, expr, arg); }
+ )?
+ ;
+
+equalOp returns [ Operator * op ]
+ : EQ { op = OperatorManager::OPERATOR_EQ; }
+ | EQEQ { op = OperatorManager::OPERATOR_EQ; }
+ | NEQ { op = OperatorManager::OPERATOR_NEQ; }
+ | SEQ { op = OperatorManager::OPERATOR_SEQ; }
+ | NSEQ { op = OperatorManager::OPERATOR_NSEQ; }
+ ;
+
+
+relationalExpression returns [ BF expr ]
+{
+ Operator * op = NULL;
+ BF arg;
+}
+ : expr=shiftExpression
+ ( op=relationalOp arg=shiftExpression
+ { expr = ExpressionConstructor::newCode(op, expr, arg); }
+ )?
+ ;
+
+relationalOp returns [ Operator * op ]
+ : LTE { op = OperatorManager::OPERATOR_LTE; }
+ | GTE { op = OperatorManager::OPERATOR_GTE; }
+ | LT_ { op = OperatorManager::OPERATOR_LT; }
+ | GT { op = OperatorManager::OPERATOR_GT; }
+ ;
+
+
+shiftExpression returns [ BF expr ]
+{
+ Operator * op = NULL;
+ BF arg;
+}
+ : expr=additiveExpression
+ ( op=shiftOp arg=additiveExpression
+ { expr = ExpressionConstructor::newCode(op, expr, arg); }
+ )*
+ ;
+
+shiftOp returns [ Operator * op ]
+ : LSHIFT { op = OperatorManager::OPERATOR_LSHIFT; }
+ | RSHIFT { op = OperatorManager::OPERATOR_RSHIFT; }
+ ;
+
+
+additiveExpression returns [ BF expr ]
+{
+ Operator * op = NULL;
+ BF arg;
+}
+ : expr=multiplicativeExpression
+ ( op=additiveOp arg=multiplicativeExpression
+ { expr = ExpressionConstructor::newCode(op, expr, arg); }
+ )*
+ ;
+
+additiveOp returns [ Operator * op ]
+ : PLUS { op = OperatorManager::OPERATOR_PLUS; }
+ | MINUS { op = OperatorManager::OPERATOR_MINUS; }
+ ;
+
+
+multiplicativeExpression returns [ BF expr ]
+{
+ Operator * op = NULL;
+ BF arg;
+}
+ : expr=unaryExpression
+ ( op=multiplicativeOp arg=unaryExpression
+ { expr = ExpressionConstructor::newCode(op, expr, arg); }
+ )*
+ ;
+
+multiplicativeOp returns [ Operator * op ]
+ : MULT { op = OperatorManager::OPERATOR_MULT; }
+ | DIV { op = OperatorManager::OPERATOR_DIV; }
+ | MOD { op = OperatorManager::OPERATOR_MOD; }
+ ;
+
+
+unaryExpression returns [ BF expr ]
+ : expr=literal
+
+/*
+ | PLUS expr=unaryExpression
+ { expr = ExpressionConstructor::newCode(OperatorManager::OPERATOR_PLUS, expr); }
+
+ | MINUS expr=unaryExpression
+ { expr = ExpressionConstructor::newCode(OperatorManager::OPERATOR_UMINUS, expr); }
+
+ | INCR expr=unaryExpression
+ { expr = ExpressionConstructor::newCode(OperatorManager::OPERATOR_INCR, expr); }
+
+ | DECR expr=unaryExpression
+ { expr = ExpressionConstructor::newCode(OperatorManager::OPERATOR_DECR, expr); }
+*/
+
+ | LNOT expr=unaryExpression
+ { expr = ExpressionConstructor::newCode(OperatorManager::OPERATOR_NOT, expr); }
+
+ | BNOT expr=unaryExpression
+ { expr = ExpressionConstructor::newCode(OperatorManager::OPERATOR_BNOT, expr); }
+
+
+// | primary ( INCR | DECR )?
+
+
+ | expr=expression_invoke
+
+ | LPAREN expr=expression RPAREN
+ ;
+/*
+primary returns [ BF expr ]
+ : ID
+ ( ( DOT ID )
+ | ( LBRACKET expression RBRACKET )
+ | LPAREN ( expression ( COMMA expression )* )? RPAREN
+ )*
+ ;
+*/
+
+literal returns [ BF expr ]
+{
+// Operator * op = NULL;
+}
+ : "true" { expr = ExpressionConstructor::newBoolean(true); }
+ | "false" { expr = ExpressionConstructor::newBoolean(false); }
+
+ | MINUS mn:IntegerNumber { expr = ExpressionConstructor::newInteger( "-" + mn->getText() ); }
+ | PLUS pn:IntegerNumber { expr = ExpressionConstructor::newInteger( pn->getText() ); }
+ | n:IntegerNumber { expr = ExpressionConstructor::newInteger( n->getText() ); }
+
+ | MINUS mf:FloatingPointNumber { expr = ExpressionConstructor::newFloat( "-" + mf->getText() ); }
+ | PLUS pf:FloatingPointNumber { expr = ExpressionConstructor::newFloat( pf->getText() ); }
+ | f:FloatingPointNumber { expr = ExpressionConstructor::newFloat( f->getText() ); }
+
+ | cl:CharacterLiteral { expr = ExpressionConstructor::newChar( cl->getText().c_str()[0] ); }
+
+ | dqs:DoubleQuotedString { expr = ExpressionConstructor::newString(
+ dqs->getText() , String::DOUBLE_QUOTE_DELIMITER ); }
+
+ | sqs:SingleQuotedString { expr = ExpressionConstructor::newString(
+ sqs->getText() , String::SINGLE_QUOTE_DELIMITER ); }
+
+ | expr=ufiString
+
+ | expr=aReference
+
+//| op=aSymbolOperator { expr = CONST_BF_OP( op ); }
+
+ | expr=anArrayForm[WObject::_NULL_]
+ ;
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+class WorkflowLexer extends Lexer;
+
+options
+{
+ charVocabulary = '\0'..'\377';
+ k = 6; // four characters of lookahead
+
+ testLiterals = false; // don't automatically test for literals
+
+ caseSensitive = true;
+ caseSensitiveLiterals = true;
+}
+
+/* CPP */
+{
+
+private:
+
+ avm_size_t noOfErrors;
+
+
+public:
+
+avm_size_t hasError() const
+{
+ return( noOfErrors > 0 );
+}
+
+avm_size_t numberOfErrors() const
+{
+ return noOfErrors;
+}
+
+void resetErrors()
+{
+ noOfErrors = 0;
+}
+
+static const std::string versionInfo()
+{
+ static std::string info = "$Id: LiaLexer.g, v 0.1 2005/10/20 Lapitre $";
+
+ return info;
+}
+
+
+protected:
+
+void reportError( const std::string & errorMessage )
+{
+ reportMessage( errorMessage );
+ ++noOfErrors;
+}
+
+void reportMessage( const std::string & message ) const
+{
+ if ( getFilename().length() > 0 )
+ {
+ AVM_OS_CERR << getFilename() << ":";
+ }
+
+ AVM_OS_CERR << getLine() << ":" << getColumn()
+ << " [error] " << message << std::endl;
+}
+
+}
+/* end CPP */
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// OPERATORS SYMBOLS LITERAL
+////////////////////////////////////////////////////////////////////////////////
+
+AT : '@' ;
+
+PLUS : '+' ;
+MINUS : '-' ;
+MOD : '%' ;
+MULT : '*' ;
+DIV : '/' ;
+
+POW : '^' | "**" ;
+
+ASSIGN : ":=" ;
+
+PUSH : "<=<" ;
+ASSIGN_TOP : "^=<" ;
+TOP : "^=>" ;
+POP : ">=>" ;
+
+EQ : '=' ;
+
+BANDEQ : "&=" ;
+BOREQ : "|=" ;
+BXOREQ : "^=" ;
+BNOTEQ : "~=" ;
+
+PLUSEQ : "+=" ;
+MINUSEQ : "-=" ;
+MULTEQ : "*=" ;
+DIVEQ : "/=" ;
+MODEQ : "%=" ;
+
+EQEQ : "==" ;
+NEQ : "!=" ;
+SEQ : "===" ;
+NSEQ : "=/=" ;
+
+GT : '>' ;
+GTE : ">=" ;
+LT_ : '<' ;
+LTE : "<=" ;
+
+BAND : '&' ;
+BOR : '|' ;
+BXOR : '^' ;
+BNOT : '~' ;
+
+LSHIFT : "<<" ;
+RSHIFT : ">>" ;
+
+
+LAND : "&&" ;
+LOR : "||" ;
+LNOT : '!' ;
+
+LPAREN : '(' ;
+RPAREN : ')' ;
+
+LPAREN_INVOKE : "(:" ;
+
+LBRACK : '[' ;
+RBRACK : ']' ;
+
+
+LCURLY : '{' ;
+RCURLY : '}' ;
+
+LPROG : "${" ;
+
+LGENERIC : "<%" ;
+RGENERIC : "%>" ;
+
+COMMA : ',' ;
+SEMI : ';' ;
+COLON : ':' ;
+COLON2 : "::" ;
+COLON_SLASH : ":/" ;
+DOT : '.' ;
+QUESTION : '?' ;
+
+GT_COLON : ">:" ;
+
+ARROW : "->" ;
+
+
+INTERLEAVING : "|i|" ;
+
+ASYNC : "|a|" ;
+STRONG_SYNC : "|and|" ;
+WEAK_SYNC : "|or|" ;
+PARALLEL : "|,|" ;
+PRODUCT : "|x|" ;
+
+EXCLUSIVE : "|xor|" ;
+NONDETERMINISM : "|/\\|" ;
+
+PRIOR_GT : "|>|" ;
+PRIOR_LT : "|<|" ;
+
+SEQUENCE : "|;|" ;
+SEQUENCE_SIDE : "|/;|" ;
+SEQUENCE_WEAK : "|;;|" ;
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// ATTRIBUTE LVALUE
+////////////////////////////////////////////////////////////////////////////////
+
+Attr_PUBLIC
+ : "@public"
+ ;
+
+Attr_STATIC
+ : "@static"
+ ;
+
+Attr_FINAL
+ : "@final"
+ ;
+
+Attr_VOLATILE
+ : "@volatile"
+ ;
+
+Attr_REFERENCE
+ : "@reference"
+ ;
+
+Attr_UFI
+ : "@ufi"
+ ;
+
+Attr_NAME
+ : "@name"
+ ;
+
+Attr_TYPE
+ : "@type"
+ ;
+
+Attr_DESIGN
+ : "@design"
+ ;
+
+Attr_DIVERSITY
+ : "@diversity"
+ ;
+
+Attr_FAVM
+ : "@favm"
+ ;
+
+Attr_SEW
+ : "@sew"
+ ;
+
+
+
+
+AtLeftValueIdentifier
+ : AT ! LeftValueIdentifier
+ ;
+
+protected
+LeftValueIdentifier
+ : ( ~( ':' | '=' | '{' | '[' | ' ' | '\t' | '\f' | '\n' |'\r' ) )+
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// NUMERIC LITERAL
+////////////////////////////////////////////////////////////////////////////////
+
+
+// Numeric Constants:
+
+protected
+LongSuffix
+ : 'l'
+ | 'L'
+ ;
+
+protected
+UnsignedSuffix
+ : 'u'
+ | 'U'
+ ;
+
+protected
+FloatSuffix
+ : 'f'
+ | 'F'
+ | 'd'
+ | 'D'
+ ;
+
+protected
+Exponent
+ :
+ ('e'|'E') ('+'|'-')? (Digit)+
+ ;
+
+Number
+ : ( (Digit)+ ('.' | 'e' | 'E') )=>
+ (Digit)+
+ ( '.' (Digit)* (Exponent)?
+ | Exponent
+ )
+ (FloatSuffix
+ |LongSuffix
+ )? {_ttype = FloatingPointNumber;}
+
+ | '.'
+ ( (Digit)+ (Exponent)?
+ (FloatSuffix
+ |LongSuffix
+ )?
+ ) {_ttype = FloatingPointNumber;}
+
+ | (Digit)+
+ (LongSuffix
+ |UnsignedSuffix
+ )* {_ttype = IntegerNumber;}
+ ;
+
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// CHAR STRING LITERAL
+////////////////////////////////////////////////////////////////////////////////
+
+
+CharacterLiteral
+ : '\''! CHAR '\''!
+ ;
+
+protected
+CHAR
+ : ( EscapeSequence | ~('\''|'\\') )
+ ;
+
+
+DoubleQuotedString
+ : '"'! DQS '"'!
+ ;
+
+protected
+DQS
+ : ( EscapeSequence | ~( '\\' | '"' ) )*
+ ;
+
+
+SingleQuotedString
+ : '\''! SQS '\''!
+ ;
+
+protected
+SQS
+ : ( EscapeSequence | ~( '\\' | '\'' ) ) ( EscapeSequence | ~( '\\' | '\'' ) )+
+ ;
+
+
+protected
+EscapeSequence
+ : '\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\')
+ | UnicodeEscape
+ | OctalEscape
+ ;
+
+protected
+OctalEscape
+ : '\\' ('0'..'3') ('0'..'7') ('0'..'7')
+ | '\\' ('0'..'7') ('0'..'7')
+ | '\\' ('0'..'7')
+ ;
+
+protected
+UnicodeEscape
+ : '\\' 'u' HexDigit HexDigit HexDigit HexDigit
+ ;
+
+protected
+HexDigit
+ : ( Digit | 'a'..'f' | 'A'..'F' )
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// IDENTIFIER
+////////////////////////////////////////////////////////////////////////////////
+
+/*
+UFI
+ : Identifier ( '.' Identifier )+
+ ;
+UfiLocator
+ : Letter ( Letter | Digit )* ( '#' ( Digit )+ )? (COLON_SLASH|COLON2)!
+ ;
+
+*/
+
+
+Identifier
+options { testLiterals=true; }
+ : Letter ( Letter | Digit | '#' | '/' )*
+ ;
+
+/**I found this char range in JavaCC's grammar, but Letter and Digit overlap.
+ Still works, but...
+*/
+protected
+Letter
+ : 'A'..'Z'
+ | 'a'..'z'
+
+ | '$'
+ | '_'
+ ;
+
+protected
+Digit
+ : '0'..'9'
+ ;
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// COMMENT RULE
+////////////////////////////////////////////////////////////////////////////////
+
+// Single-line comments
+SL_COMMENT
+ : "//" (~('\n'|'\r'))* ('\n'|'\r'('\n')?)?
+ {
+ $setType(antlr::Token::SKIP);
+ newline();
+ }
+ ;
+
+// Multi-line comments
+COMMENT_MULTI_LINE
+ : "/*"
+ ( options { generateAmbigWarnings=false; }
+ : { LA(2) != '/' }? '*'
+ | '\r' '\n' { newline(); }
+ | '\r' { newline(); }
+ | '\n' { newline(); }
+ | ~('*' | '\n' | '\r')
+ )*
+ "*/"
+ {
+ $setType(antlr::Token::SKIP);
+ }
+ ;
+
+COMMENT_MULTI_LINE_2
+ : "(*"
+ ( options { generateAmbigWarnings=false; }
+ : { LA(2) != ')' }? '*'
+ | '\r' '\n' { newline(); }
+ | '\r' { newline(); }
+ | '\n' { newline(); }
+ | ~('*' | '\n' | '\r')
+ )*
+ "*)"
+ {
+ $setType(antlr::Token::SKIP);
+ }
+ ;
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// WHITESPACE IGNORED
+////////////////////////////////////////////////////////////////////////////////
+
+WHITESPACE
+ : ( ' ' | '\t' | '\f' |
+ // handle newlines
+ (
+ "\r\n" // Evil DOS
+ | '\r' // Macintosh
+ | '\n' // Unix (the right way)
+ )
+ { newline(); }
+ )
+ {
+ $setType(antlr::Token::SKIP);
+ }
+ ;
+
+
diff --git a/org.eclipse.efm.symbex/src/printer/CMakeLists.txt b/org.eclipse.efm.symbex/src/printer/CMakeLists.txt
new file mode 100644
index 0000000..68a27d4
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/printer/CMakeLists.txt
@@ -0,0 +1,15 @@
+# =============================================================================
+# CMake file for the PRINTER library
+# =============================================================================
+
+# C++ source files to take into account (all files matching patterns)
+file (GLOB PRINTER_CXX_SRC_FILES *.cpp *.h)
+
+# Target to build
+add_library (printer STATIC ${PRINTER_CXX_SRC_FILES})
+
+# Include directories (internal)
+target_include_directories (printer PUBLIC ..) # FIXME : explicit the dependencies lib by lib
+
+# Target include directories (external)
+target_include_directories (printer PUBLIC ${Boost_INCLUDE_DIRS})
diff --git a/org.eclipse.efm.symbex/src/printer/Manipulators.cpp b/org.eclipse.efm.symbex/src/printer/Manipulators.cpp
new file mode 100644
index 0000000..7fab58b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/printer/Manipulators.cpp
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 2 juin 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#include "Manipulators.h"
+
+namespace sep {
+
+
+/**
+ * DEFAULT VALUE CSS
+ */
+SymbexValueCSS DEFAULT_SYMBEX_VALUE_ARRAY_CSS ( "[ ", " , ", " ]" );
+
+SymbexValueCSS DEFAULT_SYMBEX_VALUE_PARAMS_CSS ( "( ", " , ", " )" );
+
+SymbexValueCSS DEFAULT_SYMBEX_VALUE_STRUCT_CSS( "{ ", " , ", " }" );
+
+
+/**
+ * DEFAULT AVM INDENT
+ */
+AvmIndent AVM_TAB_INDENT ( "" , "\t" , "\n" );
+
+AvmIndent AVM_TAB1_INDENT( "\t" , "\t" , "\n" );
+
+
+AvmIndent AVM_SPC_INDENT ( "" , " " , "\n" );
+
+AvmIndent AVM_SPC1_INDENT( " " , " " , "\n" );
+
+
+AvmIndent AVM_STR_INDENT( " " , "" , "" );
+
+AvmIndent AVM_RTS_INDENT( "" , "" , " " );
+
+AvmIndent AVM_NO_INDENT ( "" , "" , "" );
+
+// Default output / fscn file indent
+AvmIndent AVM_OUTPUT_INDENT( "" , "\t" , "\n" );
+
+AvmIndent AVM_FSCN_INDENT ( "" , "\t" , "\n" );
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/printer/Manipulators.h b/org.eclipse.efm.symbex/src/printer/Manipulators.h
new file mode 100644
index 0000000..38a470a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/printer/Manipulators.h
@@ -0,0 +1,862 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 2 juin 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#ifndef PRINTER_MANIPULATORS_H_
+#define PRINTER_MANIPULATORS_H_
+
+#include <string>
+
+
+namespace sep {
+
+
+//class Manipulators {
+//public:
+// Manipulators() {
+// // TODO Auto-generated constructor stub
+//
+// }
+// virtual ~Manipulators() {
+// // TODO Auto-generated destructor stub
+// }
+//};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// MANIPULATORS
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+
+/**
+ * AvmTAB
+ */
+struct AvmTAB
+{
+ std::size_t count;
+
+ AvmTAB(std::size_t n)
+ : count( n )
+ {
+ //!! NOTHING
+ }
+};
+
+inline AvmTAB tab(std::size_t n)
+{
+ return( n );
+}
+
+
+/**
+ * AvmEOL
+ */
+struct AvmEOL
+{
+ std::size_t count;
+
+ AvmEOL(std::size_t n)
+ : count( n )
+ {
+ //!! NOTHING
+ }
+};
+
+inline AvmEOL eol(std::size_t n)
+{
+ return( n );
+}
+
+
+/**
+ * AvmINCR
+ */
+struct AvmINCR
+{
+ std::size_t count;
+
+ AvmINCR(std::size_t n)
+ : count( n )
+ {
+ //!! NOTHING
+ }
+};
+
+inline AvmINCR incr(std::size_t n)
+{
+ return( n );
+}
+
+
+/**
+ * AvmDECR
+ */
+struct AvmDECR
+{
+ std::size_t count;
+
+ AvmDECR(std::size_t n)
+ : count( n )
+ {
+ //!! NOTHING
+ }
+};
+
+inline AvmDECR decr(std::size_t n)
+{
+ return( n );
+}
+
+
+
+/**
+ * Automatic mechanism for
+ * <reference>.toStream( os )
+ */
+template< class T >
+struct _refStream_
+{
+ const T & ref;
+
+ // CONSTRUCTOR
+ _refStream_(const T & aRef)
+ : ref( aRef )
+ {
+ //!! NOTHING
+ }
+};
+
+/**
+ * Automatic mechanism for
+ * <pointer>->toStream( os )
+ */
+template< class T >
+struct _ptrStream_
+{
+ T * ptr;
+
+ // CONSTRUCTOR
+ _ptrStream_(T * aPtr)
+ : ptr( aPtr )
+ {
+ //!! NOTHING
+ }
+};
+
+
+/**
+ * toStream FUNCTORS
+ */
+template< class T >
+inline _refStream_< T > to_stream( const T & ref )
+{
+ return( ref );
+}
+
+template< class T >
+inline _ptrStream_< T > to_stream( T * ptr )
+{
+ return( ptr );
+}
+
+
+/**
+ * Automatic mechanism for
+ * <named_element>.toFQN( os )
+ */
+template< class T >
+struct _refFQN_
+{
+ const T & ref;
+
+ // CONSTRUCTOR
+ _refFQN_(const T & aRef)
+ : ref( aRef )
+ {
+ //!! NOTHING
+ }
+};
+
+/**
+ * Automatic mechanism for
+ * <named_element>->toFQN( os )
+ */
+template< class T >
+struct _ptrFQN_
+{
+ T * ptr;
+
+ // CONSTRUCTOR
+ _ptrFQN_(T * aPtr)
+ : ptr( aPtr )
+ {
+ //!! NOTHING
+ }
+};
+
+/**
+ * toStream FUNCTORS
+ */
+template< class T >
+inline _refFQN_< T > str_fqn( const T & ref )
+{
+ return( ref );
+}
+
+template< class T >
+inline _ptrFQN_< T > str_fqn( T * ptr )
+{
+ return( ptr );
+}
+
+
+/**
+ * Automatic mechanism for
+ * <reference>.strHeader( os )
+ */
+template< class T >
+struct _refHeader_
+{
+ const T & ref;
+
+ // CONSTRUCTOR
+ _refHeader_(const T & aRef)
+ : ref( aRef )
+ {
+ //!! NOTHING
+ }
+};
+
+/**
+ * Automatic mechanism for
+ * <pointer>->toHeader( os )
+ */
+template< class T >
+struct _ptrHeader_
+{
+ T * ptr;
+
+ // CONSTRUCTOR
+ _ptrHeader_(T * aPtr)
+ : ptr( aPtr )
+ {
+ //!! NOTHING
+ }
+};
+
+
+/**
+ * toHeader FUNCTORS
+ */
+template< class T >
+inline _refHeader_< T > str_header( const T & ref )
+{
+ return( ref );
+}
+
+template< class T >
+inline _ptrHeader_< T > str_header( T * ptr )
+{
+ return( ptr );
+}
+
+
+/**
+ * Automatic mechanism for
+ * INCR
+ * <reference>.toHeader( os )
+ * DECR
+ */
+template< class T >
+struct _refIncrIndent_
+{
+ const T & ref;
+
+ // CONSTRUCTOR
+ _refIncrIndent_(const T & aRef)
+ : ref( aRef )
+ {
+ //!! NOTHING
+ }
+};
+
+/**
+ * Automatic mechanism for
+ * INCR
+ * <pointer>.toStream( os )
+ * DECR
+ */
+template< class T >
+struct _ptrIncrIndent_
+{
+ T * ptr;
+
+ // CONSTRUCTOR
+ _ptrIncrIndent_(T * aPtr)
+ : ptr( aPtr )
+ {
+ //!! NOTHING
+ }
+};
+
+
+/**
+ * Increment(1) AvmIndent FUNCTORS
+ */
+template< class T >
+inline _refIncrIndent_< T > incr_stream( const T & ref )
+{
+ return( ref );
+}
+
+template< class T >
+inline _ptrIncrIndent_< T > incr_stream( T * ptr )
+{
+ return( ptr );
+}
+
+
+/**
+ * Automatic mechanism for
+ * INCR< count >
+ * <reference>.toStream( os )
+ * DECR< count >
+ */
+template< class T >
+struct _refIncrIndentCount_
+{
+ const T & ref;
+
+ std::size_t count;
+
+ // CONSTRUCTOR
+ _refIncrIndentCount_(const T & aRef, std::size_t aCount)
+ : ref( aRef ), count( aCount )
+ {
+ //!! NOTHING
+ }
+};
+
+/**
+ * Automatic mechanism for
+ * INCR< count >
+ * <pointer>.toStream( os )
+ * DECR< count >
+ */
+template< class T >
+struct _ptrIncrIndentCount_
+{
+ T * ptr;
+
+ std::size_t count;
+
+ // CONSTRUCTOR
+ _ptrIncrIndentCount_(T * aPtr, std::size_t aCount)
+ : ptr( aPtr ), count( aCount )
+ {
+ //!! NOTHING
+ }
+};
+
+
+/**
+ * Increment(<count>) AvmIndent FUNCTORS
+ */
+template< class T >
+inline _refIncrIndentCount_< T > incr_stream( const T & ref , std::size_t count )
+{
+ return( _refIncrIndentCount_< T >(ref, count) );
+}
+
+template< class T >
+inline _ptrIncrIndentCount_< T > incr_stream( T * ptr , std::size_t count )
+{
+ return( _ptrIncrIndentCount_< T >(ptr, count) );
+}
+
+
+
+/**
+ * AvmREPEAT
+ */
+template< class T >
+struct AvmREPEAT
+{
+ const T & pattern;
+ std::size_t count;
+
+ AvmREPEAT(const T & aPattern, std::size_t aCount)
+ : pattern( aPattern ),
+ count( aCount )
+ {
+ //!! NOTHING
+ }
+
+};
+
+template< class T >
+inline AvmREPEAT< T > REPEAT(const T & aPattern, std::size_t aCount)
+{
+ return( AvmREPEAT< T >(aPattern, aCount) );
+}
+
+
+/**
+ * AvmEMPHASIS
+ */
+struct AvmEMPHASIS
+{
+ std::string header;
+ std::string body;
+ char emph;
+ std::size_t count;
+
+ bool enableTab;
+
+ AvmEMPHASIS(const std::string & aHeader, const std::string & aBody,
+ char anEmph, std::size_t aCount = 80, bool enableTab = true)
+ : header( aHeader ),
+ body( aBody ),
+ emph( anEmph ),
+ count( aCount ),
+ enableTab( true )
+ {
+ //!! NOTHING
+ }
+
+ AvmEMPHASIS(const std::string & aText, char anEmph,
+ std::size_t aCount = 80, bool enableTab = true)
+ : header( "" ),
+ body( aText ),
+ emph( anEmph ),
+ count( aCount ),
+ enableTab( true )
+ {
+ //!! NOTHING
+ }
+
+};
+
+inline AvmEMPHASIS EMPHASIS(const std::string & aText,
+ char anEmph = '*', std::size_t aCount = 80, bool enableTab = true)
+{
+ return( AvmEMPHASIS(aText, anEmph, aCount, enableTab) );
+}
+
+inline AvmEMPHASIS EMPHASIS(
+ const std::string & aHeader, const std::string & aBody,
+ char anEmph = '*', std::size_t aCount = 80, bool enableTab = true)
+{
+ return( AvmEMPHASIS(aHeader, aBody, anEmph, aCount, enableTab) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// SYMBEX VALUE CSS
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+struct SymbexValueCSS
+{
+
+ std::string BEGIN;
+
+ std::string SEPARATOR;
+
+ std::string END;
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ SymbexValueCSS(
+ const std::string & begin = "{ " ,
+ const std::string & separator = " , ",
+ const std::string & end = " }" )
+ : BEGIN( begin ),
+ SEPARATOR( separator ),
+ END( end )
+ {
+ //!! NOTHING
+ }
+
+};
+
+
+/**
+ * DEFAULT AVM Multi-Value Formatter
+ */
+extern SymbexValueCSS DEFAULT_SYMBEX_VALUE_ARRAY_CSS;
+
+extern SymbexValueCSS DEFAULT_SYMBEX_VALUE_PARAMS_CSS;
+
+extern SymbexValueCSS DEFAULT_SYMBEX_VALUE_STRUCT_CSS;
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// AvmIndent
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+struct AvmIndent
+{
+
+ std::size_t COUNT;
+
+ std::string TABS;
+
+ std::string CHAR;
+
+ std::string EOL;
+
+ std::string EOL_WRAP;
+
+ std::size_t REF_COUNT;
+
+ bool IGNORE_FIRST_TAB;
+
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmIndent(const std::string & tabs = "",
+ const std::string & _char_ = "\t",
+ const std::string & eol = "\n",
+ const std::string & eol_wrap = "\n")
+ : COUNT( 0 ),
+ TABS( tabs ),
+ CHAR( _char_ ),
+ EOL( eol ),
+ EOL_WRAP( eol_wrap ),
+ REF_COUNT( 1 ),
+ IGNORE_FIRST_TAB( false )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER
+ */
+ inline std::string wrapSeparator() const
+ {
+ return( EOL_WRAP + CHAR );
+ }
+
+ inline std::size_t tabSize(std::size_t offset = 0)
+ {
+ return( TABS.size() + offset );
+ }
+
+ inline std::size_t tab2Size(std::size_t offset = 0)
+ {
+ return( TABS.size() + CHAR.size() + offset );
+ }
+
+
+ /**
+ * TEST
+ * If is prefera
+ */
+ inline bool preferablySTR()
+ {
+ return( /*TAB.empty() &&*/ CHAR.empty() /*&& EOL.empty()*/ );
+ }
+
+ inline bool preferablyFQN()
+ {
+ return( /*TAB.empty() &&*/ CHAR.empty() && EOL.empty() );
+ }
+
+
+ /**
+ * COMPARISON
+ * OPERATOR
+ */
+ inline bool operator==(const AvmIndent & other) const
+ {
+ return( (TABS == other.TABS) &&
+ (CHAR == other.CHAR) &&
+// (COUNT == other.COUNT) &&
+ (EOL == other.EOL) );
+ }
+
+ inline bool operator!=(const AvmIndent & other) const
+ {
+ return( (TABS != other.TABS) ||
+ (CHAR != other.CHAR) ||
+// (COUNT != other.COUNT) ||
+ (EOL != other.EOL) );
+ }
+
+
+ /**
+ * INCR
+ * TAB LEVEL
+ */
+ inline void incr(std::size_t count)
+ {
+ COUNT += count;
+
+ for( ; count > 0 ; --count )
+ {
+ TABS = CHAR + TABS;
+ }
+ }
+
+ inline void incr()
+ {
+ COUNT += 1;
+
+ TABS = CHAR + TABS;
+ }
+
+
+ inline void operator++()
+ {
+ COUNT += 1;
+
+ TABS = CHAR + TABS;
+ }
+
+
+ /**
+ * DECR
+ * TAB LEVEL
+ */
+ inline void decr(std::size_t count)
+ {
+ COUNT = ( COUNT >= count ) ? (COUNT - count) : 0;
+
+ for( ; count > 0 ; --count )
+ {
+// TABS = TABS.substr( TABS.find_first_of(CHAR) );
+ TABS = TABS.substr( CHAR.size() );
+ }
+ }
+
+ inline void decr()
+ {
+ if( COUNT >= 1 )
+ {
+ COUNT = (COUNT - 1);
+
+// TABS = TABS.substr( TABS.find_first_of(CHAR) );
+ TABS = TABS.substr( CHAR.size() );
+ }
+ }
+
+
+ inline void operator--()
+ {
+ if( COUNT >= 1 )
+ {
+ COUNT += -1;
+
+// TABS = TABS.substr( TABS.find_first_of(CHAR) );
+ TABS = TABS.substr( CHAR.size() );
+ }
+ }
+
+};
+
+
+/**
+ * DEFAULT AVM INDENT
+ */
+extern AvmIndent AVM_TAB_INDENT;
+
+extern AvmIndent AVM_TAB1_INDENT;
+
+extern AvmIndent AVM_SPC_INDENT;
+
+extern AvmIndent AVM_SPC1_INDENT;
+
+extern AvmIndent AVM_STR_INDENT;
+
+extern AvmIndent AVM_RTS_INDENT;
+
+extern AvmIndent AVM_NO_INDENT;
+
+// Default output / fscn file indent
+extern AvmIndent AVM_OUTPUT_INDENT;
+
+extern AvmIndent AVM_FSCN_INDENT;
+
+
+/**
+ * Automatic mechanism for
+ * PUSH< AvmIndent >
+ * <reference>.toStream( os )
+ * POP< AvmIndent >
+ */
+template< class T >
+struct _refIndent_
+{
+ const T & ref;
+
+ const AvmIndent & indent;
+
+ // CONSTRUCTOR
+ _refIndent_(const T & aRef, const AvmIndent & anIndent)
+ : ref( aRef ), indent( anIndent )
+ {
+ //!! NOTHING
+ }
+};
+
+/**
+ * Automatic mechanism for
+ * PUSH< AvmIndent >
+ * <pointer>.toStream( os )
+ * POP< AvmIndent >
+ */
+template< class T >
+struct _ptrIndent_
+{
+ T * ptr;
+
+ const AvmIndent & indent;
+
+ // CONSTRUCTOR
+ _ptrIndent_(T * aPtr, const AvmIndent & anIndent)
+ : ptr( aPtr ), indent( anIndent )
+ {
+ //!! NOTHING
+ }
+};
+
+
+/**
+ * toStream FUNCTORS
+ */
+template< class T >
+inline _refIndent_< T > to_stream( const T & ref , const AvmIndent & anIndent )
+{
+ return( _refIndent_< T >(ref, anIndent) );
+}
+
+template< class T >
+inline _ptrIndent_< T > to_stream( T * ptr , const AvmIndent & anIndent )
+{
+ return( _ptrIndent_< T >(ptr, anIndent) );
+}
+
+
+// AVM_SPC_INDENT("" , " ", "\n")
+template< class T >
+inline _refIndent_< T > spc_indent( const T & ref )
+{
+ return( _refIndent_< T >(ref, AVM_SPC_INDENT) );
+}
+
+template< class T >
+inline _ptrIndent_< T > spc_indent( T * ptr )
+{
+ return( _ptrIndent_< T >(ptr, AVM_SPC_INDENT) );
+}
+
+// AVM_SPC1_INDENT(" " , " ", "\n")
+template< class T >
+inline _refIndent_< T > spc1_indent( const T & ref )
+{
+ return( _refIndent_< T >(ref, AVM_SPC1_INDENT) );
+}
+
+template< class T >
+inline _ptrIndent_< T > spc1_indent( T * ptr )
+{
+ return( _ptrIndent_< T >(ptr, AVM_SPC1_INDENT) );
+}
+
+
+// AVM_TAB_INDENT("" , "\t", "\n")
+template< class T >
+inline _refIndent_< T > tab_indent( const T & ref )
+{
+ return( _refIndent_< T >(ref, AVM_TAB_INDENT) );
+}
+
+template< class T >
+inline _ptrIndent_< T > tab_indent( T * ptr )
+{
+ return( _ptrIndent_< T >(ptr, AVM_TAB_INDENT) );
+}
+
+// AVM_TAB1_INDENT("\t" , "\t", "\n")
+template< class T >
+inline _refIndent_< T > tab1_indent( const T & ref )
+{
+ return( _refIndent_< T >(ref, AVM_TAB1_INDENT) );
+}
+
+template< class T >
+inline _ptrIndent_< T > tab1_indent( T * ptr )
+{
+ return( _ptrIndent_< T >(ptr, AVM_TAB1_INDENT) );
+}
+
+
+// AVM_STR_INDENT(" ", "", "")
+template< class T >
+inline _refIndent_< T > str_indent( const T & ref )
+{
+ return( _refIndent_< T >(ref, AVM_STR_INDENT) );
+}
+
+template< class T >
+inline _ptrIndent_< T > str_indent( T * ptr )
+{
+ return( _ptrIndent_< T >(ptr, AVM_STR_INDENT) );
+}
+
+// AVM_RTS_INDENT("", "", " ")
+template< class T >
+inline _refIndent_< T > rts_indent( const T & ref )
+{
+ return( _refIndent_< T >(ref, AVM_RTS_INDENT) );
+}
+
+template< class T >
+inline _ptrIndent_< T > rts_indent( T * ptr )
+{
+ return( _ptrIndent_< T >(ptr, AVM_RTS_INDENT) );
+}
+
+
+// AVM_NO_INDENT("" , "", "")
+template< class T >
+inline _refIndent_< T > no_indent( const T & ref )
+{
+ return( _refIndent_< T >(ref, AVM_NO_INDENT) );
+}
+
+template< class T >
+inline _ptrIndent_< T > no_indent( T * ptr )
+{
+ return( _ptrIndent_< T >(ptr, AVM_NO_INDENT) );
+}
+
+
+} /* namespace sep */
+
+#endif /* PRINTER_MANIPULATORS_H_ */
diff --git a/org.eclipse.efm.symbex/src/printer/OutStream.cpp b/org.eclipse.efm.symbex/src/printer/OutStream.cpp
new file mode 100644
index 0000000..d0d2ce6
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/printer/OutStream.cpp
@@ -0,0 +1,410 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 17 déc. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "OutStream.h"
+
+#include <util/avm_assert.h>
+#include <util/avm_vfs.h>
+
+#include <sew/Workflow.h>
+
+#include <fml/workflow/WObject.h>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSOLE PROMPT
+ */
+const std::string & CONSOLE_DEBUG_PROMPT = "[DBG] ";
+
+const std::string & CONSOLE_SEW_PROMPT = "[SEW] ";
+
+const std::string & CONSOLE_CONFIG_PROMPT = "[CFG] ";
+
+const std::string & CONSOLE_SYMBEX_PROMPT = "[SBX] ";
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// OutStream
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * LOAD
+ * DISPOSE
+ */
+void OutStream::load()
+{
+ _avm_os_log_ = AVM_OS_COUT.OS;
+
+ _avm_os_trace_ = AVM_OS_COUT.OS;
+
+ _avm_os_tdd_ = AVM_OS_COUT.OS;
+}
+
+void OutStream::dispose()
+{
+ // AVM TRACE LOG << ofstream >>
+ if( _avm_os_log_ != NULL )
+ {
+ _avm_os_log_->flush();
+
+ if( (_avm_os_log_ != AVM_OS_COUT.OS) &&
+ (_avm_os_log_ != _avm_os_null_) )
+ {
+// _avm_os_log->close();
+ delete _avm_os_log_;
+ }
+ }
+ _avm_os_log_ = NULL;
+
+
+ // AVM TRACE DEBUG << ofstream >>
+ if( _avm_os_trace_ != NULL )
+ {
+ _avm_os_trace_->flush();
+
+ if( (_avm_os_trace_ != AVM_OS_COUT.OS) &&
+ (_avm_os_trace_ != _avm_os_null_) )
+ {
+// _avm_os_trace->close();
+ delete _avm_os_trace_;
+ }
+ }
+ _avm_os_trace_ = NULL;
+
+
+ // AVM TEST DRIVEN DEVELOPMENT << ofstream >>
+ if( _avm_os_tdd_ != NULL )
+ {
+ _avm_os_tdd_->flush();
+
+ if( (_avm_os_tdd_ != AVM_OS_COUT.OS) &&
+ (_avm_os_tdd_ != _avm_os_null_) )
+ {
+// _avm_os_tdd_->close();
+ delete _avm_os_tdd_;
+ }
+ }
+ _avm_os_tdd_ = NULL;
+
+
+ // AVM NULL << ofstream >>
+ if( _avm_os_null_ != NULL )
+ {
+ delete _avm_os_null_;
+ }
+}
+
+
+/**
+ * CONFIGURE
+ */
+/*
+// GLOBAL PROPERTY
+section PROPERTY
+ output#tab = " ";
+
+ fscn#tab = " ";
+
+ line#wrap#width = 80;
+ line#wrap#separator = "\n\t";
+endsection
+*/
+bool OutStream::configure(Workflow * aWorkflow)
+{
+ WObject * seqFORMAT = Query::getWSequenceOrElse(
+ aWorkflow->getParameterWObject(), "format", "PROPERTY");
+
+ // GLOBAL INDENT CHAR
+ std::string strTab = Query::getRegexWPropertyString(seqFORMAT,
+ CONS_WID2("output", "tab"), AVM_OUTPUT_INDENT.CHAR);
+
+ AVM_FSCN_INDENT.CHAR =
+ Query::getRegexWPropertyString(
+ seqFORMAT, CONS_WID2("fscn", "tab"),
+ (strTab != AVM_OUTPUT_INDENT.CHAR) ?
+ strTab : AVM_FSCN_INDENT.CHAR);
+
+ AVM_OUTPUT_INDENT.CHAR = strTab;
+
+ /*
+ * DEFAULT_WRAP_DATA
+ */
+ if( DEFAULT_WRAP_DATA.configure( seqFORMAT ) )
+ {
+ //!!NOTHING
+ }
+
+ // AVM TRACE LOG << ofstream >>
+ if( aWorkflow->hasDeveloperDebugLogFile() )
+ {
+ _avm_os_log_ = new std::ofstream(
+ aWorkflow->getDeveloperDebugLogFileLocation().c_str() );
+ if( (_avm_os_log_ == NULL) || _avm_os_log_->fail() )
+ {
+ _avm_os_log_ = _avm_os_null_;
+
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Failed to open AVM_OS_LOG << "
+ << aWorkflow->getDeveloperDebugLogFileLocation()
+ << " >> file in write mode !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ else
+ {
+ _avm_os_log_ = _avm_os_null_;
+ }
+
+ AVM_OS_LOG.OS = _avm_os_log_;
+
+
+ // AVM TRACE DEBUG << ofstream >>
+ if( aWorkflow->hasDeveloperDebugTraceFile() )
+ {
+ _avm_os_trace_ = new std::ofstream(
+ aWorkflow->getDeveloperDebugTraceFileLocation().c_str() );
+ if( (_avm_os_trace_ == NULL) || _avm_os_trace_->fail() )
+ {
+ _avm_os_trace_ = _avm_os_null_;
+
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Failed to open AVM_OS_TRACE << "
+ << aWorkflow->getDeveloperDebugTraceFileLocation()
+ << " >> file in write mode !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ else
+ {
+ _avm_os_trace_ = _avm_os_null_;
+ }
+
+ AVM_OS_TRACE.OS = _avm_os_trace_;
+
+
+ // AVM TEST DRIVEN DEVELOPMENT << ofstream >>
+ if( aWorkflow->hasTddReport() )
+ {
+ _avm_os_tdd_ = new std::ofstream(
+ aWorkflow->getTddReportLocation().c_str() );
+ if( (_avm_os_tdd_ == NULL) || _avm_os_tdd_->fail() )
+ {
+ _avm_os_tdd_ = _avm_os_null_;
+
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Failed to open AVM_OS_TDD << "
+ << aWorkflow->getTddReportLocation()
+ << " >> file in write mode !!!"
+ << SEND_EXIT;
+
+ return( false );
+ }
+ }
+ else
+ {
+ _avm_os_tdd_ = _avm_os_null_;
+ }
+
+ AVM_OS_TDD.OS = _avm_os_tdd_;
+
+ // For ASSERT
+ AVM_OS_THROW_EXCEPTION.OS.INDENT = AVM_OUTPUT_INDENT;
+
+ AVM_OS_THROW_ALERT.OS.INDENT = AVM_OUTPUT_INDENT;
+
+ return( true );
+}
+
+
+/**
+ * REPEAT
+ * COLUMN
+ * EMPHASIS
+ */
+OutStream & OutStream::operator<<(const AvmEMPHASIS & emphasis)
+{
+ if( emphasis.enableTab ) { ( *OS ) << INDENT.TABS; }
+ repeat(emphasis.emph, emphasis.count) << INDENT.EOL;
+
+ std::size_t count = emphasis.count + ( (emphasis.count > 2) ? -2 : 0 );
+ // for 2 spaces char --> ' ' emphasis.text ' '
+
+ std::size_t after = 0;
+ std::size_t before = 0;
+
+ // emphasis.header
+ if( not emphasis.header.empty() )
+ {
+ if( count > emphasis.header.size() )
+ {
+ after = (count - emphasis.header.size()) / 2;
+ before = count - after - emphasis.header.size();
+
+ if( emphasis.enableTab ) { ( *OS ) << INDENT.TABS; }
+ repeat(emphasis.emph, before) << ' ' << emphasis.header << ' ';
+ repeat(emphasis.emph, after) << INDENT.EOL;
+ }
+ else
+ {
+ if( emphasis.enableTab ) { ( *OS ) << INDENT.TABS; }
+ ( *OS ) << emphasis.emph << emphasis.emph
+ << ' ' << emphasis.header << INDENT.EOL;
+ }
+ }
+
+ // emphasis.body
+ if( not emphasis.body.empty() )
+ {
+ if( count > emphasis.body.size() )
+ {
+ std::size_t body_after = (count - emphasis.body.size()) / 2;
+
+ std::size_t space = 1;
+ bool rightSpace = false;
+ if( (after > 0) && (after < body_after) )
+ {
+ space += body_after - after;
+
+ rightSpace = ( ((emphasis.body.size() + before + after) % 2)
+ != (count % 2) );
+ }
+ else
+ {
+ after = body_after;
+
+ before = count - body_after - emphasis.body.size();
+ }
+
+ AvmREPEAT< char > center = REPEAT(' ', space);
+
+ if( emphasis.enableTab ) { ( *OS ) << INDENT.TABS; }
+ repeat(emphasis.emph, before) << center
+ << emphasis.body << center;
+ if( rightSpace ) { ( *OS ) << ' '; }
+ repeat(emphasis.emph, after) << INDENT.EOL;
+ }
+ else
+ {
+ if( emphasis.enableTab ) { ( *OS ) << INDENT.TABS; }
+ ( *OS ) << emphasis.emph << emphasis.emph
+ << ' ' << emphasis.body << INDENT.EOL;
+ }
+ }
+
+ if( emphasis.enableTab ) { ( *OS ) << INDENT.TABS; }
+ repeat(emphasis.emph, emphasis.count) << INDENT.EOL << std::flush;
+
+ return( *this );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// GLOBAL PRE-DEFINED STREAM
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * UTIL VARIABLE
+ * AVM_OS_NULL
+ */
+std::ostream * _avm_os_null_ = new std::ostream(NULL);
+
+NullOutStream AVM_OS_NULL;
+
+
+/**
+ * AVM COUT & CERR & DEBUG
+ */
+// !!! Due to Initialization order !!!
+//OutStream AVM_OS_COUT( std::cout , AVM_SPC_INDENT );
+OutStream AVM_OS_COUT( std::cout , "" , " " , "\n" );
+
+OutStream AVM_OS_CERR(
+ ((_AVM_EXEC_MODE_ == AVM_EXEC_SERVER_MODE) ? std::cout : std::cerr),
+// AVM_SPC_INDENT );
+ "" , " " , "\n" );
+
+OutStream AVM_OS_DEBUG( std::cout , "" , "\t" , "\n" );
+
+/**
+ * AVM LOG & TRACE FILE LOCATION
+ */
+std::string AVM_LOG_FILE_LOCATION;
+
+std::string AVM_TRACE_FILE_LOCATION;
+
+
+/**
+ * UTIL VARIABLE
+ * AVM_OS_LOG
+ */
+std::ostream * _avm_os_log_ = NULL;
+
+//OutStream AVM_OS_LOG( std::cout , AVM_SPC_INDENT );
+OutStream AVM_OS_LOG( std::cout , "" , " " , "\n" );
+
+
+/**
+ * UTIL VARIABLE
+ * AVM_OS_TRACE
+ */
+std::ostream * _avm_os_trace_ = NULL;
+
+//OutStream AVM_OS_TRACE( std::cout , AVM_SPC_INDENT );
+OutStream AVM_OS_TRACE( std::cout , "" , " " , "\n" );
+
+
+/**
+ * UTIL VARIABLE
+ * AVM_OS_WARN
+ */
+WarnOutstreamT AVM_OS_WARN(AVM_OS_CERR, AVM_OS_TRACE);
+
+/**
+ * UTIL VARIABLE
+ * AVM_OS_INFO
+ */
+InfoOutstreamT AVM_OS_INFO(AVM_OS_COUT, AVM_OS_TRACE);
+
+/**
+ * UTIL VARIABLE
+ * AVM_OS_CLOG
+ */
+InfoOutstreamT AVM_OS_CLOG(AVM_OS_COUT, AVM_OS_LOG);
+
+
+/**
+ * UTIL VARIABLE
+ * AVM_OS_TDD
+ * for Test Driven Development
+ */
+std::ostream * _avm_os_tdd_ = NULL;
+
+//OutStream AVM_OS_TDD( std::cout , AVM_TAB_INDENT );
+OutStream AVM_OS_TDD( std::cout , "" , "\t" , "\n" );
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/printer/OutStream.h b/org.eclipse.efm.symbex/src/printer/OutStream.h
new file mode 100644
index 0000000..65a4fb1
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/printer/OutStream.h
@@ -0,0 +1,1810 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 17 déc. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef PRINTER_OUTSTREAM_H_
+#define PRINTER_OUTSTREAM_H_
+
+#include <fstream>
+#include <iostream>
+#include <iomanip>
+#include <sstream>
+#include <stack>
+#include <string>
+
+#include <util/avm_debug.h>
+#include <util/avm_util.h>
+
+#include <printer/Manipulators.h>
+#include <printer/WrapStream.h>
+
+
+namespace sep
+{
+
+
+#define AVM_CHAR_SPC " "
+
+#define AVM_CHAR_TAB " "
+//#define AVM_CHAR_TAB "\t"
+
+
+class ParameterManager;
+class Workflow;
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// OutStream
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+extern std::ostream * _avm_os_null_;
+
+
+class OutStream
+{
+
+public:
+
+ /**
+ * ATTRIBUTE
+ */
+ std::ostream * OS;
+
+ WrapOstream * WRAP_OS;
+
+ AvmIndent INDENT;
+
+ std::size_t DEPTH;
+
+ std::stack< AvmIndent > STACK;
+
+ SymbexValueCSS VALUE_ARRAY_CSS;
+ SymbexValueCSS VALUE_PARAMS_CSS;
+ SymbexValueCSS VALUE_STRUCT_CSS;
+
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ OutStream(std::ostream * os = NULL,
+ const std::string & tabs = "",
+ const std::string & _char_ = "\t",
+ const std::string & eol = "\n")
+ : OS( os ),
+ WRAP_OS( NULL ),
+ INDENT( tabs, _char_ , eol ),
+ DEPTH( 0 ),
+ STACK( ),
+ VALUE_ARRAY_CSS ( "[ ", " , ", " ]" ),
+ VALUE_PARAMS_CSS( "( ", " , ", " )" ),
+ VALUE_STRUCT_CSS( "{ ", " , ", " }" )
+ {
+ STACK.push( INDENT );
+ }
+
+ OutStream(std::ostream * os, const AvmIndent & indent)
+ : OS( os ),
+ WRAP_OS( NULL ),
+ INDENT( indent ),
+ DEPTH( 0 ),
+ STACK( ),
+ VALUE_ARRAY_CSS ( "[ ", " , ", " ]" ),
+ VALUE_PARAMS_CSS( "( ", " , ", " )" ),
+ VALUE_STRUCT_CSS( "{ ", " , ", " }" )
+ {
+ STACK.push( INDENT );
+ }
+
+ OutStream(std::ostream * os, const OutStream & aos)
+ : OS( os ),
+ WRAP_OS( NULL ),
+ INDENT( aos.INDENT ),
+ DEPTH( 0 ),
+ STACK( ),
+ VALUE_ARRAY_CSS ( "[ ", " , ", " ]" ),
+ VALUE_PARAMS_CSS( "( ", " , ", " )" ),
+ VALUE_STRUCT_CSS( "{ ", " , ", " }" )
+ {
+ STACK.push( INDENT );
+ }
+
+
+ OutStream(std::ostream & os, const AvmIndent & indent)
+ : OS( & os ),
+ WRAP_OS( NULL ),
+ INDENT( indent ),
+ DEPTH( 0 ),
+ STACK( ),
+ VALUE_ARRAY_CSS ( "[ ", " , ", " ]" ),
+ VALUE_PARAMS_CSS( "( ", " , ", " )" ),
+ VALUE_STRUCT_CSS( "{ ", " , ", " }" )
+ {
+ STACK.push( INDENT );
+ }
+
+// OutStream(std::ostream & os,
+// const WrapData & wrapData, const AvmIndent & indent)
+// : OS( & os ),
+// WRAP_OS( new WrapOstream(os, wrapData) ),
+// INDENT( indent ),
+// DEPTH( 0 ),
+// STACK( ),
+// VALUE_ARRAY_CSS ( "[ ", " , ", " ]" ),
+// VALUE_PARAMS_CSS( "( ", " , ", " )" ),
+// VALUE_STRUCT_CSS( "{ ", " , ", " }" )
+// {
+// STACK.push( INDENT );
+//
+// OS = WRAP_OS;
+// }
+
+ OutStream(std::ostream & os, const OutStream & aos)
+ : OS( & os ),
+ WRAP_OS( NULL ),
+ INDENT( aos.INDENT ),
+ DEPTH( 0 ),
+ STACK( ),
+ VALUE_ARRAY_CSS ( "[ ", " , ", " ]" ),
+ VALUE_PARAMS_CSS( "( ", " , ", " )" ),
+ VALUE_STRUCT_CSS( "{ ", " , ", " }" )
+ {
+ STACK.push( INDENT );
+ }
+
+ OutStream(std::ostream & os,
+ const std::string & tabs = "",
+ const std::string & _char_ = "\t",
+ const std::string & eol = "\n")
+ : OS( & os ),
+ WRAP_OS( NULL ),
+ INDENT(tabs, _char_ , eol ),
+ DEPTH( 0 ),
+ STACK( ),
+ VALUE_ARRAY_CSS ( "[ ", " , ", " ]" ),
+ VALUE_PARAMS_CSS( "( ", " , ", " )" ),
+ VALUE_STRUCT_CSS( "{ ", " , ", " }" )
+ {
+ STACK.push( INDENT );
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~OutStream()
+ {
+ delete( WRAP_OS );
+ }
+
+
+ /**
+ * OS
+ * delete / destroy
+ */
+ inline virtual void deleteOS()
+ {
+ delete( OS );
+
+ OS = NULL;
+ }
+
+ inline void destroy()
+ {
+ if( (OS != NULL) && (OS != _avm_os_null_) &&
+ (OS != &(std::cout)) && (OS != &(std::cerr)) )
+ {
+ if( OS->good() )
+ {
+ (*OS) << std::flush;
+ }
+
+ deleteOS();
+ }
+ }
+
+
+ /**
+ * OS
+ * fail / good
+ */
+ inline virtual bool fail()
+ {
+ return( (OS == NULL) || OS->fail() );
+ }
+
+ inline virtual bool good()
+ {
+ return( (OS != NULL) && OS->good() );
+ }
+
+
+ /**
+ * OS
+ * isOpen / open / reopen
+ */
+ inline bool isOpen()
+ {
+ return( (OS != NULL) &&
+ (dynamic_cast< std::ofstream * >(OS) != NULL) &&
+ dynamic_cast< std::ofstream * >(OS)->is_open() );
+ }
+
+ inline bool open(const std::string & aFileLocation,
+ std::ios_base::openmode aMode)
+ {
+ OS = new std::ofstream(aFileLocation.c_str(), aMode);
+
+ return( (OS != NULL) && OS->good() );
+ }
+
+ inline bool reopen(const std::string & aFileLocation,
+ std::ios_base::openmode aMode)
+ {
+ if( isOpen() )
+ {
+ destroy();
+ }
+
+ return( open(aFileLocation.c_str(), aMode) );
+ }
+
+
+ /**
+ * TEST
+ * If is preferable...
+ */
+ inline bool preferablySTR()
+ {
+ return( INDENT.preferablySTR() );
+ }
+
+ inline bool preferablyFQN()
+ {
+ return( INDENT.preferablyFQN() );
+ }
+
+
+ /**
+ * restore default Symbex Value CSS
+ */
+ inline void restoreSymbexValueCSS()
+ {
+ VALUE_ARRAY_CSS = DEFAULT_SYMBEX_VALUE_ARRAY_CSS;
+ VALUE_PARAMS_CSS = DEFAULT_SYMBEX_VALUE_PARAMS_CSS;
+ VALUE_STRUCT_CSS = DEFAULT_SYMBEX_VALUE_STRUCT_CSS;
+ }
+
+ inline void setSymbexValueCSS(const SymbexValueCSS & vac,
+ const SymbexValueCSS & vpc, const SymbexValueCSS & vsc)
+ {
+ VALUE_ARRAY_CSS = vac;
+ VALUE_PARAMS_CSS = vpc;
+ VALUE_STRUCT_CSS = vsc;
+ }
+
+ /**
+ * flush()
+ */
+ inline virtual void flush() const
+ {
+ if( WRAP_OS != NULL )
+ {
+ WRAP_OS->flush();
+ }
+
+ if( OS != NULL )
+ {
+ OS->flush();
+ }
+ }
+
+
+ /**
+ * operator<<
+ */
+ // Need for polymorphism in functor like TAB or EOL family
+ inline virtual OutStream & operator<<( const std::string & x )
+ {
+ ( *OS ) << x;
+
+ return( *this );
+ }
+
+ template< class T >
+ inline OutStream & operator<<( const T & x )
+ {
+ ( *OS ) << x;
+
+ return( *this );
+ }
+
+
+ inline OutStream & operator<<( void (*op) ( OutStream & ) )
+ {
+ op( *this );
+
+ return( *this );
+ }
+
+ inline OutStream & operator<<(
+ std::ostream & (*op) ( std::ostream & ) )
+ {
+ op( *OS );
+
+ return( *this );
+ }
+
+
+ inline static void backspace(std::ostream * os)
+ {
+ if( os == &(std::cout) )
+ {
+ ( *os ) << '\b';
+ }
+ else if( os != NULL )
+ {
+ os->seekp(-1, std::ios::end);
+ }
+ }
+
+ inline virtual void backspace()
+ {
+ OutStream::backspace( OS );
+ }
+
+
+ inline void push()
+ {
+ if( /*STACK.empty() ||*/ (STACK.top() != INDENT) )
+ {
+ STACK.push( INDENT );
+ }
+ else
+ {
+ ++(STACK.top().REF_COUNT);
+ }
+ }
+
+ inline void pop()
+ {
+ INDENT = STACK.top();
+
+ if( STACK.top().REF_COUNT == 1 )
+ {
+ STACK.pop();
+ }
+ else
+ {
+ --(STACK.top().REF_COUNT);
+ }
+ }
+
+
+ /**
+ * MANIPULATORS
+ */
+ inline OutStream & operator<<(const WrapData & newWrap)
+ {
+ if( good() )
+ {
+ if( WRAP_OS != NULL )
+ {
+ delete( WRAP_OS );
+ }
+
+ OS->flush();
+
+ WRAP_OS = new WrapOstream(*OS, newWrap);
+
+ OS = WRAP_OS;
+ }
+
+ return( *this );
+ }
+
+ inline void end_wrap()
+ {
+ if( good() && (WRAP_OS != NULL) )
+ {
+ OS = WRAP_OS->mOS;
+
+ OS->flush();
+
+ delete( WRAP_OS );
+
+ WRAP_OS = NULL;
+ }
+ }
+
+
+ inline OutStream & operator<<(const AvmIndent & newIndent)
+ {
+ push();
+
+ INDENT = newIndent;
+
+ return( *this );
+ }
+
+
+// inline OutStream & operator<<(const AvmTAB & tab)
+// {
+// ( *OS ) << INDENT.TABS;
+//
+// for( ; tab.count > 1 ; --tab.count )
+// {
+// ( *OS ) << INDENT.CHAR;
+// }
+//
+// return( *this );
+// }
+//
+// inline OutStream & operator<<(const AvmEOL & eol)
+// {
+// for( ; eol.count > 0 ; --eol.count )
+// {
+// ( *OS ) << INDENT.EOL;
+// }
+//
+// return( *this );
+// }
+
+
+ inline OutStream & operator<<(const AvmINCR & incr)
+ {
+ OutStream::incr( incr.count );
+
+ return( *this );
+ }
+
+ inline OutStream & operator<<(const AvmDECR & decr)
+ {
+ OutStream::decr( decr.count );
+
+ return( *this );
+ }
+
+
+ /**
+ * <reference|pointer>.toStream( os )
+ */
+ template< class T >
+ inline OutStream & operator<<(const _refStream_< T > & obj)
+ {
+ obj.ref.toStream( *this );
+
+ return( *this );
+ }
+
+ template< class T >
+ inline OutStream & operator<<(const _ptrStream_< T > & obj)
+ {
+ if( obj.ptr != NULL )
+ {
+ obj.ptr->toStream( *this );
+ }
+ else
+ {
+ ( *OS ) << INDENT.TABS << "to_stream(<null>)" << INDENT.EOL;
+ }
+
+ return( *this );
+ }
+
+
+ /**
+ * <reference|pointer>.strHeader( os )
+ */
+ template< class T >
+ inline OutStream & operator<<(const _refHeader_< T > & obj)
+ {
+ obj.ref.strHeader( *this );
+
+ return( *this );
+ }
+
+ template< class T >
+ inline OutStream & operator<<(const _ptrHeader_< T > & obj)
+ {
+ if( obj.ptr != NULL )
+ {
+ obj.ptr->strHeader( *this );
+ }
+ else
+ {
+ ( *OS ) << "str_header(<null>)";
+ }
+
+ return( *this );
+ }
+
+
+ /**
+ * <reference|pointer>.strFQN( os )
+ */
+ template< class T >
+ inline OutStream & operator<<(const _refFQN_< T > & obj)
+ {
+ obj.ref.strFQN( *this );
+
+ return( *this );
+ }
+
+ template< class T >
+ inline OutStream & operator<<(const _ptrFQN_< T > & obj)
+ {
+ if( obj.ptr != NULL )
+ {
+ obj.ptr->strFQN( *this );
+ }
+ else
+ {
+ ( *OS ) << INDENT.TABS << "str_fqn(<null>)" << INDENT.EOL;
+ }
+
+ return( *this );
+ }
+
+
+
+
+ /**
+ * INCR <reference|pointer>.toStream( os ) DECR
+ */
+ template< class T >
+ inline OutStream & operator<<(const _refIncrIndent_< T > & obj)
+ {
+ incr();
+
+ obj.ref.toStream( *this );
+
+ decr();
+
+ return( *this );
+ }
+
+ template< class T >
+ inline OutStream & operator<<(const _ptrIncrIndent_< T > & obj)
+ {
+ if( obj.ptr != NULL )
+ {
+ incr();
+
+ obj.ptr->toStream( *this );
+
+ decr();
+ }
+ else
+ {
+ ( *OS ) << INDENT.TABS << INDENT.CHAR
+ << "incr_stream(<null>)" << INDENT.EOL;
+ }
+
+ return( *this );
+ }
+
+
+ /**
+ * INCR< count > <reference|pointer>.toStream( os ) DECR< count >
+ */
+ template< class T >
+ inline OutStream & operator<<(const _refIncrIndentCount_< T > & obj)
+ {
+ incr( obj.count );
+
+ obj.ref.toStream( *this );
+
+ decr( obj.count );
+
+ return( *this );
+ }
+
+ template< class T >
+ inline OutStream & operator<<(const _ptrIncrIndentCount_< T > & obj)
+ {
+ if( obj.ptr != NULL )
+ {
+ incr( obj.count );
+
+ obj.ptr->toStream( *this );
+
+ decr( obj.count );
+ }
+ else
+ {
+ OutStream::operator<<( tab(obj.count) );
+ ( *OS ) << "incr_count_stream(<null>)" << INDENT.EOL;
+ }
+
+ return( *this );
+ }
+
+
+ /**
+ * PUSH< AvmIndent > <reference|pointer>.toStream( os ) POP< AvmIndent >
+ */
+ template< class T >
+ inline OutStream & operator<<(const _refIndent_< T > & obj)
+ {
+ obj.ref.toStream( OutStream::operator<<( obj.indent ) );
+
+ pop();
+
+ return( *this );
+ }
+
+ template< class T >
+ inline OutStream & operator<<(const _ptrIndent_< T > & obj)
+ {
+ if( obj.ptr != NULL )
+ {
+ obj.ptr->toStream( OutStream::operator<<( obj.indent ) );
+
+ pop();
+ }
+ else
+ {
+ ( *OS ) << obj.indent.TABS << "push_stream_pop(<null>)" << obj.indent.EOL;
+ }
+
+ return( *this );
+ }
+
+
+ /**
+ * REPEAT
+ * COLUMN
+ * EMPHASIS
+ */
+ template< class T >
+ inline OutStream & repeat( const T & x , std::size_t count)
+ {
+ for( ; count > 0 ; --count )
+ {
+ ( *OS ) << x;
+ }
+
+ return( *this );
+ }
+
+ template< class T >
+ inline OutStream & operator<<(const AvmREPEAT< T > & aRepeat)
+ {
+ return( repeat< T >(aRepeat.pattern, aRepeat.count) );
+ }
+
+ OutStream & operator<<(const AvmEMPHASIS & emphasis);
+
+
+ /**
+ * INCR
+ * TAB DEPTH
+ */
+ inline void incr(std::size_t count)
+ {
+ INDENT.incr(count);
+
+ DEPTH += count;
+ }
+
+ inline void incr()
+ {
+ INDENT.incr();
+
+ DEPTH += 1;
+ }
+
+
+ inline OutStream & operator++()
+ {
+ incr();
+
+ return( *this );
+ }
+
+
+ /**
+ * DECR
+ * TAB DEPTH
+ */
+ inline void decr(std::size_t count)
+ {
+ INDENT.decr(count);
+
+ DEPTH = ( DEPTH > count ) ? (DEPTH - count) : 0;
+ }
+
+ inline void decr()
+ {
+ INDENT.decr();
+
+ DEPTH = ( DEPTH > 1 ) ? (DEPTH - 1) : 0;
+ }
+
+
+ inline OutStream & operator--()
+ {
+ decr();
+
+ return( *this );
+ }
+
+
+ /**
+ * save current INDENT
+ * set newIndent
+ * x.toStream( os , arg )
+ * restore old INDENT
+ */
+ template< class T , class P >
+ inline OutStream & toStream(const T & x,
+ const P & arg, const AvmIndent & newIndent)
+ {
+ push();
+
+ INDENT = newIndent;
+
+ x.toStream( *this , arg );
+
+ pop();
+
+ return( *this );
+ }
+
+
+ /**
+ * CAST
+ * std::ostream &
+ */
+ inline operator std::ostream & () const
+ {
+ return( *OS );
+ }
+
+
+ /**
+ * LOAD
+ * DISPOSE
+ */
+ static void load();
+ static void dispose();
+
+ /**
+ * CONFIGURE
+ */
+ static bool configure(Workflow * aWorkflow);
+
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// CONSOLE PROMPT
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+extern const std::string & CONSOLE_DEBUG_PROMPT;
+extern const std::string & CONSOLE_SEW_PROMPT;
+extern const std::string & CONSOLE_CONFIG_PROMPT;
+extern const std::string & CONSOLE_SYMBEX_PROMPT;
+
+
+inline void _DBG_(OutStream & os)
+{
+ os << CONSOLE_DEBUG_PROMPT;
+}
+
+inline void _SEW_(OutStream & os)
+{
+ os << CONSOLE_SEW_PROMPT;
+}
+
+inline void _CFG_(OutStream & os)
+{
+ os << CONSOLE_CONFIG_PROMPT;
+}
+
+inline void _SBX_(OutStream & os)
+{
+ os << CONSOLE_SYMBEX_PROMPT;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// SCOPE : for automatic PUSH / POP AvmIndent
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+struct ScopeNewIndent
+{
+ OutStream & OS;
+
+ AvmIndent INDENT;
+
+ ScopeNewIndent(OutStream & os, const AvmIndent & indent)
+ : OS( os ),
+ // save current indent
+ INDENT( os.INDENT )
+ {
+ // set new indent
+ os.INDENT = indent;
+ }
+
+ ScopeNewIndent(OutStream & os,
+ const std::string & tabs = "",
+ const std::string & _char_ = "\t",
+ const std::string & eol = "\n")
+ : OS( os ),
+ // save current indent
+ INDENT( os.INDENT )
+ {
+ // set new indent
+ os.INDENT = AvmIndent(tabs, _char_,eol);
+ }
+
+ ~ScopeNewIndent()
+ {
+ // restore old indent
+ OS.INDENT = INDENT;
+ }
+};
+
+
+/**
+ * SCOPE
+ * for automatic INCREMENT / DECREMENT
+ */
+struct ScopeIncrIndent
+{
+ OutStream & OS;
+
+ ScopeIncrIndent(OutStream & os)
+ : OS( os )
+ {
+ // increment indent
+ os.incr();
+ }
+
+ ~ScopeIncrIndent()
+ {
+ // decrement indent
+ OS.decr();
+ }
+};
+
+
+/**
+ * WrapData Manipulators
+ */
+inline void END_WRAP(OutStream & os)
+{
+ os.end_wrap();
+}
+
+inline void END_WRAP_EOL(OutStream & os)
+{
+ os.end_wrap();
+
+ os << os.INDENT.EOL;
+}
+
+/**
+ * AvmTAB
+ */
+inline void IGNORE_FIRST_TAB(OutStream & os)
+{
+ os.INDENT.IGNORE_FIRST_TAB = true;
+}
+
+
+inline void TAB(OutStream & os)
+{
+ if( os.INDENT.IGNORE_FIRST_TAB )
+ {
+ os.INDENT.IGNORE_FIRST_TAB = false;
+ }
+ else
+ {
+ os << os.INDENT.TABS;
+ }
+}
+
+inline void TAB1(OutStream & os)
+{
+ if( os.INDENT.IGNORE_FIRST_TAB )
+ {
+ os.INDENT.IGNORE_FIRST_TAB = false;
+ }
+ else
+ {
+ os << os.INDENT.TABS;
+ }
+}
+
+
+inline void TAB2(OutStream & os)
+{
+ os << os.INDENT.TABS << os.INDENT.CHAR;
+}
+
+inline void TAB3(OutStream & os)
+{
+ os << os.INDENT.TABS << os.INDENT.CHAR << os.INDENT.CHAR;
+}
+
+inline void TAB4(OutStream & os)
+{
+ os << os.INDENT.TABS << os.INDENT.CHAR << os.INDENT.CHAR
+ << os.INDENT.CHAR;
+}
+
+inline void TAB5(OutStream & os)
+{
+ os << os.INDENT.TABS << os.INDENT.CHAR << os.INDENT.CHAR
+ << os.INDENT.CHAR << os.INDENT.CHAR;
+}
+
+
+/**
+ * ++TAB
+ * --TAB
+ */
+inline void INCR_INDENT_TAB(OutStream & os)
+{
+ os.incr();
+
+ os << os.INDENT.TABS;
+}
+
+inline void DECR_INDENT_TAB(OutStream & os)
+{
+ os.decr();
+
+ os << os.INDENT.TABS;
+}
+
+inline void DECR_INDENT_TAB2(OutStream & os)
+{
+ os.decr();
+
+ os << os.INDENT.TABS << os.INDENT.CHAR;
+}
+
+
+inline void INCR2_INDENT_TAB(OutStream & os)
+{
+ os.incr(2);
+
+ os << os.INDENT.TABS;
+}
+
+inline void DECR2_INDENT_TAB(OutStream & os)
+{
+ os.decr(2);
+
+ os << os.INDENT.TABS;
+}
+
+inline void DECR2_INDENT_TAB2(OutStream & os)
+{
+ os.decr(2);
+
+ os << os.INDENT.TABS << os.INDENT.CHAR;
+}
+
+
+/**
+ * TAB++
+ * TAB--
+ */
+inline void TAB_INCR_INDENT(OutStream & os)
+{
+ os << os.INDENT.TABS;
+
+ os.incr();
+}
+
+inline void TAB_DECR_INDENT(OutStream & os)
+{
+ os << os.INDENT.TABS;
+
+ os.decr();
+}
+
+
+inline void TAB_INCR2_INDENT(OutStream & os)
+{
+ os << os.INDENT.TABS;
+
+ os.incr(2);
+}
+
+inline void TAB_DECR2_INDENT(OutStream & os)
+{
+ os << os.INDENT.TABS;
+
+ os.decr(2);
+}
+
+
+/**
+ * INCR
+ * DECR
+ * INDENTATION
+ */
+inline void INCR_INDENT(OutStream & os)
+{
+ os.incr();
+}
+
+inline void DECR_INDENT(OutStream & os)
+{
+ os.decr();
+}
+
+
+inline void INCR2_INDENT(OutStream & os)
+{
+ os.incr(2);
+}
+
+inline void DECR2_INDENT(OutStream & os)
+{
+ os.decr(2);
+}
+
+
+inline void INCR3_INDENT(OutStream & os)
+{
+ os.incr(3);
+}
+
+inline void DECR3_INDENT(OutStream & os)
+{
+ os.decr(3);
+}
+
+/**
+ * NEW
+ * END
+ * INDENTATION
+ */
+inline AvmIndent NEW_INDENT(
+ const std::string & tabs = "",
+ const std::string & _char_ = "\t",
+ const std::string & eol = "\n")
+{
+ return( AvmIndent(tabs, _char_, eol) );
+}
+
+inline AvmIndent & NEW_INDENT(AvmIndent & indent)
+{
+ return( indent );
+}
+
+
+inline AvmIndent NEW_LTRIM_INDENT(const AvmIndent & indent)
+{
+ return( AvmIndent("", indent.CHAR, indent.EOL) );
+}
+
+inline AvmIndent NEW_LTRIM_INDENT(OutStream & os)
+{
+ return( AvmIndent("", os.INDENT.CHAR, os.INDENT.EOL) );
+}
+
+
+inline void END_INDENT(OutStream & os)
+{
+ os.pop();
+}
+
+inline void END_INDENT_EOL(OutStream & os)
+{
+ os.pop();
+
+ os << os.INDENT.EOL;
+
+AVM_IF_DEBUG_LEVEL_GTE_MEDIUM
+ os << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_GTE_MEDIUM
+}
+
+
+/**
+ * BackSpace
+ */
+inline void BACKSPACE(OutStream & os)
+{
+ os.backspace();
+}
+
+inline void BACKSPACE_TAB(OutStream & os)
+{
+ os.backspace();
+
+ os << os.INDENT.TABS;
+}
+
+
+/**
+ * AvmEOL
+ */
+inline void EOL(OutStream & os)
+{
+ os << os.INDENT.EOL;
+
+AVM_IF_DEBUG_LEVEL_GTE_MEDIUM
+ os << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_GTE_MEDIUM
+}
+
+inline void EOL_TAB(OutStream & os)
+{
+ os << os.INDENT.EOL << os.INDENT.TABS;
+
+AVM_IF_DEBUG_LEVEL_GTE_MEDIUM
+ os << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_GTE_MEDIUM
+}
+
+inline void EOL_TAB2(OutStream & os)
+{
+ os << os.INDENT.EOL << os.INDENT.TABS << os.INDENT.CHAR;
+
+AVM_IF_DEBUG_LEVEL_GTE_MEDIUM
+ os << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_GTE_MEDIUM
+}
+
+inline void EOL_TAB3(OutStream & os)
+{
+ os << os.INDENT.EOL << os.INDENT.TABS
+ << os.INDENT.CHAR << os.INDENT.CHAR;
+
+AVM_IF_DEBUG_LEVEL_GTE_MEDIUM
+ os << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_GTE_MEDIUM
+}
+
+inline void EOL_FLUSH(OutStream & os)
+{
+ os << os.INDENT.EOL << std::flush;
+}
+
+
+inline void EOL2(OutStream & os)
+{
+ os << os.INDENT.EOL << os.INDENT.EOL;
+
+AVM_IF_DEBUG_LEVEL_GTE_MEDIUM
+ os << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_GTE_MEDIUM
+}
+
+inline void EOL2_TAB(OutStream & os)
+{
+ os << os.INDENT.EOL << os.INDENT.EOL << os.INDENT.TABS;
+
+AVM_IF_DEBUG_LEVEL_GTE_MEDIUM
+ os << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_GTE_MEDIUM
+}
+
+inline void EOL2_FLUSH(OutStream & os)
+{
+ os << os.INDENT.EOL << os.INDENT.EOL << std::flush;
+}
+
+
+/**
+ * ++TAB
+ * --TAB
+ */
+inline void INCR_EOL(OutStream & os)
+{
+ os.incr();
+
+ os << os.INDENT.EOL;
+
+AVM_IF_DEBUG_LEVEL_GTE_MEDIUM
+ os << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_GTE_MEDIUM
+}
+
+inline void DECR_EOL(OutStream & os)
+{
+ os.decr();
+
+ os << os.INDENT.EOL;
+
+AVM_IF_DEBUG_LEVEL_GTE_MEDIUM
+ os << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_GTE_MEDIUM
+}
+
+
+inline void EOL_INCR_INDENT(OutStream & os)
+{
+ os << os.INDENT.EOL;
+
+AVM_IF_DEBUG_LEVEL_GTE_MEDIUM
+ os << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_GTE_MEDIUM
+
+ os.incr();
+}
+
+inline void EOL_DECR_INDENT(OutStream & os)
+{
+ os << os.INDENT.EOL;
+
+AVM_IF_DEBUG_LEVEL_GTE_MEDIUM
+ os << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_GTE_MEDIUM
+
+ os.decr();
+}
+
+
+inline void EOL_INCR2_INDENT(OutStream & os)
+{
+ os << os.INDENT.EOL;
+
+AVM_IF_DEBUG_LEVEL_GTE_MEDIUM
+ os << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_GTE_MEDIUM
+
+ os.incr(2);
+}
+
+inline void EOL_DECR2_INDENT(OutStream & os)
+{
+ os << os.INDENT.EOL;
+
+AVM_IF_DEBUG_LEVEL_GTE_MEDIUM
+ os << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_GTE_MEDIUM
+
+ os.decr(2);
+}
+
+inline void EOL_FLUSH_DECR_INDENT(OutStream & os)
+{
+ os << os.INDENT.EOL << std::flush;
+
+ os.decr();
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// StringOutStream
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class StringOutStream : public OutStream
+{
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ std::ostringstream oss;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ StringOutStream(const AvmIndent & indent = AVM_TAB_INDENT)
+ : OutStream( oss , indent )
+ {
+ //!! NOTHING
+ }
+
+ StringOutStream(
+ const std::string & tabs,
+ const std::string & _char_ = "\t",
+ const std::string & eol = "\n")
+ : OutStream( oss , tabs , _char_ , eol )
+ {
+ //!! NOTHING
+ }
+
+ StringOutStream(const WrapData & wrapData,
+ const AvmIndent & indent = AVM_TAB_INDENT)
+ : OutStream( oss , indent )
+ {
+ OutStream::operator<<( wrapData );
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~StringOutStream()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * str()
+ */
+ inline std::string str() const
+ {
+ OutStream::flush();
+
+ return( oss.str() );
+ }
+
+ inline void str(const std::string & buf)
+ {
+ OutStream::flush();
+
+ oss.str( buf );
+ }
+
+ /**
+ * c_str()
+ */
+ inline const char * c_str() const
+ {
+ OutStream::flush();
+
+ return( oss.str().c_str() );
+ }
+
+
+ /**
+ * CAST
+ * std::string
+ * const char *
+ */
+ inline operator std::string () const
+ {
+ OutStream::flush();
+
+ return( oss.str() );
+ }
+
+// inline operator const char * () const
+// {
+// OutStream::flush();
+//
+// return( oss.str().c_str() );
+// }
+
+
+ /**
+ * operator<<
+ */
+ template< class T >
+ inline StringOutStream & operator<<( const T & x )
+ {
+ OutStream::operator<<( x );
+
+ return( *this );
+ }
+
+
+ inline StringOutStream & operator<<(
+ void (*op) ( StringOutStream & ) )
+ {
+ op( *this );
+
+ return( *this );
+ }
+
+ inline StringOutStream & operator<<( void (*op) ( OutStream & ) )
+ {
+ op( *this );
+
+ return( *this );
+ }
+
+ inline StringOutStream & operator<<(
+ std::ostream & (*op) ( std::ostream & ) )
+ {
+ op( *this );
+
+ return( *this );
+ }
+
+};
+
+/**
+ * TYPEDEF
+ * to_string() template replacement by OSS()
+ */
+typedef StringOutStream OSS;
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class NullOutStream : public OutStream
+{
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ NullOutStream()
+ : OutStream( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~NullOutStream()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * operator<<
+ */
+ template< class T >
+ inline NullOutStream & operator<<(const T & x)
+ {
+ return( *this );
+ }
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// PairOutStream
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class PairOutStream
+{
+
+public:
+ /**
+ * ATTRIBUTES
+ */
+ OutStream & OS1;
+ OutStream & OS2;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ PairOutStream(OutStream & os1, OutStream & os2)
+ : OS1( os1 ) , OS2( os2 )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~PairOutStream()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * operator<<
+ */
+ template< class T >
+ inline PairOutStream & operator<<( const T & x )
+ {
+ OS1 << x;
+ OS2 << x;
+
+ return( *this );
+ }
+
+
+ inline PairOutStream & operator<<( void (*op) ( OutStream & ) )
+ {
+ op( OS1 );
+ op( OS2 );
+
+ return( *this );
+ }
+
+ inline PairOutStream & operator<<(
+ std::ostream & (*op) ( std::ostream & ) )
+ {
+ op( OS1 );
+ op( OS2 );
+
+ return( *this );
+ }
+
+
+ inline virtual void backspace()
+ {
+ OS1.backspace();
+ OS2.backspace();
+ }
+
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// TripleOutStream
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class TripleOutStream
+{
+
+public:
+ /**
+ * ATRIBUTES
+ */
+ OutStream & OS1;
+ OutStream & OS2;
+ OutStream & OS3;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ TripleOutStream(OutStream & os1, OutStream & os2, OutStream & os3)
+ : OS1( os1 ) , OS2( os2 ) , OS3( os3 )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~TripleOutStream()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * operator<<
+ */
+ template< class T >
+ inline TripleOutStream & operator<<( const T & x )
+ {
+ OS1 << x;
+ OS2 << x;
+ OS3 << x;
+
+ return( *this );
+ }
+
+
+ inline TripleOutStream & operator<<( void (*op) ( OutStream & ) )
+ {
+ op( OS1 );
+ op( OS2 );
+ op( OS3 );
+
+ return( *this );
+ }
+
+ inline TripleOutStream & operator<<(
+ std::ostream & (*op) ( std::ostream & ) )
+ {
+ op( OS1 );
+ op( OS2 );
+ op( OS3 );
+
+ return( *this );
+ }
+
+
+ inline virtual void backspace()
+ {
+ OS1.backspace();
+ OS2.backspace();
+ OS3.backspace();
+ }
+
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// operator<<
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+#define AVM_OS_STREAM( T ) \
+inline OutStream & operator<<(OutStream & os, const T & anElement) \
+{ \
+ anElement.toStream( os ); \
+ return( os ); \
+} \
+inline StringOutStream & operator<<(StringOutStream & os, const T & anElement) \
+{ \
+ anElement.toStream( os ); \
+ return( os ); \
+} \
+inline PairOutStream & operator<<(PairOutStream & os, const T & anElement) \
+{ \
+ anElement.toStream( os.OS1 ); \
+ anElement.toStream( os.OS2 ); \
+ return( os ); \
+} \
+inline TripleOutStream & operator<<(TripleOutStream & os, const T & anElement) \
+{ \
+ anElement.toStream( os.OS1 ); \
+ anElement.toStream( os.OS2 ); \
+ anElement.toStream( os.OS3 ); \
+ return( os ); \
+}
+
+
+#define AVM_OS_STREAM_COLLECTION( T ) \
+inline OutStream & operator<<(OutStream & os, const T & anElement) \
+{ \
+ T::const_iterator endIt = anElement.end(); \
+ for( T::const_iterator it = anElement.begin() ; it != endIt ; ++it ) \
+ { \
+ os << (*it); \
+ } \
+ return( os ); \
+} \
+inline PairOutStream & operator<<(PairOutStream & os, const T & anElement) \
+{ \
+ T::const_iterator endIt = anElement.end(); \
+ for( T::const_iterator it = anElement.begin() ; it != endIt ; ++it ) \
+ { \
+ os << (*it); \
+ } \
+ return( os ); \
+} \
+inline TripleOutStream & operator<<(TripleOutStream & os, const T & anElement) \
+{ \
+ T::const_iterator endIt = anElement.end(); \
+ for( T::const_iterator it = anElement.begin() ; it != endIt ; ++it ) \
+ { \
+ os << (*it); \
+ } \
+ return( os ); \
+} \
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// SAVE & REDIRECT & RESTORE STREAMBUF
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+// save original stream::sbuf
+// redirect stream::sbuf
+#define STREAMBUF_SAVE_REDIRECT( originalStream , targetStream ) \
+ std::streambuf * saveSBUF = originalStream.rdbuf(); \
+ originalStream.rdbuf( targetStream.rdbuf() );
+
+
+// restore the original stream::sbuf
+#define STREAMBUF_RESTORE( originalStream ) \
+ originalStream.rdbuf( saveSBUF );
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// GLOBAL PRE-DEFINED STREAM
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * UTIL VARIABLE
+ * AVM_OS_NULL
+ */
+extern std::ostream * _avm_os_null_;
+
+extern NullOutStream AVM_OS_NULL;
+
+
+/**
+ * AVM COUT & CERR & DEBUG
+ */
+extern OutStream AVM_OS_COUT;
+
+extern OutStream AVM_OS_CERR;
+
+extern OutStream AVM_OS_DEBUG;
+
+
+/**
+ * AVM LOG & TRACE FILE LOCATION
+ */
+extern std::string AVM_LOG_FILE_LOCATION;
+
+extern std::string AVM_TRACE_FILE_LOCATION;
+
+
+/**
+ * UTIL VARIABLE
+ * AVM_OS_LOG
+ */
+extern std::ostream * _avm_os_log_;
+
+extern OutStream AVM_OS_LOG;
+
+
+/**
+ * UTIL VARIABLE
+ * AVM_OS_TRACE
+ */
+extern std::ostream * _avm_os_trace_;
+
+extern OutStream AVM_OS_TRACE;
+
+
+/**
+ * UTIL VARIABLE
+ * AVM_OS_WARN as AVM_OS_CERR & AVM_OS_TRACE
+ */
+typedef PairOutStream WarnOutstreamT;
+
+extern WarnOutstreamT AVM_OS_WARN;
+
+/**
+ * UTIL VARIABLE
+ * AVM_OS_INFO as AVM_OS_COUT & AVM_OS_TRACE
+ */
+typedef PairOutStream InfoOutstreamT;
+
+extern InfoOutstreamT AVM_OS_INFO;
+
+/**
+ * UTIL VARIABLE
+ * AVM_OS_CLOG as AVM_OS_COUT & AVM_OS_LOG
+ */
+typedef PairOutStream CLogOutstreamT;
+
+extern InfoOutstreamT AVM_OS_CLOG;
+
+/**
+ * UTIL VARIABLE
+ * AVM_OS_TDD
+ * for Test Driven Development
+ */
+extern std::ostream * _avm_os_tdd_;
+
+extern OutStream AVM_OS_TDD;
+
+
+} /* namespace sep */
+#endif /* PRINTER_OUTSTREAM_H_ */
diff --git a/org.eclipse.efm.symbex/src/printer/WrapStream.cpp b/org.eclipse.efm.symbex/src/printer/WrapStream.cpp
new file mode 100644
index 0000000..c434546
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/printer/WrapStream.cpp
@@ -0,0 +1,186 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 2 juin 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#include "WrapStream.h"
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+
+namespace sep {
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// WrapOstream
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+WrapData DEFAULT_WRAP_DATA( 80, 0, 4, "\n\t" );
+
+
+bool WrapData::configure(WObject * wfParameterObject)
+{
+ if( wfParameterObject != WObject::_NULL_ )
+ {
+ DEFAULT_WRAP_DATA.TAB_WIDTH =
+ Query::getRegexWPropertyPosSizeT(wfParameterObject,
+ CONS_WID3("char", "tab", "width"),
+ DEFAULT_WRAP_DATA.TAB_WIDTH);
+
+ DEFAULT_WRAP_DATA.LINE_WIDTH =
+ Query::getRegexWPropertyPosSizeT(wfParameterObject,
+ CONS_WID3("line", "wrap", "width"),
+ DEFAULT_WRAP_DATA.LINE_WIDTH);
+
+ DEFAULT_WRAP_DATA.SEPARATOR =
+ Query::getRegexWPropertyString(wfParameterObject,
+ CONS_WID3("line", "wrap", "separator"),
+ DEFAULT_WRAP_DATA.SEPARATOR);
+
+ StringTools::replaceAll(DEFAULT_WRAP_DATA.SEPARATOR, "\\t" , "\t");
+ StringTools::replaceAll(DEFAULT_WRAP_DATA.SEPARATOR, "\\n" , "\n");
+ }
+
+ return( true );
+}
+
+
+// This is basically a line-buffering stream mBuffer.
+// The algorithm is:
+// - Explicit end of line ("\r" or "\n"): we flush our mBuffer
+// to the underlying stream's mBuffer, and set our record of
+// the line length to 0.
+// - An "alert" character: sent to the underlying stream
+// without recording its length, since it doesn't normally
+// affect the a appearance of the output.
+// - tab: treated as occupying `tab_width` characters, but is
+// passed through undisturbed (but if we wanted to expand it
+// to `tab_width` spaces, that would be pretty easy to do so
+// you could adjust the tab-width if you wanted.
+// - Everything else: really basic buffering with word wrapping.
+// We try to add the character to the mBuffer, and if it exceeds
+// our line width, we search for the last space/tab in the
+// mBuffer and break the line there. If there is no space/tab,
+// we break the line at the limit.
+WrapStreambuf::int_type WrapStreambuf::overflow(int_type c)
+{
+ if (traits_type::eq_int_type(traits_type::eof(), c))
+ {
+ return traits_type::not_eof(c);
+ }
+ switch (c)
+ {
+ case '\n':
+ case '\r':
+ {
+ mBuffer += c;
+ mCharCount = 0;
+
+ int_type rc = mStreambuf->sputn(mBuffer.c_str(), mBuffer.size());
+
+ mBuffer.clear();
+
+ return rc;
+ }
+
+ case '\a':
+ {
+ return mStreambuf->sputc(c);
+ }
+
+ case '\t':
+ {
+ if( mCharCount > mWrapData.LINE_WIDTH )
+ {
+ mStreambuf->sputn(mWrapData.SEPARATOR.c_str(),
+ mWrapData.SEPARATOR.size());
+
+ mCharCount = mBuffer.size();
+ }
+
+ mBuffer += c;
+ mCharCount += (mWrapData.TAB_WIDTH -
+ mCharCount % mWrapData.TAB_WIDTH);
+
+ mStreambuf->sputn(mBuffer.c_str(), mBuffer.size());
+ mBuffer.clear();
+
+ return c;
+ }
+ case ' ':
+ case ')':
+ case '}':
+ case ']':
+ case '/':
+// case '.':
+ {
+ if( mCharCount > mWrapData.LINE_WIDTH )
+ {
+ mStreambuf->sputn(mWrapData.SEPARATOR.c_str(),
+ mWrapData.SEPARATOR.size());
+ mCharCount = mBuffer.size();
+ }
+
+ mBuffer += c;
+ ++mCharCount;
+
+ mStreambuf->sputn(mBuffer.c_str(), mBuffer.size());
+ mBuffer.clear();
+
+ return c;
+ }
+
+
+ default:
+ {
+ if( mBuffer.size() >= mWrapData.LINE_WIDTH )
+ {
+ mStreambuf->sputn(mBuffer.c_str(), mBuffer.size());
+ mBuffer.clear();
+
+ mStreambuf->sputn(mWrapData.SEPARATOR.c_str(),
+ mWrapData.SEPARATOR.size());
+
+ mCharCount = 0;
+ }
+
+// if (mCharCount >= mWrapData.LINE_WIDTH)
+// {
+// string_type::size_type wpos = mBuffer.find_last_of(" \t");
+// if (wpos != string_type::npos)
+// {
+// mStreambuf->sputn(mBuffer.c_str(), wpos);
+// mCharCount = mBuffer.size()-wpos-1;
+// mBuffer = string_type(mBuffer, wpos+1);
+// }
+// else
+// {
+// mStreambuf->sputn(mBuffer.c_str(), mBuffer.size());
+// mBuffer.clear();
+// mCharCount = 0;
+// }
+// mStreambuf->sputc('\n');
+// }
+
+ mBuffer += c;
+ ++mCharCount;
+
+ return c;
+ }
+ }
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/printer/WrapStream.h b/org.eclipse.efm.symbex/src/printer/WrapStream.h
new file mode 100644
index 0000000..855172d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/printer/WrapStream.h
@@ -0,0 +1,232 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 2 juin 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#ifndef PRINTER_WRAPSTREAM_H_
+#define PRINTER_WRAPSTREAM_H_
+
+#include <iostream>
+#include <string>
+
+namespace sep
+{
+
+
+class WObject;
+
+
+////////////////////////////////////////////////////////////////////////////////
+// WrapData
+////////////////////////////////////////////////////////////////////////////////
+
+struct WrapData
+{
+ /**
+ * ATTRIBUTES
+ */
+ std::size_t LINE_WIDTH;
+
+ std::size_t INIT_WIDTH;
+
+ std::size_t TAB_WIDTH;
+
+ std::string SEPARATOR;
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ WrapData(std::size_t lineWidth,
+ std::size_t initWidth = 0, std::size_t tabWidth = 4,
+ const std::string & wrapSeparator = "\n\t")
+ : LINE_WIDTH( lineWidth ),
+ INIT_WIDTH( initWidth ),
+ TAB_WIDTH( tabWidth ),
+ SEPARATOR( wrapSeparator )
+ {
+ //!! NOTHING
+ }
+
+ WrapData(std::size_t initWidth, const WrapData & aWrapData)
+ : LINE_WIDTH( aWrapData.LINE_WIDTH ),
+ INIT_WIDTH( initWidth ),
+ TAB_WIDTH( aWrapData.TAB_WIDTH ),
+ SEPARATOR( aWrapData.SEPARATOR )
+ {
+ //!! NOTHING
+ }
+
+ WrapData(const WrapData & aWrapData)
+ : LINE_WIDTH( aWrapData.LINE_WIDTH ),
+ INIT_WIDTH( aWrapData.INIT_WIDTH ),
+ TAB_WIDTH( aWrapData.TAB_WIDTH ),
+ SEPARATOR( aWrapData.SEPARATOR )
+ {
+ //!! NOTHING
+ }
+
+
+ bool configure(WObject * wfParameterObject);
+
+};
+
+
+extern WrapData DEFAULT_WRAP_DATA;
+
+
+/**
+ * Manipulators
+ */
+inline WrapData WRAP(std::size_t lineWidth,
+ std::size_t initWidth = 0, std::size_t tabWidth = 4,
+ const std::string & wrapSeparator = "\n\t")
+{
+ return( WrapData(lineWidth, initWidth, tabWidth, wrapSeparator) );
+}
+
+inline WrapData WRAP(std::size_t lineWidth,
+ const std::string & wrapSeparator)
+{
+ return( WrapData(lineWidth, 0, 4, wrapSeparator) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// WrapStreambuf
+////////////////////////////////////////////////////////////////////////////////
+
+class WrapStreambuf : public std::streambuf
+{
+
+protected:
+ /**
+ * TYPEDEF
+ */
+ typedef std::basic_string<char_type> string_type;
+
+ /**
+ * ATTRIBUTE
+ */
+ std::streambuf * mStreambuf;
+
+ WrapData mWrapData;
+
+ std::size_t mCharCount;
+
+ string_type mBuffer;
+
+
+public:
+ /**
+ * CONSTRUCTORS
+ */
+ WrapStreambuf(std::streambuf * buf, const WrapData & wrapData)
+ : mStreambuf( buf ),
+ mWrapData( wrapData ),
+ mCharCount( wrapData.INIT_WIDTH ),
+ mBuffer( )
+ {
+ //!! NOTHING
+ }
+
+ WrapStreambuf(std::streambuf * buf, std::size_t lineWidth,
+ std::size_t initWidth = 0, std::size_t tabWidth = 4,
+ const std::string & wrapSeparator = "\n\t")
+ : mStreambuf( buf ),
+ mWrapData( lineWidth, initWidth, tabWidth, wrapSeparator ),
+ mCharCount( initWidth ),
+ mBuffer( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ ~WrapStreambuf()
+ {
+ flush();
+ }
+
+ /**
+ * flush()
+ */
+ inline int_type flush() const
+ {
+ return( mStreambuf->sputn(mBuffer.c_str(), mBuffer.size()) );
+
+ }
+
+private:
+ /**
+ * overflow(...)
+ */
+ int_type overflow(int_type c);
+
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+// WrapOstream
+////////////////////////////////////////////////////////////////////////////////
+
+class WrapOstream : public std::ostream
+{
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ WrapStreambuf mWrapStreambuf;
+
+public:
+ std::ostream * mOS;
+
+ /**
+ * CONSTRUCTORS
+ */
+ WrapOstream(std::ostream & os, const WrapData & wrapData)
+ : std::ostream( & mWrapStreambuf ),
+ mWrapStreambuf( os.rdbuf(), wrapData ),
+ mOS( & os )
+ {
+ //!! NOTHING
+ }
+
+ WrapOstream(std::ostream & os, std::size_t wrapWidth,
+ std::size_t initialCharCount = 0,
+ const std::string & wrapSeparator = "\n\t")
+ : std::ostream( & mWrapStreambuf ),
+ mWrapStreambuf( os.rdbuf(), wrapWidth,
+ initialCharCount, 4, wrapSeparator ),
+ mOS( & os )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * flush()
+ */
+ inline void flush() const
+ {
+ mWrapStreambuf.flush();
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* PRINTER_WRAPSTREAM_H_ */
diff --git a/org.eclipse.efm.symbex/src/sew/CMakeLists.txt b/org.eclipse.efm.symbex/src/sew/CMakeLists.txt
new file mode 100644
index 0000000..1b1f7ad
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/sew/CMakeLists.txt
@@ -0,0 +1,18 @@
+# =============================================================================
+# CMake file for the SEW library
+# =============================================================================
+
+# C++ source files to take into account (all files matching patterns)
+file (GLOB_RECURSE SEW_CXX_SRC_FILES *.cpp *.h)
+
+# Target to build
+add_library (sew STATIC ${SEW_CXX_SRC_FILES})
+
+# Include directories (internal)
+target_include_directories (sew PUBLIC ..) # FIXME : explicit the dependencies lib by lib
+
+# Target include directories (external)
+target_include_directories (sew PUBLIC ${GMP_INCLUDE_DIR} ${GMPXX_INCLUDE_DIR})
+target_include_directories (sew PUBLIC ${BOOST_ROOT})
+
+
diff --git a/org.eclipse.efm.symbex/src/sew/Configuration.cpp b/org.eclipse.efm.symbex/src/sew/Configuration.cpp
new file mode 100644
index 0000000..7c77e6f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/sew/Configuration.cpp
@@ -0,0 +1,955 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 14 déc. 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#include "Configuration.h"
+
+#include <fam/serializer/GraphVizExecutionGraphSerializer.h>
+#include <fam/serializer/GraphVizStatemachineSerializer.h>
+
+#include <fml/executable/ExecutableSystem.h>
+
+#include <fml/workflow/Query.h>
+
+#include <sew/SymbexEngine.h>
+#include <sew/Workflow.h>
+
+#include <util/avm_vfs.h>
+
+#include <boost/format.hpp>
+
+
+namespace sep
+{
+
+
+/**
+ * ATTRIBUTES
+ * GLOBAL
+ */
+const std::string Configuration::SPECIFICATION_FILE_EXTENSION = ".xlia";
+
+const std::string Configuration::EXECUTABLE_FILE_EXTENSION = ".fexe";
+
+const std::string Configuration::SYMBEX_GRAPH_FILE_EXTENSION = ".fet";
+
+const std::string Configuration::SYMBEX_SCENARII_FILE_EXTENSION = ".fscn";
+
+const std::string Configuration::GRAPHVIZ_FILE_EXTENSION = ".gv";
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+Configuration::Configuration(SymbexEngine & aSymbexEngine, Workflow & aWorkflow)
+: NamedElement( CLASS_KIND_T( Configuration ) , aSymbexEngine ),
+mSymbexEngine( aSymbexEngine ),
+mWorkflow( aWorkflow ),
+
+mWObjectManager( WObject::FML_FQN_ROOT ),
+mProjectSourceLocation( ),
+mSpecificationFileLocation( ),
+
+mOwnedSpecificationFlag( false ),
+
+mOutputFilenamePattern( "output_%1%" ),
+mDebugFilenamePattern ( "debug_%1%" ),
+
+mOutputExecutableEnabledGenerationFlag( false ),
+mOutputExecutableFileLocation( ),
+
+mOutputSymbexGraphEnabledGenerationFlag( false ),
+mOutputSymbexGraphFileLocation( ),
+
+mOutputSymbexScenariiEnabledGenerationFlag( false ),
+mOutputSymbexScenariiFileLocation( ),
+
+mDebugStageEnabledFlag( false ),
+mDebugParsingStageEnabledFlag( false ),
+mDebugCompilingStageEnabledFlag( false ),
+mDebugLoadingStageEnabledFlag( false ),
+mDebugComputingEnabledFlag( false ),
+
+// Symbex Threading config
+mMultitaskingFlag( false ),
+mThreadCount( 1 ),
+
+// Shell config
+mInconditionalStopMarkerLocation( ),
+
+mSpecification( NULL ),
+mExecutableSystem( NULL ),
+
+mTableOfRID( ),
+mMainExecutionContext( ),
+mInputContext( ),
+mTrace( )
+{
+ //!! NOTHING
+}
+
+/**
+ * DESTRUCTOR
+ */
+Configuration::~Configuration()
+{
+ destroy();
+}
+
+void Configuration::destroy()
+{
+ if( mOwnedSpecificationFlag )
+ {
+ avm_report(AVM_OS_LOG, "Configuration::destroy");
+
+ if( mTrace.populated() )
+ {
+ ExecutionContext * itEC;
+ while( mTrace.nonempty() )
+ {
+ mTrace.pop_last_to( itEC );
+ mTrace.remove( itEC );
+ sep::destroyElement( itEC );
+ }
+ }
+ else if( mTrace.nonempty() )
+ {
+ sep::destroyElement( mTrace.pop_last() );
+ }
+
+ mMainExecutionContext.destroy();
+
+ // Attention:> Necessaire pour briser des references circulaires !!!!
+ destroyRIDRunningCode();
+
+ mExecutableSystem.destroy();
+
+ avm_report(AVM_OS_LOG, "~Configuration::destroy:> "
+ "after destruction of executable & execution context");
+
+ mSpecification.destroy();
+
+ avm_report(AVM_OS_LOG, "~Configuration::destroy:> "
+ "after destruction of specification");
+ }
+}
+
+// Attention:> Necessaire pour briser des references circulaires !!!!
+void Configuration::destroyRIDRunningCode()
+{
+ TableOfRuntimeID_T::iterator it = mTableOfRID.begin();
+ TableOfRuntimeID_T::iterator itEnd = mTableOfRID.end();
+ for( ; it != itEnd ; ++it )
+ {
+ (*it).finalize();
+ }
+
+// mTableOfRID.clear();
+}
+
+
+
+/**
+ * CONFIGURE
+ */
+/*
+section project / SPECIFICATION
+ src = <source-folder-path>
+
+ file = "additional_file.xlia";
+
+ main = "ascenseur.xlia";
+endsection
+*/
+bool Configuration::configure(
+ WObject * wfConfiguration, Configuration * prevConfiguration)
+{
+ WObject * aSECTION = Query::getWSequenceOrElse(
+ wfConfiguration, "project", "SPECIFICATION");
+ if( aSECTION != WObject::_NULL_ )
+ {
+ mProjectSourceLocation =
+ Query::getWPropertyStringOrElse(aSECTION,
+ "source", "src", VFS::WorkspaceSourcePath);
+
+ mProjectSourceLocation = VFS::native_path(
+ mProjectSourceLocation, VFS::WorkspaceRootPath);
+
+ mSpecificationFileLocation =
+ Query::getWPropertyStringOrElse(
+ aSECTION, "model", "main", "");
+
+ mOwnedSpecificationFlag = (mSpecificationFileLocation.size() > 0);
+
+ if( mOwnedSpecificationFlag )
+ {
+ mOutputFilenamePattern = mDebugFilenamePattern =
+ (VFS::basename(mSpecificationFileLocation) + "_%1%");
+
+ mSpecificationFileLocation = VFS::native_path(
+ mSpecificationFileLocation, mProjectSourceLocation);
+
+ OS_VERBOSITY_MINIMUM_OR_DEBUG( AVM_OS_COUT )
+ << _SEW_ << "Checking the specification file: \""
+ << VFS::relativeWorkspacePath( mSpecificationFileLocation )
+ << "\" ...";
+
+ AVM_OS_LOG << _SEW_ << "Checking the specification ..."
+ << std::endl
+ << _SEW_ << "File location:> "
+ << VFS::relativeWorkspacePath( mSpecificationFileLocation );
+
+ if( VFS::checkReadingFile(mSpecificationFileLocation) )
+ {
+ OS_VERBOSITY_MINIMUM_OR_DEBUG( AVM_OS_COUT )
+ << " ==> DONE" << std::endl;
+
+ AVM_OS_LOG << " ==> DONE" << std::endl;
+ }
+ else
+ {
+ mOwnedSpecificationFlag = false;
+
+ AVM_OS_COUT << EOL_TAB << " ==> FAILED :> "
+ << "This file doesn't exist or is not readable !!!"
+ << std::endl;
+
+ return( false );
+ }
+ }
+ }
+ else if( prevConfiguration != NULL )
+ {
+ mProjectSourceLocation = prevConfiguration->mProjectSourceLocation;
+ mSpecificationFileLocation = prevConfiguration->mSpecificationFileLocation;
+
+ mOutputFilenamePattern = prevConfiguration->mOutputFilenamePattern;
+ mDebugFilenamePattern = prevConfiguration->mDebugFilenamePattern;
+ }
+
+ aSECTION = Query::getRegexWSequence(
+ wfConfiguration, OR_WID2("output", "OUTPUT"));
+ if( aSECTION != WObject::_NULL_ )
+ {
+ if( configureFormatter(aSECTION, mOutputFilenamePattern, "filename" ) )
+ {
+ mOutputFilenamePattern = VFS::native_path(
+ mOutputFilenamePattern, VFS::WorkspaceOutputPath);
+
+ // Output Executable
+ mOutputExecutableFileLocation =
+ Query::getWPropertyString(aSECTION, "executable", "");
+
+ mOutputExecutableEnabledGenerationFlag =
+ (mOutputExecutableFileLocation.size() > 0);
+ if( mOutputExecutableEnabledGenerationFlag )
+ {
+ mOutputExecutableFileLocation = VFS::native_path(
+ mOutputExecutableFileLocation, VFS::WorkspaceOutputPath);
+ }
+ else
+ {
+ mOutputExecutableFileLocation =
+ mOutputFilenamePattern + EXECUTABLE_FILE_EXTENSION;
+ }
+
+ // Output SymbexGraph
+ mOutputSymbexGraphFileLocation =
+ Query::getRegexWPropertyString(aSECTION, "graph(viz)?", "");
+
+ mOutputSymbexGraphEnabledGenerationFlag =
+ (mOutputSymbexGraphFileLocation.size() > 0);
+ if( mOutputSymbexGraphEnabledGenerationFlag )
+ {
+ mOutputSymbexGraphFileLocation = VFS::native_path(
+ mOutputSymbexGraphFileLocation, VFS::WorkspaceOutputPath);
+ }
+ else
+ {
+ mOutputSymbexGraphFileLocation =
+ mOutputFilenamePattern + SYMBEX_GRAPH_FILE_EXTENSION;
+ }
+
+ // Output Symbex Scenaii
+ mOutputSymbexScenariiFileLocation =
+ Query::getWPropertyString(aSECTION, "scenarii", "");
+
+ mOutputSymbexScenariiEnabledGenerationFlag =
+ (mOutputSymbexScenariiFileLocation.size() > 0);
+ if( mOutputSymbexScenariiEnabledGenerationFlag )
+ {
+ mOutputSymbexScenariiFileLocation = VFS::native_path(
+ mOutputSymbexScenariiFileLocation, VFS::WorkspaceOutputPath);
+ }
+ else
+ {
+ mOutputSymbexScenariiFileLocation =
+ mOutputFilenamePattern + SYMBEX_SCENARII_FILE_EXTENSION;
+ }
+ }
+ else
+ {
+ AVM_OS_WARN << "Configuration::configureWObject:> "
+ "Failed to configure Output Filename Pattern < "
+ << mOutputFilenamePattern << " > !" << std::endl;
+
+ return( false );
+ }
+ }
+
+ aSECTION = Query::getRegexWSequence(wfConfiguration,
+ OR_WID2("debug", "DEBUG"), aSECTION);
+ if( aSECTION != WObject::_NULL_ )
+ {
+ mDebugStageEnabledFlag = true;
+
+ if( configureFormatter(aSECTION, mDebugFilenamePattern, "filename" ) )
+ {
+ mDebugFilenamePattern = VFS::native_path(
+ mDebugFilenamePattern, VFS::WorkspaceDebugPath);
+ }
+ else
+ {
+ AVM_OS_WARN << "Configuration::configureWObject:> "
+ "Failed to configure Debug Filename Pattern < "
+ << mDebugFilenamePattern << " > !" << std::endl;
+
+ return( false );
+ }
+
+ mDebugParsingStageEnabledFlag = mDebugStageEnabledFlag
+ && Query::hasWPropertyString(aSECTION, "parsing");
+
+ mDebugCompilingStageEnabledFlag = mDebugStageEnabledFlag
+ && Query::hasWPropertyString(aSECTION, "executable");
+
+ mDebugLoadingStageEnabledFlag = mDebugStageEnabledFlag
+ && Query::hasWPropertyString(aSECTION, "loading");
+
+ mDebugComputingEnabledFlag = mDebugStageEnabledFlag
+ && Query::hasWPropertyString(aSECTION, "execution");
+ }
+
+ bool isOK = configure_shell_symbex(wfConfiguration);
+
+ return( isOK );
+}
+
+
+bool Configuration::configure_shell_symbex(WObject * wfConfiguration)
+{
+ // Symbex config
+ WObject * configSYMBEX = Query::getRegexWSequence(
+ wfConfiguration, Workflow::SECTION_SYMBEX_REGEX_ID);
+
+ mMultitaskingFlag = Query::getWPropertyBoolean(
+ configSYMBEX, "multitasking", mWorkflow.isMultitasking());
+
+ mThreadCount = Query::getWPropertyInt(
+ configSYMBEX, "thread", mWorkflow.getThreadCount());
+
+
+ // Shell config
+ WObject * configSHELL = Query::getRegexWSequence(
+ wfConfiguration, Workflow::SECTION_SHELL_REGEX_ID);
+
+ mInconditionalStopMarkerLocation =
+ Query::getWPropertyString(configSHELL, "stop", "");
+ if( mInconditionalStopMarkerLocation.empty() )
+ {
+ mInconditionalStopMarkerLocation =
+ mWorkflow.getInconditionalStopMarkerLocation();
+ }
+ else
+ {
+ mInconditionalStopMarkerLocation =
+ VFS::native_path(mInconditionalStopMarkerLocation);
+
+ mInconditionalStopMarkerLocation = VFS::native_path(
+ mInconditionalStopMarkerLocation, VFS::WorkspaceLogPath);
+ }
+
+ return( true );
+}
+
+
+
+bool Configuration::configureFormatter(WObject * FORMAT,
+ std::string & formatPattern, const std::string & id)
+{
+ formatPattern = Query::getWPropertyString(FORMAT, id, formatPattern);
+
+ try
+ {
+ boost::format formatter(formatPattern);
+ }
+ catch(const boost::io::bad_format_string & bfs)
+ {
+ Query::reportErrorAttribute(FORMAT, id, bfs.what());
+
+ return( false );
+ }
+
+ return( true );
+}
+
+
+/**
+ * GETTER
+ * OUTPUT / DEBUG FILE LOCATION
+ */
+std::string Configuration::formatFileLocation(
+ const std::string & aFilenamePattern,
+ const std::string & strID, const std::string & strExtension) const
+{
+ boost::format locationFormatter(aFilenamePattern);
+
+ locationFormatter.exceptions( boost::io::no_error_bits );
+
+ if( strExtension.empty() )
+ {
+ return( ( locationFormatter % strID ).str() );
+ }
+ else
+ {
+ return( (OSS() << (locationFormatter % strID) << strExtension).str() );
+ }
+}
+
+
+/**
+ * SAVING
+ */
+void Configuration::saveSpecification(bool isDebug, const std::string & strID)
+{
+ std::string saveFileLocation = formatFileLocation(
+ isDebug, strID, SPECIFICATION_FILE_EXTENSION);
+
+ if( isDebug )
+ {
+ AVM_OS_CLOG << _DBG_
+ << "Saving of the Specification in text format --> "
+ << strID << std::endl;
+ }
+ else
+ {
+ AVM_OS_LOG << _SEW_
+ << "Saving of the Specification in text format --> "
+ << strID << std::endl;
+ }
+
+ Configuration::saveElementTextualView(AVM_OS_LOG,
+ getSpecification(), saveFileLocation);
+}
+
+void Configuration::saveSymbexGraph(bool isDebug, const std::string & strID)
+{
+ std::string saveFileLocation = formatFileLocation(
+ isDebug, strID, SYMBEX_GRAPH_FILE_EXTENSION);
+}
+
+void Configuration::saveSymbexScenarii(bool isDebug, const std::string & strID)
+{
+ std::string saveFileLocation = formatFileLocation(
+ isDebug, strID, SYMBEX_GRAPH_FILE_EXTENSION);
+}
+
+
+
+/**
+ * Jose Projection
+ */
+//void Configuration::saveProjection(const std::string & strPrefixName)
+//{
+// if( mOutputSymbexProjectionGraphEnabledGenerationFlag )
+// {
+// ScopeNewIndent scope( AVM_OS_LOG , AVM_TAB1_INDENT );
+//
+// AVM_OS_LOG << _SEW_ << "Saving of projection (2)" << std::endl
+// << TAB << "path: " << VFS::relativeWorkspacePath(
+// mOutputSymbexProjectionGraphFileLocation )
+// << "... " << std::flush;
+//
+// std::ofstream resultStream;
+// resultStream.open(mOutputSymbexProjectionGraphFileLocation.c_str(),
+// std::ios_base::out);
+// if( resultStream.good() )
+// {
+// OutStream os(resultStream, AVM_OUTPUT_INDENT);
+//
+// ListOfExecutionContext::iterator it = getTrace().begin();
+// ListOfExecutionContext::iterator itEnd = getTrace().end();
+// for( ; it != itEnd ; ++it )
+// {
+// // Suppression de l'indentation dans le fichier de sortie
+// (*it)->toFscn(os, NULL);
+// }
+//
+// resultStream.close();
+//
+// AVM_OS_LOG << "OK" << std::endl ;
+// }
+// else
+// {
+// AVM_OS_LOG << std::endl << TAB
+// << " KO : Failed to open this file in write mode"
+// << std::endl;
+// }
+// }
+//}
+//
+//
+//void Configuration::saveProjectionScenarii(const std::string & strPrefixName)
+//{
+// if( mOutputSymbexProjectionScenariiEnabledGenerationFlag )
+// {
+// ScopeNewIndent scope( AVM_OS_LOG , AVM_TAB1_INDENT );
+//
+// AVM_OS_LOG << _SEW_ << "Saving of projection FSCN " << std::endl
+// << TAB << "path: " << VFS::relativeWorkspacePath(
+// mOutputSymbexProjectionScenariiFileLocation )
+// << "... " << std::flush;
+//
+// std::ofstream resultStream;
+// resultStream.open(mOutputSymbexProjectionScenariiFileLocation.c_str(),
+// std::ios_base::out);
+// if( resultStream.good() )
+// {
+// OutStream os(resultStream, AVM_OUTPUT_INDENT);
+//
+// ListOfExecutionContext::iterator it = getTrace().begin();
+// ListOfExecutionContext::iterator itEnd = getTrace().end();
+// for( ; it != itEnd ; ++it )
+// {
+// // Suppression de l'indentation dans le fichier de sortie
+// (*it)->toFscn(os, NULL);
+// }
+//
+// resultStream.close();
+//
+// AVM_OS_LOG << "OK" << std::endl ;
+// }
+// else
+// {
+// AVM_OS_LOG << std::endl << TAB
+// << " KO : Failed to open this file in write mode"
+// << std::endl;
+// }
+// }
+//}
+// end Jose Projection
+
+
+
+///**
+// * Configuration::saveSpecification
+// *
+// */
+//void Configuration::saveSpecificationAfterCompilationStep(
+// const std::string & strPrefixName)
+//{
+// MainDataConfiguration * aMDC = aMDC->getInstance();
+// ParameterManager * aPM = aMDC->getParameterManager();
+//
+// std::string saveFileLocation =
+// aPM->getEngineDebugParsingLocation(strPrefixName);
+//
+// if( aMDC->hasSpecification() && (not saveFileLocation.empty()) )
+// {
+// AVM_OS_LOG << _SEW_
+// << "Saving of the internal specification "
+// "representation in textual format "
+// << std::endl;
+//
+// saveElementTextualView(aMDC->getSpecification(), saveFileLocation);
+// }
+//}
+//
+//
+///**
+// * Configuration::saveExecutableSpecification
+// *
+// */
+//void Configuration::saveExecutableSpecification(
+// const std::string & strPrefixName)
+//{
+// MainDataConfiguration * aMDC = MainDataConfiguration::getInstance();
+// ParameterManager * aPM = aMDC->getParameterManager();
+//
+// std::string saveFileLocation =
+// aPM->getEngineOutputExecutableLocation(strPrefixName);
+//
+// if( not saveFileLocation.empty() )
+// {
+// AVM_OS_LOG << _SEW_ << "Saving of the compiled "
+// "specification representation in textual format "
+// << std::endl;
+//
+// saveFormTextualViews(aMDC->getExecutableSystem(), saveFileLocation);
+//
+// saveFileLocation = aPM->getEngineOutputGraphLocation("fec_");
+// if( aMDC->hasMainExecutionContext() && (! saveFileLocation.empty()) )
+// {
+// saveElementTextualView(
+// aMDC->getMainExecutionContext(), saveFileLocation);
+// }
+// }
+//}
+
+
+/**
+ * save Element as textual view
+ *
+ */
+void Configuration::saveElementTextualView(OutStream & logger,
+ const Element & anElement, const std::string & saveFileLocation)
+{
+ ScopeNewIndent scope( logger , AVM_TAB1_INDENT );
+
+ logger << TAB << "path: "
+ << VFS::relativeWorkspacePath( saveFileLocation )
+ << "... " << std::flush;
+
+ std::ofstream resultStream;
+ resultStream.open(saveFileLocation.c_str(), std::ios_base::out);
+ if( resultStream.good() )
+ {
+ OutStream os(resultStream);
+ anElement.serialize(os);
+
+ resultStream.close();
+
+ logger << "OK" << std::endl ;
+ }
+ else
+ {
+ logger << std::endl << TAB
+ << " KO : Failed to open this file in write mode"
+ << std::endl;
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////
+// SERIALIZATION API
+////////////////////////////////////////////////////////////////////////////
+
+void Configuration::serializeDebugExecutable(const std::string & strID)
+{
+ std::string saveFileLocation = formatFileLocation(
+ true, strID, EXECUTABLE_FILE_EXTENSION);
+
+ AVM_OS_CLOG << _DBG_
+ << "Saving of the Executable in text format --> "
+ << strID << std::endl;
+
+ Configuration::saveElementTextualView(AVM_OS_LOG,
+ mExecutableSystem, saveFileLocation);
+}
+
+void Configuration::serializeTextualExecutable()
+{
+ AVM_OS_LOG << _SEW_
+ << "Saving of the Executable in text format" << std::endl;
+
+ Configuration::saveElementTextualView(AVM_OS_LOG,
+ mExecutableSystem, mOutputExecutableFileLocation);
+}
+
+
+void Configuration::serializeGraphizExecutable()
+{
+ ScopeNewIndent scope( AVM_OS_LOG , AVM_TAB1_INDENT );
+
+ std::string saveFileLocation = VFS::replace_extension(
+ mOutputExecutableFileLocation, GRAPHVIZ_FILE_EXTENSION);
+
+ AVM_OS_LOG << _SEW_
+ << "Saving of the specification representation "
+ "in GraphViz format " << std::endl;
+
+ AVM_OS_LOG << TAB << "path: "
+ << VFS::relativeWorkspacePath( saveFileLocation )
+ << "... " << std::flush;
+
+ std::ofstream resultStream;
+ resultStream.open(saveFileLocation.c_str(), std::ios_base::out);
+ if( resultStream.good() )
+ {
+ OutStream os(resultStream, AVM_SPC_INDENT);
+
+ GraphVizStatemachineSerializer::format(
+ mSymbexEngine.getControllerUnitManager(), os, getSpecification());
+
+ resultStream.close();
+
+ AVM_OS_LOG << "OK" << std::endl ;
+ }
+ else
+ {
+ AVM_OS_LOG << std::endl << TAB
+ << " KO : Failed to open this file in write mode"
+ << std::endl;
+ }
+}
+
+/**
+ * serialize Textual SymbexGraph
+ */
+void Configuration::serializeTextualSymbexGraph()
+{
+ ScopeNewIndent scope( AVM_OS_LOG , AVM_TAB1_INDENT );
+
+ AVM_OS_LOG << _SEW_
+ << "Saving of the trace of the execution specification "
+ "representation in textual format " << std::endl;
+
+ AVM_OS_LOG << TAB << "path: "
+ << VFS::relativeWorkspacePath( mOutputSymbexGraphFileLocation )
+ << "... " << std::flush;
+
+ std::ofstream resultStream;
+ resultStream.open(mOutputSymbexGraphFileLocation.c_str(),
+ std::ios_base::out);
+ if( resultStream.good() )
+ {
+ OutStream os(resultStream, AVM_SPC_INDENT);
+
+ ListOfExecutionContext::const_iterator it = getTrace().begin();
+ ListOfExecutionContext::const_iterator itEnd = getTrace().end();
+ for( ; it != itEnd ; ++it )
+ {
+ (*it)->serialize(os);
+ }
+
+ resultStream.close();
+
+ AVM_OS_LOG << "OK" << std::endl;
+ }
+ else
+ {
+ AVM_OS_LOG << std::endl << TAB
+ << " KO : Failed to open this file in write mode"
+ << std::endl;
+ }
+
+ if( hasMainExecutionContext() )
+ {
+ std::string saveFileLocation = formatFileLocation(
+ true, "tec", SYMBEX_GRAPH_FILE_EXTENSION);
+
+ saveElementTextualView(AVM_OS_LOG,
+ getMainExecutionContext(), saveFileLocation);
+ }
+}
+
+/**
+ * serialize Graphiz SymbexGraph
+ */
+void Configuration::serializeGraphizSymbexGraph()
+{
+ std::string saveFileLocation = VFS::replace_extension(
+ mOutputSymbexGraphFileLocation, GRAPHVIZ_FILE_EXTENSION);
+
+ ScopeNewIndent scope( AVM_OS_LOG , AVM_TAB1_INDENT );
+
+ AVM_OS_LOG << _SEW_
+ << "Saving of the symbex trace of the execution specification "
+ "representation in GraphViz format " << std::endl;
+
+ AVM_OS_LOG << TAB << "path: "
+ << VFS::relativeWorkspacePath( saveFileLocation )
+ << "... " << std::flush;
+
+ std::ofstream resultStream;
+ resultStream.open(saveFileLocation.c_str(), std::ios_base::out);
+ if( resultStream.good() )
+ {
+ OutStream os(resultStream, AVM_SPC_INDENT);
+
+ ListOfExecutionContext::const_iterator it = getTrace().begin();
+ ListOfExecutionContext::const_iterator itEnd = getTrace().end();
+ for( ; it != itEnd ; ++it )
+ {
+ GraphVizExecutionGraphSerializer::format(
+ mSymbexEngine.getControllerUnitManager(), os, *(*it));
+ }
+
+ resultStream.close();
+
+ AVM_OS_LOG << "OK" << std::endl ;
+ }
+ else
+ {
+ AVM_OS_LOG << std::endl << TAB
+ << " KO : Failed to open this file in write mode"
+ << std::endl;
+ }
+}
+
+
+void Configuration::serializeScenarii()
+{
+ ScopeNewIndent scope( AVM_OS_LOG , AVM_TAB1_INDENT );
+
+ AVM_OS_LOG << _SEW_
+ << "Saving of the trace of the execution specification "
+ "representation in textual format " << std::endl;
+
+ AVM_OS_LOG << TAB << "path: "
+ << VFS::relativeWorkspacePath(mOutputSymbexScenariiFileLocation)
+ << "... " << std::flush;
+
+ std::ofstream resultStream;
+ resultStream.open(mOutputSymbexScenariiFileLocation.c_str(),
+ std::ios_base::out);
+ if( resultStream.good() )
+ {
+ OutStream os(resultStream, AVM_FSCN_INDENT);
+
+ ListOfExecutionContext::const_iterator it = getTrace().begin();
+ ListOfExecutionContext::const_iterator itEnd = getTrace().end();
+ for( ; it != itEnd ; ++it )
+ {
+ (*it)->toFscn(os, NULL);
+ }
+
+ resultStream.close();
+
+ AVM_OS_LOG << "OK" << std::endl ;
+ }
+ else
+ {
+ AVM_OS_LOG << std::endl << TAB
+ << " KO : Failed to open this file in write mode"
+ << std::endl;
+ }
+}
+
+/**
+ * Serialization building stage
+ */
+void Configuration::serializeBuildingResult()
+{
+ if( mOutputExecutableEnabledGenerationFlag )
+ {
+ serializeTextualExecutable();
+
+ serializeGraphizExecutable();
+ }
+}
+
+/**
+ * Serialization computing stage
+ */
+void Configuration::serializeComputingResult()
+{
+AVM_IF_DEBUG_FLAG_AND( COMPUTING , isDebugLoadingStageEnabled() )
+ serializeDebugExecutable( "jit" );
+AVM_ENDIF_DEBUG_FLAG_AND( COMPUTING )
+
+ if( mOutputSymbexScenariiEnabledGenerationFlag )
+ {
+ serializeScenarii();
+ }
+
+ if( mOutputSymbexGraphEnabledGenerationFlag )
+ {
+AVM_IF_DEBUG_ENABLED
+
+ serializeTextualSymbexGraph();
+
+AVM_ENDIF_DEBUG_ENABLED
+
+ serializeGraphizSymbexGraph();
+ }
+
+// saveProjection();
+// saveProjectionScenarii(mParameterWObject);
+}
+
+
+/**
+ * Serialization
+ */
+void Configuration::toStream(OutStream & os) const
+{
+ os << TAB << "configuration " << getNameID() << " {" << EOL;
+
+ os << TAB2 << "WorkspaceRootPath = " << VFS::WorkspaceRootPath << EOL;
+
+ os << TAB2 << "mProjectSourceLocation = "
+ << VFS::relativeWorkspacePath( mProjectSourceLocation )
+ << EOL;
+ os << TAB2 << "mSpecificationFileLocation = "
+ << VFS::relativeWorkspacePath( mSpecificationFileLocation )
+ << EOL;
+
+ os << TAB2 << "mOwnedSpecificationFlag = "
+ << ( mOwnedSpecificationFlag ? "true" : "false" )
+ << EOL;
+ os << TAB2 << "mOutputFilenamePattern = "
+ << VFS::relativeWorkspacePath( mOutputFilenamePattern )
+ << EOL;
+ os << TAB2 << "mDebugFilenamePattern = "
+ << VFS::relativeWorkspacePath( mDebugFilenamePattern )
+ << EOL;
+
+ os << TAB2 << "mOutputExecutableEnabledGenerationFlag = "
+ << ( mOutputExecutableEnabledGenerationFlag ? "true" : "false" )
+ << EOL;
+ os << TAB2 << "mOutputExecutableFileLocation = "
+ << VFS::relativeWorkspacePath( mOutputExecutableFileLocation )
+ << EOL;
+
+ os << TAB2 << "mOutputSymbexGraphEnabledGenerationFlag = "
+ << ( mOutputSymbexGraphEnabledGenerationFlag ? "true" : "false" )
+ << EOL;
+ os << TAB2 << "mOutputSymbexGraphFileLocation = "
+ << VFS::relativeWorkspacePath( mOutputSymbexGraphFileLocation )
+ << EOL;
+
+ os << TAB2 << "mOutputSymbexScenariiEnabledGenerationFlag = "
+ << ( mOutputSymbexScenariiEnabledGenerationFlag ? "true" : "false" )
+ << EOL;
+ os << TAB2 << "mOutputSymbexScenariiFileLocation = "
+ << VFS::relativeWorkspacePath( mOutputSymbexScenariiFileLocation )
+ << EOL;
+
+ os << TAB2 << "mDebugStageEnabledFlag = "
+ << ( mDebugStageEnabledFlag ? "true" : "false" ) << EOL;
+
+ os << TAB2 << "mDebugParsingStageEnabledFlag = "
+ << ( mDebugParsingStageEnabledFlag ? "true" : "false" ) << EOL;
+
+ os << TAB2 << "mDebugCompilingStageEnabledFlag = "
+ << ( mDebugCompilingStageEnabledFlag ? "true" : "false" ) << EOL;
+
+ os << TAB2 << "mDebugLoadingStageEnabledFlag = "
+ << ( mDebugLoadingStageEnabledFlag ? "true" : "false" ) << EOL;
+
+ os << TAB2 << "mDebugComputingEnabledFlag = "
+ << ( mDebugComputingEnabledFlag ? "true" : "false" ) << EOL;
+
+
+ os << TAB2 << "mInconditionalStopMarkerLocation = "
+ << VFS::relativeWorkspacePath( mInconditionalStopMarkerLocation )
+ << EOL;
+
+ os << TAB << "}" << EOL_FLUSH;
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/sew/Configuration.h b/org.eclipse.efm.symbex/src/sew/Configuration.h
new file mode 100644
index 0000000..dd603bd
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/sew/Configuration.h
@@ -0,0 +1,555 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 14 déc. 2016
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#ifndef FML_WORKFLOW_CONFIGURATION_H_
+#define FML_WORKFLOW_CONFIGURATION_H_
+
+#include <common/NamedElement.h>
+
+#include <fml/infrastructure/System.h>
+
+#include <fml/executable/ExecutableSystem.h>
+
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/RuntimeID.h>
+
+#include <fml/workflow/WObject.h>
+
+#include <printer/OutStream.h>
+
+
+
+namespace sep
+{
+
+class APExecutionData;
+
+class ExecutableSystem;
+
+class SymbexEngine;
+
+class Workflow;
+
+
+/**
+ * TYPEDEF
+ */
+typedef Vector< RuntimeID > TableOfRuntimeID_T;
+
+
+
+class Configuration : public NamedElement
+{
+
+ AVM_DECLARE_UNCLONABLE_CLASS(Configuration)
+
+public:
+ /**
+ * ATTRIBUTES
+ * GLOBAL
+ */
+ static const std::string SPECIFICATION_FILE_EXTENSION;
+
+ static const std::string EXECUTABLE_FILE_EXTENSION;
+
+ static const std::string SYMBEX_GRAPH_FILE_EXTENSION;
+
+ static const std::string SYMBEX_SCENARII_FILE_EXTENSION;
+
+ static const std::string GRAPHVIZ_FILE_EXTENSION;
+
+
+protected :
+ /**
+ * ATTRIBUTES
+ */
+ SymbexEngine & mSymbexEngine;
+ Workflow & mWorkflow;
+
+ WObjectManager mWObjectManager;
+
+ std::string mProjectSourceLocation;
+ std::string mSpecificationFileLocation;
+
+ bool mOwnedSpecificationFlag;
+
+ std::string mOutputFilenamePattern;
+ std::string mDebugFilenamePattern;
+
+ bool mOutputExecutableEnabledGenerationFlag;
+ std::string mOutputExecutableFileLocation;
+
+ bool mOutputSymbexGraphEnabledGenerationFlag;
+ std::string mOutputSymbexGraphFileLocation;
+
+ bool mOutputSymbexScenariiEnabledGenerationFlag;
+ std::string mOutputSymbexScenariiFileLocation;
+
+ bool mDebugStageEnabledFlag;
+ bool mDebugParsingStageEnabledFlag;
+ bool mDebugCompilingStageEnabledFlag;
+ bool mDebugLoadingStageEnabledFlag;
+ bool mDebugComputingEnabledFlag;
+
+ // Symbex Threading config
+ bool mMultitaskingFlag;
+ avm_uint8_t mThreadCount;
+
+ // Shell config
+ std::string mInconditionalStopMarkerLocation;
+
+
+ AvmPointer< System , DestroyElementPolicy > mSpecification;
+
+ AvmPointer< ExecutableSystem , DestroyElementPolicy > mExecutableSystem;
+
+ TableOfRuntimeID_T mTableOfRID;
+
+ ExecutionContext mMainExecutionContext;
+
+ ListOfExecutionContext mInputContext;
+
+ ListOfExecutionContext mTrace;
+
+
+public :
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Configuration(SymbexEngine & aSymbexEngine, Workflow & aWorkflow);
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Configuration();
+
+ void destroy();
+
+
+ /**
+ * GETTER
+ * mSymbexEngine
+ */
+ inline SymbexEngine & getSymbexEngine() const
+ {
+ return( mSymbexEngine );
+ }
+
+ /**
+ * GETTER
+ * mWObjectManager
+ */
+ inline WObjectManager & getWObjectManager()
+ {
+ return( mWObjectManager );
+ }
+
+
+ /**
+ * CONFIGURE
+ */
+ bool configure(WObject * wfConfiguration, Configuration * prevConfiguration);
+
+ bool configure_shell_symbex(WObject * wfConfiguration);
+
+ bool configureFormatter(WObject * FORMAT,
+ std::string & formatPattern, const std::string & id);
+
+
+ /*
+ * GETTER
+ * mWorkflow
+ */
+ Workflow & getWorkflow()
+ {
+ return( mWorkflow );
+ }
+
+
+ /**
+ * Symbex Threading config
+ */
+ inline bool isMultitasking() const
+ {
+ return( mMultitaskingFlag );
+ }
+
+ inline avm_uint8_t getThreadCount() const
+ {
+ return( mThreadCount );
+ }
+
+ /**
+ * GETTER
+ * mInconditionalStopMarkerLocation
+ */
+ const std::string & getInconditionalStopMarkerLocation() const
+ {
+ return( mInconditionalStopMarkerLocation );
+ }
+
+
+ /**
+ * mSpecificationFileLocation
+ */
+ inline bool hasOwnedSpecification() const
+ {
+ return( mOwnedSpecificationFlag );
+ }
+
+ /**
+ * mSpecificationFileLocation
+ */
+ inline const std::string & getSpecificationFileLocation() const
+ {
+ return( mSpecificationFileLocation );
+ }
+
+ /**
+ * GETTER
+ * OUTPUT / DEBIG FILE LOCATION
+ */
+ std::string formatFileLocation(
+ const std::string & aFilenamePattern, const std::string & strID,
+ const std::string & strExtension = "") const;
+
+ inline std::string formatFileLocation(bool isDebug,
+ const std::string & strID, const std::string & strExtension) const
+ {
+ return( formatFileLocation(
+ (isDebug ? mDebugFilenamePattern : mOutputFilenamePattern),
+ strID, strExtension) );
+ }
+
+ inline std::string formatOutputFileLocation(
+ const std::string & strID, const std::string & strExtension) const
+ {
+ return( formatFileLocation(
+ mOutputFilenamePattern, strID, strExtension) );
+ }
+
+ inline std::string formatDebugFileLocation(
+ const std::string & strID, const std::string & strExtension) const
+ {
+ return( formatFileLocation(
+ mDebugFilenamePattern, strID, strExtension) );
+ }
+
+
+ /**
+ * GETTER
+ * mDebugStageEnabledFlag
+ * mDebugParsingStageEnabledFlag
+ * mDebugCompilingStageEnabledFlag
+ * mDebugLoadingEnabledFlag
+ * mDebugComputingEnabledFlag
+ */
+ inline bool isDebugStageEnabled() const
+ {
+ return( mDebugStageEnabledFlag );
+ }
+
+ inline bool isDebugParsingStageEnabled() const
+ {
+ return( mDebugParsingStageEnabledFlag );
+ }
+
+ inline bool isDebugCompilingStageEnabled() const
+ {
+ return( mDebugCompilingStageEnabledFlag );
+ }
+
+ inline bool isDebugLoadingStageEnabled() const
+ {
+ return( mDebugLoadingStageEnabledFlag );
+ }
+
+ inline bool isDebugComputingStageEnabled() const
+ {
+ return( mDebugComputingEnabledFlag );
+ }
+
+
+ /*
+ * GETTER - SETTER
+ * mSpecification
+ */
+ inline System & getSpecification()
+ {
+ return( *mSpecification );
+ }
+
+ inline const System & getSpecification() const
+ {
+ return( *mSpecification );
+ }
+
+ inline bool hasSpecification() const
+ {
+ return( mSpecification.valid() );
+ }
+
+ inline void setSpecification(System * aSpecification)
+ {
+ mSpecification = aSpecification;
+ }
+
+
+ /*
+ * GETTER - SETTER
+ * mExecutableSystem
+ */
+ inline ExecutableSystem & getExecutableSystem()
+ {
+ return( *mExecutableSystem );
+ }
+
+ inline const ExecutableSystem & getExecutableSystem() const
+ {
+ return( *mExecutableSystem );
+ }
+
+// inline bool hasExecutableSystem() const
+// {
+// return( mExecutableSystem.valid() );
+// }
+
+ inline void setExecutableSystem(ExecutableSystem * anExecutableSystem)
+ {
+ mExecutableSystem = anExecutableSystem;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mTableOfRID
+ */
+ inline void appendRID(const RuntimeID & aRID)
+ {
+ mTableOfRID.append(aRID);
+ }
+
+ void destroyRIDRunningCode();
+
+ inline const TableOfRuntimeID_T & getTableOfRID() const
+ {
+ return( mTableOfRID );
+ }
+
+
+ /*
+ * GETTER - SETTER
+ * mMainExecutionContext
+ */
+ inline ExecutionContext & getMainExecutionContext()
+ {
+ return( mMainExecutionContext );
+ }
+
+ inline const ExecutionContext & getMainExecutionContext() const
+ {
+ return( mMainExecutionContext );
+ }
+
+ inline const ExecutionData & getMainExecutionData() const
+ {
+ return( mMainExecutionContext.refExecutionData() );
+ }
+
+
+ inline bool hasMainExecutionContext() const
+ {
+ return( mMainExecutionContext.hasExecutionData() );
+ }
+
+
+ inline void setMainExecutionContext(
+ const ExecutionContext & anExecutionContext)
+ {
+ mMainExecutionContext.initialize( anExecutionContext );
+ }
+
+ inline void setMainExecutionData(const APExecutionData & anExecutionData)
+ {
+ mMainExecutionContext.initialize( anExecutionData , 0 , 1 );
+ }
+
+
+ /*
+ * GETTER - SETTER
+ * mInputContext
+ */
+ inline const ListOfExecutionContext & getInputContext() const
+ {
+ return( mInputContext );
+ }
+
+ inline ListOfExecutionContext & getInputContext()
+ {
+ return( mInputContext );
+ }
+
+ inline bool hasInputContext() const
+ {
+ return( mInputContext.nonempty() );
+ }
+
+ inline void appendInputContext(ExecutionContext * anInputContext)
+ {
+ mInputContext.append( anInputContext );
+ }
+
+ /*
+ * GETTER - SETTER
+ * mTrace
+ */
+ inline const ListOfExecutionContext & getTrace() const
+ {
+ return( mTrace );
+ }
+
+ inline ExecutionContext * getFirstTrace() const
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( mTrace.nonempty() )
+ << "Expected a non-empty Symbex Root Execution Context List !!!"
+ << SEND_EXIT;
+
+ return( mTrace.first() );
+ }
+
+ inline const ExecutionContext & refFirstTrace() const
+ {
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( mTrace.nonempty() )
+ << "Expected a non-empty Symbex Root Execution Context List !!!"
+ << SEND_EXIT;
+
+ return( *( mTrace.first() ) );
+ }
+
+ inline bool hasTrace() const
+ {
+ return( mTrace.nonempty() );
+ }
+
+ inline bool noTrace() const
+ {
+ return( mTrace.empty() );
+ }
+
+ inline void appendTrace(ExecutionContext * aTrace)
+ {
+ mTrace.append( aTrace );
+ }
+
+ inline void appendTrace(const ListOfExecutionContext & aTrace)
+ {
+ mTrace.append( aTrace );
+ }
+
+
+ /*
+ * SETTER
+ * mSpecification
+ * mExecutableSystem
+ * mMainExecutionContext
+ * mTrace
+ */
+ void set(Configuration & aConfiguration)
+ {
+ mSpecification = aConfiguration.mSpecification;
+
+ mExecutableSystem = aConfiguration.mExecutableSystem;
+
+ setMainExecutionContext( aConfiguration.mMainExecutionContext );
+
+ AVM_OS_ASSERT_FATAL_ERROR_EXIT( aConfiguration.mInputContext.nonempty() )
+ << "Expected a non-empty Symbex Input Execution Context List !!!"
+ << SEND_EXIT;
+
+ mInputContext = aConfiguration.mInputContext;
+
+ mTrace = aConfiguration.mTrace;
+ }
+
+
+ /**
+ * SAVING
+ */
+ void saveSpecification(bool isDebug, const std::string & strID = "");
+ void saveSymbexGraph(bool isDebug, const std::string & strID = "");
+ void saveSymbexScenarii(bool isDebug, const std::string & strID = "");
+
+
+// static void saveSpecificationAfterCompilationStep(
+// const std::string & strPrefixName = "");
+//
+//
+// static void saveExecutableSpecification(
+// const std::string & strPrefixName = "");
+
+ static void saveElementTextualView(OutStream & logger,
+ const Element & anElement, const std::string & saveFileURL);
+
+ inline static void saveElementTextualView(OutStream & logger,
+ const Element * anElement, const std::string & saveFileURL)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( anElement )
+ << "Element !!!"
+ << SEND_EXIT;
+
+ if( anElement != NULL )
+ {
+ saveElementTextualView(logger, (* anElement), saveFileURL);
+ }
+ }
+
+ // Jose Projection:
+// void saveProjection(const std::string & strPrefixName = "");
+// void saveProjectionScenarii(const std::string & strPrefixName = "");
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SERIALIZATION API
+ ////////////////////////////////////////////////////////////////////////////
+
+ void serializeDebugExecutable(const std::string & strID);
+
+ void serializeTextualExecutable();
+
+ void serializeGraphizExecutable();
+
+
+ void serializeTextualSymbexGraph();
+
+ void serializeGraphizSymbexGraph();
+
+
+ void serializeScenarii();
+
+
+ void serializeBuildingResult();
+
+ void serializeComputingResult();
+
+
+ virtual void toStream(OutStream & os) const;
+
+};
+
+
+} /* namespace sep */
+
+#endif /* FML_WORKFLOW_CONFIGURATION_H_ */
diff --git a/org.eclipse.efm.symbex/src/sew/README.md b/org.eclipse.efm.symbex/src/sew/README.md
new file mode 100644
index 0000000..041793d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/sew/README.md
@@ -0,0 +1,25 @@
+# EFM-SYMBEX::SEW : Symbolic Execution Workflow
+
+## Source code structure
+
+### Interfaces
+
+# Symbex Job
+Define common properties an behaviors of Symbex Controller and Processor
+
+### Classes
+
+# Symbex Dispatcher
+The Symbex workflow scheduler
+
+# Symbex Controller
+Control [execution] context streams before and after symbolic execution
+* before a.k.a. pre-filtering step
+* after a.k.a. post-filtering step
+
+# Symbex Processor
+Perform symbolic execution of a given [execution] contexts
+
+
+### Factories
+
diff --git a/org.eclipse.efm.symbex/src/sew/SEW.md b/org.eclipse.efm.symbex/src/sew/SEW.md
new file mode 100644
index 0000000..c8f0501
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/sew/SEW.md
@@ -0,0 +1,524 @@
+# SEW, Symbolic Execution Workflow Specification
+
+## Class Workflow
+* **workspace** as Virtual File System for the Workflow
+* **projet** as the specification
+* **job** as analysis jobs
+
+```sew
+
+Workflow <sew-id> "<description> of the Symbolic Execution Workflow" {
+ workspace: [
+ //...
+ ]
+
+ project: [
+ //...
+ ]
+
+ sep <id> "<description> of Global Symbolic Execution Platform Configuration" {
+ //...
+ }
+
+ // Default Job / Director / Driver
+ job = Job <id> "<description>" {
+ // ...
+ }
+
+ // Additional Job
+ job += Job <id> "<description>" {
+ // ...
+ }
+
+ /*
+ sop : Sequence
+ | Parallel
+ */
+ scheduler = <sop> {
+ start <jod-id-1>
+ start <jod-id-1>
+ }
+}
+
+```
+
+
+### Sequence Workspace
+* **root** as workspace native file system path // Chemin absolu ou relatif (au dossier de lancement!) du projet SEW
+* **source** as workspace relative source folder
+* **output** as workspace relative output folder
+* **log** as workspace output relative log folder
+
+```sew
+
+workspace: [
+ root = "<path>"
+ source = "<path>"
+ output = "<path>"
+ log = "<path>"
+]
+
+```
+
+
+### Sequence Project
+
+```sew
+
+project: [
+ // ...
+]
+
+```
+
+
+### Class SEP
+
+```sew
+
+sep <id> "<description> of Symbolic Execution Platform Configuration" {
+ core: [
+ //...
+ ]
+
+ log: [
+ //...
+ ]
+
+ debug: [
+ //...
+ ]
+
+ // ...
+}
+
+```
+
+
+### Class SAJ, Symbolic Analysis Job (or Director / Driver)
+* **stream** as default interaction streams
+* **project** as analyzed specification
+* **serializer** as default serializers
+* **fam** as Formal Analysis Module
+
+
+```sew
+
+job = Job <id> "<description>" {
+ sep <id> "<description> of Local Symbolic Execution Platform Configuration" {
+ //...
+ }
+
+ stream: [
+ // ...
+ ]
+
+ project: [
+ //...
+ ]
+
+ main = MainAnalysisModule <id> "<description> of the Main Analysis Module" {
+ // ...
+ }
+
+ serializer = GraphVizStatemachineSerializer <id> "<description>" {
+ // ...
+ }
+
+ serializer = GraphVizExecutionGraphSerializer <id> "<description>" {
+ // ...
+ }
+
+
+ fam += StateTransitionCoverageModule "State/Transition Coverage Analysis Module" {
+ // ...
+ }
+
+ fam += HitOrJumpModule "Hit or Jump Analysis Module" {
+ // ...
+ }
+
+
+ fam "Formal Analysis Module" = hitorjump {
+ // "Processor" de gestion des critères d'arrêt absolus (paramètres utilisateur)
+ main { // or director / driver
+ property: [
+
+ ]
+
+ log: [
+
+ ]
+
+ debug: [
+
+ ]
+
+ queue: [
+
+ ]
+ }
+ }
+}
+
+```
+
+#### Sequence Stream
+* **stdin** as Standard Input Stream
+* **stdout** as Standard Output Stream
+* **stderr** as Standard Error Stream
+
+* **project** as model specification
+
+
+```sew
+
+stream: [
+ /*
+ uri : std "::" ( 'cout' | 'cerr' | 'cin' )
+ | sew "::" ( 'log' | 'trace' )
+ | folder "::" "<path>"
+ | file "::" "<path>"
+ | filename "::" "<path>"
+ | socket "::" <host-id> ":" <port-number>
+ */
+ stdin = <uri>
+ stdout = <uri>
+ stderr = <uri>
+
+ // ...
+]
+
+```
+
+
+#### Sequence Project
+* **model** as FormalML Concrete Syntax model
+
+```sew
+
+project: [
+ // Chemin relatif à workspace::source (ou absolu!)
+ model = "<FormalML-Concrete-Syntax.fml>"
+
+ // ...
+]
+
+```
+
+#### Class (/ Sequence ?) FAM, Formal Analysis Module/Plugin
+* **priority** as *scheduler priority* in the workflow
+
+```sew
+
+fam += FAM "Transition Coverage Analysis Module" {
+ priority: [
+ // ...
+ ]
+
+ scheduling: [
+ // ...
+ ]
+
+ log: [
+ // ...
+ ]
+
+ debug: [
+ // ...
+ ]
+
+}
+
+```
+
+
+##### Sequence Priority
+* **preprocess** as preprocessing stage priority
+* **prefilter** as prefiltering stage priority
+* **postfilter** as postfiltering stage priority
+* **postprocess** as postprocessing stage priority
+
+```sew
+
+priority: [
+ preprocess = <integer>
+ prefilter = <integer>
+ postfilter = <integer>
+ postprocess = <integer>
+
+ // ...
+]
+
+```
+
+
+##### Sequence Scheduling
+* **preprocess** as preprocessing stage enabled flag
+* **prefilter** as prefiltering stage enabled flag
+* **postfilter** as postfiltering stage enabled flag
+* **postprocess** as postprocessing stage enabled flag
+
+```sew
+
+scheduling: [
+ preprocess = <boolean>
+ prefilter = <boolean>
+ postfilter = <boolean>
+ postprocess = <boolean>
+
+ // ...
+]
+
+```
+
+
+##### Sequence Log
+
+```sew
+
+log: [
+ // ...
+]
+
+```
+
+
+##### Sequence Debug
+
+```sew
+
+debug: [
+ // ...
+]
+
+```
+
+
+#### Class MainAnalysisModule as Director or Driver
+* **queue** as Symbolic Execution Queue
+* **limit** as Symbolic Execution Processing Limit
+* **irq** as *interrupt request* listener configuration
+* **detector** as list of *passive detector* enabled flag
+
+```sew
+
+main = MainAnalysisModule <id> "<description> of the MAM" {
+ queue "<description> of Symbolic Execution Queue" : [
+ // ...
+ ]
+
+ limit "Symbolic Execution Processing Limit" : [
+ // ...
+ ]
+
+ irq "IRQ, Interrupt ReQuest for the Workflow" : [
+ // ...
+ ]
+
+ detector <id> "Enable some passive detectors" : [
+ // ...
+ ]
+
+ // ...
+}
+
+```
+
+##### Class / Sequence Queue
+* **policy** as *enqueue/dequeue policy* of the queue
+
+```sew
+// Default Queue Sequence
+queue "<description> of the Symbolic Execution Queue" : [
+ /*
+ 'BFS' | 'BREADTH_FIRST_SEARCH'
+ 'DFS' | 'DEPTH_FIRST_SEARCH'
+ 'RFS' | 'RANDOM_FIRST_SEARCH'
+ 'WEIGHT::{ DFS | BFS | RFS | XFS }'
+ */
+ policy = <policy>
+
+ // ...
+]
+
+// Specific Class Queue
+queue = <queue_type_id> "<description> of the Symbolic Execution Queue" {
+ /*
+ 'BFS' | 'BREADTH_FIRST_SEARCH'
+ 'DFS' | 'DEPTH_FIRST_SEARCH'
+ 'RFS' | 'RANDOM_FIRST_SEARCH'
+ 'WEIGHT::{ DFS | BFS | RFS | XFS }'
+ */
+ policy = <policy>
+
+ // ...
+}
+
+
+
+```
+
+##### Sequence Limit
+* **node** as the maximum number of *nodes* built for the symbolic execution graph
+* **height** as the maximum *height* of the symbolic execution graph
+* **width** as the maximum *width* of the symbolic execution graph
+* **eval** as the maximum number of symbolic *evaluation* steps
+* **step** as the maximum number of symbolic evaluation *steps*
+* **save** as a *point of serialization* based on the number of evaluation steps
+
+```sew
+limit "Symbolic Execution Processing Limit" : [
+ node = <integer>
+ height = <integer>
+ width = <integer>
+
+ eval = <integer>
+ step = <integer>
+
+ save = <integer>
+ // ...
+]
+
+```
+
+
+##### Sequence IRQ, Interrupt ReQuest
+* **frequency** as a *frequency of listening* based on the number of evaluation steps
+
+```sew
+irq "IRQ, Interrupt ReQuest for the Workflow" : [
+ frequency = <integer>
+
+ file = "<stop-if-this-file-path-exist>"
+ // ...
+]
+
+```
+
+
+##### Sequence Detector
+* **deadlock** as the maximum *height* of the symbolic execution graph
+* **loop#trivial** as the maximum number of *nodes* built for the symbolic execution graph
+
+```sew
+detector "Enable some passive detectors" : [
+ deadlock = <boolean>
+ loop#trivial = <boolean>
+ // ...
+]
+
+```
+
+
+#### Class Serializer
+
+##### Class GraphVizStatemachineSerializer
+
+```sew
+
+serializer += GraphVizStatemachineSerializer <id> "<description>" {
+ // ...
+
+property: [
+
+]
+
+trace: [
+
+]
+
+format: [
+
+]
+
+vfs: [
+ file = "<save-file-path>"
+]
+
+```
+
+##### Class GraphVizExecutionGraphSerializer
+
+```sew
+
+serializer += GraphVizExecutionGraphSerializer <id> "<description>" {
+ // ...
+
+property: [
+
+]
+
+trace: [
+
+]
+
+format: [
+
+]
+
+vfs: [
+ file = "<save-file-path>"
+]
+
+```
+
+
+#### Class StateTransitionCoverageModule
+
+```sew
+
+fam += StateTransitionCoverageModule "State/Transition Coverage Analysis Module" {
+ // ...
+}
+
+```s
+
+#### Class HitOrJumpModule
+
+```sew
+
+fam += HitOrJumpModule <id> "<description>" {
+ // ...
+}
+
+```
+
+
+## Simple Workflow: BFS exploration :
+
+```sew
+
+Workflow explorationBFS "Simple model BFS exploration Workflow" {
+ workspace: [
+ root = "<workspace-root-folder-from-filse-system-path>"
+ output = "out"
+ ]
+
+ job {
+ project: [
+ model = "<FormalML-Concrete-Syntax.fml>"
+ ]
+
+ main {
+ queue "Symbolic Execution Queue" : [
+ policy = 'BFS'
+ ]
+
+ limit "Symbolic Execution Processing Limit" : [
+ step = 10
+ ]
+ }
+
+ serializer = GraphVizStatemachineSerializer { }
+
+ serializer = GraphVizExecutionGraphSerializer { }
+ }
+}
+
+```
+
+
+
+
+
diff --git a/org.eclipse.efm.symbex/src/sew/SymbexController.cpp b/org.eclipse.efm.symbex/src/sew/SymbexController.cpp
new file mode 100644
index 0000000..1b61473
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/sew/SymbexController.cpp
@@ -0,0 +1,265 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "SymbexController.h"
+
+#include <fml/runtime/ExecutionContext.h>
+
+#include <fam/queue/ExecutionQueue.h>
+
+#include <main/SignalHandler.h>
+
+#include <sew/SymbexControllerUnitManager.h>
+#include <sew/SymbexDispatcher.h>
+
+
+namespace sep
+{
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+SymbexController::SymbexController(
+ SymbexDispatcher & aSymbexDispatcher, WObject * wfParameterObject,
+ SymbexControllerUnitManager & aControllerUnitManager)
+: SymbexJob(aSymbexDispatcher, wfParameterObject, aControllerUnitManager),
+mSymbexRequestManager( aSymbexDispatcher.getSymbexControllerRequestManager() )
+{
+ //!! NOTHING
+}
+
+/**
+ * Thread main Run Method
+ */
+void SymbexController::operator()()
+{
+ AVM_OS_TRACE << "Begin SymbexController Thread" << std::endl;
+
+ while( isLifecycleRunnable() )
+ {
+ analyseReady();
+
+ analyseResult();
+ }
+
+ AVM_OS_TRACE << "End SymbexController Thread" << std::endl;
+}
+
+
+void SymbexController::analyseReady()
+{
+ RunnableElement::setLifecycleRunning();
+
+ if( mSymbexDispatcher.hasWork() )
+ {
+
+AVM_IF_DEBUG_LEVEL_FLAG2( MEDIUM , REPORTING , COMPUTING )
+
+AVM_IF_DEBUG_LEVEL_GTE_HIGH
+
+ mControllerUnitManager.getExecutionQueue().toStream(AVM_OS_TRACE);
+
+AVM_ELSEIF_DEBUG_LEVEL_GTE_MEDIUM
+
+ mControllerUnitManager.getExecutionQueue().toStreamWaiting(AVM_OS_TRACE);
+
+AVM_ENDIF_DEBUG_LEVEL_GTE_MEDIUM
+
+ AVM_OS_TRACE << std::endl;
+
+AVM_ENDIF_DEBUG_LEVEL_FLAG2( MEDIUM , REPORTING , COMPUTING )
+
+
+ while( true )
+ {
+
+#ifdef __AVM_UNIX__
+
+ if( SignalHandler::isSIGINT() )
+ {
+ mSymbexRequestManager.fireRequestStop();
+
+ this->handleRequestStop();
+ }
+
+#endif /* __AVM_UNIX__ */
+
+ /**
+ * PROCESSOR REQUEST API :> before << prefiltering >> step
+ * STOP | RELEASE | RESET | REQUEUE_WAITING
+ */
+ if( mSymbexRequestManager.hasRequestStop() )
+ {
+
+AVM_IF_DEBUG_LEVEL_OR_FLAG( MEDIUM , COMPUTING )
+ OSS oss( AVM_NO_INDENT );
+ mSymbexRequestManager.strStopRequestor(oss, "");
+
+ AVM_OS_INFO << std::endl << EMPHASIS(
+ "STOP REQUIRED BY FILTERING PROCESSOR !!!", oss.str(), '*', 80);
+AVM_ENDIF_DEBUG_LEVEL_OR_FLAG( MEDIUM , COMPUTING )
+
+
+ mSymbexRequestManager.fireRequestStop();
+
+ this->handleRequestStop();
+
+ break;
+ }
+
+ if( mSymbexRequestManager.hasRequestRelease() )
+ {
+ mSymbexRequestManager.fireRequestRelease();
+
+ this->handleRequestRelease();
+ }
+
+ if( mSymbexRequestManager.hasRequestReset() )
+ {
+ mSymbexRequestManager.fireRequestReset();
+
+ this->handleRequestReset();
+ }
+
+ if( mSymbexRequestManager.hasRequestRequeueWaiting() )
+ {
+ mSymbexRequestManager.fireRequestRequeueWaiting();
+ }
+
+
+ /**
+ * PREFILTERING step
+ */
+ // Si tout se passe bien on passera à la phase d'exécution symbolique
+ if( mControllerUnitManager.prefilter() )
+ {
+ if( mControllerUnitManager.finalizePrefiltering() )
+ {
+ break;
+ }
+ }
+
+
+ /**
+ * PROCESSOR REQUEST API :> check if has goal achieved
+ * GOAL_ACHIEVED
+ */
+ if( mSymbexRequestManager.hasRequestGoalAchieved() )
+ {
+ mSymbexRequestManager.fireRequestGoalAchieved();
+
+ this->handleRequestGoalAchieved();
+ }
+
+ // Sinon on repasse par la file d'attente pour récupérer de nouveaux
+ // Execution Contextes attendant pour passer l'audition des pré-filtres
+ if( mControllerUnitManager.getExecutionQueue().hasWaiting() )
+ {
+ mControllerUnitManager.getExecutionQueue().popWaiting2Ready();
+ }
+
+ /**
+ * PROCESSOR REQUEST API :> to continue if empty waiting queue
+ * CONTINUE | REQUEUE_RESERVE | RESTART
+ */
+ // Si aucun candidat n'est disponible, alors on passe la main
+ // aux filtres s'étant inscrits pour leur heuristique de
+ // en phase de << finalize prefiltering >> !!!
+ else if( mSymbexRequestManager.hasRequestsToContinue() )
+ {
+ if( mSymbexRequestManager.hasRequestContinue() )
+ {
+ mSymbexRequestManager.fireRequestContinue();
+ }
+
+ if( mSymbexRequestManager.hasRequestRequeueReserve() )
+ {
+ mSymbexRequestManager.fireRequestRequeueReserve();
+ }
+
+ if( mSymbexRequestManager.hasRequestRestart() )
+ {
+ mSymbexRequestManager.fireRequestRestart();
+ }
+ }
+
+ // Autrement, il n'y a rien à faire !!!
+ else
+ {
+ break;
+ }
+ }
+
+ // Tous ceux qui ont passé l'audition des pré-filtres avec succès sont
+ // mis en cache pour l'exécution symbolique
+ if( mSymbexDispatcher.hasReadyWork() )
+ {
+ mSymbexDispatcher.getExecutionWorkingQueue().splice(
+ mControllerUnitManager.getExecutionQueue().getReadyQueue());
+ }
+ else
+ {
+ this->handleRequestNoWork();
+ }
+ }
+ else
+ {
+ handleRequestNoWork();
+ }
+}
+
+
+void SymbexController::analyseResult()
+{
+ RunnableElement::setLifecycleRunning();
+
+ if( this->hasSymbexContext() )
+ {
+ mControllerUnitManager.getExecutionQueue().
+ spliceResult( this->getSymbexContexts() );
+
+ if( mControllerUnitManager.postfilter() )
+ {
+ mControllerUnitManager.finalizePostfiltering();
+ }
+
+ /**
+ * PROCESSOR REQUEST API :> check if has goal achieved
+ * GOAL_ACHIEVED
+ */
+ if( mSymbexRequestManager.hasRequestGoalAchieved() )
+ {
+ mSymbexRequestManager.fireRequestGoalAchieved();
+ }
+ }
+ else
+ {
+// RunnableElement::setLifecycleIdle();
+ RunnableElement::setLifecycleSuspended();
+ }
+}
+
+
+/**
+ * report Eval
+ */
+void SymbexController::reportEval() const
+{
+ mControllerUnitManager.reportEval(AVM_OS_TRACE);
+
+ mControllerUnitManager.reportEval(AVM_OS_COUT);
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/sew/SymbexController.h b/org.eclipse.efm.symbex/src/sew/SymbexController.h
new file mode 100644
index 0000000..fe0f19e
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/sew/SymbexController.h
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef SEW_SYMBEX_CONTROLLER_H_
+#define SEW_SYMBEX_CONTROLLER_H_
+
+#include <sew/SymbexJob.h>
+
+#include <fml/runtime/ExecutionContext.h>
+
+
+namespace sep
+{
+
+class ExecutionContext;
+class SymbexControllerRequestManager;
+class SymbexControllerUnitManager;
+class SymbexDispatcher;
+
+class SymbexController : public SymbexJob
+{
+
+ AVM_DECLARE_UNCLONABLE_CLASS(SymbexController)
+
+
+ /**
+ * ATTRIBUTES
+ */
+ SymbexControllerRequestManager & mSymbexRequestManager;
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ SymbexController(SymbexDispatcher & aSymbexDispatcher,
+ WObject * wfParameterObject,
+ SymbexControllerUnitManager & aControllerUnitManager);
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~SymbexController()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * Thread main Run Method
+ */
+ virtual void operator()();
+
+
+ void analyseReady();
+
+ void analyseResult();
+
+ /**
+ * report Eval
+ */
+ void reportEval() const;
+
+};
+
+
+} /* namespace sep */
+
+#endif /*SEW_SYMBEX_CONTROLLER_H_*/
diff --git a/org.eclipse.efm.symbex/src/sew/SymbexControllerRequestManager.cpp b/org.eclipse.efm.symbex/src/sew/SymbexControllerRequestManager.cpp
new file mode 100644
index 0000000..14b5209
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/sew/SymbexControllerRequestManager.cpp
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 3 mars 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "SymbexControllerRequestManager.h"
+
+
+namespace sep
+{
+
+void SymbexControllerRequestManager::osRequestor(
+ OutStream & os, const std::string & label,
+ const ListOfProcessorUnit & listofRequestor)
+{
+ os << TAB << label;
+
+ if( listofRequestor.singleton() )
+ {
+ os << listofRequestor.first()->strUniqId();
+ }
+ else if( listofRequestor.populated() )
+ {
+ ListOfProcessorUnit::const_iterator itRequestor = listofRequestor.begin();
+ ListOfProcessorUnit::const_iterator endRequestor = listofRequestor.end();
+
+ os << (*itRequestor)->strUniqId();
+ for( ++itRequestor ; itRequestor != endRequestor ; ++itRequestor )
+ {
+ os << " ;; " << (*itRequestor)->strUniqId();
+ }
+ }
+
+ os << EOL_FLUSH;
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/sew/SymbexControllerRequestManager.h b/org.eclipse.efm.symbex/src/sew/SymbexControllerRequestManager.h
new file mode 100644
index 0000000..09921f5
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/sew/SymbexControllerRequestManager.h
@@ -0,0 +1,487 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 3 mars 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef SEW_SYMBEX_CONTROLLER_REQUEST_MANAGER_H_
+#define SEW_SYMBEX_CONTROLLER_REQUEST_MANAGER_H_
+
+#include "SymbexJob.h"
+#include "SymbexControllerRequestStatus.h"
+
+#include <util/avm_numeric.h>
+#include <collection/List.h>
+
+#include <fam/api/AbstractProcessorUnit.h>
+
+#include <sew/SymbexControllerUnitManager.h>
+
+
+namespace sep
+{
+
+class OutStream;
+
+
+class SymbexControllerRequestManager :
+ public SymbexJob,
+ public SymbexControllerRequestStatus
+{
+
+ AVM_DECLARE_UNCLONABLE_CLASS(SymbexControllerRequestManager)
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef List< AbstractProcessorUnit * > ListOfProcessorUnit;
+
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ ListOfProcessorUnit mRequestStopListener;
+ ListOfProcessorUnit mRequestReleaseListener;
+
+ ListOfProcessorUnit mRequestResetListener;
+
+ ListOfProcessorUnit mRequestRestartListener;
+ ListOfProcessorUnit mRequestContinueListener;
+
+ ListOfProcessorUnit mRequestRequeueWaitingListener;
+ ListOfProcessorUnit mRequestRequeueReserveListener;
+
+ ListOfProcessorUnit mRequestHeuristicListener;
+
+ ListOfProcessorUnit mRequestGoalAchievedListener;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing Variables
+ ListOfProcessorUnit mFireRequestListener;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ SymbexControllerRequestManager(SymbexDispatcher & aSymbexDispatcher,
+ WObject * wfParameterObject,
+ SymbexControllerUnitManager & aCentralControllerUnit)
+ : SymbexJob(aSymbexDispatcher, wfParameterObject, aCentralControllerUnit),
+ SymbexControllerRequestStatus( REQUEST_UNDEFINED_STATUS ),
+
+ mRequestStopListener( ),
+ mRequestReleaseListener( ),
+
+ mRequestResetListener( ),
+
+ mRequestRestartListener( ),
+ mRequestContinueListener( ),
+
+ mRequestRequeueWaitingListener( ),
+ mRequestRequeueReserveListener( ),
+
+ mRequestHeuristicListener( ),
+
+ mRequestGoalAchievedListener( ),
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing Variables
+ mFireRequestListener( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~SymbexControllerRequestManager()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * Thread main Run Method
+ */
+ virtual void operator()()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PROCESSOR REQUEST API
+ ////////////////////////////////////////////////////////////////////////////
+
+ void osRequestor(OutStream & os, const std::string & label,
+ const ListOfProcessorUnit & listofRequestor);
+
+
+ /**
+ * REQUEST_STOP_STATUS
+ * mRequestStopListener
+ */
+ inline void fireRequestStop()
+ {
+ fireRequestStopInitialize();
+
+ while( mFireRequestListener.nonempty() )
+ {
+ mFireRequestListener.pop_first()->handleRequestStop();
+ }
+
+ mControllerUnitManager.handleRequestStop();
+ }
+
+ inline void fireRequestStopInitialize()
+ {
+ disableRequest( REQUEST_STOP_STATUS );
+
+ mFireRequestListener.clear();
+ mFireRequestListener.splice( mRequestStopListener );
+ }
+
+
+ inline void postRequestStop(AbstractProcessorUnit * aRequestor)
+ {
+ enableRequest( REQUEST_STOP_STATUS );
+
+ mRequestStopListener.add_union( aRequestor );
+ }
+
+
+ inline void strStopRequestor(OutStream & os, const std::string & label)
+ {
+ osRequestor(os, label, mRequestStopListener);
+ }
+
+
+ /**
+ * REQUEST_RELEASE_STATUS
+ * mRequestReleaseListener
+ */
+ inline void fireRequestRelease()
+ {
+ fireRequestReleaseInitialize();
+
+ AbstractProcessorUnit * aProcessor;
+ while( mFireRequestListener.nonempty() )
+ {
+ mFireRequestListener.pop_first_to( aProcessor );
+
+ mControllerUnitManager.handleRequestRelease(aProcessor);
+ }
+
+ mControllerUnitManager.handleRequestRelease();
+ }
+
+ inline void fireRequestReleaseInitialize()
+ {
+ disableRequest( REQUEST_RELEASE_STATUS );
+
+ mFireRequestListener.clear();
+ mFireRequestListener.splice( mRequestReleaseListener );
+ }
+
+
+ inline void postRequestRelease(AbstractProcessorUnit * aRequestor)
+ {
+ enableRequest( REQUEST_RELEASE_STATUS );
+
+ mRequestReleaseListener.add_union( aRequestor );
+ }
+
+
+ inline void strReleaseRequestor(OutStream & os, const std::string & label)
+ {
+ osRequestor(os, label, mRequestReleaseListener);
+ }
+
+
+ /**
+ * REQUEST_RESET_STATUS
+ * mRequestResetListener
+ */
+ inline void fireRequestReset()
+ {
+ fireRequestResetInitialize();
+
+ while( mFireRequestListener.nonempty() )
+ {
+ mFireRequestListener.pop_first()->handleRequestReset();
+ }
+
+ mControllerUnitManager.handleRequestReset();
+ }
+
+ inline void fireRequestResetInitialize()
+ {
+ disableRequest( REQUEST_RESET_STATUS );
+
+ mFireRequestListener.clear();
+ mFireRequestListener.splice( mRequestResetListener );
+ }
+
+
+ inline void postRequestReset(AbstractProcessorUnit * aRequestor)
+ {
+ enableRequest( REQUEST_RESET_STATUS );
+
+ mRequestResetListener.add_union( aRequestor );
+ }
+
+
+ inline void strRepostRequestor(OutStream & os, const std::string & label)
+ {
+ osRequestor(os, label, mRequestResetListener);
+ }
+
+
+ /**
+ * REQUEST_RESTART_STATUS
+ * mRequestRestartListener
+ */
+ inline void fireRequestRestart()
+ {
+ fireRequestRestartInitialize();
+
+ while( mFireRequestListener.nonempty() )
+ {
+ mFireRequestListener.pop_first()->handleRequestRestart();
+ }
+
+ mControllerUnitManager.handleRequestRestart();
+ }
+
+ inline void fireRequestRestartInitialize()
+ {
+ disableRequest( REQUEST_RESTART_STATUS );
+
+ mFireRequestListener.clear();
+ mFireRequestListener.splice( mRequestRestartListener );
+ }
+
+
+ inline void postRequestRestart(AbstractProcessorUnit * aRequestor)
+ {
+ enableRequest( REQUEST_RESTART_STATUS );
+
+ mRequestRestartListener.add_union( aRequestor );
+ }
+
+
+ inline void strRestartRequestor(OutStream & os, const std::string & label)
+ {
+ osRequestor(os, label, mRequestRestartListener);
+ }
+
+
+ /**
+ * REQUEST_CONTINUE_STATUS
+ * mRequestContinueListener
+ */
+ inline void fireRequestContinue()
+ {
+ fireRequestContinueInitialize();
+
+ while( mFireRequestListener.nonempty() )
+ {
+ mFireRequestListener.pop_first()->handleRequestContinue();
+ }
+
+ mControllerUnitManager.handleRequestContinue();
+ }
+
+ inline void fireRequestContinueInitialize()
+ {
+ disableRequest( REQUEST_CONTINUE_STATUS );
+
+ mFireRequestListener.clear();
+ mFireRequestListener.splice( mRequestContinueListener );
+ }
+
+
+ inline void postRequestContinue(AbstractProcessorUnit * aRequestor)
+ {
+ enableRequest( REQUEST_CONTINUE_STATUS );
+
+ mRequestContinueListener.add_union( aRequestor );
+ }
+
+
+ inline void strContinueRequestor(OutStream & os, const std::string & label)
+ {
+ osRequestor(os, label, mRequestContinueListener);
+ }
+
+
+ /**
+ * REQUEST_REQUEUE_WAITING_STATUS
+ * mRequestRequeueWaitingListener
+ */
+ inline void fireRequestRequeueWaiting()
+ {
+ fireRequestRequeueWaitingInitialize();
+
+ while( mFireRequestListener.nonempty() )
+ {
+ mControllerUnitManager.handleRequestRequeueWaiting(
+ mFireRequestListener.pop_first() );
+ }
+ }
+
+ inline void fireRequestRequeueWaitingInitialize()
+ {
+ disableRequest( REQUEST_REQUEUE_WAITING_STATUS );
+
+ mFireRequestListener.clear();
+ mFireRequestListener.splice( mRequestRequeueWaitingListener );
+ }
+
+
+ inline void postRequestRequeueWaiting(AbstractProcessorUnit * aRequestor)
+ {
+ enableRequest( REQUEST_REQUEUE_WAITING_STATUS );
+
+ mRequestRequeueWaitingListener.add_union( aRequestor );
+ }
+
+
+ inline void strRequeueWaitingRequestor(
+ OutStream & os, const std::string & label)
+ {
+ osRequestor(os, label, mRequestRequeueWaitingListener);
+ }
+
+
+ /**
+ * REQUEST_REQUEUE_RESERVE_STATUS
+ * mRequestRequeueReserveListener
+ */
+ inline void fireRequestRequeueReserve()
+ {
+ fireRequestRequeueReserveInitialize();
+
+ while( mFireRequestListener.nonempty() )
+ {
+ mControllerUnitManager.handleRequestRequeueReserve(
+ mFireRequestListener.pop_first() );
+ }
+ }
+
+ inline void fireRequestRequeueReserveInitialize()
+ {
+ disableRequest( REQUEST_REQUEUE_RESERVE_STATUS );
+
+ mFireRequestListener.clear();
+ mFireRequestListener.splice( mRequestRequeueReserveListener );
+ }
+
+
+ inline void postRequestRequeueReserve(AbstractProcessorUnit * aRequestor)
+ {
+ enableRequest( REQUEST_REQUEUE_RESERVE_STATUS );
+
+ mRequestRequeueReserveListener.add_union( aRequestor );
+ }
+
+
+ inline void strRequeueReserveRequestor(
+ OutStream & os, const std::string & label)
+ {
+ osRequestor(os, label, mRequestRequeueReserveListener);
+ }
+
+
+ /**
+ * REQUEST_HEURISTIC_STATUS
+ * mRequestHeuristicListener
+ */
+ inline void fireRequestHeuristic()
+ {
+ fireRequestHeuristicInitialize();
+
+ while( mFireRequestListener.nonempty() )
+ {
+ mFireRequestListener.pop_first()->handleRequestHeuristic();
+ }
+ }
+
+ inline void fireRequestHeuristicInitialize()
+ {
+ disableRequest( REQUEST_HEURISTIC_STATUS );
+
+ mFireRequestListener.clear();
+ mFireRequestListener.splice( mRequestHeuristicListener );
+ }
+
+
+ inline void postRequestHeuristic(AbstractProcessorUnit * aRequestor)
+ {
+ enableRequest( REQUEST_HEURISTIC_STATUS );
+
+ mRequestHeuristicListener.add_union( aRequestor );
+ }
+
+
+ inline void strHeuristicRequestor(OutStream & os, const std::string & label)
+ {
+ osRequestor(os, label, mRequestHeuristicListener);
+ }
+
+
+ /**
+ * REQUEST_GOAL_ACHIEVED_STATUS
+ * mRequestGoalAchievedListener
+ */
+ inline void fireRequestGoalAchieved()
+ {
+ SymbexControllerRequestManager::fireRequestGoalAchievedInitialize();
+
+ while( mFireRequestListener.nonempty() )
+ {
+ mFireRequestListener.pop_first()->handleRequestGoalAchieved();
+ }
+ }
+
+ inline void fireRequestGoalAchievedInitialize()
+ {
+ disableRequest( REQUEST_GOAL_ACHIEVED_STATUS );
+
+ mFireRequestListener.clear();
+ mFireRequestListener.splice( mRequestGoalAchievedListener );
+ }
+
+
+ inline void postRequestGoalAchieved(AbstractProcessorUnit * aRequestor)
+ {
+ enableRequest( REQUEST_GOAL_ACHIEVED_STATUS );
+
+ mRequestGoalAchievedListener.add_union( aRequestor );
+ }
+
+
+ inline void strGoalAchievedRequestor(
+ OutStream & os, const std::string & label)
+ {
+ osRequestor(os, label, mRequestGoalAchievedListener);
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* SEW_SYMBEX_CONTROLLER_REQUEST_MANAGER_H_ */
diff --git a/org.eclipse.efm.symbex/src/sew/SymbexControllerRequestStatus.h b/org.eclipse.efm.symbex/src/sew/SymbexControllerRequestStatus.h
new file mode 100644
index 0000000..5ac88fa
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/sew/SymbexControllerRequestStatus.h
@@ -0,0 +1,304 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 3 mars 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef SEW_SYMBEX_CONTROLLER_REQUEST_STATUS_H_
+#define SEW_SYMBEX_CONTROLLER_REQUEST_STATUS_H_
+
+#include <util/avm_numeric.h>
+#include <collection/List.h>
+
+#include <fam/api/AbstractProcessorUnit.h>
+
+
+namespace sep
+{
+
+class OutStream;
+
+
+class SymbexControllerRequestStatus
+{
+
+public:
+ /**
+ * TYPEDEF
+ */
+ typedef avm_uint16_t request_status_t;
+
+ enum
+ {
+ REQUEST_UNDEFINED_STATUS = 0x0000,
+
+
+ REQUEST_STOP_STATUS = 0x0001,
+
+ REQUEST_RELEASE_STATUS = 0x0002,
+
+
+ REQUEST_RESET_STATUS = 0x0010,
+
+ REQUEST_RESTART_STATUS = 0x0020,
+
+ REQUEST_CONTINUE_STATUS = 0x0040,
+
+
+ REQUEST_REQUEUE_WAITING_STATUS = 0x0100,
+
+ REQUEST_REQUEUE_RESERVE_STATUS = 0x0200,
+
+ REQUEST_HEURISTIC_STATUS = 0x0400,
+
+
+ REQUEST_GOAL_ACHIEVED_STATUS = 0x0800,
+
+ // ALIAS
+ REQUEST_ALIAS_CONTINUE_STATUS = REQUEST_CONTINUE_STATUS
+ | REQUEST_REQUEUE_RESERVE_STATUS
+ | REQUEST_RESTART_STATUS,
+ };
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+
+ /**
+ * Runtime Processor Request
+ * NOTHING | STOP | RESET | RESTART | RELEASE | REQUEUE | HEURISTIC
+ */
+ request_status_t mRequestStatus;
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ SymbexControllerRequestStatus(request_status_t aRequestStatus)
+ : mRequestStatus( aRequestStatus )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~SymbexControllerRequestStatus()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mRequestStatus
+ */
+ inline request_status_t getRequestStatus() const
+ {
+ return( mRequestStatus );
+ }
+
+ inline bool hasRequestStatus() const
+ {
+ return( mRequestStatus != REQUEST_UNDEFINED_STATUS );
+ }
+
+ inline bool noRequestStatus() const
+ {
+ return( mRequestStatus == REQUEST_UNDEFINED_STATUS );
+ }
+
+
+ inline bool hasRequestStatus(request_status_t aRequestStatus) const
+ {
+ return( (mRequestStatus & REQUEST_UNDEFINED_STATUS) != 0 );
+ }
+
+ inline bool isRequestStatus(request_status_t aRequestStatus) const
+ {
+ return( mRequestStatus == REQUEST_UNDEFINED_STATUS );
+ }
+
+ inline void setRequestStatus(request_status_t aRequest)
+ {
+ mRequestStatus = aRequest;
+ }
+
+
+ /**
+ * ENABLE - DISABLE
+ * mRequestStatus
+ */
+ inline void enableRequest(request_status_t aRequestStatus)
+ {
+ mRequestStatus = mRequestStatus | aRequestStatus;
+ }
+
+ inline void disableRequest(request_status_t aRequestStatus)
+ {
+ mRequestStatus = mRequestStatus & (~ aRequestStatus);
+ }
+
+ inline void disableRequestStatus()
+ {
+ mRequestStatus = REQUEST_UNDEFINED_STATUS;
+ }
+
+ inline bool hasRequestEnabled() const
+ {
+ return( mRequestStatus != REQUEST_UNDEFINED_STATUS );
+ }
+
+ inline bool isRequestDisabled() const
+ {
+ return( mRequestStatus == REQUEST_UNDEFINED_STATUS );
+ }
+
+
+ /**
+ * TESTER
+ * REQUEST_ALIAS_CONTINUE_STATUS
+ */
+ inline bool hasRequestsToContinue() const
+ {
+ return( (mRequestStatus & REQUEST_ALIAS_CONTINUE_STATUS) != 0 );
+ }
+
+ inline bool hasntRequestsToContinue() const
+ {
+ return( (mRequestStatus & REQUEST_ALIAS_CONTINUE_STATUS) == 0 );
+ }
+
+ /**
+ * REQUEST_STOP_STATUS
+ * mRequestStatus
+ */
+ inline bool hasRequestStop() const
+ {
+ return( (mRequestStatus & REQUEST_STOP_STATUS) != 0 );
+ }
+
+ inline bool hasntRequestStop() const
+ {
+ return( (mRequestStatus & REQUEST_STOP_STATUS) == 0 );
+ }
+
+ /**
+ * REQUEST_RELEASE_STATUS
+ * mRequestStatus
+ */
+ inline bool hasRequestRelease() const
+ {
+ return( (mRequestStatus & REQUEST_RELEASE_STATUS) != 0 );
+ }
+
+ inline bool hasntRequestRelease() const
+ {
+ return( (mRequestStatus & REQUEST_RELEASE_STATUS) == 0 );
+ }
+
+ /**
+ * REQUEST_RESET_STATUS
+ * mRequestStatus
+ */
+ inline bool hasRequestReset() const
+ {
+ return( (mRequestStatus & REQUEST_RESET_STATUS) != 0 );
+ }
+
+ inline bool hasntRequestReset() const
+ {
+ return( (mRequestStatus & REQUEST_RESET_STATUS) == 0 );
+ }
+
+ /**
+ * REQUEST_RESTART_STATUS
+ * mRequestStatus
+ */
+ inline bool hasRequestRestart() const
+ {
+ return( (mRequestStatus & REQUEST_RESTART_STATUS) != 0 );
+ }
+
+ inline bool hasntRequestRestart() const
+ {
+ return( (mRequestStatus & REQUEST_RESTART_STATUS) == 0 );
+ }
+
+ /**
+ * REQUEST_CONTINUE_STATUS
+ * mRequestStatus
+ */
+ inline bool hasRequestContinue() const
+ {
+ return( (mRequestStatus & REQUEST_CONTINUE_STATUS) != 0 );
+ }
+
+ inline bool hasntRequestContinue() const
+ {
+ return( (mRequestStatus & REQUEST_CONTINUE_STATUS) == 0 );
+ }
+
+ /**
+ * REQUEST_REQUEUE_WAITING_STATUS
+ * mRequestStatus
+ */
+ inline bool hasRequestRequeueWaiting() const
+ {
+ return( (mRequestStatus & REQUEST_REQUEUE_WAITING_STATUS) != 0 );
+ }
+
+ inline void setRequestRequeueWaiting()
+ {
+ mRequestStatus = REQUEST_REQUEUE_WAITING_STATUS;
+ }
+
+ /**
+ * REQUEST_REQUEUE_RESERVE_STATUS
+ * mRequestStatus
+ */
+ inline bool hasRequestRequeueReserve() const
+ {
+ return( (mRequestStatus & REQUEST_REQUEUE_RESERVE_STATUS) != 0 );
+ }
+
+ /**
+ * REQUEST_HEURISTIC_STATUS
+ * mRequestStatus
+ */
+ inline bool hasRequestHeuristic() const
+ {
+ return( (mRequestStatus & REQUEST_HEURISTIC_STATUS) != 0 );
+ }
+
+ inline void setRequestHeuristic()
+ {
+ mRequestStatus = REQUEST_HEURISTIC_STATUS;
+ }
+
+ /**
+ * REQUEST_GOAL_ACHIEVED_STATUS
+ * mRequestStatus
+ */
+ inline bool hasRequestGoalAchieved() const
+ {
+ return( (mRequestStatus & REQUEST_GOAL_ACHIEVED_STATUS) != 0 );
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* SEW_SYMBEX_CONTROLLER_REQUEST_STATUS_H_ */
diff --git a/org.eclipse.efm.symbex/src/sew/SymbexControllerUnitManager.cpp b/org.eclipse.efm.symbex/src/sew/SymbexControllerUnitManager.cpp
new file mode 100644
index 0000000..68297d7
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/sew/SymbexControllerUnitManager.cpp
@@ -0,0 +1,577 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 28 nov. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "SymbexControllerUnitManager.h"
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <fam/api/ProcessorUnitFactory.h>
+#include <fam/api/ProcessorUnitRepository.h>
+
+#include <fam/queue/ExecutionQueue.h>
+
+#include <sew/SymbexEngine.h>
+
+
+namespace sep
+{
+
+
+/**
+ * GETTER
+ * Configuration
+ */
+Configuration & SymbexControllerUnitManager::getConfiguration() const
+{
+ return( mSymbexEngine.getConfiguration() );
+}
+
+/**
+ * GETTER
+ * Builder
+ */
+Builder & SymbexControllerUnitManager::getBuilder()
+{
+ return( mSymbexEngine.getBuilder() );
+}
+
+/**
+ * GETTER
+ * AvmPrimitiveProcessor
+ */
+AvmPrimitiveProcessor & SymbexControllerUnitManager::getPrimitiveProcessor()
+{
+ return( mSymbexEngine.getPrimitiveProcessor() );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+
+bool SymbexControllerUnitManager::preConfigure()
+{
+ WObject * theCONFIG = getParameterWObject();
+
+ theCONFIG = Query::getRegexWSequence(theCONFIG,
+ OR_WID2("manifest", "MANIFEST"), theCONFIG);
+
+ if( theCONFIG != WObject::_NULL_ )
+ {
+ mAutoStart = Query::getRegexWPropertyBoolean(
+ theCONFIG, CONS_WID2("auto", "start"), false);
+
+ mAutoConfigure = Query::getRegexWPropertyBoolean(
+ theCONFIG, CONS_WID2("auto", "conf(igure)?"), false);
+ }
+
+ return( mAutoConfigure || mAutoStart );
+}
+
+bool SymbexControllerUnitManager::configure()
+{
+ AVM_OS_LOG << _SEW_
+ << "< start > SymbexControllerUnitManager::configure ..."
+ << std::endl;
+
+ mConfigFlag = true;
+
+ if( preConfigure() )
+ {
+ //!! NOTHING
+ }
+
+ // Select MOE profile
+ WObject * moeProfile = Query::getRegexWSequence(
+ getParameterWObject(), OR_WID2("moe", "MOE"));
+ if( moeProfile == WObject::_NULL_ )
+ {
+ moeProfile = Query::getRegexWSequence(
+ getParameterWObject(), OR_WID2("moc", "MOC"));
+ }
+
+ // A Possible Specific Profile
+ WObject * aProfile = Query::getWPropertyWReferenceOrElse(
+ moeProfile, "moe", "profile", WObject::_NULL_);
+ if( aProfile != WObject::_NULL_ )
+ {
+ WObject * thePROPERTY = Query::getRegexWSequence(
+ aProfile, OR_WID2("property", "PROPERTY"));
+ if( thePROPERTY != WObject::_NULL_ )
+ {
+ moeProfile = thePROPERTY;
+ }
+ else
+ {
+ moeProfile = aProfile;
+ }
+ }
+
+ mConfigFlag = ProcessorUnitFactory::configure(*this,
+ getParameterWObject(), moeProfile)
+ && mConfigFlag;
+
+
+AVM_IF_DEBUG_FLAG( CONFIGURING )
+ AVM_OS_LOG << "The process configuration:> " << std::endl;
+ toStream(AVM_OS_LOG);
+AVM_ENDIF_DEBUG_FLAG( CONFIGURING )
+
+ AVM_OS_LOG << _SEW_
+ << "< end > SymbexControllerUnitManager::configure ... done."
+ << std::endl;
+
+ return mConfigFlag;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// INIT / EXIT API
+////////////////////////////////////////////////////////////////////////////////
+
+bool SymbexControllerUnitManager::initImpl()
+{
+ processorIt = mControllerUnits.begin();
+ processorItEnd = mControllerUnits.end();
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt)->isEnablePlugin() )
+ {
+ if( not (*processorIt)->init() )
+ {
+ AVM_OS_CLOG << "Failed to init the PLUGIN PROCESSOR << "
+ << ( *processorIt)->getParameterWObject()
+ ->getFullyQualifiedNameID()
+ << " >> " << std::endl;
+
+ return( false );
+ }
+ }
+ }
+
+ return true;
+}
+
+bool SymbexControllerUnitManager::exitImpl()
+{
+ processorIt = mControllerUnits.begin();
+ processorItEnd = mControllerUnits.end();
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt)->isEnablePlugin() )
+ {
+ if( not (*processorIt)->exit() )
+ {
+ AVM_OS_CLOG << "Failed to exit the PLUGIN PROCESSOR << "
+ << ( *processorIt)->getParameterWObject()
+ ->getFullyQualifiedNameID()
+ << " >> " << std::endl;
+
+ return( false );
+ }
+ }
+ }
+
+ return( true );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// ( PRE / POST ) PROCESS API
+////////////////////////////////////////////////////////////////////////////////
+
+bool SymbexControllerUnitManager::preprocess()
+{
+ bool isOK = mMainProcessor.preprocess();
+
+ if( isOK )
+ {
+ isOK = mPreprocessorControllerUnits.preprocess();
+ }
+
+AVM_IF_DEBUG_ENABLED_AND( mMainProcessor.isDebugPreprocessing() )
+ mMainProcessor.debugPreprocessing();
+AVM_ENDIF_DEBUG_ENABLED_AND
+
+ return( isOK );
+}
+
+
+bool SymbexControllerUnitManager::postprocess()
+{
+ bool isOK = mMainProcessor.postprocess();
+
+ if( isOK )
+ {
+ isOK = mPostprocessorControllerUnits.postprocess();
+ }
+
+AVM_IF_DEBUG_ENABLED_AND( mMainProcessor.isDebugPostprocessing() )
+ mMainProcessor.debugPostprocessing();
+AVM_ENDIF_DEBUG_ENABLED_AND
+
+ return( isOK );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// FILTERING API
+////////////////////////////////////////////////////////////////////////////////
+
+bool SymbexControllerUnitManager::filteringInitialize()
+{
+ bool isOK = true;
+
+ processorIt = mControllerUnits.begin();
+ processorItEnd = mControllerUnits.end();
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt)->isWeakEnableFilter() )
+ {
+ if( not (*processorIt)->filteringInitialize() )
+ {
+ isOK = false;
+
+ break;
+ }
+ }
+ }
+
+// if( mMainProcessor.filteringInitialize() )
+// {
+// return( mPrefilterControllerUnits.filteringInitialize() );
+// }
+//
+// return( false );
+
+ AVM_IF_DEBUG_ENABLED_AND( mMainProcessor.isDebugFilteringInitialize() )
+ mMainProcessor.debugFilteringInitialize();
+ AVM_ENDIF_DEBUG_ENABLED_AND
+
+ return( isOK );
+}
+
+
+bool SymbexControllerUnitManager::filteringFinalize()
+{
+ bool isOK = true;
+
+ processorIt = mControllerUnits.begin();
+ processorItEnd = mControllerUnits.end();
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt)->isWeakEnableFilter() )
+ {
+ if( not (*processorIt)->filteringFinalize() )
+ {
+ isOK = false;
+
+ break;
+ }
+ }
+ }
+
+// if( mMainProcessor.filteringFinalize() )
+// {
+// return( mPrefilterControllerUnits.filteringFinalize() );
+// }
+//
+// return( false );
+
+ AVM_IF_DEBUG_ENABLED_AND( mMainProcessor.isDebugFilteringFinalize() )
+ mMainProcessor.debugFilteringFinalize();
+ AVM_ENDIF_DEBUG_ENABLED_AND
+
+ return( isOK );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// ( PRE / POST ) FILTER API
+////////////////////////////////////////////////////////////////////////////////
+
+bool SymbexControllerUnitManager::prefilter()
+{
+AVM_IF_DEBUG_ENABLED_AND( mMainProcessor.isDebugPrefiltering() )
+ mMainProcessor.debugPrefiltering();
+AVM_ENDIF_DEBUG_ENABLED_AND
+
+
+ if( mMainProcessor.prefilter() )
+ {
+ if( mRedundancyProcessor.prefilter() )
+ {
+ return( mPrefilterControllerUnits.prefilter() );
+ }
+ }
+
+ return( false );
+}
+
+
+bool SymbexControllerUnitManager::finalizePrefiltering()
+{
+ bool isOK = mMainProcessor.finalizePrefiltering();
+
+AVM_IF_DEBUG_ENABLED_AND( mMainProcessor.isDebugPrefilteringFinalize() )
+ mMainProcessor.debugPrefilteringFinalize();
+AVM_ENDIF_DEBUG_ENABLED_AND
+
+ return( isOK );
+}
+
+
+bool SymbexControllerUnitManager::postfilter()
+{
+AVM_IF_DEBUG_ENABLED_AND( mMainProcessor.isDebugPostfiltering() )
+ mMainProcessor.debugPostfiltering();
+AVM_ENDIF_DEBUG_ENABLED_AND
+
+ if( mMainProcessor.postfilter() )
+ {
+ return( mPostfilterControllerUnits.postfilter() );
+ }
+
+ return( false );
+}
+
+
+bool SymbexControllerUnitManager::finalizePostfiltering()
+{
+ bool isOK = mMainProcessor.finalizePostfiltering();
+
+// if( mMainProcessor.finalizePostfiltering() )
+// {
+// return( mPostfilterControllerUnits.finalizePostfiltering() );
+// }
+//
+// return( false );
+
+AVM_IF_DEBUG_ENABLED_AND( mMainProcessor.isDebugPostfilteringFinalize() )
+ mMainProcessor.debugPostfilteringFinalize();
+AVM_ENDIF_DEBUG_ENABLED_AND
+
+ return( isOK );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// REPORT API
+////////////////////////////////////////////////////////////////////////////////
+
+void SymbexControllerUnitManager::report(OutStream & os) const
+{
+ if( mControllerUnits.nonempty() )
+ {
+ os << TAB << "REPORT" << EOL_INCR_INDENT;
+
+ mQueueProcessor.report(os);
+ os << std::flush;
+
+ mMainProcessor.report(os);
+ os << std::flush;
+
+ mRedundancyProcessor.report(os);
+ os << std::flush;
+
+ controller_iterator processorIt = mControllerUnits.begin();
+ controller_iterator processorItEnd = mControllerUnits.end();
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt)->isEnablePlugin() )
+ {
+ (*processorIt)->report(os);
+ os << std::flush;
+ }
+ }
+
+ os << DECR_INDENT << std::flush;
+ }
+}
+
+
+/**
+ * EVAL TRACE
+ */
+void SymbexControllerUnitManager::traceBoundEval(OutStream & os) const
+{
+// AVM_OS_ASSERT_FATAL_ERROR_EXIT(
+// CompositeControllerUnit::first() == (& mMainProcessor) )
+// << "You found a BUG !!!"
+// << SEND_EXIT;
+
+ mMainProcessor.traceBoundEval(os);
+ os << std::flush;
+
+ controller_iterator processorIt = mControllerUnits.begin();
+ controller_iterator processorItEnd = mControllerUnits.end();
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt)->isEnablePlugin() )
+ {
+ (*processorIt)->traceBoundEval(os);
+ }
+ }
+}
+
+
+void SymbexControllerUnitManager::tracePreEval(
+ OutStream & os, const ExecutionContext & anEC) const
+{
+// AVM_OS_ASSERT_FATAL_ERROR_EXIT(
+// CompositeControllerUnit::first() == (& mMainProcessor) )
+// << "You found a BUG !!!"
+// << SEND_EXIT;
+
+ mMainProcessor.tracePreEval(os, anEC);
+ os << std::flush;
+
+ controller_iterator processorIt = mControllerUnits.begin();
+ controller_iterator processorItEnd = mControllerUnits.end();
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt)->isEnablePlugin() &&
+ (*processorIt)->isLifecycleRunnable() )
+ {
+ (*processorIt)->tracePreEval(os, anEC);
+ }
+ }
+}
+
+
+void SymbexControllerUnitManager::tracePostEval(
+ OutStream & os, const ExecutionContext & anEC) const
+{
+// AVM_OS_ASSERT_FATAL_ERROR_EXIT(
+// CompositeControllerUnit::first() == (& mMainProcessor) )
+// << "You found a BUG !!!"
+// << SEND_EXIT;
+
+ mMainProcessor.tracePostEval(os, anEC);
+ os << std::flush;
+
+ controller_iterator processorIt = mControllerUnits.begin();
+ controller_iterator processorItEnd = mControllerUnits.end();
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt)->isEnablePlugin() &&
+ (*processorIt)->isLifecycleRunnable() )
+ {
+ (*processorIt)->tracePostEval(os, anEC);
+ }
+ }
+}
+
+
+void SymbexControllerUnitManager::reportEval(OutStream & os) const
+{
+// AVM_OS_ASSERT_FATAL_ERROR_EXIT(
+// CompositeControllerUnit::first() == (& mMainProcessor) )
+// << "You found a BUG !!!"
+// << SEND_EXIT;
+
+ mMainProcessor.reportEval(os);
+ os << std::flush;
+
+ controller_iterator processorIt = mControllerUnits.begin();
+ controller_iterator processorItEnd = mControllerUnits.end();
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt)->isEnablePlugin() )
+ {
+ (*processorIt)->reportEval(os);
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// UNIT TEST API
+////////////////////////////////////////////////////////////////////////////////
+
+void SymbexControllerUnitManager::tddUnitReport(OutStream & os) const
+{
+ mMainProcessor.tddUnitReport(os);
+
+ controller_iterator processorIt = mControllerUnits.begin();
+ controller_iterator processorItEnd = mControllerUnits.end();
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt)->isEnablePlugin() )
+ {
+ (*processorIt)->tddUnitReport(os);
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// NON-REGRESSION TEST API
+////////////////////////////////////////////////////////////////////////////////
+
+void SymbexControllerUnitManager::tddRegressionReport(OutStream & os) const
+{
+ mMainProcessor.tddRegressionReport(os);
+
+ controller_iterator processorIt = mControllerUnits.begin();
+ controller_iterator processorItEnd = mControllerUnits.end();
+ for( ; processorIt != processorItEnd ; ++processorIt )
+ {
+ if( (*processorIt)->isEnablePlugin() )
+ {
+ (*processorIt)->tddRegressionReport(os);
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// SERIALIZATION API
+////////////////////////////////////////////////////////////////////////////////
+
+void SymbexControllerUnitManager::toStream(OutStream & os) const
+{
+// if( mParameterWObject != NULL )
+// {
+// mParameterWObject->toStream(os);
+// }
+
+ os << TAB << "moe:" << EOL_INCR_INDENT;
+
+ os << TAB << "supervisor = " << mMainProcessor.strUniqId() << ";" << EOL;
+
+ os << TAB << "queue = " << mQueueProcessor.strUniqId() << ";" << EOL;
+
+ os << TAB << "redundancy = " << mRedundancyProcessor.strUniqId() << ";"
+ << EOL2;
+
+ mPreprocessorControllerUnits.toStream(os, "pre_processor = " );
+
+ os << EOL;
+
+ mPrefilterControllerUnits.toStream(os, "pre_filter = " );
+
+ mPostfilterControllerUnits.toStream(os, "post_filter = " );
+
+ os << EOL;
+
+ mPostprocessorControllerUnits.toStream(os, "post_processor = " );
+
+ os << DECR_INDENT;
+
+}
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/sew/SymbexControllerUnitManager.h b/org.eclipse.efm.symbex/src/sew/SymbexControllerUnitManager.h
new file mode 100644
index 0000000..81e8cef
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/sew/SymbexControllerUnitManager.h
@@ -0,0 +1,629 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 28 nov. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef SEW_SYMBEX_CONTROLLER_UNIT_MANAGER_H_
+#define SEW_SYMBEX_CONTROLLER_UNIT_MANAGER_H_
+
+#include <fam/api/AbstractProcessorUnit.h>
+
+#include <collection/Typedef.h>
+
+#include <fam/api/CompositeControllerUnit.h>
+#include <fam/api/MainProcessorUnit.h>
+#include <fam/api/ProcessorUnitAutoRegistration.h>
+
+#include <fam/queue/ExecutionQueue.h>
+
+#include <fam/redundancy/RedundancyFilter.h>
+
+
+namespace sep
+{
+
+
+class AvmPrimitiveProcessor;
+class Builder;
+class Configuration;
+class SymbexEngine;
+class WObject;
+
+
+class SymbexControllerUnitManager : public RunnableElement
+{
+
+ AVM_DECLARE_CLONABLE_CLASS( SymbexControllerUnitManager )
+
+protected:
+ /**
+ * TYPEDEF
+ */
+ typedef List< AbstractProcessorUnit * > ListOfControllerUnits;
+
+public:
+ typedef ListOfControllerUnits::iterator rw_controller_iterator;
+ typedef ListOfControllerUnits::const_iterator controller_iterator;
+
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ SymbexEngine & mSymbexEngine;
+
+ bool mAutoConfigure;
+ bool mAutoStart;
+
+ ExecutionQueue mQueueProcessor;
+
+ MainProcessorUnit mMainProcessor;
+
+ RedundancyFilter mRedundancyProcessor;
+
+ CompositeControllerUnit mControllerUnits;
+
+ CompositeControllerUnit mPreprocessorControllerUnits;
+ CompositeControllerUnit mPostprocessorControllerUnits;
+
+ CompositeControllerUnit mPrefilterControllerUnits;
+ CompositeControllerUnit mPostfilterControllerUnits;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing Variables
+ rw_controller_iterator processorIt;
+ rw_controller_iterator processorItEnd;
+
+
+public:
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ SymbexControllerUnitManager(
+ SymbexEngine & anEngine, WObject * wfParameterObject)
+ : RunnableElement(
+ CLASS_KIND_T( SymbexControllerUnitManager ), wfParameterObject),
+
+ mSymbexEngine( anEngine ),
+
+ mAutoConfigure( false ),
+ mAutoStart( false ),
+
+ mQueueProcessor( *this ),
+ mMainProcessor( *this ),
+ mRedundancyProcessor( *this ),
+
+ mControllerUnits( *this ),
+
+ mPreprocessorControllerUnits( *this ),
+ mPostprocessorControllerUnits( *this ),
+
+ mPrefilterControllerUnits( *this ),
+ mPostfilterControllerUnits( *this ),
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing Variables
+ processorIt( ),
+ processorItEnd( )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~SymbexControllerUnitManager()
+ {
+ AbstractProcessorUnit * itProcessor = NULL;
+
+ while( mControllerUnits.nonempty() )
+ {
+ itProcessor = mControllerUnits.pop_last();
+
+ // Don't delete << mMainProcessor | mQueueProcessor >>
+ if( (itProcessor != (& mMainProcessor ))
+ && (itProcessor != (& mQueueProcessor))
+ && (itProcessor != (& mRedundancyProcessor)) )
+ {
+ delete( itProcessor );
+ }
+ }
+ }
+
+
+ inline virtual void append(AbstractProcessorUnit * aProcessor)
+ {
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( aProcessor )
+ << "Processor Unit !!!"
+ << SEND_EXIT;
+
+//!![MIGRATION]
+// AVM_OS_ASSERT_WARNING_ALERT( aProcessor != (& mMainProcessor) )
+// << "Unexpected MainProcessor !!!"
+// << SEND_ALERT;
+// AVM_OS_ASSERT_WARNING_ALERT( aProcessor != (& mQueueProcessor) )
+// << "Unexpected QueueProcessor !!!"
+// << SEND_ALERT;
+// AVM_OS_ASSERT_WARNING_ALERT( aProcessor != (& mRedundancyProcessor) )
+// << "Unexpected QueueProcessor !!!"
+// << SEND_ALERT;
+
+ // Don't append << mMainProcessor | mQueueProcessor >>
+ if( (aProcessor != (& mMainProcessor))
+ && (aProcessor != (& mQueueProcessor))
+ && (aProcessor != (& mRedundancyProcessor)) )
+ {
+ mControllerUnits.append( aProcessor );
+ }
+ }
+
+ /**
+ * GETTER
+ * mSymbexEngine
+ * Configuration
+ */
+ inline SymbexEngine & getSymbexEngine()
+ {
+ return( mSymbexEngine );
+ }
+
+ inline const SymbexEngine & getSymbexEngine() const
+ {
+ return( mSymbexEngine );
+ }
+
+ /**
+ * GETTER
+ * Configuration
+ */
+ Configuration & getConfiguration() const;
+
+ /**
+ * GETTER
+ * Builder
+ */
+ Builder & getBuilder();
+
+ /**
+ * GETTER
+ * AvmPrimitiveProcessor
+ */
+ AvmPrimitiveProcessor & getPrimitiveProcessor();
+
+
+ /**
+ * GETTER
+ * mAutoConfigure
+ * mAutoStart
+ */
+ inline bool isAutoConfigure() const
+ {
+ return( mAutoConfigure );
+ }
+
+ inline bool isAutoStart() const
+ {
+ return( mAutoStart );
+ }
+
+
+ /**
+ * GETTER
+ * mExecutionQueue
+ */
+ inline ExecutionQueue & getExecutionQueue()
+ {
+ return( mQueueProcessor );
+ }
+
+
+ /**
+ * GETTER
+ * mMainProcessor
+ */
+ inline MainProcessorUnit & getMainProcessor()
+ {
+ return( mMainProcessor );
+ }
+
+ inline const MainProcessorUnit & getMainProcessor() const
+ {
+ return( mMainProcessor );
+ }
+
+ /**
+ * GETTER
+ * mRedundancyProcessor
+ */
+ inline RedundancyFilter & getRedundancyProcessor()
+ {
+ return( mRedundancyProcessor );
+ }
+
+
+ /**
+ * GETTER
+ * mControllerUnits
+ */
+ inline CompositeControllerUnit & getControllerUnits()
+ {
+ return( mControllerUnits );
+ }
+
+ /**
+ * GETTER
+ * mControllerUnits
+ * by parameter WObject / FullyQualifiedNameID
+ */
+ inline AbstractProcessorUnit * getControllerUnit(
+ const IProcessorUnitRegistration & aRegisterTool)
+ {
+ if( mMainProcessor.isRegisterTool( aRegisterTool ) )
+ {
+ return( & mMainProcessor );
+ }
+ else if( mQueueProcessor.isRegisterTool( aRegisterTool ) )
+ {
+ return( & mQueueProcessor );
+ }
+ else if( mRedundancyProcessor.isRegisterTool( aRegisterTool ) )
+ {
+ return( & mRedundancyProcessor );
+ }
+ else
+ {
+ return( mControllerUnits.getControllerUnit( aRegisterTool ) );
+ }
+ }
+
+ inline AbstractProcessorUnit * getControllerUnit(
+ WObject * wfProcessorObject)
+ {
+ if( mMainProcessor.getParameterWObject() == wfProcessorObject )
+ {
+ return( & mMainProcessor );
+ }
+ else if( mQueueProcessor.getParameterWObject() == wfProcessorObject )
+ {
+ return( & mQueueProcessor );
+ }
+ else if( mRedundancyProcessor.getParameterWObject() == wfProcessorObject )
+ {
+ return( & mRedundancyProcessor );
+ }
+ else
+ {
+ return( mControllerUnits.getControllerUnit( wfProcessorObject ) );
+ }
+ }
+
+ inline AbstractProcessorUnit * getControllerUnit(
+ const std::string & aFullyQualifiedNameID)
+ {
+ if( mMainProcessor.getParameterWObject()
+ ->fqnEquals( aFullyQualifiedNameID ) )
+ {
+ return( & mMainProcessor );
+ }
+ else if( mQueueProcessor.getParameterWObject()
+ ->fqnEquals( aFullyQualifiedNameID ) )
+ {
+ return( & mQueueProcessor );
+ }
+ else if( mRedundancyProcessor.getParameterWObject()
+ ->fqnEquals( aFullyQualifiedNameID ) )
+ {
+ return( & mRedundancyProcessor );
+ }
+ else
+ {
+ return( mControllerUnits.getControllerUnit( aFullyQualifiedNameID ) );
+ }
+ }
+
+
+ /**
+ * GETTER
+ * mPreprocessor
+ * mPreprocessorControllerUnits
+ */
+ inline CompositeControllerUnit & getPreprocessor()
+ {
+ return( mPreprocessorControllerUnits );
+ }
+
+ inline void addPreprocessor(AbstractProcessorUnit * aFAM)
+ {
+ mPreprocessorControllerUnits.addControllerUnit( aFAM );
+ }
+
+ inline void appendPreprocessor(AbstractProcessorUnit * aFAM)
+ {
+ mPreprocessorControllerUnits.appendControllerUnit( aFAM );
+ }
+
+ inline bool registerPreprocessor(AbstractProcessorUnit * aFAM)
+ {
+ return( mPreprocessorControllerUnits.registerPreprocessor( aFAM ) );
+ }
+
+
+ /**
+ * GETTER
+ * mPostprocessor
+ * mPostprocessorControllerUnits
+ */
+ inline CompositeControllerUnit & getPostprocessor()
+ {
+ return( mPostprocessorControllerUnits );
+ }
+
+ inline void addPostprocessor(AbstractProcessorUnit * aFAM)
+ {
+ mPostprocessorControllerUnits.addControllerUnit( aFAM );
+ }
+
+ inline void appendPostprocessor(AbstractProcessorUnit * aFAM)
+ {
+ mPostprocessorControllerUnits.appendControllerUnit( aFAM );
+ }
+
+ inline bool registerPostprocessor(AbstractProcessorUnit * aFAM)
+ {
+ return( mPostprocessorControllerUnits.registerPostprocessor( aFAM ) );
+ }
+
+
+ /**
+ * GETTER
+ * mPrefilter
+ * mPrefilterControllerUnits
+ */
+ inline CompositeControllerUnit & getPrefilter()
+ {
+ return( mPrefilterControllerUnits );
+ }
+
+ inline void addPrefilter(AbstractProcessorUnit * aFAM)
+ {
+ mPrefilterControllerUnits.addControllerUnit( aFAM );
+ }
+
+ inline void appendPrefilter(AbstractProcessorUnit * aFAM)
+ {
+ mPrefilterControllerUnits.appendControllerUnit( aFAM );
+ }
+
+ inline bool registerPrefilter(AbstractProcessorUnit * aFAM)
+ {
+ return( mPrefilterControllerUnits.registerPrefilter( aFAM ) );
+ }
+
+
+ /**
+ * GETTER
+ * mPostfilter
+ * mPostfilterControllerUnits
+ */
+ inline CompositeControllerUnit & getPostfilter()
+ {
+ return( mPostfilterControllerUnits );
+ }
+
+ inline void addPostfilter(AbstractProcessorUnit * aFAM)
+ {
+ mPostfilterControllerUnits.addControllerUnit( aFAM );
+ }
+
+ inline void appendPostfilter(AbstractProcessorUnit * aFAM)
+ {
+ mPostfilterControllerUnits.appendControllerUnit( aFAM );
+ }
+
+ inline bool registerPostfilter(AbstractProcessorUnit * aFAM)
+ {
+ return( mPostfilterControllerUnits.registerPostfilter( aFAM ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool preConfigure();
+
+ virtual bool configure();
+
+ virtual bool configureImpl()
+ {
+ return( true );
+ }
+
+ inline bool configureControllerUnits()
+ {
+ return( mControllerUnits.configureControllerUnits() );
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // INIT / EXIT API
+ ////////////////////////////////////////////////////////////////////////////
+ virtual bool initImpl();
+
+ virtual bool exitImpl();
+
+ ////////////////////////////////////////////////////////////////////////////
+ // ( PRE / POST ) PROCESS API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool preprocess();
+
+ virtual bool postprocess();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // FILTERING API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool filteringInitialize();
+
+ virtual bool filteringFinalize();
+
+ ////////////////////////////////////////////////////////////////////////////
+ // ( PRE / POST ) FILTER API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool prefilter();
+
+ bool finalizePrefiltering();
+
+
+ virtual bool postfilter();
+
+ bool finalizePostfiltering();
+
+
+ /**
+ * Has Work
+ */
+ inline bool hasWork() const
+ {
+ return( mQueueProcessor.hasWork() );
+ }
+
+ inline bool hasReadyWork() const
+ {
+ return( mQueueProcessor.hasReadyWork() );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // PROCESSOR REQUEST API
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * REQUEST_STOP_STATUS
+ */
+ inline virtual void handleRequestStop()
+ {
+ mQueueProcessor.handleRequestStop();
+ }
+
+ /**
+ * REQUEST_RELEASE_STATUS
+ */
+ inline virtual void handleRequestRelease()
+ {
+ mQueueProcessor.handleRequestRelease();
+ }
+
+ inline void handleRequestRelease(AbstractProcessorUnit * aRequestor)
+ {
+ mPrefilterControllerUnits.handleRequestRelease(aRequestor);
+
+ mPostfilterControllerUnits.handleRequestRelease(aRequestor);
+
+ aRequestor->handleRequestRelease();
+ }
+
+ /**
+ * REQUEST_RESET_STATUS
+ */
+ inline virtual void handleRequestReset()
+ {
+ mQueueProcessor.handleRequestReset();
+ }
+
+ /**
+ * REQUEST_RESTART_STATUS
+ */
+ inline virtual void handleRequestRestart()
+ {
+ mQueueProcessor.handleRequestRestart();
+ }
+
+ /**
+ * REQUEST_CONTINUE_STATUS
+ */
+ inline virtual void handleRequestContinue()
+ {
+ mQueueProcessor.handleRequestContinue();
+ }
+
+ /**
+ * REQUEST_REQUEUE_WAITING_STATUS
+ */
+ inline virtual void handleRequestRequeueWaiting(
+ AbstractProcessorUnit * aRequestor)
+ {
+ mQueueProcessor.handleRequestRequeueWaiting( aRequestor );
+ }
+
+ /**
+ * REQUEST_REQUEUE_RESERVE_STATUS
+ */
+ inline virtual void handleRequestRequeueReserve(
+ AbstractProcessorUnit * aRequestor)
+ {
+ mQueueProcessor.handleRequestRequeueReserve( aRequestor );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // REPORT API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual void report(OutStream & os) const;
+
+
+ /**
+ * EVAL TRACE
+ */
+ virtual void traceBoundEval(OutStream & os) const;
+
+ virtual void tracePreEval(OutStream & os,
+ const ExecutionContext & anEC) const;
+
+ virtual void tracePostEval(OutStream & os,
+ const ExecutionContext & anEC) const;
+
+ virtual void reportEval(OutStream & os) const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // UNIT TEST API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual void tddUnitReport(OutStream & os) const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // NON-REGRESSION TEST API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual void tddRegressionReport(OutStream & os) const;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SERIALIZATION API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual void toStream(OutStream & os) const;
+
+};
+
+
+} /* namespace sep */
+
+#endif /* SEW_SYMBEX_CONTROLLER_UNIT_MANAGER_H_ */
diff --git a/org.eclipse.efm.symbex/src/sew/SymbexDispatcher.cpp b/org.eclipse.efm.symbex/src/sew/SymbexDispatcher.cpp
new file mode 100644
index 0000000..6990538
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/sew/SymbexDispatcher.cpp
@@ -0,0 +1,144 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "SymbexDispatcher.h"
+
+#include <fml/runtime/ExecutionContext.h>
+
+#include <fml/workflow/WObject.h>
+
+#include <sew/SymbexEngine.h>
+
+
+namespace sep
+{
+
+
+/**
+ * GETTER
+ * AvmPrimitiveProcessor
+ */
+AvmPrimitiveProcessor & SymbexDispatcher::getPrimitiveProcessor() const
+{
+ return( mSymbexEngine.getPrimitiveProcessor() );
+}
+
+
+/**
+ * CONFIGURE
+ */
+bool SymbexDispatcher::configure()
+{
+ if( not mSymbexProcessor.configure() )
+ {
+ AVM_OS_ERROR_ALERT << "SymbexDispatcher::SymbexProcessor: configure failed !!!"
+ << SEND_ALERT;
+
+ return( false );
+ }
+
+ if( not mSymbexController.configure() )
+ {
+ AVM_OS_ERROR_ALERT << "SymbexDispatcher::SymbexController: configure failed !!!"
+ << SEND_ALERT;
+
+ return( false );
+ }
+
+ // Registration to handler DestroyCtx event
+ mSymbexEventManager.registerHandlerEventDestroyCtx(this);
+
+ return( true );
+}
+
+
+/**
+ * INIT
+ */
+bool SymbexDispatcher::initImpl()
+{
+ bool isEC_OK = mSymbexProcessor.init();
+
+ bool isAC_OK = mSymbexController.init();
+
+ return( isEC_OK && isAC_OK );
+}
+
+/**
+ * EXIT
+ */
+bool SymbexDispatcher::exitImpl()
+{
+ bool isEC_OK = mSymbexProcessor.exit();
+
+ bool isAC_OK = mSymbexController.exit();
+
+ return( isEC_OK && isAC_OK );
+}
+
+
+/**
+ * PRE PROCESS
+ */
+bool SymbexDispatcher::preprocess()
+{
+ bool isEC_OK = mSymbexProcessor.preprocess();
+
+ bool isAC_OK = mSymbexController.preprocess();
+
+ return( isEC_OK && isAC_OK );
+}
+
+
+/**
+ * POST PROCESS
+ */
+bool SymbexDispatcher::postprocess()
+{
+ bool isEC_OK = mSymbexProcessor.postprocess();
+
+ bool isAC_OK = mSymbexController.postprocess();
+
+ return( isEC_OK && isAC_OK );
+}
+
+
+/**
+ * start
+ */
+void SymbexDispatcher::start()
+{
+ mSymbexProcessor.setLifecycleStarted();
+ mSymbexController.setLifecycleStarted();
+
+ mSymbexController.analyseReady();
+
+ mSymbexProcessor.initStep();
+
+ mSymbexController.analyseResult();
+
+ while( mSymbexController.isLifecycleRunnable() )
+ {
+ mSymbexController.analyseReady();
+
+ mSymbexProcessor.runStep();
+
+ mSymbexController.analyseResult();
+ }
+
+ // Last step-eval trace
+ reportEval();
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/sew/SymbexDispatcher.h b/org.eclipse.efm.symbex/src/sew/SymbexDispatcher.h
new file mode 100644
index 0000000..ffe9756
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/sew/SymbexDispatcher.h
@@ -0,0 +1,290 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef SEW_SYMBEX_DISPATCHER_H_
+#define SEW_SYMBEX_DISPATCHER_H_
+
+#include <common/AvmPointer.h>
+#include <common/RunnableElement.h>
+
+#include <sew/SymbexController.h>
+#include <sew/SymbexEventManager.h>
+#include <sew/SymbexProcessor.h>
+#include <sew/SymbexControllerRequestManager.h>
+
+
+
+
+namespace sep
+{
+
+
+class AvmPrimitiveProcessor;
+
+class ExecutionContext;
+
+class SymbexControllerUnitManager;
+class SymbexEngine;
+
+
+class SymbexDispatcher :
+ public RunnableElement,
+ public IHandlerEventDestroyCtx
+{
+
+ AVM_DECLARE_UNCLONABLE_CLASS(SymbexDispatcher)
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ SymbexEngine & mSymbexEngine;
+
+ SymbexControllerUnitManager & mControllerUnitManager;
+
+ SymbexEventManager mSymbexEventManager;
+
+ SymbexControllerRequestManager mSymbexControllerRequestManager;
+
+ SymbexProcessor mSymbexProcessor;
+
+ SymbexController mSymbexController;
+
+ avm_uint32_t mNextEvalNumber;
+
+ avm_uint32_t mGlobalGraphWidth;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ SymbexDispatcher(SymbexEngine & anEngine, WObject * wfParameterObject,
+ SymbexControllerUnitManager & aControllerUnitManager)
+ : RunnableElement( wfParameterObject ),
+ mSymbexEngine( anEngine ),
+ mControllerUnitManager( aControllerUnitManager ),
+
+ mSymbexEventManager( ),
+
+ mSymbexControllerRequestManager( (*this) ,
+ wfParameterObject , aControllerUnitManager ),
+
+ mSymbexProcessor( (*this) ,
+ wfParameterObject , aControllerUnitManager ),
+
+ mSymbexController ( (*this) ,
+ wfParameterObject , aControllerUnitManager ),
+
+ mNextEvalNumber( 0 ),
+ mGlobalGraphWidth( 1 )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~SymbexDispatcher()
+ {
+ // Unregistration
+ mSymbexEventManager.unregisterHandlerEventDestroyCtx(this);
+ }
+
+
+ /**
+ * CONFIGURE
+ */
+ bool configure();
+
+
+ /**
+ * REPORT TRACE
+ */
+ inline virtual void report(OutStream & os) const
+ {
+ mSymbexProcessor.report(os);
+
+ mSymbexController.report(os);
+ }
+
+
+ /**
+ * INIT - EXIT
+ */
+ virtual bool initImpl();
+
+ virtual bool exitImpl();
+
+
+ /**
+ * PRE - POST PROCESS
+ */
+ bool preprocess();
+
+ bool postprocess();
+
+ /**
+ * start
+ */
+ void start();
+
+ /**
+ * Has Work
+ */
+ inline bool hasWork() const
+ {
+ return( mSymbexControllerRequestManager.hasRequestEnabled()
+ || mControllerUnitManager.hasWork() );
+ }
+
+ inline bool hasReadyWork() const
+ {
+ return( mSymbexControllerRequestManager.hasntRequestStop()
+ && mControllerUnitManager.hasReadyWork() );
+ }
+
+
+ /**
+ * Send an ExecutionContext to
+ * Execution or Analyser working Queue
+ */
+ inline void sendToExecutionWorkingQueue(ExecutionContext * anEC)
+ {
+ mSymbexProcessor.appendSymbexContext( anEC );
+ }
+
+ inline void sendToAnalyserWorkingQueue(ExecutionContext * anEC)
+ {
+ mSymbexController.appendSymbexContext( anEC );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mSymbexEngine
+ */
+ inline SymbexEngine & getSymbexEngine() const
+ {
+ return( mSymbexEngine );
+ }
+
+ /**
+ * GETTER
+ * AvmPrimitiveProcessor
+ */
+ AvmPrimitiveProcessor & getPrimitiveProcessor() const;
+
+
+ /**
+ * GETTER - SETTER
+ * mSymbexEventManager
+ */
+ inline SymbexEventManager & getSymbexEventManager()
+ {
+ return( mSymbexEventManager );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mSymbexControllerRequestManager
+ */
+ inline SymbexControllerRequestManager & getSymbexControllerRequestManager()
+ {
+ return( mSymbexControllerRequestManager );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mSymbexProcessor
+ */
+ inline SymbexProcessor & getSymbexProcessor()
+ {
+ return( mSymbexProcessor );
+ }
+
+ inline ListOfExecutionContext & getExecutionWorkingQueue()
+ {
+ return( mSymbexProcessor.getSymbexContexts() );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mSymbexController
+ */
+ inline SymbexController & getSymbexController()
+ {
+ return( mSymbexController );
+ }
+
+ /**
+ * HANDLER for Event Notification
+ * Destroy Execution Context
+ */
+ inline virtual void handleEventDestroyCtx(ExecutionContext * anEC)
+ {
+ mSymbexController.removeSymbexContext(anEC);
+
+ mSymbexProcessor.removeSymbexContext(anEC);
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mNextEvalNumber
+ */
+ inline avm_uint32_t getEvalNumber() const
+ {
+ return( mNextEvalNumber );
+ }
+
+ inline avm_uint32_t nextEvalNumber()
+ {
+ return( ++mNextEvalNumber );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mGlobalGraphWidth
+ */
+ inline avm_uint32_t getGlobalGraphWidth() const
+ {
+ return( mGlobalGraphWidth );
+ }
+
+ inline avm_uint32_t nextGlobalGraphWidth()
+ {
+ return( ++mGlobalGraphWidth );
+ }
+
+
+protected:
+ /**
+ * report Eval
+ */
+ inline void reportEval() const
+ {
+ mSymbexController.reportEval();
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /*SEW_SYMBEX_DISPATCHER_H_*/
diff --git a/org.eclipse.efm.symbex/src/sew/SymbexEngine.cpp b/org.eclipse.efm.symbex/src/sew/SymbexEngine.cpp
new file mode 100644
index 0000000..7165900
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/sew/SymbexEngine.cpp
@@ -0,0 +1,709 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 9 mars 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "SymbexEngine.h"
+
+#include <builder/Builder.h>
+#include <parser/ParserManager.h>
+
+#include <fml/executable/ExecutableSystem.h>
+
+#include <fml/runtime/ExecutionContext.h>
+
+#include <sew/SymbexDispatcher.h>
+#include <sew/Workflow.h>
+
+#include <util/ExecutionTime.h>
+
+
+namespace sep
+{
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+SymbexEngine::SymbexEngine(Workflow & aWorkflow,
+ WObject * wfParameterObject, avm_offset_t anOffset)
+: RunnableElement( wfParameterObject ),
+mWorkflow( aWorkflow ),
+
+mConfiguration( *this , mWorkflow ),
+mPrimitiveProcessor( *this , mConfiguration ),
+
+mBuilder( *this , mConfiguration , mPrimitiveProcessor ),
+mLoader( mConfiguration, mBuilder , mPrimitiveProcessor ),
+
+mControllerUnitManager( *this , wfParameterObject ),
+mSymbexDispatcher( *this , wfParameterObject , mControllerUnitManager),
+mExecutionTimeManager( false ),
+
+mOffset( anOffset ),
+
+mPreviousEngine( NULL ),
+mNextEngine( NULL )
+{
+ //!! NOTHING
+}
+
+
+/**
+ * CONFIGURE
+ */
+bool SymbexEngine::configure()
+{
+ OS_VERBOSITY_MINIMUM_OR_DEBUG( AVM_OS_COUT ) << _SEW_
+ << "Configure Engine director: " << strUniqId() << " ... START"
+ << std::endl;
+
+ AVM_OS_LOG << _SEW_
+ << "Configure Engine director: " << strUniqId()
+ << std::endl;
+
+ if( not mConfiguration.configure(getParameterWObject(),
+ ((mPreviousEngine != NULL) ? &(mPreviousEngine->mConfiguration) : NULL)) )
+ {
+ avm_set_exit_code( AVM_EXIT_CONFIGURE_ERROR_CODE );
+
+AVM_IF_DEBUG_FLAG( CONFIGURING )
+ mConfiguration.toStream( AVM_OS_LOG );
+AVM_ENDIF_DEBUG_FLAG( CONFIGURING )
+
+ return( false );
+ }
+
+AVM_IF_DEBUG_FLAG( CONFIGURING )
+ mConfiguration.toStream( AVM_OS_LOG );
+AVM_ENDIF_DEBUG_FLAG( CONFIGURING )
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// PRIMITIVE PROCESSOR
+ ////////////////////////////////////////////////////////////////////////////
+
+ if( not mPrimitiveProcessor.configure() )
+ {
+ AVM_OS_ERROR_ALERT << "SymbexEngine::configure:> "
+ "the PrimitiveProcessor configuration failed !!!"
+ << SEND_ALERT;
+
+ avm_set_exit_code( AVM_EXIT_CONFIGURE_ERROR_CODE );
+
+ return( false );
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// BUILDER PROCESSOR
+ ////////////////////////////////////////////////////////////////////////////
+
+ if( not mBuilder.configure() )
+ {
+ AVM_OS_ERROR_ALERT << "SymbexEngine::configure:> "
+ "the Builder configuration failed !!!"
+ << SEND_ALERT;
+
+ avm_set_exit_code( AVM_EXIT_CONFIGURE_ERROR_CODE );
+
+ return( false );
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// LOADER PROCESSOR
+ ////////////////////////////////////////////////////////////////////////////
+
+ if( not mLoader.configure() )
+ {
+ AVM_OS_ERROR_ALERT << "SymbexEngine::configure:> "
+ "the Loader configuration failed !!!"
+ << SEND_ALERT;
+
+ avm_set_exit_code( AVM_EXIT_CONFIGURE_ERROR_CODE );
+
+ return( false );
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// PARSING
+ ////////////////////////////////////////////////////////////////////////////
+
+ if( mConfiguration.hasOwnedSpecification() )
+ {
+ if( not startParsing() )
+ {
+AVM_IF_DEBUG_ENABLED_OR( mConfiguration.isDebugStageEnabled() )
+ if( mConfiguration.hasSpecification() )
+ {
+ mConfiguration.saveSpecification( true , "parsing_failed" );
+ }
+AVM_ENDIF_DEBUG_ENABLED_OR
+
+ avm_set_exit_code( AVM_EXIT_PARSING_ERROR_CODE );
+
+ return( false );
+ }
+
+AVM_IF_DEBUG_ENABLED_OR( mConfiguration.isDebugParsingStageEnabled() )
+ mConfiguration.saveSpecification( true , "parsed" );
+AVM_ENDIF_DEBUG_ENABLED_OR
+
+ ////////////////////////////////////////////////////////////////////////
+ ///// BUILDING : COMPILING ; LOADING
+ ////////////////////////////////////////////////////////////////////////
+
+ if( not startBuilding() )
+ {
+ mConfiguration.saveSpecification(true, "building");
+
+ mConfiguration.serializeDebugExecutable( "building" );
+
+ avm_set_exit_code( AVM_EXIT_COMPILING_ERROR_CODE );
+
+ return( false );
+ }
+
+AVM_IF_DEBUG_FLAG_AND( COMPILING , mConfiguration.isDebugCompilingStageEnabled() )
+ mConfiguration.serializeDebugExecutable( "built" );
+
+ mConfiguration.saveSpecification( true , "built" );
+AVM_ENDIF_DEBUG_FLAG_AND( COMPILING )
+ }
+
+ // Mandatory for expression compiling in any PluginProcessor
+ else if( mPreviousEngine != NULL )
+ {
+ mBuilder.getAvmcodeCompiler().getSymbolTable().setSymbolTable(
+ mPreviousEngine->getBuilder().getAvmcodeCompiler().getSymbolTable() );
+
+ mConfiguration.set( mPreviousEngine->mConfiguration );
+ }
+ else
+ {
+ AVM_OS_ERROR_ALERT << "SymbexEngine:> "
+ "No Specification in the first Engine Core !!!"
+ << SEND_ALERT;
+
+ avm_set_exit_code( AVM_EXIT_CONFIGURE_ERROR_CODE );
+
+ return( false );
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// CONTROLLER UNIT CONFIGURATION
+ ////////////////////////////////////////////////////////////////////////////
+
+ if( not mControllerUnitManager.configure() )
+ {
+ AVM_OS_ERROR_ALERT << "SymbexEngine:> "
+ "Failed to configure the Controller Unit Manager !!!"
+ << SEND_ALERT;
+
+ avm_set_exit_code( AVM_EXIT_CONFIGURE_ERROR_CODE );
+
+ return( false );
+ }
+
+ if( not mSymbexDispatcher.configure() )
+ {
+ AVM_OS_ERROR_ALERT << "SymbexEngine:> "
+ "Failed to configure the Dispatcher !!!"
+ << SEND_ALERT;
+
+ avm_set_exit_code( AVM_EXIT_CONFIGURE_ERROR_CODE );
+
+ return( false );
+ }
+
+ OS_VERBOSITY_MINIMUM_OR_DEBUG( AVM_OS_COUT ) << _SEW_
+ << "Configure Engine director: " << strUniqId() << "... DONE"
+ << std::endl;
+
+ return( true );
+}
+
+
+/**
+ * INIT * PRE-PROCESS
+ */
+bool SymbexEngine::initImpl()
+{
+ if( not mControllerUnitManager.init() )
+ {
+ AVM_OS_ERROR_ALERT << "SymbexEngine:> "
+ "the Plugin Processor Manager initialisation failed !!!"
+ << SEND_ALERT;
+
+ return( false );
+ }
+
+
+ if( not mSymbexDispatcher.init() )
+ {
+ AVM_OS_ERROR_ALERT << "SymbexEngine:> the Engine initialisation failed !!!"
+ << SEND_ALERT;
+
+ return( false );
+ }
+
+ return( true );
+}
+
+
+bool SymbexEngine::preprocess()
+{
+ bool isPreProcessor_OK = mControllerUnitManager.preprocess();
+
+ while( mConfiguration.hasInputContext() )
+ {
+ if( mConfiguration.getInputContext().last()->isRoot() )
+ {
+ mConfiguration.appendTrace(
+ mConfiguration.getInputContext().last() );
+ }
+
+ mControllerUnitManager.getExecutionQueue().appendInit(
+ mConfiguration.getInputContext().pop_last() );
+ }
+
+ if( mConfiguration.noTrace() && (mPreviousEngine != NULL) )
+ {
+ mConfiguration.appendTrace(
+ mPreviousEngine->mConfiguration.getTrace() );
+ }
+
+ bool isSymbexDispatcher_OK = mSymbexDispatcher.preprocess();
+
+ bool isfilteringInitialize_OK = mControllerUnitManager.filteringInitialize();
+
+ if( isPreProcessor_OK && isSymbexDispatcher_OK && isfilteringInitialize_OK )
+ {
+ mControllerUnitManager.getExecutionQueue().pushInit2Waiting();
+
+ return true;
+ }
+
+ return false;
+}
+
+
+/**
+ * START
+ */
+bool SymbexEngine::start()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ ///// COMPUTING
+ ////////////////////////////////////////////////////////////////////////////
+
+ avm_report(AVM_OS_LOG, "SymbexEngine::startComputing");
+
+ mExecutionTimeManager.start_time();
+
+ mSymbexDispatcher.start();
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// EXECUTION TIME REPORT
+ ////////////////////////////////////////////////////////////////////////////
+
+ mExecutionTimeManager.finish_time();
+
+ AVM_OS_LOG << std::endl << mExecutionTimeManager.time_stat() << std::endl;
+ AVM_OS_COUT << std::endl << mExecutionTimeManager.time_stat() << std::endl;
+
+ return( true );
+}
+
+
+/**
+ * POST-PROCESS
+ */
+bool SymbexEngine::postprocess()
+{
+ bool isfilteringFinalize_OK = mControllerUnitManager.filteringFinalize();
+
+ bool isEngine_OK = mSymbexDispatcher.postprocess();
+
+ bool isPostProcessor_OK = mControllerUnitManager.postprocess();
+
+ return( isfilteringFinalize_OK && isEngine_OK && isPostProcessor_OK );
+}
+
+
+/**
+ * EXIT
+ */
+bool SymbexEngine::exitImpl()
+{
+ if( not mControllerUnitManager.exit() )
+ {
+ AVM_OS_ERROR_ALERT << "SymbexEngine:> "
+ "the Plugin Processor Manager exit failed !!!"
+ << SEND_ALERT;
+
+ return( false );
+ }
+
+ if( not mSymbexDispatcher.exit() )
+ {
+ AVM_OS_ERROR_ALERT << "SymbexEngine:> the Engine exit failed !!!"
+ << SEND_ALERT;
+
+ return( false );
+ }
+
+ return( true );
+}
+
+
+/**
+ * REPORT TRACE
+ */
+void SymbexEngine::preReport(OutStream & os) const
+{
+ //!! NOTHING
+}
+
+void SymbexEngine::dynReport(OutStream & os) const
+{
+ //!! NOTHING
+}
+
+void SymbexEngine::postReport(OutStream & os) const
+{
+ mSymbexDispatcher.report(AVM_OS_LOG);
+ mSymbexDispatcher.report(AVM_OS_COUT);
+
+ mControllerUnitManager.report(AVM_OS_LOG);
+ mControllerUnitManager.report(AVM_OS_COUT);
+}
+
+
+void SymbexEngine::report(OutStream & os) const
+{
+ preReport(os);
+
+ dynReport(os);
+
+ postReport(os);
+}
+
+
+/**
+ * PARSING
+ *
+ */
+bool SymbexEngine::startParsing()
+{
+ AVM_OS_LOG << std::endl << _SEW_ << "< start > Parsing ..." << std::endl;
+
+ ParserManager aParser( mConfiguration.getSpecificationFileLocation() );
+
+ mConfiguration.setSpecification( aParser.parseFML(
+ mConfiguration.getWObjectManager() ) );
+
+ bool isOK = mConfiguration.hasSpecification() && aParser.hasNoSyntaxError();
+
+ AVM_OS_LOG << _SEW_
+ << "< end > Parsing ... " << ( isOK ? "done." : "failed." )
+ << std::endl;
+
+ return( isOK );
+}
+
+
+/**
+ * BUILDING
+ *
+ */
+bool SymbexEngine::startBuilding()
+{
+ AVM_OS_LOG << std::endl << _SEW_ << "< start > Building ..." << std::endl;
+
+ bool isOK = mBuilder.start();
+
+ serializeBuildingResult();
+
+ AVM_OS_LOG << _SEW_
+ << "< end > Building ... " << ( isOK ? "done." : "failed." )
+ << std::endl;
+
+ return( isOK );
+}
+
+
+/**
+ * COMPUTING
+ */
+bool SymbexEngine::startComputing()
+{
+ AVM_OS_LOG << std::endl << _SBX_ << "< start > Computing ..." << std::endl;
+ try
+ {
+ ////////////////////////////////////////////////////////////////////////
+ ///// INITIALIZATION
+ ////////////////////////////////////////////////////////////////////////
+
+ if( not init() )
+ {
+ avm_set_exit_code( AVM_EXIT_INITIALIZING_ERROR_CODE );
+
+ return( false );
+ }
+
+ ////////////////////////////////////////////////////////////////////////
+ ///// PRE PROCESSING
+ ////////////////////////////////////////////////////////////////////////
+
+ if( not preprocess() )
+ {
+ avm_set_exit_code( AVM_EXIT_PRE_PROCESSING_ERROR_CODE );
+
+ return( false );
+ }
+
+ ////////////////////////////////////////////////////////////////////////
+ ///// REPORTING
+ ////////////////////////////////////////////////////////////////////////
+
+ AVM_OS_LOG << std::endl;
+
+ preReport(AVM_OS_LOG);
+
+ AVM_OS_LOG << std::endl;
+
+ ////////////////////////////////////////////////////////////////////////
+ ///// START
+ ////////////////////////////////////////////////////////////////////////
+
+ if( not start() )
+ {
+ avm_set_exit_code( AVM_EXIT_PROCESSING_ERROR_CODE );
+
+ return( false );
+ }
+
+ ////////////////////////////////////////////////////////////////////////
+ ///// REPORTING
+ ////////////////////////////////////////////////////////////////////////
+
+ AVM_OS_LOG << std::endl;
+
+ dynReport(AVM_OS_LOG);
+
+ AVM_OS_LOG << std::endl;
+
+ ////////////////////////////////////////////////////////////////////////
+ ///// POST PROCESSING
+ ////////////////////////////////////////////////////////////////////////
+
+ if( not postprocess() )
+ {
+ serializeComputingResult();
+
+ avm_set_exit_code( AVM_EXIT_POST_PROCESSING_ERROR_CODE );
+
+ return( false );
+ }
+
+ ////////////////////////////////////////////////////////////////////////
+ ///// REPORTING
+ ////////////////////////////////////////////////////////////////////////
+
+ AVM_OS_LOG << std::endl;
+
+ postReport(AVM_OS_LOG);
+
+ AVM_OS_LOG << std::endl;
+
+
+ ////////////////////////////////////////////////////////////////////////
+ ///// EXITING
+ ////////////////////////////////////////////////////////////////////////
+
+ if( not exit() )
+ {
+ serializeComputingResult();
+
+ avm_set_exit_code( AVM_EXIT_FINALIZING_ERROR_CODE );
+
+ return( false );
+ }
+
+ ////////////////////////////////////////////////////////////////////////
+ ///// REPORTING
+ ////////////////////////////////////////////////////////////////////////
+
+// AVM_OS_LOG << std::endl;
+//
+// report(AVM_OS_LOG);
+//
+// AVM_OS_LOG << std::endl;
+
+
+ ////////////////////////////////////////////////////////////////////////
+ ///// TEST DRIVEN DEVELOPMENT
+ ////////////////////////////////////////////////////////////////////////
+
+ tddStart();
+
+ ////////////////////////////////////////////////////////////////////////
+ ///// SERIALIZATION
+ ////////////////////////////////////////////////////////////////////////
+
+ serializeComputingResult();
+ }
+ catch ( const std::exception & e )
+ {
+ AVM_OS_WARN << std::endl << EMPHASIS(
+ "SymbexEngine::startComputing< std::exception >",
+ e.what(), '*', 80);
+
+ AVM_OS_WARN << EMPHASIS("Save Point ...", '*', 80);
+
+ ////////////////////////////////////////////////////////////////////////
+ ///// FAILED REPORTING
+ ////////////////////////////////////////////////////////////////////////
+
+ failedReport();
+ }
+ catch ( ... )
+ {
+ AVM_OS_WARN << std::endl << EMPHASIS(
+ "SymbexEngine::startComputing< unknown::exception > !!!",
+ '*', 80);
+
+ AVM_OS_WARN << EMPHASIS("Save Point ...", '*', 80);
+
+ ////////////////////////////////////////////////////////////////////////
+ ///// FAILED REPORTING
+ ////////////////////////////////////////////////////////////////////////
+
+ failedReport();
+ }
+
+ AVM_OS_LOG << std::endl << _SBX_ << "< end > Computing ... done." << std::endl;
+
+ return( true );
+}
+
+
+/**
+ * Serialization
+ */
+void SymbexEngine::serializeBuildingResult()
+{
+ mConfiguration.serializeBuildingResult();
+}
+
+void SymbexEngine::serializeComputingResult()
+{
+ mConfiguration.serializeComputingResult();
+}
+
+
+
+void SymbexEngine::failedReport()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ ///// EXECUTION TIME REPORT
+ ////////////////////////////////////////////////////////////////////////////
+
+ mExecutionTimeManager.finish_time();
+
+ AVM_OS_LOG << std::endl << mExecutionTimeManager.time_stat() << std::endl;
+ AVM_OS_COUT << std::endl << mExecutionTimeManager.time_stat() << std::endl;
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// REPORTING
+ ////////////////////////////////////////////////////////////////////////////
+
+ AVM_OS_LOG << std::endl;
+
+ report(AVM_OS_LOG);
+
+ AVM_OS_LOG << std::endl;
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// SERIALIZATION
+ ////////////////////////////////////////////////////////////////////////////
+
+ serializeComputingResult();
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// TEST DRIVEN DEVELOPMENT
+////////////////////////////////////////////////////////////////////////////////
+
+// TEST DRIVEN DEVELOPMENT
+//section TDD
+// @report = "avm.tdd";
+//
+// @regression = true;
+// @unit = true;
+//endsection TDD
+
+void SymbexEngine::tddStart()
+{
+ AVM_OS_TDD << "@tdd< version , 1.0 >: // "
+ << ExecutionTime::current_time() << std::endl;
+
+ AVM_OS_TDD << "engine " << getParameterWObject()->getFullyQualifiedNameID() << std::endl;
+
+ AVM_OS_TDD << INCR_INDENT;
+
+ AVM_OS_TDD << "time#stat = " << mExecutionTimeManager.time_stat()
+ << std::endl;
+
+ if( mWorkflow.isTddUnitTesting() )
+ {
+ tddUnitReport(AVM_OS_TDD);
+ }
+
+ if( mWorkflow.isTddRegressionTesting() )
+ {
+ tddRegressionReport(AVM_OS_TDD);
+ }
+
+ AVM_OS_TDD << DECR_INDENT;
+ AVM_OS_TDD << "// end engine "
+ << getParameterWObject()->getFullyQualifiedNameID()
+ << std::endl << std::endl;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// UNIT TEST API
+////////////////////////////////////////////////////////////////////////////////
+
+void SymbexEngine::tddUnitReport(OutStream & os) const
+{
+ AVM_OS_TDD << "@tdd< unit , 1.0 >:" << std::endl;
+
+ mControllerUnitManager.tddUnitReport(os);
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// NON-REGRESSION TEST API
+////////////////////////////////////////////////////////////////////////////////
+
+void SymbexEngine::tddRegressionReport(OutStream & os) const
+{
+ AVM_OS_TDD << "@tdd< regression , 1.0 >:" << std::endl;
+
+ mControllerUnitManager.tddRegressionReport(os);
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/sew/SymbexEngine.h b/org.eclipse.efm.symbex/src/sew/SymbexEngine.h
new file mode 100644
index 0000000..af16599
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/sew/SymbexEngine.h
@@ -0,0 +1,276 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 9 mars 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef SEW_SYMBEX_ENGINE_H_
+#define SEW_SYMBEX_ENGINE_H_
+
+#include <common/RunnableElement.h>
+
+#include <builder/Builder.h>
+#include <builder/Loader.h>
+
+#include <computer/primitive/AvmPrimitiveProcessor.h>
+
+#include <sew/SymbexDispatcher.h>
+
+
+#include <sew/Configuration.h>
+#include <sew/SymbexControllerUnitManager.h>
+
+#include <util/ExecutionTime.h>
+
+
+
+namespace sep
+{
+
+class ExecutionTime;
+class WObject;
+
+class Workflow;
+
+
+class SymbexEngine : public RunnableElement
+{
+
+ AVM_DECLARE_UNCLONABLE_CLASS(SymbexEngine)
+
+
+protected :
+ /**
+ * ATTRIBUTES
+ */
+ Workflow & mWorkflow;
+
+ Configuration mConfiguration;
+
+ AvmPrimitiveProcessor mPrimitiveProcessor;
+
+ Builder mBuilder;
+ Loader mLoader;
+
+ SymbexControllerUnitManager mControllerUnitManager;
+
+ SymbexDispatcher mSymbexDispatcher;
+
+ ExecutionTime mExecutionTimeManager;
+
+ avm_offset_t mOffset;
+
+ SymbexEngine * mPreviousEngine;
+ SymbexEngine * mNextEngine;
+
+
+public :
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ SymbexEngine(Workflow & aWorkflow,
+ WObject * wfParameterObject, avm_offset_t anOffset);
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~SymbexEngine()
+ {
+ //!! NOTHING
+ }
+
+
+ /*
+ * GETTER
+ * mWorkflow
+ */
+ Workflow & getWorkflow()
+ {
+ return( mWorkflow );
+ }
+
+
+ /**
+ * CONFIGURE
+ */
+ bool configure();
+
+ /**
+ * REPORT TRACE
+ */
+ void preReport (OutStream & os) const;
+ void dynReport (OutStream & os) const;
+ void postReport(OutStream & os) const;
+
+ void report(OutStream & os) const;
+
+ void failedReport();
+
+
+ /**
+ * INIT * PRE-PROCESS
+ */
+ virtual bool initImpl();
+
+ bool preprocess();
+
+ /**
+ * START
+ */
+ bool start();
+
+ /**
+ * POST-PROCESS
+ * INIT
+ */
+ bool postprocess();
+
+ virtual bool exitImpl();
+
+
+ /*
+ * PROCESSING
+ */
+ bool startParsing();
+ bool startBuilding();
+ bool startComputing();
+
+ void serializeBuildingResult();
+
+ void serializeComputingResult();
+
+ /**
+ * GETTER
+ * mPrimitiveProcessor
+ */
+ inline AvmPrimitiveProcessor & getPrimitiveProcessor()
+ {
+ return( mPrimitiveProcessor );
+ }
+
+ /**
+ * GETTER
+ * mBuilder
+ */
+ inline Builder & getBuilder()
+ {
+ return( mBuilder );
+ }
+
+ /**
+ * GETTER
+ * mLoader
+ */
+ inline Loader & getLoader()
+ {
+ return( mLoader );
+ }
+
+ /**
+ * GETTER
+ * mControllerUnitManager
+ */
+ inline SymbexControllerUnitManager & getControllerUnitManager()
+ {
+ return( mControllerUnitManager );
+ }
+
+
+ /**
+ * GETTER
+ * mSymbexDispatcher
+ */
+ inline SymbexDispatcher & getSymbexDispatcher()
+ {
+ return( mSymbexDispatcher );
+ }
+
+ inline const SymbexDispatcher & getSymbexDispatcher() const
+ {
+ return( mSymbexDispatcher );
+ }
+
+
+ /**
+ * GETTER
+ * mOffset
+ */
+ inline avm_offset_t getOffset()
+ {
+ return( mOffset );
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mPreviousEngine
+ * mNextEngine
+ * SymbexEngine
+ */
+ inline SymbexEngine * getPreviousCore()
+ {
+ return( mPreviousEngine );
+ }
+
+ inline void setPreviousCore(SymbexEngine * aPreviousCore)
+ {
+ mPreviousEngine = aPreviousCore;
+ }
+
+
+ inline SymbexEngine * getNextCore()
+ {
+ return( mNextEngine );
+ }
+
+ inline void setNextCore(SymbexEngine * aNextCore)
+ {
+ mNextEngine = aNextCore;
+ }
+
+
+ /**
+ * GETTER
+ * mConfiguration
+ */
+ inline Configuration & getConfiguration()
+ {
+ return( mConfiguration );
+ }
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // TEST DRIVEN DEVELOPMENT
+ ////////////////////////////////////////////////////////////////////////////
+
+ void tddStart();
+
+ ////////////////////////////////////////////////////////////////////////////
+ // UNIT TEST API
+ ////////////////////////////////////////////////////////////////////////////
+
+ void tddUnitReport(OutStream & os) const;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // NON-REGRESSION TEST API
+ ////////////////////////////////////////////////////////////////////////////
+
+ void tddRegressionReport(OutStream & os) const;
+
+};
+
+
+} /* namespace sep */
+
+#endif /* SEW_SYMBEX_ENGINE_H_ */
diff --git a/org.eclipse.efm.symbex/src/sew/SymbexEventManager.cpp b/org.eclipse.efm.symbex/src/sew/SymbexEventManager.cpp
new file mode 100644
index 0000000..d09f116
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/sew/SymbexEventManager.cpp
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 16 mars 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "SymbexEventManager.h"
+
+
+namespace sep
+{
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/sew/SymbexEventManager.h b/org.eclipse.efm.symbex/src/sew/SymbexEventManager.h
new file mode 100644
index 0000000..f5be830
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/sew/SymbexEventManager.h
@@ -0,0 +1,133 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 16 mars 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef SEW_SYMBEX_EVENT_MANAGER_H_
+#define SEW_SYMBEX_EVENT_MANAGER_H_
+
+#include <collection/List.h>
+
+
+namespace sep
+{
+
+class ExecutionContext;
+
+
+class IHandlerEventDestroyCtx
+{
+
+public:
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~IHandlerEventDestroyCtx()
+ {
+ //!! NOTHING
+ }
+
+ virtual void handleEventDestroyCtx(ExecutionContext * anEC) = 0;
+
+};
+
+
+
+class SymbexEventManager
+{
+
+protected:
+ /**
+ * TYPEDEFS
+ */
+ typedef List< IHandlerEventDestroyCtx * > ListOfHandlerEventDestroyCtx;
+
+protected:
+ /**
+ * ATTRIBUTE
+ */
+ ListOfHandlerEventDestroyCtx mEventDestroyCtxListener;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing Variable
+ ListOfHandlerEventDestroyCtx::iterator itEventListener;
+ ListOfHandlerEventDestroyCtx::iterator endEventListener;
+
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ SymbexEventManager()
+ : mEventDestroyCtxListener( ),
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Computing Variable
+ itEventListener( ),
+ endEventListener( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~SymbexEventManager()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * NOTIFICATION
+ * Destroy Execution Context EVENT
+ */
+ inline void notifyEventDestroyCtx(ExecutionContext * anEC)
+ {
+ if( mEventDestroyCtxListener.nonempty() )
+ {
+ postEventDestroyCtx( anEC );
+ }
+ }
+
+ void inline postEventDestroyCtx(ExecutionContext * anEC)
+ {
+ itEventListener = mEventDestroyCtxListener.begin();
+ endEventListener = mEventDestroyCtxListener.end();
+ for( ; itEventListener != endEventListener ; ++itEventListener )
+ {
+ (*itEventListener)->handleEventDestroyCtx( anEC );
+ }
+ }
+
+
+ inline void registerHandlerEventDestroyCtx(
+ IHandlerEventDestroyCtx * aListener)
+ {
+ mEventDestroyCtxListener.add_union( aListener );
+ }
+
+ inline void unregisterHandlerEventDestroyCtx(
+ IHandlerEventDestroyCtx * aListener)
+ {
+ mEventDestroyCtxListener.remove( aListener );
+ }
+
+};
+
+
+} /* namespace sep */
+
+#endif /* SEW_SYMBEX_EVENT_MANAGER_H_ */
diff --git a/org.eclipse.efm.symbex/src/sew/SymbexJob.h b/org.eclipse.efm.symbex/src/sew/SymbexJob.h
new file mode 100644
index 0000000..5e17f5d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/sew/SymbexJob.h
@@ -0,0 +1,195 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef SEW_SYMBEXJOB_H_
+#define SEW_SYMBEXJOB_H_
+
+#include <common/RunnableElement.h>
+#include <collection/Typedef.h>
+#include <fml/runtime/ExecutionContext.h>
+
+
+namespace sep
+{
+
+
+class ExecutionContext;
+class SymbexControllerUnitManager;
+class SymbexDispatcher;
+
+
+class SymbexJob :
+ public RunnableElement
+{
+
+
+protected:
+ /**
+ * TYPEDEF
+ */
+ typedef List < ExecutionContext * > ListOfExecutionContext;
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ SymbexDispatcher & mSymbexDispatcher;
+
+ SymbexControllerUnitManager & mControllerUnitManager;
+
+ ListOfExecutionContext mSymbexContexts;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ SymbexJob(SymbexDispatcher & aSymbexDispatcher,
+ WObject * wfParameterObject,
+ SymbexControllerUnitManager & aCentralControllerUnit)
+ : RunnableElement( wfParameterObject ),
+ mSymbexDispatcher( aSymbexDispatcher ),
+ mControllerUnitManager( aCentralControllerUnit ),
+ mSymbexContexts( )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~SymbexJob()
+ {
+ //!! NOTHING
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // INIT / EXIT API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool initImpl()
+ {
+ //!! NOTHING
+ return true;
+ }
+
+ virtual bool exitImpl()
+ {
+ //!! NOTHING
+ return true;
+ }
+
+
+ /**
+ * Thread main Run Method
+ */
+ virtual void operator()() = 0;
+
+
+ /**
+ * GETTER - SETTER
+ * mSymbexContexts
+ */
+ /**
+ * GETTER - SETTER
+ * mSymbexContexts
+ */
+ inline virtual void appendSymbexContext(ExecutionContext * anEC)
+ {
+ mSymbexContexts.append(anEC);
+ }
+
+
+ inline ListOfExecutionContext & getSymbexContexts()
+ {
+ return( mSymbexContexts );
+ }
+
+ inline bool hasSymbexContext() const
+ {
+
+ return( mSymbexContexts.nonempty() );
+ }
+
+
+ inline ExecutionContext * popFirstSymbexContext()
+ {
+ return( mSymbexContexts.pop_first() );
+ }
+
+ inline void removeSymbexContext(ExecutionContext * anEC)
+ {
+ mSymbexContexts.remove( anEC );
+ }
+
+
+ /**
+ * Handle Request
+ * Release
+ * Stop
+ */
+ inline void handleRequestGoalAchieved()
+ {
+ RunnableElement::setLifecycleIdle();
+ }
+
+ inline void handleRequestNoWork()
+ {
+// RunnableElement::setLifecycleIdle();
+ RunnableElement::setLifecycleSuspended();
+
+// AVM_OS_FATAL_ERROR_EXIT
+// << "[BUG] Unexpected <NoWork> request !!!"
+// << SEND_EXIT;
+ }
+
+ inline void handleRequestRelease()
+ {
+ RunnableElement::setLifecycleReleased();
+ }
+
+ inline void handleRequestReset()
+ {
+ // TODO handleRequestReset
+// mSymbexContexts.clear();
+ RunnableElement::setLifecycleIdle();
+ }
+
+ inline void handleRequestStop()
+ {
+ RunnableElement::setLifecycleStopped();
+ }
+
+ inline void handleRequestWaiting()
+ {
+ RunnableElement::setLifecycleWaiting();
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mSymbexDispatcher
+ */
+ inline SymbexDispatcher & getSymbexDispatcher() const
+ {
+ return( mSymbexDispatcher );
+ }
+
+};
+
+}
+
+#endif /*SEW_SYMBEXJOB_H_*/
diff --git a/org.eclipse.efm.symbex/src/sew/SymbexProcessor.cpp b/org.eclipse.efm.symbex/src/sew/SymbexProcessor.cpp
new file mode 100644
index 0000000..d42a215
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/sew/SymbexProcessor.cpp
@@ -0,0 +1,179 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "SymbexProcessor.h"
+
+
+#include <computer/primitive/AvmPrimitiveProcessor.h>
+
+#include <fml/runtime/ExecutionContext.h>
+
+#include <sew/SymbexEngine.h>
+#include <sew/SymbexDispatcher.h>
+
+
+namespace sep
+{
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+SymbexProcessor::SymbexProcessor(
+ SymbexDispatcher & aSymbexDispatcher, WObject * wfParameterObject,
+ SymbexControllerUnitManager & aControllerUnitManager)
+: SymbexJob(aSymbexDispatcher, wfParameterObject, aControllerUnitManager),
+mPrimitiveProcessor( aSymbexDispatcher.getPrimitiveProcessor() )
+{
+ //!! NOTHING
+}
+
+
+/**
+ * Thread main Run Method
+ */
+void SymbexProcessor::operator()()
+{
+ AVM_OS_TRACE << "Begin SymbexProcessor Thread" << std::endl;
+
+ while( isLifecycleRunnable() )
+ {
+ runStep();
+ }
+
+ AVM_OS_TRACE << "End SymbexProcessor Thread" << std::endl;
+}
+
+
+/**
+ * Execution <init> step
+ */
+
+void SymbexProcessor::initStep()
+{
+ RunnableElement::AutoRunningIdleSwitcher autoActivator( *this );
+
+ traceBoundEval();
+
+// AVM_VERBOSITY_IF_HAS_MINIMUM
+// traceBoundEval();
+// AVM_VERBOSITY_ELSE
+// AVM_IF_DEBUG_ENABLED
+// traceBoundEval();
+// AVM_ENDIF_DEBUG_ENABLED
+// AVM_VERBOSITY_ENDIF
+
+ while( hasSymbexContext() )
+ {
+ initStep( *( popFirstSymbexContext() ) );
+ }
+}
+
+void SymbexProcessor::initStep(ExecutionContext & anEC)
+{
+ // STAT before PRINTING NEXT EVAL CONTEXT ID
+ if( anEC.hasContainer()
+ && anEC.getContainer()->hasChildContext() )
+ {
+ // INVARIANT: the first child inherit their parent's width
+ if( (anEC.getContainer()->firstChildContext() == (& anEC)) )
+ {
+ anEC.setWidth( anEC.getContainer()->getWidth() );
+ }
+ else
+ {
+ anEC.setWidth( mSymbexDispatcher.nextGlobalGraphWidth() );
+ }
+ }
+
+ anEC.setEvalNumber( mSymbexDispatcher.nextEvalNumber() );
+
+ // NEW EXECUTION PROCESSOR
+ // Test necessaire en cas d'enchainement d'exécutions successives
+
+ tracePreEval(anEC);
+
+ if( anEC.hasContainer() )
+ {
+ mPrimitiveProcessor.run(anEC);
+ }
+ else
+ {
+ mPrimitiveProcessor.init(anEC);
+ }
+
+ tracePostEval(anEC);
+
+ mSymbexDispatcher.sendToAnalyserWorkingQueue(& anEC);
+}
+
+
+/**
+ * Execution <run> step
+ */
+void SymbexProcessor::runStep()
+{
+ RunnableElement::AutoRunningIdleSwitcher autoActivator( *this );
+
+ while( hasSymbexContext() )
+ {
+ runStep( *( popFirstSymbexContext() ) );
+ }
+}
+
+
+
+void SymbexProcessor::runStep(ExecutionContext & anEC)
+{
+ // STAT before PRINTING NEXT EVAL CONTEXT ID
+ anEC.setEvalNumber( mSymbexDispatcher.nextEvalNumber() );
+
+ tracePreEval(anEC);
+
+ mPrimitiveProcessor.run(anEC);
+
+ tracePostEval(anEC);
+
+ mSymbexDispatcher.sendToAnalyserWorkingQueue(& anEC);
+}
+
+
+
+/**
+ * EVAL TRACE
+ */
+void SymbexProcessor::traceBoundEval()
+{
+ mControllerUnitManager.traceBoundEval(AVM_OS_TRACE);
+
+ mControllerUnitManager.traceBoundEval(AVM_OS_COUT);
+}
+
+void SymbexProcessor::tracePreEval(const ExecutionContext & anEC)
+{
+ mControllerUnitManager.tracePreEval(AVM_OS_TRACE, anEC);
+
+ mControllerUnitManager.tracePreEval(AVM_OS_COUT, anEC);
+}
+
+void SymbexProcessor::tracePostEval(const ExecutionContext & anEC)
+{
+ mControllerUnitManager.tracePostEval(AVM_OS_TRACE, anEC);
+
+ mControllerUnitManager.tracePostEval(AVM_OS_COUT, anEC);
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/sew/SymbexProcessor.h b/org.eclipse.efm.symbex/src/sew/SymbexProcessor.h
new file mode 100644
index 0000000..b8599aa
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/sew/SymbexProcessor.h
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef SEW_SYMBEX_PROCESSOR_H_
+#define SEW_SYMBEX_PROCESSOR_H_
+
+
+
+#include <sew/SymbexJob.h>
+
+
+
+namespace sep
+{
+
+
+class AvmPrimitiveProcessor;
+class ExecutionContext;
+class SymbexControllerUnitManager;
+class SymbexDispatcher;
+
+
+class SymbexProcessor : public SymbexJob
+{
+
+ AVM_DECLARE_UNCLONABLE_CLASS(SymbexProcessor)
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ AvmPrimitiveProcessor & mPrimitiveProcessor;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ SymbexProcessor(SymbexDispatcher & aSymbexDispatcher,
+ WObject * wfParameterObject,
+ SymbexControllerUnitManager & aControllerUnitManager);
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~SymbexProcessor()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * Thread main Run Method
+ */
+ virtual void operator()();
+
+
+ /**
+ * Execution step
+ */
+ void initStep();
+ void initStep(ExecutionContext & anEC);
+
+ void runStep();
+ void runStep(ExecutionContext & anEC);
+
+
+ /**
+ * EVAL TRACE
+ */
+ void traceBoundEval();
+
+ void tracePreEval(const ExecutionContext & anEC);
+
+ void tracePostEval(const ExecutionContext & anEC);
+
+};
+
+
+} /* namespace sep */
+
+#endif /*SEW_SYMBEX_PROCESSOR_H_*/
diff --git a/org.eclipse.efm.symbex/src/sew/Workflow.cpp b/org.eclipse.efm.symbex/src/sew/Workflow.cpp
new file mode 100644
index 0000000..5576d7d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/sew/Workflow.cpp
@@ -0,0 +1,963 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "Workflow.h"
+
+#include <builder/primitive/CompilationEnvironment.h>
+
+#include <collection/List.h>
+#include <collection/Typedef.h>
+
+#include <computer/PathConditionProcessor.h>
+
+#include <fml/runtime/ExecutionContext.h>
+
+#include <parser/ParserManager.h>
+
+#include <printer/Manipulators.h>
+#include <printer/OutStream.h>
+
+#include <sew/Configuration.h>
+#include <sew/SymbexEngine.h>
+
+#include <solver/api/SolverDef.h>
+
+#include <util/avm_debug.h>
+#include <util/avm_util.h>
+
+#include <iostream>
+#include <list>
+#include <string>
+
+
+
+namespace sep
+{
+
+
+/**
+ * GLOBALS
+ */
+const std::string & Workflow::SECTION_WORKSPACE_REGEX_ID =
+ OR_WID3( "workspace" , "WORKSPACE" , "LOCATION" );
+
+const std::string & Workflow::SECTION_CONSOLE_REGEX_ID =
+ OR_WID3( "console" , "CONSOLE" , "AVM" );
+
+const std::string & Workflow::SECTION_DEVELOPER_REGEX_ID =
+ OR_WID3( "developer" , "DEVELOPER" , "TRACE");
+
+const std::string & Workflow::SECTION_DIRECTOR_REGEX_ID =
+ OR_WID4( "director" , "DIRECTOR" , "MOC" , "RUNTIME");
+
+const std::string & Workflow::SECTION_SHELL_REGEX_ID =
+ OR_WID3( "shell" , "SHELL" , "AVM");
+
+const std::string & Workflow::SECTION_SYMBEX_REGEX_ID =
+ OR_WID3( "symbex" , "SYMBEX" , "AVM");
+
+const std::string & Workflow::SECTION_TDD_REGEX_ID =
+ OR_WID2( "tdd" , "TDD");
+
+
+const std::string & Workflow::SECTION_FAM_REGEX_ID =
+ OR_WID2(OR_WID4( "controller" , "worker" , "processor" , "filter" ),
+ OR_WID4( "CONTROLLER" , "WORKER" , "PROCESSOR" , "FILTER" ));
+
+
+const std::string & Workflow::SECTION_FAM_CONTAINERS_REGEX_ID =
+ OR_WID4(OR_WID4( "controller" , "worker" , "processor" , "filter" ),
+ OR_WID4( "CONTROLLER" , "WORKER" , "PROCESSOR" , "FILTER" ),
+ OR_WID3( "queue" , "pre_process" , "post_process" ),
+ OR_WID3( "QUEUE" , "PRE_PROCESS" , "POST_PROCESS" ));
+
+// Deprecated
+const std::string & Workflow::SECTION_FAM_QUEUE_REGEX_ID =
+ OR_WID2( "queue" , "QUEUE" );
+
+const std::string & Workflow::SECTION_FAM_REDUNDANCY_REGEX_ID =
+ OR_WID2( "redundancy" , "REDUNDANCY" );
+
+const std::string & Workflow::SECTION_FAM_PROCESSOR_REGEX_ID =
+ OR_WID2(OR_WID3( "controller" , "worker" , "processor" ),
+ OR_WID3( "CONTROLLER" , "WORKER" , "PROCESSOR" ));
+
+const std::string & Workflow::SECTION_FAM_FILTER_REGEX_ID =
+ OR_WID2( "filter" , "FILTER" );
+
+const std::string & Workflow::SECTION_FAM_PREPROCESS_REGEX_ID =
+ OR_WID2( "pre_process" , "PRE_PROCESS" );
+
+const std::string & Workflow::SECTION_FAM_POSTPROCESS_REGEX_ID =
+ OR_WID2( "post_process" , "POST_PROCESS" );
+
+
+/**
+ * SINGLETON
+ */
+Workflow * Workflow::INSTANCE = NULL;
+
+
+/**
+ * LOADER
+ */
+bool Workflow::load()
+{
+ return( true );
+}
+
+
+/**
+ * DISPOSER
+ */
+void Workflow::dispose()
+{
+ mCurrentSymbexEngine = mMainSymbexEngine;
+ for( ; mCurrentSymbexEngine != NULL ; mCurrentSymbexEngine = mMainSymbexEngine )
+ {
+ mMainSymbexEngine = mMainSymbexEngine->getNextCore();
+
+ sep::destroy( mCurrentSymbexEngine );
+
+ mCurrentSymbexEngine = NULL;
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+///// AVM CONFIGURATION PARAMETER CHECKER
+////////////////////////////////////////////////////////////////////////////////
+
+bool Workflow::loadConfiguration(const std::string & aWorkflowLocation)
+{
+ mSEWFileLocation = aWorkflowLocation;
+
+ // Checking WORKFLOW
+ AVM_OS_COUT << _SEW_
+ << "Symbolic Execution based Workflow analysis ... START"
+ << std::endl
+ << _SEW_ << "Location: " << mSEWFileLocation << std::endl;
+
+ // Load workflow definition file
+ if( parseConfiguration() )
+ {
+ AVM_OS_COUT << _SEW_ << "Loading filename: \""
+ << VFS::filename( mSEWFileLocation )
+ << "\" ... done !" << std::endl;
+ }
+ else
+ {
+ return( false );
+ }
+
+ bool isOK = true;
+
+ StringOutStream OS_INIT_LOG;
+
+ // Configure core elements
+ isOK = loadCoreElementsConfig(OS_INIT_LOG);
+
+ // Set developer debug options
+ isOK = loadWorkspaceLocationsConfig(OS_INIT_LOG) && isOK;
+
+ // Initialize log & debug trace printers
+ isOK = isOK && OutStream::configure(this);
+
+AVM_IF_DEBUG_LEVEL_FLAG2_AND(HIGH , PARSING , CONFIGURING ,
+ (mParameterWObject != WObject::_NULL_) )
+
+ std::string parseResultFile = VFS::suffixFilename(
+ VFS::filename( mSEWFileLocation ), "_parsed", ".sew");
+
+ parseResultFile = VFS::native_path(parseResultFile,
+ VFS::WorkspaceDebugPath.empty()
+ ? VFS::parent( mSEWFileLocation )
+ : VFS::WorkspaceDebugPath );
+
+ OS_INIT_LOG << _DBG_ << "Saving of the parsed Workflow in text format ..."
+ << std::endl;
+
+ Configuration::saveElementTextualView(
+ OS_INIT_LOG, mParameterWObject, parseResultFile);
+
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND(ULTRA , PARSING )
+
+ if( isOK )
+ {
+ AVM_OS_LOG << _SEW_ << "Symbolic Execution "
+ "based Workflow analysis ... START"
+ << std::endl
+ << _SEW_ << "Location: " << mSEWFileLocation
+ << std::endl;
+
+ OS_VERBOSITY_MINIMUM_OR_DEBUG( AVM_OS_COUT )
+ << OS_INIT_LOG.str() << std::flush;
+
+ AVM_OS_LOG << OS_INIT_LOG.str() << std::flush;
+ }
+ else
+ {
+ AVM_OS_COUT << OS_INIT_LOG.str() << std::flush;
+
+ return( false );
+ }
+
+ // Set developer debug options
+ isOK = loadSymbexConfig() && isOK;
+
+ isOK = loadShellConfig() && isOK;
+
+ isOK = loadTddConfig() && isOK;
+
+ isOK = loadOthersConfig() && isOK;
+
+ if( isOK )
+ {
+ avm_report(AVM_OS_LOG, "Workflow::loadConfiguration:> "
+ "end of avm configuration checking !!!");
+ }
+ else
+ {
+ avm_set_exit_code( AVM_EXIT_CONFIGURE_ERROR_CODE );
+ }
+
+ AVM_OS_COUT << _SEW_
+ << "Symbolic Execution based Workflow analysis ... "
+ << ( isOK ? "DONE" : "FAILED !" )
+ << std::endl << std::endl;
+
+ AVM_OS_LOG << _SEW_
+ << "Symbolic Execution Workflow analysis ... "
+ << ( isOK ? "DONE" : "FAILED !" )
+ << std::endl << std::endl;
+
+ return( isOK );
+}
+
+
+/**
+ * Load workflow definition file
+ */
+bool Workflow::parseConfiguration()
+{
+ std::ifstream anInputStream( mSEWFileLocation.c_str() );
+
+ if( anInputStream.good() )
+ {
+ std::string antlrExceptionMsg;
+
+ ParserManager aParser( mSEWFileLocation );
+
+ mParameterWObject = aParser.parseSEW(mWObjectManager, anInputStream );
+
+ if( aParser.hasSyntaxError() )
+ {
+ AVM_OS_CERR << std::endl;
+
+ if( aParser.hasExceptionMessage() )
+ {
+ AVM_OS_CERR << _SEW_ << "< exception > "
+ << aParser.getExceptionMessage() << std::endl;
+ }
+
+ AVM_OS_CERR << std::endl << _SEW_ << "< error > "
+ << aParser.getErrorCount() << " syntax error"
+ << ((aParser.getErrorCount() > 1)? "s" : "")
+ << " found." << std::endl;
+
+ avm_set_exit_code( AVM_EXIT_PARSING_ERROR_CODE );
+
+ return( false );
+ }
+ else if( mParameterWObject == WObject::_NULL_ )
+ {
+ AVM_OS_CERR << _SEW_ << "< error > No parsing result !"
+ << std::endl;
+
+ avm_set_exit_code( AVM_EXIT_PARSING_ERROR_CODE );
+
+ return( false );
+ }
+ else
+ {
+ return( true );
+ }
+ }
+ else
+ {
+ AVM_OS_CERR << _SEW_ << "< error > Cannot open the file \""
+ << VFS::filename(mSEWFileLocation) << "\" !"
+ << std::endl << std::endl;
+
+ avm_set_exit_code( AVM_EXIT_CONFIGURE_ERROR_CODE );
+
+ return( false );
+ }
+}
+
+
+/**
+ * Configure core elements
+ * Set console verbosity level
+ * Set developer debug level
+ * Set developer debug flags
+ */
+/*
+section CONSOLE // @deprecated AVM
+ verbosity = 'MINIMUM'; // SILENT == MINIMUM < MEDIUM < MAXIMUM
+endsection CONSOLE
+
+section DEVELOPER // @deprecated TRACE
+ level = 'ZERO'; // ZERO < LOW < MEDIUM < HIGH < ULTRA
+
+ flag = 'PARSING'; --> @deprecated kind = 'PARSING';
+ flag = 'COMPILING';
+ flag = 'STATEMENT';
+ flag = 'BYTECODE';
+endsection DEVELOPER
+*/
+bool Workflow::loadCoreElementsConfig(OutStream & LOGGER)
+{
+ // Set console verbosity level
+ avm_setExecVerbosityLevel(
+ Query::getRegexWPropertyString(
+ getCONSOLE(), "verbos(ity|e)", "MAXIMUM") );
+
+ // DEVELOPER
+ WObject * configDEVELOPER = getDEVELOPER();
+
+ // Set developer debug level
+ avm_setDebugLevel(
+ Query::getWPropertyString(configDEVELOPER, "level", "ZERO") );
+
+ // Set developer debug flags
+ ListOfString listOfFlags;
+ Query::getWPropertyString(configDEVELOPER, "flag", "kind",listOfFlags);
+
+ if( listOfFlags.nonempty() )
+ {
+ ListOfString::iterator it = listOfFlags.begin();
+
+ avm_setDebugFlag(*it);
+
+ for( ++it ; it != listOfFlags.end() ; ++it )
+ {
+ avm_setDebugFlag(*it);
+ }
+ }
+
+ OS_VERBOSITY_MINIMUM_OR_DEBUG( LOGGER )
+ << _SEW_ << "Console verbosity level: \'"
+ << avm_strExecVerbosityLevel() << "\'"
+ << std::endl;
+
+AVM_IF_DEBUG_ENABLED
+
+ LOGGER << _SEW_ << "Developer debug level: \'"
+ << avm_strDebugLevel() << "\'"
+ << std::endl;
+
+ LOGGER << _SEW_ << "Developer debug flags: \'"
+ << avm_strDebugFlag(" | ") << "\'"
+ << std::endl;
+
+AVM_ENDIF_DEBUG_ENABLED
+
+ return( true );
+}
+
+/**
+ * configure workspace location & folders
+ * root location
+ * source folder
+ * output folder
+ * log folder
+ * debug folder
+ * tdd folder
+ */
+/*
+section WORKSPACE // @deprecated LOCATION
+ root = "<workspace-root-path>";
+ project = "<project-root-path>"; //# DEPRECATED
+
+ source = ".";
+
+ output = "output";
+ log = "log";
+ debug = "debug";
+
+ tdd = "tdd";
+endsection WORKSPACE
+ */
+bool Workflow::loadWorkspaceLocationsConfig(OutStream & LOGGER)
+{
+ bool isOK = true;
+
+ /*
+ * CHECKING FILE AND FOLDER
+ */
+ LOGGER << _SEW_ << "The launch folder: "
+ << VFS::LaunchPath << std::endl;
+
+ WObject * configWORKSPACE = getWORKSPACE();
+
+ VFS::ProjectPath = VFS::WorkspaceRootPath =
+ VFS::native_path(
+ Query::getWPropertyStringOrElse(
+ configWORKSPACE, "root", "project", "."),
+ VFS::LaunchPath);
+
+ LOGGER << _SEW_ << "The <wroot> folder: "
+ << VFS::WorkspaceRootPath << std::endl;
+
+ if( VFS::checkReadingFolder(VFS::WorkspaceRootPath) )
+ {
+ VFS::ProjectSourcePath = VFS::WorkspaceSourcePath =
+ VFS::native_path(
+ Query::getWPropertyStringOrElse(
+ configWORKSPACE, "source", "src", "."),
+ VFS::WorkspaceRootPath);
+
+ LOGGER << _SEW_ << "The source! folder: "
+ << VFS::relativeWorkspacePath( VFS::WorkspaceSourcePath )
+ << std::endl;
+ if( not VFS::checkWritingFolder(VFS::WorkspaceSourcePath) )
+ {
+ LOGGER << _SEW_ << "< error > The source folder `"
+ << VFS::filename( VFS::WorkspaceSourcePath )
+ << "' ==> doesn't exist or is not writable !!!"
+ << std::endl << std::endl;
+
+ isOK = false;
+ }
+
+ VFS::ProjectOutputPath = VFS::WorkspaceOutputPath =
+ VFS::native_path(
+ Query::getWPropertyStringOrElse(
+ configWORKSPACE, "output", "out", "out"),
+ VFS::WorkspaceRootPath);
+
+ LOGGER << _SEW_ << "The output! folder: "
+ << VFS::relativeWorkspacePath( VFS::WorkspaceOutputPath )
+ << std::endl;
+ if( not VFS::checkWritingFolder(VFS::WorkspaceOutputPath) )
+ {
+ LOGGER << _SEW_ << "< error > The folder `"
+ << VFS::filename( VFS::WorkspaceOutputPath )
+ << "' ==> doesn't exist or is not writable !!!"
+ << std::endl << std::endl;
+
+ isOK = false;
+ }
+
+ if( needDeveloperDebugLogTraceFolder() )
+ {
+ VFS::ProjectLogPath = VFS::WorkspaceLogPath =
+ VFS::native_path(
+ Query::getWPropertyString(
+ configWORKSPACE, "log", "log"),
+ VFS::WorkspaceOutputPath);
+
+ LOGGER << _SEW_ << "The logger! folder: "
+ << VFS::relativeWorkspacePath( VFS::WorkspaceLogPath )
+ << std::endl;
+ if( not VFS::checkWritingFolder(VFS::WorkspaceLogPath) )
+ {
+ LOGGER << _SEW_ << "< error > The folder `"
+ << VFS::filename( VFS::WorkspaceLogPath )
+ << "' ==> doesn't exist or is not writable !!!"
+ << std::endl << std::endl;
+
+ isOK = false;
+ }
+ }
+ else if( isOK )
+ {
+ VFS::ProjectLogPath =
+ VFS::WorkspaceLogPath =
+ VFS::WorkspaceOutputPath;
+ }
+
+ VFS::ProjectDebugPath =
+ VFS::WorkspaceDebugPath =
+ VFS::WorkspaceLogPath;
+
+AVM_IF_DEBUG_ENABLED
+ VFS::ProjectDebugPath = VFS::WorkspaceDebugPath =
+ VFS::native_path(
+ Query::getWPropertyStringOrElse(
+ configWORKSPACE, "debug", "dbg", "debug"),
+ VFS::WorkspaceOutputPath);
+
+ LOGGER << _SEW_ << "The !debug! folder: "
+ << VFS::relativeWorkspacePath( VFS::WorkspaceDebugPath )
+ << std::endl;
+ if( not VFS::checkWritingFolder(VFS::WorkspaceDebugPath) )
+ {
+ LOGGER << _SEW_ << "< error > The folder `"
+ << VFS::filename( VFS::WorkspaceDebugPath )
+ << "' ==> doesn't exist or is not writable !!!"
+ << std::endl << std::endl;
+
+ isOK = false;
+ }
+AVM_ENDIF_DEBUG_ENABLED
+
+ if( hasTddReport() )
+ {
+ VFS::ProjectTddPath = VFS::WorkspaceTddPath =
+ VFS::native_path(
+ Query::getWPropertyString(
+ configWORKSPACE, "tdd", "tdd"),
+ VFS::WorkspaceRootPath);
+
+ LOGGER << _SEW_ << "The tdd folder : "
+ << VFS::relativeWorkspacePath( VFS::WorkspaceTddPath )
+ << std::endl;
+ if( not VFS::checkWritingFolder(VFS::WorkspaceTddPath) )
+ {
+ LOGGER << _SEW_ << "< error > The folder `"
+ << VFS::filename( VFS::WorkspaceTddPath )
+ << "' ==> doesn't exist or is not writable !!!"
+ << std::endl << std::endl;
+
+ isOK = false;
+ }
+ }
+ }
+ else
+ {
+ LOGGER << _SEW_
+ << "< error > The <wroot> folder location "
+ "==> doesn't exist or is not Readable !!!"
+ << std::endl << std::endl;
+
+ isOK = false;
+ }
+
+ return( isOK );
+}
+
+/*
+section SYMBEX // @deprecated AVM
+ mode = 'standalone'; // standalone | server | interactive | debug
+
+ multithread = false;
+ thread = 2;
+endsection SYMBEX
+*/
+bool Workflow::loadSymbexConfig()
+{
+ WObject * configSYMBEX = getSYMBEX();
+
+ PathConditionProcessor::checkPathcondSat =
+ SolverDef::DEFAULT_SOLVER_USAGE_FLAG =
+ Query::getRegexWPropertyBoolean(configSYMBEX,
+ CONS_WID4("check", "path", "condition", "satisfiability"),
+ false);
+
+ PathConditionProcessor::separationOfPcDisjunction =
+ Query::getWPropertyBoolean(configSYMBEX,
+ "separation_of_pc_disjunction", false);
+
+
+ std::string solverKind = Query::getRegexWPropertyString(
+ configSYMBEX, CONS_WID2("constraint", "solver"), "CVC");
+
+ SolverDef::DEFAULT_SOLVER_KIND = SolverDef::toSolver(solverKind,
+ SolverDef::SOLVER_CVC_KIND);
+
+AVM_IF_DEBUG_ENABLED
+ AVM_OS_LOG << _SEW_ << "The default solver: < checksat="
+ << ( SolverDef::DEFAULT_SOLVER_USAGE_FLAG ? "true" : "false" )
+ << " , " << solverKind << " > |=> "
+ << SolverDef::strSolver(SolverDef::DEFAULT_SOLVER_KIND)
+ << std::endl;
+AVM_ENDIF_DEBUG_ENABLED
+
+ mMultitaskingFlag =
+ Query::getWPropertyBoolean(configSYMBEX, "multitasking", false);
+
+ mThreadCount = Query::getWPropertyInt(configSYMBEX, "thread", 2);
+
+ std::string evalMode = Query::getWPropertyString(configSYMBEX, "mode", "");
+
+AVM_IF_DEBUG_ENABLED
+ AVM_OS_LOG << _SEW_ << "Computing resource: < multitasking="
+ << ( ( mMultitaskingFlag ) ? "true" : "false" )
+ << " , thread=" << static_cast< unsigned int >( mThreadCount )
+ << " >" << std::endl;
+AVM_ENDIF_DEBUG_ENABLED
+
+ return( true );
+}
+
+
+/*
+section SHELL // Deprecated AVM
+ stop = "stop.avm";
+endsection SHELL
+*/
+bool Workflow::loadShellConfig()
+{
+ WObject * configSHELL = getSHELL();
+
+ mInconditionalStopMarkerLocation = VFS::native_path(
+ Query::getWPropertyString(configSHELL, "stop", "stop.sew"));
+
+ mInconditionalStopMarkerLocation = VFS::native_path(
+ mInconditionalStopMarkerLocation, VFS::WorkspaceLogPath);
+
+ return( true );
+}
+
+
+/**
+ * Other Elements Configuration
+ */
+bool Workflow::loadTddConfig()
+{
+ mTddRegressionTestingFlag =
+ Query::getWPropertyBoolean(getTDD(), "regression", false);
+
+ mTddUnitTestingFlag = Query::getWPropertyBoolean(getTDD(), "unit", false);
+
+ return( true );
+}
+
+
+/**
+ * Other Elements Configuration
+ */
+bool Workflow::loadOthersConfig()
+{
+ ExecutionContext::EXECUTION_CONTEXT_CHILD_TRACE_MAX =
+ Query::getWPropertyLong(getCONSOLE(), "ec_size",
+ ExecutionContext::EXECUTION_CONTEXT_CHILD_TRACE_MAX);
+
+ return( true );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CONFIGURE API
+////////////////////////////////////////////////////////////////////////////////
+
+bool Workflow::configure()
+{
+ mMainSymbexEngine = NULL;
+
+ WObject * sequenceDIRECTOR = getDIRECTOR();
+
+ const BF & mocRuntime =
+ Query::getWPropertyValueOrElse(sequenceDIRECTOR, "moe", "moc");
+
+ avm_offset_t anEngineOffset = 0;
+
+ if( WObjectManager::is( mocRuntime ) )
+ {
+ mMainSymbexEngine = new SymbexEngine(*this,
+ WObjectManager::from( mocRuntime ), anEngineOffset++);
+
+ if(not mMainSymbexEngine->configure() )
+ {
+ delete( mMainSymbexEngine );
+
+ mMainSymbexEngine = NULL;
+
+ return( false );
+ }
+ }
+ else if( mocRuntime.is< AvmCode >() )
+ {
+ SymbexEngine * nextEngine = NULL;
+ SymbexEngine * prevEngine = NULL;
+
+ AvmCode::iterator itEngine = mocRuntime.to_ptr< AvmCode >()->begin();
+ AvmCode::iterator itEnd = mocRuntime.to_ptr< AvmCode >()->end();
+ for( ; itEngine != itEnd ; ++itEngine )
+ {
+ if( WObjectManager::is( *itEngine ) )
+ {
+ nextEngine = new SymbexEngine(*this,
+ WObjectManager::from( *itEngine ), anEngineOffset++);
+
+ nextEngine->setPreviousCore( prevEngine );
+
+ if( nextEngine->configure() )
+ {
+ if( mMainSymbexEngine == NULL )
+ {
+ mMainSymbexEngine = nextEngine;
+ }
+
+ if( prevEngine != NULL )
+ {
+ prevEngine->setNextCore( nextEngine );
+ }
+ prevEngine = nextEngine;
+ }
+ else
+ {
+ delete( nextEngine );
+
+ return( false );
+ }
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ }
+ else
+ {
+ SymbexEngine * nextEngine = NULL;
+ SymbexEngine * prevEngine = NULL;
+
+ List< WObject * > engineList;
+ Query::getListWObject(sequenceDIRECTOR, engineList);
+
+ List< WObject * >::iterator itForm = engineList.begin();
+ for( ; itForm != engineList.end() ; ++itForm )
+ {
+ nextEngine = new SymbexEngine(*this, *itForm, anEngineOffset++ );
+
+ nextEngine->setPreviousCore( prevEngine );
+
+ if( nextEngine->configure() )
+ {
+ if( mMainSymbexEngine == NULL )
+ {
+ mMainSymbexEngine = nextEngine;
+ }
+
+ if( prevEngine != NULL )
+ {
+ prevEngine->setNextCore( nextEngine );
+ }
+ prevEngine = nextEngine;
+ }
+ else
+ {
+ delete( nextEngine );
+
+ return( false );
+ }
+ }
+ }
+
+ return( true );
+}
+
+
+/**
+ * Prologue options
+ */
+void Workflow::setPrologueOption(
+ const std::string & id, BF value)
+{
+ if( REGEX_MATCH(id, CONS_WID2("check", "type")) )
+ {
+ COMPILE_CONTEXT::DEFAUL_TYPE_CHECKING_MASK = value.isNotEqualFalse();
+ }
+
+ else if( REGEX_MATCH(id, CONS_WID2("inline", "disable")) )
+ {
+ COMPILE_CONTEXT::INLINE_DISABLE_MASK = value.isNotEqualFalse();
+ }
+ else if( REGEX_MATCH(id, CONS_WID2("inline", "enable")) )
+ {
+ COMPILE_CONTEXT::INLINE_ENABLE_MASK = value.isNotEqualFalse();
+ }
+
+ else if( REGEX_MATCH(id, CONS_WID2("inline", "procedure")) )
+ {
+ COMPILE_CONTEXT::INLINE_PROCEDURE_MASK = value.isNotEqualFalse();
+ }
+
+ else if( REGEX_MATCH(id, CONS_WID2("string", "delimiter")) )
+ {
+ if( value.isCharacter() )
+ {
+ String::_EMPTY_.to_ptr< String >()->setQuoteChar(
+ String::DEFAULT_DELIMITER = value.toCharacter() );
+ }
+ else if( value.isBuiltinString() )
+ {
+ std::string delim = value.toBuiltinString();
+
+ String::_EMPTY_.to_ptr< String >()->setQuoteChar(
+ String::DEFAULT_DELIMITER =
+ ( delim.empty() ? '\0' : delim[0] ) );
+ }
+ }
+}
+
+
+/**
+ * START
+ */
+bool Workflow::start()
+{
+ ////////////////////////////////////////////////////////////////////////////
+ ///// START SEQUENTIALLY ENGINE CORE
+ ////////////////////////////////////////////////////////////////////////////
+
+ for( mCurrentSymbexEngine = mMainSymbexEngine ; mCurrentSymbexEngine != NULL ;
+ mCurrentSymbexEngine = mCurrentSymbexEngine->getNextCore() )
+ {
+ if( not mCurrentSymbexEngine->startComputing() )
+ {
+ return( false );
+ }
+ }
+
+ return( true );
+}
+
+
+/**
+ * EXIT
+ */
+bool Workflow::exitImpl()
+{
+// bool isCasManager_OK = mAvmConfiguration.getCasManager().exit();
+//
+// return( RunnableElement::exit() && isCasManager_OK );
+
+ return( true );
+}
+
+
+/**
+ * REPORT TRACE
+ */
+void Workflow::report(OutStream & os) const
+{
+// mAvmConfiguration.getCasManager().report(os);
+//
+// mAvmConfiguration.getCasManager().report(AVM_OS_COUT);
+}
+
+
+/**
+ * COMPUTING
+ *
+ */
+bool Workflow::startComputing()
+{
+ AVM_OS_LOG << std::endl << _SEW_ << "< start > Computing ..." << std::endl;
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// INITIALIZATION
+ ////////////////////////////////////////////////////////////////////////////
+
+ if( not init() )
+ {
+ avm_set_exit_code( AVM_EXIT_INITIALIZING_ERROR_CODE );
+
+ return( false );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// PRE PROCESSING
+ ////////////////////////////////////////////////////////////////////////////
+
+ if( not preprocess() )
+ {
+ avm_set_exit_code( AVM_EXIT_PRE_PROCESSING_ERROR_CODE );
+
+ return( false );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// START
+ ////////////////////////////////////////////////////////////////////////////
+
+ if( not start() )
+ {
+ avm_set_exit_code( AVM_EXIT_PROCESSING_ERROR_CODE );
+
+ return( false );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// POST PROCESSING
+ ////////////////////////////////////////////////////////////////////////////
+
+ if( not postprocess() )
+ {
+ avm_set_exit_code( AVM_EXIT_POST_PROCESSING_ERROR_CODE );
+
+ return( false );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// EXITING
+ ////////////////////////////////////////////////////////////////////////////
+
+ if( not exit() )
+ {
+ avm_set_exit_code( AVM_EXIT_FINALIZING_ERROR_CODE );
+
+ return( false );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// REPORTING
+ ////////////////////////////////////////////////////////////////////////////
+
+ AVM_OS_LOG << std::endl;
+
+ report(AVM_OS_LOG);
+
+ AVM_OS_LOG << std::endl;
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ ///// SERIALIZATION
+ ////////////////////////////////////////////////////////////////////////////
+
+ //serializeResult();
+
+ AVM_OS_LOG << _SEW_ << "< end >Computing ... done." << std::endl;
+
+ return( true );
+}
+
+
+/**
+ * SERIALIZATION
+ */
+void Workflow::toStream(OutStream & os) const
+{
+ os << TAB << "parameter {" << EOL;
+
+ os << TAB2 << "location = " << mSEWFileLocation << ";"
+ << EOL_INCR_INDENT;
+
+ if( mParameterWObject != WObject::_NULL_ )
+ {
+ mParameterWObject->toStream(os);
+ }
+
+ os << DECR_INDENT_TAB << "}" << EOL_FLUSH;
+}
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/sew/Workflow.h b/org.eclipse.efm.symbex/src/sew/Workflow.h
new file mode 100644
index 0000000..729198b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/sew/Workflow.h
@@ -0,0 +1,430 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef WORKFLOW_WORKFLOW_H_
+#define WORKFLOW_WORKFLOW_H_
+
+#include <common/AvmPointer.h>
+#include <common/RunnableElement.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <util/avm_vfs.h>
+
+
+namespace sep
+{
+
+class SymbexEngine;
+
+
+class Workflow : public RunnableElement
+{
+
+ AVM_DECLARE_UNCLONABLE_CLASS(Workflow)
+
+public:
+ /**
+ * GLOBALS
+ */
+ static const std::string & SECTION_WORKSPACE_REGEX_ID;
+
+ static const std::string & SECTION_CONSOLE_REGEX_ID;
+
+ static const std::string & SECTION_DEVELOPER_REGEX_ID;
+
+ static const std::string & SECTION_DIRECTOR_REGEX_ID;
+
+ static const std::string & SECTION_SHELL_REGEX_ID;
+
+ static const std::string & SECTION_SYMBEX_REGEX_ID;
+
+ static const std::string & SECTION_TDD_REGEX_ID;
+
+ static const std::string & SECTION_FAM_REGEX_ID;
+
+ static const std::string & SECTION_FAM_CONTAINERS_REGEX_ID;
+
+ // Deprecated
+ static const std::string & SECTION_FAM_QUEUE_REGEX_ID;
+
+ static const std::string & SECTION_FAM_REDUNDANCY_REGEX_ID;
+
+ static const std::string & SECTION_FAM_PROCESSOR_REGEX_ID;
+
+ static const std::string & SECTION_FAM_FILTER_REGEX_ID;
+
+ static const std::string & SECTION_FAM_PREPROCESS_REGEX_ID;
+
+ static const std::string & SECTION_FAM_POSTPROCESS_REGEX_ID;
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ const std::string mSEWBuildID;
+
+ std::string mSEWFileLocation;
+
+ WObjectManager mWObjectManager;
+
+ // Symbex Threading config
+ bool mMultitaskingFlag;
+ avm_uint8_t mThreadCount;
+
+ // Shell config
+ std::string mInconditionalStopMarkerLocation;
+
+ // TDD config
+ bool mTddRegressionTestingFlag;
+ bool mTddUnitTestingFlag;
+
+ SymbexEngine * mMainSymbexEngine;
+ SymbexEngine * mCurrentSymbexEngine;
+
+
+public:
+ /**
+ * SINGLETON
+ */
+ static Workflow * INSTANCE;
+
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Workflow(const std::string & sewBuildID)
+ : RunnableElement( NULL ),
+ mSEWBuildID( sewBuildID ),
+ mSEWFileLocation( ),
+ mWObjectManager( WObject::SEW_FQN_ROOT ),
+
+ // Symbex Threading config
+ mMultitaskingFlag( false ),
+ mThreadCount( 1 ),
+
+ // Shell config
+ mInconditionalStopMarkerLocation( ),
+
+ mTddRegressionTestingFlag( false ),
+ mTddUnitTestingFlag( false ),
+
+ mMainSymbexEngine( NULL ),
+ mCurrentSymbexEngine( NULL )
+ {
+ INSTANCE = this;
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Workflow()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * LOADER - DISPOSER
+ */
+ bool load();
+
+ void dispose();
+
+ /**
+ * GETTER
+ * mWObjectManager
+ */
+ inline WObjectManager & getWObjectManager()
+ {
+ return( mWObjectManager );
+ }
+
+
+ /**
+ * Symbex Threading config
+ */
+ inline bool isMultitasking() const
+ {
+ return( mMultitaskingFlag );
+ }
+
+ inline avm_uint8_t getThreadCount() const
+ {
+ return( mThreadCount );
+ }
+
+ /**
+ * GETTER
+ * mInconditionalStopMarkerLocation
+ */
+ inline const std::string & getInconditionalStopMarkerLocation() const
+ {
+ return( mInconditionalStopMarkerLocation );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONFIGURE API
+ ////////////////////////////////////////////////////////////////////////////
+ bool loadConfiguration(const std::string & aWorkflowLocation);
+
+ bool parseConfiguration();
+
+ bool loadCoreElementsConfig(OutStream & LOGGER);
+
+ bool loadWorkspaceLocationsConfig(OutStream & LOGGER);
+
+ bool loadSymbexConfig();
+
+ bool loadShellConfig();
+
+ bool loadTddConfig();
+
+ bool loadOthersConfig();
+
+ virtual bool configure();
+
+
+ /**
+ * Prologue options
+ */
+ void setPrologueOption(const std::string & id, BF value);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // START / STOP / KILL / SUSPEND / RESUME API
+ ////////////////////////////////////////////////////////////////////////////
+
+ virtual bool start();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // INIT / EXIT API
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline virtual bool initImpl()
+ {
+ return( true );
+ }
+
+ virtual bool exitImpl();
+
+
+
+ /**
+ * REPORT TRACE
+ */
+ virtual void report(OutStream & os) const;
+
+
+ /*
+ * PROCESSING
+ */
+ bool startComputing();
+
+
+ /**
+ * STANDARD SEQUENCE
+ */
+ inline WObject * getCONSOLE() const
+ {
+ return( Query::getRegexWSequence(mParameterWObject,
+ Workflow::SECTION_CONSOLE_REGEX_ID) );
+ }
+
+ inline WObject * getDEVELOPER() const
+ {
+ return( Query::getRegexWSequence(mParameterWObject,
+ Workflow::SECTION_DEVELOPER_REGEX_ID) );
+ }
+
+ inline WObject * getDIRECTOR() const
+ {
+ return( Query::getRegexWSequence(mParameterWObject,
+ Workflow::SECTION_DIRECTOR_REGEX_ID, mParameterWObject) );
+ }
+
+ inline WObject * getSHELL() const
+ {
+ return( Query::getRegexWSequence(mParameterWObject,
+ Workflow::SECTION_SHELL_REGEX_ID) );
+ }
+
+ inline WObject * getSYMBEX() const
+ {
+ return( Query::getRegexWSequence(mParameterWObject,
+ Workflow::SECTION_SYMBEX_REGEX_ID) );
+ }
+
+ inline WObject * getTDD() const
+ {
+ return( Query::getRegexWSequence(mParameterWObject,
+ Workflow::SECTION_TDD_REGEX_ID) );
+ }
+
+ inline WObject * getWORKSPACE() const
+ {
+ return( Query::getRegexWSequence(mParameterWObject,
+ Workflow::SECTION_WORKSPACE_REGEX_ID) );
+ }
+
+
+ /**
+ ***************************************************************************
+ // TEST DRIVEN DEVELOPMENT
+ section TDD
+ report = "reportName";
+
+ regression = true;
+ unit = true;
+ endsection TDD
+ ***************************************************************************
+ */
+ inline bool hasTddReport()
+ {
+ return( Query::hasWPropertyString(getTDD(), "report") );
+ }
+
+ inline std::string getTddReport(const std::string & aDefaultValue = "report.tdd")
+ {
+ std::string aLocation =
+ Query::getWPropertyString(getTDD(), "report", aDefaultValue);
+
+ std::string::size_type pos = aLocation.find_last_of('.');
+ if( pos != std::string::npos )
+ {
+ aLocation.insert(pos, "_avm_" + mSEWBuildID);
+ }
+ else
+ {
+ aLocation = aLocation + "_avm_" + mSEWBuildID + ".tdd";
+ }
+
+ return( VFS::native_path(aLocation) );
+ }
+
+ inline std::string getTddReportLocation(
+ const std::string & aDefaultValue = "report.tdd")
+ {
+ return( VFS::native_path(
+ getTddReport(aDefaultValue), VFS::WorkspaceTddPath) );
+ }
+
+ inline bool isTddRegressionTesting(bool aDefaultValue = false)
+ {
+ return( mTddRegressionTestingFlag );
+ }
+
+ inline bool isTddUnitTesting(bool aDefaultValue = false)
+ {
+ return( mTddUnitTestingFlag );
+ }
+
+
+ /**
+ ***************************************************************************
+ section TRACE --> developer
+ log = "avm.log";
+
+ debug = "avm.trace";
+ level = 'MEDIUM'; // ZERO < LOW < MEDIUM < HIGH < ULTRA
+
+ kind = 'PARSING'; --> flag = 'PARSING';
+ kind = 'COMPILING';
+ kind = 'COMPUTING';
+
+ kind = 'TRACE';
+
+ kind = 'PROCESSOR';
+
+ kind = 'PROGRAM';
+ kind = 'STATEMENT';
+ kind = 'BYTECODE';
+
+ kind = 'STMNT_ASSIGN';
+
+ endsection TRACE --> developer
+ ***************************************************************************
+ */
+ inline bool needDeveloperDebugLogTraceFolder()
+ {
+ return( hasDeveloperDebugLogFile()
+ || hasDeveloperDebugTraceFile() );
+ }
+
+ inline bool hasDeveloperDebugLogFile()
+ {
+ return( Query::hasWPropertyString(getDEVELOPER(), "log") );
+ }
+
+ inline std::string getDeveloperDebugLogFile(
+ const std::string & aDefaultValue = "avm.log")
+ {
+ return( VFS::native_path( Query::getWPropertyString(
+ getDEVELOPER(), "log", aDefaultValue) ) );
+ }
+
+ inline std::string getDeveloperDebugLogFileLocation(
+ const std::string & aDefaultValue = "avm.log")
+ {
+ return( VFS::native_path(
+ getDeveloperDebugLogFile(aDefaultValue),
+ VFS::WorkspaceLogPath) );
+ }
+
+ /**
+ ***************************************************************************
+ * GLOBAL DEBUG LEVEL
+ *
+ * debug = "avm.trace";
+ * level = 'ZERO'; // ZERO < LOW < MEDIUM < HIGH < ULTRA
+ ***************************************************************************
+ */
+
+ inline bool hasDeveloperDebugTraceFile()
+ {
+ return( Query::hasWPropertyString(getDEVELOPER(), "debug") );
+ }
+
+ inline std::string getDeveloperDebugTraceFile(
+ const std::string & aDefaultValue = "avm.dbg")
+ {
+ return( VFS::native_path( Query::getWPropertyString(
+ getDEVELOPER(), "debug", aDefaultValue)) );
+ }
+
+ inline std::string getDeveloperDebugTraceFileLocation(
+ const std::string & aDefaultValue = "avm.dbg")
+ {
+ return( VFS::native_path(
+ getDeveloperDebugTraceFile(aDefaultValue),
+ VFS::WorkspaceLogPath) );
+ }
+
+
+ /**
+ ***************************************************************************
+ * SERIALIZATION
+ ***************************************************************************
+ */
+ void toStream(OutStream & os) const;
+
+};
+
+} /* namespace sep */
+
+#endif /* WORKFLOW_WORKFLOW_H_ */
diff --git a/org.eclipse.efm.symbex/src/solver/CMakeLists.txt b/org.eclipse.efm.symbex/src/solver/CMakeLists.txt
new file mode 100644
index 0000000..66a7029
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/solver/CMakeLists.txt
@@ -0,0 +1,20 @@
+# =============================================================================
+# CMake file for the SOLVER library
+# =============================================================================
+
+# C++ source files to take into account (all files matching patterns recursively)
+file (GLOB_RECURSE SOLVER_CXX_SRC_FILES *.cpp *.h)
+
+# Target to build
+add_library (solver STATIC ${SOLVER_CXX_SRC_FILES})
+
+# Include directories (internal)
+target_include_directories (solver PUBLIC ..) # FIXME : explicit the dependencies lib by lib
+
+# Target include directories (external)
+target_include_directories (solver PUBLIC ${GMP_INCLUDE_DIR} ${GMPXX_INCLUDE_DIR})
+target_include_directories (solver PUBLIC ${Boost_INCLUDE_DIRS})
+target_include_directories (solver PUBLIC ${CVC4_INCLUDE_DIR} ${CVC4_INCLUDE_DIR}/cvc4) # FIXME (confusion between include/cvc4 or include/cvc4/cvc4)
+
+
+add_dependencies(solver rescan_cvc4)
diff --git a/org.eclipse.efm.symbex/src/solver/CVC4Solver.cpp b/org.eclipse.efm.symbex/src/solver/CVC4Solver.cpp
new file mode 100644
index 0000000..1a9c774
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/solver/CVC4Solver.cpp
@@ -0,0 +1,2423 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 15 nov. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "CVC4Solver.h"
+
+/*
+ * Here because "SolverDef.h" could define this macro
+ */
+#if defined( _AVM_SOLVER_CVC4_ )
+
+
+#include <util/avm_vfs.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/builtin/Boolean.h>
+#include <fml/expression/BuiltinContainer.h>
+#include <fml/builtin/Character.h>
+#include <fml/expression/ExpressionComparer.h>
+#include <fml/expression/ExpressionConstant.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/ExpressionTypeChecker.h>
+#include <fml/numeric/Float.h>
+#include <fml/builtin/Identifier.h>
+#include <fml/numeric/Integer.h>
+#include <fml/numeric/Rational.h>
+#include <fml/builtin/String.h>
+
+#include <fml/operator/Operator.h>
+
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeForm.h>
+#include <fml/runtime/RuntimeID.h>
+#include <fml/runtime/TableOfData.h>
+
+#include <fml/type/TypeManager.h>
+
+#include <fml/workflow/WObject.h>
+
+
+namespace sep
+{
+
+
+/*
+ *******************************************************************************
+ * ID
+ *******************************************************************************
+ */
+std::string CVC4Solver::ID = "CVC4";
+
+std::string CVC4Solver::DESCRIPTION = "CVC4 "
+ "'Cooperating Validity Checker 4, Efficient Automatic Theorem Prover "
+ "for Satisfiability Modulo Theories problems, BSD License'";
+
+avm_uint64_t CVC4Solver::SOLVER_SESSION_ID = 0;
+
+
+//For automatic destroy of these CVC4 object using assignment
+CVC4::Expr CVC4Solver::CVC4_EXPR_NULL;
+CVC4::Type CVC4Solver::CVC4_TYPE_NULL;
+
+
+/**
+ * CONSTRUCTOR
+ * Default
+ */
+CVC4Solver::CVC4Solver(bool produce_models_flag)
+: base_this_type(CVC4_TYPE_NULL, CVC4_EXPR_NULL),
+mParamPrefix( "P_" ),
+mExprManager( ),
+mSmtEngine( & mExprManager )
+{
+ SMT_TYPE_BOOL = mExprManager.booleanType();
+ SMT_TYPE_INT = mExprManager.integerType();
+ SMT_TYPE_BV32 = mExprManager.mkBitVectorType(32);
+ SMT_TYPE_BV64 = mExprManager.mkBitVectorType(64);
+ SMT_TYPE_REAL = mExprManager.realType();
+
+ SMT_TYPE_NUMBER = mExprManager.realType();
+
+ SMT_TYPE_STRING = mExprManager.stringType();
+
+ SMT_CST_BOOL_TRUE = mExprManager.mkConst(true);
+ SMT_CST_BOOL_FALSE = mExprManager.mkConst(false);
+
+ SMT_CST_INT_ZERO = mExprManager.mkConst(CVC4::Rational(0));
+ SMT_CST_INT_ONE = mExprManager.mkConst(CVC4::Rational(1));
+
+
+// // Set the logic : LINEAR ARITHMETIC
+// mSmtEngine.setLogic("QF_LIRA");
+// // Set the logic : BIT VECTOR
+// mSmtEngine.setLogic("QF_BV");
+
+ // Produce Models
+ mSmtEngine.setOption("produce-models", produce_models_flag);
+
+ // Enable Multiple Queries
+ mSmtEngine.setOption("incremental", true);
+ //Disable dagifying the output
+ mSmtEngine.setOption("default-dag-thresh", 0);
+ // Set the output-language to CVC's
+ mSmtEngine.setOption("output-language", "cvc4");
+
+}
+
+
+/**
+ * DESTRUCTOR
+ */
+CVC4Solver::~CVC4Solver()
+{
+ SMT_TYPE_BOOL = CVC4_TYPE_NULL;
+ SMT_TYPE_INT = CVC4_TYPE_NULL;
+ SMT_TYPE_BV32 = CVC4_TYPE_NULL;
+ SMT_TYPE_BV64 = CVC4_TYPE_NULL;
+ SMT_TYPE_REAL = CVC4_TYPE_NULL;
+
+ SMT_TYPE_NUMBER = CVC4_TYPE_NULL;
+
+ SMT_TYPE_STRING = CVC4_TYPE_NULL;
+
+ SMT_CST_BOOL_TRUE = CVC4_EXPR_NULL;
+ SMT_CST_BOOL_FALSE = CVC4_EXPR_NULL;
+
+ SMT_CST_INT_ZERO = CVC4_EXPR_NULL;
+ SMT_CST_INT_ONE = CVC4_EXPR_NULL;
+}
+
+
+/**
+ * CONFIGURE
+ */
+bool CVC4Solver::configure(
+ Configuration & aConfiguration, WObject * wfFilterObject,
+ ListOfPairMachineData & listOfSelectedVariable)
+{
+ if( not SatSolver::configure(
+ aConfiguration, wfFilterObject, listOfSelectedVariable) )
+ {
+ return( false );
+ }
+
+ return( true );
+}
+
+
+
+/**
+ * CREATE - DESTROY
+ * ValidityChecker
+ */
+
+bool CVC4Solver::createChecker()
+{
+// // Set the logic : LINEAR ARITHMETIC
+// mSmtEngine.setLogic("QF_LIRA");
+// // Set the logic : BIT VECTOR
+// mSmtEngine.setLogic("QF_BV");
+
+// // Produce Models
+// mSmtEngine.setOption("produce-models", false);
+//
+// // Enable Multiple Queries
+// mSmtEngine.setOption("incremental", true);
+// //Disable dagifying the output
+// mSmtEngine.setOption("default-dag-thresh", 0);
+// // Set the output-language to CVC's
+// mSmtEngine.setOption("output-language", "cvc4");
+
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ ++SOLVER_SESSION_ID;
+AVM_IF_DEBUG_LEVEL_GTE_HIGH
+ mLogFolderLocation = OSS() << VFS::ProjectLogPath << "/cvc4/";
+
+ if ( not VFS::checkWritingFolder(mLogFolderLocation) )
+ {
+ AVM_OS_LOG << " CVC4Solver::createChecker :> Error: The folder "
+ << "`" << mLogFolderLocation << "' "
+ << "---> doesn't exist or is not writable !!!"
+ << std::endl << std::endl;
+ return( false );
+ }
+
+ std::string logFileLocation = ( OSS() << mLogFolderLocation
+ << "log_" << SOLVER_SESSION_ID << ".cvc4" );
+
+//CVC3 mSmtEngine.setOption("dump-log", logFileLocation);
+AVM_ENDIF_DEBUG_LEVEL_GTE_HIGH
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+// SMT_TYPE_BOOL = mExprManager.boolType();
+// SMT_TYPE_INT = mExprManager.integerType();
+// SMT_TYPE_BV32 = mExprManager.mkBitVectorType(32);
+// SMT_TYPE_BV64 = mExprManager.mkBitVectorType(64);
+// SMT_TYPE_REAL = mExprManager.realType();
+
+// SMT_TYPE_NUMBER = mExprManager.realType();
+
+// SMT_TYPE_STRING = mExprManager.stringType();
+
+// SMT_CST_BOOL_TRUE = mExprManager.mkConst(true);
+// SMT_CST_BOOL_FALSE = mExprManager.mkConst(false);
+//
+// SMT_CST_INT_ZERO = mExprManager.mkConst(0);
+// SMT_CST_INT_ONE = mExprManager.mkConst(1);
+
+ resetTable();
+
+ return( true );
+}
+
+bool CVC4Solver::destroyChecker()
+{
+ resetTable();
+
+// SMT_TYPE_BOOL = CVC4_TYPE_NULL;
+// SMT_TYPE_INT = CVC4_TYPE_NULL;
+// SMT_TYPE_BV32 = CVC4_TYPE_NULL;
+// SMT_TYPE_BV64 = CVC4_TYPE_NULL;
+// SMT_TYPE_REAL = CVC4_TYPE_NULL;
+
+// SMT_TYPE_NUMBER = CVC4_TYPE_NULL;
+
+// SMT_TYPE_STRING = CVC4_TYPE_NULL;
+
+// SMT_CST_BOOL_TRUE = CVC4_EXPR_NULL;
+// SMT_CST_BOOL_FALSE = CVC4_EXPR_NULL;
+//
+// SMT_CST_INT_ZERO = CVC4_EXPR_NULL;
+// SMT_CST_INT_ONE = CVC4_EXPR_NULL;
+
+// delete( mExprManager );
+// mExprManager = NULL;
+
+ return( true );
+}
+
+bool CVC4Solver::resetTable()
+{
+ base_this_type::resetTable();
+
+ mTableOfParameterExpr.append( CVC4_EXPR_NULL );
+
+ return( true );
+}
+
+
+
+/**
+ * PROVER
+ */
+//bool CVC4Solver::isSubSet(
+// const ExecutionContext & newEC, const ExecutionContext & oldEC)
+//{
+// try
+// {
+// createChecker();
+//
+// CVC4::Expr newFormula;
+// CVC4::Expr oldFormula;
+//
+// // On construit la formule newFormula =
+// // garde_newEC AND
+// // x1 = e1 AND ---- AND xn = en
+// //
+// // et la formule oldFormula =
+// // garde_oldEC AND
+// // x1 = e'1 AND ---- AND xn = e'n AND
+// // e1 = e'1 AND ---- AND en = e'n
+// //
+// edToExprWithVarEquality(newEC.refExecutionData(), newFormula,
+// oldEC.refExecutionData(), oldFormula);
+//
+//AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+// oldEC.writeTraceBeforeExec(AVM_OS_TRACE << TAB);
+// AVM_OS_TRACE << TAB << "Expr: " << oldFormula << std::endl;
+//
+// newEC.writeTraceBeforeExec(AVM_OS_TRACE << TAB);
+// AVM_OS_TRACE << TAB << "Expr: " << newFormula << std::endl;
+//AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+//
+// // ASSERT de newFormula
+// //
+// mSmtEngine.assertFormula(newFormula);
+//
+// // CHECKSAT de oldFormula
+// //
+// // A la place de CHECKSAT on utilise NOT QUERY(NOT oldFormula)
+// //
+// CVC4::Result result = mSmtEngine.query( oldFormula.notExpr() );
+//
+// newFormula = CVC4_EXPR_NULL;
+// oldFormula = CVC4_EXPR_NULL;
+// destroyChecker();
+//
+// // Si not result alors la formule oldFormula est satisfiable
+// return( result != CVC4::Result::VALID );
+// }
+// catch( const CVC4::Exception & ex )
+// {
+// AVM_OS_TRACE << TAB << "*** Exception caught in CVC4Solver::isSubSet: \n"
+// << ex << std::endl;
+// }
+//
+// return( false );
+//}
+
+
+//bool CVC4Solver::isSubSet(
+// const ExecutionContext & newEC, const ExecutionContext & oldEC)
+//{
+// try
+// {
+// createChecker();
+//
+//AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+// AVM_OS_TRACE << std::endl << "new EC: " << newEC.getIdNumber() << std::endl
+// << std::endl << "old EC: " << oldEC.getIdNumber() << std::endl;
+//AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+//
+// // On construit la formule newFormula :
+// // garde_newEC AND
+// // x1 = e1 AND ---- AND xn = en
+// //
+// // et la formule oldFormula :
+// // garde_oldEC AND
+// // x1 = e'1 AND ---- AND xn = e'n AND
+// // e1 = e'1 AND ---- AND en = e'n
+// //
+// CVC4::Expr newFormula;
+// CVC4::Expr oldFormula;
+// edToExprWithVarEquality(newEC.refExecutionData(),
+// newFormula, oldEC.refExecutionData(), oldFormula);
+//
+// if( oldFormula != SMT_CST_BOOL_FALSE )
+// {
+//AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+// oldEC.writeTraceBeforeExec(AVM_OS_TRACE << TAB);
+// AVM_OS_TRACE << TAB << "!!!!!!!!!!!!!!! old Expr: " << oldFormula << std::endl;
+//
+// newEC.writeTraceBeforeExec(AVM_OS_TRACE << TAB);
+// AVM_OS_TRACE << TAB << "!!!!!!!!!!!!!!! new Expr: " << newFormula << std::endl;
+//AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+//
+// CVC4::Expr implyFormula;
+// if( not mTableOfParameterExprForOldFormula.empty() )
+// {
+// // On construit la formule itexists
+// // mTableOfParameterExprForOldFormula oldFormula
+// CVC4::Expr itExistsFormula = mExprManager.mkExpr(
+// CVC4::kind::EXISTS,
+// mExprManager.mkExpr(CVC4::kind::BOUND_VAR_LIST,
+// mTableOfParameterExprForOldFormula),
+// oldFormula);
+//
+// // On construit la formule newFormula => itExistsFormula
+// //
+// implyFormula = mExprManager.mkExpr(
+// CVC4::kind::IMPLIES, newFormula, itExistsFormula);
+// }
+// else
+// {
+// // On construit la formule newFormula => oldFormula
+// //
+// implyFormula = mExprManager.mkExpr(
+// CVC4::kind::IMPLIES, newFormula, oldFormula);
+// }
+
+//AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+// AVM_OS_TRACE << implyFormula;
+//AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+//
+// // On construit la formule forall
+// // mTableOfParameterExprForNewFormula implyFormula
+// Vector< CVC4::Expr > forAllParameterAndVariableList;
+// forAllParameterAndVariableList.append(mTableOfVariableExpr);
+// forAllParameterAndVariableList.append(
+// mTableOfParameterExprForNewFormula);
+// CVC4::Expr forAllFormula = mExprManager.mkExpr(CVC4::kind::FORALL,
+// mExprManager.mkExpr(CVC4::kind::BOUND_VAR_LIST,
+// forAllParameterAndVariableList),
+// implyFormula);
+// AVM_OS_TRACE << TAB << "--> forAllFormula : ";
+// AVM_OS_TRACE << forAllFormula;
+//
+// // QUERY de forAllFormula
+// //
+// CVC4::Result result = mSmtEngine.query( forAllFormula );
+//
+// newFormula = CVC4_EXPR_NULL;
+// oldFormula = CVC4_EXPR_NULL;
+// destroyChecker();
+//
+// return( result == CVC4::Result::VALID );
+// }
+// else
+// {
+// AVM_OS_TRACE << TAB << "--> cas oldFormula à false " << std::endl;
+// return( false );
+// }
+// }
+// catch( const CVC4::Exception & ex )
+// {
+// AVM_OS_TRACE << TAB << "*** Exception caught in CVC4Solver::isSubSet: \n"
+// << ex << std::endl;
+// }
+//
+// return( false );
+//}
+
+
+
+bool CVC4Solver::isSubSet(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+{
+ try
+ {
+ createChecker();
+
+AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+ AVM_OS_TRACE << std::endl << "new EC: " << newEC.getIdNumber() << std::endl
+ << std::endl << "old EC: " << oldEC.getIdNumber() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+
+ // On construit la formule newFormula :
+ // garde_newEC AND
+ // x1 = e1 AND ---- AND xn = en
+ //
+ // la formule oldFormula :
+ // garde_oldEC AND
+ // x1 = e'1 AND ---- AND xn = e'n
+ //
+ // et la formule equFormula qui établie l'égalité des mémoires symboliques
+ // e1 = e'1 AND ---- AND en = e'n
+ //
+ CVC4::Expr newFormula;
+ CVC4::Expr oldFormula;
+ CVC4::Expr equFormula;
+ edToExprWithVarEquality(newEC.refExecutionData(), newFormula,
+ oldEC.refExecutionData(), oldFormula,
+ equFormula);
+
+ bool bResult = false;
+
+ if( oldFormula != SMT_CST_BOOL_FALSE )
+ {
+AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+ oldEC.traceDefault(AVM_OS_TRACE << TAB);
+ AVM_OS_TRACE << TAB << "!!!!!!!!!!!!!!! old Expr: " << oldFormula << std::endl;
+
+ newEC.traceDefault(AVM_OS_TRACE << TAB);
+ AVM_OS_TRACE << TAB << "!!!!!!!!!!!!!!! new Expr: " << newFormula << std::endl;
+
+// newEC.writeTraceBeforeExec(AVM_OS_TRACE << TAB);
+// AVM_OS_TRACE << TAB << "!!!!!!!!!!!!!!! equ Expr: " << equFormula << std::endl;
+AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+
+ // Déclaration des variables de mTableOfVariableExpr et
+ // et des paramètres de mTableOfParameterExpr
+ //
+
+ // ASSERT de newFormula
+ //
+ mSmtEngine.assertFormula(newFormula);
+
+ // ASSERT de equFormula
+ //
+// mSmtEngine.assertFormula(equFormula);
+
+ // CHECKSAT de NOT oldFormula
+ //
+ // A la place on utilise NOT QUERY(oldFormula)
+ //
+
+
+
+ CVC4::Result toto = mSmtEngine.query( oldFormula );
+// !!!!!!!!!!!!!!! 271009 : ESSAI AFA temporaire !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+// CVC4::Result toto = mSmtEngine.query(
+// mExprManager.mkExpr(CVC4::kind::NOT, oldFormula) );
+// if(toto == CVC4::SATISFIABLE)
+// {
+// int i = 1;
+// }
+// if(toto == CVC4::INVALID)
+// {
+// int i = 2;
+// }
+
+ bool result = ( toto == CVC4::Result::VALID );
+
+ bResult = ( not result );
+ }
+ else
+ {
+AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+ AVM_OS_TRACE << TAB << "--> cas oldFormula à false " << std::endl;
+AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+ }
+
+ newFormula = CVC4_EXPR_NULL;
+ oldFormula = CVC4_EXPR_NULL;
+ equFormula = CVC4_EXPR_NULL;
+ destroyChecker();
+
+ return( bResult );
+ }
+ catch( const CVC4::Exception & ex )
+ {
+ AVM_OS_TRACE << TAB << "*** Exception caught in CVC4Solver::isSubSet: \n"
+ << ex << std::endl;
+
+ destroyChecker();
+ }
+
+ return( false );
+}
+
+
+void CVC4Solver::edToExprWithVarEquality(const ExecutionData & newED,
+ CVC4::Expr & newFormula, const ExecutionData & oldED,
+ CVC4::Expr & oldFormula, CVC4::Expr & equFormula)
+{
+// AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mSmtEngine ) << "ValidityChecker !!!"
+// << SEND_EXIT;
+
+ std::vector< CVC4::Expr > newFormulaList;
+ std::vector< CVC4::Expr > oldFormulaList;
+ std::vector< CVC4::Expr > equFormulaList;
+
+ resetTable();
+
+ // compile PCs
+ CVC4::Expr aPC;
+
+// m_pTableOfParameterExpr = &mTableOfParameterExprForNewFormula;
+ newFormulaList.push_back( aPC =
+ safe_from_baseform(newED.getPathCondition()) );
+
+AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+ AVM_OS_TRACE << std::endl << "new PC: " << aPC << std::endl;
+AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+
+// m_pTableOfParameterExpr = NULL;
+ oldFormulaList.push_back( aPC =
+ safe_from_baseform(oldED.getPathCondition()) );
+
+AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+ AVM_OS_TRACE << "old PC: " << aPC << std::endl;
+AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+
+ InstanceOfData * aVar = NULL;
+ BaseTypeSpecifier * varTypeSpecifier = NULL;
+
+ // compile DATAs
+ std::ostringstream oss;
+ ListOfInstanceOfData::iterator itVar;
+ ListOfInstanceOfData::iterator endVar;
+
+ ListOfPairMachineData::iterator itPairMachineData = getSelectedVariable().begin();
+ ListOfPairMachineData::iterator endPairMachineData = getSelectedVariable().end();
+ avm_offset_t varID = 1;
+ for( ; itPairMachineData != endPairMachineData ; ++itPairMachineData )
+ {
+ if( (*itPairMachineData).second().nonempty() )
+ {
+ const RuntimeForm & newRF = newED.getRuntime(
+ (*itPairMachineData).first() );
+ const RuntimeForm & oldRF = oldED.getRuntime(
+ (*itPairMachineData).first() );
+
+ itVar = (*itPairMachineData).second().begin();
+ endVar = (*itPairMachineData).second().end();
+ for( ; itVar != endVar ; ++itVar , ++varID )
+ {
+ //??? TABLEAUX
+ aVar = newRF.rawVariable((*itVar)->getOffset());
+ varTypeSpecifier = aVar->getTypeSpecifier();
+
+ oss.str("");
+ oss << "V_" << varID;
+
+// m_pTableOfParameterExpr = &mTableOfParameterExprForNewFormula;
+ CVC4::Expr newValue = safe_from_baseform(
+ newRF.getData(*itVar), varTypeSpecifier);
+// m_pTableOfParameterExpr = NULL;
+ CVC4::Expr oldValue = safe_from_baseform(
+ oldRF.getData(*itVar), varTypeSpecifier);
+
+AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+ AVM_OS_TRACE << varTypeSpecifier->strT() << " "
+ << (*itVar)->getNameID() << " --> " << oss.str()
+ << std::endl << "\told: " << oldValue << "\tnew: " << newValue;
+AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+
+
+ if( varTypeSpecifier->isTypedBoolean() )
+ {
+ const BF & newElement = newRF.getData(*itVar);
+ const BF & oldElement = oldRF.getData(*itVar);
+ if( newElement.isBoolean() && oldElement.isBoolean() )
+ {
+ // On rajoute l'équivalence entre la nouvelle valeur
+ // symbolique et l'ancienne
+// equFormulaList.push_back( mExprManagermkExpr(
+// CVC4::kind::EQUAL, newValue, oldValue) );
+ oldFormulaList.push_back(
+ (newElement.toBoolean() == oldElement.toBoolean()) ?
+ SMT_CST_BOOL_TRUE : SMT_CST_BOOL_FALSE );
+
+ if( newElement.toBoolean() != oldElement.toBoolean() )
+ {
+ oldFormula = SMT_CST_BOOL_FALSE;
+ resetTable();
+ return;
+ }
+ }
+ else
+ {
+ CVC4::Expr varExpr =
+ mExprManager.mkVar(oss.str(), SMT_TYPE_BOOL);
+ mTableOfVariableExpr.push_back( varExpr );
+
+ newFormulaList.push_back( mExprManager.mkExpr(
+ CVC4::kind::EQUAL, varExpr, newValue) );
+ oldFormulaList.push_back( mExprManager.mkExpr(
+ CVC4::kind::EQUAL, varExpr, oldValue) );
+ }
+ }
+ else if( varTypeSpecifier->weaklyTypedInteger() ||
+ varTypeSpecifier->isTypedEnum() ||
+ varTypeSpecifier->isTypedMachine() )
+ {
+ const BF & newElement = newRF.getData(*itVar);
+ const BF & oldElement = oldRF.getData(*itVar);
+ if ( newElement.isNumeric() && oldElement.isNumeric() )
+ {
+ // On rajoute l'égalité entre la nouvelle valeur
+ // symbolique et l'ancienne
+// equFormulaList.push_back( mExprManager.mkExpr(
+// CVC4::kind::EQUAL, newValue, oldValue) );
+
+ oldFormulaList.push_back(
+ (ExpressionComparer::isEQ(newElement, oldElement)) ?
+ SMT_CST_BOOL_TRUE : SMT_CST_BOOL_FALSE );
+
+ if( ExpressionComparer::isNEQ(newElement, oldElement) )
+ {
+ oldFormula = SMT_CST_BOOL_FALSE;
+ resetTable();
+ return;
+ }
+ }
+ else
+ {
+ CVC4::Expr varExpr =
+ mExprManager.mkVar(oss.str(), SMT_TYPE_INT);
+ mTableOfVariableExpr.push_back( varExpr );
+
+ newFormulaList.push_back( mExprManager.mkExpr(
+ CVC4::kind::EQUAL, varExpr, newValue) );
+
+ oldFormulaList.push_back( mExprManager.mkExpr(
+ CVC4::kind::EQUAL, varExpr, oldValue) );
+ }
+ }
+ else if( varTypeSpecifier->weaklyTypedReal() )
+ {
+ const BF & newElement = newRF.getData(*itVar);
+ const BF & oldElement = oldRF.getData(*itVar);
+ if ( newElement.isNumeric() && oldElement.isNumeric() )
+ {
+ // On rajoute l'égalité entre la nouvelle valeur
+ // symbolique et l'ancienne
+// equFormulaList.push_back( mExprManager.mkExpr(
+// CVC4::kind::EQUAL, newValue, oldValue) );
+
+ oldFormulaList.push_back(
+ (ExpressionComparer::isEQ(newElement, oldElement)) ?
+ SMT_CST_BOOL_TRUE : SMT_CST_BOOL_FALSE );
+
+ if( ExpressionComparer::isNEQ(newElement, oldElement) )
+ {
+ oldFormula = SMT_CST_BOOL_FALSE;
+ resetTable();
+ return;
+ }
+ }
+ else
+ {
+ CVC4::Expr varExpr =
+ mExprManager.mkVar(oss.str(), SMT_TYPE_REAL);
+ mTableOfVariableExpr.push_back( varExpr );
+
+ newFormulaList.push_back( mExprManager.mkExpr(
+ CVC4::kind::EQUAL, varExpr, newValue) );
+
+ oldFormulaList.push_back( mExprManager.mkExpr(
+ CVC4::kind::EQUAL, varExpr, oldValue) );
+ }
+ }
+ else
+ {
+ AVM_OS_ERROR_ALERT << "Unexpected an instance type << "
+ << aVar->getFullyQualifiedNameID() << " as : " << oss.str() << " : "
+ << varTypeSpecifier->getFullyQualifiedNameID() << ">> !!!"
+ << SEND_ALERT;
+
+ CVC4::Expr varExpr =
+ mExprManager.mkVar(oss.str(), SMT_TYPE_REAL);
+ mTableOfVariableExpr.push_back( varExpr );
+
+ newFormulaList.push_back( mExprManager.mkExpr(
+ CVC4::kind::EQUAL, varExpr, newValue) );
+
+ oldFormulaList.push_back( mExprManager.mkExpr(
+ CVC4::kind::EQUAL, varExpr, oldValue) );
+ }
+ }
+ }
+ }
+
+ Vector< CVC4::Expr >::iterator it = mTableOfParameterExpr.begin();
+ for( ; it != mTableOfParameterExpr.end() ; ++it )
+ {
+ if( not mTableOfParameterExprForNewFormula.contains( *it ) )
+ {
+ mTableOfParameterExprForOldFormula.append( *it );
+ }
+ }
+
+// oldFormula = mSmtEngine.simplify(
+// mExprManager.mkExpr(CVC4::kind::AND, oldFormulaList) );
+//
+// newFormula = mSmtEngine.simplify(
+// mExprManager.mkExpr(CVC4::kind::AND, newFormulaList) );
+
+// Temporaire pour trace : remplacer ensuite par les 2 égalités précédentes
+ CVC4::Expr oldFormulAvantSimplfy =
+ mExprManager.mkExpr(CVC4::kind::AND, oldFormulaList);
+
+AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+ AVM_OS_TRACE << std::endl << "oldFormula avant simplify : "
+ << oldFormulAvantSimplfy << std::endl;
+AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+
+ oldFormula = mSmtEngine.simplify( oldFormulAvantSimplfy );
+
+AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+ AVM_OS_TRACE << "oldFormula après simplify : "
+ << oldFormula << std::endl;
+AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+
+
+ CVC4::Expr newFormulAvantSimplfy =
+ mExprManager.mkExpr(CVC4::kind::AND, newFormulaList);
+
+AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+ AVM_OS_TRACE << std::endl << "newFormula avant simplify : "
+ << newFormulAvantSimplfy << std::endl;
+AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+
+ newFormula = mSmtEngine.simplify( newFormulAvantSimplfy );
+
+AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+ AVM_OS_TRACE << "newFormula après simplify : "
+ << newFormula << std::endl;
+AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+
+// CVC4::Expr equFormulAvantSimplfy = mExprManager.mkExpr(CVC4::kind::AND, equFormulaList);
+//AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+// AVM_OS_TRACE << std::endl << "equFormula avant simplify : ";
+// << equFormulAvantSimplfy << std::endl;
+//AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+// equFormula = mSmtEngine.simplify( equFormulAvantSimplfy );
+
+ resetTable();
+}
+
+
+
+bool CVC4Solver::isEqualSet(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+{
+ try
+ {
+ createChecker();
+
+ CVC4::Expr newFormula;
+ CVC4::Expr oldFormula;
+
+ edToExpr(newEC.refExecutionData(), newFormula,
+ oldEC.refExecutionData(), oldFormula);
+
+AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+ oldEC.traceDefault(AVM_OS_TRACE << TAB);
+ AVM_OS_TRACE << TAB << "Expr: " << oldFormula << std::endl;
+
+ newEC.traceDefault(AVM_OS_TRACE << TAB);
+ AVM_OS_TRACE << TAB << "Expr: " << newFormula << std::endl;
+AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+
+// CVC4::Expr equalTest = mExprManager.mkExpr(CVC4::kind::FORALL,
+// mExprManager.mkExpr(CVC4::kind::BOUND_VAR_LIST, mTableOfVariableExpr),
+// mExprManager.mkExpr(CVC4::kind::EXISTS,
+// mExprManager.mkExpr(CVC4::kind::BOUND_VAR_LIST, mTableOfParameterExpr),
+// mExprManager.mkExpr(CVC4::kind::EQUAL, oldFormula, newFormula)));
+//
+// CVC4::Expr equalTest = mExprManager.mkExpr(CVC4::kind::EXISTS,
+// mTableOfParameterExpr,
+// mExprManager.mkExpr(CVC4::kind::EQUAL,
+// oldFormula, newFormula));
+
+ CVC4::Expr equalTest = mExprManager.mkExpr(CVC4::kind::EQUAL,
+ oldFormula, newFormula);
+
+AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+ AVM_OS_TRACE << TAB << "isSubSet Expr: " << equalTest << std::endl;
+AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+
+ CVC4::Result result = mSmtEngine.query(equalTest);
+
+AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+ AVM_OS_TRACE << TAB << "\nisEqual result : "
+ << TAB << ( (result.isValid() == CVC4::Result::VALID) ?
+ "true" : "false" ) << std::endl << std::endl;
+AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+
+ newFormula = CVC4_EXPR_NULL;
+ oldFormula = CVC4_EXPR_NULL;
+ destroyChecker();
+
+ return( result == CVC4::Result::VALID );
+ }
+ catch( const CVC4::Exception & ex )
+ {
+ AVM_OS_TRACE << TAB << "*** Exception caught in CVC4Solver::isEqualSet: \n"
+ << ex << std::endl;
+
+ destroyChecker();
+ }
+
+ return( false );
+}
+
+
+SolverDef::SATISFIABILITY_RING CVC4Solver::isSatisfiable(const BF & aCondition)
+{
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << "CVC4Solver::isSatisfiable(...) "
+ ":" << SOLVER_SESSION_ID << ">" << std::endl
+ << "\t" << aCondition.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ if( aCondition.isBoolean() )
+ {
+AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+ AVM_OS_TRACE << TAB << "is satisfiable : " << aCondition.str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+
+ return( aCondition.toBoolean() ?
+ SolverDef::SATISFIABLE : SolverDef::UNSATISFIABLE );
+ }
+
+ if( aCondition.isFloat() )
+ {
+AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+ AVM_OS_TRACE << TAB << "is satisfiable : " << aCondition.str() << std::endl;
+AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+
+ return( ( aCondition.toFloat() != 0 ) ?
+ SolverDef::SATISFIABLE : SolverDef::UNSATISFIABLE );
+ }
+
+
+ try
+ {
+ createChecker();
+
+ // compile Formula
+ CVC4::Expr aFormula= safe_from_baseform( aCondition );
+
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << "CVC4Condition :" << SOLVER_SESSION_ID << ">" << std::endl;
+ AVM_IF_DEBUG_LEVEL_GTE_HIGH
+ AVM_OS_TRACE << "\t";
+ aFormula.printAst(AVM_OS_TRACE);
+ AVM_OS_TRACE << std::endl;
+ AVM_ENDIF_DEBUG_LEVEL_GTE_HIGH
+ AVM_OS_TRACE << "\t" << aFormula << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ CVC4::Result result = mSmtEngine.checkSat( aFormula );
+
+ // ATTENTION : lorsque CVC4 répond UNKNOWN,
+ // on considère que la garde est SATISFIABLE
+ SolverDef::SATISFIABILITY_RING satisfiability = SolverDef::SATISFIABLE;
+
+ switch( result.isSat() )
+ {
+ case CVC4::Result::SAT:
+ //case CVC4::VALID:
+ {
+ satisfiability = SolverDef::SATISFIABLE;
+ break;
+ }
+
+ case CVC4::Result::UNSAT:
+ //case CVC4::INVALID:
+ {
+ satisfiability = SolverDef::UNSATISFIABLE;
+ break;
+ }
+
+ case CVC4::Result::SAT_UNKNOWN:
+ {
+ satisfiability = SolverDef::UNKNOWN_SAT;
+ break;
+ }
+
+// case CVC4::Result::ABORT:
+ default:
+ {
+ satisfiability = SolverDef::ABORT_SAT;
+ break;
+ }
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << "result :" << SOLVER_SESSION_ID << "> "
+ << SolverDef::strSatisfiability(satisfiability) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ aFormula = CVC4_EXPR_NULL;
+ destroyChecker();
+
+ return( satisfiability );
+ }
+ catch ( const CVC4::Exception & ex )
+ {
+ AVM_OS_WARN << std::endl << REPEAT("********", 10) << std::endl
+ << "\tCVC4Solver::isSatisfiable< CVC4::Exception :"
+ << SOLVER_SESSION_ID << ">\n\t" << ex << std::endl
+ << REPEAT("--------", 10) << std::endl
+ << "\t " << aCondition.str() << std::endl
+ << REPEAT("********", 10) << std::endl;
+
+ destroyChecker();
+
+ return( SolverDef::UNKNOWN_SAT );
+ }
+ catch ( const std::exception & ex )
+ {
+ AVM_OS_WARN << std::endl << REPEAT("********", 10) << std::endl
+ << "\tCVC4Solver::isSatisfiable< std::exception :"
+ << SOLVER_SESSION_ID << ">\n\t" << ex.what() << std::endl
+ << REPEAT("--------", 10) << std::endl
+ << "\t " << aCondition.str() << std::endl
+ << REPEAT("********", 10) << std::endl;
+
+ destroyChecker();
+
+ return( SolverDef::UNKNOWN_SAT );
+ }
+ catch ( ... )
+ {
+ AVM_OS_WARN << std::endl << REPEAT("********", 10) << std::endl
+ << "\tCVC4Solver::isSatisfiable< unknown::exception :"
+ << SOLVER_SESSION_ID << ">" << std::endl
+ << REPEAT("--------", 10) << std::endl
+ << "\t " << aCondition.str() << std::endl
+ << REPEAT("********", 10) << std::endl;
+
+ destroyChecker();
+
+ return( SolverDef::UNKNOWN_SAT );
+ }
+
+ return( SolverDef::UNKNOWN_SAT );
+}
+
+
+
+/**
+ * SOLVER
+ */
+bool CVC4Solver::solveImpl(const BF & aCondition,
+ BFVector & dataVector, BFVector & valuesVector)
+{
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << "CVC4Solver::solve(...) "
+ ":" << SOLVER_SESSION_ID << ">" << std::endl
+ << "\t" << aCondition.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ try
+ {
+ // Produce Models option --> true
+ createChecker( );
+
+ resetTable();
+
+ // compile Formula
+ CVC4::Expr aFormula = safe_from_baseform( aCondition );
+
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << "CVC4Condition :" << SOLVER_SESSION_ID << ">" << std::endl;
+ AVM_IF_DEBUG_LEVEL_GTE_HIGH
+ AVM_OS_TRACE << "\t";
+ aFormula.printAst(AVM_OS_TRACE);
+ AVM_OS_TRACE << std::endl;
+ AVM_ENDIF_DEBUG_LEVEL_GTE_HIGH
+ AVM_OS_TRACE << "\t" << aFormula << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+
+ CVC4::Result result = mSmtEngine.checkSat( aFormula );
+
+ if( result.isSat() == CVC4::Result::SAT )
+ {
+// CVC4::Model * concreteModel = mSmtEngine.getModel();
+
+ for( std::size_t i = 1 ; i < mTableOfParameterInstance.size() ; ++i )
+ {
+ dataVector.append( mTableOfParameterInstance[i] );
+
+ const CVC4::Expr & var = mTableOfParameterExpr[i];
+ CVC4::Expr val = mSmtEngine.getValue(var);
+
+ if( val == SMT_CST_BOOL_TRUE )
+ {
+ valuesVector.append( ExpressionConstant::BOOLEAN_TRUE );
+ }
+ else if( val == SMT_CST_BOOL_FALSE )
+ {
+ valuesVector.append( ExpressionConstant::BOOLEAN_FALSE );
+ }
+ else if( val.getKind() == CVC4::kind::CONST_RATIONAL )
+ {
+ CVC4::Rational rat = val.getConst< CVC4::Rational >();
+
+#if defined( _AVM_BUILTIN_NUMERIC_GMP_ )
+
+ if( rat.isIntegral() )
+ {
+ valuesVector.append( ExpressionConstructor::newInteger(
+ rat.getNumerator().get_mpz() ) );
+ }
+ else // C'est un rationel (num/den)
+ {
+ valuesVector.append(
+ ExpressionConstructor::newRational(
+ rat.get_mpq() ) );
+ }
+
+#else
+
+ if( rat.isIntegral() )
+ {
+ if( rat.sgn() > 0 )
+ {
+ valuesVector.append( ExpressionConstructor::newUInteger(
+ rat.getNumerator().getUnsignedLong()) );
+ }
+ else
+ {
+ valuesVector.append( ExpressionConstructor::newInteger(
+ rat.getNumerator().getLong()) );
+ }
+ }
+ else // C'est un rationel (num/den)
+ {
+ valuesVector.append(
+ ExpressionConstructor::newRational(
+ static_cast< avm_integer_t >(
+ rat.getNumerator().getLong() ),
+ static_cast< avm_integer_t >(
+ rat.getDenominator().getLong() ) ) );
+ }
+
+#endif /* _AVM_BUILTIN_NUMERIC_GMP_ */
+
+ }
+ else
+ {
+ valuesVector.append( dataVector.back() );
+
+ }
+
+AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+ AVM_OS_TRACE << mTableOfParameterInstance.rawAt( i )->getFullyQualifiedNameID()
+ << " --> " << var << " = " << val << std::endl;
+// AVM_OS_COUT<< mTableOfParameterInstance.rawAt( i )->getFullyQualifiedNameID()
+// << " --> " << var << " = " << val << std::endl;
+AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+ }
+ }
+
+ aFormula = CVC4_EXPR_NULL;
+ destroyChecker();
+
+ return( result.isSat() == CVC4::Result::SAT );
+ }
+ catch ( const CVC4::Exception & ex )
+ {
+ AVM_OS_WARN << std::endl << REPEAT("********", 10) << std::endl
+ << "\tCVC4Solver::solve< CVC4::Exception :"
+ << SOLVER_SESSION_ID << ">\n\t" << ex << std::endl
+ << REPEAT("--------", 10) << std::endl
+ << "\t " << aCondition.str() << std::endl
+ << REPEAT("********", 10) << std::endl;
+
+ destroyChecker();
+
+ return( false );
+ }
+ catch ( const std::exception & ex )
+ {
+ AVM_OS_WARN << std::endl << REPEAT("********", 10) << std::endl
+ << "\tCVC4Solver::solve< std::exception :"
+ << SOLVER_SESSION_ID << ">\n\t" << ex.what() << std::endl
+ << REPEAT("--------", 10) << std::endl
+ << "\t " << aCondition.str() << std::endl
+ << REPEAT("********", 10) << std::endl;
+
+ destroyChecker();
+
+ return( false );
+ }
+ catch ( ... )
+ {
+ AVM_OS_WARN << std::endl << REPEAT("********", 10) << std::endl
+ << "\tCVC4Solver::solve< unknown::exception :"
+ << SOLVER_SESSION_ID << ">" << std::endl
+ << REPEAT("--------", 10) << std::endl
+ << "\t " << aCondition.str() << std::endl
+ << REPEAT("********", 10) << std::endl;
+
+ destroyChecker();
+
+ return( false );
+ }
+
+ return( false );
+}
+
+
+/**
+ * TOOLS
+ */
+
+void CVC4Solver::edToExpr(
+ const ExecutionData & newED, CVC4::Expr & newFormula,
+ const ExecutionData & oldED, CVC4::Expr & oldFormula)
+{
+// AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mSmtEngine ) << "ValidityChecker !!!"
+// << SEND_EXIT;
+
+ resetTable();
+
+ // compile PCs
+ CVC4::Expr aPC;
+ std::vector< CVC4::Expr > newFormulaList;
+ newFormulaList.push_back( aPC = safe_from_baseform(newED.getPathCondition()) );
+
+AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+ AVM_OS_TRACE << std::endl << "new PC: " << aPC << std::endl;
+AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+
+ std::vector< CVC4::Expr > oldFormulaList;
+ oldFormulaList.push_back( aPC = safe_from_baseform(oldED.getPathCondition()) );
+
+AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+ AVM_OS_TRACE << "old PC: " << aPC << std::endl;
+AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+
+ InstanceOfData * aVar = NULL;
+ BaseTypeSpecifier * varTypeSpecifier = NULL;
+
+ // compile DATAs
+ std::ostringstream oss;
+ ListOfInstanceOfData::iterator itVar;
+ ListOfInstanceOfData::iterator endVar;
+
+ ListOfPairMachineData::iterator itPairMachineData = getSelectedVariable().begin();
+ ListOfPairMachineData::iterator endPairMachineData = getSelectedVariable().end();
+ avm_offset_t varID = 1;
+ for( ; itPairMachineData != endPairMachineData ; ++itPairMachineData )
+ {
+ if( (*itPairMachineData).second().nonempty() )
+ {
+ const RuntimeForm & newRF = newED.getRuntime(
+ (*itPairMachineData).first() );
+ const RuntimeForm & oldRF = oldED.getRuntime(
+ (*itPairMachineData).first() );
+
+ itVar = (*itPairMachineData).second().begin();
+ endVar = (*itPairMachineData).second().end();
+ for( ; itVar != endVar ; ++itVar , ++varID )
+ {
+ //??? TABLEAUX
+ aVar = newRF.rawVariable((*itVar)->getOffset());
+ varTypeSpecifier = aVar->getTypeSpecifier();
+
+ oss.str("");
+ oss << "V_" << varID;
+
+ CVC4::Expr newValue = safe_from_baseform(
+ newRF.getData(*itVar), varTypeSpecifier);
+ CVC4::Expr oldValue = safe_from_baseform(
+ oldRF.getData(*itVar), varTypeSpecifier);
+
+ if( varTypeSpecifier->isTypedBoolean() )
+ {
+ CVC4::Expr varExpr =
+ mExprManager.mkVar(oss.str(), SMT_TYPE_BOOL);
+ mTableOfVariableExpr.push_back( varExpr );
+ newFormulaList.push_back( mExprManager.mkExpr(
+ CVC4::kind::EQUAL, varExpr, newValue) );
+ oldFormulaList.push_back( mExprManager.mkExpr(
+ CVC4::kind::EQUAL,varExpr, oldValue) );
+ }
+ else if( varTypeSpecifier->weaklyTypedInteger() ||
+ varTypeSpecifier->isTypedEnum() )
+ {
+ CVC4::Expr varExpr =
+ mExprManager.mkVar(oss.str(), SMT_TYPE_INT);
+ mTableOfVariableExpr.push_back( varExpr );
+ newFormulaList.push_back( mExprManager.mkExpr(
+ CVC4::kind::EQUAL, varExpr, newValue) );
+ oldFormulaList.push_back( mExprManager.mkExpr(
+ CVC4::kind::EQUAL, varExpr, oldValue) );
+ }
+ else if( varTypeSpecifier->weaklyTypedReal() )
+ {
+ CVC4::Expr varExpr =
+ mExprManager.mkVar(oss.str(), SMT_TYPE_REAL);
+ mTableOfVariableExpr.push_back( varExpr );
+ newFormulaList.push_back( mExprManager.mkExpr(
+ CVC4::kind::EQUAL, varExpr, newValue) );
+ oldFormulaList.push_back( mExprManager.mkExpr(
+ CVC4::kind::EQUAL, varExpr, oldValue) );
+ }
+ else
+ {
+ AVM_OS_ERROR_ALERT << "Unexpected an instance type << "
+ << aVar->getFullyQualifiedNameID() << " as : " << oss.str() << " : "
+ << varTypeSpecifier->getFullyQualifiedNameID() << ">> !!!"
+ << SEND_ALERT;
+
+ CVC4::Expr varExpr = mExprManager.mkVar(oss.str(), SMT_TYPE_REAL);
+ mTableOfVariableExpr.push_back( varExpr );
+ newFormulaList.push_back( mExprManager.mkExpr(
+ CVC4::kind::EQUAL, varExpr, newValue) );
+ oldFormulaList.push_back( mExprManager.mkExpr(
+ CVC4::kind::EQUAL, varExpr, oldValue) );
+ }
+ }
+ }
+ }
+
+ oldFormula = mSmtEngine.simplify(
+ mExprManager.mkExpr(CVC4::kind::AND, oldFormulaList) );
+
+ newFormula = mSmtEngine.simplify(
+ mExprManager.mkExpr(CVC4::kind::AND, newFormulaList) );
+
+
+ resetTable();
+}
+
+
+/*
+CVC4::Expr CVC4Solver::edToExpr(const ExecutionData & anED)
+{
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mSmtEngine ) << "ValidityChecker !!!"
+ << SEND_EXIT;
+
+//AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+// AVM_OS_TRACE << TAB << "edToExpr ED: \n";
+// anED.toStreamData(AVM_OS_TRACE, "\t");
+// AVM_OS_TRACE << std::flush;
+//AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+
+ resetTable();
+
+ // compile PC
+ CVC4::Expr pcExpr = mSmtEngine.simplify(safe_from_baseform(anED.getPathCondition()));
+AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+ AVM_OS_TRACE << TAB << "\nPC: " << pcExpr << std::endl;
+AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+ mSmtEngine.assertFormula( pcExpr );
+
+ std::vector< CVC4::Expr > aFormulaList;
+ InstanceOfData * aVar = NULL;
+ BaseTypeSpecifier * varTypeSpecifier = NULL;
+ ListOfInstanceOfData::iterator itVar;
+
+ // compile DATA
+ ListOfListOfInstanceOfData::iterator itPairMachineData =
+ getSelectedVariable()->begin();
+ for( ; itPairMachineData != getSelectedVariable()->end() ; ++itPairMachineData )
+ {
+ if( (*itPairMachineData).second().nonempty() )
+ {
+ itVar = (*itPairMachineData).begin();
+ RuntimeForm * aRF = anED.get(*itVar);
+
+ for( ; itVar != (*itPairMachineData).end() ; ++itVar )
+ {
+ aVar = aRF.getExecutable()->getBasicData((*itVar)->getOffset());
+ varTypeSpecifier = aVar->getTypeSpecifier();
+
+ if( varTypeSpecifier->isTypedBoolean() )
+ {
+ aFormulaList.push_back( safe_from_baseform(
+ aRF.getData(*itVar), varTypeSpecifier) );
+ }
+ else if( varTypeSpecifier->weaklyTypedInteger() ||
+ varTypeSpecifier->isTypedEnum() )
+ {
+ aFormulaList.push_back( safe_from_baseform(
+ aRF.getData(*itVar), varTypeSpecifier) );
+ }
+ else if( varTypeSpecifier->weaklyTypedReal() )
+ {
+ aFormulaList.push_back( safe_from_baseform(
+ aRF.getData(*itVar), varTypeSpecifier) );
+ }
+ else
+ {
+ AVM_OS_ERROR_ALERT << "Unexpected an instance type << "
+ << aVar->getFullyQualifiedNameID() " : "
+ << varTypeSpecifier->getFullyQualifiedNameID() << ">> !!!"
+ << SEND_ALERT;
+
+ aFormulaList.push_back( safe_from_baseform(
+ aRF.getData(*itVar), varTypeSpecifier) );
+ }
+ }
+ }
+ }
+
+ CVC4::Expr edExpr = mExprManager.mkExpr(CVC4::kind::TUPLE, aFormulaList);
+
+AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+ AVM_OS_TRACE << TAB << "Expr: ";
+ AVM_OS_TRACE << edExpr << std::endl;
+AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+
+ resetTable();
+
+ return( edExpr );
+}
+
+*/
+
+
+CVC4::Expr CVC4Solver::edToExpr(const ExecutionData & anED)
+{
+// AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mSmtEngine ) << "ValidityChecker !!!"
+// << SEND_EXIT;
+
+//AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+// AVM_OS_TRACE << TAB << "edToExpr ED: \n";
+// anED.toStreamData(AVM_OS_TRACE, "\t");
+// AVM_OS_TRACE << std::flush;
+//AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+
+ resetTable();
+
+ std::vector< CVC4::Expr > aFormulaList;
+
+ // compile PC
+ aFormulaList.push_back( safe_from_baseform(anED.getPathCondition()) );
+
+ BaseTypeSpecifier * varTypeSpecifier = NULL;
+ ListOfInstanceOfData::iterator itVar;
+ ListOfInstanceOfData::iterator endVar;
+
+ // compile DATA
+ ListOfPairMachineData::iterator itPairMachineData = getSelectedVariable().begin();
+ ListOfPairMachineData::iterator endPairMachineData = getSelectedVariable().end();
+ avm_offset_t varID = 0;
+ for( ; itPairMachineData != endPairMachineData ; ++itPairMachineData )
+ {
+ if( (*itPairMachineData).second().nonempty() )
+ {
+ const RuntimeForm & aRF = anED.getRuntime(
+ (*itPairMachineData).first() );
+
+ itVar = (*itPairMachineData).second().begin();
+ endVar = (*itPairMachineData).second().end();
+ for( ; itVar != endVar ; ++itVar , ++varID )
+ {
+ //??? TABLEAUX
+ InstanceOfData * aVar = aRF.rawVariable((*itVar)->getOffset());
+
+ varTypeSpecifier = aVar->getTypeSpecifier();
+
+ if( varTypeSpecifier->isTypedBoolean() )
+ {
+ aFormulaList.push_back( mExprManager.mkExpr(CVC4::kind::EQUAL,
+ getVariableExpr(aVar, SMT_TYPE_BOOL, varID),
+ safe_from_baseform(aRF.getData(*itVar),
+ varTypeSpecifier)) );
+ }
+ else if( varTypeSpecifier->weaklyTypedInteger() ||
+ varTypeSpecifier->isTypedEnum() )
+ {
+ aFormulaList.push_back( mExprManager.mkExpr(CVC4::kind::EQUAL,
+ getVariableExpr(aVar, SMT_TYPE_INT, varID),
+ safe_from_baseform(aRF.getData(*itVar),
+ varTypeSpecifier)) );
+ }
+ else if( varTypeSpecifier->weaklyTypedReal() )
+ {
+ aFormulaList.push_back( mExprManager.mkExpr(CVC4::kind::EQUAL,
+ getVariableExpr(aVar, SMT_TYPE_REAL, varID),
+ safe_from_baseform(aRF.getData(*itVar),
+ varTypeSpecifier)) );
+ }
+ else
+ {
+ AVM_OS_ERROR_ALERT << "Unexpected an instance type << "
+ << aVar->getFullyQualifiedNameID() << " : "
+ << varTypeSpecifier->getFullyQualifiedNameID() << ">> !!!"
+ << SEND_ALERT;
+
+ aFormulaList.push_back( mExprManager.mkExpr(CVC4::kind::EQUAL,
+ getVariableExpr(aVar, SMT_TYPE_REAL, varID),
+ safe_from_baseform(aRF.getData(*itVar),
+ varTypeSpecifier)) );
+ }
+ }
+ }
+ }
+
+ CVC4::Expr edExpr = mExprManager.mkExpr(CVC4::kind::EXISTS,
+ mExprManager.mkExpr(
+ CVC4::kind::BOUND_VAR_LIST, mTableOfParameterExpr),
+ mSmtEngine.simplify(
+ mExprManager.mkExpr(CVC4::kind::AND, aFormulaList)) );
+
+AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+ AVM_OS_TRACE << TAB << "Expr: ";
+ AVM_OS_TRACE << edExpr << std::endl;
+AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+
+ resetTable();
+
+ return( edExpr );
+}
+
+
+CVC4::Expr & CVC4Solver::getParameterExpr(const BF & bfParameter)
+{
+ InstanceOfData * aParameter = bfParameter.to_ptr< InstanceOfData >();
+
+ if( aParameter->getMark() == 0 )
+ {
+ BaseTypeSpecifier * paramTypeSpecifier =
+ aParameter->referedTypeSpecifier();
+
+ CVC4::Type paramType;
+
+ if( paramTypeSpecifier->isTypedBoolean() )
+ {
+ paramType = SMT_TYPE_BOOL;
+ }
+ else if( paramTypeSpecifier->weaklyTypedInteger() )
+ {
+ if( SolverDef::DEFAULT_SOLVER_KIND ==
+ SolverDef::SOLVER_CVC4_BV32_KIND )
+ {
+ paramType = SMT_TYPE_BV32;
+ }
+ else
+// if( SolverDef::DEFAULT_SOLVER_KIND ==
+// SolverDef::SOLVER_CVC4_KIND )
+ {
+ paramType = SMT_TYPE_INT;
+ }
+// else
+// {
+// AVM_OS_FATAL_ERROR_EXIT
+// << "SolverDef::DEFAULT_SOLVER_KIND <> "
+// "CVC4_INT and <> CVC4_BV32 !!!\n"
+// << SEND_EXIT;
+//
+// paramType = SMT_TYPE_INT;
+// }
+ }
+ else if( paramTypeSpecifier->weaklyTypedReal() )
+ {
+ paramType = SMT_TYPE_REAL;
+ }
+ else if( paramTypeSpecifier->isTypedString() )
+ {
+ paramType = SMT_TYPE_STRING;
+ }
+ else if( paramTypeSpecifier->isTypedEnum() )
+ {
+ paramType = SMT_TYPE_INT;
+ // TODO Attention : il faudrait rajouter les contraintes
+ // d'intervalle pour le type énuméré
+ }
+ else if( paramTypeSpecifier->isTypedMachine() )
+ {
+ // TODO:> Consolidation après TEST
+ paramType = SMT_TYPE_INT;
+ }
+ else
+ {
+ AVM_OS_ERROR_ALERT << "Unexpected an instance type << "
+ << aParameter->getFullyQualifiedNameID() << " : "
+ << paramTypeSpecifier->getFullyQualifiedNameID() << ">> !!!"
+ << SEND_ALERT;
+
+ paramType = SMT_TYPE_REAL;
+ }
+
+
+ CVC4::Expr paramExpr = mExprManager.mkVar( OSS() << "P_"
+ << mTableOfParameterInstance.size(), paramType );
+
+//AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+// AVM_OS_TRACE << TAB << "P_" << mTableOfParameterInstance.size()
+// << " <- " << aParameter->getFullyQualifiedNameID() << std::endl;
+// AVM_OS_TRACE << std::flush;
+//AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+
+ aParameter->setMark( mTableOfParameterInstance.size() );
+ mTableOfParameterInstance.append( bfParameter );
+
+ mTableOfParameterExpr.append(paramExpr);
+// if( m_pTableOfParameterExpr != NULL )
+// {
+// m_pTableOfParameterExpr->append(paramExpr);
+// }
+ }
+
+ return( mTableOfParameterExpr[ aParameter->getMark() ] );
+
+}
+
+
+CVC4::Expr & CVC4Solver::getVariableExpr(InstanceOfData * aVar,
+ CVC4::Type varType, avm_offset_t varID)
+{
+ if( mTableOfVariableExpr.size() <= varID )
+ {
+ mTableOfVariableExpr.push_back(
+ mExprManager.mkVar( OSS() << "V_" << varID, varType ) );
+ }
+
+ return( mTableOfVariableExpr.at(varID) );
+}
+
+
+
+CVC4::Expr CVC4Solver::safe_from_baseform(const BF & exprForm,
+ BaseTypeSpecifier * typeSpecifier)
+{
+ try
+ {
+ return( from_baseform(exprForm, typeSpecifier) );
+ }
+ catch ( const CVC4::Exception & ex )
+ {
+ AVM_OS_WARN << std::endl << REPEAT("********", 10) << std::endl
+ << "\tCVC4Solver::safe_from_baseform< CVC4::Exception :"
+ << SOLVER_SESSION_ID << ">\n\t" << ex << std::endl
+ << REPEAT("--------", 10) << std::endl
+ << "\tFailed to CONVERT sep::fml::expression to CVC4::Expr:>" << std::endl
+ << "\t " << exprForm.str() << std::endl
+ << REPEAT("********", 10) << std::endl;
+
+ destroyChecker();
+
+ return( SMT_CST_INT_ZERO );
+ }
+ catch ( const std::exception & ex )
+ {
+ AVM_OS_WARN << std::endl << REPEAT("********", 10) << std::endl
+ << "\tCVC4Solver::safe_from_baseform< std::exception :"
+ << SOLVER_SESSION_ID << ">\n\t" << ex.what() << std::endl
+ << REPEAT("--------", 10) << std::endl
+ << "\tFailed to CONVERT sep::fml::expression to CVC4::Expr:>" << std::endl
+ << "\t " << exprForm.str() << std::endl
+ << REPEAT("********", 10) << std::endl;
+
+ destroyChecker();
+
+ return( SMT_CST_INT_ZERO );
+ }
+ catch ( ... )
+ {
+ AVM_OS_WARN << std::endl << REPEAT("********", 10) << std::endl
+ << "\tCVC4Solver::safe_from_baseform< unknown::exception :"
+ << SOLVER_SESSION_ID << ">" << std::endl
+ << REPEAT("--------", 10) << std::endl
+ << "\tFailed to CONVERT sep::fml::expression to CVC4::Expr:>" << std::endl
+ << "\t " << exprForm.str() << std::endl
+ << REPEAT("********", 10) << std::endl;
+
+ destroyChecker();
+
+ return( SMT_CST_INT_ZERO );
+ }
+
+ return( SMT_CST_INT_ZERO );
+}
+
+CVC4::Expr CVC4Solver::from_baseform(
+ const BF & exprForm, BaseTypeSpecifier * typeSpecifier)
+{
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( exprForm ) << "expression !!!"
+ << SEND_EXIT;
+
+ switch( exprForm.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ AvmCode * aCode = exprForm.to_ptr< AvmCode >();
+
+ typeSpecifier = TypeManager::UNIVERSAL;
+
+ switch( aCode->getAvmOpCode() )
+ {
+ // COMPARISON OPERATION
+ case AVM_OPCODE_EQ:
+ {
+ const BF & arg0 = aCode->first();
+ const BF & arg1 = aCode->second();
+
+ if( ExpressionTypeChecker::isBoolean(arg0) &&
+ ExpressionTypeChecker::isBoolean(arg1) )
+ {
+ return( mExprManager.mkExpr(CVC4::kind::EQUAL,
+ from_baseform(arg0, TypeManager::BOOLEAN),
+ from_baseform(arg1, TypeManager::BOOLEAN)) );
+ }
+ else
+ {
+ return( mExprManager.mkExpr(CVC4::kind::EQUAL,
+ from_baseform(arg0, typeSpecifier),
+ from_baseform(arg1, typeSpecifier)) );
+ }
+ }
+
+ case AVM_OPCODE_NEQ:
+ {
+ const BF & arg0 = aCode->first();
+ const BF & arg1 = aCode->second();
+
+ if( ExpressionTypeChecker::isBoolean(arg0) &&
+ ExpressionTypeChecker::isBoolean(arg1) )
+ {
+ return( mExprManager.mkExpr(CVC4::kind::NOT,
+ mExprManager.mkExpr(CVC4::kind::EQUAL,
+ from_baseform(arg0, TypeManager::BOOLEAN),
+ from_baseform(arg1, TypeManager::BOOLEAN))) );
+ }
+ else
+ {
+ return( mExprManager.mkExpr(CVC4::kind::DISTINCT,
+ from_baseform(arg0, typeSpecifier),
+ from_baseform(arg1, typeSpecifier)) );
+ }
+ }
+
+ case AVM_OPCODE_LT:
+ {
+ if( SolverDef::DEFAULT_SOLVER_KIND ==
+ SolverDef::SOLVER_CVC4_BV32_KIND )
+ {
+ return( mExprManager.mkExpr(CVC4::kind::BITVECTOR_SLT,
+ from_baseform(aCode->first(), typeSpecifier),
+ from_baseform(aCode->second(), typeSpecifier)) );
+ }
+ else
+// if( SolverDef::DEFAULT_SOLVER_KIND ==
+// SolverDef::SOLVER_CVC4_KIND )
+ {
+ return( mExprManager.mkExpr(CVC4::kind::LT,
+ from_baseform(aCode->first(), typeSpecifier),
+ from_baseform(aCode->second(), typeSpecifier)) );
+ }
+ }
+
+ case AVM_OPCODE_LTE:
+ {
+ if( SolverDef::DEFAULT_SOLVER_KIND ==
+ SolverDef::SOLVER_CVC4_BV32_KIND )
+ {
+ CVC4::Expr leftMember;
+ CVC4::Expr rightMember;
+ BFVector rightList;
+ BFVector leftList;
+
+ if( aCode->first().is< AvmCode >() &&
+ ( aCode->first().to_ptr< AvmCode >()->
+ isOpCode( AVM_OPCODE_PLUS ) ) )
+ {
+ AvmCode::iterator it =
+ aCode->first().to_ptr< AvmCode >()->begin();
+ AvmCode::iterator endIt =
+ aCode->first().to_ptr< AvmCode >()->end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).is< AvmCode >() &&
+ ( (*it).to_ptr< AvmCode >()->
+ isOpCode( AVM_OPCODE_UMINUS ) ) )
+ {
+ rightList.append(
+ (*it).to_ptr< AvmCode >()->getArg1() );
+ }
+ else if( (*it).isInteger() &&
+ ( (*it).toInteger() < 0 ) )
+ {
+ rightList.append( ExpressionConstructor::
+ newInteger(- (*it).toInteger()) );
+ }
+ else
+ {
+ leftList.append( (*it) );
+ }
+ }
+ }
+ else if( not ( aCode->first().isInteger() &&
+ ( aCode->first().toInteger() == 0 ) ) )
+ {
+ leftList.append( aCode->first() );
+ }
+
+ if( aCode->second().is< AvmCode >() &&
+ ( aCode->second().to_ptr< AvmCode >()->
+ isOpCode( AVM_OPCODE_PLUS ) ) )
+ {
+ AvmCode::iterator it =
+ aCode->second().to_ptr< AvmCode >()->begin();
+ AvmCode::iterator endIt =
+ aCode->second().to_ptr< AvmCode >()->end();
+ for( ; it != endIt ; ++it )
+ {
+ if( (*it).is< AvmCode >() &&
+ ( (*it).to_ptr< AvmCode >()->
+ isOpCode( AVM_OPCODE_UMINUS ) ) )
+ {
+ leftList.append(
+ (*it).to_ptr< AvmCode >()->getArg1() );
+ }
+ else if( (*it).isInteger() &&
+ ( (*it).toInteger() < 0 ) )
+ {
+ leftList.append( ExpressionConstructor::
+ newInteger(- (*it).toInteger()) );
+ }
+ else
+ {
+ rightList.append( (*it) );
+ }
+ }
+ }
+ else if( not ( aCode->second().isInteger() &&
+ ( aCode->second().toInteger() == 0 ) ) )
+ {
+ rightList.append( aCode->second() );
+ }
+
+ if( leftList.empty() )
+ {
+ leftMember = from_baseform(
+ ExpressionConstant::INTEGER_ZERO,
+ typeSpecifier);
+ }
+ else if( leftList.singleton() )
+ {
+ leftMember = from_baseform(leftList[0], typeSpecifier);
+ }
+ else
+ {
+ // leftMember = BVPLUS des elements de leftList
+ leftMember = from_baseform( leftList[0], typeSpecifier );
+ for (std::size_t i = 1 ; i < leftList.size() ; i ++)
+ {
+ leftMember = mExprManager.mkExpr(
+ CVC4::kind::BITVECTOR_PLUS, leftMember,
+ from_baseform(leftList[i], typeSpecifier));
+ }
+ }
+
+ if( rightList.empty() )
+ {
+ rightMember = from_baseform(
+ ExpressionConstant::INTEGER_ZERO,
+ typeSpecifier);
+ }
+ else if( rightList.singleton() )
+ {
+ rightMember = from_baseform(rightList[0], typeSpecifier);
+ }
+ else
+ {
+ // rightMember = BVPLUS des elements de rightList
+ rightMember = from_baseform( rightList[0], typeSpecifier );
+ for (std::size_t i = 1 ; i < rightList.size() ; i ++)
+ {
+ rightMember = mExprManager.mkExpr(
+ CVC4::kind::BITVECTOR_PLUS, rightMember,
+ from_baseform(rightList[i], typeSpecifier));
+ }
+ }
+
+ return( mExprManager.mkExpr(CVC4::kind::BITVECTOR_SLE,
+ leftMember, rightMember) );
+ }
+ else
+// if( SolverDef::DEFAULT_SOLVER_KIND ==
+// SolverDef::SOLVER_CVC4_KIND )
+ {
+ return( mExprManager.mkExpr(CVC4::kind::LEQ,
+ from_baseform(aCode->first(), typeSpecifier),
+ from_baseform(aCode->second(), typeSpecifier)) );
+ }
+ }
+
+ case AVM_OPCODE_GT:
+ {
+ if( SolverDef::DEFAULT_SOLVER_KIND ==
+ SolverDef::SOLVER_CVC4_BV32_KIND )
+ {
+ return( mExprManager.mkExpr(CVC4::kind::BITVECTOR_SGT,
+ from_baseform(aCode->first(), typeSpecifier),
+ from_baseform(aCode->second(), typeSpecifier)) );
+ }
+ else
+// if( SolverDef::DEFAULT_SOLVER_KIND ==
+// SolverDef::SOLVER_CVC4_KIND )
+ {
+ return( mExprManager.mkExpr(CVC4::kind::GT,
+ from_baseform(aCode->first(), typeSpecifier),
+ from_baseform(aCode->second(), typeSpecifier)) );
+ }
+ }
+
+ case AVM_OPCODE_GTE:
+ {
+ if( SolverDef::DEFAULT_SOLVER_KIND ==
+ SolverDef::SOLVER_CVC4_BV32_KIND )
+ {
+ return( mExprManager.mkExpr(CVC4::kind::BITVECTOR_SGE,
+ from_baseform(aCode->first(), typeSpecifier),
+ from_baseform(aCode->second(), typeSpecifier)) );
+ }
+ else
+// if( SolverDef::DEFAULT_SOLVER_KIND ==
+// SolverDef::SOLVER_CVC4_KIND )
+ {
+ return( mExprManager.mkExpr(CVC4::kind::GEQ,
+ from_baseform(aCode->first(), typeSpecifier),
+ from_baseform(aCode->second(), typeSpecifier)) );
+ }
+ }
+
+
+ case AVM_OPCODE_CONTAINS:
+ {
+ BuiltinCollection * aCollection =
+ aCode->first().to_ptr< BuiltinCollection >();
+
+ if( aCollection->singleton() )
+ {
+ const BF & col = aCollection->at(0);
+ const BF & elt = aCode->second();
+
+ if( ExpressionTypeChecker::isBoolean(col) &&
+ ExpressionTypeChecker::isBoolean(elt) )
+ {
+ return( mExprManager.mkExpr(CVC4::kind::EQUAL,
+ from_baseform(col, TypeManager::BOOLEAN),
+ from_baseform(elt, TypeManager::BOOLEAN)) );
+ }
+ else
+ {
+ return( mExprManager.mkExpr(CVC4::kind::EQUAL,
+ from_baseform(col, typeSpecifier),
+ from_baseform(elt, typeSpecifier)) );
+ }
+ }
+ else if( aCollection->populated() )
+ {
+ ARGS arg( aCollection->size() );
+ const BF & elt = aCode->second();
+ bool isBoolElt = ExpressionTypeChecker::isBoolean(elt);
+
+ for( std::size_t offset = 0 ; arg.hasNext() ; ++offset )
+ {
+ const BF & col = aCollection->at( offset );
+
+ if( isBoolElt && ExpressionTypeChecker::isBoolean(col) )
+ {
+ arg.next( mExprManager.mkExpr(CVC4::kind::EQUAL,
+ from_baseform(col, TypeManager::BOOLEAN),
+ from_baseform(elt, TypeManager::BOOLEAN) ));
+ }
+ else
+ {
+ arg.next( mExprManager.mkExpr(CVC4::kind::EQUAL,
+ from_baseform(col, typeSpecifier),
+ from_baseform(elt, typeSpecifier) ));
+ }
+ }
+
+ return( mExprManager.mkExpr(CVC4::kind::OR, arg->table) );
+ }
+ else
+ {
+ return( ((typeSpecifier != NULL) &&
+ typeSpecifier->isTypedBoolean()) ?
+ SMT_CST_BOOL_FALSE : SMT_CST_INT_ZERO );
+ }
+ }
+
+
+ // LOGICAL OPERATION
+ case AVM_OPCODE_NOT:
+ {
+ return( mExprManager.mkExpr(CVC4::kind::NOT,
+ from_baseform(aCode->first(), TypeManager::BOOLEAN)) );
+ }
+
+ case AVM_OPCODE_AND:
+ {
+ ARGS arg( aCode->size() );
+
+ AvmCode::iterator it = aCode->begin();
+ for( ; arg.hasNext() ; ++it )
+ {
+ arg.next( from_baseform(*it, TypeManager::BOOLEAN) );
+ }
+
+ return( mExprManager.mkExpr(CVC4::kind::AND, arg->table) );
+ }
+
+ case AVM_OPCODE_NAND:
+ {
+ return( mExprManager.mkExpr(CVC4::kind::NOT,
+ mExprManager.mkExpr(CVC4::kind::AND,
+ from_baseform(aCode->first(),
+ TypeManager::BOOLEAN),
+ from_baseform(aCode->second(),
+ TypeManager::BOOLEAN))) );
+ }
+
+ case AVM_OPCODE_XAND:
+ {
+ return( mExprManager.mkExpr(CVC4::kind::OR,
+ mExprManager.mkExpr(CVC4::kind::AND,
+ from_baseform(aCode->first(),
+ TypeManager::BOOLEAN),
+ from_baseform(aCode->second(),
+ TypeManager::BOOLEAN)),
+ mExprManager.mkExpr(CVC4::kind::AND,
+ mExprManager.mkExpr(CVC4::kind::NOT,
+ from_baseform(aCode->first(),
+ TypeManager::BOOLEAN)),
+ mExprManager.mkExpr(CVC4::kind::NOT,
+ from_baseform(aCode->second(),
+ TypeManager::BOOLEAN))) ) );
+ }
+
+
+ case AVM_OPCODE_OR:
+ {
+ ARGS arg( aCode->size() );
+
+ AvmCode::iterator it = aCode->begin();
+ for( ; arg.hasNext() ; ++it )
+ {
+ arg.next( from_baseform(*it, TypeManager::BOOLEAN) );
+ }
+
+ return( mExprManager.mkExpr(CVC4::kind::OR, arg->table) );
+ }
+
+ case AVM_OPCODE_NOR:
+ {
+ return( mExprManager.mkExpr(CVC4::kind::NOT,
+ mExprManager.mkExpr(CVC4::kind::OR,
+ from_baseform(aCode->first(),
+ TypeManager::BOOLEAN),
+ from_baseform(aCode->second(),
+ TypeManager::BOOLEAN))) );
+ }
+
+
+ // BITWISE OPERATION
+ case AVM_OPCODE_BAND:
+ {
+ return( mExprManager.mkExpr(CVC4::kind::BITVECTOR_AND,
+ from_baseform(aCode->first(), typeSpecifier),
+ from_baseform(aCode->second(), typeSpecifier)) );
+ }
+
+ case AVM_OPCODE_BOR:
+ {
+ return( mExprManager.mkExpr(CVC4::kind::BITVECTOR_OR,
+ from_baseform(aCode->first(), typeSpecifier),
+ from_baseform(aCode->second(), typeSpecifier)) );
+ }
+
+ case AVM_OPCODE_LSHIFT:
+ {
+ if( aCode->second().isInteger() )
+ {
+ return( mExprManager.mkExpr(CVC4::kind::BITVECTOR_SHL,
+ from_baseform(aCode->first(), typeSpecifier),
+ mExprManager.mkConst( CVC4::Rational(
+ static_cast<unsigned long int>(
+ aCode->second().toInteger())) ) ) );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected second argument for "
+ "newFixedLeftShiftExpr !!!\n"
+ << aCode->toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+
+ case AVM_OPCODE_RSHIFT:
+ {
+ if( aCode->second().isInteger() )
+ {
+ return( mExprManager.mkExpr(CVC4::kind::BITVECTOR_ASHR,
+ from_baseform(aCode->first(), typeSpecifier),
+ mExprManager.mkConst( CVC4::Rational(
+ static_cast<unsigned long int>(
+ aCode->second().toInteger())) ) ) );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected second argument for "
+ "newFixedRightShiftExpr !!!\n"
+ << aCode->toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+
+ case AVM_OPCODE_XOR:
+ {
+ return( mExprManager.mkExpr(CVC4::kind::OR,
+ mExprManager.mkExpr(CVC4::kind::AND,
+ from_baseform(aCode->first(), typeSpecifier),
+ mExprManager.mkExpr(CVC4::kind::NOT,
+ from_baseform(aCode->second(), typeSpecifier))),
+ mExprManager.mkExpr(CVC4::kind::AND,
+ mExprManager.mkExpr(CVC4::kind::NOT,
+ from_baseform(aCode->first(), typeSpecifier)),
+ from_baseform(aCode->second(), typeSpecifier)) ) );
+ }
+
+ case AVM_OPCODE_XNOR:
+ {
+ return( mExprManager.mkExpr(CVC4::kind::OR,
+ mExprManager.mkExpr(CVC4::kind::AND,
+ from_baseform(aCode->first(), typeSpecifier),
+ from_baseform(aCode->second(), typeSpecifier)),
+ mExprManager.mkExpr(CVC4::kind::AND,
+ mExprManager.mkExpr(CVC4::kind::NOT,
+ from_baseform(aCode->first(), typeSpecifier)),
+ mExprManager.mkExpr(CVC4::kind::NOT,
+ from_baseform(aCode->second(), typeSpecifier))) ) );
+ }
+
+
+ // ARITHMETIC OPERATION
+ case AVM_OPCODE_PLUS:
+ {
+ ARGS arg( aCode->size() );
+
+ AvmCode::iterator it = aCode->begin();
+ for( ; arg.hasNext() ; ++it )
+ {
+ arg.next( from_baseform(*it, typeSpecifier) );
+ }
+
+ if( SolverDef::DEFAULT_SOLVER_KIND ==
+ SolverDef::SOLVER_CVC4_BV32_KIND )
+ {
+ return( mExprManager.mkExpr(
+ CVC4::kind::BITVECTOR_PLUS, arg->table) );
+ }
+ else
+// if( SolverDef::DEFAULT_SOLVER_KIND ==
+// SolverDef::SOLVER_CVC4_KIND )
+ {
+ return( mExprManager.mkExpr(
+ CVC4::kind::PLUS, arg->table) );
+ }
+ }
+
+ case AVM_OPCODE_UMINUS:
+ {
+ return( mExprManager.mkExpr(CVC4::kind::UMINUS,
+ from_baseform(aCode->first(), typeSpecifier)) );
+ }
+
+ case AVM_OPCODE_MINUS:
+ {
+ if( SolverDef::DEFAULT_SOLVER_KIND ==
+ SolverDef::SOLVER_CVC4_BV32_KIND )
+ {
+ return( mExprManager.mkExpr(CVC4::kind::BITVECTOR_SUB,
+ from_baseform(aCode->first(), typeSpecifier),
+ from_baseform(aCode->second(), typeSpecifier)) );
+ }
+ else
+// if( SolverDef::DEFAULT_SOLVER_KIND ==
+// SolverDef::SOLVER_CVC4_KIND )
+ {
+ return( mExprManager.mkExpr(CVC4::kind::MINUS,
+ from_baseform(aCode->first(), typeSpecifier),
+ from_baseform(aCode->second(), typeSpecifier)) );
+ }
+ }
+
+ case AVM_OPCODE_MULT:
+ {
+ ARGS arg( aCode->size() );
+
+ AvmCode::iterator it = aCode->begin();
+ for( ; arg.hasNext() ; ++it )
+ {
+ arg.next( from_baseform(*it, typeSpecifier) );
+ }
+
+ if( SolverDef::DEFAULT_SOLVER_KIND ==
+ SolverDef::SOLVER_CVC4_BV32_KIND )
+ {
+ return( mExprManager.mkExpr(
+ CVC4::kind::BITVECTOR_MULT, arg->table) );
+ }
+ else
+// if( SolverDef::DEFAULT_SOLVER_KIND ==
+// SolverDef::SOLVER_CVC4_KIND )
+ {
+ return( mExprManager.mkExpr(
+ CVC4::kind::MULT, arg->table) );
+ }
+ }
+
+ case AVM_OPCODE_DIV:
+ {
+ return( mExprManager.mkExpr(CVC4::kind::DIVISION,
+ from_baseform(aCode->first(), typeSpecifier),
+ from_baseform(aCode->second(), typeSpecifier)) );
+ }
+
+ case AVM_OPCODE_POW:
+ {
+ return( mExprManager.mkExpr(CVC4::kind::POW,
+ from_baseform(aCode->first(), typeSpecifier),
+ from_baseform(aCode->second(), typeSpecifier)) );
+ }
+
+// case AVM_OPCODE_MOD:
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "CVC4Solver::from_baseform:> "
+ "Unsupported expression !!!\n"
+ << aCode->toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+
+ break;
+ }
+
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ return( getParameterExpr( exprForm ) );
+ }
+
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ {
+ if( exprForm.to_ptr< Boolean >()->getValue() )
+ {
+ return( ((typeSpecifier != NULL) &&
+ typeSpecifier->isTypedBoolean()) ?
+ SMT_CST_BOOL_TRUE : SMT_CST_INT_ONE );
+ }
+ else
+ {
+ return( ((typeSpecifier != NULL) &&
+ typeSpecifier->isTypedBoolean()) ?
+ SMT_CST_BOOL_FALSE : SMT_CST_INT_ZERO );
+ }
+ }
+
+
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ if( SolverDef::DEFAULT_SOLVER_KIND ==
+ SolverDef::SOLVER_CVC4_BV32_KIND )
+ {
+ return( mExprManager.mkConst( CVC4::BitVector( 32,
+ static_cast<unsigned long int>(
+ exprForm.to_ptr< Integer >()->toInteger())) ) );
+ }
+ else
+// if( SolverDef::DEFAULT_SOLVER_KIND == SolverDef::SOLVER_CVC4_KIND )
+ {
+ if( (typeSpecifier != NULL) &&
+ typeSpecifier->isTypedBoolean() )
+ {
+ return( exprForm.to_ptr< Integer >()->isZero() ?
+ SMT_CST_BOOL_FALSE : SMT_CST_BOOL_TRUE );
+ }
+ else
+ {
+#if defined( _AVM_BUILTIN_NUMERIC_GMP_ )
+
+ return( mExprManager.mkConst( CVC4::Rational( CVC4::Integer(
+ exprForm.to_ptr< Integer >()->getValue() ) ) ) );
+
+#else
+
+ return( mExprManager.mkConst( CVC4::Rational(
+ exprForm.to_ptr< Integer >()->str()) ) );
+
+#endif /* _AVM_BUILTIN_NUMERIC_GMP_ */
+ }
+ }
+// else
+// {
+// AVM_OS_FATAL_ERROR_EXIT
+// << "SolverDef::DEFAULT_SOLVER_KIND <> "
+// "CVC4_INT and <> CVC4_BV32 !!!\n"
+// << SEND_EXIT;
+//
+// return( mExprManager.mkConst( CVC4::Rational(
+// exprForm.to_ptr< Integer >()->getValue() ) ) );
+// }
+ }
+
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ if( (typeSpecifier != NULL) && typeSpecifier->isTypedBoolean() )
+ {
+ return( exprForm.to_ptr< Rational >()->isZero() ?
+ SMT_CST_BOOL_FALSE : SMT_CST_BOOL_TRUE );
+ }
+ else
+ {
+#if defined( _AVM_BUILTIN_NUMERIC_GMP_ )
+
+ return( mExprManager.mkConst( CVC4::Rational(
+ exprForm.to_ptr< Rational >()->getValue() ) ) );
+
+#else
+
+ return( mExprManager.mkConst( CVC4::Rational(
+ exprForm.to_ptr< Rational >()->str() ) ) );
+
+// return( mExprManager.mkConst( CVC4::Rational(
+// exprForm.to_ptr< Rational >()->getNumerator(),
+// exprForm.to_ptr< Rational >()->getDenominator()) ) );
+//
+// return( mExprManager.mkConst( CVC4::Rational(
+// exprForm.to_ptr< Rational >()->strNumerator(),
+// exprForm.to_ptr< Rational >()->strDenominator()) ) );
+
+#endif /* _AVM_BUILTIN_NUMERIC_GMP_ */
+ }
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ if( (typeSpecifier != NULL) && typeSpecifier->isTypedBoolean() )
+ {
+ return( exprForm.to_ptr< Float >()->isZero() ?
+ SMT_CST_BOOL_FALSE : SMT_CST_BOOL_TRUE );
+ }
+ else
+ {
+#if defined( _AVM_BUILTIN_NUMERIC_GMP_ )
+
+ return( mExprManager.mkConst( CVC4::Rational( mpq_class(
+ exprForm.to_ptr< Float >()->getValue() ) ) ) );
+
+#else
+
+ return( mExprManager.mkConst(
+ CVC4::Rational(exprForm.str()) ) );
+
+#endif /* _AVM_BUILTIN_NUMERIC_GMP_ */
+ }
+ }
+
+
+ case FORM_RUNTIME_ID_KIND:
+ {
+ return( mExprManager.mkConst(
+ CVC4::Rational( exprForm.bfRID().getRid() ) ) );
+ }
+
+
+ case FORM_BUILTIN_CHARACTER_KIND:
+ {
+ AVM_OS_ERROR_ALERT << "Unexpected a CHAR as expression << "
+ << exprForm.to_ptr< Character >()->getValue()
+ << " >> !!!"
+ << SEND_ALERT;
+
+ return( mExprManager.mkConst( CVC4::Rational(
+ exprForm.to_ptr< Character >()->getValue() ) ) );
+ }
+
+ case FORM_BUILTIN_STRING_KIND:
+ {
+ return( mExprManager.mkConst( CVC4::String(
+ exprForm.to_ptr< String >()->getValue() ) ) );
+ }
+
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected a STRING | UFI as expression << "
+ << exprForm.to_ptr< String >()->getValue() << " >> !!!"
+ << SEND_EXIT;
+
+ break;
+// return( mExprManager.mkConst(
+// exprForm.to_ptr< String >()->getValue() ) );
+ }
+
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected a IDENTIFIER as expression << "
+ << exprForm.to_ptr< Identifier >()->getValue()
+ << " >> !!!"
+ << SEND_EXIT;
+
+ break;
+// return( mExprManager.mkConst(
+// exprForm.to_ptr< Identifier >()->getValue() ) );
+ }
+
+ case FORM_OPERATOR_KIND:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected an OPERATOR as expression << "
+ << exprForm.to_ptr< Operator >()->standardSymbol()
+ << " >> !!!"
+ << SEND_EXIT;
+
+ break;
+// return( mExprManager.mkConst(
+// exprForm.to_ptr< Operator >()->standardSymbol() ) );
+ }
+
+
+ case FORM_INSTANCE_BUFFER_KIND:
+ case FORM_INSTANCE_CONNECTOR_KIND:
+ case FORM_INSTANCE_MACHINE_KIND:
+ case FORM_INSTANCE_PORT_KIND:
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected BASEFORM KIND as expression << "
+ << exprForm.str() << " >> !!!"
+ << SEND_EXIT;
+
+ break;
+// return( mExprManager.mkConst(
+// exprForm.to_ptr< BaseInstanceForm >()->getFullyQualifiedNameID() ) );
+ }
+ }
+
+ AVM_OS_FATAL_ERROR_EXIT
+ << "CVC4Solver::from_baseform ERROR !!!"
+ << SEND_EXIT;
+
+ return( SMT_CST_INT_ZERO );
+}
+
+
+} /* namespace sep */
+
+
+#endif /* _AVM_SOLVER_CVC4_ */
diff --git a/org.eclipse.efm.symbex/src/solver/CVC4Solver.h b/org.eclipse.efm.symbex/src/solver/CVC4Solver.h
new file mode 100644
index 0000000..4e45598
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/solver/CVC4Solver.h
@@ -0,0 +1,164 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 15 nov. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef SOLVER_CVC4_H_
+#define SOLVER_CVC4_H_
+
+#include <solver/api/SolverDef.h>
+/*
+ * Here because "SolverDef.h" could define this macro
+ */
+#if defined( _AVM_SOLVER_CVC4_ )
+
+
+#include <solver/api/SmtSolver.h>
+
+#include <cvc4/expr/expr.h>
+#include <cvc4/expr/expr_manager.h>
+#include <cvc4/expr/type.h>
+#include <cvc4/smt/smt_engine.h>
+
+#include <common/BF.h>
+
+#include <collection/Typedef.h>
+
+#include <fml/executable/InstanceOfData.h>
+
+
+namespace sep
+{
+
+
+class WObject;
+
+class ExecutionContext;
+class ExecutionData;
+
+class TypeSpecifier;
+
+
+class CVC4Solver :
+ public SmtSolver< CVC4::Expr , CVC4::Type , CVC4::Expr , false , true >
+
+{
+
+ AVM_DECLARE_UNCLONABLE_CLASS(CVC4Solver)
+
+public:
+ /*
+ ***************************************************************************
+ * ID
+ ***************************************************************************
+ */
+ static std::string ID;
+
+ static std::string DESCRIPTION;
+
+ static avm_uint64_t SOLVER_SESSION_ID;
+
+ static CVC4::Expr CVC4_EXPR_NULL;
+ static CVC4::Type CVC4_TYPE_NULL;
+
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ **/
+ std::string mParamPrefix;
+
+ CVC4::ExprManager mExprManager;
+ CVC4::SmtEngine mSmtEngine;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ CVC4Solver(bool produce_models_flag = false);
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~CVC4Solver();
+
+ /**
+ * CONFIGURE
+ */
+ virtual bool configure(
+ Configuration & aConfiguration, WObject * wfFilterObject,
+ ListOfPairMachineData & listOfSelectedVariable);
+
+
+ /**
+ * PROVER
+ */
+ virtual bool isSubSet(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC);
+
+ virtual bool isEqualSet(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC);
+
+ virtual SolverDef::SATISFIABILITY_RING isSatisfiable(const BF & aCondition);
+
+
+ /**
+ * SOLVER
+ */
+ virtual bool solveImpl(const BF & aCondition,
+ BFVector & dataVector, BFVector & valuesVector);
+
+
+ /**
+ * CREATE - DESTROY
+ * ValidityChecker
+ */
+ bool createChecker();
+ bool destroyChecker();
+ bool resetTable();
+
+ /**
+ * TOOLS
+ */
+ void edToExpr(const ExecutionData & newED, CVC4::Expr & newFormula,
+ const ExecutionData & oldED, CVC4::Expr & oldFormula);
+
+ void edToExprWithVarEquality(const ExecutionData & newED,
+ CVC4::Expr & newFormula, const ExecutionData & oldED,
+ CVC4::Expr & oldFormula, CVC4::Expr & equFormula);
+
+ CVC4::Expr edToExpr(const ExecutionData & anED);
+
+ CVC4::Expr safe_from_baseform(const BF & exprForm,
+ BaseTypeSpecifier * typeSpecifier = NULL);
+
+ CVC4::Expr from_baseform(const BF & exprForm,
+ BaseTypeSpecifier * typeSpecifier = NULL);
+
+ CVC4::Expr & getParameterExpr(const BF & aParameter);
+ CVC4::Expr & getVariableExpr(InstanceOfData * aVar,
+ CVC4::Type varType, avm_offset_t varID);
+
+};
+
+
+} /* namespace sep */
+
+#endif /* _AVM_SOLVER_CVC4_ */
+
+
+#endif /* SOLVER_CVC4_H_ */
+
diff --git a/org.eclipse.efm.symbex/src/solver/OmegaSolver.cpp b/org.eclipse.efm.symbex/src/solver/OmegaSolver.cpp
new file mode 100644
index 0000000..bed2508
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/solver/OmegaSolver.cpp
@@ -0,0 +1,1380 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "OmegaSolver.h"
+
+/*
+ * Here because "SolverDef.h" could define this macro
+ */
+#if defined( _AVM_SOLVER_OMEGA_ )
+
+
+#include <common/BF.h>
+
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/InstanceOfData.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/builtin/Boolean.h>
+#include <fml/builtin/Character.h>
+#include <fml/expression/ExpressionSimplifier.h>
+#include <fml/numeric/Float.h>
+#include <fml/numeric/Integer.h>
+#include <fml/numeric/Rational.h>
+
+#include <fml/operator/Operator.h>
+
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeForm.h>
+#include <fml/runtime/RuntimeID.h>
+
+#include <fml/workflow/Query.h>
+#include <fml/workflow/WObject.h>
+
+#include <sew/Configuration.h>
+
+
+namespace sep
+{
+
+/*
+ ***************************************************************************
+ * ID
+ ***************************************************************************
+ */
+std::string OmegaSolver::ID = "OMEGA";
+
+std::string OmegaSolver::DESCRIPTION = "OMEGA 'Solver of quantifier-free "
+ "problems in Presburger Arithmetic at CS.UMD.EDU, version 2.1'";
+
+avm_uint64_t OmegaSolver::SOLVER_SESSION_ID = 0;
+
+
+
+/**
+ * CONFIGURE
+ */
+bool OmegaSolver::configure(
+ Configuration & aConfiguration, WObject * wfFilterObject,
+ ListOfPairMachineData & listOfSelectedVariable)
+{
+ isConfigureFlag = true;
+
+ if( not SatSolver::configure(
+ aConfiguration, wfFilterObject, listOfSelectedVariable) )
+ {
+ return( false );
+ }
+
+ setSelectedVariable(
+ aConfiguration.getMainExecutionData(),
+ listOfSelectedVariable );
+
+ return( true );
+}
+
+
+/**
+ * RESET VARIABLE or PARAMETER
+ */
+void OmegaSolver::resetVariableTable()
+{
+ getSelectedVariable().clear();
+
+ // Attention Omega compte de 1 à n
+ mTableOfVariableInstance.clear();
+ mTableOfVariableInstance.append( NULL );
+
+ mTableOfVar4ParamInstance.clear();
+}
+
+
+void OmegaSolver::resetParameterTable()
+{
+ // Initialisation du tableau des parametres
+ mTableOfVariableID.clear();
+
+ VectorOfInstanceOfData::iterator it = mTableOfParameterInstance.begin();
+ VectorOfInstanceOfData::iterator itEnd = mTableOfParameterInstance.end();
+ for( ; it != itEnd ; ++it )
+ {
+ (*it)->setMark(0);
+ }
+ mTableOfParameterInstance.clear();
+
+ // Attention: Omega compte de 1 à n
+ mTableOfParameterID.clear();
+ omega::Variable_ID sentinelID;
+ mTableOfParameterID.push_back(sentinelID);
+}
+
+
+/**
+ * SET VARIABLE or PARAMETER
+ */
+void OmegaSolver::setSelectedVariable(const ExecutionData & anED)
+{
+ resetVariableTable();
+
+ TableOfInstanceOfData::const_raw_iterator itData;
+ TableOfInstanceOfData::const_raw_iterator endData;
+
+ TableOfRuntimeT::const_iterator itRF = anED.getTableOfRuntime().begin();
+ TableOfRuntimeT::const_iterator endRF = anED.getTableOfRuntime().end();
+ for( RuntimeID itRID ; itRF != endRF ; ++itRF )
+ {
+ itRID = (*itRF)->getRID();
+
+ if( itRID.getExecutable()->hasData() ||
+ itRID.getExecutable()->hasBuffer() )
+ {
+ PairMachineData tmpListOfOffset( itRID );
+
+ itData = itRID.getExecutable()->getBasicData().begin();
+ endData = itRID.getExecutable()->getBasicData().end();
+ for( ; itData != endData ; ++itData )
+ {
+ tmpListOfOffset.second().append( (itData) );
+
+ mTableOfVariableInstance.append( (itData) );
+
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+// AVM_OS_TRACE << TAB << "Omega Relation variable : "
+// << str_header( *itData ) << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ }
+
+ if( tmpListOfOffset.second().nonempty() )
+ {
+ getSelectedVariable().append(tmpListOfOffset);
+ }
+ }
+ }
+}
+
+
+void OmegaSolver::setSelectedVariable(const ExecutionData & anED,
+ ListOfPairMachineData & listOfSelectedVariable)
+{
+ resetVariableTable();
+
+ SatSolver::setSelectedVariable(listOfSelectedVariable);
+
+ ListOfPairMachineData::iterator itPairMachineData = listOfSelectedVariable.begin();
+ ListOfPairMachineData::iterator endPairMachineData = listOfSelectedVariable.end();
+ for( ; itPairMachineData != endPairMachineData ; ++itPairMachineData )
+ {
+ if( (*itPairMachineData).second().nonempty() )
+ {
+ ListOfInstanceOfData::iterator itVar = (*itPairMachineData).second().begin();
+ ListOfInstanceOfData::iterator endVar = (*itPairMachineData).second().end();
+
+ for( ; itVar != endVar ; ++itVar )
+ {
+ mTableOfVariableInstance.append( *itVar );
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+ AVM_OS_TRACE << TAB << "Omega Relation variable : "
+ << str_header( *itVar ) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+ }
+ }
+ }
+}
+
+
+void OmegaSolver::setSelectedVariable(const ExecutionData & anED,
+ ListOfInstanceOfData & aLisOfAdditionnalVar)
+{
+ setSelectedVariable(anED);
+
+ mTableOfVar4ParamInstance.append(aLisOfAdditionnalVar);
+}
+
+
+
+/**
+ * PROVER
+ */
+bool OmegaSolver::isSubSet(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+{
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ oldEC.traceDefault(AVM_OS_TRACE << TAB);
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ // Creation de la relation Omega
+ // Attention: Omega compte de 1 à n
+ omega::Relation oldRelation( mTableOfVariableInstance.size() - 1 );
+ toRelation(oldEC.refExecutionData(), oldRelation);
+
+
+ if( ((& newEC) != mCacheForNewEC) || isCurrentPathScope() )
+ {
+ mCacheForNewEC = (& newEC);
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ newEC.traceDefault(AVM_OS_TRACE << TAB);
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ // Creation de la relation Omega
+ // Attention: Omega compte de 1 à n
+ omega::Relation newRelation( mTableOfVariableInstance.size() - 1 );
+ toRelation(newEC.refExecutionData(), newRelation);
+
+ mCacheForNewRelation = newRelation;
+
+
+ return( isSubSet(newRelation, oldRelation) );
+ }
+ else
+ {
+ omega::Relation newRelation = mCacheForNewRelation;
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+ AVM_OS_TRACE << TAB << "ED cpy : "
+ << newRelation.print_with_subs_to_string() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+
+ return( isSubSet(newRelation, oldRelation) );
+ }
+}
+
+
+bool OmegaSolver::isEqualSet(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+{
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ oldEC.traceDefault(AVM_OS_TRACE << TAB);
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ // Creation de la relation Omega
+ // Attention: Omega compte de 1 à n
+ omega::Relation oldRelation( mTableOfVariableInstance.size() - 1 );
+ toRelation(oldEC.refExecutionData(), oldRelation);
+
+
+ if( (& newEC) != mCacheForNewEC )
+ {
+ mCacheForNewEC = (& newEC);
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ newEC.traceDefault(AVM_OS_TRACE << TAB);
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ // Creation de la relation Omega
+ // Attention: Omega compte de 1 à n
+ omega::Relation newRelation( mTableOfVariableInstance.size() - 1 );
+ toRelation(newEC.refExecutionData(), newRelation);
+
+ mCacheForNewRelation = newRelation;
+
+
+ return( isEqualSet(newRelation, oldRelation) );
+ }
+ else
+ {
+ omega::Relation newRelation = mCacheForNewRelation;
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << TAB << "ED cpy : "
+ << newRelation.print_with_subs_to_string() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ return( isEqualSet(newRelation, oldRelation) );
+ }
+}
+
+
+bool OmegaSolver::isEmptyIntersection(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+{
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ oldEC.traceDefault(AVM_OS_TRACE << TAB);
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ // Creation de la relation Omega
+ // Attention: Omega compte de 1 à n
+ omega::Relation oldRelation( mTableOfVariableInstance.size() - 1 +
+ mTableOfVar4ParamInstance.size() );
+ setParameterUple(oldRelation);
+ toRelation(oldEC.refExecutionData(), oldRelation);
+
+
+ if( (& newEC) != mCacheForNewEC )
+ {
+ mCacheForNewEC = (& newEC);
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ newEC.traceDefault(AVM_OS_TRACE << TAB);
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ // Creation de la relation Omega
+ // Attention: Omega compte de 1 à n
+ omega::Relation newRelation( mTableOfVariableInstance.size() - 1 +
+ mTableOfVar4ParamInstance.size() );
+ setParameterUple(newRelation);
+ toRelation(newEC.refExecutionData(), newRelation);
+
+ mCacheForNewRelation = newRelation;
+
+
+ return( isEmptyIntersection(newRelation, oldRelation) );
+ }
+ else
+ {
+ omega::Relation newRelation = mCacheForNewRelation;
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << TAB << "ED cpy : "
+ << newRelation.print_with_subs_to_string() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ return( isEmptyIntersection(newRelation, oldRelation) );
+ }
+}
+
+
+
+SolverDef::SATISFIABILITY_RING OmegaSolver::isSatisfiable(const BF & aCondition)
+{
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << "OmegaSolver::isSatisfiable(...) "
+ ":" << SOLVER_SESSION_ID << ">" << std::endl
+ << "\t" << aCondition.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ BF valCondition = ExpressionSimplifier::simplif( aCondition );
+
+ // Initialisation du tableau des parametres
+ mTableOfVariableID.clear();
+ mTableOfParameterInstance.clear();
+
+ // Attention: Omega compte de 1 à n
+ mTableOfParameterID.clear();
+ omega::Variable_ID sentinelID;
+ mTableOfParameterID.push_back(sentinelID);
+
+ omega::Relation aRelation(0);
+
+ // Creation du quantificateur Exist associe aux parametres
+ registerExistQuantifier = aRelation.add_and()->add_exists();
+ omega::F_And * andRootNode = registerExistQuantifier->add_and();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+// AVM_OS_COUT << "aCondition : " << aCondition->str() << std::flush;
+ AVM_OS_TRACE << "v::isSatisfiable(...) "
+ ":" << SOLVER_SESSION_ID << ">" << std::endl;
+ AVM_OS_TRACE << TAB << aCondition.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ toConjonction(andRootNode, valCondition);
+
+ // Simplification de la Relation
+ aRelation.finalize();
+
+ aRelation.simplify(2,4);
+
+
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+// AVM_OS_TRACE << TAB << "the Relation : "
+// << newRelation.print_with_subs_to_string() << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+
+ SolverDef::SATISFIABILITY_RING satisfiability =
+ aRelation.is_satisfiable() ?
+ SolverDef::SATISFIABLE : SolverDef::UNSATISFIABLE;
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << "result :" << SOLVER_SESSION_ID << "> "
+ << SolverDef::strSatisfiability(satisfiability) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ aRelation = omega::Relation::Null();
+
+ resetParameterTable();
+
+ return( satisfiability );
+}
+
+
+/**
+ * TOOLS
+ */
+bool OmegaSolver::isSubSet(omega::Relation & Rel1, omega::Relation & Rel2)
+{
+ return( Must_Be_Subset(Rel1, Rel2) );
+}
+
+bool OmegaSolver::isEqualSet(omega::Relation & Rel1, omega::Relation & Rel2)
+{
+ return( Must_Be_Subset(copy(Rel1), copy(Rel2)) && Must_Be_Subset(Rel2, Rel1) );
+}
+
+
+bool OmegaSolver::isEmptyIntersection(omega::Relation & Rel1, omega::Relation & Rel2)
+{
+ omega::Relation interRelation = Intersection(Rel2, Rel1);
+
+ bool isEmpty = (! interRelation.is_satisfiable() );
+
+ interRelation = omega::Relation::Null();
+
+ return( isEmpty );
+}
+
+
+bool OmegaSolver::setParameterUple(omega::Relation & aRelation)
+{
+ std::ostringstream oss;
+
+ VectorOfInstanceOfData::iterator it = mTableOfVar4ParamInstance.begin();
+ VectorOfInstanceOfData::iterator itEnd = mTableOfVar4ParamInstance.end();
+ avm_offset_t paramOffset = 1;
+ for( ; it != itEnd ; ++it , ++paramOffset )
+ {
+ oss.str("");
+ oss << "VP_" << paramOffset;
+
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << TAB << oss.str() << " << " << (*it)->getFullyQualifiedNameID()
+ << " >> --> is a Symbolic Parameter" << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ (*it)->setOffset(mTableOfParameterID.size());
+ mTableOfParameterInstance.push_back( (*it) );
+
+ omega::Variable_ID aVarID = aRelation.set_var(paramOffset);
+ mTableOfParameterID.push_back( aVarID );
+ aRelation.name_set_var(paramOffset, oss.str().c_str());
+ }
+
+ return( true );
+}
+
+bool OmegaSolver::toRelation(
+ const ExecutionData & anED, omega::Relation & aRelation)
+{
+ // Creation du quantificateur Exist associe aux parametres
+ registerExistQuantifier = aRelation.add_and()->add_exists();
+ omega::F_And * andRootNode = registerExistQuantifier->add_and();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << TAB << "aPC : " << anED.getPathCondition().str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ toConjonction(andRootNode, anED.getPathCondition());
+
+ std::ostringstream oss;
+
+ ListOfPairMachineData::iterator itPairMachineData = getSelectedVariable().begin();
+ ListOfPairMachineData::iterator endPairMachineData = getSelectedVariable().end();
+ avm_offset_t varOffset = mTableOfVar4ParamInstance.size() + 1;
+ for( ; itPairMachineData != endPairMachineData ; ++itPairMachineData )
+ {
+ if( (*itPairMachineData).second().nonempty() )
+ {
+ ListOfInstanceOfData::iterator itVar = (*itPairMachineData).second().begin();
+ ListOfInstanceOfData::iterator endVar = (*itPairMachineData).second().end();
+
+ const RuntimeForm & aRF = anED.getRuntime( (*itPairMachineData).first() );
+
+ for( ; itVar != endVar ; ++itVar , ++varOffset )
+ {
+ oss.str("");
+ oss << "V_" << varOffset;
+
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+// AVM_OS_COUT << oss.str() << " <-- " << aRF.getData(*itVar).str() << std::endl;
+ AVM_OS_TRACE << TAB << oss.str() << " <-- "
+ << aRF.getData(*itVar).str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+
+
+ omega::Variable_ID aVarID = aRelation.set_var(varOffset);
+ mTableOfVariableID.push_back(aVarID);
+ aRelation.name_set_var(varOffset, oss.str().c_str());
+
+ omega::EQ_Handle eqNode = andRootNode->add_EQ();
+ eqNode.update_coef(aVarID, -1);
+
+ if( (*itVar)->isTypedBoolean() )
+ {
+ if( aRF.getData(*itVar).isEqualTrue() )
+ {
+ eqNode.update_const( 1 );
+ }
+ else if( aRF.getData(*itVar).isEqualFalse() )
+ {
+ eqNode.update_const( 0 );
+ }
+ else
+ {
+ eqNode.update_coef(aVarID, 1);
+ }
+ }
+ else
+ {
+ toConstraint(eqNode, 1, aRF.getData(*itVar));
+ }
+ }
+ }
+ }
+
+ // Simplification de la Relation
+ aRelation.finalize();
+
+
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+// AVM_OS_COUT << "FINALIZE : ";
+// aRelation.prefix_print(); AVM_OS_COUT << std::flush;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+
+ aRelation.simplify(2,4);
+
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+// AVM_OS_COUT << "SIMPLIF : " << std::endl
+// << "ED : " << aRelation.print_with_subs_to_string() << std::endl;
+ AVM_OS_TRACE << TAB << "ED : "
+ << aRelation.print_with_subs_to_string() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+
+
+ resetParameterTable();
+
+ return( true );
+}
+
+
+omega::Variable_ID OmegaSolver::getParameterID(InstanceOfData * aParameter)
+{
+ if( aParameter->getMark() == 0 )
+ {
+// if( aParameter->isTypedBoolean() )
+// {
+// }
+// else if( aParameter->isTypedInteger() )
+// {
+// }
+// else if( aParameter->isTypedRational() )
+// {
+// }
+// else if( aParameter->isTypedFloat() )
+// {
+// }
+// else if( aParameter->isTypedReal() )
+// {
+// }
+// else
+// {
+// AVM_OS_ERROR_ALERT << "Unexpected an instance type << "
+// << aParameter->getFullyQualifiedNameID() << " : " << paramFormType->getFullyQualifiedNameID()
+// << ">> !!!"
+// << SEND_ALERT;
+// }
+
+ aParameter->setMark(mTableOfParameterID.size());
+ mTableOfParameterInstance.push_back(aParameter);
+
+ std::ostringstream oss;
+ oss.str("");
+ oss << "P_" << mTableOfParameterID.size();
+
+
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+// AVM_OS_COUT << "\t" << oss.str() << " <- " << aParameter->getFullyQualifiedNameID() << std::endl;
+// AVM_OS_TRACE << TAB << oss.str() << " <- " << aParameter->getFullyQualifiedNameID() << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ mTableOfParameterID.push_back(
+ registerExistQuantifier->declare( oss.str().c_str() ) );
+ }
+
+ //return( mTableOfParameterID[ aParameter->getMark() ] );
+
+ omega::Variable_ID varID = mTableOfParameterID[ aParameter->getMark() ];
+
+
+//AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+// AVM_OS_TRACE << TAB << "varID: ";
+// const char * c = varID->char_name();
+// while( isalnum(*c) ) { AVM_OS_TRACE << *c; ++c; }
+// AVM_OS_TRACE << TAB << " <- " << str_header( aParameter ) << std::endl;
+//AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ return( varID );
+}
+
+
+void OmegaSolver::toConjonction(omega::F_And * andNode, const BF & exprForm)
+{
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( exprForm ) << "expression !!!"
+ << SEND_EXIT;
+
+ switch( exprForm.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ AvmCode * aCode = exprForm.to_ptr< AvmCode >();
+
+ switch( aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_EQ: // - first + second == 0
+ {
+ BFCode exprCond;
+ avm_integer_t exprInt;
+
+ if( aCode->first().is< AvmCode >() )
+ {
+ exprCond = aCode->first().bfCode();
+
+ if( aCode->second().isInteger() )
+ {
+ exprInt = aCode->second().toInteger();
+ }
+ }
+ else if( aCode->first().isInteger() )
+ {
+ exprInt = aCode->first().toInteger();
+
+ if( aCode->second().is< AvmCode >() )
+ {
+ exprCond = aCode->second().bfCode();
+ }
+ }
+
+ if( exprCond.valid() )
+ {
+ switch( exprCond->getAvmOpCode() )
+ {
+ case AVM_OPCODE_EQ:
+ case AVM_OPCODE_NEQ:
+ case AVM_OPCODE_LT:
+ case AVM_OPCODE_LTE:
+ case AVM_OPCODE_GT:
+ case AVM_OPCODE_GTE:
+ case AVM_OPCODE_NOT:
+ case AVM_OPCODE_AND:
+ case AVM_OPCODE_NAND:
+ case AVM_OPCODE_XAND:
+ case AVM_OPCODE_OR:
+ case AVM_OPCODE_NOR:
+ case AVM_OPCODE_XOR:
+ case AVM_OPCODE_XNOR:
+ {
+ omega::F_And * andEQ = andNode;
+
+ if( exprInt == 0 )
+ {
+ andEQ = andNode->add_not()->add_and();
+ }
+
+ toConjonction(andEQ, exprCond);
+
+ return;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+ }
+ else
+ {
+ omega::EQ_Handle eqNode = andNode->add_EQ();
+ toConstraint(eqNode, -1, aCode->first());
+ toConstraint(eqNode, 1, aCode->second());
+ }
+
+ break;
+ }
+
+
+ case AVM_OPCODE_NEQ: // NOT( - first + second == 0 )
+ {
+ BFCode exprCond;
+ avm_integer_t exprInt;
+
+ if( aCode->first().is< AvmCode >() )
+ {
+ exprCond = aCode->first().bfCode();
+
+ if( aCode->second().isInteger() )
+ {
+ exprInt = aCode->second().toInteger();
+ }
+ }
+ else if( aCode->first().isInteger() )
+ {
+ exprInt = aCode->first().toInteger();
+
+ if( aCode->second().is< AvmCode >() )
+ {
+ exprCond = aCode->second().bfCode();
+ }
+ }
+
+ if( exprCond.valid() )
+ {
+ switch( exprCond->getAvmOpCode() )
+ {
+ case AVM_OPCODE_EQ:
+ case AVM_OPCODE_NEQ:
+ case AVM_OPCODE_LT:
+ case AVM_OPCODE_LTE:
+ case AVM_OPCODE_GT:
+ case AVM_OPCODE_GTE:
+ case AVM_OPCODE_NOT:
+ case AVM_OPCODE_AND:
+ case AVM_OPCODE_NAND:
+ case AVM_OPCODE_XAND:
+ case AVM_OPCODE_OR:
+ case AVM_OPCODE_NOR:
+ case AVM_OPCODE_XOR:
+ case AVM_OPCODE_XNOR:
+ {
+ omega::F_And * andEQ = andNode;
+
+ if( exprInt != 0 )
+ {
+ andEQ = andNode->add_not()->add_and();
+ }
+
+ toConjonction(andEQ, exprCond);
+
+ return;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+ }
+ else
+ {
+ omega::EQ_Handle eqNode =
+ andNode->add_not()->add_and()->add_EQ();
+
+ toConstraint(eqNode, -1, aCode->first());
+ toConstraint(eqNode, 1, aCode->second());
+ }
+
+ break;
+ }
+
+
+
+ case AVM_OPCODE_LT: // - first + second - 1 >= 0
+ {
+ omega::GEQ_Handle geqNode = andNode->add_GEQ();
+ toConstraint(geqNode, -1, aCode->first());
+ toConstraint(geqNode, 1, aCode->second());
+ geqNode.update_const(-1);
+
+ break;
+ }
+
+ case AVM_OPCODE_LTE: // - first + second >= 0
+ {
+ omega::GEQ_Handle geqNode = andNode->add_GEQ();
+ toConstraint(geqNode, -1, aCode->first());
+ toConstraint(geqNode, 1, aCode->second());
+
+ break;
+ }
+
+ case AVM_OPCODE_GT: // first - second - 1 >= 0
+ {
+ omega::GEQ_Handle geqNode = andNode->add_GEQ();
+ toConstraint(geqNode, 1, aCode->first());
+ toConstraint(geqNode, -1, aCode->second());
+ geqNode.update_const(-1);
+
+ break;
+ }
+
+ case AVM_OPCODE_GTE: // first - second >= 0
+ {
+ BFCode exprCond;
+ avm_integer_t exprInt;
+
+ if( aCode->first().is< AvmCode >() )
+ {
+ exprCond = aCode->first().bfCode();
+
+ if( aCode->second().isInteger() )
+ {
+ exprInt = aCode->second().toInteger();
+ }
+ }
+ else if( aCode->first().isInteger() )
+ {
+ exprInt = aCode->first().toInteger();
+
+ if( aCode->second().is< AvmCode >() )
+ {
+ exprCond = aCode->second().bfCode();
+ }
+ }
+
+ if( exprCond.valid() )
+ {
+ switch( exprCond->getAvmOpCode() )
+ {
+ case AVM_OPCODE_EQ:
+ case AVM_OPCODE_NEQ:
+ case AVM_OPCODE_LT:
+ case AVM_OPCODE_LTE:
+ case AVM_OPCODE_GT:
+ case AVM_OPCODE_GTE:
+ case AVM_OPCODE_NOT:
+ case AVM_OPCODE_AND:
+ case AVM_OPCODE_NAND:
+ case AVM_OPCODE_XAND:
+ case AVM_OPCODE_OR:
+ case AVM_OPCODE_NOR:
+ case AVM_OPCODE_XOR:
+ case AVM_OPCODE_XNOR:
+ {
+ omega::F_And * andEQ = andNode;
+
+ if( exprInt < 1 )
+ {
+ andEQ = andNode->add_not()->add_and();
+ }
+
+ toConjonction(andEQ, exprCond);
+
+ return;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+ }
+ else
+ {
+ omega::GEQ_Handle geqNode = andNode->add_GEQ();
+ toConstraint(geqNode, 1, aCode->first());
+ toConstraint(geqNode, -1, aCode->second());
+ }
+
+ break;
+ }
+
+
+ case AVM_OPCODE_CONTAINS:
+ {
+ BuiltinCollection * aCollection =
+ aCode->first().to_ptr< BuiltinCollection >();
+
+ if( aCollection->singleton() )
+ {
+ omega::EQ_Handle eqNode = andNode->add_EQ();
+ toConstraint(eqNode, -1, aCollection->at(0));
+ toConstraint(eqNode, 1, aCode->second());
+ }
+ else if( aCollection->populated() )
+ {
+ omega::F_Or * orNode = andNode->add_or();
+
+ std::size_t colSize = aCollection->size();
+ for( std::size_t offset = 0 ; offset < colSize ; ++offset )
+ {
+ omega::EQ_Handle eqNode = orNode->add_and()->add_EQ();
+ toConstraint(eqNode, -1, aCollection->at(offset));
+ toConstraint(eqNode, 1, aCode->second());
+ }
+ }
+ else
+ {
+ andNode->add_EQ().update_const(
+ exprForm.to_ptr< Boolean >()->getValue() ? 0 : 1 );
+ }
+ break;
+ }
+
+
+ case AVM_OPCODE_NOT:
+ {
+ if( aCode->first().is< InstanceOfData >() ) // arg0 == 0
+ {
+ andNode->add_EQ().update_coef(getParameterID(
+ aCode->first().to_ptr< InstanceOfData >()), 1);
+ }
+ else // NOT( arg0 )
+ {
+ toConjonction(andNode->add_not()->add_and(), aCode->first());
+ }
+
+ break;
+ }
+
+ case AVM_OPCODE_AND: // AND args
+ {
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator itEnd = aCode->end();
+ for( ; it != itEnd ; ++it )
+ {
+ toConjonction(andNode, *it);
+ }
+
+ break;
+ }
+
+ case AVM_OPCODE_NAND: // NAND first second
+ {
+ omega::F_And * nandNode = andNode->add_not()->add_and();
+ toConjonction(nandNode, aCode->first());
+ toConjonction(nandNode, aCode->second());
+
+ break;
+ }
+
+
+ case AVM_OPCODE_XAND:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unsupported boolean expression << XAND >> !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+
+
+ case AVM_OPCODE_OR: // OR args
+ {
+ omega::F_Or * orNode = andNode->add_or();
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator itEnd = aCode->end();
+ for( ; it != itEnd ; ++it )
+ {
+ toConjonction(orNode->add_and(), *it);
+ }
+
+ break;
+ }
+
+ case AVM_OPCODE_NOR: // NOR first second
+ {
+ omega::F_And * norNode = andNode->add_not()->add_or()->add_and();
+ toConjonction(norNode, aCode->first());
+ toConjonction(norNode, aCode->second());
+
+ break;
+ }
+
+
+ case AVM_OPCODE_XOR:
+ case AVM_OPCODE_XNOR:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unsupported boolean expression "
+ "<< XOR | XNOR >> !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+
+
+ case AVM_OPCODE_PLUS:
+ case AVM_OPCODE_UMINUS:
+ case AVM_OPCODE_MINUS:
+ case AVM_OPCODE_MULT:
+ case AVM_OPCODE_DIV:
+ case AVM_OPCODE_POW:
+ case AVM_OPCODE_MOD:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected arithmetic expression Operator !!!"
+ << SEND_EXIT;
+ break;
+ }
+
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected BASEFORM KIND for execution !!!\n"
+ << aCode->toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+ break;
+ }
+ }
+
+ break;
+ }
+
+ case FORM_INSTANCE_DATA_KIND:
+ {
+// andNode->add_not()->add_and()->add_EQ().update_coef(
+// getParameterID( exprForm.to_ptr< InstanceOfData >() ) );
+
+ omega::EQ_Handle eqNode = andNode->add_and()->add_EQ();
+ eqNode.update_coef( getParameterID(exprForm.to_ptr< InstanceOfData >()), 1);
+ eqNode.update_const(-1);
+
+ break;
+ }
+
+
+ case FORM_BUILTIN_BOOLEAN_KIND: // true <=> (0 == 0) ; false <=> (1 == 0)
+ {
+ andNode->add_EQ().update_const(
+ exprForm.to_ptr< Boolean >()->getValue() ? 0 : 1 );
+
+ break;
+ }
+
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ andNode->add_EQ().update_const(
+ exprForm.to_ptr< Integer >()->isZero() ? 0 : 1 );
+
+ break;
+ }
+
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ andNode->add_EQ().update_const(
+ exprForm.to_ptr< Rational >()->isZero() ? 0 : 1 );
+
+ break;
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ andNode->add_EQ().update_const(
+ exprForm.to_ptr< Float >()->isZero() ? 0 : 1 );
+
+ break;
+ }
+
+ case FORM_BUILTIN_CHARACTER_KIND:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unsupported built-in Character !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+
+ case FORM_BUILTIN_STRING_KIND:
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unsupported built-in String "
+ "< STRING | UFI | IDENTIFIER > or Operator !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+
+ case FORM_OPERATOR_KIND:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unsupported Operator expression !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+
+
+ case FORM_INSTANCE_BUFFER_KIND:
+ case FORM_INSTANCE_CONNECTOR_KIND:
+ case FORM_INSTANCE_MACHINE_KIND:
+ case FORM_INSTANCE_PORT_KIND:
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected BASEFORM KIND as expression << "
+ << exprForm.str() << " >> !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+}
+
+
+void OmegaSolver::toConstraint(omega::Constraint_Handle & constraintNode,
+ int coefficient, const BF & exprForm)
+{
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( exprForm ) << "expression !!!"
+ << SEND_EXIT;
+
+ switch( exprForm.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ AvmCode * aCode = exprForm.to_ptr< AvmCode >();
+
+ switch( aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_PLUS:
+ {
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator itEnd = aCode->end();
+ for( ; it != itEnd ; ++it )
+ {
+ toConstraint(constraintNode, coefficient, *it);
+ }
+
+ break;
+ }
+
+ case AVM_OPCODE_UMINUS:
+ {
+ toConstraint(constraintNode, - coefficient, aCode->first());
+
+ break;
+ }
+
+ case AVM_OPCODE_MINUS:
+ {
+ toConstraint(constraintNode, coefficient, aCode->first());
+ toConstraint(constraintNode, - coefficient, aCode->second());
+
+ break;
+ }
+
+ case AVM_OPCODE_MULT:
+ {
+ if( aCode->size() == 2 )
+ {
+ if( aCode->first().isInteger() )
+ {
+ coefficient = coefficient * aCode->first().toInteger();
+ toConstraint(constraintNode, coefficient, aCode->second());
+ }
+ else if( aCode->second().isInteger() )
+ {
+ coefficient = coefficient * aCode->second().toInteger();
+ toConstraint(constraintNode, coefficient, aCode->first());
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unsupported non linear multiplication !!!"
+ << SEND_EXIT;
+ }
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unsupported non binary multiplication !!!"
+ << SEND_EXIT;
+ }
+
+ break;
+ }
+
+ case AVM_OPCODE_DIV:
+ case AVM_OPCODE_POW:
+ case AVM_OPCODE_MOD:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unsupported arithmetic expression Operator "
+ "<< DIV | EXP | MOD >> !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+
+ case AVM_OPCODE_EQ:
+ case AVM_OPCODE_NEQ:
+ case AVM_OPCODE_LT:
+ case AVM_OPCODE_LTE:
+ case AVM_OPCODE_GT:
+ case AVM_OPCODE_GTE:
+ case AVM_OPCODE_NOT:
+ case AVM_OPCODE_AND:
+ case AVM_OPCODE_NAND:
+ case AVM_OPCODE_XAND:
+ case AVM_OPCODE_OR:
+ case AVM_OPCODE_NOR:
+ case AVM_OPCODE_XOR:
+ case AVM_OPCODE_XNOR:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected boolean expression Operator << "
+ << aCode->str() << " >> !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected BASEFORM KIND for execution\n"
+ << aCode->toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+ break;
+ }
+ }
+
+ break;
+ }
+
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ constraintNode.update_coef(
+ getParameterID(exprForm.to_ptr< InstanceOfData >()) ,
+ coefficient );
+
+ break;
+ }
+
+
+ case FORM_BUILTIN_BOOLEAN_KIND: // true <=> 1 ; false <=> 0
+ {
+ constraintNode.update_const(
+ ( exprForm.to_ptr< Boolean >()->getValue() ) ? 1 : 0 );
+
+ break;
+ }
+
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ constraintNode.update_const(
+ coefficient * exprForm.to_ptr< Integer >()->toInteger() );
+
+ break;
+ }
+
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ AVM_OS_WARNING_ALERT << "Unsupported builtin Rational !!!"
+ << SEND_ALERT;
+
+ if( exprForm.to_ptr< Rational >()->isInteger() )
+ {
+ constraintNode.update_const(
+ coefficient * exprForm.to_ptr< Rational >()->toInteger() );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unsupported built-in Rational !!!"
+ << SEND_EXIT;
+ }
+
+ break;
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ AVM_OS_WARNING_ALERT << "Unsupported built-in Float !!!"
+ << SEND_ALERT;
+
+ if( exprForm.to_ptr< Float >()->isInteger() )
+ {
+ constraintNode.update_const(
+ coefficient * exprForm.to_ptr< Float >()->toInteger() );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unsupported built-in Float !!!"
+ << SEND_EXIT;
+ }
+
+ break;
+ }
+
+
+ case FORM_RUNTIME_ID_KIND:
+ {
+ constraintNode.update_const( coefficient * exprForm.bfRID().getRid() );
+
+ break;
+ }
+
+
+ case FORM_BUILTIN_CHARACTER_KIND:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unsupported built-in Character !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+
+ case FORM_BUILTIN_STRING_KIND:
+ case FORM_BUILTIN_QUALIFIED_IDENTIFIER_KIND:
+ case FORM_BUILTIN_IDENTIFIER_KIND:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unsupported built-in String "
+ "< STRING | UFI | IDENTIFIER > or Operator !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+
+ case FORM_OPERATOR_KIND:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unsupported Operator expression !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+
+
+ case FORM_INSTANCE_BUFFER_KIND:
+ case FORM_INSTANCE_CONNECTOR_KIND:
+ case FORM_INSTANCE_MACHINE_KIND:
+ case FORM_INSTANCE_PORT_KIND:
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected BASEFORM KIND as expression << "
+ << exprForm.str() << " >> !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+}
+
+
+/**
+ * SOLVER
+ */
+bool OmegaSolver::solveImpl(const BF & aCondition,
+ BFVector & dataVector, BFVector & valuesVector)
+{
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << "OmegaSolver::solve(...) "
+ ":" << SOLVER_SESSION_ID << ">" << std::endl
+ << "\t" << aCondition.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ // !!!! NE FAIT RIEN POUR L'INSTANT
+
+ return(false);
+}
+
+
+}
+
+
+#endif /* _AVM_SOLVER_OMEGA_ */
diff --git a/org.eclipse.efm.symbex/src/solver/OmegaSolver.h b/org.eclipse.efm.symbex/src/solver/OmegaSolver.h
new file mode 100644
index 0000000..5bc5d84
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/solver/OmegaSolver.h
@@ -0,0 +1,193 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef SOLVER_OMEGA_H_
+#define SOLVER_OMEGA_H_
+
+#include <solver/api/SolverDef.h>
+/*
+ * Here because "SolverDef.h" could define this macro
+ */
+#if defined( _AVM_SOLVER_OMEGA_ )
+
+
+#include <solver/api/SatSolver.h>
+
+#include <collection/Typedef.h>
+
+#include <fml/executable/InstanceOfData.h>
+
+#if defined( _AVM_BUILTIN_NUMERIC_BOOST_ )
+
+// Due to compilation ambiguity between boost::swap & omega::swap
+#include <fml/numeric/Float.h>
+
+#endif /* _AVM_BUILTIN_NUMERIC_BOOST_ */
+
+////////////////////////////////////////////////////////////////////////////////
+// OMEGA & this old special ASSERT feature
+#include "omega.h"
+#undef assert
+#undef _assert
+////////////////////////////////////////////////////////////////////////////////
+
+
+
+namespace sep
+{
+
+class APExecutionData;
+class ExecutionData;
+class ExecutionContext;
+
+class WObject;
+
+
+class OmegaSolver : public SatSolver
+{
+
+ AVM_DECLARE_UNCLONABLE_CLASS(OmegaSolver)
+
+
+public:
+ /*
+ ***************************************************************************
+ * ID
+ ***************************************************************************
+ */
+ static std::string ID;
+
+ static std::string DESCRIPTION;
+
+ static avm_uint64_t SOLVER_SESSION_ID;
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ bool isConfigureFlag;
+
+ VectorOfInstanceOfData mTableOfVariableInstance;
+ std::vector< omega::Variable_ID > mTableOfVariableID;
+
+ VectorOfInstanceOfData mTableOfVar4ParamInstance;
+
+ VectorOfInstanceOfData mTableOfParameterInstance;
+ std::vector< omega::Variable_ID > mTableOfParameterID;
+
+ omega::F_Declaration * registerExistQuantifier;
+
+ const ExecutionContext * mCacheForNewEC;
+ omega::Relation mCacheForNewRelation;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ OmegaSolver()
+ : SatSolver(),
+ isConfigureFlag( false ),
+ registerExistQuantifier( NULL ),
+ mCacheForNewEC( NULL ),
+ mCacheForNewRelation( Relation::Null() )
+ {
+ //!! NOTHING
+ resetParameterTable();
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~OmegaSolver()
+ {
+ mCacheForNewRelation = Relation::Null();
+
+ resetVariableTable();
+ }
+
+ /**
+ * CONFIGURE
+ */
+ virtual bool configure(
+ Configuration & aConfiguration, WObject * wfFilterObject,
+ ListOfPairMachineData & listOfSelectedVariable);
+
+ /**
+ * RESET VARIABLE or PARAMETER
+ */
+ void resetVariableTable();
+ void resetParameterTable();
+
+ /**
+ * SET VARIABLE or PARAMETER
+ */
+ virtual void setSelectedVariable(const ExecutionData & apED,
+ ListOfPairMachineData & listOfSelectedVariable);
+
+ void setSelectedVariable(const ExecutionData & apED);
+ void setSelectedVariable(const ExecutionData & apED,
+ ListOfInstanceOfData & aLisOfAdditionnalVar);
+
+
+
+ /**
+ * PROVER
+ */
+ virtual bool isSubSet(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC);
+
+ virtual bool isEqualSet(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC);
+
+ virtual bool isEmptyIntersection(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC);
+
+ virtual SolverDef::SATISFIABILITY_RING isSatisfiable(const BF & aCondition);
+
+ /**
+ * SOLVER
+ */
+ virtual bool solveImpl(const BF & aCondition,
+ BFVector & dataVector, BFVector & valuesVector);
+
+
+ /**
+ * TOOLS
+ */
+ bool isSubSet(omega::Relation & Rel1, omega::Relation & Rel2);
+ bool isEqualSet(omega::Relation & Rel1, omega::Relation & Rel2);
+ bool isEmptyIntersection(omega::Relation & Rel1, omega::Relation & Rel2);
+
+ bool setParameterUple(omega::Relation & aRelation);
+
+ bool toRelation(const ExecutionData & anED, omega::Relation & aRelation);
+
+ omega::Variable_ID getParameterID(InstanceOfData * aParameter);
+
+ void toConjonction(omega::F_And * andNode, const BF & exprForm);
+
+ void toConstraint(omega::Constraint_Handle & constraintNode,
+ int coefficient, const BF & exprForm);
+
+};
+
+} /* namespace sep */
+
+#endif /* _AVM_SOLVER_OMEGA_ */
+
+
+#endif /*SOLVER_OMEGA_H_*/
diff --git a/org.eclipse.efm.symbex/src/solver/README.md b/org.eclipse.efm.symbex/src/solver/README.md
new file mode 100644
index 0000000..12876ee
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/solver/README.md
@@ -0,0 +1,11 @@
+# EFM-SYMBEX : Solver
+
+## Source code structure
+
+### Interfaces
+* **Isolver**
+
+### Classes
+
+### Factories
+* **Solver**
diff --git a/org.eclipse.efm.symbex/src/solver/Z3Solver.cpp b/org.eclipse.efm.symbex/src/solver/Z3Solver.cpp
new file mode 100644
index 0000000..15d107a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/solver/Z3Solver.cpp
@@ -0,0 +1,2746 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 29 févr. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "Z3Solver.h"
+
+/*
+ * Here because "SolverDef.h" could define this macro
+ */
+#if defined( _AVM_SOLVER_Z3_ )
+
+
+#include <util/avm_vfs.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/builtin/Boolean.h>
+#include <fml/builtin/Character.h>
+#include <fml/expression/BuiltinContainer.h>
+#include <fml/expression/ExpressionComparer.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/ExpressionFactory.h>
+#include <fml/expression/ExpressionTypeChecker.h>
+#include <fml/numeric/Float.h>
+#include <fml/numeric/Integer.h>
+#include <fml/numeric/Rational.h>
+
+#include <fml/operator/Operator.h>
+
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeForm.h>
+#include <fml/runtime/RuntimeID.h>
+#include <fml/runtime/TableOfData.h>
+
+#include <fml/type/TypeManager.h>
+
+#include <fml/workflow/WObject.h>
+
+#include <fstream>
+
+
+namespace sep
+{
+
+/*
+ *******************************************************************************
+ * ID
+ *******************************************************************************
+ */
+std::string Z3Solver::ID = "Z3";
+
+std::string Z3Solver::DESCRIPTION = "Z3 "
+ "'High-performance Theorem Prover at Microsoft Research, MIT License'";
+
+avm_uint64_t Z3Solver::SOLVER_SESSION_ID = 0;
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+#if defined( _AVM_SOLVER_Z3_CPP_ )
+
+
+/**
+ * CREATE - DESTROY
+ * ValidityChecker
+ */
+
+
+bool Z3Solver::createChecker(z3::config & cfg, z3::context & ctx)
+{
+ CFG = & cfg;
+
+ CFG->set("MODEL", "true");
+
+ CTX = & ctx;
+
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ ++SOLVER_SESSION_ID;
+AVM_IF_DEBUG_LEVEL_GTE_HIGH
+ mLogFolderLocation = OSS << VFS::ProjectLogPath << "/z3/";
+
+ if ( not VFS::checkWritingFolder(mLogFolderLocation) )
+ {
+ AVM_OS_LOG << " Z3Solver::createChecker :> Error: The folder "
+ << "`" << mLogFolderLocation << "' "
+ << "---> doesn't exist or is not writable !!!"
+ << std::endl << std::endl;
+ return( false );
+ }
+AVM_ENDIF_DEBUG_LEVEL_GTE_HIGH
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ SMT_CST_BOOL_TRUE = CTX->bool_val(true);
+ SMT_CST_BOOL_FALSE = CTX->bool_val(false);
+
+ resetTable();
+
+ return( true );
+}
+
+
+bool Z3Solver::destroyChecker()
+{
+ resetTable();
+
+ CFG = NULL;
+
+ CTX = NULL;
+
+ return( true );
+}
+
+bool Z3Solver::resetTable()
+{
+ base_this_type::resetTable();
+
+ mTableOfParameterDecl.append( z3::symbol(*CTX, 0) );
+
+ mTableOfParameterExpr.append( z3::expr(*CTX) );
+
+ return( true );
+}
+
+
+
+/**
+ * PROVER
+ */
+bool Z3Solver::isSubSet(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+{
+ return( true );
+}
+
+bool Z3Solver::isEqualSet(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+{
+ return( true );
+}
+
+SolverDef::SATISFIABILITY_RING Z3Solver::isSatisfiable(const BF & aCondition)
+{
+ SolverDef::SATISFIABILITY_RING satisfiability = SolverDef::SATISFIABLE;
+
+ z3::config cfg;
+ z3::context ctx;
+ createChecker(cfg, ctx);
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << "Z3Solver::isSatisfiable(...) "
+ ":" << SOLVER_SESSION_ID << ">" << std::endl
+ << "\t" << aCondition.str() << std::endl;
+
+ // trace to file
+AVM_IF_DEBUG_LEVEL_GTE_HIGH
+ smt_check_sat(aCondition);
+AVM_ENDIF_DEBUG_LEVEL_GTE_HIGH
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ z3::expr z3Condition = from_baseform(aCondition);
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << "Z3Condition :" << SOLVER_SESSION_ID << ">" << std::endl
+ << "\t" << z3Condition << std::endl;
+AVM_IF_DEBUG_LEVEL_GTE_HIGH
+ AVM_OS_TRACE << "Z3::CTX :" << SOLVER_SESSION_ID << ">" << std::endl
+ << ctx << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_GTE_HIGH
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ //if( z3Condition != NULL )
+ {
+ z3::solver z3Solver(*CTX);
+
+ z3Solver.add( z3Condition );
+
+ switch( z3Solver.check() )
+ {
+ case z3::sat:
+ {
+ satisfiability = SolverDef::SATISFIABLE;
+ break;
+ }
+
+ case z3::unsat:
+ {
+ satisfiability = SolverDef::UNSATISFIABLE;
+ break;
+ }
+
+ case z3::unknown:
+ {
+ satisfiability = SolverDef::UNKNOWN_SAT;
+ break;
+ }
+
+ default:
+ {
+ satisfiability = SolverDef::ABORT_SAT;
+ break;
+ }
+ }
+ }
+
+destroyChecker();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << "result :" << SOLVER_SESSION_ID << "> "
+ << SolverDef::strSatisfiability(satisfiability) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ return( satisfiability );
+}
+
+
+/**
+ * SOLVER
+ */
+bool Z3Solver::solveImpl(const BF & aCondition,
+ BFVector & dataVector, BFVector & valuesVector)
+{
+ SolverDef::SATISFIABILITY_RING satisfiability = SolverDef::SATISFIABLE;
+
+ z3::config cfg;
+ z3::context ctx;
+ createChecker(cfg, ctx);
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << "Z3Solver::solve(...) :"
+ << SOLVER_SESSION_ID << ">" << std::endl
+ << "\t" << aCondition.str() << std::endl;
+
+ // trace to file
+ smt_check_model(aCondition, dataVector, valuesVector);
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ z3::expr z3Condition = from_baseform(aCondition);
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << "Z3Condition :" << SOLVER_SESSION_ID << ">" << std::endl
+ << "\t" << z3Condition << std::endl;
+AVM_IF_DEBUG_LEVEL_GTE_HIGH
+ AVM_OS_TRACE << "Z3::CTX :" << SOLVER_SESSION_ID << ">" << std::endl
+ << ctx << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_GTE_HIGH
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ z3::solver z3Solver(*CTX);
+
+ z3Solver.add( z3Condition );
+
+ switch( z3Solver.check() )
+ {
+ case z3::sat:
+ {
+ satisfiability = SolverDef::SATISFIABLE;
+ break;
+ }
+
+ case z3::unsat:
+ {
+ satisfiability = SolverDef::UNSATISFIABLE;
+ break;
+ }
+
+ case z3::unknown:
+ {
+ satisfiability = SolverDef::UNKNOWN_SAT;
+ break;
+ }
+
+ default:
+ {
+ satisfiability = SolverDef::ABORT_SAT;
+ break;
+ }
+ }
+
+ //if( z3Condition != NULL )
+ {
+ z3::solver z3Solver(*CTX);
+
+ z3Solver.add( z3Condition );
+
+ switch( z3Solver.check() )
+ {
+ case z3::sat:
+ {
+ satisfiability = SolverDef::SATISFIABLE;
+
+ z3::model z3Model = z3Solver.get_model();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << "Z3Model sat:" << SOLVER_SESSION_ID << ">"
+ << std::endl << z3Model << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ unsigned num_constants = z3Model.num_consts();
+ for( unsigned i = 0 ; i < num_constants ; i++ )
+ {
+ z3::func_decl paramDecl = z3Model.get_const_decl(i);
+
+ z3::symbol paramSymbol = z3Model.get_const_decl(i).name();
+
+ z3::expr value = z3Model.get_const_interp(paramDecl);
+
+ int offset = mTableOfParameterDecl.find(paramSymbol);
+ if( offset >= 0 )
+ {
+ dataVector.append( mTableOfParameterInstance[offset] );
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << paramSymbol << " := ";
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ BF bfVal = to_baseform( z3Model, value);
+
+ valuesVector.append( bfVal.valid() ?
+ bfVal : dataVector.back() );
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << value << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Z3Solver::solve :> unfound "
+ "parameter instance for Z3 symbol << "
+ << paramSymbol << " >> !!!"
+ << SEND_EXIT;
+ }
+ }
+
+
+ break;
+ break;
+ }
+
+ case z3::unsat:
+ {
+ satisfiability = SolverDef::UNSATISFIABLE;
+ break;
+ }
+
+ case z3::unknown:
+ {
+ satisfiability = SolverDef::UNKNOWN_SAT;
+
+ break;
+ }
+
+ default:
+ {
+ satisfiability = SolverDef::ABORT_SAT;
+ break;
+ }
+ }
+ }
+
+ destroyChecker();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << "solve :" << SOLVER_SESSION_ID << "> "
+ << SolverDef::strSatisfiability(satisfiability) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ return( satisfiability == SolverDef::SATISFIABLE );
+}
+
+
+
+/**
+ * TOOLS
+ */
+z3::sort Z3Solver::getZ3Type(BaseTypeSpecifier * bts)
+{
+ if( bts->isTypedBoolean() )
+ {
+ return( CTX->bool_sort() );
+ }
+
+ else if( bts->isTypedEnum() )
+ {
+ return( CTX->int_sort() );
+ // TODO Attention : il faudrait rajouter les contraintes
+ // d'intervalle pour le type énuméré
+ }
+ else if( bts->weaklyTypedInteger() )
+ {
+ return( CTX->int_sort() );
+ }
+
+ else if( bts->weaklyTypedReal() )
+ {
+ return( CTX->real_sort() );
+ }
+
+ return( CTX->real_sort() );
+}
+
+
+z3::expr Z3Solver::getParameterExpr(const BF & bfParameter)
+{
+ InstanceOfData * aParameter = bfParameter.to_ptr< InstanceOfData >();
+
+ if( aParameter->getMark() == 0 )
+ {
+ aParameter->setMark( mTableOfParameterInstance.size() );
+ mTableOfParameterInstance.append( bfParameter );
+
+ mTableOfParameterDecl.push_back(
+ CTX->str_symbol(aParameter->getNameID().c_str()) );
+
+ mTableOfParameterExpr.push_back(
+ CTX->constant(mTableOfParameterDecl.last(),
+ getZ3Type(aParameter->referedTypeSpecifier())) );
+ }
+
+ return( mTableOfParameterExpr.at( aParameter->getMark() ) );
+}
+
+
+
+
+z3::expr Z3Solver::getVariableExpr(InstanceOfData * aVar, std::size_t varID)
+{
+ if( mTableOfVariableExpr.size() <= varID )
+ {
+ mTableOfVariableDecl.push_back(
+ CTX->str_symbol(aVar->getNameID().c_str()) );
+
+ mTableOfVariableExpr.push_back(
+ CTX->constant(mTableOfVariableDecl.last(),
+ getZ3Type(aVar->getTypeSpecifier())) );
+ }
+
+ return( mTableOfVariableExpr.at( varID ) );
+}
+
+
+z3::expr Z3Solver::safe_from_baseform(const BF & exprForm,
+ BaseTypeSpecifier * typeSpecifier)
+{
+ z3::expr e(*CTX);
+
+ try
+ {
+ e = from_baseform(exprForm, typeSpecifier);
+
+ destroyChecker();
+ }
+ catch ( ... )
+ {
+ AVM_OS_WARN << std::endl << REPEAT("********", 10) << std::endl
+ << "\tZ3Solver::safe_from_baseform< unknown::exception :"
+ << SOLVER_SESSION_ID << ">" << std::endl
+ << REPEAT("--------", 10) << std::endl
+ << "\tFailed to CONVERT sep::fml::expression to Z3::Expr:>" << std::endl
+ << "\t " << exprForm.str(" ") << std::endl
+ << REPEAT("********", 10) << std::endl;
+
+ destroyChecker();
+ }
+
+ return( e );
+}
+
+
+z3::expr Z3Solver::from_baseform(const BF & exprForm,
+ BaseTypeSpecifier * typeSpecifier)
+{
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( exprForm ) << "expression !!!"
+ << SEND_EXIT;
+
+
+ switch( exprForm.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ AvmCode * aCode = exprForm.to_ptr< AvmCode >();
+
+ typeSpecifier = TypeManager::UNIVERSAL;
+
+ switch( aCode->getAvmOpCode() )
+ {
+ // COMPARISON OPERATION
+ case AVM_OPCODE_EQ:
+ {
+ return( from_baseform(aCode->first() , typeSpecifier) ==
+ from_baseform(aCode->second(), typeSpecifier) );
+ }
+
+ case AVM_OPCODE_NEQ:
+ {
+ return( from_baseform(aCode->first() , typeSpecifier) !=
+ from_baseform(aCode->second(), typeSpecifier) );
+
+// ARGS arg( 2 );
+//
+// arg.next( from_baseform(aCode->first() , typeSpecifier) );
+// arg.next( from_baseform(aCode->second(), typeSpecifier) );
+//
+// return( Z3_mk_distinct(CTX, 2, arg->table) );
+ }
+
+ case AVM_OPCODE_LT:
+ {
+ return( from_baseform(aCode->first() , typeSpecifier) <
+ from_baseform(aCode->second(), typeSpecifier) );
+ }
+
+ case AVM_OPCODE_LTE:
+ {
+ return( from_baseform(aCode->first() , typeSpecifier) <=
+ from_baseform(aCode->second(), typeSpecifier) );
+ }
+
+ case AVM_OPCODE_GT:
+ {
+ return( from_baseform(aCode->first() , typeSpecifier) >
+ from_baseform(aCode->second(), typeSpecifier) );
+ }
+
+ case AVM_OPCODE_GTE:
+ {
+ return( from_baseform(aCode->first() , typeSpecifier) >=
+ from_baseform(aCode->second(), typeSpecifier) );
+ }
+
+
+ case AVM_OPCODE_CONTAINS:
+ {
+ BuiltinCollection * aCollection =
+ aCode->first().to_ptr< BuiltinCollection >();
+
+ if( aCollection->singleton() )
+ {
+ return( from_baseform(aCollection->at(0), typeSpecifier) ==
+ from_baseform(aCode->second(), typeSpecifier) );
+ }
+ else if( aCollection->populated() )
+ {
+ std::size_t colSize = aCollection->size();
+ const BF & elt = aCode->second();
+
+ z3::expr z3Or = ( from_baseform(elt, typeSpecifier) ==
+ from_baseform(aCollection->at(0), typeSpecifier) );
+
+ for( std::size_t offset = 1 ; offset < colSize ; ++offset )
+ {
+ z3Or = z3Or || (from_baseform(elt, typeSpecifier) ==
+ from_baseform(aCollection->at(offset), typeSpecifier));
+ }
+
+ return( z3Or );
+ }
+ else
+ {
+ return( ((typeSpecifier != NULL) &&
+ typeSpecifier->isTypedBoolean()) ?
+ CTX->bool_val(false) : CTX->int_val(0) );
+ }
+ }
+
+
+ // LOGICAL OPERATION
+ case AVM_OPCODE_NOT:
+ {
+ return( not from_baseform(
+ aCode->first(), TypeManager::BOOLEAN) );
+ }
+
+ case AVM_OPCODE_AND:
+ {
+ z3::expr z3And =
+ from_baseform(aCode->first(), TypeManager::BOOLEAN) &&
+ from_baseform(aCode->second(), TypeManager::BOOLEAN);
+
+ for( std::size_t offset = 2 ; offset < aCode->size() ; ++offset )
+ {
+ z3And = z3And && from_baseform(
+ aCode->at(offset), TypeManager::BOOLEAN);
+ }
+
+ return( z3And );
+ }
+
+ case AVM_OPCODE_NAND:
+ {
+ z3::expr z3And =
+ from_baseform(aCode->first(), TypeManager::BOOLEAN) &&
+ from_baseform(aCode->second(), TypeManager::BOOLEAN);
+
+ for( std::size_t offset = 2 ; offset < aCode->size() ; ++offset )
+ {
+ z3And = z3And && from_baseform(
+ aCode->at(offset), TypeManager::BOOLEAN);
+ }
+
+ return( not z3And );
+ }
+
+// case AVM_OPCODE_XAND:
+
+ case AVM_OPCODE_OR:
+ {
+ z3::expr z3Or =
+ from_baseform(aCode->first(), TypeManager::BOOLEAN) ||
+ from_baseform(aCode->second(), TypeManager::BOOLEAN);
+
+ for( std::size_t offset = 2 ; offset < aCode->size() ; ++offset )
+ {
+ z3Or = z3Or || from_baseform(
+ aCode->at(offset), TypeManager::BOOLEAN);
+ }
+
+ return( z3Or );
+ }
+
+ case AVM_OPCODE_NOR:
+ {
+ z3::expr z3Or =
+ from_baseform(aCode->first(), TypeManager::BOOLEAN) ||
+ from_baseform(aCode->second(), TypeManager::BOOLEAN);
+
+ for( std::size_t offset = 2 ; offset < aCode->size() ; ++offset )
+ {
+ z3Or = z3Or || from_baseform(
+ aCode->at(offset), TypeManager::BOOLEAN);
+ }
+
+ return( not z3Or );
+ }
+
+
+ // BITWISE OPERATION
+// case AVM_OPCODE_BAND:
+// case AVM_OPCODE_BOR:
+// case AVM_OPCODE_LSHIFT:
+// case AVM_OPCODE_RSHIFT:
+
+ case AVM_OPCODE_XOR:
+ {
+ z3::expr arg0 = from_baseform(
+ aCode->first(), TypeManager::BOOLEAN);
+
+ z3::expr arg1 = from_baseform(
+ aCode->second(), TypeManager::BOOLEAN);
+
+ return( (arg0 && (! arg1)) || ((! arg0) && arg1) );
+ }
+
+// case AVM_OPCODE_XNOR:
+
+
+ // ARITHMETIC OPERATION
+ case AVM_OPCODE_PLUS:
+ {
+ z3::expr z3Plus =
+ from_baseform(aCode->first(), typeSpecifier) +
+ from_baseform(aCode->second(), typeSpecifier);
+
+ for( std::size_t offset = 2 ; offset < aCode->size() ; ++offset )
+ {
+ z3Plus = z3Plus +
+ from_baseform(aCode->at(offset), typeSpecifier);
+ }
+
+ return( z3Plus );
+ }
+
+ case AVM_OPCODE_UMINUS:
+ {
+ return( - from_baseform(aCode->first(), typeSpecifier) );
+ }
+
+ case AVM_OPCODE_MINUS:
+ {
+ z3::expr z3Minus =
+ from_baseform(aCode->first(), typeSpecifier) -
+ from_baseform(aCode->second(), typeSpecifier);
+
+ for( std::size_t offset = 2 ; offset < aCode->size() ; ++offset )
+ {
+ z3Minus = z3Minus -
+ from_baseform(aCode->at(offset), typeSpecifier);
+ }
+
+ return( z3Minus );
+ }
+
+ case AVM_OPCODE_MULT:
+ {
+ z3::expr z3Mult =
+ from_baseform(aCode->first(), typeSpecifier) *
+ from_baseform(aCode->second(), typeSpecifier);
+
+ for( std::size_t offset = 2 ; offset < aCode->size() ; ++offset )
+ {
+ z3Mult = z3Mult *
+ from_baseform(aCode->at(offset), typeSpecifier);
+ }
+
+ return( z3Mult );
+ }
+
+ case AVM_OPCODE_DIV:
+ {
+ return( from_baseform(aCode->first() , typeSpecifier) /
+ from_baseform(aCode->second(), typeSpecifier) );
+ }
+
+ case AVM_OPCODE_POW:
+ {
+
+// if( ExpressionFactory::isInt32(aCode->second()) )
+// {
+// return( std::pw(
+// from_baseform(aCode->first() , typeSpecifier),
+// from_baseform(aCode->second() , typeSpecifier) ) );
+// }
+// else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Z3Solver::from_baseform:> "
+ "Unsupported expression Operator "
+ "<< AVM_OPCODE_POW >> !!!"
+ << SEND_EXIT;
+
+ return( z3::expr(*CTX) );
+ }
+ }
+
+// case AVM_OPCODE_MOD:
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Z3Solver::from_baseform:> "
+ "Unexpected expression !!!\n"
+ << aCode->toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ return( z3::expr(*CTX) );
+ }
+ }
+
+ break;
+ }
+
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ return( getParameterExpr( exprForm ) );
+ }
+
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ {
+ return( CTX->bool_val(
+ exprForm.to_ptr< Boolean >()->getValue() ) );
+ }
+
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ if( (typeSpecifier != NULL) && typeSpecifier->isTypedBoolean() )
+ {
+// return( CTX->bool_val(
+// not exprForm.to_ptr< Integer >()->isZero() ) );
+
+ return( exprForm.to_ptr< Integer >()->isZero() ?
+ SMT_CST_BOOL_FALSE : SMT_CST_BOOL_TRUE );
+ }
+ else
+ {
+#if defined( _AVM_BUILTIN_NUMERIC_GMP_ )
+
+ return( CTX->int_val( static_cast< __int64 >(
+ exprForm.to_ptr< Integer >()->toInteger() ) ) );
+
+#else
+
+ return( CTX->int_val( static_cast< __int64 >(
+ exprForm.to_ptr< Integer >()->toInteger() ) ) );
+
+#endif /* _AVM_BUILTIN_NUMERIC_GMP_ */
+ }
+
+// return( CTX->int_val( exprForm.to_ptr< Integer >()->str().c_str() ) );
+ }
+
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ if( (typeSpecifier != NULL) && typeSpecifier->isTypedBoolean() )
+ {
+// return( CTX->bool_val(
+// not exprForm.to_ptr< Rational >()->isZero() ) );
+
+ return( exprForm.to_ptr< Rational >()->isZero() ?
+ SMT_CST_BOOL_FALSE : SMT_CST_BOOL_TRUE );
+ }
+ else
+ {
+#if defined( _AVM_BUILTIN_NUMERIC_GMP_ )
+
+ return( CTX->real_val(
+ exprForm.to_ptr< Rational >()->toNumerator(),
+ exprForm.to_ptr< Rational >()->toDenominator() ) );
+
+#else
+
+ return( CTX->real_val(
+ exprForm.to_ptr< Rational >()->toNumerator(),
+ exprForm.to_ptr< Rational >()->toDenominator() ) );
+
+#endif /* _AVM_BUILTIN_NUMERIC_GMP_ */
+ }
+
+// return( CTX->real_val( exprForm.to_ptr< Rational >()->str().c_str() ) );
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ if( (typeSpecifier != NULL) && typeSpecifier->isTypedBoolean() )
+ {
+// return( CTX->bool_val(
+// not exprForm.to_ptr< Float >()->isZero() ) );
+
+ return( exprForm.to_ptr< Float >()->isZero() ?
+ SMT_CST_BOOL_FALSE : SMT_CST_BOOL_TRUE );
+ }
+ else
+ {
+#if defined( _AVM_BUILTIN_NUMERIC_GMP_ )
+
+ return( CTX->real_val(
+ exprForm.to_ptr< Float >()->str().c_str() ) );
+
+#else
+
+ return( CTX->real_val(
+ exprForm.to_ptr< Float >()->str().c_str() ) );
+
+#endif /* _AVM_BUILTIN_NUMERIC_GMP_ */
+ }
+ }
+
+
+ case FORM_RUNTIME_ID_KIND:
+ {
+ return( CTX->int_val( exprForm.bfRID().getRid() ) );
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Z3Solver::from_baseform:> Unexpected BASEFORM KIND << "
+ << exprForm.classKindName() << " >> as expression << "
+ << exprForm.str() << " >> !!!"
+ << SEND_EXIT;
+
+ return( z3::expr(*CTX) );
+ }
+ }
+
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Z3Solver::from_baseform ERROR !!!"
+ << SEND_EXIT;
+
+ return( z3::expr(*CTX) );
+}
+
+
+BF Z3Solver::to_baseform(z3::model z3Model, z3::expr z3Form)
+{
+ std::ostringstream oss;
+ oss << z3Form;
+
+ if( z3Form.is_bool() )
+ {
+ return( ExpressionConstructor::newBoolean( oss.str() ) );
+ }
+ else if( z3Form.is_int() )
+ {
+ return( ExpressionConstructor::newInteger( oss.str() ) );
+ }
+ else if( z3Form.is_real() )
+ {
+ return( ExpressionConstructor::newFloat( oss.str() ) );
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+/**
+ * Using file API
+ */
+
+SolverDef::SATISFIABILITY_RING Z3Solver::smt_check_sat(const BF & aCondition)
+{
+ SolverDef::SATISFIABILITY_RING satisfiability = SolverDef::SATISFIABLE;
+
+ BFVector paramVector;
+
+ StringOutStream ossCondition("", "\t", "");
+ to_smt(ossCondition, aCondition, paramVector);
+
+ std::string fileLocation = OSS << mLogFolderLocation,
+ << "z3_check_sat_" << SOLVER_SESSION_ID << ".smt";
+ std::ofstream osFile;
+ osFile.open(fileLocation.c_str(), std::ios_base::out);
+ if ( osFile.good() )
+ {
+// osFile << "(echo \"" << aCondition.str() << "\")" << std::endl;
+
+ InstanceOfData * aParam;
+
+ std::size_t paramCount = paramVector.size();
+ for( std::size_t offset = 0 ; offset < paramCount ; offset++ )
+ {
+ aParam = paramVector[ offset ].to_ptr< InstanceOfData >();
+
+ osFile << "(declare-const " << aParam->getFullyQualifiedNameID()
+ << " ";
+ if( aParam->isTypedBoolean() )
+ {
+ osFile << "Bool";
+ }
+ else if( aParam->weaklyTypedInteger() ||
+ aParam->isTypedEnum() )
+ {
+ osFile << "Int";
+ }
+ else if( aParam->weaklyTypedReal() )
+ {
+ osFile << "Real";
+ }
+ else
+ {
+ osFile << "Unknown";
+ }
+ osFile << ")" << std::endl;
+ }
+
+ osFile << "(assert " << ossCondition.str() << ")" << std::endl;
+
+ osFile << "(check-sat)" << std::endl;
+
+ osFile.close();
+ }
+ else
+ {
+ return( SolverDef::ABORT_SAT );
+ }
+
+
+ return( satisfiability );
+}
+
+bool Z3Solver::smt_check_model(const BF & aCondition,
+ BFVector & dataVector, BFVector & valuesVector)
+{
+ BFVector paramVector;
+
+ StringOutStream ossCondition("", "\t", "");
+ to_smt(ossCondition, aCondition, paramVector);
+
+ std::string fileLocation = OSS << mLogFolderLocation
+ << "z3_check_sat_" << SOLVER_SESSION_ID << ".smt";
+ std::ofstream osFile;
+ osFile.open(fileLocation.c_str(), std::ios_base::out);
+ if ( osFile.good() )
+ {
+// osFile << "(echo \"" << aCondition.str() << "\")" << std::endl;
+
+ InstanceOfData * aParam;
+
+ std::size_t paramCount = paramVector.size();
+ for( std::size_t offset = 0 ; offset < paramCount ; offset++ )
+ {
+ aParam = paramVector[ offset ].to_ptr< InstanceOfData >();
+
+ osFile << "(declare-const " << aParam->getFullyQualifiedNameID()
+ << " ";
+ if( aParam->isTypedBoolean() )
+ {
+ osFile << "Bool";
+ }
+ else if( aParam->weaklyTypedInteger() ||
+ aParam->isTypedEnum() )
+ {
+ osFile << "Int";
+ }
+ else if( aParam->weaklyTypedReal() )
+ {
+ osFile << "Real";
+ }
+ else
+ {
+ osFile << "Unknown";
+ }
+ osFile << ")" << std::endl;
+ }
+
+ osFile << "(assert " << ossCondition.str() << ")" << std::endl;
+
+ osFile << "(get-model)" << std::endl;
+
+ osFile.close();
+ }
+ else
+ {
+ return( false );
+ }
+
+ return( true );
+}
+
+
+
+SolverDef::SATISFIABILITY_RING Z3Solver::from_smt_sat(const BF & aCondition)
+{
+ SolverDef::SATISFIABILITY_RING satisfiability = SolverDef::SATISFIABLE;
+
+
+ return( satisfiability );
+}
+
+bool Z3Solver::from_smt_model(const BF & aCondition,
+ BFVector & dataVector, BFVector & valuesVector)
+{
+ return( true );
+}
+
+
+
+void Z3Solver::to_smt(OutStream & os,
+ const BF & exprForm, BFVector & dataVector) const
+{
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( exprForm ) << "expression !!!"
+ << SEND_EXIT;
+
+ os << TAB;
+
+ switch( exprForm.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ AvmCode * aCode = exprForm.to_ptr< AvmCode >();
+
+ os << '(';
+ std::string eoe = "";
+
+ switch( aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_AND:
+ {
+ os << "and";
+ break;
+ }
+ case AVM_OPCODE_OR:
+ {
+ os << "or";
+ break;
+ }
+ case AVM_OPCODE_NOT:
+ {
+ os << "not";
+ break;
+ }
+
+ case AVM_OPCODE_NEQ:
+ {
+ os << "(not";
+ eoe = ")";
+ break;
+ }
+
+ case AVM_OPCODE_IFE:
+ {
+ os << "ite";
+ break;
+ }
+
+ case AVM_OPCODE_IF:
+ {
+ os << "if";
+ break;
+ }
+
+ default:
+ {
+ os << aCode->getOperator()->strSMT();
+ break;
+
+ }
+ }
+
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator endIt = aCode->end();
+ for( ; it != endIt ; ++it )
+ {
+ os << " ";
+ to_smt(os, *it, dataVector);
+ }
+
+ os << eoe << ')';
+
+ break;
+ }
+
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ dataVector.add_union( exprForm );
+ os << exprForm.to_ptr< InstanceOfData >()->getFullyQualifiedNameID();
+
+ break;
+ }
+
+
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ case FORM_BUILTIN_INTEGER_KIND:
+ case FORM_BUILTIN_RATIONAL_KIND:
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ os << exprForm.str();
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected BASEFORM KIND as expression << "
+ << exprForm.str() << " >> !!!"
+ << SEND_EXIT;
+
+ os << exprForm.str();
+
+ break;
+ }
+ }
+
+ os << EOL;
+}
+
+
+#else /* NOT _AVM_SOLVER_Z3_CPP_ ==> _AVM_SOLVER_Z3_C << default >> */
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+
+/**
+ \brief Display a symbol in the given output stream.
+ */
+static void display_symbol(OutStream & os, Z3_context ctx, Z3_symbol s)
+{
+ switch (Z3_get_symbol_kind(ctx, s)) {
+ case Z3_INT_SYMBOL:
+ os << "$" << Z3_get_symbol_int(ctx, s);
+ break;
+ case Z3_STRING_SYMBOL:
+ os << Z3_get_symbol_string(ctx, s);
+ break;
+ default:
+ AVM_OS_FATAL_ERROR_EXIT
+ << "unreachable code was reached !!!"
+ << SEND_EXIT;
+ break;
+ }
+}
+
+/**
+ \brief Display the given type.
+ */
+static void display_sort(OutStream & os, Z3_context ctx, Z3_sort ty)
+{
+ switch (Z3_get_sort_kind(ctx, ty)) {
+ case Z3_UNINTERPRETED_SORT:
+ display_symbol(os, ctx, Z3_get_sort_name(ctx, ty));
+ break;
+ case Z3_BOOL_SORT:
+ os << "bool";
+ break;
+ case Z3_INT_SORT:
+ os << "int";
+ break;
+ case Z3_REAL_SORT:
+ os << "real";
+ break;
+ case Z3_BV_SORT:
+ os << "bv" << Z3_get_bv_sort_size(ctx, ty);
+ break;
+ case Z3_ARRAY_SORT:
+ os << "[";
+ display_sort(os, ctx, Z3_get_array_sort_domain(ctx, ty));
+ os << "->";
+ display_sort(os, ctx, Z3_get_array_sort_range(ctx, ty));
+ os << "]";
+ break;
+ case Z3_DATATYPE_SORT:
+ if (Z3_get_datatype_sort_num_constructors(ctx, ty) != 1)
+ {
+ os << Z3_sort_to_string(ctx,ty);
+ break;
+ }
+ {
+ unsigned num_fields = Z3_get_tuple_sort_num_fields(ctx, ty);
+ unsigned i;
+ os << "(";
+ for (i = 0; i < num_fields; i++) {
+ Z3_func_decl field = Z3_get_tuple_sort_field_decl(ctx, ty, i);
+ if (i > 0) {
+ os << ", ";
+ }
+ display_sort(os, ctx, Z3_get_range(ctx, field));
+ }
+ os << ")";
+ break;
+ }
+ default:
+ os << "unknown[";
+ display_symbol(os, ctx, Z3_get_sort_name(ctx, ty));
+ os << "]";
+ break;
+ }
+}
+
+/**
+ \brief Custom ast pretty printer.
+
+ This function demonstrates how to use the API to navigate terms.
+ */
+static void display_ast(OutStream & os, Z3_context ctx, Z3_ast v)
+{
+ switch (Z3_get_ast_kind(ctx, v)) {
+ case Z3_NUMERAL_AST: {
+ Z3_sort t;
+ os << Z3_get_numeral_string(ctx, v);
+ t = Z3_get_sort(ctx, v);
+ os << ":";
+ display_sort(os, ctx, t);
+ break;
+ }
+ case Z3_APP_AST: {
+ Z3_app app = Z3_to_app(ctx, v);
+ unsigned num_fields = Z3_get_app_num_args(ctx, app);
+ Z3_func_decl d = Z3_get_app_decl(ctx, app);
+ os << Z3_func_decl_to_string(ctx, d);
+ if (num_fields > 0) {
+ os << "[";
+ display_ast(os, ctx, Z3_get_app_arg(ctx, app, 0));
+ for (unsigned i = 1; i < num_fields; i++) {
+ os << ", ";
+ display_ast(os, ctx, Z3_get_app_arg(ctx, app, i));
+ }
+ os << "]";
+ }
+ break;
+ }
+ case Z3_QUANTIFIER_AST: {
+ os << "quantifier";
+ break;
+ }
+ default: {
+ os << "#unknown";
+ break;
+ }
+ }
+}
+
+/**
+ \brief Custom function interpretations pretty printer.
+ */
+static void display_function_interpretations(
+ OutStream & os, Z3_context ctx, Z3_model model)
+{
+ unsigned num_functions, i;
+
+ os << "function interpretations:" << std::endl;
+
+ num_functions = Z3_get_model_num_funcs(ctx, model);
+ for (i = 0; i < num_functions; i++) {
+ Z3_func_decl fdecl;
+ Z3_symbol name;
+ Z3_ast func_else;
+ unsigned num_entries, j;
+
+ fdecl = Z3_get_model_func_decl(ctx, model, i);
+ name = Z3_get_decl_name(ctx, fdecl);
+ display_symbol(os, ctx, name);
+ os << " = {";
+ num_entries = Z3_get_model_func_num_entries(ctx, model, i);
+ for (j = 0; j < num_entries; j++) {
+ unsigned num_args, k;
+ if (j > 0) {
+ os << ", ";
+ }
+ num_args = Z3_get_model_func_entry_num_args(ctx, model, i, j);
+ os << "(";
+ for (k = 0; k < num_args; k++) {
+ if (k > 0) {
+ os << ", ";
+ }
+ display_ast(os, ctx, Z3_get_model_func_entry_arg(ctx, model, i, j, k));
+ }
+ os << "|->";
+ display_ast(os, ctx, Z3_get_model_func_entry_value(ctx, model, i, j));
+ os << ")";
+ }
+ if (num_entries > 0) {
+ os << ", ";
+ }
+ os << "(else|->";
+ func_else = Z3_get_model_func_else(ctx, model, i);
+ display_ast(os, ctx, func_else);
+ os << ")}" << std::endl;
+ }
+}
+
+/**
+ \brief Custom model pretty printer.
+ */
+static void display_model(OutStream & os, Z3_context ctx, Z3_model model)
+{
+ unsigned num_constants;
+ unsigned i;
+
+ num_constants = Z3_get_model_num_constants(ctx, model);
+ for (i = 0; i < num_constants; i++) {
+ Z3_symbol name;
+ Z3_func_decl cnst = Z3_get_model_constant(ctx, model, i);
+ Z3_ast a, v;
+ name = Z3_get_decl_name(ctx, cnst);
+ display_symbol(os, ctx, name);
+ os << " = ";
+ a = Z3_mk_app(ctx, cnst, 0, 0);
+ v = a;
+ Z3_bool ok = Z3_eval(ctx, model, a, &v);
+ if( ok == Z3_TRUE )
+ {
+ display_ast(os, ctx, v);
+ os << std::endl;
+ }
+ }
+ display_function_interpretations(os, ctx, model);
+}
+
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+
+/**
+ * CONFIGURE
+ */
+bool Z3Solver::configure(
+ Configuration & aConfiguration, WObject * wfFilterObject,
+ ListOfPairMachineData & listOfSelectedVariable)
+{
+ if( not base_this_type::configure(
+ aConfiguration, wfFilterObject, listOfSelectedVariable) )
+ {
+ return( false );
+ }
+
+ return( true );
+}
+
+
+
+/**
+ * CREATE - DESTROY
+ * ValidityChecker
+ */
+
+/**
+ \brief Simpler error handler.
+ */
+void error_handler(Z3_error_code e)
+{
+ AVM_OS_EXIT( FAILED )
+ << "Z3Solver:> Incorrect use of the solver, error code << "
+ << e << " >>"
+ << SEND_EXIT;
+}
+
+
+bool Z3Solver::createChecker()
+{
+ CFG = Z3_mk_config();
+
+ Z3_set_param_value(CFG, "MODEL", "true");
+
+ CTX = Z3_mk_context(CFG);
+
+// Z3_set_error_handler(error_handler);
+
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ ++SOLVER_SESSION_ID;
+AVM_IF_DEBUG_LEVEL_GTE_HIGH
+ mLogFolderLocation = OSS() << VFS::ProjectLogPath << "/z3/";
+
+ if ( not VFS::checkWritingFolder(mLogFolderLocation) )
+ {
+ AVM_OS_LOG << " Z3Solver::createChecker :> Error: The folder "
+ << "`" << mLogFolderLocation << "' "
+ << "---> doesn't exist or is not writable !!!"
+ << std::endl << std::endl;
+ return( false );
+ }
+
+// std::string fileLocation = OSS << mLogFolderLocation
+// << "z3_log_" << SOLVER_SESSION_ID << ".z3";
+// Z3_open_log( fileLocation.c_str() );
+//
+// fileLocation = OSS << mLogFolderLocation
+// << "z3_trace_" << SOLVER_SESSION_ID << ".z3";
+// Z3_trace_to_file( CTX , fileLocation.c_str() );
+AVM_ENDIF_DEBUG_LEVEL_GTE_HIGH
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+
+ SMT_TYPE_BOOL = Z3_mk_bool_sort(CTX);
+ SMT_TYPE_INT = Z3_mk_int_sort(CTX);
+ SMT_TYPE_REAL = Z3_mk_real_sort(CTX);
+
+ SMT_CST_BOOL_TRUE = Z3_mk_true(CTX);
+ SMT_CST_BOOL_FALSE = Z3_mk_false(CTX);
+
+ SMT_CST_INT_ZERO = Z3_mk_int(CTX, 0, SMT_TYPE_INT);
+ SMT_CST_INT_ONE = Z3_mk_int(CTX, 1, SMT_TYPE_INT);
+
+ resetTable();
+
+ return( true );
+}
+
+
+bool Z3Solver::destroyChecker()
+{
+ resetTable();
+
+ SMT_TYPE_BOOL = NULL;
+ SMT_TYPE_INT = NULL;
+ SMT_TYPE_BV32 = NULL;
+ SMT_TYPE_BV64 = NULL;
+ SMT_TYPE_REAL = NULL;
+
+ SMT_CST_BOOL_TRUE = NULL;
+ SMT_CST_BOOL_FALSE = NULL;
+
+ SMT_CST_INT_ZERO = NULL;
+ SMT_CST_INT_ONE = NULL;
+
+// Z3_close_log();
+// Z3_trace_off( CTX );
+
+ if( CFG != NULL )
+ {
+ Z3_del_config(CFG);
+ CFG = NULL;
+ }
+
+ if( CTX != NULL )
+ {
+ Z3_del_context(CTX);
+
+ CTX = NULL;
+ }
+
+ return( true );
+}
+
+bool Z3Solver::resetTable()
+{
+ base_this_type::resetTable();
+
+ mTableOfParameterDecl.append( NULL );
+
+ mTableOfParameterExpr.append( NULL );
+
+ return( true );
+}
+
+
+
+/**
+ * PROVER
+ */
+bool Z3Solver::isSubSet(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+{
+ return( true );
+}
+
+bool Z3Solver::isEqualSet(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC)
+{
+ return( true );
+}
+
+SolverDef::SATISFIABILITY_RING Z3Solver::isSatisfiable(const BF & aCondition)
+{
+ SolverDef::SATISFIABILITY_RING satisfiability = SolverDef::SATISFIABLE;
+
+ createChecker();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << "Z3Solver::isSatisfiable(...) "
+ ":" << SOLVER_SESSION_ID << ">" << std::endl
+ << "\t" << aCondition.str() << std::endl;
+
+ // trace to file
+AVM_IF_DEBUG_LEVEL_GTE_HIGH
+ smt_check_sat(aCondition);
+AVM_ENDIF_DEBUG_LEVEL_GTE_HIGH
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ Z3_ast z3Condition = from_baseform(aCondition);
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << "Z3Condition :" << SOLVER_SESSION_ID << ">"
+ << std::endl;
+AVM_IF_DEBUG_LEVEL_GTE_HIGH
+ AVM_OS_TRACE << "\t";
+ display_ast(AVM_OS_TRACE, CTX, z3Condition);
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_GTE_HIGH
+ AVM_OS_TRACE << "\t" << Z3_ast_to_string(CTX, z3Condition) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+ AVM_OS_TRACE << "Z3::CTX :" << SOLVER_SESSION_ID << ">" << std::endl
+ << Z3_context_to_string(CTX) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+
+ if( z3Condition != NULL )
+ {
+ Z3_assert_cnstr(CTX, z3Condition);
+
+ switch( Z3_check(CTX) )
+ {
+ case Z3_L_TRUE:
+ {
+ satisfiability = SolverDef::SATISFIABLE;
+ break;
+ }
+
+ case Z3_L_FALSE:
+ {
+ satisfiability = SolverDef::UNSATISFIABLE;
+ break;
+ }
+
+ case Z3_L_UNDEF:
+ {
+ satisfiability = SolverDef::UNKNOWN_SAT;
+ break;
+ }
+
+ default:
+ {
+ satisfiability = SolverDef::ABORT_SAT;
+ break;
+ }
+ }
+ }
+
+ destroyChecker();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << "result :" << SOLVER_SESSION_ID << "> "
+ << SolverDef::strSatisfiability(satisfiability) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ return( satisfiability );
+}
+
+
+/**
+ * SOLVER
+ */
+bool Z3Solver::solveImpl(const BF & aCondition,
+ BFVector & dataVector, BFVector & valuesVector)
+{
+ SolverDef::SATISFIABILITY_RING satisfiability = SolverDef::SATISFIABLE;
+
+ createChecker();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << "Z3Solver::solve(...) "
+ ":" << SOLVER_SESSION_ID << ">" << std::endl
+ << "\t" << aCondition.str() << std::endl;
+
+ // trace to file
+ smt_check_model(aCondition, dataVector, valuesVector);
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ Z3_ast z3Condition = from_baseform(aCondition);
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << "Z3Condition :" << SOLVER_SESSION_ID << ">"
+ << std::endl;
+AVM_IF_DEBUG_LEVEL_GTE_HIGH
+ AVM_OS_TRACE << "\t";
+ display_ast(AVM_OS_TRACE, CTX, z3Condition);
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_GTE_HIGH
+ AVM_OS_TRACE << "\t" << Z3_ast_to_string(CTX, z3Condition) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+ AVM_OS_TRACE << "Z3::CTX :" << SOLVER_SESSION_ID << ">" << std::endl
+ << Z3_context_to_string(CTX) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+
+ if( z3Condition != NULL )
+ {
+ Z3_assert_cnstr(CTX, z3Condition);
+
+ Z3_model model = NULL;
+
+ switch( Z3_check_and_get_model(CTX, &model) )
+ {
+ case Z3_L_TRUE:
+ {
+ satisfiability = SolverDef::SATISFIABLE;
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << "Z3Model sat:" << SOLVER_SESSION_ID << ">" << std::endl
+ << Z3_model_to_string(CTX, model) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ unsigned num_constants = Z3_get_model_num_constants(CTX, model);
+ for( unsigned i = 0 ; i < num_constants ; i++ )
+ {
+ Z3_func_decl cnst = Z3_get_model_constant(CTX, model, i);
+
+ Z3_symbol symbol = Z3_get_decl_name(CTX, cnst);
+
+ int offset = mTableOfParameterDecl.find(symbol);
+ if( offset >= 0 )
+ {
+ dataVector.append( mTableOfParameterInstance[offset] );
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ display_symbol(AVM_OS_TRACE, CTX, symbol);
+ AVM_OS_TRACE << " := ";
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ Z3_ast app = Z3_mk_app(CTX, cnst, 0, 0);
+
+ Z3_ast value = app;
+
+ Z3_bool ok = Z3_eval(CTX, model, app, &value);
+
+ switch( ok )
+ {
+ case Z3_L_TRUE:
+ {
+ BF bfVal = to_baseform(model, value);
+
+ valuesVector.append( bfVal.valid() ?
+ bfVal : dataVector.back() );
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ display_ast(AVM_OS_TRACE, CTX, value);
+ AVM_OS_TRACE << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ break;
+ }
+ case Z3_L_FALSE:
+ case Z3_L_UNDEF:
+ default:
+ {
+ valuesVector.append( BF::REF_NULL );
+
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Z3Solver::solve :> "
+ "failed to Z3_eval << "
+ << Z3_ast_to_string(CTX, app)
+ << " >> !!!"
+ << SEND_EXIT;
+
+ break;
+ }
+ }
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Z3Solver::solve :> "
+ "unfound parameter instance for Z3 symbol << "
+ << Z3_get_symbol_string(CTX, symbol)
+ << " >> !!!"
+ << SEND_EXIT;
+ }
+ }
+
+
+ break;
+ }
+
+ case Z3_L_FALSE:
+ {
+ satisfiability = SolverDef::UNSATISFIABLE;
+ break;
+ }
+
+ case Z3_L_UNDEF:
+ {
+ satisfiability = SolverDef::UNKNOWN_SAT;
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << "Z3Model undef:" << SOLVER_SESSION_ID << ">"
+ << std::endl;
+ AVM_OS_TRACE << Z3_model_to_string(CTX, model) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ break;
+ }
+
+ default:
+ {
+ satisfiability = SolverDef::ABORT_SAT;
+ break;
+ }
+ }
+
+ if( model != NULL )
+ {
+ Z3_del_model(CTX, model);
+ }
+
+ }
+
+ destroyChecker();
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+ AVM_OS_TRACE << "solve :" << SOLVER_SESSION_ID << "> "
+ << SolverDef::strSatisfiability(satisfiability) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SMT_SOLVING )
+
+ return( satisfiability == SolverDef::SATISFIABLE );
+}
+
+
+
+/**
+ * TOOLS
+ */
+
+Z3_sort Z3Solver::getZ3Type(BaseTypeSpecifier * bts)
+{
+ if( bts->isTypedBoolean() )
+ {
+ return( SMT_TYPE_BOOL );
+ }
+ else if( bts->isTypedEnum() )
+ {
+ return( SMT_TYPE_INT );
+ // TODO Attention : il faudrait rajouter les contraintes
+ // d'intervalle pour le type énuméré
+ }
+ else if( bts->weaklyTypedInteger() )
+ {
+ return( SMT_TYPE_INT );
+ }
+ else if( bts->weaklyTypedReal() )
+ {
+ return( SMT_TYPE_REAL );
+ }
+
+ else if( bts->isTypedMachine() )
+ {
+ // TODO:> Consolidation après TEST
+ return( SMT_TYPE_INT );
+ }
+
+ return( SMT_TYPE_REAL );
+}
+
+
+Z3_ast Z3Solver::getParameterExpr(const BF & bfParameter)
+{
+ InstanceOfData * aParameter = bfParameter.to_ptr< InstanceOfData >();
+
+ if( aParameter->getMark() == 0 )
+ {
+ aParameter->setMark( mTableOfParameterInstance.size() );
+ mTableOfParameterInstance.append( bfParameter );
+
+ mTableOfParameterDecl.push_back( Z3_mk_string_symbol( CTX,
+// ( OSS << "P_" << aParameter->getMark() ).c_str() ) );
+ aParameter->getNameID().c_str() ) );
+
+ mTableOfParameterExpr.push_back( Z3_mk_const( CTX,
+ mTableOfParameterDecl.last(),
+ getZ3Type(aParameter->referedTypeSpecifier())) );
+ }
+
+ return( mTableOfParameterExpr.at( aParameter->getMark() ) );
+}
+
+
+
+
+Z3_ast Z3Solver::getVariableExpr(InstanceOfData * aVar, std::size_t varID)
+{
+ if( mTableOfVariableExpr.size() <= varID )
+ {
+ mTableOfVariableDecl.push_back( Z3_mk_string_symbol( CTX,
+// ( OSS << "V_" << varID ).c_str() ) );
+ aVar->getNameID().c_str() ) );
+
+ mTableOfVariableExpr.push_back( Z3_mk_const( CTX,
+ mTableOfVariableDecl.last(),
+ getZ3Type(aVar->getTypeSpecifier()) ) );
+ }
+
+ return( mTableOfVariableExpr.at( varID ) );
+}
+
+
+
+Z3_ast Z3Solver::safe_from_baseform(const BF & exprForm,
+ BaseTypeSpecifier * typeSpecifier)
+{
+ Z3_ast e = NULL;
+
+ try
+ {
+ if( (e = from_baseform(exprForm, typeSpecifier)) == NULL )
+ {
+ AVM_OS_WARN << std::endl << REPEAT("********", 10) << std::endl
+ << "\tZ3Solver::safe_from_baseform< unknown::error :"
+ << SOLVER_SESSION_ID << ">" << std::endl
+ << REPEAT("--------", 10) << std::endl
+ << "\tFailed to CONVERT sep::fml::expression to Z3::Expr:>" << std::endl
+ << "\t " << exprForm.str() << std::endl
+ << REPEAT("********", 10) << std::endl;
+
+ destroyChecker();
+ }
+ }
+ catch ( ... )
+ {
+ AVM_OS_WARN << std::endl << REPEAT("********", 10) << std::endl
+ << "\tZ3Solver::safe_from_baseform< unknown::exception :"
+ << SOLVER_SESSION_ID << ">" << std::endl
+ << REPEAT("--------", 10) << std::endl
+ << "\tFailed to CONVERT sep::fml::expression to Z3::Expr:>" << std::endl
+ << "\t " << exprForm.str() << std::endl
+ << REPEAT("********", 10) << std::endl;
+
+ destroyChecker();
+ }
+
+ return( e );
+}
+
+
+
+Z3_ast Z3Solver::from_baseform(const BF & exprForm,
+ BaseTypeSpecifier * typeSpecifier)
+{
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( exprForm ) << "expression !!!"
+ << SEND_EXIT;
+
+ switch( exprForm.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ AvmCode * aCode = exprForm.to_ptr< AvmCode >();
+
+ typeSpecifier = TypeManager::UNIVERSAL;
+
+ switch( aCode->getAvmOpCode() )
+ {
+ // COMPARISON OPERATION
+ case AVM_OPCODE_EQ:
+ {
+ return( Z3_mk_eq( CTX,
+ from_baseform(aCode->first() , typeSpecifier),
+ from_baseform(aCode->second(), typeSpecifier) ) );
+ }
+
+ case AVM_OPCODE_NEQ:
+ {
+ return( Z3_mk_not( CTX, Z3_mk_eq( CTX,
+ from_baseform(aCode->first() , typeSpecifier),
+ from_baseform(aCode->second(), typeSpecifier) ) ) );
+
+// ARGS arg( 2 );
+//
+// arg.next( from_baseform(aCode->first() , typeSpecifier) );
+// arg.next( from_baseform(aCode->second(), typeSpecifier) );
+//
+// return( Z3_mk_distinct(CTX, 2, arg->table) );
+ }
+
+ case AVM_OPCODE_LT:
+ {
+ return( Z3_mk_lt( CTX,
+ from_baseform(aCode->first() , typeSpecifier),
+ from_baseform(aCode->second(), typeSpecifier) ) );
+ }
+
+ case AVM_OPCODE_LTE:
+ {
+ return( Z3_mk_le( CTX,
+ from_baseform(aCode->first() , typeSpecifier),
+ from_baseform(aCode->second(), typeSpecifier) ) );
+ }
+
+ case AVM_OPCODE_GT:
+ {
+ return( Z3_mk_gt( CTX,
+ from_baseform(aCode->first() , typeSpecifier),
+ from_baseform(aCode->second(), typeSpecifier) ) );
+ }
+
+ case AVM_OPCODE_GTE:
+ {
+ return( Z3_mk_ge( CTX,
+ from_baseform(aCode->first() , typeSpecifier),
+ from_baseform(aCode->second(), typeSpecifier) ) );
+ }
+
+
+ // LOGICAL OPERATION
+ case AVM_OPCODE_NOT:
+ {
+ return( Z3_mk_not( CTX,
+ from_baseform(aCode->first() , typeSpecifier)) );
+ }
+
+ case AVM_OPCODE_AND:
+ {
+ ARGS arg( aCode->size() );
+
+ AvmCode::iterator it = aCode->begin();
+ for( ; arg.hasNext() ; ++it )
+ {
+ arg.next( from_baseform(*it, typeSpecifier) );
+ }
+
+ return( Z3_mk_and(CTX, arg->count, arg->table) );
+ }
+
+ case AVM_OPCODE_NAND:
+ {
+ ARGS arg( aCode->size() );
+
+ AvmCode::iterator it = aCode->begin();
+ for( ; arg.hasNext() ; ++it )
+ {
+ arg.next( from_baseform(*it, typeSpecifier) );
+ }
+
+ return( Z3_mk_not( CTX, Z3_mk_and(CTX, arg->count, arg->table) ) );
+ }
+
+// case AVM_OPCODE_XAND:
+// {
+// ARGS arg( 2 );
+//
+// arg.next( Z3_mk_not( CTX,
+// from_baseform(aCode->first() , typeSpecifier)) );
+// arg.next( from_baseform(aCode->second(), typeSpecifier) );
+//
+// return( Z3_mk_and(CTX, arg->table, 2) );
+//
+// return( mVC->orExpr(
+// mVC->andExpr(from_baseform(aCode->first(), typeSpecifier),
+// from_baseform(aCode->second(), typeSpecifier)),
+// mVC->andExpr(mVC->notExpr(from_baseform(aCode->first(), typeSpecifier)),
+// mVC->notExpr(from_baseform(aCode->second(), typeSpecifier))) ) );
+// }
+
+
+ case AVM_OPCODE_OR:
+ {
+ ARGS arg( aCode->size() );
+
+ AvmCode::iterator it = aCode->begin();
+ for( ; arg.hasNext() ; ++it )
+ {
+ arg.next( from_baseform(*it, typeSpecifier) );
+ }
+
+ return( Z3_mk_or(CTX, arg->count, arg->table) );
+ }
+
+ case AVM_OPCODE_NOR:
+ {
+ ARGS arg( aCode->size() );
+
+ AvmCode::iterator it = aCode->begin();
+ for( ; arg.hasNext() ; ++it )
+ {
+ arg.next( from_baseform(*it, typeSpecifier) );
+ }
+
+ return( Z3_mk_not( CTX, Z3_mk_or(CTX, arg->count, arg->table) ) );
+ }
+
+// case AVM_OPCODE_BAND:
+// {
+// return( Z3_mk_bv_and( CTX,
+// from_baseform(aCode->first(), typeSpecifier),
+// from_baseform(aCode->second(), typeSpecifier) ) );
+// }
+//
+// case AVM_OPCODE_BOR:
+// {
+// return( Z3_mk_bv_or( CTX,
+// from_baseform(aCode->first(), typeSpecifier),
+// from_baseform(aCode->second(), typeSpecifier) ) );
+// }
+//
+// case AVM_OPCODE_LSHIFT:
+// {
+// if( aCode->second().isInteger() )
+// {
+// return( Z3_mk_bv_shift_left0( CTX,
+// from_baseform(aCode->first(), typeSpecifier),
+// aCode->second().toInteger()) );
+//
+// }
+// else
+// {
+// AVM_OS_FATAL_ERROR_EXIT
+// << "Unexpected second argument for "
+// "newFixedLeftShiftExpr !!!\n"
+// << aCode->toString( AVM_TAB1_INDENT )
+// << SEND_EXIT;
+//
+// return( NULL );
+// }
+// }
+//
+// case AVM_OPCODE_RSHIFT:
+// {
+// if( aCode->second().isInteger() )
+// {
+// return( Z3_mk_bv_shift_right0( CTX,
+// from_baseform(aCode->first(), typeSpecifier),
+// aCode->second().toInteger()) );
+//
+// }
+// else
+// {
+// AVM_OS_FATAL_ERROR_EXIT
+// << "Unexpected second argument for "
+// "newFixedRightShiftExpr !!!\n"
+// << aCode->toString( AVM_TAB1_INDENT )
+// << SEND_EXIT;
+//
+// return( NULL );
+// }
+// }
+
+ case AVM_OPCODE_XOR:
+ {
+ return( Z3_mk_xor( CTX,
+ from_baseform(aCode->first() , typeSpecifier),
+ from_baseform(aCode->second(), typeSpecifier) ) );
+ }
+
+ case AVM_OPCODE_XNOR:
+ {
+ return( Z3_mk_not( CTX, Z3_mk_xor( CTX,
+ from_baseform(aCode->first() , typeSpecifier),
+ from_baseform(aCode->second(), typeSpecifier) ) ) );
+ }
+
+
+ // ARITHMETIC OPERATION
+ case AVM_OPCODE_PLUS:
+ {
+ ARGS arg( aCode->size() );
+
+ AvmCode::iterator it = aCode->begin();
+ for( ; arg.hasNext() ; ++it )
+ {
+ arg.next( from_baseform(*it, typeSpecifier) );
+ }
+
+ return( Z3_mk_add(CTX, arg->count, arg->table) );
+ }
+
+ case AVM_OPCODE_UMINUS:
+ {
+ return( Z3_mk_unary_minus(CTX,
+ from_baseform(aCode->first(), typeSpecifier)) );
+ }
+
+ case AVM_OPCODE_MINUS:
+ {
+ ARGS arg( aCode->size() );
+
+ AvmCode::iterator it = aCode->begin();
+ for( ; arg.hasNext() ; ++it )
+ {
+ arg.next( from_baseform(*it, typeSpecifier) );
+ }
+
+ return( Z3_mk_sub(CTX, arg->count, arg->table) );
+ }
+
+ case AVM_OPCODE_MULT:
+ {
+ ARGS arg( aCode->size() );
+
+ AvmCode::iterator it = aCode->begin();
+ for( ; arg.hasNext() ; ++it )
+ {
+ arg.next( from_baseform(*it, typeSpecifier) );
+ }
+
+ return( Z3_mk_mul(CTX, arg->count, arg->table) );
+ }
+
+ case AVM_OPCODE_DIV:
+ {
+ return( Z3_mk_div( CTX,
+ from_baseform(aCode->first() , typeSpecifier),
+ from_baseform(aCode->second(), typeSpecifier) ) );
+ }
+
+ case AVM_OPCODE_POW:
+ {
+ if( ExpressionFactory::isPosInteger(aCode->second()) )
+ {
+// return( Z3_mk_power( CTX,
+// from_baseform(aCode->first() , typeSpecifier),
+// from_baseform(aCode->second(), typeSpecifier) ) );
+
+ avm_uinteger_t power =
+ ExpressionFactory::toUInteger(aCode->second());
+
+ ARGS arg( power );
+
+ arg.next( from_baseform(aCode->first()) );
+
+ while( arg.hasNext() )
+ {
+ arg.next( arg[ 0 ] );
+ }
+
+ return( Z3_mk_mul(CTX, arg->count, arg->table) );
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Z3Solver::from_baseform:> Unsupported "
+ "expression Operator << AVM_OPCODE_POW >> !!!"
+ << SEND_EXIT;
+
+ return( NULL );
+ }
+ }
+
+ case AVM_OPCODE_MOD:
+ {
+ return( Z3_mk_mod( CTX,
+ from_baseform(aCode->first() , typeSpecifier),
+ from_baseform(aCode->second(), typeSpecifier) ) );
+ }
+
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Z3Solver::from_baseform:> Unexpected "
+ "BASEFORM KIND for execution !!!\n"
+ << aCode->toString( AVM_TAB1_INDENT )
+ << SEND_EXIT;
+
+ return( NULL );
+ }
+ }
+
+ break;
+ }
+
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ return( getParameterExpr( exprForm ) );
+ }
+
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ {
+ if( exprForm.to_ptr< Boolean >()->getValue() )
+ {
+ return( ((typeSpecifier != NULL) && typeSpecifier->isTypedBoolean()) ?
+ SMT_CST_BOOL_TRUE : SMT_CST_INT_ONE );
+ }
+ else
+ {
+ return( ((typeSpecifier != NULL) && typeSpecifier->isTypedBoolean()) ?
+ SMT_CST_BOOL_FALSE : SMT_CST_INT_ZERO );
+ }
+ }
+
+
+ case FORM_BUILTIN_INTEGER_KIND:
+ {
+ if( (typeSpecifier != NULL) && typeSpecifier->isTypedBoolean() )
+ {
+ return( exprForm.to_ptr< Integer >()->isZero() ?
+ SMT_CST_BOOL_FALSE : SMT_CST_BOOL_TRUE );
+ }
+ else
+ {
+#if defined( _AVM_BUILTIN_NUMERIC_GMP_ )
+
+ return( Z3_mk_int64(CTX,
+ exprForm.to_ptr< Integer >()->toInteger(),
+ SMT_TYPE_INT) );
+
+#else
+
+ return( Z3_mk_int64(CTX,
+ exprForm.to_ptr< Integer >()->toInteger(),
+ SMT_TYPE_INT) );
+
+#endif /* _AVM_BUILTIN_NUMERIC_GMP_ */
+ }
+
+// return( Z3_mk_numeral(CTX,
+// exprForm.to_ptr< Integer >()->str().c_str(),
+// SMT_TYPE_INT) );
+ }
+
+ case FORM_BUILTIN_RATIONAL_KIND:
+ {
+ if( (typeSpecifier != NULL) && typeSpecifier->isTypedBoolean() )
+ {
+ return( exprForm.to_ptr< Rational >()->isZero() ?
+ SMT_CST_BOOL_FALSE : SMT_CST_BOOL_TRUE );
+ }
+ else
+ {
+#if defined( _AVM_BUILTIN_NUMERIC_GMP_ )
+
+ return( Z3_mk_real(CTX,
+ exprForm.to_ptr< Rational >()->toNumerator(),
+ exprForm.to_ptr< Rational >()->toDenominator() ) );
+
+#else
+
+ return( Z3_mk_real(CTX,
+ exprForm.to_ptr< Rational >()->toNumerator(),
+ exprForm.to_ptr< Rational >()->toDenominator() ) );
+
+#endif /* _AVM_BUILTIN_NUMERIC_GMP_ */
+ }
+
+// return( Z3_mk_numeral( CTX,
+// exprForm.to_ptr< Rational >()->str().c_str(),
+// SMT_TYPE_REAL) );
+ }
+
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ if( (typeSpecifier != NULL) && typeSpecifier->isTypedBoolean() )
+ {
+ return( exprForm.to_ptr< Float >()->isZero() ?
+ SMT_CST_BOOL_FALSE : SMT_CST_BOOL_TRUE );
+ }
+ else
+ {
+#if defined( _AVM_BUILTIN_NUMERIC_GMP_ )
+
+ return( Z3_mk_numeral(CTX,
+ exprForm.to_ptr< Float >()->str().c_str(),
+ SMT_TYPE_REAL) );
+
+#else
+
+ return( Z3_mk_numeral(CTX,
+ exprForm.to_ptr< Float >()->str().c_str(),
+ SMT_TYPE_REAL) );
+
+#endif /* _AVM_BUILTIN_NUMERIC_GMP_ */
+ }
+ }
+
+
+ case FORM_RUNTIME_ID_KIND:
+ {
+ return( Z3_mk_int(CTX, exprForm.bfRID().getRid(), SMT_TYPE_INT) );
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Z3Solver::from_baseform:> Unexpected BASEFORM KIND << "
+ << exprForm.classKindName() << " >> as expression << "
+ << exprForm.str() << " >> !!!"
+ << SEND_EXIT;
+
+ return( NULL );
+ }
+ }
+
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Z3Solver::from_baseform ERROR !!!"
+ << SEND_EXIT;
+
+ return( NULL );
+}
+
+
+BF Z3Solver::to_baseform(Z3_model model, Z3_ast z3Form)
+{
+ switch( Z3_get_ast_kind(CTX, z3Form) )
+ {
+ case Z3_NUMERAL_AST:
+ {
+ Z3_sort type = Z3_get_sort(CTX, z3Form);
+
+ switch( Z3_get_sort_kind(CTX, type) )
+ {
+ case Z3_BOOL_SORT:
+ {
+ switch( Z3_get_bool_value(CTX, z3Form) )
+ {
+ case Z3_L_TRUE:
+ {
+ return( ExpressionConstructor::newBoolean( true ) );
+ }
+ case Z3_L_FALSE:
+ {
+ return( ExpressionConstructor::newBoolean( false ) );
+ }
+ case Z3_L_UNDEF:
+ default:
+ {
+ return( ExpressionConstructor::newBoolean(
+ Z3_get_numeral_string(CTX, z3Form)) );
+ }
+ }
+ }
+ case Z3_INT_SORT:
+ {
+ {
+ int val;
+ if( Z3_get_numeral_int(CTX, z3Form, &val) == Z3_L_TRUE )
+ {
+ return( ExpressionConstructor::newInteger(
+ static_cast< avm_integer_t >( val ) ) );
+ }
+ }
+ {
+ unsigned val;
+ if( Z3_get_numeral_uint(CTX, z3Form, &val) == Z3_L_TRUE )
+ {
+ return( ExpressionConstructor::newUInteger(
+ static_cast< avm_uinteger_t >( val ) ) );
+ }
+ }
+ {
+ __int64 val;
+ if( Z3_get_numeral_int64(CTX, z3Form, &val) == Z3_L_TRUE )
+ {
+ return( ExpressionConstructor::newInteger(
+ static_cast< avm_integer_t >( val ) ) );
+ }
+ }
+ {
+ unsigned __int64 val;
+ if( Z3_get_numeral_uint64(CTX, z3Form, &val) == Z3_L_TRUE )
+ {
+ return( ExpressionConstructor::newUInteger(
+ static_cast< avm_uinteger_t >( val ) ) );
+ }
+ }
+
+ return( ExpressionConstructor::newInteger(
+ Z3_get_numeral_string(CTX, z3Form)) );
+ }
+ case Z3_REAL_SORT:
+ {
+ __int64 num;
+ __int64 den;
+ if( Z3_get_numeral_rational_int64(CTX, z3Form, &num, &den) == Z3_L_TRUE )
+ {
+ return( ExpressionConstructor::newRational(
+ static_cast< avm_integer_t >( num ),
+ static_cast< avm_integer_t >( den ) ) );
+ }
+
+ return( ExpressionConstructor::newFloat(
+ Z3_get_numeral_string(CTX, z3Form)) );
+ }
+ case Z3_UNINTERPRETED_SORT:
+ case Z3_BV_SORT:
+ case Z3_ARRAY_SORT:
+ case Z3_DATATYPE_SORT:
+ default:
+ {
+ return( ExpressionConstructor::newString(
+ Z3_get_numeral_string(CTX, z3Form)) );
+
+ break;
+ }
+ }
+
+ break;
+ }
+ case Z3_APP_AST:
+ {
+ Z3_app app = Z3_to_app(CTX, z3Form);
+
+ if( Z3_get_app_num_args(CTX, app) == 0 )
+ {
+ Z3_func_decl func_decl = Z3_get_app_decl(CTX, app);
+
+ std::string val = Z3_func_decl_to_string(CTX, func_decl);
+ if( val == "(define true bool)" )
+ {
+ return( ExpressionConstructor::newBoolean( true ) );
+ }
+ else if( val == "(define false bool)" )
+ {
+ return( ExpressionConstructor::newBoolean( false ) );
+ }
+
+// z3Form = Z3_model_get_const_interp(CTX, model, func_decl);
+//
+// return( to_baseform(model, z3Form) );
+
+ }
+
+ break;
+ }
+ case Z3_QUANTIFIER_AST:
+ {
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
+
+ return( BF::REF_NULL );
+}
+
+
+/**
+ * Using file API
+ */
+
+SolverDef::SATISFIABILITY_RING Z3Solver::smt_check_sat(const BF & aCondition)
+{
+ SolverDef::SATISFIABILITY_RING satisfiability = SolverDef::SATISFIABLE;
+
+ BFVector paramVector;
+
+ StringOutStream ossCondition("", "\t", "");
+ to_smt(ossCondition, aCondition, paramVector);
+
+ std::string fileLocation = OSS() << mLogFolderLocation
+ << "z3_check_sat_" << SOLVER_SESSION_ID << ".smt";
+ std::ofstream osFile;
+ osFile.open(fileLocation.c_str(), std::ios_base::out);
+ if ( osFile.good() )
+ {
+// osFile << "(echo \"" << aCondition.str() << "\")" << std::endl;
+
+ InstanceOfData * aParam;
+
+ std::size_t paramCount = paramVector.size();
+ for( std::size_t offset = 0 ; offset < paramCount ; offset++ )
+ {
+ aParam = paramVector[ offset ].to_ptr< InstanceOfData >();
+
+ osFile << "(declare-const " << aParam->getFullyQualifiedNameID()
+ << " ";
+ if( aParam->isTypedBoolean() )
+ {
+ osFile << "Bool";
+ }
+ else if( aParam->weaklyTypedInteger() || aParam->isTypedEnum() )
+ {
+ osFile << "Int";
+ }
+ else if( aParam->weaklyTypedReal() )
+ {
+ osFile << "Real";
+ }
+ else
+ {
+ osFile << "Unknown";
+ }
+ osFile << ")" << std::endl;
+ }
+
+ osFile << "(assert " << ossCondition.str() << ")" << std::endl;
+
+ osFile << "(check-sat)" << std::endl;
+
+ osFile.close();
+ }
+ else
+ {
+ return( SolverDef::ABORT_SAT );
+ }
+
+
+ return( satisfiability );
+}
+
+bool Z3Solver::smt_check_model(const BF & aCondition,
+ BFVector & dataVector, BFVector & valuesVector)
+{
+ BFVector paramVector;
+
+ StringOutStream ossCondition("", "\t", "");
+ to_smt(ossCondition, aCondition, paramVector);
+
+ std::string fileLocation = OSS() << mLogFolderLocation
+ << "z3_check_sat_" << SOLVER_SESSION_ID << ".smt";
+ std::ofstream osFile;
+ osFile.open(fileLocation.c_str(), std::ios_base::out);
+ if ( osFile.good() )
+ {
+// osFile << "(echo \"" << aCondition.str() << "\")" << std::endl;
+
+ InstanceOfData * aParam;
+
+ std::size_t paramCount = paramVector.size();
+ for( std::size_t offset = 0 ; offset < paramCount ; offset++ )
+ {
+ aParam = paramVector[ offset ].to_ptr< InstanceOfData >();
+
+ osFile << "(declare-const " << aParam->getFullyQualifiedNameID()
+ << " ";
+ if( aParam->isTypedBoolean() )
+ {
+ osFile << "Bool";
+ }
+ else if( aParam->weaklyTypedInteger() || aParam->isTypedEnum() )
+ {
+ osFile << "Int";
+ }
+ else if( aParam->weaklyTypedReal() )
+ {
+ osFile << "Real";
+ }
+ else
+ {
+ osFile << "Unknown";
+ }
+ osFile << ")" << std::endl;
+ }
+
+ osFile << "(assert " << ossCondition.str() << ")" << std::endl;
+
+ osFile << "(get-model)" << std::endl;
+
+ osFile.close();
+ }
+ else
+ {
+ return( false );
+ }
+
+ return( true );
+}
+
+
+
+SolverDef::SATISFIABILITY_RING Z3Solver::from_smt_sat(const BF & aCondition)
+{
+ SolverDef::SATISFIABILITY_RING satisfiability = SolverDef::SATISFIABLE;
+
+
+ return( satisfiability );
+}
+
+bool Z3Solver::from_smt_model(const BF & aCondition,
+ BFVector & dataVector, BFVector & valuesVector)
+{
+ return( true );
+}
+
+
+
+void Z3Solver::to_smt(OutStream & os,
+ const BF & exprForm, BFVector & dataVector) const
+{
+ AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( exprForm ) << "expression !!!"
+ << SEND_EXIT;
+
+ os << TAB;
+
+ switch( exprForm.classKind() )
+ {
+ case FORM_AVMCODE_KIND:
+ {
+ AvmCode * aCode = exprForm.to_ptr< AvmCode >();
+
+ os << '(';
+ std::string eoe = "";
+
+ switch( aCode->getAvmOpCode() )
+ {
+ case AVM_OPCODE_AND:
+ {
+ os << "and";
+ break;
+ }
+ case AVM_OPCODE_OR:
+ {
+ os << "or";
+ break;
+ }
+ case AVM_OPCODE_NOT:
+ {
+ os << "not";
+ break;
+ }
+
+ case AVM_OPCODE_NEQ:
+ {
+ os << "(not";
+ eoe = ")";
+ break;
+ }
+
+ case AVM_OPCODE_IFE:
+ {
+ os << "ite";
+ break;
+ }
+
+ case AVM_OPCODE_IF:
+ {
+ os << "if";
+ break;
+ }
+
+ default:
+ {
+ os << aCode->getOperator()->strSMT();
+ break;
+
+ }
+ }
+
+ AvmCode::iterator it = aCode->begin();
+ AvmCode::iterator endIt = aCode->end();
+ for( ; it != endIt ; ++it )
+ {
+ os << " ";
+ to_smt(os, *it, dataVector);
+ }
+
+ os << eoe << ')';
+
+ break;
+ }
+
+ case FORM_INSTANCE_DATA_KIND:
+ {
+ dataVector.add_union( exprForm );
+ os << exprForm.to_ptr< InstanceOfData >()->getFullyQualifiedNameID();
+
+ break;
+ }
+
+ case FORM_BUILTIN_BOOLEAN_KIND:
+ case FORM_BUILTIN_INTEGER_KIND:
+ case FORM_BUILTIN_RATIONAL_KIND:
+ case FORM_BUILTIN_FLOAT_KIND:
+ {
+ os << exprForm.str();
+
+ break;
+ }
+
+ default:
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Unexpected BASEFORM KIND as expression << "
+ << exprForm.str() << " >> !!!"
+ << SEND_EXIT;
+
+ os << exprForm.str();
+
+ break;
+ }
+ }
+
+ os << EOL;
+}
+
+#endif /* _AVM_SOLVER_Z3_CPP_ */
+
+} /* namespace sep */
+
+
+#endif /* _AVM_SOLVER_Z3_ */
+
diff --git a/org.eclipse.efm.symbex/src/solver/Z3Solver.h b/org.eclipse.efm.symbex/src/solver/Z3Solver.h
new file mode 100644
index 0000000..24e3f52
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/solver/Z3Solver.h
@@ -0,0 +1,318 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 29 févr. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+// TODO for << z3 cpp interface >>
+//#define _AVM_SOLVER_Z3_CPP_
+
+
+#ifndef SOLVER_Z3_H_
+#define SOLVER_Z3_H_
+
+#include <solver/api/SolverDef.h>
+/*
+ * Here because "SolverDef.h" could define this macro
+ */
+#if defined( _AVM_SOLVER_Z3_ )
+
+
+#include <solver/api/SmtSolver.h>
+
+#include <z3/z3++.h>
+
+
+#include <common/BF.h>
+
+#include <collection/BFContainer.h>
+
+#include <fml/executable/InstanceOfData.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+
+
+namespace sep
+{
+
+class WObject;
+
+
+#if defined( _AVM_SOLVER_Z3_CPP_ )
+
+
+class Z3Solver :
+ public SmtSolver< z3::symbol , z3::sort , z3::expr , true , false >
+{
+
+ AVM_DECLARE_UNCLONABLE_CLASS(Z3Solver)
+
+
+public:
+ /*
+ ***************************************************************************
+ * ID
+ ***************************************************************************
+ */
+ static std::string ID;
+
+ static std::string DESCRIPTION;
+
+ static avm_uint64_t SOLVER_SESSION_ID;
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ **/
+ z3::config * CFG;
+
+ z3::context * CTX;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Z3Solver()
+ : base_this_type( ),
+ CFG( NULL ),
+ CTX( NULL )
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Z3Solver()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONFIGURE
+ */
+ virtual bool configure(
+ Configuration & aConfiguration, WObject * wfFilterObject,
+ ListOfPairMachineData & listOfSelectedVariable);
+
+
+ /**
+ * PROVER
+ */
+ virtual bool isSubSet(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC);
+
+ virtual bool isEqualSet(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC);
+
+ virtual SolverDef::SATISFIABILITY_RING isSatisfiable(const BF & aCondition);
+
+
+ /**
+ * SOLVER
+ */
+ virtual bool solveImpl(const BF & aCondition,
+ BFVector & dataVector, BFVector & valuesVector);
+
+
+ /**
+ * CREATE - DESTROY
+ * ValidityChecker
+ */
+ bool createChecker(z3::config & cfg, z3::context & ctx);
+ bool destroyChecker();
+ bool resetTable();
+
+
+ /**
+ * TOOLS
+ */
+
+ z3::sort getZ3Type(BaseTypeSpecifier * bts);
+
+ z3::expr getParameterExpr(const BF & aParameter);
+ z3::expr getVariableExpr(InstanceOfData * aVar, std::size_t varID);
+
+
+ z3::expr safe_from_baseform(const BF & exprForm,
+ BaseTypeSpecifier * typeSpecifier = NULL);
+
+ z3::expr from_baseform(const BF & exprForm,
+ BaseTypeSpecifier * typeSpecifier = NULL);
+
+ BF to_baseform(z3::model z3Model, z3::expr z3Form);
+
+
+ /**
+ * Using file API
+ */
+
+ virtual SolverDef::SATISFIABILITY_RING smt_check_sat(const BF & aCondition);
+
+ virtual bool smt_check_model(const BF & aCondition,
+ BFVector & dataVector, BFVector & valuesVector);
+
+ virtual SolverDef::SATISFIABILITY_RING from_smt_sat(const BF & aCondition);
+
+ virtual bool from_smt_model(const BF & aCondition,
+ BFVector & dataVector, BFVector & valuesVector);
+
+ virtual void to_smt(OutStream & os,
+ const BF & exprForm, BFVector & dataVector) const;
+
+};
+
+
+#else /* NOT _AVM_SOLVER_Z3_CPP_ ==> _AVM_SOLVER_Z3_C << default >> */
+
+
+class Z3Solver :
+ public SmtSolver< Z3_symbol , Z3_sort , Z3_ast , true , true >
+{
+
+ AVM_DECLARE_UNCLONABLE_CLASS(Z3Solver)
+
+
+public:
+ /*
+ ***************************************************************************
+ * ID
+ ***************************************************************************
+ */
+ static std::string ID;
+
+ static std::string DESCRIPTION;
+
+ static avm_uint64_t SOLVER_SESSION_ID;
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ Z3_config CFG;
+
+ Z3_context CTX;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ Z3Solver()
+ : base_this_type(NULL, NULL),
+ CFG( NULL ),
+ CTX( NULL )
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~Z3Solver()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * CONFIGURE
+ */
+ virtual bool configure(
+ Configuration & aConfiguration, WObject * wfFilterObject,
+ ListOfPairMachineData & listOfSelectedVariable);
+
+
+ /**
+ * PROVER
+ */
+ virtual bool isSubSet(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC);
+
+ virtual bool isEqualSet(
+ const ExecutionContext & newEC, const ExecutionContext & oldEC);
+
+ virtual SolverDef::SATISFIABILITY_RING isSatisfiable(const BF & aCondition);
+
+
+ /**
+ * SOLVER
+ */
+ virtual bool solveImpl(const BF & aCondition,
+ BFVector & dataVector, BFVector & valuesVector);
+
+
+ /**
+ * CREATE - DESTROY
+ * ValidityChecker
+ */
+ bool createChecker();
+ bool destroyChecker();
+ bool resetTable();
+
+
+ /**
+ * TOOLS
+ */
+
+ Z3_sort getZ3Type(BaseTypeSpecifier * bts);
+
+ Z3_ast getParameterExpr(const BF & aParameter);
+ Z3_ast getVariableExpr(InstanceOfData * aVar, std::size_t varID);
+
+
+ Z3_ast safe_from_baseform(const BF & exprForm,
+ BaseTypeSpecifier * typeSpecifier = NULL);
+
+ Z3_ast from_baseform(const BF & exprForm,
+ BaseTypeSpecifier * typeSpecifier = NULL);
+
+ BF to_baseform(Z3_model model, Z3_ast z3Form);
+
+
+ /**
+ * Using file API
+ */
+
+ virtual SolverDef::SATISFIABILITY_RING smt_check_sat(const BF & aCondition);
+
+ virtual bool smt_check_model(const BF & aCondition,
+ BFVector & dataVector, BFVector & valuesVector);
+
+ virtual SolverDef::SATISFIABILITY_RING from_smt_sat(const BF & aCondition);
+
+ virtual bool from_smt_model(const BF & aCondition,
+ BFVector & dataVector, BFVector & valuesVector);
+
+ virtual void to_smt(OutStream & os,
+ const BF & exprForm, BFVector & dataVector) const;
+
+};
+
+
+#endif /* _AVM_SOLVER_Z3_CPP_ */
+
+
+} /* namespace sep */
+
+#endif /* _AVM_SOLVER_Z3_ */
+
+
+#endif /* SOLVER_Z3_H_ */
diff --git a/org.eclipse.efm.symbex/src/solver/api/SatSolver.cpp b/org.eclipse.efm.symbex/src/solver/api/SatSolver.cpp
new file mode 100644
index 0000000..3a80b03
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/solver/api/SatSolver.cpp
@@ -0,0 +1,152 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "SatSolver.h"
+
+
+#include <util/avm_vfs.h>
+
+#include <fml/expression/ExpressionConstant.h>
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/expression/ExpressionFactory.h>
+
+#include <fml/workflow/WObject.h>
+
+
+namespace sep
+{
+
+class Configuration;
+
+
+bool SatSolver::configure(
+ Configuration & aConfiguration, WObject * wfFilterObject,
+ ListOfPairMachineData & listOfSelectedVariable)
+{
+ mListOfSelectedVariable = listOfSelectedVariable;
+
+ if( mListOfSelectedVariable.empty() )
+ {
+ AVM_OS_WARNING_ALERT
+ << "Unexpected in SatSolver "
+ "an empty selected variable list !!!"
+ << SEND_ALERT;
+
+ return( true );
+ }
+
+
+AVM_IF_DEBUG_FLAG2( CONFIGURING , SOLVING )
+ AVM_OS_TRACE << std::endl
+ << "Listes des variables utilisées pour la redondance" << std::endl;
+
+ std::size_t varCount = 0;
+ ListOfInstanceOfData::const_iterator itVar;
+ ListOfInstanceOfData::const_iterator endVar;
+
+ ListOfPairMachineData::const_iterator itPairMachineData =
+ mListOfSelectedVariable.begin();
+ ListOfPairMachineData::const_iterator endPairMachineData =
+ mListOfSelectedVariable.end();
+ for( ; itPairMachineData != endPairMachineData ; ++itPairMachineData )
+ {
+ AVM_OS_TRACE << "\t" << "Machine:> "
+ << (*itPairMachineData).first().getFullyQualifiedNameID() << std::endl;
+
+ if( (*itPairMachineData).second().nonempty() )
+ {
+ itVar = (*itPairMachineData).second().begin();
+ endVar = (*itPairMachineData).second().end();
+ for( ; itVar != endVar ; ++itVar , ++varCount )
+ {
+ AVM_OS_TRACE << "\t\t" << str_header( *itVar ) << std::endl;
+ }
+ }
+ }
+
+ AVM_OS_TRACE << "Total:> " << varCount << std::endl << std::endl;
+AVM_ENDIF_DEBUG_FLAG2( CONFIGURING , SOLVING )
+
+
+ mLogFolderLocation = VFS::ProjectDebugPath;
+
+ return( true );
+}
+
+
+
+/**
+ * SOLVER
+ * an empty << dataVector >> compute by the solver
+ * an empty << valuesVector >> compute by the solver
+ */
+bool SatSolver::solve(const BF & aCondition,
+ BFVector & dataVector, BFVector & valuesVector)
+{
+ BF fullCondition = completeUsingDataTypeConstraint(aCondition, dataVector);
+
+AVM_IF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+ AVM_OS_TRACE << "SatSolver::solve(...) :>" << std::endl
+ << "\tcondition:> " << aCondition.str() << std::endl
+ << "\tfull cond:> " << fullCondition.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( MEDIUM , SOLVING )
+
+ if( fullCondition.isEqualTrue() )
+ {
+ return( true );
+ }
+ else if( fullCondition.isEqualFalse() )
+ {
+ return( false );
+ }
+
+ return( solveImpl(fullCondition, dataVector, valuesVector) );
+}
+
+
+BF SatSolver::completeUsingDataTypeConstraint(
+ const BF & aCondition, BFVector & dataVector) const
+{
+ BF allCondition = aCondition;
+ BF typeConstraint;
+
+ BFVector paramsVector( dataVector );
+ ExpressionFactory::collectVariable(aCondition, paramsVector);
+
+ BFVector::raw_iterator< InstanceOfData > itParam = paramsVector.begin();
+ BFVector::raw_iterator< InstanceOfData > endParam = paramsVector.end();
+ for( ; itParam != endParam ; ++itParam )
+ {
+ typeConstraint = (itParam)->getTypeSpecifier()->genConstraint( *itParam );
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , SOLVING )
+ AVM_OS_TRACE << "completeUsingDataTypeConstraint:> "
+ << str_header( *itParam ) << std::endl
+ << "\tconstraint:> " << typeConstraint.str() << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , SOLVING )
+
+ if( typeConstraint.isEqualFalse() )
+ {
+ return( ExpressionConstant::BOOLEAN_FALSE );
+ }
+ else if( typeConstraint.isNotEqualTrue() )
+ {
+ allCondition = ExpressionConstructor::andExpr(
+ allCondition, typeConstraint);
+ }
+ }
+
+ return( allCondition );
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/solver/api/SatSolver.h b/org.eclipse.efm.symbex/src/solver/api/SatSolver.h
new file mode 100644
index 0000000..29eee28
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/solver/api/SatSolver.h
@@ -0,0 +1,191 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef SOLVER_ABSTRACTSOLVER_H_
+#define SOLVER_ABSTRACTSOLVER_H_
+
+#include <common/RunnableElement.h>
+
+#include <collection/Typedef.h>
+
+#include <fml/executable/InstanceOfData.h>
+
+#include <fml/runtime/RuntimeID.h>
+
+#include <solver/api/SolverDef.h>
+
+
+namespace sep
+{
+
+class BF;
+
+class Configuration;
+
+class ExecutionContext;
+
+class ExecutionData;
+
+class WObject;
+
+
+class SatSolver : public RunnableElement
+{
+
+protected:
+ /**
+ * ATTRIBUTES
+ */
+ ListOfPairMachineData mListOfSelectedVariable;
+
+ bool mCurrentPathScopeFlag;
+
+ std::string mLogFolderLocation;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ SatSolver()
+ : RunnableElement( NULL ),
+ mListOfSelectedVariable( ),
+ mCurrentPathScopeFlag( false ),
+ mLogFolderLocation( )
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~SatSolver()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * CONFIGURE
+ */
+ virtual bool configure(
+ Configuration & aConfiguration, WObject * wfFilterObject,
+ ListOfPairMachineData & listOfSelectedVariable);
+
+
+ /**
+ * INIT / EXIT
+ */
+ virtual bool initImpl()
+ {
+ //!! NOTHING
+ return true;
+ }
+
+ virtual bool exitImpl()
+ {
+ //!! NOTHING
+ return true;
+ }
+
+ /**
+ * GETTER - SETTER
+ * mListOfSelectedVariable
+ */
+ inline ListOfPairMachineData & getSelectedVariable()
+ {
+ return( mListOfSelectedVariable );
+ }
+
+ inline bool hasSelectedVariable()
+ {
+ return( mListOfSelectedVariable.nonempty() );
+ }
+
+ inline virtual void setSelectedVariable(ListOfPairMachineData & aList)
+ {
+ mListOfSelectedVariable = aList;
+ }
+
+ inline virtual void setSelectedVariable(
+ const ExecutionData & apED, ListOfPairMachineData & aList)
+ {
+ mListOfSelectedVariable = aList;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mCurrentPathScopeFlag
+ */
+ inline bool isCurrentPathScope()
+ {
+ return( mCurrentPathScopeFlag );
+ }
+
+ inline void setCurrentPathScope(bool aCurrentPathScopeFlag)
+ {
+ mCurrentPathScopeFlag = aCurrentPathScopeFlag;
+ }
+
+
+ /**
+ * GETTER - SETTER
+ * mLogFolderLocation
+ */
+ inline std::string getLogFolderLocation()
+ {
+ return( mLogFolderLocation );
+ }
+
+ inline void setLogFolderLocation(const std::string & aLocation)
+ {
+ mLogFolderLocation = aLocation;
+ }
+
+
+
+ /**
+ * PROVER
+ */
+ virtual bool isSubSet(
+ const ExecutionContext & newEC,
+ const ExecutionContext & oldEC) = 0;
+
+ virtual bool isEqualSet(
+ const ExecutionContext & newEC,
+ const ExecutionContext & oldEC) = 0;
+
+ virtual SolverDef::SATISFIABILITY_RING isSatisfiable(
+ const BF & aCondition) = 0;
+
+
+ /**
+ * SOLVER
+ * an empty << dataVector >> compute by the solver
+ * an empty << valuesVector >> compute by the solver
+ */
+ bool solve(const BF & aCondition,
+ BFVector & dataVector, BFVector & valuesVector);
+
+ virtual bool solveImpl(const BF & aCondition,
+ BFVector & dataVector, BFVector & valuesVector) = 0;
+
+
+ BF completeUsingDataTypeConstraint(
+ const BF & aCondition, BFVector & dataVector) const;
+
+};
+
+}
+
+#endif /*SOLVER_ABSTRACTSOLVER_H_*/
diff --git a/org.eclipse.efm.symbex/src/solver/api/SmtSolver.h b/org.eclipse.efm.symbex/src/solver/api/SmtSolver.h
new file mode 100644
index 0000000..66e9c54
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/solver/api/SmtSolver.h
@@ -0,0 +1,578 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 7 déc. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef SOLVER_BASESMTSOLVER_H_
+#define SOLVER_BASESMTSOLVER_H_
+
+#include <solver/api/SatSolver.h>
+
+#include <common/BF.h>
+
+#include <collection/Typedef.h>
+
+#include <fml/executable/InstanceOfData.h>
+
+
+#define SMT_ARGS_DATA_INITIAL_COUNT 16
+
+#define SMT_ARGS_DATA_ROOT_CAPACITY 512
+#define SMT_ARGS_DATA_DEFAULT_CAPACITY 64
+
+#define SMT_ARGS_DATA_INCR_CAPACITY 16
+
+
+namespace sep
+{
+
+class Configuration;
+
+
+template< class VarDecl_T , class Sort_T , class Expr_T , bool array_else_vector >
+class SmtSolverTraits : public SatSolver
+{
+
+protected:
+ /**
+ * ATTRIBUTES
+ **/
+ TableOfInstanceOfData mTableOfParameterInstance;
+ Vector< VarDecl_T > mTableOfParameterDecl;
+ Vector< Expr_T > mTableOfParameterExpr;
+
+ Vector< VarDecl_T > mTableOfVariableDecl;
+ Vector< Expr_T > mTableOfVariableExpr;
+
+ Vector< Expr_T > mTableOfParameterExprForNewFormula;
+ Vector< Expr_T > mTableOfParameterExprForOldFormula;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ SmtSolverTraits()
+ : SatSolver(),
+ mTableOfParameterInstance( ),
+ mTableOfParameterDecl( ),
+ mTableOfParameterExpr( ),
+
+ mTableOfVariableDecl( ),
+ mTableOfVariableExpr( ),
+
+ mTableOfParameterExprForNewFormula( ),
+ mTableOfParameterExprForOldFormula( )
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~SmtSolverTraits()
+ {
+ destroyChecker();
+ }
+
+
+ /**
+ * CREATE - DESTROY
+ * ValidityChecker
+ */
+ inline virtual bool destroyChecker()
+ {
+ resetTable();
+
+ return( true );
+ }
+
+
+ virtual bool resetTable()
+ {
+ if( mTableOfParameterInstance.nonempty() )
+ {
+ BFVector::raw_iterator< InstanceOfData > it =
+ mTableOfParameterInstance.begin();
+ BFVector::raw_iterator< InstanceOfData > itEnd =
+ mTableOfParameterInstance.end();
+ for( ++it /* ignore sentinel */ ; it != itEnd ; ++it )
+ {
+ (it)->setMark(0);
+ }
+ mTableOfParameterInstance.clear();
+ }
+ mTableOfParameterInstance.append( BF::REF_NULL );
+
+ mTableOfParameterDecl.clear();
+ mTableOfParameterExpr.clear();
+
+ mTableOfVariableDecl.clear();
+ mTableOfVariableExpr.clear();
+
+ mTableOfParameterExprForNewFormula.clear();
+ mTableOfParameterExprForOldFormula.clear();
+
+ return( true );
+ }
+
+};
+
+
+
+template< class VarDecl_T , class Sort_T , class Expr_T ,
+ bool array_else_vector , bool need_type_cst_decl >
+class SmtSolver;
+
+
+template< class VarDecl_T , class Sort_T , class Expr_T , bool array_else_vector >
+class SmtSolver< VarDecl_T , Sort_T , Expr_T , array_else_vector , true > :
+ public SmtSolverTraits< VarDecl_T , Sort_T , Expr_T , array_else_vector >
+{
+
+
+protected:
+ /**
+ * TYPEDEF
+ */
+ typedef SmtSolver< VarDecl_T , Sort_T , Expr_T ,
+ array_else_vector , true > base_this_type;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ SmtSolver(Sort_T nullSort, Expr_T nullExpr)
+ : SmtSolverTraits< VarDecl_T , Sort_T , Expr_T , array_else_vector >( ),
+
+ SMT_TYPE_BOOL( nullSort ),
+ SMT_TYPE_NAT ( nullSort ),
+ SMT_TYPE_INT ( nullSort ),
+ SMT_TYPE_BV32( nullSort ),
+ SMT_TYPE_BV64( nullSort ),
+ SMT_TYPE_REAL( nullSort ),
+
+ SMT_TYPE_NUMBER( nullSort ),
+
+ SMT_TYPE_STRING( nullSort ),
+
+ SMT_CST_BOOL_TRUE ( nullExpr ),
+ SMT_CST_BOOL_FALSE( nullExpr ),
+
+ SMT_CST_INT_ZERO( nullExpr ),
+ SMT_CST_INT_ONE ( nullExpr )
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~SmtSolver()
+ {
+ //!!! NOTHING
+ }
+
+
+protected:
+ /**
+ * ATTRIBUTES
+ **/
+ Sort_T SMT_TYPE_BOOL;
+ Sort_T SMT_TYPE_NAT;
+ Sort_T SMT_TYPE_INT;
+ Sort_T SMT_TYPE_BV32;
+ Sort_T SMT_TYPE_BV64;
+ Sort_T SMT_TYPE_REAL;
+
+ Sort_T SMT_TYPE_NUMBER;
+
+ Sort_T SMT_TYPE_STRING;
+
+ Expr_T SMT_CST_BOOL_TRUE;
+ Expr_T SMT_CST_BOOL_FALSE;
+
+ Expr_T SMT_CST_INT_ZERO;
+ Expr_T SMT_CST_INT_ONE;
+
+
+protected:
+
+ template< class data_t , bool is_array_else_vector >
+ struct _ARGS_DATA_TRAITS_;
+
+ template< class data_t >
+ struct _ARGS_DATA_TRAITS_< data_t , true >
+ {
+ /**
+ * ATTRIBUTES
+ */
+ data_t * table;
+
+ std::size_t capacity;
+ std::size_t count;
+ std::size_t idx;
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ _ARGS_DATA_TRAITS_( std::size_t aCapacity , std::size_t aCount )
+ : table( new data_t[aCapacity] ),
+ capacity( aCapacity ),
+ count( aCount ),
+ idx( 0 )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+ AVM_OS_TRACE << "new _ARGS_DATA_ as array :>"
+ << " capacity = " << std::setw(4) << capacity
+ << " : count = " << std::setw(4) << count
+ << " @" << avm_address_t( this ) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+ }
+
+ virtual ~_ARGS_DATA_TRAITS_()
+ {
+ delete[]( table );
+ }
+
+
+ inline void intialize()
+ {
+ //!!! NOTHING
+ }
+
+ inline void finalize()
+ {
+// for( idx = 0 ; idx < count ; ++idx )
+// {
+// table[ idx ] = NULL;
+// }
+ //!!! NOTHING
+ }
+
+ };
+
+
+ template< class data_t >
+ struct _ARGS_DATA_TRAITS_< data_t , false >
+ {
+ /**
+ * ATTRIBUTES
+ */
+ std::vector< data_t > table;
+
+ std::size_t capacity;
+ std::size_t count;
+ std::size_t idx;
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ _ARGS_DATA_TRAITS_( std::size_t aCapacity , std::size_t aCount )
+ : table( aCapacity ),
+ capacity( aCapacity ),
+ count( aCount ),
+ idx( 0 )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+ AVM_OS_TRACE << "new _ARGS_DATA_ as array :>"
+ << " capacity = " << std::setw(4) << capacity
+ << " : count = " << std::setw(4) << count
+ << " @" << avm_address_t( this ) << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+ }
+
+ virtual ~_ARGS_DATA_TRAITS_()
+ {
+ table.clear();
+ }
+
+
+ inline void intialize()
+ {
+ table.resize( count );
+
+//AVM_IF_DEBUG_LEVEL_FLAG_AND( HIGH , SMT_SOLVING , (capacity != table.capacity()) )
+ if( capacity != table.capacity() )
+ {
+ AVM_OS_TRACE << "new _ARGS_TRAITS_ as vector :>"
+ << " capacity = " << capacity
+ << " vector<" << table.capacity()
+ << "> : count = " << count
+ << " @" << avm_address_t( this ) << std::endl;
+ }
+//AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( HIGH , SMT_SOLVING )
+ }
+
+ inline void finalize()
+ {
+ table.clear();
+ }
+
+ };
+
+
+ typedef _ARGS_DATA_TRAITS_<Expr_T, array_else_vector > ARGS_DATA;
+
+
+ static List< ARGS_DATA * > ARG_CACHE;
+
+
+ inline static ARGS_DATA * newARGS( std::size_t count )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+ AVM_OS_TRACE << "newARGS :> count = " << std::setw(4) << count;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+
+ ARGS_DATA * arg = NULL;
+// if( ARG_CACHE.populated() )
+// {
+// if( ARG_CACHE.nonempty() &&
+// (ARG_CACHE.last()->capacity > count) )
+// {
+// ARG_CACHE.pop_last_to( arg );
+// arg->count = count;
+// }
+// else if( ARG_CACHE.nonempty() &&
+// (ARG_CACHE.first()->capacity > count) )
+// {
+// ARG_CACHE.pop_first_to( arg );
+// arg->count = count;
+// }
+// else
+// {
+// arg = new ARGS_TABLE(count, count);
+// }
+// }
+// else
+ if( ARG_CACHE.nonempty() && (ARG_CACHE.last()->capacity > count) )
+ {
+ ARG_CACHE.pop_last_to( arg );
+ arg->count = count;
+ arg->idx = 0;
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+ AVM_OS_TRACE << " @" << avm_address_t( arg )
+ << " with capacity = " << arg->capacity << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+ }
+ else
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+ AVM_OS_TRACE << " ==> " << std::flush;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+
+ arg = new ARGS_DATA(count + SMT_ARGS_DATA_INCR_CAPACITY, count);
+ }
+
+ return( arg );
+ }
+
+
+ inline static void freeARGS( ARGS_DATA * & arg )
+ {
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+ AVM_OS_TRACE << "freeARGS:> count = " << std::setw(4) << arg->count
+ << " @" << avm_address_t( arg )
+ << " with capacity = " << arg->capacity << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+
+ ARG_CACHE.append( arg );
+ }
+
+
+public:
+
+ /**
+ * Cache lifecycle
+ */
+ inline static void initCache()
+ {
+ for( std::size_t i = 0 ; i < SMT_ARGS_DATA_INITIAL_COUNT ; ++i )
+ {
+ ARG_CACHE.append(new ARGS_DATA( SMT_ARGS_DATA_DEFAULT_CAPACITY, 0) );
+ }
+ ARG_CACHE.append(new ARGS_DATA( SMT_ARGS_DATA_ROOT_CAPACITY, 0) );
+ }
+
+ inline static void finalizeCache( )
+ {
+ std::size_t args_count = 0;
+
+ while( ARG_CACHE.nonempty() )
+ {
+ ++args_count;
+ delete( ARG_CACHE.pop_last() );
+ }
+
+AVM_IF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+ AVM_OS_TRACE << "Solver::finalize#cache:> count = " << args_count
+ << std::endl;
+AVM_ENDIF_DEBUG_LEVEL_FLAG( HIGH , SMT_SOLVING )
+ }
+
+
+ struct ARGS
+ {
+ /**
+ * ATTRIBUTES
+ */
+ ARGS_DATA * mData;
+
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ ARGS( std::size_t count )
+ : mData( newARGS(count) )
+ {
+ mData->intialize( );
+ }
+
+ virtual ~ARGS()
+ {
+ mData->finalize( );
+
+ freeARGS( mData );
+ }
+
+
+ /**
+ * OPERATORS
+ */
+ inline ARGS_DATA * operator-> () const
+ {
+AVM_IF_DEBUG_FLAG( SMT_SOLVING )
+ AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( mData ) << "ARGS_DATA Pointer !!!"
+ << SEND_EXIT;
+AVM_ENDIF_DEBUG_FLAG( SMT_SOLVING )
+
+ return( mData );
+ }
+
+ inline Expr_T & operator[](std::size_t offset) const
+ {
+ return( mData->table[ offset ] );
+ }
+
+ // Table Iterator
+ inline bool hasNext() const
+ {
+ return( mData->idx < mData->count );
+ }
+
+ inline std::size_t offset() const
+ {
+ return( mData->idx );
+ }
+
+ inline void iter()
+ {
+ mData->idx = 0;
+ }
+
+ inline Expr_T & current()
+ {
+ return( mData->table[ mData->idx ] );
+ }
+
+ inline Expr_T & next()
+ {
+ return( mData->table[ mData->idx++ ] );
+ }
+
+ inline void next(Expr_T val)
+ {
+ mData->table[ mData->idx++ ] = val;
+ }
+
+// inline void next(const data_t & val)
+// {
+// mData->table[ mData->idx++ ] = val;
+// }
+
+ };
+
+};
+
+
+
+template< class VarDecl_T , class Sort_T , class Expr_T , bool array_else_vector >
+List< typename SmtSolver< VarDecl_T , Sort_T , Expr_T ,
+ array_else_vector , true >::ARGS_DATA * >
+SmtSolver< VarDecl_T , Sort_T , Expr_T , array_else_vector , true >::ARG_CACHE;
+
+
+
+
+template< class VarDecl_T , class Sort_T , class Expr_T , bool array_else_vector >
+class SmtSolver< VarDecl_T , Sort_T , Expr_T , array_else_vector , false > :
+ public SmtSolverTraits< VarDecl_T , Sort_T , Expr_T , array_else_vector >
+{
+
+
+protected:
+ /**
+ * TYPEDEF
+ */
+ typedef SmtSolver< VarDecl_T , Sort_T , Expr_T ,
+ array_else_vector , false > base_this_type;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ SmtSolver()
+ : SmtSolverTraits< VarDecl_T , Sort_T , Expr_T , array_else_vector >( )
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~SmtSolver()
+ {
+ //!!! NOTHING
+ }
+
+
+ /**
+ * Cache lifecycle
+ */
+ inline static void initCache()
+ {
+ //!!! NOTHING
+ }
+
+ inline static void finalizeCache( )
+ {
+ //!!! NOTHING
+ }
+
+};
+
+
+
+} /* namespace sep */
+#endif /* SOLVER_BASESMTSOLVER_H_ */
diff --git a/org.eclipse.efm.symbex/src/solver/api/SolverDef.cpp b/org.eclipse.efm.symbex/src/solver/api/SolverDef.cpp
new file mode 100644
index 0000000..945a5a9
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/solver/api/SolverDef.cpp
@@ -0,0 +1,217 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 29 févr. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "SolverDef.h"
+
+#include <util/avm_string.h>
+
+#include <printer/OutStream.h>
+
+#include <solver/CVC4Solver.h>
+#include <solver/Z3Solver.h>
+
+#if defined( _AVM_SOLVER_YICES_V2_ )
+#include <compat/solver/Yices2Solver.h>
+#endif /* _AVM_SOLVER_YICES_V2_ */
+
+// Mandatory after other Solver for compilation FIX
+#include <solver/OmegaSolver.h>
+
+
+namespace sep
+{
+
+
+/**
+ * ATTRIBUTES
+ */
+bool SolverDef::DEFAULT_SOLVER_USAGE_FLAG = false;
+
+SolverDef::SOLVER_KIND SolverDef::DEFAULT_SOLVER_KIND =
+ SolverDef::SOLVER_CVC4_KIND;
+
+
+/**
+ * toString
+ */
+std::string SolverDef::strSatisfiability(SolverDef::SATISFIABILITY_RING ring)
+{
+ switch (ring)
+ {
+ case UNSATISFIABLE : return( "unsatisfiable" );
+ case SATISFIABLE : return( "satisfiable" );
+ case ABORT_SAT : return( "abort_sat" );
+ case UNKNOWN_SAT : return( "unknown_sat" );
+ default : return( "undefined_sat" );
+ }
+}
+
+std::string SolverDef::strValidity(SolverDef::VALIDITY_RING ring)
+{
+ switch (ring)
+ {
+ case INVALID : return( "invalid" );
+ case VALID : return( "valid" );
+ case ABORT_VALID : return( "abort_valid" );
+ case UNKNOWN_VALID : return( "unknown_valid" );
+ default : return( "undefined_valid" );
+ }
+}
+
+
+std::string SolverDef::strSolver(SolverDef::SOLVER_KIND king)
+{
+ switch (king)
+ {
+#if defined( _AVM_SOLVER_OMEGA_ )
+ case SOLVER_OMEGA_KIND : return( OmegaSolver::ID );
+#endif /* _AVM_SOLVER_OMEGA_ */
+
+
+#if defined( _AVM_SOLVER_YICES_V2_ )
+ case SOLVER_YICES_KIND : return( Yices2Solver::ID );
+ case SOLVER_YICES2_KIND : return( Yices2Solver::ID );
+#endif /* _AVM_SOLVER_YICES_V2_ */
+
+
+#if defined( _AVM_SOLVER_Z3_ )
+ case SOLVER_Z3_KIND : return( Z3Solver::ID );
+#endif /* _AVM_SOLVER_Z3_ */
+
+
+#if defined( _AVM_SOLVER_CVC4_ )
+ case SOLVER_CVC_KIND : return( CVC4Solver::ID );
+ case SOLVER_CVC4_KIND : return( CVC4Solver::ID );
+ case SOLVER_CVC4_BV32_KIND : return( CVC4Solver::ID + "_BV32" );
+#endif /* _AVM_SOLVER_CVC4_ */
+
+
+ case SOLVER_UNDEFINED_KIND : return( "UNDEFINED_SOLVER" );
+
+ default : return( "UNKNOWN_SOLVER" );
+ }
+}
+
+/**
+ * toSolver
+ */
+SolverDef::SOLVER_KIND SolverDef::toSolver(
+ std::string strKing, SolverDef::SOLVER_KIND defaultKind)
+{
+ StringTools::toupper(strKing);
+
+#if defined( _AVM_SOLVER_OMEGA_ )
+ if( strKing == OmegaSolver::ID ) return( SOLVER_OMEGA_KIND );
+#endif /* _AVM_SOLVER_OMEGA_ */
+
+
+#if defined( _AVM_SOLVER_CVC4_ )
+ if( strKing == "CVC" ) return( SOLVER_CVC4_KIND );
+ if( strKing == "CVC_INT" ) return( SOLVER_CVC4_KIND );
+ if( strKing == "CVC_BV32" ) return( SOLVER_CVC4_BV32_KIND );
+ if( strKing == CVC4Solver::ID ) return( SOLVER_CVC4_KIND );
+ if( strKing == "CVC4_INT" ) return( SOLVER_CVC4_KIND );
+ if( strKing == "CVC4_BV32" ) return( SOLVER_CVC4_BV32_KIND );
+#endif /* _AVM_SOLVER_CVC4_ */
+
+
+#if defined( _AVM_SOLVER_YICES_V2_ )
+ if( strKing == Yices2Solver::ID ) return( SOLVER_YICES2_KIND );
+#if not defined( _AVM_SOLVER_YICES_V1_ )
+ if( strKing == "YICES" ) return( SOLVER_YICES2_KIND );
+#endif /* not _AVM_SOLVER_YICES_V1_ */
+#endif /* _AVM_SOLVER_YICES_V2_ */
+
+
+#if defined( _AVM_SOLVER_Z3_ )
+ if( strKing == Z3Solver::ID ) return( SOLVER_Z3_KIND );
+#endif /* _AVM_SOLVER_Z3_ */
+
+ return( defaultKind );
+}
+
+
+/**
+ * SOLVER
+ * Available
+ * List
+ */
+bool SolverDef::isAvailableSolver(SOLVER_KIND king)
+{
+ switch (king)
+ {
+#if defined( _AVM_SOLVER_OMEGA_ )
+ case SOLVER_OMEGA_KIND : return( true );
+#endif /* _AVM_SOLVER_OMEGA_ */
+
+
+#if defined( _AVM_SOLVER_YICES_V2_ )
+ case SOLVER_YICES_KIND : return( true );
+ case SOLVER_YICES2_KIND : return( true );
+#endif /* _AVM_SOLVER_YICES_V2_ */
+
+
+#if defined( _AVM_SOLVER_Z3_ )
+ case SOLVER_Z3_KIND : return( true );
+#endif /* _AVM_SOLVER_Z3_ */
+
+
+#if defined( _AVM_SOLVER_CVC4_ )
+ case SOLVER_CVC_KIND : return( true );
+ case SOLVER_CVC4_KIND : return( true );
+ case SOLVER_CVC4_BV32_KIND : return( true );
+#endif /* _AVM_SOLVER_CVC4_ */
+
+
+ case SOLVER_UNDEFINED_KIND : return( false );
+
+ default : return( false );
+ }
+}
+
+
+void SolverDef::toStreamSolverList(OutStream & os, const std::string & aHeader)
+{
+#define SOLVER_FACTORY_SHOW_DESCRIPTION( SolverClass ) \
+ os << TAB2 << SolverClass::DESCRIPTION << EOL;
+
+ os << TAB1 << aHeader << "< enabled > {" << EOL;
+
+#if defined( _AVM_SOLVER_OMEGA_ )
+ SOLVER_FACTORY_SHOW_DESCRIPTION( OmegaSolver )
+#endif /* _AVM_SOLVER_OMEGA_ */
+
+#if defined( _AVM_SOLVER_CVC4_ )
+ SOLVER_FACTORY_SHOW_DESCRIPTION( CVC4Solver )
+#endif /* _AVM_SOLVER_CVC4_ */
+
+
+#if defined( _AVM_SOLVER_Z3_ )
+ SOLVER_FACTORY_SHOW_DESCRIPTION( Z3Solver )
+#endif /* _AVM_SOLVER_Z3_ */
+
+
+#if defined( _AVM_SOLVER_YICES_V2_ )
+ SOLVER_FACTORY_SHOW_DESCRIPTION( Yices2Solver )
+#endif /* _AVM_SOLVER_YICES_V2_ */
+
+ os << TAB1 << "}" << EOL_FLUSH;
+
+}
+
+
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/solver/api/SolverDef.h b/org.eclipse.efm.symbex/src/solver/api/SolverDef.h
new file mode 100644
index 0000000..f68fafd
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/solver/api/SolverDef.h
@@ -0,0 +1,217 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 29 févr. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef SOLVER_SOLVERDEF_H_
+#define SOLVER_SOLVERDEF_H_
+
+
+/**
+ * DEFINE MACRO W.R.T. LICENSE CONSTRAINT
+ */
+#if defined( _ECLIPSE_PUBLIC_LICENSE_ )
+
+
+//// Default
+//#define _AVM_SOLVER_CVC4_
+//
+//// Incubation
+//#define _AVM_SOLVER_Z3_
+
+// Experimental
+#if defined( _AVM_SOLVER_YICES_V2_ )
+ #undef _AVM_SOLVER_YICES_V2_
+#endif /* _AVM_SOLVER_YICES_V2_ */
+
+// Deprecated
+#if defined( _AVM_SOLVER_OMEGA_ )
+ #undef _AVM_SOLVER_OMEGA_
+#endif /* _AVM_SOLVER_OMEGA_ */
+
+
+#else
+
+
+//// Default
+//#if not defined( _AVM_SOLVER_CVC4_ )
+//#define _AVM_SOLVER_CVC4_
+//#endif /* _AVM_SOLVER_CVC4_ */
+//
+//// Incubation
+//#if not defined( _AVM_SOLVER_Z3_ )
+//#define _AVM_SOLVER_Z3_
+//#endif /* _AVM_SOLVER_Z3_ */
+//
+//// Experimental
+//#if not defined( _AVM_SOLVER_YICES_V2_ )
+//#define _AVM_SOLVER_YICES_V2_
+//#endif /* _AVM_SOLVER_YICES_V2_ */
+//
+//
+//// Deprecated
+//#if not defined( _AVM_SOLVER_OMEGA_ )
+//#define _AVM_SOLVER_OMEGA_
+//#endif /* _AVM_SOLVER_OMEGA_ */
+
+
+#endif /* _ECLIPSE_PUBLIC_LICENSE_ */
+
+
+#include <string>
+
+//#if defined( _AVM_SOLVER_OMEGA_ )
+//
+//#endif /* _AVM_SOLVER_OMEGA_ */
+
+
+//#if defined( _AVM_SOLVER_CVC4_ )
+//
+//#elif defined( _AVM_SOLVER_CVC3_ )
+//
+//#endif /* _AVM_SOLVER_CVC_ */
+//
+//
+//#if defined( _AVM_SOLVER_YICES_V2_ )
+//
+//#elif defined( _AVM_SOLVER_YICES_V1_ )
+//
+//#endif /* _AVM_SOLVER_YICES_ */
+//
+//
+//#if defined( _AVM_SOLVER_Z3_ )
+//
+//#endif /* _AVM_SOLVER_Z3_ */
+
+
+namespace sep
+{
+
+
+class OutStream;
+
+
+class SolverDef
+{
+
+public:
+ /**
+ * TYPE DECLARATIONS
+ */
+
+ enum SATISFIABILITY_RING {
+ UNSATISFIABLE = 0,
+ SATISFIABLE = 1,
+
+ ABORT_SAT,
+ UNKNOWN_SAT
+ };
+
+
+ enum VALIDITY_RING {
+ INVALID = 0,
+ VALID = 1,
+
+ ABORT_VALID,
+ UNKNOWN_VALID
+ };
+
+
+ /**
+ * TYPE DECLARATIONS
+ */
+ enum SOLVER_KIND
+ {
+ SOLVER_UNDEFINED_KIND = 0x0000,
+
+ SOLVER_OMEGA_KIND = 0x00001,
+
+ SOLVER_YICES1_KIND = 0x00010,
+ SOLVER_YICES2_KIND = 0x00020,
+
+ SOLVER_YICES_KIND = SOLVER_YICES1_KIND
+ | SOLVER_YICES2_KIND,
+
+ SOLVER_Z3_KIND = 0x00100,
+
+ SOLVER_CVC3_KIND = 0x01000,
+ SOLVER_CVC3_BV32_KIND = 0x02000,
+
+ SOLVER_CVC4_KIND = 0x04000,
+ SOLVER_CVC4_BV32_KIND = 0x08000,
+
+ SOLVER_CVC_KIND = SOLVER_CVC3_KIND
+ | SOLVER_CVC4_KIND,
+
+ SOLVER_CVC_BV_KIND = SOLVER_CVC3_BV32_KIND
+ | SOLVER_CVC4_BV32_KIND
+ };
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ SolverDef()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~SolverDef()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * ATTRIBUTES
+ */
+ static bool DEFAULT_SOLVER_USAGE_FLAG;
+
+ static SolverDef::SOLVER_KIND DEFAULT_SOLVER_KIND;
+
+
+ /**
+ * toString
+ */
+ static std::string strSatisfiability(SATISFIABILITY_RING ring);
+
+ static std::string strValidity(VALIDITY_RING ring);
+
+ static std::string strSolver(SOLVER_KIND king);
+
+ /**
+ * toSolver
+ */
+ static SOLVER_KIND toSolver(std::string strKing,
+ SOLVER_KIND defaultKind /*= SOLVER_UNDEFINED_KIND*/);
+
+ /**
+ * SOLVER
+ * Available
+ * List
+ */
+ static bool isAvailableSolver(SOLVER_KIND king);
+
+ static void toStreamSolverList(OutStream & os,
+ const std::string & aHeader = "solvers");
+
+
+};
+
+} /* namespace sep */
+#endif /* SOLVER_SOLVERDEF_H_ */
diff --git a/org.eclipse.efm.symbex/src/solver/api/SolverFactory.cpp b/org.eclipse.efm.symbex/src/solver/api/SolverFactory.cpp
new file mode 100644
index 0000000..dc68e6d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/solver/api/SolverFactory.cpp
@@ -0,0 +1,994 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 9 juil. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "SolverFactory.h"
+
+#include <common/BF.h>
+
+#include <computer/EvaluationEnvironment.h>
+
+#include <fml/executable/ExecutableLib.h>
+
+#include <fml/expression/ExpressionFactory.h>
+#include <fml/expression/ExpressionConstant.h>
+#include <fml/expression/ExpressionConstructor.h>
+
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/RuntimeLib.h>
+
+#include <fml/type/EnumTypeSpecifier.h>
+#include <fml/type/IntervalTypeSpecifier.h>
+
+
+#include <solver/api/SatSolver.h>
+#include <solver/api/SolverDef.h>
+
+#include <solver/CVC4Solver.h>
+#include <solver/Z3Solver.h>
+
+#if defined( _AVM_SOLVER_YICES_V2_ )
+#include <compat/solver/Yices2Solver.h>
+#endif /* _AVM_SOLVER_YICES_V2_ */
+
+// Mandatory after other Solver for compilation FIX
+#include <solver/OmegaSolver.h>
+
+
+namespace sep
+{
+
+
+SatSolver * SolverFactory::theDefaultSolver4CheckSatisfiability = NULL;
+SatSolver * SolverFactory::theDefaultSolver4ModelsProduction = NULL;
+
+BFVector SolverFactory::thePCParameters;
+BFVector SolverFactory::thePCParameterValues;
+
+APExecutionData SolverFactory::theSymbolicED;
+
+
+/**
+ * LOADER
+ */
+void SolverFactory::load()
+{
+ switch( SolverDef::DEFAULT_SOLVER_KIND )
+ {
+#if defined( _AVM_SOLVER_CVC4_ )
+ case SolverDef::SOLVER_CVC4_KIND:
+ {
+ theDefaultSolver4CheckSatisfiability = new CVC4Solver();
+
+ theDefaultSolver4ModelsProduction =
+ new CVC4Solver(true /*to set option << produce-models >>*/);
+ break;
+ }
+#endif /* _AVM_SOLVER_CVC4_ */
+
+
+#if defined( _AVM_SOLVER_Z3_ )
+ case SolverDef::SOLVER_Z3_KIND:
+ {
+ theDefaultSolver4CheckSatisfiability = new Z3Solver();
+ theDefaultSolver4ModelsProduction = new Z3Solver();
+ break;
+ }
+#endif /* _AVM_SOLVER_Z3_ */
+
+
+#if defined( _AVM_SOLVER_YICES_V2_ )
+ case SolverDef::SOLVER_YICES2_KIND:
+ {
+ theDefaultSolver4CheckSatisfiability = new Yices2Solver();
+ theDefaultSolver4ModelsProduction = new Yices2Solver();
+ break;
+ }
+#endif /* _AVM_SOLVER_YICES_V2_ */
+
+
+#if defined( _AVM_SOLVER_OMEGA_ )
+ case SolverDef::SOLVER_OMEGA_KIND:
+ {
+ theDefaultSolver4CheckSatisfiability = new OmegaSolver();
+ theDefaultSolver4ModelsProduction = new OmegaSolver();
+ break;
+ }
+#endif /* _AVM_SOLVER_OMEGA_ */
+
+
+ case SolverDef::SOLVER_UNDEFINED_KIND:
+ default:
+ {
+#if defined( _AVM_SOLVER_CVC4_ )
+
+ theDefaultSolver4CheckSatisfiability = new CVC4Solver();
+
+ theDefaultSolver4ModelsProduction =
+ new CVC4Solver(true /*to set option << produce-models >>*/);
+
+#else
+
+ theDefaultSolver4CheckSatisfiability = NULL;
+ theDefaultSolver4ModelsProduction = NULL;
+
+#endif /* _AVM_SOLVER_CVCx_ */
+
+ break;
+ }
+ }
+
+////////////////////////////////////////////////////////////////////////////////
+// CACHE FOR MEMORY ALLOCATION OPTIMIZATION FOR SOLVER CALCULUS
+////////////////////////////////////////////////////////////////////////////////
+
+#if defined( _AVM_SOLVER_CVC4_ )
+
+ CVC4Solver::initCache();
+
+#endif /* _AVM_SOLVER_CVC4_ */
+
+
+#if defined( _AVM_SOLVER_Z3_ )
+
+ Z3Solver::initCache();
+
+#endif /* _AVM_SOLVER_Z3_ */
+
+
+#if defined( _AVM_SOLVER_YICES_V2_ )
+
+ Yices2Solver::initCache();
+
+#endif /* _AVM_SOLVER_YICES_V2_ */
+}
+
+
+/**
+ * DISPOSER
+ */
+void SolverFactory::dispose()
+{
+ delete( theDefaultSolver4CheckSatisfiability );
+ delete( theDefaultSolver4ModelsProduction );
+
+#if defined( _AVM_SOLVER_CVC4_ )
+
+ CVC4Solver::finalizeCache();
+
+#endif /* _AVM_SOLVER_CVC4_ */
+
+
+#if defined( _AVM_SOLVER_Z3_ )
+
+ Z3Solver::finalizeCache();
+
+#endif /* _AVM_SOLVER_Z3_ */
+
+
+#if defined( _AVM_SOLVER_YICES_V2_ )
+
+ Yices2Solver::finalizeCache();
+
+#endif /* _AVM_SOLVER_YICES_V2_ */
+}
+
+
+SolverDef::SATISFIABILITY_RING SolverFactory::isSatisfiable(
+ SolverDef::SOLVER_KIND aSolverKind, const BF & aCondition)
+{
+ if( aCondition.isEqualTrue() )
+ {
+ return( SolverDef::SATISFIABLE );
+ }
+ else if( aCondition.isEqualFalse() )
+ {
+ return( SolverDef::UNSATISFIABLE );
+ }
+
+ switch( aSolverKind )
+ {
+#if defined( _AVM_SOLVER_CVC4_ )
+ case SolverDef::SOLVER_CVC4_KIND:
+ case SolverDef::SOLVER_CVC4_BV32_KIND:
+ case SolverDef::SOLVER_CVC_KIND:
+ {
+ CVC4Solver solver;
+
+ return( solver.isSatisfiable( aCondition ) );
+ }
+#endif /* _AVM_SOLVER_CVC4_ */
+
+
+#if defined( _AVM_SOLVER_Z3_ )
+ case SolverDef::SOLVER_Z3_KIND:
+ {
+ Z3Solver solver;
+
+ return( solver.isSatisfiable( aCondition ) );
+ }
+#endif /* _AVM_SOLVER_Z3_ */
+
+
+#if defined( _AVM_SOLVER_YICES_V2_ )
+ case SolverDef::SOLVER_YICES2_KIND:
+ case SolverDef::SOLVER_YICES_KIND:
+ {
+ Yices2Solver solver;
+
+ return( solver.isSatisfiable( aCondition ) );
+ }
+#endif /* _AVM_SOLVER_YICES_V2_ */
+
+
+#if defined( _AVM_SOLVER_OMEGA_ )
+ case SolverDef::SOLVER_OMEGA_KIND:
+ {
+ OmegaSolver solver;
+
+ return( solver.isSatisfiable( aCondition ) );
+ }
+#endif /* _AVM_SOLVER_OMEGA_ */
+
+ default:
+ {
+AVM_OS_WARNING_ALERT
+ << "SolverFactory::isSatisfiable:> Unknown solver << "
+ << SolverDef::strSolver( aSolverKind )
+ << " >> in this executable !!!"
+ << SEND_ALERT;
+
+ return( SolverDef::UNKNOWN_SAT );
+ }
+ }
+
+ return( SolverDef::UNKNOWN_SAT );
+}
+
+
+/**
+ * DESTROY
+ */
+void SolverFactory::destroy(SatSolver * aSolver)
+{
+ if( (aSolver != NULL)
+ && (aSolver != SolverFactory::theDefaultSolver4CheckSatisfiability)
+ && (aSolver != SolverFactory::theDefaultSolver4ModelsProduction) )
+ {
+ delete( aSolver );
+ }
+}
+
+SolverDef::SATISFIABILITY_RING SolverFactory::isSatisfiable(
+ const BF & aCondition, bool useDefaultSolver)
+{
+ if( aCondition.isEqualTrue() )
+ {
+ return( SolverDef::SATISFIABLE );
+ }
+ else if( aCondition.isEqualFalse() )
+ {
+ return( SolverDef::UNSATISFIABLE );
+ }
+ else if( useDefaultSolver )
+ {
+ return( SolverFactory::isSatisfiable(
+ SolverDef::DEFAULT_SOLVER_KIND, aCondition) );
+ }
+
+ return( SolverDef::UNKNOWN_SAT );
+}
+
+
+
+/**
+ * USED BY FAM LtlProverFilter
+ */
+bool SolverFactory::isEmptyIntersection(ListOfInstanceOfData aListOfVarParam,
+ const ExecutionContext & aMainEC, const ExecutionContext & aComparEC)
+{
+#if defined( _AVM_SOLVER_OMEGA_ )
+
+ OmegaSolver theSolver;
+
+ theSolver.setSelectedVariable(aMainEC.refExecutionData(), aListOfVarParam);
+
+ return( theSolver.isEmptyIntersection( aMainEC , aComparEC ) );
+
+#else
+
+ return( false );
+
+#endif /* _AVM_SOLVER_OMEGA_ */
+}
+
+bool SolverFactory::isSubSet(
+ const ExecutionContext & aMainEC, const ExecutionContext & aComparEC)
+{
+#if defined( _AVM_SOLVER_OMEGA_ )
+
+ OmegaSolver theSolver;
+
+ theSolver.setSelectedVariable( aMainEC.refExecutionData() );
+
+ return( theSolver.isSubSet( aMainEC , aComparEC) );
+
+#else
+
+ return( false );
+
+#endif /* _AVM_SOLVER_OMEGA_ */
+}
+
+
+/**
+ * SOLVER
+ */
+
+SatSolver * SolverFactory::newSolver4CheckSatisfiability(
+ SolverDef::SOLVER_KIND aSolverKind)
+{
+ switch( aSolverKind )
+ {
+#if defined( _AVM_SOLVER_CVC4_ )
+ case SolverDef::SOLVER_CVC4_KIND:
+ case SolverDef::SOLVER_CVC_KIND:
+ {
+ return( new CVC4Solver() );
+ }
+#endif /* _AVM_SOLVER_CVC4_ */
+
+
+#if defined( _AVM_SOLVER_Z3_ )
+ case SolverDef::SOLVER_Z3_KIND:
+ {
+ return( new Z3Solver() );
+ }
+#endif /* _AVM_SOLVER_Z3_ */
+
+
+#if defined( _AVM_SOLVER_YICES_V2_ )
+ case SolverDef::SOLVER_YICES2_KIND:
+ case SolverDef::SOLVER_YICES_KIND:
+ {
+ return( new Yices2Solver() );
+ }
+#endif /* _AVM_SOLVER_YICES_V2_ */
+
+
+#if defined( _AVM_SOLVER_OMEGA_ )
+ case SolverDef::SOLVER_OMEGA_KIND:
+ {
+ return( new OmegaSolver() );
+ }
+#endif /* _AVM_SOLVER_OMEGA_ */
+
+ default:
+ {
+AVM_OS_ASSERT_FATAL_ERROR_EXIT( theDefaultSolver4CheckSatisfiability == NULL )
+ << "SolverFactory::newSolver4CheckSatisfiability:> Unknown solver << "
+ << SolverDef::strSolver( aSolverKind )
+ << " >> in this executable and there are no default alternative solver!!!"
+ << SEND_ALERT;
+
+ SolverDef::toStreamSolverList(AVM_OS_COUT, "Available solver");
+
+ return( theDefaultSolver4CheckSatisfiability );
+ }
+ }
+}
+
+
+SatSolver * SolverFactory::newSolver4ModelsProduction(
+ SolverDef::SOLVER_KIND aSolverKind)
+{
+ switch( aSolverKind )
+ {
+#if defined( _AVM_SOLVER_CVC4_ )
+ case SolverDef::SOLVER_CVC4_KIND:
+ case SolverDef::SOLVER_CVC_KIND:
+ {
+ return( new CVC4Solver(true/*produce-models*/) );
+ }
+#endif /* _AVM_SOLVER_CVC4_ */
+
+
+#if defined( _AVM_SOLVER_Z3_ )
+ case SolverDef::SOLVER_Z3_KIND:
+ {
+ return( new Z3Solver() );
+ }
+#endif /* _AVM_SOLVER_Z3_ */
+
+
+#if defined( _AVM_SOLVER_YICES_V2_ )
+ case SolverDef::SOLVER_YICES2_KIND:
+ case SolverDef::SOLVER_YICES_KIND:
+ {
+ return( new Yices2Solver() );
+ }
+#endif /* _AVM_SOLVER_YICES_V2_ */
+
+
+#if defined( _AVM_SOLVER_OMEGA_ )
+ case SolverDef::SOLVER_OMEGA_KIND:
+ {
+ return( new OmegaSolver() );
+ }
+#endif /* _AVM_SOLVER_OMEGA_ */
+
+ default:
+ {
+AVM_OS_ASSERT_FATAL_ERROR_EXIT( theDefaultSolver4ModelsProduction == NULL )
+ << "SolverFactory::newSolver4ModelsProduction:> Unknown solver << "
+ << SolverDef::strSolver( aSolverKind )
+ << " >> in this executable and and there are no default alternative solver !"
+ << SEND_ALERT;
+
+ return( theDefaultSolver4ModelsProduction );
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// CONDITION PARAMETER SOLVING
+////////////////////////////////////////////////////////////////////////////////
+
+bool SolverFactory::solve(SolverDef::SOLVER_KIND aSolverKind,
+ const BF & aCondition, BFVector & dataVector, BFVector & valuesVector)
+{
+ switch( aSolverKind )
+ {
+#if defined( _AVM_SOLVER_CVC4_ )
+ case SolverDef::SOLVER_CVC4_KIND:
+ case SolverDef::SOLVER_CVC_KIND:
+ {
+ CVC4Solver solver(true /*to set option << produce-models >>*/);
+
+ return( solver.solve( aCondition, dataVector, valuesVector ) );
+ }
+#endif /* _AVM_SOLVER_CVC4_ */
+
+
+#if defined( _AVM_SOLVER_Z3_ )
+ case SolverDef::SOLVER_Z3_KIND:
+ {
+ Z3Solver solver;
+ return( solver.solve( aCondition, dataVector, valuesVector ) );
+ }
+#endif /* _AVM_SOLVER_Z3_ */
+
+
+#if defined( _AVM_SOLVER_YICES_V2_ )
+ case SolverDef::SOLVER_YICES2_KIND:
+ case SolverDef::SOLVER_YICES_KIND:
+ {
+ Yices2Solver solver;
+
+ return( solver.solve( aCondition, dataVector, valuesVector ) );
+ }
+#endif /* _AVM_SOLVER_YICES_V2_ */
+
+
+#if defined( _AVM_SOLVER_OMEGA_ )
+ case SolverDef::SOLVER_OMEGA_KIND:
+ {
+ OmegaSolver solver;
+
+ return( solver.solve( aCondition, dataVector, valuesVector ) );
+ }
+#endif /* _AVM_SOLVER_OMEGA_ */
+
+ default:
+ {
+AVM_OS_WARNING_ALERT
+ << "SolverFactory::solve:> Unknown solver << "
+ << SolverDef::strSolver( aSolverKind )
+ << " >> in this executable !!!"
+ << SEND_ALERT;
+
+ return( false );
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// EXECUTION CONTEXT SOLVING
+////////////////////////////////////////////////////////////////////////////////
+
+APExecutionData SolverFactory::solve(SolverDef::SOLVER_KIND aSolverKind,
+ EvaluationEnvironment & ENV, const ExecutionContext & anEC,
+ const BF & aCondition)
+{
+ switch( aSolverKind )
+ {
+#if defined( _AVM_SOLVER_CVC4_ )
+ case SolverDef::SOLVER_CVC4_KIND:
+ case SolverDef::SOLVER_CVC_KIND:
+ {
+ CVC4Solver aSolver(true /*to set option << produce-models >>*/);
+
+ return( SolverFactory::solve(aSolver, ENV, anEC, aCondition) );
+ }
+#endif /* _AVM_SOLVER_CVC4_ */
+
+
+#if defined( _AVM_SOLVER_Z3_ )
+ case SolverDef::SOLVER_Z3_KIND:
+ {
+ Z3Solver aSolver;
+
+ return( SolverFactory::solve(aSolver, ENV, anEC, aCondition) );
+ }
+#endif /* _AVM_SOLVER_Z3_ */
+
+
+#if defined( _AVM_SOLVER_YICES_V2_ )
+ case SolverDef::SOLVER_YICES2_KIND:
+ case SolverDef::SOLVER_YICES_KIND:
+ {
+ Yices2Solver aSolver;
+
+ return( SolverFactory::solve(aSolver, ENV, anEC, aCondition) );
+ }
+#endif /* _AVM_SOLVER_YICES_V2_ */
+
+
+#if defined( _AVM_SOLVER_OMEGA_ )
+ case SolverDef::SOLVER_OMEGA_KIND:
+ {
+ OmegaSolver aSolver;
+
+ return( SolverFactory::solve(aSolver, ENV, anEC, aCondition) );
+ }
+#endif /* _AVM_SOLVER_OMEGA_ */
+
+
+ default:
+ {
+AVM_OS_ASSERT_FATAL_ERROR_EXIT( theDefaultSolver4ModelsProduction == NULL )
+ << "SolverFactory::solve:> Unknown solver << "
+ << SolverDef::strSolver( aSolverKind )
+ << " >> in this executable and and there are no default alternative solver !"
+ << SEND_ALERT;
+
+ return( SolverFactory::solve(
+ (*theDefaultSolver4ModelsProduction), ENV, anEC, aCondition) );
+ }
+ }
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// EXECUTION DATA SOLVING
+////////////////////////////////////////////////////////////////////////////////
+
+bool SolverFactory::solve(SatSolver & aSolver, EvaluationEnvironment & ENV,
+ APExecutionData & anED, const BF & aCondition)
+{
+ thePCParameters.clear();
+ thePCParameterValues.clear();
+
+ // On numérise le PC
+
+ // On crée un ED avec des valeurs numériques
+ if( aSolver.solve( aCondition, thePCParameters, thePCParameterValues ) )
+ {
+ if( thePCParameterValues.nonempty() )
+ {
+ setRuntimeParametersSolvingValues(anED);
+
+ ExecutableForm * exec = NULL;
+ TableOfInstanceOfData::const_raw_iterator itData;
+ TableOfInstanceOfData::const_raw_iterator endData;
+
+ TableOfRuntimeT::
+ const_iterator itRF = anED->getTableOfRuntime().begin();
+ TableOfRuntimeT::
+ const_iterator endRF = anED->getTableOfRuntime().end();
+ for( RuntimeID itRID ; itRF != endRF ; ++itRF)
+ {
+ itRID = (*itRF)->getRID();
+
+ exec = itRID.getExecutable();
+ if( exec->hasBasicData() )
+ {
+ itData = exec->getBasicData().begin();
+ endData = exec->getBasicData().end();
+ for( ; itData != endData ; ++itData)
+ {
+ const BF & rvalue = ENV.getRvalue(anED, itRID, (itData));
+
+ updateRuntimeParametersValues(rvalue);
+
+ if( ENV.eval(theSymbolicED,
+ theSymbolicED->getParametersRID(), rvalue) )
+ {
+ ENV.setRvalue(anED, itRID, (itData), ENV.outVAL);
+ }
+ else
+ {
+ finalizeRuntimeParameters();
+ return( false );
+ }
+ }
+ }
+ }
+
+ finalizeRuntimeParameters();
+ }
+ thePCParameters.clear();
+ thePCParameterValues.clear();
+
+ return( true );
+ }
+ else
+ {
+ thePCParameters.clear();
+ thePCParameterValues.clear();
+
+ return( false );
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// EXECUTION CONTEXT PARAMETERS NUMERIZATION
+////////////////////////////////////////////////////////////////////////////////
+
+bool SolverFactory::solveParameters(APExecutionData & anED, const BF & aCondition)
+{
+ if( aCondition.isEqualTrue() )
+ {
+ return( false );
+ }
+
+ thePCParameters.clear();
+ thePCParameterValues.clear();
+
+ if( theDefaultSolver4ModelsProduction->solve(
+ aCondition, thePCParameters, thePCParameterValues) )
+ {
+ ParametersRuntimeForm & paramsRF = anED.getWritableParametersRuntimeForm();
+ APTableOfData & aDataTable = paramsRF.getWritableDataTable();
+
+ BFVector::raw_iterator< InstanceOfData > itParam = thePCParameters.begin();
+ BFVector::raw_iterator< InstanceOfData > endParam = thePCParameters.end();
+ for( std::size_t offset = 0 ; itParam != endParam ; ++itParam , ++offset )
+ {
+ aDataTable->set( (itParam), thePCParameterValues[offset] );
+ }
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Pour pouvoir reutiliser tout l'outillage de Diverity
+////////////////////////////////////////////////////////////////////////////////
+
+void SolverFactory::setModel(EvaluationEnvironment & ENV, APExecutionData & anED)
+{
+ ParametersRuntimeForm & paramsRF = anED.getWritableParametersRuntimeForm();
+
+ BaseTypeSpecifier * paramType = NULL;
+ BF value;
+ TableOfInstanceOfData::const_raw_iterator itParam =
+ paramsRF.getParameters().begin();
+ TableOfInstanceOfData::const_raw_iterator endParam =
+ paramsRF.getParameters().end();
+ TableOfData::const_iterator itValue = paramsRF.getDataTable()->begin();
+ for( ; itParam != endParam ; ++itParam, ++itValue )
+ {
+ value = (*itValue);
+
+ (itParam)->getwModifier().setFeatureFinal( false );
+
+ if( value.isBuiltinValue() )
+ {
+ /* OK:> value is numeric */
+ }
+ else if( value != (itParam) )
+ {
+ if( ENV.eval(anED, anED->getSystemRID(), value) )
+ {
+ paramsRF.setData((itParam)->getOffset(), ENV.outVAL);
+ }
+ }
+ else if( (itParam)->hasValue() )
+ {
+ paramsRF.setData((itParam)->getOffset(), (itParam)->getValue());
+ }
+ else if( (itParam)->hasTypeSpecifier() &&
+ (itParam)->getTypeSpecifier()->hasDefaultValue() )
+ {
+ paramsRF.setData((itParam)->getOffset(),
+ (itParam)->getTypeSpecifier()->getDefaultValue());
+ }
+ else
+ {
+ paramType = (itParam)->referedTypeSpecifier();
+
+ /* OK:> NO value */
+ if( paramType->isTypedNumeric() )
+ {
+ if( paramType->isTypedInterval() )
+ {
+ IntervalTypeSpecifier * intervalTS = (itParam)->
+ getTypeSpecifier()->as< IntervalTypeSpecifier >();
+
+ if( intervalTS->getInfimum().isNumeric() &&
+ intervalTS->getSupremum().isNumeric() )
+ {
+ // Calcul aléatoire d'un nombre entier
+ paramsRF.setData( (itParam)->getOffset(),
+ ExpressionConstructor::newInteger(
+ RANDOM::gen_int(
+ intervalTS->getInfimum().toInteger(),
+ intervalTS->getSupremum().toInteger())) );
+ }
+ else if( intervalTS->isLClosed() )
+ {
+ // Calcul aléatoire d'un nombre entier
+ paramsRF.setData( (itParam)->getOffset(),
+ intervalTS->getInfimum() );
+ }
+ else if( intervalTS->isRClosed() )
+ {
+ // Calcul aléatoire d'un nombre entier
+ paramsRF.setData( (itParam)->getOffset(),
+ intervalTS->getSupremum() );
+ }
+ else
+ {
+ // Calcul aléatoire d'un nombre entier
+ paramsRF.setData( (itParam)->getOffset(),
+ ExpressionConstructor::divExpr(
+ ExpressionConstructor::addExpr(
+ intervalTS->getInfimum(),
+ intervalTS->getSupremum()),
+ ExpressionConstant::INTEGER_TWO) );
+ }
+ }
+ else
+ {
+ // Calcul aléatoire d'un nombre entier
+ paramsRF.setData((itParam)->getOffset(),
+ ExpressionConstructor::newInteger(
+ RANDOM::gen_uint(0, AVM_NUMERIC_MAX_INT8)) );
+ }
+ }
+
+ else if( paramType->isTypedBoolean() )
+ {
+ // Calcul aléatoire d'un nombre compris entre 0 et 1
+ paramsRF.setData((itParam)->getOffset(),
+ ExpressionConstructor::newBoolean(
+ RANDOM::gen_uint(0, 1) != 0));
+ }
+ else if( paramType->isTypedEnum() )
+ {
+ // Choix aléatoire d'un symbol du type Enum
+ paramsRF.setData((itParam)->getOffset(),
+ paramType->as< EnumTypeSpecifier
+ >()->getRandomSymbolData());
+ }
+
+ else if( paramType->isTypedString() )
+ {
+ // Calcul aléatoire d'une chaine de charactère
+
+ paramsRF.setData((itParam)->getOffset(),
+ ExpressionConstructor::newString("<< random string >>"));
+
+// AVM_OS_FATAL_ERROR_EXIT
+// << "SolverFactory::setModel:> "
+// "Unexpected symbolic value for << "
+// << str_header( *itParam ) << " >> !!!"
+// << SEND_EXIT;
+
+ }
+ else if( paramType->isTypedCharacter() )
+ {
+ // Choix aléatoire d'un charactère
+
+ paramsRF.setData((itParam)->getOffset(),
+ ExpressionConstructor::newChar(RANDOM::gen_char()));
+
+// AVM_OS_FATAL_ERROR_EXIT
+// << "SolverFactory::setModel:> "
+// "Unexpected symbolic value for << "
+// << str_header( *itParam ) << " >> !!!"
+// << SEND_EXIT;
+ }
+
+ else if( paramType->isTypedMachine() )
+ {
+ paramsRF.setData((itParam)->getOffset(),
+ RuntimeLib::RID_ENVIRONMENT);
+
+// AVM_OS_FATAL_ERROR_EXIT
+// << "SolverFactory::setModel:> "
+// "Unexpected symbolic value for << "
+// << str_header( *itParam ) << " >> !!!"
+// << SEND_EXIT;
+ }
+
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "SolverFactory::setModel:> "
+ "Unexpected symbolic parameter type << "
+ << str_header( *itParam ) << " >> !!!"
+ << SEND_EXIT;
+ }
+ }
+ }
+}
+
+
+void SolverFactory::resetModel(APExecutionData & anED)
+{
+ ParametersRuntimeForm & paramsRF = anED.getWritableParametersRuntimeForm();
+
+ TableOfInstanceOfData::const_raw_iterator itParam =
+ paramsRF.getParameters().begin();
+ TableOfInstanceOfData::const_raw_iterator endParam =
+ paramsRF.getParameters().end();
+ for( ; itParam != endParam ; ++itParam )
+ {
+ (itParam)->getwModifier().setFeatureFinal( true );
+ }
+}
+
+
+
+void SolverFactory::setRuntimeParametersSolvingValues(APExecutionData & anED)
+{
+ theSymbolicED = anED;
+
+ ParametersRuntimeForm & paramsRF =
+ theSymbolicED.getWritableParametersRuntimeForm();
+
+ paramsRF.resetOffset();
+
+ BFVector::raw_iterator< InstanceOfData > itVar = thePCParameters.begin();
+ BFVector::raw_iterator< InstanceOfData > endVar = thePCParameters.end();
+ for( avm_offset_t offset = 0 ; itVar != endVar ; ++itVar, ++offset )
+ {
+ (itVar)->getwModifier().setFeatureFinal( false );
+
+// if( (itVar) != paramsRF.rawVariable((itVar)->getOffset()) )
+// {
+// AVM_OS_COUT << ":?!?> " << (itVar)->getFullyQualifiedNameID()
+// << " (param: " << paramsRF.rawVariable(
+// (itVar)->getOffset())->getFullyQualifiedNameID() << ")"
+// << " = " << paramsRF.getData((itVar)->getOffset()).str()
+// << " <- " << thePCParameterValues[offset].str()
+// << std::endl;
+// }
+
+ paramsRF.setData((itVar)->getOffset(), thePCParameterValues[offset]);
+ }
+}
+
+
+void SolverFactory::updateRuntimeParametersValues(const BF & aValue)
+{
+ BFVector exprVariableVector;
+ ExpressionFactory::collectVariable(aValue, exprVariableVector);
+
+ const ParametersRuntimeForm & paramsRF =
+ theSymbolicED->getParametersRuntimeForm();
+
+ BFVector::raw_iterator< InstanceOfData > itVar = exprVariableVector.begin();
+ BFVector::raw_iterator< InstanceOfData > endVar = exprVariableVector.end();
+ for( ; itVar != endVar ; ++itVar )
+ {
+ if( not thePCParameters.contains(*itVar) )
+ {
+ (itVar)->getwModifier().setFeatureFinal( false );
+
+ if( (itVar)->hasValue() )
+ {
+ paramsRF.setData((itVar)->getOffset(), (itVar)->getValue());
+ }
+ else
+ {
+ paramsRF.setData((itVar)->getOffset(), (*itVar));
+ }
+ }
+ }
+}
+
+
+
+void SolverFactory::finalizeRuntimeParameters()
+{
+ TableOfInstanceOfData::const_raw_iterator itVar =
+ theSymbolicED->getParametersRuntimeForm().getVariables().begin();
+ TableOfInstanceOfData::const_raw_iterator endVar =
+ theSymbolicED->getParametersRuntimeForm().getVariables().end();
+ for( ; itVar != endVar ; ++itVar )
+ {
+ (itVar)->getwModifier().setFeatureFinal( true );
+ }
+
+ theSymbolicED.destroy();
+}
+
+
+////////////////////////////////////////////////////////////////////////////
+// EXECUTION DATA NEWFRESH
+////////////////////////////////////////////////////////////////////////////
+
+APExecutionData SolverFactory::solveNewfresh(SolverDef::SOLVER_KIND aSolverKind,
+ EvaluationEnvironment & ENV, const ExecutionContext & anEC,
+ const BF & aCondition)
+{
+ APExecutionData anED = anEC.getAPExecutionData();
+
+ ParametersRuntimeForm & paramsRF = anED.getWritableParametersRuntimeForm();
+
+ BF value;
+ TableOfInstanceOfData::const_raw_iterator itParam =
+ paramsRF.getParameters().begin();
+ TableOfInstanceOfData::const_raw_iterator endParam =
+ paramsRF.getParameters().end();
+ TableOfData::const_iterator itValue = paramsRF.getDataTable()->begin();
+ for( ; itParam != endParam ; ++itParam, ++itValue )
+ {
+ value = (*itValue);
+
+ (itParam)->getwModifier().setFeatureFinal( false );
+
+ if( value.isBuiltinValue() )
+ {
+ /* OK:> value is numeric */
+ }
+ else if( value != (itParam) )
+ {
+ if( ENV.eval(anED, anED->getSystemRID(), value) )
+ {
+ paramsRF.setData((itParam)->getOffset(), ENV.outVAL);
+ }
+ }
+ else if( (itParam)->hasValue() )
+ {
+ paramsRF.setData((itParam)->getOffset(), (itParam)->getValue());
+ }
+ else
+ {
+ BFList paramList;
+
+ value = ENV.createNewFreshParam(
+ paramsRF.getRID(), (itParam), paramList );
+
+ paramsRF.setData( (itParam)->getOffset(), value );
+ }
+ }
+
+ return( anED );
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/solver/api/SolverFactory.h b/org.eclipse.efm.symbex/src/solver/api/SolverFactory.h
new file mode 100644
index 0000000..e32e14f
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/solver/api/SolverFactory.h
@@ -0,0 +1,279 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 9 juil. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef SOLVER_SOLVERFACTORY_H_
+#define SOLVER_SOLVERFACTORY_H_
+
+#include <collection/Typedef.h>
+
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/ExecutionData.h>
+
+#include <solver/api/SolverDef.h>
+
+
+namespace sep
+{
+
+class Element;
+class BF;
+
+class EvaluationEnvironment;
+
+class InstanceOfData;
+
+class SatSolver;
+
+
+class SolverFactory
+{
+
+public:
+ /**
+ * ATTRIBUTE
+ */
+ static SatSolver * theDefaultSolver4CheckSatisfiability;
+ static SatSolver * theDefaultSolver4ModelsProduction;
+
+ static BFVector thePCParameters;
+ static BFVector thePCParameterValues;
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Pour pouvoir reutiliser tout l'outillage de Diverity
+ static APExecutionData theSymbolicED;
+
+
+public:
+ /**
+ * LOADER - DISPOSER
+ * DESTROY
+ */
+ static void load();
+ static void dispose();
+
+ static void destroy(SatSolver * aSolver);
+
+ /**
+ * SOLVER API
+ */
+ static SolverDef::SATISFIABILITY_RING isSatisfiable(
+ SolverDef::SOLVER_KIND aSolverKind, const BF & aCondition);
+
+ inline static bool isStrongSatisfiable(
+ SolverDef::SOLVER_KIND aSolverKind, const BF & aCondition)
+ {
+ return( SolverFactory::isSatisfiable(aSolverKind, aCondition)
+ == SolverDef::SATISFIABLE );
+ }
+
+ inline static bool isWeakSatisfiable(
+ SolverDef::SOLVER_KIND aSolverKind, const BF & aCondition)
+ {
+ return( SolverFactory::isSatisfiable(aSolverKind, aCondition)
+ != SolverDef::UNSATISFIABLE );
+ }
+
+
+
+ static SolverDef::SATISFIABILITY_RING isSatisfiable(
+ const BF & aCondition, bool useDefaultSolver = false);
+
+ inline static bool isStrongSatisfiable(
+ const BF & aCondition, bool useDefaultSolver)
+ {
+ return( SolverFactory::isSatisfiable(aCondition, useDefaultSolver)
+ == SolverDef::SATISFIABLE );
+ }
+
+ inline static bool isWeakSatisfiable(
+ const BF & aCondition, bool useDefaultSolver)
+ {
+ return( SolverFactory::isSatisfiable(aCondition, useDefaultSolver)
+ != SolverDef::UNSATISFIABLE );
+ }
+
+ inline static bool isStrongSatisfiable(const BF & aCondition)
+ {
+ return( SolverFactory::isSatisfiable(aCondition,
+ SolverDef::DEFAULT_SOLVER_USAGE_FLAG) == SolverDef::SATISFIABLE );
+ }
+
+ inline static bool isWeakSatisfiable(const BF & aCondition)
+ {
+ return( SolverFactory::isSatisfiable(aCondition,
+ SolverDef::DEFAULT_SOLVER_USAGE_FLAG) != SolverDef::UNSATISFIABLE );
+ }
+
+
+ /**
+ * USED BY FAM LtlProverFilter
+ */
+ static bool isEmptyIntersection(
+ ListOfInstanceOfData aListOfVarParam,
+ const ExecutionContext & aMainEC,
+ const ExecutionContext & aComparEC);
+
+ static bool isSubSet(
+ const ExecutionContext & aMainEC,
+ const ExecutionContext & aComparEC);
+
+
+ /**
+ * SOLVER
+ */
+ static SatSolver * newSolver4CheckSatisfiability(
+ SolverDef::SOLVER_KIND aSolverKind);
+
+ static SatSolver * newSolver4ModelsProduction(
+ SolverDef::SOLVER_KIND aSolverKind);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONDITION PARAMETER SOLVING
+ ////////////////////////////////////////////////////////////////////////////
+
+ static bool solve(SolverDef::SOLVER_KIND aSolverKind, const BF & aCondition,
+ BFVector & dataVector, BFVector & valuesVector);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // EXECUTION CONTEXT SOLVING
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static APExecutionData solve(
+ EvaluationEnvironment & ENV, const ExecutionContext & anEC)
+ {
+// return( SolverFactory::solve(
+// SolverDef::DEFAULT_SOLVER_KIND, ENV, anEC) );
+
+ return( SolverFactory::solve(
+ (*theDefaultSolver4ModelsProduction), ENV, anEC) );
+ }
+
+ inline static APExecutionData solve(SolverDef::SOLVER_KIND aSolverKind,
+ EvaluationEnvironment & ENV, const ExecutionContext & anEC)
+ {
+ return( SolverFactory::solve(aSolverKind, ENV, anEC,
+ anEC.refExecutionData().getAllPathCondition()) );
+ }
+
+ static APExecutionData solve(SolverDef::SOLVER_KIND aSolverKind,
+ EvaluationEnvironment & ENV, const ExecutionContext & anEC,
+ const BF & aCondition);
+
+
+ inline static APExecutionData solve(SatSolver & aSolver,
+ EvaluationEnvironment & ENV, const ExecutionContext & anEC)
+ {
+ APExecutionData anED = anEC.getAPExecutionData();
+ return( SolverFactory::solve(aSolver, ENV, anED) ?
+ anED : APExecutionData::REF_NULL);
+ }
+
+ inline static APExecutionData solve(SatSolver & aSolver,
+ EvaluationEnvironment & ENV, const ExecutionContext & anEC,
+ const BF & aCondition)
+ {
+ APExecutionData anED = anEC.getAPExecutionData();
+
+ return( SolverFactory::solve(aSolver, ENV, anED, aCondition) ?
+ anED : APExecutionData::REF_NULL);
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // EXECUTION DATA SOLVING
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static bool solve(
+ EvaluationEnvironment & ENV, APExecutionData & anED)
+ {
+ return( SolverFactory::solve(
+ (*theDefaultSolver4ModelsProduction), ENV, anED) );
+ }
+
+ inline static bool solve(SatSolver & aSolver,
+ EvaluationEnvironment & ENV, APExecutionData & anED)
+ {
+ return( SolverFactory::solve(aSolver, ENV, anED,
+ anED->getAllPathCondition()) );
+ }
+
+ static bool solve(SatSolver & aSolver, EvaluationEnvironment & ENV,
+ APExecutionData & anED, const BF & aCondition);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // EXECUTION CONTEXT NUMERIZATION
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static ExecutionContext * numerize(
+ EvaluationEnvironment & ENV, const ExecutionContext & anEC)
+ {
+ return( SolverFactory::numerize(
+ (*theDefaultSolver4ModelsProduction), ENV, anEC) );
+ }
+
+ inline static ExecutionContext * numerize(SatSolver & aSolver,
+ EvaluationEnvironment & ENV, const ExecutionContext & anEC)
+ {
+ APExecutionData newED = SolverFactory::solve(aSolver, ENV, anEC);
+
+ // ATTENTION : Hauteur à modifier !!!
+ return( new ExecutionContext(anEC, newED, anEC.getHeight() + 1, 0) );
+ }
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // EXECUTION CONTEXT PARAMETERS NUMERIZATION
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static bool solveParameters(APExecutionData & anED)
+ {
+ return( solveParameters(anED, anED->getAllPathCondition()) );
+ }
+
+ static bool solveParameters(APExecutionData & anED, const BF & aCondition);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Pour pouvoir reutiliser tout l'outillage de DIVERSITY
+ ////////////////////////////////////////////////////////////////////////////
+
+ static void setModel(EvaluationEnvironment & ENV, APExecutionData & anED);
+ static void resetModel(APExecutionData & anED);
+
+ static void setRuntimeParametersSolvingValues(APExecutionData & anED);
+ static void updateRuntimeParametersValues(const BF & aValue);
+
+ static void finalizeRuntimeParameters();
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // EXECUTION DATA NEWFRESH
+ ////////////////////////////////////////////////////////////////////////////
+
+ static APExecutionData solveNewfresh(SolverDef::SOLVER_KIND aSolverKind,
+ EvaluationEnvironment & ENV, const ExecutionContext & anEC,
+ const BF & aCondition);
+
+};
+
+
+
+}
+
+#endif /* SOLVER_SOLVERFACTORY_H_ */
diff --git a/org.eclipse.efm.symbex/src/svninfo.mk b/org.eclipse.efm.symbex/src/svninfo.mk
new file mode 100644
index 0000000..1b6332a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/svninfo.mk
@@ -0,0 +1,36 @@
+
+SVNINFO_BAK = svninfo.bak
+SVNINFO_NEW = svninfo.tmp
+
+AVM_LAUNCHER_CPP = `pwd`/../src/main/AvmLauncher.cpp
+
+
+all: AvmLauncher.cpp
+
+AvmLauncher.cpp: svninfo
+ @if test -s $(SVNINFO_NEW); \
+ then \
+ rm -f $(SVNINFO_NEW); \
+ SVN_REV=`cat $(SVNINFO_BAK) | egrep "^R.vision.:" | egrep -o "[[:digit:]]+$$"`; \
+ SVN_REV_NEXT=$$(($$SVN_REV + 1 )); \
+ echo "SUBVERSION_REVISION = $$SVN_REV_NEXT" ; \
+ sed -i -r -e "50,70 s/(SUBVERSION_REVISION_NUMBER) = [0-9]+/\1 = $${SVN_REV_NEXT}/" \
+ -e "50,70 s/(SUBVERSION_REVISION_STRING) = \"[0-9]+\"/\1 = \"$${SVN_REV_NEXT}\"/" $(AVM_LAUNCHER_CPP) ; \
+ fi
+
+svninfo: svninfo-gen
+ @if test -s $(SVNINFO_BAK); \
+ then \
+ if diff -q $(SVNINFO_NEW) $(SVNINFO_BAK) > /dev/null ; \
+ then rm -f $(SVNINFO_NEW); echo "No difference !"; \
+ else cp $(SVNINFO_NEW) $(SVNINFO_BAK); echo "Update of $(SVNINFO_BAK)"; \
+ fi; \
+ else cp $(SVNINFO_NEW) $(SVNINFO_BAK); echo "Creation of $(SVNINFO_BAK)"; \
+ fi
+
+# .PHONY ensures the .tmp version is always rebuilt (to check for any changes)
+.PHONY: svninfo-gen
+svninfo-gen:
+ svn info `pwd`/../src > $(SVNINFO_NEW)
+
+
diff --git a/org.eclipse.efm.symbex/src/util/BoostFactory.cpp b/org.eclipse.efm.symbex/src/util/BoostFactory.cpp
new file mode 100644
index 0000000..f8e4676
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/util/BoostFactory.cpp
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 8 juil. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "BoostFactory.h"
+
+#include <boost/config.hpp>
+
+
+namespace sep
+{
+
+
+// BOOST_POSIX or BOOST_WINDOWS specify which API to use.
+#if !defined( BOOST_WINXX ) || !defined( BOOST_WINDOWS ) && !defined( BOOST_POSIX ) && !defined( BOOST_CYGWIN )
+# if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(WIN64) || defined(_WIN64) || defined(__WIN64__)
+# define __AVM_BOOST_WINXX__
+# define __AVM_BOOST_WINDOWS__
+# elif defined(CYGWIN) || defined(_CYGWIN) || defined(_CYGWIN_) || defined(__CYGWIN__)
+# define __AVM_BOOST_CYGWIN__
+# define __AVM_BOOST_WINDOWS__
+# else
+# define __AVM_BOOST_POSIX__
+# endif
+#endif
+
+
+std::string BoostFactory::PLATFORM = BOOST_PLATFORM;
+
+bool BoostFactory::IS_WINXX_PLATFORM = (
+ (BoostFactory::PLATFORM == "Win32") ||
+ (BoostFactory::PLATFORM == "Win64") );
+
+
+bool BoostFactory::IS_CYGWYN_PLATFORM = (BoostFactory::PLATFORM == "Cygwin") ;
+
+
+bool BoostFactory::IS_WINDOWS_PLATFORM = (
+ BoostFactory::IS_WINXX_PLATFORM ||
+ BoostFactory::IS_CYGWYN_PLATFORM );
+
+
+bool BoostFactory::IS_POSIX_PLATFORM = (not BoostFactory::IS_WINDOWS_PLATFORM);
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/util/BoostFactory.h b/org.eclipse.efm.symbex/src/util/BoostFactory.h
new file mode 100644
index 0000000..6bcabd9
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/util/BoostFactory.h
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 8 juil. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef UTIL_BOOSTFACTORY_H_
+#define UTIL_BOOSTFACTORY_H_
+
+#include <string>
+
+# if defined(BOOST_FILESYSTEM_VERSION) \
+ && BOOST_FILESYSTEM_VERSION != 2 && BOOST_FILESYSTEM_VERSION != 3
+# error BOOST_FILESYSTEM_VERSION defined, but not as 2 or 3
+# endif
+
+
+namespace sep
+{
+
+class BoostFactory
+{
+
+public:
+ static std::string PLATFORM;
+
+ static bool IS_WINXX_PLATFORM;
+ static bool IS_CYGWYN_PLATFORM;
+ static bool IS_WINDOWS_PLATFORM;
+ static bool IS_POSIX_PLATFORM;
+
+};
+
+
+}
+
+#endif /* UTIL_BOOSTFACTORY_H_ */
diff --git a/org.eclipse.efm.symbex/src/util/CMakeLists.txt b/org.eclipse.efm.symbex/src/util/CMakeLists.txt
new file mode 100644
index 0000000..959ecb5
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/util/CMakeLists.txt
@@ -0,0 +1,16 @@
+# =============================================================================
+# CMake file for the UTIL library
+# =============================================================================
+
+# C++ source files to take into account (all files matching patterns)
+file (GLOB UTIL_CXX_SRC_FILES *.cpp *.h)
+
+# Target to build
+add_library (util STATIC ${UTIL_CXX_SRC_FILES})
+
+# Include directories (internal)
+target_include_directories (util PUBLIC ..) # FIXME : explicit the dependencies lib by lib
+
+# Target include directories (external)
+target_include_directories (util PUBLIC ${GMP_INCLUDE_DIR} ${GMPXX_INCLUDE_DIR})
+target_include_directories (util PUBLIC ${Boost_INCLUDE_DIRS})
diff --git a/org.eclipse.efm.symbex/src/util/ExecutionTime.cpp b/org.eclipse.efm.symbex/src/util/ExecutionTime.cpp
new file mode 100644
index 0000000..95c3f40
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/util/ExecutionTime.cpp
@@ -0,0 +1,397 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#define BODY_avm_tool_ExecutionTime 1
+/***********************************************************
+BODY OF THE ExecutionTime CLASS
+***********************************************************/
+
+#include "ExecutionTime.h"
+
+#include <sstream>
+
+#include <util/avm_string.h>
+
+
+namespace sep
+{
+
+
+/**
+* ExecutionTime::start_time
+*
+*/
+void ExecutionTime::start_time()
+{
+#ifdef __AVM_UNIX__
+ gettimeofday(&start_t, NULL);
+ getrusage(0, &start_r);
+ clock();
+#endif /* __AVM_UNIX__ */
+
+ t_depart = getClock();
+
+ t_start = std::time(NULL);
+
+//!!! BOOST TODO
+// time_start = boost::posix_time::microsec_clock::local_time();
+}
+
+/**
+* ExecutionTime::finish_time
+*
+*/
+void ExecutionTime::finish_time()
+{
+#ifdef __AVM_UNIX__
+ gettimeofday(&finish_t, NULL);
+ getrusage(0, &finish_r);
+ finish_clock = clock();
+#endif /* __AVM_UNIX__ */
+
+
+ t_end = std::time(NULL);
+
+ t_fin = getClock();
+
+//!!! BOOST TODO
+// time_end =boost::posix_time::microsec_clock::local_time();
+}
+
+/**
+* ExecutionTime::get_time_usage
+*
+*/
+void ExecutionTime::get_time_usage(int * rtp, int * utp, int * stp)
+{
+#ifdef __AVM_UNIX__
+#define TDIFF(f, s) \
+ (((f).tv_sec - (s).tv_sec) * 1000 + \
+ ((f).tv_usec - (s).tv_usec + 500) / 1000)
+
+ *rtp = TDIFF(finish_t, start_t);
+ *utp = TDIFF(finish_r.ru_utime, start_r.ru_utime);
+ *stp = TDIFF(finish_r.ru_stime, start_r.ru_stime);
+#endif /* __AVM_UNIX__ */
+}
+
+/**
+* ExecutionTime::format_time_milli
+*
+*/
+std::string ExecutionTime::format_time_milli(avm_uitime_t milliSecondes)
+{
+ std::ostringstream osTime;
+
+ avm_uitime_t s = milliSecondes / 1000;
+ avm_uitime_t mn = s / 60;
+ avm_uitime_t h = mn / 60;
+
+ avm_uitime_t ms = milliSecondes % 1000;
+ s = s % 60;
+ mn = mn % 60;
+
+ if (h != 0)
+ {
+ osTime << h << "h";
+ }
+ if (mn != 0)
+ {
+ osTime << mn << "m";
+ }
+ if (s != 0)
+ {
+ osTime << s << "s";
+ }
+ if( (ms != 0) || (milliSecondes == 0) )
+ {
+ osTime << ms << "ms";
+ }
+
+ return( osTime.str() );
+}
+
+/**
+* ExecutionTime::format_time_micro
+*
+*/
+std::string ExecutionTime::format_time_micro(avm_uitime_t microSecondes)
+{
+ std::ostringstream osTime;
+
+ avm_uitime_t ms = microSecondes / 1000;
+ avm_uitime_t s = ms / 1000;
+ avm_uitime_t mn = s / 60;
+ avm_uitime_t h = mn / 60;
+
+ avm_uitime_t us = microSecondes % 1000;
+ ms = ms % 1000;
+ s = s % 60;
+ mn = mn % 60;
+
+
+ if (h != 0)
+ {
+ osTime << h << "h";
+ }
+ if (mn != 0)
+ {
+ osTime << mn << "m";
+ }
+ if (s != 0)
+ {
+ osTime << s << "s";
+ }
+
+ if( ms != 0 )
+ {
+ osTime << ms << "ms";
+ }
+ if( (us) || (microSecondes == 0) )
+ {
+ osTime << us << "µs";
+ }
+
+ return( osTime.str() );
+}
+
+/**
+* ExecutionTime::format_time_nano
+*
+*/
+std::string ExecutionTime::format_time_nano(avm_uitime_t nanoSecondes)
+{
+ std::ostringstream osTime;
+
+ avm_uitime_t us = nanoSecondes / 1000;
+ avm_uitime_t ms = us / 1000;
+ avm_uitime_t s = ms / 1000;
+ avm_uitime_t mn = s / 60;
+ avm_uitime_t h = mn / 60;
+
+ avm_uitime_t ns = nanoSecondes % 1000;
+ us = us % 1000;
+ ms = ms % 1000;
+ s = s % 60;
+ mn = mn % 60;
+
+ if (h != 0)
+ {
+ osTime << h << "h";
+ }
+ if (mn != 0)
+ {
+ osTime << mn << "m";
+ }
+ if (s != 0)
+ {
+ osTime << s << "s";
+ }
+
+ if( ms != 0 )
+ {
+ osTime << ms << "ms";
+ }
+ if( us != 0 )
+ {
+ osTime << us << "us";
+ }
+ if( (ns != 0) || (nanoSecondes == 0) )
+ {
+ osTime << ns << "ns";
+ }
+
+ return( osTime.str() );
+}
+
+/**
+* ExecutionTime::print_time_stat
+*
+*/
+std::string ExecutionTime::time_stat()
+{
+ std::ostringstream osTime;
+
+#ifdef __AVM_UNIX__
+ int rtime, utime, stime;
+
+ get_time_usage(&rtime, &utime, &stime);
+
+ // a cause de: typedef signed long clock_t
+ if ((utime + stime) > 2000000/*2147000*/)
+ {
+ finish_clock = utime + stime;
+ }
+ else
+ {
+ finish_clock = finish_clock / 1000;
+ }
+
+ osTime << "(realTime " << format_time_milli(rtime);
+ osTime << " cpuTime " << format_time_milli(finish_clock);
+ osTime << " userTime " << format_time_milli(utime);
+ osTime << " systemTime " << format_time_milli(stime) << ")";
+
+// osTime << "(realTime " << rtime << " cpuTime " << (finish_clock / 1000)
+// << " userTime " << utime << " systemTime " << stime << "")";
+#endif /* __AVM_UNIX__ */
+
+
+ avm_ftime_t t_duree = (avm_ftime_t)(t_fin - t_depart);
+// osTime << " => " << OS_FLOAT_PRECISION << t_duree;
+// osTime << " --> " << format_time_micro( (avm_uitime_t)( t_duree * 1000000 ) );
+ osTime << " --> " << format_time_nano( (avm_uitime_t)( t_duree * 1000000000 ) );
+
+//?? osTime << " ==> " << std::difftime(t_end, t_start) << "s";
+
+
+//!!! BOOST TODO
+// boost::posix_time::time_duration duration(time_end - time_start);
+
+// osTime << " => " << duration;
+// osTime << " --> " << format_time_micro( duration.total_microseconds() );
+
+//!!! BOOST TODO
+// osTime << " --> " << format_time_nano( duration.total_nanoseconds() );
+
+ // Date & Heure Courante
+ std::time_t t;
+ std::time(&t);
+ osTime << " @ " << ( std::ctime(&t) );
+
+ return( osTime.str() );
+}
+
+
+
+std::string ExecutionTime::current_time()
+{
+ // Date & Heure Courante
+ time_t t;
+ time(&t);
+
+ return( sep::to_string(ctime(&t)) );
+}
+
+
+
+/*
+ * Recuperateur de temps :
+ */
+avm_ftime_t ExecutionTime::getClock ( void )
+{
+ avm_ftime_t d = 0 ;
+
+
+#ifndef __linux
+#ifdef _WIN32
+ struct timeval tval ;
+ struct timezone * tz=(struct timezone *)NULL ;
+
+ timerclear(&tval);
+
+ if ( gettimeofday(&tval, tz) )
+ {
+#ifdef VERBOSE
+ fprintf (stderr, "\nCLOCK ERROR !!!\n");
+#endif
+ }
+ else
+ {
+ d = ((avm_ftime_t)(tval.tv_usec)/1000000.0) ;
+ d = (avm_ftime_t) tval.tv_sec + d ;
+ }
+#else
+ struct timespec cur_time;
+
+ if (clock_gettime(CLOCK_REALTIME, &cur_time))
+ {
+#ifdef VERBOSE
+ fprintf (stderr, "\nCLOCK ERROR !!!\n");
+#endif
+ }
+ else
+ {
+ d = ((avm_ftime_t)(cur_time.tv_nsec) / (avm_ftime_t)(CLOCKS_PER_SEC)) / 1000000.0 ;
+ d = (avm_ftime_t) cur_time.tv_sec + d ;
+ }
+#endif
+#else
+ struct timeval tval ;
+ struct timezone * tz=(struct timezone *)NULL ;
+
+ timerclear(&tval);
+
+ if ( gettimeofday(&tval, tz) )
+ {
+#ifdef VERBOSE
+ fprintf (stderr, "\nCLOCK ERROR !!!\n");
+#endif
+ }
+ else
+ {
+ d = ((avm_ftime_t)(tval.tv_usec)/1000000.0) ;
+ d = (avm_ftime_t) tval.tv_sec + d ;
+ }
+#endif
+
+ return d ;
+}
+
+
+/*
+ * Programme de test:
+ */
+//int main( void )
+//{
+// int i ;
+// double t_depart, t_fin, t ;
+// double duree_en_millisecondes ; /* 1000 pour une seconde, 3600000 pour une heure */
+//
+//
+// /* Calcul temps de depart */
+// t_depart = GetClock() ;
+//
+// t = 0.0 ;
+//
+// for ( i = 0 ; i < 500000000 ; ++i )
+// t = t + 1.0 ;
+//
+// t_fin = GetClock() ;
+//
+// if ( (t_depart*t_fin) < 0.0 )
+// fprintf ( stderr, "\n ATTENTION !!! Une erreur s'est produite\n");
+// else
+// fprintf ( stderr, "\n Temps écoulé %g secondes pour une boucle 500000000 : \n",(t_fin - t_depart));
+//
+// t_depart = t_fin ;
+//
+// t = 0.0 ;
+//
+// for ( i = 0 ; i < 5000000 ; ++i )
+// t = t + 1.0 ;
+//
+// t_fin= GetClock() ;
+//
+// if ( (t_depart*t_fin) < 0.0 )
+// fprintf ( stderr, "\n ATTENTION !!! Une erreur s'est produite\n");
+// else
+// fprintf ( stderr, "\n Temps écoulé %g secondes pour une boucle 500000 : \n",(t_fin - t_depart));
+//
+//
+// return EXIT_SUCCESS ;
+//}
+
+
+}
+
+/***END OF THE ExecutionTime CLASS BODY***/
diff --git a/org.eclipse.efm.symbex/src/util/ExecutionTime.h b/org.eclipse.efm.symbex/src/util/ExecutionTime.h
new file mode 100644
index 0000000..9a5713b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/util/ExecutionTime.h
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef UTIL_EXECUTIONTIME_H_
+#define UTIL_EXECUTIONTIME_H_
+
+#include <ctime>
+#include <string>
+
+#ifdef __AVM_UNIX__
+
+#include <sys/resource.h>
+
+#endif /* __AVM_UNIX__ */
+
+#include <sys/time.h>
+
+//!!! BOOST TODO
+//#include <boost/date_time/posix_time/posix_time.hpp>
+
+#include <util/avm_numeric.h>
+
+namespace sep
+{
+
+
+class ExecutionTime
+{
+public :
+ /**
+ * CONSTRUCTOR
+ * DESTRUCTOR
+ */
+ ExecutionTime(bool startIt)
+ {
+ if( startIt )
+ {
+ start_time();
+ }
+ }
+
+ /*METHODS*/
+ void start_time();
+ void finish_time();
+ void get_time_usage(int * rtp, int * utp, int * stp);
+
+ std::string format_time_milli(avm_uitime_t milliSecondes);
+ std::string format_time_micro(avm_uitime_t microSecondes);
+ std::string format_time_nano(avm_uitime_t nanoSecondes);
+
+ std::string time_stat();
+
+ static std::string current_time();
+
+ static avm_ftime_t getClock();
+
+
+protected :
+
+ /*ATTRIBUTES*/
+
+
+#ifdef __AVM_UNIX__
+ struct timeval start_t;
+ struct timeval finish_t;
+ struct rusage start_r;
+ struct rusage finish_r;
+ clock_t finish_clock;
+#endif /* __AVM_UNIX__ */
+
+ avm_ftime_t t_depart;
+ avm_ftime_t t_fin;
+
+ std::time_t t_start;
+ std::time_t t_end;
+
+//!!! BOOST TODO
+// boost::posix_time::ptime time_start;
+// boost::posix_time::ptime time_end;
+};
+
+
+}
+
+
+#endif /*UTIL_EXECUTIONTIME_H_*/
diff --git a/org.eclipse.efm.symbex/src/util/README.md b/org.eclipse.efm.symbex/src/util/README.md
new file mode 100644
index 0000000..9373836
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/util/README.md
@@ -0,0 +1,10 @@
+# EFM-SYMBEX : Util
+
+## Source code structure
+
+### Interfaces
+
+### Classes
+
+### Factories
+
diff --git a/org.eclipse.efm.symbex/src/util/avm_assert.cpp b/org.eclipse.efm.symbex/src/util/avm_assert.cpp
new file mode 100644
index 0000000..40ab622
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/util/avm_assert.cpp
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 17 déc. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "avm_assert.h"
+
+#include <util/avm_debug.h>
+#include <util/avm_vfs.h>
+
+
+namespace sep
+{
+
+/**
+ *
+ */
+void AvmExitException::prologue()
+{
+ OS << EMPHASIS( mDescription , '>' , 80 );
+// OS << TAB << "<" << mDescription << "> ";
+
+AVM_IF_DEBUG_ENABLED_AND( not mSourcePath.empty() )
+ OS << TAB << "in " << VFS::wrapPath(mSourcePath,
+ 80 - OS.INDENT.tabSize() - 6 - ( (mLine > 0) ? 12 : 0 ), "...");
+ // with 10 for size(TAB + "in " + "..." + ", line: " + mLine)
+ if( mLine > 0 )
+ {
+ OS << ", line: " << mLine;
+ }
+ OS << std::endl;
+AVM_ENDIF_DEBUG_ENABLED
+}
+
+/**
+ * ERROR & WARNING
+ * COUNT
+ */
+std::size_t AVM_ERROR_COUNT = 0;
+
+std::size_t AVM_WARNING_COUNT = 0;
+
+
+AvmExitException AVM_OS_THROW_EXCEPTION(AVM_EXIT_FAILED_CODE);
+
+AvmExitException AVM_OS_THROW_ALERT(AVM_EXIT_FAILED_CODE);
+
+
+AvmEXIT_SIGNAL THROW_FATAL_ERROR( AVM_EXIT_FATAL_ERROR_CODE );
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/util/avm_assert.h b/org.eclipse.efm.symbex/src/util/avm_assert.h
new file mode 100644
index 0000000..801fd20
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/util/avm_assert.h
@@ -0,0 +1,316 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 17 déc. 2012
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVM_ASSERT_H_
+#define AVM_ASSERT_H_
+
+
+#include <exception>
+
+#include <cassert>
+#include <cstdio>
+#include <cstdlib>
+#include <string>
+
+#include <printer/OutStream.h>
+#include <util/avm_string.h>
+#include <util/avm_util.h>
+
+
+namespace sep
+{
+
+/**
+ * EXIT EXCEPTION
+ */
+struct AvmExitException : public std::exception
+{
+ /**
+ * ATTRIBUTES
+ */
+ StringOutStream OS;
+
+ AVM_EXIT_CODE_KIND mExitCode;
+
+ std::string mDescription;
+
+ // for debug
+ std::string mSourcePath;
+ long mLine;
+
+ /**
+ * CONSTRUCTOR / DESTRUCTOR
+ */
+ AvmExitException( AVM_EXIT_CODE_KIND anExitCode,
+ const std::string & aDescription = "",
+ const std::string & aSourcePath = "", long aLine = -1 )
+ : std::exception( ),
+ OS( WrapData( 80, 0, 4, "\n\t" ) , AvmIndent("" , "\t", "\n") ),
+ mExitCode( anExitCode ),
+ mDescription( aDescription ),
+ mSourcePath( aSourcePath ),
+ mLine( aLine )
+ {
+ prologue();
+ }
+
+ AvmExitException( const AvmExitException & anExitException )
+ : std::exception( ),
+ OS( WrapData( 80, 0, 4, "\n\t" ) , AvmIndent("" , "\t", "\n") ),
+ mExitCode( anExitException.mExitCode ),
+ mDescription( anExitException.mDescription ),
+ mSourcePath( anExitException.mSourcePath ),
+ mLine( anExitException.mLine )
+ {
+ OS << anExitException.OS.str();
+ }
+
+
+ virtual ~AvmExitException() throw()
+ {
+ //!! NOTHING
+ }
+
+ /**
+ * API
+ */
+ inline virtual const char* what() const throw()
+ {
+ return( mDescription.c_str() );
+ }
+
+ inline virtual std::string info() const throw()
+ {
+ return( OS.str() );
+ }
+
+ void prologue();
+
+
+ /**
+ * operator<<
+ */
+ template< class T >
+ inline AvmExitException & operator<<( const T & x )
+ {
+ OS << x;
+
+ return( *this );
+ }
+
+
+ inline AvmExitException & operator<<(AvmEXIT_SIGNAL exit_signal)
+ {
+ mExitCode = exit_signal.code;
+
+ throw( *this );
+
+ return( *this );
+ }
+
+ inline AvmExitException & operator<<(
+ void (*op) ( AvmExitException & os ) )
+ {
+ op( *this );
+
+ return( *this );
+ }
+
+
+ inline AvmExitException & operator<<(
+ void (*op) ( OutStream & os ) )
+ {
+ OS.operator<<( op );
+
+ return( *this );
+ }
+
+ inline AvmExitException & operator<<(
+ std::ostream & (*op) ( std::ostream & ) )
+ {
+ OS.operator<<( op );
+
+ return( *this );
+ }
+
+};
+
+
+extern AvmExitException AVM_OS_THROW_EXCEPTION;
+
+
+inline AvmExitException & osAssert(
+ AVM_EXIT_CODE_KIND anExitCode,
+ const std::string & aDescription,
+ const std::string & aSourcePath, long aLine )
+{
+ AVM_OS_THROW_EXCEPTION.OS.str("");
+ AVM_OS_THROW_EXCEPTION.mExitCode = anExitCode;
+ AVM_OS_THROW_EXCEPTION.mDescription = aDescription;
+ AVM_OS_THROW_EXCEPTION.mSourcePath = aSourcePath;
+ AVM_OS_THROW_EXCEPTION.mLine = aLine;
+
+ AVM_OS_THROW_EXCEPTION.prologue();
+
+ return( AVM_OS_THROW_EXCEPTION );
+}
+
+
+extern AvmExitException AVM_OS_THROW_ALERT;
+
+inline AvmExitException & osAlert(
+ AVM_EXIT_CODE_KIND anExitCode,
+ const std::string & aDescription,
+ const std::string & aSourcePath, long aLine )
+{
+ AVM_OS_THROW_ALERT.OS.str("");
+ AVM_OS_THROW_ALERT.mExitCode = anExitCode;
+ AVM_OS_THROW_ALERT.mDescription = aDescription;
+ AVM_OS_THROW_ALERT.mSourcePath = aSourcePath;
+ AVM_OS_THROW_ALERT.mLine = aLine;
+
+ AVM_OS_THROW_ALERT.prologue();
+
+ return( AVM_OS_THROW_ALERT );
+}
+
+
+inline void SEND_EXIT(AvmExitException & aee)
+{
+AVM_IF_DEBUG_ENABLED
+
+ AVM_OS_WARN << std::endl << aee.info() << std::endl
+ << REPEAT( '<' , 80 ) << std::endl << std::flush;
+
+AVM_DEBUG_ELSE
+
+ AVM_OS_CERR << std::endl << aee.info() << std::endl
+ << REPEAT( '<' , 80 ) << std::endl << std::flush;
+
+AVM_ENDIF_DEBUG_ENABLED
+
+ throw( aee );
+}
+
+inline void SEND_ALERT(AvmExitException & aee)
+{
+AVM_IF_DEBUG_ENABLED
+
+ AVM_OS_WARN << std::endl << aee.info() << std::endl
+ << REPEAT( '<' , 80 ) << std::endl << std::flush;
+
+AVM_DEBUG_ELSE
+
+ AVM_OS_CERR << std::endl << aee.info() << std::endl
+ << REPEAT( '<' , 80 ) << std::endl << std::flush;
+
+AVM_ENDIF_DEBUG_ENABLED
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+/**
+ * AVM OSTREAM EXIT
+ */
+#define AVM_OS_EXIT( KIND ) \
+ osAssert( AVM_EXIT_##KIND##_CODE, QUOTEME(KIND), __FILE__, __LINE__ )
+
+#define AVM_OS_FATAL_ERROR_EXIT AVM_OS_EXIT( FATAL_ERROR )
+
+
+/**
+ * AVM OSTREAM ASSERT EXIT
+ */
+#define AVM_OS_ASSERT_EXIT( KIND , assert_cond ) \
+ if( not (assert_cond) ) \
+ osAssert( AVM_EXIT_##KIND##_CODE, QUOTEME(KIND), __FILE__, __LINE__ )
+
+
+#define AVM_OS_ASSERT_OUT_OF_MEMORY_EXIT( aPtr ) \
+ AVM_OS_ASSERT_EXIT( OUT_OF_MEMORY , ((aPtr) != NULL) )
+
+
+#define AVM_OS_ASSERT_FATAL_ERROR_EXIT( assert_cond ) \
+ AVM_OS_ASSERT_EXIT( FATAL_ERROR , assert_cond )
+
+
+#define AVM_OS_ASSERT_FATAL_ARRAY_INDEX_EXIT( index , aSize ) \
+ AVM_OS_ASSERT_EXIT( FATAL_ERROR , ((aSize > index) && (index >= 0)) ) \
+ << " index:" << index << " is not in [ 0 , " << aSize \
+ << " [ : Unbound array index !!!"
+
+
+#define AVM_OS_ASSERT_FATAL_ARRAY_OFFSET_EXIT( offset , aSize ) \
+ AVM_OS_ASSERT_EXIT( FATAL_ERROR , ((aSize > offset) && (offset >= 0)) ) \
+ << " offset:" << offset << " is not in [ 0, " << aSize << " [ : "
+
+#define AVM_OS_ASSERT_FATAL_NULL_POINTER_EXIT( aPtr ) \
+ AVM_OS_ASSERT_EXIT( FATAL_ERROR , ((aPtr) != NULL) ) \
+ << "Unexpected a <null> "
+
+#define AVM_OS_ASSERT_FATAL_NULL_SMART_POINTER_EXIT( aPtr ) \
+ AVM_OS_ASSERT_EXIT( FATAL_ERROR , aPtr.valid() ) \
+ << "Unexpected a <null> "
+
+#define AVM_OS_ASSERT_FATAL_EMPTY_COLLECTION_EXIT( aPtr ) \
+ AVM_OS_ASSERT_EXIT( FATAL_ERROR , aPtr.nonempty() ) \
+ << "Unexpected an empty "
+
+
+/**
+ * AVM OSTREAM ALERT
+ */
+#define AVM_OS_ALERT( DESC ) \
+ osAlert( AVM_EXIT_GOOD_CODE, DESC, __FILE__, __LINE__ )
+
+
+#define AVM_OS_ERROR_ALERT AVM_OS_ALERT( "ERROR" )
+
+#define AVM_OS_WARNING_ALERT AVM_OS_ALERT( "WARNING" )
+
+#define AVM_OS_TODO_ALERT AVM_OS_ALERT( "TODO" )
+
+
+/**
+ * AVM OSTREAM ASSERT ALERT
+ */
+#define AVM_OS_ASSERT_ALERT( DESC , assert_cond ) \
+ if( not (assert_cond) ) \
+ osAlert( AVM_EXIT_GOOD_CODE, DESC, __FILE__, __LINE__ )
+
+#define AVM_OS_ASSERT_ERROR_ALERT( assert_cond ) \
+ AVM_OS_ASSERT_ALERT( "ERROR" , assert_cond )
+
+#define AVM_OS_ASSERT_WARNING_ALERT( assert_cond ) \
+ AVM_OS_ASSERT_ALERT( "WARNING" , assert_cond )
+
+
+/**
+ * AVM_ERROR_COUNT
+ * AVM_WARNING_COUNT
+ */
+extern std::size_t AVM_ERROR_COUNT;
+
+extern std::size_t AVM_WARNING_COUNT;
+
+
+} /* namespace sep */
+#endif /* AVM_ASSERT_H_ */
diff --git a/org.eclipse.efm.symbex/src/util/avm_debug.cpp b/org.eclipse.efm.symbex/src/util/avm_debug.cpp
new file mode 100644
index 0000000..d874b48
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/util/avm_debug.cpp
@@ -0,0 +1,539 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 11 févr. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "avm_debug.h"
+
+#include <util/avm_string.h>
+
+
+namespace sep {
+
+
+/**
+ ***************************************************************************
+ * AVM DEBUG LEVEL
+ ***************************************************************************
+ */
+unsigned short _AVM_DEBUG_LEVEL_ = AVM_DEBUG_ZERO_LEVEL;
+
+
+/**
+ ***************************************************************************
+ * AVM DEBUG KIND
+ ***************************************************************************
+ */
+std::size_t _AVM_DEBUG_FLAG_ = AVM_DEBUG_NOTHING_FLAG;
+
+
+
+/**
+ * avm_setDebugLevel
+ * avm_unsetDebugLevel
+ */
+void avm_setDebugLevel(std::string strDebugLevel)
+{
+#define SET_DEBUG_LEVEL( level ) \
+ else if( strDebugLevel == #level ) AVM_DEBUG_SET_LEVEL( level )
+
+ StringTools::toupper(strDebugLevel);
+
+ if( strDebugLevel.empty() ) AVM_DEBUG_SET_LEVEL( ZERO )
+
+ SET_DEBUG_LEVEL( ZERO )
+
+ SET_DEBUG_LEVEL( LOW )
+ SET_DEBUG_LEVEL( MEDIUM )
+
+ SET_DEBUG_LEVEL( HIGH )
+ SET_DEBUG_LEVEL( ULTRA )
+
+ SET_DEBUG_LEVEL( GOD_MODE )
+
+ else AVM_DEBUG_SET_LEVEL( ZERO )
+}
+
+
+void avm_unsetDebugLevel(std::string strDebugLevel)
+{
+#define UNSET_DEBUG_EXCEPT_LEVEL( level ) \
+ else if( strDebugLevel == #level ) AVM_DEBUG_SET_LEVEL( ZERO )
+
+#define UNSET_DEBUG_LEVEL( level ) \
+ else if( strDebugLevel == #level ) AVM_DEBUG_UNSET_LEVEL( level )
+
+ StringTools::toupper(strDebugLevel);
+
+ if( strDebugLevel.empty() ) AVM_DEBUG_SET_LEVEL( ZERO )
+
+ UNSET_DEBUG_LEVEL( LOW )
+ UNSET_DEBUG_LEVEL( MEDIUM )
+
+ UNSET_DEBUG_LEVEL( HIGH )
+ UNSET_DEBUG_LEVEL( ULTRA )
+
+ UNSET_DEBUG_EXCEPT_LEVEL( ZERO )
+ UNSET_DEBUG_EXCEPT_LEVEL( GOD_MODE )
+
+ else AVM_DEBUG_SET_LEVEL( ZERO )
+}
+
+std::string avm_strDebugLevel()
+{
+#define PRINT_DEBUG_LEVEL( level ) \
+ case AVM_DEBUG_##level##_LEVEL : return( #level );
+
+ switch( _AVM_DEBUG_LEVEL_ )
+ {
+ PRINT_DEBUG_LEVEL( ZERO )
+
+ PRINT_DEBUG_LEVEL( LOW )
+ PRINT_DEBUG_LEVEL( MEDIUM )
+
+ PRINT_DEBUG_LEVEL( HIGH )
+ PRINT_DEBUG_LEVEL( ULTRA )
+
+ PRINT_DEBUG_LEVEL( GOD_MODE )
+
+ default: return( "DEBUG#LEVEL< UNKNOWN >" );
+ }
+}
+
+
+/**
+ * avm_setDebugFlag
+ * avm_unsetDebugFlag
+ */
+void avm_setDebugFlag(std::string strDebugFlag)
+{
+#define SET_DEBUG_FLAG( flag ) \
+ else if( strDebugFlag == #flag ) AVM_DEBUG_ENABLE_FLAG( flag )
+
+
+ if( _AVM_DEBUG_FLAG_ == AVM_DEBUG_ALL_FLAG )
+ {
+ return;
+ }
+ else if( strDebugFlag.empty() || strDebugFlag == "NOTHING" ) {
+ _AVM_DEBUG_FLAG_ = AVM_DEBUG_NOTHING_FLAG;
+ }
+
+ // General Context
+
+ SET_DEBUG_FLAG( PARSING )
+
+ SET_DEBUG_FLAG( CONFIGURING )
+
+ SET_DEBUG_FLAG( COMPILING )
+
+ SET_DEBUG_FLAG( LOADING )
+
+ SET_DEBUG_FLAG( COMPUTING )
+
+ SET_DEBUG_FLAG( REPORTING )
+
+ SET_DEBUG_FLAG( SOLVING )
+ SET_DEBUG_FLAG( SAT_SOLVING )
+ SET_DEBUG_FLAG( SMT_SOLVING )
+
+ SET_DEBUG_FLAG( PROFILING )
+
+
+ // Process Stage: Processing, Filtering, ...
+
+ SET_DEBUG_FLAG( ALL_PROCESS_STAGE )
+ SET_DEBUG_FLAG( PROCESSOR )
+
+ SET_DEBUG_FLAG( PROCESSING )
+ SET_DEBUG_FLAG( PRE_PROCESSING )
+ SET_DEBUG_FLAG( POST_PROCESSING )
+
+ SET_DEBUG_FLAG( FILTERING )
+ SET_DEBUG_FLAG( PRE_FILTERING )
+ SET_DEBUG_FLAG( POST_FILTERING )
+
+ SET_DEBUG_FLAG( QUEUE )
+ SET_DEBUG_FLAG( QUEUING )
+
+
+ // Statement Evaluation
+
+ SET_DEBUG_FLAG( PROGRAM )
+
+ SET_DEBUG_FLAG( STATEMENT )
+
+ SET_DEBUG_FLAG( ASSIGNMENT )
+ SET_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ SET_DEBUG_FLAG( COMMUNICATION )
+ SET_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ SET_DEBUG_FLAG( STATEMENT_CONTROL )
+ SET_DEBUG_FLAG( STATEMENT_SCHEDULING )
+
+ SET_DEBUG_FLAG( TEST_DECISION )
+ SET_DEBUG_FLAG( STATEMENT_TEST_DECISION )
+
+ SET_DEBUG_FLAG( BYTECODE )
+
+ SET_DEBUG_FLAG( DATA )
+
+ SET_DEBUG_FLAG( TRACE )
+
+
+ // Element: Property, Signal...
+
+ SET_DEBUG_FLAG( VARIABLE )
+
+ SET_DEBUG_FLAG( BUFFER )
+
+ SET_DEBUG_FLAG( PORT )
+
+ SET_DEBUG_FLAG( SIGNAL )
+
+ SET_DEBUG_FLAG( CONNEXION )
+
+ SET_DEBUG_FLAG( TIME )
+
+
+ // Executable Component...
+
+ SET_DEBUG_FLAG( EXECUTABLE )
+
+ SET_DEBUG_FLAG( PRIMITIVE )
+
+ SET_DEBUG_FLAG( ACTIVITY )
+
+ SET_DEBUG_FLAG( ROUTINE )
+
+ SET_DEBUG_FLAG( TRANSITION )
+
+ SET_DEBUG_FLAG( MACHINE )
+
+ SET_DEBUG_FLAG( STATEMACHINE )
+
+
+ // Others: [Qualified]NameID, RefCount, ...
+
+ SET_DEBUG_FLAG( NAME_ID )
+
+ SET_DEBUG_FLAG( QUALIFIED_NAME_ID )
+
+ SET_DEBUG_FLAG( FULLY_QUALIFIED_NAME_ID )
+
+
+ SET_DEBUG_FLAG( CAS )
+
+ SET_DEBUG_FLAG( REDUNDANCE )
+
+
+ SET_DEBUG_FLAG( REFERENCE_COUNTING )
+
+ // God Mode
+ SET_DEBUG_FLAG( ALL )
+ SET_DEBUG_FLAG( GOD_MODE )
+}
+
+
+void avm_unsetDebugFlag(std::string strDebugFlag)
+{
+#define UNSET_DEBUG_FLAG( flag ) \
+ else if( strDebugFlag == #flag ) AVM_DEBUG_DISABLE_FLAG( flag )
+
+
+ if( _AVM_DEBUG_FLAG_ == AVM_DEBUG_NOTHING_FLAG )
+ {
+ return;
+ }
+ else if( strDebugFlag.empty()
+ || strDebugFlag == "NOTHING" ) {
+ _AVM_DEBUG_FLAG_ = AVM_DEBUG_NOTHING_FLAG;
+
+ return;
+ }
+
+ // General Context
+
+ UNSET_DEBUG_FLAG( PARSING )
+
+ UNSET_DEBUG_FLAG( CONFIGURING )
+
+ UNSET_DEBUG_FLAG( COMPILING )
+
+ UNSET_DEBUG_FLAG( LOADING )
+
+ UNSET_DEBUG_FLAG( COMPUTING )
+
+ UNSET_DEBUG_FLAG( REPORTING )
+
+ UNSET_DEBUG_FLAG( SOLVING )
+ UNSET_DEBUG_FLAG( SAT_SOLVING )
+ UNSET_DEBUG_FLAG( SMT_SOLVING )
+
+ UNSET_DEBUG_FLAG( PROFILING )
+
+
+ // Process Stage: Processing, Filtering, ...
+
+ UNSET_DEBUG_FLAG( ALL_PROCESS_STAGE )
+ UNSET_DEBUG_FLAG( PROCESSOR )
+
+ UNSET_DEBUG_FLAG( PROCESSING )
+ UNSET_DEBUG_FLAG( PRE_PROCESSING )
+ UNSET_DEBUG_FLAG( POST_PROCESSING )
+
+ UNSET_DEBUG_FLAG( FILTERING )
+ UNSET_DEBUG_FLAG( PRE_FILTERING )
+ UNSET_DEBUG_FLAG( POST_FILTERING )
+
+ UNSET_DEBUG_FLAG( QUEUE )
+ UNSET_DEBUG_FLAG( QUEUING )
+
+
+ // Statement Evaluation
+
+ UNSET_DEBUG_FLAG( PROGRAM )
+
+ UNSET_DEBUG_FLAG( STATEMENT )
+
+ UNSET_DEBUG_FLAG( ASSIGNMENT )
+ UNSET_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ UNSET_DEBUG_FLAG( COMMUNICATION )
+ UNSET_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ UNSET_DEBUG_FLAG( STATEMENT_CONTROL )
+ UNSET_DEBUG_FLAG( STATEMENT_SCHEDULING )
+
+ UNSET_DEBUG_FLAG( TEST_DECISION )
+ UNSET_DEBUG_FLAG( STATEMENT_TEST_DECISION )
+
+ UNSET_DEBUG_FLAG( BYTECODE )
+
+ UNSET_DEBUG_FLAG( DATA )
+
+ UNSET_DEBUG_FLAG( TRACE )
+
+
+ // Element: Property, Signal...
+
+ UNSET_DEBUG_FLAG( VARIABLE )
+
+ UNSET_DEBUG_FLAG( BUFFER )
+
+ UNSET_DEBUG_FLAG( PORT )
+
+ UNSET_DEBUG_FLAG( SIGNAL )
+
+ UNSET_DEBUG_FLAG( CONNEXION )
+
+ UNSET_DEBUG_FLAG( TIME )
+
+
+ // Executable Component...
+
+ UNSET_DEBUG_FLAG( EXECUTABLE )
+
+ UNSET_DEBUG_FLAG( PRIMITIVE )
+
+ UNSET_DEBUG_FLAG( ACTIVITY )
+
+ UNSET_DEBUG_FLAG( ROUTINE )
+
+ UNSET_DEBUG_FLAG( TRANSITION )
+
+ UNSET_DEBUG_FLAG( MACHINE )
+
+ UNSET_DEBUG_FLAG( STATEMACHINE )
+
+
+ // Others: [Qualified]NameID, RefCount, ...
+
+ UNSET_DEBUG_FLAG( NAME_ID )
+
+ UNSET_DEBUG_FLAG( QUALIFIED_NAME_ID )
+
+ UNSET_DEBUG_FLAG( FULLY_QUALIFIED_NAME_ID )
+
+
+ UNSET_DEBUG_FLAG( CAS )
+
+ UNSET_DEBUG_FLAG( REDUNDANCE )
+
+
+ UNSET_DEBUG_FLAG( REFERENCE_COUNTING )
+
+ // God Mode
+ UNSET_DEBUG_FLAG( ALL )
+ UNSET_DEBUG_FLAG( GOD_MODE )
+}
+
+
+std::string avm_strDebugFlag(const std::string & sep)
+{
+ if( _AVM_DEBUG_FLAG_ == AVM_DEBUG_NOTHING_FLAG )
+ {
+ return( "NOTHING" );
+ }
+ if( _AVM_DEBUG_FLAG_ == AVM_DEBUG_GOD_MODE_FLAG )
+ {
+ return( "GOD_MODE" );
+ }
+ if( _AVM_DEBUG_FLAG_ == AVM_DEBUG_ALL_FLAG )
+ {
+ return( "ALL" );
+ }
+ else
+ {
+ std::ostringstream oss;
+ bool needSep = false;
+
+#define STR_DEBUG_FLAG( flag ) \
+ if( AVM_DEBUG_FLAG_ENABLED( flag ) ) \
+ { oss << (needSep ? sep : "") << #flag; needSep = true; }
+
+#define STR_DEBUG_GROUP( flag ) \
+ if( AVM_DEBUG_FLAG_GROUP_ENABLED( flag ) ) \
+ { oss << (needSep ? sep : "") << #flag; needSep = true; }
+
+ // General Context
+
+ STR_DEBUG_FLAG( PARSING )
+
+ STR_DEBUG_FLAG( CONFIGURING )
+
+ STR_DEBUG_FLAG( COMPILING )
+
+ STR_DEBUG_FLAG( LOADING )
+
+ STR_DEBUG_FLAG( COMPUTING )
+
+ STR_DEBUG_FLAG( REPORTING )
+
+ STR_DEBUG_FLAG( SOLVING )
+// STR_DEBUG_FLAG( SAT_SOLVING )
+// STR_DEBUG_FLAG( SMT_SOLVING )
+
+ STR_DEBUG_FLAG( PROFILING )
+
+
+ // Process Stage: Processing, Filtering, ... ...
+
+ STR_DEBUG_FLAG( ALL_PROCESS_STAGE )
+
+ STR_DEBUG_FLAG( QUEUE )
+ STR_DEBUG_FLAG( QUEUING )
+
+
+ // Statement Evaluation
+
+ STR_DEBUG_FLAG( PROGRAM )
+
+ STR_DEBUG_FLAG( STATEMENT )
+
+ STR_DEBUG_FLAG( ASSIGNMENT )
+// STR_DEBUG_FLAG( STATEMENT_ASSIGNMENT )
+
+ STR_DEBUG_FLAG( COMMUNICATION )
+// STR_DEBUG_FLAG( STATEMENT_COMMUNICATION )
+
+ STR_DEBUG_FLAG( STATEMENT_CONTROL )
+ STR_DEBUG_FLAG( STATEMENT_SCHEDULING )
+
+ STR_DEBUG_FLAG( TEST_DECISION )
+// STR_DEBUG_FLAG( STATEMENT_TEST_DECISION )
+
+ STR_DEBUG_FLAG( BYTECODE )
+
+ STR_DEBUG_FLAG( DATA )
+
+ STR_DEBUG_FLAG( TRACE )
+
+
+ // Element: Property, Signal...
+
+ STR_DEBUG_FLAG( VARIABLE )
+
+ STR_DEBUG_FLAG( BUFFER )
+
+ STR_DEBUG_FLAG( PORT )
+
+ STR_DEBUG_FLAG( SIGNAL )
+
+ STR_DEBUG_FLAG( CONNEXION )
+
+ STR_DEBUG_FLAG( TIME )
+
+
+ // Executable Component...
+
+ STR_DEBUG_FLAG( EXECUTABLE )
+
+ STR_DEBUG_FLAG( PRIMITIVE )
+
+ STR_DEBUG_FLAG( ACTIVITY )
+
+ STR_DEBUG_FLAG( ROUTINE )
+
+ STR_DEBUG_FLAG( TRANSITION )
+
+ STR_DEBUG_FLAG( MACHINE )
+
+ STR_DEBUG_FLAG( STATEMACHINE )
+
+
+ // Others: [Qualified]NameID, RefCount, ...
+
+ STR_DEBUG_FLAG( NAME_ID )
+
+ STR_DEBUG_FLAG( QUALIFIED_NAME_ID )
+
+ STR_DEBUG_FLAG( FULLY_QUALIFIED_NAME_ID )
+
+
+ STR_DEBUG_FLAG( CAS )
+
+ STR_DEBUG_FLAG( REDUNDANCE )
+
+
+ STR_DEBUG_FLAG( REFERENCE_COUNTING )
+
+
+ // ... Process Stage: Processing, Filtering, ...
+ else
+ {
+ STR_DEBUG_GROUP( PROCESSING )
+ else
+ {
+ STR_DEBUG_FLAG( PRE_PROCESSING )
+
+ STR_DEBUG_FLAG( POST_PROCESSING )
+ }
+
+ STR_DEBUG_GROUP( FILTERING )
+ else
+ {
+ STR_DEBUG_FLAG( PRE_FILTERING )
+
+ STR_DEBUG_FLAG( POST_FILTERING )
+ }
+ }
+
+ return( oss.str() );
+ }
+}
+
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/util/avm_debug.h b/org.eclipse.efm.symbex/src/util/avm_debug.h
new file mode 100644
index 0000000..5fad5e0
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/util/avm_debug.h
@@ -0,0 +1,863 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 11 févr. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVM_DEBUG_H_
+#define AVM_DEBUG_H_
+
+
+#include <string>
+
+
+namespace sep {
+
+
+#define AVM_COMPILE_DEBUG_ENABLED
+//#undef AVM_COMPILE_DEBUG_ENABLED
+
+
+#if defined( AVM_COMPILE_DEBUG_ENABLED )
+
+
+#define AVM_DEBUG_IF( condition ) if( condition ) {
+
+#define AVM_DEBUG_ELSE } else {
+
+#define AVM_DEBUG_ELSE_IF( condition ) } else if( condition ) {
+
+#define AVM_DEBUG_ENDIF } ;
+// << ; >> prevent << else >> without explicit << if >>
+
+#else
+
+
+#define AVM_DEBUG_IF( condition ) if( false ) {
+//#define AVM_DEBUG_IF( condition ) #if( condition )
+
+#define AVM_DEBUG_ELSE } else {
+//#define AVM_DEBUG_ELSE } else if( false ) {
+//#define AVM_DEBUG_ELSE #else
+
+#define AVM_DEBUG_ELSE_IF( condition ) } else if( false ) {
+//#define AVM_DEBUG_ELSE_IF( condition ) #elif( condition )
+
+#define AVM_DEBUG_ENDIF } ;
+//#define AVM_DEBUG_ENDIF #endif
+
+
+#endif
+
+
+#define AVM_IF( condition ) if( condition ) {
+#define AVM_ELSE_IF( condition ) } else if( condition ) {
+#define AVM_ELSE } else {
+#define AVM_ENDIF } ;
+
+
+/**
+ *******************************************************************************
+ * AVM DEBUG LEVEL
+ *******************************************************************************
+ */
+
+extern unsigned short _AVM_DEBUG_LEVEL_;
+
+enum AVM_DEBUG_LEVEL_T
+{
+ AVM_DEBUG_ZERO_LEVEL = 0x00,
+
+ AVM_DEBUG_LOW_STRICT_LEVEL = 0x01,
+ AVM_DEBUG_LOW_LEVEL = AVM_DEBUG_LOW_STRICT_LEVEL,
+
+ AVM_DEBUG_MEDIUM_STRICT_LEVEL = 0x02,
+ AVM_DEBUG_MEDIUM_LEVEL = AVM_DEBUG_MEDIUM_STRICT_LEVEL
+ | AVM_DEBUG_LOW_LEVEL,
+
+ AVM_DEBUG_HIGH_STRICT_LEVEL = 0x04,
+ AVM_DEBUG_HIGH_LEVEL = AVM_DEBUG_HIGH_STRICT_LEVEL
+ | AVM_DEBUG_MEDIUM_LEVEL,
+
+ AVM_DEBUG_ULTRA_STRICT_LEVEL = 0x08,
+ AVM_DEBUG_ULTRA_LEVEL = AVM_DEBUG_ULTRA_STRICT_LEVEL
+ | AVM_DEBUG_HIGH_LEVEL,
+
+ AVM_DEBUG_GOD_MODE_LEVEL = 0xFF
+};
+
+
+/**
+ * DEBUG LEVEL SET
+ * DEBUG LEVEL TEST
+ */
+#define AVM_DEBUG_SET_STRICT_LEVEL( level ) \
+ { _AVM_DEBUG_LEVEL_ = AVM_DEBUG_##level##_STRICT_LEVEL; }
+
+#define AVM_DEBUG_SET_LEVEL( level ) \
+ { _AVM_DEBUG_LEVEL_ = AVM_DEBUG_##level##_LEVEL; }
+
+#define AVM_DEBUG_UNSET_LEVEL( level ) \
+ { _AVM_DEBUG_LEVEL_ &= (~ AVM_DEBUG_##level##_STRICT_LEVEL); }
+
+#define AVM_DEBUG_IS_LEVEL( level ) \
+ ( _AVM_DEBUG_LEVEL_ == AVM_DEBUG_##level##_LEVEL )
+
+#define AVM_DEBUG_HAS_LEVEL( level ) \
+ ( (_AVM_DEBUG_LEVEL_ & AVM_DEBUG_##level##_LEVEL) != 0 )
+
+
+/**
+ * DEBUG LEVEL <
+ * DEBUG LEVEL <=
+ */
+#define AVM_DEBUG_LEVEL_LT( level ) \
+ ( _AVM_DEBUG_LEVEL_ < AVM_DEBUG_##level##_LEVEL )
+
+#define AVM_DEBUG_LEVEL_LTE( level ) \
+ ( _AVM_DEBUG_LEVEL_ <= AVM_DEBUG_##level##_LEVEL )
+
+
+/**
+ * DEBUG LEVEL >
+ * DEBUG LEVEL >=
+ */
+#define AVM_DEBUG_LEVEL_GT( level ) \
+ ( _AVM_DEBUG_LEVEL_ > AVM_DEBUG_##level##_LEVEL )
+
+#define AVM_DEBUG_LEVEL_GTE( level ) \
+ ( _AVM_DEBUG_LEVEL_ >= AVM_DEBUG_##level##_LEVEL )
+
+
+
+/**
+ * DEBUG ENABLED
+ */
+#define AVM_DEBUG_ENABLED AVM_DEBUG_LEVEL_GT( ZERO )
+
+#define AVM_IF_DEBUG_ENABLED \
+ AVM_DEBUG_IF( AVM_DEBUG_ENABLED )
+
+#define AVM_ELSEIF_DEBUG_ENABLED \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_ENABLED )
+
+#define AVM_ENDIF_DEBUG_ENABLED AVM_DEBUG_ENDIF
+
+/**
+ * DEBUG ENABLED and CONDITION
+ */
+#define AVM_DEBUG_ENABLED_AND( condition ) \
+ ( AVM_DEBUG_ENABLED && (condition) )
+
+#define AVM_IF_DEBUG_ENABLED_AND( condition ) \
+ AVM_DEBUG_IF( AVM_DEBUG_ENABLED_AND( condition ) )
+
+#define AVM_ELSEIF_DEBUG_ENABLED_AND( condition ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_ENABLED_AND( condition ) )
+
+#define AVM_ENDIF_DEBUG_ENABLED_AND AVM_DEBUG_ENDIF
+
+/**
+ * DEBUG ENABLED or CONDITION
+ */
+#define AVM_DEBUG_ENABLED_OR( condition ) \
+ ( AVM_DEBUG_ENABLED || (condition) )
+
+#define AVM_IF_DEBUG_ENABLED_OR( condition ) \
+ AVM_DEBUG_IF( AVM_DEBUG_ENABLED_OR( condition ) )
+
+#define AVM_ELSEIF_DEBUG_ENABLED_OR( condition ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_ENABLED_OR( condition ) )
+
+#define AVM_ENDIF_DEBUG_ENABLED_OR AVM_DEBUG_ENDIF
+
+
+
+/**
+ * DEBUG LEVEL > LOW
+ */
+#define AVM_DEBUG_LEVEL_GT_LOW AVM_DEBUG_LEVEL_GT( LOW )
+
+#define AVM_IF_DEBUG_LEVEL_GT_LOW \
+ AVM_DEBUG_IF( AVM_DEBUG_LEVEL_GT_LOW )
+
+#define AVM_ELSEIF_DEBUG_LEVEL_GT_LOW \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_LEVEL_GT_LOW )
+
+#define AVM_ENDIF_DEBUG_LEVEL_GT_LOW AVM_DEBUG_ENDIF
+
+/**
+ * DEBUG LEVEL >= LOW
+ */
+#define AVM_DEBUG_LEVEL_GTE_LOW AVM_DEBUG_LEVEL_GTE( LOW )
+
+#define AVM_IF_DEBUG_LEVEL_GTE_LOW \
+ AVM_DEBUG_IF( AVM_DEBUG_LEVEL_GTE_LOW )
+
+#define AVM_ELSEIF_DEBUG_LEVEL_GTE_LOW \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_LEVEL_GTE_LOW )
+
+#define AVM_ENDIF_DEBUG_LEVEL_GTE_LOW AVM_DEBUG_ENDIF
+
+
+
+/**
+ * DEBUG LEVEL > MEDIUM
+ */
+#define AVM_DEBUG_LEVEL_GT_MEDIUM AVM_DEBUG_LEVEL_GT( MEDIUM )
+
+#define AVM_IF_DEBUG_LEVEL_GT_MEDIUM \
+ AVM_DEBUG_IF( AVM_DEBUG_LEVEL_GT_MEDIUM )
+
+#define AVM_ELSEIF_DEBUG_LEVEL_GT_MEDIUM \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_LEVEL_GT_MEDIUM )
+
+#define AVM_ENDIF_DEBUG_LEVEL_GT_MEDIUM AVM_DEBUG_ENDIF
+
+/**
+ * DEBUG ( LEVEL > MEDIUM ) or CONDITION
+ */
+#define AVM_DEBUG_LEVEL_GT_MEDIUM_OR( condition ) \
+ ( AVM_DEBUG_LEVEL_GT_MEDIUM || (condition) )
+
+#define AVM_IF_DEBUG_LEVEL_GT_MEDIUM_OR( condition ) \
+ AVM_DEBUG_IF( AVM_DEBUG_LEVEL_GT_MEDIUM_OR( condition ) )
+
+#define AVM_ELSEIF_DEBUG_LEVEL_GT_MEDIUM_OR( condition ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_LEVEL_GT_MEDIUM_OR( condition ) )
+
+#define AVM_ENDIF_DEBUG_LEVEL_GT_MEDIUM_OR AVM_DEBUG_ENDIF
+
+
+/**
+ * DEBUG LEVEL >= MEDIUM
+ */
+#define AVM_DEBUG_LEVEL_GTE_MEDIUM AVM_DEBUG_LEVEL_GTE( MEDIUM )
+
+#define AVM_IF_DEBUG_LEVEL_GTE_MEDIUM \
+ AVM_DEBUG_IF( AVM_DEBUG_LEVEL_GTE_MEDIUM )
+
+#define AVM_ELSEIF_DEBUG_LEVEL_GTE_MEDIUM \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_LEVEL_GTE_MEDIUM )
+
+#define AVM_ENDIF_DEBUG_LEVEL_GTE_MEDIUM AVM_DEBUG_ENDIF
+
+
+/**
+ * DEBUG ( LEVEL > MEDIUM ) or CONDITION
+ */
+#define AVM_DEBUG_LEVEL_GTE_MEDIUM_OR( condition ) \
+ ( AVM_DEBUG_LEVEL_GTE_MEDIUM || (condition) )
+
+#define AVM_IF_DEBUG_LEVEL_GTE_MEDIUM_OR( condition ) \
+ AVM_DEBUG_IF( AVM_DEBUG_LEVEL_GTE_MEDIUM_OR( condition ) )
+
+#define AVM_ELSEIF_DEBUG_LEVEL_GTE_MEDIUM_OR( condition ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_LEVEL_GTE_MEDIUM_OR( condition ) )
+
+#define AVM_ENDIF_DEBUG_LEVEL_GTE_MEDIUM_OR AVM_DEBUG_ENDIF
+
+
+/**
+ * DEBUG LEVEL > HIGH
+ */
+#define AVM_DEBUG_LEVEL_GT_HIGH AVM_DEBUG_LEVEL_GT( HIGH )
+
+#define AVM_IF_DEBUG_LEVEL_GT_HIGH \
+ AVM_DEBUG_IF( AVM_DEBUG_LEVEL_GT_HIGH )
+
+#define AVM_ELSEIF_DEBUG_LEVEL_GT_HIGH \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_LEVEL_GT_HIGH )
+
+#define AVM_ENDIF_DEBUG_LEVEL_GT_HIGH AVM_DEBUG_ENDIF
+
+/**
+ * DEBUG LEVEL >= HIGH
+ */
+#define AVM_DEBUG_LEVEL_GTE_HIGH AVM_DEBUG_LEVEL_GTE( HIGH )
+
+#define AVM_IF_DEBUG_LEVEL_GTE_HIGH \
+ AVM_DEBUG_IF( AVM_DEBUG_LEVEL_GTE_HIGH )
+
+#define AVM_ELSEIF_DEBUG_LEVEL_GTE_HIGH \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_LEVEL_GTE_HIGH )
+
+#define AVM_ENDIF_DEBUG_LEVEL_GTE_HIGH AVM_DEBUG_ENDIF
+
+
+/**
+ * DEBUG LEVEL > ULTRA
+ */
+#define AVM_DEBUG_LEVEL_GT_ULTRA AVM_DEBUG_LEVEL_GT( ULTRA )
+
+#define AVM_IF_DEBUG_LEVEL_GT_ULTRA \
+ AVM_DEBUG_IF( AVM_DEBUG_LEVEL_GT_ULTRA )
+
+#define AVM_ELSEIF_DEBUG_LEVEL_GT_ULTRA \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_LEVEL_GT_ULTRA )
+
+#define AVM_ENDIF_DEBUG_LEVEL_GT_ULTRA AVM_DEBUG_ENDIF
+
+/**
+ * DEBUG LEVEL >= ULTRA
+ */
+#define AVM_DEBUG_LEVEL_GTE_ULTRA AVM_DEBUG_LEVEL_GTE( ULTRA )
+
+#define AVM_IF_DEBUG_LEVEL_GTE_ULTRA \
+ AVM_DEBUG_IF( AVM_DEBUG_LEVEL_GTE_ULTRA )
+
+#define AVM_ELSEIF_DEBUG_LEVEL_GTE_ULTRA \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_LEVEL_GTE_ULTRA )
+
+#define AVM_ENDIF_DEBUG_LEVEL_GTE_ULTRA AVM_DEBUG_ENDIF
+
+
+
+/**
+ * DEBUG LEVEL < ?
+ */
+#define AVM_IF_DEBUG_LEVEL_LT( level ) \
+ AVM_DEBUG_IF( AVM_DEBUG_LEVEL_LT( level ) )
+
+#define AVM_ELSEIF_DEBUG_LEVEL_LT( level ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_LEVEL_LT( level ) )
+
+#define AVM_ENDIF_DEBUG_LEVEL_LT( level ) AVM_DEBUG_ENDIF
+
+
+/**
+ * DEBUG LEVEL > ?
+ */
+#define AVM_IF_DEBUG_LEVEL_GT( level ) \
+ AVM_DEBUG_IF( AVM_DEBUG_LEVEL_GT( level ) )
+
+#define AVM_ELSEIF_DEBUG_LEVEL_GT( level ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_LEVEL_GT( level ) )
+
+#define AVM_ENDIF_DEBUG_LEVEL_GT( level ) AVM_DEBUG_ENDIF
+
+
+
+/**
+ * DEBUG LEVEL <= ?
+ */
+#define AVM_IF_DEBUG_LEVEL_LTE( level ) \
+ AVM_DEBUG_IF( AVM_DEBUG_LEVEL_LTE( level ) )
+
+#define AVM_ELSEIF_DEBUG_LEVEL_LTE( level ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_LEVEL_LTE( level ) )
+
+#define AVM_ENDIF_DEBUG_LEVEL_LTE( level ) AVM_DEBUG_ENDIF
+
+
+/**
+ * DEBUG LEVEL >= ?
+ */
+#define AVM_IF_DEBUG_LEVEL_GTE( level ) \
+ AVM_DEBUG_IF( AVM_DEBUG_LEVEL_GTE( level ) )
+
+#define AVM_ELSEIF_DEBUG_LEVEL_GTE( level ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_LEVEL_GTE( level ) )
+
+#define AVM_ENDIF_DEBUG_LEVEL_GTE( level ) AVM_DEBUG_ENDIF
+
+
+/**
+ * DEBUG TEST LEVEL and CONDITION
+ */
+#define AVM_DEBUG_LEVEL_AND( level , condition ) \
+ ( AVM_DEBUG_LEVEL_GTE( level ) && (condition) )
+
+#define AVM_IF_DEBUG_LEVEL_AND( level , condition ) \
+ AVM_DEBUG_IF( AVM_DEBUG_LEVEL_AND( level , condition ) )
+
+#define AVM_ELSEIF_DEBUG_LEVEL_AND( level , condition ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_LEVEL_AND( level , condition ) )
+
+#define AVM_ENDIF_DEBUG_LEVEL_AND( level ) AVM_DEBUG_ENDIF
+
+
+/**
+ * DEBUG TEST LEVEL or CONDITION
+ */
+#define AVM_DEBUG_LEVEL_OR( level , condition ) \
+ ( AVM_DEBUG_LEVEL_GTE( level ) || (condition) )
+
+#define AVM_IF_DEBUG_LEVEL_OR( level , condition ) \
+ AVM_DEBUG_IF( AVM_DEBUG_LEVEL_OR( level , condition ) )
+
+#define AVM_ELSEIF_DEBUG_LEVEL_OR( level , condition ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_LEVEL_OR( level , condition ) )
+
+#define AVM_ENDIF_DEBUG_LEVEL_OR( level ) AVM_DEBUG_ENDIF
+
+
+
+/**
+ *******************************************************************************
+ * AVM DEBUG FLAG
+ *******************************************************************************
+ */
+
+extern std::size_t _AVM_DEBUG_FLAG_;
+
+
+/**
+ * DEBUG FLAG ENABLE
+ * DEBUG FLAG DISABLE
+ */
+#define AVM_DEBUG_ENABLE_FLAG( flag ) \
+ { _AVM_DEBUG_FLAG_ |= (AVM_DEBUG_##flag##_FLAG); }
+
+#define AVM_DEBUG_DISABLE_FLAG( flag ) \
+ { _AVM_DEBUG_FLAG_ &= (~ (AVM_DEBUG_##flag##_FLAG)); }
+
+
+
+/**
+ * DEBUG FLAG ENABLED
+ * DEBUG FLAG DISABLED
+ */
+#define AVM_DEBUG_FLAG_ENABLED( flag ) \
+ ( (_AVM_DEBUG_FLAG_ & (AVM_DEBUG_##flag##_FLAG)) != 0 )
+
+#define AVM_DEBUG_FLAG_GROUP_ENABLED( flag ) \
+ ( (_AVM_DEBUG_FLAG_ & (AVM_DEBUG_##flag##_FLAG)) == \
+ (AVM_DEBUG_##flag##_FLAG) )
+
+
+#define AVM_DEBUG_FLAG_ENABLED2( kind1 , kind2 ) \
+ ( AVM_DEBUG_FLAG_ENABLED( kind1 ) && AVM_DEBUG_FLAG_ENABLED( kind2 ) )
+
+#define AVM_DEBUG_FLAG_DISABLED( flag ) \
+ ( (_AVM_DEBUG_FLAG_ & (AVM_DEBUG_##flag##_FLAG)) == 0 )
+
+
+
+/**
+ * DEBUG TEST FLAG
+ */
+#define AVM_DEBUG_FLAG( flag ) \
+ ( AVM_DEBUG_ENABLED && AVM_DEBUG_FLAG_ENABLED( flag ) )
+
+#define AVM_IF_DEBUG_FLAG( flag ) \
+ AVM_DEBUG_IF( AVM_DEBUG_FLAG( flag ) )
+
+#define AVM_ELSEIF_DEBUG_FLAG( flag ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_FLAG( flag ) )
+
+#define AVM_ENDIF_DEBUG_FLAG( flag ) AVM_DEBUG_ENDIF
+
+
+
+/**
+ * DEBUG TEST KIND1 and KIN2
+ */
+ #define AVM_DEBUG_FLAG2( kind1 , kind2 ) \
+ ( AVM_DEBUG_ENABLED && AVM_DEBUG_FLAG_ENABLED2( kind1 , kind2 ) )
+
+ #define AVM_IF_DEBUG_FLAG2( kind1 , kind2 ) \
+ AVM_DEBUG_IF( AVM_DEBUG_FLAG2( kind1 , kind2 ) )
+
+ #define AVM_ELSEIF_DEBUG_FLAG2( kind1 , kind2 ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_FLAG2( kind1 , kind2 ) )
+
+ #define AVM_ENDIF_DEBUG_FLAG2( kind1 , kind2 ) AVM_DEBUG_ENDIF
+
+
+ /**
+ * DEBUG TEST KIND1 inhibit KIN2)
+ */
+ #define AVM_DEBUG_FLAG_AND_NOT_FLAG( kind1 , kind2 ) \
+ ( AVM_DEBUG_FLAG( kind1 ) && AVM_DEBUG_NOT_FLAG( kind2 ) )
+
+ #define AVM_IF_DEBUG_FLAG_AND_NOT_FLAG( kind1 , kind2 ) \
+ AVM_DEBUG_IF( AVM_DEBUG_FLAG_AND_NOT_FLAG( kind1 , kind2 ) )
+
+ #define AVM_ELSEIF_DEBUG_FLAG_AND_NOT_FLAG( kind1 , kind2 ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_FLAG_AND_NOT_FLAG( kind1 , kind2 ) )
+
+ #define AVM_ENDIF_DEBUG_FLAG_AND_NOT_FLAG( kind1 , kind2 ) AVM_DEBUG_ENDIF
+
+
+
+/**
+ * DEBUG TEST FLAG and CONDITION
+ */
+#define AVM_DEBUG_FLAG_AND( flag , condition ) \
+ ( AVM_DEBUG_FLAG( flag ) && (condition) )
+
+#define AVM_IF_DEBUG_FLAG_AND( flag , condition ) \
+ AVM_DEBUG_IF( AVM_DEBUG_FLAG_AND( flag , condition ) )
+
+#define AVM_ELSEIF_DEBUG_FLAG_AND( flag , condition ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_FLAG_AND( flag , condition ) )
+
+#define AVM_ENDIF_DEBUG_FLAG_AND( flag ) AVM_DEBUG_ENDIF
+
+
+
+/**
+ * DEBUG TEST KIND1 and KIND2 and CONDITION
+ */
+ #define AVM_DEBUG_FLAG2_AND( kind1 , kind2 , condition ) \
+ ( AVM_DEBUG_FLAG2( kind1 , kind2 ) && (condition) )
+
+ #define AVM_IF_DEBUG_FLAG2_AND( kind1 , kind2 , condition ) \
+ AVM_DEBUG_IF( AVM_DEBUG_FLAG2_AND( kind1 , kind2 , condition ) )
+
+ #define AVM_ELSEIF_DEBUG_FLAG2_AND( kind1 , kind2 , condition ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_FLAG_AND( kind1 , kind2 , condition ) )
+
+ #define AVM_ENDIF_DEBUG_FLAG2_AND( kind1 , kind2 ) AVM_DEBUG_ENDIF
+
+
+
+/**
+ * DEBUG TEST FLAG or CONDITION
+ */
+#define AVM_DEBUG_FLAG_OR( flag , condition ) \
+ ( AVM_DEBUG_FLAG( flag ) || (condition) )
+
+#define AVM_IF_DEBUG_FLAG_OR( flag , condition ) \
+ AVM_DEBUG_IF( AVM_DEBUG_FLAG_OR( flag , condition ) )
+
+#define AVM_ELSEIF_DEBUG_FLAG_OR( flag , condition ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_FLAG_OR( flag , condition ) )
+
+#define AVM_ENDIF_DEBUG_FLAG_OR( flag ) AVM_DEBUG_ENDIF
+
+
+
+
+/**
+ * DEBUG TEST not FLAG
+ */
+#define AVM_DEBUG_NOT_FLAG( flag ) AVM_DEBUG_FLAG_DISABLED( flag )
+
+#define AVM_IF_DEBUG_NOT_FLAG( flag ) \
+ AVM_DEBUG_IF( AVM_DEBUG_NOT_FLAG( flag ) )
+
+#define AVM_ELSEIF_DEBUG_NOT_FLAG( flag ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_NOT_FLAG( flag ) )
+
+#define AVM_ENDIF_DEBUG_NOT_FLAG( flag ) AVM_DEBUG_ENDIF
+
+
+
+/**
+ * DEBUG TEST ( not FLAG ) and CONDITION
+ */
+#define AVM_DEBUG_NOT_FLAG_AND( flag , condition ) \
+ ( AVM_DEBUG_NOT_FLAG( flag ) && (condition) )
+
+#define AVM_IF_DEBUG_NOT_FLAG_AND( flag , condition ) \
+ AVM_DEBUG_IF( AVM_DEBUG_NOT_FLAG_AND( flag , condition ) )
+
+#define AVM_ELSEIF_DEBUG_NOT_FLAG_AND( flag , condition ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_NOT_FLAG_AND( flag , condition ) )
+
+#define AVM_ENDIF_DEBUG_NOT_FLAG_AND( flag ) AVM_DEBUG_ENDIF
+
+
+
+/**
+ * DEBUG TEST LEVEL and FLAG
+ */
+#define AVM_DEBUG_LEVEL_FLAG( level , flag ) \
+ ( AVM_DEBUG_LEVEL_GTE( level ) && AVM_DEBUG_FLAG_ENABLED( flag ) )
+
+#define AVM_IF_DEBUG_LEVEL_FLAG( level , flag ) \
+ AVM_DEBUG_IF( AVM_DEBUG_LEVEL_FLAG( level , flag ) )
+
+#define AVM_ELSEIF_DEBUG_LEVEL_FLAG( level , flag ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_LEVEL_FLAG( level , flag ) )
+
+#define AVM_ENDIF_DEBUG_LEVEL_FLAG( level , flag ) AVM_DEBUG_ENDIF
+
+
+/**
+ * DEBUG TEST not ( LEVEL and FLAG )
+ */
+#define AVM_DEBUG_NOT2_LEVEL_FLAG( level , flag ) \
+ ( AVM_DEBUG_LEVEL_LT( level ) || AVM_DEBUG_FLAG_DISABLED( flag ) )
+
+#define AVM_IF_DEBUG_NOT2_LEVEL_FLAG( level , flag ) \
+ AVM_DEBUG_IF( AVM_DEBUG_NOT2_LEVEL_FLAG( level , flag ) )
+
+#define AVM_ELSEIF_DEBUG_NOT2_LEVEL_FLAG( level , flag ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_NOT2_LEVEL_FLAG( level , flag ) )
+
+#define AVM_ENDIF_DEBUG_NOT2_LEVEL_FLAG( level , flag ) AVM_DEBUG_ENDIF
+
+
+/**
+ * DEBUG TEST LEVEL or FLAG
+ */
+#define AVM_DEBUG_LEVEL_OR_FLAG( level , flag ) \
+ ( AVM_DEBUG_LEVEL_GTE( level ) || \
+ AVM_DEBUG_ENABLED_AND( AVM_DEBUG_FLAG_ENABLED( flag ) ) )
+
+#define AVM_IF_DEBUG_LEVEL_OR_FLAG( level , flag ) \
+ AVM_DEBUG_IF( AVM_DEBUG_LEVEL_OR_FLAG( level , flag ) )
+
+#define AVM_ELSEIF_DEBUG_LEVEL_OR_FLAG( level , flag ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_LEVEL_OR_FLAG( level , flag ) )
+
+#define AVM_ENDIF_DEBUG_LEVEL_OR_FLAG( level , flag ) AVM_DEBUG_ENDIF
+
+
+
+ /**
+ * DEBUG TEST LEVEL or FLAG
+ */
+ #define AVM_DEBUG_LEVEL_OR_FLAG2( level , kind1 , kind2 ) \
+ ( AVM_DEBUG_LEVEL_GTE( level ) || \
+ AVM_DEBUG_ENABLED_AND( AVM_DEBUG_FLAG_ENABLED2( kind1 , kind2 ) ) )
+
+ #define AVM_IF_DEBUG_LEVEL_OR_FLAG2( level , kind1 , kind2 ) \
+ AVM_DEBUG_IF( AVM_DEBUG_LEVEL_OR_FLAG2( level , kind1 , kind2 ) )
+
+ #define AVM_ELSEIF_DEBUG_LEVEL_OR_FLAG2( level , kind1 , kind2 ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_LEVEL_OR_FLAG2( level , kind1 , kind2 ) )
+
+ #define AVM_ENDIF_DEBUG_LEVEL_OR_FLAG2( level , kind1 , kind2 ) AVM_DEBUG_ENDIF
+
+
+
+/**
+ * DEBUG TEST LEVEL and KIND1 and KIND2
+ */
+#define AVM_DEBUG_LEVEL_FLAG2( level , kind1 , kind2 ) \
+ ( AVM_DEBUG_LEVEL_GTE( level ) && AVM_DEBUG_FLAG_ENABLED2( kind1 , kind2 ) )
+
+#define AVM_IF_DEBUG_LEVEL_FLAG2( level , kind1 , kind2 ) \
+ AVM_DEBUG_IF( AVM_DEBUG_LEVEL_FLAG2( level , kind1 , kind2 ) )
+
+#define AVM_ELSEIF_DEBUG_LEVEL_FLAG2( level , kind1 , kind2 ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_LEVEL_FLAG2( level , kind1 , kind2 ) )
+
+#define AVM_ENDIF_DEBUG_LEVEL_FLAG2( level , kind1 , kind2 ) AVM_DEBUG_ENDIF
+
+
+ /**
+ * DEBUG TEST LEVEL and FLAG and CONDITION
+ */
+ #define AVM_DEBUG_LEVEL_FLAG_AND( level , flag , condition ) \
+ ( AVM_DEBUG_LEVEL_FLAG( level , flag ) && (condition) )
+
+ #define AVM_IF_DEBUG_LEVEL_FLAG_AND( level , flag , condition ) \
+ AVM_DEBUG_IF( AVM_DEBUG_LEVEL_FLAG_AND( level , flag , condition ) )
+
+ #define AVM_ELSEIF_DEBUG_LEVEL_FLAG_AND( level , flag , condition ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_LEVEL_FLAG_AND( level , flag , condition ) )
+
+ #define AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( level , flag ) AVM_DEBUG_ENDIF
+
+
+ /**
+ * DEBUG TEST LEVEL and KIND2 and CONDITION
+ */
+ #define AVM_DEBUG_LEVEL_FLAG2_AND( level , flag , kind2 , condition ) \
+ ( AVM_DEBUG_LEVEL_FLAG2( level , flag , kind2 ) && (condition) )
+
+ #define AVM_IF_DEBUG_LEVEL_FLAG2_AND( level , flag , kind2 , condition ) \
+ AVM_DEBUG_IF( AVM_DEBUG_LEVEL_FLAG2_AND( level , flag , kind2 , condition ) )
+
+ #define AVM_ELSEIF_DEBUG_LEVEL_FLAG2_AND( level , flag , kind2 , condition ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_LEVEL_FLAG2_AND( level , flag , kind2 , condition ) )
+
+ #define AVM_ENDIF_DEBUG_LEVEL_FLAG2_AND( level , flag , kind2 ) AVM_DEBUG_ENDIF
+
+
+/**
+ * DEBUG TEST (LEVEL and FLAG) or CONDITION
+ */
+#define AVM_DEBUG_LEVEL_FLAG_OR( level , flag , condition ) \
+ ( AVM_DEBUG_LEVEL_FLAG( level , flag ) || (condition) )
+
+#define AVM_IF_DEBUG_LEVEL_FLAG_OR( level , flag , condition ) \
+ AVM_DEBUG_IF( AVM_DEBUG_LEVEL_FLAG_OR( level , flag , condition ) )
+
+#define AVM_ELSEIF_DEBUG_LEVEL_FLAG_OR( level , flag , condition ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_LEVEL_FLAG_OR( level , flag , condition ) )
+
+#define AVM_ENDIF_DEBUG_LEVEL_FLAG_OR( level , flag ) AVM_DEBUG_ENDIF
+
+
+
+ /**
+ * DEBUG TEST ( LEVEL or FLAG ) and CONDITION
+ */
+ #define AVM_DEBUG_LEVEL_OR_FLAG_AND( level , flag , condition ) \
+ ( ( AVM_DEBUG_LEVEL_GTE( level ) || \
+ AVM_DEBUG_ENABLED_AND( AVM_DEBUG_FLAG_ENABLED( flag ) ) ) && \
+ (condition) )
+
+ #define AVM_IF_DEBUG_LEVEL_OR_FLAG_AND( level , flag , condition ) \
+ AVM_DEBUG_IF( AVM_DEBUG_LEVEL_OR_FLAG_AND( level , flag , condition ) )
+
+ #define AVM_ELSEIF_DEBUG_LEVEL_OR_FLAG_AND( level , flag , condition ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_LEVEL_OR_FLAG_AND( level , flag , condition ) )
+
+ #define AVM_ENDIF_DEBUG_LEVEL_OR_FLAG_AND( level , flag ) AVM_DEBUG_ENDIF
+
+
+ /**
+ * DEBUG TEST ( LEVEL or FLAG ) or CONDITION
+ */
+ #define AVM_DEBUG_LEVEL_OR_FLAG_OR( level , flag , condition ) \
+ ( AVM_DEBUG_LEVEL_GTE( level ) || \
+ AVM_DEBUG_ENABLED_AND( AVM_DEBUG_FLAG_ENABLED( flag ) ) || (condition) )
+
+ #define AVM_IF_DEBUG_LEVEL_OR_FLAG_OR( level , flag , condition ) \
+ AVM_DEBUG_IF( AVM_DEBUG_LEVEL_OR_FLAG_OR( level , flag , condition ) )
+
+ #define AVM_ELSEIF_DEBUG_LEVEL_OR_FLAG_OR( level , flag , condition ) \
+ AVM_DEBUG_ELSE_IF( AVM_DEBUG_LEVEL_OR_FLAG_OR( level , flag , condition ) )
+
+ #define AVM_ENDIF_DEBUG_LEVEL_OR_FLAG_OR( level , flag ) AVM_DEBUG_ENDIF
+
+
+
+/**
+ * DEBUG FLAG ENUMERATION
+ * on 64 bits max
+ */
+
+enum AVM_DEBUG_FLAG_T
+{
+ AVM_DEBUG_NOTHING_FLAG = 0x0000000000000000,
+
+ // General Context
+ AVM_DEBUG_CONFIGURING_FLAG = 0x0000000000000001,
+ AVM_DEBUG_PARSING_FLAG = 0x0000000000000002,
+ AVM_DEBUG_COMPILING_FLAG = 0x0000000000000004,
+ AVM_DEBUG_LOADING_FLAG = 0x0000000000000008,
+
+ AVM_DEBUG_COMPUTING_FLAG = 0x0000000000000010,
+ AVM_DEBUG_REPORTING_FLAG = 0x0000000000000020,
+
+ AVM_DEBUG_SOLVING_FLAG = 0x0000000000000040,
+ AVM_DEBUG_SAT_SOLVING_FLAG = AVM_DEBUG_SOLVING_FLAG,
+ AVM_DEBUG_SMT_SOLVING_FLAG = AVM_DEBUG_SOLVING_FLAG,
+
+ AVM_DEBUG_PROFILING_FLAG = 0x0000000000000080,
+
+ // Process Stage: Processing, Filtering, ...
+ AVM_DEBUG_PRE_PROCESSING_FLAG = 0x0000000000000100,
+ AVM_DEBUG_POST_PROCESSING_FLAG = 0x0000000000000200,
+
+ AVM_DEBUG_PROCESSING_FLAG = AVM_DEBUG_PRE_PROCESSING_FLAG
+ | AVM_DEBUG_POST_PROCESSING_FLAG,
+
+ AVM_DEBUG_PRE_FILTERING_FLAG = 0x0000000000000400,
+ AVM_DEBUG_POST_FILTERING_FLAG = 0x0000000000000800,
+
+ AVM_DEBUG_FILTERING_FLAG = AVM_DEBUG_PRE_FILTERING_FLAG
+ | AVM_DEBUG_POST_FILTERING_FLAG,
+
+ AVM_DEBUG_QUEUE_FLAG = 0x0000000000001000,
+ AVM_DEBUG_QUEUING_FLAG = AVM_DEBUG_QUEUE_FLAG,
+
+ AVM_DEBUG_ALL_PROCESS_STAGE_FLAG = AVM_DEBUG_PROCESSING_FLAG
+ | AVM_DEBUG_FILTERING_FLAG,
+
+ AVM_DEBUG_PROCESSOR_FLAG = AVM_DEBUG_ALL_PROCESS_STAGE_FLAG,
+
+ // Statement Evaluation
+ AVM_DEBUG_PROGRAM_FLAG = 0x0000000000002000,
+ AVM_DEBUG_STATEMENT_FLAG = 0x0000000000010000,
+
+ AVM_DEBUG_ASSIGNMENT_FLAG = 0x0000000000020000,
+ AVM_DEBUG_STATEMENT_ASSIGNMENT_FLAG = AVM_DEBUG_ASSIGNMENT_FLAG,
+
+ AVM_DEBUG_COMMUNICATION_FLAG = 0x0000000000040000,
+ AVM_DEBUG_STATEMENT_COMMUNICATION_FLAG = AVM_DEBUG_COMMUNICATION_FLAG,
+
+ AVM_DEBUG_STATEMENT_CONTROL_FLAG = 0x0000000000080000,
+ AVM_DEBUG_STATEMENT_SCHEDULING_FLAG = 0x0000000000100000,
+
+ AVM_DEBUG_TEST_DECISION_FLAG = 0x0000000000200000,
+ AVM_DEBUG_STATEMENT_TEST_DECISION_FLAG = AVM_DEBUG_TEST_DECISION_FLAG,
+
+ AVM_DEBUG_BYTECODE_FLAG = 0x0000000000800000,
+
+ AVM_DEBUG_DATA_FLAG = 0x0000000001000000,
+
+ AVM_DEBUG_TRACE_FLAG = 0x0000000002000000,
+
+ // Element: Property, Signal...
+ AVM_DEBUG_VARIABLE_FLAG = 0x0000000010000000,
+ AVM_DEBUG_BUFFER_FLAG = 0x0000000020000000,
+ AVM_DEBUG_PORT_FLAG = 0x0000000040000000,
+ AVM_DEBUG_SIGNAL_FLAG = 0x0000000080000000,
+ AVM_DEBUG_CONNEXION_FLAG = 0x0000000100000000,
+
+ AVM_DEBUG_TIME_FLAG = 0x0000000200000000,
+
+ // Executable Component...
+ AVM_DEBUG_EXECUTABLE_FLAG = 0x0000001000000000,
+ AVM_DEBUG_PRIMITIVE_FLAG = 0x0000002000000000,
+ AVM_DEBUG_ACTIVITY_FLAG = 0x0000004000000000,
+ AVM_DEBUG_ROUTINE_FLAG = 0x0000008000000000,
+ AVM_DEBUG_TRANSITION_FLAG = 0x0000010000000000,
+ AVM_DEBUG_MACHINE_FLAG = 0x0000020000000000,
+ AVM_DEBUG_STATEMACHINE_FLAG = 0x0000040000000000,
+
+ // Others: [Qualified]NameID, RefCount, ...
+ AVM_DEBUG_NAME_ID_FLAG = 0x0000100000000000,
+ AVM_DEBUG_QUALIFIED_NAME_ID_FLAG = 0x0000200000000000,
+ AVM_DEBUG_FULLY_QUALIFIED_NAME_ID_FLAG = 0x0000400000000000,
+
+ AVM_DEBUG_CAS_FLAG = 0x0001000000000000,
+ AVM_DEBUG_REDUNDANCE_FLAG = 0x0002000000000000,
+
+ AVM_DEBUG_REFERENCE_COUNTING_FLAG = 0x0010000000000000,
+
+ // God Mode
+ AVM_DEBUG_ALL_FLAG = 0xFFFFFFFFFFFFFFFF,
+ AVM_DEBUG_GOD_MODE_FLAG = 0xFFFFFFFFFFFFFFFF
+
+};
+
+
+/**
+ *******************************************************************************
+ * AVM DEBUG CONFIGURE
+ *******************************************************************************
+ */
+
+void avm_setDebugLevel(std::string strDebugLevel);
+
+void avm_unsetDebugLevel(std::string strDebugLevel);
+
+std::string avm_strDebugLevel();
+
+
+inline bool avm_hasDebugFlag()
+{
+ return( _AVM_DEBUG_FLAG_ != AVM_DEBUG_NOTHING_FLAG );
+}
+
+void avm_setDebugFlag(std::string strDebugFlag);
+
+void avm_unsetDebugFlag(std::string strDebugFlag);
+
+std::string avm_strDebugFlag(const std::string & sep = " ");
+
+
+
+}
+
+
+#endif /* AVM_DEBUG_H_ */
diff --git a/org.eclipse.efm.symbex/src/util/avm_injector.cpp b/org.eclipse.efm.symbex/src/util/avm_injector.cpp
new file mode 100644
index 0000000..dd5b49a
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/util/avm_injector.cpp
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 16 juil. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "avm_injector.h"
+
+
+namespace sep
+{
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/util/avm_injector.h b/org.eclipse.efm.symbex/src/util/avm_injector.h
new file mode 100644
index 0000000..7140df5
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/util/avm_injector.h
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 16 juil. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVM_INJECTOR_H_
+#define AVM_INJECTOR_H_
+
+#include <base/InstanceCounter.h>
+
+
+namespace sep
+{
+
+/**
+ * Macro for instance counter management
+ */
+#define AVM_INJECT_INSTANCE_COUNTER_CLASS( ClassName ) \
+ public InstanceCounter< ClassName >
+
+
+/**
+ * Macro for clonable object
+ */
+template< class T >
+struct AvmClonableClass
+{
+ // DESTRUCTOR
+ virtual ~AvmClonableClass()
+ {
+ //!! NOTHING
+ }
+
+ // CLONE API
+ inline virtual T * clone() const
+ {
+ return( new T(*this) );
+ }
+
+};
+
+#define AVM_INJECT_CLONABLE_CLASS( ClassName ) \
+ public AvmClonableClass< ClassName >
+
+
+/**
+ * Macro for unclonable object
+ */
+template< class T >
+struct AvmUnclonableClass
+{
+ // DESTRUCTOR
+ virtual ~AvmUnclonableClass()
+ {
+ //!! NOTHING
+ }
+
+ // CLONE API
+ inline virtual T * clone() const
+ {
+ return( const_cast< T * >(this) );
+ }
+
+};
+
+#define AVM_INJECT_UNCLONABLE_CLASS( ClassName ) \
+ public AvmUnclonableClass< ClassName >
+
+
+
+/**
+ * Generics Macros
+ */
+#define AVM_INJECT_CLONABLE_INSTANCE_COUNTER( ClassName ) \
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ClassName ) , \
+ AVM_INJECT_CLONABLE_CLASS( ClassName )
+
+
+#define AVM_INJECT_UNCLONABLE_INSTANCE_COUNTER( ClassName ) \
+ AVM_INJECT_INSTANCE_COUNTER_CLASS( ClassName ) , \
+ AVM_INJECT_UNCLONABLE_CLASS( ClassName )
+
+
+
+}
+
+#endif /* AVM_INJECTOR_H_ */
diff --git a/org.eclipse.efm.symbex/src/util/avm_numeric.cpp b/org.eclipse.efm.symbex/src/util/avm_numeric.cpp
new file mode 100644
index 0000000..a17c5a4
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/util/avm_numeric.cpp
@@ -0,0 +1,221 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 16 mars 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "avm_numeric.h"
+
+#include <time.h>
+
+#include <boost/random.hpp>
+
+namespace sep
+{
+
+
+avm_uinteger_t RANDOM::gen_uinteger(avm_uinteger_t min, avm_uinteger_t max)
+{
+ if( min < max )
+ {
+ // Initialize a random number generator.
+ // Boost provides a bunch of these, note that some of them are not meant
+ // for direct user usage and you should instead use a specialization
+ // (for example, don't use linear_congruential and use minstd_rand or
+ // minstd_rand0 instead)
+
+ // This constructor seeds the generator with the current time.
+ // As mentioned in Boost's sample program, time(0) is not a great seed,
+ // but you can probably get away with it for most situations.
+ // Consider using more precise timers such as gettimeofday on *nix or
+ // GetTickCount/timeGetTime/QueryPerformanceCounter on Windows.
+ boost::mt19937 randGen(static_cast< avm_uint64_t >(clock()));
+
+ // Now we set up a distribution. Boost provides a bunch of these as well.
+ // This is the preferred way to generate numbers in a certain range.
+ boost::uniform_int<avm_uinteger_t> uIntDist(min, max);
+
+ // Finally, declare a variate_generator which maps the random number
+ // generator and the distribution together. This variate_generator
+ // is usable like a function call.
+ boost::variate_generator< boost::mt19937 & ,
+ boost::uniform_int<avm_uinteger_t> > GetRand(randGen, uIntDist);
+
+ // Generate a random number
+ return( GetRand() );
+ }
+ else// if( min == max )
+ {
+ return( min );
+ }
+}
+
+
+avm_integer_t RANDOM::gen_integer(avm_integer_t min, avm_integer_t max)
+{
+ if( min < max )
+ {
+ // Initialize a random number generator.
+ // Boost provides a bunch of these, note that some of them are not meant
+ // for direct user usage and you should instead use a specialization
+ // (for example, don't use linear_congruential and use minstd_rand or
+ // minstd_rand0 instead)
+
+ // This constructor seeds the generator with the current time.
+ // As mentioned in Boost's sample program, time(0) is not a great seed,
+ // but you can probably get away with it for most situations.
+ // Consider using more precise timers such as gettimeofday on *nix or
+ // GetTickCount/timeGetTime/QueryPerformanceCounter on Windows.
+ boost::mt19937 randGen(static_cast< avm_uint64_t >(clock()));
+
+ // Now we set up a distribution. Boost provides a bunch of these as well.
+ // This is the preferred way to generate numbers in a certain range.
+ boost::uniform_int<avm_integer_t> uIntDist(min, max);
+
+ // Finally, declare a variate_generator which maps the random number
+ // generator and the distribution together. This variate_generator
+ // is usable like a function call.
+ boost::variate_generator< boost::mt19937 & ,
+ boost::uniform_int<avm_integer_t> > GetRand(randGen, uIntDist);
+
+ // Generate a random number
+ return( GetRand() );
+ }
+ else// if( min == max )
+ {
+ return( min );
+ }
+}
+
+
+
+avm_uint32_t RANDOM::gen_uint(avm_uint32_t min, avm_uint32_t max)
+{
+ if( min < max )
+ {
+ // Initialize a random number generator.
+ // Boost provides a bunch of these, note that some of them are not meant
+ // for direct user usage and you should instead use a specialization
+ // (for example, don't use linear_congruential and use minstd_rand or
+ // minstd_rand0 instead)
+
+ // This constructor seeds the generator with the current time.
+ // As mentioned in Boost's sample program, time(0) is not a great seed,
+ // but you can probably get away with it for most situations.
+ // Consider using more precise timers such as gettimeofday on *nix or
+ // GetTickCount/timeGetTime/QueryPerformanceCounter on Windows.
+ boost::mt19937 randGen(static_cast< avm_uint64_t >(clock()));
+
+ // Now we set up a distribution. Boost provides a bunch of these as well.
+ // This is the preferred way to generate numbers in a certain range.
+ boost::uniform_int<avm_uint32_t> uIntDist(min, max);
+
+ // Finally, declare a variate_generator which maps the random number
+ // generator and the distribution together. This variate_generator
+ // is usable like a function call.
+ boost::variate_generator< boost::mt19937 & ,
+ boost::uniform_int<avm_uint32_t> > GetRand(randGen, uIntDist);
+
+ // Generate a random number
+ return( GetRand() );
+ }
+ else// if( min == max )
+ {
+ return( min );
+ }
+}
+
+
+avm_int32_t RANDOM::gen_int(avm_int32_t min, avm_int32_t max)
+{
+ if( min < max )
+ {
+ // Initialize a random number generator.
+ // Boost provides a bunch of these, note that some of them are not meant
+ // for direct user usage and you should instead use a specialization
+ // (for example, don't use linear_congruential and use minstd_rand or
+ // minstd_rand0 instead)
+
+ // This constructor seeds the generator with the current time.
+ // As mentioned in Boost's sample program, time(0) is not a great seed,
+ // but you can probably get away with it for most situations.
+ // Consider using more precise timers such as gettimeofday on *nix or
+ // GetTickCount/timeGetTime/QueryPerformanceCounter on Windows.
+ boost::mt19937 randGen(static_cast< avm_uint64_t >(clock()));
+
+ // Now we set up a distribution. Boost provides a bunch of these as well.
+ // This is the preferred way to generate numbers in a certain range.
+ boost::uniform_int<avm_int32_t> uIntDist(min, max);
+
+ // Finally, declare a variate_generator which maps the random number
+ // generator and the distribution together. This variate_generator
+ // is usable like a function call.
+ boost::variate_generator< boost::mt19937 & ,
+ boost::uniform_int<avm_int32_t> > GetRand(randGen, uIntDist);
+
+ // Generate a random number
+ return( GetRand() );
+ }
+ else// if( min == max )
+ {
+ return( min );
+ }
+}
+
+
+
+double RANDOM::gen_double(double min, double max, avm_uint64_t previous)
+{
+ if( min < max )
+ {
+ // Initialize a random number generator.
+ // Boost provides a bunch of these, note that some of them are not meant
+ // for direct user usage and you should instead use a specialization
+ // (for example, don't use linear_congruential and use minstd_rand or
+ // minstd_rand0 instead)
+
+ // This constructor seeds the generator with the current time.
+ // As mentioned in Boost's sample program, time(0) is not a great seed,
+ // but you can probably get away with it for most situations.
+ // Consider using more precise timers such as gettimeofday on *nix or
+ // GetTickCount/timeGetTime/QueryPerformanceCounter on Windows.
+
+// boost::mt19937 randGen(std::time(0));
+// AVM_FLOAT_TIME_TYPE tps0 = ExecutionTime::getClock();
+// AVM_OS_TRACE << OS_FLOAT_PRECISION << "Valeur tps0 = " << tps0
+// << " clock = " << static_cast<long unsigned int>(clock())
+// << std::endl;
+// unsigned int tps = (unsigned int)tps0;
+// AVM_OS_TRACE << "Valeur tps = " << tps << std::endl;
+ boost::mt19937 randGen(static_cast< avm_uint64_t >(clock()) + previous);
+
+ // Now we set up a distribution. Boost provides a bunch of these as well.
+ // This is the preferred way to generate numbers in a certain range.
+ boost::uniform_real<double> uRealDist(min, max);
+
+ // Finally, declare a variate_generator which maps the random number
+ // generator and the distribution together. This variate_generator
+ // is usable like a function call.
+ boost::variate_generator< boost::mt19937 & ,
+ boost::uniform_real<double> > GetRand(randGen, uRealDist);
+
+ // Generate a random number
+ return( GetRand() );
+ }
+ else// if( min == max )
+ {
+ return( min );
+ }
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/util/avm_numeric.h b/org.eclipse.efm.symbex/src/util/avm_numeric.h
new file mode 100644
index 0000000..d98a001
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/util/avm_numeric.h
@@ -0,0 +1,258 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 16 mars 2010
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVM_NUMERIC_H_
+#define AVM_NUMERIC_H_
+
+#include <cstddef>
+
+#include <limits>
+
+//#include <cinttypes>
+#define __STDC_FORMAT_MACROS
+//#include <inttypes.h>
+#undef __STDC_FORMAT_MACROS
+
+#include <stdint.h>
+//?#include <cstdint>
+
+
+
+#ifdef __AVM_MINGW__ /* NEED INT64_T OVERLOADS */
+
+#define _AVM_NEED_INT64_T_OVERLOADS_
+
+#else //#ifdef __AVM_LINUX__
+
+#undef _AVM_NEED_INT64_T_OVERLOADS_
+
+#endif
+
+
+namespace sep
+{
+
+
+/* Integers of type char have 8 bits. */
+#define avm_char_bitsize 8
+
+/* Integers of type short have 16 bits. */
+#define avm_short_bitsize 16
+
+/* Integers of type int have 32 bits. */
+#define avm_int_bitsize 32
+
+/* Integers of type long have 32 or 64 bits. */
+//#define avm_long_bitsize 32
+
+/* Integers of type long long have 64 bits. */
+#define avm_long_long_bitsize 64
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// AVM NUMERIC TYPE
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+typedef int8_t avm_int8_t;
+typedef uint8_t avm_uint8_t;
+
+typedef int16_t avm_int16_t;
+typedef uint16_t avm_uint16_t;
+
+typedef int32_t avm_int32_t;
+typedef uint32_t avm_uint32_t;
+
+typedef uint32_t avm_offset_t;
+
+typedef int64_t avm_int64_t;
+typedef uint64_t avm_uint64_t;
+
+typedef int64_t avm_integer_t;
+typedef uint64_t avm_uinteger_t;
+
+typedef double avm_float_t;
+
+typedef long double avm_real_t;
+
+
+typedef int64_t avm_itime_t;
+typedef uint64_t avm_uitime_t;
+
+typedef long double avm_ftime_t;
+
+
+/**
+ * The Address Type
+ */
+typedef intptr_t avm_address_t;
+
+
+/**
+ * The Size Type
+ */
+typedef std::size_t avm_size_t;
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// AVM NUMERIC LIMITS
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+#define AVM_NUMERIC_MAX_INT ( std::numeric_limits<int>::max() )
+#define AVM_NUMERIC_MIN_INT ( std::numeric_limits<int>::min() )
+
+#define AVM_NUMERIC_MAX_UINT ( std::numeric_limits<unsigned int>::max() )
+#define AVM_NUMERIC_MIN_UINT ( std::numeric_limits<unsigned int>::min() )
+
+
+#define AVM_NUMERIC_MAX_OFFSET ( std::numeric_limits<sep::avm_uinteger_t>::max() )
+#define AVM_NUMERIC_MIN_OFFSET ( std::numeric_limits<sep::avm_uinteger_t>::min() )
+
+
+#define AVM_NO_OFFSET ( static_cast<sep::avm_offset_t>(-1) )
+
+
+#define AVM_NUMERIC_MAX_LONG ( std::numeric_limits<long>::max() )
+#define AVM_NUMERIC_MIN_LONG ( std::numeric_limits<long>::min() )
+
+#define AVM_NUMERIC_MAX_ULONG ( std::numeric_limits<unsigned long>::max() )
+#define AVM_NUMERIC_MIN_ULONG ( std::numeric_limits<unsigned long>::min() )
+
+
+#define AVM_NUMERIC_MAX_INT8 ( std::numeric_limits<sep::avm_int8_t>::max() )
+#define AVM_NUMERIC_MIN_INT8 ( std::numeric_limits<sep::avm_int8_t>::min() )
+
+#define AVM_NUMERIC_MAX_INT16 ( std::numeric_limits<sep::avm_int16_t>::max() )
+#define AVM_NUMERIC_MIN_INT16 ( std::numeric_limits<sep::avm_int16_t>::min() )
+
+#define AVM_NUMERIC_MAX_INT32 ( std::numeric_limits<sep::avm_int32_t>::max() )
+#define AVM_NUMERIC_MIN_INT32 ( std::numeric_limits<sep::avm_int32_t>::min() )
+
+#define AVM_NUMERIC_MAX_INT64 ( std::numeric_limits<sep::avm_int64_t>::max() )
+#define AVM_NUMERIC_MIN_INT64 ( std::numeric_limits<sep::avm_int64_t>::min() )
+
+
+#define AVM_NUMERIC_MAX_UINT8 ( std::numeric_limits<sep::avm_uint8_t>::max() )
+#define AVM_NUMERIC_MIN_UINT8 ( std::numeric_limits<sep::avm_uint8_t>::min() )
+
+#define AVM_NUMERIC_MAX_UINT16 ( std::numeric_limits<sep::avm_uint16_t>::max() )
+#define AVM_NUMERIC_MIN_UINT16 ( std::numeric_limits<sep::avm_uint16_t>::min() )
+
+#define AVM_NUMERIC_MAX_UINT32 ( std::numeric_limits<sep::avm_uint32_t>::max() )
+#define AVM_NUMERIC_MIN_UINT32 ( std::numeric_limits<sep::avm_uint32_t>::min() )
+
+#define AVM_NUMERIC_MAX_UINT64 ( std::numeric_limits<sep::avm_uint64_t>::max() )
+#define AVM_NUMERIC_MIN_UINT64 ( std::numeric_limits<sep::avm_uint64_t>::min() )
+
+
+#define AVM_NUMERIC_MAX_SIZE_T ( std::numeric_limits<sep::avm_size_t>::max() )
+#define AVM_NUMERIC_MIN_SIZE_T ( std::numeric_limits<sep::avm_size_t>::min() )
+
+
+#define AVM_NUMERIC_MAX_INTEGER ( std::numeric_limits<sep::avm_integer_t>::max() )
+#define AVM_NUMERIC_MIN_INTEGER ( std::numeric_limits<sep::avm_integer_t>::min() )
+
+#define AVM_NUMERIC_MAX_UINTEGER ( std::numeric_limits<sep::avm_uinteger_t>::max() )
+#define AVM_NUMERIC_MIN_UINTEGER ( std::numeric_limits<sep::avm_uinteger_t>::min() )
+
+
+#define AVM_NUMERIC_MAX_FLOAT ( std::numeric_limits<float>::max() )
+#define AVM_NUMERIC_MIN_FLOAT ( std::numeric_limits<float>::min() )
+
+#define AVM_NUMERIC_MAX_UFLOAT ( std::numeric_limits<unsigned float>::max() )
+#define AVM_NUMERIC_MIN_UFLOAT ( std::numeric_limits<unsigned float>::min() )
+
+
+#define AVM_NUMERIC_MAX_DOUBLE ( std::numeric_limits<double>::max() )
+#define AVM_NUMERIC_MIN_DOUBLE ( std::numeric_limits<double>::min() )
+
+#define AVM_NUMERIC_MAX_UDOUBLE ( std::numeric_limits<unsigned double>::max() )
+#define AVM_NUMERIC_MIN_UDOUBLE ( std::numeric_limits<unsigned double>::min() )
+
+
+#define AVM_NUMERIC_MAX_FLOAT_T ( std::numeric_limits<sep::avm_float_t>::max() )
+#define AVM_NUMERIC_MIN_FLOAT_T ( std::numeric_limits<sep::avm_float_t>::min() )
+
+#define AVM_NUMERIC_MAX_REAL_T ( std::numeric_limits<sep::avm_real_t>::max() )
+#define AVM_NUMERIC_MIN_REAL_T ( std::numeric_limits<sep::avm_real_t>::min() )
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// AVM NUMERIC PRECISION
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+#define OS_FLOAT_PRECISION \
+ std::setprecision( std::numeric_limits< double >::digits10 + 1 )
+
+#define OS_REAL_PRECISION \
+ std::setprecision( std::numeric_limits< long double >::digits10 + 1 )
+
+
+#define AVM_MUMERIC_PRECISION 17
+
+
+struct RANDOM
+{
+
+ ////////////////////////////////////////////////////////////////////////////
+ // NUMERIC RANDOM GENERATOR
+ ////////////////////////////////////////////////////////////////////////////
+
+
+ inline static char gen_char()
+ {
+ return( static_cast< char >( gen_int(
+ std::numeric_limits<sep::avm_uint8_t>::min(),
+ std::numeric_limits<sep::avm_uint8_t>::max()) ) );
+ }
+
+
+ static avm_uinteger_t gen_uinteger(avm_uinteger_t min, avm_uinteger_t max);
+ static avm_integer_t gen_integer(avm_integer_t min, avm_integer_t max);
+
+ inline static avm_integer_t gen_integer()
+ {
+ return( gen_integer(AVM_NUMERIC_MIN_INTEGER, AVM_NUMERIC_MAX_INTEGER) ) ;
+ }
+
+ static avm_uint32_t gen_uint(avm_uint32_t min, avm_uint32_t max);
+ static avm_int32_t gen_int(avm_int32_t min, avm_int32_t max);
+
+ inline static avm_int32_t gen_int()
+ {
+ return( gen_int(AVM_NUMERIC_MIN_INT32, AVM_NUMERIC_MAX_INT32) ) ;
+ }
+
+ static double gen_double(double min, double max, avm_uint64_t previous);
+
+ inline static double gen_double(long unsigned int previous)
+ {
+ return( gen_double(previous) ) ;
+ }
+
+};
+
+
+}
+
+#endif /* AVM_NUMERIC_H_ */
diff --git a/org.eclipse.efm.symbex/src/util/avm_string.cpp b/org.eclipse.efm.symbex/src/util/avm_string.cpp
new file mode 100644
index 0000000..afad0f9
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/util/avm_string.cpp
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 4 avr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "avm_string.h"
+
+#include <boost/algorithm/string.hpp>
+#include <boost/regex.hpp>
+
+
+namespace sep {
+
+
+////////////////////////////////////////////////////////////////////////////
+// REGEX MATCH TEXT
+////////////////////////////////////////////////////////////////////////////
+
+bool StringTools::regex_match(
+ const std::string & text, const std::string & regex)
+{
+ return( boost::regex_match(text, boost::regex(regex)) );
+}
+
+bool StringTools::regex_find(
+ const std::string & text, const std::string & regex)
+{
+ return( boost::regex_match(text, boost::regex(".*" + regex + ".*")) );
+}
+
+bool StringTools::regex_startsWith(
+ const std::string & text, const std::string & regex)
+{
+ return( boost::regex_match(text, boost::regex(regex + ".*")) );
+}
+
+bool StringTools::regex_endsWith(
+ const std::string & text, const std::string & regex)
+{
+ return( boost::regex_match(text, boost::regex(".*" + regex)) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// REPLACE TEXT
+////////////////////////////////////////////////////////////////////////////////
+
+void StringTools::replace(std::string & mainStr,
+ const std::string & patternA, const std::string & patternB)
+{
+ boost::replace_first(mainStr, patternA, patternB);
+}
+
+void StringTools::replaceAll(std::string & mainStr,
+ const std::string & patternA, const std::string & patternB)
+{
+ boost::replace_all(mainStr, patternA, patternB);
+}
+
+std::string regex_replace(const std::string & mainStr,
+ const std::string & regex_pattern, const std::string & pattern)
+{
+ boost::regex re( regex_pattern );
+
+ return( boost::regex_replace(mainStr, boost::regex(regex_pattern), pattern) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// ERASE TEXT
+////////////////////////////////////////////////////////////////////////////////
+
+void StringTools::erase(std::string & mainStr, const std::string & pattern)
+{
+ boost::erase_first(mainStr, pattern);
+}
+
+void StringTools::eraseAll(std::string & mainStr, const std::string & pattern)
+{
+ boost::erase_all(mainStr, pattern);
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/util/avm_string.h b/org.eclipse.efm.symbex/src/util/avm_string.h
new file mode 100644
index 0000000..13bc63b
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/util/avm_string.h
@@ -0,0 +1,359 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 4 avr. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVM_STRING_H_
+#define AVM_STRING_H_
+
+#include <algorithm>
+#include <sstream>
+#include <string>
+
+//#include <boost/algorithm/string.hpp>
+//#include <boost/tokenizer.hpp>
+
+
+namespace sep
+{
+
+#define SPACE_CHARS " \t\f\v\n\r"
+
+
+#define QUOTEME( X ) #X
+
+
+#define STRIML(s) s.substr(s.find_first_not_of(SPACE_CHARS))
+
+#define STRIMR(s) s.substr(0, s.find_last_not_of(SPACE_CHARS))
+
+#define STRIM(s) s.substr(s.find_first_not_of(SPACE_CHARS), \
+ s.find_last_not_of(SPACE_CHARS))
+
+
+// Conversion
+template< typename T >
+T string_to(const std::string & strInput,
+ std::ios_base & (*f)(std::ios_base &) = std::dec)
+{
+ std::istringstream iss(strInput);
+ T t;
+
+ if( ( iss >> f >> t ).fail() )
+ {
+// AVM_OS_FATAL_ERROR_EXIT
+// << "fail:> sep::string_to< T >( " << aValue << " ) !!!"
+// << SEND_EXIT;
+ }
+
+ return( t );
+}
+
+template< typename T >
+bool from_string(const std::string & strInput, T & t,
+ std::ios_base & (*f)(std::ios_base &) = std::dec)
+{
+ std::istringstream iss(strInput);
+
+ return( not ( iss >> f >> t ).fail() );
+}
+
+template< typename T , typename U >
+bool from_string(const std::string & strInput, T & t, char separator,
+ U & u, std::ios_base & (*f)(std::ios_base &) = std::dec)
+{
+ std::istringstream iss(strInput);
+
+ char c;
+
+ return( (not ( iss >> f >> t >> c >> f >> u ).fail()) &&
+ (c == separator) );
+}
+
+
+template< typename T >
+std::string to_string( const T & a )
+{
+ std::ostringstream oss;
+ oss << a;
+ return oss.str();
+}
+
+
+/**
+ * TOOLS / UTILS
+ */
+class StringTools
+{
+
+public:
+
+ ////////////////////////////////////////////////////////////////////////////
+ // TOLOWER -- TOUPPER
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static void tolower(std::string & str)
+ {
+ std::transform(str.begin(), str.end(), str.begin(), ::tolower );
+ }
+
+ inline static void toupper(std::string & str)
+ {
+ std::transform(str.begin(), str.end(), str.begin(), ::toupper );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // REGEX MATCH TEXT
+ ////////////////////////////////////////////////////////////////////////////
+
+ static bool regex_match(
+ const std::string & text, const std::string & regex);
+
+#define REGEX_MATCH( text , regex ) StringTools::regex_match( text , regex )
+
+ static bool regex_find(
+ const std::string & text, const std::string & regex);
+
+#define REGEX_FIND( text , regex ) StringTools::regex_find( text , regex )
+
+
+ static bool regex_startsWith(
+ const std::string & text, const std::string & regex);
+
+#define REGEX_STARTS( text , regex ) \
+ StringTools::regex_startsWith( text , regex )
+
+ static bool regex_endsWith(
+ const std::string & text, const std::string & regex);
+
+#define REGEX_ENDS( text , regex ) \
+ StringTools::regex_endsWith( text , regex )
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // REPLACE TEXT
+ ////////////////////////////////////////////////////////////////////////////
+
+ static void replace(std::string & mainStr, const std::string & patternA,
+ const std::string & patternB);
+
+ static void replaceAll(std::string & mainStr, const std::string & patternA,
+ const std::string & patternB);
+
+
+ static std::string regex_replace(const std::string & mainStr,
+ const std::string & regex_pattern, const std::string & pattern);
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // ERASE TEXT
+ ////////////////////////////////////////////////////////////////////////////
+
+ static void erase(std::string & mainStr, const std::string & pattern);
+
+ static void eraseAll(std::string & mainStr, const std::string & pattern);
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // STARTS , ENDS WITH
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static bool startsWith(
+ const std::string & strA, const std::string & strB)
+ {
+ std::string::size_type sizeB = strB.size();
+
+ return( (strA.size() >= sizeB)
+ && (strA.compare(0, sizeB, strB) == 0) );
+
+// return( (strA.size() >= strB.size()) &&
+// std::equal(strB.begin(), strB.end(), strA.begin()) );
+ }
+
+ inline static bool endsWith(
+ const std::string & strA, const std::string & strB)
+ {
+ std::string::size_type sizeA = strA.size();
+ std::string::size_type sizeB = strB.size();
+
+ return( (sizeA >= sizeB)
+ && (strA.compare(sizeA - sizeB, sizeB, strB) == 0) );
+
+// return( (strA.size() >= strB.size()) &&
+// std::equal(strB.rbegin(), strB.rend(), strA.rbegin()) );
+ }
+
+ inline static std::string removeLastIfEndsWith(
+ const std::string & strA, const std::string & strB)
+ {
+ std::string::size_type sizeA = strA.size();
+ std::string::size_type sizeB = strB.size();
+
+ if( (sizeA >= sizeB)
+ && (strA.compare(sizeA - sizeB, sizeB, strB) == 0) )
+ {
+ return( strA.substr(0, sizeA - sizeB) );
+ }
+ else
+ {
+ return( strA );
+ }
+ }
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // TRIM LEFT RIGHT
+ ////////////////////////////////////////////////////////////////////////////
+
+ // trim from start to first_not_of(SPACE_CHARS) + pos
+ inline static std::string & ltrim(
+ std::string & s, std::string::size_type pos = 0)
+ {
+// boost::algorithm::trim_left( s );
+ s.erase(0, s.find_first_not_of(SPACE_CHARS, pos));
+
+ return( s );
+ }
+
+ // trim from end
+ inline static std::string & rtrim(std::string & s)
+ {
+// boost::algorithm::trim_right( s );
+ s.erase(s.find_last_not_of(SPACE_CHARS) + 1);
+
+ return( s );
+ }
+
+ // trim from both ends
+ inline static std::string & trim(std::string & s)
+ {
+// boost::algorithm::trim( s );
+
+// return( s );
+
+ return( ltrim( rtrim(s) ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////
+ // TOKEN PARSER
+ ////////////////////////////////////////////////////////////////////////////
+
+ inline static bool nextToken(std::string & buffer,
+ std::string & token, const std::string & separator = SPACE_CHARS)
+ {
+ // token position: 0 --> pos
+ std::string::size_type pos = buffer.find_first_of(separator);
+
+ // next token
+ token = buffer.substr(0, pos);
+
+ // updated buffer
+ buffer.erase(0, buffer.find_first_not_of(SPACE_CHARS, pos));
+
+ return( not token.empty() );
+ }
+
+ inline static bool nextTokenWord(std::string & buffer,
+ std::string & token, const std::string & expectdWord)
+ {
+ if( buffer.size() < expectdWord.size() )
+ {
+ return( false );
+ }
+ else
+ {
+ std::string::size_type pos = 0;
+
+ for( ; pos < expectdWord.size() ; ++pos )
+ {
+ if( buffer[pos] != expectdWord[pos] )
+ {
+ return( false );
+ }
+ }
+
+ // next token
+ token = expectdWord;
+
+ // updated buffer
+ buffer.erase(0, buffer.find_first_not_of(SPACE_CHARS, pos));
+
+ return( true );
+ }
+ }
+
+
+ inline static bool nextTokenID(std::string & buffer,
+ std::string & token, const std::string & separator = SPACE_CHARS)
+ {
+ // ID position: 0 --> pos
+ std::string::size_type pos = 0;
+ if( std::isalpha(buffer[0]) || (buffer[0] == '_') || (buffer[0] == '#') )
+ {
+ for( ++pos ; (pos < buffer.size()) && (std::isalnum(buffer[pos]) ||
+ (buffer[pos] == '_') || (buffer[pos] == '#')) ; ++pos )
+ {
+ //!! CONTINUE
+ }
+ }
+
+ // next token
+ token = buffer.substr(0, pos);
+
+ // updated buffer
+ buffer.erase(0, buffer.find_first_not_of(separator, pos));
+
+ return( not token.empty() );
+ }
+
+
+ inline static bool nextTokenUFID(std::string & buffer,
+ std::string & token, const std::string & separator = SPACE_CHARS)
+ {
+ // ID position: 0 --> pos
+ std::string::size_type pos = 0;
+ if( std::isalpha(buffer[0])
+ || (buffer[0] == '_')
+ || (buffer[0] == '#')
+ || (buffer[pos] == ':') )
+ {
+ for( ++pos ; (pos < buffer.size()) &&
+ ( std::isalnum(buffer[pos])
+ || (buffer[pos] == '_')
+ || (buffer[pos] == '#')
+ || (buffer[pos] == '.')
+ || (buffer[pos] == ':') ) ; ++pos )
+ {
+ //!! CONTINUE
+ }
+ }
+
+ // next token
+ token = buffer.substr(0, pos);
+
+ // updated buffer
+ buffer.erase(0, buffer.find_first_not_of(separator, pos));
+
+ return( not token.empty() );
+ }
+
+};
+
+
+}
+
+#endif /* AVM_STRING_H_ */
diff --git a/org.eclipse.efm.symbex/src/util/avm_types.cpp b/org.eclipse.efm.symbex/src/util/avm_types.cpp
new file mode 100644
index 0000000..9f700f4
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/util/avm_types.cpp
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 25 nov. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "avm_types.h"
+
+namespace sep
+{
+
+
+std::string strUnit(avm_unit_t unit)
+{
+ switch ( unit )
+ {
+ case AVM_NANO_SECOND_UNIT : return( "ns");
+ case AVM_MICRO_SECOND_UNIT : return( "µs");
+ case AVM_MILLI_SECOND_UNIT : return( "ms");
+ case AVM_SECOND_UNIT : return( "s");
+
+ case AVM_MINUTE_UNIT : return( "min");
+ case AVM_HOUR_UNIT : return( "h");
+
+ case AVM_MICRO_STEP_UNIT : return( "micro_step");
+ case AVM_STEP_UNIT : return( "step");
+ case AVM_MACRO_STEP_UNIT : return( "macro_step");
+
+ case AVM_UNDEFINED_UNIT : return( "undefined<unit>");
+
+ default : return( "unknown<unit>" );
+ }
+}
+
+
+}
+
diff --git a/org.eclipse.efm.symbex/src/util/avm_types.h b/org.eclipse.efm.symbex/src/util/avm_types.h
new file mode 100644
index 0000000..cc2e90e
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/util/avm_types.h
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 16 juil. 2009
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVM_TYPES_H_
+#define AVM_TYPES_H_
+
+#include <string>
+
+#include <util/avm_numeric.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// The TIME UNIT, ...
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+typedef avm_uint64_t avm_delay_value_t;
+
+typedef avm_uint16_t avm_unit_t;
+
+enum {
+ AVM_UNDEFINED_UNIT = 0x0000,
+
+ AVM_NANO_SECOND_UNIT = 0x0001,
+ AVM_MICRO_SECOND_UNIT = 0x0002,
+ AVM_MILLI_SECOND_UNIT = 0x0004,
+ AVM_SECOND_UNIT = 0x0008,
+
+ AVM_MINUTE_UNIT = 0x0010,
+ AVM_HOUR_UNIT = 0x0020,
+
+ AVM_MICRO_STEP_UNIT = 0x0040,
+ AVM_STEP_UNIT = 0x0080,
+ AVM_MACRO_STEP_UNIT = 0x0100,
+};
+
+
+#define IS_UNDEFINED_UNIT(unit) (unit == AVM_UNDEFINED_UNIT)
+
+#define IS_NANO_SECOND_UNIT(unit) (unit & AVM_NANO_SECOND_UNIT)
+#define IS_MILLI_SECOND_UNIT(unit) (unit & AVM_MILLI_SECOND_UNIT)
+#define IS_SECOND_UNIT(unit) (unit & AVM_SECOND_UNIT)
+
+#define IS_MINUTE_UNIT(unit) (unit & AVM_MINUTE_UNIT)
+#define IS_HOUR_UNIT(unit) (unit & AVM_HOUR_UNIT)
+
+#define IS_MICRO_STEP_UNIT(unit) (unit & AVM_MICRO_STEP_UNIT)
+#define IS_STEP_UNIT(unit) (unit & AVM_STEP_UNIT)
+#define IS_MACRO_STEP_UNIT(unit) (unit & AVM_MACRO_STEP_UNIT)
+
+
+extern std::string strUnit(avm_unit_t unit);
+
+
+
+}
+
+#endif /* AVM_TYPES_H_ */
diff --git a/org.eclipse.efm.symbex/src/util/avm_uri.cpp b/org.eclipse.efm.symbex/src/util/avm_uri.cpp
new file mode 100644
index 0000000..a6a7b75
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/util/avm_uri.cpp
@@ -0,0 +1,164 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 23 nov. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "avm_uri.h"
+
+#include <fstream>
+
+#include <util/avm_assert.h>
+
+
+namespace sep
+{
+
+
+/**
+ * open / close
+ * OS
+ */
+
+bool AvmUri::open()
+{
+ if( outStream.good() )
+ {
+ return( true );
+ }
+
+ else switch ( kind )
+ {
+ case AVM_URI_STREAM_STD_COUT_KIND:
+ {
+ outStream.OS = AVM_OS_COUT.OS;
+
+ break;
+ }
+ case AVM_URI_STREAM_STD_CERR_KIND:
+ {
+ outStream.OS = AVM_OS_CERR.OS;
+
+ break;
+ }
+
+
+ case AVM_URI_STREAM_AVM_LOG_KIND:
+ {
+ outStream.OS = AVM_OS_LOG.OS;
+
+ break;
+ }
+
+ case AVM_URI_STREAM_AVM_TRACE_KIND:
+ {
+ outStream.OS = AVM_OS_TRACE.OS;
+
+ break;
+ }
+
+ case AVM_URI_FOLDER_KIND:
+ {
+ break;
+ }
+
+ case AVM_URI_FILE_KIND:
+ case AVM_URI_FILENAME_KIND:
+ {
+ if( outStream.fail() )
+ {
+ if( outStream.open(location.c_str() , mode) )
+ {
+ isAllocated = true;
+ }
+ else
+ {
+ AVM_OS_FATAL_ERROR_EXIT
+ << "Failed to open << " << location
+ << " >> file in write mode !!!"
+ << SEND_EXIT;
+ }
+ }
+
+ break;
+ }
+
+ case AVM_URI_SOCKET_KIND:
+ {
+ outStream = NULL;
+
+ break;
+ }
+
+
+ case AVM_URI_UNDEFINED_KIND:
+ {
+ outStream = NULL;
+
+ break;
+ }
+
+ default:
+ {
+ outStream = NULL;
+
+ break;
+ }
+ }
+
+ return( true );
+}
+
+
+/**
+ ***************************************************************************
+ * SERIALIZATION
+ ***************************************************************************
+ */
+
+std::string AvmUri::strKind(avm_uri_kind_t kind)
+{
+ switch ( kind )
+ {
+ case AVM_URI_STREAM_STD_COUT_KIND : return( "stream:std:cout");
+ case AVM_URI_STREAM_STD_CERR_KIND : return( "stream:std:cerr");
+
+ case AVM_URI_STREAM_AVM_LOG_KIND : return( "stream:avm:log");
+ case AVM_URI_STREAM_AVM_TRACE_KIND : return( "stream:avm:trace");
+
+ case AVM_URI_FOLDER_KIND : return( "folder");
+ case AVM_URI_FILE_KIND : return( "file");
+ case AVM_URI_FILENAME_KIND : return( "filename");
+
+ case AVM_URI_SOCKET_KIND : return( "socket");
+
+ case AVM_URI_UNDEFINED_KIND : return( "undefined<uri#kind>");
+
+ default : return( "unknown<uri#kind>" );
+ }
+}
+
+
+void AvmUri::toStream(OutStream & os) const
+{
+ os << TAB << "uri< " << strKind(kind) << " > {" << EOL;
+ os << TAB2 << "raw = " << raw << ";" << EOL;
+ os << TAB2 << "location = " << location << ";" << EOL;
+
+ if( kind == AVM_URI_SOCKET_KIND )
+ {
+ os << TAB2 << "port = " << port << ";" << EOL;
+ }
+ os << TAB << "}" << EOL_FLUSH;
+}
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/util/avm_uri.h b/org.eclipse.efm.symbex/src/util/avm_uri.h
new file mode 100644
index 0000000..d5b47ea
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/util/avm_uri.h
@@ -0,0 +1,170 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 23 nov. 2011
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVM_URI_H_
+#define AVM_URI_H_
+
+#include <printer/OutStream.h>
+
+#include <util/avm_numeric.h>
+
+
+namespace sep
+{
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// The URI KIND
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+typedef avm_uint8_t avm_uri_kind_t;
+
+enum {
+ AVM_URI_UNDEFINED_KIND = 0x0000,
+
+ AVM_URI_STREAM_STD_COUT_KIND = 0x0001,
+ AVM_URI_STREAM_STD_CERR_KIND = 0x0002,
+
+ AVM_URI_STREAM_AVM_LOG_KIND = 0x0004,
+ AVM_URI_STREAM_AVM_TRACE_KIND = 0x0008,
+
+ AVM_URI_FOLDER_KIND = 0x0010,
+ AVM_URI_FILE_KIND = 0x0020,
+ AVM_URI_FILENAME_KIND = 0x0040,
+
+ AVM_URI_SOCKET_KIND = 0x0080
+};
+
+#define IS_URI_UNDEFINED(kind) (kind == AVM_URI_UNDEFINED_KIND)
+
+#define IS_URI_STREAM_STD_COUT_KIND(kind) (kind & AVM_URI_STREAM_STD_COUT_KIND)
+#define IS_URI_STREAM_STD_CERR_KIND(kind) (kind & AVM_URI_STREAM_STD_CERR_KIND)
+
+#define IS_URI_STREAM_AVM_LOG_KIND(kind) (kind & AVM_URI_STREAM_AVM_LOG_KIND)
+#define IS_URI_STREAM_AVM_TRACE_KIND(kind) (kind & AVM_URI_STREAM_AVM_TRACE_KIND)
+
+#define IS_URI_FOLDER_KIND(kind) (kind & AVM_URI_FOLDER_KIND)
+#define IS_URI_FILE_KIND(kind) (kind & AVM_URI_FILE_KIND)
+#define IS_URI_FILENAME_KIND(kind) (kind & AVM_URI_FILENAME_KIND)
+
+#define IS_URI_SOCKET_KIND(kind) (kind & AVM_URI_SOCKET_KIND)
+
+
+
+class AvmUri
+{
+
+public:
+ /**
+ * ATTRIBUTES
+ */
+ std::string raw;
+
+ avm_uri_kind_t kind;
+
+ std::string location;
+
+ avm_uint64_t port;
+
+ OutStream outStream;
+ std::ios_base::openmode mode;
+
+ bool isAllocated;
+
+
+public:
+ /**
+ * CONSTRUCTOR
+ * Default
+ */
+ AvmUri( const std::string & rawLocation )
+ : raw( rawLocation ),
+ kind( AVM_URI_UNDEFINED_KIND ),
+ location( ),
+ port( 0 ),
+ outStream( ),
+ mode( std::ios_base::out ),
+ isAllocated( false )
+ {
+ //!! NOTHING
+ }
+
+ AvmUri( avm_uri_kind_t aKind, const std::string & rawLocation )
+ : raw( rawLocation ),
+ kind( aKind ),
+ location( ),
+ port( 0 ),
+ outStream( ),
+ mode( std::ios_base::out ),
+ isAllocated( false )
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * DESTRUCTOR
+ */
+ virtual ~AvmUri()
+ {
+ //!! NOTHING
+ }
+
+
+ /**
+ * COMPARISON
+ * OPERATOR
+ */
+
+ inline bool operator==(const AvmUri & uri) const
+ {
+ return( (raw == uri.raw) && (kind == uri.kind) &&
+ (location == uri.location) && (port == uri.port) );
+ }
+
+
+ /**
+ * open / close
+ * OS
+ */
+
+ bool open();
+
+ void close()
+ {
+ if( isAllocated )
+ {
+ outStream.deleteOS();
+ }
+ }
+
+ /**
+ ***************************************************************************
+ * SERIALIZATION
+ ***************************************************************************
+ */
+ static std::string strKind(avm_uri_kind_t kind);
+
+
+ void toStream(OutStream & os) const;
+
+};
+
+
+
+} /* namespace sep */
+#endif /* AVM_URI_H_ */
diff --git a/org.eclipse.efm.symbex/src/util/avm_util.cpp b/org.eclipse.efm.symbex/src/util/avm_util.cpp
new file mode 100644
index 0000000..b846e09
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/util/avm_util.cpp
@@ -0,0 +1,477 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#include "avm_util.h"
+
+#include <collection/Bitset.h>
+
+#include <common/AvmObject.h>
+#include <common/Element.h>
+#include <common/BF.h>
+#include <common/RunnableElement.h>
+#include <computer/BaseEnvironment.h>
+#include <computer/EvaluationEnvironment.h>
+#include <computer/ExecutionEnvironment.h>
+#include <computer/instruction/InstructionEnvironment.h>
+#include <computer/primitive/AvmCommunicationRdvPrimitive.h>
+
+#include <fml/buffer/BaseBufferQueue.h>
+
+#include <fml/builtin/BuiltinForm.h>
+#include <fml/builtin/Identifier.h>
+#include <fml/builtin/QualifiedIdentifier.h>
+
+#include <fml/common/ObjectElement.h>
+#include <fml/common/PropertyElement.h>
+
+#include <fml/executable/AvmLambda.h>
+#include <fml/executable/AvmProgram.h>
+#include <fml/executable/ComRouteData.h>
+#include <fml/executable/BaseInstanceForm.h>
+#include <fml/executable/ExecutableForm.h>
+#include <fml/executable/ExecutableSystem.h>
+#include <fml/executable/InstanceOfBuffer.h>
+#include <fml/executable/InstanceOfConnect.h>
+#include <fml/executable/InstanceOfData.h>
+#include <fml/executable/InstanceOfMachine.h>
+#include <fml/executable/InstanceOfPort.h>
+#include <fml/executable/Router.h>
+#include <fml/executable/RoutingData.h>
+
+#include <fml/expression/AvmCode.h>
+#include <fml/expression/BuiltinArray.h>
+#include <fml/expression/BuiltinQueue.h>
+#include <fml/expression/BuiltinContainer.h>
+
+#include <fml/numeric/Number.h>
+
+#include <fml/infrastructure/BehavioralPart.h>
+#include <fml/infrastructure/Buffer.h>
+#include <fml/infrastructure/Channel.h>
+#include <fml/infrastructure/ComPoint.h>
+#include <fml/infrastructure/ComRoute.h>
+#include <fml/infrastructure/CompositePart.h>
+#include <fml/infrastructure/Connector.h>
+#include <fml/infrastructure/DataType.h>
+#include <fml/infrastructure/InteractionPart.h>
+#include <fml/infrastructure/Machine.h>
+#include <fml/infrastructure/ModelOfComputationPart.h>
+#include <fml/infrastructure/Package.h>
+#include <fml/infrastructure/Port.h>
+#include <fml/infrastructure/PropertyPart.h>
+#include <fml/infrastructure/Routine.h>
+#include <fml/infrastructure/System.h>
+#include <fml/infrastructure/Transition.h>
+#include <fml/infrastructure/Variable.h>
+
+#include <fml/operator/Operator.h>
+
+#include <fml/symbol/Symbol.h>
+#include <fml/symbol/TableOfSymbol.h>
+
+#include <fml/type/TableOfTypeSpecifier.h>
+#include <fml/type/TypeSpecifier.h>
+
+#include <fml/runtime/ExecutionConfiguration.h>
+#include <fml/runtime/ExecutionContext.h>
+#include <fml/runtime/ExecutionData.h>
+#include <fml/runtime/ExecutionInformation.h>
+#include <fml/runtime/ExecutionLocation.h>
+#include <fml/runtime/ExecutionSynchronizationPoint.h>
+#include <fml/runtime/LocalRuntime.h>
+#include <fml/runtime/RuntimeForm.h>
+#include <fml/runtime/RuntimeID.h>
+#include <fml/runtime/TableOfData.h>
+#include <fml/runtime/TableOfRuntimeFormState.h>
+
+#include <fml/trace/TraceFilter.h>
+#include <fml/trace/TracePoint.h>
+#include <fml/trace/TraceSequence.h>
+
+#include <fml/type/BaseTypeSpecifier.h>
+
+#include <fml/workflow/UniFormIdentifier.h>
+#include <fml/workflow/WObject.h>
+
+#include <fam/api/AbstractProcessorUnit.h>
+#include <fml/runtime/LocalRuntime.h>
+#include <fml/runtime/Message.h>
+
+#include <parser/ParserManager.h>
+
+
+namespace sep {
+
+
+/**
+ *******************************************************************************
+ * AVM EXIT CODE
+ *******************************************************************************
+ */
+AVM_EXIT_CODE_KIND _AVM_EXIT_CODE_ = AVM_EXIT_GOOD_CODE;
+
+
+void avm_set_exit_code(AVM_EXIT_CODE_KIND exit_code)
+{
+ if( _AVM_EXIT_CODE_ == AVM_EXIT_GOOD_CODE )
+ {
+ _AVM_EXIT_CODE_ = exit_code;
+ }
+ else if( _AVM_EXIT_CODE_ != exit_code )
+ {
+AVM_IF_DEBUG_ENABLED
+
+ AVM_OS_WARN << _DBG_ << "Previous exit code: " << std::endl
+ << exit_msg( _AVM_EXIT_CODE_ ) << std::endl;
+
+AVM_ENDIF_DEBUG_ENABLED
+
+ _AVM_EXIT_CODE_ = exit_code;
+ }
+}
+
+
+std::string avm_strExitCode(AVM_EXIT_CODE_KIND exit_code)
+{
+
+#define CASE_RETURN( code , str ) case AVM_EXIT_##code##_CODE: return( str );
+
+ switch( exit_code )
+ {
+ CASE_RETURN( GOOD , "good" )
+
+ CASE_RETURN( FAILED , "failed" )
+
+
+ CASE_RETURN( OUT_OF_MEMORY , "out-of-memory" )
+
+ CASE_RETURN( FATAL_ERROR , "fatal error" )
+
+
+ CASE_RETURN( CONFIGURE_ERROR , "error in configuration process" )
+
+ CASE_RETURN( PARSING_ERROR , "error in parsing process" )
+
+ CASE_RETURN( PARSING_EXCEPTION , "exception in parsing process" )
+
+ CASE_RETURN( COMPILING_ERROR , "error in compiling process" )
+
+
+ CASE_RETURN( EXECUTION_ERROR , "error in execution process" )
+
+ CASE_RETURN( RUNTIME_ERROR , "runtime error" )
+
+
+ CASE_RETURN( INITIALIZING_ERROR , "processor: initialization error" )
+
+ CASE_RETURN( PRE_PROCESSING_ERROR , "processor: pre-processing error" )
+
+ CASE_RETURN( PROCESSING_ERROR , "processor: processing error" )
+
+ CASE_RETURN( POST_PROCESSING_ERROR , "processor: post_processing error" )
+
+ CASE_RETURN( FINALIZING_ERROR , "processor: finalization error" )
+
+
+ //CONTROLLER UNIT VERDICT
+ CASE_RETURN( SYMBEX_CONTROLLER_MIN , "symbex controller: minimal code" )
+
+
+ CASE_RETURN( COVERAGE_GOAL_ACHIEVED , "coverage: GOAL ACHIEVED" )
+ CASE_RETURN( COVERAGE_GOAL_UNACHIEVED , "coverage: GOAL UNACHIEVED" )
+
+ CASE_RETURN( COVERAGE_GOAL_ALMOST_ACHIEVED, "coverage: ALMOST ACHIEVED")
+
+ CASE_RETURN( COVERAGE_GOAL_UNREACHABLE , "coverage: GOAL UNREACHABLE" )
+
+
+ CASE_RETURN( VERDICT_PASS , "verdict: PASS" )
+ CASE_RETURN( VERDICT_STRONG_PASS , "verdict: STRONG PASS" )
+ CASE_RETURN( VERDICT_WEAK_PASS , "verdict: WEAK PASS" )
+
+ CASE_RETURN( VERDICT_INCONCLUIVE , "verdict: INCONCLUIVE" )
+ CASE_RETURN( VERDICT_INCONCLUIVE_INPUT , "verdict: INCONCLUIVE_INPUT" )
+ CASE_RETURN( VERDICT_INCONCLUIVE_R , "verdict: INCONCLUIVE_R" )
+
+ CASE_RETURN( VERDICT_NONE , "verdict: NONE" )
+ CASE_RETURN( VERDICT_FAIL , "verdict: FAIL" )
+ CASE_RETURN( VERDICT_ERROR , "verdict: ERROR" )
+ CASE_RETURN( VERDICT_ABORT , "verdict: ABORT" )
+
+ CASE_RETURN( VERDICT_UNDEFINED , "verdict: UNDEFINED" )
+
+
+ CASE_RETURN( UNKNOWN , "unknown exit code" )
+
+ default: return "undefined exit code";
+ }
+}
+
+
+OutStream & operator<<(OutStream & OS, const AvmEXIT_SIGNAL & exitSignal)
+{
+ return( OS << EMPHASIS( OSS() << "@exit< "
+ << avm_strExitCode( exitSignal.code ) << " > bye !",
+ ( ((exitSignal.code == AVM_EXIT_GOOD_CODE)
+ || (exitSignal.code > AVM_EXIT_SYMBEX_CONTROLLER_MIN_CODE))
+ ? '*' : '?' ),
+ ( ((exitSignal.code == AVM_EXIT_GOOD_CODE)
+ || (exitSignal.code > AVM_EXIT_SYMBEX_CONTROLLER_MIN_CODE))
+ ? 42 : 80 ) ) );
+
+// return( OS << "@exit< " << avm_strExitCode( exitSignal.code )
+// << " > bye !" << std::endl );
+}
+
+
+/**
+ ***************************************************************************
+ * AVM EVAL MODE
+ ***************************************************************************
+ */
+AVM_EXEC_MODE_KIND _AVM_EXEC_MODE_ = AVM_EXEC_STANDALONE_MODE;
+
+void avm_setExecModeKind(std::string strModeKind)
+{
+ StringTools::toupper(strModeKind);
+
+ if( strModeKind.empty() ) AVM_EXEC_MODE_SET( STANDALONE )
+
+ else if( strModeKind == "STANDALONE" ) AVM_EXEC_MODE_SET( STANDALONE )
+
+ else if( strModeKind == "SERVER" ) AVM_EXEC_MODE_SET( SERVER )
+
+ else if( strModeKind == "INTERACTIVE" ) AVM_EXEC_MODE_SET( INTERACTIVE )
+
+ else AVM_EXEC_MODE_SET( STANDALONE )
+}
+
+
+
+AVM_EXEC_VERBOSITY_LEVEL _AVM_EXEC_VERBOSITY_ = AVM_EXEC_VERBOSITY_MAXIMUM;
+
+void avm_setExecVerbosityLevel(std::string strVerbosityLevel)
+{
+ StringTools::toupper(strVerbosityLevel);
+
+ if( strVerbosityLevel.empty() ) AVM_EXEC_VERBOSITY_SET( MAXIMUM )
+
+ else if( strVerbosityLevel == "SILENT" ) AVM_EXEC_VERBOSITY_SET( SILENT )
+
+ else if( strVerbosityLevel == "MINIMUM" ) AVM_EXEC_VERBOSITY_SET( MINIMUM )
+
+ else if( strVerbosityLevel == "MEDIUM" ) AVM_EXEC_VERBOSITY_SET( MEDIUM )
+
+ else if( strVerbosityLevel == "MAXIMUM" ) AVM_EXEC_VERBOSITY_SET( MAXIMUM )
+
+ else AVM_EXEC_VERBOSITY_SET( MAXIMUM )
+}
+
+std::string avm_strExecVerbosityLevel()
+{
+ switch( _AVM_EXEC_VERBOSITY_ )
+ {
+ case AVM_EXEC_VERBOSITY_SILENT : return( "SILENT" );
+ case AVM_EXEC_VERBOSITY_MINIMUM: return( "MINIMUM" );
+ case AVM_EXEC_VERBOSITY_MEDIUM : return( "MEDIUM" );
+ case AVM_EXEC_VERBOSITY_MAXIMUM: return( "MAXIMUM" );
+
+ default: return( "VERBOSITY< UNKNOWN >" );
+ }
+}
+
+
+
+#define AVM_INSTANCE_SHOW_COUNTER(ClassName) \
+ InstanceCounter< ClassName >::showCounters(os, #ClassName)
+
+#define AVM_INSTANCE_REPORT_COUNTER(ClassName) \
+ InstanceCounter< ClassName >::reportCounters(os, #ClassName)
+
+
+#define AVM_SHOW_INSTANCE_COUNT_T(ClassName, counter) \
+ if( counter > 0 ) do { \
+ int colSize = 32 - std::strlen(#ClassName); \
+ os << TAB << #ClassName << std::setw((colSize > 0) ? colSize : 1); \
+ os << " :> " << std::setw(6) << counter << EOL_FLUSH; \
+ } while( 0 )
+
+
+
+/**
+ * avm_report
+ */
+void avm_report(OutStream & os, const std::string & aMsg, bool forced)
+{
+//!![MIGRATION]
+AVM_IF_DEBUG_LEVEL_FLAG_OR( MEDIUM , REFERENCE_COUNTING , forced )
+
+ os << AVM_TAB_INDENT;
+
+ os << std::endl << "\t" << "***** FORM COUNTER in << " << aMsg
+ << " >> *****" << std::endl;
+
+ AVM_INSTANCE_SHOW_COUNTER(AvmObject);
+ AVM_INSTANCE_SHOW_COUNTER(Element );
+
+ AVM_INSTANCE_SHOW_COUNTER(BF);
+
+ AVM_INSTANCE_SHOW_COUNTER(Symbol );
+ AVM_INSTANCE_SHOW_COUNTER(TypeSpecifier);
+
+ AVM_INSTANCE_SHOW_COUNTER(TableOfSymbol );
+ AVM_INSTANCE_SHOW_COUNTER(TableOfTypeSpecifier);
+
+ AVM_SHOW_INSTANCE_COUNT_T(BF_FROM_ASP, BF::INSTANCE_COUNTER_ASP);
+
+ AVM_INSTANCE_REPORT_COUNTER(AvmCode);
+ AVM_INSTANCE_REPORT_COUNTER(BFCode );
+
+ AVM_INSTANCE_REPORT_COUNTER(LocalRuntime );
+ AVM_INSTANCE_REPORT_COUNTER(RuntimeForm );
+ AVM_INSTANCE_REPORT_COUNTER(_RuntimeID_ );
+ AVM_INSTANCE_REPORT_COUNTER(RuntimeID );
+
+ AVM_INSTANCE_REPORT_COUNTER(ExecutionContext );
+ AVM_INSTANCE_REPORT_COUNTER(ExecutionData );
+ AVM_INSTANCE_REPORT_COUNTER(ExecutionInformation);
+ AVM_INSTANCE_REPORT_COUNTER(GenericInfoData );
+
+ AVM_INSTANCE_REPORT_COUNTER(WObject);
+AVM_ENDIF_DEBUG_LEVEL_FLAG_OR( MEDIUM , REFERENCE_COUNTING )
+
+
+AVM_IF_DEBUG_LEVEL_FLAG_AND( HIGH , REFERENCE_COUNTING ,
+ (AvmObject::INSTANCE_ALIVE > 0) )
+
+// AVM_INSTANCE_REPORT_COUNTER(ginac_and );
+// AVM_INSTANCE_REPORT_COUNTER(ginac_or );
+// AVM_INSTANCE_REPORT_COUNTER(ginac_not );
+// AVM_INSTANCE_REPORT_COUNTER(ginac_relational);
+
+
+ AVM_INSTANCE_REPORT_COUNTER(RunnableElement);
+
+ AVM_INSTANCE_REPORT_COUNTER(AbstractProcessorUnit);
+
+ AVM_INSTANCE_REPORT_COUNTER(Bitset);
+
+ AVM_INSTANCE_REPORT_COUNTER(BuiltinForm);
+ AVM_INSTANCE_REPORT_COUNTER(Number );
+ AVM_INSTANCE_REPORT_COUNTER(Identifier );
+ AVM_INSTANCE_REPORT_COUNTER(QualifiedIdentifier);
+
+ AVM_INSTANCE_REPORT_COUNTER(ArrayBF );
+ AVM_INSTANCE_REPORT_COUNTER(ArrayBoolean );
+ AVM_INSTANCE_REPORT_COUNTER(ArrayCharacter );
+ AVM_INSTANCE_REPORT_COUNTER(ArrayInteger );
+ AVM_INSTANCE_REPORT_COUNTER(ArrayRational );
+ AVM_INSTANCE_REPORT_COUNTER(ArrayFloat );
+ AVM_INSTANCE_REPORT_COUNTER(ArrayString );
+ AVM_INSTANCE_REPORT_COUNTER(ArrayIdentifier);
+ AVM_INSTANCE_REPORT_COUNTER(ArrayQualifiedIdentifier);
+
+ AVM_INSTANCE_REPORT_COUNTER(BuiltinContainer );
+ AVM_INSTANCE_REPORT_COUNTER(BuiltinList );
+ AVM_INSTANCE_REPORT_COUNTER(BuiltinVector );
+ AVM_INSTANCE_REPORT_COUNTER(BuiltinQueue );
+ AVM_INSTANCE_REPORT_COUNTER(BuiltinFifo );
+ AVM_INSTANCE_REPORT_COUNTER(BuiltinLifo );
+ AVM_INSTANCE_REPORT_COUNTER(BuiltinSet );
+ AVM_INSTANCE_REPORT_COUNTER(BuiltinBag );
+
+ AVM_INSTANCE_REPORT_COUNTER(UniFormIdentifier);
+
+ AVM_INSTANCE_REPORT_COUNTER(ObjectElement );
+ AVM_INSTANCE_REPORT_COUNTER(PropertyElement );
+
+ AVM_INSTANCE_REPORT_COUNTER(WObject );
+
+ AVM_INSTANCE_REPORT_COUNTER(DataType );
+ AVM_INSTANCE_REPORT_COUNTER(Buffer );
+ AVM_INSTANCE_REPORT_COUNTER(Channel );
+ AVM_INSTANCE_REPORT_COUNTER(ComPoint );
+ AVM_INSTANCE_REPORT_COUNTER(ComRoute );
+ AVM_INSTANCE_REPORT_COUNTER(Connector );
+ AVM_INSTANCE_REPORT_COUNTER(Machine );
+ AVM_INSTANCE_REPORT_COUNTER(Package );
+ AVM_INSTANCE_REPORT_COUNTER(Port );
+ AVM_INSTANCE_REPORT_COUNTER(Routine );
+ AVM_INSTANCE_REPORT_COUNTER(System );
+ AVM_INSTANCE_REPORT_COUNTER(Transition);
+ AVM_INSTANCE_REPORT_COUNTER(Variable );
+
+ AVM_INSTANCE_REPORT_COUNTER(BehavioralPart );
+ AVM_INSTANCE_REPORT_COUNTER(CompositePart );
+ AVM_INSTANCE_REPORT_COUNTER(InteractionPart);
+ AVM_INSTANCE_REPORT_COUNTER(ModelOfComputationPart);
+ AVM_INSTANCE_REPORT_COUNTER(PropertyPart );
+
+ AVM_INSTANCE_REPORT_COUNTER(AvmLambda );
+ AVM_INSTANCE_REPORT_COUNTER(AvmProgram );
+ AVM_INSTANCE_REPORT_COUNTER(ExecutableForm );
+ AVM_INSTANCE_REPORT_COUNTER(ExecutableSystem);
+ AVM_INSTANCE_REPORT_COUNTER(ComRouteData );
+ AVM_INSTANCE_REPORT_COUNTER(RoutingData );
+
+ AVM_INSTANCE_REPORT_COUNTER(BaseEnvironment );
+ AVM_INSTANCE_REPORT_COUNTER(EvaluationEnvironment );
+ AVM_INSTANCE_REPORT_COUNTER(ExecutionEnvironment );
+ AVM_INSTANCE_REPORT_COUNTER(InstructionEnvironment );
+
+ AVM_INSTANCE_REPORT_COUNTER(ExecutionContextHeader );
+ AVM_INSTANCE_REPORT_COUNTER(ExecutionContext );
+ AVM_INSTANCE_REPORT_COUNTER(ExecutionData );
+ AVM_INSTANCE_REPORT_COUNTER(ExecutionConfiguration );
+ AVM_INSTANCE_REPORT_COUNTER(ExecutionInformation );
+ AVM_INSTANCE_REPORT_COUNTER(GenericInfoData );
+
+ AVM_INSTANCE_REPORT_COUNTER(ExecutionLocation );
+ AVM_INSTANCE_REPORT_COUNTER(ExecutionSynchronizationPoint);
+ AVM_INSTANCE_REPORT_COUNTER(RdvConfigurationData );
+
+ AVM_INSTANCE_REPORT_COUNTER(TableOfData );
+ AVM_INSTANCE_REPORT_COUNTER(TableOfInstanceOfData );
+ AVM_INSTANCE_REPORT_COUNTER(TableOfAvmProgram );
+ AVM_INSTANCE_REPORT_COUNTER(StackOfLocalRuntime );
+ AVM_INSTANCE_REPORT_COUNTER(TableOfRuntimeFormState);
+ AVM_INSTANCE_REPORT_COUNTER(TableOfRuntimeID );
+
+ AVM_INSTANCE_REPORT_COUNTER(InstanceOfData );
+ AVM_INSTANCE_REPORT_COUNTER(InstanceOfMachine);
+ AVM_INSTANCE_REPORT_COUNTER(InstanceOfPort );
+ AVM_INSTANCE_REPORT_COUNTER(InstanceOfBuffer );
+ AVM_INSTANCE_REPORT_COUNTER(InstanceOfConnect);
+ AVM_INSTANCE_REPORT_COUNTER(BaseInstanceForm );
+
+ AVM_INSTANCE_REPORT_COUNTER(LocalRuntime );
+ AVM_INSTANCE_REPORT_COUNTER(RuntimeForm );
+
+ AVM_INSTANCE_REPORT_COUNTER(Message );
+ AVM_INSTANCE_REPORT_COUNTER(BaseBufferForm );
+ AVM_INSTANCE_REPORT_COUNTER(Router );
+
+ AVM_INSTANCE_REPORT_COUNTER(Operator );
+
+ AVM_INSTANCE_REPORT_COUNTER(BaseTypeSpecifier);
+
+ AVM_INSTANCE_REPORT_COUNTER(TracePoint );
+ AVM_INSTANCE_REPORT_COUNTER(TraceSequence );
+ AVM_INSTANCE_REPORT_COUNTER(TraceFilter );
+
+ os << END_INDENT;
+
+AVM_ENDIF_DEBUG_LEVEL_FLAG_AND( HIGH , REFERENCE_COUNTING )
+}
+
+
+}
diff --git a/org.eclipse.efm.symbex/src/util/avm_util.h b/org.eclipse.efm.symbex/src/util/avm_util.h
new file mode 100644
index 0000000..1e9545d
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/util/avm_util.h
@@ -0,0 +1,341 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+#ifndef AVM_UTIL_H_
+#define AVM_UTIL_H_
+
+#include <iostream>
+#include <string>
+
+
+namespace sep {
+
+
+class OutStream;
+
+
+
+/**
+ *******************************************************************************
+ * AVM EXIT CODE
+ *******************************************************************************
+ */
+
+enum AVM_EXIT_CODE_KIND
+{
+ AVM_EXIT_GOOD_CODE = 0,
+
+ AVM_EXIT_FAILED_CODE = 1,
+
+ AVM_EXIT_OUT_OF_MEMORY_CODE = 2,
+
+ AVM_EXIT_SEGMENTATION_FAULT_CODE = 3,
+
+ AVM_EXIT_FATAL_ERROR_CODE = 4,
+
+
+ AVM_EXIT_CONFIGURE_ERROR_CODE = 5,
+
+
+ AVM_EXIT_PARSING_ERROR_CODE = 6,
+
+ AVM_EXIT_PARSING_EXCEPTION_CODE = 7,
+
+ AVM_EXIT_COMPILING_ERROR_CODE = 8,
+
+
+ AVM_EXIT_EXECUTION_ERROR_CODE = 9,
+
+ AVM_EXIT_RUNTIME_ERROR_CODE = 10,
+
+
+ AVM_EXIT_INITIALIZING_ERROR_CODE = 11,
+
+ AVM_EXIT_PRE_PROCESSING_ERROR_CODE = 12,
+
+ AVM_EXIT_PROCESSING_ERROR_CODE = 13,
+
+ AVM_EXIT_POST_PROCESSING_ERROR_CODE = 14,
+
+ AVM_EXIT_FINALIZING_ERROR_CODE = 15,
+
+
+ //CONTROLLER UNIT VERDICT
+ AVM_EXIT_SYMBEX_CONTROLLER_MIN_CODE = 100,
+
+
+ AVM_EXIT_COVERAGE_GOAL_ACHIEVED_CODE = 101,
+
+ AVM_EXIT_COVERAGE_GOAL_UNACHIEVED_CODE = 102,
+
+ AVM_EXIT_COVERAGE_GOAL_ALMOST_ACHIEVED_CODE = 103,
+
+ AVM_EXIT_COVERAGE_GOAL_UNREACHABLE_CODE = 104,
+
+
+ AVM_EXIT_VERDICT_PASS_CODE = 110,
+
+ AVM_EXIT_VERDICT_STRONG_PASS_CODE = 111,
+
+ AVM_EXIT_VERDICT_WEAK_PASS_CODE = 112,
+
+
+ AVM_EXIT_VERDICT_INCONCLUIVE_CODE = 113,
+
+ AVM_EXIT_VERDICT_INCONCLUIVE_INPUT_CODE = 114,
+
+ AVM_EXIT_VERDICT_INCONCLUIVE_R_CODE = 115,
+
+
+ AVM_EXIT_VERDICT_NONE_CODE = 116,
+
+ AVM_EXIT_VERDICT_FAIL_CODE = 117,
+
+ AVM_EXIT_VERDICT_ERROR_CODE = 118,
+
+ AVM_EXIT_VERDICT_ABORT_CODE = 119,
+
+ AVM_EXIT_VERDICT_UNDEFINED_CODE = 120,
+
+
+ AVM_EXIT_UNKNOWN_CODE = 255
+};
+
+extern AVM_EXIT_CODE_KIND _AVM_EXIT_CODE_;
+
+void avm_set_exit_code(AVM_EXIT_CODE_KIND exit_code);
+
+std::string avm_strExitCode(AVM_EXIT_CODE_KIND exit_code);
+
+
+/**
+ * MANIPULATORS
+ * for operator<<
+ */
+class OutStream;
+
+struct AvmEXIT_SIGNAL
+{
+ friend OutStream & operator<<(OutStream & OS,
+ const AvmEXIT_SIGNAL & exitSignal);
+
+
+ AVM_EXIT_CODE_KIND code;
+
+ AvmEXIT_SIGNAL(AVM_EXIT_CODE_KIND eck)
+ : code( eck )
+ {
+ //!! NOTHING
+ }
+};
+
+inline AvmEXIT_SIGNAL exit_signal(AVM_EXIT_CODE_KIND code)
+{
+ return( code );
+}
+
+inline AvmEXIT_SIGNAL exit_msg(AVM_EXIT_CODE_KIND code)
+{
+ return( code );
+}
+
+
+/**
+ * operator<<
+ */
+OutStream & operator<<(OutStream & OS, const AvmEXIT_SIGNAL & exitSignal);
+
+
+
+/**
+ *******************************************************************************
+ * AVM EVAL MODE
+ *******************************************************************************
+ */
+
+enum AVM_EXEC_MODE_KIND
+{
+ AVM_EXEC_STANDALONE_MODE = 0,
+
+ AVM_EXEC_SERVER_MODE = 1,
+
+ AVM_EXEC_INTERACTIVE_MODE = 2
+};
+
+extern AVM_EXEC_MODE_KIND _AVM_EXEC_MODE_;
+
+#define AVM_EXEC_MODE_SET( KIND ) \
+ { _AVM_EXEC_MODE_ = AVM_EXEC_##KIND##_MODE; }
+
+#define AVM_EXEC_MODE_IS( KIND ) \
+ ( _AVM_EXEC_MODE_ == AVM_EXEC_##KIND##_MODE )
+
+
+void avm_setExecModeKind(std::string strModeKind);
+
+
+
+/**
+ *******************************************************************************
+ * AVM VERBOSITY LEVEL
+ *******************************************************************************
+ */
+
+enum AVM_EXEC_VERBOSITY_LEVEL
+{
+ AVM_EXEC_VERBOSITY_SILENT = 0,
+
+ AVM_EXEC_VERBOSITY_MINIMUM = 1,
+
+ AVM_EXEC_VERBOSITY_MEDIUM = 2,
+
+ AVM_EXEC_VERBOSITY_MAXIMUM = 3
+};
+
+extern AVM_EXEC_VERBOSITY_LEVEL _AVM_EXEC_VERBOSITY_;
+
+
+#define AVM_EXEC_VERBOSITY_SET( LEVEL ) \
+ { _AVM_EXEC_VERBOSITY_ = AVM_EXEC_VERBOSITY_##LEVEL; }
+
+#define AVM_EXEC_VERBOSITY_IS( LEVEL ) \
+ ( _AVM_EXEC_VERBOSITY_ == AVM_EXEC_VERBOSITY_##LEVEL )
+
+#define AVM_EXEC_VERBOSITY_HAS( LEVEL ) \
+ ( _AVM_EXEC_VERBOSITY_ >= AVM_EXEC_VERBOSITY_##LEVEL )
+
+
+
+void avm_setExecVerbosityLevel(std::string strVerbosityLevel);
+
+std::string avm_strExecVerbosityLevel();
+
+
+/**
+ * VERBOSITY TEST
+ */
+#define _AVM_VERBOSITY_IF_IS_( LEVEL ) if( AVM_EXEC_VERBOSITY_IS( LEVEL ) ) {
+
+#define _AVM_VERBOSITY_IF_HAS_( LEVEL ) if( AVM_EXEC_VERBOSITY_HAS( LEVEL ) ) {
+
+#define _AVM_VERBOSITY_ELSEIF_( LEVEL ) } else if( AVM_EXEC_VERBOSITY_HAS( LEVEL ) ) {
+
+
+#define AVM_VERBOSITY_ELSE } else {
+
+#define AVM_VERBOSITY_ENDIF } ;
+
+
+/**
+ * VERBOSITY SILENT
+ */
+#define AVM_VERBOSITY_IF_IS_SILENT _AVM_VERBOSITY_IF_IS_( SILENT )
+
+#define AVM_VERBOSITY_IF_HAS_SILENT _AVM_VERBOSITY_IF_HAS_( SILENT )
+
+
+/**
+ * VERBOSITY MINIMUM
+ */
+#define AVM_VERBOSITY_IF_IS_MINIMUM _AVM_VERBOSITY_IF_IS_( MINIMUM )
+
+#define AVM_VERBOSITY_IF_HAS_MINIMUM _AVM_VERBOSITY_IF_HAS_( MINIMUM )
+
+#define AVM_OS_VERBOSITY_MINIMUM( OS ) if( AVM_EXEC_VERBOSITY_HAS( MINIMUM ) ) OS
+
+#define OS_VERBOSITY_MINIMUM_OR_DEBUG( OS ) \
+ if( AVM_DEBUG_ENABLED || AVM_EXEC_VERBOSITY_HAS( MINIMUM ) ) OS
+
+
+/**
+ * VERBOSITY MEDIUM
+ */
+#define AVM_VERBOSITY_IF_IS_MEDIUM _AVM_VERBOSITY_IF_IS_( MEDIUM )
+
+#define AVM_VERBOSITY_IF_HAS_MEDIUM _AVM_VERBOSITY_IF_HAS_( MEDIUM )
+
+#define AVM_OS_VERBOSITY_MEDIUM( OS ) if( AVM_EXEC_VERBOSITY_HAS( MEDIUM ) ) OS
+
+#define OS_VERBOSITY_MEDIUM_OR_DEBUG( OS ) \
+ if( AVM_DEBUG_ENABLED || AVM_EXEC_VERBOSITY_HAS( MEDIUM ) ) OS
+
+
+/**
+ * VERBOSITY MAXIMUM
+ */
+#define AVM_VERBOSITY_IF_IS_MAXIMUM _AVM_VERBOSITY_IF_IS_( MAXIMUM )
+
+#define AVM_VERBOSITY_IF_HAS_MAXIMUM _AVM_VERBOSITY_IF_HAS_( MAXIMUM )
+
+#define AVM_OS_VERBOSITY_MAXIMUM( OS ) if( AVM_EXEC_VERBOSITY_HAS( MAXIMUM ) ) OS
+
+#define OS_VERBOSITY_MAXIMUM_OR_DEBUG( OS ) \
+ if( AVM_DEBUG_ENABLED || AVM_EXEC_VERBOSITY_HAS( MAXIMUM ) ) OS
+
+
+/**
+ * VERBOSITY SWITCH
+ */
+#define AVM_VERBOSITY_SWITCH switch( _AVM_EXEC_VERBOSITY_ ) {
+
+#define AVM_VERBOSITY_CASE_SILENT case AVM_EXEC_VERBOSITY_SILENT : {
+
+#define AVM_VERBOSITY_CASE_MINIMUM case AVM_EXEC_VERBOSITY_MINIMUM: {
+
+#define AVM_VERBOSITY_CASE_MEDIUM case AVM_EXEC_VERBOSITY_MEDIUM : {
+
+#define AVM_VERBOSITY_CASE_MAXIMUM case AVM_EXEC_VERBOSITY_MAXIMUM: {
+
+
+#define AVM_VERBOSITY_CASE_END break; }
+
+#define AVM_VERBOSITY_SWITCH_DEFAULT AVM_VERBOSITY_CASE_END default: {
+
+#define AVM_VERBOSITY_SWITCH_END AVM_VERBOSITY_CASE_END }
+
+
+#define AVM_VERBOSITY_SWITCH_SILENT AVM_VERBOSITY_SWITCH AVM_VERBOSITY_CASE_SILENT
+
+#define AVM_VERBOSITY_SWITCH_MINIMUM AVM_VERBOSITY_SWITCH AVM_VERBOSITY_CASE_MINIMUM
+
+#define AVM_VERBOSITY_SWITCH_MEDIUM AVM_VERBOSITY_SWITCH AVM_VERBOSITY_CASE_MEDIUM
+
+#define AVM_VERBOSITY_SWITCH_MAXIMUM AVM_VERBOSITY_SWITCH AVM_VERBOSITY_CASE_MAXIMUM
+
+
+#define AVM_VERBOSITY_SWITCH_CASE_SILENT AVM_VERBOSITY_CASE_END AVM_VERBOSITY_CASE_SILENT
+
+#define AVM_VERBOSITY_SWITCH_CASE_MINIMUM AVM_VERBOSITY_CASE_END AVM_VERBOSITY_CASE_MINIMUM
+
+#define AVM_VERBOSITY_SWITCH_CASE_MEDIUM AVM_VERBOSITY_CASE_END AVM_VERBOSITY_CASE_MEDIUM
+
+#define AVM_VERBOSITY_SWITCH_CASE_MAXIMUM AVM_VERBOSITY_CASE_END AVM_VERBOSITY_CASE_MAXIMUM
+
+#define AVM_VERBOSITY_SWITCH_CASE_MAXIMUM AVM_VERBOSITY_CASE_END AVM_VERBOSITY_CASE_MAXIMUM
+
+
+
+
+/**
+ *******************************************************************************
+ * AVM GLOBAL METHOD
+ *******************************************************************************
+ */
+
+void avm_report(OutStream & os, const std::string & aMsg, bool forced = false);
+
+
+
+}
+#endif /*AVM_UTIL_H_*/
+
+
diff --git a/org.eclipse.efm.symbex/src/util/avm_vfs.cpp b/org.eclipse.efm.symbex/src/util/avm_vfs.cpp
new file mode 100644
index 0000000..a0fa0a4
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/util/avm_vfs.cpp
@@ -0,0 +1,545 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 mars 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#include "avm_vfs.h"
+
+#include <collection/Typedef.h>
+
+#include <fstream>
+
+#include <boost/filesystem.hpp>
+
+
+namespace sep
+{
+
+std::string VFS::ExecutablePath;
+
+std::string VFS::WorkflowPath;
+
+
+std::string VFS::LaunchPath;
+
+
+std::string VFS::WorkspaceRootPath;
+
+std::string VFS::WorkspaceSourcePath;
+
+std::string VFS::WorkspaceOutputPath;
+
+std::string VFS::WorkspaceLogPath;
+
+std::string VFS::WorkspaceDebugPath;
+
+std::string VFS::WorkspaceTddPath;
+
+
+std::string VFS::ProjectPath;
+
+std::string VFS::ProjectSourcePath;
+
+std::string VFS::ProjectOutputPath;
+
+std::string VFS::ProjectLogPath;
+
+std::string VFS::ProjectDebugPath;
+
+std::string VFS::ProjectTddPath;
+
+
+
+
+/**
+ * FORMAT NATIVE FILE / DIRECTORY PATH
+ */
+
+static bool is_complete(const boost::filesystem::path & aPath)
+{
+// return( aPath.is_absolute() );
+
+ if( aPath.is_complete() )
+ {
+ return( true );
+ }
+ else
+ {
+#ifdef __AVM_BOOST_WINDOWS__
+ std::string root = aPath.root_path().string();
+ return( (root.size() >= 2) &&
+ ((root[root.size()-1] == ':')
+ || (root.find(':') != std::string::npos) // "c:"
+ || ((root[0] == '/') && (root[1] == '/')) // "//share"
+ || aPath.is_complete()
+ )
+ );
+#else
+ return( aPath.is_complete() );
+#endif
+ }
+// else if( VFS::IS_WINDOWS_PLATFORM && (! aPath.empty()) )
+// {
+// std::string root = aPath.root_path().string();
+// return( (root.size() == 2) && (root[1] == ':') );
+// }
+
+ return( false );
+}
+
+
+std::string VFS::native_path(const std::string & path)
+{
+ boost::filesystem::path aPath( path );
+
+// if( not is_complete(aPath) )
+// {
+// aPath = boost::filesystem::current_path().string() +
+// "/" + aPath.string();
+// }
+ aPath.normalize();
+
+ return( aPath.string() );
+}
+
+std::string VFS::native_path(
+ const std::string & path, const std::string & main_dir)
+{
+ boost::filesystem::path aPath( path );
+
+ if( not is_complete(aPath) )
+// if( aPath.is_relative() )
+ {
+ aPath = main_dir + "/" + aPath.string();
+ aPath.normalize();
+ }
+
+ return( aPath.string() );
+}
+
+// CYGWIN
+std::string VFS::posix_path(const std::string & path)
+{
+// if( VFS::IS_CYGWYN_PLATFORM )
+#ifdef __AVM_BOOST_CYGWIN__
+ if( (path.size() > 2) && (path[1] == ':') )
+ {
+ path[0] = tolower(path[0]);
+ path[1] = '/';
+ if( (path[2] == '/') || (path[2] == '\\') )
+ {
+ path = "/cygdrive/" + path.substr(0, 2) + path.substr(3) ;
+ }
+ else
+ {
+ path = "/cygdrive/" + path;
+ }
+ }
+#endif
+
+ return( path );
+}
+
+
+/**
+ * CHECKER FOR READING / WRITING FILE / DIRECTORY PATH
+ */
+bool VFS::checkReadingFile(const std::string & path)
+{
+ try
+ {
+ boost::filesystem::path aPath( path );
+
+ return( boost::filesystem::exists(aPath) /*&&
+ boost::filesystem::is_regular_file(aPath)*/ );
+ }
+ catch( const std::exception & e )
+ {
+ AVM_OS_CERR << std::endl
+ << EMPHASIS("std::exception:>", e.what(), '*', 80);
+ }
+
+ return( false );
+}
+
+bool VFS::checkWritingFile(const std::string & path)
+{
+ std::ofstream checkFileStream(path.c_str());
+
+ return( checkFileStream.good() );
+}
+
+bool VFS::checkWritingFileFolder(const std::string & path)
+{
+ std::string::size_type pos = path.find_last_of( VFS::PathSeparator );
+
+ if( pos != std::string::npos )
+ {
+ if( not VFS::checkWritingFolder( path.substr(0, pos) ) )
+ {
+ return( false );
+ }
+ }
+
+ return( VFS::checkWritingFile( path ) );
+}
+
+
+bool VFS::checkReadingFolder(const std::string & dir_path)
+{
+ try
+ {
+ boost::filesystem::path aPath( dir_path );
+
+ return( boost::filesystem::exists(aPath) &&
+ boost::filesystem::is_directory(aPath) );
+ }
+ catch( const std::exception & e )
+ {
+ AVM_OS_CERR << std::endl
+ << EMPHASIS("std::exception:>", e.what(), '*', 80);
+ }
+
+ return( false );
+}
+
+bool VFS::checkWritingFolder(const std::string & dir_path)
+{
+ try
+ {
+ boost::filesystem::path aPath( dir_path );
+
+ boost::filesystem::create_directories( aPath );
+
+ return( true );
+ }
+ catch( const std::exception & e )
+ {
+ AVM_OS_CERR << std::endl
+ << EMPHASIS("std::exception:>", e.what(), '*', 80);
+
+ return( false );
+ }
+
+ return( false );
+}
+
+
+/**
+ * List all file
+ */
+bool VFS::listAllFiles(const std::string & dir_path,
+ std::vector< std::string > & listOfFiles, bool recursive)
+{
+ if( VFS::checkReadingFolder(dir_path) )
+ {
+ boost::filesystem::path aPath( dir_path );
+
+ boost::filesystem::directory_iterator end_itr;
+ boost::filesystem::directory_iterator itr(aPath);
+
+ for( ; itr != end_itr ; ++itr )
+ {
+ // If it's not a directory, list it.
+ // If you want to list directories too, just remove this check.
+ if( boost::filesystem::is_regular_file( itr->status() ) )
+ {
+ if( VFS::checkReadingFile( itr->path().string() ) )
+ {
+ listOfFiles.push_back( itr->path().string() );
+ }
+ }
+ else if( recursive &&
+ boost::filesystem::is_directory( itr->status() ) )
+ {
+ if( VFS::listAllFiles(itr->path().string(), listOfFiles, true) )
+ {
+ //!! continue
+ }
+ }
+ }
+
+ return( true );
+ }
+
+ return( false );
+}
+
+
+/**
+ * copy / move
+ */
+bool VFS::copyTo(
+ const std::string & srcLocation,
+ const std::string & destLocation)
+{
+ try
+ {
+ boost::filesystem::copy_file(srcLocation, destLocation,
+ boost::filesystem::copy_option::overwrite_if_exists);
+
+ return( true );
+ }
+ catch( const std::exception & e )
+ {
+ AVM_OS_WARN << std::endl << EMPHASIS(
+ "VFS::copyToFolder< std::exception >", e.what(), '*', 80);
+ }
+ catch( ... )
+ {
+ AVM_OS_WARN << std::endl << EMPHASIS(
+ "VFS::copyToFolder< unknown::exception > !!!", '*', 80 );
+ }
+
+ return( false );
+}
+
+bool VFS::copyToFolder(
+ const std::string & srcLocation,
+ const std::string & destLocation)
+{
+ try
+ {
+ boost::filesystem::path srcPath( srcLocation );
+ boost::filesystem::path destPath( destLocation );
+
+ destPath /= srcPath.filename();
+
+ boost::filesystem::copy_file(srcPath, destPath,
+ boost::filesystem::copy_option::overwrite_if_exists);
+
+ return( true );
+ }
+ catch( const std::exception & e )
+ {
+ AVM_OS_WARN << std::endl << EMPHASIS(
+ "VFS::copyToFolder< std::exception >", e.what(), '*', 80);
+ }
+ catch( ... )
+ {
+ AVM_OS_WARN << std::endl << EMPHASIS(
+ "VFS::copyToFolder< unknown::exception > !!!", '*', 80);
+ }
+
+ return( false );
+}
+
+
+bool VFS::moveTo(
+ const std::string & srcLocation,
+ const std::string & destLocation)
+{
+ try
+ {
+ if( VFS::copyTo(srcLocation, destLocation) )
+ {
+ return( boost::filesystem::remove( srcLocation ) );
+ }
+ }
+ catch( const std::exception & e )
+ {
+ AVM_OS_WARN << std::endl << EMPHASIS(
+ "VFS::moveToFolder< std::exception >", e.what(), '*', 80);
+ }
+ catch( ... )
+ {
+ AVM_OS_WARN << std::endl << EMPHASIS(
+ "VFS::moveToFolder< unknown::exception > !!!", '*', 80);
+ }
+
+ return( false );
+}
+
+bool VFS::moveToFolder(
+ const std::string & srcLocation, const std::string & destLocation)
+{
+ try
+ {
+ if( VFS::copyToFolder(srcLocation, destLocation) )
+ {
+ return( boost::filesystem::remove( srcLocation ) );
+ }
+ }
+ catch( const std::exception & e )
+ {
+ AVM_OS_WARN << std::endl << EMPHASIS(
+ "VFS::moveToFolder< std::exception >", e.what(), '*', 80);
+ }
+ catch( ... )
+ {
+ AVM_OS_WARN << std::endl << EMPHASIS(
+ "VFS::moveToFolder< unknown::exception > !!!", '*', 80);
+ }
+
+ return( false );
+}
+
+
+/**
+ * UTILS
+ */
+const char VFS::PathSeparator =
+ boost::filesystem::path::preferred_separator;
+
+
+bool VFS::isPathSeparator(char c)
+{
+ return( (c == boost::filesystem::path::preferred_separator) ||
+ (c == ('/')) || (c == ('\\')) );
+}
+
+
+std::string VFS::parent(const std::string & aLocation)
+{
+ boost::filesystem::path aPath( aLocation );
+
+ return( aPath.parent_path().string() );
+}
+
+std::string VFS::filename(const std::string & aLocation)
+{
+ boost::filesystem::path aPath( aLocation );
+
+ return( aPath.filename().string() );
+}
+
+std::string VFS::stem(const std::string & aLocation)
+{
+ boost::filesystem::path aPath( aLocation );
+
+ return( aPath.stem().string() );
+}
+
+std::string VFS::extension(const std::string & aLocation)
+{
+ boost::filesystem::path aPath( aLocation );
+
+ return( aPath.extension().string() );
+}
+
+std::string VFS::replace_extension(
+ const std::string & aLocation, const std::string & anExtension)
+{
+ boost::filesystem::path aPath( aLocation );
+
+ boost::filesystem::path newPath = aPath.replace_extension(anExtension);
+
+ return( newPath.string() );
+}
+
+
+std::string VFS::prefixFilename(const std::string & aLocation,
+ const std::string & aPrefix, const std::string & newExtension)
+{
+ boost::filesystem::path aPath( aLocation );
+
+ boost::filesystem::path newPath = aPath.parent_path();
+
+ newPath /= aPrefix + aPath.filename().string();
+
+ if( newExtension.size() > 1 )
+ {
+ newPath = newPath.replace_extension(newExtension);
+ }
+
+ return( newPath.string() );
+}
+
+std::string VFS::suffixFilename(const std::string & aLocation,
+ const std::string & aPrefix, const std::string & newExtension)
+{
+ boost::filesystem::path aPath( aLocation );
+
+ boost::filesystem::path newPath = aPath.parent_path();
+ newPath /= aPath.stem().string() + aPrefix +
+ ( (newExtension.size() > 1) ?
+ newExtension : aPath.extension().string() );
+
+ return( newPath.string() );
+}
+
+
+std::string VFS::relativePath(const std::string & refPath,
+ const std::string & aPath, const std::string & newPrefix)
+{
+ if( refPath.size() < aPath.size() )
+ {
+ std::string::size_type pos = 0;
+
+ for( ; pos < refPath.size() ; ++pos )
+ {
+ if( (refPath[pos] != aPath[pos]) &&
+ (not isPathSeparator(refPath[pos])) &&
+ (not isPathSeparator(aPath[pos])) )
+ {
+ break;
+ }
+ }
+
+ if( pos > 0 )
+ {
+ if( newPrefix.empty() )
+ {
+ while( isPathSeparator(aPath[pos]) )
+ {
+ ++pos;
+ }
+
+ return( aPath.substr(pos) );
+ }
+
+ return( newPrefix + aPath.substr(pos) );
+ }
+ }
+ else if( refPath.size() == aPath.size() )
+ {
+ return( newPrefix + "./" );
+ }
+
+ return( aPath );
+}
+
+
+
+std::string VFS::wrapPath(const std::string & aPath,
+ std::size_t wrapSize, const std::string & newPrefix)
+{
+ if( aPath.size() > wrapSize )
+ {
+ std::string::size_type posSeparator = 0;
+
+ for( std::string::size_type pos = 0 ; pos < aPath.size() ; ++pos )
+ {
+ if( isPathSeparator(aPath[pos]) )
+ {
+ posSeparator = pos;
+ if( wrapSize >= (aPath.size() - pos) )
+ {
+ break;
+ }
+ }
+ }
+
+ if( posSeparator > 0 )
+ {
+ return( newPrefix + aPath.substr(posSeparator) );
+ }
+
+ return( aPath );
+ }
+
+ return( aPath );
+}
+
+
+} /* namespace sep */
diff --git a/org.eclipse.efm.symbex/src/util/avm_vfs.h b/org.eclipse.efm.symbex/src/util/avm_vfs.h
new file mode 100644
index 0000000..0ff8629
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/util/avm_vfs.h
@@ -0,0 +1,207 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 26 mars 2015
+ *
+ * Contributors:
+ * Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
+ * - Initial API and implementation
+ ******************************************************************************/
+
+#ifndef AVM_VFS_H_
+#define AVM_VFS_H_
+
+#include <string>
+#include <vector>
+
+
+namespace sep
+{
+
+struct VFS
+{
+ /**
+ * ATTRIBUTE
+ */
+ static std::string ExecutablePath;
+
+ static std::string WorkflowPath;
+
+
+ static std::string LaunchPath;
+
+
+ static std::string WorkspaceRootPath;
+
+ static std::string WorkspaceSourcePath;
+
+ static std::string WorkspaceOutputPath;
+
+ static std::string WorkspaceLogPath;
+
+ static std::string WorkspaceDebugPath;
+
+ static std::string WorkspaceTddPath;
+
+
+ static std::string ProjectPath;
+
+ static std::string ProjectSourcePath;
+
+ static std::string ProjectOutputPath;
+
+ static std::string ProjectLogPath;
+
+ static std::string ProjectDebugPath;
+
+ static std::string ProjectTddPath;
+
+
+ /**
+ * FORMAT NATIVE FILE / DIRECTORY PATH
+ */
+ static std::string native_path(const std::string & path);
+ static std::string native_path(
+ const std::string & path, const std::string & main_dir);
+
+ static std::string posix_path(const std::string & path);
+
+
+ /**
+ * CHECKER FOR READING / WRITING FILE / DIRECTORY PATH
+ */
+ static bool checkReadingFile(const std::string & path);
+ static bool checkWritingFile(const std::string & path);
+
+ static bool checkWritingFileFolder(const std::string & path);
+
+ static bool checkReadingFolder(const std::string & dir_path);
+ static bool checkWritingFolder(const std::string & dir_path);
+
+
+ /**
+ * List all files
+ */
+ static bool listAllFiles(
+ const std::string & dir_path,
+ std::vector< std::string > & listOfFiles,
+ bool recursive = false);
+
+ /**
+ * copy / move
+ */
+ static bool copyTo(
+ const std::string & srcLocation,
+ const std::string & destLocation);
+
+ static bool copyToFolder(
+ const std::string & srcLocation,
+ const std::string & destLocation);
+
+
+ static bool moveTo(
+ const std::string & srcLocation,
+ const std::string & destLocation);
+
+ static bool moveToFolder(
+ const std::string & srcLocation,
+ const std::string & destLocation);
+
+
+ /**
+ * UTILS
+ */
+ static const char PathSeparator;
+
+ static bool isPathSeparator(char c);
+
+
+ static std::string parent(const std::string & aLocation);
+
+ static std::string filename(const std::string & aLocation);
+
+ static std::string stem(const std::string & aLocation);
+
+ inline static std::string basename(const std::string & aLocation)
+ {
+ return( stem(aLocation ) );
+ }
+
+ static std::string extension(const std::string & aLocation);
+
+ static std::string replace_extension(
+ const std::string & aLocation,
+ const std::string & newExtension);
+
+
+ static std::string prefixFilename(
+ const std::string & aLocation,
+ const std::string & aPrefix,
+ const std::string & newExtension = "");
+
+ static std::string suffixFilename(
+ const std::string & aLocation,
+ const std::string & aPrefix,
+ const std::string & newExtension = "");
+
+ static std::string relativePath(
+ const std::string & refPath,
+ const std::string & aPath,
+ const std::string & newPrefix = "");
+
+ inline static std::string relativeWorkspacePath(
+ const std::string & aPath,
+ const std::string & newPrefix = "<wroot>:")
+ {
+ return( relativePath(WorkspaceRootPath, aPath, newPrefix) );
+ }
+
+ inline static std::string relativeProjectPath(
+ const std::string & aPath,
+ const std::string & newPrefix = "<proj>:")
+ {
+ return( relativePath(ProjectPath, aPath, newPrefix) );
+ }
+
+ inline static std::string relativeProjectSourcePath(
+ const std::string & aPath,
+ const std::string & newPrefix = "<src>:")
+ {
+ return( relativePath(ProjectSourcePath, aPath, newPrefix) );
+ }
+
+ inline static std::string relativeProjectOutputPath(
+ const std::string & aPath,
+ const std::string & newPrefix = "<out>:")
+ {
+ return( relativePath(ProjectOutputPath, aPath, newPrefix) );
+ }
+
+ inline static std::string relativeLogPath(
+ const std::string & aPath,
+ const std::string & newPrefix = "<log>:")
+ {
+ return( relativePath(ProjectLogPath, aPath, newPrefix) );
+ }
+
+ inline static std::string relativeProjectTddPath(
+ const std::string & aPath,
+ const std::string & newPrefix = "<tdd>:")
+ {
+ return( relativePath(ProjectTddPath, aPath, newPrefix) );
+ }
+
+
+ static std::string wrapPath(const std::string & aPath,
+ std::size_t wrapSize, const std::string & newPrefix = "..." );
+
+};
+
+} /* namespace sep */
+
+#endif /* AVM_VFS_H_ */
diff --git a/org.eclipse.efm.symbex/src/util/confs.h.in b/org.eclipse.efm.symbex/src/util/confs.h.in
new file mode 100644
index 0000000..d207338
--- /dev/null
+++ b/org.eclipse.efm.symbex/src/util/confs.h.in
@@ -0,0 +1,34 @@
+/*
+ * version.h
+ *
+ * Created on: 8 juin 2016
+ * Author: ss219326
+ */
+
+/* Warning : this file is needed by CMake to generate confs.h
+ * Expression @..@ are variables identifiers replaced by CMake at
+ * configure time by their actual values.
+ *
+ * The resulting confs.h can be included anywhere there is a need
+ * to known the actual native types size (in bytes).
+ */
+
+#ifndef MAIN_CONFS_H_IN_
+#define MAIN_CONFS_H_IN_
+
+#include <string>
+
+using namespace std;
+
+namespace sep {
+
+const int int_size (@INT_SIZE@);
+const int short_int_size (@SHORT_INT_SIZE@);
+const int long_int_size (@LONG_INT_SIZE@);
+const int char_size (@CHAR_SIZE@);
+const string system_name ("@CMAKE_SYSTEM@-@CMAKE_SYSTEM_PROCESSOR@");
+
+} /* namespace sep */
+
+
+#endif /* MAIN_CONFS_H_IN_ */
diff --git a/org.eclipse.efm.symbex/utests/CMakeLists.txt b/org.eclipse.efm.symbex/utests/CMakeLists.txt
new file mode 100644
index 0000000..8d2d21a
--- /dev/null
+++ b/org.eclipse.efm.symbex/utests/CMakeLists.txt
@@ -0,0 +1,24 @@
+# =============================================================================
+# CMake Master File for Symbex Unit Tests
+# =============================================================================
+#
+
+# Minimum required CMake version
+cmake_minimum_required (VERSION 2.8 FATAL_ERROR)
+
+# Tell cmake where to find its own modules
+list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/utests/cmake)
+list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
+
+# Print title banner
+set (BANNER_MESSAGE "This is Symbex Unit Test")
+include (PrintBanner)
+
+# Searching for Symbex internal libraries
+# Unit tests are built against Symbex internal libraries and look for them in SYMBEX_BINARY_DIR
+# The following line suppose they have been built in builds/... (default location)
+set (SYMBEX_BINARY_DIR ${CMAKE_BINARY_DIR}/..)
+include (LookForSymbexLibs)
+
+# Project definition (directories hierarchy, main target sources, link)
+include (DefineSymbexUnitTestProject)
diff --git a/org.eclipse.efm.symbex/utests/base/CMakeLists.txt b/org.eclipse.efm.symbex/utests/base/CMakeLists.txt
new file mode 100644
index 0000000..e8b12c8
--- /dev/null
+++ b/org.eclipse.efm.symbex/utests/base/CMakeLists.txt
@@ -0,0 +1,24 @@
+# =============================================================================
+# CMake file for the Base library testing
+# =============================================================================
+
+message (STATUS "****** Defining unit tests ******")
+
+
+# Define Test runner for the base library
+file (GLOB_RECURSE T_BASE_CXX_SRC_FILES t_*.cpp t_*.h)
+
+add_executable(t_base_runner ${T_BASE_CXX_SRC_FILES})
+
+
+# Find header required to compile the test runner
+target_include_directories (t_base_runner PUBLIC ${Boost_INCLUDE_DIRS})
+target_include_directories (t_base_runner PUBLIC ../../src)
+
+# Link required librairies to the test runner
+#target_link_libraries(t_base_runner base ${Boost_LIBRARY_DIRS}/libboost_unit_test_framework-mt.a)
+target_link_libraries(t_base_runner base ${Boost_LIBRARY_DIRS}/libboost_unit_test_framework.a)
+
+# Define tests
+add_test (NAME t_InstanceCounter_all COMMAND t_base_runner --log_level=test_suite --run_test=Base/t_InstanceCounter_all)
+
diff --git a/org.eclipse.efm.symbex/utests/base/t_InstanceCounter.cpp b/org.eclipse.efm.symbex/utests/base/t_InstanceCounter.cpp
new file mode 100644
index 0000000..7b08ea8
--- /dev/null
+++ b/org.eclipse.efm.symbex/utests/base/t_InstanceCounter.cpp
@@ -0,0 +1,109 @@
+/*
+ * Unit test of InstanceCounter class
+ */
+
+
+#include <iostream>
+#include <string>
+
+#include "boost/test/unit_test.hpp"
+
+#include "printer/OutStream.h"
+#include "base/InstanceCounter.h"
+
+
+using namespace std;
+using namespace sep;
+
+
+// Local fixtures
+OutStream os(&cout);
+class A : public InstanceCounter<A> {}; // Regular case
+class B : public A {}; // To see what happens with heritage
+class C : public A, public InstanceCounter<C> {}; // To see what happens with multiple heritage
+
+
+BOOST_AUTO_TEST_SUITE(Base);
+
+BOOST_AUTO_TEST_CASE(t_InstanceCounter_all) {
+ // Due to the nature of the tested mechanism (instance counting), we are unable to create
+ // multiple independent unit test cases (as we should have been)
+ // Hence all assertions are checked within the same big test case
+
+ A::showCounters(os, "A");
+
+ // No instance created
+ BOOST_CHECK(A::INSTANCE_ALIVE == 0);
+ BOOST_CHECK(A::INSTANCE_CREATED == 0);
+
+ // Instance created as an automatic variable
+ A a1;
+ a1.showCounters(os, "A");
+ BOOST_CHECK(a1.INSTANCE_ALIVE == 1);
+ BOOST_CHECK(a1.INSTANCE_CREATED == 1);
+
+ // Instance created as an automatic variable in a subblock ...
+ {
+ A a2;
+ a2.showCounters(os, "A");
+ BOOST_CHECK(a2.INSTANCE_ALIVE == 2);
+ BOOST_CHECK(a2.INSTANCE_CREATED == 2);
+ }
+ // ... should be automatically deleted outside the block
+ a1.showCounters(os, "A");
+ BOOST_CHECK(a1.INSTANCE_ALIVE == 1);
+ BOOST_CHECK(a1.INSTANCE_CREATED == 2);
+
+ // Reference on existing instance
+ A& ra1 = a1;
+ a1.showCounters(os, "A");
+ BOOST_CHECK(ra1.INSTANCE_ALIVE == 1);
+ BOOST_CHECK(ra1.INSTANCE_CREATED == 2);
+ BOOST_CHECK(a1.INSTANCE_ALIVE == ra1.INSTANCE_ALIVE);
+ BOOST_CHECK(a1.INSTANCE_CREATED == ra1.INSTANCE_CREATED);
+
+ // Pointer on existing instance
+ A* pa1 = &a1;
+ a1.showCounters(os, "A");
+ BOOST_CHECK(pa1->INSTANCE_ALIVE == 1);
+ BOOST_CHECK(pa1->INSTANCE_CREATED == 2);
+ BOOST_CHECK(a1.INSTANCE_ALIVE == pa1->INSTANCE_ALIVE);
+ BOOST_CHECK(a1.INSTANCE_CREATED == pa1->INSTANCE_CREATED);
+
+ // Instance created on the heap ...
+ A* pa3 = new A();
+ pa3->showCounters(os, "A");
+ BOOST_CHECK(pa3->INSTANCE_ALIVE == 2);
+ BOOST_CHECK(pa3->INSTANCE_CREATED == 3);
+ // ... then deleted
+ delete pa3;
+ a1.showCounters(os, "A");
+ BOOST_CHECK(a1.INSTANCE_ALIVE == 1);
+ BOOST_CHECK(a1.INSTANCE_CREATED == 3);
+
+ // Counting mecanism should works through heritage relations
+ B b; // Remind : B is a A
+ b.showCounters(os, "B");
+ BOOST_CHECK(b.INSTANCE_ALIVE == 2);
+ BOOST_CHECK(b.INSTANCE_CREATED == 4);
+
+ // and through upcast
+ A a4 = (A) b; // Upcast changes nothing
+ a4.showCounters(os, "A");
+ BOOST_CHECK(a4.INSTANCE_ALIVE == 2);
+ BOOST_CHECK(a4.INSTANCE_CREATED == 4);
+
+ // What happens with multiple heritage
+ C c;
+ // c.showCounters(cout, "C"); // Doesn't compile due to the ambiguity of showCounters() in the multiple heritage (normal)
+ // In this case we have to choose which counter we want to query :
+ c.InstanceCounter<C>::showCounters(os, "C"); // C: 1/1
+ c.InstanceCounter<A>::showCounters(os, "A"); // A: 3/5
+ BOOST_CHECK(c.InstanceCounter<C>::INSTANCE_ALIVE == 1);
+ BOOST_CHECK(c.InstanceCounter<C>::INSTANCE_CREATED == 1);
+ BOOST_CHECK(c.InstanceCounter<A>::INSTANCE_ALIVE == 3);
+ BOOST_CHECK(c.InstanceCounter<A>::INSTANCE_CREATED == 5);
+}
+
+BOOST_AUTO_TEST_SUITE_END(); // BASE
+
diff --git a/org.eclipse.efm.symbex/utests/base/t_base_runner.cpp b/org.eclipse.efm.symbex/utests/base/t_base_runner.cpp
new file mode 100644
index 0000000..d18274b
--- /dev/null
+++ b/org.eclipse.efm.symbex/utests/base/t_base_runner.cpp
@@ -0,0 +1,7 @@
+/* Main file for test runner */
+
+#define BOOST_TEST_MAIN
+
+#include "boost/test/unit_test.hpp"
+
+/* Nothing more here, the Boost Runtime takes care of everything */
diff --git a/org.eclipse.efm.symbex/utests/cmake/DefineSymbexUnitTestProject.cmake b/org.eclipse.efm.symbex/utests/cmake/DefineSymbexUnitTestProject.cmake
new file mode 100644
index 0000000..79ff8ff
--- /dev/null
+++ b/org.eclipse.efm.symbex/utests/cmake/DefineSymbexUnitTestProject.cmake
@@ -0,0 +1,4 @@
+message (STATUS "****** Defining project******")
+
+add_subdirectory (base)
+add_subdirectory (fml) \ No newline at end of file
diff --git a/org.eclipse.efm.symbex/utests/cmake/LookForSymbexLibs.cmake b/org.eclipse.efm.symbex/utests/cmake/LookForSymbexLibs.cmake
new file mode 100644
index 0000000..f8f312c
--- /dev/null
+++ b/org.eclipse.efm.symbex/utests/cmake/LookForSymbexLibs.cmake
@@ -0,0 +1,28 @@
+
+#[[
+add_library (base STATIC IMPORTED)
+add_library (builder STATIC IMPORTED)
+add_library (collection STATIC IMPORTED)
+add_library (common STATIC IMPORTED)
+add_library (computer STATIC IMPORTED)
+add_library (fam STATIC IMPORTED)
+add_library (fml STATIC IMPORTED)
+add_library (parser STATIC IMPORTED)
+add_library (printer STATIC IMPORTED)
+add_library (sew STATIC IMPORTED)
+add_library (solver STATIC IMPORTED)
+add_library (util STATIC IMPORTED)
+
+set_property (TARGET base PROPERTY IMPORTED_LOCATION ${SYMBEX_BINARY_DIR}/base/libbase.a)
+set_property (TARGET builder PROPERTY IMPORTED_LOCATION ${SYMBEX_BINARY_DIR}/builder/libbuilder.a)
+set_property (TARGET collection PROPERTY IMPORTED_LOCATION ${SYMBEX_BINARY_DIR}/collection/libcollection.a)
+set_property (TARGET common PROPERTY IMPORTED_LOCATION ${SYMBEX_BINARY_DIR}/common/libcommon.a)
+set_property (TARGET computer PROPERTY IMPORTED_LOCATION ${SYMBEX_BINARY_DIR}/computer/libcomputer.a)
+set_property (TARGET fam PROPERTY IMPORTED_LOCATION ${SYMBEX_BINARY_DIR}/fam/libfam.a)
+set_property (TARGET fml PROPERTY IMPORTED_LOCATION ${SYMBEX_BINARY_DIR}/fml/libfml.a)
+set_property (TARGET parser PROPERTY IMPORTED_LOCATION ${SYMBEX_BINARY_DIR}/parser/libparser.a)
+set_property (TARGET printer PROPERTY IMPORTED_LOCATION ${SYMBEX_BINARY_DIR}/printer/libprinter.a)
+set_property (TARGET sew PROPERTY IMPORTED_LOCATION ${SYMBEX_BINARY_DIR}/sew/libsew.a)
+set_property (TARGET solver PROPERTY IMPORTED_LOCATION ${SYMBEX_BINARY_DIR}/solver/libsolver.a)
+set_property (TARGET util PROPERTY IMPORTED_LOCATION ${SYMBEX_BINARY_DIR}/util/libutil.a)
+#]] \ No newline at end of file
diff --git a/org.eclipse.efm.symbex/utests/fml/CMakeLists.txt b/org.eclipse.efm.symbex/utests/fml/CMakeLists.txt
new file mode 100644
index 0000000..0740788
--- /dev/null
+++ b/org.eclipse.efm.symbex/utests/fml/CMakeLists.txt
@@ -0,0 +1,30 @@
+# =============================================================================
+# CMake file for the FML library testing
+# =============================================================================
+
+
+# Define Test runner for the FML library
+file (GLOB_RECURSE T_FML_CXX_SRC_FILES t_*.cpp t_*.h)
+add_executable(t_fml_runner ${T_FML_CXX_SRC_FILES})
+
+# Find header required to compile the test runner
+target_include_directories (t_fml_runner PUBLIC ${Boost_INCLUDE_DIRS})
+target_include_directories (t_fml_runner PUBLIC ../../src)
+
+# Link required librairies to the test runner # FIXME : too much libraries and duplicates here
+target_link_libraries(t_fml_runner base fam fml sew parser fam fml fam builder sew solver computer fml common collection printer util common ${ANTLR2_LIBRARIES} ${ANTLR3_LIBRARIES} ${Boost_LIBRARIES} ${CVC4_LIBRARIES} ${lib_gmp_c} ${lib_gmp_cxx})
+
+# Define tests
+list (APPEND TEST_NAMES t_integer_ctor t_integer_big t_integer_maxuint t_integer_maxlong t_integer_10pow123)
+list (APPEND TEST_NAMES t_rational_ctor t_rational_big t_rational_maxuint t_rational_maxlong t_rational_decimal_big)
+list (APPEND TEST_NAMES t_float_ctor t_float_big t_float_maxuint t_float_maxlong)
+list (APPEND TEST_NAMES t_numeric_ctor t_numeric_ctor_decimal_excp t_numeric_ctor_decimal t_numeric_ctor_frac t_numeric_frac_simplif)
+
+# tests on optional libraries that are not yet integrated into diversity install process
+#list (APPEND TEST NAMES t_ginac_expression_printing t_ginac_expression_not_or_substitution t_ginac_expression_not_and_substitution t_ginac_expression_and_or_composition_equivalence)
+#list (APPEND TEST NAMES t_yices_expression_printing)
+
+foreach (TEST_NAME ${TEST_NAMES})
+ add_test (NAME ${TEST_NAME} COMMAND t_fml_runner --log_level=test_suite --run_test=FML/${TEST_NAME} )
+endforeach()
+
diff --git a/org.eclipse.efm.symbex/utests/fml/t_ExpressionConstructor.cpp b/org.eclipse.efm.symbex/utests/fml/t_ExpressionConstructor.cpp
new file mode 100644
index 0000000..ac6e445
--- /dev/null
+++ b/org.eclipse.efm.symbex/utests/fml/t_ExpressionConstructor.cpp
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 23 juin 2016
+ *
+ * Contributors:
+ * Stephane Salmons (CEA LIST) stephane.salmons@gmail.com
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#include "boost/test/unit_test.hpp"
+
+
+#include <fml/expression/ExpressionConstructor.h>
+
+
+using namespace std;
+using namespace sep;
+
+BOOST_AUTO_TEST_SUITE (FML);
+
+BOOST_AUTO_TEST_CASE (t_exprctor_newinteger) {
+ BOOST_CHECK_MESSAGE ("512" == ExpressionConstructor::newExprInteger("512").str(), "newExprInteger(512) != 512");
+}
+
+
+BOOST_AUTO_TEST_CASE (t_exprctor_newinteger_decimal_excp) {
+ BOOST_CHECK_MESSAGE ("5" == ExpressionConstructor::newExprInteger("5.12").str(), "newExprInteger(5.12) != 5");
+}
+
+BOOST_AUTO_TEST_CASE (t_exprctor_newinteger_NULL) {
+ BOOST_CHECK_MESSAGE ("0" == ExpressionConstructor::newExprInteger(NULL).str(), "newExprInteger(NULL) != 0");
+}
+
+
+BOOST_AUTO_TEST_CASE (t_exprctor_newrational_dec2frac) {
+ BOOST_CHECK_MESSAGE ("128/25" == ExpressionConstructor::newExprRational("5.12").str(), "newExprRational(5.12) != 128/25");
+}
+
+BOOST_AUTO_TEST_CASE (t_exprctor_newrational_dec2dec) {
+ BOOST_CHECK_MESSAGE ("5.12" == ExpressionConstructor::newExprRational("5.12").str(), "newExprRational(5.12) !=5.12");
+}
+
+
+BOOST_AUTO_TEST_SUITE_END(); // FML
diff --git a/org.eclipse.efm.symbex/utests/fml/t_Float.cpp b/org.eclipse.efm.symbex/utests/fml/t_Float.cpp
new file mode 100644
index 0000000..1d1edd6
--- /dev/null
+++ b/org.eclipse.efm.symbex/utests/fml/t_Float.cpp
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 23 juin 2016
+ *
+ * Contributors:
+ * Stephane Salmons (CEA LIST) stephane.salmons@gmail.com
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#include <iostream>
+
+#include "boost/test/unit_test.hpp"
+
+#include "fml/numeric/Float.h"
+#include "util/avm_numeric.h"
+
+using namespace std;
+using namespace sep;
+
+
+BOOST_AUTO_TEST_SUITE (FML);
+
+BOOST_AUTO_TEST_CASE (t_float_ctor) {
+ Float F("123456789123456789123456789123456789");
+}
+
+BOOST_AUTO_TEST_CASE (t_float_big) {
+ Float F("123456789123456789123456789123456789");
+ BOOST_CHECK_MESSAGE("123456789123456789123456789123456789" == F.str(), F.str() << " is not " << "123456789123456789123456789123456789");
+ BOOST_CHECK (! F.isInt32());
+ BOOST_CHECK (! F.isInt64());
+ BOOST_CHECK (! F.isInteger());
+ BOOST_CHECK (! F.isPosInteger());
+}
+
+BOOST_AUTO_TEST_CASE (t_float_maxuint) {
+ Float F(AVM_NUMERIC_MAX_UINT);
+ BOOST_CHECK ( F.isInt32());
+ BOOST_CHECK ( F.isInt64());
+ BOOST_CHECK ( F.isInteger());
+ BOOST_CHECK (! F.isPosInteger());
+}
+
+BOOST_AUTO_TEST_CASE (t_float_maxlong) {
+ Float F(AVM_NUMERIC_MAX_LONG);
+ BOOST_CHECK ( F.isInt32());
+ BOOST_CHECK ( F.isInt64());
+ BOOST_CHECK ( F.isInteger());
+ BOOST_CHECK ( F.isPosInteger());
+}
+
+BOOST_AUTO_TEST_SUITE_END(); // FML
diff --git a/org.eclipse.efm.symbex/utests/fml/t_Integer.cpp b/org.eclipse.efm.symbex/utests/fml/t_Integer.cpp
new file mode 100644
index 0000000..3826df1
--- /dev/null
+++ b/org.eclipse.efm.symbex/utests/fml/t_Integer.cpp
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 20 juin 2016
+ *
+ * Contributors:
+ * Stephane Salmons (CEA LIST) stephane.salmons@gmail.com
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#include <iostream>
+
+#include "boost/test/unit_test.hpp"
+
+
+#include "fml/numeric/Integer.h"
+#include "util/avm_numeric.h"
+
+using namespace std;
+using namespace sep;
+
+
+
+
+BOOST_AUTO_TEST_SUITE (FML);
+
+BOOST_AUTO_TEST_CASE (t_integer_ctor) {Integer N("123456789123456789123456789123456789") ;}
+
+BOOST_AUTO_TEST_CASE (t_integer_big) {
+ Integer N("123456789123456789123456789123456789");
+ BOOST_CHECK_MESSAGE ("123456789123456789123456789123456789" == N.str(), "string conversion error");
+ BOOST_CHECK_MESSAGE (! N.isInt32(), "is Int32");
+ BOOST_CHECK_MESSAGE (! N.isInt64(), "is Int64");
+ BOOST_CHECK_MESSAGE (! N.isInteger(), "is Integer" );
+ BOOST_CHECK_MESSAGE (! N.isPosInteger(), "is PosInteger");
+}
+
+BOOST_AUTO_TEST_CASE (t_integer_maxuint) {
+ Integer N(AVM_NUMERIC_MAX_UINT);
+ BOOST_CHECK_MESSAGE (! N.isInt32(), "is Int32");
+ BOOST_CHECK_MESSAGE (! N.isInt64(), "is Int64");
+ BOOST_CHECK_MESSAGE (! N.isInteger(), "is Integer");
+ BOOST_CHECK_MESSAGE ( N.isPosInteger(), "is not PosInteger");
+}
+
+BOOST_AUTO_TEST_CASE (t_integer_maxlong) {
+ Integer N(AVM_NUMERIC_MAX_LONG);
+ BOOST_CHECK_MESSAGE ( N.isInt32(), "is not Int32");
+ BOOST_CHECK_MESSAGE ( N.isInt64(), "is not Int64");
+ BOOST_CHECK_MESSAGE ( N.isInteger(), "is not Integer");
+ BOOST_CHECK_MESSAGE ( N.isPosInteger(), "is not PosInteger");
+}
+
+BOOST_AUTO_TEST_CASE (t_integer_10pow123) {
+ string computed(Integer::pow(10, 123).str());
+ string expected("1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
+ BOOST_CHECK_MESSAGE (computed == expected, "pow(10,123) not equals its decimal representation");
+}
+
+
+BOOST_AUTO_TEST_SUITE_END(); // FML
diff --git a/org.eclipse.efm.symbex/utests/fml/t_Numeric.cpp b/org.eclipse.efm.symbex/utests/fml/t_Numeric.cpp
new file mode 100644
index 0000000..f42ac4c
--- /dev/null
+++ b/org.eclipse.efm.symbex/utests/fml/t_Numeric.cpp
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 23 juin 2016
+ *
+ * Contributors:
+ * Stephane Salmons (CEA LIST) stephane.salmons@gmail.com
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#include "boost/test/unit_test.hpp"
+
+
+#include <fml/numeric/Numeric.h>
+
+
+using namespace std;
+using namespace sep;
+
+
+BOOST_AUTO_TEST_SUITE (FML);
+
+BOOST_AUTO_TEST_CASE (t_numeric_ctor) {
+ Numeric N("512");
+ BOOST_CHECK ("512" == N.str());
+}
+
+BOOST_AUTO_TEST_CASE (t_numeric_ctor_decimal_excp) {
+ Numeric N("5.12");
+}
+
+BOOST_AUTO_TEST_CASE (t_numeric_ctor_decimal) {
+ Numeric N("5.12");
+ BOOST_CHECK ("5.12" == N.str());
+
+}
+
+BOOST_AUTO_TEST_CASE (t_numeric_ctor_frac) {
+ Numeric N("5/12");
+ BOOST_CHECK ("5/12" == N.str());
+}
+
+BOOST_AUTO_TEST_CASE (t_numeric_frac_simplif) {
+ Numeric N("512/100");
+ BOOST_CHECK ("128/25" == N.str());
+}
+
+BOOST_AUTO_TEST_SUITE_END(); // FML
diff --git a/org.eclipse.efm.symbex/utests/fml/t_Rational.cpp b/org.eclipse.efm.symbex/utests/fml/t_Rational.cpp
new file mode 100644
index 0000000..ebfb6d5
--- /dev/null
+++ b/org.eclipse.efm.symbex/utests/fml/t_Rational.cpp
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 22 juin 2016
+ *
+ * Contributors:
+ * Stephane Salmons (CEA LIST) stephane.salmons@gmail.com
+ * - Initial API and Implementation
+ ******************************************************************************/
+
+#include <iostream>
+
+#include "boost/test/unit_test.hpp"
+
+#include "fml/numeric/Rational.h"
+#include "util/avm_numeric.h"
+
+using namespace std;
+using namespace sep;
+
+
+BOOST_AUTO_TEST_SUITE (FML);
+
+BOOST_AUTO_TEST_CASE (t_rational_ctor) {
+ Rational R("123456789123456789123456789123456789/3");
+ Rational S("123456789123456789123456789.123456788");
+}
+
+BOOST_AUTO_TEST_CASE (t_rational_big) {
+ Rational R("123456789123456789123456789123456789/3");
+ BOOST_CHECK_MESSAGE ("41152263041152263041152263041152263" == R.str(), "str conversion failed");
+ BOOST_CHECK_MESSAGE (! R.isInt32(), "is Int32");
+ BOOST_CHECK_MESSAGE (! R.isInt64(), "is Int64");
+ BOOST_CHECK_MESSAGE (! R.isInteger(), "is Integer");
+ BOOST_CHECK_MESSAGE (! R.isPosInteger(), "is PosInteger");
+}
+
+BOOST_AUTO_TEST_CASE (t_rational_maxuint) {
+ Rational R(AVM_NUMERIC_MAX_UINT);
+ BOOST_CHECK_MESSAGE (! R.isInt32(),"is Int32");
+ BOOST_CHECK_MESSAGE ( R.isInt64(), "is not Int64");
+ BOOST_CHECK_MESSAGE ( R.isInteger(), "is not Integer");
+ BOOST_CHECK_MESSAGE ( R.isPosInteger(), "is not PosInteger");
+}
+
+BOOST_AUTO_TEST_CASE (t_rational_maxlong) {
+ Rational R(AVM_NUMERIC_MAX_LONG);
+ BOOST_CHECK_MESSAGE ( R.isInt32(),"is not Int32");
+ BOOST_CHECK_MESSAGE ( R.isInt64(), "is not Int64");
+ BOOST_CHECK_MESSAGE ( R.isInteger(), "is not Integer");
+ BOOST_CHECK_MESSAGE ( R.isPosInteger(), "is not PosInteger");
+}
+
+BOOST_AUTO_TEST_CASE (t_rational_decimal_big) {
+ Rational S("123456789123456789123456789.123456788");
+ BOOST_CHECK_MESSAGE ("30864197280864197280864197280864197/250000000" == S.str(), "Rational(123456789123456789123456789.123456788) != 30864197280864197280864197280864197/250000000");
+ BOOST_CHECK_MESSAGE (! S.isInt32(), "is Int32");
+ BOOST_CHECK_MESSAGE (! S.isInt64(), "is Int64");
+ BOOST_CHECK_MESSAGE (! S.isInteger(), "is Integer");
+ BOOST_CHECK_MESSAGE (! S.isPosInteger(), "is PosInteger");
+}
+
+BOOST_AUTO_TEST_SUITE_END(); // FML
diff --git a/org.eclipse.efm.symbex/utests/fml/t_fml_runner.cpp b/org.eclipse.efm.symbex/utests/fml/t_fml_runner.cpp
new file mode 100644
index 0000000..44bbe8e
--- /dev/null
+++ b/org.eclipse.efm.symbex/utests/fml/t_fml_runner.cpp
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 22 juin 2016
+ *
+ * Contributors:
+ * Stephane Salmons (CEA LIST) stephane.salmons@gmail.com
+ * - Initial API and Implementation
+ ******************************************************************************/
+/* Main file for test runner */
+
+#define BOOST_TEST_MAIN
+
+#include "boost/test/unit_test.hpp"
+
+/* Nothing more here, the Boost Runtime takes care of everything */
diff --git a/org.eclipse.efm.symbex/utests/fml/t_solver_ginac.cpp b/org.eclipse.efm.symbex/utests/fml/t_solver_ginac.cpp
new file mode 100644
index 0000000..bebcd00
--- /dev/null
+++ b/org.eclipse.efm.symbex/utests/fml/t_solver_ginac.cpp
@@ -0,0 +1,167 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 06 july 2016
+ *
+ * Contributors:
+ * Stephane Salmons (CEA LIST) stephane.salmons@gmail.com
+ * - Initial API and Implementation
+ ******************************************************************************/
+/*
+* GiNaC is a C++ library.
+* GiNaC is an iterated and recursive acronym for GiNaC is Not a CAS,
+* where CAS stands for Computer Algebra System.
+* It is designed to allow the creation of integrated systems that
+* embed symbolic manipulations together with more established areas of
+* computer science
+* http://www.ginac.de/
+*
+*/
+
+
+
+
+/*
+
+test on optional library that is not yet integrated into diversity install process
+
+
+* /
+
+
+
+
+/*
+#include "boost/test/unit_test.hpp"
+
+
+#include <fml/symbol/Symbol.h>
+
+#include <ginac/ginac.h>
+#include <compat/model/ginac_expression/ExpressionGinac.h>
+#include <compat/model/ginac_expression/GinacAnd.h>
+#include <compat/model/ginac_expression/GinacForm.h>
+#include <compat/model/ginac_expression/GinacNot.h>
+#include <compat/model/ginac_expression/GinacOr.h>
+#include <compat/model/ginac_expression/GinacRelational.h>
+#include <compat/model/ginac_expression/GinacSimplifier.h>
+
+
+
+
+//using namespace std;
+using namespace sep;
+
+BOOST_AUTO_TEST_SUITE(FML);
+
+BOOST_AUTO_TEST_CASE(t_ginac_expression_printing) {
+
+ GiNaC::symbol x("x"), y("y"), z("z");
+
+ GiNaC::ex expression = GiNaC::sin(x + 2 / (y / x)) + 3 / z + 41;
+
+ // check ginac expression
+ std::string expected = "41+sin(x+2*y)+3*z";
+ BOOST_CHECK_MESSAGE(expression.str() == expected, "got : " << expression.str() << " expected " << expected);
+
+ // checks addition on ginac expression ?
+ expected = "42+sin(x+2*y)+3*z";
+ BOOST_CHECK_MESSAGE((expression + 1).str() == expected, "got : " << (expression + 1).str() << " expected " << expected);
+
+ // checks foo.subs
+ expected = "41+sin(2+2*y)+3*z";
+ BOOST_CHECK_MESSAGE((expression.subs(x == 2)).str() == expected, "got : " << (expression.subs(x == 2)).str() << " expected " << expected);
+
+ // ensure no effect of foo.subs on foo value
+ expected = "41+sin(x+2*y)+3*z";
+ BOOST_CHECK_MESSAGE(expression.str() == expected, "got : " << expression.str() << " expected " << expected);
+}
+
+
+BOOST_AUTO_TEST_CASE(t_ginac_expression_not_or_substitution) {
+
+ GiNaC::symbol x("x"), y("y");
+ GiNaC::ex expression;
+ GiNaC::ex expected;
+
+ expression = ginac_or(x, y).subs(x == GinacFactory::_TRUE_);
+ expected = GinacFactory::_TRUE_;
+ BOOST_CHECK_MESSAGE(expression == expected, expression.str());
+
+ expression = ginac_or(x, y).subs(x == GinacFactory::_FALSE_);
+ expected = y;
+ BOOST_CHECK_MESSAGE(expression == expected, expression.str());
+
+ expression = ginac_or(ginac_not(x), y).subs(x == GinacFactory::_TRUE_);
+ expected = y;
+ BOOST_CHECK_MESSAGE(expression == expected, expression.str());
+
+ expression = ginac_or(ginac_not(x), y).subs(x == GinacFactory::_FALSE_);
+ expected = GinacFactory::_TRUE_;
+ BOOST_CHECK_MESSAGE(expression == expected, expression.str());
+}
+
+BOOST_AUTO_TEST_CASE(t_ginac_expression_not_and_substitution) {
+
+ GiNaC::symbol x("x"), y("y");
+ GiNaC::ex expression;
+ GiNaC::ex expected;
+
+ expression = ginac_and(x, y).subs(x == GinacFactory::_TRUE_);
+ expected = y;
+ BOOST_CHECK_MESSAGE(expression == expected, expression.str());
+
+ expression = ginac_and(x, y).subs(x == GinacFactory::_FALSE_);
+ expected = GinacFactory::_FALSE_;
+ BOOST_CHECK_MESSAGE(expression == expected, expression.str());
+
+ expression = ginac_and(ginac_not(x), y).subs(x == GinacFactory::_TRUE_);
+ expected = GinacFactory::_FALSE_;
+ BOOST_CHECK_MESSAGE(expression == expected, expression.str());
+
+ expression = ginac_and(ginac_not(x), y).subs(x == GinacFactory::_FALSE_);
+ expected = y;
+ BOOST_CHECK_MESSAGE(expression == expected, expression.str());
+}
+
+BOOST_AUTO_TEST_CASE(t_ginac_expression_and_or_composition_equivalence) {
+
+ GiNaC::symbol x("x"), y("y"), z("z");
+ GiNaC::ex expression;
+ GiNaC::ex equivalent;
+
+ expression = ginac_and(x, ginac_or(x, y));
+ equivalent = ginac_or(x, ginac_and(x, y));
+ BOOST_CHECK_MESSAGE(expression == equivalent, expression.str());
+
+ expression = ginac_and(x, ginac_or(x, y), z);
+ equivalent = ginac_and(ginac_or(x, ginac_and(x, y)), z);
+ BOOST_CHECK_MESSAGE(expression == equivalent, expression.str());
+
+ expression = ginac_and(x, ginac_or(ginac_not(x), y));
+ equivalent = ginac_and(x, y);
+ BOOST_CHECK_MESSAGE(expression == equivalent, expression.str());
+
+ expression = ginac_and(x, ginac_or(ginac_not(x), y), z);
+ equivalent = ginac_and(x, y, z);
+ BOOST_CHECK_MESSAGE(expression == equivalent, expression.str());
+
+ expression = ginac_and(ginac_not(x), ginac_or(ginac_not(x), y));
+ equivalent = ginac_and(ginac_not(x), y);
+ BOOST_CHECK_MESSAGE(expression == equivalent, expression.str());
+
+ expression = ginac_and(ginac_not(x), ginac_or(ginac_not(x), y), z);
+ equivalent = ginac_and(ginac_not(x), y, z);
+ BOOST_CHECK_MESSAGE(expression == equivalent, expression.str());
+}
+
+BOOST_AUTO_TEST_SUITE_END(); // FML
+
+
+
+*/
diff --git a/org.eclipse.efm.symbex/utests/fml/t_solver_yices.cpp b/org.eclipse.efm.symbex/utests/fml/t_solver_yices.cpp
new file mode 100644
index 0000000..e9edd56
--- /dev/null
+++ b/org.eclipse.efm.symbex/utests/fml/t_solver_yices.cpp
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Created on: 06 july 2016
+ *
+ * Contributors:
+ * Stephane Salmons (CEA LIST) stephane.salmons@gmail.com
+ * - Initial API and Implementation
+ ******************************************************************************/
+/*
+* Yices 2 is an SMT solver that decides the satisfiability of
+* formulas containing uninterpreted function symbols with equality,
+* linear real and integer arithmetic, bitvectors, scalar types, and tuples.
+* http://yices.csl.sri.com/
+*
+*/
+
+
+/*
+
+test on optional library that is not yet integrated into diversity install process
+
+
+* /
+
+
+
+/*
+#include "boost/test/unit_test.hpp"
+
+#include <common/BF.h>
+
+#include <fml/expression/ExpressionConstructor.h>
+#include <fml/executable/InstanceOfData.h>
+
+#include <fml/type/TypeManager.h>
+
+#include <compat/model/xbed/XBED.h>
+
+#include <yices2/yices.h>
+
+
+using namespace std;
+using namespace sep;
+
+BOOST_AUTO_TEST_SUITE(FML);
+
+BOOST_AUTO_TEST_CASE(t_yices_expression_printing) {
+
+ BOOST_CHECK_MESSAGE(true, "yices dummy test");
+}
+
+BOOST_AUTO_TEST_SUITE_END(); // FML
+
+
+*/
diff --git a/org.eclipse.efm.symbex/utests/to_migrate/to_migrate.zip b/org.eclipse.efm.symbex/utests/to_migrate/to_migrate.zip
new file mode 100644
index 0000000..7ea849f
--- /dev/null
+++ b/org.eclipse.efm.symbex/utests/to_migrate/to_migrate.zip
Binary files differ

Back to the top